aboutsummaryrefslogtreecommitdiff
path: root/mesalib
diff options
context:
space:
mode:
Diffstat (limited to 'mesalib')
-rw-r--r--mesalib/bin/extract_git_sha140
-rw-r--r--mesalib/common.py184
-rw-r--r--mesalib/configs/linux-dri146
-rw-r--r--mesalib/docs/GL3.txt238
-rw-r--r--mesalib/docs/MESA_drm_image.spec306
-rw-r--r--mesalib/docs/README.WIN32102
-rw-r--r--mesalib/docs/WL_bind_wayland_display.spec184
-rw-r--r--mesalib/docs/download.html206
-rw-r--r--mesalib/docs/envvars.html328
-rw-r--r--mesalib/docs/install.html690
-rw-r--r--mesalib/docs/news.html2652
-rw-r--r--mesalib/docs/relnotes.html178
-rw-r--r--mesalib/include/GL/glu.h706
-rw-r--r--mesalib/include/GL/internal/dri_interface.h1778
-rw-r--r--mesalib/include/getopt.h128
-rw-r--r--mesalib/scons/custom.py344
-rw-r--r--mesalib/scons/gallium.py1248
-rw-r--r--mesalib/src/SConscript66
-rw-r--r--mesalib/src/gallium/auxiliary/util/u_math.h1288
-rw-r--r--mesalib/src/gallium/auxiliary/util/u_vbuf_mgr.c1300
-rw-r--r--mesalib/src/glsl/ast.h4
-rw-r--r--mesalib/src/glsl/ast_expr.cpp190
-rw-r--r--mesalib/src/glsl/ast_function.cpp2590
-rw-r--r--mesalib/src/glsl/ast_to_hir.cpp7018
-rw-r--r--mesalib/src/glsl/ast_type.cpp276
-rw-r--r--mesalib/src/glsl/builtin_types.h604
-rw-r--r--mesalib/src/glsl/doflexbison.bat21
-rw-r--r--mesalib/src/glsl/getopt.cpp552
-rw-r--r--mesalib/src/glsl/glcpp/glcpp-parse.y3808
-rw-r--r--mesalib/src/glsl/glcpp/glcpp.c8
-rw-r--r--mesalib/src/glsl/glsl_parser_extras.cpp1696
-rw-r--r--mesalib/src/glsl/glsl_parser_extras.h570
-rw-r--r--mesalib/src/glsl/glsl_symbol_table.cpp334
-rw-r--r--mesalib/src/glsl/glsl_symbol_table.h5
-rw-r--r--mesalib/src/glsl/glsl_types.cpp1018
-rw-r--r--mesalib/src/glsl/hir_field_selection.cpp204
-rw-r--r--mesalib/src/glsl/ir.cpp3144
-rw-r--r--mesalib/src/glsl/ir.h3332
-rw-r--r--mesalib/src/glsl/ir_clone.cpp864
-rw-r--r--mesalib/src/glsl/ir_constant_expression.cpp2744
-rw-r--r--mesalib/src/glsl/ir_import_prototypes.cpp244
-rw-r--r--mesalib/src/glsl/ir_print_visitor.cpp1030
-rw-r--r--mesalib/src/glsl/ir_print_visitor.h188
-rw-r--r--mesalib/src/glsl/ir_validate.cpp1154
-rw-r--r--mesalib/src/glsl/ir_variable.cpp1714
-rw-r--r--mesalib/src/glsl/link_functions.cpp544
-rw-r--r--mesalib/src/glsl/linker.cpp3444
-rw-r--r--mesalib/src/glsl/list.h8
-rw-r--r--mesalib/src/glsl/loop_controls.cpp608
-rw-r--r--mesalib/src/glsl/lower_mat_op_to_vec.cpp980
-rw-r--r--mesalib/src/glsl/main.cpp679
-rw-r--r--mesalib/src/glsl/opt_constant_propagation.cpp868
-rw-r--r--mesalib/src/glsl/opt_constant_variable.cpp390
-rw-r--r--mesalib/src/glsl/opt_copy_propagation_elements.cpp934
-rw-r--r--mesalib/src/glsl/opt_dead_code.cpp284
-rw-r--r--mesalib/src/glsl/opt_dead_code_local.cpp444
-rw-r--r--mesalib/src/glsl/opt_function_inlining.cpp844
-rw-r--r--mesalib/src/glsl/opt_swizzle_swizzle.cpp186
-rw-r--r--mesalib/src/glsl/opt_tree_grafting.cpp736
-rw-r--r--mesalib/src/glsl/s_expression.cpp366
-rw-r--r--mesalib/src/glu/sgi/include/gluos.h160
-rw-r--r--mesalib/src/glu/sgi/libutil/mipmap.c17880
-rw-r--r--mesalib/src/mapi/glapi/gen/GL3x.xml1178
-rw-r--r--mesalib/src/mapi/glapi/gen/Makefile462
-rw-r--r--mesalib/src/mapi/glapi/gen/gen.bat20
-rw-r--r--mesalib/src/mapi/glapi/gen/gl_API.xml25080
-rw-r--r--mesalib/src/mapi/glapi/gen/gl_XML.py1934
-rw-r--r--mesalib/src/mapi/glapi/gen/gl_table.py3
-rw-r--r--mesalib/src/mapi/glapi/glapi.h106
-rw-r--r--mesalib/src/mapi/glapi/glapi_getproc.c11
-rw-r--r--mesalib/src/mapi/glapi/glapi_mapi_tmp.h27112
-rw-r--r--mesalib/src/mapi/glapi/glapi_nop.c4
-rw-r--r--mesalib/src/mapi/glapi/glapi_sparc.S3120
-rw-r--r--mesalib/src/mapi/glapi/glapi_x86-64.S71294
-rw-r--r--mesalib/src/mapi/glapi/glapi_x86.S2950
-rw-r--r--mesalib/src/mapi/glapi/glapitable.h1946
-rw-r--r--mesalib/src/mapi/glapi/glapitemp.h16224
-rw-r--r--mesalib/src/mapi/glapi/glprocs.h5494
-rw-r--r--mesalib/src/mapi/glapi/glthread.c2
-rw-r--r--mesalib/src/mapi/mapi/u_current.c532
-rw-r--r--mesalib/src/mapi/mapi/u_thread.c498
-rw-r--r--mesalib/src/mapi/mapi/u_thread.h402
-rw-r--r--mesalib/src/mesa/SConscript962
-rw-r--r--mesalib/src/mesa/drivers/common/driverfuncs.c664
-rw-r--r--mesalib/src/mesa/drivers/dri/Makefile.template222
-rw-r--r--mesalib/src/mesa/drivers/dri/common/dri_util.c2060
-rw-r--r--mesalib/src/mesa/drivers/dri/common/dri_util.h1126
-rw-r--r--mesalib/src/mesa/drivers/dri/common/spantmp2.h1832
-rw-r--r--mesalib/src/mesa/drivers/dri/common/texmem.c2684
-rw-r--r--mesalib/src/mesa/drivers/dri/common/utils.c2
-rw-r--r--mesalib/src/mesa/drivers/dri/swrast/swrast.c1617
-rw-r--r--mesalib/src/mesa/drivers/dri/swrast/swrast_priv.h7
-rw-r--r--mesalib/src/mesa/drivers/windows/gdi/mesa.def1712
-rw-r--r--mesalib/src/mesa/drivers/windows/gdi/wgl.c1414
-rw-r--r--mesalib/src/mesa/drivers/windows/gdi/wmesa.c3316
-rw-r--r--mesalib/src/mesa/drivers/windows/gdi/wmesadef.h86
-rw-r--r--mesalib/src/mesa/drivers/windows/gldirect/dglcontext.c4424
-rw-r--r--mesalib/src/mesa/main/api_arrayelt.c3420
-rw-r--r--mesalib/src/mesa/main/api_exec.c1502
-rw-r--r--mesalib/src/mesa/main/attrib.c3126
-rw-r--r--mesalib/src/mesa/main/bufferobj.c14
-rw-r--r--mesalib/src/mesa/main/bufferobj.h298
-rw-r--r--mesalib/src/mesa/main/clear.c1150
-rw-r--r--mesalib/src/mesa/main/colortab.c1672
-rw-r--r--mesalib/src/mesa/main/compiler.h1010
-rw-r--r--mesalib/src/mesa/main/context.c3784
-rw-r--r--mesalib/src/mesa/main/context.h578
-rw-r--r--mesalib/src/mesa/main/convolve.c410
-rw-r--r--mesalib/src/mesa/main/dd.h2400
-rw-r--r--mesalib/src/mesa/main/debug.h188
-rw-r--r--mesalib/src/mesa/main/depth.c348
-rw-r--r--mesalib/src/mesa/main/depthstencil.c1670
-rw-r--r--mesalib/src/mesa/main/dlist.c20822
-rw-r--r--mesalib/src/mesa/main/dlopen.c6
-rw-r--r--mesalib/src/mesa/main/drawpix.c604
-rw-r--r--mesalib/src/mesa/main/enable.c2856
-rw-r--r--mesalib/src/mesa/main/enums.c12680
-rw-r--r--mesalib/src/mesa/main/eval.c2182
-rw-r--r--mesalib/src/mesa/main/fbobject.c5074
-rw-r--r--mesalib/src/mesa/main/ff_fragment_shader.cpp3236
-rw-r--r--mesalib/src/mesa/main/fog.c408
-rw-r--r--mesalib/src/mesa/main/framebuffer.c2194
-rw-r--r--mesalib/src/mesa/main/get.c5240
-rw-r--r--mesalib/src/mesa/main/get.h162
-rw-r--r--mesalib/src/mesa/main/getstring.c540
-rw-r--r--mesalib/src/mesa/main/glheader.h334
-rw-r--r--mesalib/src/mesa/main/hint.c294
-rw-r--r--mesalib/src/mesa/main/histogram.c346
-rw-r--r--mesalib/src/mesa/main/imports.h1242
-rw-r--r--mesalib/src/mesa/main/lines.c234
-rw-r--r--mesalib/src/mesa/main/macros.h1450
-rw-r--r--mesalib/src/mesa/main/mfeatures.h292
-rw-r--r--mesalib/src/mesa/main/mtypes.h6848
-rw-r--r--mesalib/src/mesa/main/pack.c10386
-rw-r--r--mesalib/src/mesa/main/pbo.c784
-rw-r--r--mesalib/src/mesa/main/pbo.h186
-rw-r--r--mesalib/src/mesa/main/pixel.c1462
-rw-r--r--mesalib/src/mesa/main/polygon.c660
-rw-r--r--mesalib/src/mesa/main/polygon.h140
-rw-r--r--mesalib/src/mesa/main/queryobj.c10
-rw-r--r--mesalib/src/mesa/main/readpix.c514
-rw-r--r--mesalib/src/mesa/main/readpix.h94
-rw-r--r--mesalib/src/mesa/main/remap_helper.h13612
-rw-r--r--mesalib/src/mesa/main/renderbuffer.c5184
-rw-r--r--mesalib/src/mesa/main/renderbuffer.h230
-rw-r--r--mesalib/src/mesa/main/samplerobj.c2826
-rw-r--r--mesalib/src/mesa/main/samplerobj.h124
-rw-r--r--mesalib/src/mesa/main/shaderapi.c3876
-rw-r--r--mesalib/src/mesa/main/shared.c840
-rw-r--r--mesalib/src/mesa/main/shared.h78
-rw-r--r--mesalib/src/mesa/main/state.c1486
-rw-r--r--mesalib/src/mesa/main/stencil.c1228
-rw-r--r--mesalib/src/mesa/main/syncobj.c12
-rw-r--r--mesalib/src/mesa/main/syncobj.h12
-rw-r--r--mesalib/src/mesa/main/texcompress.c576
-rw-r--r--mesalib/src/mesa/main/texcompress_rgtc.h154
-rw-r--r--mesalib/src/mesa/main/texcompress_rgtc_tmp.h836
-rw-r--r--mesalib/src/mesa/main/texcompress_s3tc.c1120
-rw-r--r--mesalib/src/mesa/main/texenv.c2086
-rw-r--r--mesalib/src/mesa/main/texgetimage.h130
-rw-r--r--mesalib/src/mesa/main/teximage.c7698
-rw-r--r--mesalib/src/mesa/main/texobj.c2558
-rw-r--r--mesalib/src/mesa/main/texparam.c2980
-rw-r--r--mesalib/src/mesa/main/texrender.c1308
-rw-r--r--mesalib/src/mesa/main/texstate.c1712
-rw-r--r--mesalib/src/mesa/main/texstore.h418
-rw-r--r--mesalib/src/mesa/main/uniforms.c3074
-rw-r--r--mesalib/src/mesa/main/uniforms.h416
-rw-r--r--mesalib/src/mesa/main/varray.h558
-rw-r--r--mesalib/src/mesa/main/version.c2
-rw-r--r--mesalib/src/mesa/program/arbprogparse.c432
-rw-r--r--mesalib/src/mesa/program/doflexbison.bat18
-rw-r--r--mesalib/src/mesa/program/hash_table.c418
-rw-r--r--mesalib/src/mesa/program/hash_table.h314
-rw-r--r--mesalib/src/mesa/program/ir_to_mesa.cpp6568
-rw-r--r--mesalib/src/mesa/program/prog_instruction.h908
-rw-r--r--mesalib/src/mesa/program/prog_optimize.c2700
-rw-r--r--mesalib/src/mesa/program/prog_print.c2192
-rw-r--r--mesalib/src/mesa/program/prog_statevars.c2416
-rw-r--r--mesalib/src/mesa/program/prog_statevars.h296
-rw-r--r--mesalib/src/mesa/program/program.c2152
-rw-r--r--mesalib/src/mesa/program/program_parse.y5612
-rw-r--r--mesalib/src/mesa/program/program_parse_extra.c530
-rw-r--r--mesalib/src/mesa/program/program_parser.h600
-rw-r--r--mesalib/src/mesa/program/programopt.c1370
-rw-r--r--mesalib/src/mesa/program/programopt.h110
-rw-r--r--mesalib/src/mesa/program/register_allocate.c1074
-rw-r--r--mesalib/src/mesa/program/register_allocate.h144
-rw-r--r--mesalib/src/mesa/program/sampler.cpp274
-rw-r--r--mesalib/src/mesa/sources.mak758
-rw-r--r--mesalib/src/mesa/state_tracker/st_atom_blend.c604
-rw-r--r--mesalib/src/mesa/state_tracker/st_atom_depth.c320
-rw-r--r--mesalib/src/mesa/state_tracker/st_atom_framebuffer.c364
-rw-r--r--mesalib/src/mesa/state_tracker/st_atom_pixeltransfer.c688
-rw-r--r--mesalib/src/mesa/state_tracker/st_atom_rasterizer.c560
-rw-r--r--mesalib/src/mesa/state_tracker/st_cb_blit.c422
-rw-r--r--mesalib/src/mesa/state_tracker/st_cb_bufferobjects.c914
-rw-r--r--mesalib/src/mesa/state_tracker/st_cb_clear.c1202
-rw-r--r--mesalib/src/mesa/state_tracker/st_cb_drawpixels.c3084
-rw-r--r--mesalib/src/mesa/state_tracker/st_cb_drawtex.c614
-rw-r--r--mesalib/src/mesa/state_tracker/st_cb_readpixels.c1192
-rw-r--r--mesalib/src/mesa/state_tracker/st_cb_texture.c3896
-rw-r--r--mesalib/src/mesa/state_tracker/st_context.c600
-rw-r--r--mesalib/src/mesa/state_tracker/st_context.h560
-rw-r--r--mesalib/src/mesa/state_tracker/st_draw.c1580
-rw-r--r--mesalib/src/mesa/state_tracker/st_extensions.c1220
-rw-r--r--mesalib/src/mesa/state_tracker/st_format.h172
-rw-r--r--mesalib/src/mesa/state_tracker/st_mesa_to_tgsi.c2562
-rw-r--r--mesalib/src/mesa/state_tracker/st_program.c2330
-rw-r--r--mesalib/src/mesa/state_tracker/st_texture.h470
-rw-r--r--mesalib/src/mesa/swrast/s_accum.c1196
-rw-r--r--mesalib/src/mesa/swrast/s_bitmap.c446
-rw-r--r--mesalib/src/mesa/swrast/s_context.c1898
-rw-r--r--mesalib/src/mesa/swrast/s_context.h696
-rw-r--r--mesalib/src/mesa/swrast/s_drawpix.c1506
-rw-r--r--mesalib/src/mesa/swrast/s_fog.c488
-rw-r--r--mesalib/src/mesa/swrast/s_fragprog.c554
-rw-r--r--mesalib/src/mesa/swrast/s_readpix.c1028
-rw-r--r--mesalib/src/mesa/swrast/s_triangle.c2286
-rw-r--r--mesalib/src/mesa/tnl/t_context.c440
-rw-r--r--mesalib/src/mesa/tnl/t_draw.c1068
-rw-r--r--mesalib/src/mesa/vbo/vbo.h352
-rw-r--r--mesalib/src/mesa/vbo/vbo_attrib_tmp.h1480
-rw-r--r--mesalib/src/mesa/vbo/vbo_exec.h408
-rw-r--r--mesalib/src/mesa/vbo/vbo_exec_array.c2674
-rw-r--r--mesalib/src/mesa/vbo/vbo_save_api.c2620
-rw-r--r--mesalib/windows/VC8/mesa/glsl_apps_compile/glsl_apps_compile.vcproj304
-rw-r--r--mesalib/windows/VC8/mesa/glsl_apps_compile/glsl_apps_compile.vcxproj189
-rw-r--r--mesalib/windows/VC8/mesa/glsl_apps_compile/glsl_apps_compile.vcxproj.filters247
-rw-r--r--mesalib/windows/VC8/mesa/makefile58
-rw-r--r--mesalib/windows/VC8/mesa/mesa.sln63
-rw-r--r--mesalib/windows/VC8/mesa/mesa/mesa.vcproj2486
-rw-r--r--mesalib/windows/VC8/mesa/mesa/mesa.vcxproj359
-rw-r--r--mesalib/windows/VC8/mesa/mesa/mesa.vcxproj.filters687
-rw-r--r--mesalib/windows/VC8/mesa/mesavc10.sln31
-rw-r--r--mesalib/windows/VC8/mesa/swrast_dri/swrast_dri.vcproj434
-rw-r--r--mesalib/windows/VC8/mesa/swrast_dri/swrast_dri.vcxproj178
-rw-r--r--mesalib/windows/VC8/mesa/swrast_dri/swrast_dri.vcxproj.filters129
238 files changed, 247879 insertions, 241929 deletions
diff --git a/mesalib/bin/extract_git_sha1 b/mesalib/bin/extract_git_sha1
index 828387016..c2994ff09 100644
--- a/mesalib/bin/extract_git_sha1
+++ b/mesalib/bin/extract_git_sha1
@@ -1,20 +1,20 @@
-#!/bin/sh
-if [ ! -f src/mesa/main/git_sha1.h ]; then
- touch src/mesa/main/git_sha1.h
-fi
-
-if [ ! -d .git ]; then
- exit
-fi
-
-if which git > /dev/null; then
- # Extract the 7-digit "short" SHA1 for the current HEAD, convert
- # it to a string, and wrap it in a #define. This is used in
- # src/mesa/main/version.c to put the GIT SHA1 in the GL_VERSION string.
- git log -n 1 --oneline |\
- sed 's/^\([^ ]*\) .*/#define MESA_GIT_SHA1 "git-\1"/' \
- > src/mesa/main/git_sha1.h.tmp
- if ! cmp -s src/mesa/main/git_sha1.h.tmp src/mesa/main/git_sha1.h; then
- mv src/mesa/main/git_sha1.h.tmp src/mesa/main/git_sha1.h
- fi
-fi
+#!/bin/sh
+if [ ! -f src/mesa/main/git_sha1.h ]; then
+ touch src/mesa/main/git_sha1.h
+fi
+
+if [ ! -d .git ]; then
+ exit
+fi
+
+if which git > /dev/null; then
+ # Extract the 7-digit "short" SHA1 for the current HEAD, convert
+ # it to a string, and wrap it in a #define. This is used in
+ # src/mesa/main/version.c to put the GIT SHA1 in the GL_VERSION string.
+ git log -n 1 --oneline |\
+ sed 's/^\([^ ]*\) .*/#define MESA_GIT_SHA1 "git-\1"/' \
+ > src/mesa/main/git_sha1.h.tmp
+ if ! cmp -s src/mesa/main/git_sha1.h.tmp src/mesa/main/git_sha1.h; then
+ mv src/mesa/main/git_sha1.h.tmp src/mesa/main/git_sha1.h
+ fi
+fi
diff --git a/mesalib/common.py b/mesalib/common.py
index 0a3dcdcf5..089a4ee02 100644
--- a/mesalib/common.py
+++ b/mesalib/common.py
@@ -1,92 +1,92 @@
-#######################################################################
-# Common SCons code
-
-import os
-import os.path
-import re
-import subprocess
-import sys
-import platform as _platform
-
-import SCons.Script.SConscript
-
-
-#######################################################################
-# Defaults
-
-host_platform = _platform.system().lower()
-if host_platform.startswith('cygwin'):
- host_platform = 'cygwin'
-
-# Search sys.argv[] for a "platform=foo" argument since we don't have
-# an 'env' variable at this point.
-if 'platform' in SCons.Script.ARGUMENTS:
- target_platform = SCons.Script.ARGUMENTS['platform']
-else:
- target_platform = host_platform
-
-_machine_map = {
- 'x86': 'x86',
- 'i386': 'x86',
- 'i486': 'x86',
- 'i586': 'x86',
- 'i686': 'x86',
- 'ppc' : 'ppc',
- 'AMD64': 'x86_64',
- 'x86_64': 'x86_64',
-}
-
-
-# find host_machine value
-if 'PROCESSOR_ARCHITECTURE' in os.environ:
- host_machine = os.environ['PROCESSOR_ARCHITECTURE']
-else:
- host_machine = _platform.machine()
-host_machine = _machine_map.get(host_machine, 'generic')
-
-default_machine = host_machine
-default_toolchain = 'default'
-
-if target_platform == 'windows' and host_platform != 'windows':
- default_machine = 'x86'
- default_toolchain = 'crossmingw'
-
-
-# find default_llvm value
-if 'LLVM' in os.environ:
- default_llvm = 'yes'
-else:
- default_llvm = 'no'
- try:
- if target_platform != 'windows' and \
- subprocess.call(['llvm-config', '--version'], stdout=subprocess.PIPE) == 0:
- default_llvm = 'yes'
- except:
- pass
-
-
-#######################################################################
-# Common options
-
-def AddOptions(opts):
- try:
- from SCons.Variables.BoolVariable import BoolVariable as BoolOption
- except ImportError:
- from SCons.Options.BoolOption import BoolOption
- try:
- from SCons.Variables.EnumVariable import EnumVariable as EnumOption
- except ImportError:
- from SCons.Options.EnumOption import EnumOption
- opts.Add(EnumOption('build', 'build type', 'debug',
- allowed_values=('debug', 'checked', 'profile', 'release')))
- opts.Add(BoolOption('quiet', 'quiet command lines', 'yes'))
- opts.Add(EnumOption('machine', 'use machine-specific assembly code', default_machine,
- allowed_values=('generic', 'ppc', 'x86', 'x86_64')))
- opts.Add(EnumOption('platform', 'target platform', host_platform,
- allowed_values=('linux', 'cell', 'windows', 'winddk', 'wince', 'darwin', 'embedded', 'cygwin', 'sunos', 'freebsd8')))
- opts.Add('toolchain', 'compiler toolchain', default_toolchain)
- opts.Add(BoolOption('gles', 'EXPERIMENTAL: enable OpenGL ES support', 'no'))
- opts.Add(BoolOption('llvm', 'use LLVM', default_llvm))
- opts.Add(BoolOption('debug', 'DEPRECATED: debug build', 'yes'))
- opts.Add(BoolOption('profile', 'DEPRECATED: profile build', 'no'))
- opts.Add(EnumOption('MSVS_VERSION', 'MS Visual C++ version', None, allowed_values=('7.1', '8.0', '9.0')))
+#######################################################################
+# Common SCons code
+
+import os
+import os.path
+import re
+import subprocess
+import sys
+import platform as _platform
+
+import SCons.Script.SConscript
+
+
+#######################################################################
+# Defaults
+
+host_platform = _platform.system().lower()
+if host_platform.startswith('cygwin'):
+ host_platform = 'cygwin'
+
+# Search sys.argv[] for a "platform=foo" argument since we don't have
+# an 'env' variable at this point.
+if 'platform' in SCons.Script.ARGUMENTS:
+ target_platform = SCons.Script.ARGUMENTS['platform']
+else:
+ target_platform = host_platform
+
+_machine_map = {
+ 'x86': 'x86',
+ 'i386': 'x86',
+ 'i486': 'x86',
+ 'i586': 'x86',
+ 'i686': 'x86',
+ 'ppc' : 'ppc',
+ 'AMD64': 'x86_64',
+ 'x86_64': 'x86_64',
+}
+
+
+# find host_machine value
+if 'PROCESSOR_ARCHITECTURE' in os.environ:
+ host_machine = os.environ['PROCESSOR_ARCHITECTURE']
+else:
+ host_machine = _platform.machine()
+host_machine = _machine_map.get(host_machine, 'generic')
+
+default_machine = host_machine
+default_toolchain = 'default'
+
+if target_platform == 'windows' and host_platform != 'windows':
+ default_machine = 'x86'
+ default_toolchain = 'crossmingw'
+
+
+# find default_llvm value
+if 'LLVM' in os.environ:
+ default_llvm = 'yes'
+else:
+ default_llvm = 'no'
+ try:
+ if target_platform != 'windows' and \
+ subprocess.call(['llvm-config', '--version'], stdout=subprocess.PIPE) == 0:
+ default_llvm = 'yes'
+ except:
+ pass
+
+
+#######################################################################
+# Common options
+
+def AddOptions(opts):
+ try:
+ from SCons.Variables.BoolVariable import BoolVariable as BoolOption
+ except ImportError:
+ from SCons.Options.BoolOption import BoolOption
+ try:
+ from SCons.Variables.EnumVariable import EnumVariable as EnumOption
+ except ImportError:
+ from SCons.Options.EnumOption import EnumOption
+ opts.Add(EnumOption('build', 'build type', 'debug',
+ allowed_values=('debug', 'checked', 'profile', 'release')))
+ opts.Add(BoolOption('quiet', 'quiet command lines', 'yes'))
+ opts.Add(EnumOption('machine', 'use machine-specific assembly code', default_machine,
+ allowed_values=('generic', 'ppc', 'x86', 'x86_64')))
+ opts.Add(EnumOption('platform', 'target platform', host_platform,
+ allowed_values=('linux', 'cell', 'windows', 'winddk', 'wince', 'darwin', 'embedded', 'cygwin', 'sunos', 'freebsd8')))
+ opts.Add('toolchain', 'compiler toolchain', default_toolchain)
+ opts.Add(BoolOption('gles', 'EXPERIMENTAL: enable OpenGL ES support', 'no'))
+ opts.Add(BoolOption('llvm', 'use LLVM', default_llvm))
+ opts.Add(BoolOption('debug', 'DEPRECATED: debug build', 'yes'))
+ opts.Add(BoolOption('profile', 'DEPRECATED: profile build', 'no'))
+ opts.Add(EnumOption('MSVS_VERSION', 'MS Visual C++ version', None, allowed_values=('7.1', '8.0', '9.0')))
diff --git a/mesalib/configs/linux-dri b/mesalib/configs/linux-dri
index 7ee007e35..1b89fac7d 100644
--- a/mesalib/configs/linux-dri
+++ b/mesalib/configs/linux-dri
@@ -1,73 +1,73 @@
-# -*-makefile-*-
-# Configuration for linux-dri: Linux DRI hardware drivers for XFree86 & others
-
-include $(TOP)/configs/default
-
-CONFIG_NAME = linux-dri
-
-# Compiler and flags
-CC = gcc
-CXX = g++
-
-#MKDEP = /usr/X11R6/bin/makedepend
-#MKDEP = gcc -M
-#MKDEP_OPTIONS = -MF depend
-
-OPT_FLAGS = -O2 -g
-PIC_FLAGS = -fPIC
-
-# Add '-DGLX_USE_TLS' to ARCH_FLAGS to enable TLS support.
-ARCH_FLAGS ?=
-
-DEFINES = -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE \
- -D_BSD_SOURCE -D_GNU_SOURCE \
- -DPTHREADS -DUSE_EXTERNAL_DXTN_LIB=1 -DIN_DRI_DRIVER \
- -DGLX_DIRECT_RENDERING -DGLX_INDIRECT_RENDERING \
- -DHAVE_ALIAS -DHAVE_POSIX_MEMALIGN
-
-X11_INCLUDES = -I/usr/X11R6/include
-
-CFLAGS = -Wall -Wmissing-prototypes -std=c99 -ffast-math \
- $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(DEFINES) $(ASM_FLAGS)
-
-CXXFLAGS = -Wall $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(DEFINES)
-
-GLUT_CFLAGS = -fexceptions
-
-# Work around aliasing bugs - developers should comment this out
-CFLAGS += -fno-strict-aliasing
-CXXFLAGS += -fno-strict-aliasing
-
-MESA_ASM_SOURCES =
-
-# Library/program dependencies
-EXTRA_LIB_PATH=-L/usr/X11R6/lib
-
-MESA_MODULES = $(TOP)/src/mesa/libmesa.a
-
-LIBDRM_CFLAGS = $(shell pkg-config --cflags libdrm)
-LIBDRM_LIB = $(shell pkg-config --libs libdrm)
-DRI_LIB_DEPS = $(MESA_MODULES) $(EXTRA_LIB_PATH) -lm -lpthread -lexpat -ldl $(LIBDRM_LIB)
-GL_LIB_DEPS = $(EXTRA_LIB_PATH) -lX11 -lXext -lXxf86vm -lXdamage -lXfixes \
- -lm -lpthread -ldl $(LIBDRM_LIB)
-
-
-# Directories
-SRC_DIRS := glx egl $(SRC_DIRS)
-
-# EGL directories
-EGL_DRIVERS_DIRS = glx
-
-DRIVER_DIRS = dri
-GALLIUM_WINSYS_DIRS = sw sw/xlib drm/vmware drm/intel drm/i965
-GALLIUM_TARGET_DIRS =
-GALLIUM_STATE_TRACKERS_DIRS = egl
-
-DRI_DIRS = i810 i915 i965 mach64 mga r128 r200 r300 r600 radeon \
- savage sis tdfx unichrome swrast
-
-INTEL_LIBS = `pkg-config --libs libdrm_intel`
-INTEL_CFLAGS = `pkg-config --cflags libdrm_intel`
-
-RADEON_LIBS = `pkg-config --libs libdrm_radeon`
-RADEON_CFLAGS = `pkg-config --cflags libdrm_radeon`
+# -*-makefile-*-
+# Configuration for linux-dri: Linux DRI hardware drivers for XFree86 & others
+
+include $(TOP)/configs/default
+
+CONFIG_NAME = linux-dri
+
+# Compiler and flags
+CC = gcc
+CXX = g++
+
+#MKDEP = /usr/X11R6/bin/makedepend
+#MKDEP = gcc -M
+#MKDEP_OPTIONS = -MF depend
+
+OPT_FLAGS = -O2 -g
+PIC_FLAGS = -fPIC
+
+# Add '-DGLX_USE_TLS' to ARCH_FLAGS to enable TLS support.
+ARCH_FLAGS ?=
+
+DEFINES = -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE \
+ -D_BSD_SOURCE -D_GNU_SOURCE \
+ -DPTHREADS -DUSE_EXTERNAL_DXTN_LIB=1 -DIN_DRI_DRIVER \
+ -DGLX_DIRECT_RENDERING -DGLX_INDIRECT_RENDERING \
+ -DHAVE_ALIAS -DHAVE_POSIX_MEMALIGN
+
+X11_INCLUDES = -I/usr/X11R6/include
+
+CFLAGS = -Wall -Wmissing-prototypes -std=c99 -ffast-math \
+ $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(DEFINES) $(ASM_FLAGS)
+
+CXXFLAGS = -Wall $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(DEFINES)
+
+GLUT_CFLAGS = -fexceptions
+
+# Work around aliasing bugs - developers should comment this out
+CFLAGS += -fno-strict-aliasing
+CXXFLAGS += -fno-strict-aliasing
+
+MESA_ASM_SOURCES =
+
+# Library/program dependencies
+EXTRA_LIB_PATH=-L/usr/X11R6/lib
+
+MESA_MODULES = $(TOP)/src/mesa/libmesa.a
+
+LIBDRM_CFLAGS = $(shell pkg-config --cflags libdrm)
+LIBDRM_LIB = $(shell pkg-config --libs libdrm)
+DRI_LIB_DEPS = $(MESA_MODULES) $(EXTRA_LIB_PATH) -lm -lpthread -lexpat -ldl $(LIBDRM_LIB)
+GL_LIB_DEPS = $(EXTRA_LIB_PATH) -lX11 -lXext -lXxf86vm -lXdamage -lXfixes \
+ -lm -lpthread -ldl $(LIBDRM_LIB)
+
+
+# Directories
+SRC_DIRS := glx egl $(SRC_DIRS)
+
+# EGL directories
+EGL_DRIVERS_DIRS = glx
+
+DRIVER_DIRS = dri
+GALLIUM_WINSYS_DIRS = sw sw/xlib drm/vmware drm/intel drm/i965
+GALLIUM_TARGET_DIRS =
+GALLIUM_STATE_TRACKERS_DIRS = egl
+
+DRI_DIRS = i810 i915 i965 mach64 mga r128 r200 r300 r600 radeon \
+ savage sis tdfx unichrome swrast
+
+INTEL_LIBS = `pkg-config --libs libdrm_intel`
+INTEL_CFLAGS = `pkg-config --cflags libdrm_intel`
+
+RADEON_LIBS = `pkg-config --libs libdrm_radeon`
+RADEON_CFLAGS = `pkg-config --cflags libdrm_radeon`
diff --git a/mesalib/docs/GL3.txt b/mesalib/docs/GL3.txt
index d86c4b0bf..fbdeaad17 100644
--- a/mesalib/docs/GL3.txt
+++ b/mesalib/docs/GL3.txt
@@ -1,119 +1,119 @@
-
-Status of OpenGL 3.x features in Mesa
-
-
-Note: when an item is marked as "DONE" it means all the core Mesa
-infrastructure is complete but it may be the case that few (if any) drivers
-implement the features.
-
-
-Feature Status
------------------------------------------------------ ------------------------
-
-GL 3.0:
-
-GLSL 1.30 (GL_EXT_gpu_shader4, etc.) started
-Conditional rendering (GL_NV_conditional_render) DONE (swrast, softpipe, i965)
-Map buffer subranges (GL_ARB_map_buffer_range) DONE
-Clamping controls (GL_ARB_color_buffer_float) DONE
-Float textures, renderbuffers (GL_ARB_texture_float) DONE (gallium r300)
-GL_EXT_packed_float DONE (gallium r600)
-GL_EXT_texture_shared_exponent DONE (gallium, swrast)
-Float depth buffers (GL_ARB_depth_buffer_float) not started
-Framebuffer objects (GL_EXT_framebuffer_object) DONE
-Half-float DONE
-Multisample blit DONE
-Non-normalized Integer texture/framebuffer formats ~50% done
-1D/2D Texture arrays core Mesa, swrast done
-Packed depth/stencil formats DONE
-Per-buffer blend and masks (GL_EXT_draw_buffers2) DONE
-GL_EXT_texture_compression_rgtc DONE (swrast, gallium r600)
-Red and red/green texture formats DONE (swrast, i965, gallium)
-Transform feedback (GL_EXT_transform_feedback) ~50% done
- glBindFragDataLocation, glGetFragDataLocation,
- glBindBufferRange, glBindBufferBase commands
-Vertex array objects (GL_APPLE_vertex_array_object) DONE
-sRGB framebuffer format (GL_EXT_framebuffer_sRGB) core GL done (i965, gallium), GLX todo
-glClearBuffer commands DONE
-glGetStringi command DONE
-glTexParameterI, glGetTexParameterI commands DONE
-glVertexAttribI commands DONE (but converts int
- values to floats)
-Depth format cube textures 0% done
-
-
-
-GL 3.1:
-
-GLSL 1.40 not started
-Instanced drawing (GL_ARB_draw_instanced) DONE (gallium, swrast)
-Buffer copying (GL_ARB_copy_buffer) DONE
-Primitive restart (GL_NV_primitive_restart) DONE (gallium)
-16 vertex texture image units not started
-Texture buffer objs (GL_ARB_texture_buffer_object) not started
-Rectangular textures (GL_ARB_texture_rectangle) DONE
-Uniform buffer objs (GL_ARB_uniform_buffer_object) not started
-Signed normalized textures (GL_EXT_texture_snorm) DONE (gallium)
-
-
-GL 3.2:
-
-Core/compatibility profiles not started
-GLSL 1.50 not started
-Geometry shaders (GL_ARB_geometry_shader4) partially done (Zack)
-BGRA vertex order (GL_ARB_vertex_array_bgra) DONE
-Base vertex offset(GL_ARB_draw_elements_base_vertex) DONE
-Frag shader coord (GL_ARB_fragment_coord_conventions) DONE (swrast, gallium)
-Provoking vertex (GL_ARB_provoking_vertex) DONE
-Seamless cubemaps (GL_ARB_seamless_cube_map) DONE
-Multisample textures (GL_ARB_texture_multisample) not started
-Frag depth clamp (GL_ARB_depth_clamp) DONE
-Fence objects (GL_ARB_sync) DONE
-
-
-GL 3.3:
-
-GLSL 3.30 not started
-GL_ARB_blend_func_extended not started
-GL_ARB_explicit_attrib_location DONE (swrast, i915, i965)
-GL_ARB_occlusion_query2 DONE (swrast, gallium)
-GL_ARB_sampler_objects DONE (gallium)
-GL_ARB_texture_rgb10_a2ui not started
-GL_ARB_texture_swizzle DONE (same as EXT version)
-GL_ARB_timer_query ~60% done (the EXT variant)
-GL_ARB_instanced_arrays DONE (gallium)
-GL_ARB_vertex_type_2_10_10_10_rev not started
-
-
-GL 4.0:
-
-GLSL 4.0 not started
-GL_ARB_texture_query_lod not started
-GL_ARB_draw_buffers_blend DONE (gallium softpipe)
-GL_ARB_draw_indirect not started
-GL_ARB_gpu_shader_fp64 not started
-GL_ARB_sample_shading not started
-GL_ARB_shader_subroutine not started
-GL_ARB_tessellation_shader not started
-GL_ARB_texture_buffer_object_rgb32 not started
-GL_ARB_texture_cube_map_array not started
-GL_ARB_texture_gather not started
-GL_ARB_transform_feedback2 not started
-GL_ARB_transform_feedback3 not started
-
-
-GL 4.1:
-
-GLSL 4.1 not started
-GL_ARB_ES2_compatibility DONE (i965)
-GL_ARB_get_program_binary not started
-GL_ARB_separate_shader_objects some infrastructure done
-GL_ARB_shader_precision not started
-GL_ARB_vertex_attrib_64bit not started
-GL_ARB_viewport_array not started
-
-
-
-
-More info about these features and the work involved can be found at
-http://dri.freedesktop.org/wiki/MissingFunctionality
+
+Status of OpenGL 3.x features in Mesa
+
+
+Note: when an item is marked as "DONE" it means all the core Mesa
+infrastructure is complete but it may be the case that few (if any) drivers
+implement the features.
+
+
+Feature Status
+----------------------------------------------------- ------------------------
+
+GL 3.0:
+
+GLSL 1.30 (GL_EXT_gpu_shader4, etc.) started
+Conditional rendering (GL_NV_conditional_render) DONE (swrast, softpipe, i965)
+Map buffer subranges (GL_ARB_map_buffer_range) DONE
+Clamping controls (GL_ARB_color_buffer_float) DONE
+Float textures, renderbuffers (GL_ARB_texture_float) DONE (gallium r300)
+GL_EXT_packed_float DONE (gallium r600)
+GL_EXT_texture_shared_exponent DONE (gallium, swrast)
+Float depth buffers (GL_ARB_depth_buffer_float) not started
+Framebuffer objects (GL_EXT_framebuffer_object) DONE
+Half-float DONE
+Multisample blit DONE
+Non-normalized Integer texture/framebuffer formats ~50% done
+1D/2D Texture arrays core Mesa, swrast done
+Packed depth/stencil formats DONE
+Per-buffer blend and masks (GL_EXT_draw_buffers2) DONE
+GL_EXT_texture_compression_rgtc DONE (swrast, gallium r600)
+Red and red/green texture formats DONE (swrast, i965, gallium)
+Transform feedback (GL_EXT_transform_feedback) ~50% done
+ glBindFragDataLocation, glGetFragDataLocation,
+ glBindBufferRange, glBindBufferBase commands
+Vertex array objects (GL_APPLE_vertex_array_object) DONE
+sRGB framebuffer format (GL_EXT_framebuffer_sRGB) core GL done (i965, gallium), GLX todo
+glClearBuffer commands DONE
+glGetStringi command DONE
+glTexParameterI, glGetTexParameterI commands DONE
+glVertexAttribI commands DONE (but converts int
+ values to floats)
+Depth format cube textures 0% done
+
+
+
+GL 3.1:
+
+GLSL 1.40 not started
+Instanced drawing (GL_ARB_draw_instanced) DONE (gallium, swrast)
+Buffer copying (GL_ARB_copy_buffer) DONE
+Primitive restart (GL_NV_primitive_restart) DONE (gallium)
+16 vertex texture image units not started
+Texture buffer objs (GL_ARB_texture_buffer_object) not started
+Rectangular textures (GL_ARB_texture_rectangle) DONE
+Uniform buffer objs (GL_ARB_uniform_buffer_object) not started
+Signed normalized textures (GL_EXT_texture_snorm) DONE (gallium)
+
+
+GL 3.2:
+
+Core/compatibility profiles not started
+GLSL 1.50 not started
+Geometry shaders (GL_ARB_geometry_shader4) partially done (Zack)
+BGRA vertex order (GL_ARB_vertex_array_bgra) DONE
+Base vertex offset(GL_ARB_draw_elements_base_vertex) DONE
+Frag shader coord (GL_ARB_fragment_coord_conventions) DONE (swrast, gallium)
+Provoking vertex (GL_ARB_provoking_vertex) DONE
+Seamless cubemaps (GL_ARB_seamless_cube_map) DONE
+Multisample textures (GL_ARB_texture_multisample) not started
+Frag depth clamp (GL_ARB_depth_clamp) DONE
+Fence objects (GL_ARB_sync) DONE
+
+
+GL 3.3:
+
+GLSL 3.30 not started
+GL_ARB_blend_func_extended not started
+GL_ARB_explicit_attrib_location DONE (swrast, i915, i965)
+GL_ARB_occlusion_query2 DONE (swrast, gallium)
+GL_ARB_sampler_objects DONE (gallium)
+GL_ARB_texture_rgb10_a2ui not started
+GL_ARB_texture_swizzle DONE (same as EXT version)
+GL_ARB_timer_query ~60% done (the EXT variant)
+GL_ARB_instanced_arrays DONE (gallium)
+GL_ARB_vertex_type_2_10_10_10_rev not started
+
+
+GL 4.0:
+
+GLSL 4.0 not started
+GL_ARB_texture_query_lod not started
+GL_ARB_draw_buffers_blend DONE (gallium softpipe)
+GL_ARB_draw_indirect not started
+GL_ARB_gpu_shader_fp64 not started
+GL_ARB_sample_shading not started
+GL_ARB_shader_subroutine not started
+GL_ARB_tessellation_shader not started
+GL_ARB_texture_buffer_object_rgb32 not started
+GL_ARB_texture_cube_map_array not started
+GL_ARB_texture_gather not started
+GL_ARB_transform_feedback2 not started
+GL_ARB_transform_feedback3 not started
+
+
+GL 4.1:
+
+GLSL 4.1 not started
+GL_ARB_ES2_compatibility DONE (i965)
+GL_ARB_get_program_binary not started
+GL_ARB_separate_shader_objects some infrastructure done
+GL_ARB_shader_precision not started
+GL_ARB_vertex_attrib_64bit not started
+GL_ARB_viewport_array not started
+
+
+
+
+More info about these features and the work involved can be found at
+http://dri.freedesktop.org/wiki/MissingFunctionality
diff --git a/mesalib/docs/MESA_drm_image.spec b/mesalib/docs/MESA_drm_image.spec
index 1150a4c43..fa1e32e06 100644
--- a/mesalib/docs/MESA_drm_image.spec
+++ b/mesalib/docs/MESA_drm_image.spec
@@ -1,153 +1,153 @@
-Name
-
- MESA_drm_image
-
-Name Strings
-
- EGL_MESA_drm_image
-
-Contact
-
- Kristian Høgsberg <krh@bitplanet.net>
-
-Status
-
- Proposal
-
-Version
-
- Version 2, August 25, 2010
-
-Number
-
- EGL Extension #not assigned
-
-Dependencies
-
- Requires EGL 1.4 or later. This extension is written against the
- wording of the EGL 1.4 specification.
-
- EGL_KHR_base_image is required.
-
-Overview
-
- This extension provides entry points for integrating EGLImage with the
- Linux DRM mode setting and memory management drivers. The extension
- lets applications create EGLImages without a client API resource and
- lets the application get the DRM buffer handles.
-
-IP Status
-
- Open-source; freely implementable.
-
-New Procedures and Functions
-
- EGLImageKHR eglCreateDRMImageMESA(EGLDisplay dpy,
- const EGLint *attrib_list);
-
- EGLBoolean eglExportDRMImageMESA(EGLDisplay dpy,
- EGLImageKHR image,
- EGLint *name,
- EGLint *handle,
- EGLint *stride);
-
-New Tokens
-
- Accepted in the <attrib_list> parameter of eglCreateDRMImageMESA:
-
- EGL_DRM_BUFFER_FORMAT_MESA 0x31D0
- EGL_DRM_BUFFER_USE_MESA 0x31D1
-
- Accepted as values for the EGL_IMAGE_FORMAT_MESA attribute:
-
- EGL_DRM_BUFFER_FORMAT_ARGB32_MESA 0x31D2
-
- Bits accepted in EGL_DRM_BUFFER_USE_MESA:
-
- EGL_DRM_BUFFER_USE_SCANOUT_MESA 0x0001
- EGL_DRM_BUFFER_USE_SHARE_MESA 0x0002
- EGL_DRM_BUFFER_USE_CURSOR_MESA 0x0004
-
- Accepted in the <target> parameter of eglCreateImageKHR:
-
- EGL_DRM_BUFFER_MESA 0x31D3
-
- Use when importing drm buffer:
-
- EGL_DRM_BUFFER_STRIDE_MESA 0x31D4
- EGL_DRM_BUFFER_FORMAT_MESA 0x31D0
-
-Additions to the EGL 1.4 Specification:
-
- To create a DRM EGLImage, call
-
- EGLImageKHR eglCreateDRMImageMESA(EGLDisplay dpy,
- const EGLint *attrib_list);
-
- In the attribute list, pass EGL_WIDTH, EGL_HEIGHT and format and
- use in the attrib list using EGL_DRM_BUFFER_FORMAT_MESA and
- EGL_DRM_BUFFER_USE_MESA. The only format specified by this
- extension is EGL_DRM_BUFFER_FORMAT_ARGB32_MESA, where each pixel
- is a CPU-endian, 32-bit quantity, with alpha in the upper 8 bits,
- then red, then green, then blue. The bit values accepted by
- EGL_DRM_BUFFER_USE_MESA are EGL_DRM_BUFFER_USE_SCANOUT_MESA,
- EGL_DRM_BUFFER_USE_SHARE_MESA and EGL_DRM_BUFFER_USE_CURSOR_MESA.
- EGL_DRM_BUFFER_USE_SCANOUT_MESA requests that the created EGLImage
- should be usable as a scanout buffer with the DRM kernel
- modesetting API. EGL_DRM_BUFFER_USE_SHARE_MESA requests that the
- EGLImage can be shared with other processes by passing the
- underlying DRM buffer name. EGL_DRM_BUFFER_USE_CURSOR_MESA
- requests that the image must be usable as a cursor with KMS. When
- EGL_DRM_BUFFER_USE_CURSOR_MESA is set, width and height must both
- be 64.
-
- To create a process local handle or a global DRM name for a
- buffer, call
-
- EGLBoolean eglExportDRMImageMESA(EGLDisplay dpy,
- EGLImageKHR image,
- EGLint *name,
- EGLint *handle,
- EGLint *stride);
-
- If <name> is non-NULL, a global name is assigned to the image and
- written to <name>, the handle (local to the DRM file descriptor,
- for use with DRM kernel modesetting API) is written to <handle> if
- non-NULL and the stride (in bytes) is written to <stride>, if
- non-NULL.
-
- Import a shared buffer by calling eglCreateImageKHR with
- EGL_DRM_BUFFER_MESA as the target, using EGL_WIDTH, EGL_HEIGHT,
- EGL_DRM_BUFFER_FORMAT_MESA, EGL_DRM_BUFFER_STRIDE_MESA
- in the attrib list.
-
-Issues
-
- 1. Why don't we use eglCreateImageKHR with a target that
- indicates that we want to create an EGLImage from scratch?
-
- RESOLVED: The eglCreateImageKHR entry point is reserved for
- creating an EGLImage from an already existing client API
- resource. This is fine when we're creating the EGLImage from
- an existing DRM buffer name, it doesn't seem right to overload
- the function to also allocate the underlying resource.
-
- 2. Why don't we use an eglQueryImageMESA type functions for
- querying the DRM EGLImage attributes (name, handle, and stride)?
-
- RESOLVED: The eglQueryImage function has been proposed often,
- but it goes against the EGLImage design. EGLImages are opaque
- handles to a 2D array of pixels, which can be passed between
- client APIs. By referencing an EGLImage in a client API, the
- EGLImage target (a texture, a renderbuffer or such) can be
- used to query the attributes of the EGLImage. We don't have a
- full client API for creating and querying DRM buffers, though,
- so we use a new EGL extension entry point instead.
-
-Revision History
-
- Version 1, June 3, 2010
- Initial draft (Kristian Høgsberg)
- Version 2, August 25, 2010
- Flesh out the extension a bit, add final EGL tokens, capture
- some of the original discussion in the issues section.
+Name
+
+ MESA_drm_image
+
+Name Strings
+
+ EGL_MESA_drm_image
+
+Contact
+
+ Kristian Høgsberg <krh@bitplanet.net>
+
+Status
+
+ Proposal
+
+Version
+
+ Version 2, August 25, 2010
+
+Number
+
+ EGL Extension #not assigned
+
+Dependencies
+
+ Requires EGL 1.4 or later. This extension is written against the
+ wording of the EGL 1.4 specification.
+
+ EGL_KHR_base_image is required.
+
+Overview
+
+ This extension provides entry points for integrating EGLImage with the
+ Linux DRM mode setting and memory management drivers. The extension
+ lets applications create EGLImages without a client API resource and
+ lets the application get the DRM buffer handles.
+
+IP Status
+
+ Open-source; freely implementable.
+
+New Procedures and Functions
+
+ EGLImageKHR eglCreateDRMImageMESA(EGLDisplay dpy,
+ const EGLint *attrib_list);
+
+ EGLBoolean eglExportDRMImageMESA(EGLDisplay dpy,
+ EGLImageKHR image,
+ EGLint *name,
+ EGLint *handle,
+ EGLint *stride);
+
+New Tokens
+
+ Accepted in the <attrib_list> parameter of eglCreateDRMImageMESA:
+
+ EGL_DRM_BUFFER_FORMAT_MESA 0x31D0
+ EGL_DRM_BUFFER_USE_MESA 0x31D1
+
+ Accepted as values for the EGL_IMAGE_FORMAT_MESA attribute:
+
+ EGL_DRM_BUFFER_FORMAT_ARGB32_MESA 0x31D2
+
+ Bits accepted in EGL_DRM_BUFFER_USE_MESA:
+
+ EGL_DRM_BUFFER_USE_SCANOUT_MESA 0x0001
+ EGL_DRM_BUFFER_USE_SHARE_MESA 0x0002
+ EGL_DRM_BUFFER_USE_CURSOR_MESA 0x0004
+
+ Accepted in the <target> parameter of eglCreateImageKHR:
+
+ EGL_DRM_BUFFER_MESA 0x31D3
+
+ Use when importing drm buffer:
+
+ EGL_DRM_BUFFER_STRIDE_MESA 0x31D4
+ EGL_DRM_BUFFER_FORMAT_MESA 0x31D0
+
+Additions to the EGL 1.4 Specification:
+
+ To create a DRM EGLImage, call
+
+ EGLImageKHR eglCreateDRMImageMESA(EGLDisplay dpy,
+ const EGLint *attrib_list);
+
+ In the attribute list, pass EGL_WIDTH, EGL_HEIGHT and format and
+ use in the attrib list using EGL_DRM_BUFFER_FORMAT_MESA and
+ EGL_DRM_BUFFER_USE_MESA. The only format specified by this
+ extension is EGL_DRM_BUFFER_FORMAT_ARGB32_MESA, where each pixel
+ is a CPU-endian, 32-bit quantity, with alpha in the upper 8 bits,
+ then red, then green, then blue. The bit values accepted by
+ EGL_DRM_BUFFER_USE_MESA are EGL_DRM_BUFFER_USE_SCANOUT_MESA,
+ EGL_DRM_BUFFER_USE_SHARE_MESA and EGL_DRM_BUFFER_USE_CURSOR_MESA.
+ EGL_DRM_BUFFER_USE_SCANOUT_MESA requests that the created EGLImage
+ should be usable as a scanout buffer with the DRM kernel
+ modesetting API. EGL_DRM_BUFFER_USE_SHARE_MESA requests that the
+ EGLImage can be shared with other processes by passing the
+ underlying DRM buffer name. EGL_DRM_BUFFER_USE_CURSOR_MESA
+ requests that the image must be usable as a cursor with KMS. When
+ EGL_DRM_BUFFER_USE_CURSOR_MESA is set, width and height must both
+ be 64.
+
+ To create a process local handle or a global DRM name for a
+ buffer, call
+
+ EGLBoolean eglExportDRMImageMESA(EGLDisplay dpy,
+ EGLImageKHR image,
+ EGLint *name,
+ EGLint *handle,
+ EGLint *stride);
+
+ If <name> is non-NULL, a global name is assigned to the image and
+ written to <name>, the handle (local to the DRM file descriptor,
+ for use with DRM kernel modesetting API) is written to <handle> if
+ non-NULL and the stride (in bytes) is written to <stride>, if
+ non-NULL.
+
+ Import a shared buffer by calling eglCreateImageKHR with
+ EGL_DRM_BUFFER_MESA as the target, using EGL_WIDTH, EGL_HEIGHT,
+ EGL_DRM_BUFFER_FORMAT_MESA, EGL_DRM_BUFFER_STRIDE_MESA
+ in the attrib list.
+
+Issues
+
+ 1. Why don't we use eglCreateImageKHR with a target that
+ indicates that we want to create an EGLImage from scratch?
+
+ RESOLVED: The eglCreateImageKHR entry point is reserved for
+ creating an EGLImage from an already existing client API
+ resource. This is fine when we're creating the EGLImage from
+ an existing DRM buffer name, it doesn't seem right to overload
+ the function to also allocate the underlying resource.
+
+ 2. Why don't we use an eglQueryImageMESA type functions for
+ querying the DRM EGLImage attributes (name, handle, and stride)?
+
+ RESOLVED: The eglQueryImage function has been proposed often,
+ but it goes against the EGLImage design. EGLImages are opaque
+ handles to a 2D array of pixels, which can be passed between
+ client APIs. By referencing an EGLImage in a client API, the
+ EGLImage target (a texture, a renderbuffer or such) can be
+ used to query the attributes of the EGLImage. We don't have a
+ full client API for creating and querying DRM buffers, though,
+ so we use a new EGL extension entry point instead.
+
+Revision History
+
+ Version 1, June 3, 2010
+ Initial draft (Kristian Høgsberg)
+ Version 2, August 25, 2010
+ Flesh out the extension a bit, add final EGL tokens, capture
+ some of the original discussion in the issues section.
diff --git a/mesalib/docs/README.WIN32 b/mesalib/docs/README.WIN32
index ab0df573b..d0dd94117 100644
--- a/mesalib/docs/README.WIN32
+++ b/mesalib/docs/README.WIN32
@@ -1,51 +1,51 @@
-File: docs/README.WIN32
-
-Last updated: 23 April 2011
-
-
-Quick Start
------ -----
-
-Windows drivers are build with SCons. Makefiles or Visual Studio projects are
-no longer shipped or supported.
-
-Run
-
- scons osmesa mesagdi
-
-to build classic mesa Windows GDI drivers; or
-
- scons libgl-gdi
-
-to build gallium based GDI driver.
-
-
-Windows Drivers
-------- -------
-
-At this time, only the gallium GDI driver is known to work.
-
-Source code also exists in the tree for other drivers in
-src/mesa/drivers/windows, but the status of this code is unknown.
-
-
-General
--------
-
-After building, you can copy the above DLL files to a place in your
-PATH such as $SystemRoot/SYSTEM32. If you don't like putting things
-in a system directory, place them in the same directory as the
-executable(s). Be careful about accidentially overwriting files of
-the same name in the SYSTEM32 directory.
-
-The DLL files are built so that the external entry points use the
-stdcall calling convention.
-
-Static LIB files are not built. The LIB files that are built with are
-the linker import files associated with the DLL files.
-
-The si-glu sources are used to build the GLU libs. This was done
-mainly to get the better tessellator code.
-
-If you have a Windows-related build problem or question, please post
-to the mesa-dev or mesa-users list.
+File: docs/README.WIN32
+
+Last updated: 23 April 2011
+
+
+Quick Start
+----- -----
+
+Windows drivers are build with SCons. Makefiles or Visual Studio projects are
+no longer shipped or supported.
+
+Run
+
+ scons osmesa mesagdi
+
+to build classic mesa Windows GDI drivers; or
+
+ scons libgl-gdi
+
+to build gallium based GDI driver.
+
+
+Windows Drivers
+------- -------
+
+At this time, only the gallium GDI driver is known to work.
+
+Source code also exists in the tree for other drivers in
+src/mesa/drivers/windows, but the status of this code is unknown.
+
+
+General
+-------
+
+After building, you can copy the above DLL files to a place in your
+PATH such as $SystemRoot/SYSTEM32. If you don't like putting things
+in a system directory, place them in the same directory as the
+executable(s). Be careful about accidentially overwriting files of
+the same name in the SYSTEM32 directory.
+
+The DLL files are built so that the external entry points use the
+stdcall calling convention.
+
+Static LIB files are not built. The LIB files that are built with are
+the linker import files associated with the DLL files.
+
+The si-glu sources are used to build the GLU libs. This was done
+mainly to get the better tessellator code.
+
+If you have a Windows-related build problem or question, please post
+to the mesa-dev or mesa-users list.
diff --git a/mesalib/docs/WL_bind_wayland_display.spec b/mesalib/docs/WL_bind_wayland_display.spec
index e2fde3c50..49ac82681 100644
--- a/mesalib/docs/WL_bind_wayland_display.spec
+++ b/mesalib/docs/WL_bind_wayland_display.spec
@@ -1,92 +1,92 @@
-Name
-
- WL_bind_wayland_display
-
-Name Strings
-
- EGL_WL_bind_wayland_display
-
-Contact
-
- Kristian Høgsberg <krh@bitplanet.net>
- Benjamin Franzke <benjaminfranzke@googlemail.com>
-
-Status
-
- Proposal
-
-Version
-
- Version 1, March 1, 2011
-
-Number
-
- EGL Extension #not assigned
-
-Dependencies
-
- Requires EGL 1.4 or later. This extension is written against the
- wording of the EGL 1.4 specification.
-
- EGL_KHR_base_image is required.
-
-Overview
-
- This extension provides entry points for binding and unbinding the
- wl_display of a Wayland compositor to an EGLDisplay. Binding a
- wl_display means that the EGL implementation should provide one or
- more interfaces in the Wayland protocol to allow clients to create
- wl_buffer objects. On the server side, this extension also
- provides a new target for eglCreateImageKHR, to create an EGLImage
- from a wl_buffer
-
- Adding an implementation specific wayland interface, allows the
- EGL implementation to define specific wayland requests and events,
- needed for buffer sharing in an EGL wayland platform.
-
-IP Status
-
- Open-source; freely implementable.
-
-New Procedures and Functions
-
- EGLBoolean eglBindWaylandDisplayWL(EGLDisplay dpy,
- struct wl_display *display);
-
- EGLBoolean eglUnbindWaylandDisplayWL(EGLDisplay dpy,
- struct wl_display *display);
-
-New Tokens
-
- Accepted as <target> in eglCreateImageKHR
-
- EGL_WAYLAND_BUFFER_WL 0x31D5
-
-Additions to the EGL 1.4 Specification:
-
- To bind a server side wl_display to an EGLDisplay, call
-
- EGLBoolean eglBindWaylandDisplayWL(EGLDisplay dpy,
- struct wl_display *display);
-
- To unbind a server side wl_display from an EGLDisplay, call
-
- EGLBoolean eglUnbindWaylandDisplayWL(EGLDisplay dpy,
- struct wl_display *display);
-
- eglBindWaylandDisplayWL returns EGL_FALSE when there is already a
- wl_display bound to EGLDisplay otherwise EGL_TRUE.
-
- eglUnbindWaylandDisplayWL returns EGL_FALSE when there is no
- wl_display bound to the EGLDisplay currently otherwise EGL_TRUE.
-
- Import a wl_buffer by calling eglCreateImageKHR with
- wl_buffer as EGLClientBuffer, EGL_WAYLAND_BUFFER_WL as the target,
- NULL context and an empty attribute_list.
-
-Issues
-
-Revision History
-
- Version 1, March 1, 2011
- Initial draft (Benjamin Franzke)
+Name
+
+ WL_bind_wayland_display
+
+Name Strings
+
+ EGL_WL_bind_wayland_display
+
+Contact
+
+ Kristian Høgsberg <krh@bitplanet.net>
+ Benjamin Franzke <benjaminfranzke@googlemail.com>
+
+Status
+
+ Proposal
+
+Version
+
+ Version 1, March 1, 2011
+
+Number
+
+ EGL Extension #not assigned
+
+Dependencies
+
+ Requires EGL 1.4 or later. This extension is written against the
+ wording of the EGL 1.4 specification.
+
+ EGL_KHR_base_image is required.
+
+Overview
+
+ This extension provides entry points for binding and unbinding the
+ wl_display of a Wayland compositor to an EGLDisplay. Binding a
+ wl_display means that the EGL implementation should provide one or
+ more interfaces in the Wayland protocol to allow clients to create
+ wl_buffer objects. On the server side, this extension also
+ provides a new target for eglCreateImageKHR, to create an EGLImage
+ from a wl_buffer
+
+ Adding an implementation specific wayland interface, allows the
+ EGL implementation to define specific wayland requests and events,
+ needed for buffer sharing in an EGL wayland platform.
+
+IP Status
+
+ Open-source; freely implementable.
+
+New Procedures and Functions
+
+ EGLBoolean eglBindWaylandDisplayWL(EGLDisplay dpy,
+ struct wl_display *display);
+
+ EGLBoolean eglUnbindWaylandDisplayWL(EGLDisplay dpy,
+ struct wl_display *display);
+
+New Tokens
+
+ Accepted as <target> in eglCreateImageKHR
+
+ EGL_WAYLAND_BUFFER_WL 0x31D5
+
+Additions to the EGL 1.4 Specification:
+
+ To bind a server side wl_display to an EGLDisplay, call
+
+ EGLBoolean eglBindWaylandDisplayWL(EGLDisplay dpy,
+ struct wl_display *display);
+
+ To unbind a server side wl_display from an EGLDisplay, call
+
+ EGLBoolean eglUnbindWaylandDisplayWL(EGLDisplay dpy,
+ struct wl_display *display);
+
+ eglBindWaylandDisplayWL returns EGL_FALSE when there is already a
+ wl_display bound to EGLDisplay otherwise EGL_TRUE.
+
+ eglUnbindWaylandDisplayWL returns EGL_FALSE when there is no
+ wl_display bound to the EGLDisplay currently otherwise EGL_TRUE.
+
+ Import a wl_buffer by calling eglCreateImageKHR with
+ wl_buffer as EGLClientBuffer, EGL_WAYLAND_BUFFER_WL as the target,
+ NULL context and an empty attribute_list.
+
+Issues
+
+Revision History
+
+ Version 1, March 1, 2011
+ Initial draft (Benjamin Franzke)
diff --git a/mesalib/docs/download.html b/mesalib/docs/download.html
index 03fa60b4d..2174bf0d9 100644
--- a/mesalib/docs/download.html
+++ b/mesalib/docs/download.html
@@ -1,103 +1,103 @@
-<HTML>
-
-<TITLE>Getting Mesa</TITLE>
-
-<link rel="stylesheet" type="text/css" href="mesa.css"></head>
-
-<BODY>
-
-<H1>Downloading</H1>
-
-<p>
-Primary Mesa download site:
-<a href="ftp://ftp.freedesktop.org/pub/mesa/"
-target="_parent">freedesktop.org</a> (FTP)
-</p>
-
-<p>
-When a new release is coming, release candidates (betas) may be found
-<a href="ftp://ftp.freedesktop.org/pub/mesa/beta/" target="_parent">here</a>.
-</p>
-
-
-<p>
-The Mesa package is named MesaLib-x.y.z.{tar.bz2, tar.gz, zip} where x.y.z
-is the version. There are three types of compressed archives.
-</p>
-<p>
-There's also the MesaGLUT-x.y.z.{tar.bz2, tar.gz, zip} packages which
-contain Mark Kilgard's GLUT library.
-This is optional.
-Most Linux distributions include an implementation of GLUT (such as freeglut).
-</p>
-<p>
-In the past, the Mesa demos collection was distributed as
-MesaDemos-x.y.z.{tar.bz2, tar.gz, zip}.
-Now, the
-<a href="ftp://ftp.freedesktop.org/pub/mesa/demos/" target="_parent">
-Mesa demos</a> are distributed separately.
-</p>
-
-
-<H1>Unpacking</H1>
-
-<p>
-To unpack .tar.gz files:
-</p>
-<pre>
- tar zxf MesaLib-x.y.z.tar.gz
-</pre>
-or
-<pre>
- gzcat MesaLib-x.y.z.tar.gz | tar xf -
-</pre>
-or
-<pre>
- gunzip MesaLib-x.y.z.tar.gz ; tar xf MesaLib-x.y.z.tar
-</pre>
-<p>
-To unpack .tar.bz2 files:
-</p>
-<pre>
- bunzip2 -c MesaLib-x.y.z.tar.gz | tar xf -
-</pre>
-<p>
-To unpack .zip files:
-</p>
-<pre>
- unzip MesaLib-x.y.z.zip
-</pre>
-
-
-<h1>Contents</h1>
-
-<p>
-After unpacking you'll have these files and directories (among others):
-</p>
-<pre>
-Makefile - top-level Makefile for most systems
-configs/ - makefile parameter files for various systems
-include/ - GL header (include) files
-bin/ - shell scripts for making shared libraries, etc
-docs/ - documentation
-src/ - source code for libraries
-src/mesa - sources for the main Mesa library and device drivers
-src/gallium - sources for Gallium and Gallium drivers
-src/glu - libGLU source code
-src/glx - sources for building libGL with full GLX and DRI support
-src/glw - Xt/Motif/OpenGL widget code
-</pre>
-
-If you downloaded and unpacked the MesaGLUT.x.y.z package:
-<pre>
-src/glut - GLUT library source code
-</pre>
-
-<p>
-Proceed to the <a href="install.html">compilation and installation
-instructions</a>.
-</p>
-
-
-</BODY>
-</HTML>
+<HTML>
+
+<TITLE>Getting Mesa</TITLE>
+
+<link rel="stylesheet" type="text/css" href="mesa.css"></head>
+
+<BODY>
+
+<H1>Downloading</H1>
+
+<p>
+Primary Mesa download site:
+<a href="ftp://ftp.freedesktop.org/pub/mesa/"
+target="_parent">freedesktop.org</a> (FTP)
+</p>
+
+<p>
+When a new release is coming, release candidates (betas) may be found
+<a href="ftp://ftp.freedesktop.org/pub/mesa/beta/" target="_parent">here</a>.
+</p>
+
+
+<p>
+The Mesa package is named MesaLib-x.y.z.{tar.bz2, tar.gz, zip} where x.y.z
+is the version. There are three types of compressed archives.
+</p>
+<p>
+There's also the MesaGLUT-x.y.z.{tar.bz2, tar.gz, zip} packages which
+contain Mark Kilgard's GLUT library.
+This is optional.
+Most Linux distributions include an implementation of GLUT (such as freeglut).
+</p>
+<p>
+In the past, the Mesa demos collection was distributed as
+MesaDemos-x.y.z.{tar.bz2, tar.gz, zip}.
+Now, the
+<a href="ftp://ftp.freedesktop.org/pub/mesa/demos/" target="_parent">
+Mesa demos</a> are distributed separately.
+</p>
+
+
+<H1>Unpacking</H1>
+
+<p>
+To unpack .tar.gz files:
+</p>
+<pre>
+ tar zxf MesaLib-x.y.z.tar.gz
+</pre>
+or
+<pre>
+ gzcat MesaLib-x.y.z.tar.gz | tar xf -
+</pre>
+or
+<pre>
+ gunzip MesaLib-x.y.z.tar.gz ; tar xf MesaLib-x.y.z.tar
+</pre>
+<p>
+To unpack .tar.bz2 files:
+</p>
+<pre>
+ bunzip2 -c MesaLib-x.y.z.tar.gz | tar xf -
+</pre>
+<p>
+To unpack .zip files:
+</p>
+<pre>
+ unzip MesaLib-x.y.z.zip
+</pre>
+
+
+<h1>Contents</h1>
+
+<p>
+After unpacking you'll have these files and directories (among others):
+</p>
+<pre>
+Makefile - top-level Makefile for most systems
+configs/ - makefile parameter files for various systems
+include/ - GL header (include) files
+bin/ - shell scripts for making shared libraries, etc
+docs/ - documentation
+src/ - source code for libraries
+src/mesa - sources for the main Mesa library and device drivers
+src/gallium - sources for Gallium and Gallium drivers
+src/glu - libGLU source code
+src/glx - sources for building libGL with full GLX and DRI support
+src/glw - Xt/Motif/OpenGL widget code
+</pre>
+
+If you downloaded and unpacked the MesaGLUT.x.y.z package:
+<pre>
+src/glut - GLUT library source code
+</pre>
+
+<p>
+Proceed to the <a href="install.html">compilation and installation
+instructions</a>.
+</p>
+
+
+</BODY>
+</HTML>
diff --git a/mesalib/docs/envvars.html b/mesalib/docs/envvars.html
index 986d2f8eb..c710bca51 100644
--- a/mesalib/docs/envvars.html
+++ b/mesalib/docs/envvars.html
@@ -1,164 +1,164 @@
-<HTML>
-
-<TITLE>Environment Variables</TITLE>
-
-<link rel="stylesheet" type="text/css" href="mesa.css"></head>
-
-<BODY>
-
-<H1>Environment Variables</H1>
-
-<p>
-Normally, no environment variables need to be set. Most of the environment
-variables used by Mesa/Gallium are for debugging purposes, but they can
-sometimes be useful for debugging end-user issues.
-</p>
-
-
-<H2>LibGL environment variables</H2>
-
-<ul>
-<li>LIBGL_DEBUG - If defined debug information will be printed to stderr.
- If set to 'verbose' additional information will be printed.
-<li>LIBGL_DRIVERS_PATH - colon-separated list of paths to search for DRI drivers
-<li>LIBGL_ALWAYS_INDIRECT - forces an indirect rendering context/connection.
-<li>LIBGL_ALWAYS_SOFTWARE - if set, always use software rendering
-<li>LIBGL_NO_DRAWARRAYS - if set do not use DrawArrays GLX protocol (for debugging)
-</ul>
-
-
-
-<H2>Core Mesa environment variables</H2>
-
-<ul>
-<li>MESA_NO_ASM - if set, disables all assembly language optimizations
-<li>MESA_NO_MMX - if set, disables Intel MMX optimizations
-<li>MESA_NO_3DNOW - if set, disables AMD 3DNow! optimizations
-<li>MESA_NO_SSE - if set, disables Intel SSE optimizations
-<li>MESA_DEBUG - if set, error messages are printed to stderr. For example,
- if the application generates a GL_INVALID_ENUM error, a corresponding error
- message indicating where the error occured, and possibly why, will be
- printed to stderr.<br>
- If the value of MESA_DEBUG is 'FP' floating point arithmetic errors will
- generate exceptions.
-<li>MESA_TEX_PROG - if set, implement conventional texture env modes with
-fragment programs (intended for developers only)
-<li>MESA_TNL_PROG - if set, implement conventional vertex transformation
-operations with vertex programs (intended for developers only).
-Setting this variable automatically sets the MESA_TEX_PROG variable as well.
-<li>MESA_EXTENSION_OVERRIDE - can be used to enable/disable extensions.
-A value such as "GL_EXT_foo -GL_EXT_bar" will enable the GL_EXT_foo extension
-and disable the GL_EXT_bar extension.
-<li>MESA_EXTENSION_MAX_YEAR - The GL_EXTENSIONS string returned by Mesa is sorted
-by extension year.
-If this variable is set to year X, only extensions defined on or before year
-X will be reported.
-This is to work-around a bug in some games where the extension string is
-copied into a fixed-size buffer without truncating.
-If the extension string is too long, the buffer overrun can cause the game
-to crash.
-This is a work-around for that.
-<li>MESA_GLSL - <a href="shading.html#envvars">shading language compiler options</a>
-</ul>
-
-
-<H2>Mesa Xlib driver environment variables</H2>
-
-<p>
-The following are only applicable to the Mesa Xlib software driver.
-See the <A HREF="xlibdriver.html">Xlib software driver page</A> for details.
-</p>
-<ul>
-<li>MESA_RGB_VISUAL - specifies the X visual and depth for RGB mode
-<li>MESA_CI_VISUAL - specifies the X visual and depth for CI mode
-<li>MESA_BACK_BUFFER - specifies how to implement the back color buffer,
- either "pixmap" or "ximage"
-<li>MESA_GAMMA - gamma correction coefficients for red, green, blue channels
-<li>MESA_XSYNC - enable synchronous X behavior (for debugging only)
-<li>MESA_GLX_FORCE_CI - if set, force GLX to treat 8bpp visuals as CI visuals
-<li>MESA_GLX_FX - set to either "fullscreen" for full-screen rendering,
- "window" to render into a window, or "disable" to disable the Glide driver.
-<li>MESA_GLX_FORCE_ALPHA - if set, forces RGB windows to have an alpha channel.
-<li>MESA_GLX_DEPTH_BITS - specifies default number of bits for depth buffer.
-<li>MESA_GLX_ALPHA_BITS - specifies default number of bits for alpha channel.
-</ul>
-
-
-<h2>i945/i965 driver environment variables (non-Gallium)</h2>
-
-<ul>
-<li>INTEL_STRICT_CONFORMANCE - if set to 1, enable sw fallbacks to improve
- OpenGL conformance. If set to 2, always use software rendering.
-<li>INTEL_NO_BLIT - if set, disable hardware-accelerated glBitmap,
- glCopyPixels, glDrawPixels.
-</ul>
-
-
-<h2>Radeon R300 driver environment variables (non-Gallium)</h2>
-
-<ul>
-<li>R300_NO_TCL - if set, disable hardware-accelerated Transform/Clip/Lighting.
-</ul>
-
-
-<h2>EGL environment variables</h2>
-
-<p>
-Mesa EGL supports different sets of environment variables. See the
-<a href="egl.html">Mesa EGL</a> page for the details.
-</p>
-
-
-<h2>Gallium environment variables</h2>
-
-<ul>
-<li>GALLIUM_PRINT_OPTIONS - if non-zero, print all the Gallium environment
- variables which are used, and their current values.
-<li>GALLIUM_NOSSE - if non-zero, do not use SSE runtime code generation for
- shader execution
-<li>GALLIUM_NOPPC - if non-zero, do not use PPC runtime code generation for
- shader execution
-<li>GALLIUM_DUMP_CPU - if non-zero, print information about the CPU on start-up
-<li>TGSI_PRINT_SANITY - if set, do extra sanity checking on TGSI shaders and
- print any errors to stderr.
-<LI>DRAW_FSE - ???
-<LI>DRAW_NO_FSE - ???
-<li>DRAW_USE_LLVM - if set to zero, the draw module will not use LLVM to execute
- shaders, vertex fetch, etc.
-</ul>
-
-<h3>Softpipe driver environment variables</h3>
-<ul>
-<li>SOFTPIPE_DUMP_FS - if set, the softpipe driver will print fragment shaders
- to stderr
-<li>SOFTPIPE_DUMP_GS - if set, the softpipe driver will print geometry shaders
- to stderr
-<li>SOFTPIPE_NO_RAST - if set, rasterization is no-op'd. For profiling purposes.
-</ul>
-
-
-<h3>LLVMpipe driver environment variables</h3>
-<ul>
-<li>LP_NO_RAST - if set LLVMpipe will no-op rasterization
-<li>LP_DEBUG - a comma-separated list of debug options is acceptec. See the
- source code for details.
-<li>LP_PERF - a comma-separated list of options to selectively no-op various
- parts of the driver. See the source code for details.
-<li>LP_NUM_THREADS - an integer indicating how many threads to use for rendering.
- Zero turns of threading completely. The default value is the number of CPU
- cores present.
-</ul>
-
-
-<p>
-Other Gallium drivers have their own environment variables. These may change
-frequently so the source code should be consulted for details.
-</p>
-
-
-<br>
-<br>
-
-
-</BODY>
-</HTML>
+<HTML>
+
+<TITLE>Environment Variables</TITLE>
+
+<link rel="stylesheet" type="text/css" href="mesa.css"></head>
+
+<BODY>
+
+<H1>Environment Variables</H1>
+
+<p>
+Normally, no environment variables need to be set. Most of the environment
+variables used by Mesa/Gallium are for debugging purposes, but they can
+sometimes be useful for debugging end-user issues.
+</p>
+
+
+<H2>LibGL environment variables</H2>
+
+<ul>
+<li>LIBGL_DEBUG - If defined debug information will be printed to stderr.
+ If set to 'verbose' additional information will be printed.
+<li>LIBGL_DRIVERS_PATH - colon-separated list of paths to search for DRI drivers
+<li>LIBGL_ALWAYS_INDIRECT - forces an indirect rendering context/connection.
+<li>LIBGL_ALWAYS_SOFTWARE - if set, always use software rendering
+<li>LIBGL_NO_DRAWARRAYS - if set do not use DrawArrays GLX protocol (for debugging)
+</ul>
+
+
+
+<H2>Core Mesa environment variables</H2>
+
+<ul>
+<li>MESA_NO_ASM - if set, disables all assembly language optimizations
+<li>MESA_NO_MMX - if set, disables Intel MMX optimizations
+<li>MESA_NO_3DNOW - if set, disables AMD 3DNow! optimizations
+<li>MESA_NO_SSE - if set, disables Intel SSE optimizations
+<li>MESA_DEBUG - if set, error messages are printed to stderr. For example,
+ if the application generates a GL_INVALID_ENUM error, a corresponding error
+ message indicating where the error occured, and possibly why, will be
+ printed to stderr.<br>
+ If the value of MESA_DEBUG is 'FP' floating point arithmetic errors will
+ generate exceptions.
+<li>MESA_TEX_PROG - if set, implement conventional texture env modes with
+fragment programs (intended for developers only)
+<li>MESA_TNL_PROG - if set, implement conventional vertex transformation
+operations with vertex programs (intended for developers only).
+Setting this variable automatically sets the MESA_TEX_PROG variable as well.
+<li>MESA_EXTENSION_OVERRIDE - can be used to enable/disable extensions.
+A value such as "GL_EXT_foo -GL_EXT_bar" will enable the GL_EXT_foo extension
+and disable the GL_EXT_bar extension.
+<li>MESA_EXTENSION_MAX_YEAR - The GL_EXTENSIONS string returned by Mesa is sorted
+by extension year.
+If this variable is set to year X, only extensions defined on or before year
+X will be reported.
+This is to work-around a bug in some games where the extension string is
+copied into a fixed-size buffer without truncating.
+If the extension string is too long, the buffer overrun can cause the game
+to crash.
+This is a work-around for that.
+<li>MESA_GLSL - <a href="shading.html#envvars">shading language compiler options</a>
+</ul>
+
+
+<H2>Mesa Xlib driver environment variables</H2>
+
+<p>
+The following are only applicable to the Mesa Xlib software driver.
+See the <A HREF="xlibdriver.html">Xlib software driver page</A> for details.
+</p>
+<ul>
+<li>MESA_RGB_VISUAL - specifies the X visual and depth for RGB mode
+<li>MESA_CI_VISUAL - specifies the X visual and depth for CI mode
+<li>MESA_BACK_BUFFER - specifies how to implement the back color buffer,
+ either "pixmap" or "ximage"
+<li>MESA_GAMMA - gamma correction coefficients for red, green, blue channels
+<li>MESA_XSYNC - enable synchronous X behavior (for debugging only)
+<li>MESA_GLX_FORCE_CI - if set, force GLX to treat 8bpp visuals as CI visuals
+<li>MESA_GLX_FX - set to either "fullscreen" for full-screen rendering,
+ "window" to render into a window, or "disable" to disable the Glide driver.
+<li>MESA_GLX_FORCE_ALPHA - if set, forces RGB windows to have an alpha channel.
+<li>MESA_GLX_DEPTH_BITS - specifies default number of bits for depth buffer.
+<li>MESA_GLX_ALPHA_BITS - specifies default number of bits for alpha channel.
+</ul>
+
+
+<h2>i945/i965 driver environment variables (non-Gallium)</h2>
+
+<ul>
+<li>INTEL_STRICT_CONFORMANCE - if set to 1, enable sw fallbacks to improve
+ OpenGL conformance. If set to 2, always use software rendering.
+<li>INTEL_NO_BLIT - if set, disable hardware-accelerated glBitmap,
+ glCopyPixels, glDrawPixels.
+</ul>
+
+
+<h2>Radeon R300 driver environment variables (non-Gallium)</h2>
+
+<ul>
+<li>R300_NO_TCL - if set, disable hardware-accelerated Transform/Clip/Lighting.
+</ul>
+
+
+<h2>EGL environment variables</h2>
+
+<p>
+Mesa EGL supports different sets of environment variables. See the
+<a href="egl.html">Mesa EGL</a> page for the details.
+</p>
+
+
+<h2>Gallium environment variables</h2>
+
+<ul>
+<li>GALLIUM_PRINT_OPTIONS - if non-zero, print all the Gallium environment
+ variables which are used, and their current values.
+<li>GALLIUM_NOSSE - if non-zero, do not use SSE runtime code generation for
+ shader execution
+<li>GALLIUM_NOPPC - if non-zero, do not use PPC runtime code generation for
+ shader execution
+<li>GALLIUM_DUMP_CPU - if non-zero, print information about the CPU on start-up
+<li>TGSI_PRINT_SANITY - if set, do extra sanity checking on TGSI shaders and
+ print any errors to stderr.
+<LI>DRAW_FSE - ???
+<LI>DRAW_NO_FSE - ???
+<li>DRAW_USE_LLVM - if set to zero, the draw module will not use LLVM to execute
+ shaders, vertex fetch, etc.
+</ul>
+
+<h3>Softpipe driver environment variables</h3>
+<ul>
+<li>SOFTPIPE_DUMP_FS - if set, the softpipe driver will print fragment shaders
+ to stderr
+<li>SOFTPIPE_DUMP_GS - if set, the softpipe driver will print geometry shaders
+ to stderr
+<li>SOFTPIPE_NO_RAST - if set, rasterization is no-op'd. For profiling purposes.
+</ul>
+
+
+<h3>LLVMpipe driver environment variables</h3>
+<ul>
+<li>LP_NO_RAST - if set LLVMpipe will no-op rasterization
+<li>LP_DEBUG - a comma-separated list of debug options is acceptec. See the
+ source code for details.
+<li>LP_PERF - a comma-separated list of options to selectively no-op various
+ parts of the driver. See the source code for details.
+<li>LP_NUM_THREADS - an integer indicating how many threads to use for rendering.
+ Zero turns of threading completely. The default value is the number of CPU
+ cores present.
+</ul>
+
+
+<p>
+Other Gallium drivers have their own environment variables. These may change
+frequently so the source code should be consulted for details.
+</p>
+
+
+<br>
+<br>
+
+
+</BODY>
+</HTML>
diff --git a/mesalib/docs/install.html b/mesalib/docs/install.html
index e1018119a..b82b1d743 100644
--- a/mesalib/docs/install.html
+++ b/mesalib/docs/install.html
@@ -1,345 +1,345 @@
-<HTML>
-
-<TITLE>Compiling and Installing</TITLE>
-
-<link rel="stylesheet" type="text/css" href="mesa.css"></head>
-
-<BODY>
-
-
-<H1>Compiling and Installing</H1>
-
-<ol>
-<li><a href="#unix-x11">Unix / X11</a>
- <ul>
- <li><a href="#prereq-general">General prerequisites for building</a>
- <li><a href="#prereq-dri">Prerequisites for DRI and hardware acceleration</a>
- <li><a href="#autoconf">Building with autoconf</a>
- <li><a href="#traditional">Building with traditional Makefiles</a>
- <li><a href="#libs">The Libraries</a>
- <li><a href="#install">Installing the header and library files
- <li><a href="#pkg-config">Building OpenGL programs with pkg-config
- </ul>
-<li><a href="#windows">Windows</a>
-<li><a href="#scons">Building with SCons</a>
-<li><a href="#other">Other</a>
-</ol>
-<br>
-
-
-<a name="unix-x11">
-<H2>1. Unix/X11 Compilation and Installation</H1>
-
-
-<a name="prereq-general">
-<h3>1.1 General prerequisites for building</h3>
-
-<ul>
-<li>lex / yacc - for building the GLSL compiler.
-On Linux systems, flex and bison are used.
-Versions 2.5.35 and 2.4.1, respectively, (or later) should work.
-</li>
-<li>python - Python is needed for building the Gallium components.
-Version 2.6.4 or later should work.
-</li>
-</ul>
-
-
-<a name="prereq-dri">
-<h3>1.2 Prerequisites for DRI and hardware acceleration</h3>
-
-<p>
-The following are required for DRI-based hardware acceleration with Mesa:
-</p>
-
-<ul>
-<li><a href="http://xorg.freedesktop.org/releases/individual/proto/">dri2proto</a> version 1.99.3 or later
-<li>Linux 2.6.28
-<li><a href="http://dri.freedesktop.org/libdrm/" target="_parent">libDRM</a>
-version 2.4.15 or later
-<li>Xorg server version 1.5 or later
-</ul>
-</p>
-
-
-<a name="autoconf">
-<h3>1.3 Building with Autoconf</h3>
-
-<p>
-Mesa may be <a href="autoconf.html">built using autoconf</a>.
-This should work well on most GNU-based systems.
-If that fails the traditional Mesa build system is available.
-
-
-
-<a name="traditional">
-<h3>1.4 Building with traditional Makefiles</h3>
-
-<p>
-The traditional Mesa build system is based on a collection of pre-defined
-system configurations.
-</p>
-<p>
-To see the list of configurations, just type <code>make</code>.
-Then choose a configuration from the list and type <code>make</code>
-<em>configname</em>.
-</p>
-
-<p>
-Mesa may be built in several different ways using the predefined configurations:
-</p>
-<ul>
-<li><b><em>Stand-alone/Xlib mode</em></b> - Mesa will be compiled as
-a software renderer using Xlib to do all rendering.
-The libGL.so library will be a self-contained rendering library that will
-allow you to run OpenGL/GLX applications on any X server (regardless of
-whether it supports the GLX X server extension).
-You will <em>not</em> be able to use hardware 3D acceleration.
-<p>
-To compile stand-alone Mesa type <code>make</code> in the top-level directory.
-You'll see a list of supported system configurations.
-Choose one from the list (such as linux-x86), and type:
-</p>
-<pre>
- make linux-x86
-</pre>
-<p>This will produce libGL.so and several other libraries</p>
-</li>
-
-<li><b><em>DRI/accelerated</em></b> - The DRI hardware drivers for
-accelerated OpenGL rendering (for ATI, Intel, Matrox, etc) will be built.
-The libGL.so library will support the GLX extension and will load/use
-the DRI hardware drivers.
-
-
-<p>
-Build Mesa and the DRI hardware drivers by running
-</p>
-<pre>
- make linux-dri
-</pre>
-<p>
-There are also <code>linux-dri-x86</code>, <code>linux-dri-x86-64</code>,
-and <code>linux-ppc</code> configurations which are optimized for those
-architectures.
-</p>
-<p>
-Make sure you have the prerequisite versions of DRM and Xserver mentioned
-above.
-</p>
-
-</li>
-
-</ul>
-
-
-<p>
-Later, if you want to rebuild for a different configuration run
-<code>make realclean</code> before rebuilding.
-</p>
-
-
-<a name="libs">
-<h3>1.5 The libraries</h3>
-
-<p>
-When compilation has finished, look in the top-level <code>lib/</code>
-(or <code>lib64/</code>) directory.
-You'll see a set of library files similar to this:
-</p>
-<pre>
-lrwxrwxrwx 1 brian users 10 Mar 26 07:53 libGL.so -> libGL.so.1*
-lrwxrwxrwx 1 brian users 19 Mar 26 07:53 libGL.so.1 -> libGL.so.1.5.060100*
--rwxr-xr-x 1 brian users 3375861 Mar 26 07:53 libGL.so.1.5.060100*
-lrwxrwxrwx 1 brian users 11 Mar 26 07:53 libGLU.so -> libGLU.so.1*
-lrwxrwxrwx 1 brian users 20 Mar 26 07:53 libGLU.so.1 -> libGLU.so.1.3.060100*
--rwxr-xr-x 1 brian users 549269 Mar 26 07:53 libGLU.so.1.3.060100*
-lrwxrwxrwx 1 brian users 12 Mar 26 07:53 libglut.so -> libglut.so.3*
-lrwxrwxrwx 1 brian users 16 Mar 26 07:53 libglut.so.3 -> libglut.so.3.7.1*
--rwxr-xr-x 1 brian users 597754 Mar 26 07:53 libglut.so.3.7.1*
-lrwxrwxrwx 1 brian users 11 Mar 26 08:04 libGLw.so -> libGLw.so.1*
-lrwxrwxrwx 1 brian users 15 Mar 26 08:04 libGLw.so.1 -> libGLw.so.1.0.0*
--rwxr-xr-x 1 brian users 20750 Mar 26 08:04 libGLw.so.1.0.0*
-lrwxrwxrwx 1 brian users 14 Mar 26 07:53 libOSMesa.so -> libOSMesa.so.6*
-lrwxrwxrwx 1 brian users 23 Mar 26 07:53 libOSMesa.so.6 -> libOSMesa.so.6.1.060100*
--rwxr-xr-x 1 brian users 23871 Mar 26 07:53 libOSMesa.so.6.1.060100*
-</pre>
-
-<p>
-<b>libGL</b> is the main OpenGL library (i.e. Mesa).
-<br>
-<b>libGLU</b> is the OpenGL Utility library.
-<br>
-<b>libglut</b> is the GLUT library.
-<br>
-<b>libGLw</b> is the Xt/Motif OpenGL drawing area widget library.
-<br>
-<b>libOSMesa</b> is the OSMesa (Off-Screen) interface library.
-</p>
-
-<p>
-If you built the DRI hardware drivers, you'll also see the DRI drivers:
-</p>
-<pre>
--rwxr-xr-x 1 brian users 15607851 Jul 21 12:11 ffb_dri.so
--rwxr-xr-x 1 brian users 15148747 Jul 21 12:11 i810_dri.so
--rwxr-xr-x 1 brian users 14497814 Jul 21 12:11 i830_dri.so
--rwxr-xr-x 1 brian users 16895413 Jul 21 12:11 i915_dri.so
--rwxr-xr-x 1 brian users 11320803 Jul 21 12:11 mach64_dri.so
--rwxr-xr-x 1 brian users 11418014 Jul 21 12:12 mga_dri.so
--rwxr-xr-x 1 brian users 11064426 Jul 21 12:12 r128_dri.so
--rwxr-xr-x 1 brian users 11849858 Jul 21 12:12 r200_dri.so
--rwxr-xr-x 1 brian users 16050488 Jul 21 12:11 r300_dri.so
--rwxr-xr-x 1 brian users 11757388 Jul 21 12:12 radeon_dri.so
--rwxr-xr-x 1 brian users 11232304 Jul 21 12:13 s3v_dri.so
--rwxr-xr-x 1 brian users 11062970 Jul 21 12:13 savage_dri.so
--rwxr-xr-x 1 brian users 11214212 Jul 21 12:13 sis_dri.so
--rwxr-xr-x 1 brian users 11368736 Jul 21 12:13 tdfx_dri.so
--rwxr-xr-x 1 brian users 10598868 Jul 21 12:13 trident_dri.so
--rwxr-xr-x 1 brian users 10997120 Jul 21 12:13 unichrome_dri.so
-</pre>
-
-<p>
-If you built with Gallium support, look in lib/gallium/ for Gallium-based
-versions of libGL and device drivers.
-</p>
-
-
-
-<a name="install">
-<H3>1.6 Installing the header and library files</H3>
-
-<p>
-The standard location for the OpenGL header files on Unix-type systems is
-in <code>/usr/include/GL/</code>.
-The standard location for the libraries is <code>/usr/lib/</code>.
-For more information see, the
-<a href="http://oss.sgi.com/projects/ogl-sample/ABI/" target="_parent">
-Linux/OpenGL ABI specification</a>.
-</p>
-
-<p>
-If you'd like Mesa to co-exist with another implementation of OpenGL that's
-already installed, you'll have to choose different directories, like
-<code>/usr/local/include/GL/</code> and <code>/usr/local/lib/</code>.
-</p>
-
-<p>
-To install Mesa's headers and libraries, run <code>make install</code>.
-But first, check the Mesa/configs/default file and examine the values
-of the <b>INSTALL_DIR</b> and <b>DRI_DRIVER_INSTALL_DIR</b> variables.
-Change them if needed, then run <code>make install</code>.
-</p>
-
-<p>
-The variable
-<b>DESTDIR</b> may also be used to install the contents to a temporary
-staging directory.
-This can be useful for package management.
-For example: <code>make install DESTDIR=/somepath/</code>
-</p>
-
-<p>
-Note: at runtime you can use the LD_LIBRARY_PATH environment variable
-(on Linux at least) to switch
-between the Mesa libraries and other vendor's libraries whenever you want.
-This is a handy way to compare multiple OpenGL implementations.
-</p>
-
-
-<a name="pkg-config">
-<H3>1.7 Building OpenGL programs with pkg-config</H3>
-
-<p>
-Running <code>make install</code> will install package configuration files
-for the pkg-config utility.
-</p>
-
-<p>
-When compiling your OpenGL application you can use pkg-config to determine
-the proper compiler and linker flags.
-</p>
-
-<p>
-For example, compiling and linking a GLUT application can be done with:
-</p>
-<pre>
- gcc `pkg-config --cflags --libs glut` mydemo.c -o mydemo
-</pre>
-
-<br>
-
-<a name="windows">
-<H2>2. Windows Compilation and Installation</H1>
-
-<p>
-Please see the <a href="#scons">instructions on building with SCons</a>.
-</p>
-
-
-
-<a name="scons">
-<H2>3. Building with SCons</H1>
-
-<p>
-To build Mesa with SCons on Linux or Windows do
-</p>
-<pre>
- scons
-</pre>
-<p>
-The build output will be placed in
-build/<i>platform</i>-<i>machine</i>-<i>debug</i>/..., where <i>platform</i> is for
-example linux or windows, <i>machine</i> is x86 or x86_64, optionally followed
-by -debug for debug builds.
-</p>
-
-<p>
-To build Mesa with SCons for Windows on Linux using the MinGW crosscompiler toolchain do
-</p>
-<pre>
- scons platform=windows toolchain=crossmingw machine=x86 statetrackers=mesa drivers=softpipe,trace winsys=gdi
-</pre>
-<p>
-This will create:
-</p>
-<ul>
-<li>build/windows-x86-debug/gallium/targets/libgl-gdi/opengl32.dll &mdash; Mesa + Gallium + softpipe, binary compatible with Windows's opengl32.dll
-<li>build/windows-x86-debug/glut/glx/glut32.dll
-<li>progs/build/windows-x86-debug/wgl/wglinfo.exe
-<li>progs/build/windows-x86-debug/trivial/tri.exe
-<li>and many other samples in progs/build/windows-x86-debug/...
-</ul>
-<p>
-Put them all in the same directory to test them.
-</p>
-
-
-<a name="other">
-<H2>4. Other systems</H1>
-
-<p>
-Documentation for other environments (some may be very out of date):
-</p>
-
-<UL>
-<li><A HREF="README.VMS">README.VMS</A> - VMS
-<LI><A HREF="README.GGI">README.GGI</A> - GGI
-<LI><A HREF="README.3DFX">README.3DFX</A> - 3Dfx/Glide driver
-<LI><A HREF="README.AMIWIN">README.AMIWIN</A> - Amiga Amiwin
-<LI><A HREF="README.BEOS">README.BEOS</A> - BeOS
-<LI><A HREF="README.D3D">README.D3D</A> - Direct3D driver
-<LI><A HREF="README.DJ">README.DJ</A> - DJGPP
-<LI><A HREF="README.LYNXOS">README.LYNXOS</A> - LynxOS
-<LI><A HREF="README.MINGW32">README.MINGW32</A> - Mingw32
-<LI><A HREF="README.NeXT">README.NeXT</A> - NeXT
-<LI><A HREF="README.OpenStep">README.OpenStep</A> - OpenStep
-<LI><A HREF="README.OS2">README.OS2</A> - OS/2
-<LI><A HREF="README.WINDML">README.WINDML</A> - WindML
-</UL>
-
-
-
-
-</body>
-</html>
+<HTML>
+
+<TITLE>Compiling and Installing</TITLE>
+
+<link rel="stylesheet" type="text/css" href="mesa.css"></head>
+
+<BODY>
+
+
+<H1>Compiling and Installing</H1>
+
+<ol>
+<li><a href="#unix-x11">Unix / X11</a>
+ <ul>
+ <li><a href="#prereq-general">General prerequisites for building</a>
+ <li><a href="#prereq-dri">Prerequisites for DRI and hardware acceleration</a>
+ <li><a href="#autoconf">Building with autoconf</a>
+ <li><a href="#traditional">Building with traditional Makefiles</a>
+ <li><a href="#libs">The Libraries</a>
+ <li><a href="#install">Installing the header and library files
+ <li><a href="#pkg-config">Building OpenGL programs with pkg-config
+ </ul>
+<li><a href="#windows">Windows</a>
+<li><a href="#scons">Building with SCons</a>
+<li><a href="#other">Other</a>
+</ol>
+<br>
+
+
+<a name="unix-x11">
+<H2>1. Unix/X11 Compilation and Installation</H1>
+
+
+<a name="prereq-general">
+<h3>1.1 General prerequisites for building</h3>
+
+<ul>
+<li>lex / yacc - for building the GLSL compiler.
+On Linux systems, flex and bison are used.
+Versions 2.5.35 and 2.4.1, respectively, (or later) should work.
+</li>
+<li>python - Python is needed for building the Gallium components.
+Version 2.6.4 or later should work.
+</li>
+</ul>
+
+
+<a name="prereq-dri">
+<h3>1.2 Prerequisites for DRI and hardware acceleration</h3>
+
+<p>
+The following are required for DRI-based hardware acceleration with Mesa:
+</p>
+
+<ul>
+<li><a href="http://xorg.freedesktop.org/releases/individual/proto/">dri2proto</a> version 1.99.3 or later
+<li>Linux 2.6.28
+<li><a href="http://dri.freedesktop.org/libdrm/" target="_parent">libDRM</a>
+version 2.4.15 or later
+<li>Xorg server version 1.5 or later
+</ul>
+</p>
+
+
+<a name="autoconf">
+<h3>1.3 Building with Autoconf</h3>
+
+<p>
+Mesa may be <a href="autoconf.html">built using autoconf</a>.
+This should work well on most GNU-based systems.
+If that fails the traditional Mesa build system is available.
+
+
+
+<a name="traditional">
+<h3>1.4 Building with traditional Makefiles</h3>
+
+<p>
+The traditional Mesa build system is based on a collection of pre-defined
+system configurations.
+</p>
+<p>
+To see the list of configurations, just type <code>make</code>.
+Then choose a configuration from the list and type <code>make</code>
+<em>configname</em>.
+</p>
+
+<p>
+Mesa may be built in several different ways using the predefined configurations:
+</p>
+<ul>
+<li><b><em>Stand-alone/Xlib mode</em></b> - Mesa will be compiled as
+a software renderer using Xlib to do all rendering.
+The libGL.so library will be a self-contained rendering library that will
+allow you to run OpenGL/GLX applications on any X server (regardless of
+whether it supports the GLX X server extension).
+You will <em>not</em> be able to use hardware 3D acceleration.
+<p>
+To compile stand-alone Mesa type <code>make</code> in the top-level directory.
+You'll see a list of supported system configurations.
+Choose one from the list (such as linux-x86), and type:
+</p>
+<pre>
+ make linux-x86
+</pre>
+<p>This will produce libGL.so and several other libraries</p>
+</li>
+
+<li><b><em>DRI/accelerated</em></b> - The DRI hardware drivers for
+accelerated OpenGL rendering (for ATI, Intel, Matrox, etc) will be built.
+The libGL.so library will support the GLX extension and will load/use
+the DRI hardware drivers.
+
+
+<p>
+Build Mesa and the DRI hardware drivers by running
+</p>
+<pre>
+ make linux-dri
+</pre>
+<p>
+There are also <code>linux-dri-x86</code>, <code>linux-dri-x86-64</code>,
+and <code>linux-ppc</code> configurations which are optimized for those
+architectures.
+</p>
+<p>
+Make sure you have the prerequisite versions of DRM and Xserver mentioned
+above.
+</p>
+
+</li>
+
+</ul>
+
+
+<p>
+Later, if you want to rebuild for a different configuration run
+<code>make realclean</code> before rebuilding.
+</p>
+
+
+<a name="libs">
+<h3>1.5 The libraries</h3>
+
+<p>
+When compilation has finished, look in the top-level <code>lib/</code>
+(or <code>lib64/</code>) directory.
+You'll see a set of library files similar to this:
+</p>
+<pre>
+lrwxrwxrwx 1 brian users 10 Mar 26 07:53 libGL.so -> libGL.so.1*
+lrwxrwxrwx 1 brian users 19 Mar 26 07:53 libGL.so.1 -> libGL.so.1.5.060100*
+-rwxr-xr-x 1 brian users 3375861 Mar 26 07:53 libGL.so.1.5.060100*
+lrwxrwxrwx 1 brian users 11 Mar 26 07:53 libGLU.so -> libGLU.so.1*
+lrwxrwxrwx 1 brian users 20 Mar 26 07:53 libGLU.so.1 -> libGLU.so.1.3.060100*
+-rwxr-xr-x 1 brian users 549269 Mar 26 07:53 libGLU.so.1.3.060100*
+lrwxrwxrwx 1 brian users 12 Mar 26 07:53 libglut.so -> libglut.so.3*
+lrwxrwxrwx 1 brian users 16 Mar 26 07:53 libglut.so.3 -> libglut.so.3.7.1*
+-rwxr-xr-x 1 brian users 597754 Mar 26 07:53 libglut.so.3.7.1*
+lrwxrwxrwx 1 brian users 11 Mar 26 08:04 libGLw.so -> libGLw.so.1*
+lrwxrwxrwx 1 brian users 15 Mar 26 08:04 libGLw.so.1 -> libGLw.so.1.0.0*
+-rwxr-xr-x 1 brian users 20750 Mar 26 08:04 libGLw.so.1.0.0*
+lrwxrwxrwx 1 brian users 14 Mar 26 07:53 libOSMesa.so -> libOSMesa.so.6*
+lrwxrwxrwx 1 brian users 23 Mar 26 07:53 libOSMesa.so.6 -> libOSMesa.so.6.1.060100*
+-rwxr-xr-x 1 brian users 23871 Mar 26 07:53 libOSMesa.so.6.1.060100*
+</pre>
+
+<p>
+<b>libGL</b> is the main OpenGL library (i.e. Mesa).
+<br>
+<b>libGLU</b> is the OpenGL Utility library.
+<br>
+<b>libglut</b> is the GLUT library.
+<br>
+<b>libGLw</b> is the Xt/Motif OpenGL drawing area widget library.
+<br>
+<b>libOSMesa</b> is the OSMesa (Off-Screen) interface library.
+</p>
+
+<p>
+If you built the DRI hardware drivers, you'll also see the DRI drivers:
+</p>
+<pre>
+-rwxr-xr-x 1 brian users 15607851 Jul 21 12:11 ffb_dri.so
+-rwxr-xr-x 1 brian users 15148747 Jul 21 12:11 i810_dri.so
+-rwxr-xr-x 1 brian users 14497814 Jul 21 12:11 i830_dri.so
+-rwxr-xr-x 1 brian users 16895413 Jul 21 12:11 i915_dri.so
+-rwxr-xr-x 1 brian users 11320803 Jul 21 12:11 mach64_dri.so
+-rwxr-xr-x 1 brian users 11418014 Jul 21 12:12 mga_dri.so
+-rwxr-xr-x 1 brian users 11064426 Jul 21 12:12 r128_dri.so
+-rwxr-xr-x 1 brian users 11849858 Jul 21 12:12 r200_dri.so
+-rwxr-xr-x 1 brian users 16050488 Jul 21 12:11 r300_dri.so
+-rwxr-xr-x 1 brian users 11757388 Jul 21 12:12 radeon_dri.so
+-rwxr-xr-x 1 brian users 11232304 Jul 21 12:13 s3v_dri.so
+-rwxr-xr-x 1 brian users 11062970 Jul 21 12:13 savage_dri.so
+-rwxr-xr-x 1 brian users 11214212 Jul 21 12:13 sis_dri.so
+-rwxr-xr-x 1 brian users 11368736 Jul 21 12:13 tdfx_dri.so
+-rwxr-xr-x 1 brian users 10598868 Jul 21 12:13 trident_dri.so
+-rwxr-xr-x 1 brian users 10997120 Jul 21 12:13 unichrome_dri.so
+</pre>
+
+<p>
+If you built with Gallium support, look in lib/gallium/ for Gallium-based
+versions of libGL and device drivers.
+</p>
+
+
+
+<a name="install">
+<H3>1.6 Installing the header and library files</H3>
+
+<p>
+The standard location for the OpenGL header files on Unix-type systems is
+in <code>/usr/include/GL/</code>.
+The standard location for the libraries is <code>/usr/lib/</code>.
+For more information see, the
+<a href="http://oss.sgi.com/projects/ogl-sample/ABI/" target="_parent">
+Linux/OpenGL ABI specification</a>.
+</p>
+
+<p>
+If you'd like Mesa to co-exist with another implementation of OpenGL that's
+already installed, you'll have to choose different directories, like
+<code>/usr/local/include/GL/</code> and <code>/usr/local/lib/</code>.
+</p>
+
+<p>
+To install Mesa's headers and libraries, run <code>make install</code>.
+But first, check the Mesa/configs/default file and examine the values
+of the <b>INSTALL_DIR</b> and <b>DRI_DRIVER_INSTALL_DIR</b> variables.
+Change them if needed, then run <code>make install</code>.
+</p>
+
+<p>
+The variable
+<b>DESTDIR</b> may also be used to install the contents to a temporary
+staging directory.
+This can be useful for package management.
+For example: <code>make install DESTDIR=/somepath/</code>
+</p>
+
+<p>
+Note: at runtime you can use the LD_LIBRARY_PATH environment variable
+(on Linux at least) to switch
+between the Mesa libraries and other vendor's libraries whenever you want.
+This is a handy way to compare multiple OpenGL implementations.
+</p>
+
+
+<a name="pkg-config">
+<H3>1.7 Building OpenGL programs with pkg-config</H3>
+
+<p>
+Running <code>make install</code> will install package configuration files
+for the pkg-config utility.
+</p>
+
+<p>
+When compiling your OpenGL application you can use pkg-config to determine
+the proper compiler and linker flags.
+</p>
+
+<p>
+For example, compiling and linking a GLUT application can be done with:
+</p>
+<pre>
+ gcc `pkg-config --cflags --libs glut` mydemo.c -o mydemo
+</pre>
+
+<br>
+
+<a name="windows">
+<H2>2. Windows Compilation and Installation</H1>
+
+<p>
+Please see the <a href="#scons">instructions on building with SCons</a>.
+</p>
+
+
+
+<a name="scons">
+<H2>3. Building with SCons</H1>
+
+<p>
+To build Mesa with SCons on Linux or Windows do
+</p>
+<pre>
+ scons
+</pre>
+<p>
+The build output will be placed in
+build/<i>platform</i>-<i>machine</i>-<i>debug</i>/..., where <i>platform</i> is for
+example linux or windows, <i>machine</i> is x86 or x86_64, optionally followed
+by -debug for debug builds.
+</p>
+
+<p>
+To build Mesa with SCons for Windows on Linux using the MinGW crosscompiler toolchain do
+</p>
+<pre>
+ scons platform=windows toolchain=crossmingw machine=x86 statetrackers=mesa drivers=softpipe,trace winsys=gdi
+</pre>
+<p>
+This will create:
+</p>
+<ul>
+<li>build/windows-x86-debug/gallium/targets/libgl-gdi/opengl32.dll &mdash; Mesa + Gallium + softpipe, binary compatible with Windows's opengl32.dll
+<li>build/windows-x86-debug/glut/glx/glut32.dll
+<li>progs/build/windows-x86-debug/wgl/wglinfo.exe
+<li>progs/build/windows-x86-debug/trivial/tri.exe
+<li>and many other samples in progs/build/windows-x86-debug/...
+</ul>
+<p>
+Put them all in the same directory to test them.
+</p>
+
+
+<a name="other">
+<H2>4. Other systems</H1>
+
+<p>
+Documentation for other environments (some may be very out of date):
+</p>
+
+<UL>
+<li><A HREF="README.VMS">README.VMS</A> - VMS
+<LI><A HREF="README.GGI">README.GGI</A> - GGI
+<LI><A HREF="README.3DFX">README.3DFX</A> - 3Dfx/Glide driver
+<LI><A HREF="README.AMIWIN">README.AMIWIN</A> - Amiga Amiwin
+<LI><A HREF="README.BEOS">README.BEOS</A> - BeOS
+<LI><A HREF="README.D3D">README.D3D</A> - Direct3D driver
+<LI><A HREF="README.DJ">README.DJ</A> - DJGPP
+<LI><A HREF="README.LYNXOS">README.LYNXOS</A> - LynxOS
+<LI><A HREF="README.MINGW32">README.MINGW32</A> - Mingw32
+<LI><A HREF="README.NeXT">README.NeXT</A> - NeXT
+<LI><A HREF="README.OpenStep">README.OpenStep</A> - OpenStep
+<LI><A HREF="README.OS2">README.OS2</A> - OS/2
+<LI><A HREF="README.WINDML">README.WINDML</A> - WindML
+</UL>
+
+
+
+
+</body>
+</html>
diff --git a/mesalib/docs/news.html b/mesalib/docs/news.html
index a6a658aef..5c21c11cd 100644
--- a/mesalib/docs/news.html
+++ b/mesalib/docs/news.html
@@ -1,1326 +1,1326 @@
-<HTML>
-
-<TITLE>Mesa News</TITLE>
-
-<head><link rel="stylesheet" type="text/css" href="mesa.css"></head>
-
-<BODY>
-
-<body bgcolor="#eeeeee">
-
-<H1>News</H1>
-
-
-<h2>April 6, 2011</h2>
-
-<p>
-<a href="relnotes-7.10.2.html">Mesa 7.10.2</a> is released. This is a bug
-fix release release.
-</p>
-
-<h2>March 2, 2011</h2>
-
-<p>
-<a href="relnotes-7.9.2.html">Mesa 7.9.2</a> and
-<a href="relnotes-7.10.1.html">Mesa 7.10.1</a> are released. These are
-stable releases containing bug fixes since the 7.9.1 and 7.10 releases.
-</p>
-
-
-<h2>October 4, 2010</h2>
-
-<p>
-<a href="relnotes-7.9.html">Mesa 7.9</a> (final) is released. This is a new
-development release.
-</p>
-
-
-<h2>September 27, 2010</h2>
-
-<p>
-<a href="relnotes-7.9.html">Mesa 7.9.0-rc1</a> is released. This is a
-release candidate for the 7.9 development release.
-</p>
-
-
-<h2>June 16, 2010</h2>
-
-<p>
-<a href="relnotes-7.8.2.html">Mesa 7.8.2</a> is released. This is a bug-fix
-release collecting fixes since the 7.8.1 release.
-</p>
-
-
-<h2>April 5, 2010</h2>
-
-<p>
-<a href="relnotes-7.8.1.html">Mesa 7.8.1</a> is released. This is a bug-fix
-release for a few critical issues in the 7.8 release.
-</p>
-
-
-<h2>March 28, 2010</h2>
-<p>
-<a href="relnotes-7.7.1.html">Mesa 7.7.1</a> is released. This is a bug-fix
-release fixing issues found in the 7.7 release.
-</p>
-<p>
-Also, <a href="relnotes-7.8.html">Mesa 7.8</a> is released. This is a new
-development release.
-</p>
-
-
-
-<h2>December 21, 2009</h2>
-<p>
-<a href="relnotes-7.6.1.html">Mesa 7.6.1</a> is released. This is a bug-fix
-release fixing issues found in the 7.6 release.
-</p>
-<p>
-Also, <a href="relnotes-7.7.html">Mesa 7.7</a> is released. This is a new
-development release.
-</p>
-
-
-<h2>September 28, 2009</h2>
-<p>
-<a href="relnotes-7.6.html">Mesa 7.6</a> is released. This is a new feature
-release. Those especially concerned about stability may want to wait for the
-follow-on 7.6.1 bug-fix release.
-</p>
-<p>
-<a href="relnotes-7.5.2.html">Mesa 7.5.2</a> is also released.
-This is a stable release fixing bugs since the 7.5.1 release.
-</p>
-
-
-<h2>September 3, 2009</h2>
-<p>
-<a href="relnotes-7.5.1.html">Mesa 7.5.1</a> is released.
-This is a bug-fix release which fixes bugs found in version 7.5.
-</p>
-
-
-<h2>July 17, 2009</h2>
-<p>
-<a href="relnotes-7.5.html">Mesa 7.5</a> is released.
-This is a new features release. People especially concerned about
-stability may want to wait for the follow-on 7.5.1 bug-fix release.
-</p>
-
-
-<h2>June 23, 2009</h2>
-<p>
-<a href="relnotes-7.4.4.html">Mesa 7.4.4</a> is released.
-This is a stable release that fixes a regression in the i915/i965 drivers
-that slipped into the 7.4.3 release.
-</p>
-
-
-<h2>June 19, 2009</h2>
-<p>
-<a href="relnotes-7.4.3.html">Mesa 7.4.3</a> is released.
-This is a stable release fixing bugs since the 7.4.2 release.
-</p>
-
-
-<h2>May 15, 2009</h2>
-<p>
-<a href="relnotes-7.4.2.html">Mesa 7.4.2</a> is released.
-This is a stable release fixing bugs since the 7.4.1 release.
-</p>
-
-
-<h2>April 18, 2009</h2>
-<p>
-<a href="relnotes-7.4.1.html">Mesa 7.4.1</a> is released.
-This is a stable release fixing bugs since the 7.4 release.
-</p>
-
-
-<h2>March 27, 2009</h2>
-<p>
-<a href="relnotes-7.4.html">Mesa 7.4</a> is released.
-This is a stable release fixing bugs since the 7.3 release.
-</p>
-
-
-<h2>January 22, 2009</h2>
-<p>
-<a href="relnotes-7.3.html">Mesa 7.3</a> is released.
-This is a new development release.
-Mesa 7.4 will follow and will have bug fixes relative to 7.3.
-</p>
-
-
-<h2>September 20, 2008</h2>
-<p>
-<a href="relnotes-7.2.html">Mesa 7.2</a> is released.
-This is a stable, bug-fix release.
-</p>
-
-
-<h2>August 26, 2008</h2>
-<p>
-<a href="relnotes-7.1.html">Mesa 7.1</a> is released.
-This is a new development release.
-It should be relatively stable, but those especially concerned about
-stability should wait for the 7.2 release or use Mesa 7.0.4 (the
-previous stable release).
-</p>
-
-
-<h2>August 16, 2008</h2>
-<p>
-<a href="relnotes-7.0.4.html">Mesa 7.0.4</a> is released.
-This is a bug-fix release.
-</p>
-
-
-<h2>April 4, 2008</h2>
-<p>
-<a href="relnotes-7.0.3.html">Mesa 7.0.3</a> is released.
-This is a bug-fix release.
-</p>
-
-
-<h2>January 24, 2008</h2>
-
-<p>
-Added a new page describing the <a href="cell.html">Mesa Cell driver</a>.
-</p>
-
-
-
-<h2>November 13, 2007</h2>
-
-<p>
-Gallium3D is the codename for the new Mesa device driver architecture
-which is currently under development.
-</p>
-<p>
-Gallium3D development is taking place on the <em>gallium-0.1</em> branch
-of the git repository.
-Currently, there's only a software-only driver and an Intel i915/945 driver
-but other drivers will be coming...
-</p>
-
-
-<h2>November 10, 2007</h2>
-<p>
-<a href="relnotes-7.0.2.html">Mesa 7.0.2</a> is released.
-This is a bug-fix release.
-</p>
-
-
-<h2>August 3, 2007</h2>
-<p>
-<a href="relnotes-7.0.1.html">Mesa 7.0.1</a> is released.
-This is a bug-fix release.
-</p>
-
-
-<h2>June 22, 2007</h2>
-<p>
-<a href="relnotes-7.0.html">Mesa 7.0</a> is released.
-This is a stable release featuring OpenGL 2.1 support.
-</p>
-
-
-<h2>April 27, 2007</h2>
-<p>
-<a href="relnotes-6.5.3.html">Mesa 6.5.3</a> is released.
-This is a development release which will lead up to the Mesa 7.0 release
-(which will advertise OpenGL 2.1 API support).
-</p>
-
-
-<h2>March 26, 2007</h2>
-<p>
-The new Shading Language compiler branch has been merged into the git
-master branch. This is a step toward hardware support for the OpenGL
-2.0 Shading Language and will be included in the next Mesa release.
-In conjunction, <a href="http://glean.sf.net" target="_parent">Glean
-</a> has been updated with a new test that does over 130 tests of the
-shading language and built-in functions.
-</p>
-
-<h2>April 2007</h2>
-<p>
-Thomas Hellstr&ouml;m of Tungsten Graphics has written a whitepaper
-describing the new DRI memory management system</a>.
-</p>
-
-<h2>December 5, 2006</h2>
-<p>
-Mesa is now using git as its source code management system.
-The previous CVS repository should no longer be used.
-See the <a href="repository.html">repository page</a> for more information.
-</p>
-
-<h2>December 2, 2006</h2>
-<p>
-<a href="relnotes-6.5.2.html">Mesa 6.5.2</a> has been released.
-This is a new development release.
-</p>
-
-<h2>September 15, 2006</h2>
-<p>
-<a href="relnotes-6.5.1.html">Mesa 6.5.1</a> has been released.
-This is a new development release.
-</p>
-
-<h2>March 31, 2006</h2>
-<p>
-<a href="relnotes-6.5.html">Mesa 6.5</a> has been released.
-This is a new development release.
-</p>
-
-
-<h2>February 2, 2006</h2>
-<p>
-<a href="relnotes-6.4.2.html">Mesa 6.4.2</a> has been released.
-This is stable, bug-fix release.
-</p>
-
-
-<h2>November 29, 2005</h2>
-<p>
-<a href="relnotes-6.4.1.html">Mesa 6.4.1</a> has been released.
-This is stable, bug-fix release.
-</p>
-
-
-
-<h2>October 24, 2005</h2>
-<p>
-<a href="relnotes-6.4.html">Mesa 6.4</a> has been released.
-This is stable, bug-fix release.
-</p>
-
-
-<h2>August 19, 2005</h2>
-<p>
-Mesa 6.3.2 has been released.
-Note: there was no public release of version 6.3.1.
-</p>
-<a href="versions.html#6.3.2">Changes in version 6.3.1</a>
-<p>
-The MD5 checksums are:
-</p>
-<pre>
-98192e45ed8d69113688f89f90869346 MesaLib-6.3.2.tar.gz
-0df27701df0924d17ddf41185efa8ce1 MesaLib-6.3.2.tar.bz2
-ccb2423aab77fc7e81ce628734586140 MesaLib-6.3.2.zip
-9d0fca0a7d051c34a0b485423fb3e85d MesaDemos-6.3.2.tar.gz
-96708868450c188205e42229b5d813c4 MesaDemos-6.3.2.tar.bz2
-c5102501e609aa8996d832fafacb8ab9 MesaDemos-6.3.2.zip
-</pre>
-
-
-<h2>July 20, 2005</h2>
-<p>
-Mesa 6.3 has been released.
-This is a development release with new features, changes and bug fixes.
-</p>
-<pre>
- New:
- - GL_EXT_framebuffer_object extension
- - GL_ARB_draw_buffers extension
- - GL_ARB_pixel_buffer_object extension
- - GL_OES_read_format extension (Ian Romanick)
- - DirectFB driver (Claudio Ciccani)
- - x86_64 vertex transformation code (Mikko T.)
- Changes:
- - added -stereo option for glxgears demo (Jacek Rosik)
- - updated the PBuffer demo code in xdemos/ directory
- - glDeleteTextures/Programs/Buffers() now makes the object ID
- available for immediate re-use
- - assorted 64-bit clean-ups fixes (x86_64 and Win64)
- - lots of internal changes for GL_EXT_framebuffer_object
- Bug fixes:
- - some functions didn't support PBO functionality
- - glGetTexImage didn't convert color index images to RGBA as required
- - fragment program texcoords were sometimes wrong for points and lines
- - fixed problem with negative dot product in arbfplight, fplight demos
- - fixed bug in perspective correction of antialiased, textured lines
- - querying GL_POST_CONVOLUTION_ALPHA_BIAS_EXT returned wrong value
- - fixed a couple per-pixel fog bugs (Soju Matsumoto)
- - glGetBooleanv(GL_FRAGMENT_PROGRAM_BINDING_NV) was broken
- - fixed float parsing bug in ARB frag/vert programs (bug 2520)
- - XMesaGetDepthBuffer() returned incorrect value for bytesPerValue
- - GL_COLOR_MATERIAL with glColor3 didn't properly set diffuse alpha
- - glXChooseFBConfig() crashed if attribList pointer was NULL
- - program state.light[n].spot.direction.w was wrong value (bug 3083)
- - fragment program fog option required glEnable(GL_FOG) - wrong.
- - glColorTable() could produce a Mesa implementation error (bug 3135)
- - RasterPos could get corrupted by color index rendering path
- - Removed bad XTranslateCoordinates call when rendering to Pixmaps
- - glPopAttrib() didn't properly restore GL_TEXTURE_GEN enable state
- - fixed a few Darwin compilation problems
-</pre>
-<p>
-The MD5 checksums are:
-</p>
-<pre>
-0236f552d37514776945d5a013e5bb7b MesaLib-6.3.tar.gz
-60e1a8f78c4a8c7750a1e95753190986 MesaLib-6.3.tar.bz2
-ca7c950fbace68c70caa822322db7223 MesaLib-6.3.zip
-25ea801645b376c014051804fe4974b2 MesaDemos-6.3.tar.gz
-9248e74872ea88c57ec25c900c295057 MesaDemos-6.3.tar.bz2
-8537dfa734ef258dcc7272097558d434 MesaDemos-6.3.zip
-</pre>
-
-
-<h2>December 9, 2004</h2>
-<p>
-Mesa 6.2.1 has been released.
-This is a stable release which just fixes bugs since the 6.2 release.
-</p>
-<pre>
- Bug fixes:
- - don't apply regular fog or color sum when using a fragment program
- - glProgramEnvParameter4fARB always generated an error on
- GL_FRAGMENT_PROGRAM_ARB (fdo bug 1645)
- - glVertexAttrib3svNV and glVertexAttrib3svARB were broken
- - fixed width/height mix-up in glSeparableFilter2D()
- - fixed regression in glCopyPixels + convolution
- - glReadPixels from a clipped front color buffer didn't always work
- - glTexImage didn't accept GL_RED/GREEN/BLUE as the format
- - Attempting queries/accesses of VBO 0 weren't detected as errors
- - paletted textures failed if the palette had fewer than 256 entries
- Changes:
- - fixed a bunch of compiler warnings found with gcc 3.4
- - bug reports should to go bugzilla.freedesktop.org
-</pre>
-<p>
-The MD5 checksums are:
-</p>
-<pre>
-80008a92f6e055d3bfdde2cf331ec3fa MesaLib-6.2.1.tar.gz
-f43228cd2bf70f583ef3275c1c545421 MesaLib-6.2.1.tar.bz2
-dec26cfd40116ad021020fea2d94f652 MesaLib-6.2.1.zip
-2c7af3c986a7571c8713c8bfee7e49e3 MesaDemos-6.2.1.tar.gz
-3cac74667b50bcbd4f67f594fb4224a2 MesaDemos-6.2.1.tar.bz2
-75b3edd12eb2b370caf05f29b99e508a MesaDemos-6.2.1.zip
-</pre>
-
-
-<h2>October 2, 2004</h2>
-<p>
-Mesa 6.2 has been released.
-This is a stable release which just fixes bugs since the 6.1 release.
-</p>
-<pre>
- New:
- - enabled GL_ARB_texture_rectangle (same as GL_NV_texture_rectangle)
- - updated Doxygen support (Jose Fonseca)
- Changes:
- - some GGI driver updates (Christoph Egger, bug 1025977)
- Bug fixes:
- - Omit GL_ARB_texture_non_power_of_two from list of OpenGL 1.5 features
- - fixed a few compilation issues on IRIX
- - fixed a matrix classification bug (reported by Wes Bethel)
- - we weren't reseting the vertex/fragment program error state
- before parsing (Dave Reveman)
- - adjust texcoords for sampling texture rectangles (Dave Reveman)
- - glGet*(GL_MAX_VERTEX_ATTRIBS_ARB) wasn't implemented
- - repeated calls to glDeleteTexture(t) could lead to a crash
- - fixed potential ref count bugs in VBOs and vertex/fragment programs
- - spriteblast demo didn't handle window size changes correctly
- - glTexSubImage didn't handle pixels=NULL correctly for PBOs
- - fixed color index mode glDrawPixels bug (Karl Schultz)
-</pre>
-<p>
-The MD5 checksums are:
-</p>
-<pre>
-9e8f34b059272dbb8e1f2c968b33bbf0 MesaLib-6.2.tar.gz
-3d6a6362390b6a37d3cb2e615f3ac7db MesaLib-6.2.tar.bz2
-6cfd7895d28e695c0dbbed9469564091 MesaLib-6.2.zip
-3e06e33b0809f09855cb60883b8bdfef MesaDemos-6.2.tar.gz
-9d160009c3dfdb35fe7e4088c9ba8f85 MesaDemos-6.2.tar.bz2
-856f7ec947122eb3c8985ebc2f654dcd MesaDemos-6.2.zip
-</pre>
-
-
-<h2>August 18, 2004</h2>
-<p>
-Mesa 6.1 has been released.
-This is a new development release (version 6.2 will be a stabilization
-release).
-</p>
-<pre>
- New:
- - Revamped Makefile system
- - glXUseRotatedXFont() utility (see xdemos/xuserotfont.c)
- - internal driver interface changes related to texture object
- allocation, vertex/fragment programs, BlendEquationSeparate, etc.
- - option to walk triangle edges with double-precision floats
- (Justin Novosad of Discreet) (see config.h file)
- - support for AUX buffers in software GLX driver
- - updated glext.h to version 24 and glxext.h to version 6
- - new MESA_GLX_FORCE_ALPHA and MESA_GLX_DEPTH_BITS env vars
- - updated BeOS support (Philippe Houdoin)
- Changes:
- - fragment fog interpolation is perspective corrected now
- - new glTexImage code, much cleaner, may be a bit faster
- Bug fixes:
- - glArrayElement in display lists didn't handle generic vertex attribs
- - glFogCoord didn't always work properly
- - ARB_fragment_program fog options didn't work
- - frag prog TEX instruction no longer incorrectly divides s,t,r by q
- - ARB frag prog TEX and TEXP instructions now use LOD=0
- - glTexEnviv in display lists didn't work
- - glRasterPos didn't do texgen or apply texture matrix
- - GL_DOUBLE-valued vertex arrays were broken in some cases
- - fixed texture rectangle edge/border sampling bugs
- - sampling an incomplete texture in a fragment program would segfault
- - glTexImage was missing a few error checks
- - fixed some minor glGetTexParameter glitches
- - GL_INTENSITY was mistakenly accepted as a <format> to glTexImage
- - fragment program writes to RC/HC register were broken
- - fixed a few glitches in GL_HP_occlusion_test extension
- - glBeginQueryARB and glEndQueryARB didn't work inside display lists
- - vertex program state references were broken
- - fixed triangle color interpolation bug on AIX (Shane Blackett)
- - fixed a number of minor memory leaks (bug #1002030)
-</pre>
-The MD5 checksums are:
-</p>
-<pre>
-c9284d295ebcd2e0486cc3cd54e5863c MesaLib-6.1.tar.gz
-5de1f53ec0709f60fc68fdfed57351f3 MesaLib-6.1.tar.bz2
-483e77cac4789a5d36c42f3c0136d6d8 MesaLib-6.1.zip
-8c46cfa6f9732acc6f6c25724aad0246 MesaDemos-6.1.tar.gz
-89bfe0f6c69b39fd0ebd9fff481a4e9b MesaDemos-6.1.tar.bz2
-161268531fcc6f0c5a056430ee97e0c1 MesaDemos-6.1.zip
-</pre>
-
-
-
-<h2>April 2, 2004</h2>
-
-<p>
-Mesa 6.0.1 has been released.
-This release basically just fixes bugs since the 6.0. release.
-</p>
-<pre>
- New:
- - upgraded glext.h to version 22
- - new build targets (Dan Schikore)
- - new linux-x86-opteron build target (Heath Feather)
- Bug fixes:
- - glBindProgramARB didn't update all necessary state
- - fixed build problems on OpenBSD
- - omit CVS directories from tarballs
- - glGetTexImage(GL_COLOR_INDEX) was broken
- - fixed an infinite loop in t&l module
- - silenced some valgrind warnings about using unitialized memory
- - fixed some compilation/link glitches on IRIX (Mike Stephens)
- - glBindProgram wasn't getting compiled into display lists
- - GLX_FBCONFIG_ID wasn't recognized in glXChooseFBConfig() (bug 888079)
- - two-sided lighting and vertex program didn't work (bug 887330)
- - stores to program parameter registers in vertex state programs
- didn't work.
- - fixed glOrtho bug found with gcc 3.2.2 (RH9)
- - glXCreateWindow() wasn't fully implemented (bug 890894)
- - generic vertex attribute arrays didn't work in display lists
- - vertex buffer objects' default usage and access fields were wrong
- - glDrawArrays with start!=0 was broken
- - fragment program PK2H, UP2H, UP4B and UP4UB instructions were broken
- - linux-osmesa16-static config didn't work
- - fixed a few color index rendering problems (bug 910687)
- - glInterleavedArrays didn't respect GL_CLIENT_ACTIVE_TEXTURE
- - OSMesa RGB and BGR modes were broken
- - glProgramStringARB mistakenly required a null-terminated string
- - fragment program XPD instruction was incorrect
- - glGetMaterial() didn't work reliably
-</pre>
-The MD5 checksums are:
-</p>
-<pre>
-011be0e79666c7a6eb9693fbf9348653 MesaLib-6.0.1.tar.gz
-b7f14088c5c2f14490d2739a91102112 MesaLib-6.0.1.tar.bz2
-bf0510cf0a2b87d64cdd317eca3f1db1 MesaLib-6.0.1.zip
-b7b648599e0aaee1c4ffc554a2a9139e MesaDemos-6.0.1.tar.gz
-dd6aadfd9ca8e1cfa90c6ee492bc6f43 MesaDemos-6.0.1.tar.bz2
-eff71d59c211825e949199852f5a2316 MesaDemos-6.0.1.zip
-</pre>
-
-
-
-<h2>January 16, 2004</h2>
-
-<p>
-Mesa 6.0 has been released. This is a stabilization of the 5.1 release
-and primarily just incorporates bug fixes.
-</p>
-<pre>
- New:
- - full OpenGL 1.5 support
- - updated GL/glext.h file to version 21
- Changes:
- - changed max framebuffer size to 4Kx4K (MAX_WIDTH/HEIGHT in config.h)
- Bug fixes:
- - fixed bug in UNCLAMPED_FLOAT_TO_UBYTE macro; solves a color
- clamping issue
- - updated suno5-gcc configs
- - glColor3 functions sometimes resulted in undefined alpha values
- - fixed FP divide by zero error seen on VMS with xlockmore, others
- - fixed vertex/fragment program debug problem (bug 873011)
- - building on AIX with gcc works now
- - glDeleteProgramsARB failed for ARB fragment programs (bug 876160)
- - glDrawRangeElements tried to modify potentially read-only storage
- - updated files for building on Windows
-</pre>
-
-
-
-<h2>December 28, 2003</h2>
-
-<p>
-The Mesa CVS server has been moved to <a href="http://www.freedesktop.org"
-target="_parent">
-freedesktop.org</a> because of problems with SourceForge's anonymous
-CVS service.
-</p>
-
-<p>Please see the <a href="cvs_access.html">CVS access page</a> for details.
-</p>
-
-
-<h2>December 17, 2003</h2>
-
-<p>
-Mesa 5.1 has been released. This is a new development release.
-Mesa 6.0 will be the next stable release and will support all
-OpenGL 1.5 features.
-</p>
-<pre>
- New features:
- - reorganized directory tree
- - GL_ARB_vertex/fragment_program extensions (Michal Krol & Karl Rasche)
- - GL_ATI_texture_env_combine3 extension (Ian Romanick)
- - GL_SGI_texture_color_table extension (Eric Plante)
- - GL_NV_fragment_program extension
- - GL_NV_light_max_exponent extension
- - GL_EXT_texture_rectangle (identical to GL_NV_texture_rectangle)
- - GL_ARB_occlusion_query extension
- - GL_ARB_point_sprite extension
- - GL_ARB_texture_non_power_of_two extension
- - GL_IBM_multimode_draw_arrays extension
- - GL_EXT_texture_mirror_clamp extension (Ian Romanick)
- - GL_ARB_vertex_buffer_object extension
- - new X86 feature detection code (Petr Sebor)
- - less memory used for display lists and vertex buffers
- - demo of per-pixel lighting with a fragment program (demos/fplight.c)
- - new version (18) of glext.h header
- - new spriteblast.c demo of GL_ARB_point_sprite
- - faster glDrawPixels in X11 driver in some cases (see RELNOTES-5.1)
- - faster glCopyPixels in X11 driver in some cases (see RELNOTES-5.1)
- Bug fixes:
- - really enable OpenGL 1.4 features in DOS driver.
- - fixed issues in glDrawPixels and glCopyPixels for very wide images
- - glPixelMapf/ui/usv()'s size parameter is GLsizei, not GLint
- - fixed some texgen bugs reported by Daniel Borca
- - fixed wglMakeCurrent(NULL, NULL) bug (#835861)
- - fixed glTexSubImage3D z-offset bug (Cedric Gautier)
- - fixed RGBA blend enable bug (Ville Syrjala)
- - glAccum is supposed to be a no-op in selection/feedback mode
- - fixed texgen bug #597589 (John Popplewell)
- Changes:
- - dropped API trace feature (src/Trace/)
- - documentation overhaul. merged with website content. more html.
- - glxgears.c demo updated to use GLX swap rate extensions
- - glTexImage1/2/3D now allows width/height/depth = 0
- - disable SPARC asm code on Linux (bug 852204)
-</pre>
-
-The MD5 checksums are:
-</p>
-<pre>
-78f452f6c55478471a744f07147612b5 MesaLib-5.1.tar.gz
-67b3b8d3f7f4c8c44904551b851d01af MesaLib-5.1.tar.bz2
-6dd19ffa750ec7f634e370a987505c9d MesaLib-5.1.zip
-e0214d4ebb22409dfa9262f2b52fd828 MesaDemos-5.1.tar.gz
-066c9aff4fd924405de1ae9bad5ec9a7 MesaDemos-5.1.tar.bz2
-d2b5ba32b53e0ad0576c637a4cc1fb41 MesaDemos-5.1.zip
-</pre>
-
-
-<H2>November 12, 2003</H2>
-
-<p>
-New Mesa 5.0.2 tarballs have been uploaded to SourceForge which fix a
-number of automake/libtool problems.
-</p>
-<p>
-The new MD5 checksums are:
-</p>
-<pre>
-a9dcf3ff9ad1b7d6ce73a0df7cff8b5b MesaLib-5.0.2.tar.gz
-7b4bf9261657c2fca03796d4955e6f50 MesaLib-5.0.2.tar.bz2
-79c141bddcbad557647535d02194f346 MesaLib-5.0.2.zip
-952d9dc823dd818981d1a648d7b2668a MesaDemos-5.0.2.tar.gz
-b81fafff90995025d2f25ea02b786642 MesaDemos-5.0.2.tar.bz2
-a21be975589e8a2d1871b6bb7874fffa MesaDemos-5.0.2.zip
-</pre>
-
-
-
-<h2>September 5, 2003</h2>
-
-<p>
-Mesa 5.0.2 has been released. This is a stable, bug-fix release.
-</p>
-<pre>
- Bug fixes:
- - fixed texgen problem causing texcoord's Q to be zero (stex3d)
- - default GL_TEXTURE_COMPARE_MODE_ARB was wrong
- - GL_CURRENT_MATRIX_NV query was wrong
- - GL_CURRENT_MATRIX_STACK_DEPTH_NV query was off by one
- - GL_LIST_MODE query wasn't correct
- - GL_FOG_COORDINATE_SOURCE_EXT query wasn't supported
- - GL_SECONDARY_COLOR_ARRAY_SIZE_EXT query returned wrong value
- - blended, wide lines didn't always work correctly (bug 711595)
- - glVertexAttrib4svNV w component was always 1
- - fixed bug in GL_IBM_rasterpos_clip (missing return)
- - GL_DEPTH_TEXTURE_MODE = GL_ALPHA didn't work correctly
- - a few Solaris compilation fixes
- - fixed glClear() problem for DRI drivers (non-existant stencil, etc)
- - fixed int/REAL mixup in GLU NURBS curve evaluator (Eric Cazeaux)
- - fixed delete [] bug in SI GLU (bug 721765) (Diego Santa Cruz)
- - glFog() didn't clamp fog colors
- - fixed bad float/int conversion for GL_TEXTURE_PRIORITY in the
- gl[Get]TexParameteri[v] functions
- - fixed invalid memory references in glTexGen functions (bug 781602)
- - integer-valued color arrays weren't handled correctly
- - glDrawPixels(GL_DEPTH_COMPONENT) with glPixelZoom didn't work
- - GL_EXT_texture_lod_bias is part of 1.4, overlooked in 5.0.1
- Changes:
- - build GLUT with -fexceptions so C++ apps propogate exceptions
-</pre>
-
-
-
-<h2>June 2003</h2>
-
-<p>
-Mesa's directory tree has been overhauled.
-Things are better organized now with some thought toward future needs.
-</p>
-<p>
-In CVS, the latest Mesa 5.1 development code is now rooted under the
-<b>Mesa-newtree/</b> directory. The old top-level <b>Mesa/</b> directory
-holds the Mesa 5.0.x code which will be abandoned at some point.
-</p>
-
-
-
-<h2>March 30, 2003</h2>
-
-<p>
-Mesa 5.0.1 has been released. This is a stable, bug-fix release.
-</p>
-<pre>
- New:
- - DOS driver updates from Daniel Borca
- - updated GL/gl_mangle.h file (Bill Hoffman)
- Bug fixes:
- - auto mipmap generation for cube maps was broken (bug 641363)
- - writing/clearing software alpha channels was unreliable
- - minor compilation fixes for OS/2 (Evgeny Kotsuba)
- - fixed some bad assertions found with shadowtex demo
- - fixed error checking bug in glCopyTexSubImage2D (bug 659020)
- - glRotate(angle, -x, 0, 0) was incorrect (bug 659677)
- - fixed potential segfault in texture object validation (bug 659012)
- - fixed some bogus code in _mesa_test_os_sse_exception_support (Linus)
- - fix fog stride bug in tnl code for h/w drivers (Michel Danzer)
- - fixed glActiveTexture / glMatrixMode(GL_TEXTURE) bug (#669080)
- - glGet(GL_CURRENT_SECONDARY_COLOR) should return 4 values, not 3
- - fixed compilation problem on Solaris7/x86 (bug 536406)
- - fixed prefetch bug in 3DNow! code (Felix Kuhling)
- - fixed NeXT build problem (FABSF macro)
- - glDrawPixels Z values when glPixelZoom!=1 were invalid (bug 687811)
- - zoomed glDraw/CopyPixels with clipping sometimes failed (bug 689964)
- - AA line and triangle Z values are now rounded, not truncated
- - fixed color interpolation bug when GLchan==GLfloat (bug 694461)
- - glArePrograms/TexturesResident() wasn't 100% correct (Jose Fonseca)
- - fixed a minor GL_COLOR_MATERIAL bug
- - NV vertex program EXP instruction was broken
- - glColorMask misbehaved with X window / pixmap rendering
- - fix autoconf/libtool GLU C++ linker problem on Linux (a total hack)
- - attempt to fix GGI compilation problem when MesaDemos not present
- - NV vertex program ARL-relative fetches didn't work
- Changes:
- - use glPolygonOffset in gloss demo to avoid z-fighting artifacts
- - updated winpos and pointblast demos to use ARB extensions
- - disable SPARC normal transformation code (bug 673938)
- - GLU fixes for OS/2 (Evgeny Kotsuba)
-</pre>
-<p>
-MD5 checksums follow:
-</p>
-<pre>
-b80f8b5d53a3e9f19b9fde5af0c542f0 MesaLib-5.0.1.tar.gz
-513b4bbd7d38951f05027179063d876b MesaLib-5.0.1.tar.bz2
-eebd395678f4520d33b267e5d5c22651 MesaLib-5.0.1.zip
-49d7feaec6dc1d2091d7c3cc72a9b320 MesaDemos-5.0.1.tar.gz
-37190374a98c3c892f0698be9ca3acf0 MesaDemos-5.0.1.tar.bz2
-becd8bf17f5791361b4a54ba2a78e5c9 MesaDemos-5.0.1.zip
-</pre>
-
-
-
-<h2>March 7, 2003</h2>
-<p>
-Website and documentation overhaul.
-</p>
-<p>
-The website content and Mesa documentation (from the doc/ directory) have
-been merged together.
-All the documentation files have been entered into the CVS repository.
-Many of the old plain-text files have been converted to html and modernized.
-</p>
-
-
-<h2>November 13, 2002</h2>
-<p>Mesa 5.0 has been released. This is a stable release which
-implements the OpenGL 1.4 specification.
-</p><pre>New:
- - OpenGL 1.4 support (glGetString(GL_VERSION) returns "1.4")
- - removed some overlooked debugging code
- - glxinfo updated to support GLX_ARB_multisample
- - GLUT now support GLX_ARB_multisample
- - updated DOS driver (Daniel Borca)
-Bug fixes:
- - GL_POINT and GL_LINE-mode polygons didn't obey cull state
- - fixed potential bug in _mesa_align_malloc/calloc()
- - fixed missing triangle bug when running vertex programs
- - fixed a few HPUX compilation problems
- - FX (Glide) driver didn't compile
- - setting GL_TEXTURE_BORDER_COLOR with glTexParameteriv() didn't work
- - a few EXT functions, like glGenTexturesEXT, were no-ops
- - a few OpenGL 1.4 functions like glFogCoord*, glBlendFuncSeparate,
- glMultiDrawArrays and glMultiDrawElements were missing
- - glGet*(GL_ACTIVE_STENCIL_FACE_EXT) was broken
- - Pentium 4 Mobile was mistakenly identified as having 3DNow!
- - fixed one-bit error in point/line fragment Z calculation
- - fixed potential segfault in fakeglx code
- - fixed color overflow problem in DOT3 texture env mode
-</pre>
-
-
-<h2>October 29, 2002</h2>
-<p>Mesa 4.1 has been released. This is a new development release.
-For a stable release, get 4.0.4.
-</p><pre>New:
- - GL_NV_vertex_program extension
- - GL_NV_vertex_program1_1 extension
- - GL_ARB_window_pos extension
- - GL_ARB_depth_texture extension
- - GL_ARB_shadow extension
- - GL_ARB_shadow_ambient extension
- - GL_EXT_shadow_funcs extension
- - GL_ARB_point_parameters extension
- - GL_ARB_texture_env_crossbar
- - GL_NV_point_sprite extension
- - GL_NV_texture_rectangle extension
- - GL_EXT_multi_draw_arrays extension
- - GL_EXT_stencil_two_side extension
- - GLX_SGIX_fbconfig and GLX_SGIX_pbuffer extensions
- - GL_ATI_texture_mirror_once extension (Ian Romanick)
- - massive overhaul/simplification of software rasterizer module,
- many contributions from Klaus Niederkrueger
- - faster software texturing in some cases (i.e. trilinear filtering)
- - new OSMesaGetProcAddress() function
- - more blend modes implemented with MMX code (Jose Fonseca)
- - added glutGetProcAddress() to GLUT
- - added GLUT_FPS env var to compute frames/second in glutSwapBuffers()
- - pbinfo and pbdemo PBuffer programs
- - glxinfo -v prints transprent pixel info (Gerd Sussner)
-Bug fixes:
- - better mipmap LOD computation (prevents excessive blurriness)
- - OSMesaMakeCurrent() didn't recognize buffer size changes
- - assorted conformance fixes for 16-bit/channel rendering
- - texcombine alpha subtraction mode was broken
- - fixed some blend problems when GLchan==GLfloat (Gerk Huisma)
- - clamp colors to [0,1] in OSMesa if GLchan==GLfloat (Gerk Huisma)
- - fixed divide by zero error in NURBS tessellator (Jon Perry)
- - fixed GL_LINEAR fog bug by adding clamping
- - fixed FP exceptions found using Alpha CPU
- - 3dfx/glide driver render-to-window feature was broken
- - added missing GLX_TRANSPARENT_RGB token to glx.h
- - fixed error checking related to paletted textures
- - fixed reference count error in glDeleteTextures (Randy Fayan)
-Changes:
- - New spec file and Python code to generate some GL dispatch files
- - Glide driver defaults to "no" with autoconf/automake
- - floating point color channels now clamped to [0,inf)
- - updated demos/stex3d with new options
-</pre>
-
-
-<h2>October 4, 2002</h2>
-<p>
-The <a href="http://mesa3d.sourceforge.net/docs/MesaFAQ.html">Mesa FAQ</a> has been rewritten.
-</p>
-
-<h2>October 3, 2002</h2>
-<p>Mesa 4.0.4 has been released. This is a stable bug-fix release.
-</p><pre> New:
- - GL_NV_texture_rectangle extension
- - updated glext.h header (version 17)
- - updated DOS driver (Daniel Borca)
- - updated BeOS R5 driver (Philippe Houdoin)
- - added GL_IBM_texture_mirror_repeat
- - glxinfo now takes -l option to print interesting OpenGL limits info
- - GL_MESA_ycbcr_texture extension
- - GL_APPLE_client_storage extension (for some DRI drivers only)
- - GL_MESA_pack_invert extension
- Bug fixes:
- - fixed GL_LINEAR fog bug by adding clamping
- - fixed FP exceptions found using Alpha CPU
- - 3dfx MESA_GLX_FX=window (render to window) didn't work
- - fixed memory leak in wglCreateContest (Karl Schultz)
- - define GLAPIENTRY and GLAPI if undefined in glu.h
- - wglGetProcAddress didn't handle all API functions
- - when testing for OpenGL 1.2 vs 1.3, check for GL_ARB_texture_cube_map
- - removed GL_MAX_CONVOLUTION_WIDTH/HEIGHT from glGetInteger/Float/etc()
- - error checking in compressed tex image functions had some glitches
- - fixed AIX compile problem in src/config.c
- - glGetTexImage was using pixel unpacking instead of packing params
- - auto-mipmap generation for cube maps was incorrect
- Changes:
- - max texture units reduced to six to accomodate texture rectangles
- - removed unfinished GL_MESA_sprite_point extension code
-</pre>
-
-<h2>June 25, 2002</h2>
-<p>Mesa 4.0.3 has been released. This is a stable bug-fix release.
-</p><pre> New:
- - updated GL/glext.h file (version 15)
- - corrected MMX blend code (Jose Fonseca)
- - support for software-based alpha planes in Windows driver
- - updated GGI driver (Filip Spacek)
- Bug fixes:
- - glext.h had wrong values for GL_DOT3_RGB[A]_EXT tokens
- - OSMesaMakeCurrent() didn't recognize buffer size changes
- - assorted conformance fixes for 16-bit/channel rendering
- - texcombine alpha subtraction mode was broken
- - fixed lighting bug with non-uniform scaling and display lists
- - fixed bug when deleting shared display lists
- - disabled SPARC cliptest assembly code (Mesa bug 544665)
- - fixed a couple Solaris compilation/link problems
- - blending clipped glDrawPixels didn't always work
- - glGetTexImage() didn't accept packed pixel types
- - glPixelMapu[is]v() could explode given too large of pixelmap
- - glGetTexParameter[if]v() didn't accept GL_TEXTURE_MAX_ANISOTROPY_EXT
- - glXCopyContext() could lead to segfaults
- - glCullFace(GL_FRONT_AND_BACK) didn't work (bug 572665)
- Changes:
- - lots of C++ (g++) code clean-ups
- - lots of T&amp;L updates for the Radeon DRI driver
- Known bugs:
- - mipmap LOD computation (fixed for Mesa 4.1)
-</pre>
-
-<h2>April 2, 2002</h2>
-<p>Mesa 4.0.2 has been released. This is a stable bug-fix release.
-</p><pre> New:
- - New DOS (DJGPP) driver written by Daniel Borca
- - New driver interface functions for TCL drivers (such as Radeon DRI)
- - GL_RENDERER string returns "Mesa Offscreen16" or "Mesa Offscreen32"
- if using deep color channels
- - latest GL/glext.h and GL/glxext.h headers from SGI
- Bug fixes:
- - GL_BLEND with non-black texture env color wasn't always correct
- - GL_REPLACE with GL_RGB texture format wasn't always correct (alpha)
- - glTexEnviv( pname != GL_TEXTURE_ENV_COLOR ) was broken
- - glReadPixels was sometimes mistakenly clipped by the scissor box
- - glDraw/ReadPixels didn't catch all the errors that they should have
- - Fixed 24bpp rendering problem in Windows driver (Karl Schultz)
- - 16-bit GLchan mode fixes (m_trans_tmp.h, s_triangle.c)
- - Fixed 1-bit float-&gt;int conversion bug in glDrawPixels(GL_DEPTH_COMP)
- - glColorMask as sometimes effecting glXSwapBuffers()
- - fixed a potential bug in XMesaGarbageCollect()
- - N threads rendering into one window didn't work reliably
- - glCopyPixels didn't work for deep color channels
- - improved 8 -&gt; 16bit/channel texture image conversion (Gerk Huisma)
- - glPopAttrib() didn't correctly restore user clip planes
- - user clip planes failed for some perspective projections (Chromium)
-</pre>
-
-<h2>December 17, 2001</h2>
-<p>Mesa 4.0.1 has been released. This is a stable bug-fix release.
-</p><pre> New:
- - better sub-pixel sample positions for AA triangles (Ray Tice)
- - slightly faster blending for (GL_ZERO, GL_ONE) and (GL_ONE, GL_ZERO)
- Bug fixes:
- - added missing break statements in glGet*() for multisample cases
- - fixed uninitialized hash table mutex bug (display lists / texobjs)
- - fixed bad teximage error check conditional (bug 476846)
- - fixed demos readtex.c compilation problem on Windows (Karl Schultz)
- - added missing glGet() query for GL_MAX_TEXTURE_LOD_BIAS_EXT
- - silence some compiler warnings (gcc 2.96)
- - enable the #define GL_VERSION_1_3 in GL/gl.h
- - added GL 1.3 and GLX 1.4 entries to gl_mangle.h and glx_mangle.h
- - fixed glu.h typedef problem found with MSDev 6.0
- - build libGL.so with -Bsymbolic (fixes bug found with Chromium)
- - added missing 'const' to glXGetContextIDEXT() in glxext.h
- - fixed a few glXGetProcAddress() errors (texture compression, etc)
- - fixed start index bug in compiled vertex arrays (Keith)
- - fixed compilation problems in src/SPARC/glapi_sparc.S
- - fixed triangle strip "parity" bug found in VTK medical1 demo (Keith)
- - use glXGetProcAddressARB in GLUT to avoid extension linking problems
- - provoking vertex of flat-shaded, color-index triangles was wrong
- - fixed a few display list bugs (GLUT walker, molecule, etc) (Keith)
- - glTexParameter didn't flush the vertex buffer (Ray Tice)
- - feedback attributes for glDraw/CopyPixels and glBitmap were wrong
- - fixed bug in normal length caching (ParaView lighting bug)
-</pre>
-
-<h2>October 22, 2001</h2>
-<p>Mesa 4.0 has been released. This is a stable release.
-</p><pre> New:
- - Mesa 4.0 implements the OpenGL 1.3 specification
- - GL_IBM_rasterpos_clip extension
- - GL_EXT_texture_edge_clamp extension (aka GL_SGIS_texture_edge_clamp)
- - GL_ARB_texture_mirrored_repeat extension
- - WindML UGL driver (Stephane Raimbault)
- - added OSMESA_MAX_WIDTH/HEIGHT queries
- - attempted compiliation fixes for Solaris 5, 7 and 8
- - updated glext.h and glxext.h files
- - updated Windows driver (Karl Schultz)
- Bug fixes:
- - added some missing GLX 1.3 tokens to include/GL/glx.h
- - GL_COLOR_MATRIX changes weren't recognized by teximage functions
- - glCopyPixels with scale and bias was broken
- - glRasterPos with lighting could segfault
- - glDeleteTextures could leave a dangling pointer
- - Proxy textures for cube maps didn't work
- - fixed a number of 16-bit color channel bugs
- - fixed a few minor memory leaks
- - GLX context sharing was broken in 3.5
- - fixed state-update bugs in glPopClientAttrib()
- - fixed glDrawRangeElements() bug
- - fixed a glPush/PopAttrib() bug related to texture binding
- - flat-shaded, textured lines were broken
- - fixed a dangling pointer problem in the XMesa code (Chris Burghart)
- - lighting didn't always produce the correct alpha value
- - fixed 3DNow! code to not read past end of arrays (Andrew Lewycky)
-</pre>
-
-
-<h2>June 21, 2001</h2>
-<p>Mesa 3.5 has been released. This is a new development release.
-</p><pre> New:
- - internals of Mesa divided into modular pieces (Keith Whitwell)
- - 100% OpenGL 1.2 conformance (passes all conformance tests)
- - new AA line algorithm
- - GL_EXT_convolution extension
- - GL_ARB_imaging subset
- - OSMesaCreateContextExt() function
- - GL_ARB_texture_env_add extension (same as GL_EXT_texture_env_add)
- - GL_MAX_TEXTURE_UNITS_ARB now defaults to eight
- - GL_EXT_fog_coord extension (Keith Whitwell)
- - GL_EXT_secondary_color extension (Keith Whitwell)
- - GL_ARB_texture_env_add extension (same as GL_EXT_texture_env_add)
- - GL_SGIX_depth_texture extension
- - GL_SGIX_shadow and GL_SGIX_shadow_ambient extensions
- - demos/shadowtex.c demo of GL_SGIX_depth_texture and GL_SGIX_shadow
- - GL_ARB_texture_env_combine extension
- - GL_ARB_texture_env_dot3 extension
- - GL_ARB_texture_border_clamp (aka GL_SGIS_texture_border_clamp)
- - OSMesaCreateContextExt() function
- - libOSMesa.so library, contains the OSMesa driver interface
- - GL/glxext.h header file for GLX extensions
- - somewhat faster software texturing, fogging, depth testing
- - all color-index conformance tests now pass (only 8bpp tested)
- - SPARC assembly language TCL optimizations (David Miller)
- - GL_SGIS_generate_mipmap extension
- Bug Fixes:
- - fbiRev and tmuRev were unitialized when using Glide3
- - fixed a few color index mode conformance failures; all pass now
- - now appling antialiasing coverage to alpha after texturing
- - colors weren't getting clamped to [0,1] before color table lookup
- - fixed RISC alignment errors caused by COPY_4UBV macro
- - drawing wide, flat-shaded lines could cause a segfault
- - vertices now snapped to 1/16 pixel to fix rendering of tiny triangles
- Changes:
- - SGI's Sample Implementation (SI) 1.3 GLU library replaces Mesa GLU
- - new libOSMesa.so library, contains the OSMesa driver interface
-</pre>
-
-
-<h2>May 17, 2001</h2>
-<p>Mesa 3.4.2 has been released. This is basically just a bug-fix release.
-Here's what's new:</p>
-<pre> Bug fixes:
- - deleting the currently bound texture could cause bad problems
- - using fog could result in random vertex alpha values
- - AA triangle rendering could touch pixels outside right window bound
- - fixed byteswapping problem in clear_32bit_ximage() function
- - fixed bugs in wglUseFontBitmapsA(), by Frank Warmerdam
- - fixed memory leak in glXUseXFont()
- - fragment sampling in AA triangle function was off by 1/2 pixel
- - Windows: reading pixels from framebuffer didn't always work
- - glConvolutionFilter2D could segfault or cause FP exception
- - fixed segfaults in FX and X drivers when using tex unit 1 but not 0
- - GL_NAND logicop didn't work right in RGBA mode
- - fixed a memory corruption bug in vertex buffer reset code
- - clearing the softwara alpha buffer with scissoring was broken
- - fixed a few color index mode fog bugs
- - fixed some bad assertions in color index mode
- - fixed FX line 'stipple' bug #420091
- Changes:
- - optimized writing mono-colored pixel spans to X pixmaps
- - increased max viewport size to 2048 x 2048
-</pre>
-
-
-<h2>April 29, 2001</h2>
-<p>New Mesa website</p>
-<p>Mark Manning produced the new website.<br>Thanks, Mark!</p>
-
-
-<h2>February 14, 2001</h2>
-<p>Mesa 3.4.1 has been released. Here's what's new:</p>
-<pre> New:
- - fixed some Linux build problems
- - fixed some Windows build problems
- - GL_EXT_texture_env_dot3 extension (Gareth Hughes)
- Bug fixes:
- - added RENDER_START/RENDER_FINISH macros for glCopyTexImage in DRI
- - various state-update code changes needed for DRI bugs
- - disabled pixel transfer ops in glColorTable commands, not needed
- - fixed bugs in glCopyConvolutionFilter1D/2D, glGetConvolutionFilter
- - updated sources and fixed compile problems in widgets-mesa/
- - GLX_PBUFFER enum value was wrong in glx.h
- - fixed a glColorMaterial lighting bug
- - fixed bad args to Read/WriteStencilSpan in h/w stencil clear function
- - glXCopySubBufferMESA() Y position was off by one
- - Error checking of glTexSubImage3D() was broken (bug 128775)
- - glPopAttrib() didn't restore all derived Mesa state correctly
- - Better glReadPixels accuracy for 16bpp color - fixes lots of OpenGL
- conformance problems at 16bpp.
- - clearing depth buffer with scissoring was broken, would segfault
- - OSMesaGetDepthBuffer() returned bad bytesPerValue value
- - fixed a line clipping bug (reported by Craig McDaniel)
- - fixed RGB color over/underflow bug for very tiny triangles
- Known problems:
- - NURBS or evaluator surfaces inside display lists don't always work
-</pre>
-<p>
-</p><h2>November 3, 2000</h2>
-<p>Mesa 3.4 has been released. Here's what's new since the 3.3 release:</p>
-<pre> New:
- - optimized glDrawPixels for glPixelZoom(1,-1)
- Bug Fixes:
- - widgets-mesa/src/*.c files were missing from 3.3 distro
- - include/GL/mesa_wgl.h file was missing from 3.3 distro
- - fixed some Win32 compile problems
- - texture object priorities weren't getting initialized to 1.0
- - glAreTexturesResident return value was wrong when using hardware
- - glXUseXFont segfaulted when using 3dfx driver (via MESA_GLX_FX)
- - glReadPixels with GLushort packed types was broken
- - fixed a few bugs in the GL_EXT_texture_env_combine texture code
- - glPush/PopAttrib(GL_ENABLE_BIT) mishandled multi-texture enables
- - fixed some typos/bugs in the VB code
- - glDrawPixels(GL_COLOR_INDEX) to RGB window didn't work
- - optimized glDrawPixels paths weren't being used
- - per-fragment fog calculation didn't work without a Z buffer
- - improved blending accuracy, fixes Glean blendFunc test failures
- - glPixelStore(GL_PACK/UNPACK_SKIP_IMAGES) wasn't handled correctly
- - glXGetProcAddressARB() didn't always return the right address
- - gluBuild[12]DMipmaps() didn't grok the GL_BGR pixel format
- - texture matrix changes weren't always detected (GLUT projtex demo)
- - fixed random color problem in vertex fog code
- - fixed Glide-related bug that let Quake get a 24-bit Z buffer
- Changes:
- - finished internal support for compressed textures for DRI
-</pre>
-<p>
-</p><h2>April 24, 2000</h2>
-<p>Mesa 3.2 has been released. Here's what's new since the beta release:</p>
-<pre> Bug fixes:
- - fixed memcpy bugs in span.c
- - fixed missing glEnd problem in demos/tessdemo.c
- - fixed bug when clearing 24bpp Ximages
- - fixed clipping problem found in Unreal Tournament
- - fixed Loki's "ice bug" and "crazy triangles" seen in Heretic2
- - fixed Loki's 3dfx RGB vs BGR bug
- - fixed Loki's 3dfx smooth/flat shading bug in SoF
- Changes:
- - updated docs/README file
- - use bcopy() optimizations on FreeBSD
- - re-enabled the optimized persp_textured_triangle() function
-</pre>
-<p>
-</p><h2>March 23, 2000</h2>
-<p>I've just upload the Mesa 3.2 beta 1 files to SourceForge at <a href="http://sourceforge.net/project/showfiles.php?group_id=3" target="_parent">http://sourceforge.net/project/filelist.php?group_id=3</a><a href="http://sourceforge.net/project/showfiles.php?group_id=3"></a></p>
-<p>3.2 (note even number) is a stabilization release of Mesa 3.1 meaning it's mainly
-just bug fixes.</p>
-<p>Here's what's changed:
-
-</p><ul>
- Bug fixes:
- <ul>
- - mixed drawing of lines and bitmaps sometimes had wrong colors<br>
- - added missing glHintPGI() function<br>
- - fixed a polygon culling bug<br>
- - fixed bugs in gluPartialDisk()<br>
- - Z values in selection mode were wrong<br>
- - added missing tokens:
- <ul>
- GL_SMOOTH_POINT_SIZE_RANGE<br>
- GL_SMOOTH_POINT_SIZE_GRANULARITY<br>
- GL_SMOOTH_LINE_WIDTH_RANGE<br>
- GL_SMOOTH_LINE_WIDTH_GRANULARITY<br>
- GL_ALIASED_POINT_SIZE_RANGE<br>
- GL_ALIASED_LINE_WIDTH_RANGE
- </ul>
- - fixed glCopyPixels when copying from back to front buffer<br>
- - GL_EXT_compiled_vertex_array tokens had _SGI suffix instead of _EXT<br>
- - glDrawRangeElements(GL_LINES, 0, 1, 2, type, indices) was broken<br>
- - glDeleteTextures() didn't decrement reference count correctly<br>
- - GL_SRCA_ALPHA_SATURATE blend mode didn't work correctly<br>
- - Actual depth of transformation matrix stacks was off by one<br>
- - 24bpp visuals didn't address pixels correctly<br>
- - mipmap level of detail (lambda) calculation simplified, more accurate<br>
- - 101691 - Polygon clipping and GL_LINE<br>
- - 101928 - Polygon clipping and GL_LINE (same fix as above)<br>
- - 101808 - Non-glVertexArrays tristrip bug<br>
- - 101971 - find_last_3f on Dec OSF (worked around)<br>
- - 102369 - segv on dec osf (possibly a duplicate of the above)<br>
- - 102893 - orientations of modelview cause segfault
- </ul>
- New:
- <ul>
- - updated SVGA Linux driver<br>
- - added the MESA_FX_NO_SIGNALS env var, see docs/README.3DFX<br>
- - build libGLw.a (Xt/OpenGL drawing area widget) library by default<br>
- - changed -O2 to -O3 for a number of gcc configs
- </ul>
- Changes:
- <ul>
- - glXCopyContext's mask parameter is now unsigned long, per GLX spec
- </ul>
-</ul>
-
-<p>Please report any problems with this release ASAP. Bugs should be filed on the
-Mesa3D website at sourceforge.<br>
-After 3.2 is wrapped up I hope to release 3.3 beta 1 soon afterward.</p>
-<p>-- Brian</p>
-<p>
-</p><h2>December 17, 1999</h2>
-<p>A Slashdot interview with Brian about Mesa (questions submitted by Slashdot readers)
-can be found at <a href="http://slashdot.org/interviews/99/12/17/0927212.shtml" target="_parent">http://slashdot.org/interviews/99/12/17/0927212.shtml</a>.</p>
-<p>
-</p><h2>December 14, 1999</h2>
-<p>Mesa 3.1 is released!</p>
-<p>
-</p><h2>September 21, 1999</h2>
-<p>There appear to be two new files on the ftp site, <a href="ftp://ftp.mesa3d.org/mesa/beta/MesaLib-3.1beta3.tar.gz">MesaLib-3.1beta3.tar.gz</a>
-and <a href="ftp://ftp.mesa3d.org/mesa/beta/MesaDemos-3.1beta3.tar.gz">MesaDemos-3.1beta3.tar.gz</a>,
-that seem to be... yes, I've just received confirmation from the beta center, they
-are indeed the <b>THIRD</b> beta release of Mesa 3.1! Happy Days. Happy Days. Thanks
-Keith Whitwell for preparing these for us during Brian's absence.</p>
-<p>
-</p><h2>August 30, 1999</h2>
-<p>I'm pleased to announce that I've accepted a position with Precision Insight,
-Inc. effective October, 1999. I'll be leaving Avid Technology in September.</p>
-<p>I've been working on Mesa in my spare time for over five years. With Precision
-Insight I now have the opportunity to devote my full attention to advancing Mesa
-and OpenGL on Linux.</p>
-<p>While I'll be focused on Linux, the X Window System, and hardware acceleration,
-my work will continue to be open sourced and available to any other programmers who
-may want to contribute to it, or use it for other projects or platforms</p>
-<p>PS: I'm going to be traveling until Sep 6 and won't be reading email until then.</p>
-<p>
-</p><h2>August 23, 1999</h2>
-<p>Anonymous CVS access is back online so suck up all the bandwidth you can afford.
-Note that this is a new archive, so you will need to re-checkout the archive. That
-means don't <i>cvs update</i> from a previous download.</p>
-<p>
-</p><h2>August 17, 1999</h2>
-<p>A report from the SIGGRAPH '99 Linux/OpenGL
-BOF meeting is now available.</p>
-<p>-Brian</p>
-<p>
-</p><h2>August 14, 1999</h2>
-<p>www.mesa3d.org is having technical problems due to hardware failures at VA Linux
-systems. The Mac pages, ftp, and CVS services aren't fully restored yet. Please be
-patient.</p>
-<p>-Brian</p>
-<p>
-</p><h2>June 7, 1999</h2>
-<p>RPMS of the nVidia RIVA server can be found at <a href="ftp://ftp.mesa3d.org/mesa/misc/nVidia/">ftp://ftp.mesa3d.org/mesa/misc/nVidia/</a>.</p>
-<p>
-</p><h2>June 2, 1999</h2>
-<p><a href="http://www.nvidia.com/">nVidia</a> has released some Linux binaries for
-xfree86 3.3.3.1, along with the <b>full source</b>, which includes GLX acceleration
-based on Mesa 3.0. They can be downloaded from <a href="http://www.nvidia.com/Products.nsf/htmlmedia/software_drivers.html">http://www.nvidia.com/Products.nsf/htmlmedia/software_drivers.html</a>.</p>
-<p>
-</p><h2>May 24, 1999</h2>
-<p>Beta 2 of Mesa 3.1 has been make available at <a href="ftp://ftp.mesa3d.org/mesa/beta/">ftp://ftp.mesa3d.org/mesa/beta/</a>.
-If you are into the quake scene, you may want to try this out, as it contains some
-optimizations specifically in the Q3A rendering path.
-<p>
-</p><h2>May 13, 1999</h2>
-<p>For those interested in the integration of Mesa into XFree86 4.0, Precision Insight
-has posted their lowlevel design documents at http://www.precisioninsight.com.</p>
-<p>
-</p><h2>May 13, 1999</h2>
-<pre>May 1999 - John Carmack of id Software, Inc. has made a donation of
-US$10,000 to the Mesa project to support its continuing development.
-Mesa is a free implementation of the OpenGL 3D graphics library and id's
-newest game, Quake 3 Arena, will use Mesa as the 3D renderer on Linux.
-
-The donation will go to Keith Whitwell, who has been optimizing Mesa to
-improve performance on 3d hardware. Thanks to Keith's work, many
-applications using Mesa 3.1 will see a dramatic performance increase
-over Mesa 3.0. The donation will allow Keith to continue working on
-Mesa full time for some time to come.
-
-For more information about Mesa see www.mesa3d.org. For more
-information about id Software, Inc. see www.idsoftware.com.
-
---------------------------------
-
-This donation from John/id is very generous. Keith and I are very
-grateful.
-
-</pre>
-<p>
-</p><h2>May 1, 1999</h2>
-<p>John Carmack made an interesting .plan update yesterday:
-
-</p><ul>
- <i>"I put together a document on optimizing OpenGL drivers for Q3 that
- should be helpful to the various Linux 3D teams. <br>
- </i>http://www.quake3arena.com/news/glopt.html</i>"
-</ul>
-
-<p>
-</p><h2>April 7, 1999</h2>
-<p>Updated the Mesa contributors section and added links to RPM Mesa packages.</p>
-<p>
-</p><h2>March 18, 1999</h2>
-<p>The new webpages are now online. Enjoy, and let me know if you find any errors.
-<p>
-</p><h2>February 16, 1999</h2>
-<p><a href="http://www.sgi.com/">SGI</a> releases its <a href="http://www.sgi.com/software/opensource/glx/">GLX
-source code</a>.</p>
-<p>
-</p><h2>January 22, 1999</h2>
-<p>www.mesa3d.org established</p>
-
-
-</p>
-
-
-<hr>
-</body>
-</html>
+<HTML>
+
+<TITLE>Mesa News</TITLE>
+
+<head><link rel="stylesheet" type="text/css" href="mesa.css"></head>
+
+<BODY>
+
+<body bgcolor="#eeeeee">
+
+<H1>News</H1>
+
+
+<h2>April 6, 2011</h2>
+
+<p>
+<a href="relnotes-7.10.2.html">Mesa 7.10.2</a> is released. This is a bug
+fix release release.
+</p>
+
+<h2>March 2, 2011</h2>
+
+<p>
+<a href="relnotes-7.9.2.html">Mesa 7.9.2</a> and
+<a href="relnotes-7.10.1.html">Mesa 7.10.1</a> are released. These are
+stable releases containing bug fixes since the 7.9.1 and 7.10 releases.
+</p>
+
+
+<h2>October 4, 2010</h2>
+
+<p>
+<a href="relnotes-7.9.html">Mesa 7.9</a> (final) is released. This is a new
+development release.
+</p>
+
+
+<h2>September 27, 2010</h2>
+
+<p>
+<a href="relnotes-7.9.html">Mesa 7.9.0-rc1</a> is released. This is a
+release candidate for the 7.9 development release.
+</p>
+
+
+<h2>June 16, 2010</h2>
+
+<p>
+<a href="relnotes-7.8.2.html">Mesa 7.8.2</a> is released. This is a bug-fix
+release collecting fixes since the 7.8.1 release.
+</p>
+
+
+<h2>April 5, 2010</h2>
+
+<p>
+<a href="relnotes-7.8.1.html">Mesa 7.8.1</a> is released. This is a bug-fix
+release for a few critical issues in the 7.8 release.
+</p>
+
+
+<h2>March 28, 2010</h2>
+<p>
+<a href="relnotes-7.7.1.html">Mesa 7.7.1</a> is released. This is a bug-fix
+release fixing issues found in the 7.7 release.
+</p>
+<p>
+Also, <a href="relnotes-7.8.html">Mesa 7.8</a> is released. This is a new
+development release.
+</p>
+
+
+
+<h2>December 21, 2009</h2>
+<p>
+<a href="relnotes-7.6.1.html">Mesa 7.6.1</a> is released. This is a bug-fix
+release fixing issues found in the 7.6 release.
+</p>
+<p>
+Also, <a href="relnotes-7.7.html">Mesa 7.7</a> is released. This is a new
+development release.
+</p>
+
+
+<h2>September 28, 2009</h2>
+<p>
+<a href="relnotes-7.6.html">Mesa 7.6</a> is released. This is a new feature
+release. Those especially concerned about stability may want to wait for the
+follow-on 7.6.1 bug-fix release.
+</p>
+<p>
+<a href="relnotes-7.5.2.html">Mesa 7.5.2</a> is also released.
+This is a stable release fixing bugs since the 7.5.1 release.
+</p>
+
+
+<h2>September 3, 2009</h2>
+<p>
+<a href="relnotes-7.5.1.html">Mesa 7.5.1</a> is released.
+This is a bug-fix release which fixes bugs found in version 7.5.
+</p>
+
+
+<h2>July 17, 2009</h2>
+<p>
+<a href="relnotes-7.5.html">Mesa 7.5</a> is released.
+This is a new features release. People especially concerned about
+stability may want to wait for the follow-on 7.5.1 bug-fix release.
+</p>
+
+
+<h2>June 23, 2009</h2>
+<p>
+<a href="relnotes-7.4.4.html">Mesa 7.4.4</a> is released.
+This is a stable release that fixes a regression in the i915/i965 drivers
+that slipped into the 7.4.3 release.
+</p>
+
+
+<h2>June 19, 2009</h2>
+<p>
+<a href="relnotes-7.4.3.html">Mesa 7.4.3</a> is released.
+This is a stable release fixing bugs since the 7.4.2 release.
+</p>
+
+
+<h2>May 15, 2009</h2>
+<p>
+<a href="relnotes-7.4.2.html">Mesa 7.4.2</a> is released.
+This is a stable release fixing bugs since the 7.4.1 release.
+</p>
+
+
+<h2>April 18, 2009</h2>
+<p>
+<a href="relnotes-7.4.1.html">Mesa 7.4.1</a> is released.
+This is a stable release fixing bugs since the 7.4 release.
+</p>
+
+
+<h2>March 27, 2009</h2>
+<p>
+<a href="relnotes-7.4.html">Mesa 7.4</a> is released.
+This is a stable release fixing bugs since the 7.3 release.
+</p>
+
+
+<h2>January 22, 2009</h2>
+<p>
+<a href="relnotes-7.3.html">Mesa 7.3</a> is released.
+This is a new development release.
+Mesa 7.4 will follow and will have bug fixes relative to 7.3.
+</p>
+
+
+<h2>September 20, 2008</h2>
+<p>
+<a href="relnotes-7.2.html">Mesa 7.2</a> is released.
+This is a stable, bug-fix release.
+</p>
+
+
+<h2>August 26, 2008</h2>
+<p>
+<a href="relnotes-7.1.html">Mesa 7.1</a> is released.
+This is a new development release.
+It should be relatively stable, but those especially concerned about
+stability should wait for the 7.2 release or use Mesa 7.0.4 (the
+previous stable release).
+</p>
+
+
+<h2>August 16, 2008</h2>
+<p>
+<a href="relnotes-7.0.4.html">Mesa 7.0.4</a> is released.
+This is a bug-fix release.
+</p>
+
+
+<h2>April 4, 2008</h2>
+<p>
+<a href="relnotes-7.0.3.html">Mesa 7.0.3</a> is released.
+This is a bug-fix release.
+</p>
+
+
+<h2>January 24, 2008</h2>
+
+<p>
+Added a new page describing the <a href="cell.html">Mesa Cell driver</a>.
+</p>
+
+
+
+<h2>November 13, 2007</h2>
+
+<p>
+Gallium3D is the codename for the new Mesa device driver architecture
+which is currently under development.
+</p>
+<p>
+Gallium3D development is taking place on the <em>gallium-0.1</em> branch
+of the git repository.
+Currently, there's only a software-only driver and an Intel i915/945 driver
+but other drivers will be coming...
+</p>
+
+
+<h2>November 10, 2007</h2>
+<p>
+<a href="relnotes-7.0.2.html">Mesa 7.0.2</a> is released.
+This is a bug-fix release.
+</p>
+
+
+<h2>August 3, 2007</h2>
+<p>
+<a href="relnotes-7.0.1.html">Mesa 7.0.1</a> is released.
+This is a bug-fix release.
+</p>
+
+
+<h2>June 22, 2007</h2>
+<p>
+<a href="relnotes-7.0.html">Mesa 7.0</a> is released.
+This is a stable release featuring OpenGL 2.1 support.
+</p>
+
+
+<h2>April 27, 2007</h2>
+<p>
+<a href="relnotes-6.5.3.html">Mesa 6.5.3</a> is released.
+This is a development release which will lead up to the Mesa 7.0 release
+(which will advertise OpenGL 2.1 API support).
+</p>
+
+
+<h2>March 26, 2007</h2>
+<p>
+The new Shading Language compiler branch has been merged into the git
+master branch. This is a step toward hardware support for the OpenGL
+2.0 Shading Language and will be included in the next Mesa release.
+In conjunction, <a href="http://glean.sf.net" target="_parent">Glean
+</a> has been updated with a new test that does over 130 tests of the
+shading language and built-in functions.
+</p>
+
+<h2>April 2007</h2>
+<p>
+Thomas Hellstr&ouml;m of Tungsten Graphics has written a whitepaper
+describing the new DRI memory management system</a>.
+</p>
+
+<h2>December 5, 2006</h2>
+<p>
+Mesa is now using git as its source code management system.
+The previous CVS repository should no longer be used.
+See the <a href="repository.html">repository page</a> for more information.
+</p>
+
+<h2>December 2, 2006</h2>
+<p>
+<a href="relnotes-6.5.2.html">Mesa 6.5.2</a> has been released.
+This is a new development release.
+</p>
+
+<h2>September 15, 2006</h2>
+<p>
+<a href="relnotes-6.5.1.html">Mesa 6.5.1</a> has been released.
+This is a new development release.
+</p>
+
+<h2>March 31, 2006</h2>
+<p>
+<a href="relnotes-6.5.html">Mesa 6.5</a> has been released.
+This is a new development release.
+</p>
+
+
+<h2>February 2, 2006</h2>
+<p>
+<a href="relnotes-6.4.2.html">Mesa 6.4.2</a> has been released.
+This is stable, bug-fix release.
+</p>
+
+
+<h2>November 29, 2005</h2>
+<p>
+<a href="relnotes-6.4.1.html">Mesa 6.4.1</a> has been released.
+This is stable, bug-fix release.
+</p>
+
+
+
+<h2>October 24, 2005</h2>
+<p>
+<a href="relnotes-6.4.html">Mesa 6.4</a> has been released.
+This is stable, bug-fix release.
+</p>
+
+
+<h2>August 19, 2005</h2>
+<p>
+Mesa 6.3.2 has been released.
+Note: there was no public release of version 6.3.1.
+</p>
+<a href="versions.html#6.3.2">Changes in version 6.3.1</a>
+<p>
+The MD5 checksums are:
+</p>
+<pre>
+98192e45ed8d69113688f89f90869346 MesaLib-6.3.2.tar.gz
+0df27701df0924d17ddf41185efa8ce1 MesaLib-6.3.2.tar.bz2
+ccb2423aab77fc7e81ce628734586140 MesaLib-6.3.2.zip
+9d0fca0a7d051c34a0b485423fb3e85d MesaDemos-6.3.2.tar.gz
+96708868450c188205e42229b5d813c4 MesaDemos-6.3.2.tar.bz2
+c5102501e609aa8996d832fafacb8ab9 MesaDemos-6.3.2.zip
+</pre>
+
+
+<h2>July 20, 2005</h2>
+<p>
+Mesa 6.3 has been released.
+This is a development release with new features, changes and bug fixes.
+</p>
+<pre>
+ New:
+ - GL_EXT_framebuffer_object extension
+ - GL_ARB_draw_buffers extension
+ - GL_ARB_pixel_buffer_object extension
+ - GL_OES_read_format extension (Ian Romanick)
+ - DirectFB driver (Claudio Ciccani)
+ - x86_64 vertex transformation code (Mikko T.)
+ Changes:
+ - added -stereo option for glxgears demo (Jacek Rosik)
+ - updated the PBuffer demo code in xdemos/ directory
+ - glDeleteTextures/Programs/Buffers() now makes the object ID
+ available for immediate re-use
+ - assorted 64-bit clean-ups fixes (x86_64 and Win64)
+ - lots of internal changes for GL_EXT_framebuffer_object
+ Bug fixes:
+ - some functions didn't support PBO functionality
+ - glGetTexImage didn't convert color index images to RGBA as required
+ - fragment program texcoords were sometimes wrong for points and lines
+ - fixed problem with negative dot product in arbfplight, fplight demos
+ - fixed bug in perspective correction of antialiased, textured lines
+ - querying GL_POST_CONVOLUTION_ALPHA_BIAS_EXT returned wrong value
+ - fixed a couple per-pixel fog bugs (Soju Matsumoto)
+ - glGetBooleanv(GL_FRAGMENT_PROGRAM_BINDING_NV) was broken
+ - fixed float parsing bug in ARB frag/vert programs (bug 2520)
+ - XMesaGetDepthBuffer() returned incorrect value for bytesPerValue
+ - GL_COLOR_MATERIAL with glColor3 didn't properly set diffuse alpha
+ - glXChooseFBConfig() crashed if attribList pointer was NULL
+ - program state.light[n].spot.direction.w was wrong value (bug 3083)
+ - fragment program fog option required glEnable(GL_FOG) - wrong.
+ - glColorTable() could produce a Mesa implementation error (bug 3135)
+ - RasterPos could get corrupted by color index rendering path
+ - Removed bad XTranslateCoordinates call when rendering to Pixmaps
+ - glPopAttrib() didn't properly restore GL_TEXTURE_GEN enable state
+ - fixed a few Darwin compilation problems
+</pre>
+<p>
+The MD5 checksums are:
+</p>
+<pre>
+0236f552d37514776945d5a013e5bb7b MesaLib-6.3.tar.gz
+60e1a8f78c4a8c7750a1e95753190986 MesaLib-6.3.tar.bz2
+ca7c950fbace68c70caa822322db7223 MesaLib-6.3.zip
+25ea801645b376c014051804fe4974b2 MesaDemos-6.3.tar.gz
+9248e74872ea88c57ec25c900c295057 MesaDemos-6.3.tar.bz2
+8537dfa734ef258dcc7272097558d434 MesaDemos-6.3.zip
+</pre>
+
+
+<h2>December 9, 2004</h2>
+<p>
+Mesa 6.2.1 has been released.
+This is a stable release which just fixes bugs since the 6.2 release.
+</p>
+<pre>
+ Bug fixes:
+ - don't apply regular fog or color sum when using a fragment program
+ - glProgramEnvParameter4fARB always generated an error on
+ GL_FRAGMENT_PROGRAM_ARB (fdo bug 1645)
+ - glVertexAttrib3svNV and glVertexAttrib3svARB were broken
+ - fixed width/height mix-up in glSeparableFilter2D()
+ - fixed regression in glCopyPixels + convolution
+ - glReadPixels from a clipped front color buffer didn't always work
+ - glTexImage didn't accept GL_RED/GREEN/BLUE as the format
+ - Attempting queries/accesses of VBO 0 weren't detected as errors
+ - paletted textures failed if the palette had fewer than 256 entries
+ Changes:
+ - fixed a bunch of compiler warnings found with gcc 3.4
+ - bug reports should to go bugzilla.freedesktop.org
+</pre>
+<p>
+The MD5 checksums are:
+</p>
+<pre>
+80008a92f6e055d3bfdde2cf331ec3fa MesaLib-6.2.1.tar.gz
+f43228cd2bf70f583ef3275c1c545421 MesaLib-6.2.1.tar.bz2
+dec26cfd40116ad021020fea2d94f652 MesaLib-6.2.1.zip
+2c7af3c986a7571c8713c8bfee7e49e3 MesaDemos-6.2.1.tar.gz
+3cac74667b50bcbd4f67f594fb4224a2 MesaDemos-6.2.1.tar.bz2
+75b3edd12eb2b370caf05f29b99e508a MesaDemos-6.2.1.zip
+</pre>
+
+
+<h2>October 2, 2004</h2>
+<p>
+Mesa 6.2 has been released.
+This is a stable release which just fixes bugs since the 6.1 release.
+</p>
+<pre>
+ New:
+ - enabled GL_ARB_texture_rectangle (same as GL_NV_texture_rectangle)
+ - updated Doxygen support (Jose Fonseca)
+ Changes:
+ - some GGI driver updates (Christoph Egger, bug 1025977)
+ Bug fixes:
+ - Omit GL_ARB_texture_non_power_of_two from list of OpenGL 1.5 features
+ - fixed a few compilation issues on IRIX
+ - fixed a matrix classification bug (reported by Wes Bethel)
+ - we weren't reseting the vertex/fragment program error state
+ before parsing (Dave Reveman)
+ - adjust texcoords for sampling texture rectangles (Dave Reveman)
+ - glGet*(GL_MAX_VERTEX_ATTRIBS_ARB) wasn't implemented
+ - repeated calls to glDeleteTexture(t) could lead to a crash
+ - fixed potential ref count bugs in VBOs and vertex/fragment programs
+ - spriteblast demo didn't handle window size changes correctly
+ - glTexSubImage didn't handle pixels=NULL correctly for PBOs
+ - fixed color index mode glDrawPixels bug (Karl Schultz)
+</pre>
+<p>
+The MD5 checksums are:
+</p>
+<pre>
+9e8f34b059272dbb8e1f2c968b33bbf0 MesaLib-6.2.tar.gz
+3d6a6362390b6a37d3cb2e615f3ac7db MesaLib-6.2.tar.bz2
+6cfd7895d28e695c0dbbed9469564091 MesaLib-6.2.zip
+3e06e33b0809f09855cb60883b8bdfef MesaDemos-6.2.tar.gz
+9d160009c3dfdb35fe7e4088c9ba8f85 MesaDemos-6.2.tar.bz2
+856f7ec947122eb3c8985ebc2f654dcd MesaDemos-6.2.zip
+</pre>
+
+
+<h2>August 18, 2004</h2>
+<p>
+Mesa 6.1 has been released.
+This is a new development release (version 6.2 will be a stabilization
+release).
+</p>
+<pre>
+ New:
+ - Revamped Makefile system
+ - glXUseRotatedXFont() utility (see xdemos/xuserotfont.c)
+ - internal driver interface changes related to texture object
+ allocation, vertex/fragment programs, BlendEquationSeparate, etc.
+ - option to walk triangle edges with double-precision floats
+ (Justin Novosad of Discreet) (see config.h file)
+ - support for AUX buffers in software GLX driver
+ - updated glext.h to version 24 and glxext.h to version 6
+ - new MESA_GLX_FORCE_ALPHA and MESA_GLX_DEPTH_BITS env vars
+ - updated BeOS support (Philippe Houdoin)
+ Changes:
+ - fragment fog interpolation is perspective corrected now
+ - new glTexImage code, much cleaner, may be a bit faster
+ Bug fixes:
+ - glArrayElement in display lists didn't handle generic vertex attribs
+ - glFogCoord didn't always work properly
+ - ARB_fragment_program fog options didn't work
+ - frag prog TEX instruction no longer incorrectly divides s,t,r by q
+ - ARB frag prog TEX and TEXP instructions now use LOD=0
+ - glTexEnviv in display lists didn't work
+ - glRasterPos didn't do texgen or apply texture matrix
+ - GL_DOUBLE-valued vertex arrays were broken in some cases
+ - fixed texture rectangle edge/border sampling bugs
+ - sampling an incomplete texture in a fragment program would segfault
+ - glTexImage was missing a few error checks
+ - fixed some minor glGetTexParameter glitches
+ - GL_INTENSITY was mistakenly accepted as a <format> to glTexImage
+ - fragment program writes to RC/HC register were broken
+ - fixed a few glitches in GL_HP_occlusion_test extension
+ - glBeginQueryARB and glEndQueryARB didn't work inside display lists
+ - vertex program state references were broken
+ - fixed triangle color interpolation bug on AIX (Shane Blackett)
+ - fixed a number of minor memory leaks (bug #1002030)
+</pre>
+The MD5 checksums are:
+</p>
+<pre>
+c9284d295ebcd2e0486cc3cd54e5863c MesaLib-6.1.tar.gz
+5de1f53ec0709f60fc68fdfed57351f3 MesaLib-6.1.tar.bz2
+483e77cac4789a5d36c42f3c0136d6d8 MesaLib-6.1.zip
+8c46cfa6f9732acc6f6c25724aad0246 MesaDemos-6.1.tar.gz
+89bfe0f6c69b39fd0ebd9fff481a4e9b MesaDemos-6.1.tar.bz2
+161268531fcc6f0c5a056430ee97e0c1 MesaDemos-6.1.zip
+</pre>
+
+
+
+<h2>April 2, 2004</h2>
+
+<p>
+Mesa 6.0.1 has been released.
+This release basically just fixes bugs since the 6.0. release.
+</p>
+<pre>
+ New:
+ - upgraded glext.h to version 22
+ - new build targets (Dan Schikore)
+ - new linux-x86-opteron build target (Heath Feather)
+ Bug fixes:
+ - glBindProgramARB didn't update all necessary state
+ - fixed build problems on OpenBSD
+ - omit CVS directories from tarballs
+ - glGetTexImage(GL_COLOR_INDEX) was broken
+ - fixed an infinite loop in t&l module
+ - silenced some valgrind warnings about using unitialized memory
+ - fixed some compilation/link glitches on IRIX (Mike Stephens)
+ - glBindProgram wasn't getting compiled into display lists
+ - GLX_FBCONFIG_ID wasn't recognized in glXChooseFBConfig() (bug 888079)
+ - two-sided lighting and vertex program didn't work (bug 887330)
+ - stores to program parameter registers in vertex state programs
+ didn't work.
+ - fixed glOrtho bug found with gcc 3.2.2 (RH9)
+ - glXCreateWindow() wasn't fully implemented (bug 890894)
+ - generic vertex attribute arrays didn't work in display lists
+ - vertex buffer objects' default usage and access fields were wrong
+ - glDrawArrays with start!=0 was broken
+ - fragment program PK2H, UP2H, UP4B and UP4UB instructions were broken
+ - linux-osmesa16-static config didn't work
+ - fixed a few color index rendering problems (bug 910687)
+ - glInterleavedArrays didn't respect GL_CLIENT_ACTIVE_TEXTURE
+ - OSMesa RGB and BGR modes were broken
+ - glProgramStringARB mistakenly required a null-terminated string
+ - fragment program XPD instruction was incorrect
+ - glGetMaterial() didn't work reliably
+</pre>
+The MD5 checksums are:
+</p>
+<pre>
+011be0e79666c7a6eb9693fbf9348653 MesaLib-6.0.1.tar.gz
+b7f14088c5c2f14490d2739a91102112 MesaLib-6.0.1.tar.bz2
+bf0510cf0a2b87d64cdd317eca3f1db1 MesaLib-6.0.1.zip
+b7b648599e0aaee1c4ffc554a2a9139e MesaDemos-6.0.1.tar.gz
+dd6aadfd9ca8e1cfa90c6ee492bc6f43 MesaDemos-6.0.1.tar.bz2
+eff71d59c211825e949199852f5a2316 MesaDemos-6.0.1.zip
+</pre>
+
+
+
+<h2>January 16, 2004</h2>
+
+<p>
+Mesa 6.0 has been released. This is a stabilization of the 5.1 release
+and primarily just incorporates bug fixes.
+</p>
+<pre>
+ New:
+ - full OpenGL 1.5 support
+ - updated GL/glext.h file to version 21
+ Changes:
+ - changed max framebuffer size to 4Kx4K (MAX_WIDTH/HEIGHT in config.h)
+ Bug fixes:
+ - fixed bug in UNCLAMPED_FLOAT_TO_UBYTE macro; solves a color
+ clamping issue
+ - updated suno5-gcc configs
+ - glColor3 functions sometimes resulted in undefined alpha values
+ - fixed FP divide by zero error seen on VMS with xlockmore, others
+ - fixed vertex/fragment program debug problem (bug 873011)
+ - building on AIX with gcc works now
+ - glDeleteProgramsARB failed for ARB fragment programs (bug 876160)
+ - glDrawRangeElements tried to modify potentially read-only storage
+ - updated files for building on Windows
+</pre>
+
+
+
+<h2>December 28, 2003</h2>
+
+<p>
+The Mesa CVS server has been moved to <a href="http://www.freedesktop.org"
+target="_parent">
+freedesktop.org</a> because of problems with SourceForge's anonymous
+CVS service.
+</p>
+
+<p>Please see the <a href="cvs_access.html">CVS access page</a> for details.
+</p>
+
+
+<h2>December 17, 2003</h2>
+
+<p>
+Mesa 5.1 has been released. This is a new development release.
+Mesa 6.0 will be the next stable release and will support all
+OpenGL 1.5 features.
+</p>
+<pre>
+ New features:
+ - reorganized directory tree
+ - GL_ARB_vertex/fragment_program extensions (Michal Krol & Karl Rasche)
+ - GL_ATI_texture_env_combine3 extension (Ian Romanick)
+ - GL_SGI_texture_color_table extension (Eric Plante)
+ - GL_NV_fragment_program extension
+ - GL_NV_light_max_exponent extension
+ - GL_EXT_texture_rectangle (identical to GL_NV_texture_rectangle)
+ - GL_ARB_occlusion_query extension
+ - GL_ARB_point_sprite extension
+ - GL_ARB_texture_non_power_of_two extension
+ - GL_IBM_multimode_draw_arrays extension
+ - GL_EXT_texture_mirror_clamp extension (Ian Romanick)
+ - GL_ARB_vertex_buffer_object extension
+ - new X86 feature detection code (Petr Sebor)
+ - less memory used for display lists and vertex buffers
+ - demo of per-pixel lighting with a fragment program (demos/fplight.c)
+ - new version (18) of glext.h header
+ - new spriteblast.c demo of GL_ARB_point_sprite
+ - faster glDrawPixels in X11 driver in some cases (see RELNOTES-5.1)
+ - faster glCopyPixels in X11 driver in some cases (see RELNOTES-5.1)
+ Bug fixes:
+ - really enable OpenGL 1.4 features in DOS driver.
+ - fixed issues in glDrawPixels and glCopyPixels for very wide images
+ - glPixelMapf/ui/usv()'s size parameter is GLsizei, not GLint
+ - fixed some texgen bugs reported by Daniel Borca
+ - fixed wglMakeCurrent(NULL, NULL) bug (#835861)
+ - fixed glTexSubImage3D z-offset bug (Cedric Gautier)
+ - fixed RGBA blend enable bug (Ville Syrjala)
+ - glAccum is supposed to be a no-op in selection/feedback mode
+ - fixed texgen bug #597589 (John Popplewell)
+ Changes:
+ - dropped API trace feature (src/Trace/)
+ - documentation overhaul. merged with website content. more html.
+ - glxgears.c demo updated to use GLX swap rate extensions
+ - glTexImage1/2/3D now allows width/height/depth = 0
+ - disable SPARC asm code on Linux (bug 852204)
+</pre>
+
+The MD5 checksums are:
+</p>
+<pre>
+78f452f6c55478471a744f07147612b5 MesaLib-5.1.tar.gz
+67b3b8d3f7f4c8c44904551b851d01af MesaLib-5.1.tar.bz2
+6dd19ffa750ec7f634e370a987505c9d MesaLib-5.1.zip
+e0214d4ebb22409dfa9262f2b52fd828 MesaDemos-5.1.tar.gz
+066c9aff4fd924405de1ae9bad5ec9a7 MesaDemos-5.1.tar.bz2
+d2b5ba32b53e0ad0576c637a4cc1fb41 MesaDemos-5.1.zip
+</pre>
+
+
+<H2>November 12, 2003</H2>
+
+<p>
+New Mesa 5.0.2 tarballs have been uploaded to SourceForge which fix a
+number of automake/libtool problems.
+</p>
+<p>
+The new MD5 checksums are:
+</p>
+<pre>
+a9dcf3ff9ad1b7d6ce73a0df7cff8b5b MesaLib-5.0.2.tar.gz
+7b4bf9261657c2fca03796d4955e6f50 MesaLib-5.0.2.tar.bz2
+79c141bddcbad557647535d02194f346 MesaLib-5.0.2.zip
+952d9dc823dd818981d1a648d7b2668a MesaDemos-5.0.2.tar.gz
+b81fafff90995025d2f25ea02b786642 MesaDemos-5.0.2.tar.bz2
+a21be975589e8a2d1871b6bb7874fffa MesaDemos-5.0.2.zip
+</pre>
+
+
+
+<h2>September 5, 2003</h2>
+
+<p>
+Mesa 5.0.2 has been released. This is a stable, bug-fix release.
+</p>
+<pre>
+ Bug fixes:
+ - fixed texgen problem causing texcoord's Q to be zero (stex3d)
+ - default GL_TEXTURE_COMPARE_MODE_ARB was wrong
+ - GL_CURRENT_MATRIX_NV query was wrong
+ - GL_CURRENT_MATRIX_STACK_DEPTH_NV query was off by one
+ - GL_LIST_MODE query wasn't correct
+ - GL_FOG_COORDINATE_SOURCE_EXT query wasn't supported
+ - GL_SECONDARY_COLOR_ARRAY_SIZE_EXT query returned wrong value
+ - blended, wide lines didn't always work correctly (bug 711595)
+ - glVertexAttrib4svNV w component was always 1
+ - fixed bug in GL_IBM_rasterpos_clip (missing return)
+ - GL_DEPTH_TEXTURE_MODE = GL_ALPHA didn't work correctly
+ - a few Solaris compilation fixes
+ - fixed glClear() problem for DRI drivers (non-existant stencil, etc)
+ - fixed int/REAL mixup in GLU NURBS curve evaluator (Eric Cazeaux)
+ - fixed delete [] bug in SI GLU (bug 721765) (Diego Santa Cruz)
+ - glFog() didn't clamp fog colors
+ - fixed bad float/int conversion for GL_TEXTURE_PRIORITY in the
+ gl[Get]TexParameteri[v] functions
+ - fixed invalid memory references in glTexGen functions (bug 781602)
+ - integer-valued color arrays weren't handled correctly
+ - glDrawPixels(GL_DEPTH_COMPONENT) with glPixelZoom didn't work
+ - GL_EXT_texture_lod_bias is part of 1.4, overlooked in 5.0.1
+ Changes:
+ - build GLUT with -fexceptions so C++ apps propogate exceptions
+</pre>
+
+
+
+<h2>June 2003</h2>
+
+<p>
+Mesa's directory tree has been overhauled.
+Things are better organized now with some thought toward future needs.
+</p>
+<p>
+In CVS, the latest Mesa 5.1 development code is now rooted under the
+<b>Mesa-newtree/</b> directory. The old top-level <b>Mesa/</b> directory
+holds the Mesa 5.0.x code which will be abandoned at some point.
+</p>
+
+
+
+<h2>March 30, 2003</h2>
+
+<p>
+Mesa 5.0.1 has been released. This is a stable, bug-fix release.
+</p>
+<pre>
+ New:
+ - DOS driver updates from Daniel Borca
+ - updated GL/gl_mangle.h file (Bill Hoffman)
+ Bug fixes:
+ - auto mipmap generation for cube maps was broken (bug 641363)
+ - writing/clearing software alpha channels was unreliable
+ - minor compilation fixes for OS/2 (Evgeny Kotsuba)
+ - fixed some bad assertions found with shadowtex demo
+ - fixed error checking bug in glCopyTexSubImage2D (bug 659020)
+ - glRotate(angle, -x, 0, 0) was incorrect (bug 659677)
+ - fixed potential segfault in texture object validation (bug 659012)
+ - fixed some bogus code in _mesa_test_os_sse_exception_support (Linus)
+ - fix fog stride bug in tnl code for h/w drivers (Michel Danzer)
+ - fixed glActiveTexture / glMatrixMode(GL_TEXTURE) bug (#669080)
+ - glGet(GL_CURRENT_SECONDARY_COLOR) should return 4 values, not 3
+ - fixed compilation problem on Solaris7/x86 (bug 536406)
+ - fixed prefetch bug in 3DNow! code (Felix Kuhling)
+ - fixed NeXT build problem (FABSF macro)
+ - glDrawPixels Z values when glPixelZoom!=1 were invalid (bug 687811)
+ - zoomed glDraw/CopyPixels with clipping sometimes failed (bug 689964)
+ - AA line and triangle Z values are now rounded, not truncated
+ - fixed color interpolation bug when GLchan==GLfloat (bug 694461)
+ - glArePrograms/TexturesResident() wasn't 100% correct (Jose Fonseca)
+ - fixed a minor GL_COLOR_MATERIAL bug
+ - NV vertex program EXP instruction was broken
+ - glColorMask misbehaved with X window / pixmap rendering
+ - fix autoconf/libtool GLU C++ linker problem on Linux (a total hack)
+ - attempt to fix GGI compilation problem when MesaDemos not present
+ - NV vertex program ARL-relative fetches didn't work
+ Changes:
+ - use glPolygonOffset in gloss demo to avoid z-fighting artifacts
+ - updated winpos and pointblast demos to use ARB extensions
+ - disable SPARC normal transformation code (bug 673938)
+ - GLU fixes for OS/2 (Evgeny Kotsuba)
+</pre>
+<p>
+MD5 checksums follow:
+</p>
+<pre>
+b80f8b5d53a3e9f19b9fde5af0c542f0 MesaLib-5.0.1.tar.gz
+513b4bbd7d38951f05027179063d876b MesaLib-5.0.1.tar.bz2
+eebd395678f4520d33b267e5d5c22651 MesaLib-5.0.1.zip
+49d7feaec6dc1d2091d7c3cc72a9b320 MesaDemos-5.0.1.tar.gz
+37190374a98c3c892f0698be9ca3acf0 MesaDemos-5.0.1.tar.bz2
+becd8bf17f5791361b4a54ba2a78e5c9 MesaDemos-5.0.1.zip
+</pre>
+
+
+
+<h2>March 7, 2003</h2>
+<p>
+Website and documentation overhaul.
+</p>
+<p>
+The website content and Mesa documentation (from the doc/ directory) have
+been merged together.
+All the documentation files have been entered into the CVS repository.
+Many of the old plain-text files have been converted to html and modernized.
+</p>
+
+
+<h2>November 13, 2002</h2>
+<p>Mesa 5.0 has been released. This is a stable release which
+implements the OpenGL 1.4 specification.
+</p><pre>New:
+ - OpenGL 1.4 support (glGetString(GL_VERSION) returns "1.4")
+ - removed some overlooked debugging code
+ - glxinfo updated to support GLX_ARB_multisample
+ - GLUT now support GLX_ARB_multisample
+ - updated DOS driver (Daniel Borca)
+Bug fixes:
+ - GL_POINT and GL_LINE-mode polygons didn't obey cull state
+ - fixed potential bug in _mesa_align_malloc/calloc()
+ - fixed missing triangle bug when running vertex programs
+ - fixed a few HPUX compilation problems
+ - FX (Glide) driver didn't compile
+ - setting GL_TEXTURE_BORDER_COLOR with glTexParameteriv() didn't work
+ - a few EXT functions, like glGenTexturesEXT, were no-ops
+ - a few OpenGL 1.4 functions like glFogCoord*, glBlendFuncSeparate,
+ glMultiDrawArrays and glMultiDrawElements were missing
+ - glGet*(GL_ACTIVE_STENCIL_FACE_EXT) was broken
+ - Pentium 4 Mobile was mistakenly identified as having 3DNow!
+ - fixed one-bit error in point/line fragment Z calculation
+ - fixed potential segfault in fakeglx code
+ - fixed color overflow problem in DOT3 texture env mode
+</pre>
+
+
+<h2>October 29, 2002</h2>
+<p>Mesa 4.1 has been released. This is a new development release.
+For a stable release, get 4.0.4.
+</p><pre>New:
+ - GL_NV_vertex_program extension
+ - GL_NV_vertex_program1_1 extension
+ - GL_ARB_window_pos extension
+ - GL_ARB_depth_texture extension
+ - GL_ARB_shadow extension
+ - GL_ARB_shadow_ambient extension
+ - GL_EXT_shadow_funcs extension
+ - GL_ARB_point_parameters extension
+ - GL_ARB_texture_env_crossbar
+ - GL_NV_point_sprite extension
+ - GL_NV_texture_rectangle extension
+ - GL_EXT_multi_draw_arrays extension
+ - GL_EXT_stencil_two_side extension
+ - GLX_SGIX_fbconfig and GLX_SGIX_pbuffer extensions
+ - GL_ATI_texture_mirror_once extension (Ian Romanick)
+ - massive overhaul/simplification of software rasterizer module,
+ many contributions from Klaus Niederkrueger
+ - faster software texturing in some cases (i.e. trilinear filtering)
+ - new OSMesaGetProcAddress() function
+ - more blend modes implemented with MMX code (Jose Fonseca)
+ - added glutGetProcAddress() to GLUT
+ - added GLUT_FPS env var to compute frames/second in glutSwapBuffers()
+ - pbinfo and pbdemo PBuffer programs
+ - glxinfo -v prints transprent pixel info (Gerd Sussner)
+Bug fixes:
+ - better mipmap LOD computation (prevents excessive blurriness)
+ - OSMesaMakeCurrent() didn't recognize buffer size changes
+ - assorted conformance fixes for 16-bit/channel rendering
+ - texcombine alpha subtraction mode was broken
+ - fixed some blend problems when GLchan==GLfloat (Gerk Huisma)
+ - clamp colors to [0,1] in OSMesa if GLchan==GLfloat (Gerk Huisma)
+ - fixed divide by zero error in NURBS tessellator (Jon Perry)
+ - fixed GL_LINEAR fog bug by adding clamping
+ - fixed FP exceptions found using Alpha CPU
+ - 3dfx/glide driver render-to-window feature was broken
+ - added missing GLX_TRANSPARENT_RGB token to glx.h
+ - fixed error checking related to paletted textures
+ - fixed reference count error in glDeleteTextures (Randy Fayan)
+Changes:
+ - New spec file and Python code to generate some GL dispatch files
+ - Glide driver defaults to "no" with autoconf/automake
+ - floating point color channels now clamped to [0,inf)
+ - updated demos/stex3d with new options
+</pre>
+
+
+<h2>October 4, 2002</h2>
+<p>
+The <a href="http://mesa3d.sourceforge.net/docs/MesaFAQ.html">Mesa FAQ</a> has been rewritten.
+</p>
+
+<h2>October 3, 2002</h2>
+<p>Mesa 4.0.4 has been released. This is a stable bug-fix release.
+</p><pre> New:
+ - GL_NV_texture_rectangle extension
+ - updated glext.h header (version 17)
+ - updated DOS driver (Daniel Borca)
+ - updated BeOS R5 driver (Philippe Houdoin)
+ - added GL_IBM_texture_mirror_repeat
+ - glxinfo now takes -l option to print interesting OpenGL limits info
+ - GL_MESA_ycbcr_texture extension
+ - GL_APPLE_client_storage extension (for some DRI drivers only)
+ - GL_MESA_pack_invert extension
+ Bug fixes:
+ - fixed GL_LINEAR fog bug by adding clamping
+ - fixed FP exceptions found using Alpha CPU
+ - 3dfx MESA_GLX_FX=window (render to window) didn't work
+ - fixed memory leak in wglCreateContest (Karl Schultz)
+ - define GLAPIENTRY and GLAPI if undefined in glu.h
+ - wglGetProcAddress didn't handle all API functions
+ - when testing for OpenGL 1.2 vs 1.3, check for GL_ARB_texture_cube_map
+ - removed GL_MAX_CONVOLUTION_WIDTH/HEIGHT from glGetInteger/Float/etc()
+ - error checking in compressed tex image functions had some glitches
+ - fixed AIX compile problem in src/config.c
+ - glGetTexImage was using pixel unpacking instead of packing params
+ - auto-mipmap generation for cube maps was incorrect
+ Changes:
+ - max texture units reduced to six to accomodate texture rectangles
+ - removed unfinished GL_MESA_sprite_point extension code
+</pre>
+
+<h2>June 25, 2002</h2>
+<p>Mesa 4.0.3 has been released. This is a stable bug-fix release.
+</p><pre> New:
+ - updated GL/glext.h file (version 15)
+ - corrected MMX blend code (Jose Fonseca)
+ - support for software-based alpha planes in Windows driver
+ - updated GGI driver (Filip Spacek)
+ Bug fixes:
+ - glext.h had wrong values for GL_DOT3_RGB[A]_EXT tokens
+ - OSMesaMakeCurrent() didn't recognize buffer size changes
+ - assorted conformance fixes for 16-bit/channel rendering
+ - texcombine alpha subtraction mode was broken
+ - fixed lighting bug with non-uniform scaling and display lists
+ - fixed bug when deleting shared display lists
+ - disabled SPARC cliptest assembly code (Mesa bug 544665)
+ - fixed a couple Solaris compilation/link problems
+ - blending clipped glDrawPixels didn't always work
+ - glGetTexImage() didn't accept packed pixel types
+ - glPixelMapu[is]v() could explode given too large of pixelmap
+ - glGetTexParameter[if]v() didn't accept GL_TEXTURE_MAX_ANISOTROPY_EXT
+ - glXCopyContext() could lead to segfaults
+ - glCullFace(GL_FRONT_AND_BACK) didn't work (bug 572665)
+ Changes:
+ - lots of C++ (g++) code clean-ups
+ - lots of T&amp;L updates for the Radeon DRI driver
+ Known bugs:
+ - mipmap LOD computation (fixed for Mesa 4.1)
+</pre>
+
+<h2>April 2, 2002</h2>
+<p>Mesa 4.0.2 has been released. This is a stable bug-fix release.
+</p><pre> New:
+ - New DOS (DJGPP) driver written by Daniel Borca
+ - New driver interface functions for TCL drivers (such as Radeon DRI)
+ - GL_RENDERER string returns "Mesa Offscreen16" or "Mesa Offscreen32"
+ if using deep color channels
+ - latest GL/glext.h and GL/glxext.h headers from SGI
+ Bug fixes:
+ - GL_BLEND with non-black texture env color wasn't always correct
+ - GL_REPLACE with GL_RGB texture format wasn't always correct (alpha)
+ - glTexEnviv( pname != GL_TEXTURE_ENV_COLOR ) was broken
+ - glReadPixels was sometimes mistakenly clipped by the scissor box
+ - glDraw/ReadPixels didn't catch all the errors that they should have
+ - Fixed 24bpp rendering problem in Windows driver (Karl Schultz)
+ - 16-bit GLchan mode fixes (m_trans_tmp.h, s_triangle.c)
+ - Fixed 1-bit float-&gt;int conversion bug in glDrawPixels(GL_DEPTH_COMP)
+ - glColorMask as sometimes effecting glXSwapBuffers()
+ - fixed a potential bug in XMesaGarbageCollect()
+ - N threads rendering into one window didn't work reliably
+ - glCopyPixels didn't work for deep color channels
+ - improved 8 -&gt; 16bit/channel texture image conversion (Gerk Huisma)
+ - glPopAttrib() didn't correctly restore user clip planes
+ - user clip planes failed for some perspective projections (Chromium)
+</pre>
+
+<h2>December 17, 2001</h2>
+<p>Mesa 4.0.1 has been released. This is a stable bug-fix release.
+</p><pre> New:
+ - better sub-pixel sample positions for AA triangles (Ray Tice)
+ - slightly faster blending for (GL_ZERO, GL_ONE) and (GL_ONE, GL_ZERO)
+ Bug fixes:
+ - added missing break statements in glGet*() for multisample cases
+ - fixed uninitialized hash table mutex bug (display lists / texobjs)
+ - fixed bad teximage error check conditional (bug 476846)
+ - fixed demos readtex.c compilation problem on Windows (Karl Schultz)
+ - added missing glGet() query for GL_MAX_TEXTURE_LOD_BIAS_EXT
+ - silence some compiler warnings (gcc 2.96)
+ - enable the #define GL_VERSION_1_3 in GL/gl.h
+ - added GL 1.3 and GLX 1.4 entries to gl_mangle.h and glx_mangle.h
+ - fixed glu.h typedef problem found with MSDev 6.0
+ - build libGL.so with -Bsymbolic (fixes bug found with Chromium)
+ - added missing 'const' to glXGetContextIDEXT() in glxext.h
+ - fixed a few glXGetProcAddress() errors (texture compression, etc)
+ - fixed start index bug in compiled vertex arrays (Keith)
+ - fixed compilation problems in src/SPARC/glapi_sparc.S
+ - fixed triangle strip "parity" bug found in VTK medical1 demo (Keith)
+ - use glXGetProcAddressARB in GLUT to avoid extension linking problems
+ - provoking vertex of flat-shaded, color-index triangles was wrong
+ - fixed a few display list bugs (GLUT walker, molecule, etc) (Keith)
+ - glTexParameter didn't flush the vertex buffer (Ray Tice)
+ - feedback attributes for glDraw/CopyPixels and glBitmap were wrong
+ - fixed bug in normal length caching (ParaView lighting bug)
+</pre>
+
+<h2>October 22, 2001</h2>
+<p>Mesa 4.0 has been released. This is a stable release.
+</p><pre> New:
+ - Mesa 4.0 implements the OpenGL 1.3 specification
+ - GL_IBM_rasterpos_clip extension
+ - GL_EXT_texture_edge_clamp extension (aka GL_SGIS_texture_edge_clamp)
+ - GL_ARB_texture_mirrored_repeat extension
+ - WindML UGL driver (Stephane Raimbault)
+ - added OSMESA_MAX_WIDTH/HEIGHT queries
+ - attempted compiliation fixes for Solaris 5, 7 and 8
+ - updated glext.h and glxext.h files
+ - updated Windows driver (Karl Schultz)
+ Bug fixes:
+ - added some missing GLX 1.3 tokens to include/GL/glx.h
+ - GL_COLOR_MATRIX changes weren't recognized by teximage functions
+ - glCopyPixels with scale and bias was broken
+ - glRasterPos with lighting could segfault
+ - glDeleteTextures could leave a dangling pointer
+ - Proxy textures for cube maps didn't work
+ - fixed a number of 16-bit color channel bugs
+ - fixed a few minor memory leaks
+ - GLX context sharing was broken in 3.5
+ - fixed state-update bugs in glPopClientAttrib()
+ - fixed glDrawRangeElements() bug
+ - fixed a glPush/PopAttrib() bug related to texture binding
+ - flat-shaded, textured lines were broken
+ - fixed a dangling pointer problem in the XMesa code (Chris Burghart)
+ - lighting didn't always produce the correct alpha value
+ - fixed 3DNow! code to not read past end of arrays (Andrew Lewycky)
+</pre>
+
+
+<h2>June 21, 2001</h2>
+<p>Mesa 3.5 has been released. This is a new development release.
+</p><pre> New:
+ - internals of Mesa divided into modular pieces (Keith Whitwell)
+ - 100% OpenGL 1.2 conformance (passes all conformance tests)
+ - new AA line algorithm
+ - GL_EXT_convolution extension
+ - GL_ARB_imaging subset
+ - OSMesaCreateContextExt() function
+ - GL_ARB_texture_env_add extension (same as GL_EXT_texture_env_add)
+ - GL_MAX_TEXTURE_UNITS_ARB now defaults to eight
+ - GL_EXT_fog_coord extension (Keith Whitwell)
+ - GL_EXT_secondary_color extension (Keith Whitwell)
+ - GL_ARB_texture_env_add extension (same as GL_EXT_texture_env_add)
+ - GL_SGIX_depth_texture extension
+ - GL_SGIX_shadow and GL_SGIX_shadow_ambient extensions
+ - demos/shadowtex.c demo of GL_SGIX_depth_texture and GL_SGIX_shadow
+ - GL_ARB_texture_env_combine extension
+ - GL_ARB_texture_env_dot3 extension
+ - GL_ARB_texture_border_clamp (aka GL_SGIS_texture_border_clamp)
+ - OSMesaCreateContextExt() function
+ - libOSMesa.so library, contains the OSMesa driver interface
+ - GL/glxext.h header file for GLX extensions
+ - somewhat faster software texturing, fogging, depth testing
+ - all color-index conformance tests now pass (only 8bpp tested)
+ - SPARC assembly language TCL optimizations (David Miller)
+ - GL_SGIS_generate_mipmap extension
+ Bug Fixes:
+ - fbiRev and tmuRev were unitialized when using Glide3
+ - fixed a few color index mode conformance failures; all pass now
+ - now appling antialiasing coverage to alpha after texturing
+ - colors weren't getting clamped to [0,1] before color table lookup
+ - fixed RISC alignment errors caused by COPY_4UBV macro
+ - drawing wide, flat-shaded lines could cause a segfault
+ - vertices now snapped to 1/16 pixel to fix rendering of tiny triangles
+ Changes:
+ - SGI's Sample Implementation (SI) 1.3 GLU library replaces Mesa GLU
+ - new libOSMesa.so library, contains the OSMesa driver interface
+</pre>
+
+
+<h2>May 17, 2001</h2>
+<p>Mesa 3.4.2 has been released. This is basically just a bug-fix release.
+Here's what's new:</p>
+<pre> Bug fixes:
+ - deleting the currently bound texture could cause bad problems
+ - using fog could result in random vertex alpha values
+ - AA triangle rendering could touch pixels outside right window bound
+ - fixed byteswapping problem in clear_32bit_ximage() function
+ - fixed bugs in wglUseFontBitmapsA(), by Frank Warmerdam
+ - fixed memory leak in glXUseXFont()
+ - fragment sampling in AA triangle function was off by 1/2 pixel
+ - Windows: reading pixels from framebuffer didn't always work
+ - glConvolutionFilter2D could segfault or cause FP exception
+ - fixed segfaults in FX and X drivers when using tex unit 1 but not 0
+ - GL_NAND logicop didn't work right in RGBA mode
+ - fixed a memory corruption bug in vertex buffer reset code
+ - clearing the softwara alpha buffer with scissoring was broken
+ - fixed a few color index mode fog bugs
+ - fixed some bad assertions in color index mode
+ - fixed FX line 'stipple' bug #420091
+ Changes:
+ - optimized writing mono-colored pixel spans to X pixmaps
+ - increased max viewport size to 2048 x 2048
+</pre>
+
+
+<h2>April 29, 2001</h2>
+<p>New Mesa website</p>
+<p>Mark Manning produced the new website.<br>Thanks, Mark!</p>
+
+
+<h2>February 14, 2001</h2>
+<p>Mesa 3.4.1 has been released. Here's what's new:</p>
+<pre> New:
+ - fixed some Linux build problems
+ - fixed some Windows build problems
+ - GL_EXT_texture_env_dot3 extension (Gareth Hughes)
+ Bug fixes:
+ - added RENDER_START/RENDER_FINISH macros for glCopyTexImage in DRI
+ - various state-update code changes needed for DRI bugs
+ - disabled pixel transfer ops in glColorTable commands, not needed
+ - fixed bugs in glCopyConvolutionFilter1D/2D, glGetConvolutionFilter
+ - updated sources and fixed compile problems in widgets-mesa/
+ - GLX_PBUFFER enum value was wrong in glx.h
+ - fixed a glColorMaterial lighting bug
+ - fixed bad args to Read/WriteStencilSpan in h/w stencil clear function
+ - glXCopySubBufferMESA() Y position was off by one
+ - Error checking of glTexSubImage3D() was broken (bug 128775)
+ - glPopAttrib() didn't restore all derived Mesa state correctly
+ - Better glReadPixels accuracy for 16bpp color - fixes lots of OpenGL
+ conformance problems at 16bpp.
+ - clearing depth buffer with scissoring was broken, would segfault
+ - OSMesaGetDepthBuffer() returned bad bytesPerValue value
+ - fixed a line clipping bug (reported by Craig McDaniel)
+ - fixed RGB color over/underflow bug for very tiny triangles
+ Known problems:
+ - NURBS or evaluator surfaces inside display lists don't always work
+</pre>
+<p>
+</p><h2>November 3, 2000</h2>
+<p>Mesa 3.4 has been released. Here's what's new since the 3.3 release:</p>
+<pre> New:
+ - optimized glDrawPixels for glPixelZoom(1,-1)
+ Bug Fixes:
+ - widgets-mesa/src/*.c files were missing from 3.3 distro
+ - include/GL/mesa_wgl.h file was missing from 3.3 distro
+ - fixed some Win32 compile problems
+ - texture object priorities weren't getting initialized to 1.0
+ - glAreTexturesResident return value was wrong when using hardware
+ - glXUseXFont segfaulted when using 3dfx driver (via MESA_GLX_FX)
+ - glReadPixels with GLushort packed types was broken
+ - fixed a few bugs in the GL_EXT_texture_env_combine texture code
+ - glPush/PopAttrib(GL_ENABLE_BIT) mishandled multi-texture enables
+ - fixed some typos/bugs in the VB code
+ - glDrawPixels(GL_COLOR_INDEX) to RGB window didn't work
+ - optimized glDrawPixels paths weren't being used
+ - per-fragment fog calculation didn't work without a Z buffer
+ - improved blending accuracy, fixes Glean blendFunc test failures
+ - glPixelStore(GL_PACK/UNPACK_SKIP_IMAGES) wasn't handled correctly
+ - glXGetProcAddressARB() didn't always return the right address
+ - gluBuild[12]DMipmaps() didn't grok the GL_BGR pixel format
+ - texture matrix changes weren't always detected (GLUT projtex demo)
+ - fixed random color problem in vertex fog code
+ - fixed Glide-related bug that let Quake get a 24-bit Z buffer
+ Changes:
+ - finished internal support for compressed textures for DRI
+</pre>
+<p>
+</p><h2>April 24, 2000</h2>
+<p>Mesa 3.2 has been released. Here's what's new since the beta release:</p>
+<pre> Bug fixes:
+ - fixed memcpy bugs in span.c
+ - fixed missing glEnd problem in demos/tessdemo.c
+ - fixed bug when clearing 24bpp Ximages
+ - fixed clipping problem found in Unreal Tournament
+ - fixed Loki's "ice bug" and "crazy triangles" seen in Heretic2
+ - fixed Loki's 3dfx RGB vs BGR bug
+ - fixed Loki's 3dfx smooth/flat shading bug in SoF
+ Changes:
+ - updated docs/README file
+ - use bcopy() optimizations on FreeBSD
+ - re-enabled the optimized persp_textured_triangle() function
+</pre>
+<p>
+</p><h2>March 23, 2000</h2>
+<p>I've just upload the Mesa 3.2 beta 1 files to SourceForge at <a href="http://sourceforge.net/project/showfiles.php?group_id=3" target="_parent">http://sourceforge.net/project/filelist.php?group_id=3</a><a href="http://sourceforge.net/project/showfiles.php?group_id=3"></a></p>
+<p>3.2 (note even number) is a stabilization release of Mesa 3.1 meaning it's mainly
+just bug fixes.</p>
+<p>Here's what's changed:
+
+</p><ul>
+ Bug fixes:
+ <ul>
+ - mixed drawing of lines and bitmaps sometimes had wrong colors<br>
+ - added missing glHintPGI() function<br>
+ - fixed a polygon culling bug<br>
+ - fixed bugs in gluPartialDisk()<br>
+ - Z values in selection mode were wrong<br>
+ - added missing tokens:
+ <ul>
+ GL_SMOOTH_POINT_SIZE_RANGE<br>
+ GL_SMOOTH_POINT_SIZE_GRANULARITY<br>
+ GL_SMOOTH_LINE_WIDTH_RANGE<br>
+ GL_SMOOTH_LINE_WIDTH_GRANULARITY<br>
+ GL_ALIASED_POINT_SIZE_RANGE<br>
+ GL_ALIASED_LINE_WIDTH_RANGE
+ </ul>
+ - fixed glCopyPixels when copying from back to front buffer<br>
+ - GL_EXT_compiled_vertex_array tokens had _SGI suffix instead of _EXT<br>
+ - glDrawRangeElements(GL_LINES, 0, 1, 2, type, indices) was broken<br>
+ - glDeleteTextures() didn't decrement reference count correctly<br>
+ - GL_SRCA_ALPHA_SATURATE blend mode didn't work correctly<br>
+ - Actual depth of transformation matrix stacks was off by one<br>
+ - 24bpp visuals didn't address pixels correctly<br>
+ - mipmap level of detail (lambda) calculation simplified, more accurate<br>
+ - 101691 - Polygon clipping and GL_LINE<br>
+ - 101928 - Polygon clipping and GL_LINE (same fix as above)<br>
+ - 101808 - Non-glVertexArrays tristrip bug<br>
+ - 101971 - find_last_3f on Dec OSF (worked around)<br>
+ - 102369 - segv on dec osf (possibly a duplicate of the above)<br>
+ - 102893 - orientations of modelview cause segfault
+ </ul>
+ New:
+ <ul>
+ - updated SVGA Linux driver<br>
+ - added the MESA_FX_NO_SIGNALS env var, see docs/README.3DFX<br>
+ - build libGLw.a (Xt/OpenGL drawing area widget) library by default<br>
+ - changed -O2 to -O3 for a number of gcc configs
+ </ul>
+ Changes:
+ <ul>
+ - glXCopyContext's mask parameter is now unsigned long, per GLX spec
+ </ul>
+</ul>
+
+<p>Please report any problems with this release ASAP. Bugs should be filed on the
+Mesa3D website at sourceforge.<br>
+After 3.2 is wrapped up I hope to release 3.3 beta 1 soon afterward.</p>
+<p>-- Brian</p>
+<p>
+</p><h2>December 17, 1999</h2>
+<p>A Slashdot interview with Brian about Mesa (questions submitted by Slashdot readers)
+can be found at <a href="http://slashdot.org/interviews/99/12/17/0927212.shtml" target="_parent">http://slashdot.org/interviews/99/12/17/0927212.shtml</a>.</p>
+<p>
+</p><h2>December 14, 1999</h2>
+<p>Mesa 3.1 is released!</p>
+<p>
+</p><h2>September 21, 1999</h2>
+<p>There appear to be two new files on the ftp site, <a href="ftp://ftp.mesa3d.org/mesa/beta/MesaLib-3.1beta3.tar.gz">MesaLib-3.1beta3.tar.gz</a>
+and <a href="ftp://ftp.mesa3d.org/mesa/beta/MesaDemos-3.1beta3.tar.gz">MesaDemos-3.1beta3.tar.gz</a>,
+that seem to be... yes, I've just received confirmation from the beta center, they
+are indeed the <b>THIRD</b> beta release of Mesa 3.1! Happy Days. Happy Days. Thanks
+Keith Whitwell for preparing these for us during Brian's absence.</p>
+<p>
+</p><h2>August 30, 1999</h2>
+<p>I'm pleased to announce that I've accepted a position with Precision Insight,
+Inc. effective October, 1999. I'll be leaving Avid Technology in September.</p>
+<p>I've been working on Mesa in my spare time for over five years. With Precision
+Insight I now have the opportunity to devote my full attention to advancing Mesa
+and OpenGL on Linux.</p>
+<p>While I'll be focused on Linux, the X Window System, and hardware acceleration,
+my work will continue to be open sourced and available to any other programmers who
+may want to contribute to it, or use it for other projects or platforms</p>
+<p>PS: I'm going to be traveling until Sep 6 and won't be reading email until then.</p>
+<p>
+</p><h2>August 23, 1999</h2>
+<p>Anonymous CVS access is back online so suck up all the bandwidth you can afford.
+Note that this is a new archive, so you will need to re-checkout the archive. That
+means don't <i>cvs update</i> from a previous download.</p>
+<p>
+</p><h2>August 17, 1999</h2>
+<p>A report from the SIGGRAPH '99 Linux/OpenGL
+BOF meeting is now available.</p>
+<p>-Brian</p>
+<p>
+</p><h2>August 14, 1999</h2>
+<p>www.mesa3d.org is having technical problems due to hardware failures at VA Linux
+systems. The Mac pages, ftp, and CVS services aren't fully restored yet. Please be
+patient.</p>
+<p>-Brian</p>
+<p>
+</p><h2>June 7, 1999</h2>
+<p>RPMS of the nVidia RIVA server can be found at <a href="ftp://ftp.mesa3d.org/mesa/misc/nVidia/">ftp://ftp.mesa3d.org/mesa/misc/nVidia/</a>.</p>
+<p>
+</p><h2>June 2, 1999</h2>
+<p><a href="http://www.nvidia.com/">nVidia</a> has released some Linux binaries for
+xfree86 3.3.3.1, along with the <b>full source</b>, which includes GLX acceleration
+based on Mesa 3.0. They can be downloaded from <a href="http://www.nvidia.com/Products.nsf/htmlmedia/software_drivers.html">http://www.nvidia.com/Products.nsf/htmlmedia/software_drivers.html</a>.</p>
+<p>
+</p><h2>May 24, 1999</h2>
+<p>Beta 2 of Mesa 3.1 has been make available at <a href="ftp://ftp.mesa3d.org/mesa/beta/">ftp://ftp.mesa3d.org/mesa/beta/</a>.
+If you are into the quake scene, you may want to try this out, as it contains some
+optimizations specifically in the Q3A rendering path.
+<p>
+</p><h2>May 13, 1999</h2>
+<p>For those interested in the integration of Mesa into XFree86 4.0, Precision Insight
+has posted their lowlevel design documents at http://www.precisioninsight.com.</p>
+<p>
+</p><h2>May 13, 1999</h2>
+<pre>May 1999 - John Carmack of id Software, Inc. has made a donation of
+US$10,000 to the Mesa project to support its continuing development.
+Mesa is a free implementation of the OpenGL 3D graphics library and id's
+newest game, Quake 3 Arena, will use Mesa as the 3D renderer on Linux.
+
+The donation will go to Keith Whitwell, who has been optimizing Mesa to
+improve performance on 3d hardware. Thanks to Keith's work, many
+applications using Mesa 3.1 will see a dramatic performance increase
+over Mesa 3.0. The donation will allow Keith to continue working on
+Mesa full time for some time to come.
+
+For more information about Mesa see www.mesa3d.org. For more
+information about id Software, Inc. see www.idsoftware.com.
+
+--------------------------------
+
+This donation from John/id is very generous. Keith and I are very
+grateful.
+
+</pre>
+<p>
+</p><h2>May 1, 1999</h2>
+<p>John Carmack made an interesting .plan update yesterday:
+
+</p><ul>
+ <i>"I put together a document on optimizing OpenGL drivers for Q3 that
+ should be helpful to the various Linux 3D teams. <br>
+ </i>http://www.quake3arena.com/news/glopt.html</i>"
+</ul>
+
+<p>
+</p><h2>April 7, 1999</h2>
+<p>Updated the Mesa contributors section and added links to RPM Mesa packages.</p>
+<p>
+</p><h2>March 18, 1999</h2>
+<p>The new webpages are now online. Enjoy, and let me know if you find any errors.
+<p>
+</p><h2>February 16, 1999</h2>
+<p><a href="http://www.sgi.com/">SGI</a> releases its <a href="http://www.sgi.com/software/opensource/glx/">GLX
+source code</a>.</p>
+<p>
+</p><h2>January 22, 1999</h2>
+<p>www.mesa3d.org established</p>
+
+
+</p>
+
+
+<hr>
+</body>
+</html>
diff --git a/mesalib/docs/relnotes.html b/mesalib/docs/relnotes.html
index c1a7ab78d..794fd60a2 100644
--- a/mesalib/docs/relnotes.html
+++ b/mesalib/docs/relnotes.html
@@ -1,89 +1,89 @@
-<HTML>
-
-<TITLE>Mesa Release Notes</TITLE>
-
-<link rel="stylesheet" type="text/css" href="mesa.css"></head>
-
-<BODY>
-
-<H1>Release Notes</H1>
-
-<p>
-The release notes summarize what's new or changed in each Mesa release.
-</p>
-
-<UL>
-<LI><A HREF="relnotes-7.11.html">7.11 release notes</A>
-<LI><A HREF="relnotes-7.10.2.html">7.10.2 release notes</A>
-<LI><A HREF="relnotes-7.10.1.html">7.10.1 release notes</A>
-<LI><A HREF="relnotes-7.10.html">7.10 release notes</A>
-<LI><A HREF="relnotes-7.9.2.html">7.9.2 release notes</A>
-<LI><A HREF="relnotes-7.9.1.html">7.9.1 release notes</A>
-<LI><A HREF="relnotes-7.9.html">7.9 release notes</A>
-<LI><A HREF="relnotes-7.8.3.html">7.8.3 release notes</A>
-<LI><A HREF="relnotes-7.8.2.html">7.8.2 release notes</A>
-<LI><A HREF="relnotes-7.8.1.html">7.8.1 release notes</A>
-<LI><A HREF="relnotes-7.8.html">7.8 release notes</A>
-<LI><A HREF="relnotes-7.7.1.html">7.7.1 release notes</A>
-<LI><A HREF="relnotes-7.7.html">7.7 release notes</A>
-<LI><A HREF="relnotes-7.6.1.html">7.6.1 release notes</A>
-<LI><A HREF="relnotes-7.6.html">7.6 release notes</A>
-<LI><A HREF="relnotes-7.5.2.html">7.5.2 release notes</A>
-<LI><A HREF="relnotes-7.5.1.html">7.5.1 release notes</A>
-<LI><A HREF="relnotes-7.5.html">7.5 release notes</A>
-<LI><A HREF="relnotes-7.4.4.html">7.4.4 release notes</A>
-<LI><A HREF="relnotes-7.4.3.html">7.4.3 release notes</A>
-<LI><A HREF="relnotes-7.4.2.html">7.4.2 release notes</A>
-<LI><A HREF="relnotes-7.4.1.html">7.4.1 release notes</A>
-<LI><A HREF="relnotes-7.4.html">7.4 release notes</A>
-<LI><A HREF="relnotes-7.3.html">7.3 release notes</A>
-<LI><A HREF="relnotes-7.2.html">7.2 release notes</A>
-<LI><A HREF="relnotes-7.1.html">7.1 release notes</A>
-<LI><A HREF="relnotes-7.0.4.html">7.0.4 release notes</A>
-<LI><A HREF="relnotes-7.0.3.html">7.0.3 release notes</A>
-<LI><A HREF="relnotes-7.0.2.html">7.0.2 release notes</A>
-<LI><A HREF="relnotes-7.0.1.html">7.0.1 release notes</A>
-<LI><A HREF="relnotes-7.0.html">7.0 release notes</A>
-<LI><A HREF="relnotes-6.5.3.html">6.5.3 release notes</A>
-<LI><A HREF="relnotes-6.5.2.html">6.5.2 release notes</A>
-<LI><A HREF="relnotes-6.5.1.html">6.5.1 release notes</A>
-<LI><A HREF="relnotes-6.5.html">6.5 release notes</A>
-<LI><A HREF="relnotes-6.4.2.html">6.4.2 release notes</A>
-<LI><A HREF="relnotes-6.4.1.html">6.4.1 release notes</A>
-<LI><A HREF="relnotes-6.4.html">6.4 release notes</A>
-</UL
-
-<p>
-Versions of Mesa prior to 6.4 are summarized in the
-<a href="versions.html">versions file</a> and the following release notes.
-</p>
-
-<UL>
-<LI><A HREF="RELNOTES-6.3.2">RELNOTES-6.3.2</A>
-<LI><A HREF="RELNOTES-6.3">RELNOTES-6.3</A>
-<LI><A HREF="RELNOTES-6.2.1">RELNOTES-6.2.1</A>
-<LI><A HREF="RELNOTES-6.2">RELNOTES-6.2</A>
-<LI><A HREF="RELNOTES-6.1">RELNOTES-6.1</A>
-<LI><A HREF="RELNOTES-6.0">RELNOTES-6.0</A>
-<LI><A HREF="RELNOTES-5.1">RELNOTES-5.1</A>
-<LI><A HREF="RELNOTES-5.0.2">RELNOTES-5.0.2</A>
-<LI><A HREF="RELNOTES-5.0.1">RELNOTES-5.0.1</A>
-<LI><A HREF="RELNOTES-5.0">RELNOTES-5.0</A>
-<LI><A HREF="RELNOTES-4.1">RELNOTES-4.1</A>
-<LI><A HREF="RELNOTES-4.0.3">RELNOTES-4.0.3</A>
-<LI><A HREF="RELNOTES-4.0.2">RELNOTES-4.0.2</A>
-<LI><A HREF="RELNOTES-4.0.1">RELNOTES-4.0.1</A>
-<LI><A HREF="RELNOTES-4.0">RELNOTES-4.0</A>
-<LI><A HREF="RELNOTES-3.5">RELNOTES-3.5</A>
-<LI><A HREF="RELNOTES-3.4.2">RELNOTES-3.4.2</A>
-<LI><A HREF="RELNOTES-3.4.1">RELNOTES-3.4.1</A>
-<LI><A HREF="RELNOTES-3.4">RELNOTES-3.4</A>
-<LI><A HREF="RELNOTES-3.3">RELNOTES-3.3</A>
-<LI><A HREF="RELNOTES-3.2.1">RELNOTES-3.2.1</A>
-<LI><A HREF="RELNOTES-3.2">RELNOTES-3.2</A>
-<LI><A HREF="RELNOTES-3.1">RELNOTES-3.1</A>
-</UL>
-
-
-</BODY>
-</HTML>
+<HTML>
+
+<TITLE>Mesa Release Notes</TITLE>
+
+<link rel="stylesheet" type="text/css" href="mesa.css"></head>
+
+<BODY>
+
+<H1>Release Notes</H1>
+
+<p>
+The release notes summarize what's new or changed in each Mesa release.
+</p>
+
+<UL>
+<LI><A HREF="relnotes-7.11.html">7.11 release notes</A>
+<LI><A HREF="relnotes-7.10.2.html">7.10.2 release notes</A>
+<LI><A HREF="relnotes-7.10.1.html">7.10.1 release notes</A>
+<LI><A HREF="relnotes-7.10.html">7.10 release notes</A>
+<LI><A HREF="relnotes-7.9.2.html">7.9.2 release notes</A>
+<LI><A HREF="relnotes-7.9.1.html">7.9.1 release notes</A>
+<LI><A HREF="relnotes-7.9.html">7.9 release notes</A>
+<LI><A HREF="relnotes-7.8.3.html">7.8.3 release notes</A>
+<LI><A HREF="relnotes-7.8.2.html">7.8.2 release notes</A>
+<LI><A HREF="relnotes-7.8.1.html">7.8.1 release notes</A>
+<LI><A HREF="relnotes-7.8.html">7.8 release notes</A>
+<LI><A HREF="relnotes-7.7.1.html">7.7.1 release notes</A>
+<LI><A HREF="relnotes-7.7.html">7.7 release notes</A>
+<LI><A HREF="relnotes-7.6.1.html">7.6.1 release notes</A>
+<LI><A HREF="relnotes-7.6.html">7.6 release notes</A>
+<LI><A HREF="relnotes-7.5.2.html">7.5.2 release notes</A>
+<LI><A HREF="relnotes-7.5.1.html">7.5.1 release notes</A>
+<LI><A HREF="relnotes-7.5.html">7.5 release notes</A>
+<LI><A HREF="relnotes-7.4.4.html">7.4.4 release notes</A>
+<LI><A HREF="relnotes-7.4.3.html">7.4.3 release notes</A>
+<LI><A HREF="relnotes-7.4.2.html">7.4.2 release notes</A>
+<LI><A HREF="relnotes-7.4.1.html">7.4.1 release notes</A>
+<LI><A HREF="relnotes-7.4.html">7.4 release notes</A>
+<LI><A HREF="relnotes-7.3.html">7.3 release notes</A>
+<LI><A HREF="relnotes-7.2.html">7.2 release notes</A>
+<LI><A HREF="relnotes-7.1.html">7.1 release notes</A>
+<LI><A HREF="relnotes-7.0.4.html">7.0.4 release notes</A>
+<LI><A HREF="relnotes-7.0.3.html">7.0.3 release notes</A>
+<LI><A HREF="relnotes-7.0.2.html">7.0.2 release notes</A>
+<LI><A HREF="relnotes-7.0.1.html">7.0.1 release notes</A>
+<LI><A HREF="relnotes-7.0.html">7.0 release notes</A>
+<LI><A HREF="relnotes-6.5.3.html">6.5.3 release notes</A>
+<LI><A HREF="relnotes-6.5.2.html">6.5.2 release notes</A>
+<LI><A HREF="relnotes-6.5.1.html">6.5.1 release notes</A>
+<LI><A HREF="relnotes-6.5.html">6.5 release notes</A>
+<LI><A HREF="relnotes-6.4.2.html">6.4.2 release notes</A>
+<LI><A HREF="relnotes-6.4.1.html">6.4.1 release notes</A>
+<LI><A HREF="relnotes-6.4.html">6.4 release notes</A>
+</UL
+
+<p>
+Versions of Mesa prior to 6.4 are summarized in the
+<a href="versions.html">versions file</a> and the following release notes.
+</p>
+
+<UL>
+<LI><A HREF="RELNOTES-6.3.2">RELNOTES-6.3.2</A>
+<LI><A HREF="RELNOTES-6.3">RELNOTES-6.3</A>
+<LI><A HREF="RELNOTES-6.2.1">RELNOTES-6.2.1</A>
+<LI><A HREF="RELNOTES-6.2">RELNOTES-6.2</A>
+<LI><A HREF="RELNOTES-6.1">RELNOTES-6.1</A>
+<LI><A HREF="RELNOTES-6.0">RELNOTES-6.0</A>
+<LI><A HREF="RELNOTES-5.1">RELNOTES-5.1</A>
+<LI><A HREF="RELNOTES-5.0.2">RELNOTES-5.0.2</A>
+<LI><A HREF="RELNOTES-5.0.1">RELNOTES-5.0.1</A>
+<LI><A HREF="RELNOTES-5.0">RELNOTES-5.0</A>
+<LI><A HREF="RELNOTES-4.1">RELNOTES-4.1</A>
+<LI><A HREF="RELNOTES-4.0.3">RELNOTES-4.0.3</A>
+<LI><A HREF="RELNOTES-4.0.2">RELNOTES-4.0.2</A>
+<LI><A HREF="RELNOTES-4.0.1">RELNOTES-4.0.1</A>
+<LI><A HREF="RELNOTES-4.0">RELNOTES-4.0</A>
+<LI><A HREF="RELNOTES-3.5">RELNOTES-3.5</A>
+<LI><A HREF="RELNOTES-3.4.2">RELNOTES-3.4.2</A>
+<LI><A HREF="RELNOTES-3.4.1">RELNOTES-3.4.1</A>
+<LI><A HREF="RELNOTES-3.4">RELNOTES-3.4</A>
+<LI><A HREF="RELNOTES-3.3">RELNOTES-3.3</A>
+<LI><A HREF="RELNOTES-3.2.1">RELNOTES-3.2.1</A>
+<LI><A HREF="RELNOTES-3.2">RELNOTES-3.2</A>
+<LI><A HREF="RELNOTES-3.1">RELNOTES-3.1</A>
+</UL>
+
+
+</BODY>
+</HTML>
diff --git a/mesalib/include/GL/glu.h b/mesalib/include/GL/glu.h
index ba2228d8d..fe7b03100 100644
--- a/mesalib/include/GL/glu.h
+++ b/mesalib/include/GL/glu.h
@@ -1,353 +1,353 @@
-/*
- * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008)
- * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice including the dates of first publication and
- * either this permission notice or a reference to
- * http://oss.sgi.com/projects/FreeB/
- * shall be included in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
- * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- *
- * Except as contained in this notice, the name of Silicon Graphics, Inc.
- * shall not be used in advertising or otherwise to promote the sale, use or
- * other dealings in this Software without prior written authorization from
- * Silicon Graphics, Inc.
- */
-
-#ifndef __glu_h__
-#define __glu_h__
-
-#if defined(USE_MGL_NAMESPACE)
-#include "glu_mangle.h"
-#endif
-
-#include <GL/gl.h>
-
-#ifndef GLAPIENTRY
-#if defined(_MSC_VER) || defined(__MINGW32__)
-#define GLAPIENTRY __stdcall
-#else
-#define GLAPIENTRY
-#endif
-#endif
-
-#ifndef GLAPIENTRYP
-#define GLAPIENTRYP GLAPIENTRY *
-#endif
-
-#if (defined(_MSC_VER) || defined(__MINGW32__)) && defined(BUILD_GLU32)
-# undef GLAPI
-# define GLAPI __declspec(dllexport)
-#elif (defined(_MSC_VER) || defined(__MINGW32__)) && defined(_DLL)
-/* tag specifying we're building for DLL runtime support */
-# undef GLAPI
-# define GLAPI __declspec(dllimport)
-#elif !defined(GLAPI)
-/* for use with static link lib build of Win32 edition only */
-# define GLAPI extern
-#endif /* _STATIC_MESA support */
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*************************************************************/
-
-/* Extensions */
-#define GLU_EXT_object_space_tess 1
-#define GLU_EXT_nurbs_tessellator 1
-
-/* Boolean */
-#define GLU_FALSE 0
-#define GLU_TRUE 1
-
-/* Version */
-#define GLU_VERSION_1_1 1
-#define GLU_VERSION_1_2 1
-#define GLU_VERSION_1_3 1
-
-/* StringName */
-#define GLU_VERSION 100800
-#define GLU_EXTENSIONS 100801
-
-/* ErrorCode */
-#define GLU_INVALID_ENUM 100900
-#define GLU_INVALID_VALUE 100901
-#define GLU_OUT_OF_MEMORY 100902
-#define GLU_INCOMPATIBLE_GL_VERSION 100903
-#define GLU_INVALID_OPERATION 100904
-
-/* NurbsDisplay */
-/* GLU_FILL */
-#define GLU_OUTLINE_POLYGON 100240
-#define GLU_OUTLINE_PATCH 100241
-
-/* NurbsCallback */
-#define GLU_NURBS_ERROR 100103
-#define GLU_ERROR 100103
-#define GLU_NURBS_BEGIN 100164
-#define GLU_NURBS_BEGIN_EXT 100164
-#define GLU_NURBS_VERTEX 100165
-#define GLU_NURBS_VERTEX_EXT 100165
-#define GLU_NURBS_NORMAL 100166
-#define GLU_NURBS_NORMAL_EXT 100166
-#define GLU_NURBS_COLOR 100167
-#define GLU_NURBS_COLOR_EXT 100167
-#define GLU_NURBS_TEXTURE_COORD 100168
-#define GLU_NURBS_TEX_COORD_EXT 100168
-#define GLU_NURBS_END 100169
-#define GLU_NURBS_END_EXT 100169
-#define GLU_NURBS_BEGIN_DATA 100170
-#define GLU_NURBS_BEGIN_DATA_EXT 100170
-#define GLU_NURBS_VERTEX_DATA 100171
-#define GLU_NURBS_VERTEX_DATA_EXT 100171
-#define GLU_NURBS_NORMAL_DATA 100172
-#define GLU_NURBS_NORMAL_DATA_EXT 100172
-#define GLU_NURBS_COLOR_DATA 100173
-#define GLU_NURBS_COLOR_DATA_EXT 100173
-#define GLU_NURBS_TEXTURE_COORD_DATA 100174
-#define GLU_NURBS_TEX_COORD_DATA_EXT 100174
-#define GLU_NURBS_END_DATA 100175
-#define GLU_NURBS_END_DATA_EXT 100175
-
-/* NurbsError */
-#define GLU_NURBS_ERROR1 100251
-#define GLU_NURBS_ERROR2 100252
-#define GLU_NURBS_ERROR3 100253
-#define GLU_NURBS_ERROR4 100254
-#define GLU_NURBS_ERROR5 100255
-#define GLU_NURBS_ERROR6 100256
-#define GLU_NURBS_ERROR7 100257
-#define GLU_NURBS_ERROR8 100258
-#define GLU_NURBS_ERROR9 100259
-#define GLU_NURBS_ERROR10 100260
-#define GLU_NURBS_ERROR11 100261
-#define GLU_NURBS_ERROR12 100262
-#define GLU_NURBS_ERROR13 100263
-#define GLU_NURBS_ERROR14 100264
-#define GLU_NURBS_ERROR15 100265
-#define GLU_NURBS_ERROR16 100266
-#define GLU_NURBS_ERROR17 100267
-#define GLU_NURBS_ERROR18 100268
-#define GLU_NURBS_ERROR19 100269
-#define GLU_NURBS_ERROR20 100270
-#define GLU_NURBS_ERROR21 100271
-#define GLU_NURBS_ERROR22 100272
-#define GLU_NURBS_ERROR23 100273
-#define GLU_NURBS_ERROR24 100274
-#define GLU_NURBS_ERROR25 100275
-#define GLU_NURBS_ERROR26 100276
-#define GLU_NURBS_ERROR27 100277
-#define GLU_NURBS_ERROR28 100278
-#define GLU_NURBS_ERROR29 100279
-#define GLU_NURBS_ERROR30 100280
-#define GLU_NURBS_ERROR31 100281
-#define GLU_NURBS_ERROR32 100282
-#define GLU_NURBS_ERROR33 100283
-#define GLU_NURBS_ERROR34 100284
-#define GLU_NURBS_ERROR35 100285
-#define GLU_NURBS_ERROR36 100286
-#define GLU_NURBS_ERROR37 100287
-
-/* NurbsProperty */
-#define GLU_AUTO_LOAD_MATRIX 100200
-#define GLU_CULLING 100201
-#define GLU_SAMPLING_TOLERANCE 100203
-#define GLU_DISPLAY_MODE 100204
-#define GLU_PARAMETRIC_TOLERANCE 100202
-#define GLU_SAMPLING_METHOD 100205
-#define GLU_U_STEP 100206
-#define GLU_V_STEP 100207
-#define GLU_NURBS_MODE 100160
-#define GLU_NURBS_MODE_EXT 100160
-#define GLU_NURBS_TESSELLATOR 100161
-#define GLU_NURBS_TESSELLATOR_EXT 100161
-#define GLU_NURBS_RENDERER 100162
-#define GLU_NURBS_RENDERER_EXT 100162
-
-/* NurbsSampling */
-#define GLU_OBJECT_PARAMETRIC_ERROR 100208
-#define GLU_OBJECT_PARAMETRIC_ERROR_EXT 100208
-#define GLU_OBJECT_PATH_LENGTH 100209
-#define GLU_OBJECT_PATH_LENGTH_EXT 100209
-#define GLU_PATH_LENGTH 100215
-#define GLU_PARAMETRIC_ERROR 100216
-#define GLU_DOMAIN_DISTANCE 100217
-
-/* NurbsTrim */
-#define GLU_MAP1_TRIM_2 100210
-#define GLU_MAP1_TRIM_3 100211
-
-/* QuadricDrawStyle */
-#define GLU_POINT 100010
-#define GLU_LINE 100011
-#define GLU_FILL 100012
-#define GLU_SILHOUETTE 100013
-
-/* QuadricCallback */
-/* GLU_ERROR */
-
-/* QuadricNormal */
-#define GLU_SMOOTH 100000
-#define GLU_FLAT 100001
-#define GLU_NONE 100002
-
-/* QuadricOrientation */
-#define GLU_OUTSIDE 100020
-#define GLU_INSIDE 100021
-
-/* TessCallback */
-#define GLU_TESS_BEGIN 100100
-#define GLU_BEGIN 100100
-#define GLU_TESS_VERTEX 100101
-#define GLU_VERTEX 100101
-#define GLU_TESS_END 100102
-#define GLU_END 100102
-#define GLU_TESS_ERROR 100103
-#define GLU_TESS_EDGE_FLAG 100104
-#define GLU_EDGE_FLAG 100104
-#define GLU_TESS_COMBINE 100105
-#define GLU_TESS_BEGIN_DATA 100106
-#define GLU_TESS_VERTEX_DATA 100107
-#define GLU_TESS_END_DATA 100108
-#define GLU_TESS_ERROR_DATA 100109
-#define GLU_TESS_EDGE_FLAG_DATA 100110
-#define GLU_TESS_COMBINE_DATA 100111
-
-/* TessContour */
-#define GLU_CW 100120
-#define GLU_CCW 100121
-#define GLU_INTERIOR 100122
-#define GLU_EXTERIOR 100123
-#define GLU_UNKNOWN 100124
-
-/* TessProperty */
-#define GLU_TESS_WINDING_RULE 100140
-#define GLU_TESS_BOUNDARY_ONLY 100141
-#define GLU_TESS_TOLERANCE 100142
-
-/* TessError */
-#define GLU_TESS_ERROR1 100151
-#define GLU_TESS_ERROR2 100152
-#define GLU_TESS_ERROR3 100153
-#define GLU_TESS_ERROR4 100154
-#define GLU_TESS_ERROR5 100155
-#define GLU_TESS_ERROR6 100156
-#define GLU_TESS_ERROR7 100157
-#define GLU_TESS_ERROR8 100158
-#define GLU_TESS_MISSING_BEGIN_POLYGON 100151
-#define GLU_TESS_MISSING_BEGIN_CONTOUR 100152
-#define GLU_TESS_MISSING_END_POLYGON 100153
-#define GLU_TESS_MISSING_END_CONTOUR 100154
-#define GLU_TESS_COORD_TOO_LARGE 100155
-#define GLU_TESS_NEED_COMBINE_CALLBACK 100156
-
-/* TessWinding */
-#define GLU_TESS_WINDING_ODD 100130
-#define GLU_TESS_WINDING_NONZERO 100131
-#define GLU_TESS_WINDING_POSITIVE 100132
-#define GLU_TESS_WINDING_NEGATIVE 100133
-#define GLU_TESS_WINDING_ABS_GEQ_TWO 100134
-
-/*************************************************************/
-
-
-#ifdef __cplusplus
-class GLUnurbs;
-class GLUquadric;
-class GLUtesselator;
-#else
-typedef struct GLUnurbs GLUnurbs;
-typedef struct GLUquadric GLUquadric;
-typedef struct GLUtesselator GLUtesselator;
-#endif
-
-typedef GLUnurbs GLUnurbsObj;
-typedef GLUquadric GLUquadricObj;
-typedef GLUtesselator GLUtesselatorObj;
-typedef GLUtesselator GLUtriangulatorObj;
-
-#define GLU_TESS_MAX_COORD 1.0e150
-
-/* Internal convenience typedefs */
-typedef void (GLAPIENTRYP _GLUfuncptr)(void);
-
-GLAPI void GLAPIENTRY gluBeginCurve (GLUnurbs* nurb);
-GLAPI void GLAPIENTRY gluBeginPolygon (GLUtesselator* tess);
-GLAPI void GLAPIENTRY gluBeginSurface (GLUnurbs* nurb);
-GLAPI void GLAPIENTRY gluBeginTrim (GLUnurbs* nurb);
-GLAPI GLint GLAPIENTRY gluBuild1DMipmapLevels (GLenum target, GLint internalFormat, GLsizei width, GLenum format, GLenum type, GLint level, GLint base, GLint max, const void *data);
-GLAPI GLint GLAPIENTRY gluBuild1DMipmaps (GLenum target, GLint internalFormat, GLsizei width, GLenum format, GLenum type, const void *data);
-GLAPI GLint GLAPIENTRY gluBuild2DMipmapLevels (GLenum target, GLint internalFormat, GLsizei width, GLsizei height, GLenum format, GLenum type, GLint level, GLint base, GLint max, const void *data);
-GLAPI GLint GLAPIENTRY gluBuild2DMipmaps (GLenum target, GLint internalFormat, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *data);
-GLAPI GLint GLAPIENTRY gluBuild3DMipmapLevels (GLenum target, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, GLint level, GLint base, GLint max, const void *data);
-GLAPI GLint GLAPIENTRY gluBuild3DMipmaps (GLenum target, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *data);
-GLAPI GLboolean GLAPIENTRY gluCheckExtension (const GLubyte *extName, const GLubyte *extString);
-GLAPI void GLAPIENTRY gluCylinder (GLUquadric* quad, GLdouble base, GLdouble top, GLdouble height, GLint slices, GLint stacks);
-GLAPI void GLAPIENTRY gluDeleteNurbsRenderer (GLUnurbs* nurb);
-GLAPI void GLAPIENTRY gluDeleteQuadric (GLUquadric* quad);
-GLAPI void GLAPIENTRY gluDeleteTess (GLUtesselator* tess);
-GLAPI void GLAPIENTRY gluDisk (GLUquadric* quad, GLdouble inner, GLdouble outer, GLint slices, GLint loops);
-GLAPI void GLAPIENTRY gluEndCurve (GLUnurbs* nurb);
-GLAPI void GLAPIENTRY gluEndPolygon (GLUtesselator* tess);
-GLAPI void GLAPIENTRY gluEndSurface (GLUnurbs* nurb);
-GLAPI void GLAPIENTRY gluEndTrim (GLUnurbs* nurb);
-GLAPI const GLubyte * GLAPIENTRY gluErrorString (GLenum error);
-GLAPI void GLAPIENTRY gluGetNurbsProperty (GLUnurbs* nurb, GLenum property, GLfloat* data);
-GLAPI const GLubyte * GLAPIENTRY gluGetString (GLenum name);
-GLAPI void GLAPIENTRY gluGetTessProperty (GLUtesselator* tess, GLenum which, GLdouble* data);
-GLAPI void GLAPIENTRY gluLoadSamplingMatrices (GLUnurbs* nurb, const GLfloat *model, const GLfloat *perspective, const GLint *view);
-GLAPI void GLAPIENTRY gluLookAt (GLdouble eyeX, GLdouble eyeY, GLdouble eyeZ, GLdouble centerX, GLdouble centerY, GLdouble centerZ, GLdouble upX, GLdouble upY, GLdouble upZ);
-GLAPI GLUnurbs* GLAPIENTRY gluNewNurbsRenderer (void);
-GLAPI GLUquadric* GLAPIENTRY gluNewQuadric (void);
-GLAPI GLUtesselator* GLAPIENTRY gluNewTess (void);
-GLAPI void GLAPIENTRY gluNextContour (GLUtesselator* tess, GLenum type);
-GLAPI void GLAPIENTRY gluNurbsCallback (GLUnurbs* nurb, GLenum which, _GLUfuncptr CallBackFunc);
-GLAPI void GLAPIENTRY gluNurbsCallbackData (GLUnurbs* nurb, GLvoid* userData);
-GLAPI void GLAPIENTRY gluNurbsCallbackDataEXT (GLUnurbs* nurb, GLvoid* userData);
-GLAPI void GLAPIENTRY gluNurbsCurve (GLUnurbs* nurb, GLint knotCount, GLfloat *knots, GLint stride, GLfloat *control, GLint order, GLenum type);
-GLAPI void GLAPIENTRY gluNurbsProperty (GLUnurbs* nurb, GLenum property, GLfloat value);
-GLAPI void GLAPIENTRY gluNurbsSurface (GLUnurbs* nurb, GLint sKnotCount, GLfloat* sKnots, GLint tKnotCount, GLfloat* tKnots, GLint sStride, GLint tStride, GLfloat* control, GLint sOrder, GLint tOrder, GLenum type);
-GLAPI void GLAPIENTRY gluOrtho2D (GLdouble left, GLdouble right, GLdouble bottom, GLdouble top);
-GLAPI void GLAPIENTRY gluPartialDisk (GLUquadric* quad, GLdouble inner, GLdouble outer, GLint slices, GLint loops, GLdouble start, GLdouble sweep);
-GLAPI void GLAPIENTRY gluPerspective (GLdouble fovy, GLdouble aspect, GLdouble zNear, GLdouble zFar);
-GLAPI void GLAPIENTRY gluPickMatrix (GLdouble x, GLdouble y, GLdouble delX, GLdouble delY, GLint *viewport);
-GLAPI GLint GLAPIENTRY gluProject (GLdouble objX, GLdouble objY, GLdouble objZ, const GLdouble *model, const GLdouble *proj, const GLint *view, GLdouble* winX, GLdouble* winY, GLdouble* winZ);
-GLAPI void GLAPIENTRY gluPwlCurve (GLUnurbs* nurb, GLint count, GLfloat* data, GLint stride, GLenum type);
-GLAPI void GLAPIENTRY gluQuadricCallback (GLUquadric* quad, GLenum which, _GLUfuncptr CallBackFunc);
-GLAPI void GLAPIENTRY gluQuadricDrawStyle (GLUquadric* quad, GLenum draw);
-GLAPI void GLAPIENTRY gluQuadricNormals (GLUquadric* quad, GLenum normal);
-GLAPI void GLAPIENTRY gluQuadricOrientation (GLUquadric* quad, GLenum orientation);
-GLAPI void GLAPIENTRY gluQuadricTexture (GLUquadric* quad, GLboolean texture);
-GLAPI GLint GLAPIENTRY gluScaleImage (GLenum format, GLsizei wIn, GLsizei hIn, GLenum typeIn, const void *dataIn, GLsizei wOut, GLsizei hOut, GLenum typeOut, GLvoid* dataOut);
-GLAPI void GLAPIENTRY gluSphere (GLUquadric* quad, GLdouble radius, GLint slices, GLint stacks);
-GLAPI void GLAPIENTRY gluTessBeginContour (GLUtesselator* tess);
-GLAPI void GLAPIENTRY gluTessBeginPolygon (GLUtesselator* tess, GLvoid* data);
-GLAPI void GLAPIENTRY gluTessCallback (GLUtesselator* tess, GLenum which, _GLUfuncptr CallBackFunc);
-GLAPI void GLAPIENTRY gluTessEndContour (GLUtesselator* tess);
-GLAPI void GLAPIENTRY gluTessEndPolygon (GLUtesselator* tess);
-GLAPI void GLAPIENTRY gluTessNormal (GLUtesselator* tess, GLdouble valueX, GLdouble valueY, GLdouble valueZ);
-GLAPI void GLAPIENTRY gluTessProperty (GLUtesselator* tess, GLenum which, GLdouble data);
-GLAPI void GLAPIENTRY gluTessVertex (GLUtesselator* tess, GLdouble *location, GLvoid* data);
-GLAPI GLint GLAPIENTRY gluUnProject (GLdouble winX, GLdouble winY, GLdouble winZ, const GLdouble *model, const GLdouble *proj, const GLint *view, GLdouble* objX, GLdouble* objY, GLdouble* objZ);
-GLAPI GLint GLAPIENTRY gluUnProject4 (GLdouble winX, GLdouble winY, GLdouble winZ, GLdouble clipW, const GLdouble *model, const GLdouble *proj, const GLint *view, GLdouble nearVal, GLdouble farVal, GLdouble* objX, GLdouble* objY, GLdouble* objZ, GLdouble* objW);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* __glu_h__ */
+/*
+ * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008)
+ * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice including the dates of first publication and
+ * either this permission notice or a reference to
+ * http://oss.sgi.com/projects/FreeB/
+ * shall be included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
+ * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ *
+ * Except as contained in this notice, the name of Silicon Graphics, Inc.
+ * shall not be used in advertising or otherwise to promote the sale, use or
+ * other dealings in this Software without prior written authorization from
+ * Silicon Graphics, Inc.
+ */
+
+#ifndef __glu_h__
+#define __glu_h__
+
+#if defined(USE_MGL_NAMESPACE)
+#include "glu_mangle.h"
+#endif
+
+#include <GL/gl.h>
+
+#ifndef GLAPIENTRY
+#if defined(_MSC_VER) || defined(__MINGW32__)
+#define GLAPIENTRY __stdcall
+#else
+#define GLAPIENTRY
+#endif
+#endif
+
+#ifndef GLAPIENTRYP
+#define GLAPIENTRYP GLAPIENTRY *
+#endif
+
+#if (defined(_MSC_VER) || defined(__MINGW32__)) && defined(BUILD_GLU32)
+# undef GLAPI
+# define GLAPI __declspec(dllexport)
+#elif (defined(_MSC_VER) || defined(__MINGW32__)) && defined(_DLL)
+/* tag specifying we're building for DLL runtime support */
+# undef GLAPI
+# define GLAPI __declspec(dllimport)
+#elif !defined(GLAPI)
+/* for use with static link lib build of Win32 edition only */
+# define GLAPI extern
+#endif /* _STATIC_MESA support */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*************************************************************/
+
+/* Extensions */
+#define GLU_EXT_object_space_tess 1
+#define GLU_EXT_nurbs_tessellator 1
+
+/* Boolean */
+#define GLU_FALSE 0
+#define GLU_TRUE 1
+
+/* Version */
+#define GLU_VERSION_1_1 1
+#define GLU_VERSION_1_2 1
+#define GLU_VERSION_1_3 1
+
+/* StringName */
+#define GLU_VERSION 100800
+#define GLU_EXTENSIONS 100801
+
+/* ErrorCode */
+#define GLU_INVALID_ENUM 100900
+#define GLU_INVALID_VALUE 100901
+#define GLU_OUT_OF_MEMORY 100902
+#define GLU_INCOMPATIBLE_GL_VERSION 100903
+#define GLU_INVALID_OPERATION 100904
+
+/* NurbsDisplay */
+/* GLU_FILL */
+#define GLU_OUTLINE_POLYGON 100240
+#define GLU_OUTLINE_PATCH 100241
+
+/* NurbsCallback */
+#define GLU_NURBS_ERROR 100103
+#define GLU_ERROR 100103
+#define GLU_NURBS_BEGIN 100164
+#define GLU_NURBS_BEGIN_EXT 100164
+#define GLU_NURBS_VERTEX 100165
+#define GLU_NURBS_VERTEX_EXT 100165
+#define GLU_NURBS_NORMAL 100166
+#define GLU_NURBS_NORMAL_EXT 100166
+#define GLU_NURBS_COLOR 100167
+#define GLU_NURBS_COLOR_EXT 100167
+#define GLU_NURBS_TEXTURE_COORD 100168
+#define GLU_NURBS_TEX_COORD_EXT 100168
+#define GLU_NURBS_END 100169
+#define GLU_NURBS_END_EXT 100169
+#define GLU_NURBS_BEGIN_DATA 100170
+#define GLU_NURBS_BEGIN_DATA_EXT 100170
+#define GLU_NURBS_VERTEX_DATA 100171
+#define GLU_NURBS_VERTEX_DATA_EXT 100171
+#define GLU_NURBS_NORMAL_DATA 100172
+#define GLU_NURBS_NORMAL_DATA_EXT 100172
+#define GLU_NURBS_COLOR_DATA 100173
+#define GLU_NURBS_COLOR_DATA_EXT 100173
+#define GLU_NURBS_TEXTURE_COORD_DATA 100174
+#define GLU_NURBS_TEX_COORD_DATA_EXT 100174
+#define GLU_NURBS_END_DATA 100175
+#define GLU_NURBS_END_DATA_EXT 100175
+
+/* NurbsError */
+#define GLU_NURBS_ERROR1 100251
+#define GLU_NURBS_ERROR2 100252
+#define GLU_NURBS_ERROR3 100253
+#define GLU_NURBS_ERROR4 100254
+#define GLU_NURBS_ERROR5 100255
+#define GLU_NURBS_ERROR6 100256
+#define GLU_NURBS_ERROR7 100257
+#define GLU_NURBS_ERROR8 100258
+#define GLU_NURBS_ERROR9 100259
+#define GLU_NURBS_ERROR10 100260
+#define GLU_NURBS_ERROR11 100261
+#define GLU_NURBS_ERROR12 100262
+#define GLU_NURBS_ERROR13 100263
+#define GLU_NURBS_ERROR14 100264
+#define GLU_NURBS_ERROR15 100265
+#define GLU_NURBS_ERROR16 100266
+#define GLU_NURBS_ERROR17 100267
+#define GLU_NURBS_ERROR18 100268
+#define GLU_NURBS_ERROR19 100269
+#define GLU_NURBS_ERROR20 100270
+#define GLU_NURBS_ERROR21 100271
+#define GLU_NURBS_ERROR22 100272
+#define GLU_NURBS_ERROR23 100273
+#define GLU_NURBS_ERROR24 100274
+#define GLU_NURBS_ERROR25 100275
+#define GLU_NURBS_ERROR26 100276
+#define GLU_NURBS_ERROR27 100277
+#define GLU_NURBS_ERROR28 100278
+#define GLU_NURBS_ERROR29 100279
+#define GLU_NURBS_ERROR30 100280
+#define GLU_NURBS_ERROR31 100281
+#define GLU_NURBS_ERROR32 100282
+#define GLU_NURBS_ERROR33 100283
+#define GLU_NURBS_ERROR34 100284
+#define GLU_NURBS_ERROR35 100285
+#define GLU_NURBS_ERROR36 100286
+#define GLU_NURBS_ERROR37 100287
+
+/* NurbsProperty */
+#define GLU_AUTO_LOAD_MATRIX 100200
+#define GLU_CULLING 100201
+#define GLU_SAMPLING_TOLERANCE 100203
+#define GLU_DISPLAY_MODE 100204
+#define GLU_PARAMETRIC_TOLERANCE 100202
+#define GLU_SAMPLING_METHOD 100205
+#define GLU_U_STEP 100206
+#define GLU_V_STEP 100207
+#define GLU_NURBS_MODE 100160
+#define GLU_NURBS_MODE_EXT 100160
+#define GLU_NURBS_TESSELLATOR 100161
+#define GLU_NURBS_TESSELLATOR_EXT 100161
+#define GLU_NURBS_RENDERER 100162
+#define GLU_NURBS_RENDERER_EXT 100162
+
+/* NurbsSampling */
+#define GLU_OBJECT_PARAMETRIC_ERROR 100208
+#define GLU_OBJECT_PARAMETRIC_ERROR_EXT 100208
+#define GLU_OBJECT_PATH_LENGTH 100209
+#define GLU_OBJECT_PATH_LENGTH_EXT 100209
+#define GLU_PATH_LENGTH 100215
+#define GLU_PARAMETRIC_ERROR 100216
+#define GLU_DOMAIN_DISTANCE 100217
+
+/* NurbsTrim */
+#define GLU_MAP1_TRIM_2 100210
+#define GLU_MAP1_TRIM_3 100211
+
+/* QuadricDrawStyle */
+#define GLU_POINT 100010
+#define GLU_LINE 100011
+#define GLU_FILL 100012
+#define GLU_SILHOUETTE 100013
+
+/* QuadricCallback */
+/* GLU_ERROR */
+
+/* QuadricNormal */
+#define GLU_SMOOTH 100000
+#define GLU_FLAT 100001
+#define GLU_NONE 100002
+
+/* QuadricOrientation */
+#define GLU_OUTSIDE 100020
+#define GLU_INSIDE 100021
+
+/* TessCallback */
+#define GLU_TESS_BEGIN 100100
+#define GLU_BEGIN 100100
+#define GLU_TESS_VERTEX 100101
+#define GLU_VERTEX 100101
+#define GLU_TESS_END 100102
+#define GLU_END 100102
+#define GLU_TESS_ERROR 100103
+#define GLU_TESS_EDGE_FLAG 100104
+#define GLU_EDGE_FLAG 100104
+#define GLU_TESS_COMBINE 100105
+#define GLU_TESS_BEGIN_DATA 100106
+#define GLU_TESS_VERTEX_DATA 100107
+#define GLU_TESS_END_DATA 100108
+#define GLU_TESS_ERROR_DATA 100109
+#define GLU_TESS_EDGE_FLAG_DATA 100110
+#define GLU_TESS_COMBINE_DATA 100111
+
+/* TessContour */
+#define GLU_CW 100120
+#define GLU_CCW 100121
+#define GLU_INTERIOR 100122
+#define GLU_EXTERIOR 100123
+#define GLU_UNKNOWN 100124
+
+/* TessProperty */
+#define GLU_TESS_WINDING_RULE 100140
+#define GLU_TESS_BOUNDARY_ONLY 100141
+#define GLU_TESS_TOLERANCE 100142
+
+/* TessError */
+#define GLU_TESS_ERROR1 100151
+#define GLU_TESS_ERROR2 100152
+#define GLU_TESS_ERROR3 100153
+#define GLU_TESS_ERROR4 100154
+#define GLU_TESS_ERROR5 100155
+#define GLU_TESS_ERROR6 100156
+#define GLU_TESS_ERROR7 100157
+#define GLU_TESS_ERROR8 100158
+#define GLU_TESS_MISSING_BEGIN_POLYGON 100151
+#define GLU_TESS_MISSING_BEGIN_CONTOUR 100152
+#define GLU_TESS_MISSING_END_POLYGON 100153
+#define GLU_TESS_MISSING_END_CONTOUR 100154
+#define GLU_TESS_COORD_TOO_LARGE 100155
+#define GLU_TESS_NEED_COMBINE_CALLBACK 100156
+
+/* TessWinding */
+#define GLU_TESS_WINDING_ODD 100130
+#define GLU_TESS_WINDING_NONZERO 100131
+#define GLU_TESS_WINDING_POSITIVE 100132
+#define GLU_TESS_WINDING_NEGATIVE 100133
+#define GLU_TESS_WINDING_ABS_GEQ_TWO 100134
+
+/*************************************************************/
+
+
+#ifdef __cplusplus
+class GLUnurbs;
+class GLUquadric;
+class GLUtesselator;
+#else
+typedef struct GLUnurbs GLUnurbs;
+typedef struct GLUquadric GLUquadric;
+typedef struct GLUtesselator GLUtesselator;
+#endif
+
+typedef GLUnurbs GLUnurbsObj;
+typedef GLUquadric GLUquadricObj;
+typedef GLUtesselator GLUtesselatorObj;
+typedef GLUtesselator GLUtriangulatorObj;
+
+#define GLU_TESS_MAX_COORD 1.0e150
+
+/* Internal convenience typedefs */
+typedef void (GLAPIENTRYP _GLUfuncptr)(void);
+
+GLAPI void GLAPIENTRY gluBeginCurve (GLUnurbs* nurb);
+GLAPI void GLAPIENTRY gluBeginPolygon (GLUtesselator* tess);
+GLAPI void GLAPIENTRY gluBeginSurface (GLUnurbs* nurb);
+GLAPI void GLAPIENTRY gluBeginTrim (GLUnurbs* nurb);
+GLAPI GLint GLAPIENTRY gluBuild1DMipmapLevels (GLenum target, GLint internalFormat, GLsizei width, GLenum format, GLenum type, GLint level, GLint base, GLint max, const void *data);
+GLAPI GLint GLAPIENTRY gluBuild1DMipmaps (GLenum target, GLint internalFormat, GLsizei width, GLenum format, GLenum type, const void *data);
+GLAPI GLint GLAPIENTRY gluBuild2DMipmapLevels (GLenum target, GLint internalFormat, GLsizei width, GLsizei height, GLenum format, GLenum type, GLint level, GLint base, GLint max, const void *data);
+GLAPI GLint GLAPIENTRY gluBuild2DMipmaps (GLenum target, GLint internalFormat, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *data);
+GLAPI GLint GLAPIENTRY gluBuild3DMipmapLevels (GLenum target, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, GLint level, GLint base, GLint max, const void *data);
+GLAPI GLint GLAPIENTRY gluBuild3DMipmaps (GLenum target, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *data);
+GLAPI GLboolean GLAPIENTRY gluCheckExtension (const GLubyte *extName, const GLubyte *extString);
+GLAPI void GLAPIENTRY gluCylinder (GLUquadric* quad, GLdouble base, GLdouble top, GLdouble height, GLint slices, GLint stacks);
+GLAPI void GLAPIENTRY gluDeleteNurbsRenderer (GLUnurbs* nurb);
+GLAPI void GLAPIENTRY gluDeleteQuadric (GLUquadric* quad);
+GLAPI void GLAPIENTRY gluDeleteTess (GLUtesselator* tess);
+GLAPI void GLAPIENTRY gluDisk (GLUquadric* quad, GLdouble inner, GLdouble outer, GLint slices, GLint loops);
+GLAPI void GLAPIENTRY gluEndCurve (GLUnurbs* nurb);
+GLAPI void GLAPIENTRY gluEndPolygon (GLUtesselator* tess);
+GLAPI void GLAPIENTRY gluEndSurface (GLUnurbs* nurb);
+GLAPI void GLAPIENTRY gluEndTrim (GLUnurbs* nurb);
+GLAPI const GLubyte * GLAPIENTRY gluErrorString (GLenum error);
+GLAPI void GLAPIENTRY gluGetNurbsProperty (GLUnurbs* nurb, GLenum property, GLfloat* data);
+GLAPI const GLubyte * GLAPIENTRY gluGetString (GLenum name);
+GLAPI void GLAPIENTRY gluGetTessProperty (GLUtesselator* tess, GLenum which, GLdouble* data);
+GLAPI void GLAPIENTRY gluLoadSamplingMatrices (GLUnurbs* nurb, const GLfloat *model, const GLfloat *perspective, const GLint *view);
+GLAPI void GLAPIENTRY gluLookAt (GLdouble eyeX, GLdouble eyeY, GLdouble eyeZ, GLdouble centerX, GLdouble centerY, GLdouble centerZ, GLdouble upX, GLdouble upY, GLdouble upZ);
+GLAPI GLUnurbs* GLAPIENTRY gluNewNurbsRenderer (void);
+GLAPI GLUquadric* GLAPIENTRY gluNewQuadric (void);
+GLAPI GLUtesselator* GLAPIENTRY gluNewTess (void);
+GLAPI void GLAPIENTRY gluNextContour (GLUtesselator* tess, GLenum type);
+GLAPI void GLAPIENTRY gluNurbsCallback (GLUnurbs* nurb, GLenum which, _GLUfuncptr CallBackFunc);
+GLAPI void GLAPIENTRY gluNurbsCallbackData (GLUnurbs* nurb, GLvoid* userData);
+GLAPI void GLAPIENTRY gluNurbsCallbackDataEXT (GLUnurbs* nurb, GLvoid* userData);
+GLAPI void GLAPIENTRY gluNurbsCurve (GLUnurbs* nurb, GLint knotCount, GLfloat *knots, GLint stride, GLfloat *control, GLint order, GLenum type);
+GLAPI void GLAPIENTRY gluNurbsProperty (GLUnurbs* nurb, GLenum property, GLfloat value);
+GLAPI void GLAPIENTRY gluNurbsSurface (GLUnurbs* nurb, GLint sKnotCount, GLfloat* sKnots, GLint tKnotCount, GLfloat* tKnots, GLint sStride, GLint tStride, GLfloat* control, GLint sOrder, GLint tOrder, GLenum type);
+GLAPI void GLAPIENTRY gluOrtho2D (GLdouble left, GLdouble right, GLdouble bottom, GLdouble top);
+GLAPI void GLAPIENTRY gluPartialDisk (GLUquadric* quad, GLdouble inner, GLdouble outer, GLint slices, GLint loops, GLdouble start, GLdouble sweep);
+GLAPI void GLAPIENTRY gluPerspective (GLdouble fovy, GLdouble aspect, GLdouble zNear, GLdouble zFar);
+GLAPI void GLAPIENTRY gluPickMatrix (GLdouble x, GLdouble y, GLdouble delX, GLdouble delY, GLint *viewport);
+GLAPI GLint GLAPIENTRY gluProject (GLdouble objX, GLdouble objY, GLdouble objZ, const GLdouble *model, const GLdouble *proj, const GLint *view, GLdouble* winX, GLdouble* winY, GLdouble* winZ);
+GLAPI void GLAPIENTRY gluPwlCurve (GLUnurbs* nurb, GLint count, GLfloat* data, GLint stride, GLenum type);
+GLAPI void GLAPIENTRY gluQuadricCallback (GLUquadric* quad, GLenum which, _GLUfuncptr CallBackFunc);
+GLAPI void GLAPIENTRY gluQuadricDrawStyle (GLUquadric* quad, GLenum draw);
+GLAPI void GLAPIENTRY gluQuadricNormals (GLUquadric* quad, GLenum normal);
+GLAPI void GLAPIENTRY gluQuadricOrientation (GLUquadric* quad, GLenum orientation);
+GLAPI void GLAPIENTRY gluQuadricTexture (GLUquadric* quad, GLboolean texture);
+GLAPI GLint GLAPIENTRY gluScaleImage (GLenum format, GLsizei wIn, GLsizei hIn, GLenum typeIn, const void *dataIn, GLsizei wOut, GLsizei hOut, GLenum typeOut, GLvoid* dataOut);
+GLAPI void GLAPIENTRY gluSphere (GLUquadric* quad, GLdouble radius, GLint slices, GLint stacks);
+GLAPI void GLAPIENTRY gluTessBeginContour (GLUtesselator* tess);
+GLAPI void GLAPIENTRY gluTessBeginPolygon (GLUtesselator* tess, GLvoid* data);
+GLAPI void GLAPIENTRY gluTessCallback (GLUtesselator* tess, GLenum which, _GLUfuncptr CallBackFunc);
+GLAPI void GLAPIENTRY gluTessEndContour (GLUtesselator* tess);
+GLAPI void GLAPIENTRY gluTessEndPolygon (GLUtesselator* tess);
+GLAPI void GLAPIENTRY gluTessNormal (GLUtesselator* tess, GLdouble valueX, GLdouble valueY, GLdouble valueZ);
+GLAPI void GLAPIENTRY gluTessProperty (GLUtesselator* tess, GLenum which, GLdouble data);
+GLAPI void GLAPIENTRY gluTessVertex (GLUtesselator* tess, GLdouble *location, GLvoid* data);
+GLAPI GLint GLAPIENTRY gluUnProject (GLdouble winX, GLdouble winY, GLdouble winZ, const GLdouble *model, const GLdouble *proj, const GLint *view, GLdouble* objX, GLdouble* objY, GLdouble* objZ);
+GLAPI GLint GLAPIENTRY gluUnProject4 (GLdouble winX, GLdouble winY, GLdouble winZ, GLdouble clipW, const GLdouble *model, const GLdouble *proj, const GLint *view, GLdouble nearVal, GLdouble farVal, GLdouble* objX, GLdouble* objY, GLdouble* objZ, GLdouble* objW);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __glu_h__ */
diff --git a/mesalib/include/GL/internal/dri_interface.h b/mesalib/include/GL/internal/dri_interface.h
index d79155798..1564e4cea 100644
--- a/mesalib/include/GL/internal/dri_interface.h
+++ b/mesalib/include/GL/internal/dri_interface.h
@@ -1,888 +1,890 @@
-/*
- * Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
- * Copyright 2007-2008 Red Hat, Inc.
- * (C) Copyright IBM Corporation 2004
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * on the rights to use, copy, modify, merge, publish, distribute, sub
- * license, and/or sell copies of the Software, and to permit persons to whom
- * the Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
- * THE COPYRIGHT HOLDERS AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
- * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
- * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
- * USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-/**
- * \file dri_interface.h
- *
- * This file contains all the types and functions that define the interface
- * between a DRI driver and driver loader. Currently, the most common driver
- * loader is the XFree86 libGL.so. However, other loaders do exist, and in
- * the future the server-side libglx.a will also be a loader.
- *
- * \author Kevin E. Martin <kevin@precisioninsight.com>
- * \author Ian Romanick <idr@us.ibm.com>
- * \author Kristian Høgsberg <krh@redhat.com>
- */
-
-#ifndef DRI_INTERFACE_H
-#define DRI_INTERFACE_H
-
-/* For archs with no drm.h */
-#if defined(__APPLE__) || defined(__CYGWIN__) || defined(__GNU__)
-#ifndef __NOT_HAVE_DRM_H
-#define __NOT_HAVE_DRM_H
-#endif
-#endif
-
-#ifndef __NOT_HAVE_DRM_H
-#include <drm.h>
-#else
-typedef unsigned int drm_context_t;
-typedef unsigned int drm_drawable_t;
-typedef struct drm_clip_rect drm_clip_rect_t;
-#endif
-
-/**
- * \name DRI interface structures
- *
- * The following structures define the interface between the GLX client
- * side library and the DRI (direct rendering infrastructure).
- */
-/*@{*/
-typedef struct __DRIdisplayRec __DRIdisplay;
-typedef struct __DRIscreenRec __DRIscreen;
-typedef struct __DRIcontextRec __DRIcontext;
-typedef struct __DRIdrawableRec __DRIdrawable;
-typedef struct __DRIconfigRec __DRIconfig;
-typedef struct __DRIframebufferRec __DRIframebuffer;
-typedef struct __DRIversionRec __DRIversion;
-
-typedef struct __DRIcoreExtensionRec __DRIcoreExtension;
-typedef struct __DRIextensionRec __DRIextension;
-typedef struct __DRIcopySubBufferExtensionRec __DRIcopySubBufferExtension;
-typedef struct __DRIswapControlExtensionRec __DRIswapControlExtension;
-typedef struct __DRIframeTrackingExtensionRec __DRIframeTrackingExtension;
-typedef struct __DRImediaStreamCounterExtensionRec __DRImediaStreamCounterExtension;
-typedef struct __DRItexOffsetExtensionRec __DRItexOffsetExtension;
-typedef struct __DRItexBufferExtensionRec __DRItexBufferExtension;
-typedef struct __DRIlegacyExtensionRec __DRIlegacyExtension;
-typedef struct __DRIswrastExtensionRec __DRIswrastExtension;
-typedef struct __DRIbufferRec __DRIbuffer;
-typedef struct __DRIdri2ExtensionRec __DRIdri2Extension;
-typedef struct __DRIdri2LoaderExtensionRec __DRIdri2LoaderExtension;
-typedef struct __DRI2flushExtensionRec __DRI2flushExtension;
-
-/*@}*/
-
-
-/**
- * Extension struct. Drivers 'inherit' from this struct by embedding
- * it as the first element in the extension struct.
- *
- * We never break API in for a DRI extension. If we need to change
- * the way things work in a non-backwards compatible manner, we
- * introduce a new extension. During a transition period, we can
- * leave both the old and the new extension in the driver, which
- * allows us to move to the new interface without having to update the
- * loader(s) in lock step.
- *
- * However, we can add entry points to an extension over time as long
- * as we don't break the old ones. As we add entry points to an
- * extension, we increase the version number. The corresponding
- * #define can be used to guard code that accesses the new entry
- * points at compile time and the version field in the extension
- * struct can be used at run-time to determine how to use the
- * extension.
- */
-struct __DRIextensionRec {
- const char *name;
- int version;
-};
-
-/**
- * The first set of extension are the screen extensions, returned by
- * __DRIcore::getExtensions(). This entry point will return a list of
- * extensions and the loader can use the ones it knows about by
- * casting them to more specific extensions and advertising any GLX
- * extensions the DRI extensions enables.
- */
-
-/**
- * Used by drivers to indicate support for setting the read drawable.
- */
-#define __DRI_READ_DRAWABLE "DRI_ReadDrawable"
-#define __DRI_READ_DRAWABLE_VERSION 1
-
-/**
- * Used by drivers that implement the GLX_MESA_copy_sub_buffer extension.
- */
-#define __DRI_COPY_SUB_BUFFER "DRI_CopySubBuffer"
-#define __DRI_COPY_SUB_BUFFER_VERSION 1
-struct __DRIcopySubBufferExtensionRec {
- __DRIextension base;
- void (*copySubBuffer)(__DRIdrawable *drawable, int x, int y, int w, int h);
-};
-
-/**
- * Used by drivers that implement the GLX_SGI_swap_control or
- * GLX_MESA_swap_control extension.
- */
-#define __DRI_SWAP_CONTROL "DRI_SwapControl"
-#define __DRI_SWAP_CONTROL_VERSION 1
-struct __DRIswapControlExtensionRec {
- __DRIextension base;
- void (*setSwapInterval)(__DRIdrawable *drawable, unsigned int inteval);
- unsigned int (*getSwapInterval)(__DRIdrawable *drawable);
-};
-
-/**
- * Used by drivers that implement the GLX_MESA_swap_frame_usage extension.
- */
-#define __DRI_FRAME_TRACKING "DRI_FrameTracking"
-#define __DRI_FRAME_TRACKING_VERSION 1
-struct __DRIframeTrackingExtensionRec {
- __DRIextension base;
-
- /**
- * Enable or disable frame usage tracking.
- *
- * \since Internal API version 20030317.
- */
- int (*frameTracking)(__DRIdrawable *drawable, GLboolean enable);
-
- /**
- * Retrieve frame usage information.
- *
- * \since Internal API version 20030317.
- */
- int (*queryFrameTracking)(__DRIdrawable *drawable,
- int64_t * sbc, int64_t * missedFrames,
- float * lastMissedUsage, float * usage);
-};
-
-
-/**
- * Used by drivers that implement the GLX_SGI_video_sync extension.
- */
-#define __DRI_MEDIA_STREAM_COUNTER "DRI_MediaStreamCounter"
-#define __DRI_MEDIA_STREAM_COUNTER_VERSION 1
-struct __DRImediaStreamCounterExtensionRec {
- __DRIextension base;
-
- /**
- * Wait for the MSC to equal target_msc, or, if that has already passed,
- * the next time (MSC % divisor) is equal to remainder. If divisor is
- * zero, the function will return as soon as MSC is greater than or equal
- * to target_msc.
- */
- int (*waitForMSC)(__DRIdrawable *drawable,
- int64_t target_msc, int64_t divisor, int64_t remainder,
- int64_t * msc, int64_t * sbc);
-
- /**
- * Get the number of vertical refreshes since some point in time before
- * this function was first called (i.e., system start up).
- */
- int (*getDrawableMSC)(__DRIscreen *screen, __DRIdrawable *drawable,
- int64_t *msc);
-};
-
-
-#define __DRI_TEX_OFFSET "DRI_TexOffset"
-#define __DRI_TEX_OFFSET_VERSION 1
-struct __DRItexOffsetExtensionRec {
- __DRIextension base;
-
- /**
- * Method to override base texture image with a driver specific 'offset'.
- * The depth passed in allows e.g. to ignore the alpha channel of texture
- * images where the non-alpha components don't occupy a whole texel.
- *
- * For GLX_EXT_texture_from_pixmap with AIGLX.
- */
- void (*setTexOffset)(__DRIcontext *pDRICtx, GLint texname,
- unsigned long long offset, GLint depth, GLuint pitch);
-};
-
-
-/* Valid values for format in the setTexBuffer2 function below. These
- * values match the GLX tokens for compatibility reasons, but we
- * define them here since the DRI interface can't depend on GLX. */
-#define __DRI_TEXTURE_FORMAT_NONE 0x20D8
-#define __DRI_TEXTURE_FORMAT_RGB 0x20D9
-#define __DRI_TEXTURE_FORMAT_RGBA 0x20DA
-
-#define __DRI_TEX_BUFFER "DRI_TexBuffer"
-#define __DRI_TEX_BUFFER_VERSION 2
-struct __DRItexBufferExtensionRec {
- __DRIextension base;
-
- /**
- * Method to override base texture image with the contents of a
- * __DRIdrawable.
- *
- * For GLX_EXT_texture_from_pixmap with AIGLX. Deprecated in favor of
- * setTexBuffer2 in version 2 of this interface
- */
- void (*setTexBuffer)(__DRIcontext *pDRICtx,
- GLint target,
- __DRIdrawable *pDraw);
-
- /**
- * Method to override base texture image with the contents of a
- * __DRIdrawable, including the required texture format attribute.
- *
- * For GLX_EXT_texture_from_pixmap with AIGLX.
- */
- void (*setTexBuffer2)(__DRIcontext *pDRICtx,
- GLint target,
- GLint format,
- __DRIdrawable *pDraw);
- /**
- * Method to release texture buffer in case some special platform
- * need this.
- *
- * For GLX_EXT_texture_from_pixmap with AIGLX.
- */
- void (*releaseTexBuffer)(__DRIcontext *pDRICtx,
- GLint target,
- __DRIdrawable *pDraw);
-};
-
-/**
- * Used by drivers that implement DRI2
- */
-#define __DRI2_FLUSH "DRI2_Flush"
-#define __DRI2_FLUSH_VERSION 3
-struct __DRI2flushExtensionRec {
- __DRIextension base;
- void (*flush)(__DRIdrawable *drawable);
-
- /**
- * Ask the driver to call getBuffers/getBuffersWithFormat before
- * it starts rendering again.
- *
- * \param drawable the drawable to invalidate
- *
- * \since 3
- */
- void (*invalidate)(__DRIdrawable *drawable);
-};
-
-
-/**
- * XML document describing the configuration options supported by the
- * driver.
- */
-extern const char __driConfigOptions[];
-
-/*@}*/
-
-/**
- * The following extensions describe loader features that the DRI
- * driver can make use of. Some of these are mandatory, such as the
- * getDrawableInfo extension for DRI and the DRI Loader extensions for
- * DRI2, while others are optional, and if present allow the driver to
- * expose certain features. The loader pass in a NULL terminated
- * array of these extensions to the driver in the createNewScreen
- * constructor.
- */
-
-typedef struct __DRIgetDrawableInfoExtensionRec __DRIgetDrawableInfoExtension;
-typedef struct __DRIsystemTimeExtensionRec __DRIsystemTimeExtension;
-typedef struct __DRIdamageExtensionRec __DRIdamageExtension;
-typedef struct __DRIloaderExtensionRec __DRIloaderExtension;
-typedef struct __DRIswrastLoaderExtensionRec __DRIswrastLoaderExtension;
-
-
-/**
- * Callback to getDrawableInfo protocol
- */
-#define __DRI_GET_DRAWABLE_INFO "DRI_GetDrawableInfo"
-#define __DRI_GET_DRAWABLE_INFO_VERSION 1
-struct __DRIgetDrawableInfoExtensionRec {
- __DRIextension base;
-
- /**
- * This function is used to get information about the position, size, and
- * clip rects of a drawable.
- */
- GLboolean (* getDrawableInfo) ( __DRIdrawable *drawable,
- unsigned int * index, unsigned int * stamp,
- int * x, int * y, int * width, int * height,
- int * numClipRects, drm_clip_rect_t ** pClipRects,
- int * backX, int * backY,
- int * numBackClipRects, drm_clip_rect_t ** pBackClipRects,
- void *loaderPrivate);
-};
-
-/**
- * Callback to get system time for media stream counter extensions.
- */
-#define __DRI_SYSTEM_TIME "DRI_SystemTime"
-#define __DRI_SYSTEM_TIME_VERSION 1
-struct __DRIsystemTimeExtensionRec {
- __DRIextension base;
-
- /**
- * Get the 64-bit unadjusted system time (UST).
- */
- int (*getUST)(int64_t * ust);
-
- /**
- * Get the media stream counter (MSC) rate.
- *
- * Matching the definition in GLX_OML_sync_control, this function returns
- * the rate of the "media stream counter". In practical terms, this is
- * the frame refresh rate of the display.
- */
- GLboolean (*getMSCRate)(__DRIdrawable *draw,
- int32_t * numerator, int32_t * denominator,
- void *loaderPrivate);
-};
-
-/**
- * Damage reporting
- */
-#define __DRI_DAMAGE "DRI_Damage"
-#define __DRI_DAMAGE_VERSION 1
-struct __DRIdamageExtensionRec {
- __DRIextension base;
-
- /**
- * Reports areas of the given drawable which have been modified by the
- * driver.
- *
- * \param drawable which the drawing was done to.
- * \param rects rectangles affected, with the drawable origin as the
- * origin.
- * \param x X offset of the drawable within the screen (used in the
- * front_buffer case)
- * \param y Y offset of the drawable within the screen.
- * \param front_buffer boolean flag for whether the drawing to the
- * drawable was actually done directly to the front buffer (instead
- * of backing storage, for example)
- * \param loaderPrivate the data passed in at createNewDrawable time
- */
- void (*reportDamage)(__DRIdrawable *draw,
- int x, int y,
- drm_clip_rect_t *rects, int num_rects,
- GLboolean front_buffer,
- void *loaderPrivate);
-};
-
-#define __DRI_SWRAST_IMAGE_OP_DRAW 1
-#define __DRI_SWRAST_IMAGE_OP_CLEAR 2
-#define __DRI_SWRAST_IMAGE_OP_SWAP 3
-
-/**
- * SWRast Loader extension.
- */
-#define __DRI_SWRAST_LOADER "DRI_SWRastLoader"
-#define __DRI_SWRAST_LOADER_VERSION 1
-struct __DRIswrastLoaderExtensionRec {
- __DRIextension base;
-
- /*
- * Drawable position and size
- */
- void (*getDrawableInfo)(__DRIdrawable *drawable,
- int *x, int *y, int *width, int *height,
- void *loaderPrivate);
-
- /**
- * Put image to drawable
- */
- void (*putImage)(__DRIdrawable *drawable, int op,
- int x, int y, int width, int height,
- char *data, void *loaderPrivate);
-
- /**
- * Get image from readable
- */
- void (*getImage)(__DRIdrawable *readable,
- int x, int y, int width, int height,
- char *data, void *loaderPrivate);
-};
-
-/**
- * Invalidate loader extension. The presence of this extension
- * indicates to the DRI driver that the loader will call invalidate in
- * the __DRI2_FLUSH extension, whenever the needs to query for new
- * buffers. This means that the DRI driver can drop the polling in
- * glViewport().
- *
- * The extension doesn't provide any functionality, it's only use to
- * indicate to the driver that it can use the new semantics. A DRI
- * driver can use this to switch between the different semantics or
- * just refuse to initialize if this extension isn't present.
- */
-#define __DRI_USE_INVALIDATE "DRI_UseInvalidate"
-#define __DRI_USE_INVALIDATE_VERSION 1
-
-typedef struct __DRIuseInvalidateExtensionRec __DRIuseInvalidateExtension;
-struct __DRIuseInvalidateExtensionRec {
- __DRIextension base;
-};
-
-/**
- * The remaining extensions describe driver extensions, immediately
- * available interfaces provided by the driver. To start using the
- * driver, dlsym() for the __DRI_DRIVER_EXTENSIONS symbol and look for
- * the extension you need in the array.
- */
-#define __DRI_DRIVER_EXTENSIONS "__driDriverExtensions"
-
-/**
- * Tokens for __DRIconfig attribs. A number of attributes defined by
- * GLX or EGL standards are not in the table, as they must be provided
- * by the loader. For example, FBConfig ID or visual ID, drawable type.
- */
-
-#define __DRI_ATTRIB_BUFFER_SIZE 1
-#define __DRI_ATTRIB_LEVEL 2
-#define __DRI_ATTRIB_RED_SIZE 3
-#define __DRI_ATTRIB_GREEN_SIZE 4
-#define __DRI_ATTRIB_BLUE_SIZE 5
-#define __DRI_ATTRIB_LUMINANCE_SIZE 6
-#define __DRI_ATTRIB_ALPHA_SIZE 7
-#define __DRI_ATTRIB_ALPHA_MASK_SIZE 8
-#define __DRI_ATTRIB_DEPTH_SIZE 9
-#define __DRI_ATTRIB_STENCIL_SIZE 10
-#define __DRI_ATTRIB_ACCUM_RED_SIZE 11
-#define __DRI_ATTRIB_ACCUM_GREEN_SIZE 12
-#define __DRI_ATTRIB_ACCUM_BLUE_SIZE 13
-#define __DRI_ATTRIB_ACCUM_ALPHA_SIZE 14
-#define __DRI_ATTRIB_SAMPLE_BUFFERS 15
-#define __DRI_ATTRIB_SAMPLES 16
-#define __DRI_ATTRIB_RENDER_TYPE 17
-#define __DRI_ATTRIB_CONFIG_CAVEAT 18
-#define __DRI_ATTRIB_CONFORMANT 19
-#define __DRI_ATTRIB_DOUBLE_BUFFER 20
-#define __DRI_ATTRIB_STEREO 21
-#define __DRI_ATTRIB_AUX_BUFFERS 22
-#define __DRI_ATTRIB_TRANSPARENT_TYPE 23
-#define __DRI_ATTRIB_TRANSPARENT_INDEX_VALUE 24
-#define __DRI_ATTRIB_TRANSPARENT_RED_VALUE 25
-#define __DRI_ATTRIB_TRANSPARENT_GREEN_VALUE 26
-#define __DRI_ATTRIB_TRANSPARENT_BLUE_VALUE 27
-#define __DRI_ATTRIB_TRANSPARENT_ALPHA_VALUE 28
-#define __DRI_ATTRIB_FLOAT_MODE 29
-#define __DRI_ATTRIB_RED_MASK 30
-#define __DRI_ATTRIB_GREEN_MASK 31
-#define __DRI_ATTRIB_BLUE_MASK 32
-#define __DRI_ATTRIB_ALPHA_MASK 33
-#define __DRI_ATTRIB_MAX_PBUFFER_WIDTH 34
-#define __DRI_ATTRIB_MAX_PBUFFER_HEIGHT 35
-#define __DRI_ATTRIB_MAX_PBUFFER_PIXELS 36
-#define __DRI_ATTRIB_OPTIMAL_PBUFFER_WIDTH 37
-#define __DRI_ATTRIB_OPTIMAL_PBUFFER_HEIGHT 38
-#define __DRI_ATTRIB_VISUAL_SELECT_GROUP 39
-#define __DRI_ATTRIB_SWAP_METHOD 40
-#define __DRI_ATTRIB_MAX_SWAP_INTERVAL 41
-#define __DRI_ATTRIB_MIN_SWAP_INTERVAL 42
-#define __DRI_ATTRIB_BIND_TO_TEXTURE_RGB 43
-#define __DRI_ATTRIB_BIND_TO_TEXTURE_RGBA 44
-#define __DRI_ATTRIB_BIND_TO_MIPMAP_TEXTURE 45
-#define __DRI_ATTRIB_BIND_TO_TEXTURE_TARGETS 46
-#define __DRI_ATTRIB_YINVERTED 47
-#define __DRI_ATTRIB_FRAMEBUFFER_SRGB_CAPABLE 48
-
-/* __DRI_ATTRIB_RENDER_TYPE */
-#define __DRI_ATTRIB_RGBA_BIT 0x01
-#define __DRI_ATTRIB_COLOR_INDEX_BIT 0x02
-#define __DRI_ATTRIB_LUMINANCE_BIT 0x04
-
-/* __DRI_ATTRIB_CONFIG_CAVEAT */
-#define __DRI_ATTRIB_SLOW_BIT 0x01
-#define __DRI_ATTRIB_NON_CONFORMANT_CONFIG 0x02
-
-/* __DRI_ATTRIB_TRANSPARENT_TYPE */
-#define __DRI_ATTRIB_TRANSPARENT_RGB 0x00
-#define __DRI_ATTRIB_TRANSPARENT_INDEX 0x01
-
-/* __DRI_ATTRIB_BIND_TO_TEXTURE_TARGETS */
-#define __DRI_ATTRIB_TEXTURE_1D_BIT 0x01
-#define __DRI_ATTRIB_TEXTURE_2D_BIT 0x02
-#define __DRI_ATTRIB_TEXTURE_RECTANGLE_BIT 0x04
-
-/**
- * This extension defines the core DRI functionality.
- */
-#define __DRI_CORE "DRI_Core"
-#define __DRI_CORE_VERSION 1
-
-struct __DRIcoreExtensionRec {
- __DRIextension base;
-
- __DRIscreen *(*createNewScreen)(int screen, int fd,
- unsigned int sarea_handle,
- const __DRIextension **extensions,
- const __DRIconfig ***driverConfigs,
- void *loaderPrivate);
-
- void (*destroyScreen)(__DRIscreen *screen);
-
- const __DRIextension **(*getExtensions)(__DRIscreen *screen);
-
- int (*getConfigAttrib)(const __DRIconfig *config,
- unsigned int attrib,
- unsigned int *value);
-
- int (*indexConfigAttrib)(const __DRIconfig *config, int index,
- unsigned int *attrib, unsigned int *value);
-
- __DRIdrawable *(*createNewDrawable)(__DRIscreen *screen,
- const __DRIconfig *config,
- unsigned int drawable_id,
- unsigned int head,
- void *loaderPrivate);
-
- void (*destroyDrawable)(__DRIdrawable *drawable);
-
- void (*swapBuffers)(__DRIdrawable *drawable);
-
- __DRIcontext *(*createNewContext)(__DRIscreen *screen,
- const __DRIconfig *config,
- __DRIcontext *shared,
- void *loaderPrivate);
-
- int (*copyContext)(__DRIcontext *dest,
- __DRIcontext *src,
- unsigned long mask);
-
- void (*destroyContext)(__DRIcontext *context);
-
- int (*bindContext)(__DRIcontext *ctx,
- __DRIdrawable *pdraw,
- __DRIdrawable *pread);
-
- int (*unbindContext)(__DRIcontext *ctx);
-};
-
-/**
- * Stored version of some component (i.e., server-side DRI module, kernel-side
- * DRM, etc.).
- *
- * \todo
- * There are several data structures that explicitly store a major version,
- * minor version, and patch level. These structures should be modified to
- * have a \c __DRIversionRec instead.
- */
-struct __DRIversionRec {
- int major; /**< Major version number. */
- int minor; /**< Minor version number. */
- int patch; /**< Patch-level. */
-};
-
-/**
- * Framebuffer information record. Used by libGL to communicate information
- * about the framebuffer to the driver's \c __driCreateNewScreen function.
- *
- * In XFree86, most of this information is derrived from data returned by
- * calling \c XF86DRIGetDeviceInfo.
- *
- * \sa XF86DRIGetDeviceInfo __DRIdisplayRec::createNewScreen
- * __driUtilCreateNewScreen CallCreateNewScreen
- *
- * \bug This structure could be better named.
- */
-struct __DRIframebufferRec {
- unsigned char *base; /**< Framebuffer base address in the CPU's
- * address space. This value is calculated by
- * calling \c drmMap on the framebuffer handle
- * returned by \c XF86DRIGetDeviceInfo (or a
- * similar function).
- */
- int size; /**< Framebuffer size, in bytes. */
- int stride; /**< Number of bytes from one line to the next. */
- int width; /**< Pixel width of the framebuffer. */
- int height; /**< Pixel height of the framebuffer. */
- int dev_priv_size; /**< Size of the driver's dev-priv structure. */
- void *dev_priv; /**< Pointer to the driver's dev-priv structure. */
-};
-
-
-/**
- * This extension provides alternative screen, drawable and context
- * constructors for legacy DRI functionality. This is used in
- * conjunction with the core extension.
- */
-#define __DRI_LEGACY "DRI_Legacy"
-#define __DRI_LEGACY_VERSION 1
-
-struct __DRIlegacyExtensionRec {
- __DRIextension base;
-
- __DRIscreen *(*createNewScreen)(int screen,
- const __DRIversion *ddx_version,
- const __DRIversion *dri_version,
- const __DRIversion *drm_version,
- const __DRIframebuffer *frame_buffer,
- void *pSAREA, int fd,
- const __DRIextension **extensions,
- const __DRIconfig ***driver_configs,
- void *loaderPrivate);
-
- __DRIdrawable *(*createNewDrawable)(__DRIscreen *screen,
- const __DRIconfig *config,
- drm_drawable_t hwDrawable,
- int renderType, const int *attrs,
- void *loaderPrivate);
-
- __DRIcontext *(*createNewContext)(__DRIscreen *screen,
- const __DRIconfig *config,
- int render_type,
- __DRIcontext *shared,
- drm_context_t hwContext,
- void *loaderPrivate);
-};
-
-/**
- * This extension provides alternative screen, drawable and context
- * constructors for swrast DRI functionality. This is used in
- * conjunction with the core extension.
- */
-#define __DRI_SWRAST "DRI_SWRast"
-#define __DRI_SWRAST_VERSION 2
-
-struct __DRIswrastExtensionRec {
- __DRIextension base;
-
- __DRIscreen *(*createNewScreen)(int screen,
- const __DRIextension **extensions,
- const __DRIconfig ***driver_configs,
- void *loaderPrivate);
-
- __DRIdrawable *(*createNewDrawable)(__DRIscreen *screen,
- const __DRIconfig *config,
- void *loaderPrivate);
-
- /* Since version 2 */
- __DRIcontext *(*createNewContextForAPI)(__DRIscreen *screen,
- int api,
- const __DRIconfig *config,
- __DRIcontext *shared,
- void *data);
-};
-
-/**
- * DRI2 Loader extension.
- */
-#define __DRI_BUFFER_FRONT_LEFT 0
-#define __DRI_BUFFER_BACK_LEFT 1
-#define __DRI_BUFFER_FRONT_RIGHT 2
-#define __DRI_BUFFER_BACK_RIGHT 3
-#define __DRI_BUFFER_DEPTH 4
-#define __DRI_BUFFER_STENCIL 5
-#define __DRI_BUFFER_ACCUM 6
-#define __DRI_BUFFER_FAKE_FRONT_LEFT 7
-#define __DRI_BUFFER_FAKE_FRONT_RIGHT 8
-#define __DRI_BUFFER_DEPTH_STENCIL 9 /**< Only available with DRI2 1.1 */
-
-struct __DRIbufferRec {
- unsigned int attachment;
- unsigned int name;
- unsigned int pitch;
- unsigned int cpp;
- unsigned int flags;
-};
-
-#define __DRI_DRI2_LOADER "DRI_DRI2Loader"
-#define __DRI_DRI2_LOADER_VERSION 3
-struct __DRIdri2LoaderExtensionRec {
- __DRIextension base;
-
- __DRIbuffer *(*getBuffers)(__DRIdrawable *driDrawable,
- int *width, int *height,
- unsigned int *attachments, int count,
- int *out_count, void *loaderPrivate);
-
- /**
- * Flush pending front-buffer rendering
- *
- * Any rendering that has been performed to the
- * \c __DRI_BUFFER_FAKE_FRONT_LEFT will be flushed to the
- * \c __DRI_BUFFER_FRONT_LEFT.
- *
- * \param driDrawable Drawable whose front-buffer is to be flushed
- * \param loaderPrivate Loader's private data that was previously passed
- * into __DRIdri2ExtensionRec::createNewDrawable
- */
- void (*flushFrontBuffer)(__DRIdrawable *driDrawable, void *loaderPrivate);
-
-
- /**
- * Get list of buffers from the server
- *
- * Gets a list of buffer for the specified set of attachments. Unlike
- * \c ::getBuffers, this function takes a list of attachments paired with
- * opaque \c unsigned \c int value describing the format of the buffer.
- * It is the responsibility of the caller to know what the service that
- * allocates the buffers will expect to receive for the format.
- *
- * \param driDrawable Drawable whose buffers are being queried.
- * \param width Output where the width of the buffers is stored.
- * \param height Output where the height of the buffers is stored.
- * \param attachments List of pairs of attachment ID and opaque format
- * requested for the drawable.
- * \param count Number of attachment / format pairs stored in
- * \c attachments.
- * \param loaderPrivate Loader's private data that was previously passed
- * into __DRIdri2ExtensionRec::createNewDrawable.
- */
- __DRIbuffer *(*getBuffersWithFormat)(__DRIdrawable *driDrawable,
- int *width, int *height,
- unsigned int *attachments, int count,
- int *out_count, void *loaderPrivate);
-};
-
-/**
- * This extension provides alternative screen, drawable and context
- * constructors for DRI2.
- */
-#define __DRI_DRI2 "DRI_DRI2"
-#define __DRI_DRI2_VERSION 2
-
-#define __DRI_API_OPENGL 0
-#define __DRI_API_GLES 1
-#define __DRI_API_GLES2 2
-
-struct __DRIdri2ExtensionRec {
- __DRIextension base;
-
- __DRIscreen *(*createNewScreen)(int screen, int fd,
- const __DRIextension **extensions,
- const __DRIconfig ***driver_configs,
- void *loaderPrivate);
-
- __DRIdrawable *(*createNewDrawable)(__DRIscreen *screen,
- const __DRIconfig *config,
- void *loaderPrivate);
-
- __DRIcontext *(*createNewContext)(__DRIscreen *screen,
- const __DRIconfig *config,
- __DRIcontext *shared,
- void *loaderPrivate);
-
- /* Since version 2 */
- unsigned int (*getAPIMask)(__DRIscreen *screen);
-
- __DRIcontext *(*createNewContextForAPI)(__DRIscreen *screen,
- int api,
- const __DRIconfig *config,
- __DRIcontext *shared,
- void *data);
-
- __DRIbuffer *(*allocateBuffer)(__DRIscreen *screen,
- unsigned int attachment,
- unsigned int format,
- int width,
- int height);
- void (*releaseBuffer)(__DRIscreen *screen,
- __DRIbuffer *buffer);
-};
-
-
-/**
- * This extension provides functionality to enable various EGLImage
- * extensions.
- */
-#define __DRI_IMAGE "DRI_IMAGE"
-#define __DRI_IMAGE_VERSION 1
-
-/**
- * These formats correspond to the similarly named MESA_FORMAT_*
- * tokens, except in the native endian of the CPU. For example, on
- * little endian __DRI_IMAGE_FORMAT_XRGB8888 corresponds to
- * MESA_FORMAT_XRGB8888, but MESA_FORMAT_XRGB8888_REV on big endian.
- */
-#define __DRI_IMAGE_FORMAT_RGB565 0x1001
-#define __DRI_IMAGE_FORMAT_XRGB8888 0x1002
-#define __DRI_IMAGE_FORMAT_ARGB8888 0x1003
-
-#define __DRI_IMAGE_USE_SHARE 0x0001
-#define __DRI_IMAGE_USE_SCANOUT 0x0002
-#define __DRI_IMAGE_USE_CURSOR 0x0004
-
-/**
- * queryImage attributes
- */
-
-#define __DRI_IMAGE_ATTRIB_STRIDE 0x2000
-#define __DRI_IMAGE_ATTRIB_HANDLE 0x2001
-#define __DRI_IMAGE_ATTRIB_NAME 0x2002
-
-typedef struct __DRIimageRec __DRIimage;
-typedef struct __DRIimageExtensionRec __DRIimageExtension;
-struct __DRIimageExtensionRec {
- __DRIextension base;
-
- __DRIimage *(*createImageFromName)(__DRIscreen *screen,
- int width, int height, int format,
- int name, int pitch,
- void *loaderPrivate);
-
- __DRIimage *(*createImageFromRenderbuffer)(__DRIcontext *context,
- int renderbuffer,
- void *loaderPrivate);
-
- void (*destroyImage)(__DRIimage *image);
-
- __DRIimage *(*createImage)(__DRIscreen *screen,
- int width, int height, int format,
- unsigned int use,
- void *loaderPrivate);
-
- GLboolean (*queryImage)(__DRIimage *image, int attrib, int *value);
-};
-
-
-/**
- * This extension must be implemented by the loader and passed to the
- * driver at screen creation time. The EGLImage entry points in the
- * various client APIs take opaque EGLImage handles and use this
- * extension to map them to a __DRIimage. At version 1, this
- * extensions allows mapping EGLImage pointers to __DRIimage pointers,
- * but future versions could support other EGLImage-like, opaque types
- * with new lookup functions.
- */
-#define __DRI_IMAGE_LOOKUP "DRI_IMAGE_LOOKUP"
-#define __DRI_IMAGE_LOOKUP_VERSION 1
-
-typedef struct __DRIimageLookupExtensionRec __DRIimageLookupExtension;
-struct __DRIimageLookupExtensionRec {
- __DRIextension base;
-
- __DRIimage *(*lookupEGLImage)(__DRIscreen *screen, void *image,
- void *loaderPrivate);
-};
-
-/**
- * This extension allows for common DRI2 options
- */
-#define __DRI2_CONFIG_QUERY "DRI_CONFIG_QUERY"
-#define __DRI2_CONFIG_QUERY_VERSION 1
-
-typedef struct __DRI2configQueryExtensionRec __DRI2configQueryExtension;
-struct __DRI2configQueryExtensionRec {
- __DRIextension base;
-
- int (*configQueryb)(__DRIscreen *screen, const char *var, GLboolean *val);
- int (*configQueryi)(__DRIscreen *screen, const char *var, GLint *val);
- int (*configQueryf)(__DRIscreen *screen, const char *var, GLfloat *val);
-};
-#endif
+/*
+ * Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
+ * Copyright 2007-2008 Red Hat, Inc.
+ * (C) Copyright IBM Corporation 2004
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * on the rights to use, copy, modify, merge, publish, distribute, sub
+ * license, and/or sell copies of the Software, and to permit persons to whom
+ * the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
+ * THE COPYRIGHT HOLDERS AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+ * USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+/**
+ * \file dri_interface.h
+ *
+ * This file contains all the types and functions that define the interface
+ * between a DRI driver and driver loader. Currently, the most common driver
+ * loader is the XFree86 libGL.so. However, other loaders do exist, and in
+ * the future the server-side libglx.a will also be a loader.
+ *
+ * \author Kevin E. Martin <kevin@precisioninsight.com>
+ * \author Ian Romanick <idr@us.ibm.com>
+ * \author Kristian Høgsberg <krh@redhat.com>
+ */
+
+#ifndef DRI_INTERFACE_H
+#define DRI_INTERFACE_H
+
+/* For archs with no drm.h */
+#if defined(__APPLE__) || defined(__CYGWIN__) || defined(__GNU__) || defined(_MSC_VER)
+#ifndef __NOT_HAVE_DRM_H
+#define __NOT_HAVE_DRM_H
+#endif
+#endif
+
+#ifndef __NOT_HAVE_DRM_H
+#include <drm.h>
+#else
+typedef unsigned int drm_context_t;
+typedef unsigned int drm_drawable_t;
+typedef struct drm_clip_rect drm_clip_rect_t;
+#endif
+
+/**
+ * \name DRI interface structures
+ *
+ * The following structures define the interface between the GLX client
+ * side library and the DRI (direct rendering infrastructure).
+ */
+/*@{*/
+typedef struct __DRIdisplayRec __DRIdisplay;
+typedef struct __DRIscreenRec __DRIscreen;
+typedef struct __DRIcontextRec __DRIcontext;
+typedef struct __DRIdrawableRec __DRIdrawable;
+typedef struct __DRIconfigRec __DRIconfig;
+typedef struct __DRIframebufferRec __DRIframebuffer;
+typedef struct __DRIversionRec __DRIversion;
+
+typedef struct __DRIcoreExtensionRec __DRIcoreExtension;
+typedef struct __DRIextensionRec __DRIextension;
+typedef struct __DRIcopySubBufferExtensionRec __DRIcopySubBufferExtension;
+typedef struct __DRIswapControlExtensionRec __DRIswapControlExtension;
+typedef struct __DRIframeTrackingExtensionRec __DRIframeTrackingExtension;
+typedef struct __DRImediaStreamCounterExtensionRec __DRImediaStreamCounterExtension;
+typedef struct __DRItexOffsetExtensionRec __DRItexOffsetExtension;
+typedef struct __DRItexBufferExtensionRec __DRItexBufferExtension;
+typedef struct __DRIlegacyExtensionRec __DRIlegacyExtension;
+typedef struct __DRIswrastExtensionRec __DRIswrastExtension;
+typedef struct __DRIbufferRec __DRIbuffer;
+typedef struct __DRIdri2ExtensionRec __DRIdri2Extension;
+typedef struct __DRIdri2LoaderExtensionRec __DRIdri2LoaderExtension;
+typedef struct __DRI2flushExtensionRec __DRI2flushExtension;
+
+/*@}*/
+
+
+/**
+ * Extension struct. Drivers 'inherit' from this struct by embedding
+ * it as the first element in the extension struct.
+ *
+ * We never break API in for a DRI extension. If we need to change
+ * the way things work in a non-backwards compatible manner, we
+ * introduce a new extension. During a transition period, we can
+ * leave both the old and the new extension in the driver, which
+ * allows us to move to the new interface without having to update the
+ * loader(s) in lock step.
+ *
+ * However, we can add entry points to an extension over time as long
+ * as we don't break the old ones. As we add entry points to an
+ * extension, we increase the version number. The corresponding
+ * #define can be used to guard code that accesses the new entry
+ * points at compile time and the version field in the extension
+ * struct can be used at run-time to determine how to use the
+ * extension.
+ */
+struct __DRIextensionRec {
+ const char *name;
+ int version;
+};
+
+/**
+ * The first set of extension are the screen extensions, returned by
+ * __DRIcore::getExtensions(). This entry point will return a list of
+ * extensions and the loader can use the ones it knows about by
+ * casting them to more specific extensions and advertising any GLX
+ * extensions the DRI extensions enables.
+ */
+
+/**
+ * Used by drivers to indicate support for setting the read drawable.
+ */
+#define __DRI_READ_DRAWABLE "DRI_ReadDrawable"
+#define __DRI_READ_DRAWABLE_VERSION 1
+
+/**
+ * Used by drivers that implement the GLX_MESA_copy_sub_buffer extension.
+ */
+#define __DRI_COPY_SUB_BUFFER "DRI_CopySubBuffer"
+#define __DRI_COPY_SUB_BUFFER_VERSION 1
+struct __DRIcopySubBufferExtensionRec {
+ __DRIextension base;
+ void (*copySubBuffer)(__DRIdrawable *drawable, int x, int y, int w, int h);
+};
+
+/**
+ * Used by drivers that implement the GLX_SGI_swap_control or
+ * GLX_MESA_swap_control extension.
+ */
+#define __DRI_SWAP_CONTROL "DRI_SwapControl"
+#define __DRI_SWAP_CONTROL_VERSION 1
+struct __DRIswapControlExtensionRec {
+ __DRIextension base;
+ void (*setSwapInterval)(__DRIdrawable *drawable, unsigned int inteval);
+ unsigned int (*getSwapInterval)(__DRIdrawable *drawable);
+};
+
+/**
+ * Used by drivers that implement the GLX_MESA_swap_frame_usage extension.
+ */
+#define __DRI_FRAME_TRACKING "DRI_FrameTracking"
+#define __DRI_FRAME_TRACKING_VERSION 1
+struct __DRIframeTrackingExtensionRec {
+ __DRIextension base;
+
+ /**
+ * Enable or disable frame usage tracking.
+ *
+ * \since Internal API version 20030317.
+ */
+ int (*frameTracking)(__DRIdrawable *drawable, GLboolean enable);
+
+ /**
+ * Retrieve frame usage information.
+ *
+ * \since Internal API version 20030317.
+ */
+ int (*queryFrameTracking)(__DRIdrawable *drawable,
+ int64_t * sbc, int64_t * missedFrames,
+ float * lastMissedUsage, float * usage);
+};
+
+
+/**
+ * Used by drivers that implement the GLX_SGI_video_sync extension.
+ */
+#define __DRI_MEDIA_STREAM_COUNTER "DRI_MediaStreamCounter"
+#define __DRI_MEDIA_STREAM_COUNTER_VERSION 1
+struct __DRImediaStreamCounterExtensionRec {
+ __DRIextension base;
+
+ /**
+ * Wait for the MSC to equal target_msc, or, if that has already passed,
+ * the next time (MSC % divisor) is equal to remainder. If divisor is
+ * zero, the function will return as soon as MSC is greater than or equal
+ * to target_msc.
+ */
+ int (*waitForMSC)(__DRIdrawable *drawable,
+ int64_t target_msc, int64_t divisor, int64_t remainder,
+ int64_t * msc, int64_t * sbc);
+
+ /**
+ * Get the number of vertical refreshes since some point in time before
+ * this function was first called (i.e., system start up).
+ */
+ int (*getDrawableMSC)(__DRIscreen *screen, __DRIdrawable *drawable,
+ int64_t *msc);
+};
+
+
+#define __DRI_TEX_OFFSET "DRI_TexOffset"
+#define __DRI_TEX_OFFSET_VERSION 1
+struct __DRItexOffsetExtensionRec {
+ __DRIextension base;
+
+ /**
+ * Method to override base texture image with a driver specific 'offset'.
+ * The depth passed in allows e.g. to ignore the alpha channel of texture
+ * images where the non-alpha components don't occupy a whole texel.
+ *
+ * For GLX_EXT_texture_from_pixmap with AIGLX.
+ */
+ void (*setTexOffset)(__DRIcontext *pDRICtx, GLint texname,
+ unsigned long long offset, GLint depth, GLuint pitch);
+};
+
+
+/* Valid values for format in the setTexBuffer2 function below. These
+ * values match the GLX tokens for compatibility reasons, but we
+ * define them here since the DRI interface can't depend on GLX. */
+#define __DRI_TEXTURE_FORMAT_NONE 0x20D8
+#define __DRI_TEXTURE_FORMAT_RGB 0x20D9
+#define __DRI_TEXTURE_FORMAT_RGBA 0x20DA
+
+#define __DRI_TEX_BUFFER "DRI_TexBuffer"
+#define __DRI_TEX_BUFFER_VERSION 2
+struct __DRItexBufferExtensionRec {
+ __DRIextension base;
+
+ /**
+ * Method to override base texture image with the contents of a
+ * __DRIdrawable.
+ *
+ * For GLX_EXT_texture_from_pixmap with AIGLX. Deprecated in favor of
+ * setTexBuffer2 in version 2 of this interface
+ */
+ void (*setTexBuffer)(__DRIcontext *pDRICtx,
+ GLint target,
+ __DRIdrawable *pDraw);
+
+ /**
+ * Method to override base texture image with the contents of a
+ * __DRIdrawable, including the required texture format attribute.
+ *
+ * For GLX_EXT_texture_from_pixmap with AIGLX.
+ */
+ void (*setTexBuffer2)(__DRIcontext *pDRICtx,
+ GLint target,
+ GLint format,
+ __DRIdrawable *pDraw);
+ /**
+ * Method to release texture buffer in case some special platform
+ * need this.
+ *
+ * For GLX_EXT_texture_from_pixmap with AIGLX.
+ */
+ void (*releaseTexBuffer)(__DRIcontext *pDRICtx,
+ GLint target,
+ __DRIdrawable *pDraw);
+};
+
+/**
+ * Used by drivers that implement DRI2
+ */
+#define __DRI2_FLUSH "DRI2_Flush"
+#define __DRI2_FLUSH_VERSION 3
+struct __DRI2flushExtensionRec {
+ __DRIextension base;
+ void (*flush)(__DRIdrawable *drawable);
+
+ /**
+ * Ask the driver to call getBuffers/getBuffersWithFormat before
+ * it starts rendering again.
+ *
+ * \param drawable the drawable to invalidate
+ *
+ * \since 3
+ */
+ void (*invalidate)(__DRIdrawable *drawable);
+};
+
+
+/**
+ * XML document describing the configuration options supported by the
+ * driver.
+ */
+extern const char __driConfigOptions[];
+
+/*@}*/
+
+/**
+ * The following extensions describe loader features that the DRI
+ * driver can make use of. Some of these are mandatory, such as the
+ * getDrawableInfo extension for DRI and the DRI Loader extensions for
+ * DRI2, while others are optional, and if present allow the driver to
+ * expose certain features. The loader pass in a NULL terminated
+ * array of these extensions to the driver in the createNewScreen
+ * constructor.
+ */
+
+typedef struct __DRIgetDrawableInfoExtensionRec __DRIgetDrawableInfoExtension;
+typedef struct __DRIsystemTimeExtensionRec __DRIsystemTimeExtension;
+typedef struct __DRIdamageExtensionRec __DRIdamageExtension;
+typedef struct __DRIloaderExtensionRec __DRIloaderExtension;
+typedef struct __DRIswrastLoaderExtensionRec __DRIswrastLoaderExtension;
+
+
+/**
+ * Callback to getDrawableInfo protocol
+ */
+#define __DRI_GET_DRAWABLE_INFO "DRI_GetDrawableInfo"
+#define __DRI_GET_DRAWABLE_INFO_VERSION 1
+struct __DRIgetDrawableInfoExtensionRec {
+ __DRIextension base;
+
+ /**
+ * This function is used to get information about the position, size, and
+ * clip rects of a drawable.
+ */
+ GLboolean (* getDrawableInfo) ( __DRIdrawable *drawable,
+ unsigned int * index, unsigned int * stamp,
+ int * x, int * y, int * width, int * height,
+ int * numClipRects, drm_clip_rect_t ** pClipRects,
+ int * backX, int * backY,
+ int * numBackClipRects, drm_clip_rect_t ** pBackClipRects,
+ void *loaderPrivate);
+};
+
+typedef int int32_t;
+
+/**
+ * Callback to get system time for media stream counter extensions.
+ */
+#define __DRI_SYSTEM_TIME "DRI_SystemTime"
+#define __DRI_SYSTEM_TIME_VERSION 1
+struct __DRIsystemTimeExtensionRec {
+ __DRIextension base;
+
+ /**
+ * Get the 64-bit unadjusted system time (UST).
+ */
+ int (*getUST)(int64_t * ust);
+
+ /**
+ * Get the media stream counter (MSC) rate.
+ *
+ * Matching the definition in GLX_OML_sync_control, this function returns
+ * the rate of the "media stream counter". In practical terms, this is
+ * the frame refresh rate of the display.
+ */
+ GLboolean (*getMSCRate)(__DRIdrawable *draw,
+ int32_t * numerator, int32_t * denominator,
+ void *loaderPrivate);
+};
+
+/**
+ * Damage reporting
+ */
+#define __DRI_DAMAGE "DRI_Damage"
+#define __DRI_DAMAGE_VERSION 1
+struct __DRIdamageExtensionRec {
+ __DRIextension base;
+
+ /**
+ * Reports areas of the given drawable which have been modified by the
+ * driver.
+ *
+ * \param drawable which the drawing was done to.
+ * \param rects rectangles affected, with the drawable origin as the
+ * origin.
+ * \param x X offset of the drawable within the screen (used in the
+ * front_buffer case)
+ * \param y Y offset of the drawable within the screen.
+ * \param front_buffer boolean flag for whether the drawing to the
+ * drawable was actually done directly to the front buffer (instead
+ * of backing storage, for example)
+ * \param loaderPrivate the data passed in at createNewDrawable time
+ */
+ void (*reportDamage)(__DRIdrawable *draw,
+ int x, int y,
+ drm_clip_rect_t *rects, int num_rects,
+ GLboolean front_buffer,
+ void *loaderPrivate);
+};
+
+#define __DRI_SWRAST_IMAGE_OP_DRAW 1
+#define __DRI_SWRAST_IMAGE_OP_CLEAR 2
+#define __DRI_SWRAST_IMAGE_OP_SWAP 3
+
+/**
+ * SWRast Loader extension.
+ */
+#define __DRI_SWRAST_LOADER "DRI_SWRastLoader"
+#define __DRI_SWRAST_LOADER_VERSION 1
+struct __DRIswrastLoaderExtensionRec {
+ __DRIextension base;
+
+ /*
+ * Drawable position and size
+ */
+ void (*getDrawableInfo)(__DRIdrawable *drawable,
+ int *x, int *y, int *width, int *height,
+ void *loaderPrivate);
+
+ /**
+ * Put image to drawable
+ */
+ void (*putImage)(__DRIdrawable *drawable, int op,
+ int x, int y, int width, int height,
+ char *data, void *loaderPrivate);
+
+ /**
+ * Get image from readable
+ */
+ void (*getImage)(__DRIdrawable *readable,
+ int x, int y, int width, int height,
+ char *data, void *loaderPrivate);
+};
+
+/**
+ * Invalidate loader extension. The presence of this extension
+ * indicates to the DRI driver that the loader will call invalidate in
+ * the __DRI2_FLUSH extension, whenever the needs to query for new
+ * buffers. This means that the DRI driver can drop the polling in
+ * glViewport().
+ *
+ * The extension doesn't provide any functionality, it's only use to
+ * indicate to the driver that it can use the new semantics. A DRI
+ * driver can use this to switch between the different semantics or
+ * just refuse to initialize if this extension isn't present.
+ */
+#define __DRI_USE_INVALIDATE "DRI_UseInvalidate"
+#define __DRI_USE_INVALIDATE_VERSION 1
+
+typedef struct __DRIuseInvalidateExtensionRec __DRIuseInvalidateExtension;
+struct __DRIuseInvalidateExtensionRec {
+ __DRIextension base;
+};
+
+/**
+ * The remaining extensions describe driver extensions, immediately
+ * available interfaces provided by the driver. To start using the
+ * driver, dlsym() for the __DRI_DRIVER_EXTENSIONS symbol and look for
+ * the extension you need in the array.
+ */
+#define __DRI_DRIVER_EXTENSIONS "__driDriverExtensions"
+
+/**
+ * Tokens for __DRIconfig attribs. A number of attributes defined by
+ * GLX or EGL standards are not in the table, as they must be provided
+ * by the loader. For example, FBConfig ID or visual ID, drawable type.
+ */
+
+#define __DRI_ATTRIB_BUFFER_SIZE 1
+#define __DRI_ATTRIB_LEVEL 2
+#define __DRI_ATTRIB_RED_SIZE 3
+#define __DRI_ATTRIB_GREEN_SIZE 4
+#define __DRI_ATTRIB_BLUE_SIZE 5
+#define __DRI_ATTRIB_LUMINANCE_SIZE 6
+#define __DRI_ATTRIB_ALPHA_SIZE 7
+#define __DRI_ATTRIB_ALPHA_MASK_SIZE 8
+#define __DRI_ATTRIB_DEPTH_SIZE 9
+#define __DRI_ATTRIB_STENCIL_SIZE 10
+#define __DRI_ATTRIB_ACCUM_RED_SIZE 11
+#define __DRI_ATTRIB_ACCUM_GREEN_SIZE 12
+#define __DRI_ATTRIB_ACCUM_BLUE_SIZE 13
+#define __DRI_ATTRIB_ACCUM_ALPHA_SIZE 14
+#define __DRI_ATTRIB_SAMPLE_BUFFERS 15
+#define __DRI_ATTRIB_SAMPLES 16
+#define __DRI_ATTRIB_RENDER_TYPE 17
+#define __DRI_ATTRIB_CONFIG_CAVEAT 18
+#define __DRI_ATTRIB_CONFORMANT 19
+#define __DRI_ATTRIB_DOUBLE_BUFFER 20
+#define __DRI_ATTRIB_STEREO 21
+#define __DRI_ATTRIB_AUX_BUFFERS 22
+#define __DRI_ATTRIB_TRANSPARENT_TYPE 23
+#define __DRI_ATTRIB_TRANSPARENT_INDEX_VALUE 24
+#define __DRI_ATTRIB_TRANSPARENT_RED_VALUE 25
+#define __DRI_ATTRIB_TRANSPARENT_GREEN_VALUE 26
+#define __DRI_ATTRIB_TRANSPARENT_BLUE_VALUE 27
+#define __DRI_ATTRIB_TRANSPARENT_ALPHA_VALUE 28
+#define __DRI_ATTRIB_FLOAT_MODE 29
+#define __DRI_ATTRIB_RED_MASK 30
+#define __DRI_ATTRIB_GREEN_MASK 31
+#define __DRI_ATTRIB_BLUE_MASK 32
+#define __DRI_ATTRIB_ALPHA_MASK 33
+#define __DRI_ATTRIB_MAX_PBUFFER_WIDTH 34
+#define __DRI_ATTRIB_MAX_PBUFFER_HEIGHT 35
+#define __DRI_ATTRIB_MAX_PBUFFER_PIXELS 36
+#define __DRI_ATTRIB_OPTIMAL_PBUFFER_WIDTH 37
+#define __DRI_ATTRIB_OPTIMAL_PBUFFER_HEIGHT 38
+#define __DRI_ATTRIB_VISUAL_SELECT_GROUP 39
+#define __DRI_ATTRIB_SWAP_METHOD 40
+#define __DRI_ATTRIB_MAX_SWAP_INTERVAL 41
+#define __DRI_ATTRIB_MIN_SWAP_INTERVAL 42
+#define __DRI_ATTRIB_BIND_TO_TEXTURE_RGB 43
+#define __DRI_ATTRIB_BIND_TO_TEXTURE_RGBA 44
+#define __DRI_ATTRIB_BIND_TO_MIPMAP_TEXTURE 45
+#define __DRI_ATTRIB_BIND_TO_TEXTURE_TARGETS 46
+#define __DRI_ATTRIB_YINVERTED 47
+#define __DRI_ATTRIB_FRAMEBUFFER_SRGB_CAPABLE 48
+
+/* __DRI_ATTRIB_RENDER_TYPE */
+#define __DRI_ATTRIB_RGBA_BIT 0x01
+#define __DRI_ATTRIB_COLOR_INDEX_BIT 0x02
+#define __DRI_ATTRIB_LUMINANCE_BIT 0x04
+
+/* __DRI_ATTRIB_CONFIG_CAVEAT */
+#define __DRI_ATTRIB_SLOW_BIT 0x01
+#define __DRI_ATTRIB_NON_CONFORMANT_CONFIG 0x02
+
+/* __DRI_ATTRIB_TRANSPARENT_TYPE */
+#define __DRI_ATTRIB_TRANSPARENT_RGB 0x00
+#define __DRI_ATTRIB_TRANSPARENT_INDEX 0x01
+
+/* __DRI_ATTRIB_BIND_TO_TEXTURE_TARGETS */
+#define __DRI_ATTRIB_TEXTURE_1D_BIT 0x01
+#define __DRI_ATTRIB_TEXTURE_2D_BIT 0x02
+#define __DRI_ATTRIB_TEXTURE_RECTANGLE_BIT 0x04
+
+/**
+ * This extension defines the core DRI functionality.
+ */
+#define __DRI_CORE "DRI_Core"
+#define __DRI_CORE_VERSION 1
+
+struct __DRIcoreExtensionRec {
+ __DRIextension base;
+
+ __DRIscreen *(*createNewScreen)(int screen, int fd,
+ unsigned int sarea_handle,
+ const __DRIextension **extensions,
+ const __DRIconfig ***driverConfigs,
+ void *loaderPrivate);
+
+ void (*destroyScreen)(__DRIscreen *screen);
+
+ const __DRIextension **(*getExtensions)(__DRIscreen *screen);
+
+ int (*getConfigAttrib)(const __DRIconfig *config,
+ unsigned int attrib,
+ unsigned int *value);
+
+ int (*indexConfigAttrib)(const __DRIconfig *config, int index,
+ unsigned int *attrib, unsigned int *value);
+
+ __DRIdrawable *(*createNewDrawable)(__DRIscreen *screen,
+ const __DRIconfig *config,
+ unsigned int drawable_id,
+ unsigned int head,
+ void *loaderPrivate);
+
+ void (*destroyDrawable)(__DRIdrawable *drawable);
+
+ void (*swapBuffers)(__DRIdrawable *drawable);
+
+ __DRIcontext *(*createNewContext)(__DRIscreen *screen,
+ const __DRIconfig *config,
+ __DRIcontext *shared,
+ void *loaderPrivate);
+
+ int (*copyContext)(__DRIcontext *dest,
+ __DRIcontext *src,
+ unsigned long mask);
+
+ void (*destroyContext)(__DRIcontext *context);
+
+ int (*bindContext)(__DRIcontext *ctx,
+ __DRIdrawable *pdraw,
+ __DRIdrawable *pread);
+
+ int (*unbindContext)(__DRIcontext *ctx);
+};
+
+/**
+ * Stored version of some component (i.e., server-side DRI module, kernel-side
+ * DRM, etc.).
+ *
+ * \todo
+ * There are several data structures that explicitly store a major version,
+ * minor version, and patch level. These structures should be modified to
+ * have a \c __DRIversionRec instead.
+ */
+struct __DRIversionRec {
+ int major; /**< Major version number. */
+ int minor; /**< Minor version number. */
+ int patch; /**< Patch-level. */
+};
+
+/**
+ * Framebuffer information record. Used by libGL to communicate information
+ * about the framebuffer to the driver's \c __driCreateNewScreen function.
+ *
+ * In XFree86, most of this information is derrived from data returned by
+ * calling \c XF86DRIGetDeviceInfo.
+ *
+ * \sa XF86DRIGetDeviceInfo __DRIdisplayRec::createNewScreen
+ * __driUtilCreateNewScreen CallCreateNewScreen
+ *
+ * \bug This structure could be better named.
+ */
+struct __DRIframebufferRec {
+ unsigned char *base; /**< Framebuffer base address in the CPU's
+ * address space. This value is calculated by
+ * calling \c drmMap on the framebuffer handle
+ * returned by \c XF86DRIGetDeviceInfo (or a
+ * similar function).
+ */
+ int size; /**< Framebuffer size, in bytes. */
+ int stride; /**< Number of bytes from one line to the next. */
+ int width; /**< Pixel width of the framebuffer. */
+ int height; /**< Pixel height of the framebuffer. */
+ int dev_priv_size; /**< Size of the driver's dev-priv structure. */
+ void *dev_priv; /**< Pointer to the driver's dev-priv structure. */
+};
+
+
+/**
+ * This extension provides alternative screen, drawable and context
+ * constructors for legacy DRI functionality. This is used in
+ * conjunction with the core extension.
+ */
+#define __DRI_LEGACY "DRI_Legacy"
+#define __DRI_LEGACY_VERSION 1
+
+struct __DRIlegacyExtensionRec {
+ __DRIextension base;
+
+ __DRIscreen *(*createNewScreen)(int screen,
+ const __DRIversion *ddx_version,
+ const __DRIversion *dri_version,
+ const __DRIversion *drm_version,
+ const __DRIframebuffer *frame_buffer,
+ void *pSAREA, int fd,
+ const __DRIextension **extensions,
+ const __DRIconfig ***driver_configs,
+ void *loaderPrivate);
+
+ __DRIdrawable *(*createNewDrawable)(__DRIscreen *screen,
+ const __DRIconfig *config,
+ drm_drawable_t hwDrawable,
+ int renderType, const int *attrs,
+ void *loaderPrivate);
+
+ __DRIcontext *(*createNewContext)(__DRIscreen *screen,
+ const __DRIconfig *config,
+ int render_type,
+ __DRIcontext *shared,
+ drm_context_t hwContext,
+ void *loaderPrivate);
+};
+
+/**
+ * This extension provides alternative screen, drawable and context
+ * constructors for swrast DRI functionality. This is used in
+ * conjunction with the core extension.
+ */
+#define __DRI_SWRAST "DRI_SWRast"
+#define __DRI_SWRAST_VERSION 2
+
+struct __DRIswrastExtensionRec {
+ __DRIextension base;
+
+ __DRIscreen *(*createNewScreen)(int screen,
+ const __DRIextension **extensions,
+ const __DRIconfig ***driver_configs,
+ void *loaderPrivate);
+
+ __DRIdrawable *(*createNewDrawable)(__DRIscreen *screen,
+ const __DRIconfig *config,
+ void *loaderPrivate);
+
+ /* Since version 2 */
+ __DRIcontext *(*createNewContextForAPI)(__DRIscreen *screen,
+ int api,
+ const __DRIconfig *config,
+ __DRIcontext *shared,
+ void *data);
+};
+
+/**
+ * DRI2 Loader extension.
+ */
+#define __DRI_BUFFER_FRONT_LEFT 0
+#define __DRI_BUFFER_BACK_LEFT 1
+#define __DRI_BUFFER_FRONT_RIGHT 2
+#define __DRI_BUFFER_BACK_RIGHT 3
+#define __DRI_BUFFER_DEPTH 4
+#define __DRI_BUFFER_STENCIL 5
+#define __DRI_BUFFER_ACCUM 6
+#define __DRI_BUFFER_FAKE_FRONT_LEFT 7
+#define __DRI_BUFFER_FAKE_FRONT_RIGHT 8
+#define __DRI_BUFFER_DEPTH_STENCIL 9 /**< Only available with DRI2 1.1 */
+
+struct __DRIbufferRec {
+ unsigned int attachment;
+ unsigned int name;
+ unsigned int pitch;
+ unsigned int cpp;
+ unsigned int flags;
+};
+
+#define __DRI_DRI2_LOADER "DRI_DRI2Loader"
+#define __DRI_DRI2_LOADER_VERSION 3
+struct __DRIdri2LoaderExtensionRec {
+ __DRIextension base;
+
+ __DRIbuffer *(*getBuffers)(__DRIdrawable *driDrawable,
+ int *width, int *height,
+ unsigned int *attachments, int count,
+ int *out_count, void *loaderPrivate);
+
+ /**
+ * Flush pending front-buffer rendering
+ *
+ * Any rendering that has been performed to the
+ * \c __DRI_BUFFER_FAKE_FRONT_LEFT will be flushed to the
+ * \c __DRI_BUFFER_FRONT_LEFT.
+ *
+ * \param driDrawable Drawable whose front-buffer is to be flushed
+ * \param loaderPrivate Loader's private data that was previously passed
+ * into __DRIdri2ExtensionRec::createNewDrawable
+ */
+ void (*flushFrontBuffer)(__DRIdrawable *driDrawable, void *loaderPrivate);
+
+
+ /**
+ * Get list of buffers from the server
+ *
+ * Gets a list of buffer for the specified set of attachments. Unlike
+ * \c ::getBuffers, this function takes a list of attachments paired with
+ * opaque \c unsigned \c int value describing the format of the buffer.
+ * It is the responsibility of the caller to know what the service that
+ * allocates the buffers will expect to receive for the format.
+ *
+ * \param driDrawable Drawable whose buffers are being queried.
+ * \param width Output where the width of the buffers is stored.
+ * \param height Output where the height of the buffers is stored.
+ * \param attachments List of pairs of attachment ID and opaque format
+ * requested for the drawable.
+ * \param count Number of attachment / format pairs stored in
+ * \c attachments.
+ * \param loaderPrivate Loader's private data that was previously passed
+ * into __DRIdri2ExtensionRec::createNewDrawable.
+ */
+ __DRIbuffer *(*getBuffersWithFormat)(__DRIdrawable *driDrawable,
+ int *width, int *height,
+ unsigned int *attachments, int count,
+ int *out_count, void *loaderPrivate);
+};
+
+/**
+ * This extension provides alternative screen, drawable and context
+ * constructors for DRI2.
+ */
+#define __DRI_DRI2 "DRI_DRI2"
+#define __DRI_DRI2_VERSION 2
+
+#define __DRI_API_OPENGL 0
+#define __DRI_API_GLES 1
+#define __DRI_API_GLES2 2
+
+struct __DRIdri2ExtensionRec {
+ __DRIextension base;
+
+ __DRIscreen *(*createNewScreen)(int screen, int fd,
+ const __DRIextension **extensions,
+ const __DRIconfig ***driver_configs,
+ void *loaderPrivate);
+
+ __DRIdrawable *(*createNewDrawable)(__DRIscreen *screen,
+ const __DRIconfig *config,
+ void *loaderPrivate);
+
+ __DRIcontext *(*createNewContext)(__DRIscreen *screen,
+ const __DRIconfig *config,
+ __DRIcontext *shared,
+ void *loaderPrivate);
+
+ /* Since version 2 */
+ unsigned int (*getAPIMask)(__DRIscreen *screen);
+
+ __DRIcontext *(*createNewContextForAPI)(__DRIscreen *screen,
+ int api,
+ const __DRIconfig *config,
+ __DRIcontext *shared,
+ void *data);
+
+ __DRIbuffer *(*allocateBuffer)(__DRIscreen *screen,
+ unsigned int attachment,
+ unsigned int format,
+ int width,
+ int height);
+ void (*releaseBuffer)(__DRIscreen *screen,
+ __DRIbuffer *buffer);
+};
+
+
+/**
+ * This extension provides functionality to enable various EGLImage
+ * extensions.
+ */
+#define __DRI_IMAGE "DRI_IMAGE"
+#define __DRI_IMAGE_VERSION 1
+
+/**
+ * These formats correspond to the similarly named MESA_FORMAT_*
+ * tokens, except in the native endian of the CPU. For example, on
+ * little endian __DRI_IMAGE_FORMAT_XRGB8888 corresponds to
+ * MESA_FORMAT_XRGB8888, but MESA_FORMAT_XRGB8888_REV on big endian.
+ */
+#define __DRI_IMAGE_FORMAT_RGB565 0x1001
+#define __DRI_IMAGE_FORMAT_XRGB8888 0x1002
+#define __DRI_IMAGE_FORMAT_ARGB8888 0x1003
+
+#define __DRI_IMAGE_USE_SHARE 0x0001
+#define __DRI_IMAGE_USE_SCANOUT 0x0002
+#define __DRI_IMAGE_USE_CURSOR 0x0004
+
+/**
+ * queryImage attributes
+ */
+
+#define __DRI_IMAGE_ATTRIB_STRIDE 0x2000
+#define __DRI_IMAGE_ATTRIB_HANDLE 0x2001
+#define __DRI_IMAGE_ATTRIB_NAME 0x2002
+
+typedef struct __DRIimageRec __DRIimage;
+typedef struct __DRIimageExtensionRec __DRIimageExtension;
+struct __DRIimageExtensionRec {
+ __DRIextension base;
+
+ __DRIimage *(*createImageFromName)(__DRIscreen *screen,
+ int width, int height, int format,
+ int name, int pitch,
+ void *loaderPrivate);
+
+ __DRIimage *(*createImageFromRenderbuffer)(__DRIcontext *context,
+ int renderbuffer,
+ void *loaderPrivate);
+
+ void (*destroyImage)(__DRIimage *image);
+
+ __DRIimage *(*createImage)(__DRIscreen *screen,
+ int width, int height, int format,
+ unsigned int use,
+ void *loaderPrivate);
+
+ GLboolean (*queryImage)(__DRIimage *image, int attrib, int *value);
+};
+
+
+/**
+ * This extension must be implemented by the loader and passed to the
+ * driver at screen creation time. The EGLImage entry points in the
+ * various client APIs take opaque EGLImage handles and use this
+ * extension to map them to a __DRIimage. At version 1, this
+ * extensions allows mapping EGLImage pointers to __DRIimage pointers,
+ * but future versions could support other EGLImage-like, opaque types
+ * with new lookup functions.
+ */
+#define __DRI_IMAGE_LOOKUP "DRI_IMAGE_LOOKUP"
+#define __DRI_IMAGE_LOOKUP_VERSION 1
+
+typedef struct __DRIimageLookupExtensionRec __DRIimageLookupExtension;
+struct __DRIimageLookupExtensionRec {
+ __DRIextension base;
+
+ __DRIimage *(*lookupEGLImage)(__DRIscreen *screen, void *image,
+ void *loaderPrivate);
+};
+
+/**
+ * This extension allows for common DRI2 options
+ */
+#define __DRI2_CONFIG_QUERY "DRI_CONFIG_QUERY"
+#define __DRI2_CONFIG_QUERY_VERSION 1
+
+typedef struct __DRI2configQueryExtensionRec __DRI2configQueryExtension;
+struct __DRI2configQueryExtensionRec {
+ __DRIextension base;
+
+ int (*configQueryb)(__DRIscreen *screen, const char *var, GLboolean *val);
+ int (*configQueryi)(__DRIscreen *screen, const char *var, GLint *val);
+ int (*configQueryf)(__DRIscreen *screen, const char *var, GLfloat *val);
+};
+#endif
diff --git a/mesalib/include/getopt.h b/mesalib/include/getopt.h
new file mode 100644
index 000000000..695f89061
--- /dev/null
+++ b/mesalib/include/getopt.h
@@ -0,0 +1,128 @@
+/* Declarations for getopt.
+ Copyright (C) 1989, 1990, 1991, 1992, 1993 Free Software Foundation, Inc.
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the
+ Free Software Foundation; either version 2, or (at your option) any
+ later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#ifndef _GETOPT_H
+#define _GETOPT_H 1
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* For communication from `getopt' to the caller.
+ When `getopt' finds an option that takes an argument,
+ the argument value is returned here.
+ Also, when `ordering' is RETURN_IN_ORDER,
+ each non-option ARGV-element is returned here. */
+
+extern char *optarg;
+
+/* Index in ARGV of the next element to be scanned.
+ This is used for communication to and from the caller
+ and for communication between successive calls to `getopt'.
+
+ On entry to `getopt', zero means this is the first call; initialize.
+
+ When `getopt' returns EOF, this is the index of the first of the
+ non-option elements that the caller should itself scan.
+
+ Otherwise, `optind' communicates from one call to the next
+ how much of ARGV has been scanned so far. */
+
+extern int optind;
+
+/* Callers store zero here to inhibit the error message `getopt' prints
+ for unrecognized options. */
+
+extern int opterr;
+
+ /* Set to an option character which was unrecognized. */
+
+ extern int optopt;
+
+/* Describe the long-named options requested by the application.
+ The LONG_OPTIONS argument to getopt_long or getopt_long_only is a vector
+ of `struct option' terminated by an element containing a name which is
+ zero.
+
+ The field `has_arg' is:
+ no_argument (or 0) if the option does not take an argument,
+ required_argument (or 1) if the option requires an argument,
+ optional_argument (or 2) if the option takes an optional argument.
+
+ If the field `flag' is not NULL, it points to a variable that is set
+ to the value given in the field `val' when the option is found, but
+ left unchanged if the option is not found.
+
+ To have a long-named option do something other than set an `int' to
+ a compiled-in constant, such as set a value from `optarg', set the
+ option's `flag' field to zero and its `val' field to a nonzero
+ value (the equivalent single-letter option character, if there is
+ one). For long options that have a zero `flag' field, `getopt'
+ returns the contents of the `val' field. */
+
+struct option
+{
+#if __STDC__
+ const char *name;
+#else
+ char *name;
+#endif
+ /* has_arg can't be an enum because some compilers complain about
+ type mismatches in all the code that assumes it is an int. */
+ int has_arg;
+ int *flag;
+ int val;
+};
+
+/* Names for the values of the `has_arg' field of `struct option'. */
+
+#define no_argument 0
+#define required_argument 1
+#define optional_argument 2
+
+#if __STDC__
+#if defined(__GNU_LIBRARY__)
+/* Many other libraries have conflicting prototypes for getopt, with
+ differences in the consts, in stdlib.h. To avoid compilation
+ errors, only prototype getopt for the GNU C library. */
+extern int getopt (int argc, char *const *argv, const char *shortopts);
+#else /* not __GNU_LIBRARY__ */
+extern int getopt ();
+#endif /* not __GNU_LIBRARY__ */
+extern int getopt_long (int argc, char *const *argv, const char *shortopts,
+ const struct option *longopts, int *longind);
+extern int getopt_long_only (int argc, char *const *argv,
+ const char *shortopts,
+ const struct option *longopts, int *longind);
+
+/* Internal only. Users should not call this directly. */
+extern int _getopt_internal (int argc, char *const *argv,
+ const char *shortopts,
+ const struct option *longopts, int *longind,
+ int long_only);
+#else /* not __STDC__ */
+extern int getopt ();
+extern int getopt_long ();
+extern int getopt_long_only ();
+
+extern int _getopt_internal ();
+#endif /* not __STDC__ */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _GETOPT_H */
diff --git a/mesalib/scons/custom.py b/mesalib/scons/custom.py
index a2c690f65..106ffcfd1 100644
--- a/mesalib/scons/custom.py
+++ b/mesalib/scons/custom.py
@@ -1,172 +1,172 @@
-"""custom
-
-Custom builders and methods.
-
-"""
-
-#
-# Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
-# All Rights Reserved.
-#
-# Permission is hereby granted, free of charge, to any person obtaining a
-# copy of this software and associated documentation files (the
-# "Software"), to deal in the Software without restriction, including
-# without limitation the rights to use, copy, modify, merge, publish,
-# distribute, sub license, and/or sell copies of the Software, and to
-# permit persons to whom the Software is furnished to do so, subject to
-# the following conditions:
-#
-# The above copyright notice and this permission notice (including the
-# next paragraph) shall be included in all copies or substantial portions
-# of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
-# IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
-# ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-#
-
-
-import os
-import os.path
-import re
-
-import SCons.Action
-import SCons.Builder
-import SCons.Scanner
-
-import fixes
-
-
-def quietCommandLines(env):
- # Quiet command lines
- # See also http://www.scons.org/wiki/HidingCommandLinesInOutput
- env['ASCOMSTR'] = " Assembling $SOURCE ..."
- env['ASPPCOMSTR'] = " Assembling $SOURCE ..."
- env['CCCOMSTR'] = " Compiling $SOURCE ..."
- env['SHCCCOMSTR'] = " Compiling $SOURCE ..."
- env['CXXCOMSTR'] = " Compiling $SOURCE ..."
- env['SHCXXCOMSTR'] = " Compiling $SOURCE ..."
- env['ARCOMSTR'] = " Archiving $TARGET ..."
- env['RANLIBCOMSTR'] = " Indexing $TARGET ..."
- env['LINKCOMSTR'] = " Linking $TARGET ..."
- env['SHLINKCOMSTR'] = " Linking $TARGET ..."
- env['LDMODULECOMSTR'] = " Linking $TARGET ..."
- env['SWIGCOMSTR'] = " Generating $TARGET ..."
- env['LEXCOMSTR'] = " Generating $TARGET ..."
- env['YACCCOMSTR'] = " Generating $TARGET ..."
- env['CODEGENCOMSTR'] = " Generating $TARGET ..."
- env['INSTALLSTR'] = " Installing $TARGET ..."
-
-
-def createConvenienceLibBuilder(env):
- """This is a utility function that creates the ConvenienceLibrary
- Builder in an Environment if it is not there already.
-
- If it is already there, we return the existing one.
-
- Based on the stock StaticLibrary and SharedLibrary builders.
- """
-
- try:
- convenience_lib = env['BUILDERS']['ConvenienceLibrary']
- except KeyError:
- action_list = [ SCons.Action.Action("$ARCOM", "$ARCOMSTR") ]
- if env.Detect('ranlib'):
- ranlib_action = SCons.Action.Action("$RANLIBCOM", "$RANLIBCOMSTR")
- action_list.append(ranlib_action)
-
- convenience_lib = SCons.Builder.Builder(action = action_list,
- emitter = '$LIBEMITTER',
- prefix = '$LIBPREFIX',
- suffix = '$LIBSUFFIX',
- src_suffix = '$SHOBJSUFFIX',
- src_builder = 'SharedObject')
- env['BUILDERS']['ConvenienceLibrary'] = convenience_lib
-
- return convenience_lib
-
-
-# TODO: handle import statements with multiple modules
-# TODO: handle from import statements
-import_re = re.compile(r'^import\s+(\S+)$', re.M)
-
-def python_scan(node, env, path):
- # http://www.scons.org/doc/0.98.5/HTML/scons-user/c2781.html#AEN2789
- contents = node.get_contents()
- source_dir = node.get_dir()
- imports = import_re.findall(contents)
- results = []
- for imp in imports:
- for dir in path:
- file = os.path.join(str(dir), imp.replace('.', os.sep) + '.py')
- if os.path.exists(file):
- results.append(env.File(file))
- break
- file = os.path.join(str(dir), imp.replace('.', os.sep), '__init__.py')
- if os.path.exists(file):
- results.append(env.File(file))
- break
- return results
-
-python_scanner = SCons.Scanner.Scanner(function = python_scan, skeys = ['.py'])
-
-
-def code_generate(env, script, target, source, command):
- """Method to simplify code generation via python scripts.
-
- http://www.scons.org/wiki/UsingCodeGenerators
- http://www.scons.org/doc/0.98.5/HTML/scons-user/c2768.html
- """
-
- # We're generating code using Python scripts, so we have to be
- # careful with our scons elements. This entry represents
- # the generator file *in the source directory*.
- script_src = env.File(script).srcnode()
-
- # This command creates generated code *in the build directory*.
- command = command.replace('$SCRIPT', script_src.path)
- action = SCons.Action.Action(command, "$CODEGENCOMSTR")
- code = env.Command(target, source, action)
-
- # Explicitly mark that the generated code depends on the generator,
- # and on implicitly imported python modules
- path = (script_src.get_dir(),)
- deps = [script_src]
- deps += script_src.get_implicit_deps(env, python_scanner, path)
- env.Depends(code, deps)
-
- # Running the Python script causes .pyc files to be generated in the
- # source directory. When we clean up, they should go too. So add side
- # effects for .pyc files
- for dep in deps:
- pyc = env.File(str(dep) + 'c')
- env.SideEffect(pyc, code)
-
- return code
-
-
-def createCodeGenerateMethod(env):
- env.Append(SCANNERS = python_scanner)
- env.AddMethod(code_generate, 'CodeGenerate')
-
-
-def generate(env):
- """Common environment generation code"""
-
- if env.get('quiet', True):
- quietCommandLines(env)
-
- # Custom builders and methods
- createConvenienceLibBuilder(env)
- createCodeGenerateMethod(env)
-
- # for debugging
- #print env.Dump()
-
-
-def exists(env):
- return 1
+"""custom
+
+Custom builders and methods.
+
+"""
+
+#
+# Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
+# All Rights Reserved.
+#
+# Permission is hereby granted, free of charge, to any person obtaining a
+# copy of this software and associated documentation files (the
+# "Software"), to deal in the Software without restriction, including
+# without limitation the rights to use, copy, modify, merge, publish,
+# distribute, sub license, and/or sell copies of the Software, and to
+# permit persons to whom the Software is furnished to do so, subject to
+# the following conditions:
+#
+# The above copyright notice and this permission notice (including the
+# next paragraph) shall be included in all copies or substantial portions
+# of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+# IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
+# ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+#
+
+
+import os
+import os.path
+import re
+
+import SCons.Action
+import SCons.Builder
+import SCons.Scanner
+
+import fixes
+
+
+def quietCommandLines(env):
+ # Quiet command lines
+ # See also http://www.scons.org/wiki/HidingCommandLinesInOutput
+ env['ASCOMSTR'] = " Assembling $SOURCE ..."
+ env['ASPPCOMSTR'] = " Assembling $SOURCE ..."
+ env['CCCOMSTR'] = " Compiling $SOURCE ..."
+ env['SHCCCOMSTR'] = " Compiling $SOURCE ..."
+ env['CXXCOMSTR'] = " Compiling $SOURCE ..."
+ env['SHCXXCOMSTR'] = " Compiling $SOURCE ..."
+ env['ARCOMSTR'] = " Archiving $TARGET ..."
+ env['RANLIBCOMSTR'] = " Indexing $TARGET ..."
+ env['LINKCOMSTR'] = " Linking $TARGET ..."
+ env['SHLINKCOMSTR'] = " Linking $TARGET ..."
+ env['LDMODULECOMSTR'] = " Linking $TARGET ..."
+ env['SWIGCOMSTR'] = " Generating $TARGET ..."
+ env['LEXCOMSTR'] = " Generating $TARGET ..."
+ env['YACCCOMSTR'] = " Generating $TARGET ..."
+ env['CODEGENCOMSTR'] = " Generating $TARGET ..."
+ env['INSTALLSTR'] = " Installing $TARGET ..."
+
+
+def createConvenienceLibBuilder(env):
+ """This is a utility function that creates the ConvenienceLibrary
+ Builder in an Environment if it is not there already.
+
+ If it is already there, we return the existing one.
+
+ Based on the stock StaticLibrary and SharedLibrary builders.
+ """
+
+ try:
+ convenience_lib = env['BUILDERS']['ConvenienceLibrary']
+ except KeyError:
+ action_list = [ SCons.Action.Action("$ARCOM", "$ARCOMSTR") ]
+ if env.Detect('ranlib'):
+ ranlib_action = SCons.Action.Action("$RANLIBCOM", "$RANLIBCOMSTR")
+ action_list.append(ranlib_action)
+
+ convenience_lib = SCons.Builder.Builder(action = action_list,
+ emitter = '$LIBEMITTER',
+ prefix = '$LIBPREFIX',
+ suffix = '$LIBSUFFIX',
+ src_suffix = '$SHOBJSUFFIX',
+ src_builder = 'SharedObject')
+ env['BUILDERS']['ConvenienceLibrary'] = convenience_lib
+
+ return convenience_lib
+
+
+# TODO: handle import statements with multiple modules
+# TODO: handle from import statements
+import_re = re.compile(r'^import\s+(\S+)$', re.M)
+
+def python_scan(node, env, path):
+ # http://www.scons.org/doc/0.98.5/HTML/scons-user/c2781.html#AEN2789
+ contents = node.get_contents()
+ source_dir = node.get_dir()
+ imports = import_re.findall(contents)
+ results = []
+ for imp in imports:
+ for dir in path:
+ file = os.path.join(str(dir), imp.replace('.', os.sep) + '.py')
+ if os.path.exists(file):
+ results.append(env.File(file))
+ break
+ file = os.path.join(str(dir), imp.replace('.', os.sep), '__init__.py')
+ if os.path.exists(file):
+ results.append(env.File(file))
+ break
+ return results
+
+python_scanner = SCons.Scanner.Scanner(function = python_scan, skeys = ['.py'])
+
+
+def code_generate(env, script, target, source, command):
+ """Method to simplify code generation via python scripts.
+
+ http://www.scons.org/wiki/UsingCodeGenerators
+ http://www.scons.org/doc/0.98.5/HTML/scons-user/c2768.html
+ """
+
+ # We're generating code using Python scripts, so we have to be
+ # careful with our scons elements. This entry represents
+ # the generator file *in the source directory*.
+ script_src = env.File(script).srcnode()
+
+ # This command creates generated code *in the build directory*.
+ command = command.replace('$SCRIPT', script_src.path)
+ action = SCons.Action.Action(command, "$CODEGENCOMSTR")
+ code = env.Command(target, source, action)
+
+ # Explicitly mark that the generated code depends on the generator,
+ # and on implicitly imported python modules
+ path = (script_src.get_dir(),)
+ deps = [script_src]
+ deps += script_src.get_implicit_deps(env, python_scanner, path)
+ env.Depends(code, deps)
+
+ # Running the Python script causes .pyc files to be generated in the
+ # source directory. When we clean up, they should go too. So add side
+ # effects for .pyc files
+ for dep in deps:
+ pyc = env.File(str(dep) + 'c')
+ env.SideEffect(pyc, code)
+
+ return code
+
+
+def createCodeGenerateMethod(env):
+ env.Append(SCANNERS = python_scanner)
+ env.AddMethod(code_generate, 'CodeGenerate')
+
+
+def generate(env):
+ """Common environment generation code"""
+
+ if env.get('quiet', True):
+ quietCommandLines(env)
+
+ # Custom builders and methods
+ createConvenienceLibBuilder(env)
+ createCodeGenerateMethod(env)
+
+ # for debugging
+ #print env.Dump()
+
+
+def exists(env):
+ return 1
diff --git a/mesalib/scons/gallium.py b/mesalib/scons/gallium.py
index a94bf7364..002560b4e 100644
--- a/mesalib/scons/gallium.py
+++ b/mesalib/scons/gallium.py
@@ -1,624 +1,624 @@
-"""gallium
-
-Frontend-tool for Gallium3D architecture.
-
-"""
-
-#
-# Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
-# All Rights Reserved.
-#
-# Permission is hereby granted, free of charge, to any person obtaining a
-# copy of this software and associated documentation files (the
-# "Software"), to deal in the Software without restriction, including
-# without limitation the rights to use, copy, modify, merge, publish,
-# distribute, sub license, and/or sell copies of the Software, and to
-# permit persons to whom the Software is furnished to do so, subject to
-# the following conditions:
-#
-# The above copyright notice and this permission notice (including the
-# next paragraph) shall be included in all copies or substantial portions
-# of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
-# IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
-# ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-#
-
-
-import distutils.version
-import os
-import os.path
-import re
-import subprocess
-import platform as _platform
-
-import SCons.Action
-import SCons.Builder
-import SCons.Scanner
-
-
-def symlink(target, source, env):
- target = str(target[0])
- source = str(source[0])
- if os.path.islink(target) or os.path.exists(target):
- os.remove(target)
- os.symlink(os.path.basename(source), target)
-
-def install(env, source, subdir):
- target_dir = os.path.join(env.Dir('#.').srcnode().abspath, env['build_dir'], subdir)
- return env.Install(target_dir, source)
-
-def install_program(env, source):
- return install(env, source, 'bin')
-
-def install_shared_library(env, sources, version = ()):
- targets = []
- install_dir = os.path.join(env.Dir('#.').srcnode().abspath, env['build_dir'])
- version = tuple(map(str, version))
- if env['SHLIBSUFFIX'] == '.dll':
- dlls = env.FindIxes(sources, 'SHLIBPREFIX', 'SHLIBSUFFIX')
- targets += install(env, dlls, 'bin')
- libs = env.FindIxes(sources, 'LIBPREFIX', 'LIBSUFFIX')
- targets += install(env, libs, 'lib')
- else:
- for source in sources:
- target_dir = os.path.join(install_dir, 'lib')
- target_name = '.'.join((str(source),) + version)
- last = env.InstallAs(os.path.join(target_dir, target_name), source)
- targets += last
- while len(version):
- version = version[:-1]
- target_name = '.'.join((str(source),) + version)
- action = SCons.Action.Action(symlink, " Symlinking $TARGET ...")
- last = env.Command(os.path.join(target_dir, target_name), last, action)
- targets += last
- return targets
-
-
-def createInstallMethods(env):
- env.AddMethod(install_program, 'InstallProgram')
- env.AddMethod(install_shared_library, 'InstallSharedLibrary')
-
-
-def num_jobs():
- try:
- return int(os.environ['NUMBER_OF_PROCESSORS'])
- except (ValueError, KeyError):
- pass
-
- try:
- return os.sysconf('SC_NPROCESSORS_ONLN')
- except (ValueError, OSError, AttributeError):
- pass
-
- try:
- return int(os.popen2("sysctl -n hw.ncpu")[1].read())
- except ValueError:
- pass
-
- return 1
-
-
-def pkg_config_modules(env, name, modules):
- '''Simple wrapper for pkg-config.'''
-
- env[name] = False
-
- if env['platform'] == 'windows':
- return
-
- if not env.Detect('pkg-config'):
- return
-
- if subprocess.call(["pkg-config", "--exists", ' '.join(modules)]) != 0:
- return
-
- # Put -I and -L flags directly into the environment, as these don't affect
- # the compilation of targets that do not use them
- try:
- env.ParseConfig('pkg-config --cflags-only-I --libs-only-L ' + ' '.join(modules))
- except OSError:
- return
-
- # Other flags may affect the compilation of unrelated targets, so store
- # them with a prefix, (e.g., XXX_CFLAGS, XXX_LIBS, etc)
- try:
- flags = env.ParseFlags('!pkg-config --cflags-only-other --libs-only-l --libs-only-other ' + ' '.join(modules))
- except OSError:
- return
- prefix = name.upper() + '_'
- for flag_name, flag_value in flags.iteritems():
- env[prefix + flag_name] = flag_value
-
- env[name] = True
-
-
-
-def generate(env):
- """Common environment generation code"""
-
- # Tell tools which machine to compile for
- env['TARGET_ARCH'] = env['machine']
- env['MSVS_ARCH'] = env['machine']
-
- # Toolchain
- platform = env['platform']
- if env['toolchain'] == 'default':
- if platform == 'winddk':
- env['toolchain'] = 'winddk'
- elif platform == 'wince':
- env['toolchain'] = 'wcesdk'
- env.Tool(env['toolchain'])
-
- # Allow override compiler and specify additional flags from environment
- if os.environ.has_key('CC'):
- env['CC'] = os.environ['CC']
- # Update CCVERSION to match
- pipe = SCons.Action._subproc(env, [env['CC'], '--version'],
- stdin = 'devnull',
- stderr = 'devnull',
- stdout = subprocess.PIPE)
- if pipe.wait() == 0:
- line = pipe.stdout.readline()
- match = re.search(r'[0-9]+(\.[0-9]+)+', line)
- if match:
- env['CCVERSION'] = match.group(0)
- if os.environ.has_key('CFLAGS'):
- env['CCFLAGS'] += SCons.Util.CLVar(os.environ['CFLAGS'])
- if os.environ.has_key('CXX'):
- env['CXX'] = os.environ['CXX']
- if os.environ.has_key('CXXFLAGS'):
- env['CXXFLAGS'] += SCons.Util.CLVar(os.environ['CXXFLAGS'])
- if os.environ.has_key('LDFLAGS'):
- env['LINKFLAGS'] += SCons.Util.CLVar(os.environ['LDFLAGS'])
-
- env['gcc'] = 'gcc' in os.path.basename(env['CC']).split('-')
- env['msvc'] = env['CC'] == 'cl'
-
- if env['msvc'] and env['toolchain'] == 'default' and env['machine'] == 'x86_64':
- # MSVC x64 support is broken in earlier versions of scons
- env.EnsurePythonVersion(2, 0)
-
- # shortcuts
- machine = env['machine']
- platform = env['platform']
- x86 = env['machine'] == 'x86'
- ppc = env['machine'] == 'ppc'
- gcc = env['gcc']
- msvc = env['msvc']
-
- # Determine whether we are cross compiling; in particular, whether we need
- # to compile code generators with a different compiler as the target code.
- host_platform = _platform.system().lower()
- if host_platform.startswith('cygwin'):
- host_platform = 'cygwin'
- host_machine = os.environ.get('PROCESSOR_ARCHITEW6432', os.environ.get('PROCESSOR_ARCHITECTURE', _platform.machine()))
- host_machine = {
- 'x86': 'x86',
- 'i386': 'x86',
- 'i486': 'x86',
- 'i586': 'x86',
- 'i686': 'x86',
- 'ppc' : 'ppc',
- 'AMD64': 'x86_64',
- 'x86_64': 'x86_64',
- }.get(host_machine, 'generic')
- env['crosscompile'] = platform != host_platform
- if machine == 'x86_64' and host_machine != 'x86_64':
- env['crosscompile'] = True
- env['hostonly'] = False
-
- # Backwards compatability with the debug= profile= options
- if env['build'] == 'debug':
- if not env['debug']:
- print 'scons: warning: debug option is deprecated and will be removed eventually; use instead'
- print
- print ' scons build=release'
- print
- env['build'] = 'release'
- if env['profile']:
- print 'scons: warning: profile option is deprecated and will be removed eventually; use instead'
- print
- print ' scons build=profile'
- print
- env['build'] = 'profile'
- if False:
- # Enforce SConscripts to use the new build variable
- env.popitem('debug')
- env.popitem('profile')
- else:
- # Backwards portability with older sconscripts
- if env['build'] in ('debug', 'checked'):
- env['debug'] = True
- env['profile'] = False
- if env['build'] == 'profile':
- env['debug'] = False
- env['profile'] = True
- if env['build'] == 'release':
- env['debug'] = False
- env['profile'] = False
-
- # Put build output in a separate dir, which depends on the current
- # configuration. See also http://www.scons.org/wiki/AdvancedBuildExample
- build_topdir = 'build'
- build_subdir = env['platform']
- if env['machine'] != 'generic':
- build_subdir += '-' + env['machine']
- if env['build'] != 'release':
- build_subdir += '-' + env['build']
- build_dir = os.path.join(build_topdir, build_subdir)
- # Place the .sconsign file in the build dir too, to avoid issues with
- # different scons versions building the same source file
- env['build_dir'] = build_dir
- env.SConsignFile(os.path.join(build_dir, '.sconsign'))
- if 'SCONS_CACHE_DIR' in os.environ:
- print 'scons: Using build cache in %s.' % (os.environ['SCONS_CACHE_DIR'],)
- env.CacheDir(os.environ['SCONS_CACHE_DIR'])
- env['CONFIGUREDIR'] = os.path.join(build_dir, 'conf')
- env['CONFIGURELOG'] = os.path.join(os.path.abspath(build_dir), 'config.log')
-
- # Parallel build
- if env.GetOption('num_jobs') <= 1:
- env.SetOption('num_jobs', num_jobs())
-
- env.Decider('MD5-timestamp')
- env.SetOption('max_drift', 60)
-
- # C preprocessor options
- cppdefines = []
- if env['build'] in ('debug', 'checked'):
- cppdefines += ['DEBUG']
- else:
- cppdefines += ['NDEBUG']
- if env['build'] == 'profile':
- cppdefines += ['PROFILE']
- if platform == 'windows':
- cppdefines += [
- 'WIN32',
- '_WINDOWS',
- #'_UNICODE',
- #'UNICODE',
- # http://msdn.microsoft.com/en-us/library/aa383745.aspx
- ('_WIN32_WINNT', '0x0601'),
- ('WINVER', '0x0601'),
- ]
- if msvc and env['toolchain'] != 'winddk':
- cppdefines += [
- 'VC_EXTRALEAN',
- '_USE_MATH_DEFINES',
- '_CRT_SECURE_NO_WARNINGS',
- '_CRT_SECURE_NO_DEPRECATE',
- '_SCL_SECURE_NO_WARNINGS',
- '_SCL_SECURE_NO_DEPRECATE',
- ]
- if env['build'] in ('debug', 'checked'):
- cppdefines += ['_DEBUG']
- if env['toolchain'] == 'winddk':
- # Mimic WINDDK's builtin flags. See also:
- # - WINDDK's bin/makefile.new i386mk.inc for more info.
- # - buildchk_wxp_x86.log files, generated by the WINDDK's build
- # - http://alter.org.ua/docs/nt_kernel/vc8_proj/
- if machine == 'x86':
- cppdefines += ['_X86_', 'i386']
- if machine == 'x86_64':
- cppdefines += ['_AMD64_', 'AMD64']
- if platform == 'winddk':
- cppdefines += [
- 'STD_CALL',
- ('CONDITION_HANDLING', '1'),
- ('NT_INST', '0'),
- ('WIN32', '100'),
- ('_NT1X_', '100'),
- ('WINNT', '1'),
- ('_WIN32_WINNT', '0x0501'), # minimum required OS version
- ('WINVER', '0x0501'),
- ('_WIN32_IE', '0x0603'),
- ('WIN32_LEAN_AND_MEAN', '1'),
- ('DEVL', '1'),
- ('__BUILDMACHINE__', 'WinDDK'),
- ('FPO', '0'),
- ]
- if env['build'] in ('debug', 'checked'):
- cppdefines += [('DBG', 1)]
- if platform == 'wince':
- cppdefines += [
- '_CRT_SECURE_NO_DEPRECATE',
- '_USE_32BIT_TIME_T',
- 'UNICODE',
- '_UNICODE',
- ('UNDER_CE', '600'),
- ('_WIN32_WCE', '0x600'),
- 'WINCEOEM',
- 'WINCEINTERNAL',
- 'WIN32',
- 'STRICT',
- 'x86',
- '_X86_',
- 'INTERNATIONAL',
- ('INTLMSG_CODEPAGE', '1252'),
- ]
- if platform == 'windows':
- cppdefines += ['PIPE_SUBSYSTEM_WINDOWS_USER']
- if platform == 'winddk':
- cppdefines += ['PIPE_SUBSYSTEM_WINDOWS_DISPLAY']
- if platform == 'wince':
- cppdefines += ['PIPE_SUBSYSTEM_WINDOWS_CE']
- cppdefines += ['PIPE_SUBSYSTEM_WINDOWS_CE_OGL']
- if platform == 'embedded':
- cppdefines += ['PIPE_OS_EMBEDDED']
- env.Append(CPPDEFINES = cppdefines)
-
- # C compiler options
- cflags = [] # C
- cxxflags = [] # C++
- ccflags = [] # C & C++
- if gcc:
- ccversion = env['CCVERSION']
- if env['build'] == 'debug':
- ccflags += ['-O0']
- elif ccversion.startswith('4.2.'):
- # gcc 4.2.x optimizer is broken
- print "warning: gcc 4.2.x optimizer is broken -- disabling optimizations"
- ccflags += ['-O0']
- else:
- ccflags += ['-O3']
- ccflags += ['-g3']
- if env['build'] in ('checked', 'profile'):
- # See http://code.google.com/p/jrfonseca/wiki/Gprof2Dot#Which_options_should_I_pass_to_gcc_when_compiling_for_profiling?
- ccflags += [
- '-fno-omit-frame-pointer',
- '-fno-optimize-sibling-calls',
- ]
- if env['machine'] == 'x86':
- ccflags += [
- '-m32',
- #'-march=pentium4',
- ]
- if distutils.version.LooseVersion(ccversion) >= distutils.version.LooseVersion('4.2') \
- and (platform != 'windows' or env['build'] == 'debug' or True):
- # NOTE: We need to ensure stack is realigned given that we
- # produce shared objects, and have no control over the stack
- # alignment policy of the application. Therefore we need
- # -mstackrealign ore -mincoming-stack-boundary=2.
- #
- # XXX: -O and -mstackrealign causes stack corruption on MinGW
- #
- # XXX: We could have SSE without -mstackrealign if we always used
- # __attribute__((force_align_arg_pointer)), but that's not
- # always the case.
- ccflags += [
- '-mstackrealign', # ensure stack is aligned
- '-mmmx', '-msse', '-msse2', # enable SIMD intrinsics
- #'-mfpmath=sse',
- ]
- if platform in ['windows', 'darwin']:
- # Workaround http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37216
- ccflags += ['-fno-common']
- if env['machine'] == 'x86_64':
- ccflags += ['-m64']
- if platform == 'darwin':
- ccflags += ['-fno-common']
- # See also:
- # - http://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html
- ccflags += [
- '-Wall',
- '-Wno-long-long',
- '-ffast-math',
- '-fmessage-length=0', # be nice to Eclipse
- ]
- cflags += [
- '-Wmissing-prototypes',
- '-std=gnu99',
- ]
- if distutils.version.LooseVersion(ccversion) >= distutils.version.LooseVersion('4.0'):
- ccflags += [
- '-Wmissing-field-initializers',
- ]
- if distutils.version.LooseVersion(ccversion) >= distutils.version.LooseVersion('4.2'):
- ccflags += [
- '-Werror=pointer-arith',
- ]
- cflags += [
- '-Werror=declaration-after-statement',
- ]
- if msvc:
- # See also:
- # - http://msdn.microsoft.com/en-us/library/19z1t1wy.aspx
- # - cl /?
- if env['build'] == 'debug':
- ccflags += [
- '/Od', # disable optimizations
- '/Oi', # enable intrinsic functions
- '/Oy-', # disable frame pointer omission
- ]
- else:
- ccflags += [
- '/O2', # optimize for speed
- ]
- if env['build'] == 'release':
- ccflags += [
- '/GL', # enable whole program optimization
- ]
- else:
- ccflags += [
- '/GL-', # disable whole program optimization
- ]
- ccflags += [
- '/fp:fast', # fast floating point
- '/W3', # warning level
- #'/Wp64', # enable 64 bit porting warnings
- ]
- if env['machine'] == 'x86':
- ccflags += [
- #'/arch:SSE2', # use the SSE2 instructions
- ]
- if platform == 'windows':
- ccflags += [
- # TODO
- ]
- if platform == 'winddk':
- ccflags += [
- '/Zl', # omit default library name in .OBJ
- '/Zp8', # 8bytes struct member alignment
- '/Gy', # separate functions for linker
- '/Gm-', # disable minimal rebuild
- '/WX', # treat warnings as errors
- '/Gz', # __stdcall Calling convention
- '/GX-', # disable C++ EH
- '/GR-', # disable C++ RTTI
- '/GF', # enable read-only string pooling
- '/G6', # optimize for PPro, P-II, P-III
- '/Ze', # enable extensions
- '/Gi-', # disable incremental compilation
- '/QIfdiv-', # disable Pentium FDIV fix
- '/hotpatch', # prepares an image for hotpatching.
- #'/Z7', #enable old-style debug info
- ]
- if platform == 'wince':
- # See also C:\WINCE600\public\common\oak\misc\makefile.def
- ccflags += [
- '/Zl', # omit default library name in .OBJ
- '/GF', # enable read-only string pooling
- '/GR-', # disable C++ RTTI
- '/GS', # enable security checks
- # Allow disabling language conformance to maintain backward compat
- #'/Zc:wchar_t-', # don't force wchar_t as native type, instead of typedef
- #'/Zc:forScope-', # don't enforce Standard C++ for scoping rules
- #'/wd4867',
- #'/wd4430',
- #'/MT',
- #'/U_MT',
- ]
- # Automatic pdb generation
- # See http://scons.tigris.org/issues/show_bug.cgi?id=1656
- env.EnsureSConsVersion(0, 98, 0)
- env['PDB'] = '${TARGET.base}.pdb'
- env.Append(CCFLAGS = ccflags)
- env.Append(CFLAGS = cflags)
- env.Append(CXXFLAGS = cxxflags)
-
- if env['platform'] == 'windows' and msvc:
- # Choose the appropriate MSVC CRT
- # http://msdn.microsoft.com/en-us/library/2kzt1wy3.aspx
- if env['build'] in ('debug', 'checked'):
- env.Append(CCFLAGS = ['/MTd'])
- env.Append(SHCCFLAGS = ['/LDd'])
- else:
- env.Append(CCFLAGS = ['/MT'])
- env.Append(SHCCFLAGS = ['/LD'])
-
- # Assembler options
- if gcc:
- if env['machine'] == 'x86':
- env.Append(ASFLAGS = ['-m32'])
- if env['machine'] == 'x86_64':
- env.Append(ASFLAGS = ['-m64'])
-
- # Linker options
- linkflags = []
- shlinkflags = []
- if gcc:
- if env['machine'] == 'x86':
- linkflags += ['-m32']
- if env['machine'] == 'x86_64':
- linkflags += ['-m64']
- if env['platform'] not in ('darwin'):
- shlinkflags += [
- '-Wl,-Bsymbolic',
- ]
- # Handle circular dependencies in the libraries
- if env['platform'] in ('darwin'):
- pass
- else:
- env['_LIBFLAGS'] = '-Wl,--start-group ' + env['_LIBFLAGS'] + ' -Wl,--end-group'
- if msvc:
- if env['build'] == 'release':
- # enable Link-time Code Generation
- linkflags += ['/LTCG']
- env.Append(ARFLAGS = ['/LTCG'])
- if platform == 'windows' and msvc:
- # See also:
- # - http://msdn2.microsoft.com/en-us/library/y0zzbyt4.aspx
- linkflags += [
- '/fixed:no',
- '/incremental:no',
- ]
- if platform == 'winddk':
- linkflags += [
- '/merge:_PAGE=PAGE',
- '/merge:_TEXT=.text',
- '/section:INIT,d',
- '/opt:ref',
- '/opt:icf',
- '/ignore:4198,4010,4037,4039,4065,4070,4078,4087,4089,4221',
- '/incremental:no',
- '/fullbuild',
- '/release',
- '/nodefaultlib',
- '/wx',
- '/debug',
- '/debugtype:cv',
- '/version:5.1',
- '/osversion:5.1',
- '/functionpadmin:5',
- '/safeseh',
- '/pdbcompress',
- '/stack:0x40000,0x1000',
- '/driver',
- '/align:0x80',
- '/subsystem:native,5.01',
- '/base:0x10000',
-
- '/entry:DrvEnableDriver',
- ]
- if env['build'] != 'release':
- linkflags += [
- '/MAP', # http://msdn.microsoft.com/en-us/library/k7xkk3e2.aspx
- ]
- if platform == 'wince':
- linkflags += [
- '/nodefaultlib',
- #'/incremental:no',
- #'/fullbuild',
- '/entry:_DllMainCRTStartup',
- ]
- env.Append(LINKFLAGS = linkflags)
- env.Append(SHLINKFLAGS = shlinkflags)
-
- # We have C++ in several libraries, so always link with the C++ compiler
- if env['gcc']:
- env['LINK'] = env['CXX']
-
- # Default libs
- env.Append(LIBS = [])
-
- # Load tools
- env.Tool('lex')
- env.Tool('yacc')
- if env['llvm']:
- env.Tool('llvm')
-
- pkg_config_modules(env, 'x11', ['x11', 'xext'])
- pkg_config_modules(env, 'drm', ['libdrm'])
- pkg_config_modules(env, 'drm_intel', ['libdrm_intel'])
- pkg_config_modules(env, 'drm_radeon', ['libdrm_radeon'])
- pkg_config_modules(env, 'xorg', ['xorg-server'])
- pkg_config_modules(env, 'kms', ['libkms'])
-
- env['dri'] = env['x11'] and env['drm']
-
- # Custom builders and methods
- env.Tool('custom')
- createInstallMethods(env)
-
- # for debugging
- #print env.Dump()
-
-
-def exists(env):
- return 1
+"""gallium
+
+Frontend-tool for Gallium3D architecture.
+
+"""
+
+#
+# Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
+# All Rights Reserved.
+#
+# Permission is hereby granted, free of charge, to any person obtaining a
+# copy of this software and associated documentation files (the
+# "Software"), to deal in the Software without restriction, including
+# without limitation the rights to use, copy, modify, merge, publish,
+# distribute, sub license, and/or sell copies of the Software, and to
+# permit persons to whom the Software is furnished to do so, subject to
+# the following conditions:
+#
+# The above copyright notice and this permission notice (including the
+# next paragraph) shall be included in all copies or substantial portions
+# of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+# IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
+# ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+#
+
+
+import distutils.version
+import os
+import os.path
+import re
+import subprocess
+import platform as _platform
+
+import SCons.Action
+import SCons.Builder
+import SCons.Scanner
+
+
+def symlink(target, source, env):
+ target = str(target[0])
+ source = str(source[0])
+ if os.path.islink(target) or os.path.exists(target):
+ os.remove(target)
+ os.symlink(os.path.basename(source), target)
+
+def install(env, source, subdir):
+ target_dir = os.path.join(env.Dir('#.').srcnode().abspath, env['build_dir'], subdir)
+ return env.Install(target_dir, source)
+
+def install_program(env, source):
+ return install(env, source, 'bin')
+
+def install_shared_library(env, sources, version = ()):
+ targets = []
+ install_dir = os.path.join(env.Dir('#.').srcnode().abspath, env['build_dir'])
+ version = tuple(map(str, version))
+ if env['SHLIBSUFFIX'] == '.dll':
+ dlls = env.FindIxes(sources, 'SHLIBPREFIX', 'SHLIBSUFFIX')
+ targets += install(env, dlls, 'bin')
+ libs = env.FindIxes(sources, 'LIBPREFIX', 'LIBSUFFIX')
+ targets += install(env, libs, 'lib')
+ else:
+ for source in sources:
+ target_dir = os.path.join(install_dir, 'lib')
+ target_name = '.'.join((str(source),) + version)
+ last = env.InstallAs(os.path.join(target_dir, target_name), source)
+ targets += last
+ while len(version):
+ version = version[:-1]
+ target_name = '.'.join((str(source),) + version)
+ action = SCons.Action.Action(symlink, " Symlinking $TARGET ...")
+ last = env.Command(os.path.join(target_dir, target_name), last, action)
+ targets += last
+ return targets
+
+
+def createInstallMethods(env):
+ env.AddMethod(install_program, 'InstallProgram')
+ env.AddMethod(install_shared_library, 'InstallSharedLibrary')
+
+
+def num_jobs():
+ try:
+ return int(os.environ['NUMBER_OF_PROCESSORS'])
+ except (ValueError, KeyError):
+ pass
+
+ try:
+ return os.sysconf('SC_NPROCESSORS_ONLN')
+ except (ValueError, OSError, AttributeError):
+ pass
+
+ try:
+ return int(os.popen2("sysctl -n hw.ncpu")[1].read())
+ except ValueError:
+ pass
+
+ return 1
+
+
+def pkg_config_modules(env, name, modules):
+ '''Simple wrapper for pkg-config.'''
+
+ env[name] = False
+
+ if env['platform'] == 'windows':
+ return
+
+ if not env.Detect('pkg-config'):
+ return
+
+ if subprocess.call(["pkg-config", "--exists", ' '.join(modules)]) != 0:
+ return
+
+ # Put -I and -L flags directly into the environment, as these don't affect
+ # the compilation of targets that do not use them
+ try:
+ env.ParseConfig('pkg-config --cflags-only-I --libs-only-L ' + ' '.join(modules))
+ except OSError:
+ return
+
+ # Other flags may affect the compilation of unrelated targets, so store
+ # them with a prefix, (e.g., XXX_CFLAGS, XXX_LIBS, etc)
+ try:
+ flags = env.ParseFlags('!pkg-config --cflags-only-other --libs-only-l --libs-only-other ' + ' '.join(modules))
+ except OSError:
+ return
+ prefix = name.upper() + '_'
+ for flag_name, flag_value in flags.iteritems():
+ env[prefix + flag_name] = flag_value
+
+ env[name] = True
+
+
+
+def generate(env):
+ """Common environment generation code"""
+
+ # Tell tools which machine to compile for
+ env['TARGET_ARCH'] = env['machine']
+ env['MSVS_ARCH'] = env['machine']
+
+ # Toolchain
+ platform = env['platform']
+ if env['toolchain'] == 'default':
+ if platform == 'winddk':
+ env['toolchain'] = 'winddk'
+ elif platform == 'wince':
+ env['toolchain'] = 'wcesdk'
+ env.Tool(env['toolchain'])
+
+ # Allow override compiler and specify additional flags from environment
+ if os.environ.has_key('CC'):
+ env['CC'] = os.environ['CC']
+ # Update CCVERSION to match
+ pipe = SCons.Action._subproc(env, [env['CC'], '--version'],
+ stdin = 'devnull',
+ stderr = 'devnull',
+ stdout = subprocess.PIPE)
+ if pipe.wait() == 0:
+ line = pipe.stdout.readline()
+ match = re.search(r'[0-9]+(\.[0-9]+)+', line)
+ if match:
+ env['CCVERSION'] = match.group(0)
+ if os.environ.has_key('CFLAGS'):
+ env['CCFLAGS'] += SCons.Util.CLVar(os.environ['CFLAGS'])
+ if os.environ.has_key('CXX'):
+ env['CXX'] = os.environ['CXX']
+ if os.environ.has_key('CXXFLAGS'):
+ env['CXXFLAGS'] += SCons.Util.CLVar(os.environ['CXXFLAGS'])
+ if os.environ.has_key('LDFLAGS'):
+ env['LINKFLAGS'] += SCons.Util.CLVar(os.environ['LDFLAGS'])
+
+ env['gcc'] = 'gcc' in os.path.basename(env['CC']).split('-')
+ env['msvc'] = env['CC'] == 'cl'
+
+ if env['msvc'] and env['toolchain'] == 'default' and env['machine'] == 'x86_64':
+ # MSVC x64 support is broken in earlier versions of scons
+ env.EnsurePythonVersion(2, 0)
+
+ # shortcuts
+ machine = env['machine']
+ platform = env['platform']
+ x86 = env['machine'] == 'x86'
+ ppc = env['machine'] == 'ppc'
+ gcc = env['gcc']
+ msvc = env['msvc']
+
+ # Determine whether we are cross compiling; in particular, whether we need
+ # to compile code generators with a different compiler as the target code.
+ host_platform = _platform.system().lower()
+ if host_platform.startswith('cygwin'):
+ host_platform = 'cygwin'
+ host_machine = os.environ.get('PROCESSOR_ARCHITEW6432', os.environ.get('PROCESSOR_ARCHITECTURE', _platform.machine()))
+ host_machine = {
+ 'x86': 'x86',
+ 'i386': 'x86',
+ 'i486': 'x86',
+ 'i586': 'x86',
+ 'i686': 'x86',
+ 'ppc' : 'ppc',
+ 'AMD64': 'x86_64',
+ 'x86_64': 'x86_64',
+ }.get(host_machine, 'generic')
+ env['crosscompile'] = platform != host_platform
+ if machine == 'x86_64' and host_machine != 'x86_64':
+ env['crosscompile'] = True
+ env['hostonly'] = False
+
+ # Backwards compatability with the debug= profile= options
+ if env['build'] == 'debug':
+ if not env['debug']:
+ print 'scons: warning: debug option is deprecated and will be removed eventually; use instead'
+ print
+ print ' scons build=release'
+ print
+ env['build'] = 'release'
+ if env['profile']:
+ print 'scons: warning: profile option is deprecated and will be removed eventually; use instead'
+ print
+ print ' scons build=profile'
+ print
+ env['build'] = 'profile'
+ if False:
+ # Enforce SConscripts to use the new build variable
+ env.popitem('debug')
+ env.popitem('profile')
+ else:
+ # Backwards portability with older sconscripts
+ if env['build'] in ('debug', 'checked'):
+ env['debug'] = True
+ env['profile'] = False
+ if env['build'] == 'profile':
+ env['debug'] = False
+ env['profile'] = True
+ if env['build'] == 'release':
+ env['debug'] = False
+ env['profile'] = False
+
+ # Put build output in a separate dir, which depends on the current
+ # configuration. See also http://www.scons.org/wiki/AdvancedBuildExample
+ build_topdir = 'build'
+ build_subdir = env['platform']
+ if env['machine'] != 'generic':
+ build_subdir += '-' + env['machine']
+ if env['build'] != 'release':
+ build_subdir += '-' + env['build']
+ build_dir = os.path.join(build_topdir, build_subdir)
+ # Place the .sconsign file in the build dir too, to avoid issues with
+ # different scons versions building the same source file
+ env['build_dir'] = build_dir
+ env.SConsignFile(os.path.join(build_dir, '.sconsign'))
+ if 'SCONS_CACHE_DIR' in os.environ:
+ print 'scons: Using build cache in %s.' % (os.environ['SCONS_CACHE_DIR'],)
+ env.CacheDir(os.environ['SCONS_CACHE_DIR'])
+ env['CONFIGUREDIR'] = os.path.join(build_dir, 'conf')
+ env['CONFIGURELOG'] = os.path.join(os.path.abspath(build_dir), 'config.log')
+
+ # Parallel build
+ if env.GetOption('num_jobs') <= 1:
+ env.SetOption('num_jobs', num_jobs())
+
+ env.Decider('MD5-timestamp')
+ env.SetOption('max_drift', 60)
+
+ # C preprocessor options
+ cppdefines = []
+ if env['build'] in ('debug', 'checked'):
+ cppdefines += ['DEBUG']
+ else:
+ cppdefines += ['NDEBUG']
+ if env['build'] == 'profile':
+ cppdefines += ['PROFILE']
+ if platform == 'windows':
+ cppdefines += [
+ 'WIN32',
+ '_WINDOWS',
+ #'_UNICODE',
+ #'UNICODE',
+ # http://msdn.microsoft.com/en-us/library/aa383745.aspx
+ ('_WIN32_WINNT', '0x0601'),
+ ('WINVER', '0x0601'),
+ ]
+ if msvc and env['toolchain'] != 'winddk':
+ cppdefines += [
+ 'VC_EXTRALEAN',
+ '_USE_MATH_DEFINES',
+ '_CRT_SECURE_NO_WARNINGS',
+ '_CRT_SECURE_NO_DEPRECATE',
+ '_SCL_SECURE_NO_WARNINGS',
+ '_SCL_SECURE_NO_DEPRECATE',
+ ]
+ if env['build'] in ('debug', 'checked'):
+ cppdefines += ['_DEBUG']
+ if env['toolchain'] == 'winddk':
+ # Mimic WINDDK's builtin flags. See also:
+ # - WINDDK's bin/makefile.new i386mk.inc for more info.
+ # - buildchk_wxp_x86.log files, generated by the WINDDK's build
+ # - http://alter.org.ua/docs/nt_kernel/vc8_proj/
+ if machine == 'x86':
+ cppdefines += ['_X86_', 'i386']
+ if machine == 'x86_64':
+ cppdefines += ['_AMD64_', 'AMD64']
+ if platform == 'winddk':
+ cppdefines += [
+ 'STD_CALL',
+ ('CONDITION_HANDLING', '1'),
+ ('NT_INST', '0'),
+ ('WIN32', '100'),
+ ('_NT1X_', '100'),
+ ('WINNT', '1'),
+ ('_WIN32_WINNT', '0x0501'), # minimum required OS version
+ ('WINVER', '0x0501'),
+ ('_WIN32_IE', '0x0603'),
+ ('WIN32_LEAN_AND_MEAN', '1'),
+ ('DEVL', '1'),
+ ('__BUILDMACHINE__', 'WinDDK'),
+ ('FPO', '0'),
+ ]
+ if env['build'] in ('debug', 'checked'):
+ cppdefines += [('DBG', 1)]
+ if platform == 'wince':
+ cppdefines += [
+ '_CRT_SECURE_NO_DEPRECATE',
+ '_USE_32BIT_TIME_T',
+ 'UNICODE',
+ '_UNICODE',
+ ('UNDER_CE', '600'),
+ ('_WIN32_WCE', '0x600'),
+ 'WINCEOEM',
+ 'WINCEINTERNAL',
+ 'WIN32',
+ 'STRICT',
+ 'x86',
+ '_X86_',
+ 'INTERNATIONAL',
+ ('INTLMSG_CODEPAGE', '1252'),
+ ]
+ if platform == 'windows':
+ cppdefines += ['PIPE_SUBSYSTEM_WINDOWS_USER']
+ if platform == 'winddk':
+ cppdefines += ['PIPE_SUBSYSTEM_WINDOWS_DISPLAY']
+ if platform == 'wince':
+ cppdefines += ['PIPE_SUBSYSTEM_WINDOWS_CE']
+ cppdefines += ['PIPE_SUBSYSTEM_WINDOWS_CE_OGL']
+ if platform == 'embedded':
+ cppdefines += ['PIPE_OS_EMBEDDED']
+ env.Append(CPPDEFINES = cppdefines)
+
+ # C compiler options
+ cflags = [] # C
+ cxxflags = [] # C++
+ ccflags = [] # C & C++
+ if gcc:
+ ccversion = env['CCVERSION']
+ if env['build'] == 'debug':
+ ccflags += ['-O0']
+ elif ccversion.startswith('4.2.'):
+ # gcc 4.2.x optimizer is broken
+ print "warning: gcc 4.2.x optimizer is broken -- disabling optimizations"
+ ccflags += ['-O0']
+ else:
+ ccflags += ['-O3']
+ ccflags += ['-g3']
+ if env['build'] in ('checked', 'profile'):
+ # See http://code.google.com/p/jrfonseca/wiki/Gprof2Dot#Which_options_should_I_pass_to_gcc_when_compiling_for_profiling?
+ ccflags += [
+ '-fno-omit-frame-pointer',
+ '-fno-optimize-sibling-calls',
+ ]
+ if env['machine'] == 'x86':
+ ccflags += [
+ '-m32',
+ #'-march=pentium4',
+ ]
+ if distutils.version.LooseVersion(ccversion) >= distutils.version.LooseVersion('4.2') \
+ and (platform != 'windows' or env['build'] == 'debug' or True):
+ # NOTE: We need to ensure stack is realigned given that we
+ # produce shared objects, and have no control over the stack
+ # alignment policy of the application. Therefore we need
+ # -mstackrealign ore -mincoming-stack-boundary=2.
+ #
+ # XXX: -O and -mstackrealign causes stack corruption on MinGW
+ #
+ # XXX: We could have SSE without -mstackrealign if we always used
+ # __attribute__((force_align_arg_pointer)), but that's not
+ # always the case.
+ ccflags += [
+ '-mstackrealign', # ensure stack is aligned
+ '-mmmx', '-msse', '-msse2', # enable SIMD intrinsics
+ #'-mfpmath=sse',
+ ]
+ if platform in ['windows', 'darwin']:
+ # Workaround http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37216
+ ccflags += ['-fno-common']
+ if env['machine'] == 'x86_64':
+ ccflags += ['-m64']
+ if platform == 'darwin':
+ ccflags += ['-fno-common']
+ # See also:
+ # - http://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html
+ ccflags += [
+ '-Wall',
+ '-Wno-long-long',
+ '-ffast-math',
+ '-fmessage-length=0', # be nice to Eclipse
+ ]
+ cflags += [
+ '-Wmissing-prototypes',
+ '-std=gnu99',
+ ]
+ if distutils.version.LooseVersion(ccversion) >= distutils.version.LooseVersion('4.0'):
+ ccflags += [
+ '-Wmissing-field-initializers',
+ ]
+ if distutils.version.LooseVersion(ccversion) >= distutils.version.LooseVersion('4.2'):
+ ccflags += [
+ '-Werror=pointer-arith',
+ ]
+ cflags += [
+ '-Werror=declaration-after-statement',
+ ]
+ if msvc:
+ # See also:
+ # - http://msdn.microsoft.com/en-us/library/19z1t1wy.aspx
+ # - cl /?
+ if env['build'] == 'debug':
+ ccflags += [
+ '/Od', # disable optimizations
+ '/Oi', # enable intrinsic functions
+ '/Oy-', # disable frame pointer omission
+ ]
+ else:
+ ccflags += [
+ '/O2', # optimize for speed
+ ]
+ if env['build'] == 'release':
+ ccflags += [
+ '/GL', # enable whole program optimization
+ ]
+ else:
+ ccflags += [
+ '/GL-', # disable whole program optimization
+ ]
+ ccflags += [
+ '/fp:fast', # fast floating point
+ '/W3', # warning level
+ #'/Wp64', # enable 64 bit porting warnings
+ ]
+ if env['machine'] == 'x86':
+ ccflags += [
+ #'/arch:SSE2', # use the SSE2 instructions
+ ]
+ if platform == 'windows':
+ ccflags += [
+ # TODO
+ ]
+ if platform == 'winddk':
+ ccflags += [
+ '/Zl', # omit default library name in .OBJ
+ '/Zp8', # 8bytes struct member alignment
+ '/Gy', # separate functions for linker
+ '/Gm-', # disable minimal rebuild
+ '/WX', # treat warnings as errors
+ '/Gz', # __stdcall Calling convention
+ '/GX-', # disable C++ EH
+ '/GR-', # disable C++ RTTI
+ '/GF', # enable read-only string pooling
+ '/G6', # optimize for PPro, P-II, P-III
+ '/Ze', # enable extensions
+ '/Gi-', # disable incremental compilation
+ '/QIfdiv-', # disable Pentium FDIV fix
+ '/hotpatch', # prepares an image for hotpatching.
+ #'/Z7', #enable old-style debug info
+ ]
+ if platform == 'wince':
+ # See also C:\WINCE600\public\common\oak\misc\makefile.def
+ ccflags += [
+ '/Zl', # omit default library name in .OBJ
+ '/GF', # enable read-only string pooling
+ '/GR-', # disable C++ RTTI
+ '/GS', # enable security checks
+ # Allow disabling language conformance to maintain backward compat
+ #'/Zc:wchar_t-', # don't force wchar_t as native type, instead of typedef
+ #'/Zc:forScope-', # don't enforce Standard C++ for scoping rules
+ #'/wd4867',
+ #'/wd4430',
+ #'/MT',
+ #'/U_MT',
+ ]
+ # Automatic pdb generation
+ # See http://scons.tigris.org/issues/show_bug.cgi?id=1656
+ env.EnsureSConsVersion(0, 98, 0)
+ env['PDB'] = '${TARGET.base}.pdb'
+ env.Append(CCFLAGS = ccflags)
+ env.Append(CFLAGS = cflags)
+ env.Append(CXXFLAGS = cxxflags)
+
+ if env['platform'] == 'windows' and msvc:
+ # Choose the appropriate MSVC CRT
+ # http://msdn.microsoft.com/en-us/library/2kzt1wy3.aspx
+ if env['build'] in ('debug', 'checked'):
+ env.Append(CCFLAGS = ['/MTd'])
+ env.Append(SHCCFLAGS = ['/LDd'])
+ else:
+ env.Append(CCFLAGS = ['/MT'])
+ env.Append(SHCCFLAGS = ['/LD'])
+
+ # Assembler options
+ if gcc:
+ if env['machine'] == 'x86':
+ env.Append(ASFLAGS = ['-m32'])
+ if env['machine'] == 'x86_64':
+ env.Append(ASFLAGS = ['-m64'])
+
+ # Linker options
+ linkflags = []
+ shlinkflags = []
+ if gcc:
+ if env['machine'] == 'x86':
+ linkflags += ['-m32']
+ if env['machine'] == 'x86_64':
+ linkflags += ['-m64']
+ if env['platform'] not in ('darwin'):
+ shlinkflags += [
+ '-Wl,-Bsymbolic',
+ ]
+ # Handle circular dependencies in the libraries
+ if env['platform'] in ('darwin'):
+ pass
+ else:
+ env['_LIBFLAGS'] = '-Wl,--start-group ' + env['_LIBFLAGS'] + ' -Wl,--end-group'
+ if msvc:
+ if env['build'] == 'release':
+ # enable Link-time Code Generation
+ linkflags += ['/LTCG']
+ env.Append(ARFLAGS = ['/LTCG'])
+ if platform == 'windows' and msvc:
+ # See also:
+ # - http://msdn2.microsoft.com/en-us/library/y0zzbyt4.aspx
+ linkflags += [
+ '/fixed:no',
+ '/incremental:no',
+ ]
+ if platform == 'winddk':
+ linkflags += [
+ '/merge:_PAGE=PAGE',
+ '/merge:_TEXT=.text',
+ '/section:INIT,d',
+ '/opt:ref',
+ '/opt:icf',
+ '/ignore:4198,4010,4037,4039,4065,4070,4078,4087,4089,4221',
+ '/incremental:no',
+ '/fullbuild',
+ '/release',
+ '/nodefaultlib',
+ '/wx',
+ '/debug',
+ '/debugtype:cv',
+ '/version:5.1',
+ '/osversion:5.1',
+ '/functionpadmin:5',
+ '/safeseh',
+ '/pdbcompress',
+ '/stack:0x40000,0x1000',
+ '/driver',
+ '/align:0x80',
+ '/subsystem:native,5.01',
+ '/base:0x10000',
+
+ '/entry:DrvEnableDriver',
+ ]
+ if env['build'] != 'release':
+ linkflags += [
+ '/MAP', # http://msdn.microsoft.com/en-us/library/k7xkk3e2.aspx
+ ]
+ if platform == 'wince':
+ linkflags += [
+ '/nodefaultlib',
+ #'/incremental:no',
+ #'/fullbuild',
+ '/entry:_DllMainCRTStartup',
+ ]
+ env.Append(LINKFLAGS = linkflags)
+ env.Append(SHLINKFLAGS = shlinkflags)
+
+ # We have C++ in several libraries, so always link with the C++ compiler
+ if env['gcc']:
+ env['LINK'] = env['CXX']
+
+ # Default libs
+ env.Append(LIBS = [])
+
+ # Load tools
+ env.Tool('lex')
+ env.Tool('yacc')
+ if env['llvm']:
+ env.Tool('llvm')
+
+ pkg_config_modules(env, 'x11', ['x11', 'xext'])
+ pkg_config_modules(env, 'drm', ['libdrm'])
+ pkg_config_modules(env, 'drm_intel', ['libdrm_intel'])
+ pkg_config_modules(env, 'drm_radeon', ['libdrm_radeon'])
+ pkg_config_modules(env, 'xorg', ['xorg-server'])
+ pkg_config_modules(env, 'kms', ['libkms'])
+
+ env['dri'] = env['x11'] and env['drm']
+
+ # Custom builders and methods
+ env.Tool('custom')
+ createInstallMethods(env)
+
+ # for debugging
+ #print env.Dump()
+
+
+def exists(env):
+ return 1
diff --git a/mesalib/src/SConscript b/mesalib/src/SConscript
index 7b614daee..d2c002b8b 100644
--- a/mesalib/src/SConscript
+++ b/mesalib/src/SConscript
@@ -1,33 +1,33 @@
-Import('*')
-
-
-if env['platform'] == 'windows':
- SConscript('getopt/SConscript')
-
-SConscript('glsl/SConscript')
-
-if env['hostonly']:
- # We are just compiling the things necessary on the host for cross
- # compilation
- Return()
-
-
-# When env['gles'] is set, the targets defined in mapi/glapi/SConscript are not
-# used. libgl-xlib and libgl-gdi adapt themselves to use the targets defined
-# in mapi/glapi-shared/SConscript. mesa/SConscript also adapts itself to
-# enable OpenGL ES support.
-SConscript('mapi/glapi/SConscript')
-SConscript('mesa/SConscript')
-
-SConscript('mapi/vgapi/SConscript')
-
-if env['platform'] != 'embedded':
- SConscript('egl/main/SConscript')
- SConscript('glu/sgi/SConscript')
- SConscript('glut/glx/SConscript')
-
- if env['gles']:
- SConscript('mapi/shared-glapi/SConscript')
-
-SConscript('gallium/SConscript')
-
+Import('*')
+
+
+if env['platform'] == 'windows':
+ SConscript('getopt/SConscript')
+
+SConscript('glsl/SConscript')
+
+if env['hostonly']:
+ # We are just compiling the things necessary on the host for cross
+ # compilation
+ Return()
+
+
+# When env['gles'] is set, the targets defined in mapi/glapi/SConscript are not
+# used. libgl-xlib and libgl-gdi adapt themselves to use the targets defined
+# in mapi/glapi-shared/SConscript. mesa/SConscript also adapts itself to
+# enable OpenGL ES support.
+SConscript('mapi/glapi/SConscript')
+SConscript('mesa/SConscript')
+
+SConscript('mapi/vgapi/SConscript')
+
+if env['platform'] != 'embedded':
+ SConscript('egl/main/SConscript')
+ SConscript('glu/sgi/SConscript')
+ SConscript('glut/glx/SConscript')
+
+ if env['gles']:
+ SConscript('mapi/shared-glapi/SConscript')
+
+SConscript('gallium/SConscript')
+
diff --git a/mesalib/src/gallium/auxiliary/util/u_math.h b/mesalib/src/gallium/auxiliary/util/u_math.h
index 2ecade5f7..8f2ae2e17 100644
--- a/mesalib/src/gallium/auxiliary/util/u_math.h
+++ b/mesalib/src/gallium/auxiliary/util/u_math.h
@@ -1,644 +1,644 @@
-/**************************************************************************
- *
- * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sub license, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice (including the
- * next paragraph) shall be included in all copies or substantial portions
- * of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
- * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
- * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- **************************************************************************/
-
-
-/**
- * Math utilities and approximations for common math functions.
- * Reduced precision is usually acceptable in shaders...
- *
- * "fast" is used in the names of functions which are low-precision,
- * or at least lower-precision than the normal C lib functions.
- */
-
-
-#ifndef U_MATH_H
-#define U_MATH_H
-
-
-#include "pipe/p_compiler.h"
-#include "util/u_debug.h"
-
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-#if defined(PIPE_SUBSYSTEM_WINDOWS_MINIPORT)
-__inline double ceil(double val)
-{
- double ceil_val;
-
- if ((val - (long) val) == 0) {
- ceil_val = val;
- }
- else {
- if (val > 0) {
- ceil_val = (long) val + 1;
- }
- else {
- ceil_val = (long) val;
- }
- }
-
- return ceil_val;
-}
-
-#ifndef PIPE_SUBSYSTEM_WINDOWS_CE_OGL
-__inline double floor(double val)
-{
- double floor_val;
-
- if ((val - (long) val) == 0) {
- floor_val = val;
- }
- else {
- if (val > 0) {
- floor_val = (long) val;
- }
- else {
- floor_val = (long) val - 1;
- }
- }
-
- return floor_val;
-}
-#endif
-
-#pragma function(pow)
-__inline double __cdecl pow(double val, double exponent)
-{
- /* XXX */
- assert(0);
- return 0;
-}
-
-#pragma function(log)
-__inline double __cdecl log(double val)
-{
- /* XXX */
- assert(0);
- return 0;
-}
-
-#pragma function(atan2)
-__inline double __cdecl atan2(double val)
-{
- /* XXX */
- assert(0);
- return 0;
-}
-#else
-#include <math.h>
-#include <stdarg.h>
-#endif
-
-
-#ifndef M_SQRT2
-#define M_SQRT2 1.41421356237309504880
-#endif
-
-
-#if defined(_MSC_VER)
-
-#if _MSC_VER < 1400 && !defined(__cplusplus) || defined(PIPE_SUBSYSTEM_WINDOWS_CE)
-
-static INLINE float cosf( float f )
-{
- return (float) cos( (double) f );
-}
-
-static INLINE float sinf( float f )
-{
- return (float) sin( (double) f );
-}
-
-static INLINE float ceilf( float f )
-{
- return (float) ceil( (double) f );
-}
-
-static INLINE float floorf( float f )
-{
- return (float) floor( (double) f );
-}
-
-static INLINE float powf( float f, float g )
-{
- return (float) pow( (double) f, (double) g );
-}
-
-static INLINE float sqrtf( float f )
-{
- return (float) sqrt( (double) f );
-}
-
-static INLINE float fabsf( float f )
-{
- return (float) fabs( (double) f );
-}
-
-static INLINE float logf( float f )
-{
- return (float) log( (double) f );
-}
-
-#else
-/* Work-around an extra semi-colon in VS 2005 logf definition */
-#ifdef logf
-#undef logf
-#define logf(x) ((float)log((double)(x)))
-#endif /* logf */
-
-#define isfinite(x) _finite((double)(x))
-#define isnan(x) _isnan((double)(x))
-#endif /* _MSC_VER < 1400 && !defined(__cplusplus) */
-
-static INLINE double log2( double x )
-{
- const double invln2 = 1.442695041;
- return log( x ) * invln2;
-}
-
-static INLINE double
-round(double x)
-{
- return x >= 0.0 ? floor(x + 0.5) : ceil(x - 0.5);
-}
-
-static INLINE float
-roundf(float x)
-{
- return x >= 0.0f ? floorf(x + 0.5f) : ceilf(x - 0.5f);
-}
-
-#endif /* _MSC_VER */
-
-
-
-
-
-#define POW2_TABLE_SIZE_LOG2 9
-#define POW2_TABLE_SIZE (1 << POW2_TABLE_SIZE_LOG2)
-#define POW2_TABLE_OFFSET (POW2_TABLE_SIZE/2)
-#define POW2_TABLE_SCALE ((float)(POW2_TABLE_SIZE/2))
-extern float pow2_table[POW2_TABLE_SIZE];
-
-
-/**
- * Initialize math module. This should be called before using any
- * other functions in this module.
- */
-extern void
-util_init_math(void);
-
-
-union fi {
- float f;
- int32_t i;
- uint32_t ui;
-};
-
-
-/**
- * Fast version of 2^x
- * Identity: exp2(a + b) = exp2(a) * exp2(b)
- * Let ipart = int(x)
- * Let fpart = x - ipart;
- * So, exp2(x) = exp2(ipart) * exp2(fpart)
- * Compute exp2(ipart) with i << ipart
- * Compute exp2(fpart) with lookup table.
- */
-static INLINE float
-util_fast_exp2(float x)
-{
- int32_t ipart;
- float fpart, mpart;
- union fi epart;
-
- if(x > 129.00000f)
- return 3.402823466e+38f;
-
- if (x < -126.99999f)
- return 0.0f;
-
- ipart = (int32_t) x;
- fpart = x - (float) ipart;
-
- /* same as
- * epart.f = (float) (1 << ipart)
- * but faster and without integer overflow for ipart > 31
- */
- epart.i = (ipart + 127 ) << 23;
-
- mpart = pow2_table[POW2_TABLE_OFFSET + (int)(fpart * POW2_TABLE_SCALE)];
-
- return epart.f * mpart;
-}
-
-
-/**
- * Fast approximation to exp(x).
- */
-static INLINE float
-util_fast_exp(float x)
-{
- const float k = 1.44269f; /* = log2(e) */
- return util_fast_exp2(k * x);
-}
-
-
-#define LOG2_TABLE_SIZE_LOG2 16
-#define LOG2_TABLE_SCALE (1 << LOG2_TABLE_SIZE_LOG2)
-#define LOG2_TABLE_SIZE (LOG2_TABLE_SCALE + 1)
-extern float log2_table[LOG2_TABLE_SIZE];
-
-
-/**
- * Fast approximation to log2(x).
- */
-static INLINE float
-util_fast_log2(float x)
-{
- union fi num;
- float epart, mpart;
- num.f = x;
- epart = (float)(((num.i & 0x7f800000) >> 23) - 127);
- /* mpart = log2_table[mantissa*LOG2_TABLE_SCALE + 0.5] */
- mpart = log2_table[((num.i & 0x007fffff) + (1 << (22 - LOG2_TABLE_SIZE_LOG2))) >> (23 - LOG2_TABLE_SIZE_LOG2)];
- return epart + mpart;
-}
-
-
-/**
- * Fast approximation to x^y.
- */
-static INLINE float
-util_fast_pow(float x, float y)
-{
- return util_fast_exp2(util_fast_log2(x) * y);
-}
-
-/* Note that this counts zero as a power of two.
- */
-static INLINE boolean
-util_is_power_of_two( unsigned v )
-{
- return (v & (v-1)) == 0;
-}
-
-
-/**
- * Floor(x), returned as int.
- */
-static INLINE int
-util_ifloor(float f)
-{
- int ai, bi;
- double af, bf;
- union fi u;
- af = (3 << 22) + 0.5 + (double) f;
- bf = (3 << 22) + 0.5 - (double) f;
- u.f = (float) af; ai = u.i;
- u.f = (float) bf; bi = u.i;
- return (ai - bi) >> 1;
-}
-
-
-/**
- * Round float to nearest int.
- */
-static INLINE int
-util_iround(float f)
-{
-#if defined(PIPE_CC_GCC) && defined(PIPE_ARCH_X86)
- int r;
- __asm__ ("fistpl %0" : "=m" (r) : "t" (f) : "st");
- return r;
-#elif defined(PIPE_CC_MSVC) && defined(PIPE_ARCH_X86)
- int r;
- _asm {
- fld f
- fistp r
- }
- return r;
-#else
- if (f >= 0.0f)
- return (int) (f + 0.5f);
- else
- return (int) (f - 0.5f);
-#endif
-}
-
-
-/**
- * Approximate floating point comparison
- */
-static INLINE boolean
-util_is_approx(float a, float b, float tol)
-{
- return fabs(b - a) <= tol;
-}
-
-
-/**
- * Test if x is NaN or +/- infinity.
- */
-static INLINE boolean
-util_is_inf_or_nan(float x)
-{
- union fi tmp;
- tmp.f = x;
- return !(int)((unsigned int)((tmp.i & 0x7fffffff)-0x7f800000) >> 31);
-}
-
-
-/**
- * Find first bit set in word. Least significant bit is 1.
- * Return 0 if no bits set.
- */
-#if defined(_MSC_VER) && _MSC_VER >= 1300 && (_M_IX86 || _M_AMD64 || _M_IA64)
-unsigned char _BitScanForward(unsigned long* Index, unsigned long Mask);
-#pragma intrinsic(_BitScanForward)
-static INLINE
-unsigned long ffs( unsigned long u )
-{
- unsigned long i;
- if (_BitScanForward(&i, u))
- return i + 1;
- else
- return 0;
-}
-#elif defined(PIPE_CC_MSVC) && defined(PIPE_ARCH_X86)
-static INLINE
-unsigned ffs( unsigned u )
-{
- unsigned i;
-
- if (u == 0) {
- return 0;
- }
-
- __asm bsf eax, [u]
- __asm inc eax
- __asm mov [i], eax
-
- return i;
-}
-#elif defined(__MINGW32__)
-#define ffs __builtin_ffs
-#endif
-
-
-/**
- * Return float bits.
- */
-static INLINE unsigned
-fui( float f )
-{
- union fi fi;
- fi.f = f;
- return fi.ui;
-}
-
-
-/**
- * Convert ubyte to float in [0, 1].
- * XXX a 256-entry lookup table would be slightly faster.
- */
-static INLINE float
-ubyte_to_float(ubyte ub)
-{
- return (float) ub * (1.0f / 255.0f);
-}
-
-
-/**
- * Convert float in [0,1] to ubyte in [0,255] with clamping.
- */
-static INLINE ubyte
-float_to_ubyte(float f)
-{
- const int ieee_0996 = 0x3f7f0000; /* 0.996 or so */
- union fi tmp;
-
- tmp.f = f;
- if (tmp.i < 0) {
- return (ubyte) 0;
- }
- else if (tmp.i >= ieee_0996) {
- return (ubyte) 255;
- }
- else {
- tmp.f = tmp.f * (255.0f/256.0f) + 32768.0f;
- return (ubyte) tmp.i;
- }
-}
-
-static INLINE float
-byte_to_float_tex(int8_t b)
-{
- return (b == -128) ? -1.0F : b * 1.0F / 127.0F;
-}
-
-static INLINE int8_t
-float_to_byte_tex(float f)
-{
- return (int8_t) (127.0F * f);
-}
-
-/**
- * Calc log base 2
- */
-static INLINE unsigned
-util_logbase2(unsigned n)
-{
- unsigned log2 = 0;
- while (n >>= 1)
- ++log2;
- return log2;
-}
-
-
-/**
- * Returns the smallest power of two >= x
- */
-static INLINE unsigned
-util_next_power_of_two(unsigned x)
-{
- unsigned i;
-
- if (x == 0)
- return 1;
-
- --x;
-
- for (i = 1; i < sizeof(unsigned) * 8; i <<= 1)
- x |= x >> i;
-
- return x + 1;
-}
-
-
-/**
- * Return number of bits set in n.
- */
-static INLINE unsigned
-util_bitcount(unsigned n)
-{
-#if defined(PIPE_CC_GCC)
- return __builtin_popcount(n);
-#else
- /* K&R classic bitcount.
- *
- * For each iteration, clear the LSB from the bitfield.
- * Requires only one iteration per set bit, instead of
- * one iteration per bit less than highest set bit.
- */
- unsigned bits = 0;
- for (bits; n; bits++) {
- n &= n - 1;
- }
- return bits;
-#endif
-}
-
-
-/**
- * Reverse byte order of a 32 bit word.
- */
-static INLINE uint32_t
-util_bswap32(uint32_t n)
-{
-#if defined(PIPE_CC_GCC) && (PIPE_CC_GCC_VERSION >= 403)
- return __builtin_bswap32(n);
-#else
- return (n >> 24) |
- ((n >> 8) & 0x0000ff00) |
- ((n << 8) & 0x00ff0000) |
- (n << 24);
-#endif
-}
-
-
-/**
- * Reverse byte order of a 16 bit word.
- */
-static INLINE uint16_t
-util_bswap16(uint16_t n)
-{
- return (n >> 8) |
- (n << 8);
-}
-
-
-/**
- * Clamp X to [MIN, MAX].
- * This is a macro to allow float, int, uint, etc. types.
- */
-#define CLAMP( X, MIN, MAX ) ( (X)<(MIN) ? (MIN) : ((X)>(MAX) ? (MAX) : (X)) )
-
-#define MIN2( A, B ) ( (A)<(B) ? (A) : (B) )
-#define MAX2( A, B ) ( (A)>(B) ? (A) : (B) )
-
-#define MIN3( A, B, C ) ((A) < (B) ? MIN2(A, C) : MIN2(B, C))
-#define MAX3( A, B, C ) ((A) > (B) ? MAX2(A, C) : MAX2(B, C))
-
-#define MIN4( A, B, C, D ) ((A) < (B) ? MIN3(A, C, D) : MIN3(B, C, D))
-#define MAX4( A, B, C, D ) ((A) > (B) ? MAX3(A, C, D) : MAX3(B, C, D))
-
-
-/**
- * Align a value, only works pot alignemnts.
- */
-static INLINE int
-align(int value, int alignment)
-{
- return (value + alignment - 1) & ~(alignment - 1);
-}
-
-/**
- * Works like align but on npot alignments.
- */
-static INLINE size_t
-util_align_npot(size_t value, size_t alignment)
-{
- if (value % alignment)
- return value + (alignment - (value % alignment));
- return value;
-}
-
-static INLINE unsigned
-u_minify(unsigned value, unsigned levels)
-{
- return MAX2(1, value >> levels);
-}
-
-#ifndef COPY_4V
-#define COPY_4V( DST, SRC ) \
-do { \
- (DST)[0] = (SRC)[0]; \
- (DST)[1] = (SRC)[1]; \
- (DST)[2] = (SRC)[2]; \
- (DST)[3] = (SRC)[3]; \
-} while (0)
-#endif
-
-
-#ifndef COPY_4FV
-#define COPY_4FV( DST, SRC ) COPY_4V(DST, SRC)
-#endif
-
-
-#ifndef ASSIGN_4V
-#define ASSIGN_4V( DST, V0, V1, V2, V3 ) \
-do { \
- (DST)[0] = (V0); \
- (DST)[1] = (V1); \
- (DST)[2] = (V2); \
- (DST)[3] = (V3); \
-} while (0)
-#endif
-
-
-static INLINE uint32_t util_unsigned_fixed(float value, unsigned frac_bits)
-{
- return value < 0 ? 0 : (uint32_t)(value * (1<<frac_bits));
-}
-
-static INLINE int32_t util_signed_fixed(float value, unsigned frac_bits)
-{
- return (int32_t)(value * (1<<frac_bits));
-}
-
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* U_MATH_H */
+/**************************************************************************
+ *
+ * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ **************************************************************************/
+
+
+/**
+ * Math utilities and approximations for common math functions.
+ * Reduced precision is usually acceptable in shaders...
+ *
+ * "fast" is used in the names of functions which are low-precision,
+ * or at least lower-precision than the normal C lib functions.
+ */
+
+
+#ifndef U_MATH_H
+#define U_MATH_H
+
+
+#include "pipe/p_compiler.h"
+#include "util/u_debug.h"
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+#if defined(PIPE_SUBSYSTEM_WINDOWS_MINIPORT)
+__inline double ceil(double val)
+{
+ double ceil_val;
+
+ if ((val - (long) val) == 0) {
+ ceil_val = val;
+ }
+ else {
+ if (val > 0) {
+ ceil_val = (long) val + 1;
+ }
+ else {
+ ceil_val = (long) val;
+ }
+ }
+
+ return ceil_val;
+}
+
+#ifndef PIPE_SUBSYSTEM_WINDOWS_CE_OGL
+__inline double floor(double val)
+{
+ double floor_val;
+
+ if ((val - (long) val) == 0) {
+ floor_val = val;
+ }
+ else {
+ if (val > 0) {
+ floor_val = (long) val;
+ }
+ else {
+ floor_val = (long) val - 1;
+ }
+ }
+
+ return floor_val;
+}
+#endif
+
+#pragma function(pow)
+__inline double __cdecl pow(double val, double exponent)
+{
+ /* XXX */
+ assert(0);
+ return 0;
+}
+
+#pragma function(log)
+__inline double __cdecl log(double val)
+{
+ /* XXX */
+ assert(0);
+ return 0;
+}
+
+#pragma function(atan2)
+__inline double __cdecl atan2(double val)
+{
+ /* XXX */
+ assert(0);
+ return 0;
+}
+#else
+#include <math.h>
+#include <stdarg.h>
+#endif
+
+
+#ifndef M_SQRT2
+#define M_SQRT2 1.41421356237309504880
+#endif
+
+
+#if defined(_MSC_VER)
+
+#if _MSC_VER < 1400 && !defined(__cplusplus) || defined(PIPE_SUBSYSTEM_WINDOWS_CE)
+
+static INLINE float cosf( float f )
+{
+ return (float) cos( (double) f );
+}
+
+static INLINE float sinf( float f )
+{
+ return (float) sin( (double) f );
+}
+
+static INLINE float ceilf( float f )
+{
+ return (float) ceil( (double) f );
+}
+
+static INLINE float floorf( float f )
+{
+ return (float) floor( (double) f );
+}
+
+static INLINE float powf( float f, float g )
+{
+ return (float) pow( (double) f, (double) g );
+}
+
+static INLINE float sqrtf( float f )
+{
+ return (float) sqrt( (double) f );
+}
+
+static INLINE float fabsf( float f )
+{
+ return (float) fabs( (double) f );
+}
+
+static INLINE float logf( float f )
+{
+ return (float) log( (double) f );
+}
+
+#else
+/* Work-around an extra semi-colon in VS 2005 logf definition */
+#ifdef logf
+#undef logf
+#define logf(x) ((float)log((double)(x)))
+#endif /* logf */
+
+#define isfinite(x) _finite((double)(x))
+#define isnan(x) _isnan((double)(x))
+#endif /* _MSC_VER < 1400 && !defined(__cplusplus) */
+
+static INLINE double log2( double x )
+{
+ const double invln2 = 1.442695041;
+ return log( x ) * invln2;
+}
+
+static INLINE double
+round(double x)
+{
+ return x >= 0.0 ? floor(x + 0.5) : ceil(x - 0.5);
+}
+
+static INLINE float
+roundf(float x)
+{
+ return x >= 0.0f ? floorf(x + 0.5f) : ceilf(x - 0.5f);
+}
+
+#endif /* _MSC_VER */
+
+
+
+
+
+#define POW2_TABLE_SIZE_LOG2 9
+#define POW2_TABLE_SIZE (1 << POW2_TABLE_SIZE_LOG2)
+#define POW2_TABLE_OFFSET (POW2_TABLE_SIZE/2)
+#define POW2_TABLE_SCALE ((float)(POW2_TABLE_SIZE/2))
+extern float pow2_table[POW2_TABLE_SIZE];
+
+
+/**
+ * Initialize math module. This should be called before using any
+ * other functions in this module.
+ */
+extern void
+util_init_math(void);
+
+
+union fi {
+ float f;
+ int32_t i;
+ uint32_t ui;
+};
+
+
+/**
+ * Fast version of 2^x
+ * Identity: exp2(a + b) = exp2(a) * exp2(b)
+ * Let ipart = int(x)
+ * Let fpart = x - ipart;
+ * So, exp2(x) = exp2(ipart) * exp2(fpart)
+ * Compute exp2(ipart) with i << ipart
+ * Compute exp2(fpart) with lookup table.
+ */
+static INLINE float
+util_fast_exp2(float x)
+{
+ int32_t ipart;
+ float fpart, mpart;
+ union fi epart;
+
+ if(x > 129.00000f)
+ return 3.402823466e+38f;
+
+ if (x < -126.99999f)
+ return 0.0f;
+
+ ipart = (int32_t) x;
+ fpart = x - (float) ipart;
+
+ /* same as
+ * epart.f = (float) (1 << ipart)
+ * but faster and without integer overflow for ipart > 31
+ */
+ epart.i = (ipart + 127 ) << 23;
+
+ mpart = pow2_table[POW2_TABLE_OFFSET + (int)(fpart * POW2_TABLE_SCALE)];
+
+ return epart.f * mpart;
+}
+
+
+/**
+ * Fast approximation to exp(x).
+ */
+static INLINE float
+util_fast_exp(float x)
+{
+ const float k = 1.44269f; /* = log2(e) */
+ return util_fast_exp2(k * x);
+}
+
+
+#define LOG2_TABLE_SIZE_LOG2 16
+#define LOG2_TABLE_SCALE (1 << LOG2_TABLE_SIZE_LOG2)
+#define LOG2_TABLE_SIZE (LOG2_TABLE_SCALE + 1)
+extern float log2_table[LOG2_TABLE_SIZE];
+
+
+/**
+ * Fast approximation to log2(x).
+ */
+static INLINE float
+util_fast_log2(float x)
+{
+ union fi num;
+ float epart, mpart;
+ num.f = x;
+ epart = (float)(((num.i & 0x7f800000) >> 23) - 127);
+ /* mpart = log2_table[mantissa*LOG2_TABLE_SCALE + 0.5] */
+ mpart = log2_table[((num.i & 0x007fffff) + (1 << (22 - LOG2_TABLE_SIZE_LOG2))) >> (23 - LOG2_TABLE_SIZE_LOG2)];
+ return epart + mpart;
+}
+
+
+/**
+ * Fast approximation to x^y.
+ */
+static INLINE float
+util_fast_pow(float x, float y)
+{
+ return util_fast_exp2(util_fast_log2(x) * y);
+}
+
+/* Note that this counts zero as a power of two.
+ */
+static INLINE boolean
+util_is_power_of_two( unsigned v )
+{
+ return (v & (v-1)) == 0;
+}
+
+
+/**
+ * Floor(x), returned as int.
+ */
+static INLINE int
+util_ifloor(float f)
+{
+ int ai, bi;
+ double af, bf;
+ union fi u;
+ af = (3 << 22) + 0.5 + (double) f;
+ bf = (3 << 22) + 0.5 - (double) f;
+ u.f = (float) af; ai = u.i;
+ u.f = (float) bf; bi = u.i;
+ return (ai - bi) >> 1;
+}
+
+
+/**
+ * Round float to nearest int.
+ */
+static INLINE int
+util_iround(float f)
+{
+#if defined(PIPE_CC_GCC) && defined(PIPE_ARCH_X86)
+ int r;
+ __asm__ ("fistpl %0" : "=m" (r) : "t" (f) : "st");
+ return r;
+#elif defined(PIPE_CC_MSVC) && defined(PIPE_ARCH_X86)
+ int r;
+ _asm {
+ fld f
+ fistp r
+ }
+ return r;
+#else
+ if (f >= 0.0f)
+ return (int) (f + 0.5f);
+ else
+ return (int) (f - 0.5f);
+#endif
+}
+
+
+/**
+ * Approximate floating point comparison
+ */
+static INLINE boolean
+util_is_approx(float a, float b, float tol)
+{
+ return fabs(b - a) <= tol;
+}
+
+
+/**
+ * Test if x is NaN or +/- infinity.
+ */
+static INLINE boolean
+util_is_inf_or_nan(float x)
+{
+ union fi tmp;
+ tmp.f = x;
+ return !(int)((unsigned int)((tmp.i & 0x7fffffff)-0x7f800000) >> 31);
+}
+
+
+/**
+ * Find first bit set in word. Least significant bit is 1.
+ * Return 0 if no bits set.
+ */
+#if defined(_MSC_VER) && _MSC_VER >= 1300 && (_M_IX86 || _M_AMD64 || _M_IA64)
+unsigned char _BitScanForward(unsigned long* Index, unsigned long Mask);
+#pragma intrinsic(_BitScanForward)
+static INLINE
+unsigned long ffs( unsigned long u )
+{
+ unsigned long i;
+ if (_BitScanForward(&i, u))
+ return i + 1;
+ else
+ return 0;
+}
+#elif defined(PIPE_CC_MSVC) && defined(PIPE_ARCH_X86)
+static INLINE
+unsigned ffs( unsigned u )
+{
+ unsigned i;
+
+ if (u == 0) {
+ return 0;
+ }
+
+ __asm bsf eax, [u]
+ __asm inc eax
+ __asm mov [i], eax
+
+ return i;
+}
+#elif defined(__MINGW32__)
+#define ffs __builtin_ffs
+#endif
+
+
+/**
+ * Return float bits.
+ */
+static INLINE unsigned
+fui( float f )
+{
+ union fi fi;
+ fi.f = f;
+ return fi.ui;
+}
+
+
+/**
+ * Convert ubyte to float in [0, 1].
+ * XXX a 256-entry lookup table would be slightly faster.
+ */
+static INLINE float
+ubyte_to_float(ubyte ub)
+{
+ return (float) ub * (1.0f / 255.0f);
+}
+
+
+/**
+ * Convert float in [0,1] to ubyte in [0,255] with clamping.
+ */
+static INLINE ubyte
+float_to_ubyte(float f)
+{
+ const int ieee_0996 = 0x3f7f0000; /* 0.996 or so */
+ union fi tmp;
+
+ tmp.f = f;
+ if (tmp.i < 0) {
+ return (ubyte) 0;
+ }
+ else if (tmp.i >= ieee_0996) {
+ return (ubyte) 255;
+ }
+ else {
+ tmp.f = tmp.f * (255.0f/256.0f) + 32768.0f;
+ return (ubyte) tmp.i;
+ }
+}
+
+static INLINE float
+byte_to_float_tex(int8_t b)
+{
+ return (b == -128) ? -1.0F : b * 1.0F / 127.0F;
+}
+
+static INLINE int8_t
+float_to_byte_tex(float f)
+{
+ return (int8_t) (127.0F * f);
+}
+
+/**
+ * Calc log base 2
+ */
+static INLINE unsigned
+util_logbase2(unsigned n)
+{
+ unsigned log2 = 0;
+ while (n >>= 1)
+ ++log2;
+ return log2;
+}
+
+
+/**
+ * Returns the smallest power of two >= x
+ */
+static INLINE unsigned
+util_next_power_of_two(unsigned x)
+{
+ unsigned i;
+
+ if (x == 0)
+ return 1;
+
+ --x;
+
+ for (i = 1; i < sizeof(unsigned) * 8; i <<= 1)
+ x |= x >> i;
+
+ return x + 1;
+}
+
+
+/**
+ * Return number of bits set in n.
+ */
+static INLINE unsigned
+util_bitcount(unsigned n)
+{
+#if defined(PIPE_CC_GCC)
+ return __builtin_popcount(n);
+#else
+ /* K&R classic bitcount.
+ *
+ * For each iteration, clear the LSB from the bitfield.
+ * Requires only one iteration per set bit, instead of
+ * one iteration per bit less than highest set bit.
+ */
+ unsigned bits = 0;
+ for (bits; n; bits++) {
+ n &= n - 1;
+ }
+ return bits;
+#endif
+}
+
+
+/**
+ * Reverse byte order of a 32 bit word.
+ */
+static INLINE uint32_t
+util_bswap32(uint32_t n)
+{
+#if defined(PIPE_CC_GCC) && (PIPE_CC_GCC_VERSION >= 403)
+ return __builtin_bswap32(n);
+#else
+ return (n >> 24) |
+ ((n >> 8) & 0x0000ff00) |
+ ((n << 8) & 0x00ff0000) |
+ (n << 24);
+#endif
+}
+
+
+/**
+ * Reverse byte order of a 16 bit word.
+ */
+static INLINE uint16_t
+util_bswap16(uint16_t n)
+{
+ return (n >> 8) |
+ (n << 8);
+}
+
+
+/**
+ * Clamp X to [MIN, MAX].
+ * This is a macro to allow float, int, uint, etc. types.
+ */
+#define CLAMP( X, MIN, MAX ) ( (X)<(MIN) ? (MIN) : ((X)>(MAX) ? (MAX) : (X)) )
+
+#define MIN2( A, B ) ( (A)<(B) ? (A) : (B) )
+#define MAX2( A, B ) ( (A)>(B) ? (A) : (B) )
+
+#define MIN3( A, B, C ) ((A) < (B) ? MIN2(A, C) : MIN2(B, C))
+#define MAX3( A, B, C ) ((A) > (B) ? MAX2(A, C) : MAX2(B, C))
+
+#define MIN4( A, B, C, D ) ((A) < (B) ? MIN3(A, C, D) : MIN3(B, C, D))
+#define MAX4( A, B, C, D ) ((A) > (B) ? MAX3(A, C, D) : MAX3(B, C, D))
+
+
+/**
+ * Align a value, only works pot alignemnts.
+ */
+static INLINE int
+align(int value, int alignment)
+{
+ return (value + alignment - 1) & ~(alignment - 1);
+}
+
+/**
+ * Works like align but on npot alignments.
+ */
+static INLINE size_t
+util_align_npot(size_t value, size_t alignment)
+{
+ if (value % alignment)
+ return value + (alignment - (value % alignment));
+ return value;
+}
+
+static INLINE unsigned
+u_minify(unsigned value, unsigned levels)
+{
+ return MAX2(1, value >> levels);
+}
+
+#ifndef COPY_4V
+#define COPY_4V( DST, SRC ) \
+do { \
+ (DST)[0] = (SRC)[0]; \
+ (DST)[1] = (SRC)[1]; \
+ (DST)[2] = (SRC)[2]; \
+ (DST)[3] = (SRC)[3]; \
+} while (0)
+#endif
+
+
+#ifndef COPY_4FV
+#define COPY_4FV( DST, SRC ) COPY_4V(DST, SRC)
+#endif
+
+
+#ifndef ASSIGN_4V
+#define ASSIGN_4V( DST, V0, V1, V2, V3 ) \
+do { \
+ (DST)[0] = (V0); \
+ (DST)[1] = (V1); \
+ (DST)[2] = (V2); \
+ (DST)[3] = (V3); \
+} while (0)
+#endif
+
+
+static INLINE uint32_t util_unsigned_fixed(float value, unsigned frac_bits)
+{
+ return value < 0 ? 0 : (uint32_t)(value * (1<<frac_bits));
+}
+
+static INLINE int32_t util_signed_fixed(float value, unsigned frac_bits)
+{
+ return (int32_t)(value * (1<<frac_bits));
+}
+
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* U_MATH_H */
diff --git a/mesalib/src/gallium/auxiliary/util/u_vbuf_mgr.c b/mesalib/src/gallium/auxiliary/util/u_vbuf_mgr.c
index 04149525e..8a66c2e95 100644
--- a/mesalib/src/gallium/auxiliary/util/u_vbuf_mgr.c
+++ b/mesalib/src/gallium/auxiliary/util/u_vbuf_mgr.c
@@ -1,650 +1,650 @@
-/**************************************************************************
- *
- * Copyright 2011 Marek Olšák <maraeo@gmail.com>
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sub license, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice (including the
- * next paragraph) shall be included in all copies or substantial portions
- * of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
- * IN NO EVENT SHALL AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR
- * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- **************************************************************************/
-
-#include "util/u_vbuf_mgr.h"
-
-#include "util/u_format.h"
-#include "util/u_inlines.h"
-#include "util/u_memory.h"
-#include "util/u_upload_mgr.h"
-#include "translate/translate.h"
-#include "translate/translate_cache.h"
-
-/* Hardware vertex fetcher limitations can be described by this structure. */
-struct u_vbuf_caps {
- /* Vertex format CAPs. */
- /* TRUE if hardware supports it. */
- unsigned format_fixed32:1; /* PIPE_FORMAT_*32*_FIXED */
- unsigned format_float16:1; /* PIPE_FORMAT_*16*_FLOAT */
- unsigned format_float64:1; /* PIPE_FORMAT_*64*_FLOAT */
- unsigned format_norm32:1; /* PIPE_FORMAT_*32*NORM */
- unsigned format_scaled32:1; /* PIPE_FORMAT_*32*SCALED */
-
- /* Whether vertex fetches don't have to be dword-aligned. */
- /* TRUE if hardware supports it. */
- unsigned fetch_dword_unaligned:1;
-};
-
-struct u_vbuf_mgr_elements {
- unsigned count;
- struct pipe_vertex_element ve[PIPE_MAX_ATTRIBS];
-
- unsigned src_format_size[PIPE_MAX_ATTRIBS];
-
- /* If (velem[i].src_format != native_format[i]), the vertex buffer
- * referenced by the vertex element cannot be used for rendering and
- * its vertex data must be translated to native_format[i]. */
- enum pipe_format native_format[PIPE_MAX_ATTRIBS];
- unsigned native_format_size[PIPE_MAX_ATTRIBS];
-
- /* This might mean two things:
- * - src_format != native_format, as discussed above.
- * - src_offset % 4 != 0 (if the caps don't allow such an offset). */
- boolean incompatible_layout;
-};
-
-struct u_vbuf_mgr_priv {
- struct u_vbuf_mgr b;
- struct u_vbuf_caps caps;
- struct pipe_context *pipe;
-
- struct translate_cache *translate_cache;
- unsigned translate_vb_slot;
-
- struct u_vbuf_mgr_elements *ve;
- void *saved_ve, *fallback_ve;
- boolean ve_binding_lock;
-
- boolean any_user_vbs;
- boolean incompatible_vb_layout;
-};
-
-static void u_vbuf_mgr_init_format_caps(struct u_vbuf_mgr_priv *mgr)
-{
- struct pipe_screen *screen = mgr->pipe->screen;
-
- mgr->caps.format_fixed32 =
- screen->is_format_supported(screen, PIPE_FORMAT_R32_FIXED, PIPE_BUFFER,
- 0, PIPE_BIND_VERTEX_BUFFER);
-
- mgr->caps.format_float16 =
- screen->is_format_supported(screen, PIPE_FORMAT_R16_FLOAT, PIPE_BUFFER,
- 0, PIPE_BIND_VERTEX_BUFFER);
-
- mgr->caps.format_float64 =
- screen->is_format_supported(screen, PIPE_FORMAT_R64_FLOAT, PIPE_BUFFER,
- 0, PIPE_BIND_VERTEX_BUFFER);
-
- mgr->caps.format_norm32 =
- screen->is_format_supported(screen, PIPE_FORMAT_R32_UNORM, PIPE_BUFFER,
- 0, PIPE_BIND_VERTEX_BUFFER) &&
- screen->is_format_supported(screen, PIPE_FORMAT_R32_SNORM, PIPE_BUFFER,
- 0, PIPE_BIND_VERTEX_BUFFER);
-
- mgr->caps.format_scaled32 =
- screen->is_format_supported(screen, PIPE_FORMAT_R32_USCALED, PIPE_BUFFER,
- 0, PIPE_BIND_VERTEX_BUFFER) &&
- screen->is_format_supported(screen, PIPE_FORMAT_R32_SSCALED, PIPE_BUFFER,
- 0, PIPE_BIND_VERTEX_BUFFER);
-}
-
-struct u_vbuf_mgr *
-u_vbuf_mgr_create(struct pipe_context *pipe,
- unsigned upload_buffer_size,
- unsigned upload_buffer_alignment,
- unsigned upload_buffer_bind,
- enum u_fetch_alignment fetch_alignment)
-{
- struct u_vbuf_mgr_priv *mgr = CALLOC_STRUCT(u_vbuf_mgr_priv);
-
- mgr->pipe = pipe;
- mgr->translate_cache = translate_cache_create();
-
- mgr->b.uploader = u_upload_create(pipe, upload_buffer_size,
- upload_buffer_alignment,
- upload_buffer_bind);
-
- mgr->caps.fetch_dword_unaligned =
- fetch_alignment == U_VERTEX_FETCH_BYTE_ALIGNED;
-
- u_vbuf_mgr_init_format_caps(mgr);
-
- return &mgr->b;
-}
-
-void u_vbuf_mgr_destroy(struct u_vbuf_mgr *mgrb)
-{
- struct u_vbuf_mgr_priv *mgr = (struct u_vbuf_mgr_priv*)mgrb;
- unsigned i;
-
- for (i = 0; i < mgr->b.nr_real_vertex_buffers; i++) {
- pipe_resource_reference(&mgr->b.vertex_buffer[i].buffer, NULL);
- pipe_resource_reference(&mgr->b.real_vertex_buffer[i], NULL);
- }
-
- translate_cache_destroy(mgr->translate_cache);
- u_upload_destroy(mgr->b.uploader);
- FREE(mgr);
-}
-
-
-static void u_vbuf_translate_begin(struct u_vbuf_mgr_priv *mgr,
- int min_index, int max_index,
- boolean *upload_flushed)
-{
- struct translate_key key;
- struct translate_element *te;
- unsigned tr_elem_index[PIPE_MAX_ATTRIBS];
- struct translate *tr;
- boolean vb_translated[PIPE_MAX_ATTRIBS] = {0};
- uint8_t *vb_map[PIPE_MAX_ATTRIBS] = {0}, *out_map;
- struct pipe_transfer *vb_transfer[PIPE_MAX_ATTRIBS] = {0};
- struct pipe_resource *out_buffer = NULL;
- unsigned i, num_verts, out_offset;
- struct pipe_vertex_element new_velems[PIPE_MAX_ATTRIBS];
-
- memset(&key, 0, sizeof(key));
- memset(tr_elem_index, 0xff, sizeof(tr_elem_index));
-
- /* Initialize the translate key, i.e. the recipe how vertices should be
- * translated. */
- memset(&key, 0, sizeof key);
- for (i = 0; i < mgr->ve->count; i++) {
- struct pipe_vertex_buffer *vb =
- &mgr->b.vertex_buffer[mgr->ve->ve[i].vertex_buffer_index];
- enum pipe_format output_format = mgr->ve->native_format[i];
- unsigned output_format_size = mgr->ve->native_format_size[i];
-
- /* Check for support. */
- if (mgr->ve->ve[i].src_format == mgr->ve->native_format[i] &&
- (mgr->caps.fetch_dword_unaligned ||
- (vb->buffer_offset % 4 == 0 &&
- vb->stride % 4 == 0 &&
- mgr->ve->ve[i].src_offset % 4 == 0))) {
- continue;
- }
-
- /* Workaround for translate: output floats instead of halfs. */
- switch (output_format) {
- case PIPE_FORMAT_R16_FLOAT:
- output_format = PIPE_FORMAT_R32_FLOAT;
- output_format_size = 4;
- break;
- case PIPE_FORMAT_R16G16_FLOAT:
- output_format = PIPE_FORMAT_R32G32_FLOAT;
- output_format_size = 8;
- break;
- case PIPE_FORMAT_R16G16B16_FLOAT:
- output_format = PIPE_FORMAT_R32G32B32_FLOAT;
- output_format_size = 12;
- break;
- case PIPE_FORMAT_R16G16B16A16_FLOAT:
- output_format = PIPE_FORMAT_R32G32B32A32_FLOAT;
- output_format_size = 16;
- break;
- default:;
- }
-
- /* Add this vertex element. */
- te = &key.element[key.nr_elements];
- /*te->type;
- te->instance_divisor;*/
- te->input_buffer = mgr->ve->ve[i].vertex_buffer_index;
- te->input_format = mgr->ve->ve[i].src_format;
- te->input_offset = mgr->ve->ve[i].src_offset;
- te->output_format = output_format;
- te->output_offset = key.output_stride;
-
- key.output_stride += output_format_size;
- vb_translated[mgr->ve->ve[i].vertex_buffer_index] = TRUE;
- tr_elem_index[i] = key.nr_elements;
- key.nr_elements++;
- }
-
- /* Get a translate object. */
- tr = translate_cache_find(mgr->translate_cache, &key);
-
- /* Map buffers we want to translate. */
- for (i = 0; i < mgr->b.nr_vertex_buffers; i++) {
- if (vb_translated[i]) {
- struct pipe_vertex_buffer *vb = &mgr->b.vertex_buffer[i];
-
- vb_map[i] = pipe_buffer_map(mgr->pipe, vb->buffer,
- PIPE_TRANSFER_READ, &vb_transfer[i]);
-
- tr->set_buffer(tr, i,
- vb_map[i] + vb->buffer_offset + vb->stride * min_index,
- vb->stride, ~0);
- }
- }
-
- /* Create and map the output buffer. */
- num_verts = max_index + 1 - min_index;
-
- u_upload_alloc(mgr->b.uploader,
- key.output_stride * min_index,
- key.output_stride * num_verts,
- &out_offset, &out_buffer, upload_flushed,
- (void**)&out_map);
-
- out_offset -= key.output_stride * min_index;
-
- /* Translate. */
- tr->run(tr, 0, num_verts, 0, out_map);
-
- /* Unmap all buffers. */
- for (i = 0; i < mgr->b.nr_vertex_buffers; i++) {
- if (vb_translated[i]) {
- pipe_buffer_unmap(mgr->pipe, vb_transfer[i]);
- }
- }
-
- /* Setup the new vertex buffer in the first free slot. */
- mgr->translate_vb_slot = ~0;
- for (i = 0; i < PIPE_MAX_ATTRIBS; i++) {
- if (!mgr->b.vertex_buffer[i].buffer) {
- mgr->translate_vb_slot = i;
-
- if (i >= mgr->b.nr_vertex_buffers) {
- mgr->b.nr_real_vertex_buffers = i+1;
- }
- break;
- }
- }
-
- if (mgr->translate_vb_slot != ~0) {
- /* Setup the new vertex buffer. */
- pipe_resource_reference(
- &mgr->b.real_vertex_buffer[mgr->translate_vb_slot], out_buffer);
- mgr->b.vertex_buffer[mgr->translate_vb_slot].buffer_offset = out_offset;
- mgr->b.vertex_buffer[mgr->translate_vb_slot].stride = key.output_stride;
-
- /* Setup new vertex elements. */
- for (i = 0; i < mgr->ve->count; i++) {
- if (tr_elem_index[i] < key.nr_elements) {
- te = &key.element[tr_elem_index[i]];
- new_velems[i].instance_divisor = mgr->ve->ve[i].instance_divisor;
- new_velems[i].src_format = te->output_format;
- new_velems[i].src_offset = te->output_offset;
- new_velems[i].vertex_buffer_index = mgr->translate_vb_slot;
- } else {
- memcpy(&new_velems[i], &mgr->ve->ve[i],
- sizeof(struct pipe_vertex_element));
- }
- }
-
- mgr->fallback_ve =
- mgr->pipe->create_vertex_elements_state(mgr->pipe, mgr->ve->count,
- new_velems);
-
- /* Preserve saved_ve. */
- mgr->ve_binding_lock = TRUE;
- mgr->pipe->bind_vertex_elements_state(mgr->pipe, mgr->fallback_ve);
- mgr->ve_binding_lock = FALSE;
- }
-
- pipe_resource_reference(&out_buffer, NULL);
-}
-
-static void u_vbuf_translate_end(struct u_vbuf_mgr_priv *mgr)
-{
- if (mgr->fallback_ve == NULL) {
- return;
- }
-
- /* Restore vertex elements. */
- /* Note that saved_ve will be overwritten in bind_vertex_elements_state. */
- mgr->pipe->bind_vertex_elements_state(mgr->pipe, mgr->saved_ve);
- mgr->pipe->delete_vertex_elements_state(mgr->pipe, mgr->fallback_ve);
- mgr->fallback_ve = NULL;
-
- /* Delete the now-unused VBO. */
- pipe_resource_reference(&mgr->b.real_vertex_buffer[mgr->translate_vb_slot],
- NULL);
- mgr->b.nr_real_vertex_buffers = mgr->b.nr_vertex_buffers;
-}
-
-#define FORMAT_REPLACE(what, withwhat) \
- case PIPE_FORMAT_##what: format = PIPE_FORMAT_##withwhat; break
-
-struct u_vbuf_mgr_elements *
-u_vbuf_mgr_create_vertex_elements(struct u_vbuf_mgr *mgrb,
- unsigned count,
- const struct pipe_vertex_element *attribs,
- struct pipe_vertex_element *native_attribs)
-{
- struct u_vbuf_mgr_priv *mgr = (struct u_vbuf_mgr_priv*)mgrb;
- unsigned i;
- struct u_vbuf_mgr_elements *ve = CALLOC_STRUCT(u_vbuf_mgr_elements);
-
- ve->count = count;
-
- if (!count) {
- return ve;
- }
-
- memcpy(ve->ve, attribs, sizeof(struct pipe_vertex_element) * count);
- memcpy(native_attribs, attribs, sizeof(struct pipe_vertex_element) * count);
-
- /* Set the best native format in case the original format is not
- * supported. */
- for (i = 0; i < count; i++) {
- enum pipe_format format = ve->ve[i].src_format;
-
- ve->src_format_size[i] = util_format_get_blocksize(format);
-
- /* Choose a native format.
- * For now we don't care about the alignment, that's going to
- * be sorted out later. */
- if (!mgr->caps.format_fixed32) {
- switch (format) {
- FORMAT_REPLACE(R32_FIXED, R32_FLOAT);
- FORMAT_REPLACE(R32G32_FIXED, R32G32_FLOAT);
- FORMAT_REPLACE(R32G32B32_FIXED, R32G32B32_FLOAT);
- FORMAT_REPLACE(R32G32B32A32_FIXED, R32G32B32A32_FLOAT);
- default:;
- }
- }
- if (!mgr->caps.format_float16) {
- switch (format) {
- FORMAT_REPLACE(R16_FLOAT, R32_FLOAT);
- FORMAT_REPLACE(R16G16_FLOAT, R32G32_FLOAT);
- FORMAT_REPLACE(R16G16B16_FLOAT, R32G32B32_FLOAT);
- FORMAT_REPLACE(R16G16B16A16_FLOAT, R32G32B32A32_FLOAT);
- default:;
- }
- }
- if (!mgr->caps.format_float64) {
- switch (format) {
- FORMAT_REPLACE(R64_FLOAT, R32_FLOAT);
- FORMAT_REPLACE(R64G64_FLOAT, R32G32_FLOAT);
- FORMAT_REPLACE(R64G64B64_FLOAT, R32G32B32_FLOAT);
- FORMAT_REPLACE(R64G64B64A64_FLOAT, R32G32B32A32_FLOAT);
- default:;
- }
- }
- if (!mgr->caps.format_norm32) {
- switch (format) {
- FORMAT_REPLACE(R32_UNORM, R32_FLOAT);
- FORMAT_REPLACE(R32G32_UNORM, R32G32_FLOAT);
- FORMAT_REPLACE(R32G32B32_UNORM, R32G32B32_FLOAT);
- FORMAT_REPLACE(R32G32B32A32_UNORM, R32G32B32A32_FLOAT);
- FORMAT_REPLACE(R32_SNORM, R32_FLOAT);
- FORMAT_REPLACE(R32G32_SNORM, R32G32_FLOAT);
- FORMAT_REPLACE(R32G32B32_SNORM, R32G32B32_FLOAT);
- FORMAT_REPLACE(R32G32B32A32_SNORM, R32G32B32A32_FLOAT);
- default:;
- }
- }
- if (!mgr->caps.format_scaled32) {
- switch (format) {
- FORMAT_REPLACE(R32_USCALED, R32_FLOAT);
- FORMAT_REPLACE(R32G32_USCALED, R32G32_FLOAT);
- FORMAT_REPLACE(R32G32B32_USCALED, R32G32B32_FLOAT);
- FORMAT_REPLACE(R32G32B32A32_USCALED,R32G32B32A32_FLOAT);
- FORMAT_REPLACE(R32_SSCALED, R32_FLOAT);
- FORMAT_REPLACE(R32G32_SSCALED, R32G32_FLOAT);
- FORMAT_REPLACE(R32G32B32_SSCALED, R32G32B32_FLOAT);
- FORMAT_REPLACE(R32G32B32A32_SSCALED,R32G32B32A32_FLOAT);
- default:;
- }
- }
-
- native_attribs[i].src_format = format;
- ve->native_format[i] = format;
- ve->native_format_size[i] =
- util_format_get_blocksize(ve->native_format[i]);
-
- ve->incompatible_layout =
- ve->incompatible_layout ||
- ve->ve[i].src_format != ve->native_format[i] ||
- (!mgr->caps.fetch_dword_unaligned && ve->ve[i].src_offset % 4 != 0);
- }
-
- /* Align the formats to the size of DWORD if needed. */
- if (!mgr->caps.fetch_dword_unaligned) {
- for (i = 0; i < count; i++) {
- ve->native_format_size[i] = align(ve->native_format_size[i], 4);
- }
- }
-
- return ve;
-}
-
-void u_vbuf_mgr_bind_vertex_elements(struct u_vbuf_mgr *mgrb,
- void *cso,
- struct u_vbuf_mgr_elements *ve)
-{
- struct u_vbuf_mgr_priv *mgr = (struct u_vbuf_mgr_priv*)mgrb;
-
- if (!cso) {
- return;
- }
-
- if (!mgr->ve_binding_lock) {
- mgr->saved_ve = cso;
- mgr->ve = ve;
- }
-}
-
-void u_vbuf_mgr_destroy_vertex_elements(struct u_vbuf_mgr *mgr,
- struct u_vbuf_mgr_elements *ve)
-{
- FREE(ve);
-}
-
-void u_vbuf_mgr_set_vertex_buffers(struct u_vbuf_mgr *mgrb,
- unsigned count,
- const struct pipe_vertex_buffer *bufs)
-{
- struct u_vbuf_mgr_priv *mgr = (struct u_vbuf_mgr_priv*)mgrb;
- unsigned i;
-
- mgr->any_user_vbs = FALSE;
- mgr->incompatible_vb_layout = FALSE;
-
- if (!mgr->caps.fetch_dword_unaligned) {
- /* Check if the strides and offsets are aligned to the size of DWORD. */
- for (i = 0; i < count; i++) {
- if (bufs[i].buffer) {
- if (bufs[i].stride % 4 != 0 ||
- bufs[i].buffer_offset % 4 != 0) {
- mgr->incompatible_vb_layout = TRUE;
- break;
- }
- }
- }
- }
-
- for (i = 0; i < count; i++) {
- const struct pipe_vertex_buffer *vb = &bufs[i];
-
- pipe_resource_reference(&mgr->b.vertex_buffer[i].buffer, vb->buffer);
- pipe_resource_reference(&mgr->b.real_vertex_buffer[i], NULL);
-
- if (!vb->buffer) {
- continue;
- }
-
- if (u_vbuf_resource(vb->buffer)->user_ptr) {
- mgr->any_user_vbs = TRUE;
- continue;
- }
-
- pipe_resource_reference(&mgr->b.real_vertex_buffer[i], vb->buffer);
- }
-
- for (; i < mgr->b.nr_real_vertex_buffers; i++) {
- pipe_resource_reference(&mgr->b.vertex_buffer[i].buffer, NULL);
- pipe_resource_reference(&mgr->b.real_vertex_buffer[i], NULL);
- }
-
- memcpy(mgr->b.vertex_buffer, bufs,
- sizeof(struct pipe_vertex_buffer) * count);
-
- mgr->b.nr_vertex_buffers = count;
- mgr->b.nr_real_vertex_buffers = count;
-}
-
-static void u_vbuf_upload_buffers(struct u_vbuf_mgr_priv *mgr,
- int min_index, int max_index,
- unsigned instance_count,
- boolean *upload_flushed)
-{
- unsigned i, nr = mgr->ve->count;
- unsigned count = max_index + 1 - min_index;
- boolean uploaded[PIPE_MAX_ATTRIBS] = {0};
-
- for (i = 0; i < nr; i++) {
- unsigned index = mgr->ve->ve[i].vertex_buffer_index;
- struct pipe_vertex_buffer *vb = &mgr->b.vertex_buffer[index];
-
- if (vb->buffer &&
- u_vbuf_resource(vb->buffer)->user_ptr &&
- !uploaded[index]) {
- unsigned first, size;
- boolean flushed;
- unsigned instance_div = mgr->ve->ve[i].instance_divisor;
-
- if (instance_div) {
- first = 0;
- size = vb->stride *
- ((instance_count + instance_div - 1) / instance_div);
- } else if (vb->stride) {
- first = vb->stride * min_index;
- size = vb->stride * count;
- } else {
- first = 0;
- size = mgr->ve->native_format_size[i];
- }
-
- u_upload_data(mgr->b.uploader, first, size,
- u_vbuf_resource(vb->buffer)->user_ptr + first,
- &vb->buffer_offset,
- &mgr->b.real_vertex_buffer[index],
- &flushed);
-
- vb->buffer_offset -= first;
-
- uploaded[index] = TRUE;
- *upload_flushed = *upload_flushed || flushed;
- } else {
- assert(mgr->b.real_vertex_buffer[index]);
- }
- }
-}
-
-static void u_vbuf_mgr_compute_max_index(struct u_vbuf_mgr_priv *mgr)
-{
- unsigned i, nr = mgr->ve->count;
-
- mgr->b.max_index = ~0;
-
- for (i = 0; i < nr; i++) {
- struct pipe_vertex_buffer *vb =
- &mgr->b.vertex_buffer[mgr->ve->ve[i].vertex_buffer_index];
- int unused;
- unsigned max_index;
-
- if (!vb->buffer ||
- !vb->stride ||
- u_vbuf_resource(vb->buffer)->user_ptr) {
- continue;
- }
-
- /* How many bytes is unused after the last vertex.
- * width0 may be "count*stride - unused" and we have to compensate
- * for that when dividing by stride. */
- unused = vb->stride -
- (mgr->ve->ve[i].src_offset + mgr->ve->src_format_size[i]);
-
- /* If src_offset is greater than stride (which means it's a buffer
- * offset rather than a vertex offset)... */
- if (unused < 0) {
- unused = 0;
- }
-
- /* Compute the maximum index for this vertex element. */
- max_index =
- (vb->buffer->width0 - vb->buffer_offset + (unsigned)unused) /
- vb->stride - 1;
-
- mgr->b.max_index = MIN2(mgr->b.max_index, max_index);
- }
-}
-
-void u_vbuf_mgr_draw_begin(struct u_vbuf_mgr *mgrb,
- const struct pipe_draw_info *info,
- boolean *buffers_updated,
- boolean *uploader_flushed)
-{
- struct u_vbuf_mgr_priv *mgr = (struct u_vbuf_mgr_priv*)mgrb;
- boolean bufs_updated = FALSE, upload_flushed = FALSE;
- int min_index, max_index;
-
- u_vbuf_mgr_compute_max_index(mgr);
-
- min_index = info->min_index - info->index_bias;
- if (info->max_index == ~0) {
- max_index = mgr->b.max_index;
- } else {
- max_index = MIN2(info->max_index - info->index_bias, mgr->b.max_index);
- }
-
- /* Translate vertices with non-native layouts or formats. */
- if (mgr->incompatible_vb_layout || mgr->ve->incompatible_layout) {
- u_vbuf_translate_begin(mgr, min_index, max_index, &upload_flushed);
-
- if (mgr->fallback_ve) {
- bufs_updated = TRUE;
- }
- }
-
- /* Upload user buffers. */
- if (mgr->any_user_vbs) {
- u_vbuf_upload_buffers(mgr, min_index, max_index, info->instance_count,
- &upload_flushed);
- bufs_updated = TRUE;
- }
-
- /* Set the return values. */
- if (buffers_updated) {
- *buffers_updated = bufs_updated;
- }
- if (uploader_flushed) {
- *uploader_flushed = upload_flushed;
- }
-}
-
-void u_vbuf_mgr_draw_end(struct u_vbuf_mgr *mgrb)
-{
- struct u_vbuf_mgr_priv *mgr = (struct u_vbuf_mgr_priv*)mgrb;
-
- if (mgr->fallback_ve) {
- u_vbuf_translate_end(mgr);
- }
-}
+/**************************************************************************
+ *
+ * Copyright 2011 Marek Olšák <maraeo@gmail.com>
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ **************************************************************************/
+
+#include "util/u_vbuf_mgr.h"
+
+#include "util/u_format.h"
+#include "util/u_inlines.h"
+#include "util/u_memory.h"
+#include "util/u_upload_mgr.h"
+#include "translate/translate.h"
+#include "translate/translate_cache.h"
+
+/* Hardware vertex fetcher limitations can be described by this structure. */
+struct u_vbuf_caps {
+ /* Vertex format CAPs. */
+ /* TRUE if hardware supports it. */
+ unsigned format_fixed32:1; /* PIPE_FORMAT_*32*_FIXED */
+ unsigned format_float16:1; /* PIPE_FORMAT_*16*_FLOAT */
+ unsigned format_float64:1; /* PIPE_FORMAT_*64*_FLOAT */
+ unsigned format_norm32:1; /* PIPE_FORMAT_*32*NORM */
+ unsigned format_scaled32:1; /* PIPE_FORMAT_*32*SCALED */
+
+ /* Whether vertex fetches don't have to be dword-aligned. */
+ /* TRUE if hardware supports it. */
+ unsigned fetch_dword_unaligned:1;
+};
+
+struct u_vbuf_mgr_elements {
+ unsigned count;
+ struct pipe_vertex_element ve[PIPE_MAX_ATTRIBS];
+
+ unsigned src_format_size[PIPE_MAX_ATTRIBS];
+
+ /* If (velem[i].src_format != native_format[i]), the vertex buffer
+ * referenced by the vertex element cannot be used for rendering and
+ * its vertex data must be translated to native_format[i]. */
+ enum pipe_format native_format[PIPE_MAX_ATTRIBS];
+ unsigned native_format_size[PIPE_MAX_ATTRIBS];
+
+ /* This might mean two things:
+ * - src_format != native_format, as discussed above.
+ * - src_offset % 4 != 0 (if the caps don't allow such an offset). */
+ boolean incompatible_layout;
+};
+
+struct u_vbuf_mgr_priv {
+ struct u_vbuf_mgr b;
+ struct u_vbuf_caps caps;
+ struct pipe_context *pipe;
+
+ struct translate_cache *translate_cache;
+ unsigned translate_vb_slot;
+
+ struct u_vbuf_mgr_elements *ve;
+ void *saved_ve, *fallback_ve;
+ boolean ve_binding_lock;
+
+ boolean any_user_vbs;
+ boolean incompatible_vb_layout;
+};
+
+static void u_vbuf_mgr_init_format_caps(struct u_vbuf_mgr_priv *mgr)
+{
+ struct pipe_screen *screen = mgr->pipe->screen;
+
+ mgr->caps.format_fixed32 =
+ screen->is_format_supported(screen, PIPE_FORMAT_R32_FIXED, PIPE_BUFFER,
+ 0, PIPE_BIND_VERTEX_BUFFER);
+
+ mgr->caps.format_float16 =
+ screen->is_format_supported(screen, PIPE_FORMAT_R16_FLOAT, PIPE_BUFFER,
+ 0, PIPE_BIND_VERTEX_BUFFER);
+
+ mgr->caps.format_float64 =
+ screen->is_format_supported(screen, PIPE_FORMAT_R64_FLOAT, PIPE_BUFFER,
+ 0, PIPE_BIND_VERTEX_BUFFER);
+
+ mgr->caps.format_norm32 =
+ screen->is_format_supported(screen, PIPE_FORMAT_R32_UNORM, PIPE_BUFFER,
+ 0, PIPE_BIND_VERTEX_BUFFER) &&
+ screen->is_format_supported(screen, PIPE_FORMAT_R32_SNORM, PIPE_BUFFER,
+ 0, PIPE_BIND_VERTEX_BUFFER);
+
+ mgr->caps.format_scaled32 =
+ screen->is_format_supported(screen, PIPE_FORMAT_R32_USCALED, PIPE_BUFFER,
+ 0, PIPE_BIND_VERTEX_BUFFER) &&
+ screen->is_format_supported(screen, PIPE_FORMAT_R32_SSCALED, PIPE_BUFFER,
+ 0, PIPE_BIND_VERTEX_BUFFER);
+}
+
+struct u_vbuf_mgr *
+u_vbuf_mgr_create(struct pipe_context *pipe,
+ unsigned upload_buffer_size,
+ unsigned upload_buffer_alignment,
+ unsigned upload_buffer_bind,
+ enum u_fetch_alignment fetch_alignment)
+{
+ struct u_vbuf_mgr_priv *mgr = CALLOC_STRUCT(u_vbuf_mgr_priv);
+
+ mgr->pipe = pipe;
+ mgr->translate_cache = translate_cache_create();
+
+ mgr->b.uploader = u_upload_create(pipe, upload_buffer_size,
+ upload_buffer_alignment,
+ upload_buffer_bind);
+
+ mgr->caps.fetch_dword_unaligned =
+ fetch_alignment == U_VERTEX_FETCH_BYTE_ALIGNED;
+
+ u_vbuf_mgr_init_format_caps(mgr);
+
+ return &mgr->b;
+}
+
+void u_vbuf_mgr_destroy(struct u_vbuf_mgr *mgrb)
+{
+ struct u_vbuf_mgr_priv *mgr = (struct u_vbuf_mgr_priv*)mgrb;
+ unsigned i;
+
+ for (i = 0; i < mgr->b.nr_real_vertex_buffers; i++) {
+ pipe_resource_reference(&mgr->b.vertex_buffer[i].buffer, NULL);
+ pipe_resource_reference(&mgr->b.real_vertex_buffer[i], NULL);
+ }
+
+ translate_cache_destroy(mgr->translate_cache);
+ u_upload_destroy(mgr->b.uploader);
+ FREE(mgr);
+}
+
+
+static void u_vbuf_translate_begin(struct u_vbuf_mgr_priv *mgr,
+ int min_index, int max_index,
+ boolean *upload_flushed)
+{
+ struct translate_key key;
+ struct translate_element *te;
+ unsigned tr_elem_index[PIPE_MAX_ATTRIBS];
+ struct translate *tr;
+ boolean vb_translated[PIPE_MAX_ATTRIBS] = {0};
+ uint8_t *vb_map[PIPE_MAX_ATTRIBS] = {0}, *out_map;
+ struct pipe_transfer *vb_transfer[PIPE_MAX_ATTRIBS] = {0};
+ struct pipe_resource *out_buffer = NULL;
+ unsigned i, num_verts, out_offset;
+ struct pipe_vertex_element new_velems[PIPE_MAX_ATTRIBS];
+
+ memset(&key, 0, sizeof(key));
+ memset(tr_elem_index, 0xff, sizeof(tr_elem_index));
+
+ /* Initialize the translate key, i.e. the recipe how vertices should be
+ * translated. */
+ memset(&key, 0, sizeof key);
+ for (i = 0; i < mgr->ve->count; i++) {
+ struct pipe_vertex_buffer *vb =
+ &mgr->b.vertex_buffer[mgr->ve->ve[i].vertex_buffer_index];
+ enum pipe_format output_format = mgr->ve->native_format[i];
+ unsigned output_format_size = mgr->ve->native_format_size[i];
+
+ /* Check for support. */
+ if (mgr->ve->ve[i].src_format == mgr->ve->native_format[i] &&
+ (mgr->caps.fetch_dword_unaligned ||
+ (vb->buffer_offset % 4 == 0 &&
+ vb->stride % 4 == 0 &&
+ mgr->ve->ve[i].src_offset % 4 == 0))) {
+ continue;
+ }
+
+ /* Workaround for translate: output floats instead of halfs. */
+ switch (output_format) {
+ case PIPE_FORMAT_R16_FLOAT:
+ output_format = PIPE_FORMAT_R32_FLOAT;
+ output_format_size = 4;
+ break;
+ case PIPE_FORMAT_R16G16_FLOAT:
+ output_format = PIPE_FORMAT_R32G32_FLOAT;
+ output_format_size = 8;
+ break;
+ case PIPE_FORMAT_R16G16B16_FLOAT:
+ output_format = PIPE_FORMAT_R32G32B32_FLOAT;
+ output_format_size = 12;
+ break;
+ case PIPE_FORMAT_R16G16B16A16_FLOAT:
+ output_format = PIPE_FORMAT_R32G32B32A32_FLOAT;
+ output_format_size = 16;
+ break;
+ default:;
+ }
+
+ /* Add this vertex element. */
+ te = &key.element[key.nr_elements];
+ /*te->type;
+ te->instance_divisor;*/
+ te->input_buffer = mgr->ve->ve[i].vertex_buffer_index;
+ te->input_format = mgr->ve->ve[i].src_format;
+ te->input_offset = mgr->ve->ve[i].src_offset;
+ te->output_format = output_format;
+ te->output_offset = key.output_stride;
+
+ key.output_stride += output_format_size;
+ vb_translated[mgr->ve->ve[i].vertex_buffer_index] = TRUE;
+ tr_elem_index[i] = key.nr_elements;
+ key.nr_elements++;
+ }
+
+ /* Get a translate object. */
+ tr = translate_cache_find(mgr->translate_cache, &key);
+
+ /* Map buffers we want to translate. */
+ for (i = 0; i < mgr->b.nr_vertex_buffers; i++) {
+ if (vb_translated[i]) {
+ struct pipe_vertex_buffer *vb = &mgr->b.vertex_buffer[i];
+
+ vb_map[i] = pipe_buffer_map(mgr->pipe, vb->buffer,
+ PIPE_TRANSFER_READ, &vb_transfer[i]);
+
+ tr->set_buffer(tr, i,
+ vb_map[i] + vb->buffer_offset + vb->stride * min_index,
+ vb->stride, ~0);
+ }
+ }
+
+ /* Create and map the output buffer. */
+ num_verts = max_index + 1 - min_index;
+
+ u_upload_alloc(mgr->b.uploader,
+ key.output_stride * min_index,
+ key.output_stride * num_verts,
+ &out_offset, &out_buffer, upload_flushed,
+ (void**)&out_map);
+
+ out_offset -= key.output_stride * min_index;
+
+ /* Translate. */
+ tr->run(tr, 0, num_verts, 0, out_map);
+
+ /* Unmap all buffers. */
+ for (i = 0; i < mgr->b.nr_vertex_buffers; i++) {
+ if (vb_translated[i]) {
+ pipe_buffer_unmap(mgr->pipe, vb_transfer[i]);
+ }
+ }
+
+ /* Setup the new vertex buffer in the first free slot. */
+ mgr->translate_vb_slot = ~0;
+ for (i = 0; i < PIPE_MAX_ATTRIBS; i++) {
+ if (!mgr->b.vertex_buffer[i].buffer) {
+ mgr->translate_vb_slot = i;
+
+ if (i >= mgr->b.nr_vertex_buffers) {
+ mgr->b.nr_real_vertex_buffers = i+1;
+ }
+ break;
+ }
+ }
+
+ if (mgr->translate_vb_slot != ~0) {
+ /* Setup the new vertex buffer. */
+ pipe_resource_reference(
+ &mgr->b.real_vertex_buffer[mgr->translate_vb_slot], out_buffer);
+ mgr->b.vertex_buffer[mgr->translate_vb_slot].buffer_offset = out_offset;
+ mgr->b.vertex_buffer[mgr->translate_vb_slot].stride = key.output_stride;
+
+ /* Setup new vertex elements. */
+ for (i = 0; i < mgr->ve->count; i++) {
+ if (tr_elem_index[i] < key.nr_elements) {
+ te = &key.element[tr_elem_index[i]];
+ new_velems[i].instance_divisor = mgr->ve->ve[i].instance_divisor;
+ new_velems[i].src_format = te->output_format;
+ new_velems[i].src_offset = te->output_offset;
+ new_velems[i].vertex_buffer_index = mgr->translate_vb_slot;
+ } else {
+ memcpy(&new_velems[i], &mgr->ve->ve[i],
+ sizeof(struct pipe_vertex_element));
+ }
+ }
+
+ mgr->fallback_ve =
+ mgr->pipe->create_vertex_elements_state(mgr->pipe, mgr->ve->count,
+ new_velems);
+
+ /* Preserve saved_ve. */
+ mgr->ve_binding_lock = TRUE;
+ mgr->pipe->bind_vertex_elements_state(mgr->pipe, mgr->fallback_ve);
+ mgr->ve_binding_lock = FALSE;
+ }
+
+ pipe_resource_reference(&out_buffer, NULL);
+}
+
+static void u_vbuf_translate_end(struct u_vbuf_mgr_priv *mgr)
+{
+ if (mgr->fallback_ve == NULL) {
+ return;
+ }
+
+ /* Restore vertex elements. */
+ /* Note that saved_ve will be overwritten in bind_vertex_elements_state. */
+ mgr->pipe->bind_vertex_elements_state(mgr->pipe, mgr->saved_ve);
+ mgr->pipe->delete_vertex_elements_state(mgr->pipe, mgr->fallback_ve);
+ mgr->fallback_ve = NULL;
+
+ /* Delete the now-unused VBO. */
+ pipe_resource_reference(&mgr->b.real_vertex_buffer[mgr->translate_vb_slot],
+ NULL);
+ mgr->b.nr_real_vertex_buffers = mgr->b.nr_vertex_buffers;
+}
+
+#define FORMAT_REPLACE(what, withwhat) \
+ case PIPE_FORMAT_##what: format = PIPE_FORMAT_##withwhat; break
+
+struct u_vbuf_mgr_elements *
+u_vbuf_mgr_create_vertex_elements(struct u_vbuf_mgr *mgrb,
+ unsigned count,
+ const struct pipe_vertex_element *attribs,
+ struct pipe_vertex_element *native_attribs)
+{
+ struct u_vbuf_mgr_priv *mgr = (struct u_vbuf_mgr_priv*)mgrb;
+ unsigned i;
+ struct u_vbuf_mgr_elements *ve = CALLOC_STRUCT(u_vbuf_mgr_elements);
+
+ ve->count = count;
+
+ if (!count) {
+ return ve;
+ }
+
+ memcpy(ve->ve, attribs, sizeof(struct pipe_vertex_element) * count);
+ memcpy(native_attribs, attribs, sizeof(struct pipe_vertex_element) * count);
+
+ /* Set the best native format in case the original format is not
+ * supported. */
+ for (i = 0; i < count; i++) {
+ enum pipe_format format = ve->ve[i].src_format;
+
+ ve->src_format_size[i] = util_format_get_blocksize(format);
+
+ /* Choose a native format.
+ * For now we don't care about the alignment, that's going to
+ * be sorted out later. */
+ if (!mgr->caps.format_fixed32) {
+ switch (format) {
+ FORMAT_REPLACE(R32_FIXED, R32_FLOAT);
+ FORMAT_REPLACE(R32G32_FIXED, R32G32_FLOAT);
+ FORMAT_REPLACE(R32G32B32_FIXED, R32G32B32_FLOAT);
+ FORMAT_REPLACE(R32G32B32A32_FIXED, R32G32B32A32_FLOAT);
+ default:;
+ }
+ }
+ if (!mgr->caps.format_float16) {
+ switch (format) {
+ FORMAT_REPLACE(R16_FLOAT, R32_FLOAT);
+ FORMAT_REPLACE(R16G16_FLOAT, R32G32_FLOAT);
+ FORMAT_REPLACE(R16G16B16_FLOAT, R32G32B32_FLOAT);
+ FORMAT_REPLACE(R16G16B16A16_FLOAT, R32G32B32A32_FLOAT);
+ default:;
+ }
+ }
+ if (!mgr->caps.format_float64) {
+ switch (format) {
+ FORMAT_REPLACE(R64_FLOAT, R32_FLOAT);
+ FORMAT_REPLACE(R64G64_FLOAT, R32G32_FLOAT);
+ FORMAT_REPLACE(R64G64B64_FLOAT, R32G32B32_FLOAT);
+ FORMAT_REPLACE(R64G64B64A64_FLOAT, R32G32B32A32_FLOAT);
+ default:;
+ }
+ }
+ if (!mgr->caps.format_norm32) {
+ switch (format) {
+ FORMAT_REPLACE(R32_UNORM, R32_FLOAT);
+ FORMAT_REPLACE(R32G32_UNORM, R32G32_FLOAT);
+ FORMAT_REPLACE(R32G32B32_UNORM, R32G32B32_FLOAT);
+ FORMAT_REPLACE(R32G32B32A32_UNORM, R32G32B32A32_FLOAT);
+ FORMAT_REPLACE(R32_SNORM, R32_FLOAT);
+ FORMAT_REPLACE(R32G32_SNORM, R32G32_FLOAT);
+ FORMAT_REPLACE(R32G32B32_SNORM, R32G32B32_FLOAT);
+ FORMAT_REPLACE(R32G32B32A32_SNORM, R32G32B32A32_FLOAT);
+ default:;
+ }
+ }
+ if (!mgr->caps.format_scaled32) {
+ switch (format) {
+ FORMAT_REPLACE(R32_USCALED, R32_FLOAT);
+ FORMAT_REPLACE(R32G32_USCALED, R32G32_FLOAT);
+ FORMAT_REPLACE(R32G32B32_USCALED, R32G32B32_FLOAT);
+ FORMAT_REPLACE(R32G32B32A32_USCALED,R32G32B32A32_FLOAT);
+ FORMAT_REPLACE(R32_SSCALED, R32_FLOAT);
+ FORMAT_REPLACE(R32G32_SSCALED, R32G32_FLOAT);
+ FORMAT_REPLACE(R32G32B32_SSCALED, R32G32B32_FLOAT);
+ FORMAT_REPLACE(R32G32B32A32_SSCALED,R32G32B32A32_FLOAT);
+ default:;
+ }
+ }
+
+ native_attribs[i].src_format = format;
+ ve->native_format[i] = format;
+ ve->native_format_size[i] =
+ util_format_get_blocksize(ve->native_format[i]);
+
+ ve->incompatible_layout =
+ ve->incompatible_layout ||
+ ve->ve[i].src_format != ve->native_format[i] ||
+ (!mgr->caps.fetch_dword_unaligned && ve->ve[i].src_offset % 4 != 0);
+ }
+
+ /* Align the formats to the size of DWORD if needed. */
+ if (!mgr->caps.fetch_dword_unaligned) {
+ for (i = 0; i < count; i++) {
+ ve->native_format_size[i] = align(ve->native_format_size[i], 4);
+ }
+ }
+
+ return ve;
+}
+
+void u_vbuf_mgr_bind_vertex_elements(struct u_vbuf_mgr *mgrb,
+ void *cso,
+ struct u_vbuf_mgr_elements *ve)
+{
+ struct u_vbuf_mgr_priv *mgr = (struct u_vbuf_mgr_priv*)mgrb;
+
+ if (!cso) {
+ return;
+ }
+
+ if (!mgr->ve_binding_lock) {
+ mgr->saved_ve = cso;
+ mgr->ve = ve;
+ }
+}
+
+void u_vbuf_mgr_destroy_vertex_elements(struct u_vbuf_mgr *mgr,
+ struct u_vbuf_mgr_elements *ve)
+{
+ FREE(ve);
+}
+
+void u_vbuf_mgr_set_vertex_buffers(struct u_vbuf_mgr *mgrb,
+ unsigned count,
+ const struct pipe_vertex_buffer *bufs)
+{
+ struct u_vbuf_mgr_priv *mgr = (struct u_vbuf_mgr_priv*)mgrb;
+ unsigned i;
+
+ mgr->any_user_vbs = FALSE;
+ mgr->incompatible_vb_layout = FALSE;
+
+ if (!mgr->caps.fetch_dword_unaligned) {
+ /* Check if the strides and offsets are aligned to the size of DWORD. */
+ for (i = 0; i < count; i++) {
+ if (bufs[i].buffer) {
+ if (bufs[i].stride % 4 != 0 ||
+ bufs[i].buffer_offset % 4 != 0) {
+ mgr->incompatible_vb_layout = TRUE;
+ break;
+ }
+ }
+ }
+ }
+
+ for (i = 0; i < count; i++) {
+ const struct pipe_vertex_buffer *vb = &bufs[i];
+
+ pipe_resource_reference(&mgr->b.vertex_buffer[i].buffer, vb->buffer);
+ pipe_resource_reference(&mgr->b.real_vertex_buffer[i], NULL);
+
+ if (!vb->buffer) {
+ continue;
+ }
+
+ if (u_vbuf_resource(vb->buffer)->user_ptr) {
+ mgr->any_user_vbs = TRUE;
+ continue;
+ }
+
+ pipe_resource_reference(&mgr->b.real_vertex_buffer[i], vb->buffer);
+ }
+
+ for (; i < mgr->b.nr_real_vertex_buffers; i++) {
+ pipe_resource_reference(&mgr->b.vertex_buffer[i].buffer, NULL);
+ pipe_resource_reference(&mgr->b.real_vertex_buffer[i], NULL);
+ }
+
+ memcpy(mgr->b.vertex_buffer, bufs,
+ sizeof(struct pipe_vertex_buffer) * count);
+
+ mgr->b.nr_vertex_buffers = count;
+ mgr->b.nr_real_vertex_buffers = count;
+}
+
+static void u_vbuf_upload_buffers(struct u_vbuf_mgr_priv *mgr,
+ int min_index, int max_index,
+ unsigned instance_count,
+ boolean *upload_flushed)
+{
+ unsigned i, nr = mgr->ve->count;
+ unsigned count = max_index + 1 - min_index;
+ boolean uploaded[PIPE_MAX_ATTRIBS] = {0};
+
+ for (i = 0; i < nr; i++) {
+ unsigned index = mgr->ve->ve[i].vertex_buffer_index;
+ struct pipe_vertex_buffer *vb = &mgr->b.vertex_buffer[index];
+
+ if (vb->buffer &&
+ u_vbuf_resource(vb->buffer)->user_ptr &&
+ !uploaded[index]) {
+ unsigned first, size;
+ boolean flushed;
+ unsigned instance_div = mgr->ve->ve[i].instance_divisor;
+
+ if (instance_div) {
+ first = 0;
+ size = vb->stride *
+ ((instance_count + instance_div - 1) / instance_div);
+ } else if (vb->stride) {
+ first = vb->stride * min_index;
+ size = vb->stride * count;
+ } else {
+ first = 0;
+ size = mgr->ve->native_format_size[i];
+ }
+
+ u_upload_data(mgr->b.uploader, first, size,
+ u_vbuf_resource(vb->buffer)->user_ptr + first,
+ &vb->buffer_offset,
+ &mgr->b.real_vertex_buffer[index],
+ &flushed);
+
+ vb->buffer_offset -= first;
+
+ uploaded[index] = TRUE;
+ *upload_flushed = *upload_flushed || flushed;
+ } else {
+ assert(mgr->b.real_vertex_buffer[index]);
+ }
+ }
+}
+
+static void u_vbuf_mgr_compute_max_index(struct u_vbuf_mgr_priv *mgr)
+{
+ unsigned i, nr = mgr->ve->count;
+
+ mgr->b.max_index = ~0;
+
+ for (i = 0; i < nr; i++) {
+ struct pipe_vertex_buffer *vb =
+ &mgr->b.vertex_buffer[mgr->ve->ve[i].vertex_buffer_index];
+ int unused;
+ unsigned max_index;
+
+ if (!vb->buffer ||
+ !vb->stride ||
+ u_vbuf_resource(vb->buffer)->user_ptr) {
+ continue;
+ }
+
+ /* How many bytes is unused after the last vertex.
+ * width0 may be "count*stride - unused" and we have to compensate
+ * for that when dividing by stride. */
+ unused = vb->stride -
+ (mgr->ve->ve[i].src_offset + mgr->ve->src_format_size[i]);
+
+ /* If src_offset is greater than stride (which means it's a buffer
+ * offset rather than a vertex offset)... */
+ if (unused < 0) {
+ unused = 0;
+ }
+
+ /* Compute the maximum index for this vertex element. */
+ max_index =
+ (vb->buffer->width0 - vb->buffer_offset + (unsigned)unused) /
+ vb->stride - 1;
+
+ mgr->b.max_index = MIN2(mgr->b.max_index, max_index);
+ }
+}
+
+void u_vbuf_mgr_draw_begin(struct u_vbuf_mgr *mgrb,
+ const struct pipe_draw_info *info,
+ boolean *buffers_updated,
+ boolean *uploader_flushed)
+{
+ struct u_vbuf_mgr_priv *mgr = (struct u_vbuf_mgr_priv*)mgrb;
+ boolean bufs_updated = FALSE, upload_flushed = FALSE;
+ int min_index, max_index;
+
+ u_vbuf_mgr_compute_max_index(mgr);
+
+ min_index = info->min_index - info->index_bias;
+ if (info->max_index == ~0) {
+ max_index = mgr->b.max_index;
+ } else {
+ max_index = MIN2(info->max_index - info->index_bias, mgr->b.max_index);
+ }
+
+ /* Translate vertices with non-native layouts or formats. */
+ if (mgr->incompatible_vb_layout || mgr->ve->incompatible_layout) {
+ u_vbuf_translate_begin(mgr, min_index, max_index, &upload_flushed);
+
+ if (mgr->fallback_ve) {
+ bufs_updated = TRUE;
+ }
+ }
+
+ /* Upload user buffers. */
+ if (mgr->any_user_vbs) {
+ u_vbuf_upload_buffers(mgr, min_index, max_index, info->instance_count,
+ &upload_flushed);
+ bufs_updated = TRUE;
+ }
+
+ /* Set the return values. */
+ if (buffers_updated) {
+ *buffers_updated = bufs_updated;
+ }
+ if (uploader_flushed) {
+ *uploader_flushed = upload_flushed;
+ }
+}
+
+void u_vbuf_mgr_draw_end(struct u_vbuf_mgr *mgrb)
+{
+ struct u_vbuf_mgr_priv *mgr = (struct u_vbuf_mgr_priv*)mgrb;
+
+ if (mgr->fallback_ve) {
+ u_vbuf_translate_end(mgr);
+ }
+}
diff --git a/mesalib/src/glsl/ast.h b/mesalib/src/glsl/ast.h
index 878f48b20..6963b83af 100644
--- a/mesalib/src/glsl/ast.h
+++ b/mesalib/src/glsl/ast.h
@@ -63,6 +63,10 @@ public:
/* If the user *does* call delete, that's OK, we will just
* ralloc_free in that case. */
+ static void operator delete(void *table, void *ctx)
+ {
+ ralloc_free(table);
+ }
static void operator delete(void *table)
{
ralloc_free(table);
diff --git a/mesalib/src/glsl/ast_expr.cpp b/mesalib/src/glsl/ast_expr.cpp
index e624d11cf..e8812e7a1 100644
--- a/mesalib/src/glsl/ast_expr.cpp
+++ b/mesalib/src/glsl/ast_expr.cpp
@@ -1,95 +1,95 @@
-/*
- * Copyright © 2010 Intel Corporation
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-#include <assert.h>
-#include "ast.h"
-
-const char *
-ast_expression::operator_string(enum ast_operators op)
-{
- static const char *const operators[] = {
- "=",
- "+",
- "-",
- "+",
- "-",
- "*",
- "/",
- "%",
- "<<",
- ">>",
- "<",
- ">",
- "<=",
- ">=",
- "==",
- "!=",
- "&",
- "^",
- "|",
- "~",
- "&&",
- "^^",
- "||",
- "!",
-
- "*=",
- "/=",
- "%=",
- "+=",
- "-=",
- "<<=",
- ">>=",
- "&=",
- "^=",
- "|=",
-
- "?:",
-
- "++",
- "--",
- "++",
- "--",
- ".",
- };
-
- assert((unsigned int)op < sizeof(operators) / sizeof(operators[0]));
-
- return operators[op];
-}
-
-
-ast_expression_bin::ast_expression_bin(int oper, ast_expression *ex0,
- ast_expression *ex1) :
- ast_expression(oper, ex0, ex1, NULL)
-{
- assert((oper >= ast_plus) && (oper <= ast_logic_not));
-}
-
-
-void
-ast_expression_bin::print(void) const
-{
- subexpressions[0]->print();
- printf("%s ", operator_string(oper));
- subexpressions[1]->print();
-}
+/*
+ * Copyright © 2010 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+#include <assert.h>
+#include "ast.h"
+
+const char *
+ast_expression::operator_string(enum ast_operators op)
+{
+ static const char *const operators[] = {
+ "=",
+ "+",
+ "-",
+ "+",
+ "-",
+ "*",
+ "/",
+ "%",
+ "<<",
+ ">>",
+ "<",
+ ">",
+ "<=",
+ ">=",
+ "==",
+ "!=",
+ "&",
+ "^",
+ "|",
+ "~",
+ "&&",
+ "^^",
+ "||",
+ "!",
+
+ "*=",
+ "/=",
+ "%=",
+ "+=",
+ "-=",
+ "<<=",
+ ">>=",
+ "&=",
+ "^=",
+ "|=",
+
+ "?:",
+
+ "++",
+ "--",
+ "++",
+ "--",
+ ".",
+ };
+
+ assert((unsigned int)op < sizeof(operators) / sizeof(operators[0]));
+
+ return operators[op];
+}
+
+
+ast_expression_bin::ast_expression_bin(int oper, ast_expression *ex0,
+ ast_expression *ex1) :
+ ast_expression(oper, ex0, ex1, NULL)
+{
+ assert((oper >= ast_plus) && (oper <= ast_logic_not));
+}
+
+
+void
+ast_expression_bin::print(void) const
+{
+ subexpressions[0]->print();
+ printf("%s ", operator_string(oper));
+ subexpressions[1]->print();
+}
diff --git a/mesalib/src/glsl/ast_function.cpp b/mesalib/src/glsl/ast_function.cpp
index 3ba699ad9..fbda41294 100644
--- a/mesalib/src/glsl/ast_function.cpp
+++ b/mesalib/src/glsl/ast_function.cpp
@@ -1,1295 +1,1295 @@
-/*
- * Copyright © 2010 Intel Corporation
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-
-#include "glsl_symbol_table.h"
-#include "ast.h"
-#include "glsl_types.h"
-#include "ir.h"
-#include "main/core.h" /* for MIN2 */
-
-static ir_rvalue *
-convert_component(ir_rvalue *src, const glsl_type *desired_type);
-
-bool
-apply_implicit_conversion(const glsl_type *to, ir_rvalue * &from,
- struct _mesa_glsl_parse_state *state);
-
-static unsigned
-process_parameters(exec_list *instructions, exec_list *actual_parameters,
- exec_list *parameters,
- struct _mesa_glsl_parse_state *state)
-{
- unsigned count = 0;
-
- foreach_list (n, parameters) {
- ast_node *const ast = exec_node_data(ast_node, n, link);
- ir_rvalue *result = ast->hir(instructions, state);
-
- ir_constant *const constant = result->constant_expression_value();
- if (constant != NULL)
- result = constant;
-
- actual_parameters->push_tail(result);
- count++;
- }
-
- return count;
-}
-
-
-/**
- * Generate a source prototype for a function signature
- *
- * \param return_type Return type of the function. May be \c NULL.
- * \param name Name of the function.
- * \param parameters Parameter list for the function. This may be either a
- * formal or actual parameter list. Only the type is used.
- *
- * \return
- * A ralloced string representing the prototype of the function.
- */
-char *
-prototype_string(const glsl_type *return_type, const char *name,
- exec_list *parameters)
-{
- char *str = NULL;
-
- if (return_type != NULL)
- str = ralloc_asprintf(NULL, "%s ", return_type->name);
-
- ralloc_asprintf_append(&str, "%s(", name);
-
- const char *comma = "";
- foreach_list(node, parameters) {
- const ir_instruction *const param = (ir_instruction *) node;
-
- ralloc_asprintf_append(&str, "%s%s", comma, param->type->name);
- comma = ", ";
- }
-
- ralloc_strcat(&str, ")");
- return str;
-}
-
-
-static ir_rvalue *
-match_function_by_name(exec_list *instructions, const char *name,
- YYLTYPE *loc, exec_list *actual_parameters,
- struct _mesa_glsl_parse_state *state)
-{
- void *ctx = state;
- ir_function *f = state->symbols->get_function(name);
- ir_function_signature *sig;
-
- sig = f ? f->matching_signature(actual_parameters) : NULL;
-
- /* FINISHME: This doesn't handle the case where shader X contains a
- * FINISHME: matching signature but shader X + N contains an _exact_
- * FINISHME: matching signature.
- */
- if (sig == NULL
- && (f == NULL || state->es_shader || !f->has_user_signature())
- && state->symbols->get_type(name) == NULL
- && (state->language_version == 110
- || state->symbols->get_variable(name) == NULL)) {
- /* The current shader doesn't contain a matching function or signature.
- * Before giving up, look for the prototype in the built-in functions.
- */
- for (unsigned i = 0; i < state->num_builtins_to_link; i++) {
- ir_function *builtin;
- builtin = state->builtins_to_link[i]->symbols->get_function(name);
- sig = builtin ? builtin->matching_signature(actual_parameters) : NULL;
- if (sig != NULL) {
- if (f == NULL) {
- f = new(ctx) ir_function(name);
- state->symbols->add_global_function(f);
- emit_function(state, instructions, f);
- }
-
- f->add_signature(sig->clone_prototype(f, NULL));
- break;
- }
- }
- }
-
- if (sig != NULL) {
- /* Verify that 'out' and 'inout' actual parameters are lvalues. This
- * isn't done in ir_function::matching_signature because that function
- * cannot generate the necessary diagnostics.
- *
- * Also, validate that 'const_in' formal parameters (an extension of our
- * IR) correspond to ir_constant actual parameters.
- */
- exec_list_iterator actual_iter = actual_parameters->iterator();
- exec_list_iterator formal_iter = sig->parameters.iterator();
-
- while (actual_iter.has_next()) {
- ir_rvalue *actual = (ir_rvalue *) actual_iter.get();
- ir_variable *formal = (ir_variable *) formal_iter.get();
-
- assert(actual != NULL);
- assert(formal != NULL);
-
- if (formal->mode == ir_var_const_in && !actual->as_constant()) {
- _mesa_glsl_error(loc, state,
- "parameter `%s' must be a constant expression",
- formal->name);
- }
-
- if ((formal->mode == ir_var_out)
- || (formal->mode == ir_var_inout)) {
- const char *mode = NULL;
- switch (formal->mode) {
- case ir_var_out: mode = "out"; break;
- case ir_var_inout: mode = "inout"; break;
- default: assert(false); break;
- }
- /* FIXME: 'loc' is incorrect (as of 2011-01-21). It is always
- * FIXME: 0:0(0).
- */
- if (actual->variable_referenced()
- && actual->variable_referenced()->read_only) {
- _mesa_glsl_error(loc, state,
- "function parameter '%s %s' references the "
- "read-only variable '%s'",
- mode, formal->name,
- actual->variable_referenced()->name);
-
- } else if (!actual->is_lvalue()) {
- _mesa_glsl_error(loc, state,
- "function parameter '%s %s' is not an lvalue",
- mode, formal->name);
- }
- }
-
- if (formal->type->is_numeric() || formal->type->is_boolean()) {
- ir_rvalue *converted = convert_component(actual, formal->type);
- actual->replace_with(converted);
- }
-
- actual_iter.next();
- formal_iter.next();
- }
-
- /* Always insert the call in the instruction stream, and return a deref
- * of its return val if it returns a value, since we don't know if
- * the rvalue is going to be assigned to anything or not.
- */
- ir_call *call = new(ctx) ir_call(sig, actual_parameters);
- if (!sig->return_type->is_void()) {
- ir_variable *var;
- ir_dereference_variable *deref;
-
- var = new(ctx) ir_variable(sig->return_type,
- ralloc_asprintf(ctx, "%s_retval",
- sig->function_name()),
- ir_var_temporary);
- instructions->push_tail(var);
-
- deref = new(ctx) ir_dereference_variable(var);
- ir_assignment *assign = new(ctx) ir_assignment(deref, call, NULL);
- instructions->push_tail(assign);
- if (state->language_version >= 120)
- var->constant_value = call->constant_expression_value();
-
- deref = new(ctx) ir_dereference_variable(var);
- return deref;
- } else {
- instructions->push_tail(call);
- return NULL;
- }
- } else {
- char *str = prototype_string(NULL, name, actual_parameters);
-
- _mesa_glsl_error(loc, state, "no matching function for call to `%s'",
- str);
- ralloc_free(str);
-
- const char *prefix = "candidates are: ";
-
- for (int i = -1; i < (int) state->num_builtins_to_link; i++) {
- glsl_symbol_table *syms = i >= 0 ? state->builtins_to_link[i]->symbols
- : state->symbols;
- f = syms->get_function(name);
- if (f == NULL)
- continue;
-
- foreach_list (node, &f->signatures) {
- ir_function_signature *sig = (ir_function_signature *) node;
-
- str = prototype_string(sig->return_type, f->name, &sig->parameters);
- _mesa_glsl_error(loc, state, "%s%s", prefix, str);
- ralloc_free(str);
-
- prefix = " ";
- }
-
- }
-
- return ir_call::get_error_instruction(ctx);
- }
-}
-
-
-/**
- * Perform automatic type conversion of constructor parameters
- *
- * This implements the rules in the "Conversion and Scalar Constructors"
- * section (GLSL 1.10 section 5.4.1), not the "Implicit Conversions" rules.
- */
-static ir_rvalue *
-convert_component(ir_rvalue *src, const glsl_type *desired_type)
-{
- void *ctx = ralloc_parent(src);
- const unsigned a = desired_type->base_type;
- const unsigned b = src->type->base_type;
- ir_expression *result = NULL;
-
- if (src->type->is_error())
- return src;
-
- assert(a <= GLSL_TYPE_BOOL);
- assert(b <= GLSL_TYPE_BOOL);
-
- if ((a == b) || (src->type->is_integer() && desired_type->is_integer()))
- return src;
-
- switch (a) {
- case GLSL_TYPE_UINT:
- case GLSL_TYPE_INT:
- if (b == GLSL_TYPE_FLOAT)
- result = new(ctx) ir_expression(ir_unop_f2i, desired_type, src, NULL);
- else {
- assert(b == GLSL_TYPE_BOOL);
- result = new(ctx) ir_expression(ir_unop_b2i, desired_type, src, NULL);
- }
- break;
- case GLSL_TYPE_FLOAT:
- switch (b) {
- case GLSL_TYPE_UINT:
- result = new(ctx) ir_expression(ir_unop_u2f, desired_type, src, NULL);
- break;
- case GLSL_TYPE_INT:
- result = new(ctx) ir_expression(ir_unop_i2f, desired_type, src, NULL);
- break;
- case GLSL_TYPE_BOOL:
- result = new(ctx) ir_expression(ir_unop_b2f, desired_type, src, NULL);
- break;
- }
- break;
- case GLSL_TYPE_BOOL:
- switch (b) {
- case GLSL_TYPE_UINT:
- case GLSL_TYPE_INT:
- result = new(ctx) ir_expression(ir_unop_i2b, desired_type, src, NULL);
- break;
- case GLSL_TYPE_FLOAT:
- result = new(ctx) ir_expression(ir_unop_f2b, desired_type, src, NULL);
- break;
- }
- break;
- }
-
- assert(result != NULL);
-
- /* Try constant folding; it may fold in the conversion we just added. */
- ir_constant *const constant = result->constant_expression_value();
- return (constant != NULL) ? (ir_rvalue *) constant : (ir_rvalue *) result;
-}
-
-/**
- * Dereference a specific component from a scalar, vector, or matrix
- */
-static ir_rvalue *
-dereference_component(ir_rvalue *src, unsigned component)
-{
- void *ctx = ralloc_parent(src);
- assert(component < src->type->components());
-
- /* If the source is a constant, just create a new constant instead of a
- * dereference of the existing constant.
- */
- ir_constant *constant = src->as_constant();
- if (constant)
- return new(ctx) ir_constant(constant, component);
-
- if (src->type->is_scalar()) {
- return src;
- } else if (src->type->is_vector()) {
- return new(ctx) ir_swizzle(src, component, 0, 0, 0, 1);
- } else {
- assert(src->type->is_matrix());
-
- /* Dereference a row of the matrix, then call this function again to get
- * a specific element from that row.
- */
- const int c = component / src->type->column_type()->vector_elements;
- const int r = component % src->type->column_type()->vector_elements;
- ir_constant *const col_index = new(ctx) ir_constant(c);
- ir_dereference *const col = new(ctx) ir_dereference_array(src, col_index);
-
- col->type = src->type->column_type();
-
- return dereference_component(col, r);
- }
-
- assert(!"Should not get here.");
- return NULL;
-}
-
-
-static ir_rvalue *
-process_array_constructor(exec_list *instructions,
- const glsl_type *constructor_type,
- YYLTYPE *loc, exec_list *parameters,
- struct _mesa_glsl_parse_state *state)
-{
- void *ctx = state;
- /* Array constructors come in two forms: sized and unsized. Sized array
- * constructors look like 'vec4[2](a, b)', where 'a' and 'b' are vec4
- * variables. In this case the number of parameters must exactly match the
- * specified size of the array.
- *
- * Unsized array constructors look like 'vec4[](a, b)', where 'a' and 'b'
- * are vec4 variables. In this case the size of the array being constructed
- * is determined by the number of parameters.
- *
- * From page 52 (page 58 of the PDF) of the GLSL 1.50 spec:
- *
- * "There must be exactly the same number of arguments as the size of
- * the array being constructed. If no size is present in the
- * constructor, then the array is explicitly sized to the number of
- * arguments provided. The arguments are assigned in order, starting at
- * element 0, to the elements of the constructed array. Each argument
- * must be the same type as the element type of the array, or be a type
- * that can be converted to the element type of the array according to
- * Section 4.1.10 "Implicit Conversions.""
- */
- exec_list actual_parameters;
- const unsigned parameter_count =
- process_parameters(instructions, &actual_parameters, parameters, state);
-
- if ((parameter_count == 0)
- || ((constructor_type->length != 0)
- && (constructor_type->length != parameter_count))) {
- const unsigned min_param = (constructor_type->length == 0)
- ? 1 : constructor_type->length;
-
- _mesa_glsl_error(loc, state, "array constructor must have %s %u "
- "parameter%s",
- (constructor_type->length != 0) ? "at least" : "exactly",
- min_param, (min_param <= 1) ? "" : "s");
- return ir_call::get_error_instruction(ctx);
- }
-
- if (constructor_type->length == 0) {
- constructor_type =
- glsl_type::get_array_instance(constructor_type->element_type(),
- parameter_count);
- assert(constructor_type != NULL);
- assert(constructor_type->length == parameter_count);
- }
-
- bool all_parameters_are_constant = true;
-
- /* Type cast each parameter and, if possible, fold constants. */
- foreach_list_safe(n, &actual_parameters) {
- ir_rvalue *ir = (ir_rvalue *) n;
- ir_rvalue *result = ir;
-
- /* Apply implicit conversions (not the scalar constructor rules!) */
- if (constructor_type->element_type()->is_float()) {
- const glsl_type *desired_type =
- glsl_type::get_instance(GLSL_TYPE_FLOAT,
- ir->type->vector_elements,
- ir->type->matrix_columns);
- result = convert_component(ir, desired_type);
- }
-
- if (result->type != constructor_type->element_type()) {
- _mesa_glsl_error(loc, state, "type error in array constructor: "
- "expected: %s, found %s",
- constructor_type->element_type()->name,
- result->type->name);
- }
-
- /* Attempt to convert the parameter to a constant valued expression.
- * After doing so, track whether or not all the parameters to the
- * constructor are trivially constant valued expressions.
- */
- ir_rvalue *const constant = result->constant_expression_value();
-
- if (constant != NULL)
- result = constant;
- else
- all_parameters_are_constant = false;
-
- ir->replace_with(result);
- }
-
- if (all_parameters_are_constant)
- return new(ctx) ir_constant(constructor_type, &actual_parameters);
-
- ir_variable *var = new(ctx) ir_variable(constructor_type, "array_ctor",
- ir_var_temporary);
- instructions->push_tail(var);
-
- int i = 0;
- foreach_list(node, &actual_parameters) {
- ir_rvalue *rhs = (ir_rvalue *) node;
- ir_rvalue *lhs = new(ctx) ir_dereference_array(var,
- new(ctx) ir_constant(i));
-
- ir_instruction *assignment = new(ctx) ir_assignment(lhs, rhs, NULL);
- instructions->push_tail(assignment);
-
- i++;
- }
-
- return new(ctx) ir_dereference_variable(var);
-}
-
-
-/**
- * Try to convert a record constructor to a constant expression
- */
-static ir_constant *
-constant_record_constructor(const glsl_type *constructor_type,
- exec_list *parameters, void *mem_ctx)
-{
- foreach_list(node, parameters) {
- ir_constant *constant = ((ir_instruction *) node)->as_constant();
- if (constant == NULL)
- return NULL;
- node->replace_with(constant);
- }
-
- return new(mem_ctx) ir_constant(constructor_type, parameters);
-}
-
-
-/**
- * Determine if a list consists of a single scalar r-value
- */
-bool
-single_scalar_parameter(exec_list *parameters)
-{
- const ir_rvalue *const p = (ir_rvalue *) parameters->head;
- assert(((ir_rvalue *)p)->as_rvalue() != NULL);
-
- return (p->type->is_scalar() && p->next->is_tail_sentinel());
-}
-
-
-/**
- * Generate inline code for a vector constructor
- *
- * The generated constructor code will consist of a temporary variable
- * declaration of the same type as the constructor. A sequence of assignments
- * from constructor parameters to the temporary will follow.
- *
- * \return
- * An \c ir_dereference_variable of the temprorary generated in the constructor
- * body.
- */
-ir_rvalue *
-emit_inline_vector_constructor(const glsl_type *type,
- exec_list *instructions,
- exec_list *parameters,
- void *ctx)
-{
- assert(!parameters->is_empty());
-
- ir_variable *var = new(ctx) ir_variable(type, "vec_ctor", ir_var_temporary);
- instructions->push_tail(var);
-
- /* There are two kinds of vector constructors.
- *
- * - Construct a vector from a single scalar by replicating that scalar to
- * all components of the vector.
- *
- * - Construct a vector from an arbirary combination of vectors and
- * scalars. The components of the constructor parameters are assigned
- * to the vector in order until the vector is full.
- */
- const unsigned lhs_components = type->components();
- if (single_scalar_parameter(parameters)) {
- ir_rvalue *first_param = (ir_rvalue *)parameters->head;
- ir_rvalue *rhs = new(ctx) ir_swizzle(first_param, 0, 0, 0, 0,
- lhs_components);
- ir_dereference_variable *lhs = new(ctx) ir_dereference_variable(var);
- const unsigned mask = (1U << lhs_components) - 1;
-
- assert(rhs->type == lhs->type);
-
- ir_instruction *inst = new(ctx) ir_assignment(lhs, rhs, NULL, mask);
- instructions->push_tail(inst);
- } else {
- unsigned base_component = 0;
- unsigned base_lhs_component = 0;
- ir_constant_data data;
- unsigned constant_mask = 0, constant_components = 0;
-
- memset(&data, 0, sizeof(data));
-
- foreach_list(node, parameters) {
- ir_rvalue *param = (ir_rvalue *) node;
- unsigned rhs_components = param->type->components();
-
- /* Do not try to assign more components to the vector than it has!
- */
- if ((rhs_components + base_lhs_component) > lhs_components) {
- rhs_components = lhs_components - base_lhs_component;
- }
-
- const ir_constant *const c = param->as_constant();
- if (c != NULL) {
- for (unsigned i = 0; i < rhs_components; i++) {
- switch (c->type->base_type) {
- case GLSL_TYPE_UINT:
- data.u[i + base_component] = c->get_uint_component(i);
- break;
- case GLSL_TYPE_INT:
- data.i[i + base_component] = c->get_int_component(i);
- break;
- case GLSL_TYPE_FLOAT:
- data.f[i + base_component] = c->get_float_component(i);
- break;
- case GLSL_TYPE_BOOL:
- data.b[i + base_component] = c->get_bool_component(i);
- break;
- default:
- assert(!"Should not get here.");
- break;
- }
- }
-
- /* Mask of fields to be written in the assignment.
- */
- constant_mask |= ((1U << rhs_components) - 1) << base_lhs_component;
- constant_components += rhs_components;
-
- base_component += rhs_components;
- }
- /* Advance the component index by the number of components
- * that were just assigned.
- */
- base_lhs_component += rhs_components;
- }
-
- if (constant_mask != 0) {
- ir_dereference *lhs = new(ctx) ir_dereference_variable(var);
- const glsl_type *rhs_type = glsl_type::get_instance(var->type->base_type,
- constant_components,
- 1);
- ir_rvalue *rhs = new(ctx) ir_constant(rhs_type, &data);
-
- ir_instruction *inst =
- new(ctx) ir_assignment(lhs, rhs, NULL, constant_mask);
- instructions->push_tail(inst);
- }
-
- base_component = 0;
- foreach_list(node, parameters) {
- ir_rvalue *param = (ir_rvalue *) node;
- unsigned rhs_components = param->type->components();
-
- /* Do not try to assign more components to the vector than it has!
- */
- if ((rhs_components + base_component) > lhs_components) {
- rhs_components = lhs_components - base_component;
- }
-
- const ir_constant *const c = param->as_constant();
- if (c == NULL) {
- /* Mask of fields to be written in the assignment.
- */
- const unsigned write_mask = ((1U << rhs_components) - 1)
- << base_component;
-
- ir_dereference *lhs = new(ctx) ir_dereference_variable(var);
-
- /* Generate a swizzle so that LHS and RHS sizes match.
- */
- ir_rvalue *rhs =
- new(ctx) ir_swizzle(param, 0, 1, 2, 3, rhs_components);
-
- ir_instruction *inst =
- new(ctx) ir_assignment(lhs, rhs, NULL, write_mask);
- instructions->push_tail(inst);
- }
-
- /* Advance the component index by the number of components that were
- * just assigned.
- */
- base_component += rhs_components;
- }
- }
- return new(ctx) ir_dereference_variable(var);
-}
-
-
-/**
- * Generate assignment of a portion of a vector to a portion of a matrix column
- *
- * \param src_base First component of the source to be used in assignment
- * \param column Column of destination to be assiged
- * \param row_base First component of the destination column to be assigned
- * \param count Number of components to be assigned
- *
- * \note
- * \c src_base + \c count must be less than or equal to the number of components
- * in the source vector.
- */
-ir_instruction *
-assign_to_matrix_column(ir_variable *var, unsigned column, unsigned row_base,
- ir_rvalue *src, unsigned src_base, unsigned count,
- void *mem_ctx)
-{
- ir_constant *col_idx = new(mem_ctx) ir_constant(column);
- ir_dereference *column_ref = new(mem_ctx) ir_dereference_array(var, col_idx);
-
- assert(column_ref->type->components() >= (row_base + count));
- assert(src->type->components() >= (src_base + count));
-
- /* Generate a swizzle that extracts the number of components from the source
- * that are to be assigned to the column of the matrix.
- */
- if (count < src->type->vector_elements) {
- src = new(mem_ctx) ir_swizzle(src,
- src_base + 0, src_base + 1,
- src_base + 2, src_base + 3,
- count);
- }
-
- /* Mask of fields to be written in the assignment.
- */
- const unsigned write_mask = ((1U << count) - 1) << row_base;
-
- return new(mem_ctx) ir_assignment(column_ref, src, NULL, write_mask);
-}
-
-
-/**
- * Generate inline code for a matrix constructor
- *
- * The generated constructor code will consist of a temporary variable
- * declaration of the same type as the constructor. A sequence of assignments
- * from constructor parameters to the temporary will follow.
- *
- * \return
- * An \c ir_dereference_variable of the temprorary generated in the constructor
- * body.
- */
-ir_rvalue *
-emit_inline_matrix_constructor(const glsl_type *type,
- exec_list *instructions,
- exec_list *parameters,
- void *ctx)
-{
- assert(!parameters->is_empty());
-
- ir_variable *var = new(ctx) ir_variable(type, "mat_ctor", ir_var_temporary);
- instructions->push_tail(var);
-
- /* There are three kinds of matrix constructors.
- *
- * - Construct a matrix from a single scalar by replicating that scalar to
- * along the diagonal of the matrix and setting all other components to
- * zero.
- *
- * - Construct a matrix from an arbirary combination of vectors and
- * scalars. The components of the constructor parameters are assigned
- * to the matrix in colum-major order until the matrix is full.
- *
- * - Construct a matrix from a single matrix. The source matrix is copied
- * to the upper left portion of the constructed matrix, and the remaining
- * elements take values from the identity matrix.
- */
- ir_rvalue *const first_param = (ir_rvalue *) parameters->head;
- if (single_scalar_parameter(parameters)) {
- /* Assign the scalar to the X component of a vec4, and fill the remaining
- * components with zero.
- */
- ir_variable *rhs_var =
- new(ctx) ir_variable(glsl_type::vec4_type, "mat_ctor_vec",
- ir_var_temporary);
- instructions->push_tail(rhs_var);
-
- ir_constant_data zero;
- zero.f[0] = 0.0;
- zero.f[1] = 0.0;
- zero.f[2] = 0.0;
- zero.f[3] = 0.0;
-
- ir_instruction *inst =
- new(ctx) ir_assignment(new(ctx) ir_dereference_variable(rhs_var),
- new(ctx) ir_constant(rhs_var->type, &zero),
- NULL);
- instructions->push_tail(inst);
-
- ir_dereference *const rhs_ref = new(ctx) ir_dereference_variable(rhs_var);
-
- inst = new(ctx) ir_assignment(rhs_ref, first_param, NULL, 0x01);
- instructions->push_tail(inst);
-
- /* Assign the temporary vector to each column of the destination matrix
- * with a swizzle that puts the X component on the diagonal of the
- * matrix. In some cases this may mean that the X component does not
- * get assigned into the column at all (i.e., when the matrix has more
- * columns than rows).
- */
- static const unsigned rhs_swiz[4][4] = {
- { 0, 1, 1, 1 },
- { 1, 0, 1, 1 },
- { 1, 1, 0, 1 },
- { 1, 1, 1, 0 }
- };
-
- const unsigned cols_to_init = MIN2(type->matrix_columns,
- type->vector_elements);
- for (unsigned i = 0; i < cols_to_init; i++) {
- ir_constant *const col_idx = new(ctx) ir_constant(i);
- ir_rvalue *const col_ref = new(ctx) ir_dereference_array(var, col_idx);
-
- ir_rvalue *const rhs_ref = new(ctx) ir_dereference_variable(rhs_var);
- ir_rvalue *const rhs = new(ctx) ir_swizzle(rhs_ref, rhs_swiz[i],
- type->vector_elements);
-
- inst = new(ctx) ir_assignment(col_ref, rhs, NULL);
- instructions->push_tail(inst);
- }
-
- for (unsigned i = cols_to_init; i < type->matrix_columns; i++) {
- ir_constant *const col_idx = new(ctx) ir_constant(i);
- ir_rvalue *const col_ref = new(ctx) ir_dereference_array(var, col_idx);
-
- ir_rvalue *const rhs_ref = new(ctx) ir_dereference_variable(rhs_var);
- ir_rvalue *const rhs = new(ctx) ir_swizzle(rhs_ref, 1, 1, 1, 1,
- type->vector_elements);
-
- inst = new(ctx) ir_assignment(col_ref, rhs, NULL);
- instructions->push_tail(inst);
- }
- } else if (first_param->type->is_matrix()) {
- /* From page 50 (56 of the PDF) of the GLSL 1.50 spec:
- *
- * "If a matrix is constructed from a matrix, then each component
- * (column i, row j) in the result that has a corresponding
- * component (column i, row j) in the argument will be initialized
- * from there. All other components will be initialized to the
- * identity matrix. If a matrix argument is given to a matrix
- * constructor, it is an error to have any other arguments."
- */
- assert(first_param->next->is_tail_sentinel());
- ir_rvalue *const src_matrix = first_param;
-
- /* If the source matrix is smaller, pre-initialize the relavent parts of
- * the destination matrix to the identity matrix.
- */
- if ((src_matrix->type->matrix_columns < var->type->matrix_columns)
- || (src_matrix->type->vector_elements < var->type->vector_elements)) {
-
- /* If the source matrix has fewer rows, every column of the destination
- * must be initialized. Otherwise only the columns in the destination
- * that do not exist in the source must be initialized.
- */
- unsigned col =
- (src_matrix->type->vector_elements < var->type->vector_elements)
- ? 0 : src_matrix->type->matrix_columns;
-
- const glsl_type *const col_type = var->type->column_type();
- for (/* empty */; col < var->type->matrix_columns; col++) {
- ir_constant_data ident;
-
- ident.f[0] = 0.0;
- ident.f[1] = 0.0;
- ident.f[2] = 0.0;
- ident.f[3] = 0.0;
-
- ident.f[col] = 1.0;
-
- ir_rvalue *const rhs = new(ctx) ir_constant(col_type, &ident);
-
- ir_rvalue *const lhs =
- new(ctx) ir_dereference_array(var, new(ctx) ir_constant(col));
-
- ir_instruction *inst = new(ctx) ir_assignment(lhs, rhs, NULL);
- instructions->push_tail(inst);
- }
- }
-
- /* Assign columns from the source matrix to the destination matrix.
- *
- * Since the parameter will be used in the RHS of multiple assignments,
- * generate a temporary and copy the paramter there.
- */
- ir_variable *const rhs_var =
- new(ctx) ir_variable(first_param->type, "mat_ctor_mat",
- ir_var_temporary);
- instructions->push_tail(rhs_var);
-
- ir_dereference *const rhs_var_ref =
- new(ctx) ir_dereference_variable(rhs_var);
- ir_instruction *const inst =
- new(ctx) ir_assignment(rhs_var_ref, first_param, NULL);
- instructions->push_tail(inst);
-
- const unsigned last_row = MIN2(src_matrix->type->vector_elements,
- var->type->vector_elements);
- const unsigned last_col = MIN2(src_matrix->type->matrix_columns,
- var->type->matrix_columns);
-
- unsigned swiz[4] = { 0, 0, 0, 0 };
- for (unsigned i = 1; i < last_row; i++)
- swiz[i] = i;
-
- const unsigned write_mask = (1U << last_row) - 1;
-
- for (unsigned i = 0; i < last_col; i++) {
- ir_dereference *const lhs =
- new(ctx) ir_dereference_array(var, new(ctx) ir_constant(i));
- ir_rvalue *const rhs_col =
- new(ctx) ir_dereference_array(rhs_var, new(ctx) ir_constant(i));
-
- /* If one matrix has columns that are smaller than the columns of the
- * other matrix, wrap the column access of the larger with a swizzle
- * so that the LHS and RHS of the assignment have the same size (and
- * therefore have the same type).
- *
- * It would be perfectly valid to unconditionally generate the
- * swizzles, this this will typically result in a more compact IR tree.
- */
- ir_rvalue *rhs;
- if (lhs->type->vector_elements != rhs_col->type->vector_elements) {
- rhs = new(ctx) ir_swizzle(rhs_col, swiz, last_row);
- } else {
- rhs = rhs_col;
- }
-
- ir_instruction *inst =
- new(ctx) ir_assignment(lhs, rhs, NULL, write_mask);
- instructions->push_tail(inst);
- }
- } else {
- const unsigned cols = type->matrix_columns;
- const unsigned rows = type->vector_elements;
- unsigned col_idx = 0;
- unsigned row_idx = 0;
-
- foreach_list (node, parameters) {
- ir_rvalue *const rhs = (ir_rvalue *) node;
- const unsigned components_remaining_this_column = rows - row_idx;
- unsigned rhs_components = rhs->type->components();
- unsigned rhs_base = 0;
-
- /* Since the parameter might be used in the RHS of two assignments,
- * generate a temporary and copy the paramter there.
- */
- ir_variable *rhs_var =
- new(ctx) ir_variable(rhs->type, "mat_ctor_vec", ir_var_temporary);
- instructions->push_tail(rhs_var);
-
- ir_dereference *rhs_var_ref =
- new(ctx) ir_dereference_variable(rhs_var);
- ir_instruction *inst = new(ctx) ir_assignment(rhs_var_ref, rhs, NULL);
- instructions->push_tail(inst);
-
- /* Assign the current parameter to as many components of the matrix
- * as it will fill.
- *
- * NOTE: A single vector parameter can span two matrix columns. A
- * single vec4, for example, can completely fill a mat2.
- */
- if (rhs_components >= components_remaining_this_column) {
- const unsigned count = MIN2(rhs_components,
- components_remaining_this_column);
-
- rhs_var_ref = new(ctx) ir_dereference_variable(rhs_var);
-
- ir_instruction *inst = assign_to_matrix_column(var, col_idx,
- row_idx,
- rhs_var_ref, 0,
- count, ctx);
- instructions->push_tail(inst);
-
- rhs_base = count;
-
- col_idx++;
- row_idx = 0;
- }
-
- /* If there is data left in the parameter and components left to be
- * set in the destination, emit another assignment. It is possible
- * that the assignment could be of a vec4 to the last element of the
- * matrix. In this case col_idx==cols, but there is still data
- * left in the source parameter. Obviously, don't emit an assignment
- * to data outside the destination matrix.
- */
- if ((col_idx < cols) && (rhs_base < rhs_components)) {
- const unsigned count = rhs_components - rhs_base;
-
- rhs_var_ref = new(ctx) ir_dereference_variable(rhs_var);
-
- ir_instruction *inst = assign_to_matrix_column(var, col_idx,
- row_idx,
- rhs_var_ref,
- rhs_base,
- count, ctx);
- instructions->push_tail(inst);
-
- row_idx += count;
- }
- }
- }
-
- return new(ctx) ir_dereference_variable(var);
-}
-
-
-ir_rvalue *
-emit_inline_record_constructor(const glsl_type *type,
- exec_list *instructions,
- exec_list *parameters,
- void *mem_ctx)
-{
- ir_variable *const var =
- new(mem_ctx) ir_variable(type, "record_ctor", ir_var_temporary);
- ir_dereference_variable *const d = new(mem_ctx) ir_dereference_variable(var);
-
- instructions->push_tail(var);
-
- exec_node *node = parameters->head;
- for (unsigned i = 0; i < type->length; i++) {
- assert(!node->is_tail_sentinel());
-
- ir_dereference *const lhs =
- new(mem_ctx) ir_dereference_record(d->clone(mem_ctx, NULL),
- type->fields.structure[i].name);
-
- ir_rvalue *const rhs = ((ir_instruction *) node)->as_rvalue();
- assert(rhs != NULL);
-
- ir_instruction *const assign = new(mem_ctx) ir_assignment(lhs, rhs, NULL);
-
- instructions->push_tail(assign);
- node = node->next;
- }
-
- return d;
-}
-
-
-ir_rvalue *
-ast_function_expression::hir(exec_list *instructions,
- struct _mesa_glsl_parse_state *state)
-{
- void *ctx = state;
- /* There are three sorts of function calls.
- *
- * 1. constructors - The first subexpression is an ast_type_specifier.
- * 2. methods - Only the .length() method of array types.
- * 3. functions - Calls to regular old functions.
- *
- * Method calls are actually detected when the ast_field_selection
- * expression is handled.
- */
- if (is_constructor()) {
- const ast_type_specifier *type = (ast_type_specifier *) subexpressions[0];
- YYLTYPE loc = type->get_location();
- const char *name;
-
- const glsl_type *const constructor_type = type->glsl_type(& name, state);
-
- /* constructor_type can be NULL if a variable with the same name as the
- * structure has come into scope.
- */
- if (constructor_type == NULL) {
- _mesa_glsl_error(& loc, state, "unknown type `%s' (structure name "
- "may be shadowed by a variable with the same name)",
- type->type_name);
- return ir_call::get_error_instruction(ctx);
- }
-
-
- /* Constructors for samplers are illegal.
- */
- if (constructor_type->is_sampler()) {
- _mesa_glsl_error(& loc, state, "cannot construct sampler type `%s'",
- constructor_type->name);
- return ir_call::get_error_instruction(ctx);
- }
-
- if (constructor_type->is_array()) {
- if (state->language_version <= 110) {
- _mesa_glsl_error(& loc, state,
- "array constructors forbidden in GLSL 1.10");
- return ir_call::get_error_instruction(ctx);
- }
-
- return process_array_constructor(instructions, constructor_type,
- & loc, &this->expressions, state);
- }
-
-
- /* There are two kinds of constructor call. Constructors for built-in
- * language types, such as mat4 and vec2, are free form. The only
- * requirement is that the parameters must provide enough values of the
- * correct scalar type. Constructors for arrays and structures must
- * have the exact number of parameters with matching types in the
- * correct order. These constructors follow essentially the same type
- * matching rules as functions.
- */
- if (constructor_type->is_record()) {
- exec_list actual_parameters;
-
- process_parameters(instructions, &actual_parameters,
- &this->expressions, state);
-
- exec_node *node = actual_parameters.head;
- for (unsigned i = 0; i < constructor_type->length; i++) {
- ir_rvalue *ir = (ir_rvalue *) node;
-
- if (node->is_tail_sentinel()) {
- _mesa_glsl_error(&loc, state,
- "insufficient parameters to constructor "
- "for `%s'",
- constructor_type->name);
- return ir_call::get_error_instruction(ctx);
- }
-
- if (apply_implicit_conversion(constructor_type->fields.structure[i].type,
- ir, state)) {
- node->replace_with(ir);
- } else {
- _mesa_glsl_error(&loc, state,
- "parameter type mismatch in constructor "
- "for `%s.%s' (%s vs %s)",
- constructor_type->name,
- constructor_type->fields.structure[i].name,
- ir->type->name,
- constructor_type->fields.structure[i].type->name);
- return ir_call::get_error_instruction(ctx);;
- }
-
- node = node->next;
- }
-
- if (!node->is_tail_sentinel()) {
- _mesa_glsl_error(&loc, state, "too many parameters in constructor "
- "for `%s'", constructor_type->name);
- return ir_call::get_error_instruction(ctx);
- }
-
- ir_rvalue *const constant =
- constant_record_constructor(constructor_type, &actual_parameters,
- state);
-
- return (constant != NULL)
- ? constant
- : emit_inline_record_constructor(constructor_type, instructions,
- &actual_parameters, state);
- }
-
- if (!constructor_type->is_numeric() && !constructor_type->is_boolean())
- return ir_call::get_error_instruction(ctx);
-
- /* Total number of components of the type being constructed. */
- const unsigned type_components = constructor_type->components();
-
- /* Number of components from parameters that have actually been
- * consumed. This is used to perform several kinds of error checking.
- */
- unsigned components_used = 0;
-
- unsigned matrix_parameters = 0;
- unsigned nonmatrix_parameters = 0;
- exec_list actual_parameters;
-
- foreach_list (n, &this->expressions) {
- ast_node *ast = exec_node_data(ast_node, n, link);
- ir_rvalue *result = ast->hir(instructions, state)->as_rvalue();
-
- /* From page 50 (page 56 of the PDF) of the GLSL 1.50 spec:
- *
- * "It is an error to provide extra arguments beyond this
- * last used argument."
- */
- if (components_used >= type_components) {
- _mesa_glsl_error(& loc, state, "too many parameters to `%s' "
- "constructor",
- constructor_type->name);
- return ir_call::get_error_instruction(ctx);
- }
-
- if (!result->type->is_numeric() && !result->type->is_boolean()) {
- _mesa_glsl_error(& loc, state, "cannot construct `%s' from a "
- "non-numeric data type",
- constructor_type->name);
- return ir_call::get_error_instruction(ctx);
- }
-
- /* Count the number of matrix and nonmatrix parameters. This
- * is used below to enforce some of the constructor rules.
- */
- if (result->type->is_matrix())
- matrix_parameters++;
- else
- nonmatrix_parameters++;
-
- actual_parameters.push_tail(result);
- components_used += result->type->components();
- }
-
- /* From page 28 (page 34 of the PDF) of the GLSL 1.10 spec:
- *
- * "It is an error to construct matrices from other matrices. This
- * is reserved for future use."
- */
- if (state->language_version == 110 && matrix_parameters > 0
- && constructor_type->is_matrix()) {
- _mesa_glsl_error(& loc, state, "cannot construct `%s' from a "
- "matrix in GLSL 1.10",
- constructor_type->name);
- return ir_call::get_error_instruction(ctx);
- }
-
- /* From page 50 (page 56 of the PDF) of the GLSL 1.50 spec:
- *
- * "If a matrix argument is given to a matrix constructor, it is
- * an error to have any other arguments."
- */
- if ((matrix_parameters > 0)
- && ((matrix_parameters + nonmatrix_parameters) > 1)
- && constructor_type->is_matrix()) {
- _mesa_glsl_error(& loc, state, "for matrix `%s' constructor, "
- "matrix must be only parameter",
- constructor_type->name);
- return ir_call::get_error_instruction(ctx);
- }
-
- /* From page 28 (page 34 of the PDF) of the GLSL 1.10 spec:
- *
- * "In these cases, there must be enough components provided in the
- * arguments to provide an initializer for every component in the
- * constructed value."
- */
- if (components_used < type_components && components_used != 1
- && matrix_parameters == 0) {
- _mesa_glsl_error(& loc, state, "too few components to construct "
- "`%s'",
- constructor_type->name);
- return ir_call::get_error_instruction(ctx);
- }
-
- /* Later, we cast each parameter to the same base type as the
- * constructor. Since there are no non-floating point matrices, we
- * need to break them up into a series of column vectors.
- */
- if (constructor_type->base_type != GLSL_TYPE_FLOAT) {
- foreach_list_safe(n, &actual_parameters) {
- ir_rvalue *matrix = (ir_rvalue *) n;
-
- if (!matrix->type->is_matrix())
- continue;
-
- /* Create a temporary containing the matrix. */
- ir_variable *var = new(ctx) ir_variable(matrix->type, "matrix_tmp",
- ir_var_temporary);
- instructions->push_tail(var);
- instructions->push_tail(new(ctx) ir_assignment(new(ctx)
- ir_dereference_variable(var), matrix, NULL));
- var->constant_value = matrix->constant_expression_value();
-
- /* Replace the matrix with dereferences of its columns. */
- for (int i = 0; i < matrix->type->matrix_columns; i++) {
- matrix->insert_before(new (ctx) ir_dereference_array(var,
- new(ctx) ir_constant(i)));
- }
- matrix->remove();
- }
- }
-
- bool all_parameters_are_constant = true;
-
- /* Type cast each parameter and, if possible, fold constants.*/
- foreach_list_safe(n, &actual_parameters) {
- ir_rvalue *ir = (ir_rvalue *) n;
-
- const glsl_type *desired_type =
- glsl_type::get_instance(constructor_type->base_type,
- ir->type->vector_elements,
- ir->type->matrix_columns);
- ir_rvalue *result = convert_component(ir, desired_type);
-
- /* Attempt to convert the parameter to a constant valued expression.
- * After doing so, track whether or not all the parameters to the
- * constructor are trivially constant valued expressions.
- */
- ir_rvalue *const constant = result->constant_expression_value();
-
- if (constant != NULL)
- result = constant;
- else
- all_parameters_are_constant = false;
-
- if (result != ir) {
- ir->replace_with(result);
- }
- }
-
- /* If all of the parameters are trivially constant, create a
- * constant representing the complete collection of parameters.
- */
- if (all_parameters_are_constant) {
- return new(ctx) ir_constant(constructor_type, &actual_parameters);
- } else if (constructor_type->is_scalar()) {
- return dereference_component((ir_rvalue *) actual_parameters.head,
- 0);
- } else if (constructor_type->is_vector()) {
- return emit_inline_vector_constructor(constructor_type,
- instructions,
- &actual_parameters,
- ctx);
- } else {
- assert(constructor_type->is_matrix());
- return emit_inline_matrix_constructor(constructor_type,
- instructions,
- &actual_parameters,
- ctx);
- }
- } else {
- const ast_expression *id = subexpressions[0];
- YYLTYPE loc = id->get_location();
- exec_list actual_parameters;
-
- process_parameters(instructions, &actual_parameters, &this->expressions,
- state);
-
- return match_function_by_name(instructions,
- id->primary_expression.identifier, & loc,
- &actual_parameters, state);
- }
-
- return ir_call::get_error_instruction(ctx);
-}
+/*
+ * Copyright © 2010 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+#include "glsl_symbol_table.h"
+#include "ast.h"
+#include "glsl_types.h"
+#include "ir.h"
+#include "main/core.h" /* for MIN2 */
+
+static ir_rvalue *
+convert_component(ir_rvalue *src, const glsl_type *desired_type);
+
+bool
+apply_implicit_conversion(const glsl_type *to, ir_rvalue * &from,
+ struct _mesa_glsl_parse_state *state);
+
+static unsigned
+process_parameters(exec_list *instructions, exec_list *actual_parameters,
+ exec_list *parameters,
+ struct _mesa_glsl_parse_state *state)
+{
+ unsigned count = 0;
+
+ foreach_list (n, parameters) {
+ ast_node *const ast = exec_node_data(ast_node, n, link);
+ ir_rvalue *result = ast->hir(instructions, state);
+
+ ir_constant *const constant = result->constant_expression_value();
+ if (constant != NULL)
+ result = constant;
+
+ actual_parameters->push_tail(result);
+ count++;
+ }
+
+ return count;
+}
+
+
+/**
+ * Generate a source prototype for a function signature
+ *
+ * \param return_type Return type of the function. May be \c NULL.
+ * \param name Name of the function.
+ * \param parameters Parameter list for the function. This may be either a
+ * formal or actual parameter list. Only the type is used.
+ *
+ * \return
+ * A ralloced string representing the prototype of the function.
+ */
+char *
+prototype_string(const glsl_type *return_type, const char *name,
+ exec_list *parameters)
+{
+ char *str = NULL;
+
+ if (return_type != NULL)
+ str = ralloc_asprintf(NULL, "%s ", return_type->name);
+
+ ralloc_asprintf_append(&str, "%s(", name);
+
+ const char *comma = "";
+ foreach_list(node, parameters) {
+ const ir_instruction *const param = (ir_instruction *) node;
+
+ ralloc_asprintf_append(&str, "%s%s", comma, param->type->name);
+ comma = ", ";
+ }
+
+ ralloc_strcat(&str, ")");
+ return str;
+}
+
+
+static ir_rvalue *
+match_function_by_name(exec_list *instructions, const char *name,
+ YYLTYPE *loc, exec_list *actual_parameters,
+ struct _mesa_glsl_parse_state *state)
+{
+ void *ctx = state;
+ ir_function *f = state->symbols->get_function(name);
+ ir_function_signature *sig;
+
+ sig = f ? f->matching_signature(actual_parameters) : NULL;
+
+ /* FINISHME: This doesn't handle the case where shader X contains a
+ * FINISHME: matching signature but shader X + N contains an _exact_
+ * FINISHME: matching signature.
+ */
+ if (sig == NULL
+ && (f == NULL || state->es_shader || !f->has_user_signature())
+ && state->symbols->get_type(name) == NULL
+ && (state->language_version == 110
+ || state->symbols->get_variable(name) == NULL)) {
+ /* The current shader doesn't contain a matching function or signature.
+ * Before giving up, look for the prototype in the built-in functions.
+ */
+ for (unsigned i = 0; i < state->num_builtins_to_link; i++) {
+ ir_function *builtin;
+ builtin = state->builtins_to_link[i]->symbols->get_function(name);
+ sig = builtin ? builtin->matching_signature(actual_parameters) : NULL;
+ if (sig != NULL) {
+ if (f == NULL) {
+ f = new(ctx) ir_function(name);
+ state->symbols->add_global_function(f);
+ emit_function(state, instructions, f);
+ }
+
+ f->add_signature(sig->clone_prototype(f, NULL));
+ break;
+ }
+ }
+ }
+
+ if (sig != NULL) {
+ /* Verify that 'out' and 'inout' actual parameters are lvalues. This
+ * isn't done in ir_function::matching_signature because that function
+ * cannot generate the necessary diagnostics.
+ *
+ * Also, validate that 'const_in' formal parameters (an extension of our
+ * IR) correspond to ir_constant actual parameters.
+ */
+ exec_list_iterator actual_iter = actual_parameters->iterator();
+ exec_list_iterator formal_iter = sig->parameters.iterator();
+
+ while (actual_iter.has_next()) {
+ ir_rvalue *actual = (ir_rvalue *) actual_iter.get();
+ ir_variable *formal = (ir_variable *) formal_iter.get();
+
+ assert(actual != NULL);
+ assert(formal != NULL);
+
+ if (formal->mode == ir_var_const_in && !actual->as_constant()) {
+ _mesa_glsl_error(loc, state,
+ "parameter `%s' must be a constant expression",
+ formal->name);
+ }
+
+ if ((formal->mode == ir_var_out)
+ || (formal->mode == ir_var_inout)) {
+ const char *mode = NULL;
+ switch (formal->mode) {
+ case ir_var_out: mode = "out"; break;
+ case ir_var_inout: mode = "inout"; break;
+ default: assert(false); break;
+ }
+ /* FIXME: 'loc' is incorrect (as of 2011-01-21). It is always
+ * FIXME: 0:0(0).
+ */
+ if (actual->variable_referenced()
+ && actual->variable_referenced()->read_only) {
+ _mesa_glsl_error(loc, state,
+ "function parameter '%s %s' references the "
+ "read-only variable '%s'",
+ mode, formal->name,
+ actual->variable_referenced()->name);
+
+ } else if (!actual->is_lvalue()) {
+ _mesa_glsl_error(loc, state,
+ "function parameter '%s %s' is not an lvalue",
+ mode, formal->name);
+ }
+ }
+
+ if (formal->type->is_numeric() || formal->type->is_boolean()) {
+ ir_rvalue *converted = convert_component(actual, formal->type);
+ actual->replace_with(converted);
+ }
+
+ actual_iter.next();
+ formal_iter.next();
+ }
+
+ /* Always insert the call in the instruction stream, and return a deref
+ * of its return val if it returns a value, since we don't know if
+ * the rvalue is going to be assigned to anything or not.
+ */
+ ir_call *call = new(ctx) ir_call(sig, actual_parameters);
+ if (!sig->return_type->is_void()) {
+ ir_variable *var;
+ ir_dereference_variable *deref;
+
+ var = new(ctx) ir_variable(sig->return_type,
+ ralloc_asprintf(ctx, "%s_retval",
+ sig->function_name()),
+ ir_var_temporary);
+ instructions->push_tail(var);
+
+ deref = new(ctx) ir_dereference_variable(var);
+ ir_assignment *assign = new(ctx) ir_assignment(deref, call, NULL);
+ instructions->push_tail(assign);
+ if (state->language_version >= 120)
+ var->constant_value = call->constant_expression_value();
+
+ deref = new(ctx) ir_dereference_variable(var);
+ return deref;
+ } else {
+ instructions->push_tail(call);
+ return NULL;
+ }
+ } else {
+ char *str = prototype_string(NULL, name, actual_parameters);
+
+ _mesa_glsl_error(loc, state, "no matching function for call to `%s'",
+ str);
+ ralloc_free(str);
+
+ const char *prefix = "candidates are: ";
+
+ for (int i = -1; i < (int) state->num_builtins_to_link; i++) {
+ glsl_symbol_table *syms = i >= 0 ? state->builtins_to_link[i]->symbols
+ : state->symbols;
+ f = syms->get_function(name);
+ if (f == NULL)
+ continue;
+
+ foreach_list (node, &f->signatures) {
+ ir_function_signature *sig = (ir_function_signature *) node;
+
+ str = prototype_string(sig->return_type, f->name, &sig->parameters);
+ _mesa_glsl_error(loc, state, "%s%s", prefix, str);
+ ralloc_free(str);
+
+ prefix = " ";
+ }
+
+ }
+
+ return ir_call::get_error_instruction(ctx);
+ }
+}
+
+
+/**
+ * Perform automatic type conversion of constructor parameters
+ *
+ * This implements the rules in the "Conversion and Scalar Constructors"
+ * section (GLSL 1.10 section 5.4.1), not the "Implicit Conversions" rules.
+ */
+static ir_rvalue *
+convert_component(ir_rvalue *src, const glsl_type *desired_type)
+{
+ void *ctx = ralloc_parent(src);
+ const unsigned a = desired_type->base_type;
+ const unsigned b = src->type->base_type;
+ ir_expression *result = NULL;
+
+ if (src->type->is_error())
+ return src;
+
+ assert(a <= GLSL_TYPE_BOOL);
+ assert(b <= GLSL_TYPE_BOOL);
+
+ if ((a == b) || (src->type->is_integer() && desired_type->is_integer()))
+ return src;
+
+ switch (a) {
+ case GLSL_TYPE_UINT:
+ case GLSL_TYPE_INT:
+ if (b == GLSL_TYPE_FLOAT)
+ result = new(ctx) ir_expression(ir_unop_f2i, desired_type, src, NULL);
+ else {
+ assert(b == GLSL_TYPE_BOOL);
+ result = new(ctx) ir_expression(ir_unop_b2i, desired_type, src, NULL);
+ }
+ break;
+ case GLSL_TYPE_FLOAT:
+ switch (b) {
+ case GLSL_TYPE_UINT:
+ result = new(ctx) ir_expression(ir_unop_u2f, desired_type, src, NULL);
+ break;
+ case GLSL_TYPE_INT:
+ result = new(ctx) ir_expression(ir_unop_i2f, desired_type, src, NULL);
+ break;
+ case GLSL_TYPE_BOOL:
+ result = new(ctx) ir_expression(ir_unop_b2f, desired_type, src, NULL);
+ break;
+ }
+ break;
+ case GLSL_TYPE_BOOL:
+ switch (b) {
+ case GLSL_TYPE_UINT:
+ case GLSL_TYPE_INT:
+ result = new(ctx) ir_expression(ir_unop_i2b, desired_type, src, NULL);
+ break;
+ case GLSL_TYPE_FLOAT:
+ result = new(ctx) ir_expression(ir_unop_f2b, desired_type, src, NULL);
+ break;
+ }
+ break;
+ }
+
+ assert(result != NULL);
+
+ /* Try constant folding; it may fold in the conversion we just added. */
+ ir_constant *const constant = result->constant_expression_value();
+ return (constant != NULL) ? (ir_rvalue *) constant : (ir_rvalue *) result;
+}
+
+/**
+ * Dereference a specific component from a scalar, vector, or matrix
+ */
+static ir_rvalue *
+dereference_component(ir_rvalue *src, unsigned component)
+{
+ void *ctx = ralloc_parent(src);
+ assert(component < src->type->components());
+
+ /* If the source is a constant, just create a new constant instead of a
+ * dereference of the existing constant.
+ */
+ ir_constant *constant = src->as_constant();
+ if (constant)
+ return new(ctx) ir_constant(constant, component);
+
+ if (src->type->is_scalar()) {
+ return src;
+ } else if (src->type->is_vector()) {
+ return new(ctx) ir_swizzle(src, component, 0, 0, 0, 1);
+ } else {
+ assert(src->type->is_matrix());
+
+ /* Dereference a row of the matrix, then call this function again to get
+ * a specific element from that row.
+ */
+ const int c = component / src->type->column_type()->vector_elements;
+ const int r = component % src->type->column_type()->vector_elements;
+ ir_constant *const col_index = new(ctx) ir_constant(c);
+ ir_dereference *const col = new(ctx) ir_dereference_array(src, col_index);
+
+ col->type = src->type->column_type();
+
+ return dereference_component(col, r);
+ }
+
+ assert(!"Should not get here.");
+ return NULL;
+}
+
+
+static ir_rvalue *
+process_array_constructor(exec_list *instructions,
+ const glsl_type *constructor_type,
+ YYLTYPE *loc, exec_list *parameters,
+ struct _mesa_glsl_parse_state *state)
+{
+ void *ctx = state;
+ /* Array constructors come in two forms: sized and unsized. Sized array
+ * constructors look like 'vec4[2](a, b)', where 'a' and 'b' are vec4
+ * variables. In this case the number of parameters must exactly match the
+ * specified size of the array.
+ *
+ * Unsized array constructors look like 'vec4[](a, b)', where 'a' and 'b'
+ * are vec4 variables. In this case the size of the array being constructed
+ * is determined by the number of parameters.
+ *
+ * From page 52 (page 58 of the PDF) of the GLSL 1.50 spec:
+ *
+ * "There must be exactly the same number of arguments as the size of
+ * the array being constructed. If no size is present in the
+ * constructor, then the array is explicitly sized to the number of
+ * arguments provided. The arguments are assigned in order, starting at
+ * element 0, to the elements of the constructed array. Each argument
+ * must be the same type as the element type of the array, or be a type
+ * that can be converted to the element type of the array according to
+ * Section 4.1.10 "Implicit Conversions.""
+ */
+ exec_list actual_parameters;
+ const unsigned parameter_count =
+ process_parameters(instructions, &actual_parameters, parameters, state);
+
+ if ((parameter_count == 0)
+ || ((constructor_type->length != 0)
+ && (constructor_type->length != parameter_count))) {
+ const unsigned min_param = (constructor_type->length == 0)
+ ? 1 : constructor_type->length;
+
+ _mesa_glsl_error(loc, state, "array constructor must have %s %u "
+ "parameter%s",
+ (constructor_type->length != 0) ? "at least" : "exactly",
+ min_param, (min_param <= 1) ? "" : "s");
+ return ir_call::get_error_instruction(ctx);
+ }
+
+ if (constructor_type->length == 0) {
+ constructor_type =
+ glsl_type::get_array_instance(constructor_type->element_type(),
+ parameter_count);
+ assert(constructor_type != NULL);
+ assert(constructor_type->length == parameter_count);
+ }
+
+ bool all_parameters_are_constant = true;
+
+ /* Type cast each parameter and, if possible, fold constants. */
+ foreach_list_safe(n, &actual_parameters) {
+ ir_rvalue *ir = (ir_rvalue *) n;
+ ir_rvalue *result = ir;
+
+ /* Apply implicit conversions (not the scalar constructor rules!) */
+ if (constructor_type->element_type()->is_float()) {
+ const glsl_type *desired_type =
+ glsl_type::get_instance(GLSL_TYPE_FLOAT,
+ ir->type->vector_elements,
+ ir->type->matrix_columns);
+ result = convert_component(ir, desired_type);
+ }
+
+ if (result->type != constructor_type->element_type()) {
+ _mesa_glsl_error(loc, state, "type error in array constructor: "
+ "expected: %s, found %s",
+ constructor_type->element_type()->name,
+ result->type->name);
+ }
+
+ /* Attempt to convert the parameter to a constant valued expression.
+ * After doing so, track whether or not all the parameters to the
+ * constructor are trivially constant valued expressions.
+ */
+ ir_rvalue *const constant = result->constant_expression_value();
+
+ if (constant != NULL)
+ result = constant;
+ else
+ all_parameters_are_constant = false;
+
+ ir->replace_with(result);
+ }
+
+ if (all_parameters_are_constant)
+ return new(ctx) ir_constant(constructor_type, &actual_parameters);
+
+ ir_variable *var = new(ctx) ir_variable(constructor_type, "array_ctor",
+ ir_var_temporary);
+ instructions->push_tail(var);
+
+ int i = 0;
+ foreach_list(node, &actual_parameters) {
+ ir_rvalue *rhs = (ir_rvalue *) node;
+ ir_rvalue *lhs = new(ctx) ir_dereference_array(var,
+ new(ctx) ir_constant(i));
+
+ ir_instruction *assignment = new(ctx) ir_assignment(lhs, rhs, NULL);
+ instructions->push_tail(assignment);
+
+ i++;
+ }
+
+ return new(ctx) ir_dereference_variable(var);
+}
+
+
+/**
+ * Try to convert a record constructor to a constant expression
+ */
+static ir_constant *
+constant_record_constructor(const glsl_type *constructor_type,
+ exec_list *parameters, void *mem_ctx)
+{
+ foreach_list(node, parameters) {
+ ir_constant *constant = ((ir_instruction *) node)->as_constant();
+ if (constant == NULL)
+ return NULL;
+ node->replace_with(constant);
+ }
+
+ return new(mem_ctx) ir_constant(constructor_type, parameters);
+}
+
+
+/**
+ * Determine if a list consists of a single scalar r-value
+ */
+bool
+single_scalar_parameter(exec_list *parameters)
+{
+ const ir_rvalue *const p = (ir_rvalue *) parameters->head;
+ assert(((ir_rvalue *)p)->as_rvalue() != NULL);
+
+ return (p->type->is_scalar() && p->next->is_tail_sentinel());
+}
+
+
+/**
+ * Generate inline code for a vector constructor
+ *
+ * The generated constructor code will consist of a temporary variable
+ * declaration of the same type as the constructor. A sequence of assignments
+ * from constructor parameters to the temporary will follow.
+ *
+ * \return
+ * An \c ir_dereference_variable of the temprorary generated in the constructor
+ * body.
+ */
+ir_rvalue *
+emit_inline_vector_constructor(const glsl_type *type,
+ exec_list *instructions,
+ exec_list *parameters,
+ void *ctx)
+{
+ assert(!parameters->is_empty());
+
+ ir_variable *var = new(ctx) ir_variable(type, "vec_ctor", ir_var_temporary);
+ instructions->push_tail(var);
+
+ /* There are two kinds of vector constructors.
+ *
+ * - Construct a vector from a single scalar by replicating that scalar to
+ * all components of the vector.
+ *
+ * - Construct a vector from an arbirary combination of vectors and
+ * scalars. The components of the constructor parameters are assigned
+ * to the vector in order until the vector is full.
+ */
+ const unsigned lhs_components = type->components();
+ if (single_scalar_parameter(parameters)) {
+ ir_rvalue *first_param = (ir_rvalue *)parameters->head;
+ ir_rvalue *rhs = new(ctx) ir_swizzle(first_param, 0, 0, 0, 0,
+ lhs_components);
+ ir_dereference_variable *lhs = new(ctx) ir_dereference_variable(var);
+ const unsigned mask = (1U << lhs_components) - 1;
+
+ assert(rhs->type == lhs->type);
+
+ ir_instruction *inst = new(ctx) ir_assignment(lhs, rhs, NULL, mask);
+ instructions->push_tail(inst);
+ } else {
+ unsigned base_component = 0;
+ unsigned base_lhs_component = 0;
+ ir_constant_data data;
+ unsigned constant_mask = 0, constant_components = 0;
+
+ memset(&data, 0, sizeof(data));
+
+ foreach_list(node, parameters) {
+ ir_rvalue *param = (ir_rvalue *) node;
+ unsigned rhs_components = param->type->components();
+
+ /* Do not try to assign more components to the vector than it has!
+ */
+ if ((rhs_components + base_lhs_component) > lhs_components) {
+ rhs_components = lhs_components - base_lhs_component;
+ }
+
+ const ir_constant *const c = param->as_constant();
+ if (c != NULL) {
+ for (unsigned i = 0; i < rhs_components; i++) {
+ switch (c->type->base_type) {
+ case GLSL_TYPE_UINT:
+ data.u[i + base_component] = c->get_uint_component(i);
+ break;
+ case GLSL_TYPE_INT:
+ data.i[i + base_component] = c->get_int_component(i);
+ break;
+ case GLSL_TYPE_FLOAT:
+ data.f[i + base_component] = c->get_float_component(i);
+ break;
+ case GLSL_TYPE_BOOL:
+ data.b[i + base_component] = c->get_bool_component(i);
+ break;
+ default:
+ assert(!"Should not get here.");
+ break;
+ }
+ }
+
+ /* Mask of fields to be written in the assignment.
+ */
+ constant_mask |= ((1U << rhs_components) - 1) << base_lhs_component;
+ constant_components += rhs_components;
+
+ base_component += rhs_components;
+ }
+ /* Advance the component index by the number of components
+ * that were just assigned.
+ */
+ base_lhs_component += rhs_components;
+ }
+
+ if (constant_mask != 0) {
+ ir_dereference *lhs = new(ctx) ir_dereference_variable(var);
+ const glsl_type *rhs_type = glsl_type::get_instance(var->type->base_type,
+ constant_components,
+ 1);
+ ir_rvalue *rhs = new(ctx) ir_constant(rhs_type, &data);
+
+ ir_instruction *inst =
+ new(ctx) ir_assignment(lhs, rhs, NULL, constant_mask);
+ instructions->push_tail(inst);
+ }
+
+ base_component = 0;
+ foreach_list(node, parameters) {
+ ir_rvalue *param = (ir_rvalue *) node;
+ unsigned rhs_components = param->type->components();
+
+ /* Do not try to assign more components to the vector than it has!
+ */
+ if ((rhs_components + base_component) > lhs_components) {
+ rhs_components = lhs_components - base_component;
+ }
+
+ const ir_constant *const c = param->as_constant();
+ if (c == NULL) {
+ /* Mask of fields to be written in the assignment.
+ */
+ const unsigned write_mask = ((1U << rhs_components) - 1)
+ << base_component;
+
+ ir_dereference *lhs = new(ctx) ir_dereference_variable(var);
+
+ /* Generate a swizzle so that LHS and RHS sizes match.
+ */
+ ir_rvalue *rhs =
+ new(ctx) ir_swizzle(param, 0, 1, 2, 3, rhs_components);
+
+ ir_instruction *inst =
+ new(ctx) ir_assignment(lhs, rhs, NULL, write_mask);
+ instructions->push_tail(inst);
+ }
+
+ /* Advance the component index by the number of components that were
+ * just assigned.
+ */
+ base_component += rhs_components;
+ }
+ }
+ return new(ctx) ir_dereference_variable(var);
+}
+
+
+/**
+ * Generate assignment of a portion of a vector to a portion of a matrix column
+ *
+ * \param src_base First component of the source to be used in assignment
+ * \param column Column of destination to be assiged
+ * \param row_base First component of the destination column to be assigned
+ * \param count Number of components to be assigned
+ *
+ * \note
+ * \c src_base + \c count must be less than or equal to the number of components
+ * in the source vector.
+ */
+ir_instruction *
+assign_to_matrix_column(ir_variable *var, unsigned column, unsigned row_base,
+ ir_rvalue *src, unsigned src_base, unsigned count,
+ void *mem_ctx)
+{
+ ir_constant *col_idx = new(mem_ctx) ir_constant(column);
+ ir_dereference *column_ref = new(mem_ctx) ir_dereference_array(var, col_idx);
+
+ assert(column_ref->type->components() >= (row_base + count));
+ assert(src->type->components() >= (src_base + count));
+
+ /* Generate a swizzle that extracts the number of components from the source
+ * that are to be assigned to the column of the matrix.
+ */
+ if (count < src->type->vector_elements) {
+ src = new(mem_ctx) ir_swizzle(src,
+ src_base + 0, src_base + 1,
+ src_base + 2, src_base + 3,
+ count);
+ }
+
+ /* Mask of fields to be written in the assignment.
+ */
+ const unsigned write_mask = ((1U << count) - 1) << row_base;
+
+ return new(mem_ctx) ir_assignment(column_ref, src, NULL, write_mask);
+}
+
+
+/**
+ * Generate inline code for a matrix constructor
+ *
+ * The generated constructor code will consist of a temporary variable
+ * declaration of the same type as the constructor. A sequence of assignments
+ * from constructor parameters to the temporary will follow.
+ *
+ * \return
+ * An \c ir_dereference_variable of the temprorary generated in the constructor
+ * body.
+ */
+ir_rvalue *
+emit_inline_matrix_constructor(const glsl_type *type,
+ exec_list *instructions,
+ exec_list *parameters,
+ void *ctx)
+{
+ assert(!parameters->is_empty());
+
+ ir_variable *var = new(ctx) ir_variable(type, "mat_ctor", ir_var_temporary);
+ instructions->push_tail(var);
+
+ /* There are three kinds of matrix constructors.
+ *
+ * - Construct a matrix from a single scalar by replicating that scalar to
+ * along the diagonal of the matrix and setting all other components to
+ * zero.
+ *
+ * - Construct a matrix from an arbirary combination of vectors and
+ * scalars. The components of the constructor parameters are assigned
+ * to the matrix in colum-major order until the matrix is full.
+ *
+ * - Construct a matrix from a single matrix. The source matrix is copied
+ * to the upper left portion of the constructed matrix, and the remaining
+ * elements take values from the identity matrix.
+ */
+ ir_rvalue *const first_param = (ir_rvalue *) parameters->head;
+ if (single_scalar_parameter(parameters)) {
+ /* Assign the scalar to the X component of a vec4, and fill the remaining
+ * components with zero.
+ */
+ ir_variable *rhs_var =
+ new(ctx) ir_variable(glsl_type::vec4_type, "mat_ctor_vec",
+ ir_var_temporary);
+ instructions->push_tail(rhs_var);
+
+ ir_constant_data zero;
+ zero.f[0] = 0.0;
+ zero.f[1] = 0.0;
+ zero.f[2] = 0.0;
+ zero.f[3] = 0.0;
+
+ ir_instruction *inst =
+ new(ctx) ir_assignment(new(ctx) ir_dereference_variable(rhs_var),
+ new(ctx) ir_constant(rhs_var->type, &zero),
+ NULL);
+ instructions->push_tail(inst);
+
+ ir_dereference *const rhs_ref = new(ctx) ir_dereference_variable(rhs_var);
+
+ inst = new(ctx) ir_assignment(rhs_ref, first_param, NULL, 0x01);
+ instructions->push_tail(inst);
+
+ /* Assign the temporary vector to each column of the destination matrix
+ * with a swizzle that puts the X component on the diagonal of the
+ * matrix. In some cases this may mean that the X component does not
+ * get assigned into the column at all (i.e., when the matrix has more
+ * columns than rows).
+ */
+ static const unsigned rhs_swiz[4][4] = {
+ { 0, 1, 1, 1 },
+ { 1, 0, 1, 1 },
+ { 1, 1, 0, 1 },
+ { 1, 1, 1, 0 }
+ };
+
+ const unsigned cols_to_init = MIN2(type->matrix_columns,
+ type->vector_elements);
+ for (unsigned i = 0; i < cols_to_init; i++) {
+ ir_constant *const col_idx = new(ctx) ir_constant(i);
+ ir_rvalue *const col_ref = new(ctx) ir_dereference_array(var, col_idx);
+
+ ir_rvalue *const rhs_ref = new(ctx) ir_dereference_variable(rhs_var);
+ ir_rvalue *const rhs = new(ctx) ir_swizzle(rhs_ref, rhs_swiz[i],
+ type->vector_elements);
+
+ inst = new(ctx) ir_assignment(col_ref, rhs, NULL);
+ instructions->push_tail(inst);
+ }
+
+ for (unsigned i = cols_to_init; i < type->matrix_columns; i++) {
+ ir_constant *const col_idx = new(ctx) ir_constant(i);
+ ir_rvalue *const col_ref = new(ctx) ir_dereference_array(var, col_idx);
+
+ ir_rvalue *const rhs_ref = new(ctx) ir_dereference_variable(rhs_var);
+ ir_rvalue *const rhs = new(ctx) ir_swizzle(rhs_ref, 1, 1, 1, 1,
+ type->vector_elements);
+
+ inst = new(ctx) ir_assignment(col_ref, rhs, NULL);
+ instructions->push_tail(inst);
+ }
+ } else if (first_param->type->is_matrix()) {
+ /* From page 50 (56 of the PDF) of the GLSL 1.50 spec:
+ *
+ * "If a matrix is constructed from a matrix, then each component
+ * (column i, row j) in the result that has a corresponding
+ * component (column i, row j) in the argument will be initialized
+ * from there. All other components will be initialized to the
+ * identity matrix. If a matrix argument is given to a matrix
+ * constructor, it is an error to have any other arguments."
+ */
+ assert(first_param->next->is_tail_sentinel());
+ ir_rvalue *const src_matrix = first_param;
+
+ /* If the source matrix is smaller, pre-initialize the relavent parts of
+ * the destination matrix to the identity matrix.
+ */
+ if ((src_matrix->type->matrix_columns < var->type->matrix_columns)
+ || (src_matrix->type->vector_elements < var->type->vector_elements)) {
+
+ /* If the source matrix has fewer rows, every column of the destination
+ * must be initialized. Otherwise only the columns in the destination
+ * that do not exist in the source must be initialized.
+ */
+ unsigned col =
+ (src_matrix->type->vector_elements < var->type->vector_elements)
+ ? 0 : src_matrix->type->matrix_columns;
+
+ const glsl_type *const col_type = var->type->column_type();
+ for (/* empty */; col < var->type->matrix_columns; col++) {
+ ir_constant_data ident;
+
+ ident.f[0] = 0.0;
+ ident.f[1] = 0.0;
+ ident.f[2] = 0.0;
+ ident.f[3] = 0.0;
+
+ ident.f[col] = 1.0;
+
+ ir_rvalue *const rhs = new(ctx) ir_constant(col_type, &ident);
+
+ ir_rvalue *const lhs =
+ new(ctx) ir_dereference_array(var, new(ctx) ir_constant(col));
+
+ ir_instruction *inst = new(ctx) ir_assignment(lhs, rhs, NULL);
+ instructions->push_tail(inst);
+ }
+ }
+
+ /* Assign columns from the source matrix to the destination matrix.
+ *
+ * Since the parameter will be used in the RHS of multiple assignments,
+ * generate a temporary and copy the paramter there.
+ */
+ ir_variable *const rhs_var =
+ new(ctx) ir_variable(first_param->type, "mat_ctor_mat",
+ ir_var_temporary);
+ instructions->push_tail(rhs_var);
+
+ ir_dereference *const rhs_var_ref =
+ new(ctx) ir_dereference_variable(rhs_var);
+ ir_instruction *const inst =
+ new(ctx) ir_assignment(rhs_var_ref, first_param, NULL);
+ instructions->push_tail(inst);
+
+ const unsigned last_row = MIN2(src_matrix->type->vector_elements,
+ var->type->vector_elements);
+ const unsigned last_col = MIN2(src_matrix->type->matrix_columns,
+ var->type->matrix_columns);
+
+ unsigned swiz[4] = { 0, 0, 0, 0 };
+ for (unsigned i = 1; i < last_row; i++)
+ swiz[i] = i;
+
+ const unsigned write_mask = (1U << last_row) - 1;
+
+ for (unsigned i = 0; i < last_col; i++) {
+ ir_dereference *const lhs =
+ new(ctx) ir_dereference_array(var, new(ctx) ir_constant(i));
+ ir_rvalue *const rhs_col =
+ new(ctx) ir_dereference_array(rhs_var, new(ctx) ir_constant(i));
+
+ /* If one matrix has columns that are smaller than the columns of the
+ * other matrix, wrap the column access of the larger with a swizzle
+ * so that the LHS and RHS of the assignment have the same size (and
+ * therefore have the same type).
+ *
+ * It would be perfectly valid to unconditionally generate the
+ * swizzles, this this will typically result in a more compact IR tree.
+ */
+ ir_rvalue *rhs;
+ if (lhs->type->vector_elements != rhs_col->type->vector_elements) {
+ rhs = new(ctx) ir_swizzle(rhs_col, swiz, last_row);
+ } else {
+ rhs = rhs_col;
+ }
+
+ ir_instruction *inst =
+ new(ctx) ir_assignment(lhs, rhs, NULL, write_mask);
+ instructions->push_tail(inst);
+ }
+ } else {
+ const unsigned cols = type->matrix_columns;
+ const unsigned rows = type->vector_elements;
+ unsigned col_idx = 0;
+ unsigned row_idx = 0;
+
+ foreach_list (node, parameters) {
+ ir_rvalue *const rhs = (ir_rvalue *) node;
+ const unsigned components_remaining_this_column = rows - row_idx;
+ unsigned rhs_components = rhs->type->components();
+ unsigned rhs_base = 0;
+
+ /* Since the parameter might be used in the RHS of two assignments,
+ * generate a temporary and copy the paramter there.
+ */
+ ir_variable *rhs_var =
+ new(ctx) ir_variable(rhs->type, "mat_ctor_vec", ir_var_temporary);
+ instructions->push_tail(rhs_var);
+
+ ir_dereference *rhs_var_ref =
+ new(ctx) ir_dereference_variable(rhs_var);
+ ir_instruction *inst = new(ctx) ir_assignment(rhs_var_ref, rhs, NULL);
+ instructions->push_tail(inst);
+
+ /* Assign the current parameter to as many components of the matrix
+ * as it will fill.
+ *
+ * NOTE: A single vector parameter can span two matrix columns. A
+ * single vec4, for example, can completely fill a mat2.
+ */
+ if (rhs_components >= components_remaining_this_column) {
+ const unsigned count = MIN2(rhs_components,
+ components_remaining_this_column);
+
+ rhs_var_ref = new(ctx) ir_dereference_variable(rhs_var);
+
+ ir_instruction *inst = assign_to_matrix_column(var, col_idx,
+ row_idx,
+ rhs_var_ref, 0,
+ count, ctx);
+ instructions->push_tail(inst);
+
+ rhs_base = count;
+
+ col_idx++;
+ row_idx = 0;
+ }
+
+ /* If there is data left in the parameter and components left to be
+ * set in the destination, emit another assignment. It is possible
+ * that the assignment could be of a vec4 to the last element of the
+ * matrix. In this case col_idx==cols, but there is still data
+ * left in the source parameter. Obviously, don't emit an assignment
+ * to data outside the destination matrix.
+ */
+ if ((col_idx < cols) && (rhs_base < rhs_components)) {
+ const unsigned count = rhs_components - rhs_base;
+
+ rhs_var_ref = new(ctx) ir_dereference_variable(rhs_var);
+
+ ir_instruction *inst = assign_to_matrix_column(var, col_idx,
+ row_idx,
+ rhs_var_ref,
+ rhs_base,
+ count, ctx);
+ instructions->push_tail(inst);
+
+ row_idx += count;
+ }
+ }
+ }
+
+ return new(ctx) ir_dereference_variable(var);
+}
+
+
+ir_rvalue *
+emit_inline_record_constructor(const glsl_type *type,
+ exec_list *instructions,
+ exec_list *parameters,
+ void *mem_ctx)
+{
+ ir_variable *const var =
+ new(mem_ctx) ir_variable(type, "record_ctor", ir_var_temporary);
+ ir_dereference_variable *const d = new(mem_ctx) ir_dereference_variable(var);
+
+ instructions->push_tail(var);
+
+ exec_node *node = parameters->head;
+ for (unsigned i = 0; i < type->length; i++) {
+ assert(!node->is_tail_sentinel());
+
+ ir_dereference *const lhs =
+ new(mem_ctx) ir_dereference_record(d->clone(mem_ctx, NULL),
+ type->fields.structure[i].name);
+
+ ir_rvalue *const rhs = ((ir_instruction *) node)->as_rvalue();
+ assert(rhs != NULL);
+
+ ir_instruction *const assign = new(mem_ctx) ir_assignment(lhs, rhs, NULL);
+
+ instructions->push_tail(assign);
+ node = node->next;
+ }
+
+ return d;
+}
+
+
+ir_rvalue *
+ast_function_expression::hir(exec_list *instructions,
+ struct _mesa_glsl_parse_state *state)
+{
+ void *ctx = state;
+ /* There are three sorts of function calls.
+ *
+ * 1. constructors - The first subexpression is an ast_type_specifier.
+ * 2. methods - Only the .length() method of array types.
+ * 3. functions - Calls to regular old functions.
+ *
+ * Method calls are actually detected when the ast_field_selection
+ * expression is handled.
+ */
+ if (is_constructor()) {
+ const ast_type_specifier *type = (ast_type_specifier *) subexpressions[0];
+ YYLTYPE loc = type->get_location();
+ const char *name;
+
+ const glsl_type *const constructor_type = type->glsl_type(& name, state);
+
+ /* constructor_type can be NULL if a variable with the same name as the
+ * structure has come into scope.
+ */
+ if (constructor_type == NULL) {
+ _mesa_glsl_error(& loc, state, "unknown type `%s' (structure name "
+ "may be shadowed by a variable with the same name)",
+ type->type_name);
+ return ir_call::get_error_instruction(ctx);
+ }
+
+
+ /* Constructors for samplers are illegal.
+ */
+ if (constructor_type->is_sampler()) {
+ _mesa_glsl_error(& loc, state, "cannot construct sampler type `%s'",
+ constructor_type->name);
+ return ir_call::get_error_instruction(ctx);
+ }
+
+ if (constructor_type->is_array()) {
+ if (state->language_version <= 110) {
+ _mesa_glsl_error(& loc, state,
+ "array constructors forbidden in GLSL 1.10");
+ return ir_call::get_error_instruction(ctx);
+ }
+
+ return process_array_constructor(instructions, constructor_type,
+ & loc, &this->expressions, state);
+ }
+
+
+ /* There are two kinds of constructor call. Constructors for built-in
+ * language types, such as mat4 and vec2, are free form. The only
+ * requirement is that the parameters must provide enough values of the
+ * correct scalar type. Constructors for arrays and structures must
+ * have the exact number of parameters with matching types in the
+ * correct order. These constructors follow essentially the same type
+ * matching rules as functions.
+ */
+ if (constructor_type->is_record()) {
+ exec_list actual_parameters;
+
+ process_parameters(instructions, &actual_parameters,
+ &this->expressions, state);
+
+ exec_node *node = actual_parameters.head;
+ for (unsigned i = 0; i < constructor_type->length; i++) {
+ ir_rvalue *ir = (ir_rvalue *) node;
+
+ if (node->is_tail_sentinel()) {
+ _mesa_glsl_error(&loc, state,
+ "insufficient parameters to constructor "
+ "for `%s'",
+ constructor_type->name);
+ return ir_call::get_error_instruction(ctx);
+ }
+
+ if (apply_implicit_conversion(constructor_type->fields.structure[i].type,
+ ir, state)) {
+ node->replace_with(ir);
+ } else {
+ _mesa_glsl_error(&loc, state,
+ "parameter type mismatch in constructor "
+ "for `%s.%s' (%s vs %s)",
+ constructor_type->name,
+ constructor_type->fields.structure[i].name,
+ ir->type->name,
+ constructor_type->fields.structure[i].type->name);
+ return ir_call::get_error_instruction(ctx);;
+ }
+
+ node = node->next;
+ }
+
+ if (!node->is_tail_sentinel()) {
+ _mesa_glsl_error(&loc, state, "too many parameters in constructor "
+ "for `%s'", constructor_type->name);
+ return ir_call::get_error_instruction(ctx);
+ }
+
+ ir_rvalue *const constant =
+ constant_record_constructor(constructor_type, &actual_parameters,
+ state);
+
+ return (constant != NULL)
+ ? constant
+ : emit_inline_record_constructor(constructor_type, instructions,
+ &actual_parameters, state);
+ }
+
+ if (!constructor_type->is_numeric() && !constructor_type->is_boolean())
+ return ir_call::get_error_instruction(ctx);
+
+ /* Total number of components of the type being constructed. */
+ const unsigned type_components = constructor_type->components();
+
+ /* Number of components from parameters that have actually been
+ * consumed. This is used to perform several kinds of error checking.
+ */
+ unsigned components_used = 0;
+
+ unsigned matrix_parameters = 0;
+ unsigned nonmatrix_parameters = 0;
+ exec_list actual_parameters;
+
+ foreach_list (n, &this->expressions) {
+ ast_node *ast = exec_node_data(ast_node, n, link);
+ ir_rvalue *result = ast->hir(instructions, state)->as_rvalue();
+
+ /* From page 50 (page 56 of the PDF) of the GLSL 1.50 spec:
+ *
+ * "It is an error to provide extra arguments beyond this
+ * last used argument."
+ */
+ if (components_used >= type_components) {
+ _mesa_glsl_error(& loc, state, "too many parameters to `%s' "
+ "constructor",
+ constructor_type->name);
+ return ir_call::get_error_instruction(ctx);
+ }
+
+ if (!result->type->is_numeric() && !result->type->is_boolean()) {
+ _mesa_glsl_error(& loc, state, "cannot construct `%s' from a "
+ "non-numeric data type",
+ constructor_type->name);
+ return ir_call::get_error_instruction(ctx);
+ }
+
+ /* Count the number of matrix and nonmatrix parameters. This
+ * is used below to enforce some of the constructor rules.
+ */
+ if (result->type->is_matrix())
+ matrix_parameters++;
+ else
+ nonmatrix_parameters++;
+
+ actual_parameters.push_tail(result);
+ components_used += result->type->components();
+ }
+
+ /* From page 28 (page 34 of the PDF) of the GLSL 1.10 spec:
+ *
+ * "It is an error to construct matrices from other matrices. This
+ * is reserved for future use."
+ */
+ if (state->language_version == 110 && matrix_parameters > 0
+ && constructor_type->is_matrix()) {
+ _mesa_glsl_error(& loc, state, "cannot construct `%s' from a "
+ "matrix in GLSL 1.10",
+ constructor_type->name);
+ return ir_call::get_error_instruction(ctx);
+ }
+
+ /* From page 50 (page 56 of the PDF) of the GLSL 1.50 spec:
+ *
+ * "If a matrix argument is given to a matrix constructor, it is
+ * an error to have any other arguments."
+ */
+ if ((matrix_parameters > 0)
+ && ((matrix_parameters + nonmatrix_parameters) > 1)
+ && constructor_type->is_matrix()) {
+ _mesa_glsl_error(& loc, state, "for matrix `%s' constructor, "
+ "matrix must be only parameter",
+ constructor_type->name);
+ return ir_call::get_error_instruction(ctx);
+ }
+
+ /* From page 28 (page 34 of the PDF) of the GLSL 1.10 spec:
+ *
+ * "In these cases, there must be enough components provided in the
+ * arguments to provide an initializer for every component in the
+ * constructed value."
+ */
+ if (components_used < type_components && components_used != 1
+ && matrix_parameters == 0) {
+ _mesa_glsl_error(& loc, state, "too few components to construct "
+ "`%s'",
+ constructor_type->name);
+ return ir_call::get_error_instruction(ctx);
+ }
+
+ /* Later, we cast each parameter to the same base type as the
+ * constructor. Since there are no non-floating point matrices, we
+ * need to break them up into a series of column vectors.
+ */
+ if (constructor_type->base_type != GLSL_TYPE_FLOAT) {
+ foreach_list_safe(n, &actual_parameters) {
+ ir_rvalue *matrix = (ir_rvalue *) n;
+
+ if (!matrix->type->is_matrix())
+ continue;
+
+ /* Create a temporary containing the matrix. */
+ ir_variable *var = new(ctx) ir_variable(matrix->type, "matrix_tmp",
+ ir_var_temporary);
+ instructions->push_tail(var);
+ instructions->push_tail(new(ctx) ir_assignment(new(ctx)
+ ir_dereference_variable(var), matrix, NULL));
+ var->constant_value = matrix->constant_expression_value();
+
+ /* Replace the matrix with dereferences of its columns. */
+ for (int i = 0; i < matrix->type->matrix_columns; i++) {
+ matrix->insert_before(new (ctx) ir_dereference_array(var,
+ new(ctx) ir_constant(i)));
+ }
+ matrix->remove();
+ }
+ }
+
+ bool all_parameters_are_constant = true;
+
+ /* Type cast each parameter and, if possible, fold constants.*/
+ foreach_list_safe(n, &actual_parameters) {
+ ir_rvalue *ir = (ir_rvalue *) n;
+
+ const glsl_type *desired_type =
+ glsl_type::get_instance(constructor_type->base_type,
+ ir->type->vector_elements,
+ ir->type->matrix_columns);
+ ir_rvalue *result = convert_component(ir, desired_type);
+
+ /* Attempt to convert the parameter to a constant valued expression.
+ * After doing so, track whether or not all the parameters to the
+ * constructor are trivially constant valued expressions.
+ */
+ ir_rvalue *const constant = result->constant_expression_value();
+
+ if (constant != NULL)
+ result = constant;
+ else
+ all_parameters_are_constant = false;
+
+ if (result != ir) {
+ ir->replace_with(result);
+ }
+ }
+
+ /* If all of the parameters are trivially constant, create a
+ * constant representing the complete collection of parameters.
+ */
+ if (all_parameters_are_constant) {
+ return new(ctx) ir_constant(constructor_type, &actual_parameters);
+ } else if (constructor_type->is_scalar()) {
+ return dereference_component((ir_rvalue *) actual_parameters.head,
+ 0);
+ } else if (constructor_type->is_vector()) {
+ return emit_inline_vector_constructor(constructor_type,
+ instructions,
+ &actual_parameters,
+ ctx);
+ } else {
+ assert(constructor_type->is_matrix());
+ return emit_inline_matrix_constructor(constructor_type,
+ instructions,
+ &actual_parameters,
+ ctx);
+ }
+ } else {
+ const ast_expression *id = subexpressions[0];
+ YYLTYPE loc = id->get_location();
+ exec_list actual_parameters;
+
+ process_parameters(instructions, &actual_parameters, &this->expressions,
+ state);
+
+ return match_function_by_name(instructions,
+ id->primary_expression.identifier, & loc,
+ &actual_parameters, state);
+ }
+
+ return ir_call::get_error_instruction(ctx);
+}
diff --git a/mesalib/src/glsl/ast_to_hir.cpp b/mesalib/src/glsl/ast_to_hir.cpp
index 3b87f0d56..b5cffcd47 100644
--- a/mesalib/src/glsl/ast_to_hir.cpp
+++ b/mesalib/src/glsl/ast_to_hir.cpp
@@ -1,3509 +1,3509 @@
-/*
- * Copyright © 2010 Intel Corporation
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-
-/**
- * \file ast_to_hir.c
- * Convert abstract syntax to to high-level intermediate reprensentation (HIR).
- *
- * During the conversion to HIR, the majority of the symantic checking is
- * preformed on the program. This includes:
- *
- * * Symbol table management
- * * Type checking
- * * Function binding
- *
- * The majority of this work could be done during parsing, and the parser could
- * probably generate HIR directly. However, this results in frequent changes
- * to the parser code. Since we do not assume that every system this complier
- * is built on will have Flex and Bison installed, we have to store the code
- * generated by these tools in our version control system. In other parts of
- * the system we've seen problems where a parser was changed but the generated
- * code was not committed, merge conflicts where created because two developers
- * had slightly different versions of Bison installed, etc.
- *
- * I have also noticed that running Bison generated parsers in GDB is very
- * irritating. When you get a segfault on '$$ = $1->foo', you can't very
- * well 'print $1' in GDB.
- *
- * As a result, my preference is to put as little C code as possible in the
- * parser (and lexer) sources.
- */
-
-#include "main/core.h" /* for struct gl_extensions */
-#include "glsl_symbol_table.h"
-#include "glsl_parser_extras.h"
-#include "ast.h"
-#include "glsl_types.h"
-#include "ir.h"
-
-void
-_mesa_ast_to_hir(exec_list *instructions, struct _mesa_glsl_parse_state *state)
-{
- _mesa_glsl_initialize_variables(instructions, state);
- _mesa_glsl_initialize_functions(state);
-
- state->symbols->language_version = state->language_version;
-
- state->current_function = NULL;
-
- /* Section 4.2 of the GLSL 1.20 specification states:
- * "The built-in functions are scoped in a scope outside the global scope
- * users declare global variables in. That is, a shader's global scope,
- * available for user-defined functions and global variables, is nested
- * inside the scope containing the built-in functions."
- *
- * Since built-in functions like ftransform() access built-in variables,
- * it follows that those must be in the outer scope as well.
- *
- * We push scope here to create this nesting effect...but don't pop.
- * This way, a shader's globals are still in the symbol table for use
- * by the linker.
- */
- state->symbols->push_scope();
-
- foreach_list_typed (ast_node, ast, link, & state->translation_unit)
- ast->hir(instructions, state);
-}
-
-
-/**
- * If a conversion is available, convert one operand to a different type
- *
- * The \c from \c ir_rvalue is converted "in place".
- *
- * \param to Type that the operand it to be converted to
- * \param from Operand that is being converted
- * \param state GLSL compiler state
- *
- * \return
- * If a conversion is possible (or unnecessary), \c true is returned.
- * Otherwise \c false is returned.
- */
-bool
-apply_implicit_conversion(const glsl_type *to, ir_rvalue * &from,
- struct _mesa_glsl_parse_state *state)
-{
- void *ctx = state;
- if (to->base_type == from->type->base_type)
- return true;
-
- /* This conversion was added in GLSL 1.20. If the compilation mode is
- * GLSL 1.10, the conversion is skipped.
- */
- if (state->language_version < 120)
- return false;
-
- /* From page 27 (page 33 of the PDF) of the GLSL 1.50 spec:
- *
- * "There are no implicit array or structure conversions. For
- * example, an array of int cannot be implicitly converted to an
- * array of float. There are no implicit conversions between
- * signed and unsigned integers."
- */
- /* FINISHME: The above comment is partially a lie. There is int/uint
- * FINISHME: conversion for immediate constants.
- */
- if (!to->is_float() || !from->type->is_numeric())
- return false;
-
- /* Convert to a floating point type with the same number of components
- * as the original type - i.e. int to float, not int to vec4.
- */
- to = glsl_type::get_instance(GLSL_TYPE_FLOAT, from->type->vector_elements,
- from->type->matrix_columns);
-
- switch (from->type->base_type) {
- case GLSL_TYPE_INT:
- from = new(ctx) ir_expression(ir_unop_i2f, to, from, NULL);
- break;
- case GLSL_TYPE_UINT:
- from = new(ctx) ir_expression(ir_unop_u2f, to, from, NULL);
- break;
- case GLSL_TYPE_BOOL:
- from = new(ctx) ir_expression(ir_unop_b2f, to, from, NULL);
- break;
- default:
- assert(0);
- }
-
- return true;
-}
-
-
-static const struct glsl_type *
-arithmetic_result_type(ir_rvalue * &value_a, ir_rvalue * &value_b,
- bool multiply,
- struct _mesa_glsl_parse_state *state, YYLTYPE *loc)
-{
- const glsl_type *type_a = value_a->type;
- const glsl_type *type_b = value_b->type;
-
- /* From GLSL 1.50 spec, page 56:
- *
- * "The arithmetic binary operators add (+), subtract (-),
- * multiply (*), and divide (/) operate on integer and
- * floating-point scalars, vectors, and matrices."
- */
- if (!type_a->is_numeric() || !type_b->is_numeric()) {
- _mesa_glsl_error(loc, state,
- "Operands to arithmetic operators must be numeric");
- return glsl_type::error_type;
- }
-
-
- /* "If one operand is floating-point based and the other is
- * not, then the conversions from Section 4.1.10 "Implicit
- * Conversions" are applied to the non-floating-point-based operand."
- */
- if (!apply_implicit_conversion(type_a, value_b, state)
- && !apply_implicit_conversion(type_b, value_a, state)) {
- _mesa_glsl_error(loc, state,
- "Could not implicitly convert operands to "
- "arithmetic operator");
- return glsl_type::error_type;
- }
- type_a = value_a->type;
- type_b = value_b->type;
-
- /* "If the operands are integer types, they must both be signed or
- * both be unsigned."
- *
- * From this rule and the preceeding conversion it can be inferred that
- * both types must be GLSL_TYPE_FLOAT, or GLSL_TYPE_UINT, or GLSL_TYPE_INT.
- * The is_numeric check above already filtered out the case where either
- * type is not one of these, so now the base types need only be tested for
- * equality.
- */
- if (type_a->base_type != type_b->base_type) {
- _mesa_glsl_error(loc, state,
- "base type mismatch for arithmetic operator");
- return glsl_type::error_type;
- }
-
- /* "All arithmetic binary operators result in the same fundamental type
- * (signed integer, unsigned integer, or floating-point) as the
- * operands they operate on, after operand type conversion. After
- * conversion, the following cases are valid
- *
- * * The two operands are scalars. In this case the operation is
- * applied, resulting in a scalar."
- */
- if (type_a->is_scalar() && type_b->is_scalar())
- return type_a;
-
- /* "* One operand is a scalar, and the other is a vector or matrix.
- * In this case, the scalar operation is applied independently to each
- * component of the vector or matrix, resulting in the same size
- * vector or matrix."
- */
- if (type_a->is_scalar()) {
- if (!type_b->is_scalar())
- return type_b;
- } else if (type_b->is_scalar()) {
- return type_a;
- }
-
- /* All of the combinations of <scalar, scalar>, <vector, scalar>,
- * <scalar, vector>, <scalar, matrix>, and <matrix, scalar> have been
- * handled.
- */
- assert(!type_a->is_scalar());
- assert(!type_b->is_scalar());
-
- /* "* The two operands are vectors of the same size. In this case, the
- * operation is done component-wise resulting in the same size
- * vector."
- */
- if (type_a->is_vector() && type_b->is_vector()) {
- if (type_a == type_b) {
- return type_a;
- } else {
- _mesa_glsl_error(loc, state,
- "vector size mismatch for arithmetic operator");
- return glsl_type::error_type;
- }
- }
-
- /* All of the combinations of <scalar, scalar>, <vector, scalar>,
- * <scalar, vector>, <scalar, matrix>, <matrix, scalar>, and
- * <vector, vector> have been handled. At least one of the operands must
- * be matrix. Further, since there are no integer matrix types, the base
- * type of both operands must be float.
- */
- assert(type_a->is_matrix() || type_b->is_matrix());
- assert(type_a->base_type == GLSL_TYPE_FLOAT);
- assert(type_b->base_type == GLSL_TYPE_FLOAT);
-
- /* "* The operator is add (+), subtract (-), or divide (/), and the
- * operands are matrices with the same number of rows and the same
- * number of columns. In this case, the operation is done component-
- * wise resulting in the same size matrix."
- * * The operator is multiply (*), where both operands are matrices or
- * one operand is a vector and the other a matrix. A right vector
- * operand is treated as a column vector and a left vector operand as a
- * row vector. In all these cases, it is required that the number of
- * columns of the left operand is equal to the number of rows of the
- * right operand. Then, the multiply (*) operation does a linear
- * algebraic multiply, yielding an object that has the same number of
- * rows as the left operand and the same number of columns as the right
- * operand. Section 5.10 "Vector and Matrix Operations" explains in
- * more detail how vectors and matrices are operated on."
- */
- if (! multiply) {
- if (type_a == type_b)
- return type_a;
- } else {
- if (type_a->is_matrix() && type_b->is_matrix()) {
- /* Matrix multiply. The columns of A must match the rows of B. Given
- * the other previously tested constraints, this means the vector type
- * of a row from A must be the same as the vector type of a column from
- * B.
- */
- if (type_a->row_type() == type_b->column_type()) {
- /* The resulting matrix has the number of columns of matrix B and
- * the number of rows of matrix A. We get the row count of A by
- * looking at the size of a vector that makes up a column. The
- * transpose (size of a row) is done for B.
- */
- const glsl_type *const type =
- glsl_type::get_instance(type_a->base_type,
- type_a->column_type()->vector_elements,
- type_b->row_type()->vector_elements);
- assert(type != glsl_type::error_type);
-
- return type;
- }
- } else if (type_a->is_matrix()) {
- /* A is a matrix and B is a column vector. Columns of A must match
- * rows of B. Given the other previously tested constraints, this
- * means the vector type of a row from A must be the same as the
- * vector the type of B.
- */
- if (type_a->row_type() == type_b) {
- /* The resulting vector has a number of elements equal to
- * the number of rows of matrix A. */
- const glsl_type *const type =
- glsl_type::get_instance(type_a->base_type,
- type_a->column_type()->vector_elements,
- 1);
- assert(type != glsl_type::error_type);
-
- return type;
- }
- } else {
- assert(type_b->is_matrix());
-
- /* A is a row vector and B is a matrix. Columns of A must match rows
- * of B. Given the other previously tested constraints, this means
- * the type of A must be the same as the vector type of a column from
- * B.
- */
- if (type_a == type_b->column_type()) {
- /* The resulting vector has a number of elements equal to
- * the number of columns of matrix B. */
- const glsl_type *const type =
- glsl_type::get_instance(type_a->base_type,
- type_b->row_type()->vector_elements,
- 1);
- assert(type != glsl_type::error_type);
-
- return type;
- }
- }
-
- _mesa_glsl_error(loc, state, "size mismatch for matrix multiplication");
- return glsl_type::error_type;
- }
-
-
- /* "All other cases are illegal."
- */
- _mesa_glsl_error(loc, state, "type mismatch");
- return glsl_type::error_type;
-}
-
-
-static const struct glsl_type *
-unary_arithmetic_result_type(const struct glsl_type *type,
- struct _mesa_glsl_parse_state *state, YYLTYPE *loc)
-{
- /* From GLSL 1.50 spec, page 57:
- *
- * "The arithmetic unary operators negate (-), post- and pre-increment
- * and decrement (-- and ++) operate on integer or floating-point
- * values (including vectors and matrices). All unary operators work
- * component-wise on their operands. These result with the same type
- * they operated on."
- */
- if (!type->is_numeric()) {
- _mesa_glsl_error(loc, state,
- "Operands to arithmetic operators must be numeric");
- return glsl_type::error_type;
- }
-
- return type;
-}
-
-/**
- * \brief Return the result type of a bit-logic operation.
- *
- * If the given types to the bit-logic operator are invalid, return
- * glsl_type::error_type.
- *
- * \param type_a Type of LHS of bit-logic op
- * \param type_b Type of RHS of bit-logic op
- */
-static const struct glsl_type *
-bit_logic_result_type(const struct glsl_type *type_a,
- const struct glsl_type *type_b,
- ast_operators op,
- struct _mesa_glsl_parse_state *state, YYLTYPE *loc)
-{
- if (state->language_version < 130) {
- _mesa_glsl_error(loc, state, "bit operations require GLSL 1.30");
- return glsl_type::error_type;
- }
-
- /* From page 50 (page 56 of PDF) of GLSL 1.30 spec:
- *
- * "The bitwise operators and (&), exclusive-or (^), and inclusive-or
- * (|). The operands must be of type signed or unsigned integers or
- * integer vectors."
- */
- if (!type_a->is_integer()) {
- _mesa_glsl_error(loc, state, "LHS of `%s' must be an integer",
- ast_expression::operator_string(op));
- return glsl_type::error_type;
- }
- if (!type_b->is_integer()) {
- _mesa_glsl_error(loc, state, "RHS of `%s' must be an integer",
- ast_expression::operator_string(op));
- return glsl_type::error_type;
- }
-
- /* "The fundamental types of the operands (signed or unsigned) must
- * match,"
- */
- if (type_a->base_type != type_b->base_type) {
- _mesa_glsl_error(loc, state, "operands of `%s' must have the same "
- "base type", ast_expression::operator_string(op));
- return glsl_type::error_type;
- }
-
- /* "The operands cannot be vectors of differing size." */
- if (type_a->is_vector() &&
- type_b->is_vector() &&
- type_a->vector_elements != type_b->vector_elements) {
- _mesa_glsl_error(loc, state, "operands of `%s' cannot be vectors of "
- "different sizes", ast_expression::operator_string(op));
- return glsl_type::error_type;
- }
-
- /* "If one operand is a scalar and the other a vector, the scalar is
- * applied component-wise to the vector, resulting in the same type as
- * the vector. The fundamental types of the operands [...] will be the
- * resulting fundamental type."
- */
- if (type_a->is_scalar())
- return type_b;
- else
- return type_a;
-}
-
-static const struct glsl_type *
-modulus_result_type(const struct glsl_type *type_a,
- const struct glsl_type *type_b,
- struct _mesa_glsl_parse_state *state, YYLTYPE *loc)
-{
- if (state->language_version < 130) {
- _mesa_glsl_error(loc, state,
- "operator '%%' is reserved in %s",
- state->version_string);
- return glsl_type::error_type;
- }
-
- /* From GLSL 1.50 spec, page 56:
- * "The operator modulus (%) operates on signed or unsigned integers or
- * integer vectors. The operand types must both be signed or both be
- * unsigned."
- */
- if (!type_a->is_integer() || !type_b->is_integer()
- || (type_a->base_type != type_b->base_type)) {
- _mesa_glsl_error(loc, state, "type mismatch");
- return glsl_type::error_type;
- }
-
- /* "The operands cannot be vectors of differing size. If one operand is
- * a scalar and the other vector, then the scalar is applied component-
- * wise to the vector, resulting in the same type as the vector. If both
- * are vectors of the same size, the result is computed component-wise."
- */
- if (type_a->is_vector()) {
- if (!type_b->is_vector()
- || (type_a->vector_elements == type_b->vector_elements))
- return type_a;
- } else
- return type_b;
-
- /* "The operator modulus (%) is not defined for any other data types
- * (non-integer types)."
- */
- _mesa_glsl_error(loc, state, "type mismatch");
- return glsl_type::error_type;
-}
-
-
-static const struct glsl_type *
-relational_result_type(ir_rvalue * &value_a, ir_rvalue * &value_b,
- struct _mesa_glsl_parse_state *state, YYLTYPE *loc)
-{
- const glsl_type *type_a = value_a->type;
- const glsl_type *type_b = value_b->type;
-
- /* From GLSL 1.50 spec, page 56:
- * "The relational operators greater than (>), less than (<), greater
- * than or equal (>=), and less than or equal (<=) operate only on
- * scalar integer and scalar floating-point expressions."
- */
- if (!type_a->is_numeric()
- || !type_b->is_numeric()
- || !type_a->is_scalar()
- || !type_b->is_scalar()) {
- _mesa_glsl_error(loc, state,
- "Operands to relational operators must be scalar and "
- "numeric");
- return glsl_type::error_type;
- }
-
- /* "Either the operands' types must match, or the conversions from
- * Section 4.1.10 "Implicit Conversions" will be applied to the integer
- * operand, after which the types must match."
- */
- if (!apply_implicit_conversion(type_a, value_b, state)
- && !apply_implicit_conversion(type_b, value_a, state)) {
- _mesa_glsl_error(loc, state,
- "Could not implicitly convert operands to "
- "relational operator");
- return glsl_type::error_type;
- }
- type_a = value_a->type;
- type_b = value_b->type;
-
- if (type_a->base_type != type_b->base_type) {
- _mesa_glsl_error(loc, state, "base type mismatch");
- return glsl_type::error_type;
- }
-
- /* "The result is scalar Boolean."
- */
- return glsl_type::bool_type;
-}
-
-/**
- * \brief Return the result type of a bit-shift operation.
- *
- * If the given types to the bit-shift operator are invalid, return
- * glsl_type::error_type.
- *
- * \param type_a Type of LHS of bit-shift op
- * \param type_b Type of RHS of bit-shift op
- */
-static const struct glsl_type *
-shift_result_type(const struct glsl_type *type_a,
- const struct glsl_type *type_b,
- ast_operators op,
- struct _mesa_glsl_parse_state *state, YYLTYPE *loc)
-{
- if (state->language_version < 130) {
- _mesa_glsl_error(loc, state, "bit operations require GLSL 1.30");
- return glsl_type::error_type;
- }
-
- /* From page 50 (page 56 of the PDF) of the GLSL 1.30 spec:
- *
- * "The shift operators (<<) and (>>). For both operators, the operands
- * must be signed or unsigned integers or integer vectors. One operand
- * can be signed while the other is unsigned."
- */
- if (!type_a->is_integer()) {
- _mesa_glsl_error(loc, state, "LHS of operator %s must be an integer or "
- "integer vector", ast_expression::operator_string(op));
- return glsl_type::error_type;
-
- }
- if (!type_b->is_integer()) {
- _mesa_glsl_error(loc, state, "RHS of operator %s must be an integer or "
- "integer vector", ast_expression::operator_string(op));
- return glsl_type::error_type;
- }
-
- /* "If the first operand is a scalar, the second operand has to be
- * a scalar as well."
- */
- if (type_a->is_scalar() && !type_b->is_scalar()) {
- _mesa_glsl_error(loc, state, "If the first operand of %s is scalar, the "
- "second must be scalar as well",
- ast_expression::operator_string(op));
- return glsl_type::error_type;
- }
-
- /* If both operands are vectors, check that they have same number of
- * elements.
- */
- if (type_a->is_vector() &&
- type_b->is_vector() &&
- type_a->vector_elements != type_b->vector_elements) {
- _mesa_glsl_error(loc, state, "Vector operands to operator %s must "
- "have same number of elements",
- ast_expression::operator_string(op));
- return glsl_type::error_type;
- }
-
- /* "In all cases, the resulting type will be the same type as the left
- * operand."
- */
- return type_a;
-}
-
-/**
- * Validates that a value can be assigned to a location with a specified type
- *
- * Validates that \c rhs can be assigned to some location. If the types are
- * not an exact match but an automatic conversion is possible, \c rhs will be
- * converted.
- *
- * \return
- * \c NULL if \c rhs cannot be assigned to a location with type \c lhs_type.
- * Otherwise the actual RHS to be assigned will be returned. This may be
- * \c rhs, or it may be \c rhs after some type conversion.
- *
- * \note
- * In addition to being used for assignments, this function is used to
- * type-check return values.
- */
-ir_rvalue *
-validate_assignment(struct _mesa_glsl_parse_state *state,
- const glsl_type *lhs_type, ir_rvalue *rhs,
- bool is_initializer)
-{
- /* If there is already some error in the RHS, just return it. Anything
- * else will lead to an avalanche of error message back to the user.
- */
- if (rhs->type->is_error())
- return rhs;
-
- /* If the types are identical, the assignment can trivially proceed.
- */
- if (rhs->type == lhs_type)
- return rhs;
-
- /* If the array element types are the same and the size of the LHS is zero,
- * the assignment is okay for initializers embedded in variable
- * declarations.
- *
- * Note: Whole-array assignments are not permitted in GLSL 1.10, but this
- * is handled by ir_dereference::is_lvalue.
- */
- if (is_initializer && lhs_type->is_array() && rhs->type->is_array()
- && (lhs_type->element_type() == rhs->type->element_type())
- && (lhs_type->array_size() == 0)) {
- return rhs;
- }
-
- /* Check for implicit conversion in GLSL 1.20 */
- if (apply_implicit_conversion(lhs_type, rhs, state)) {
- if (rhs->type == lhs_type)
- return rhs;
- }
-
- return NULL;
-}
-
-ir_rvalue *
-do_assignment(exec_list *instructions, struct _mesa_glsl_parse_state *state,
- ir_rvalue *lhs, ir_rvalue *rhs, bool is_initializer,
- YYLTYPE lhs_loc)
-{
- void *ctx = state;
- bool error_emitted = (lhs->type->is_error() || rhs->type->is_error());
-
- if (!error_emitted) {
- if (lhs->variable_referenced() != NULL
- && lhs->variable_referenced()->read_only) {
- _mesa_glsl_error(&lhs_loc, state,
- "assignment to read-only variable '%s'",
- lhs->variable_referenced()->name);
- error_emitted = true;
-
- } else if (!lhs->is_lvalue()) {
- _mesa_glsl_error(& lhs_loc, state, "non-lvalue in assignment");
- error_emitted = true;
- }
-
- if (state->es_shader && lhs->type->is_array()) {
- _mesa_glsl_error(&lhs_loc, state, "whole array assignment is not "
- "allowed in GLSL ES 1.00.");
- error_emitted = true;
- }
- }
-
- ir_rvalue *new_rhs =
- validate_assignment(state, lhs->type, rhs, is_initializer);
- if (new_rhs == NULL) {
- _mesa_glsl_error(& lhs_loc, state, "type mismatch");
- } else {
- rhs = new_rhs;
-
- /* If the LHS array was not declared with a size, it takes it size from
- * the RHS. If the LHS is an l-value and a whole array, it must be a
- * dereference of a variable. Any other case would require that the LHS
- * is either not an l-value or not a whole array.
- */
- if (lhs->type->array_size() == 0) {
- ir_dereference *const d = lhs->as_dereference();
-
- assert(d != NULL);
-
- ir_variable *const var = d->variable_referenced();
-
- assert(var != NULL);
-
- if (var->max_array_access >= unsigned(rhs->type->array_size())) {
- /* FINISHME: This should actually log the location of the RHS. */
- _mesa_glsl_error(& lhs_loc, state, "array size must be > %u due to "
- "previous access",
- var->max_array_access);
- }
-
- var->type = glsl_type::get_array_instance(lhs->type->element_type(),
- rhs->type->array_size());
- d->type = var->type;
- }
- }
-
- /* Most callers of do_assignment (assign, add_assign, pre_inc/dec,
- * but not post_inc) need the converted assigned value as an rvalue
- * to handle things like:
- *
- * i = j += 1;
- *
- * So we always just store the computed value being assigned to a
- * temporary and return a deref of that temporary. If the rvalue
- * ends up not being used, the temp will get copy-propagated out.
- */
- ir_variable *var = new(ctx) ir_variable(rhs->type, "assignment_tmp",
- ir_var_temporary);
- ir_dereference_variable *deref_var = new(ctx) ir_dereference_variable(var);
- instructions->push_tail(var);
- instructions->push_tail(new(ctx) ir_assignment(deref_var,
- rhs,
- NULL));
- deref_var = new(ctx) ir_dereference_variable(var);
-
- if (!error_emitted)
- instructions->push_tail(new(ctx) ir_assignment(lhs, deref_var, NULL));
-
- return new(ctx) ir_dereference_variable(var);
-}
-
-static ir_rvalue *
-get_lvalue_copy(exec_list *instructions, ir_rvalue *lvalue)
-{
- void *ctx = ralloc_parent(lvalue);
- ir_variable *var;
-
- var = new(ctx) ir_variable(lvalue->type, "_post_incdec_tmp",
- ir_var_temporary);
- instructions->push_tail(var);
- var->mode = ir_var_auto;
-
- instructions->push_tail(new(ctx) ir_assignment(new(ctx) ir_dereference_variable(var),
- lvalue, NULL));
-
- /* Once we've created this temporary, mark it read only so it's no
- * longer considered an lvalue.
- */
- var->read_only = true;
-
- return new(ctx) ir_dereference_variable(var);
-}
-
-
-ir_rvalue *
-ast_node::hir(exec_list *instructions,
- struct _mesa_glsl_parse_state *state)
-{
- (void) instructions;
- (void) state;
-
- return NULL;
-}
-
-static void
-mark_whole_array_access(ir_rvalue *access)
-{
- ir_dereference_variable *deref = access->as_dereference_variable();
-
- if (deref) {
- deref->var->max_array_access = deref->type->length - 1;
- }
-}
-
-static ir_rvalue *
-do_comparison(void *mem_ctx, int operation, ir_rvalue *op0, ir_rvalue *op1)
-{
- int join_op;
- ir_rvalue *cmp = NULL;
-
- if (operation == ir_binop_all_equal)
- join_op = ir_binop_logic_and;
- else
- join_op = ir_binop_logic_or;
-
- switch (op0->type->base_type) {
- case GLSL_TYPE_FLOAT:
- case GLSL_TYPE_UINT:
- case GLSL_TYPE_INT:
- case GLSL_TYPE_BOOL:
- return new(mem_ctx) ir_expression(operation, op0, op1);
-
- case GLSL_TYPE_ARRAY: {
- for (unsigned int i = 0; i < op0->type->length; i++) {
- ir_rvalue *e0, *e1, *result;
-
- e0 = new(mem_ctx) ir_dereference_array(op0->clone(mem_ctx, NULL),
- new(mem_ctx) ir_constant(i));
- e1 = new(mem_ctx) ir_dereference_array(op1->clone(mem_ctx, NULL),
- new(mem_ctx) ir_constant(i));
- result = do_comparison(mem_ctx, operation, e0, e1);
-
- if (cmp) {
- cmp = new(mem_ctx) ir_expression(join_op, cmp, result);
- } else {
- cmp = result;
- }
- }
-
- mark_whole_array_access(op0);
- mark_whole_array_access(op1);
- break;
- }
-
- case GLSL_TYPE_STRUCT: {
- for (unsigned int i = 0; i < op0->type->length; i++) {
- ir_rvalue *e0, *e1, *result;
- const char *field_name = op0->type->fields.structure[i].name;
-
- e0 = new(mem_ctx) ir_dereference_record(op0->clone(mem_ctx, NULL),
- field_name);
- e1 = new(mem_ctx) ir_dereference_record(op1->clone(mem_ctx, NULL),
- field_name);
- result = do_comparison(mem_ctx, operation, e0, e1);
-
- if (cmp) {
- cmp = new(mem_ctx) ir_expression(join_op, cmp, result);
- } else {
- cmp = result;
- }
- }
- break;
- }
-
- case GLSL_TYPE_ERROR:
- case GLSL_TYPE_VOID:
- case GLSL_TYPE_SAMPLER:
- /* I assume a comparison of a struct containing a sampler just
- * ignores the sampler present in the type.
- */
- break;
-
- default:
- assert(!"Should not get here.");
- break;
- }
-
- if (cmp == NULL)
- cmp = new(mem_ctx) ir_constant(true);
-
- return cmp;
-}
-
-/* For logical operations, we want to ensure that the operands are
- * scalar booleans. If it isn't, emit an error and return a constant
- * boolean to avoid triggering cascading error messages.
- */
-ir_rvalue *
-get_scalar_boolean_operand(exec_list *instructions,
- struct _mesa_glsl_parse_state *state,
- ast_expression *parent_expr,
- int operand,
- const char *operand_name,
- bool *error_emitted)
-{
- ast_expression *expr = parent_expr->subexpressions[operand];
- void *ctx = state;
- ir_rvalue *val = expr->hir(instructions, state);
-
- if (val->type->is_boolean() && val->type->is_scalar())
- return val;
-
- if (!*error_emitted) {
- YYLTYPE loc = expr->get_location();
- _mesa_glsl_error(&loc, state, "%s of `%s' must be scalar boolean",
- operand_name,
- parent_expr->operator_string(parent_expr->oper));
- *error_emitted = true;
- }
-
- return new(ctx) ir_constant(true);
-}
-
-ir_rvalue *
-ast_expression::hir(exec_list *instructions,
- struct _mesa_glsl_parse_state *state)
-{
- void *ctx = state;
- static const int operations[AST_NUM_OPERATORS] = {
- -1, /* ast_assign doesn't convert to ir_expression. */
- -1, /* ast_plus doesn't convert to ir_expression. */
- ir_unop_neg,
- ir_binop_add,
- ir_binop_sub,
- ir_binop_mul,
- ir_binop_div,
- ir_binop_mod,
- ir_binop_lshift,
- ir_binop_rshift,
- ir_binop_less,
- ir_binop_greater,
- ir_binop_lequal,
- ir_binop_gequal,
- ir_binop_all_equal,
- ir_binop_any_nequal,
- ir_binop_bit_and,
- ir_binop_bit_xor,
- ir_binop_bit_or,
- ir_unop_bit_not,
- ir_binop_logic_and,
- ir_binop_logic_xor,
- ir_binop_logic_or,
- ir_unop_logic_not,
-
- /* Note: The following block of expression types actually convert
- * to multiple IR instructions.
- */
- ir_binop_mul, /* ast_mul_assign */
- ir_binop_div, /* ast_div_assign */
- ir_binop_mod, /* ast_mod_assign */
- ir_binop_add, /* ast_add_assign */
- ir_binop_sub, /* ast_sub_assign */
- ir_binop_lshift, /* ast_ls_assign */
- ir_binop_rshift, /* ast_rs_assign */
- ir_binop_bit_and, /* ast_and_assign */
- ir_binop_bit_xor, /* ast_xor_assign */
- ir_binop_bit_or, /* ast_or_assign */
-
- -1, /* ast_conditional doesn't convert to ir_expression. */
- ir_binop_add, /* ast_pre_inc. */
- ir_binop_sub, /* ast_pre_dec. */
- ir_binop_add, /* ast_post_inc. */
- ir_binop_sub, /* ast_post_dec. */
- -1, /* ast_field_selection doesn't conv to ir_expression. */
- -1, /* ast_array_index doesn't convert to ir_expression. */
- -1, /* ast_function_call doesn't conv to ir_expression. */
- -1, /* ast_identifier doesn't convert to ir_expression. */
- -1, /* ast_int_constant doesn't convert to ir_expression. */
- -1, /* ast_uint_constant doesn't conv to ir_expression. */
- -1, /* ast_float_constant doesn't conv to ir_expression. */
- -1, /* ast_bool_constant doesn't conv to ir_expression. */
- -1, /* ast_sequence doesn't convert to ir_expression. */
- };
- ir_rvalue *result = NULL;
- ir_rvalue *op[3];
- const struct glsl_type *type; /* a temporary variable for switch cases */
- bool error_emitted = false;
- YYLTYPE loc;
-
- loc = this->get_location();
-
- switch (this->oper) {
- case ast_assign: {
- op[0] = this->subexpressions[0]->hir(instructions, state);
- op[1] = this->subexpressions[1]->hir(instructions, state);
-
- result = do_assignment(instructions, state, op[0], op[1], false,
- this->subexpressions[0]->get_location());
- error_emitted = result->type->is_error();
- break;
- }
-
- case ast_plus:
- op[0] = this->subexpressions[0]->hir(instructions, state);
-
- type = unary_arithmetic_result_type(op[0]->type, state, & loc);
-
- error_emitted = type->is_error();
-
- result = op[0];
- break;
-
- case ast_neg:
- op[0] = this->subexpressions[0]->hir(instructions, state);
-
- type = unary_arithmetic_result_type(op[0]->type, state, & loc);
-
- error_emitted = type->is_error();
-
- result = new(ctx) ir_expression(operations[this->oper], type,
- op[0], NULL);
- break;
-
- case ast_add:
- case ast_sub:
- case ast_mul:
- case ast_div:
- op[0] = this->subexpressions[0]->hir(instructions, state);
- op[1] = this->subexpressions[1]->hir(instructions, state);
-
- type = arithmetic_result_type(op[0], op[1],
- (this->oper == ast_mul),
- state, & loc);
- error_emitted = type->is_error();
-
- result = new(ctx) ir_expression(operations[this->oper], type,
- op[0], op[1]);
- break;
-
- case ast_mod:
- op[0] = this->subexpressions[0]->hir(instructions, state);
- op[1] = this->subexpressions[1]->hir(instructions, state);
-
- type = modulus_result_type(op[0]->type, op[1]->type, state, & loc);
-
- assert(operations[this->oper] == ir_binop_mod);
-
- result = new(ctx) ir_expression(operations[this->oper], type,
- op[0], op[1]);
- error_emitted = type->is_error();
- break;
-
- case ast_lshift:
- case ast_rshift:
- if (state->language_version < 130) {
- _mesa_glsl_error(&loc, state, "operator %s requires GLSL 1.30",
- operator_string(this->oper));
- error_emitted = true;
- }
-
- op[0] = this->subexpressions[0]->hir(instructions, state);
- op[1] = this->subexpressions[1]->hir(instructions, state);
- type = shift_result_type(op[0]->type, op[1]->type, this->oper, state,
- &loc);
- result = new(ctx) ir_expression(operations[this->oper], type,
- op[0], op[1]);
- error_emitted = op[0]->type->is_error() || op[1]->type->is_error();
- break;
-
- case ast_less:
- case ast_greater:
- case ast_lequal:
- case ast_gequal:
- op[0] = this->subexpressions[0]->hir(instructions, state);
- op[1] = this->subexpressions[1]->hir(instructions, state);
-
- type = relational_result_type(op[0], op[1], state, & loc);
-
- /* The relational operators must either generate an error or result
- * in a scalar boolean. See page 57 of the GLSL 1.50 spec.
- */
- assert(type->is_error()
- || ((type->base_type == GLSL_TYPE_BOOL)
- && type->is_scalar()));
-
- result = new(ctx) ir_expression(operations[this->oper], type,
- op[0], op[1]);
- error_emitted = type->is_error();
- break;
-
- case ast_nequal:
- case ast_equal:
- op[0] = this->subexpressions[0]->hir(instructions, state);
- op[1] = this->subexpressions[1]->hir(instructions, state);
-
- /* From page 58 (page 64 of the PDF) of the GLSL 1.50 spec:
- *
- * "The equality operators equal (==), and not equal (!=)
- * operate on all types. They result in a scalar Boolean. If
- * the operand types do not match, then there must be a
- * conversion from Section 4.1.10 "Implicit Conversions"
- * applied to one operand that can make them match, in which
- * case this conversion is done."
- */
- if ((!apply_implicit_conversion(op[0]->type, op[1], state)
- && !apply_implicit_conversion(op[1]->type, op[0], state))
- || (op[0]->type != op[1]->type)) {
- _mesa_glsl_error(& loc, state, "operands of `%s' must have the same "
- "type", (this->oper == ast_equal) ? "==" : "!=");
- error_emitted = true;
- } else if ((state->language_version <= 110)
- && (op[0]->type->is_array() || op[1]->type->is_array())) {
- _mesa_glsl_error(& loc, state, "array comparisons forbidden in "
- "GLSL 1.10");
- error_emitted = true;
- }
-
- if (error_emitted) {
- result = new(ctx) ir_constant(false);
- } else {
- result = do_comparison(ctx, operations[this->oper], op[0], op[1]);
- assert(result->type == glsl_type::bool_type);
- }
- break;
-
- case ast_bit_and:
- case ast_bit_xor:
- case ast_bit_or:
- op[0] = this->subexpressions[0]->hir(instructions, state);
- op[1] = this->subexpressions[1]->hir(instructions, state);
- type = bit_logic_result_type(op[0]->type, op[1]->type, this->oper,
- state, &loc);
- result = new(ctx) ir_expression(operations[this->oper], type,
- op[0], op[1]);
- error_emitted = op[0]->type->is_error() || op[1]->type->is_error();
- break;
-
- case ast_bit_not:
- op[0] = this->subexpressions[0]->hir(instructions, state);
-
- if (state->language_version < 130) {
- _mesa_glsl_error(&loc, state, "bit-wise operations require GLSL 1.30");
- error_emitted = true;
- }
-
- if (!op[0]->type->is_integer()) {
- _mesa_glsl_error(&loc, state, "operand of `~' must be an integer");
- error_emitted = true;
- }
-
- type = op[0]->type;
- result = new(ctx) ir_expression(ir_unop_bit_not, type, op[0], NULL);
- break;
-
- case ast_logic_and: {
- exec_list rhs_instructions;
- op[0] = get_scalar_boolean_operand(instructions, state, this, 0,
- "LHS", &error_emitted);
- op[1] = get_scalar_boolean_operand(&rhs_instructions, state, this, 1,
- "RHS", &error_emitted);
-
- ir_constant *op0_const = op[0]->constant_expression_value();
- if (op0_const) {
- if (op0_const->value.b[0]) {
- instructions->append_list(&rhs_instructions);
- result = op[1];
- } else {
- result = op0_const;
- }
- type = glsl_type::bool_type;
- } else {
- ir_variable *const tmp = new(ctx) ir_variable(glsl_type::bool_type,
- "and_tmp",
- ir_var_temporary);
- instructions->push_tail(tmp);
-
- ir_if *const stmt = new(ctx) ir_if(op[0]);
- instructions->push_tail(stmt);
-
- stmt->then_instructions.append_list(&rhs_instructions);
- ir_dereference *const then_deref = new(ctx) ir_dereference_variable(tmp);
- ir_assignment *const then_assign =
- new(ctx) ir_assignment(then_deref, op[1], NULL);
- stmt->then_instructions.push_tail(then_assign);
-
- ir_dereference *const else_deref = new(ctx) ir_dereference_variable(tmp);
- ir_assignment *const else_assign =
- new(ctx) ir_assignment(else_deref, new(ctx) ir_constant(false), NULL);
- stmt->else_instructions.push_tail(else_assign);
-
- result = new(ctx) ir_dereference_variable(tmp);
- type = tmp->type;
- }
- break;
- }
-
- case ast_logic_or: {
- exec_list rhs_instructions;
- op[0] = get_scalar_boolean_operand(instructions, state, this, 0,
- "LHS", &error_emitted);
- op[1] = get_scalar_boolean_operand(&rhs_instructions, state, this, 1,
- "RHS", &error_emitted);
-
- ir_constant *op0_const = op[0]->constant_expression_value();
- if (op0_const) {
- if (op0_const->value.b[0]) {
- result = op0_const;
- } else {
- result = op[1];
- }
- type = glsl_type::bool_type;
- } else {
- ir_variable *const tmp = new(ctx) ir_variable(glsl_type::bool_type,
- "or_tmp",
- ir_var_temporary);
- instructions->push_tail(tmp);
-
- ir_if *const stmt = new(ctx) ir_if(op[0]);
- instructions->push_tail(stmt);
-
- ir_dereference *const then_deref = new(ctx) ir_dereference_variable(tmp);
- ir_assignment *const then_assign =
- new(ctx) ir_assignment(then_deref, new(ctx) ir_constant(true), NULL);
- stmt->then_instructions.push_tail(then_assign);
-
- stmt->else_instructions.append_list(&rhs_instructions);
- ir_dereference *const else_deref = new(ctx) ir_dereference_variable(tmp);
- ir_assignment *const else_assign =
- new(ctx) ir_assignment(else_deref, op[1], NULL);
- stmt->else_instructions.push_tail(else_assign);
-
- result = new(ctx) ir_dereference_variable(tmp);
- type = tmp->type;
- }
- break;
- }
-
- case ast_logic_xor:
- /* From page 33 (page 39 of the PDF) of the GLSL 1.10 spec:
- *
- * "The logical binary operators and (&&), or ( | | ), and
- * exclusive or (^^). They operate only on two Boolean
- * expressions and result in a Boolean expression."
- */
- op[0] = get_scalar_boolean_operand(instructions, state, this, 0, "LHS",
- &error_emitted);
- op[1] = get_scalar_boolean_operand(instructions, state, this, 1, "RHS",
- &error_emitted);
-
- result = new(ctx) ir_expression(operations[this->oper], glsl_type::bool_type,
- op[0], op[1]);
- break;
-
- case ast_logic_not:
- op[0] = get_scalar_boolean_operand(instructions, state, this, 0,
- "operand", &error_emitted);
-
- result = new(ctx) ir_expression(operations[this->oper], glsl_type::bool_type,
- op[0], NULL);
- break;
-
- case ast_mul_assign:
- case ast_div_assign:
- case ast_add_assign:
- case ast_sub_assign: {
- op[0] = this->subexpressions[0]->hir(instructions, state);
- op[1] = this->subexpressions[1]->hir(instructions, state);
-
- type = arithmetic_result_type(op[0], op[1],
- (this->oper == ast_mul_assign),
- state, & loc);
-
- ir_rvalue *temp_rhs = new(ctx) ir_expression(operations[this->oper], type,
- op[0], op[1]);
-
- result = do_assignment(instructions, state,
- op[0]->clone(ctx, NULL), temp_rhs, false,
- this->subexpressions[0]->get_location());
- error_emitted = (op[0]->type->is_error());
-
- /* GLSL 1.10 does not allow array assignment. However, we don't have to
- * explicitly test for this because none of the binary expression
- * operators allow array operands either.
- */
-
- break;
- }
-
- case ast_mod_assign: {
- op[0] = this->subexpressions[0]->hir(instructions, state);
- op[1] = this->subexpressions[1]->hir(instructions, state);
-
- type = modulus_result_type(op[0]->type, op[1]->type, state, & loc);
-
- assert(operations[this->oper] == ir_binop_mod);
-
- ir_rvalue *temp_rhs;
- temp_rhs = new(ctx) ir_expression(operations[this->oper], type,
- op[0], op[1]);
-
- result = do_assignment(instructions, state,
- op[0]->clone(ctx, NULL), temp_rhs, false,
- this->subexpressions[0]->get_location());
- error_emitted = type->is_error();
- break;
- }
-
- case ast_ls_assign:
- case ast_rs_assign: {
- op[0] = this->subexpressions[0]->hir(instructions, state);
- op[1] = this->subexpressions[1]->hir(instructions, state);
- type = shift_result_type(op[0]->type, op[1]->type, this->oper, state,
- &loc);
- ir_rvalue *temp_rhs = new(ctx) ir_expression(operations[this->oper],
- type, op[0], op[1]);
- result = do_assignment(instructions, state, op[0]->clone(ctx, NULL),
- temp_rhs, false,
- this->subexpressions[0]->get_location());
- error_emitted = op[0]->type->is_error() || op[1]->type->is_error();
- break;
- }
-
- case ast_and_assign:
- case ast_xor_assign:
- case ast_or_assign: {
- op[0] = this->subexpressions[0]->hir(instructions, state);
- op[1] = this->subexpressions[1]->hir(instructions, state);
- type = bit_logic_result_type(op[0]->type, op[1]->type, this->oper,
- state, &loc);
- ir_rvalue *temp_rhs = new(ctx) ir_expression(operations[this->oper],
- type, op[0], op[1]);
- result = do_assignment(instructions, state, op[0]->clone(ctx, NULL),
- temp_rhs, false,
- this->subexpressions[0]->get_location());
- error_emitted = op[0]->type->is_error() || op[1]->type->is_error();
- break;
- }
-
- case ast_conditional: {
- /* From page 59 (page 65 of the PDF) of the GLSL 1.50 spec:
- *
- * "The ternary selection operator (?:). It operates on three
- * expressions (exp1 ? exp2 : exp3). This operator evaluates the
- * first expression, which must result in a scalar Boolean."
- */
- op[0] = get_scalar_boolean_operand(instructions, state, this, 0,
- "condition", &error_emitted);
-
- /* The :? operator is implemented by generating an anonymous temporary
- * followed by an if-statement. The last instruction in each branch of
- * the if-statement assigns a value to the anonymous temporary. This
- * temporary is the r-value of the expression.
- */
- exec_list then_instructions;
- exec_list else_instructions;
-
- op[1] = this->subexpressions[1]->hir(&then_instructions, state);
- op[2] = this->subexpressions[2]->hir(&else_instructions, state);
-
- /* From page 59 (page 65 of the PDF) of the GLSL 1.50 spec:
- *
- * "The second and third expressions can be any type, as
- * long their types match, or there is a conversion in
- * Section 4.1.10 "Implicit Conversions" that can be applied
- * to one of the expressions to make their types match. This
- * resulting matching type is the type of the entire
- * expression."
- */
- if ((!apply_implicit_conversion(op[1]->type, op[2], state)
- && !apply_implicit_conversion(op[2]->type, op[1], state))
- || (op[1]->type != op[2]->type)) {
- YYLTYPE loc = this->subexpressions[1]->get_location();
-
- _mesa_glsl_error(& loc, state, "Second and third operands of ?: "
- "operator must have matching types.");
- error_emitted = true;
- type = glsl_type::error_type;
- } else {
- type = op[1]->type;
- }
-
- /* From page 33 (page 39 of the PDF) of the GLSL 1.10 spec:
- *
- * "The second and third expressions must be the same type, but can
- * be of any type other than an array."
- */
- if ((state->language_version <= 110) && type->is_array()) {
- _mesa_glsl_error(& loc, state, "Second and third operands of ?: "
- "operator must not be arrays.");
- error_emitted = true;
- }
-
- ir_constant *cond_val = op[0]->constant_expression_value();
- ir_constant *then_val = op[1]->constant_expression_value();
- ir_constant *else_val = op[2]->constant_expression_value();
-
- if (then_instructions.is_empty()
- && else_instructions.is_empty()
- && (cond_val != NULL) && (then_val != NULL) && (else_val != NULL)) {
- result = (cond_val->value.b[0]) ? then_val : else_val;
- } else {
- ir_variable *const tmp =
- new(ctx) ir_variable(type, "conditional_tmp", ir_var_temporary);
- instructions->push_tail(tmp);
-
- ir_if *const stmt = new(ctx) ir_if(op[0]);
- instructions->push_tail(stmt);
-
- then_instructions.move_nodes_to(& stmt->then_instructions);
- ir_dereference *const then_deref =
- new(ctx) ir_dereference_variable(tmp);
- ir_assignment *const then_assign =
- new(ctx) ir_assignment(then_deref, op[1], NULL);
- stmt->then_instructions.push_tail(then_assign);
-
- else_instructions.move_nodes_to(& stmt->else_instructions);
- ir_dereference *const else_deref =
- new(ctx) ir_dereference_variable(tmp);
- ir_assignment *const else_assign =
- new(ctx) ir_assignment(else_deref, op[2], NULL);
- stmt->else_instructions.push_tail(else_assign);
-
- result = new(ctx) ir_dereference_variable(tmp);
- }
- break;
- }
-
- case ast_pre_inc:
- case ast_pre_dec: {
- op[0] = this->subexpressions[0]->hir(instructions, state);
- if (op[0]->type->base_type == GLSL_TYPE_FLOAT)
- op[1] = new(ctx) ir_constant(1.0f);
- else
- op[1] = new(ctx) ir_constant(1);
-
- type = arithmetic_result_type(op[0], op[1], false, state, & loc);
-
- ir_rvalue *temp_rhs;
- temp_rhs = new(ctx) ir_expression(operations[this->oper], type,
- op[0], op[1]);
-
- result = do_assignment(instructions, state,
- op[0]->clone(ctx, NULL), temp_rhs, false,
- this->subexpressions[0]->get_location());
- error_emitted = op[0]->type->is_error();
- break;
- }
-
- case ast_post_inc:
- case ast_post_dec: {
- op[0] = this->subexpressions[0]->hir(instructions, state);
- if (op[0]->type->base_type == GLSL_TYPE_FLOAT)
- op[1] = new(ctx) ir_constant(1.0f);
- else
- op[1] = new(ctx) ir_constant(1);
-
- error_emitted = op[0]->type->is_error() || op[1]->type->is_error();
-
- type = arithmetic_result_type(op[0], op[1], false, state, & loc);
-
- ir_rvalue *temp_rhs;
- temp_rhs = new(ctx) ir_expression(operations[this->oper], type,
- op[0], op[1]);
-
- /* Get a temporary of a copy of the lvalue before it's modified.
- * This may get thrown away later.
- */
- result = get_lvalue_copy(instructions, op[0]->clone(ctx, NULL));
-
- (void)do_assignment(instructions, state,
- op[0]->clone(ctx, NULL), temp_rhs, false,
- this->subexpressions[0]->get_location());
-
- error_emitted = op[0]->type->is_error();
- break;
- }
-
- case ast_field_selection:
- result = _mesa_ast_field_selection_to_hir(this, instructions, state);
- break;
-
- case ast_array_index: {
- YYLTYPE index_loc = subexpressions[1]->get_location();
-
- op[0] = subexpressions[0]->hir(instructions, state);
- op[1] = subexpressions[1]->hir(instructions, state);
-
- error_emitted = op[0]->type->is_error() || op[1]->type->is_error();
-
- ir_rvalue *const array = op[0];
-
- result = new(ctx) ir_dereference_array(op[0], op[1]);
-
- /* Do not use op[0] after this point. Use array.
- */
- op[0] = NULL;
-
-
- if (error_emitted)
- break;
-
- if (!array->type->is_array()
- && !array->type->is_matrix()
- && !array->type->is_vector()) {
- _mesa_glsl_error(& index_loc, state,
- "cannot dereference non-array / non-matrix / "
- "non-vector");
- error_emitted = true;
- }
-
- if (!op[1]->type->is_integer()) {
- _mesa_glsl_error(& index_loc, state,
- "array index must be integer type");
- error_emitted = true;
- } else if (!op[1]->type->is_scalar()) {
- _mesa_glsl_error(& index_loc, state,
- "array index must be scalar");
- error_emitted = true;
- }
-
- /* If the array index is a constant expression and the array has a
- * declared size, ensure that the access is in-bounds. If the array
- * index is not a constant expression, ensure that the array has a
- * declared size.
- */
- ir_constant *const const_index = op[1]->constant_expression_value();
- if (const_index != NULL) {
- const int idx = const_index->value.i[0];
- const char *type_name;
- unsigned bound = 0;
-
- if (array->type->is_matrix()) {
- type_name = "matrix";
- } else if (array->type->is_vector()) {
- type_name = "vector";
- } else {
- type_name = "array";
- }
-
- /* From page 24 (page 30 of the PDF) of the GLSL 1.50 spec:
- *
- * "It is illegal to declare an array with a size, and then
- * later (in the same shader) index the same array with an
- * integral constant expression greater than or equal to the
- * declared size. It is also illegal to index an array with a
- * negative constant expression."
- */
- if (array->type->is_matrix()) {
- if (array->type->row_type()->vector_elements <= idx) {
- bound = array->type->row_type()->vector_elements;
- }
- } else if (array->type->is_vector()) {
- if (array->type->vector_elements <= idx) {
- bound = array->type->vector_elements;
- }
- } else {
- if ((array->type->array_size() > 0)
- && (array->type->array_size() <= idx)) {
- bound = array->type->array_size();
- }
- }
-
- if (bound > 0) {
- _mesa_glsl_error(& loc, state, "%s index must be < %u",
- type_name, bound);
- error_emitted = true;
- } else if (idx < 0) {
- _mesa_glsl_error(& loc, state, "%s index must be >= 0",
- type_name);
- error_emitted = true;
- }
-
- if (array->type->is_array()) {
- /* If the array is a variable dereference, it dereferences the
- * whole array, by definition. Use this to get the variable.
- *
- * FINISHME: Should some methods for getting / setting / testing
- * FINISHME: array access limits be added to ir_dereference?
- */
- ir_variable *const v = array->whole_variable_referenced();
- if ((v != NULL) && (unsigned(idx) > v->max_array_access))
- v->max_array_access = idx;
- }
- } else if (array->type->array_size() == 0) {
- _mesa_glsl_error(&loc, state, "unsized array index must be constant");
- } else {
- if (array->type->is_array()) {
- /* whole_variable_referenced can return NULL if the array is a
- * member of a structure. In this case it is safe to not update
- * the max_array_access field because it is never used for fields
- * of structures.
- */
- ir_variable *v = array->whole_variable_referenced();
- if (v != NULL)
- v->max_array_access = array->type->array_size() - 1;
- }
- }
-
- /* From page 23 (29 of the PDF) of the GLSL 1.30 spec:
- *
- * "Samplers aggregated into arrays within a shader (using square
- * brackets [ ]) can only be indexed with integral constant
- * expressions [...]."
- *
- * This restriction was added in GLSL 1.30. Shaders using earlier version
- * of the language should not be rejected by the compiler front-end for
- * using this construct. This allows useful things such as using a loop
- * counter as the index to an array of samplers. If the loop in unrolled,
- * the code should compile correctly. Instead, emit a warning.
- */
- if (array->type->is_array() &&
- array->type->element_type()->is_sampler() &&
- const_index == NULL) {
-
- if (state->language_version == 100) {
- _mesa_glsl_warning(&loc, state,
- "sampler arrays indexed with non-constant "
- "expressions is optional in GLSL ES 1.00");
- } else if (state->language_version < 130) {
- _mesa_glsl_warning(&loc, state,
- "sampler arrays indexed with non-constant "
- "expressions is forbidden in GLSL 1.30 and "
- "later");
- } else {
- _mesa_glsl_error(&loc, state,
- "sampler arrays indexed with non-constant "
- "expressions is forbidden in GLSL 1.30 and "
- "later");
- error_emitted = true;
- }
- }
-
- if (error_emitted)
- result->type = glsl_type::error_type;
-
- break;
- }
-
- case ast_function_call:
- /* Should *NEVER* get here. ast_function_call should always be handled
- * by ast_function_expression::hir.
- */
- assert(0);
- break;
-
- case ast_identifier: {
- /* ast_identifier can appear several places in a full abstract syntax
- * tree. This particular use must be at location specified in the grammar
- * as 'variable_identifier'.
- */
- ir_variable *var =
- state->symbols->get_variable(this->primary_expression.identifier);
-
- result = new(ctx) ir_dereference_variable(var);
-
- if (var != NULL) {
- var->used = true;
- } else {
- _mesa_glsl_error(& loc, state, "`%s' undeclared",
- this->primary_expression.identifier);
-
- error_emitted = true;
- }
- break;
- }
-
- case ast_int_constant:
- result = new(ctx) ir_constant(this->primary_expression.int_constant);
- break;
-
- case ast_uint_constant:
- result = new(ctx) ir_constant(this->primary_expression.uint_constant);
- break;
-
- case ast_float_constant:
- result = new(ctx) ir_constant(this->primary_expression.float_constant);
- break;
-
- case ast_bool_constant:
- result = new(ctx) ir_constant(bool(this->primary_expression.bool_constant));
- break;
-
- case ast_sequence: {
- /* It should not be possible to generate a sequence in the AST without
- * any expressions in it.
- */
- assert(!this->expressions.is_empty());
-
- /* The r-value of a sequence is the last expression in the sequence. If
- * the other expressions in the sequence do not have side-effects (and
- * therefore add instructions to the instruction list), they get dropped
- * on the floor.
- */
- exec_node *previous_tail_pred = NULL;
- YYLTYPE previous_operand_loc = loc;
-
- foreach_list_typed (ast_node, ast, link, &this->expressions) {
- /* If one of the operands of comma operator does not generate any
- * code, we want to emit a warning. At each pass through the loop
- * previous_tail_pred will point to the last instruction in the
- * stream *before* processing the previous operand. Naturally,
- * instructions->tail_pred will point to the last instruction in the
- * stream *after* processing the previous operand. If the two
- * pointers match, then the previous operand had no effect.
- *
- * The warning behavior here differs slightly from GCC. GCC will
- * only emit a warning if none of the left-hand operands have an
- * effect. However, it will emit a warning for each. I believe that
- * there are some cases in C (especially with GCC extensions) where
- * it is useful to have an intermediate step in a sequence have no
- * effect, but I don't think these cases exist in GLSL. Either way,
- * it would be a giant hassle to replicate that behavior.
- */
- if (previous_tail_pred == instructions->tail_pred) {
- _mesa_glsl_warning(&previous_operand_loc, state,
- "left-hand operand of comma expression has "
- "no effect");
- }
-
- /* tail_pred is directly accessed instead of using the get_tail()
- * method for performance reasons. get_tail() has extra code to
- * return NULL when the list is empty. We don't care about that
- * here, so using tail_pred directly is fine.
- */
- previous_tail_pred = instructions->tail_pred;
- previous_operand_loc = ast->get_location();
-
- result = ast->hir(instructions, state);
- }
-
- /* Any errors should have already been emitted in the loop above.
- */
- error_emitted = true;
- break;
- }
- }
- type = NULL; /* use result->type, not type. */
- assert(result != NULL);
-
- if (result->type->is_error() && !error_emitted)
- _mesa_glsl_error(& loc, state, "type mismatch");
-
- return result;
-}
-
-
-ir_rvalue *
-ast_expression_statement::hir(exec_list *instructions,
- struct _mesa_glsl_parse_state *state)
-{
- /* It is possible to have expression statements that don't have an
- * expression. This is the solitary semicolon:
- *
- * for (i = 0; i < 5; i++)
- * ;
- *
- * In this case the expression will be NULL. Test for NULL and don't do
- * anything in that case.
- */
- if (expression != NULL)
- expression->hir(instructions, state);
-
- /* Statements do not have r-values.
- */
- return NULL;
-}
-
-
-ir_rvalue *
-ast_compound_statement::hir(exec_list *instructions,
- struct _mesa_glsl_parse_state *state)
-{
- if (new_scope)
- state->symbols->push_scope();
-
- foreach_list_typed (ast_node, ast, link, &this->statements)
- ast->hir(instructions, state);
-
- if (new_scope)
- state->symbols->pop_scope();
-
- /* Compound statements do not have r-values.
- */
- return NULL;
-}
-
-
-static const glsl_type *
-process_array_type(YYLTYPE *loc, const glsl_type *base, ast_node *array_size,
- struct _mesa_glsl_parse_state *state)
-{
- unsigned length = 0;
-
- /* FINISHME: Reject delcarations of multidimensional arrays. */
-
- if (array_size != NULL) {
- exec_list dummy_instructions;
- ir_rvalue *const ir = array_size->hir(& dummy_instructions, state);
- YYLTYPE loc = array_size->get_location();
-
- /* FINISHME: Verify that the grammar forbids side-effects in array
- * FINISHME: sizes. i.e., 'vec4 [x = 12] data'
- */
- assert(dummy_instructions.is_empty());
-
- if (ir != NULL) {
- if (!ir->type->is_integer()) {
- _mesa_glsl_error(& loc, state, "array size must be integer type");
- } else if (!ir->type->is_scalar()) {
- _mesa_glsl_error(& loc, state, "array size must be scalar type");
- } else {
- ir_constant *const size = ir->constant_expression_value();
-
- if (size == NULL) {
- _mesa_glsl_error(& loc, state, "array size must be a "
- "constant valued expression");
- } else if (size->value.i[0] <= 0) {
- _mesa_glsl_error(& loc, state, "array size must be > 0");
- } else {
- assert(size->type == ir->type);
- length = size->value.u[0];
- }
- }
- }
- } else if (state->es_shader) {
- /* Section 10.17 of the GLSL ES 1.00 specification states that unsized
- * array declarations have been removed from the language.
- */
- _mesa_glsl_error(loc, state, "unsized array declarations are not "
- "allowed in GLSL ES 1.00.");
- }
-
- return glsl_type::get_array_instance(base, length);
-}
-
-
-const glsl_type *
-ast_type_specifier::glsl_type(const char **name,
- struct _mesa_glsl_parse_state *state) const
-{
- const struct glsl_type *type;
-
- type = state->symbols->get_type(this->type_name);
- *name = this->type_name;
-
- if (this->is_array) {
- YYLTYPE loc = this->get_location();
- type = process_array_type(&loc, type, this->array_size, state);
- }
-
- return type;
-}
-
-
-static void
-apply_type_qualifier_to_variable(const struct ast_type_qualifier *qual,
- ir_variable *var,
- struct _mesa_glsl_parse_state *state,
- YYLTYPE *loc)
-{
- if (qual->flags.q.invariant) {
- if (var->used) {
- _mesa_glsl_error(loc, state,
- "variable `%s' may not be redeclared "
- "`invariant' after being used",
- var->name);
- } else {
- var->invariant = 1;
- }
- }
-
- if (qual->flags.q.constant || qual->flags.q.attribute
- || qual->flags.q.uniform
- || (qual->flags.q.varying && (state->target == fragment_shader)))
- var->read_only = 1;
-
- if (qual->flags.q.centroid)
- var->centroid = 1;
-
- if (qual->flags.q.attribute && state->target != vertex_shader) {
- var->type = glsl_type::error_type;
- _mesa_glsl_error(loc, state,
- "`attribute' variables may not be declared in the "
- "%s shader",
- _mesa_glsl_shader_target_name(state->target));
- }
-
- /* From page 25 (page 31 of the PDF) of the GLSL 1.10 spec:
- *
- * "The varying qualifier can be used only with the data types
- * float, vec2, vec3, vec4, mat2, mat3, and mat4, or arrays of
- * these."
- */
- if (qual->flags.q.varying) {
- const glsl_type *non_array_type;
-
- if (var->type && var->type->is_array())
- non_array_type = var->type->fields.array;
- else
- non_array_type = var->type;
-
- if (non_array_type && non_array_type->base_type != GLSL_TYPE_FLOAT) {
- var->type = glsl_type::error_type;
- _mesa_glsl_error(loc, state,
- "varying variables must be of base type float");
- }
- }
-
- /* If there is no qualifier that changes the mode of the variable, leave
- * the setting alone.
- */
- if (qual->flags.q.in && qual->flags.q.out)
- var->mode = ir_var_inout;
- else if (qual->flags.q.attribute || qual->flags.q.in
- || (qual->flags.q.varying && (state->target == fragment_shader)))
- var->mode = ir_var_in;
- else if (qual->flags.q.out
- || (qual->flags.q.varying && (state->target == vertex_shader)))
- var->mode = ir_var_out;
- else if (qual->flags.q.uniform)
- var->mode = ir_var_uniform;
-
- if (state->all_invariant && (state->current_function == NULL)) {
- switch (state->target) {
- case vertex_shader:
- if (var->mode == ir_var_out)
- var->invariant = true;
- break;
- case geometry_shader:
- if ((var->mode == ir_var_in) || (var->mode == ir_var_out))
- var->invariant = true;
- break;
- case fragment_shader:
- if (var->mode == ir_var_in)
- var->invariant = true;
- break;
- }
- }
-
- if (qual->flags.q.flat)
- var->interpolation = ir_var_flat;
- else if (qual->flags.q.noperspective)
- var->interpolation = ir_var_noperspective;
- else
- var->interpolation = ir_var_smooth;
-
- var->pixel_center_integer = qual->flags.q.pixel_center_integer;
- var->origin_upper_left = qual->flags.q.origin_upper_left;
- if ((qual->flags.q.origin_upper_left || qual->flags.q.pixel_center_integer)
- && (strcmp(var->name, "gl_FragCoord") != 0)) {
- const char *const qual_string = (qual->flags.q.origin_upper_left)
- ? "origin_upper_left" : "pixel_center_integer";
-
- _mesa_glsl_error(loc, state,
- "layout qualifier `%s' can only be applied to "
- "fragment shader input `gl_FragCoord'",
- qual_string);
- }
-
- if (qual->flags.q.explicit_location) {
- const bool global_scope = (state->current_function == NULL);
- bool fail = false;
- const char *string = "";
-
- /* In the vertex shader only shader inputs can be given explicit
- * locations.
- *
- * In the fragment shader only shader outputs can be given explicit
- * locations.
- */
- switch (state->target) {
- case vertex_shader:
- if (!global_scope || (var->mode != ir_var_in)) {
- fail = true;
- string = "input";
- }
- break;
-
- case geometry_shader:
- _mesa_glsl_error(loc, state,
- "geometry shader variables cannot be given "
- "explicit locations\n");
- break;
-
- case fragment_shader:
- if (!global_scope || (var->mode != ir_var_in)) {
- fail = true;
- string = "output";
- }
- break;
- };
-
- if (fail) {
- _mesa_glsl_error(loc, state,
- "only %s shader %s variables can be given an "
- "explicit location\n",
- _mesa_glsl_shader_target_name(state->target),
- string);
- } else {
- var->explicit_location = true;
-
- /* This bit of silliness is needed because invalid explicit locations
- * are supposed to be flagged during linking. Small negative values
- * biased by VERT_ATTRIB_GENERIC0 or FRAG_RESULT_DATA0 could alias
- * built-in values (e.g., -16+VERT_ATTRIB_GENERIC0 = VERT_ATTRIB_POS).
- * The linker needs to be able to differentiate these cases. This
- * ensures that negative values stay negative.
- */
- if (qual->location >= 0) {
- var->location = (state->target == vertex_shader)
- ? (qual->location + VERT_ATTRIB_GENERIC0)
- : (qual->location + FRAG_RESULT_DATA0);
- } else {
- var->location = qual->location;
- }
- }
- }
-
- /* Does the declaration use the 'layout' keyword?
- */
- const bool uses_layout = qual->flags.q.pixel_center_integer
- || qual->flags.q.origin_upper_left
- || qual->flags.q.explicit_location;
-
- /* Does the declaration use the deprecated 'attribute' or 'varying'
- * keywords?
- */
- const bool uses_deprecated_qualifier = qual->flags.q.attribute
- || qual->flags.q.varying;
-
- /* Is the 'layout' keyword used with parameters that allow relaxed checking.
- * Many implementations of GL_ARB_fragment_coord_conventions_enable and some
- * implementations (only Mesa?) GL_ARB_explicit_attrib_location_enable
- * allowed the layout qualifier to be used with 'varying' and 'attribute'.
- * These extensions and all following extensions that add the 'layout'
- * keyword have been modified to require the use of 'in' or 'out'.
- *
- * The following extension do not allow the deprecated keywords:
- *
- * GL_AMD_conservative_depth
- * GL_ARB_gpu_shader5
- * GL_ARB_separate_shader_objects
- * GL_ARB_tesselation_shader
- * GL_ARB_transform_feedback3
- * GL_ARB_uniform_buffer_object
- *
- * It is unknown whether GL_EXT_shader_image_load_store or GL_NV_gpu_shader5
- * allow layout with the deprecated keywords.
- */
- const bool relaxed_layout_qualifier_checking =
- state->ARB_fragment_coord_conventions_enable;
-
- if (uses_layout && uses_deprecated_qualifier) {
- if (relaxed_layout_qualifier_checking) {
- _mesa_glsl_warning(loc, state,
- "`layout' qualifier may not be used with "
- "`attribute' or `varying'");
- } else {
- _mesa_glsl_error(loc, state,
- "`layout' qualifier may not be used with "
- "`attribute' or `varying'");
- }
- }
-
- /* Layout qualifiers for gl_FragDepth, which are enabled by extension
- * AMD_conservative_depth.
- */
- int depth_layout_count = qual->flags.q.depth_any
- + qual->flags.q.depth_greater
- + qual->flags.q.depth_less
- + qual->flags.q.depth_unchanged;
- if (depth_layout_count > 0
- && !state->AMD_conservative_depth_enable) {
- _mesa_glsl_error(loc, state,
- "extension GL_AMD_conservative_depth must be enabled "
- "to use depth layout qualifiers");
- } else if (depth_layout_count > 0
- && strcmp(var->name, "gl_FragDepth") != 0) {
- _mesa_glsl_error(loc, state,
- "depth layout qualifiers can be applied only to "
- "gl_FragDepth");
- } else if (depth_layout_count > 1
- && strcmp(var->name, "gl_FragDepth") == 0) {
- _mesa_glsl_error(loc, state,
- "at most one depth layout qualifier can be applied to "
- "gl_FragDepth");
- }
- if (qual->flags.q.depth_any)
- var->depth_layout = ir_depth_layout_any;
- else if (qual->flags.q.depth_greater)
- var->depth_layout = ir_depth_layout_greater;
- else if (qual->flags.q.depth_less)
- var->depth_layout = ir_depth_layout_less;
- else if (qual->flags.q.depth_unchanged)
- var->depth_layout = ir_depth_layout_unchanged;
- else
- var->depth_layout = ir_depth_layout_none;
-
- if (var->type->is_array() && state->language_version != 110) {
- var->array_lvalue = true;
- }
-}
-
-/**
- * Get the variable that is being redeclared by this declaration
- *
- * Semantic checks to verify the validity of the redeclaration are also
- * performed. If semantic checks fail, compilation error will be emitted via
- * \c _mesa_glsl_error, but a non-\c NULL pointer will still be returned.
- *
- * \returns
- * A pointer to an existing variable in the current scope if the declaration
- * is a redeclaration, \c NULL otherwise.
- */
-ir_variable *
-get_variable_being_redeclared(ir_variable *var, ast_declaration *decl,
- struct _mesa_glsl_parse_state *state)
-{
- /* Check if this declaration is actually a re-declaration, either to
- * resize an array or add qualifiers to an existing variable.
- *
- * This is allowed for variables in the current scope, or when at
- * global scope (for built-ins in the implicit outer scope).
- */
- ir_variable *earlier = state->symbols->get_variable(decl->identifier);
- if (earlier == NULL ||
- (state->current_function != NULL &&
- !state->symbols->name_declared_this_scope(decl->identifier))) {
- return NULL;
- }
-
-
- YYLTYPE loc = decl->get_location();
-
- /* From page 24 (page 30 of the PDF) of the GLSL 1.50 spec,
- *
- * "It is legal to declare an array without a size and then
- * later re-declare the same name as an array of the same
- * type and specify a size."
- */
- if ((earlier->type->array_size() == 0)
- && var->type->is_array()
- && (var->type->element_type() == earlier->type->element_type())) {
- /* FINISHME: This doesn't match the qualifiers on the two
- * FINISHME: declarations. It's not 100% clear whether this is
- * FINISHME: required or not.
- */
-
- /* From page 54 (page 60 of the PDF) of the GLSL 1.20 spec:
- *
- * "The size [of gl_TexCoord] can be at most
- * gl_MaxTextureCoords."
- */
- const unsigned size = unsigned(var->type->array_size());
- if ((strcmp("gl_TexCoord", var->name) == 0)
- && (size > state->Const.MaxTextureCoords)) {
- _mesa_glsl_error(& loc, state, "`gl_TexCoord' array size cannot "
- "be larger than gl_MaxTextureCoords (%u)\n",
- state->Const.MaxTextureCoords);
- } else if ((size > 0) && (size <= earlier->max_array_access)) {
- _mesa_glsl_error(& loc, state, "array size must be > %u due to "
- "previous access",
- earlier->max_array_access);
- }
-
- earlier->type = var->type;
- delete var;
- var = NULL;
- } else if (state->ARB_fragment_coord_conventions_enable
- && strcmp(var->name, "gl_FragCoord") == 0
- && earlier->type == var->type
- && earlier->mode == var->mode) {
- /* Allow redeclaration of gl_FragCoord for ARB_fcc layout
- * qualifiers.
- */
- earlier->origin_upper_left = var->origin_upper_left;
- earlier->pixel_center_integer = var->pixel_center_integer;
-
- /* According to section 4.3.7 of the GLSL 1.30 spec,
- * the following built-in varaibles can be redeclared with an
- * interpolation qualifier:
- * * gl_FrontColor
- * * gl_BackColor
- * * gl_FrontSecondaryColor
- * * gl_BackSecondaryColor
- * * gl_Color
- * * gl_SecondaryColor
- */
- } else if (state->language_version >= 130
- && (strcmp(var->name, "gl_FrontColor") == 0
- || strcmp(var->name, "gl_BackColor") == 0
- || strcmp(var->name, "gl_FrontSecondaryColor") == 0
- || strcmp(var->name, "gl_BackSecondaryColor") == 0
- || strcmp(var->name, "gl_Color") == 0
- || strcmp(var->name, "gl_SecondaryColor") == 0)
- && earlier->type == var->type
- && earlier->mode == var->mode) {
- earlier->interpolation = var->interpolation;
-
- /* Layout qualifiers for gl_FragDepth. */
- } else if (state->AMD_conservative_depth_enable
- && strcmp(var->name, "gl_FragDepth") == 0
- && earlier->type == var->type
- && earlier->mode == var->mode) {
-
- /** From the AMD_conservative_depth spec:
- * Within any shader, the first redeclarations of gl_FragDepth
- * must appear before any use of gl_FragDepth.
- */
- if (earlier->used) {
- _mesa_glsl_error(&loc, state,
- "the first redeclaration of gl_FragDepth "
- "must appear before any use of gl_FragDepth");
- }
-
- /* Prevent inconsistent redeclaration of depth layout qualifier. */
- if (earlier->depth_layout != ir_depth_layout_none
- && earlier->depth_layout != var->depth_layout) {
- _mesa_glsl_error(&loc, state,
- "gl_FragDepth: depth layout is declared here "
- "as '%s, but it was previously declared as "
- "'%s'",
- depth_layout_string(var->depth_layout),
- depth_layout_string(earlier->depth_layout));
- }
-
- earlier->depth_layout = var->depth_layout;
-
- } else {
- _mesa_glsl_error(&loc, state, "`%s' redeclared", decl->identifier);
- }
-
- return earlier;
-}
-
-/**
- * Generate the IR for an initializer in a variable declaration
- */
-ir_rvalue *
-process_initializer(ir_variable *var, ast_declaration *decl,
- ast_fully_specified_type *type,
- exec_list *initializer_instructions,
- struct _mesa_glsl_parse_state *state)
-{
- ir_rvalue *result = NULL;
-
- YYLTYPE initializer_loc = decl->initializer->get_location();
-
- /* From page 24 (page 30 of the PDF) of the GLSL 1.10 spec:
- *
- * "All uniform variables are read-only and are initialized either
- * directly by an application via API commands, or indirectly by
- * OpenGL."
- */
- if ((state->language_version <= 110)
- && (var->mode == ir_var_uniform)) {
- _mesa_glsl_error(& initializer_loc, state,
- "cannot initialize uniforms in GLSL 1.10");
- }
-
- if (var->type->is_sampler()) {
- _mesa_glsl_error(& initializer_loc, state,
- "cannot initialize samplers");
- }
-
- if ((var->mode == ir_var_in) && (state->current_function == NULL)) {
- _mesa_glsl_error(& initializer_loc, state,
- "cannot initialize %s shader input / %s",
- _mesa_glsl_shader_target_name(state->target),
- (state->target == vertex_shader)
- ? "attribute" : "varying");
- }
-
- ir_dereference *const lhs = new(state) ir_dereference_variable(var);
- ir_rvalue *rhs = decl->initializer->hir(initializer_instructions,
- state);
-
- /* Calculate the constant value if this is a const or uniform
- * declaration.
- */
- if (type->qualifier.flags.q.constant
- || type->qualifier.flags.q.uniform) {
- ir_rvalue *new_rhs = validate_assignment(state, var->type, rhs, true);
- if (new_rhs != NULL) {
- rhs = new_rhs;
-
- ir_constant *constant_value = rhs->constant_expression_value();
- if (!constant_value) {
- _mesa_glsl_error(& initializer_loc, state,
- "initializer of %s variable `%s' must be a "
- "constant expression",
- (type->qualifier.flags.q.constant)
- ? "const" : "uniform",
- decl->identifier);
- if (var->type->is_numeric()) {
- /* Reduce cascading errors. */
- var->constant_value = ir_constant::zero(state, var->type);
- }
- } else {
- rhs = constant_value;
- var->constant_value = constant_value;
- }
- } else {
- _mesa_glsl_error(&initializer_loc, state,
- "initializer of type %s cannot be assigned to "
- "variable of type %s",
- rhs->type->name, var->type->name);
- if (var->type->is_numeric()) {
- /* Reduce cascading errors. */
- var->constant_value = ir_constant::zero(state, var->type);
- }
- }
- }
-
- if (rhs && !rhs->type->is_error()) {
- bool temp = var->read_only;
- if (type->qualifier.flags.q.constant)
- var->read_only = false;
-
- /* Never emit code to initialize a uniform.
- */
- const glsl_type *initializer_type;
- if (!type->qualifier.flags.q.uniform) {
- result = do_assignment(initializer_instructions, state,
- lhs, rhs, true,
- type->get_location());
- initializer_type = result->type;
- } else
- initializer_type = rhs->type;
-
- /* If the declared variable is an unsized array, it must inherrit
- * its full type from the initializer. A declaration such as
- *
- * uniform float a[] = float[](1.0, 2.0, 3.0, 3.0);
- *
- * becomes
- *
- * uniform float a[4] = float[](1.0, 2.0, 3.0, 3.0);
- *
- * The assignment generated in the if-statement (below) will also
- * automatically handle this case for non-uniforms.
- *
- * If the declared variable is not an array, the types must
- * already match exactly. As a result, the type assignment
- * here can be done unconditionally. For non-uniforms the call
- * to do_assignment can change the type of the initializer (via
- * the implicit conversion rules). For uniforms the initializer
- * must be a constant expression, and the type of that expression
- * was validated above.
- */
- var->type = initializer_type;
-
- var->read_only = temp;
- }
-
- return result;
-}
-
-ir_rvalue *
-ast_declarator_list::hir(exec_list *instructions,
- struct _mesa_glsl_parse_state *state)
-{
- void *ctx = state;
- const struct glsl_type *decl_type;
- const char *type_name = NULL;
- ir_rvalue *result = NULL;
- YYLTYPE loc = this->get_location();
-
- /* From page 46 (page 52 of the PDF) of the GLSL 1.50 spec:
- *
- * "To ensure that a particular output variable is invariant, it is
- * necessary to use the invariant qualifier. It can either be used to
- * qualify a previously declared variable as being invariant
- *
- * invariant gl_Position; // make existing gl_Position be invariant"
- *
- * In these cases the parser will set the 'invariant' flag in the declarator
- * list, and the type will be NULL.
- */
- if (this->invariant) {
- assert(this->type == NULL);
-
- if (state->current_function != NULL) {
- _mesa_glsl_error(& loc, state,
- "All uses of `invariant' keyword must be at global "
- "scope\n");
- }
-
- foreach_list_typed (ast_declaration, decl, link, &this->declarations) {
- assert(!decl->is_array);
- assert(decl->array_size == NULL);
- assert(decl->initializer == NULL);
-
- ir_variable *const earlier =
- state->symbols->get_variable(decl->identifier);
- if (earlier == NULL) {
- _mesa_glsl_error(& loc, state,
- "Undeclared variable `%s' cannot be marked "
- "invariant\n", decl->identifier);
- } else if ((state->target == vertex_shader)
- && (earlier->mode != ir_var_out)) {
- _mesa_glsl_error(& loc, state,
- "`%s' cannot be marked invariant, vertex shader "
- "outputs only\n", decl->identifier);
- } else if ((state->target == fragment_shader)
- && (earlier->mode != ir_var_in)) {
- _mesa_glsl_error(& loc, state,
- "`%s' cannot be marked invariant, fragment shader "
- "inputs only\n", decl->identifier);
- } else if (earlier->used) {
- _mesa_glsl_error(& loc, state,
- "variable `%s' may not be redeclared "
- "`invariant' after being used",
- earlier->name);
- } else {
- earlier->invariant = true;
- }
- }
-
- /* Invariant redeclarations do not have r-values.
- */
- return NULL;
- }
-
- assert(this->type != NULL);
- assert(!this->invariant);
-
- /* The type specifier may contain a structure definition. Process that
- * before any of the variable declarations.
- */
- (void) this->type->specifier->hir(instructions, state);
-
- decl_type = this->type->specifier->glsl_type(& type_name, state);
- if (this->declarations.is_empty()) {
- /* The only valid case where the declaration list can be empty is when
- * the declaration is setting the default precision of a built-in type
- * (e.g., 'precision highp vec4;').
- */
-
- if (decl_type != NULL) {
- } else {
- _mesa_glsl_error(& loc, state, "incomplete declaration");
- }
- }
-
- foreach_list_typed (ast_declaration, decl, link, &this->declarations) {
- const struct glsl_type *var_type;
- ir_variable *var;
-
- /* FINISHME: Emit a warning if a variable declaration shadows a
- * FINISHME: declaration at a higher scope.
- */
-
- if ((decl_type == NULL) || decl_type->is_void()) {
- if (type_name != NULL) {
- _mesa_glsl_error(& loc, state,
- "invalid type `%s' in declaration of `%s'",
- type_name, decl->identifier);
- } else {
- _mesa_glsl_error(& loc, state,
- "invalid type in declaration of `%s'",
- decl->identifier);
- }
- continue;
- }
-
- if (decl->is_array) {
- var_type = process_array_type(&loc, decl_type, decl->array_size,
- state);
- } else {
- var_type = decl_type;
- }
-
- var = new(ctx) ir_variable(var_type, decl->identifier, ir_var_auto);
-
- /* From page 22 (page 28 of the PDF) of the GLSL 1.10 specification;
- *
- * "Global variables can only use the qualifiers const,
- * attribute, uni form, or varying. Only one may be
- * specified.
- *
- * Local variables can only use the qualifier const."
- *
- * This is relaxed in GLSL 1.30. It is also relaxed by any extension
- * that adds the 'layout' keyword.
- */
- if ((state->language_version < 130)
- && !state->ARB_explicit_attrib_location_enable
- && !state->ARB_fragment_coord_conventions_enable) {
- if (this->type->qualifier.flags.q.out) {
- _mesa_glsl_error(& loc, state,
- "`out' qualifier in declaration of `%s' "
- "only valid for function parameters in %s.",
- decl->identifier, state->version_string);
- }
- if (this->type->qualifier.flags.q.in) {
- _mesa_glsl_error(& loc, state,
- "`in' qualifier in declaration of `%s' "
- "only valid for function parameters in %s.",
- decl->identifier, state->version_string);
- }
- /* FINISHME: Test for other invalid qualifiers. */
- }
-
- apply_type_qualifier_to_variable(& this->type->qualifier, var, state,
- & loc);
-
- if (this->type->qualifier.flags.q.invariant) {
- if ((state->target == vertex_shader) && !(var->mode == ir_var_out ||
- var->mode == ir_var_inout)) {
- /* FINISHME: Note that this doesn't work for invariant on
- * a function signature outval
- */
- _mesa_glsl_error(& loc, state,
- "`%s' cannot be marked invariant, vertex shader "
- "outputs only\n", var->name);
- } else if ((state->target == fragment_shader) &&
- !(var->mode == ir_var_in || var->mode == ir_var_inout)) {
- /* FINISHME: Note that this doesn't work for invariant on
- * a function signature inval
- */
- _mesa_glsl_error(& loc, state,
- "`%s' cannot be marked invariant, fragment shader "
- "inputs only\n", var->name);
- }
- }
-
- if (state->current_function != NULL) {
- const char *mode = NULL;
- const char *extra = "";
-
- /* There is no need to check for 'inout' here because the parser will
- * only allow that in function parameter lists.
- */
- if (this->type->qualifier.flags.q.attribute) {
- mode = "attribute";
- } else if (this->type->qualifier.flags.q.uniform) {
- mode = "uniform";
- } else if (this->type->qualifier.flags.q.varying) {
- mode = "varying";
- } else if (this->type->qualifier.flags.q.in) {
- mode = "in";
- extra = " or in function parameter list";
- } else if (this->type->qualifier.flags.q.out) {
- mode = "out";
- extra = " or in function parameter list";
- }
-
- if (mode) {
- _mesa_glsl_error(& loc, state,
- "%s variable `%s' must be declared at "
- "global scope%s",
- mode, var->name, extra);
- }
- } else if (var->mode == ir_var_in) {
- var->read_only = true;
-
- if (state->target == vertex_shader) {
- bool error_emitted = false;
-
- /* From page 31 (page 37 of the PDF) of the GLSL 1.50 spec:
- *
- * "Vertex shader inputs can only be float, floating-point
- * vectors, matrices, signed and unsigned integers and integer
- * vectors. Vertex shader inputs can also form arrays of these
- * types, but not structures."
- *
- * From page 31 (page 27 of the PDF) of the GLSL 1.30 spec:
- *
- * "Vertex shader inputs can only be float, floating-point
- * vectors, matrices, signed and unsigned integers and integer
- * vectors. They cannot be arrays or structures."
- *
- * From page 23 (page 29 of the PDF) of the GLSL 1.20 spec:
- *
- * "The attribute qualifier can be used only with float,
- * floating-point vectors, and matrices. Attribute variables
- * cannot be declared as arrays or structures."
- */
- const glsl_type *check_type = var->type->is_array()
- ? var->type->fields.array : var->type;
-
- switch (check_type->base_type) {
- case GLSL_TYPE_FLOAT:
- break;
- case GLSL_TYPE_UINT:
- case GLSL_TYPE_INT:
- if (state->language_version > 120)
- break;
- /* FALLTHROUGH */
- default:
- _mesa_glsl_error(& loc, state,
- "vertex shader input / attribute cannot have "
- "type %s`%s'",
- var->type->is_array() ? "array of " : "",
- check_type->name);
- error_emitted = true;
- }
-
- if (!error_emitted && (state->language_version <= 130)
- && var->type->is_array()) {
- _mesa_glsl_error(& loc, state,
- "vertex shader input / attribute cannot have "
- "array type");
- error_emitted = true;
- }
- }
- }
-
- /* Integer vertex outputs must be qualified with 'flat'.
- *
- * From section 4.3.6 of the GLSL 1.30 spec:
- * "If a vertex output is a signed or unsigned integer or integer
- * vector, then it must be qualified with the interpolation qualifier
- * flat."
- */
- if (state->language_version >= 130
- && state->target == vertex_shader
- && state->current_function == NULL
- && var->type->is_integer()
- && var->mode == ir_var_out
- && var->interpolation != ir_var_flat) {
-
- _mesa_glsl_error(&loc, state, "If a vertex output is an integer, "
- "then it must be qualified with 'flat'");
- }
-
-
- /* Interpolation qualifiers cannot be applied to 'centroid' and
- * 'centroid varying'.
- *
- * From page 29 (page 35 of the PDF) of the GLSL 1.30 spec:
- * "interpolation qualifiers may only precede the qualifiers in,
- * centroid in, out, or centroid out in a declaration. They do not apply
- * to the deprecated storage qualifiers varying or centroid varying."
- */
- if (state->language_version >= 130
- && this->type->qualifier.has_interpolation()
- && this->type->qualifier.flags.q.varying) {
-
- const char *i = this->type->qualifier.interpolation_string();
- assert(i != NULL);
- const char *s;
- if (this->type->qualifier.flags.q.centroid)
- s = "centroid varying";
- else
- s = "varying";
-
- _mesa_glsl_error(&loc, state,
- "qualifier '%s' cannot be applied to the "
- "deprecated storage qualifier '%s'", i, s);
- }
-
-
- /* Interpolation qualifiers can only apply to vertex shader outputs and
- * fragment shader inputs.
- *
- * From page 29 (page 35 of the PDF) of the GLSL 1.30 spec:
- * "Outputs from a vertex shader (out) and inputs to a fragment
- * shader (in) can be further qualified with one or more of these
- * interpolation qualifiers"
- */
- if (state->language_version >= 130
- && this->type->qualifier.has_interpolation()) {
-
- const char *i = this->type->qualifier.interpolation_string();
- assert(i != NULL);
-
- switch (state->target) {
- case vertex_shader:
- if (this->type->qualifier.flags.q.in) {
- _mesa_glsl_error(&loc, state,
- "qualifier '%s' cannot be applied to vertex "
- "shader inputs", i);
- }
- break;
- case fragment_shader:
- if (this->type->qualifier.flags.q.out) {
- _mesa_glsl_error(&loc, state,
- "qualifier '%s' cannot be applied to fragment "
- "shader outputs", i);
- }
- break;
- default:
- assert(0);
- }
- }
-
-
- /* From section 4.3.4 of the GLSL 1.30 spec:
- * "It is an error to use centroid in in a vertex shader."
- */
- if (state->language_version >= 130
- && this->type->qualifier.flags.q.centroid
- && this->type->qualifier.flags.q.in
- && state->target == vertex_shader) {
-
- _mesa_glsl_error(&loc, state,
- "'centroid in' cannot be used in a vertex shader");
- }
-
-
- /* Precision qualifiers exists only in GLSL versions 1.00 and >= 1.30.
- */
- if (this->type->specifier->precision != ast_precision_none
- && state->language_version != 100
- && state->language_version < 130) {
-
- _mesa_glsl_error(&loc, state,
- "precision qualifiers are supported only in GLSL ES "
- "1.00, and GLSL 1.30 and later");
- }
-
-
- /* Precision qualifiers only apply to floating point and integer types.
- *
- * From section 4.5.2 of the GLSL 1.30 spec:
- * "Any floating point or any integer declaration can have the type
- * preceded by one of these precision qualifiers [...] Literal
- * constants do not have precision qualifiers. Neither do Boolean
- * variables.
- *
- * In GLSL ES, sampler types are also allowed.
- *
- * From page 87 of the GLSL ES spec:
- * "RESOLUTION: Allow sampler types to take a precision qualifier."
- */
- if (this->type->specifier->precision != ast_precision_none
- && !var->type->is_float()
- && !var->type->is_integer()
- && !(var->type->is_sampler() && state->es_shader)
- && !(var->type->is_array()
- && (var->type->fields.array->is_float()
- || var->type->fields.array->is_integer()))) {
-
- _mesa_glsl_error(&loc, state,
- "precision qualifiers apply only to floating point"
- "%s types", state->es_shader ? ", integer, and sampler"
- : "and integer");
- }
-
- /* Process the initializer and add its instructions to a temporary
- * list. This list will be added to the instruction stream (below) after
- * the declaration is added. This is done because in some cases (such as
- * redeclarations) the declaration may not actually be added to the
- * instruction stream.
- */
- exec_list initializer_instructions;
- ir_variable *earlier = get_variable_being_redeclared(var, decl, state);
-
- if (decl->initializer != NULL) {
- result = process_initializer((earlier == NULL) ? var : earlier,
- decl, this->type,
- &initializer_instructions, state);
- }
-
- /* From page 23 (page 29 of the PDF) of the GLSL 1.10 spec:
- *
- * "It is an error to write to a const variable outside of
- * its declaration, so they must be initialized when
- * declared."
- */
- if (this->type->qualifier.flags.q.constant && decl->initializer == NULL) {
- _mesa_glsl_error(& loc, state,
- "const declaration of `%s' must be initialized",
- decl->identifier);
- }
-
- /* If the declaration is not a redeclaration, there are a few additional
- * semantic checks that must be applied. In addition, variable that was
- * created for the declaration should be added to the IR stream.
- */
- if (earlier == NULL) {
- /* From page 15 (page 21 of the PDF) of the GLSL 1.10 spec,
- *
- * "Identifiers starting with "gl_" are reserved for use by
- * OpenGL, and may not be declared in a shader as either a
- * variable or a function."
- */
- if (strncmp(decl->identifier, "gl_", 3) == 0)
- _mesa_glsl_error(& loc, state,
- "identifier `%s' uses reserved `gl_' prefix",
- decl->identifier);
-
- /* Add the variable to the symbol table. Note that the initializer's
- * IR was already processed earlier (though it hasn't been emitted
- * yet), without the variable in scope.
- *
- * This differs from most C-like languages, but it follows the GLSL
- * specification. From page 28 (page 34 of the PDF) of the GLSL 1.50
- * spec:
- *
- * "Within a declaration, the scope of a name starts immediately
- * after the initializer if present or immediately after the name
- * being declared if not."
- */
- if (!state->symbols->add_variable(var)) {
- YYLTYPE loc = this->get_location();
- _mesa_glsl_error(&loc, state, "name `%s' already taken in the "
- "current scope", decl->identifier);
- continue;
- }
-
- /* Push the variable declaration to the top. It means that all the
- * variable declarations will appear in a funny last-to-first order,
- * but otherwise we run into trouble if a function is prototyped, a
- * global var is decled, then the function is defined with usage of
- * the global var. See glslparsertest's CorrectModule.frag.
- */
- instructions->push_head(var);
- }
-
- instructions->append_list(&initializer_instructions);
- }
-
-
- /* Generally, variable declarations do not have r-values. However,
- * one is used for the declaration in
- *
- * while (bool b = some_condition()) {
- * ...
- * }
- *
- * so we return the rvalue from the last seen declaration here.
- */
- return result;
-}
-
-
-ir_rvalue *
-ast_parameter_declarator::hir(exec_list *instructions,
- struct _mesa_glsl_parse_state *state)
-{
- void *ctx = state;
- const struct glsl_type *type;
- const char *name = NULL;
- YYLTYPE loc = this->get_location();
-
- type = this->type->specifier->glsl_type(& name, state);
-
- if (type == NULL) {
- if (name != NULL) {
- _mesa_glsl_error(& loc, state,
- "invalid type `%s' in declaration of `%s'",
- name, this->identifier);
- } else {
- _mesa_glsl_error(& loc, state,
- "invalid type in declaration of `%s'",
- this->identifier);
- }
-
- type = glsl_type::error_type;
- }
-
- /* From page 62 (page 68 of the PDF) of the GLSL 1.50 spec:
- *
- * "Functions that accept no input arguments need not use void in the
- * argument list because prototypes (or definitions) are required and
- * therefore there is no ambiguity when an empty argument list "( )" is
- * declared. The idiom "(void)" as a parameter list is provided for
- * convenience."
- *
- * Placing this check here prevents a void parameter being set up
- * for a function, which avoids tripping up checks for main taking
- * parameters and lookups of an unnamed symbol.
- */
- if (type->is_void()) {
- if (this->identifier != NULL)
- _mesa_glsl_error(& loc, state,
- "named parameter cannot have type `void'");
-
- is_void = true;
- return NULL;
- }
-
- if (formal_parameter && (this->identifier == NULL)) {
- _mesa_glsl_error(& loc, state, "formal parameter lacks a name");
- return NULL;
- }
-
- /* This only handles "vec4 foo[..]". The earlier specifier->glsl_type(...)
- * call already handled the "vec4[..] foo" case.
- */
- if (this->is_array) {
- type = process_array_type(&loc, type, this->array_size, state);
- }
-
- if (type->array_size() == 0) {
- _mesa_glsl_error(&loc, state, "arrays passed as parameters must have "
- "a declared size.");
- type = glsl_type::error_type;
- }
-
- is_void = false;
- ir_variable *var = new(ctx) ir_variable(type, this->identifier, ir_var_in);
-
- /* Apply any specified qualifiers to the parameter declaration. Note that
- * for function parameters the default mode is 'in'.
- */
- apply_type_qualifier_to_variable(& this->type->qualifier, var, state, & loc);
-
- instructions->push_tail(var);
-
- /* Parameter declarations do not have r-values.
- */
- return NULL;
-}
-
-
-void
-ast_parameter_declarator::parameters_to_hir(exec_list *ast_parameters,
- bool formal,
- exec_list *ir_parameters,
- _mesa_glsl_parse_state *state)
-{
- ast_parameter_declarator *void_param = NULL;
- unsigned count = 0;
-
- foreach_list_typed (ast_parameter_declarator, param, link, ast_parameters) {
- param->formal_parameter = formal;
- param->hir(ir_parameters, state);
-
- if (param->is_void)
- void_param = param;
-
- count++;
- }
-
- if ((void_param != NULL) && (count > 1)) {
- YYLTYPE loc = void_param->get_location();
-
- _mesa_glsl_error(& loc, state,
- "`void' parameter must be only parameter");
- }
-}
-
-
-void
-emit_function(_mesa_glsl_parse_state *state, exec_list *instructions,
- ir_function *f)
-{
- /* Emit the new function header */
- if (state->current_function == NULL) {
- instructions->push_tail(f);
- } else {
- /* IR invariants disallow function declarations or definitions nested
- * within other function definitions. Insert the new ir_function
- * block in the instruction sequence before the ir_function block
- * containing the current ir_function_signature.
- */
- ir_function *const curr =
- const_cast<ir_function *>(state->current_function->function());
-
- curr->insert_before(f);
- }
-}
-
-
-ir_rvalue *
-ast_function::hir(exec_list *instructions,
- struct _mesa_glsl_parse_state *state)
-{
- void *ctx = state;
- ir_function *f = NULL;
- ir_function_signature *sig = NULL;
- exec_list hir_parameters;
-
- const char *const name = identifier;
-
- /* From page 21 (page 27 of the PDF) of the GLSL 1.20 spec,
- *
- * "Function declarations (prototypes) cannot occur inside of functions;
- * they must be at global scope, or for the built-in functions, outside
- * the global scope."
- *
- * From page 27 (page 33 of the PDF) of the GLSL ES 1.00.16 spec,
- *
- * "User defined functions may only be defined within the global scope."
- *
- * Note that this language does not appear in GLSL 1.10.
- */
- if ((state->current_function != NULL) && (state->language_version != 110)) {
- YYLTYPE loc = this->get_location();
- _mesa_glsl_error(&loc, state,
- "declaration of function `%s' not allowed within "
- "function body", name);
- }
-
- /* From page 15 (page 21 of the PDF) of the GLSL 1.10 spec,
- *
- * "Identifiers starting with "gl_" are reserved for use by
- * OpenGL, and may not be declared in a shader as either a
- * variable or a function."
- */
- if (strncmp(name, "gl_", 3) == 0) {
- YYLTYPE loc = this->get_location();
- _mesa_glsl_error(&loc, state,
- "identifier `%s' uses reserved `gl_' prefix", name);
- }
-
- /* Convert the list of function parameters to HIR now so that they can be
- * used below to compare this function's signature with previously seen
- * signatures for functions with the same name.
- */
- ast_parameter_declarator::parameters_to_hir(& this->parameters,
- is_definition,
- & hir_parameters, state);
-
- const char *return_type_name;
- const glsl_type *return_type =
- this->return_type->specifier->glsl_type(& return_type_name, state);
-
- if (!return_type) {
- YYLTYPE loc = this->get_location();
- _mesa_glsl_error(&loc, state,
- "function `%s' has undeclared return type `%s'",
- name, return_type_name);
- return_type = glsl_type::error_type;
- }
-
- /* From page 56 (page 62 of the PDF) of the GLSL 1.30 spec:
- * "No qualifier is allowed on the return type of a function."
- */
- if (this->return_type->has_qualifiers()) {
- YYLTYPE loc = this->get_location();
- _mesa_glsl_error(& loc, state,
- "function `%s' return type has qualifiers", name);
- }
-
- /* Verify that this function's signature either doesn't match a previously
- * seen signature for a function with the same name, or, if a match is found,
- * that the previously seen signature does not have an associated definition.
- */
- f = state->symbols->get_function(name);
- if (f != NULL && (state->es_shader || f->has_user_signature())) {
- sig = f->exact_matching_signature(&hir_parameters);
- if (sig != NULL) {
- const char *badvar = sig->qualifiers_match(&hir_parameters);
- if (badvar != NULL) {
- YYLTYPE loc = this->get_location();
-
- _mesa_glsl_error(&loc, state, "function `%s' parameter `%s' "
- "qualifiers don't match prototype", name, badvar);
- }
-
- if (sig->return_type != return_type) {
- YYLTYPE loc = this->get_location();
-
- _mesa_glsl_error(&loc, state, "function `%s' return type doesn't "
- "match prototype", name);
- }
-
- if (is_definition && sig->is_defined) {
- YYLTYPE loc = this->get_location();
-
- _mesa_glsl_error(& loc, state, "function `%s' redefined", name);
- }
- }
- } else {
- f = new(ctx) ir_function(name);
- if (!state->symbols->add_function(f)) {
- /* This function name shadows a non-function use of the same name. */
- YYLTYPE loc = this->get_location();
-
- _mesa_glsl_error(&loc, state, "function name `%s' conflicts with "
- "non-function", name);
- return NULL;
- }
-
- emit_function(state, instructions, f);
- }
-
- /* Verify the return type of main() */
- if (strcmp(name, "main") == 0) {
- if (! return_type->is_void()) {
- YYLTYPE loc = this->get_location();
-
- _mesa_glsl_error(& loc, state, "main() must return void");
- }
-
- if (!hir_parameters.is_empty()) {
- YYLTYPE loc = this->get_location();
-
- _mesa_glsl_error(& loc, state, "main() must not take any parameters");
- }
- }
-
- /* Finish storing the information about this new function in its signature.
- */
- if (sig == NULL) {
- sig = new(ctx) ir_function_signature(return_type);
- f->add_signature(sig);
- }
-
- sig->replace_parameters(&hir_parameters);
- signature = sig;
-
- /* Function declarations (prototypes) do not have r-values.
- */
- return NULL;
-}
-
-
-ir_rvalue *
-ast_function_definition::hir(exec_list *instructions,
- struct _mesa_glsl_parse_state *state)
-{
- prototype->is_definition = true;
- prototype->hir(instructions, state);
-
- ir_function_signature *signature = prototype->signature;
- if (signature == NULL)
- return NULL;
-
- assert(state->current_function == NULL);
- state->current_function = signature;
- state->found_return = false;
-
- /* Duplicate parameters declared in the prototype as concrete variables.
- * Add these to the symbol table.
- */
- state->symbols->push_scope();
- foreach_iter(exec_list_iterator, iter, signature->parameters) {
- ir_variable *const var = ((ir_instruction *) iter.get())->as_variable();
-
- assert(var != NULL);
-
- /* The only way a parameter would "exist" is if two parameters have
- * the same name.
- */
- if (state->symbols->name_declared_this_scope(var->name)) {
- YYLTYPE loc = this->get_location();
-
- _mesa_glsl_error(& loc, state, "parameter `%s' redeclared", var->name);
- } else {
- state->symbols->add_variable(var);
- }
- }
-
- /* Convert the body of the function to HIR. */
- this->body->hir(&signature->body, state);
- signature->is_defined = true;
-
- state->symbols->pop_scope();
-
- assert(state->current_function == signature);
- state->current_function = NULL;
-
- if (!signature->return_type->is_void() && !state->found_return) {
- YYLTYPE loc = this->get_location();
- _mesa_glsl_error(& loc, state, "function `%s' has non-void return type "
- "%s, but no return statement",
- signature->function_name(),
- signature->return_type->name);
- }
-
- /* Function definitions do not have r-values.
- */
- return NULL;
-}
-
-
-ir_rvalue *
-ast_jump_statement::hir(exec_list *instructions,
- struct _mesa_glsl_parse_state *state)
-{
- void *ctx = state;
-
- switch (mode) {
- case ast_return: {
- ir_return *inst;
- assert(state->current_function);
-
- if (opt_return_value) {
- ir_rvalue *const ret = opt_return_value->hir(instructions, state);
-
- /* The value of the return type can be NULL if the shader says
- * 'return foo();' and foo() is a function that returns void.
- *
- * NOTE: The GLSL spec doesn't say that this is an error. The type
- * of the return value is void. If the return type of the function is
- * also void, then this should compile without error. Seriously.
- */
- const glsl_type *const ret_type =
- (ret == NULL) ? glsl_type::void_type : ret->type;
-
- /* Implicit conversions are not allowed for return values. */
- if (state->current_function->return_type != ret_type) {
- YYLTYPE loc = this->get_location();
-
- _mesa_glsl_error(& loc, state,
- "`return' with wrong type %s, in function `%s' "
- "returning %s",
- ret_type->name,
- state->current_function->function_name(),
- state->current_function->return_type->name);
- }
-
- inst = new(ctx) ir_return(ret);
- } else {
- if (state->current_function->return_type->base_type !=
- GLSL_TYPE_VOID) {
- YYLTYPE loc = this->get_location();
-
- _mesa_glsl_error(& loc, state,
- "`return' with no value, in function %s returning "
- "non-void",
- state->current_function->function_name());
- }
- inst = new(ctx) ir_return;
- }
-
- state->found_return = true;
- instructions->push_tail(inst);
- break;
- }
-
- case ast_discard:
- if (state->target != fragment_shader) {
- YYLTYPE loc = this->get_location();
-
- _mesa_glsl_error(& loc, state,
- "`discard' may only appear in a fragment shader");
- }
- instructions->push_tail(new(ctx) ir_discard);
- break;
-
- case ast_break:
- case ast_continue:
- /* FINISHME: Handle switch-statements. They cannot contain 'continue',
- * FINISHME: and they use a different IR instruction for 'break'.
- */
- /* FINISHME: Correctly handle the nesting. If a switch-statement is
- * FINISHME: inside a loop, a 'continue' is valid and will bind to the
- * FINISHME: loop.
- */
- if (state->loop_or_switch_nesting == NULL) {
- YYLTYPE loc = this->get_location();
-
- _mesa_glsl_error(& loc, state,
- "`%s' may only appear in a loop",
- (mode == ast_break) ? "break" : "continue");
- } else {
- ir_loop *const loop = state->loop_or_switch_nesting->as_loop();
-
- /* Inline the for loop expression again, since we don't know
- * where near the end of the loop body the normal copy of it
- * is going to be placed.
- */
- if (mode == ast_continue &&
- state->loop_or_switch_nesting_ast->rest_expression) {
- state->loop_or_switch_nesting_ast->rest_expression->hir(instructions,
- state);
- }
-
- if (loop != NULL) {
- ir_loop_jump *const jump =
- new(ctx) ir_loop_jump((mode == ast_break)
- ? ir_loop_jump::jump_break
- : ir_loop_jump::jump_continue);
- instructions->push_tail(jump);
- }
- }
-
- break;
- }
-
- /* Jump instructions do not have r-values.
- */
- return NULL;
-}
-
-
-ir_rvalue *
-ast_selection_statement::hir(exec_list *instructions,
- struct _mesa_glsl_parse_state *state)
-{
- void *ctx = state;
-
- ir_rvalue *const condition = this->condition->hir(instructions, state);
-
- /* From page 66 (page 72 of the PDF) of the GLSL 1.50 spec:
- *
- * "Any expression whose type evaluates to a Boolean can be used as the
- * conditional expression bool-expression. Vector types are not accepted
- * as the expression to if."
- *
- * The checks are separated so that higher quality diagnostics can be
- * generated for cases where both rules are violated.
- */
- if (!condition->type->is_boolean() || !condition->type->is_scalar()) {
- YYLTYPE loc = this->condition->get_location();
-
- _mesa_glsl_error(& loc, state, "if-statement condition must be scalar "
- "boolean");
- }
-
- ir_if *const stmt = new(ctx) ir_if(condition);
-
- if (then_statement != NULL) {
- state->symbols->push_scope();
- then_statement->hir(& stmt->then_instructions, state);
- state->symbols->pop_scope();
- }
-
- if (else_statement != NULL) {
- state->symbols->push_scope();
- else_statement->hir(& stmt->else_instructions, state);
- state->symbols->pop_scope();
- }
-
- instructions->push_tail(stmt);
-
- /* if-statements do not have r-values.
- */
- return NULL;
-}
-
-
-void
-ast_iteration_statement::condition_to_hir(ir_loop *stmt,
- struct _mesa_glsl_parse_state *state)
-{
- void *ctx = state;
-
- if (condition != NULL) {
- ir_rvalue *const cond =
- condition->hir(& stmt->body_instructions, state);
-
- if ((cond == NULL)
- || !cond->type->is_boolean() || !cond->type->is_scalar()) {
- YYLTYPE loc = condition->get_location();
-
- _mesa_glsl_error(& loc, state,
- "loop condition must be scalar boolean");
- } else {
- /* As the first code in the loop body, generate a block that looks
- * like 'if (!condition) break;' as the loop termination condition.
- */
- ir_rvalue *const not_cond =
- new(ctx) ir_expression(ir_unop_logic_not, glsl_type::bool_type, cond,
- NULL);
-
- ir_if *const if_stmt = new(ctx) ir_if(not_cond);
-
- ir_jump *const break_stmt =
- new(ctx) ir_loop_jump(ir_loop_jump::jump_break);
-
- if_stmt->then_instructions.push_tail(break_stmt);
- stmt->body_instructions.push_tail(if_stmt);
- }
- }
-}
-
-
-ir_rvalue *
-ast_iteration_statement::hir(exec_list *instructions,
- struct _mesa_glsl_parse_state *state)
-{
- void *ctx = state;
-
- /* For-loops and while-loops start a new scope, but do-while loops do not.
- */
- if (mode != ast_do_while)
- state->symbols->push_scope();
-
- if (init_statement != NULL)
- init_statement->hir(instructions, state);
-
- ir_loop *const stmt = new(ctx) ir_loop();
- instructions->push_tail(stmt);
-
- /* Track the current loop and / or switch-statement nesting.
- */
- ir_instruction *const nesting = state->loop_or_switch_nesting;
- ast_iteration_statement *nesting_ast = state->loop_or_switch_nesting_ast;
-
- state->loop_or_switch_nesting = stmt;
- state->loop_or_switch_nesting_ast = this;
-
- if (mode != ast_do_while)
- condition_to_hir(stmt, state);
-
- if (body != NULL)
- body->hir(& stmt->body_instructions, state);
-
- if (rest_expression != NULL)
- rest_expression->hir(& stmt->body_instructions, state);
-
- if (mode == ast_do_while)
- condition_to_hir(stmt, state);
-
- if (mode != ast_do_while)
- state->symbols->pop_scope();
-
- /* Restore previous nesting before returning.
- */
- state->loop_or_switch_nesting = nesting;
- state->loop_or_switch_nesting_ast = nesting_ast;
-
- /* Loops do not have r-values.
- */
- return NULL;
-}
-
-
-ir_rvalue *
-ast_type_specifier::hir(exec_list *instructions,
- struct _mesa_glsl_parse_state *state)
-{
- if (!this->is_precision_statement && this->structure == NULL)
- return NULL;
-
- YYLTYPE loc = this->get_location();
-
- if (this->precision != ast_precision_none
- && state->language_version != 100
- && state->language_version < 130) {
- _mesa_glsl_error(&loc, state,
- "precision qualifiers exist only in "
- "GLSL ES 1.00, and GLSL 1.30 and later");
- return NULL;
- }
- if (this->precision != ast_precision_none
- && this->structure != NULL) {
- _mesa_glsl_error(&loc, state,
- "precision qualifiers do not apply to structures");
- return NULL;
- }
-
- /* If this is a precision statement, check that the type to which it is
- * applied is either float or int.
- *
- * From section 4.5.3 of the GLSL 1.30 spec:
- * "The precision statement
- * precision precision-qualifier type;
- * can be used to establish a default precision qualifier. The type
- * field can be either int or float [...]. Any other types or
- * qualifiers will result in an error.
- */
- if (this->is_precision_statement) {
- assert(this->precision != ast_precision_none);
- assert(this->structure == NULL); /* The check for structures was
- * performed above. */
- if (this->is_array) {
- _mesa_glsl_error(&loc, state,
- "default precision statements do not apply to "
- "arrays");
- return NULL;
- }
- if (this->type_specifier != ast_float
- && this->type_specifier != ast_int) {
- _mesa_glsl_error(&loc, state,
- "default precision statements apply only to types "
- "float and int");
- return NULL;
- }
-
- /* FINISHME: Translate precision statements into IR. */
- return NULL;
- }
-
- if (this->structure != NULL)
- return this->structure->hir(instructions, state);
-
- return NULL;
-}
-
-
-ir_rvalue *
-ast_struct_specifier::hir(exec_list *instructions,
- struct _mesa_glsl_parse_state *state)
-{
- unsigned decl_count = 0;
-
- /* Make an initial pass over the list of structure fields to determine how
- * many there are. Each element in this list is an ast_declarator_list.
- * This means that we actually need to count the number of elements in the
- * 'declarations' list in each of the elements.
- */
- foreach_list_typed (ast_declarator_list, decl_list, link,
- &this->declarations) {
- foreach_list_const (decl_ptr, & decl_list->declarations) {
- decl_count++;
- }
- }
-
- /* Allocate storage for the structure fields and process the field
- * declarations. As the declarations are processed, try to also convert
- * the types to HIR. This ensures that structure definitions embedded in
- * other structure definitions are processed.
- */
- glsl_struct_field *const fields = ralloc_array(state, glsl_struct_field,
- decl_count);
-
- unsigned i = 0;
- foreach_list_typed (ast_declarator_list, decl_list, link,
- &this->declarations) {
- const char *type_name;
-
- decl_list->type->specifier->hir(instructions, state);
-
- /* Section 10.9 of the GLSL ES 1.00 specification states that
- * embedded structure definitions have been removed from the language.
- */
- if (state->es_shader && decl_list->type->specifier->structure != NULL) {
- YYLTYPE loc = this->get_location();
- _mesa_glsl_error(&loc, state, "Embedded structure definitions are "
- "not allowed in GLSL ES 1.00.");
- }
-
- const glsl_type *decl_type =
- decl_list->type->specifier->glsl_type(& type_name, state);
-
- foreach_list_typed (ast_declaration, decl, link,
- &decl_list->declarations) {
- const struct glsl_type *field_type = decl_type;
- if (decl->is_array) {
- YYLTYPE loc = decl->get_location();
- field_type = process_array_type(&loc, decl_type, decl->array_size,
- state);
- }
- fields[i].type = (field_type != NULL)
- ? field_type : glsl_type::error_type;
- fields[i].name = decl->identifier;
- i++;
- }
- }
-
- assert(i == decl_count);
-
- const glsl_type *t =
- glsl_type::get_record_instance(fields, decl_count, this->name);
-
- YYLTYPE loc = this->get_location();
- if (!state->symbols->add_type(name, t)) {
- _mesa_glsl_error(& loc, state, "struct `%s' previously defined", name);
- } else {
- const glsl_type **s = reralloc(state, state->user_structures,
- const glsl_type *,
- state->num_user_structures + 1);
- if (s != NULL) {
- s[state->num_user_structures] = t;
- state->user_structures = s;
- state->num_user_structures++;
- }
- }
-
- /* Structure type definitions do not have r-values.
- */
- return NULL;
-}
+/*
+ * Copyright © 2010 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+/**
+ * \file ast_to_hir.c
+ * Convert abstract syntax to to high-level intermediate reprensentation (HIR).
+ *
+ * During the conversion to HIR, the majority of the symantic checking is
+ * preformed on the program. This includes:
+ *
+ * * Symbol table management
+ * * Type checking
+ * * Function binding
+ *
+ * The majority of this work could be done during parsing, and the parser could
+ * probably generate HIR directly. However, this results in frequent changes
+ * to the parser code. Since we do not assume that every system this complier
+ * is built on will have Flex and Bison installed, we have to store the code
+ * generated by these tools in our version control system. In other parts of
+ * the system we've seen problems where a parser was changed but the generated
+ * code was not committed, merge conflicts where created because two developers
+ * had slightly different versions of Bison installed, etc.
+ *
+ * I have also noticed that running Bison generated parsers in GDB is very
+ * irritating. When you get a segfault on '$$ = $1->foo', you can't very
+ * well 'print $1' in GDB.
+ *
+ * As a result, my preference is to put as little C code as possible in the
+ * parser (and lexer) sources.
+ */
+
+#include "main/core.h" /* for struct gl_extensions */
+#include "glsl_symbol_table.h"
+#include "glsl_parser_extras.h"
+#include "ast.h"
+#include "glsl_types.h"
+#include "ir.h"
+
+void
+_mesa_ast_to_hir(exec_list *instructions, struct _mesa_glsl_parse_state *state)
+{
+ _mesa_glsl_initialize_variables(instructions, state);
+ _mesa_glsl_initialize_functions(state);
+
+ state->symbols->language_version = state->language_version;
+
+ state->current_function = NULL;
+
+ /* Section 4.2 of the GLSL 1.20 specification states:
+ * "The built-in functions are scoped in a scope outside the global scope
+ * users declare global variables in. That is, a shader's global scope,
+ * available for user-defined functions and global variables, is nested
+ * inside the scope containing the built-in functions."
+ *
+ * Since built-in functions like ftransform() access built-in variables,
+ * it follows that those must be in the outer scope as well.
+ *
+ * We push scope here to create this nesting effect...but don't pop.
+ * This way, a shader's globals are still in the symbol table for use
+ * by the linker.
+ */
+ state->symbols->push_scope();
+
+ foreach_list_typed (ast_node, ast, link, & state->translation_unit)
+ ast->hir(instructions, state);
+}
+
+
+/**
+ * If a conversion is available, convert one operand to a different type
+ *
+ * The \c from \c ir_rvalue is converted "in place".
+ *
+ * \param to Type that the operand it to be converted to
+ * \param from Operand that is being converted
+ * \param state GLSL compiler state
+ *
+ * \return
+ * If a conversion is possible (or unnecessary), \c true is returned.
+ * Otherwise \c false is returned.
+ */
+bool
+apply_implicit_conversion(const glsl_type *to, ir_rvalue * &from,
+ struct _mesa_glsl_parse_state *state)
+{
+ void *ctx = state;
+ if (to->base_type == from->type->base_type)
+ return true;
+
+ /* This conversion was added in GLSL 1.20. If the compilation mode is
+ * GLSL 1.10, the conversion is skipped.
+ */
+ if (state->language_version < 120)
+ return false;
+
+ /* From page 27 (page 33 of the PDF) of the GLSL 1.50 spec:
+ *
+ * "There are no implicit array or structure conversions. For
+ * example, an array of int cannot be implicitly converted to an
+ * array of float. There are no implicit conversions between
+ * signed and unsigned integers."
+ */
+ /* FINISHME: The above comment is partially a lie. There is int/uint
+ * FINISHME: conversion for immediate constants.
+ */
+ if (!to->is_float() || !from->type->is_numeric())
+ return false;
+
+ /* Convert to a floating point type with the same number of components
+ * as the original type - i.e. int to float, not int to vec4.
+ */
+ to = glsl_type::get_instance(GLSL_TYPE_FLOAT, from->type->vector_elements,
+ from->type->matrix_columns);
+
+ switch (from->type->base_type) {
+ case GLSL_TYPE_INT:
+ from = new(ctx) ir_expression(ir_unop_i2f, to, from, NULL);
+ break;
+ case GLSL_TYPE_UINT:
+ from = new(ctx) ir_expression(ir_unop_u2f, to, from, NULL);
+ break;
+ case GLSL_TYPE_BOOL:
+ from = new(ctx) ir_expression(ir_unop_b2f, to, from, NULL);
+ break;
+ default:
+ assert(0);
+ }
+
+ return true;
+}
+
+
+static const struct glsl_type *
+arithmetic_result_type(ir_rvalue * &value_a, ir_rvalue * &value_b,
+ bool multiply,
+ struct _mesa_glsl_parse_state *state, YYLTYPE *loc)
+{
+ const glsl_type *type_a = value_a->type;
+ const glsl_type *type_b = value_b->type;
+
+ /* From GLSL 1.50 spec, page 56:
+ *
+ * "The arithmetic binary operators add (+), subtract (-),
+ * multiply (*), and divide (/) operate on integer and
+ * floating-point scalars, vectors, and matrices."
+ */
+ if (!type_a->is_numeric() || !type_b->is_numeric()) {
+ _mesa_glsl_error(loc, state,
+ "Operands to arithmetic operators must be numeric");
+ return glsl_type::error_type;
+ }
+
+
+ /* "If one operand is floating-point based and the other is
+ * not, then the conversions from Section 4.1.10 "Implicit
+ * Conversions" are applied to the non-floating-point-based operand."
+ */
+ if (!apply_implicit_conversion(type_a, value_b, state)
+ && !apply_implicit_conversion(type_b, value_a, state)) {
+ _mesa_glsl_error(loc, state,
+ "Could not implicitly convert operands to "
+ "arithmetic operator");
+ return glsl_type::error_type;
+ }
+ type_a = value_a->type;
+ type_b = value_b->type;
+
+ /* "If the operands are integer types, they must both be signed or
+ * both be unsigned."
+ *
+ * From this rule and the preceeding conversion it can be inferred that
+ * both types must be GLSL_TYPE_FLOAT, or GLSL_TYPE_UINT, or GLSL_TYPE_INT.
+ * The is_numeric check above already filtered out the case where either
+ * type is not one of these, so now the base types need only be tested for
+ * equality.
+ */
+ if (type_a->base_type != type_b->base_type) {
+ _mesa_glsl_error(loc, state,
+ "base type mismatch for arithmetic operator");
+ return glsl_type::error_type;
+ }
+
+ /* "All arithmetic binary operators result in the same fundamental type
+ * (signed integer, unsigned integer, or floating-point) as the
+ * operands they operate on, after operand type conversion. After
+ * conversion, the following cases are valid
+ *
+ * * The two operands are scalars. In this case the operation is
+ * applied, resulting in a scalar."
+ */
+ if (type_a->is_scalar() && type_b->is_scalar())
+ return type_a;
+
+ /* "* One operand is a scalar, and the other is a vector or matrix.
+ * In this case, the scalar operation is applied independently to each
+ * component of the vector or matrix, resulting in the same size
+ * vector or matrix."
+ */
+ if (type_a->is_scalar()) {
+ if (!type_b->is_scalar())
+ return type_b;
+ } else if (type_b->is_scalar()) {
+ return type_a;
+ }
+
+ /* All of the combinations of <scalar, scalar>, <vector, scalar>,
+ * <scalar, vector>, <scalar, matrix>, and <matrix, scalar> have been
+ * handled.
+ */
+ assert(!type_a->is_scalar());
+ assert(!type_b->is_scalar());
+
+ /* "* The two operands are vectors of the same size. In this case, the
+ * operation is done component-wise resulting in the same size
+ * vector."
+ */
+ if (type_a->is_vector() && type_b->is_vector()) {
+ if (type_a == type_b) {
+ return type_a;
+ } else {
+ _mesa_glsl_error(loc, state,
+ "vector size mismatch for arithmetic operator");
+ return glsl_type::error_type;
+ }
+ }
+
+ /* All of the combinations of <scalar, scalar>, <vector, scalar>,
+ * <scalar, vector>, <scalar, matrix>, <matrix, scalar>, and
+ * <vector, vector> have been handled. At least one of the operands must
+ * be matrix. Further, since there are no integer matrix types, the base
+ * type of both operands must be float.
+ */
+ assert(type_a->is_matrix() || type_b->is_matrix());
+ assert(type_a->base_type == GLSL_TYPE_FLOAT);
+ assert(type_b->base_type == GLSL_TYPE_FLOAT);
+
+ /* "* The operator is add (+), subtract (-), or divide (/), and the
+ * operands are matrices with the same number of rows and the same
+ * number of columns. In this case, the operation is done component-
+ * wise resulting in the same size matrix."
+ * * The operator is multiply (*), where both operands are matrices or
+ * one operand is a vector and the other a matrix. A right vector
+ * operand is treated as a column vector and a left vector operand as a
+ * row vector. In all these cases, it is required that the number of
+ * columns of the left operand is equal to the number of rows of the
+ * right operand. Then, the multiply (*) operation does a linear
+ * algebraic multiply, yielding an object that has the same number of
+ * rows as the left operand and the same number of columns as the right
+ * operand. Section 5.10 "Vector and Matrix Operations" explains in
+ * more detail how vectors and matrices are operated on."
+ */
+ if (! multiply) {
+ if (type_a == type_b)
+ return type_a;
+ } else {
+ if (type_a->is_matrix() && type_b->is_matrix()) {
+ /* Matrix multiply. The columns of A must match the rows of B. Given
+ * the other previously tested constraints, this means the vector type
+ * of a row from A must be the same as the vector type of a column from
+ * B.
+ */
+ if (type_a->row_type() == type_b->column_type()) {
+ /* The resulting matrix has the number of columns of matrix B and
+ * the number of rows of matrix A. We get the row count of A by
+ * looking at the size of a vector that makes up a column. The
+ * transpose (size of a row) is done for B.
+ */
+ const glsl_type *const type =
+ glsl_type::get_instance(type_a->base_type,
+ type_a->column_type()->vector_elements,
+ type_b->row_type()->vector_elements);
+ assert(type != glsl_type::error_type);
+
+ return type;
+ }
+ } else if (type_a->is_matrix()) {
+ /* A is a matrix and B is a column vector. Columns of A must match
+ * rows of B. Given the other previously tested constraints, this
+ * means the vector type of a row from A must be the same as the
+ * vector the type of B.
+ */
+ if (type_a->row_type() == type_b) {
+ /* The resulting vector has a number of elements equal to
+ * the number of rows of matrix A. */
+ const glsl_type *const type =
+ glsl_type::get_instance(type_a->base_type,
+ type_a->column_type()->vector_elements,
+ 1);
+ assert(type != glsl_type::error_type);
+
+ return type;
+ }
+ } else {
+ assert(type_b->is_matrix());
+
+ /* A is a row vector and B is a matrix. Columns of A must match rows
+ * of B. Given the other previously tested constraints, this means
+ * the type of A must be the same as the vector type of a column from
+ * B.
+ */
+ if (type_a == type_b->column_type()) {
+ /* The resulting vector has a number of elements equal to
+ * the number of columns of matrix B. */
+ const glsl_type *const type =
+ glsl_type::get_instance(type_a->base_type,
+ type_b->row_type()->vector_elements,
+ 1);
+ assert(type != glsl_type::error_type);
+
+ return type;
+ }
+ }
+
+ _mesa_glsl_error(loc, state, "size mismatch for matrix multiplication");
+ return glsl_type::error_type;
+ }
+
+
+ /* "All other cases are illegal."
+ */
+ _mesa_glsl_error(loc, state, "type mismatch");
+ return glsl_type::error_type;
+}
+
+
+static const struct glsl_type *
+unary_arithmetic_result_type(const struct glsl_type *type,
+ struct _mesa_glsl_parse_state *state, YYLTYPE *loc)
+{
+ /* From GLSL 1.50 spec, page 57:
+ *
+ * "The arithmetic unary operators negate (-), post- and pre-increment
+ * and decrement (-- and ++) operate on integer or floating-point
+ * values (including vectors and matrices). All unary operators work
+ * component-wise on their operands. These result with the same type
+ * they operated on."
+ */
+ if (!type->is_numeric()) {
+ _mesa_glsl_error(loc, state,
+ "Operands to arithmetic operators must be numeric");
+ return glsl_type::error_type;
+ }
+
+ return type;
+}
+
+/**
+ * \brief Return the result type of a bit-logic operation.
+ *
+ * If the given types to the bit-logic operator are invalid, return
+ * glsl_type::error_type.
+ *
+ * \param type_a Type of LHS of bit-logic op
+ * \param type_b Type of RHS of bit-logic op
+ */
+static const struct glsl_type *
+bit_logic_result_type(const struct glsl_type *type_a,
+ const struct glsl_type *type_b,
+ ast_operators op,
+ struct _mesa_glsl_parse_state *state, YYLTYPE *loc)
+{
+ if (state->language_version < 130) {
+ _mesa_glsl_error(loc, state, "bit operations require GLSL 1.30");
+ return glsl_type::error_type;
+ }
+
+ /* From page 50 (page 56 of PDF) of GLSL 1.30 spec:
+ *
+ * "The bitwise operators and (&), exclusive-or (^), and inclusive-or
+ * (|). The operands must be of type signed or unsigned integers or
+ * integer vectors."
+ */
+ if (!type_a->is_integer()) {
+ _mesa_glsl_error(loc, state, "LHS of `%s' must be an integer",
+ ast_expression::operator_string(op));
+ return glsl_type::error_type;
+ }
+ if (!type_b->is_integer()) {
+ _mesa_glsl_error(loc, state, "RHS of `%s' must be an integer",
+ ast_expression::operator_string(op));
+ return glsl_type::error_type;
+ }
+
+ /* "The fundamental types of the operands (signed or unsigned) must
+ * match,"
+ */
+ if (type_a->base_type != type_b->base_type) {
+ _mesa_glsl_error(loc, state, "operands of `%s' must have the same "
+ "base type", ast_expression::operator_string(op));
+ return glsl_type::error_type;
+ }
+
+ /* "The operands cannot be vectors of differing size." */
+ if (type_a->is_vector() &&
+ type_b->is_vector() &&
+ type_a->vector_elements != type_b->vector_elements) {
+ _mesa_glsl_error(loc, state, "operands of `%s' cannot be vectors of "
+ "different sizes", ast_expression::operator_string(op));
+ return glsl_type::error_type;
+ }
+
+ /* "If one operand is a scalar and the other a vector, the scalar is
+ * applied component-wise to the vector, resulting in the same type as
+ * the vector. The fundamental types of the operands [...] will be the
+ * resulting fundamental type."
+ */
+ if (type_a->is_scalar())
+ return type_b;
+ else
+ return type_a;
+}
+
+static const struct glsl_type *
+modulus_result_type(const struct glsl_type *type_a,
+ const struct glsl_type *type_b,
+ struct _mesa_glsl_parse_state *state, YYLTYPE *loc)
+{
+ if (state->language_version < 130) {
+ _mesa_glsl_error(loc, state,
+ "operator '%%' is reserved in %s",
+ state->version_string);
+ return glsl_type::error_type;
+ }
+
+ /* From GLSL 1.50 spec, page 56:
+ * "The operator modulus (%) operates on signed or unsigned integers or
+ * integer vectors. The operand types must both be signed or both be
+ * unsigned."
+ */
+ if (!type_a->is_integer() || !type_b->is_integer()
+ || (type_a->base_type != type_b->base_type)) {
+ _mesa_glsl_error(loc, state, "type mismatch");
+ return glsl_type::error_type;
+ }
+
+ /* "The operands cannot be vectors of differing size. If one operand is
+ * a scalar and the other vector, then the scalar is applied component-
+ * wise to the vector, resulting in the same type as the vector. If both
+ * are vectors of the same size, the result is computed component-wise."
+ */
+ if (type_a->is_vector()) {
+ if (!type_b->is_vector()
+ || (type_a->vector_elements == type_b->vector_elements))
+ return type_a;
+ } else
+ return type_b;
+
+ /* "The operator modulus (%) is not defined for any other data types
+ * (non-integer types)."
+ */
+ _mesa_glsl_error(loc, state, "type mismatch");
+ return glsl_type::error_type;
+}
+
+
+static const struct glsl_type *
+relational_result_type(ir_rvalue * &value_a, ir_rvalue * &value_b,
+ struct _mesa_glsl_parse_state *state, YYLTYPE *loc)
+{
+ const glsl_type *type_a = value_a->type;
+ const glsl_type *type_b = value_b->type;
+
+ /* From GLSL 1.50 spec, page 56:
+ * "The relational operators greater than (>), less than (<), greater
+ * than or equal (>=), and less than or equal (<=) operate only on
+ * scalar integer and scalar floating-point expressions."
+ */
+ if (!type_a->is_numeric()
+ || !type_b->is_numeric()
+ || !type_a->is_scalar()
+ || !type_b->is_scalar()) {
+ _mesa_glsl_error(loc, state,
+ "Operands to relational operators must be scalar and "
+ "numeric");
+ return glsl_type::error_type;
+ }
+
+ /* "Either the operands' types must match, or the conversions from
+ * Section 4.1.10 "Implicit Conversions" will be applied to the integer
+ * operand, after which the types must match."
+ */
+ if (!apply_implicit_conversion(type_a, value_b, state)
+ && !apply_implicit_conversion(type_b, value_a, state)) {
+ _mesa_glsl_error(loc, state,
+ "Could not implicitly convert operands to "
+ "relational operator");
+ return glsl_type::error_type;
+ }
+ type_a = value_a->type;
+ type_b = value_b->type;
+
+ if (type_a->base_type != type_b->base_type) {
+ _mesa_glsl_error(loc, state, "base type mismatch");
+ return glsl_type::error_type;
+ }
+
+ /* "The result is scalar Boolean."
+ */
+ return glsl_type::bool_type;
+}
+
+/**
+ * \brief Return the result type of a bit-shift operation.
+ *
+ * If the given types to the bit-shift operator are invalid, return
+ * glsl_type::error_type.
+ *
+ * \param type_a Type of LHS of bit-shift op
+ * \param type_b Type of RHS of bit-shift op
+ */
+static const struct glsl_type *
+shift_result_type(const struct glsl_type *type_a,
+ const struct glsl_type *type_b,
+ ast_operators op,
+ struct _mesa_glsl_parse_state *state, YYLTYPE *loc)
+{
+ if (state->language_version < 130) {
+ _mesa_glsl_error(loc, state, "bit operations require GLSL 1.30");
+ return glsl_type::error_type;
+ }
+
+ /* From page 50 (page 56 of the PDF) of the GLSL 1.30 spec:
+ *
+ * "The shift operators (<<) and (>>). For both operators, the operands
+ * must be signed or unsigned integers or integer vectors. One operand
+ * can be signed while the other is unsigned."
+ */
+ if (!type_a->is_integer()) {
+ _mesa_glsl_error(loc, state, "LHS of operator %s must be an integer or "
+ "integer vector", ast_expression::operator_string(op));
+ return glsl_type::error_type;
+
+ }
+ if (!type_b->is_integer()) {
+ _mesa_glsl_error(loc, state, "RHS of operator %s must be an integer or "
+ "integer vector", ast_expression::operator_string(op));
+ return glsl_type::error_type;
+ }
+
+ /* "If the first operand is a scalar, the second operand has to be
+ * a scalar as well."
+ */
+ if (type_a->is_scalar() && !type_b->is_scalar()) {
+ _mesa_glsl_error(loc, state, "If the first operand of %s is scalar, the "
+ "second must be scalar as well",
+ ast_expression::operator_string(op));
+ return glsl_type::error_type;
+ }
+
+ /* If both operands are vectors, check that they have same number of
+ * elements.
+ */
+ if (type_a->is_vector() &&
+ type_b->is_vector() &&
+ type_a->vector_elements != type_b->vector_elements) {
+ _mesa_glsl_error(loc, state, "Vector operands to operator %s must "
+ "have same number of elements",
+ ast_expression::operator_string(op));
+ return glsl_type::error_type;
+ }
+
+ /* "In all cases, the resulting type will be the same type as the left
+ * operand."
+ */
+ return type_a;
+}
+
+/**
+ * Validates that a value can be assigned to a location with a specified type
+ *
+ * Validates that \c rhs can be assigned to some location. If the types are
+ * not an exact match but an automatic conversion is possible, \c rhs will be
+ * converted.
+ *
+ * \return
+ * \c NULL if \c rhs cannot be assigned to a location with type \c lhs_type.
+ * Otherwise the actual RHS to be assigned will be returned. This may be
+ * \c rhs, or it may be \c rhs after some type conversion.
+ *
+ * \note
+ * In addition to being used for assignments, this function is used to
+ * type-check return values.
+ */
+ir_rvalue *
+validate_assignment(struct _mesa_glsl_parse_state *state,
+ const glsl_type *lhs_type, ir_rvalue *rhs,
+ bool is_initializer)
+{
+ /* If there is already some error in the RHS, just return it. Anything
+ * else will lead to an avalanche of error message back to the user.
+ */
+ if (rhs->type->is_error())
+ return rhs;
+
+ /* If the types are identical, the assignment can trivially proceed.
+ */
+ if (rhs->type == lhs_type)
+ return rhs;
+
+ /* If the array element types are the same and the size of the LHS is zero,
+ * the assignment is okay for initializers embedded in variable
+ * declarations.
+ *
+ * Note: Whole-array assignments are not permitted in GLSL 1.10, but this
+ * is handled by ir_dereference::is_lvalue.
+ */
+ if (is_initializer && lhs_type->is_array() && rhs->type->is_array()
+ && (lhs_type->element_type() == rhs->type->element_type())
+ && (lhs_type->array_size() == 0)) {
+ return rhs;
+ }
+
+ /* Check for implicit conversion in GLSL 1.20 */
+ if (apply_implicit_conversion(lhs_type, rhs, state)) {
+ if (rhs->type == lhs_type)
+ return rhs;
+ }
+
+ return NULL;
+}
+
+ir_rvalue *
+do_assignment(exec_list *instructions, struct _mesa_glsl_parse_state *state,
+ ir_rvalue *lhs, ir_rvalue *rhs, bool is_initializer,
+ YYLTYPE lhs_loc)
+{
+ void *ctx = state;
+ bool error_emitted = (lhs->type->is_error() || rhs->type->is_error());
+
+ if (!error_emitted) {
+ if (lhs->variable_referenced() != NULL
+ && lhs->variable_referenced()->read_only) {
+ _mesa_glsl_error(&lhs_loc, state,
+ "assignment to read-only variable '%s'",
+ lhs->variable_referenced()->name);
+ error_emitted = true;
+
+ } else if (!lhs->is_lvalue()) {
+ _mesa_glsl_error(& lhs_loc, state, "non-lvalue in assignment");
+ error_emitted = true;
+ }
+
+ if (state->es_shader && lhs->type->is_array()) {
+ _mesa_glsl_error(&lhs_loc, state, "whole array assignment is not "
+ "allowed in GLSL ES 1.00.");
+ error_emitted = true;
+ }
+ }
+
+ ir_rvalue *new_rhs =
+ validate_assignment(state, lhs->type, rhs, is_initializer);
+ if (new_rhs == NULL) {
+ _mesa_glsl_error(& lhs_loc, state, "type mismatch");
+ } else {
+ rhs = new_rhs;
+
+ /* If the LHS array was not declared with a size, it takes it size from
+ * the RHS. If the LHS is an l-value and a whole array, it must be a
+ * dereference of a variable. Any other case would require that the LHS
+ * is either not an l-value or not a whole array.
+ */
+ if (lhs->type->array_size() == 0) {
+ ir_dereference *const d = lhs->as_dereference();
+
+ assert(d != NULL);
+
+ ir_variable *const var = d->variable_referenced();
+
+ assert(var != NULL);
+
+ if (var->max_array_access >= unsigned(rhs->type->array_size())) {
+ /* FINISHME: This should actually log the location of the RHS. */
+ _mesa_glsl_error(& lhs_loc, state, "array size must be > %u due to "
+ "previous access",
+ var->max_array_access);
+ }
+
+ var->type = glsl_type::get_array_instance(lhs->type->element_type(),
+ rhs->type->array_size());
+ d->type = var->type;
+ }
+ }
+
+ /* Most callers of do_assignment (assign, add_assign, pre_inc/dec,
+ * but not post_inc) need the converted assigned value as an rvalue
+ * to handle things like:
+ *
+ * i = j += 1;
+ *
+ * So we always just store the computed value being assigned to a
+ * temporary and return a deref of that temporary. If the rvalue
+ * ends up not being used, the temp will get copy-propagated out.
+ */
+ ir_variable *var = new(ctx) ir_variable(rhs->type, "assignment_tmp",
+ ir_var_temporary);
+ ir_dereference_variable *deref_var = new(ctx) ir_dereference_variable(var);
+ instructions->push_tail(var);
+ instructions->push_tail(new(ctx) ir_assignment(deref_var,
+ rhs,
+ NULL));
+ deref_var = new(ctx) ir_dereference_variable(var);
+
+ if (!error_emitted)
+ instructions->push_tail(new(ctx) ir_assignment(lhs, deref_var, NULL));
+
+ return new(ctx) ir_dereference_variable(var);
+}
+
+static ir_rvalue *
+get_lvalue_copy(exec_list *instructions, ir_rvalue *lvalue)
+{
+ void *ctx = ralloc_parent(lvalue);
+ ir_variable *var;
+
+ var = new(ctx) ir_variable(lvalue->type, "_post_incdec_tmp",
+ ir_var_temporary);
+ instructions->push_tail(var);
+ var->mode = ir_var_auto;
+
+ instructions->push_tail(new(ctx) ir_assignment(new(ctx) ir_dereference_variable(var),
+ lvalue, NULL));
+
+ /* Once we've created this temporary, mark it read only so it's no
+ * longer considered an lvalue.
+ */
+ var->read_only = true;
+
+ return new(ctx) ir_dereference_variable(var);
+}
+
+
+ir_rvalue *
+ast_node::hir(exec_list *instructions,
+ struct _mesa_glsl_parse_state *state)
+{
+ (void) instructions;
+ (void) state;
+
+ return NULL;
+}
+
+static void
+mark_whole_array_access(ir_rvalue *access)
+{
+ ir_dereference_variable *deref = access->as_dereference_variable();
+
+ if (deref) {
+ deref->var->max_array_access = deref->type->length - 1;
+ }
+}
+
+static ir_rvalue *
+do_comparison(void *mem_ctx, int operation, ir_rvalue *op0, ir_rvalue *op1)
+{
+ int join_op;
+ ir_rvalue *cmp = NULL;
+
+ if (operation == ir_binop_all_equal)
+ join_op = ir_binop_logic_and;
+ else
+ join_op = ir_binop_logic_or;
+
+ switch (op0->type->base_type) {
+ case GLSL_TYPE_FLOAT:
+ case GLSL_TYPE_UINT:
+ case GLSL_TYPE_INT:
+ case GLSL_TYPE_BOOL:
+ return new(mem_ctx) ir_expression(operation, op0, op1);
+
+ case GLSL_TYPE_ARRAY: {
+ for (unsigned int i = 0; i < op0->type->length; i++) {
+ ir_rvalue *e0, *e1, *result;
+
+ e0 = new(mem_ctx) ir_dereference_array(op0->clone(mem_ctx, NULL),
+ new(mem_ctx) ir_constant(i));
+ e1 = new(mem_ctx) ir_dereference_array(op1->clone(mem_ctx, NULL),
+ new(mem_ctx) ir_constant(i));
+ result = do_comparison(mem_ctx, operation, e0, e1);
+
+ if (cmp) {
+ cmp = new(mem_ctx) ir_expression(join_op, cmp, result);
+ } else {
+ cmp = result;
+ }
+ }
+
+ mark_whole_array_access(op0);
+ mark_whole_array_access(op1);
+ break;
+ }
+
+ case GLSL_TYPE_STRUCT: {
+ for (unsigned int i = 0; i < op0->type->length; i++) {
+ ir_rvalue *e0, *e1, *result;
+ const char *field_name = op0->type->fields.structure[i].name;
+
+ e0 = new(mem_ctx) ir_dereference_record(op0->clone(mem_ctx, NULL),
+ field_name);
+ e1 = new(mem_ctx) ir_dereference_record(op1->clone(mem_ctx, NULL),
+ field_name);
+ result = do_comparison(mem_ctx, operation, e0, e1);
+
+ if (cmp) {
+ cmp = new(mem_ctx) ir_expression(join_op, cmp, result);
+ } else {
+ cmp = result;
+ }
+ }
+ break;
+ }
+
+ case GLSL_TYPE_ERROR:
+ case GLSL_TYPE_VOID:
+ case GLSL_TYPE_SAMPLER:
+ /* I assume a comparison of a struct containing a sampler just
+ * ignores the sampler present in the type.
+ */
+ break;
+
+ default:
+ assert(!"Should not get here.");
+ break;
+ }
+
+ if (cmp == NULL)
+ cmp = new(mem_ctx) ir_constant(true);
+
+ return cmp;
+}
+
+/* For logical operations, we want to ensure that the operands are
+ * scalar booleans. If it isn't, emit an error and return a constant
+ * boolean to avoid triggering cascading error messages.
+ */
+ir_rvalue *
+get_scalar_boolean_operand(exec_list *instructions,
+ struct _mesa_glsl_parse_state *state,
+ ast_expression *parent_expr,
+ int operand,
+ const char *operand_name,
+ bool *error_emitted)
+{
+ ast_expression *expr = parent_expr->subexpressions[operand];
+ void *ctx = state;
+ ir_rvalue *val = expr->hir(instructions, state);
+
+ if (val->type->is_boolean() && val->type->is_scalar())
+ return val;
+
+ if (!*error_emitted) {
+ YYLTYPE loc = expr->get_location();
+ _mesa_glsl_error(&loc, state, "%s of `%s' must be scalar boolean",
+ operand_name,
+ parent_expr->operator_string(parent_expr->oper));
+ *error_emitted = true;
+ }
+
+ return new(ctx) ir_constant(true);
+}
+
+ir_rvalue *
+ast_expression::hir(exec_list *instructions,
+ struct _mesa_glsl_parse_state *state)
+{
+ void *ctx = state;
+ static const int operations[AST_NUM_OPERATORS] = {
+ -1, /* ast_assign doesn't convert to ir_expression. */
+ -1, /* ast_plus doesn't convert to ir_expression. */
+ ir_unop_neg,
+ ir_binop_add,
+ ir_binop_sub,
+ ir_binop_mul,
+ ir_binop_div,
+ ir_binop_mod,
+ ir_binop_lshift,
+ ir_binop_rshift,
+ ir_binop_less,
+ ir_binop_greater,
+ ir_binop_lequal,
+ ir_binop_gequal,
+ ir_binop_all_equal,
+ ir_binop_any_nequal,
+ ir_binop_bit_and,
+ ir_binop_bit_xor,
+ ir_binop_bit_or,
+ ir_unop_bit_not,
+ ir_binop_logic_and,
+ ir_binop_logic_xor,
+ ir_binop_logic_or,
+ ir_unop_logic_not,
+
+ /* Note: The following block of expression types actually convert
+ * to multiple IR instructions.
+ */
+ ir_binop_mul, /* ast_mul_assign */
+ ir_binop_div, /* ast_div_assign */
+ ir_binop_mod, /* ast_mod_assign */
+ ir_binop_add, /* ast_add_assign */
+ ir_binop_sub, /* ast_sub_assign */
+ ir_binop_lshift, /* ast_ls_assign */
+ ir_binop_rshift, /* ast_rs_assign */
+ ir_binop_bit_and, /* ast_and_assign */
+ ir_binop_bit_xor, /* ast_xor_assign */
+ ir_binop_bit_or, /* ast_or_assign */
+
+ -1, /* ast_conditional doesn't convert to ir_expression. */
+ ir_binop_add, /* ast_pre_inc. */
+ ir_binop_sub, /* ast_pre_dec. */
+ ir_binop_add, /* ast_post_inc. */
+ ir_binop_sub, /* ast_post_dec. */
+ -1, /* ast_field_selection doesn't conv to ir_expression. */
+ -1, /* ast_array_index doesn't convert to ir_expression. */
+ -1, /* ast_function_call doesn't conv to ir_expression. */
+ -1, /* ast_identifier doesn't convert to ir_expression. */
+ -1, /* ast_int_constant doesn't convert to ir_expression. */
+ -1, /* ast_uint_constant doesn't conv to ir_expression. */
+ -1, /* ast_float_constant doesn't conv to ir_expression. */
+ -1, /* ast_bool_constant doesn't conv to ir_expression. */
+ -1, /* ast_sequence doesn't convert to ir_expression. */
+ };
+ ir_rvalue *result = NULL;
+ ir_rvalue *op[3];
+ const struct glsl_type *type; /* a temporary variable for switch cases */
+ bool error_emitted = false;
+ YYLTYPE loc;
+
+ loc = this->get_location();
+
+ switch (this->oper) {
+ case ast_assign: {
+ op[0] = this->subexpressions[0]->hir(instructions, state);
+ op[1] = this->subexpressions[1]->hir(instructions, state);
+
+ result = do_assignment(instructions, state, op[0], op[1], false,
+ this->subexpressions[0]->get_location());
+ error_emitted = result->type->is_error();
+ break;
+ }
+
+ case ast_plus:
+ op[0] = this->subexpressions[0]->hir(instructions, state);
+
+ type = unary_arithmetic_result_type(op[0]->type, state, & loc);
+
+ error_emitted = type->is_error();
+
+ result = op[0];
+ break;
+
+ case ast_neg:
+ op[0] = this->subexpressions[0]->hir(instructions, state);
+
+ type = unary_arithmetic_result_type(op[0]->type, state, & loc);
+
+ error_emitted = type->is_error();
+
+ result = new(ctx) ir_expression(operations[this->oper], type,
+ op[0], NULL);
+ break;
+
+ case ast_add:
+ case ast_sub:
+ case ast_mul:
+ case ast_div:
+ op[0] = this->subexpressions[0]->hir(instructions, state);
+ op[1] = this->subexpressions[1]->hir(instructions, state);
+
+ type = arithmetic_result_type(op[0], op[1],
+ (this->oper == ast_mul),
+ state, & loc);
+ error_emitted = type->is_error();
+
+ result = new(ctx) ir_expression(operations[this->oper], type,
+ op[0], op[1]);
+ break;
+
+ case ast_mod:
+ op[0] = this->subexpressions[0]->hir(instructions, state);
+ op[1] = this->subexpressions[1]->hir(instructions, state);
+
+ type = modulus_result_type(op[0]->type, op[1]->type, state, & loc);
+
+ assert(operations[this->oper] == ir_binop_mod);
+
+ result = new(ctx) ir_expression(operations[this->oper], type,
+ op[0], op[1]);
+ error_emitted = type->is_error();
+ break;
+
+ case ast_lshift:
+ case ast_rshift:
+ if (state->language_version < 130) {
+ _mesa_glsl_error(&loc, state, "operator %s requires GLSL 1.30",
+ operator_string(this->oper));
+ error_emitted = true;
+ }
+
+ op[0] = this->subexpressions[0]->hir(instructions, state);
+ op[1] = this->subexpressions[1]->hir(instructions, state);
+ type = shift_result_type(op[0]->type, op[1]->type, this->oper, state,
+ &loc);
+ result = new(ctx) ir_expression(operations[this->oper], type,
+ op[0], op[1]);
+ error_emitted = op[0]->type->is_error() || op[1]->type->is_error();
+ break;
+
+ case ast_less:
+ case ast_greater:
+ case ast_lequal:
+ case ast_gequal:
+ op[0] = this->subexpressions[0]->hir(instructions, state);
+ op[1] = this->subexpressions[1]->hir(instructions, state);
+
+ type = relational_result_type(op[0], op[1], state, & loc);
+
+ /* The relational operators must either generate an error or result
+ * in a scalar boolean. See page 57 of the GLSL 1.50 spec.
+ */
+ assert(type->is_error()
+ || ((type->base_type == GLSL_TYPE_BOOL)
+ && type->is_scalar()));
+
+ result = new(ctx) ir_expression(operations[this->oper], type,
+ op[0], op[1]);
+ error_emitted = type->is_error();
+ break;
+
+ case ast_nequal:
+ case ast_equal:
+ op[0] = this->subexpressions[0]->hir(instructions, state);
+ op[1] = this->subexpressions[1]->hir(instructions, state);
+
+ /* From page 58 (page 64 of the PDF) of the GLSL 1.50 spec:
+ *
+ * "The equality operators equal (==), and not equal (!=)
+ * operate on all types. They result in a scalar Boolean. If
+ * the operand types do not match, then there must be a
+ * conversion from Section 4.1.10 "Implicit Conversions"
+ * applied to one operand that can make them match, in which
+ * case this conversion is done."
+ */
+ if ((!apply_implicit_conversion(op[0]->type, op[1], state)
+ && !apply_implicit_conversion(op[1]->type, op[0], state))
+ || (op[0]->type != op[1]->type)) {
+ _mesa_glsl_error(& loc, state, "operands of `%s' must have the same "
+ "type", (this->oper == ast_equal) ? "==" : "!=");
+ error_emitted = true;
+ } else if ((state->language_version <= 110)
+ && (op[0]->type->is_array() || op[1]->type->is_array())) {
+ _mesa_glsl_error(& loc, state, "array comparisons forbidden in "
+ "GLSL 1.10");
+ error_emitted = true;
+ }
+
+ if (error_emitted) {
+ result = new(ctx) ir_constant(false);
+ } else {
+ result = do_comparison(ctx, operations[this->oper], op[0], op[1]);
+ assert(result->type == glsl_type::bool_type);
+ }
+ break;
+
+ case ast_bit_and:
+ case ast_bit_xor:
+ case ast_bit_or:
+ op[0] = this->subexpressions[0]->hir(instructions, state);
+ op[1] = this->subexpressions[1]->hir(instructions, state);
+ type = bit_logic_result_type(op[0]->type, op[1]->type, this->oper,
+ state, &loc);
+ result = new(ctx) ir_expression(operations[this->oper], type,
+ op[0], op[1]);
+ error_emitted = op[0]->type->is_error() || op[1]->type->is_error();
+ break;
+
+ case ast_bit_not:
+ op[0] = this->subexpressions[0]->hir(instructions, state);
+
+ if (state->language_version < 130) {
+ _mesa_glsl_error(&loc, state, "bit-wise operations require GLSL 1.30");
+ error_emitted = true;
+ }
+
+ if (!op[0]->type->is_integer()) {
+ _mesa_glsl_error(&loc, state, "operand of `~' must be an integer");
+ error_emitted = true;
+ }
+
+ type = op[0]->type;
+ result = new(ctx) ir_expression(ir_unop_bit_not, type, op[0], NULL);
+ break;
+
+ case ast_logic_and: {
+ exec_list rhs_instructions;
+ op[0] = get_scalar_boolean_operand(instructions, state, this, 0,
+ "LHS", &error_emitted);
+ op[1] = get_scalar_boolean_operand(&rhs_instructions, state, this, 1,
+ "RHS", &error_emitted);
+
+ ir_constant *op0_const = op[0]->constant_expression_value();
+ if (op0_const) {
+ if (op0_const->value.b[0]) {
+ instructions->append_list(&rhs_instructions);
+ result = op[1];
+ } else {
+ result = op0_const;
+ }
+ type = glsl_type::bool_type;
+ } else {
+ ir_variable *const tmp = new(ctx) ir_variable(glsl_type::bool_type,
+ "and_tmp",
+ ir_var_temporary);
+ instructions->push_tail(tmp);
+
+ ir_if *const stmt = new(ctx) ir_if(op[0]);
+ instructions->push_tail(stmt);
+
+ stmt->then_instructions.append_list(&rhs_instructions);
+ ir_dereference *const then_deref = new(ctx) ir_dereference_variable(tmp);
+ ir_assignment *const then_assign =
+ new(ctx) ir_assignment(then_deref, op[1], NULL);
+ stmt->then_instructions.push_tail(then_assign);
+
+ ir_dereference *const else_deref = new(ctx) ir_dereference_variable(tmp);
+ ir_assignment *const else_assign =
+ new(ctx) ir_assignment(else_deref, new(ctx) ir_constant(false), NULL);
+ stmt->else_instructions.push_tail(else_assign);
+
+ result = new(ctx) ir_dereference_variable(tmp);
+ type = tmp->type;
+ }
+ break;
+ }
+
+ case ast_logic_or: {
+ exec_list rhs_instructions;
+ op[0] = get_scalar_boolean_operand(instructions, state, this, 0,
+ "LHS", &error_emitted);
+ op[1] = get_scalar_boolean_operand(&rhs_instructions, state, this, 1,
+ "RHS", &error_emitted);
+
+ ir_constant *op0_const = op[0]->constant_expression_value();
+ if (op0_const) {
+ if (op0_const->value.b[0]) {
+ result = op0_const;
+ } else {
+ result = op[1];
+ }
+ type = glsl_type::bool_type;
+ } else {
+ ir_variable *const tmp = new(ctx) ir_variable(glsl_type::bool_type,
+ "or_tmp",
+ ir_var_temporary);
+ instructions->push_tail(tmp);
+
+ ir_if *const stmt = new(ctx) ir_if(op[0]);
+ instructions->push_tail(stmt);
+
+ ir_dereference *const then_deref = new(ctx) ir_dereference_variable(tmp);
+ ir_assignment *const then_assign =
+ new(ctx) ir_assignment(then_deref, new(ctx) ir_constant(true), NULL);
+ stmt->then_instructions.push_tail(then_assign);
+
+ stmt->else_instructions.append_list(&rhs_instructions);
+ ir_dereference *const else_deref = new(ctx) ir_dereference_variable(tmp);
+ ir_assignment *const else_assign =
+ new(ctx) ir_assignment(else_deref, op[1], NULL);
+ stmt->else_instructions.push_tail(else_assign);
+
+ result = new(ctx) ir_dereference_variable(tmp);
+ type = tmp->type;
+ }
+ break;
+ }
+
+ case ast_logic_xor:
+ /* From page 33 (page 39 of the PDF) of the GLSL 1.10 spec:
+ *
+ * "The logical binary operators and (&&), or ( | | ), and
+ * exclusive or (^^). They operate only on two Boolean
+ * expressions and result in a Boolean expression."
+ */
+ op[0] = get_scalar_boolean_operand(instructions, state, this, 0, "LHS",
+ &error_emitted);
+ op[1] = get_scalar_boolean_operand(instructions, state, this, 1, "RHS",
+ &error_emitted);
+
+ result = new(ctx) ir_expression(operations[this->oper], glsl_type::bool_type,
+ op[0], op[1]);
+ break;
+
+ case ast_logic_not:
+ op[0] = get_scalar_boolean_operand(instructions, state, this, 0,
+ "operand", &error_emitted);
+
+ result = new(ctx) ir_expression(operations[this->oper], glsl_type::bool_type,
+ op[0], NULL);
+ break;
+
+ case ast_mul_assign:
+ case ast_div_assign:
+ case ast_add_assign:
+ case ast_sub_assign: {
+ op[0] = this->subexpressions[0]->hir(instructions, state);
+ op[1] = this->subexpressions[1]->hir(instructions, state);
+
+ type = arithmetic_result_type(op[0], op[1],
+ (this->oper == ast_mul_assign),
+ state, & loc);
+
+ ir_rvalue *temp_rhs = new(ctx) ir_expression(operations[this->oper], type,
+ op[0], op[1]);
+
+ result = do_assignment(instructions, state,
+ op[0]->clone(ctx, NULL), temp_rhs, false,
+ this->subexpressions[0]->get_location());
+ error_emitted = (op[0]->type->is_error());
+
+ /* GLSL 1.10 does not allow array assignment. However, we don't have to
+ * explicitly test for this because none of the binary expression
+ * operators allow array operands either.
+ */
+
+ break;
+ }
+
+ case ast_mod_assign: {
+ op[0] = this->subexpressions[0]->hir(instructions, state);
+ op[1] = this->subexpressions[1]->hir(instructions, state);
+
+ type = modulus_result_type(op[0]->type, op[1]->type, state, & loc);
+
+ assert(operations[this->oper] == ir_binop_mod);
+
+ ir_rvalue *temp_rhs;
+ temp_rhs = new(ctx) ir_expression(operations[this->oper], type,
+ op[0], op[1]);
+
+ result = do_assignment(instructions, state,
+ op[0]->clone(ctx, NULL), temp_rhs, false,
+ this->subexpressions[0]->get_location());
+ error_emitted = type->is_error();
+ break;
+ }
+
+ case ast_ls_assign:
+ case ast_rs_assign: {
+ op[0] = this->subexpressions[0]->hir(instructions, state);
+ op[1] = this->subexpressions[1]->hir(instructions, state);
+ type = shift_result_type(op[0]->type, op[1]->type, this->oper, state,
+ &loc);
+ ir_rvalue *temp_rhs = new(ctx) ir_expression(operations[this->oper],
+ type, op[0], op[1]);
+ result = do_assignment(instructions, state, op[0]->clone(ctx, NULL),
+ temp_rhs, false,
+ this->subexpressions[0]->get_location());
+ error_emitted = op[0]->type->is_error() || op[1]->type->is_error();
+ break;
+ }
+
+ case ast_and_assign:
+ case ast_xor_assign:
+ case ast_or_assign: {
+ op[0] = this->subexpressions[0]->hir(instructions, state);
+ op[1] = this->subexpressions[1]->hir(instructions, state);
+ type = bit_logic_result_type(op[0]->type, op[1]->type, this->oper,
+ state, &loc);
+ ir_rvalue *temp_rhs = new(ctx) ir_expression(operations[this->oper],
+ type, op[0], op[1]);
+ result = do_assignment(instructions, state, op[0]->clone(ctx, NULL),
+ temp_rhs, false,
+ this->subexpressions[0]->get_location());
+ error_emitted = op[0]->type->is_error() || op[1]->type->is_error();
+ break;
+ }
+
+ case ast_conditional: {
+ /* From page 59 (page 65 of the PDF) of the GLSL 1.50 spec:
+ *
+ * "The ternary selection operator (?:). It operates on three
+ * expressions (exp1 ? exp2 : exp3). This operator evaluates the
+ * first expression, which must result in a scalar Boolean."
+ */
+ op[0] = get_scalar_boolean_operand(instructions, state, this, 0,
+ "condition", &error_emitted);
+
+ /* The :? operator is implemented by generating an anonymous temporary
+ * followed by an if-statement. The last instruction in each branch of
+ * the if-statement assigns a value to the anonymous temporary. This
+ * temporary is the r-value of the expression.
+ */
+ exec_list then_instructions;
+ exec_list else_instructions;
+
+ op[1] = this->subexpressions[1]->hir(&then_instructions, state);
+ op[2] = this->subexpressions[2]->hir(&else_instructions, state);
+
+ /* From page 59 (page 65 of the PDF) of the GLSL 1.50 spec:
+ *
+ * "The second and third expressions can be any type, as
+ * long their types match, or there is a conversion in
+ * Section 4.1.10 "Implicit Conversions" that can be applied
+ * to one of the expressions to make their types match. This
+ * resulting matching type is the type of the entire
+ * expression."
+ */
+ if ((!apply_implicit_conversion(op[1]->type, op[2], state)
+ && !apply_implicit_conversion(op[2]->type, op[1], state))
+ || (op[1]->type != op[2]->type)) {
+ YYLTYPE loc = this->subexpressions[1]->get_location();
+
+ _mesa_glsl_error(& loc, state, "Second and third operands of ?: "
+ "operator must have matching types.");
+ error_emitted = true;
+ type = glsl_type::error_type;
+ } else {
+ type = op[1]->type;
+ }
+
+ /* From page 33 (page 39 of the PDF) of the GLSL 1.10 spec:
+ *
+ * "The second and third expressions must be the same type, but can
+ * be of any type other than an array."
+ */
+ if ((state->language_version <= 110) && type->is_array()) {
+ _mesa_glsl_error(& loc, state, "Second and third operands of ?: "
+ "operator must not be arrays.");
+ error_emitted = true;
+ }
+
+ ir_constant *cond_val = op[0]->constant_expression_value();
+ ir_constant *then_val = op[1]->constant_expression_value();
+ ir_constant *else_val = op[2]->constant_expression_value();
+
+ if (then_instructions.is_empty()
+ && else_instructions.is_empty()
+ && (cond_val != NULL) && (then_val != NULL) && (else_val != NULL)) {
+ result = (cond_val->value.b[0]) ? then_val : else_val;
+ } else {
+ ir_variable *const tmp =
+ new(ctx) ir_variable(type, "conditional_tmp", ir_var_temporary);
+ instructions->push_tail(tmp);
+
+ ir_if *const stmt = new(ctx) ir_if(op[0]);
+ instructions->push_tail(stmt);
+
+ then_instructions.move_nodes_to(& stmt->then_instructions);
+ ir_dereference *const then_deref =
+ new(ctx) ir_dereference_variable(tmp);
+ ir_assignment *const then_assign =
+ new(ctx) ir_assignment(then_deref, op[1], NULL);
+ stmt->then_instructions.push_tail(then_assign);
+
+ else_instructions.move_nodes_to(& stmt->else_instructions);
+ ir_dereference *const else_deref =
+ new(ctx) ir_dereference_variable(tmp);
+ ir_assignment *const else_assign =
+ new(ctx) ir_assignment(else_deref, op[2], NULL);
+ stmt->else_instructions.push_tail(else_assign);
+
+ result = new(ctx) ir_dereference_variable(tmp);
+ }
+ break;
+ }
+
+ case ast_pre_inc:
+ case ast_pre_dec: {
+ op[0] = this->subexpressions[0]->hir(instructions, state);
+ if (op[0]->type->base_type == GLSL_TYPE_FLOAT)
+ op[1] = new(ctx) ir_constant(1.0f);
+ else
+ op[1] = new(ctx) ir_constant(1);
+
+ type = arithmetic_result_type(op[0], op[1], false, state, & loc);
+
+ ir_rvalue *temp_rhs;
+ temp_rhs = new(ctx) ir_expression(operations[this->oper], type,
+ op[0], op[1]);
+
+ result = do_assignment(instructions, state,
+ op[0]->clone(ctx, NULL), temp_rhs, false,
+ this->subexpressions[0]->get_location());
+ error_emitted = op[0]->type->is_error();
+ break;
+ }
+
+ case ast_post_inc:
+ case ast_post_dec: {
+ op[0] = this->subexpressions[0]->hir(instructions, state);
+ if (op[0]->type->base_type == GLSL_TYPE_FLOAT)
+ op[1] = new(ctx) ir_constant(1.0f);
+ else
+ op[1] = new(ctx) ir_constant(1);
+
+ error_emitted = op[0]->type->is_error() || op[1]->type->is_error();
+
+ type = arithmetic_result_type(op[0], op[1], false, state, & loc);
+
+ ir_rvalue *temp_rhs;
+ temp_rhs = new(ctx) ir_expression(operations[this->oper], type,
+ op[0], op[1]);
+
+ /* Get a temporary of a copy of the lvalue before it's modified.
+ * This may get thrown away later.
+ */
+ result = get_lvalue_copy(instructions, op[0]->clone(ctx, NULL));
+
+ (void)do_assignment(instructions, state,
+ op[0]->clone(ctx, NULL), temp_rhs, false,
+ this->subexpressions[0]->get_location());
+
+ error_emitted = op[0]->type->is_error();
+ break;
+ }
+
+ case ast_field_selection:
+ result = _mesa_ast_field_selection_to_hir(this, instructions, state);
+ break;
+
+ case ast_array_index: {
+ YYLTYPE index_loc = subexpressions[1]->get_location();
+
+ op[0] = subexpressions[0]->hir(instructions, state);
+ op[1] = subexpressions[1]->hir(instructions, state);
+
+ error_emitted = op[0]->type->is_error() || op[1]->type->is_error();
+
+ ir_rvalue *const array = op[0];
+
+ result = new(ctx) ir_dereference_array(op[0], op[1]);
+
+ /* Do not use op[0] after this point. Use array.
+ */
+ op[0] = NULL;
+
+
+ if (error_emitted)
+ break;
+
+ if (!array->type->is_array()
+ && !array->type->is_matrix()
+ && !array->type->is_vector()) {
+ _mesa_glsl_error(& index_loc, state,
+ "cannot dereference non-array / non-matrix / "
+ "non-vector");
+ error_emitted = true;
+ }
+
+ if (!op[1]->type->is_integer()) {
+ _mesa_glsl_error(& index_loc, state,
+ "array index must be integer type");
+ error_emitted = true;
+ } else if (!op[1]->type->is_scalar()) {
+ _mesa_glsl_error(& index_loc, state,
+ "array index must be scalar");
+ error_emitted = true;
+ }
+
+ /* If the array index is a constant expression and the array has a
+ * declared size, ensure that the access is in-bounds. If the array
+ * index is not a constant expression, ensure that the array has a
+ * declared size.
+ */
+ ir_constant *const const_index = op[1]->constant_expression_value();
+ if (const_index != NULL) {
+ const int idx = const_index->value.i[0];
+ const char *type_name;
+ unsigned bound = 0;
+
+ if (array->type->is_matrix()) {
+ type_name = "matrix";
+ } else if (array->type->is_vector()) {
+ type_name = "vector";
+ } else {
+ type_name = "array";
+ }
+
+ /* From page 24 (page 30 of the PDF) of the GLSL 1.50 spec:
+ *
+ * "It is illegal to declare an array with a size, and then
+ * later (in the same shader) index the same array with an
+ * integral constant expression greater than or equal to the
+ * declared size. It is also illegal to index an array with a
+ * negative constant expression."
+ */
+ if (array->type->is_matrix()) {
+ if (array->type->row_type()->vector_elements <= idx) {
+ bound = array->type->row_type()->vector_elements;
+ }
+ } else if (array->type->is_vector()) {
+ if (array->type->vector_elements <= idx) {
+ bound = array->type->vector_elements;
+ }
+ } else {
+ if ((array->type->array_size() > 0)
+ && (array->type->array_size() <= idx)) {
+ bound = array->type->array_size();
+ }
+ }
+
+ if (bound > 0) {
+ _mesa_glsl_error(& loc, state, "%s index must be < %u",
+ type_name, bound);
+ error_emitted = true;
+ } else if (idx < 0) {
+ _mesa_glsl_error(& loc, state, "%s index must be >= 0",
+ type_name);
+ error_emitted = true;
+ }
+
+ if (array->type->is_array()) {
+ /* If the array is a variable dereference, it dereferences the
+ * whole array, by definition. Use this to get the variable.
+ *
+ * FINISHME: Should some methods for getting / setting / testing
+ * FINISHME: array access limits be added to ir_dereference?
+ */
+ ir_variable *const v = array->whole_variable_referenced();
+ if ((v != NULL) && (unsigned(idx) > v->max_array_access))
+ v->max_array_access = idx;
+ }
+ } else if (array->type->array_size() == 0) {
+ _mesa_glsl_error(&loc, state, "unsized array index must be constant");
+ } else {
+ if (array->type->is_array()) {
+ /* whole_variable_referenced can return NULL if the array is a
+ * member of a structure. In this case it is safe to not update
+ * the max_array_access field because it is never used for fields
+ * of structures.
+ */
+ ir_variable *v = array->whole_variable_referenced();
+ if (v != NULL)
+ v->max_array_access = array->type->array_size() - 1;
+ }
+ }
+
+ /* From page 23 (29 of the PDF) of the GLSL 1.30 spec:
+ *
+ * "Samplers aggregated into arrays within a shader (using square
+ * brackets [ ]) can only be indexed with integral constant
+ * expressions [...]."
+ *
+ * This restriction was added in GLSL 1.30. Shaders using earlier version
+ * of the language should not be rejected by the compiler front-end for
+ * using this construct. This allows useful things such as using a loop
+ * counter as the index to an array of samplers. If the loop in unrolled,
+ * the code should compile correctly. Instead, emit a warning.
+ */
+ if (array->type->is_array() &&
+ array->type->element_type()->is_sampler() &&
+ const_index == NULL) {
+
+ if (state->language_version == 100) {
+ _mesa_glsl_warning(&loc, state,
+ "sampler arrays indexed with non-constant "
+ "expressions is optional in GLSL ES 1.00");
+ } else if (state->language_version < 130) {
+ _mesa_glsl_warning(&loc, state,
+ "sampler arrays indexed with non-constant "
+ "expressions is forbidden in GLSL 1.30 and "
+ "later");
+ } else {
+ _mesa_glsl_error(&loc, state,
+ "sampler arrays indexed with non-constant "
+ "expressions is forbidden in GLSL 1.30 and "
+ "later");
+ error_emitted = true;
+ }
+ }
+
+ if (error_emitted)
+ result->type = glsl_type::error_type;
+
+ break;
+ }
+
+ case ast_function_call:
+ /* Should *NEVER* get here. ast_function_call should always be handled
+ * by ast_function_expression::hir.
+ */
+ assert(0);
+ break;
+
+ case ast_identifier: {
+ /* ast_identifier can appear several places in a full abstract syntax
+ * tree. This particular use must be at location specified in the grammar
+ * as 'variable_identifier'.
+ */
+ ir_variable *var =
+ state->symbols->get_variable(this->primary_expression.identifier);
+
+ result = new(ctx) ir_dereference_variable(var);
+
+ if (var != NULL) {
+ var->used = true;
+ } else {
+ _mesa_glsl_error(& loc, state, "`%s' undeclared",
+ this->primary_expression.identifier);
+
+ error_emitted = true;
+ }
+ break;
+ }
+
+ case ast_int_constant:
+ result = new(ctx) ir_constant(this->primary_expression.int_constant);
+ break;
+
+ case ast_uint_constant:
+ result = new(ctx) ir_constant(this->primary_expression.uint_constant);
+ break;
+
+ case ast_float_constant:
+ result = new(ctx) ir_constant(this->primary_expression.float_constant);
+ break;
+
+ case ast_bool_constant:
+ result = new(ctx) ir_constant(bool(this->primary_expression.bool_constant));
+ break;
+
+ case ast_sequence: {
+ /* It should not be possible to generate a sequence in the AST without
+ * any expressions in it.
+ */
+ assert(!this->expressions.is_empty());
+
+ /* The r-value of a sequence is the last expression in the sequence. If
+ * the other expressions in the sequence do not have side-effects (and
+ * therefore add instructions to the instruction list), they get dropped
+ * on the floor.
+ */
+ exec_node *previous_tail_pred = NULL;
+ YYLTYPE previous_operand_loc = loc;
+
+ foreach_list_typed (ast_node, ast, link, &this->expressions) {
+ /* If one of the operands of comma operator does not generate any
+ * code, we want to emit a warning. At each pass through the loop
+ * previous_tail_pred will point to the last instruction in the
+ * stream *before* processing the previous operand. Naturally,
+ * instructions->tail_pred will point to the last instruction in the
+ * stream *after* processing the previous operand. If the two
+ * pointers match, then the previous operand had no effect.
+ *
+ * The warning behavior here differs slightly from GCC. GCC will
+ * only emit a warning if none of the left-hand operands have an
+ * effect. However, it will emit a warning for each. I believe that
+ * there are some cases in C (especially with GCC extensions) where
+ * it is useful to have an intermediate step in a sequence have no
+ * effect, but I don't think these cases exist in GLSL. Either way,
+ * it would be a giant hassle to replicate that behavior.
+ */
+ if (previous_tail_pred == instructions->tail_pred) {
+ _mesa_glsl_warning(&previous_operand_loc, state,
+ "left-hand operand of comma expression has "
+ "no effect");
+ }
+
+ /* tail_pred is directly accessed instead of using the get_tail()
+ * method for performance reasons. get_tail() has extra code to
+ * return NULL when the list is empty. We don't care about that
+ * here, so using tail_pred directly is fine.
+ */
+ previous_tail_pred = instructions->tail_pred;
+ previous_operand_loc = ast->get_location();
+
+ result = ast->hir(instructions, state);
+ }
+
+ /* Any errors should have already been emitted in the loop above.
+ */
+ error_emitted = true;
+ break;
+ }
+ }
+ type = NULL; /* use result->type, not type. */
+ assert(result != NULL);
+
+ if (result->type->is_error() && !error_emitted)
+ _mesa_glsl_error(& loc, state, "type mismatch");
+
+ return result;
+}
+
+
+ir_rvalue *
+ast_expression_statement::hir(exec_list *instructions,
+ struct _mesa_glsl_parse_state *state)
+{
+ /* It is possible to have expression statements that don't have an
+ * expression. This is the solitary semicolon:
+ *
+ * for (i = 0; i < 5; i++)
+ * ;
+ *
+ * In this case the expression will be NULL. Test for NULL and don't do
+ * anything in that case.
+ */
+ if (expression != NULL)
+ expression->hir(instructions, state);
+
+ /* Statements do not have r-values.
+ */
+ return NULL;
+}
+
+
+ir_rvalue *
+ast_compound_statement::hir(exec_list *instructions,
+ struct _mesa_glsl_parse_state *state)
+{
+ if (new_scope)
+ state->symbols->push_scope();
+
+ foreach_list_typed (ast_node, ast, link, &this->statements)
+ ast->hir(instructions, state);
+
+ if (new_scope)
+ state->symbols->pop_scope();
+
+ /* Compound statements do not have r-values.
+ */
+ return NULL;
+}
+
+
+static const glsl_type *
+process_array_type(YYLTYPE *loc, const glsl_type *base, ast_node *array_size,
+ struct _mesa_glsl_parse_state *state)
+{
+ unsigned length = 0;
+
+ /* FINISHME: Reject delcarations of multidimensional arrays. */
+
+ if (array_size != NULL) {
+ exec_list dummy_instructions;
+ ir_rvalue *const ir = array_size->hir(& dummy_instructions, state);
+ YYLTYPE loc = array_size->get_location();
+
+ /* FINISHME: Verify that the grammar forbids side-effects in array
+ * FINISHME: sizes. i.e., 'vec4 [x = 12] data'
+ */
+ assert(dummy_instructions.is_empty());
+
+ if (ir != NULL) {
+ if (!ir->type->is_integer()) {
+ _mesa_glsl_error(& loc, state, "array size must be integer type");
+ } else if (!ir->type->is_scalar()) {
+ _mesa_glsl_error(& loc, state, "array size must be scalar type");
+ } else {
+ ir_constant *const size = ir->constant_expression_value();
+
+ if (size == NULL) {
+ _mesa_glsl_error(& loc, state, "array size must be a "
+ "constant valued expression");
+ } else if (size->value.i[0] <= 0) {
+ _mesa_glsl_error(& loc, state, "array size must be > 0");
+ } else {
+ assert(size->type == ir->type);
+ length = size->value.u[0];
+ }
+ }
+ }
+ } else if (state->es_shader) {
+ /* Section 10.17 of the GLSL ES 1.00 specification states that unsized
+ * array declarations have been removed from the language.
+ */
+ _mesa_glsl_error(loc, state, "unsized array declarations are not "
+ "allowed in GLSL ES 1.00.");
+ }
+
+ return glsl_type::get_array_instance(base, length);
+}
+
+
+const glsl_type *
+ast_type_specifier::glsl_type(const char **name,
+ struct _mesa_glsl_parse_state *state) const
+{
+ const struct glsl_type *type;
+
+ type = state->symbols->get_type(this->type_name);
+ *name = this->type_name;
+
+ if (this->is_array) {
+ YYLTYPE loc = this->get_location();
+ type = process_array_type(&loc, type, this->array_size, state);
+ }
+
+ return type;
+}
+
+
+static void
+apply_type_qualifier_to_variable(const struct ast_type_qualifier *qual,
+ ir_variable *var,
+ struct _mesa_glsl_parse_state *state,
+ YYLTYPE *loc)
+{
+ if (qual->flags.q.invariant) {
+ if (var->used) {
+ _mesa_glsl_error(loc, state,
+ "variable `%s' may not be redeclared "
+ "`invariant' after being used",
+ var->name);
+ } else {
+ var->invariant = 1;
+ }
+ }
+
+ if (qual->flags.q.constant || qual->flags.q.attribute
+ || qual->flags.q.uniform
+ || (qual->flags.q.varying && (state->target == fragment_shader)))
+ var->read_only = 1;
+
+ if (qual->flags.q.centroid)
+ var->centroid = 1;
+
+ if (qual->flags.q.attribute && state->target != vertex_shader) {
+ var->type = glsl_type::error_type;
+ _mesa_glsl_error(loc, state,
+ "`attribute' variables may not be declared in the "
+ "%s shader",
+ _mesa_glsl_shader_target_name(state->target));
+ }
+
+ /* From page 25 (page 31 of the PDF) of the GLSL 1.10 spec:
+ *
+ * "The varying qualifier can be used only with the data types
+ * float, vec2, vec3, vec4, mat2, mat3, and mat4, or arrays of
+ * these."
+ */
+ if (qual->flags.q.varying) {
+ const glsl_type *non_array_type;
+
+ if (var->type && var->type->is_array())
+ non_array_type = var->type->fields.array;
+ else
+ non_array_type = var->type;
+
+ if (non_array_type && non_array_type->base_type != GLSL_TYPE_FLOAT) {
+ var->type = glsl_type::error_type;
+ _mesa_glsl_error(loc, state,
+ "varying variables must be of base type float");
+ }
+ }
+
+ /* If there is no qualifier that changes the mode of the variable, leave
+ * the setting alone.
+ */
+ if (qual->flags.q.in && qual->flags.q.out)
+ var->mode = ir_var_inout;
+ else if (qual->flags.q.attribute || qual->flags.q.in
+ || (qual->flags.q.varying && (state->target == fragment_shader)))
+ var->mode = ir_var_in;
+ else if (qual->flags.q.out
+ || (qual->flags.q.varying && (state->target == vertex_shader)))
+ var->mode = ir_var_out;
+ else if (qual->flags.q.uniform)
+ var->mode = ir_var_uniform;
+
+ if (state->all_invariant && (state->current_function == NULL)) {
+ switch (state->target) {
+ case vertex_shader:
+ if (var->mode == ir_var_out)
+ var->invariant = true;
+ break;
+ case geometry_shader:
+ if ((var->mode == ir_var_in) || (var->mode == ir_var_out))
+ var->invariant = true;
+ break;
+ case fragment_shader:
+ if (var->mode == ir_var_in)
+ var->invariant = true;
+ break;
+ }
+ }
+
+ if (qual->flags.q.flat)
+ var->interpolation = ir_var_flat;
+ else if (qual->flags.q.noperspective)
+ var->interpolation = ir_var_noperspective;
+ else
+ var->interpolation = ir_var_smooth;
+
+ var->pixel_center_integer = qual->flags.q.pixel_center_integer;
+ var->origin_upper_left = qual->flags.q.origin_upper_left;
+ if ((qual->flags.q.origin_upper_left || qual->flags.q.pixel_center_integer)
+ && (strcmp(var->name, "gl_FragCoord") != 0)) {
+ const char *const qual_string = (qual->flags.q.origin_upper_left)
+ ? "origin_upper_left" : "pixel_center_integer";
+
+ _mesa_glsl_error(loc, state,
+ "layout qualifier `%s' can only be applied to "
+ "fragment shader input `gl_FragCoord'",
+ qual_string);
+ }
+
+ if (qual->flags.q.explicit_location) {
+ const bool global_scope = (state->current_function == NULL);
+ bool fail = false;
+ const char *string = "";
+
+ /* In the vertex shader only shader inputs can be given explicit
+ * locations.
+ *
+ * In the fragment shader only shader outputs can be given explicit
+ * locations.
+ */
+ switch (state->target) {
+ case vertex_shader:
+ if (!global_scope || (var->mode != ir_var_in)) {
+ fail = true;
+ string = "input";
+ }
+ break;
+
+ case geometry_shader:
+ _mesa_glsl_error(loc, state,
+ "geometry shader variables cannot be given "
+ "explicit locations\n");
+ break;
+
+ case fragment_shader:
+ if (!global_scope || (var->mode != ir_var_in)) {
+ fail = true;
+ string = "output";
+ }
+ break;
+ };
+
+ if (fail) {
+ _mesa_glsl_error(loc, state,
+ "only %s shader %s variables can be given an "
+ "explicit location\n",
+ _mesa_glsl_shader_target_name(state->target),
+ string);
+ } else {
+ var->explicit_location = true;
+
+ /* This bit of silliness is needed because invalid explicit locations
+ * are supposed to be flagged during linking. Small negative values
+ * biased by VERT_ATTRIB_GENERIC0 or FRAG_RESULT_DATA0 could alias
+ * built-in values (e.g., -16+VERT_ATTRIB_GENERIC0 = VERT_ATTRIB_POS).
+ * The linker needs to be able to differentiate these cases. This
+ * ensures that negative values stay negative.
+ */
+ if (qual->location >= 0) {
+ var->location = (state->target == vertex_shader)
+ ? (qual->location + VERT_ATTRIB_GENERIC0)
+ : (qual->location + FRAG_RESULT_DATA0);
+ } else {
+ var->location = qual->location;
+ }
+ }
+ }
+
+ /* Does the declaration use the 'layout' keyword?
+ */
+ const bool uses_layout = qual->flags.q.pixel_center_integer
+ || qual->flags.q.origin_upper_left
+ || qual->flags.q.explicit_location;
+
+ /* Does the declaration use the deprecated 'attribute' or 'varying'
+ * keywords?
+ */
+ const bool uses_deprecated_qualifier = qual->flags.q.attribute
+ || qual->flags.q.varying;
+
+ /* Is the 'layout' keyword used with parameters that allow relaxed checking.
+ * Many implementations of GL_ARB_fragment_coord_conventions_enable and some
+ * implementations (only Mesa?) GL_ARB_explicit_attrib_location_enable
+ * allowed the layout qualifier to be used with 'varying' and 'attribute'.
+ * These extensions and all following extensions that add the 'layout'
+ * keyword have been modified to require the use of 'in' or 'out'.
+ *
+ * The following extension do not allow the deprecated keywords:
+ *
+ * GL_AMD_conservative_depth
+ * GL_ARB_gpu_shader5
+ * GL_ARB_separate_shader_objects
+ * GL_ARB_tesselation_shader
+ * GL_ARB_transform_feedback3
+ * GL_ARB_uniform_buffer_object
+ *
+ * It is unknown whether GL_EXT_shader_image_load_store or GL_NV_gpu_shader5
+ * allow layout with the deprecated keywords.
+ */
+ const bool relaxed_layout_qualifier_checking =
+ state->ARB_fragment_coord_conventions_enable;
+
+ if (uses_layout && uses_deprecated_qualifier) {
+ if (relaxed_layout_qualifier_checking) {
+ _mesa_glsl_warning(loc, state,
+ "`layout' qualifier may not be used with "
+ "`attribute' or `varying'");
+ } else {
+ _mesa_glsl_error(loc, state,
+ "`layout' qualifier may not be used with "
+ "`attribute' or `varying'");
+ }
+ }
+
+ /* Layout qualifiers for gl_FragDepth, which are enabled by extension
+ * AMD_conservative_depth.
+ */
+ int depth_layout_count = qual->flags.q.depth_any
+ + qual->flags.q.depth_greater
+ + qual->flags.q.depth_less
+ + qual->flags.q.depth_unchanged;
+ if (depth_layout_count > 0
+ && !state->AMD_conservative_depth_enable) {
+ _mesa_glsl_error(loc, state,
+ "extension GL_AMD_conservative_depth must be enabled "
+ "to use depth layout qualifiers");
+ } else if (depth_layout_count > 0
+ && strcmp(var->name, "gl_FragDepth") != 0) {
+ _mesa_glsl_error(loc, state,
+ "depth layout qualifiers can be applied only to "
+ "gl_FragDepth");
+ } else if (depth_layout_count > 1
+ && strcmp(var->name, "gl_FragDepth") == 0) {
+ _mesa_glsl_error(loc, state,
+ "at most one depth layout qualifier can be applied to "
+ "gl_FragDepth");
+ }
+ if (qual->flags.q.depth_any)
+ var->depth_layout = ir_depth_layout_any;
+ else if (qual->flags.q.depth_greater)
+ var->depth_layout = ir_depth_layout_greater;
+ else if (qual->flags.q.depth_less)
+ var->depth_layout = ir_depth_layout_less;
+ else if (qual->flags.q.depth_unchanged)
+ var->depth_layout = ir_depth_layout_unchanged;
+ else
+ var->depth_layout = ir_depth_layout_none;
+
+ if (var->type->is_array() && state->language_version != 110) {
+ var->array_lvalue = true;
+ }
+}
+
+/**
+ * Get the variable that is being redeclared by this declaration
+ *
+ * Semantic checks to verify the validity of the redeclaration are also
+ * performed. If semantic checks fail, compilation error will be emitted via
+ * \c _mesa_glsl_error, but a non-\c NULL pointer will still be returned.
+ *
+ * \returns
+ * A pointer to an existing variable in the current scope if the declaration
+ * is a redeclaration, \c NULL otherwise.
+ */
+ir_variable *
+get_variable_being_redeclared(ir_variable *var, ast_declaration *decl,
+ struct _mesa_glsl_parse_state *state)
+{
+ /* Check if this declaration is actually a re-declaration, either to
+ * resize an array or add qualifiers to an existing variable.
+ *
+ * This is allowed for variables in the current scope, or when at
+ * global scope (for built-ins in the implicit outer scope).
+ */
+ ir_variable *earlier = state->symbols->get_variable(decl->identifier);
+ if (earlier == NULL ||
+ (state->current_function != NULL &&
+ !state->symbols->name_declared_this_scope(decl->identifier))) {
+ return NULL;
+ }
+
+
+ YYLTYPE loc = decl->get_location();
+
+ /* From page 24 (page 30 of the PDF) of the GLSL 1.50 spec,
+ *
+ * "It is legal to declare an array without a size and then
+ * later re-declare the same name as an array of the same
+ * type and specify a size."
+ */
+ if ((earlier->type->array_size() == 0)
+ && var->type->is_array()
+ && (var->type->element_type() == earlier->type->element_type())) {
+ /* FINISHME: This doesn't match the qualifiers on the two
+ * FINISHME: declarations. It's not 100% clear whether this is
+ * FINISHME: required or not.
+ */
+
+ /* From page 54 (page 60 of the PDF) of the GLSL 1.20 spec:
+ *
+ * "The size [of gl_TexCoord] can be at most
+ * gl_MaxTextureCoords."
+ */
+ const unsigned size = unsigned(var->type->array_size());
+ if ((strcmp("gl_TexCoord", var->name) == 0)
+ && (size > state->Const.MaxTextureCoords)) {
+ _mesa_glsl_error(& loc, state, "`gl_TexCoord' array size cannot "
+ "be larger than gl_MaxTextureCoords (%u)\n",
+ state->Const.MaxTextureCoords);
+ } else if ((size > 0) && (size <= earlier->max_array_access)) {
+ _mesa_glsl_error(& loc, state, "array size must be > %u due to "
+ "previous access",
+ earlier->max_array_access);
+ }
+
+ earlier->type = var->type;
+ delete var;
+ var = NULL;
+ } else if (state->ARB_fragment_coord_conventions_enable
+ && strcmp(var->name, "gl_FragCoord") == 0
+ && earlier->type == var->type
+ && earlier->mode == var->mode) {
+ /* Allow redeclaration of gl_FragCoord for ARB_fcc layout
+ * qualifiers.
+ */
+ earlier->origin_upper_left = var->origin_upper_left;
+ earlier->pixel_center_integer = var->pixel_center_integer;
+
+ /* According to section 4.3.7 of the GLSL 1.30 spec,
+ * the following built-in varaibles can be redeclared with an
+ * interpolation qualifier:
+ * * gl_FrontColor
+ * * gl_BackColor
+ * * gl_FrontSecondaryColor
+ * * gl_BackSecondaryColor
+ * * gl_Color
+ * * gl_SecondaryColor
+ */
+ } else if (state->language_version >= 130
+ && (strcmp(var->name, "gl_FrontColor") == 0
+ || strcmp(var->name, "gl_BackColor") == 0
+ || strcmp(var->name, "gl_FrontSecondaryColor") == 0
+ || strcmp(var->name, "gl_BackSecondaryColor") == 0
+ || strcmp(var->name, "gl_Color") == 0
+ || strcmp(var->name, "gl_SecondaryColor") == 0)
+ && earlier->type == var->type
+ && earlier->mode == var->mode) {
+ earlier->interpolation = var->interpolation;
+
+ /* Layout qualifiers for gl_FragDepth. */
+ } else if (state->AMD_conservative_depth_enable
+ && strcmp(var->name, "gl_FragDepth") == 0
+ && earlier->type == var->type
+ && earlier->mode == var->mode) {
+
+ /** From the AMD_conservative_depth spec:
+ * Within any shader, the first redeclarations of gl_FragDepth
+ * must appear before any use of gl_FragDepth.
+ */
+ if (earlier->used) {
+ _mesa_glsl_error(&loc, state,
+ "the first redeclaration of gl_FragDepth "
+ "must appear before any use of gl_FragDepth");
+ }
+
+ /* Prevent inconsistent redeclaration of depth layout qualifier. */
+ if (earlier->depth_layout != ir_depth_layout_none
+ && earlier->depth_layout != var->depth_layout) {
+ _mesa_glsl_error(&loc, state,
+ "gl_FragDepth: depth layout is declared here "
+ "as '%s, but it was previously declared as "
+ "'%s'",
+ depth_layout_string(var->depth_layout),
+ depth_layout_string(earlier->depth_layout));
+ }
+
+ earlier->depth_layout = var->depth_layout;
+
+ } else {
+ _mesa_glsl_error(&loc, state, "`%s' redeclared", decl->identifier);
+ }
+
+ return earlier;
+}
+
+/**
+ * Generate the IR for an initializer in a variable declaration
+ */
+ir_rvalue *
+process_initializer(ir_variable *var, ast_declaration *decl,
+ ast_fully_specified_type *type,
+ exec_list *initializer_instructions,
+ struct _mesa_glsl_parse_state *state)
+{
+ ir_rvalue *result = NULL;
+
+ YYLTYPE initializer_loc = decl->initializer->get_location();
+
+ /* From page 24 (page 30 of the PDF) of the GLSL 1.10 spec:
+ *
+ * "All uniform variables are read-only and are initialized either
+ * directly by an application via API commands, or indirectly by
+ * OpenGL."
+ */
+ if ((state->language_version <= 110)
+ && (var->mode == ir_var_uniform)) {
+ _mesa_glsl_error(& initializer_loc, state,
+ "cannot initialize uniforms in GLSL 1.10");
+ }
+
+ if (var->type->is_sampler()) {
+ _mesa_glsl_error(& initializer_loc, state,
+ "cannot initialize samplers");
+ }
+
+ if ((var->mode == ir_var_in) && (state->current_function == NULL)) {
+ _mesa_glsl_error(& initializer_loc, state,
+ "cannot initialize %s shader input / %s",
+ _mesa_glsl_shader_target_name(state->target),
+ (state->target == vertex_shader)
+ ? "attribute" : "varying");
+ }
+
+ ir_dereference *const lhs = new(state) ir_dereference_variable(var);
+ ir_rvalue *rhs = decl->initializer->hir(initializer_instructions,
+ state);
+
+ /* Calculate the constant value if this is a const or uniform
+ * declaration.
+ */
+ if (type->qualifier.flags.q.constant
+ || type->qualifier.flags.q.uniform) {
+ ir_rvalue *new_rhs = validate_assignment(state, var->type, rhs, true);
+ if (new_rhs != NULL) {
+ rhs = new_rhs;
+
+ ir_constant *constant_value = rhs->constant_expression_value();
+ if (!constant_value) {
+ _mesa_glsl_error(& initializer_loc, state,
+ "initializer of %s variable `%s' must be a "
+ "constant expression",
+ (type->qualifier.flags.q.constant)
+ ? "const" : "uniform",
+ decl->identifier);
+ if (var->type->is_numeric()) {
+ /* Reduce cascading errors. */
+ var->constant_value = ir_constant::zero(state, var->type);
+ }
+ } else {
+ rhs = constant_value;
+ var->constant_value = constant_value;
+ }
+ } else {
+ _mesa_glsl_error(&initializer_loc, state,
+ "initializer of type %s cannot be assigned to "
+ "variable of type %s",
+ rhs->type->name, var->type->name);
+ if (var->type->is_numeric()) {
+ /* Reduce cascading errors. */
+ var->constant_value = ir_constant::zero(state, var->type);
+ }
+ }
+ }
+
+ if (rhs && !rhs->type->is_error()) {
+ bool temp = var->read_only;
+ if (type->qualifier.flags.q.constant)
+ var->read_only = false;
+
+ /* Never emit code to initialize a uniform.
+ */
+ const glsl_type *initializer_type;
+ if (!type->qualifier.flags.q.uniform) {
+ result = do_assignment(initializer_instructions, state,
+ lhs, rhs, true,
+ type->get_location());
+ initializer_type = result->type;
+ } else
+ initializer_type = rhs->type;
+
+ /* If the declared variable is an unsized array, it must inherrit
+ * its full type from the initializer. A declaration such as
+ *
+ * uniform float a[] = float[](1.0, 2.0, 3.0, 3.0);
+ *
+ * becomes
+ *
+ * uniform float a[4] = float[](1.0, 2.0, 3.0, 3.0);
+ *
+ * The assignment generated in the if-statement (below) will also
+ * automatically handle this case for non-uniforms.
+ *
+ * If the declared variable is not an array, the types must
+ * already match exactly. As a result, the type assignment
+ * here can be done unconditionally. For non-uniforms the call
+ * to do_assignment can change the type of the initializer (via
+ * the implicit conversion rules). For uniforms the initializer
+ * must be a constant expression, and the type of that expression
+ * was validated above.
+ */
+ var->type = initializer_type;
+
+ var->read_only = temp;
+ }
+
+ return result;
+}
+
+ir_rvalue *
+ast_declarator_list::hir(exec_list *instructions,
+ struct _mesa_glsl_parse_state *state)
+{
+ void *ctx = state;
+ const struct glsl_type *decl_type;
+ const char *type_name = NULL;
+ ir_rvalue *result = NULL;
+ YYLTYPE loc = this->get_location();
+
+ /* From page 46 (page 52 of the PDF) of the GLSL 1.50 spec:
+ *
+ * "To ensure that a particular output variable is invariant, it is
+ * necessary to use the invariant qualifier. It can either be used to
+ * qualify a previously declared variable as being invariant
+ *
+ * invariant gl_Position; // make existing gl_Position be invariant"
+ *
+ * In these cases the parser will set the 'invariant' flag in the declarator
+ * list, and the type will be NULL.
+ */
+ if (this->invariant) {
+ assert(this->type == NULL);
+
+ if (state->current_function != NULL) {
+ _mesa_glsl_error(& loc, state,
+ "All uses of `invariant' keyword must be at global "
+ "scope\n");
+ }
+
+ foreach_list_typed (ast_declaration, decl, link, &this->declarations) {
+ assert(!decl->is_array);
+ assert(decl->array_size == NULL);
+ assert(decl->initializer == NULL);
+
+ ir_variable *const earlier =
+ state->symbols->get_variable(decl->identifier);
+ if (earlier == NULL) {
+ _mesa_glsl_error(& loc, state,
+ "Undeclared variable `%s' cannot be marked "
+ "invariant\n", decl->identifier);
+ } else if ((state->target == vertex_shader)
+ && (earlier->mode != ir_var_out)) {
+ _mesa_glsl_error(& loc, state,
+ "`%s' cannot be marked invariant, vertex shader "
+ "outputs only\n", decl->identifier);
+ } else if ((state->target == fragment_shader)
+ && (earlier->mode != ir_var_in)) {
+ _mesa_glsl_error(& loc, state,
+ "`%s' cannot be marked invariant, fragment shader "
+ "inputs only\n", decl->identifier);
+ } else if (earlier->used) {
+ _mesa_glsl_error(& loc, state,
+ "variable `%s' may not be redeclared "
+ "`invariant' after being used",
+ earlier->name);
+ } else {
+ earlier->invariant = true;
+ }
+ }
+
+ /* Invariant redeclarations do not have r-values.
+ */
+ return NULL;
+ }
+
+ assert(this->type != NULL);
+ assert(!this->invariant);
+
+ /* The type specifier may contain a structure definition. Process that
+ * before any of the variable declarations.
+ */
+ (void) this->type->specifier->hir(instructions, state);
+
+ decl_type = this->type->specifier->glsl_type(& type_name, state);
+ if (this->declarations.is_empty()) {
+ /* The only valid case where the declaration list can be empty is when
+ * the declaration is setting the default precision of a built-in type
+ * (e.g., 'precision highp vec4;').
+ */
+
+ if (decl_type != NULL) {
+ } else {
+ _mesa_glsl_error(& loc, state, "incomplete declaration");
+ }
+ }
+
+ foreach_list_typed (ast_declaration, decl, link, &this->declarations) {
+ const struct glsl_type *var_type;
+ ir_variable *var;
+
+ /* FINISHME: Emit a warning if a variable declaration shadows a
+ * FINISHME: declaration at a higher scope.
+ */
+
+ if ((decl_type == NULL) || decl_type->is_void()) {
+ if (type_name != NULL) {
+ _mesa_glsl_error(& loc, state,
+ "invalid type `%s' in declaration of `%s'",
+ type_name, decl->identifier);
+ } else {
+ _mesa_glsl_error(& loc, state,
+ "invalid type in declaration of `%s'",
+ decl->identifier);
+ }
+ continue;
+ }
+
+ if (decl->is_array) {
+ var_type = process_array_type(&loc, decl_type, decl->array_size,
+ state);
+ } else {
+ var_type = decl_type;
+ }
+
+ var = new(ctx) ir_variable(var_type, decl->identifier, ir_var_auto);
+
+ /* From page 22 (page 28 of the PDF) of the GLSL 1.10 specification;
+ *
+ * "Global variables can only use the qualifiers const,
+ * attribute, uni form, or varying. Only one may be
+ * specified.
+ *
+ * Local variables can only use the qualifier const."
+ *
+ * This is relaxed in GLSL 1.30. It is also relaxed by any extension
+ * that adds the 'layout' keyword.
+ */
+ if ((state->language_version < 130)
+ && !state->ARB_explicit_attrib_location_enable
+ && !state->ARB_fragment_coord_conventions_enable) {
+ if (this->type->qualifier.flags.q.out) {
+ _mesa_glsl_error(& loc, state,
+ "`out' qualifier in declaration of `%s' "
+ "only valid for function parameters in %s.",
+ decl->identifier, state->version_string);
+ }
+ if (this->type->qualifier.flags.q.in) {
+ _mesa_glsl_error(& loc, state,
+ "`in' qualifier in declaration of `%s' "
+ "only valid for function parameters in %s.",
+ decl->identifier, state->version_string);
+ }
+ /* FINISHME: Test for other invalid qualifiers. */
+ }
+
+ apply_type_qualifier_to_variable(& this->type->qualifier, var, state,
+ & loc);
+
+ if (this->type->qualifier.flags.q.invariant) {
+ if ((state->target == vertex_shader) && !(var->mode == ir_var_out ||
+ var->mode == ir_var_inout)) {
+ /* FINISHME: Note that this doesn't work for invariant on
+ * a function signature outval
+ */
+ _mesa_glsl_error(& loc, state,
+ "`%s' cannot be marked invariant, vertex shader "
+ "outputs only\n", var->name);
+ } else if ((state->target == fragment_shader) &&
+ !(var->mode == ir_var_in || var->mode == ir_var_inout)) {
+ /* FINISHME: Note that this doesn't work for invariant on
+ * a function signature inval
+ */
+ _mesa_glsl_error(& loc, state,
+ "`%s' cannot be marked invariant, fragment shader "
+ "inputs only\n", var->name);
+ }
+ }
+
+ if (state->current_function != NULL) {
+ const char *mode = NULL;
+ const char *extra = "";
+
+ /* There is no need to check for 'inout' here because the parser will
+ * only allow that in function parameter lists.
+ */
+ if (this->type->qualifier.flags.q.attribute) {
+ mode = "attribute";
+ } else if (this->type->qualifier.flags.q.uniform) {
+ mode = "uniform";
+ } else if (this->type->qualifier.flags.q.varying) {
+ mode = "varying";
+ } else if (this->type->qualifier.flags.q.in) {
+ mode = "in";
+ extra = " or in function parameter list";
+ } else if (this->type->qualifier.flags.q.out) {
+ mode = "out";
+ extra = " or in function parameter list";
+ }
+
+ if (mode) {
+ _mesa_glsl_error(& loc, state,
+ "%s variable `%s' must be declared at "
+ "global scope%s",
+ mode, var->name, extra);
+ }
+ } else if (var->mode == ir_var_in) {
+ var->read_only = true;
+
+ if (state->target == vertex_shader) {
+ bool error_emitted = false;
+
+ /* From page 31 (page 37 of the PDF) of the GLSL 1.50 spec:
+ *
+ * "Vertex shader inputs can only be float, floating-point
+ * vectors, matrices, signed and unsigned integers and integer
+ * vectors. Vertex shader inputs can also form arrays of these
+ * types, but not structures."
+ *
+ * From page 31 (page 27 of the PDF) of the GLSL 1.30 spec:
+ *
+ * "Vertex shader inputs can only be float, floating-point
+ * vectors, matrices, signed and unsigned integers and integer
+ * vectors. They cannot be arrays or structures."
+ *
+ * From page 23 (page 29 of the PDF) of the GLSL 1.20 spec:
+ *
+ * "The attribute qualifier can be used only with float,
+ * floating-point vectors, and matrices. Attribute variables
+ * cannot be declared as arrays or structures."
+ */
+ const glsl_type *check_type = var->type->is_array()
+ ? var->type->fields.array : var->type;
+
+ switch (check_type->base_type) {
+ case GLSL_TYPE_FLOAT:
+ break;
+ case GLSL_TYPE_UINT:
+ case GLSL_TYPE_INT:
+ if (state->language_version > 120)
+ break;
+ /* FALLTHROUGH */
+ default:
+ _mesa_glsl_error(& loc, state,
+ "vertex shader input / attribute cannot have "
+ "type %s`%s'",
+ var->type->is_array() ? "array of " : "",
+ check_type->name);
+ error_emitted = true;
+ }
+
+ if (!error_emitted && (state->language_version <= 130)
+ && var->type->is_array()) {
+ _mesa_glsl_error(& loc, state,
+ "vertex shader input / attribute cannot have "
+ "array type");
+ error_emitted = true;
+ }
+ }
+ }
+
+ /* Integer vertex outputs must be qualified with 'flat'.
+ *
+ * From section 4.3.6 of the GLSL 1.30 spec:
+ * "If a vertex output is a signed or unsigned integer or integer
+ * vector, then it must be qualified with the interpolation qualifier
+ * flat."
+ */
+ if (state->language_version >= 130
+ && state->target == vertex_shader
+ && state->current_function == NULL
+ && var->type->is_integer()
+ && var->mode == ir_var_out
+ && var->interpolation != ir_var_flat) {
+
+ _mesa_glsl_error(&loc, state, "If a vertex output is an integer, "
+ "then it must be qualified with 'flat'");
+ }
+
+
+ /* Interpolation qualifiers cannot be applied to 'centroid' and
+ * 'centroid varying'.
+ *
+ * From page 29 (page 35 of the PDF) of the GLSL 1.30 spec:
+ * "interpolation qualifiers may only precede the qualifiers in,
+ * centroid in, out, or centroid out in a declaration. They do not apply
+ * to the deprecated storage qualifiers varying or centroid varying."
+ */
+ if (state->language_version >= 130
+ && this->type->qualifier.has_interpolation()
+ && this->type->qualifier.flags.q.varying) {
+
+ const char *i = this->type->qualifier.interpolation_string();
+ assert(i != NULL);
+ const char *s;
+ if (this->type->qualifier.flags.q.centroid)
+ s = "centroid varying";
+ else
+ s = "varying";
+
+ _mesa_glsl_error(&loc, state,
+ "qualifier '%s' cannot be applied to the "
+ "deprecated storage qualifier '%s'", i, s);
+ }
+
+
+ /* Interpolation qualifiers can only apply to vertex shader outputs and
+ * fragment shader inputs.
+ *
+ * From page 29 (page 35 of the PDF) of the GLSL 1.30 spec:
+ * "Outputs from a vertex shader (out) and inputs to a fragment
+ * shader (in) can be further qualified with one or more of these
+ * interpolation qualifiers"
+ */
+ if (state->language_version >= 130
+ && this->type->qualifier.has_interpolation()) {
+
+ const char *i = this->type->qualifier.interpolation_string();
+ assert(i != NULL);
+
+ switch (state->target) {
+ case vertex_shader:
+ if (this->type->qualifier.flags.q.in) {
+ _mesa_glsl_error(&loc, state,
+ "qualifier '%s' cannot be applied to vertex "
+ "shader inputs", i);
+ }
+ break;
+ case fragment_shader:
+ if (this->type->qualifier.flags.q.out) {
+ _mesa_glsl_error(&loc, state,
+ "qualifier '%s' cannot be applied to fragment "
+ "shader outputs", i);
+ }
+ break;
+ default:
+ assert(0);
+ }
+ }
+
+
+ /* From section 4.3.4 of the GLSL 1.30 spec:
+ * "It is an error to use centroid in in a vertex shader."
+ */
+ if (state->language_version >= 130
+ && this->type->qualifier.flags.q.centroid
+ && this->type->qualifier.flags.q.in
+ && state->target == vertex_shader) {
+
+ _mesa_glsl_error(&loc, state,
+ "'centroid in' cannot be used in a vertex shader");
+ }
+
+
+ /* Precision qualifiers exists only in GLSL versions 1.00 and >= 1.30.
+ */
+ if (this->type->specifier->precision != ast_precision_none
+ && state->language_version != 100
+ && state->language_version < 130) {
+
+ _mesa_glsl_error(&loc, state,
+ "precision qualifiers are supported only in GLSL ES "
+ "1.00, and GLSL 1.30 and later");
+ }
+
+
+ /* Precision qualifiers only apply to floating point and integer types.
+ *
+ * From section 4.5.2 of the GLSL 1.30 spec:
+ * "Any floating point or any integer declaration can have the type
+ * preceded by one of these precision qualifiers [...] Literal
+ * constants do not have precision qualifiers. Neither do Boolean
+ * variables.
+ *
+ * In GLSL ES, sampler types are also allowed.
+ *
+ * From page 87 of the GLSL ES spec:
+ * "RESOLUTION: Allow sampler types to take a precision qualifier."
+ */
+ if (this->type->specifier->precision != ast_precision_none
+ && !var->type->is_float()
+ && !var->type->is_integer()
+ && !(var->type->is_sampler() && state->es_shader)
+ && !(var->type->is_array()
+ && (var->type->fields.array->is_float()
+ || var->type->fields.array->is_integer()))) {
+
+ _mesa_glsl_error(&loc, state,
+ "precision qualifiers apply only to floating point"
+ "%s types", state->es_shader ? ", integer, and sampler"
+ : "and integer");
+ }
+
+ /* Process the initializer and add its instructions to a temporary
+ * list. This list will be added to the instruction stream (below) after
+ * the declaration is added. This is done because in some cases (such as
+ * redeclarations) the declaration may not actually be added to the
+ * instruction stream.
+ */
+ exec_list initializer_instructions;
+ ir_variable *earlier = get_variable_being_redeclared(var, decl, state);
+
+ if (decl->initializer != NULL) {
+ result = process_initializer((earlier == NULL) ? var : earlier,
+ decl, this->type,
+ &initializer_instructions, state);
+ }
+
+ /* From page 23 (page 29 of the PDF) of the GLSL 1.10 spec:
+ *
+ * "It is an error to write to a const variable outside of
+ * its declaration, so they must be initialized when
+ * declared."
+ */
+ if (this->type->qualifier.flags.q.constant && decl->initializer == NULL) {
+ _mesa_glsl_error(& loc, state,
+ "const declaration of `%s' must be initialized",
+ decl->identifier);
+ }
+
+ /* If the declaration is not a redeclaration, there are a few additional
+ * semantic checks that must be applied. In addition, variable that was
+ * created for the declaration should be added to the IR stream.
+ */
+ if (earlier == NULL) {
+ /* From page 15 (page 21 of the PDF) of the GLSL 1.10 spec,
+ *
+ * "Identifiers starting with "gl_" are reserved for use by
+ * OpenGL, and may not be declared in a shader as either a
+ * variable or a function."
+ */
+ if (strncmp(decl->identifier, "gl_", 3) == 0)
+ _mesa_glsl_error(& loc, state,
+ "identifier `%s' uses reserved `gl_' prefix",
+ decl->identifier);
+
+ /* Add the variable to the symbol table. Note that the initializer's
+ * IR was already processed earlier (though it hasn't been emitted
+ * yet), without the variable in scope.
+ *
+ * This differs from most C-like languages, but it follows the GLSL
+ * specification. From page 28 (page 34 of the PDF) of the GLSL 1.50
+ * spec:
+ *
+ * "Within a declaration, the scope of a name starts immediately
+ * after the initializer if present or immediately after the name
+ * being declared if not."
+ */
+ if (!state->symbols->add_variable(var)) {
+ YYLTYPE loc = this->get_location();
+ _mesa_glsl_error(&loc, state, "name `%s' already taken in the "
+ "current scope", decl->identifier);
+ continue;
+ }
+
+ /* Push the variable declaration to the top. It means that all the
+ * variable declarations will appear in a funny last-to-first order,
+ * but otherwise we run into trouble if a function is prototyped, a
+ * global var is decled, then the function is defined with usage of
+ * the global var. See glslparsertest's CorrectModule.frag.
+ */
+ instructions->push_head(var);
+ }
+
+ instructions->append_list(&initializer_instructions);
+ }
+
+
+ /* Generally, variable declarations do not have r-values. However,
+ * one is used for the declaration in
+ *
+ * while (bool b = some_condition()) {
+ * ...
+ * }
+ *
+ * so we return the rvalue from the last seen declaration here.
+ */
+ return result;
+}
+
+
+ir_rvalue *
+ast_parameter_declarator::hir(exec_list *instructions,
+ struct _mesa_glsl_parse_state *state)
+{
+ void *ctx = state;
+ const struct glsl_type *type;
+ const char *name = NULL;
+ YYLTYPE loc = this->get_location();
+
+ type = this->type->specifier->glsl_type(& name, state);
+
+ if (type == NULL) {
+ if (name != NULL) {
+ _mesa_glsl_error(& loc, state,
+ "invalid type `%s' in declaration of `%s'",
+ name, this->identifier);
+ } else {
+ _mesa_glsl_error(& loc, state,
+ "invalid type in declaration of `%s'",
+ this->identifier);
+ }
+
+ type = glsl_type::error_type;
+ }
+
+ /* From page 62 (page 68 of the PDF) of the GLSL 1.50 spec:
+ *
+ * "Functions that accept no input arguments need not use void in the
+ * argument list because prototypes (or definitions) are required and
+ * therefore there is no ambiguity when an empty argument list "( )" is
+ * declared. The idiom "(void)" as a parameter list is provided for
+ * convenience."
+ *
+ * Placing this check here prevents a void parameter being set up
+ * for a function, which avoids tripping up checks for main taking
+ * parameters and lookups of an unnamed symbol.
+ */
+ if (type->is_void()) {
+ if (this->identifier != NULL)
+ _mesa_glsl_error(& loc, state,
+ "named parameter cannot have type `void'");
+
+ is_void = true;
+ return NULL;
+ }
+
+ if (formal_parameter && (this->identifier == NULL)) {
+ _mesa_glsl_error(& loc, state, "formal parameter lacks a name");
+ return NULL;
+ }
+
+ /* This only handles "vec4 foo[..]". The earlier specifier->glsl_type(...)
+ * call already handled the "vec4[..] foo" case.
+ */
+ if (this->is_array) {
+ type = process_array_type(&loc, type, this->array_size, state);
+ }
+
+ if (type->array_size() == 0) {
+ _mesa_glsl_error(&loc, state, "arrays passed as parameters must have "
+ "a declared size.");
+ type = glsl_type::error_type;
+ }
+
+ is_void = false;
+ ir_variable *var = new(ctx) ir_variable(type, this->identifier, ir_var_in);
+
+ /* Apply any specified qualifiers to the parameter declaration. Note that
+ * for function parameters the default mode is 'in'.
+ */
+ apply_type_qualifier_to_variable(& this->type->qualifier, var, state, & loc);
+
+ instructions->push_tail(var);
+
+ /* Parameter declarations do not have r-values.
+ */
+ return NULL;
+}
+
+
+void
+ast_parameter_declarator::parameters_to_hir(exec_list *ast_parameters,
+ bool formal,
+ exec_list *ir_parameters,
+ _mesa_glsl_parse_state *state)
+{
+ ast_parameter_declarator *void_param = NULL;
+ unsigned count = 0;
+
+ foreach_list_typed (ast_parameter_declarator, param, link, ast_parameters) {
+ param->formal_parameter = formal;
+ param->hir(ir_parameters, state);
+
+ if (param->is_void)
+ void_param = param;
+
+ count++;
+ }
+
+ if ((void_param != NULL) && (count > 1)) {
+ YYLTYPE loc = void_param->get_location();
+
+ _mesa_glsl_error(& loc, state,
+ "`void' parameter must be only parameter");
+ }
+}
+
+
+void
+emit_function(_mesa_glsl_parse_state *state, exec_list *instructions,
+ ir_function *f)
+{
+ /* Emit the new function header */
+ if (state->current_function == NULL) {
+ instructions->push_tail(f);
+ } else {
+ /* IR invariants disallow function declarations or definitions nested
+ * within other function definitions. Insert the new ir_function
+ * block in the instruction sequence before the ir_function block
+ * containing the current ir_function_signature.
+ */
+ ir_function *const curr =
+ const_cast<ir_function *>(state->current_function->function());
+
+ curr->insert_before(f);
+ }
+}
+
+
+ir_rvalue *
+ast_function::hir(exec_list *instructions,
+ struct _mesa_glsl_parse_state *state)
+{
+ void *ctx = state;
+ ir_function *f = NULL;
+ ir_function_signature *sig = NULL;
+ exec_list hir_parameters;
+
+ const char *const name = identifier;
+
+ /* From page 21 (page 27 of the PDF) of the GLSL 1.20 spec,
+ *
+ * "Function declarations (prototypes) cannot occur inside of functions;
+ * they must be at global scope, or for the built-in functions, outside
+ * the global scope."
+ *
+ * From page 27 (page 33 of the PDF) of the GLSL ES 1.00.16 spec,
+ *
+ * "User defined functions may only be defined within the global scope."
+ *
+ * Note that this language does not appear in GLSL 1.10.
+ */
+ if ((state->current_function != NULL) && (state->language_version != 110)) {
+ YYLTYPE loc = this->get_location();
+ _mesa_glsl_error(&loc, state,
+ "declaration of function `%s' not allowed within "
+ "function body", name);
+ }
+
+ /* From page 15 (page 21 of the PDF) of the GLSL 1.10 spec,
+ *
+ * "Identifiers starting with "gl_" are reserved for use by
+ * OpenGL, and may not be declared in a shader as either a
+ * variable or a function."
+ */
+ if (strncmp(name, "gl_", 3) == 0) {
+ YYLTYPE loc = this->get_location();
+ _mesa_glsl_error(&loc, state,
+ "identifier `%s' uses reserved `gl_' prefix", name);
+ }
+
+ /* Convert the list of function parameters to HIR now so that they can be
+ * used below to compare this function's signature with previously seen
+ * signatures for functions with the same name.
+ */
+ ast_parameter_declarator::parameters_to_hir(& this->parameters,
+ is_definition,
+ & hir_parameters, state);
+
+ const char *return_type_name;
+ const glsl_type *return_type =
+ this->return_type->specifier->glsl_type(& return_type_name, state);
+
+ if (!return_type) {
+ YYLTYPE loc = this->get_location();
+ _mesa_glsl_error(&loc, state,
+ "function `%s' has undeclared return type `%s'",
+ name, return_type_name);
+ return_type = glsl_type::error_type;
+ }
+
+ /* From page 56 (page 62 of the PDF) of the GLSL 1.30 spec:
+ * "No qualifier is allowed on the return type of a function."
+ */
+ if (this->return_type->has_qualifiers()) {
+ YYLTYPE loc = this->get_location();
+ _mesa_glsl_error(& loc, state,
+ "function `%s' return type has qualifiers", name);
+ }
+
+ /* Verify that this function's signature either doesn't match a previously
+ * seen signature for a function with the same name, or, if a match is found,
+ * that the previously seen signature does not have an associated definition.
+ */
+ f = state->symbols->get_function(name);
+ if (f != NULL && (state->es_shader || f->has_user_signature())) {
+ sig = f->exact_matching_signature(&hir_parameters);
+ if (sig != NULL) {
+ const char *badvar = sig->qualifiers_match(&hir_parameters);
+ if (badvar != NULL) {
+ YYLTYPE loc = this->get_location();
+
+ _mesa_glsl_error(&loc, state, "function `%s' parameter `%s' "
+ "qualifiers don't match prototype", name, badvar);
+ }
+
+ if (sig->return_type != return_type) {
+ YYLTYPE loc = this->get_location();
+
+ _mesa_glsl_error(&loc, state, "function `%s' return type doesn't "
+ "match prototype", name);
+ }
+
+ if (is_definition && sig->is_defined) {
+ YYLTYPE loc = this->get_location();
+
+ _mesa_glsl_error(& loc, state, "function `%s' redefined", name);
+ }
+ }
+ } else {
+ f = new(ctx) ir_function(name);
+ if (!state->symbols->add_function(f)) {
+ /* This function name shadows a non-function use of the same name. */
+ YYLTYPE loc = this->get_location();
+
+ _mesa_glsl_error(&loc, state, "function name `%s' conflicts with "
+ "non-function", name);
+ return NULL;
+ }
+
+ emit_function(state, instructions, f);
+ }
+
+ /* Verify the return type of main() */
+ if (strcmp(name, "main") == 0) {
+ if (! return_type->is_void()) {
+ YYLTYPE loc = this->get_location();
+
+ _mesa_glsl_error(& loc, state, "main() must return void");
+ }
+
+ if (!hir_parameters.is_empty()) {
+ YYLTYPE loc = this->get_location();
+
+ _mesa_glsl_error(& loc, state, "main() must not take any parameters");
+ }
+ }
+
+ /* Finish storing the information about this new function in its signature.
+ */
+ if (sig == NULL) {
+ sig = new(ctx) ir_function_signature(return_type);
+ f->add_signature(sig);
+ }
+
+ sig->replace_parameters(&hir_parameters);
+ signature = sig;
+
+ /* Function declarations (prototypes) do not have r-values.
+ */
+ return NULL;
+}
+
+
+ir_rvalue *
+ast_function_definition::hir(exec_list *instructions,
+ struct _mesa_glsl_parse_state *state)
+{
+ prototype->is_definition = true;
+ prototype->hir(instructions, state);
+
+ ir_function_signature *signature = prototype->signature;
+ if (signature == NULL)
+ return NULL;
+
+ assert(state->current_function == NULL);
+ state->current_function = signature;
+ state->found_return = false;
+
+ /* Duplicate parameters declared in the prototype as concrete variables.
+ * Add these to the symbol table.
+ */
+ state->symbols->push_scope();
+ foreach_iter(exec_list_iterator, iter, signature->parameters) {
+ ir_variable *const var = ((ir_instruction *) iter.get())->as_variable();
+
+ assert(var != NULL);
+
+ /* The only way a parameter would "exist" is if two parameters have
+ * the same name.
+ */
+ if (state->symbols->name_declared_this_scope(var->name)) {
+ YYLTYPE loc = this->get_location();
+
+ _mesa_glsl_error(& loc, state, "parameter `%s' redeclared", var->name);
+ } else {
+ state->symbols->add_variable(var);
+ }
+ }
+
+ /* Convert the body of the function to HIR. */
+ this->body->hir(&signature->body, state);
+ signature->is_defined = true;
+
+ state->symbols->pop_scope();
+
+ assert(state->current_function == signature);
+ state->current_function = NULL;
+
+ if (!signature->return_type->is_void() && !state->found_return) {
+ YYLTYPE loc = this->get_location();
+ _mesa_glsl_error(& loc, state, "function `%s' has non-void return type "
+ "%s, but no return statement",
+ signature->function_name(),
+ signature->return_type->name);
+ }
+
+ /* Function definitions do not have r-values.
+ */
+ return NULL;
+}
+
+
+ir_rvalue *
+ast_jump_statement::hir(exec_list *instructions,
+ struct _mesa_glsl_parse_state *state)
+{
+ void *ctx = state;
+
+ switch (mode) {
+ case ast_return: {
+ ir_return *inst;
+ assert(state->current_function);
+
+ if (opt_return_value) {
+ ir_rvalue *const ret = opt_return_value->hir(instructions, state);
+
+ /* The value of the return type can be NULL if the shader says
+ * 'return foo();' and foo() is a function that returns void.
+ *
+ * NOTE: The GLSL spec doesn't say that this is an error. The type
+ * of the return value is void. If the return type of the function is
+ * also void, then this should compile without error. Seriously.
+ */
+ const glsl_type *const ret_type =
+ (ret == NULL) ? glsl_type::void_type : ret->type;
+
+ /* Implicit conversions are not allowed for return values. */
+ if (state->current_function->return_type != ret_type) {
+ YYLTYPE loc = this->get_location();
+
+ _mesa_glsl_error(& loc, state,
+ "`return' with wrong type %s, in function `%s' "
+ "returning %s",
+ ret_type->name,
+ state->current_function->function_name(),
+ state->current_function->return_type->name);
+ }
+
+ inst = new(ctx) ir_return(ret);
+ } else {
+ if (state->current_function->return_type->base_type !=
+ GLSL_TYPE_VOID) {
+ YYLTYPE loc = this->get_location();
+
+ _mesa_glsl_error(& loc, state,
+ "`return' with no value, in function %s returning "
+ "non-void",
+ state->current_function->function_name());
+ }
+ inst = new(ctx) ir_return;
+ }
+
+ state->found_return = true;
+ instructions->push_tail(inst);
+ break;
+ }
+
+ case ast_discard:
+ if (state->target != fragment_shader) {
+ YYLTYPE loc = this->get_location();
+
+ _mesa_glsl_error(& loc, state,
+ "`discard' may only appear in a fragment shader");
+ }
+ instructions->push_tail(new(ctx) ir_discard);
+ break;
+
+ case ast_break:
+ case ast_continue:
+ /* FINISHME: Handle switch-statements. They cannot contain 'continue',
+ * FINISHME: and they use a different IR instruction for 'break'.
+ */
+ /* FINISHME: Correctly handle the nesting. If a switch-statement is
+ * FINISHME: inside a loop, a 'continue' is valid and will bind to the
+ * FINISHME: loop.
+ */
+ if (state->loop_or_switch_nesting == NULL) {
+ YYLTYPE loc = this->get_location();
+
+ _mesa_glsl_error(& loc, state,
+ "`%s' may only appear in a loop",
+ (mode == ast_break) ? "break" : "continue");
+ } else {
+ ir_loop *const loop = state->loop_or_switch_nesting->as_loop();
+
+ /* Inline the for loop expression again, since we don't know
+ * where near the end of the loop body the normal copy of it
+ * is going to be placed.
+ */
+ if (mode == ast_continue &&
+ state->loop_or_switch_nesting_ast->rest_expression) {
+ state->loop_or_switch_nesting_ast->rest_expression->hir(instructions,
+ state);
+ }
+
+ if (loop != NULL) {
+ ir_loop_jump *const jump =
+ new(ctx) ir_loop_jump((mode == ast_break)
+ ? ir_loop_jump::jump_break
+ : ir_loop_jump::jump_continue);
+ instructions->push_tail(jump);
+ }
+ }
+
+ break;
+ }
+
+ /* Jump instructions do not have r-values.
+ */
+ return NULL;
+}
+
+
+ir_rvalue *
+ast_selection_statement::hir(exec_list *instructions,
+ struct _mesa_glsl_parse_state *state)
+{
+ void *ctx = state;
+
+ ir_rvalue *const condition = this->condition->hir(instructions, state);
+
+ /* From page 66 (page 72 of the PDF) of the GLSL 1.50 spec:
+ *
+ * "Any expression whose type evaluates to a Boolean can be used as the
+ * conditional expression bool-expression. Vector types are not accepted
+ * as the expression to if."
+ *
+ * The checks are separated so that higher quality diagnostics can be
+ * generated for cases where both rules are violated.
+ */
+ if (!condition->type->is_boolean() || !condition->type->is_scalar()) {
+ YYLTYPE loc = this->condition->get_location();
+
+ _mesa_glsl_error(& loc, state, "if-statement condition must be scalar "
+ "boolean");
+ }
+
+ ir_if *const stmt = new(ctx) ir_if(condition);
+
+ if (then_statement != NULL) {
+ state->symbols->push_scope();
+ then_statement->hir(& stmt->then_instructions, state);
+ state->symbols->pop_scope();
+ }
+
+ if (else_statement != NULL) {
+ state->symbols->push_scope();
+ else_statement->hir(& stmt->else_instructions, state);
+ state->symbols->pop_scope();
+ }
+
+ instructions->push_tail(stmt);
+
+ /* if-statements do not have r-values.
+ */
+ return NULL;
+}
+
+
+void
+ast_iteration_statement::condition_to_hir(ir_loop *stmt,
+ struct _mesa_glsl_parse_state *state)
+{
+ void *ctx = state;
+
+ if (condition != NULL) {
+ ir_rvalue *const cond =
+ condition->hir(& stmt->body_instructions, state);
+
+ if ((cond == NULL)
+ || !cond->type->is_boolean() || !cond->type->is_scalar()) {
+ YYLTYPE loc = condition->get_location();
+
+ _mesa_glsl_error(& loc, state,
+ "loop condition must be scalar boolean");
+ } else {
+ /* As the first code in the loop body, generate a block that looks
+ * like 'if (!condition) break;' as the loop termination condition.
+ */
+ ir_rvalue *const not_cond =
+ new(ctx) ir_expression(ir_unop_logic_not, glsl_type::bool_type, cond,
+ NULL);
+
+ ir_if *const if_stmt = new(ctx) ir_if(not_cond);
+
+ ir_jump *const break_stmt =
+ new(ctx) ir_loop_jump(ir_loop_jump::jump_break);
+
+ if_stmt->then_instructions.push_tail(break_stmt);
+ stmt->body_instructions.push_tail(if_stmt);
+ }
+ }
+}
+
+
+ir_rvalue *
+ast_iteration_statement::hir(exec_list *instructions,
+ struct _mesa_glsl_parse_state *state)
+{
+ void *ctx = state;
+
+ /* For-loops and while-loops start a new scope, but do-while loops do not.
+ */
+ if (mode != ast_do_while)
+ state->symbols->push_scope();
+
+ if (init_statement != NULL)
+ init_statement->hir(instructions, state);
+
+ ir_loop *const stmt = new(ctx) ir_loop();
+ instructions->push_tail(stmt);
+
+ /* Track the current loop and / or switch-statement nesting.
+ */
+ ir_instruction *const nesting = state->loop_or_switch_nesting;
+ ast_iteration_statement *nesting_ast = state->loop_or_switch_nesting_ast;
+
+ state->loop_or_switch_nesting = stmt;
+ state->loop_or_switch_nesting_ast = this;
+
+ if (mode != ast_do_while)
+ condition_to_hir(stmt, state);
+
+ if (body != NULL)
+ body->hir(& stmt->body_instructions, state);
+
+ if (rest_expression != NULL)
+ rest_expression->hir(& stmt->body_instructions, state);
+
+ if (mode == ast_do_while)
+ condition_to_hir(stmt, state);
+
+ if (mode != ast_do_while)
+ state->symbols->pop_scope();
+
+ /* Restore previous nesting before returning.
+ */
+ state->loop_or_switch_nesting = nesting;
+ state->loop_or_switch_nesting_ast = nesting_ast;
+
+ /* Loops do not have r-values.
+ */
+ return NULL;
+}
+
+
+ir_rvalue *
+ast_type_specifier::hir(exec_list *instructions,
+ struct _mesa_glsl_parse_state *state)
+{
+ if (!this->is_precision_statement && this->structure == NULL)
+ return NULL;
+
+ YYLTYPE loc = this->get_location();
+
+ if (this->precision != ast_precision_none
+ && state->language_version != 100
+ && state->language_version < 130) {
+ _mesa_glsl_error(&loc, state,
+ "precision qualifiers exist only in "
+ "GLSL ES 1.00, and GLSL 1.30 and later");
+ return NULL;
+ }
+ if (this->precision != ast_precision_none
+ && this->structure != NULL) {
+ _mesa_glsl_error(&loc, state,
+ "precision qualifiers do not apply to structures");
+ return NULL;
+ }
+
+ /* If this is a precision statement, check that the type to which it is
+ * applied is either float or int.
+ *
+ * From section 4.5.3 of the GLSL 1.30 spec:
+ * "The precision statement
+ * precision precision-qualifier type;
+ * can be used to establish a default precision qualifier. The type
+ * field can be either int or float [...]. Any other types or
+ * qualifiers will result in an error.
+ */
+ if (this->is_precision_statement) {
+ assert(this->precision != ast_precision_none);
+ assert(this->structure == NULL); /* The check for structures was
+ * performed above. */
+ if (this->is_array) {
+ _mesa_glsl_error(&loc, state,
+ "default precision statements do not apply to "
+ "arrays");
+ return NULL;
+ }
+ if (this->type_specifier != ast_float
+ && this->type_specifier != ast_int) {
+ _mesa_glsl_error(&loc, state,
+ "default precision statements apply only to types "
+ "float and int");
+ return NULL;
+ }
+
+ /* FINISHME: Translate precision statements into IR. */
+ return NULL;
+ }
+
+ if (this->structure != NULL)
+ return this->structure->hir(instructions, state);
+
+ return NULL;
+}
+
+
+ir_rvalue *
+ast_struct_specifier::hir(exec_list *instructions,
+ struct _mesa_glsl_parse_state *state)
+{
+ unsigned decl_count = 0;
+
+ /* Make an initial pass over the list of structure fields to determine how
+ * many there are. Each element in this list is an ast_declarator_list.
+ * This means that we actually need to count the number of elements in the
+ * 'declarations' list in each of the elements.
+ */
+ foreach_list_typed (ast_declarator_list, decl_list, link,
+ &this->declarations) {
+ foreach_list_const (decl_ptr, & decl_list->declarations) {
+ decl_count++;
+ }
+ }
+
+ /* Allocate storage for the structure fields and process the field
+ * declarations. As the declarations are processed, try to also convert
+ * the types to HIR. This ensures that structure definitions embedded in
+ * other structure definitions are processed.
+ */
+ glsl_struct_field *const fields = ralloc_array(state, glsl_struct_field,
+ decl_count);
+
+ unsigned i = 0;
+ foreach_list_typed (ast_declarator_list, decl_list, link,
+ &this->declarations) {
+ const char *type_name;
+
+ decl_list->type->specifier->hir(instructions, state);
+
+ /* Section 10.9 of the GLSL ES 1.00 specification states that
+ * embedded structure definitions have been removed from the language.
+ */
+ if (state->es_shader && decl_list->type->specifier->structure != NULL) {
+ YYLTYPE loc = this->get_location();
+ _mesa_glsl_error(&loc, state, "Embedded structure definitions are "
+ "not allowed in GLSL ES 1.00.");
+ }
+
+ const glsl_type *decl_type =
+ decl_list->type->specifier->glsl_type(& type_name, state);
+
+ foreach_list_typed (ast_declaration, decl, link,
+ &decl_list->declarations) {
+ const struct glsl_type *field_type = decl_type;
+ if (decl->is_array) {
+ YYLTYPE loc = decl->get_location();
+ field_type = process_array_type(&loc, decl_type, decl->array_size,
+ state);
+ }
+ fields[i].type = (field_type != NULL)
+ ? field_type : glsl_type::error_type;
+ fields[i].name = decl->identifier;
+ i++;
+ }
+ }
+
+ assert(i == decl_count);
+
+ const glsl_type *t =
+ glsl_type::get_record_instance(fields, decl_count, this->name);
+
+ YYLTYPE loc = this->get_location();
+ if (!state->symbols->add_type(name, t)) {
+ _mesa_glsl_error(& loc, state, "struct `%s' previously defined", name);
+ } else {
+ const glsl_type **s = reralloc(state, state->user_structures,
+ const glsl_type *,
+ state->num_user_structures + 1);
+ if (s != NULL) {
+ s[state->num_user_structures] = t;
+ state->user_structures = s;
+ state->num_user_structures++;
+ }
+ }
+
+ /* Structure type definitions do not have r-values.
+ */
+ return NULL;
+}
diff --git a/mesalib/src/glsl/ast_type.cpp b/mesalib/src/glsl/ast_type.cpp
index c680ae5f6..8e49bef8a 100644
--- a/mesalib/src/glsl/ast_type.cpp
+++ b/mesalib/src/glsl/ast_type.cpp
@@ -1,138 +1,138 @@
-/*
- * Copyright © 2010 Intel Corporation
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-
-#include "ast.h"
-extern "C" {
-#include "program/symbol_table.h"
-}
-
-void
-ast_type_specifier::print(void) const
-{
- if (type_specifier == ast_struct) {
- structure->print();
- } else {
- printf("%s ", type_name);
- }
-
- if (is_array) {
- printf("[ ");
-
- if (array_size) {
- array_size->print();
- }
-
- printf("] ");
- }
-}
-
-ast_type_specifier::ast_type_specifier(int specifier)
- : type_specifier(ast_types(specifier)), type_name(NULL), structure(NULL),
- is_array(false), array_size(NULL), precision(ast_precision_none),
- is_precision_statement(false)
-{
- static const char *const names[] = {
- "void",
- "float",
- "int",
- "uint",
- "bool",
- "vec2",
- "vec3",
- "vec4",
- "bvec2",
- "bvec3",
- "bvec4",
- "ivec2",
- "ivec3",
- "ivec4",
- "uvec2",
- "uvec3",
- "uvec4",
- "mat2",
- "mat2x3",
- "mat2x4",
- "mat3x2",
- "mat3",
- "mat3x4",
- "mat4x2",
- "mat4x3",
- "mat4",
- "sampler1D",
- "sampler2D",
- "sampler2DRect",
- "sampler3D",
- "samplerCube",
- "sampler1DShadow",
- "sampler2DShadow",
- "sampler2DRectShadow",
- "samplerCubeShadow",
- "sampler1DArray",
- "sampler2DArray",
- "sampler1DArrayShadow",
- "sampler2DArrayShadow",
- "isampler1D",
- "isampler2D",
- "isampler3D",
- "isamplerCube",
- "isampler1DArray",
- "isampler2DArray",
- "usampler1D",
- "usampler2D",
- "usampler3D",
- "usamplerCube",
- "usampler1DArray",
- "usampler2DArray",
-
- NULL, /* ast_struct */
- NULL /* ast_type_name */
- };
-
- type_name = names[specifier];
-}
-
-bool
-ast_fully_specified_type::has_qualifiers() const
-{
- return this->qualifier.flags.i != 0;
-}
-
-bool ast_type_qualifier::has_interpolation() const
-{
- return this->flags.q.smooth
- || this->flags.q.flat
- || this->flags.q.noperspective;
-}
-
-const char*
-ast_type_qualifier::interpolation_string() const
-{
- if (this->flags.q.smooth)
- return "smooth";
- else if (this->flags.q.flat)
- return "flat";
- else if (this->flags.q.noperspective)
- return "noperspective";
- else
- return NULL;
-}
+/*
+ * Copyright © 2010 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+#include "ast.h"
+extern "C" {
+#include "program/symbol_table.h"
+}
+
+void
+ast_type_specifier::print(void) const
+{
+ if (type_specifier == ast_struct) {
+ structure->print();
+ } else {
+ printf("%s ", type_name);
+ }
+
+ if (is_array) {
+ printf("[ ");
+
+ if (array_size) {
+ array_size->print();
+ }
+
+ printf("] ");
+ }
+}
+
+ast_type_specifier::ast_type_specifier(int specifier)
+ : type_specifier(ast_types(specifier)), type_name(NULL), structure(NULL),
+ is_array(false), array_size(NULL), precision(ast_precision_none),
+ is_precision_statement(false)
+{
+ static const char *const names[] = {
+ "void",
+ "float",
+ "int",
+ "uint",
+ "bool",
+ "vec2",
+ "vec3",
+ "vec4",
+ "bvec2",
+ "bvec3",
+ "bvec4",
+ "ivec2",
+ "ivec3",
+ "ivec4",
+ "uvec2",
+ "uvec3",
+ "uvec4",
+ "mat2",
+ "mat2x3",
+ "mat2x4",
+ "mat3x2",
+ "mat3",
+ "mat3x4",
+ "mat4x2",
+ "mat4x3",
+ "mat4",
+ "sampler1D",
+ "sampler2D",
+ "sampler2DRect",
+ "sampler3D",
+ "samplerCube",
+ "sampler1DShadow",
+ "sampler2DShadow",
+ "sampler2DRectShadow",
+ "samplerCubeShadow",
+ "sampler1DArray",
+ "sampler2DArray",
+ "sampler1DArrayShadow",
+ "sampler2DArrayShadow",
+ "isampler1D",
+ "isampler2D",
+ "isampler3D",
+ "isamplerCube",
+ "isampler1DArray",
+ "isampler2DArray",
+ "usampler1D",
+ "usampler2D",
+ "usampler3D",
+ "usamplerCube",
+ "usampler1DArray",
+ "usampler2DArray",
+
+ NULL, /* ast_struct */
+ NULL /* ast_type_name */
+ };
+
+ type_name = names[specifier];
+}
+
+bool
+ast_fully_specified_type::has_qualifiers() const
+{
+ return this->qualifier.flags.i != 0;
+}
+
+bool ast_type_qualifier::has_interpolation() const
+{
+ return this->flags.q.smooth
+ || this->flags.q.flat
+ || this->flags.q.noperspective;
+}
+
+const char*
+ast_type_qualifier::interpolation_string() const
+{
+ if (this->flags.q.smooth)
+ return "smooth";
+ else if (this->flags.q.flat)
+ return "flat";
+ else if (this->flags.q.noperspective)
+ return "noperspective";
+ else
+ return NULL;
+}
diff --git a/mesalib/src/glsl/builtin_types.h b/mesalib/src/glsl/builtin_types.h
index 58b9a8127..6b98419ae 100644
--- a/mesalib/src/glsl/builtin_types.h
+++ b/mesalib/src/glsl/builtin_types.h
@@ -1,302 +1,302 @@
-/*
- * Copyright © 2009 Intel Corporation
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-
-const glsl_type glsl_type::_error_type =
- glsl_type(GL_INVALID_ENUM, GLSL_TYPE_ERROR, 0, 0, "");
-
-const glsl_type glsl_type::_void_type =
- glsl_type(GL_INVALID_ENUM, GLSL_TYPE_VOID, 0, 0, "void");
-
-const glsl_type glsl_type::_sampler3D_type =
- glsl_type(GL_SAMPLER_3D, GLSL_SAMPLER_DIM_3D, 0, 0, GLSL_TYPE_FLOAT,
- "sampler3D");
-
-const glsl_type *const glsl_type::error_type = & glsl_type::_error_type;
-const glsl_type *const glsl_type::void_type = & glsl_type::_void_type;
-
-/** \name Core built-in types
- *
- * These types exist in all versions of GLSL.
- */
-/*@{*/
-
-const glsl_type glsl_type::builtin_core_types[] = {
- glsl_type(GL_BOOL, GLSL_TYPE_BOOL, 1, 1, "bool"),
- glsl_type(GL_BOOL_VEC2, GLSL_TYPE_BOOL, 2, 1, "bvec2"),
- glsl_type(GL_BOOL_VEC3, GLSL_TYPE_BOOL, 3, 1, "bvec3"),
- glsl_type(GL_BOOL_VEC4, GLSL_TYPE_BOOL, 4, 1, "bvec4"),
- glsl_type(GL_INT, GLSL_TYPE_INT, 1, 1, "int"),
- glsl_type(GL_INT_VEC2, GLSL_TYPE_INT, 2, 1, "ivec2"),
- glsl_type(GL_INT_VEC3, GLSL_TYPE_INT, 3, 1, "ivec3"),
- glsl_type(GL_INT_VEC4, GLSL_TYPE_INT, 4, 1, "ivec4"),
- glsl_type(GL_FLOAT, GLSL_TYPE_FLOAT, 1, 1, "float"),
- glsl_type(GL_FLOAT_VEC2, GLSL_TYPE_FLOAT, 2, 1, "vec2"),
- glsl_type(GL_FLOAT_VEC3, GLSL_TYPE_FLOAT, 3, 1, "vec3"),
- glsl_type(GL_FLOAT_VEC4, GLSL_TYPE_FLOAT, 4, 1, "vec4"),
- glsl_type(GL_FLOAT_MAT2, GLSL_TYPE_FLOAT, 2, 2, "mat2"),
- glsl_type(GL_FLOAT_MAT3, GLSL_TYPE_FLOAT, 3, 3, "mat3"),
- glsl_type(GL_FLOAT_MAT4, GLSL_TYPE_FLOAT, 4, 4, "mat4"),
- glsl_type(GL_SAMPLER_2D, GLSL_SAMPLER_DIM_2D, 0, 0, GLSL_TYPE_FLOAT,
- "sampler2D"),
- glsl_type(GL_SAMPLER_CUBE, GLSL_SAMPLER_DIM_CUBE, 0, 0, GLSL_TYPE_FLOAT,
- "samplerCube"),
-};
-
-const glsl_type *const glsl_type::bool_type = & builtin_core_types[0];
-const glsl_type *const glsl_type::int_type = & builtin_core_types[4];
-const glsl_type *const glsl_type::ivec4_type = & builtin_core_types[7];
-const glsl_type *const glsl_type::float_type = & builtin_core_types[8];
-const glsl_type *const glsl_type::vec2_type = & builtin_core_types[9];
-const glsl_type *const glsl_type::vec3_type = & builtin_core_types[10];
-const glsl_type *const glsl_type::vec4_type = & builtin_core_types[11];
-const glsl_type *const glsl_type::mat2_type = & builtin_core_types[12];
-const glsl_type *const glsl_type::mat3_type = & builtin_core_types[13];
-const glsl_type *const glsl_type::mat4_type = & builtin_core_types[14];
-/*@}*/
-
-/** \name GLSL structures that have not been deprecated.
- */
-/*@{*/
-
-static const struct glsl_struct_field gl_DepthRangeParameters_fields[] = {
- { glsl_type::float_type, "near" },
- { glsl_type::float_type, "far" },
- { glsl_type::float_type, "diff" },
-};
-
-const glsl_type glsl_type::builtin_structure_types[] = {
- glsl_type(gl_DepthRangeParameters_fields,
- Elements(gl_DepthRangeParameters_fields),
- "gl_DepthRangeParameters"),
-};
-/*@}*/
-
-/** \name GLSL 1.00 / 1.10 structures that are deprecated in GLSL 1.30
- */
-/*@{*/
-
-static const struct glsl_struct_field gl_PointParameters_fields[] = {
- { glsl_type::float_type, "size" },
- { glsl_type::float_type, "sizeMin" },
- { glsl_type::float_type, "sizeMax" },
- { glsl_type::float_type, "fadeThresholdSize" },
- { glsl_type::float_type, "distanceConstantAttenuation" },
- { glsl_type::float_type, "distanceLinearAttenuation" },
- { glsl_type::float_type, "distanceQuadraticAttenuation" },
-};
-
-static const struct glsl_struct_field gl_MaterialParameters_fields[] = {
- { glsl_type::vec4_type, "emission" },
- { glsl_type::vec4_type, "ambient" },
- { glsl_type::vec4_type, "diffuse" },
- { glsl_type::vec4_type, "specular" },
- { glsl_type::float_type, "shininess" },
-};
-
-static const struct glsl_struct_field gl_LightSourceParameters_fields[] = {
- { glsl_type::vec4_type, "ambient" },
- { glsl_type::vec4_type, "diffuse" },
- { glsl_type::vec4_type, "specular" },
- { glsl_type::vec4_type, "position" },
- { glsl_type::vec4_type, "halfVector" },
- { glsl_type::vec3_type, "spotDirection" },
- { glsl_type::float_type, "spotExponent" },
- { glsl_type::float_type, "spotCutoff" },
- { glsl_type::float_type, "spotCosCutoff" },
- { glsl_type::float_type, "constantAttenuation" },
- { glsl_type::float_type, "linearAttenuation" },
- { glsl_type::float_type, "quadraticAttenuation" },
-};
-
-static const struct glsl_struct_field gl_LightModelParameters_fields[] = {
- { glsl_type::vec4_type, "ambient" },
-};
-
-static const struct glsl_struct_field gl_LightModelProducts_fields[] = {
- { glsl_type::vec4_type, "sceneColor" },
-};
-
-static const struct glsl_struct_field gl_LightProducts_fields[] = {
- { glsl_type::vec4_type, "ambient" },
- { glsl_type::vec4_type, "diffuse" },
- { glsl_type::vec4_type, "specular" },
-};
-
-static const struct glsl_struct_field gl_FogParameters_fields[] = {
- { glsl_type::vec4_type, "color" },
- { glsl_type::float_type, "density" },
- { glsl_type::float_type, "start" },
- { glsl_type::float_type, "end" },
- { glsl_type::float_type, "scale" },
-};
-
-const glsl_type glsl_type::builtin_110_deprecated_structure_types[] = {
- glsl_type(gl_PointParameters_fields,
- Elements(gl_PointParameters_fields),
- "gl_PointParameters"),
- glsl_type(gl_MaterialParameters_fields,
- Elements(gl_MaterialParameters_fields),
- "gl_MaterialParameters"),
- glsl_type(gl_LightSourceParameters_fields,
- Elements(gl_LightSourceParameters_fields),
- "gl_LightSourceParameters"),
- glsl_type(gl_LightModelParameters_fields,
- Elements(gl_LightModelParameters_fields),
- "gl_LightModelParameters"),
- glsl_type(gl_LightModelProducts_fields,
- Elements(gl_LightModelProducts_fields),
- "gl_LightModelProducts"),
- glsl_type(gl_LightProducts_fields,
- Elements(gl_LightProducts_fields),
- "gl_LightProducts"),
- glsl_type(gl_FogParameters_fields,
- Elements(gl_FogParameters_fields),
- "gl_FogParameters"),
-};
-/*@}*/
-
-/** \name Types in GLSL 1.10 (but not GLSL ES 1.00)
- */
-/*@{*/
-const glsl_type glsl_type::builtin_110_types[] = {
- glsl_type(GL_SAMPLER_1D, GLSL_SAMPLER_DIM_1D, 0, 0, GLSL_TYPE_FLOAT,
- "sampler1D"),
- glsl_type(GL_SAMPLER_1D_SHADOW, GLSL_SAMPLER_DIM_1D, 1, 0, GLSL_TYPE_FLOAT,
- "sampler1DShadow"),
- glsl_type(GL_SAMPLER_2D_SHADOW, GLSL_SAMPLER_DIM_2D, 1, 0, GLSL_TYPE_FLOAT,
- "sampler2DShadow"),
-};
-/*@}*/
-
-/** \name Types added in GLSL 1.20
- */
-/*@{*/
-
-const glsl_type glsl_type::builtin_120_types[] = {
- glsl_type(GL_FLOAT_MAT2x3, GLSL_TYPE_FLOAT, 3, 2, "mat2x3"),
- glsl_type(GL_FLOAT_MAT2x4, GLSL_TYPE_FLOAT, 4, 2, "mat2x4"),
- glsl_type(GL_FLOAT_MAT3x2, GLSL_TYPE_FLOAT, 2, 3, "mat3x2"),
- glsl_type(GL_FLOAT_MAT3x4, GLSL_TYPE_FLOAT, 4, 3, "mat3x4"),
- glsl_type(GL_FLOAT_MAT4x2, GLSL_TYPE_FLOAT, 2, 4, "mat4x2"),
- glsl_type(GL_FLOAT_MAT4x3, GLSL_TYPE_FLOAT, 3, 4, "mat4x3"),
-};
-const glsl_type *const glsl_type::mat2x3_type = & builtin_120_types[0];
-const glsl_type *const glsl_type::mat2x4_type = & builtin_120_types[1];
-const glsl_type *const glsl_type::mat3x2_type = & builtin_120_types[2];
-const glsl_type *const glsl_type::mat3x4_type = & builtin_120_types[3];
-const glsl_type *const glsl_type::mat4x2_type = & builtin_120_types[4];
-const glsl_type *const glsl_type::mat4x3_type = & builtin_120_types[5];
-/*@}*/
-
-/** \name Types added in GLSL 1.30
- */
-/*@{*/
-
-const glsl_type glsl_type::builtin_130_types[] = {
- glsl_type(GL_UNSIGNED_INT, GLSL_TYPE_UINT, 1, 1, "uint"),
- glsl_type(GL_UNSIGNED_INT_VEC2, GLSL_TYPE_UINT, 2, 1, "uvec2"),
- glsl_type(GL_UNSIGNED_INT_VEC3, GLSL_TYPE_UINT, 3, 1, "uvec3"),
- glsl_type(GL_UNSIGNED_INT_VEC4, GLSL_TYPE_UINT, 4, 1, "uvec4"),
-
- /* 1D and 2D texture arrays - several of these are included only in
- * builtin_EXT_texture_array_types.
- */
- glsl_type(GL_INT_SAMPLER_1D_ARRAY,
- GLSL_SAMPLER_DIM_1D, 0, 1, GLSL_TYPE_INT, "isampler1DArray"),
- glsl_type(GL_UNSIGNED_INT_SAMPLER_1D_ARRAY,
- GLSL_SAMPLER_DIM_1D, 0, 1, GLSL_TYPE_UINT, "usampler1DArray"),
- glsl_type(GL_INT_SAMPLER_2D_ARRAY,
- GLSL_SAMPLER_DIM_2D, 0, 1, GLSL_TYPE_INT, "isampler2DArray"),
- glsl_type(GL_UNSIGNED_INT_SAMPLER_2D_ARRAY,
- GLSL_SAMPLER_DIM_2D, 0, 1, GLSL_TYPE_UINT, "usampler2DArray"),
-
- /* cube shadow samplers */
- glsl_type(GL_SAMPLER_CUBE_SHADOW,
- GLSL_SAMPLER_DIM_CUBE, 1, 0, GLSL_TYPE_FLOAT, "samplerCubeShadow"),
-
- /* signed and unsigned integer samplers */
- glsl_type(GL_INT_SAMPLER_1D,
- GLSL_SAMPLER_DIM_1D, 0, 0, GLSL_TYPE_INT, "isampler1D"),
- glsl_type(GL_UNSIGNED_INT_SAMPLER_1D,
- GLSL_SAMPLER_DIM_1D, 0, 0, GLSL_TYPE_UINT, "usampler1D"),
- glsl_type(GL_INT_SAMPLER_2D,
- GLSL_SAMPLER_DIM_2D, 0, 0, GLSL_TYPE_INT, "isampler2D"),
- glsl_type(GL_UNSIGNED_INT_SAMPLER_2D,
- GLSL_SAMPLER_DIM_2D, 0, 0, GLSL_TYPE_UINT, "usampler2D"),
- glsl_type(GL_INT_SAMPLER_3D,
- GLSL_SAMPLER_DIM_3D, 0, 0, GLSL_TYPE_INT, "isampler3D"),
- glsl_type(GL_UNSIGNED_INT_SAMPLER_3D,
- GLSL_SAMPLER_DIM_3D, 0, 0, GLSL_TYPE_UINT, "usampler3D"),
- glsl_type(GL_INT_SAMPLER_CUBE,
- GLSL_SAMPLER_DIM_CUBE, 0, 0, GLSL_TYPE_INT, "isamplerCube"),
- glsl_type(GL_INT_SAMPLER_CUBE,
- GLSL_SAMPLER_DIM_CUBE, 0, 0, GLSL_TYPE_UINT, "usamplerCube"),
-};
-
-const glsl_type *const glsl_type::uint_type = & builtin_130_types[0];
-const glsl_type *const glsl_type::uvec2_type = & builtin_130_types[1];
-const glsl_type *const glsl_type::uvec3_type = & builtin_130_types[2];
-const glsl_type *const glsl_type::uvec4_type = & builtin_130_types[3];
-/*@}*/
-
-/** \name Sampler types added by GL_ARB_texture_rectangle
- */
-/*@{*/
-
-const glsl_type glsl_type::builtin_ARB_texture_rectangle_types[] = {
- glsl_type(GL_SAMPLER_2D_RECT,
- GLSL_SAMPLER_DIM_RECT, 0, 0, GLSL_TYPE_FLOAT, "sampler2DRect"),
- glsl_type(GL_SAMPLER_2D_RECT_SHADOW,
- GLSL_SAMPLER_DIM_RECT, 1, 0, GLSL_TYPE_FLOAT, "sampler2DRectShadow"),
-};
-/*@}*/
-
-/** \name Sampler types added by GL_EXT_texture_array
- */
-/*@{*/
-
-const glsl_type glsl_type::builtin_EXT_texture_array_types[] = {
- glsl_type(GL_SAMPLER_1D_ARRAY,
- GLSL_SAMPLER_DIM_1D, 0, 1, GLSL_TYPE_FLOAT, "sampler1DArray"),
- glsl_type(GL_SAMPLER_2D_ARRAY,
- GLSL_SAMPLER_DIM_2D, 0, 1, GLSL_TYPE_FLOAT, "sampler2DArray"),
- glsl_type(GL_SAMPLER_1D_ARRAY_SHADOW,
- GLSL_SAMPLER_DIM_1D, 1, 1, GLSL_TYPE_FLOAT, "sampler1DArrayShadow"),
- glsl_type(GL_SAMPLER_2D_ARRAY_SHADOW,
- GLSL_SAMPLER_DIM_2D, 1, 1, GLSL_TYPE_FLOAT, "sampler2DArrayShadow"),
-};
-/*@}*/
-
-/** \name Sampler types added by GL_EXT_texture_buffer_object
- */
-/*@{*/
-
-const glsl_type glsl_type::builtin_EXT_texture_buffer_object_types[] = {
- glsl_type(GL_SAMPLER_BUFFER,
- GLSL_SAMPLER_DIM_BUF, 0, 0, GLSL_TYPE_FLOAT, "samplerBuffer"),
- glsl_type(GL_INT_SAMPLER_BUFFER,
- GLSL_SAMPLER_DIM_BUF, 0, 0, GLSL_TYPE_INT, "isamplerBuffer"),
- glsl_type(GL_UNSIGNED_INT_SAMPLER_BUFFER,
- GLSL_SAMPLER_DIM_BUF, 0, 0, GLSL_TYPE_UINT, "usamplerBuffer"),
-};
-/*@}*/
+/*
+ * Copyright © 2009 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+const glsl_type glsl_type::_error_type =
+ glsl_type(GL_INVALID_ENUM, GLSL_TYPE_ERROR, 0, 0, "");
+
+const glsl_type glsl_type::_void_type =
+ glsl_type(GL_INVALID_ENUM, GLSL_TYPE_VOID, 0, 0, "void");
+
+const glsl_type glsl_type::_sampler3D_type =
+ glsl_type(GL_SAMPLER_3D, GLSL_SAMPLER_DIM_3D, 0, 0, GLSL_TYPE_FLOAT,
+ "sampler3D");
+
+const glsl_type *const glsl_type::error_type = & glsl_type::_error_type;
+const glsl_type *const glsl_type::void_type = & glsl_type::_void_type;
+
+/** \name Core built-in types
+ *
+ * These types exist in all versions of GLSL.
+ */
+/*@{*/
+
+const glsl_type glsl_type::builtin_core_types[] = {
+ glsl_type(GL_BOOL, GLSL_TYPE_BOOL, 1, 1, "bool"),
+ glsl_type(GL_BOOL_VEC2, GLSL_TYPE_BOOL, 2, 1, "bvec2"),
+ glsl_type(GL_BOOL_VEC3, GLSL_TYPE_BOOL, 3, 1, "bvec3"),
+ glsl_type(GL_BOOL_VEC4, GLSL_TYPE_BOOL, 4, 1, "bvec4"),
+ glsl_type(GL_INT, GLSL_TYPE_INT, 1, 1, "int"),
+ glsl_type(GL_INT_VEC2, GLSL_TYPE_INT, 2, 1, "ivec2"),
+ glsl_type(GL_INT_VEC3, GLSL_TYPE_INT, 3, 1, "ivec3"),
+ glsl_type(GL_INT_VEC4, GLSL_TYPE_INT, 4, 1, "ivec4"),
+ glsl_type(GL_FLOAT, GLSL_TYPE_FLOAT, 1, 1, "float"),
+ glsl_type(GL_FLOAT_VEC2, GLSL_TYPE_FLOAT, 2, 1, "vec2"),
+ glsl_type(GL_FLOAT_VEC3, GLSL_TYPE_FLOAT, 3, 1, "vec3"),
+ glsl_type(GL_FLOAT_VEC4, GLSL_TYPE_FLOAT, 4, 1, "vec4"),
+ glsl_type(GL_FLOAT_MAT2, GLSL_TYPE_FLOAT, 2, 2, "mat2"),
+ glsl_type(GL_FLOAT_MAT3, GLSL_TYPE_FLOAT, 3, 3, "mat3"),
+ glsl_type(GL_FLOAT_MAT4, GLSL_TYPE_FLOAT, 4, 4, "mat4"),
+ glsl_type(GL_SAMPLER_2D, GLSL_SAMPLER_DIM_2D, 0, 0, GLSL_TYPE_FLOAT,
+ "sampler2D"),
+ glsl_type(GL_SAMPLER_CUBE, GLSL_SAMPLER_DIM_CUBE, 0, 0, GLSL_TYPE_FLOAT,
+ "samplerCube"),
+};
+
+const glsl_type *const glsl_type::bool_type = & builtin_core_types[0];
+const glsl_type *const glsl_type::int_type = & builtin_core_types[4];
+const glsl_type *const glsl_type::ivec4_type = & builtin_core_types[7];
+const glsl_type *const glsl_type::float_type = & builtin_core_types[8];
+const glsl_type *const glsl_type::vec2_type = & builtin_core_types[9];
+const glsl_type *const glsl_type::vec3_type = & builtin_core_types[10];
+const glsl_type *const glsl_type::vec4_type = & builtin_core_types[11];
+const glsl_type *const glsl_type::mat2_type = & builtin_core_types[12];
+const glsl_type *const glsl_type::mat3_type = & builtin_core_types[13];
+const glsl_type *const glsl_type::mat4_type = & builtin_core_types[14];
+/*@}*/
+
+/** \name GLSL structures that have not been deprecated.
+ */
+/*@{*/
+
+static const struct glsl_struct_field gl_DepthRangeParameters_fields[] = {
+ { glsl_type::float_type, "near" },
+ { glsl_type::float_type, "far" },
+ { glsl_type::float_type, "diff" },
+};
+
+const glsl_type glsl_type::builtin_structure_types[] = {
+ glsl_type(gl_DepthRangeParameters_fields,
+ Elements(gl_DepthRangeParameters_fields),
+ "gl_DepthRangeParameters"),
+};
+/*@}*/
+
+/** \name GLSL 1.00 / 1.10 structures that are deprecated in GLSL 1.30
+ */
+/*@{*/
+
+static const struct glsl_struct_field gl_PointParameters_fields[] = {
+ { glsl_type::float_type, "size" },
+ { glsl_type::float_type, "sizeMin" },
+ { glsl_type::float_type, "sizeMax" },
+ { glsl_type::float_type, "fadeThresholdSize" },
+ { glsl_type::float_type, "distanceConstantAttenuation" },
+ { glsl_type::float_type, "distanceLinearAttenuation" },
+ { glsl_type::float_type, "distanceQuadraticAttenuation" },
+};
+
+static const struct glsl_struct_field gl_MaterialParameters_fields[] = {
+ { glsl_type::vec4_type, "emission" },
+ { glsl_type::vec4_type, "ambient" },
+ { glsl_type::vec4_type, "diffuse" },
+ { glsl_type::vec4_type, "specular" },
+ { glsl_type::float_type, "shininess" },
+};
+
+static const struct glsl_struct_field gl_LightSourceParameters_fields[] = {
+ { glsl_type::vec4_type, "ambient" },
+ { glsl_type::vec4_type, "diffuse" },
+ { glsl_type::vec4_type, "specular" },
+ { glsl_type::vec4_type, "position" },
+ { glsl_type::vec4_type, "halfVector" },
+ { glsl_type::vec3_type, "spotDirection" },
+ { glsl_type::float_type, "spotExponent" },
+ { glsl_type::float_type, "spotCutoff" },
+ { glsl_type::float_type, "spotCosCutoff" },
+ { glsl_type::float_type, "constantAttenuation" },
+ { glsl_type::float_type, "linearAttenuation" },
+ { glsl_type::float_type, "quadraticAttenuation" },
+};
+
+static const struct glsl_struct_field gl_LightModelParameters_fields[] = {
+ { glsl_type::vec4_type, "ambient" },
+};
+
+static const struct glsl_struct_field gl_LightModelProducts_fields[] = {
+ { glsl_type::vec4_type, "sceneColor" },
+};
+
+static const struct glsl_struct_field gl_LightProducts_fields[] = {
+ { glsl_type::vec4_type, "ambient" },
+ { glsl_type::vec4_type, "diffuse" },
+ { glsl_type::vec4_type, "specular" },
+};
+
+static const struct glsl_struct_field gl_FogParameters_fields[] = {
+ { glsl_type::vec4_type, "color" },
+ { glsl_type::float_type, "density" },
+ { glsl_type::float_type, "start" },
+ { glsl_type::float_type, "end" },
+ { glsl_type::float_type, "scale" },
+};
+
+const glsl_type glsl_type::builtin_110_deprecated_structure_types[] = {
+ glsl_type(gl_PointParameters_fields,
+ Elements(gl_PointParameters_fields),
+ "gl_PointParameters"),
+ glsl_type(gl_MaterialParameters_fields,
+ Elements(gl_MaterialParameters_fields),
+ "gl_MaterialParameters"),
+ glsl_type(gl_LightSourceParameters_fields,
+ Elements(gl_LightSourceParameters_fields),
+ "gl_LightSourceParameters"),
+ glsl_type(gl_LightModelParameters_fields,
+ Elements(gl_LightModelParameters_fields),
+ "gl_LightModelParameters"),
+ glsl_type(gl_LightModelProducts_fields,
+ Elements(gl_LightModelProducts_fields),
+ "gl_LightModelProducts"),
+ glsl_type(gl_LightProducts_fields,
+ Elements(gl_LightProducts_fields),
+ "gl_LightProducts"),
+ glsl_type(gl_FogParameters_fields,
+ Elements(gl_FogParameters_fields),
+ "gl_FogParameters"),
+};
+/*@}*/
+
+/** \name Types in GLSL 1.10 (but not GLSL ES 1.00)
+ */
+/*@{*/
+const glsl_type glsl_type::builtin_110_types[] = {
+ glsl_type(GL_SAMPLER_1D, GLSL_SAMPLER_DIM_1D, 0, 0, GLSL_TYPE_FLOAT,
+ "sampler1D"),
+ glsl_type(GL_SAMPLER_1D_SHADOW, GLSL_SAMPLER_DIM_1D, 1, 0, GLSL_TYPE_FLOAT,
+ "sampler1DShadow"),
+ glsl_type(GL_SAMPLER_2D_SHADOW, GLSL_SAMPLER_DIM_2D, 1, 0, GLSL_TYPE_FLOAT,
+ "sampler2DShadow"),
+};
+/*@}*/
+
+/** \name Types added in GLSL 1.20
+ */
+/*@{*/
+
+const glsl_type glsl_type::builtin_120_types[] = {
+ glsl_type(GL_FLOAT_MAT2x3, GLSL_TYPE_FLOAT, 3, 2, "mat2x3"),
+ glsl_type(GL_FLOAT_MAT2x4, GLSL_TYPE_FLOAT, 4, 2, "mat2x4"),
+ glsl_type(GL_FLOAT_MAT3x2, GLSL_TYPE_FLOAT, 2, 3, "mat3x2"),
+ glsl_type(GL_FLOAT_MAT3x4, GLSL_TYPE_FLOAT, 4, 3, "mat3x4"),
+ glsl_type(GL_FLOAT_MAT4x2, GLSL_TYPE_FLOAT, 2, 4, "mat4x2"),
+ glsl_type(GL_FLOAT_MAT4x3, GLSL_TYPE_FLOAT, 3, 4, "mat4x3"),
+};
+const glsl_type *const glsl_type::mat2x3_type = & builtin_120_types[0];
+const glsl_type *const glsl_type::mat2x4_type = & builtin_120_types[1];
+const glsl_type *const glsl_type::mat3x2_type = & builtin_120_types[2];
+const glsl_type *const glsl_type::mat3x4_type = & builtin_120_types[3];
+const glsl_type *const glsl_type::mat4x2_type = & builtin_120_types[4];
+const glsl_type *const glsl_type::mat4x3_type = & builtin_120_types[5];
+/*@}*/
+
+/** \name Types added in GLSL 1.30
+ */
+/*@{*/
+
+const glsl_type glsl_type::builtin_130_types[] = {
+ glsl_type(GL_UNSIGNED_INT, GLSL_TYPE_UINT, 1, 1, "uint"),
+ glsl_type(GL_UNSIGNED_INT_VEC2, GLSL_TYPE_UINT, 2, 1, "uvec2"),
+ glsl_type(GL_UNSIGNED_INT_VEC3, GLSL_TYPE_UINT, 3, 1, "uvec3"),
+ glsl_type(GL_UNSIGNED_INT_VEC4, GLSL_TYPE_UINT, 4, 1, "uvec4"),
+
+ /* 1D and 2D texture arrays - several of these are included only in
+ * builtin_EXT_texture_array_types.
+ */
+ glsl_type(GL_INT_SAMPLER_1D_ARRAY,
+ GLSL_SAMPLER_DIM_1D, 0, 1, GLSL_TYPE_INT, "isampler1DArray"),
+ glsl_type(GL_UNSIGNED_INT_SAMPLER_1D_ARRAY,
+ GLSL_SAMPLER_DIM_1D, 0, 1, GLSL_TYPE_UINT, "usampler1DArray"),
+ glsl_type(GL_INT_SAMPLER_2D_ARRAY,
+ GLSL_SAMPLER_DIM_2D, 0, 1, GLSL_TYPE_INT, "isampler2DArray"),
+ glsl_type(GL_UNSIGNED_INT_SAMPLER_2D_ARRAY,
+ GLSL_SAMPLER_DIM_2D, 0, 1, GLSL_TYPE_UINT, "usampler2DArray"),
+
+ /* cube shadow samplers */
+ glsl_type(GL_SAMPLER_CUBE_SHADOW,
+ GLSL_SAMPLER_DIM_CUBE, 1, 0, GLSL_TYPE_FLOAT, "samplerCubeShadow"),
+
+ /* signed and unsigned integer samplers */
+ glsl_type(GL_INT_SAMPLER_1D,
+ GLSL_SAMPLER_DIM_1D, 0, 0, GLSL_TYPE_INT, "isampler1D"),
+ glsl_type(GL_UNSIGNED_INT_SAMPLER_1D,
+ GLSL_SAMPLER_DIM_1D, 0, 0, GLSL_TYPE_UINT, "usampler1D"),
+ glsl_type(GL_INT_SAMPLER_2D,
+ GLSL_SAMPLER_DIM_2D, 0, 0, GLSL_TYPE_INT, "isampler2D"),
+ glsl_type(GL_UNSIGNED_INT_SAMPLER_2D,
+ GLSL_SAMPLER_DIM_2D, 0, 0, GLSL_TYPE_UINT, "usampler2D"),
+ glsl_type(GL_INT_SAMPLER_3D,
+ GLSL_SAMPLER_DIM_3D, 0, 0, GLSL_TYPE_INT, "isampler3D"),
+ glsl_type(GL_UNSIGNED_INT_SAMPLER_3D,
+ GLSL_SAMPLER_DIM_3D, 0, 0, GLSL_TYPE_UINT, "usampler3D"),
+ glsl_type(GL_INT_SAMPLER_CUBE,
+ GLSL_SAMPLER_DIM_CUBE, 0, 0, GLSL_TYPE_INT, "isamplerCube"),
+ glsl_type(GL_INT_SAMPLER_CUBE,
+ GLSL_SAMPLER_DIM_CUBE, 0, 0, GLSL_TYPE_UINT, "usamplerCube"),
+};
+
+const glsl_type *const glsl_type::uint_type = & builtin_130_types[0];
+const glsl_type *const glsl_type::uvec2_type = & builtin_130_types[1];
+const glsl_type *const glsl_type::uvec3_type = & builtin_130_types[2];
+const glsl_type *const glsl_type::uvec4_type = & builtin_130_types[3];
+/*@}*/
+
+/** \name Sampler types added by GL_ARB_texture_rectangle
+ */
+/*@{*/
+
+const glsl_type glsl_type::builtin_ARB_texture_rectangle_types[] = {
+ glsl_type(GL_SAMPLER_2D_RECT,
+ GLSL_SAMPLER_DIM_RECT, 0, 0, GLSL_TYPE_FLOAT, "sampler2DRect"),
+ glsl_type(GL_SAMPLER_2D_RECT_SHADOW,
+ GLSL_SAMPLER_DIM_RECT, 1, 0, GLSL_TYPE_FLOAT, "sampler2DRectShadow"),
+};
+/*@}*/
+
+/** \name Sampler types added by GL_EXT_texture_array
+ */
+/*@{*/
+
+const glsl_type glsl_type::builtin_EXT_texture_array_types[] = {
+ glsl_type(GL_SAMPLER_1D_ARRAY,
+ GLSL_SAMPLER_DIM_1D, 0, 1, GLSL_TYPE_FLOAT, "sampler1DArray"),
+ glsl_type(GL_SAMPLER_2D_ARRAY,
+ GLSL_SAMPLER_DIM_2D, 0, 1, GLSL_TYPE_FLOAT, "sampler2DArray"),
+ glsl_type(GL_SAMPLER_1D_ARRAY_SHADOW,
+ GLSL_SAMPLER_DIM_1D, 1, 1, GLSL_TYPE_FLOAT, "sampler1DArrayShadow"),
+ glsl_type(GL_SAMPLER_2D_ARRAY_SHADOW,
+ GLSL_SAMPLER_DIM_2D, 1, 1, GLSL_TYPE_FLOAT, "sampler2DArrayShadow"),
+};
+/*@}*/
+
+/** \name Sampler types added by GL_EXT_texture_buffer_object
+ */
+/*@{*/
+
+const glsl_type glsl_type::builtin_EXT_texture_buffer_object_types[] = {
+ glsl_type(GL_SAMPLER_BUFFER,
+ GLSL_SAMPLER_DIM_BUF, 0, 0, GLSL_TYPE_FLOAT, "samplerBuffer"),
+ glsl_type(GL_INT_SAMPLER_BUFFER,
+ GLSL_SAMPLER_DIM_BUF, 0, 0, GLSL_TYPE_INT, "isamplerBuffer"),
+ glsl_type(GL_UNSIGNED_INT_SAMPLER_BUFFER,
+ GLSL_SAMPLER_DIM_BUF, 0, 0, GLSL_TYPE_UINT, "usamplerBuffer"),
+};
+/*@}*/
diff --git a/mesalib/src/glsl/doflexbison.bat b/mesalib/src/glsl/doflexbison.bat
new file mode 100644
index 000000000..8a5e4f0a6
--- /dev/null
+++ b/mesalib/src/glsl/doflexbison.bat
@@ -0,0 +1,21 @@
+@echo off
+setlocal
+
+cd "%~dp0"
+
+set M4=..\..\..\tools\mhmake\m4.exe
+set BISON_PKGDATADIR=../../../tools/mhmake/src/bisondata
+
+set path=..\..\..\tools\mhmake;%path%
+
+..\..\..\tools\mhmake\bison.exe -v -o glsl_parser.cpp -p "_mesa_glsl_" --defines=glsl_parser.h glsl_parser.yy
+
+..\..\..\tools\mhmake\bison.exe -v -o glcpp/glcpp-parse.c --defines=glcpp/glcpp-parse.h glcpp/glcpp-parse.y
+
+copy "..\..\..\tools\mhmake\flex++.exe" flex.exe
+flex.exe --nounistd -oglsl_lexer.cpp glsl_lexer.ll
+flex.exe --nounistd -oglcpp/glcpp-lex.c glcpp/glcpp-lex.l
+del flex.exe
+
+endlocal
+
diff --git a/mesalib/src/glsl/getopt.cpp b/mesalib/src/glsl/getopt.cpp
new file mode 100644
index 000000000..ea5dd3927
--- /dev/null
+++ b/mesalib/src/glsl/getopt.cpp
@@ -0,0 +1,552 @@
+/* $OpenBSD: getopt_long.c,v 1.20 2005/10/25 15:49:37 jmc Exp $ */
+/* $NetBSD: getopt_long.c,v 1.15 2002/01/31 22:43:40 tv Exp $ */
+// Adapted for Box Backup by Chris Wilson <chris+boxbackup@qwirx.com>
+
+/*
+ * Copyright (c) 2002 Todd C. Miller <Todd.Miller@courtesan.com>
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ * Sponsored in part by the Defense Advanced Research Projects
+ * Agency (DARPA) and Air Force Research Laboratory, Air Force
+ * Materiel Command, USAF, under agreement number F39502-99-1-0512.
+ */
+/*-
+ * Copyright (c) 2000 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Dieter Baron and Thomas Klausner.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the NetBSD
+ * Foundation, Inc. and its contributors.
+ * 4. Neither the name of The NetBSD Foundation nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// #include "Box.h"
+
+#include <errno.h>
+#include <stdarg.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+
+#define __STDC__ 1
+
+#include "getopt.h"
+
+#if defined _MSC_VER || defined __MINGW32__
+#define REPLACE_GETOPT /* use this getopt as the system getopt(3) */
+
+#ifdef REPLACE_GETOPT
+int opterr = 1; /* if error message should be printed */
+int optind = 1; /* index into parent argv vector */
+int optopt = '?'; /* character checked for validity */
+int optreset; /* reset getopt */
+char *optarg; /* argument associated with option */
+#endif
+
+#define PRINT_ERROR ((opterr) && (*options != ':'))
+
+#define FLAG_PERMUTE 0x01 /* permute non-options to the end of argv */
+#define FLAG_ALLARGS 0x02 /* treat non-options as args to option "-1" */
+#define FLAG_LONGONLY 0x04 /* operate as getopt_long_only */
+
+/* return values */
+#define BADCH (int)'?'
+#define BADARG ((*options == ':') ? (int)':' : (int)'?')
+#define INORDER (int)1
+
+#define EMSG ""
+
+static void warnx(const char* fmt, ...)
+{
+ va_list ap;
+ va_start(ap, fmt);
+ vfprintf(stderr, fmt, ap);
+ va_end(ap);
+ fprintf(stderr, "\n");
+ }
+
+ static int getopt_internal(int, char * const *, const char *,
+ const struct option *, int *, int);
+ static int parse_long_options(char * const *, const char *,
+ const struct option *, int *, int);
+ static int gcd(int, int);
+ static void permute_args(int, int, int, char * const *);
+
+ static char *place = EMSG; /* option letter processing */
+
+ /* XXX: set optreset to 1 rather than these two */
+ static int nonopt_start = -1; /* first non option argument (for permute) */
+ static int nonopt_end = -1; /* first option after non options (for permute) */
+
+ /* Error messages */
+ static const char recargchar[] = "option requires an argument -- %c";
+ static const char recargstring[] = "option requires an argument -- %s";
+ static const char ambig[] = "ambiguous option -- %.*s";
+ static const char noarg[] = "option doesn't take an argument -- %.*s";
+ static const char illoptchar[] = "unknown option -- %c";
+ static const char illoptstring[] = "unknown option -- %s";
+
+ /*
+ * Compute the greatest common divisor of a and b.
+ */
+ static int
+ gcd(int a, int b)
+ {
+ int c;
+
+ c = a % b;
+ while (c != 0) {
+ a = b;
+ b = c;
+ c = a % b;
+ }
+
+ return (b);
+ }
+
+ /*
+ * Exchange the block from nonopt_start to nonopt_end with the block
+ * from nonopt_end to opt_end (keeping the same order of arguments
+ * in each block).
+ */
+ static void
+ permute_args(int panonopt_start, int panonopt_end, int opt_end,
+ char * const *nargv)
+ {
+ int cstart, cyclelen, i, j, ncycle, nnonopts, nopts, pos;
+ char *swap;
+
+ /*
+ * compute lengths of blocks and number and size of cycles
+ */
+ nnonopts = panonopt_end - panonopt_start;
+ nopts = opt_end - panonopt_end;
+ ncycle = gcd(nnonopts, nopts);
+ cyclelen = (opt_end - panonopt_start) / ncycle;
+
+ for (i = 0; i < ncycle; i++) {
+ cstart = panonopt_end+i;
+ pos = cstart;
+ for (j = 0; j < cyclelen; j++) {
+ if (pos >= panonopt_end)
+ pos -= nnonopts;
+ else
+ pos += nopts;
+ swap = nargv[pos];
+ /* LINTED const cast */
+ ((char **) nargv)[pos] = nargv[cstart];
+ /* LINTED const cast */
+ ((char **)nargv)[cstart] = swap;
+ }
+ }
+ }
+
+ /*
+ * parse_long_options --
+ * Parse long options in argc/argv argument vector.
+ * Returns -1 if short_too is set and the option does not match long_options.
+ */
+ static int
+ parse_long_options(char * const *nargv, const char *options,
+ const struct option *long_options, int *idx, int short_too)
+ {
+ char *current_argv, *has_equal;
+ size_t current_argv_len;
+ int i, match;
+
+ current_argv = place;
+ match = -1;
+
+ optind++;
+
+ if ((has_equal = strchr(current_argv, '=')) != NULL) {
+ /* argument found (--option=arg) */
+ current_argv_len = has_equal - current_argv;
+ has_equal++;
+ } else
+ current_argv_len = strlen(current_argv);
+
+ for (i = 0; long_options[i].name; i++) {
+ /* find matching long option */
+ if (strncmp(current_argv, long_options[i].name,
+ current_argv_len))
+ continue;
+
+ if (strlen(long_options[i].name) == current_argv_len) {
+ /* exact match */
+ match = i;
+ break;
+ }
+ /*
+ * If this is a known short option, don't allow
+ * a partial match of a single character.
+ */
+ if (short_too && current_argv_len == 1)
+ continue;
+
+ if (match == -1) /* partial match */
+ match = i;
+ else {
+ /* ambiguous abbreviation */
+ if (PRINT_ERROR)
+ warnx(ambig, (int)current_argv_len,
+ current_argv);
+ optopt = 0;
+ return (BADCH);
+ }
+ }
+ if (match != -1) { /* option found */
+ if (long_options[match].has_arg == no_argument
+ && has_equal) {
+ if (PRINT_ERROR)
+ warnx(noarg, (int)current_argv_len,
+ current_argv);
+ /*
+ * XXX: GNU sets optopt to val regardless of flag
+ */
+ if (long_options[match].flag == NULL)
+ optopt = long_options[match].val;
+ else
+ optopt = 0;
+ return (BADARG);
+ }
+ if (long_options[match].has_arg == required_argument ||
+ long_options[match].has_arg == optional_argument) {
+ if (has_equal)
+ optarg = has_equal;
+ else if (long_options[match].has_arg ==
+ required_argument) {
+ /*
+ * optional argument doesn't use next nargv
+ */
+ optarg = nargv[optind++];
+ }
+ }
+ if ((long_options[match].has_arg == required_argument)
+ && (optarg == NULL)) {
+ /*
+ * Missing argument; leading ':' indicates no error
+ * should be generated.
+ */
+ if (PRINT_ERROR)
+ warnx(recargstring,
+ current_argv);
+ /*
+ * XXX: GNU sets optopt to val regardless of flag
+ */
+ if (long_options[match].flag == NULL)
+ optopt = long_options[match].val;
+ else
+ optopt = 0;
+ --optind;
+ return (BADARG);
+ }
+ } else { /* unknown option */
+ if (short_too) {
+ --optind;
+ return (-1);
+ }
+ if (PRINT_ERROR)
+ warnx(illoptstring, current_argv);
+ optopt = 0;
+ return (BADCH);
+ }
+ if (idx)
+ *idx = match;
+ if (long_options[match].flag) {
+ *long_options[match].flag = long_options[match].val;
+ return (0);
+ } else
+ return (long_options[match].val);
+ }
+
+ /*
+ * getopt_internal --
+ * Parse argc/argv argument vector. Called by user level routines.
+ */
+ static int
+ getopt_internal(int nargc, char * const *nargv, const char *options,
+ const struct option *long_options, int *idx, int flags)
+ {
+ const char * oli; /* option letter list index */
+ int optchar, short_too;
+ static int posixly_correct = -1;
+
+ if (options == NULL)
+ return (-1);
+
+ /*
+ * Disable GNU extensions if POSIXLY_CORRECT is set or options
+ * string begins with a '+'.
+ */
+ if (posixly_correct == -1)
+ posixly_correct = (getenv("POSIXLY_CORRECT") != NULL);
+ if (posixly_correct || *options == '+')
+ flags &= ~FLAG_PERMUTE;
+ else if (*options == '-')
+ flags |= FLAG_ALLARGS;
+ if (*options == '+' || *options == '-')
+ options++;
+
+ /*
+ * XXX Some GNU programs (like cvs) set optind to 0 instead of
+ * XXX using optreset. Work around this braindamage.
+ */
+ if (optind == 0)
+ optind = optreset = 1;
+
+ optarg = NULL;
+ if (optreset)
+ nonopt_start = nonopt_end = -1;
+ start:
+ if (optreset || !*place) { /* update scanning pointer */
+ optreset = 0;
+ if (optind >= nargc) { /* end of argument vector */
+ place = EMSG;
+ if (nonopt_end != -1) {
+ /* do permutation, if we have to */
+ permute_args(nonopt_start, nonopt_end,
+ optind, nargv);
+ optind -= nonopt_end - nonopt_start;
+ }
+ else if (nonopt_start != -1) {
+ /*
+ * If we skipped non-options, set optind
+ * to the first of them.
+ */
+ optind = nonopt_start;
+ }
+ nonopt_start = nonopt_end = -1;
+ return (-1);
+ }
+ if (*(place = nargv[optind]) != '-' ||
+ (place[1] == '\0' && strchr(options, '-') == NULL)) {
+ place = EMSG; /* found non-option */
+ if (flags & FLAG_ALLARGS) {
+ /*
+ * GNU extension:
+ * return non-option as argument to option 1
+ */
+ optarg = nargv[optind++];
+ return (INORDER);
+ }
+ if (!(flags & FLAG_PERMUTE)) {
+ /*
+ * If no permutation wanted, stop parsing
+ * at first non-option.
+ */
+ return (-1);
+ }
+ /* do permutation */
+ if (nonopt_start == -1)
+ nonopt_start = optind;
+ else if (nonopt_end != -1) {
+ permute_args(nonopt_start, nonopt_end,
+ optind, nargv);
+ nonopt_start = optind -
+ (nonopt_end - nonopt_start);
+ nonopt_end = -1;
+ }
+ optind++;
+ /* process next argument */
+ goto start;
+ }
+ if (nonopt_start != -1 && nonopt_end == -1)
+ nonopt_end = optind;
+
+ /*
+ * If we have "-" do nothing, if "--" we are done.
+ */
+ if (place[1] != '\0' && *++place == '-' && place[1] == '\0') {
+ optind++;
+ place = EMSG;
+ /*
+ * We found an option (--), so if we skipped
+ * non-options, we have to permute.
+ */
+ if (nonopt_end != -1) {
+ permute_args(nonopt_start, nonopt_end,
+ optind, nargv);
+ optind -= nonopt_end - nonopt_start;
+ }
+ nonopt_start = nonopt_end = -1;
+ return (-1);
+ }
+ }
+
+ /*
+ * Check long options if:
+ * 1) we were passed some
+ * 2) the arg is not just "-"
+ * 3) either the arg starts with -- we are getopt_long_only()
+ */
+ if (long_options != NULL && place != nargv[optind] &&
+ (*place == '-' || (flags & FLAG_LONGONLY))) {
+ short_too = 0;
+ if (*place == '-')
+ place++; /* --foo long option */
+ else if (*place != ':' && strchr(options, *place) != NULL)
+ short_too = 1; /* could be short option too */
+
+ optchar = parse_long_options(nargv, options, long_options,
+ idx, short_too);
+ if (optchar != -1) {
+ place = EMSG;
+ return (optchar);
+ }
+ }
+
+ if ((optchar = (int)*place++) == (int)':' ||
+ optchar == (int)'-' && *place != '\0' ||
+ (oli = strchr(options, optchar)) == NULL) {
+ /*
+ * If the user specified "-" and '-' isn't listed in
+ * options, return -1 (non-option) as per POSIX.
+ * Otherwise, it is an unknown option character (or ':').
+ */
+ if (optchar == (int)'-' && *place == '\0')
+ return (-1);
+ if (!*place)
+ ++optind;
+ if (PRINT_ERROR)
+ warnx(illoptchar, optchar);
+ optopt = optchar;
+ return (BADCH);
+ }
+ if (long_options != NULL && optchar == 'W' && oli[1] == ';') {
+ /* -W long-option */
+ if (*place) /* no space */
+ /* NOTHING */;
+ else if (++optind >= nargc) { /* no arg */
+ place = EMSG;
+ if (PRINT_ERROR)
+ warnx(recargchar, optchar);
+ optopt = optchar;
+ return (BADARG);
+ } else /* white space */
+ place = nargv[optind];
+ optchar = parse_long_options(nargv, options, long_options,
+ idx, 0);
+ place = EMSG;
+ return (optchar);
+ }
+ if (*++oli != ':') { /* doesn't take argument */
+ if (!*place)
+ ++optind;
+ } else { /* takes (optional) argument */
+ optarg = NULL;
+ if (*place) /* no white space */
+ optarg = place;
+ /* XXX: disable test for :: if PC? (GNU doesn't) */
+ else if (oli[1] != ':') { /* arg not optional */
+ if (++optind >= nargc) { /* no arg */
+ place = EMSG;
+ if (PRINT_ERROR)
+ warnx(recargchar, optchar);
+ optopt = optchar;
+ return (BADARG);
+ } else
+ optarg = nargv[optind];
+ } else if (!(flags & FLAG_PERMUTE)) {
+ /*
+ * If permutation is disabled, we can accept an
+ * optional arg separated by whitespace so long
+ * as it does not start with a dash (-).
+ */
+ if (optind + 1 < nargc && *nargv[optind + 1] != '-')
+ optarg = nargv[++optind];
+ }
+ place = EMSG;
+ ++optind;
+ }
+ /* dump back option letter */
+ return (optchar);
+ }
+
+ #ifdef REPLACE_GETOPT
+ /*
+ * getopt --
+ * Parse argc/argv argument vector.
+ *
+ * [eventually this will replace the BSD getopt]
+ */
+ int
+ getopt(int nargc, char * const *nargv, const char *options)
+ {
+
+ /*
+ * We don't pass FLAG_PERMUTE to getopt_internal() since
+ * the BSD getopt(3) (unlike GNU) has never done this.
+ *
+ * Furthermore, since many privileged programs call getopt()
+ * before dropping privileges it makes sense to keep things
+ * as simple (and bug-free) as possible.
+ */
+ return (getopt_internal(nargc, nargv, options, NULL, NULL, 0));
+ }
+ #endif /* REPLACE_GETOPT */
+
+ /*
+ * getopt_long --
+ * Parse argc/argv argument vector.
+ */
+ int
+ getopt_long(int nargc, char * const *nargv, const char *options,
+ const struct option *long_options, int *idx)
+ {
+
+ return (getopt_internal(nargc, nargv, options, long_options, idx,
+ FLAG_PERMUTE));
+ }
+
+ /*
+ * getopt_long_only --
+ * Parse argc/argv argument vector.
+ */
+ int
+ getopt_long_only(int nargc, char * const *nargv, const char *options,
+ const struct option *long_options, int *idx)
+ {
+
+ return (getopt_internal(nargc, nargv, options, long_options, idx,
+ FLAG_PERMUTE|FLAG_LONGONLY));
+ }
+
+#endif // defined _MSC_VER || defined __MINGW32__ \ No newline at end of file
diff --git a/mesalib/src/glsl/glcpp/glcpp-parse.y b/mesalib/src/glsl/glcpp/glcpp-parse.y
index 0a35e88ce..0b1ada90d 100644
--- a/mesalib/src/glsl/glcpp/glcpp-parse.y
+++ b/mesalib/src/glsl/glcpp/glcpp-parse.y
@@ -1,1904 +1,1904 @@
-%{
-/*
- * Copyright © 2010 Intel Corporation
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <assert.h>
-#include <inttypes.h>
-
-#include "glcpp.h"
-#include "main/core.h" /* for struct gl_extensions */
-#include "main/mtypes.h" /* for gl_api enum */
-
-static void
-yyerror (YYLTYPE *locp, glcpp_parser_t *parser, const char *error);
-
-static void
-_define_object_macro (glcpp_parser_t *parser,
- YYLTYPE *loc,
- const char *macro,
- token_list_t *replacements);
-
-static void
-_define_function_macro (glcpp_parser_t *parser,
- YYLTYPE *loc,
- const char *macro,
- string_list_t *parameters,
- token_list_t *replacements);
-
-static string_list_t *
-_string_list_create (void *ctx);
-
-static void
-_string_list_append_item (string_list_t *list, const char *str);
-
-static int
-_string_list_contains (string_list_t *list, const char *member, int *index);
-
-static int
-_string_list_length (string_list_t *list);
-
-static int
-_string_list_equal (string_list_t *a, string_list_t *b);
-
-static argument_list_t *
-_argument_list_create (void *ctx);
-
-static void
-_argument_list_append (argument_list_t *list, token_list_t *argument);
-
-static int
-_argument_list_length (argument_list_t *list);
-
-static token_list_t *
-_argument_list_member_at (argument_list_t *list, int index);
-
-/* Note: This function ralloc_steal()s the str pointer. */
-static token_t *
-_token_create_str (void *ctx, int type, char *str);
-
-static token_t *
-_token_create_ival (void *ctx, int type, int ival);
-
-static token_list_t *
-_token_list_create (void *ctx);
-
-/* Note: This function calls ralloc_steal on token. */
-static void
-_token_list_append (token_list_t *list, token_t *token);
-
-static void
-_token_list_append_list (token_list_t *list, token_list_t *tail);
-
-static int
-_token_list_equal_ignoring_space (token_list_t *a, token_list_t *b);
-
-static void
-_parser_active_list_push (glcpp_parser_t *parser,
- const char *identifier,
- token_node_t *marker);
-
-static void
-_parser_active_list_pop (glcpp_parser_t *parser);
-
-static int
-_parser_active_list_contains (glcpp_parser_t *parser, const char *identifier);
-
-static void
-_glcpp_parser_expand_if (glcpp_parser_t *parser, int type, token_list_t *list);
-
-static void
-_glcpp_parser_expand_token_list (glcpp_parser_t *parser,
- token_list_t *list);
-
-static void
-_glcpp_parser_print_expanded_token_list (glcpp_parser_t *parser,
- token_list_t *list);
-
-static void
-_glcpp_parser_skip_stack_push_if (glcpp_parser_t *parser, YYLTYPE *loc,
- int condition);
-
-static void
-_glcpp_parser_skip_stack_change_if (glcpp_parser_t *parser, YYLTYPE *loc,
- const char *type, int condition);
-
-static void
-_glcpp_parser_skip_stack_pop (glcpp_parser_t *parser, YYLTYPE *loc);
-
-#define yylex glcpp_parser_lex
-
-static int
-glcpp_parser_lex (YYSTYPE *yylval, YYLTYPE *yylloc, glcpp_parser_t *parser);
-
-static void
-glcpp_parser_lex_from (glcpp_parser_t *parser, token_list_t *list);
-
-static void
-add_builtin_define(glcpp_parser_t *parser, const char *name, int value);
-
-%}
-
-%pure-parser
-%error-verbose
-
-%locations
-%initial-action {
- @$.first_line = 1;
- @$.first_column = 1;
- @$.last_line = 1;
- @$.last_column = 1;
- @$.source = 0;
-}
-
-%parse-param {glcpp_parser_t *parser}
-%lex-param {glcpp_parser_t *parser}
-
-%expect 0
-%token COMMA_FINAL DEFINED ELIF_EXPANDED HASH HASH_DEFINE_FUNC HASH_DEFINE_OBJ HASH_ELIF HASH_ELSE HASH_ENDIF HASH_IF HASH_IFDEF HASH_IFNDEF HASH_UNDEF HASH_VERSION IDENTIFIER IF_EXPANDED INTEGER INTEGER_STRING NEWLINE OTHER PLACEHOLDER SPACE
-%token PASTE
-%type <ival> expression INTEGER operator SPACE integer_constant
-%type <str> IDENTIFIER INTEGER_STRING OTHER
-%type <string_list> identifier_list
-%type <token> preprocessing_token conditional_token
-%type <token_list> pp_tokens replacement_list text_line conditional_tokens
-%left OR
-%left AND
-%left '|'
-%left '^'
-%left '&'
-%left EQUAL NOT_EQUAL
-%left '<' '>' LESS_OR_EQUAL GREATER_OR_EQUAL
-%left LEFT_SHIFT RIGHT_SHIFT
-%left '+' '-'
-%left '*' '/' '%'
-%right UNARY
-
-%%
-
-input:
- /* empty */
-| input line
-;
-
-line:
- control_line {
- ralloc_strcat (&parser->output, "\n");
- }
-| text_line {
- _glcpp_parser_print_expanded_token_list (parser, $1);
- ralloc_strcat (&parser->output, "\n");
- ralloc_free ($1);
- }
-| expanded_line
-| HASH non_directive
-;
-
-expanded_line:
- IF_EXPANDED expression NEWLINE {
- _glcpp_parser_skip_stack_push_if (parser, & @1, $2);
- }
-| ELIF_EXPANDED expression NEWLINE {
- _glcpp_parser_skip_stack_change_if (parser, & @1, "elif", $2);
- }
-;
-
-control_line:
- HASH_DEFINE_OBJ IDENTIFIER replacement_list NEWLINE {
- _define_object_macro (parser, & @2, $2, $3);
- }
-| HASH_DEFINE_FUNC IDENTIFIER '(' ')' replacement_list NEWLINE {
- _define_function_macro (parser, & @2, $2, NULL, $5);
- }
-| HASH_DEFINE_FUNC IDENTIFIER '(' identifier_list ')' replacement_list NEWLINE {
- _define_function_macro (parser, & @2, $2, $4, $6);
- }
-| HASH_UNDEF IDENTIFIER NEWLINE {
- macro_t *macro = hash_table_find (parser->defines, $2);
- if (macro) {
- hash_table_remove (parser->defines, $2);
- ralloc_free (macro);
- }
- ralloc_free ($2);
- }
-| HASH_IF conditional_tokens NEWLINE {
- /* Be careful to only evaluate the 'if' expression if
- * we are not skipping. When we are skipping, we
- * simply push a new 0-valued 'if' onto the skip
- * stack.
- *
- * This avoids generating diagnostics for invalid
- * expressions that are being skipped. */
- if (parser->skip_stack == NULL ||
- parser->skip_stack->type == SKIP_NO_SKIP)
- {
- _glcpp_parser_expand_if (parser, IF_EXPANDED, $2);
- }
- else
- {
- _glcpp_parser_skip_stack_push_if (parser, & @1, 0);
- parser->skip_stack->type = SKIP_TO_ENDIF;
- }
- }
-| HASH_IF NEWLINE {
- /* #if without an expression is only an error if we
- * are not skipping */
- if (parser->skip_stack == NULL ||
- parser->skip_stack->type == SKIP_NO_SKIP)
- {
- glcpp_error(& @1, parser, "#if with no expression");
- }
- _glcpp_parser_skip_stack_push_if (parser, & @1, 0);
- }
-| HASH_IFDEF IDENTIFIER junk NEWLINE {
- macro_t *macro = hash_table_find (parser->defines, $2);
- ralloc_free ($2);
- _glcpp_parser_skip_stack_push_if (parser, & @1, macro != NULL);
- }
-| HASH_IFNDEF IDENTIFIER junk NEWLINE {
- macro_t *macro = hash_table_find (parser->defines, $2);
- ralloc_free ($2);
- _glcpp_parser_skip_stack_push_if (parser, & @1, macro == NULL);
- }
-| HASH_ELIF conditional_tokens NEWLINE {
- /* Be careful to only evaluate the 'elif' expression
- * if we are not skipping. When we are skipping, we
- * simply change to a 0-valued 'elif' on the skip
- * stack.
- *
- * This avoids generating diagnostics for invalid
- * expressions that are being skipped. */
- if (parser->skip_stack &&
- parser->skip_stack->type == SKIP_TO_ELSE)
- {
- _glcpp_parser_expand_if (parser, ELIF_EXPANDED, $2);
- }
- else
- {
- _glcpp_parser_skip_stack_change_if (parser, & @1,
- "elif", 0);
- }
- }
-| HASH_ELIF NEWLINE {
- /* #elif without an expression is an error unless we
- * are skipping. */
- if (parser->skip_stack &&
- parser->skip_stack->type == SKIP_TO_ELSE)
- {
- glcpp_error(& @1, parser, "#elif with no expression");
- }
- else
- {
- _glcpp_parser_skip_stack_change_if (parser, & @1,
- "elif", 0);
- glcpp_warning(& @1, parser, "ignoring illegal #elif without expression");
- }
- }
-| HASH_ELSE NEWLINE {
- _glcpp_parser_skip_stack_change_if (parser, & @1, "else", 1);
- }
-| HASH_ENDIF NEWLINE {
- _glcpp_parser_skip_stack_pop (parser, & @1);
- }
-| HASH_VERSION integer_constant NEWLINE {
- macro_t *macro = hash_table_find (parser->defines, "__VERSION__");
- if (macro) {
- hash_table_remove (parser->defines, "__VERSION__");
- ralloc_free (macro);
- }
- add_builtin_define (parser, "__VERSION__", $2);
-
- if ($2 == 100)
- add_builtin_define (parser, "GL_ES", 1);
-
- /* Currently, all ES2 implementations support highp in the
- * fragment shader, so we always define this macro in ES2.
- * If we ever get a driver that doesn't support highp, we'll
- * need to add a flag to the gl_context and check that here.
- */
- if ($2 >= 130 || $2 == 100)
- add_builtin_define (parser, "GL_FRAGMENT_PRECISION_HIGH", 1);
-
- ralloc_asprintf_append (&parser->output, "#version %" PRIiMAX, $2);
- }
-| HASH NEWLINE
-;
-
-integer_constant:
- INTEGER_STRING {
- if (strlen ($1) >= 3 && strncmp ($1, "0x", 2) == 0) {
- $$ = strtoll ($1 + 2, NULL, 16);
- } else if ($1[0] == '0') {
- $$ = strtoll ($1, NULL, 8);
- } else {
- $$ = strtoll ($1, NULL, 10);
- }
- }
-| INTEGER {
- $$ = $1;
- }
-
-expression:
- integer_constant
-| expression OR expression {
- $$ = $1 || $3;
- }
-| expression AND expression {
- $$ = $1 && $3;
- }
-| expression '|' expression {
- $$ = $1 | $3;
- }
-| expression '^' expression {
- $$ = $1 ^ $3;
- }
-| expression '&' expression {
- $$ = $1 & $3;
- }
-| expression NOT_EQUAL expression {
- $$ = $1 != $3;
- }
-| expression EQUAL expression {
- $$ = $1 == $3;
- }
-| expression GREATER_OR_EQUAL expression {
- $$ = $1 >= $3;
- }
-| expression LESS_OR_EQUAL expression {
- $$ = $1 <= $3;
- }
-| expression '>' expression {
- $$ = $1 > $3;
- }
-| expression '<' expression {
- $$ = $1 < $3;
- }
-| expression RIGHT_SHIFT expression {
- $$ = $1 >> $3;
- }
-| expression LEFT_SHIFT expression {
- $$ = $1 << $3;
- }
-| expression '-' expression {
- $$ = $1 - $3;
- }
-| expression '+' expression {
- $$ = $1 + $3;
- }
-| expression '%' expression {
- if ($3 == 0) {
- yyerror (& @1, parser,
- "zero modulus in preprocessor directive");
- } else {
- $$ = $1 % $3;
- }
- }
-| expression '/' expression {
- if ($3 == 0) {
- yyerror (& @1, parser,
- "division by 0 in preprocessor directive");
- } else {
- $$ = $1 / $3;
- }
- }
-| expression '*' expression {
- $$ = $1 * $3;
- }
-| '!' expression %prec UNARY {
- $$ = ! $2;
- }
-| '~' expression %prec UNARY {
- $$ = ~ $2;
- }
-| '-' expression %prec UNARY {
- $$ = - $2;
- }
-| '+' expression %prec UNARY {
- $$ = + $2;
- }
-| '(' expression ')' {
- $$ = $2;
- }
-;
-
-identifier_list:
- IDENTIFIER {
- $$ = _string_list_create (parser);
- _string_list_append_item ($$, $1);
- ralloc_steal ($$, $1);
- }
-| identifier_list ',' IDENTIFIER {
- $$ = $1;
- _string_list_append_item ($$, $3);
- ralloc_steal ($$, $3);
- }
-;
-
-text_line:
- NEWLINE { $$ = NULL; }
-| pp_tokens NEWLINE
-;
-
-non_directive:
- pp_tokens NEWLINE {
- yyerror (& @1, parser, "Invalid tokens after #");
- }
-;
-
-replacement_list:
- /* empty */ { $$ = NULL; }
-| pp_tokens
-;
-
-junk:
- /* empty */
-| pp_tokens {
- glcpp_warning(&@1, parser, "extra tokens at end of directive");
- }
-;
-
-conditional_token:
- /* Handle "defined" operator */
- DEFINED IDENTIFIER {
- int v = hash_table_find (parser->defines, $2) ? 1 : 0;
- $$ = _token_create_ival (parser, INTEGER, v);
- }
-| DEFINED '(' IDENTIFIER ')' {
- int v = hash_table_find (parser->defines, $3) ? 1 : 0;
- $$ = _token_create_ival (parser, INTEGER, v);
- }
-| preprocessing_token
-;
-
-conditional_tokens:
- /* Exactly the same as pp_tokens, but using conditional_token */
- conditional_token {
- $$ = _token_list_create (parser);
- _token_list_append ($$, $1);
- }
-| conditional_tokens conditional_token {
- $$ = $1;
- _token_list_append ($$, $2);
- }
-;
-
-pp_tokens:
- preprocessing_token {
- parser->space_tokens = 1;
- $$ = _token_list_create (parser);
- _token_list_append ($$, $1);
- }
-| pp_tokens preprocessing_token {
- $$ = $1;
- _token_list_append ($$, $2);
- }
-;
-
-preprocessing_token:
- IDENTIFIER {
- $$ = _token_create_str (parser, IDENTIFIER, $1);
- $$->location = yylloc;
- }
-| INTEGER_STRING {
- $$ = _token_create_str (parser, INTEGER_STRING, $1);
- $$->location = yylloc;
- }
-| operator {
- $$ = _token_create_ival (parser, $1, $1);
- $$->location = yylloc;
- }
-| OTHER {
- $$ = _token_create_str (parser, OTHER, $1);
- $$->location = yylloc;
- }
-| SPACE {
- $$ = _token_create_ival (parser, SPACE, SPACE);
- $$->location = yylloc;
- }
-;
-
-operator:
- '[' { $$ = '['; }
-| ']' { $$ = ']'; }
-| '(' { $$ = '('; }
-| ')' { $$ = ')'; }
-| '{' { $$ = '{'; }
-| '}' { $$ = '}'; }
-| '.' { $$ = '.'; }
-| '&' { $$ = '&'; }
-| '*' { $$ = '*'; }
-| '+' { $$ = '+'; }
-| '-' { $$ = '-'; }
-| '~' { $$ = '~'; }
-| '!' { $$ = '!'; }
-| '/' { $$ = '/'; }
-| '%' { $$ = '%'; }
-| LEFT_SHIFT { $$ = LEFT_SHIFT; }
-| RIGHT_SHIFT { $$ = RIGHT_SHIFT; }
-| '<' { $$ = '<'; }
-| '>' { $$ = '>'; }
-| LESS_OR_EQUAL { $$ = LESS_OR_EQUAL; }
-| GREATER_OR_EQUAL { $$ = GREATER_OR_EQUAL; }
-| EQUAL { $$ = EQUAL; }
-| NOT_EQUAL { $$ = NOT_EQUAL; }
-| '^' { $$ = '^'; }
-| '|' { $$ = '|'; }
-| AND { $$ = AND; }
-| OR { $$ = OR; }
-| ';' { $$ = ';'; }
-| ',' { $$ = ','; }
-| '=' { $$ = '='; }
-| PASTE { $$ = PASTE; }
-;
-
-%%
-
-string_list_t *
-_string_list_create (void *ctx)
-{
- string_list_t *list;
-
- list = ralloc (ctx, string_list_t);
- list->head = NULL;
- list->tail = NULL;
-
- return list;
-}
-
-void
-_string_list_append_item (string_list_t *list, const char *str)
-{
- string_node_t *node;
-
- node = ralloc (list, string_node_t);
- node->str = ralloc_strdup (node, str);
-
- node->next = NULL;
-
- if (list->head == NULL) {
- list->head = node;
- } else {
- list->tail->next = node;
- }
-
- list->tail = node;
-}
-
-int
-_string_list_contains (string_list_t *list, const char *member, int *index)
-{
- string_node_t *node;
- int i;
-
- if (list == NULL)
- return 0;
-
- for (i = 0, node = list->head; node; i++, node = node->next) {
- if (strcmp (node->str, member) == 0) {
- if (index)
- *index = i;
- return 1;
- }
- }
-
- return 0;
-}
-
-int
-_string_list_length (string_list_t *list)
-{
- int length = 0;
- string_node_t *node;
-
- if (list == NULL)
- return 0;
-
- for (node = list->head; node; node = node->next)
- length++;
-
- return length;
-}
-
-int
-_string_list_equal (string_list_t *a, string_list_t *b)
-{
- string_node_t *node_a, *node_b;
-
- if (a == NULL && b == NULL)
- return 1;
-
- if (a == NULL || b == NULL)
- return 0;
-
- for (node_a = a->head, node_b = b->head;
- node_a && node_b;
- node_a = node_a->next, node_b = node_b->next)
- {
- if (strcmp (node_a->str, node_b->str))
- return 0;
- }
-
- /* Catch the case of lists being different lengths, (which
- * would cause the loop above to terminate after the shorter
- * list). */
- return node_a == node_b;
-}
-
-argument_list_t *
-_argument_list_create (void *ctx)
-{
- argument_list_t *list;
-
- list = ralloc (ctx, argument_list_t);
- list->head = NULL;
- list->tail = NULL;
-
- return list;
-}
-
-void
-_argument_list_append (argument_list_t *list, token_list_t *argument)
-{
- argument_node_t *node;
-
- node = ralloc (list, argument_node_t);
- node->argument = argument;
-
- node->next = NULL;
-
- if (list->head == NULL) {
- list->head = node;
- } else {
- list->tail->next = node;
- }
-
- list->tail = node;
-}
-
-int
-_argument_list_length (argument_list_t *list)
-{
- int length = 0;
- argument_node_t *node;
-
- if (list == NULL)
- return 0;
-
- for (node = list->head; node; node = node->next)
- length++;
-
- return length;
-}
-
-token_list_t *
-_argument_list_member_at (argument_list_t *list, int index)
-{
- argument_node_t *node;
- int i;
-
- if (list == NULL)
- return NULL;
-
- node = list->head;
- for (i = 0; i < index; i++) {
- node = node->next;
- if (node == NULL)
- break;
- }
-
- if (node)
- return node->argument;
-
- return NULL;
-}
-
-/* Note: This function ralloc_steal()s the str pointer. */
-token_t *
-_token_create_str (void *ctx, int type, char *str)
-{
- token_t *token;
-
- token = ralloc (ctx, token_t);
- token->type = type;
- token->value.str = str;
-
- ralloc_steal (token, str);
-
- return token;
-}
-
-token_t *
-_token_create_ival (void *ctx, int type, int ival)
-{
- token_t *token;
-
- token = ralloc (ctx, token_t);
- token->type = type;
- token->value.ival = ival;
-
- return token;
-}
-
-token_list_t *
-_token_list_create (void *ctx)
-{
- token_list_t *list;
-
- list = ralloc (ctx, token_list_t);
- list->head = NULL;
- list->tail = NULL;
- list->non_space_tail = NULL;
-
- return list;
-}
-
-void
-_token_list_append (token_list_t *list, token_t *token)
-{
- token_node_t *node;
-
- node = ralloc (list, token_node_t);
- node->token = token;
- node->next = NULL;
-
- ralloc_steal (list, token);
-
- if (list->head == NULL) {
- list->head = node;
- } else {
- list->tail->next = node;
- }
-
- list->tail = node;
- if (token->type != SPACE)
- list->non_space_tail = node;
-}
-
-void
-_token_list_append_list (token_list_t *list, token_list_t *tail)
-{
- if (tail == NULL || tail->head == NULL)
- return;
-
- if (list->head == NULL) {
- list->head = tail->head;
- } else {
- list->tail->next = tail->head;
- }
-
- list->tail = tail->tail;
- list->non_space_tail = tail->non_space_tail;
-}
-
-static token_list_t *
-_token_list_copy (void *ctx, token_list_t *other)
-{
- token_list_t *copy;
- token_node_t *node;
-
- if (other == NULL)
- return NULL;
-
- copy = _token_list_create (ctx);
- for (node = other->head; node; node = node->next) {
- token_t *new_token = ralloc (copy, token_t);
- *new_token = *node->token;
- _token_list_append (copy, new_token);
- }
-
- return copy;
-}
-
-static void
-_token_list_trim_trailing_space (token_list_t *list)
-{
- token_node_t *tail, *next;
-
- if (list->non_space_tail) {
- tail = list->non_space_tail->next;
- list->non_space_tail->next = NULL;
- list->tail = list->non_space_tail;
-
- while (tail) {
- next = tail->next;
- ralloc_free (tail);
- tail = next;
- }
- }
-}
-
-static int
-_token_list_is_empty_ignoring_space (token_list_t *l)
-{
- token_node_t *n;
-
- if (l == NULL)
- return 1;
-
- n = l->head;
- while (n != NULL && n->token->type == SPACE)
- n = n->next;
-
- return n == NULL;
-}
-
-int
-_token_list_equal_ignoring_space (token_list_t *a, token_list_t *b)
-{
- token_node_t *node_a, *node_b;
-
- if (a == NULL || b == NULL) {
- int a_empty = _token_list_is_empty_ignoring_space(a);
- int b_empty = _token_list_is_empty_ignoring_space(b);
- return a_empty == b_empty;
- }
-
- node_a = a->head;
- node_b = b->head;
-
- while (1)
- {
- if (node_a == NULL && node_b == NULL)
- break;
-
- if (node_a == NULL || node_b == NULL)
- return 0;
-
- if (node_a->token->type == SPACE) {
- node_a = node_a->next;
- continue;
- }
-
- if (node_b->token->type == SPACE) {
- node_b = node_b->next;
- continue;
- }
-
- if (node_a->token->type != node_b->token->type)
- return 0;
-
- switch (node_a->token->type) {
- case INTEGER:
- if (node_a->token->value.ival !=
- node_b->token->value.ival)
- {
- return 0;
- }
- break;
- case IDENTIFIER:
- case INTEGER_STRING:
- case OTHER:
- if (strcmp (node_a->token->value.str,
- node_b->token->value.str))
- {
- return 0;
- }
- break;
- }
-
- node_a = node_a->next;
- node_b = node_b->next;
- }
-
- return 1;
-}
-
-static void
-_token_print (char **out, token_t *token)
-{
- if (token->type < 256) {
- ralloc_asprintf_append (out, "%c", token->type);
- return;
- }
-
- switch (token->type) {
- case INTEGER:
- ralloc_asprintf_append (out, "%" PRIiMAX, token->value.ival);
- break;
- case IDENTIFIER:
- case INTEGER_STRING:
- case OTHER:
- ralloc_strcat (out, token->value.str);
- break;
- case SPACE:
- ralloc_strcat (out, " ");
- break;
- case LEFT_SHIFT:
- ralloc_strcat (out, "<<");
- break;
- case RIGHT_SHIFT:
- ralloc_strcat (out, ">>");
- break;
- case LESS_OR_EQUAL:
- ralloc_strcat (out, "<=");
- break;
- case GREATER_OR_EQUAL:
- ralloc_strcat (out, ">=");
- break;
- case EQUAL:
- ralloc_strcat (out, "==");
- break;
- case NOT_EQUAL:
- ralloc_strcat (out, "!=");
- break;
- case AND:
- ralloc_strcat (out, "&&");
- break;
- case OR:
- ralloc_strcat (out, "||");
- break;
- case PASTE:
- ralloc_strcat (out, "##");
- break;
- case COMMA_FINAL:
- ralloc_strcat (out, ",");
- break;
- case PLACEHOLDER:
- /* Nothing to print. */
- break;
- default:
- assert(!"Error: Don't know how to print token.");
- break;
- }
-}
-
-/* Return a new token (ralloc()ed off of 'token') formed by pasting
- * 'token' and 'other'. Note that this function may return 'token' or
- * 'other' directly rather than allocating anything new.
- *
- * Caution: Only very cursory error-checking is performed to see if
- * the final result is a valid single token. */
-static token_t *
-_token_paste (glcpp_parser_t *parser, token_t *token, token_t *other)
-{
- token_t *combined = NULL;
-
- /* Pasting a placeholder onto anything makes no change. */
- if (other->type == PLACEHOLDER)
- return token;
-
- /* When 'token' is a placeholder, just return 'other'. */
- if (token->type == PLACEHOLDER)
- return other;
-
- /* A very few single-character punctuators can be combined
- * with another to form a multi-character punctuator. */
- switch (token->type) {
- case '<':
- if (other->type == '<')
- combined = _token_create_ival (token, LEFT_SHIFT, LEFT_SHIFT);
- else if (other->type == '=')
- combined = _token_create_ival (token, LESS_OR_EQUAL, LESS_OR_EQUAL);
- break;
- case '>':
- if (other->type == '>')
- combined = _token_create_ival (token, RIGHT_SHIFT, RIGHT_SHIFT);
- else if (other->type == '=')
- combined = _token_create_ival (token, GREATER_OR_EQUAL, GREATER_OR_EQUAL);
- break;
- case '=':
- if (other->type == '=')
- combined = _token_create_ival (token, EQUAL, EQUAL);
- break;
- case '!':
- if (other->type == '=')
- combined = _token_create_ival (token, NOT_EQUAL, NOT_EQUAL);
- break;
- case '&':
- if (other->type == '&')
- combined = _token_create_ival (token, AND, AND);
- break;
- case '|':
- if (other->type == '|')
- combined = _token_create_ival (token, OR, OR);
- break;
- }
-
- if (combined != NULL) {
- /* Inherit the location from the first token */
- combined->location = token->location;
- return combined;
- }
-
- /* Two string-valued tokens can usually just be mashed
- * together.
- *
- * XXX: This isn't actually legitimate. Several things here
- * should result in a diagnostic since the result cannot be a
- * valid, single pre-processing token. For example, pasting
- * "123" and "abc" is not legal, but we don't catch that
- * here. */
- if ((token->type == IDENTIFIER || token->type == OTHER || token->type == INTEGER_STRING) &&
- (other->type == IDENTIFIER || other->type == OTHER || other->type == INTEGER_STRING))
- {
- char *str;
-
- str = ralloc_asprintf (token, "%s%s", token->value.str,
- other->value.str);
- combined = _token_create_str (token, token->type, str);
- combined->location = token->location;
- return combined;
- }
-
- glcpp_error (&token->location, parser, "");
- ralloc_strcat (&parser->info_log, "Pasting \"");
- _token_print (&parser->info_log, token);
- ralloc_strcat (&parser->info_log, "\" and \"");
- _token_print (&parser->info_log, other);
- ralloc_strcat (&parser->info_log, "\" does not give a valid preprocessing token.\n");
-
- return token;
-}
-
-static void
-_token_list_print (glcpp_parser_t *parser, token_list_t *list)
-{
- token_node_t *node;
-
- if (list == NULL)
- return;
-
- for (node = list->head; node; node = node->next)
- _token_print (&parser->output, node->token);
-}
-
-void
-yyerror (YYLTYPE *locp, glcpp_parser_t *parser, const char *error)
-{
- glcpp_error(locp, parser, "%s", error);
-}
-
-static void add_builtin_define(glcpp_parser_t *parser,
- const char *name, int value)
-{
- token_t *tok;
- token_list_t *list;
-
- tok = _token_create_ival (parser, INTEGER, value);
-
- list = _token_list_create(parser);
- _token_list_append(list, tok);
- _define_object_macro(parser, NULL, name, list);
-}
-
-glcpp_parser_t *
-glcpp_parser_create (const struct gl_extensions *extensions, int api)
-{
- glcpp_parser_t *parser;
- int language_version;
-
- parser = ralloc (NULL, glcpp_parser_t);
-
- glcpp_lex_init_extra (parser, &parser->scanner);
- parser->defines = hash_table_ctor (32, hash_table_string_hash,
- hash_table_string_compare);
- parser->active = NULL;
- parser->lexing_if = 0;
- parser->space_tokens = 1;
- parser->newline_as_space = 0;
- parser->in_control_line = 0;
- parser->paren_count = 0;
-
- parser->skip_stack = NULL;
-
- parser->lex_from_list = NULL;
- parser->lex_from_node = NULL;
-
- parser->output = ralloc_strdup(parser, "");
- parser->info_log = ralloc_strdup(parser, "");
- parser->error = 0;
-
- /* Add pre-defined macros. */
- add_builtin_define(parser, "GL_ARB_draw_buffers", 1);
- add_builtin_define(parser, "GL_ARB_texture_rectangle", 1);
-
- if (api == API_OPENGLES2)
- add_builtin_define(parser, "GL_ES", 1);
-
- if (extensions != NULL) {
- if (extensions->EXT_texture_array) {
- add_builtin_define(parser, "GL_EXT_texture_array", 1);
- }
-
- if (extensions->ARB_fragment_coord_conventions)
- add_builtin_define(parser, "GL_ARB_fragment_coord_conventions",
- 1);
-
- if (extensions->ARB_explicit_attrib_location)
- add_builtin_define(parser, "GL_ARB_explicit_attrib_location", 1);
-
- if (extensions->ARB_shader_texture_lod)
- add_builtin_define(parser, "GL_ARB_shader_texture_lod", 1);
-
- if (extensions->AMD_conservative_depth)
- add_builtin_define(parser, "GL_AMD_conservative_depth", 1);
- }
-
- language_version = 110;
- add_builtin_define(parser, "__VERSION__", language_version);
-
- return parser;
-}
-
-int
-glcpp_parser_parse (glcpp_parser_t *parser)
-{
- return yyparse (parser);
-}
-
-void
-glcpp_parser_destroy (glcpp_parser_t *parser)
-{
- glcpp_lex_destroy (parser->scanner);
- hash_table_dtor (parser->defines);
- ralloc_free (parser);
-}
-
-typedef enum function_status
-{
- FUNCTION_STATUS_SUCCESS,
- FUNCTION_NOT_A_FUNCTION,
- FUNCTION_UNBALANCED_PARENTHESES
-} function_status_t;
-
-/* Find a set of function-like macro arguments by looking for a
- * balanced set of parentheses.
- *
- * When called, 'node' should be the opening-parenthesis token, (or
- * perhaps preceeding SPACE tokens). Upon successful return *last will
- * be the last consumed node, (corresponding to the closing right
- * parenthesis).
- *
- * Return values:
- *
- * FUNCTION_STATUS_SUCCESS:
- *
- * Successfully parsed a set of function arguments.
- *
- * FUNCTION_NOT_A_FUNCTION:
- *
- * Macro name not followed by a '('. This is not an error, but
- * simply that the macro name should be treated as a non-macro.
- *
- * FUNCTION_UNBALANCED_PARENTHESES
- *
- * Macro name is not followed by a balanced set of parentheses.
- */
-static function_status_t
-_arguments_parse (argument_list_t *arguments,
- token_node_t *node,
- token_node_t **last)
-{
- token_list_t *argument;
- int paren_count;
-
- node = node->next;
-
- /* Ignore whitespace before first parenthesis. */
- while (node && node->token->type == SPACE)
- node = node->next;
-
- if (node == NULL || node->token->type != '(')
- return FUNCTION_NOT_A_FUNCTION;
-
- node = node->next;
-
- argument = _token_list_create (arguments);
- _argument_list_append (arguments, argument);
-
- for (paren_count = 1; node; node = node->next) {
- if (node->token->type == '(')
- {
- paren_count++;
- }
- else if (node->token->type == ')')
- {
- paren_count--;
- if (paren_count == 0)
- break;
- }
-
- if (node->token->type == ',' &&
- paren_count == 1)
- {
- _token_list_trim_trailing_space (argument);
- argument = _token_list_create (arguments);
- _argument_list_append (arguments, argument);
- }
- else {
- if (argument->head == NULL) {
- /* Don't treat initial whitespace as
- * part of the arguement. */
- if (node->token->type == SPACE)
- continue;
- }
- _token_list_append (argument, node->token);
- }
- }
-
- if (paren_count)
- return FUNCTION_UNBALANCED_PARENTHESES;
-
- *last = node;
-
- return FUNCTION_STATUS_SUCCESS;
-}
-
-static token_list_t *
-_token_list_create_with_one_space (void *ctx)
-{
- token_list_t *list;
- token_t *space;
-
- list = _token_list_create (ctx);
- space = _token_create_ival (list, SPACE, SPACE);
- _token_list_append (list, space);
-
- return list;
-}
-
-static void
-_glcpp_parser_expand_if (glcpp_parser_t *parser, int type, token_list_t *list)
-{
- token_list_t *expanded;
- token_t *token;
-
- expanded = _token_list_create (parser);
- token = _token_create_ival (parser, type, type);
- _token_list_append (expanded, token);
- _glcpp_parser_expand_token_list (parser, list);
- _token_list_append_list (expanded, list);
- glcpp_parser_lex_from (parser, expanded);
-}
-
-/* This is a helper function that's essentially part of the
- * implementation of _glcpp_parser_expand_node. It shouldn't be called
- * except for by that function.
- *
- * Returns NULL if node is a simple token with no expansion, (that is,
- * although 'node' corresponds to an identifier defined as a
- * function-like macro, it is not followed with a parenthesized
- * argument list).
- *
- * Compute the complete expansion of node (which is a function-like
- * macro) and subsequent nodes which are arguments.
- *
- * Returns the token list that results from the expansion and sets
- * *last to the last node in the list that was consumed by the
- * expansion. Specifically, *last will be set as follows: as the
- * token of the closing right parenthesis.
- */
-static token_list_t *
-_glcpp_parser_expand_function (glcpp_parser_t *parser,
- token_node_t *node,
- token_node_t **last)
-
-{
- macro_t *macro;
- const char *identifier;
- argument_list_t *arguments;
- function_status_t status;
- token_list_t *substituted;
- int parameter_index;
-
- identifier = node->token->value.str;
-
- macro = hash_table_find (parser->defines, identifier);
-
- assert (macro->is_function);
-
- arguments = _argument_list_create (parser);
- status = _arguments_parse (arguments, node, last);
-
- switch (status) {
- case FUNCTION_STATUS_SUCCESS:
- break;
- case FUNCTION_NOT_A_FUNCTION:
- return NULL;
- case FUNCTION_UNBALANCED_PARENTHESES:
- glcpp_error (&node->token->location, parser, "Macro %s call has unbalanced parentheses\n", identifier);
- return NULL;
- }
-
- /* Replace a macro defined as empty with a SPACE token. */
- if (macro->replacements == NULL) {
- ralloc_free (arguments);
- return _token_list_create_with_one_space (parser);
- }
-
- if (! ((_argument_list_length (arguments) ==
- _string_list_length (macro->parameters)) ||
- (_string_list_length (macro->parameters) == 0 &&
- _argument_list_length (arguments) == 1 &&
- arguments->head->argument->head == NULL)))
- {
- glcpp_error (&node->token->location, parser,
- "Error: macro %s invoked with %d arguments (expected %d)\n",
- identifier,
- _argument_list_length (arguments),
- _string_list_length (macro->parameters));
- return NULL;
- }
-
- /* Perform argument substitution on the replacement list. */
- substituted = _token_list_create (arguments);
-
- for (node = macro->replacements->head; node; node = node->next)
- {
- if (node->token->type == IDENTIFIER &&
- _string_list_contains (macro->parameters,
- node->token->value.str,
- &parameter_index))
- {
- token_list_t *argument;
- argument = _argument_list_member_at (arguments,
- parameter_index);
- /* Before substituting, we expand the argument
- * tokens, or append a placeholder token for
- * an empty argument. */
- if (argument->head) {
- token_list_t *expanded_argument;
- expanded_argument = _token_list_copy (parser,
- argument);
- _glcpp_parser_expand_token_list (parser,
- expanded_argument);
- _token_list_append_list (substituted,
- expanded_argument);
- } else {
- token_t *new_token;
-
- new_token = _token_create_ival (substituted,
- PLACEHOLDER,
- PLACEHOLDER);
- _token_list_append (substituted, new_token);
- }
- } else {
- _token_list_append (substituted, node->token);
- }
- }
-
- /* After argument substitution, and before further expansion
- * below, implement token pasting. */
-
- _token_list_trim_trailing_space (substituted);
-
- node = substituted->head;
- while (node)
- {
- token_node_t *next_non_space;
-
- /* Look ahead for a PASTE token, skipping space. */
- next_non_space = node->next;
- while (next_non_space && next_non_space->token->type == SPACE)
- next_non_space = next_non_space->next;
-
- if (next_non_space == NULL)
- break;
-
- if (next_non_space->token->type != PASTE) {
- node = next_non_space;
- continue;
- }
-
- /* Now find the next non-space token after the PASTE. */
- next_non_space = next_non_space->next;
- while (next_non_space && next_non_space->token->type == SPACE)
- next_non_space = next_non_space->next;
-
- if (next_non_space == NULL) {
- yyerror (&node->token->location, parser, "'##' cannot appear at either end of a macro expansion\n");
- return NULL;
- }
-
- node->token = _token_paste (parser, node->token, next_non_space->token);
- node->next = next_non_space->next;
- if (next_non_space == substituted->tail)
- substituted->tail = node;
-
- node = node->next;
- }
-
- substituted->non_space_tail = substituted->tail;
-
- return substituted;
-}
-
-/* Compute the complete expansion of node, (and subsequent nodes after
- * 'node' in the case that 'node' is a function-like macro and
- * subsequent nodes are arguments).
- *
- * Returns NULL if node is a simple token with no expansion.
- *
- * Otherwise, returns the token list that results from the expansion
- * and sets *last to the last node in the list that was consumed by
- * the expansion. Specifically, *last will be set as follows:
- *
- * As 'node' in the case of object-like macro expansion.
- *
- * As the token of the closing right parenthesis in the case of
- * function-like macro expansion.
- */
-static token_list_t *
-_glcpp_parser_expand_node (glcpp_parser_t *parser,
- token_node_t *node,
- token_node_t **last)
-{
- token_t *token = node->token;
- const char *identifier;
- macro_t *macro;
-
- /* We only expand identifiers */
- if (token->type != IDENTIFIER) {
- /* We change any COMMA into a COMMA_FINAL to prevent
- * it being mistaken for an argument separator
- * later. */
- if (token->type == ',') {
- token->type = COMMA_FINAL;
- token->value.ival = COMMA_FINAL;
- }
-
- return NULL;
- }
-
- /* Look up this identifier in the hash table. */
- identifier = token->value.str;
- macro = hash_table_find (parser->defines, identifier);
-
- /* Not a macro, so no expansion needed. */
- if (macro == NULL)
- return NULL;
-
- /* Finally, don't expand this macro if we're already actively
- * expanding it, (to avoid infinite recursion). */
- if (_parser_active_list_contains (parser, identifier)) {
- /* We change the token type here from IDENTIFIER to
- * OTHER to prevent any future expansion of this
- * unexpanded token. */
- char *str;
- token_list_t *expansion;
- token_t *final;
-
- str = ralloc_strdup (parser, token->value.str);
- final = _token_create_str (parser, OTHER, str);
- expansion = _token_list_create (parser);
- _token_list_append (expansion, final);
- *last = node;
- return expansion;
- }
-
- if (! macro->is_function)
- {
- *last = node;
-
- /* Replace a macro defined as empty with a SPACE token. */
- if (macro->replacements == NULL)
- return _token_list_create_with_one_space (parser);
-
- return _token_list_copy (parser, macro->replacements);
- }
-
- return _glcpp_parser_expand_function (parser, node, last);
-}
-
-/* Push a new identifier onto the parser's active list.
- *
- * Here, 'marker' is the token node that appears in the list after the
- * expansion of 'identifier'. That is, when the list iterator begins
- * examining 'marker', then it is time to pop this node from the
- * active stack.
- */
-static void
-_parser_active_list_push (glcpp_parser_t *parser,
- const char *identifier,
- token_node_t *marker)
-{
- active_list_t *node;
-
- node = ralloc (parser->active, active_list_t);
- node->identifier = ralloc_strdup (node, identifier);
- node->marker = marker;
- node->next = parser->active;
-
- parser->active = node;
-}
-
-static void
-_parser_active_list_pop (glcpp_parser_t *parser)
-{
- active_list_t *node = parser->active;
-
- if (node == NULL) {
- parser->active = NULL;
- return;
- }
-
- node = parser->active->next;
- ralloc_free (parser->active);
-
- parser->active = node;
-}
-
-static int
-_parser_active_list_contains (glcpp_parser_t *parser, const char *identifier)
-{
- active_list_t *node;
-
- if (parser->active == NULL)
- return 0;
-
- for (node = parser->active; node; node = node->next)
- if (strcmp (node->identifier, identifier) == 0)
- return 1;
-
- return 0;
-}
-
-/* Walk over the token list replacing nodes with their expansion.
- * Whenever nodes are expanded the walking will walk over the new
- * nodes, continuing to expand as necessary. The results are placed in
- * 'list' itself;
- */
-static void
-_glcpp_parser_expand_token_list (glcpp_parser_t *parser,
- token_list_t *list)
-{
- token_node_t *node_prev;
- token_node_t *node, *last = NULL;
- token_list_t *expansion;
- active_list_t *active_initial = parser->active;
-
- if (list == NULL)
- return;
-
- _token_list_trim_trailing_space (list);
-
- node_prev = NULL;
- node = list->head;
-
- while (node) {
-
- while (parser->active && parser->active->marker == node)
- _parser_active_list_pop (parser);
-
- expansion = _glcpp_parser_expand_node (parser, node, &last);
- if (expansion) {
- token_node_t *n;
-
- for (n = node; n != last->next; n = n->next)
- while (parser->active &&
- parser->active->marker == n)
- {
- _parser_active_list_pop (parser);
- }
-
- _parser_active_list_push (parser,
- node->token->value.str,
- last->next);
-
- /* Splice expansion into list, supporting a
- * simple deletion if the expansion is
- * empty. */
- if (expansion->head) {
- if (node_prev)
- node_prev->next = expansion->head;
- else
- list->head = expansion->head;
- expansion->tail->next = last->next;
- if (last == list->tail)
- list->tail = expansion->tail;
- } else {
- if (node_prev)
- node_prev->next = last->next;
- else
- list->head = last->next;
- if (last == list->tail)
- list->tail = NULL;
- }
- } else {
- node_prev = node;
- }
- node = node_prev ? node_prev->next : list->head;
- }
-
- /* Remove any lingering effects of this invocation on the
- * active list. That is, pop until the list looks like it did
- * at the beginning of this function. */
- while (parser->active && parser->active != active_initial)
- _parser_active_list_pop (parser);
-
- list->non_space_tail = list->tail;
-}
-
-void
-_glcpp_parser_print_expanded_token_list (glcpp_parser_t *parser,
- token_list_t *list)
-{
- if (list == NULL)
- return;
-
- _glcpp_parser_expand_token_list (parser, list);
-
- _token_list_trim_trailing_space (list);
-
- _token_list_print (parser, list);
-}
-
-static void
-_check_for_reserved_macro_name (glcpp_parser_t *parser, YYLTYPE *loc,
- const char *identifier)
-{
- /* According to the GLSL specification, macro names starting with "__"
- * or "GL_" are reserved for future use. So, don't allow them.
- */
- if (strncmp(identifier, "__", 2) == 0) {
- glcpp_error (loc, parser, "Macro names starting with \"__\" are reserved.\n");
- }
- if (strncmp(identifier, "GL_", 3) == 0) {
- glcpp_error (loc, parser, "Macro names starting with \"GL_\" are reserved.\n");
- }
-}
-
-static int
-_macro_equal (macro_t *a, macro_t *b)
-{
- if (a->is_function != b->is_function)
- return 0;
-
- if (a->is_function) {
- if (! _string_list_equal (a->parameters, b->parameters))
- return 0;
- }
-
- return _token_list_equal_ignoring_space (a->replacements,
- b->replacements);
-}
-
-void
-_define_object_macro (glcpp_parser_t *parser,
- YYLTYPE *loc,
- const char *identifier,
- token_list_t *replacements)
-{
- macro_t *macro, *previous;
-
- if (loc != NULL)
- _check_for_reserved_macro_name(parser, loc, identifier);
-
- macro = ralloc (parser, macro_t);
-
- macro->is_function = 0;
- macro->parameters = NULL;
- macro->identifier = ralloc_strdup (macro, identifier);
- macro->replacements = replacements;
- ralloc_steal (macro, replacements);
-
- previous = hash_table_find (parser->defines, identifier);
- if (previous) {
- if (_macro_equal (macro, previous)) {
- ralloc_free (macro);
- return;
- }
- glcpp_error (loc, parser, "Redefinition of macro %s\n",
- identifier);
- }
-
- hash_table_insert (parser->defines, macro, identifier);
-}
-
-void
-_define_function_macro (glcpp_parser_t *parser,
- YYLTYPE *loc,
- const char *identifier,
- string_list_t *parameters,
- token_list_t *replacements)
-{
- macro_t *macro, *previous;
-
- _check_for_reserved_macro_name(parser, loc, identifier);
-
- macro = ralloc (parser, macro_t);
- ralloc_steal (macro, parameters);
- ralloc_steal (macro, replacements);
-
- macro->is_function = 1;
- macro->parameters = parameters;
- macro->identifier = ralloc_strdup (macro, identifier);
- macro->replacements = replacements;
- previous = hash_table_find (parser->defines, identifier);
- if (previous) {
- if (_macro_equal (macro, previous)) {
- ralloc_free (macro);
- return;
- }
- glcpp_error (loc, parser, "Redefinition of macro %s\n",
- identifier);
- }
-
- hash_table_insert (parser->defines, macro, identifier);
-}
-
-static int
-glcpp_parser_lex (YYSTYPE *yylval, YYLTYPE *yylloc, glcpp_parser_t *parser)
-{
- token_node_t *node;
- int ret;
-
- if (parser->lex_from_list == NULL) {
- ret = glcpp_lex (yylval, yylloc, parser->scanner);
-
- /* XXX: This ugly block of code exists for the sole
- * purpose of converting a NEWLINE token into a SPACE
- * token, but only in the case where we have seen a
- * function-like macro name, but have not yet seen its
- * closing parenthesis.
- *
- * There's perhaps a more compact way to do this with
- * mid-rule actions in the grammar.
- *
- * I'm definitely not pleased with the complexity of
- * this code here.
- */
- if (parser->newline_as_space)
- {
- if (ret == '(') {
- parser->paren_count++;
- } else if (ret == ')') {
- parser->paren_count--;
- if (parser->paren_count == 0)
- parser->newline_as_space = 0;
- } else if (ret == NEWLINE) {
- ret = SPACE;
- } else if (ret != SPACE) {
- if (parser->paren_count == 0)
- parser->newline_as_space = 0;
- }
- }
- else if (parser->in_control_line)
- {
- if (ret == NEWLINE)
- parser->in_control_line = 0;
- }
- else if (ret == HASH_DEFINE_OBJ || ret == HASH_DEFINE_FUNC ||
- ret == HASH_UNDEF || ret == HASH_IF ||
- ret == HASH_IFDEF || ret == HASH_IFNDEF ||
- ret == HASH_ELIF || ret == HASH_ELSE ||
- ret == HASH_ENDIF || ret == HASH)
- {
- parser->in_control_line = 1;
- }
- else if (ret == IDENTIFIER)
- {
- macro_t *macro;
- macro = hash_table_find (parser->defines,
- yylval->str);
- if (macro && macro->is_function) {
- parser->newline_as_space = 1;
- parser->paren_count = 0;
- }
- }
-
- return ret;
- }
-
- node = parser->lex_from_node;
-
- if (node == NULL) {
- ralloc_free (parser->lex_from_list);
- parser->lex_from_list = NULL;
- return NEWLINE;
- }
-
- *yylval = node->token->value;
- ret = node->token->type;
-
- parser->lex_from_node = node->next;
-
- return ret;
-}
-
-static void
-glcpp_parser_lex_from (glcpp_parser_t *parser, token_list_t *list)
-{
- token_node_t *node;
-
- assert (parser->lex_from_list == NULL);
-
- /* Copy list, eliminating any space tokens. */
- parser->lex_from_list = _token_list_create (parser);
-
- for (node = list->head; node; node = node->next) {
- if (node->token->type == SPACE)
- continue;
- _token_list_append (parser->lex_from_list, node->token);
- }
-
- ralloc_free (list);
-
- parser->lex_from_node = parser->lex_from_list->head;
-
- /* It's possible the list consisted of nothing but whitespace. */
- if (parser->lex_from_node == NULL) {
- ralloc_free (parser->lex_from_list);
- parser->lex_from_list = NULL;
- }
-}
-
-static void
-_glcpp_parser_skip_stack_push_if (glcpp_parser_t *parser, YYLTYPE *loc,
- int condition)
-{
- skip_type_t current = SKIP_NO_SKIP;
- skip_node_t *node;
-
- if (parser->skip_stack)
- current = parser->skip_stack->type;
-
- node = ralloc (parser, skip_node_t);
- node->loc = *loc;
-
- if (current == SKIP_NO_SKIP) {
- if (condition)
- node->type = SKIP_NO_SKIP;
- else
- node->type = SKIP_TO_ELSE;
- } else {
- node->type = SKIP_TO_ENDIF;
- }
-
- node->next = parser->skip_stack;
- parser->skip_stack = node;
-}
-
-static void
-_glcpp_parser_skip_stack_change_if (glcpp_parser_t *parser, YYLTYPE *loc,
- const char *type, int condition)
-{
- if (parser->skip_stack == NULL) {
- glcpp_error (loc, parser, "%s without #if\n", type);
- return;
- }
-
- if (parser->skip_stack->type == SKIP_TO_ELSE) {
- if (condition)
- parser->skip_stack->type = SKIP_NO_SKIP;
- } else {
- parser->skip_stack->type = SKIP_TO_ENDIF;
- }
-}
-
-static void
-_glcpp_parser_skip_stack_pop (glcpp_parser_t *parser, YYLTYPE *loc)
-{
- skip_node_t *node;
-
- if (parser->skip_stack == NULL) {
- glcpp_error (loc, parser, "#endif without #if\n");
- return;
- }
-
- node = parser->skip_stack;
- parser->skip_stack = node->next;
- ralloc_free (node);
-}
+%{
+/*
+ * Copyright © 2010 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <assert.h>
+#include <inttypes.h>
+
+#include "glcpp.h"
+#include "main/core.h" /* for struct gl_extensions */
+#include "main/mtypes.h" /* for gl_api enum */
+
+static void
+yyerror (YYLTYPE *locp, glcpp_parser_t *parser, const char *error);
+
+static void
+_define_object_macro (glcpp_parser_t *parser,
+ YYLTYPE *loc,
+ const char *macro,
+ token_list_t *replacements);
+
+static void
+_define_function_macro (glcpp_parser_t *parser,
+ YYLTYPE *loc,
+ const char *macro,
+ string_list_t *parameters,
+ token_list_t *replacements);
+
+static string_list_t *
+_string_list_create (void *ctx);
+
+static void
+_string_list_append_item (string_list_t *list, const char *str);
+
+static int
+_string_list_contains (string_list_t *list, const char *member, int *index);
+
+static int
+_string_list_length (string_list_t *list);
+
+static int
+_string_list_equal (string_list_t *a, string_list_t *b);
+
+static argument_list_t *
+_argument_list_create (void *ctx);
+
+static void
+_argument_list_append (argument_list_t *list, token_list_t *argument);
+
+static int
+_argument_list_length (argument_list_t *list);
+
+static token_list_t *
+_argument_list_member_at (argument_list_t *list, int index);
+
+/* Note: This function ralloc_steal()s the str pointer. */
+static token_t *
+_token_create_str (void *ctx, int type, char *str);
+
+static token_t *
+_token_create_ival (void *ctx, int type, int ival);
+
+static token_list_t *
+_token_list_create (void *ctx);
+
+/* Note: This function calls ralloc_steal on token. */
+static void
+_token_list_append (token_list_t *list, token_t *token);
+
+static void
+_token_list_append_list (token_list_t *list, token_list_t *tail);
+
+static int
+_token_list_equal_ignoring_space (token_list_t *a, token_list_t *b);
+
+static void
+_parser_active_list_push (glcpp_parser_t *parser,
+ const char *identifier,
+ token_node_t *marker);
+
+static void
+_parser_active_list_pop (glcpp_parser_t *parser);
+
+static int
+_parser_active_list_contains (glcpp_parser_t *parser, const char *identifier);
+
+static void
+_glcpp_parser_expand_if (glcpp_parser_t *parser, int type, token_list_t *list);
+
+static void
+_glcpp_parser_expand_token_list (glcpp_parser_t *parser,
+ token_list_t *list);
+
+static void
+_glcpp_parser_print_expanded_token_list (glcpp_parser_t *parser,
+ token_list_t *list);
+
+static void
+_glcpp_parser_skip_stack_push_if (glcpp_parser_t *parser, YYLTYPE *loc,
+ int condition);
+
+static void
+_glcpp_parser_skip_stack_change_if (glcpp_parser_t *parser, YYLTYPE *loc,
+ const char *type, int condition);
+
+static void
+_glcpp_parser_skip_stack_pop (glcpp_parser_t *parser, YYLTYPE *loc);
+
+#define yylex glcpp_parser_lex
+
+static int
+glcpp_parser_lex (YYSTYPE *yylval, YYLTYPE *yylloc, glcpp_parser_t *parser);
+
+static void
+glcpp_parser_lex_from (glcpp_parser_t *parser, token_list_t *list);
+
+static void
+add_builtin_define(glcpp_parser_t *parser, const char *name, int value);
+
+%}
+
+%pure-parser
+%error-verbose
+
+%locations
+%initial-action {
+ @$.first_line = 1;
+ @$.first_column = 1;
+ @$.last_line = 1;
+ @$.last_column = 1;
+ @$.source = 0;
+}
+
+%parse-param {glcpp_parser_t *parser}
+%lex-param {glcpp_parser_t *parser}
+
+%expect 0
+%token COMMA_FINAL DEFINED ELIF_EXPANDED HASH HASH_DEFINE_FUNC HASH_DEFINE_OBJ HASH_ELIF HASH_ELSE HASH_ENDIF HASH_IF HASH_IFDEF HASH_IFNDEF HASH_UNDEF HASH_VERSION IDENTIFIER IF_EXPANDED INTEGER INTEGER_STRING NEWLINE OTHER PLACEHOLDER SPACE
+%token PASTE
+%type <ival> expression INTEGER operator SPACE integer_constant
+%type <str> IDENTIFIER INTEGER_STRING OTHER
+%type <string_list> identifier_list
+%type <token> preprocessing_token conditional_token
+%type <token_list> pp_tokens replacement_list text_line conditional_tokens
+%left OR
+%left AND
+%left '|'
+%left '^'
+%left '&'
+%left EQUAL NOT_EQUAL
+%left '<' '>' LESS_OR_EQUAL GREATER_OR_EQUAL
+%left LEFT_SHIFT RIGHT_SHIFT
+%left '+' '-'
+%left '*' '/' '%'
+%right UNARY
+
+%%
+
+input:
+ /* empty */
+| input line
+;
+
+line:
+ control_line {
+ ralloc_strcat (&parser->output, "\n");
+ }
+| text_line {
+ _glcpp_parser_print_expanded_token_list (parser, $1);
+ ralloc_strcat (&parser->output, "\n");
+ ralloc_free ($1);
+ }
+| expanded_line
+| HASH non_directive
+;
+
+expanded_line:
+ IF_EXPANDED expression NEWLINE {
+ _glcpp_parser_skip_stack_push_if (parser, & @1, $2);
+ }
+| ELIF_EXPANDED expression NEWLINE {
+ _glcpp_parser_skip_stack_change_if (parser, & @1, "elif", $2);
+ }
+;
+
+control_line:
+ HASH_DEFINE_OBJ IDENTIFIER replacement_list NEWLINE {
+ _define_object_macro (parser, & @2, $2, $3);
+ }
+| HASH_DEFINE_FUNC IDENTIFIER '(' ')' replacement_list NEWLINE {
+ _define_function_macro (parser, & @2, $2, NULL, $5);
+ }
+| HASH_DEFINE_FUNC IDENTIFIER '(' identifier_list ')' replacement_list NEWLINE {
+ _define_function_macro (parser, & @2, $2, $4, $6);
+ }
+| HASH_UNDEF IDENTIFIER NEWLINE {
+ macro_t *macro = hash_table_find (parser->defines, $2);
+ if (macro) {
+ hash_table_remove (parser->defines, $2);
+ ralloc_free (macro);
+ }
+ ralloc_free ($2);
+ }
+| HASH_IF conditional_tokens NEWLINE {
+ /* Be careful to only evaluate the 'if' expression if
+ * we are not skipping. When we are skipping, we
+ * simply push a new 0-valued 'if' onto the skip
+ * stack.
+ *
+ * This avoids generating diagnostics for invalid
+ * expressions that are being skipped. */
+ if (parser->skip_stack == NULL ||
+ parser->skip_stack->type == SKIP_NO_SKIP)
+ {
+ _glcpp_parser_expand_if (parser, IF_EXPANDED, $2);
+ }
+ else
+ {
+ _glcpp_parser_skip_stack_push_if (parser, & @1, 0);
+ parser->skip_stack->type = SKIP_TO_ENDIF;
+ }
+ }
+| HASH_IF NEWLINE {
+ /* #if without an expression is only an error if we
+ * are not skipping */
+ if (parser->skip_stack == NULL ||
+ parser->skip_stack->type == SKIP_NO_SKIP)
+ {
+ glcpp_error(& @1, parser, "#if with no expression");
+ }
+ _glcpp_parser_skip_stack_push_if (parser, & @1, 0);
+ }
+| HASH_IFDEF IDENTIFIER junk NEWLINE {
+ macro_t *macro = hash_table_find (parser->defines, $2);
+ ralloc_free ($2);
+ _glcpp_parser_skip_stack_push_if (parser, & @1, macro != NULL);
+ }
+| HASH_IFNDEF IDENTIFIER junk NEWLINE {
+ macro_t *macro = hash_table_find (parser->defines, $2);
+ ralloc_free ($2);
+ _glcpp_parser_skip_stack_push_if (parser, & @1, macro == NULL);
+ }
+| HASH_ELIF conditional_tokens NEWLINE {
+ /* Be careful to only evaluate the 'elif' expression
+ * if we are not skipping. When we are skipping, we
+ * simply change to a 0-valued 'elif' on the skip
+ * stack.
+ *
+ * This avoids generating diagnostics for invalid
+ * expressions that are being skipped. */
+ if (parser->skip_stack &&
+ parser->skip_stack->type == SKIP_TO_ELSE)
+ {
+ _glcpp_parser_expand_if (parser, ELIF_EXPANDED, $2);
+ }
+ else
+ {
+ _glcpp_parser_skip_stack_change_if (parser, & @1,
+ "elif", 0);
+ }
+ }
+| HASH_ELIF NEWLINE {
+ /* #elif without an expression is an error unless we
+ * are skipping. */
+ if (parser->skip_stack &&
+ parser->skip_stack->type == SKIP_TO_ELSE)
+ {
+ glcpp_error(& @1, parser, "#elif with no expression");
+ }
+ else
+ {
+ _glcpp_parser_skip_stack_change_if (parser, & @1,
+ "elif", 0);
+ glcpp_warning(& @1, parser, "ignoring illegal #elif without expression");
+ }
+ }
+| HASH_ELSE NEWLINE {
+ _glcpp_parser_skip_stack_change_if (parser, & @1, "else", 1);
+ }
+| HASH_ENDIF NEWLINE {
+ _glcpp_parser_skip_stack_pop (parser, & @1);
+ }
+| HASH_VERSION integer_constant NEWLINE {
+ macro_t *macro = hash_table_find (parser->defines, "__VERSION__");
+ if (macro) {
+ hash_table_remove (parser->defines, "__VERSION__");
+ ralloc_free (macro);
+ }
+ add_builtin_define (parser, "__VERSION__", $2);
+
+ if ($2 == 100)
+ add_builtin_define (parser, "GL_ES", 1);
+
+ /* Currently, all ES2 implementations support highp in the
+ * fragment shader, so we always define this macro in ES2.
+ * If we ever get a driver that doesn't support highp, we'll
+ * need to add a flag to the gl_context and check that here.
+ */
+ if ($2 >= 130 || $2 == 100)
+ add_builtin_define (parser, "GL_FRAGMENT_PRECISION_HIGH", 1);
+
+ ralloc_asprintf_append (&parser->output, "#version %" PRIiMAX, $2);
+ }
+| HASH NEWLINE
+;
+
+integer_constant:
+ INTEGER_STRING {
+ if (strlen ($1) >= 3 && strncmp ($1, "0x", 2) == 0) {
+ $$ = strtoll ($1 + 2, NULL, 16);
+ } else if ($1[0] == '0') {
+ $$ = strtoll ($1, NULL, 8);
+ } else {
+ $$ = strtoll ($1, NULL, 10);
+ }
+ }
+| INTEGER {
+ $$ = $1;
+ }
+
+expression:
+ integer_constant
+| expression OR expression {
+ $$ = $1 || $3;
+ }
+| expression AND expression {
+ $$ = $1 && $3;
+ }
+| expression '|' expression {
+ $$ = $1 | $3;
+ }
+| expression '^' expression {
+ $$ = $1 ^ $3;
+ }
+| expression '&' expression {
+ $$ = $1 & $3;
+ }
+| expression NOT_EQUAL expression {
+ $$ = $1 != $3;
+ }
+| expression EQUAL expression {
+ $$ = $1 == $3;
+ }
+| expression GREATER_OR_EQUAL expression {
+ $$ = $1 >= $3;
+ }
+| expression LESS_OR_EQUAL expression {
+ $$ = $1 <= $3;
+ }
+| expression '>' expression {
+ $$ = $1 > $3;
+ }
+| expression '<' expression {
+ $$ = $1 < $3;
+ }
+| expression RIGHT_SHIFT expression {
+ $$ = $1 >> $3;
+ }
+| expression LEFT_SHIFT expression {
+ $$ = $1 << $3;
+ }
+| expression '-' expression {
+ $$ = $1 - $3;
+ }
+| expression '+' expression {
+ $$ = $1 + $3;
+ }
+| expression '%' expression {
+ if ($3 == 0) {
+ yyerror (& @1, parser,
+ "zero modulus in preprocessor directive");
+ } else {
+ $$ = $1 % $3;
+ }
+ }
+| expression '/' expression {
+ if ($3 == 0) {
+ yyerror (& @1, parser,
+ "division by 0 in preprocessor directive");
+ } else {
+ $$ = $1 / $3;
+ }
+ }
+| expression '*' expression {
+ $$ = $1 * $3;
+ }
+| '!' expression %prec UNARY {
+ $$ = ! $2;
+ }
+| '~' expression %prec UNARY {
+ $$ = ~ $2;
+ }
+| '-' expression %prec UNARY {
+ $$ = - $2;
+ }
+| '+' expression %prec UNARY {
+ $$ = + $2;
+ }
+| '(' expression ')' {
+ $$ = $2;
+ }
+;
+
+identifier_list:
+ IDENTIFIER {
+ $$ = _string_list_create (parser);
+ _string_list_append_item ($$, $1);
+ ralloc_steal ($$, $1);
+ }
+| identifier_list ',' IDENTIFIER {
+ $$ = $1;
+ _string_list_append_item ($$, $3);
+ ralloc_steal ($$, $3);
+ }
+;
+
+text_line:
+ NEWLINE { $$ = NULL; }
+| pp_tokens NEWLINE
+;
+
+non_directive:
+ pp_tokens NEWLINE {
+ yyerror (& @1, parser, "Invalid tokens after #");
+ }
+;
+
+replacement_list:
+ /* empty */ { $$ = NULL; }
+| pp_tokens
+;
+
+junk:
+ /* empty */
+| pp_tokens {
+ glcpp_warning(&@1, parser, "extra tokens at end of directive");
+ }
+;
+
+conditional_token:
+ /* Handle "defined" operator */
+ DEFINED IDENTIFIER {
+ int v = hash_table_find (parser->defines, $2) ? 1 : 0;
+ $$ = _token_create_ival (parser, INTEGER, v);
+ }
+| DEFINED '(' IDENTIFIER ')' {
+ int v = hash_table_find (parser->defines, $3) ? 1 : 0;
+ $$ = _token_create_ival (parser, INTEGER, v);
+ }
+| preprocessing_token
+;
+
+conditional_tokens:
+ /* Exactly the same as pp_tokens, but using conditional_token */
+ conditional_token {
+ $$ = _token_list_create (parser);
+ _token_list_append ($$, $1);
+ }
+| conditional_tokens conditional_token {
+ $$ = $1;
+ _token_list_append ($$, $2);
+ }
+;
+
+pp_tokens:
+ preprocessing_token {
+ parser->space_tokens = 1;
+ $$ = _token_list_create (parser);
+ _token_list_append ($$, $1);
+ }
+| pp_tokens preprocessing_token {
+ $$ = $1;
+ _token_list_append ($$, $2);
+ }
+;
+
+preprocessing_token:
+ IDENTIFIER {
+ $$ = _token_create_str (parser, IDENTIFIER, $1);
+ $$->location = yylloc;
+ }
+| INTEGER_STRING {
+ $$ = _token_create_str (parser, INTEGER_STRING, $1);
+ $$->location = yylloc;
+ }
+| operator {
+ $$ = _token_create_ival (parser, $1, $1);
+ $$->location = yylloc;
+ }
+| OTHER {
+ $$ = _token_create_str (parser, OTHER, $1);
+ $$->location = yylloc;
+ }
+| SPACE {
+ $$ = _token_create_ival (parser, SPACE, SPACE);
+ $$->location = yylloc;
+ }
+;
+
+operator:
+ '[' { $$ = '['; }
+| ']' { $$ = ']'; }
+| '(' { $$ = '('; }
+| ')' { $$ = ')'; }
+| '{' { $$ = '{'; }
+| '}' { $$ = '}'; }
+| '.' { $$ = '.'; }
+| '&' { $$ = '&'; }
+| '*' { $$ = '*'; }
+| '+' { $$ = '+'; }
+| '-' { $$ = '-'; }
+| '~' { $$ = '~'; }
+| '!' { $$ = '!'; }
+| '/' { $$ = '/'; }
+| '%' { $$ = '%'; }
+| LEFT_SHIFT { $$ = LEFT_SHIFT; }
+| RIGHT_SHIFT { $$ = RIGHT_SHIFT; }
+| '<' { $$ = '<'; }
+| '>' { $$ = '>'; }
+| LESS_OR_EQUAL { $$ = LESS_OR_EQUAL; }
+| GREATER_OR_EQUAL { $$ = GREATER_OR_EQUAL; }
+| EQUAL { $$ = EQUAL; }
+| NOT_EQUAL { $$ = NOT_EQUAL; }
+| '^' { $$ = '^'; }
+| '|' { $$ = '|'; }
+| AND { $$ = AND; }
+| OR { $$ = OR; }
+| ';' { $$ = ';'; }
+| ',' { $$ = ','; }
+| '=' { $$ = '='; }
+| PASTE { $$ = PASTE; }
+;
+
+%%
+
+string_list_t *
+_string_list_create (void *ctx)
+{
+ string_list_t *list;
+
+ list = ralloc (ctx, string_list_t);
+ list->head = NULL;
+ list->tail = NULL;
+
+ return list;
+}
+
+void
+_string_list_append_item (string_list_t *list, const char *str)
+{
+ string_node_t *node;
+
+ node = ralloc (list, string_node_t);
+ node->str = ralloc_strdup (node, str);
+
+ node->next = NULL;
+
+ if (list->head == NULL) {
+ list->head = node;
+ } else {
+ list->tail->next = node;
+ }
+
+ list->tail = node;
+}
+
+int
+_string_list_contains (string_list_t *list, const char *member, int *index)
+{
+ string_node_t *node;
+ int i;
+
+ if (list == NULL)
+ return 0;
+
+ for (i = 0, node = list->head; node; i++, node = node->next) {
+ if (strcmp (node->str, member) == 0) {
+ if (index)
+ *index = i;
+ return 1;
+ }
+ }
+
+ return 0;
+}
+
+int
+_string_list_length (string_list_t *list)
+{
+ int length = 0;
+ string_node_t *node;
+
+ if (list == NULL)
+ return 0;
+
+ for (node = list->head; node; node = node->next)
+ length++;
+
+ return length;
+}
+
+int
+_string_list_equal (string_list_t *a, string_list_t *b)
+{
+ string_node_t *node_a, *node_b;
+
+ if (a == NULL && b == NULL)
+ return 1;
+
+ if (a == NULL || b == NULL)
+ return 0;
+
+ for (node_a = a->head, node_b = b->head;
+ node_a && node_b;
+ node_a = node_a->next, node_b = node_b->next)
+ {
+ if (strcmp (node_a->str, node_b->str))
+ return 0;
+ }
+
+ /* Catch the case of lists being different lengths, (which
+ * would cause the loop above to terminate after the shorter
+ * list). */
+ return node_a == node_b;
+}
+
+argument_list_t *
+_argument_list_create (void *ctx)
+{
+ argument_list_t *list;
+
+ list = ralloc (ctx, argument_list_t);
+ list->head = NULL;
+ list->tail = NULL;
+
+ return list;
+}
+
+void
+_argument_list_append (argument_list_t *list, token_list_t *argument)
+{
+ argument_node_t *node;
+
+ node = ralloc (list, argument_node_t);
+ node->argument = argument;
+
+ node->next = NULL;
+
+ if (list->head == NULL) {
+ list->head = node;
+ } else {
+ list->tail->next = node;
+ }
+
+ list->tail = node;
+}
+
+int
+_argument_list_length (argument_list_t *list)
+{
+ int length = 0;
+ argument_node_t *node;
+
+ if (list == NULL)
+ return 0;
+
+ for (node = list->head; node; node = node->next)
+ length++;
+
+ return length;
+}
+
+token_list_t *
+_argument_list_member_at (argument_list_t *list, int index)
+{
+ argument_node_t *node;
+ int i;
+
+ if (list == NULL)
+ return NULL;
+
+ node = list->head;
+ for (i = 0; i < index; i++) {
+ node = node->next;
+ if (node == NULL)
+ break;
+ }
+
+ if (node)
+ return node->argument;
+
+ return NULL;
+}
+
+/* Note: This function ralloc_steal()s the str pointer. */
+token_t *
+_token_create_str (void *ctx, int type, char *str)
+{
+ token_t *token;
+
+ token = ralloc (ctx, token_t);
+ token->type = type;
+ token->value.str = str;
+
+ ralloc_steal (token, str);
+
+ return token;
+}
+
+token_t *
+_token_create_ival (void *ctx, int type, int ival)
+{
+ token_t *token;
+
+ token = ralloc (ctx, token_t);
+ token->type = type;
+ token->value.ival = ival;
+
+ return token;
+}
+
+token_list_t *
+_token_list_create (void *ctx)
+{
+ token_list_t *list;
+
+ list = ralloc (ctx, token_list_t);
+ list->head = NULL;
+ list->tail = NULL;
+ list->non_space_tail = NULL;
+
+ return list;
+}
+
+void
+_token_list_append (token_list_t *list, token_t *token)
+{
+ token_node_t *node;
+
+ node = ralloc (list, token_node_t);
+ node->token = token;
+ node->next = NULL;
+
+ ralloc_steal (list, token);
+
+ if (list->head == NULL) {
+ list->head = node;
+ } else {
+ list->tail->next = node;
+ }
+
+ list->tail = node;
+ if (token->type != SPACE)
+ list->non_space_tail = node;
+}
+
+void
+_token_list_append_list (token_list_t *list, token_list_t *tail)
+{
+ if (tail == NULL || tail->head == NULL)
+ return;
+
+ if (list->head == NULL) {
+ list->head = tail->head;
+ } else {
+ list->tail->next = tail->head;
+ }
+
+ list->tail = tail->tail;
+ list->non_space_tail = tail->non_space_tail;
+}
+
+static token_list_t *
+_token_list_copy (void *ctx, token_list_t *other)
+{
+ token_list_t *copy;
+ token_node_t *node;
+
+ if (other == NULL)
+ return NULL;
+
+ copy = _token_list_create (ctx);
+ for (node = other->head; node; node = node->next) {
+ token_t *new_token = ralloc (copy, token_t);
+ *new_token = *node->token;
+ _token_list_append (copy, new_token);
+ }
+
+ return copy;
+}
+
+static void
+_token_list_trim_trailing_space (token_list_t *list)
+{
+ token_node_t *tail, *next;
+
+ if (list->non_space_tail) {
+ tail = list->non_space_tail->next;
+ list->non_space_tail->next = NULL;
+ list->tail = list->non_space_tail;
+
+ while (tail) {
+ next = tail->next;
+ ralloc_free (tail);
+ tail = next;
+ }
+ }
+}
+
+static int
+_token_list_is_empty_ignoring_space (token_list_t *l)
+{
+ token_node_t *n;
+
+ if (l == NULL)
+ return 1;
+
+ n = l->head;
+ while (n != NULL && n->token->type == SPACE)
+ n = n->next;
+
+ return n == NULL;
+}
+
+int
+_token_list_equal_ignoring_space (token_list_t *a, token_list_t *b)
+{
+ token_node_t *node_a, *node_b;
+
+ if (a == NULL || b == NULL) {
+ int a_empty = _token_list_is_empty_ignoring_space(a);
+ int b_empty = _token_list_is_empty_ignoring_space(b);
+ return a_empty == b_empty;
+ }
+
+ node_a = a->head;
+ node_b = b->head;
+
+ while (1)
+ {
+ if (node_a == NULL && node_b == NULL)
+ break;
+
+ if (node_a == NULL || node_b == NULL)
+ return 0;
+
+ if (node_a->token->type == SPACE) {
+ node_a = node_a->next;
+ continue;
+ }
+
+ if (node_b->token->type == SPACE) {
+ node_b = node_b->next;
+ continue;
+ }
+
+ if (node_a->token->type != node_b->token->type)
+ return 0;
+
+ switch (node_a->token->type) {
+ case INTEGER:
+ if (node_a->token->value.ival !=
+ node_b->token->value.ival)
+ {
+ return 0;
+ }
+ break;
+ case IDENTIFIER:
+ case INTEGER_STRING:
+ case OTHER:
+ if (strcmp (node_a->token->value.str,
+ node_b->token->value.str))
+ {
+ return 0;
+ }
+ break;
+ }
+
+ node_a = node_a->next;
+ node_b = node_b->next;
+ }
+
+ return 1;
+}
+
+static void
+_token_print (char **out, token_t *token)
+{
+ if (token->type < 256) {
+ ralloc_asprintf_append (out, "%c", token->type);
+ return;
+ }
+
+ switch (token->type) {
+ case INTEGER:
+ ralloc_asprintf_append (out, "%" PRIiMAX, token->value.ival);
+ break;
+ case IDENTIFIER:
+ case INTEGER_STRING:
+ case OTHER:
+ ralloc_strcat (out, token->value.str);
+ break;
+ case SPACE:
+ ralloc_strcat (out, " ");
+ break;
+ case LEFT_SHIFT:
+ ralloc_strcat (out, "<<");
+ break;
+ case RIGHT_SHIFT:
+ ralloc_strcat (out, ">>");
+ break;
+ case LESS_OR_EQUAL:
+ ralloc_strcat (out, "<=");
+ break;
+ case GREATER_OR_EQUAL:
+ ralloc_strcat (out, ">=");
+ break;
+ case EQUAL:
+ ralloc_strcat (out, "==");
+ break;
+ case NOT_EQUAL:
+ ralloc_strcat (out, "!=");
+ break;
+ case AND:
+ ralloc_strcat (out, "&&");
+ break;
+ case OR:
+ ralloc_strcat (out, "||");
+ break;
+ case PASTE:
+ ralloc_strcat (out, "##");
+ break;
+ case COMMA_FINAL:
+ ralloc_strcat (out, ",");
+ break;
+ case PLACEHOLDER:
+ /* Nothing to print. */
+ break;
+ default:
+ assert(!"Error: Don't know how to print token.");
+ break;
+ }
+}
+
+/* Return a new token (ralloc()ed off of 'token') formed by pasting
+ * 'token' and 'other'. Note that this function may return 'token' or
+ * 'other' directly rather than allocating anything new.
+ *
+ * Caution: Only very cursory error-checking is performed to see if
+ * the final result is a valid single token. */
+static token_t *
+_token_paste (glcpp_parser_t *parser, token_t *token, token_t *other)
+{
+ token_t *combined = NULL;
+
+ /* Pasting a placeholder onto anything makes no change. */
+ if (other->type == PLACEHOLDER)
+ return token;
+
+ /* When 'token' is a placeholder, just return 'other'. */
+ if (token->type == PLACEHOLDER)
+ return other;
+
+ /* A very few single-character punctuators can be combined
+ * with another to form a multi-character punctuator. */
+ switch (token->type) {
+ case '<':
+ if (other->type == '<')
+ combined = _token_create_ival (token, LEFT_SHIFT, LEFT_SHIFT);
+ else if (other->type == '=')
+ combined = _token_create_ival (token, LESS_OR_EQUAL, LESS_OR_EQUAL);
+ break;
+ case '>':
+ if (other->type == '>')
+ combined = _token_create_ival (token, RIGHT_SHIFT, RIGHT_SHIFT);
+ else if (other->type == '=')
+ combined = _token_create_ival (token, GREATER_OR_EQUAL, GREATER_OR_EQUAL);
+ break;
+ case '=':
+ if (other->type == '=')
+ combined = _token_create_ival (token, EQUAL, EQUAL);
+ break;
+ case '!':
+ if (other->type == '=')
+ combined = _token_create_ival (token, NOT_EQUAL, NOT_EQUAL);
+ break;
+ case '&':
+ if (other->type == '&')
+ combined = _token_create_ival (token, AND, AND);
+ break;
+ case '|':
+ if (other->type == '|')
+ combined = _token_create_ival (token, OR, OR);
+ break;
+ }
+
+ if (combined != NULL) {
+ /* Inherit the location from the first token */
+ combined->location = token->location;
+ return combined;
+ }
+
+ /* Two string-valued tokens can usually just be mashed
+ * together.
+ *
+ * XXX: This isn't actually legitimate. Several things here
+ * should result in a diagnostic since the result cannot be a
+ * valid, single pre-processing token. For example, pasting
+ * "123" and "abc" is not legal, but we don't catch that
+ * here. */
+ if ((token->type == IDENTIFIER || token->type == OTHER || token->type == INTEGER_STRING) &&
+ (other->type == IDENTIFIER || other->type == OTHER || other->type == INTEGER_STRING))
+ {
+ char *str;
+
+ str = ralloc_asprintf (token, "%s%s", token->value.str,
+ other->value.str);
+ combined = _token_create_str (token, token->type, str);
+ combined->location = token->location;
+ return combined;
+ }
+
+ glcpp_error (&token->location, parser, "");
+ ralloc_strcat (&parser->info_log, "Pasting \"");
+ _token_print (&parser->info_log, token);
+ ralloc_strcat (&parser->info_log, "\" and \"");
+ _token_print (&parser->info_log, other);
+ ralloc_strcat (&parser->info_log, "\" does not give a valid preprocessing token.\n");
+
+ return token;
+}
+
+static void
+_token_list_print (glcpp_parser_t *parser, token_list_t *list)
+{
+ token_node_t *node;
+
+ if (list == NULL)
+ return;
+
+ for (node = list->head; node; node = node->next)
+ _token_print (&parser->output, node->token);
+}
+
+void
+yyerror (YYLTYPE *locp, glcpp_parser_t *parser, const char *error)
+{
+ glcpp_error(locp, parser, "%s", error);
+}
+
+static void add_builtin_define(glcpp_parser_t *parser,
+ const char *name, int value)
+{
+ token_t *tok;
+ token_list_t *list;
+
+ tok = _token_create_ival (parser, INTEGER, value);
+
+ list = _token_list_create(parser);
+ _token_list_append(list, tok);
+ _define_object_macro(parser, NULL, name, list);
+}
+
+glcpp_parser_t *
+glcpp_parser_create (const struct gl_extensions *extensions, int api)
+{
+ glcpp_parser_t *parser;
+ int language_version;
+
+ parser = ralloc (NULL, glcpp_parser_t);
+
+ glcpp_lex_init_extra (parser, &parser->scanner);
+ parser->defines = hash_table_ctor (32, hash_table_string_hash,
+ hash_table_string_compare);
+ parser->active = NULL;
+ parser->lexing_if = 0;
+ parser->space_tokens = 1;
+ parser->newline_as_space = 0;
+ parser->in_control_line = 0;
+ parser->paren_count = 0;
+
+ parser->skip_stack = NULL;
+
+ parser->lex_from_list = NULL;
+ parser->lex_from_node = NULL;
+
+ parser->output = ralloc_strdup(parser, "");
+ parser->info_log = ralloc_strdup(parser, "");
+ parser->error = 0;
+
+ /* Add pre-defined macros. */
+ add_builtin_define(parser, "GL_ARB_draw_buffers", 1);
+ add_builtin_define(parser, "GL_ARB_texture_rectangle", 1);
+
+ if (api == API_OPENGLES2)
+ add_builtin_define(parser, "GL_ES", 1);
+
+ if (extensions != NULL) {
+ if (extensions->EXT_texture_array) {
+ add_builtin_define(parser, "GL_EXT_texture_array", 1);
+ }
+
+ if (extensions->ARB_fragment_coord_conventions)
+ add_builtin_define(parser, "GL_ARB_fragment_coord_conventions",
+ 1);
+
+ if (extensions->ARB_explicit_attrib_location)
+ add_builtin_define(parser, "GL_ARB_explicit_attrib_location", 1);
+
+ if (extensions->ARB_shader_texture_lod)
+ add_builtin_define(parser, "GL_ARB_shader_texture_lod", 1);
+
+ if (extensions->AMD_conservative_depth)
+ add_builtin_define(parser, "GL_AMD_conservative_depth", 1);
+ }
+
+ language_version = 110;
+ add_builtin_define(parser, "__VERSION__", language_version);
+
+ return parser;
+}
+
+int
+glcpp_parser_parse (glcpp_parser_t *parser)
+{
+ return yyparse (parser);
+}
+
+void
+glcpp_parser_destroy (glcpp_parser_t *parser)
+{
+ glcpp_lex_destroy (parser->scanner);
+ hash_table_dtor (parser->defines);
+ ralloc_free (parser);
+}
+
+typedef enum function_status
+{
+ FUNCTION_STATUS_SUCCESS,
+ FUNCTION_NOT_A_FUNCTION,
+ FUNCTION_UNBALANCED_PARENTHESES
+} function_status_t;
+
+/* Find a set of function-like macro arguments by looking for a
+ * balanced set of parentheses.
+ *
+ * When called, 'node' should be the opening-parenthesis token, (or
+ * perhaps preceeding SPACE tokens). Upon successful return *last will
+ * be the last consumed node, (corresponding to the closing right
+ * parenthesis).
+ *
+ * Return values:
+ *
+ * FUNCTION_STATUS_SUCCESS:
+ *
+ * Successfully parsed a set of function arguments.
+ *
+ * FUNCTION_NOT_A_FUNCTION:
+ *
+ * Macro name not followed by a '('. This is not an error, but
+ * simply that the macro name should be treated as a non-macro.
+ *
+ * FUNCTION_UNBALANCED_PARENTHESES
+ *
+ * Macro name is not followed by a balanced set of parentheses.
+ */
+static function_status_t
+_arguments_parse (argument_list_t *arguments,
+ token_node_t *node,
+ token_node_t **last)
+{
+ token_list_t *argument;
+ int paren_count;
+
+ node = node->next;
+
+ /* Ignore whitespace before first parenthesis. */
+ while (node && node->token->type == SPACE)
+ node = node->next;
+
+ if (node == NULL || node->token->type != '(')
+ return FUNCTION_NOT_A_FUNCTION;
+
+ node = node->next;
+
+ argument = _token_list_create (arguments);
+ _argument_list_append (arguments, argument);
+
+ for (paren_count = 1; node; node = node->next) {
+ if (node->token->type == '(')
+ {
+ paren_count++;
+ }
+ else if (node->token->type == ')')
+ {
+ paren_count--;
+ if (paren_count == 0)
+ break;
+ }
+
+ if (node->token->type == ',' &&
+ paren_count == 1)
+ {
+ _token_list_trim_trailing_space (argument);
+ argument = _token_list_create (arguments);
+ _argument_list_append (arguments, argument);
+ }
+ else {
+ if (argument->head == NULL) {
+ /* Don't treat initial whitespace as
+ * part of the arguement. */
+ if (node->token->type == SPACE)
+ continue;
+ }
+ _token_list_append (argument, node->token);
+ }
+ }
+
+ if (paren_count)
+ return FUNCTION_UNBALANCED_PARENTHESES;
+
+ *last = node;
+
+ return FUNCTION_STATUS_SUCCESS;
+}
+
+static token_list_t *
+_token_list_create_with_one_space (void *ctx)
+{
+ token_list_t *list;
+ token_t *space;
+
+ list = _token_list_create (ctx);
+ space = _token_create_ival (list, SPACE, SPACE);
+ _token_list_append (list, space);
+
+ return list;
+}
+
+static void
+_glcpp_parser_expand_if (glcpp_parser_t *parser, int type, token_list_t *list)
+{
+ token_list_t *expanded;
+ token_t *token;
+
+ expanded = _token_list_create (parser);
+ token = _token_create_ival (parser, type, type);
+ _token_list_append (expanded, token);
+ _glcpp_parser_expand_token_list (parser, list);
+ _token_list_append_list (expanded, list);
+ glcpp_parser_lex_from (parser, expanded);
+}
+
+/* This is a helper function that's essentially part of the
+ * implementation of _glcpp_parser_expand_node. It shouldn't be called
+ * except for by that function.
+ *
+ * Returns NULL if node is a simple token with no expansion, (that is,
+ * although 'node' corresponds to an identifier defined as a
+ * function-like macro, it is not followed with a parenthesized
+ * argument list).
+ *
+ * Compute the complete expansion of node (which is a function-like
+ * macro) and subsequent nodes which are arguments.
+ *
+ * Returns the token list that results from the expansion and sets
+ * *last to the last node in the list that was consumed by the
+ * expansion. Specifically, *last will be set as follows: as the
+ * token of the closing right parenthesis.
+ */
+static token_list_t *
+_glcpp_parser_expand_function (glcpp_parser_t *parser,
+ token_node_t *node,
+ token_node_t **last)
+
+{
+ macro_t *macro;
+ const char *identifier;
+ argument_list_t *arguments;
+ function_status_t status;
+ token_list_t *substituted;
+ int parameter_index;
+
+ identifier = node->token->value.str;
+
+ macro = hash_table_find (parser->defines, identifier);
+
+ assert (macro->is_function);
+
+ arguments = _argument_list_create (parser);
+ status = _arguments_parse (arguments, node, last);
+
+ switch (status) {
+ case FUNCTION_STATUS_SUCCESS:
+ break;
+ case FUNCTION_NOT_A_FUNCTION:
+ return NULL;
+ case FUNCTION_UNBALANCED_PARENTHESES:
+ glcpp_error (&node->token->location, parser, "Macro %s call has unbalanced parentheses\n", identifier);
+ return NULL;
+ }
+
+ /* Replace a macro defined as empty with a SPACE token. */
+ if (macro->replacements == NULL) {
+ ralloc_free (arguments);
+ return _token_list_create_with_one_space (parser);
+ }
+
+ if (! ((_argument_list_length (arguments) ==
+ _string_list_length (macro->parameters)) ||
+ (_string_list_length (macro->parameters) == 0 &&
+ _argument_list_length (arguments) == 1 &&
+ arguments->head->argument->head == NULL)))
+ {
+ glcpp_error (&node->token->location, parser,
+ "Error: macro %s invoked with %d arguments (expected %d)\n",
+ identifier,
+ _argument_list_length (arguments),
+ _string_list_length (macro->parameters));
+ return NULL;
+ }
+
+ /* Perform argument substitution on the replacement list. */
+ substituted = _token_list_create (arguments);
+
+ for (node = macro->replacements->head; node; node = node->next)
+ {
+ if (node->token->type == IDENTIFIER &&
+ _string_list_contains (macro->parameters,
+ node->token->value.str,
+ &parameter_index))
+ {
+ token_list_t *argument;
+ argument = _argument_list_member_at (arguments,
+ parameter_index);
+ /* Before substituting, we expand the argument
+ * tokens, or append a placeholder token for
+ * an empty argument. */
+ if (argument->head) {
+ token_list_t *expanded_argument;
+ expanded_argument = _token_list_copy (parser,
+ argument);
+ _glcpp_parser_expand_token_list (parser,
+ expanded_argument);
+ _token_list_append_list (substituted,
+ expanded_argument);
+ } else {
+ token_t *new_token;
+
+ new_token = _token_create_ival (substituted,
+ PLACEHOLDER,
+ PLACEHOLDER);
+ _token_list_append (substituted, new_token);
+ }
+ } else {
+ _token_list_append (substituted, node->token);
+ }
+ }
+
+ /* After argument substitution, and before further expansion
+ * below, implement token pasting. */
+
+ _token_list_trim_trailing_space (substituted);
+
+ node = substituted->head;
+ while (node)
+ {
+ token_node_t *next_non_space;
+
+ /* Look ahead for a PASTE token, skipping space. */
+ next_non_space = node->next;
+ while (next_non_space && next_non_space->token->type == SPACE)
+ next_non_space = next_non_space->next;
+
+ if (next_non_space == NULL)
+ break;
+
+ if (next_non_space->token->type != PASTE) {
+ node = next_non_space;
+ continue;
+ }
+
+ /* Now find the next non-space token after the PASTE. */
+ next_non_space = next_non_space->next;
+ while (next_non_space && next_non_space->token->type == SPACE)
+ next_non_space = next_non_space->next;
+
+ if (next_non_space == NULL) {
+ yyerror (&node->token->location, parser, "'##' cannot appear at either end of a macro expansion\n");
+ return NULL;
+ }
+
+ node->token = _token_paste (parser, node->token, next_non_space->token);
+ node->next = next_non_space->next;
+ if (next_non_space == substituted->tail)
+ substituted->tail = node;
+
+ node = node->next;
+ }
+
+ substituted->non_space_tail = substituted->tail;
+
+ return substituted;
+}
+
+/* Compute the complete expansion of node, (and subsequent nodes after
+ * 'node' in the case that 'node' is a function-like macro and
+ * subsequent nodes are arguments).
+ *
+ * Returns NULL if node is a simple token with no expansion.
+ *
+ * Otherwise, returns the token list that results from the expansion
+ * and sets *last to the last node in the list that was consumed by
+ * the expansion. Specifically, *last will be set as follows:
+ *
+ * As 'node' in the case of object-like macro expansion.
+ *
+ * As the token of the closing right parenthesis in the case of
+ * function-like macro expansion.
+ */
+static token_list_t *
+_glcpp_parser_expand_node (glcpp_parser_t *parser,
+ token_node_t *node,
+ token_node_t **last)
+{
+ token_t *token = node->token;
+ const char *identifier;
+ macro_t *macro;
+
+ /* We only expand identifiers */
+ if (token->type != IDENTIFIER) {
+ /* We change any COMMA into a COMMA_FINAL to prevent
+ * it being mistaken for an argument separator
+ * later. */
+ if (token->type == ',') {
+ token->type = COMMA_FINAL;
+ token->value.ival = COMMA_FINAL;
+ }
+
+ return NULL;
+ }
+
+ /* Look up this identifier in the hash table. */
+ identifier = token->value.str;
+ macro = hash_table_find (parser->defines, identifier);
+
+ /* Not a macro, so no expansion needed. */
+ if (macro == NULL)
+ return NULL;
+
+ /* Finally, don't expand this macro if we're already actively
+ * expanding it, (to avoid infinite recursion). */
+ if (_parser_active_list_contains (parser, identifier)) {
+ /* We change the token type here from IDENTIFIER to
+ * OTHER to prevent any future expansion of this
+ * unexpanded token. */
+ char *str;
+ token_list_t *expansion;
+ token_t *final;
+
+ str = ralloc_strdup (parser, token->value.str);
+ final = _token_create_str (parser, OTHER, str);
+ expansion = _token_list_create (parser);
+ _token_list_append (expansion, final);
+ *last = node;
+ return expansion;
+ }
+
+ if (! macro->is_function)
+ {
+ *last = node;
+
+ /* Replace a macro defined as empty with a SPACE token. */
+ if (macro->replacements == NULL)
+ return _token_list_create_with_one_space (parser);
+
+ return _token_list_copy (parser, macro->replacements);
+ }
+
+ return _glcpp_parser_expand_function (parser, node, last);
+}
+
+/* Push a new identifier onto the parser's active list.
+ *
+ * Here, 'marker' is the token node that appears in the list after the
+ * expansion of 'identifier'. That is, when the list iterator begins
+ * examining 'marker', then it is time to pop this node from the
+ * active stack.
+ */
+static void
+_parser_active_list_push (glcpp_parser_t *parser,
+ const char *identifier,
+ token_node_t *marker)
+{
+ active_list_t *node;
+
+ node = ralloc (parser->active, active_list_t);
+ node->identifier = ralloc_strdup (node, identifier);
+ node->marker = marker;
+ node->next = parser->active;
+
+ parser->active = node;
+}
+
+static void
+_parser_active_list_pop (glcpp_parser_t *parser)
+{
+ active_list_t *node = parser->active;
+
+ if (node == NULL) {
+ parser->active = NULL;
+ return;
+ }
+
+ node = parser->active->next;
+ ralloc_free (parser->active);
+
+ parser->active = node;
+}
+
+static int
+_parser_active_list_contains (glcpp_parser_t *parser, const char *identifier)
+{
+ active_list_t *node;
+
+ if (parser->active == NULL)
+ return 0;
+
+ for (node = parser->active; node; node = node->next)
+ if (strcmp (node->identifier, identifier) == 0)
+ return 1;
+
+ return 0;
+}
+
+/* Walk over the token list replacing nodes with their expansion.
+ * Whenever nodes are expanded the walking will walk over the new
+ * nodes, continuing to expand as necessary. The results are placed in
+ * 'list' itself;
+ */
+static void
+_glcpp_parser_expand_token_list (glcpp_parser_t *parser,
+ token_list_t *list)
+{
+ token_node_t *node_prev;
+ token_node_t *node, *last = NULL;
+ token_list_t *expansion;
+ active_list_t *active_initial = parser->active;
+
+ if (list == NULL)
+ return;
+
+ _token_list_trim_trailing_space (list);
+
+ node_prev = NULL;
+ node = list->head;
+
+ while (node) {
+
+ while (parser->active && parser->active->marker == node)
+ _parser_active_list_pop (parser);
+
+ expansion = _glcpp_parser_expand_node (parser, node, &last);
+ if (expansion) {
+ token_node_t *n;
+
+ for (n = node; n != last->next; n = n->next)
+ while (parser->active &&
+ parser->active->marker == n)
+ {
+ _parser_active_list_pop (parser);
+ }
+
+ _parser_active_list_push (parser,
+ node->token->value.str,
+ last->next);
+
+ /* Splice expansion into list, supporting a
+ * simple deletion if the expansion is
+ * empty. */
+ if (expansion->head) {
+ if (node_prev)
+ node_prev->next = expansion->head;
+ else
+ list->head = expansion->head;
+ expansion->tail->next = last->next;
+ if (last == list->tail)
+ list->tail = expansion->tail;
+ } else {
+ if (node_prev)
+ node_prev->next = last->next;
+ else
+ list->head = last->next;
+ if (last == list->tail)
+ list->tail = NULL;
+ }
+ } else {
+ node_prev = node;
+ }
+ node = node_prev ? node_prev->next : list->head;
+ }
+
+ /* Remove any lingering effects of this invocation on the
+ * active list. That is, pop until the list looks like it did
+ * at the beginning of this function. */
+ while (parser->active && parser->active != active_initial)
+ _parser_active_list_pop (parser);
+
+ list->non_space_tail = list->tail;
+}
+
+void
+_glcpp_parser_print_expanded_token_list (glcpp_parser_t *parser,
+ token_list_t *list)
+{
+ if (list == NULL)
+ return;
+
+ _glcpp_parser_expand_token_list (parser, list);
+
+ _token_list_trim_trailing_space (list);
+
+ _token_list_print (parser, list);
+}
+
+static void
+_check_for_reserved_macro_name (glcpp_parser_t *parser, YYLTYPE *loc,
+ const char *identifier)
+{
+ /* According to the GLSL specification, macro names starting with "__"
+ * or "GL_" are reserved for future use. So, don't allow them.
+ */
+ if (strncmp(identifier, "__", 2) == 0) {
+ glcpp_error (loc, parser, "Macro names starting with \"__\" are reserved.\n");
+ }
+ if (strncmp(identifier, "GL_", 3) == 0) {
+ glcpp_error (loc, parser, "Macro names starting with \"GL_\" are reserved.\n");
+ }
+}
+
+static int
+_macro_equal (macro_t *a, macro_t *b)
+{
+ if (a->is_function != b->is_function)
+ return 0;
+
+ if (a->is_function) {
+ if (! _string_list_equal (a->parameters, b->parameters))
+ return 0;
+ }
+
+ return _token_list_equal_ignoring_space (a->replacements,
+ b->replacements);
+}
+
+void
+_define_object_macro (glcpp_parser_t *parser,
+ YYLTYPE *loc,
+ const char *identifier,
+ token_list_t *replacements)
+{
+ macro_t *macro, *previous;
+
+ if (loc != NULL)
+ _check_for_reserved_macro_name(parser, loc, identifier);
+
+ macro = ralloc (parser, macro_t);
+
+ macro->is_function = 0;
+ macro->parameters = NULL;
+ macro->identifier = ralloc_strdup (macro, identifier);
+ macro->replacements = replacements;
+ ralloc_steal (macro, replacements);
+
+ previous = hash_table_find (parser->defines, identifier);
+ if (previous) {
+ if (_macro_equal (macro, previous)) {
+ ralloc_free (macro);
+ return;
+ }
+ glcpp_error (loc, parser, "Redefinition of macro %s\n",
+ identifier);
+ }
+
+ hash_table_insert (parser->defines, macro, identifier);
+}
+
+void
+_define_function_macro (glcpp_parser_t *parser,
+ YYLTYPE *loc,
+ const char *identifier,
+ string_list_t *parameters,
+ token_list_t *replacements)
+{
+ macro_t *macro, *previous;
+
+ _check_for_reserved_macro_name(parser, loc, identifier);
+
+ macro = ralloc (parser, macro_t);
+ ralloc_steal (macro, parameters);
+ ralloc_steal (macro, replacements);
+
+ macro->is_function = 1;
+ macro->parameters = parameters;
+ macro->identifier = ralloc_strdup (macro, identifier);
+ macro->replacements = replacements;
+ previous = hash_table_find (parser->defines, identifier);
+ if (previous) {
+ if (_macro_equal (macro, previous)) {
+ ralloc_free (macro);
+ return;
+ }
+ glcpp_error (loc, parser, "Redefinition of macro %s\n",
+ identifier);
+ }
+
+ hash_table_insert (parser->defines, macro, identifier);
+}
+
+static int
+glcpp_parser_lex (YYSTYPE *yylval, YYLTYPE *yylloc, glcpp_parser_t *parser)
+{
+ token_node_t *node;
+ int ret;
+
+ if (parser->lex_from_list == NULL) {
+ ret = glcpp_lex (yylval, yylloc, parser->scanner);
+
+ /* XXX: This ugly block of code exists for the sole
+ * purpose of converting a NEWLINE token into a SPACE
+ * token, but only in the case where we have seen a
+ * function-like macro name, but have not yet seen its
+ * closing parenthesis.
+ *
+ * There's perhaps a more compact way to do this with
+ * mid-rule actions in the grammar.
+ *
+ * I'm definitely not pleased with the complexity of
+ * this code here.
+ */
+ if (parser->newline_as_space)
+ {
+ if (ret == '(') {
+ parser->paren_count++;
+ } else if (ret == ')') {
+ parser->paren_count--;
+ if (parser->paren_count == 0)
+ parser->newline_as_space = 0;
+ } else if (ret == NEWLINE) {
+ ret = SPACE;
+ } else if (ret != SPACE) {
+ if (parser->paren_count == 0)
+ parser->newline_as_space = 0;
+ }
+ }
+ else if (parser->in_control_line)
+ {
+ if (ret == NEWLINE)
+ parser->in_control_line = 0;
+ }
+ else if (ret == HASH_DEFINE_OBJ || ret == HASH_DEFINE_FUNC ||
+ ret == HASH_UNDEF || ret == HASH_IF ||
+ ret == HASH_IFDEF || ret == HASH_IFNDEF ||
+ ret == HASH_ELIF || ret == HASH_ELSE ||
+ ret == HASH_ENDIF || ret == HASH)
+ {
+ parser->in_control_line = 1;
+ }
+ else if (ret == IDENTIFIER)
+ {
+ macro_t *macro;
+ macro = hash_table_find (parser->defines,
+ yylval->str);
+ if (macro && macro->is_function) {
+ parser->newline_as_space = 1;
+ parser->paren_count = 0;
+ }
+ }
+
+ return ret;
+ }
+
+ node = parser->lex_from_node;
+
+ if (node == NULL) {
+ ralloc_free (parser->lex_from_list);
+ parser->lex_from_list = NULL;
+ return NEWLINE;
+ }
+
+ *yylval = node->token->value;
+ ret = node->token->type;
+
+ parser->lex_from_node = node->next;
+
+ return ret;
+}
+
+static void
+glcpp_parser_lex_from (glcpp_parser_t *parser, token_list_t *list)
+{
+ token_node_t *node;
+
+ assert (parser->lex_from_list == NULL);
+
+ /* Copy list, eliminating any space tokens. */
+ parser->lex_from_list = _token_list_create (parser);
+
+ for (node = list->head; node; node = node->next) {
+ if (node->token->type == SPACE)
+ continue;
+ _token_list_append (parser->lex_from_list, node->token);
+ }
+
+ ralloc_free (list);
+
+ parser->lex_from_node = parser->lex_from_list->head;
+
+ /* It's possible the list consisted of nothing but whitespace. */
+ if (parser->lex_from_node == NULL) {
+ ralloc_free (parser->lex_from_list);
+ parser->lex_from_list = NULL;
+ }
+}
+
+static void
+_glcpp_parser_skip_stack_push_if (glcpp_parser_t *parser, YYLTYPE *loc,
+ int condition)
+{
+ skip_type_t current = SKIP_NO_SKIP;
+ skip_node_t *node;
+
+ if (parser->skip_stack)
+ current = parser->skip_stack->type;
+
+ node = ralloc (parser, skip_node_t);
+ node->loc = *loc;
+
+ if (current == SKIP_NO_SKIP) {
+ if (condition)
+ node->type = SKIP_NO_SKIP;
+ else
+ node->type = SKIP_TO_ELSE;
+ } else {
+ node->type = SKIP_TO_ENDIF;
+ }
+
+ node->next = parser->skip_stack;
+ parser->skip_stack = node;
+}
+
+static void
+_glcpp_parser_skip_stack_change_if (glcpp_parser_t *parser, YYLTYPE *loc,
+ const char *type, int condition)
+{
+ if (parser->skip_stack == NULL) {
+ glcpp_error (loc, parser, "%s without #if\n", type);
+ return;
+ }
+
+ if (parser->skip_stack->type == SKIP_TO_ELSE) {
+ if (condition)
+ parser->skip_stack->type = SKIP_NO_SKIP;
+ } else {
+ parser->skip_stack->type = SKIP_TO_ENDIF;
+ }
+}
+
+static void
+_glcpp_parser_skip_stack_pop (glcpp_parser_t *parser, YYLTYPE *loc)
+{
+ skip_node_t *node;
+
+ if (parser->skip_stack == NULL) {
+ glcpp_error (loc, parser, "#endif without #if\n");
+ return;
+ }
+
+ node = parser->skip_stack;
+ parser->skip_stack = node->next;
+ ralloc_free (node);
+}
diff --git a/mesalib/src/glsl/glcpp/glcpp.c b/mesalib/src/glsl/glcpp/glcpp.c
index 63eb061c2..fd602c1fb 100644
--- a/mesalib/src/glsl/glcpp/glcpp.c
+++ b/mesalib/src/glsl/glcpp/glcpp.c
@@ -28,6 +28,14 @@
#include "main/mtypes.h"
#include "main/shaderobj.h"
+#ifdef _MSC_VER
+#include <io.h>
+#define STDIN_FILENO 0
+#define read _read
+#define open _open
+#define close _close
+#endif
+
extern int yydebug;
void
diff --git a/mesalib/src/glsl/glsl_parser_extras.cpp b/mesalib/src/glsl/glsl_parser_extras.cpp
index fce2faa75..8de806d4d 100644
--- a/mesalib/src/glsl/glsl_parser_extras.cpp
+++ b/mesalib/src/glsl/glsl_parser_extras.cpp
@@ -1,848 +1,848 @@
-/*
- * Copyright © 2008, 2009 Intel Corporation
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-#include <stdio.h>
-#include <stdarg.h>
-#include <string.h>
-#include <assert.h>
-
-extern "C" {
-#include "main/core.h" /* for struct gl_context */
-}
-
-#include "ralloc.h"
-#include "ast.h"
-#include "glsl_parser_extras.h"
-#include "glsl_parser.h"
-#include "ir_optimization.h"
-#include "loop_analysis.h"
-
-_mesa_glsl_parse_state::_mesa_glsl_parse_state(struct gl_context *ctx,
- GLenum target, void *mem_ctx)
-{
- switch (target) {
- case GL_VERTEX_SHADER: this->target = vertex_shader; break;
- case GL_FRAGMENT_SHADER: this->target = fragment_shader; break;
- case GL_GEOMETRY_SHADER: this->target = geometry_shader; break;
- }
-
- this->scanner = NULL;
- this->translation_unit.make_empty();
- this->symbols = new(mem_ctx) glsl_symbol_table;
- this->info_log = ralloc_strdup(mem_ctx, "");
- this->error = false;
- this->loop_or_switch_nesting = NULL;
-
- /* Set default language version and extensions */
- this->language_version = 110;
- this->es_shader = false;
- this->ARB_texture_rectangle_enable = true;
-
- /* OpenGL ES 2.0 has different defaults from desktop GL. */
- if (ctx->API == API_OPENGLES2) {
- this->language_version = 100;
- this->es_shader = true;
- this->ARB_texture_rectangle_enable = false;
- }
-
- this->extensions = &ctx->Extensions;
-
- this->Const.MaxLights = ctx->Const.MaxLights;
- this->Const.MaxClipPlanes = ctx->Const.MaxClipPlanes;
- this->Const.MaxTextureUnits = ctx->Const.MaxTextureUnits;
- this->Const.MaxTextureCoords = ctx->Const.MaxTextureCoordUnits;
- this->Const.MaxVertexAttribs = ctx->Const.VertexProgram.MaxAttribs;
- this->Const.MaxVertexUniformComponents = ctx->Const.VertexProgram.MaxUniformComponents;
- this->Const.MaxVaryingFloats = ctx->Const.MaxVarying * 4;
- this->Const.MaxVertexTextureImageUnits = ctx->Const.MaxVertexTextureImageUnits;
- this->Const.MaxCombinedTextureImageUnits = ctx->Const.MaxCombinedTextureImageUnits;
- this->Const.MaxTextureImageUnits = ctx->Const.MaxTextureImageUnits;
- this->Const.MaxFragmentUniformComponents = ctx->Const.FragmentProgram.MaxUniformComponents;
-
- this->Const.MaxDrawBuffers = ctx->Const.MaxDrawBuffers;
-
- /* Note: Once the OpenGL 3.0 'forward compatible' context or the OpenGL 3.2
- * Core context is supported, this logic will need change. Older versions of
- * GLSL are no longer supported outside the compatibility contexts of 3.x.
- */
- this->Const.GLSL_100ES = (ctx->API == API_OPENGLES2)
- || ctx->Extensions.ARB_ES2_compatibility;
- this->Const.GLSL_110 = (ctx->API == API_OPENGL);
- this->Const.GLSL_120 = (ctx->API == API_OPENGL)
- && (ctx->Const.GLSLVersion >= 120);
- this->Const.GLSL_130 = (ctx->API == API_OPENGL)
- && (ctx->Const.GLSLVersion >= 130);
-
- const unsigned lowest_version =
- (ctx->API == API_OPENGLES2) || ctx->Extensions.ARB_ES2_compatibility
- ? 100 : 110;
- const unsigned highest_version =
- (ctx->API == API_OPENGL) ? ctx->Const.GLSLVersion : 100;
- char *supported = ralloc_strdup(this, "");
-
- for (unsigned ver = lowest_version; ver <= highest_version; ver += 10) {
- const char *const prefix = (ver == lowest_version)
- ? ""
- : ((ver == highest_version) ? ", and " : ", ");
-
- ralloc_asprintf_append(& supported, "%s%d.%02d%s",
- prefix,
- ver / 100, ver % 100,
- (ver == 100) ? " ES" : "");
- }
-
- this->supported_version_string = supported;
-}
-
-const char *
-_mesa_glsl_shader_target_name(enum _mesa_glsl_parser_targets target)
-{
- switch (target) {
- case vertex_shader: return "vertex";
- case fragment_shader: return "fragment";
- case geometry_shader: return "geometry";
- }
-
- assert(!"Should not get here.");
- return "unknown";
-}
-
-
-void
-_mesa_glsl_error(YYLTYPE *locp, _mesa_glsl_parse_state *state,
- const char *fmt, ...)
-{
- va_list ap;
-
- state->error = true;
-
- assert(state->info_log != NULL);
- ralloc_asprintf_append(&state->info_log, "%u:%u(%u): error: ",
- locp->source,
- locp->first_line,
- locp->first_column);
- va_start(ap, fmt);
- ralloc_vasprintf_append(&state->info_log, fmt, ap);
- va_end(ap);
- ralloc_strcat(&state->info_log, "\n");
-}
-
-
-void
-_mesa_glsl_warning(const YYLTYPE *locp, _mesa_glsl_parse_state *state,
- const char *fmt, ...)
-{
- va_list ap;
-
- assert(state->info_log != NULL);
- ralloc_asprintf_append(&state->info_log, "%u:%u(%u): warning: ",
- locp->source,
- locp->first_line,
- locp->first_column);
- va_start(ap, fmt);
- ralloc_vasprintf_append(&state->info_log, fmt, ap);
- va_end(ap);
- ralloc_strcat(&state->info_log, "\n");
-}
-
-
-bool
-_mesa_glsl_process_extension(const char *name, YYLTYPE *name_locp,
- const char *behavior, YYLTYPE *behavior_locp,
- _mesa_glsl_parse_state *state)
-{
- enum {
- extension_disable,
- extension_enable,
- extension_require,
- extension_warn
- } ext_mode;
-
- if (strcmp(behavior, "warn") == 0) {
- ext_mode = extension_warn;
- } else if (strcmp(behavior, "require") == 0) {
- ext_mode = extension_require;
- } else if (strcmp(behavior, "enable") == 0) {
- ext_mode = extension_enable;
- } else if (strcmp(behavior, "disable") == 0) {
- ext_mode = extension_disable;
- } else {
- _mesa_glsl_error(behavior_locp, state,
- "Unknown extension behavior `%s'",
- behavior);
- return false;
- }
-
- bool unsupported = false;
-
- if (strcmp(name, "all") == 0) {
- if ((ext_mode == extension_enable) || (ext_mode == extension_require)) {
- _mesa_glsl_error(name_locp, state, "Cannot %s all extensions",
- (ext_mode == extension_enable)
- ? "enable" : "require");
- return false;
- }
- } else if (strcmp(name, "GL_ARB_draw_buffers") == 0) {
- /* This extension is only supported in fragment shaders.
- */
- if (state->target != fragment_shader) {
- unsupported = true;
- } else {
- state->ARB_draw_buffers_enable = (ext_mode != extension_disable);
- state->ARB_draw_buffers_warn = (ext_mode == extension_warn);
- }
- } else if (strcmp(name, "GL_ARB_draw_instanced") == 0) {
- state->ARB_draw_instanced_enable = (ext_mode != extension_disable);
- state->ARB_draw_instanced_warn = (ext_mode == extension_warn);
-
- /* This extension is only supported in vertex shaders.
- */
- unsupported = (state->target != vertex_shader)
- || !state->extensions->ARB_draw_instanced;
- } else if (strcmp(name, "GL_ARB_explicit_attrib_location") == 0) {
- state->ARB_explicit_attrib_location_enable =
- (ext_mode != extension_disable);
- state->ARB_explicit_attrib_location_warn =
- (ext_mode == extension_warn);
-
- unsupported = !state->extensions->ARB_explicit_attrib_location;
- } else if (strcmp(name, "GL_ARB_fragment_coord_conventions") == 0) {
- state->ARB_fragment_coord_conventions_enable =
- (ext_mode != extension_disable);
- state->ARB_fragment_coord_conventions_warn =
- (ext_mode == extension_warn);
-
- unsupported = !state->extensions->ARB_fragment_coord_conventions;
- } else if (strcmp(name, "GL_ARB_texture_rectangle") == 0) {
- state->ARB_texture_rectangle_enable = (ext_mode != extension_disable);
- state->ARB_texture_rectangle_warn = (ext_mode == extension_warn);
- } else if (strcmp(name, "GL_EXT_texture_array") == 0) {
- state->EXT_texture_array_enable = (ext_mode != extension_disable);
- state->EXT_texture_array_warn = (ext_mode == extension_warn);
-
- unsupported = !state->extensions->EXT_texture_array;
- } else if (strcmp(name, "GL_ARB_shader_texture_lod") == 0) {
- /* Force ARB_texture_rectangle to be on so sampler2DRects are defined */
- state->ARB_texture_rectangle_enable = true;
-
- state->ARB_shader_texture_lod_enable = (ext_mode != extension_disable);
- state->ARB_shader_texture_lod_warn = (ext_mode == extension_warn);
-
- unsupported = !state->extensions->ARB_shader_texture_lod;
- } else if (strcmp(name, "GL_ARB_shader_stencil_export") == 0) {
- state->ARB_shader_stencil_export_enable = (ext_mode != extension_disable);
- state->ARB_shader_stencil_export_warn = (ext_mode == extension_warn);
-
- /* This extension is only supported in fragment shaders.
- */
- unsupported = (state->target != fragment_shader)
- || !state->extensions->ARB_shader_stencil_export;
- } else if (strcmp(name, "GL_AMD_conservative_depth") == 0) {
- /* The AMD_conservative spec does not forbid requiring the extension in
- * the vertex shader.
- */
- state->AMD_conservative_depth_enable = (ext_mode != extension_disable);
- state->AMD_conservative_depth_warn = (ext_mode == extension_warn);
- unsupported = !state->extensions->AMD_conservative_depth;
- } else if (strcmp(name, "GL_AMD_shader_stencil_export") == 0) {
- state->AMD_shader_stencil_export_enable = (ext_mode != extension_disable);
- state->AMD_shader_stencil_export_warn = (ext_mode == extension_warn);
-
- /* This extension is only supported in fragment shaders.
- * Both the ARB and AMD variants share the same ARB flag
- * in gl_extensions.
- */
- unsupported = (state->target != fragment_shader)
- || !state->extensions->ARB_shader_stencil_export;
- } else if (strcmp(name, "GL_OES_texture_3D") == 0 && state->es_shader) {
- state->OES_texture_3D_enable = (ext_mode != extension_disable);
- state->OES_texture_3D_warn = (ext_mode == extension_warn);
-
- unsupported = !state->extensions->EXT_texture3D;
- } else {
- unsupported = true;
- }
-
- if (unsupported) {
- static const char *const fmt = "extension `%s' unsupported in %s shader";
-
- if (ext_mode == extension_require) {
- _mesa_glsl_error(name_locp, state, fmt,
- name, _mesa_glsl_shader_target_name(state->target));
- return false;
- } else {
- _mesa_glsl_warning(name_locp, state, fmt,
- name, _mesa_glsl_shader_target_name(state->target));
- }
- }
-
- return true;
-}
-
-void
-_mesa_ast_type_qualifier_print(const struct ast_type_qualifier *q)
-{
- if (q->flags.q.constant)
- printf("const ");
-
- if (q->flags.q.invariant)
- printf("invariant ");
-
- if (q->flags.q.attribute)
- printf("attribute ");
-
- if (q->flags.q.varying)
- printf("varying ");
-
- if (q->flags.q.in && q->flags.q.out)
- printf("inout ");
- else {
- if (q->flags.q.in)
- printf("in ");
-
- if (q->flags.q.out)
- printf("out ");
- }
-
- if (q->flags.q.centroid)
- printf("centroid ");
- if (q->flags.q.uniform)
- printf("uniform ");
- if (q->flags.q.smooth)
- printf("smooth ");
- if (q->flags.q.flat)
- printf("flat ");
- if (q->flags.q.noperspective)
- printf("noperspective ");
-}
-
-
-void
-ast_node::print(void) const
-{
- printf("unhandled node ");
-}
-
-
-ast_node::ast_node(void)
-{
- this->location.source = 0;
- this->location.line = 0;
- this->location.column = 0;
-}
-
-
-static void
-ast_opt_array_size_print(bool is_array, const ast_expression *array_size)
-{
- if (is_array) {
- printf("[ ");
-
- if (array_size)
- array_size->print();
-
- printf("] ");
- }
-}
-
-
-void
-ast_compound_statement::print(void) const
-{
- printf("{\n");
-
- foreach_list_const(n, &this->statements) {
- ast_node *ast = exec_node_data(ast_node, n, link);
- ast->print();
- }
-
- printf("}\n");
-}
-
-
-ast_compound_statement::ast_compound_statement(int new_scope,
- ast_node *statements)
-{
- this->new_scope = new_scope;
-
- if (statements != NULL) {
- this->statements.push_degenerate_list_at_head(&statements->link);
- }
-}
-
-
-void
-ast_expression::print(void) const
-{
- switch (oper) {
- case ast_assign:
- case ast_mul_assign:
- case ast_div_assign:
- case ast_mod_assign:
- case ast_add_assign:
- case ast_sub_assign:
- case ast_ls_assign:
- case ast_rs_assign:
- case ast_and_assign:
- case ast_xor_assign:
- case ast_or_assign:
- subexpressions[0]->print();
- printf("%s ", operator_string(oper));
- subexpressions[1]->print();
- break;
-
- case ast_field_selection:
- subexpressions[0]->print();
- printf(". %s ", primary_expression.identifier);
- break;
-
- case ast_plus:
- case ast_neg:
- case ast_bit_not:
- case ast_logic_not:
- case ast_pre_inc:
- case ast_pre_dec:
- printf("%s ", operator_string(oper));
- subexpressions[0]->print();
- break;
-
- case ast_post_inc:
- case ast_post_dec:
- subexpressions[0]->print();
- printf("%s ", operator_string(oper));
- break;
-
- case ast_conditional:
- subexpressions[0]->print();
- printf("? ");
- subexpressions[1]->print();
- printf(": ");
- subexpressions[1]->print();
- break;
-
- case ast_array_index:
- subexpressions[0]->print();
- printf("[ ");
- subexpressions[1]->print();
- printf("] ");
- break;
-
- case ast_function_call: {
- subexpressions[0]->print();
- printf("( ");
-
- foreach_list_const (n, &this->expressions) {
- if (n != this->expressions.get_head())
- printf(", ");
-
- ast_node *ast = exec_node_data(ast_node, n, link);
- ast->print();
- }
-
- printf(") ");
- break;
- }
-
- case ast_identifier:
- printf("%s ", primary_expression.identifier);
- break;
-
- case ast_int_constant:
- printf("%d ", primary_expression.int_constant);
- break;
-
- case ast_uint_constant:
- printf("%u ", primary_expression.uint_constant);
- break;
-
- case ast_float_constant:
- printf("%f ", primary_expression.float_constant);
- break;
-
- case ast_bool_constant:
- printf("%s ",
- primary_expression.bool_constant
- ? "true" : "false");
- break;
-
- case ast_sequence: {
- printf("( ");
- foreach_list_const(n, & this->expressions) {
- if (n != this->expressions.get_head())
- printf(", ");
-
- ast_node *ast = exec_node_data(ast_node, n, link);
- ast->print();
- }
- printf(") ");
- break;
- }
-
- default:
- assert(0);
- break;
- }
-}
-
-ast_expression::ast_expression(int oper,
- ast_expression *ex0,
- ast_expression *ex1,
- ast_expression *ex2)
-{
- this->oper = ast_operators(oper);
- this->subexpressions[0] = ex0;
- this->subexpressions[1] = ex1;
- this->subexpressions[2] = ex2;
-}
-
-
-void
-ast_expression_statement::print(void) const
-{
- if (expression)
- expression->print();
-
- printf("; ");
-}
-
-
-ast_expression_statement::ast_expression_statement(ast_expression *ex) :
- expression(ex)
-{
- /* empty */
-}
-
-
-void
-ast_function::print(void) const
-{
- return_type->print();
- printf(" %s (", identifier);
-
- foreach_list_const(n, & this->parameters) {
- ast_node *ast = exec_node_data(ast_node, n, link);
- ast->print();
- }
-
- printf(")");
-}
-
-
-ast_function::ast_function(void)
- : is_definition(false), signature(NULL)
-{
- /* empty */
-}
-
-
-void
-ast_fully_specified_type::print(void) const
-{
- _mesa_ast_type_qualifier_print(& qualifier);
- specifier->print();
-}
-
-
-void
-ast_parameter_declarator::print(void) const
-{
- type->print();
- if (identifier)
- printf("%s ", identifier);
- ast_opt_array_size_print(is_array, array_size);
-}
-
-
-void
-ast_function_definition::print(void) const
-{
- prototype->print();
- body->print();
-}
-
-
-void
-ast_declaration::print(void) const
-{
- printf("%s ", identifier);
- ast_opt_array_size_print(is_array, array_size);
-
- if (initializer) {
- printf("= ");
- initializer->print();
- }
-}
-
-
-ast_declaration::ast_declaration(char *identifier, int is_array,
- ast_expression *array_size,
- ast_expression *initializer)
-{
- this->identifier = identifier;
- this->is_array = is_array;
- this->array_size = array_size;
- this->initializer = initializer;
-}
-
-
-void
-ast_declarator_list::print(void) const
-{
- assert(type || invariant);
-
- if (type)
- type->print();
- else
- printf("invariant ");
-
- foreach_list_const (ptr, & this->declarations) {
- if (ptr != this->declarations.get_head())
- printf(", ");
-
- ast_node *ast = exec_node_data(ast_node, ptr, link);
- ast->print();
- }
-
- printf("; ");
-}
-
-
-ast_declarator_list::ast_declarator_list(ast_fully_specified_type *type)
-{
- this->type = type;
- this->invariant = false;
-}
-
-void
-ast_jump_statement::print(void) const
-{
- switch (mode) {
- case ast_continue:
- printf("continue; ");
- break;
- case ast_break:
- printf("break; ");
- break;
- case ast_return:
- printf("return ");
- if (opt_return_value)
- opt_return_value->print();
-
- printf("; ");
- break;
- case ast_discard:
- printf("discard; ");
- break;
- }
-}
-
-
-ast_jump_statement::ast_jump_statement(int mode, ast_expression *return_value)
-{
- this->mode = ast_jump_modes(mode);
-
- if (mode == ast_return)
- opt_return_value = return_value;
-}
-
-
-void
-ast_selection_statement::print(void) const
-{
- printf("if ( ");
- condition->print();
- printf(") ");
-
- then_statement->print();
-
- if (else_statement) {
- printf("else ");
- else_statement->print();
- }
-
-}
-
-
-ast_selection_statement::ast_selection_statement(ast_expression *condition,
- ast_node *then_statement,
- ast_node *else_statement)
-{
- this->condition = condition;
- this->then_statement = then_statement;
- this->else_statement = else_statement;
-}
-
-
-void
-ast_iteration_statement::print(void) const
-{
- switch (mode) {
- case ast_for:
- printf("for( ");
- if (init_statement)
- init_statement->print();
- printf("; ");
-
- if (condition)
- condition->print();
- printf("; ");
-
- if (rest_expression)
- rest_expression->print();
- printf(") ");
-
- body->print();
- break;
-
- case ast_while:
- printf("while ( ");
- if (condition)
- condition->print();
- printf(") ");
- body->print();
- break;
-
- case ast_do_while:
- printf("do ");
- body->print();
- printf("while ( ");
- if (condition)
- condition->print();
- printf("); ");
- break;
- }
-}
-
-
-ast_iteration_statement::ast_iteration_statement(int mode,
- ast_node *init,
- ast_node *condition,
- ast_expression *rest_expression,
- ast_node *body)
-{
- this->mode = ast_iteration_modes(mode);
- this->init_statement = init;
- this->condition = condition;
- this->rest_expression = rest_expression;
- this->body = body;
-}
-
-
-void
-ast_struct_specifier::print(void) const
-{
- printf("struct %s { ", name);
- foreach_list_const(n, &this->declarations) {
- ast_node *ast = exec_node_data(ast_node, n, link);
- ast->print();
- }
- printf("} ");
-}
-
-
-ast_struct_specifier::ast_struct_specifier(char *identifier,
- ast_node *declarator_list)
-{
- if (identifier == NULL) {
- static unsigned anon_count = 1;
- identifier = ralloc_asprintf(this, "#anon_struct_%04x", anon_count);
- anon_count++;
- }
- name = identifier;
- this->declarations.push_degenerate_list_at_head(&declarator_list->link);
-}
-
-bool
-do_common_optimization(exec_list *ir, bool linked, unsigned max_unroll_iterations)
-{
- GLboolean progress = GL_FALSE;
-
- progress = lower_instructions(ir, SUB_TO_ADD_NEG) || progress;
-
- if (linked) {
- progress = do_function_inlining(ir) || progress;
- progress = do_dead_functions(ir) || progress;
- }
- progress = do_structure_splitting(ir) || progress;
- progress = do_if_simplification(ir) || progress;
- progress = do_discard_simplification(ir) || progress;
- progress = do_copy_propagation(ir) || progress;
- progress = do_copy_propagation_elements(ir) || progress;
- if (linked)
- progress = do_dead_code(ir) || progress;
- else
- progress = do_dead_code_unlinked(ir) || progress;
- progress = do_dead_code_local(ir) || progress;
- progress = do_tree_grafting(ir) || progress;
- progress = do_constant_propagation(ir) || progress;
- if (linked)
- progress = do_constant_variable(ir) || progress;
- else
- progress = do_constant_variable_unlinked(ir) || progress;
- progress = do_constant_folding(ir) || progress;
- progress = do_algebraic(ir) || progress;
- progress = do_lower_jumps(ir) || progress;
- progress = do_vec_index_to_swizzle(ir) || progress;
- progress = do_swizzle_swizzle(ir) || progress;
- progress = do_noop_swizzle(ir) || progress;
-
- progress = optimize_redundant_jumps(ir) || progress;
-
- loop_state *ls = analyze_loop_variables(ir);
- if (ls->loop_found) {
- progress = set_loop_controls(ir, ls) || progress;
- progress = unroll_loops(ir, ls, max_unroll_iterations) || progress;
- }
- delete ls;
-
- return progress;
-}
-
-extern "C" {
-
-/**
- * To be called at GL teardown time, this frees compiler datastructures.
- *
- * After calling this, any previously compiled shaders and shader
- * programs would be invalid. So this should happen at approximately
- * program exit.
- */
-void
-_mesa_destroy_shader_compiler(void)
-{
- _mesa_destroy_shader_compiler_caches();
-
- _mesa_glsl_release_types();
-}
-
-/**
- * Releases compiler caches to trade off performance for memory.
- *
- * Intended to be used with glReleaseShaderCompiler().
- */
-void
-_mesa_destroy_shader_compiler_caches(void)
-{
- _mesa_glsl_release_functions();
-}
-
-}
+/*
+ * Copyright © 2008, 2009 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+#include <stdio.h>
+#include <stdarg.h>
+#include <string.h>
+#include <assert.h>
+
+extern "C" {
+#include "main/core.h" /* for struct gl_context */
+}
+
+#include "ralloc.h"
+#include "ast.h"
+#include "glsl_parser_extras.h"
+#include "glsl_parser.h"
+#include "ir_optimization.h"
+#include "loop_analysis.h"
+
+_mesa_glsl_parse_state::_mesa_glsl_parse_state(struct gl_context *ctx,
+ GLenum target, void *mem_ctx)
+{
+ switch (target) {
+ case GL_VERTEX_SHADER: this->target = vertex_shader; break;
+ case GL_FRAGMENT_SHADER: this->target = fragment_shader; break;
+ case GL_GEOMETRY_SHADER: this->target = geometry_shader; break;
+ }
+
+ this->scanner = NULL;
+ this->translation_unit.make_empty();
+ this->symbols = new(mem_ctx) glsl_symbol_table;
+ this->info_log = ralloc_strdup(mem_ctx, "");
+ this->error = false;
+ this->loop_or_switch_nesting = NULL;
+
+ /* Set default language version and extensions */
+ this->language_version = 110;
+ this->es_shader = false;
+ this->ARB_texture_rectangle_enable = true;
+
+ /* OpenGL ES 2.0 has different defaults from desktop GL. */
+ if (ctx->API == API_OPENGLES2) {
+ this->language_version = 100;
+ this->es_shader = true;
+ this->ARB_texture_rectangle_enable = false;
+ }
+
+ this->extensions = &ctx->Extensions;
+
+ this->Const.MaxLights = ctx->Const.MaxLights;
+ this->Const.MaxClipPlanes = ctx->Const.MaxClipPlanes;
+ this->Const.MaxTextureUnits = ctx->Const.MaxTextureUnits;
+ this->Const.MaxTextureCoords = ctx->Const.MaxTextureCoordUnits;
+ this->Const.MaxVertexAttribs = ctx->Const.VertexProgram.MaxAttribs;
+ this->Const.MaxVertexUniformComponents = ctx->Const.VertexProgram.MaxUniformComponents;
+ this->Const.MaxVaryingFloats = ctx->Const.MaxVarying * 4;
+ this->Const.MaxVertexTextureImageUnits = ctx->Const.MaxVertexTextureImageUnits;
+ this->Const.MaxCombinedTextureImageUnits = ctx->Const.MaxCombinedTextureImageUnits;
+ this->Const.MaxTextureImageUnits = ctx->Const.MaxTextureImageUnits;
+ this->Const.MaxFragmentUniformComponents = ctx->Const.FragmentProgram.MaxUniformComponents;
+
+ this->Const.MaxDrawBuffers = ctx->Const.MaxDrawBuffers;
+
+ /* Note: Once the OpenGL 3.0 'forward compatible' context or the OpenGL 3.2
+ * Core context is supported, this logic will need change. Older versions of
+ * GLSL are no longer supported outside the compatibility contexts of 3.x.
+ */
+ this->Const.GLSL_100ES = (ctx->API == API_OPENGLES2)
+ || ctx->Extensions.ARB_ES2_compatibility;
+ this->Const.GLSL_110 = (ctx->API == API_OPENGL);
+ this->Const.GLSL_120 = (ctx->API == API_OPENGL)
+ && (ctx->Const.GLSLVersion >= 120);
+ this->Const.GLSL_130 = (ctx->API == API_OPENGL)
+ && (ctx->Const.GLSLVersion >= 130);
+
+ const unsigned lowest_version =
+ (ctx->API == API_OPENGLES2) || ctx->Extensions.ARB_ES2_compatibility
+ ? 100 : 110;
+ const unsigned highest_version =
+ (ctx->API == API_OPENGL) ? ctx->Const.GLSLVersion : 100;
+ char *supported = ralloc_strdup(this, "");
+
+ for (unsigned ver = lowest_version; ver <= highest_version; ver += 10) {
+ const char *const prefix = (ver == lowest_version)
+ ? ""
+ : ((ver == highest_version) ? ", and " : ", ");
+
+ ralloc_asprintf_append(& supported, "%s%d.%02d%s",
+ prefix,
+ ver / 100, ver % 100,
+ (ver == 100) ? " ES" : "");
+ }
+
+ this->supported_version_string = supported;
+}
+
+const char *
+_mesa_glsl_shader_target_name(enum _mesa_glsl_parser_targets target)
+{
+ switch (target) {
+ case vertex_shader: return "vertex";
+ case fragment_shader: return "fragment";
+ case geometry_shader: return "geometry";
+ }
+
+ assert(!"Should not get here.");
+ return "unknown";
+}
+
+
+void
+_mesa_glsl_error(YYLTYPE *locp, _mesa_glsl_parse_state *state,
+ const char *fmt, ...)
+{
+ va_list ap;
+
+ state->error = true;
+
+ assert(state->info_log != NULL);
+ ralloc_asprintf_append(&state->info_log, "%u:%u(%u): error: ",
+ locp->source,
+ locp->first_line,
+ locp->first_column);
+ va_start(ap, fmt);
+ ralloc_vasprintf_append(&state->info_log, fmt, ap);
+ va_end(ap);
+ ralloc_strcat(&state->info_log, "\n");
+}
+
+
+void
+_mesa_glsl_warning(const YYLTYPE *locp, _mesa_glsl_parse_state *state,
+ const char *fmt, ...)
+{
+ va_list ap;
+
+ assert(state->info_log != NULL);
+ ralloc_asprintf_append(&state->info_log, "%u:%u(%u): warning: ",
+ locp->source,
+ locp->first_line,
+ locp->first_column);
+ va_start(ap, fmt);
+ ralloc_vasprintf_append(&state->info_log, fmt, ap);
+ va_end(ap);
+ ralloc_strcat(&state->info_log, "\n");
+}
+
+
+bool
+_mesa_glsl_process_extension(const char *name, YYLTYPE *name_locp,
+ const char *behavior, YYLTYPE *behavior_locp,
+ _mesa_glsl_parse_state *state)
+{
+ enum {
+ extension_disable,
+ extension_enable,
+ extension_require,
+ extension_warn
+ } ext_mode;
+
+ if (strcmp(behavior, "warn") == 0) {
+ ext_mode = extension_warn;
+ } else if (strcmp(behavior, "require") == 0) {
+ ext_mode = extension_require;
+ } else if (strcmp(behavior, "enable") == 0) {
+ ext_mode = extension_enable;
+ } else if (strcmp(behavior, "disable") == 0) {
+ ext_mode = extension_disable;
+ } else {
+ _mesa_glsl_error(behavior_locp, state,
+ "Unknown extension behavior `%s'",
+ behavior);
+ return false;
+ }
+
+ bool unsupported = false;
+
+ if (strcmp(name, "all") == 0) {
+ if ((ext_mode == extension_enable) || (ext_mode == extension_require)) {
+ _mesa_glsl_error(name_locp, state, "Cannot %s all extensions",
+ (ext_mode == extension_enable)
+ ? "enable" : "require");
+ return false;
+ }
+ } else if (strcmp(name, "GL_ARB_draw_buffers") == 0) {
+ /* This extension is only supported in fragment shaders.
+ */
+ if (state->target != fragment_shader) {
+ unsupported = true;
+ } else {
+ state->ARB_draw_buffers_enable = (ext_mode != extension_disable);
+ state->ARB_draw_buffers_warn = (ext_mode == extension_warn);
+ }
+ } else if (strcmp(name, "GL_ARB_draw_instanced") == 0) {
+ state->ARB_draw_instanced_enable = (ext_mode != extension_disable);
+ state->ARB_draw_instanced_warn = (ext_mode == extension_warn);
+
+ /* This extension is only supported in vertex shaders.
+ */
+ unsupported = (state->target != vertex_shader)
+ || !state->extensions->ARB_draw_instanced;
+ } else if (strcmp(name, "GL_ARB_explicit_attrib_location") == 0) {
+ state->ARB_explicit_attrib_location_enable =
+ (ext_mode != extension_disable);
+ state->ARB_explicit_attrib_location_warn =
+ (ext_mode == extension_warn);
+
+ unsupported = !state->extensions->ARB_explicit_attrib_location;
+ } else if (strcmp(name, "GL_ARB_fragment_coord_conventions") == 0) {
+ state->ARB_fragment_coord_conventions_enable =
+ (ext_mode != extension_disable);
+ state->ARB_fragment_coord_conventions_warn =
+ (ext_mode == extension_warn);
+
+ unsupported = !state->extensions->ARB_fragment_coord_conventions;
+ } else if (strcmp(name, "GL_ARB_texture_rectangle") == 0) {
+ state->ARB_texture_rectangle_enable = (ext_mode != extension_disable);
+ state->ARB_texture_rectangle_warn = (ext_mode == extension_warn);
+ } else if (strcmp(name, "GL_EXT_texture_array") == 0) {
+ state->EXT_texture_array_enable = (ext_mode != extension_disable);
+ state->EXT_texture_array_warn = (ext_mode == extension_warn);
+
+ unsupported = !state->extensions->EXT_texture_array;
+ } else if (strcmp(name, "GL_ARB_shader_texture_lod") == 0) {
+ /* Force ARB_texture_rectangle to be on so sampler2DRects are defined */
+ state->ARB_texture_rectangle_enable = true;
+
+ state->ARB_shader_texture_lod_enable = (ext_mode != extension_disable);
+ state->ARB_shader_texture_lod_warn = (ext_mode == extension_warn);
+
+ unsupported = !state->extensions->ARB_shader_texture_lod;
+ } else if (strcmp(name, "GL_ARB_shader_stencil_export") == 0) {
+ state->ARB_shader_stencil_export_enable = (ext_mode != extension_disable);
+ state->ARB_shader_stencil_export_warn = (ext_mode == extension_warn);
+
+ /* This extension is only supported in fragment shaders.
+ */
+ unsupported = (state->target != fragment_shader)
+ || !state->extensions->ARB_shader_stencil_export;
+ } else if (strcmp(name, "GL_AMD_conservative_depth") == 0) {
+ /* The AMD_conservative spec does not forbid requiring the extension in
+ * the vertex shader.
+ */
+ state->AMD_conservative_depth_enable = (ext_mode != extension_disable);
+ state->AMD_conservative_depth_warn = (ext_mode == extension_warn);
+ unsupported = !state->extensions->AMD_conservative_depth;
+ } else if (strcmp(name, "GL_AMD_shader_stencil_export") == 0) {
+ state->AMD_shader_stencil_export_enable = (ext_mode != extension_disable);
+ state->AMD_shader_stencil_export_warn = (ext_mode == extension_warn);
+
+ /* This extension is only supported in fragment shaders.
+ * Both the ARB and AMD variants share the same ARB flag
+ * in gl_extensions.
+ */
+ unsupported = (state->target != fragment_shader)
+ || !state->extensions->ARB_shader_stencil_export;
+ } else if (strcmp(name, "GL_OES_texture_3D") == 0 && state->es_shader) {
+ state->OES_texture_3D_enable = (ext_mode != extension_disable);
+ state->OES_texture_3D_warn = (ext_mode == extension_warn);
+
+ unsupported = !state->extensions->EXT_texture3D;
+ } else {
+ unsupported = true;
+ }
+
+ if (unsupported) {
+ static const char *const fmt = "extension `%s' unsupported in %s shader";
+
+ if (ext_mode == extension_require) {
+ _mesa_glsl_error(name_locp, state, fmt,
+ name, _mesa_glsl_shader_target_name(state->target));
+ return false;
+ } else {
+ _mesa_glsl_warning(name_locp, state, fmt,
+ name, _mesa_glsl_shader_target_name(state->target));
+ }
+ }
+
+ return true;
+}
+
+void
+_mesa_ast_type_qualifier_print(const struct ast_type_qualifier *q)
+{
+ if (q->flags.q.constant)
+ printf("const ");
+
+ if (q->flags.q.invariant)
+ printf("invariant ");
+
+ if (q->flags.q.attribute)
+ printf("attribute ");
+
+ if (q->flags.q.varying)
+ printf("varying ");
+
+ if (q->flags.q.in && q->flags.q.out)
+ printf("inout ");
+ else {
+ if (q->flags.q.in)
+ printf("in ");
+
+ if (q->flags.q.out)
+ printf("out ");
+ }
+
+ if (q->flags.q.centroid)
+ printf("centroid ");
+ if (q->flags.q.uniform)
+ printf("uniform ");
+ if (q->flags.q.smooth)
+ printf("smooth ");
+ if (q->flags.q.flat)
+ printf("flat ");
+ if (q->flags.q.noperspective)
+ printf("noperspective ");
+}
+
+
+void
+ast_node::print(void) const
+{
+ printf("unhandled node ");
+}
+
+
+ast_node::ast_node(void)
+{
+ this->location.source = 0;
+ this->location.line = 0;
+ this->location.column = 0;
+}
+
+
+static void
+ast_opt_array_size_print(bool is_array, const ast_expression *array_size)
+{
+ if (is_array) {
+ printf("[ ");
+
+ if (array_size)
+ array_size->print();
+
+ printf("] ");
+ }
+}
+
+
+void
+ast_compound_statement::print(void) const
+{
+ printf("{\n");
+
+ foreach_list_const(n, &this->statements) {
+ ast_node *ast = exec_node_data(ast_node, n, link);
+ ast->print();
+ }
+
+ printf("}\n");
+}
+
+
+ast_compound_statement::ast_compound_statement(int new_scope,
+ ast_node *statements)
+{
+ this->new_scope = new_scope;
+
+ if (statements != NULL) {
+ this->statements.push_degenerate_list_at_head(&statements->link);
+ }
+}
+
+
+void
+ast_expression::print(void) const
+{
+ switch (oper) {
+ case ast_assign:
+ case ast_mul_assign:
+ case ast_div_assign:
+ case ast_mod_assign:
+ case ast_add_assign:
+ case ast_sub_assign:
+ case ast_ls_assign:
+ case ast_rs_assign:
+ case ast_and_assign:
+ case ast_xor_assign:
+ case ast_or_assign:
+ subexpressions[0]->print();
+ printf("%s ", operator_string(oper));
+ subexpressions[1]->print();
+ break;
+
+ case ast_field_selection:
+ subexpressions[0]->print();
+ printf(". %s ", primary_expression.identifier);
+ break;
+
+ case ast_plus:
+ case ast_neg:
+ case ast_bit_not:
+ case ast_logic_not:
+ case ast_pre_inc:
+ case ast_pre_dec:
+ printf("%s ", operator_string(oper));
+ subexpressions[0]->print();
+ break;
+
+ case ast_post_inc:
+ case ast_post_dec:
+ subexpressions[0]->print();
+ printf("%s ", operator_string(oper));
+ break;
+
+ case ast_conditional:
+ subexpressions[0]->print();
+ printf("? ");
+ subexpressions[1]->print();
+ printf(": ");
+ subexpressions[1]->print();
+ break;
+
+ case ast_array_index:
+ subexpressions[0]->print();
+ printf("[ ");
+ subexpressions[1]->print();
+ printf("] ");
+ break;
+
+ case ast_function_call: {
+ subexpressions[0]->print();
+ printf("( ");
+
+ foreach_list_const (n, &this->expressions) {
+ if (n != this->expressions.get_head())
+ printf(", ");
+
+ ast_node *ast = exec_node_data(ast_node, n, link);
+ ast->print();
+ }
+
+ printf(") ");
+ break;
+ }
+
+ case ast_identifier:
+ printf("%s ", primary_expression.identifier);
+ break;
+
+ case ast_int_constant:
+ printf("%d ", primary_expression.int_constant);
+ break;
+
+ case ast_uint_constant:
+ printf("%u ", primary_expression.uint_constant);
+ break;
+
+ case ast_float_constant:
+ printf("%f ", primary_expression.float_constant);
+ break;
+
+ case ast_bool_constant:
+ printf("%s ",
+ primary_expression.bool_constant
+ ? "true" : "false");
+ break;
+
+ case ast_sequence: {
+ printf("( ");
+ foreach_list_const(n, & this->expressions) {
+ if (n != this->expressions.get_head())
+ printf(", ");
+
+ ast_node *ast = exec_node_data(ast_node, n, link);
+ ast->print();
+ }
+ printf(") ");
+ break;
+ }
+
+ default:
+ assert(0);
+ break;
+ }
+}
+
+ast_expression::ast_expression(int oper,
+ ast_expression *ex0,
+ ast_expression *ex1,
+ ast_expression *ex2)
+{
+ this->oper = ast_operators(oper);
+ this->subexpressions[0] = ex0;
+ this->subexpressions[1] = ex1;
+ this->subexpressions[2] = ex2;
+}
+
+
+void
+ast_expression_statement::print(void) const
+{
+ if (expression)
+ expression->print();
+
+ printf("; ");
+}
+
+
+ast_expression_statement::ast_expression_statement(ast_expression *ex) :
+ expression(ex)
+{
+ /* empty */
+}
+
+
+void
+ast_function::print(void) const
+{
+ return_type->print();
+ printf(" %s (", identifier);
+
+ foreach_list_const(n, & this->parameters) {
+ ast_node *ast = exec_node_data(ast_node, n, link);
+ ast->print();
+ }
+
+ printf(")");
+}
+
+
+ast_function::ast_function(void)
+ : is_definition(false), signature(NULL)
+{
+ /* empty */
+}
+
+
+void
+ast_fully_specified_type::print(void) const
+{
+ _mesa_ast_type_qualifier_print(& qualifier);
+ specifier->print();
+}
+
+
+void
+ast_parameter_declarator::print(void) const
+{
+ type->print();
+ if (identifier)
+ printf("%s ", identifier);
+ ast_opt_array_size_print(is_array, array_size);
+}
+
+
+void
+ast_function_definition::print(void) const
+{
+ prototype->print();
+ body->print();
+}
+
+
+void
+ast_declaration::print(void) const
+{
+ printf("%s ", identifier);
+ ast_opt_array_size_print(is_array, array_size);
+
+ if (initializer) {
+ printf("= ");
+ initializer->print();
+ }
+}
+
+
+ast_declaration::ast_declaration(char *identifier, int is_array,
+ ast_expression *array_size,
+ ast_expression *initializer)
+{
+ this->identifier = identifier;
+ this->is_array = is_array;
+ this->array_size = array_size;
+ this->initializer = initializer;
+}
+
+
+void
+ast_declarator_list::print(void) const
+{
+ assert(type || invariant);
+
+ if (type)
+ type->print();
+ else
+ printf("invariant ");
+
+ foreach_list_const (ptr, & this->declarations) {
+ if (ptr != this->declarations.get_head())
+ printf(", ");
+
+ ast_node *ast = exec_node_data(ast_node, ptr, link);
+ ast->print();
+ }
+
+ printf("; ");
+}
+
+
+ast_declarator_list::ast_declarator_list(ast_fully_specified_type *type)
+{
+ this->type = type;
+ this->invariant = false;
+}
+
+void
+ast_jump_statement::print(void) const
+{
+ switch (mode) {
+ case ast_continue:
+ printf("continue; ");
+ break;
+ case ast_break:
+ printf("break; ");
+ break;
+ case ast_return:
+ printf("return ");
+ if (opt_return_value)
+ opt_return_value->print();
+
+ printf("; ");
+ break;
+ case ast_discard:
+ printf("discard; ");
+ break;
+ }
+}
+
+
+ast_jump_statement::ast_jump_statement(int mode, ast_expression *return_value)
+{
+ this->mode = ast_jump_modes(mode);
+
+ if (mode == ast_return)
+ opt_return_value = return_value;
+}
+
+
+void
+ast_selection_statement::print(void) const
+{
+ printf("if ( ");
+ condition->print();
+ printf(") ");
+
+ then_statement->print();
+
+ if (else_statement) {
+ printf("else ");
+ else_statement->print();
+ }
+
+}
+
+
+ast_selection_statement::ast_selection_statement(ast_expression *condition,
+ ast_node *then_statement,
+ ast_node *else_statement)
+{
+ this->condition = condition;
+ this->then_statement = then_statement;
+ this->else_statement = else_statement;
+}
+
+
+void
+ast_iteration_statement::print(void) const
+{
+ switch (mode) {
+ case ast_for:
+ printf("for( ");
+ if (init_statement)
+ init_statement->print();
+ printf("; ");
+
+ if (condition)
+ condition->print();
+ printf("; ");
+
+ if (rest_expression)
+ rest_expression->print();
+ printf(") ");
+
+ body->print();
+ break;
+
+ case ast_while:
+ printf("while ( ");
+ if (condition)
+ condition->print();
+ printf(") ");
+ body->print();
+ break;
+
+ case ast_do_while:
+ printf("do ");
+ body->print();
+ printf("while ( ");
+ if (condition)
+ condition->print();
+ printf("); ");
+ break;
+ }
+}
+
+
+ast_iteration_statement::ast_iteration_statement(int mode,
+ ast_node *init,
+ ast_node *condition,
+ ast_expression *rest_expression,
+ ast_node *body)
+{
+ this->mode = ast_iteration_modes(mode);
+ this->init_statement = init;
+ this->condition = condition;
+ this->rest_expression = rest_expression;
+ this->body = body;
+}
+
+
+void
+ast_struct_specifier::print(void) const
+{
+ printf("struct %s { ", name);
+ foreach_list_const(n, &this->declarations) {
+ ast_node *ast = exec_node_data(ast_node, n, link);
+ ast->print();
+ }
+ printf("} ");
+}
+
+
+ast_struct_specifier::ast_struct_specifier(char *identifier,
+ ast_node *declarator_list)
+{
+ if (identifier == NULL) {
+ static unsigned anon_count = 1;
+ identifier = ralloc_asprintf(this, "#anon_struct_%04x", anon_count);
+ anon_count++;
+ }
+ name = identifier;
+ this->declarations.push_degenerate_list_at_head(&declarator_list->link);
+}
+
+bool
+do_common_optimization(exec_list *ir, bool linked, unsigned max_unroll_iterations)
+{
+ GLboolean progress = GL_FALSE;
+
+ progress = lower_instructions(ir, SUB_TO_ADD_NEG) || progress;
+
+ if (linked) {
+ progress = do_function_inlining(ir) || progress;
+ progress = do_dead_functions(ir) || progress;
+ }
+ progress = do_structure_splitting(ir) || progress;
+ progress = do_if_simplification(ir) || progress;
+ progress = do_discard_simplification(ir) || progress;
+ progress = do_copy_propagation(ir) || progress;
+ progress = do_copy_propagation_elements(ir) || progress;
+ if (linked)
+ progress = do_dead_code(ir) || progress;
+ else
+ progress = do_dead_code_unlinked(ir) || progress;
+ progress = do_dead_code_local(ir) || progress;
+ progress = do_tree_grafting(ir) || progress;
+ progress = do_constant_propagation(ir) || progress;
+ if (linked)
+ progress = do_constant_variable(ir) || progress;
+ else
+ progress = do_constant_variable_unlinked(ir) || progress;
+ progress = do_constant_folding(ir) || progress;
+ progress = do_algebraic(ir) || progress;
+ progress = do_lower_jumps(ir) || progress;
+ progress = do_vec_index_to_swizzle(ir) || progress;
+ progress = do_swizzle_swizzle(ir) || progress;
+ progress = do_noop_swizzle(ir) || progress;
+
+ progress = optimize_redundant_jumps(ir) || progress;
+
+ loop_state *ls = analyze_loop_variables(ir);
+ if (ls->loop_found) {
+ progress = set_loop_controls(ir, ls) || progress;
+ progress = unroll_loops(ir, ls, max_unroll_iterations) || progress;
+ }
+ delete ls;
+
+ return progress;
+}
+
+extern "C" {
+
+/**
+ * To be called at GL teardown time, this frees compiler datastructures.
+ *
+ * After calling this, any previously compiled shaders and shader
+ * programs would be invalid. So this should happen at approximately
+ * program exit.
+ */
+void
+_mesa_destroy_shader_compiler(void)
+{
+ _mesa_destroy_shader_compiler_caches();
+
+ _mesa_glsl_release_types();
+}
+
+/**
+ * Releases compiler caches to trade off performance for memory.
+ *
+ * Intended to be used with glReleaseShaderCompiler().
+ */
+void
+_mesa_destroy_shader_compiler_caches(void)
+{
+ _mesa_glsl_release_functions();
+}
+
+}
diff --git a/mesalib/src/glsl/glsl_parser_extras.h b/mesalib/src/glsl/glsl_parser_extras.h
index 878d2ae3f..acff7eac3 100644
--- a/mesalib/src/glsl/glsl_parser_extras.h
+++ b/mesalib/src/glsl/glsl_parser_extras.h
@@ -1,283 +1,287 @@
-/*
- * Copyright © 2010 Intel Corporation
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-
-#pragma once
-#ifndef GLSL_PARSER_EXTRAS_H
-#define GLSL_PARSER_EXTRAS_H
-
-/*
- * Most of the definitions here only apply to C++
- */
-#ifdef __cplusplus
-
-
-#include <stdlib.h>
-#include "glsl_symbol_table.h"
-
-enum _mesa_glsl_parser_targets {
- vertex_shader,
- geometry_shader,
- fragment_shader
-};
-
-struct gl_context;
-
-struct _mesa_glsl_parse_state {
- _mesa_glsl_parse_state(struct gl_context *ctx, GLenum target,
- void *mem_ctx);
-
- /* Callers of this ralloc-based new need not call delete. It's
- * easier to just ralloc_free 'ctx' (or any of its ancestors). */
- static void* operator new(size_t size, void *ctx)
- {
- void *mem = rzalloc_size(ctx, size);
- assert(mem != NULL);
-
- return mem;
- }
-
- /* If the user *does* call delete, that's OK, we will just
- * ralloc_free in that case. */
- static void operator delete(void *mem)
- {
- ralloc_free(mem);
- }
-
- void *scanner;
- exec_list translation_unit;
- glsl_symbol_table *symbols;
-
- bool es_shader;
- unsigned language_version;
- const char *version_string;
- enum _mesa_glsl_parser_targets target;
-
- /**
- * Printable list of GLSL versions supported by the current context
- *
- * \note
- * This string should probably be generated per-context instead of per
- * invokation of the compiler. This should be changed when the method of
- * tracking supported GLSL versions changes.
- */
- const char *supported_version_string;
-
- /**
- * Implementation defined limits that affect built-in variables, etc.
- *
- * \sa struct gl_constants (in mtypes.h)
- */
- struct {
- /* 1.10 */
- unsigned MaxLights;
- unsigned MaxClipPlanes;
- unsigned MaxTextureUnits;
- unsigned MaxTextureCoords;
- unsigned MaxVertexAttribs;
- unsigned MaxVertexUniformComponents;
- unsigned MaxVaryingFloats;
- unsigned MaxVertexTextureImageUnits;
- unsigned MaxCombinedTextureImageUnits;
- unsigned MaxTextureImageUnits;
- unsigned MaxFragmentUniformComponents;
-
- /* ARB_draw_buffers */
- unsigned MaxDrawBuffers;
-
- /**
- * Set of GLSL versions supported by the current context
- *
- * Knowing that version X is supported doesn't mean that versions before
- * X are also supported. Version 1.00 is only supported in an ES2
- * context or when GL_ARB_ES2_compatibility is supported. In an OpenGL
- * 3.0 "forward compatible" context, GLSL 1.10 and 1.20 are \b not
- * supported.
- */
- /*@{*/
- unsigned GLSL_100ES:1;
- unsigned GLSL_110:1;
- unsigned GLSL_120:1;
- unsigned GLSL_130:1;
- /*@}*/
- } Const;
-
- /**
- * During AST to IR conversion, pointer to current IR function
- *
- * Will be \c NULL whenever the AST to IR conversion is not inside a
- * function definition.
- */
- class ir_function_signature *current_function;
-
- /** Have we found a return statement in this function? */
- bool found_return;
-
- /** Was there an error during compilation? */
- bool error;
-
- /**
- * Are all shader inputs / outputs invariant?
- *
- * This is set when the 'STDGL invariant(all)' pragma is used.
- */
- bool all_invariant;
-
- /** Loop or switch statement containing the current instructions. */
- class ir_instruction *loop_or_switch_nesting;
- class ast_iteration_statement *loop_or_switch_nesting_ast;
-
- /** List of structures defined in user code. */
- const glsl_type **user_structures;
- unsigned num_user_structures;
-
- char *info_log;
-
- /**
- * \name Enable bits for GLSL extensions
- */
- /*@{*/
- unsigned ARB_draw_buffers_enable:1;
- unsigned ARB_draw_buffers_warn:1;
- unsigned ARB_draw_instanced_enable:1;
- unsigned ARB_draw_instanced_warn:1;
- unsigned ARB_explicit_attrib_location_enable:1;
- unsigned ARB_explicit_attrib_location_warn:1;
- unsigned ARB_fragment_coord_conventions_enable:1;
- unsigned ARB_fragment_coord_conventions_warn:1;
- unsigned ARB_texture_rectangle_enable:1;
- unsigned ARB_texture_rectangle_warn:1;
- unsigned EXT_texture_array_enable:1;
- unsigned EXT_texture_array_warn:1;
- unsigned ARB_shader_texture_lod_enable:1;
- unsigned ARB_shader_texture_lod_warn:1;
- unsigned ARB_shader_stencil_export_enable:1;
- unsigned ARB_shader_stencil_export_warn:1;
- unsigned AMD_conservative_depth_enable:1;
- unsigned AMD_conservative_depth_warn:1;
- unsigned AMD_shader_stencil_export_enable:1;
- unsigned AMD_shader_stencil_export_warn:1;
- unsigned OES_texture_3D_enable:1;
- unsigned OES_texture_3D_warn:1;
- /*@}*/
-
- /** Extensions supported by the OpenGL implementation. */
- const struct gl_extensions *extensions;
-
- /** Shaders containing built-in functions that are used for linking. */
- struct gl_shader *builtins_to_link[16];
- unsigned num_builtins_to_link;
-};
-
-typedef struct YYLTYPE {
- int first_line;
- int first_column;
- int last_line;
- int last_column;
- unsigned source;
-} YYLTYPE;
-# define YYLTYPE_IS_DECLARED 1
-# define YYLTYPE_IS_TRIVIAL 1
-
-# define YYLLOC_DEFAULT(Current, Rhs, N) \
-do { \
- if (N) \
- { \
- (Current).first_line = YYRHSLOC(Rhs, 1).first_line; \
- (Current).first_column = YYRHSLOC(Rhs, 1).first_column; \
- (Current).last_line = YYRHSLOC(Rhs, N).last_line; \
- (Current).last_column = YYRHSLOC(Rhs, N).last_column; \
- } \
- else \
- { \
- (Current).first_line = (Current).last_line = \
- YYRHSLOC(Rhs, 0).last_line; \
- (Current).first_column = (Current).last_column = \
- YYRHSLOC(Rhs, 0).last_column; \
- } \
- (Current).source = 0; \
-} while (0)
-
-extern void _mesa_glsl_error(YYLTYPE *locp, _mesa_glsl_parse_state *state,
- const char *fmt, ...);
-
-/**
- * Emit a warning to the shader log
- *
- * \sa _mesa_glsl_error
- */
-extern void _mesa_glsl_warning(const YYLTYPE *locp,
- _mesa_glsl_parse_state *state,
- const char *fmt, ...);
-
-extern void _mesa_glsl_lexer_ctor(struct _mesa_glsl_parse_state *state,
- const char *string);
-
-extern void _mesa_glsl_lexer_dtor(struct _mesa_glsl_parse_state *state);
-
-union YYSTYPE;
-extern int _mesa_glsl_lex(union YYSTYPE *yylval, YYLTYPE *yylloc,
- void *scanner);
-
-extern int _mesa_glsl_parse(struct _mesa_glsl_parse_state *);
-
-/**
- * Process elements of the #extension directive
- *
- * \return
- * If \c name and \c behavior are valid, \c true is returned. Otherwise
- * \c false is returned.
- */
-extern bool _mesa_glsl_process_extension(const char *name, YYLTYPE *name_locp,
- const char *behavior,
- YYLTYPE *behavior_locp,
- _mesa_glsl_parse_state *state);
-
-/**
- * Get the textual name of the specified shader target
- */
-extern const char *
-_mesa_glsl_shader_target_name(enum _mesa_glsl_parser_targets target);
-
-
-#endif /* __cplusplus */
-
-
-/*
- * These definitions apply to C and C++
- */
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-extern int preprocess(void *ctx, const char **shader, char **info_log,
- const struct gl_extensions *extensions, int api);
-
-extern void _mesa_destroy_shader_compiler(void);
-extern void _mesa_destroy_shader_compiler_caches(void);
-
-#ifdef __cplusplus
-}
-#endif
-
-
-#endif /* GLSL_PARSER_EXTRAS_H */
+/*
+ * Copyright © 2010 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+#pragma once
+#ifndef GLSL_PARSER_EXTRAS_H
+#define GLSL_PARSER_EXTRAS_H
+
+/*
+ * Most of the definitions here only apply to C++
+ */
+#ifdef __cplusplus
+
+
+#include <stdlib.h>
+#include "glsl_symbol_table.h"
+
+enum _mesa_glsl_parser_targets {
+ vertex_shader,
+ geometry_shader,
+ fragment_shader
+};
+
+struct gl_context;
+
+struct _mesa_glsl_parse_state {
+ _mesa_glsl_parse_state(struct gl_context *ctx, GLenum target,
+ void *mem_ctx);
+
+ /* Callers of this ralloc-based new need not call delete. It's
+ * easier to just ralloc_free 'ctx' (or any of its ancestors). */
+ static void* operator new(size_t size, void *ctx)
+ {
+ void *mem = rzalloc_size(ctx, size);
+ assert(mem != NULL);
+
+ return mem;
+ }
+
+ /* If the user *does* call delete, that's OK, we will just
+ * ralloc_free in that case. */
+ static void operator delete(void *mem, void *ctx)
+ {
+ ralloc_free(mem);
+ }
+ static void operator delete(void *mem)
+ {
+ ralloc_free(mem);
+ }
+
+ void *scanner;
+ exec_list translation_unit;
+ glsl_symbol_table *symbols;
+
+ bool es_shader;
+ unsigned language_version;
+ const char *version_string;
+ enum _mesa_glsl_parser_targets target;
+
+ /**
+ * Printable list of GLSL versions supported by the current context
+ *
+ * \note
+ * This string should probably be generated per-context instead of per
+ * invokation of the compiler. This should be changed when the method of
+ * tracking supported GLSL versions changes.
+ */
+ const char *supported_version_string;
+
+ /**
+ * Implementation defined limits that affect built-in variables, etc.
+ *
+ * \sa struct gl_constants (in mtypes.h)
+ */
+ struct {
+ /* 1.10 */
+ unsigned MaxLights;
+ unsigned MaxClipPlanes;
+ unsigned MaxTextureUnits;
+ unsigned MaxTextureCoords;
+ unsigned MaxVertexAttribs;
+ unsigned MaxVertexUniformComponents;
+ unsigned MaxVaryingFloats;
+ unsigned MaxVertexTextureImageUnits;
+ unsigned MaxCombinedTextureImageUnits;
+ unsigned MaxTextureImageUnits;
+ unsigned MaxFragmentUniformComponents;
+
+ /* ARB_draw_buffers */
+ unsigned MaxDrawBuffers;
+
+ /**
+ * Set of GLSL versions supported by the current context
+ *
+ * Knowing that version X is supported doesn't mean that versions before
+ * X are also supported. Version 1.00 is only supported in an ES2
+ * context or when GL_ARB_ES2_compatibility is supported. In an OpenGL
+ * 3.0 "forward compatible" context, GLSL 1.10 and 1.20 are \b not
+ * supported.
+ */
+ /*@{*/
+ unsigned GLSL_100ES:1;
+ unsigned GLSL_110:1;
+ unsigned GLSL_120:1;
+ unsigned GLSL_130:1;
+ /*@}*/
+ } Const;
+
+ /**
+ * During AST to IR conversion, pointer to current IR function
+ *
+ * Will be \c NULL whenever the AST to IR conversion is not inside a
+ * function definition.
+ */
+ class ir_function_signature *current_function;
+
+ /** Have we found a return statement in this function? */
+ bool found_return;
+
+ /** Was there an error during compilation? */
+ bool error;
+
+ /**
+ * Are all shader inputs / outputs invariant?
+ *
+ * This is set when the 'STDGL invariant(all)' pragma is used.
+ */
+ bool all_invariant;
+
+ /** Loop or switch statement containing the current instructions. */
+ class ir_instruction *loop_or_switch_nesting;
+ class ast_iteration_statement *loop_or_switch_nesting_ast;
+
+ /** List of structures defined in user code. */
+ const glsl_type **user_structures;
+ unsigned num_user_structures;
+
+ char *info_log;
+
+ /**
+ * \name Enable bits for GLSL extensions
+ */
+ /*@{*/
+ unsigned ARB_draw_buffers_enable:1;
+ unsigned ARB_draw_buffers_warn:1;
+ unsigned ARB_draw_instanced_enable:1;
+ unsigned ARB_draw_instanced_warn:1;
+ unsigned ARB_explicit_attrib_location_enable:1;
+ unsigned ARB_explicit_attrib_location_warn:1;
+ unsigned ARB_fragment_coord_conventions_enable:1;
+ unsigned ARB_fragment_coord_conventions_warn:1;
+ unsigned ARB_texture_rectangle_enable:1;
+ unsigned ARB_texture_rectangle_warn:1;
+ unsigned EXT_texture_array_enable:1;
+ unsigned EXT_texture_array_warn:1;
+ unsigned ARB_shader_texture_lod_enable:1;
+ unsigned ARB_shader_texture_lod_warn:1;
+ unsigned ARB_shader_stencil_export_enable:1;
+ unsigned ARB_shader_stencil_export_warn:1;
+ unsigned AMD_conservative_depth_enable:1;
+ unsigned AMD_conservative_depth_warn:1;
+ unsigned AMD_shader_stencil_export_enable:1;
+ unsigned AMD_shader_stencil_export_warn:1;
+ unsigned OES_texture_3D_enable:1;
+ unsigned OES_texture_3D_warn:1;
+ /*@}*/
+
+ /** Extensions supported by the OpenGL implementation. */
+ const struct gl_extensions *extensions;
+
+ /** Shaders containing built-in functions that are used for linking. */
+ struct gl_shader *builtins_to_link[16];
+ unsigned num_builtins_to_link;
+};
+
+typedef struct YYLTYPE {
+ int first_line;
+ int first_column;
+ int last_line;
+ int last_column;
+ unsigned source;
+} YYLTYPE;
+# define YYLTYPE_IS_DECLARED 1
+# define YYLTYPE_IS_TRIVIAL 1
+
+# define YYLLOC_DEFAULT(Current, Rhs, N) \
+do { \
+ if (N) \
+ { \
+ (Current).first_line = YYRHSLOC(Rhs, 1).first_line; \
+ (Current).first_column = YYRHSLOC(Rhs, 1).first_column; \
+ (Current).last_line = YYRHSLOC(Rhs, N).last_line; \
+ (Current).last_column = YYRHSLOC(Rhs, N).last_column; \
+ } \
+ else \
+ { \
+ (Current).first_line = (Current).last_line = \
+ YYRHSLOC(Rhs, 0).last_line; \
+ (Current).first_column = (Current).last_column = \
+ YYRHSLOC(Rhs, 0).last_column; \
+ } \
+ (Current).source = 0; \
+} while (0)
+
+extern void _mesa_glsl_error(YYLTYPE *locp, _mesa_glsl_parse_state *state,
+ const char *fmt, ...);
+
+/**
+ * Emit a warning to the shader log
+ *
+ * \sa _mesa_glsl_error
+ */
+extern void _mesa_glsl_warning(const YYLTYPE *locp,
+ _mesa_glsl_parse_state *state,
+ const char *fmt, ...);
+
+extern void _mesa_glsl_lexer_ctor(struct _mesa_glsl_parse_state *state,
+ const char *string);
+
+extern void _mesa_glsl_lexer_dtor(struct _mesa_glsl_parse_state *state);
+
+union YYSTYPE;
+extern int _mesa_glsl_lex(union YYSTYPE *yylval, YYLTYPE *yylloc,
+ void *scanner);
+
+extern int _mesa_glsl_parse(struct _mesa_glsl_parse_state *);
+
+/**
+ * Process elements of the #extension directive
+ *
+ * \return
+ * If \c name and \c behavior are valid, \c true is returned. Otherwise
+ * \c false is returned.
+ */
+extern bool _mesa_glsl_process_extension(const char *name, YYLTYPE *name_locp,
+ const char *behavior,
+ YYLTYPE *behavior_locp,
+ _mesa_glsl_parse_state *state);
+
+/**
+ * Get the textual name of the specified shader target
+ */
+extern const char *
+_mesa_glsl_shader_target_name(enum _mesa_glsl_parser_targets target);
+
+
+#endif /* __cplusplus */
+
+
+/*
+ * These definitions apply to C and C++
+ */
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+extern int preprocess(void *ctx, const char **shader, char **info_log,
+ const struct gl_extensions *extensions, int api);
+
+extern void _mesa_destroy_shader_compiler(void);
+extern void _mesa_destroy_shader_compiler_caches(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+
+#endif /* GLSL_PARSER_EXTRAS_H */
diff --git a/mesalib/src/glsl/glsl_symbol_table.cpp b/mesalib/src/glsl/glsl_symbol_table.cpp
index bcb65d301..fa6458df5 100644
--- a/mesalib/src/glsl/glsl_symbol_table.cpp
+++ b/mesalib/src/glsl/glsl_symbol_table.cpp
@@ -1,165 +1,169 @@
-/* -*- c++ -*- */
-/*
- * Copyright © 2010 Intel Corporation
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-
-#include "glsl_symbol_table.h"
-
-class symbol_table_entry {
-public:
- /* Callers of this ralloc-based new need not call delete. It's
- * easier to just ralloc_free 'ctx' (or any of its ancestors). */
- static void* operator new(size_t size, void *ctx)
- {
- void *entry = ralloc_size(ctx, size);
- assert(entry != NULL);
- return entry;
- }
-
- /* If the user *does* call delete, that's OK, we will just ralloc_free. */
- static void operator delete(void *entry)
- {
- ralloc_free(entry);
- }
-
- symbol_table_entry(ir_variable *v) : v(v), f(0), t(0) {}
- symbol_table_entry(ir_function *f) : v(0), f(f), t(0) {}
- symbol_table_entry(const glsl_type *t) : v(0), f(0), t(t) {}
-
- ir_variable *v;
- ir_function *f;
- const glsl_type *t;
-};
-
-glsl_symbol_table::glsl_symbol_table()
-{
- this->language_version = 120;
- this->table = _mesa_symbol_table_ctor();
- this->mem_ctx = ralloc_context(NULL);
-}
-
-glsl_symbol_table::~glsl_symbol_table()
-{
- _mesa_symbol_table_dtor(table);
- ralloc_free(mem_ctx);
-}
-
-void glsl_symbol_table::push_scope()
-{
- _mesa_symbol_table_push_scope(table);
-}
-
-void glsl_symbol_table::pop_scope()
-{
- _mesa_symbol_table_pop_scope(table);
-}
-
-bool glsl_symbol_table::name_declared_this_scope(const char *name)
-{
- return _mesa_symbol_table_symbol_scope(table, -1, name) == 0;
-}
-
-bool glsl_symbol_table::add_variable(ir_variable *v)
-{
- if (this->language_version == 110) {
- /* In 1.10, functions and variables have separate namespaces. */
- symbol_table_entry *existing = get_entry(v->name);
- if (name_declared_this_scope(v->name)) {
- /* If there's already an existing function (not a constructor!) in
- * the current scope, just update the existing entry to include 'v'.
- */
- if (existing->v == NULL && existing->t == NULL) {
- existing->v = v;
- return true;
- }
- } else {
- /* If not declared at this scope, add a new entry. But if an existing
- * entry includes a function, propagate that to this block - otherwise
- * the new variable declaration would shadow the function.
- */
- symbol_table_entry *entry = new(mem_ctx) symbol_table_entry(v);
- if (existing != NULL)
- entry->f = existing->f;
- int added = _mesa_symbol_table_add_symbol(table, -1, v->name, entry);
- assert(added == 0);
- (void)added;
- return true;
- }
- return false;
- }
-
- /* 1.20+ rules: */
- symbol_table_entry *entry = new(mem_ctx) symbol_table_entry(v);
- return _mesa_symbol_table_add_symbol(table, -1, v->name, entry) == 0;
-}
-
-bool glsl_symbol_table::add_type(const char *name, const glsl_type *t)
-{
- symbol_table_entry *entry = new(mem_ctx) symbol_table_entry(t);
- return _mesa_symbol_table_add_symbol(table, -1, name, entry) == 0;
-}
-
-bool glsl_symbol_table::add_function(ir_function *f)
-{
- if (this->language_version == 110 && name_declared_this_scope(f->name)) {
- /* In 1.10, functions and variables have separate namespaces. */
- symbol_table_entry *existing = get_entry(f->name);
- if ((existing->f == NULL) && (existing->t == NULL)) {
- existing->f = f;
- return true;
- }
- }
- symbol_table_entry *entry = new(mem_ctx) symbol_table_entry(f);
- return _mesa_symbol_table_add_symbol(table, -1, f->name, entry) == 0;
-}
-
-void glsl_symbol_table::add_global_function(ir_function *f)
-{
- symbol_table_entry *entry = new(mem_ctx) symbol_table_entry(f);
- int added = _mesa_symbol_table_add_global_symbol(table, -1, f->name, entry);
- assert(added == 0);
- (void)added;
-}
-
-ir_variable *glsl_symbol_table::get_variable(const char *name)
-{
- symbol_table_entry *entry = get_entry(name);
- return entry != NULL ? entry->v : NULL;
-}
-
-const glsl_type *glsl_symbol_table::get_type(const char *name)
-{
- symbol_table_entry *entry = get_entry(name);
- return entry != NULL ? entry->t : NULL;
-}
-
-ir_function *glsl_symbol_table::get_function(const char *name)
-{
- symbol_table_entry *entry = get_entry(name);
- return entry != NULL ? entry->f : NULL;
-}
-
-symbol_table_entry *glsl_symbol_table::get_entry(const char *name)
-{
- return (symbol_table_entry *)
- _mesa_symbol_table_find_symbol(table, -1, name);
-}
+/* -*- c++ -*- */
+/*
+ * Copyright © 2010 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+#include "glsl_symbol_table.h"
+
+class symbol_table_entry {
+public:
+ /* Callers of this ralloc-based new need not call delete. It's
+ * easier to just ralloc_free 'ctx' (or any of its ancestors). */
+ static void* operator new(size_t size, void *ctx)
+ {
+ void *entry = ralloc_size(ctx, size);
+ assert(entry != NULL);
+ return entry;
+ }
+
+ /* If the user *does* call delete, that's OK, we will just ralloc_free. */
+ static void operator delete(void *entry, void *ctx)
+ {
+ ralloc_free(entry);
+ }
+ static void operator delete(void *entry)
+ {
+ ralloc_free(entry);
+ }
+
+ symbol_table_entry(ir_variable *v) : v(v), f(0), t(0) {}
+ symbol_table_entry(ir_function *f) : v(0), f(f), t(0) {}
+ symbol_table_entry(const glsl_type *t) : v(0), f(0), t(t) {}
+
+ ir_variable *v;
+ ir_function *f;
+ const glsl_type *t;
+};
+
+glsl_symbol_table::glsl_symbol_table()
+{
+ this->language_version = 120;
+ this->table = _mesa_symbol_table_ctor();
+ this->mem_ctx = ralloc_context(NULL);
+}
+
+glsl_symbol_table::~glsl_symbol_table()
+{
+ _mesa_symbol_table_dtor(table);
+ ralloc_free(mem_ctx);
+}
+
+void glsl_symbol_table::push_scope()
+{
+ _mesa_symbol_table_push_scope(table);
+}
+
+void glsl_symbol_table::pop_scope()
+{
+ _mesa_symbol_table_pop_scope(table);
+}
+
+bool glsl_symbol_table::name_declared_this_scope(const char *name)
+{
+ return _mesa_symbol_table_symbol_scope(table, -1, name) == 0;
+}
+
+bool glsl_symbol_table::add_variable(ir_variable *v)
+{
+ if (this->language_version == 110) {
+ /* In 1.10, functions and variables have separate namespaces. */
+ symbol_table_entry *existing = get_entry(v->name);
+ if (name_declared_this_scope(v->name)) {
+ /* If there's already an existing function (not a constructor!) in
+ * the current scope, just update the existing entry to include 'v'.
+ */
+ if (existing->v == NULL && existing->t == NULL) {
+ existing->v = v;
+ return true;
+ }
+ } else {
+ /* If not declared at this scope, add a new entry. But if an existing
+ * entry includes a function, propagate that to this block - otherwise
+ * the new variable declaration would shadow the function.
+ */
+ symbol_table_entry *entry = new(mem_ctx) symbol_table_entry(v);
+ if (existing != NULL)
+ entry->f = existing->f;
+ int added = _mesa_symbol_table_add_symbol(table, -1, v->name, entry);
+ assert(added == 0);
+ (void)added;
+ return true;
+ }
+ return false;
+ }
+
+ /* 1.20+ rules: */
+ symbol_table_entry *entry = new(mem_ctx) symbol_table_entry(v);
+ return _mesa_symbol_table_add_symbol(table, -1, v->name, entry) == 0;
+}
+
+bool glsl_symbol_table::add_type(const char *name, const glsl_type *t)
+{
+ symbol_table_entry *entry = new(mem_ctx) symbol_table_entry(t);
+ return _mesa_symbol_table_add_symbol(table, -1, name, entry) == 0;
+}
+
+bool glsl_symbol_table::add_function(ir_function *f)
+{
+ if (this->language_version == 110 && name_declared_this_scope(f->name)) {
+ /* In 1.10, functions and variables have separate namespaces. */
+ symbol_table_entry *existing = get_entry(f->name);
+ if ((existing->f == NULL) && (existing->t == NULL)) {
+ existing->f = f;
+ return true;
+ }
+ }
+ symbol_table_entry *entry = new(mem_ctx) symbol_table_entry(f);
+ return _mesa_symbol_table_add_symbol(table, -1, f->name, entry) == 0;
+}
+
+void glsl_symbol_table::add_global_function(ir_function *f)
+{
+ symbol_table_entry *entry = new(mem_ctx) symbol_table_entry(f);
+ int added = _mesa_symbol_table_add_global_symbol(table, -1, f->name, entry);
+ assert(added == 0);
+ (void)added;
+}
+
+ir_variable *glsl_symbol_table::get_variable(const char *name)
+{
+ symbol_table_entry *entry = get_entry(name);
+ return entry != NULL ? entry->v : NULL;
+}
+
+const glsl_type *glsl_symbol_table::get_type(const char *name)
+{
+ symbol_table_entry *entry = get_entry(name);
+ return entry != NULL ? entry->t : NULL;
+}
+
+ir_function *glsl_symbol_table::get_function(const char *name)
+{
+ symbol_table_entry *entry = get_entry(name);
+ return entry != NULL ? entry->f : NULL;
+}
+
+symbol_table_entry *glsl_symbol_table::get_entry(const char *name)
+{
+ return (symbol_table_entry *)
+ _mesa_symbol_table_find_symbol(table, -1, name);
+}
diff --git a/mesalib/src/glsl/glsl_symbol_table.h b/mesalib/src/glsl/glsl_symbol_table.h
index 637bc033b..1afeddb33 100644
--- a/mesalib/src/glsl/glsl_symbol_table.h
+++ b/mesalib/src/glsl/glsl_symbol_table.h
@@ -68,6 +68,11 @@ public:
/* If the user *does* call delete, that's OK, we will just
* ralloc_free in that case. Here, C++ will have already called the
* destructor so tell ralloc not to do that again. */
+ static void operator delete(void *table, void *ctx)
+ {
+ ralloc_set_destructor(table, NULL);
+ ralloc_free(table);
+ }
static void operator delete(void *table)
{
ralloc_set_destructor(table, NULL);
diff --git a/mesalib/src/glsl/glsl_types.cpp b/mesalib/src/glsl/glsl_types.cpp
index 78d10bd93..ba862dfd6 100644
--- a/mesalib/src/glsl/glsl_types.cpp
+++ b/mesalib/src/glsl/glsl_types.cpp
@@ -1,509 +1,509 @@
-/*
- * Copyright © 2009 Intel Corporation
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include "main/core.h" /* for Elements */
-#include "glsl_symbol_table.h"
-#include "glsl_parser_extras.h"
-#include "glsl_types.h"
-#include "builtin_types.h"
-extern "C" {
-#include "program/hash_table.h"
-}
-
-hash_table *glsl_type::array_types = NULL;
-hash_table *glsl_type::record_types = NULL;
-void *glsl_type::mem_ctx = NULL;
-
-void
-glsl_type::init_ralloc_type_ctx(void)
-{
- if (glsl_type::mem_ctx == NULL) {
- glsl_type::mem_ctx = ralloc_autofree_context();
- assert(glsl_type::mem_ctx != NULL);
- }
-}
-
-glsl_type::glsl_type(GLenum gl_type,
- glsl_base_type base_type, unsigned vector_elements,
- unsigned matrix_columns, const char *name) :
- gl_type(gl_type),
- base_type(base_type),
- sampler_dimensionality(0), sampler_shadow(0), sampler_array(0),
- sampler_type(0),
- vector_elements(vector_elements), matrix_columns(matrix_columns),
- length(0)
-{
- init_ralloc_type_ctx();
- this->name = ralloc_strdup(this->mem_ctx, name);
- /* Neither dimension is zero or both dimensions are zero.
- */
- assert((vector_elements == 0) == (matrix_columns == 0));
- memset(& fields, 0, sizeof(fields));
-}
-
-glsl_type::glsl_type(GLenum gl_type,
- enum glsl_sampler_dim dim, bool shadow, bool array,
- unsigned type, const char *name) :
- gl_type(gl_type),
- base_type(GLSL_TYPE_SAMPLER),
- sampler_dimensionality(dim), sampler_shadow(shadow),
- sampler_array(array), sampler_type(type),
- vector_elements(0), matrix_columns(0),
- length(0)
-{
- init_ralloc_type_ctx();
- this->name = ralloc_strdup(this->mem_ctx, name);
- memset(& fields, 0, sizeof(fields));
-}
-
-glsl_type::glsl_type(const glsl_struct_field *fields, unsigned num_fields,
- const char *name) :
- base_type(GLSL_TYPE_STRUCT),
- sampler_dimensionality(0), sampler_shadow(0), sampler_array(0),
- sampler_type(0),
- vector_elements(0), matrix_columns(0),
- length(num_fields)
-{
- unsigned int i;
-
- init_ralloc_type_ctx();
- this->name = ralloc_strdup(this->mem_ctx, name);
- this->fields.structure = ralloc_array(this->mem_ctx,
- glsl_struct_field, length);
- for (i = 0; i < length; i++) {
- this->fields.structure[i].type = fields[i].type;
- this->fields.structure[i].name = ralloc_strdup(this->fields.structure,
- fields[i].name);
- }
-}
-
-static void
-add_types_to_symbol_table(glsl_symbol_table *symtab,
- const struct glsl_type *types,
- unsigned num_types, bool warn)
-{
- (void) warn;
-
- for (unsigned i = 0; i < num_types; i++) {
- symtab->add_type(types[i].name, & types[i]);
- }
-}
-
-void
-glsl_type::generate_100ES_types(glsl_symbol_table *symtab)
-{
- add_types_to_symbol_table(symtab, builtin_core_types,
- Elements(builtin_core_types),
- false);
- add_types_to_symbol_table(symtab, builtin_structure_types,
- Elements(builtin_structure_types),
- false);
- add_types_to_symbol_table(symtab, void_type, 1, false);
-}
-
-void
-glsl_type::generate_110_types(glsl_symbol_table *symtab)
-{
- generate_100ES_types(symtab);
-
- add_types_to_symbol_table(symtab, builtin_110_types,
- Elements(builtin_110_types),
- false);
- add_types_to_symbol_table(symtab, &_sampler3D_type, 1, false);
- add_types_to_symbol_table(symtab, builtin_110_deprecated_structure_types,
- Elements(builtin_110_deprecated_structure_types),
- false);
-}
-
-
-void
-glsl_type::generate_120_types(glsl_symbol_table *symtab)
-{
- generate_110_types(symtab);
-
- add_types_to_symbol_table(symtab, builtin_120_types,
- Elements(builtin_120_types), false);
-}
-
-
-void
-glsl_type::generate_130_types(glsl_symbol_table *symtab)
-{
- generate_120_types(symtab);
-
- add_types_to_symbol_table(symtab, builtin_130_types,
- Elements(builtin_130_types), false);
- generate_EXT_texture_array_types(symtab, false);
-}
-
-
-void
-glsl_type::generate_ARB_texture_rectangle_types(glsl_symbol_table *symtab,
- bool warn)
-{
- add_types_to_symbol_table(symtab, builtin_ARB_texture_rectangle_types,
- Elements(builtin_ARB_texture_rectangle_types),
- warn);
-}
-
-
-void
-glsl_type::generate_EXT_texture_array_types(glsl_symbol_table *symtab,
- bool warn)
-{
- add_types_to_symbol_table(symtab, builtin_EXT_texture_array_types,
- Elements(builtin_EXT_texture_array_types),
- warn);
-}
-
-
-void
-glsl_type::generate_OES_texture_3D_types(glsl_symbol_table *symtab, bool warn)
-{
- add_types_to_symbol_table(symtab, &_sampler3D_type, 1, warn);
-}
-
-
-void
-_mesa_glsl_initialize_types(struct _mesa_glsl_parse_state *state)
-{
- switch (state->language_version) {
- case 100:
- assert(state->es_shader);
- glsl_type::generate_100ES_types(state->symbols);
- break;
- case 110:
- glsl_type::generate_110_types(state->symbols);
- break;
- case 120:
- glsl_type::generate_120_types(state->symbols);
- break;
- case 130:
- glsl_type::generate_130_types(state->symbols);
- break;
- default:
- /* error */
- break;
- }
-
- if (state->ARB_texture_rectangle_enable) {
- glsl_type::generate_ARB_texture_rectangle_types(state->symbols,
- state->ARB_texture_rectangle_warn);
- }
- if (state->OES_texture_3D_enable && state->language_version == 100) {
- glsl_type::generate_OES_texture_3D_types(state->symbols,
- state->OES_texture_3D_warn);
- }
-
- if (state->EXT_texture_array_enable && state->language_version < 130) {
- // These are already included in 130; don't create twice.
- glsl_type::generate_EXT_texture_array_types(state->symbols,
- state->EXT_texture_array_warn);
- }
-}
-
-
-const glsl_type *glsl_type::get_base_type() const
-{
- switch (base_type) {
- case GLSL_TYPE_UINT:
- return uint_type;
- case GLSL_TYPE_INT:
- return int_type;
- case GLSL_TYPE_FLOAT:
- return float_type;
- case GLSL_TYPE_BOOL:
- return bool_type;
- default:
- return error_type;
- }
-}
-
-
-void
-_mesa_glsl_release_types(void)
-{
- if (glsl_type::array_types != NULL) {
- hash_table_dtor(glsl_type::array_types);
- glsl_type::array_types = NULL;
- }
-
- if (glsl_type::record_types != NULL) {
- hash_table_dtor(glsl_type::record_types);
- glsl_type::record_types = NULL;
- }
-}
-
-
-glsl_type::glsl_type(const glsl_type *array, unsigned length) :
- base_type(GLSL_TYPE_ARRAY),
- sampler_dimensionality(0), sampler_shadow(0), sampler_array(0),
- sampler_type(0),
- vector_elements(0), matrix_columns(0),
- name(NULL), length(length)
-{
- this->fields.array = array;
- /* Inherit the gl type of the base. The GL type is used for
- * uniform/statevar handling in Mesa and the arrayness of the type
- * is represented by the size rather than the type.
- */
- this->gl_type = array->gl_type;
-
- /* Allow a maximum of 10 characters for the array size. This is enough
- * for 32-bits of ~0. The extra 3 are for the '[', ']', and terminating
- * NUL.
- */
- const unsigned name_length = strlen(array->name) + 10 + 3;
- char *const n = (char *) ralloc_size(this->mem_ctx, name_length);
-
- if (length == 0)
- snprintf(n, name_length, "%s[]", array->name);
- else
- snprintf(n, name_length, "%s[%u]", array->name, length);
-
- this->name = n;
-}
-
-
-const glsl_type *
-glsl_type::get_instance(unsigned base_type, unsigned rows, unsigned columns)
-{
- if (base_type == GLSL_TYPE_VOID)
- return void_type;
-
- if ((rows < 1) || (rows > 4) || (columns < 1) || (columns > 4))
- return error_type;
-
- /* Treat GLSL vectors as Nx1 matrices.
- */
- if (columns == 1) {
- switch (base_type) {
- case GLSL_TYPE_UINT:
- return uint_type + (rows - 1);
- case GLSL_TYPE_INT:
- return int_type + (rows - 1);
- case GLSL_TYPE_FLOAT:
- return float_type + (rows - 1);
- case GLSL_TYPE_BOOL:
- return bool_type + (rows - 1);
- default:
- return error_type;
- }
- } else {
- if ((base_type != GLSL_TYPE_FLOAT) || (rows == 1))
- return error_type;
-
- /* GLSL matrix types are named mat{COLUMNS}x{ROWS}. Only the following
- * combinations are valid:
- *
- * 1 2 3 4
- * 1
- * 2 x x x
- * 3 x x x
- * 4 x x x
- */
-#define IDX(c,r) (((c-1)*3) + (r-1))
-
- switch (IDX(columns, rows)) {
- case IDX(2,2): return mat2_type;
- case IDX(2,3): return mat2x3_type;
- case IDX(2,4): return mat2x4_type;
- case IDX(3,2): return mat3x2_type;
- case IDX(3,3): return mat3_type;
- case IDX(3,4): return mat3x4_type;
- case IDX(4,2): return mat4x2_type;
- case IDX(4,3): return mat4x3_type;
- case IDX(4,4): return mat4_type;
- default: return error_type;
- }
- }
-
- assert(!"Should not get here.");
- return error_type;
-}
-
-
-const glsl_type *
-glsl_type::get_array_instance(const glsl_type *base, unsigned array_size)
-{
-
- if (array_types == NULL) {
- array_types = hash_table_ctor(64, hash_table_string_hash,
- hash_table_string_compare);
- }
-
- /* Generate a name using the base type pointer in the key. This is
- * done because the name of the base type may not be unique across
- * shaders. For example, two shaders may have different record types
- * named 'foo'.
- */
- char key[128];
- snprintf(key, sizeof(key), "%p[%u]", (void *) base, array_size);
-
- const glsl_type *t = (glsl_type *) hash_table_find(array_types, key);
- if (t == NULL) {
- t = new glsl_type(base, array_size);
-
- hash_table_insert(array_types, (void *) t, ralloc_strdup(mem_ctx, key));
- }
-
- assert(t->base_type == GLSL_TYPE_ARRAY);
- assert(t->length == array_size);
- assert(t->fields.array == base);
-
- return t;
-}
-
-
-int
-glsl_type::record_key_compare(const void *a, const void *b)
-{
- const glsl_type *const key1 = (glsl_type *) a;
- const glsl_type *const key2 = (glsl_type *) b;
-
- /* Return zero is the types match (there is zero difference) or non-zero
- * otherwise.
- */
- if (strcmp(key1->name, key2->name) != 0)
- return 1;
-
- if (key1->length != key2->length)
- return 1;
-
- for (unsigned i = 0; i < key1->length; i++) {
- if (key1->fields.structure[i].type != key2->fields.structure[i].type)
- return 1;
- if (strcmp(key1->fields.structure[i].name,
- key2->fields.structure[i].name) != 0)
- return 1;
- }
-
- return 0;
-}
-
-
-unsigned
-glsl_type::record_key_hash(const void *a)
-{
- const glsl_type *const key = (glsl_type *) a;
- char hash_key[128];
- unsigned size = 0;
-
- size = snprintf(hash_key, sizeof(hash_key), "%08x", key->length);
-
- for (unsigned i = 0; i < key->length; i++) {
- if (size >= sizeof(hash_key))
- break;
-
- size += snprintf(& hash_key[size], sizeof(hash_key) - size,
- "%p", (void *) key->fields.structure[i].type);
- }
-
- return hash_table_string_hash(& hash_key);
-}
-
-
-const glsl_type *
-glsl_type::get_record_instance(const glsl_struct_field *fields,
- unsigned num_fields,
- const char *name)
-{
- const glsl_type key(fields, num_fields, name);
-
- if (record_types == NULL) {
- record_types = hash_table_ctor(64, record_key_hash, record_key_compare);
- }
-
- const glsl_type *t = (glsl_type *) hash_table_find(record_types, & key);
- if (t == NULL) {
- t = new glsl_type(fields, num_fields, name);
-
- hash_table_insert(record_types, (void *) t, t);
- }
-
- assert(t->base_type == GLSL_TYPE_STRUCT);
- assert(t->length == num_fields);
- assert(strcmp(t->name, name) == 0);
-
- return t;
-}
-
-
-const glsl_type *
-glsl_type::field_type(const char *name) const
-{
- if (this->base_type != GLSL_TYPE_STRUCT)
- return error_type;
-
- for (unsigned i = 0; i < this->length; i++) {
- if (strcmp(name, this->fields.structure[i].name) == 0)
- return this->fields.structure[i].type;
- }
-
- return error_type;
-}
-
-
-int
-glsl_type::field_index(const char *name) const
-{
- if (this->base_type != GLSL_TYPE_STRUCT)
- return -1;
-
- for (unsigned i = 0; i < this->length; i++) {
- if (strcmp(name, this->fields.structure[i].name) == 0)
- return i;
- }
-
- return -1;
-}
-
-
-unsigned
-glsl_type::component_slots() const
-{
- switch (this->base_type) {
- case GLSL_TYPE_UINT:
- case GLSL_TYPE_INT:
- case GLSL_TYPE_FLOAT:
- case GLSL_TYPE_BOOL:
- return this->components();
-
- case GLSL_TYPE_STRUCT: {
- unsigned size = 0;
-
- for (unsigned i = 0; i < this->length; i++)
- size += this->fields.structure[i].type->component_slots();
-
- return size;
- }
-
- case GLSL_TYPE_ARRAY:
- return this->length * this->fields.array->component_slots();
-
- default:
- return 0;
- }
-}
+/*
+ * Copyright © 2009 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include "main/core.h" /* for Elements */
+#include "glsl_symbol_table.h"
+#include "glsl_parser_extras.h"
+#include "glsl_types.h"
+#include "builtin_types.h"
+extern "C" {
+#include "program/hash_table.h"
+}
+
+hash_table *glsl_type::array_types = NULL;
+hash_table *glsl_type::record_types = NULL;
+void *glsl_type::mem_ctx = NULL;
+
+void
+glsl_type::init_ralloc_type_ctx(void)
+{
+ if (glsl_type::mem_ctx == NULL) {
+ glsl_type::mem_ctx = ralloc_autofree_context();
+ assert(glsl_type::mem_ctx != NULL);
+ }
+}
+
+glsl_type::glsl_type(GLenum gl_type,
+ glsl_base_type base_type, unsigned vector_elements,
+ unsigned matrix_columns, const char *name) :
+ gl_type(gl_type),
+ base_type(base_type),
+ sampler_dimensionality(0), sampler_shadow(0), sampler_array(0),
+ sampler_type(0),
+ vector_elements(vector_elements), matrix_columns(matrix_columns),
+ length(0)
+{
+ init_ralloc_type_ctx();
+ this->name = ralloc_strdup(this->mem_ctx, name);
+ /* Neither dimension is zero or both dimensions are zero.
+ */
+ assert((vector_elements == 0) == (matrix_columns == 0));
+ memset(& fields, 0, sizeof(fields));
+}
+
+glsl_type::glsl_type(GLenum gl_type,
+ enum glsl_sampler_dim dim, bool shadow, bool array,
+ unsigned type, const char *name) :
+ gl_type(gl_type),
+ base_type(GLSL_TYPE_SAMPLER),
+ sampler_dimensionality(dim), sampler_shadow(shadow),
+ sampler_array(array), sampler_type(type),
+ vector_elements(0), matrix_columns(0),
+ length(0)
+{
+ init_ralloc_type_ctx();
+ this->name = ralloc_strdup(this->mem_ctx, name);
+ memset(& fields, 0, sizeof(fields));
+}
+
+glsl_type::glsl_type(const glsl_struct_field *fields, unsigned num_fields,
+ const char *name) :
+ base_type(GLSL_TYPE_STRUCT),
+ sampler_dimensionality(0), sampler_shadow(0), sampler_array(0),
+ sampler_type(0),
+ vector_elements(0), matrix_columns(0),
+ length(num_fields)
+{
+ unsigned int i;
+
+ init_ralloc_type_ctx();
+ this->name = ralloc_strdup(this->mem_ctx, name);
+ this->fields.structure = ralloc_array(this->mem_ctx,
+ glsl_struct_field, length);
+ for (i = 0; i < length; i++) {
+ this->fields.structure[i].type = fields[i].type;
+ this->fields.structure[i].name = ralloc_strdup(this->fields.structure,
+ fields[i].name);
+ }
+}
+
+static void
+add_types_to_symbol_table(glsl_symbol_table *symtab,
+ const struct glsl_type *types,
+ unsigned num_types, bool warn)
+{
+ (void) warn;
+
+ for (unsigned i = 0; i < num_types; i++) {
+ symtab->add_type(types[i].name, & types[i]);
+ }
+}
+
+void
+glsl_type::generate_100ES_types(glsl_symbol_table *symtab)
+{
+ add_types_to_symbol_table(symtab, builtin_core_types,
+ Elements(builtin_core_types),
+ false);
+ add_types_to_symbol_table(symtab, builtin_structure_types,
+ Elements(builtin_structure_types),
+ false);
+ add_types_to_symbol_table(symtab, void_type, 1, false);
+}
+
+void
+glsl_type::generate_110_types(glsl_symbol_table *symtab)
+{
+ generate_100ES_types(symtab);
+
+ add_types_to_symbol_table(symtab, builtin_110_types,
+ Elements(builtin_110_types),
+ false);
+ add_types_to_symbol_table(symtab, &_sampler3D_type, 1, false);
+ add_types_to_symbol_table(symtab, builtin_110_deprecated_structure_types,
+ Elements(builtin_110_deprecated_structure_types),
+ false);
+}
+
+
+void
+glsl_type::generate_120_types(glsl_symbol_table *symtab)
+{
+ generate_110_types(symtab);
+
+ add_types_to_symbol_table(symtab, builtin_120_types,
+ Elements(builtin_120_types), false);
+}
+
+
+void
+glsl_type::generate_130_types(glsl_symbol_table *symtab)
+{
+ generate_120_types(symtab);
+
+ add_types_to_symbol_table(symtab, builtin_130_types,
+ Elements(builtin_130_types), false);
+ generate_EXT_texture_array_types(symtab, false);
+}
+
+
+void
+glsl_type::generate_ARB_texture_rectangle_types(glsl_symbol_table *symtab,
+ bool warn)
+{
+ add_types_to_symbol_table(symtab, builtin_ARB_texture_rectangle_types,
+ Elements(builtin_ARB_texture_rectangle_types),
+ warn);
+}
+
+
+void
+glsl_type::generate_EXT_texture_array_types(glsl_symbol_table *symtab,
+ bool warn)
+{
+ add_types_to_symbol_table(symtab, builtin_EXT_texture_array_types,
+ Elements(builtin_EXT_texture_array_types),
+ warn);
+}
+
+
+void
+glsl_type::generate_OES_texture_3D_types(glsl_symbol_table *symtab, bool warn)
+{
+ add_types_to_symbol_table(symtab, &_sampler3D_type, 1, warn);
+}
+
+
+void
+_mesa_glsl_initialize_types(struct _mesa_glsl_parse_state *state)
+{
+ switch (state->language_version) {
+ case 100:
+ assert(state->es_shader);
+ glsl_type::generate_100ES_types(state->symbols);
+ break;
+ case 110:
+ glsl_type::generate_110_types(state->symbols);
+ break;
+ case 120:
+ glsl_type::generate_120_types(state->symbols);
+ break;
+ case 130:
+ glsl_type::generate_130_types(state->symbols);
+ break;
+ default:
+ /* error */
+ break;
+ }
+
+ if (state->ARB_texture_rectangle_enable) {
+ glsl_type::generate_ARB_texture_rectangle_types(state->symbols,
+ state->ARB_texture_rectangle_warn);
+ }
+ if (state->OES_texture_3D_enable && state->language_version == 100) {
+ glsl_type::generate_OES_texture_3D_types(state->symbols,
+ state->OES_texture_3D_warn);
+ }
+
+ if (state->EXT_texture_array_enable && state->language_version < 130) {
+ // These are already included in 130; don't create twice.
+ glsl_type::generate_EXT_texture_array_types(state->symbols,
+ state->EXT_texture_array_warn);
+ }
+}
+
+
+const glsl_type *glsl_type::get_base_type() const
+{
+ switch (base_type) {
+ case GLSL_TYPE_UINT:
+ return uint_type;
+ case GLSL_TYPE_INT:
+ return int_type;
+ case GLSL_TYPE_FLOAT:
+ return float_type;
+ case GLSL_TYPE_BOOL:
+ return bool_type;
+ default:
+ return error_type;
+ }
+}
+
+
+void
+_mesa_glsl_release_types(void)
+{
+ if (glsl_type::array_types != NULL) {
+ hash_table_dtor(glsl_type::array_types);
+ glsl_type::array_types = NULL;
+ }
+
+ if (glsl_type::record_types != NULL) {
+ hash_table_dtor(glsl_type::record_types);
+ glsl_type::record_types = NULL;
+ }
+}
+
+
+glsl_type::glsl_type(const glsl_type *array, unsigned length) :
+ base_type(GLSL_TYPE_ARRAY),
+ sampler_dimensionality(0), sampler_shadow(0), sampler_array(0),
+ sampler_type(0),
+ vector_elements(0), matrix_columns(0),
+ name(NULL), length(length)
+{
+ this->fields.array = array;
+ /* Inherit the gl type of the base. The GL type is used for
+ * uniform/statevar handling in Mesa and the arrayness of the type
+ * is represented by the size rather than the type.
+ */
+ this->gl_type = array->gl_type;
+
+ /* Allow a maximum of 10 characters for the array size. This is enough
+ * for 32-bits of ~0. The extra 3 are for the '[', ']', and terminating
+ * NUL.
+ */
+ const unsigned name_length = strlen(array->name) + 10 + 3;
+ char *const n = (char *) ralloc_size(this->mem_ctx, name_length);
+
+ if (length == 0)
+ snprintf(n, name_length, "%s[]", array->name);
+ else
+ snprintf(n, name_length, "%s[%u]", array->name, length);
+
+ this->name = n;
+}
+
+
+const glsl_type *
+glsl_type::get_instance(unsigned base_type, unsigned rows, unsigned columns)
+{
+ if (base_type == GLSL_TYPE_VOID)
+ return void_type;
+
+ if ((rows < 1) || (rows > 4) || (columns < 1) || (columns > 4))
+ return error_type;
+
+ /* Treat GLSL vectors as Nx1 matrices.
+ */
+ if (columns == 1) {
+ switch (base_type) {
+ case GLSL_TYPE_UINT:
+ return uint_type + (rows - 1);
+ case GLSL_TYPE_INT:
+ return int_type + (rows - 1);
+ case GLSL_TYPE_FLOAT:
+ return float_type + (rows - 1);
+ case GLSL_TYPE_BOOL:
+ return bool_type + (rows - 1);
+ default:
+ return error_type;
+ }
+ } else {
+ if ((base_type != GLSL_TYPE_FLOAT) || (rows == 1))
+ return error_type;
+
+ /* GLSL matrix types are named mat{COLUMNS}x{ROWS}. Only the following
+ * combinations are valid:
+ *
+ * 1 2 3 4
+ * 1
+ * 2 x x x
+ * 3 x x x
+ * 4 x x x
+ */
+#define IDX(c,r) (((c-1)*3) + (r-1))
+
+ switch (IDX(columns, rows)) {
+ case IDX(2,2): return mat2_type;
+ case IDX(2,3): return mat2x3_type;
+ case IDX(2,4): return mat2x4_type;
+ case IDX(3,2): return mat3x2_type;
+ case IDX(3,3): return mat3_type;
+ case IDX(3,4): return mat3x4_type;
+ case IDX(4,2): return mat4x2_type;
+ case IDX(4,3): return mat4x3_type;
+ case IDX(4,4): return mat4_type;
+ default: return error_type;
+ }
+ }
+
+ assert(!"Should not get here.");
+ return error_type;
+}
+
+
+const glsl_type *
+glsl_type::get_array_instance(const glsl_type *base, unsigned array_size)
+{
+
+ if (array_types == NULL) {
+ array_types = hash_table_ctor(64, hash_table_string_hash,
+ hash_table_string_compare);
+ }
+
+ /* Generate a name using the base type pointer in the key. This is
+ * done because the name of the base type may not be unique across
+ * shaders. For example, two shaders may have different record types
+ * named 'foo'.
+ */
+ char key[128];
+ snprintf(key, sizeof(key), "%p[%u]", (void *) base, array_size);
+
+ const glsl_type *t = (glsl_type *) hash_table_find(array_types, key);
+ if (t == NULL) {
+ t = new glsl_type(base, array_size);
+
+ hash_table_insert(array_types, (void *) t, ralloc_strdup(mem_ctx, key));
+ }
+
+ assert(t->base_type == GLSL_TYPE_ARRAY);
+ assert(t->length == array_size);
+ assert(t->fields.array == base);
+
+ return t;
+}
+
+
+int
+glsl_type::record_key_compare(const void *a, const void *b)
+{
+ const glsl_type *const key1 = (glsl_type *) a;
+ const glsl_type *const key2 = (glsl_type *) b;
+
+ /* Return zero is the types match (there is zero difference) or non-zero
+ * otherwise.
+ */
+ if (strcmp(key1->name, key2->name) != 0)
+ return 1;
+
+ if (key1->length != key2->length)
+ return 1;
+
+ for (unsigned i = 0; i < key1->length; i++) {
+ if (key1->fields.structure[i].type != key2->fields.structure[i].type)
+ return 1;
+ if (strcmp(key1->fields.structure[i].name,
+ key2->fields.structure[i].name) != 0)
+ return 1;
+ }
+
+ return 0;
+}
+
+
+unsigned
+glsl_type::record_key_hash(const void *a)
+{
+ const glsl_type *const key = (glsl_type *) a;
+ char hash_key[128];
+ unsigned size = 0;
+
+ size = snprintf(hash_key, sizeof(hash_key), "%08x", key->length);
+
+ for (unsigned i = 0; i < key->length; i++) {
+ if (size >= sizeof(hash_key))
+ break;
+
+ size += snprintf(& hash_key[size], sizeof(hash_key) - size,
+ "%p", (void *) key->fields.structure[i].type);
+ }
+
+ return hash_table_string_hash(& hash_key);
+}
+
+
+const glsl_type *
+glsl_type::get_record_instance(const glsl_struct_field *fields,
+ unsigned num_fields,
+ const char *name)
+{
+ const glsl_type key(fields, num_fields, name);
+
+ if (record_types == NULL) {
+ record_types = hash_table_ctor(64, record_key_hash, record_key_compare);
+ }
+
+ const glsl_type *t = (glsl_type *) hash_table_find(record_types, & key);
+ if (t == NULL) {
+ t = new glsl_type(fields, num_fields, name);
+
+ hash_table_insert(record_types, (void *) t, t);
+ }
+
+ assert(t->base_type == GLSL_TYPE_STRUCT);
+ assert(t->length == num_fields);
+ assert(strcmp(t->name, name) == 0);
+
+ return t;
+}
+
+
+const glsl_type *
+glsl_type::field_type(const char *name) const
+{
+ if (this->base_type != GLSL_TYPE_STRUCT)
+ return error_type;
+
+ for (unsigned i = 0; i < this->length; i++) {
+ if (strcmp(name, this->fields.structure[i].name) == 0)
+ return this->fields.structure[i].type;
+ }
+
+ return error_type;
+}
+
+
+int
+glsl_type::field_index(const char *name) const
+{
+ if (this->base_type != GLSL_TYPE_STRUCT)
+ return -1;
+
+ for (unsigned i = 0; i < this->length; i++) {
+ if (strcmp(name, this->fields.structure[i].name) == 0)
+ return i;
+ }
+
+ return -1;
+}
+
+
+unsigned
+glsl_type::component_slots() const
+{
+ switch (this->base_type) {
+ case GLSL_TYPE_UINT:
+ case GLSL_TYPE_INT:
+ case GLSL_TYPE_FLOAT:
+ case GLSL_TYPE_BOOL:
+ return this->components();
+
+ case GLSL_TYPE_STRUCT: {
+ unsigned size = 0;
+
+ for (unsigned i = 0; i < this->length; i++)
+ size += this->fields.structure[i].type->component_slots();
+
+ return size;
+ }
+
+ case GLSL_TYPE_ARRAY:
+ return this->length * this->fields.array->component_slots();
+
+ default:
+ return 0;
+ }
+}
diff --git a/mesalib/src/glsl/hir_field_selection.cpp b/mesalib/src/glsl/hir_field_selection.cpp
index 3c33127b5..21f107405 100644
--- a/mesalib/src/glsl/hir_field_selection.cpp
+++ b/mesalib/src/glsl/hir_field_selection.cpp
@@ -1,102 +1,102 @@
-/*
- * Copyright © 2010 Intel Corporation
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-
-#include "ir.h"
-#include "program/symbol_table.h"
-#include "glsl_parser_extras.h"
-#include "ast.h"
-#include "glsl_types.h"
-
-ir_rvalue *
-_mesa_ast_field_selection_to_hir(const ast_expression *expr,
- exec_list *instructions,
- struct _mesa_glsl_parse_state *state)
-{
- void *ctx = state;
- ir_rvalue *result = NULL;
- ir_rvalue *op;
-
- op = expr->subexpressions[0]->hir(instructions, state);
-
- /* There are two kinds of field selection. There is the selection of a
- * specific field from a structure, and there is the selection of a
- * swizzle / mask from a vector. Which is which is determined entirely
- * by the base type of the thing to which the field selection operator is
- * being applied.
- */
- YYLTYPE loc = expr->get_location();
- if (op->type->is_error()) {
- /* silently propagate the error */
- } else if (op->type->is_vector()) {
- ir_swizzle *swiz = ir_swizzle::create(op,
- expr->primary_expression.identifier,
- op->type->vector_elements);
- if (swiz != NULL) {
- result = swiz;
- } else {
- /* FINISHME: Logging of error messages should be moved into
- * FINISHME: ir_swizzle::create. This allows the generation of more
- * FINISHME: specific error messages.
- */
- _mesa_glsl_error(& loc, state, "Invalid swizzle / mask `%s'",
- expr->primary_expression.identifier);
- }
- } else if (op->type->base_type == GLSL_TYPE_STRUCT) {
- result = new(ctx) ir_dereference_record(op,
- expr->primary_expression.identifier);
-
- if (result->type->is_error()) {
- _mesa_glsl_error(& loc, state, "Cannot access field `%s' of "
- "structure",
- expr->primary_expression.identifier);
- }
- } else if (expr->subexpressions[1] != NULL) {
- /* Handle "method calls" in GLSL 1.20 - namely, array.length() */
- if (state->language_version < 120)
- _mesa_glsl_error(&loc, state, "Methods not supported in GLSL 1.10.");
-
- ast_expression *call = expr->subexpressions[1];
- assert(call->oper == ast_function_call);
-
- const char *method;
- method = call->subexpressions[0]->primary_expression.identifier;
-
- if (op->type->is_array() && strcmp(method, "length") == 0) {
- if (!call->expressions.is_empty())
- _mesa_glsl_error(&loc, state, "length method takes no arguments.");
-
- if (op->type->array_size() == 0)
- _mesa_glsl_error(&loc, state, "length called on unsized array.");
-
- result = new(ctx) ir_constant(op->type->array_size());
- } else {
- _mesa_glsl_error(&loc, state, "Unknown method: `%s'.", method);
- }
- } else {
- _mesa_glsl_error(& loc, state, "Cannot access field `%s' of "
- "non-structure / non-vector.",
- expr->primary_expression.identifier);
- }
-
- return result ? result : ir_call::get_error_instruction(ctx);
-}
+/*
+ * Copyright © 2010 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+#include "ir.h"
+#include "program/symbol_table.h"
+#include "glsl_parser_extras.h"
+#include "ast.h"
+#include "glsl_types.h"
+
+ir_rvalue *
+_mesa_ast_field_selection_to_hir(const ast_expression *expr,
+ exec_list *instructions,
+ struct _mesa_glsl_parse_state *state)
+{
+ void *ctx = state;
+ ir_rvalue *result = NULL;
+ ir_rvalue *op;
+
+ op = expr->subexpressions[0]->hir(instructions, state);
+
+ /* There are two kinds of field selection. There is the selection of a
+ * specific field from a structure, and there is the selection of a
+ * swizzle / mask from a vector. Which is which is determined entirely
+ * by the base type of the thing to which the field selection operator is
+ * being applied.
+ */
+ YYLTYPE loc = expr->get_location();
+ if (op->type->is_error()) {
+ /* silently propagate the error */
+ } else if (op->type->is_vector()) {
+ ir_swizzle *swiz = ir_swizzle::create(op,
+ expr->primary_expression.identifier,
+ op->type->vector_elements);
+ if (swiz != NULL) {
+ result = swiz;
+ } else {
+ /* FINISHME: Logging of error messages should be moved into
+ * FINISHME: ir_swizzle::create. This allows the generation of more
+ * FINISHME: specific error messages.
+ */
+ _mesa_glsl_error(& loc, state, "Invalid swizzle / mask `%s'",
+ expr->primary_expression.identifier);
+ }
+ } else if (op->type->base_type == GLSL_TYPE_STRUCT) {
+ result = new(ctx) ir_dereference_record(op,
+ expr->primary_expression.identifier);
+
+ if (result->type->is_error()) {
+ _mesa_glsl_error(& loc, state, "Cannot access field `%s' of "
+ "structure",
+ expr->primary_expression.identifier);
+ }
+ } else if (expr->subexpressions[1] != NULL) {
+ /* Handle "method calls" in GLSL 1.20 - namely, array.length() */
+ if (state->language_version < 120)
+ _mesa_glsl_error(&loc, state, "Methods not supported in GLSL 1.10.");
+
+ ast_expression *call = expr->subexpressions[1];
+ assert(call->oper == ast_function_call);
+
+ const char *method;
+ method = call->subexpressions[0]->primary_expression.identifier;
+
+ if (op->type->is_array() && strcmp(method, "length") == 0) {
+ if (!call->expressions.is_empty())
+ _mesa_glsl_error(&loc, state, "length method takes no arguments.");
+
+ if (op->type->array_size() == 0)
+ _mesa_glsl_error(&loc, state, "length called on unsized array.");
+
+ result = new(ctx) ir_constant(op->type->array_size());
+ } else {
+ _mesa_glsl_error(&loc, state, "Unknown method: `%s'.", method);
+ }
+ } else {
+ _mesa_glsl_error(& loc, state, "Cannot access field `%s' of "
+ "non-structure / non-vector.",
+ expr->primary_expression.identifier);
+ }
+
+ return result ? result : ir_call::get_error_instruction(ctx);
+}
diff --git a/mesalib/src/glsl/ir.cpp b/mesalib/src/glsl/ir.cpp
index a3623b31e..7ee07f3c6 100644
--- a/mesalib/src/glsl/ir.cpp
+++ b/mesalib/src/glsl/ir.cpp
@@ -1,1572 +1,1572 @@
-/*
- * Copyright © 2010 Intel Corporation
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-#include <string.h>
-#include "main/core.h" /* for MAX2 */
-#include "ir.h"
-#include "ir_visitor.h"
-#include "glsl_types.h"
-
-ir_rvalue::ir_rvalue()
-{
- this->type = glsl_type::error_type;
-}
-
-bool ir_rvalue::is_zero() const
-{
- return false;
-}
-
-bool ir_rvalue::is_one() const
-{
- return false;
-}
-
-bool ir_rvalue::is_negative_one() const
-{
- return false;
-}
-
-/**
- * Modify the swizzle make to move one component to another
- *
- * \param m IR swizzle to be modified
- * \param from Component in the RHS that is to be swizzled
- * \param to Desired swizzle location of \c from
- */
-static void
-update_rhs_swizzle(ir_swizzle_mask &m, unsigned from, unsigned to)
-{
- switch (to) {
- case 0: m.x = from; break;
- case 1: m.y = from; break;
- case 2: m.z = from; break;
- case 3: m.w = from; break;
- default: assert(!"Should not get here.");
- }
-
- m.num_components = MAX2(m.num_components, (to + 1));
-}
-
-void
-ir_assignment::set_lhs(ir_rvalue *lhs)
-{
- void *mem_ctx = this;
- bool swizzled = false;
-
- while (lhs != NULL) {
- ir_swizzle *swiz = lhs->as_swizzle();
-
- if (swiz == NULL)
- break;
-
- unsigned write_mask = 0;
- ir_swizzle_mask rhs_swiz = { 0, 0, 0, 0, 0, 0 };
-
- for (unsigned i = 0; i < swiz->mask.num_components; i++) {
- unsigned c = 0;
-
- switch (i) {
- case 0: c = swiz->mask.x; break;
- case 1: c = swiz->mask.y; break;
- case 2: c = swiz->mask.z; break;
- case 3: c = swiz->mask.w; break;
- default: assert(!"Should not get here.");
- }
-
- write_mask |= (((this->write_mask >> i) & 1) << c);
- update_rhs_swizzle(rhs_swiz, i, c);
- }
-
- this->write_mask = write_mask;
- lhs = swiz->val;
-
- this->rhs = new(mem_ctx) ir_swizzle(this->rhs, rhs_swiz);
- swizzled = true;
- }
-
- if (swizzled) {
- /* Now, RHS channels line up with the LHS writemask. Collapse it
- * to just the channels that will be written.
- */
- ir_swizzle_mask rhs_swiz = { 0, 0, 0, 0, 0, 0 };
- int rhs_chan = 0;
- for (int i = 0; i < 4; i++) {
- if (write_mask & (1 << i))
- update_rhs_swizzle(rhs_swiz, i, rhs_chan++);
- }
- this->rhs = new(mem_ctx) ir_swizzle(this->rhs, rhs_swiz);
- }
-
- assert((lhs == NULL) || lhs->as_dereference());
-
- this->lhs = (ir_dereference *) lhs;
-}
-
-ir_variable *
-ir_assignment::whole_variable_written()
-{
- ir_variable *v = this->lhs->whole_variable_referenced();
-
- if (v == NULL)
- return NULL;
-
- if (v->type->is_scalar())
- return v;
-
- if (v->type->is_vector()) {
- const unsigned mask = (1U << v->type->vector_elements) - 1;
-
- if (mask != this->write_mask)
- return NULL;
- }
-
- /* Either all the vector components are assigned or the variable is some
- * composite type (and the whole thing is assigned.
- */
- return v;
-}
-
-ir_assignment::ir_assignment(ir_dereference *lhs, ir_rvalue *rhs,
- ir_rvalue *condition, unsigned write_mask)
-{
- this->ir_type = ir_type_assignment;
- this->condition = condition;
- this->rhs = rhs;
- this->lhs = lhs;
- this->write_mask = write_mask;
-
- if (lhs->type->is_scalar() || lhs->type->is_vector()) {
- int lhs_components = 0;
- for (int i = 0; i < 4; i++) {
- if (write_mask & (1 << i))
- lhs_components++;
- }
-
- assert(lhs_components == this->rhs->type->vector_elements);
- }
-}
-
-ir_assignment::ir_assignment(ir_rvalue *lhs, ir_rvalue *rhs,
- ir_rvalue *condition)
-{
- this->ir_type = ir_type_assignment;
- this->condition = condition;
- this->rhs = rhs;
-
- /* If the RHS is a vector type, assume that all components of the vector
- * type are being written to the LHS. The write mask comes from the RHS
- * because we can have a case where the LHS is a vec4 and the RHS is a
- * vec3. In that case, the assignment is:
- *
- * (assign (...) (xyz) (var_ref lhs) (var_ref rhs))
- */
- if (rhs->type->is_vector())
- this->write_mask = (1U << rhs->type->vector_elements) - 1;
- else if (rhs->type->is_scalar())
- this->write_mask = 1;
- else
- this->write_mask = 0;
-
- this->set_lhs(lhs);
-}
-
-
-ir_expression::ir_expression(int op, const struct glsl_type *type,
- ir_rvalue *op0)
-{
- assert(get_num_operands(ir_expression_operation(op)) == 1);
- this->ir_type = ir_type_expression;
- this->type = type;
- this->operation = ir_expression_operation(op);
- this->operands[0] = op0;
- this->operands[1] = NULL;
- this->operands[2] = NULL;
- this->operands[3] = NULL;
-}
-
-ir_expression::ir_expression(int op, const struct glsl_type *type,
- ir_rvalue *op0, ir_rvalue *op1)
-{
- assert(((op1 == NULL) && (get_num_operands(ir_expression_operation(op)) == 1))
- || (get_num_operands(ir_expression_operation(op)) == 2));
- this->ir_type = ir_type_expression;
- this->type = type;
- this->operation = ir_expression_operation(op);
- this->operands[0] = op0;
- this->operands[1] = op1;
- this->operands[2] = NULL;
- this->operands[3] = NULL;
-}
-
-ir_expression::ir_expression(int op, const struct glsl_type *type,
- ir_rvalue *op0, ir_rvalue *op1,
- ir_rvalue *op2, ir_rvalue *op3)
-{
- this->ir_type = ir_type_expression;
- this->type = type;
- this->operation = ir_expression_operation(op);
- this->operands[0] = op0;
- this->operands[1] = op1;
- this->operands[2] = op2;
- this->operands[3] = op3;
-}
-
-ir_expression::ir_expression(int op, ir_rvalue *op0)
-{
- this->ir_type = ir_type_expression;
-
- this->operation = ir_expression_operation(op);
- this->operands[0] = op0;
- this->operands[1] = NULL;
- this->operands[2] = NULL;
- this->operands[3] = NULL;
-
- assert(op <= ir_last_unop);
-
- switch (this->operation) {
- case ir_unop_bit_not:
- case ir_unop_logic_not:
- case ir_unop_neg:
- case ir_unop_abs:
- case ir_unop_sign:
- case ir_unop_rcp:
- case ir_unop_rsq:
- case ir_unop_sqrt:
- case ir_unop_exp:
- case ir_unop_log:
- case ir_unop_exp2:
- case ir_unop_log2:
- case ir_unop_trunc:
- case ir_unop_ceil:
- case ir_unop_floor:
- case ir_unop_fract:
- case ir_unop_round_even:
- case ir_unop_sin:
- case ir_unop_cos:
- case ir_unop_sin_reduced:
- case ir_unop_cos_reduced:
- case ir_unop_dFdx:
- case ir_unop_dFdy:
- this->type = op0->type;
- break;
-
- case ir_unop_f2i:
- case ir_unop_b2i:
- this->type = glsl_type::get_instance(GLSL_TYPE_INT,
- op0->type->vector_elements, 1);
- break;
-
- case ir_unop_b2f:
- case ir_unop_i2f:
- case ir_unop_u2f:
- this->type = glsl_type::get_instance(GLSL_TYPE_FLOAT,
- op0->type->vector_elements, 1);
- break;
-
- case ir_unop_f2b:
- case ir_unop_i2b:
- this->type = glsl_type::get_instance(GLSL_TYPE_BOOL,
- op0->type->vector_elements, 1);
- break;
-
- case ir_unop_noise:
- this->type = glsl_type::float_type;
- break;
-
- case ir_unop_any:
- this->type = glsl_type::bool_type;
- break;
-
- default:
- assert(!"not reached: missing automatic type setup for ir_expression");
- this->type = op0->type;
- break;
- }
-}
-
-ir_expression::ir_expression(int op, ir_rvalue *op0, ir_rvalue *op1)
-{
- this->ir_type = ir_type_expression;
-
- this->operation = ir_expression_operation(op);
- this->operands[0] = op0;
- this->operands[1] = op1;
- this->operands[2] = NULL;
- this->operands[3] = NULL;
-
- assert(op > ir_last_unop);
-
- switch (this->operation) {
- case ir_binop_all_equal:
- case ir_binop_any_nequal:
- this->type = glsl_type::bool_type;
- break;
-
- case ir_binop_add:
- case ir_binop_sub:
- case ir_binop_min:
- case ir_binop_max:
- case ir_binop_pow:
- case ir_binop_mul:
- case ir_binop_div:
- case ir_binop_mod:
- if (op0->type->is_scalar()) {
- this->type = op1->type;
- } else if (op1->type->is_scalar()) {
- this->type = op0->type;
- } else {
- /* FINISHME: matrix types */
- assert(!op0->type->is_matrix() && !op1->type->is_matrix());
- assert(op0->type == op1->type);
- this->type = op0->type;
- }
- break;
-
- case ir_binop_logic_and:
- case ir_binop_logic_xor:
- case ir_binop_logic_or:
- case ir_binop_bit_and:
- case ir_binop_bit_xor:
- case ir_binop_bit_or:
- if (op0->type->is_scalar()) {
- this->type = op1->type;
- } else if (op1->type->is_scalar()) {
- this->type = op0->type;
- }
- break;
-
- case ir_binop_equal:
- case ir_binop_nequal:
- case ir_binop_lequal:
- case ir_binop_gequal:
- case ir_binop_less:
- case ir_binop_greater:
- assert(op0->type == op1->type);
- this->type = glsl_type::get_instance(GLSL_TYPE_BOOL,
- op0->type->vector_elements, 1);
- break;
-
- case ir_binop_dot:
- this->type = glsl_type::float_type;
- break;
-
- case ir_binop_lshift:
- case ir_binop_rshift:
- this->type = op0->type;
- break;
-
- default:
- assert(!"not reached: missing automatic type setup for ir_expression");
- this->type = glsl_type::float_type;
- }
-}
-
-unsigned int
-ir_expression::get_num_operands(ir_expression_operation op)
-{
- assert(op <= ir_last_opcode);
-
- if (op <= ir_last_unop)
- return 1;
-
- if (op <= ir_last_binop)
- return 2;
-
- if (op == ir_quadop_vector)
- return 4;
-
- assert(false);
- return 0;
-}
-
-static const char *const operator_strs[] = {
- "~",
- "!",
- "neg",
- "abs",
- "sign",
- "rcp",
- "rsq",
- "sqrt",
- "exp",
- "log",
- "exp2",
- "log2",
- "f2i",
- "i2f",
- "f2b",
- "b2f",
- "i2b",
- "b2i",
- "u2f",
- "any",
- "trunc",
- "ceil",
- "floor",
- "fract",
- "round_even",
- "sin",
- "cos",
- "sin_reduced",
- "cos_reduced",
- "dFdx",
- "dFdy",
- "noise",
- "+",
- "-",
- "*",
- "/",
- "%",
- "<",
- ">",
- "<=",
- ">=",
- "==",
- "!=",
- "all_equal",
- "any_nequal",
- "<<",
- ">>",
- "&",
- "^",
- "|",
- "&&",
- "^^",
- "||",
- "dot",
- "min",
- "max",
- "pow",
- "vector",
-};
-
-const char *ir_expression::operator_string(ir_expression_operation op)
-{
- assert((unsigned int) op < Elements(operator_strs));
- assert(Elements(operator_strs) == (ir_quadop_vector + 1));
- return operator_strs[op];
-}
-
-const char *ir_expression::operator_string()
-{
- return operator_string(this->operation);
-}
-
-const char*
-depth_layout_string(ir_depth_layout layout)
-{
- switch(layout) {
- case ir_depth_layout_none: return "";
- case ir_depth_layout_any: return "depth_any";
- case ir_depth_layout_greater: return "depth_greater";
- case ir_depth_layout_less: return "depth_less";
- case ir_depth_layout_unchanged: return "depth_unchanged";
-
- default:
- assert(0);
- return "";
- }
-}
-
-ir_expression_operation
-ir_expression::get_operator(const char *str)
-{
- const int operator_count = sizeof(operator_strs) / sizeof(operator_strs[0]);
- for (int op = 0; op < operator_count; op++) {
- if (strcmp(str, operator_strs[op]) == 0)
- return (ir_expression_operation) op;
- }
- return (ir_expression_operation) -1;
-}
-
-ir_constant::ir_constant()
-{
- this->ir_type = ir_type_constant;
-}
-
-ir_constant::ir_constant(const struct glsl_type *type,
- const ir_constant_data *data)
-{
- assert((type->base_type >= GLSL_TYPE_UINT)
- && (type->base_type <= GLSL_TYPE_BOOL));
-
- this->ir_type = ir_type_constant;
- this->type = type;
- memcpy(& this->value, data, sizeof(this->value));
-}
-
-ir_constant::ir_constant(float f)
-{
- this->ir_type = ir_type_constant;
- this->type = glsl_type::float_type;
- this->value.f[0] = f;
- for (int i = 1; i < 16; i++) {
- this->value.f[i] = 0;
- }
-}
-
-ir_constant::ir_constant(unsigned int u)
-{
- this->ir_type = ir_type_constant;
- this->type = glsl_type::uint_type;
- this->value.u[0] = u;
- for (int i = 1; i < 16; i++) {
- this->value.u[i] = 0;
- }
-}
-
-ir_constant::ir_constant(int i)
-{
- this->ir_type = ir_type_constant;
- this->type = glsl_type::int_type;
- this->value.i[0] = i;
- for (int i = 1; i < 16; i++) {
- this->value.i[i] = 0;
- }
-}
-
-ir_constant::ir_constant(bool b)
-{
- this->ir_type = ir_type_constant;
- this->type = glsl_type::bool_type;
- this->value.b[0] = b;
- for (int i = 1; i < 16; i++) {
- this->value.b[i] = false;
- }
-}
-
-ir_constant::ir_constant(const ir_constant *c, unsigned i)
-{
- this->ir_type = ir_type_constant;
- this->type = c->type->get_base_type();
-
- switch (this->type->base_type) {
- case GLSL_TYPE_UINT: this->value.u[0] = c->value.u[i]; break;
- case GLSL_TYPE_INT: this->value.i[0] = c->value.i[i]; break;
- case GLSL_TYPE_FLOAT: this->value.f[0] = c->value.f[i]; break;
- case GLSL_TYPE_BOOL: this->value.b[0] = c->value.b[i]; break;
- default: assert(!"Should not get here."); break;
- }
-}
-
-ir_constant::ir_constant(const struct glsl_type *type, exec_list *value_list)
-{
- this->ir_type = ir_type_constant;
- this->type = type;
-
- assert(type->is_scalar() || type->is_vector() || type->is_matrix()
- || type->is_record() || type->is_array());
-
- if (type->is_array()) {
- this->array_elements = ralloc_array(this, ir_constant *, type->length);
- unsigned i = 0;
- foreach_list(node, value_list) {
- ir_constant *value = (ir_constant *) node;
- assert(value->as_constant() != NULL);
-
- this->array_elements[i++] = value;
- }
- return;
- }
-
- /* If the constant is a record, the types of each of the entries in
- * value_list must be a 1-for-1 match with the structure components. Each
- * entry must also be a constant. Just move the nodes from the value_list
- * to the list in the ir_constant.
- */
- /* FINISHME: Should there be some type checking and / or assertions here? */
- /* FINISHME: Should the new constant take ownership of the nodes from
- * FINISHME: value_list, or should it make copies?
- */
- if (type->is_record()) {
- value_list->move_nodes_to(& this->components);
- return;
- }
-
- for (unsigned i = 0; i < 16; i++) {
- this->value.u[i] = 0;
- }
-
- ir_constant *value = (ir_constant *) (value_list->head);
-
- /* Constructors with exactly one scalar argument are special for vectors
- * and matrices. For vectors, the scalar value is replicated to fill all
- * the components. For matrices, the scalar fills the components of the
- * diagonal while the rest is filled with 0.
- */
- if (value->type->is_scalar() && value->next->is_tail_sentinel()) {
- if (type->is_matrix()) {
- /* Matrix - fill diagonal (rest is already set to 0) */
- assert(type->base_type == GLSL_TYPE_FLOAT);
- for (unsigned i = 0; i < type->matrix_columns; i++)
- this->value.f[i * type->vector_elements + i] = value->value.f[0];
- } else {
- /* Vector or scalar - fill all components */
- switch (type->base_type) {
- case GLSL_TYPE_UINT:
- case GLSL_TYPE_INT:
- for (unsigned i = 0; i < type->components(); i++)
- this->value.u[i] = value->value.u[0];
- break;
- case GLSL_TYPE_FLOAT:
- for (unsigned i = 0; i < type->components(); i++)
- this->value.f[i] = value->value.f[0];
- break;
- case GLSL_TYPE_BOOL:
- for (unsigned i = 0; i < type->components(); i++)
- this->value.b[i] = value->value.b[0];
- break;
- default:
- assert(!"Should not get here.");
- break;
- }
- }
- return;
- }
-
- if (type->is_matrix() && value->type->is_matrix()) {
- assert(value->next->is_tail_sentinel());
-
- /* From section 5.4.2 of the GLSL 1.20 spec:
- * "If a matrix is constructed from a matrix, then each component
- * (column i, row j) in the result that has a corresponding component
- * (column i, row j) in the argument will be initialized from there."
- */
- unsigned cols = MIN2(type->matrix_columns, value->type->matrix_columns);
- unsigned rows = MIN2(type->vector_elements, value->type->vector_elements);
- for (unsigned i = 0; i < cols; i++) {
- for (unsigned j = 0; j < rows; j++) {
- const unsigned src = i * value->type->vector_elements + j;
- const unsigned dst = i * type->vector_elements + j;
- this->value.f[dst] = value->value.f[src];
- }
- }
-
- /* "All other components will be initialized to the identity matrix." */
- for (unsigned i = cols; i < type->matrix_columns; i++)
- this->value.f[i * type->vector_elements + i] = 1.0;
-
- return;
- }
-
- /* Use each component from each entry in the value_list to initialize one
- * component of the constant being constructed.
- */
- for (unsigned i = 0; i < type->components(); /* empty */) {
- assert(value->as_constant() != NULL);
- assert(!value->is_tail_sentinel());
-
- for (unsigned j = 0; j < value->type->components(); j++) {
- switch (type->base_type) {
- case GLSL_TYPE_UINT:
- this->value.u[i] = value->get_uint_component(j);
- break;
- case GLSL_TYPE_INT:
- this->value.i[i] = value->get_int_component(j);
- break;
- case GLSL_TYPE_FLOAT:
- this->value.f[i] = value->get_float_component(j);
- break;
- case GLSL_TYPE_BOOL:
- this->value.b[i] = value->get_bool_component(j);
- break;
- default:
- /* FINISHME: What to do? Exceptions are not the answer.
- */
- break;
- }
-
- i++;
- if (i >= type->components())
- break;
- }
-
- value = (ir_constant *) value->next;
- }
-}
-
-ir_constant *
-ir_constant::zero(void *mem_ctx, const glsl_type *type)
-{
- assert(type->is_numeric() || type->is_boolean());
-
- ir_constant *c = new(mem_ctx) ir_constant;
- c->type = type;
- memset(&c->value, 0, sizeof(c->value));
-
- return c;
-}
-
-bool
-ir_constant::get_bool_component(unsigned i) const
-{
- switch (this->type->base_type) {
- case GLSL_TYPE_UINT: return this->value.u[i] != 0;
- case GLSL_TYPE_INT: return this->value.i[i] != 0;
- case GLSL_TYPE_FLOAT: return ((int)this->value.f[i]) != 0;
- case GLSL_TYPE_BOOL: return this->value.b[i];
- default: assert(!"Should not get here."); break;
- }
-
- /* Must return something to make the compiler happy. This is clearly an
- * error case.
- */
- return false;
-}
-
-float
-ir_constant::get_float_component(unsigned i) const
-{
- switch (this->type->base_type) {
- case GLSL_TYPE_UINT: return (float) this->value.u[i];
- case GLSL_TYPE_INT: return (float) this->value.i[i];
- case GLSL_TYPE_FLOAT: return this->value.f[i];
- case GLSL_TYPE_BOOL: return this->value.b[i] ? 1.0 : 0.0;
- default: assert(!"Should not get here."); break;
- }
-
- /* Must return something to make the compiler happy. This is clearly an
- * error case.
- */
- return 0.0;
-}
-
-int
-ir_constant::get_int_component(unsigned i) const
-{
- switch (this->type->base_type) {
- case GLSL_TYPE_UINT: return this->value.u[i];
- case GLSL_TYPE_INT: return this->value.i[i];
- case GLSL_TYPE_FLOAT: return (int) this->value.f[i];
- case GLSL_TYPE_BOOL: return this->value.b[i] ? 1 : 0;
- default: assert(!"Should not get here."); break;
- }
-
- /* Must return something to make the compiler happy. This is clearly an
- * error case.
- */
- return 0;
-}
-
-unsigned
-ir_constant::get_uint_component(unsigned i) const
-{
- switch (this->type->base_type) {
- case GLSL_TYPE_UINT: return this->value.u[i];
- case GLSL_TYPE_INT: return this->value.i[i];
- case GLSL_TYPE_FLOAT: return (unsigned) this->value.f[i];
- case GLSL_TYPE_BOOL: return this->value.b[i] ? 1 : 0;
- default: assert(!"Should not get here."); break;
- }
-
- /* Must return something to make the compiler happy. This is clearly an
- * error case.
- */
- return 0;
-}
-
-ir_constant *
-ir_constant::get_array_element(unsigned i) const
-{
- assert(this->type->is_array());
-
- /* From page 35 (page 41 of the PDF) of the GLSL 1.20 spec:
- *
- * "Behavior is undefined if a shader subscripts an array with an index
- * less than 0 or greater than or equal to the size the array was
- * declared with."
- *
- * Most out-of-bounds accesses are removed before things could get this far.
- * There are cases where non-constant array index values can get constant
- * folded.
- */
- if (int(i) < 0)
- i = 0;
- else if (i >= this->type->length)
- i = this->type->length - 1;
-
- return array_elements[i];
-}
-
-ir_constant *
-ir_constant::get_record_field(const char *name)
-{
- int idx = this->type->field_index(name);
-
- if (idx < 0)
- return NULL;
-
- if (this->components.is_empty())
- return NULL;
-
- exec_node *node = this->components.head;
- for (int i = 0; i < idx; i++) {
- node = node->next;
-
- /* If the end of the list is encountered before the element matching the
- * requested field is found, return NULL.
- */
- if (node->is_tail_sentinel())
- return NULL;
- }
-
- return (ir_constant *) node;
-}
-
-
-bool
-ir_constant::has_value(const ir_constant *c) const
-{
- if (this->type != c->type)
- return false;
-
- if (this->type->is_array()) {
- for (unsigned i = 0; i < this->type->length; i++) {
- if (!this->array_elements[i]->has_value(c->array_elements[i]))
- return false;
- }
- return true;
- }
-
- if (this->type->base_type == GLSL_TYPE_STRUCT) {
- const exec_node *a_node = this->components.head;
- const exec_node *b_node = c->components.head;
-
- while (!a_node->is_tail_sentinel()) {
- assert(!b_node->is_tail_sentinel());
-
- const ir_constant *const a_field = (ir_constant *) a_node;
- const ir_constant *const b_field = (ir_constant *) b_node;
-
- if (!a_field->has_value(b_field))
- return false;
-
- a_node = a_node->next;
- b_node = b_node->next;
- }
-
- return true;
- }
-
- for (unsigned i = 0; i < this->type->components(); i++) {
- switch (this->type->base_type) {
- case GLSL_TYPE_UINT:
- if (this->value.u[i] != c->value.u[i])
- return false;
- break;
- case GLSL_TYPE_INT:
- if (this->value.i[i] != c->value.i[i])
- return false;
- break;
- case GLSL_TYPE_FLOAT:
- if (this->value.f[i] != c->value.f[i])
- return false;
- break;
- case GLSL_TYPE_BOOL:
- if (this->value.b[i] != c->value.b[i])
- return false;
- break;
- default:
- assert(!"Should not get here.");
- return false;
- }
- }
-
- return true;
-}
-
-bool
-ir_constant::is_zero() const
-{
- if (!this->type->is_scalar() && !this->type->is_vector())
- return false;
-
- for (unsigned c = 0; c < this->type->vector_elements; c++) {
- switch (this->type->base_type) {
- case GLSL_TYPE_FLOAT:
- if (this->value.f[c] != 0.0)
- return false;
- break;
- case GLSL_TYPE_INT:
- if (this->value.i[c] != 0)
- return false;
- break;
- case GLSL_TYPE_UINT:
- if (this->value.u[c] != 0)
- return false;
- break;
- case GLSL_TYPE_BOOL:
- if (this->value.b[c] != false)
- return false;
- break;
- default:
- /* The only other base types are structures, arrays, and samplers.
- * Samplers cannot be constants, and the others should have been
- * filtered out above.
- */
- assert(!"Should not get here.");
- return false;
- }
- }
-
- return true;
-}
-
-bool
-ir_constant::is_one() const
-{
- if (!this->type->is_scalar() && !this->type->is_vector())
- return false;
-
- for (unsigned c = 0; c < this->type->vector_elements; c++) {
- switch (this->type->base_type) {
- case GLSL_TYPE_FLOAT:
- if (this->value.f[c] != 1.0)
- return false;
- break;
- case GLSL_TYPE_INT:
- if (this->value.i[c] != 1)
- return false;
- break;
- case GLSL_TYPE_UINT:
- if (this->value.u[c] != 1)
- return false;
- break;
- case GLSL_TYPE_BOOL:
- if (this->value.b[c] != true)
- return false;
- break;
- default:
- /* The only other base types are structures, arrays, and samplers.
- * Samplers cannot be constants, and the others should have been
- * filtered out above.
- */
- assert(!"Should not get here.");
- return false;
- }
- }
-
- return true;
-}
-
-bool
-ir_constant::is_negative_one() const
-{
- if (!this->type->is_scalar() && !this->type->is_vector())
- return false;
-
- if (this->type->is_boolean())
- return false;
-
- for (unsigned c = 0; c < this->type->vector_elements; c++) {
- switch (this->type->base_type) {
- case GLSL_TYPE_FLOAT:
- if (this->value.f[c] != -1.0)
- return false;
- break;
- case GLSL_TYPE_INT:
- if (this->value.i[c] != -1)
- return false;
- break;
- case GLSL_TYPE_UINT:
- if (int(this->value.u[c]) != -1)
- return false;
- break;
- default:
- /* The only other base types are structures, arrays, samplers, and
- * booleans. Samplers cannot be constants, and the others should
- * have been filtered out above.
- */
- assert(!"Should not get here.");
- return false;
- }
- }
-
- return true;
-}
-
-ir_loop::ir_loop()
-{
- this->ir_type = ir_type_loop;
- this->cmp = ir_unop_neg;
- this->from = NULL;
- this->to = NULL;
- this->increment = NULL;
- this->counter = NULL;
-}
-
-
-ir_dereference_variable::ir_dereference_variable(ir_variable *var)
-{
- this->ir_type = ir_type_dereference_variable;
- this->var = var;
- this->type = (var != NULL) ? var->type : glsl_type::error_type;
-}
-
-
-ir_dereference_array::ir_dereference_array(ir_rvalue *value,
- ir_rvalue *array_index)
-{
- this->ir_type = ir_type_dereference_array;
- this->array_index = array_index;
- this->set_array(value);
-}
-
-
-ir_dereference_array::ir_dereference_array(ir_variable *var,
- ir_rvalue *array_index)
-{
- void *ctx = ralloc_parent(var);
-
- this->ir_type = ir_type_dereference_array;
- this->array_index = array_index;
- this->set_array(new(ctx) ir_dereference_variable(var));
-}
-
-
-void
-ir_dereference_array::set_array(ir_rvalue *value)
-{
- this->array = value;
- this->type = glsl_type::error_type;
-
- if (this->array != NULL) {
- const glsl_type *const vt = this->array->type;
-
- if (vt->is_array()) {
- type = vt->element_type();
- } else if (vt->is_matrix()) {
- type = vt->column_type();
- } else if (vt->is_vector()) {
- type = vt->get_base_type();
- }
- }
-}
-
-
-ir_dereference_record::ir_dereference_record(ir_rvalue *value,
- const char *field)
-{
- this->ir_type = ir_type_dereference_record;
- this->record = value;
- this->field = ralloc_strdup(this, field);
- this->type = (this->record != NULL)
- ? this->record->type->field_type(field) : glsl_type::error_type;
-}
-
-
-ir_dereference_record::ir_dereference_record(ir_variable *var,
- const char *field)
-{
- void *ctx = ralloc_parent(var);
-
- this->ir_type = ir_type_dereference_record;
- this->record = new(ctx) ir_dereference_variable(var);
- this->field = ralloc_strdup(this, field);
- this->type = (this->record != NULL)
- ? this->record->type->field_type(field) : glsl_type::error_type;
-}
-
-bool type_contains_sampler(const glsl_type *type)
-{
- if (type->is_array()) {
- return type_contains_sampler(type->fields.array);
- } else if (type->is_record()) {
- for (unsigned int i = 0; i < type->length; i++) {
- if (type_contains_sampler(type->fields.structure[i].type))
- return true;
- }
- return false;
- } else {
- return type->is_sampler();
- }
-}
-
-bool
-ir_dereference::is_lvalue()
-{
- ir_variable *var = this->variable_referenced();
-
- /* Every l-value derference chain eventually ends in a variable.
- */
- if ((var == NULL) || var->read_only)
- return false;
-
- if (this->type->is_array() && !var->array_lvalue)
- return false;
-
- /* From page 17 (page 23 of the PDF) of the GLSL 1.20 spec:
- *
- * "Samplers cannot be treated as l-values; hence cannot be used
- * as out or inout function parameters, nor can they be
- * assigned into."
- */
- if (type_contains_sampler(this->type))
- return false;
-
- return true;
-}
-
-
-const char *tex_opcode_strs[] = { "tex", "txb", "txl", "txd", "txf" };
-
-const char *ir_texture::opcode_string()
-{
- assert((unsigned int) op <=
- sizeof(tex_opcode_strs) / sizeof(tex_opcode_strs[0]));
- return tex_opcode_strs[op];
-}
-
-ir_texture_opcode
-ir_texture::get_opcode(const char *str)
-{
- const int count = sizeof(tex_opcode_strs) / sizeof(tex_opcode_strs[0]);
- for (int op = 0; op < count; op++) {
- if (strcmp(str, tex_opcode_strs[op]) == 0)
- return (ir_texture_opcode) op;
- }
- return (ir_texture_opcode) -1;
-}
-
-
-void
-ir_texture::set_sampler(ir_dereference *sampler, const glsl_type *type)
-{
- assert(sampler != NULL);
- assert(type != NULL);
- this->sampler = sampler;
- this->type = type;
-
- assert(sampler->type->sampler_type == (int) type->base_type);
- if (sampler->type->sampler_shadow)
- assert(type->vector_elements == 4 || type->vector_elements == 1);
- else
- assert(type->vector_elements == 4);
-}
-
-
-void
-ir_swizzle::init_mask(const unsigned *comp, unsigned count)
-{
- assert((count >= 1) && (count <= 4));
-
- memset(&this->mask, 0, sizeof(this->mask));
- this->mask.num_components = count;
-
- unsigned dup_mask = 0;
- switch (count) {
- case 4:
- assert(comp[3] <= 3);
- dup_mask |= (1U << comp[3])
- & ((1U << comp[0]) | (1U << comp[1]) | (1U << comp[2]));
- this->mask.w = comp[3];
-
- case 3:
- assert(comp[2] <= 3);
- dup_mask |= (1U << comp[2])
- & ((1U << comp[0]) | (1U << comp[1]));
- this->mask.z = comp[2];
-
- case 2:
- assert(comp[1] <= 3);
- dup_mask |= (1U << comp[1])
- & ((1U << comp[0]));
- this->mask.y = comp[1];
-
- case 1:
- assert(comp[0] <= 3);
- this->mask.x = comp[0];
- }
-
- this->mask.has_duplicates = dup_mask != 0;
-
- /* Based on the number of elements in the swizzle and the base type
- * (i.e., float, int, unsigned, or bool) of the vector being swizzled,
- * generate the type of the resulting value.
- */
- type = glsl_type::get_instance(val->type->base_type, mask.num_components, 1);
-}
-
-ir_swizzle::ir_swizzle(ir_rvalue *val, unsigned x, unsigned y, unsigned z,
- unsigned w, unsigned count)
- : val(val)
-{
- const unsigned components[4] = { x, y, z, w };
- this->ir_type = ir_type_swizzle;
- this->init_mask(components, count);
-}
-
-ir_swizzle::ir_swizzle(ir_rvalue *val, const unsigned *comp,
- unsigned count)
- : val(val)
-{
- this->ir_type = ir_type_swizzle;
- this->init_mask(comp, count);
-}
-
-ir_swizzle::ir_swizzle(ir_rvalue *val, ir_swizzle_mask mask)
-{
- this->ir_type = ir_type_swizzle;
- this->val = val;
- this->mask = mask;
- this->type = glsl_type::get_instance(val->type->base_type,
- mask.num_components, 1);
-}
-
-#define X 1
-#define R 5
-#define S 9
-#define I 13
-
-ir_swizzle *
-ir_swizzle::create(ir_rvalue *val, const char *str, unsigned vector_length)
-{
- void *ctx = ralloc_parent(val);
-
- /* For each possible swizzle character, this table encodes the value in
- * \c idx_map that represents the 0th element of the vector. For invalid
- * swizzle characters (e.g., 'k'), a special value is used that will allow
- * detection of errors.
- */
- static const unsigned char base_idx[26] = {
- /* a b c d e f g h i j k l m */
- R, R, I, I, I, I, R, I, I, I, I, I, I,
- /* n o p q r s t u v w x y z */
- I, I, S, S, R, S, S, I, I, X, X, X, X
- };
-
- /* Each valid swizzle character has an entry in the previous table. This
- * table encodes the base index encoded in the previous table plus the actual
- * index of the swizzle character. When processing swizzles, the first
- * character in the string is indexed in the previous table. Each character
- * in the string is indexed in this table, and the value found there has the
- * value form the first table subtracted. The result must be on the range
- * [0,3].
- *
- * For example, the string "wzyx" will get X from the first table. Each of
- * the charcaters will get X+3, X+2, X+1, and X+0 from this table. After
- * subtraction, the swizzle values are { 3, 2, 1, 0 }.
- *
- * The string "wzrg" will get X from the first table. Each of the characters
- * will get X+3, X+2, R+0, and R+1 from this table. After subtraction, the
- * swizzle values are { 3, 2, 4, 5 }. Since 4 and 5 are outside the range
- * [0,3], the error is detected.
- */
- static const unsigned char idx_map[26] = {
- /* a b c d e f g h i j k l m */
- R+3, R+2, 0, 0, 0, 0, R+1, 0, 0, 0, 0, 0, 0,
- /* n o p q r s t u v w x y z */
- 0, 0, S+2, S+3, R+0, S+0, S+1, 0, 0, X+3, X+0, X+1, X+2
- };
-
- int swiz_idx[4] = { 0, 0, 0, 0 };
- unsigned i;
-
-
- /* Validate the first character in the swizzle string and look up the base
- * index value as described above.
- */
- if ((str[0] < 'a') || (str[0] > 'z'))
- return NULL;
-
- const unsigned base = base_idx[str[0] - 'a'];
-
-
- for (i = 0; (i < 4) && (str[i] != '\0'); i++) {
- /* Validate the next character, and, as described above, convert it to a
- * swizzle index.
- */
- if ((str[i] < 'a') || (str[i] > 'z'))
- return NULL;
-
- swiz_idx[i] = idx_map[str[i] - 'a'] - base;
- if ((swiz_idx[i] < 0) || (swiz_idx[i] >= (int) vector_length))
- return NULL;
- }
-
- if (str[i] != '\0')
- return NULL;
-
- return new(ctx) ir_swizzle(val, swiz_idx[0], swiz_idx[1], swiz_idx[2],
- swiz_idx[3], i);
-}
-
-#undef X
-#undef R
-#undef S
-#undef I
-
-ir_variable *
-ir_swizzle::variable_referenced()
-{
- return this->val->variable_referenced();
-}
-
-
-ir_variable::ir_variable(const struct glsl_type *type, const char *name,
- ir_variable_mode mode)
- : max_array_access(0), read_only(false), centroid(false), invariant(false),
- mode(mode), interpolation(ir_var_smooth), array_lvalue(false)
-{
- this->ir_type = ir_type_variable;
- this->type = type;
- this->name = ralloc_strdup(this, name);
- this->explicit_location = false;
- this->location = -1;
- this->warn_extension = NULL;
- this->constant_value = NULL;
- this->origin_upper_left = false;
- this->pixel_center_integer = false;
- this->depth_layout = ir_depth_layout_none;
- this->used = false;
-
- if (type && type->base_type == GLSL_TYPE_SAMPLER)
- this->read_only = true;
-}
-
-
-const char *
-ir_variable::interpolation_string() const
-{
- switch (this->interpolation) {
- case ir_var_smooth: return "smooth";
- case ir_var_flat: return "flat";
- case ir_var_noperspective: return "noperspective";
- }
-
- assert(!"Should not get here.");
- return "";
-}
-
-
-unsigned
-ir_variable::component_slots() const
-{
- /* FINISHME: Sparsely accessed arrays require fewer slots. */
- return this->type->component_slots();
-}
-
-
-ir_function_signature::ir_function_signature(const glsl_type *return_type)
- : return_type(return_type), is_defined(false), _function(NULL)
-{
- this->ir_type = ir_type_function_signature;
- this->is_builtin = false;
-}
-
-
-static bool
-modes_match(unsigned a, unsigned b)
-{
- if (a == b)
- return true;
-
- /* Accept "in" vs. "const in" */
- if ((a == ir_var_const_in && b == ir_var_in) ||
- (b == ir_var_const_in && a == ir_var_in))
- return true;
-
- return false;
-}
-
-
-const char *
-ir_function_signature::qualifiers_match(exec_list *params)
-{
- exec_list_iterator iter_a = parameters.iterator();
- exec_list_iterator iter_b = params->iterator();
-
- /* check that the qualifiers match. */
- while (iter_a.has_next()) {
- ir_variable *a = (ir_variable *)iter_a.get();
- ir_variable *b = (ir_variable *)iter_b.get();
-
- if (a->read_only != b->read_only ||
- !modes_match(a->mode, b->mode) ||
- a->interpolation != b->interpolation ||
- a->centroid != b->centroid) {
-
- /* parameter a's qualifiers don't match */
- return a->name;
- }
-
- iter_a.next();
- iter_b.next();
- }
- return NULL;
-}
-
-
-void
-ir_function_signature::replace_parameters(exec_list *new_params)
-{
- /* Destroy all of the previous parameter information. If the previous
- * parameter information comes from the function prototype, it may either
- * specify incorrect parameter names or not have names at all.
- */
- foreach_iter(exec_list_iterator, iter, parameters) {
- assert(((ir_instruction *) iter.get())->as_variable() != NULL);
-
- iter.remove();
- }
-
- new_params->move_nodes_to(&parameters);
-}
-
-
-ir_function::ir_function(const char *name)
-{
- this->ir_type = ir_type_function;
- this->name = ralloc_strdup(this, name);
-}
-
-
-bool
-ir_function::has_user_signature()
-{
- foreach_list(n, &this->signatures) {
- ir_function_signature *const sig = (ir_function_signature *) n;
- if (!sig->is_builtin)
- return true;
- }
- return false;
-}
-
-
-ir_call *
-ir_call::get_error_instruction(void *ctx)
-{
- ir_call *call = new(ctx) ir_call;
-
- call->type = glsl_type::error_type;
- return call;
-}
-
-void
-ir_call::set_callee(ir_function_signature *sig)
-{
- assert((this->type == NULL) || (this->type == sig->return_type));
-
- this->callee = sig;
-}
-
-void
-visit_exec_list(exec_list *list, ir_visitor *visitor)
-{
- foreach_iter(exec_list_iterator, iter, *list) {
- ((ir_instruction *)iter.get())->accept(visitor);
- }
-}
-
-
-static void
-steal_memory(ir_instruction *ir, void *new_ctx)
-{
- ir_variable *var = ir->as_variable();
- ir_constant *constant = ir->as_constant();
- if (var != NULL && var->constant_value != NULL)
- steal_memory(var->constant_value, ir);
-
- /* The components of aggregate constants are not visited by the normal
- * visitor, so steal their values by hand.
- */
- if (constant != NULL) {
- if (constant->type->is_record()) {
- foreach_iter(exec_list_iterator, iter, constant->components) {
- ir_constant *field = (ir_constant *)iter.get();
- steal_memory(field, ir);
- }
- } else if (constant->type->is_array()) {
- for (unsigned int i = 0; i < constant->type->length; i++) {
- steal_memory(constant->array_elements[i], ir);
- }
- }
- }
-
- ralloc_steal(new_ctx, ir);
-}
-
-
-void
-reparent_ir(exec_list *list, void *mem_ctx)
-{
- foreach_list(node, list) {
- visit_tree((ir_instruction *) node, steal_memory, mem_ctx);
- }
-}
-
-
-static ir_rvalue *
-try_min_one(ir_rvalue *ir)
-{
- ir_expression *expr = ir->as_expression();
-
- if (!expr || expr->operation != ir_binop_min)
- return NULL;
-
- if (expr->operands[0]->is_one())
- return expr->operands[1];
-
- if (expr->operands[1]->is_one())
- return expr->operands[0];
-
- return NULL;
-}
-
-static ir_rvalue *
-try_max_zero(ir_rvalue *ir)
-{
- ir_expression *expr = ir->as_expression();
-
- if (!expr || expr->operation != ir_binop_max)
- return NULL;
-
- if (expr->operands[0]->is_zero())
- return expr->operands[1];
-
- if (expr->operands[1]->is_zero())
- return expr->operands[0];
-
- return NULL;
-}
-
-ir_rvalue *
-ir_rvalue::as_rvalue_to_saturate()
-{
- ir_expression *expr = this->as_expression();
-
- if (!expr)
- return NULL;
-
- ir_rvalue *max_zero = try_max_zero(expr);
- if (max_zero) {
- return try_min_one(max_zero);
- } else {
- ir_rvalue *min_one = try_min_one(expr);
- if (min_one) {
- return try_max_zero(min_one);
- }
- }
-
- return NULL;
-}
+/*
+ * Copyright © 2010 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+#include <string.h>
+#include "main/core.h" /* for MAX2 */
+#include "ir.h"
+#include "ir_visitor.h"
+#include "glsl_types.h"
+
+ir_rvalue::ir_rvalue()
+{
+ this->type = glsl_type::error_type;
+}
+
+bool ir_rvalue::is_zero() const
+{
+ return false;
+}
+
+bool ir_rvalue::is_one() const
+{
+ return false;
+}
+
+bool ir_rvalue::is_negative_one() const
+{
+ return false;
+}
+
+/**
+ * Modify the swizzle make to move one component to another
+ *
+ * \param m IR swizzle to be modified
+ * \param from Component in the RHS that is to be swizzled
+ * \param to Desired swizzle location of \c from
+ */
+static void
+update_rhs_swizzle(ir_swizzle_mask &m, unsigned from, unsigned to)
+{
+ switch (to) {
+ case 0: m.x = from; break;
+ case 1: m.y = from; break;
+ case 2: m.z = from; break;
+ case 3: m.w = from; break;
+ default: assert(!"Should not get here.");
+ }
+
+ m.num_components = MAX2(m.num_components, (to + 1));
+}
+
+void
+ir_assignment::set_lhs(ir_rvalue *lhs)
+{
+ void *mem_ctx = this;
+ bool swizzled = false;
+
+ while (lhs != NULL) {
+ ir_swizzle *swiz = lhs->as_swizzle();
+
+ if (swiz == NULL)
+ break;
+
+ unsigned write_mask = 0;
+ ir_swizzle_mask rhs_swiz = { 0, 0, 0, 0, 0, 0 };
+
+ for (unsigned i = 0; i < swiz->mask.num_components; i++) {
+ unsigned c = 0;
+
+ switch (i) {
+ case 0: c = swiz->mask.x; break;
+ case 1: c = swiz->mask.y; break;
+ case 2: c = swiz->mask.z; break;
+ case 3: c = swiz->mask.w; break;
+ default: assert(!"Should not get here.");
+ }
+
+ write_mask |= (((this->write_mask >> i) & 1) << c);
+ update_rhs_swizzle(rhs_swiz, i, c);
+ }
+
+ this->write_mask = write_mask;
+ lhs = swiz->val;
+
+ this->rhs = new(mem_ctx) ir_swizzle(this->rhs, rhs_swiz);
+ swizzled = true;
+ }
+
+ if (swizzled) {
+ /* Now, RHS channels line up with the LHS writemask. Collapse it
+ * to just the channels that will be written.
+ */
+ ir_swizzle_mask rhs_swiz = { 0, 0, 0, 0, 0, 0 };
+ int rhs_chan = 0;
+ for (int i = 0; i < 4; i++) {
+ if (write_mask & (1 << i))
+ update_rhs_swizzle(rhs_swiz, i, rhs_chan++);
+ }
+ this->rhs = new(mem_ctx) ir_swizzle(this->rhs, rhs_swiz);
+ }
+
+ assert((lhs == NULL) || lhs->as_dereference());
+
+ this->lhs = (ir_dereference *) lhs;
+}
+
+ir_variable *
+ir_assignment::whole_variable_written()
+{
+ ir_variable *v = this->lhs->whole_variable_referenced();
+
+ if (v == NULL)
+ return NULL;
+
+ if (v->type->is_scalar())
+ return v;
+
+ if (v->type->is_vector()) {
+ const unsigned mask = (1U << v->type->vector_elements) - 1;
+
+ if (mask != this->write_mask)
+ return NULL;
+ }
+
+ /* Either all the vector components are assigned or the variable is some
+ * composite type (and the whole thing is assigned.
+ */
+ return v;
+}
+
+ir_assignment::ir_assignment(ir_dereference *lhs, ir_rvalue *rhs,
+ ir_rvalue *condition, unsigned write_mask)
+{
+ this->ir_type = ir_type_assignment;
+ this->condition = condition;
+ this->rhs = rhs;
+ this->lhs = lhs;
+ this->write_mask = write_mask;
+
+ if (lhs->type->is_scalar() || lhs->type->is_vector()) {
+ int lhs_components = 0;
+ for (int i = 0; i < 4; i++) {
+ if (write_mask & (1 << i))
+ lhs_components++;
+ }
+
+ assert(lhs_components == this->rhs->type->vector_elements);
+ }
+}
+
+ir_assignment::ir_assignment(ir_rvalue *lhs, ir_rvalue *rhs,
+ ir_rvalue *condition)
+{
+ this->ir_type = ir_type_assignment;
+ this->condition = condition;
+ this->rhs = rhs;
+
+ /* If the RHS is a vector type, assume that all components of the vector
+ * type are being written to the LHS. The write mask comes from the RHS
+ * because we can have a case where the LHS is a vec4 and the RHS is a
+ * vec3. In that case, the assignment is:
+ *
+ * (assign (...) (xyz) (var_ref lhs) (var_ref rhs))
+ */
+ if (rhs->type->is_vector())
+ this->write_mask = (1U << rhs->type->vector_elements) - 1;
+ else if (rhs->type->is_scalar())
+ this->write_mask = 1;
+ else
+ this->write_mask = 0;
+
+ this->set_lhs(lhs);
+}
+
+
+ir_expression::ir_expression(int op, const struct glsl_type *type,
+ ir_rvalue *op0)
+{
+ assert(get_num_operands(ir_expression_operation(op)) == 1);
+ this->ir_type = ir_type_expression;
+ this->type = type;
+ this->operation = ir_expression_operation(op);
+ this->operands[0] = op0;
+ this->operands[1] = NULL;
+ this->operands[2] = NULL;
+ this->operands[3] = NULL;
+}
+
+ir_expression::ir_expression(int op, const struct glsl_type *type,
+ ir_rvalue *op0, ir_rvalue *op1)
+{
+ assert(((op1 == NULL) && (get_num_operands(ir_expression_operation(op)) == 1))
+ || (get_num_operands(ir_expression_operation(op)) == 2));
+ this->ir_type = ir_type_expression;
+ this->type = type;
+ this->operation = ir_expression_operation(op);
+ this->operands[0] = op0;
+ this->operands[1] = op1;
+ this->operands[2] = NULL;
+ this->operands[3] = NULL;
+}
+
+ir_expression::ir_expression(int op, const struct glsl_type *type,
+ ir_rvalue *op0, ir_rvalue *op1,
+ ir_rvalue *op2, ir_rvalue *op3)
+{
+ this->ir_type = ir_type_expression;
+ this->type = type;
+ this->operation = ir_expression_operation(op);
+ this->operands[0] = op0;
+ this->operands[1] = op1;
+ this->operands[2] = op2;
+ this->operands[3] = op3;
+}
+
+ir_expression::ir_expression(int op, ir_rvalue *op0)
+{
+ this->ir_type = ir_type_expression;
+
+ this->operation = ir_expression_operation(op);
+ this->operands[0] = op0;
+ this->operands[1] = NULL;
+ this->operands[2] = NULL;
+ this->operands[3] = NULL;
+
+ assert(op <= ir_last_unop);
+
+ switch (this->operation) {
+ case ir_unop_bit_not:
+ case ir_unop_logic_not:
+ case ir_unop_neg:
+ case ir_unop_abs:
+ case ir_unop_sign:
+ case ir_unop_rcp:
+ case ir_unop_rsq:
+ case ir_unop_sqrt:
+ case ir_unop_exp:
+ case ir_unop_log:
+ case ir_unop_exp2:
+ case ir_unop_log2:
+ case ir_unop_trunc:
+ case ir_unop_ceil:
+ case ir_unop_floor:
+ case ir_unop_fract:
+ case ir_unop_round_even:
+ case ir_unop_sin:
+ case ir_unop_cos:
+ case ir_unop_sin_reduced:
+ case ir_unop_cos_reduced:
+ case ir_unop_dFdx:
+ case ir_unop_dFdy:
+ this->type = op0->type;
+ break;
+
+ case ir_unop_f2i:
+ case ir_unop_b2i:
+ this->type = glsl_type::get_instance(GLSL_TYPE_INT,
+ op0->type->vector_elements, 1);
+ break;
+
+ case ir_unop_b2f:
+ case ir_unop_i2f:
+ case ir_unop_u2f:
+ this->type = glsl_type::get_instance(GLSL_TYPE_FLOAT,
+ op0->type->vector_elements, 1);
+ break;
+
+ case ir_unop_f2b:
+ case ir_unop_i2b:
+ this->type = glsl_type::get_instance(GLSL_TYPE_BOOL,
+ op0->type->vector_elements, 1);
+ break;
+
+ case ir_unop_noise:
+ this->type = glsl_type::float_type;
+ break;
+
+ case ir_unop_any:
+ this->type = glsl_type::bool_type;
+ break;
+
+ default:
+ assert(!"not reached: missing automatic type setup for ir_expression");
+ this->type = op0->type;
+ break;
+ }
+}
+
+ir_expression::ir_expression(int op, ir_rvalue *op0, ir_rvalue *op1)
+{
+ this->ir_type = ir_type_expression;
+
+ this->operation = ir_expression_operation(op);
+ this->operands[0] = op0;
+ this->operands[1] = op1;
+ this->operands[2] = NULL;
+ this->operands[3] = NULL;
+
+ assert(op > ir_last_unop);
+
+ switch (this->operation) {
+ case ir_binop_all_equal:
+ case ir_binop_any_nequal:
+ this->type = glsl_type::bool_type;
+ break;
+
+ case ir_binop_add:
+ case ir_binop_sub:
+ case ir_binop_min:
+ case ir_binop_max:
+ case ir_binop_pow:
+ case ir_binop_mul:
+ case ir_binop_div:
+ case ir_binop_mod:
+ if (op0->type->is_scalar()) {
+ this->type = op1->type;
+ } else if (op1->type->is_scalar()) {
+ this->type = op0->type;
+ } else {
+ /* FINISHME: matrix types */
+ assert(!op0->type->is_matrix() && !op1->type->is_matrix());
+ assert(op0->type == op1->type);
+ this->type = op0->type;
+ }
+ break;
+
+ case ir_binop_logic_and:
+ case ir_binop_logic_xor:
+ case ir_binop_logic_or:
+ case ir_binop_bit_and:
+ case ir_binop_bit_xor:
+ case ir_binop_bit_or:
+ if (op0->type->is_scalar()) {
+ this->type = op1->type;
+ } else if (op1->type->is_scalar()) {
+ this->type = op0->type;
+ }
+ break;
+
+ case ir_binop_equal:
+ case ir_binop_nequal:
+ case ir_binop_lequal:
+ case ir_binop_gequal:
+ case ir_binop_less:
+ case ir_binop_greater:
+ assert(op0->type == op1->type);
+ this->type = glsl_type::get_instance(GLSL_TYPE_BOOL,
+ op0->type->vector_elements, 1);
+ break;
+
+ case ir_binop_dot:
+ this->type = glsl_type::float_type;
+ break;
+
+ case ir_binop_lshift:
+ case ir_binop_rshift:
+ this->type = op0->type;
+ break;
+
+ default:
+ assert(!"not reached: missing automatic type setup for ir_expression");
+ this->type = glsl_type::float_type;
+ }
+}
+
+unsigned int
+ir_expression::get_num_operands(ir_expression_operation op)
+{
+ assert(op <= ir_last_opcode);
+
+ if (op <= ir_last_unop)
+ return 1;
+
+ if (op <= ir_last_binop)
+ return 2;
+
+ if (op == ir_quadop_vector)
+ return 4;
+
+ assert(false);
+ return 0;
+}
+
+static const char *const operator_strs[] = {
+ "~",
+ "!",
+ "neg",
+ "abs",
+ "sign",
+ "rcp",
+ "rsq",
+ "sqrt",
+ "exp",
+ "log",
+ "exp2",
+ "log2",
+ "f2i",
+ "i2f",
+ "f2b",
+ "b2f",
+ "i2b",
+ "b2i",
+ "u2f",
+ "any",
+ "trunc",
+ "ceil",
+ "floor",
+ "fract",
+ "round_even",
+ "sin",
+ "cos",
+ "sin_reduced",
+ "cos_reduced",
+ "dFdx",
+ "dFdy",
+ "noise",
+ "+",
+ "-",
+ "*",
+ "/",
+ "%",
+ "<",
+ ">",
+ "<=",
+ ">=",
+ "==",
+ "!=",
+ "all_equal",
+ "any_nequal",
+ "<<",
+ ">>",
+ "&",
+ "^",
+ "|",
+ "&&",
+ "^^",
+ "||",
+ "dot",
+ "min",
+ "max",
+ "pow",
+ "vector",
+};
+
+const char *ir_expression::operator_string(ir_expression_operation op)
+{
+ assert((unsigned int) op < Elements(operator_strs));
+ assert(Elements(operator_strs) == (ir_quadop_vector + 1));
+ return operator_strs[op];
+}
+
+const char *ir_expression::operator_string()
+{
+ return operator_string(this->operation);
+}
+
+const char*
+depth_layout_string(ir_depth_layout layout)
+{
+ switch(layout) {
+ case ir_depth_layout_none: return "";
+ case ir_depth_layout_any: return "depth_any";
+ case ir_depth_layout_greater: return "depth_greater";
+ case ir_depth_layout_less: return "depth_less";
+ case ir_depth_layout_unchanged: return "depth_unchanged";
+
+ default:
+ assert(0);
+ return "";
+ }
+}
+
+ir_expression_operation
+ir_expression::get_operator(const char *str)
+{
+ const int operator_count = sizeof(operator_strs) / sizeof(operator_strs[0]);
+ for (int op = 0; op < operator_count; op++) {
+ if (strcmp(str, operator_strs[op]) == 0)
+ return (ir_expression_operation) op;
+ }
+ return (ir_expression_operation) -1;
+}
+
+ir_constant::ir_constant()
+{
+ this->ir_type = ir_type_constant;
+}
+
+ir_constant::ir_constant(const struct glsl_type *type,
+ const ir_constant_data *data)
+{
+ assert((type->base_type >= GLSL_TYPE_UINT)
+ && (type->base_type <= GLSL_TYPE_BOOL));
+
+ this->ir_type = ir_type_constant;
+ this->type = type;
+ memcpy(& this->value, data, sizeof(this->value));
+}
+
+ir_constant::ir_constant(float f)
+{
+ this->ir_type = ir_type_constant;
+ this->type = glsl_type::float_type;
+ this->value.f[0] = f;
+ for (int i = 1; i < 16; i++) {
+ this->value.f[i] = 0;
+ }
+}
+
+ir_constant::ir_constant(unsigned int u)
+{
+ this->ir_type = ir_type_constant;
+ this->type = glsl_type::uint_type;
+ this->value.u[0] = u;
+ for (int i = 1; i < 16; i++) {
+ this->value.u[i] = 0;
+ }
+}
+
+ir_constant::ir_constant(int i)
+{
+ this->ir_type = ir_type_constant;
+ this->type = glsl_type::int_type;
+ this->value.i[0] = i;
+ for (int i = 1; i < 16; i++) {
+ this->value.i[i] = 0;
+ }
+}
+
+ir_constant::ir_constant(bool b)
+{
+ this->ir_type = ir_type_constant;
+ this->type = glsl_type::bool_type;
+ this->value.b[0] = b;
+ for (int i = 1; i < 16; i++) {
+ this->value.b[i] = false;
+ }
+}
+
+ir_constant::ir_constant(const ir_constant *c, unsigned i)
+{
+ this->ir_type = ir_type_constant;
+ this->type = c->type->get_base_type();
+
+ switch (this->type->base_type) {
+ case GLSL_TYPE_UINT: this->value.u[0] = c->value.u[i]; break;
+ case GLSL_TYPE_INT: this->value.i[0] = c->value.i[i]; break;
+ case GLSL_TYPE_FLOAT: this->value.f[0] = c->value.f[i]; break;
+ case GLSL_TYPE_BOOL: this->value.b[0] = c->value.b[i]; break;
+ default: assert(!"Should not get here."); break;
+ }
+}
+
+ir_constant::ir_constant(const struct glsl_type *type, exec_list *value_list)
+{
+ this->ir_type = ir_type_constant;
+ this->type = type;
+
+ assert(type->is_scalar() || type->is_vector() || type->is_matrix()
+ || type->is_record() || type->is_array());
+
+ if (type->is_array()) {
+ this->array_elements = ralloc_array(this, ir_constant *, type->length);
+ unsigned i = 0;
+ foreach_list(node, value_list) {
+ ir_constant *value = (ir_constant *) node;
+ assert(value->as_constant() != NULL);
+
+ this->array_elements[i++] = value;
+ }
+ return;
+ }
+
+ /* If the constant is a record, the types of each of the entries in
+ * value_list must be a 1-for-1 match with the structure components. Each
+ * entry must also be a constant. Just move the nodes from the value_list
+ * to the list in the ir_constant.
+ */
+ /* FINISHME: Should there be some type checking and / or assertions here? */
+ /* FINISHME: Should the new constant take ownership of the nodes from
+ * FINISHME: value_list, or should it make copies?
+ */
+ if (type->is_record()) {
+ value_list->move_nodes_to(& this->components);
+ return;
+ }
+
+ for (unsigned i = 0; i < 16; i++) {
+ this->value.u[i] = 0;
+ }
+
+ ir_constant *value = (ir_constant *) (value_list->head);
+
+ /* Constructors with exactly one scalar argument are special for vectors
+ * and matrices. For vectors, the scalar value is replicated to fill all
+ * the components. For matrices, the scalar fills the components of the
+ * diagonal while the rest is filled with 0.
+ */
+ if (value->type->is_scalar() && value->next->is_tail_sentinel()) {
+ if (type->is_matrix()) {
+ /* Matrix - fill diagonal (rest is already set to 0) */
+ assert(type->base_type == GLSL_TYPE_FLOAT);
+ for (unsigned i = 0; i < type->matrix_columns; i++)
+ this->value.f[i * type->vector_elements + i] = value->value.f[0];
+ } else {
+ /* Vector or scalar - fill all components */
+ switch (type->base_type) {
+ case GLSL_TYPE_UINT:
+ case GLSL_TYPE_INT:
+ for (unsigned i = 0; i < type->components(); i++)
+ this->value.u[i] = value->value.u[0];
+ break;
+ case GLSL_TYPE_FLOAT:
+ for (unsigned i = 0; i < type->components(); i++)
+ this->value.f[i] = value->value.f[0];
+ break;
+ case GLSL_TYPE_BOOL:
+ for (unsigned i = 0; i < type->components(); i++)
+ this->value.b[i] = value->value.b[0];
+ break;
+ default:
+ assert(!"Should not get here.");
+ break;
+ }
+ }
+ return;
+ }
+
+ if (type->is_matrix() && value->type->is_matrix()) {
+ assert(value->next->is_tail_sentinel());
+
+ /* From section 5.4.2 of the GLSL 1.20 spec:
+ * "If a matrix is constructed from a matrix, then each component
+ * (column i, row j) in the result that has a corresponding component
+ * (column i, row j) in the argument will be initialized from there."
+ */
+ unsigned cols = MIN2(type->matrix_columns, value->type->matrix_columns);
+ unsigned rows = MIN2(type->vector_elements, value->type->vector_elements);
+ for (unsigned i = 0; i < cols; i++) {
+ for (unsigned j = 0; j < rows; j++) {
+ const unsigned src = i * value->type->vector_elements + j;
+ const unsigned dst = i * type->vector_elements + j;
+ this->value.f[dst] = value->value.f[src];
+ }
+ }
+
+ /* "All other components will be initialized to the identity matrix." */
+ for (unsigned i = cols; i < type->matrix_columns; i++)
+ this->value.f[i * type->vector_elements + i] = 1.0;
+
+ return;
+ }
+
+ /* Use each component from each entry in the value_list to initialize one
+ * component of the constant being constructed.
+ */
+ for (unsigned i = 0; i < type->components(); /* empty */) {
+ assert(value->as_constant() != NULL);
+ assert(!value->is_tail_sentinel());
+
+ for (unsigned j = 0; j < value->type->components(); j++) {
+ switch (type->base_type) {
+ case GLSL_TYPE_UINT:
+ this->value.u[i] = value->get_uint_component(j);
+ break;
+ case GLSL_TYPE_INT:
+ this->value.i[i] = value->get_int_component(j);
+ break;
+ case GLSL_TYPE_FLOAT:
+ this->value.f[i] = value->get_float_component(j);
+ break;
+ case GLSL_TYPE_BOOL:
+ this->value.b[i] = value->get_bool_component(j);
+ break;
+ default:
+ /* FINISHME: What to do? Exceptions are not the answer.
+ */
+ break;
+ }
+
+ i++;
+ if (i >= type->components())
+ break;
+ }
+
+ value = (ir_constant *) value->next;
+ }
+}
+
+ir_constant *
+ir_constant::zero(void *mem_ctx, const glsl_type *type)
+{
+ assert(type->is_numeric() || type->is_boolean());
+
+ ir_constant *c = new(mem_ctx) ir_constant;
+ c->type = type;
+ memset(&c->value, 0, sizeof(c->value));
+
+ return c;
+}
+
+bool
+ir_constant::get_bool_component(unsigned i) const
+{
+ switch (this->type->base_type) {
+ case GLSL_TYPE_UINT: return this->value.u[i] != 0;
+ case GLSL_TYPE_INT: return this->value.i[i] != 0;
+ case GLSL_TYPE_FLOAT: return ((int)this->value.f[i]) != 0;
+ case GLSL_TYPE_BOOL: return this->value.b[i];
+ default: assert(!"Should not get here."); break;
+ }
+
+ /* Must return something to make the compiler happy. This is clearly an
+ * error case.
+ */
+ return false;
+}
+
+float
+ir_constant::get_float_component(unsigned i) const
+{
+ switch (this->type->base_type) {
+ case GLSL_TYPE_UINT: return (float) this->value.u[i];
+ case GLSL_TYPE_INT: return (float) this->value.i[i];
+ case GLSL_TYPE_FLOAT: return this->value.f[i];
+ case GLSL_TYPE_BOOL: return this->value.b[i] ? 1.0 : 0.0;
+ default: assert(!"Should not get here."); break;
+ }
+
+ /* Must return something to make the compiler happy. This is clearly an
+ * error case.
+ */
+ return 0.0;
+}
+
+int
+ir_constant::get_int_component(unsigned i) const
+{
+ switch (this->type->base_type) {
+ case GLSL_TYPE_UINT: return this->value.u[i];
+ case GLSL_TYPE_INT: return this->value.i[i];
+ case GLSL_TYPE_FLOAT: return (int) this->value.f[i];
+ case GLSL_TYPE_BOOL: return this->value.b[i] ? 1 : 0;
+ default: assert(!"Should not get here."); break;
+ }
+
+ /* Must return something to make the compiler happy. This is clearly an
+ * error case.
+ */
+ return 0;
+}
+
+unsigned
+ir_constant::get_uint_component(unsigned i) const
+{
+ switch (this->type->base_type) {
+ case GLSL_TYPE_UINT: return this->value.u[i];
+ case GLSL_TYPE_INT: return this->value.i[i];
+ case GLSL_TYPE_FLOAT: return (unsigned) this->value.f[i];
+ case GLSL_TYPE_BOOL: return this->value.b[i] ? 1 : 0;
+ default: assert(!"Should not get here."); break;
+ }
+
+ /* Must return something to make the compiler happy. This is clearly an
+ * error case.
+ */
+ return 0;
+}
+
+ir_constant *
+ir_constant::get_array_element(unsigned i) const
+{
+ assert(this->type->is_array());
+
+ /* From page 35 (page 41 of the PDF) of the GLSL 1.20 spec:
+ *
+ * "Behavior is undefined if a shader subscripts an array with an index
+ * less than 0 or greater than or equal to the size the array was
+ * declared with."
+ *
+ * Most out-of-bounds accesses are removed before things could get this far.
+ * There are cases where non-constant array index values can get constant
+ * folded.
+ */
+ if (int(i) < 0)
+ i = 0;
+ else if (i >= this->type->length)
+ i = this->type->length - 1;
+
+ return array_elements[i];
+}
+
+ir_constant *
+ir_constant::get_record_field(const char *name)
+{
+ int idx = this->type->field_index(name);
+
+ if (idx < 0)
+ return NULL;
+
+ if (this->components.is_empty())
+ return NULL;
+
+ exec_node *node = this->components.head;
+ for (int i = 0; i < idx; i++) {
+ node = node->next;
+
+ /* If the end of the list is encountered before the element matching the
+ * requested field is found, return NULL.
+ */
+ if (node->is_tail_sentinel())
+ return NULL;
+ }
+
+ return (ir_constant *) node;
+}
+
+
+bool
+ir_constant::has_value(const ir_constant *c) const
+{
+ if (this->type != c->type)
+ return false;
+
+ if (this->type->is_array()) {
+ for (unsigned i = 0; i < this->type->length; i++) {
+ if (!this->array_elements[i]->has_value(c->array_elements[i]))
+ return false;
+ }
+ return true;
+ }
+
+ if (this->type->base_type == GLSL_TYPE_STRUCT) {
+ const exec_node *a_node = this->components.head;
+ const exec_node *b_node = c->components.head;
+
+ while (!a_node->is_tail_sentinel()) {
+ assert(!b_node->is_tail_sentinel());
+
+ const ir_constant *const a_field = (ir_constant *) a_node;
+ const ir_constant *const b_field = (ir_constant *) b_node;
+
+ if (!a_field->has_value(b_field))
+ return false;
+
+ a_node = a_node->next;
+ b_node = b_node->next;
+ }
+
+ return true;
+ }
+
+ for (unsigned i = 0; i < this->type->components(); i++) {
+ switch (this->type->base_type) {
+ case GLSL_TYPE_UINT:
+ if (this->value.u[i] != c->value.u[i])
+ return false;
+ break;
+ case GLSL_TYPE_INT:
+ if (this->value.i[i] != c->value.i[i])
+ return false;
+ break;
+ case GLSL_TYPE_FLOAT:
+ if (this->value.f[i] != c->value.f[i])
+ return false;
+ break;
+ case GLSL_TYPE_BOOL:
+ if (this->value.b[i] != c->value.b[i])
+ return false;
+ break;
+ default:
+ assert(!"Should not get here.");
+ return false;
+ }
+ }
+
+ return true;
+}
+
+bool
+ir_constant::is_zero() const
+{
+ if (!this->type->is_scalar() && !this->type->is_vector())
+ return false;
+
+ for (unsigned c = 0; c < this->type->vector_elements; c++) {
+ switch (this->type->base_type) {
+ case GLSL_TYPE_FLOAT:
+ if (this->value.f[c] != 0.0)
+ return false;
+ break;
+ case GLSL_TYPE_INT:
+ if (this->value.i[c] != 0)
+ return false;
+ break;
+ case GLSL_TYPE_UINT:
+ if (this->value.u[c] != 0)
+ return false;
+ break;
+ case GLSL_TYPE_BOOL:
+ if (this->value.b[c] != false)
+ return false;
+ break;
+ default:
+ /* The only other base types are structures, arrays, and samplers.
+ * Samplers cannot be constants, and the others should have been
+ * filtered out above.
+ */
+ assert(!"Should not get here.");
+ return false;
+ }
+ }
+
+ return true;
+}
+
+bool
+ir_constant::is_one() const
+{
+ if (!this->type->is_scalar() && !this->type->is_vector())
+ return false;
+
+ for (unsigned c = 0; c < this->type->vector_elements; c++) {
+ switch (this->type->base_type) {
+ case GLSL_TYPE_FLOAT:
+ if (this->value.f[c] != 1.0)
+ return false;
+ break;
+ case GLSL_TYPE_INT:
+ if (this->value.i[c] != 1)
+ return false;
+ break;
+ case GLSL_TYPE_UINT:
+ if (this->value.u[c] != 1)
+ return false;
+ break;
+ case GLSL_TYPE_BOOL:
+ if (this->value.b[c] != true)
+ return false;
+ break;
+ default:
+ /* The only other base types are structures, arrays, and samplers.
+ * Samplers cannot be constants, and the others should have been
+ * filtered out above.
+ */
+ assert(!"Should not get here.");
+ return false;
+ }
+ }
+
+ return true;
+}
+
+bool
+ir_constant::is_negative_one() const
+{
+ if (!this->type->is_scalar() && !this->type->is_vector())
+ return false;
+
+ if (this->type->is_boolean())
+ return false;
+
+ for (unsigned c = 0; c < this->type->vector_elements; c++) {
+ switch (this->type->base_type) {
+ case GLSL_TYPE_FLOAT:
+ if (this->value.f[c] != -1.0)
+ return false;
+ break;
+ case GLSL_TYPE_INT:
+ if (this->value.i[c] != -1)
+ return false;
+ break;
+ case GLSL_TYPE_UINT:
+ if (int(this->value.u[c]) != -1)
+ return false;
+ break;
+ default:
+ /* The only other base types are structures, arrays, samplers, and
+ * booleans. Samplers cannot be constants, and the others should
+ * have been filtered out above.
+ */
+ assert(!"Should not get here.");
+ return false;
+ }
+ }
+
+ return true;
+}
+
+ir_loop::ir_loop()
+{
+ this->ir_type = ir_type_loop;
+ this->cmp = ir_unop_neg;
+ this->from = NULL;
+ this->to = NULL;
+ this->increment = NULL;
+ this->counter = NULL;
+}
+
+
+ir_dereference_variable::ir_dereference_variable(ir_variable *var)
+{
+ this->ir_type = ir_type_dereference_variable;
+ this->var = var;
+ this->type = (var != NULL) ? var->type : glsl_type::error_type;
+}
+
+
+ir_dereference_array::ir_dereference_array(ir_rvalue *value,
+ ir_rvalue *array_index)
+{
+ this->ir_type = ir_type_dereference_array;
+ this->array_index = array_index;
+ this->set_array(value);
+}
+
+
+ir_dereference_array::ir_dereference_array(ir_variable *var,
+ ir_rvalue *array_index)
+{
+ void *ctx = ralloc_parent(var);
+
+ this->ir_type = ir_type_dereference_array;
+ this->array_index = array_index;
+ this->set_array(new(ctx) ir_dereference_variable(var));
+}
+
+
+void
+ir_dereference_array::set_array(ir_rvalue *value)
+{
+ this->array = value;
+ this->type = glsl_type::error_type;
+
+ if (this->array != NULL) {
+ const glsl_type *const vt = this->array->type;
+
+ if (vt->is_array()) {
+ type = vt->element_type();
+ } else if (vt->is_matrix()) {
+ type = vt->column_type();
+ } else if (vt->is_vector()) {
+ type = vt->get_base_type();
+ }
+ }
+}
+
+
+ir_dereference_record::ir_dereference_record(ir_rvalue *value,
+ const char *field)
+{
+ this->ir_type = ir_type_dereference_record;
+ this->record = value;
+ this->field = ralloc_strdup(this, field);
+ this->type = (this->record != NULL)
+ ? this->record->type->field_type(field) : glsl_type::error_type;
+}
+
+
+ir_dereference_record::ir_dereference_record(ir_variable *var,
+ const char *field)
+{
+ void *ctx = ralloc_parent(var);
+
+ this->ir_type = ir_type_dereference_record;
+ this->record = new(ctx) ir_dereference_variable(var);
+ this->field = ralloc_strdup(this, field);
+ this->type = (this->record != NULL)
+ ? this->record->type->field_type(field) : glsl_type::error_type;
+}
+
+bool type_contains_sampler(const glsl_type *type)
+{
+ if (type->is_array()) {
+ return type_contains_sampler(type->fields.array);
+ } else if (type->is_record()) {
+ for (unsigned int i = 0; i < type->length; i++) {
+ if (type_contains_sampler(type->fields.structure[i].type))
+ return true;
+ }
+ return false;
+ } else {
+ return type->is_sampler();
+ }
+}
+
+bool
+ir_dereference::is_lvalue()
+{
+ ir_variable *var = this->variable_referenced();
+
+ /* Every l-value derference chain eventually ends in a variable.
+ */
+ if ((var == NULL) || var->read_only)
+ return false;
+
+ if (this->type->is_array() && !var->array_lvalue)
+ return false;
+
+ /* From page 17 (page 23 of the PDF) of the GLSL 1.20 spec:
+ *
+ * "Samplers cannot be treated as l-values; hence cannot be used
+ * as out or inout function parameters, nor can they be
+ * assigned into."
+ */
+ if (type_contains_sampler(this->type))
+ return false;
+
+ return true;
+}
+
+
+const char *tex_opcode_strs[] = { "tex", "txb", "txl", "txd", "txf" };
+
+const char *ir_texture::opcode_string()
+{
+ assert((unsigned int) op <=
+ sizeof(tex_opcode_strs) / sizeof(tex_opcode_strs[0]));
+ return tex_opcode_strs[op];
+}
+
+ir_texture_opcode
+ir_texture::get_opcode(const char *str)
+{
+ const int count = sizeof(tex_opcode_strs) / sizeof(tex_opcode_strs[0]);
+ for (int op = 0; op < count; op++) {
+ if (strcmp(str, tex_opcode_strs[op]) == 0)
+ return (ir_texture_opcode) op;
+ }
+ return (ir_texture_opcode) -1;
+}
+
+
+void
+ir_texture::set_sampler(ir_dereference *sampler, const glsl_type *type)
+{
+ assert(sampler != NULL);
+ assert(type != NULL);
+ this->sampler = sampler;
+ this->type = type;
+
+ assert(sampler->type->sampler_type == (int) type->base_type);
+ if (sampler->type->sampler_shadow)
+ assert(type->vector_elements == 4 || type->vector_elements == 1);
+ else
+ assert(type->vector_elements == 4);
+}
+
+
+void
+ir_swizzle::init_mask(const unsigned *comp, unsigned count)
+{
+ assert((count >= 1) && (count <= 4));
+
+ memset(&this->mask, 0, sizeof(this->mask));
+ this->mask.num_components = count;
+
+ unsigned dup_mask = 0;
+ switch (count) {
+ case 4:
+ assert(comp[3] <= 3);
+ dup_mask |= (1U << comp[3])
+ & ((1U << comp[0]) | (1U << comp[1]) | (1U << comp[2]));
+ this->mask.w = comp[3];
+
+ case 3:
+ assert(comp[2] <= 3);
+ dup_mask |= (1U << comp[2])
+ & ((1U << comp[0]) | (1U << comp[1]));
+ this->mask.z = comp[2];
+
+ case 2:
+ assert(comp[1] <= 3);
+ dup_mask |= (1U << comp[1])
+ & ((1U << comp[0]));
+ this->mask.y = comp[1];
+
+ case 1:
+ assert(comp[0] <= 3);
+ this->mask.x = comp[0];
+ }
+
+ this->mask.has_duplicates = dup_mask != 0;
+
+ /* Based on the number of elements in the swizzle and the base type
+ * (i.e., float, int, unsigned, or bool) of the vector being swizzled,
+ * generate the type of the resulting value.
+ */
+ type = glsl_type::get_instance(val->type->base_type, mask.num_components, 1);
+}
+
+ir_swizzle::ir_swizzle(ir_rvalue *val, unsigned x, unsigned y, unsigned z,
+ unsigned w, unsigned count)
+ : val(val)
+{
+ const unsigned components[4] = { x, y, z, w };
+ this->ir_type = ir_type_swizzle;
+ this->init_mask(components, count);
+}
+
+ir_swizzle::ir_swizzle(ir_rvalue *val, const unsigned *comp,
+ unsigned count)
+ : val(val)
+{
+ this->ir_type = ir_type_swizzle;
+ this->init_mask(comp, count);
+}
+
+ir_swizzle::ir_swizzle(ir_rvalue *val, ir_swizzle_mask mask)
+{
+ this->ir_type = ir_type_swizzle;
+ this->val = val;
+ this->mask = mask;
+ this->type = glsl_type::get_instance(val->type->base_type,
+ mask.num_components, 1);
+}
+
+#define X 1
+#define R 5
+#define S 9
+#define I 13
+
+ir_swizzle *
+ir_swizzle::create(ir_rvalue *val, const char *str, unsigned vector_length)
+{
+ void *ctx = ralloc_parent(val);
+
+ /* For each possible swizzle character, this table encodes the value in
+ * \c idx_map that represents the 0th element of the vector. For invalid
+ * swizzle characters (e.g., 'k'), a special value is used that will allow
+ * detection of errors.
+ */
+ static const unsigned char base_idx[26] = {
+ /* a b c d e f g h i j k l m */
+ R, R, I, I, I, I, R, I, I, I, I, I, I,
+ /* n o p q r s t u v w x y z */
+ I, I, S, S, R, S, S, I, I, X, X, X, X
+ };
+
+ /* Each valid swizzle character has an entry in the previous table. This
+ * table encodes the base index encoded in the previous table plus the actual
+ * index of the swizzle character. When processing swizzles, the first
+ * character in the string is indexed in the previous table. Each character
+ * in the string is indexed in this table, and the value found there has the
+ * value form the first table subtracted. The result must be on the range
+ * [0,3].
+ *
+ * For example, the string "wzyx" will get X from the first table. Each of
+ * the charcaters will get X+3, X+2, X+1, and X+0 from this table. After
+ * subtraction, the swizzle values are { 3, 2, 1, 0 }.
+ *
+ * The string "wzrg" will get X from the first table. Each of the characters
+ * will get X+3, X+2, R+0, and R+1 from this table. After subtraction, the
+ * swizzle values are { 3, 2, 4, 5 }. Since 4 and 5 are outside the range
+ * [0,3], the error is detected.
+ */
+ static const unsigned char idx_map[26] = {
+ /* a b c d e f g h i j k l m */
+ R+3, R+2, 0, 0, 0, 0, R+1, 0, 0, 0, 0, 0, 0,
+ /* n o p q r s t u v w x y z */
+ 0, 0, S+2, S+3, R+0, S+0, S+1, 0, 0, X+3, X+0, X+1, X+2
+ };
+
+ int swiz_idx[4] = { 0, 0, 0, 0 };
+ unsigned i;
+
+
+ /* Validate the first character in the swizzle string and look up the base
+ * index value as described above.
+ */
+ if ((str[0] < 'a') || (str[0] > 'z'))
+ return NULL;
+
+ const unsigned base = base_idx[str[0] - 'a'];
+
+
+ for (i = 0; (i < 4) && (str[i] != '\0'); i++) {
+ /* Validate the next character, and, as described above, convert it to a
+ * swizzle index.
+ */
+ if ((str[i] < 'a') || (str[i] > 'z'))
+ return NULL;
+
+ swiz_idx[i] = idx_map[str[i] - 'a'] - base;
+ if ((swiz_idx[i] < 0) || (swiz_idx[i] >= (int) vector_length))
+ return NULL;
+ }
+
+ if (str[i] != '\0')
+ return NULL;
+
+ return new(ctx) ir_swizzle(val, swiz_idx[0], swiz_idx[1], swiz_idx[2],
+ swiz_idx[3], i);
+}
+
+#undef X
+#undef R
+#undef S
+#undef I
+
+ir_variable *
+ir_swizzle::variable_referenced()
+{
+ return this->val->variable_referenced();
+}
+
+
+ir_variable::ir_variable(const struct glsl_type *type, const char *name,
+ ir_variable_mode mode)
+ : max_array_access(0), read_only(false), centroid(false), invariant(false),
+ mode(mode), interpolation(ir_var_smooth), array_lvalue(false)
+{
+ this->ir_type = ir_type_variable;
+ this->type = type;
+ this->name = ralloc_strdup(this, name);
+ this->explicit_location = false;
+ this->location = -1;
+ this->warn_extension = NULL;
+ this->constant_value = NULL;
+ this->origin_upper_left = false;
+ this->pixel_center_integer = false;
+ this->depth_layout = ir_depth_layout_none;
+ this->used = false;
+
+ if (type && type->base_type == GLSL_TYPE_SAMPLER)
+ this->read_only = true;
+}
+
+
+const char *
+ir_variable::interpolation_string() const
+{
+ switch (this->interpolation) {
+ case ir_var_smooth: return "smooth";
+ case ir_var_flat: return "flat";
+ case ir_var_noperspective: return "noperspective";
+ }
+
+ assert(!"Should not get here.");
+ return "";
+}
+
+
+unsigned
+ir_variable::component_slots() const
+{
+ /* FINISHME: Sparsely accessed arrays require fewer slots. */
+ return this->type->component_slots();
+}
+
+
+ir_function_signature::ir_function_signature(const glsl_type *return_type)
+ : return_type(return_type), is_defined(false), _function(NULL)
+{
+ this->ir_type = ir_type_function_signature;
+ this->is_builtin = false;
+}
+
+
+static bool
+modes_match(unsigned a, unsigned b)
+{
+ if (a == b)
+ return true;
+
+ /* Accept "in" vs. "const in" */
+ if ((a == ir_var_const_in && b == ir_var_in) ||
+ (b == ir_var_const_in && a == ir_var_in))
+ return true;
+
+ return false;
+}
+
+
+const char *
+ir_function_signature::qualifiers_match(exec_list *params)
+{
+ exec_list_iterator iter_a = parameters.iterator();
+ exec_list_iterator iter_b = params->iterator();
+
+ /* check that the qualifiers match. */
+ while (iter_a.has_next()) {
+ ir_variable *a = (ir_variable *)iter_a.get();
+ ir_variable *b = (ir_variable *)iter_b.get();
+
+ if (a->read_only != b->read_only ||
+ !modes_match(a->mode, b->mode) ||
+ a->interpolation != b->interpolation ||
+ a->centroid != b->centroid) {
+
+ /* parameter a's qualifiers don't match */
+ return a->name;
+ }
+
+ iter_a.next();
+ iter_b.next();
+ }
+ return NULL;
+}
+
+
+void
+ir_function_signature::replace_parameters(exec_list *new_params)
+{
+ /* Destroy all of the previous parameter information. If the previous
+ * parameter information comes from the function prototype, it may either
+ * specify incorrect parameter names or not have names at all.
+ */
+ foreach_iter(exec_list_iterator, iter, parameters) {
+ assert(((ir_instruction *) iter.get())->as_variable() != NULL);
+
+ iter.remove();
+ }
+
+ new_params->move_nodes_to(&parameters);
+}
+
+
+ir_function::ir_function(const char *name)
+{
+ this->ir_type = ir_type_function;
+ this->name = ralloc_strdup(this, name);
+}
+
+
+bool
+ir_function::has_user_signature()
+{
+ foreach_list(n, &this->signatures) {
+ ir_function_signature *const sig = (ir_function_signature *) n;
+ if (!sig->is_builtin)
+ return true;
+ }
+ return false;
+}
+
+
+ir_call *
+ir_call::get_error_instruction(void *ctx)
+{
+ ir_call *call = new(ctx) ir_call;
+
+ call->type = glsl_type::error_type;
+ return call;
+}
+
+void
+ir_call::set_callee(ir_function_signature *sig)
+{
+ assert((this->type == NULL) || (this->type == sig->return_type));
+
+ this->callee = sig;
+}
+
+void
+visit_exec_list(exec_list *list, ir_visitor *visitor)
+{
+ foreach_iter(exec_list_iterator, iter, *list) {
+ ((ir_instruction *)iter.get())->accept(visitor);
+ }
+}
+
+
+static void
+steal_memory(ir_instruction *ir, void *new_ctx)
+{
+ ir_variable *var = ir->as_variable();
+ ir_constant *constant = ir->as_constant();
+ if (var != NULL && var->constant_value != NULL)
+ steal_memory(var->constant_value, ir);
+
+ /* The components of aggregate constants are not visited by the normal
+ * visitor, so steal their values by hand.
+ */
+ if (constant != NULL) {
+ if (constant->type->is_record()) {
+ foreach_iter(exec_list_iterator, iter, constant->components) {
+ ir_constant *field = (ir_constant *)iter.get();
+ steal_memory(field, ir);
+ }
+ } else if (constant->type->is_array()) {
+ for (unsigned int i = 0; i < constant->type->length; i++) {
+ steal_memory(constant->array_elements[i], ir);
+ }
+ }
+ }
+
+ ralloc_steal(new_ctx, ir);
+}
+
+
+void
+reparent_ir(exec_list *list, void *mem_ctx)
+{
+ foreach_list(node, list) {
+ visit_tree((ir_instruction *) node, steal_memory, mem_ctx);
+ }
+}
+
+
+static ir_rvalue *
+try_min_one(ir_rvalue *ir)
+{
+ ir_expression *expr = ir->as_expression();
+
+ if (!expr || expr->operation != ir_binop_min)
+ return NULL;
+
+ if (expr->operands[0]->is_one())
+ return expr->operands[1];
+
+ if (expr->operands[1]->is_one())
+ return expr->operands[0];
+
+ return NULL;
+}
+
+static ir_rvalue *
+try_max_zero(ir_rvalue *ir)
+{
+ ir_expression *expr = ir->as_expression();
+
+ if (!expr || expr->operation != ir_binop_max)
+ return NULL;
+
+ if (expr->operands[0]->is_zero())
+ return expr->operands[1];
+
+ if (expr->operands[1]->is_zero())
+ return expr->operands[0];
+
+ return NULL;
+}
+
+ir_rvalue *
+ir_rvalue::as_rvalue_to_saturate()
+{
+ ir_expression *expr = this->as_expression();
+
+ if (!expr)
+ return NULL;
+
+ ir_rvalue *max_zero = try_max_zero(expr);
+ if (max_zero) {
+ return try_min_one(max_zero);
+ } else {
+ ir_rvalue *min_one = try_min_one(expr);
+ if (min_one) {
+ return try_max_zero(min_one);
+ }
+ }
+
+ return NULL;
+}
diff --git a/mesalib/src/glsl/ir.h b/mesalib/src/glsl/ir.h
index a41984310..6292bec1b 100644
--- a/mesalib/src/glsl/ir.h
+++ b/mesalib/src/glsl/ir.h
@@ -1,1666 +1,1666 @@
-/* -*- c++ -*- */
-/*
- * Copyright © 2010 Intel Corporation
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-
-#pragma once
-#ifndef IR_H
-#define IR_H
-
-#include <stdio.h>
-#include <stdlib.h>
-
-#include "ralloc.h"
-#include "glsl_types.h"
-#include "list.h"
-#include "ir_visitor.h"
-#include "ir_hierarchical_visitor.h"
-
-/**
- * \defgroup IR Intermediate representation nodes
- *
- * @{
- */
-
-/**
- * Class tags
- *
- * Each concrete class derived from \c ir_instruction has a value in this
- * enumerant. The value for the type is stored in \c ir_instruction::ir_type
- * by the constructor. While using type tags is not very C++, it is extremely
- * convenient. For example, during debugging you can simply inspect
- * \c ir_instruction::ir_type to find out the actual type of the object.
- *
- * In addition, it is possible to use a switch-statement based on \c
- * \c ir_instruction::ir_type to select different behavior for different object
- * types. For functions that have only slight differences for several object
- * types, this allows writing very straightforward, readable code.
- */
-enum ir_node_type {
- /**
- * Zero is unused so that the IR validator can detect cases where
- * \c ir_instruction::ir_type has not been initialized.
- */
- ir_type_unset,
- ir_type_variable,
- ir_type_assignment,
- ir_type_call,
- ir_type_constant,
- ir_type_dereference_array,
- ir_type_dereference_record,
- ir_type_dereference_variable,
- ir_type_discard,
- ir_type_expression,
- ir_type_function,
- ir_type_function_signature,
- ir_type_if,
- ir_type_loop,
- ir_type_loop_jump,
- ir_type_return,
- ir_type_swizzle,
- ir_type_texture,
- ir_type_max /**< maximum ir_type enum number, for validation */
-};
-
-/**
- * Base class of all IR instructions
- */
-class ir_instruction : public exec_node {
-public:
- enum ir_node_type ir_type;
- const struct glsl_type *type;
-
- /** ir_print_visitor helper for debugging. */
- void print(void) const;
-
- virtual void accept(ir_visitor *) = 0;
- virtual ir_visitor_status accept(ir_hierarchical_visitor *) = 0;
- virtual ir_instruction *clone(void *mem_ctx,
- struct hash_table *ht) const = 0;
-
- /**
- * \name IR instruction downcast functions
- *
- * These functions either cast the object to a derived class or return
- * \c NULL if the object's type does not match the specified derived class.
- * Additional downcast functions will be added as needed.
- */
- /*@{*/
- virtual class ir_variable * as_variable() { return NULL; }
- virtual class ir_function * as_function() { return NULL; }
- virtual class ir_dereference * as_dereference() { return NULL; }
- virtual class ir_dereference_array * as_dereference_array() { return NULL; }
- virtual class ir_dereference_variable *as_dereference_variable() { return NULL; }
- virtual class ir_expression * as_expression() { return NULL; }
- virtual class ir_rvalue * as_rvalue() { return NULL; }
- virtual class ir_loop * as_loop() { return NULL; }
- virtual class ir_assignment * as_assignment() { return NULL; }
- virtual class ir_call * as_call() { return NULL; }
- virtual class ir_return * as_return() { return NULL; }
- virtual class ir_if * as_if() { return NULL; }
- virtual class ir_swizzle * as_swizzle() { return NULL; }
- virtual class ir_constant * as_constant() { return NULL; }
- virtual class ir_discard * as_discard() { return NULL; }
- /*@}*/
-
-protected:
- ir_instruction()
- {
- ir_type = ir_type_unset;
- type = NULL;
- }
-};
-
-
-class ir_rvalue : public ir_instruction {
-public:
- virtual ir_rvalue *clone(void *mem_ctx, struct hash_table *) const = 0;
-
- virtual ir_constant *constant_expression_value() = 0;
-
- virtual ir_rvalue * as_rvalue()
- {
- return this;
- }
-
- ir_rvalue *as_rvalue_to_saturate();
-
- virtual bool is_lvalue()
- {
- return false;
- }
-
- /**
- * Get the variable that is ultimately referenced by an r-value
- */
- virtual ir_variable *variable_referenced()
- {
- return NULL;
- }
-
-
- /**
- * If an r-value is a reference to a whole variable, get that variable
- *
- * \return
- * Pointer to a variable that is completely dereferenced by the r-value. If
- * the r-value is not a dereference or the dereference does not access the
- * entire variable (i.e., it's just one array element, struct field), \c NULL
- * is returned.
- */
- virtual ir_variable *whole_variable_referenced()
- {
- return NULL;
- }
-
- /**
- * Determine if an r-value has the value zero
- *
- * The base implementation of this function always returns \c false. The
- * \c ir_constant class over-rides this function to return \c true \b only
- * for vector and scalar types that have all elements set to the value
- * zero (or \c false for booleans).
- *
- * \sa ir_constant::has_value, ir_rvalue::is_one, ir_rvalue::is_negative_one
- */
- virtual bool is_zero() const;
-
- /**
- * Determine if an r-value has the value one
- *
- * The base implementation of this function always returns \c false. The
- * \c ir_constant class over-rides this function to return \c true \b only
- * for vector and scalar types that have all elements set to the value
- * one (or \c true for booleans).
- *
- * \sa ir_constant::has_value, ir_rvalue::is_zero, ir_rvalue::is_negative_one
- */
- virtual bool is_one() const;
-
- /**
- * Determine if an r-value has the value negative one
- *
- * The base implementation of this function always returns \c false. The
- * \c ir_constant class over-rides this function to return \c true \b only
- * for vector and scalar types that have all elements set to the value
- * negative one. For boolean times, the result is always \c false.
- *
- * \sa ir_constant::has_value, ir_rvalue::is_zero, ir_rvalue::is_one
- */
- virtual bool is_negative_one() const;
-
-protected:
- ir_rvalue();
-};
-
-
-/**
- * Variable storage classes
- */
-enum ir_variable_mode {
- ir_var_auto = 0, /**< Function local variables and globals. */
- ir_var_uniform, /**< Variable declared as a uniform. */
- ir_var_in,
- ir_var_out,
- ir_var_inout,
- ir_var_const_in, /**< "in" param that must be a constant expression */
- ir_var_system_value, /**< Ex: front-face, instance-id, etc. */
- ir_var_temporary /**< Temporary variable generated during compilation. */
-};
-
-enum ir_variable_interpolation {
- ir_var_smooth = 0,
- ir_var_flat,
- ir_var_noperspective
-};
-
-/**
- * \brief Layout qualifiers for gl_FragDepth.
- *
- * The AMD_conservative_depth extension allows gl_FragDepth to be redeclared
- * with a layout qualifier.
- */
-enum ir_depth_layout {
- ir_depth_layout_none, /**< No depth layout is specified. */
- ir_depth_layout_any,
- ir_depth_layout_greater,
- ir_depth_layout_less,
- ir_depth_layout_unchanged
-};
-
-/**
- * \brief Convert depth layout qualifier to string.
- */
-const char*
-depth_layout_string(ir_depth_layout layout);
-
-/**
- * Description of built-in state associated with a uniform
- *
- * \sa ir_variable::state_slots
- */
-struct ir_state_slot {
- int tokens[5];
- int swizzle;
-};
-
-class ir_variable : public ir_instruction {
-public:
- ir_variable(const struct glsl_type *, const char *, ir_variable_mode);
-
- virtual ir_variable *clone(void *mem_ctx, struct hash_table *ht) const;
-
- virtual ir_variable *as_variable()
- {
- return this;
- }
-
- virtual void accept(ir_visitor *v)
- {
- v->visit(this);
- }
-
- virtual ir_visitor_status accept(ir_hierarchical_visitor *);
-
-
- /**
- * Get the string value for the interpolation qualifier
- *
- * \return The string that would be used in a shader to specify \c
- * mode will be returned.
- *
- * This function should only be used on a shader input or output variable.
- */
- const char *interpolation_string() const;
-
- /**
- * Calculate the number of slots required to hold this variable
- *
- * This is used to determine how many uniform or varying locations a variable
- * occupies. The count is in units of floating point components.
- */
- unsigned component_slots() const;
-
- /**
- * Delcared name of the variable
- */
- const char *name;
-
- /**
- * Highest element accessed with a constant expression array index
- *
- * Not used for non-array variables.
- */
- unsigned max_array_access;
-
- /**
- * Is the variable read-only?
- *
- * This is set for variables declared as \c const, shader inputs,
- * and uniforms.
- */
- unsigned read_only:1;
- unsigned centroid:1;
- unsigned invariant:1;
-
- /**
- * Has this variable been used for reading or writing?
- *
- * Several GLSL semantic checks require knowledge of whether or not a
- * variable has been used. For example, it is an error to redeclare a
- * variable as invariant after it has been used.
- */
- unsigned used:1;
-
- /**
- * Storage class of the variable.
- *
- * \sa ir_variable_mode
- */
- unsigned mode:3;
-
- /**
- * Interpolation mode for shader inputs / outputs
- *
- * \sa ir_variable_interpolation
- */
- unsigned interpolation:2;
-
- /**
- * Flag that the whole array is assignable
- *
- * In GLSL 1.20 and later whole arrays are assignable (and comparable for
- * equality). This flag enables this behavior.
- */
- unsigned array_lvalue:1;
-
- /**
- * \name ARB_fragment_coord_conventions
- * @{
- */
- unsigned origin_upper_left:1;
- unsigned pixel_center_integer:1;
- /*@}*/
-
- /**
- * \brief Layout qualifier for gl_FragDepth.
- *
- * This is not equal to \c ir_depth_layout_none if and only if this
- * variable is \c gl_FragDepth and a layout qualifier is specified.
- */
- ir_depth_layout depth_layout;
-
- /**
- * Was the location explicitly set in the shader?
- *
- * If the location is explicitly set in the shader, it \b cannot be changed
- * by the linker or by the API (e.g., calls to \c glBindAttribLocation have
- * no effect).
- */
- unsigned explicit_location:1;
-
- /**
- * Storage location of the base of this variable
- *
- * The precise meaning of this field depends on the nature of the variable.
- *
- * - Vertex shader input: one of the values from \c gl_vert_attrib.
- * - Vertex shader output: one of the values from \c gl_vert_result.
- * - Fragment shader input: one of the values from \c gl_frag_attrib.
- * - Fragment shader output: one of the values from \c gl_frag_result.
- * - Uniforms: Per-stage uniform slot number.
- * - Other: This field is not currently used.
- *
- * If the variable is a uniform, shader input, or shader output, and the
- * slot has not been assigned, the value will be -1.
- */
- int location;
-
- /**
- * Built-in state that backs this uniform
- *
- * Once set at variable creation, \c state_slots must remain invariant.
- * This is because, ideally, this array would be shared by all clones of
- * this variable in the IR tree. In other words, we'd really like for it
- * to be a fly-weight.
- *
- * If the variable is not a uniform, \c num_state_slots will be zero and
- * \c state_slots will be \c NULL.
- */
- /*@{*/
- unsigned num_state_slots; /**< Number of state slots used */
- ir_state_slot *state_slots; /**< State descriptors. */
- /*@}*/
-
- /**
- * Emit a warning if this variable is accessed.
- */
- const char *warn_extension;
-
- /**
- * Value assigned in the initializer of a variable declared "const"
- */
- ir_constant *constant_value;
-};
-
-
-/*@{*/
-/**
- * The representation of a function instance; may be the full definition or
- * simply a prototype.
- */
-class ir_function_signature : public ir_instruction {
- /* An ir_function_signature will be part of the list of signatures in
- * an ir_function.
- */
-public:
- ir_function_signature(const glsl_type *return_type);
-
- virtual ir_function_signature *clone(void *mem_ctx,
- struct hash_table *ht) const;
- ir_function_signature *clone_prototype(void *mem_ctx,
- struct hash_table *ht) const;
-
- virtual void accept(ir_visitor *v)
- {
- v->visit(this);
- }
-
- virtual ir_visitor_status accept(ir_hierarchical_visitor *);
-
- /**
- * Get the name of the function for which this is a signature
- */
- const char *function_name() const;
-
- /**
- * Get a handle to the function for which this is a signature
- *
- * There is no setter function, this function returns a \c const pointer,
- * and \c ir_function_signature::_function is private for a reason. The
- * only way to make a connection between a function and function signature
- * is via \c ir_function::add_signature. This helps ensure that certain
- * invariants (i.e., a function signature is in the list of signatures for
- * its \c _function) are met.
- *
- * \sa ir_function::add_signature
- */
- inline const class ir_function *function() const
- {
- return this->_function;
- }
-
- /**
- * Check whether the qualifiers match between this signature's parameters
- * and the supplied parameter list. If not, returns the name of the first
- * parameter with mismatched qualifiers (for use in error messages).
- */
- const char *qualifiers_match(exec_list *params);
-
- /**
- * Replace the current parameter list with the given one. This is useful
- * if the current information came from a prototype, and either has invalid
- * or missing parameter names.
- */
- void replace_parameters(exec_list *new_params);
-
- /**
- * Function return type.
- *
- * \note This discards the optional precision qualifier.
- */
- const struct glsl_type *return_type;
-
- /**
- * List of ir_variable of function parameters.
- *
- * This represents the storage. The paramaters passed in a particular
- * call will be in ir_call::actual_paramaters.
- */
- struct exec_list parameters;
-
- /** Whether or not this function has a body (which may be empty). */
- unsigned is_defined:1;
-
- /** Whether or not this function signature is a built-in. */
- unsigned is_builtin:1;
-
- /** Body of instructions in the function. */
- struct exec_list body;
-
-private:
- /** Function of which this signature is one overload. */
- class ir_function *_function;
-
- friend class ir_function;
-};
-
-
-/**
- * Header for tracking multiple overloaded functions with the same name.
- * Contains a list of ir_function_signatures representing each of the
- * actual functions.
- */
-class ir_function : public ir_instruction {
-public:
- ir_function(const char *name);
-
- virtual ir_function *clone(void *mem_ctx, struct hash_table *ht) const;
-
- virtual ir_function *as_function()
- {
- return this;
- }
-
- virtual void accept(ir_visitor *v)
- {
- v->visit(this);
- }
-
- virtual ir_visitor_status accept(ir_hierarchical_visitor *);
-
- void add_signature(ir_function_signature *sig)
- {
- sig->_function = this;
- this->signatures.push_tail(sig);
- }
-
- /**
- * Get an iterator for the set of function signatures
- */
- exec_list_iterator iterator()
- {
- return signatures.iterator();
- }
-
- /**
- * Find a signature that matches a set of actual parameters, taking implicit
- * conversions into account.
- */
- ir_function_signature *matching_signature(const exec_list *actual_param);
-
- /**
- * Find a signature that exactly matches a set of actual parameters without
- * any implicit type conversions.
- */
- ir_function_signature *exact_matching_signature(const exec_list *actual_ps);
-
- /**
- * Name of the function.
- */
- const char *name;
-
- /** Whether or not this function has a signature that isn't a built-in. */
- bool has_user_signature();
-
- /**
- * List of ir_function_signature for each overloaded function with this name.
- */
- struct exec_list signatures;
-};
-
-inline const char *ir_function_signature::function_name() const
-{
- return this->_function->name;
-}
-/*@}*/
-
-
-/**
- * IR instruction representing high-level if-statements
- */
-class ir_if : public ir_instruction {
-public:
- ir_if(ir_rvalue *condition)
- : condition(condition)
- {
- ir_type = ir_type_if;
- }
-
- virtual ir_if *clone(void *mem_ctx, struct hash_table *ht) const;
-
- virtual ir_if *as_if()
- {
- return this;
- }
-
- virtual void accept(ir_visitor *v)
- {
- v->visit(this);
- }
-
- virtual ir_visitor_status accept(ir_hierarchical_visitor *);
-
- ir_rvalue *condition;
- /** List of ir_instruction for the body of the then branch */
- exec_list then_instructions;
- /** List of ir_instruction for the body of the else branch */
- exec_list else_instructions;
-};
-
-
-/**
- * IR instruction representing a high-level loop structure.
- */
-class ir_loop : public ir_instruction {
-public:
- ir_loop();
-
- virtual ir_loop *clone(void *mem_ctx, struct hash_table *ht) const;
-
- virtual void accept(ir_visitor *v)
- {
- v->visit(this);
- }
-
- virtual ir_visitor_status accept(ir_hierarchical_visitor *);
-
- virtual ir_loop *as_loop()
- {
- return this;
- }
-
- /**
- * Get an iterator for the instructions of the loop body
- */
- exec_list_iterator iterator()
- {
- return body_instructions.iterator();
- }
-
- /** List of ir_instruction that make up the body of the loop. */
- exec_list body_instructions;
-
- /**
- * \name Loop counter and controls
- *
- * Represents a loop like a FORTRAN \c do-loop.
- *
- * \note
- * If \c from and \c to are the same value, the loop will execute once.
- */
- /*@{*/
- ir_rvalue *from; /** Value of the loop counter on the first
- * iteration of the loop.
- */
- ir_rvalue *to; /** Value of the loop counter on the last
- * iteration of the loop.
- */
- ir_rvalue *increment;
- ir_variable *counter;
-
- /**
- * Comparison operation in the loop terminator.
- *
- * If any of the loop control fields are non-\c NULL, this field must be
- * one of \c ir_binop_less, \c ir_binop_greater, \c ir_binop_lequal,
- * \c ir_binop_gequal, \c ir_binop_equal, or \c ir_binop_nequal.
- */
- int cmp;
- /*@}*/
-};
-
-
-class ir_assignment : public ir_instruction {
-public:
- ir_assignment(ir_rvalue *lhs, ir_rvalue *rhs, ir_rvalue *condition);
-
- /**
- * Construct an assignment with an explicit write mask
- *
- * \note
- * Since a write mask is supplied, the LHS must already be a bare
- * \c ir_dereference. The cannot be any swizzles in the LHS.
- */
- ir_assignment(ir_dereference *lhs, ir_rvalue *rhs, ir_rvalue *condition,
- unsigned write_mask);
-
- virtual ir_assignment *clone(void *mem_ctx, struct hash_table *ht) const;
-
- virtual ir_constant *constant_expression_value();
-
- virtual void accept(ir_visitor *v)
- {
- v->visit(this);
- }
-
- virtual ir_visitor_status accept(ir_hierarchical_visitor *);
-
- virtual ir_assignment * as_assignment()
- {
- return this;
- }
-
- /**
- * Get a whole variable written by an assignment
- *
- * If the LHS of the assignment writes a whole variable, the variable is
- * returned. Otherwise \c NULL is returned. Examples of whole-variable
- * assignment are:
- *
- * - Assigning to a scalar
- * - Assigning to all components of a vector
- * - Whole array (or matrix) assignment
- * - Whole structure assignment
- */
- ir_variable *whole_variable_written();
-
- /**
- * Set the LHS of an assignment
- */
- void set_lhs(ir_rvalue *lhs);
-
- /**
- * Left-hand side of the assignment.
- *
- * This should be treated as read only. If you need to set the LHS of an
- * assignment, use \c ir_assignment::set_lhs.
- */
- ir_dereference *lhs;
-
- /**
- * Value being assigned
- */
- ir_rvalue *rhs;
-
- /**
- * Optional condition for the assignment.
- */
- ir_rvalue *condition;
-
-
- /**
- * Component mask written
- *
- * For non-vector types in the LHS, this field will be zero. For vector
- * types, a bit will be set for each component that is written. Note that
- * for \c vec2 and \c vec3 types only the lower bits will ever be set.
- *
- * A partially-set write mask means that each enabled channel gets
- * the value from a consecutive channel of the rhs. For example,
- * to write just .xyw of gl_FrontColor with color:
- *
- * (assign (constant bool (1)) (xyw)
- * (var_ref gl_FragColor)
- * (swiz xyw (var_ref color)))
- */
- unsigned write_mask:4;
-};
-
-/* Update ir_expression::num_operands() and operator_strs when
- * updating this list.
- */
-enum ir_expression_operation {
- ir_unop_bit_not,
- ir_unop_logic_not,
- ir_unop_neg,
- ir_unop_abs,
- ir_unop_sign,
- ir_unop_rcp,
- ir_unop_rsq,
- ir_unop_sqrt,
- ir_unop_exp, /**< Log base e on gentype */
- ir_unop_log, /**< Natural log on gentype */
- ir_unop_exp2,
- ir_unop_log2,
- ir_unop_f2i, /**< Float-to-integer conversion. */
- ir_unop_i2f, /**< Integer-to-float conversion. */
- ir_unop_f2b, /**< Float-to-boolean conversion */
- ir_unop_b2f, /**< Boolean-to-float conversion */
- ir_unop_i2b, /**< int-to-boolean conversion */
- ir_unop_b2i, /**< Boolean-to-int conversion */
- ir_unop_u2f, /**< Unsigned-to-float conversion. */
- ir_unop_any,
-
- /**
- * \name Unary floating-point rounding operations.
- */
- /*@{*/
- ir_unop_trunc,
- ir_unop_ceil,
- ir_unop_floor,
- ir_unop_fract,
- ir_unop_round_even,
- /*@}*/
-
- /**
- * \name Trigonometric operations.
- */
- /*@{*/
- ir_unop_sin,
- ir_unop_cos,
- ir_unop_sin_reduced, /**< Reduced range sin. [-pi, pi] */
- ir_unop_cos_reduced, /**< Reduced range cos. [-pi, pi] */
- /*@}*/
-
- /**
- * \name Partial derivatives.
- */
- /*@{*/
- ir_unop_dFdx,
- ir_unop_dFdy,
- /*@}*/
-
- ir_unop_noise,
-
- /**
- * A sentinel marking the last of the unary operations.
- */
- ir_last_unop = ir_unop_noise,
-
- ir_binop_add,
- ir_binop_sub,
- ir_binop_mul,
- ir_binop_div,
-
- /**
- * Takes one of two combinations of arguments:
- *
- * - mod(vecN, vecN)
- * - mod(vecN, float)
- *
- * Does not take integer types.
- */
- ir_binop_mod,
-
- /**
- * \name Binary comparison operators which return a boolean vector.
- * The type of both operands must be equal.
- */
- /*@{*/
- ir_binop_less,
- ir_binop_greater,
- ir_binop_lequal,
- ir_binop_gequal,
- ir_binop_equal,
- ir_binop_nequal,
- /**
- * Returns single boolean for whether all components of operands[0]
- * equal the components of operands[1].
- */
- ir_binop_all_equal,
- /**
- * Returns single boolean for whether any component of operands[0]
- * is not equal to the corresponding component of operands[1].
- */
- ir_binop_any_nequal,
- /*@}*/
-
- /**
- * \name Bit-wise binary operations.
- */
- /*@{*/
- ir_binop_lshift,
- ir_binop_rshift,
- ir_binop_bit_and,
- ir_binop_bit_xor,
- ir_binop_bit_or,
- /*@}*/
-
- ir_binop_logic_and,
- ir_binop_logic_xor,
- ir_binop_logic_or,
-
- ir_binop_dot,
- ir_binop_min,
- ir_binop_max,
-
- ir_binop_pow,
-
- /**
- * A sentinel marking the last of the binary operations.
- */
- ir_last_binop = ir_binop_pow,
-
- ir_quadop_vector,
-
- /**
- * A sentinel marking the last of all operations.
- */
- ir_last_opcode = ir_last_binop
-};
-
-class ir_expression : public ir_rvalue {
-public:
- /**
- * Constructor for unary operation expressions
- */
- ir_expression(int op, const struct glsl_type *type, ir_rvalue *);
- ir_expression(int op, ir_rvalue *);
-
- /**
- * Constructor for binary operation expressions
- */
- ir_expression(int op, const struct glsl_type *type,
- ir_rvalue *, ir_rvalue *);
- ir_expression(int op, ir_rvalue *op0, ir_rvalue *op1);
-
- /**
- * Constructor for quad operator expressions
- */
- ir_expression(int op, const struct glsl_type *type,
- ir_rvalue *, ir_rvalue *, ir_rvalue *, ir_rvalue *);
-
- virtual ir_expression *as_expression()
- {
- return this;
- }
-
- virtual ir_expression *clone(void *mem_ctx, struct hash_table *ht) const;
-
- /**
- * Attempt to constant-fold the expression
- *
- * If the expression cannot be constant folded, this method will return
- * \c NULL.
- */
- virtual ir_constant *constant_expression_value();
-
- /**
- * Determine the number of operands used by an expression
- */
- static unsigned int get_num_operands(ir_expression_operation);
-
- /**
- * Determine the number of operands used by an expression
- */
- unsigned int get_num_operands() const
- {
- return (this->operation == ir_quadop_vector)
- ? this->type->vector_elements : get_num_operands(operation);
- }
-
- /**
- * Return a string representing this expression's operator.
- */
- const char *operator_string();
-
- /**
- * Return a string representing this expression's operator.
- */
- static const char *operator_string(ir_expression_operation);
-
-
- /**
- * Do a reverse-lookup to translate the given string into an operator.
- */
- static ir_expression_operation get_operator(const char *);
-
- virtual void accept(ir_visitor *v)
- {
- v->visit(this);
- }
-
- virtual ir_visitor_status accept(ir_hierarchical_visitor *);
-
- ir_expression_operation operation;
- ir_rvalue *operands[4];
-};
-
-
-/**
- * IR instruction representing a function call
- */
-class ir_call : public ir_rvalue {
-public:
- ir_call(ir_function_signature *callee, exec_list *actual_parameters)
- : callee(callee)
- {
- ir_type = ir_type_call;
- assert(callee->return_type != NULL);
- type = callee->return_type;
- actual_parameters->move_nodes_to(& this->actual_parameters);
- }
-
- virtual ir_call *clone(void *mem_ctx, struct hash_table *ht) const;
-
- virtual ir_constant *constant_expression_value();
-
- virtual ir_call *as_call()
- {
- return this;
- }
-
- virtual void accept(ir_visitor *v)
- {
- v->visit(this);
- }
-
- virtual ir_visitor_status accept(ir_hierarchical_visitor *);
-
- /**
- * Get a generic ir_call object when an error occurs
- *
- * Any allocation will be performed with 'ctx' as ralloc owner.
- */
- static ir_call *get_error_instruction(void *ctx);
-
- /**
- * Get an iterator for the set of acutal parameters
- */
- exec_list_iterator iterator()
- {
- return actual_parameters.iterator();
- }
-
- /**
- * Get the name of the function being called.
- */
- const char *callee_name() const
- {
- return callee->function_name();
- }
-
- /**
- * Get the function signature bound to this function call
- */
- ir_function_signature *get_callee()
- {
- return callee;
- }
-
- /**
- * Set the function call target
- */
- void set_callee(ir_function_signature *sig);
-
- /**
- * Generates an inline version of the function before @ir,
- * returning the return value of the function.
- */
- ir_rvalue *generate_inline(ir_instruction *ir);
-
- /* List of ir_rvalue of paramaters passed in this call. */
- exec_list actual_parameters;
-
-private:
- ir_call()
- : callee(NULL)
- {
- this->ir_type = ir_type_call;
- }
-
- ir_function_signature *callee;
-};
-
-
-/**
- * \name Jump-like IR instructions.
- *
- * These include \c break, \c continue, \c return, and \c discard.
- */
-/*@{*/
-class ir_jump : public ir_instruction {
-protected:
- ir_jump()
- {
- ir_type = ir_type_unset;
- }
-};
-
-class ir_return : public ir_jump {
-public:
- ir_return()
- : value(NULL)
- {
- this->ir_type = ir_type_return;
- }
-
- ir_return(ir_rvalue *value)
- : value(value)
- {
- this->ir_type = ir_type_return;
- }
-
- virtual ir_return *clone(void *mem_ctx, struct hash_table *) const;
-
- virtual ir_return *as_return()
- {
- return this;
- }
-
- ir_rvalue *get_value() const
- {
- return value;
- }
-
- virtual void accept(ir_visitor *v)
- {
- v->visit(this);
- }
-
- virtual ir_visitor_status accept(ir_hierarchical_visitor *);
-
- ir_rvalue *value;
-};
-
-
-/**
- * Jump instructions used inside loops
- *
- * These include \c break and \c continue. The \c break within a loop is
- * different from the \c break within a switch-statement.
- *
- * \sa ir_switch_jump
- */
-class ir_loop_jump : public ir_jump {
-public:
- enum jump_mode {
- jump_break,
- jump_continue
- };
-
- ir_loop_jump(jump_mode mode)
- {
- this->ir_type = ir_type_loop_jump;
- this->mode = mode;
- this->loop = loop;
- }
-
- virtual ir_loop_jump *clone(void *mem_ctx, struct hash_table *) const;
-
- virtual void accept(ir_visitor *v)
- {
- v->visit(this);
- }
-
- virtual ir_visitor_status accept(ir_hierarchical_visitor *);
-
- bool is_break() const
- {
- return mode == jump_break;
- }
-
- bool is_continue() const
- {
- return mode == jump_continue;
- }
-
- /** Mode selector for the jump instruction. */
- enum jump_mode mode;
-private:
- /** Loop containing this break instruction. */
- ir_loop *loop;
-};
-
-/**
- * IR instruction representing discard statements.
- */
-class ir_discard : public ir_jump {
-public:
- ir_discard()
- {
- this->ir_type = ir_type_discard;
- this->condition = NULL;
- }
-
- ir_discard(ir_rvalue *cond)
- {
- this->ir_type = ir_type_discard;
- this->condition = cond;
- }
-
- virtual ir_discard *clone(void *mem_ctx, struct hash_table *ht) const;
-
- virtual void accept(ir_visitor *v)
- {
- v->visit(this);
- }
-
- virtual ir_visitor_status accept(ir_hierarchical_visitor *);
-
- virtual ir_discard *as_discard()
- {
- return this;
- }
-
- ir_rvalue *condition;
-};
-/*@}*/
-
-
-/**
- * Texture sampling opcodes used in ir_texture
- */
-enum ir_texture_opcode {
- ir_tex, /**< Regular texture look-up */
- ir_txb, /**< Texture look-up with LOD bias */
- ir_txl, /**< Texture look-up with explicit LOD */
- ir_txd, /**< Texture look-up with partial derivatvies */
- ir_txf /**< Texel fetch with explicit LOD */
-};
-
-
-/**
- * IR instruction to sample a texture
- *
- * The specific form of the IR instruction depends on the \c mode value
- * selected from \c ir_texture_opcodes. In the printed IR, these will
- * appear as:
- *
- * Texel offset (0 or an expression)
- * | Projection divisor
- * | | Shadow comparitor
- * | | |
- * v v v
- * (tex <type> <sampler> <coordinate> 0 1 ( ))
- * (txb <type> <sampler> <coordinate> 0 1 ( ) <bias>)
- * (txl <type> <sampler> <coordinate> 0 1 ( ) <lod>)
- * (txd <type> <sampler> <coordinate> 0 1 ( ) (dPdx dPdy))
- * (txf <type> <sampler> <coordinate> 0 <lod>)
- */
-class ir_texture : public ir_rvalue {
-public:
- ir_texture(enum ir_texture_opcode op)
- : op(op), projector(NULL), shadow_comparitor(NULL), offset(NULL)
- {
- this->ir_type = ir_type_texture;
- }
-
- virtual ir_texture *clone(void *mem_ctx, struct hash_table *) const;
-
- virtual ir_constant *constant_expression_value();
-
- virtual void accept(ir_visitor *v)
- {
- v->visit(this);
- }
-
- virtual ir_visitor_status accept(ir_hierarchical_visitor *);
-
- /**
- * Return a string representing the ir_texture_opcode.
- */
- const char *opcode_string();
-
- /** Set the sampler and type. */
- void set_sampler(ir_dereference *sampler, const glsl_type *type);
-
- /**
- * Do a reverse-lookup to translate a string into an ir_texture_opcode.
- */
- static ir_texture_opcode get_opcode(const char *);
-
- enum ir_texture_opcode op;
-
- /** Sampler to use for the texture access. */
- ir_dereference *sampler;
-
- /** Texture coordinate to sample */
- ir_rvalue *coordinate;
-
- /**
- * Value used for projective divide.
- *
- * If there is no projective divide (the common case), this will be
- * \c NULL. Optimization passes should check for this to point to a constant
- * of 1.0 and replace that with \c NULL.
- */
- ir_rvalue *projector;
-
- /**
- * Coordinate used for comparison on shadow look-ups.
- *
- * If there is no shadow comparison, this will be \c NULL. For the
- * \c ir_txf opcode, this *must* be \c NULL.
- */
- ir_rvalue *shadow_comparitor;
-
- /** Texel offset. */
- ir_rvalue *offset;
-
- union {
- ir_rvalue *lod; /**< Floating point LOD */
- ir_rvalue *bias; /**< Floating point LOD bias */
- struct {
- ir_rvalue *dPdx; /**< Partial derivative of coordinate wrt X */
- ir_rvalue *dPdy; /**< Partial derivative of coordinate wrt Y */
- } grad;
- } lod_info;
-};
-
-
-struct ir_swizzle_mask {
- unsigned x:2;
- unsigned y:2;
- unsigned z:2;
- unsigned w:2;
-
- /**
- * Number of components in the swizzle.
- */
- unsigned num_components:3;
-
- /**
- * Does the swizzle contain duplicate components?
- *
- * L-value swizzles cannot contain duplicate components.
- */
- unsigned has_duplicates:1;
-};
-
-
-class ir_swizzle : public ir_rvalue {
-public:
- ir_swizzle(ir_rvalue *, unsigned x, unsigned y, unsigned z, unsigned w,
- unsigned count);
-
- ir_swizzle(ir_rvalue *val, const unsigned *components, unsigned count);
-
- ir_swizzle(ir_rvalue *val, ir_swizzle_mask mask);
-
- virtual ir_swizzle *clone(void *mem_ctx, struct hash_table *) const;
-
- virtual ir_constant *constant_expression_value();
-
- virtual ir_swizzle *as_swizzle()
- {
- return this;
- }
-
- /**
- * Construct an ir_swizzle from the textual representation. Can fail.
- */
- static ir_swizzle *create(ir_rvalue *, const char *, unsigned vector_length);
-
- virtual void accept(ir_visitor *v)
- {
- v->visit(this);
- }
-
- virtual ir_visitor_status accept(ir_hierarchical_visitor *);
-
- bool is_lvalue()
- {
- return val->is_lvalue() && !mask.has_duplicates;
- }
-
- /**
- * Get the variable that is ultimately referenced by an r-value
- */
- virtual ir_variable *variable_referenced();
-
- ir_rvalue *val;
- ir_swizzle_mask mask;
-
-private:
- /**
- * Initialize the mask component of a swizzle
- *
- * This is used by the \c ir_swizzle constructors.
- */
- void init_mask(const unsigned *components, unsigned count);
-};
-
-
-class ir_dereference : public ir_rvalue {
-public:
- virtual ir_dereference *clone(void *mem_ctx, struct hash_table *) const = 0;
-
- virtual ir_dereference *as_dereference()
- {
- return this;
- }
-
- bool is_lvalue();
-
- /**
- * Get the variable that is ultimately referenced by an r-value
- */
- virtual ir_variable *variable_referenced() = 0;
-};
-
-
-class ir_dereference_variable : public ir_dereference {
-public:
- ir_dereference_variable(ir_variable *var);
-
- virtual ir_dereference_variable *clone(void *mem_ctx,
- struct hash_table *) const;
-
- virtual ir_constant *constant_expression_value();
-
- virtual ir_dereference_variable *as_dereference_variable()
- {
- return this;
- }
-
- /**
- * Get the variable that is ultimately referenced by an r-value
- */
- virtual ir_variable *variable_referenced()
- {
- return this->var;
- }
-
- virtual ir_variable *whole_variable_referenced()
- {
- /* ir_dereference_variable objects always dereference the entire
- * variable. However, if this dereference is dereferenced by anything
- * else, the complete deferefernce chain is not a whole-variable
- * dereference. This method should only be called on the top most
- * ir_rvalue in a dereference chain.
- */
- return this->var;
- }
-
- virtual void accept(ir_visitor *v)
- {
- v->visit(this);
- }
-
- virtual ir_visitor_status accept(ir_hierarchical_visitor *);
-
- /**
- * Object being dereferenced.
- */
- ir_variable *var;
-};
-
-
-class ir_dereference_array : public ir_dereference {
-public:
- ir_dereference_array(ir_rvalue *value, ir_rvalue *array_index);
-
- ir_dereference_array(ir_variable *var, ir_rvalue *array_index);
-
- virtual ir_dereference_array *clone(void *mem_ctx,
- struct hash_table *) const;
-
- virtual ir_constant *constant_expression_value();
-
- virtual ir_dereference_array *as_dereference_array()
- {
- return this;
- }
-
- /**
- * Get the variable that is ultimately referenced by an r-value
- */
- virtual ir_variable *variable_referenced()
- {
- return this->array->variable_referenced();
- }
-
- virtual void accept(ir_visitor *v)
- {
- v->visit(this);
- }
-
- virtual ir_visitor_status accept(ir_hierarchical_visitor *);
-
- ir_rvalue *array;
- ir_rvalue *array_index;
-
-private:
- void set_array(ir_rvalue *value);
-};
-
-
-class ir_dereference_record : public ir_dereference {
-public:
- ir_dereference_record(ir_rvalue *value, const char *field);
-
- ir_dereference_record(ir_variable *var, const char *field);
-
- virtual ir_dereference_record *clone(void *mem_ctx,
- struct hash_table *) const;
-
- virtual ir_constant *constant_expression_value();
-
- /**
- * Get the variable that is ultimately referenced by an r-value
- */
- virtual ir_variable *variable_referenced()
- {
- return this->record->variable_referenced();
- }
-
- virtual void accept(ir_visitor *v)
- {
- v->visit(this);
- }
-
- virtual ir_visitor_status accept(ir_hierarchical_visitor *);
-
- ir_rvalue *record;
- const char *field;
-};
-
-
-/**
- * Data stored in an ir_constant
- */
-union ir_constant_data {
- unsigned u[16];
- int i[16];
- float f[16];
- bool b[16];
-};
-
-
-class ir_constant : public ir_rvalue {
-public:
- ir_constant(const struct glsl_type *type, const ir_constant_data *data);
- ir_constant(bool b);
- ir_constant(unsigned int u);
- ir_constant(int i);
- ir_constant(float f);
-
- /**
- * Construct an ir_constant from a list of ir_constant values
- */
- ir_constant(const struct glsl_type *type, exec_list *values);
-
- /**
- * Construct an ir_constant from a scalar component of another ir_constant
- *
- * The new \c ir_constant inherits the type of the component from the
- * source constant.
- *
- * \note
- * In the case of a matrix constant, the new constant is a scalar, \b not
- * a vector.
- */
- ir_constant(const ir_constant *c, unsigned i);
-
- /**
- * Return a new ir_constant of the specified type containing all zeros.
- */
- static ir_constant *zero(void *mem_ctx, const glsl_type *type);
-
- virtual ir_constant *clone(void *mem_ctx, struct hash_table *) const;
-
- virtual ir_constant *constant_expression_value();
-
- virtual ir_constant *as_constant()
- {
- return this;
- }
-
- virtual void accept(ir_visitor *v)
- {
- v->visit(this);
- }
-
- virtual ir_visitor_status accept(ir_hierarchical_visitor *);
-
- /**
- * Get a particular component of a constant as a specific type
- *
- * This is useful, for example, to get a value from an integer constant
- * as a float or bool. This appears frequently when constructors are
- * called with all constant parameters.
- */
- /*@{*/
- bool get_bool_component(unsigned i) const;
- float get_float_component(unsigned i) const;
- int get_int_component(unsigned i) const;
- unsigned get_uint_component(unsigned i) const;
- /*@}*/
-
- ir_constant *get_array_element(unsigned i) const;
-
- ir_constant *get_record_field(const char *name);
-
- /**
- * Determine whether a constant has the same value as another constant
- *
- * \sa ir_constant::is_zero, ir_constant::is_one,
- * ir_constant::is_negative_one
- */
- bool has_value(const ir_constant *) const;
-
- virtual bool is_zero() const;
- virtual bool is_one() const;
- virtual bool is_negative_one() const;
-
- /**
- * Value of the constant.
- *
- * The field used to back the values supplied by the constant is determined
- * by the type associated with the \c ir_instruction. Constants may be
- * scalars, vectors, or matrices.
- */
- union ir_constant_data value;
-
- /* Array elements */
- ir_constant **array_elements;
-
- /* Structure fields */
- exec_list components;
-
-private:
- /**
- * Parameterless constructor only used by the clone method
- */
- ir_constant(void);
-};
-
-/*@}*/
-
-/**
- * Apply a visitor to each IR node in a list
- */
-void
-visit_exec_list(exec_list *list, ir_visitor *visitor);
-
-/**
- * Validate invariants on each IR node in a list
- */
-void validate_ir_tree(exec_list *instructions);
-
-/**
- * Make a clone of each IR instruction in a list
- *
- * \param in List of IR instructions that are to be cloned
- * \param out List to hold the cloned instructions
- */
-void
-clone_ir_list(void *mem_ctx, exec_list *out, const exec_list *in);
-
-extern void
-_mesa_glsl_initialize_variables(exec_list *instructions,
- struct _mesa_glsl_parse_state *state);
-
-extern void
-_mesa_glsl_initialize_functions(_mesa_glsl_parse_state *state);
-
-extern void
-_mesa_glsl_release_functions(void);
-
-extern void
-reparent_ir(exec_list *list, void *mem_ctx);
-
-struct glsl_symbol_table;
-
-extern void
-import_prototypes(const exec_list *source, exec_list *dest,
- struct glsl_symbol_table *symbols, void *mem_ctx);
-
-extern bool
-ir_has_call(ir_instruction *ir);
-
-extern void
-do_set_program_inouts(exec_list *instructions, struct gl_program *prog);
-
-#endif /* IR_H */
+/* -*- c++ -*- */
+/*
+ * Copyright © 2010 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+#pragma once
+#ifndef IR_H
+#define IR_H
+
+#include <stdio.h>
+#include <stdlib.h>
+
+#include "ralloc.h"
+#include "glsl_types.h"
+#include "list.h"
+#include "ir_visitor.h"
+#include "ir_hierarchical_visitor.h"
+
+/**
+ * \defgroup IR Intermediate representation nodes
+ *
+ * @{
+ */
+
+/**
+ * Class tags
+ *
+ * Each concrete class derived from \c ir_instruction has a value in this
+ * enumerant. The value for the type is stored in \c ir_instruction::ir_type
+ * by the constructor. While using type tags is not very C++, it is extremely
+ * convenient. For example, during debugging you can simply inspect
+ * \c ir_instruction::ir_type to find out the actual type of the object.
+ *
+ * In addition, it is possible to use a switch-statement based on \c
+ * \c ir_instruction::ir_type to select different behavior for different object
+ * types. For functions that have only slight differences for several object
+ * types, this allows writing very straightforward, readable code.
+ */
+enum ir_node_type {
+ /**
+ * Zero is unused so that the IR validator can detect cases where
+ * \c ir_instruction::ir_type has not been initialized.
+ */
+ ir_type_unset,
+ ir_type_variable,
+ ir_type_assignment,
+ ir_type_call,
+ ir_type_constant,
+ ir_type_dereference_array,
+ ir_type_dereference_record,
+ ir_type_dereference_variable,
+ ir_type_discard,
+ ir_type_expression,
+ ir_type_function,
+ ir_type_function_signature,
+ ir_type_if,
+ ir_type_loop,
+ ir_type_loop_jump,
+ ir_type_return,
+ ir_type_swizzle,
+ ir_type_texture,
+ ir_type_max /**< maximum ir_type enum number, for validation */
+};
+
+/**
+ * Base class of all IR instructions
+ */
+class ir_instruction : public exec_node {
+public:
+ enum ir_node_type ir_type;
+ const struct glsl_type *type;
+
+ /** ir_print_visitor helper for debugging. */
+ void print(void) const;
+
+ virtual void accept(ir_visitor *) = 0;
+ virtual ir_visitor_status accept(ir_hierarchical_visitor *) = 0;
+ virtual ir_instruction *clone(void *mem_ctx,
+ struct hash_table *ht) const = 0;
+
+ /**
+ * \name IR instruction downcast functions
+ *
+ * These functions either cast the object to a derived class or return
+ * \c NULL if the object's type does not match the specified derived class.
+ * Additional downcast functions will be added as needed.
+ */
+ /*@{*/
+ virtual class ir_variable * as_variable() { return NULL; }
+ virtual class ir_function * as_function() { return NULL; }
+ virtual class ir_dereference * as_dereference() { return NULL; }
+ virtual class ir_dereference_array * as_dereference_array() { return NULL; }
+ virtual class ir_dereference_variable *as_dereference_variable() { return NULL; }
+ virtual class ir_expression * as_expression() { return NULL; }
+ virtual class ir_rvalue * as_rvalue() { return NULL; }
+ virtual class ir_loop * as_loop() { return NULL; }
+ virtual class ir_assignment * as_assignment() { return NULL; }
+ virtual class ir_call * as_call() { return NULL; }
+ virtual class ir_return * as_return() { return NULL; }
+ virtual class ir_if * as_if() { return NULL; }
+ virtual class ir_swizzle * as_swizzle() { return NULL; }
+ virtual class ir_constant * as_constant() { return NULL; }
+ virtual class ir_discard * as_discard() { return NULL; }
+ /*@}*/
+
+protected:
+ ir_instruction()
+ {
+ ir_type = ir_type_unset;
+ type = NULL;
+ }
+};
+
+
+class ir_rvalue : public ir_instruction {
+public:
+ virtual ir_rvalue *clone(void *mem_ctx, struct hash_table *) const = 0;
+
+ virtual ir_constant *constant_expression_value() = 0;
+
+ virtual ir_rvalue * as_rvalue()
+ {
+ return this;
+ }
+
+ ir_rvalue *as_rvalue_to_saturate();
+
+ virtual bool is_lvalue()
+ {
+ return false;
+ }
+
+ /**
+ * Get the variable that is ultimately referenced by an r-value
+ */
+ virtual ir_variable *variable_referenced()
+ {
+ return NULL;
+ }
+
+
+ /**
+ * If an r-value is a reference to a whole variable, get that variable
+ *
+ * \return
+ * Pointer to a variable that is completely dereferenced by the r-value. If
+ * the r-value is not a dereference or the dereference does not access the
+ * entire variable (i.e., it's just one array element, struct field), \c NULL
+ * is returned.
+ */
+ virtual ir_variable *whole_variable_referenced()
+ {
+ return NULL;
+ }
+
+ /**
+ * Determine if an r-value has the value zero
+ *
+ * The base implementation of this function always returns \c false. The
+ * \c ir_constant class over-rides this function to return \c true \b only
+ * for vector and scalar types that have all elements set to the value
+ * zero (or \c false for booleans).
+ *
+ * \sa ir_constant::has_value, ir_rvalue::is_one, ir_rvalue::is_negative_one
+ */
+ virtual bool is_zero() const;
+
+ /**
+ * Determine if an r-value has the value one
+ *
+ * The base implementation of this function always returns \c false. The
+ * \c ir_constant class over-rides this function to return \c true \b only
+ * for vector and scalar types that have all elements set to the value
+ * one (or \c true for booleans).
+ *
+ * \sa ir_constant::has_value, ir_rvalue::is_zero, ir_rvalue::is_negative_one
+ */
+ virtual bool is_one() const;
+
+ /**
+ * Determine if an r-value has the value negative one
+ *
+ * The base implementation of this function always returns \c false. The
+ * \c ir_constant class over-rides this function to return \c true \b only
+ * for vector and scalar types that have all elements set to the value
+ * negative one. For boolean times, the result is always \c false.
+ *
+ * \sa ir_constant::has_value, ir_rvalue::is_zero, ir_rvalue::is_one
+ */
+ virtual bool is_negative_one() const;
+
+protected:
+ ir_rvalue();
+};
+
+
+/**
+ * Variable storage classes
+ */
+enum ir_variable_mode {
+ ir_var_auto = 0, /**< Function local variables and globals. */
+ ir_var_uniform, /**< Variable declared as a uniform. */
+ ir_var_in,
+ ir_var_out,
+ ir_var_inout,
+ ir_var_const_in, /**< "in" param that must be a constant expression */
+ ir_var_system_value, /**< Ex: front-face, instance-id, etc. */
+ ir_var_temporary /**< Temporary variable generated during compilation. */
+};
+
+enum ir_variable_interpolation {
+ ir_var_smooth = 0,
+ ir_var_flat,
+ ir_var_noperspective
+};
+
+/**
+ * \brief Layout qualifiers for gl_FragDepth.
+ *
+ * The AMD_conservative_depth extension allows gl_FragDepth to be redeclared
+ * with a layout qualifier.
+ */
+enum ir_depth_layout {
+ ir_depth_layout_none, /**< No depth layout is specified. */
+ ir_depth_layout_any,
+ ir_depth_layout_greater,
+ ir_depth_layout_less,
+ ir_depth_layout_unchanged
+};
+
+/**
+ * \brief Convert depth layout qualifier to string.
+ */
+const char*
+depth_layout_string(ir_depth_layout layout);
+
+/**
+ * Description of built-in state associated with a uniform
+ *
+ * \sa ir_variable::state_slots
+ */
+struct ir_state_slot {
+ int tokens[5];
+ int swizzle;
+};
+
+class ir_variable : public ir_instruction {
+public:
+ ir_variable(const struct glsl_type *, const char *, ir_variable_mode);
+
+ virtual ir_variable *clone(void *mem_ctx, struct hash_table *ht) const;
+
+ virtual ir_variable *as_variable()
+ {
+ return this;
+ }
+
+ virtual void accept(ir_visitor *v)
+ {
+ v->visit(this);
+ }
+
+ virtual ir_visitor_status accept(ir_hierarchical_visitor *);
+
+
+ /**
+ * Get the string value for the interpolation qualifier
+ *
+ * \return The string that would be used in a shader to specify \c
+ * mode will be returned.
+ *
+ * This function should only be used on a shader input or output variable.
+ */
+ const char *interpolation_string() const;
+
+ /**
+ * Calculate the number of slots required to hold this variable
+ *
+ * This is used to determine how many uniform or varying locations a variable
+ * occupies. The count is in units of floating point components.
+ */
+ unsigned component_slots() const;
+
+ /**
+ * Delcared name of the variable
+ */
+ const char *name;
+
+ /**
+ * Highest element accessed with a constant expression array index
+ *
+ * Not used for non-array variables.
+ */
+ unsigned max_array_access;
+
+ /**
+ * Is the variable read-only?
+ *
+ * This is set for variables declared as \c const, shader inputs,
+ * and uniforms.
+ */
+ unsigned read_only:1;
+ unsigned centroid:1;
+ unsigned invariant:1;
+
+ /**
+ * Has this variable been used for reading or writing?
+ *
+ * Several GLSL semantic checks require knowledge of whether or not a
+ * variable has been used. For example, it is an error to redeclare a
+ * variable as invariant after it has been used.
+ */
+ unsigned used:1;
+
+ /**
+ * Storage class of the variable.
+ *
+ * \sa ir_variable_mode
+ */
+ unsigned mode:3;
+
+ /**
+ * Interpolation mode for shader inputs / outputs
+ *
+ * \sa ir_variable_interpolation
+ */
+ unsigned interpolation:2;
+
+ /**
+ * Flag that the whole array is assignable
+ *
+ * In GLSL 1.20 and later whole arrays are assignable (and comparable for
+ * equality). This flag enables this behavior.
+ */
+ unsigned array_lvalue:1;
+
+ /**
+ * \name ARB_fragment_coord_conventions
+ * @{
+ */
+ unsigned origin_upper_left:1;
+ unsigned pixel_center_integer:1;
+ /*@}*/
+
+ /**
+ * \brief Layout qualifier for gl_FragDepth.
+ *
+ * This is not equal to \c ir_depth_layout_none if and only if this
+ * variable is \c gl_FragDepth and a layout qualifier is specified.
+ */
+ ir_depth_layout depth_layout;
+
+ /**
+ * Was the location explicitly set in the shader?
+ *
+ * If the location is explicitly set in the shader, it \b cannot be changed
+ * by the linker or by the API (e.g., calls to \c glBindAttribLocation have
+ * no effect).
+ */
+ unsigned explicit_location:1;
+
+ /**
+ * Storage location of the base of this variable
+ *
+ * The precise meaning of this field depends on the nature of the variable.
+ *
+ * - Vertex shader input: one of the values from \c gl_vert_attrib.
+ * - Vertex shader output: one of the values from \c gl_vert_result.
+ * - Fragment shader input: one of the values from \c gl_frag_attrib.
+ * - Fragment shader output: one of the values from \c gl_frag_result.
+ * - Uniforms: Per-stage uniform slot number.
+ * - Other: This field is not currently used.
+ *
+ * If the variable is a uniform, shader input, or shader output, and the
+ * slot has not been assigned, the value will be -1.
+ */
+ int location;
+
+ /**
+ * Built-in state that backs this uniform
+ *
+ * Once set at variable creation, \c state_slots must remain invariant.
+ * This is because, ideally, this array would be shared by all clones of
+ * this variable in the IR tree. In other words, we'd really like for it
+ * to be a fly-weight.
+ *
+ * If the variable is not a uniform, \c num_state_slots will be zero and
+ * \c state_slots will be \c NULL.
+ */
+ /*@{*/
+ unsigned num_state_slots; /**< Number of state slots used */
+ ir_state_slot *state_slots; /**< State descriptors. */
+ /*@}*/
+
+ /**
+ * Emit a warning if this variable is accessed.
+ */
+ const char *warn_extension;
+
+ /**
+ * Value assigned in the initializer of a variable declared "const"
+ */
+ ir_constant *constant_value;
+};
+
+
+/*@{*/
+/**
+ * The representation of a function instance; may be the full definition or
+ * simply a prototype.
+ */
+class ir_function_signature : public ir_instruction {
+ /* An ir_function_signature will be part of the list of signatures in
+ * an ir_function.
+ */
+public:
+ ir_function_signature(const glsl_type *return_type);
+
+ virtual ir_function_signature *clone(void *mem_ctx,
+ struct hash_table *ht) const;
+ ir_function_signature *clone_prototype(void *mem_ctx,
+ struct hash_table *ht) const;
+
+ virtual void accept(ir_visitor *v)
+ {
+ v->visit(this);
+ }
+
+ virtual ir_visitor_status accept(ir_hierarchical_visitor *);
+
+ /**
+ * Get the name of the function for which this is a signature
+ */
+ const char *function_name() const;
+
+ /**
+ * Get a handle to the function for which this is a signature
+ *
+ * There is no setter function, this function returns a \c const pointer,
+ * and \c ir_function_signature::_function is private for a reason. The
+ * only way to make a connection between a function and function signature
+ * is via \c ir_function::add_signature. This helps ensure that certain
+ * invariants (i.e., a function signature is in the list of signatures for
+ * its \c _function) are met.
+ *
+ * \sa ir_function::add_signature
+ */
+ inline const class ir_function *function() const
+ {
+ return this->_function;
+ }
+
+ /**
+ * Check whether the qualifiers match between this signature's parameters
+ * and the supplied parameter list. If not, returns the name of the first
+ * parameter with mismatched qualifiers (for use in error messages).
+ */
+ const char *qualifiers_match(exec_list *params);
+
+ /**
+ * Replace the current parameter list with the given one. This is useful
+ * if the current information came from a prototype, and either has invalid
+ * or missing parameter names.
+ */
+ void replace_parameters(exec_list *new_params);
+
+ /**
+ * Function return type.
+ *
+ * \note This discards the optional precision qualifier.
+ */
+ const struct glsl_type *return_type;
+
+ /**
+ * List of ir_variable of function parameters.
+ *
+ * This represents the storage. The paramaters passed in a particular
+ * call will be in ir_call::actual_paramaters.
+ */
+ struct exec_list parameters;
+
+ /** Whether or not this function has a body (which may be empty). */
+ unsigned is_defined:1;
+
+ /** Whether or not this function signature is a built-in. */
+ unsigned is_builtin:1;
+
+ /** Body of instructions in the function. */
+ struct exec_list body;
+
+private:
+ /** Function of which this signature is one overload. */
+ class ir_function *_function;
+
+ friend class ir_function;
+};
+
+
+/**
+ * Header for tracking multiple overloaded functions with the same name.
+ * Contains a list of ir_function_signatures representing each of the
+ * actual functions.
+ */
+class ir_function : public ir_instruction {
+public:
+ ir_function(const char *name);
+
+ virtual ir_function *clone(void *mem_ctx, struct hash_table *ht) const;
+
+ virtual ir_function *as_function()
+ {
+ return this;
+ }
+
+ virtual void accept(ir_visitor *v)
+ {
+ v->visit(this);
+ }
+
+ virtual ir_visitor_status accept(ir_hierarchical_visitor *);
+
+ void add_signature(ir_function_signature *sig)
+ {
+ sig->_function = this;
+ this->signatures.push_tail(sig);
+ }
+
+ /**
+ * Get an iterator for the set of function signatures
+ */
+ exec_list_iterator iterator()
+ {
+ return signatures.iterator();
+ }
+
+ /**
+ * Find a signature that matches a set of actual parameters, taking implicit
+ * conversions into account.
+ */
+ ir_function_signature *matching_signature(const exec_list *actual_param);
+
+ /**
+ * Find a signature that exactly matches a set of actual parameters without
+ * any implicit type conversions.
+ */
+ ir_function_signature *exact_matching_signature(const exec_list *actual_ps);
+
+ /**
+ * Name of the function.
+ */
+ const char *name;
+
+ /** Whether or not this function has a signature that isn't a built-in. */
+ bool has_user_signature();
+
+ /**
+ * List of ir_function_signature for each overloaded function with this name.
+ */
+ struct exec_list signatures;
+};
+
+inline const char *ir_function_signature::function_name() const
+{
+ return this->_function->name;
+}
+/*@}*/
+
+
+/**
+ * IR instruction representing high-level if-statements
+ */
+class ir_if : public ir_instruction {
+public:
+ ir_if(ir_rvalue *condition)
+ : condition(condition)
+ {
+ ir_type = ir_type_if;
+ }
+
+ virtual ir_if *clone(void *mem_ctx, struct hash_table *ht) const;
+
+ virtual ir_if *as_if()
+ {
+ return this;
+ }
+
+ virtual void accept(ir_visitor *v)
+ {
+ v->visit(this);
+ }
+
+ virtual ir_visitor_status accept(ir_hierarchical_visitor *);
+
+ ir_rvalue *condition;
+ /** List of ir_instruction for the body of the then branch */
+ exec_list then_instructions;
+ /** List of ir_instruction for the body of the else branch */
+ exec_list else_instructions;
+};
+
+
+/**
+ * IR instruction representing a high-level loop structure.
+ */
+class ir_loop : public ir_instruction {
+public:
+ ir_loop();
+
+ virtual ir_loop *clone(void *mem_ctx, struct hash_table *ht) const;
+
+ virtual void accept(ir_visitor *v)
+ {
+ v->visit(this);
+ }
+
+ virtual ir_visitor_status accept(ir_hierarchical_visitor *);
+
+ virtual ir_loop *as_loop()
+ {
+ return this;
+ }
+
+ /**
+ * Get an iterator for the instructions of the loop body
+ */
+ exec_list_iterator iterator()
+ {
+ return body_instructions.iterator();
+ }
+
+ /** List of ir_instruction that make up the body of the loop. */
+ exec_list body_instructions;
+
+ /**
+ * \name Loop counter and controls
+ *
+ * Represents a loop like a FORTRAN \c do-loop.
+ *
+ * \note
+ * If \c from and \c to are the same value, the loop will execute once.
+ */
+ /*@{*/
+ ir_rvalue *from; /** Value of the loop counter on the first
+ * iteration of the loop.
+ */
+ ir_rvalue *to; /** Value of the loop counter on the last
+ * iteration of the loop.
+ */
+ ir_rvalue *increment;
+ ir_variable *counter;
+
+ /**
+ * Comparison operation in the loop terminator.
+ *
+ * If any of the loop control fields are non-\c NULL, this field must be
+ * one of \c ir_binop_less, \c ir_binop_greater, \c ir_binop_lequal,
+ * \c ir_binop_gequal, \c ir_binop_equal, or \c ir_binop_nequal.
+ */
+ int cmp;
+ /*@}*/
+};
+
+
+class ir_assignment : public ir_instruction {
+public:
+ ir_assignment(ir_rvalue *lhs, ir_rvalue *rhs, ir_rvalue *condition);
+
+ /**
+ * Construct an assignment with an explicit write mask
+ *
+ * \note
+ * Since a write mask is supplied, the LHS must already be a bare
+ * \c ir_dereference. The cannot be any swizzles in the LHS.
+ */
+ ir_assignment(ir_dereference *lhs, ir_rvalue *rhs, ir_rvalue *condition,
+ unsigned write_mask);
+
+ virtual ir_assignment *clone(void *mem_ctx, struct hash_table *ht) const;
+
+ virtual ir_constant *constant_expression_value();
+
+ virtual void accept(ir_visitor *v)
+ {
+ v->visit(this);
+ }
+
+ virtual ir_visitor_status accept(ir_hierarchical_visitor *);
+
+ virtual ir_assignment * as_assignment()
+ {
+ return this;
+ }
+
+ /**
+ * Get a whole variable written by an assignment
+ *
+ * If the LHS of the assignment writes a whole variable, the variable is
+ * returned. Otherwise \c NULL is returned. Examples of whole-variable
+ * assignment are:
+ *
+ * - Assigning to a scalar
+ * - Assigning to all components of a vector
+ * - Whole array (or matrix) assignment
+ * - Whole structure assignment
+ */
+ ir_variable *whole_variable_written();
+
+ /**
+ * Set the LHS of an assignment
+ */
+ void set_lhs(ir_rvalue *lhs);
+
+ /**
+ * Left-hand side of the assignment.
+ *
+ * This should be treated as read only. If you need to set the LHS of an
+ * assignment, use \c ir_assignment::set_lhs.
+ */
+ ir_dereference *lhs;
+
+ /**
+ * Value being assigned
+ */
+ ir_rvalue *rhs;
+
+ /**
+ * Optional condition for the assignment.
+ */
+ ir_rvalue *condition;
+
+
+ /**
+ * Component mask written
+ *
+ * For non-vector types in the LHS, this field will be zero. For vector
+ * types, a bit will be set for each component that is written. Note that
+ * for \c vec2 and \c vec3 types only the lower bits will ever be set.
+ *
+ * A partially-set write mask means that each enabled channel gets
+ * the value from a consecutive channel of the rhs. For example,
+ * to write just .xyw of gl_FrontColor with color:
+ *
+ * (assign (constant bool (1)) (xyw)
+ * (var_ref gl_FragColor)
+ * (swiz xyw (var_ref color)))
+ */
+ unsigned write_mask:4;
+};
+
+/* Update ir_expression::num_operands() and operator_strs when
+ * updating this list.
+ */
+enum ir_expression_operation {
+ ir_unop_bit_not,
+ ir_unop_logic_not,
+ ir_unop_neg,
+ ir_unop_abs,
+ ir_unop_sign,
+ ir_unop_rcp,
+ ir_unop_rsq,
+ ir_unop_sqrt,
+ ir_unop_exp, /**< Log base e on gentype */
+ ir_unop_log, /**< Natural log on gentype */
+ ir_unop_exp2,
+ ir_unop_log2,
+ ir_unop_f2i, /**< Float-to-integer conversion. */
+ ir_unop_i2f, /**< Integer-to-float conversion. */
+ ir_unop_f2b, /**< Float-to-boolean conversion */
+ ir_unop_b2f, /**< Boolean-to-float conversion */
+ ir_unop_i2b, /**< int-to-boolean conversion */
+ ir_unop_b2i, /**< Boolean-to-int conversion */
+ ir_unop_u2f, /**< Unsigned-to-float conversion. */
+ ir_unop_any,
+
+ /**
+ * \name Unary floating-point rounding operations.
+ */
+ /*@{*/
+ ir_unop_trunc,
+ ir_unop_ceil,
+ ir_unop_floor,
+ ir_unop_fract,
+ ir_unop_round_even,
+ /*@}*/
+
+ /**
+ * \name Trigonometric operations.
+ */
+ /*@{*/
+ ir_unop_sin,
+ ir_unop_cos,
+ ir_unop_sin_reduced, /**< Reduced range sin. [-pi, pi] */
+ ir_unop_cos_reduced, /**< Reduced range cos. [-pi, pi] */
+ /*@}*/
+
+ /**
+ * \name Partial derivatives.
+ */
+ /*@{*/
+ ir_unop_dFdx,
+ ir_unop_dFdy,
+ /*@}*/
+
+ ir_unop_noise,
+
+ /**
+ * A sentinel marking the last of the unary operations.
+ */
+ ir_last_unop = ir_unop_noise,
+
+ ir_binop_add,
+ ir_binop_sub,
+ ir_binop_mul,
+ ir_binop_div,
+
+ /**
+ * Takes one of two combinations of arguments:
+ *
+ * - mod(vecN, vecN)
+ * - mod(vecN, float)
+ *
+ * Does not take integer types.
+ */
+ ir_binop_mod,
+
+ /**
+ * \name Binary comparison operators which return a boolean vector.
+ * The type of both operands must be equal.
+ */
+ /*@{*/
+ ir_binop_less,
+ ir_binop_greater,
+ ir_binop_lequal,
+ ir_binop_gequal,
+ ir_binop_equal,
+ ir_binop_nequal,
+ /**
+ * Returns single boolean for whether all components of operands[0]
+ * equal the components of operands[1].
+ */
+ ir_binop_all_equal,
+ /**
+ * Returns single boolean for whether any component of operands[0]
+ * is not equal to the corresponding component of operands[1].
+ */
+ ir_binop_any_nequal,
+ /*@}*/
+
+ /**
+ * \name Bit-wise binary operations.
+ */
+ /*@{*/
+ ir_binop_lshift,
+ ir_binop_rshift,
+ ir_binop_bit_and,
+ ir_binop_bit_xor,
+ ir_binop_bit_or,
+ /*@}*/
+
+ ir_binop_logic_and,
+ ir_binop_logic_xor,
+ ir_binop_logic_or,
+
+ ir_binop_dot,
+ ir_binop_min,
+ ir_binop_max,
+
+ ir_binop_pow,
+
+ /**
+ * A sentinel marking the last of the binary operations.
+ */
+ ir_last_binop = ir_binop_pow,
+
+ ir_quadop_vector,
+
+ /**
+ * A sentinel marking the last of all operations.
+ */
+ ir_last_opcode = ir_last_binop
+};
+
+class ir_expression : public ir_rvalue {
+public:
+ /**
+ * Constructor for unary operation expressions
+ */
+ ir_expression(int op, const struct glsl_type *type, ir_rvalue *);
+ ir_expression(int op, ir_rvalue *);
+
+ /**
+ * Constructor for binary operation expressions
+ */
+ ir_expression(int op, const struct glsl_type *type,
+ ir_rvalue *, ir_rvalue *);
+ ir_expression(int op, ir_rvalue *op0, ir_rvalue *op1);
+
+ /**
+ * Constructor for quad operator expressions
+ */
+ ir_expression(int op, const struct glsl_type *type,
+ ir_rvalue *, ir_rvalue *, ir_rvalue *, ir_rvalue *);
+
+ virtual ir_expression *as_expression()
+ {
+ return this;
+ }
+
+ virtual ir_expression *clone(void *mem_ctx, struct hash_table *ht) const;
+
+ /**
+ * Attempt to constant-fold the expression
+ *
+ * If the expression cannot be constant folded, this method will return
+ * \c NULL.
+ */
+ virtual ir_constant *constant_expression_value();
+
+ /**
+ * Determine the number of operands used by an expression
+ */
+ static unsigned int get_num_operands(ir_expression_operation);
+
+ /**
+ * Determine the number of operands used by an expression
+ */
+ unsigned int get_num_operands() const
+ {
+ return (this->operation == ir_quadop_vector)
+ ? this->type->vector_elements : get_num_operands(operation);
+ }
+
+ /**
+ * Return a string representing this expression's operator.
+ */
+ const char *operator_string();
+
+ /**
+ * Return a string representing this expression's operator.
+ */
+ static const char *operator_string(ir_expression_operation);
+
+
+ /**
+ * Do a reverse-lookup to translate the given string into an operator.
+ */
+ static ir_expression_operation get_operator(const char *);
+
+ virtual void accept(ir_visitor *v)
+ {
+ v->visit(this);
+ }
+
+ virtual ir_visitor_status accept(ir_hierarchical_visitor *);
+
+ ir_expression_operation operation;
+ ir_rvalue *operands[4];
+};
+
+
+/**
+ * IR instruction representing a function call
+ */
+class ir_call : public ir_rvalue {
+public:
+ ir_call(ir_function_signature *callee, exec_list *actual_parameters)
+ : callee(callee)
+ {
+ ir_type = ir_type_call;
+ assert(callee->return_type != NULL);
+ type = callee->return_type;
+ actual_parameters->move_nodes_to(& this->actual_parameters);
+ }
+
+ virtual ir_call *clone(void *mem_ctx, struct hash_table *ht) const;
+
+ virtual ir_constant *constant_expression_value();
+
+ virtual ir_call *as_call()
+ {
+ return this;
+ }
+
+ virtual void accept(ir_visitor *v)
+ {
+ v->visit(this);
+ }
+
+ virtual ir_visitor_status accept(ir_hierarchical_visitor *);
+
+ /**
+ * Get a generic ir_call object when an error occurs
+ *
+ * Any allocation will be performed with 'ctx' as ralloc owner.
+ */
+ static ir_call *get_error_instruction(void *ctx);
+
+ /**
+ * Get an iterator for the set of acutal parameters
+ */
+ exec_list_iterator iterator()
+ {
+ return actual_parameters.iterator();
+ }
+
+ /**
+ * Get the name of the function being called.
+ */
+ const char *callee_name() const
+ {
+ return callee->function_name();
+ }
+
+ /**
+ * Get the function signature bound to this function call
+ */
+ ir_function_signature *get_callee()
+ {
+ return callee;
+ }
+
+ /**
+ * Set the function call target
+ */
+ void set_callee(ir_function_signature *sig);
+
+ /**
+ * Generates an inline version of the function before @ir,
+ * returning the return value of the function.
+ */
+ ir_rvalue *generate_inline(ir_instruction *ir);
+
+ /* List of ir_rvalue of paramaters passed in this call. */
+ exec_list actual_parameters;
+
+private:
+ ir_call()
+ : callee(NULL)
+ {
+ this->ir_type = ir_type_call;
+ }
+
+ ir_function_signature *callee;
+};
+
+
+/**
+ * \name Jump-like IR instructions.
+ *
+ * These include \c break, \c continue, \c return, and \c discard.
+ */
+/*@{*/
+class ir_jump : public ir_instruction {
+protected:
+ ir_jump()
+ {
+ ir_type = ir_type_unset;
+ }
+};
+
+class ir_return : public ir_jump {
+public:
+ ir_return()
+ : value(NULL)
+ {
+ this->ir_type = ir_type_return;
+ }
+
+ ir_return(ir_rvalue *value)
+ : value(value)
+ {
+ this->ir_type = ir_type_return;
+ }
+
+ virtual ir_return *clone(void *mem_ctx, struct hash_table *) const;
+
+ virtual ir_return *as_return()
+ {
+ return this;
+ }
+
+ ir_rvalue *get_value() const
+ {
+ return value;
+ }
+
+ virtual void accept(ir_visitor *v)
+ {
+ v->visit(this);
+ }
+
+ virtual ir_visitor_status accept(ir_hierarchical_visitor *);
+
+ ir_rvalue *value;
+};
+
+
+/**
+ * Jump instructions used inside loops
+ *
+ * These include \c break and \c continue. The \c break within a loop is
+ * different from the \c break within a switch-statement.
+ *
+ * \sa ir_switch_jump
+ */
+class ir_loop_jump : public ir_jump {
+public:
+ enum jump_mode {
+ jump_break,
+ jump_continue
+ };
+
+ ir_loop_jump(jump_mode mode)
+ {
+ this->ir_type = ir_type_loop_jump;
+ this->mode = mode;
+ this->loop = loop;
+ }
+
+ virtual ir_loop_jump *clone(void *mem_ctx, struct hash_table *) const;
+
+ virtual void accept(ir_visitor *v)
+ {
+ v->visit(this);
+ }
+
+ virtual ir_visitor_status accept(ir_hierarchical_visitor *);
+
+ bool is_break() const
+ {
+ return mode == jump_break;
+ }
+
+ bool is_continue() const
+ {
+ return mode == jump_continue;
+ }
+
+ /** Mode selector for the jump instruction. */
+ enum jump_mode mode;
+private:
+ /** Loop containing this break instruction. */
+ ir_loop *loop;
+};
+
+/**
+ * IR instruction representing discard statements.
+ */
+class ir_discard : public ir_jump {
+public:
+ ir_discard()
+ {
+ this->ir_type = ir_type_discard;
+ this->condition = NULL;
+ }
+
+ ir_discard(ir_rvalue *cond)
+ {
+ this->ir_type = ir_type_discard;
+ this->condition = cond;
+ }
+
+ virtual ir_discard *clone(void *mem_ctx, struct hash_table *ht) const;
+
+ virtual void accept(ir_visitor *v)
+ {
+ v->visit(this);
+ }
+
+ virtual ir_visitor_status accept(ir_hierarchical_visitor *);
+
+ virtual ir_discard *as_discard()
+ {
+ return this;
+ }
+
+ ir_rvalue *condition;
+};
+/*@}*/
+
+
+/**
+ * Texture sampling opcodes used in ir_texture
+ */
+enum ir_texture_opcode {
+ ir_tex, /**< Regular texture look-up */
+ ir_txb, /**< Texture look-up with LOD bias */
+ ir_txl, /**< Texture look-up with explicit LOD */
+ ir_txd, /**< Texture look-up with partial derivatvies */
+ ir_txf /**< Texel fetch with explicit LOD */
+};
+
+
+/**
+ * IR instruction to sample a texture
+ *
+ * The specific form of the IR instruction depends on the \c mode value
+ * selected from \c ir_texture_opcodes. In the printed IR, these will
+ * appear as:
+ *
+ * Texel offset (0 or an expression)
+ * | Projection divisor
+ * | | Shadow comparitor
+ * | | |
+ * v v v
+ * (tex <type> <sampler> <coordinate> 0 1 ( ))
+ * (txb <type> <sampler> <coordinate> 0 1 ( ) <bias>)
+ * (txl <type> <sampler> <coordinate> 0 1 ( ) <lod>)
+ * (txd <type> <sampler> <coordinate> 0 1 ( ) (dPdx dPdy))
+ * (txf <type> <sampler> <coordinate> 0 <lod>)
+ */
+class ir_texture : public ir_rvalue {
+public:
+ ir_texture(enum ir_texture_opcode op)
+ : op(op), projector(NULL), shadow_comparitor(NULL), offset(NULL)
+ {
+ this->ir_type = ir_type_texture;
+ }
+
+ virtual ir_texture *clone(void *mem_ctx, struct hash_table *) const;
+
+ virtual ir_constant *constant_expression_value();
+
+ virtual void accept(ir_visitor *v)
+ {
+ v->visit(this);
+ }
+
+ virtual ir_visitor_status accept(ir_hierarchical_visitor *);
+
+ /**
+ * Return a string representing the ir_texture_opcode.
+ */
+ const char *opcode_string();
+
+ /** Set the sampler and type. */
+ void set_sampler(ir_dereference *sampler, const glsl_type *type);
+
+ /**
+ * Do a reverse-lookup to translate a string into an ir_texture_opcode.
+ */
+ static ir_texture_opcode get_opcode(const char *);
+
+ enum ir_texture_opcode op;
+
+ /** Sampler to use for the texture access. */
+ ir_dereference *sampler;
+
+ /** Texture coordinate to sample */
+ ir_rvalue *coordinate;
+
+ /**
+ * Value used for projective divide.
+ *
+ * If there is no projective divide (the common case), this will be
+ * \c NULL. Optimization passes should check for this to point to a constant
+ * of 1.0 and replace that with \c NULL.
+ */
+ ir_rvalue *projector;
+
+ /**
+ * Coordinate used for comparison on shadow look-ups.
+ *
+ * If there is no shadow comparison, this will be \c NULL. For the
+ * \c ir_txf opcode, this *must* be \c NULL.
+ */
+ ir_rvalue *shadow_comparitor;
+
+ /** Texel offset. */
+ ir_rvalue *offset;
+
+ union {
+ ir_rvalue *lod; /**< Floating point LOD */
+ ir_rvalue *bias; /**< Floating point LOD bias */
+ struct {
+ ir_rvalue *dPdx; /**< Partial derivative of coordinate wrt X */
+ ir_rvalue *dPdy; /**< Partial derivative of coordinate wrt Y */
+ } grad;
+ } lod_info;
+};
+
+
+struct ir_swizzle_mask {
+ unsigned x:2;
+ unsigned y:2;
+ unsigned z:2;
+ unsigned w:2;
+
+ /**
+ * Number of components in the swizzle.
+ */
+ unsigned num_components:3;
+
+ /**
+ * Does the swizzle contain duplicate components?
+ *
+ * L-value swizzles cannot contain duplicate components.
+ */
+ unsigned has_duplicates:1;
+};
+
+
+class ir_swizzle : public ir_rvalue {
+public:
+ ir_swizzle(ir_rvalue *, unsigned x, unsigned y, unsigned z, unsigned w,
+ unsigned count);
+
+ ir_swizzle(ir_rvalue *val, const unsigned *components, unsigned count);
+
+ ir_swizzle(ir_rvalue *val, ir_swizzle_mask mask);
+
+ virtual ir_swizzle *clone(void *mem_ctx, struct hash_table *) const;
+
+ virtual ir_constant *constant_expression_value();
+
+ virtual ir_swizzle *as_swizzle()
+ {
+ return this;
+ }
+
+ /**
+ * Construct an ir_swizzle from the textual representation. Can fail.
+ */
+ static ir_swizzle *create(ir_rvalue *, const char *, unsigned vector_length);
+
+ virtual void accept(ir_visitor *v)
+ {
+ v->visit(this);
+ }
+
+ virtual ir_visitor_status accept(ir_hierarchical_visitor *);
+
+ bool is_lvalue()
+ {
+ return val->is_lvalue() && !mask.has_duplicates;
+ }
+
+ /**
+ * Get the variable that is ultimately referenced by an r-value
+ */
+ virtual ir_variable *variable_referenced();
+
+ ir_rvalue *val;
+ ir_swizzle_mask mask;
+
+private:
+ /**
+ * Initialize the mask component of a swizzle
+ *
+ * This is used by the \c ir_swizzle constructors.
+ */
+ void init_mask(const unsigned *components, unsigned count);
+};
+
+
+class ir_dereference : public ir_rvalue {
+public:
+ virtual ir_dereference *clone(void *mem_ctx, struct hash_table *) const = 0;
+
+ virtual ir_dereference *as_dereference()
+ {
+ return this;
+ }
+
+ bool is_lvalue();
+
+ /**
+ * Get the variable that is ultimately referenced by an r-value
+ */
+ virtual ir_variable *variable_referenced() = 0;
+};
+
+
+class ir_dereference_variable : public ir_dereference {
+public:
+ ir_dereference_variable(ir_variable *var);
+
+ virtual ir_dereference_variable *clone(void *mem_ctx,
+ struct hash_table *) const;
+
+ virtual ir_constant *constant_expression_value();
+
+ virtual ir_dereference_variable *as_dereference_variable()
+ {
+ return this;
+ }
+
+ /**
+ * Get the variable that is ultimately referenced by an r-value
+ */
+ virtual ir_variable *variable_referenced()
+ {
+ return this->var;
+ }
+
+ virtual ir_variable *whole_variable_referenced()
+ {
+ /* ir_dereference_variable objects always dereference the entire
+ * variable. However, if this dereference is dereferenced by anything
+ * else, the complete deferefernce chain is not a whole-variable
+ * dereference. This method should only be called on the top most
+ * ir_rvalue in a dereference chain.
+ */
+ return this->var;
+ }
+
+ virtual void accept(ir_visitor *v)
+ {
+ v->visit(this);
+ }
+
+ virtual ir_visitor_status accept(ir_hierarchical_visitor *);
+
+ /**
+ * Object being dereferenced.
+ */
+ ir_variable *var;
+};
+
+
+class ir_dereference_array : public ir_dereference {
+public:
+ ir_dereference_array(ir_rvalue *value, ir_rvalue *array_index);
+
+ ir_dereference_array(ir_variable *var, ir_rvalue *array_index);
+
+ virtual ir_dereference_array *clone(void *mem_ctx,
+ struct hash_table *) const;
+
+ virtual ir_constant *constant_expression_value();
+
+ virtual ir_dereference_array *as_dereference_array()
+ {
+ return this;
+ }
+
+ /**
+ * Get the variable that is ultimately referenced by an r-value
+ */
+ virtual ir_variable *variable_referenced()
+ {
+ return this->array->variable_referenced();
+ }
+
+ virtual void accept(ir_visitor *v)
+ {
+ v->visit(this);
+ }
+
+ virtual ir_visitor_status accept(ir_hierarchical_visitor *);
+
+ ir_rvalue *array;
+ ir_rvalue *array_index;
+
+private:
+ void set_array(ir_rvalue *value);
+};
+
+
+class ir_dereference_record : public ir_dereference {
+public:
+ ir_dereference_record(ir_rvalue *value, const char *field);
+
+ ir_dereference_record(ir_variable *var, const char *field);
+
+ virtual ir_dereference_record *clone(void *mem_ctx,
+ struct hash_table *) const;
+
+ virtual ir_constant *constant_expression_value();
+
+ /**
+ * Get the variable that is ultimately referenced by an r-value
+ */
+ virtual ir_variable *variable_referenced()
+ {
+ return this->record->variable_referenced();
+ }
+
+ virtual void accept(ir_visitor *v)
+ {
+ v->visit(this);
+ }
+
+ virtual ir_visitor_status accept(ir_hierarchical_visitor *);
+
+ ir_rvalue *record;
+ const char *field;
+};
+
+
+/**
+ * Data stored in an ir_constant
+ */
+union ir_constant_data {
+ unsigned u[16];
+ int i[16];
+ float f[16];
+ bool b[16];
+};
+
+
+class ir_constant : public ir_rvalue {
+public:
+ ir_constant(const struct glsl_type *type, const ir_constant_data *data);
+ ir_constant(bool b);
+ ir_constant(unsigned int u);
+ ir_constant(int i);
+ ir_constant(float f);
+
+ /**
+ * Construct an ir_constant from a list of ir_constant values
+ */
+ ir_constant(const struct glsl_type *type, exec_list *values);
+
+ /**
+ * Construct an ir_constant from a scalar component of another ir_constant
+ *
+ * The new \c ir_constant inherits the type of the component from the
+ * source constant.
+ *
+ * \note
+ * In the case of a matrix constant, the new constant is a scalar, \b not
+ * a vector.
+ */
+ ir_constant(const ir_constant *c, unsigned i);
+
+ /**
+ * Return a new ir_constant of the specified type containing all zeros.
+ */
+ static ir_constant *zero(void *mem_ctx, const glsl_type *type);
+
+ virtual ir_constant *clone(void *mem_ctx, struct hash_table *) const;
+
+ virtual ir_constant *constant_expression_value();
+
+ virtual ir_constant *as_constant()
+ {
+ return this;
+ }
+
+ virtual void accept(ir_visitor *v)
+ {
+ v->visit(this);
+ }
+
+ virtual ir_visitor_status accept(ir_hierarchical_visitor *);
+
+ /**
+ * Get a particular component of a constant as a specific type
+ *
+ * This is useful, for example, to get a value from an integer constant
+ * as a float or bool. This appears frequently when constructors are
+ * called with all constant parameters.
+ */
+ /*@{*/
+ bool get_bool_component(unsigned i) const;
+ float get_float_component(unsigned i) const;
+ int get_int_component(unsigned i) const;
+ unsigned get_uint_component(unsigned i) const;
+ /*@}*/
+
+ ir_constant *get_array_element(unsigned i) const;
+
+ ir_constant *get_record_field(const char *name);
+
+ /**
+ * Determine whether a constant has the same value as another constant
+ *
+ * \sa ir_constant::is_zero, ir_constant::is_one,
+ * ir_constant::is_negative_one
+ */
+ bool has_value(const ir_constant *) const;
+
+ virtual bool is_zero() const;
+ virtual bool is_one() const;
+ virtual bool is_negative_one() const;
+
+ /**
+ * Value of the constant.
+ *
+ * The field used to back the values supplied by the constant is determined
+ * by the type associated with the \c ir_instruction. Constants may be
+ * scalars, vectors, or matrices.
+ */
+ union ir_constant_data value;
+
+ /* Array elements */
+ ir_constant **array_elements;
+
+ /* Structure fields */
+ exec_list components;
+
+private:
+ /**
+ * Parameterless constructor only used by the clone method
+ */
+ ir_constant(void);
+};
+
+/*@}*/
+
+/**
+ * Apply a visitor to each IR node in a list
+ */
+void
+visit_exec_list(exec_list *list, ir_visitor *visitor);
+
+/**
+ * Validate invariants on each IR node in a list
+ */
+void validate_ir_tree(exec_list *instructions);
+
+/**
+ * Make a clone of each IR instruction in a list
+ *
+ * \param in List of IR instructions that are to be cloned
+ * \param out List to hold the cloned instructions
+ */
+void
+clone_ir_list(void *mem_ctx, exec_list *out, const exec_list *in);
+
+extern void
+_mesa_glsl_initialize_variables(exec_list *instructions,
+ struct _mesa_glsl_parse_state *state);
+
+extern void
+_mesa_glsl_initialize_functions(_mesa_glsl_parse_state *state);
+
+extern void
+_mesa_glsl_release_functions(void);
+
+extern void
+reparent_ir(exec_list *list, void *mem_ctx);
+
+struct glsl_symbol_table;
+
+extern void
+import_prototypes(const exec_list *source, exec_list *dest,
+ struct glsl_symbol_table *symbols, void *mem_ctx);
+
+extern bool
+ir_has_call(ir_instruction *ir);
+
+extern void
+do_set_program_inouts(exec_list *instructions, struct gl_program *prog);
+
+#endif /* IR_H */
diff --git a/mesalib/src/glsl/ir_clone.cpp b/mesalib/src/glsl/ir_clone.cpp
index 069bb85e8..eac1f7492 100644
--- a/mesalib/src/glsl/ir_clone.cpp
+++ b/mesalib/src/glsl/ir_clone.cpp
@@ -1,432 +1,432 @@
-/*
- * Copyright © 2010 Intel Corporation
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-
-#include <string.h>
-#include "main/compiler.h"
-#include "ir.h"
-#include "glsl_types.h"
-extern "C" {
-#include "program/hash_table.h"
-}
-
-/**
- * Duplicate an IR variable
- *
- * \note
- * This will probably be made \c virtual and moved to the base class
- * eventually.
- */
-ir_variable *
-ir_variable::clone(void *mem_ctx, struct hash_table *ht) const
-{
- ir_variable *var = new(mem_ctx) ir_variable(this->type, this->name,
- (ir_variable_mode) this->mode);
-
- var->max_array_access = this->max_array_access;
- var->read_only = this->read_only;
- var->centroid = this->centroid;
- var->invariant = this->invariant;
- var->interpolation = this->interpolation;
- var->array_lvalue = this->array_lvalue;
- var->location = this->location;
- var->warn_extension = this->warn_extension;
- var->origin_upper_left = this->origin_upper_left;
- var->pixel_center_integer = this->pixel_center_integer;
- var->explicit_location = this->explicit_location;
-
- var->num_state_slots = this->num_state_slots;
- if (this->state_slots) {
- /* FINISHME: This really wants to use something like talloc_reference, but
- * FINISHME: ralloc doesn't have any similar function.
- */
- var->state_slots = ralloc_array(var, ir_state_slot,
- this->num_state_slots);
- memcpy(var->state_slots, this->state_slots,
- sizeof(this->state_slots[0]) * var->num_state_slots);
- }
-
- if (this->explicit_location)
- var->location = this->location;
-
- if (this->constant_value)
- var->constant_value = this->constant_value->clone(mem_ctx, ht);
-
- if (ht) {
- hash_table_insert(ht, var, (void *)const_cast<ir_variable *>(this));
- }
-
- return var;
-}
-
-ir_swizzle *
-ir_swizzle::clone(void *mem_ctx, struct hash_table *ht) const
-{
- return new(mem_ctx) ir_swizzle(this->val->clone(mem_ctx, ht), this->mask);
-}
-
-ir_return *
-ir_return::clone(void *mem_ctx, struct hash_table *ht) const
-{
- ir_rvalue *new_value = NULL;
-
- if (this->value)
- new_value = this->value->clone(mem_ctx, ht);
-
- return new(mem_ctx) ir_return(new_value);
-}
-
-ir_discard *
-ir_discard::clone(void *mem_ctx, struct hash_table *ht) const
-{
- ir_rvalue *new_condition = NULL;
-
- if (this->condition != NULL)
- new_condition = this->condition->clone(mem_ctx, ht);
-
- return new(mem_ctx) ir_discard(new_condition);
-}
-
-ir_loop_jump *
-ir_loop_jump::clone(void *mem_ctx, struct hash_table *ht) const
-{
- (void)ht;
-
- return new(mem_ctx) ir_loop_jump(this->mode);
-}
-
-ir_if *
-ir_if::clone(void *mem_ctx, struct hash_table *ht) const
-{
- ir_if *new_if = new(mem_ctx) ir_if(this->condition->clone(mem_ctx, ht));
-
- foreach_iter(exec_list_iterator, iter, this->then_instructions) {
- ir_instruction *ir = (ir_instruction *)iter.get();
- new_if->then_instructions.push_tail(ir->clone(mem_ctx, ht));
- }
-
- foreach_iter(exec_list_iterator, iter, this->else_instructions) {
- ir_instruction *ir = (ir_instruction *)iter.get();
- new_if->else_instructions.push_tail(ir->clone(mem_ctx, ht));
- }
-
- return new_if;
-}
-
-ir_loop *
-ir_loop::clone(void *mem_ctx, struct hash_table *ht) const
-{
- ir_loop *new_loop = new(mem_ctx) ir_loop();
-
- if (this->from)
- new_loop->from = this->from->clone(mem_ctx, ht);
- if (this->to)
- new_loop->to = this->to->clone(mem_ctx, ht);
- if (this->increment)
- new_loop->increment = this->increment->clone(mem_ctx, ht);
- new_loop->counter = counter;
-
- foreach_iter(exec_list_iterator, iter, this->body_instructions) {
- ir_instruction *ir = (ir_instruction *)iter.get();
- new_loop->body_instructions.push_tail(ir->clone(mem_ctx, ht));
- }
-
- new_loop->cmp = this->cmp;
- return new_loop;
-}
-
-ir_call *
-ir_call::clone(void *mem_ctx, struct hash_table *ht) const
-{
- if (this->type == glsl_type::error_type)
- return ir_call::get_error_instruction(mem_ctx);
-
- exec_list new_parameters;
-
- foreach_iter(exec_list_iterator, iter, this->actual_parameters) {
- ir_instruction *ir = (ir_instruction *)iter.get();
- new_parameters.push_tail(ir->clone(mem_ctx, ht));
- }
-
- return new(mem_ctx) ir_call(this->callee, &new_parameters);
-}
-
-ir_expression *
-ir_expression::clone(void *mem_ctx, struct hash_table *ht) const
-{
- ir_rvalue *op[Elements(this->operands)] = { NULL, };
- unsigned int i;
-
- for (i = 0; i < get_num_operands(); i++) {
- op[i] = this->operands[i]->clone(mem_ctx, ht);
- }
-
- return new(mem_ctx) ir_expression(this->operation, this->type,
- op[0], op[1], op[2], op[3]);
-}
-
-ir_dereference_variable *
-ir_dereference_variable::clone(void *mem_ctx, struct hash_table *ht) const
-{
- ir_variable *new_var;
-
- if (ht) {
- new_var = (ir_variable *)hash_table_find(ht, this->var);
- if (!new_var)
- new_var = this->var;
- } else {
- new_var = this->var;
- }
-
- return new(mem_ctx) ir_dereference_variable(new_var);
-}
-
-ir_dereference_array *
-ir_dereference_array::clone(void *mem_ctx, struct hash_table *ht) const
-{
- return new(mem_ctx) ir_dereference_array(this->array->clone(mem_ctx, ht),
- this->array_index->clone(mem_ctx,
- ht));
-}
-
-ir_dereference_record *
-ir_dereference_record::clone(void *mem_ctx, struct hash_table *ht) const
-{
- return new(mem_ctx) ir_dereference_record(this->record->clone(mem_ctx, ht),
- this->field);
-}
-
-ir_texture *
-ir_texture::clone(void *mem_ctx, struct hash_table *ht) const
-{
- ir_texture *new_tex = new(mem_ctx) ir_texture(this->op);
- new_tex->type = this->type;
-
- new_tex->sampler = this->sampler->clone(mem_ctx, ht);
- new_tex->coordinate = this->coordinate->clone(mem_ctx, ht);
- if (this->projector)
- new_tex->projector = this->projector->clone(mem_ctx, ht);
- if (this->shadow_comparitor) {
- new_tex->shadow_comparitor = this->shadow_comparitor->clone(mem_ctx, ht);
- }
-
- if (this->offset != NULL)
- new_tex->offset = this->offset->clone(mem_ctx, ht);
-
- switch (this->op) {
- case ir_tex:
- break;
- case ir_txb:
- new_tex->lod_info.bias = this->lod_info.bias->clone(mem_ctx, ht);
- break;
- case ir_txl:
- case ir_txf:
- new_tex->lod_info.lod = this->lod_info.lod->clone(mem_ctx, ht);
- break;
- case ir_txd:
- new_tex->lod_info.grad.dPdx = this->lod_info.grad.dPdx->clone(mem_ctx, ht);
- new_tex->lod_info.grad.dPdy = this->lod_info.grad.dPdy->clone(mem_ctx, ht);
- break;
- }
-
- return new_tex;
-}
-
-ir_assignment *
-ir_assignment::clone(void *mem_ctx, struct hash_table *ht) const
-{
- ir_rvalue *new_condition = NULL;
-
- if (this->condition)
- new_condition = this->condition->clone(mem_ctx, ht);
-
- return new(mem_ctx) ir_assignment(this->lhs->clone(mem_ctx, ht),
- this->rhs->clone(mem_ctx, ht),
- new_condition,
- this->write_mask);
-}
-
-ir_function *
-ir_function::clone(void *mem_ctx, struct hash_table *ht) const
-{
- ir_function *copy = new(mem_ctx) ir_function(this->name);
-
- foreach_list_const(node, &this->signatures) {
- const ir_function_signature *const sig =
- (const ir_function_signature *const) node;
-
- ir_function_signature *sig_copy = sig->clone(mem_ctx, ht);
- copy->add_signature(sig_copy);
-
- if (ht != NULL)
- hash_table_insert(ht, sig_copy,
- (void *)const_cast<ir_function_signature *>(sig));
- }
-
- return copy;
-}
-
-ir_function_signature *
-ir_function_signature::clone(void *mem_ctx, struct hash_table *ht) const
-{
- ir_function_signature *copy = this->clone_prototype(mem_ctx, ht);
-
- copy->is_defined = this->is_defined;
-
- /* Clone the instruction list.
- */
- foreach_list_const(node, &this->body) {
- const ir_instruction *const inst = (const ir_instruction *) node;
-
- ir_instruction *const inst_copy = inst->clone(mem_ctx, ht);
- copy->body.push_tail(inst_copy);
- }
-
- return copy;
-}
-
-ir_function_signature *
-ir_function_signature::clone_prototype(void *mem_ctx, struct hash_table *ht) const
-{
- ir_function_signature *copy =
- new(mem_ctx) ir_function_signature(this->return_type);
-
- copy->is_defined = false;
- copy->is_builtin = this->is_builtin;
-
- /* Clone the parameter list, but NOT the body.
- */
- foreach_list_const(node, &this->parameters) {
- const ir_variable *const param = (const ir_variable *) node;
-
- assert(const_cast<ir_variable *>(param)->as_variable() != NULL);
-
- ir_variable *const param_copy = param->clone(mem_ctx, ht);
- copy->parameters.push_tail(param_copy);
- }
-
- return copy;
-}
-
-ir_constant *
-ir_constant::clone(void *mem_ctx, struct hash_table *ht) const
-{
- (void)ht;
-
- switch (this->type->base_type) {
- case GLSL_TYPE_UINT:
- case GLSL_TYPE_INT:
- case GLSL_TYPE_FLOAT:
- case GLSL_TYPE_BOOL:
- return new(mem_ctx) ir_constant(this->type, &this->value);
-
- case GLSL_TYPE_STRUCT: {
- ir_constant *c = new(mem_ctx) ir_constant;
-
- c->type = this->type;
- for (exec_node *node = this->components.head
- ; !node->is_tail_sentinel()
- ; node = node->next) {
- ir_constant *const orig = (ir_constant *) node;
-
- c->components.push_tail(orig->clone(mem_ctx, NULL));
- }
-
- return c;
- }
-
- case GLSL_TYPE_ARRAY: {
- ir_constant *c = new(mem_ctx) ir_constant;
-
- c->type = this->type;
- c->array_elements = ralloc_array(c, ir_constant *, this->type->length);
- for (unsigned i = 0; i < this->type->length; i++) {
- c->array_elements[i] = this->array_elements[i]->clone(mem_ctx, NULL);
- }
- return c;
- }
-
- default:
- assert(!"Should not get here.");
- return NULL;
- }
-}
-
-
-class fixup_ir_call_visitor : public ir_hierarchical_visitor {
-public:
- fixup_ir_call_visitor(struct hash_table *ht)
- {
- this->ht = ht;
- }
-
- virtual ir_visitor_status visit_enter(ir_call *ir)
- {
- /* Try to find the function signature referenced by the ir_call in the
- * table. If it is found, replace it with the value from the table.
- */
- ir_function_signature *sig =
- (ir_function_signature *) hash_table_find(this->ht, ir->get_callee());
- if (sig != NULL)
- ir->set_callee(sig);
-
- /* Since this may be used before function call parameters are flattened,
- * the children also need to be processed.
- */
- return visit_continue;
- }
-
-private:
- struct hash_table *ht;
-};
-
-
-static void
-fixup_function_calls(struct hash_table *ht, exec_list *instructions)
-{
- fixup_ir_call_visitor v(ht);
- v.run(instructions);
-}
-
-
-void
-clone_ir_list(void *mem_ctx, exec_list *out, const exec_list *in)
-{
- struct hash_table *ht =
- hash_table_ctor(0, hash_table_pointer_hash, hash_table_pointer_compare);
-
- foreach_list_const(node, in) {
- const ir_instruction *const original = (ir_instruction *) node;
- ir_instruction *copy = original->clone(mem_ctx, ht);
-
- out->push_tail(copy);
- }
-
- /* Make a pass over the cloned tree to fix up ir_call nodes to point to the
- * cloned ir_function_signature nodes. This cannot be done automatically
- * during cloning because the ir_call might be a forward reference (i.e.,
- * the function signature that it references may not have been cloned yet).
- */
- fixup_function_calls(ht, out);
-
- hash_table_dtor(ht);
-}
+/*
+ * Copyright © 2010 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+#include <string.h>
+#include "main/compiler.h"
+#include "ir.h"
+#include "glsl_types.h"
+extern "C" {
+#include "program/hash_table.h"
+}
+
+/**
+ * Duplicate an IR variable
+ *
+ * \note
+ * This will probably be made \c virtual and moved to the base class
+ * eventually.
+ */
+ir_variable *
+ir_variable::clone(void *mem_ctx, struct hash_table *ht) const
+{
+ ir_variable *var = new(mem_ctx) ir_variable(this->type, this->name,
+ (ir_variable_mode) this->mode);
+
+ var->max_array_access = this->max_array_access;
+ var->read_only = this->read_only;
+ var->centroid = this->centroid;
+ var->invariant = this->invariant;
+ var->interpolation = this->interpolation;
+ var->array_lvalue = this->array_lvalue;
+ var->location = this->location;
+ var->warn_extension = this->warn_extension;
+ var->origin_upper_left = this->origin_upper_left;
+ var->pixel_center_integer = this->pixel_center_integer;
+ var->explicit_location = this->explicit_location;
+
+ var->num_state_slots = this->num_state_slots;
+ if (this->state_slots) {
+ /* FINISHME: This really wants to use something like talloc_reference, but
+ * FINISHME: ralloc doesn't have any similar function.
+ */
+ var->state_slots = ralloc_array(var, ir_state_slot,
+ this->num_state_slots);
+ memcpy(var->state_slots, this->state_slots,
+ sizeof(this->state_slots[0]) * var->num_state_slots);
+ }
+
+ if (this->explicit_location)
+ var->location = this->location;
+
+ if (this->constant_value)
+ var->constant_value = this->constant_value->clone(mem_ctx, ht);
+
+ if (ht) {
+ hash_table_insert(ht, var, (void *)const_cast<ir_variable *>(this));
+ }
+
+ return var;
+}
+
+ir_swizzle *
+ir_swizzle::clone(void *mem_ctx, struct hash_table *ht) const
+{
+ return new(mem_ctx) ir_swizzle(this->val->clone(mem_ctx, ht), this->mask);
+}
+
+ir_return *
+ir_return::clone(void *mem_ctx, struct hash_table *ht) const
+{
+ ir_rvalue *new_value = NULL;
+
+ if (this->value)
+ new_value = this->value->clone(mem_ctx, ht);
+
+ return new(mem_ctx) ir_return(new_value);
+}
+
+ir_discard *
+ir_discard::clone(void *mem_ctx, struct hash_table *ht) const
+{
+ ir_rvalue *new_condition = NULL;
+
+ if (this->condition != NULL)
+ new_condition = this->condition->clone(mem_ctx, ht);
+
+ return new(mem_ctx) ir_discard(new_condition);
+}
+
+ir_loop_jump *
+ir_loop_jump::clone(void *mem_ctx, struct hash_table *ht) const
+{
+ (void)ht;
+
+ return new(mem_ctx) ir_loop_jump(this->mode);
+}
+
+ir_if *
+ir_if::clone(void *mem_ctx, struct hash_table *ht) const
+{
+ ir_if *new_if = new(mem_ctx) ir_if(this->condition->clone(mem_ctx, ht));
+
+ foreach_iter(exec_list_iterator, iter, this->then_instructions) {
+ ir_instruction *ir = (ir_instruction *)iter.get();
+ new_if->then_instructions.push_tail(ir->clone(mem_ctx, ht));
+ }
+
+ foreach_iter(exec_list_iterator, iter, this->else_instructions) {
+ ir_instruction *ir = (ir_instruction *)iter.get();
+ new_if->else_instructions.push_tail(ir->clone(mem_ctx, ht));
+ }
+
+ return new_if;
+}
+
+ir_loop *
+ir_loop::clone(void *mem_ctx, struct hash_table *ht) const
+{
+ ir_loop *new_loop = new(mem_ctx) ir_loop();
+
+ if (this->from)
+ new_loop->from = this->from->clone(mem_ctx, ht);
+ if (this->to)
+ new_loop->to = this->to->clone(mem_ctx, ht);
+ if (this->increment)
+ new_loop->increment = this->increment->clone(mem_ctx, ht);
+ new_loop->counter = counter;
+
+ foreach_iter(exec_list_iterator, iter, this->body_instructions) {
+ ir_instruction *ir = (ir_instruction *)iter.get();
+ new_loop->body_instructions.push_tail(ir->clone(mem_ctx, ht));
+ }
+
+ new_loop->cmp = this->cmp;
+ return new_loop;
+}
+
+ir_call *
+ir_call::clone(void *mem_ctx, struct hash_table *ht) const
+{
+ if (this->type == glsl_type::error_type)
+ return ir_call::get_error_instruction(mem_ctx);
+
+ exec_list new_parameters;
+
+ foreach_iter(exec_list_iterator, iter, this->actual_parameters) {
+ ir_instruction *ir = (ir_instruction *)iter.get();
+ new_parameters.push_tail(ir->clone(mem_ctx, ht));
+ }
+
+ return new(mem_ctx) ir_call(this->callee, &new_parameters);
+}
+
+ir_expression *
+ir_expression::clone(void *mem_ctx, struct hash_table *ht) const
+{
+ ir_rvalue *op[Elements(this->operands)] = { NULL, };
+ unsigned int i;
+
+ for (i = 0; i < get_num_operands(); i++) {
+ op[i] = this->operands[i]->clone(mem_ctx, ht);
+ }
+
+ return new(mem_ctx) ir_expression(this->operation, this->type,
+ op[0], op[1], op[2], op[3]);
+}
+
+ir_dereference_variable *
+ir_dereference_variable::clone(void *mem_ctx, struct hash_table *ht) const
+{
+ ir_variable *new_var;
+
+ if (ht) {
+ new_var = (ir_variable *)hash_table_find(ht, this->var);
+ if (!new_var)
+ new_var = this->var;
+ } else {
+ new_var = this->var;
+ }
+
+ return new(mem_ctx) ir_dereference_variable(new_var);
+}
+
+ir_dereference_array *
+ir_dereference_array::clone(void *mem_ctx, struct hash_table *ht) const
+{
+ return new(mem_ctx) ir_dereference_array(this->array->clone(mem_ctx, ht),
+ this->array_index->clone(mem_ctx,
+ ht));
+}
+
+ir_dereference_record *
+ir_dereference_record::clone(void *mem_ctx, struct hash_table *ht) const
+{
+ return new(mem_ctx) ir_dereference_record(this->record->clone(mem_ctx, ht),
+ this->field);
+}
+
+ir_texture *
+ir_texture::clone(void *mem_ctx, struct hash_table *ht) const
+{
+ ir_texture *new_tex = new(mem_ctx) ir_texture(this->op);
+ new_tex->type = this->type;
+
+ new_tex->sampler = this->sampler->clone(mem_ctx, ht);
+ new_tex->coordinate = this->coordinate->clone(mem_ctx, ht);
+ if (this->projector)
+ new_tex->projector = this->projector->clone(mem_ctx, ht);
+ if (this->shadow_comparitor) {
+ new_tex->shadow_comparitor = this->shadow_comparitor->clone(mem_ctx, ht);
+ }
+
+ if (this->offset != NULL)
+ new_tex->offset = this->offset->clone(mem_ctx, ht);
+
+ switch (this->op) {
+ case ir_tex:
+ break;
+ case ir_txb:
+ new_tex->lod_info.bias = this->lod_info.bias->clone(mem_ctx, ht);
+ break;
+ case ir_txl:
+ case ir_txf:
+ new_tex->lod_info.lod = this->lod_info.lod->clone(mem_ctx, ht);
+ break;
+ case ir_txd:
+ new_tex->lod_info.grad.dPdx = this->lod_info.grad.dPdx->clone(mem_ctx, ht);
+ new_tex->lod_info.grad.dPdy = this->lod_info.grad.dPdy->clone(mem_ctx, ht);
+ break;
+ }
+
+ return new_tex;
+}
+
+ir_assignment *
+ir_assignment::clone(void *mem_ctx, struct hash_table *ht) const
+{
+ ir_rvalue *new_condition = NULL;
+
+ if (this->condition)
+ new_condition = this->condition->clone(mem_ctx, ht);
+
+ return new(mem_ctx) ir_assignment(this->lhs->clone(mem_ctx, ht),
+ this->rhs->clone(mem_ctx, ht),
+ new_condition,
+ this->write_mask);
+}
+
+ir_function *
+ir_function::clone(void *mem_ctx, struct hash_table *ht) const
+{
+ ir_function *copy = new(mem_ctx) ir_function(this->name);
+
+ foreach_list_const(node, &this->signatures) {
+ const ir_function_signature *const sig =
+ (const ir_function_signature *const) node;
+
+ ir_function_signature *sig_copy = sig->clone(mem_ctx, ht);
+ copy->add_signature(sig_copy);
+
+ if (ht != NULL)
+ hash_table_insert(ht, sig_copy,
+ (void *)const_cast<ir_function_signature *>(sig));
+ }
+
+ return copy;
+}
+
+ir_function_signature *
+ir_function_signature::clone(void *mem_ctx, struct hash_table *ht) const
+{
+ ir_function_signature *copy = this->clone_prototype(mem_ctx, ht);
+
+ copy->is_defined = this->is_defined;
+
+ /* Clone the instruction list.
+ */
+ foreach_list_const(node, &this->body) {
+ const ir_instruction *const inst = (const ir_instruction *) node;
+
+ ir_instruction *const inst_copy = inst->clone(mem_ctx, ht);
+ copy->body.push_tail(inst_copy);
+ }
+
+ return copy;
+}
+
+ir_function_signature *
+ir_function_signature::clone_prototype(void *mem_ctx, struct hash_table *ht) const
+{
+ ir_function_signature *copy =
+ new(mem_ctx) ir_function_signature(this->return_type);
+
+ copy->is_defined = false;
+ copy->is_builtin = this->is_builtin;
+
+ /* Clone the parameter list, but NOT the body.
+ */
+ foreach_list_const(node, &this->parameters) {
+ const ir_variable *const param = (const ir_variable *) node;
+
+ assert(const_cast<ir_variable *>(param)->as_variable() != NULL);
+
+ ir_variable *const param_copy = param->clone(mem_ctx, ht);
+ copy->parameters.push_tail(param_copy);
+ }
+
+ return copy;
+}
+
+ir_constant *
+ir_constant::clone(void *mem_ctx, struct hash_table *ht) const
+{
+ (void)ht;
+
+ switch (this->type->base_type) {
+ case GLSL_TYPE_UINT:
+ case GLSL_TYPE_INT:
+ case GLSL_TYPE_FLOAT:
+ case GLSL_TYPE_BOOL:
+ return new(mem_ctx) ir_constant(this->type, &this->value);
+
+ case GLSL_TYPE_STRUCT: {
+ ir_constant *c = new(mem_ctx) ir_constant;
+
+ c->type = this->type;
+ for (exec_node *node = this->components.head
+ ; !node->is_tail_sentinel()
+ ; node = node->next) {
+ ir_constant *const orig = (ir_constant *) node;
+
+ c->components.push_tail(orig->clone(mem_ctx, NULL));
+ }
+
+ return c;
+ }
+
+ case GLSL_TYPE_ARRAY: {
+ ir_constant *c = new(mem_ctx) ir_constant;
+
+ c->type = this->type;
+ c->array_elements = ralloc_array(c, ir_constant *, this->type->length);
+ for (unsigned i = 0; i < this->type->length; i++) {
+ c->array_elements[i] = this->array_elements[i]->clone(mem_ctx, NULL);
+ }
+ return c;
+ }
+
+ default:
+ assert(!"Should not get here.");
+ return NULL;
+ }
+}
+
+
+class fixup_ir_call_visitor : public ir_hierarchical_visitor {
+public:
+ fixup_ir_call_visitor(struct hash_table *ht)
+ {
+ this->ht = ht;
+ }
+
+ virtual ir_visitor_status visit_enter(ir_call *ir)
+ {
+ /* Try to find the function signature referenced by the ir_call in the
+ * table. If it is found, replace it with the value from the table.
+ */
+ ir_function_signature *sig =
+ (ir_function_signature *) hash_table_find(this->ht, ir->get_callee());
+ if (sig != NULL)
+ ir->set_callee(sig);
+
+ /* Since this may be used before function call parameters are flattened,
+ * the children also need to be processed.
+ */
+ return visit_continue;
+ }
+
+private:
+ struct hash_table *ht;
+};
+
+
+static void
+fixup_function_calls(struct hash_table *ht, exec_list *instructions)
+{
+ fixup_ir_call_visitor v(ht);
+ v.run(instructions);
+}
+
+
+void
+clone_ir_list(void *mem_ctx, exec_list *out, const exec_list *in)
+{
+ struct hash_table *ht =
+ hash_table_ctor(0, hash_table_pointer_hash, hash_table_pointer_compare);
+
+ foreach_list_const(node, in) {
+ const ir_instruction *const original = (ir_instruction *) node;
+ ir_instruction *copy = original->clone(mem_ctx, ht);
+
+ out->push_tail(copy);
+ }
+
+ /* Make a pass over the cloned tree to fix up ir_call nodes to point to the
+ * cloned ir_function_signature nodes. This cannot be done automatically
+ * during cloning because the ir_call might be a forward reference (i.e.,
+ * the function signature that it references may not have been cloned yet).
+ */
+ fixup_function_calls(ht, out);
+
+ hash_table_dtor(ht);
+}
diff --git a/mesalib/src/glsl/ir_constant_expression.cpp b/mesalib/src/glsl/ir_constant_expression.cpp
index 2a3084896..1d39e31fa 100644
--- a/mesalib/src/glsl/ir_constant_expression.cpp
+++ b/mesalib/src/glsl/ir_constant_expression.cpp
@@ -1,1372 +1,1372 @@
-/*
- * Copyright © 2010 Intel Corporation
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-
-/**
- * \file ir_constant_expression.cpp
- * Evaluate and process constant valued expressions
- *
- * In GLSL, constant valued expressions are used in several places. These
- * must be processed and evaluated very early in the compilation process.
- *
- * * Sizes of arrays
- * * Initializers for uniforms
- * * Initializers for \c const variables
- */
-
-#include <math.h>
-#include "main/core.h" /* for MAX2, MIN2, CLAMP */
-#include "ir.h"
-#include "ir_visitor.h"
-#include "glsl_types.h"
-
-static float
-dot(ir_constant *op0, ir_constant *op1)
-{
- assert(op0->type->is_float() && op1->type->is_float());
-
- float result = 0;
- for (unsigned c = 0; c < op0->type->components(); c++)
- result += op0->value.f[c] * op1->value.f[c];
-
- return result;
-}
-
-ir_constant *
-ir_expression::constant_expression_value()
-{
- if (this->type->is_error())
- return NULL;
-
- ir_constant *op[Elements(this->operands)] = { NULL, };
- ir_constant_data data;
-
- memset(&data, 0, sizeof(data));
-
- for (unsigned operand = 0; operand < this->get_num_operands(); operand++) {
- op[operand] = this->operands[operand]->constant_expression_value();
- if (!op[operand])
- return NULL;
- }
-
- if (op[1] != NULL)
- assert(op[0]->type->base_type == op[1]->type->base_type);
-
- bool op0_scalar = op[0]->type->is_scalar();
- bool op1_scalar = op[1] != NULL && op[1]->type->is_scalar();
-
- /* When iterating over a vector or matrix's components, we want to increase
- * the loop counter. However, for scalars, we want to stay at 0.
- */
- unsigned c0_inc = op0_scalar ? 0 : 1;
- unsigned c1_inc = op1_scalar ? 0 : 1;
- unsigned components;
- if (op1_scalar || !op[1]) {
- components = op[0]->type->components();
- } else {
- components = op[1]->type->components();
- }
-
- void *ctx = ralloc_parent(this);
-
- /* Handle array operations here, rather than below. */
- if (op[0]->type->is_array()) {
- assert(op[1] != NULL && op[1]->type->is_array());
- switch (this->operation) {
- case ir_binop_all_equal:
- return new(ctx) ir_constant(op[0]->has_value(op[1]));
- case ir_binop_any_nequal:
- return new(ctx) ir_constant(!op[0]->has_value(op[1]));
- default:
- break;
- }
- return NULL;
- }
-
- switch (this->operation) {
- case ir_unop_bit_not:
- switch (op[0]->type->base_type) {
- case GLSL_TYPE_INT:
- for (unsigned c = 0; c < components; c++)
- data.i[c] = ~ op[0]->value.i[c];
- break;
- case GLSL_TYPE_UINT:
- for (unsigned c = 0; c < components; c++)
- data.u[c] = ~ op[0]->value.u[c];
- break;
- default:
- assert(0);
- }
- break;
-
- case ir_unop_logic_not:
- assert(op[0]->type->base_type == GLSL_TYPE_BOOL);
- for (unsigned c = 0; c < op[0]->type->components(); c++)
- data.b[c] = !op[0]->value.b[c];
- break;
-
- case ir_unop_f2i:
- assert(op[0]->type->base_type == GLSL_TYPE_FLOAT);
- for (unsigned c = 0; c < op[0]->type->components(); c++) {
- data.i[c] = (int) op[0]->value.f[c];
- }
- break;
- case ir_unop_i2f:
- assert(op[0]->type->base_type == GLSL_TYPE_INT);
- for (unsigned c = 0; c < op[0]->type->components(); c++) {
- data.f[c] = (float) op[0]->value.i[c];
- }
- break;
- case ir_unop_u2f:
- assert(op[0]->type->base_type == GLSL_TYPE_UINT);
- for (unsigned c = 0; c < op[0]->type->components(); c++) {
- data.f[c] = (float) op[0]->value.u[c];
- }
- break;
- case ir_unop_b2f:
- assert(op[0]->type->base_type == GLSL_TYPE_BOOL);
- for (unsigned c = 0; c < op[0]->type->components(); c++) {
- data.f[c] = op[0]->value.b[c] ? 1.0F : 0.0F;
- }
- break;
- case ir_unop_f2b:
- assert(op[0]->type->base_type == GLSL_TYPE_FLOAT);
- for (unsigned c = 0; c < op[0]->type->components(); c++) {
- data.b[c] = op[0]->value.f[c] != 0.0F ? true : false;
- }
- break;
- case ir_unop_b2i:
- assert(op[0]->type->base_type == GLSL_TYPE_BOOL);
- for (unsigned c = 0; c < op[0]->type->components(); c++) {
- data.u[c] = op[0]->value.b[c] ? 1 : 0;
- }
- break;
- case ir_unop_i2b:
- assert(op[0]->type->is_integer());
- for (unsigned c = 0; c < op[0]->type->components(); c++) {
- data.b[c] = op[0]->value.u[c] ? true : false;
- }
- break;
-
- case ir_unop_any:
- assert(op[0]->type->is_boolean());
- data.b[0] = false;
- for (unsigned c = 0; c < op[0]->type->components(); c++) {
- if (op[0]->value.b[c])
- data.b[0] = true;
- }
- break;
-
- case ir_unop_trunc:
- assert(op[0]->type->base_type == GLSL_TYPE_FLOAT);
- for (unsigned c = 0; c < op[0]->type->components(); c++) {
- data.f[c] = truncf(op[0]->value.f[c]);
- }
- break;
-
- case ir_unop_ceil:
- assert(op[0]->type->base_type == GLSL_TYPE_FLOAT);
- for (unsigned c = 0; c < op[0]->type->components(); c++) {
- data.f[c] = ceilf(op[0]->value.f[c]);
- }
- break;
-
- case ir_unop_floor:
- assert(op[0]->type->base_type == GLSL_TYPE_FLOAT);
- for (unsigned c = 0; c < op[0]->type->components(); c++) {
- data.f[c] = floorf(op[0]->value.f[c]);
- }
- break;
-
- case ir_unop_fract:
- for (unsigned c = 0; c < op[0]->type->components(); c++) {
- switch (this->type->base_type) {
- case GLSL_TYPE_UINT:
- data.u[c] = 0;
- break;
- case GLSL_TYPE_INT:
- data.i[c] = 0;
- break;
- case GLSL_TYPE_FLOAT:
- data.f[c] = op[0]->value.f[c] - floor(op[0]->value.f[c]);
- break;
- default:
- assert(0);
- }
- }
- break;
-
- case ir_unop_sin:
- case ir_unop_sin_reduced:
- assert(op[0]->type->base_type == GLSL_TYPE_FLOAT);
- for (unsigned c = 0; c < op[0]->type->components(); c++) {
- data.f[c] = sinf(op[0]->value.f[c]);
- }
- break;
-
- case ir_unop_cos:
- case ir_unop_cos_reduced:
- assert(op[0]->type->base_type == GLSL_TYPE_FLOAT);
- for (unsigned c = 0; c < op[0]->type->components(); c++) {
- data.f[c] = cosf(op[0]->value.f[c]);
- }
- break;
-
- case ir_unop_neg:
- for (unsigned c = 0; c < op[0]->type->components(); c++) {
- switch (this->type->base_type) {
- case GLSL_TYPE_UINT:
- data.u[c] = -((int) op[0]->value.u[c]);
- break;
- case GLSL_TYPE_INT:
- data.i[c] = -op[0]->value.i[c];
- break;
- case GLSL_TYPE_FLOAT:
- data.f[c] = -op[0]->value.f[c];
- break;
- default:
- assert(0);
- }
- }
- break;
-
- case ir_unop_abs:
- for (unsigned c = 0; c < op[0]->type->components(); c++) {
- switch (this->type->base_type) {
- case GLSL_TYPE_UINT:
- data.u[c] = op[0]->value.u[c];
- break;
- case GLSL_TYPE_INT:
- data.i[c] = op[0]->value.i[c];
- if (data.i[c] < 0)
- data.i[c] = -data.i[c];
- break;
- case GLSL_TYPE_FLOAT:
- data.f[c] = fabs(op[0]->value.f[c]);
- break;
- default:
- assert(0);
- }
- }
- break;
-
- case ir_unop_sign:
- for (unsigned c = 0; c < op[0]->type->components(); c++) {
- switch (this->type->base_type) {
- case GLSL_TYPE_UINT:
- data.u[c] = op[0]->value.i[c] > 0;
- break;
- case GLSL_TYPE_INT:
- data.i[c] = (op[0]->value.i[c] > 0) - (op[0]->value.i[c] < 0);
- break;
- case GLSL_TYPE_FLOAT:
- data.f[c] = float((op[0]->value.f[c] > 0)-(op[0]->value.f[c] < 0));
- break;
- default:
- assert(0);
- }
- }
- break;
-
- case ir_unop_rcp:
- assert(op[0]->type->base_type == GLSL_TYPE_FLOAT);
- for (unsigned c = 0; c < op[0]->type->components(); c++) {
- switch (this->type->base_type) {
- case GLSL_TYPE_UINT:
- if (op[0]->value.u[c] != 0.0)
- data.u[c] = 1 / op[0]->value.u[c];
- break;
- case GLSL_TYPE_INT:
- if (op[0]->value.i[c] != 0.0)
- data.i[c] = 1 / op[0]->value.i[c];
- break;
- case GLSL_TYPE_FLOAT:
- if (op[0]->value.f[c] != 0.0)
- data.f[c] = 1.0F / op[0]->value.f[c];
- break;
- default:
- assert(0);
- }
- }
- break;
-
- case ir_unop_rsq:
- assert(op[0]->type->base_type == GLSL_TYPE_FLOAT);
- for (unsigned c = 0; c < op[0]->type->components(); c++) {
- data.f[c] = 1.0F / sqrtf(op[0]->value.f[c]);
- }
- break;
-
- case ir_unop_sqrt:
- assert(op[0]->type->base_type == GLSL_TYPE_FLOAT);
- for (unsigned c = 0; c < op[0]->type->components(); c++) {
- data.f[c] = sqrtf(op[0]->value.f[c]);
- }
- break;
-
- case ir_unop_exp:
- assert(op[0]->type->base_type == GLSL_TYPE_FLOAT);
- for (unsigned c = 0; c < op[0]->type->components(); c++) {
- data.f[c] = expf(op[0]->value.f[c]);
- }
- break;
-
- case ir_unop_exp2:
- assert(op[0]->type->base_type == GLSL_TYPE_FLOAT);
- for (unsigned c = 0; c < op[0]->type->components(); c++) {
- data.f[c] = exp2f(op[0]->value.f[c]);
- }
- break;
-
- case ir_unop_log:
- assert(op[0]->type->base_type == GLSL_TYPE_FLOAT);
- for (unsigned c = 0; c < op[0]->type->components(); c++) {
- data.f[c] = logf(op[0]->value.f[c]);
- }
- break;
-
- case ir_unop_log2:
- assert(op[0]->type->base_type == GLSL_TYPE_FLOAT);
- for (unsigned c = 0; c < op[0]->type->components(); c++) {
- data.f[c] = log2f(op[0]->value.f[c]);
- }
- break;
-
- case ir_unop_dFdx:
- case ir_unop_dFdy:
- assert(op[0]->type->base_type == GLSL_TYPE_FLOAT);
- for (unsigned c = 0; c < op[0]->type->components(); c++) {
- data.f[c] = 0.0;
- }
- break;
-
- case ir_binop_pow:
- assert(op[0]->type->base_type == GLSL_TYPE_FLOAT);
- for (unsigned c = 0; c < op[0]->type->components(); c++) {
- data.f[c] = powf(op[0]->value.f[c], op[1]->value.f[c]);
- }
- break;
-
- case ir_binop_dot:
- data.f[0] = dot(op[0], op[1]);
- break;
-
- case ir_binop_min:
- assert(op[0]->type == op[1]->type || op0_scalar || op1_scalar);
- for (unsigned c = 0, c0 = 0, c1 = 0;
- c < components;
- c0 += c0_inc, c1 += c1_inc, c++) {
-
- switch (op[0]->type->base_type) {
- case GLSL_TYPE_UINT:
- data.u[c] = MIN2(op[0]->value.u[c0], op[1]->value.u[c1]);
- break;
- case GLSL_TYPE_INT:
- data.i[c] = MIN2(op[0]->value.i[c0], op[1]->value.i[c1]);
- break;
- case GLSL_TYPE_FLOAT:
- data.f[c] = MIN2(op[0]->value.f[c0], op[1]->value.f[c1]);
- break;
- default:
- assert(0);
- }
- }
-
- break;
- case ir_binop_max:
- assert(op[0]->type == op[1]->type || op0_scalar || op1_scalar);
- for (unsigned c = 0, c0 = 0, c1 = 0;
- c < components;
- c0 += c0_inc, c1 += c1_inc, c++) {
-
- switch (op[0]->type->base_type) {
- case GLSL_TYPE_UINT:
- data.u[c] = MAX2(op[0]->value.u[c0], op[1]->value.u[c1]);
- break;
- case GLSL_TYPE_INT:
- data.i[c] = MAX2(op[0]->value.i[c0], op[1]->value.i[c1]);
- break;
- case GLSL_TYPE_FLOAT:
- data.f[c] = MAX2(op[0]->value.f[c0], op[1]->value.f[c1]);
- break;
- default:
- assert(0);
- }
- }
- break;
-
- case ir_binop_add:
- assert(op[0]->type == op[1]->type || op0_scalar || op1_scalar);
- for (unsigned c = 0, c0 = 0, c1 = 0;
- c < components;
- c0 += c0_inc, c1 += c1_inc, c++) {
-
- switch (op[0]->type->base_type) {
- case GLSL_TYPE_UINT:
- data.u[c] = op[0]->value.u[c0] + op[1]->value.u[c1];
- break;
- case GLSL_TYPE_INT:
- data.i[c] = op[0]->value.i[c0] + op[1]->value.i[c1];
- break;
- case GLSL_TYPE_FLOAT:
- data.f[c] = op[0]->value.f[c0] + op[1]->value.f[c1];
- break;
- default:
- assert(0);
- }
- }
-
- break;
- case ir_binop_sub:
- assert(op[0]->type == op[1]->type || op0_scalar || op1_scalar);
- for (unsigned c = 0, c0 = 0, c1 = 0;
- c < components;
- c0 += c0_inc, c1 += c1_inc, c++) {
-
- switch (op[0]->type->base_type) {
- case GLSL_TYPE_UINT:
- data.u[c] = op[0]->value.u[c0] - op[1]->value.u[c1];
- break;
- case GLSL_TYPE_INT:
- data.i[c] = op[0]->value.i[c0] - op[1]->value.i[c1];
- break;
- case GLSL_TYPE_FLOAT:
- data.f[c] = op[0]->value.f[c0] - op[1]->value.f[c1];
- break;
- default:
- assert(0);
- }
- }
-
- break;
- case ir_binop_mul:
- /* Check for equal types, or unequal types involving scalars */
- if ((op[0]->type == op[1]->type && !op[0]->type->is_matrix())
- || op0_scalar || op1_scalar) {
- for (unsigned c = 0, c0 = 0, c1 = 0;
- c < components;
- c0 += c0_inc, c1 += c1_inc, c++) {
-
- switch (op[0]->type->base_type) {
- case GLSL_TYPE_UINT:
- data.u[c] = op[0]->value.u[c0] * op[1]->value.u[c1];
- break;
- case GLSL_TYPE_INT:
- data.i[c] = op[0]->value.i[c0] * op[1]->value.i[c1];
- break;
- case GLSL_TYPE_FLOAT:
- data.f[c] = op[0]->value.f[c0] * op[1]->value.f[c1];
- break;
- default:
- assert(0);
- }
- }
- } else {
- assert(op[0]->type->is_matrix() || op[1]->type->is_matrix());
-
- /* Multiply an N-by-M matrix with an M-by-P matrix. Since either
- * matrix can be a GLSL vector, either N or P can be 1.
- *
- * For vec*mat, the vector is treated as a row vector. This
- * means the vector is a 1-row x M-column matrix.
- *
- * For mat*vec, the vector is treated as a column vector. Since
- * matrix_columns is 1 for vectors, this just works.
- */
- const unsigned n = op[0]->type->is_vector()
- ? 1 : op[0]->type->vector_elements;
- const unsigned m = op[1]->type->vector_elements;
- const unsigned p = op[1]->type->matrix_columns;
- for (unsigned j = 0; j < p; j++) {
- for (unsigned i = 0; i < n; i++) {
- for (unsigned k = 0; k < m; k++) {
- data.f[i+n*j] += op[0]->value.f[i+n*k]*op[1]->value.f[k+m*j];
- }
- }
- }
- }
-
- break;
- case ir_binop_div:
- /* FINISHME: Emit warning when division-by-zero is detected. */
- assert(op[0]->type == op[1]->type || op0_scalar || op1_scalar);
- for (unsigned c = 0, c0 = 0, c1 = 0;
- c < components;
- c0 += c0_inc, c1 += c1_inc, c++) {
-
- switch (op[0]->type->base_type) {
- case GLSL_TYPE_UINT:
- if (op[1]->value.u[c1] == 0) {
- data.u[c] = 0;
- } else {
- data.u[c] = op[0]->value.u[c0] / op[1]->value.u[c1];
- }
- break;
- case GLSL_TYPE_INT:
- if (op[1]->value.i[c1] == 0) {
- data.i[c] = 0;
- } else {
- data.i[c] = op[0]->value.i[c0] / op[1]->value.i[c1];
- }
- break;
- case GLSL_TYPE_FLOAT:
- data.f[c] = op[0]->value.f[c0] / op[1]->value.f[c1];
- break;
- default:
- assert(0);
- }
- }
-
- break;
- case ir_binop_mod:
- /* FINISHME: Emit warning when division-by-zero is detected. */
- assert(op[0]->type == op[1]->type || op0_scalar || op1_scalar);
- for (unsigned c = 0, c0 = 0, c1 = 0;
- c < components;
- c0 += c0_inc, c1 += c1_inc, c++) {
-
- switch (op[0]->type->base_type) {
- case GLSL_TYPE_UINT:
- if (op[1]->value.u[c1] == 0) {
- data.u[c] = 0;
- } else {
- data.u[c] = op[0]->value.u[c0] % op[1]->value.u[c1];
- }
- break;
- case GLSL_TYPE_INT:
- if (op[1]->value.i[c1] == 0) {
- data.i[c] = 0;
- } else {
- data.i[c] = op[0]->value.i[c0] % op[1]->value.i[c1];
- }
- break;
- case GLSL_TYPE_FLOAT:
- /* We don't use fmod because it rounds toward zero; GLSL specifies
- * the use of floor.
- */
- data.f[c] = op[0]->value.f[c0] - op[1]->value.f[c1]
- * floorf(op[0]->value.f[c0] / op[1]->value.f[c1]);
- break;
- default:
- assert(0);
- }
- }
-
- break;
-
- case ir_binop_logic_and:
- assert(op[0]->type->base_type == GLSL_TYPE_BOOL);
- for (unsigned c = 0; c < op[0]->type->components(); c++)
- data.b[c] = op[0]->value.b[c] && op[1]->value.b[c];
- break;
- case ir_binop_logic_xor:
- assert(op[0]->type->base_type == GLSL_TYPE_BOOL);
- for (unsigned c = 0; c < op[0]->type->components(); c++)
- data.b[c] = op[0]->value.b[c] ^ op[1]->value.b[c];
- break;
- case ir_binop_logic_or:
- assert(op[0]->type->base_type == GLSL_TYPE_BOOL);
- for (unsigned c = 0; c < op[0]->type->components(); c++)
- data.b[c] = op[0]->value.b[c] || op[1]->value.b[c];
- break;
-
- case ir_binop_less:
- assert(op[0]->type == op[1]->type);
- for (unsigned c = 0; c < op[0]->type->components(); c++) {
- switch (op[0]->type->base_type) {
- case GLSL_TYPE_UINT:
- data.b[0] = op[0]->value.u[0] < op[1]->value.u[0];
- break;
- case GLSL_TYPE_INT:
- data.b[0] = op[0]->value.i[0] < op[1]->value.i[0];
- break;
- case GLSL_TYPE_FLOAT:
- data.b[0] = op[0]->value.f[0] < op[1]->value.f[0];
- break;
- default:
- assert(0);
- }
- }
- break;
- case ir_binop_greater:
- assert(op[0]->type == op[1]->type);
- for (unsigned c = 0; c < op[0]->type->components(); c++) {
- switch (op[0]->type->base_type) {
- case GLSL_TYPE_UINT:
- data.b[c] = op[0]->value.u[c] > op[1]->value.u[c];
- break;
- case GLSL_TYPE_INT:
- data.b[c] = op[0]->value.i[c] > op[1]->value.i[c];
- break;
- case GLSL_TYPE_FLOAT:
- data.b[c] = op[0]->value.f[c] > op[1]->value.f[c];
- break;
- default:
- assert(0);
- }
- }
- break;
- case ir_binop_lequal:
- assert(op[0]->type == op[1]->type);
- for (unsigned c = 0; c < op[0]->type->components(); c++) {
- switch (op[0]->type->base_type) {
- case GLSL_TYPE_UINT:
- data.b[0] = op[0]->value.u[0] <= op[1]->value.u[0];
- break;
- case GLSL_TYPE_INT:
- data.b[0] = op[0]->value.i[0] <= op[1]->value.i[0];
- break;
- case GLSL_TYPE_FLOAT:
- data.b[0] = op[0]->value.f[0] <= op[1]->value.f[0];
- break;
- default:
- assert(0);
- }
- }
- break;
- case ir_binop_gequal:
- assert(op[0]->type == op[1]->type);
- for (unsigned c = 0; c < op[0]->type->components(); c++) {
- switch (op[0]->type->base_type) {
- case GLSL_TYPE_UINT:
- data.b[0] = op[0]->value.u[0] >= op[1]->value.u[0];
- break;
- case GLSL_TYPE_INT:
- data.b[0] = op[0]->value.i[0] >= op[1]->value.i[0];
- break;
- case GLSL_TYPE_FLOAT:
- data.b[0] = op[0]->value.f[0] >= op[1]->value.f[0];
- break;
- default:
- assert(0);
- }
- }
- break;
- case ir_binop_equal:
- assert(op[0]->type == op[1]->type);
- for (unsigned c = 0; c < components; c++) {
- switch (op[0]->type->base_type) {
- case GLSL_TYPE_UINT:
- data.b[c] = op[0]->value.u[c] == op[1]->value.u[c];
- break;
- case GLSL_TYPE_INT:
- data.b[c] = op[0]->value.i[c] == op[1]->value.i[c];
- break;
- case GLSL_TYPE_FLOAT:
- data.b[c] = op[0]->value.f[c] == op[1]->value.f[c];
- break;
- default:
- assert(0);
- }
- }
- break;
- case ir_binop_nequal:
- assert(op[0]->type != op[1]->type);
- for (unsigned c = 0; c < components; c++) {
- switch (op[0]->type->base_type) {
- case GLSL_TYPE_UINT:
- data.b[c] = op[0]->value.u[c] != op[1]->value.u[c];
- break;
- case GLSL_TYPE_INT:
- data.b[c] = op[0]->value.i[c] != op[1]->value.i[c];
- break;
- case GLSL_TYPE_FLOAT:
- data.b[c] = op[0]->value.f[c] != op[1]->value.f[c];
- break;
- default:
- assert(0);
- }
- }
- break;
- case ir_binop_all_equal:
- data.b[0] = op[0]->has_value(op[1]);
- break;
- case ir_binop_any_nequal:
- data.b[0] = !op[0]->has_value(op[1]);
- break;
-
- case ir_binop_lshift:
- for (unsigned c = 0, c0 = 0, c1 = 0;
- c < components;
- c0 += c0_inc, c1 += c1_inc, c++) {
-
- if (op[0]->type->base_type == GLSL_TYPE_INT &&
- op[1]->type->base_type == GLSL_TYPE_INT) {
- data.i[c] = op[0]->value.i[c0] << op[1]->value.i[c1];
-
- } else if (op[0]->type->base_type == GLSL_TYPE_INT &&
- op[1]->type->base_type == GLSL_TYPE_UINT) {
- data.i[c] = op[0]->value.i[c0] << op[1]->value.u[c1];
-
- } else if (op[0]->type->base_type == GLSL_TYPE_UINT &&
- op[1]->type->base_type == GLSL_TYPE_INT) {
- data.u[c] = op[0]->value.u[c0] << op[1]->value.i[c1];
-
- } else if (op[0]->type->base_type == GLSL_TYPE_UINT &&
- op[1]->type->base_type == GLSL_TYPE_UINT) {
- data.u[c] = op[0]->value.u[c0] << op[1]->value.u[c1];
- }
- }
- break;
-
- case ir_binop_rshift:
- for (unsigned c = 0, c0 = 0, c1 = 0;
- c < components;
- c0 += c0_inc, c1 += c1_inc, c++) {
-
- if (op[0]->type->base_type == GLSL_TYPE_INT &&
- op[1]->type->base_type == GLSL_TYPE_INT) {
- data.i[c] = op[0]->value.i[c0] >> op[1]->value.i[c1];
-
- } else if (op[0]->type->base_type == GLSL_TYPE_INT &&
- op[1]->type->base_type == GLSL_TYPE_UINT) {
- data.i[c] = op[0]->value.i[c0] >> op[1]->value.u[c1];
-
- } else if (op[0]->type->base_type == GLSL_TYPE_UINT &&
- op[1]->type->base_type == GLSL_TYPE_INT) {
- data.u[c] = op[0]->value.u[c0] >> op[1]->value.i[c1];
-
- } else if (op[0]->type->base_type == GLSL_TYPE_UINT &&
- op[1]->type->base_type == GLSL_TYPE_UINT) {
- data.u[c] = op[0]->value.u[c0] >> op[1]->value.u[c1];
- }
- }
- break;
-
- case ir_binop_bit_and:
- for (unsigned c = 0, c0 = 0, c1 = 0;
- c < components;
- c0 += c0_inc, c1 += c1_inc, c++) {
-
- switch (op[0]->type->base_type) {
- case GLSL_TYPE_INT:
- data.i[c] = op[0]->value.i[c0] & op[1]->value.i[c1];
- break;
- case GLSL_TYPE_UINT:
- data.u[c] = op[0]->value.u[c0] & op[1]->value.u[c1];
- break;
- default:
- assert(0);
- }
- }
- break;
-
- case ir_binop_bit_or:
- for (unsigned c = 0, c0 = 0, c1 = 0;
- c < components;
- c0 += c0_inc, c1 += c1_inc, c++) {
-
- switch (op[0]->type->base_type) {
- case GLSL_TYPE_INT:
- data.i[c] = op[0]->value.i[c0] | op[1]->value.i[c1];
- break;
- case GLSL_TYPE_UINT:
- data.u[c] = op[0]->value.u[c0] | op[1]->value.u[c1];
- break;
- default:
- assert(0);
- }
- }
- break;
-
- case ir_binop_bit_xor:
- for (unsigned c = 0, c0 = 0, c1 = 0;
- c < components;
- c0 += c0_inc, c1 += c1_inc, c++) {
-
- switch (op[0]->type->base_type) {
- case GLSL_TYPE_INT:
- data.i[c] = op[0]->value.i[c0] ^ op[1]->value.i[c1];
- break;
- case GLSL_TYPE_UINT:
- data.u[c] = op[0]->value.u[c0] ^ op[1]->value.u[c1];
- break;
- default:
- assert(0);
- }
- }
- break;
-
- case ir_quadop_vector:
- for (unsigned c = 0; c < this->type->vector_elements; c++) {
- switch (this->type->base_type) {
- case GLSL_TYPE_INT:
- data.i[c] = op[c]->value.i[0];
- break;
- case GLSL_TYPE_UINT:
- data.u[c] = op[c]->value.u[0];
- break;
- case GLSL_TYPE_FLOAT:
- data.f[c] = op[c]->value.f[0];
- break;
- default:
- assert(0);
- }
- }
- break;
-
- default:
- /* FINISHME: Should handle all expression types. */
- return NULL;
- }
-
- return new(ctx) ir_constant(this->type, &data);
-}
-
-
-ir_constant *
-ir_texture::constant_expression_value()
-{
- /* texture lookups aren't constant expressions */
- return NULL;
-}
-
-
-ir_constant *
-ir_swizzle::constant_expression_value()
-{
- ir_constant *v = this->val->constant_expression_value();
-
- if (v != NULL) {
- ir_constant_data data = { { 0 } };
-
- const unsigned swiz_idx[4] = {
- this->mask.x, this->mask.y, this->mask.z, this->mask.w
- };
-
- for (unsigned i = 0; i < this->mask.num_components; i++) {
- switch (v->type->base_type) {
- case GLSL_TYPE_UINT:
- case GLSL_TYPE_INT: data.u[i] = v->value.u[swiz_idx[i]]; break;
- case GLSL_TYPE_FLOAT: data.f[i] = v->value.f[swiz_idx[i]]; break;
- case GLSL_TYPE_BOOL: data.b[i] = v->value.b[swiz_idx[i]]; break;
- default: assert(!"Should not get here."); break;
- }
- }
-
- void *ctx = ralloc_parent(this);
- return new(ctx) ir_constant(this->type, &data);
- }
- return NULL;
-}
-
-
-ir_constant *
-ir_dereference_variable::constant_expression_value()
-{
- /* This may occur during compile and var->type is glsl_type::error_type */
- if (!var)
- return NULL;
-
- /* The constant_value of a uniform variable is its initializer,
- * not the lifetime constant value of the uniform.
- */
- if (var->mode == ir_var_uniform)
- return NULL;
-
- if (!var->constant_value)
- return NULL;
-
- return var->constant_value->clone(ralloc_parent(var), NULL);
-}
-
-
-ir_constant *
-ir_dereference_array::constant_expression_value()
-{
- ir_constant *array = this->array->constant_expression_value();
- ir_constant *idx = this->array_index->constant_expression_value();
-
- if ((array != NULL) && (idx != NULL)) {
- void *ctx = ralloc_parent(this);
- if (array->type->is_matrix()) {
- /* Array access of a matrix results in a vector.
- */
- const unsigned column = idx->value.u[0];
-
- const glsl_type *const column_type = array->type->column_type();
-
- /* Offset in the constant matrix to the first element of the column
- * to be extracted.
- */
- const unsigned mat_idx = column * column_type->vector_elements;
-
- ir_constant_data data = { { 0 } };
-
- switch (column_type->base_type) {
- case GLSL_TYPE_UINT:
- case GLSL_TYPE_INT:
- for (unsigned i = 0; i < column_type->vector_elements; i++)
- data.u[i] = array->value.u[mat_idx + i];
-
- break;
-
- case GLSL_TYPE_FLOAT:
- for (unsigned i = 0; i < column_type->vector_elements; i++)
- data.f[i] = array->value.f[mat_idx + i];
-
- break;
-
- default:
- assert(!"Should not get here.");
- break;
- }
-
- return new(ctx) ir_constant(column_type, &data);
- } else if (array->type->is_vector()) {
- const unsigned component = idx->value.u[0];
-
- return new(ctx) ir_constant(array, component);
- } else {
- const unsigned index = idx->value.u[0];
- return array->get_array_element(index)->clone(ctx, NULL);
- }
- }
- return NULL;
-}
-
-
-ir_constant *
-ir_dereference_record::constant_expression_value()
-{
- ir_constant *v = this->record->constant_expression_value();
-
- return (v != NULL) ? v->get_record_field(this->field) : NULL;
-}
-
-
-ir_constant *
-ir_assignment::constant_expression_value()
-{
- /* FINISHME: Handle CEs involving assignment (return RHS) */
- return NULL;
-}
-
-
-ir_constant *
-ir_constant::constant_expression_value()
-{
- return this;
-}
-
-
-ir_constant *
-ir_call::constant_expression_value()
-{
- if (this->type == glsl_type::error_type)
- return NULL;
-
- /* From the GLSL 1.20 spec, page 23:
- * "Function calls to user-defined functions (non-built-in functions)
- * cannot be used to form constant expressions."
- */
- if (!this->callee->is_builtin)
- return NULL;
-
- unsigned num_parameters = 0;
-
- /* Check if all parameters are constant */
- ir_constant *op[3];
- foreach_list(n, &this->actual_parameters) {
- ir_constant *constant = ((ir_rvalue *) n)->constant_expression_value();
- if (constant == NULL)
- return NULL;
-
- op[num_parameters] = constant;
-
- assert(num_parameters < 3);
- num_parameters++;
- }
-
- /* Individual cases below can either:
- * - Assign "expr" a new ir_expression to evaluate (for basic opcodes)
- * - Fill "data" with appopriate constant data
- * - Return an ir_constant directly.
- */
- void *mem_ctx = ralloc_parent(this);
- ir_expression *expr = NULL;
-
- ir_constant_data data;
- memset(&data, 0, sizeof(data));
-
- const char *callee = this->callee_name();
- if (strcmp(callee, "abs") == 0) {
- expr = new(mem_ctx) ir_expression(ir_unop_abs, type, op[0], NULL);
- } else if (strcmp(callee, "all") == 0) {
- assert(op[0]->type->is_boolean());
- for (unsigned c = 0; c < op[0]->type->components(); c++) {
- if (!op[0]->value.b[c])
- return new(mem_ctx) ir_constant(false);
- }
- return new(mem_ctx) ir_constant(true);
- } else if (strcmp(callee, "any") == 0) {
- assert(op[0]->type->is_boolean());
- for (unsigned c = 0; c < op[0]->type->components(); c++) {
- if (op[0]->value.b[c])
- return new(mem_ctx) ir_constant(true);
- }
- return new(mem_ctx) ir_constant(false);
- } else if (strcmp(callee, "acos") == 0) {
- assert(op[0]->type->is_float());
- for (unsigned c = 0; c < op[0]->type->components(); c++)
- data.f[c] = acosf(op[0]->value.f[c]);
- } else if (strcmp(callee, "acosh") == 0) {
- assert(op[0]->type->is_float());
- for (unsigned c = 0; c < op[0]->type->components(); c++)
- data.f[c] = acoshf(op[0]->value.f[c]);
- } else if (strcmp(callee, "asin") == 0) {
- assert(op[0]->type->is_float());
- for (unsigned c = 0; c < op[0]->type->components(); c++)
- data.f[c] = asinf(op[0]->value.f[c]);
- } else if (strcmp(callee, "asinh") == 0) {
- assert(op[0]->type->is_float());
- for (unsigned c = 0; c < op[0]->type->components(); c++)
- data.f[c] = asinhf(op[0]->value.f[c]);
- } else if (strcmp(callee, "atan") == 0) {
- assert(op[0]->type->is_float());
- if (num_parameters == 2) {
- assert(op[1]->type->is_float());
- for (unsigned c = 0; c < op[0]->type->components(); c++)
- data.f[c] = atan2f(op[0]->value.f[c], op[1]->value.f[c]);
- } else {
- for (unsigned c = 0; c < op[0]->type->components(); c++)
- data.f[c] = atanf(op[0]->value.f[c]);
- }
- } else if (strcmp(callee, "atanh") == 0) {
- assert(op[0]->type->is_float());
- for (unsigned c = 0; c < op[0]->type->components(); c++)
- data.f[c] = atanhf(op[0]->value.f[c]);
- } else if (strcmp(callee, "dFdx") == 0 || strcmp(callee, "dFdy") == 0) {
- return ir_constant::zero(mem_ctx, this->type);
- } else if (strcmp(callee, "ceil") == 0) {
- expr = new(mem_ctx) ir_expression(ir_unop_ceil, type, op[0], NULL);
- } else if (strcmp(callee, "clamp") == 0) {
- assert(num_parameters == 3);
- unsigned c1_inc = op[1]->type->is_scalar() ? 0 : 1;
- unsigned c2_inc = op[2]->type->is_scalar() ? 0 : 1;
- for (unsigned c = 0, c1 = 0, c2 = 0;
- c < op[0]->type->components();
- c1 += c1_inc, c2 += c2_inc, c++) {
-
- switch (op[0]->type->base_type) {
- case GLSL_TYPE_UINT:
- data.u[c] = CLAMP(op[0]->value.u[c], op[1]->value.u[c1],
- op[2]->value.u[c2]);
- break;
- case GLSL_TYPE_INT:
- data.i[c] = CLAMP(op[0]->value.i[c], op[1]->value.i[c1],
- op[2]->value.i[c2]);
- break;
- case GLSL_TYPE_FLOAT:
- data.f[c] = CLAMP(op[0]->value.f[c], op[1]->value.f[c1],
- op[2]->value.f[c2]);
- break;
- default:
- assert(!"Should not get here.");
- }
- }
- } else if (strcmp(callee, "cos") == 0) {
- expr = new(mem_ctx) ir_expression(ir_unop_cos, type, op[0], NULL);
- } else if (strcmp(callee, "cosh") == 0) {
- assert(op[0]->type->is_float());
- for (unsigned c = 0; c < op[0]->type->components(); c++)
- data.f[c] = coshf(op[0]->value.f[c]);
- } else if (strcmp(callee, "cross") == 0) {
- assert(op[0]->type == glsl_type::vec3_type);
- assert(op[1]->type == glsl_type::vec3_type);
- data.f[0] = (op[0]->value.f[1] * op[1]->value.f[2] -
- op[1]->value.f[1] * op[0]->value.f[2]);
- data.f[1] = (op[0]->value.f[2] * op[1]->value.f[0] -
- op[1]->value.f[2] * op[0]->value.f[0]);
- data.f[2] = (op[0]->value.f[0] * op[1]->value.f[1] -
- op[1]->value.f[0] * op[0]->value.f[1]);
- } else if (strcmp(callee, "degrees") == 0) {
- assert(op[0]->type->is_float());
- for (unsigned c = 0; c < op[0]->type->components(); c++)
- data.f[c] = 180.0F / M_PI * op[0]->value.f[c];
- } else if (strcmp(callee, "distance") == 0) {
- assert(op[0]->type->is_float() && op[1]->type->is_float());
- float length_squared = 0.0;
- for (unsigned c = 0; c < op[0]->type->components(); c++) {
- float t = op[0]->value.f[c] - op[1]->value.f[c];
- length_squared += t * t;
- }
- return new(mem_ctx) ir_constant(sqrtf(length_squared));
- } else if (strcmp(callee, "dot") == 0) {
- return new(mem_ctx) ir_constant(dot(op[0], op[1]));
- } else if (strcmp(callee, "equal") == 0) {
- assert(op[0]->type->is_vector() && op[1] && op[1]->type->is_vector());
- for (unsigned c = 0; c < op[0]->type->components(); c++) {
- switch (op[0]->type->base_type) {
- case GLSL_TYPE_UINT:
- data.b[c] = op[0]->value.u[c] == op[1]->value.u[c];
- break;
- case GLSL_TYPE_INT:
- data.b[c] = op[0]->value.i[c] == op[1]->value.i[c];
- break;
- case GLSL_TYPE_FLOAT:
- data.b[c] = op[0]->value.f[c] == op[1]->value.f[c];
- break;
- case GLSL_TYPE_BOOL:
- data.b[c] = op[0]->value.b[c] == op[1]->value.b[c];
- break;
- default:
- assert(!"Should not get here.");
- }
- }
- } else if (strcmp(callee, "exp") == 0) {
- expr = new(mem_ctx) ir_expression(ir_unop_exp, type, op[0], NULL);
- } else if (strcmp(callee, "exp2") == 0) {
- expr = new(mem_ctx) ir_expression(ir_unop_exp2, type, op[0], NULL);
- } else if (strcmp(callee, "faceforward") == 0) {
- if (dot(op[2], op[1]) < 0)
- return op[0];
- for (unsigned c = 0; c < op[0]->type->components(); c++)
- data.f[c] = -op[0]->value.f[c];
- } else if (strcmp(callee, "floor") == 0) {
- expr = new(mem_ctx) ir_expression(ir_unop_floor, type, op[0], NULL);
- } else if (strcmp(callee, "fract") == 0) {
- expr = new(mem_ctx) ir_expression(ir_unop_fract, type, op[0], NULL);
- } else if (strcmp(callee, "fwidth") == 0) {
- return ir_constant::zero(mem_ctx, this->type);
- } else if (strcmp(callee, "greaterThan") == 0) {
- assert(op[0]->type->is_vector() && op[1] && op[1]->type->is_vector());
- for (unsigned c = 0; c < op[0]->type->components(); c++) {
- switch (op[0]->type->base_type) {
- case GLSL_TYPE_UINT:
- data.b[c] = op[0]->value.u[c] > op[1]->value.u[c];
- break;
- case GLSL_TYPE_INT:
- data.b[c] = op[0]->value.i[c] > op[1]->value.i[c];
- break;
- case GLSL_TYPE_FLOAT:
- data.b[c] = op[0]->value.f[c] > op[1]->value.f[c];
- break;
- default:
- assert(!"Should not get here.");
- }
- }
- } else if (strcmp(callee, "greaterThanEqual") == 0) {
- assert(op[0]->type->is_vector() && op[1] && op[1]->type->is_vector());
- for (unsigned c = 0; c < op[0]->type->components(); c++) {
- switch (op[0]->type->base_type) {
- case GLSL_TYPE_UINT:
- data.b[c] = op[0]->value.u[c] >= op[1]->value.u[c];
- break;
- case GLSL_TYPE_INT:
- data.b[c] = op[0]->value.i[c] >= op[1]->value.i[c];
- break;
- case GLSL_TYPE_FLOAT:
- data.b[c] = op[0]->value.f[c] >= op[1]->value.f[c];
- break;
- default:
- assert(!"Should not get here.");
- }
- }
- } else if (strcmp(callee, "inversesqrt") == 0) {
- expr = new(mem_ctx) ir_expression(ir_unop_rsq, type, op[0], NULL);
- } else if (strcmp(callee, "length") == 0) {
- return new(mem_ctx) ir_constant(sqrtf(dot(op[0], op[0])));
- } else if (strcmp(callee, "lessThan") == 0) {
- assert(op[0]->type->is_vector() && op[1] && op[1]->type->is_vector());
- for (unsigned c = 0; c < op[0]->type->components(); c++) {
- switch (op[0]->type->base_type) {
- case GLSL_TYPE_UINT:
- data.b[c] = op[0]->value.u[c] < op[1]->value.u[c];
- break;
- case GLSL_TYPE_INT:
- data.b[c] = op[0]->value.i[c] < op[1]->value.i[c];
- break;
- case GLSL_TYPE_FLOAT:
- data.b[c] = op[0]->value.f[c] < op[1]->value.f[c];
- break;
- default:
- assert(!"Should not get here.");
- }
- }
- } else if (strcmp(callee, "lessThanEqual") == 0) {
- assert(op[0]->type->is_vector() && op[1] && op[1]->type->is_vector());
- for (unsigned c = 0; c < op[0]->type->components(); c++) {
- switch (op[0]->type->base_type) {
- case GLSL_TYPE_UINT:
- data.b[c] = op[0]->value.u[c] <= op[1]->value.u[c];
- break;
- case GLSL_TYPE_INT:
- data.b[c] = op[0]->value.i[c] <= op[1]->value.i[c];
- break;
- case GLSL_TYPE_FLOAT:
- data.b[c] = op[0]->value.f[c] <= op[1]->value.f[c];
- break;
- default:
- assert(!"Should not get here.");
- }
- }
- } else if (strcmp(callee, "log") == 0) {
- expr = new(mem_ctx) ir_expression(ir_unop_log, type, op[0], NULL);
- } else if (strcmp(callee, "log2") == 0) {
- expr = new(mem_ctx) ir_expression(ir_unop_log2, type, op[0], NULL);
- } else if (strcmp(callee, "matrixCompMult") == 0) {
- assert(op[0]->type->is_float() && op[1]->type->is_float());
- for (unsigned c = 0; c < op[0]->type->components(); c++)
- data.f[c] = op[0]->value.f[c] * op[1]->value.f[c];
- } else if (strcmp(callee, "max") == 0) {
- expr = new(mem_ctx) ir_expression(ir_binop_max, type, op[0], op[1]);
- } else if (strcmp(callee, "min") == 0) {
- expr = new(mem_ctx) ir_expression(ir_binop_min, type, op[0], op[1]);
- } else if (strcmp(callee, "mix") == 0) {
- assert(op[0]->type->is_float() && op[1]->type->is_float());
- if (op[2]->type->is_float()) {
- unsigned c2_inc = op[2]->type->is_scalar() ? 0 : 1;
- unsigned components = op[0]->type->components();
- for (unsigned c = 0, c2 = 0; c < components; c2 += c2_inc, c++) {
- data.f[c] = op[0]->value.f[c] * (1 - op[2]->value.f[c2]) +
- op[1]->value.f[c] * op[2]->value.f[c2];
- }
- } else {
- assert(op[2]->type->is_boolean());
- for (unsigned c = 0; c < op[0]->type->components(); c++)
- data.f[c] = op[op[2]->value.b[c] ? 1 : 0]->value.f[c];
- }
- } else if (strcmp(callee, "mod") == 0) {
- expr = new(mem_ctx) ir_expression(ir_binop_mod, type, op[0], op[1]);
- } else if (strcmp(callee, "normalize") == 0) {
- assert(op[0]->type->is_float());
- float length = sqrtf(dot(op[0], op[0]));
-
- if (length == 0)
- return ir_constant::zero(mem_ctx, this->type);
-
- for (unsigned c = 0; c < op[0]->type->components(); c++)
- data.f[c] = op[0]->value.f[c] / length;
- } else if (strcmp(callee, "not") == 0) {
- expr = new(mem_ctx) ir_expression(ir_unop_logic_not, type, op[0], NULL);
- } else if (strcmp(callee, "notEqual") == 0) {
- assert(op[0]->type->is_vector() && op[1] && op[1]->type->is_vector());
- for (unsigned c = 0; c < op[0]->type->components(); c++) {
- switch (op[0]->type->base_type) {
- case GLSL_TYPE_UINT:
- data.b[c] = op[0]->value.u[c] != op[1]->value.u[c];
- break;
- case GLSL_TYPE_INT:
- data.b[c] = op[0]->value.i[c] != op[1]->value.i[c];
- break;
- case GLSL_TYPE_FLOAT:
- data.b[c] = op[0]->value.f[c] != op[1]->value.f[c];
- break;
- case GLSL_TYPE_BOOL:
- data.b[c] = op[0]->value.b[c] != op[1]->value.b[c];
- break;
- default:
- assert(!"Should not get here.");
- }
- }
- } else if (strcmp(callee, "outerProduct") == 0) {
- assert(op[0]->type->is_vector() && op[1]->type->is_vector());
- const unsigned m = op[0]->type->vector_elements;
- const unsigned n = op[1]->type->vector_elements;
- for (unsigned j = 0; j < n; j++) {
- for (unsigned i = 0; i < m; i++) {
- data.f[i+m*j] = op[0]->value.f[i] * op[1]->value.f[j];
- }
- }
- } else if (strcmp(callee, "pow") == 0) {
- expr = new(mem_ctx) ir_expression(ir_binop_pow, type, op[0], op[1]);
- } else if (strcmp(callee, "radians") == 0) {
- assert(op[0]->type->is_float());
- for (unsigned c = 0; c < op[0]->type->components(); c++)
- data.f[c] = M_PI / 180.0F * op[0]->value.f[c];
- } else if (strcmp(callee, "reflect") == 0) {
- assert(op[0]->type->is_float());
- float dot_NI = dot(op[1], op[0]);
- for (unsigned c = 0; c < op[0]->type->components(); c++)
- data.f[c] = op[0]->value.f[c] - 2 * dot_NI * op[1]->value.f[c];
- } else if (strcmp(callee, "refract") == 0) {
- const float eta = op[2]->value.f[0];
- const float dot_NI = dot(op[1], op[0]);
- const float k = 1.0F - eta * eta * (1.0F - dot_NI * dot_NI);
- if (k < 0.0) {
- return ir_constant::zero(mem_ctx, this->type);
- } else {
- for (unsigned c = 0; c < type->components(); c++) {
- data.f[c] = eta * op[0]->value.f[c] - (eta * dot_NI + sqrtf(k))
- * op[1]->value.f[c];
- }
- }
- } else if (strcmp(callee, "sign") == 0) {
- expr = new(mem_ctx) ir_expression(ir_unop_sign, type, op[0], NULL);
- } else if (strcmp(callee, "sin") == 0) {
- expr = new(mem_ctx) ir_expression(ir_unop_sin, type, op[0], NULL);
- } else if (strcmp(callee, "sinh") == 0) {
- assert(op[0]->type->is_float());
- for (unsigned c = 0; c < op[0]->type->components(); c++)
- data.f[c] = sinhf(op[0]->value.f[c]);
- } else if (strcmp(callee, "smoothstep") == 0) {
- assert(num_parameters == 3);
- assert(op[1]->type == op[0]->type);
- unsigned edge_inc = op[0]->type->is_scalar() ? 0 : 1;
- for (unsigned c = 0, e = 0; c < type->components(); e += edge_inc, c++) {
- const float edge0 = op[0]->value.f[e];
- const float edge1 = op[1]->value.f[e];
- if (edge0 == edge1) {
- data.f[c] = 0.0; /* Avoid a crash - results are undefined anyway */
- } else {
- const float numerator = op[2]->value.f[c] - edge0;
- const float denominator = edge1 - edge0;
- const float t = CLAMP(numerator/denominator, 0, 1);
- data.f[c] = t * t * (3 - 2 * t);
- }
- }
- } else if (strcmp(callee, "sqrt") == 0) {
- expr = new(mem_ctx) ir_expression(ir_unop_sqrt, type, op[0], NULL);
- } else if (strcmp(callee, "step") == 0) {
- assert(op[0]->type->is_float() && op[1]->type->is_float());
- /* op[0] (edge) may be either a scalar or a vector */
- const unsigned c0_inc = op[0]->type->is_scalar() ? 0 : 1;
- for (unsigned c = 0, c0 = 0; c < type->components(); c0 += c0_inc, c++)
- data.f[c] = (op[1]->value.f[c] < op[0]->value.f[c0]) ? 0.0F : 1.0F;
- } else if (strcmp(callee, "tan") == 0) {
- assert(op[0]->type->is_float());
- for (unsigned c = 0; c < op[0]->type->components(); c++)
- data.f[c] = tanf(op[0]->value.f[c]);
- } else if (strcmp(callee, "tanh") == 0) {
- assert(op[0]->type->is_float());
- for (unsigned c = 0; c < op[0]->type->components(); c++)
- data.f[c] = tanhf(op[0]->value.f[c]);
- } else if (strcmp(callee, "transpose") == 0) {
- assert(op[0]->type->is_matrix());
- const unsigned n = op[0]->type->vector_elements;
- const unsigned m = op[0]->type->matrix_columns;
- for (unsigned j = 0; j < m; j++) {
- for (unsigned i = 0; i < n; i++) {
- data.f[m*i+j] += op[0]->value.f[i+n*j];
- }
- }
- } else {
- /* Unsupported builtin - some are not allowed in constant expressions. */
- return NULL;
- }
-
- if (expr != NULL)
- return expr->constant_expression_value();
-
- return new(mem_ctx) ir_constant(this->type, &data);
-}
+/*
+ * Copyright © 2010 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+/**
+ * \file ir_constant_expression.cpp
+ * Evaluate and process constant valued expressions
+ *
+ * In GLSL, constant valued expressions are used in several places. These
+ * must be processed and evaluated very early in the compilation process.
+ *
+ * * Sizes of arrays
+ * * Initializers for uniforms
+ * * Initializers for \c const variables
+ */
+
+#include <math.h>
+#include "main/core.h" /* for MAX2, MIN2, CLAMP */
+#include "ir.h"
+#include "ir_visitor.h"
+#include "glsl_types.h"
+
+static float
+dot(ir_constant *op0, ir_constant *op1)
+{
+ assert(op0->type->is_float() && op1->type->is_float());
+
+ float result = 0;
+ for (unsigned c = 0; c < op0->type->components(); c++)
+ result += op0->value.f[c] * op1->value.f[c];
+
+ return result;
+}
+
+ir_constant *
+ir_expression::constant_expression_value()
+{
+ if (this->type->is_error())
+ return NULL;
+
+ ir_constant *op[Elements(this->operands)] = { NULL, };
+ ir_constant_data data;
+
+ memset(&data, 0, sizeof(data));
+
+ for (unsigned operand = 0; operand < this->get_num_operands(); operand++) {
+ op[operand] = this->operands[operand]->constant_expression_value();
+ if (!op[operand])
+ return NULL;
+ }
+
+ if (op[1] != NULL)
+ assert(op[0]->type->base_type == op[1]->type->base_type);
+
+ bool op0_scalar = op[0]->type->is_scalar();
+ bool op1_scalar = op[1] != NULL && op[1]->type->is_scalar();
+
+ /* When iterating over a vector or matrix's components, we want to increase
+ * the loop counter. However, for scalars, we want to stay at 0.
+ */
+ unsigned c0_inc = op0_scalar ? 0 : 1;
+ unsigned c1_inc = op1_scalar ? 0 : 1;
+ unsigned components;
+ if (op1_scalar || !op[1]) {
+ components = op[0]->type->components();
+ } else {
+ components = op[1]->type->components();
+ }
+
+ void *ctx = ralloc_parent(this);
+
+ /* Handle array operations here, rather than below. */
+ if (op[0]->type->is_array()) {
+ assert(op[1] != NULL && op[1]->type->is_array());
+ switch (this->operation) {
+ case ir_binop_all_equal:
+ return new(ctx) ir_constant(op[0]->has_value(op[1]));
+ case ir_binop_any_nequal:
+ return new(ctx) ir_constant(!op[0]->has_value(op[1]));
+ default:
+ break;
+ }
+ return NULL;
+ }
+
+ switch (this->operation) {
+ case ir_unop_bit_not:
+ switch (op[0]->type->base_type) {
+ case GLSL_TYPE_INT:
+ for (unsigned c = 0; c < components; c++)
+ data.i[c] = ~ op[0]->value.i[c];
+ break;
+ case GLSL_TYPE_UINT:
+ for (unsigned c = 0; c < components; c++)
+ data.u[c] = ~ op[0]->value.u[c];
+ break;
+ default:
+ assert(0);
+ }
+ break;
+
+ case ir_unop_logic_not:
+ assert(op[0]->type->base_type == GLSL_TYPE_BOOL);
+ for (unsigned c = 0; c < op[0]->type->components(); c++)
+ data.b[c] = !op[0]->value.b[c];
+ break;
+
+ case ir_unop_f2i:
+ assert(op[0]->type->base_type == GLSL_TYPE_FLOAT);
+ for (unsigned c = 0; c < op[0]->type->components(); c++) {
+ data.i[c] = (int) op[0]->value.f[c];
+ }
+ break;
+ case ir_unop_i2f:
+ assert(op[0]->type->base_type == GLSL_TYPE_INT);
+ for (unsigned c = 0; c < op[0]->type->components(); c++) {
+ data.f[c] = (float) op[0]->value.i[c];
+ }
+ break;
+ case ir_unop_u2f:
+ assert(op[0]->type->base_type == GLSL_TYPE_UINT);
+ for (unsigned c = 0; c < op[0]->type->components(); c++) {
+ data.f[c] = (float) op[0]->value.u[c];
+ }
+ break;
+ case ir_unop_b2f:
+ assert(op[0]->type->base_type == GLSL_TYPE_BOOL);
+ for (unsigned c = 0; c < op[0]->type->components(); c++) {
+ data.f[c] = op[0]->value.b[c] ? 1.0F : 0.0F;
+ }
+ break;
+ case ir_unop_f2b:
+ assert(op[0]->type->base_type == GLSL_TYPE_FLOAT);
+ for (unsigned c = 0; c < op[0]->type->components(); c++) {
+ data.b[c] = op[0]->value.f[c] != 0.0F ? true : false;
+ }
+ break;
+ case ir_unop_b2i:
+ assert(op[0]->type->base_type == GLSL_TYPE_BOOL);
+ for (unsigned c = 0; c < op[0]->type->components(); c++) {
+ data.u[c] = op[0]->value.b[c] ? 1 : 0;
+ }
+ break;
+ case ir_unop_i2b:
+ assert(op[0]->type->is_integer());
+ for (unsigned c = 0; c < op[0]->type->components(); c++) {
+ data.b[c] = op[0]->value.u[c] ? true : false;
+ }
+ break;
+
+ case ir_unop_any:
+ assert(op[0]->type->is_boolean());
+ data.b[0] = false;
+ for (unsigned c = 0; c < op[0]->type->components(); c++) {
+ if (op[0]->value.b[c])
+ data.b[0] = true;
+ }
+ break;
+
+ case ir_unop_trunc:
+ assert(op[0]->type->base_type == GLSL_TYPE_FLOAT);
+ for (unsigned c = 0; c < op[0]->type->components(); c++) {
+ data.f[c] = truncf(op[0]->value.f[c]);
+ }
+ break;
+
+ case ir_unop_ceil:
+ assert(op[0]->type->base_type == GLSL_TYPE_FLOAT);
+ for (unsigned c = 0; c < op[0]->type->components(); c++) {
+ data.f[c] = ceilf(op[0]->value.f[c]);
+ }
+ break;
+
+ case ir_unop_floor:
+ assert(op[0]->type->base_type == GLSL_TYPE_FLOAT);
+ for (unsigned c = 0; c < op[0]->type->components(); c++) {
+ data.f[c] = floorf(op[0]->value.f[c]);
+ }
+ break;
+
+ case ir_unop_fract:
+ for (unsigned c = 0; c < op[0]->type->components(); c++) {
+ switch (this->type->base_type) {
+ case GLSL_TYPE_UINT:
+ data.u[c] = 0;
+ break;
+ case GLSL_TYPE_INT:
+ data.i[c] = 0;
+ break;
+ case GLSL_TYPE_FLOAT:
+ data.f[c] = op[0]->value.f[c] - floor(op[0]->value.f[c]);
+ break;
+ default:
+ assert(0);
+ }
+ }
+ break;
+
+ case ir_unop_sin:
+ case ir_unop_sin_reduced:
+ assert(op[0]->type->base_type == GLSL_TYPE_FLOAT);
+ for (unsigned c = 0; c < op[0]->type->components(); c++) {
+ data.f[c] = sinf(op[0]->value.f[c]);
+ }
+ break;
+
+ case ir_unop_cos:
+ case ir_unop_cos_reduced:
+ assert(op[0]->type->base_type == GLSL_TYPE_FLOAT);
+ for (unsigned c = 0; c < op[0]->type->components(); c++) {
+ data.f[c] = cosf(op[0]->value.f[c]);
+ }
+ break;
+
+ case ir_unop_neg:
+ for (unsigned c = 0; c < op[0]->type->components(); c++) {
+ switch (this->type->base_type) {
+ case GLSL_TYPE_UINT:
+ data.u[c] = -((int) op[0]->value.u[c]);
+ break;
+ case GLSL_TYPE_INT:
+ data.i[c] = -op[0]->value.i[c];
+ break;
+ case GLSL_TYPE_FLOAT:
+ data.f[c] = -op[0]->value.f[c];
+ break;
+ default:
+ assert(0);
+ }
+ }
+ break;
+
+ case ir_unop_abs:
+ for (unsigned c = 0; c < op[0]->type->components(); c++) {
+ switch (this->type->base_type) {
+ case GLSL_TYPE_UINT:
+ data.u[c] = op[0]->value.u[c];
+ break;
+ case GLSL_TYPE_INT:
+ data.i[c] = op[0]->value.i[c];
+ if (data.i[c] < 0)
+ data.i[c] = -data.i[c];
+ break;
+ case GLSL_TYPE_FLOAT:
+ data.f[c] = fabs(op[0]->value.f[c]);
+ break;
+ default:
+ assert(0);
+ }
+ }
+ break;
+
+ case ir_unop_sign:
+ for (unsigned c = 0; c < op[0]->type->components(); c++) {
+ switch (this->type->base_type) {
+ case GLSL_TYPE_UINT:
+ data.u[c] = op[0]->value.i[c] > 0;
+ break;
+ case GLSL_TYPE_INT:
+ data.i[c] = (op[0]->value.i[c] > 0) - (op[0]->value.i[c] < 0);
+ break;
+ case GLSL_TYPE_FLOAT:
+ data.f[c] = float((op[0]->value.f[c] > 0)-(op[0]->value.f[c] < 0));
+ break;
+ default:
+ assert(0);
+ }
+ }
+ break;
+
+ case ir_unop_rcp:
+ assert(op[0]->type->base_type == GLSL_TYPE_FLOAT);
+ for (unsigned c = 0; c < op[0]->type->components(); c++) {
+ switch (this->type->base_type) {
+ case GLSL_TYPE_UINT:
+ if (op[0]->value.u[c] != 0.0)
+ data.u[c] = 1 / op[0]->value.u[c];
+ break;
+ case GLSL_TYPE_INT:
+ if (op[0]->value.i[c] != 0.0)
+ data.i[c] = 1 / op[0]->value.i[c];
+ break;
+ case GLSL_TYPE_FLOAT:
+ if (op[0]->value.f[c] != 0.0)
+ data.f[c] = 1.0F / op[0]->value.f[c];
+ break;
+ default:
+ assert(0);
+ }
+ }
+ break;
+
+ case ir_unop_rsq:
+ assert(op[0]->type->base_type == GLSL_TYPE_FLOAT);
+ for (unsigned c = 0; c < op[0]->type->components(); c++) {
+ data.f[c] = 1.0F / sqrtf(op[0]->value.f[c]);
+ }
+ break;
+
+ case ir_unop_sqrt:
+ assert(op[0]->type->base_type == GLSL_TYPE_FLOAT);
+ for (unsigned c = 0; c < op[0]->type->components(); c++) {
+ data.f[c] = sqrtf(op[0]->value.f[c]);
+ }
+ break;
+
+ case ir_unop_exp:
+ assert(op[0]->type->base_type == GLSL_TYPE_FLOAT);
+ for (unsigned c = 0; c < op[0]->type->components(); c++) {
+ data.f[c] = expf(op[0]->value.f[c]);
+ }
+ break;
+
+ case ir_unop_exp2:
+ assert(op[0]->type->base_type == GLSL_TYPE_FLOAT);
+ for (unsigned c = 0; c < op[0]->type->components(); c++) {
+ data.f[c] = exp2f(op[0]->value.f[c]);
+ }
+ break;
+
+ case ir_unop_log:
+ assert(op[0]->type->base_type == GLSL_TYPE_FLOAT);
+ for (unsigned c = 0; c < op[0]->type->components(); c++) {
+ data.f[c] = logf(op[0]->value.f[c]);
+ }
+ break;
+
+ case ir_unop_log2:
+ assert(op[0]->type->base_type == GLSL_TYPE_FLOAT);
+ for (unsigned c = 0; c < op[0]->type->components(); c++) {
+ data.f[c] = log2f(op[0]->value.f[c]);
+ }
+ break;
+
+ case ir_unop_dFdx:
+ case ir_unop_dFdy:
+ assert(op[0]->type->base_type == GLSL_TYPE_FLOAT);
+ for (unsigned c = 0; c < op[0]->type->components(); c++) {
+ data.f[c] = 0.0;
+ }
+ break;
+
+ case ir_binop_pow:
+ assert(op[0]->type->base_type == GLSL_TYPE_FLOAT);
+ for (unsigned c = 0; c < op[0]->type->components(); c++) {
+ data.f[c] = powf(op[0]->value.f[c], op[1]->value.f[c]);
+ }
+ break;
+
+ case ir_binop_dot:
+ data.f[0] = dot(op[0], op[1]);
+ break;
+
+ case ir_binop_min:
+ assert(op[0]->type == op[1]->type || op0_scalar || op1_scalar);
+ for (unsigned c = 0, c0 = 0, c1 = 0;
+ c < components;
+ c0 += c0_inc, c1 += c1_inc, c++) {
+
+ switch (op[0]->type->base_type) {
+ case GLSL_TYPE_UINT:
+ data.u[c] = MIN2(op[0]->value.u[c0], op[1]->value.u[c1]);
+ break;
+ case GLSL_TYPE_INT:
+ data.i[c] = MIN2(op[0]->value.i[c0], op[1]->value.i[c1]);
+ break;
+ case GLSL_TYPE_FLOAT:
+ data.f[c] = MIN2(op[0]->value.f[c0], op[1]->value.f[c1]);
+ break;
+ default:
+ assert(0);
+ }
+ }
+
+ break;
+ case ir_binop_max:
+ assert(op[0]->type == op[1]->type || op0_scalar || op1_scalar);
+ for (unsigned c = 0, c0 = 0, c1 = 0;
+ c < components;
+ c0 += c0_inc, c1 += c1_inc, c++) {
+
+ switch (op[0]->type->base_type) {
+ case GLSL_TYPE_UINT:
+ data.u[c] = MAX2(op[0]->value.u[c0], op[1]->value.u[c1]);
+ break;
+ case GLSL_TYPE_INT:
+ data.i[c] = MAX2(op[0]->value.i[c0], op[1]->value.i[c1]);
+ break;
+ case GLSL_TYPE_FLOAT:
+ data.f[c] = MAX2(op[0]->value.f[c0], op[1]->value.f[c1]);
+ break;
+ default:
+ assert(0);
+ }
+ }
+ break;
+
+ case ir_binop_add:
+ assert(op[0]->type == op[1]->type || op0_scalar || op1_scalar);
+ for (unsigned c = 0, c0 = 0, c1 = 0;
+ c < components;
+ c0 += c0_inc, c1 += c1_inc, c++) {
+
+ switch (op[0]->type->base_type) {
+ case GLSL_TYPE_UINT:
+ data.u[c] = op[0]->value.u[c0] + op[1]->value.u[c1];
+ break;
+ case GLSL_TYPE_INT:
+ data.i[c] = op[0]->value.i[c0] + op[1]->value.i[c1];
+ break;
+ case GLSL_TYPE_FLOAT:
+ data.f[c] = op[0]->value.f[c0] + op[1]->value.f[c1];
+ break;
+ default:
+ assert(0);
+ }
+ }
+
+ break;
+ case ir_binop_sub:
+ assert(op[0]->type == op[1]->type || op0_scalar || op1_scalar);
+ for (unsigned c = 0, c0 = 0, c1 = 0;
+ c < components;
+ c0 += c0_inc, c1 += c1_inc, c++) {
+
+ switch (op[0]->type->base_type) {
+ case GLSL_TYPE_UINT:
+ data.u[c] = op[0]->value.u[c0] - op[1]->value.u[c1];
+ break;
+ case GLSL_TYPE_INT:
+ data.i[c] = op[0]->value.i[c0] - op[1]->value.i[c1];
+ break;
+ case GLSL_TYPE_FLOAT:
+ data.f[c] = op[0]->value.f[c0] - op[1]->value.f[c1];
+ break;
+ default:
+ assert(0);
+ }
+ }
+
+ break;
+ case ir_binop_mul:
+ /* Check for equal types, or unequal types involving scalars */
+ if ((op[0]->type == op[1]->type && !op[0]->type->is_matrix())
+ || op0_scalar || op1_scalar) {
+ for (unsigned c = 0, c0 = 0, c1 = 0;
+ c < components;
+ c0 += c0_inc, c1 += c1_inc, c++) {
+
+ switch (op[0]->type->base_type) {
+ case GLSL_TYPE_UINT:
+ data.u[c] = op[0]->value.u[c0] * op[1]->value.u[c1];
+ break;
+ case GLSL_TYPE_INT:
+ data.i[c] = op[0]->value.i[c0] * op[1]->value.i[c1];
+ break;
+ case GLSL_TYPE_FLOAT:
+ data.f[c] = op[0]->value.f[c0] * op[1]->value.f[c1];
+ break;
+ default:
+ assert(0);
+ }
+ }
+ } else {
+ assert(op[0]->type->is_matrix() || op[1]->type->is_matrix());
+
+ /* Multiply an N-by-M matrix with an M-by-P matrix. Since either
+ * matrix can be a GLSL vector, either N or P can be 1.
+ *
+ * For vec*mat, the vector is treated as a row vector. This
+ * means the vector is a 1-row x M-column matrix.
+ *
+ * For mat*vec, the vector is treated as a column vector. Since
+ * matrix_columns is 1 for vectors, this just works.
+ */
+ const unsigned n = op[0]->type->is_vector()
+ ? 1 : op[0]->type->vector_elements;
+ const unsigned m = op[1]->type->vector_elements;
+ const unsigned p = op[1]->type->matrix_columns;
+ for (unsigned j = 0; j < p; j++) {
+ for (unsigned i = 0; i < n; i++) {
+ for (unsigned k = 0; k < m; k++) {
+ data.f[i+n*j] += op[0]->value.f[i+n*k]*op[1]->value.f[k+m*j];
+ }
+ }
+ }
+ }
+
+ break;
+ case ir_binop_div:
+ /* FINISHME: Emit warning when division-by-zero is detected. */
+ assert(op[0]->type == op[1]->type || op0_scalar || op1_scalar);
+ for (unsigned c = 0, c0 = 0, c1 = 0;
+ c < components;
+ c0 += c0_inc, c1 += c1_inc, c++) {
+
+ switch (op[0]->type->base_type) {
+ case GLSL_TYPE_UINT:
+ if (op[1]->value.u[c1] == 0) {
+ data.u[c] = 0;
+ } else {
+ data.u[c] = op[0]->value.u[c0] / op[1]->value.u[c1];
+ }
+ break;
+ case GLSL_TYPE_INT:
+ if (op[1]->value.i[c1] == 0) {
+ data.i[c] = 0;
+ } else {
+ data.i[c] = op[0]->value.i[c0] / op[1]->value.i[c1];
+ }
+ break;
+ case GLSL_TYPE_FLOAT:
+ data.f[c] = op[0]->value.f[c0] / op[1]->value.f[c1];
+ break;
+ default:
+ assert(0);
+ }
+ }
+
+ break;
+ case ir_binop_mod:
+ /* FINISHME: Emit warning when division-by-zero is detected. */
+ assert(op[0]->type == op[1]->type || op0_scalar || op1_scalar);
+ for (unsigned c = 0, c0 = 0, c1 = 0;
+ c < components;
+ c0 += c0_inc, c1 += c1_inc, c++) {
+
+ switch (op[0]->type->base_type) {
+ case GLSL_TYPE_UINT:
+ if (op[1]->value.u[c1] == 0) {
+ data.u[c] = 0;
+ } else {
+ data.u[c] = op[0]->value.u[c0] % op[1]->value.u[c1];
+ }
+ break;
+ case GLSL_TYPE_INT:
+ if (op[1]->value.i[c1] == 0) {
+ data.i[c] = 0;
+ } else {
+ data.i[c] = op[0]->value.i[c0] % op[1]->value.i[c1];
+ }
+ break;
+ case GLSL_TYPE_FLOAT:
+ /* We don't use fmod because it rounds toward zero; GLSL specifies
+ * the use of floor.
+ */
+ data.f[c] = op[0]->value.f[c0] - op[1]->value.f[c1]
+ * floorf(op[0]->value.f[c0] / op[1]->value.f[c1]);
+ break;
+ default:
+ assert(0);
+ }
+ }
+
+ break;
+
+ case ir_binop_logic_and:
+ assert(op[0]->type->base_type == GLSL_TYPE_BOOL);
+ for (unsigned c = 0; c < op[0]->type->components(); c++)
+ data.b[c] = op[0]->value.b[c] && op[1]->value.b[c];
+ break;
+ case ir_binop_logic_xor:
+ assert(op[0]->type->base_type == GLSL_TYPE_BOOL);
+ for (unsigned c = 0; c < op[0]->type->components(); c++)
+ data.b[c] = op[0]->value.b[c] ^ op[1]->value.b[c];
+ break;
+ case ir_binop_logic_or:
+ assert(op[0]->type->base_type == GLSL_TYPE_BOOL);
+ for (unsigned c = 0; c < op[0]->type->components(); c++)
+ data.b[c] = op[0]->value.b[c] || op[1]->value.b[c];
+ break;
+
+ case ir_binop_less:
+ assert(op[0]->type == op[1]->type);
+ for (unsigned c = 0; c < op[0]->type->components(); c++) {
+ switch (op[0]->type->base_type) {
+ case GLSL_TYPE_UINT:
+ data.b[0] = op[0]->value.u[0] < op[1]->value.u[0];
+ break;
+ case GLSL_TYPE_INT:
+ data.b[0] = op[0]->value.i[0] < op[1]->value.i[0];
+ break;
+ case GLSL_TYPE_FLOAT:
+ data.b[0] = op[0]->value.f[0] < op[1]->value.f[0];
+ break;
+ default:
+ assert(0);
+ }
+ }
+ break;
+ case ir_binop_greater:
+ assert(op[0]->type == op[1]->type);
+ for (unsigned c = 0; c < op[0]->type->components(); c++) {
+ switch (op[0]->type->base_type) {
+ case GLSL_TYPE_UINT:
+ data.b[c] = op[0]->value.u[c] > op[1]->value.u[c];
+ break;
+ case GLSL_TYPE_INT:
+ data.b[c] = op[0]->value.i[c] > op[1]->value.i[c];
+ break;
+ case GLSL_TYPE_FLOAT:
+ data.b[c] = op[0]->value.f[c] > op[1]->value.f[c];
+ break;
+ default:
+ assert(0);
+ }
+ }
+ break;
+ case ir_binop_lequal:
+ assert(op[0]->type == op[1]->type);
+ for (unsigned c = 0; c < op[0]->type->components(); c++) {
+ switch (op[0]->type->base_type) {
+ case GLSL_TYPE_UINT:
+ data.b[0] = op[0]->value.u[0] <= op[1]->value.u[0];
+ break;
+ case GLSL_TYPE_INT:
+ data.b[0] = op[0]->value.i[0] <= op[1]->value.i[0];
+ break;
+ case GLSL_TYPE_FLOAT:
+ data.b[0] = op[0]->value.f[0] <= op[1]->value.f[0];
+ break;
+ default:
+ assert(0);
+ }
+ }
+ break;
+ case ir_binop_gequal:
+ assert(op[0]->type == op[1]->type);
+ for (unsigned c = 0; c < op[0]->type->components(); c++) {
+ switch (op[0]->type->base_type) {
+ case GLSL_TYPE_UINT:
+ data.b[0] = op[0]->value.u[0] >= op[1]->value.u[0];
+ break;
+ case GLSL_TYPE_INT:
+ data.b[0] = op[0]->value.i[0] >= op[1]->value.i[0];
+ break;
+ case GLSL_TYPE_FLOAT:
+ data.b[0] = op[0]->value.f[0] >= op[1]->value.f[0];
+ break;
+ default:
+ assert(0);
+ }
+ }
+ break;
+ case ir_binop_equal:
+ assert(op[0]->type == op[1]->type);
+ for (unsigned c = 0; c < components; c++) {
+ switch (op[0]->type->base_type) {
+ case GLSL_TYPE_UINT:
+ data.b[c] = op[0]->value.u[c] == op[1]->value.u[c];
+ break;
+ case GLSL_TYPE_INT:
+ data.b[c] = op[0]->value.i[c] == op[1]->value.i[c];
+ break;
+ case GLSL_TYPE_FLOAT:
+ data.b[c] = op[0]->value.f[c] == op[1]->value.f[c];
+ break;
+ default:
+ assert(0);
+ }
+ }
+ break;
+ case ir_binop_nequal:
+ assert(op[0]->type != op[1]->type);
+ for (unsigned c = 0; c < components; c++) {
+ switch (op[0]->type->base_type) {
+ case GLSL_TYPE_UINT:
+ data.b[c] = op[0]->value.u[c] != op[1]->value.u[c];
+ break;
+ case GLSL_TYPE_INT:
+ data.b[c] = op[0]->value.i[c] != op[1]->value.i[c];
+ break;
+ case GLSL_TYPE_FLOAT:
+ data.b[c] = op[0]->value.f[c] != op[1]->value.f[c];
+ break;
+ default:
+ assert(0);
+ }
+ }
+ break;
+ case ir_binop_all_equal:
+ data.b[0] = op[0]->has_value(op[1]);
+ break;
+ case ir_binop_any_nequal:
+ data.b[0] = !op[0]->has_value(op[1]);
+ break;
+
+ case ir_binop_lshift:
+ for (unsigned c = 0, c0 = 0, c1 = 0;
+ c < components;
+ c0 += c0_inc, c1 += c1_inc, c++) {
+
+ if (op[0]->type->base_type == GLSL_TYPE_INT &&
+ op[1]->type->base_type == GLSL_TYPE_INT) {
+ data.i[c] = op[0]->value.i[c0] << op[1]->value.i[c1];
+
+ } else if (op[0]->type->base_type == GLSL_TYPE_INT &&
+ op[1]->type->base_type == GLSL_TYPE_UINT) {
+ data.i[c] = op[0]->value.i[c0] << op[1]->value.u[c1];
+
+ } else if (op[0]->type->base_type == GLSL_TYPE_UINT &&
+ op[1]->type->base_type == GLSL_TYPE_INT) {
+ data.u[c] = op[0]->value.u[c0] << op[1]->value.i[c1];
+
+ } else if (op[0]->type->base_type == GLSL_TYPE_UINT &&
+ op[1]->type->base_type == GLSL_TYPE_UINT) {
+ data.u[c] = op[0]->value.u[c0] << op[1]->value.u[c1];
+ }
+ }
+ break;
+
+ case ir_binop_rshift:
+ for (unsigned c = 0, c0 = 0, c1 = 0;
+ c < components;
+ c0 += c0_inc, c1 += c1_inc, c++) {
+
+ if (op[0]->type->base_type == GLSL_TYPE_INT &&
+ op[1]->type->base_type == GLSL_TYPE_INT) {
+ data.i[c] = op[0]->value.i[c0] >> op[1]->value.i[c1];
+
+ } else if (op[0]->type->base_type == GLSL_TYPE_INT &&
+ op[1]->type->base_type == GLSL_TYPE_UINT) {
+ data.i[c] = op[0]->value.i[c0] >> op[1]->value.u[c1];
+
+ } else if (op[0]->type->base_type == GLSL_TYPE_UINT &&
+ op[1]->type->base_type == GLSL_TYPE_INT) {
+ data.u[c] = op[0]->value.u[c0] >> op[1]->value.i[c1];
+
+ } else if (op[0]->type->base_type == GLSL_TYPE_UINT &&
+ op[1]->type->base_type == GLSL_TYPE_UINT) {
+ data.u[c] = op[0]->value.u[c0] >> op[1]->value.u[c1];
+ }
+ }
+ break;
+
+ case ir_binop_bit_and:
+ for (unsigned c = 0, c0 = 0, c1 = 0;
+ c < components;
+ c0 += c0_inc, c1 += c1_inc, c++) {
+
+ switch (op[0]->type->base_type) {
+ case GLSL_TYPE_INT:
+ data.i[c] = op[0]->value.i[c0] & op[1]->value.i[c1];
+ break;
+ case GLSL_TYPE_UINT:
+ data.u[c] = op[0]->value.u[c0] & op[1]->value.u[c1];
+ break;
+ default:
+ assert(0);
+ }
+ }
+ break;
+
+ case ir_binop_bit_or:
+ for (unsigned c = 0, c0 = 0, c1 = 0;
+ c < components;
+ c0 += c0_inc, c1 += c1_inc, c++) {
+
+ switch (op[0]->type->base_type) {
+ case GLSL_TYPE_INT:
+ data.i[c] = op[0]->value.i[c0] | op[1]->value.i[c1];
+ break;
+ case GLSL_TYPE_UINT:
+ data.u[c] = op[0]->value.u[c0] | op[1]->value.u[c1];
+ break;
+ default:
+ assert(0);
+ }
+ }
+ break;
+
+ case ir_binop_bit_xor:
+ for (unsigned c = 0, c0 = 0, c1 = 0;
+ c < components;
+ c0 += c0_inc, c1 += c1_inc, c++) {
+
+ switch (op[0]->type->base_type) {
+ case GLSL_TYPE_INT:
+ data.i[c] = op[0]->value.i[c0] ^ op[1]->value.i[c1];
+ break;
+ case GLSL_TYPE_UINT:
+ data.u[c] = op[0]->value.u[c0] ^ op[1]->value.u[c1];
+ break;
+ default:
+ assert(0);
+ }
+ }
+ break;
+
+ case ir_quadop_vector:
+ for (unsigned c = 0; c < this->type->vector_elements; c++) {
+ switch (this->type->base_type) {
+ case GLSL_TYPE_INT:
+ data.i[c] = op[c]->value.i[0];
+ break;
+ case GLSL_TYPE_UINT:
+ data.u[c] = op[c]->value.u[0];
+ break;
+ case GLSL_TYPE_FLOAT:
+ data.f[c] = op[c]->value.f[0];
+ break;
+ default:
+ assert(0);
+ }
+ }
+ break;
+
+ default:
+ /* FINISHME: Should handle all expression types. */
+ return NULL;
+ }
+
+ return new(ctx) ir_constant(this->type, &data);
+}
+
+
+ir_constant *
+ir_texture::constant_expression_value()
+{
+ /* texture lookups aren't constant expressions */
+ return NULL;
+}
+
+
+ir_constant *
+ir_swizzle::constant_expression_value()
+{
+ ir_constant *v = this->val->constant_expression_value();
+
+ if (v != NULL) {
+ ir_constant_data data = { { 0 } };
+
+ const unsigned swiz_idx[4] = {
+ this->mask.x, this->mask.y, this->mask.z, this->mask.w
+ };
+
+ for (unsigned i = 0; i < this->mask.num_components; i++) {
+ switch (v->type->base_type) {
+ case GLSL_TYPE_UINT:
+ case GLSL_TYPE_INT: data.u[i] = v->value.u[swiz_idx[i]]; break;
+ case GLSL_TYPE_FLOAT: data.f[i] = v->value.f[swiz_idx[i]]; break;
+ case GLSL_TYPE_BOOL: data.b[i] = v->value.b[swiz_idx[i]]; break;
+ default: assert(!"Should not get here."); break;
+ }
+ }
+
+ void *ctx = ralloc_parent(this);
+ return new(ctx) ir_constant(this->type, &data);
+ }
+ return NULL;
+}
+
+
+ir_constant *
+ir_dereference_variable::constant_expression_value()
+{
+ /* This may occur during compile and var->type is glsl_type::error_type */
+ if (!var)
+ return NULL;
+
+ /* The constant_value of a uniform variable is its initializer,
+ * not the lifetime constant value of the uniform.
+ */
+ if (var->mode == ir_var_uniform)
+ return NULL;
+
+ if (!var->constant_value)
+ return NULL;
+
+ return var->constant_value->clone(ralloc_parent(var), NULL);
+}
+
+
+ir_constant *
+ir_dereference_array::constant_expression_value()
+{
+ ir_constant *array = this->array->constant_expression_value();
+ ir_constant *idx = this->array_index->constant_expression_value();
+
+ if ((array != NULL) && (idx != NULL)) {
+ void *ctx = ralloc_parent(this);
+ if (array->type->is_matrix()) {
+ /* Array access of a matrix results in a vector.
+ */
+ const unsigned column = idx->value.u[0];
+
+ const glsl_type *const column_type = array->type->column_type();
+
+ /* Offset in the constant matrix to the first element of the column
+ * to be extracted.
+ */
+ const unsigned mat_idx = column * column_type->vector_elements;
+
+ ir_constant_data data = { { 0 } };
+
+ switch (column_type->base_type) {
+ case GLSL_TYPE_UINT:
+ case GLSL_TYPE_INT:
+ for (unsigned i = 0; i < column_type->vector_elements; i++)
+ data.u[i] = array->value.u[mat_idx + i];
+
+ break;
+
+ case GLSL_TYPE_FLOAT:
+ for (unsigned i = 0; i < column_type->vector_elements; i++)
+ data.f[i] = array->value.f[mat_idx + i];
+
+ break;
+
+ default:
+ assert(!"Should not get here.");
+ break;
+ }
+
+ return new(ctx) ir_constant(column_type, &data);
+ } else if (array->type->is_vector()) {
+ const unsigned component = idx->value.u[0];
+
+ return new(ctx) ir_constant(array, component);
+ } else {
+ const unsigned index = idx->value.u[0];
+ return array->get_array_element(index)->clone(ctx, NULL);
+ }
+ }
+ return NULL;
+}
+
+
+ir_constant *
+ir_dereference_record::constant_expression_value()
+{
+ ir_constant *v = this->record->constant_expression_value();
+
+ return (v != NULL) ? v->get_record_field(this->field) : NULL;
+}
+
+
+ir_constant *
+ir_assignment::constant_expression_value()
+{
+ /* FINISHME: Handle CEs involving assignment (return RHS) */
+ return NULL;
+}
+
+
+ir_constant *
+ir_constant::constant_expression_value()
+{
+ return this;
+}
+
+
+ir_constant *
+ir_call::constant_expression_value()
+{
+ if (this->type == glsl_type::error_type)
+ return NULL;
+
+ /* From the GLSL 1.20 spec, page 23:
+ * "Function calls to user-defined functions (non-built-in functions)
+ * cannot be used to form constant expressions."
+ */
+ if (!this->callee->is_builtin)
+ return NULL;
+
+ unsigned num_parameters = 0;
+
+ /* Check if all parameters are constant */
+ ir_constant *op[3];
+ foreach_list(n, &this->actual_parameters) {
+ ir_constant *constant = ((ir_rvalue *) n)->constant_expression_value();
+ if (constant == NULL)
+ return NULL;
+
+ op[num_parameters] = constant;
+
+ assert(num_parameters < 3);
+ num_parameters++;
+ }
+
+ /* Individual cases below can either:
+ * - Assign "expr" a new ir_expression to evaluate (for basic opcodes)
+ * - Fill "data" with appopriate constant data
+ * - Return an ir_constant directly.
+ */
+ void *mem_ctx = ralloc_parent(this);
+ ir_expression *expr = NULL;
+
+ ir_constant_data data;
+ memset(&data, 0, sizeof(data));
+
+ const char *callee = this->callee_name();
+ if (strcmp(callee, "abs") == 0) {
+ expr = new(mem_ctx) ir_expression(ir_unop_abs, type, op[0], NULL);
+ } else if (strcmp(callee, "all") == 0) {
+ assert(op[0]->type->is_boolean());
+ for (unsigned c = 0; c < op[0]->type->components(); c++) {
+ if (!op[0]->value.b[c])
+ return new(mem_ctx) ir_constant(false);
+ }
+ return new(mem_ctx) ir_constant(true);
+ } else if (strcmp(callee, "any") == 0) {
+ assert(op[0]->type->is_boolean());
+ for (unsigned c = 0; c < op[0]->type->components(); c++) {
+ if (op[0]->value.b[c])
+ return new(mem_ctx) ir_constant(true);
+ }
+ return new(mem_ctx) ir_constant(false);
+ } else if (strcmp(callee, "acos") == 0) {
+ assert(op[0]->type->is_float());
+ for (unsigned c = 0; c < op[0]->type->components(); c++)
+ data.f[c] = acosf(op[0]->value.f[c]);
+ } else if (strcmp(callee, "acosh") == 0) {
+ assert(op[0]->type->is_float());
+ for (unsigned c = 0; c < op[0]->type->components(); c++)
+ data.f[c] = acoshf(op[0]->value.f[c]);
+ } else if (strcmp(callee, "asin") == 0) {
+ assert(op[0]->type->is_float());
+ for (unsigned c = 0; c < op[0]->type->components(); c++)
+ data.f[c] = asinf(op[0]->value.f[c]);
+ } else if (strcmp(callee, "asinh") == 0) {
+ assert(op[0]->type->is_float());
+ for (unsigned c = 0; c < op[0]->type->components(); c++)
+ data.f[c] = asinhf(op[0]->value.f[c]);
+ } else if (strcmp(callee, "atan") == 0) {
+ assert(op[0]->type->is_float());
+ if (num_parameters == 2) {
+ assert(op[1]->type->is_float());
+ for (unsigned c = 0; c < op[0]->type->components(); c++)
+ data.f[c] = atan2f(op[0]->value.f[c], op[1]->value.f[c]);
+ } else {
+ for (unsigned c = 0; c < op[0]->type->components(); c++)
+ data.f[c] = atanf(op[0]->value.f[c]);
+ }
+ } else if (strcmp(callee, "atanh") == 0) {
+ assert(op[0]->type->is_float());
+ for (unsigned c = 0; c < op[0]->type->components(); c++)
+ data.f[c] = atanhf(op[0]->value.f[c]);
+ } else if (strcmp(callee, "dFdx") == 0 || strcmp(callee, "dFdy") == 0) {
+ return ir_constant::zero(mem_ctx, this->type);
+ } else if (strcmp(callee, "ceil") == 0) {
+ expr = new(mem_ctx) ir_expression(ir_unop_ceil, type, op[0], NULL);
+ } else if (strcmp(callee, "clamp") == 0) {
+ assert(num_parameters == 3);
+ unsigned c1_inc = op[1]->type->is_scalar() ? 0 : 1;
+ unsigned c2_inc = op[2]->type->is_scalar() ? 0 : 1;
+ for (unsigned c = 0, c1 = 0, c2 = 0;
+ c < op[0]->type->components();
+ c1 += c1_inc, c2 += c2_inc, c++) {
+
+ switch (op[0]->type->base_type) {
+ case GLSL_TYPE_UINT:
+ data.u[c] = CLAMP(op[0]->value.u[c], op[1]->value.u[c1],
+ op[2]->value.u[c2]);
+ break;
+ case GLSL_TYPE_INT:
+ data.i[c] = CLAMP(op[0]->value.i[c], op[1]->value.i[c1],
+ op[2]->value.i[c2]);
+ break;
+ case GLSL_TYPE_FLOAT:
+ data.f[c] = CLAMP(op[0]->value.f[c], op[1]->value.f[c1],
+ op[2]->value.f[c2]);
+ break;
+ default:
+ assert(!"Should not get here.");
+ }
+ }
+ } else if (strcmp(callee, "cos") == 0) {
+ expr = new(mem_ctx) ir_expression(ir_unop_cos, type, op[0], NULL);
+ } else if (strcmp(callee, "cosh") == 0) {
+ assert(op[0]->type->is_float());
+ for (unsigned c = 0; c < op[0]->type->components(); c++)
+ data.f[c] = coshf(op[0]->value.f[c]);
+ } else if (strcmp(callee, "cross") == 0) {
+ assert(op[0]->type == glsl_type::vec3_type);
+ assert(op[1]->type == glsl_type::vec3_type);
+ data.f[0] = (op[0]->value.f[1] * op[1]->value.f[2] -
+ op[1]->value.f[1] * op[0]->value.f[2]);
+ data.f[1] = (op[0]->value.f[2] * op[1]->value.f[0] -
+ op[1]->value.f[2] * op[0]->value.f[0]);
+ data.f[2] = (op[0]->value.f[0] * op[1]->value.f[1] -
+ op[1]->value.f[0] * op[0]->value.f[1]);
+ } else if (strcmp(callee, "degrees") == 0) {
+ assert(op[0]->type->is_float());
+ for (unsigned c = 0; c < op[0]->type->components(); c++)
+ data.f[c] = 180.0F / M_PI * op[0]->value.f[c];
+ } else if (strcmp(callee, "distance") == 0) {
+ assert(op[0]->type->is_float() && op[1]->type->is_float());
+ float length_squared = 0.0;
+ for (unsigned c = 0; c < op[0]->type->components(); c++) {
+ float t = op[0]->value.f[c] - op[1]->value.f[c];
+ length_squared += t * t;
+ }
+ return new(mem_ctx) ir_constant(sqrtf(length_squared));
+ } else if (strcmp(callee, "dot") == 0) {
+ return new(mem_ctx) ir_constant(dot(op[0], op[1]));
+ } else if (strcmp(callee, "equal") == 0) {
+ assert(op[0]->type->is_vector() && op[1] && op[1]->type->is_vector());
+ for (unsigned c = 0; c < op[0]->type->components(); c++) {
+ switch (op[0]->type->base_type) {
+ case GLSL_TYPE_UINT:
+ data.b[c] = op[0]->value.u[c] == op[1]->value.u[c];
+ break;
+ case GLSL_TYPE_INT:
+ data.b[c] = op[0]->value.i[c] == op[1]->value.i[c];
+ break;
+ case GLSL_TYPE_FLOAT:
+ data.b[c] = op[0]->value.f[c] == op[1]->value.f[c];
+ break;
+ case GLSL_TYPE_BOOL:
+ data.b[c] = op[0]->value.b[c] == op[1]->value.b[c];
+ break;
+ default:
+ assert(!"Should not get here.");
+ }
+ }
+ } else if (strcmp(callee, "exp") == 0) {
+ expr = new(mem_ctx) ir_expression(ir_unop_exp, type, op[0], NULL);
+ } else if (strcmp(callee, "exp2") == 0) {
+ expr = new(mem_ctx) ir_expression(ir_unop_exp2, type, op[0], NULL);
+ } else if (strcmp(callee, "faceforward") == 0) {
+ if (dot(op[2], op[1]) < 0)
+ return op[0];
+ for (unsigned c = 0; c < op[0]->type->components(); c++)
+ data.f[c] = -op[0]->value.f[c];
+ } else if (strcmp(callee, "floor") == 0) {
+ expr = new(mem_ctx) ir_expression(ir_unop_floor, type, op[0], NULL);
+ } else if (strcmp(callee, "fract") == 0) {
+ expr = new(mem_ctx) ir_expression(ir_unop_fract, type, op[0], NULL);
+ } else if (strcmp(callee, "fwidth") == 0) {
+ return ir_constant::zero(mem_ctx, this->type);
+ } else if (strcmp(callee, "greaterThan") == 0) {
+ assert(op[0]->type->is_vector() && op[1] && op[1]->type->is_vector());
+ for (unsigned c = 0; c < op[0]->type->components(); c++) {
+ switch (op[0]->type->base_type) {
+ case GLSL_TYPE_UINT:
+ data.b[c] = op[0]->value.u[c] > op[1]->value.u[c];
+ break;
+ case GLSL_TYPE_INT:
+ data.b[c] = op[0]->value.i[c] > op[1]->value.i[c];
+ break;
+ case GLSL_TYPE_FLOAT:
+ data.b[c] = op[0]->value.f[c] > op[1]->value.f[c];
+ break;
+ default:
+ assert(!"Should not get here.");
+ }
+ }
+ } else if (strcmp(callee, "greaterThanEqual") == 0) {
+ assert(op[0]->type->is_vector() && op[1] && op[1]->type->is_vector());
+ for (unsigned c = 0; c < op[0]->type->components(); c++) {
+ switch (op[0]->type->base_type) {
+ case GLSL_TYPE_UINT:
+ data.b[c] = op[0]->value.u[c] >= op[1]->value.u[c];
+ break;
+ case GLSL_TYPE_INT:
+ data.b[c] = op[0]->value.i[c] >= op[1]->value.i[c];
+ break;
+ case GLSL_TYPE_FLOAT:
+ data.b[c] = op[0]->value.f[c] >= op[1]->value.f[c];
+ break;
+ default:
+ assert(!"Should not get here.");
+ }
+ }
+ } else if (strcmp(callee, "inversesqrt") == 0) {
+ expr = new(mem_ctx) ir_expression(ir_unop_rsq, type, op[0], NULL);
+ } else if (strcmp(callee, "length") == 0) {
+ return new(mem_ctx) ir_constant(sqrtf(dot(op[0], op[0])));
+ } else if (strcmp(callee, "lessThan") == 0) {
+ assert(op[0]->type->is_vector() && op[1] && op[1]->type->is_vector());
+ for (unsigned c = 0; c < op[0]->type->components(); c++) {
+ switch (op[0]->type->base_type) {
+ case GLSL_TYPE_UINT:
+ data.b[c] = op[0]->value.u[c] < op[1]->value.u[c];
+ break;
+ case GLSL_TYPE_INT:
+ data.b[c] = op[0]->value.i[c] < op[1]->value.i[c];
+ break;
+ case GLSL_TYPE_FLOAT:
+ data.b[c] = op[0]->value.f[c] < op[1]->value.f[c];
+ break;
+ default:
+ assert(!"Should not get here.");
+ }
+ }
+ } else if (strcmp(callee, "lessThanEqual") == 0) {
+ assert(op[0]->type->is_vector() && op[1] && op[1]->type->is_vector());
+ for (unsigned c = 0; c < op[0]->type->components(); c++) {
+ switch (op[0]->type->base_type) {
+ case GLSL_TYPE_UINT:
+ data.b[c] = op[0]->value.u[c] <= op[1]->value.u[c];
+ break;
+ case GLSL_TYPE_INT:
+ data.b[c] = op[0]->value.i[c] <= op[1]->value.i[c];
+ break;
+ case GLSL_TYPE_FLOAT:
+ data.b[c] = op[0]->value.f[c] <= op[1]->value.f[c];
+ break;
+ default:
+ assert(!"Should not get here.");
+ }
+ }
+ } else if (strcmp(callee, "log") == 0) {
+ expr = new(mem_ctx) ir_expression(ir_unop_log, type, op[0], NULL);
+ } else if (strcmp(callee, "log2") == 0) {
+ expr = new(mem_ctx) ir_expression(ir_unop_log2, type, op[0], NULL);
+ } else if (strcmp(callee, "matrixCompMult") == 0) {
+ assert(op[0]->type->is_float() && op[1]->type->is_float());
+ for (unsigned c = 0; c < op[0]->type->components(); c++)
+ data.f[c] = op[0]->value.f[c] * op[1]->value.f[c];
+ } else if (strcmp(callee, "max") == 0) {
+ expr = new(mem_ctx) ir_expression(ir_binop_max, type, op[0], op[1]);
+ } else if (strcmp(callee, "min") == 0) {
+ expr = new(mem_ctx) ir_expression(ir_binop_min, type, op[0], op[1]);
+ } else if (strcmp(callee, "mix") == 0) {
+ assert(op[0]->type->is_float() && op[1]->type->is_float());
+ if (op[2]->type->is_float()) {
+ unsigned c2_inc = op[2]->type->is_scalar() ? 0 : 1;
+ unsigned components = op[0]->type->components();
+ for (unsigned c = 0, c2 = 0; c < components; c2 += c2_inc, c++) {
+ data.f[c] = op[0]->value.f[c] * (1 - op[2]->value.f[c2]) +
+ op[1]->value.f[c] * op[2]->value.f[c2];
+ }
+ } else {
+ assert(op[2]->type->is_boolean());
+ for (unsigned c = 0; c < op[0]->type->components(); c++)
+ data.f[c] = op[op[2]->value.b[c] ? 1 : 0]->value.f[c];
+ }
+ } else if (strcmp(callee, "mod") == 0) {
+ expr = new(mem_ctx) ir_expression(ir_binop_mod, type, op[0], op[1]);
+ } else if (strcmp(callee, "normalize") == 0) {
+ assert(op[0]->type->is_float());
+ float length = sqrtf(dot(op[0], op[0]));
+
+ if (length == 0)
+ return ir_constant::zero(mem_ctx, this->type);
+
+ for (unsigned c = 0; c < op[0]->type->components(); c++)
+ data.f[c] = op[0]->value.f[c] / length;
+ } else if (strcmp(callee, "not") == 0) {
+ expr = new(mem_ctx) ir_expression(ir_unop_logic_not, type, op[0], NULL);
+ } else if (strcmp(callee, "notEqual") == 0) {
+ assert(op[0]->type->is_vector() && op[1] && op[1]->type->is_vector());
+ for (unsigned c = 0; c < op[0]->type->components(); c++) {
+ switch (op[0]->type->base_type) {
+ case GLSL_TYPE_UINT:
+ data.b[c] = op[0]->value.u[c] != op[1]->value.u[c];
+ break;
+ case GLSL_TYPE_INT:
+ data.b[c] = op[0]->value.i[c] != op[1]->value.i[c];
+ break;
+ case GLSL_TYPE_FLOAT:
+ data.b[c] = op[0]->value.f[c] != op[1]->value.f[c];
+ break;
+ case GLSL_TYPE_BOOL:
+ data.b[c] = op[0]->value.b[c] != op[1]->value.b[c];
+ break;
+ default:
+ assert(!"Should not get here.");
+ }
+ }
+ } else if (strcmp(callee, "outerProduct") == 0) {
+ assert(op[0]->type->is_vector() && op[1]->type->is_vector());
+ const unsigned m = op[0]->type->vector_elements;
+ const unsigned n = op[1]->type->vector_elements;
+ for (unsigned j = 0; j < n; j++) {
+ for (unsigned i = 0; i < m; i++) {
+ data.f[i+m*j] = op[0]->value.f[i] * op[1]->value.f[j];
+ }
+ }
+ } else if (strcmp(callee, "pow") == 0) {
+ expr = new(mem_ctx) ir_expression(ir_binop_pow, type, op[0], op[1]);
+ } else if (strcmp(callee, "radians") == 0) {
+ assert(op[0]->type->is_float());
+ for (unsigned c = 0; c < op[0]->type->components(); c++)
+ data.f[c] = M_PI / 180.0F * op[0]->value.f[c];
+ } else if (strcmp(callee, "reflect") == 0) {
+ assert(op[0]->type->is_float());
+ float dot_NI = dot(op[1], op[0]);
+ for (unsigned c = 0; c < op[0]->type->components(); c++)
+ data.f[c] = op[0]->value.f[c] - 2 * dot_NI * op[1]->value.f[c];
+ } else if (strcmp(callee, "refract") == 0) {
+ const float eta = op[2]->value.f[0];
+ const float dot_NI = dot(op[1], op[0]);
+ const float k = 1.0F - eta * eta * (1.0F - dot_NI * dot_NI);
+ if (k < 0.0) {
+ return ir_constant::zero(mem_ctx, this->type);
+ } else {
+ for (unsigned c = 0; c < type->components(); c++) {
+ data.f[c] = eta * op[0]->value.f[c] - (eta * dot_NI + sqrtf(k))
+ * op[1]->value.f[c];
+ }
+ }
+ } else if (strcmp(callee, "sign") == 0) {
+ expr = new(mem_ctx) ir_expression(ir_unop_sign, type, op[0], NULL);
+ } else if (strcmp(callee, "sin") == 0) {
+ expr = new(mem_ctx) ir_expression(ir_unop_sin, type, op[0], NULL);
+ } else if (strcmp(callee, "sinh") == 0) {
+ assert(op[0]->type->is_float());
+ for (unsigned c = 0; c < op[0]->type->components(); c++)
+ data.f[c] = sinhf(op[0]->value.f[c]);
+ } else if (strcmp(callee, "smoothstep") == 0) {
+ assert(num_parameters == 3);
+ assert(op[1]->type == op[0]->type);
+ unsigned edge_inc = op[0]->type->is_scalar() ? 0 : 1;
+ for (unsigned c = 0, e = 0; c < type->components(); e += edge_inc, c++) {
+ const float edge0 = op[0]->value.f[e];
+ const float edge1 = op[1]->value.f[e];
+ if (edge0 == edge1) {
+ data.f[c] = 0.0; /* Avoid a crash - results are undefined anyway */
+ } else {
+ const float numerator = op[2]->value.f[c] - edge0;
+ const float denominator = edge1 - edge0;
+ const float t = CLAMP(numerator/denominator, 0, 1);
+ data.f[c] = t * t * (3 - 2 * t);
+ }
+ }
+ } else if (strcmp(callee, "sqrt") == 0) {
+ expr = new(mem_ctx) ir_expression(ir_unop_sqrt, type, op[0], NULL);
+ } else if (strcmp(callee, "step") == 0) {
+ assert(op[0]->type->is_float() && op[1]->type->is_float());
+ /* op[0] (edge) may be either a scalar or a vector */
+ const unsigned c0_inc = op[0]->type->is_scalar() ? 0 : 1;
+ for (unsigned c = 0, c0 = 0; c < type->components(); c0 += c0_inc, c++)
+ data.f[c] = (op[1]->value.f[c] < op[0]->value.f[c0]) ? 0.0F : 1.0F;
+ } else if (strcmp(callee, "tan") == 0) {
+ assert(op[0]->type->is_float());
+ for (unsigned c = 0; c < op[0]->type->components(); c++)
+ data.f[c] = tanf(op[0]->value.f[c]);
+ } else if (strcmp(callee, "tanh") == 0) {
+ assert(op[0]->type->is_float());
+ for (unsigned c = 0; c < op[0]->type->components(); c++)
+ data.f[c] = tanhf(op[0]->value.f[c]);
+ } else if (strcmp(callee, "transpose") == 0) {
+ assert(op[0]->type->is_matrix());
+ const unsigned n = op[0]->type->vector_elements;
+ const unsigned m = op[0]->type->matrix_columns;
+ for (unsigned j = 0; j < m; j++) {
+ for (unsigned i = 0; i < n; i++) {
+ data.f[m*i+j] += op[0]->value.f[i+n*j];
+ }
+ }
+ } else {
+ /* Unsupported builtin - some are not allowed in constant expressions. */
+ return NULL;
+ }
+
+ if (expr != NULL)
+ return expr->constant_expression_value();
+
+ return new(mem_ctx) ir_constant(this->type, &data);
+}
diff --git a/mesalib/src/glsl/ir_import_prototypes.cpp b/mesalib/src/glsl/ir_import_prototypes.cpp
index 3585bf6b2..03d40bb68 100644
--- a/mesalib/src/glsl/ir_import_prototypes.cpp
+++ b/mesalib/src/glsl/ir_import_prototypes.cpp
@@ -1,122 +1,122 @@
-/*
- * Copyright © 2010 Intel Corporation
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-
-/**
- * \file ir_import_prototypes.cpp
- * Import function prototypes from one IR tree into another.
- *
- * \author Ian Romanick
- */
-#include "ir.h"
-#include "glsl_symbol_table.h"
-
-/**
- * Visitor used to import function prototypes
- *
- * Normally the \c clone method of either \c ir_function or
- * \c ir_function_signature could be used. However, we don't want a complete
- * clone of the \c ir_function_signature. We want everything \b except the
- * body of the function.
- */
-class import_prototype_visitor : public ir_hierarchical_visitor {
-public:
- /**
- */
- import_prototype_visitor(exec_list *list, glsl_symbol_table *symbols,
- void *mem_ctx)
- {
- this->mem_ctx = mem_ctx;
- this->list = list;
- this->symbols = symbols;
- this->function = NULL;
- }
-
- virtual ir_visitor_status visit_enter(ir_function *ir)
- {
- assert(this->function == NULL);
-
- this->function = this->symbols->get_function(ir->name);
- if (!this->function) {
- this->function = new(this->mem_ctx) ir_function(ir->name);
-
- list->push_tail(this->function);
-
- /* Add the new function to the symbol table.
- */
- this->symbols->add_function(this->function);
- }
- return visit_continue;
- }
-
- virtual ir_visitor_status visit_leave(ir_function *ir)
- {
- (void) ir;
- assert(this->function != NULL);
-
- this->function = NULL;
- return visit_continue;
- }
-
- ir_visitor_status visit_enter(ir_function_signature *ir)
- {
- assert(this->function != NULL);
-
- ir_function_signature *copy = ir->clone_prototype(mem_ctx, NULL);
-
- this->function->add_signature(copy);
-
- /* Do not process child nodes of the ir_function_signature. There can
- * never be any nodes inside the ir_function_signature that we care
- * about. Instead continue with the next sibling.
- */
- return visit_continue_with_parent;
- }
-
-private:
- exec_list *list;
- ir_function *function;
- glsl_symbol_table *symbols;
- void *mem_ctx;
-};
-
-
-/**
- * Import function prototypes from one IR tree into another
- *
- * \param source Source instruction stream containing functions whose
- * prototypes are to be imported
- * \param dest Destination instruction stream where new \c ir_function and
- * \c ir_function_signature nodes will be stored
- * \param symbols Symbol table where new functions will be stored
- * \param mem_ctx ralloc memory context used for new allocations
- */
-void
-import_prototypes(const exec_list *source, exec_list *dest,
- glsl_symbol_table *symbols, void *mem_ctx)
-{
- import_prototype_visitor v(dest, symbols, mem_ctx);
-
- /* Making source be const is just extra documentation.
- */
- v.run(const_cast<exec_list *>(source));
-}
+/*
+ * Copyright © 2010 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+/**
+ * \file ir_import_prototypes.cpp
+ * Import function prototypes from one IR tree into another.
+ *
+ * \author Ian Romanick
+ */
+#include "ir.h"
+#include "glsl_symbol_table.h"
+
+/**
+ * Visitor used to import function prototypes
+ *
+ * Normally the \c clone method of either \c ir_function or
+ * \c ir_function_signature could be used. However, we don't want a complete
+ * clone of the \c ir_function_signature. We want everything \b except the
+ * body of the function.
+ */
+class import_prototype_visitor : public ir_hierarchical_visitor {
+public:
+ /**
+ */
+ import_prototype_visitor(exec_list *list, glsl_symbol_table *symbols,
+ void *mem_ctx)
+ {
+ this->mem_ctx = mem_ctx;
+ this->list = list;
+ this->symbols = symbols;
+ this->function = NULL;
+ }
+
+ virtual ir_visitor_status visit_enter(ir_function *ir)
+ {
+ assert(this->function == NULL);
+
+ this->function = this->symbols->get_function(ir->name);
+ if (!this->function) {
+ this->function = new(this->mem_ctx) ir_function(ir->name);
+
+ list->push_tail(this->function);
+
+ /* Add the new function to the symbol table.
+ */
+ this->symbols->add_function(this->function);
+ }
+ return visit_continue;
+ }
+
+ virtual ir_visitor_status visit_leave(ir_function *ir)
+ {
+ (void) ir;
+ assert(this->function != NULL);
+
+ this->function = NULL;
+ return visit_continue;
+ }
+
+ ir_visitor_status visit_enter(ir_function_signature *ir)
+ {
+ assert(this->function != NULL);
+
+ ir_function_signature *copy = ir->clone_prototype(mem_ctx, NULL);
+
+ this->function->add_signature(copy);
+
+ /* Do not process child nodes of the ir_function_signature. There can
+ * never be any nodes inside the ir_function_signature that we care
+ * about. Instead continue with the next sibling.
+ */
+ return visit_continue_with_parent;
+ }
+
+private:
+ exec_list *list;
+ ir_function *function;
+ glsl_symbol_table *symbols;
+ void *mem_ctx;
+};
+
+
+/**
+ * Import function prototypes from one IR tree into another
+ *
+ * \param source Source instruction stream containing functions whose
+ * prototypes are to be imported
+ * \param dest Destination instruction stream where new \c ir_function and
+ * \c ir_function_signature nodes will be stored
+ * \param symbols Symbol table where new functions will be stored
+ * \param mem_ctx ralloc memory context used for new allocations
+ */
+void
+import_prototypes(const exec_list *source, exec_list *dest,
+ glsl_symbol_table *symbols, void *mem_ctx)
+{
+ import_prototype_visitor v(dest, symbols, mem_ctx);
+
+ /* Making source be const is just extra documentation.
+ */
+ v.run(const_cast<exec_list *>(source));
+}
diff --git a/mesalib/src/glsl/ir_print_visitor.cpp b/mesalib/src/glsl/ir_print_visitor.cpp
index 02f3d8149..ba95103ea 100644
--- a/mesalib/src/glsl/ir_print_visitor.cpp
+++ b/mesalib/src/glsl/ir_print_visitor.cpp
@@ -1,515 +1,515 @@
-/*
- * Copyright © 2010 Intel Corporation
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-
-#include "ir_print_visitor.h"
-#include "glsl_types.h"
-#include "glsl_parser_extras.h"
-
-extern "C" {
-#include "program/hash_table.h"
-}
-
-static void print_type(const glsl_type *t);
-
-void
-ir_instruction::print(void) const
-{
- ir_instruction *deconsted = const_cast<ir_instruction *>(this);
-
- ir_print_visitor v;
- deconsted->accept(&v);
-}
-
-void
-_mesa_print_ir(exec_list *instructions,
- struct _mesa_glsl_parse_state *state)
-{
- if (state) {
- for (unsigned i = 0; i < state->num_user_structures; i++) {
- const glsl_type *const s = state->user_structures[i];
-
- printf("(structure (%s) (%s@%p) (%u) (\n",
- s->name, s->name, (void *) s, s->length);
-
- for (unsigned j = 0; j < s->length; j++) {
- printf("\t((");
- print_type(s->fields.structure[j].type);
- printf(")(%s))\n", s->fields.structure[j].name);
- }
-
- printf(")\n");
- }
- }
-
- printf("(\n");
- foreach_iter(exec_list_iterator, iter, *instructions) {
- ir_instruction *ir = (ir_instruction *)iter.get();
- ir->print();
- if (ir->ir_type != ir_type_function)
- printf("\n");
- }
- printf("\n)");
-}
-
-ir_print_visitor::ir_print_visitor()
-{
- indentation = 0;
- printable_names =
- hash_table_ctor(32, hash_table_pointer_hash, hash_table_pointer_compare);
- symbols = _mesa_symbol_table_ctor();
- mem_ctx = ralloc_context(NULL);
-}
-
-ir_print_visitor::~ir_print_visitor()
-{
- hash_table_dtor(printable_names);
- _mesa_symbol_table_dtor(symbols);
- ralloc_free(mem_ctx);
-}
-
-void ir_print_visitor::indent(void)
-{
- for (int i = 0; i < indentation; i++)
- printf(" ");
-}
-
-const char *
-ir_print_visitor::unique_name(ir_variable *var)
-{
- /* Do we already have a name for this variable? */
- const char *name = (const char *) hash_table_find(this->printable_names, var);
- if (name != NULL)
- return name;
-
- /* If there's no conflict, just use the original name */
- if (_mesa_symbol_table_find_symbol(this->symbols, -1, var->name) == NULL) {
- name = var->name;
- } else {
- static unsigned i = 1;
- name = ralloc_asprintf(this->mem_ctx, "%s@%u", var->name, ++i);
- }
- hash_table_insert(this->printable_names, (void *) name, var);
- _mesa_symbol_table_add_symbol(this->symbols, -1, name, var);
- return name;
-}
-
-static void
-print_type(const glsl_type *t)
-{
- if (t->base_type == GLSL_TYPE_ARRAY) {
- printf("(array ");
- print_type(t->fields.array);
- printf(" %u)", t->length);
- } else if ((t->base_type == GLSL_TYPE_STRUCT)
- && (strncmp("gl_", t->name, 3) != 0)) {
- printf("%s@%p", t->name, (void *) t);
- } else {
- printf("%s", t->name);
- }
-}
-
-
-void ir_print_visitor::visit(ir_variable *ir)
-{
- printf("(declare ");
-
- const char *const cent = (ir->centroid) ? "centroid " : "";
- const char *const inv = (ir->invariant) ? "invariant " : "";
- const char *const mode[] = { "", "uniform ", "in ", "out ", "inout ",
- "const_in ", "sys ", "temporary " };
- const char *const interp[] = { "", "flat", "noperspective" };
-
- printf("(%s%s%s%s) ",
- cent, inv, mode[ir->mode], interp[ir->interpolation]);
-
- print_type(ir->type);
- printf(" %s)", unique_name(ir));
-}
-
-
-void ir_print_visitor::visit(ir_function_signature *ir)
-{
- _mesa_symbol_table_push_scope(symbols);
- printf("(signature ");
- indentation++;
-
- print_type(ir->return_type);
- printf("\n");
- indent();
-
- printf("(parameters\n");
- indentation++;
-
- foreach_iter(exec_list_iterator, iter, ir->parameters) {
- ir_variable *const inst = (ir_variable *) iter.get();
-
- indent();
- inst->accept(this);
- printf("\n");
- }
- indentation--;
-
- indent();
- printf(")\n");
-
- indent();
-
- printf("(\n");
- indentation++;
-
- foreach_iter(exec_list_iterator, iter, ir->body) {
- ir_instruction *const inst = (ir_instruction *) iter.get();
-
- indent();
- inst->accept(this);
- printf("\n");
- }
- indentation--;
- indent();
- printf("))\n");
- indentation--;
- _mesa_symbol_table_pop_scope(symbols);
-}
-
-
-void ir_print_visitor::visit(ir_function *ir)
-{
- printf("(function %s\n", ir->name);
- indentation++;
- foreach_iter(exec_list_iterator, iter, *ir) {
- ir_function_signature *const sig = (ir_function_signature *) iter.get();
- indent();
- sig->accept(this);
- printf("\n");
- }
- indentation--;
- indent();
- printf(")\n\n");
-}
-
-
-void ir_print_visitor::visit(ir_expression *ir)
-{
- printf("(expression ");
-
- print_type(ir->type);
-
- printf(" %s ", ir->operator_string());
-
- for (unsigned i = 0; i < ir->get_num_operands(); i++) {
- ir->operands[i]->accept(this);
- }
-
- printf(") ");
-}
-
-
-void ir_print_visitor::visit(ir_texture *ir)
-{
- printf("(%s ", ir->opcode_string());
-
- print_type(ir->type);
- printf(" ");
-
- ir->sampler->accept(this);
- printf(" ");
-
- ir->coordinate->accept(this);
-
- printf(" ");
-
- if (ir->offset != NULL) {
- ir->offset->accept(this);
- } else {
- printf("0");
- }
-
- printf(" ");
-
- if (ir->op != ir_txf) {
- if (ir->projector)
- ir->projector->accept(this);
- else
- printf("1");
-
- if (ir->shadow_comparitor) {
- printf(" ");
- ir->shadow_comparitor->accept(this);
- } else {
- printf(" ()");
- }
- }
-
- printf(" ");
- switch (ir->op)
- {
- case ir_tex:
- break;
- case ir_txb:
- ir->lod_info.bias->accept(this);
- break;
- case ir_txl:
- case ir_txf:
- ir->lod_info.lod->accept(this);
- break;
- case ir_txd:
- printf("(");
- ir->lod_info.grad.dPdx->accept(this);
- printf(" ");
- ir->lod_info.grad.dPdy->accept(this);
- printf(")");
- break;
- };
- printf(")");
-}
-
-
-void ir_print_visitor::visit(ir_swizzle *ir)
-{
- const unsigned swiz[4] = {
- ir->mask.x,
- ir->mask.y,
- ir->mask.z,
- ir->mask.w,
- };
-
- printf("(swiz ");
- for (unsigned i = 0; i < ir->mask.num_components; i++) {
- printf("%c", "xyzw"[swiz[i]]);
- }
- printf(" ");
- ir->val->accept(this);
- printf(")");
-}
-
-
-void ir_print_visitor::visit(ir_dereference_variable *ir)
-{
- ir_variable *var = ir->variable_referenced();
- printf("(var_ref %s) ", unique_name(var));
-}
-
-
-void ir_print_visitor::visit(ir_dereference_array *ir)
-{
- printf("(array_ref ");
- ir->array->accept(this);
- ir->array_index->accept(this);
- printf(") ");
-}
-
-
-void ir_print_visitor::visit(ir_dereference_record *ir)
-{
- printf("(record_ref ");
- ir->record->accept(this);
- printf(" %s) ", ir->field);
-}
-
-
-void ir_print_visitor::visit(ir_assignment *ir)
-{
- printf("(assign ");
-
- if (ir->condition)
- ir->condition->accept(this);
-
- char mask[5];
- unsigned j = 0;
-
- for (unsigned i = 0; i < 4; i++) {
- if ((ir->write_mask & (1 << i)) != 0) {
- mask[j] = "xyzw"[i];
- j++;
- }
- }
- mask[j] = '\0';
-
- printf(" (%s) ", mask);
-
- ir->lhs->accept(this);
-
- printf(" ");
-
- ir->rhs->accept(this);
- printf(") ");
-}
-
-
-void ir_print_visitor::visit(ir_constant *ir)
-{
- const glsl_type *const base_type = ir->type->get_base_type();
-
- printf("(constant ");
- print_type(ir->type);
- printf(" (");
-
- if (ir->type->is_array()) {
- for (unsigned i = 0; i < ir->type->length; i++)
- ir->get_array_element(i)->accept(this);
- } else if (ir->type->is_record()) {
- ir_constant *value = (ir_constant *) ir->components.get_head();
- for (unsigned i = 0; i < ir->type->length; i++) {
- printf("(%s ", ir->type->fields.structure->name);
- value->accept(this);
- printf(")");
-
- value = (ir_constant *) value->next;
- }
- } else {
- for (unsigned i = 0; i < ir->type->components(); i++) {
- if (i != 0)
- printf(" ");
- switch (base_type->base_type) {
- case GLSL_TYPE_UINT: printf("%u", ir->value.u[i]); break;
- case GLSL_TYPE_INT: printf("%d", ir->value.i[i]); break;
- case GLSL_TYPE_FLOAT: printf("%f", ir->value.f[i]); break;
- case GLSL_TYPE_BOOL: printf("%d", ir->value.b[i]); break;
- default: assert(0);
- }
- }
- }
- printf(")) ");
-}
-
-
-void
-ir_print_visitor::visit(ir_call *ir)
-{
- printf("(call %s (", ir->callee_name());
- foreach_iter(exec_list_iterator, iter, *ir) {
- ir_instruction *const inst = (ir_instruction *) iter.get();
-
- inst->accept(this);
- }
- printf("))\n");
-}
-
-
-void
-ir_print_visitor::visit(ir_return *ir)
-{
- printf("(return");
-
- ir_rvalue *const value = ir->get_value();
- if (value) {
- printf(" ");
- value->accept(this);
- }
-
- printf(")");
-}
-
-
-void
-ir_print_visitor::visit(ir_discard *ir)
-{
- printf("(discard ");
-
- if (ir->condition != NULL) {
- printf(" ");
- ir->condition->accept(this);
- }
-
- printf(")");
-}
-
-
-void
-ir_print_visitor::visit(ir_if *ir)
-{
- printf("(if ");
- ir->condition->accept(this);
-
- printf("(\n");
- indentation++;
-
- foreach_iter(exec_list_iterator, iter, ir->then_instructions) {
- ir_instruction *const inst = (ir_instruction *) iter.get();
-
- indent();
- inst->accept(this);
- printf("\n");
- }
-
- indentation--;
- indent();
- printf(")\n");
-
- indent();
- if (!ir->else_instructions.is_empty()) {
- printf("(\n");
- indentation++;
-
- foreach_iter(exec_list_iterator, iter, ir->else_instructions) {
- ir_instruction *const inst = (ir_instruction *) iter.get();
-
- indent();
- inst->accept(this);
- printf("\n");
- }
- indentation--;
- indent();
- printf("))\n");
- } else {
- printf("())\n");
- }
-}
-
-
-void
-ir_print_visitor::visit(ir_loop *ir)
-{
- printf("(loop (");
- if (ir->counter != NULL)
- ir->counter->accept(this);
- printf(") (");
- if (ir->from != NULL)
- ir->from->accept(this);
- printf(") (");
- if (ir->to != NULL)
- ir->to->accept(this);
- printf(") (");
- if (ir->increment != NULL)
- ir->increment->accept(this);
- printf(") (\n");
- indentation++;
-
- foreach_iter(exec_list_iterator, iter, ir->body_instructions) {
- ir_instruction *const inst = (ir_instruction *) iter.get();
-
- indent();
- inst->accept(this);
- printf("\n");
- }
- indentation--;
- indent();
- printf("))\n");
-}
-
-
-void
-ir_print_visitor::visit(ir_loop_jump *ir)
-{
- printf("%s", ir->is_break() ? "break" : "continue");
-}
+/*
+ * Copyright © 2010 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+#include "ir_print_visitor.h"
+#include "glsl_types.h"
+#include "glsl_parser_extras.h"
+
+extern "C" {
+#include "program/hash_table.h"
+}
+
+static void print_type(const glsl_type *t);
+
+void
+ir_instruction::print(void) const
+{
+ ir_instruction *deconsted = const_cast<ir_instruction *>(this);
+
+ ir_print_visitor v;
+ deconsted->accept(&v);
+}
+
+void
+_mesa_print_ir(exec_list *instructions,
+ struct _mesa_glsl_parse_state *state)
+{
+ if (state) {
+ for (unsigned i = 0; i < state->num_user_structures; i++) {
+ const glsl_type *const s = state->user_structures[i];
+
+ printf("(structure (%s) (%s@%p) (%u) (\n",
+ s->name, s->name, (void *) s, s->length);
+
+ for (unsigned j = 0; j < s->length; j++) {
+ printf("\t((");
+ print_type(s->fields.structure[j].type);
+ printf(")(%s))\n", s->fields.structure[j].name);
+ }
+
+ printf(")\n");
+ }
+ }
+
+ printf("(\n");
+ foreach_iter(exec_list_iterator, iter, *instructions) {
+ ir_instruction *ir = (ir_instruction *)iter.get();
+ ir->print();
+ if (ir->ir_type != ir_type_function)
+ printf("\n");
+ }
+ printf("\n)");
+}
+
+ir_print_visitor::ir_print_visitor()
+{
+ indentation = 0;
+ printable_names =
+ hash_table_ctor(32, hash_table_pointer_hash, hash_table_pointer_compare);
+ symbols = _mesa_symbol_table_ctor();
+ mem_ctx = ralloc_context(NULL);
+}
+
+ir_print_visitor::~ir_print_visitor()
+{
+ hash_table_dtor(printable_names);
+ _mesa_symbol_table_dtor(symbols);
+ ralloc_free(mem_ctx);
+}
+
+void ir_print_visitor::indent(void)
+{
+ for (int i = 0; i < indentation; i++)
+ printf(" ");
+}
+
+const char *
+ir_print_visitor::unique_name(ir_variable *var)
+{
+ /* Do we already have a name for this variable? */
+ const char *name = (const char *) hash_table_find(this->printable_names, var);
+ if (name != NULL)
+ return name;
+
+ /* If there's no conflict, just use the original name */
+ if (_mesa_symbol_table_find_symbol(this->symbols, -1, var->name) == NULL) {
+ name = var->name;
+ } else {
+ static unsigned i = 1;
+ name = ralloc_asprintf(this->mem_ctx, "%s@%u", var->name, ++i);
+ }
+ hash_table_insert(this->printable_names, (void *) name, var);
+ _mesa_symbol_table_add_symbol(this->symbols, -1, name, var);
+ return name;
+}
+
+static void
+print_type(const glsl_type *t)
+{
+ if (t->base_type == GLSL_TYPE_ARRAY) {
+ printf("(array ");
+ print_type(t->fields.array);
+ printf(" %u)", t->length);
+ } else if ((t->base_type == GLSL_TYPE_STRUCT)
+ && (strncmp("gl_", t->name, 3) != 0)) {
+ printf("%s@%p", t->name, (void *) t);
+ } else {
+ printf("%s", t->name);
+ }
+}
+
+
+void ir_print_visitor::visit(ir_variable *ir)
+{
+ printf("(declare ");
+
+ const char *const cent = (ir->centroid) ? "centroid " : "";
+ const char *const inv = (ir->invariant) ? "invariant " : "";
+ const char *const mode[] = { "", "uniform ", "in ", "out ", "inout ",
+ "const_in ", "sys ", "temporary " };
+ const char *const interp[] = { "", "flat", "noperspective" };
+
+ printf("(%s%s%s%s) ",
+ cent, inv, mode[ir->mode], interp[ir->interpolation]);
+
+ print_type(ir->type);
+ printf(" %s)", unique_name(ir));
+}
+
+
+void ir_print_visitor::visit(ir_function_signature *ir)
+{
+ _mesa_symbol_table_push_scope(symbols);
+ printf("(signature ");
+ indentation++;
+
+ print_type(ir->return_type);
+ printf("\n");
+ indent();
+
+ printf("(parameters\n");
+ indentation++;
+
+ foreach_iter(exec_list_iterator, iter, ir->parameters) {
+ ir_variable *const inst = (ir_variable *) iter.get();
+
+ indent();
+ inst->accept(this);
+ printf("\n");
+ }
+ indentation--;
+
+ indent();
+ printf(")\n");
+
+ indent();
+
+ printf("(\n");
+ indentation++;
+
+ foreach_iter(exec_list_iterator, iter, ir->body) {
+ ir_instruction *const inst = (ir_instruction *) iter.get();
+
+ indent();
+ inst->accept(this);
+ printf("\n");
+ }
+ indentation--;
+ indent();
+ printf("))\n");
+ indentation--;
+ _mesa_symbol_table_pop_scope(symbols);
+}
+
+
+void ir_print_visitor::visit(ir_function *ir)
+{
+ printf("(function %s\n", ir->name);
+ indentation++;
+ foreach_iter(exec_list_iterator, iter, *ir) {
+ ir_function_signature *const sig = (ir_function_signature *) iter.get();
+ indent();
+ sig->accept(this);
+ printf("\n");
+ }
+ indentation--;
+ indent();
+ printf(")\n\n");
+}
+
+
+void ir_print_visitor::visit(ir_expression *ir)
+{
+ printf("(expression ");
+
+ print_type(ir->type);
+
+ printf(" %s ", ir->operator_string());
+
+ for (unsigned i = 0; i < ir->get_num_operands(); i++) {
+ ir->operands[i]->accept(this);
+ }
+
+ printf(") ");
+}
+
+
+void ir_print_visitor::visit(ir_texture *ir)
+{
+ printf("(%s ", ir->opcode_string());
+
+ print_type(ir->type);
+ printf(" ");
+
+ ir->sampler->accept(this);
+ printf(" ");
+
+ ir->coordinate->accept(this);
+
+ printf(" ");
+
+ if (ir->offset != NULL) {
+ ir->offset->accept(this);
+ } else {
+ printf("0");
+ }
+
+ printf(" ");
+
+ if (ir->op != ir_txf) {
+ if (ir->projector)
+ ir->projector->accept(this);
+ else
+ printf("1");
+
+ if (ir->shadow_comparitor) {
+ printf(" ");
+ ir->shadow_comparitor->accept(this);
+ } else {
+ printf(" ()");
+ }
+ }
+
+ printf(" ");
+ switch (ir->op)
+ {
+ case ir_tex:
+ break;
+ case ir_txb:
+ ir->lod_info.bias->accept(this);
+ break;
+ case ir_txl:
+ case ir_txf:
+ ir->lod_info.lod->accept(this);
+ break;
+ case ir_txd:
+ printf("(");
+ ir->lod_info.grad.dPdx->accept(this);
+ printf(" ");
+ ir->lod_info.grad.dPdy->accept(this);
+ printf(")");
+ break;
+ };
+ printf(")");
+}
+
+
+void ir_print_visitor::visit(ir_swizzle *ir)
+{
+ const unsigned swiz[4] = {
+ ir->mask.x,
+ ir->mask.y,
+ ir->mask.z,
+ ir->mask.w,
+ };
+
+ printf("(swiz ");
+ for (unsigned i = 0; i < ir->mask.num_components; i++) {
+ printf("%c", "xyzw"[swiz[i]]);
+ }
+ printf(" ");
+ ir->val->accept(this);
+ printf(")");
+}
+
+
+void ir_print_visitor::visit(ir_dereference_variable *ir)
+{
+ ir_variable *var = ir->variable_referenced();
+ printf("(var_ref %s) ", unique_name(var));
+}
+
+
+void ir_print_visitor::visit(ir_dereference_array *ir)
+{
+ printf("(array_ref ");
+ ir->array->accept(this);
+ ir->array_index->accept(this);
+ printf(") ");
+}
+
+
+void ir_print_visitor::visit(ir_dereference_record *ir)
+{
+ printf("(record_ref ");
+ ir->record->accept(this);
+ printf(" %s) ", ir->field);
+}
+
+
+void ir_print_visitor::visit(ir_assignment *ir)
+{
+ printf("(assign ");
+
+ if (ir->condition)
+ ir->condition->accept(this);
+
+ char mask[5];
+ unsigned j = 0;
+
+ for (unsigned i = 0; i < 4; i++) {
+ if ((ir->write_mask & (1 << i)) != 0) {
+ mask[j] = "xyzw"[i];
+ j++;
+ }
+ }
+ mask[j] = '\0';
+
+ printf(" (%s) ", mask);
+
+ ir->lhs->accept(this);
+
+ printf(" ");
+
+ ir->rhs->accept(this);
+ printf(") ");
+}
+
+
+void ir_print_visitor::visit(ir_constant *ir)
+{
+ const glsl_type *const base_type = ir->type->get_base_type();
+
+ printf("(constant ");
+ print_type(ir->type);
+ printf(" (");
+
+ if (ir->type->is_array()) {
+ for (unsigned i = 0; i < ir->type->length; i++)
+ ir->get_array_element(i)->accept(this);
+ } else if (ir->type->is_record()) {
+ ir_constant *value = (ir_constant *) ir->components.get_head();
+ for (unsigned i = 0; i < ir->type->length; i++) {
+ printf("(%s ", ir->type->fields.structure->name);
+ value->accept(this);
+ printf(")");
+
+ value = (ir_constant *) value->next;
+ }
+ } else {
+ for (unsigned i = 0; i < ir->type->components(); i++) {
+ if (i != 0)
+ printf(" ");
+ switch (base_type->base_type) {
+ case GLSL_TYPE_UINT: printf("%u", ir->value.u[i]); break;
+ case GLSL_TYPE_INT: printf("%d", ir->value.i[i]); break;
+ case GLSL_TYPE_FLOAT: printf("%f", ir->value.f[i]); break;
+ case GLSL_TYPE_BOOL: printf("%d", ir->value.b[i]); break;
+ default: assert(0);
+ }
+ }
+ }
+ printf(")) ");
+}
+
+
+void
+ir_print_visitor::visit(ir_call *ir)
+{
+ printf("(call %s (", ir->callee_name());
+ foreach_iter(exec_list_iterator, iter, *ir) {
+ ir_instruction *const inst = (ir_instruction *) iter.get();
+
+ inst->accept(this);
+ }
+ printf("))\n");
+}
+
+
+void
+ir_print_visitor::visit(ir_return *ir)
+{
+ printf("(return");
+
+ ir_rvalue *const value = ir->get_value();
+ if (value) {
+ printf(" ");
+ value->accept(this);
+ }
+
+ printf(")");
+}
+
+
+void
+ir_print_visitor::visit(ir_discard *ir)
+{
+ printf("(discard ");
+
+ if (ir->condition != NULL) {
+ printf(" ");
+ ir->condition->accept(this);
+ }
+
+ printf(")");
+}
+
+
+void
+ir_print_visitor::visit(ir_if *ir)
+{
+ printf("(if ");
+ ir->condition->accept(this);
+
+ printf("(\n");
+ indentation++;
+
+ foreach_iter(exec_list_iterator, iter, ir->then_instructions) {
+ ir_instruction *const inst = (ir_instruction *) iter.get();
+
+ indent();
+ inst->accept(this);
+ printf("\n");
+ }
+
+ indentation--;
+ indent();
+ printf(")\n");
+
+ indent();
+ if (!ir->else_instructions.is_empty()) {
+ printf("(\n");
+ indentation++;
+
+ foreach_iter(exec_list_iterator, iter, ir->else_instructions) {
+ ir_instruction *const inst = (ir_instruction *) iter.get();
+
+ indent();
+ inst->accept(this);
+ printf("\n");
+ }
+ indentation--;
+ indent();
+ printf("))\n");
+ } else {
+ printf("())\n");
+ }
+}
+
+
+void
+ir_print_visitor::visit(ir_loop *ir)
+{
+ printf("(loop (");
+ if (ir->counter != NULL)
+ ir->counter->accept(this);
+ printf(") (");
+ if (ir->from != NULL)
+ ir->from->accept(this);
+ printf(") (");
+ if (ir->to != NULL)
+ ir->to->accept(this);
+ printf(") (");
+ if (ir->increment != NULL)
+ ir->increment->accept(this);
+ printf(") (\n");
+ indentation++;
+
+ foreach_iter(exec_list_iterator, iter, ir->body_instructions) {
+ ir_instruction *const inst = (ir_instruction *) iter.get();
+
+ indent();
+ inst->accept(this);
+ printf("\n");
+ }
+ indentation--;
+ indent();
+ printf("))\n");
+}
+
+
+void
+ir_print_visitor::visit(ir_loop_jump *ir)
+{
+ printf("%s", ir->is_break() ? "break" : "continue");
+}
diff --git a/mesalib/src/glsl/ir_print_visitor.h b/mesalib/src/glsl/ir_print_visitor.h
index c7136f11a..ec4d00843 100644
--- a/mesalib/src/glsl/ir_print_visitor.h
+++ b/mesalib/src/glsl/ir_print_visitor.h
@@ -1,94 +1,94 @@
-/* -*- c++ -*- */
-/*
- * Copyright © 2010 Intel Corporation
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-
-#pragma once
-#ifndef IR_PRINT_VISITOR_H
-#define IR_PRINT_VISITOR_H
-
-#include "ir.h"
-#include "ir_visitor.h"
-
-extern "C" {
-#include "program/symbol_table.h"
-}
-
-extern void _mesa_print_ir(exec_list *instructions,
- struct _mesa_glsl_parse_state *state);
-
-/**
- * Abstract base class of visitors of IR instruction trees
- */
-class ir_print_visitor : public ir_visitor {
-public:
- ir_print_visitor();
- virtual ~ir_print_visitor();
-
- void indent(void);
-
- /**
- * \name Visit methods
- *
- * As typical for the visitor pattern, there must be one \c visit method for
- * each concrete subclass of \c ir_instruction. Virtual base classes within
- * the hierarchy should not have \c visit methods.
- */
- /*@{*/
- virtual void visit(ir_variable *);
- virtual void visit(ir_function_signature *);
- virtual void visit(ir_function *);
- virtual void visit(ir_expression *);
- virtual void visit(ir_texture *);
- virtual void visit(ir_swizzle *);
- virtual void visit(ir_dereference_variable *);
- virtual void visit(ir_dereference_array *);
- virtual void visit(ir_dereference_record *);
- virtual void visit(ir_assignment *);
- virtual void visit(ir_constant *);
- virtual void visit(ir_call *);
- virtual void visit(ir_return *);
- virtual void visit(ir_discard *);
- virtual void visit(ir_if *);
- virtual void visit(ir_loop *);
- virtual void visit(ir_loop_jump *);
- /*@}*/
-
-private:
- /**
- * Fetch/generate a unique name for ir_variable.
- *
- * GLSL IR permits multiple ir_variables to share the same name. This works
- * fine until we try to print it, when we really need a unique one.
- */
- const char *unique_name(ir_variable *var);
-
- /** A mapping from ir_variable * -> unique printable names. */
- hash_table *printable_names;
- _mesa_symbol_table *symbols;
-
- void *mem_ctx;
-
- int indentation;
-};
-
-#endif /* IR_PRINT_VISITOR_H */
+/* -*- c++ -*- */
+/*
+ * Copyright © 2010 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+#pragma once
+#ifndef IR_PRINT_VISITOR_H
+#define IR_PRINT_VISITOR_H
+
+#include "ir.h"
+#include "ir_visitor.h"
+
+extern "C" {
+#include "program/symbol_table.h"
+}
+
+extern void _mesa_print_ir(exec_list *instructions,
+ struct _mesa_glsl_parse_state *state);
+
+/**
+ * Abstract base class of visitors of IR instruction trees
+ */
+class ir_print_visitor : public ir_visitor {
+public:
+ ir_print_visitor();
+ virtual ~ir_print_visitor();
+
+ void indent(void);
+
+ /**
+ * \name Visit methods
+ *
+ * As typical for the visitor pattern, there must be one \c visit method for
+ * each concrete subclass of \c ir_instruction. Virtual base classes within
+ * the hierarchy should not have \c visit methods.
+ */
+ /*@{*/
+ virtual void visit(ir_variable *);
+ virtual void visit(ir_function_signature *);
+ virtual void visit(ir_function *);
+ virtual void visit(ir_expression *);
+ virtual void visit(ir_texture *);
+ virtual void visit(ir_swizzle *);
+ virtual void visit(ir_dereference_variable *);
+ virtual void visit(ir_dereference_array *);
+ virtual void visit(ir_dereference_record *);
+ virtual void visit(ir_assignment *);
+ virtual void visit(ir_constant *);
+ virtual void visit(ir_call *);
+ virtual void visit(ir_return *);
+ virtual void visit(ir_discard *);
+ virtual void visit(ir_if *);
+ virtual void visit(ir_loop *);
+ virtual void visit(ir_loop_jump *);
+ /*@}*/
+
+private:
+ /**
+ * Fetch/generate a unique name for ir_variable.
+ *
+ * GLSL IR permits multiple ir_variables to share the same name. This works
+ * fine until we try to print it, when we really need a unique one.
+ */
+ const char *unique_name(ir_variable *var);
+
+ /** A mapping from ir_variable * -> unique printable names. */
+ hash_table *printable_names;
+ _mesa_symbol_table *symbols;
+
+ void *mem_ctx;
+
+ int indentation;
+};
+
+#endif /* IR_PRINT_VISITOR_H */
diff --git a/mesalib/src/glsl/ir_validate.cpp b/mesalib/src/glsl/ir_validate.cpp
index 7b1c19d65..ce5bd4afe 100644
--- a/mesalib/src/glsl/ir_validate.cpp
+++ b/mesalib/src/glsl/ir_validate.cpp
@@ -1,577 +1,577 @@
-/*
- * Copyright © 2010 Intel Corporation
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-
-/**
- * \file ir_validate.cpp
- *
- * Attempts to verify that various invariants of the IR tree are true.
- *
- * In particular, at the moment it makes sure that no single
- * ir_instruction node except for ir_variable appears multiple times
- * in the ir tree. ir_variable does appear multiple times: Once as a
- * declaration in an exec_list, and multiple times as the endpoint of
- * a dereference chain.
- */
-
-#include <inttypes.h>
-#include "ir.h"
-#include "ir_hierarchical_visitor.h"
-#include "program/hash_table.h"
-#include "glsl_types.h"
-
-class ir_validate : public ir_hierarchical_visitor {
-public:
- ir_validate()
- {
- this->ht = hash_table_ctor(0, hash_table_pointer_hash,
- hash_table_pointer_compare);
-
- this->current_function = NULL;
-
- this->callback = ir_validate::validate_ir;
- this->data = ht;
- }
-
- ~ir_validate()
- {
- hash_table_dtor(this->ht);
- }
-
- virtual ir_visitor_status visit(ir_variable *v);
- virtual ir_visitor_status visit(ir_dereference_variable *ir);
- virtual ir_visitor_status visit(ir_if *ir);
-
- virtual ir_visitor_status visit_leave(ir_loop *ir);
- virtual ir_visitor_status visit_enter(ir_function *ir);
- virtual ir_visitor_status visit_leave(ir_function *ir);
- virtual ir_visitor_status visit_enter(ir_function_signature *ir);
-
- virtual ir_visitor_status visit_leave(ir_expression *ir);
- virtual ir_visitor_status visit_leave(ir_swizzle *ir);
-
- virtual ir_visitor_status visit_enter(ir_assignment *ir);
- virtual ir_visitor_status visit_enter(ir_call *ir);
-
- static void validate_ir(ir_instruction *ir, void *data);
-
- ir_function *current_function;
-
- struct hash_table *ht;
-};
-
-
-ir_visitor_status
-ir_validate::visit(ir_dereference_variable *ir)
-{
- if ((ir->var == NULL) || (ir->var->as_variable() == NULL)) {
- printf("ir_dereference_variable @ %p does not specify a variable %p\n",
- (void *) ir, (void *) ir->var);
- abort();
- }
-
- if (hash_table_find(ht, ir->var) == NULL) {
- printf("ir_dereference_variable @ %p specifies undeclared variable "
- "`%s' @ %p\n",
- (void *) ir, ir->var->name, (void *) ir->var);
- abort();
- }
-
- this->validate_ir(ir, this->data);
-
- return visit_continue;
-}
-
-ir_visitor_status
-ir_validate::visit(ir_if *ir)
-{
- if (ir->condition->type != glsl_type::bool_type) {
- printf("ir_if condition %s type instead of bool.\n",
- ir->condition->type->name);
- ir->print();
- printf("\n");
- abort();
- }
-
- return visit_continue;
-}
-
-
-ir_visitor_status
-ir_validate::visit_leave(ir_loop *ir)
-{
- if (ir->counter != NULL) {
- if ((ir->from == NULL) || (ir->from == NULL) || (ir->increment == NULL)) {
- printf("ir_loop has invalid loop controls:\n"
- " counter: %p\n"
- " from: %p\n"
- " to: %p\n"
- " increment: %p\n",
- (void *) ir->counter, (void *) ir->from, (void *) ir->to,
- (void *) ir->increment);
- abort();
- }
-
- if ((ir->cmp < ir_binop_less) || (ir->cmp > ir_binop_nequal)) {
- printf("ir_loop has invalid comparitor %d\n", ir->cmp);
- abort();
- }
- } else {
- if ((ir->from != NULL) || (ir->from != NULL) || (ir->increment != NULL)) {
- printf("ir_loop has invalid loop controls:\n"
- " counter: %p\n"
- " from: %p\n"
- " to: %p\n"
- " increment: %p\n",
- (void *) ir->counter, (void *) ir->from, (void *) ir->to,
- (void *) ir->increment);
- abort();
- }
- }
-
- return visit_continue;
-}
-
-
-ir_visitor_status
-ir_validate::visit_enter(ir_function *ir)
-{
- /* Function definitions cannot be nested.
- */
- if (this->current_function != NULL) {
- printf("Function definition nested inside another function "
- "definition:\n");
- printf("%s %p inside %s %p\n",
- ir->name, (void *) ir,
- this->current_function->name, (void *) this->current_function);
- abort();
- }
-
- /* Store the current function hierarchy being traversed. This is used
- * by the function signature visitor to ensure that the signatures are
- * linked with the correct functions.
- */
- this->current_function = ir;
-
- this->validate_ir(ir, this->data);
-
- /* Verify that all of the things stored in the list of signatures are,
- * in fact, function signatures.
- */
- foreach_list(node, &ir->signatures) {
- ir_instruction *sig = (ir_instruction *) node;
-
- if (sig->ir_type != ir_type_function_signature) {
- printf("Non-signature in signature list of function `%s'\n",
- ir->name);
- abort();
- }
- }
-
- return visit_continue;
-}
-
-ir_visitor_status
-ir_validate::visit_leave(ir_function *ir)
-{
- assert(ralloc_parent(ir->name) == ir);
-
- this->current_function = NULL;
- return visit_continue;
-}
-
-ir_visitor_status
-ir_validate::visit_enter(ir_function_signature *ir)
-{
- if (this->current_function != ir->function()) {
- printf("Function signature nested inside wrong function "
- "definition:\n");
- printf("%p inside %s %p instead of %s %p\n",
- (void *) ir,
- this->current_function->name, (void *) this->current_function,
- ir->function_name(), (void *) ir->function());
- abort();
- }
-
- if (ir->return_type == NULL) {
- printf("Function signature %p for function %s has NULL return type.\n",
- (void *) ir, ir->function_name());
- abort();
- }
-
- this->validate_ir(ir, this->data);
-
- return visit_continue;
-}
-
-ir_visitor_status
-ir_validate::visit_leave(ir_expression *ir)
-{
- switch (ir->operation) {
- case ir_unop_bit_not:
- assert(ir->operands[0]->type == ir->type);
- break;
- case ir_unop_logic_not:
- assert(ir->type->base_type == GLSL_TYPE_BOOL);
- assert(ir->operands[0]->type->base_type == GLSL_TYPE_BOOL);
- break;
-
- case ir_unop_neg:
- case ir_unop_abs:
- case ir_unop_sign:
- case ir_unop_rcp:
- case ir_unop_rsq:
- case ir_unop_sqrt:
- assert(ir->type == ir->operands[0]->type);
- break;
-
- case ir_unop_exp:
- case ir_unop_log:
- case ir_unop_exp2:
- case ir_unop_log2:
- assert(ir->operands[0]->type->base_type == GLSL_TYPE_FLOAT);
- assert(ir->type == ir->operands[0]->type);
- break;
-
- case ir_unop_f2i:
- assert(ir->operands[0]->type->base_type == GLSL_TYPE_FLOAT);
- assert(ir->type->is_integer());
- break;
- case ir_unop_i2f:
- assert(ir->operands[0]->type->base_type == GLSL_TYPE_INT);
- assert(ir->type->base_type == GLSL_TYPE_FLOAT);
- break;
- case ir_unop_f2b:
- assert(ir->operands[0]->type->base_type == GLSL_TYPE_FLOAT);
- assert(ir->type->base_type == GLSL_TYPE_BOOL);
- break;
- case ir_unop_b2f:
- assert(ir->operands[0]->type->base_type == GLSL_TYPE_BOOL);
- assert(ir->type->base_type == GLSL_TYPE_FLOAT);
- break;
- case ir_unop_i2b:
- assert(ir->operands[0]->type->is_integer());
- assert(ir->type->base_type == GLSL_TYPE_BOOL);
- break;
- case ir_unop_b2i:
- assert(ir->operands[0]->type->base_type == GLSL_TYPE_BOOL);
- assert(ir->type->is_integer());
- break;
- case ir_unop_u2f:
- assert(ir->operands[0]->type->base_type == GLSL_TYPE_UINT);
- assert(ir->type->base_type == GLSL_TYPE_FLOAT);
- break;
-
- case ir_unop_any:
- assert(ir->operands[0]->type->base_type == GLSL_TYPE_BOOL);
- assert(ir->type == glsl_type::bool_type);
- break;
-
- case ir_unop_trunc:
- case ir_unop_round_even:
- case ir_unop_ceil:
- case ir_unop_floor:
- case ir_unop_fract:
- case ir_unop_sin:
- case ir_unop_cos:
- case ir_unop_sin_reduced:
- case ir_unop_cos_reduced:
- case ir_unop_dFdx:
- case ir_unop_dFdy:
- assert(ir->operands[0]->type->base_type == GLSL_TYPE_FLOAT);
- assert(ir->operands[0]->type == ir->type);
- break;
-
- case ir_unop_noise:
- /* XXX what can we assert here? */
- break;
-
- case ir_binop_add:
- case ir_binop_sub:
- case ir_binop_mul:
- case ir_binop_div:
- case ir_binop_mod:
- case ir_binop_min:
- case ir_binop_max:
- case ir_binop_pow:
- if (ir->operands[0]->type->is_scalar())
- assert(ir->operands[1]->type == ir->type);
- else if (ir->operands[1]->type->is_scalar())
- assert(ir->operands[0]->type == ir->type);
- else if (ir->operands[0]->type->is_vector() &&
- ir->operands[1]->type->is_vector()) {
- assert(ir->operands[0]->type == ir->operands[1]->type);
- assert(ir->operands[0]->type == ir->type);
- }
- break;
-
- case ir_binop_less:
- case ir_binop_greater:
- case ir_binop_lequal:
- case ir_binop_gequal:
- case ir_binop_equal:
- case ir_binop_nequal:
- /* The semantics of the IR operators differ from the GLSL <, >, <=, >=,
- * ==, and != operators. The IR operators perform a component-wise
- * comparison on scalar or vector types and return a boolean scalar or
- * vector type of the same size.
- */
- assert(ir->type->base_type == GLSL_TYPE_BOOL);
- assert(ir->operands[0]->type == ir->operands[1]->type);
- assert(ir->operands[0]->type->is_vector()
- || ir->operands[0]->type->is_scalar());
- assert(ir->operands[0]->type->vector_elements
- == ir->type->vector_elements);
- break;
-
- case ir_binop_all_equal:
- case ir_binop_any_nequal:
- /* GLSL == and != operate on scalars, vectors, matrices and arrays, and
- * return a scalar boolean. The IR matches that.
- */
- assert(ir->type == glsl_type::bool_type);
- assert(ir->operands[0]->type == ir->operands[1]->type);
- break;
-
- case ir_binop_lshift:
- case ir_binop_rshift:
- assert(ir->operands[0]->type->is_integer() &&
- ir->operands[1]->type->is_integer());
- if (ir->operands[0]->type->is_scalar()) {
- assert(ir->operands[1]->type->is_scalar());
- }
- if (ir->operands[0]->type->is_vector() &&
- ir->operands[1]->type->is_vector()) {
- assert(ir->operands[0]->type->components() ==
- ir->operands[1]->type->components());
- }
- assert(ir->type == ir->operands[0]->type);
- break;
-
- case ir_binop_bit_and:
- case ir_binop_bit_xor:
- case ir_binop_bit_or:
- assert(ir->operands[0]->type->base_type ==
- ir->operands[1]->type->base_type);
- assert(ir->type->is_integer());
- if (ir->operands[0]->type->is_vector() &&
- ir->operands[1]->type->is_vector()) {
- assert(ir->operands[0]->type->vector_elements ==
- ir->operands[1]->type->vector_elements);
- }
- break;
-
- case ir_binop_logic_and:
- case ir_binop_logic_xor:
- case ir_binop_logic_or:
- assert(ir->type == glsl_type::bool_type);
- assert(ir->operands[0]->type == glsl_type::bool_type);
- assert(ir->operands[1]->type == glsl_type::bool_type);
- break;
-
- case ir_binop_dot:
- assert(ir->type == glsl_type::float_type);
- assert(ir->operands[0]->type->base_type == GLSL_TYPE_FLOAT);
- assert(ir->operands[0]->type->is_vector());
- assert(ir->operands[0]->type == ir->operands[1]->type);
- break;
-
- case ir_quadop_vector:
- /* The vector operator collects some number of scalars and generates a
- * vector from them.
- *
- * - All of the operands must be scalar.
- * - Number of operands must matche the size of the resulting vector.
- * - Base type of the operands must match the base type of the result.
- */
- assert(ir->type->is_vector());
- switch (ir->type->vector_elements) {
- case 2:
- assert(ir->operands[0]->type->is_scalar());
- assert(ir->operands[0]->type->base_type == ir->type->base_type);
- assert(ir->operands[1]->type->is_scalar());
- assert(ir->operands[1]->type->base_type == ir->type->base_type);
- assert(ir->operands[2] == NULL);
- assert(ir->operands[3] == NULL);
- break;
- case 3:
- assert(ir->operands[0]->type->is_scalar());
- assert(ir->operands[0]->type->base_type == ir->type->base_type);
- assert(ir->operands[1]->type->is_scalar());
- assert(ir->operands[1]->type->base_type == ir->type->base_type);
- assert(ir->operands[2]->type->is_scalar());
- assert(ir->operands[2]->type->base_type == ir->type->base_type);
- assert(ir->operands[3] == NULL);
- break;
- case 4:
- assert(ir->operands[0]->type->is_scalar());
- assert(ir->operands[0]->type->base_type == ir->type->base_type);
- assert(ir->operands[1]->type->is_scalar());
- assert(ir->operands[1]->type->base_type == ir->type->base_type);
- assert(ir->operands[2]->type->is_scalar());
- assert(ir->operands[2]->type->base_type == ir->type->base_type);
- assert(ir->operands[3]->type->is_scalar());
- assert(ir->operands[3]->type->base_type == ir->type->base_type);
- break;
- default:
- /* The is_vector assertion above should prevent execution from ever
- * getting here.
- */
- assert(!"Should not get here.");
- break;
- }
- }
-
- return visit_continue;
-}
-
-ir_visitor_status
-ir_validate::visit_leave(ir_swizzle *ir)
-{
- int chans[4] = {ir->mask.x, ir->mask.y, ir->mask.z, ir->mask.w};
-
- for (unsigned int i = 0; i < ir->type->vector_elements; i++) {
- if (chans[i] >= ir->val->type->vector_elements) {
- printf("ir_swizzle @ %p specifies a channel not present "
- "in the value.\n", (void *) ir);
- ir->print();
- abort();
- }
- }
-
- return visit_continue;
-}
-
-ir_visitor_status
-ir_validate::visit(ir_variable *ir)
-{
- /* An ir_variable is the one thing that can (and will) appear multiple times
- * in an IR tree. It is added to the hashtable so that it can be used
- * in the ir_dereference_variable handler to ensure that a variable is
- * declared before it is dereferenced.
- */
- if (ir->name)
- assert(ralloc_parent(ir->name) == ir);
-
- hash_table_insert(ht, ir, ir);
-
-
- /* If a variable is an array, verify that the maximum array index is in
- * bounds. There was once an error in AST-to-HIR conversion that set this
- * to be out of bounds.
- */
- if (ir->type->array_size() > 0) {
- if (ir->max_array_access >= ir->type->length) {
- printf("ir_variable has maximum access out of bounds (%d vs %d)\n",
- ir->max_array_access, ir->type->length - 1);
- ir->print();
- abort();
- }
- }
-
- return visit_continue;
-}
-
-ir_visitor_status
-ir_validate::visit_enter(ir_assignment *ir)
-{
- const ir_dereference *const lhs = ir->lhs;
- if (lhs->type->is_scalar() || lhs->type->is_vector()) {
- if (ir->write_mask == 0) {
- printf("Assignment LHS is %s, but write mask is 0:\n",
- lhs->type->is_scalar() ? "scalar" : "vector");
- ir->print();
- abort();
- }
-
- int lhs_components = 0;
- for (int i = 0; i < 4; i++) {
- if (ir->write_mask & (1 << i))
- lhs_components++;
- }
-
- if (lhs_components != ir->rhs->type->vector_elements) {
- printf("Assignment count of LHS write mask channels enabled not\n"
- "matching RHS vector size (%d LHS, %d RHS).\n",
- lhs_components, ir->rhs->type->vector_elements);
- ir->print();
- abort();
- }
- }
-
- this->validate_ir(ir, this->data);
-
- return visit_continue;
-}
-
-ir_visitor_status
-ir_validate::visit_enter(ir_call *ir)
-{
- ir_function_signature *const callee = ir->get_callee();
-
- if (callee->ir_type != ir_type_function_signature) {
- printf("IR called by ir_call is not ir_function_signature!\n");
- abort();
- }
-
- return visit_continue;
-}
-
-void
-ir_validate::validate_ir(ir_instruction *ir, void *data)
-{
- struct hash_table *ht = (struct hash_table *) data;
-
- if (hash_table_find(ht, ir)) {
- printf("Instruction node present twice in ir tree:\n");
- ir->print();
- printf("\n");
- abort();
- }
- hash_table_insert(ht, ir, ir);
-}
-
-void
-check_node_type(ir_instruction *ir, void *data)
-{
- (void) data;
-
- if (ir->ir_type <= ir_type_unset || ir->ir_type >= ir_type_max) {
- printf("Instruction node with unset type\n");
- ir->print(); printf("\n");
- }
- assert(ir->type != glsl_type::error_type);
-}
-
-void
-validate_ir_tree(exec_list *instructions)
-{
- ir_validate v;
-
- v.run(instructions);
-
- foreach_iter(exec_list_iterator, iter, *instructions) {
- ir_instruction *ir = (ir_instruction *)iter.get();
-
- visit_tree(ir, check_node_type, NULL);
- }
-}
+/*
+ * Copyright © 2010 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+/**
+ * \file ir_validate.cpp
+ *
+ * Attempts to verify that various invariants of the IR tree are true.
+ *
+ * In particular, at the moment it makes sure that no single
+ * ir_instruction node except for ir_variable appears multiple times
+ * in the ir tree. ir_variable does appear multiple times: Once as a
+ * declaration in an exec_list, and multiple times as the endpoint of
+ * a dereference chain.
+ */
+
+#include <inttypes.h>
+#include "ir.h"
+#include "ir_hierarchical_visitor.h"
+#include "program/hash_table.h"
+#include "glsl_types.h"
+
+class ir_validate : public ir_hierarchical_visitor {
+public:
+ ir_validate()
+ {
+ this->ht = hash_table_ctor(0, hash_table_pointer_hash,
+ hash_table_pointer_compare);
+
+ this->current_function = NULL;
+
+ this->callback = ir_validate::validate_ir;
+ this->data = ht;
+ }
+
+ ~ir_validate()
+ {
+ hash_table_dtor(this->ht);
+ }
+
+ virtual ir_visitor_status visit(ir_variable *v);
+ virtual ir_visitor_status visit(ir_dereference_variable *ir);
+ virtual ir_visitor_status visit(ir_if *ir);
+
+ virtual ir_visitor_status visit_leave(ir_loop *ir);
+ virtual ir_visitor_status visit_enter(ir_function *ir);
+ virtual ir_visitor_status visit_leave(ir_function *ir);
+ virtual ir_visitor_status visit_enter(ir_function_signature *ir);
+
+ virtual ir_visitor_status visit_leave(ir_expression *ir);
+ virtual ir_visitor_status visit_leave(ir_swizzle *ir);
+
+ virtual ir_visitor_status visit_enter(ir_assignment *ir);
+ virtual ir_visitor_status visit_enter(ir_call *ir);
+
+ static void validate_ir(ir_instruction *ir, void *data);
+
+ ir_function *current_function;
+
+ struct hash_table *ht;
+};
+
+
+ir_visitor_status
+ir_validate::visit(ir_dereference_variable *ir)
+{
+ if ((ir->var == NULL) || (ir->var->as_variable() == NULL)) {
+ printf("ir_dereference_variable @ %p does not specify a variable %p\n",
+ (void *) ir, (void *) ir->var);
+ abort();
+ }
+
+ if (hash_table_find(ht, ir->var) == NULL) {
+ printf("ir_dereference_variable @ %p specifies undeclared variable "
+ "`%s' @ %p\n",
+ (void *) ir, ir->var->name, (void *) ir->var);
+ abort();
+ }
+
+ this->validate_ir(ir, this->data);
+
+ return visit_continue;
+}
+
+ir_visitor_status
+ir_validate::visit(ir_if *ir)
+{
+ if (ir->condition->type != glsl_type::bool_type) {
+ printf("ir_if condition %s type instead of bool.\n",
+ ir->condition->type->name);
+ ir->print();
+ printf("\n");
+ abort();
+ }
+
+ return visit_continue;
+}
+
+
+ir_visitor_status
+ir_validate::visit_leave(ir_loop *ir)
+{
+ if (ir->counter != NULL) {
+ if ((ir->from == NULL) || (ir->from == NULL) || (ir->increment == NULL)) {
+ printf("ir_loop has invalid loop controls:\n"
+ " counter: %p\n"
+ " from: %p\n"
+ " to: %p\n"
+ " increment: %p\n",
+ (void *) ir->counter, (void *) ir->from, (void *) ir->to,
+ (void *) ir->increment);
+ abort();
+ }
+
+ if ((ir->cmp < ir_binop_less) || (ir->cmp > ir_binop_nequal)) {
+ printf("ir_loop has invalid comparitor %d\n", ir->cmp);
+ abort();
+ }
+ } else {
+ if ((ir->from != NULL) || (ir->from != NULL) || (ir->increment != NULL)) {
+ printf("ir_loop has invalid loop controls:\n"
+ " counter: %p\n"
+ " from: %p\n"
+ " to: %p\n"
+ " increment: %p\n",
+ (void *) ir->counter, (void *) ir->from, (void *) ir->to,
+ (void *) ir->increment);
+ abort();
+ }
+ }
+
+ return visit_continue;
+}
+
+
+ir_visitor_status
+ir_validate::visit_enter(ir_function *ir)
+{
+ /* Function definitions cannot be nested.
+ */
+ if (this->current_function != NULL) {
+ printf("Function definition nested inside another function "
+ "definition:\n");
+ printf("%s %p inside %s %p\n",
+ ir->name, (void *) ir,
+ this->current_function->name, (void *) this->current_function);
+ abort();
+ }
+
+ /* Store the current function hierarchy being traversed. This is used
+ * by the function signature visitor to ensure that the signatures are
+ * linked with the correct functions.
+ */
+ this->current_function = ir;
+
+ this->validate_ir(ir, this->data);
+
+ /* Verify that all of the things stored in the list of signatures are,
+ * in fact, function signatures.
+ */
+ foreach_list(node, &ir->signatures) {
+ ir_instruction *sig = (ir_instruction *) node;
+
+ if (sig->ir_type != ir_type_function_signature) {
+ printf("Non-signature in signature list of function `%s'\n",
+ ir->name);
+ abort();
+ }
+ }
+
+ return visit_continue;
+}
+
+ir_visitor_status
+ir_validate::visit_leave(ir_function *ir)
+{
+ assert(ralloc_parent(ir->name) == ir);
+
+ this->current_function = NULL;
+ return visit_continue;
+}
+
+ir_visitor_status
+ir_validate::visit_enter(ir_function_signature *ir)
+{
+ if (this->current_function != ir->function()) {
+ printf("Function signature nested inside wrong function "
+ "definition:\n");
+ printf("%p inside %s %p instead of %s %p\n",
+ (void *) ir,
+ this->current_function->name, (void *) this->current_function,
+ ir->function_name(), (void *) ir->function());
+ abort();
+ }
+
+ if (ir->return_type == NULL) {
+ printf("Function signature %p for function %s has NULL return type.\n",
+ (void *) ir, ir->function_name());
+ abort();
+ }
+
+ this->validate_ir(ir, this->data);
+
+ return visit_continue;
+}
+
+ir_visitor_status
+ir_validate::visit_leave(ir_expression *ir)
+{
+ switch (ir->operation) {
+ case ir_unop_bit_not:
+ assert(ir->operands[0]->type == ir->type);
+ break;
+ case ir_unop_logic_not:
+ assert(ir->type->base_type == GLSL_TYPE_BOOL);
+ assert(ir->operands[0]->type->base_type == GLSL_TYPE_BOOL);
+ break;
+
+ case ir_unop_neg:
+ case ir_unop_abs:
+ case ir_unop_sign:
+ case ir_unop_rcp:
+ case ir_unop_rsq:
+ case ir_unop_sqrt:
+ assert(ir->type == ir->operands[0]->type);
+ break;
+
+ case ir_unop_exp:
+ case ir_unop_log:
+ case ir_unop_exp2:
+ case ir_unop_log2:
+ assert(ir->operands[0]->type->base_type == GLSL_TYPE_FLOAT);
+ assert(ir->type == ir->operands[0]->type);
+ break;
+
+ case ir_unop_f2i:
+ assert(ir->operands[0]->type->base_type == GLSL_TYPE_FLOAT);
+ assert(ir->type->is_integer());
+ break;
+ case ir_unop_i2f:
+ assert(ir->operands[0]->type->base_type == GLSL_TYPE_INT);
+ assert(ir->type->base_type == GLSL_TYPE_FLOAT);
+ break;
+ case ir_unop_f2b:
+ assert(ir->operands[0]->type->base_type == GLSL_TYPE_FLOAT);
+ assert(ir->type->base_type == GLSL_TYPE_BOOL);
+ break;
+ case ir_unop_b2f:
+ assert(ir->operands[0]->type->base_type == GLSL_TYPE_BOOL);
+ assert(ir->type->base_type == GLSL_TYPE_FLOAT);
+ break;
+ case ir_unop_i2b:
+ assert(ir->operands[0]->type->is_integer());
+ assert(ir->type->base_type == GLSL_TYPE_BOOL);
+ break;
+ case ir_unop_b2i:
+ assert(ir->operands[0]->type->base_type == GLSL_TYPE_BOOL);
+ assert(ir->type->is_integer());
+ break;
+ case ir_unop_u2f:
+ assert(ir->operands[0]->type->base_type == GLSL_TYPE_UINT);
+ assert(ir->type->base_type == GLSL_TYPE_FLOAT);
+ break;
+
+ case ir_unop_any:
+ assert(ir->operands[0]->type->base_type == GLSL_TYPE_BOOL);
+ assert(ir->type == glsl_type::bool_type);
+ break;
+
+ case ir_unop_trunc:
+ case ir_unop_round_even:
+ case ir_unop_ceil:
+ case ir_unop_floor:
+ case ir_unop_fract:
+ case ir_unop_sin:
+ case ir_unop_cos:
+ case ir_unop_sin_reduced:
+ case ir_unop_cos_reduced:
+ case ir_unop_dFdx:
+ case ir_unop_dFdy:
+ assert(ir->operands[0]->type->base_type == GLSL_TYPE_FLOAT);
+ assert(ir->operands[0]->type == ir->type);
+ break;
+
+ case ir_unop_noise:
+ /* XXX what can we assert here? */
+ break;
+
+ case ir_binop_add:
+ case ir_binop_sub:
+ case ir_binop_mul:
+ case ir_binop_div:
+ case ir_binop_mod:
+ case ir_binop_min:
+ case ir_binop_max:
+ case ir_binop_pow:
+ if (ir->operands[0]->type->is_scalar())
+ assert(ir->operands[1]->type == ir->type);
+ else if (ir->operands[1]->type->is_scalar())
+ assert(ir->operands[0]->type == ir->type);
+ else if (ir->operands[0]->type->is_vector() &&
+ ir->operands[1]->type->is_vector()) {
+ assert(ir->operands[0]->type == ir->operands[1]->type);
+ assert(ir->operands[0]->type == ir->type);
+ }
+ break;
+
+ case ir_binop_less:
+ case ir_binop_greater:
+ case ir_binop_lequal:
+ case ir_binop_gequal:
+ case ir_binop_equal:
+ case ir_binop_nequal:
+ /* The semantics of the IR operators differ from the GLSL <, >, <=, >=,
+ * ==, and != operators. The IR operators perform a component-wise
+ * comparison on scalar or vector types and return a boolean scalar or
+ * vector type of the same size.
+ */
+ assert(ir->type->base_type == GLSL_TYPE_BOOL);
+ assert(ir->operands[0]->type == ir->operands[1]->type);
+ assert(ir->operands[0]->type->is_vector()
+ || ir->operands[0]->type->is_scalar());
+ assert(ir->operands[0]->type->vector_elements
+ == ir->type->vector_elements);
+ break;
+
+ case ir_binop_all_equal:
+ case ir_binop_any_nequal:
+ /* GLSL == and != operate on scalars, vectors, matrices and arrays, and
+ * return a scalar boolean. The IR matches that.
+ */
+ assert(ir->type == glsl_type::bool_type);
+ assert(ir->operands[0]->type == ir->operands[1]->type);
+ break;
+
+ case ir_binop_lshift:
+ case ir_binop_rshift:
+ assert(ir->operands[0]->type->is_integer() &&
+ ir->operands[1]->type->is_integer());
+ if (ir->operands[0]->type->is_scalar()) {
+ assert(ir->operands[1]->type->is_scalar());
+ }
+ if (ir->operands[0]->type->is_vector() &&
+ ir->operands[1]->type->is_vector()) {
+ assert(ir->operands[0]->type->components() ==
+ ir->operands[1]->type->components());
+ }
+ assert(ir->type == ir->operands[0]->type);
+ break;
+
+ case ir_binop_bit_and:
+ case ir_binop_bit_xor:
+ case ir_binop_bit_or:
+ assert(ir->operands[0]->type->base_type ==
+ ir->operands[1]->type->base_type);
+ assert(ir->type->is_integer());
+ if (ir->operands[0]->type->is_vector() &&
+ ir->operands[1]->type->is_vector()) {
+ assert(ir->operands[0]->type->vector_elements ==
+ ir->operands[1]->type->vector_elements);
+ }
+ break;
+
+ case ir_binop_logic_and:
+ case ir_binop_logic_xor:
+ case ir_binop_logic_or:
+ assert(ir->type == glsl_type::bool_type);
+ assert(ir->operands[0]->type == glsl_type::bool_type);
+ assert(ir->operands[1]->type == glsl_type::bool_type);
+ break;
+
+ case ir_binop_dot:
+ assert(ir->type == glsl_type::float_type);
+ assert(ir->operands[0]->type->base_type == GLSL_TYPE_FLOAT);
+ assert(ir->operands[0]->type->is_vector());
+ assert(ir->operands[0]->type == ir->operands[1]->type);
+ break;
+
+ case ir_quadop_vector:
+ /* The vector operator collects some number of scalars and generates a
+ * vector from them.
+ *
+ * - All of the operands must be scalar.
+ * - Number of operands must matche the size of the resulting vector.
+ * - Base type of the operands must match the base type of the result.
+ */
+ assert(ir->type->is_vector());
+ switch (ir->type->vector_elements) {
+ case 2:
+ assert(ir->operands[0]->type->is_scalar());
+ assert(ir->operands[0]->type->base_type == ir->type->base_type);
+ assert(ir->operands[1]->type->is_scalar());
+ assert(ir->operands[1]->type->base_type == ir->type->base_type);
+ assert(ir->operands[2] == NULL);
+ assert(ir->operands[3] == NULL);
+ break;
+ case 3:
+ assert(ir->operands[0]->type->is_scalar());
+ assert(ir->operands[0]->type->base_type == ir->type->base_type);
+ assert(ir->operands[1]->type->is_scalar());
+ assert(ir->operands[1]->type->base_type == ir->type->base_type);
+ assert(ir->operands[2]->type->is_scalar());
+ assert(ir->operands[2]->type->base_type == ir->type->base_type);
+ assert(ir->operands[3] == NULL);
+ break;
+ case 4:
+ assert(ir->operands[0]->type->is_scalar());
+ assert(ir->operands[0]->type->base_type == ir->type->base_type);
+ assert(ir->operands[1]->type->is_scalar());
+ assert(ir->operands[1]->type->base_type == ir->type->base_type);
+ assert(ir->operands[2]->type->is_scalar());
+ assert(ir->operands[2]->type->base_type == ir->type->base_type);
+ assert(ir->operands[3]->type->is_scalar());
+ assert(ir->operands[3]->type->base_type == ir->type->base_type);
+ break;
+ default:
+ /* The is_vector assertion above should prevent execution from ever
+ * getting here.
+ */
+ assert(!"Should not get here.");
+ break;
+ }
+ }
+
+ return visit_continue;
+}
+
+ir_visitor_status
+ir_validate::visit_leave(ir_swizzle *ir)
+{
+ int chans[4] = {ir->mask.x, ir->mask.y, ir->mask.z, ir->mask.w};
+
+ for (unsigned int i = 0; i < ir->type->vector_elements; i++) {
+ if (chans[i] >= ir->val->type->vector_elements) {
+ printf("ir_swizzle @ %p specifies a channel not present "
+ "in the value.\n", (void *) ir);
+ ir->print();
+ abort();
+ }
+ }
+
+ return visit_continue;
+}
+
+ir_visitor_status
+ir_validate::visit(ir_variable *ir)
+{
+ /* An ir_variable is the one thing that can (and will) appear multiple times
+ * in an IR tree. It is added to the hashtable so that it can be used
+ * in the ir_dereference_variable handler to ensure that a variable is
+ * declared before it is dereferenced.
+ */
+ if (ir->name)
+ assert(ralloc_parent(ir->name) == ir);
+
+ hash_table_insert(ht, ir, ir);
+
+
+ /* If a variable is an array, verify that the maximum array index is in
+ * bounds. There was once an error in AST-to-HIR conversion that set this
+ * to be out of bounds.
+ */
+ if (ir->type->array_size() > 0) {
+ if (ir->max_array_access >= ir->type->length) {
+ printf("ir_variable has maximum access out of bounds (%d vs %d)\n",
+ ir->max_array_access, ir->type->length - 1);
+ ir->print();
+ abort();
+ }
+ }
+
+ return visit_continue;
+}
+
+ir_visitor_status
+ir_validate::visit_enter(ir_assignment *ir)
+{
+ const ir_dereference *const lhs = ir->lhs;
+ if (lhs->type->is_scalar() || lhs->type->is_vector()) {
+ if (ir->write_mask == 0) {
+ printf("Assignment LHS is %s, but write mask is 0:\n",
+ lhs->type->is_scalar() ? "scalar" : "vector");
+ ir->print();
+ abort();
+ }
+
+ int lhs_components = 0;
+ for (int i = 0; i < 4; i++) {
+ if (ir->write_mask & (1 << i))
+ lhs_components++;
+ }
+
+ if (lhs_components != ir->rhs->type->vector_elements) {
+ printf("Assignment count of LHS write mask channels enabled not\n"
+ "matching RHS vector size (%d LHS, %d RHS).\n",
+ lhs_components, ir->rhs->type->vector_elements);
+ ir->print();
+ abort();
+ }
+ }
+
+ this->validate_ir(ir, this->data);
+
+ return visit_continue;
+}
+
+ir_visitor_status
+ir_validate::visit_enter(ir_call *ir)
+{
+ ir_function_signature *const callee = ir->get_callee();
+
+ if (callee->ir_type != ir_type_function_signature) {
+ printf("IR called by ir_call is not ir_function_signature!\n");
+ abort();
+ }
+
+ return visit_continue;
+}
+
+void
+ir_validate::validate_ir(ir_instruction *ir, void *data)
+{
+ struct hash_table *ht = (struct hash_table *) data;
+
+ if (hash_table_find(ht, ir)) {
+ printf("Instruction node present twice in ir tree:\n");
+ ir->print();
+ printf("\n");
+ abort();
+ }
+ hash_table_insert(ht, ir, ir);
+}
+
+void
+check_node_type(ir_instruction *ir, void *data)
+{
+ (void) data;
+
+ if (ir->ir_type <= ir_type_unset || ir->ir_type >= ir_type_max) {
+ printf("Instruction node with unset type\n");
+ ir->print(); printf("\n");
+ }
+ assert(ir->type != glsl_type::error_type);
+}
+
+void
+validate_ir_tree(exec_list *instructions)
+{
+ ir_validate v;
+
+ v.run(instructions);
+
+ foreach_iter(exec_list_iterator, iter, *instructions) {
+ ir_instruction *ir = (ir_instruction *)iter.get();
+
+ visit_tree(ir, check_node_type, NULL);
+ }
+}
diff --git a/mesalib/src/glsl/ir_variable.cpp b/mesalib/src/glsl/ir_variable.cpp
index b8487694c..8495043fe 100644
--- a/mesalib/src/glsl/ir_variable.cpp
+++ b/mesalib/src/glsl/ir_variable.cpp
@@ -1,857 +1,857 @@
-/*
- * Copyright © 2010 Intel Corporation
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-
-#include "ir.h"
-#include "glsl_parser_extras.h"
-#include "glsl_symbol_table.h"
-#include "builtin_variables.h"
-#include "main/uniforms.h"
-#include "program/prog_parameter.h"
-#include "program/prog_statevars.h"
-#include "program/prog_instruction.h"
-
-static void generate_ARB_draw_buffers_variables(exec_list *,
- struct _mesa_glsl_parse_state *,
- bool, _mesa_glsl_parser_targets);
-
-static void
-generate_ARB_draw_instanced_variables(exec_list *,
- struct _mesa_glsl_parse_state *,
- bool, _mesa_glsl_parser_targets);
-
-static struct gl_builtin_uniform_element gl_DepthRange_elements[] = {
- {"near", {STATE_DEPTH_RANGE, 0, 0}, SWIZZLE_XXXX},
- {"far", {STATE_DEPTH_RANGE, 0, 0}, SWIZZLE_YYYY},
- {"diff", {STATE_DEPTH_RANGE, 0, 0}, SWIZZLE_ZZZZ},
-};
-
-static struct gl_builtin_uniform_element gl_ClipPlane_elements[] = {
- {NULL, {STATE_CLIPPLANE, 0, 0}, SWIZZLE_XYZW}
-};
-
-static struct gl_builtin_uniform_element gl_Point_elements[] = {
- {"size", {STATE_POINT_SIZE}, SWIZZLE_XXXX},
- {"sizeMin", {STATE_POINT_SIZE}, SWIZZLE_YYYY},
- {"sizeMax", {STATE_POINT_SIZE}, SWIZZLE_ZZZZ},
- {"fadeThresholdSize", {STATE_POINT_SIZE}, SWIZZLE_WWWW},
- {"distanceConstantAttenuation", {STATE_POINT_ATTENUATION}, SWIZZLE_XXXX},
- {"distanceLinearAttenuation", {STATE_POINT_ATTENUATION}, SWIZZLE_YYYY},
- {"distanceQuadraticAttenuation", {STATE_POINT_ATTENUATION}, SWIZZLE_ZZZZ},
-};
-
-static struct gl_builtin_uniform_element gl_FrontMaterial_elements[] = {
- {"emission", {STATE_MATERIAL, 0, STATE_EMISSION}, SWIZZLE_XYZW},
- {"ambient", {STATE_MATERIAL, 0, STATE_AMBIENT}, SWIZZLE_XYZW},
- {"diffuse", {STATE_MATERIAL, 0, STATE_DIFFUSE}, SWIZZLE_XYZW},
- {"specular", {STATE_MATERIAL, 0, STATE_SPECULAR}, SWIZZLE_XYZW},
- {"shininess", {STATE_MATERIAL, 0, STATE_SHININESS}, SWIZZLE_XXXX},
-};
-
-static struct gl_builtin_uniform_element gl_BackMaterial_elements[] = {
- {"emission", {STATE_MATERIAL, 1, STATE_EMISSION}, SWIZZLE_XYZW},
- {"ambient", {STATE_MATERIAL, 1, STATE_AMBIENT}, SWIZZLE_XYZW},
- {"diffuse", {STATE_MATERIAL, 1, STATE_DIFFUSE}, SWIZZLE_XYZW},
- {"specular", {STATE_MATERIAL, 1, STATE_SPECULAR}, SWIZZLE_XYZW},
- {"shininess", {STATE_MATERIAL, 1, STATE_SHININESS}, SWIZZLE_XXXX},
-};
-
-static struct gl_builtin_uniform_element gl_LightSource_elements[] = {
- {"ambient", {STATE_LIGHT, 0, STATE_AMBIENT}, SWIZZLE_XYZW},
- {"diffuse", {STATE_LIGHT, 0, STATE_DIFFUSE}, SWIZZLE_XYZW},
- {"specular", {STATE_LIGHT, 0, STATE_SPECULAR}, SWIZZLE_XYZW},
- {"position", {STATE_LIGHT, 0, STATE_POSITION}, SWIZZLE_XYZW},
- {"halfVector", {STATE_LIGHT, 0, STATE_HALF_VECTOR}, SWIZZLE_XYZW},
- {"spotDirection", {STATE_LIGHT, 0, STATE_SPOT_DIRECTION},
- MAKE_SWIZZLE4(SWIZZLE_X,
- SWIZZLE_Y,
- SWIZZLE_Z,
- SWIZZLE_Z)},
- {"spotCosCutoff", {STATE_LIGHT, 0, STATE_SPOT_DIRECTION}, SWIZZLE_WWWW},
- {"spotCutoff", {STATE_LIGHT, 0, STATE_SPOT_CUTOFF}, SWIZZLE_XXXX},
- {"spotExponent", {STATE_LIGHT, 0, STATE_ATTENUATION}, SWIZZLE_WWWW},
- {"constantAttenuation", {STATE_LIGHT, 0, STATE_ATTENUATION}, SWIZZLE_XXXX},
- {"linearAttenuation", {STATE_LIGHT, 0, STATE_ATTENUATION}, SWIZZLE_YYYY},
- {"quadraticAttenuation", {STATE_LIGHT, 0, STATE_ATTENUATION}, SWIZZLE_ZZZZ},
-};
-
-static struct gl_builtin_uniform_element gl_LightModel_elements[] = {
- {"ambient", {STATE_LIGHTMODEL_AMBIENT, 0}, SWIZZLE_XYZW},
-};
-
-static struct gl_builtin_uniform_element gl_FrontLightModelProduct_elements[] = {
- {"sceneColor", {STATE_LIGHTMODEL_SCENECOLOR, 0}, SWIZZLE_XYZW},
-};
-
-static struct gl_builtin_uniform_element gl_BackLightModelProduct_elements[] = {
- {"sceneColor", {STATE_LIGHTMODEL_SCENECOLOR, 1}, SWIZZLE_XYZW},
-};
-
-static struct gl_builtin_uniform_element gl_FrontLightProduct_elements[] = {
- {"ambient", {STATE_LIGHTPROD, 0, 0, STATE_AMBIENT}, SWIZZLE_XYZW},
- {"diffuse", {STATE_LIGHTPROD, 0, 0, STATE_DIFFUSE}, SWIZZLE_XYZW},
- {"specular", {STATE_LIGHTPROD, 0, 0, STATE_SPECULAR}, SWIZZLE_XYZW},
-};
-
-static struct gl_builtin_uniform_element gl_BackLightProduct_elements[] = {
- {"ambient", {STATE_LIGHTPROD, 0, 1, STATE_AMBIENT}, SWIZZLE_XYZW},
- {"diffuse", {STATE_LIGHTPROD, 0, 1, STATE_DIFFUSE}, SWIZZLE_XYZW},
- {"specular", {STATE_LIGHTPROD, 0, 1, STATE_SPECULAR}, SWIZZLE_XYZW},
-};
-
-static struct gl_builtin_uniform_element gl_TextureEnvColor_elements[] = {
- {NULL, {STATE_TEXENV_COLOR, 0}, SWIZZLE_XYZW},
-};
-
-static struct gl_builtin_uniform_element gl_EyePlaneS_elements[] = {
- {NULL, {STATE_TEXGEN, 0, STATE_TEXGEN_EYE_S}, SWIZZLE_XYZW},
-};
-
-static struct gl_builtin_uniform_element gl_EyePlaneT_elements[] = {
- {NULL, {STATE_TEXGEN, 0, STATE_TEXGEN_EYE_T}, SWIZZLE_XYZW},
-};
-
-static struct gl_builtin_uniform_element gl_EyePlaneR_elements[] = {
- {NULL, {STATE_TEXGEN, 0, STATE_TEXGEN_EYE_R}, SWIZZLE_XYZW},
-};
-
-static struct gl_builtin_uniform_element gl_EyePlaneQ_elements[] = {
- {NULL, {STATE_TEXGEN, 0, STATE_TEXGEN_EYE_Q}, SWIZZLE_XYZW},
-};
-
-static struct gl_builtin_uniform_element gl_ObjectPlaneS_elements[] = {
- {NULL, {STATE_TEXGEN, 0, STATE_TEXGEN_OBJECT_S}, SWIZZLE_XYZW},
-};
-
-static struct gl_builtin_uniform_element gl_ObjectPlaneT_elements[] = {
- {NULL, {STATE_TEXGEN, 0, STATE_TEXGEN_OBJECT_T}, SWIZZLE_XYZW},
-};
-
-static struct gl_builtin_uniform_element gl_ObjectPlaneR_elements[] = {
- {NULL, {STATE_TEXGEN, 0, STATE_TEXGEN_OBJECT_R}, SWIZZLE_XYZW},
-};
-
-static struct gl_builtin_uniform_element gl_ObjectPlaneQ_elements[] = {
- {NULL, {STATE_TEXGEN, 0, STATE_TEXGEN_OBJECT_Q}, SWIZZLE_XYZW},
-};
-
-static struct gl_builtin_uniform_element gl_Fog_elements[] = {
- {"color", {STATE_FOG_COLOR}, SWIZZLE_XYZW},
- {"density", {STATE_FOG_PARAMS}, SWIZZLE_XXXX},
- {"start", {STATE_FOG_PARAMS}, SWIZZLE_YYYY},
- {"end", {STATE_FOG_PARAMS}, SWIZZLE_ZZZZ},
- {"scale", {STATE_FOG_PARAMS}, SWIZZLE_WWWW},
-};
-
-static struct gl_builtin_uniform_element gl_NormalScale_elements[] = {
- {NULL, {STATE_NORMAL_SCALE}, SWIZZLE_XXXX},
-};
-
-static struct gl_builtin_uniform_element gl_MESABumpRotMatrix0_elements[] = {
- {NULL, {STATE_INTERNAL, STATE_ROT_MATRIX_0}, SWIZZLE_XYZW},
-};
-
-static struct gl_builtin_uniform_element gl_MESABumpRotMatrix1_elements[] = {
- {NULL, {STATE_INTERNAL, STATE_ROT_MATRIX_1}, SWIZZLE_XYZW},
-};
-
-static struct gl_builtin_uniform_element gl_MESAFogParamsOptimized_elements[] = {
- {NULL, {STATE_INTERNAL, STATE_FOG_PARAMS_OPTIMIZED}, SWIZZLE_XYZW},
-};
-
-#define MATRIX(name, statevar, modifier) \
- static struct gl_builtin_uniform_element name ## _elements[] = { \
- { NULL, { statevar, 0, 0, 0, modifier}, SWIZZLE_XYZW }, \
- { NULL, { statevar, 0, 1, 1, modifier}, SWIZZLE_XYZW }, \
- { NULL, { statevar, 0, 2, 2, modifier}, SWIZZLE_XYZW }, \
- { NULL, { statevar, 0, 3, 3, modifier}, SWIZZLE_XYZW }, \
- }
-
-MATRIX(gl_ModelViewMatrix,
- STATE_MODELVIEW_MATRIX, STATE_MATRIX_TRANSPOSE);
-MATRIX(gl_ModelViewMatrixInverse,
- STATE_MODELVIEW_MATRIX, STATE_MATRIX_INVTRANS);
-MATRIX(gl_ModelViewMatrixTranspose,
- STATE_MODELVIEW_MATRIX, 0);
-MATRIX(gl_ModelViewMatrixInverseTranspose,
- STATE_MODELVIEW_MATRIX, STATE_MATRIX_INVERSE);
-
-MATRIX(gl_ProjectionMatrix,
- STATE_PROJECTION_MATRIX, STATE_MATRIX_TRANSPOSE);
-MATRIX(gl_ProjectionMatrixInverse,
- STATE_PROJECTION_MATRIX, STATE_MATRIX_INVTRANS);
-MATRIX(gl_ProjectionMatrixTranspose,
- STATE_PROJECTION_MATRIX, 0);
-MATRIX(gl_ProjectionMatrixInverseTranspose,
- STATE_PROJECTION_MATRIX, STATE_MATRIX_INVERSE);
-
-MATRIX(gl_ModelViewProjectionMatrix,
- STATE_MVP_MATRIX, STATE_MATRIX_TRANSPOSE);
-MATRIX(gl_ModelViewProjectionMatrixInverse,
- STATE_MVP_MATRIX, STATE_MATRIX_INVTRANS);
-MATRIX(gl_ModelViewProjectionMatrixTranspose,
- STATE_MVP_MATRIX, 0);
-MATRIX(gl_ModelViewProjectionMatrixInverseTranspose,
- STATE_MVP_MATRIX, STATE_MATRIX_INVERSE);
-
-MATRIX(gl_TextureMatrix,
- STATE_TEXTURE_MATRIX, STATE_MATRIX_TRANSPOSE);
-MATRIX(gl_TextureMatrixInverse,
- STATE_TEXTURE_MATRIX, STATE_MATRIX_INVTRANS);
-MATRIX(gl_TextureMatrixTranspose,
- STATE_TEXTURE_MATRIX, 0);
-MATRIX(gl_TextureMatrixInverseTranspose,
- STATE_TEXTURE_MATRIX, STATE_MATRIX_INVERSE);
-
-static struct gl_builtin_uniform_element gl_NormalMatrix_elements[] = {
- { NULL, { STATE_MODELVIEW_MATRIX, 0, 0, 0, STATE_MATRIX_INVERSE},
- SWIZZLE_XYZW },
- { NULL, { STATE_MODELVIEW_MATRIX, 0, 1, 1, STATE_MATRIX_INVERSE},
- SWIZZLE_XYZW },
- { NULL, { STATE_MODELVIEW_MATRIX, 0, 2, 2, STATE_MATRIX_INVERSE},
- SWIZZLE_XYZW },
-};
-
-#undef MATRIX
-
-#define STATEVAR(name) {#name, name ## _elements, Elements(name ## _elements)}
-
-const struct gl_builtin_uniform_desc _mesa_builtin_uniform_desc[] = {
- STATEVAR(gl_DepthRange),
- STATEVAR(gl_ClipPlane),
- STATEVAR(gl_Point),
- STATEVAR(gl_FrontMaterial),
- STATEVAR(gl_BackMaterial),
- STATEVAR(gl_LightSource),
- STATEVAR(gl_LightModel),
- STATEVAR(gl_FrontLightModelProduct),
- STATEVAR(gl_BackLightModelProduct),
- STATEVAR(gl_FrontLightProduct),
- STATEVAR(gl_BackLightProduct),
- STATEVAR(gl_TextureEnvColor),
- STATEVAR(gl_EyePlaneS),
- STATEVAR(gl_EyePlaneT),
- STATEVAR(gl_EyePlaneR),
- STATEVAR(gl_EyePlaneQ),
- STATEVAR(gl_ObjectPlaneS),
- STATEVAR(gl_ObjectPlaneT),
- STATEVAR(gl_ObjectPlaneR),
- STATEVAR(gl_ObjectPlaneQ),
- STATEVAR(gl_Fog),
-
- STATEVAR(gl_ModelViewMatrix),
- STATEVAR(gl_ModelViewMatrixInverse),
- STATEVAR(gl_ModelViewMatrixTranspose),
- STATEVAR(gl_ModelViewMatrixInverseTranspose),
-
- STATEVAR(gl_ProjectionMatrix),
- STATEVAR(gl_ProjectionMatrixInverse),
- STATEVAR(gl_ProjectionMatrixTranspose),
- STATEVAR(gl_ProjectionMatrixInverseTranspose),
-
- STATEVAR(gl_ModelViewProjectionMatrix),
- STATEVAR(gl_ModelViewProjectionMatrixInverse),
- STATEVAR(gl_ModelViewProjectionMatrixTranspose),
- STATEVAR(gl_ModelViewProjectionMatrixInverseTranspose),
-
- STATEVAR(gl_TextureMatrix),
- STATEVAR(gl_TextureMatrixInverse),
- STATEVAR(gl_TextureMatrixTranspose),
- STATEVAR(gl_TextureMatrixInverseTranspose),
-
- STATEVAR(gl_NormalMatrix),
- STATEVAR(gl_NormalScale),
-
- STATEVAR(gl_MESABumpRotMatrix0),
- STATEVAR(gl_MESABumpRotMatrix1),
- STATEVAR(gl_MESAFogParamsOptimized),
-
- {NULL, NULL, 0}
-};
-
-static ir_variable *
-add_variable(exec_list *instructions, glsl_symbol_table *symtab,
- const char *name, const glsl_type *type,
- enum ir_variable_mode mode, int slot)
-{
- ir_variable *var = new(symtab) ir_variable(type, name, mode);
-
- switch (var->mode) {
- case ir_var_auto:
- case ir_var_in:
- case ir_var_const_in:
- case ir_var_uniform:
- case ir_var_system_value:
- var->read_only = true;
- break;
- case ir_var_inout:
- case ir_var_out:
- break;
- default:
- assert(0);
- break;
- }
-
- var->location = slot;
- var->explicit_location = (slot >= 0);
-
- /* Once the variable is created an initialized, add it to the symbol table
- * and add the declaration to the IR stream.
- */
- instructions->push_tail(var);
-
- symtab->add_variable(var);
- return var;
-}
-
-static ir_variable *
-add_uniform(exec_list *instructions, glsl_symbol_table *symtab,
- const char *name, const glsl_type *type)
-{
- ir_variable *const uni =
- add_variable(instructions, symtab, name, type, ir_var_uniform, -1);
-
- unsigned i;
- for (i = 0; _mesa_builtin_uniform_desc[i].name != NULL; i++) {
- if (strcmp(_mesa_builtin_uniform_desc[i].name, name) == 0) {
- break;
- }
- }
-
- assert(_mesa_builtin_uniform_desc[i].name != NULL);
- const struct gl_builtin_uniform_desc* const statevar =
- &_mesa_builtin_uniform_desc[i];
-
- const unsigned array_count = type->is_array() ? type->length : 1;
- uni->num_state_slots = array_count * statevar->num_elements;
-
- ir_state_slot *slots =
- ralloc_array(uni, ir_state_slot, uni->num_state_slots);
-
- uni->state_slots = slots;
-
- for (unsigned a = 0; a < array_count; a++) {
- for (unsigned j = 0; j < statevar->num_elements; j++) {
- struct gl_builtin_uniform_element *element = &statevar->elements[j];
-
- memcpy(slots->tokens, element->tokens, sizeof(element->tokens));
- if (type->is_array()) {
- slots->tokens[1] = a;
- }
-
- slots->swizzle = element->swizzle;
- slots++;
- }
- }
-
- return uni;
-}
-
-static void
-add_builtin_variable(exec_list *instructions, glsl_symbol_table *symtab,
- const builtin_variable *proto)
-{
- /* Create a new variable declaration from the description supplied by
- * the caller.
- */
- const glsl_type *const type = symtab->get_type(proto->type);
-
- assert(type != NULL);
-
- if (proto->mode == ir_var_uniform) {
- add_uniform(instructions, symtab, proto->name, type);
- } else {
- add_variable(instructions, symtab, proto->name, type, proto->mode,
- proto->slot);
- }
-}
-
-static void
-add_builtin_constant(exec_list *instructions, glsl_symbol_table *symtab,
- const char *name, int value)
-{
- ir_variable *const var = add_variable(instructions, symtab,
- name, glsl_type::int_type,
- ir_var_auto, -1);
- var->constant_value = new(var) ir_constant(value);
-}
-
-/* Several constants in GLSL ES have different names than normal desktop GLSL.
- * Therefore, this function should only be called on the ES path.
- */
-static void
-generate_100ES_uniforms(exec_list *instructions,
- struct _mesa_glsl_parse_state *state)
-{
- glsl_symbol_table *const symtab = state->symbols;
-
- add_builtin_constant(instructions, symtab, "gl_MaxVertexAttribs",
- state->Const.MaxVertexAttribs);
- add_builtin_constant(instructions, symtab, "gl_MaxVertexUniformVectors",
- state->Const.MaxVertexUniformComponents);
- add_builtin_constant(instructions, symtab, "gl_MaxVaryingVectors",
- state->Const.MaxVaryingFloats / 4);
- add_builtin_constant(instructions, symtab, "gl_MaxVertexTextureImageUnits",
- state->Const.MaxVertexTextureImageUnits);
- add_builtin_constant(instructions, symtab, "gl_MaxCombinedTextureImageUnits",
- state->Const.MaxCombinedTextureImageUnits);
- add_builtin_constant(instructions, symtab, "gl_MaxTextureImageUnits",
- state->Const.MaxTextureImageUnits);
- add_builtin_constant(instructions, symtab, "gl_MaxFragmentUniformVectors",
- state->Const.MaxFragmentUniformComponents);
-
- add_uniform(instructions, symtab, "gl_DepthRange",
- state->symbols->get_type("gl_DepthRangeParameters"));
-}
-
-static void
-generate_110_uniforms(exec_list *instructions,
- struct _mesa_glsl_parse_state *state)
-{
- glsl_symbol_table *const symtab = state->symbols;
-
- for (unsigned i = 0
- ; i < Elements(builtin_110_deprecated_uniforms)
- ; i++) {
- add_builtin_variable(instructions, symtab,
- & builtin_110_deprecated_uniforms[i]);
- }
-
- add_builtin_constant(instructions, symtab, "gl_MaxLights",
- state->Const.MaxLights);
- add_builtin_constant(instructions, symtab, "gl_MaxClipPlanes",
- state->Const.MaxClipPlanes);
- add_builtin_constant(instructions, symtab, "gl_MaxTextureUnits",
- state->Const.MaxTextureUnits);
- add_builtin_constant(instructions, symtab, "gl_MaxTextureCoords",
- state->Const.MaxTextureCoords);
- add_builtin_constant(instructions, symtab, "gl_MaxVertexAttribs",
- state->Const.MaxVertexAttribs);
- add_builtin_constant(instructions, symtab, "gl_MaxVertexUniformComponents",
- state->Const.MaxVertexUniformComponents);
- add_builtin_constant(instructions, symtab, "gl_MaxVaryingFloats",
- state->Const.MaxVaryingFloats);
- add_builtin_constant(instructions, symtab, "gl_MaxVertexTextureImageUnits",
- state->Const.MaxVertexTextureImageUnits);
- add_builtin_constant(instructions, symtab, "gl_MaxCombinedTextureImageUnits",
- state->Const.MaxCombinedTextureImageUnits);
- add_builtin_constant(instructions, symtab, "gl_MaxTextureImageUnits",
- state->Const.MaxTextureImageUnits);
- add_builtin_constant(instructions, symtab, "gl_MaxFragmentUniformComponents",
- state->Const.MaxFragmentUniformComponents);
-
- const glsl_type *const mat4_array_type =
- glsl_type::get_array_instance(glsl_type::mat4_type,
- state->Const.MaxTextureCoords);
-
- add_uniform(instructions, symtab, "gl_TextureMatrix", mat4_array_type);
- add_uniform(instructions, symtab, "gl_TextureMatrixInverse", mat4_array_type);
- add_uniform(instructions, symtab, "gl_TextureMatrixTranspose", mat4_array_type);
- add_uniform(instructions, symtab, "gl_TextureMatrixInverseTranspose", mat4_array_type);
-
- add_uniform(instructions, symtab, "gl_DepthRange",
- symtab->get_type("gl_DepthRangeParameters"));
-
- add_uniform(instructions, symtab, "gl_ClipPlane",
- glsl_type::get_array_instance(glsl_type::vec4_type,
- state->Const.MaxClipPlanes));
- add_uniform(instructions, symtab, "gl_Point",
- symtab->get_type("gl_PointParameters"));
-
- const glsl_type *const material_parameters_type =
- symtab->get_type("gl_MaterialParameters");
- add_uniform(instructions, symtab, "gl_FrontMaterial", material_parameters_type);
- add_uniform(instructions, symtab, "gl_BackMaterial", material_parameters_type);
-
- const glsl_type *const light_source_array_type =
- glsl_type::get_array_instance(symtab->get_type("gl_LightSourceParameters"), state->Const.MaxLights);
-
- add_uniform(instructions, symtab, "gl_LightSource", light_source_array_type);
-
- const glsl_type *const light_model_products_type =
- symtab->get_type("gl_LightModelProducts");
- add_uniform(instructions, symtab, "gl_FrontLightModelProduct",
- light_model_products_type);
- add_uniform(instructions, symtab, "gl_BackLightModelProduct",
- light_model_products_type);
-
- const glsl_type *const light_products_type =
- glsl_type::get_array_instance(symtab->get_type("gl_LightProducts"),
- state->Const.MaxLights);
- add_uniform(instructions, symtab, "gl_FrontLightProduct", light_products_type);
- add_uniform(instructions, symtab, "gl_BackLightProduct", light_products_type);
-
- add_uniform(instructions, symtab, "gl_TextureEnvColor",
- glsl_type::get_array_instance(glsl_type::vec4_type,
- state->Const.MaxTextureUnits));
-
- const glsl_type *const texcoords_vec4 =
- glsl_type::get_array_instance(glsl_type::vec4_type,
- state->Const.MaxTextureCoords);
- add_uniform(instructions, symtab, "gl_EyePlaneS", texcoords_vec4);
- add_uniform(instructions, symtab, "gl_EyePlaneT", texcoords_vec4);
- add_uniform(instructions, symtab, "gl_EyePlaneR", texcoords_vec4);
- add_uniform(instructions, symtab, "gl_EyePlaneQ", texcoords_vec4);
- add_uniform(instructions, symtab, "gl_ObjectPlaneS", texcoords_vec4);
- add_uniform(instructions, symtab, "gl_ObjectPlaneT", texcoords_vec4);
- add_uniform(instructions, symtab, "gl_ObjectPlaneR", texcoords_vec4);
- add_uniform(instructions, symtab, "gl_ObjectPlaneQ", texcoords_vec4);
-
- add_uniform(instructions, symtab, "gl_Fog",
- symtab->get_type("gl_FogParameters"));
-}
-
-/* This function should only be called for ES, not desktop GL. */
-static void
-generate_100ES_vs_variables(exec_list *instructions,
- struct _mesa_glsl_parse_state *state)
-{
- for (unsigned i = 0; i < Elements(builtin_core_vs_variables); i++) {
- add_builtin_variable(instructions, state->symbols,
- & builtin_core_vs_variables[i]);
- }
-
- generate_100ES_uniforms(instructions, state);
-
- generate_ARB_draw_buffers_variables(instructions, state, false,
- vertex_shader);
-}
-
-
-static void
-generate_110_vs_variables(exec_list *instructions,
- struct _mesa_glsl_parse_state *state)
-{
- for (unsigned i = 0; i < Elements(builtin_core_vs_variables); i++) {
- add_builtin_variable(instructions, state->symbols,
- & builtin_core_vs_variables[i]);
- }
-
- for (unsigned i = 0
- ; i < Elements(builtin_110_deprecated_vs_variables)
- ; i++) {
- add_builtin_variable(instructions, state->symbols,
- & builtin_110_deprecated_vs_variables[i]);
- }
- generate_110_uniforms(instructions, state);
-
- /* From page 54 (page 60 of the PDF) of the GLSL 1.20 spec:
- *
- * "As with all arrays, indices used to subscript gl_TexCoord must
- * either be an integral constant expressions, or this array must be
- * re-declared by the shader with a size. The size can be at most
- * gl_MaxTextureCoords. Using indexes close to 0 may aid the
- * implementation in preserving varying resources."
- */
- const glsl_type *const vec4_array_type =
- glsl_type::get_array_instance(glsl_type::vec4_type, 0);
-
- add_variable(instructions, state->symbols,
- "gl_TexCoord", vec4_array_type, ir_var_out, VERT_RESULT_TEX0);
-
- generate_ARB_draw_buffers_variables(instructions, state, false,
- vertex_shader);
-}
-
-
-static void
-generate_120_vs_variables(exec_list *instructions,
- struct _mesa_glsl_parse_state *state)
-{
- /* GLSL version 1.20 did not add any built-in variables in the vertex
- * shader.
- */
- generate_110_vs_variables(instructions, state);
-}
-
-
-static void
-generate_130_vs_variables(exec_list *instructions,
- struct _mesa_glsl_parse_state *state)
-{
- generate_120_vs_variables(instructions, state);
-
- for (unsigned i = 0; i < Elements(builtin_130_vs_variables); i++) {
- add_builtin_variable(instructions, state->symbols,
- & builtin_130_vs_variables[i]);
- }
-
- const glsl_type *const clip_distance_array_type =
- glsl_type::get_array_instance(glsl_type::float_type,
- state->Const.MaxClipPlanes);
-
- /* FINISHME: gl_ClipDistance needs a real location assigned. */
- add_variable(instructions, state->symbols,
- "gl_ClipDistance", clip_distance_array_type, ir_var_out, -1);
-
-}
-
-
-static void
-initialize_vs_variables(exec_list *instructions,
- struct _mesa_glsl_parse_state *state)
-{
-
- switch (state->language_version) {
- case 100:
- generate_100ES_vs_variables(instructions, state);
- break;
- case 110:
- generate_110_vs_variables(instructions, state);
- break;
- case 120:
- generate_120_vs_variables(instructions, state);
- break;
- case 130:
- generate_130_vs_variables(instructions, state);
- break;
- }
-
- if (state->ARB_draw_instanced_enable)
- generate_ARB_draw_instanced_variables(instructions, state, false,
- vertex_shader);
-}
-
-
-/* This function should only be called for ES, not desktop GL. */
-static void
-generate_100ES_fs_variables(exec_list *instructions,
- struct _mesa_glsl_parse_state *state)
-{
- for (unsigned i = 0; i < Elements(builtin_core_fs_variables); i++) {
- add_builtin_variable(instructions, state->symbols,
- & builtin_core_fs_variables[i]);
- }
-
- for (unsigned i = 0; i < Elements(builtin_100ES_fs_variables); i++) {
- add_builtin_variable(instructions, state->symbols,
- & builtin_100ES_fs_variables[i]);
- }
-
- generate_100ES_uniforms(instructions, state);
-
- generate_ARB_draw_buffers_variables(instructions, state, false,
- fragment_shader);
-}
-
-static void
-generate_110_fs_variables(exec_list *instructions,
- struct _mesa_glsl_parse_state *state)
-{
- for (unsigned i = 0; i < Elements(builtin_core_fs_variables); i++) {
- add_builtin_variable(instructions, state->symbols,
- & builtin_core_fs_variables[i]);
- }
-
- for (unsigned i = 0; i < Elements(builtin_110_fs_variables); i++) {
- add_builtin_variable(instructions, state->symbols,
- & builtin_110_fs_variables[i]);
- }
-
- for (unsigned i = 0
- ; i < Elements(builtin_110_deprecated_fs_variables)
- ; i++) {
- add_builtin_variable(instructions, state->symbols,
- & builtin_110_deprecated_fs_variables[i]);
- }
- generate_110_uniforms(instructions, state);
-
- /* From page 54 (page 60 of the PDF) of the GLSL 1.20 spec:
- *
- * "As with all arrays, indices used to subscript gl_TexCoord must
- * either be an integral constant expressions, or this array must be
- * re-declared by the shader with a size. The size can be at most
- * gl_MaxTextureCoords. Using indexes close to 0 may aid the
- * implementation in preserving varying resources."
- */
- const glsl_type *const vec4_array_type =
- glsl_type::get_array_instance(glsl_type::vec4_type, 0);
-
- add_variable(instructions, state->symbols,
- "gl_TexCoord", vec4_array_type, ir_var_in, FRAG_ATTRIB_TEX0);
-
- generate_ARB_draw_buffers_variables(instructions, state, false,
- fragment_shader);
-}
-
-
-static void
-generate_ARB_draw_buffers_variables(exec_list *instructions,
- struct _mesa_glsl_parse_state *state,
- bool warn, _mesa_glsl_parser_targets target)
-{
- /* gl_MaxDrawBuffers is available in all shader stages.
- */
- ir_variable *const mdb =
- add_variable(instructions, state->symbols,
- "gl_MaxDrawBuffers", glsl_type::int_type, ir_var_auto, -1);
-
- if (warn)
- mdb->warn_extension = "GL_ARB_draw_buffers";
-
- mdb->constant_value = new(mdb)
- ir_constant(int(state->Const.MaxDrawBuffers));
-
-
- /* gl_FragData is only available in the fragment shader.
- */
- if (target == fragment_shader) {
- const glsl_type *const vec4_array_type =
- glsl_type::get_array_instance(glsl_type::vec4_type,
- state->Const.MaxDrawBuffers);
-
- ir_variable *const fd =
- add_variable(instructions, state->symbols,
- "gl_FragData", vec4_array_type,
- ir_var_out, FRAG_RESULT_DATA0);
-
- if (warn)
- fd->warn_extension = "GL_ARB_draw_buffers";
- }
-}
-
-
-static void
-generate_ARB_draw_instanced_variables(exec_list *instructions,
- struct _mesa_glsl_parse_state *state,
- bool warn,
- _mesa_glsl_parser_targets target)
-{
- /* gl_InstanceIDARB is only available in the vertex shader.
- */
- if (target == vertex_shader) {
- ir_variable *const inst =
- add_variable(instructions, state->symbols,
- "gl_InstanceIDARB", glsl_type::int_type,
- ir_var_system_value, SYSTEM_VALUE_INSTANCE_ID);
-
- if (warn)
- inst->warn_extension = "GL_ARB_draw_instanced";
- }
-}
-
-
-static void
-generate_ARB_shader_stencil_export_variables(exec_list *instructions,
- struct _mesa_glsl_parse_state *state,
- bool warn)
-{
- /* gl_FragStencilRefARB is only available in the fragment shader.
- */
- ir_variable *const fd =
- add_variable(instructions, state->symbols,
- "gl_FragStencilRefARB", glsl_type::int_type,
- ir_var_out, FRAG_RESULT_STENCIL);
-
- if (warn)
- fd->warn_extension = "GL_ARB_shader_stencil_export";
-}
-
-static void
-generate_AMD_shader_stencil_export_variables(exec_list *instructions,
- struct _mesa_glsl_parse_state *state,
- bool warn)
-{
- /* gl_FragStencilRefAMD is only available in the fragment shader.
- */
- ir_variable *const fd =
- add_variable(instructions, state->symbols,
- "gl_FragStencilRefAMD", glsl_type::int_type,
- ir_var_out, FRAG_RESULT_STENCIL);
-
- if (warn)
- fd->warn_extension = "GL_AMD_shader_stencil_export";
-}
-
-static void
-generate_120_fs_variables(exec_list *instructions,
- struct _mesa_glsl_parse_state *state)
-{
- generate_110_fs_variables(instructions, state);
-
- for (unsigned i = 0
- ; i < Elements(builtin_120_fs_variables)
- ; i++) {
- add_builtin_variable(instructions, state->symbols,
- & builtin_120_fs_variables[i]);
- }
-}
-
-static void
-generate_130_fs_variables(exec_list *instructions,
- struct _mesa_glsl_parse_state *state)
-{
- generate_120_fs_variables(instructions, state);
-
- const glsl_type *const clip_distance_array_type =
- glsl_type::get_array_instance(glsl_type::float_type,
- state->Const.MaxClipPlanes);
-
- /* FINISHME: gl_ClipDistance needs a real location assigned. */
- add_variable(instructions, state->symbols,
- "gl_ClipDistance", clip_distance_array_type, ir_var_in, -1);
-}
-
-static void
-initialize_fs_variables(exec_list *instructions,
- struct _mesa_glsl_parse_state *state)
-{
-
- switch (state->language_version) {
- case 100:
- generate_100ES_fs_variables(instructions, state);
- break;
- case 110:
- generate_110_fs_variables(instructions, state);
- break;
- case 120:
- generate_120_fs_variables(instructions, state);
- break;
- case 130:
- generate_130_fs_variables(instructions, state);
- break;
- }
-
- if (state->ARB_shader_stencil_export_enable)
- generate_ARB_shader_stencil_export_variables(instructions, state,
- state->ARB_shader_stencil_export_warn);
-
- if (state->AMD_shader_stencil_export_enable)
- generate_AMD_shader_stencil_export_variables(instructions, state,
- state->AMD_shader_stencil_export_warn);
-}
-
-void
-_mesa_glsl_initialize_variables(exec_list *instructions,
- struct _mesa_glsl_parse_state *state)
-{
- switch (state->target) {
- case vertex_shader:
- initialize_vs_variables(instructions, state);
- break;
- case geometry_shader:
- break;
- case fragment_shader:
- initialize_fs_variables(instructions, state);
- break;
- }
-}
+/*
+ * Copyright © 2010 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+#include "ir.h"
+#include "glsl_parser_extras.h"
+#include "glsl_symbol_table.h"
+#include "builtin_variables.h"
+#include "main/uniforms.h"
+#include "program/prog_parameter.h"
+#include "program/prog_statevars.h"
+#include "program/prog_instruction.h"
+
+static void generate_ARB_draw_buffers_variables(exec_list *,
+ struct _mesa_glsl_parse_state *,
+ bool, _mesa_glsl_parser_targets);
+
+static void
+generate_ARB_draw_instanced_variables(exec_list *,
+ struct _mesa_glsl_parse_state *,
+ bool, _mesa_glsl_parser_targets);
+
+static struct gl_builtin_uniform_element gl_DepthRange_elements[] = {
+ {"near", {STATE_DEPTH_RANGE, 0, 0}, SWIZZLE_XXXX},
+ {"far", {STATE_DEPTH_RANGE, 0, 0}, SWIZZLE_YYYY},
+ {"diff", {STATE_DEPTH_RANGE, 0, 0}, SWIZZLE_ZZZZ},
+};
+
+static struct gl_builtin_uniform_element gl_ClipPlane_elements[] = {
+ {NULL, {STATE_CLIPPLANE, 0, 0}, SWIZZLE_XYZW}
+};
+
+static struct gl_builtin_uniform_element gl_Point_elements[] = {
+ {"size", {STATE_POINT_SIZE}, SWIZZLE_XXXX},
+ {"sizeMin", {STATE_POINT_SIZE}, SWIZZLE_YYYY},
+ {"sizeMax", {STATE_POINT_SIZE}, SWIZZLE_ZZZZ},
+ {"fadeThresholdSize", {STATE_POINT_SIZE}, SWIZZLE_WWWW},
+ {"distanceConstantAttenuation", {STATE_POINT_ATTENUATION}, SWIZZLE_XXXX},
+ {"distanceLinearAttenuation", {STATE_POINT_ATTENUATION}, SWIZZLE_YYYY},
+ {"distanceQuadraticAttenuation", {STATE_POINT_ATTENUATION}, SWIZZLE_ZZZZ},
+};
+
+static struct gl_builtin_uniform_element gl_FrontMaterial_elements[] = {
+ {"emission", {STATE_MATERIAL, 0, STATE_EMISSION}, SWIZZLE_XYZW},
+ {"ambient", {STATE_MATERIAL, 0, STATE_AMBIENT}, SWIZZLE_XYZW},
+ {"diffuse", {STATE_MATERIAL, 0, STATE_DIFFUSE}, SWIZZLE_XYZW},
+ {"specular", {STATE_MATERIAL, 0, STATE_SPECULAR}, SWIZZLE_XYZW},
+ {"shininess", {STATE_MATERIAL, 0, STATE_SHININESS}, SWIZZLE_XXXX},
+};
+
+static struct gl_builtin_uniform_element gl_BackMaterial_elements[] = {
+ {"emission", {STATE_MATERIAL, 1, STATE_EMISSION}, SWIZZLE_XYZW},
+ {"ambient", {STATE_MATERIAL, 1, STATE_AMBIENT}, SWIZZLE_XYZW},
+ {"diffuse", {STATE_MATERIAL, 1, STATE_DIFFUSE}, SWIZZLE_XYZW},
+ {"specular", {STATE_MATERIAL, 1, STATE_SPECULAR}, SWIZZLE_XYZW},
+ {"shininess", {STATE_MATERIAL, 1, STATE_SHININESS}, SWIZZLE_XXXX},
+};
+
+static struct gl_builtin_uniform_element gl_LightSource_elements[] = {
+ {"ambient", {STATE_LIGHT, 0, STATE_AMBIENT}, SWIZZLE_XYZW},
+ {"diffuse", {STATE_LIGHT, 0, STATE_DIFFUSE}, SWIZZLE_XYZW},
+ {"specular", {STATE_LIGHT, 0, STATE_SPECULAR}, SWIZZLE_XYZW},
+ {"position", {STATE_LIGHT, 0, STATE_POSITION}, SWIZZLE_XYZW},
+ {"halfVector", {STATE_LIGHT, 0, STATE_HALF_VECTOR}, SWIZZLE_XYZW},
+ {"spotDirection", {STATE_LIGHT, 0, STATE_SPOT_DIRECTION},
+ MAKE_SWIZZLE4(SWIZZLE_X,
+ SWIZZLE_Y,
+ SWIZZLE_Z,
+ SWIZZLE_Z)},
+ {"spotCosCutoff", {STATE_LIGHT, 0, STATE_SPOT_DIRECTION}, SWIZZLE_WWWW},
+ {"spotCutoff", {STATE_LIGHT, 0, STATE_SPOT_CUTOFF}, SWIZZLE_XXXX},
+ {"spotExponent", {STATE_LIGHT, 0, STATE_ATTENUATION}, SWIZZLE_WWWW},
+ {"constantAttenuation", {STATE_LIGHT, 0, STATE_ATTENUATION}, SWIZZLE_XXXX},
+ {"linearAttenuation", {STATE_LIGHT, 0, STATE_ATTENUATION}, SWIZZLE_YYYY},
+ {"quadraticAttenuation", {STATE_LIGHT, 0, STATE_ATTENUATION}, SWIZZLE_ZZZZ},
+};
+
+static struct gl_builtin_uniform_element gl_LightModel_elements[] = {
+ {"ambient", {STATE_LIGHTMODEL_AMBIENT, 0}, SWIZZLE_XYZW},
+};
+
+static struct gl_builtin_uniform_element gl_FrontLightModelProduct_elements[] = {
+ {"sceneColor", {STATE_LIGHTMODEL_SCENECOLOR, 0}, SWIZZLE_XYZW},
+};
+
+static struct gl_builtin_uniform_element gl_BackLightModelProduct_elements[] = {
+ {"sceneColor", {STATE_LIGHTMODEL_SCENECOLOR, 1}, SWIZZLE_XYZW},
+};
+
+static struct gl_builtin_uniform_element gl_FrontLightProduct_elements[] = {
+ {"ambient", {STATE_LIGHTPROD, 0, 0, STATE_AMBIENT}, SWIZZLE_XYZW},
+ {"diffuse", {STATE_LIGHTPROD, 0, 0, STATE_DIFFUSE}, SWIZZLE_XYZW},
+ {"specular", {STATE_LIGHTPROD, 0, 0, STATE_SPECULAR}, SWIZZLE_XYZW},
+};
+
+static struct gl_builtin_uniform_element gl_BackLightProduct_elements[] = {
+ {"ambient", {STATE_LIGHTPROD, 0, 1, STATE_AMBIENT}, SWIZZLE_XYZW},
+ {"diffuse", {STATE_LIGHTPROD, 0, 1, STATE_DIFFUSE}, SWIZZLE_XYZW},
+ {"specular", {STATE_LIGHTPROD, 0, 1, STATE_SPECULAR}, SWIZZLE_XYZW},
+};
+
+static struct gl_builtin_uniform_element gl_TextureEnvColor_elements[] = {
+ {NULL, {STATE_TEXENV_COLOR, 0}, SWIZZLE_XYZW},
+};
+
+static struct gl_builtin_uniform_element gl_EyePlaneS_elements[] = {
+ {NULL, {STATE_TEXGEN, 0, STATE_TEXGEN_EYE_S}, SWIZZLE_XYZW},
+};
+
+static struct gl_builtin_uniform_element gl_EyePlaneT_elements[] = {
+ {NULL, {STATE_TEXGEN, 0, STATE_TEXGEN_EYE_T}, SWIZZLE_XYZW},
+};
+
+static struct gl_builtin_uniform_element gl_EyePlaneR_elements[] = {
+ {NULL, {STATE_TEXGEN, 0, STATE_TEXGEN_EYE_R}, SWIZZLE_XYZW},
+};
+
+static struct gl_builtin_uniform_element gl_EyePlaneQ_elements[] = {
+ {NULL, {STATE_TEXGEN, 0, STATE_TEXGEN_EYE_Q}, SWIZZLE_XYZW},
+};
+
+static struct gl_builtin_uniform_element gl_ObjectPlaneS_elements[] = {
+ {NULL, {STATE_TEXGEN, 0, STATE_TEXGEN_OBJECT_S}, SWIZZLE_XYZW},
+};
+
+static struct gl_builtin_uniform_element gl_ObjectPlaneT_elements[] = {
+ {NULL, {STATE_TEXGEN, 0, STATE_TEXGEN_OBJECT_T}, SWIZZLE_XYZW},
+};
+
+static struct gl_builtin_uniform_element gl_ObjectPlaneR_elements[] = {
+ {NULL, {STATE_TEXGEN, 0, STATE_TEXGEN_OBJECT_R}, SWIZZLE_XYZW},
+};
+
+static struct gl_builtin_uniform_element gl_ObjectPlaneQ_elements[] = {
+ {NULL, {STATE_TEXGEN, 0, STATE_TEXGEN_OBJECT_Q}, SWIZZLE_XYZW},
+};
+
+static struct gl_builtin_uniform_element gl_Fog_elements[] = {
+ {"color", {STATE_FOG_COLOR}, SWIZZLE_XYZW},
+ {"density", {STATE_FOG_PARAMS}, SWIZZLE_XXXX},
+ {"start", {STATE_FOG_PARAMS}, SWIZZLE_YYYY},
+ {"end", {STATE_FOG_PARAMS}, SWIZZLE_ZZZZ},
+ {"scale", {STATE_FOG_PARAMS}, SWIZZLE_WWWW},
+};
+
+static struct gl_builtin_uniform_element gl_NormalScale_elements[] = {
+ {NULL, {STATE_NORMAL_SCALE}, SWIZZLE_XXXX},
+};
+
+static struct gl_builtin_uniform_element gl_MESABumpRotMatrix0_elements[] = {
+ {NULL, {STATE_INTERNAL, STATE_ROT_MATRIX_0}, SWIZZLE_XYZW},
+};
+
+static struct gl_builtin_uniform_element gl_MESABumpRotMatrix1_elements[] = {
+ {NULL, {STATE_INTERNAL, STATE_ROT_MATRIX_1}, SWIZZLE_XYZW},
+};
+
+static struct gl_builtin_uniform_element gl_MESAFogParamsOptimized_elements[] = {
+ {NULL, {STATE_INTERNAL, STATE_FOG_PARAMS_OPTIMIZED}, SWIZZLE_XYZW},
+};
+
+#define MATRIX(name, statevar, modifier) \
+ static struct gl_builtin_uniform_element name ## _elements[] = { \
+ { NULL, { statevar, 0, 0, 0, modifier}, SWIZZLE_XYZW }, \
+ { NULL, { statevar, 0, 1, 1, modifier}, SWIZZLE_XYZW }, \
+ { NULL, { statevar, 0, 2, 2, modifier}, SWIZZLE_XYZW }, \
+ { NULL, { statevar, 0, 3, 3, modifier}, SWIZZLE_XYZW }, \
+ }
+
+MATRIX(gl_ModelViewMatrix,
+ STATE_MODELVIEW_MATRIX, STATE_MATRIX_TRANSPOSE);
+MATRIX(gl_ModelViewMatrixInverse,
+ STATE_MODELVIEW_MATRIX, STATE_MATRIX_INVTRANS);
+MATRIX(gl_ModelViewMatrixTranspose,
+ STATE_MODELVIEW_MATRIX, 0);
+MATRIX(gl_ModelViewMatrixInverseTranspose,
+ STATE_MODELVIEW_MATRIX, STATE_MATRIX_INVERSE);
+
+MATRIX(gl_ProjectionMatrix,
+ STATE_PROJECTION_MATRIX, STATE_MATRIX_TRANSPOSE);
+MATRIX(gl_ProjectionMatrixInverse,
+ STATE_PROJECTION_MATRIX, STATE_MATRIX_INVTRANS);
+MATRIX(gl_ProjectionMatrixTranspose,
+ STATE_PROJECTION_MATRIX, 0);
+MATRIX(gl_ProjectionMatrixInverseTranspose,
+ STATE_PROJECTION_MATRIX, STATE_MATRIX_INVERSE);
+
+MATRIX(gl_ModelViewProjectionMatrix,
+ STATE_MVP_MATRIX, STATE_MATRIX_TRANSPOSE);
+MATRIX(gl_ModelViewProjectionMatrixInverse,
+ STATE_MVP_MATRIX, STATE_MATRIX_INVTRANS);
+MATRIX(gl_ModelViewProjectionMatrixTranspose,
+ STATE_MVP_MATRIX, 0);
+MATRIX(gl_ModelViewProjectionMatrixInverseTranspose,
+ STATE_MVP_MATRIX, STATE_MATRIX_INVERSE);
+
+MATRIX(gl_TextureMatrix,
+ STATE_TEXTURE_MATRIX, STATE_MATRIX_TRANSPOSE);
+MATRIX(gl_TextureMatrixInverse,
+ STATE_TEXTURE_MATRIX, STATE_MATRIX_INVTRANS);
+MATRIX(gl_TextureMatrixTranspose,
+ STATE_TEXTURE_MATRIX, 0);
+MATRIX(gl_TextureMatrixInverseTranspose,
+ STATE_TEXTURE_MATRIX, STATE_MATRIX_INVERSE);
+
+static struct gl_builtin_uniform_element gl_NormalMatrix_elements[] = {
+ { NULL, { STATE_MODELVIEW_MATRIX, 0, 0, 0, STATE_MATRIX_INVERSE},
+ SWIZZLE_XYZW },
+ { NULL, { STATE_MODELVIEW_MATRIX, 0, 1, 1, STATE_MATRIX_INVERSE},
+ SWIZZLE_XYZW },
+ { NULL, { STATE_MODELVIEW_MATRIX, 0, 2, 2, STATE_MATRIX_INVERSE},
+ SWIZZLE_XYZW },
+};
+
+#undef MATRIX
+
+#define STATEVAR(name) {#name, name ## _elements, Elements(name ## _elements)}
+
+const struct gl_builtin_uniform_desc _mesa_builtin_uniform_desc[] = {
+ STATEVAR(gl_DepthRange),
+ STATEVAR(gl_ClipPlane),
+ STATEVAR(gl_Point),
+ STATEVAR(gl_FrontMaterial),
+ STATEVAR(gl_BackMaterial),
+ STATEVAR(gl_LightSource),
+ STATEVAR(gl_LightModel),
+ STATEVAR(gl_FrontLightModelProduct),
+ STATEVAR(gl_BackLightModelProduct),
+ STATEVAR(gl_FrontLightProduct),
+ STATEVAR(gl_BackLightProduct),
+ STATEVAR(gl_TextureEnvColor),
+ STATEVAR(gl_EyePlaneS),
+ STATEVAR(gl_EyePlaneT),
+ STATEVAR(gl_EyePlaneR),
+ STATEVAR(gl_EyePlaneQ),
+ STATEVAR(gl_ObjectPlaneS),
+ STATEVAR(gl_ObjectPlaneT),
+ STATEVAR(gl_ObjectPlaneR),
+ STATEVAR(gl_ObjectPlaneQ),
+ STATEVAR(gl_Fog),
+
+ STATEVAR(gl_ModelViewMatrix),
+ STATEVAR(gl_ModelViewMatrixInverse),
+ STATEVAR(gl_ModelViewMatrixTranspose),
+ STATEVAR(gl_ModelViewMatrixInverseTranspose),
+
+ STATEVAR(gl_ProjectionMatrix),
+ STATEVAR(gl_ProjectionMatrixInverse),
+ STATEVAR(gl_ProjectionMatrixTranspose),
+ STATEVAR(gl_ProjectionMatrixInverseTranspose),
+
+ STATEVAR(gl_ModelViewProjectionMatrix),
+ STATEVAR(gl_ModelViewProjectionMatrixInverse),
+ STATEVAR(gl_ModelViewProjectionMatrixTranspose),
+ STATEVAR(gl_ModelViewProjectionMatrixInverseTranspose),
+
+ STATEVAR(gl_TextureMatrix),
+ STATEVAR(gl_TextureMatrixInverse),
+ STATEVAR(gl_TextureMatrixTranspose),
+ STATEVAR(gl_TextureMatrixInverseTranspose),
+
+ STATEVAR(gl_NormalMatrix),
+ STATEVAR(gl_NormalScale),
+
+ STATEVAR(gl_MESABumpRotMatrix0),
+ STATEVAR(gl_MESABumpRotMatrix1),
+ STATEVAR(gl_MESAFogParamsOptimized),
+
+ {NULL, NULL, 0}
+};
+
+static ir_variable *
+add_variable(exec_list *instructions, glsl_symbol_table *symtab,
+ const char *name, const glsl_type *type,
+ enum ir_variable_mode mode, int slot)
+{
+ ir_variable *var = new(symtab) ir_variable(type, name, mode);
+
+ switch (var->mode) {
+ case ir_var_auto:
+ case ir_var_in:
+ case ir_var_const_in:
+ case ir_var_uniform:
+ case ir_var_system_value:
+ var->read_only = true;
+ break;
+ case ir_var_inout:
+ case ir_var_out:
+ break;
+ default:
+ assert(0);
+ break;
+ }
+
+ var->location = slot;
+ var->explicit_location = (slot >= 0);
+
+ /* Once the variable is created an initialized, add it to the symbol table
+ * and add the declaration to the IR stream.
+ */
+ instructions->push_tail(var);
+
+ symtab->add_variable(var);
+ return var;
+}
+
+static ir_variable *
+add_uniform(exec_list *instructions, glsl_symbol_table *symtab,
+ const char *name, const glsl_type *type)
+{
+ ir_variable *const uni =
+ add_variable(instructions, symtab, name, type, ir_var_uniform, -1);
+
+ unsigned i;
+ for (i = 0; _mesa_builtin_uniform_desc[i].name != NULL; i++) {
+ if (strcmp(_mesa_builtin_uniform_desc[i].name, name) == 0) {
+ break;
+ }
+ }
+
+ assert(_mesa_builtin_uniform_desc[i].name != NULL);
+ const struct gl_builtin_uniform_desc* const statevar =
+ &_mesa_builtin_uniform_desc[i];
+
+ const unsigned array_count = type->is_array() ? type->length : 1;
+ uni->num_state_slots = array_count * statevar->num_elements;
+
+ ir_state_slot *slots =
+ ralloc_array(uni, ir_state_slot, uni->num_state_slots);
+
+ uni->state_slots = slots;
+
+ for (unsigned a = 0; a < array_count; a++) {
+ for (unsigned j = 0; j < statevar->num_elements; j++) {
+ struct gl_builtin_uniform_element *element = &statevar->elements[j];
+
+ memcpy(slots->tokens, element->tokens, sizeof(element->tokens));
+ if (type->is_array()) {
+ slots->tokens[1] = a;
+ }
+
+ slots->swizzle = element->swizzle;
+ slots++;
+ }
+ }
+
+ return uni;
+}
+
+static void
+add_builtin_variable(exec_list *instructions, glsl_symbol_table *symtab,
+ const builtin_variable *proto)
+{
+ /* Create a new variable declaration from the description supplied by
+ * the caller.
+ */
+ const glsl_type *const type = symtab->get_type(proto->type);
+
+ assert(type != NULL);
+
+ if (proto->mode == ir_var_uniform) {
+ add_uniform(instructions, symtab, proto->name, type);
+ } else {
+ add_variable(instructions, symtab, proto->name, type, proto->mode,
+ proto->slot);
+ }
+}
+
+static void
+add_builtin_constant(exec_list *instructions, glsl_symbol_table *symtab,
+ const char *name, int value)
+{
+ ir_variable *const var = add_variable(instructions, symtab,
+ name, glsl_type::int_type,
+ ir_var_auto, -1);
+ var->constant_value = new(var) ir_constant(value);
+}
+
+/* Several constants in GLSL ES have different names than normal desktop GLSL.
+ * Therefore, this function should only be called on the ES path.
+ */
+static void
+generate_100ES_uniforms(exec_list *instructions,
+ struct _mesa_glsl_parse_state *state)
+{
+ glsl_symbol_table *const symtab = state->symbols;
+
+ add_builtin_constant(instructions, symtab, "gl_MaxVertexAttribs",
+ state->Const.MaxVertexAttribs);
+ add_builtin_constant(instructions, symtab, "gl_MaxVertexUniformVectors",
+ state->Const.MaxVertexUniformComponents);
+ add_builtin_constant(instructions, symtab, "gl_MaxVaryingVectors",
+ state->Const.MaxVaryingFloats / 4);
+ add_builtin_constant(instructions, symtab, "gl_MaxVertexTextureImageUnits",
+ state->Const.MaxVertexTextureImageUnits);
+ add_builtin_constant(instructions, symtab, "gl_MaxCombinedTextureImageUnits",
+ state->Const.MaxCombinedTextureImageUnits);
+ add_builtin_constant(instructions, symtab, "gl_MaxTextureImageUnits",
+ state->Const.MaxTextureImageUnits);
+ add_builtin_constant(instructions, symtab, "gl_MaxFragmentUniformVectors",
+ state->Const.MaxFragmentUniformComponents);
+
+ add_uniform(instructions, symtab, "gl_DepthRange",
+ state->symbols->get_type("gl_DepthRangeParameters"));
+}
+
+static void
+generate_110_uniforms(exec_list *instructions,
+ struct _mesa_glsl_parse_state *state)
+{
+ glsl_symbol_table *const symtab = state->symbols;
+
+ for (unsigned i = 0
+ ; i < Elements(builtin_110_deprecated_uniforms)
+ ; i++) {
+ add_builtin_variable(instructions, symtab,
+ & builtin_110_deprecated_uniforms[i]);
+ }
+
+ add_builtin_constant(instructions, symtab, "gl_MaxLights",
+ state->Const.MaxLights);
+ add_builtin_constant(instructions, symtab, "gl_MaxClipPlanes",
+ state->Const.MaxClipPlanes);
+ add_builtin_constant(instructions, symtab, "gl_MaxTextureUnits",
+ state->Const.MaxTextureUnits);
+ add_builtin_constant(instructions, symtab, "gl_MaxTextureCoords",
+ state->Const.MaxTextureCoords);
+ add_builtin_constant(instructions, symtab, "gl_MaxVertexAttribs",
+ state->Const.MaxVertexAttribs);
+ add_builtin_constant(instructions, symtab, "gl_MaxVertexUniformComponents",
+ state->Const.MaxVertexUniformComponents);
+ add_builtin_constant(instructions, symtab, "gl_MaxVaryingFloats",
+ state->Const.MaxVaryingFloats);
+ add_builtin_constant(instructions, symtab, "gl_MaxVertexTextureImageUnits",
+ state->Const.MaxVertexTextureImageUnits);
+ add_builtin_constant(instructions, symtab, "gl_MaxCombinedTextureImageUnits",
+ state->Const.MaxCombinedTextureImageUnits);
+ add_builtin_constant(instructions, symtab, "gl_MaxTextureImageUnits",
+ state->Const.MaxTextureImageUnits);
+ add_builtin_constant(instructions, symtab, "gl_MaxFragmentUniformComponents",
+ state->Const.MaxFragmentUniformComponents);
+
+ const glsl_type *const mat4_array_type =
+ glsl_type::get_array_instance(glsl_type::mat4_type,
+ state->Const.MaxTextureCoords);
+
+ add_uniform(instructions, symtab, "gl_TextureMatrix", mat4_array_type);
+ add_uniform(instructions, symtab, "gl_TextureMatrixInverse", mat4_array_type);
+ add_uniform(instructions, symtab, "gl_TextureMatrixTranspose", mat4_array_type);
+ add_uniform(instructions, symtab, "gl_TextureMatrixInverseTranspose", mat4_array_type);
+
+ add_uniform(instructions, symtab, "gl_DepthRange",
+ symtab->get_type("gl_DepthRangeParameters"));
+
+ add_uniform(instructions, symtab, "gl_ClipPlane",
+ glsl_type::get_array_instance(glsl_type::vec4_type,
+ state->Const.MaxClipPlanes));
+ add_uniform(instructions, symtab, "gl_Point",
+ symtab->get_type("gl_PointParameters"));
+
+ const glsl_type *const material_parameters_type =
+ symtab->get_type("gl_MaterialParameters");
+ add_uniform(instructions, symtab, "gl_FrontMaterial", material_parameters_type);
+ add_uniform(instructions, symtab, "gl_BackMaterial", material_parameters_type);
+
+ const glsl_type *const light_source_array_type =
+ glsl_type::get_array_instance(symtab->get_type("gl_LightSourceParameters"), state->Const.MaxLights);
+
+ add_uniform(instructions, symtab, "gl_LightSource", light_source_array_type);
+
+ const glsl_type *const light_model_products_type =
+ symtab->get_type("gl_LightModelProducts");
+ add_uniform(instructions, symtab, "gl_FrontLightModelProduct",
+ light_model_products_type);
+ add_uniform(instructions, symtab, "gl_BackLightModelProduct",
+ light_model_products_type);
+
+ const glsl_type *const light_products_type =
+ glsl_type::get_array_instance(symtab->get_type("gl_LightProducts"),
+ state->Const.MaxLights);
+ add_uniform(instructions, symtab, "gl_FrontLightProduct", light_products_type);
+ add_uniform(instructions, symtab, "gl_BackLightProduct", light_products_type);
+
+ add_uniform(instructions, symtab, "gl_TextureEnvColor",
+ glsl_type::get_array_instance(glsl_type::vec4_type,
+ state->Const.MaxTextureUnits));
+
+ const glsl_type *const texcoords_vec4 =
+ glsl_type::get_array_instance(glsl_type::vec4_type,
+ state->Const.MaxTextureCoords);
+ add_uniform(instructions, symtab, "gl_EyePlaneS", texcoords_vec4);
+ add_uniform(instructions, symtab, "gl_EyePlaneT", texcoords_vec4);
+ add_uniform(instructions, symtab, "gl_EyePlaneR", texcoords_vec4);
+ add_uniform(instructions, symtab, "gl_EyePlaneQ", texcoords_vec4);
+ add_uniform(instructions, symtab, "gl_ObjectPlaneS", texcoords_vec4);
+ add_uniform(instructions, symtab, "gl_ObjectPlaneT", texcoords_vec4);
+ add_uniform(instructions, symtab, "gl_ObjectPlaneR", texcoords_vec4);
+ add_uniform(instructions, symtab, "gl_ObjectPlaneQ", texcoords_vec4);
+
+ add_uniform(instructions, symtab, "gl_Fog",
+ symtab->get_type("gl_FogParameters"));
+}
+
+/* This function should only be called for ES, not desktop GL. */
+static void
+generate_100ES_vs_variables(exec_list *instructions,
+ struct _mesa_glsl_parse_state *state)
+{
+ for (unsigned i = 0; i < Elements(builtin_core_vs_variables); i++) {
+ add_builtin_variable(instructions, state->symbols,
+ & builtin_core_vs_variables[i]);
+ }
+
+ generate_100ES_uniforms(instructions, state);
+
+ generate_ARB_draw_buffers_variables(instructions, state, false,
+ vertex_shader);
+}
+
+
+static void
+generate_110_vs_variables(exec_list *instructions,
+ struct _mesa_glsl_parse_state *state)
+{
+ for (unsigned i = 0; i < Elements(builtin_core_vs_variables); i++) {
+ add_builtin_variable(instructions, state->symbols,
+ & builtin_core_vs_variables[i]);
+ }
+
+ for (unsigned i = 0
+ ; i < Elements(builtin_110_deprecated_vs_variables)
+ ; i++) {
+ add_builtin_variable(instructions, state->symbols,
+ & builtin_110_deprecated_vs_variables[i]);
+ }
+ generate_110_uniforms(instructions, state);
+
+ /* From page 54 (page 60 of the PDF) of the GLSL 1.20 spec:
+ *
+ * "As with all arrays, indices used to subscript gl_TexCoord must
+ * either be an integral constant expressions, or this array must be
+ * re-declared by the shader with a size. The size can be at most
+ * gl_MaxTextureCoords. Using indexes close to 0 may aid the
+ * implementation in preserving varying resources."
+ */
+ const glsl_type *const vec4_array_type =
+ glsl_type::get_array_instance(glsl_type::vec4_type, 0);
+
+ add_variable(instructions, state->symbols,
+ "gl_TexCoord", vec4_array_type, ir_var_out, VERT_RESULT_TEX0);
+
+ generate_ARB_draw_buffers_variables(instructions, state, false,
+ vertex_shader);
+}
+
+
+static void
+generate_120_vs_variables(exec_list *instructions,
+ struct _mesa_glsl_parse_state *state)
+{
+ /* GLSL version 1.20 did not add any built-in variables in the vertex
+ * shader.
+ */
+ generate_110_vs_variables(instructions, state);
+}
+
+
+static void
+generate_130_vs_variables(exec_list *instructions,
+ struct _mesa_glsl_parse_state *state)
+{
+ generate_120_vs_variables(instructions, state);
+
+ for (unsigned i = 0; i < Elements(builtin_130_vs_variables); i++) {
+ add_builtin_variable(instructions, state->symbols,
+ & builtin_130_vs_variables[i]);
+ }
+
+ const glsl_type *const clip_distance_array_type =
+ glsl_type::get_array_instance(glsl_type::float_type,
+ state->Const.MaxClipPlanes);
+
+ /* FINISHME: gl_ClipDistance needs a real location assigned. */
+ add_variable(instructions, state->symbols,
+ "gl_ClipDistance", clip_distance_array_type, ir_var_out, -1);
+
+}
+
+
+static void
+initialize_vs_variables(exec_list *instructions,
+ struct _mesa_glsl_parse_state *state)
+{
+
+ switch (state->language_version) {
+ case 100:
+ generate_100ES_vs_variables(instructions, state);
+ break;
+ case 110:
+ generate_110_vs_variables(instructions, state);
+ break;
+ case 120:
+ generate_120_vs_variables(instructions, state);
+ break;
+ case 130:
+ generate_130_vs_variables(instructions, state);
+ break;
+ }
+
+ if (state->ARB_draw_instanced_enable)
+ generate_ARB_draw_instanced_variables(instructions, state, false,
+ vertex_shader);
+}
+
+
+/* This function should only be called for ES, not desktop GL. */
+static void
+generate_100ES_fs_variables(exec_list *instructions,
+ struct _mesa_glsl_parse_state *state)
+{
+ for (unsigned i = 0; i < Elements(builtin_core_fs_variables); i++) {
+ add_builtin_variable(instructions, state->symbols,
+ & builtin_core_fs_variables[i]);
+ }
+
+ for (unsigned i = 0; i < Elements(builtin_100ES_fs_variables); i++) {
+ add_builtin_variable(instructions, state->symbols,
+ & builtin_100ES_fs_variables[i]);
+ }
+
+ generate_100ES_uniforms(instructions, state);
+
+ generate_ARB_draw_buffers_variables(instructions, state, false,
+ fragment_shader);
+}
+
+static void
+generate_110_fs_variables(exec_list *instructions,
+ struct _mesa_glsl_parse_state *state)
+{
+ for (unsigned i = 0; i < Elements(builtin_core_fs_variables); i++) {
+ add_builtin_variable(instructions, state->symbols,
+ & builtin_core_fs_variables[i]);
+ }
+
+ for (unsigned i = 0; i < Elements(builtin_110_fs_variables); i++) {
+ add_builtin_variable(instructions, state->symbols,
+ & builtin_110_fs_variables[i]);
+ }
+
+ for (unsigned i = 0
+ ; i < Elements(builtin_110_deprecated_fs_variables)
+ ; i++) {
+ add_builtin_variable(instructions, state->symbols,
+ & builtin_110_deprecated_fs_variables[i]);
+ }
+ generate_110_uniforms(instructions, state);
+
+ /* From page 54 (page 60 of the PDF) of the GLSL 1.20 spec:
+ *
+ * "As with all arrays, indices used to subscript gl_TexCoord must
+ * either be an integral constant expressions, or this array must be
+ * re-declared by the shader with a size. The size can be at most
+ * gl_MaxTextureCoords. Using indexes close to 0 may aid the
+ * implementation in preserving varying resources."
+ */
+ const glsl_type *const vec4_array_type =
+ glsl_type::get_array_instance(glsl_type::vec4_type, 0);
+
+ add_variable(instructions, state->symbols,
+ "gl_TexCoord", vec4_array_type, ir_var_in, FRAG_ATTRIB_TEX0);
+
+ generate_ARB_draw_buffers_variables(instructions, state, false,
+ fragment_shader);
+}
+
+
+static void
+generate_ARB_draw_buffers_variables(exec_list *instructions,
+ struct _mesa_glsl_parse_state *state,
+ bool warn, _mesa_glsl_parser_targets target)
+{
+ /* gl_MaxDrawBuffers is available in all shader stages.
+ */
+ ir_variable *const mdb =
+ add_variable(instructions, state->symbols,
+ "gl_MaxDrawBuffers", glsl_type::int_type, ir_var_auto, -1);
+
+ if (warn)
+ mdb->warn_extension = "GL_ARB_draw_buffers";
+
+ mdb->constant_value = new(mdb)
+ ir_constant(int(state->Const.MaxDrawBuffers));
+
+
+ /* gl_FragData is only available in the fragment shader.
+ */
+ if (target == fragment_shader) {
+ const glsl_type *const vec4_array_type =
+ glsl_type::get_array_instance(glsl_type::vec4_type,
+ state->Const.MaxDrawBuffers);
+
+ ir_variable *const fd =
+ add_variable(instructions, state->symbols,
+ "gl_FragData", vec4_array_type,
+ ir_var_out, FRAG_RESULT_DATA0);
+
+ if (warn)
+ fd->warn_extension = "GL_ARB_draw_buffers";
+ }
+}
+
+
+static void
+generate_ARB_draw_instanced_variables(exec_list *instructions,
+ struct _mesa_glsl_parse_state *state,
+ bool warn,
+ _mesa_glsl_parser_targets target)
+{
+ /* gl_InstanceIDARB is only available in the vertex shader.
+ */
+ if (target == vertex_shader) {
+ ir_variable *const inst =
+ add_variable(instructions, state->symbols,
+ "gl_InstanceIDARB", glsl_type::int_type,
+ ir_var_system_value, SYSTEM_VALUE_INSTANCE_ID);
+
+ if (warn)
+ inst->warn_extension = "GL_ARB_draw_instanced";
+ }
+}
+
+
+static void
+generate_ARB_shader_stencil_export_variables(exec_list *instructions,
+ struct _mesa_glsl_parse_state *state,
+ bool warn)
+{
+ /* gl_FragStencilRefARB is only available in the fragment shader.
+ */
+ ir_variable *const fd =
+ add_variable(instructions, state->symbols,
+ "gl_FragStencilRefARB", glsl_type::int_type,
+ ir_var_out, FRAG_RESULT_STENCIL);
+
+ if (warn)
+ fd->warn_extension = "GL_ARB_shader_stencil_export";
+}
+
+static void
+generate_AMD_shader_stencil_export_variables(exec_list *instructions,
+ struct _mesa_glsl_parse_state *state,
+ bool warn)
+{
+ /* gl_FragStencilRefAMD is only available in the fragment shader.
+ */
+ ir_variable *const fd =
+ add_variable(instructions, state->symbols,
+ "gl_FragStencilRefAMD", glsl_type::int_type,
+ ir_var_out, FRAG_RESULT_STENCIL);
+
+ if (warn)
+ fd->warn_extension = "GL_AMD_shader_stencil_export";
+}
+
+static void
+generate_120_fs_variables(exec_list *instructions,
+ struct _mesa_glsl_parse_state *state)
+{
+ generate_110_fs_variables(instructions, state);
+
+ for (unsigned i = 0
+ ; i < Elements(builtin_120_fs_variables)
+ ; i++) {
+ add_builtin_variable(instructions, state->symbols,
+ & builtin_120_fs_variables[i]);
+ }
+}
+
+static void
+generate_130_fs_variables(exec_list *instructions,
+ struct _mesa_glsl_parse_state *state)
+{
+ generate_120_fs_variables(instructions, state);
+
+ const glsl_type *const clip_distance_array_type =
+ glsl_type::get_array_instance(glsl_type::float_type,
+ state->Const.MaxClipPlanes);
+
+ /* FINISHME: gl_ClipDistance needs a real location assigned. */
+ add_variable(instructions, state->symbols,
+ "gl_ClipDistance", clip_distance_array_type, ir_var_in, -1);
+}
+
+static void
+initialize_fs_variables(exec_list *instructions,
+ struct _mesa_glsl_parse_state *state)
+{
+
+ switch (state->language_version) {
+ case 100:
+ generate_100ES_fs_variables(instructions, state);
+ break;
+ case 110:
+ generate_110_fs_variables(instructions, state);
+ break;
+ case 120:
+ generate_120_fs_variables(instructions, state);
+ break;
+ case 130:
+ generate_130_fs_variables(instructions, state);
+ break;
+ }
+
+ if (state->ARB_shader_stencil_export_enable)
+ generate_ARB_shader_stencil_export_variables(instructions, state,
+ state->ARB_shader_stencil_export_warn);
+
+ if (state->AMD_shader_stencil_export_enable)
+ generate_AMD_shader_stencil_export_variables(instructions, state,
+ state->AMD_shader_stencil_export_warn);
+}
+
+void
+_mesa_glsl_initialize_variables(exec_list *instructions,
+ struct _mesa_glsl_parse_state *state)
+{
+ switch (state->target) {
+ case vertex_shader:
+ initialize_vs_variables(instructions, state);
+ break;
+ case geometry_shader:
+ break;
+ case fragment_shader:
+ initialize_fs_variables(instructions, state);
+ break;
+ }
+}
diff --git a/mesalib/src/glsl/link_functions.cpp b/mesalib/src/glsl/link_functions.cpp
index ae8818be8..76687b6be 100644
--- a/mesalib/src/glsl/link_functions.cpp
+++ b/mesalib/src/glsl/link_functions.cpp
@@ -1,272 +1,272 @@
-/*
- * Copyright © 2010 Intel Corporation
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-
-#include "main/core.h"
-#include "glsl_symbol_table.h"
-#include "glsl_parser_extras.h"
-#include "ir.h"
-#include "program.h"
-#include "program/hash_table.h"
-#include "linker.h"
-
-static ir_function_signature *
-find_matching_signature(const char *name, const exec_list *actual_parameters,
- gl_shader **shader_list, unsigned num_shaders);
-
-class call_link_visitor : public ir_hierarchical_visitor {
-public:
- call_link_visitor(gl_shader_program *prog, gl_shader *linked,
- gl_shader **shader_list, unsigned num_shaders)
- {
- this->prog = prog;
- this->shader_list = shader_list;
- this->num_shaders = num_shaders;
- this->success = true;
- this->linked = linked;
-
- this->locals = hash_table_ctor(0, hash_table_pointer_hash,
- hash_table_pointer_compare);
- }
-
- ~call_link_visitor()
- {
- hash_table_dtor(this->locals);
- }
-
- virtual ir_visitor_status visit(ir_variable *ir)
- {
- hash_table_insert(locals, ir, ir);
- return visit_continue;
- }
-
- virtual ir_visitor_status visit_enter(ir_call *ir)
- {
- /* If ir is an ir_call from a function that was imported from another
- * shader callee will point to an ir_function_signature in the original
- * shader. In this case the function signature MUST NOT BE MODIFIED.
- * Doing so will modify the original shader. This may prevent that
- * shader from being linkable in other programs.
- */
- const ir_function_signature *const callee = ir->get_callee();
- assert(callee != NULL);
- const char *const name = callee->function_name();
-
- /* Determine if the requested function signature already exists in the
- * final linked shader. If it does, use it as the target of the call.
- */
- ir_function_signature *sig =
- find_matching_signature(name, &callee->parameters, &linked, 1);
- if (sig != NULL) {
- ir->set_callee(sig);
- return visit_continue;
- }
-
- /* Try to find the signature in one of the other shaders that is being
- * linked. If it's not found there, return an error.
- */
- sig = find_matching_signature(name, &ir->actual_parameters, shader_list,
- num_shaders);
- if (sig == NULL) {
- /* FINISHME: Log the full signature of unresolved function.
- */
- linker_error_printf(this->prog, "unresolved reference to function "
- "`%s'\n", name);
- this->success = false;
- return visit_stop;
- }
-
- /* Find the prototype information in the linked shader. Generate any
- * details that may be missing.
- */
- ir_function *f = linked->symbols->get_function(name);
- if (f == NULL) {
- f = new(linked) ir_function(name);
-
- /* Add the new function to the linked IR.
- */
- linked->symbols->add_function(f);
- linked->ir->push_head(f);
- }
-
- ir_function_signature *linked_sig =
- f->exact_matching_signature(&callee->parameters);
- if (linked_sig == NULL) {
- linked_sig = new(linked) ir_function_signature(callee->return_type);
- f->add_signature(linked_sig);
- }
-
- /* At this point linked_sig and called may be the same. If ir is an
- * ir_call from linked then linked_sig and callee will be
- * ir_function_signatures that have no definitions (is_defined is false).
- */
- assert(!linked_sig->is_defined);
- assert(linked_sig->body.is_empty());
-
- /* Create an in-place clone of the function definition. This multistep
- * process introduces some complexity here, but it has some advantages.
- * The parameter list and the and function body are cloned separately.
- * The clone of the parameter list is used to prime the hashtable used
- * to replace variable references in the cloned body.
- *
- * The big advantage is that the ir_function_signature does not change.
- * This means that we don't have to process the rest of the IR tree to
- * patch ir_call nodes. In addition, there is no way to remove or
- * replace signature stored in a function. One could easily be added,
- * but this avoids the need.
- */
- struct hash_table *ht = hash_table_ctor(0, hash_table_pointer_hash,
- hash_table_pointer_compare);
- exec_list formal_parameters;
- foreach_list_const(node, &sig->parameters) {
- const ir_instruction *const original = (ir_instruction *) node;
- assert(const_cast<ir_instruction *>(original)->as_variable());
-
- ir_instruction *copy = original->clone(linked, ht);
- formal_parameters.push_tail(copy);
- }
-
- linked_sig->replace_parameters(&formal_parameters);
-
- foreach_list_const(node, &sig->body) {
- const ir_instruction *const original = (ir_instruction *) node;
-
- ir_instruction *copy = original->clone(linked, ht);
- linked_sig->body.push_tail(copy);
- }
-
- linked_sig->is_defined = true;
- hash_table_dtor(ht);
-
- /* Patch references inside the function to things outside the function
- * (i.e., function calls and global variables).
- */
- linked_sig->accept(this);
-
- ir->set_callee(linked_sig);
-
- return visit_continue;
- }
-
- virtual ir_visitor_status visit(ir_dereference_variable *ir)
- {
- if (hash_table_find(locals, ir->var) == NULL) {
- /* The non-function variable must be a global, so try to find the
- * variable in the shader's symbol table. If the variable is not
- * found, then it's a global that *MUST* be defined in the original
- * shader.
- */
- ir_variable *var = linked->symbols->get_variable(ir->var->name);
- if (var == NULL) {
- /* Clone the ir_variable that the dereference already has and add
- * it to the linked shader.
- */
- var = ir->var->clone(linked, NULL);
- linked->symbols->add_variable(var);
- linked->ir->push_head(var);
- } else if (var->type->is_array()) {
- /* It is possible to have a global array declared in multiple
- * shaders without a size. The array is implicitly sized by the
- * maximal access to it in *any* shader. Because of this, we
- * need to track the maximal access to the array as linking pulls
- * more functions in that access the array.
- */
- var->max_array_access =
- MAX2(var->max_array_access, ir->var->max_array_access);
-
- if (var->type->length == 0 && ir->var->type->length != 0)
- var->type = ir->var->type;
- }
-
- ir->var = var;
- }
-
- return visit_continue;
- }
-
- /** Was function linking successful? */
- bool success;
-
-private:
- /**
- * Shader program being linked
- *
- * This is only used for logging error messages.
- */
- gl_shader_program *prog;
-
- /** List of shaders available for linking. */
- gl_shader **shader_list;
-
- /** Number of shaders available for linking. */
- unsigned num_shaders;
-
- /**
- * Final linked shader
- *
- * This is used two ways. It is used to find global variables in the
- * linked shader that are accessed by the function. It is also used to add
- * global variables from the shader where the function originated.
- */
- gl_shader *linked;
-
- /**
- * Table of variables local to the function.
- */
- hash_table *locals;
-};
-
-
-/**
- * Searches a list of shaders for a particular function definition
- */
-ir_function_signature *
-find_matching_signature(const char *name, const exec_list *actual_parameters,
- gl_shader **shader_list, unsigned num_shaders)
-{
- for (unsigned i = 0; i < num_shaders; i++) {
- ir_function *const f = shader_list[i]->symbols->get_function(name);
-
- if (f == NULL)
- continue;
-
- ir_function_signature *sig = f->matching_signature(actual_parameters);
-
- if ((sig == NULL) || !sig->is_defined)
- continue;
-
- return sig;
- }
-
- return NULL;
-}
-
-
-bool
-link_function_calls(gl_shader_program *prog, gl_shader *main,
- gl_shader **shader_list, unsigned num_shaders)
-{
- call_link_visitor v(prog, main, shader_list, num_shaders);
-
- v.run(main->ir);
- return v.success;
-}
+/*
+ * Copyright © 2010 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+#include "main/core.h"
+#include "glsl_symbol_table.h"
+#include "glsl_parser_extras.h"
+#include "ir.h"
+#include "program.h"
+#include "program/hash_table.h"
+#include "linker.h"
+
+static ir_function_signature *
+find_matching_signature(const char *name, const exec_list *actual_parameters,
+ gl_shader **shader_list, unsigned num_shaders);
+
+class call_link_visitor : public ir_hierarchical_visitor {
+public:
+ call_link_visitor(gl_shader_program *prog, gl_shader *linked,
+ gl_shader **shader_list, unsigned num_shaders)
+ {
+ this->prog = prog;
+ this->shader_list = shader_list;
+ this->num_shaders = num_shaders;
+ this->success = true;
+ this->linked = linked;
+
+ this->locals = hash_table_ctor(0, hash_table_pointer_hash,
+ hash_table_pointer_compare);
+ }
+
+ ~call_link_visitor()
+ {
+ hash_table_dtor(this->locals);
+ }
+
+ virtual ir_visitor_status visit(ir_variable *ir)
+ {
+ hash_table_insert(locals, ir, ir);
+ return visit_continue;
+ }
+
+ virtual ir_visitor_status visit_enter(ir_call *ir)
+ {
+ /* If ir is an ir_call from a function that was imported from another
+ * shader callee will point to an ir_function_signature in the original
+ * shader. In this case the function signature MUST NOT BE MODIFIED.
+ * Doing so will modify the original shader. This may prevent that
+ * shader from being linkable in other programs.
+ */
+ const ir_function_signature *const callee = ir->get_callee();
+ assert(callee != NULL);
+ const char *const name = callee->function_name();
+
+ /* Determine if the requested function signature already exists in the
+ * final linked shader. If it does, use it as the target of the call.
+ */
+ ir_function_signature *sig =
+ find_matching_signature(name, &callee->parameters, &linked, 1);
+ if (sig != NULL) {
+ ir->set_callee(sig);
+ return visit_continue;
+ }
+
+ /* Try to find the signature in one of the other shaders that is being
+ * linked. If it's not found there, return an error.
+ */
+ sig = find_matching_signature(name, &ir->actual_parameters, shader_list,
+ num_shaders);
+ if (sig == NULL) {
+ /* FINISHME: Log the full signature of unresolved function.
+ */
+ linker_error_printf(this->prog, "unresolved reference to function "
+ "`%s'\n", name);
+ this->success = false;
+ return visit_stop;
+ }
+
+ /* Find the prototype information in the linked shader. Generate any
+ * details that may be missing.
+ */
+ ir_function *f = linked->symbols->get_function(name);
+ if (f == NULL) {
+ f = new(linked) ir_function(name);
+
+ /* Add the new function to the linked IR.
+ */
+ linked->symbols->add_function(f);
+ linked->ir->push_head(f);
+ }
+
+ ir_function_signature *linked_sig =
+ f->exact_matching_signature(&callee->parameters);
+ if (linked_sig == NULL) {
+ linked_sig = new(linked) ir_function_signature(callee->return_type);
+ f->add_signature(linked_sig);
+ }
+
+ /* At this point linked_sig and called may be the same. If ir is an
+ * ir_call from linked then linked_sig and callee will be
+ * ir_function_signatures that have no definitions (is_defined is false).
+ */
+ assert(!linked_sig->is_defined);
+ assert(linked_sig->body.is_empty());
+
+ /* Create an in-place clone of the function definition. This multistep
+ * process introduces some complexity here, but it has some advantages.
+ * The parameter list and the and function body are cloned separately.
+ * The clone of the parameter list is used to prime the hashtable used
+ * to replace variable references in the cloned body.
+ *
+ * The big advantage is that the ir_function_signature does not change.
+ * This means that we don't have to process the rest of the IR tree to
+ * patch ir_call nodes. In addition, there is no way to remove or
+ * replace signature stored in a function. One could easily be added,
+ * but this avoids the need.
+ */
+ struct hash_table *ht = hash_table_ctor(0, hash_table_pointer_hash,
+ hash_table_pointer_compare);
+ exec_list formal_parameters;
+ foreach_list_const(node, &sig->parameters) {
+ const ir_instruction *const original = (ir_instruction *) node;
+ assert(const_cast<ir_instruction *>(original)->as_variable());
+
+ ir_instruction *copy = original->clone(linked, ht);
+ formal_parameters.push_tail(copy);
+ }
+
+ linked_sig->replace_parameters(&formal_parameters);
+
+ foreach_list_const(node, &sig->body) {
+ const ir_instruction *const original = (ir_instruction *) node;
+
+ ir_instruction *copy = original->clone(linked, ht);
+ linked_sig->body.push_tail(copy);
+ }
+
+ linked_sig->is_defined = true;
+ hash_table_dtor(ht);
+
+ /* Patch references inside the function to things outside the function
+ * (i.e., function calls and global variables).
+ */
+ linked_sig->accept(this);
+
+ ir->set_callee(linked_sig);
+
+ return visit_continue;
+ }
+
+ virtual ir_visitor_status visit(ir_dereference_variable *ir)
+ {
+ if (hash_table_find(locals, ir->var) == NULL) {
+ /* The non-function variable must be a global, so try to find the
+ * variable in the shader's symbol table. If the variable is not
+ * found, then it's a global that *MUST* be defined in the original
+ * shader.
+ */
+ ir_variable *var = linked->symbols->get_variable(ir->var->name);
+ if (var == NULL) {
+ /* Clone the ir_variable that the dereference already has and add
+ * it to the linked shader.
+ */
+ var = ir->var->clone(linked, NULL);
+ linked->symbols->add_variable(var);
+ linked->ir->push_head(var);
+ } else if (var->type->is_array()) {
+ /* It is possible to have a global array declared in multiple
+ * shaders without a size. The array is implicitly sized by the
+ * maximal access to it in *any* shader. Because of this, we
+ * need to track the maximal access to the array as linking pulls
+ * more functions in that access the array.
+ */
+ var->max_array_access =
+ MAX2(var->max_array_access, ir->var->max_array_access);
+
+ if (var->type->length == 0 && ir->var->type->length != 0)
+ var->type = ir->var->type;
+ }
+
+ ir->var = var;
+ }
+
+ return visit_continue;
+ }
+
+ /** Was function linking successful? */
+ bool success;
+
+private:
+ /**
+ * Shader program being linked
+ *
+ * This is only used for logging error messages.
+ */
+ gl_shader_program *prog;
+
+ /** List of shaders available for linking. */
+ gl_shader **shader_list;
+
+ /** Number of shaders available for linking. */
+ unsigned num_shaders;
+
+ /**
+ * Final linked shader
+ *
+ * This is used two ways. It is used to find global variables in the
+ * linked shader that are accessed by the function. It is also used to add
+ * global variables from the shader where the function originated.
+ */
+ gl_shader *linked;
+
+ /**
+ * Table of variables local to the function.
+ */
+ hash_table *locals;
+};
+
+
+/**
+ * Searches a list of shaders for a particular function definition
+ */
+ir_function_signature *
+find_matching_signature(const char *name, const exec_list *actual_parameters,
+ gl_shader **shader_list, unsigned num_shaders)
+{
+ for (unsigned i = 0; i < num_shaders; i++) {
+ ir_function *const f = shader_list[i]->symbols->get_function(name);
+
+ if (f == NULL)
+ continue;
+
+ ir_function_signature *sig = f->matching_signature(actual_parameters);
+
+ if ((sig == NULL) || !sig->is_defined)
+ continue;
+
+ return sig;
+ }
+
+ return NULL;
+}
+
+
+bool
+link_function_calls(gl_shader_program *prog, gl_shader *main,
+ gl_shader **shader_list, unsigned num_shaders)
+{
+ call_link_visitor v(prog, main, shader_list, num_shaders);
+
+ v.run(main->ir);
+ return v.success;
+}
diff --git a/mesalib/src/glsl/linker.cpp b/mesalib/src/glsl/linker.cpp
index 255edc6a7..307c432ad 100644
--- a/mesalib/src/glsl/linker.cpp
+++ b/mesalib/src/glsl/linker.cpp
@@ -1,1722 +1,1722 @@
-/*
- * Copyright © 2010 Intel Corporation
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-
-/**
- * \file linker.cpp
- * GLSL linker implementation
- *
- * Given a set of shaders that are to be linked to generate a final program,
- * there are three distinct stages.
- *
- * In the first stage shaders are partitioned into groups based on the shader
- * type. All shaders of a particular type (e.g., vertex shaders) are linked
- * together.
- *
- * - Undefined references in each shader are resolve to definitions in
- * another shader.
- * - Types and qualifiers of uniforms, outputs, and global variables defined
- * in multiple shaders with the same name are verified to be the same.
- * - Initializers for uniforms and global variables defined
- * in multiple shaders with the same name are verified to be the same.
- *
- * The result, in the terminology of the GLSL spec, is a set of shader
- * executables for each processing unit.
- *
- * After the first stage is complete, a series of semantic checks are performed
- * on each of the shader executables.
- *
- * - Each shader executable must define a \c main function.
- * - Each vertex shader executable must write to \c gl_Position.
- * - Each fragment shader executable must write to either \c gl_FragData or
- * \c gl_FragColor.
- *
- * In the final stage individual shader executables are linked to create a
- * complete exectuable.
- *
- * - Types of uniforms defined in multiple shader stages with the same name
- * are verified to be the same.
- * - Initializers for uniforms defined in multiple shader stages with the
- * same name are verified to be the same.
- * - Types and qualifiers of outputs defined in one stage are verified to
- * be the same as the types and qualifiers of inputs defined with the same
- * name in a later stage.
- *
- * \author Ian Romanick <ian.d.romanick@intel.com>
- */
-
-#include "main/core.h"
-#include "glsl_symbol_table.h"
-#include "ir.h"
-#include "program.h"
-#include "program/hash_table.h"
-#include "linker.h"
-#include "ir_optimization.h"
-
-extern "C" {
-#include "main/shaderobj.h"
-}
-
-/**
- * Visitor that determines whether or not a variable is ever written.
- */
-class find_assignment_visitor : public ir_hierarchical_visitor {
-public:
- find_assignment_visitor(const char *name)
- : name(name), found(false)
- {
- /* empty */
- }
-
- virtual ir_visitor_status visit_enter(ir_assignment *ir)
- {
- ir_variable *const var = ir->lhs->variable_referenced();
-
- if (strcmp(name, var->name) == 0) {
- found = true;
- return visit_stop;
- }
-
- return visit_continue_with_parent;
- }
-
- virtual ir_visitor_status visit_enter(ir_call *ir)
- {
- exec_list_iterator sig_iter = ir->get_callee()->parameters.iterator();
- foreach_iter(exec_list_iterator, iter, *ir) {
- ir_rvalue *param_rval = (ir_rvalue *)iter.get();
- ir_variable *sig_param = (ir_variable *)sig_iter.get();
-
- if (sig_param->mode == ir_var_out ||
- sig_param->mode == ir_var_inout) {
- ir_variable *var = param_rval->variable_referenced();
- if (var && strcmp(name, var->name) == 0) {
- found = true;
- return visit_stop;
- }
- }
- sig_iter.next();
- }
-
- return visit_continue_with_parent;
- }
-
- bool variable_found()
- {
- return found;
- }
-
-private:
- const char *name; /**< Find writes to a variable with this name. */
- bool found; /**< Was a write to the variable found? */
-};
-
-
-/**
- * Visitor that determines whether or not a variable is ever read.
- */
-class find_deref_visitor : public ir_hierarchical_visitor {
-public:
- find_deref_visitor(const char *name)
- : name(name), found(false)
- {
- /* empty */
- }
-
- virtual ir_visitor_status visit(ir_dereference_variable *ir)
- {
- if (strcmp(this->name, ir->var->name) == 0) {
- this->found = true;
- return visit_stop;
- }
-
- return visit_continue;
- }
-
- bool variable_found() const
- {
- return this->found;
- }
-
-private:
- const char *name; /**< Find writes to a variable with this name. */
- bool found; /**< Was a write to the variable found? */
-};
-
-
-void
-linker_error_printf(gl_shader_program *prog, const char *fmt, ...)
-{
- va_list ap;
-
- ralloc_strcat(&prog->InfoLog, "error: ");
- va_start(ap, fmt);
- ralloc_vasprintf_append(&prog->InfoLog, fmt, ap);
- va_end(ap);
-}
-
-
-void
-invalidate_variable_locations(gl_shader *sh, enum ir_variable_mode mode,
- int generic_base)
-{
- foreach_list(node, sh->ir) {
- ir_variable *const var = ((ir_instruction *) node)->as_variable();
-
- if ((var == NULL) || (var->mode != (unsigned) mode))
- continue;
-
- /* Only assign locations for generic attributes / varyings / etc.
- */
- if ((var->location >= generic_base) && !var->explicit_location)
- var->location = -1;
- }
-}
-
-
-/**
- * Determine the number of attribute slots required for a particular type
- *
- * This code is here because it implements the language rules of a specific
- * GLSL version. Since it's a property of the language and not a property of
- * types in general, it doesn't really belong in glsl_type.
- */
-unsigned
-count_attribute_slots(const glsl_type *t)
-{
- /* From page 31 (page 37 of the PDF) of the GLSL 1.50 spec:
- *
- * "A scalar input counts the same amount against this limit as a vec4,
- * so applications may want to consider packing groups of four
- * unrelated float inputs together into a vector to better utilize the
- * capabilities of the underlying hardware. A matrix input will use up
- * multiple locations. The number of locations used will equal the
- * number of columns in the matrix."
- *
- * The spec does not explicitly say how arrays are counted. However, it
- * should be safe to assume the total number of slots consumed by an array
- * is the number of entries in the array multiplied by the number of slots
- * consumed by a single element of the array.
- */
-
- if (t->is_array())
- return t->array_size() * count_attribute_slots(t->element_type());
-
- if (t->is_matrix())
- return t->matrix_columns;
-
- return 1;
-}
-
-
-/**
- * Verify that a vertex shader executable meets all semantic requirements
- *
- * \param shader Vertex shader executable to be verified
- */
-bool
-validate_vertex_shader_executable(struct gl_shader_program *prog,
- struct gl_shader *shader)
-{
- if (shader == NULL)
- return true;
-
- find_assignment_visitor find("gl_Position");
- find.run(shader->ir);
- if (!find.variable_found()) {
- linker_error_printf(prog,
- "vertex shader does not write to `gl_Position'\n");
- return false;
- }
-
- return true;
-}
-
-
-/**
- * Verify that a fragment shader executable meets all semantic requirements
- *
- * \param shader Fragment shader executable to be verified
- */
-bool
-validate_fragment_shader_executable(struct gl_shader_program *prog,
- struct gl_shader *shader)
-{
- if (shader == NULL)
- return true;
-
- find_assignment_visitor frag_color("gl_FragColor");
- find_assignment_visitor frag_data("gl_FragData");
-
- frag_color.run(shader->ir);
- frag_data.run(shader->ir);
-
- if (frag_color.variable_found() && frag_data.variable_found()) {
- linker_error_printf(prog, "fragment shader writes to both "
- "`gl_FragColor' and `gl_FragData'\n");
- return false;
- }
-
- return true;
-}
-
-
-/**
- * Generate a string describing the mode of a variable
- */
-static const char *
-mode_string(const ir_variable *var)
-{
- switch (var->mode) {
- case ir_var_auto:
- return (var->read_only) ? "global constant" : "global variable";
-
- case ir_var_uniform: return "uniform";
- case ir_var_in: return "shader input";
- case ir_var_out: return "shader output";
- case ir_var_inout: return "shader inout";
-
- case ir_var_const_in:
- case ir_var_temporary:
- default:
- assert(!"Should not get here.");
- return "invalid variable";
- }
-}
-
-
-/**
- * Perform validation of global variables used across multiple shaders
- */
-bool
-cross_validate_globals(struct gl_shader_program *prog,
- struct gl_shader **shader_list,
- unsigned num_shaders,
- bool uniforms_only)
-{
- /* Examine all of the uniforms in all of the shaders and cross validate
- * them.
- */
- glsl_symbol_table variables;
- for (unsigned i = 0; i < num_shaders; i++) {
- if (shader_list[i] == NULL)
- continue;
-
- foreach_list(node, shader_list[i]->ir) {
- ir_variable *const var = ((ir_instruction *) node)->as_variable();
-
- if (var == NULL)
- continue;
-
- if (uniforms_only && (var->mode != ir_var_uniform))
- continue;
-
- /* Don't cross validate temporaries that are at global scope. These
- * will eventually get pulled into the shaders 'main'.
- */
- if (var->mode == ir_var_temporary)
- continue;
-
- /* If a global with this name has already been seen, verify that the
- * new instance has the same type. In addition, if the globals have
- * initializers, the values of the initializers must be the same.
- */
- ir_variable *const existing = variables.get_variable(var->name);
- if (existing != NULL) {
- if (var->type != existing->type) {
- /* Consider the types to be "the same" if both types are arrays
- * of the same type and one of the arrays is implicitly sized.
- * In addition, set the type of the linked variable to the
- * explicitly sized array.
- */
- if (var->type->is_array()
- && existing->type->is_array()
- && (var->type->fields.array == existing->type->fields.array)
- && ((var->type->length == 0)
- || (existing->type->length == 0))) {
- if (var->type->length != 0) {
- existing->type = var->type;
- }
- } else {
- linker_error_printf(prog, "%s `%s' declared as type "
- "`%s' and type `%s'\n",
- mode_string(var),
- var->name, var->type->name,
- existing->type->name);
- return false;
- }
- }
-
- if (var->explicit_location) {
- if (existing->explicit_location
- && (var->location != existing->location)) {
- linker_error_printf(prog, "explicit locations for %s "
- "`%s' have differing values\n",
- mode_string(var), var->name);
- return false;
- }
-
- existing->location = var->location;
- existing->explicit_location = true;
- }
-
- /* Validate layout qualifiers for gl_FragDepth.
- *
- * From the AMD_conservative_depth spec:
- * "If gl_FragDepth is redeclared in any fragment shader in
- * a program, it must be redeclared in all fragment shaders in that
- * program that have static assignments to gl_FragDepth. All
- * redeclarations of gl_FragDepth in all fragment shaders in
- * a single program must have the same set of qualifiers."
- */
- if (strcmp(var->name, "gl_FragDepth") == 0) {
- bool layout_declared = var->depth_layout != ir_depth_layout_none;
- bool layout_differs = var->depth_layout != existing->depth_layout;
- if (layout_declared && layout_differs) {
- linker_error_printf(prog,
- "All redeclarations of gl_FragDepth in all fragment shaders "
- "in a single program must have the same set of qualifiers.");
- }
- if (var->used && layout_differs) {
- linker_error_printf(prog,
- "If gl_FragDepth is redeclared with a layout qualifier in"
- "any fragment shader, it must be redeclared with the same"
- "layout qualifier in all fragment shaders that have"
- "assignments to gl_FragDepth");
- }
- }
-
- /* FINISHME: Handle non-constant initializers.
- */
- if (var->constant_value != NULL) {
- if (existing->constant_value != NULL) {
- if (!var->constant_value->has_value(existing->constant_value)) {
- linker_error_printf(prog, "initializers for %s "
- "`%s' have differing values\n",
- mode_string(var), var->name);
- return false;
- }
- } else
- /* If the first-seen instance of a particular uniform did not
- * have an initializer but a later instance does, copy the
- * initializer to the version stored in the symbol table.
- */
- /* FINISHME: This is wrong. The constant_value field should
- * FINISHME: not be modified! Imagine a case where a shader
- * FINISHME: without an initializer is linked in two different
- * FINISHME: programs with shaders that have differing
- * FINISHME: initializers. Linking with the first will
- * FINISHME: modify the shader, and linking with the second
- * FINISHME: will fail.
- */
- existing->constant_value =
- var->constant_value->clone(ralloc_parent(existing), NULL);
- }
-
- if (existing->invariant != var->invariant) {
- linker_error_printf(prog, "declarations for %s `%s' have "
- "mismatching invariant qualifiers\n",
- mode_string(var), var->name);
- return false;
- }
- if (existing->centroid != var->centroid) {
- linker_error_printf(prog, "declarations for %s `%s' have "
- "mismatching centroid qualifiers\n",
- mode_string(var), var->name);
- return false;
- }
- } else
- variables.add_variable(var);
- }
- }
-
- return true;
-}
-
-
-/**
- * Perform validation of uniforms used across multiple shader stages
- */
-bool
-cross_validate_uniforms(struct gl_shader_program *prog)
-{
- return cross_validate_globals(prog, prog->_LinkedShaders,
- MESA_SHADER_TYPES, true);
-}
-
-
-/**
- * Validate that outputs from one stage match inputs of another
- */
-bool
-cross_validate_outputs_to_inputs(struct gl_shader_program *prog,
- gl_shader *producer, gl_shader *consumer)
-{
- glsl_symbol_table parameters;
- /* FINISHME: Figure these out dynamically. */
- const char *const producer_stage = "vertex";
- const char *const consumer_stage = "fragment";
-
- /* Find all shader outputs in the "producer" stage.
- */
- foreach_list(node, producer->ir) {
- ir_variable *const var = ((ir_instruction *) node)->as_variable();
-
- /* FINISHME: For geometry shaders, this should also look for inout
- * FINISHME: variables.
- */
- if ((var == NULL) || (var->mode != ir_var_out))
- continue;
-
- parameters.add_variable(var);
- }
-
-
- /* Find all shader inputs in the "consumer" stage. Any variables that have
- * matching outputs already in the symbol table must have the same type and
- * qualifiers.
- */
- foreach_list(node, consumer->ir) {
- ir_variable *const input = ((ir_instruction *) node)->as_variable();
-
- /* FINISHME: For geometry shaders, this should also look for inout
- * FINISHME: variables.
- */
- if ((input == NULL) || (input->mode != ir_var_in))
- continue;
-
- ir_variable *const output = parameters.get_variable(input->name);
- if (output != NULL) {
- /* Check that the types match between stages.
- */
- if (input->type != output->type) {
- /* There is a bit of a special case for gl_TexCoord. This
- * built-in is unsized by default. Applications that variable
- * access it must redeclare it with a size. There is some
- * language in the GLSL spec that implies the fragment shader
- * and vertex shader do not have to agree on this size. Other
- * driver behave this way, and one or two applications seem to
- * rely on it.
- *
- * Neither declaration needs to be modified here because the array
- * sizes are fixed later when update_array_sizes is called.
- *
- * From page 48 (page 54 of the PDF) of the GLSL 1.10 spec:
- *
- * "Unlike user-defined varying variables, the built-in
- * varying variables don't have a strict one-to-one
- * correspondence between the vertex language and the
- * fragment language."
- */
- if (!output->type->is_array()
- || (strncmp("gl_", output->name, 3) != 0)) {
- linker_error_printf(prog,
- "%s shader output `%s' declared as "
- "type `%s', but %s shader input declared "
- "as type `%s'\n",
- producer_stage, output->name,
- output->type->name,
- consumer_stage, input->type->name);
- return false;
- }
- }
-
- /* Check that all of the qualifiers match between stages.
- */
- if (input->centroid != output->centroid) {
- linker_error_printf(prog,
- "%s shader output `%s' %s centroid qualifier, "
- "but %s shader input %s centroid qualifier\n",
- producer_stage,
- output->name,
- (output->centroid) ? "has" : "lacks",
- consumer_stage,
- (input->centroid) ? "has" : "lacks");
- return false;
- }
-
- if (input->invariant != output->invariant) {
- linker_error_printf(prog,
- "%s shader output `%s' %s invariant qualifier, "
- "but %s shader input %s invariant qualifier\n",
- producer_stage,
- output->name,
- (output->invariant) ? "has" : "lacks",
- consumer_stage,
- (input->invariant) ? "has" : "lacks");
- return false;
- }
-
- if (input->interpolation != output->interpolation) {
- linker_error_printf(prog,
- "%s shader output `%s' specifies %s "
- "interpolation qualifier, "
- "but %s shader input specifies %s "
- "interpolation qualifier\n",
- producer_stage,
- output->name,
- output->interpolation_string(),
- consumer_stage,
- input->interpolation_string());
- return false;
- }
- }
- }
-
- return true;
-}
-
-
-/**
- * Populates a shaders symbol table with all global declarations
- */
-static void
-populate_symbol_table(gl_shader *sh)
-{
- sh->symbols = new(sh) glsl_symbol_table;
-
- foreach_list(node, sh->ir) {
- ir_instruction *const inst = (ir_instruction *) node;
- ir_variable *var;
- ir_function *func;
-
- if ((func = inst->as_function()) != NULL) {
- sh->symbols->add_function(func);
- } else if ((var = inst->as_variable()) != NULL) {
- sh->symbols->add_variable(var);
- }
- }
-}
-
-
-/**
- * Remap variables referenced in an instruction tree
- *
- * This is used when instruction trees are cloned from one shader and placed in
- * another. These trees will contain references to \c ir_variable nodes that
- * do not exist in the target shader. This function finds these \c ir_variable
- * references and replaces the references with matching variables in the target
- * shader.
- *
- * If there is no matching variable in the target shader, a clone of the
- * \c ir_variable is made and added to the target shader. The new variable is
- * added to \b both the instruction stream and the symbol table.
- *
- * \param inst IR tree that is to be processed.
- * \param symbols Symbol table containing global scope symbols in the
- * linked shader.
- * \param instructions Instruction stream where new variable declarations
- * should be added.
- */
-void
-remap_variables(ir_instruction *inst, struct gl_shader *target,
- hash_table *temps)
-{
- class remap_visitor : public ir_hierarchical_visitor {
- public:
- remap_visitor(struct gl_shader *target,
- hash_table *temps)
- {
- this->target = target;
- this->symbols = target->symbols;
- this->instructions = target->ir;
- this->temps = temps;
- }
-
- virtual ir_visitor_status visit(ir_dereference_variable *ir)
- {
- if (ir->var->mode == ir_var_temporary) {
- ir_variable *var = (ir_variable *) hash_table_find(temps, ir->var);
-
- assert(var != NULL);
- ir->var = var;
- return visit_continue;
- }
-
- ir_variable *const existing =
- this->symbols->get_variable(ir->var->name);
- if (existing != NULL)
- ir->var = existing;
- else {
- ir_variable *copy = ir->var->clone(this->target, NULL);
-
- this->symbols->add_variable(copy);
- this->instructions->push_head(copy);
- ir->var = copy;
- }
-
- return visit_continue;
- }
-
- private:
- struct gl_shader *target;
- glsl_symbol_table *symbols;
- exec_list *instructions;
- hash_table *temps;
- };
-
- remap_visitor v(target, temps);
-
- inst->accept(&v);
-}
-
-
-/**
- * Move non-declarations from one instruction stream to another
- *
- * The intended usage pattern of this function is to pass the pointer to the
- * head sentinel of a list (i.e., a pointer to the list cast to an \c exec_node
- * pointer) for \c last and \c false for \c make_copies on the first
- * call. Successive calls pass the return value of the previous call for
- * \c last and \c true for \c make_copies.
- *
- * \param instructions Source instruction stream
- * \param last Instruction after which new instructions should be
- * inserted in the target instruction stream
- * \param make_copies Flag selecting whether instructions in \c instructions
- * should be copied (via \c ir_instruction::clone) into the
- * target list or moved.
- *
- * \return
- * The new "last" instruction in the target instruction stream. This pointer
- * is suitable for use as the \c last parameter of a later call to this
- * function.
- */
-exec_node *
-move_non_declarations(exec_list *instructions, exec_node *last,
- bool make_copies, gl_shader *target)
-{
- hash_table *temps = NULL;
-
- if (make_copies)
- temps = hash_table_ctor(0, hash_table_pointer_hash,
- hash_table_pointer_compare);
-
- foreach_list_safe(node, instructions) {
- ir_instruction *inst = (ir_instruction *) node;
-
- if (inst->as_function())
- continue;
-
- ir_variable *var = inst->as_variable();
- if ((var != NULL) && (var->mode != ir_var_temporary))
- continue;
-
- assert(inst->as_assignment()
- || ((var != NULL) && (var->mode == ir_var_temporary)));
-
- if (make_copies) {
- inst = inst->clone(target, NULL);
-
- if (var != NULL)
- hash_table_insert(temps, inst, var);
- else
- remap_variables(inst, target, temps);
- } else {
- inst->remove();
- }
-
- last->insert_after(inst);
- last = inst;
- }
-
- if (make_copies)
- hash_table_dtor(temps);
-
- return last;
-}
-
-/**
- * Get the function signature for main from a shader
- */
-static ir_function_signature *
-get_main_function_signature(gl_shader *sh)
-{
- ir_function *const f = sh->symbols->get_function("main");
- if (f != NULL) {
- exec_list void_parameters;
-
- /* Look for the 'void main()' signature and ensure that it's defined.
- * This keeps the linker from accidentally pick a shader that just
- * contains a prototype for main.
- *
- * We don't have to check for multiple definitions of main (in multiple
- * shaders) because that would have already been caught above.
- */
- ir_function_signature *sig = f->matching_signature(&void_parameters);
- if ((sig != NULL) && sig->is_defined) {
- return sig;
- }
- }
-
- return NULL;
-}
-
-
-/**
- * Combine a group of shaders for a single stage to generate a linked shader
- *
- * \note
- * If this function is supplied a single shader, it is cloned, and the new
- * shader is returned.
- */
-static struct gl_shader *
-link_intrastage_shaders(void *mem_ctx,
- struct gl_context *ctx,
- struct gl_shader_program *prog,
- struct gl_shader **shader_list,
- unsigned num_shaders)
-{
- /* Check that global variables defined in multiple shaders are consistent.
- */
- if (!cross_validate_globals(prog, shader_list, num_shaders, false))
- return NULL;
-
- /* Check that there is only a single definition of each function signature
- * across all shaders.
- */
- for (unsigned i = 0; i < (num_shaders - 1); i++) {
- foreach_list(node, shader_list[i]->ir) {
- ir_function *const f = ((ir_instruction *) node)->as_function();
-
- if (f == NULL)
- continue;
-
- for (unsigned j = i + 1; j < num_shaders; j++) {
- ir_function *const other =
- shader_list[j]->symbols->get_function(f->name);
-
- /* If the other shader has no function (and therefore no function
- * signatures) with the same name, skip to the next shader.
- */
- if (other == NULL)
- continue;
-
- foreach_iter (exec_list_iterator, iter, *f) {
- ir_function_signature *sig =
- (ir_function_signature *) iter.get();
-
- if (!sig->is_defined || sig->is_builtin)
- continue;
-
- ir_function_signature *other_sig =
- other->exact_matching_signature(& sig->parameters);
-
- if ((other_sig != NULL) && other_sig->is_defined
- && !other_sig->is_builtin) {
- linker_error_printf(prog,
- "function `%s' is multiply defined",
- f->name);
- return NULL;
- }
- }
- }
- }
- }
-
- /* Find the shader that defines main, and make a clone of it.
- *
- * Starting with the clone, search for undefined references. If one is
- * found, find the shader that defines it. Clone the reference and add
- * it to the shader. Repeat until there are no undefined references or
- * until a reference cannot be resolved.
- */
- gl_shader *main = NULL;
- for (unsigned i = 0; i < num_shaders; i++) {
- if (get_main_function_signature(shader_list[i]) != NULL) {
- main = shader_list[i];
- break;
- }
- }
-
- if (main == NULL) {
- linker_error_printf(prog, "%s shader lacks `main'\n",
- (shader_list[0]->Type == GL_VERTEX_SHADER)
- ? "vertex" : "fragment");
- return NULL;
- }
-
- gl_shader *linked = ctx->Driver.NewShader(NULL, 0, main->Type);
- linked->ir = new(linked) exec_list;
- clone_ir_list(mem_ctx, linked->ir, main->ir);
-
- populate_symbol_table(linked);
-
- /* The a pointer to the main function in the final linked shader (i.e., the
- * copy of the original shader that contained the main function).
- */
- ir_function_signature *const main_sig = get_main_function_signature(linked);
-
- /* Move any instructions other than variable declarations or function
- * declarations into main.
- */
- exec_node *insertion_point =
- move_non_declarations(linked->ir, (exec_node *) &main_sig->body, false,
- linked);
-
- for (unsigned i = 0; i < num_shaders; i++) {
- if (shader_list[i] == main)
- continue;
-
- insertion_point = move_non_declarations(shader_list[i]->ir,
- insertion_point, true, linked);
- }
-
- /* Resolve initializers for global variables in the linked shader.
- */
- unsigned num_linking_shaders = num_shaders;
- for (unsigned i = 0; i < num_shaders; i++)
- num_linking_shaders += shader_list[i]->num_builtins_to_link;
-
- gl_shader **linking_shaders =
- (gl_shader **) calloc(num_linking_shaders, sizeof(gl_shader *));
-
- memcpy(linking_shaders, shader_list,
- sizeof(linking_shaders[0]) * num_shaders);
-
- unsigned idx = num_shaders;
- for (unsigned i = 0; i < num_shaders; i++) {
- memcpy(&linking_shaders[idx], shader_list[i]->builtins_to_link,
- sizeof(linking_shaders[0]) * shader_list[i]->num_builtins_to_link);
- idx += shader_list[i]->num_builtins_to_link;
- }
-
- assert(idx == num_linking_shaders);
-
- if (!link_function_calls(prog, linked, linking_shaders,
- num_linking_shaders)) {
- ctx->Driver.DeleteShader(ctx, linked);
- linked = NULL;
- }
-
- free(linking_shaders);
-
- /* Make a pass over all variable declarations to ensure that arrays with
- * unspecified sizes have a size specified. The size is inferred from the
- * max_array_access field.
- */
- if (linked != NULL) {
- class array_sizing_visitor : public ir_hierarchical_visitor {
- public:
- virtual ir_visitor_status visit(ir_variable *var)
- {
- if (var->type->is_array() && (var->type->length == 0)) {
- const glsl_type *type =
- glsl_type::get_array_instance(var->type->fields.array,
- var->max_array_access + 1);
-
- assert(type != NULL);
- var->type = type;
- }
-
- return visit_continue;
- }
- } v;
-
- v.run(linked->ir);
- }
-
- return linked;
-}
-
-
-struct uniform_node {
- exec_node link;
- struct gl_uniform *u;
- unsigned slots;
-};
-
-/**
- * Update the sizes of linked shader uniform arrays to the maximum
- * array index used.
- *
- * From page 81 (page 95 of the PDF) of the OpenGL 2.1 spec:
- *
- * If one or more elements of an array are active,
- * GetActiveUniform will return the name of the array in name,
- * subject to the restrictions listed above. The type of the array
- * is returned in type. The size parameter contains the highest
- * array element index used, plus one. The compiler or linker
- * determines the highest index used. There will be only one
- * active uniform reported by the GL per uniform array.
-
- */
-static void
-update_array_sizes(struct gl_shader_program *prog)
-{
- for (unsigned i = 0; i < MESA_SHADER_TYPES; i++) {
- if (prog->_LinkedShaders[i] == NULL)
- continue;
-
- foreach_list(node, prog->_LinkedShaders[i]->ir) {
- ir_variable *const var = ((ir_instruction *) node)->as_variable();
-
- if ((var == NULL) || (var->mode != ir_var_uniform &&
- var->mode != ir_var_in &&
- var->mode != ir_var_out) ||
- !var->type->is_array())
- continue;
-
- unsigned int size = var->max_array_access;
- for (unsigned j = 0; j < MESA_SHADER_TYPES; j++) {
- if (prog->_LinkedShaders[j] == NULL)
- continue;
-
- foreach_list(node2, prog->_LinkedShaders[j]->ir) {
- ir_variable *other_var = ((ir_instruction *) node2)->as_variable();
- if (!other_var)
- continue;
-
- if (strcmp(var->name, other_var->name) == 0 &&
- other_var->max_array_access > size) {
- size = other_var->max_array_access;
- }
- }
- }
-
- if (size + 1 != var->type->fields.array->length) {
- /* If this is a built-in uniform (i.e., it's backed by some
- * fixed-function state), adjust the number of state slots to
- * match the new array size. The number of slots per array entry
- * is not known. It seems safe to assume that the total number of
- * slots is an integer multiple of the number of array elements.
- * Determine the number of slots per array element by dividing by
- * the old (total) size.
- */
- if (var->num_state_slots > 0) {
- var->num_state_slots = (size + 1)
- * (var->num_state_slots / var->type->length);
- }
-
- var->type = glsl_type::get_array_instance(var->type->fields.array,
- size + 1);
- /* FINISHME: We should update the types of array
- * dereferences of this variable now.
- */
- }
- }
- }
-}
-
-static void
-add_uniform(void *mem_ctx, exec_list *uniforms, struct hash_table *ht,
- const char *name, const glsl_type *type, GLenum shader_type,
- unsigned *next_shader_pos, unsigned *total_uniforms)
-{
- if (type->is_record()) {
- for (unsigned int i = 0; i < type->length; i++) {
- const glsl_type *field_type = type->fields.structure[i].type;
- char *field_name = ralloc_asprintf(mem_ctx, "%s.%s", name,
- type->fields.structure[i].name);
-
- add_uniform(mem_ctx, uniforms, ht, field_name, field_type,
- shader_type, next_shader_pos, total_uniforms);
- }
- } else {
- uniform_node *n = (uniform_node *) hash_table_find(ht, name);
- unsigned int vec4_slots;
- const glsl_type *array_elem_type = NULL;
-
- if (type->is_array()) {
- array_elem_type = type->fields.array;
- /* Array of structures. */
- if (array_elem_type->is_record()) {
- for (unsigned int i = 0; i < type->length; i++) {
- char *elem_name = ralloc_asprintf(mem_ctx, "%s[%d]", name, i);
- add_uniform(mem_ctx, uniforms, ht, elem_name, array_elem_type,
- shader_type, next_shader_pos, total_uniforms);
- }
- return;
- }
- }
-
- /* Fix the storage size of samplers at 1 vec4 each. Be sure to pad out
- * vectors to vec4 slots.
- */
- if (type->is_array()) {
- if (array_elem_type->is_sampler())
- vec4_slots = type->length;
- else
- vec4_slots = type->length * array_elem_type->matrix_columns;
- } else if (type->is_sampler()) {
- vec4_slots = 1;
- } else {
- vec4_slots = type->matrix_columns;
- }
-
- if (n == NULL) {
- n = (uniform_node *) calloc(1, sizeof(struct uniform_node));
- n->u = (gl_uniform *) calloc(1, sizeof(struct gl_uniform));
- n->slots = vec4_slots;
-
- n->u->Name = strdup(name);
- n->u->Type = type;
- n->u->VertPos = -1;
- n->u->FragPos = -1;
- n->u->GeomPos = -1;
- (*total_uniforms)++;
-
- hash_table_insert(ht, n, name);
- uniforms->push_tail(& n->link);
- }
-
- switch (shader_type) {
- case GL_VERTEX_SHADER:
- n->u->VertPos = *next_shader_pos;
- break;
- case GL_FRAGMENT_SHADER:
- n->u->FragPos = *next_shader_pos;
- break;
- case GL_GEOMETRY_SHADER:
- n->u->GeomPos = *next_shader_pos;
- break;
- }
-
- (*next_shader_pos) += vec4_slots;
- }
-}
-
-void
-assign_uniform_locations(struct gl_shader_program *prog)
-{
- /* */
- exec_list uniforms;
- unsigned total_uniforms = 0;
- hash_table *ht = hash_table_ctor(32, hash_table_string_hash,
- hash_table_string_compare);
- void *mem_ctx = ralloc_context(NULL);
-
- for (unsigned i = 0; i < MESA_SHADER_TYPES; i++) {
- if (prog->_LinkedShaders[i] == NULL)
- continue;
-
- unsigned next_position = 0;
-
- foreach_list(node, prog->_LinkedShaders[i]->ir) {
- ir_variable *const var = ((ir_instruction *) node)->as_variable();
-
- if ((var == NULL) || (var->mode != ir_var_uniform))
- continue;
-
- if (strncmp(var->name, "gl_", 3) == 0) {
- /* At the moment, we don't allocate uniform locations for
- * builtin uniforms. It's permitted by spec, and we'll
- * likely switch to doing that at some point, but not yet.
- */
- continue;
- }
-
- var->location = next_position;
- add_uniform(mem_ctx, &uniforms, ht, var->name, var->type,
- prog->_LinkedShaders[i]->Type,
- &next_position, &total_uniforms);
- }
- }
-
- ralloc_free(mem_ctx);
-
- gl_uniform_list *ul = (gl_uniform_list *)
- calloc(1, sizeof(gl_uniform_list));
-
- ul->Size = total_uniforms;
- ul->NumUniforms = total_uniforms;
- ul->Uniforms = (gl_uniform *) calloc(total_uniforms, sizeof(gl_uniform));
-
- unsigned idx = 0;
- uniform_node *next;
- for (uniform_node *node = (uniform_node *) uniforms.head
- ; node->link.next != NULL
- ; node = next) {
- next = (uniform_node *) node->link.next;
-
- node->link.remove();
- memcpy(&ul->Uniforms[idx], node->u, sizeof(gl_uniform));
- idx++;
-
- free(node->u);
- free(node);
- }
-
- hash_table_dtor(ht);
-
- prog->Uniforms = ul;
-}
-
-
-/**
- * Find a contiguous set of available bits in a bitmask.
- *
- * \param used_mask Bits representing used (1) and unused (0) locations
- * \param needed_count Number of contiguous bits needed.
- *
- * \return
- * Base location of the available bits on success or -1 on failure.
- */
-int
-find_available_slots(unsigned used_mask, unsigned needed_count)
-{
- unsigned needed_mask = (1 << needed_count) - 1;
- const int max_bit_to_test = (8 * sizeof(used_mask)) - needed_count;
-
- /* The comparison to 32 is redundant, but without it GCC emits "warning:
- * cannot optimize possibly infinite loops" for the loop below.
- */
- if ((needed_count == 0) || (max_bit_to_test < 0) || (max_bit_to_test > 32))
- return -1;
-
- for (int i = 0; i <= max_bit_to_test; i++) {
- if ((needed_mask & ~used_mask) == needed_mask)
- return i;
-
- needed_mask <<= 1;
- }
-
- return -1;
-}
-
-
-bool
-assign_attribute_locations(gl_shader_program *prog, unsigned max_attribute_index)
-{
- /* Mark invalid attribute locations as being used.
- */
- unsigned used_locations = (max_attribute_index >= 32)
- ? ~0 : ~((1 << max_attribute_index) - 1);
-
- gl_shader *const sh = prog->_LinkedShaders[0];
- assert(sh->Type == GL_VERTEX_SHADER);
-
- /* Operate in a total of four passes.
- *
- * 1. Invalidate the location assignments for all vertex shader inputs.
- *
- * 2. Assign locations for inputs that have user-defined (via
- * glBindVertexAttribLocation) locations.
- *
- * 3. Sort the attributes without assigned locations by number of slots
- * required in decreasing order. Fragmentation caused by attribute
- * locations assigned by the application may prevent large attributes
- * from having enough contiguous space.
- *
- * 4. Assign locations to any inputs without assigned locations.
- */
-
- invalidate_variable_locations(sh, ir_var_in, VERT_ATTRIB_GENERIC0);
-
- if (prog->Attributes != NULL) {
- for (unsigned i = 0; i < prog->Attributes->NumParameters; i++) {
- ir_variable *const var =
- sh->symbols->get_variable(prog->Attributes->Parameters[i].Name);
-
- /* Note: attributes that occupy multiple slots, such as arrays or
- * matrices, may appear in the attrib array multiple times.
- */
- if ((var == NULL) || (var->location != -1))
- continue;
-
- /* From page 61 of the OpenGL 4.0 spec:
- *
- * "LinkProgram will fail if the attribute bindings assigned by
- * BindAttribLocation do not leave not enough space to assign a
- * location for an active matrix attribute or an active attribute
- * array, both of which require multiple contiguous generic
- * attributes."
- *
- * Previous versions of the spec contain similar language but omit the
- * bit about attribute arrays.
- *
- * Page 61 of the OpenGL 4.0 spec also says:
- *
- * "It is possible for an application to bind more than one
- * attribute name to the same location. This is referred to as
- * aliasing. This will only work if only one of the aliased
- * attributes is active in the executable program, or if no path
- * through the shader consumes more than one attribute of a set
- * of attributes aliased to the same location. A link error can
- * occur if the linker determines that every path through the
- * shader consumes multiple aliased attributes, but
- * implementations are not required to generate an error in this
- * case."
- *
- * These two paragraphs are either somewhat contradictory, or I don't
- * fully understand one or both of them.
- */
- /* FINISHME: The code as currently written does not support attribute
- * FINISHME: location aliasing (see comment above).
- */
- const int attr = prog->Attributes->Parameters[i].StateIndexes[0];
- const unsigned slots = count_attribute_slots(var->type);
-
- /* Mask representing the contiguous slots that will be used by this
- * attribute.
- */
- const unsigned use_mask = (1 << slots) - 1;
-
- /* Generate a link error if the set of bits requested for this
- * attribute overlaps any previously allocated bits.
- */
- if ((~(use_mask << attr) & used_locations) != used_locations) {
- linker_error_printf(prog,
- "insufficient contiguous attribute locations "
- "available for vertex shader input `%s'",
- var->name);
- return false;
- }
-
- var->location = VERT_ATTRIB_GENERIC0 + attr;
- used_locations |= (use_mask << attr);
- }
- }
-
- /* Temporary storage for the set of attributes that need locations assigned.
- */
- struct temp_attr {
- unsigned slots;
- ir_variable *var;
-
- /* Used below in the call to qsort. */
- static int compare(const void *a, const void *b)
- {
- const temp_attr *const l = (const temp_attr *) a;
- const temp_attr *const r = (const temp_attr *) b;
-
- /* Reversed because we want a descending order sort below. */
- return r->slots - l->slots;
- }
- } to_assign[16];
-
- unsigned num_attr = 0;
-
- foreach_list(node, sh->ir) {
- ir_variable *const var = ((ir_instruction *) node)->as_variable();
-
- if ((var == NULL) || (var->mode != ir_var_in))
- continue;
-
- if (var->explicit_location) {
- const unsigned slots = count_attribute_slots(var->type);
- const unsigned use_mask = (1 << slots) - 1;
- const int attr = var->location - VERT_ATTRIB_GENERIC0;
-
- if ((var->location >= (int)(max_attribute_index + VERT_ATTRIB_GENERIC0))
- || (var->location < 0)) {
- linker_error_printf(prog,
- "invalid explicit location %d specified for "
- "`%s'\n",
- (var->location < 0) ? var->location : attr,
- var->name);
- return false;
- } else if (var->location >= VERT_ATTRIB_GENERIC0) {
- used_locations |= (use_mask << attr);
- }
- }
-
- /* The location was explicitly assigned, nothing to do here.
- */
- if (var->location != -1)
- continue;
-
- to_assign[num_attr].slots = count_attribute_slots(var->type);
- to_assign[num_attr].var = var;
- num_attr++;
- }
-
- /* If all of the attributes were assigned locations by the application (or
- * are built-in attributes with fixed locations), return early. This should
- * be the common case.
- */
- if (num_attr == 0)
- return true;
-
- qsort(to_assign, num_attr, sizeof(to_assign[0]), temp_attr::compare);
-
- /* VERT_ATTRIB_GENERIC0 is a pseudo-alias for VERT_ATTRIB_POS. It can only
- * be explicitly assigned by via glBindAttribLocation. Mark it as reserved
- * to prevent it from being automatically allocated below.
- */
- find_deref_visitor find("gl_Vertex");
- find.run(sh->ir);
- if (find.variable_found())
- used_locations |= (1 << 0);
-
- for (unsigned i = 0; i < num_attr; i++) {
- /* Mask representing the contiguous slots that will be used by this
- * attribute.
- */
- const unsigned use_mask = (1 << to_assign[i].slots) - 1;
-
- int location = find_available_slots(used_locations, to_assign[i].slots);
-
- if (location < 0) {
- linker_error_printf(prog,
- "insufficient contiguous attribute locations "
- "available for vertex shader input `%s'",
- to_assign[i].var->name);
- return false;
- }
-
- to_assign[i].var->location = VERT_ATTRIB_GENERIC0 + location;
- used_locations |= (use_mask << location);
- }
-
- return true;
-}
-
-
-/**
- * Demote shader inputs and outputs that are not used in other stages
- */
-void
-demote_shader_inputs_and_outputs(gl_shader *sh, enum ir_variable_mode mode)
-{
- foreach_list(node, sh->ir) {
- ir_variable *const var = ((ir_instruction *) node)->as_variable();
-
- if ((var == NULL) || (var->mode != int(mode)))
- continue;
-
- /* A shader 'in' or 'out' variable is only really an input or output if
- * its value is used by other shader stages. This will cause the variable
- * to have a location assigned.
- */
- if (var->location == -1) {
- var->mode = ir_var_auto;
- }
- }
-}
-
-
-void
-assign_varying_locations(struct gl_shader_program *prog,
- gl_shader *producer, gl_shader *consumer)
-{
- /* FINISHME: Set dynamically when geometry shader support is added. */
- unsigned output_index = VERT_RESULT_VAR0;
- unsigned input_index = FRAG_ATTRIB_VAR0;
-
- /* Operate in a total of three passes.
- *
- * 1. Assign locations for any matching inputs and outputs.
- *
- * 2. Mark output variables in the producer that do not have locations as
- * not being outputs. This lets the optimizer eliminate them.
- *
- * 3. Mark input variables in the consumer that do not have locations as
- * not being inputs. This lets the optimizer eliminate them.
- */
-
- invalidate_variable_locations(producer, ir_var_out, VERT_RESULT_VAR0);
- invalidate_variable_locations(consumer, ir_var_in, FRAG_ATTRIB_VAR0);
-
- foreach_list(node, producer->ir) {
- ir_variable *const output_var = ((ir_instruction *) node)->as_variable();
-
- if ((output_var == NULL) || (output_var->mode != ir_var_out)
- || (output_var->location != -1))
- continue;
-
- ir_variable *const input_var =
- consumer->symbols->get_variable(output_var->name);
-
- if ((input_var == NULL) || (input_var->mode != ir_var_in))
- continue;
-
- assert(input_var->location == -1);
-
- output_var->location = output_index;
- input_var->location = input_index;
-
- /* FINISHME: Support for "varying" records in GLSL 1.50. */
- assert(!output_var->type->is_record());
-
- if (output_var->type->is_array()) {
- const unsigned slots = output_var->type->length
- * output_var->type->fields.array->matrix_columns;
-
- output_index += slots;
- input_index += slots;
- } else {
- const unsigned slots = output_var->type->matrix_columns;
-
- output_index += slots;
- input_index += slots;
- }
- }
-
- foreach_list(node, consumer->ir) {
- ir_variable *const var = ((ir_instruction *) node)->as_variable();
-
- if ((var == NULL) || (var->mode != ir_var_in))
- continue;
-
- if (var->location == -1) {
- if (prog->Version <= 120) {
- /* On page 25 (page 31 of the PDF) of the GLSL 1.20 spec:
- *
- * Only those varying variables used (i.e. read) in
- * the fragment shader executable must be written to
- * by the vertex shader executable; declaring
- * superfluous varying variables in a vertex shader is
- * permissible.
- *
- * We interpret this text as meaning that the VS must
- * write the variable for the FS to read it. See
- * "glsl1-varying read but not written" in piglit.
- */
-
- linker_error_printf(prog, "fragment shader varying %s not written "
- "by vertex shader\n.", var->name);
- prog->LinkStatus = false;
- }
-
- /* An 'in' variable is only really a shader input if its
- * value is written by the previous stage.
- */
- var->mode = ir_var_auto;
- }
- }
-}
-
-
-void
-link_shaders(struct gl_context *ctx, struct gl_shader_program *prog)
-{
- void *mem_ctx = ralloc_context(NULL); // temporary linker context
-
- prog->LinkStatus = false;
- prog->Validated = false;
- prog->_Used = false;
-
- if (prog->InfoLog != NULL)
- ralloc_free(prog->InfoLog);
-
- prog->InfoLog = ralloc_strdup(NULL, "");
-
- /* Separate the shaders into groups based on their type.
- */
- struct gl_shader **vert_shader_list;
- unsigned num_vert_shaders = 0;
- struct gl_shader **frag_shader_list;
- unsigned num_frag_shaders = 0;
-
- vert_shader_list = (struct gl_shader **)
- calloc(2 * prog->NumShaders, sizeof(struct gl_shader *));
- frag_shader_list = &vert_shader_list[prog->NumShaders];
-
- unsigned min_version = UINT_MAX;
- unsigned max_version = 0;
- for (unsigned i = 0; i < prog->NumShaders; i++) {
- min_version = MIN2(min_version, prog->Shaders[i]->Version);
- max_version = MAX2(max_version, prog->Shaders[i]->Version);
-
- switch (prog->Shaders[i]->Type) {
- case GL_VERTEX_SHADER:
- vert_shader_list[num_vert_shaders] = prog->Shaders[i];
- num_vert_shaders++;
- break;
- case GL_FRAGMENT_SHADER:
- frag_shader_list[num_frag_shaders] = prog->Shaders[i];
- num_frag_shaders++;
- break;
- case GL_GEOMETRY_SHADER:
- /* FINISHME: Support geometry shaders. */
- assert(prog->Shaders[i]->Type != GL_GEOMETRY_SHADER);
- break;
- }
- }
-
- /* Previous to GLSL version 1.30, different compilation units could mix and
- * match shading language versions. With GLSL 1.30 and later, the versions
- * of all shaders must match.
- */
- assert(min_version >= 100);
- assert(max_version <= 130);
- if ((max_version >= 130 || min_version == 100)
- && min_version != max_version) {
- linker_error_printf(prog, "all shaders must use same shading "
- "language version\n");
- goto done;
- }
-
- prog->Version = max_version;
-
- for (unsigned int i = 0; i < MESA_SHADER_TYPES; i++) {
- if (prog->_LinkedShaders[i] != NULL)
- ctx->Driver.DeleteShader(ctx, prog->_LinkedShaders[i]);
-
- prog->_LinkedShaders[i] = NULL;
- }
-
- /* Link all shaders for a particular stage and validate the result.
- */
- if (num_vert_shaders > 0) {
- gl_shader *const sh =
- link_intrastage_shaders(mem_ctx, ctx, prog, vert_shader_list,
- num_vert_shaders);
-
- if (sh == NULL)
- goto done;
-
- if (!validate_vertex_shader_executable(prog, sh))
- goto done;
-
- _mesa_reference_shader(ctx, &prog->_LinkedShaders[MESA_SHADER_VERTEX],
- sh);
- }
-
- if (num_frag_shaders > 0) {
- gl_shader *const sh =
- link_intrastage_shaders(mem_ctx, ctx, prog, frag_shader_list,
- num_frag_shaders);
-
- if (sh == NULL)
- goto done;
-
- if (!validate_fragment_shader_executable(prog, sh))
- goto done;
-
- _mesa_reference_shader(ctx, &prog->_LinkedShaders[MESA_SHADER_FRAGMENT],
- sh);
- }
-
- /* Here begins the inter-stage linking phase. Some initial validation is
- * performed, then locations are assigned for uniforms, attributes, and
- * varyings.
- */
- if (cross_validate_uniforms(prog)) {
- unsigned prev;
-
- for (prev = 0; prev < MESA_SHADER_TYPES; prev++) {
- if (prog->_LinkedShaders[prev] != NULL)
- break;
- }
-
- /* Validate the inputs of each stage with the output of the preceding
- * stage.
- */
- for (unsigned i = prev + 1; i < MESA_SHADER_TYPES; i++) {
- if (prog->_LinkedShaders[i] == NULL)
- continue;
-
- if (!cross_validate_outputs_to_inputs(prog,
- prog->_LinkedShaders[prev],
- prog->_LinkedShaders[i]))
- goto done;
-
- prev = i;
- }
-
- prog->LinkStatus = true;
- }
-
- /* Do common optimization before assigning storage for attributes,
- * uniforms, and varyings. Later optimization could possibly make
- * some of that unused.
- */
- for (unsigned i = 0; i < MESA_SHADER_TYPES; i++) {
- if (prog->_LinkedShaders[i] == NULL)
- continue;
-
- while (do_common_optimization(prog->_LinkedShaders[i]->ir, true, 32))
- ;
- }
-
- update_array_sizes(prog);
-
- assign_uniform_locations(prog);
-
- if (prog->_LinkedShaders[MESA_SHADER_VERTEX] != NULL) {
- /* FINISHME: The value of the max_attribute_index parameter is
- * FINISHME: implementation dependent based on the value of
- * FINISHME: GL_MAX_VERTEX_ATTRIBS. GL_MAX_VERTEX_ATTRIBS must be
- * FINISHME: at least 16, so hardcode 16 for now.
- */
- if (!assign_attribute_locations(prog, 16)) {
- prog->LinkStatus = false;
- goto done;
- }
- }
-
- unsigned prev;
- for (prev = 0; prev < MESA_SHADER_TYPES; prev++) {
- if (prog->_LinkedShaders[prev] != NULL)
- break;
- }
-
- for (unsigned i = prev + 1; i < MESA_SHADER_TYPES; i++) {
- if (prog->_LinkedShaders[i] == NULL)
- continue;
-
- assign_varying_locations(prog,
- prog->_LinkedShaders[prev],
- prog->_LinkedShaders[i]);
- prev = i;
- }
-
- if (prog->_LinkedShaders[MESA_SHADER_VERTEX] != NULL) {
- demote_shader_inputs_and_outputs(prog->_LinkedShaders[MESA_SHADER_VERTEX],
- ir_var_out);
- }
-
- if (prog->_LinkedShaders[MESA_SHADER_GEOMETRY] != NULL) {
- gl_shader *const sh = prog->_LinkedShaders[MESA_SHADER_GEOMETRY];
-
- demote_shader_inputs_and_outputs(sh, ir_var_in);
- demote_shader_inputs_and_outputs(sh, ir_var_inout);
- demote_shader_inputs_and_outputs(sh, ir_var_out);
- }
-
- if (prog->_LinkedShaders[MESA_SHADER_FRAGMENT] != NULL) {
- gl_shader *const sh = prog->_LinkedShaders[MESA_SHADER_FRAGMENT];
-
- demote_shader_inputs_and_outputs(sh, ir_var_in);
- }
-
- /* OpenGL ES requires that a vertex shader and a fragment shader both be
- * present in a linked program. By checking for use of shading language
- * version 1.00, we also catch the GL_ARB_ES2_compatibility case.
- */
- if (ctx->API == API_OPENGLES2 || prog->Version == 100) {
- if (prog->_LinkedShaders[MESA_SHADER_VERTEX] == NULL) {
- linker_error_printf(prog, "program lacks a vertex shader\n");
- prog->LinkStatus = false;
- } else if (prog->_LinkedShaders[MESA_SHADER_FRAGMENT] == NULL) {
- linker_error_printf(prog, "program lacks a fragment shader\n");
- prog->LinkStatus = false;
- }
- }
-
- /* FINISHME: Assign fragment shader output locations. */
-
-done:
- free(vert_shader_list);
-
- for (unsigned i = 0; i < MESA_SHADER_TYPES; i++) {
- if (prog->_LinkedShaders[i] == NULL)
- continue;
-
- /* Retain any live IR, but trash the rest. */
- reparent_ir(prog->_LinkedShaders[i]->ir, prog->_LinkedShaders[i]->ir);
- }
-
- ralloc_free(mem_ctx);
-}
+/*
+ * Copyright © 2010 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+/**
+ * \file linker.cpp
+ * GLSL linker implementation
+ *
+ * Given a set of shaders that are to be linked to generate a final program,
+ * there are three distinct stages.
+ *
+ * In the first stage shaders are partitioned into groups based on the shader
+ * type. All shaders of a particular type (e.g., vertex shaders) are linked
+ * together.
+ *
+ * - Undefined references in each shader are resolve to definitions in
+ * another shader.
+ * - Types and qualifiers of uniforms, outputs, and global variables defined
+ * in multiple shaders with the same name are verified to be the same.
+ * - Initializers for uniforms and global variables defined
+ * in multiple shaders with the same name are verified to be the same.
+ *
+ * The result, in the terminology of the GLSL spec, is a set of shader
+ * executables for each processing unit.
+ *
+ * After the first stage is complete, a series of semantic checks are performed
+ * on each of the shader executables.
+ *
+ * - Each shader executable must define a \c main function.
+ * - Each vertex shader executable must write to \c gl_Position.
+ * - Each fragment shader executable must write to either \c gl_FragData or
+ * \c gl_FragColor.
+ *
+ * In the final stage individual shader executables are linked to create a
+ * complete exectuable.
+ *
+ * - Types of uniforms defined in multiple shader stages with the same name
+ * are verified to be the same.
+ * - Initializers for uniforms defined in multiple shader stages with the
+ * same name are verified to be the same.
+ * - Types and qualifiers of outputs defined in one stage are verified to
+ * be the same as the types and qualifiers of inputs defined with the same
+ * name in a later stage.
+ *
+ * \author Ian Romanick <ian.d.romanick@intel.com>
+ */
+
+#include "main/core.h"
+#include "glsl_symbol_table.h"
+#include "ir.h"
+#include "program.h"
+#include "program/hash_table.h"
+#include "linker.h"
+#include "ir_optimization.h"
+
+extern "C" {
+#include "main/shaderobj.h"
+}
+
+/**
+ * Visitor that determines whether or not a variable is ever written.
+ */
+class find_assignment_visitor : public ir_hierarchical_visitor {
+public:
+ find_assignment_visitor(const char *name)
+ : name(name), found(false)
+ {
+ /* empty */
+ }
+
+ virtual ir_visitor_status visit_enter(ir_assignment *ir)
+ {
+ ir_variable *const var = ir->lhs->variable_referenced();
+
+ if (strcmp(name, var->name) == 0) {
+ found = true;
+ return visit_stop;
+ }
+
+ return visit_continue_with_parent;
+ }
+
+ virtual ir_visitor_status visit_enter(ir_call *ir)
+ {
+ exec_list_iterator sig_iter = ir->get_callee()->parameters.iterator();
+ foreach_iter(exec_list_iterator, iter, *ir) {
+ ir_rvalue *param_rval = (ir_rvalue *)iter.get();
+ ir_variable *sig_param = (ir_variable *)sig_iter.get();
+
+ if (sig_param->mode == ir_var_out ||
+ sig_param->mode == ir_var_inout) {
+ ir_variable *var = param_rval->variable_referenced();
+ if (var && strcmp(name, var->name) == 0) {
+ found = true;
+ return visit_stop;
+ }
+ }
+ sig_iter.next();
+ }
+
+ return visit_continue_with_parent;
+ }
+
+ bool variable_found()
+ {
+ return found;
+ }
+
+private:
+ const char *name; /**< Find writes to a variable with this name. */
+ bool found; /**< Was a write to the variable found? */
+};
+
+
+/**
+ * Visitor that determines whether or not a variable is ever read.
+ */
+class find_deref_visitor : public ir_hierarchical_visitor {
+public:
+ find_deref_visitor(const char *name)
+ : name(name), found(false)
+ {
+ /* empty */
+ }
+
+ virtual ir_visitor_status visit(ir_dereference_variable *ir)
+ {
+ if (strcmp(this->name, ir->var->name) == 0) {
+ this->found = true;
+ return visit_stop;
+ }
+
+ return visit_continue;
+ }
+
+ bool variable_found() const
+ {
+ return this->found;
+ }
+
+private:
+ const char *name; /**< Find writes to a variable with this name. */
+ bool found; /**< Was a write to the variable found? */
+};
+
+
+void
+linker_error_printf(gl_shader_program *prog, const char *fmt, ...)
+{
+ va_list ap;
+
+ ralloc_strcat(&prog->InfoLog, "error: ");
+ va_start(ap, fmt);
+ ralloc_vasprintf_append(&prog->InfoLog, fmt, ap);
+ va_end(ap);
+}
+
+
+void
+invalidate_variable_locations(gl_shader *sh, enum ir_variable_mode mode,
+ int generic_base)
+{
+ foreach_list(node, sh->ir) {
+ ir_variable *const var = ((ir_instruction *) node)->as_variable();
+
+ if ((var == NULL) || (var->mode != (unsigned) mode))
+ continue;
+
+ /* Only assign locations for generic attributes / varyings / etc.
+ */
+ if ((var->location >= generic_base) && !var->explicit_location)
+ var->location = -1;
+ }
+}
+
+
+/**
+ * Determine the number of attribute slots required for a particular type
+ *
+ * This code is here because it implements the language rules of a specific
+ * GLSL version. Since it's a property of the language and not a property of
+ * types in general, it doesn't really belong in glsl_type.
+ */
+unsigned
+count_attribute_slots(const glsl_type *t)
+{
+ /* From page 31 (page 37 of the PDF) of the GLSL 1.50 spec:
+ *
+ * "A scalar input counts the same amount against this limit as a vec4,
+ * so applications may want to consider packing groups of four
+ * unrelated float inputs together into a vector to better utilize the
+ * capabilities of the underlying hardware. A matrix input will use up
+ * multiple locations. The number of locations used will equal the
+ * number of columns in the matrix."
+ *
+ * The spec does not explicitly say how arrays are counted. However, it
+ * should be safe to assume the total number of slots consumed by an array
+ * is the number of entries in the array multiplied by the number of slots
+ * consumed by a single element of the array.
+ */
+
+ if (t->is_array())
+ return t->array_size() * count_attribute_slots(t->element_type());
+
+ if (t->is_matrix())
+ return t->matrix_columns;
+
+ return 1;
+}
+
+
+/**
+ * Verify that a vertex shader executable meets all semantic requirements
+ *
+ * \param shader Vertex shader executable to be verified
+ */
+bool
+validate_vertex_shader_executable(struct gl_shader_program *prog,
+ struct gl_shader *shader)
+{
+ if (shader == NULL)
+ return true;
+
+ find_assignment_visitor find("gl_Position");
+ find.run(shader->ir);
+ if (!find.variable_found()) {
+ linker_error_printf(prog,
+ "vertex shader does not write to `gl_Position'\n");
+ return false;
+ }
+
+ return true;
+}
+
+
+/**
+ * Verify that a fragment shader executable meets all semantic requirements
+ *
+ * \param shader Fragment shader executable to be verified
+ */
+bool
+validate_fragment_shader_executable(struct gl_shader_program *prog,
+ struct gl_shader *shader)
+{
+ if (shader == NULL)
+ return true;
+
+ find_assignment_visitor frag_color("gl_FragColor");
+ find_assignment_visitor frag_data("gl_FragData");
+
+ frag_color.run(shader->ir);
+ frag_data.run(shader->ir);
+
+ if (frag_color.variable_found() && frag_data.variable_found()) {
+ linker_error_printf(prog, "fragment shader writes to both "
+ "`gl_FragColor' and `gl_FragData'\n");
+ return false;
+ }
+
+ return true;
+}
+
+
+/**
+ * Generate a string describing the mode of a variable
+ */
+static const char *
+mode_string(const ir_variable *var)
+{
+ switch (var->mode) {
+ case ir_var_auto:
+ return (var->read_only) ? "global constant" : "global variable";
+
+ case ir_var_uniform: return "uniform";
+ case ir_var_in: return "shader input";
+ case ir_var_out: return "shader output";
+ case ir_var_inout: return "shader inout";
+
+ case ir_var_const_in:
+ case ir_var_temporary:
+ default:
+ assert(!"Should not get here.");
+ return "invalid variable";
+ }
+}
+
+
+/**
+ * Perform validation of global variables used across multiple shaders
+ */
+bool
+cross_validate_globals(struct gl_shader_program *prog,
+ struct gl_shader **shader_list,
+ unsigned num_shaders,
+ bool uniforms_only)
+{
+ /* Examine all of the uniforms in all of the shaders and cross validate
+ * them.
+ */
+ glsl_symbol_table variables;
+ for (unsigned i = 0; i < num_shaders; i++) {
+ if (shader_list[i] == NULL)
+ continue;
+
+ foreach_list(node, shader_list[i]->ir) {
+ ir_variable *const var = ((ir_instruction *) node)->as_variable();
+
+ if (var == NULL)
+ continue;
+
+ if (uniforms_only && (var->mode != ir_var_uniform))
+ continue;
+
+ /* Don't cross validate temporaries that are at global scope. These
+ * will eventually get pulled into the shaders 'main'.
+ */
+ if (var->mode == ir_var_temporary)
+ continue;
+
+ /* If a global with this name has already been seen, verify that the
+ * new instance has the same type. In addition, if the globals have
+ * initializers, the values of the initializers must be the same.
+ */
+ ir_variable *const existing = variables.get_variable(var->name);
+ if (existing != NULL) {
+ if (var->type != existing->type) {
+ /* Consider the types to be "the same" if both types are arrays
+ * of the same type and one of the arrays is implicitly sized.
+ * In addition, set the type of the linked variable to the
+ * explicitly sized array.
+ */
+ if (var->type->is_array()
+ && existing->type->is_array()
+ && (var->type->fields.array == existing->type->fields.array)
+ && ((var->type->length == 0)
+ || (existing->type->length == 0))) {
+ if (var->type->length != 0) {
+ existing->type = var->type;
+ }
+ } else {
+ linker_error_printf(prog, "%s `%s' declared as type "
+ "`%s' and type `%s'\n",
+ mode_string(var),
+ var->name, var->type->name,
+ existing->type->name);
+ return false;
+ }
+ }
+
+ if (var->explicit_location) {
+ if (existing->explicit_location
+ && (var->location != existing->location)) {
+ linker_error_printf(prog, "explicit locations for %s "
+ "`%s' have differing values\n",
+ mode_string(var), var->name);
+ return false;
+ }
+
+ existing->location = var->location;
+ existing->explicit_location = true;
+ }
+
+ /* Validate layout qualifiers for gl_FragDepth.
+ *
+ * From the AMD_conservative_depth spec:
+ * "If gl_FragDepth is redeclared in any fragment shader in
+ * a program, it must be redeclared in all fragment shaders in that
+ * program that have static assignments to gl_FragDepth. All
+ * redeclarations of gl_FragDepth in all fragment shaders in
+ * a single program must have the same set of qualifiers."
+ */
+ if (strcmp(var->name, "gl_FragDepth") == 0) {
+ bool layout_declared = var->depth_layout != ir_depth_layout_none;
+ bool layout_differs = var->depth_layout != existing->depth_layout;
+ if (layout_declared && layout_differs) {
+ linker_error_printf(prog,
+ "All redeclarations of gl_FragDepth in all fragment shaders "
+ "in a single program must have the same set of qualifiers.");
+ }
+ if (var->used && layout_differs) {
+ linker_error_printf(prog,
+ "If gl_FragDepth is redeclared with a layout qualifier in"
+ "any fragment shader, it must be redeclared with the same"
+ "layout qualifier in all fragment shaders that have"
+ "assignments to gl_FragDepth");
+ }
+ }
+
+ /* FINISHME: Handle non-constant initializers.
+ */
+ if (var->constant_value != NULL) {
+ if (existing->constant_value != NULL) {
+ if (!var->constant_value->has_value(existing->constant_value)) {
+ linker_error_printf(prog, "initializers for %s "
+ "`%s' have differing values\n",
+ mode_string(var), var->name);
+ return false;
+ }
+ } else
+ /* If the first-seen instance of a particular uniform did not
+ * have an initializer but a later instance does, copy the
+ * initializer to the version stored in the symbol table.
+ */
+ /* FINISHME: This is wrong. The constant_value field should
+ * FINISHME: not be modified! Imagine a case where a shader
+ * FINISHME: without an initializer is linked in two different
+ * FINISHME: programs with shaders that have differing
+ * FINISHME: initializers. Linking with the first will
+ * FINISHME: modify the shader, and linking with the second
+ * FINISHME: will fail.
+ */
+ existing->constant_value =
+ var->constant_value->clone(ralloc_parent(existing), NULL);
+ }
+
+ if (existing->invariant != var->invariant) {
+ linker_error_printf(prog, "declarations for %s `%s' have "
+ "mismatching invariant qualifiers\n",
+ mode_string(var), var->name);
+ return false;
+ }
+ if (existing->centroid != var->centroid) {
+ linker_error_printf(prog, "declarations for %s `%s' have "
+ "mismatching centroid qualifiers\n",
+ mode_string(var), var->name);
+ return false;
+ }
+ } else
+ variables.add_variable(var);
+ }
+ }
+
+ return true;
+}
+
+
+/**
+ * Perform validation of uniforms used across multiple shader stages
+ */
+bool
+cross_validate_uniforms(struct gl_shader_program *prog)
+{
+ return cross_validate_globals(prog, prog->_LinkedShaders,
+ MESA_SHADER_TYPES, true);
+}
+
+
+/**
+ * Validate that outputs from one stage match inputs of another
+ */
+bool
+cross_validate_outputs_to_inputs(struct gl_shader_program *prog,
+ gl_shader *producer, gl_shader *consumer)
+{
+ glsl_symbol_table parameters;
+ /* FINISHME: Figure these out dynamically. */
+ const char *const producer_stage = "vertex";
+ const char *const consumer_stage = "fragment";
+
+ /* Find all shader outputs in the "producer" stage.
+ */
+ foreach_list(node, producer->ir) {
+ ir_variable *const var = ((ir_instruction *) node)->as_variable();
+
+ /* FINISHME: For geometry shaders, this should also look for inout
+ * FINISHME: variables.
+ */
+ if ((var == NULL) || (var->mode != ir_var_out))
+ continue;
+
+ parameters.add_variable(var);
+ }
+
+
+ /* Find all shader inputs in the "consumer" stage. Any variables that have
+ * matching outputs already in the symbol table must have the same type and
+ * qualifiers.
+ */
+ foreach_list(node, consumer->ir) {
+ ir_variable *const input = ((ir_instruction *) node)->as_variable();
+
+ /* FINISHME: For geometry shaders, this should also look for inout
+ * FINISHME: variables.
+ */
+ if ((input == NULL) || (input->mode != ir_var_in))
+ continue;
+
+ ir_variable *const output = parameters.get_variable(input->name);
+ if (output != NULL) {
+ /* Check that the types match between stages.
+ */
+ if (input->type != output->type) {
+ /* There is a bit of a special case for gl_TexCoord. This
+ * built-in is unsized by default. Applications that variable
+ * access it must redeclare it with a size. There is some
+ * language in the GLSL spec that implies the fragment shader
+ * and vertex shader do not have to agree on this size. Other
+ * driver behave this way, and one or two applications seem to
+ * rely on it.
+ *
+ * Neither declaration needs to be modified here because the array
+ * sizes are fixed later when update_array_sizes is called.
+ *
+ * From page 48 (page 54 of the PDF) of the GLSL 1.10 spec:
+ *
+ * "Unlike user-defined varying variables, the built-in
+ * varying variables don't have a strict one-to-one
+ * correspondence between the vertex language and the
+ * fragment language."
+ */
+ if (!output->type->is_array()
+ || (strncmp("gl_", output->name, 3) != 0)) {
+ linker_error_printf(prog,
+ "%s shader output `%s' declared as "
+ "type `%s', but %s shader input declared "
+ "as type `%s'\n",
+ producer_stage, output->name,
+ output->type->name,
+ consumer_stage, input->type->name);
+ return false;
+ }
+ }
+
+ /* Check that all of the qualifiers match between stages.
+ */
+ if (input->centroid != output->centroid) {
+ linker_error_printf(prog,
+ "%s shader output `%s' %s centroid qualifier, "
+ "but %s shader input %s centroid qualifier\n",
+ producer_stage,
+ output->name,
+ (output->centroid) ? "has" : "lacks",
+ consumer_stage,
+ (input->centroid) ? "has" : "lacks");
+ return false;
+ }
+
+ if (input->invariant != output->invariant) {
+ linker_error_printf(prog,
+ "%s shader output `%s' %s invariant qualifier, "
+ "but %s shader input %s invariant qualifier\n",
+ producer_stage,
+ output->name,
+ (output->invariant) ? "has" : "lacks",
+ consumer_stage,
+ (input->invariant) ? "has" : "lacks");
+ return false;
+ }
+
+ if (input->interpolation != output->interpolation) {
+ linker_error_printf(prog,
+ "%s shader output `%s' specifies %s "
+ "interpolation qualifier, "
+ "but %s shader input specifies %s "
+ "interpolation qualifier\n",
+ producer_stage,
+ output->name,
+ output->interpolation_string(),
+ consumer_stage,
+ input->interpolation_string());
+ return false;
+ }
+ }
+ }
+
+ return true;
+}
+
+
+/**
+ * Populates a shaders symbol table with all global declarations
+ */
+static void
+populate_symbol_table(gl_shader *sh)
+{
+ sh->symbols = new(sh) glsl_symbol_table;
+
+ foreach_list(node, sh->ir) {
+ ir_instruction *const inst = (ir_instruction *) node;
+ ir_variable *var;
+ ir_function *func;
+
+ if ((func = inst->as_function()) != NULL) {
+ sh->symbols->add_function(func);
+ } else if ((var = inst->as_variable()) != NULL) {
+ sh->symbols->add_variable(var);
+ }
+ }
+}
+
+
+/**
+ * Remap variables referenced in an instruction tree
+ *
+ * This is used when instruction trees are cloned from one shader and placed in
+ * another. These trees will contain references to \c ir_variable nodes that
+ * do not exist in the target shader. This function finds these \c ir_variable
+ * references and replaces the references with matching variables in the target
+ * shader.
+ *
+ * If there is no matching variable in the target shader, a clone of the
+ * \c ir_variable is made and added to the target shader. The new variable is
+ * added to \b both the instruction stream and the symbol table.
+ *
+ * \param inst IR tree that is to be processed.
+ * \param symbols Symbol table containing global scope symbols in the
+ * linked shader.
+ * \param instructions Instruction stream where new variable declarations
+ * should be added.
+ */
+void
+remap_variables(ir_instruction *inst, struct gl_shader *target,
+ hash_table *temps)
+{
+ class remap_visitor : public ir_hierarchical_visitor {
+ public:
+ remap_visitor(struct gl_shader *target,
+ hash_table *temps)
+ {
+ this->target = target;
+ this->symbols = target->symbols;
+ this->instructions = target->ir;
+ this->temps = temps;
+ }
+
+ virtual ir_visitor_status visit(ir_dereference_variable *ir)
+ {
+ if (ir->var->mode == ir_var_temporary) {
+ ir_variable *var = (ir_variable *) hash_table_find(temps, ir->var);
+
+ assert(var != NULL);
+ ir->var = var;
+ return visit_continue;
+ }
+
+ ir_variable *const existing =
+ this->symbols->get_variable(ir->var->name);
+ if (existing != NULL)
+ ir->var = existing;
+ else {
+ ir_variable *copy = ir->var->clone(this->target, NULL);
+
+ this->symbols->add_variable(copy);
+ this->instructions->push_head(copy);
+ ir->var = copy;
+ }
+
+ return visit_continue;
+ }
+
+ private:
+ struct gl_shader *target;
+ glsl_symbol_table *symbols;
+ exec_list *instructions;
+ hash_table *temps;
+ };
+
+ remap_visitor v(target, temps);
+
+ inst->accept(&v);
+}
+
+
+/**
+ * Move non-declarations from one instruction stream to another
+ *
+ * The intended usage pattern of this function is to pass the pointer to the
+ * head sentinel of a list (i.e., a pointer to the list cast to an \c exec_node
+ * pointer) for \c last and \c false for \c make_copies on the first
+ * call. Successive calls pass the return value of the previous call for
+ * \c last and \c true for \c make_copies.
+ *
+ * \param instructions Source instruction stream
+ * \param last Instruction after which new instructions should be
+ * inserted in the target instruction stream
+ * \param make_copies Flag selecting whether instructions in \c instructions
+ * should be copied (via \c ir_instruction::clone) into the
+ * target list or moved.
+ *
+ * \return
+ * The new "last" instruction in the target instruction stream. This pointer
+ * is suitable for use as the \c last parameter of a later call to this
+ * function.
+ */
+exec_node *
+move_non_declarations(exec_list *instructions, exec_node *last,
+ bool make_copies, gl_shader *target)
+{
+ hash_table *temps = NULL;
+
+ if (make_copies)
+ temps = hash_table_ctor(0, hash_table_pointer_hash,
+ hash_table_pointer_compare);
+
+ foreach_list_safe(node, instructions) {
+ ir_instruction *inst = (ir_instruction *) node;
+
+ if (inst->as_function())
+ continue;
+
+ ir_variable *var = inst->as_variable();
+ if ((var != NULL) && (var->mode != ir_var_temporary))
+ continue;
+
+ assert(inst->as_assignment()
+ || ((var != NULL) && (var->mode == ir_var_temporary)));
+
+ if (make_copies) {
+ inst = inst->clone(target, NULL);
+
+ if (var != NULL)
+ hash_table_insert(temps, inst, var);
+ else
+ remap_variables(inst, target, temps);
+ } else {
+ inst->remove();
+ }
+
+ last->insert_after(inst);
+ last = inst;
+ }
+
+ if (make_copies)
+ hash_table_dtor(temps);
+
+ return last;
+}
+
+/**
+ * Get the function signature for main from a shader
+ */
+static ir_function_signature *
+get_main_function_signature(gl_shader *sh)
+{
+ ir_function *const f = sh->symbols->get_function("main");
+ if (f != NULL) {
+ exec_list void_parameters;
+
+ /* Look for the 'void main()' signature and ensure that it's defined.
+ * This keeps the linker from accidentally pick a shader that just
+ * contains a prototype for main.
+ *
+ * We don't have to check for multiple definitions of main (in multiple
+ * shaders) because that would have already been caught above.
+ */
+ ir_function_signature *sig = f->matching_signature(&void_parameters);
+ if ((sig != NULL) && sig->is_defined) {
+ return sig;
+ }
+ }
+
+ return NULL;
+}
+
+
+/**
+ * Combine a group of shaders for a single stage to generate a linked shader
+ *
+ * \note
+ * If this function is supplied a single shader, it is cloned, and the new
+ * shader is returned.
+ */
+static struct gl_shader *
+link_intrastage_shaders(void *mem_ctx,
+ struct gl_context *ctx,
+ struct gl_shader_program *prog,
+ struct gl_shader **shader_list,
+ unsigned num_shaders)
+{
+ /* Check that global variables defined in multiple shaders are consistent.
+ */
+ if (!cross_validate_globals(prog, shader_list, num_shaders, false))
+ return NULL;
+
+ /* Check that there is only a single definition of each function signature
+ * across all shaders.
+ */
+ for (unsigned i = 0; i < (num_shaders - 1); i++) {
+ foreach_list(node, shader_list[i]->ir) {
+ ir_function *const f = ((ir_instruction *) node)->as_function();
+
+ if (f == NULL)
+ continue;
+
+ for (unsigned j = i + 1; j < num_shaders; j++) {
+ ir_function *const other =
+ shader_list[j]->symbols->get_function(f->name);
+
+ /* If the other shader has no function (and therefore no function
+ * signatures) with the same name, skip to the next shader.
+ */
+ if (other == NULL)
+ continue;
+
+ foreach_iter (exec_list_iterator, iter, *f) {
+ ir_function_signature *sig =
+ (ir_function_signature *) iter.get();
+
+ if (!sig->is_defined || sig->is_builtin)
+ continue;
+
+ ir_function_signature *other_sig =
+ other->exact_matching_signature(& sig->parameters);
+
+ if ((other_sig != NULL) && other_sig->is_defined
+ && !other_sig->is_builtin) {
+ linker_error_printf(prog,
+ "function `%s' is multiply defined",
+ f->name);
+ return NULL;
+ }
+ }
+ }
+ }
+ }
+
+ /* Find the shader that defines main, and make a clone of it.
+ *
+ * Starting with the clone, search for undefined references. If one is
+ * found, find the shader that defines it. Clone the reference and add
+ * it to the shader. Repeat until there are no undefined references or
+ * until a reference cannot be resolved.
+ */
+ gl_shader *main = NULL;
+ for (unsigned i = 0; i < num_shaders; i++) {
+ if (get_main_function_signature(shader_list[i]) != NULL) {
+ main = shader_list[i];
+ break;
+ }
+ }
+
+ if (main == NULL) {
+ linker_error_printf(prog, "%s shader lacks `main'\n",
+ (shader_list[0]->Type == GL_VERTEX_SHADER)
+ ? "vertex" : "fragment");
+ return NULL;
+ }
+
+ gl_shader *linked = ctx->Driver.NewShader(NULL, 0, main->Type);
+ linked->ir = new(linked) exec_list;
+ clone_ir_list(mem_ctx, linked->ir, main->ir);
+
+ populate_symbol_table(linked);
+
+ /* The a pointer to the main function in the final linked shader (i.e., the
+ * copy of the original shader that contained the main function).
+ */
+ ir_function_signature *const main_sig = get_main_function_signature(linked);
+
+ /* Move any instructions other than variable declarations or function
+ * declarations into main.
+ */
+ exec_node *insertion_point =
+ move_non_declarations(linked->ir, (exec_node *) &main_sig->body, false,
+ linked);
+
+ for (unsigned i = 0; i < num_shaders; i++) {
+ if (shader_list[i] == main)
+ continue;
+
+ insertion_point = move_non_declarations(shader_list[i]->ir,
+ insertion_point, true, linked);
+ }
+
+ /* Resolve initializers for global variables in the linked shader.
+ */
+ unsigned num_linking_shaders = num_shaders;
+ for (unsigned i = 0; i < num_shaders; i++)
+ num_linking_shaders += shader_list[i]->num_builtins_to_link;
+
+ gl_shader **linking_shaders =
+ (gl_shader **) calloc(num_linking_shaders, sizeof(gl_shader *));
+
+ memcpy(linking_shaders, shader_list,
+ sizeof(linking_shaders[0]) * num_shaders);
+
+ unsigned idx = num_shaders;
+ for (unsigned i = 0; i < num_shaders; i++) {
+ memcpy(&linking_shaders[idx], shader_list[i]->builtins_to_link,
+ sizeof(linking_shaders[0]) * shader_list[i]->num_builtins_to_link);
+ idx += shader_list[i]->num_builtins_to_link;
+ }
+
+ assert(idx == num_linking_shaders);
+
+ if (!link_function_calls(prog, linked, linking_shaders,
+ num_linking_shaders)) {
+ ctx->Driver.DeleteShader(ctx, linked);
+ linked = NULL;
+ }
+
+ free(linking_shaders);
+
+ /* Make a pass over all variable declarations to ensure that arrays with
+ * unspecified sizes have a size specified. The size is inferred from the
+ * max_array_access field.
+ */
+ if (linked != NULL) {
+ class array_sizing_visitor : public ir_hierarchical_visitor {
+ public:
+ virtual ir_visitor_status visit(ir_variable *var)
+ {
+ if (var->type->is_array() && (var->type->length == 0)) {
+ const glsl_type *type =
+ glsl_type::get_array_instance(var->type->fields.array,
+ var->max_array_access + 1);
+
+ assert(type != NULL);
+ var->type = type;
+ }
+
+ return visit_continue;
+ }
+ } v;
+
+ v.run(linked->ir);
+ }
+
+ return linked;
+}
+
+
+struct uniform_node {
+ exec_node link;
+ struct gl_uniform *u;
+ unsigned slots;
+};
+
+/**
+ * Update the sizes of linked shader uniform arrays to the maximum
+ * array index used.
+ *
+ * From page 81 (page 95 of the PDF) of the OpenGL 2.1 spec:
+ *
+ * If one or more elements of an array are active,
+ * GetActiveUniform will return the name of the array in name,
+ * subject to the restrictions listed above. The type of the array
+ * is returned in type. The size parameter contains the highest
+ * array element index used, plus one. The compiler or linker
+ * determines the highest index used. There will be only one
+ * active uniform reported by the GL per uniform array.
+
+ */
+static void
+update_array_sizes(struct gl_shader_program *prog)
+{
+ for (unsigned i = 0; i < MESA_SHADER_TYPES; i++) {
+ if (prog->_LinkedShaders[i] == NULL)
+ continue;
+
+ foreach_list(node, prog->_LinkedShaders[i]->ir) {
+ ir_variable *const var = ((ir_instruction *) node)->as_variable();
+
+ if ((var == NULL) || (var->mode != ir_var_uniform &&
+ var->mode != ir_var_in &&
+ var->mode != ir_var_out) ||
+ !var->type->is_array())
+ continue;
+
+ unsigned int size = var->max_array_access;
+ for (unsigned j = 0; j < MESA_SHADER_TYPES; j++) {
+ if (prog->_LinkedShaders[j] == NULL)
+ continue;
+
+ foreach_list(node2, prog->_LinkedShaders[j]->ir) {
+ ir_variable *other_var = ((ir_instruction *) node2)->as_variable();
+ if (!other_var)
+ continue;
+
+ if (strcmp(var->name, other_var->name) == 0 &&
+ other_var->max_array_access > size) {
+ size = other_var->max_array_access;
+ }
+ }
+ }
+
+ if (size + 1 != var->type->fields.array->length) {
+ /* If this is a built-in uniform (i.e., it's backed by some
+ * fixed-function state), adjust the number of state slots to
+ * match the new array size. The number of slots per array entry
+ * is not known. It seems safe to assume that the total number of
+ * slots is an integer multiple of the number of array elements.
+ * Determine the number of slots per array element by dividing by
+ * the old (total) size.
+ */
+ if (var->num_state_slots > 0) {
+ var->num_state_slots = (size + 1)
+ * (var->num_state_slots / var->type->length);
+ }
+
+ var->type = glsl_type::get_array_instance(var->type->fields.array,
+ size + 1);
+ /* FINISHME: We should update the types of array
+ * dereferences of this variable now.
+ */
+ }
+ }
+ }
+}
+
+static void
+add_uniform(void *mem_ctx, exec_list *uniforms, struct hash_table *ht,
+ const char *name, const glsl_type *type, GLenum shader_type,
+ unsigned *next_shader_pos, unsigned *total_uniforms)
+{
+ if (type->is_record()) {
+ for (unsigned int i = 0; i < type->length; i++) {
+ const glsl_type *field_type = type->fields.structure[i].type;
+ char *field_name = ralloc_asprintf(mem_ctx, "%s.%s", name,
+ type->fields.structure[i].name);
+
+ add_uniform(mem_ctx, uniforms, ht, field_name, field_type,
+ shader_type, next_shader_pos, total_uniforms);
+ }
+ } else {
+ uniform_node *n = (uniform_node *) hash_table_find(ht, name);
+ unsigned int vec4_slots;
+ const glsl_type *array_elem_type = NULL;
+
+ if (type->is_array()) {
+ array_elem_type = type->fields.array;
+ /* Array of structures. */
+ if (array_elem_type->is_record()) {
+ for (unsigned int i = 0; i < type->length; i++) {
+ char *elem_name = ralloc_asprintf(mem_ctx, "%s[%d]", name, i);
+ add_uniform(mem_ctx, uniforms, ht, elem_name, array_elem_type,
+ shader_type, next_shader_pos, total_uniforms);
+ }
+ return;
+ }
+ }
+
+ /* Fix the storage size of samplers at 1 vec4 each. Be sure to pad out
+ * vectors to vec4 slots.
+ */
+ if (type->is_array()) {
+ if (array_elem_type->is_sampler())
+ vec4_slots = type->length;
+ else
+ vec4_slots = type->length * array_elem_type->matrix_columns;
+ } else if (type->is_sampler()) {
+ vec4_slots = 1;
+ } else {
+ vec4_slots = type->matrix_columns;
+ }
+
+ if (n == NULL) {
+ n = (uniform_node *) calloc(1, sizeof(struct uniform_node));
+ n->u = (gl_uniform *) calloc(1, sizeof(struct gl_uniform));
+ n->slots = vec4_slots;
+
+ n->u->Name = strdup(name);
+ n->u->Type = type;
+ n->u->VertPos = -1;
+ n->u->FragPos = -1;
+ n->u->GeomPos = -1;
+ (*total_uniforms)++;
+
+ hash_table_insert(ht, n, name);
+ uniforms->push_tail(& n->link);
+ }
+
+ switch (shader_type) {
+ case GL_VERTEX_SHADER:
+ n->u->VertPos = *next_shader_pos;
+ break;
+ case GL_FRAGMENT_SHADER:
+ n->u->FragPos = *next_shader_pos;
+ break;
+ case GL_GEOMETRY_SHADER:
+ n->u->GeomPos = *next_shader_pos;
+ break;
+ }
+
+ (*next_shader_pos) += vec4_slots;
+ }
+}
+
+void
+assign_uniform_locations(struct gl_shader_program *prog)
+{
+ /* */
+ exec_list uniforms;
+ unsigned total_uniforms = 0;
+ hash_table *ht = hash_table_ctor(32, hash_table_string_hash,
+ hash_table_string_compare);
+ void *mem_ctx = ralloc_context(NULL);
+
+ for (unsigned i = 0; i < MESA_SHADER_TYPES; i++) {
+ if (prog->_LinkedShaders[i] == NULL)
+ continue;
+
+ unsigned next_position = 0;
+
+ foreach_list(node, prog->_LinkedShaders[i]->ir) {
+ ir_variable *const var = ((ir_instruction *) node)->as_variable();
+
+ if ((var == NULL) || (var->mode != ir_var_uniform))
+ continue;
+
+ if (strncmp(var->name, "gl_", 3) == 0) {
+ /* At the moment, we don't allocate uniform locations for
+ * builtin uniforms. It's permitted by spec, and we'll
+ * likely switch to doing that at some point, but not yet.
+ */
+ continue;
+ }
+
+ var->location = next_position;
+ add_uniform(mem_ctx, &uniforms, ht, var->name, var->type,
+ prog->_LinkedShaders[i]->Type,
+ &next_position, &total_uniforms);
+ }
+ }
+
+ ralloc_free(mem_ctx);
+
+ gl_uniform_list *ul = (gl_uniform_list *)
+ calloc(1, sizeof(gl_uniform_list));
+
+ ul->Size = total_uniforms;
+ ul->NumUniforms = total_uniforms;
+ ul->Uniforms = (gl_uniform *) calloc(total_uniforms, sizeof(gl_uniform));
+
+ unsigned idx = 0;
+ uniform_node *next;
+ for (uniform_node *node = (uniform_node *) uniforms.head
+ ; node->link.next != NULL
+ ; node = next) {
+ next = (uniform_node *) node->link.next;
+
+ node->link.remove();
+ memcpy(&ul->Uniforms[idx], node->u, sizeof(gl_uniform));
+ idx++;
+
+ free(node->u);
+ free(node);
+ }
+
+ hash_table_dtor(ht);
+
+ prog->Uniforms = ul;
+}
+
+
+/**
+ * Find a contiguous set of available bits in a bitmask.
+ *
+ * \param used_mask Bits representing used (1) and unused (0) locations
+ * \param needed_count Number of contiguous bits needed.
+ *
+ * \return
+ * Base location of the available bits on success or -1 on failure.
+ */
+int
+find_available_slots(unsigned used_mask, unsigned needed_count)
+{
+ unsigned needed_mask = (1 << needed_count) - 1;
+ const int max_bit_to_test = (8 * sizeof(used_mask)) - needed_count;
+
+ /* The comparison to 32 is redundant, but without it GCC emits "warning:
+ * cannot optimize possibly infinite loops" for the loop below.
+ */
+ if ((needed_count == 0) || (max_bit_to_test < 0) || (max_bit_to_test > 32))
+ return -1;
+
+ for (int i = 0; i <= max_bit_to_test; i++) {
+ if ((needed_mask & ~used_mask) == needed_mask)
+ return i;
+
+ needed_mask <<= 1;
+ }
+
+ return -1;
+}
+
+
+bool
+assign_attribute_locations(gl_shader_program *prog, unsigned max_attribute_index)
+{
+ /* Mark invalid attribute locations as being used.
+ */
+ unsigned used_locations = (max_attribute_index >= 32)
+ ? ~0 : ~((1 << max_attribute_index) - 1);
+
+ gl_shader *const sh = prog->_LinkedShaders[0];
+ assert(sh->Type == GL_VERTEX_SHADER);
+
+ /* Operate in a total of four passes.
+ *
+ * 1. Invalidate the location assignments for all vertex shader inputs.
+ *
+ * 2. Assign locations for inputs that have user-defined (via
+ * glBindVertexAttribLocation) locations.
+ *
+ * 3. Sort the attributes without assigned locations by number of slots
+ * required in decreasing order. Fragmentation caused by attribute
+ * locations assigned by the application may prevent large attributes
+ * from having enough contiguous space.
+ *
+ * 4. Assign locations to any inputs without assigned locations.
+ */
+
+ invalidate_variable_locations(sh, ir_var_in, VERT_ATTRIB_GENERIC0);
+
+ if (prog->Attributes != NULL) {
+ for (unsigned i = 0; i < prog->Attributes->NumParameters; i++) {
+ ir_variable *const var =
+ sh->symbols->get_variable(prog->Attributes->Parameters[i].Name);
+
+ /* Note: attributes that occupy multiple slots, such as arrays or
+ * matrices, may appear in the attrib array multiple times.
+ */
+ if ((var == NULL) || (var->location != -1))
+ continue;
+
+ /* From page 61 of the OpenGL 4.0 spec:
+ *
+ * "LinkProgram will fail if the attribute bindings assigned by
+ * BindAttribLocation do not leave not enough space to assign a
+ * location for an active matrix attribute or an active attribute
+ * array, both of which require multiple contiguous generic
+ * attributes."
+ *
+ * Previous versions of the spec contain similar language but omit the
+ * bit about attribute arrays.
+ *
+ * Page 61 of the OpenGL 4.0 spec also says:
+ *
+ * "It is possible for an application to bind more than one
+ * attribute name to the same location. This is referred to as
+ * aliasing. This will only work if only one of the aliased
+ * attributes is active in the executable program, or if no path
+ * through the shader consumes more than one attribute of a set
+ * of attributes aliased to the same location. A link error can
+ * occur if the linker determines that every path through the
+ * shader consumes multiple aliased attributes, but
+ * implementations are not required to generate an error in this
+ * case."
+ *
+ * These two paragraphs are either somewhat contradictory, or I don't
+ * fully understand one or both of them.
+ */
+ /* FINISHME: The code as currently written does not support attribute
+ * FINISHME: location aliasing (see comment above).
+ */
+ const int attr = prog->Attributes->Parameters[i].StateIndexes[0];
+ const unsigned slots = count_attribute_slots(var->type);
+
+ /* Mask representing the contiguous slots that will be used by this
+ * attribute.
+ */
+ const unsigned use_mask = (1 << slots) - 1;
+
+ /* Generate a link error if the set of bits requested for this
+ * attribute overlaps any previously allocated bits.
+ */
+ if ((~(use_mask << attr) & used_locations) != used_locations) {
+ linker_error_printf(prog,
+ "insufficient contiguous attribute locations "
+ "available for vertex shader input `%s'",
+ var->name);
+ return false;
+ }
+
+ var->location = VERT_ATTRIB_GENERIC0 + attr;
+ used_locations |= (use_mask << attr);
+ }
+ }
+
+ /* Temporary storage for the set of attributes that need locations assigned.
+ */
+ struct temp_attr {
+ unsigned slots;
+ ir_variable *var;
+
+ /* Used below in the call to qsort. */
+ static int compare(const void *a, const void *b)
+ {
+ const temp_attr *const l = (const temp_attr *) a;
+ const temp_attr *const r = (const temp_attr *) b;
+
+ /* Reversed because we want a descending order sort below. */
+ return r->slots - l->slots;
+ }
+ } to_assign[16];
+
+ unsigned num_attr = 0;
+
+ foreach_list(node, sh->ir) {
+ ir_variable *const var = ((ir_instruction *) node)->as_variable();
+
+ if ((var == NULL) || (var->mode != ir_var_in))
+ continue;
+
+ if (var->explicit_location) {
+ const unsigned slots = count_attribute_slots(var->type);
+ const unsigned use_mask = (1 << slots) - 1;
+ const int attr = var->location - VERT_ATTRIB_GENERIC0;
+
+ if ((var->location >= (int)(max_attribute_index + VERT_ATTRIB_GENERIC0))
+ || (var->location < 0)) {
+ linker_error_printf(prog,
+ "invalid explicit location %d specified for "
+ "`%s'\n",
+ (var->location < 0) ? var->location : attr,
+ var->name);
+ return false;
+ } else if (var->location >= VERT_ATTRIB_GENERIC0) {
+ used_locations |= (use_mask << attr);
+ }
+ }
+
+ /* The location was explicitly assigned, nothing to do here.
+ */
+ if (var->location != -1)
+ continue;
+
+ to_assign[num_attr].slots = count_attribute_slots(var->type);
+ to_assign[num_attr].var = var;
+ num_attr++;
+ }
+
+ /* If all of the attributes were assigned locations by the application (or
+ * are built-in attributes with fixed locations), return early. This should
+ * be the common case.
+ */
+ if (num_attr == 0)
+ return true;
+
+ qsort(to_assign, num_attr, sizeof(to_assign[0]), temp_attr::compare);
+
+ /* VERT_ATTRIB_GENERIC0 is a pseudo-alias for VERT_ATTRIB_POS. It can only
+ * be explicitly assigned by via glBindAttribLocation. Mark it as reserved
+ * to prevent it from being automatically allocated below.
+ */
+ find_deref_visitor find("gl_Vertex");
+ find.run(sh->ir);
+ if (find.variable_found())
+ used_locations |= (1 << 0);
+
+ for (unsigned i = 0; i < num_attr; i++) {
+ /* Mask representing the contiguous slots that will be used by this
+ * attribute.
+ */
+ const unsigned use_mask = (1 << to_assign[i].slots) - 1;
+
+ int location = find_available_slots(used_locations, to_assign[i].slots);
+
+ if (location < 0) {
+ linker_error_printf(prog,
+ "insufficient contiguous attribute locations "
+ "available for vertex shader input `%s'",
+ to_assign[i].var->name);
+ return false;
+ }
+
+ to_assign[i].var->location = VERT_ATTRIB_GENERIC0 + location;
+ used_locations |= (use_mask << location);
+ }
+
+ return true;
+}
+
+
+/**
+ * Demote shader inputs and outputs that are not used in other stages
+ */
+void
+demote_shader_inputs_and_outputs(gl_shader *sh, enum ir_variable_mode mode)
+{
+ foreach_list(node, sh->ir) {
+ ir_variable *const var = ((ir_instruction *) node)->as_variable();
+
+ if ((var == NULL) || (var->mode != int(mode)))
+ continue;
+
+ /* A shader 'in' or 'out' variable is only really an input or output if
+ * its value is used by other shader stages. This will cause the variable
+ * to have a location assigned.
+ */
+ if (var->location == -1) {
+ var->mode = ir_var_auto;
+ }
+ }
+}
+
+
+void
+assign_varying_locations(struct gl_shader_program *prog,
+ gl_shader *producer, gl_shader *consumer)
+{
+ /* FINISHME: Set dynamically when geometry shader support is added. */
+ unsigned output_index = VERT_RESULT_VAR0;
+ unsigned input_index = FRAG_ATTRIB_VAR0;
+
+ /* Operate in a total of three passes.
+ *
+ * 1. Assign locations for any matching inputs and outputs.
+ *
+ * 2. Mark output variables in the producer that do not have locations as
+ * not being outputs. This lets the optimizer eliminate them.
+ *
+ * 3. Mark input variables in the consumer that do not have locations as
+ * not being inputs. This lets the optimizer eliminate them.
+ */
+
+ invalidate_variable_locations(producer, ir_var_out, VERT_RESULT_VAR0);
+ invalidate_variable_locations(consumer, ir_var_in, FRAG_ATTRIB_VAR0);
+
+ foreach_list(node, producer->ir) {
+ ir_variable *const output_var = ((ir_instruction *) node)->as_variable();
+
+ if ((output_var == NULL) || (output_var->mode != ir_var_out)
+ || (output_var->location != -1))
+ continue;
+
+ ir_variable *const input_var =
+ consumer->symbols->get_variable(output_var->name);
+
+ if ((input_var == NULL) || (input_var->mode != ir_var_in))
+ continue;
+
+ assert(input_var->location == -1);
+
+ output_var->location = output_index;
+ input_var->location = input_index;
+
+ /* FINISHME: Support for "varying" records in GLSL 1.50. */
+ assert(!output_var->type->is_record());
+
+ if (output_var->type->is_array()) {
+ const unsigned slots = output_var->type->length
+ * output_var->type->fields.array->matrix_columns;
+
+ output_index += slots;
+ input_index += slots;
+ } else {
+ const unsigned slots = output_var->type->matrix_columns;
+
+ output_index += slots;
+ input_index += slots;
+ }
+ }
+
+ foreach_list(node, consumer->ir) {
+ ir_variable *const var = ((ir_instruction *) node)->as_variable();
+
+ if ((var == NULL) || (var->mode != ir_var_in))
+ continue;
+
+ if (var->location == -1) {
+ if (prog->Version <= 120) {
+ /* On page 25 (page 31 of the PDF) of the GLSL 1.20 spec:
+ *
+ * Only those varying variables used (i.e. read) in
+ * the fragment shader executable must be written to
+ * by the vertex shader executable; declaring
+ * superfluous varying variables in a vertex shader is
+ * permissible.
+ *
+ * We interpret this text as meaning that the VS must
+ * write the variable for the FS to read it. See
+ * "glsl1-varying read but not written" in piglit.
+ */
+
+ linker_error_printf(prog, "fragment shader varying %s not written "
+ "by vertex shader\n.", var->name);
+ prog->LinkStatus = false;
+ }
+
+ /* An 'in' variable is only really a shader input if its
+ * value is written by the previous stage.
+ */
+ var->mode = ir_var_auto;
+ }
+ }
+}
+
+
+void
+link_shaders(struct gl_context *ctx, struct gl_shader_program *prog)
+{
+ void *mem_ctx = ralloc_context(NULL); // temporary linker context
+
+ prog->LinkStatus = false;
+ prog->Validated = false;
+ prog->_Used = false;
+
+ if (prog->InfoLog != NULL)
+ ralloc_free(prog->InfoLog);
+
+ prog->InfoLog = ralloc_strdup(NULL, "");
+
+ /* Separate the shaders into groups based on their type.
+ */
+ struct gl_shader **vert_shader_list;
+ unsigned num_vert_shaders = 0;
+ struct gl_shader **frag_shader_list;
+ unsigned num_frag_shaders = 0;
+
+ vert_shader_list = (struct gl_shader **)
+ calloc(2 * prog->NumShaders, sizeof(struct gl_shader *));
+ frag_shader_list = &vert_shader_list[prog->NumShaders];
+
+ unsigned min_version = UINT_MAX;
+ unsigned max_version = 0;
+ for (unsigned i = 0; i < prog->NumShaders; i++) {
+ min_version = MIN2(min_version, prog->Shaders[i]->Version);
+ max_version = MAX2(max_version, prog->Shaders[i]->Version);
+
+ switch (prog->Shaders[i]->Type) {
+ case GL_VERTEX_SHADER:
+ vert_shader_list[num_vert_shaders] = prog->Shaders[i];
+ num_vert_shaders++;
+ break;
+ case GL_FRAGMENT_SHADER:
+ frag_shader_list[num_frag_shaders] = prog->Shaders[i];
+ num_frag_shaders++;
+ break;
+ case GL_GEOMETRY_SHADER:
+ /* FINISHME: Support geometry shaders. */
+ assert(prog->Shaders[i]->Type != GL_GEOMETRY_SHADER);
+ break;
+ }
+ }
+
+ /* Previous to GLSL version 1.30, different compilation units could mix and
+ * match shading language versions. With GLSL 1.30 and later, the versions
+ * of all shaders must match.
+ */
+ assert(min_version >= 100);
+ assert(max_version <= 130);
+ if ((max_version >= 130 || min_version == 100)
+ && min_version != max_version) {
+ linker_error_printf(prog, "all shaders must use same shading "
+ "language version\n");
+ goto done;
+ }
+
+ prog->Version = max_version;
+
+ for (unsigned int i = 0; i < MESA_SHADER_TYPES; i++) {
+ if (prog->_LinkedShaders[i] != NULL)
+ ctx->Driver.DeleteShader(ctx, prog->_LinkedShaders[i]);
+
+ prog->_LinkedShaders[i] = NULL;
+ }
+
+ /* Link all shaders for a particular stage and validate the result.
+ */
+ if (num_vert_shaders > 0) {
+ gl_shader *const sh =
+ link_intrastage_shaders(mem_ctx, ctx, prog, vert_shader_list,
+ num_vert_shaders);
+
+ if (sh == NULL)
+ goto done;
+
+ if (!validate_vertex_shader_executable(prog, sh))
+ goto done;
+
+ _mesa_reference_shader(ctx, &prog->_LinkedShaders[MESA_SHADER_VERTEX],
+ sh);
+ }
+
+ if (num_frag_shaders > 0) {
+ gl_shader *const sh =
+ link_intrastage_shaders(mem_ctx, ctx, prog, frag_shader_list,
+ num_frag_shaders);
+
+ if (sh == NULL)
+ goto done;
+
+ if (!validate_fragment_shader_executable(prog, sh))
+ goto done;
+
+ _mesa_reference_shader(ctx, &prog->_LinkedShaders[MESA_SHADER_FRAGMENT],
+ sh);
+ }
+
+ /* Here begins the inter-stage linking phase. Some initial validation is
+ * performed, then locations are assigned for uniforms, attributes, and
+ * varyings.
+ */
+ if (cross_validate_uniforms(prog)) {
+ unsigned prev;
+
+ for (prev = 0; prev < MESA_SHADER_TYPES; prev++) {
+ if (prog->_LinkedShaders[prev] != NULL)
+ break;
+ }
+
+ /* Validate the inputs of each stage with the output of the preceding
+ * stage.
+ */
+ for (unsigned i = prev + 1; i < MESA_SHADER_TYPES; i++) {
+ if (prog->_LinkedShaders[i] == NULL)
+ continue;
+
+ if (!cross_validate_outputs_to_inputs(prog,
+ prog->_LinkedShaders[prev],
+ prog->_LinkedShaders[i]))
+ goto done;
+
+ prev = i;
+ }
+
+ prog->LinkStatus = true;
+ }
+
+ /* Do common optimization before assigning storage for attributes,
+ * uniforms, and varyings. Later optimization could possibly make
+ * some of that unused.
+ */
+ for (unsigned i = 0; i < MESA_SHADER_TYPES; i++) {
+ if (prog->_LinkedShaders[i] == NULL)
+ continue;
+
+ while (do_common_optimization(prog->_LinkedShaders[i]->ir, true, 32))
+ ;
+ }
+
+ update_array_sizes(prog);
+
+ assign_uniform_locations(prog);
+
+ if (prog->_LinkedShaders[MESA_SHADER_VERTEX] != NULL) {
+ /* FINISHME: The value of the max_attribute_index parameter is
+ * FINISHME: implementation dependent based on the value of
+ * FINISHME: GL_MAX_VERTEX_ATTRIBS. GL_MAX_VERTEX_ATTRIBS must be
+ * FINISHME: at least 16, so hardcode 16 for now.
+ */
+ if (!assign_attribute_locations(prog, 16)) {
+ prog->LinkStatus = false;
+ goto done;
+ }
+ }
+
+ unsigned prev;
+ for (prev = 0; prev < MESA_SHADER_TYPES; prev++) {
+ if (prog->_LinkedShaders[prev] != NULL)
+ break;
+ }
+
+ for (unsigned i = prev + 1; i < MESA_SHADER_TYPES; i++) {
+ if (prog->_LinkedShaders[i] == NULL)
+ continue;
+
+ assign_varying_locations(prog,
+ prog->_LinkedShaders[prev],
+ prog->_LinkedShaders[i]);
+ prev = i;
+ }
+
+ if (prog->_LinkedShaders[MESA_SHADER_VERTEX] != NULL) {
+ demote_shader_inputs_and_outputs(prog->_LinkedShaders[MESA_SHADER_VERTEX],
+ ir_var_out);
+ }
+
+ if (prog->_LinkedShaders[MESA_SHADER_GEOMETRY] != NULL) {
+ gl_shader *const sh = prog->_LinkedShaders[MESA_SHADER_GEOMETRY];
+
+ demote_shader_inputs_and_outputs(sh, ir_var_in);
+ demote_shader_inputs_and_outputs(sh, ir_var_inout);
+ demote_shader_inputs_and_outputs(sh, ir_var_out);
+ }
+
+ if (prog->_LinkedShaders[MESA_SHADER_FRAGMENT] != NULL) {
+ gl_shader *const sh = prog->_LinkedShaders[MESA_SHADER_FRAGMENT];
+
+ demote_shader_inputs_and_outputs(sh, ir_var_in);
+ }
+
+ /* OpenGL ES requires that a vertex shader and a fragment shader both be
+ * present in a linked program. By checking for use of shading language
+ * version 1.00, we also catch the GL_ARB_ES2_compatibility case.
+ */
+ if (ctx->API == API_OPENGLES2 || prog->Version == 100) {
+ if (prog->_LinkedShaders[MESA_SHADER_VERTEX] == NULL) {
+ linker_error_printf(prog, "program lacks a vertex shader\n");
+ prog->LinkStatus = false;
+ } else if (prog->_LinkedShaders[MESA_SHADER_FRAGMENT] == NULL) {
+ linker_error_printf(prog, "program lacks a fragment shader\n");
+ prog->LinkStatus = false;
+ }
+ }
+
+ /* FINISHME: Assign fragment shader output locations. */
+
+done:
+ free(vert_shader_list);
+
+ for (unsigned i = 0; i < MESA_SHADER_TYPES; i++) {
+ if (prog->_LinkedShaders[i] == NULL)
+ continue;
+
+ /* Retain any live IR, but trash the rest. */
+ reparent_ir(prog->_LinkedShaders[i]->ir, prog->_LinkedShaders[i]->ir);
+ }
+
+ ralloc_free(mem_ctx);
+}
diff --git a/mesalib/src/glsl/list.h b/mesalib/src/glsl/list.h
index 1d46365fa..fb6f0fbba 100644
--- a/mesalib/src/glsl/list.h
+++ b/mesalib/src/glsl/list.h
@@ -90,6 +90,10 @@ struct exec_node {
/* If the user *does* call delete, that's OK, we will just
* ralloc_free in that case. */
+ static void operator delete(void *node, void *ctx)
+ {
+ ralloc_free(node);
+ }
static void operator delete(void *node)
{
ralloc_free(node);
@@ -299,6 +303,10 @@ struct exec_list {
/* If the user *does* call delete, that's OK, we will just
* ralloc_free in that case. */
+ static void operator delete(void *node, void *ctx)
+ {
+ ralloc_free(node);
+ }
static void operator delete(void *node)
{
ralloc_free(node);
diff --git a/mesalib/src/glsl/loop_controls.cpp b/mesalib/src/glsl/loop_controls.cpp
index 9acbadc50..9b77ef460 100644
--- a/mesalib/src/glsl/loop_controls.cpp
+++ b/mesalib/src/glsl/loop_controls.cpp
@@ -1,304 +1,304 @@
-/*
- * Copyright © 2010 Intel Corporation
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-
-#include <limits.h>
-#include "main/compiler.h"
-#include "glsl_types.h"
-#include "loop_analysis.h"
-#include "ir_hierarchical_visitor.h"
-
-/**
- * Find an initializer of a variable outside a loop
- *
- * Works backwards from the loop to find the pre-loop value of the variable.
- * This is used, for example, to find the initial value of loop induction
- * variables.
- *
- * \param loop Loop where \c var is an induction variable
- * \param var Variable whose initializer is to be found
- *
- * \return
- * The \c ir_rvalue assigned to the variable outside the loop. May return
- * \c NULL if no initializer can be found.
- */
-ir_rvalue *
-find_initial_value(ir_loop *loop, ir_variable *var)
-{
- for (exec_node *node = loop->prev;
- !node->is_head_sentinel();
- node = node->prev) {
- ir_instruction *ir = (ir_instruction *) node;
-
- switch (ir->ir_type) {
- case ir_type_call:
- case ir_type_loop:
- case ir_type_loop_jump:
- case ir_type_return:
- case ir_type_if:
- return NULL;
-
- case ir_type_function:
- case ir_type_function_signature:
- assert(!"Should not get here.");
- return NULL;
-
- case ir_type_assignment: {
- ir_assignment *assign = ir->as_assignment();
- ir_variable *assignee = assign->lhs->whole_variable_referenced();
-
- if (assignee == var)
- return (assign->condition != NULL) ? NULL : assign->rhs;
-
- break;
- }
-
- default:
- break;
- }
- }
-
- return NULL;
-}
-
-
-int
-calculate_iterations(ir_rvalue *from, ir_rvalue *to, ir_rvalue *increment,
- enum ir_expression_operation op)
-{
- if (from == NULL || to == NULL || increment == NULL)
- return -1;
-
- void *mem_ctx = ralloc_context(NULL);
-
- ir_expression *const sub =
- new(mem_ctx) ir_expression(ir_binop_sub, from->type, to, from);
-
- ir_expression *const div =
- new(mem_ctx) ir_expression(ir_binop_div, sub->type, sub, increment);
-
- ir_constant *iter = div->constant_expression_value();
-
- if (iter == NULL)
- return -1;
-
- if (!iter->type->is_integer()) {
- ir_rvalue *cast =
- new(mem_ctx) ir_expression(ir_unop_f2i, glsl_type::int_type, iter,
- NULL);
-
- iter = cast->constant_expression_value();
- }
-
- int iter_value = iter->get_int_component(0);
-
- /* Make sure that the calculated number of iterations satisfies the exit
- * condition. This is needed to catch off-by-one errors and some types of
- * ill-formed loops. For example, we need to detect that the following
- * loop does not have a maximum iteration count.
- *
- * for (float x = 0.0; x != 0.9; x += 0.2)
- * ;
- */
- const int bias[] = { -1, 0, 1 };
- bool valid_loop = false;
-
- for (unsigned i = 0; i < Elements(bias); i++) {
- iter = (increment->type->is_integer())
- ? new(mem_ctx) ir_constant(iter_value + bias[i])
- : new(mem_ctx) ir_constant(float(iter_value + bias[i]));
-
- ir_expression *const mul =
- new(mem_ctx) ir_expression(ir_binop_mul, increment->type, iter,
- increment);
-
- ir_expression *const add =
- new(mem_ctx) ir_expression(ir_binop_add, mul->type, mul, from);
-
- ir_expression *const cmp =
- new(mem_ctx) ir_expression(op, glsl_type::bool_type, add, to);
-
- ir_constant *const cmp_result = cmp->constant_expression_value();
-
- assert(cmp_result != NULL);
- if (cmp_result->get_bool_component(0)) {
- iter_value += bias[i];
- valid_loop = true;
- break;
- }
- }
-
- ralloc_free(mem_ctx);
- return (valid_loop) ? iter_value : -1;
-}
-
-
-class loop_control_visitor : public ir_hierarchical_visitor {
-public:
- loop_control_visitor(loop_state *state)
- {
- this->state = state;
- this->progress = false;
- }
-
- virtual ir_visitor_status visit_leave(ir_loop *ir);
-
- loop_state *state;
-
- bool progress;
-};
-
-
-ir_visitor_status
-loop_control_visitor::visit_leave(ir_loop *ir)
-{
- loop_variable_state *const ls = this->state->get(ir);
-
- /* If we've entered a loop that hasn't been analyzed, something really,
- * really bad has happened.
- */
- if (ls == NULL) {
- assert(ls != NULL);
- return visit_continue;
- }
-
- /* Search the loop terminating conditions for one of the form 'i < c' where
- * i is a loop induction variable, c is a constant, and < is any relative
- * operator.
- */
- int max_iterations = ls->max_iterations;
-
- if(ir->from && ir->to && ir->increment)
- max_iterations = calculate_iterations(ir->from, ir->to, ir->increment, (ir_expression_operation)ir->cmp);
-
- if(max_iterations < 0)
- max_iterations = INT_MAX;
-
- foreach_list(node, &ls->terminators) {
- loop_terminator *t = (loop_terminator *) node;
- ir_if *if_stmt = t->ir;
-
- /* If-statements can be either 'if (expr)' or 'if (deref)'. We only care
- * about the former here.
- */
- ir_expression *cond = if_stmt->condition->as_expression();
- if (cond == NULL)
- continue;
-
- switch (cond->operation) {
- case ir_binop_less:
- case ir_binop_greater:
- case ir_binop_lequal:
- case ir_binop_gequal: {
- /* The expressions that we care about will either be of the form
- * 'counter < limit' or 'limit < counter'. Figure out which is
- * which.
- */
- ir_rvalue *counter = cond->operands[0]->as_dereference_variable();
- ir_constant *limit = cond->operands[1]->as_constant();
- enum ir_expression_operation cmp = cond->operation;
-
- if (limit == NULL) {
- counter = cond->operands[1]->as_dereference_variable();
- limit = cond->operands[0]->as_constant();
-
- switch (cmp) {
- case ir_binop_less: cmp = ir_binop_gequal; break;
- case ir_binop_greater: cmp = ir_binop_lequal; break;
- case ir_binop_lequal: cmp = ir_binop_greater; break;
- case ir_binop_gequal: cmp = ir_binop_less; break;
- default: assert(!"Should not get here.");
- }
- }
-
- if ((counter == NULL) || (limit == NULL))
- break;
-
- ir_variable *var = counter->variable_referenced();
-
- ir_rvalue *init = find_initial_value(ir, var);
-
- foreach_list(iv_node, &ls->induction_variables) {
- loop_variable *lv = (loop_variable *) iv_node;
-
- if (lv->var == var) {
- const int iterations = calculate_iterations(init, limit,
- lv->increment,
- cmp);
- if (iterations >= 0) {
- /* If the new iteration count is lower than the previously
- * believed iteration count, update the loop control values.
- */
- if (iterations < max_iterations) {
- ir->from = init->clone(ir, NULL);
- ir->to = limit->clone(ir, NULL);
- ir->increment = lv->increment->clone(ir, NULL);
- ir->counter = lv->var;
- ir->cmp = cmp;
-
- max_iterations = iterations;
- }
-
- /* Remove the conditional break statement. The loop
- * controls are now set such that the exit condition will be
- * satisfied.
- */
- if_stmt->remove();
-
- assert(ls->num_loop_jumps > 0);
- ls->num_loop_jumps--;
-
- this->progress = true;
- }
-
- break;
- }
- }
- break;
- }
-
- default:
- break;
- }
- }
-
- /* If we have proven the one of the loop exit conditions is satisifed before
- * running the loop once, remove the loop.
- */
- if (max_iterations == 0)
- ir->remove();
- else
- ls->max_iterations = max_iterations;
-
- return visit_continue;
-}
-
-
-bool
-set_loop_controls(exec_list *instructions, loop_state *ls)
-{
- loop_control_visitor v(ls);
-
- v.run(instructions);
-
- return v.progress;
-}
+/*
+ * Copyright © 2010 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+#include <limits.h>
+#include "main/compiler.h"
+#include "glsl_types.h"
+#include "loop_analysis.h"
+#include "ir_hierarchical_visitor.h"
+
+/**
+ * Find an initializer of a variable outside a loop
+ *
+ * Works backwards from the loop to find the pre-loop value of the variable.
+ * This is used, for example, to find the initial value of loop induction
+ * variables.
+ *
+ * \param loop Loop where \c var is an induction variable
+ * \param var Variable whose initializer is to be found
+ *
+ * \return
+ * The \c ir_rvalue assigned to the variable outside the loop. May return
+ * \c NULL if no initializer can be found.
+ */
+ir_rvalue *
+find_initial_value(ir_loop *loop, ir_variable *var)
+{
+ for (exec_node *node = loop->prev;
+ !node->is_head_sentinel();
+ node = node->prev) {
+ ir_instruction *ir = (ir_instruction *) node;
+
+ switch (ir->ir_type) {
+ case ir_type_call:
+ case ir_type_loop:
+ case ir_type_loop_jump:
+ case ir_type_return:
+ case ir_type_if:
+ return NULL;
+
+ case ir_type_function:
+ case ir_type_function_signature:
+ assert(!"Should not get here.");
+ return NULL;
+
+ case ir_type_assignment: {
+ ir_assignment *assign = ir->as_assignment();
+ ir_variable *assignee = assign->lhs->whole_variable_referenced();
+
+ if (assignee == var)
+ return (assign->condition != NULL) ? NULL : assign->rhs;
+
+ break;
+ }
+
+ default:
+ break;
+ }
+ }
+
+ return NULL;
+}
+
+
+int
+calculate_iterations(ir_rvalue *from, ir_rvalue *to, ir_rvalue *increment,
+ enum ir_expression_operation op)
+{
+ if (from == NULL || to == NULL || increment == NULL)
+ return -1;
+
+ void *mem_ctx = ralloc_context(NULL);
+
+ ir_expression *const sub =
+ new(mem_ctx) ir_expression(ir_binop_sub, from->type, to, from);
+
+ ir_expression *const div =
+ new(mem_ctx) ir_expression(ir_binop_div, sub->type, sub, increment);
+
+ ir_constant *iter = div->constant_expression_value();
+
+ if (iter == NULL)
+ return -1;
+
+ if (!iter->type->is_integer()) {
+ ir_rvalue *cast =
+ new(mem_ctx) ir_expression(ir_unop_f2i, glsl_type::int_type, iter,
+ NULL);
+
+ iter = cast->constant_expression_value();
+ }
+
+ int iter_value = iter->get_int_component(0);
+
+ /* Make sure that the calculated number of iterations satisfies the exit
+ * condition. This is needed to catch off-by-one errors and some types of
+ * ill-formed loops. For example, we need to detect that the following
+ * loop does not have a maximum iteration count.
+ *
+ * for (float x = 0.0; x != 0.9; x += 0.2)
+ * ;
+ */
+ const int bias[] = { -1, 0, 1 };
+ bool valid_loop = false;
+
+ for (unsigned i = 0; i < Elements(bias); i++) {
+ iter = (increment->type->is_integer())
+ ? new(mem_ctx) ir_constant(iter_value + bias[i])
+ : new(mem_ctx) ir_constant(float(iter_value + bias[i]));
+
+ ir_expression *const mul =
+ new(mem_ctx) ir_expression(ir_binop_mul, increment->type, iter,
+ increment);
+
+ ir_expression *const add =
+ new(mem_ctx) ir_expression(ir_binop_add, mul->type, mul, from);
+
+ ir_expression *const cmp =
+ new(mem_ctx) ir_expression(op, glsl_type::bool_type, add, to);
+
+ ir_constant *const cmp_result = cmp->constant_expression_value();
+
+ assert(cmp_result != NULL);
+ if (cmp_result->get_bool_component(0)) {
+ iter_value += bias[i];
+ valid_loop = true;
+ break;
+ }
+ }
+
+ ralloc_free(mem_ctx);
+ return (valid_loop) ? iter_value : -1;
+}
+
+
+class loop_control_visitor : public ir_hierarchical_visitor {
+public:
+ loop_control_visitor(loop_state *state)
+ {
+ this->state = state;
+ this->progress = false;
+ }
+
+ virtual ir_visitor_status visit_leave(ir_loop *ir);
+
+ loop_state *state;
+
+ bool progress;
+};
+
+
+ir_visitor_status
+loop_control_visitor::visit_leave(ir_loop *ir)
+{
+ loop_variable_state *const ls = this->state->get(ir);
+
+ /* If we've entered a loop that hasn't been analyzed, something really,
+ * really bad has happened.
+ */
+ if (ls == NULL) {
+ assert(ls != NULL);
+ return visit_continue;
+ }
+
+ /* Search the loop terminating conditions for one of the form 'i < c' where
+ * i is a loop induction variable, c is a constant, and < is any relative
+ * operator.
+ */
+ int max_iterations = ls->max_iterations;
+
+ if(ir->from && ir->to && ir->increment)
+ max_iterations = calculate_iterations(ir->from, ir->to, ir->increment, (ir_expression_operation)ir->cmp);
+
+ if(max_iterations < 0)
+ max_iterations = INT_MAX;
+
+ foreach_list(node, &ls->terminators) {
+ loop_terminator *t = (loop_terminator *) node;
+ ir_if *if_stmt = t->ir;
+
+ /* If-statements can be either 'if (expr)' or 'if (deref)'. We only care
+ * about the former here.
+ */
+ ir_expression *cond = if_stmt->condition->as_expression();
+ if (cond == NULL)
+ continue;
+
+ switch (cond->operation) {
+ case ir_binop_less:
+ case ir_binop_greater:
+ case ir_binop_lequal:
+ case ir_binop_gequal: {
+ /* The expressions that we care about will either be of the form
+ * 'counter < limit' or 'limit < counter'. Figure out which is
+ * which.
+ */
+ ir_rvalue *counter = cond->operands[0]->as_dereference_variable();
+ ir_constant *limit = cond->operands[1]->as_constant();
+ enum ir_expression_operation cmp = cond->operation;
+
+ if (limit == NULL) {
+ counter = cond->operands[1]->as_dereference_variable();
+ limit = cond->operands[0]->as_constant();
+
+ switch (cmp) {
+ case ir_binop_less: cmp = ir_binop_gequal; break;
+ case ir_binop_greater: cmp = ir_binop_lequal; break;
+ case ir_binop_lequal: cmp = ir_binop_greater; break;
+ case ir_binop_gequal: cmp = ir_binop_less; break;
+ default: assert(!"Should not get here.");
+ }
+ }
+
+ if ((counter == NULL) || (limit == NULL))
+ break;
+
+ ir_variable *var = counter->variable_referenced();
+
+ ir_rvalue *init = find_initial_value(ir, var);
+
+ foreach_list(iv_node, &ls->induction_variables) {
+ loop_variable *lv = (loop_variable *) iv_node;
+
+ if (lv->var == var) {
+ const int iterations = calculate_iterations(init, limit,
+ lv->increment,
+ cmp);
+ if (iterations >= 0) {
+ /* If the new iteration count is lower than the previously
+ * believed iteration count, update the loop control values.
+ */
+ if (iterations < max_iterations) {
+ ir->from = init->clone(ir, NULL);
+ ir->to = limit->clone(ir, NULL);
+ ir->increment = lv->increment->clone(ir, NULL);
+ ir->counter = lv->var;
+ ir->cmp = cmp;
+
+ max_iterations = iterations;
+ }
+
+ /* Remove the conditional break statement. The loop
+ * controls are now set such that the exit condition will be
+ * satisfied.
+ */
+ if_stmt->remove();
+
+ assert(ls->num_loop_jumps > 0);
+ ls->num_loop_jumps--;
+
+ this->progress = true;
+ }
+
+ break;
+ }
+ }
+ break;
+ }
+
+ default:
+ break;
+ }
+ }
+
+ /* If we have proven the one of the loop exit conditions is satisifed before
+ * running the loop once, remove the loop.
+ */
+ if (max_iterations == 0)
+ ir->remove();
+ else
+ ls->max_iterations = max_iterations;
+
+ return visit_continue;
+}
+
+
+bool
+set_loop_controls(exec_list *instructions, loop_state *ls)
+{
+ loop_control_visitor v(ls);
+
+ v.run(instructions);
+
+ return v.progress;
+}
diff --git a/mesalib/src/glsl/lower_mat_op_to_vec.cpp b/mesalib/src/glsl/lower_mat_op_to_vec.cpp
index 8cbbfa713..dc46ed417 100644
--- a/mesalib/src/glsl/lower_mat_op_to_vec.cpp
+++ b/mesalib/src/glsl/lower_mat_op_to_vec.cpp
@@ -1,490 +1,490 @@
-/*
- * Copyright © 2010 Intel Corporation
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-
-/**
- * \file lower_mat_op_to_vec.cpp
- *
- * Breaks matrix operation expressions down to a series of vector operations.
- *
- * Generally this is how we have to codegen matrix operations for a
- * GPU, so this gives us the chance to constant fold operations on a
- * column or row.
- */
-
-#include "ir.h"
-#include "ir_expression_flattening.h"
-#include "glsl_types.h"
-
-class ir_mat_op_to_vec_visitor : public ir_hierarchical_visitor {
-public:
- ir_mat_op_to_vec_visitor()
- {
- this->made_progress = false;
- this->mem_ctx = NULL;
- }
-
- ir_visitor_status visit_leave(ir_assignment *);
-
- ir_dereference *get_column(ir_variable *var, int col);
- ir_rvalue *get_element(ir_variable *var, int col, int row);
-
- void do_mul_mat_mat(ir_variable *result_var,
- ir_variable *a_var, ir_variable *b_var);
- void do_mul_mat_vec(ir_variable *result_var,
- ir_variable *a_var, ir_variable *b_var);
- void do_mul_vec_mat(ir_variable *result_var,
- ir_variable *a_var, ir_variable *b_var);
- void do_mul_mat_scalar(ir_variable *result_var,
- ir_variable *a_var, ir_variable *b_var);
- void do_equal_mat_mat(ir_variable *result_var, ir_variable *a_var,
- ir_variable *b_var, bool test_equal);
-
- void *mem_ctx;
- bool made_progress;
-};
-
-static bool
-mat_op_to_vec_predicate(ir_instruction *ir)
-{
- ir_expression *expr = ir->as_expression();
- unsigned int i;
-
- if (!expr)
- return false;
-
- for (i = 0; i < expr->get_num_operands(); i++) {
- if (expr->operands[i]->type->is_matrix())
- return true;
- }
-
- return false;
-}
-
-bool
-do_mat_op_to_vec(exec_list *instructions)
-{
- ir_mat_op_to_vec_visitor v;
-
- /* Pull out any matrix expression to a separate assignment to a
- * temp. This will make our handling of the breakdown to
- * operations on the matrix's vector components much easier.
- */
- do_expression_flattening(instructions, mat_op_to_vec_predicate);
-
- visit_list_elements(&v, instructions);
-
- return v.made_progress;
-}
-
-ir_rvalue *
-ir_mat_op_to_vec_visitor::get_element(ir_variable *var, int col, int row)
-{
- ir_dereference *deref;
-
- deref = new(mem_ctx) ir_dereference_variable(var);
-
- if (var->type->is_matrix()) {
- deref = new(mem_ctx) ir_dereference_array(var,
- new(mem_ctx) ir_constant(col));
- } else {
- assert(col == 0);
- }
-
- return new(mem_ctx) ir_swizzle(deref, row, 0, 0, 0, 1);
-}
-
-ir_dereference *
-ir_mat_op_to_vec_visitor::get_column(ir_variable *var, int row)
-{
- ir_dereference *deref;
-
- if (!var->type->is_matrix()) {
- deref = new(mem_ctx) ir_dereference_variable(var);
- } else {
- deref = new(mem_ctx) ir_dereference_variable(var);
- deref = new(mem_ctx) ir_dereference_array(deref,
- new(mem_ctx) ir_constant(row));
- }
-
- return deref;
-}
-
-void
-ir_mat_op_to_vec_visitor::do_mul_mat_mat(ir_variable *result_var,
- ir_variable *a_var,
- ir_variable *b_var)
-{
- int b_col, i;
- ir_assignment *assign;
- ir_expression *expr;
-
- for (b_col = 0; b_col < b_var->type->matrix_columns; b_col++) {
- ir_rvalue *a = get_column(a_var, 0);
- ir_rvalue *b = get_element(b_var, b_col, 0);
-
- /* first column */
- expr = new(mem_ctx) ir_expression(ir_binop_mul,
- a->type,
- a,
- b);
-
- /* following columns */
- for (i = 1; i < a_var->type->matrix_columns; i++) {
- ir_expression *mul_expr;
-
- a = get_column(a_var, i);
- b = get_element(b_var, b_col, i);
-
- mul_expr = new(mem_ctx) ir_expression(ir_binop_mul,
- a->type,
- a,
- b);
- expr = new(mem_ctx) ir_expression(ir_binop_add,
- a->type,
- expr,
- mul_expr);
- }
-
- ir_rvalue *result = get_column(result_var, b_col);
- assign = new(mem_ctx) ir_assignment(result,
- expr,
- NULL);
- base_ir->insert_before(assign);
- }
-}
-
-void
-ir_mat_op_to_vec_visitor::do_mul_mat_vec(ir_variable *result_var,
- ir_variable *a_var,
- ir_variable *b_var)
-{
- int i;
- ir_rvalue *a = get_column(a_var, 0);
- ir_rvalue *b = get_element(b_var, 0, 0);
- ir_assignment *assign;
- ir_expression *expr;
-
- /* first column */
- expr = new(mem_ctx) ir_expression(ir_binop_mul,
- result_var->type,
- a,
- b);
-
- /* following columns */
- for (i = 1; i < a_var->type->matrix_columns; i++) {
- ir_expression *mul_expr;
-
- a = get_column(a_var, i);
- b = get_element(b_var, 0, i);
-
- mul_expr = new(mem_ctx) ir_expression(ir_binop_mul,
- result_var->type,
- a,
- b);
- expr = new(mem_ctx) ir_expression(ir_binop_add,
- result_var->type,
- expr,
- mul_expr);
- }
-
- ir_rvalue *result = new(mem_ctx) ir_dereference_variable(result_var);
- assign = new(mem_ctx) ir_assignment(result,
- expr,
- NULL);
- base_ir->insert_before(assign);
-}
-
-void
-ir_mat_op_to_vec_visitor::do_mul_vec_mat(ir_variable *result_var,
- ir_variable *a_var,
- ir_variable *b_var)
-{
- int i;
-
- for (i = 0; i < b_var->type->matrix_columns; i++) {
- ir_rvalue *a = new(mem_ctx) ir_dereference_variable(a_var);
- ir_rvalue *b = get_column(b_var, i);
- ir_rvalue *result;
- ir_expression *column_expr;
- ir_assignment *column_assign;
-
- result = new(mem_ctx) ir_dereference_variable(result_var);
- result = new(mem_ctx) ir_swizzle(result, i, 0, 0, 0, 1);
-
- column_expr = new(mem_ctx) ir_expression(ir_binop_dot,
- result->type,
- a,
- b);
-
- column_assign = new(mem_ctx) ir_assignment(result,
- column_expr,
- NULL);
- base_ir->insert_before(column_assign);
- }
-}
-
-void
-ir_mat_op_to_vec_visitor::do_mul_mat_scalar(ir_variable *result_var,
- ir_variable *a_var,
- ir_variable *b_var)
-{
- int i;
-
- for (i = 0; i < a_var->type->matrix_columns; i++) {
- ir_rvalue *a = get_column(a_var, i);
- ir_rvalue *b = new(mem_ctx) ir_dereference_variable(b_var);
- ir_rvalue *result = get_column(result_var, i);
- ir_expression *column_expr;
- ir_assignment *column_assign;
-
- column_expr = new(mem_ctx) ir_expression(ir_binop_mul,
- result->type,
- a,
- b);
-
- column_assign = new(mem_ctx) ir_assignment(result,
- column_expr,
- NULL);
- base_ir->insert_before(column_assign);
- }
-}
-
-void
-ir_mat_op_to_vec_visitor::do_equal_mat_mat(ir_variable *result_var,
- ir_variable *a_var,
- ir_variable *b_var,
- bool test_equal)
-{
- /* This essentially implements the following GLSL:
- *
- * bool equal(mat4 a, mat4 b)
- * {
- * return !any(bvec4(a[0] != b[0],
- * a[1] != b[1],
- * a[2] != b[2],
- * a[3] != b[3]);
- * }
- *
- * bool nequal(mat4 a, mat4 b)
- * {
- * return any(bvec4(a[0] != b[0],
- * a[1] != b[1],
- * a[2] != b[2],
- * a[3] != b[3]);
- * }
- */
- const unsigned columns = a_var->type->matrix_columns;
- const glsl_type *const bvec_type =
- glsl_type::get_instance(GLSL_TYPE_BOOL, columns, 1);
-
- ir_variable *const tmp_bvec =
- new(this->mem_ctx) ir_variable(bvec_type, "mat_cmp_bvec",
- ir_var_temporary);
- this->base_ir->insert_before(tmp_bvec);
-
- for (unsigned i = 0; i < columns; i++) {
- ir_dereference *const op0 = get_column(a_var, i);
- ir_dereference *const op1 = get_column(b_var, i);
-
- ir_expression *const cmp =
- new(this->mem_ctx) ir_expression(ir_binop_any_nequal,
- glsl_type::bool_type, op0, op1);
-
- ir_dereference *const lhs =
- new(this->mem_ctx) ir_dereference_variable(tmp_bvec);
-
- ir_assignment *const assign =
- new(this->mem_ctx) ir_assignment(lhs, cmp, NULL, (1U << i));
-
- this->base_ir->insert_before(assign);
- }
-
- ir_rvalue *const val =
- new(this->mem_ctx) ir_dereference_variable(tmp_bvec);
-
- ir_expression *any =
- new(this->mem_ctx) ir_expression(ir_unop_any, glsl_type::bool_type,
- val, NULL);
-
- if (test_equal)
- any = new(this->mem_ctx) ir_expression(ir_unop_logic_not,
- glsl_type::bool_type,
- any, NULL);
-
- ir_rvalue *const result =
- new(this->mem_ctx) ir_dereference_variable(result_var);
-
- ir_assignment *const assign =
- new(mem_ctx) ir_assignment(result, any, NULL);
- base_ir->insert_before(assign);
-}
-
-static bool
-has_matrix_operand(const ir_expression *expr, unsigned &columns)
-{
- for (unsigned i = 0; i < expr->get_num_operands(); i++) {
- if (expr->operands[i]->type->is_matrix()) {
- columns = expr->operands[i]->type->matrix_columns;
- return true;
- }
- }
-
- return false;
-}
-
-
-ir_visitor_status
-ir_mat_op_to_vec_visitor::visit_leave(ir_assignment *orig_assign)
-{
- ir_expression *orig_expr = orig_assign->rhs->as_expression();
- unsigned int i, matrix_columns = 1;
- ir_variable *op_var[2];
-
- if (!orig_expr)
- return visit_continue;
-
- if (!has_matrix_operand(orig_expr, matrix_columns))
- return visit_continue;
-
- assert(orig_expr->get_num_operands() <= 2);
-
- mem_ctx = ralloc_parent(orig_assign);
-
- ir_dereference_variable *lhs_deref =
- orig_assign->lhs->as_dereference_variable();
- assert(lhs_deref);
-
- ir_variable *result_var = lhs_deref->var;
-
- /* Store the expression operands in temps so we can use them
- * multiple times.
- */
- for (i = 0; i < orig_expr->get_num_operands(); i++) {
- ir_assignment *assign;
-
- op_var[i] = new(mem_ctx) ir_variable(orig_expr->operands[i]->type,
- "mat_op_to_vec",
- ir_var_temporary);
- base_ir->insert_before(op_var[i]);
-
- lhs_deref = new(mem_ctx) ir_dereference_variable(op_var[i]);
- assign = new(mem_ctx) ir_assignment(lhs_deref,
- orig_expr->operands[i],
- NULL);
- base_ir->insert_before(assign);
- }
-
- /* OK, time to break down this matrix operation. */
- switch (orig_expr->operation) {
- case ir_unop_neg: {
- const unsigned mask = (1U << result_var->type->vector_elements) - 1;
-
- /* Apply the operation to each column.*/
- for (i = 0; i < matrix_columns; i++) {
- ir_rvalue *op0 = get_column(op_var[0], i);
- ir_dereference *result = get_column(result_var, i);
- ir_expression *column_expr;
- ir_assignment *column_assign;
-
- column_expr = new(mem_ctx) ir_expression(orig_expr->operation,
- result->type,
- op0,
- NULL);
-
- column_assign = new(mem_ctx) ir_assignment(result,
- column_expr,
- NULL,
- mask);
- assert(column_assign->write_mask != 0);
- base_ir->insert_before(column_assign);
- }
- break;
- }
- case ir_binop_add:
- case ir_binop_sub:
- case ir_binop_div:
- case ir_binop_mod: {
- const unsigned mask = (1U << result_var->type->vector_elements) - 1;
-
- /* For most operations, the matrix version is just going
- * column-wise through and applying the operation to each column
- * if available.
- */
- for (i = 0; i < matrix_columns; i++) {
- ir_rvalue *op0 = get_column(op_var[0], i);
- ir_rvalue *op1 = get_column(op_var[1], i);
- ir_dereference *result = get_column(result_var, i);
- ir_expression *column_expr;
- ir_assignment *column_assign;
-
- column_expr = new(mem_ctx) ir_expression(orig_expr->operation,
- result->type,
- op0,
- op1);
-
- column_assign = new(mem_ctx) ir_assignment(result,
- column_expr,
- NULL,
- mask);
- assert(column_assign->write_mask != 0);
- base_ir->insert_before(column_assign);
- }
- break;
- }
- case ir_binop_mul:
- if (op_var[0]->type->is_matrix()) {
- if (op_var[1]->type->is_matrix()) {
- do_mul_mat_mat(result_var, op_var[0], op_var[1]);
- } else if (op_var[1]->type->is_vector()) {
- do_mul_mat_vec(result_var, op_var[0], op_var[1]);
- } else {
- assert(op_var[1]->type->is_scalar());
- do_mul_mat_scalar(result_var, op_var[0], op_var[1]);
- }
- } else {
- assert(op_var[1]->type->is_matrix());
- if (op_var[0]->type->is_vector()) {
- do_mul_vec_mat(result_var, op_var[0], op_var[1]);
- } else {
- assert(op_var[0]->type->is_scalar());
- do_mul_mat_scalar(result_var, op_var[1], op_var[0]);
- }
- }
- break;
-
- case ir_binop_all_equal:
- case ir_binop_any_nequal:
- do_equal_mat_mat(result_var, op_var[1], op_var[0],
- (orig_expr->operation == ir_binop_all_equal));
- break;
-
- default:
- printf("FINISHME: Handle matrix operation for %s\n",
- orig_expr->operator_string());
- abort();
- }
- orig_assign->remove();
- this->made_progress = true;
-
- return visit_continue;
-}
+/*
+ * Copyright © 2010 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+/**
+ * \file lower_mat_op_to_vec.cpp
+ *
+ * Breaks matrix operation expressions down to a series of vector operations.
+ *
+ * Generally this is how we have to codegen matrix operations for a
+ * GPU, so this gives us the chance to constant fold operations on a
+ * column or row.
+ */
+
+#include "ir.h"
+#include "ir_expression_flattening.h"
+#include "glsl_types.h"
+
+class ir_mat_op_to_vec_visitor : public ir_hierarchical_visitor {
+public:
+ ir_mat_op_to_vec_visitor()
+ {
+ this->made_progress = false;
+ this->mem_ctx = NULL;
+ }
+
+ ir_visitor_status visit_leave(ir_assignment *);
+
+ ir_dereference *get_column(ir_variable *var, int col);
+ ir_rvalue *get_element(ir_variable *var, int col, int row);
+
+ void do_mul_mat_mat(ir_variable *result_var,
+ ir_variable *a_var, ir_variable *b_var);
+ void do_mul_mat_vec(ir_variable *result_var,
+ ir_variable *a_var, ir_variable *b_var);
+ void do_mul_vec_mat(ir_variable *result_var,
+ ir_variable *a_var, ir_variable *b_var);
+ void do_mul_mat_scalar(ir_variable *result_var,
+ ir_variable *a_var, ir_variable *b_var);
+ void do_equal_mat_mat(ir_variable *result_var, ir_variable *a_var,
+ ir_variable *b_var, bool test_equal);
+
+ void *mem_ctx;
+ bool made_progress;
+};
+
+static bool
+mat_op_to_vec_predicate(ir_instruction *ir)
+{
+ ir_expression *expr = ir->as_expression();
+ unsigned int i;
+
+ if (!expr)
+ return false;
+
+ for (i = 0; i < expr->get_num_operands(); i++) {
+ if (expr->operands[i]->type->is_matrix())
+ return true;
+ }
+
+ return false;
+}
+
+bool
+do_mat_op_to_vec(exec_list *instructions)
+{
+ ir_mat_op_to_vec_visitor v;
+
+ /* Pull out any matrix expression to a separate assignment to a
+ * temp. This will make our handling of the breakdown to
+ * operations on the matrix's vector components much easier.
+ */
+ do_expression_flattening(instructions, mat_op_to_vec_predicate);
+
+ visit_list_elements(&v, instructions);
+
+ return v.made_progress;
+}
+
+ir_rvalue *
+ir_mat_op_to_vec_visitor::get_element(ir_variable *var, int col, int row)
+{
+ ir_dereference *deref;
+
+ deref = new(mem_ctx) ir_dereference_variable(var);
+
+ if (var->type->is_matrix()) {
+ deref = new(mem_ctx) ir_dereference_array(var,
+ new(mem_ctx) ir_constant(col));
+ } else {
+ assert(col == 0);
+ }
+
+ return new(mem_ctx) ir_swizzle(deref, row, 0, 0, 0, 1);
+}
+
+ir_dereference *
+ir_mat_op_to_vec_visitor::get_column(ir_variable *var, int row)
+{
+ ir_dereference *deref;
+
+ if (!var->type->is_matrix()) {
+ deref = new(mem_ctx) ir_dereference_variable(var);
+ } else {
+ deref = new(mem_ctx) ir_dereference_variable(var);
+ deref = new(mem_ctx) ir_dereference_array(deref,
+ new(mem_ctx) ir_constant(row));
+ }
+
+ return deref;
+}
+
+void
+ir_mat_op_to_vec_visitor::do_mul_mat_mat(ir_variable *result_var,
+ ir_variable *a_var,
+ ir_variable *b_var)
+{
+ int b_col, i;
+ ir_assignment *assign;
+ ir_expression *expr;
+
+ for (b_col = 0; b_col < b_var->type->matrix_columns; b_col++) {
+ ir_rvalue *a = get_column(a_var, 0);
+ ir_rvalue *b = get_element(b_var, b_col, 0);
+
+ /* first column */
+ expr = new(mem_ctx) ir_expression(ir_binop_mul,
+ a->type,
+ a,
+ b);
+
+ /* following columns */
+ for (i = 1; i < a_var->type->matrix_columns; i++) {
+ ir_expression *mul_expr;
+
+ a = get_column(a_var, i);
+ b = get_element(b_var, b_col, i);
+
+ mul_expr = new(mem_ctx) ir_expression(ir_binop_mul,
+ a->type,
+ a,
+ b);
+ expr = new(mem_ctx) ir_expression(ir_binop_add,
+ a->type,
+ expr,
+ mul_expr);
+ }
+
+ ir_rvalue *result = get_column(result_var, b_col);
+ assign = new(mem_ctx) ir_assignment(result,
+ expr,
+ NULL);
+ base_ir->insert_before(assign);
+ }
+}
+
+void
+ir_mat_op_to_vec_visitor::do_mul_mat_vec(ir_variable *result_var,
+ ir_variable *a_var,
+ ir_variable *b_var)
+{
+ int i;
+ ir_rvalue *a = get_column(a_var, 0);
+ ir_rvalue *b = get_element(b_var, 0, 0);
+ ir_assignment *assign;
+ ir_expression *expr;
+
+ /* first column */
+ expr = new(mem_ctx) ir_expression(ir_binop_mul,
+ result_var->type,
+ a,
+ b);
+
+ /* following columns */
+ for (i = 1; i < a_var->type->matrix_columns; i++) {
+ ir_expression *mul_expr;
+
+ a = get_column(a_var, i);
+ b = get_element(b_var, 0, i);
+
+ mul_expr = new(mem_ctx) ir_expression(ir_binop_mul,
+ result_var->type,
+ a,
+ b);
+ expr = new(mem_ctx) ir_expression(ir_binop_add,
+ result_var->type,
+ expr,
+ mul_expr);
+ }
+
+ ir_rvalue *result = new(mem_ctx) ir_dereference_variable(result_var);
+ assign = new(mem_ctx) ir_assignment(result,
+ expr,
+ NULL);
+ base_ir->insert_before(assign);
+}
+
+void
+ir_mat_op_to_vec_visitor::do_mul_vec_mat(ir_variable *result_var,
+ ir_variable *a_var,
+ ir_variable *b_var)
+{
+ int i;
+
+ for (i = 0; i < b_var->type->matrix_columns; i++) {
+ ir_rvalue *a = new(mem_ctx) ir_dereference_variable(a_var);
+ ir_rvalue *b = get_column(b_var, i);
+ ir_rvalue *result;
+ ir_expression *column_expr;
+ ir_assignment *column_assign;
+
+ result = new(mem_ctx) ir_dereference_variable(result_var);
+ result = new(mem_ctx) ir_swizzle(result, i, 0, 0, 0, 1);
+
+ column_expr = new(mem_ctx) ir_expression(ir_binop_dot,
+ result->type,
+ a,
+ b);
+
+ column_assign = new(mem_ctx) ir_assignment(result,
+ column_expr,
+ NULL);
+ base_ir->insert_before(column_assign);
+ }
+}
+
+void
+ir_mat_op_to_vec_visitor::do_mul_mat_scalar(ir_variable *result_var,
+ ir_variable *a_var,
+ ir_variable *b_var)
+{
+ int i;
+
+ for (i = 0; i < a_var->type->matrix_columns; i++) {
+ ir_rvalue *a = get_column(a_var, i);
+ ir_rvalue *b = new(mem_ctx) ir_dereference_variable(b_var);
+ ir_rvalue *result = get_column(result_var, i);
+ ir_expression *column_expr;
+ ir_assignment *column_assign;
+
+ column_expr = new(mem_ctx) ir_expression(ir_binop_mul,
+ result->type,
+ a,
+ b);
+
+ column_assign = new(mem_ctx) ir_assignment(result,
+ column_expr,
+ NULL);
+ base_ir->insert_before(column_assign);
+ }
+}
+
+void
+ir_mat_op_to_vec_visitor::do_equal_mat_mat(ir_variable *result_var,
+ ir_variable *a_var,
+ ir_variable *b_var,
+ bool test_equal)
+{
+ /* This essentially implements the following GLSL:
+ *
+ * bool equal(mat4 a, mat4 b)
+ * {
+ * return !any(bvec4(a[0] != b[0],
+ * a[1] != b[1],
+ * a[2] != b[2],
+ * a[3] != b[3]);
+ * }
+ *
+ * bool nequal(mat4 a, mat4 b)
+ * {
+ * return any(bvec4(a[0] != b[0],
+ * a[1] != b[1],
+ * a[2] != b[2],
+ * a[3] != b[3]);
+ * }
+ */
+ const unsigned columns = a_var->type->matrix_columns;
+ const glsl_type *const bvec_type =
+ glsl_type::get_instance(GLSL_TYPE_BOOL, columns, 1);
+
+ ir_variable *const tmp_bvec =
+ new(this->mem_ctx) ir_variable(bvec_type, "mat_cmp_bvec",
+ ir_var_temporary);
+ this->base_ir->insert_before(tmp_bvec);
+
+ for (unsigned i = 0; i < columns; i++) {
+ ir_dereference *const op0 = get_column(a_var, i);
+ ir_dereference *const op1 = get_column(b_var, i);
+
+ ir_expression *const cmp =
+ new(this->mem_ctx) ir_expression(ir_binop_any_nequal,
+ glsl_type::bool_type, op0, op1);
+
+ ir_dereference *const lhs =
+ new(this->mem_ctx) ir_dereference_variable(tmp_bvec);
+
+ ir_assignment *const assign =
+ new(this->mem_ctx) ir_assignment(lhs, cmp, NULL, (1U << i));
+
+ this->base_ir->insert_before(assign);
+ }
+
+ ir_rvalue *const val =
+ new(this->mem_ctx) ir_dereference_variable(tmp_bvec);
+
+ ir_expression *any =
+ new(this->mem_ctx) ir_expression(ir_unop_any, glsl_type::bool_type,
+ val, NULL);
+
+ if (test_equal)
+ any = new(this->mem_ctx) ir_expression(ir_unop_logic_not,
+ glsl_type::bool_type,
+ any, NULL);
+
+ ir_rvalue *const result =
+ new(this->mem_ctx) ir_dereference_variable(result_var);
+
+ ir_assignment *const assign =
+ new(mem_ctx) ir_assignment(result, any, NULL);
+ base_ir->insert_before(assign);
+}
+
+static bool
+has_matrix_operand(const ir_expression *expr, unsigned &columns)
+{
+ for (unsigned i = 0; i < expr->get_num_operands(); i++) {
+ if (expr->operands[i]->type->is_matrix()) {
+ columns = expr->operands[i]->type->matrix_columns;
+ return true;
+ }
+ }
+
+ return false;
+}
+
+
+ir_visitor_status
+ir_mat_op_to_vec_visitor::visit_leave(ir_assignment *orig_assign)
+{
+ ir_expression *orig_expr = orig_assign->rhs->as_expression();
+ unsigned int i, matrix_columns = 1;
+ ir_variable *op_var[2];
+
+ if (!orig_expr)
+ return visit_continue;
+
+ if (!has_matrix_operand(orig_expr, matrix_columns))
+ return visit_continue;
+
+ assert(orig_expr->get_num_operands() <= 2);
+
+ mem_ctx = ralloc_parent(orig_assign);
+
+ ir_dereference_variable *lhs_deref =
+ orig_assign->lhs->as_dereference_variable();
+ assert(lhs_deref);
+
+ ir_variable *result_var = lhs_deref->var;
+
+ /* Store the expression operands in temps so we can use them
+ * multiple times.
+ */
+ for (i = 0; i < orig_expr->get_num_operands(); i++) {
+ ir_assignment *assign;
+
+ op_var[i] = new(mem_ctx) ir_variable(orig_expr->operands[i]->type,
+ "mat_op_to_vec",
+ ir_var_temporary);
+ base_ir->insert_before(op_var[i]);
+
+ lhs_deref = new(mem_ctx) ir_dereference_variable(op_var[i]);
+ assign = new(mem_ctx) ir_assignment(lhs_deref,
+ orig_expr->operands[i],
+ NULL);
+ base_ir->insert_before(assign);
+ }
+
+ /* OK, time to break down this matrix operation. */
+ switch (orig_expr->operation) {
+ case ir_unop_neg: {
+ const unsigned mask = (1U << result_var->type->vector_elements) - 1;
+
+ /* Apply the operation to each column.*/
+ for (i = 0; i < matrix_columns; i++) {
+ ir_rvalue *op0 = get_column(op_var[0], i);
+ ir_dereference *result = get_column(result_var, i);
+ ir_expression *column_expr;
+ ir_assignment *column_assign;
+
+ column_expr = new(mem_ctx) ir_expression(orig_expr->operation,
+ result->type,
+ op0,
+ NULL);
+
+ column_assign = new(mem_ctx) ir_assignment(result,
+ column_expr,
+ NULL,
+ mask);
+ assert(column_assign->write_mask != 0);
+ base_ir->insert_before(column_assign);
+ }
+ break;
+ }
+ case ir_binop_add:
+ case ir_binop_sub:
+ case ir_binop_div:
+ case ir_binop_mod: {
+ const unsigned mask = (1U << result_var->type->vector_elements) - 1;
+
+ /* For most operations, the matrix version is just going
+ * column-wise through and applying the operation to each column
+ * if available.
+ */
+ for (i = 0; i < matrix_columns; i++) {
+ ir_rvalue *op0 = get_column(op_var[0], i);
+ ir_rvalue *op1 = get_column(op_var[1], i);
+ ir_dereference *result = get_column(result_var, i);
+ ir_expression *column_expr;
+ ir_assignment *column_assign;
+
+ column_expr = new(mem_ctx) ir_expression(orig_expr->operation,
+ result->type,
+ op0,
+ op1);
+
+ column_assign = new(mem_ctx) ir_assignment(result,
+ column_expr,
+ NULL,
+ mask);
+ assert(column_assign->write_mask != 0);
+ base_ir->insert_before(column_assign);
+ }
+ break;
+ }
+ case ir_binop_mul:
+ if (op_var[0]->type->is_matrix()) {
+ if (op_var[1]->type->is_matrix()) {
+ do_mul_mat_mat(result_var, op_var[0], op_var[1]);
+ } else if (op_var[1]->type->is_vector()) {
+ do_mul_mat_vec(result_var, op_var[0], op_var[1]);
+ } else {
+ assert(op_var[1]->type->is_scalar());
+ do_mul_mat_scalar(result_var, op_var[0], op_var[1]);
+ }
+ } else {
+ assert(op_var[1]->type->is_matrix());
+ if (op_var[0]->type->is_vector()) {
+ do_mul_vec_mat(result_var, op_var[0], op_var[1]);
+ } else {
+ assert(op_var[0]->type->is_scalar());
+ do_mul_mat_scalar(result_var, op_var[1], op_var[0]);
+ }
+ }
+ break;
+
+ case ir_binop_all_equal:
+ case ir_binop_any_nequal:
+ do_equal_mat_mat(result_var, op_var[1], op_var[0],
+ (orig_expr->operation == ir_binop_all_equal));
+ break;
+
+ default:
+ printf("FINISHME: Handle matrix operation for %s\n",
+ orig_expr->operator_string());
+ abort();
+ }
+ orig_assign->remove();
+ this->made_progress = true;
+
+ return visit_continue;
+}
diff --git a/mesalib/src/glsl/main.cpp b/mesalib/src/glsl/main.cpp
index 096da93dc..873a4fa16 100644
--- a/mesalib/src/glsl/main.cpp
+++ b/mesalib/src/glsl/main.cpp
@@ -1,334 +1,345 @@
-/*
- * Copyright © 2008, 2009 Intel Corporation
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-#include <getopt.h>
-
-#include "ast.h"
-#include "glsl_parser_extras.h"
-#include "glsl_parser.h"
-#include "ir_optimization.h"
-#include "ir_print_visitor.h"
-#include "program.h"
-#include "loop_analysis.h"
-
-extern "C" struct gl_shader *
-_mesa_new_shader(struct gl_context *ctx, GLuint name, GLenum type);
-
-extern "C" void
-_mesa_reference_shader(struct gl_context *ctx, struct gl_shader **ptr,
- struct gl_shader *sh);
-
-/* Copied from shader_api.c for the stand-alone compiler.
- */
-void
-_mesa_reference_shader(struct gl_context *ctx, struct gl_shader **ptr,
- struct gl_shader *sh)
-{
- *ptr = sh;
-}
-
-struct gl_shader *
-_mesa_new_shader(struct gl_context *ctx, GLuint name, GLenum type)
-{
- struct gl_shader *shader;
-
- (void) ctx;
-
- assert(type == GL_FRAGMENT_SHADER || type == GL_VERTEX_SHADER);
- shader = rzalloc(NULL, struct gl_shader);
- if (shader) {
- shader->Type = type;
- shader->Name = name;
- shader->RefCount = 1;
- }
- return shader;
-}
-
-static void
-initialize_context(struct gl_context *ctx, gl_api api)
-{
- memset(ctx, 0, sizeof(*ctx));
-
- ctx->API = api;
-
- ctx->Extensions.ARB_ES2_compatibility = GL_TRUE;
- ctx->Extensions.ARB_draw_buffers = GL_TRUE;
- ctx->Extensions.ARB_draw_instanced = GL_TRUE;
- ctx->Extensions.ARB_fragment_coord_conventions = GL_TRUE;
- ctx->Extensions.EXT_texture_array = GL_TRUE;
- ctx->Extensions.NV_texture_rectangle = GL_TRUE;
-
- /* GLSL 1.30 isn't fully supported, but we need to advertise 1.30 so that
- * the built-in functions for 1.30 can be built.
- */
- ctx->Const.GLSLVersion = 130;
-
- /* 1.10 minimums. */
- ctx->Const.MaxLights = 8;
- ctx->Const.MaxClipPlanes = 8;
- ctx->Const.MaxTextureUnits = 2;
-
- /* More than the 1.10 minimum to appease parser tests taken from
- * apps that (hopefully) already checked the number of coords.
- */
- ctx->Const.MaxTextureCoordUnits = 4;
-
- ctx->Const.VertexProgram.MaxAttribs = 16;
- ctx->Const.VertexProgram.MaxUniformComponents = 512;
- ctx->Const.MaxVarying = 8;
- ctx->Const.MaxVertexTextureImageUnits = 0;
- ctx->Const.MaxCombinedTextureImageUnits = 2;
- ctx->Const.MaxTextureImageUnits = 2;
- ctx->Const.FragmentProgram.MaxUniformComponents = 64;
-
- ctx->Const.MaxDrawBuffers = 2;
-
- ctx->Driver.NewShader = _mesa_new_shader;
-}
-
-/* Returned string will have 'ctx' as its ralloc owner. */
-static char *
-load_text_file(void *ctx, const char *file_name)
-{
- char *text = NULL;
- size_t size;
- size_t total_read = 0;
- FILE *fp = fopen(file_name, "rb");
-
- if (!fp) {
- return NULL;
- }
-
- fseek(fp, 0L, SEEK_END);
- size = ftell(fp);
- fseek(fp, 0L, SEEK_SET);
-
- text = (char *) ralloc_size(ctx, size + 1);
- if (text != NULL) {
- do {
- size_t bytes = fread(text + total_read,
- 1, size - total_read, fp);
- if (bytes < size - total_read) {
- free(text);
- text = NULL;
- break;
- }
-
- if (bytes == 0) {
- break;
- }
-
- total_read += bytes;
- } while (total_read < size);
-
- text[total_read] = '\0';
- }
-
- fclose(fp);
-
- return text;
-}
-
-int glsl_es = 0;
-int dump_ast = 0;
-int dump_hir = 0;
-int dump_lir = 0;
-int do_link = 0;
-
-const struct option compiler_opts[] = {
- { "glsl-es", 0, &glsl_es, 1 },
- { "dump-ast", 0, &dump_ast, 1 },
- { "dump-hir", 0, &dump_hir, 1 },
- { "dump-lir", 0, &dump_lir, 1 },
- { "link", 0, &do_link, 1 },
- { NULL, 0, NULL, 0 }
-};
-
-/**
- * \brief Print proper usage and exit with failure.
- */
-void
-usage_fail(const char *name)
-{
-
- const char *header =
- "usage: %s [options] <file.vert | file.geom | file.frag>\n"
- "\n"
- "Possible options are:\n";
- printf(header, name, name);
- for (const struct option *o = compiler_opts; o->name != 0; ++o) {
- printf(" --%s\n", o->name);
- }
- exit(EXIT_FAILURE);
-}
-
-
-void
-compile_shader(struct gl_context *ctx, struct gl_shader *shader)
-{
- struct _mesa_glsl_parse_state *state =
- new(shader) _mesa_glsl_parse_state(ctx, shader->Type, shader);
-
- const char *source = shader->Source;
- state->error = preprocess(state, &source, &state->info_log,
- state->extensions, ctx->API) != 0;
-
- if (!state->error) {
- _mesa_glsl_lexer_ctor(state, source);
- _mesa_glsl_parse(state);
- _mesa_glsl_lexer_dtor(state);
- }
-
- if (dump_ast) {
- foreach_list_const(n, &state->translation_unit) {
- ast_node *ast = exec_node_data(ast_node, n, link);
- ast->print();
- }
- printf("\n\n");
- }
-
- shader->ir = new(shader) exec_list;
- if (!state->error && !state->translation_unit.is_empty())
- _mesa_ast_to_hir(shader->ir, state);
-
- /* Print out the unoptimized IR. */
- if (!state->error && dump_hir) {
- validate_ir_tree(shader->ir);
- _mesa_print_ir(shader->ir, state);
- }
-
- /* Optimization passes */
- if (!state->error && !shader->ir->is_empty()) {
- bool progress;
- do {
- progress = do_common_optimization(shader->ir, false, 32);
- } while (progress);
-
- validate_ir_tree(shader->ir);
- }
-
-
- /* Print out the resulting IR */
- if (!state->error && dump_lir) {
- _mesa_print_ir(shader->ir, state);
- }
-
- shader->symbols = state->symbols;
- shader->CompileStatus = !state->error;
- shader->Version = state->language_version;
- memcpy(shader->builtins_to_link, state->builtins_to_link,
- sizeof(shader->builtins_to_link[0]) * state->num_builtins_to_link);
- shader->num_builtins_to_link = state->num_builtins_to_link;
-
- if (shader->InfoLog)
- ralloc_free(shader->InfoLog);
-
- shader->InfoLog = state->info_log;
-
- /* Retain any live IR, but trash the rest. */
- reparent_ir(shader->ir, shader);
-
- ralloc_free(state);
-
- return;
-}
-
-int
-main(int argc, char **argv)
-{
- int status = EXIT_SUCCESS;
- struct gl_context local_ctx;
- struct gl_context *ctx = &local_ctx;
-
- int c;
- int idx = 0;
- while ((c = getopt_long(argc, argv, "", compiler_opts, &idx)) != -1)
- /* empty */ ;
-
-
- if (argc <= optind)
- usage_fail(argv[0]);
-
- initialize_context(ctx, (glsl_es) ? API_OPENGLES2 : API_OPENGL);
-
- struct gl_shader_program *whole_program;
-
- whole_program = rzalloc (NULL, struct gl_shader_program);
- assert(whole_program != NULL);
-
- for (/* empty */; argc > optind; optind++) {
- whole_program->Shaders =
- reralloc(whole_program, whole_program->Shaders,
- struct gl_shader *, whole_program->NumShaders + 1);
- assert(whole_program->Shaders != NULL);
-
- struct gl_shader *shader = rzalloc(whole_program, gl_shader);
-
- whole_program->Shaders[whole_program->NumShaders] = shader;
- whole_program->NumShaders++;
-
- const unsigned len = strlen(argv[optind]);
- if (len < 6)
- usage_fail(argv[0]);
-
- const char *const ext = & argv[optind][len - 5];
- if (strncmp(".vert", ext, 5) == 0)
- shader->Type = GL_VERTEX_SHADER;
- else if (strncmp(".geom", ext, 5) == 0)
- shader->Type = GL_GEOMETRY_SHADER;
- else if (strncmp(".frag", ext, 5) == 0)
- shader->Type = GL_FRAGMENT_SHADER;
- else
- usage_fail(argv[0]);
-
- shader->Source = load_text_file(whole_program, argv[optind]);
- if (shader->Source == NULL) {
- printf("File \"%s\" does not exist.\n", argv[optind]);
- exit(EXIT_FAILURE);
- }
-
- compile_shader(ctx, shader);
-
- if (!shader->CompileStatus) {
- printf("Info log for %s:\n%s\n", argv[optind], shader->InfoLog);
- status = EXIT_FAILURE;
- break;
- }
- }
-
- if ((status == EXIT_SUCCESS) && do_link) {
- link_shaders(ctx, whole_program);
- status = (whole_program->LinkStatus) ? EXIT_SUCCESS : EXIT_FAILURE;
-
- if (strlen(whole_program->InfoLog) > 0)
- printf("Info log for linking:\n%s\n", whole_program->InfoLog);
- }
-
- for (unsigned i = 0; i < MESA_SHADER_TYPES; i++)
- ralloc_free(whole_program->_LinkedShaders[i]);
-
- ralloc_free(whole_program);
- _mesa_glsl_release_types();
- _mesa_glsl_release_functions();
-
- return status;
-}
+/*
+ * Copyright © 2008, 2009 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+#include <io.h>
+
+#ifdef _MSC_VER
+#define __STDC__ 1
+#include <getopt.h>
+#define open _open
+#define read _read
+#define fstat _fstat
+#define stat _stat
+#define close _close
+#define O_RDONLY _O_RDONLY
+#endif
+
+#include "ast.h"
+#include "glsl_parser_extras.h"
+#include "glsl_parser.h"
+#include "ir_optimization.h"
+#include "ir_print_visitor.h"
+#include "program.h"
+#include "loop_analysis.h"
+
+extern "C" struct gl_shader *
+_mesa_new_shader(struct gl_context *ctx, GLuint name, GLenum type);
+
+extern "C" void
+_mesa_reference_shader(struct gl_context *ctx, struct gl_shader **ptr,
+ struct gl_shader *sh);
+
+/* Copied from shader_api.c for the stand-alone compiler.
+ */
+void
+_mesa_reference_shader(struct gl_context *ctx, struct gl_shader **ptr,
+ struct gl_shader *sh)
+{
+ *ptr = sh;
+}
+
+struct gl_shader *
+_mesa_new_shader(struct gl_context *ctx, GLuint name, GLenum type)
+{
+ struct gl_shader *shader;
+
+ (void) ctx;
+
+ assert(type == GL_FRAGMENT_SHADER || type == GL_VERTEX_SHADER);
+ shader = rzalloc(NULL, struct gl_shader);
+ if (shader) {
+ shader->Type = type;
+ shader->Name = name;
+ shader->RefCount = 1;
+ }
+ return shader;
+}
+
+static void
+initialize_context(struct gl_context *ctx, gl_api api)
+{
+ memset(ctx, 0, sizeof(*ctx));
+
+ ctx->API = api;
+
+ ctx->Extensions.ARB_ES2_compatibility = GL_TRUE;
+ ctx->Extensions.ARB_draw_buffers = GL_TRUE;
+ ctx->Extensions.ARB_draw_instanced = GL_TRUE;
+ ctx->Extensions.ARB_fragment_coord_conventions = GL_TRUE;
+ ctx->Extensions.EXT_texture_array = GL_TRUE;
+ ctx->Extensions.NV_texture_rectangle = GL_TRUE;
+
+ /* GLSL 1.30 isn't fully supported, but we need to advertise 1.30 so that
+ * the built-in functions for 1.30 can be built.
+ */
+ ctx->Const.GLSLVersion = 130;
+
+ /* 1.10 minimums. */
+ ctx->Const.MaxLights = 8;
+ ctx->Const.MaxClipPlanes = 8;
+ ctx->Const.MaxTextureUnits = 2;
+
+ /* More than the 1.10 minimum to appease parser tests taken from
+ * apps that (hopefully) already checked the number of coords.
+ */
+ ctx->Const.MaxTextureCoordUnits = 4;
+
+ ctx->Const.VertexProgram.MaxAttribs = 16;
+ ctx->Const.VertexProgram.MaxUniformComponents = 512;
+ ctx->Const.MaxVarying = 8;
+ ctx->Const.MaxVertexTextureImageUnits = 0;
+ ctx->Const.MaxCombinedTextureImageUnits = 2;
+ ctx->Const.MaxTextureImageUnits = 2;
+ ctx->Const.FragmentProgram.MaxUniformComponents = 64;
+
+ ctx->Const.MaxDrawBuffers = 2;
+
+ ctx->Driver.NewShader = _mesa_new_shader;
+}
+
+/* Returned string will have 'ctx' as its ralloc owner. */
+static char *
+load_text_file(void *ctx, const char *file_name)
+{
+ char *text = NULL;
+ size_t size;
+ size_t total_read = 0;
+ FILE *fp = fopen(file_name, "rb");
+
+ if (!fp) {
+ return NULL;
+ }
+
+ fseek(fp, 0L, SEEK_END);
+ size = ftell(fp);
+ fseek(fp, 0L, SEEK_SET);
+
+ text = (char *) ralloc_size(ctx, size + 1);
+ if (text != NULL) {
+ do {
+ size_t bytes = fread(text + total_read,
+ 1, size - total_read, fp);
+ if (bytes < size - total_read) {
+ free(text);
+ text = NULL;
+ break;
+ }
+
+ if (bytes == 0) {
+ break;
+ }
+
+ total_read += bytes;
+ } while (total_read < size);
+
+ text[total_read] = '\0';
+ }
+
+ fclose(fp);
+
+ return text;
+}
+
+int glsl_es = 0;
+int dump_ast = 0;
+int dump_hir = 0;
+int dump_lir = 0;
+int do_link = 0;
+
+const struct option compiler_opts[] = {
+ { "glsl-es", 0, &glsl_es, 1 },
+ { "dump-ast", 0, &dump_ast, 1 },
+ { "dump-hir", 0, &dump_hir, 1 },
+ { "dump-lir", 0, &dump_lir, 1 },
+ { "link", 0, &do_link, 1 },
+ { NULL, 0, NULL, 0 }
+};
+
+/**
+ * \brief Print proper usage and exit with failure.
+ */
+void
+usage_fail(const char *name)
+{
+
+ const char *header =
+ "usage: %s [options] <file.vert | file.geom | file.frag>\n"
+ "\n"
+ "Possible options are:\n";
+ printf(header, name, name);
+ for (const struct option *o = compiler_opts; o->name != 0; ++o) {
+ printf(" --%s\n", o->name);
+ }
+ exit(EXIT_FAILURE);
+}
+
+
+void
+compile_shader(struct gl_context *ctx, struct gl_shader *shader)
+{
+ struct _mesa_glsl_parse_state *state =
+ new(shader) _mesa_glsl_parse_state(ctx, shader->Type, shader);
+
+ const char *source = shader->Source;
+ state->error = preprocess(state, &source, &state->info_log,
+ state->extensions, ctx->API) != 0;
+
+ if (!state->error) {
+ _mesa_glsl_lexer_ctor(state, source);
+ _mesa_glsl_parse(state);
+ _mesa_glsl_lexer_dtor(state);
+ }
+
+ if (dump_ast) {
+ foreach_list_const(n, &state->translation_unit) {
+ ast_node *ast = exec_node_data(ast_node, n, link);
+ ast->print();
+ }
+ printf("\n\n");
+ }
+
+ shader->ir = new(shader) exec_list;
+ if (!state->error && !state->translation_unit.is_empty())
+ _mesa_ast_to_hir(shader->ir, state);
+
+ /* Print out the unoptimized IR. */
+ if (!state->error && dump_hir) {
+ validate_ir_tree(shader->ir);
+ _mesa_print_ir(shader->ir, state);
+ }
+
+ /* Optimization passes */
+ if (!state->error && !shader->ir->is_empty()) {
+ bool progress;
+ do {
+ progress = do_common_optimization(shader->ir, false, 32);
+ } while (progress);
+
+ validate_ir_tree(shader->ir);
+ }
+
+
+ /* Print out the resulting IR */
+ if (!state->error && dump_lir) {
+ _mesa_print_ir(shader->ir, state);
+ }
+
+ shader->symbols = state->symbols;
+ shader->CompileStatus = !state->error;
+ shader->Version = state->language_version;
+ memcpy(shader->builtins_to_link, state->builtins_to_link,
+ sizeof(shader->builtins_to_link[0]) * state->num_builtins_to_link);
+ shader->num_builtins_to_link = state->num_builtins_to_link;
+
+ if (shader->InfoLog)
+ ralloc_free(shader->InfoLog);
+
+ shader->InfoLog = state->info_log;
+
+ /* Retain any live IR, but trash the rest. */
+ reparent_ir(shader->ir, shader);
+
+ ralloc_free(state);
+
+ return;
+}
+
+int
+main(int argc, char **argv)
+{
+ int status = EXIT_SUCCESS;
+ struct gl_context local_ctx;
+ struct gl_context *ctx = &local_ctx;
+
+ int c;
+ int idx = 0;
+ while ((c = getopt_long(argc, argv, "", compiler_opts, &idx)) != -1)
+ /* empty */ ;
+
+
+ if (argc <= optind)
+ usage_fail(argv[0]);
+
+ initialize_context(ctx, (glsl_es) ? API_OPENGLES2 : API_OPENGL);
+
+ struct gl_shader_program *whole_program;
+
+ whole_program = rzalloc (NULL, struct gl_shader_program);
+ assert(whole_program != NULL);
+
+ for (/* empty */; argc > optind; optind++) {
+ whole_program->Shaders =
+ reralloc(whole_program, whole_program->Shaders,
+ struct gl_shader *, whole_program->NumShaders + 1);
+ assert(whole_program->Shaders != NULL);
+
+ struct gl_shader *shader = rzalloc(whole_program, gl_shader);
+
+ whole_program->Shaders[whole_program->NumShaders] = shader;
+ whole_program->NumShaders++;
+
+ const unsigned len = strlen(argv[optind]);
+ if (len < 6)
+ usage_fail(argv[0]);
+
+ const char *const ext = & argv[optind][len - 5];
+ if (strncmp(".vert", ext, 5) == 0)
+ shader->Type = GL_VERTEX_SHADER;
+ else if (strncmp(".geom", ext, 5) == 0)
+ shader->Type = GL_GEOMETRY_SHADER;
+ else if (strncmp(".frag", ext, 5) == 0)
+ shader->Type = GL_FRAGMENT_SHADER;
+ else
+ usage_fail(argv[0]);
+
+ shader->Source = load_text_file(whole_program, argv[optind]);
+ if (shader->Source == NULL) {
+ printf("File \"%s\" does not exist.\n", argv[optind]);
+ exit(EXIT_FAILURE);
+ }
+
+ compile_shader(ctx, shader);
+
+ if (!shader->CompileStatus) {
+ printf("Info log for %s:\n%s\n", argv[optind], shader->InfoLog);
+ status = EXIT_FAILURE;
+ break;
+ }
+ }
+
+ if ((status == EXIT_SUCCESS) && do_link) {
+ link_shaders(ctx, whole_program);
+ status = (whole_program->LinkStatus) ? EXIT_SUCCESS : EXIT_FAILURE;
+
+ if (strlen(whole_program->InfoLog) > 0)
+ printf("Info log for linking:\n%s\n", whole_program->InfoLog);
+ }
+
+ for (unsigned i = 0; i < MESA_SHADER_TYPES; i++)
+ ralloc_free(whole_program->_LinkedShaders[i]);
+
+ ralloc_free(whole_program);
+ _mesa_glsl_release_types();
+ _mesa_glsl_release_functions();
+
+ return status;
+}
diff --git a/mesalib/src/glsl/opt_constant_propagation.cpp b/mesalib/src/glsl/opt_constant_propagation.cpp
index 4425f4211..55c271200 100644
--- a/mesalib/src/glsl/opt_constant_propagation.cpp
+++ b/mesalib/src/glsl/opt_constant_propagation.cpp
@@ -1,434 +1,434 @@
-/*
- * Copyright © 2010 Intel Corporation
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * constant of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, constant, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above constantright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE AUTHORS OR CONSTANTRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-
-/**
- * \file opt_constant_propagation.cpp
- *
- * Tracks assignments of constants to channels of variables, and
- * usage of those constant channels with direct usage of the constants.
- *
- * This can lead to constant folding and algebraic optimizations in
- * those later expressions, while causing no increase in instruction
- * count (due to constants being generally free to load from a
- * constant push buffer or as instruction immediate values) and
- * possibly reducing register pressure.
- */
-
-#include "ir.h"
-#include "ir_visitor.h"
-#include "ir_rvalue_visitor.h"
-#include "ir_basic_block.h"
-#include "ir_optimization.h"
-#include "glsl_types.h"
-
-class acp_entry : public exec_node
-{
-public:
- acp_entry(ir_variable *var, unsigned write_mask, ir_constant *constant)
- {
- assert(var);
- assert(constant);
- this->var = var;
- this->write_mask = write_mask;
- this->constant = constant;
- }
-
- ir_variable *var;
- ir_constant *constant;
- unsigned write_mask;
-};
-
-
-class kill_entry : public exec_node
-{
-public:
- kill_entry(ir_variable *var, unsigned write_mask)
- {
- assert(var);
- this->var = var;
- this->write_mask = write_mask;
- }
-
- ir_variable *var;
- unsigned write_mask;
-};
-
-class ir_constant_propagation_visitor : public ir_rvalue_visitor {
-public:
- ir_constant_propagation_visitor()
- {
- progress = false;
- mem_ctx = ralloc_context(0);
- this->acp = new(mem_ctx) exec_list;
- this->kills = new(mem_ctx) exec_list;
- }
- ~ir_constant_propagation_visitor()
- {
- ralloc_free(mem_ctx);
- }
-
- virtual ir_visitor_status visit_enter(class ir_loop *);
- virtual ir_visitor_status visit_enter(class ir_function_signature *);
- virtual ir_visitor_status visit_enter(class ir_function *);
- virtual ir_visitor_status visit_leave(class ir_assignment *);
- virtual ir_visitor_status visit_enter(class ir_call *);
- virtual ir_visitor_status visit_enter(class ir_if *);
-
- void add_constant(ir_assignment *ir);
- void kill(ir_variable *ir, unsigned write_mask);
- void handle_if_block(exec_list *instructions);
- void handle_rvalue(ir_rvalue **rvalue);
-
- /** List of acp_entry: The available constants to propagate */
- exec_list *acp;
-
- /**
- * List of kill_entry: The masks of variables whose values were
- * killed in this block.
- */
- exec_list *kills;
-
- bool progress;
-
- bool killed_all;
-
- void *mem_ctx;
-};
-
-
-void
-ir_constant_propagation_visitor::handle_rvalue(ir_rvalue **rvalue)
-{
- if (this->in_assignee || !*rvalue)
- return;
-
- const glsl_type *type = (*rvalue)->type;
- if (!type->is_scalar() && !type->is_vector())
- return;
-
- ir_swizzle *swiz = NULL;
- ir_dereference_variable *deref = (*rvalue)->as_dereference_variable();
- if (!deref) {
- swiz = (*rvalue)->as_swizzle();
- if (!swiz)
- return;
-
- deref = swiz->val->as_dereference_variable();
- if (!deref)
- return;
- }
-
- ir_constant_data data;
- memset(&data, 0, sizeof(data));
-
- for (unsigned int i = 0; i < type->components(); i++) {
- int channel;
- acp_entry *found = NULL;
-
- if (swiz) {
- switch (i) {
- case 0: channel = swiz->mask.x; break;
- case 1: channel = swiz->mask.y; break;
- case 2: channel = swiz->mask.z; break;
- case 3: channel = swiz->mask.w; break;
- default: assert(!"shouldn't be reached"); channel = 0; break;
- }
- } else {
- channel = i;
- }
-
- foreach_iter(exec_list_iterator, iter, *this->acp) {
- acp_entry *entry = (acp_entry *)iter.get();
- if (entry->var == deref->var && entry->write_mask & (1 << channel)) {
- found = entry;
- break;
- }
- }
-
- if (!found)
- return;
-
- int rhs_channel = 0;
- for (int j = 0; j < 4; j++) {
- if (j == channel)
- break;
- if (found->write_mask & (1 << j))
- rhs_channel++;
- }
-
- switch (type->base_type) {
- case GLSL_TYPE_FLOAT:
- data.f[i] = found->constant->value.f[rhs_channel];
- break;
- case GLSL_TYPE_INT:
- data.i[i] = found->constant->value.i[rhs_channel];
- break;
- case GLSL_TYPE_UINT:
- data.u[i] = found->constant->value.u[rhs_channel];
- break;
- case GLSL_TYPE_BOOL:
- data.b[i] = found->constant->value.b[rhs_channel];
- break;
- default:
- assert(!"not reached");
- break;
- }
- }
-
- *rvalue = new(ralloc_parent(deref)) ir_constant(type, &data);
- this->progress = true;
-}
-
-ir_visitor_status
-ir_constant_propagation_visitor::visit_enter(ir_function_signature *ir)
-{
- /* Treat entry into a function signature as a completely separate
- * block. Any instructions at global scope will be shuffled into
- * main() at link time, so they're irrelevant to us.
- */
- exec_list *orig_acp = this->acp;
- exec_list *orig_kills = this->kills;
- bool orig_killed_all = this->killed_all;
-
- this->acp = new(mem_ctx) exec_list;
- this->kills = new(mem_ctx) exec_list;
- this->killed_all = false;
-
- visit_list_elements(this, &ir->body);
-
- this->kills = orig_kills;
- this->acp = orig_acp;
- this->killed_all = orig_killed_all;
-
- return visit_continue_with_parent;
-}
-
-ir_visitor_status
-ir_constant_propagation_visitor::visit_leave(ir_assignment *ir)
-{
- if (this->in_assignee)
- return visit_continue;
-
- kill(ir->lhs->variable_referenced(), ir->write_mask);
-
- add_constant(ir);
-
- return visit_continue;
-}
-
-ir_visitor_status
-ir_constant_propagation_visitor::visit_enter(ir_function *ir)
-{
- (void) ir;
- return visit_continue;
-}
-
-ir_visitor_status
-ir_constant_propagation_visitor::visit_enter(ir_call *ir)
-{
- /* Do constant propagation on call parameters, but skip any out params */
- exec_list_iterator sig_param_iter = ir->get_callee()->parameters.iterator();
- foreach_iter(exec_list_iterator, iter, ir->actual_parameters) {
- ir_variable *sig_param = (ir_variable *)sig_param_iter.get();
- ir_rvalue *param = (ir_rvalue *)iter.get();
- if (sig_param->mode != ir_var_out && sig_param->mode != ir_var_inout) {
- ir_rvalue *new_param = param;
- handle_rvalue(&new_param);
- if (new_param != param)
- param->replace_with(new_param);
- else
- param->accept(this);
- }
- sig_param_iter.next();
- }
-
- /* Since we're unlinked, we don't (necssarily) know the side effects of
- * this call. So kill all copies.
- */
- acp->make_empty();
- this->killed_all = true;
-
- return visit_continue_with_parent;
-}
-
-void
-ir_constant_propagation_visitor::handle_if_block(exec_list *instructions)
-{
- exec_list *orig_acp = this->acp;
- exec_list *orig_kills = this->kills;
- bool orig_killed_all = this->killed_all;
-
- this->acp = new(mem_ctx) exec_list;
- this->kills = new(mem_ctx) exec_list;
- this->killed_all = false;
-
- /* Populate the initial acp with a constant of the original */
- foreach_iter(exec_list_iterator, iter, *orig_acp) {
- acp_entry *a = (acp_entry *)iter.get();
- this->acp->push_tail(new(this->mem_ctx) acp_entry(a->var, a->write_mask,
- a->constant));
- }
-
- visit_list_elements(this, instructions);
-
- if (this->killed_all) {
- orig_acp->make_empty();
- }
-
- exec_list *new_kills = this->kills;
- this->kills = orig_kills;
- this->acp = orig_acp;
- this->killed_all = this->killed_all || orig_killed_all;
-
- foreach_iter(exec_list_iterator, iter, *new_kills) {
- kill_entry *k = (kill_entry *)iter.get();
- kill(k->var, k->write_mask);
- }
-}
-
-ir_visitor_status
-ir_constant_propagation_visitor::visit_enter(ir_if *ir)
-{
- ir->condition->accept(this);
- handle_rvalue(&ir->condition);
-
- handle_if_block(&ir->then_instructions);
- handle_if_block(&ir->else_instructions);
-
- /* handle_if_block() already descended into the children. */
- return visit_continue_with_parent;
-}
-
-ir_visitor_status
-ir_constant_propagation_visitor::visit_enter(ir_loop *ir)
-{
- exec_list *orig_acp = this->acp;
- exec_list *orig_kills = this->kills;
- bool orig_killed_all = this->killed_all;
-
- /* FINISHME: For now, the initial acp for loops is totally empty.
- * We could go through once, then go through again with the acp
- * cloned minus the killed entries after the first run through.
- */
- this->acp = new(mem_ctx) exec_list;
- this->kills = new(mem_ctx) exec_list;
- this->killed_all = false;
-
- visit_list_elements(this, &ir->body_instructions);
-
- if (this->killed_all) {
- orig_acp->make_empty();
- }
-
- exec_list *new_kills = this->kills;
- this->kills = orig_kills;
- this->acp = orig_acp;
- this->killed_all = this->killed_all || orig_killed_all;
-
- foreach_iter(exec_list_iterator, iter, *new_kills) {
- kill_entry *k = (kill_entry *)iter.get();
- kill(k->var, k->write_mask);
- }
-
- /* already descended into the children. */
- return visit_continue_with_parent;
-}
-
-void
-ir_constant_propagation_visitor::kill(ir_variable *var, unsigned write_mask)
-{
- assert(var != NULL);
-
- /* We don't track non-vectors. */
- if (!var->type->is_vector() && !var->type->is_scalar())
- return;
-
- /* Remove any entries currently in the ACP for this kill. */
- foreach_iter(exec_list_iterator, iter, *this->acp) {
- acp_entry *entry = (acp_entry *)iter.get();
-
- if (entry->var == var) {
- entry->write_mask &= ~write_mask;
- if (entry->write_mask == 0)
- entry->remove();
- }
- }
-
- /* Add this writemask of the variable to the list of killed
- * variables in this block.
- */
- foreach_iter(exec_list_iterator, iter, *this->kills) {
- kill_entry *entry = (kill_entry *)iter.get();
-
- if (entry->var == var) {
- entry->write_mask |= write_mask;
- return;
- }
- }
- /* Not already in the list. Make new entry. */
- this->kills->push_tail(new(this->mem_ctx) kill_entry(var, write_mask));
-}
-
-/**
- * Adds an entry to the available constant list if it's a plain assignment
- * of a variable to a variable.
- */
-void
-ir_constant_propagation_visitor::add_constant(ir_assignment *ir)
-{
- acp_entry *entry;
-
- if (ir->condition)
- return;
-
- if (!ir->write_mask)
- return;
-
- ir_dereference_variable *deref = ir->lhs->as_dereference_variable();
- ir_constant *constant = ir->rhs->as_constant();
-
- if (!deref || !constant)
- return;
-
- /* Only do constant propagation on vectors. Constant matrices,
- * arrays, or structures would require more work elsewhere.
- */
- if (!deref->var->type->is_vector() && !deref->var->type->is_scalar())
- return;
-
- entry = new(this->mem_ctx) acp_entry(deref->var, ir->write_mask, constant);
- this->acp->push_tail(entry);
-}
-
-/**
- * Does a constant propagation pass on the code present in the instruction stream.
- */
-bool
-do_constant_propagation(exec_list *instructions)
-{
- ir_constant_propagation_visitor v;
-
- visit_list_elements(&v, instructions);
-
- return v.progress;
-}
+/*
+ * Copyright © 2010 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * constant of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, constant, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above constantright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR CONSTANTRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+/**
+ * \file opt_constant_propagation.cpp
+ *
+ * Tracks assignments of constants to channels of variables, and
+ * usage of those constant channels with direct usage of the constants.
+ *
+ * This can lead to constant folding and algebraic optimizations in
+ * those later expressions, while causing no increase in instruction
+ * count (due to constants being generally free to load from a
+ * constant push buffer or as instruction immediate values) and
+ * possibly reducing register pressure.
+ */
+
+#include "ir.h"
+#include "ir_visitor.h"
+#include "ir_rvalue_visitor.h"
+#include "ir_basic_block.h"
+#include "ir_optimization.h"
+#include "glsl_types.h"
+
+class acp_entry : public exec_node
+{
+public:
+ acp_entry(ir_variable *var, unsigned write_mask, ir_constant *constant)
+ {
+ assert(var);
+ assert(constant);
+ this->var = var;
+ this->write_mask = write_mask;
+ this->constant = constant;
+ }
+
+ ir_variable *var;
+ ir_constant *constant;
+ unsigned write_mask;
+};
+
+
+class kill_entry : public exec_node
+{
+public:
+ kill_entry(ir_variable *var, unsigned write_mask)
+ {
+ assert(var);
+ this->var = var;
+ this->write_mask = write_mask;
+ }
+
+ ir_variable *var;
+ unsigned write_mask;
+};
+
+class ir_constant_propagation_visitor : public ir_rvalue_visitor {
+public:
+ ir_constant_propagation_visitor()
+ {
+ progress = false;
+ mem_ctx = ralloc_context(0);
+ this->acp = new(mem_ctx) exec_list;
+ this->kills = new(mem_ctx) exec_list;
+ }
+ ~ir_constant_propagation_visitor()
+ {
+ ralloc_free(mem_ctx);
+ }
+
+ virtual ir_visitor_status visit_enter(class ir_loop *);
+ virtual ir_visitor_status visit_enter(class ir_function_signature *);
+ virtual ir_visitor_status visit_enter(class ir_function *);
+ virtual ir_visitor_status visit_leave(class ir_assignment *);
+ virtual ir_visitor_status visit_enter(class ir_call *);
+ virtual ir_visitor_status visit_enter(class ir_if *);
+
+ void add_constant(ir_assignment *ir);
+ void kill(ir_variable *ir, unsigned write_mask);
+ void handle_if_block(exec_list *instructions);
+ void handle_rvalue(ir_rvalue **rvalue);
+
+ /** List of acp_entry: The available constants to propagate */
+ exec_list *acp;
+
+ /**
+ * List of kill_entry: The masks of variables whose values were
+ * killed in this block.
+ */
+ exec_list *kills;
+
+ bool progress;
+
+ bool killed_all;
+
+ void *mem_ctx;
+};
+
+
+void
+ir_constant_propagation_visitor::handle_rvalue(ir_rvalue **rvalue)
+{
+ if (this->in_assignee || !*rvalue)
+ return;
+
+ const glsl_type *type = (*rvalue)->type;
+ if (!type->is_scalar() && !type->is_vector())
+ return;
+
+ ir_swizzle *swiz = NULL;
+ ir_dereference_variable *deref = (*rvalue)->as_dereference_variable();
+ if (!deref) {
+ swiz = (*rvalue)->as_swizzle();
+ if (!swiz)
+ return;
+
+ deref = swiz->val->as_dereference_variable();
+ if (!deref)
+ return;
+ }
+
+ ir_constant_data data;
+ memset(&data, 0, sizeof(data));
+
+ for (unsigned int i = 0; i < type->components(); i++) {
+ int channel;
+ acp_entry *found = NULL;
+
+ if (swiz) {
+ switch (i) {
+ case 0: channel = swiz->mask.x; break;
+ case 1: channel = swiz->mask.y; break;
+ case 2: channel = swiz->mask.z; break;
+ case 3: channel = swiz->mask.w; break;
+ default: assert(!"shouldn't be reached"); channel = 0; break;
+ }
+ } else {
+ channel = i;
+ }
+
+ foreach_iter(exec_list_iterator, iter, *this->acp) {
+ acp_entry *entry = (acp_entry *)iter.get();
+ if (entry->var == deref->var && entry->write_mask & (1 << channel)) {
+ found = entry;
+ break;
+ }
+ }
+
+ if (!found)
+ return;
+
+ int rhs_channel = 0;
+ for (int j = 0; j < 4; j++) {
+ if (j == channel)
+ break;
+ if (found->write_mask & (1 << j))
+ rhs_channel++;
+ }
+
+ switch (type->base_type) {
+ case GLSL_TYPE_FLOAT:
+ data.f[i] = found->constant->value.f[rhs_channel];
+ break;
+ case GLSL_TYPE_INT:
+ data.i[i] = found->constant->value.i[rhs_channel];
+ break;
+ case GLSL_TYPE_UINT:
+ data.u[i] = found->constant->value.u[rhs_channel];
+ break;
+ case GLSL_TYPE_BOOL:
+ data.b[i] = found->constant->value.b[rhs_channel];
+ break;
+ default:
+ assert(!"not reached");
+ break;
+ }
+ }
+
+ *rvalue = new(ralloc_parent(deref)) ir_constant(type, &data);
+ this->progress = true;
+}
+
+ir_visitor_status
+ir_constant_propagation_visitor::visit_enter(ir_function_signature *ir)
+{
+ /* Treat entry into a function signature as a completely separate
+ * block. Any instructions at global scope will be shuffled into
+ * main() at link time, so they're irrelevant to us.
+ */
+ exec_list *orig_acp = this->acp;
+ exec_list *orig_kills = this->kills;
+ bool orig_killed_all = this->killed_all;
+
+ this->acp = new(mem_ctx) exec_list;
+ this->kills = new(mem_ctx) exec_list;
+ this->killed_all = false;
+
+ visit_list_elements(this, &ir->body);
+
+ this->kills = orig_kills;
+ this->acp = orig_acp;
+ this->killed_all = orig_killed_all;
+
+ return visit_continue_with_parent;
+}
+
+ir_visitor_status
+ir_constant_propagation_visitor::visit_leave(ir_assignment *ir)
+{
+ if (this->in_assignee)
+ return visit_continue;
+
+ kill(ir->lhs->variable_referenced(), ir->write_mask);
+
+ add_constant(ir);
+
+ return visit_continue;
+}
+
+ir_visitor_status
+ir_constant_propagation_visitor::visit_enter(ir_function *ir)
+{
+ (void) ir;
+ return visit_continue;
+}
+
+ir_visitor_status
+ir_constant_propagation_visitor::visit_enter(ir_call *ir)
+{
+ /* Do constant propagation on call parameters, but skip any out params */
+ exec_list_iterator sig_param_iter = ir->get_callee()->parameters.iterator();
+ foreach_iter(exec_list_iterator, iter, ir->actual_parameters) {
+ ir_variable *sig_param = (ir_variable *)sig_param_iter.get();
+ ir_rvalue *param = (ir_rvalue *)iter.get();
+ if (sig_param->mode != ir_var_out && sig_param->mode != ir_var_inout) {
+ ir_rvalue *new_param = param;
+ handle_rvalue(&new_param);
+ if (new_param != param)
+ param->replace_with(new_param);
+ else
+ param->accept(this);
+ }
+ sig_param_iter.next();
+ }
+
+ /* Since we're unlinked, we don't (necssarily) know the side effects of
+ * this call. So kill all copies.
+ */
+ acp->make_empty();
+ this->killed_all = true;
+
+ return visit_continue_with_parent;
+}
+
+void
+ir_constant_propagation_visitor::handle_if_block(exec_list *instructions)
+{
+ exec_list *orig_acp = this->acp;
+ exec_list *orig_kills = this->kills;
+ bool orig_killed_all = this->killed_all;
+
+ this->acp = new(mem_ctx) exec_list;
+ this->kills = new(mem_ctx) exec_list;
+ this->killed_all = false;
+
+ /* Populate the initial acp with a constant of the original */
+ foreach_iter(exec_list_iterator, iter, *orig_acp) {
+ acp_entry *a = (acp_entry *)iter.get();
+ this->acp->push_tail(new(this->mem_ctx) acp_entry(a->var, a->write_mask,
+ a->constant));
+ }
+
+ visit_list_elements(this, instructions);
+
+ if (this->killed_all) {
+ orig_acp->make_empty();
+ }
+
+ exec_list *new_kills = this->kills;
+ this->kills = orig_kills;
+ this->acp = orig_acp;
+ this->killed_all = this->killed_all || orig_killed_all;
+
+ foreach_iter(exec_list_iterator, iter, *new_kills) {
+ kill_entry *k = (kill_entry *)iter.get();
+ kill(k->var, k->write_mask);
+ }
+}
+
+ir_visitor_status
+ir_constant_propagation_visitor::visit_enter(ir_if *ir)
+{
+ ir->condition->accept(this);
+ handle_rvalue(&ir->condition);
+
+ handle_if_block(&ir->then_instructions);
+ handle_if_block(&ir->else_instructions);
+
+ /* handle_if_block() already descended into the children. */
+ return visit_continue_with_parent;
+}
+
+ir_visitor_status
+ir_constant_propagation_visitor::visit_enter(ir_loop *ir)
+{
+ exec_list *orig_acp = this->acp;
+ exec_list *orig_kills = this->kills;
+ bool orig_killed_all = this->killed_all;
+
+ /* FINISHME: For now, the initial acp for loops is totally empty.
+ * We could go through once, then go through again with the acp
+ * cloned minus the killed entries after the first run through.
+ */
+ this->acp = new(mem_ctx) exec_list;
+ this->kills = new(mem_ctx) exec_list;
+ this->killed_all = false;
+
+ visit_list_elements(this, &ir->body_instructions);
+
+ if (this->killed_all) {
+ orig_acp->make_empty();
+ }
+
+ exec_list *new_kills = this->kills;
+ this->kills = orig_kills;
+ this->acp = orig_acp;
+ this->killed_all = this->killed_all || orig_killed_all;
+
+ foreach_iter(exec_list_iterator, iter, *new_kills) {
+ kill_entry *k = (kill_entry *)iter.get();
+ kill(k->var, k->write_mask);
+ }
+
+ /* already descended into the children. */
+ return visit_continue_with_parent;
+}
+
+void
+ir_constant_propagation_visitor::kill(ir_variable *var, unsigned write_mask)
+{
+ assert(var != NULL);
+
+ /* We don't track non-vectors. */
+ if (!var->type->is_vector() && !var->type->is_scalar())
+ return;
+
+ /* Remove any entries currently in the ACP for this kill. */
+ foreach_iter(exec_list_iterator, iter, *this->acp) {
+ acp_entry *entry = (acp_entry *)iter.get();
+
+ if (entry->var == var) {
+ entry->write_mask &= ~write_mask;
+ if (entry->write_mask == 0)
+ entry->remove();
+ }
+ }
+
+ /* Add this writemask of the variable to the list of killed
+ * variables in this block.
+ */
+ foreach_iter(exec_list_iterator, iter, *this->kills) {
+ kill_entry *entry = (kill_entry *)iter.get();
+
+ if (entry->var == var) {
+ entry->write_mask |= write_mask;
+ return;
+ }
+ }
+ /* Not already in the list. Make new entry. */
+ this->kills->push_tail(new(this->mem_ctx) kill_entry(var, write_mask));
+}
+
+/**
+ * Adds an entry to the available constant list if it's a plain assignment
+ * of a variable to a variable.
+ */
+void
+ir_constant_propagation_visitor::add_constant(ir_assignment *ir)
+{
+ acp_entry *entry;
+
+ if (ir->condition)
+ return;
+
+ if (!ir->write_mask)
+ return;
+
+ ir_dereference_variable *deref = ir->lhs->as_dereference_variable();
+ ir_constant *constant = ir->rhs->as_constant();
+
+ if (!deref || !constant)
+ return;
+
+ /* Only do constant propagation on vectors. Constant matrices,
+ * arrays, or structures would require more work elsewhere.
+ */
+ if (!deref->var->type->is_vector() && !deref->var->type->is_scalar())
+ return;
+
+ entry = new(this->mem_ctx) acp_entry(deref->var, ir->write_mask, constant);
+ this->acp->push_tail(entry);
+}
+
+/**
+ * Does a constant propagation pass on the code present in the instruction stream.
+ */
+bool
+do_constant_propagation(exec_list *instructions)
+{
+ ir_constant_propagation_visitor v;
+
+ visit_list_elements(&v, instructions);
+
+ return v.progress;
+}
diff --git a/mesalib/src/glsl/opt_constant_variable.cpp b/mesalib/src/glsl/opt_constant_variable.cpp
index 3fa7c3bad..f1aeaa99a 100644
--- a/mesalib/src/glsl/opt_constant_variable.cpp
+++ b/mesalib/src/glsl/opt_constant_variable.cpp
@@ -1,195 +1,195 @@
-/*
- * Copyright © 2010 Intel Corporation
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-
-/**
- * \file opt_constant_variable.cpp
- *
- * Marks variables assigned a single constant value over the course
- * of the program as constant.
- *
- * The goal here is to trigger further constant folding and then dead
- * code elimination. This is common with vector/matrix constructors
- * and calls to builtin functions.
- */
-
-#include "ir.h"
-#include "ir_visitor.h"
-#include "ir_optimization.h"
-#include "glsl_types.h"
-
-struct assignment_entry {
- exec_node link;
- int assignment_count;
- ir_variable *var;
- ir_constant *constval;
- bool our_scope;
-};
-
-class ir_constant_variable_visitor : public ir_hierarchical_visitor {
-public:
- virtual ir_visitor_status visit_enter(ir_dereference_variable *);
- virtual ir_visitor_status visit(ir_variable *);
- virtual ir_visitor_status visit_enter(ir_assignment *);
- virtual ir_visitor_status visit_enter(ir_call *);
-
- exec_list list;
-};
-
-static struct assignment_entry *
-get_assignment_entry(ir_variable *var, exec_list *list)
-{
- struct assignment_entry *entry;
-
- foreach_list_typed(struct assignment_entry, entry, link, list) {
- if (entry->var == var)
- return entry;
- }
-
- entry = (struct assignment_entry *)calloc(1, sizeof(*entry));
- entry->var = var;
- list->push_head(&entry->link);
- return entry;
-}
-
-ir_visitor_status
-ir_constant_variable_visitor::visit(ir_variable *ir)
-{
- struct assignment_entry *entry = get_assignment_entry(ir, &this->list);
- entry->our_scope = true;
- return visit_continue;
-}
-
-/* Skip derefs of variables so that we can detect declarations. */
-ir_visitor_status
-ir_constant_variable_visitor::visit_enter(ir_dereference_variable *ir)
-{
- (void)ir;
- return visit_continue_with_parent;
-}
-
-ir_visitor_status
-ir_constant_variable_visitor::visit_enter(ir_assignment *ir)
-{
- ir_constant *constval;
- struct assignment_entry *entry;
-
- entry = get_assignment_entry(ir->lhs->variable_referenced(), &this->list);
- assert(entry);
- entry->assignment_count++;
-
- /* If it's already constant, don't do the work. */
- if (entry->var->constant_value)
- return visit_continue;
-
- /* OK, now find if we actually have all the right conditions for
- * this to be a constant value assigned to the var.
- */
- if (ir->condition)
- return visit_continue;
-
- ir_variable *var = ir->whole_variable_written();
- if (!var)
- return visit_continue;
-
- constval = ir->rhs->constant_expression_value();
- if (!constval)
- return visit_continue;
-
- /* Mark this entry as having a constant assignment (if the
- * assignment count doesn't go >1). do_constant_variable will fix
- * up the variable with the constant value later.
- */
- entry->constval = constval;
-
- return visit_continue;
-}
-
-ir_visitor_status
-ir_constant_variable_visitor::visit_enter(ir_call *ir)
-{
- exec_list_iterator sig_iter = ir->get_callee()->parameters.iterator();
- foreach_iter(exec_list_iterator, iter, *ir) {
- ir_rvalue *param_rval = (ir_rvalue *)iter.get();
- ir_variable *param = (ir_variable *)sig_iter.get();
-
- if (param->mode == ir_var_out ||
- param->mode == ir_var_inout) {
- ir_variable *var = param_rval->variable_referenced();
- struct assignment_entry *entry;
-
- assert(var);
- entry = get_assignment_entry(var, &this->list);
- entry->assignment_count++;
- }
- sig_iter.next();
- }
- return visit_continue;
-}
-
-/**
- * Does a copy propagation pass on the code present in the instruction stream.
- */
-bool
-do_constant_variable(exec_list *instructions)
-{
- bool progress = false;
- ir_constant_variable_visitor v;
-
- v.run(instructions);
-
- while (!v.list.is_empty()) {
-
- struct assignment_entry *entry;
- entry = exec_node_data(struct assignment_entry, v.list.head, link);
-
- if (entry->assignment_count == 1 && entry->constval && entry->our_scope) {
- entry->var->constant_value = entry->constval;
- progress = true;
- }
- entry->link.remove();
- free(entry);
- }
-
- return progress;
-}
-
-bool
-do_constant_variable_unlinked(exec_list *instructions)
-{
- bool progress = false;
-
- foreach_iter(exec_list_iterator, iter, *instructions) {
- ir_instruction *ir = (ir_instruction *)iter.get();
- ir_function *f = ir->as_function();
- if (f) {
- foreach_iter(exec_list_iterator, sigiter, *f) {
- ir_function_signature *sig =
- (ir_function_signature *) sigiter.get();
- if (do_constant_variable(&sig->body))
- progress = true;
- }
- }
- }
-
- return progress;
-}
+/*
+ * Copyright © 2010 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+/**
+ * \file opt_constant_variable.cpp
+ *
+ * Marks variables assigned a single constant value over the course
+ * of the program as constant.
+ *
+ * The goal here is to trigger further constant folding and then dead
+ * code elimination. This is common with vector/matrix constructors
+ * and calls to builtin functions.
+ */
+
+#include "ir.h"
+#include "ir_visitor.h"
+#include "ir_optimization.h"
+#include "glsl_types.h"
+
+struct assignment_entry {
+ exec_node link;
+ int assignment_count;
+ ir_variable *var;
+ ir_constant *constval;
+ bool our_scope;
+};
+
+class ir_constant_variable_visitor : public ir_hierarchical_visitor {
+public:
+ virtual ir_visitor_status visit_enter(ir_dereference_variable *);
+ virtual ir_visitor_status visit(ir_variable *);
+ virtual ir_visitor_status visit_enter(ir_assignment *);
+ virtual ir_visitor_status visit_enter(ir_call *);
+
+ exec_list list;
+};
+
+static struct assignment_entry *
+get_assignment_entry(ir_variable *var, exec_list *list)
+{
+ struct assignment_entry *entry;
+
+ foreach_list_typed(struct assignment_entry, entry, link, list) {
+ if (entry->var == var)
+ return entry;
+ }
+
+ entry = (struct assignment_entry *)calloc(1, sizeof(*entry));
+ entry->var = var;
+ list->push_head(&entry->link);
+ return entry;
+}
+
+ir_visitor_status
+ir_constant_variable_visitor::visit(ir_variable *ir)
+{
+ struct assignment_entry *entry = get_assignment_entry(ir, &this->list);
+ entry->our_scope = true;
+ return visit_continue;
+}
+
+/* Skip derefs of variables so that we can detect declarations. */
+ir_visitor_status
+ir_constant_variable_visitor::visit_enter(ir_dereference_variable *ir)
+{
+ (void)ir;
+ return visit_continue_with_parent;
+}
+
+ir_visitor_status
+ir_constant_variable_visitor::visit_enter(ir_assignment *ir)
+{
+ ir_constant *constval;
+ struct assignment_entry *entry;
+
+ entry = get_assignment_entry(ir->lhs->variable_referenced(), &this->list);
+ assert(entry);
+ entry->assignment_count++;
+
+ /* If it's already constant, don't do the work. */
+ if (entry->var->constant_value)
+ return visit_continue;
+
+ /* OK, now find if we actually have all the right conditions for
+ * this to be a constant value assigned to the var.
+ */
+ if (ir->condition)
+ return visit_continue;
+
+ ir_variable *var = ir->whole_variable_written();
+ if (!var)
+ return visit_continue;
+
+ constval = ir->rhs->constant_expression_value();
+ if (!constval)
+ return visit_continue;
+
+ /* Mark this entry as having a constant assignment (if the
+ * assignment count doesn't go >1). do_constant_variable will fix
+ * up the variable with the constant value later.
+ */
+ entry->constval = constval;
+
+ return visit_continue;
+}
+
+ir_visitor_status
+ir_constant_variable_visitor::visit_enter(ir_call *ir)
+{
+ exec_list_iterator sig_iter = ir->get_callee()->parameters.iterator();
+ foreach_iter(exec_list_iterator, iter, *ir) {
+ ir_rvalue *param_rval = (ir_rvalue *)iter.get();
+ ir_variable *param = (ir_variable *)sig_iter.get();
+
+ if (param->mode == ir_var_out ||
+ param->mode == ir_var_inout) {
+ ir_variable *var = param_rval->variable_referenced();
+ struct assignment_entry *entry;
+
+ assert(var);
+ entry = get_assignment_entry(var, &this->list);
+ entry->assignment_count++;
+ }
+ sig_iter.next();
+ }
+ return visit_continue;
+}
+
+/**
+ * Does a copy propagation pass on the code present in the instruction stream.
+ */
+bool
+do_constant_variable(exec_list *instructions)
+{
+ bool progress = false;
+ ir_constant_variable_visitor v;
+
+ v.run(instructions);
+
+ while (!v.list.is_empty()) {
+
+ struct assignment_entry *entry;
+ entry = exec_node_data(struct assignment_entry, v.list.head, link);
+
+ if (entry->assignment_count == 1 && entry->constval && entry->our_scope) {
+ entry->var->constant_value = entry->constval;
+ progress = true;
+ }
+ entry->link.remove();
+ free(entry);
+ }
+
+ return progress;
+}
+
+bool
+do_constant_variable_unlinked(exec_list *instructions)
+{
+ bool progress = false;
+
+ foreach_iter(exec_list_iterator, iter, *instructions) {
+ ir_instruction *ir = (ir_instruction *)iter.get();
+ ir_function *f = ir->as_function();
+ if (f) {
+ foreach_iter(exec_list_iterator, sigiter, *f) {
+ ir_function_signature *sig =
+ (ir_function_signature *) sigiter.get();
+ if (do_constant_variable(&sig->body))
+ progress = true;
+ }
+ }
+ }
+
+ return progress;
+}
diff --git a/mesalib/src/glsl/opt_copy_propagation_elements.cpp b/mesalib/src/glsl/opt_copy_propagation_elements.cpp
index a91e624cb..580c10f27 100644
--- a/mesalib/src/glsl/opt_copy_propagation_elements.cpp
+++ b/mesalib/src/glsl/opt_copy_propagation_elements.cpp
@@ -1,467 +1,467 @@
-/*
- * Copyright © 2010 Intel Corporation
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-
-/**
- * \file opt_copy_propagation_elements.cpp
- *
- * Replaces usage of recently-copied components of variables with the
- * previous copy of the variable.
- *
- * This pass can be compared with opt_copy_propagation, which operands
- * on arbitrary whole-variable copies. However, in order to handle
- * the copy propagation of swizzled variables or writemasked writes,
- * we want to track things on a channel-wise basis. I found that
- * trying to mix the swizzled/writemasked support here with the
- * whole-variable stuff in opt_copy_propagation.cpp just made a mess,
- * so this is separate despite the ACP handling being somewhat
- * similar.
- *
- * This should reduce the number of MOV instructions in the generated
- * programs unless copy propagation is also done on the LIR, and may
- * help anyway by triggering other optimizations that live in the HIR.
- */
-
-#include "ir.h"
-#include "ir_rvalue_visitor.h"
-#include "ir_basic_block.h"
-#include "ir_optimization.h"
-#include "glsl_types.h"
-
-static bool debug = false;
-
-class acp_entry : public exec_node
-{
-public:
- acp_entry(ir_variable *lhs, ir_variable *rhs, int write_mask, int swizzle[4])
- {
- this->lhs = lhs;
- this->rhs = rhs;
- this->write_mask = write_mask;
- memcpy(this->swizzle, swizzle, sizeof(this->swizzle));
- }
-
- acp_entry(acp_entry *a)
- {
- this->lhs = a->lhs;
- this->rhs = a->rhs;
- this->write_mask = a->write_mask;
- memcpy(this->swizzle, a->swizzle, sizeof(this->swizzle));
- }
-
- ir_variable *lhs;
- ir_variable *rhs;
- unsigned int write_mask;
- int swizzle[4];
-};
-
-
-class kill_entry : public exec_node
-{
-public:
- kill_entry(ir_variable *var, int write_mask)
- {
- this->var = var;
- this->write_mask = write_mask;
- }
-
- ir_variable *var;
- unsigned int write_mask;
-};
-
-class ir_copy_propagation_elements_visitor : public ir_rvalue_visitor {
-public:
- ir_copy_propagation_elements_visitor()
- {
- this->progress = false;
- this->mem_ctx = ralloc_context(NULL);
- this->shader_mem_ctx = NULL;
- this->acp = new(mem_ctx) exec_list;
- this->kills = new(mem_ctx) exec_list;
- }
- ~ir_copy_propagation_elements_visitor()
- {
- ralloc_free(mem_ctx);
- }
-
- virtual ir_visitor_status visit_enter(class ir_loop *);
- virtual ir_visitor_status visit_enter(class ir_function_signature *);
- virtual ir_visitor_status visit_leave(class ir_assignment *);
- virtual ir_visitor_status visit_enter(class ir_call *);
- virtual ir_visitor_status visit_enter(class ir_if *);
-
- void handle_rvalue(ir_rvalue **rvalue);
-
- void add_copy(ir_assignment *ir);
- void kill(kill_entry *k);
- void handle_if_block(exec_list *instructions);
-
- /** List of acp_entry: The available copies to propagate */
- exec_list *acp;
- /**
- * List of kill_entry: The variables whose values were killed in this
- * block.
- */
- exec_list *kills;
-
- bool progress;
-
- bool killed_all;
-
- /* Context for our local data structures. */
- void *mem_ctx;
- /* Context for allocating new shader nodes. */
- void *shader_mem_ctx;
-};
-
-ir_visitor_status
-ir_copy_propagation_elements_visitor::visit_enter(ir_function_signature *ir)
-{
- /* Treat entry into a function signature as a completely separate
- * block. Any instructions at global scope will be shuffled into
- * main() at link time, so they're irrelevant to us.
- */
- exec_list *orig_acp = this->acp;
- exec_list *orig_kills = this->kills;
- bool orig_killed_all = this->killed_all;
-
- this->acp = new(mem_ctx) exec_list;
- this->kills = new(mem_ctx) exec_list;
- this->killed_all = false;
-
- visit_list_elements(this, &ir->body);
-
- this->kills = orig_kills;
- this->acp = orig_acp;
- this->killed_all = orig_killed_all;
-
- return visit_continue_with_parent;
-}
-
-ir_visitor_status
-ir_copy_propagation_elements_visitor::visit_leave(ir_assignment *ir)
-{
- ir_dereference_variable *lhs = ir->lhs->as_dereference_variable();
- ir_variable *var = ir->lhs->variable_referenced();
-
- if (var->type->is_scalar() || var->type->is_vector()) {
- kill_entry *k;
-
- if (lhs)
- k = new(mem_ctx) kill_entry(var, ir->write_mask);
- else
- k = new(mem_ctx) kill_entry(var, ~0);
-
- kill(k);
- }
-
- add_copy(ir);
-
- return visit_continue;
-}
-
-/**
- * Replaces dereferences of ACP RHS variables with ACP LHS variables.
- *
- * This is where the actual copy propagation occurs. Note that the
- * rewriting of ir_dereference means that the ir_dereference instance
- * must not be shared by multiple IR operations!
- */
-void
-ir_copy_propagation_elements_visitor::handle_rvalue(ir_rvalue **ir)
-{
- int swizzle_chan[4];
- ir_dereference_variable *deref_var;
- ir_variable *source[4] = {NULL, NULL, NULL, NULL};
- int source_chan[4];
- int chans;
-
- if (!*ir)
- return;
-
- ir_swizzle *swizzle = (*ir)->as_swizzle();
- if (swizzle) {
- deref_var = swizzle->val->as_dereference_variable();
- if (!deref_var)
- return;
-
- swizzle_chan[0] = swizzle->mask.x;
- swizzle_chan[1] = swizzle->mask.y;
- swizzle_chan[2] = swizzle->mask.z;
- swizzle_chan[3] = swizzle->mask.w;
- chans = swizzle->type->vector_elements;
- } else {
- deref_var = (*ir)->as_dereference_variable();
- if (!deref_var)
- return;
-
- swizzle_chan[0] = 0;
- swizzle_chan[1] = 1;
- swizzle_chan[2] = 2;
- swizzle_chan[3] = 3;
- chans = deref_var->type->vector_elements;
- }
-
- if (this->in_assignee)
- return;
-
- ir_variable *var = deref_var->var;
-
- /* Try to find ACP entries covering swizzle_chan[], hoping they're
- * the same source variable.
- */
- foreach_iter(exec_list_iterator, iter, *this->acp) {
- acp_entry *entry = (acp_entry *)iter.get();
-
- if (var == entry->lhs) {
- for (int c = 0; c < chans; c++) {
- if (entry->write_mask & (1 << swizzle_chan[c])) {
- source[c] = entry->rhs;
- source_chan[c] = entry->swizzle[swizzle_chan[c]];
- }
- }
- }
- }
-
- /* Make sure all channels are copying from the same source variable. */
- if (!source[0])
- return;
- for (int c = 1; c < chans; c++) {
- if (source[c] != source[0])
- return;
- }
-
- if (!shader_mem_ctx)
- shader_mem_ctx = ralloc_parent(deref_var);
-
- if (debug) {
- printf("Copy propagation from:\n");
- (*ir)->print();
- }
-
- deref_var = new(shader_mem_ctx) ir_dereference_variable(source[0]);
- *ir = new(shader_mem_ctx) ir_swizzle(deref_var,
- source_chan[0],
- source_chan[1],
- source_chan[2],
- source_chan[3],
- chans);
-
- if (debug) {
- printf("to:\n");
- (*ir)->print();
- printf("\n");
- }
-}
-
-
-ir_visitor_status
-ir_copy_propagation_elements_visitor::visit_enter(ir_call *ir)
-{
- /* Do copy propagation on call parameters, but skip any out params */
- exec_list_iterator sig_param_iter = ir->get_callee()->parameters.iterator();
- foreach_iter(exec_list_iterator, iter, ir->actual_parameters) {
- ir_variable *sig_param = (ir_variable *)sig_param_iter.get();
- ir_instruction *ir = (ir_instruction *)iter.get();
- if (sig_param->mode != ir_var_out && sig_param->mode != ir_var_inout) {
- ir->accept(this);
- }
- sig_param_iter.next();
- }
-
- /* Since we're unlinked, we don't (necessarily) know the side effects of
- * this call. So kill all copies.
- */
- acp->make_empty();
- this->killed_all = true;
-
- return visit_continue_with_parent;
-}
-
-void
-ir_copy_propagation_elements_visitor::handle_if_block(exec_list *instructions)
-{
- exec_list *orig_acp = this->acp;
- exec_list *orig_kills = this->kills;
- bool orig_killed_all = this->killed_all;
-
- this->acp = new(mem_ctx) exec_list;
- this->kills = new(mem_ctx) exec_list;
- this->killed_all = false;
-
- /* Populate the initial acp with a copy of the original */
- foreach_iter(exec_list_iterator, iter, *orig_acp) {
- acp_entry *a = (acp_entry *)iter.get();
- this->acp->push_tail(new(this->mem_ctx) acp_entry(a));
- }
-
- visit_list_elements(this, instructions);
-
- if (this->killed_all) {
- orig_acp->make_empty();
- }
-
- exec_list *new_kills = this->kills;
- this->kills = orig_kills;
- this->acp = orig_acp;
- this->killed_all = this->killed_all || orig_killed_all;
-
- /* Move the new kills into the parent block's list, removing them
- * from the parent's ACP list in the process.
- */
- foreach_list_safe(node, new_kills) {
- kill_entry *k = (kill_entry *)node;
- kill(k);
- }
-}
-
-ir_visitor_status
-ir_copy_propagation_elements_visitor::visit_enter(ir_if *ir)
-{
- ir->condition->accept(this);
-
- handle_if_block(&ir->then_instructions);
- handle_if_block(&ir->else_instructions);
-
- /* handle_if_block() already descended into the children. */
- return visit_continue_with_parent;
-}
-
-ir_visitor_status
-ir_copy_propagation_elements_visitor::visit_enter(ir_loop *ir)
-{
- exec_list *orig_acp = this->acp;
- exec_list *orig_kills = this->kills;
- bool orig_killed_all = this->killed_all;
-
- /* FINISHME: For now, the initial acp for loops is totally empty.
- * We could go through once, then go through again with the acp
- * cloned minus the killed entries after the first run through.
- */
- this->acp = new(mem_ctx) exec_list;
- this->kills = new(mem_ctx) exec_list;
- this->killed_all = false;
-
- visit_list_elements(this, &ir->body_instructions);
-
- if (this->killed_all) {
- orig_acp->make_empty();
- }
-
- exec_list *new_kills = this->kills;
- this->kills = orig_kills;
- this->acp = orig_acp;
- this->killed_all = this->killed_all || orig_killed_all;
-
- foreach_list_safe(node, new_kills) {
- kill_entry *k = (kill_entry *)node;
- kill(k);
- }
-
- /* already descended into the children. */
- return visit_continue_with_parent;
-}
-
-/* Remove any entries currently in the ACP for this kill. */
-void
-ir_copy_propagation_elements_visitor::kill(kill_entry *k)
-{
- foreach_list_safe(node, acp) {
- acp_entry *entry = (acp_entry *)node;
-
- if (entry->lhs == k->var) {
- entry->write_mask = entry->write_mask & ~k->write_mask;
- if (entry->write_mask == 0) {
- entry->remove();
- continue;
- }
- }
- if (entry->rhs == k->var) {
- entry->remove();
- }
- }
-
- /* If we were on a list, remove ourselves before inserting */
- if (k->next)
- k->remove();
-
- this->kills->push_tail(k);
-}
-
-/**
- * Adds directly-copied channels between vector variables to the available
- * copy propagation list.
- */
-void
-ir_copy_propagation_elements_visitor::add_copy(ir_assignment *ir)
-{
- acp_entry *entry;
- int orig_swizzle[4] = {0, 1, 2, 3};
- int swizzle[4];
-
- if (ir->condition)
- return;
-
- ir_dereference_variable *lhs = ir->lhs->as_dereference_variable();
- if (!lhs || !(lhs->type->is_scalar() || lhs->type->is_vector()))
- return;
-
- ir_dereference_variable *rhs = ir->rhs->as_dereference_variable();
- if (!rhs) {
- ir_swizzle *swiz = ir->rhs->as_swizzle();
- if (!swiz)
- return;
-
- rhs = swiz->val->as_dereference_variable();
- if (!rhs)
- return;
-
- orig_swizzle[0] = swiz->mask.x;
- orig_swizzle[1] = swiz->mask.y;
- orig_swizzle[2] = swiz->mask.z;
- orig_swizzle[3] = swiz->mask.w;
- }
-
- /* Move the swizzle channels out to the positions they match in the
- * destination. We don't want to have to rewrite the swizzle[]
- * array every time we clear a bit of the write_mask.
- */
- int j = 0;
- for (int i = 0; i < 4; i++) {
- if (ir->write_mask & (1 << i))
- swizzle[i] = orig_swizzle[j++];
- }
-
- entry = new(this->mem_ctx) acp_entry(lhs->var, rhs->var, ir->write_mask,
- swizzle);
- this->acp->push_tail(entry);
-}
-
-bool
-do_copy_propagation_elements(exec_list *instructions)
-{
- ir_copy_propagation_elements_visitor v;
-
- visit_list_elements(&v, instructions);
-
- return v.progress;
-}
+/*
+ * Copyright © 2010 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+/**
+ * \file opt_copy_propagation_elements.cpp
+ *
+ * Replaces usage of recently-copied components of variables with the
+ * previous copy of the variable.
+ *
+ * This pass can be compared with opt_copy_propagation, which operands
+ * on arbitrary whole-variable copies. However, in order to handle
+ * the copy propagation of swizzled variables or writemasked writes,
+ * we want to track things on a channel-wise basis. I found that
+ * trying to mix the swizzled/writemasked support here with the
+ * whole-variable stuff in opt_copy_propagation.cpp just made a mess,
+ * so this is separate despite the ACP handling being somewhat
+ * similar.
+ *
+ * This should reduce the number of MOV instructions in the generated
+ * programs unless copy propagation is also done on the LIR, and may
+ * help anyway by triggering other optimizations that live in the HIR.
+ */
+
+#include "ir.h"
+#include "ir_rvalue_visitor.h"
+#include "ir_basic_block.h"
+#include "ir_optimization.h"
+#include "glsl_types.h"
+
+static bool debug = false;
+
+class acp_entry : public exec_node
+{
+public:
+ acp_entry(ir_variable *lhs, ir_variable *rhs, int write_mask, int swizzle[4])
+ {
+ this->lhs = lhs;
+ this->rhs = rhs;
+ this->write_mask = write_mask;
+ memcpy(this->swizzle, swizzle, sizeof(this->swizzle));
+ }
+
+ acp_entry(acp_entry *a)
+ {
+ this->lhs = a->lhs;
+ this->rhs = a->rhs;
+ this->write_mask = a->write_mask;
+ memcpy(this->swizzle, a->swizzle, sizeof(this->swizzle));
+ }
+
+ ir_variable *lhs;
+ ir_variable *rhs;
+ unsigned int write_mask;
+ int swizzle[4];
+};
+
+
+class kill_entry : public exec_node
+{
+public:
+ kill_entry(ir_variable *var, int write_mask)
+ {
+ this->var = var;
+ this->write_mask = write_mask;
+ }
+
+ ir_variable *var;
+ unsigned int write_mask;
+};
+
+class ir_copy_propagation_elements_visitor : public ir_rvalue_visitor {
+public:
+ ir_copy_propagation_elements_visitor()
+ {
+ this->progress = false;
+ this->mem_ctx = ralloc_context(NULL);
+ this->shader_mem_ctx = NULL;
+ this->acp = new(mem_ctx) exec_list;
+ this->kills = new(mem_ctx) exec_list;
+ }
+ ~ir_copy_propagation_elements_visitor()
+ {
+ ralloc_free(mem_ctx);
+ }
+
+ virtual ir_visitor_status visit_enter(class ir_loop *);
+ virtual ir_visitor_status visit_enter(class ir_function_signature *);
+ virtual ir_visitor_status visit_leave(class ir_assignment *);
+ virtual ir_visitor_status visit_enter(class ir_call *);
+ virtual ir_visitor_status visit_enter(class ir_if *);
+
+ void handle_rvalue(ir_rvalue **rvalue);
+
+ void add_copy(ir_assignment *ir);
+ void kill(kill_entry *k);
+ void handle_if_block(exec_list *instructions);
+
+ /** List of acp_entry: The available copies to propagate */
+ exec_list *acp;
+ /**
+ * List of kill_entry: The variables whose values were killed in this
+ * block.
+ */
+ exec_list *kills;
+
+ bool progress;
+
+ bool killed_all;
+
+ /* Context for our local data structures. */
+ void *mem_ctx;
+ /* Context for allocating new shader nodes. */
+ void *shader_mem_ctx;
+};
+
+ir_visitor_status
+ir_copy_propagation_elements_visitor::visit_enter(ir_function_signature *ir)
+{
+ /* Treat entry into a function signature as a completely separate
+ * block. Any instructions at global scope will be shuffled into
+ * main() at link time, so they're irrelevant to us.
+ */
+ exec_list *orig_acp = this->acp;
+ exec_list *orig_kills = this->kills;
+ bool orig_killed_all = this->killed_all;
+
+ this->acp = new(mem_ctx) exec_list;
+ this->kills = new(mem_ctx) exec_list;
+ this->killed_all = false;
+
+ visit_list_elements(this, &ir->body);
+
+ this->kills = orig_kills;
+ this->acp = orig_acp;
+ this->killed_all = orig_killed_all;
+
+ return visit_continue_with_parent;
+}
+
+ir_visitor_status
+ir_copy_propagation_elements_visitor::visit_leave(ir_assignment *ir)
+{
+ ir_dereference_variable *lhs = ir->lhs->as_dereference_variable();
+ ir_variable *var = ir->lhs->variable_referenced();
+
+ if (var->type->is_scalar() || var->type->is_vector()) {
+ kill_entry *k;
+
+ if (lhs)
+ k = new(mem_ctx) kill_entry(var, ir->write_mask);
+ else
+ k = new(mem_ctx) kill_entry(var, ~0);
+
+ kill(k);
+ }
+
+ add_copy(ir);
+
+ return visit_continue;
+}
+
+/**
+ * Replaces dereferences of ACP RHS variables with ACP LHS variables.
+ *
+ * This is where the actual copy propagation occurs. Note that the
+ * rewriting of ir_dereference means that the ir_dereference instance
+ * must not be shared by multiple IR operations!
+ */
+void
+ir_copy_propagation_elements_visitor::handle_rvalue(ir_rvalue **ir)
+{
+ int swizzle_chan[4];
+ ir_dereference_variable *deref_var;
+ ir_variable *source[4] = {NULL, NULL, NULL, NULL};
+ int source_chan[4];
+ int chans;
+
+ if (!*ir)
+ return;
+
+ ir_swizzle *swizzle = (*ir)->as_swizzle();
+ if (swizzle) {
+ deref_var = swizzle->val->as_dereference_variable();
+ if (!deref_var)
+ return;
+
+ swizzle_chan[0] = swizzle->mask.x;
+ swizzle_chan[1] = swizzle->mask.y;
+ swizzle_chan[2] = swizzle->mask.z;
+ swizzle_chan[3] = swizzle->mask.w;
+ chans = swizzle->type->vector_elements;
+ } else {
+ deref_var = (*ir)->as_dereference_variable();
+ if (!deref_var)
+ return;
+
+ swizzle_chan[0] = 0;
+ swizzle_chan[1] = 1;
+ swizzle_chan[2] = 2;
+ swizzle_chan[3] = 3;
+ chans = deref_var->type->vector_elements;
+ }
+
+ if (this->in_assignee)
+ return;
+
+ ir_variable *var = deref_var->var;
+
+ /* Try to find ACP entries covering swizzle_chan[], hoping they're
+ * the same source variable.
+ */
+ foreach_iter(exec_list_iterator, iter, *this->acp) {
+ acp_entry *entry = (acp_entry *)iter.get();
+
+ if (var == entry->lhs) {
+ for (int c = 0; c < chans; c++) {
+ if (entry->write_mask & (1 << swizzle_chan[c])) {
+ source[c] = entry->rhs;
+ source_chan[c] = entry->swizzle[swizzle_chan[c]];
+ }
+ }
+ }
+ }
+
+ /* Make sure all channels are copying from the same source variable. */
+ if (!source[0])
+ return;
+ for (int c = 1; c < chans; c++) {
+ if (source[c] != source[0])
+ return;
+ }
+
+ if (!shader_mem_ctx)
+ shader_mem_ctx = ralloc_parent(deref_var);
+
+ if (debug) {
+ printf("Copy propagation from:\n");
+ (*ir)->print();
+ }
+
+ deref_var = new(shader_mem_ctx) ir_dereference_variable(source[0]);
+ *ir = new(shader_mem_ctx) ir_swizzle(deref_var,
+ source_chan[0],
+ source_chan[1],
+ source_chan[2],
+ source_chan[3],
+ chans);
+
+ if (debug) {
+ printf("to:\n");
+ (*ir)->print();
+ printf("\n");
+ }
+}
+
+
+ir_visitor_status
+ir_copy_propagation_elements_visitor::visit_enter(ir_call *ir)
+{
+ /* Do copy propagation on call parameters, but skip any out params */
+ exec_list_iterator sig_param_iter = ir->get_callee()->parameters.iterator();
+ foreach_iter(exec_list_iterator, iter, ir->actual_parameters) {
+ ir_variable *sig_param = (ir_variable *)sig_param_iter.get();
+ ir_instruction *ir = (ir_instruction *)iter.get();
+ if (sig_param->mode != ir_var_out && sig_param->mode != ir_var_inout) {
+ ir->accept(this);
+ }
+ sig_param_iter.next();
+ }
+
+ /* Since we're unlinked, we don't (necessarily) know the side effects of
+ * this call. So kill all copies.
+ */
+ acp->make_empty();
+ this->killed_all = true;
+
+ return visit_continue_with_parent;
+}
+
+void
+ir_copy_propagation_elements_visitor::handle_if_block(exec_list *instructions)
+{
+ exec_list *orig_acp = this->acp;
+ exec_list *orig_kills = this->kills;
+ bool orig_killed_all = this->killed_all;
+
+ this->acp = new(mem_ctx) exec_list;
+ this->kills = new(mem_ctx) exec_list;
+ this->killed_all = false;
+
+ /* Populate the initial acp with a copy of the original */
+ foreach_iter(exec_list_iterator, iter, *orig_acp) {
+ acp_entry *a = (acp_entry *)iter.get();
+ this->acp->push_tail(new(this->mem_ctx) acp_entry(a));
+ }
+
+ visit_list_elements(this, instructions);
+
+ if (this->killed_all) {
+ orig_acp->make_empty();
+ }
+
+ exec_list *new_kills = this->kills;
+ this->kills = orig_kills;
+ this->acp = orig_acp;
+ this->killed_all = this->killed_all || orig_killed_all;
+
+ /* Move the new kills into the parent block's list, removing them
+ * from the parent's ACP list in the process.
+ */
+ foreach_list_safe(node, new_kills) {
+ kill_entry *k = (kill_entry *)node;
+ kill(k);
+ }
+}
+
+ir_visitor_status
+ir_copy_propagation_elements_visitor::visit_enter(ir_if *ir)
+{
+ ir->condition->accept(this);
+
+ handle_if_block(&ir->then_instructions);
+ handle_if_block(&ir->else_instructions);
+
+ /* handle_if_block() already descended into the children. */
+ return visit_continue_with_parent;
+}
+
+ir_visitor_status
+ir_copy_propagation_elements_visitor::visit_enter(ir_loop *ir)
+{
+ exec_list *orig_acp = this->acp;
+ exec_list *orig_kills = this->kills;
+ bool orig_killed_all = this->killed_all;
+
+ /* FINISHME: For now, the initial acp for loops is totally empty.
+ * We could go through once, then go through again with the acp
+ * cloned minus the killed entries after the first run through.
+ */
+ this->acp = new(mem_ctx) exec_list;
+ this->kills = new(mem_ctx) exec_list;
+ this->killed_all = false;
+
+ visit_list_elements(this, &ir->body_instructions);
+
+ if (this->killed_all) {
+ orig_acp->make_empty();
+ }
+
+ exec_list *new_kills = this->kills;
+ this->kills = orig_kills;
+ this->acp = orig_acp;
+ this->killed_all = this->killed_all || orig_killed_all;
+
+ foreach_list_safe(node, new_kills) {
+ kill_entry *k = (kill_entry *)node;
+ kill(k);
+ }
+
+ /* already descended into the children. */
+ return visit_continue_with_parent;
+}
+
+/* Remove any entries currently in the ACP for this kill. */
+void
+ir_copy_propagation_elements_visitor::kill(kill_entry *k)
+{
+ foreach_list_safe(node, acp) {
+ acp_entry *entry = (acp_entry *)node;
+
+ if (entry->lhs == k->var) {
+ entry->write_mask = entry->write_mask & ~k->write_mask;
+ if (entry->write_mask == 0) {
+ entry->remove();
+ continue;
+ }
+ }
+ if (entry->rhs == k->var) {
+ entry->remove();
+ }
+ }
+
+ /* If we were on a list, remove ourselves before inserting */
+ if (k->next)
+ k->remove();
+
+ this->kills->push_tail(k);
+}
+
+/**
+ * Adds directly-copied channels between vector variables to the available
+ * copy propagation list.
+ */
+void
+ir_copy_propagation_elements_visitor::add_copy(ir_assignment *ir)
+{
+ acp_entry *entry;
+ int orig_swizzle[4] = {0, 1, 2, 3};
+ int swizzle[4];
+
+ if (ir->condition)
+ return;
+
+ ir_dereference_variable *lhs = ir->lhs->as_dereference_variable();
+ if (!lhs || !(lhs->type->is_scalar() || lhs->type->is_vector()))
+ return;
+
+ ir_dereference_variable *rhs = ir->rhs->as_dereference_variable();
+ if (!rhs) {
+ ir_swizzle *swiz = ir->rhs->as_swizzle();
+ if (!swiz)
+ return;
+
+ rhs = swiz->val->as_dereference_variable();
+ if (!rhs)
+ return;
+
+ orig_swizzle[0] = swiz->mask.x;
+ orig_swizzle[1] = swiz->mask.y;
+ orig_swizzle[2] = swiz->mask.z;
+ orig_swizzle[3] = swiz->mask.w;
+ }
+
+ /* Move the swizzle channels out to the positions they match in the
+ * destination. We don't want to have to rewrite the swizzle[]
+ * array every time we clear a bit of the write_mask.
+ */
+ int j = 0;
+ for (int i = 0; i < 4; i++) {
+ if (ir->write_mask & (1 << i))
+ swizzle[i] = orig_swizzle[j++];
+ }
+
+ entry = new(this->mem_ctx) acp_entry(lhs->var, rhs->var, ir->write_mask,
+ swizzle);
+ this->acp->push_tail(entry);
+}
+
+bool
+do_copy_propagation_elements(exec_list *instructions)
+{
+ ir_copy_propagation_elements_visitor v;
+
+ visit_list_elements(&v, instructions);
+
+ return v.progress;
+}
diff --git a/mesalib/src/glsl/opt_dead_code.cpp b/mesalib/src/glsl/opt_dead_code.cpp
index cb500d2d1..492ba73a1 100644
--- a/mesalib/src/glsl/opt_dead_code.cpp
+++ b/mesalib/src/glsl/opt_dead_code.cpp
@@ -1,142 +1,142 @@
-/*
- * Copyright © 2010 Intel Corporation
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-
-/**
- * \file opt_dead_code.cpp
- *
- * Eliminates dead assignments and variable declarations from the code.
- */
-
-#include "ir.h"
-#include "ir_visitor.h"
-#include "ir_variable_refcount.h"
-#include "glsl_types.h"
-
-static bool debug = false;
-
-/**
- * Do a dead code pass over instructions and everything that instructions
- * references.
- *
- * Note that this will remove assignments to globals, so it is not suitable
- * for usage on an unlinked instruction stream.
- */
-bool
-do_dead_code(exec_list *instructions)
-{
- ir_variable_refcount_visitor v;
- bool progress = false;
-
- v.run(instructions);
-
- foreach_iter(exec_list_iterator, iter, v.variable_list) {
- variable_entry *entry = (variable_entry *)iter.get();
-
- /* Since each assignment is a reference, the refereneced count must be
- * greater than or equal to the assignment count. If they are equal,
- * then all of the references are assignments, and the variable is
- * dead.
- *
- * Note that if the variable is neither assigned nor referenced, both
- * counts will be zero and will be caught by the equality test.
- */
- assert(entry->referenced_count >= entry->assigned_count);
-
- if (debug) {
- printf("%s@%p: %d refs, %d assigns, %sdeclared in our scope\n",
- entry->var->name, (void *) entry->var,
- entry->referenced_count, entry->assigned_count,
- entry->declaration ? "" : "not ");
- }
-
- if ((entry->referenced_count > entry->assigned_count)
- || !entry->declaration)
- continue;
-
- if (entry->assign) {
- /* Remove a single dead assignment to the variable we found.
- * Don't do so if it's a shader output, though.
- */
- if (entry->var->mode != ir_var_out &&
- entry->var->mode != ir_var_inout &&
- !ir_has_call(entry->assign)) {
- entry->assign->remove();
- progress = true;
-
- if (debug) {
- printf("Removed assignment to %s@%p\n",
- entry->var->name, (void *) entry->var);
- }
- }
- } else {
- /* If there are no assignments or references to the variable left,
- * then we can remove its declaration.
- */
-
- /* uniform initializers are precious, and could get used by another
- * stage.
- */
- if (entry->var->mode == ir_var_uniform &&
- entry->var->constant_value)
- continue;
-
- entry->var->remove();
- progress = true;
-
- if (debug) {
- printf("Removed declaration of %s@%p\n",
- entry->var->name, (void *) entry->var);
- }
- }
- }
-
- return progress;
-}
-
-/**
- * Does a dead code pass on the functions present in the instruction stream.
- *
- * This is suitable for use while the program is not linked, as it will
- * ignore variable declarations (and the assignments to them) for variables
- * with global scope.
- */
-bool
-do_dead_code_unlinked(exec_list *instructions)
-{
- bool progress = false;
-
- foreach_iter(exec_list_iterator, iter, *instructions) {
- ir_instruction *ir = (ir_instruction *)iter.get();
- ir_function *f = ir->as_function();
- if (f) {
- foreach_iter(exec_list_iterator, sigiter, *f) {
- ir_function_signature *sig =
- (ir_function_signature *) sigiter.get();
- if (do_dead_code(&sig->body))
- progress = true;
- }
- }
- }
-
- return progress;
-}
+/*
+ * Copyright © 2010 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+/**
+ * \file opt_dead_code.cpp
+ *
+ * Eliminates dead assignments and variable declarations from the code.
+ */
+
+#include "ir.h"
+#include "ir_visitor.h"
+#include "ir_variable_refcount.h"
+#include "glsl_types.h"
+
+static bool debug = false;
+
+/**
+ * Do a dead code pass over instructions and everything that instructions
+ * references.
+ *
+ * Note that this will remove assignments to globals, so it is not suitable
+ * for usage on an unlinked instruction stream.
+ */
+bool
+do_dead_code(exec_list *instructions)
+{
+ ir_variable_refcount_visitor v;
+ bool progress = false;
+
+ v.run(instructions);
+
+ foreach_iter(exec_list_iterator, iter, v.variable_list) {
+ variable_entry *entry = (variable_entry *)iter.get();
+
+ /* Since each assignment is a reference, the refereneced count must be
+ * greater than or equal to the assignment count. If they are equal,
+ * then all of the references are assignments, and the variable is
+ * dead.
+ *
+ * Note that if the variable is neither assigned nor referenced, both
+ * counts will be zero and will be caught by the equality test.
+ */
+ assert(entry->referenced_count >= entry->assigned_count);
+
+ if (debug) {
+ printf("%s@%p: %d refs, %d assigns, %sdeclared in our scope\n",
+ entry->var->name, (void *) entry->var,
+ entry->referenced_count, entry->assigned_count,
+ entry->declaration ? "" : "not ");
+ }
+
+ if ((entry->referenced_count > entry->assigned_count)
+ || !entry->declaration)
+ continue;
+
+ if (entry->assign) {
+ /* Remove a single dead assignment to the variable we found.
+ * Don't do so if it's a shader output, though.
+ */
+ if (entry->var->mode != ir_var_out &&
+ entry->var->mode != ir_var_inout &&
+ !ir_has_call(entry->assign)) {
+ entry->assign->remove();
+ progress = true;
+
+ if (debug) {
+ printf("Removed assignment to %s@%p\n",
+ entry->var->name, (void *) entry->var);
+ }
+ }
+ } else {
+ /* If there are no assignments or references to the variable left,
+ * then we can remove its declaration.
+ */
+
+ /* uniform initializers are precious, and could get used by another
+ * stage.
+ */
+ if (entry->var->mode == ir_var_uniform &&
+ entry->var->constant_value)
+ continue;
+
+ entry->var->remove();
+ progress = true;
+
+ if (debug) {
+ printf("Removed declaration of %s@%p\n",
+ entry->var->name, (void *) entry->var);
+ }
+ }
+ }
+
+ return progress;
+}
+
+/**
+ * Does a dead code pass on the functions present in the instruction stream.
+ *
+ * This is suitable for use while the program is not linked, as it will
+ * ignore variable declarations (and the assignments to them) for variables
+ * with global scope.
+ */
+bool
+do_dead_code_unlinked(exec_list *instructions)
+{
+ bool progress = false;
+
+ foreach_iter(exec_list_iterator, iter, *instructions) {
+ ir_instruction *ir = (ir_instruction *)iter.get();
+ ir_function *f = ir->as_function();
+ if (f) {
+ foreach_iter(exec_list_iterator, sigiter, *f) {
+ ir_function_signature *sig =
+ (ir_function_signature *) sigiter.get();
+ if (do_dead_code(&sig->body))
+ progress = true;
+ }
+ }
+ }
+
+ return progress;
+}
diff --git a/mesalib/src/glsl/opt_dead_code_local.cpp b/mesalib/src/glsl/opt_dead_code_local.cpp
index 39962bd60..42e5e94c8 100644
--- a/mesalib/src/glsl/opt_dead_code_local.cpp
+++ b/mesalib/src/glsl/opt_dead_code_local.cpp
@@ -1,222 +1,222 @@
-/*
- * Copyright © 2010 Intel Corporation
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-
-/**
- * \file opt_dead_code_local.cpp
- *
- * Eliminates local dead assignments from the code.
- *
- * This operates on basic blocks, tracking assignments and finding if
- * they're used before the variable is completely reassigned.
- *
- * Compare this to ir_dead_code.cpp, which operates globally looking
- * for assignments to variables that are never read.
- */
-
-#include "ir.h"
-#include "ir_basic_block.h"
-#include "ir_optimization.h"
-#include "glsl_types.h"
-
-static bool debug = false;
-
-class assignment_entry : public exec_node
-{
-public:
- assignment_entry(ir_variable *lhs, ir_instruction *ir)
- {
- assert(lhs);
- assert(ir);
- this->lhs = lhs;
- this->ir = ir;
- }
-
- ir_variable *lhs;
- ir_instruction *ir;
-};
-
-class kill_for_derefs_visitor : public ir_hierarchical_visitor {
-public:
- kill_for_derefs_visitor(exec_list *assignments)
- {
- this->assignments = assignments;
- }
-
- virtual ir_visitor_status visit(ir_dereference_variable *ir)
- {
- ir_variable *const var = ir->variable_referenced();
-
- foreach_iter(exec_list_iterator, iter, *this->assignments) {
- assignment_entry *entry = (assignment_entry *)iter.get();
-
- if (entry->lhs == var) {
- if (debug)
- printf("kill %s\n", entry->lhs->name);
- entry->remove();
- }
- }
-
- return visit_continue;
- }
-
-private:
- exec_list *assignments;
-};
-
-class array_index_visit : public ir_hierarchical_visitor {
-public:
- array_index_visit(ir_hierarchical_visitor *v)
- {
- this->visitor = v;
- }
-
- virtual ir_visitor_status visit_enter(class ir_dereference_array *ir)
- {
- ir->array_index->accept(visitor);
- return visit_continue;
- }
-
- static void run(ir_instruction *ir, ir_hierarchical_visitor *v)
- {
- array_index_visit top_visit(v);
- ir->accept(& top_visit);
- }
-
- ir_hierarchical_visitor *visitor;
-};
-
-
-/**
- * Adds an entry to the available copy list if it's a plain assignment
- * of a variable to a variable.
- */
-static bool
-process_assignment(void *ctx, ir_assignment *ir, exec_list *assignments)
-{
- ir_variable *var = NULL;
- bool progress = false;
- kill_for_derefs_visitor v(assignments);
-
- /* Kill assignment entries for things used to produce this assignment. */
- ir->rhs->accept(&v);
- if (ir->condition) {
- ir->condition->accept(&v);
- }
-
- /* Kill assignment enties used as array indices.
- */
- array_index_visit::run(ir->lhs, &v);
- var = ir->lhs->variable_referenced();
- assert(var);
-
- /* Now, check if we did a whole-variable assignment. */
- if (!ir->condition && (ir->whole_variable_written() != NULL)) {
- /* We did a whole-variable assignment. So, any instruction in
- * the assignment list with the same LHS is dead.
- */
- if (debug)
- printf("looking for %s to remove\n", var->name);
- foreach_iter(exec_list_iterator, iter, *assignments) {
- assignment_entry *entry = (assignment_entry *)iter.get();
-
- if (entry->lhs == var) {
- if (debug)
- printf("removing %s\n", var->name);
- entry->ir->remove();
- entry->remove();
- progress = true;
- }
- }
- }
-
- /* Add this instruction to the assignment list available to be removed.
- * But not if the assignment has other side effects.
- */
- if (ir_has_call(ir))
- return progress;
-
- assignment_entry *entry = new(ctx) assignment_entry(var, ir);
- assignments->push_tail(entry);
-
- if (debug) {
- printf("add %s\n", var->name);
-
- printf("current entries\n");
- foreach_iter(exec_list_iterator, iter, *assignments) {
- assignment_entry *entry = (assignment_entry *)iter.get();
-
- printf(" %s\n", entry->lhs->name);
- }
- }
-
- return progress;
-}
-
-static void
-dead_code_local_basic_block(ir_instruction *first,
- ir_instruction *last,
- void *data)
-{
- ir_instruction *ir, *ir_next;
- /* List of avaialble_copy */
- exec_list assignments;
- bool *out_progress = (bool *)data;
- bool progress = false;
-
- void *ctx = ralloc_context(NULL);
- /* Safe looping, since process_assignment */
- for (ir = first, ir_next = (ir_instruction *)first->next;;
- ir = ir_next, ir_next = (ir_instruction *)ir->next) {
- ir_assignment *ir_assign = ir->as_assignment();
-
- if (debug) {
- ir->print();
- printf("\n");
- }
-
- if (ir_assign) {
- progress = process_assignment(ctx, ir_assign, &assignments) || progress;
- } else {
- kill_for_derefs_visitor kill(&assignments);
- ir->accept(&kill);
- }
-
- if (ir == last)
- break;
- }
- *out_progress = progress;
- ralloc_free(ctx);
-}
-
-/**
- * Does a copy propagation pass on the code present in the instruction stream.
- */
-bool
-do_dead_code_local(exec_list *instructions)
-{
- bool progress = false;
-
- call_for_basic_blocks(instructions, dead_code_local_basic_block, &progress);
-
- return progress;
-}
+/*
+ * Copyright © 2010 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+/**
+ * \file opt_dead_code_local.cpp
+ *
+ * Eliminates local dead assignments from the code.
+ *
+ * This operates on basic blocks, tracking assignments and finding if
+ * they're used before the variable is completely reassigned.
+ *
+ * Compare this to ir_dead_code.cpp, which operates globally looking
+ * for assignments to variables that are never read.
+ */
+
+#include "ir.h"
+#include "ir_basic_block.h"
+#include "ir_optimization.h"
+#include "glsl_types.h"
+
+static bool debug = false;
+
+class assignment_entry : public exec_node
+{
+public:
+ assignment_entry(ir_variable *lhs, ir_instruction *ir)
+ {
+ assert(lhs);
+ assert(ir);
+ this->lhs = lhs;
+ this->ir = ir;
+ }
+
+ ir_variable *lhs;
+ ir_instruction *ir;
+};
+
+class kill_for_derefs_visitor : public ir_hierarchical_visitor {
+public:
+ kill_for_derefs_visitor(exec_list *assignments)
+ {
+ this->assignments = assignments;
+ }
+
+ virtual ir_visitor_status visit(ir_dereference_variable *ir)
+ {
+ ir_variable *const var = ir->variable_referenced();
+
+ foreach_iter(exec_list_iterator, iter, *this->assignments) {
+ assignment_entry *entry = (assignment_entry *)iter.get();
+
+ if (entry->lhs == var) {
+ if (debug)
+ printf("kill %s\n", entry->lhs->name);
+ entry->remove();
+ }
+ }
+
+ return visit_continue;
+ }
+
+private:
+ exec_list *assignments;
+};
+
+class array_index_visit : public ir_hierarchical_visitor {
+public:
+ array_index_visit(ir_hierarchical_visitor *v)
+ {
+ this->visitor = v;
+ }
+
+ virtual ir_visitor_status visit_enter(class ir_dereference_array *ir)
+ {
+ ir->array_index->accept(visitor);
+ return visit_continue;
+ }
+
+ static void run(ir_instruction *ir, ir_hierarchical_visitor *v)
+ {
+ array_index_visit top_visit(v);
+ ir->accept(& top_visit);
+ }
+
+ ir_hierarchical_visitor *visitor;
+};
+
+
+/**
+ * Adds an entry to the available copy list if it's a plain assignment
+ * of a variable to a variable.
+ */
+static bool
+process_assignment(void *ctx, ir_assignment *ir, exec_list *assignments)
+{
+ ir_variable *var = NULL;
+ bool progress = false;
+ kill_for_derefs_visitor v(assignments);
+
+ /* Kill assignment entries for things used to produce this assignment. */
+ ir->rhs->accept(&v);
+ if (ir->condition) {
+ ir->condition->accept(&v);
+ }
+
+ /* Kill assignment enties used as array indices.
+ */
+ array_index_visit::run(ir->lhs, &v);
+ var = ir->lhs->variable_referenced();
+ assert(var);
+
+ /* Now, check if we did a whole-variable assignment. */
+ if (!ir->condition && (ir->whole_variable_written() != NULL)) {
+ /* We did a whole-variable assignment. So, any instruction in
+ * the assignment list with the same LHS is dead.
+ */
+ if (debug)
+ printf("looking for %s to remove\n", var->name);
+ foreach_iter(exec_list_iterator, iter, *assignments) {
+ assignment_entry *entry = (assignment_entry *)iter.get();
+
+ if (entry->lhs == var) {
+ if (debug)
+ printf("removing %s\n", var->name);
+ entry->ir->remove();
+ entry->remove();
+ progress = true;
+ }
+ }
+ }
+
+ /* Add this instruction to the assignment list available to be removed.
+ * But not if the assignment has other side effects.
+ */
+ if (ir_has_call(ir))
+ return progress;
+
+ assignment_entry *entry = new(ctx) assignment_entry(var, ir);
+ assignments->push_tail(entry);
+
+ if (debug) {
+ printf("add %s\n", var->name);
+
+ printf("current entries\n");
+ foreach_iter(exec_list_iterator, iter, *assignments) {
+ assignment_entry *entry = (assignment_entry *)iter.get();
+
+ printf(" %s\n", entry->lhs->name);
+ }
+ }
+
+ return progress;
+}
+
+static void
+dead_code_local_basic_block(ir_instruction *first,
+ ir_instruction *last,
+ void *data)
+{
+ ir_instruction *ir, *ir_next;
+ /* List of avaialble_copy */
+ exec_list assignments;
+ bool *out_progress = (bool *)data;
+ bool progress = false;
+
+ void *ctx = ralloc_context(NULL);
+ /* Safe looping, since process_assignment */
+ for (ir = first, ir_next = (ir_instruction *)first->next;;
+ ir = ir_next, ir_next = (ir_instruction *)ir->next) {
+ ir_assignment *ir_assign = ir->as_assignment();
+
+ if (debug) {
+ ir->print();
+ printf("\n");
+ }
+
+ if (ir_assign) {
+ progress = process_assignment(ctx, ir_assign, &assignments) || progress;
+ } else {
+ kill_for_derefs_visitor kill(&assignments);
+ ir->accept(&kill);
+ }
+
+ if (ir == last)
+ break;
+ }
+ *out_progress = progress;
+ ralloc_free(ctx);
+}
+
+/**
+ * Does a copy propagation pass on the code present in the instruction stream.
+ */
+bool
+do_dead_code_local(exec_list *instructions)
+{
+ bool progress = false;
+
+ call_for_basic_blocks(instructions, dead_code_local_basic_block, &progress);
+
+ return progress;
+}
diff --git a/mesalib/src/glsl/opt_function_inlining.cpp b/mesalib/src/glsl/opt_function_inlining.cpp
index 8fef358cc..3cc405b95 100644
--- a/mesalib/src/glsl/opt_function_inlining.cpp
+++ b/mesalib/src/glsl/opt_function_inlining.cpp
@@ -1,422 +1,422 @@
-/*
- * Copyright © 2010 Intel Corporation
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-
-/**
- * \file opt_function_inlining.cpp
- *
- * Replaces calls to functions with the body of the function.
- */
-
-#include <inttypes.h>
-#include "ir.h"
-#include "ir_visitor.h"
-#include "ir_function_inlining.h"
-#include "ir_expression_flattening.h"
-#include "glsl_types.h"
-#include "program/hash_table.h"
-
-static void
-do_sampler_replacement(exec_list *instructions,
- ir_variable *sampler,
- ir_dereference *deref);
-
-class ir_function_inlining_visitor : public ir_hierarchical_visitor {
-public:
- ir_function_inlining_visitor()
- {
- progress = false;
- }
-
- virtual ~ir_function_inlining_visitor()
- {
- /* empty */
- }
-
- virtual ir_visitor_status visit_enter(ir_expression *);
- virtual ir_visitor_status visit_enter(ir_call *);
- virtual ir_visitor_status visit_enter(ir_assignment *);
- virtual ir_visitor_status visit_enter(ir_return *);
- virtual ir_visitor_status visit_enter(ir_texture *);
- virtual ir_visitor_status visit_enter(ir_swizzle *);
-
- bool progress;
-};
-
-
-bool
-automatic_inlining_predicate(ir_instruction *ir)
-{
- ir_call *call = ir->as_call();
-
- if (call && can_inline(call))
- return true;
-
- return false;
-}
-
-bool
-do_function_inlining(exec_list *instructions)
-{
- ir_function_inlining_visitor v;
-
- do_expression_flattening(instructions, automatic_inlining_predicate);
-
- v.run(instructions);
-
- return v.progress;
-}
-
-static void
-replace_return_with_assignment(ir_instruction *ir, void *data)
-{
- void *ctx = ralloc_parent(ir);
- ir_variable *retval = (ir_variable *)data;
- ir_return *ret = ir->as_return();
-
- if (ret) {
- if (ret->value) {
- ir_rvalue *lhs = new(ctx) ir_dereference_variable(retval);
- ret->replace_with(new(ctx) ir_assignment(lhs, ret->value, NULL));
- } else {
- /* un-valued return has to be the last return, or we shouldn't
- * have reached here. (see can_inline()).
- */
- assert(ret->next->is_tail_sentinel());
- ret->remove();
- }
- }
-}
-
-ir_rvalue *
-ir_call::generate_inline(ir_instruction *next_ir)
-{
- void *ctx = ralloc_parent(this);
- ir_variable **parameters;
- int num_parameters;
- int i;
- ir_variable *retval = NULL;
- struct hash_table *ht;
-
- ht = hash_table_ctor(0, hash_table_pointer_hash, hash_table_pointer_compare);
-
- num_parameters = 0;
- foreach_iter(exec_list_iterator, iter_sig, this->callee->parameters)
- num_parameters++;
-
- parameters = new ir_variable *[num_parameters];
-
- /* Generate storage for the return value. */
- if (!this->callee->return_type->is_void()) {
- retval = new(ctx) ir_variable(this->callee->return_type, "_ret_val",
- ir_var_auto);
- next_ir->insert_before(retval);
- }
-
- /* Generate the declarations for the parameters to our inlined code,
- * and set up the mapping of real function body variables to ours.
- */
- i = 0;
- exec_list_iterator sig_param_iter = this->callee->parameters.iterator();
- exec_list_iterator param_iter = this->actual_parameters.iterator();
- for (i = 0; i < num_parameters; i++) {
- ir_variable *sig_param = (ir_variable *) sig_param_iter.get();
- ir_rvalue *param = (ir_rvalue *) param_iter.get();
-
- /* Generate a new variable for the parameter. */
- if (sig_param->type->base_type == GLSL_TYPE_SAMPLER) {
- /* For samplers, we want the inlined sampler references
- * referencing the passed in sampler variable, since that
- * will have the location information, which an assignment of
- * a sampler wouldn't. Fix it up below.
- */
- parameters[i] = NULL;
- } else {
- parameters[i] = sig_param->clone(ctx, ht);
- parameters[i]->mode = ir_var_auto;
-
- /* Remove the read-only decoration becuase we're going to write
- * directly to this variable. If the cloned variable is left
- * read-only and the inlined function is inside a loop, the loop
- * analysis code will get confused.
- */
- parameters[i]->read_only = false;
- next_ir->insert_before(parameters[i]);
- }
-
- /* Move the actual param into our param variable if it's an 'in' type. */
- if (parameters[i] && (sig_param->mode == ir_var_in ||
- sig_param->mode == ir_var_const_in ||
- sig_param->mode == ir_var_inout)) {
- ir_assignment *assign;
-
- assign = new(ctx) ir_assignment(new(ctx) ir_dereference_variable(parameters[i]),
- param, NULL);
- next_ir->insert_before(assign);
- }
-
- sig_param_iter.next();
- param_iter.next();
- }
-
- exec_list new_instructions;
-
- /* Generate the inlined body of the function to a new list */
- foreach_iter(exec_list_iterator, iter, callee->body) {
- ir_instruction *ir = (ir_instruction *)iter.get();
- ir_instruction *new_ir = ir->clone(ctx, ht);
-
- new_instructions.push_tail(new_ir);
- visit_tree(new_ir, replace_return_with_assignment, retval);
- }
-
- /* If any samplers were passed in, replace any deref of the sampler
- * with a deref of the sampler argument.
- */
- param_iter = this->actual_parameters.iterator();
- sig_param_iter = this->callee->parameters.iterator();
- for (i = 0; i < num_parameters; i++) {
- ir_instruction *const param = (ir_instruction *) param_iter.get();
- ir_variable *sig_param = (ir_variable *) sig_param_iter.get();
-
- if (sig_param->type->base_type == GLSL_TYPE_SAMPLER) {
- ir_dereference *deref = param->as_dereference();
-
- assert(deref);
- do_sampler_replacement(&new_instructions, sig_param, deref);
- }
- param_iter.next();
- sig_param_iter.next();
- }
-
- /* Now push those new instructions in. */
- next_ir->insert_before(&new_instructions);
-
- /* Copy back the value of any 'out' parameters from the function body
- * variables to our own.
- */
- i = 0;
- param_iter = this->actual_parameters.iterator();
- sig_param_iter = this->callee->parameters.iterator();
- for (i = 0; i < num_parameters; i++) {
- ir_instruction *const param = (ir_instruction *) param_iter.get();
- const ir_variable *const sig_param = (ir_variable *) sig_param_iter.get();
-
- /* Move our param variable into the actual param if it's an 'out' type. */
- if (parameters[i] && (sig_param->mode == ir_var_out ||
- sig_param->mode == ir_var_inout)) {
- ir_assignment *assign;
-
- assign = new(ctx) ir_assignment(param->clone(ctx, NULL)->as_rvalue(),
- new(ctx) ir_dereference_variable(parameters[i]),
- NULL);
- next_ir->insert_before(assign);
- }
-
- param_iter.next();
- sig_param_iter.next();
- }
-
- delete [] parameters;
-
- hash_table_dtor(ht);
-
- if (retval)
- return new(ctx) ir_dereference_variable(retval);
- else
- return NULL;
-}
-
-
-ir_visitor_status
-ir_function_inlining_visitor::visit_enter(ir_expression *ir)
-{
- (void) ir;
- return visit_continue_with_parent;
-}
-
-
-ir_visitor_status
-ir_function_inlining_visitor::visit_enter(ir_return *ir)
-{
- (void) ir;
- return visit_continue_with_parent;
-}
-
-
-ir_visitor_status
-ir_function_inlining_visitor::visit_enter(ir_texture *ir)
-{
- (void) ir;
- return visit_continue_with_parent;
-}
-
-
-ir_visitor_status
-ir_function_inlining_visitor::visit_enter(ir_swizzle *ir)
-{
- (void) ir;
- return visit_continue_with_parent;
-}
-
-
-ir_visitor_status
-ir_function_inlining_visitor::visit_enter(ir_call *ir)
-{
- if (can_inline(ir)) {
- /* If the call was part of some tree, then it should have been
- * flattened out or we shouldn't have seen it because of a
- * visit_continue_with_parent in this visitor.
- */
- assert(ir == base_ir);
-
- (void) ir->generate_inline(ir);
- ir->remove();
- this->progress = true;
- }
-
- return visit_continue;
-}
-
-
-ir_visitor_status
-ir_function_inlining_visitor::visit_enter(ir_assignment *ir)
-{
- ir_call *call = ir->rhs->as_call();
- if (!call || !can_inline(call))
- return visit_continue;
-
- /* generates the parameter setup, function body, and returns the return
- * value of the function
- */
- ir_rvalue *rhs = call->generate_inline(ir);
- assert(rhs);
-
- ir->rhs = rhs;
- this->progress = true;
-
- return visit_continue;
-}
-
-/**
- * Replaces references to the "sampler" variable with a clone of "deref."
- *
- * From the spec, samplers can appear in the tree as function
- * (non-out) parameters and as the result of array indexing and
- * structure field selection. In our builtin implementation, they
- * also appear in the sampler field of an ir_tex instruction.
- */
-
-class ir_sampler_replacement_visitor : public ir_hierarchical_visitor {
-public:
- ir_sampler_replacement_visitor(ir_variable *sampler, ir_dereference *deref)
- {
- this->sampler = sampler;
- this->deref = deref;
- }
-
- virtual ~ir_sampler_replacement_visitor()
- {
- }
-
- virtual ir_visitor_status visit_leave(ir_call *);
- virtual ir_visitor_status visit_leave(ir_dereference_array *);
- virtual ir_visitor_status visit_leave(ir_dereference_record *);
- virtual ir_visitor_status visit_leave(ir_texture *);
-
- void replace_deref(ir_dereference **deref);
- void replace_rvalue(ir_rvalue **rvalue);
-
- ir_variable *sampler;
- ir_dereference *deref;
-};
-
-void
-ir_sampler_replacement_visitor::replace_deref(ir_dereference **deref)
-{
- ir_dereference_variable *deref_var = (*deref)->as_dereference_variable();
- if (deref_var && deref_var->var == this->sampler) {
- *deref = this->deref->clone(ralloc_parent(*deref), NULL);
- }
-}
-
-void
-ir_sampler_replacement_visitor::replace_rvalue(ir_rvalue **rvalue)
-{
- if (!*rvalue)
- return;
-
- ir_dereference *deref = (*rvalue)->as_dereference();
-
- if (!deref)
- return;
-
- replace_deref(&deref);
- *rvalue = deref;
-}
-
-ir_visitor_status
-ir_sampler_replacement_visitor::visit_leave(ir_texture *ir)
-{
- replace_deref(&ir->sampler);
-
- return visit_continue;
-}
-
-ir_visitor_status
-ir_sampler_replacement_visitor::visit_leave(ir_dereference_array *ir)
-{
- replace_rvalue(&ir->array);
- return visit_continue;
-}
-
-ir_visitor_status
-ir_sampler_replacement_visitor::visit_leave(ir_dereference_record *ir)
-{
- replace_rvalue(&ir->record);
- return visit_continue;
-}
-
-ir_visitor_status
-ir_sampler_replacement_visitor::visit_leave(ir_call *ir)
-{
- foreach_iter(exec_list_iterator, iter, *ir) {
- ir_rvalue *param = (ir_rvalue *)iter.get();
- ir_rvalue *new_param = param;
- replace_rvalue(&new_param);
-
- if (new_param != param) {
- param->replace_with(new_param);
- }
- }
- return visit_continue;
-}
-
-static void
-do_sampler_replacement(exec_list *instructions,
- ir_variable *sampler,
- ir_dereference *deref)
-{
- ir_sampler_replacement_visitor v(sampler, deref);
-
- visit_list_elements(&v, instructions);
-}
+/*
+ * Copyright © 2010 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+/**
+ * \file opt_function_inlining.cpp
+ *
+ * Replaces calls to functions with the body of the function.
+ */
+
+#include <inttypes.h>
+#include "ir.h"
+#include "ir_visitor.h"
+#include "ir_function_inlining.h"
+#include "ir_expression_flattening.h"
+#include "glsl_types.h"
+#include "program/hash_table.h"
+
+static void
+do_sampler_replacement(exec_list *instructions,
+ ir_variable *sampler,
+ ir_dereference *deref);
+
+class ir_function_inlining_visitor : public ir_hierarchical_visitor {
+public:
+ ir_function_inlining_visitor()
+ {
+ progress = false;
+ }
+
+ virtual ~ir_function_inlining_visitor()
+ {
+ /* empty */
+ }
+
+ virtual ir_visitor_status visit_enter(ir_expression *);
+ virtual ir_visitor_status visit_enter(ir_call *);
+ virtual ir_visitor_status visit_enter(ir_assignment *);
+ virtual ir_visitor_status visit_enter(ir_return *);
+ virtual ir_visitor_status visit_enter(ir_texture *);
+ virtual ir_visitor_status visit_enter(ir_swizzle *);
+
+ bool progress;
+};
+
+
+bool
+automatic_inlining_predicate(ir_instruction *ir)
+{
+ ir_call *call = ir->as_call();
+
+ if (call && can_inline(call))
+ return true;
+
+ return false;
+}
+
+bool
+do_function_inlining(exec_list *instructions)
+{
+ ir_function_inlining_visitor v;
+
+ do_expression_flattening(instructions, automatic_inlining_predicate);
+
+ v.run(instructions);
+
+ return v.progress;
+}
+
+static void
+replace_return_with_assignment(ir_instruction *ir, void *data)
+{
+ void *ctx = ralloc_parent(ir);
+ ir_variable *retval = (ir_variable *)data;
+ ir_return *ret = ir->as_return();
+
+ if (ret) {
+ if (ret->value) {
+ ir_rvalue *lhs = new(ctx) ir_dereference_variable(retval);
+ ret->replace_with(new(ctx) ir_assignment(lhs, ret->value, NULL));
+ } else {
+ /* un-valued return has to be the last return, or we shouldn't
+ * have reached here. (see can_inline()).
+ */
+ assert(ret->next->is_tail_sentinel());
+ ret->remove();
+ }
+ }
+}
+
+ir_rvalue *
+ir_call::generate_inline(ir_instruction *next_ir)
+{
+ void *ctx = ralloc_parent(this);
+ ir_variable **parameters;
+ int num_parameters;
+ int i;
+ ir_variable *retval = NULL;
+ struct hash_table *ht;
+
+ ht = hash_table_ctor(0, hash_table_pointer_hash, hash_table_pointer_compare);
+
+ num_parameters = 0;
+ foreach_iter(exec_list_iterator, iter_sig, this->callee->parameters)
+ num_parameters++;
+
+ parameters = new ir_variable *[num_parameters];
+
+ /* Generate storage for the return value. */
+ if (!this->callee->return_type->is_void()) {
+ retval = new(ctx) ir_variable(this->callee->return_type, "_ret_val",
+ ir_var_auto);
+ next_ir->insert_before(retval);
+ }
+
+ /* Generate the declarations for the parameters to our inlined code,
+ * and set up the mapping of real function body variables to ours.
+ */
+ i = 0;
+ exec_list_iterator sig_param_iter = this->callee->parameters.iterator();
+ exec_list_iterator param_iter = this->actual_parameters.iterator();
+ for (i = 0; i < num_parameters; i++) {
+ ir_variable *sig_param = (ir_variable *) sig_param_iter.get();
+ ir_rvalue *param = (ir_rvalue *) param_iter.get();
+
+ /* Generate a new variable for the parameter. */
+ if (sig_param->type->base_type == GLSL_TYPE_SAMPLER) {
+ /* For samplers, we want the inlined sampler references
+ * referencing the passed in sampler variable, since that
+ * will have the location information, which an assignment of
+ * a sampler wouldn't. Fix it up below.
+ */
+ parameters[i] = NULL;
+ } else {
+ parameters[i] = sig_param->clone(ctx, ht);
+ parameters[i]->mode = ir_var_auto;
+
+ /* Remove the read-only decoration becuase we're going to write
+ * directly to this variable. If the cloned variable is left
+ * read-only and the inlined function is inside a loop, the loop
+ * analysis code will get confused.
+ */
+ parameters[i]->read_only = false;
+ next_ir->insert_before(parameters[i]);
+ }
+
+ /* Move the actual param into our param variable if it's an 'in' type. */
+ if (parameters[i] && (sig_param->mode == ir_var_in ||
+ sig_param->mode == ir_var_const_in ||
+ sig_param->mode == ir_var_inout)) {
+ ir_assignment *assign;
+
+ assign = new(ctx) ir_assignment(new(ctx) ir_dereference_variable(parameters[i]),
+ param, NULL);
+ next_ir->insert_before(assign);
+ }
+
+ sig_param_iter.next();
+ param_iter.next();
+ }
+
+ exec_list new_instructions;
+
+ /* Generate the inlined body of the function to a new list */
+ foreach_iter(exec_list_iterator, iter, callee->body) {
+ ir_instruction *ir = (ir_instruction *)iter.get();
+ ir_instruction *new_ir = ir->clone(ctx, ht);
+
+ new_instructions.push_tail(new_ir);
+ visit_tree(new_ir, replace_return_with_assignment, retval);
+ }
+
+ /* If any samplers were passed in, replace any deref of the sampler
+ * with a deref of the sampler argument.
+ */
+ param_iter = this->actual_parameters.iterator();
+ sig_param_iter = this->callee->parameters.iterator();
+ for (i = 0; i < num_parameters; i++) {
+ ir_instruction *const param = (ir_instruction *) param_iter.get();
+ ir_variable *sig_param = (ir_variable *) sig_param_iter.get();
+
+ if (sig_param->type->base_type == GLSL_TYPE_SAMPLER) {
+ ir_dereference *deref = param->as_dereference();
+
+ assert(deref);
+ do_sampler_replacement(&new_instructions, sig_param, deref);
+ }
+ param_iter.next();
+ sig_param_iter.next();
+ }
+
+ /* Now push those new instructions in. */
+ next_ir->insert_before(&new_instructions);
+
+ /* Copy back the value of any 'out' parameters from the function body
+ * variables to our own.
+ */
+ i = 0;
+ param_iter = this->actual_parameters.iterator();
+ sig_param_iter = this->callee->parameters.iterator();
+ for (i = 0; i < num_parameters; i++) {
+ ir_instruction *const param = (ir_instruction *) param_iter.get();
+ const ir_variable *const sig_param = (ir_variable *) sig_param_iter.get();
+
+ /* Move our param variable into the actual param if it's an 'out' type. */
+ if (parameters[i] && (sig_param->mode == ir_var_out ||
+ sig_param->mode == ir_var_inout)) {
+ ir_assignment *assign;
+
+ assign = new(ctx) ir_assignment(param->clone(ctx, NULL)->as_rvalue(),
+ new(ctx) ir_dereference_variable(parameters[i]),
+ NULL);
+ next_ir->insert_before(assign);
+ }
+
+ param_iter.next();
+ sig_param_iter.next();
+ }
+
+ delete [] parameters;
+
+ hash_table_dtor(ht);
+
+ if (retval)
+ return new(ctx) ir_dereference_variable(retval);
+ else
+ return NULL;
+}
+
+
+ir_visitor_status
+ir_function_inlining_visitor::visit_enter(ir_expression *ir)
+{
+ (void) ir;
+ return visit_continue_with_parent;
+}
+
+
+ir_visitor_status
+ir_function_inlining_visitor::visit_enter(ir_return *ir)
+{
+ (void) ir;
+ return visit_continue_with_parent;
+}
+
+
+ir_visitor_status
+ir_function_inlining_visitor::visit_enter(ir_texture *ir)
+{
+ (void) ir;
+ return visit_continue_with_parent;
+}
+
+
+ir_visitor_status
+ir_function_inlining_visitor::visit_enter(ir_swizzle *ir)
+{
+ (void) ir;
+ return visit_continue_with_parent;
+}
+
+
+ir_visitor_status
+ir_function_inlining_visitor::visit_enter(ir_call *ir)
+{
+ if (can_inline(ir)) {
+ /* If the call was part of some tree, then it should have been
+ * flattened out or we shouldn't have seen it because of a
+ * visit_continue_with_parent in this visitor.
+ */
+ assert(ir == base_ir);
+
+ (void) ir->generate_inline(ir);
+ ir->remove();
+ this->progress = true;
+ }
+
+ return visit_continue;
+}
+
+
+ir_visitor_status
+ir_function_inlining_visitor::visit_enter(ir_assignment *ir)
+{
+ ir_call *call = ir->rhs->as_call();
+ if (!call || !can_inline(call))
+ return visit_continue;
+
+ /* generates the parameter setup, function body, and returns the return
+ * value of the function
+ */
+ ir_rvalue *rhs = call->generate_inline(ir);
+ assert(rhs);
+
+ ir->rhs = rhs;
+ this->progress = true;
+
+ return visit_continue;
+}
+
+/**
+ * Replaces references to the "sampler" variable with a clone of "deref."
+ *
+ * From the spec, samplers can appear in the tree as function
+ * (non-out) parameters and as the result of array indexing and
+ * structure field selection. In our builtin implementation, they
+ * also appear in the sampler field of an ir_tex instruction.
+ */
+
+class ir_sampler_replacement_visitor : public ir_hierarchical_visitor {
+public:
+ ir_sampler_replacement_visitor(ir_variable *sampler, ir_dereference *deref)
+ {
+ this->sampler = sampler;
+ this->deref = deref;
+ }
+
+ virtual ~ir_sampler_replacement_visitor()
+ {
+ }
+
+ virtual ir_visitor_status visit_leave(ir_call *);
+ virtual ir_visitor_status visit_leave(ir_dereference_array *);
+ virtual ir_visitor_status visit_leave(ir_dereference_record *);
+ virtual ir_visitor_status visit_leave(ir_texture *);
+
+ void replace_deref(ir_dereference **deref);
+ void replace_rvalue(ir_rvalue **rvalue);
+
+ ir_variable *sampler;
+ ir_dereference *deref;
+};
+
+void
+ir_sampler_replacement_visitor::replace_deref(ir_dereference **deref)
+{
+ ir_dereference_variable *deref_var = (*deref)->as_dereference_variable();
+ if (deref_var && deref_var->var == this->sampler) {
+ *deref = this->deref->clone(ralloc_parent(*deref), NULL);
+ }
+}
+
+void
+ir_sampler_replacement_visitor::replace_rvalue(ir_rvalue **rvalue)
+{
+ if (!*rvalue)
+ return;
+
+ ir_dereference *deref = (*rvalue)->as_dereference();
+
+ if (!deref)
+ return;
+
+ replace_deref(&deref);
+ *rvalue = deref;
+}
+
+ir_visitor_status
+ir_sampler_replacement_visitor::visit_leave(ir_texture *ir)
+{
+ replace_deref(&ir->sampler);
+
+ return visit_continue;
+}
+
+ir_visitor_status
+ir_sampler_replacement_visitor::visit_leave(ir_dereference_array *ir)
+{
+ replace_rvalue(&ir->array);
+ return visit_continue;
+}
+
+ir_visitor_status
+ir_sampler_replacement_visitor::visit_leave(ir_dereference_record *ir)
+{
+ replace_rvalue(&ir->record);
+ return visit_continue;
+}
+
+ir_visitor_status
+ir_sampler_replacement_visitor::visit_leave(ir_call *ir)
+{
+ foreach_iter(exec_list_iterator, iter, *ir) {
+ ir_rvalue *param = (ir_rvalue *)iter.get();
+ ir_rvalue *new_param = param;
+ replace_rvalue(&new_param);
+
+ if (new_param != param) {
+ param->replace_with(new_param);
+ }
+ }
+ return visit_continue;
+}
+
+static void
+do_sampler_replacement(exec_list *instructions,
+ ir_variable *sampler,
+ ir_dereference *deref)
+{
+ ir_sampler_replacement_visitor v(sampler, deref);
+
+ visit_list_elements(&v, instructions);
+}
diff --git a/mesalib/src/glsl/opt_swizzle_swizzle.cpp b/mesalib/src/glsl/opt_swizzle_swizzle.cpp
index bc442fa86..e23655240 100644
--- a/mesalib/src/glsl/opt_swizzle_swizzle.cpp
+++ b/mesalib/src/glsl/opt_swizzle_swizzle.cpp
@@ -1,93 +1,93 @@
-/*
- * Copyright © 2010 Intel Corporation
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-
-/**
- * \file opt_swizzle_swizzle.cpp
- *
- * Eliminates the second swizzle in a swizzle chain.
- */
-
-#include "ir.h"
-#include "ir_visitor.h"
-#include "ir_optimization.h"
-#include "glsl_types.h"
-
-class ir_swizzle_swizzle_visitor : public ir_hierarchical_visitor {
-public:
- ir_swizzle_swizzle_visitor()
- {
- progress = false;
- }
-
- virtual ir_visitor_status visit_enter(ir_swizzle *);
-
- bool progress;
-};
-
-ir_visitor_status
-ir_swizzle_swizzle_visitor::visit_enter(ir_swizzle *ir)
-{
- int mask2[4];
-
- ir_swizzle *swiz2 = ir->val->as_swizzle();
- if (!swiz2)
- return visit_continue;
-
- memset(&mask2, 0, sizeof(mask2));
- if (swiz2->mask.num_components >= 1)
- mask2[0] = swiz2->mask.x;
- if (swiz2->mask.num_components >= 2)
- mask2[1] = swiz2->mask.y;
- if (swiz2->mask.num_components >= 3)
- mask2[2] = swiz2->mask.z;
- if (swiz2->mask.num_components >= 4)
- mask2[3] = swiz2->mask.w;
-
- if (ir->mask.num_components >= 1)
- ir->mask.x = mask2[ir->mask.x];
- if (ir->mask.num_components >= 2)
- ir->mask.y = mask2[ir->mask.y];
- if (ir->mask.num_components >= 3)
- ir->mask.z = mask2[ir->mask.z];
- if (ir->mask.num_components >= 4)
- ir->mask.w = mask2[ir->mask.w];
-
- ir->val = swiz2->val;
-
- this->progress = true;
-
- return visit_continue;
-}
-
-/**
- * Does a copy propagation pass on the code present in the instruction stream.
- */
-bool
-do_swizzle_swizzle(exec_list *instructions)
-{
- ir_swizzle_swizzle_visitor v;
-
- v.run(instructions);
-
- return v.progress;
-}
+/*
+ * Copyright © 2010 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+/**
+ * \file opt_swizzle_swizzle.cpp
+ *
+ * Eliminates the second swizzle in a swizzle chain.
+ */
+
+#include "ir.h"
+#include "ir_visitor.h"
+#include "ir_optimization.h"
+#include "glsl_types.h"
+
+class ir_swizzle_swizzle_visitor : public ir_hierarchical_visitor {
+public:
+ ir_swizzle_swizzle_visitor()
+ {
+ progress = false;
+ }
+
+ virtual ir_visitor_status visit_enter(ir_swizzle *);
+
+ bool progress;
+};
+
+ir_visitor_status
+ir_swizzle_swizzle_visitor::visit_enter(ir_swizzle *ir)
+{
+ int mask2[4];
+
+ ir_swizzle *swiz2 = ir->val->as_swizzle();
+ if (!swiz2)
+ return visit_continue;
+
+ memset(&mask2, 0, sizeof(mask2));
+ if (swiz2->mask.num_components >= 1)
+ mask2[0] = swiz2->mask.x;
+ if (swiz2->mask.num_components >= 2)
+ mask2[1] = swiz2->mask.y;
+ if (swiz2->mask.num_components >= 3)
+ mask2[2] = swiz2->mask.z;
+ if (swiz2->mask.num_components >= 4)
+ mask2[3] = swiz2->mask.w;
+
+ if (ir->mask.num_components >= 1)
+ ir->mask.x = mask2[ir->mask.x];
+ if (ir->mask.num_components >= 2)
+ ir->mask.y = mask2[ir->mask.y];
+ if (ir->mask.num_components >= 3)
+ ir->mask.z = mask2[ir->mask.z];
+ if (ir->mask.num_components >= 4)
+ ir->mask.w = mask2[ir->mask.w];
+
+ ir->val = swiz2->val;
+
+ this->progress = true;
+
+ return visit_continue;
+}
+
+/**
+ * Does a copy propagation pass on the code present in the instruction stream.
+ */
+bool
+do_swizzle_swizzle(exec_list *instructions)
+{
+ ir_swizzle_swizzle_visitor v;
+
+ v.run(instructions);
+
+ return v.progress;
+}
diff --git a/mesalib/src/glsl/opt_tree_grafting.cpp b/mesalib/src/glsl/opt_tree_grafting.cpp
index 1ef940f9c..75bd11c09 100644
--- a/mesalib/src/glsl/opt_tree_grafting.cpp
+++ b/mesalib/src/glsl/opt_tree_grafting.cpp
@@ -1,368 +1,368 @@
-/*
- * Copyright © 2010 Intel Corporation
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-
-/**
- * \file opt_tree_grafting.cpp
- *
- * Takes assignments to variables that are dereferenced only once and
- * pastes the RHS expression into where the variable is dereferenced.
- *
- * In the process of various operations like function inlining and
- * tertiary op handling, we'll end up with our expression trees having
- * been chopped up into a series of assignments of short expressions
- * to temps. Other passes like ir_algebraic.cpp would prefer to see
- * the deepest expression trees they can to try to optimize them.
- *
- * This is a lot like copy propagaton. In comparison, copy
- * propagation only acts on plain copies, not arbitrary expressions on
- * the RHS. Generally, we wouldn't want to go pasting some
- * complicated expression everywhere it got used, though, so we don't
- * handle expressions in that pass.
- *
- * The hard part is making sure we don't move an expression across
- * some other assignments that would change the value of the
- * expression. So we split this into two passes: First, find the
- * variables in our scope which are written to once and read once, and
- * then go through basic blocks seeing if we find an opportunity to
- * move those expressions safely.
- */
-
-#include "ir.h"
-#include "ir_visitor.h"
-#include "ir_variable_refcount.h"
-#include "ir_basic_block.h"
-#include "ir_optimization.h"
-#include "glsl_types.h"
-
-static bool debug = false;
-
-class ir_tree_grafting_visitor : public ir_hierarchical_visitor {
-public:
- ir_tree_grafting_visitor(ir_assignment *graft_assign,
- ir_variable *graft_var)
- {
- this->progress = false;
- this->graft_assign = graft_assign;
- this->graft_var = graft_var;
- }
-
- virtual ir_visitor_status visit_leave(class ir_assignment *);
- virtual ir_visitor_status visit_enter(class ir_call *);
- virtual ir_visitor_status visit_enter(class ir_expression *);
- virtual ir_visitor_status visit_enter(class ir_function *);
- virtual ir_visitor_status visit_enter(class ir_function_signature *);
- virtual ir_visitor_status visit_enter(class ir_if *);
- virtual ir_visitor_status visit_enter(class ir_loop *);
- virtual ir_visitor_status visit_enter(class ir_swizzle *);
- virtual ir_visitor_status visit_enter(class ir_texture *);
-
- bool do_graft(ir_rvalue **rvalue);
-
- bool progress;
- ir_variable *graft_var;
- ir_assignment *graft_assign;
-};
-
-struct find_deref_info {
- ir_variable *var;
- bool found;
-};
-
-void
-dereferences_variable_callback(ir_instruction *ir, void *data)
-{
- struct find_deref_info *info = (struct find_deref_info *)data;
- ir_dereference_variable *deref = ir->as_dereference_variable();
-
- if (deref && deref->var == info->var)
- info->found = true;
-}
-
-static bool
-dereferences_variable(ir_instruction *ir, ir_variable *var)
-{
- struct find_deref_info info;
-
- info.var = var;
- info.found = false;
-
- visit_tree(ir, dereferences_variable_callback, &info);
-
- return info.found;
-}
-
-bool
-ir_tree_grafting_visitor::do_graft(ir_rvalue **rvalue)
-{
- if (!*rvalue)
- return false;
-
- ir_dereference_variable *deref = (*rvalue)->as_dereference_variable();
-
- if (!deref || deref->var != this->graft_var)
- return false;
-
- if (debug) {
- printf("GRAFTING:\n");
- this->graft_assign->print();
- printf("\n");
- printf("TO:\n");
- (*rvalue)->print();
- printf("\n");
- }
-
- this->graft_assign->remove();
- *rvalue = this->graft_assign->rhs;
-
- this->progress = true;
- return true;
-}
-
-ir_visitor_status
-ir_tree_grafting_visitor::visit_enter(ir_loop *ir)
-{
- (void)ir;
- /* Do not traverse into the body of the loop since that is a
- * different basic block.
- */
- return visit_stop;
-}
-
-ir_visitor_status
-ir_tree_grafting_visitor::visit_leave(ir_assignment *ir)
-{
- if (do_graft(&ir->rhs) ||
- do_graft(&ir->condition))
- return visit_stop;
-
- /* If this assignment updates a variable used in the assignment
- * we're trying to graft, then we're done.
- */
- if (dereferences_variable(this->graft_assign->rhs,
- ir->lhs->variable_referenced())) {
- if (debug) {
- printf("graft killed by: ");
- ir->print();
- printf("\n");
- }
- return visit_stop;
- }
-
- return visit_continue;
-}
-
-ir_visitor_status
-ir_tree_grafting_visitor::visit_enter(ir_function *ir)
-{
- (void) ir;
- return visit_continue_with_parent;
-}
-
-ir_visitor_status
-ir_tree_grafting_visitor::visit_enter(ir_function_signature *ir)
-{
- (void)ir;
- return visit_continue_with_parent;
-}
-
-ir_visitor_status
-ir_tree_grafting_visitor::visit_enter(ir_call *ir)
-{
- exec_list_iterator sig_iter = ir->get_callee()->parameters.iterator();
- /* Reminder: iterating ir_call iterates its parameters. */
- foreach_iter(exec_list_iterator, iter, *ir) {
- ir_variable *sig_param = (ir_variable *)sig_iter.get();
- ir_rvalue *ir = (ir_rvalue *)iter.get();
- ir_rvalue *new_ir = ir;
-
- if (sig_param->mode != ir_var_in && sig_param->mode != ir_var_const_in)
- continue;
-
- if (do_graft(&new_ir)) {
- ir->replace_with(new_ir);
- return visit_stop;
- }
- sig_iter.next();
- }
-
- return visit_continue;
-}
-
-ir_visitor_status
-ir_tree_grafting_visitor::visit_enter(ir_expression *ir)
-{
- for (unsigned int i = 0; i < ir->get_num_operands(); i++) {
- if (do_graft(&ir->operands[i]))
- return visit_stop;
- }
-
- return visit_continue;
-}
-
-ir_visitor_status
-ir_tree_grafting_visitor::visit_enter(ir_if *ir)
-{
- if (do_graft(&ir->condition))
- return visit_stop;
-
- /* Do not traverse into the body of the if-statement since that is a
- * different basic block.
- */
- return visit_continue_with_parent;
-}
-
-ir_visitor_status
-ir_tree_grafting_visitor::visit_enter(ir_swizzle *ir)
-{
- if (do_graft(&ir->val))
- return visit_stop;
-
- return visit_continue;
-}
-
-ir_visitor_status
-ir_tree_grafting_visitor::visit_enter(ir_texture *ir)
-{
- if (do_graft(&ir->coordinate) ||
- do_graft(&ir->projector) ||
- do_graft(&ir->offset) ||
- do_graft(&ir->shadow_comparitor))
- return visit_stop;
-
- switch (ir->op) {
- case ir_tex:
- break;
- case ir_txb:
- if (do_graft(&ir->lod_info.bias))
- return visit_stop;
- break;
- case ir_txf:
- case ir_txl:
- if (do_graft(&ir->lod_info.lod))
- return visit_stop;
- break;
- case ir_txd:
- if (do_graft(&ir->lod_info.grad.dPdx) ||
- do_graft(&ir->lod_info.grad.dPdy))
- return visit_stop;
- break;
- }
-
- return visit_continue;
-}
-
-struct tree_grafting_info {
- ir_variable_refcount_visitor *refs;
- bool progress;
-};
-
-static bool
-try_tree_grafting(ir_assignment *start,
- ir_variable *lhs_var,
- ir_instruction *bb_last)
-{
- ir_tree_grafting_visitor v(start, lhs_var);
-
- if (debug) {
- printf("trying to graft: ");
- lhs_var->print();
- printf("\n");
- }
-
- for (ir_instruction *ir = (ir_instruction *)start->next;
- ir != bb_last->next;
- ir = (ir_instruction *)ir->next) {
-
- if (debug) {
- printf("- ");
- ir->print();
- printf("\n");
- }
-
- ir_visitor_status s = ir->accept(&v);
- if (s == visit_stop)
- return v.progress;
- }
-
- return false;
-}
-
-static void
-tree_grafting_basic_block(ir_instruction *bb_first,
- ir_instruction *bb_last,
- void *data)
-{
- struct tree_grafting_info *info = (struct tree_grafting_info *)data;
- ir_instruction *ir, *next;
-
- for (ir = bb_first, next = (ir_instruction *)ir->next;
- ir != bb_last->next;
- ir = next, next = (ir_instruction *)ir->next) {
- ir_assignment *assign = ir->as_assignment();
-
- if (!assign)
- continue;
-
- ir_variable *lhs_var = assign->whole_variable_written();
- if (!lhs_var)
- continue;
-
- if (lhs_var->mode == ir_var_out ||
- lhs_var->mode == ir_var_inout)
- continue;
-
- variable_entry *entry = info->refs->get_variable_entry(lhs_var);
-
- if (!entry->declaration ||
- entry->assigned_count != 1 ||
- entry->referenced_count != 2)
- continue;
-
- assert(assign == entry->assign);
-
- /* Found a possibly graftable assignment. Now, walk through the
- * rest of the BB seeing if the deref is here, and if nothing interfered with
- * pasting its expression's values in between.
- */
- info->progress |= try_tree_grafting(assign, lhs_var, bb_last);
- }
-}
-
-/**
- * Does a copy propagation pass on the code present in the instruction stream.
- */
-bool
-do_tree_grafting(exec_list *instructions)
-{
- ir_variable_refcount_visitor refs;
- struct tree_grafting_info info;
-
- info.progress = false;
- info.refs = &refs;
-
- visit_list_elements(info.refs, instructions);
-
- call_for_basic_blocks(instructions, tree_grafting_basic_block, &info);
-
- return info.progress;
-}
+/*
+ * Copyright © 2010 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+/**
+ * \file opt_tree_grafting.cpp
+ *
+ * Takes assignments to variables that are dereferenced only once and
+ * pastes the RHS expression into where the variable is dereferenced.
+ *
+ * In the process of various operations like function inlining and
+ * tertiary op handling, we'll end up with our expression trees having
+ * been chopped up into a series of assignments of short expressions
+ * to temps. Other passes like ir_algebraic.cpp would prefer to see
+ * the deepest expression trees they can to try to optimize them.
+ *
+ * This is a lot like copy propagaton. In comparison, copy
+ * propagation only acts on plain copies, not arbitrary expressions on
+ * the RHS. Generally, we wouldn't want to go pasting some
+ * complicated expression everywhere it got used, though, so we don't
+ * handle expressions in that pass.
+ *
+ * The hard part is making sure we don't move an expression across
+ * some other assignments that would change the value of the
+ * expression. So we split this into two passes: First, find the
+ * variables in our scope which are written to once and read once, and
+ * then go through basic blocks seeing if we find an opportunity to
+ * move those expressions safely.
+ */
+
+#include "ir.h"
+#include "ir_visitor.h"
+#include "ir_variable_refcount.h"
+#include "ir_basic_block.h"
+#include "ir_optimization.h"
+#include "glsl_types.h"
+
+static bool debug = false;
+
+class ir_tree_grafting_visitor : public ir_hierarchical_visitor {
+public:
+ ir_tree_grafting_visitor(ir_assignment *graft_assign,
+ ir_variable *graft_var)
+ {
+ this->progress = false;
+ this->graft_assign = graft_assign;
+ this->graft_var = graft_var;
+ }
+
+ virtual ir_visitor_status visit_leave(class ir_assignment *);
+ virtual ir_visitor_status visit_enter(class ir_call *);
+ virtual ir_visitor_status visit_enter(class ir_expression *);
+ virtual ir_visitor_status visit_enter(class ir_function *);
+ virtual ir_visitor_status visit_enter(class ir_function_signature *);
+ virtual ir_visitor_status visit_enter(class ir_if *);
+ virtual ir_visitor_status visit_enter(class ir_loop *);
+ virtual ir_visitor_status visit_enter(class ir_swizzle *);
+ virtual ir_visitor_status visit_enter(class ir_texture *);
+
+ bool do_graft(ir_rvalue **rvalue);
+
+ bool progress;
+ ir_variable *graft_var;
+ ir_assignment *graft_assign;
+};
+
+struct find_deref_info {
+ ir_variable *var;
+ bool found;
+};
+
+void
+dereferences_variable_callback(ir_instruction *ir, void *data)
+{
+ struct find_deref_info *info = (struct find_deref_info *)data;
+ ir_dereference_variable *deref = ir->as_dereference_variable();
+
+ if (deref && deref->var == info->var)
+ info->found = true;
+}
+
+static bool
+dereferences_variable(ir_instruction *ir, ir_variable *var)
+{
+ struct find_deref_info info;
+
+ info.var = var;
+ info.found = false;
+
+ visit_tree(ir, dereferences_variable_callback, &info);
+
+ return info.found;
+}
+
+bool
+ir_tree_grafting_visitor::do_graft(ir_rvalue **rvalue)
+{
+ if (!*rvalue)
+ return false;
+
+ ir_dereference_variable *deref = (*rvalue)->as_dereference_variable();
+
+ if (!deref || deref->var != this->graft_var)
+ return false;
+
+ if (debug) {
+ printf("GRAFTING:\n");
+ this->graft_assign->print();
+ printf("\n");
+ printf("TO:\n");
+ (*rvalue)->print();
+ printf("\n");
+ }
+
+ this->graft_assign->remove();
+ *rvalue = this->graft_assign->rhs;
+
+ this->progress = true;
+ return true;
+}
+
+ir_visitor_status
+ir_tree_grafting_visitor::visit_enter(ir_loop *ir)
+{
+ (void)ir;
+ /* Do not traverse into the body of the loop since that is a
+ * different basic block.
+ */
+ return visit_stop;
+}
+
+ir_visitor_status
+ir_tree_grafting_visitor::visit_leave(ir_assignment *ir)
+{
+ if (do_graft(&ir->rhs) ||
+ do_graft(&ir->condition))
+ return visit_stop;
+
+ /* If this assignment updates a variable used in the assignment
+ * we're trying to graft, then we're done.
+ */
+ if (dereferences_variable(this->graft_assign->rhs,
+ ir->lhs->variable_referenced())) {
+ if (debug) {
+ printf("graft killed by: ");
+ ir->print();
+ printf("\n");
+ }
+ return visit_stop;
+ }
+
+ return visit_continue;
+}
+
+ir_visitor_status
+ir_tree_grafting_visitor::visit_enter(ir_function *ir)
+{
+ (void) ir;
+ return visit_continue_with_parent;
+}
+
+ir_visitor_status
+ir_tree_grafting_visitor::visit_enter(ir_function_signature *ir)
+{
+ (void)ir;
+ return visit_continue_with_parent;
+}
+
+ir_visitor_status
+ir_tree_grafting_visitor::visit_enter(ir_call *ir)
+{
+ exec_list_iterator sig_iter = ir->get_callee()->parameters.iterator();
+ /* Reminder: iterating ir_call iterates its parameters. */
+ foreach_iter(exec_list_iterator, iter, *ir) {
+ ir_variable *sig_param = (ir_variable *)sig_iter.get();
+ ir_rvalue *ir = (ir_rvalue *)iter.get();
+ ir_rvalue *new_ir = ir;
+
+ if (sig_param->mode != ir_var_in && sig_param->mode != ir_var_const_in)
+ continue;
+
+ if (do_graft(&new_ir)) {
+ ir->replace_with(new_ir);
+ return visit_stop;
+ }
+ sig_iter.next();
+ }
+
+ return visit_continue;
+}
+
+ir_visitor_status
+ir_tree_grafting_visitor::visit_enter(ir_expression *ir)
+{
+ for (unsigned int i = 0; i < ir->get_num_operands(); i++) {
+ if (do_graft(&ir->operands[i]))
+ return visit_stop;
+ }
+
+ return visit_continue;
+}
+
+ir_visitor_status
+ir_tree_grafting_visitor::visit_enter(ir_if *ir)
+{
+ if (do_graft(&ir->condition))
+ return visit_stop;
+
+ /* Do not traverse into the body of the if-statement since that is a
+ * different basic block.
+ */
+ return visit_continue_with_parent;
+}
+
+ir_visitor_status
+ir_tree_grafting_visitor::visit_enter(ir_swizzle *ir)
+{
+ if (do_graft(&ir->val))
+ return visit_stop;
+
+ return visit_continue;
+}
+
+ir_visitor_status
+ir_tree_grafting_visitor::visit_enter(ir_texture *ir)
+{
+ if (do_graft(&ir->coordinate) ||
+ do_graft(&ir->projector) ||
+ do_graft(&ir->offset) ||
+ do_graft(&ir->shadow_comparitor))
+ return visit_stop;
+
+ switch (ir->op) {
+ case ir_tex:
+ break;
+ case ir_txb:
+ if (do_graft(&ir->lod_info.bias))
+ return visit_stop;
+ break;
+ case ir_txf:
+ case ir_txl:
+ if (do_graft(&ir->lod_info.lod))
+ return visit_stop;
+ break;
+ case ir_txd:
+ if (do_graft(&ir->lod_info.grad.dPdx) ||
+ do_graft(&ir->lod_info.grad.dPdy))
+ return visit_stop;
+ break;
+ }
+
+ return visit_continue;
+}
+
+struct tree_grafting_info {
+ ir_variable_refcount_visitor *refs;
+ bool progress;
+};
+
+static bool
+try_tree_grafting(ir_assignment *start,
+ ir_variable *lhs_var,
+ ir_instruction *bb_last)
+{
+ ir_tree_grafting_visitor v(start, lhs_var);
+
+ if (debug) {
+ printf("trying to graft: ");
+ lhs_var->print();
+ printf("\n");
+ }
+
+ for (ir_instruction *ir = (ir_instruction *)start->next;
+ ir != bb_last->next;
+ ir = (ir_instruction *)ir->next) {
+
+ if (debug) {
+ printf("- ");
+ ir->print();
+ printf("\n");
+ }
+
+ ir_visitor_status s = ir->accept(&v);
+ if (s == visit_stop)
+ return v.progress;
+ }
+
+ return false;
+}
+
+static void
+tree_grafting_basic_block(ir_instruction *bb_first,
+ ir_instruction *bb_last,
+ void *data)
+{
+ struct tree_grafting_info *info = (struct tree_grafting_info *)data;
+ ir_instruction *ir, *next;
+
+ for (ir = bb_first, next = (ir_instruction *)ir->next;
+ ir != bb_last->next;
+ ir = next, next = (ir_instruction *)ir->next) {
+ ir_assignment *assign = ir->as_assignment();
+
+ if (!assign)
+ continue;
+
+ ir_variable *lhs_var = assign->whole_variable_written();
+ if (!lhs_var)
+ continue;
+
+ if (lhs_var->mode == ir_var_out ||
+ lhs_var->mode == ir_var_inout)
+ continue;
+
+ variable_entry *entry = info->refs->get_variable_entry(lhs_var);
+
+ if (!entry->declaration ||
+ entry->assigned_count != 1 ||
+ entry->referenced_count != 2)
+ continue;
+
+ assert(assign == entry->assign);
+
+ /* Found a possibly graftable assignment. Now, walk through the
+ * rest of the BB seeing if the deref is here, and if nothing interfered with
+ * pasting its expression's values in between.
+ */
+ info->progress |= try_tree_grafting(assign, lhs_var, bb_last);
+ }
+}
+
+/**
+ * Does a copy propagation pass on the code present in the instruction stream.
+ */
+bool
+do_tree_grafting(exec_list *instructions)
+{
+ ir_variable_refcount_visitor refs;
+ struct tree_grafting_info info;
+
+ info.progress = false;
+ info.refs = &refs;
+
+ visit_list_elements(info.refs, instructions);
+
+ call_for_basic_blocks(instructions, tree_grafting_basic_block, &info);
+
+ return info.progress;
+}
diff --git a/mesalib/src/glsl/s_expression.cpp b/mesalib/src/glsl/s_expression.cpp
index a922a50d3..b47b014c6 100644
--- a/mesalib/src/glsl/s_expression.cpp
+++ b/mesalib/src/glsl/s_expression.cpp
@@ -1,183 +1,183 @@
-/* -*- c++ -*- */
-/*
- * Copyright © 2010 Intel Corporation
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-
-#include <assert.h>
-#include "s_expression.h"
-
-s_symbol::s_symbol(const char *tmp, size_t n)
-{
- this->str = ralloc_strndup (this, tmp, n);
- assert(this->str != NULL);
-}
-
-s_list::s_list()
-{
-}
-
-static void
-skip_whitespace(const char *& src)
-{
- src += strspn(src, " \v\t\r\n");
- /* Also skip Scheme-style comments: semi-colon 'til end of line */
- if (src[0] == ';') {
- src += strcspn(src, "\n");
- skip_whitespace(src);
- }
-}
-
-static s_expression *
-read_atom(void *ctx, const char *& src)
-{
- s_expression *expr = NULL;
-
- skip_whitespace(src);
-
- size_t n = strcspn(src, "( \v\t\r\n);");
- if (n == 0)
- return NULL; // no atom
-
- // Check if the atom is a number.
- char *float_end = NULL;
- double f = glsl_strtod(src, &float_end);
- if (float_end != src) {
- char *int_end = NULL;
- int i = strtol(src, &int_end, 10);
- // If strtod matched more characters, it must have a decimal part
- if (float_end > int_end)
- expr = new(ctx) s_float(f);
- else
- expr = new(ctx) s_int(i);
- } else {
- // Not a number; return a symbol.
- expr = new(ctx) s_symbol(src, n);
- }
-
- src += n;
-
- return expr;
-}
-
-s_expression *
-s_expression::read_expression(void *ctx, const char *&src)
-{
- assert(src != NULL);
-
- s_expression *atom = read_atom(ctx, src);
- if (atom != NULL)
- return atom;
-
- skip_whitespace(src);
- if (src[0] == '(') {
- ++src;
-
- s_list *list = new(ctx) s_list;
- s_expression *expr;
-
- while ((expr = read_expression(ctx, src)) != NULL) {
- list->subexpressions.push_tail(expr);
- }
- skip_whitespace(src);
- if (src[0] != ')') {
- printf("Unclosed expression (check your parenthesis).\n");
- return NULL;
- }
- ++src;
- return list;
- }
- return NULL;
-}
-
-void s_int::print()
-{
- printf("%d", this->val);
-}
-
-void s_float::print()
-{
- printf("%f", this->val);
-}
-
-void s_symbol::print()
-{
- printf("%s", this->str);
-}
-
-void s_list::print()
-{
- printf("(");
- foreach_iter(exec_list_iterator, it, this->subexpressions) {
- s_expression *expr = (s_expression*) it.get();
- expr->print();
- if (!expr->next->is_tail_sentinel())
- printf(" ");
- }
- printf(")");
-}
-
-// --------------------------------------------------
-
-bool
-s_pattern::match(s_expression *expr)
-{
- switch (type)
- {
- case EXPR: *p_expr = expr; break;
- case LIST: if (expr->is_list()) *p_list = (s_list *) expr; break;
- case SYMBOL: if (expr->is_symbol()) *p_symbol = (s_symbol *) expr; break;
- case NUMBER: if (expr->is_number()) *p_number = (s_number *) expr; break;
- case INT: if (expr->is_int()) *p_int = (s_int *) expr; break;
- case STRING:
- s_symbol *sym = SX_AS_SYMBOL(expr);
- if (sym != NULL && strcmp(sym->value(), literal) == 0)
- return true;
- return false;
- };
-
- return *p_expr == expr;
-}
-
-bool
-s_match(s_expression *top, unsigned n, s_pattern *pattern, bool partial)
-{
- s_list *list = SX_AS_LIST(top);
- if (list == NULL)
- return false;
-
- unsigned i = 0;
- foreach_iter(exec_list_iterator, it, list->subexpressions) {
- if (i >= n)
- return partial; /* More actual items than the pattern expected */
-
- s_expression *expr = (s_expression *) it.get();
- if (expr == NULL || !pattern[i].match(expr))
- return false;
-
- i++;
- }
-
- if (i < n)
- return false; /* Less actual items than the pattern expected */
-
- return true;
-}
+/* -*- c++ -*- */
+/*
+ * Copyright © 2010 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+#include <assert.h>
+#include "s_expression.h"
+
+s_symbol::s_symbol(const char *tmp, size_t n)
+{
+ this->str = ralloc_strndup (this, tmp, n);
+ assert(this->str != NULL);
+}
+
+s_list::s_list()
+{
+}
+
+static void
+skip_whitespace(const char *& src)
+{
+ src += strspn(src, " \v\t\r\n");
+ /* Also skip Scheme-style comments: semi-colon 'til end of line */
+ if (src[0] == ';') {
+ src += strcspn(src, "\n");
+ skip_whitespace(src);
+ }
+}
+
+static s_expression *
+read_atom(void *ctx, const char *& src)
+{
+ s_expression *expr = NULL;
+
+ skip_whitespace(src);
+
+ size_t n = strcspn(src, "( \v\t\r\n);");
+ if (n == 0)
+ return NULL; // no atom
+
+ // Check if the atom is a number.
+ char *float_end = NULL;
+ double f = glsl_strtod(src, &float_end);
+ if (float_end != src) {
+ char *int_end = NULL;
+ int i = strtol(src, &int_end, 10);
+ // If strtod matched more characters, it must have a decimal part
+ if (float_end > int_end)
+ expr = new(ctx) s_float(f);
+ else
+ expr = new(ctx) s_int(i);
+ } else {
+ // Not a number; return a symbol.
+ expr = new(ctx) s_symbol(src, n);
+ }
+
+ src += n;
+
+ return expr;
+}
+
+s_expression *
+s_expression::read_expression(void *ctx, const char *&src)
+{
+ assert(src != NULL);
+
+ s_expression *atom = read_atom(ctx, src);
+ if (atom != NULL)
+ return atom;
+
+ skip_whitespace(src);
+ if (src[0] == '(') {
+ ++src;
+
+ s_list *list = new(ctx) s_list;
+ s_expression *expr;
+
+ while ((expr = read_expression(ctx, src)) != NULL) {
+ list->subexpressions.push_tail(expr);
+ }
+ skip_whitespace(src);
+ if (src[0] != ')') {
+ printf("Unclosed expression (check your parenthesis).\n");
+ return NULL;
+ }
+ ++src;
+ return list;
+ }
+ return NULL;
+}
+
+void s_int::print()
+{
+ printf("%d", this->val);
+}
+
+void s_float::print()
+{
+ printf("%f", this->val);
+}
+
+void s_symbol::print()
+{
+ printf("%s", this->str);
+}
+
+void s_list::print()
+{
+ printf("(");
+ foreach_iter(exec_list_iterator, it, this->subexpressions) {
+ s_expression *expr = (s_expression*) it.get();
+ expr->print();
+ if (!expr->next->is_tail_sentinel())
+ printf(" ");
+ }
+ printf(")");
+}
+
+// --------------------------------------------------
+
+bool
+s_pattern::match(s_expression *expr)
+{
+ switch (type)
+ {
+ case EXPR: *p_expr = expr; break;
+ case LIST: if (expr->is_list()) *p_list = (s_list *) expr; break;
+ case SYMBOL: if (expr->is_symbol()) *p_symbol = (s_symbol *) expr; break;
+ case NUMBER: if (expr->is_number()) *p_number = (s_number *) expr; break;
+ case INT: if (expr->is_int()) *p_int = (s_int *) expr; break;
+ case STRING:
+ s_symbol *sym = SX_AS_SYMBOL(expr);
+ if (sym != NULL && strcmp(sym->value(), literal) == 0)
+ return true;
+ return false;
+ };
+
+ return *p_expr == expr;
+}
+
+bool
+s_match(s_expression *top, unsigned n, s_pattern *pattern, bool partial)
+{
+ s_list *list = SX_AS_LIST(top);
+ if (list == NULL)
+ return false;
+
+ unsigned i = 0;
+ foreach_iter(exec_list_iterator, it, list->subexpressions) {
+ if (i >= n)
+ return partial; /* More actual items than the pattern expected */
+
+ s_expression *expr = (s_expression *) it.get();
+ if (expr == NULL || !pattern[i].match(expr))
+ return false;
+
+ i++;
+ }
+
+ if (i < n)
+ return false; /* Less actual items than the pattern expected */
+
+ return true;
+}
diff --git a/mesalib/src/glu/sgi/include/gluos.h b/mesalib/src/glu/sgi/include/gluos.h
index ac0a7874c..6e1691022 100644
--- a/mesalib/src/glu/sgi/include/gluos.h
+++ b/mesalib/src/glu/sgi/include/gluos.h
@@ -1,80 +1,80 @@
-/*
-** gluos.h - operating system dependencies for GLU
-**
-*/
-#ifdef __VMS
-#ifdef __cplusplus
-#pragma message disable nocordel
-#pragma message disable codeunreachable
-#pragma message disable codcauunr
-#endif
-#endif
-
-#ifdef __WATCOMC__
-/* Disable *lots* of warnings to get a clean build. I can't be bothered fixing the
- * code at the moment, as it is pretty ugly.
- */
-#pragma warning 7 10
-#pragma warning 13 10
-#pragma warning 14 10
-#pragma warning 367 10
-#pragma warning 379 10
-#pragma warning 726 10
-#pragma warning 836 10
-#endif
-
-#ifdef BUILD_FOR_SNAP
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <malloc.h>
-
-#elif defined(_WIN32)
-
-#include <stdlib.h> /* For _MAX_PATH definition */
-#include <stdio.h>
-#include <malloc.h>
-
-#define WIN32_LEAN_AND_MEAN
-#define NOGDI
-#define NOIME
-#define NOMINMAX
-
-#ifndef _WIN32_WINNT
- #define _WIN32_WINNT 0x0400
-#endif
-#ifndef STRICT
- #define STRICT 1
-#endif
-
-#include <windows.h>
-
-/* Disable warnings */
-#if defined(_MSC_VER)
-#pragma warning(disable : 4101)
-#pragma warning(disable : 4244)
-#pragma warning(disable : 4761)
-#endif
-
-#if defined(_MSC_VER) && _MSC_VER >= 1200 && _MSC_VER < 1300
-#pragma comment(linker, "/OPT:NOWIN98")
-#endif
-
-#ifndef WINGDIAPI
-#define WINGDIAPI
-#endif
-
-#elif defined(__OS2__)
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <malloc.h>
-#define WINGDIAPI
-
-#else
-
-/* Disable Microsoft-specific keywords */
-#define GLAPIENTRY
-#define WINGDIAPI
-
-#endif
+/*
+** gluos.h - operating system dependencies for GLU
+**
+*/
+#ifdef __VMS
+#ifdef __cplusplus
+#pragma message disable nocordel
+#pragma message disable codeunreachable
+#pragma message disable codcauunr
+#endif
+#endif
+
+#ifdef __WATCOMC__
+/* Disable *lots* of warnings to get a clean build. I can't be bothered fixing the
+ * code at the moment, as it is pretty ugly.
+ */
+#pragma warning 7 10
+#pragma warning 13 10
+#pragma warning 14 10
+#pragma warning 367 10
+#pragma warning 379 10
+#pragma warning 726 10
+#pragma warning 836 10
+#endif
+
+#ifdef BUILD_FOR_SNAP
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <malloc.h>
+
+#elif defined(_WIN32)
+
+#include <stdlib.h> /* For _MAX_PATH definition */
+#include <stdio.h>
+#include <malloc.h>
+
+#define WIN32_LEAN_AND_MEAN
+#define NOGDI
+#define NOIME
+#define NOMINMAX
+
+#ifndef _WIN32_WINNT
+ #define _WIN32_WINNT 0x0400
+#endif
+#ifndef STRICT
+ #define STRICT 1
+#endif
+
+#include <windows.h>
+
+/* Disable warnings */
+#if defined(_MSC_VER)
+#pragma warning(disable : 4101)
+#pragma warning(disable : 4244)
+#pragma warning(disable : 4761)
+#endif
+
+#if defined(_MSC_VER) && _MSC_VER >= 1200 && _MSC_VER < 1300
+#pragma comment(linker, "/OPT:NOWIN98")
+#endif
+
+#ifndef WINGDIAPI
+#define WINGDIAPI
+#endif
+
+#elif defined(__OS2__)
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <malloc.h>
+#define WINGDIAPI
+
+#else
+
+/* Disable Microsoft-specific keywords */
+#define GLAPIENTRY
+#define WINGDIAPI
+
+#endif
diff --git a/mesalib/src/glu/sgi/libutil/mipmap.c b/mesalib/src/glu/sgi/libutil/mipmap.c
index c475c96a2..3ba3667ae 100644
--- a/mesalib/src/glu/sgi/libutil/mipmap.c
+++ b/mesalib/src/glu/sgi/libutil/mipmap.c
@@ -1,8940 +1,8940 @@
-/*
- * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008)
- * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice including the dates of first publication and
- * either this permission notice or a reference to
- * http://oss.sgi.com/projects/FreeB/
- * shall be included in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
- * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- *
- * Except as contained in this notice, the name of Silicon Graphics, Inc.
- * shall not be used in advertising or otherwise to promote the sale, use or
- * other dealings in this Software without prior written authorization from
- * Silicon Graphics, Inc.
- */
-
-#include "gluos.h"
-#include <assert.h>
-#include <GL/glu.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <limits.h> /* UINT_MAX */
-#include <math.h>
-
-typedef union {
- unsigned char ub[4];
- unsigned short us[2];
- unsigned int ui;
- char b[4];
- short s[2];
- int i;
- float f;
-} Type_Widget;
-
-/* Pixel storage modes */
-typedef struct {
- GLint pack_alignment;
- GLint pack_row_length;
- GLint pack_skip_rows;
- GLint pack_skip_pixels;
- GLint pack_lsb_first;
- GLint pack_swap_bytes;
- GLint pack_skip_images;
- GLint pack_image_height;
-
- GLint unpack_alignment;
- GLint unpack_row_length;
- GLint unpack_skip_rows;
- GLint unpack_skip_pixels;
- GLint unpack_lsb_first;
- GLint unpack_swap_bytes;
- GLint unpack_skip_images;
- GLint unpack_image_height;
-} PixelStorageModes;
-
-static int gluBuild1DMipmapLevelsCore(GLenum, GLint,
- GLsizei,
- GLsizei,
- GLenum, GLenum, GLint, GLint, GLint,
- const void *);
-static int gluBuild2DMipmapLevelsCore(GLenum, GLint,
- GLsizei, GLsizei,
- GLsizei, GLsizei,
- GLenum, GLenum, GLint, GLint, GLint,
- const void *);
-static int gluBuild3DMipmapLevelsCore(GLenum, GLint,
- GLsizei, GLsizei, GLsizei,
- GLsizei, GLsizei, GLsizei,
- GLenum, GLenum, GLint, GLint, GLint,
- const void *);
-
-/*
- * internal function declarations
- */
-static GLfloat bytes_per_element(GLenum type);
-static GLint elements_per_group(GLenum format, GLenum type);
-static GLint is_index(GLenum format);
-static GLint image_size(GLint width, GLint height, GLenum format, GLenum type);
-static void fill_image(const PixelStorageModes *,
- GLint width, GLint height, GLenum format,
- GLenum type, GLboolean index_format,
- const void *userdata, GLushort *newimage);
-static void empty_image(const PixelStorageModes *,
- GLint width, GLint height, GLenum format,
- GLenum type, GLboolean index_format,
- const GLushort *oldimage, void *userdata);
-static void scale_internal(GLint components, GLint widthin, GLint heightin,
- const GLushort *datain,
- GLint widthout, GLint heightout,
- GLushort *dataout);
-
-static void scale_internal_ubyte(GLint components, GLint widthin,
- GLint heightin, const GLubyte *datain,
- GLint widthout, GLint heightout,
- GLubyte *dataout, GLint element_size,
- GLint ysize, GLint group_size);
-static void scale_internal_byte(GLint components, GLint widthin,
- GLint heightin, const GLbyte *datain,
- GLint widthout, GLint heightout,
- GLbyte *dataout, GLint element_size,
- GLint ysize, GLint group_size);
-static void scale_internal_ushort(GLint components, GLint widthin,
- GLint heightin, const GLushort *datain,
- GLint widthout, GLint heightout,
- GLushort *dataout, GLint element_size,
- GLint ysize, GLint group_size,
- GLint myswap_bytes);
-static void scale_internal_short(GLint components, GLint widthin,
- GLint heightin, const GLshort *datain,
- GLint widthout, GLint heightout,
- GLshort *dataout, GLint element_size,
- GLint ysize, GLint group_size,
- GLint myswap_bytes);
-static void scale_internal_uint(GLint components, GLint widthin,
- GLint heightin, const GLuint *datain,
- GLint widthout, GLint heightout,
- GLuint *dataout, GLint element_size,
- GLint ysize, GLint group_size,
- GLint myswap_bytes);
-static void scale_internal_int(GLint components, GLint widthin,
- GLint heightin, const GLint *datain,
- GLint widthout, GLint heightout,
- GLint *dataout, GLint element_size,
- GLint ysize, GLint group_size,
- GLint myswap_bytes);
-static void scale_internal_float(GLint components, GLint widthin,
- GLint heightin, const GLfloat *datain,
- GLint widthout, GLint heightout,
- GLfloat *dataout, GLint element_size,
- GLint ysize, GLint group_size,
- GLint myswap_bytes);
-
-static int checkMipmapArgs(GLenum, GLenum, GLenum);
-static GLboolean legalFormat(GLenum);
-static GLboolean legalType(GLenum);
-static GLboolean isTypePackedPixel(GLenum);
-static GLboolean isLegalFormatForPackedPixelType(GLenum, GLenum);
-static GLboolean isLegalLevels(GLint, GLint, GLint, GLint);
-static void closestFit(GLenum, GLint, GLint, GLint, GLenum, GLenum,
- GLint *, GLint *);
-
-/* all extract/shove routines must return double to handle unsigned ints */
-static GLdouble extractUbyte(int, const void *);
-static void shoveUbyte(GLdouble, int, void *);
-static GLdouble extractSbyte(int, const void *);
-static void shoveSbyte(GLdouble, int, void *);
-static GLdouble extractUshort(int, const void *);
-static void shoveUshort(GLdouble, int, void *);
-static GLdouble extractSshort(int, const void *);
-static void shoveSshort(GLdouble, int, void *);
-static GLdouble extractUint(int, const void *);
-static void shoveUint(GLdouble, int, void *);
-static GLdouble extractSint(int, const void *);
-static void shoveSint(GLdouble, int, void *);
-static GLdouble extractFloat(int, const void *);
-static void shoveFloat(GLdouble, int, void *);
-static void halveImageSlice(int, GLdouble (*)(int, const void *),
- void (*)(GLdouble, int, void *),
- GLint, GLint, GLint,
- const void *, void *,
- GLint, GLint, GLint, GLint, GLint);
-static void halveImage3D(int, GLdouble (*)(int, const void *),
- void (*)(GLdouble, int, void *),
- GLint, GLint, GLint,
- const void *, void *,
- GLint, GLint, GLint, GLint, GLint);
-
-/* packedpixel type scale routines */
-static void extract332(int,const void *, GLfloat []);
-static void shove332(const GLfloat [],int ,void *);
-static void extract233rev(int,const void *, GLfloat []);
-static void shove233rev(const GLfloat [],int ,void *);
-static void extract565(int,const void *, GLfloat []);
-static void shove565(const GLfloat [],int ,void *);
-static void extract565rev(int,const void *, GLfloat []);
-static void shove565rev(const GLfloat [],int ,void *);
-static void extract4444(int,const void *, GLfloat []);
-static void shove4444(const GLfloat [],int ,void *);
-static void extract4444rev(int,const void *, GLfloat []);
-static void shove4444rev(const GLfloat [],int ,void *);
-static void extract5551(int,const void *, GLfloat []);
-static void shove5551(const GLfloat [],int ,void *);
-static void extract1555rev(int,const void *, GLfloat []);
-static void shove1555rev(const GLfloat [],int ,void *);
-static void extract8888(int,const void *, GLfloat []);
-static void shove8888(const GLfloat [],int ,void *);
-static void extract8888rev(int,const void *, GLfloat []);
-static void shove8888rev(const GLfloat [],int ,void *);
-static void extract1010102(int,const void *, GLfloat []);
-static void shove1010102(const GLfloat [],int ,void *);
-static void extract2101010rev(int,const void *, GLfloat []);
-static void shove2101010rev(const GLfloat [],int ,void *);
-static void scaleInternalPackedPixel(int,
- void (*)(int, const void *,GLfloat []),
- void (*)(const GLfloat [],int, void *),
- GLint,GLint, const void *,
- GLint,GLint,void *,GLint,GLint,GLint);
-static void halveImagePackedPixel(int,
- void (*)(int, const void *,GLfloat []),
- void (*)(const GLfloat [],int, void *),
- GLint, GLint, const void *,
- void *, GLint, GLint, GLint);
-static void halve1DimagePackedPixel(int,
- void (*)(int, const void *,GLfloat []),
- void (*)(const GLfloat [],int, void *),
- GLint, GLint, const void *,
- void *, GLint, GLint, GLint);
-
-static void halve1Dimage_ubyte(GLint, GLuint, GLuint,const GLubyte *,
- GLubyte *, GLint, GLint, GLint);
-static void halve1Dimage_byte(GLint, GLuint, GLuint,const GLbyte *, GLbyte *,
- GLint, GLint, GLint);
-static void halve1Dimage_ushort(GLint, GLuint, GLuint, const GLushort *,
- GLushort *, GLint, GLint, GLint, GLint);
-static void halve1Dimage_short(GLint, GLuint, GLuint,const GLshort *, GLshort *,
- GLint, GLint, GLint, GLint);
-static void halve1Dimage_uint(GLint, GLuint, GLuint, const GLuint *, GLuint *,
- GLint, GLint, GLint, GLint);
-static void halve1Dimage_int(GLint, GLuint, GLuint, const GLint *, GLint *,
- GLint, GLint, GLint, GLint);
-static void halve1Dimage_float(GLint, GLuint, GLuint, const GLfloat *, GLfloat *,
- GLint, GLint, GLint, GLint);
-
-static GLint imageSize3D(GLint, GLint, GLint, GLenum,GLenum);
-static void fillImage3D(const PixelStorageModes *, GLint, GLint, GLint,GLenum,
- GLenum, GLboolean, const void *, GLushort *);
-static void emptyImage3D(const PixelStorageModes *,
- GLint, GLint, GLint, GLenum,
- GLenum, GLboolean,
- const GLushort *, void *);
-static void scaleInternal3D(GLint, GLint, GLint, GLint, const GLushort *,
- GLint, GLint, GLint, GLushort *);
-
-static void retrieveStoreModes(PixelStorageModes *psm)
-{
- glGetIntegerv(GL_UNPACK_ALIGNMENT, &psm->unpack_alignment);
- glGetIntegerv(GL_UNPACK_ROW_LENGTH, &psm->unpack_row_length);
- glGetIntegerv(GL_UNPACK_SKIP_ROWS, &psm->unpack_skip_rows);
- glGetIntegerv(GL_UNPACK_SKIP_PIXELS, &psm->unpack_skip_pixels);
- glGetIntegerv(GL_UNPACK_LSB_FIRST, &psm->unpack_lsb_first);
- glGetIntegerv(GL_UNPACK_SWAP_BYTES, &psm->unpack_swap_bytes);
-
- glGetIntegerv(GL_PACK_ALIGNMENT, &psm->pack_alignment);
- glGetIntegerv(GL_PACK_ROW_LENGTH, &psm->pack_row_length);
- glGetIntegerv(GL_PACK_SKIP_ROWS, &psm->pack_skip_rows);
- glGetIntegerv(GL_PACK_SKIP_PIXELS, &psm->pack_skip_pixels);
- glGetIntegerv(GL_PACK_LSB_FIRST, &psm->pack_lsb_first);
- glGetIntegerv(GL_PACK_SWAP_BYTES, &psm->pack_swap_bytes);
-}
-
-static void retrieveStoreModes3D(PixelStorageModes *psm)
-{
- glGetIntegerv(GL_UNPACK_ALIGNMENT, &psm->unpack_alignment);
- glGetIntegerv(GL_UNPACK_ROW_LENGTH, &psm->unpack_row_length);
- glGetIntegerv(GL_UNPACK_SKIP_ROWS, &psm->unpack_skip_rows);
- glGetIntegerv(GL_UNPACK_SKIP_PIXELS, &psm->unpack_skip_pixels);
- glGetIntegerv(GL_UNPACK_LSB_FIRST, &psm->unpack_lsb_first);
- glGetIntegerv(GL_UNPACK_SWAP_BYTES, &psm->unpack_swap_bytes);
- glGetIntegerv(GL_UNPACK_SKIP_IMAGES, &psm->unpack_skip_images);
- glGetIntegerv(GL_UNPACK_IMAGE_HEIGHT, &psm->unpack_image_height);
-
- glGetIntegerv(GL_PACK_ALIGNMENT, &psm->pack_alignment);
- glGetIntegerv(GL_PACK_ROW_LENGTH, &psm->pack_row_length);
- glGetIntegerv(GL_PACK_SKIP_ROWS, &psm->pack_skip_rows);
- glGetIntegerv(GL_PACK_SKIP_PIXELS, &psm->pack_skip_pixels);
- glGetIntegerv(GL_PACK_LSB_FIRST, &psm->pack_lsb_first);
- glGetIntegerv(GL_PACK_SWAP_BYTES, &psm->pack_swap_bytes);
- glGetIntegerv(GL_PACK_SKIP_IMAGES, &psm->pack_skip_images);
- glGetIntegerv(GL_PACK_IMAGE_HEIGHT, &psm->pack_image_height);
-}
-
-static int computeLog(GLuint value)
-{
- int i;
-
- i = 0;
-
- /* Error! */
- if (value == 0) return -1;
-
- for (;;) {
- if (value & 1) {
- /* Error ! */
- if (value != 1) return -1;
- return i;
- }
- value = value >> 1;
- i++;
- }
-}
-
-/*
-** Compute the nearest power of 2 number. This algorithm is a little
-** strange, but it works quite well.
-*/
-static int nearestPower(GLuint value)
-{
- int i;
-
- i = 1;
-
- /* Error! */
- if (value == 0) return -1;
-
- for (;;) {
- if (value == 1) {
- return i;
- } else if (value == 3) {
- return i*4;
- }
- value = value >> 1;
- i *= 2;
- }
-}
-
-#define __GLU_SWAP_2_BYTES(s)\
-(GLushort)(((GLushort)((const GLubyte*)(s))[1])<<8 | ((const GLubyte*)(s))[0])
-
-#define __GLU_SWAP_4_BYTES(s)\
-(GLuint)(((GLuint)((const GLubyte*)(s))[3])<<24 | \
- ((GLuint)((const GLubyte*)(s))[2])<<16 | \
- ((GLuint)((const GLubyte*)(s))[1])<<8 | ((const GLubyte*)(s))[0])
-
-static void halveImage(GLint components, GLuint width, GLuint height,
- const GLushort *datain, GLushort *dataout)
-{
- int i, j, k;
- int newwidth, newheight;
- int delta;
- GLushort *s;
- const GLushort *t;
-
- newwidth = width / 2;
- newheight = height / 2;
- delta = width * components;
- s = dataout;
- t = datain;
-
- /* Piece o' cake! */
- for (i = 0; i < newheight; i++) {
- for (j = 0; j < newwidth; j++) {
- for (k = 0; k < components; k++) {
- s[0] = (t[0] + t[components] + t[delta] +
- t[delta+components] + 2) / 4;
- s++; t++;
- }
- t += components;
- }
- t += delta;
- }
-}
-
-static void halveImage_ubyte(GLint components, GLuint width, GLuint height,
- const GLubyte *datain, GLubyte *dataout,
- GLint element_size, GLint ysize, GLint group_size)
-{
- int i, j, k;
- int newwidth, newheight;
- int padBytes;
- GLubyte *s;
- const char *t;
-
- /* handle case where there is only 1 column/row */
- if (width == 1 || height == 1) {
- assert( !(width == 1 && height == 1) ); /* can't be 1x1 */
- halve1Dimage_ubyte(components,width,height,datain,dataout,
- element_size,ysize,group_size);
- return;
- }
-
- newwidth = width / 2;
- newheight = height / 2;
- padBytes = ysize - (width*group_size);
- s = dataout;
- t = (const char *)datain;
-
- /* Piece o' cake! */
- for (i = 0; i < newheight; i++) {
- for (j = 0; j < newwidth; j++) {
- for (k = 0; k < components; k++) {
- s[0] = (*(const GLubyte*)t +
- *(const GLubyte*)(t+group_size) +
- *(const GLubyte*)(t+ysize) +
- *(const GLubyte*)(t+ysize+group_size) + 2) / 4;
- s++; t += element_size;
- }
- t += group_size;
- }
- t += padBytes;
- t += ysize;
- }
-}
-
-/* */
-static void halve1Dimage_ubyte(GLint components, GLuint width, GLuint height,
- const GLubyte *dataIn, GLubyte *dataOut,
- GLint element_size, GLint ysize,
- GLint group_size)
-{
- GLint halfWidth= width / 2;
- GLint halfHeight= height / 2;
- const char *src= (const char *) dataIn;
- GLubyte *dest= dataOut;
- int jj;
-
- assert(width == 1 || height == 1); /* must be 1D */
- assert(width != height); /* can't be square */
-
- if (height == 1) { /* 1 row */
- assert(width != 1); /* widthxheight can't be 1x1 */
- halfHeight= 1;
-
- for (jj= 0; jj< halfWidth; jj++) {
- int kk;
- for (kk= 0; kk< components; kk++) {
- *dest= (*(const GLubyte*)src +
- *(const GLubyte*)(src+group_size)) / 2;
-
- src+= element_size;
- dest++;
- }
- src+= group_size; /* skip to next 2 */
- }
- {
- int padBytes= ysize - (width*group_size);
- src+= padBytes; /* for assertion only */
- }
- }
- else if (width == 1) { /* 1 column */
- int padBytes= ysize - (width * group_size);
- assert(height != 1); /* widthxheight can't be 1x1 */
- halfWidth= 1;
- /* one vertical column with possible pad bytes per row */
- /* average two at a time */
-
- for (jj= 0; jj< halfHeight; jj++) {
- int kk;
- for (kk= 0; kk< components; kk++) {
- *dest= (*(const GLubyte*)src + *(const GLubyte*)(src+ysize)) / 2;
-
- src+= element_size;
- dest++;
- }
- src+= padBytes; /* add pad bytes, if any, to get to end to row */
- src+= ysize;
- }
- }
-
- assert(src == &((const char *)dataIn)[ysize*height]);
- assert((char *)dest == &((char *)dataOut)
- [components * element_size * halfWidth * halfHeight]);
-} /* halve1Dimage_ubyte() */
-
-static void halveImage_byte(GLint components, GLuint width, GLuint height,
- const GLbyte *datain, GLbyte *dataout,
- GLint element_size,
- GLint ysize, GLint group_size)
-{
- int i, j, k;
- int newwidth, newheight;
- int padBytes;
- GLbyte *s;
- const char *t;
-
- /* handle case where there is only 1 column/row */
- if (width == 1 || height == 1) {
- assert( !(width == 1 && height == 1) ); /* can't be 1x1 */
- halve1Dimage_byte(components,width,height,datain,dataout,
- element_size,ysize,group_size);
- return;
- }
-
- newwidth = width / 2;
- newheight = height / 2;
- padBytes = ysize - (width*group_size);
- s = dataout;
- t = (const char *)datain;
-
- /* Piece o' cake! */
- for (i = 0; i < newheight; i++) {
- for (j = 0; j < newwidth; j++) {
- for (k = 0; k < components; k++) {
- s[0] = (*(const GLbyte*)t +
- *(const GLbyte*)(t+group_size) +
- *(const GLbyte*)(t+ysize) +
- *(const GLbyte*)(t+ysize+group_size) + 2) / 4;
- s++; t += element_size;
- }
- t += group_size;
- }
- t += padBytes;
- t += ysize;
- }
-}
-
-static void halve1Dimage_byte(GLint components, GLuint width, GLuint height,
- const GLbyte *dataIn, GLbyte *dataOut,
- GLint element_size,GLint ysize, GLint group_size)
-{
- GLint halfWidth= width / 2;
- GLint halfHeight= height / 2;
- const char *src= (const char *) dataIn;
- GLbyte *dest= dataOut;
- int jj;
-
- assert(width == 1 || height == 1); /* must be 1D */
- assert(width != height); /* can't be square */
-
- if (height == 1) { /* 1 row */
- assert(width != 1); /* widthxheight can't be 1x1 */
- halfHeight= 1;
-
- for (jj= 0; jj< halfWidth; jj++) {
- int kk;
- for (kk= 0; kk< components; kk++) {
- *dest= (*(const GLbyte*)src + *(const GLbyte*)(src+group_size)) / 2;
-
- src+= element_size;
- dest++;
- }
- src+= group_size; /* skip to next 2 */
- }
- {
- int padBytes= ysize - (width*group_size);
- src+= padBytes; /* for assertion only */
- }
- }
- else if (width == 1) { /* 1 column */
- int padBytes= ysize - (width * group_size);
- assert(height != 1); /* widthxheight can't be 1x1 */
- halfWidth= 1;
- /* one vertical column with possible pad bytes per row */
- /* average two at a time */
-
- for (jj= 0; jj< halfHeight; jj++) {
- int kk;
- for (kk= 0; kk< components; kk++) {
- *dest= (*(const GLbyte*)src + *(const GLbyte*)(src+ysize)) / 2;
-
- src+= element_size;
- dest++;
- }
- src+= padBytes; /* add pad bytes, if any, to get to end to row */
- src+= ysize;
- }
-
- assert(src == &((const char *)dataIn)[ysize*height]);
- }
-
- assert((char *)dest == &((char *)dataOut)
- [components * element_size * halfWidth * halfHeight]);
-} /* halve1Dimage_byte() */
-
-static void halveImage_ushort(GLint components, GLuint width, GLuint height,
- const GLushort *datain, GLushort *dataout,
- GLint element_size, GLint ysize, GLint group_size,
- GLint myswap_bytes)
-{
- int i, j, k;
- int newwidth, newheight;
- int padBytes;
- GLushort *s;
- const char *t;
-
- /* handle case where there is only 1 column/row */
- if (width == 1 || height == 1) {
- assert( !(width == 1 && height == 1) ); /* can't be 1x1 */
- halve1Dimage_ushort(components,width,height,datain,dataout,
- element_size,ysize,group_size, myswap_bytes);
- return;
- }
-
- newwidth = width / 2;
- newheight = height / 2;
- padBytes = ysize - (width*group_size);
- s = dataout;
- t = (const char *)datain;
-
- /* Piece o' cake! */
- if (!myswap_bytes)
- for (i = 0; i < newheight; i++) {
- for (j = 0; j < newwidth; j++) {
- for (k = 0; k < components; k++) {
- s[0] = (*(const GLushort*)t +
- *(const GLushort*)(t+group_size) +
- *(const GLushort*)(t+ysize) +
- *(const GLushort*)(t+ysize+group_size) + 2) / 4;
- s++; t += element_size;
- }
- t += group_size;
- }
- t += padBytes;
- t += ysize;
- }
- else
- for (i = 0; i < newheight; i++) {
- for (j = 0; j < newwidth; j++) {
- for (k = 0; k < components; k++) {
- s[0] = (__GLU_SWAP_2_BYTES(t) +
- __GLU_SWAP_2_BYTES(t+group_size) +
- __GLU_SWAP_2_BYTES(t+ysize) +
- __GLU_SWAP_2_BYTES(t+ysize+group_size)+ 2)/4;
- s++; t += element_size;
- }
- t += group_size;
- }
- t += padBytes;
- t += ysize;
- }
-}
-
-static void halve1Dimage_ushort(GLint components, GLuint width, GLuint height,
- const GLushort *dataIn, GLushort *dataOut,
- GLint element_size, GLint ysize,
- GLint group_size, GLint myswap_bytes)
-{
- GLint halfWidth= width / 2;
- GLint halfHeight= height / 2;
- const char *src= (const char *) dataIn;
- GLushort *dest= dataOut;
- int jj;
-
- assert(width == 1 || height == 1); /* must be 1D */
- assert(width != height); /* can't be square */
-
- if (height == 1) { /* 1 row */
- assert(width != 1); /* widthxheight can't be 1x1 */
- halfHeight= 1;
-
- for (jj= 0; jj< halfWidth; jj++) {
- int kk;
- for (kk= 0; kk< components; kk++) {
-#define BOX2 2
- GLushort ushort[BOX2];
- if (myswap_bytes) {
- ushort[0]= __GLU_SWAP_2_BYTES(src);
- ushort[1]= __GLU_SWAP_2_BYTES(src+group_size);
- }
- else {
- ushort[0]= *(const GLushort*)src;
- ushort[1]= *(const GLushort*)(src+group_size);
- }
-
- *dest= (ushort[0] + ushort[1]) / 2;
- src+= element_size;
- dest++;
- }
- src+= group_size; /* skip to next 2 */
- }
- {
- int padBytes= ysize - (width*group_size);
- src+= padBytes; /* for assertion only */
- }
- }
- else if (width == 1) { /* 1 column */
- int padBytes= ysize - (width * group_size);
- assert(height != 1); /* widthxheight can't be 1x1 */
- halfWidth= 1;
- /* one vertical column with possible pad bytes per row */
- /* average two at a time */
-
- for (jj= 0; jj< halfHeight; jj++) {
- int kk;
- for (kk= 0; kk< components; kk++) {
-#define BOX2 2
- GLushort ushort[BOX2];
- if (myswap_bytes) {
- ushort[0]= __GLU_SWAP_2_BYTES(src);
- ushort[1]= __GLU_SWAP_2_BYTES(src+ysize);
- }
- else {
- ushort[0]= *(const GLushort*)src;
- ushort[1]= *(const GLushort*)(src+ysize);
- }
- *dest= (ushort[0] + ushort[1]) / 2;
-
- src+= element_size;
- dest++;
- }
- src+= padBytes; /* add pad bytes, if any, to get to end to row */
- src+= ysize;
- }
-
- assert(src == &((const char *)dataIn)[ysize*height]);
- }
-
- assert((char *)dest == &((char *)dataOut)
- [components * element_size * halfWidth * halfHeight]);
-
-} /* halve1Dimage_ushort() */
-
-
-static void halveImage_short(GLint components, GLuint width, GLuint height,
- const GLshort *datain, GLshort *dataout,
- GLint element_size, GLint ysize, GLint group_size,
- GLint myswap_bytes)
-{
- int i, j, k;
- int newwidth, newheight;
- int padBytes;
- GLshort *s;
- const char *t;
-
- /* handle case where there is only 1 column/row */
- if (width == 1 || height == 1) {
- assert( !(width == 1 && height == 1) ); /* can't be 1x1 */
- halve1Dimage_short(components,width,height,datain,dataout,
- element_size,ysize,group_size, myswap_bytes);
- return;
- }
-
- newwidth = width / 2;
- newheight = height / 2;
- padBytes = ysize - (width*group_size);
- s = dataout;
- t = (const char *)datain;
-
- /* Piece o' cake! */
- if (!myswap_bytes)
- for (i = 0; i < newheight; i++) {
- for (j = 0; j < newwidth; j++) {
- for (k = 0; k < components; k++) {
- s[0] = (*(const GLshort*)t +
- *(const GLshort*)(t+group_size) +
- *(const GLshort*)(t+ysize) +
- *(const GLshort*)(t+ysize+group_size) + 2) / 4;
- s++; t += element_size;
- }
- t += group_size;
- }
- t += padBytes;
- t += ysize;
- }
- else
- for (i = 0; i < newheight; i++) {
- for (j = 0; j < newwidth; j++) {
- for (k = 0; k < components; k++) {
- GLushort b;
- GLint buf;
- b = __GLU_SWAP_2_BYTES(t);
- buf = *(const GLshort*)&b;
- b = __GLU_SWAP_2_BYTES(t+group_size);
- buf += *(const GLshort*)&b;
- b = __GLU_SWAP_2_BYTES(t+ysize);
- buf += *(const GLshort*)&b;
- b = __GLU_SWAP_2_BYTES(t+ysize+group_size);
- buf += *(const GLshort*)&b;
- s[0] = (GLshort)((buf+2)/4);
- s++; t += element_size;
- }
- t += group_size;
- }
- t += padBytes;
- t += ysize;
- }
-}
-
-static void halve1Dimage_short(GLint components, GLuint width, GLuint height,
- const GLshort *dataIn, GLshort *dataOut,
- GLint element_size, GLint ysize,
- GLint group_size, GLint myswap_bytes)
-{
- GLint halfWidth= width / 2;
- GLint halfHeight= height / 2;
- const char *src= (const char *) dataIn;
- GLshort *dest= dataOut;
- int jj;
-
- assert(width == 1 || height == 1); /* must be 1D */
- assert(width != height); /* can't be square */
-
- if (height == 1) { /* 1 row */
- assert(width != 1); /* widthxheight can't be 1x1 */
- halfHeight= 1;
-
- for (jj= 0; jj< halfWidth; jj++) {
- int kk;
- for (kk= 0; kk< components; kk++) {
-#define BOX2 2
- GLshort sshort[BOX2];
- if (myswap_bytes) {
- sshort[0]= __GLU_SWAP_2_BYTES(src);
- sshort[1]= __GLU_SWAP_2_BYTES(src+group_size);
- }
- else {
- sshort[0]= *(const GLshort*)src;
- sshort[1]= *(const GLshort*)(src+group_size);
- }
-
- *dest= (sshort[0] + sshort[1]) / 2;
- src+= element_size;
- dest++;
- }
- src+= group_size; /* skip to next 2 */
- }
- {
- int padBytes= ysize - (width*group_size);
- src+= padBytes; /* for assertion only */
- }
- }
- else if (width == 1) { /* 1 column */
- int padBytes= ysize - (width * group_size);
- assert(height != 1); /* widthxheight can't be 1x1 */
- halfWidth= 1;
- /* one vertical column with possible pad bytes per row */
- /* average two at a time */
-
- for (jj= 0; jj< halfHeight; jj++) {
- int kk;
- for (kk= 0; kk< components; kk++) {
-#define BOX2 2
- GLshort sshort[BOX2];
- if (myswap_bytes) {
- sshort[0]= __GLU_SWAP_2_BYTES(src);
- sshort[1]= __GLU_SWAP_2_BYTES(src+ysize);
- }
- else {
- sshort[0]= *(const GLshort*)src;
- sshort[1]= *(const GLshort*)(src+ysize);
- }
- *dest= (sshort[0] + sshort[1]) / 2;
-
- src+= element_size;
- dest++;
- }
- src+= padBytes; /* add pad bytes, if any, to get to end to row */
- src+= ysize;
- }
-
- assert(src == &((const char *)dataIn)[ysize*height]);
- }
-
- assert((char *)dest == &((char *)dataOut)
- [components * element_size * halfWidth * halfHeight]);
-
-} /* halve1Dimage_short() */
-
-
-static void halveImage_uint(GLint components, GLuint width, GLuint height,
- const GLuint *datain, GLuint *dataout,
- GLint element_size, GLint ysize, GLint group_size,
- GLint myswap_bytes)
-{
- int i, j, k;
- int newwidth, newheight;
- int padBytes;
- GLuint *s;
- const char *t;
-
- /* handle case where there is only 1 column/row */
- if (width == 1 || height == 1) {
- assert( !(width == 1 && height == 1) ); /* can't be 1x1 */
- halve1Dimage_uint(components,width,height,datain,dataout,
- element_size,ysize,group_size, myswap_bytes);
- return;
- }
-
- newwidth = width / 2;
- newheight = height / 2;
- padBytes = ysize - (width*group_size);
- s = dataout;
- t = (const char *)datain;
-
- /* Piece o' cake! */
- if (!myswap_bytes)
- for (i = 0; i < newheight; i++) {
- for (j = 0; j < newwidth; j++) {
- for (k = 0; k < components; k++) {
- /* need to cast to double to hold large unsigned ints */
- s[0] = ((double)*(const GLuint*)t +
- (double)*(const GLuint*)(t+group_size) +
- (double)*(const GLuint*)(t+ysize) +
- (double)*(const GLuint*)(t+ysize+group_size))/4 + 0.5;
- s++; t += element_size;
-
- }
- t += group_size;
- }
- t += padBytes;
- t += ysize;
- }
- else
- for (i = 0; i < newheight; i++) {
- for (j = 0; j < newwidth; j++) {
- for (k = 0; k < components; k++) {
- /* need to cast to double to hold large unsigned ints */
- GLdouble buf;
- buf = (GLdouble)__GLU_SWAP_4_BYTES(t) +
- (GLdouble)__GLU_SWAP_4_BYTES(t+group_size) +
- (GLdouble)__GLU_SWAP_4_BYTES(t+ysize) +
- (GLdouble)__GLU_SWAP_4_BYTES(t+ysize+group_size);
- s[0] = (GLuint)(buf/4 + 0.5);
-
- s++; t += element_size;
- }
- t += group_size;
- }
- t += padBytes;
- t += ysize;
- }
-}
-
-/* */
-static void halve1Dimage_uint(GLint components, GLuint width, GLuint height,
- const GLuint *dataIn, GLuint *dataOut,
- GLint element_size, GLint ysize,
- GLint group_size, GLint myswap_bytes)
-{
- GLint halfWidth= width / 2;
- GLint halfHeight= height / 2;
- const char *src= (const char *) dataIn;
- GLuint *dest= dataOut;
- int jj;
-
- assert(width == 1 || height == 1); /* must be 1D */
- assert(width != height); /* can't be square */
-
- if (height == 1) { /* 1 row */
- assert(width != 1); /* widthxheight can't be 1x1 */
- halfHeight= 1;
-
- for (jj= 0; jj< halfWidth; jj++) {
- int kk;
- for (kk= 0; kk< components; kk++) {
-#define BOX2 2
- GLuint uint[BOX2];
- if (myswap_bytes) {
- uint[0]= __GLU_SWAP_4_BYTES(src);
- uint[1]= __GLU_SWAP_4_BYTES(src+group_size);
- }
- else {
- uint[0]= *(const GLuint*)src;
- uint[1]= *(const GLuint*)(src+group_size);
- }
- *dest= ((double)uint[0]+(double)uint[1])/2.0;
-
- src+= element_size;
- dest++;
- }
- src+= group_size; /* skip to next 2 */
- }
- {
- int padBytes= ysize - (width*group_size);
- src+= padBytes; /* for assertion only */
- }
- }
- else if (width == 1) { /* 1 column */
- int padBytes= ysize - (width * group_size);
- assert(height != 1); /* widthxheight can't be 1x1 */
- halfWidth= 1;
- /* one vertical column with possible pad bytes per row */
- /* average two at a time */
-
- for (jj= 0; jj< halfHeight; jj++) {
- int kk;
- for (kk= 0; kk< components; kk++) {
-#define BOX2 2
- GLuint uint[BOX2];
- if (myswap_bytes) {
- uint[0]= __GLU_SWAP_4_BYTES(src);
- uint[1]= __GLU_SWAP_4_BYTES(src+ysize);
- }
- else {
- uint[0]= *(const GLuint*)src;
- uint[1]= *(const GLuint*)(src+ysize);
- }
- *dest= ((double)uint[0]+(double)uint[1])/2.0;
-
- src+= element_size;
- dest++;
- }
- src+= padBytes; /* add pad bytes, if any, to get to end to row */
- src+= ysize;
- }
-
- assert(src == &((const char *)dataIn)[ysize*height]);
- }
-
- assert((char *)dest == &((char *)dataOut)
- [components * element_size * halfWidth * halfHeight]);
-
-} /* halve1Dimage_uint() */
-
-static void halveImage_int(GLint components, GLuint width, GLuint height,
- const GLint *datain, GLint *dataout, GLint element_size,
- GLint ysize, GLint group_size, GLint myswap_bytes)
-{
- int i, j, k;
- int newwidth, newheight;
- int padBytes;
- GLint *s;
- const char *t;
-
- /* handle case where there is only 1 column/row */
- if (width == 1 || height == 1) {
- assert( !(width == 1 && height == 1) ); /* can't be 1x1 */
- halve1Dimage_int(components,width,height,datain,dataout,
- element_size,ysize,group_size, myswap_bytes);
- return;
- }
-
- newwidth = width / 2;
- newheight = height / 2;
- padBytes = ysize - (width*group_size);
- s = dataout;
- t = (const char *)datain;
-
- /* Piece o' cake! */
- if (!myswap_bytes)
- for (i = 0; i < newheight; i++) {
- for (j = 0; j < newwidth; j++) {
- for (k = 0; k < components; k++) {
- s[0] = ((float)*(const GLint*)t +
- (float)*(const GLint*)(t+group_size) +
- (float)*(const GLint*)(t+ysize) +
- (float)*(const GLint*)(t+ysize+group_size))/4 + 0.5;
- s++; t += element_size;
- }
- t += group_size;
- }
- t += padBytes;
- t += ysize;
- }
- else
- for (i = 0; i < newheight; i++) {
- for (j = 0; j < newwidth; j++) {
- for (k = 0; k < components; k++) {
- GLuint b;
- GLfloat buf;
- b = __GLU_SWAP_4_BYTES(t);
- buf = *(GLint*)&b;
- b = __GLU_SWAP_4_BYTES(t+group_size);
- buf += *(GLint*)&b;
- b = __GLU_SWAP_4_BYTES(t+ysize);
- buf += *(GLint*)&b;
- b = __GLU_SWAP_4_BYTES(t+ysize+group_size);
- buf += *(GLint*)&b;
- s[0] = (GLint)(buf/4 + 0.5);
-
- s++; t += element_size;
- }
- t += group_size;
- }
- t += padBytes;
- t += ysize;
- }
-}
-
-/* */
-static void halve1Dimage_int(GLint components, GLuint width, GLuint height,
- const GLint *dataIn, GLint *dataOut,
- GLint element_size, GLint ysize,
- GLint group_size, GLint myswap_bytes)
-{
- GLint halfWidth= width / 2;
- GLint halfHeight= height / 2;
- const char *src= (const char *) dataIn;
- GLint *dest= dataOut;
- int jj;
-
- assert(width == 1 || height == 1); /* must be 1D */
- assert(width != height); /* can't be square */
-
- if (height == 1) { /* 1 row */
- assert(width != 1); /* widthxheight can't be 1x1 */
- halfHeight= 1;
-
- for (jj= 0; jj< halfWidth; jj++) {
- int kk;
- for (kk= 0; kk< components; kk++) {
-#define BOX2 2
- GLuint uint[BOX2];
- if (myswap_bytes) {
- uint[0]= __GLU_SWAP_4_BYTES(src);
- uint[1]= __GLU_SWAP_4_BYTES(src+group_size);
- }
- else {
- uint[0]= *(const GLuint*)src;
- uint[1]= *(const GLuint*)(src+group_size);
- }
- *dest= ((float)uint[0]+(float)uint[1])/2.0;
-
- src+= element_size;
- dest++;
- }
- src+= group_size; /* skip to next 2 */
- }
- {
- int padBytes= ysize - (width*group_size);
- src+= padBytes; /* for assertion only */
- }
- }
- else if (width == 1) { /* 1 column */
- int padBytes= ysize - (width * group_size);
- assert(height != 1); /* widthxheight can't be 1x1 */
- halfWidth= 1;
- /* one vertical column with possible pad bytes per row */
- /* average two at a time */
-
- for (jj= 0; jj< halfHeight; jj++) {
- int kk;
- for (kk= 0; kk< components; kk++) {
-#define BOX2 2
- GLuint uint[BOX2];
- if (myswap_bytes) {
- uint[0]= __GLU_SWAP_4_BYTES(src);
- uint[1]= __GLU_SWAP_4_BYTES(src+ysize);
- }
- else {
- uint[0]= *(const GLuint*)src;
- uint[1]= *(const GLuint*)(src+ysize);
- }
- *dest= ((float)uint[0]+(float)uint[1])/2.0;
-
- src+= element_size;
- dest++;
- }
- src+= padBytes; /* add pad bytes, if any, to get to end to row */
- src+= ysize;
- }
-
- assert(src == &((const char *)dataIn)[ysize*height]);
- }
-
- assert((char *)dest == &((char *)dataOut)
- [components * element_size * halfWidth * halfHeight]);
-
-} /* halve1Dimage_int() */
-
-
-static void halveImage_float(GLint components, GLuint width, GLuint height,
- const GLfloat *datain, GLfloat *dataout,
- GLint element_size, GLint ysize, GLint group_size,
- GLint myswap_bytes)
-{
- int i, j, k;
- int newwidth, newheight;
- int padBytes;
- GLfloat *s;
- const char *t;
-
- /* handle case where there is only 1 column/row */
- if (width == 1 || height == 1) {
- assert( !(width == 1 && height == 1) ); /* can't be 1x1 */
- halve1Dimage_float(components,width,height,datain,dataout,
- element_size,ysize,group_size, myswap_bytes);
- return;
- }
-
- newwidth = width / 2;
- newheight = height / 2;
- padBytes = ysize - (width*group_size);
- s = dataout;
- t = (const char *)datain;
-
- /* Piece o' cake! */
- if (!myswap_bytes)
- for (i = 0; i < newheight; i++) {
- for (j = 0; j < newwidth; j++) {
- for (k = 0; k < components; k++) {
- s[0] = (*(const GLfloat*)t +
- *(const GLfloat*)(t+group_size) +
- *(const GLfloat*)(t+ysize) +
- *(const GLfloat*)(t+ysize+group_size)) / 4;
- s++; t += element_size;
- }
- t += group_size;
- }
- t += padBytes;
- t += ysize;
- }
- else
- for (i = 0; i < newheight; i++) {
- for (j = 0; j < newwidth; j++) {
- for (k = 0; k < components; k++) {
- union { GLuint b; GLfloat f; } swapbuf;
- swapbuf.b = __GLU_SWAP_4_BYTES(t);
- s[0] = swapbuf.f;
- swapbuf.b = __GLU_SWAP_4_BYTES(t+group_size);
- s[0] += swapbuf.f;
- swapbuf.b = __GLU_SWAP_4_BYTES(t+ysize);
- s[0] += swapbuf.f;
- swapbuf.b = __GLU_SWAP_4_BYTES(t+ysize+group_size);
- s[0] += swapbuf.f;
- s[0] /= 4;
- s++; t += element_size;
- }
- t += group_size;
- }
- t += padBytes;
- t += ysize;
- }
-}
-
-/* */
-static void halve1Dimage_float(GLint components, GLuint width, GLuint height,
- const GLfloat *dataIn, GLfloat *dataOut,
- GLint element_size, GLint ysize,
- GLint group_size, GLint myswap_bytes)
-{
- GLint halfWidth= width / 2;
- GLint halfHeight= height / 2;
- const char *src= (const char *) dataIn;
- GLfloat *dest= dataOut;
- int jj;
-
- assert(width == 1 || height == 1); /* must be 1D */
- assert(width != height); /* can't be square */
-
- if (height == 1) { /* 1 row */
- assert(width != 1); /* widthxheight can't be 1x1 */
- halfHeight= 1;
-
- for (jj= 0; jj< halfWidth; jj++) {
- int kk;
- for (kk= 0; kk< components; kk++) {
-#define BOX2 2
- GLfloat sfloat[BOX2];
- if (myswap_bytes) {
- sfloat[0]= __GLU_SWAP_4_BYTES(src);
- sfloat[1]= __GLU_SWAP_4_BYTES(src+group_size);
- }
- else {
- sfloat[0]= *(const GLfloat*)src;
- sfloat[1]= *(const GLfloat*)(src+group_size);
- }
-
- *dest= (sfloat[0] + sfloat[1]) / 2.0;
- src+= element_size;
- dest++;
- }
- src+= group_size; /* skip to next 2 */
- }
- {
- int padBytes= ysize - (width*group_size);
- src+= padBytes; /* for assertion only */
- }
- }
- else if (width == 1) { /* 1 column */
- int padBytes= ysize - (width * group_size);
- assert(height != 1); /* widthxheight can't be 1x1 */
- halfWidth= 1;
- /* one vertical column with possible pad bytes per row */
- /* average two at a time */
-
- for (jj= 0; jj< halfHeight; jj++) {
- int kk;
- for (kk= 0; kk< components; kk++) {
-#define BOX2 2
- GLfloat sfloat[BOX2];
- if (myswap_bytes) {
- sfloat[0]= __GLU_SWAP_4_BYTES(src);
- sfloat[1]= __GLU_SWAP_4_BYTES(src+ysize);
- }
- else {
- sfloat[0]= *(const GLfloat*)src;
- sfloat[1]= *(const GLfloat*)(src+ysize);
- }
- *dest= (sfloat[0] + sfloat[1]) / 2.0;
-
- src+= element_size;
- dest++;
- }
- src+= padBytes; /* add pad bytes, if any, to get to end to row */
- src+= ysize; /* skip to odd row */
- }
- }
-
- assert(src == &((const char *)dataIn)[ysize*height]);
- assert((char *)dest == &((char *)dataOut)
- [components * element_size * halfWidth * halfHeight]);
-} /* halve1Dimage_float() */
-
-static void scale_internal(GLint components, GLint widthin, GLint heightin,
- const GLushort *datain,
- GLint widthout, GLint heightout,
- GLushort *dataout)
-{
- float x, lowx, highx, convx, halfconvx;
- float y, lowy, highy, convy, halfconvy;
- float xpercent,ypercent;
- float percent;
- /* Max components in a format is 4, so... */
- float totals[4];
- float area;
- int i,j,k,yint,xint,xindex,yindex;
- int temp;
-
- if (widthin == widthout*2 && heightin == heightout*2) {
- halveImage(components, widthin, heightin, datain, dataout);
- return;
- }
- convy = (float) heightin/heightout;
- convx = (float) widthin/widthout;
- halfconvx = convx/2;
- halfconvy = convy/2;
- for (i = 0; i < heightout; i++) {
- y = convy * (i+0.5);
- if (heightin > heightout) {
- highy = y + halfconvy;
- lowy = y - halfconvy;
- } else {
- highy = y + 0.5;
- lowy = y - 0.5;
- }
- for (j = 0; j < widthout; j++) {
- x = convx * (j+0.5);
- if (widthin > widthout) {
- highx = x + halfconvx;
- lowx = x - halfconvx;
- } else {
- highx = x + 0.5;
- lowx = x - 0.5;
- }
-
- /*
- ** Ok, now apply box filter to box that goes from (lowx, lowy)
- ** to (highx, highy) on input data into this pixel on output
- ** data.
- */
- totals[0] = totals[1] = totals[2] = totals[3] = 0.0;
- area = 0.0;
-
- y = lowy;
- yint = floor(y);
- while (y < highy) {
- yindex = (yint + heightin) % heightin;
- if (highy < yint+1) {
- ypercent = highy - y;
- } else {
- ypercent = yint+1 - y;
- }
-
- x = lowx;
- xint = floor(x);
-
- while (x < highx) {
- xindex = (xint + widthin) % widthin;
- if (highx < xint+1) {
- xpercent = highx - x;
- } else {
- xpercent = xint+1 - x;
- }
-
- percent = xpercent * ypercent;
- area += percent;
- temp = (xindex + (yindex * widthin)) * components;
- for (k = 0; k < components; k++) {
- totals[k] += datain[temp + k] * percent;
- }
-
- xint++;
- x = xint;
- }
- yint++;
- y = yint;
- }
-
- temp = (j + (i * widthout)) * components;
- for (k = 0; k < components; k++) {
- /* totals[] should be rounded in the case of enlarging an RGB
- * ramp when the type is 332 or 4444
- */
- dataout[temp + k] = (totals[k]+0.5)/area;
- }
- }
- }
-}
-
-static void scale_internal_ubyte(GLint components, GLint widthin,
- GLint heightin, const GLubyte *datain,
- GLint widthout, GLint heightout,
- GLubyte *dataout, GLint element_size,
- GLint ysize, GLint group_size)
-{
- float convx;
- float convy;
- float percent;
- /* Max components in a format is 4, so... */
- float totals[4];
- float area;
- int i,j,k,xindex;
-
- const char *temp, *temp0;
- const char *temp_index;
- int outindex;
-
- int lowx_int, highx_int, lowy_int, highy_int;
- float x_percent, y_percent;
- float lowx_float, highx_float, lowy_float, highy_float;
- float convy_float, convx_float;
- int convy_int, convx_int;
- int l, m;
- const char *left, *right;
-
- if (widthin == widthout*2 && heightin == heightout*2) {
- halveImage_ubyte(components, widthin, heightin,
- (const GLubyte *)datain, (GLubyte *)dataout,
- element_size, ysize, group_size);
- return;
- }
- convy = (float) heightin/heightout;
- convx = (float) widthin/widthout;
- convy_int = floor(convy);
- convy_float = convy - convy_int;
- convx_int = floor(convx);
- convx_float = convx - convx_int;
-
- area = convx * convy;
-
- lowy_int = 0;
- lowy_float = 0;
- highy_int = convy_int;
- highy_float = convy_float;
-
- for (i = 0; i < heightout; i++) {
- /* Clamp here to be sure we don't read beyond input buffer. */
- if (highy_int >= heightin)
- highy_int = heightin - 1;
- lowx_int = 0;
- lowx_float = 0;
- highx_int = convx_int;
- highx_float = convx_float;
-
- for (j = 0; j < widthout; j++) {
-
- /*
- ** Ok, now apply box filter to box that goes from (lowx, lowy)
- ** to (highx, highy) on input data into this pixel on output
- ** data.
- */
- totals[0] = totals[1] = totals[2] = totals[3] = 0.0;
-
- /* calculate the value for pixels in the 1st row */
- xindex = lowx_int*group_size;
- if((highy_int>lowy_int) && (highx_int>lowx_int)) {
-
- y_percent = 1-lowy_float;
- temp = (const char *)datain + xindex + lowy_int * ysize;
- percent = y_percent * (1-lowx_float);
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- totals[k] += (GLubyte)(*(temp_index)) * percent;
- }
- left = temp;
- for(l = lowx_int+1; l < highx_int; l++) {
- temp += group_size;
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- totals[k] += (GLubyte)(*(temp_index)) * y_percent;
- }
- }
- temp += group_size;
- right = temp;
- percent = y_percent * highx_float;
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- totals[k] += (GLubyte)(*(temp_index)) * percent;
- }
-
- /* calculate the value for pixels in the last row */
- y_percent = highy_float;
- percent = y_percent * (1-lowx_float);
- temp = (const char *)datain + xindex + highy_int * ysize;
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- totals[k] += (GLubyte)(*(temp_index)) * percent;
- }
- for(l = lowx_int+1; l < highx_int; l++) {
- temp += group_size;
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- totals[k] += (GLubyte)(*(temp_index)) * y_percent;
- }
- }
- temp += group_size;
- percent = y_percent * highx_float;
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- totals[k] += (GLubyte)(*(temp_index)) * percent;
- }
-
-
- /* calculate the value for pixels in the 1st and last column */
- for(m = lowy_int+1; m < highy_int; m++) {
- left += ysize;
- right += ysize;
- for (k = 0; k < components;
- k++, left += element_size, right += element_size) {
- totals[k] += (GLubyte)(*(left))*(1-lowx_float)
- +(GLubyte)(*(right))*highx_float;
- }
- }
- } else if (highy_int > lowy_int) {
- x_percent = highx_float - lowx_float;
- percent = (1-lowy_float)*x_percent;
- temp = (const char *)datain + xindex + lowy_int*ysize;
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- totals[k] += (GLubyte)(*(temp_index)) * percent;
- }
- for(m = lowy_int+1; m < highy_int; m++) {
- temp += ysize;
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- totals[k] += (GLubyte)(*(temp_index)) * x_percent;
- }
- }
- percent = x_percent * highy_float;
- temp += ysize;
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- totals[k] += (GLubyte)(*(temp_index)) * percent;
- }
- } else if (highx_int > lowx_int) {
- y_percent = highy_float - lowy_float;
- percent = (1-lowx_float)*y_percent;
- temp = (const char *)datain + xindex + lowy_int*ysize;
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- totals[k] += (GLubyte)(*(temp_index)) * percent;
- }
- for (l = lowx_int+1; l < highx_int; l++) {
- temp += group_size;
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- totals[k] += (GLubyte)(*(temp_index)) * y_percent;
- }
- }
- temp += group_size;
- percent = y_percent * highx_float;
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- totals[k] += (GLubyte)(*(temp_index)) * percent;
- }
- } else {
- percent = (highy_float-lowy_float)*(highx_float-lowx_float);
- temp = (const char *)datain + xindex + lowy_int * ysize;
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- totals[k] += (GLubyte)(*(temp_index)) * percent;
- }
- }
-
-
-
- /* this is for the pixels in the body */
- temp0 = (const char *)datain + xindex + group_size +
- (lowy_int+1)*ysize;
- for (m = lowy_int+1; m < highy_int; m++) {
- temp = temp0;
- for(l = lowx_int+1; l < highx_int; l++) {
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- totals[k] += (GLubyte)(*(temp_index));
- }
- temp += group_size;
- }
- temp0 += ysize;
- }
-
- outindex = (j + (i * widthout)) * components;
- for (k = 0; k < components; k++) {
- dataout[outindex + k] = totals[k]/area;
- /*printf("totals[%d] = %f\n", k, totals[k]);*/
- }
- lowx_int = highx_int;
- lowx_float = highx_float;
- highx_int += convx_int;
- highx_float += convx_float;
- if(highx_float > 1) {
- highx_float -= 1.0;
- highx_int++;
- }
- }
- lowy_int = highy_int;
- lowy_float = highy_float;
- highy_int += convy_int;
- highy_float += convy_float;
- if(highy_float > 1) {
- highy_float -= 1.0;
- highy_int++;
- }
- }
-}
-
-static void scale_internal_byte(GLint components, GLint widthin,
- GLint heightin, const GLbyte *datain,
- GLint widthout, GLint heightout,
- GLbyte *dataout, GLint element_size,
- GLint ysize, GLint group_size)
-{
- float convx;
- float convy;
- float percent;
- /* Max components in a format is 4, so... */
- float totals[4];
- float area;
- int i,j,k,xindex;
-
- const char *temp, *temp0;
- const char *temp_index;
- int outindex;
-
- int lowx_int, highx_int, lowy_int, highy_int;
- float x_percent, y_percent;
- float lowx_float, highx_float, lowy_float, highy_float;
- float convy_float, convx_float;
- int convy_int, convx_int;
- int l, m;
- const char *left, *right;
-
- if (widthin == widthout*2 && heightin == heightout*2) {
- halveImage_byte(components, widthin, heightin,
- (const GLbyte *)datain, (GLbyte *)dataout,
- element_size, ysize, group_size);
- return;
- }
- convy = (float) heightin/heightout;
- convx = (float) widthin/widthout;
- convy_int = floor(convy);
- convy_float = convy - convy_int;
- convx_int = floor(convx);
- convx_float = convx - convx_int;
-
- area = convx * convy;
-
- lowy_int = 0;
- lowy_float = 0;
- highy_int = convy_int;
- highy_float = convy_float;
-
- for (i = 0; i < heightout; i++) {
- /* Clamp here to be sure we don't read beyond input buffer. */
- if (highy_int >= heightin)
- highy_int = heightin - 1;
- lowx_int = 0;
- lowx_float = 0;
- highx_int = convx_int;
- highx_float = convx_float;
-
- for (j = 0; j < widthout; j++) {
-
- /*
- ** Ok, now apply box filter to box that goes from (lowx, lowy)
- ** to (highx, highy) on input data into this pixel on output
- ** data.
- */
- totals[0] = totals[1] = totals[2] = totals[3] = 0.0;
-
- /* calculate the value for pixels in the 1st row */
- xindex = lowx_int*group_size;
- if((highy_int>lowy_int) && (highx_int>lowx_int)) {
-
- y_percent = 1-lowy_float;
- temp = (const char *)datain + xindex + lowy_int * ysize;
- percent = y_percent * (1-lowx_float);
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- totals[k] += (GLbyte)(*(temp_index)) * percent;
- }
- left = temp;
- for(l = lowx_int+1; l < highx_int; l++) {
- temp += group_size;
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- totals[k] += (GLbyte)(*(temp_index)) * y_percent;
- }
- }
- temp += group_size;
- right = temp;
- percent = y_percent * highx_float;
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- totals[k] += (GLbyte)(*(temp_index)) * percent;
- }
-
- /* calculate the value for pixels in the last row */
- y_percent = highy_float;
- percent = y_percent * (1-lowx_float);
- temp = (const char *)datain + xindex + highy_int * ysize;
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- totals[k] += (GLbyte)(*(temp_index)) * percent;
- }
- for(l = lowx_int+1; l < highx_int; l++) {
- temp += group_size;
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- totals[k] += (GLbyte)(*(temp_index)) * y_percent;
- }
- }
- temp += group_size;
- percent = y_percent * highx_float;
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- totals[k] += (GLbyte)(*(temp_index)) * percent;
- }
-
-
- /* calculate the value for pixels in the 1st and last column */
- for(m = lowy_int+1; m < highy_int; m++) {
- left += ysize;
- right += ysize;
- for (k = 0; k < components;
- k++, left += element_size, right += element_size) {
- totals[k] += (GLbyte)(*(left))*(1-lowx_float)
- +(GLbyte)(*(right))*highx_float;
- }
- }
- } else if (highy_int > lowy_int) {
- x_percent = highx_float - lowx_float;
- percent = (1-lowy_float)*x_percent;
- temp = (const char *)datain + xindex + lowy_int*ysize;
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- totals[k] += (GLbyte)(*(temp_index)) * percent;
- }
- for(m = lowy_int+1; m < highy_int; m++) {
- temp += ysize;
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- totals[k] += (GLbyte)(*(temp_index)) * x_percent;
- }
- }
- percent = x_percent * highy_float;
- temp += ysize;
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- totals[k] += (GLbyte)(*(temp_index)) * percent;
- }
- } else if (highx_int > lowx_int) {
- y_percent = highy_float - lowy_float;
- percent = (1-lowx_float)*y_percent;
- temp = (const char *)datain + xindex + lowy_int*ysize;
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- totals[k] += (GLbyte)(*(temp_index)) * percent;
- }
- for (l = lowx_int+1; l < highx_int; l++) {
- temp += group_size;
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- totals[k] += (GLbyte)(*(temp_index)) * y_percent;
- }
- }
- temp += group_size;
- percent = y_percent * highx_float;
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- totals[k] += (GLbyte)(*(temp_index)) * percent;
- }
- } else {
- percent = (highy_float-lowy_float)*(highx_float-lowx_float);
- temp = (const char *)datain + xindex + lowy_int * ysize;
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- totals[k] += (GLbyte)(*(temp_index)) * percent;
- }
- }
-
-
-
- /* this is for the pixels in the body */
- temp0 = (const char *)datain + xindex + group_size +
- (lowy_int+1)*ysize;
- for (m = lowy_int+1; m < highy_int; m++) {
- temp = temp0;
- for(l = lowx_int+1; l < highx_int; l++) {
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- totals[k] += (GLbyte)(*(temp_index));
- }
- temp += group_size;
- }
- temp0 += ysize;
- }
-
- outindex = (j + (i * widthout)) * components;
- for (k = 0; k < components; k++) {
- dataout[outindex + k] = totals[k]/area;
- /*printf("totals[%d] = %f\n", k, totals[k]);*/
- }
- lowx_int = highx_int;
- lowx_float = highx_float;
- highx_int += convx_int;
- highx_float += convx_float;
- if(highx_float > 1) {
- highx_float -= 1.0;
- highx_int++;
- }
- }
- lowy_int = highy_int;
- lowy_float = highy_float;
- highy_int += convy_int;
- highy_float += convy_float;
- if(highy_float > 1) {
- highy_float -= 1.0;
- highy_int++;
- }
- }
-}
-
-static void scale_internal_ushort(GLint components, GLint widthin,
- GLint heightin, const GLushort *datain,
- GLint widthout, GLint heightout,
- GLushort *dataout, GLint element_size,
- GLint ysize, GLint group_size,
- GLint myswap_bytes)
-{
- float convx;
- float convy;
- float percent;
- /* Max components in a format is 4, so... */
- float totals[4];
- float area;
- int i,j,k,xindex;
-
- const char *temp, *temp0;
- const char *temp_index;
- int outindex;
-
- int lowx_int, highx_int, lowy_int, highy_int;
- float x_percent, y_percent;
- float lowx_float, highx_float, lowy_float, highy_float;
- float convy_float, convx_float;
- int convy_int, convx_int;
- int l, m;
- const char *left, *right;
-
- if (widthin == widthout*2 && heightin == heightout*2) {
- halveImage_ushort(components, widthin, heightin,
- (const GLushort *)datain, (GLushort *)dataout,
- element_size, ysize, group_size, myswap_bytes);
- return;
- }
- convy = (float) heightin/heightout;
- convx = (float) widthin/widthout;
- convy_int = floor(convy);
- convy_float = convy - convy_int;
- convx_int = floor(convx);
- convx_float = convx - convx_int;
-
- area = convx * convy;
-
- lowy_int = 0;
- lowy_float = 0;
- highy_int = convy_int;
- highy_float = convy_float;
-
- for (i = 0; i < heightout; i++) {
- /* Clamp here to be sure we don't read beyond input buffer. */
- if (highy_int >= heightin)
- highy_int = heightin - 1;
- lowx_int = 0;
- lowx_float = 0;
- highx_int = convx_int;
- highx_float = convx_float;
-
- for (j = 0; j < widthout; j++) {
- /*
- ** Ok, now apply box filter to box that goes from (lowx, lowy)
- ** to (highx, highy) on input data into this pixel on output
- ** data.
- */
- totals[0] = totals[1] = totals[2] = totals[3] = 0.0;
-
- /* calculate the value for pixels in the 1st row */
- xindex = lowx_int*group_size;
- if((highy_int>lowy_int) && (highx_int>lowx_int)) {
-
- y_percent = 1-lowy_float;
- temp = (const char *)datain + xindex + lowy_int * ysize;
- percent = y_percent * (1-lowx_float);
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- if (myswap_bytes) {
- totals[k] += __GLU_SWAP_2_BYTES(temp_index) * percent;
- } else {
- totals[k] += *(const GLushort*)temp_index * percent;
- }
- }
- left = temp;
- for(l = lowx_int+1; l < highx_int; l++) {
- temp += group_size;
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- if (myswap_bytes) {
- totals[k] +=
- __GLU_SWAP_2_BYTES(temp_index) * y_percent;
- } else {
- totals[k] += *(const GLushort*)temp_index * y_percent;
- }
- }
- }
- temp += group_size;
- right = temp;
- percent = y_percent * highx_float;
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- if (myswap_bytes) {
- totals[k] += __GLU_SWAP_2_BYTES(temp_index) * percent;
- } else {
- totals[k] += *(const GLushort*)temp_index * percent;
- }
- }
-
- /* calculate the value for pixels in the last row */
- y_percent = highy_float;
- percent = y_percent * (1-lowx_float);
- temp = (const char *)datain + xindex + highy_int * ysize;
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- if (myswap_bytes) {
- totals[k] += __GLU_SWAP_2_BYTES(temp_index) * percent;
- } else {
- totals[k] += *(const GLushort*)temp_index * percent;
- }
- }
- for(l = lowx_int+1; l < highx_int; l++) {
- temp += group_size;
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- if (myswap_bytes) {
- totals[k] +=
- __GLU_SWAP_2_BYTES(temp_index) * y_percent;
- } else {
- totals[k] += *(const GLushort*)temp_index * y_percent;
- }
- }
- }
- temp += group_size;
- percent = y_percent * highx_float;
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- if (myswap_bytes) {
- totals[k] += __GLU_SWAP_2_BYTES(temp_index) * percent;
- } else {
- totals[k] += *(const GLushort*)temp_index * percent;
- }
- }
-
- /* calculate the value for pixels in the 1st and last column */
- for(m = lowy_int+1; m < highy_int; m++) {
- left += ysize;
- right += ysize;
- for (k = 0; k < components;
- k++, left += element_size, right += element_size) {
- if (myswap_bytes) {
- totals[k] +=
- __GLU_SWAP_2_BYTES(left) * (1-lowx_float) +
- __GLU_SWAP_2_BYTES(right) * highx_float;
- } else {
- totals[k] += *(const GLushort*)left * (1-lowx_float)
- + *(const GLushort*)right * highx_float;
- }
- }
- }
- } else if (highy_int > lowy_int) {
- x_percent = highx_float - lowx_float;
- percent = (1-lowy_float)*x_percent;
- temp = (const char *)datain + xindex + lowy_int*ysize;
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- if (myswap_bytes) {
- totals[k] += __GLU_SWAP_2_BYTES(temp_index) * percent;
- } else {
- totals[k] += *(const GLushort*)temp_index * percent;
- }
- }
- for(m = lowy_int+1; m < highy_int; m++) {
- temp += ysize;
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- if (myswap_bytes) {
- totals[k] +=
- __GLU_SWAP_2_BYTES(temp_index) * x_percent;
- } else {
- totals[k] += *(const GLushort*)temp_index * x_percent;
- }
- }
- }
- percent = x_percent * highy_float;
- temp += ysize;
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- if (myswap_bytes) {
- totals[k] += __GLU_SWAP_2_BYTES(temp_index) * percent;
- } else {
- totals[k] += *(const GLushort*)temp_index * percent;
- }
- }
- } else if (highx_int > lowx_int) {
- y_percent = highy_float - lowy_float;
- percent = (1-lowx_float)*y_percent;
- temp = (const char *)datain + xindex + lowy_int*ysize;
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- if (myswap_bytes) {
- totals[k] += __GLU_SWAP_2_BYTES(temp_index) * percent;
- } else {
- totals[k] += *(const GLushort*)temp_index * percent;
- }
- }
- for (l = lowx_int+1; l < highx_int; l++) {
- temp += group_size;
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- if (myswap_bytes) {
- totals[k] +=
- __GLU_SWAP_2_BYTES(temp_index) * y_percent;
- } else {
- totals[k] += *(const GLushort*)temp_index * y_percent;
- }
- }
- }
- temp += group_size;
- percent = y_percent * highx_float;
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- if (myswap_bytes) {
- totals[k] += __GLU_SWAP_2_BYTES(temp_index) * percent;
- } else {
- totals[k] += *(const GLushort*)temp_index * percent;
- }
- }
- } else {
- percent = (highy_float-lowy_float)*(highx_float-lowx_float);
- temp = (const char *)datain + xindex + lowy_int * ysize;
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- if (myswap_bytes) {
- totals[k] += __GLU_SWAP_2_BYTES(temp_index) * percent;
- } else {
- totals[k] += *(const GLushort*)temp_index * percent;
- }
- }
- }
-
- /* this is for the pixels in the body */
- temp0 = (const char *)datain + xindex + group_size +
- (lowy_int+1)*ysize;
- for (m = lowy_int+1; m < highy_int; m++) {
- temp = temp0;
- for(l = lowx_int+1; l < highx_int; l++) {
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- if (myswap_bytes) {
- totals[k] += __GLU_SWAP_2_BYTES(temp_index);
- } else {
- totals[k] += *(const GLushort*)temp_index;
- }
- }
- temp += group_size;
- }
- temp0 += ysize;
- }
-
- outindex = (j + (i * widthout)) * components;
- for (k = 0; k < components; k++) {
- dataout[outindex + k] = totals[k]/area;
- /*printf("totals[%d] = %f\n", k, totals[k]);*/
- }
- lowx_int = highx_int;
- lowx_float = highx_float;
- highx_int += convx_int;
- highx_float += convx_float;
- if(highx_float > 1) {
- highx_float -= 1.0;
- highx_int++;
- }
- }
- lowy_int = highy_int;
- lowy_float = highy_float;
- highy_int += convy_int;
- highy_float += convy_float;
- if(highy_float > 1) {
- highy_float -= 1.0;
- highy_int++;
- }
- }
-}
-
-static void scale_internal_short(GLint components, GLint widthin,
- GLint heightin, const GLshort *datain,
- GLint widthout, GLint heightout,
- GLshort *dataout, GLint element_size,
- GLint ysize, GLint group_size,
- GLint myswap_bytes)
-{
- float convx;
- float convy;
- float percent;
- /* Max components in a format is 4, so... */
- float totals[4];
- float area;
- int i,j,k,xindex;
-
- const char *temp, *temp0;
- const char *temp_index;
- int outindex;
-
- int lowx_int, highx_int, lowy_int, highy_int;
- float x_percent, y_percent;
- float lowx_float, highx_float, lowy_float, highy_float;
- float convy_float, convx_float;
- int convy_int, convx_int;
- int l, m;
- const char *left, *right;
-
- GLushort swapbuf; /* unsigned buffer */
-
- if (widthin == widthout*2 && heightin == heightout*2) {
- halveImage_short(components, widthin, heightin,
- (const GLshort *)datain, (GLshort *)dataout,
- element_size, ysize, group_size, myswap_bytes);
- return;
- }
- convy = (float) heightin/heightout;
- convx = (float) widthin/widthout;
- convy_int = floor(convy);
- convy_float = convy - convy_int;
- convx_int = floor(convx);
- convx_float = convx - convx_int;
-
- area = convx * convy;
-
- lowy_int = 0;
- lowy_float = 0;
- highy_int = convy_int;
- highy_float = convy_float;
-
- for (i = 0; i < heightout; i++) {
- /* Clamp here to be sure we don't read beyond input buffer. */
- if (highy_int >= heightin)
- highy_int = heightin - 1;
- lowx_int = 0;
- lowx_float = 0;
- highx_int = convx_int;
- highx_float = convx_float;
-
- for (j = 0; j < widthout; j++) {
- /*
- ** Ok, now apply box filter to box that goes from (lowx, lowy)
- ** to (highx, highy) on input data into this pixel on output
- ** data.
- */
- totals[0] = totals[1] = totals[2] = totals[3] = 0.0;
-
- /* calculate the value for pixels in the 1st row */
- xindex = lowx_int*group_size;
- if((highy_int>lowy_int) && (highx_int>lowx_int)) {
-
- y_percent = 1-lowy_float;
- temp = (const char *)datain + xindex + lowy_int * ysize;
- percent = y_percent * (1-lowx_float);
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- if (myswap_bytes) {
- swapbuf = __GLU_SWAP_2_BYTES(temp_index);
- totals[k] += *(const GLshort*)&swapbuf * percent;
- } else {
- totals[k] += *(const GLshort*)temp_index * percent;
- }
- }
- left = temp;
- for(l = lowx_int+1; l < highx_int; l++) {
- temp += group_size;
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- if (myswap_bytes) {
- swapbuf = __GLU_SWAP_2_BYTES(temp_index);
- totals[k] += *(const GLshort*)&swapbuf * y_percent;
- } else {
- totals[k] += *(const GLshort*)temp_index * y_percent;
- }
- }
- }
- temp += group_size;
- right = temp;
- percent = y_percent * highx_float;
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- if (myswap_bytes) {
- swapbuf = __GLU_SWAP_2_BYTES(temp_index);
- totals[k] += *(const GLshort*)&swapbuf * percent;
- } else {
- totals[k] += *(const GLshort*)temp_index * percent;
- }
- }
-
- /* calculate the value for pixels in the last row */
- y_percent = highy_float;
- percent = y_percent * (1-lowx_float);
- temp = (const char *)datain + xindex + highy_int * ysize;
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- if (myswap_bytes) {
- swapbuf = __GLU_SWAP_2_BYTES(temp_index);
- totals[k] += *(const GLshort*)&swapbuf * percent;
- } else {
- totals[k] += *(const GLshort*)temp_index * percent;
- }
- }
- for(l = lowx_int+1; l < highx_int; l++) {
- temp += group_size;
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- if (myswap_bytes) {
- swapbuf = __GLU_SWAP_2_BYTES(temp_index);
- totals[k] += *(const GLshort*)&swapbuf * y_percent;
- } else {
- totals[k] += *(const GLshort*)temp_index * y_percent;
- }
- }
- }
- temp += group_size;
- percent = y_percent * highx_float;
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- if (myswap_bytes) {
- swapbuf = __GLU_SWAP_2_BYTES(temp_index);
- totals[k] += *(const GLshort*)&swapbuf * percent;
- } else {
- totals[k] += *(const GLshort*)temp_index * percent;
- }
- }
-
- /* calculate the value for pixels in the 1st and last column */
- for(m = lowy_int+1; m < highy_int; m++) {
- left += ysize;
- right += ysize;
- for (k = 0; k < components;
- k++, left += element_size, right += element_size) {
- if (myswap_bytes) {
- swapbuf = __GLU_SWAP_2_BYTES(left);
- totals[k] += *(const GLshort*)&swapbuf * (1-lowx_float);
- swapbuf = __GLU_SWAP_2_BYTES(right);
- totals[k] += *(const GLshort*)&swapbuf * highx_float;
- } else {
- totals[k] += *(const GLshort*)left * (1-lowx_float)
- + *(const GLshort*)right * highx_float;
- }
- }
- }
- } else if (highy_int > lowy_int) {
- x_percent = highx_float - lowx_float;
- percent = (1-lowy_float)*x_percent;
- temp = (const char *)datain + xindex + lowy_int*ysize;
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- if (myswap_bytes) {
- swapbuf = __GLU_SWAP_2_BYTES(temp_index);
- totals[k] += *(const GLshort*)&swapbuf * percent;
- } else {
- totals[k] += *(const GLshort*)temp_index * percent;
- }
- }
- for(m = lowy_int+1; m < highy_int; m++) {
- temp += ysize;
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- if (myswap_bytes) {
- swapbuf = __GLU_SWAP_2_BYTES(temp_index);
- totals[k] += *(const GLshort*)&swapbuf * x_percent;
- } else {
- totals[k] += *(const GLshort*)temp_index * x_percent;
- }
- }
- }
- percent = x_percent * highy_float;
- temp += ysize;
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- if (myswap_bytes) {
- swapbuf = __GLU_SWAP_2_BYTES(temp_index);
- totals[k] += *(const GLshort*)&swapbuf * percent;
- } else {
- totals[k] += *(const GLshort*)temp_index * percent;
- }
- }
- } else if (highx_int > lowx_int) {
- y_percent = highy_float - lowy_float;
- percent = (1-lowx_float)*y_percent;
-
- temp = (const char *)datain + xindex + lowy_int*ysize;
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- if (myswap_bytes) {
- swapbuf = __GLU_SWAP_2_BYTES(temp_index);
- totals[k] += *(const GLshort*)&swapbuf * percent;
- } else {
- totals[k] += *(const GLshort*)temp_index * percent;
- }
- }
- for (l = lowx_int+1; l < highx_int; l++) {
- temp += group_size;
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- if (myswap_bytes) {
- swapbuf = __GLU_SWAP_2_BYTES(temp_index);
- totals[k] += *(const GLshort*)&swapbuf * y_percent;
- } else {
- totals[k] += *(const GLshort*)temp_index * y_percent;
- }
- }
- }
- temp += group_size;
- percent = y_percent * highx_float;
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- if (myswap_bytes) {
- swapbuf = __GLU_SWAP_2_BYTES(temp_index);
- totals[k] += *(const GLshort*)&swapbuf * percent;
- } else {
- totals[k] += *(const GLshort*)temp_index * percent;
- }
- }
- } else {
- percent = (highy_float-lowy_float)*(highx_float-lowx_float);
- temp = (const char *)datain + xindex + lowy_int * ysize;
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- if (myswap_bytes) {
- swapbuf = __GLU_SWAP_2_BYTES(temp_index);
- totals[k] += *(const GLshort*)&swapbuf * percent;
- } else {
- totals[k] += *(const GLshort*)temp_index * percent;
- }
- }
- }
-
- /* this is for the pixels in the body */
- temp0 = (const char *)datain + xindex + group_size +
- (lowy_int+1)*ysize;
- for (m = lowy_int+1; m < highy_int; m++) {
- temp = temp0;
- for(l = lowx_int+1; l < highx_int; l++) {
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- if (myswap_bytes) {
- swapbuf = __GLU_SWAP_2_BYTES(temp_index);
- totals[k] += *(const GLshort*)&swapbuf;
- } else {
- totals[k] += *(const GLshort*)temp_index;
- }
- }
- temp += group_size;
- }
- temp0 += ysize;
- }
-
- outindex = (j + (i * widthout)) * components;
- for (k = 0; k < components; k++) {
- dataout[outindex + k] = totals[k]/area;
- /*printf("totals[%d] = %f\n", k, totals[k]);*/
- }
- lowx_int = highx_int;
- lowx_float = highx_float;
- highx_int += convx_int;
- highx_float += convx_float;
- if(highx_float > 1) {
- highx_float -= 1.0;
- highx_int++;
- }
- }
- lowy_int = highy_int;
- lowy_float = highy_float;
- highy_int += convy_int;
- highy_float += convy_float;
- if(highy_float > 1) {
- highy_float -= 1.0;
- highy_int++;
- }
- }
-}
-
-static void scale_internal_uint(GLint components, GLint widthin,
- GLint heightin, const GLuint *datain,
- GLint widthout, GLint heightout,
- GLuint *dataout, GLint element_size,
- GLint ysize, GLint group_size,
- GLint myswap_bytes)
-{
- float convx;
- float convy;
- float percent;
- /* Max components in a format is 4, so... */
- float totals[4];
- float area;
- int i,j,k,xindex;
-
- const char *temp, *temp0;
- const char *temp_index;
- int outindex;
-
- int lowx_int, highx_int, lowy_int, highy_int;
- float x_percent, y_percent;
- float lowx_float, highx_float, lowy_float, highy_float;
- float convy_float, convx_float;
- int convy_int, convx_int;
- int l, m;
- const char *left, *right;
-
- if (widthin == widthout*2 && heightin == heightout*2) {
- halveImage_uint(components, widthin, heightin,
- (const GLuint *)datain, (GLuint *)dataout,
- element_size, ysize, group_size, myswap_bytes);
- return;
- }
- convy = (float) heightin/heightout;
- convx = (float) widthin/widthout;
- convy_int = floor(convy);
- convy_float = convy - convy_int;
- convx_int = floor(convx);
- convx_float = convx - convx_int;
-
- area = convx * convy;
-
- lowy_int = 0;
- lowy_float = 0;
- highy_int = convy_int;
- highy_float = convy_float;
-
- for (i = 0; i < heightout; i++) {
- /* Clamp here to be sure we don't read beyond input buffer. */
- if (highy_int >= heightin)
- highy_int = heightin - 1;
- lowx_int = 0;
- lowx_float = 0;
- highx_int = convx_int;
- highx_float = convx_float;
-
- for (j = 0; j < widthout; j++) {
- /*
- ** Ok, now apply box filter to box that goes from (lowx, lowy)
- ** to (highx, highy) on input data into this pixel on output
- ** data.
- */
- totals[0] = totals[1] = totals[2] = totals[3] = 0.0;
-
- /* calculate the value for pixels in the 1st row */
- xindex = lowx_int*group_size;
- if((highy_int>lowy_int) && (highx_int>lowx_int)) {
-
- y_percent = 1-lowy_float;
- temp = (const char *)datain + xindex + lowy_int * ysize;
- percent = y_percent * (1-lowx_float);
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- if (myswap_bytes) {
- totals[k] += __GLU_SWAP_4_BYTES(temp_index) * percent;
- } else {
- totals[k] += *(const GLuint*)temp_index * percent;
- }
- }
- left = temp;
- for(l = lowx_int+1; l < highx_int; l++) {
- temp += group_size;
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- if (myswap_bytes) {
- totals[k] +=
- __GLU_SWAP_4_BYTES(temp_index) * y_percent;
- } else {
- totals[k] += *(const GLuint*)temp_index * y_percent;
- }
- }
- }
- temp += group_size;
- right = temp;
- percent = y_percent * highx_float;
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- if (myswap_bytes) {
- totals[k] += __GLU_SWAP_4_BYTES(temp_index) * percent;
- } else {
- totals[k] += *(const GLuint*)temp_index * percent;
- }
- }
-
- /* calculate the value for pixels in the last row */
- y_percent = highy_float;
- percent = y_percent * (1-lowx_float);
- temp = (const char *)datain + xindex + highy_int * ysize;
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- if (myswap_bytes) {
- totals[k] += __GLU_SWAP_4_BYTES(temp_index) * percent;
- } else {
- totals[k] += *(const GLuint*)temp_index * percent;
- }
- }
- for(l = lowx_int+1; l < highx_int; l++) {
- temp += group_size;
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- if (myswap_bytes) {
- totals[k] +=
- __GLU_SWAP_4_BYTES(temp_index) * y_percent;
- } else {
- totals[k] += *(const GLuint*)temp_index * y_percent;
- }
- }
- }
- temp += group_size;
- percent = y_percent * highx_float;
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- if (myswap_bytes) {
- totals[k] += __GLU_SWAP_4_BYTES(temp_index) * percent;
- } else {
- totals[k] += *(const GLuint*)temp_index * percent;
- }
- }
-
- /* calculate the value for pixels in the 1st and last column */
- for(m = lowy_int+1; m < highy_int; m++) {
- left += ysize;
- right += ysize;
- for (k = 0; k < components;
- k++, left += element_size, right += element_size) {
- if (myswap_bytes) {
- totals[k] +=
- __GLU_SWAP_4_BYTES(left) * (1-lowx_float)
- + __GLU_SWAP_4_BYTES(right) * highx_float;
- } else {
- totals[k] += *(const GLuint*)left * (1-lowx_float)
- + *(const GLuint*)right * highx_float;
- }
- }
- }
- } else if (highy_int > lowy_int) {
- x_percent = highx_float - lowx_float;
- percent = (1-lowy_float)*x_percent;
- temp = (const char *)datain + xindex + lowy_int*ysize;
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- if (myswap_bytes) {
- totals[k] += __GLU_SWAP_4_BYTES(temp_index) * percent;
- } else {
- totals[k] += *(const GLuint*)temp_index * percent;
- }
- }
- for(m = lowy_int+1; m < highy_int; m++) {
- temp += ysize;
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- if (myswap_bytes) {
- totals[k] +=
- __GLU_SWAP_4_BYTES(temp_index) * x_percent;
- } else {
- totals[k] += *(const GLuint*)temp_index * x_percent;
- }
- }
- }
- percent = x_percent * highy_float;
- temp += ysize;
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- if (myswap_bytes) {
- totals[k] += __GLU_SWAP_4_BYTES(temp_index) * percent;
- } else {
- totals[k] += *(const GLuint*)temp_index * percent;
- }
- }
- } else if (highx_int > lowx_int) {
- y_percent = highy_float - lowy_float;
- percent = (1-lowx_float)*y_percent;
-
- temp = (const char *)datain + xindex + lowy_int*ysize;
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- if (myswap_bytes) {
- totals[k] += __GLU_SWAP_4_BYTES(temp_index) * percent;
- } else {
- totals[k] += *(const GLuint*)temp_index * percent;
- }
- }
- for (l = lowx_int+1; l < highx_int; l++) {
- temp += group_size;
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- if (myswap_bytes) {
- totals[k] +=
- __GLU_SWAP_4_BYTES(temp_index) * y_percent;
- } else {
- totals[k] += *(const GLuint*)temp_index * y_percent;
- }
- }
- }
- temp += group_size;
- percent = y_percent * highx_float;
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- if (myswap_bytes) {
- totals[k] += __GLU_SWAP_4_BYTES(temp_index) * percent;
- } else {
- totals[k] += *(const GLuint*)temp_index * percent;
- }
- }
- } else {
- percent = (highy_float-lowy_float)*(highx_float-lowx_float);
- temp = (const char *)datain + xindex + lowy_int * ysize;
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- if (myswap_bytes) {
- totals[k] += __GLU_SWAP_4_BYTES(temp_index) * percent;
- } else {
- totals[k] += *(const GLuint*)temp_index * percent;
- }
- }
- }
-
- /* this is for the pixels in the body */
- temp0 = (const char *)datain + xindex + group_size +
- (lowy_int+1)*ysize;
- for (m = lowy_int+1; m < highy_int; m++) {
- temp = temp0;
- for(l = lowx_int+1; l < highx_int; l++) {
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- if (myswap_bytes) {
- totals[k] += __GLU_SWAP_4_BYTES(temp_index);
- } else {
- totals[k] += *(const GLuint*)temp_index;
- }
- }
- temp += group_size;
- }
- temp0 += ysize;
- }
-
- outindex = (j + (i * widthout)) * components;
- for (k = 0; k < components; k++) {
- /* clamp at UINT_MAX */
- float value= totals[k]/area;
- if (value >= (float) UINT_MAX) { /* need '=' */
- dataout[outindex + k] = UINT_MAX;
- }
- else dataout[outindex + k] = value;
- }
- lowx_int = highx_int;
- lowx_float = highx_float;
- highx_int += convx_int;
- highx_float += convx_float;
- if(highx_float > 1) {
- highx_float -= 1.0;
- highx_int++;
- }
- }
- lowy_int = highy_int;
- lowy_float = highy_float;
- highy_int += convy_int;
- highy_float += convy_float;
- if(highy_float > 1) {
- highy_float -= 1.0;
- highy_int++;
- }
- }
-}
-
-
-
-static void scale_internal_int(GLint components, GLint widthin,
- GLint heightin, const GLint *datain,
- GLint widthout, GLint heightout,
- GLint *dataout, GLint element_size,
- GLint ysize, GLint group_size,
- GLint myswap_bytes)
-{
- float convx;
- float convy;
- float percent;
- /* Max components in a format is 4, so... */
- float totals[4];
- float area;
- int i,j,k,xindex;
-
- const char *temp, *temp0;
- const char *temp_index;
- int outindex;
-
- int lowx_int, highx_int, lowy_int, highy_int;
- float x_percent, y_percent;
- float lowx_float, highx_float, lowy_float, highy_float;
- float convy_float, convx_float;
- int convy_int, convx_int;
- int l, m;
- const char *left, *right;
-
- GLuint swapbuf; /* unsigned buffer */
-
- if (widthin == widthout*2 && heightin == heightout*2) {
- halveImage_int(components, widthin, heightin,
- (const GLint *)datain, (GLint *)dataout,
- element_size, ysize, group_size, myswap_bytes);
- return;
- }
- convy = (float) heightin/heightout;
- convx = (float) widthin/widthout;
- convy_int = floor(convy);
- convy_float = convy - convy_int;
- convx_int = floor(convx);
- convx_float = convx - convx_int;
-
- area = convx * convy;
-
- lowy_int = 0;
- lowy_float = 0;
- highy_int = convy_int;
- highy_float = convy_float;
-
- for (i = 0; i < heightout; i++) {
- /* Clamp here to be sure we don't read beyond input buffer. */
- if (highy_int >= heightin)
- highy_int = heightin - 1;
- lowx_int = 0;
- lowx_float = 0;
- highx_int = convx_int;
- highx_float = convx_float;
-
- for (j = 0; j < widthout; j++) {
- /*
- ** Ok, now apply box filter to box that goes from (lowx, lowy)
- ** to (highx, highy) on input data into this pixel on output
- ** data.
- */
- totals[0] = totals[1] = totals[2] = totals[3] = 0.0;
-
- /* calculate the value for pixels in the 1st row */
- xindex = lowx_int*group_size;
- if((highy_int>lowy_int) && (highx_int>lowx_int)) {
-
- y_percent = 1-lowy_float;
- temp = (const char *)datain + xindex + lowy_int * ysize;
- percent = y_percent * (1-lowx_float);
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- if (myswap_bytes) {
- swapbuf = __GLU_SWAP_4_BYTES(temp_index);
- totals[k] += *(const GLint*)&swapbuf * percent;
- } else {
- totals[k] += *(const GLint*)temp_index * percent;
- }
- }
- left = temp;
- for(l = lowx_int+1; l < highx_int; l++) {
- temp += group_size;
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- if (myswap_bytes) {
- swapbuf = __GLU_SWAP_4_BYTES(temp_index);
- totals[k] += *(const GLint*)&swapbuf * y_percent;
- } else {
- totals[k] += *(const GLint*)temp_index * y_percent;
- }
- }
- }
- temp += group_size;
- right = temp;
- percent = y_percent * highx_float;
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- if (myswap_bytes) {
- swapbuf = __GLU_SWAP_4_BYTES(temp_index);
- totals[k] += *(const GLint*)&swapbuf * percent;
- } else {
- totals[k] += *(const GLint*)temp_index * percent;
- }
- }
-
- /* calculate the value for pixels in the last row */
- y_percent = highy_float;
- percent = y_percent * (1-lowx_float);
- temp = (const char *)datain + xindex + highy_int * ysize;
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- if (myswap_bytes) {
- swapbuf = __GLU_SWAP_4_BYTES(temp_index);
- totals[k] += *(const GLint*)&swapbuf * percent;
- } else {
- totals[k] += *(const GLint*)temp_index * percent;
- }
- }
- for(l = lowx_int+1; l < highx_int; l++) {
- temp += group_size;
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- if (myswap_bytes) {
- swapbuf = __GLU_SWAP_4_BYTES(temp_index);
- totals[k] += *(const GLint*)&swapbuf * y_percent;
- } else {
- totals[k] += *(const GLint*)temp_index * y_percent;
- }
- }
- }
- temp += group_size;
- percent = y_percent * highx_float;
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- if (myswap_bytes) {
- swapbuf = __GLU_SWAP_4_BYTES(temp_index);
- totals[k] += *(const GLint*)&swapbuf * percent;
- } else {
- totals[k] += *(const GLint*)temp_index * percent;
- }
- }
-
- /* calculate the value for pixels in the 1st and last column */
- for(m = lowy_int+1; m < highy_int; m++) {
- left += ysize;
- right += ysize;
- for (k = 0; k < components;
- k++, left += element_size, right += element_size) {
- if (myswap_bytes) {
- swapbuf = __GLU_SWAP_4_BYTES(left);
- totals[k] += *(const GLint*)&swapbuf * (1-lowx_float);
- swapbuf = __GLU_SWAP_4_BYTES(right);
- totals[k] += *(const GLint*)&swapbuf * highx_float;
- } else {
- totals[k] += *(const GLint*)left * (1-lowx_float)
- + *(const GLint*)right * highx_float;
- }
- }
- }
- } else if (highy_int > lowy_int) {
- x_percent = highx_float - lowx_float;
- percent = (1-lowy_float)*x_percent;
- temp = (const char *)datain + xindex + lowy_int*ysize;
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- if (myswap_bytes) {
- swapbuf = __GLU_SWAP_4_BYTES(temp_index);
- totals[k] += *(const GLint*)&swapbuf * percent;
- } else {
- totals[k] += *(const GLint*)temp_index * percent;
- }
- }
- for(m = lowy_int+1; m < highy_int; m++) {
- temp += ysize;
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- if (myswap_bytes) {
- swapbuf = __GLU_SWAP_4_BYTES(temp_index);
- totals[k] += *(const GLint*)&swapbuf * x_percent;
- } else {
- totals[k] += *(const GLint*)temp_index * x_percent;
- }
- }
- }
- percent = x_percent * highy_float;
- temp += ysize;
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- if (myswap_bytes) {
- swapbuf = __GLU_SWAP_4_BYTES(temp_index);
- totals[k] += *(const GLint*)&swapbuf * percent;
- } else {
- totals[k] += *(const GLint*)temp_index * percent;
- }
- }
- } else if (highx_int > lowx_int) {
- y_percent = highy_float - lowy_float;
- percent = (1-lowx_float)*y_percent;
-
- temp = (const char *)datain + xindex + lowy_int*ysize;
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- if (myswap_bytes) {
- swapbuf = __GLU_SWAP_4_BYTES(temp_index);
- totals[k] += *(const GLint*)&swapbuf * percent;
- } else {
- totals[k] += *(const GLint*)temp_index * percent;
- }
- }
- for (l = lowx_int+1; l < highx_int; l++) {
- temp += group_size;
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- if (myswap_bytes) {
- swapbuf = __GLU_SWAP_4_BYTES(temp_index);
- totals[k] += *(const GLint*)&swapbuf * y_percent;
- } else {
- totals[k] += *(const GLint*)temp_index * y_percent;
- }
- }
- }
- temp += group_size;
- percent = y_percent * highx_float;
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- if (myswap_bytes) {
- swapbuf = __GLU_SWAP_4_BYTES(temp_index);
- totals[k] += *(const GLint*)&swapbuf * percent;
- } else {
- totals[k] += *(const GLint*)temp_index * percent;
- }
- }
- } else {
- percent = (highy_float-lowy_float)*(highx_float-lowx_float);
- temp = (const char *)datain + xindex + lowy_int * ysize;
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- if (myswap_bytes) {
- swapbuf = __GLU_SWAP_4_BYTES(temp_index);
- totals[k] += *(const GLint*)&swapbuf * percent;
- } else {
- totals[k] += *(const GLint*)temp_index * percent;
- }
- }
- }
-
- /* this is for the pixels in the body */
- temp0 = (const char *)datain + xindex + group_size +
- (lowy_int+1)*ysize;
- for (m = lowy_int+1; m < highy_int; m++) {
- temp = temp0;
- for(l = lowx_int+1; l < highx_int; l++) {
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- if (myswap_bytes) {
- swapbuf = __GLU_SWAP_4_BYTES(temp_index);
- totals[k] += *(const GLint*)&swapbuf;
- } else {
- totals[k] += *(const GLint*)temp_index;
- }
- }
- temp += group_size;
- }
- temp0 += ysize;
- }
-
- outindex = (j + (i * widthout)) * components;
- for (k = 0; k < components; k++) {
- dataout[outindex + k] = totals[k]/area;
- /*printf("totals[%d] = %f\n", k, totals[k]);*/
- }
- lowx_int = highx_int;
- lowx_float = highx_float;
- highx_int += convx_int;
- highx_float += convx_float;
- if(highx_float > 1) {
- highx_float -= 1.0;
- highx_int++;
- }
- }
- lowy_int = highy_int;
- lowy_float = highy_float;
- highy_int += convy_int;
- highy_float += convy_float;
- if(highy_float > 1) {
- highy_float -= 1.0;
- highy_int++;
- }
- }
-}
-
-
-
-static void scale_internal_float(GLint components, GLint widthin,
- GLint heightin, const GLfloat *datain,
- GLint widthout, GLint heightout,
- GLfloat *dataout, GLint element_size,
- GLint ysize, GLint group_size,
- GLint myswap_bytes)
-{
- float convx;
- float convy;
- float percent;
- /* Max components in a format is 4, so... */
- float totals[4];
- float area;
- int i,j,k,xindex;
-
- const char *temp, *temp0;
- const char *temp_index;
- int outindex;
-
- int lowx_int, highx_int, lowy_int, highy_int;
- float x_percent, y_percent;
- float lowx_float, highx_float, lowy_float, highy_float;
- float convy_float, convx_float;
- int convy_int, convx_int;
- int l, m;
- const char *left, *right;
-
- union { GLuint b; GLfloat f; } swapbuf;
-
- if (widthin == widthout*2 && heightin == heightout*2) {
- halveImage_float(components, widthin, heightin,
- (const GLfloat *)datain, (GLfloat *)dataout,
- element_size, ysize, group_size, myswap_bytes);
- return;
- }
- convy = (float) heightin/heightout;
- convx = (float) widthin/widthout;
- convy_int = floor(convy);
- convy_float = convy - convy_int;
- convx_int = floor(convx);
- convx_float = convx - convx_int;
-
- area = convx * convy;
-
- lowy_int = 0;
- lowy_float = 0;
- highy_int = convy_int;
- highy_float = convy_float;
-
- for (i = 0; i < heightout; i++) {
- /* Clamp here to be sure we don't read beyond input buffer. */
- if (highy_int >= heightin)
- highy_int = heightin - 1;
- lowx_int = 0;
- lowx_float = 0;
- highx_int = convx_int;
- highx_float = convx_float;
-
- for (j = 0; j < widthout; j++) {
- /*
- ** Ok, now apply box filter to box that goes from (lowx, lowy)
- ** to (highx, highy) on input data into this pixel on output
- ** data.
- */
- totals[0] = totals[1] = totals[2] = totals[3] = 0.0;
-
- /* calculate the value for pixels in the 1st row */
- xindex = lowx_int*group_size;
- if((highy_int>lowy_int) && (highx_int>lowx_int)) {
-
- y_percent = 1-lowy_float;
- temp = (const char *)datain + xindex + lowy_int * ysize;
- percent = y_percent * (1-lowx_float);
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- if (myswap_bytes) {
- swapbuf.b = __GLU_SWAP_4_BYTES(temp_index);
- totals[k] += swapbuf.f * percent;
- } else {
- totals[k] += *(const GLfloat*)temp_index * percent;
- }
- }
- left = temp;
- for(l = lowx_int+1; l < highx_int; l++) {
- temp += group_size;
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- if (myswap_bytes) {
- swapbuf.b = __GLU_SWAP_4_BYTES(temp_index);
- totals[k] += swapbuf.f * y_percent;
- } else {
- totals[k] += *(const GLfloat*)temp_index * y_percent;
- }
- }
- }
- temp += group_size;
- right = temp;
- percent = y_percent * highx_float;
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- if (myswap_bytes) {
- swapbuf.b = __GLU_SWAP_4_BYTES(temp_index);
- totals[k] += swapbuf.f * percent;
- } else {
- totals[k] += *(const GLfloat*)temp_index * percent;
- }
- }
-
- /* calculate the value for pixels in the last row */
- y_percent = highy_float;
- percent = y_percent * (1-lowx_float);
- temp = (const char *)datain + xindex + highy_int * ysize;
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- if (myswap_bytes) {
- swapbuf.b = __GLU_SWAP_4_BYTES(temp_index);
- totals[k] += swapbuf.f * percent;
- } else {
- totals[k] += *(const GLfloat*)temp_index * percent;
- }
- }
- for(l = lowx_int+1; l < highx_int; l++) {
- temp += group_size;
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- if (myswap_bytes) {
- swapbuf.b = __GLU_SWAP_4_BYTES(temp_index);
- totals[k] += swapbuf.f * y_percent;
- } else {
- totals[k] += *(const GLfloat*)temp_index * y_percent;
- }
- }
- }
- temp += group_size;
- percent = y_percent * highx_float;
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- if (myswap_bytes) {
- swapbuf.b = __GLU_SWAP_4_BYTES(temp_index);
- totals[k] += swapbuf.f * percent;
- } else {
- totals[k] += *(const GLfloat*)temp_index * percent;
- }
- }
-
- /* calculate the value for pixels in the 1st and last column */
- for(m = lowy_int+1; m < highy_int; m++) {
- left += ysize;
- right += ysize;
- for (k = 0; k < components;
- k++, left += element_size, right += element_size) {
- if (myswap_bytes) {
- swapbuf.b = __GLU_SWAP_4_BYTES(left);
- totals[k] += swapbuf.f * (1-lowx_float);
- swapbuf.b = __GLU_SWAP_4_BYTES(right);
- totals[k] += swapbuf.f * highx_float;
- } else {
- totals[k] += *(const GLfloat*)left * (1-lowx_float)
- + *(const GLfloat*)right * highx_float;
- }
- }
- }
- } else if (highy_int > lowy_int) {
- x_percent = highx_float - lowx_float;
- percent = (1-lowy_float)*x_percent;
- temp = (const char *)datain + xindex + lowy_int*ysize;
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- if (myswap_bytes) {
- swapbuf.b = __GLU_SWAP_4_BYTES(temp_index);
- totals[k] += swapbuf.f * percent;
- } else {
- totals[k] += *(const GLfloat*)temp_index * percent;
- }
- }
- for(m = lowy_int+1; m < highy_int; m++) {
- temp += ysize;
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- if (myswap_bytes) {
- swapbuf.b = __GLU_SWAP_4_BYTES(temp_index);
- totals[k] += swapbuf.f * x_percent;
- } else {
- totals[k] += *(const GLfloat*)temp_index * x_percent;
- }
- }
- }
- percent = x_percent * highy_float;
- temp += ysize;
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- if (myswap_bytes) {
- swapbuf.b = __GLU_SWAP_4_BYTES(temp_index);
- totals[k] += swapbuf.f * percent;
- } else {
- totals[k] += *(const GLfloat*)temp_index * percent;
- }
- }
- } else if (highx_int > lowx_int) {
- y_percent = highy_float - lowy_float;
- percent = (1-lowx_float)*y_percent;
-
- temp = (const char *)datain + xindex + lowy_int*ysize;
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- if (myswap_bytes) {
- swapbuf.b = __GLU_SWAP_4_BYTES(temp_index);
- totals[k] += swapbuf.f * percent;
- } else {
- totals[k] += *(const GLfloat*)temp_index * percent;
- }
- }
- for (l = lowx_int+1; l < highx_int; l++) {
- temp += group_size;
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- if (myswap_bytes) {
- swapbuf.b = __GLU_SWAP_4_BYTES(temp_index);
- totals[k] += swapbuf.f * y_percent;
- } else {
- totals[k] += *(const GLfloat*)temp_index * y_percent;
- }
- }
- }
- temp += group_size;
- percent = y_percent * highx_float;
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- if (myswap_bytes) {
- swapbuf.b = __GLU_SWAP_4_BYTES(temp_index);
- totals[k] += swapbuf.f * percent;
- } else {
- totals[k] += *(const GLfloat*)temp_index * percent;
- }
- }
- } else {
- percent = (highy_float-lowy_float)*(highx_float-lowx_float);
- temp = (const char *)datain + xindex + lowy_int * ysize;
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- if (myswap_bytes) {
- swapbuf.b = __GLU_SWAP_4_BYTES(temp_index);
- totals[k] += swapbuf.f * percent;
- } else {
- totals[k] += *(const GLfloat*)temp_index * percent;
- }
- }
- }
-
- /* this is for the pixels in the body */
- temp0 = (const char *)datain + xindex + group_size +
- (lowy_int+1)*ysize;
- for (m = lowy_int+1; m < highy_int; m++) {
- temp = temp0;
- for(l = lowx_int+1; l < highx_int; l++) {
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- if (myswap_bytes) {
- swapbuf.b = __GLU_SWAP_4_BYTES(temp_index);
- totals[k] += swapbuf.f;
- } else {
- totals[k] += *(const GLfloat*)temp_index;
- }
- }
- temp += group_size;
- }
- temp0 += ysize;
- }
-
- outindex = (j + (i * widthout)) * components;
- for (k = 0; k < components; k++) {
- dataout[outindex + k] = totals[k]/area;
- /*printf("totals[%d] = %f\n", k, totals[k]);*/
- }
- lowx_int = highx_int;
- lowx_float = highx_float;
- highx_int += convx_int;
- highx_float += convx_float;
- if(highx_float > 1) {
- highx_float -= 1.0;
- highx_int++;
- }
- }
- lowy_int = highy_int;
- lowy_float = highy_float;
- highy_int += convy_int;
- highy_float += convy_float;
- if(highy_float > 1) {
- highy_float -= 1.0;
- highy_int++;
- }
- }
-}
-
-static int checkMipmapArgs(GLenum internalFormat, GLenum format, GLenum type)
-{
- if (!legalFormat(format) || !legalType(type)) {
- return GLU_INVALID_ENUM;
- }
- if (format == GL_STENCIL_INDEX) {
- return GLU_INVALID_ENUM;
- }
-
- if (!isLegalFormatForPackedPixelType(format, type)) {
- return GLU_INVALID_OPERATION;
- }
-
- return 0;
-} /* checkMipmapArgs() */
-
-static GLboolean legalFormat(GLenum format)
-{
- switch(format) {
- case GL_COLOR_INDEX:
- case GL_STENCIL_INDEX:
- case GL_DEPTH_COMPONENT:
- case GL_RED:
- case GL_GREEN:
- case GL_BLUE:
- case GL_ALPHA:
- case GL_RGB:
- case GL_RGBA:
- case GL_LUMINANCE:
- case GL_LUMINANCE_ALPHA:
- case GL_BGR:
- case GL_BGRA:
- return GL_TRUE;
- default:
- return GL_FALSE;
- }
-}
-
-
-static GLboolean legalType(GLenum type)
-{
- switch(type) {
- case GL_BITMAP:
- case GL_BYTE:
- case GL_UNSIGNED_BYTE:
- case GL_SHORT:
- case GL_UNSIGNED_SHORT:
- case GL_INT:
- case GL_UNSIGNED_INT:
- case GL_FLOAT:
- case GL_UNSIGNED_BYTE_3_3_2:
- case GL_UNSIGNED_BYTE_2_3_3_REV:
- case GL_UNSIGNED_SHORT_5_6_5:
- case GL_UNSIGNED_SHORT_5_6_5_REV:
- case GL_UNSIGNED_SHORT_4_4_4_4:
- case GL_UNSIGNED_SHORT_4_4_4_4_REV:
- case GL_UNSIGNED_SHORT_5_5_5_1:
- case GL_UNSIGNED_SHORT_1_5_5_5_REV:
- case GL_UNSIGNED_INT_8_8_8_8:
- case GL_UNSIGNED_INT_8_8_8_8_REV:
- case GL_UNSIGNED_INT_10_10_10_2:
- case GL_UNSIGNED_INT_2_10_10_10_REV:
- return GL_TRUE;
- default:
- return GL_FALSE;
- }
-}
-
-/* */
-static GLboolean isTypePackedPixel(GLenum type)
-{
- assert(legalType(type));
-
- if (type == GL_UNSIGNED_BYTE_3_3_2 ||
- type == GL_UNSIGNED_BYTE_2_3_3_REV ||
- type == GL_UNSIGNED_SHORT_5_6_5 ||
- type == GL_UNSIGNED_SHORT_5_6_5_REV ||
- type == GL_UNSIGNED_SHORT_4_4_4_4 ||
- type == GL_UNSIGNED_SHORT_4_4_4_4_REV ||
- type == GL_UNSIGNED_SHORT_5_5_5_1 ||
- type == GL_UNSIGNED_SHORT_1_5_5_5_REV ||
- type == GL_UNSIGNED_INT_8_8_8_8 ||
- type == GL_UNSIGNED_INT_8_8_8_8_REV ||
- type == GL_UNSIGNED_INT_10_10_10_2 ||
- type == GL_UNSIGNED_INT_2_10_10_10_REV) {
- return 1;
- }
- else return 0;
-} /* isTypePackedPixel() */
-
-/* Determines if the packed pixel type is compatible with the format */
-static GLboolean isLegalFormatForPackedPixelType(GLenum format, GLenum type)
-{
- /* if not a packed pixel type then return true */
- if (!isTypePackedPixel(type)) {
- return GL_TRUE;
- }
-
- /* 3_3_2/2_3_3_REV & 5_6_5/5_6_5_REV are only compatible with RGB */
- if ((type == GL_UNSIGNED_BYTE_3_3_2 || type == GL_UNSIGNED_BYTE_2_3_3_REV||
- type == GL_UNSIGNED_SHORT_5_6_5|| type == GL_UNSIGNED_SHORT_5_6_5_REV)
- && format != GL_RGB)
- return GL_FALSE;
-
- /* 4_4_4_4/4_4_4_4_REV & 5_5_5_1/1_5_5_5_REV & 8_8_8_8/8_8_8_8_REV &
- * 10_10_10_2/2_10_10_10_REV are only compatible with RGBA, BGRA & ABGR_EXT.
- */
- if ((type == GL_UNSIGNED_SHORT_4_4_4_4 ||
- type == GL_UNSIGNED_SHORT_4_4_4_4_REV ||
- type == GL_UNSIGNED_SHORT_5_5_5_1 ||
- type == GL_UNSIGNED_SHORT_1_5_5_5_REV ||
- type == GL_UNSIGNED_INT_8_8_8_8 ||
- type == GL_UNSIGNED_INT_8_8_8_8_REV ||
- type == GL_UNSIGNED_INT_10_10_10_2 ||
- type == GL_UNSIGNED_INT_2_10_10_10_REV) &&
- (format != GL_RGBA &&
- format != GL_BGRA)) {
- return GL_FALSE;
- }
-
- return GL_TRUE;
-} /* isLegalFormatForPackedPixelType() */
-
-static GLboolean isLegalLevels(GLint userLevel,GLint baseLevel,GLint maxLevel,
- GLint totalLevels)
-{
- if (baseLevel < 0 || baseLevel < userLevel || maxLevel < baseLevel ||
- totalLevels < maxLevel)
- return GL_FALSE;
- else return GL_TRUE;
-} /* isLegalLevels() */
-
-/* Given user requested texture size, determine if it fits. If it
- * doesn't then halve both sides and make the determination again
- * until it does fit (for IR only).
- * Note that proxy textures are not implemented in RE* even though
- * they advertise the texture extension.
- * Note that proxy textures are implemented but not according to spec in
- * IMPACT*.
- */
-static void closestFit(GLenum target, GLint width, GLint height,
- GLint internalFormat, GLenum format, GLenum type,
- GLint *newWidth, GLint *newHeight)
-{
- /* Use proxy textures if OpenGL version is >= 1.1 */
- if ( (strtod((const char *)glGetString(GL_VERSION),NULL) >= 1.1)
- ) {
- GLint widthPowerOf2= nearestPower(width);
- GLint heightPowerOf2= nearestPower(height);
- GLint proxyWidth;
-
- do {
- /* compute level 1 width & height, clamping each at 1 */
- GLint widthAtLevelOne= (widthPowerOf2 > 1) ?
- widthPowerOf2 >> 1 :
- widthPowerOf2;
- GLint heightAtLevelOne= (heightPowerOf2 > 1) ?
- heightPowerOf2 >> 1 :
- heightPowerOf2;
- GLenum proxyTarget;
- assert(widthAtLevelOne > 0); assert(heightAtLevelOne > 0);
-
- /* does width x height at level 1 & all their mipmaps fit? */
- if (target == GL_TEXTURE_2D || target == GL_PROXY_TEXTURE_2D) {
- proxyTarget = GL_PROXY_TEXTURE_2D;
- glTexImage2D(proxyTarget, 1, /* must be non-zero */
- internalFormat,
- widthAtLevelOne,heightAtLevelOne,0,format,type,NULL);
- } else
-#if defined(GL_ARB_texture_cube_map)
- if ((target == GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB) ||
- (target == GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB) ||
- (target == GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB) ||
- (target == GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB) ||
- (target == GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB) ||
- (target == GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB)) {
- proxyTarget = GL_PROXY_TEXTURE_CUBE_MAP_ARB;
- glTexImage2D(proxyTarget, 1, /* must be non-zero */
- internalFormat,
- widthAtLevelOne,heightAtLevelOne,0,format,type,NULL);
- } else
-#endif /* GL_ARB_texture_cube_map */
- {
- assert(target == GL_TEXTURE_1D || target == GL_PROXY_TEXTURE_1D);
- proxyTarget = GL_PROXY_TEXTURE_1D;
- glTexImage1D(proxyTarget, 1, /* must be non-zero */
- internalFormat,widthAtLevelOne,0,format,type,NULL);
- }
- glGetTexLevelParameteriv(proxyTarget, 1,GL_TEXTURE_WIDTH,&proxyWidth);
- /* does it fit??? */
- if (proxyWidth == 0) { /* nope, so try again with these sizes */
- if (widthPowerOf2 == 1 && heightPowerOf2 == 1) {
- /* An 1x1 texture couldn't fit for some reason, so
- * break out. This should never happen. But things
- * happen. The disadvantage with this if-statement is
- * that we will never be aware of when this happens
- * since it will silently branch out.
- */
- goto noProxyTextures;
- }
- widthPowerOf2= widthAtLevelOne;
- heightPowerOf2= heightAtLevelOne;
- }
- /* else it does fit */
- } while (proxyWidth == 0);
- /* loop must terminate! */
-
- /* return the width & height at level 0 that fits */
- *newWidth= widthPowerOf2;
- *newHeight= heightPowerOf2;
-/*printf("Proxy Textures\n");*/
- } /* if gluCheckExtension() */
- else { /* no texture extension, so do this instead */
- GLint maxsize;
-
-noProxyTextures:
-
- glGetIntegerv(GL_MAX_TEXTURE_SIZE, &maxsize);
- /* clamp user's texture sizes to maximum sizes, if necessary */
- *newWidth = nearestPower(width);
- if (*newWidth > maxsize) *newWidth = maxsize;
- *newHeight = nearestPower(height);
- if (*newHeight > maxsize) *newHeight = maxsize;
-/*printf("NO proxy textures\n");*/
- }
-} /* closestFit() */
-
-GLint GLAPIENTRY
-gluScaleImage(GLenum format, GLsizei widthin, GLsizei heightin,
- GLenum typein, const void *datain,
- GLsizei widthout, GLsizei heightout, GLenum typeout,
- void *dataout)
-{
- int components;
- GLushort *beforeImage;
- GLushort *afterImage;
- PixelStorageModes psm;
-
- if (widthin == 0 || heightin == 0 || widthout == 0 || heightout == 0) {
- return 0;
- }
- if (widthin < 0 || heightin < 0 || widthout < 0 || heightout < 0) {
- return GLU_INVALID_VALUE;
- }
- if (!legalFormat(format) || !legalType(typein) || !legalType(typeout)) {
- return GLU_INVALID_ENUM;
- }
- if (!isLegalFormatForPackedPixelType(format, typein)) {
- return GLU_INVALID_OPERATION;
- }
- if (!isLegalFormatForPackedPixelType(format, typeout)) {
- return GLU_INVALID_OPERATION;
- }
- beforeImage =
- malloc(image_size(widthin, heightin, format, GL_UNSIGNED_SHORT));
- afterImage =
- malloc(image_size(widthout, heightout, format, GL_UNSIGNED_SHORT));
- if (beforeImage == NULL || afterImage == NULL) {
- free(beforeImage);
- free(afterImage);
- return GLU_OUT_OF_MEMORY;
- }
-
- retrieveStoreModes(&psm);
- fill_image(&psm,widthin, heightin, format, typein, is_index(format),
- datain, beforeImage);
- components = elements_per_group(format, 0);
- scale_internal(components, widthin, heightin, beforeImage,
- widthout, heightout, afterImage);
- empty_image(&psm,widthout, heightout, format, typeout,
- is_index(format), afterImage, dataout);
- free((GLbyte *) beforeImage);
- free((GLbyte *) afterImage);
-
- return 0;
-}
-
-int gluBuild1DMipmapLevelsCore(GLenum target, GLint internalFormat,
- GLsizei width,
- GLsizei widthPowerOf2,
- GLenum format, GLenum type,
- GLint userLevel, GLint baseLevel,GLint maxLevel,
- const void *data)
-{
- GLint newwidth;
- GLint level, levels;
- GLushort *newImage;
- GLint newImage_width;
- GLushort *otherImage;
- GLushort *imageTemp;
- GLint memreq;
- GLint cmpts;
- PixelStorageModes psm;
-
- assert(checkMipmapArgs(internalFormat,format,type) == 0);
- assert(width >= 1);
-
- otherImage = NULL;
-
- newwidth= widthPowerOf2;
- levels = computeLog(newwidth);
-
- levels+= userLevel;
-
- retrieveStoreModes(&psm);
- newImage = (GLushort *)
- malloc(image_size(width, 1, format, GL_UNSIGNED_SHORT));
- newImage_width = width;
- if (newImage == NULL) {
- return GLU_OUT_OF_MEMORY;
- }
- fill_image(&psm,width, 1, format, type, is_index(format),
- data, newImage);
- cmpts = elements_per_group(format,type);
- glPixelStorei(GL_UNPACK_ALIGNMENT, 2);
- glPixelStorei(GL_UNPACK_SKIP_ROWS, 0);
- glPixelStorei(GL_UNPACK_SKIP_PIXELS, 0);
- glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
- /*
- ** If swap_bytes was set, swapping occurred in fill_image.
- */
- glPixelStorei(GL_UNPACK_SWAP_BYTES, GL_FALSE);
-
- for (level = userLevel; level <= levels; level++) {
- if (newImage_width == newwidth) {
- /* Use newImage for this level */
- if (baseLevel <= level && level <= maxLevel) {
- glTexImage1D(target, level, internalFormat, newImage_width,
- 0, format, GL_UNSIGNED_SHORT, (void *) newImage);
- }
- } else {
- if (otherImage == NULL) {
- memreq = image_size(newwidth, 1, format, GL_UNSIGNED_SHORT);
- otherImage = (GLushort *) malloc(memreq);
- if (otherImage == NULL) {
- glPixelStorei(GL_UNPACK_ALIGNMENT, psm.unpack_alignment);
- glPixelStorei(GL_UNPACK_SKIP_ROWS, psm.unpack_skip_rows);
- glPixelStorei(GL_UNPACK_SKIP_PIXELS,psm.unpack_skip_pixels);
- glPixelStorei(GL_UNPACK_ROW_LENGTH, psm.unpack_row_length);
- glPixelStorei(GL_UNPACK_SWAP_BYTES, psm.unpack_swap_bytes);
- free(newImage);
- return GLU_OUT_OF_MEMORY;
- }
- }
- scale_internal(cmpts, newImage_width, 1, newImage,
- newwidth, 1, otherImage);
- /* Swap newImage and otherImage */
- imageTemp = otherImage;
- otherImage = newImage;
- newImage = imageTemp;
-
- newImage_width = newwidth;
- if (baseLevel <= level && level <= maxLevel) {
- glTexImage1D(target, level, internalFormat, newImage_width,
- 0, format, GL_UNSIGNED_SHORT, (void *) newImage);
- }
- }
- if (newwidth > 1) newwidth /= 2;
- }
- glPixelStorei(GL_UNPACK_ALIGNMENT, psm.unpack_alignment);
- glPixelStorei(GL_UNPACK_SKIP_ROWS, psm.unpack_skip_rows);
- glPixelStorei(GL_UNPACK_SKIP_PIXELS, psm.unpack_skip_pixels);
- glPixelStorei(GL_UNPACK_ROW_LENGTH, psm.unpack_row_length);
- glPixelStorei(GL_UNPACK_SWAP_BYTES, psm.unpack_swap_bytes);
-
- free((GLbyte *) newImage);
- if (otherImage) {
- free((GLbyte *) otherImage);
- }
- return 0;
-}
-
-GLint GLAPIENTRY
-gluBuild1DMipmapLevels(GLenum target, GLint internalFormat,
- GLsizei width,
- GLenum format, GLenum type,
- GLint userLevel, GLint baseLevel, GLint maxLevel,
- const void *data)
-{
- int levels;
-
- int rc= checkMipmapArgs(internalFormat,format,type);
- if (rc != 0) return rc;
-
- if (width < 1) {
- return GLU_INVALID_VALUE;
- }
-
- levels = computeLog(width);
-
- levels+= userLevel;
- if (!isLegalLevels(userLevel,baseLevel,maxLevel,levels))
- return GLU_INVALID_VALUE;
-
- return gluBuild1DMipmapLevelsCore(target, internalFormat,
- width,
- width,format, type,
- userLevel, baseLevel, maxLevel,
- data);
-} /* gluBuild1DMipmapLevels() */
-
-GLint GLAPIENTRY
-gluBuild1DMipmaps(GLenum target, GLint internalFormat, GLsizei width,
- GLenum format, GLenum type,
- const void *data)
-{
- GLint widthPowerOf2;
- int levels;
- GLint dummy;
-
- int rc= checkMipmapArgs(internalFormat,format,type);
- if (rc != 0) return rc;
-
- if (width < 1) {
- return GLU_INVALID_VALUE;
- }
-
- closestFit(target,width,1,internalFormat,format,type,&widthPowerOf2,&dummy);
- levels = computeLog(widthPowerOf2);
-
- return gluBuild1DMipmapLevelsCore(target,internalFormat,
- width,
- widthPowerOf2,
- format,type,0,0,levels,data);
-}
-
-static int bitmapBuild2DMipmaps(GLenum target, GLint internalFormat,
- GLint width, GLint height, GLenum format,
- GLenum type, const void *data)
-{
- GLint newwidth, newheight;
- GLint level, levels;
- GLushort *newImage;
- GLint newImage_width;
- GLint newImage_height;
- GLushort *otherImage;
- GLushort *imageTemp;
- GLint memreq;
- GLint cmpts;
- PixelStorageModes psm;
-
- retrieveStoreModes(&psm);
-
-#if 0
- glGetIntegerv(GL_MAX_TEXTURE_SIZE, &maxsize);
- newwidth = nearestPower(width);
- if (newwidth > maxsize) newwidth = maxsize;
- newheight = nearestPower(height);
- if (newheight > maxsize) newheight = maxsize;
-#else
- closestFit(target,width,height,internalFormat,format,type,
- &newwidth,&newheight);
-#endif
- levels = computeLog(newwidth);
- level = computeLog(newheight);
- if (level > levels) levels=level;
-
- otherImage = NULL;
- newImage = (GLushort *)
- malloc(image_size(width, height, format, GL_UNSIGNED_SHORT));
- newImage_width = width;
- newImage_height = height;
- if (newImage == NULL) {
- return GLU_OUT_OF_MEMORY;
- }
-
- fill_image(&psm,width, height, format, type, is_index(format),
- data, newImage);
-
- cmpts = elements_per_group(format,type);
- glPixelStorei(GL_UNPACK_ALIGNMENT, 2);
- glPixelStorei(GL_UNPACK_SKIP_ROWS, 0);
- glPixelStorei(GL_UNPACK_SKIP_PIXELS, 0);
- glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
- /*
- ** If swap_bytes was set, swapping occurred in fill_image.
- */
- glPixelStorei(GL_UNPACK_SWAP_BYTES, GL_FALSE);
-
- for (level = 0; level <= levels; level++) {
- if (newImage_width == newwidth && newImage_height == newheight) { /* Use newImage for this level */
- glTexImage2D(target, level, internalFormat, newImage_width,
- newImage_height, 0, format, GL_UNSIGNED_SHORT,
- (void *) newImage);
- } else {
- if (otherImage == NULL) {
- memreq =
- image_size(newwidth, newheight, format, GL_UNSIGNED_SHORT);
- otherImage = (GLushort *) malloc(memreq);
- if (otherImage == NULL) {
- glPixelStorei(GL_UNPACK_ALIGNMENT, psm.unpack_alignment);
- glPixelStorei(GL_UNPACK_SKIP_ROWS, psm.unpack_skip_rows);
- glPixelStorei(GL_UNPACK_SKIP_PIXELS,psm.unpack_skip_pixels);
- glPixelStorei(GL_UNPACK_ROW_LENGTH, psm.unpack_row_length);
- glPixelStorei(GL_UNPACK_SWAP_BYTES, psm.unpack_swap_bytes);
- free(newImage);
- return GLU_OUT_OF_MEMORY;
- }
- }
- scale_internal(cmpts, newImage_width, newImage_height, newImage,
- newwidth, newheight, otherImage);
- /* Swap newImage and otherImage */
- imageTemp = otherImage;
- otherImage = newImage;
- newImage = imageTemp;
-
- newImage_width = newwidth;
- newImage_height = newheight;
- glTexImage2D(target, level, internalFormat, newImage_width,
- newImage_height, 0, format, GL_UNSIGNED_SHORT,
- (void *) newImage);
- }
- if (newwidth > 1) newwidth /= 2;
- if (newheight > 1) newheight /= 2;
- }
- glPixelStorei(GL_UNPACK_ALIGNMENT, psm.unpack_alignment);
- glPixelStorei(GL_UNPACK_SKIP_ROWS, psm.unpack_skip_rows);
- glPixelStorei(GL_UNPACK_SKIP_PIXELS, psm.unpack_skip_pixels);
- glPixelStorei(GL_UNPACK_ROW_LENGTH, psm.unpack_row_length);
- glPixelStorei(GL_UNPACK_SWAP_BYTES, psm.unpack_swap_bytes);
-
- free((GLbyte *) newImage);
- if (otherImage) {
- free((GLbyte *) otherImage);
- }
- return 0;
-}
-
-/* To make swapping images less error prone */
-#define __GLU_INIT_SWAP_IMAGE void *tmpImage
-#define __GLU_SWAP_IMAGE(a,b) tmpImage = a; a = b; b = tmpImage;
-
-static int gluBuild2DMipmapLevelsCore(GLenum target, GLint internalFormat,
- GLsizei width, GLsizei height,
- GLsizei widthPowerOf2,
- GLsizei heightPowerOf2,
- GLenum format, GLenum type,
- GLint userLevel,
- GLint baseLevel,GLint maxLevel,
- const void *data)
-{
- GLint newwidth, newheight;
- GLint level, levels;
- const void *usersImage; /* passed from user. Don't touch! */
- void *srcImage, *dstImage; /* scratch area to build mipmapped images */
- __GLU_INIT_SWAP_IMAGE;
- GLint memreq;
- GLint cmpts;
-
- GLint myswap_bytes, groups_per_line, element_size, group_size;
- GLint rowsize, padding;
- PixelStorageModes psm;
-
- assert(checkMipmapArgs(internalFormat,format,type) == 0);
- assert(width >= 1 && height >= 1);
-
- if(type == GL_BITMAP) {
- return bitmapBuild2DMipmaps(target, internalFormat, width, height,
- format, type, data);
- }
-
- srcImage = dstImage = NULL;
-
- newwidth= widthPowerOf2;
- newheight= heightPowerOf2;
- levels = computeLog(newwidth);
- level = computeLog(newheight);
- if (level > levels) levels=level;
-
- levels+= userLevel;
-
- retrieveStoreModes(&psm);
- myswap_bytes = psm.unpack_swap_bytes;
- cmpts = elements_per_group(format,type);
- if (psm.unpack_row_length > 0) {
- groups_per_line = psm.unpack_row_length;
- } else {
- groups_per_line = width;
- }
-
- element_size = bytes_per_element(type);
- group_size = element_size * cmpts;
- if (element_size == 1) myswap_bytes = 0;
-
- rowsize = groups_per_line * group_size;
- padding = (rowsize % psm.unpack_alignment);
- if (padding) {
- rowsize += psm.unpack_alignment - padding;
- }
- usersImage = (const GLubyte *) data + psm.unpack_skip_rows * rowsize +
- psm.unpack_skip_pixels * group_size;
-
- glPixelStorei(GL_UNPACK_SKIP_ROWS, 0);
- glPixelStorei(GL_UNPACK_SKIP_PIXELS, 0);
- glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
-
- level = userLevel;
-
- /* already power-of-two square */
- if (width == newwidth && height == newheight) {
- /* Use usersImage for level userLevel */
- if (baseLevel <= level && level <= maxLevel) {
- glPixelStorei(GL_UNPACK_ROW_LENGTH, psm.unpack_row_length);
- glTexImage2D(target, level, internalFormat, width,
- height, 0, format, type,
- usersImage);
- }
- glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
- if(levels == 0) { /* we're done. clean up and return */
- glPixelStorei(GL_UNPACK_ALIGNMENT, psm.unpack_alignment);
- glPixelStorei(GL_UNPACK_SKIP_ROWS, psm.unpack_skip_rows);
- glPixelStorei(GL_UNPACK_SKIP_PIXELS, psm.unpack_skip_pixels);
- glPixelStorei(GL_UNPACK_ROW_LENGTH, psm.unpack_row_length);
- glPixelStorei(GL_UNPACK_SWAP_BYTES, psm.unpack_swap_bytes);
- return 0;
- }
- {
- int nextWidth= newwidth/2;
- int nextHeight= newheight/2;
-
- /* clamp to 1 */
- if (nextWidth < 1) nextWidth= 1;
- if (nextHeight < 1) nextHeight= 1;
- memreq = image_size(nextWidth, nextHeight, format, type);
- }
-
- switch(type) {
- case GL_UNSIGNED_BYTE:
- dstImage = (GLubyte *)malloc(memreq);
- break;
- case GL_BYTE:
- dstImage = (GLbyte *)malloc(memreq);
- break;
- case GL_UNSIGNED_SHORT:
- dstImage = (GLushort *)malloc(memreq);
- break;
- case GL_SHORT:
- dstImage = (GLshort *)malloc(memreq);
- break;
- case GL_UNSIGNED_INT:
- dstImage = (GLuint *)malloc(memreq);
- break;
- case GL_INT:
- dstImage = (GLint *)malloc(memreq);
- break;
- case GL_FLOAT:
- dstImage = (GLfloat *)malloc(memreq);
- break;
- case GL_UNSIGNED_BYTE_3_3_2:
- case GL_UNSIGNED_BYTE_2_3_3_REV:
- dstImage = (GLubyte *)malloc(memreq);
- break;
- case GL_UNSIGNED_SHORT_5_6_5:
- case GL_UNSIGNED_SHORT_5_6_5_REV:
- case GL_UNSIGNED_SHORT_4_4_4_4:
- case GL_UNSIGNED_SHORT_4_4_4_4_REV:
- case GL_UNSIGNED_SHORT_5_5_5_1:
- case GL_UNSIGNED_SHORT_1_5_5_5_REV:
- dstImage = (GLushort *)malloc(memreq);
- break;
- case GL_UNSIGNED_INT_8_8_8_8:
- case GL_UNSIGNED_INT_8_8_8_8_REV:
- case GL_UNSIGNED_INT_10_10_10_2:
- case GL_UNSIGNED_INT_2_10_10_10_REV:
- dstImage = (GLuint *)malloc(memreq);
- break;
- default:
- return GLU_INVALID_ENUM;
- }
- if (dstImage == NULL) {
- glPixelStorei(GL_UNPACK_ALIGNMENT, psm.unpack_alignment);
- glPixelStorei(GL_UNPACK_SKIP_ROWS, psm.unpack_skip_rows);
- glPixelStorei(GL_UNPACK_SKIP_PIXELS, psm.unpack_skip_pixels);
- glPixelStorei(GL_UNPACK_ROW_LENGTH, psm.unpack_row_length);
- glPixelStorei(GL_UNPACK_SWAP_BYTES, psm.unpack_swap_bytes);
- return GLU_OUT_OF_MEMORY;
- }
- else
- switch(type) {
- case GL_UNSIGNED_BYTE:
- halveImage_ubyte(cmpts, width, height,
- (const GLubyte *)usersImage, (GLubyte *)dstImage,
- element_size, rowsize, group_size);
- break;
- case GL_BYTE:
- halveImage_byte(cmpts, width, height,
- (const GLbyte *)usersImage, (GLbyte *)dstImage,
- element_size, rowsize, group_size);
- break;
- case GL_UNSIGNED_SHORT:
- halveImage_ushort(cmpts, width, height,
- (const GLushort *)usersImage, (GLushort *)dstImage,
- element_size, rowsize, group_size, myswap_bytes);
- break;
- case GL_SHORT:
- halveImage_short(cmpts, width, height,
- (const GLshort *)usersImage, (GLshort *)dstImage,
- element_size, rowsize, group_size, myswap_bytes);
- break;
- case GL_UNSIGNED_INT:
- halveImage_uint(cmpts, width, height,
- (const GLuint *)usersImage, (GLuint *)dstImage,
- element_size, rowsize, group_size, myswap_bytes);
- break;
- case GL_INT:
- halveImage_int(cmpts, width, height,
- (const GLint *)usersImage, (GLint *)dstImage,
- element_size, rowsize, group_size, myswap_bytes);
- break;
- case GL_FLOAT:
- halveImage_float(cmpts, width, height,
- (const GLfloat *)usersImage, (GLfloat *)dstImage,
- element_size, rowsize, group_size, myswap_bytes);
- break;
- case GL_UNSIGNED_BYTE_3_3_2:
- assert(format == GL_RGB);
- halveImagePackedPixel(3,extract332,shove332,
- width,height,usersImage,dstImage,
- element_size,rowsize,myswap_bytes);
- break;
- case GL_UNSIGNED_BYTE_2_3_3_REV:
- assert(format == GL_RGB);
- halveImagePackedPixel(3,extract233rev,shove233rev,
- width,height,usersImage,dstImage,
- element_size,rowsize,myswap_bytes);
- break;
- case GL_UNSIGNED_SHORT_5_6_5:
- halveImagePackedPixel(3,extract565,shove565,
- width,height,usersImage,dstImage,
- element_size,rowsize,myswap_bytes);
- break;
- case GL_UNSIGNED_SHORT_5_6_5_REV:
- halveImagePackedPixel(3,extract565rev,shove565rev,
- width,height,usersImage,dstImage,
- element_size,rowsize,myswap_bytes);
- break;
- case GL_UNSIGNED_SHORT_4_4_4_4:
- halveImagePackedPixel(4,extract4444,shove4444,
- width,height,usersImage,dstImage,
- element_size,rowsize,myswap_bytes);
- break;
- case GL_UNSIGNED_SHORT_4_4_4_4_REV:
- halveImagePackedPixel(4,extract4444rev,shove4444rev,
- width,height,usersImage,dstImage,
- element_size,rowsize,myswap_bytes);
- break;
- case GL_UNSIGNED_SHORT_5_5_5_1:
- halveImagePackedPixel(4,extract5551,shove5551,
- width,height,usersImage,dstImage,
- element_size,rowsize,myswap_bytes);
- break;
- case GL_UNSIGNED_SHORT_1_5_5_5_REV:
- halveImagePackedPixel(4,extract1555rev,shove1555rev,
- width,height,usersImage,dstImage,
- element_size,rowsize,myswap_bytes);
- break;
- case GL_UNSIGNED_INT_8_8_8_8:
- halveImagePackedPixel(4,extract8888,shove8888,
- width,height,usersImage,dstImage,
- element_size,rowsize,myswap_bytes);
- break;
- case GL_UNSIGNED_INT_8_8_8_8_REV:
- halveImagePackedPixel(4,extract8888rev,shove8888rev,
- width,height,usersImage,dstImage,
- element_size,rowsize,myswap_bytes);
- break;
- case GL_UNSIGNED_INT_10_10_10_2:
- halveImagePackedPixel(4,extract1010102,shove1010102,
- width,height,usersImage,dstImage,
- element_size,rowsize,myswap_bytes);
- break;
- case GL_UNSIGNED_INT_2_10_10_10_REV:
- halveImagePackedPixel(4,extract2101010rev,shove2101010rev,
- width,height,usersImage,dstImage,
- element_size,rowsize,myswap_bytes);
- break;
- default:
- assert(0);
- break;
- }
- newwidth = width/2;
- newheight = height/2;
- /* clamp to 1 */
- if (newwidth < 1) newwidth= 1;
- if (newheight < 1) newheight= 1;
-
- myswap_bytes = 0;
- rowsize = newwidth * group_size;
- memreq = image_size(newwidth, newheight, format, type);
- /* Swap srcImage and dstImage */
- __GLU_SWAP_IMAGE(srcImage,dstImage);
- switch(type) {
- case GL_UNSIGNED_BYTE:
- dstImage = (GLubyte *)malloc(memreq);
- break;
- case GL_BYTE:
- dstImage = (GLbyte *)malloc(memreq);
- break;
- case GL_UNSIGNED_SHORT:
- dstImage = (GLushort *)malloc(memreq);
- break;
- case GL_SHORT:
- dstImage = (GLshort *)malloc(memreq);
- break;
- case GL_UNSIGNED_INT:
- dstImage = (GLuint *)malloc(memreq);
- break;
- case GL_INT:
- dstImage = (GLint *)malloc(memreq);
- break;
- case GL_FLOAT:
- dstImage = (GLfloat *)malloc(memreq);
- break;
- case GL_UNSIGNED_BYTE_3_3_2:
- case GL_UNSIGNED_BYTE_2_3_3_REV:
- dstImage = (GLubyte *)malloc(memreq);
- break;
- case GL_UNSIGNED_SHORT_5_6_5:
- case GL_UNSIGNED_SHORT_5_6_5_REV:
- case GL_UNSIGNED_SHORT_4_4_4_4:
- case GL_UNSIGNED_SHORT_4_4_4_4_REV:
- case GL_UNSIGNED_SHORT_5_5_5_1:
- case GL_UNSIGNED_SHORT_1_5_5_5_REV:
- dstImage = (GLushort *)malloc(memreq);
- break;
- case GL_UNSIGNED_INT_8_8_8_8:
- case GL_UNSIGNED_INT_8_8_8_8_REV:
- case GL_UNSIGNED_INT_10_10_10_2:
- case GL_UNSIGNED_INT_2_10_10_10_REV:
- dstImage = (GLuint *)malloc(memreq);
- break;
- default:
- return GLU_INVALID_ENUM;
- }
- if (dstImage == NULL) {
- glPixelStorei(GL_UNPACK_ALIGNMENT, psm.unpack_alignment);
- glPixelStorei(GL_UNPACK_SKIP_ROWS, psm.unpack_skip_rows);
- glPixelStorei(GL_UNPACK_SKIP_PIXELS, psm.unpack_skip_pixels);
- glPixelStorei(GL_UNPACK_ROW_LENGTH, psm.unpack_row_length);
- glPixelStorei(GL_UNPACK_SWAP_BYTES, psm.unpack_swap_bytes);
- free(srcImage);
- return GLU_OUT_OF_MEMORY;
- }
- /* level userLevel+1 is in srcImage; level userLevel already saved */
- level = userLevel+1;
- } else { /* user's image is *not* nice power-of-2 sized square */
- memreq = image_size(newwidth, newheight, format, type);
- switch(type) {
- case GL_UNSIGNED_BYTE:
- dstImage = (GLubyte *)malloc(memreq);
- break;
- case GL_BYTE:
- dstImage = (GLbyte *)malloc(memreq);
- break;
- case GL_UNSIGNED_SHORT:
- dstImage = (GLushort *)malloc(memreq);
- break;
- case GL_SHORT:
- dstImage = (GLshort *)malloc(memreq);
- break;
- case GL_UNSIGNED_INT:
- dstImage = (GLuint *)malloc(memreq);
- break;
- case GL_INT:
- dstImage = (GLint *)malloc(memreq);
- break;
- case GL_FLOAT:
- dstImage = (GLfloat *)malloc(memreq);
- break;
- case GL_UNSIGNED_BYTE_3_3_2:
- case GL_UNSIGNED_BYTE_2_3_3_REV:
- dstImage = (GLubyte *)malloc(memreq);
- break;
- case GL_UNSIGNED_SHORT_5_6_5:
- case GL_UNSIGNED_SHORT_5_6_5_REV:
- case GL_UNSIGNED_SHORT_4_4_4_4:
- case GL_UNSIGNED_SHORT_4_4_4_4_REV:
- case GL_UNSIGNED_SHORT_5_5_5_1:
- case GL_UNSIGNED_SHORT_1_5_5_5_REV:
- dstImage = (GLushort *)malloc(memreq);
- break;
- case GL_UNSIGNED_INT_8_8_8_8:
- case GL_UNSIGNED_INT_8_8_8_8_REV:
- case GL_UNSIGNED_INT_10_10_10_2:
- case GL_UNSIGNED_INT_2_10_10_10_REV:
- dstImage = (GLuint *)malloc(memreq);
- break;
- default:
- return GLU_INVALID_ENUM;
- }
-
- if (dstImage == NULL) {
- glPixelStorei(GL_UNPACK_ALIGNMENT, psm.unpack_alignment);
- glPixelStorei(GL_UNPACK_SKIP_ROWS, psm.unpack_skip_rows);
- glPixelStorei(GL_UNPACK_SKIP_PIXELS, psm.unpack_skip_pixels);
- glPixelStorei(GL_UNPACK_ROW_LENGTH, psm.unpack_row_length);
- glPixelStorei(GL_UNPACK_SWAP_BYTES, psm.unpack_swap_bytes);
- return GLU_OUT_OF_MEMORY;
- }
-
- switch(type) {
- case GL_UNSIGNED_BYTE:
- scale_internal_ubyte(cmpts, width, height,
- (const GLubyte *)usersImage, newwidth, newheight,
- (GLubyte *)dstImage, element_size,
- rowsize, group_size);
- break;
- case GL_BYTE:
- scale_internal_byte(cmpts, width, height,
- (const GLbyte *)usersImage, newwidth, newheight,
- (GLbyte *)dstImage, element_size,
- rowsize, group_size);
- break;
- case GL_UNSIGNED_SHORT:
- scale_internal_ushort(cmpts, width, height,
- (const GLushort *)usersImage, newwidth, newheight,
- (GLushort *)dstImage, element_size,
- rowsize, group_size, myswap_bytes);
- break;
- case GL_SHORT:
- scale_internal_short(cmpts, width, height,
- (const GLshort *)usersImage, newwidth, newheight,
- (GLshort *)dstImage, element_size,
- rowsize, group_size, myswap_bytes);
- break;
- case GL_UNSIGNED_INT:
- scale_internal_uint(cmpts, width, height,
- (const GLuint *)usersImage, newwidth, newheight,
- (GLuint *)dstImage, element_size,
- rowsize, group_size, myswap_bytes);
- break;
- case GL_INT:
- scale_internal_int(cmpts, width, height,
- (const GLint *)usersImage, newwidth, newheight,
- (GLint *)dstImage, element_size,
- rowsize, group_size, myswap_bytes);
- break;
- case GL_FLOAT:
- scale_internal_float(cmpts, width, height,
- (const GLfloat *)usersImage, newwidth, newheight,
- (GLfloat *)dstImage, element_size,
- rowsize, group_size, myswap_bytes);
- break;
- case GL_UNSIGNED_BYTE_3_3_2:
- scaleInternalPackedPixel(3,extract332,shove332,
- width, height,usersImage,
- newwidth,newheight,(void *)dstImage,
- element_size,rowsize,myswap_bytes);
- break;
- case GL_UNSIGNED_BYTE_2_3_3_REV:
- scaleInternalPackedPixel(3,extract233rev,shove233rev,
- width, height,usersImage,
- newwidth,newheight,(void *)dstImage,
- element_size,rowsize,myswap_bytes);
- break;
- case GL_UNSIGNED_SHORT_5_6_5:
- scaleInternalPackedPixel(3,extract565,shove565,
- width, height,usersImage,
- newwidth,newheight,(void *)dstImage,
- element_size,rowsize,myswap_bytes);
- break;
- case GL_UNSIGNED_SHORT_5_6_5_REV:
- scaleInternalPackedPixel(3,extract565rev,shove565rev,
- width, height,usersImage,
- newwidth,newheight,(void *)dstImage,
- element_size,rowsize,myswap_bytes);
- break;
- case GL_UNSIGNED_SHORT_4_4_4_4:
- scaleInternalPackedPixel(4,extract4444,shove4444,
- width, height,usersImage,
- newwidth,newheight,(void *)dstImage,
- element_size,rowsize,myswap_bytes);
- break;
- case GL_UNSIGNED_SHORT_4_4_4_4_REV:
- scaleInternalPackedPixel(4,extract4444rev,shove4444rev,
- width, height,usersImage,
- newwidth,newheight,(void *)dstImage,
- element_size,rowsize,myswap_bytes);
- break;
- case GL_UNSIGNED_SHORT_5_5_5_1:
- scaleInternalPackedPixel(4,extract5551,shove5551,
- width, height,usersImage,
- newwidth,newheight,(void *)dstImage,
- element_size,rowsize,myswap_bytes);
- break;
- case GL_UNSIGNED_SHORT_1_5_5_5_REV:
- scaleInternalPackedPixel(4,extract1555rev,shove1555rev,
- width, height,usersImage,
- newwidth,newheight,(void *)dstImage,
- element_size,rowsize,myswap_bytes);
- break;
- case GL_UNSIGNED_INT_8_8_8_8:
- scaleInternalPackedPixel(4,extract8888,shove8888,
- width, height,usersImage,
- newwidth,newheight,(void *)dstImage,
- element_size,rowsize,myswap_bytes);
- break;
- case GL_UNSIGNED_INT_8_8_8_8_REV:
- scaleInternalPackedPixel(4,extract8888rev,shove8888rev,
- width, height,usersImage,
- newwidth,newheight,(void *)dstImage,
- element_size,rowsize,myswap_bytes);
- break;
- case GL_UNSIGNED_INT_10_10_10_2:
- scaleInternalPackedPixel(4,extract1010102,shove1010102,
- width, height,usersImage,
- newwidth,newheight,(void *)dstImage,
- element_size,rowsize,myswap_bytes);
- break;
- case GL_UNSIGNED_INT_2_10_10_10_REV:
- scaleInternalPackedPixel(4,extract2101010rev,shove2101010rev,
- width, height,usersImage,
- newwidth,newheight,(void *)dstImage,
- element_size,rowsize,myswap_bytes);
- break;
- default:
- assert(0);
- break;
- }
- myswap_bytes = 0;
- rowsize = newwidth * group_size;
- /* Swap dstImage and srcImage */
- __GLU_SWAP_IMAGE(srcImage,dstImage);
-
- if(levels != 0) { /* use as little memory as possible */
- {
- int nextWidth= newwidth/2;
- int nextHeight= newheight/2;
- if (nextWidth < 1) nextWidth= 1;
- if (nextHeight < 1) nextHeight= 1;
-
- memreq = image_size(nextWidth, nextHeight, format, type);
- }
-
- switch(type) {
- case GL_UNSIGNED_BYTE:
- dstImage = (GLubyte *)malloc(memreq);
- break;
- case GL_BYTE:
- dstImage = (GLbyte *)malloc(memreq);
- break;
- case GL_UNSIGNED_SHORT:
- dstImage = (GLushort *)malloc(memreq);
- break;
- case GL_SHORT:
- dstImage = (GLshort *)malloc(memreq);
- break;
- case GL_UNSIGNED_INT:
- dstImage = (GLuint *)malloc(memreq);
- break;
- case GL_INT:
- dstImage = (GLint *)malloc(memreq);
- break;
- case GL_FLOAT:
- dstImage = (GLfloat *)malloc(memreq);
- break;
- case GL_UNSIGNED_BYTE_3_3_2:
- case GL_UNSIGNED_BYTE_2_3_3_REV:
- dstImage = (GLubyte *)malloc(memreq);
- break;
- case GL_UNSIGNED_SHORT_5_6_5:
- case GL_UNSIGNED_SHORT_5_6_5_REV:
- case GL_UNSIGNED_SHORT_4_4_4_4:
- case GL_UNSIGNED_SHORT_4_4_4_4_REV:
- case GL_UNSIGNED_SHORT_5_5_5_1:
- case GL_UNSIGNED_SHORT_1_5_5_5_REV:
- dstImage = (GLushort *)malloc(memreq);
- break;
- case GL_UNSIGNED_INT_8_8_8_8:
- case GL_UNSIGNED_INT_8_8_8_8_REV:
- case GL_UNSIGNED_INT_10_10_10_2:
- case GL_UNSIGNED_INT_2_10_10_10_REV:
- dstImage = (GLuint *)malloc(memreq);
- break;
- default:
- return GLU_INVALID_ENUM;
- }
- if (dstImage == NULL) {
- glPixelStorei(GL_UNPACK_ALIGNMENT, psm.unpack_alignment);
- glPixelStorei(GL_UNPACK_SKIP_ROWS, psm.unpack_skip_rows);
- glPixelStorei(GL_UNPACK_SKIP_PIXELS, psm.unpack_skip_pixels);
- glPixelStorei(GL_UNPACK_ROW_LENGTH, psm.unpack_row_length);
- glPixelStorei(GL_UNPACK_SWAP_BYTES, psm.unpack_swap_bytes);
- free(srcImage);
- return GLU_OUT_OF_MEMORY;
- }
- }
- /* level userLevel is in srcImage; nothing saved yet */
- level = userLevel;
- }
-
- glPixelStorei(GL_UNPACK_SWAP_BYTES, GL_FALSE);
- if (baseLevel <= level && level <= maxLevel) {
- glTexImage2D(target, level, internalFormat, newwidth, newheight, 0,
- format, type, (void *)srcImage);
- }
-
- level++; /* update current level for the loop */
- for (; level <= levels; level++) {
- switch(type) {
- case GL_UNSIGNED_BYTE:
- halveImage_ubyte(cmpts, newwidth, newheight,
- (GLubyte *)srcImage, (GLubyte *)dstImage, element_size,
- rowsize, group_size);
- break;
- case GL_BYTE:
- halveImage_byte(cmpts, newwidth, newheight,
- (GLbyte *)srcImage, (GLbyte *)dstImage, element_size,
- rowsize, group_size);
- break;
- case GL_UNSIGNED_SHORT:
- halveImage_ushort(cmpts, newwidth, newheight,
- (GLushort *)srcImage, (GLushort *)dstImage, element_size,
- rowsize, group_size, myswap_bytes);
- break;
- case GL_SHORT:
- halveImage_short(cmpts, newwidth, newheight,
- (GLshort *)srcImage, (GLshort *)dstImage, element_size,
- rowsize, group_size, myswap_bytes);
- break;
- case GL_UNSIGNED_INT:
- halveImage_uint(cmpts, newwidth, newheight,
- (GLuint *)srcImage, (GLuint *)dstImage, element_size,
- rowsize, group_size, myswap_bytes);
- break;
- case GL_INT:
- halveImage_int(cmpts, newwidth, newheight,
- (GLint *)srcImage, (GLint *)dstImage, element_size,
- rowsize, group_size, myswap_bytes);
- break;
- case GL_FLOAT:
- halveImage_float(cmpts, newwidth, newheight,
- (GLfloat *)srcImage, (GLfloat *)dstImage, element_size,
- rowsize, group_size, myswap_bytes);
- break;
- case GL_UNSIGNED_BYTE_3_3_2:
- halveImagePackedPixel(3,extract332,shove332,
- newwidth,newheight,
- srcImage,dstImage,element_size,rowsize,
- myswap_bytes);
- break;
- case GL_UNSIGNED_BYTE_2_3_3_REV:
- halveImagePackedPixel(3,extract233rev,shove233rev,
- newwidth,newheight,
- srcImage,dstImage,element_size,rowsize,
- myswap_bytes);
- break;
- case GL_UNSIGNED_SHORT_5_6_5:
- halveImagePackedPixel(3,extract565,shove565,
- newwidth,newheight,
- srcImage,dstImage,element_size,rowsize,
- myswap_bytes);
- break;
- case GL_UNSIGNED_SHORT_5_6_5_REV:
- halveImagePackedPixel(3,extract565rev,shove565rev,
- newwidth,newheight,
- srcImage,dstImage,element_size,rowsize,
- myswap_bytes);
- break;
- case GL_UNSIGNED_SHORT_4_4_4_4:
- halveImagePackedPixel(4,extract4444,shove4444,
- newwidth,newheight,
- srcImage,dstImage,element_size,rowsize,
- myswap_bytes);
- break;
- case GL_UNSIGNED_SHORT_4_4_4_4_REV:
- halveImagePackedPixel(4,extract4444rev,shove4444rev,
- newwidth,newheight,
- srcImage,dstImage,element_size,rowsize,
- myswap_bytes);
- break;
- case GL_UNSIGNED_SHORT_5_5_5_1:
- halveImagePackedPixel(4,extract5551,shove5551,
- newwidth,newheight,
- srcImage,dstImage,element_size,rowsize,
- myswap_bytes);
- break;
- case GL_UNSIGNED_SHORT_1_5_5_5_REV:
- halveImagePackedPixel(4,extract1555rev,shove1555rev,
- newwidth,newheight,
- srcImage,dstImage,element_size,rowsize,
- myswap_bytes);
- break;
- case GL_UNSIGNED_INT_8_8_8_8:
- halveImagePackedPixel(4,extract8888,shove8888,
- newwidth,newheight,
- srcImage,dstImage,element_size,rowsize,
- myswap_bytes);
- break;
- case GL_UNSIGNED_INT_8_8_8_8_REV:
- halveImagePackedPixel(4,extract8888rev,shove8888rev,
- newwidth,newheight,
- srcImage,dstImage,element_size,rowsize,
- myswap_bytes);
- break;
- case GL_UNSIGNED_INT_10_10_10_2:
- halveImagePackedPixel(4,extract1010102,shove1010102,
- newwidth,newheight,
- srcImage,dstImage,element_size,rowsize,
- myswap_bytes);
- break;
- case GL_UNSIGNED_INT_2_10_10_10_REV:
- halveImagePackedPixel(4,extract2101010rev,shove2101010rev,
- newwidth,newheight,
- srcImage,dstImage,element_size,rowsize,
- myswap_bytes);
- break;
- default:
- assert(0);
- break;
- }
-
- __GLU_SWAP_IMAGE(srcImage,dstImage);
-
- if (newwidth > 1) { newwidth /= 2; rowsize /= 2;}
- if (newheight > 1) newheight /= 2;
- {
- /* compute amount to pad per row, if any */
- int rowPad= rowsize % psm.unpack_alignment;
-
- /* should row be padded? */
- if (rowPad == 0) { /* nope, row should not be padded */
- /* call tex image with srcImage untouched since it's not padded */
- if (baseLevel <= level && level <= maxLevel) {
- glTexImage2D(target, level, internalFormat, newwidth, newheight, 0,
- format, type, (void *) srcImage);
- }
- }
- else { /* yes, row should be padded */
- /* compute length of new row in bytes, including padding */
- int newRowLength= rowsize + psm.unpack_alignment - rowPad;
- int ii; unsigned char *dstTrav, *srcTrav; /* indices for copying */
-
- /* allocate new image for mipmap of size newRowLength x newheight */
- void *newMipmapImage= malloc((size_t) (newRowLength*newheight));
- if (newMipmapImage == NULL) {
- /* out of memory so return */
- glPixelStorei(GL_UNPACK_ALIGNMENT, psm.unpack_alignment);
- glPixelStorei(GL_UNPACK_SKIP_ROWS, psm.unpack_skip_rows);
- glPixelStorei(GL_UNPACK_SKIP_PIXELS, psm.unpack_skip_pixels);
- glPixelStorei(GL_UNPACK_ROW_LENGTH, psm.unpack_row_length);
- glPixelStorei(GL_UNPACK_SWAP_BYTES, psm.unpack_swap_bytes);
- return GLU_OUT_OF_MEMORY;
- }
-
- /* copy image from srcImage into newMipmapImage by rows */
- for (ii= 0,
- dstTrav= (unsigned char *) newMipmapImage,
- srcTrav= (unsigned char *) srcImage;
- ii< newheight;
- ii++,
- dstTrav+= newRowLength, /* make sure the correct distance... */
- srcTrav+= rowsize) { /* ...is skipped */
- memcpy(dstTrav,srcTrav,rowsize);
- /* note that the pad bytes are not visited and will contain
- * garbage, which is ok.
- */
- }
-
- /* ...and use this new image for mipmapping instead */
- if (baseLevel <= level && level <= maxLevel) {
- glTexImage2D(target, level, internalFormat, newwidth, newheight, 0,
- format, type, newMipmapImage);
- }
- free(newMipmapImage); /* don't forget to free it! */
- } /* else */
- }
- } /* for level */
- glPixelStorei(GL_UNPACK_ALIGNMENT, psm.unpack_alignment);
- glPixelStorei(GL_UNPACK_SKIP_ROWS, psm.unpack_skip_rows);
- glPixelStorei(GL_UNPACK_SKIP_PIXELS, psm.unpack_skip_pixels);
- glPixelStorei(GL_UNPACK_ROW_LENGTH, psm.unpack_row_length);
- glPixelStorei(GL_UNPACK_SWAP_BYTES, psm.unpack_swap_bytes);
-
- free(srcImage); /*if you get to here, a srcImage has always been malloc'ed*/
- if (dstImage) { /* if it's non-rectangular and only 1 level */
- free(dstImage);
- }
- return 0;
-} /* gluBuild2DMipmapLevelsCore() */
-
-GLint GLAPIENTRY
-gluBuild2DMipmapLevels(GLenum target, GLint internalFormat,
- GLsizei width, GLsizei height,
- GLenum format, GLenum type,
- GLint userLevel, GLint baseLevel, GLint maxLevel,
- const void *data)
-{
- int level, levels;
-
- int rc= checkMipmapArgs(internalFormat,format,type);
- if (rc != 0) return rc;
-
- if (width < 1 || height < 1) {
- return GLU_INVALID_VALUE;
- }
-
- levels = computeLog(width);
- level = computeLog(height);
- if (level > levels) levels=level;
-
- levels+= userLevel;
- if (!isLegalLevels(userLevel,baseLevel,maxLevel,levels))
- return GLU_INVALID_VALUE;
-
- return gluBuild2DMipmapLevelsCore(target, internalFormat,
- width, height,
- width, height,
- format, type,
- userLevel, baseLevel, maxLevel,
- data);
-} /* gluBuild2DMipmapLevels() */
-
-GLint GLAPIENTRY
-gluBuild2DMipmaps(GLenum target, GLint internalFormat,
- GLsizei width, GLsizei height,
- GLenum format, GLenum type,
- const void *data)
-{
- GLint widthPowerOf2, heightPowerOf2;
- int level, levels;
-
- int rc= checkMipmapArgs(internalFormat,format,type);
- if (rc != 0) return rc;
-
- if (width < 1 || height < 1) {
- return GLU_INVALID_VALUE;
- }
-
- closestFit(target,width,height,internalFormat,format,type,
- &widthPowerOf2,&heightPowerOf2);
-
- levels = computeLog(widthPowerOf2);
- level = computeLog(heightPowerOf2);
- if (level > levels) levels=level;
-
- return gluBuild2DMipmapLevelsCore(target,internalFormat,
- width, height,
- widthPowerOf2,heightPowerOf2,
- format,type,
- 0,0,levels,data);
-} /* gluBuild2DMipmaps() */
-
-#if 0
-/*
-** This routine is for the limited case in which
-** type == GL_UNSIGNED_BYTE && format != index &&
-** unpack_alignment = 1 && unpack_swap_bytes == false
-**
-** so all of the work data can be kept as ubytes instead of shorts.
-*/
-static int fastBuild2DMipmaps(const PixelStorageModes *psm,
- GLenum target, GLint components, GLint width,
- GLint height, GLenum format,
- GLenum type, void *data)
-{
- GLint newwidth, newheight;
- GLint level, levels;
- GLubyte *newImage;
- GLint newImage_width;
- GLint newImage_height;
- GLubyte *otherImage;
- GLubyte *imageTemp;
- GLint memreq;
- GLint cmpts;
-
-
-#if 0
- glGetIntegerv(GL_MAX_TEXTURE_SIZE, &maxsize);
- newwidth = nearestPower(width);
- if (newwidth > maxsize) newwidth = maxsize;
- newheight = nearestPower(height);
- if (newheight > maxsize) newheight = maxsize;
-#else
- closestFit(target,width,height,components,format,type,
- &newwidth,&newheight);
-#endif
- levels = computeLog(newwidth);
- level = computeLog(newheight);
- if (level > levels) levels=level;
-
- cmpts = elements_per_group(format,type);
-
- otherImage = NULL;
- /**
- ** No need to copy the user data if its in the packed correctly.
- ** Make sure that later routines don't change that data.
- */
- if (psm->unpack_skip_rows == 0 && psm->unpack_skip_pixels == 0) {
- newImage = (GLubyte *)data;
- newImage_width = width;
- newImage_height = height;
- } else {
- GLint rowsize;
- GLint groups_per_line;
- GLint elements_per_line;
- const GLubyte *start;
- const GLubyte *iter;
- GLubyte *iter2;
- GLint i, j;
-
- newImage = (GLubyte *)
- malloc(image_size(width, height, format, GL_UNSIGNED_BYTE));
- newImage_width = width;
- newImage_height = height;
- if (newImage == NULL) {
- return GLU_OUT_OF_MEMORY;
- }
-
- /*
- ** Abbreviated version of fill_image for this restricted case.
- */
- if (psm->unpack_row_length > 0) {
- groups_per_line = psm->unpack_row_length;
- } else {
- groups_per_line = width;
- }
- rowsize = groups_per_line * cmpts;
- elements_per_line = width * cmpts;
- start = (const GLubyte *) data + psm->unpack_skip_rows * rowsize +
- psm->unpack_skip_pixels * cmpts;
- iter2 = newImage;
-
- for (i = 0; i < height; i++) {
- iter = start;
- for (j = 0; j < elements_per_line; j++) {
- *iter2 = *iter;
- iter++;
- iter2++;
- }
- start += rowsize;
- }
- }
-
-
- glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
- glPixelStorei(GL_UNPACK_SKIP_ROWS, 0);
- glPixelStorei(GL_UNPACK_SKIP_PIXELS, 0);
- glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
- glPixelStorei(GL_UNPACK_SWAP_BYTES, GL_FALSE);
-
- for (level = 0; level <= levels; level++) {
- if (newImage_width == newwidth && newImage_height == newheight) {
- /* Use newImage for this level */
- glTexImage2D(target, level, components, newImage_width,
- newImage_height, 0, format, GL_UNSIGNED_BYTE,
- (void *) newImage);
- } else {
- if (otherImage == NULL) {
- memreq =
- image_size(newwidth, newheight, format, GL_UNSIGNED_BYTE);
- otherImage = (GLubyte *) malloc(memreq);
- if (otherImage == NULL) {
- glPixelStorei(GL_UNPACK_ALIGNMENT, psm->unpack_alignment);
- glPixelStorei(GL_UNPACK_SKIP_ROWS, psm->unpack_skip_rows);
- glPixelStorei(GL_UNPACK_SKIP_PIXELS, psm->unpack_skip_pixels);
- glPixelStorei(GL_UNPACK_ROW_LENGTH,psm->unpack_row_length);
- glPixelStorei(GL_UNPACK_SWAP_BYTES,psm->unpack_swap_bytes);
- return GLU_OUT_OF_MEMORY;
- }
- }
-/*
- scale_internal_ubyte(cmpts, newImage_width, newImage_height,
- newImage, newwidth, newheight, otherImage);
-*/
- /* Swap newImage and otherImage */
- imageTemp = otherImage;
- otherImage = newImage;
- newImage = imageTemp;
-
- newImage_width = newwidth;
- newImage_height = newheight;
- glTexImage2D(target, level, components, newImage_width,
- newImage_height, 0, format, GL_UNSIGNED_BYTE,
- (void *) newImage);
- }
- if (newwidth > 1) newwidth /= 2;
- if (newheight > 1) newheight /= 2;
- }
- glPixelStorei(GL_UNPACK_ALIGNMENT, psm->unpack_alignment);
- glPixelStorei(GL_UNPACK_SKIP_ROWS, psm->unpack_skip_rows);
- glPixelStorei(GL_UNPACK_SKIP_PIXELS, psm->unpack_skip_pixels);
- glPixelStorei(GL_UNPACK_ROW_LENGTH, psm->unpack_row_length);
- glPixelStorei(GL_UNPACK_SWAP_BYTES, psm->unpack_swap_bytes);
-
- if (newImage != (const GLubyte *)data) {
- free((GLbyte *) newImage);
- }
- if (otherImage && otherImage != (const GLubyte *)data) {
- free((GLbyte *) otherImage);
- }
- return 0;
-}
-#endif
-
-/*
- * Utility Routines
- */
-static GLint elements_per_group(GLenum format, GLenum type)
-{
- /*
- * Return the number of elements per group of a specified format
- */
-
- /* If the type is packedpixels then answer is 1 (ignore format) */
- if (type == GL_UNSIGNED_BYTE_3_3_2 ||
- type == GL_UNSIGNED_BYTE_2_3_3_REV ||
- type == GL_UNSIGNED_SHORT_5_6_5 ||
- type == GL_UNSIGNED_SHORT_5_6_5_REV ||
- type == GL_UNSIGNED_SHORT_4_4_4_4 ||
- type == GL_UNSIGNED_SHORT_4_4_4_4_REV ||
- type == GL_UNSIGNED_SHORT_5_5_5_1 ||
- type == GL_UNSIGNED_SHORT_1_5_5_5_REV ||
- type == GL_UNSIGNED_INT_8_8_8_8 ||
- type == GL_UNSIGNED_INT_8_8_8_8_REV ||
- type == GL_UNSIGNED_INT_10_10_10_2 ||
- type == GL_UNSIGNED_INT_2_10_10_10_REV) {
- return 1;
- }
-
- /* Types are not packed pixels, so get elements per group */
- switch(format) {
- case GL_RGB:
- case GL_BGR:
- return 3;
- case GL_LUMINANCE_ALPHA:
- return 2;
- case GL_RGBA:
- case GL_BGRA:
- return 4;
- default:
- return 1;
- }
-}
-
-static GLfloat bytes_per_element(GLenum type)
-{
- /*
- * Return the number of bytes per element, based on the element type
- */
- switch(type) {
- case GL_BITMAP:
- return 1.0 / 8.0;
- case GL_UNSIGNED_SHORT:
- return(sizeof(GLushort));
- case GL_SHORT:
- return(sizeof(GLshort));
- case GL_UNSIGNED_BYTE:
- return(sizeof(GLubyte));
- case GL_BYTE:
- return(sizeof(GLbyte));
- case GL_INT:
- return(sizeof(GLint));
- case GL_UNSIGNED_INT:
- return(sizeof(GLuint));
- case GL_FLOAT:
- return(sizeof(GLfloat));
- case GL_UNSIGNED_BYTE_3_3_2:
- case GL_UNSIGNED_BYTE_2_3_3_REV:
- return(sizeof(GLubyte));
- case GL_UNSIGNED_SHORT_5_6_5:
- case GL_UNSIGNED_SHORT_5_6_5_REV:
- case GL_UNSIGNED_SHORT_4_4_4_4:
- case GL_UNSIGNED_SHORT_4_4_4_4_REV:
- case GL_UNSIGNED_SHORT_5_5_5_1:
- case GL_UNSIGNED_SHORT_1_5_5_5_REV:
- return(sizeof(GLushort));
- case GL_UNSIGNED_INT_8_8_8_8:
- case GL_UNSIGNED_INT_8_8_8_8_REV:
- case GL_UNSIGNED_INT_10_10_10_2:
- case GL_UNSIGNED_INT_2_10_10_10_REV:
- return(sizeof(GLuint));
- default:
- return 4;
- }
-}
-
-static GLint is_index(GLenum format)
-{
- return format == GL_COLOR_INDEX || format == GL_STENCIL_INDEX;
-}
-
-/*
-** Compute memory required for internal packed array of data of given type
-** and format.
-*/
-static GLint image_size(GLint width, GLint height, GLenum format, GLenum type)
-{
- int bytes_per_row;
- int components;
-
-assert(width > 0);
-assert(height > 0);
- components = elements_per_group(format,type);
- if (type == GL_BITMAP) {
- bytes_per_row = (width + 7) / 8;
- } else {
- bytes_per_row = bytes_per_element(type) * width;
- }
- return bytes_per_row * height * components;
-}
-
-/*
-** Extract array from user's data applying all pixel store modes.
-** The internal format used is an array of unsigned shorts.
-*/
-static void fill_image(const PixelStorageModes *psm,
- GLint width, GLint height, GLenum format,
- GLenum type, GLboolean index_format,
- const void *userdata, GLushort *newimage)
-{
- GLint components;
- GLint element_size;
- GLint rowsize;
- GLint padding;
- GLint groups_per_line;
- GLint group_size;
- GLint elements_per_line;
- const GLubyte *start;
- const GLubyte *iter;
- GLushort *iter2;
- GLint i, j, k;
- GLint myswap_bytes;
-
- myswap_bytes = psm->unpack_swap_bytes;
- components = elements_per_group(format,type);
- if (psm->unpack_row_length > 0) {
- groups_per_line = psm->unpack_row_length;
- } else {
- groups_per_line = width;
- }
-
- /* All formats except GL_BITMAP fall out trivially */
- if (type == GL_BITMAP) {
- GLint bit_offset;
- GLint current_bit;
-
- rowsize = (groups_per_line * components + 7) / 8;
- padding = (rowsize % psm->unpack_alignment);
- if (padding) {
- rowsize += psm->unpack_alignment - padding;
- }
- start = (const GLubyte *) userdata + psm->unpack_skip_rows * rowsize +
- (psm->unpack_skip_pixels * components / 8);
- elements_per_line = width * components;
- iter2 = newimage;
- for (i = 0; i < height; i++) {
- iter = start;
- bit_offset = (psm->unpack_skip_pixels * components) % 8;
- for (j = 0; j < elements_per_line; j++) {
- /* Retrieve bit */
- if (psm->unpack_lsb_first) {
- current_bit = iter[0] & (1 << bit_offset);
- } else {
- current_bit = iter[0] & (1 << (7 - bit_offset));
- }
- if (current_bit) {
- if (index_format) {
- *iter2 = 1;
- } else {
- *iter2 = 65535;
- }
- } else {
- *iter2 = 0;
- }
- bit_offset++;
- if (bit_offset == 8) {
- bit_offset = 0;
- iter++;
- }
- iter2++;
- }
- start += rowsize;
- }
- } else {
- element_size = bytes_per_element(type);
- group_size = element_size * components;
- if (element_size == 1) myswap_bytes = 0;
-
- rowsize = groups_per_line * group_size;
- padding = (rowsize % psm->unpack_alignment);
- if (padding) {
- rowsize += psm->unpack_alignment - padding;
- }
- start = (const GLubyte *) userdata + psm->unpack_skip_rows * rowsize +
- psm->unpack_skip_pixels * group_size;
- elements_per_line = width * components;
-
- iter2 = newimage;
- for (i = 0; i < height; i++) {
- iter = start;
- for (j = 0; j < elements_per_line; j++) {
- Type_Widget widget;
- float extractComponents[4];
-
- switch(type) {
- case GL_UNSIGNED_BYTE_3_3_2:
- extract332(0,iter,extractComponents);
- for (k = 0; k < 3; k++) {
- *iter2++ = (GLushort)(extractComponents[k]*65535);
- }
- break;
- case GL_UNSIGNED_BYTE_2_3_3_REV:
- extract233rev(0,iter,extractComponents);
- for (k = 0; k < 3; k++) {
- *iter2++ = (GLushort)(extractComponents[k]*65535);
- }
- break;
- case GL_UNSIGNED_BYTE:
- if (index_format) {
- *iter2++ = *iter;
- } else {
- *iter2++ = (*iter) * 257;
- }
- break;
- case GL_BYTE:
- if (index_format) {
- *iter2++ = *((const GLbyte *) iter);
- } else {
- /* rough approx */
- *iter2++ = (*((const GLbyte *) iter)) * 516;
- }
- break;
- case GL_UNSIGNED_SHORT_5_6_5:
- extract565(myswap_bytes,iter,extractComponents);
- for (k = 0; k < 3; k++) {
- *iter2++ = (GLushort)(extractComponents[k]*65535);
- }
- break;
- case GL_UNSIGNED_SHORT_5_6_5_REV:
- extract565rev(myswap_bytes,iter,extractComponents);
- for (k = 0; k < 3; k++) {
- *iter2++ = (GLushort)(extractComponents[k]*65535);
- }
- break;
- case GL_UNSIGNED_SHORT_4_4_4_4:
- extract4444(myswap_bytes,iter,extractComponents);
- for (k = 0; k < 4; k++) {
- *iter2++ = (GLushort)(extractComponents[k]*65535);
- }
- break;
- case GL_UNSIGNED_SHORT_4_4_4_4_REV:
- extract4444rev(myswap_bytes,iter,extractComponents);
- for (k = 0; k < 4; k++) {
- *iter2++ = (GLushort)(extractComponents[k]*65535);
- }
- break;
- case GL_UNSIGNED_SHORT_5_5_5_1:
- extract5551(myswap_bytes,iter,extractComponents);
- for (k = 0; k < 4; k++) {
- *iter2++ = (GLushort)(extractComponents[k]*65535);
- }
- break;
- case GL_UNSIGNED_SHORT_1_5_5_5_REV:
- extract1555rev(myswap_bytes,iter,extractComponents);
- for (k = 0; k < 4; k++) {
- *iter2++ = (GLushort)(extractComponents[k]*65535);
- }
- break;
- case GL_UNSIGNED_SHORT:
- case GL_SHORT:
- if (myswap_bytes) {
- widget.ub[0] = iter[1];
- widget.ub[1] = iter[0];
- } else {
- widget.ub[0] = iter[0];
- widget.ub[1] = iter[1];
- }
- if (type == GL_SHORT) {
- if (index_format) {
- *iter2++ = widget.s[0];
- } else {
- /* rough approx */
- *iter2++ = widget.s[0]*2;
- }
- } else {
- *iter2++ = widget.us[0];
- }
- break;
- case GL_UNSIGNED_INT_8_8_8_8:
- extract8888(myswap_bytes,iter,extractComponents);
- for (k = 0; k < 4; k++) {
- *iter2++ = (GLushort)(extractComponents[k]*65535);
- }
- break;
- case GL_UNSIGNED_INT_8_8_8_8_REV:
- extract8888rev(myswap_bytes,iter,extractComponents);
- for (k = 0; k < 4; k++) {
- *iter2++ = (GLushort)(extractComponents[k]*65535);
- }
- break;
- case GL_UNSIGNED_INT_10_10_10_2:
- extract1010102(myswap_bytes,iter,extractComponents);
- for (k = 0; k < 4; k++) {
- *iter2++ = (GLushort)(extractComponents[k]*65535);
- }
- break;
- case GL_UNSIGNED_INT_2_10_10_10_REV:
- extract2101010rev(myswap_bytes,iter,extractComponents);
- for (k = 0; k < 4; k++) {
- *iter2++ = (GLushort)(extractComponents[k]*65535);
- }
- break;
- case GL_INT:
- case GL_UNSIGNED_INT:
- case GL_FLOAT:
- if (myswap_bytes) {
- widget.ub[0] = iter[3];
- widget.ub[1] = iter[2];
- widget.ub[2] = iter[1];
- widget.ub[3] = iter[0];
- } else {
- widget.ub[0] = iter[0];
- widget.ub[1] = iter[1];
- widget.ub[2] = iter[2];
- widget.ub[3] = iter[3];
- }
- if (type == GL_FLOAT) {
- if (index_format) {
- *iter2++ = widget.f;
- } else {
- *iter2++ = 65535 * widget.f;
- }
- } else if (type == GL_UNSIGNED_INT) {
- if (index_format) {
- *iter2++ = widget.ui;
- } else {
- *iter2++ = widget.ui >> 16;
- }
- } else {
- if (index_format) {
- *iter2++ = widget.i;
- } else {
- *iter2++ = widget.i >> 15;
- }
- }
- break;
- }
- iter += element_size;
- } /* for j */
- start += rowsize;
-#if 1
- /* want 'iter' pointing at start, not within, row for assertion
- * purposes
- */
- iter= start;
-#endif
- } /* for i */
-
- /* iterators should be one byte past end */
- if (!isTypePackedPixel(type)) {
- assert(iter2 == &newimage[width*height*components]);
- }
- else {
- assert(iter2 == &newimage[width*height*
- elements_per_group(format,0)]);
- }
- assert( iter == &((const GLubyte *)userdata)[rowsize*height +
- psm->unpack_skip_rows * rowsize +
- psm->unpack_skip_pixels * group_size] );
-
- } /* else */
-} /* fill_image() */
-
-/*
-** Insert array into user's data applying all pixel store modes.
-** The internal format is an array of unsigned shorts.
-** empty_image() because it is the opposite of fill_image().
-*/
-static void empty_image(const PixelStorageModes *psm,
- GLint width, GLint height, GLenum format,
- GLenum type, GLboolean index_format,
- const GLushort *oldimage, void *userdata)
-{
- GLint components;
- GLint element_size;
- GLint rowsize;
- GLint padding;
- GLint groups_per_line;
- GLint group_size;
- GLint elements_per_line;
- GLubyte *start;
- GLubyte *iter;
- const GLushort *iter2;
- GLint i, j, k;
- GLint myswap_bytes;
-
- myswap_bytes = psm->pack_swap_bytes;
- components = elements_per_group(format,type);
- if (psm->pack_row_length > 0) {
- groups_per_line = psm->pack_row_length;
- } else {
- groups_per_line = width;
- }
-
- /* All formats except GL_BITMAP fall out trivially */
- if (type == GL_BITMAP) {
- GLint bit_offset;
- GLint current_bit;
-
- rowsize = (groups_per_line * components + 7) / 8;
- padding = (rowsize % psm->pack_alignment);
- if (padding) {
- rowsize += psm->pack_alignment - padding;
- }
- start = (GLubyte *) userdata + psm->pack_skip_rows * rowsize +
- (psm->pack_skip_pixels * components / 8);
- elements_per_line = width * components;
- iter2 = oldimage;
- for (i = 0; i < height; i++) {
- iter = start;
- bit_offset = (psm->pack_skip_pixels * components) % 8;
- for (j = 0; j < elements_per_line; j++) {
- if (index_format) {
- current_bit = iter2[0] & 1;
- } else {
- if (iter2[0] > 32767) {
- current_bit = 1;
- } else {
- current_bit = 0;
- }
- }
-
- if (current_bit) {
- if (psm->pack_lsb_first) {
- *iter |= (1 << bit_offset);
- } else {
- *iter |= (1 << (7 - bit_offset));
- }
- } else {
- if (psm->pack_lsb_first) {
- *iter &= ~(1 << bit_offset);
- } else {
- *iter &= ~(1 << (7 - bit_offset));
- }
- }
-
- bit_offset++;
- if (bit_offset == 8) {
- bit_offset = 0;
- iter++;
- }
- iter2++;
- }
- start += rowsize;
- }
- } else {
- float shoveComponents[4];
-
- element_size = bytes_per_element(type);
- group_size = element_size * components;
- if (element_size == 1) myswap_bytes = 0;
-
- rowsize = groups_per_line * group_size;
- padding = (rowsize % psm->pack_alignment);
- if (padding) {
- rowsize += psm->pack_alignment - padding;
- }
- start = (GLubyte *) userdata + psm->pack_skip_rows * rowsize +
- psm->pack_skip_pixels * group_size;
- elements_per_line = width * components;
-
- iter2 = oldimage;
- for (i = 0; i < height; i++) {
- iter = start;
- for (j = 0; j < elements_per_line; j++) {
- Type_Widget widget;
-
- switch(type) {
- case GL_UNSIGNED_BYTE_3_3_2:
- for (k = 0; k < 3; k++) {
- shoveComponents[k]= *iter2++ / 65535.0;
- }
- shove332(shoveComponents,0,(void *)iter);
- break;
- case GL_UNSIGNED_BYTE_2_3_3_REV:
- for (k = 0; k < 3; k++) {
- shoveComponents[k]= *iter2++ / 65535.0;
- }
- shove233rev(shoveComponents,0,(void *)iter);
- break;
- case GL_UNSIGNED_BYTE:
- if (index_format) {
- *iter = *iter2++;
- } else {
- *iter = *iter2++ >> 8;
- }
- break;
- case GL_BYTE:
- if (index_format) {
- *((GLbyte *) iter) = *iter2++;
- } else {
- *((GLbyte *) iter) = *iter2++ >> 9;
- }
- break;
- case GL_UNSIGNED_SHORT_5_6_5:
- for (k = 0; k < 3; k++) {
- shoveComponents[k]= *iter2++ / 65535.0;
- }
- shove565(shoveComponents,0,(void *)&widget.us[0]);
- if (myswap_bytes) {
- iter[0] = widget.ub[1];
- iter[1] = widget.ub[0];
- }
- else {
- *(GLushort *)iter = widget.us[0];
- }
- break;
- case GL_UNSIGNED_SHORT_5_6_5_REV:
- for (k = 0; k < 3; k++) {
- shoveComponents[k]= *iter2++ / 65535.0;
- }
- shove565rev(shoveComponents,0,(void *)&widget.us[0]);
- if (myswap_bytes) {
- iter[0] = widget.ub[1];
- iter[1] = widget.ub[0];
- }
- else {
- *(GLushort *)iter = widget.us[0];
- }
- break;
- case GL_UNSIGNED_SHORT_4_4_4_4:
- for (k = 0; k < 4; k++) {
- shoveComponents[k]= *iter2++ / 65535.0;
- }
- shove4444(shoveComponents,0,(void *)&widget.us[0]);
- if (myswap_bytes) {
- iter[0] = widget.ub[1];
- iter[1] = widget.ub[0];
- } else {
- *(GLushort *)iter = widget.us[0];
- }
- break;
- case GL_UNSIGNED_SHORT_4_4_4_4_REV:
- for (k = 0; k < 4; k++) {
- shoveComponents[k]= *iter2++ / 65535.0;
- }
- shove4444rev(shoveComponents,0,(void *)&widget.us[0]);
- if (myswap_bytes) {
- iter[0] = widget.ub[1];
- iter[1] = widget.ub[0];
- } else {
- *(GLushort *)iter = widget.us[0];
- }
- break;
- case GL_UNSIGNED_SHORT_5_5_5_1:
- for (k = 0; k < 4; k++) {
- shoveComponents[k]= *iter2++ / 65535.0;
- }
- shove5551(shoveComponents,0,(void *)&widget.us[0]);
- if (myswap_bytes) {
- iter[0] = widget.ub[1];
- iter[1] = widget.ub[0];
- } else {
- *(GLushort *)iter = widget.us[0];
- }
- break;
- case GL_UNSIGNED_SHORT_1_5_5_5_REV:
- for (k = 0; k < 4; k++) {
- shoveComponents[k]= *iter2++ / 65535.0;
- }
- shove1555rev(shoveComponents,0,(void *)&widget.us[0]);
- if (myswap_bytes) {
- iter[0] = widget.ub[1];
- iter[1] = widget.ub[0];
- } else {
- *(GLushort *)iter = widget.us[0];
- }
- break;
- case GL_UNSIGNED_SHORT:
- case GL_SHORT:
- if (type == GL_SHORT) {
- if (index_format) {
- widget.s[0] = *iter2++;
- } else {
- widget.s[0] = *iter2++ >> 1;
- }
- } else {
- widget.us[0] = *iter2++;
- }
- if (myswap_bytes) {
- iter[0] = widget.ub[1];
- iter[1] = widget.ub[0];
- } else {
- iter[0] = widget.ub[0];
- iter[1] = widget.ub[1];
- }
- break;
- case GL_UNSIGNED_INT_8_8_8_8:
- for (k = 0; k < 4; k++) {
- shoveComponents[k]= *iter2++ / 65535.0;
- }
- shove8888(shoveComponents,0,(void *)&widget.ui);
- if (myswap_bytes) {
- iter[3] = widget.ub[0];
- iter[2] = widget.ub[1];
- iter[1] = widget.ub[2];
- iter[0] = widget.ub[3];
- } else {
- *(GLuint *)iter= widget.ui;
- }
-
- break;
- case GL_UNSIGNED_INT_8_8_8_8_REV:
- for (k = 0; k < 4; k++) {
- shoveComponents[k]= *iter2++ / 65535.0;
- }
- shove8888rev(shoveComponents,0,(void *)&widget.ui);
- if (myswap_bytes) {
- iter[3] = widget.ub[0];
- iter[2] = widget.ub[1];
- iter[1] = widget.ub[2];
- iter[0] = widget.ub[3];
- } else {
- *(GLuint *)iter= widget.ui;
- }
- break;
- case GL_UNSIGNED_INT_10_10_10_2:
- for (k = 0; k < 4; k++) {
- shoveComponents[k]= *iter2++ / 65535.0;
- }
- shove1010102(shoveComponents,0,(void *)&widget.ui);
- if (myswap_bytes) {
- iter[3] = widget.ub[0];
- iter[2] = widget.ub[1];
- iter[1] = widget.ub[2];
- iter[0] = widget.ub[3];
- } else {
- *(GLuint *)iter= widget.ui;
- }
- break;
- case GL_UNSIGNED_INT_2_10_10_10_REV:
- for (k = 0; k < 4; k++) {
- shoveComponents[k]= *iter2++ / 65535.0;
- }
- shove2101010rev(shoveComponents,0,(void *)&widget.ui);
- if (myswap_bytes) {
- iter[3] = widget.ub[0];
- iter[2] = widget.ub[1];
- iter[1] = widget.ub[2];
- iter[0] = widget.ub[3];
- } else {
- *(GLuint *)iter= widget.ui;
- }
- break;
- case GL_INT:
- case GL_UNSIGNED_INT:
- case GL_FLOAT:
- if (type == GL_FLOAT) {
- if (index_format) {
- widget.f = *iter2++;
- } else {
- widget.f = *iter2++ / (float) 65535.0;
- }
- } else if (type == GL_UNSIGNED_INT) {
- if (index_format) {
- widget.ui = *iter2++;
- } else {
- widget.ui = (unsigned int) *iter2++ * 65537;
- }
- } else {
- if (index_format) {
- widget.i = *iter2++;
- } else {
- widget.i = ((unsigned int) *iter2++ * 65537)/2;
- }
- }
- if (myswap_bytes) {
- iter[3] = widget.ub[0];
- iter[2] = widget.ub[1];
- iter[1] = widget.ub[2];
- iter[0] = widget.ub[3];
- } else {
- iter[0] = widget.ub[0];
- iter[1] = widget.ub[1];
- iter[2] = widget.ub[2];
- iter[3] = widget.ub[3];
- }
- break;
- }
- iter += element_size;
- } /* for j */
- start += rowsize;
-#if 1
- /* want 'iter' pointing at start, not within, row for assertion
- * purposes
- */
- iter= start;
-#endif
- } /* for i */
-
- /* iterators should be one byte past end */
- if (!isTypePackedPixel(type)) {
- assert(iter2 == &oldimage[width*height*components]);
- }
- else {
- assert(iter2 == &oldimage[width*height*
- elements_per_group(format,0)]);
- }
- assert( iter == &((GLubyte *)userdata)[rowsize*height +
- psm->pack_skip_rows * rowsize +
- psm->pack_skip_pixels * group_size] );
-
- } /* else */
-} /* empty_image() */
-
-/*--------------------------------------------------------------------------
- * Decimation of packed pixel types
- *--------------------------------------------------------------------------
- */
-static void extract332(int isSwap,
- const void *packedPixel, GLfloat extractComponents[])
-{
- GLubyte ubyte= *(const GLubyte *)packedPixel;
-
- isSwap= isSwap; /* turn off warnings */
-
- /* 11100000 == 0xe0 */
- /* 00011100 == 0x1c */
- /* 00000011 == 0x03 */
-
- extractComponents[0]= (float)((ubyte & 0xe0) >> 5) / 7.0;
- extractComponents[1]= (float)((ubyte & 0x1c) >> 2) / 7.0; /* 7 = 2^3-1 */
- extractComponents[2]= (float)((ubyte & 0x03) ) / 3.0; /* 3 = 2^2-1 */
-} /* extract332() */
-
-static void shove332(const GLfloat shoveComponents[],
- int index, void *packedPixel)
-{
- /* 11100000 == 0xe0 */
- /* 00011100 == 0x1c */
- /* 00000011 == 0x03 */
-
- assert(0.0 <= shoveComponents[0] && shoveComponents[0] <= 1.0);
- assert(0.0 <= shoveComponents[1] && shoveComponents[1] <= 1.0);
- assert(0.0 <= shoveComponents[2] && shoveComponents[2] <= 1.0);
-
- /* due to limited precision, need to round before shoving */
- ((GLubyte *)packedPixel)[index] =
- ((GLubyte)((shoveComponents[0] * 7)+0.5) << 5) & 0xe0;
- ((GLubyte *)packedPixel)[index] |=
- ((GLubyte)((shoveComponents[1] * 7)+0.5) << 2) & 0x1c;
- ((GLubyte *)packedPixel)[index] |=
- ((GLubyte)((shoveComponents[2] * 3)+0.5) ) & 0x03;
-} /* shove332() */
-
-static void extract233rev(int isSwap,
- const void *packedPixel, GLfloat extractComponents[])
-{
- GLubyte ubyte= *(const GLubyte *)packedPixel;
-
- isSwap= isSwap; /* turn off warnings */
-
- /* 0000,0111 == 0x07 */
- /* 0011,1000 == 0x38 */
- /* 1100,0000 == 0xC0 */
-
- extractComponents[0]= (float)((ubyte & 0x07) ) / 7.0;
- extractComponents[1]= (float)((ubyte & 0x38) >> 3) / 7.0;
- extractComponents[2]= (float)((ubyte & 0xC0) >> 6) / 3.0;
-} /* extract233rev() */
-
-static void shove233rev(const GLfloat shoveComponents[],
- int index, void *packedPixel)
-{
- /* 0000,0111 == 0x07 */
- /* 0011,1000 == 0x38 */
- /* 1100,0000 == 0xC0 */
-
- assert(0.0 <= shoveComponents[0] && shoveComponents[0] <= 1.0);
- assert(0.0 <= shoveComponents[1] && shoveComponents[1] <= 1.0);
- assert(0.0 <= shoveComponents[2] && shoveComponents[2] <= 1.0);
-
- /* due to limited precision, need to round before shoving */
- ((GLubyte *)packedPixel)[index] =
- ((GLubyte)((shoveComponents[0] * 7.0)+0.5) ) & 0x07;
- ((GLubyte *)packedPixel)[index]|=
- ((GLubyte)((shoveComponents[1] * 7.0)+0.5) << 3) & 0x38;
- ((GLubyte *)packedPixel)[index]|=
- ((GLubyte)((shoveComponents[2] * 3.0)+0.5) << 6) & 0xC0;
-} /* shove233rev() */
-
-static void extract565(int isSwap,
- const void *packedPixel, GLfloat extractComponents[])
-{
- GLushort ushort;
-
- if (isSwap) {
- ushort= __GLU_SWAP_2_BYTES(packedPixel);
- }
- else {
- ushort= *(const GLushort *)packedPixel;
- }
-
- /* 11111000,00000000 == 0xf800 */
- /* 00000111,11100000 == 0x07e0 */
- /* 00000000,00011111 == 0x001f */
-
- extractComponents[0]=(float)((ushort & 0xf800) >> 11) / 31.0;/* 31 = 2^5-1*/
- extractComponents[1]=(float)((ushort & 0x07e0) >> 5) / 63.0;/* 63 = 2^6-1*/
- extractComponents[2]=(float)((ushort & 0x001f) ) / 31.0;
-} /* extract565() */
-
-static void shove565(const GLfloat shoveComponents[],
- int index,void *packedPixel)
-{
- /* 11111000,00000000 == 0xf800 */
- /* 00000111,11100000 == 0x07e0 */
- /* 00000000,00011111 == 0x001f */
-
- assert(0.0 <= shoveComponents[0] && shoveComponents[0] <= 1.0);
- assert(0.0 <= shoveComponents[1] && shoveComponents[1] <= 1.0);
- assert(0.0 <= shoveComponents[2] && shoveComponents[2] <= 1.0);
-
- /* due to limited precision, need to round before shoving */
- ((GLushort *)packedPixel)[index] =
- ((GLushort)((shoveComponents[0] * 31)+0.5) << 11) & 0xf800;
- ((GLushort *)packedPixel)[index]|=
- ((GLushort)((shoveComponents[1] * 63)+0.5) << 5) & 0x07e0;
- ((GLushort *)packedPixel)[index]|=
- ((GLushort)((shoveComponents[2] * 31)+0.5) ) & 0x001f;
-} /* shove565() */
-
-static void extract565rev(int isSwap,
- const void *packedPixel, GLfloat extractComponents[])
-{
- GLushort ushort;
-
- if (isSwap) {
- ushort= __GLU_SWAP_2_BYTES(packedPixel);
- }
- else {
- ushort= *(const GLushort *)packedPixel;
- }
-
- /* 00000000,00011111 == 0x001f */
- /* 00000111,11100000 == 0x07e0 */
- /* 11111000,00000000 == 0xf800 */
-
- extractComponents[0]= (float)((ushort & 0x001F) ) / 31.0;
- extractComponents[1]= (float)((ushort & 0x07E0) >> 5) / 63.0;
- extractComponents[2]= (float)((ushort & 0xF800) >> 11) / 31.0;
-} /* extract565rev() */
-
-static void shove565rev(const GLfloat shoveComponents[],
- int index,void *packedPixel)
-{
- /* 00000000,00011111 == 0x001f */
- /* 00000111,11100000 == 0x07e0 */
- /* 11111000,00000000 == 0xf800 */
-
- assert(0.0 <= shoveComponents[0] && shoveComponents[0] <= 1.0);
- assert(0.0 <= shoveComponents[1] && shoveComponents[1] <= 1.0);
- assert(0.0 <= shoveComponents[2] && shoveComponents[2] <= 1.0);
-
- /* due to limited precision, need to round before shoving */
- ((GLushort *)packedPixel)[index] =
- ((GLushort)((shoveComponents[0] * 31.0)+0.5) ) & 0x001F;
- ((GLushort *)packedPixel)[index]|=
- ((GLushort)((shoveComponents[1] * 63.0)+0.5) << 5) & 0x07E0;
- ((GLushort *)packedPixel)[index]|=
- ((GLushort)((shoveComponents[2] * 31.0)+0.5) << 11) & 0xF800;
-} /* shove565rev() */
-
-static void extract4444(int isSwap,const void *packedPixel,
- GLfloat extractComponents[])
-{
- GLushort ushort;
-
- if (isSwap) {
- ushort= __GLU_SWAP_2_BYTES(packedPixel);
- }
- else {
- ushort= *(const GLushort *)packedPixel;
- }
-
- /* 11110000,00000000 == 0xf000 */
- /* 00001111,00000000 == 0x0f00 */
- /* 00000000,11110000 == 0x00f0 */
- /* 00000000,00001111 == 0x000f */
-
- extractComponents[0]= (float)((ushort & 0xf000) >> 12) / 15.0;/* 15=2^4-1 */
- extractComponents[1]= (float)((ushort & 0x0f00) >> 8) / 15.0;
- extractComponents[2]= (float)((ushort & 0x00f0) >> 4) / 15.0;
- extractComponents[3]= (float)((ushort & 0x000f) ) / 15.0;
-} /* extract4444() */
-
-static void shove4444(const GLfloat shoveComponents[],
- int index,void *packedPixel)
-{
- assert(0.0 <= shoveComponents[0] && shoveComponents[0] <= 1.0);
- assert(0.0 <= shoveComponents[1] && shoveComponents[1] <= 1.0);
- assert(0.0 <= shoveComponents[2] && shoveComponents[2] <= 1.0);
- assert(0.0 <= shoveComponents[3] && shoveComponents[3] <= 1.0);
-
- /* due to limited precision, need to round before shoving */
- ((GLushort *)packedPixel)[index] =
- ((GLushort)((shoveComponents[0] * 15)+0.5) << 12) & 0xf000;
- ((GLushort *)packedPixel)[index]|=
- ((GLushort)((shoveComponents[1] * 15)+0.5) << 8) & 0x0f00;
- ((GLushort *)packedPixel)[index]|=
- ((GLushort)((shoveComponents[2] * 15)+0.5) << 4) & 0x00f0;
- ((GLushort *)packedPixel)[index]|=
- ((GLushort)((shoveComponents[3] * 15)+0.5) ) & 0x000f;
-} /* shove4444() */
-
-static void extract4444rev(int isSwap,const void *packedPixel,
- GLfloat extractComponents[])
-{
- GLushort ushort;
-
- if (isSwap) {
- ushort= __GLU_SWAP_2_BYTES(packedPixel);
- }
- else {
- ushort= *(const GLushort *)packedPixel;
- }
-
- /* 00000000,00001111 == 0x000f */
- /* 00000000,11110000 == 0x00f0 */
- /* 00001111,00000000 == 0x0f00 */
- /* 11110000,00000000 == 0xf000 */
-
- /* 15 = 2^4-1 */
- extractComponents[0]= (float)((ushort & 0x000F) ) / 15.0;
- extractComponents[1]= (float)((ushort & 0x00F0) >> 4) / 15.0;
- extractComponents[2]= (float)((ushort & 0x0F00) >> 8) / 15.0;
- extractComponents[3]= (float)((ushort & 0xF000) >> 12) / 15.0;
-} /* extract4444rev() */
-
-static void shove4444rev(const GLfloat shoveComponents[],
- int index,void *packedPixel)
-{
- /* 00000000,00001111 == 0x000f */
- /* 00000000,11110000 == 0x00f0 */
- /* 00001111,00000000 == 0x0f00 */
- /* 11110000,00000000 == 0xf000 */
-
- assert(0.0 <= shoveComponents[0] && shoveComponents[0] <= 1.0);
- assert(0.0 <= shoveComponents[1] && shoveComponents[1] <= 1.0);
- assert(0.0 <= shoveComponents[2] && shoveComponents[2] <= 1.0);
- assert(0.0 <= shoveComponents[3] && shoveComponents[3] <= 1.0);
-
- /* due to limited precision, need to round before shoving */
- ((GLushort *)packedPixel)[index] =
- ((GLushort)((shoveComponents[0] * 15)+0.5) ) & 0x000F;
- ((GLushort *)packedPixel)[index]|=
- ((GLushort)((shoveComponents[1] * 15)+0.5) << 4) & 0x00F0;
- ((GLushort *)packedPixel)[index]|=
- ((GLushort)((shoveComponents[2] * 15)+0.5) << 8) & 0x0F00;
- ((GLushort *)packedPixel)[index]|=
- ((GLushort)((shoveComponents[3] * 15)+0.5) << 12) & 0xF000;
-} /* shove4444rev() */
-
-static void extract5551(int isSwap,const void *packedPixel,
- GLfloat extractComponents[])
-{
- GLushort ushort;
-
- if (isSwap) {
- ushort= __GLU_SWAP_2_BYTES(packedPixel);
- }
- else {
- ushort= *(const GLushort *)packedPixel;
- }
-
- /* 11111000,00000000 == 0xf800 */
- /* 00000111,11000000 == 0x07c0 */
- /* 00000000,00111110 == 0x003e */
- /* 00000000,00000001 == 0x0001 */
-
- extractComponents[0]=(float)((ushort & 0xf800) >> 11) / 31.0;/* 31 = 2^5-1*/
- extractComponents[1]=(float)((ushort & 0x07c0) >> 6) / 31.0;
- extractComponents[2]=(float)((ushort & 0x003e) >> 1) / 31.0;
- extractComponents[3]=(float)((ushort & 0x0001) );
-} /* extract5551() */
-
-static void shove5551(const GLfloat shoveComponents[],
- int index,void *packedPixel)
-{
- /* 11111000,00000000 == 0xf800 */
- /* 00000111,11000000 == 0x07c0 */
- /* 00000000,00111110 == 0x003e */
- /* 00000000,00000001 == 0x0001 */
-
- assert(0.0 <= shoveComponents[0] && shoveComponents[0] <= 1.0);
- assert(0.0 <= shoveComponents[1] && shoveComponents[1] <= 1.0);
- assert(0.0 <= shoveComponents[2] && shoveComponents[2] <= 1.0);
- assert(0.0 <= shoveComponents[3] && shoveComponents[3] <= 1.0);
-
- /* due to limited precision, need to round before shoving */
- ((GLushort *)packedPixel)[index] =
- ((GLushort)((shoveComponents[0] * 31)+0.5) << 11) & 0xf800;
- ((GLushort *)packedPixel)[index]|=
- ((GLushort)((shoveComponents[1] * 31)+0.5) << 6) & 0x07c0;
- ((GLushort *)packedPixel)[index]|=
- ((GLushort)((shoveComponents[2] * 31)+0.5) << 1) & 0x003e;
- ((GLushort *)packedPixel)[index]|=
- ((GLushort)((shoveComponents[3])+0.5) ) & 0x0001;
-} /* shove5551() */
-
-static void extract1555rev(int isSwap,const void *packedPixel,
- GLfloat extractComponents[])
-{
- GLushort ushort;
-
- if (isSwap) {
- ushort= __GLU_SWAP_2_BYTES(packedPixel);
- }
- else {
- ushort= *(const GLushort *)packedPixel;
- }
-
- /* 00000000,00011111 == 0x001F */
- /* 00000011,11100000 == 0x03E0 */
- /* 01111100,00000000 == 0x7C00 */
- /* 10000000,00000000 == 0x8000 */
-
- /* 31 = 2^5-1 */
- extractComponents[0]= (float)((ushort & 0x001F) ) / 31.0;
- extractComponents[1]= (float)((ushort & 0x03E0) >> 5) / 31.0;
- extractComponents[2]= (float)((ushort & 0x7C00) >> 10) / 31.0;
- extractComponents[3]= (float)((ushort & 0x8000) >> 15);
-} /* extract1555rev() */
-
-static void shove1555rev(const GLfloat shoveComponents[],
- int index,void *packedPixel)
-{
- /* 00000000,00011111 == 0x001F */
- /* 00000011,11100000 == 0x03E0 */
- /* 01111100,00000000 == 0x7C00 */
- /* 10000000,00000000 == 0x8000 */
-
- assert(0.0 <= shoveComponents[0] && shoveComponents[0] <= 1.0);
- assert(0.0 <= shoveComponents[1] && shoveComponents[1] <= 1.0);
- assert(0.0 <= shoveComponents[2] && shoveComponents[2] <= 1.0);
- assert(0.0 <= shoveComponents[3] && shoveComponents[3] <= 1.0);
-
- /* due to limited precision, need to round before shoving */
- ((GLushort *)packedPixel)[index] =
- ((GLushort)((shoveComponents[0] * 31)+0.5) ) & 0x001F;
- ((GLushort *)packedPixel)[index]|=
- ((GLushort)((shoveComponents[1] * 31)+0.5) << 5) & 0x03E0;
- ((GLushort *)packedPixel)[index]|=
- ((GLushort)((shoveComponents[2] * 31)+0.5) << 10) & 0x7C00;
- ((GLushort *)packedPixel)[index]|=
- ((GLushort)((shoveComponents[3])+0.5) << 15) & 0x8000;
-} /* shove1555rev() */
-
-static void extract8888(int isSwap,
- const void *packedPixel, GLfloat extractComponents[])
-{
- GLuint uint;
-
- if (isSwap) {
- uint= __GLU_SWAP_4_BYTES(packedPixel);
- }
- else {
- uint= *(const GLuint *)packedPixel;
- }
-
- /* 11111111,00000000,00000000,00000000 == 0xff000000 */
- /* 00000000,11111111,00000000,00000000 == 0x00ff0000 */
- /* 00000000,00000000,11111111,00000000 == 0x0000ff00 */
- /* 00000000,00000000,00000000,11111111 == 0x000000ff */
-
- /* 255 = 2^8-1 */
- extractComponents[0]= (float)((uint & 0xff000000) >> 24) / 255.0;
- extractComponents[1]= (float)((uint & 0x00ff0000) >> 16) / 255.0;
- extractComponents[2]= (float)((uint & 0x0000ff00) >> 8) / 255.0;
- extractComponents[3]= (float)((uint & 0x000000ff) ) / 255.0;
-} /* extract8888() */
-
-static void shove8888(const GLfloat shoveComponents[],
- int index,void *packedPixel)
-{
- /* 11111111,00000000,00000000,00000000 == 0xff000000 */
- /* 00000000,11111111,00000000,00000000 == 0x00ff0000 */
- /* 00000000,00000000,11111111,00000000 == 0x0000ff00 */
- /* 00000000,00000000,00000000,11111111 == 0x000000ff */
-
- assert(0.0 <= shoveComponents[0] && shoveComponents[0] <= 1.0);
- assert(0.0 <= shoveComponents[1] && shoveComponents[1] <= 1.0);
- assert(0.0 <= shoveComponents[2] && shoveComponents[2] <= 1.0);
- assert(0.0 <= shoveComponents[3] && shoveComponents[3] <= 1.0);
-
- /* due to limited precision, need to round before shoving */
- ((GLuint *)packedPixel)[index] =
- ((GLuint)((shoveComponents[0] * 255)+0.5) << 24) & 0xff000000;
- ((GLuint *)packedPixel)[index]|=
- ((GLuint)((shoveComponents[1] * 255)+0.5) << 16) & 0x00ff0000;
- ((GLuint *)packedPixel)[index]|=
- ((GLuint)((shoveComponents[2] * 255)+0.5) << 8) & 0x0000ff00;
- ((GLuint *)packedPixel)[index]|=
- ((GLuint)((shoveComponents[3] * 255)+0.5) ) & 0x000000ff;
-} /* shove8888() */
-
-static void extract8888rev(int isSwap,
- const void *packedPixel,GLfloat extractComponents[])
-{
- GLuint uint;
-
- if (isSwap) {
- uint= __GLU_SWAP_4_BYTES(packedPixel);
- }
- else {
- uint= *(const GLuint *)packedPixel;
- }
-
- /* 00000000,00000000,00000000,11111111 == 0x000000ff */
- /* 00000000,00000000,11111111,00000000 == 0x0000ff00 */
- /* 00000000,11111111,00000000,00000000 == 0x00ff0000 */
- /* 11111111,00000000,00000000,00000000 == 0xff000000 */
-
- /* 255 = 2^8-1 */
- extractComponents[0]= (float)((uint & 0x000000FF) ) / 255.0;
- extractComponents[1]= (float)((uint & 0x0000FF00) >> 8) / 255.0;
- extractComponents[2]= (float)((uint & 0x00FF0000) >> 16) / 255.0;
- extractComponents[3]= (float)((uint & 0xFF000000) >> 24) / 255.0;
-} /* extract8888rev() */
-
-static void shove8888rev(const GLfloat shoveComponents[],
- int index,void *packedPixel)
-{
- /* 00000000,00000000,00000000,11111111 == 0x000000ff */
- /* 00000000,00000000,11111111,00000000 == 0x0000ff00 */
- /* 00000000,11111111,00000000,00000000 == 0x00ff0000 */
- /* 11111111,00000000,00000000,00000000 == 0xff000000 */
-
- assert(0.0 <= shoveComponents[0] && shoveComponents[0] <= 1.0);
- assert(0.0 <= shoveComponents[1] && shoveComponents[1] <= 1.0);
- assert(0.0 <= shoveComponents[2] && shoveComponents[2] <= 1.0);
- assert(0.0 <= shoveComponents[3] && shoveComponents[3] <= 1.0);
-
- /* due to limited precision, need to round before shoving */
- ((GLuint *)packedPixel)[index] =
- ((GLuint)((shoveComponents[0] * 255)+0.5) ) & 0x000000FF;
- ((GLuint *)packedPixel)[index]|=
- ((GLuint)((shoveComponents[1] * 255)+0.5) << 8) & 0x0000FF00;
- ((GLuint *)packedPixel)[index]|=
- ((GLuint)((shoveComponents[2] * 255)+0.5) << 16) & 0x00FF0000;
- ((GLuint *)packedPixel)[index]|=
- ((GLuint)((shoveComponents[3] * 255)+0.5) << 24) & 0xFF000000;
-} /* shove8888rev() */
-
-static void extract1010102(int isSwap,
- const void *packedPixel,GLfloat extractComponents[])
-{
- GLuint uint;
-
- if (isSwap) {
- uint= __GLU_SWAP_4_BYTES(packedPixel);
- }
- else {
- uint= *(const GLuint *)packedPixel;
- }
-
- /* 11111111,11000000,00000000,00000000 == 0xffc00000 */
- /* 00000000,00111111,11110000,00000000 == 0x003ff000 */
- /* 00000000,00000000,00001111,11111100 == 0x00000ffc */
- /* 00000000,00000000,00000000,00000011 == 0x00000003 */
-
- /* 1023 = 2^10-1 */
- extractComponents[0]= (float)((uint & 0xffc00000) >> 22) / 1023.0;
- extractComponents[1]= (float)((uint & 0x003ff000) >> 12) / 1023.0;
- extractComponents[2]= (float)((uint & 0x00000ffc) >> 2) / 1023.0;
- extractComponents[3]= (float)((uint & 0x00000003) ) / 3.0;
-} /* extract1010102() */
-
-static void shove1010102(const GLfloat shoveComponents[],
- int index,void *packedPixel)
-{
- /* 11111111,11000000,00000000,00000000 == 0xffc00000 */
- /* 00000000,00111111,11110000,00000000 == 0x003ff000 */
- /* 00000000,00000000,00001111,11111100 == 0x00000ffc */
- /* 00000000,00000000,00000000,00000011 == 0x00000003 */
-
- assert(0.0 <= shoveComponents[0] && shoveComponents[0] <= 1.0);
- assert(0.0 <= shoveComponents[1] && shoveComponents[1] <= 1.0);
- assert(0.0 <= shoveComponents[2] && shoveComponents[2] <= 1.0);
- assert(0.0 <= shoveComponents[3] && shoveComponents[3] <= 1.0);
-
- /* due to limited precision, need to round before shoving */
- ((GLuint *)packedPixel)[index] =
- ((GLuint)((shoveComponents[0] * 1023)+0.5) << 22) & 0xffc00000;
- ((GLuint *)packedPixel)[index]|=
- ((GLuint)((shoveComponents[1] * 1023)+0.5) << 12) & 0x003ff000;
- ((GLuint *)packedPixel)[index]|=
- ((GLuint)((shoveComponents[2] * 1023)+0.5) << 2) & 0x00000ffc;
- ((GLuint *)packedPixel)[index]|=
- ((GLuint)((shoveComponents[3] * 3)+0.5) ) & 0x00000003;
-} /* shove1010102() */
-
-static void extract2101010rev(int isSwap,
- const void *packedPixel,
- GLfloat extractComponents[])
-{
- GLuint uint;
-
- if (isSwap) {
- uint= __GLU_SWAP_4_BYTES(packedPixel);
- }
- else {
- uint= *(const GLuint *)packedPixel;
- }
-
- /* 00000000,00000000,00000011,11111111 == 0x000003FF */
- /* 00000000,00001111,11111100,00000000 == 0x000FFC00 */
- /* 00111111,11110000,00000000,00000000 == 0x3FF00000 */
- /* 11000000,00000000,00000000,00000000 == 0xC0000000 */
-
- /* 1023 = 2^10-1 */
- extractComponents[0]= (float)((uint & 0x000003FF) ) / 1023.0;
- extractComponents[1]= (float)((uint & 0x000FFC00) >> 10) / 1023.0;
- extractComponents[2]= (float)((uint & 0x3FF00000) >> 20) / 1023.0;
- extractComponents[3]= (float)((uint & 0xC0000000) >> 30) / 3.0;
- /* 3 = 2^2-1 */
-} /* extract2101010rev() */
-
-static void shove2101010rev(const GLfloat shoveComponents[],
- int index,void *packedPixel)
-{
- /* 00000000,00000000,00000011,11111111 == 0x000003FF */
- /* 00000000,00001111,11111100,00000000 == 0x000FFC00 */
- /* 00111111,11110000,00000000,00000000 == 0x3FF00000 */
- /* 11000000,00000000,00000000,00000000 == 0xC0000000 */
-
- assert(0.0 <= shoveComponents[0] && shoveComponents[0] <= 1.0);
- assert(0.0 <= shoveComponents[1] && shoveComponents[1] <= 1.0);
- assert(0.0 <= shoveComponents[2] && shoveComponents[2] <= 1.0);
- assert(0.0 <= shoveComponents[3] && shoveComponents[3] <= 1.0);
-
- /* due to limited precision, need to round before shoving */
- ((GLuint *)packedPixel)[index] =
- ((GLuint)((shoveComponents[0] * 1023)+0.5) ) & 0x000003FF;
- ((GLuint *)packedPixel)[index]|=
- ((GLuint)((shoveComponents[1] * 1023)+0.5) << 10) & 0x000FFC00;
- ((GLuint *)packedPixel)[index]|=
- ((GLuint)((shoveComponents[2] * 1023)+0.5) << 20) & 0x3FF00000;
- ((GLuint *)packedPixel)[index]|=
- ((GLuint)((shoveComponents[3] * 3)+0.5) << 30) & 0xC0000000;
-} /* shove2101010rev() */
-
-static void scaleInternalPackedPixel(int components,
- void (*extractPackedPixel)
- (int, const void *,GLfloat []),
- void (*shovePackedPixel)
- (const GLfloat [], int, void *),
- GLint widthIn,GLint heightIn,
- const void *dataIn,
- GLint widthOut,GLint heightOut,
- void *dataOut,
- GLint pixelSizeInBytes,
- GLint rowSizeInBytes,GLint isSwap)
-{
- float convx;
- float convy;
- float percent;
-
- /* Max components in a format is 4, so... */
- float totals[4];
- float extractTotals[4], extractMoreTotals[4], shoveTotals[4];
-
- float area;
- int i,j,k,xindex;
-
- const char *temp, *temp0;
- int outindex;
-
- int lowx_int, highx_int, lowy_int, highy_int;
- float x_percent, y_percent;
- float lowx_float, highx_float, lowy_float, highy_float;
- float convy_float, convx_float;
- int convy_int, convx_int;
- int l, m;
- const char *left, *right;
-
- if (widthIn == widthOut*2 && heightIn == heightOut*2) {
- halveImagePackedPixel(components,extractPackedPixel,shovePackedPixel,
- widthIn, heightIn, dataIn, dataOut,
- pixelSizeInBytes,rowSizeInBytes,isSwap);
- return;
- }
- convy = (float) heightIn/heightOut;
- convx = (float) widthIn/widthOut;
- convy_int = floor(convy);
- convy_float = convy - convy_int;
- convx_int = floor(convx);
- convx_float = convx - convx_int;
-
- area = convx * convy;
-
- lowy_int = 0;
- lowy_float = 0;
- highy_int = convy_int;
- highy_float = convy_float;
-
- for (i = 0; i < heightOut; i++) {
- lowx_int = 0;
- lowx_float = 0;
- highx_int = convx_int;
- highx_float = convx_float;
-
- for (j = 0; j < widthOut; j++) {
- /*
- ** Ok, now apply box filter to box that goes from (lowx, lowy)
- ** to (highx, highy) on input data into this pixel on output
- ** data.
- */
- totals[0] = totals[1] = totals[2] = totals[3] = 0.0;
-
- /* calculate the value for pixels in the 1st row */
- xindex = lowx_int*pixelSizeInBytes;
- if((highy_int>lowy_int) && (highx_int>lowx_int)) {
-
- y_percent = 1-lowy_float;
- temp = (const char *)dataIn + xindex + lowy_int * rowSizeInBytes;
- percent = y_percent * (1-lowx_float);
-#if 0
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- if (myswap_bytes) {
- totals[k] += __GLU_SWAP_2_BYTES(temp_index) * percent;
- } else {
- totals[k] += *(const GLushort*)temp_index * percent;
- }
- }
-#else
- (*extractPackedPixel)(isSwap,temp,extractTotals);
- for (k = 0; k < components; k++) {
- totals[k]+= extractTotals[k] * percent;
- }
-#endif
- left = temp;
- for(l = lowx_int+1; l < highx_int; l++) {
- temp += pixelSizeInBytes;
-#if 0
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- if (myswap_bytes) {
- totals[k] +=
- __GLU_SWAP_2_BYTES(temp_index) * y_percent;
- } else {
- totals[k] += *(const GLushort*)temp_index * y_percent;
- }
- }
-#else
- (*extractPackedPixel)(isSwap,temp,extractTotals);
- for (k = 0; k < components; k++) {
- totals[k]+= extractTotals[k] * y_percent;
- }
-#endif
- }
- temp += pixelSizeInBytes;
- right = temp;
- percent = y_percent * highx_float;
-#if 0
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- if (myswap_bytes) {
- totals[k] += __GLU_SWAP_2_BYTES(temp_index) * percent;
- } else {
- totals[k] += *(const GLushort*)temp_index * percent;
- }
- }
-#else
- (*extractPackedPixel)(isSwap,temp,extractTotals);
- for (k = 0; k < components; k++) {
- totals[k]+= extractTotals[k] * percent;
- }
-#endif
-
- /* calculate the value for pixels in the last row */
-
- y_percent = highy_float;
- percent = y_percent * (1-lowx_float);
- temp = (const char *)dataIn + xindex + highy_int * rowSizeInBytes;
-#if 0
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- if (myswap_bytes) {
- totals[k] += __GLU_SWAP_2_BYTES(temp_index) * percent;
- } else {
- totals[k] += *(const GLushort*)temp_index * percent;
- }
- }
-#else
- (*extractPackedPixel)(isSwap,temp,extractTotals);
- for (k = 0; k < components; k++) {
- totals[k]+= extractTotals[k] * percent;
- }
-#endif
- for(l = lowx_int+1; l < highx_int; l++) {
- temp += pixelSizeInBytes;
-#if 0
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- if (myswap_bytes) {
- totals[k] +=
- __GLU_SWAP_2_BYTES(temp_index) * y_percent;
- } else {
- totals[k] += *(const GLushort*)temp_index * y_percent;
- }
- }
-#else
- (*extractPackedPixel)(isSwap,temp,extractTotals);
- for (k = 0; k < components; k++) {
- totals[k]+= extractTotals[k] * y_percent;
- }
-#endif
-
- }
- temp += pixelSizeInBytes;
- percent = y_percent * highx_float;
-#if 0
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- if (myswap_bytes) {
- totals[k] += __GLU_SWAP_2_BYTES(temp_index) * percent;
- } else {
- totals[k] += *(const GLushort*)temp_index * percent;
- }
- }
-#else
- (*extractPackedPixel)(isSwap,temp,extractTotals);
- for (k = 0; k < components; k++) {
- totals[k]+= extractTotals[k] * percent;
- }
-#endif
-
- /* calculate the value for pixels in the 1st and last column */
- for(m = lowy_int+1; m < highy_int; m++) {
- left += rowSizeInBytes;
- right += rowSizeInBytes;
-#if 0
- for (k = 0; k < components;
- k++, left += element_size, right += element_size) {
- if (myswap_bytes) {
- totals[k] +=
- __GLU_SWAP_2_BYTES(left) * (1-lowx_float) +
- __GLU_SWAP_2_BYTES(right) * highx_float;
- } else {
- totals[k] += *(const GLushort*)left * (1-lowx_float)
- + *(const GLushort*)right * highx_float;
- }
- }
-#else
- (*extractPackedPixel)(isSwap,left,extractTotals);
- (*extractPackedPixel)(isSwap,right,extractMoreTotals);
- for (k = 0; k < components; k++) {
- totals[k]+= (extractTotals[k]*(1-lowx_float) +
- extractMoreTotals[k]*highx_float);
- }
-#endif
- }
- } else if (highy_int > lowy_int) {
- x_percent = highx_float - lowx_float;
- percent = (1-lowy_float)*x_percent;
- temp = (const char *)dataIn + xindex + lowy_int*rowSizeInBytes;
-#if 0
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- if (myswap_bytes) {
- totals[k] += __GLU_SWAP_2_BYTES(temp_index) * percent;
- } else {
- totals[k] += *(const GLushort*)temp_index * percent;
- }
- }
-#else
- (*extractPackedPixel)(isSwap,temp,extractTotals);
- for (k = 0; k < components; k++) {
- totals[k]+= extractTotals[k] * percent;
- }
-#endif
- for(m = lowy_int+1; m < highy_int; m++) {
- temp += rowSizeInBytes;
-#if 0
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- if (myswap_bytes) {
- totals[k] +=
- __GLU_SWAP_2_BYTES(temp_index) * x_percent;
- } else {
- totals[k] += *(const GLushort*)temp_index * x_percent;
- }
- }
-#else
- (*extractPackedPixel)(isSwap,temp,extractTotals);
- for (k = 0; k < components; k++) {
- totals[k]+= extractTotals[k] * x_percent;
- }
-#endif
- }
- percent = x_percent * highy_float;
- temp += rowSizeInBytes;
-#if 0
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- if (myswap_bytes) {
- totals[k] += __GLU_SWAP_2_BYTES(temp_index) * percent;
- } else {
- totals[k] += *(const GLushort*)temp_index * percent;
- }
- }
-#else
- (*extractPackedPixel)(isSwap,temp,extractTotals);
- for (k = 0; k < components; k++) {
- totals[k]+= extractTotals[k] * percent;
- }
-#endif
- } else if (highx_int > lowx_int) {
- y_percent = highy_float - lowy_float;
- percent = (1-lowx_float)*y_percent;
- temp = (const char *)dataIn + xindex + lowy_int*rowSizeInBytes;
-#if 0
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- if (myswap_bytes) {
- totals[k] += __GLU_SWAP_2_BYTES(temp_index) * percent;
- } else {
- totals[k] += *(const GLushort*)temp_index * percent;
- }
- }
-#else
- (*extractPackedPixel)(isSwap,temp,extractTotals);
- for (k = 0; k < components; k++) {
- totals[k]+= extractTotals[k] * percent;
- }
-#endif
- for (l = lowx_int+1; l < highx_int; l++) {
- temp += pixelSizeInBytes;
-#if 0
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- if (myswap_bytes) {
- totals[k] +=
- __GLU_SWAP_2_BYTES(temp_index) * y_percent;
- } else {
- totals[k] += *(const GLushort*)temp_index * y_percent;
- }
- }
-#else
- (*extractPackedPixel)(isSwap,temp,extractTotals);
- for (k = 0; k < components; k++) {
- totals[k]+= extractTotals[k] * y_percent;
- }
-#endif
- }
- temp += pixelSizeInBytes;
- percent = y_percent * highx_float;
-#if 0
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- if (myswap_bytes) {
- totals[k] += __GLU_SWAP_2_BYTES(temp_index) * percent;
- } else {
- totals[k] += *(const GLushort*)temp_index * percent;
- }
- }
-#else
- (*extractPackedPixel)(isSwap,temp,extractTotals);
- for (k = 0; k < components; k++) {
- totals[k]+= extractTotals[k] * percent;
- }
-#endif
- } else {
- percent = (highy_float-lowy_float)*(highx_float-lowx_float);
- temp = (const char *)dataIn + xindex + lowy_int * rowSizeInBytes;
-#if 0
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- if (myswap_bytes) {
- totals[k] += __GLU_SWAP_2_BYTES(temp_index) * percent;
- } else {
- totals[k] += *(const GLushort*)temp_index * percent;
- }
- }
-#else
- (*extractPackedPixel)(isSwap,temp,extractTotals);
- for (k = 0; k < components; k++) {
- totals[k]+= extractTotals[k] * percent;
- }
-#endif
- }
-
- /* this is for the pixels in the body */
- temp0 = (const char *)dataIn + xindex + pixelSizeInBytes + (lowy_int+1)*rowSizeInBytes;
- for (m = lowy_int+1; m < highy_int; m++) {
- temp = temp0;
- for(l = lowx_int+1; l < highx_int; l++) {
-#if 0
- for (k = 0, temp_index = temp; k < components;
- k++, temp_index += element_size) {
- if (myswap_bytes) {
- totals[k] += __GLU_SWAP_2_BYTES(temp_index);
- } else {
- totals[k] += *(const GLushort*)temp_index;
- }
- }
-#else
- (*extractPackedPixel)(isSwap,temp,extractTotals);
- for (k = 0; k < components; k++) {
- totals[k]+= extractTotals[k];
- }
-#endif
- temp += pixelSizeInBytes;
- }
- temp0 += rowSizeInBytes;
- }
-
- outindex = (j + (i * widthOut)); /* * (components == 1) */
-#if 0
- for (k = 0; k < components; k++) {
- dataout[outindex + k] = totals[k]/area;
- /*printf("totals[%d] = %f\n", k, totals[k]);*/
- }
-#else
- for (k = 0; k < components; k++) {
- shoveTotals[k]= totals[k]/area;
- }
- (*shovePackedPixel)(shoveTotals,outindex,(void *)dataOut);
-#endif
- lowx_int = highx_int;
- lowx_float = highx_float;
- highx_int += convx_int;
- highx_float += convx_float;
- if(highx_float > 1) {
- highx_float -= 1.0;
- highx_int++;
- }
- }
- lowy_int = highy_int;
- lowy_float = highy_float;
- highy_int += convy_int;
- highy_float += convy_float;
- if(highy_float > 1) {
- highy_float -= 1.0;
- highy_int++;
- }
- }
-
- assert(outindex == (widthOut*heightOut - 1));
-} /* scaleInternalPackedPixel() */
-
-/* rowSizeInBytes is at least the width (in bytes) due to padding on
- * inputs; not always equal. Output NEVER has row padding.
- */
-static void halveImagePackedPixel(int components,
- void (*extractPackedPixel)
- (int, const void *,GLfloat []),
- void (*shovePackedPixel)
- (const GLfloat [],int, void *),
- GLint width, GLint height,
- const void *dataIn, void *dataOut,
- GLint pixelSizeInBytes,
- GLint rowSizeInBytes, GLint isSwap)
-{
- /* handle case where there is only 1 column/row */
- if (width == 1 || height == 1) {
- assert(!(width == 1 && height == 1)); /* can't be 1x1 */
- halve1DimagePackedPixel(components,extractPackedPixel,shovePackedPixel,
- width,height,dataIn,dataOut,pixelSizeInBytes,
- rowSizeInBytes,isSwap);
- return;
- }
-
- {
- int ii, jj;
-
- int halfWidth= width / 2;
- int halfHeight= height / 2;
- const char *src= (const char *) dataIn;
- int padBytes= rowSizeInBytes - (width*pixelSizeInBytes);
- int outIndex= 0;
-
- for (ii= 0; ii< halfHeight; ii++) {
- for (jj= 0; jj< halfWidth; jj++) {
-#define BOX4 4
- float totals[4]; /* 4 is maximum components */
- float extractTotals[BOX4][4]; /* 4 is maximum components */
- int cc;
-
- (*extractPackedPixel)(isSwap,src,
- &extractTotals[0][0]);
- (*extractPackedPixel)(isSwap,(src+pixelSizeInBytes),
- &extractTotals[1][0]);
- (*extractPackedPixel)(isSwap,(src+rowSizeInBytes),
- &extractTotals[2][0]);
- (*extractPackedPixel)(isSwap,
- (src+rowSizeInBytes+pixelSizeInBytes),
- &extractTotals[3][0]);
- for (cc = 0; cc < components; cc++) {
- int kk;
-
- /* grab 4 pixels to average */
- totals[cc]= 0.0;
- /* totals[RED]= extractTotals[0][RED]+extractTotals[1][RED]+
- * extractTotals[2][RED]+extractTotals[3][RED];
- * totals[RED]/= 4.0;
- */
- for (kk = 0; kk < BOX4; kk++) {
- totals[cc]+= extractTotals[kk][cc];
- }
- totals[cc]/= (float)BOX4;
- }
- (*shovePackedPixel)(totals,outIndex,dataOut);
-
- outIndex++;
- /* skip over to next square of 4 */
- src+= pixelSizeInBytes + pixelSizeInBytes;
- }
- /* skip past pad bytes, if any, to get to next row */
- src+= padBytes;
-
- /* src is at beginning of a row here, but it's the second row of
- * the square block of 4 pixels that we just worked on so we
- * need to go one more row.
- * i.e.,
- * OO...
- * here -->OO...
- * but want -->OO...
- * OO...
- * ...
- */
- src+= rowSizeInBytes;
- }
-
- /* both pointers must reach one byte after the end */
- assert(src == &((const char *)dataIn)[rowSizeInBytes*height]);
- assert(outIndex == halfWidth * halfHeight);
- }
-} /* halveImagePackedPixel() */
-
-static void halve1DimagePackedPixel(int components,
- void (*extractPackedPixel)
- (int, const void *,GLfloat []),
- void (*shovePackedPixel)
- (const GLfloat [],int, void *),
- GLint width, GLint height,
- const void *dataIn, void *dataOut,
- GLint pixelSizeInBytes,
- GLint rowSizeInBytes, GLint isSwap)
-{
- int halfWidth= width / 2;
- int halfHeight= height / 2;
- const char *src= (const char *) dataIn;
- int jj;
-
- assert(width == 1 || height == 1); /* must be 1D */
- assert(width != height); /* can't be square */
-
- if (height == 1) { /* 1 row */
- int outIndex= 0;
-
- assert(width != 1); /* widthxheight can't be 1x1 */
- halfHeight= 1;
-
- /* one horizontal row with possible pad bytes */
-
- for (jj= 0; jj< halfWidth; jj++) {
-#define BOX2 2
- float totals[4]; /* 4 is maximum components */
- float extractTotals[BOX2][4]; /* 4 is maximum components */
- int cc;
-
- /* average two at a time, instead of four */
- (*extractPackedPixel)(isSwap,src,
- &extractTotals[0][0]);
- (*extractPackedPixel)(isSwap,(src+pixelSizeInBytes),
- &extractTotals[1][0]);
- for (cc = 0; cc < components; cc++) {
- int kk;
-
- /* grab 2 pixels to average */
- totals[cc]= 0.0;
- /* totals[RED]= extractTotals[0][RED]+extractTotals[1][RED];
- * totals[RED]/= 2.0;
- */
- for (kk = 0; kk < BOX2; kk++) {
- totals[cc]+= extractTotals[kk][cc];
- }
- totals[cc]/= (float)BOX2;
- }
- (*shovePackedPixel)(totals,outIndex,dataOut);
-
- outIndex++;
- /* skip over to next group of 2 */
- src+= pixelSizeInBytes + pixelSizeInBytes;
- }
-
- {
- int padBytes= rowSizeInBytes - (width*pixelSizeInBytes);
- src+= padBytes; /* for assertion only */
- }
- assert(src == &((const char *)dataIn)[rowSizeInBytes]);
- assert(outIndex == halfWidth * halfHeight);
- }
- else if (width == 1) { /* 1 column */
- int outIndex= 0;
-
- assert(height != 1); /* widthxheight can't be 1x1 */
- halfWidth= 1;
- /* one vertical column with possible pad bytes per row */
- /* average two at a time */
-
- for (jj= 0; jj< halfHeight; jj++) {
-#define BOX2 2
- float totals[4]; /* 4 is maximum components */
- float extractTotals[BOX2][4]; /* 4 is maximum components */
- int cc;
-
- /* average two at a time, instead of four */
- (*extractPackedPixel)(isSwap,src,
- &extractTotals[0][0]);
- (*extractPackedPixel)(isSwap,(src+rowSizeInBytes),
- &extractTotals[1][0]);
- for (cc = 0; cc < components; cc++) {
- int kk;
-
- /* grab 2 pixels to average */
- totals[cc]= 0.0;
- /* totals[RED]= extractTotals[0][RED]+extractTotals[1][RED];
- * totals[RED]/= 2.0;
- */
- for (kk = 0; kk < BOX2; kk++) {
- totals[cc]+= extractTotals[kk][cc];
- }
- totals[cc]/= (float)BOX2;
- }
- (*shovePackedPixel)(totals,outIndex,dataOut);
-
- outIndex++;
- src+= rowSizeInBytes + rowSizeInBytes; /* go to row after next */
- }
-
- assert(src == &((const char *)dataIn)[rowSizeInBytes*height]);
- assert(outIndex == halfWidth * halfHeight);
- }
-} /* halve1DimagePackedPixel() */
-
-/*===========================================================================*/
-
-#ifdef RESOLVE_3D_TEXTURE_SUPPORT
-/*
- * This section ensures that GLU 1.3 will load and run on
- * a GL 1.1 implementation. It dynamically resolves the
- * call to glTexImage3D() which might not be available.
- * Or is it might be supported as an extension.
- * Contributed by Gerk Huisma <gerk@five-d.demon.nl>.
- */
-
-typedef void (GLAPIENTRY *TexImage3Dproc)( GLenum target, GLint level,
- GLenum internalFormat,
- GLsizei width, GLsizei height,
- GLsizei depth, GLint border,
- GLenum format, GLenum type,
- const GLvoid *pixels );
-
-static TexImage3Dproc pTexImage3D = 0;
-
-#if !defined(_WIN32) && !defined(__WIN32__)
-# include <dlfcn.h>
-# include <sys/types.h>
-#else
- WINGDIAPI PROC WINAPI wglGetProcAddress(LPCSTR);
-#endif
-
-static void gluTexImage3D( GLenum target, GLint level,
- GLenum internalFormat,
- GLsizei width, GLsizei height,
- GLsizei depth, GLint border,
- GLenum format, GLenum type,
- const GLvoid *pixels )
-{
- if (!pTexImage3D) {
-#if defined(_WIN32) || defined(__WIN32__)
- pTexImage3D = (TexImage3Dproc) wglGetProcAddress("glTexImage3D");
- if (!pTexImage3D)
- pTexImage3D = (TexImage3Dproc) wglGetProcAddress("glTexImage3DEXT");
-#else
- void *libHandle = dlopen("libgl.so", RTLD_LAZY);
- pTexImage3D = (TexImage3Dproc) dlsym(libHandle, "glTexImage3D" );
- if (!pTexImage3D)
- pTexImage3D = (TexImage3Dproc) dlsym(libHandle,"glTexImage3DEXT");
- dlclose(libHandle);
-#endif
- }
-
- /* Now call glTexImage3D */
- if (pTexImage3D)
- pTexImage3D(target, level, internalFormat, width, height,
- depth, border, format, type, pixels);
-}
-
-#else
-
-/* Only bind to a GL 1.2 implementation: */
-#define gluTexImage3D glTexImage3D
-
-#endif
-
-static GLint imageSize3D(GLint width, GLint height, GLint depth,
- GLenum format, GLenum type)
-{
- int components= elements_per_group(format,type);
- int bytes_per_row= bytes_per_element(type) * width;
-
-assert(width > 0 && height > 0 && depth > 0);
-assert(type != GL_BITMAP);
-
- return bytes_per_row * height * depth * components;
-} /* imageSize3D() */
-
-static void fillImage3D(const PixelStorageModes *psm,
- GLint width, GLint height, GLint depth, GLenum format,
- GLenum type, GLboolean indexFormat,
- const void *userImage, GLushort *newImage)
-{
- int myswapBytes;
- int components;
- int groupsPerLine;
- int elementSize;
- int groupSize;
- int rowSize;
- int padding;
- int elementsPerLine;
- int rowsPerImage;
- int imageSize;
- const GLubyte *start, *rowStart, *iter;
- GLushort *iter2;
- int ww, hh, dd, k;
-
- myswapBytes= psm->unpack_swap_bytes;
- components= elements_per_group(format,type);
- if (psm->unpack_row_length > 0) {
- groupsPerLine= psm->unpack_row_length;
- }
- else {
- groupsPerLine= width;
- }
- elementSize= bytes_per_element(type);
- groupSize= elementSize * components;
- if (elementSize == 1) myswapBytes= 0;
-
- /* 3dstuff begin */
- if (psm->unpack_image_height > 0) {
- rowsPerImage= psm->unpack_image_height;
- }
- else {
- rowsPerImage= height;
- }
- /* 3dstuff end */
-
- rowSize= groupsPerLine * groupSize;
- padding= rowSize % psm->unpack_alignment;
- if (padding) {
- rowSize+= psm->unpack_alignment - padding;
- }
-
- imageSize= rowsPerImage * rowSize; /* 3dstuff */
-
- start= (const GLubyte *)userImage + psm->unpack_skip_rows * rowSize +
- psm->unpack_skip_pixels * groupSize +
- /*3dstuff*/
- psm->unpack_skip_images * imageSize;
- elementsPerLine = width * components;
-
- iter2= newImage;
- for (dd= 0; dd < depth; dd++) {
- rowStart= start;
-
- for (hh= 0; hh < height; hh++) {
- iter= rowStart;
-
- for (ww= 0; ww < elementsPerLine; ww++) {
- Type_Widget widget;
- float extractComponents[4];
-
- switch(type) {
- case GL_UNSIGNED_BYTE:
- if (indexFormat) {
- *iter2++ = *iter;
- } else {
- *iter2++ = (*iter) * 257;
- }
- break;
- case GL_BYTE:
- if (indexFormat) {
- *iter2++ = *((const GLbyte *) iter);
- } else {
- /* rough approx */
- *iter2++ = (*((const GLbyte *) iter)) * 516;
- }
- break;
- case GL_UNSIGNED_BYTE_3_3_2:
- extract332(0,iter,extractComponents);
- for (k = 0; k < 3; k++) {
- *iter2++ = (GLushort)(extractComponents[k]*65535);
- }
- break;
- case GL_UNSIGNED_BYTE_2_3_3_REV:
- extract233rev(0,iter,extractComponents);
- for (k = 0; k < 3; k++) {
- *iter2++ = (GLushort)(extractComponents[k]*65535);
- }
- break;
- case GL_UNSIGNED_SHORT_5_6_5:
- extract565(myswapBytes,iter,extractComponents);
- for (k = 0; k < 3; k++) {
- *iter2++ = (GLushort)(extractComponents[k]*65535);
- }
- break;
- case GL_UNSIGNED_SHORT_5_6_5_REV:
- extract565rev(myswapBytes,iter,extractComponents);
- for (k = 0; k < 3; k++) {
- *iter2++ = (GLushort)(extractComponents[k]*65535);
- }
- break;
- case GL_UNSIGNED_SHORT_4_4_4_4:
- extract4444(myswapBytes,iter,extractComponents);
- for (k = 0; k < 4; k++) {
- *iter2++ = (GLushort)(extractComponents[k]*65535);
- }
- break;
- case GL_UNSIGNED_SHORT_4_4_4_4_REV:
- extract4444rev(myswapBytes,iter,extractComponents);
- for (k = 0; k < 4; k++) {
- *iter2++ = (GLushort)(extractComponents[k]*65535);
- }
- break;
- case GL_UNSIGNED_SHORT_5_5_5_1:
- extract5551(myswapBytes,iter,extractComponents);
- for (k = 0; k < 4; k++) {
- *iter2++ = (GLushort)(extractComponents[k]*65535);
- }
- break;
- case GL_UNSIGNED_SHORT_1_5_5_5_REV:
- extract1555rev(myswapBytes,iter,extractComponents);
- for (k = 0; k < 4; k++) {
- *iter2++ = (GLushort)(extractComponents[k]*65535);
- }
- break;
- case GL_UNSIGNED_SHORT:
- case GL_SHORT:
- if (myswapBytes) {
- widget.ub[0] = iter[1];
- widget.ub[1] = iter[0];
- } else {
- widget.ub[0] = iter[0];
- widget.ub[1] = iter[1];
- }
- if (type == GL_SHORT) {
- if (indexFormat) {
- *iter2++ = widget.s[0];
- } else {
- /* rough approx */
- *iter2++ = widget.s[0]*2;
- }
- } else {
- *iter2++ = widget.us[0];
- }
- break;
- case GL_UNSIGNED_INT_8_8_8_8:
- extract8888(myswapBytes,iter,extractComponents);
- for (k = 0; k < 4; k++) {
- *iter2++ = (GLushort)(extractComponents[k]*65535);
- }
- break;
- case GL_UNSIGNED_INT_8_8_8_8_REV:
- extract8888rev(myswapBytes,iter,extractComponents);
- for (k = 0; k < 4; k++) {
- *iter2++ = (GLushort)(extractComponents[k]*65535);
- }
- break;
- case GL_UNSIGNED_INT_10_10_10_2:
- extract1010102(myswapBytes,iter,extractComponents);
- for (k = 0; k < 4; k++) {
- *iter2++ = (GLushort)(extractComponents[k]*65535);
- }
- break;
- case GL_UNSIGNED_INT_2_10_10_10_REV:
- extract2101010rev(myswapBytes,iter,extractComponents);
- for (k = 0; k < 4; k++) {
- *iter2++ = (GLushort)(extractComponents[k]*65535);
- }
- break;
- case GL_INT:
- case GL_UNSIGNED_INT:
- case GL_FLOAT:
- if (myswapBytes) {
- widget.ub[0] = iter[3];
- widget.ub[1] = iter[2];
- widget.ub[2] = iter[1];
- widget.ub[3] = iter[0];
- } else {
- widget.ub[0] = iter[0];
- widget.ub[1] = iter[1];
- widget.ub[2] = iter[2];
- widget.ub[3] = iter[3];
- }
- if (type == GL_FLOAT) {
- if (indexFormat) {
- *iter2++ = widget.f;
- } else {
- *iter2++ = 65535 * widget.f;
- }
- } else if (type == GL_UNSIGNED_INT) {
- if (indexFormat) {
- *iter2++ = widget.ui;
- } else {
- *iter2++ = widget.ui >> 16;
- }
- } else {
- if (indexFormat) {
- *iter2++ = widget.i;
- } else {
- *iter2++ = widget.i >> 15;
- }
- }
- break;
- default:
- assert(0);
- }
-
- iter+= elementSize;
- } /* for ww */
- rowStart+= rowSize;
-
- iter= rowStart; /* for assertion purposes */
- } /* for hh */
-
- start+= imageSize;
- } /* for dd */
-
- /* iterators should be one byte past end */
- if (!isTypePackedPixel(type)) {
- assert(iter2 == &newImage[width*height*depth*components]);
- }
- else {
- assert(iter2 == &newImage[width*height*depth*
- elements_per_group(format,0)]);
- }
- assert( iter == &((const GLubyte *)userImage)[rowSize*height*depth +
- psm->unpack_skip_rows * rowSize +
- psm->unpack_skip_pixels * groupSize +
- /*3dstuff*/
- psm->unpack_skip_images * imageSize] );
-} /* fillImage3D () */
-
-static void scaleInternal3D(GLint components,
- GLint widthIn, GLint heightIn, GLint depthIn,
- const GLushort *dataIn,
- GLint widthOut, GLint heightOut, GLint depthOut,
- GLushort *dataOut)
-{
- float x, lowx, highx, convx, halfconvx;
- float y, lowy, highy, convy, halfconvy;
- float z, lowz, highz, convz, halfconvz;
- float xpercent,ypercent,zpercent;
- float percent;
- /* Max components in a format is 4, so... */
- float totals[4];
- float volume;
- int i,j,d,k,zint,yint,xint,xindex,yindex,zindex;
- int temp;
-
- convz = (float) depthIn/depthOut;
- convy = (float) heightIn/heightOut;
- convx = (float) widthIn/widthOut;
- halfconvx = convx/2;
- halfconvy = convy/2;
- halfconvz = convz/2;
- for (d = 0; d < depthOut; d++) {
- z = convz * (d+0.5);
- if (depthIn > depthOut) {
- highz = z + halfconvz;
- lowz = z - halfconvz;
- } else {
- highz = z + 0.5;
- lowz = z - 0.5;
- }
- for (i = 0; i < heightOut; i++) {
- y = convy * (i+0.5);
- if (heightIn > heightOut) {
- highy = y + halfconvy;
- lowy = y - halfconvy;
- } else {
- highy = y + 0.5;
- lowy = y - 0.5;
- }
- for (j = 0; j < widthOut; j++) {
- x = convx * (j+0.5);
- if (widthIn > widthOut) {
- highx = x + halfconvx;
- lowx = x - halfconvx;
- } else {
- highx = x + 0.5;
- lowx = x - 0.5;
- }
-
- /*
- ** Ok, now apply box filter to box that goes from (lowx, lowy,
- ** lowz) to (highx, highy, highz) on input data into this pixel
- ** on output data.
- */
- totals[0] = totals[1] = totals[2] = totals[3] = 0.0;
- volume = 0.0;
-
- z = lowz;
- zint = floor(z);
- while (z < highz) {
- zindex = (zint + depthIn) % depthIn;
- if (highz < zint+1) {
- zpercent = highz - z;
- } else {
- zpercent = zint+1 - z;
- }
-
- y = lowy;
- yint = floor(y);
- while (y < highy) {
- yindex = (yint + heightIn) % heightIn;
- if (highy < yint+1) {
- ypercent = highy - y;
- } else {
- ypercent = yint+1 - y;
- }
-
- x = lowx;
- xint = floor(x);
-
- while (x < highx) {
- xindex = (xint + widthIn) % widthIn;
- if (highx < xint+1) {
- xpercent = highx - x;
- } else {
- xpercent = xint+1 - x;
- }
-
- percent = xpercent * ypercent * zpercent;
- volume += percent;
-
- temp = (xindex + (yindex*widthIn) +
- (zindex*widthIn*heightIn)) * components;
- for (k = 0; k < components; k++) {
- assert(0 <= (temp+k) &&
- (temp+k) <
- (widthIn*heightIn*depthIn*components));
- totals[k] += dataIn[temp + k] * percent;
- }
-
- xint++;
- x = xint;
- } /* while x */
-
- yint++;
- y = yint;
- } /* while y */
-
- zint++;
- z = zint;
- } /* while z */
-
- temp = (j + (i * widthOut) +
- (d*widthOut*heightOut)) * components;
- for (k = 0; k < components; k++) {
- /* totals[] should be rounded in the case of enlarging an
- * RGB ramp when the type is 332 or 4444
- */
- assert(0 <= (temp+k) &&
- (temp+k) < (widthOut*heightOut*depthOut*components));
- dataOut[temp + k] = (totals[k]+0.5)/volume;
- }
- } /* for j */
- } /* for i */
- } /* for d */
-} /* scaleInternal3D() */
-
-static void emptyImage3D(const PixelStorageModes *psm,
- GLint width, GLint height, GLint depth,
- GLenum format, GLenum type, GLboolean indexFormat,
- const GLushort *oldImage, void *userImage)
-{
- int myswapBytes;
- int components;
- int groupsPerLine;
- int elementSize;
- int groupSize;
- int rowSize;
- int padding;
- GLubyte *start, *rowStart, *iter;
- int elementsPerLine;
- const GLushort *iter2;
- int ii, jj, dd, k;
- int rowsPerImage;
- int imageSize;
-
- myswapBytes= psm->pack_swap_bytes;
- components = elements_per_group(format,type);
- if (psm->pack_row_length > 0) {
- groupsPerLine = psm->pack_row_length;
- }
- else {
- groupsPerLine = width;
- }
-
- elementSize= bytes_per_element(type);
- groupSize= elementSize * components;
- if (elementSize == 1) myswapBytes= 0;
-
- /* 3dstuff begin */
- if (psm->pack_image_height > 0) {
- rowsPerImage= psm->pack_image_height;
- }
- else {
- rowsPerImage= height;
- }
-
- /* 3dstuff end */
-
- rowSize = groupsPerLine * groupSize;
- padding = rowSize % psm->pack_alignment;
- if (padding) {
- rowSize+= psm->pack_alignment - padding;
- }
-
- imageSize= rowsPerImage * rowSize; /* 3dstuff */
-
- start = (GLubyte *)userImage + psm->pack_skip_rows * rowSize +
- psm->pack_skip_pixels * groupSize +
- /*3dstuff*/
- psm->pack_skip_images * imageSize;
- elementsPerLine= width * components;
-
- iter2 = oldImage;
- for (dd= 0; dd < depth; dd++) {
- rowStart= start;
-
- for (ii= 0; ii< height; ii++) {
- iter = rowStart;
-
- for (jj = 0; jj < elementsPerLine; jj++) {
- Type_Widget widget;
- float shoveComponents[4];
-
- switch(type){
- case GL_UNSIGNED_BYTE:
- if (indexFormat) {
- *iter = *iter2++;
- } else {
- *iter = *iter2++ >> 8;
- }
- break;
- case GL_BYTE:
- if (indexFormat) {
- *((GLbyte *) iter) = *iter2++;
- } else {
- *((GLbyte *) iter) = *iter2++ >> 9;
- }
- break;
- case GL_UNSIGNED_BYTE_3_3_2:
- for (k = 0; k < 3; k++) {
- shoveComponents[k]= *iter2++ / 65535.0;
- }
- shove332(shoveComponents,0,(void *)iter);
- break;
- case GL_UNSIGNED_BYTE_2_3_3_REV:
- for (k = 0; k < 3; k++) {
- shoveComponents[k]= *iter2++ / 65535.0;
- }
- shove233rev(shoveComponents,0,(void *)iter);
- break;
- case GL_UNSIGNED_SHORT_5_6_5:
- for (k = 0; k < 3; k++) {
- shoveComponents[k]= *iter2++ / 65535.0;
- }
- shove565(shoveComponents,0,(void *)&widget.us[0]);
- if (myswapBytes) {
- iter[0] = widget.ub[1];
- iter[1] = widget.ub[0];
- }
- else {
- *(GLushort *)iter = widget.us[0];
- }
- break;
- case GL_UNSIGNED_SHORT_5_6_5_REV:
- for (k = 0; k < 3; k++) {
- shoveComponents[k]= *iter2++ / 65535.0;
- }
- shove565rev(shoveComponents,0,(void *)&widget.us[0]);
- if (myswapBytes) {
- iter[0] = widget.ub[1];
- iter[1] = widget.ub[0];
- }
- else {
- *(GLushort *)iter = widget.us[0];
- }
- break;
- case GL_UNSIGNED_SHORT_4_4_4_4:
- for (k = 0; k < 4; k++) {
- shoveComponents[k]= *iter2++ / 65535.0;
- }
- shove4444(shoveComponents,0,(void *)&widget.us[0]);
- if (myswapBytes) {
- iter[0] = widget.ub[1];
- iter[1] = widget.ub[0];
- } else {
- *(GLushort *)iter = widget.us[0];
- }
- break;
- case GL_UNSIGNED_SHORT_4_4_4_4_REV:
- for (k = 0; k < 4; k++) {
- shoveComponents[k]= *iter2++ / 65535.0;
- }
- shove4444rev(shoveComponents,0,(void *)&widget.us[0]);
- if (myswapBytes) {
- iter[0] = widget.ub[1];
- iter[1] = widget.ub[0];
- } else {
- *(GLushort *)iter = widget.us[0];
- }
- break;
- case GL_UNSIGNED_SHORT_5_5_5_1:
- for (k = 0; k < 4; k++) {
- shoveComponents[k]= *iter2++ / 65535.0;
- }
- shove5551(shoveComponents,0,(void *)&widget.us[0]);
- if (myswapBytes) {
- iter[0] = widget.ub[1];
- iter[1] = widget.ub[0];
- } else {
- *(GLushort *)iter = widget.us[0];
- }
- break;
- case GL_UNSIGNED_SHORT_1_5_5_5_REV:
- for (k = 0; k < 4; k++) {
- shoveComponents[k]= *iter2++ / 65535.0;
- }
- shove1555rev(shoveComponents,0,(void *)&widget.us[0]);
- if (myswapBytes) {
- iter[0] = widget.ub[1];
- iter[1] = widget.ub[0];
- } else {
- *(GLushort *)iter = widget.us[0];
- }
- break;
- case GL_UNSIGNED_SHORT:
- case GL_SHORT:
- if (type == GL_SHORT) {
- if (indexFormat) {
- widget.s[0] = *iter2++;
- } else {
- widget.s[0] = *iter2++ >> 1;
- }
- } else {
- widget.us[0] = *iter2++;
- }
- if (myswapBytes) {
- iter[0] = widget.ub[1];
- iter[1] = widget.ub[0];
- } else {
- iter[0] = widget.ub[0];
- iter[1] = widget.ub[1];
- }
- break;
- case GL_UNSIGNED_INT_8_8_8_8:
- for (k = 0; k < 4; k++) {
- shoveComponents[k]= *iter2++ / 65535.0;
- }
- shove8888(shoveComponents,0,(void *)&widget.ui);
- if (myswapBytes) {
- iter[3] = widget.ub[0];
- iter[2] = widget.ub[1];
- iter[1] = widget.ub[2];
- iter[0] = widget.ub[3];
- } else {
- *(GLuint *)iter= widget.ui;
- }
- break;
- case GL_UNSIGNED_INT_8_8_8_8_REV:
- for (k = 0; k < 4; k++) {
- shoveComponents[k]= *iter2++ / 65535.0;
- }
- shove8888rev(shoveComponents,0,(void *)&widget.ui);
- if (myswapBytes) {
- iter[3] = widget.ub[0];
- iter[2] = widget.ub[1];
- iter[1] = widget.ub[2];
- iter[0] = widget.ub[3];
- } else {
- *(GLuint *)iter= widget.ui;
- }
- break;
- case GL_UNSIGNED_INT_10_10_10_2:
- for (k = 0; k < 4; k++) {
- shoveComponents[k]= *iter2++ / 65535.0;
- }
- shove1010102(shoveComponents,0,(void *)&widget.ui);
- if (myswapBytes) {
- iter[3] = widget.ub[0];
- iter[2] = widget.ub[1];
- iter[1] = widget.ub[2];
- iter[0] = widget.ub[3];
- } else {
- *(GLuint *)iter= widget.ui;
- }
- break;
- case GL_UNSIGNED_INT_2_10_10_10_REV:
- for (k = 0; k < 4; k++) {
- shoveComponents[k]= *iter2++ / 65535.0;
- }
- shove2101010rev(shoveComponents,0,(void *)&widget.ui);
- if (myswapBytes) {
- iter[3] = widget.ub[0];
- iter[2] = widget.ub[1];
- iter[1] = widget.ub[2];
- iter[0] = widget.ub[3];
- } else {
- *(GLuint *)iter= widget.ui;
- }
- break;
- case GL_INT:
- case GL_UNSIGNED_INT:
- case GL_FLOAT:
- if (type == GL_FLOAT) {
- if (indexFormat) {
- widget.f = *iter2++;
- } else {
- widget.f = *iter2++ / (float) 65535.0;
- }
- } else if (type == GL_UNSIGNED_INT) {
- if (indexFormat) {
- widget.ui = *iter2++;
- } else {
- widget.ui = (unsigned int) *iter2++ * 65537;
- }
- } else {
- if (indexFormat) {
- widget.i = *iter2++;
- } else {
- widget.i = ((unsigned int) *iter2++ * 65537)/2;
- }
- }
- if (myswapBytes) {
- iter[3] = widget.ub[0];
- iter[2] = widget.ub[1];
- iter[1] = widget.ub[2];
- iter[0] = widget.ub[3];
- } else {
- iter[0] = widget.ub[0];
- iter[1] = widget.ub[1];
- iter[2] = widget.ub[2];
- iter[3] = widget.ub[3];
- }
- break;
- default:
- assert(0);
- }
-
- iter+= elementSize;
- } /* for jj */
-
- rowStart+= rowSize;
- } /* for ii */
-
- start+= imageSize;
- } /* for dd */
-
- /* iterators should be one byte past end */
- if (!isTypePackedPixel(type)) {
- assert(iter2 == &oldImage[width*height*depth*components]);
- }
- else {
- assert(iter2 == &oldImage[width*height*depth*
- elements_per_group(format,0)]);
- }
- assert( iter == &((GLubyte *)userImage)[rowSize*height*depth +
- psm->unpack_skip_rows * rowSize +
- psm->unpack_skip_pixels * groupSize +
- /*3dstuff*/
- psm->unpack_skip_images * imageSize] );
-} /* emptyImage3D() */
-
-static
-int gluScaleImage3D(GLenum format,
- GLint widthIn, GLint heightIn, GLint depthIn,
- GLenum typeIn, const void *dataIn,
- GLint widthOut, GLint heightOut, GLint depthOut,
- GLenum typeOut, void *dataOut)
-{
- int components;
- GLushort *beforeImage, *afterImage;
- PixelStorageModes psm;
-
- if (widthIn == 0 || heightIn == 0 || depthIn == 0 ||
- widthOut == 0 || heightOut == 0 || depthOut == 0) {
- return 0;
- }
-
- if (widthIn < 0 || heightIn < 0 || depthIn < 0 ||
- widthOut < 0 || heightOut < 0 || depthOut < 0) {
- return GLU_INVALID_VALUE;
- }
-
- if (!legalFormat(format) || !legalType(typeIn) || !legalType(typeOut) ||
- typeIn == GL_BITMAP || typeOut == GL_BITMAP) {
- return GLU_INVALID_ENUM;
- }
- if (!isLegalFormatForPackedPixelType(format, typeIn)) {
- return GLU_INVALID_OPERATION;
- }
- if (!isLegalFormatForPackedPixelType(format, typeOut)) {
- return GLU_INVALID_OPERATION;
- }
-
- beforeImage = malloc(imageSize3D(widthIn, heightIn, depthIn, format,
- GL_UNSIGNED_SHORT));
- afterImage = malloc(imageSize3D(widthOut, heightOut, depthOut, format,
- GL_UNSIGNED_SHORT));
- if (beforeImage == NULL || afterImage == NULL) {
- free(beforeImage);
- free(afterImage);
- return GLU_OUT_OF_MEMORY;
- }
- retrieveStoreModes3D(&psm);
-
- fillImage3D(&psm,widthIn,heightIn,depthIn,format,typeIn, is_index(format),
- dataIn, beforeImage);
- components = elements_per_group(format,0);
- scaleInternal3D(components,widthIn,heightIn,depthIn,beforeImage,
- widthOut,heightOut,depthOut,afterImage);
- emptyImage3D(&psm,widthOut,heightOut,depthOut,format,typeOut,
- is_index(format),afterImage, dataOut);
- free((void *) beforeImage);
- free((void *) afterImage);
-
- return 0;
-} /* gluScaleImage3D() */
-
-
-static void closestFit3D(GLenum target, GLint width, GLint height, GLint depth,
- GLint internalFormat, GLenum format, GLenum type,
- GLint *newWidth, GLint *newHeight, GLint *newDepth)
-{
- GLint widthPowerOf2= nearestPower(width);
- GLint heightPowerOf2= nearestPower(height);
- GLint depthPowerOf2= nearestPower(depth);
- GLint proxyWidth;
-
- do {
- /* compute level 1 width & height & depth, clamping each at 1 */
- GLint widthAtLevelOne= (widthPowerOf2 > 1) ?
- widthPowerOf2 >> 1 :
- widthPowerOf2;
- GLint heightAtLevelOne= (heightPowerOf2 > 1) ?
- heightPowerOf2 >> 1 :
- heightPowerOf2;
- GLint depthAtLevelOne= (depthPowerOf2 > 1) ?
- depthPowerOf2 >> 1 :
- depthPowerOf2;
- GLenum proxyTarget = GL_PROXY_TEXTURE_3D;
- assert(widthAtLevelOne > 0);
- assert(heightAtLevelOne > 0);
- assert(depthAtLevelOne > 0);
-
- /* does width x height x depth at level 1 & all their mipmaps fit? */
- assert(target == GL_TEXTURE_3D || target == GL_PROXY_TEXTURE_3D);
- gluTexImage3D(proxyTarget, 1, /* must be non-zero */
- internalFormat,
- widthAtLevelOne,heightAtLevelOne,depthAtLevelOne,
- 0,format,type,NULL);
- glGetTexLevelParameteriv(proxyTarget, 1,GL_TEXTURE_WIDTH,&proxyWidth);
- /* does it fit??? */
- if (proxyWidth == 0) { /* nope, so try again with these sizes */
- if (widthPowerOf2 == 1 && heightPowerOf2 == 1 &&
- depthPowerOf2 == 1) {
- *newWidth= *newHeight= *newDepth= 1; /* must fit 1x1x1 texture */
- return;
- }
- widthPowerOf2= widthAtLevelOne;
- heightPowerOf2= heightAtLevelOne;
- depthPowerOf2= depthAtLevelOne;
- }
- /* else it does fit */
- } while (proxyWidth == 0);
- /* loop must terminate! */
-
- /* return the width & height at level 0 that fits */
- *newWidth= widthPowerOf2;
- *newHeight= heightPowerOf2;
- *newDepth= depthPowerOf2;
-/*printf("Proxy Textures\n");*/
-} /* closestFit3D() */
-
-static void halveImagePackedPixelSlice(int components,
- void (*extractPackedPixel)
- (int, const void *,GLfloat []),
- void (*shovePackedPixel)
- (const GLfloat [],int, void *),
- GLint width, GLint height, GLint depth,
- const void *dataIn, void *dataOut,
- GLint pixelSizeInBytes,
- GLint rowSizeInBytes,
- GLint imageSizeInBytes,
- GLint isSwap)
-{
- int ii, jj;
- int halfWidth= width / 2;
- int halfHeight= height / 2;
- int halfDepth= depth / 2;
- const char *src= (const char *)dataIn;
- int outIndex= 0;
-
- assert((width == 1 || height == 1) && depth >= 2);
-
- if (width == height) { /* a 1-pixel column viewed from top */
- assert(width == 1 && height == 1);
- assert(depth >= 2);
-
- for (ii= 0; ii< halfDepth; ii++) {
- float totals[4];
- float extractTotals[BOX2][4];
- int cc;
-
- (*extractPackedPixel)(isSwap,src,&extractTotals[0][0]);
- (*extractPackedPixel)(isSwap,(src+imageSizeInBytes),
- &extractTotals[1][0]);
- for (cc = 0; cc < components; cc++) {
- int kk;
-
- /* average 2 pixels since only a column */
- totals[cc]= 0.0;
- /* totals[RED]= extractTotals[0][RED]+extractTotals[1][RED];
- * totals[RED]/= 2.0;
- */
- for (kk = 0; kk < BOX2; kk++) {
- totals[cc]+= extractTotals[kk][cc];
- }
- totals[cc]/= (float)BOX2;
- } /* for cc */
-
- (*shovePackedPixel)(totals,outIndex,dataOut);
- outIndex++;
- /* skip over to next group of 2 */
- src+= imageSizeInBytes + imageSizeInBytes;
- } /* for ii */
- }
- else if (height == 1) { /* horizontal slice viewed from top */
- assert(width != 1);
-
- for (ii= 0; ii< halfDepth; ii++) {
- for (jj= 0; jj< halfWidth; jj++) {
- float totals[4];
- float extractTotals[BOX4][4];
- int cc;
-
- (*extractPackedPixel)(isSwap,src,
- &extractTotals[0][0]);
- (*extractPackedPixel)(isSwap,(src+pixelSizeInBytes),
- &extractTotals[1][0]);
- (*extractPackedPixel)(isSwap,(src+imageSizeInBytes),
- &extractTotals[2][0]);
- (*extractPackedPixel)(isSwap,
- (src+imageSizeInBytes+pixelSizeInBytes),
- &extractTotals[3][0]);
- for (cc = 0; cc < components; cc++) {
- int kk;
-
- /* grab 4 pixels to average */
- totals[cc]= 0.0;
- /* totals[RED]= extractTotals[0][RED]+extractTotals[1][RED]+
- * extractTotals[2][RED]+extractTotals[3][RED];
- * totals[RED]/= 4.0;
- */
- for (kk = 0; kk < BOX4; kk++) {
- totals[cc]+= extractTotals[kk][cc];
- }
- totals[cc]/= (float)BOX4;
- }
- (*shovePackedPixel)(totals,outIndex,dataOut);
-
- outIndex++;
- /* skip over to next horizontal square of 4 */
- src+= imageSizeInBytes + imageSizeInBytes;
- }
- }
-
- /* assert() */
- }
- else if (width == 1) { /* vertical slice viewed from top */
- assert(height != 1);
-
- for (ii= 0; ii< halfDepth; ii++) {
- for (jj= 0; jj< halfHeight; jj++) {
- float totals[4];
- float extractTotals[BOX4][4];
- int cc;
-
- (*extractPackedPixel)(isSwap,src,
- &extractTotals[0][0]);
- (*extractPackedPixel)(isSwap,(src+rowSizeInBytes),
- &extractTotals[1][0]);
- (*extractPackedPixel)(isSwap,(src+imageSizeInBytes),
- &extractTotals[2][0]);
- (*extractPackedPixel)(isSwap,
- (src+imageSizeInBytes+rowSizeInBytes),
- &extractTotals[3][0]);
- for (cc = 0; cc < components; cc++) {
- int kk;
-
- /* grab 4 pixels to average */
- totals[cc]= 0.0;
- /* totals[RED]= extractTotals[0][RED]+extractTotals[1][RED]+
- * extractTotals[2][RED]+extractTotals[3][RED];
- * totals[RED]/= 4.0;
- */
- for (kk = 0; kk < BOX4; kk++) {
- totals[cc]+= extractTotals[kk][cc];
- }
- totals[cc]/= (float)BOX4;
- }
- (*shovePackedPixel)(totals,outIndex,dataOut);
-
- outIndex++;
-
- /* skip over to next vertical square of 4 */
- src+= imageSizeInBytes + imageSizeInBytes;
- }
- }
- /* assert() */
- }
-
-} /* halveImagePackedPixelSlice() */
-
-static void halveImagePackedPixel3D(int components,
- void (*extractPackedPixel)
- (int, const void *,GLfloat []),
- void (*shovePackedPixel)
- (const GLfloat [],int, void *),
- GLint width, GLint height, GLint depth,
- const void *dataIn, void *dataOut,
- GLint pixelSizeInBytes,
- GLint rowSizeInBytes,
- GLint imageSizeInBytes,
- GLint isSwap)
-{
- if (depth == 1) {
- assert(1 <= width && 1 <= height);
-
- halveImagePackedPixel(components,extractPackedPixel,shovePackedPixel,
- width,height,dataIn,dataOut,pixelSizeInBytes,
- rowSizeInBytes,isSwap);
- return;
- }
- /* a horizontal or vertical slice viewed from top */
- else if (width == 1 || height == 1) {
- assert(1 <= depth);
-
- halveImagePackedPixelSlice(components,
- extractPackedPixel,shovePackedPixel,
- width, height, depth, dataIn, dataOut,
- pixelSizeInBytes, rowSizeInBytes,
- imageSizeInBytes, isSwap);
- return;
- }
- {
- int ii, jj, dd;
-
- int halfWidth= width / 2;
- int halfHeight= height / 2;
- int halfDepth= depth / 2;
- const char *src= (const char *) dataIn;
- int padBytes= rowSizeInBytes - (width*pixelSizeInBytes);
- int outIndex= 0;
-
- for (dd= 0; dd < halfDepth; dd++) {
- for (ii= 0; ii< halfHeight; ii++) {
- for (jj= 0; jj< halfWidth; jj++) {
-#define BOX8 8
- float totals[4]; /* 4 is maximum components */
- float extractTotals[BOX8][4]; /* 4 is maximum components */
- int cc;
-
- (*extractPackedPixel)(isSwap,src,
- &extractTotals[0][0]);
- (*extractPackedPixel)(isSwap,(src+pixelSizeInBytes),
- &extractTotals[1][0]);
- (*extractPackedPixel)(isSwap,(src+rowSizeInBytes),
- &extractTotals[2][0]);
- (*extractPackedPixel)(isSwap,
- (src+rowSizeInBytes+pixelSizeInBytes),
- &extractTotals[3][0]);
-
- (*extractPackedPixel)(isSwap,(src+imageSizeInBytes),
- &extractTotals[4][0]);
- (*extractPackedPixel)(isSwap,(src+pixelSizeInBytes+imageSizeInBytes),
- &extractTotals[5][0]);
- (*extractPackedPixel)(isSwap,(src+rowSizeInBytes+imageSizeInBytes),
- &extractTotals[6][0]);
- (*extractPackedPixel)(isSwap,
- (src+rowSizeInBytes+pixelSizeInBytes+imageSizeInBytes),
- &extractTotals[7][0]);
- for (cc = 0; cc < components; cc++) {
- int kk;
-
- /* grab 8 pixels to average */
- totals[cc]= 0.0;
- /* totals[RED]= extractTotals[0][RED]+extractTotals[1][RED]+
- * extractTotals[2][RED]+extractTotals[3][RED]+
- * extractTotals[4][RED]+extractTotals[5][RED]+
- * extractTotals[6][RED]+extractTotals[7][RED];
- * totals[RED]/= 8.0;
- */
- for (kk = 0; kk < BOX8; kk++) {
- totals[cc]+= extractTotals[kk][cc];
- }
- totals[cc]/= (float)BOX8;
- }
- (*shovePackedPixel)(totals,outIndex,dataOut);
-
- outIndex++;
- /* skip over to next square of 4 */
- src+= pixelSizeInBytes + pixelSizeInBytes;
- }
- /* skip past pad bytes, if any, to get to next row */
- src+= padBytes;
-
- /* src is at beginning of a row here, but it's the second row of
- * the square block of 4 pixels that we just worked on so we
- * need to go one more row.
- * i.e.,
- * OO...
- * here -->OO...
- * but want -->OO...
- * OO...
- * ...
- */
- src+= rowSizeInBytes;
- }
-
- src+= imageSizeInBytes;
- } /* for dd */
-
- /* both pointers must reach one byte after the end */
- assert(src == &((const char *)dataIn)[rowSizeInBytes*height*depth]);
- assert(outIndex == halfWidth * halfHeight * halfDepth);
- } /* for dd */
-
-} /* halveImagePackedPixel3D() */
-
-static int gluBuild3DMipmapLevelsCore(GLenum target, GLint internalFormat,
- GLsizei width,
- GLsizei height,
- GLsizei depth,
- GLsizei widthPowerOf2,
- GLsizei heightPowerOf2,
- GLsizei depthPowerOf2,
- GLenum format, GLenum type,
- GLint userLevel,
- GLint baseLevel,GLint maxLevel,
- const void *data)
-{
- GLint newWidth, newHeight, newDepth;
- GLint level, levels;
- const void *usersImage;
- void *srcImage, *dstImage;
- __GLU_INIT_SWAP_IMAGE;
- GLint memReq;
- GLint cmpts;
-
- GLint myswapBytes, groupsPerLine, elementSize, groupSize;
- GLint rowsPerImage, imageSize;
- GLint rowSize, padding;
- PixelStorageModes psm;
-
- assert(checkMipmapArgs(internalFormat,format,type) == 0);
- assert(width >= 1 && height >= 1 && depth >= 1);
- assert(type != GL_BITMAP);
-
- srcImage = dstImage = NULL;
-
- newWidth= widthPowerOf2;
- newHeight= heightPowerOf2;
- newDepth= depthPowerOf2;
- levels = computeLog(newWidth);
- level = computeLog(newHeight);
- if (level > levels) levels=level;
- level = computeLog(newDepth);
- if (level > levels) levels=level;
-
- levels+= userLevel;
-
- retrieveStoreModes3D(&psm);
- myswapBytes = psm.unpack_swap_bytes;
- cmpts = elements_per_group(format,type);
- if (psm.unpack_row_length > 0) {
- groupsPerLine = psm.unpack_row_length;
- } else {
- groupsPerLine = width;
- }
-
- elementSize = bytes_per_element(type);
- groupSize = elementSize * cmpts;
- if (elementSize == 1) myswapBytes = 0;
-
- /* 3dstuff begin */
- if (psm.unpack_image_height > 0) {
- rowsPerImage= psm.unpack_image_height;
- }
- else {
- rowsPerImage= height;
- }
-
- /* 3dstuff end */
- rowSize = groupsPerLine * groupSize;
- padding = (rowSize % psm.unpack_alignment);
- if (padding) {
- rowSize += psm.unpack_alignment - padding;
- }
-
- imageSize= rowsPerImage * rowSize; /* 3dstuff */
-
- usersImage = (const GLubyte *)data + psm.unpack_skip_rows * rowSize +
- psm.unpack_skip_pixels * groupSize +
- /* 3dstuff */
- psm.unpack_skip_images * imageSize;
-
- glPixelStorei(GL_UNPACK_SKIP_ROWS, 0);
- glPixelStorei(GL_UNPACK_SKIP_PIXELS, 0);
- glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
- glPixelStorei(GL_UNPACK_SKIP_IMAGES, 0);
- glPixelStorei(GL_UNPACK_IMAGE_HEIGHT, 0);
-
- level = userLevel;
-
- if (width == newWidth && height == newHeight && depth == newDepth) {
- /* Use usersImage for level userLevel */
- if (baseLevel <= level && level <= maxLevel) {
- gluTexImage3D(target, level, internalFormat, width,
- height, depth, 0, format, type,
- usersImage);
- }
- if(levels == 0) { /* we're done. clean up and return */
- glPixelStorei(GL_UNPACK_ALIGNMENT, psm.unpack_alignment);
- glPixelStorei(GL_UNPACK_SKIP_ROWS, psm.unpack_skip_rows);
- glPixelStorei(GL_UNPACK_SKIP_PIXELS, psm.unpack_skip_pixels);
- glPixelStorei(GL_UNPACK_ROW_LENGTH, psm.unpack_row_length);
- glPixelStorei(GL_UNPACK_SWAP_BYTES, psm.unpack_swap_bytes);
- glPixelStorei(GL_UNPACK_SKIP_IMAGES, psm.unpack_skip_images);
- glPixelStorei(GL_UNPACK_IMAGE_HEIGHT, psm.unpack_image_height);
- return 0;
- }
- {
- int nextWidth= newWidth/2;
- int nextHeight= newHeight/2;
- int nextDepth= newDepth/2;
-
- /* clamp to 1 */
- if (nextWidth < 1) nextWidth= 1;
- if (nextHeight < 1) nextHeight= 1;
- if (nextDepth < 1) nextDepth= 1;
- memReq = imageSize3D(nextWidth, nextHeight, nextDepth, format, type);
- }
- switch(type) {
- case GL_UNSIGNED_BYTE:
- dstImage = (GLubyte *)malloc(memReq);
- break;
- case GL_BYTE:
- dstImage = (GLbyte *)malloc(memReq);
- break;
- case GL_UNSIGNED_SHORT:
- dstImage = (GLushort *)malloc(memReq);
- break;
- case GL_SHORT:
- dstImage = (GLshort *)malloc(memReq);
- break;
- case GL_UNSIGNED_INT:
- dstImage = (GLuint *)malloc(memReq);
- break;
- case GL_INT:
- dstImage = (GLint *)malloc(memReq);
- break;
- case GL_FLOAT:
- dstImage = (GLfloat *)malloc(memReq);
- break;
- case GL_UNSIGNED_BYTE_3_3_2:
- case GL_UNSIGNED_BYTE_2_3_3_REV:
- dstImage = (GLubyte *)malloc(memReq);
- break;
- case GL_UNSIGNED_SHORT_5_6_5:
- case GL_UNSIGNED_SHORT_5_6_5_REV:
- case GL_UNSIGNED_SHORT_4_4_4_4:
- case GL_UNSIGNED_SHORT_4_4_4_4_REV:
- case GL_UNSIGNED_SHORT_5_5_5_1:
- case GL_UNSIGNED_SHORT_1_5_5_5_REV:
- dstImage = (GLushort *)malloc(memReq);
- break;
- case GL_UNSIGNED_INT_8_8_8_8:
- case GL_UNSIGNED_INT_8_8_8_8_REV:
- case GL_UNSIGNED_INT_10_10_10_2:
- case GL_UNSIGNED_INT_2_10_10_10_REV:
- dstImage = (GLuint *)malloc(memReq);
- break;
- default:
- return GLU_INVALID_ENUM; /* assertion */
- }
- if (dstImage == NULL) {
- glPixelStorei(GL_UNPACK_ALIGNMENT, psm.unpack_alignment);
- glPixelStorei(GL_UNPACK_SKIP_ROWS, psm.unpack_skip_rows);
- glPixelStorei(GL_UNPACK_SKIP_PIXELS, psm.unpack_skip_pixels);
- glPixelStorei(GL_UNPACK_ROW_LENGTH, psm.unpack_row_length);
- glPixelStorei(GL_UNPACK_SWAP_BYTES, psm.unpack_swap_bytes);
- glPixelStorei(GL_UNPACK_SKIP_IMAGES, psm.unpack_skip_images);
- glPixelStorei(GL_UNPACK_IMAGE_HEIGHT, psm.unpack_image_height);
- return GLU_OUT_OF_MEMORY;
- }
- else
- switch(type) {
- case GL_UNSIGNED_BYTE:
- if (depth > 1) {
- halveImage3D(cmpts,extractUbyte,shoveUbyte,
- width,height,depth,
- usersImage,dstImage,elementSize,groupSize,rowSize,
- imageSize,myswapBytes);
- }
- else {
- halveImage_ubyte(cmpts,width,height,usersImage,dstImage,
- elementSize,rowSize,groupSize);
- }
- break;
- case GL_BYTE:
- if (depth > 1) {
- halveImage3D(cmpts,extractSbyte,shoveSbyte,
- width,height,depth,
- usersImage,dstImage,elementSize,groupSize,rowSize,
- imageSize,myswapBytes);
- }
- else {
- halveImage_byte(cmpts,width,height,usersImage,dstImage,
- elementSize,rowSize,groupSize);
- }
- break;
- case GL_UNSIGNED_SHORT:
- if (depth > 1) {
- halveImage3D(cmpts,extractUshort,shoveUshort,
- width,height,depth,
- usersImage,dstImage,elementSize,groupSize,rowSize,
- imageSize,myswapBytes);
- }
- else {
- halveImage_ushort(cmpts,width,height,usersImage,dstImage,
- elementSize,rowSize,groupSize,myswapBytes);
- }
- break;
- case GL_SHORT:
- if (depth > 1) {
- halveImage3D(cmpts,extractSshort,shoveSshort,
- width,height,depth,
- usersImage,dstImage,elementSize,groupSize,rowSize,
- imageSize,myswapBytes);
- }
- else {
- halveImage_short(cmpts,width,height,usersImage,dstImage,
- elementSize,rowSize,groupSize,myswapBytes);
- }
- break;
- case GL_UNSIGNED_INT:
- if (depth > 1) {
- halveImage3D(cmpts,extractUint,shoveUint,
- width,height,depth,
- usersImage,dstImage,elementSize,groupSize,rowSize,
- imageSize,myswapBytes);
- }
- else {
- halveImage_uint(cmpts,width,height,usersImage,dstImage,
- elementSize,rowSize,groupSize,myswapBytes);
- }
- break;
- case GL_INT:
- if (depth > 1) {
- halveImage3D(cmpts,extractSint,shoveSint,
- width,height,depth,
- usersImage,dstImage,elementSize,groupSize,rowSize,
- imageSize,myswapBytes);
- }
- else {
- halveImage_int(cmpts,width,height,usersImage,dstImage,
- elementSize,rowSize,groupSize,myswapBytes);
- }
- break;
- case GL_FLOAT:
- if (depth > 1 ) {
- halveImage3D(cmpts,extractFloat,shoveFloat,
- width,height,depth,
- usersImage,dstImage,elementSize,groupSize,rowSize,
- imageSize,myswapBytes);
- }
- else {
- halveImage_float(cmpts,width,height,usersImage,dstImage,
- elementSize,rowSize,groupSize,myswapBytes);
- }
- break;
- case GL_UNSIGNED_BYTE_3_3_2:
- assert(format == GL_RGB);
- halveImagePackedPixel3D(3,extract332,shove332,
- width,height,depth,usersImage,dstImage,
- elementSize,rowSize,imageSize,myswapBytes);
- break;
- case GL_UNSIGNED_BYTE_2_3_3_REV:
- assert(format == GL_RGB);
- halveImagePackedPixel3D(3,extract233rev,shove233rev,
- width,height,depth,usersImage,dstImage,
- elementSize,rowSize,imageSize,myswapBytes);
- break;
- case GL_UNSIGNED_SHORT_5_6_5:
- halveImagePackedPixel3D(3,extract565,shove565,
- width,height,depth,usersImage,dstImage,
- elementSize,rowSize,imageSize,myswapBytes);
- break;
- case GL_UNSIGNED_SHORT_5_6_5_REV:
- halveImagePackedPixel3D(3,extract565rev,shove565rev,
- width,height,depth,usersImage,dstImage,
- elementSize,rowSize,imageSize,myswapBytes);
- break;
- case GL_UNSIGNED_SHORT_4_4_4_4:
- halveImagePackedPixel3D(4,extract4444,shove4444,
- width,height,depth,usersImage,dstImage,
- elementSize,rowSize,imageSize,myswapBytes);
- break;
- case GL_UNSIGNED_SHORT_4_4_4_4_REV:
- halveImagePackedPixel3D(4,extract4444rev,shove4444rev,
- width,height,depth,usersImage,dstImage,
- elementSize,rowSize,imageSize,myswapBytes);
- break;
- case GL_UNSIGNED_SHORT_5_5_5_1:
- halveImagePackedPixel3D(4,extract5551,shove5551,
- width,height,depth,usersImage,dstImage,
- elementSize,rowSize,imageSize,myswapBytes);
- break;
- case GL_UNSIGNED_SHORT_1_5_5_5_REV:
- halveImagePackedPixel3D(4,extract1555rev,shove1555rev,
- width,height,depth,usersImage,dstImage,
- elementSize,rowSize,imageSize,myswapBytes);
- break;
- case GL_UNSIGNED_INT_8_8_8_8:
- halveImagePackedPixel3D(4,extract8888,shove8888,
- width,height,depth,usersImage,dstImage,
- elementSize,rowSize,imageSize,myswapBytes);
- break;
- case GL_UNSIGNED_INT_8_8_8_8_REV:
- halveImagePackedPixel3D(4,extract8888rev,shove8888rev,
- width,height,depth,usersImage,dstImage,
- elementSize,rowSize,imageSize,myswapBytes);
- break;
- case GL_UNSIGNED_INT_10_10_10_2:
- halveImagePackedPixel3D(4,extract1010102,shove1010102,
- width,height,depth,usersImage,dstImage,
- elementSize,rowSize,imageSize,myswapBytes);
- break;
- case GL_UNSIGNED_INT_2_10_10_10_REV:
- halveImagePackedPixel3D(4,extract2101010rev,shove2101010rev,
- width,height,depth,usersImage,dstImage,
- elementSize,rowSize,imageSize,myswapBytes);
- break;
- default:
- assert(0);
- break;
- }
- newWidth = width/2;
- newHeight = height/2;
- newDepth = depth/2;
- /* clamp to 1 */
- if (newWidth < 1) newWidth= 1;
- if (newHeight < 1) newHeight= 1;
- if (newDepth < 1) newDepth= 1;
-
- myswapBytes = 0;
- rowSize = newWidth * groupSize;
- imageSize= rowSize * newHeight; /* 3dstuff */
- memReq = imageSize3D(newWidth, newHeight, newDepth, format, type);
- /* Swap srcImage and dstImage */
- __GLU_SWAP_IMAGE(srcImage,dstImage);
- switch(type) {
- case GL_UNSIGNED_BYTE:
- dstImage = (GLubyte *)malloc(memReq);
- break;
- case GL_BYTE:
- dstImage = (GLbyte *)malloc(memReq);
- break;
- case GL_UNSIGNED_SHORT:
- dstImage = (GLushort *)malloc(memReq);
- break;
- case GL_SHORT:
- dstImage = (GLshort *)malloc(memReq);
- break;
- case GL_UNSIGNED_INT:
- dstImage = (GLuint *)malloc(memReq);
- break;
- case GL_INT:
- dstImage = (GLint *)malloc(memReq);
- break;
- case GL_FLOAT:
- dstImage = (GLfloat *)malloc(memReq);
- break;
- case GL_UNSIGNED_BYTE_3_3_2:
- case GL_UNSIGNED_BYTE_2_3_3_REV:
- dstImage = (GLubyte *)malloc(memReq);
- break;
- case GL_UNSIGNED_SHORT_5_6_5:
- case GL_UNSIGNED_SHORT_5_6_5_REV:
- case GL_UNSIGNED_SHORT_4_4_4_4:
- case GL_UNSIGNED_SHORT_4_4_4_4_REV:
- case GL_UNSIGNED_SHORT_5_5_5_1:
- case GL_UNSIGNED_SHORT_1_5_5_5_REV:
- dstImage = (GLushort *)malloc(memReq);
- break;
- case GL_UNSIGNED_INT_8_8_8_8:
- case GL_UNSIGNED_INT_8_8_8_8_REV:
- case GL_UNSIGNED_INT_10_10_10_2:
- case GL_UNSIGNED_INT_2_10_10_10_REV:
- dstImage = (GLuint *)malloc(memReq);
- break;
- default:
- return GLU_INVALID_ENUM; /* assertion */
- }
- if (dstImage == NULL) {
- glPixelStorei(GL_UNPACK_ALIGNMENT, psm.unpack_alignment);
- glPixelStorei(GL_UNPACK_SKIP_ROWS, psm.unpack_skip_rows);
- glPixelStorei(GL_UNPACK_SKIP_PIXELS, psm.unpack_skip_pixels);
- glPixelStorei(GL_UNPACK_ROW_LENGTH, psm.unpack_row_length);
- glPixelStorei(GL_UNPACK_SWAP_BYTES, psm.unpack_swap_bytes);
- glPixelStorei(GL_UNPACK_SKIP_IMAGES, psm.unpack_skip_images);
- glPixelStorei(GL_UNPACK_IMAGE_HEIGHT, psm.unpack_image_height);
- free(srcImage);
- return GLU_OUT_OF_MEMORY;
- }
- /* level userLevel+1 is in srcImage; level userLevel already saved */
- level = userLevel+1;
- } else {/* user's image is *not* nice power-of-2 sized square */
- memReq = imageSize3D(newWidth, newHeight, newDepth, format, type);
- switch(type) {
- case GL_UNSIGNED_BYTE:
- dstImage = (GLubyte *)malloc(memReq);
- break;
- case GL_BYTE:
- dstImage = (GLbyte *)malloc(memReq);
- break;
- case GL_UNSIGNED_SHORT:
- dstImage = (GLushort *)malloc(memReq);
- break;
- case GL_SHORT:
- dstImage = (GLshort *)malloc(memReq);
- break;
- case GL_UNSIGNED_INT:
- dstImage = (GLuint *)malloc(memReq);
- break;
- case GL_INT:
- dstImage = (GLint *)malloc(memReq);
- break;
- case GL_FLOAT:
- dstImage = (GLfloat *)malloc(memReq);
- break;
- case GL_UNSIGNED_BYTE_3_3_2:
- case GL_UNSIGNED_BYTE_2_3_3_REV:
- dstImage = (GLubyte *)malloc(memReq);
- break;
- case GL_UNSIGNED_SHORT_5_6_5:
- case GL_UNSIGNED_SHORT_5_6_5_REV:
- case GL_UNSIGNED_SHORT_4_4_4_4:
- case GL_UNSIGNED_SHORT_4_4_4_4_REV:
- case GL_UNSIGNED_SHORT_5_5_5_1:
- case GL_UNSIGNED_SHORT_1_5_5_5_REV:
- dstImage = (GLushort *)malloc(memReq);
- break;
- case GL_UNSIGNED_INT_8_8_8_8:
- case GL_UNSIGNED_INT_8_8_8_8_REV:
- case GL_UNSIGNED_INT_10_10_10_2:
- case GL_UNSIGNED_INT_2_10_10_10_REV:
- dstImage = (GLuint *)malloc(memReq);
- break;
- default:
- return GLU_INVALID_ENUM; /* assertion */
- }
-
- if (dstImage == NULL) {
- glPixelStorei(GL_UNPACK_ALIGNMENT, psm.unpack_alignment);
- glPixelStorei(GL_UNPACK_SKIP_ROWS, psm.unpack_skip_rows);
- glPixelStorei(GL_UNPACK_SKIP_PIXELS, psm.unpack_skip_pixels);
- glPixelStorei(GL_UNPACK_ROW_LENGTH, psm.unpack_row_length);
- glPixelStorei(GL_UNPACK_SWAP_BYTES, psm.unpack_swap_bytes);
- glPixelStorei(GL_UNPACK_SKIP_IMAGES, psm.unpack_skip_images);
- glPixelStorei(GL_UNPACK_IMAGE_HEIGHT, psm.unpack_image_height);
- return GLU_OUT_OF_MEMORY;
- }
- /*printf("Build3DMipmaps(): ScaleImage3D %d %d %d->%d %d %d\n",
- width,height,depth,newWidth,newHeight,newDepth);*/
-
- gluScaleImage3D(format, width, height, depth, type, usersImage,
- newWidth, newHeight, newDepth, type, dstImage);
-
- myswapBytes = 0;
- rowSize = newWidth * groupSize;
- imageSize = rowSize * newHeight; /* 3dstuff */
- /* Swap dstImage and srcImage */
- __GLU_SWAP_IMAGE(srcImage,dstImage);
-
- if(levels != 0) { /* use as little memory as possible */
- {
- int nextWidth= newWidth/2;
- int nextHeight= newHeight/2;
- int nextDepth= newDepth/2;
- if (nextWidth < 1) nextWidth= 1;
- if (nextHeight < 1) nextHeight= 1;
- if (nextDepth < 1) nextDepth= 1;
-
- memReq = imageSize3D(nextWidth, nextHeight, nextDepth, format, type);
- }
- switch(type) {
- case GL_UNSIGNED_BYTE:
- dstImage = (GLubyte *)malloc(memReq);
- break;
- case GL_BYTE:
- dstImage = (GLbyte *)malloc(memReq);
- break;
- case GL_UNSIGNED_SHORT:
- dstImage = (GLushort *)malloc(memReq);
- break;
- case GL_SHORT:
- dstImage = (GLshort *)malloc(memReq);
- break;
- case GL_UNSIGNED_INT:
- dstImage = (GLuint *)malloc(memReq);
- break;
- case GL_INT:
- dstImage = (GLint *)malloc(memReq);
- break;
- case GL_FLOAT:
- dstImage = (GLfloat *)malloc(memReq);
- break;
- case GL_UNSIGNED_BYTE_3_3_2:
- case GL_UNSIGNED_BYTE_2_3_3_REV:
- dstImage = (GLubyte *)malloc(memReq);
- break;
- case GL_UNSIGNED_SHORT_5_6_5:
- case GL_UNSIGNED_SHORT_5_6_5_REV:
- case GL_UNSIGNED_SHORT_4_4_4_4:
- case GL_UNSIGNED_SHORT_4_4_4_4_REV:
- case GL_UNSIGNED_SHORT_5_5_5_1:
- case GL_UNSIGNED_SHORT_1_5_5_5_REV:
- dstImage = (GLushort *)malloc(memReq);
- break;
- case GL_UNSIGNED_INT_8_8_8_8:
- case GL_UNSIGNED_INT_8_8_8_8_REV:
- case GL_UNSIGNED_INT_10_10_10_2:
- case GL_UNSIGNED_INT_2_10_10_10_REV:
- dstImage = (GLuint *)malloc(memReq);
- break;
- default:
- return GLU_INVALID_ENUM; /* assertion */
- }
- if (dstImage == NULL) {
- glPixelStorei(GL_UNPACK_ALIGNMENT, psm.unpack_alignment);
- glPixelStorei(GL_UNPACK_SKIP_ROWS, psm.unpack_skip_rows);
- glPixelStorei(GL_UNPACK_SKIP_PIXELS, psm.unpack_skip_pixels);
- glPixelStorei(GL_UNPACK_ROW_LENGTH, psm.unpack_row_length);
- glPixelStorei(GL_UNPACK_SWAP_BYTES, psm.unpack_swap_bytes);
- glPixelStorei(GL_UNPACK_SKIP_IMAGES, psm.unpack_skip_images);
- glPixelStorei(GL_UNPACK_IMAGE_HEIGHT, psm.unpack_image_height);
- free(srcImage);
- return GLU_OUT_OF_MEMORY;
- }
- }
- /* level userLevel is in srcImage; nothing saved yet */
- level = userLevel;
- }
-
- glPixelStorei(GL_UNPACK_SWAP_BYTES, GL_FALSE);
- if (baseLevel <= level && level <= maxLevel) {
- gluTexImage3D(target, level, internalFormat, newWidth, newHeight, newDepth,
- 0,format, type, (void *)srcImage);
- }
- level++; /* update current level for the loop */
- for (; level <= levels; level++) {
- switch(type) {
- case GL_UNSIGNED_BYTE:
- if (newDepth > 1) {
- halveImage3D(cmpts,extractUbyte,shoveUbyte,
- newWidth,newHeight,newDepth,
- srcImage,dstImage,elementSize,groupSize,rowSize,
- imageSize,myswapBytes);
- }
- else {
- halveImage_ubyte(cmpts,newWidth,newHeight,srcImage,dstImage,
- elementSize,rowSize,groupSize);
- }
- break;
- case GL_BYTE:
- if (newDepth > 1) {
- halveImage3D(cmpts,extractSbyte,shoveSbyte,
- newWidth,newHeight,newDepth,
- srcImage,dstImage,elementSize,groupSize,rowSize,
- imageSize,myswapBytes);
- }
- else {
- halveImage_byte(cmpts,newWidth,newHeight,srcImage,dstImage,
- elementSize,rowSize,groupSize);
- }
- break;
- case GL_UNSIGNED_SHORT:
- if (newDepth > 1) {
- halveImage3D(cmpts,extractUshort,shoveUshort,
- newWidth,newHeight,newDepth,
- srcImage,dstImage,elementSize,groupSize,rowSize,
- imageSize,myswapBytes);
- }
- else {
- halveImage_ushort(cmpts,newWidth,newHeight,srcImage,dstImage,
- elementSize,rowSize,groupSize,myswapBytes);
- }
- break;
- case GL_SHORT:
- if (newDepth > 1) {
- halveImage3D(cmpts,extractSshort,shoveSshort,
- newWidth,newHeight,newDepth,
- srcImage,dstImage,elementSize,groupSize,rowSize,
- imageSize,myswapBytes);
- }
- else {
- halveImage_short(cmpts,newWidth,newHeight,srcImage,dstImage,
- elementSize,rowSize,groupSize,myswapBytes);
- }
- break;
- case GL_UNSIGNED_INT:
- if (newDepth > 1) {
- halveImage3D(cmpts,extractUint,shoveUint,
- newWidth,newHeight,newDepth,
- srcImage,dstImage,elementSize,groupSize,rowSize,
- imageSize,myswapBytes);
- }
- else {
- halveImage_uint(cmpts,newWidth,newHeight,srcImage,dstImage,
- elementSize,rowSize,groupSize,myswapBytes);
- }
- break;
- case GL_INT:
- if (newDepth > 1) {
- halveImage3D(cmpts,extractSint,shoveSint,
- newWidth,newHeight,newDepth,
- srcImage,dstImage,elementSize,groupSize,rowSize,
- imageSize,myswapBytes);
- }
- else {
- halveImage_int(cmpts,newWidth,newHeight,srcImage,dstImage,
- elementSize,rowSize,groupSize,myswapBytes);
- }
- break;
- case GL_FLOAT:
- if (newDepth > 1) {
- halveImage3D(cmpts,extractFloat,shoveFloat,
- newWidth,newHeight,newDepth,
- srcImage,dstImage,elementSize,groupSize,rowSize,
- imageSize,myswapBytes);
- }
- else {
- halveImage_float(cmpts,newWidth,newHeight,srcImage,dstImage,
- elementSize,rowSize,groupSize,myswapBytes);
- }
- break;
- case GL_UNSIGNED_BYTE_3_3_2:
- halveImagePackedPixel3D(3,extract332,shove332,
- newWidth,newHeight,newDepth,
- srcImage,dstImage,elementSize,rowSize,
- imageSize,myswapBytes);
- break;
- case GL_UNSIGNED_BYTE_2_3_3_REV:
- halveImagePackedPixel3D(3,extract233rev,shove233rev,
- newWidth,newHeight,newDepth,
- srcImage,dstImage,elementSize,rowSize,
- imageSize,myswapBytes);
- break;
- case GL_UNSIGNED_SHORT_5_6_5:
- halveImagePackedPixel3D(3,extract565,shove565,
- newWidth,newHeight,newDepth,
- srcImage,dstImage,elementSize,rowSize,
- imageSize,myswapBytes);
- break;
- case GL_UNSIGNED_SHORT_5_6_5_REV:
- halveImagePackedPixel3D(3,extract565rev,shove565rev,
- newWidth,newHeight,newDepth,
- srcImage,dstImage,elementSize,rowSize,
- imageSize,myswapBytes);
- break;
- case GL_UNSIGNED_SHORT_4_4_4_4:
- halveImagePackedPixel3D(4,extract4444,shove4444,
- newWidth,newHeight,newDepth,
- srcImage,dstImage,elementSize,rowSize,
- imageSize,myswapBytes);
- break;
- case GL_UNSIGNED_SHORT_4_4_4_4_REV:
- halveImagePackedPixel3D(4,extract4444rev,shove4444rev,
- newWidth,newHeight,newDepth,
- srcImage,dstImage,elementSize,rowSize,
- imageSize,myswapBytes);
- break;
- case GL_UNSIGNED_SHORT_5_5_5_1:
- halveImagePackedPixel3D(4,extract5551,shove5551,
- newWidth,newHeight,newDepth,
- srcImage,dstImage,elementSize,rowSize,
- imageSize,myswapBytes);
- break;
- case GL_UNSIGNED_SHORT_1_5_5_5_REV:
- halveImagePackedPixel3D(4,extract1555rev,shove1555rev,
- newWidth,newHeight,newDepth,
- srcImage,dstImage,elementSize,rowSize,
- imageSize,myswapBytes);
- break;
- case GL_UNSIGNED_INT_8_8_8_8:
- halveImagePackedPixel3D(4,extract8888,shove8888,
- newWidth,newHeight,newDepth,
- srcImage,dstImage,elementSize,rowSize,
- imageSize,myswapBytes);
- break;
- case GL_UNSIGNED_INT_8_8_8_8_REV:
- halveImagePackedPixel3D(4,extract8888rev,shove8888rev,
- newWidth,newHeight,newDepth,
- srcImage,dstImage,elementSize,rowSize,
- imageSize,myswapBytes);
- break;
- case GL_UNSIGNED_INT_10_10_10_2:
- halveImagePackedPixel3D(4,extract1010102,shove1010102,
- newWidth,newHeight,newDepth,
- srcImage,dstImage,elementSize,rowSize,
- imageSize,myswapBytes);
- break;
- case GL_UNSIGNED_INT_2_10_10_10_REV:
- halveImagePackedPixel3D(4,extract2101010rev,shove2101010rev,
- newWidth,newHeight,newDepth,
- srcImage,dstImage,elementSize,rowSize,
- imageSize,myswapBytes);
- break;
- default:
- assert(0);
- break;
- }
-
- __GLU_SWAP_IMAGE(srcImage,dstImage);
-
- if (newWidth > 1) { newWidth /= 2; rowSize /= 2;}
- if (newHeight > 1) { newHeight /= 2; imageSize = rowSize * newHeight; }
- if (newDepth > 1) newDepth /= 2;
- {
- /* call tex image with srcImage untouched since it's not padded */
- if (baseLevel <= level && level <= maxLevel) {
- gluTexImage3D(target, level, internalFormat, newWidth, newHeight,
- newDepth,0, format, type, (void *) srcImage);
- }
- }
- } /* for level */
- glPixelStorei(GL_UNPACK_ALIGNMENT, psm.unpack_alignment);
- glPixelStorei(GL_UNPACK_SKIP_ROWS, psm.unpack_skip_rows);
- glPixelStorei(GL_UNPACK_SKIP_PIXELS, psm.unpack_skip_pixels);
- glPixelStorei(GL_UNPACK_ROW_LENGTH, psm.unpack_row_length);
- glPixelStorei(GL_UNPACK_SWAP_BYTES, psm.unpack_swap_bytes);
- glPixelStorei(GL_UNPACK_SKIP_IMAGES, psm.unpack_skip_images);
- glPixelStorei(GL_UNPACK_IMAGE_HEIGHT, psm.unpack_image_height);
-
- free(srcImage); /*if you get to here, a srcImage has always been malloc'ed*/
- if (dstImage) { /* if it's non-rectangular and only 1 level */
- free(dstImage);
- }
- return 0;
-} /* gluBuild3DMipmapLevelsCore() */
-
-GLint GLAPIENTRY
-gluBuild3DMipmapLevels(GLenum target, GLint internalFormat,
- GLsizei width, GLsizei height, GLsizei depth,
- GLenum format, GLenum type,
- GLint userLevel, GLint baseLevel, GLint maxLevel,
- const void *data)
-{
- int level, levels;
-
- int rc= checkMipmapArgs(internalFormat,format,type);
- if (rc != 0) return rc;
-
- if (width < 1 || height < 1 || depth < 1) {
- return GLU_INVALID_VALUE;
- }
-
- if(type == GL_BITMAP) {
- return GLU_INVALID_ENUM;
- }
-
- levels = computeLog(width);
- level = computeLog(height);
- if (level > levels) levels=level;
- level = computeLog(depth);
- if (level > levels) levels=level;
-
- levels+= userLevel;
- if (!isLegalLevels(userLevel,baseLevel,maxLevel,levels))
- return GLU_INVALID_VALUE;
-
- return gluBuild3DMipmapLevelsCore(target, internalFormat,
- width, height, depth,
- width, height, depth,
- format, type,
- userLevel, baseLevel, maxLevel,
- data);
-} /* gluBuild3DMipmapLevels() */
-
-GLint GLAPIENTRY
-gluBuild3DMipmaps(GLenum target, GLint internalFormat,
- GLsizei width, GLsizei height, GLsizei depth,
- GLenum format, GLenum type, const void *data)
-{
- GLint widthPowerOf2, heightPowerOf2, depthPowerOf2;
- int level, levels;
-
- int rc= checkMipmapArgs(internalFormat,format,type);
- if (rc != 0) return rc;
-
- if (width < 1 || height < 1 || depth < 1) {
- return GLU_INVALID_VALUE;
- }
-
- if(type == GL_BITMAP) {
- return GLU_INVALID_ENUM;
- }
-
- closestFit3D(target,width,height,depth,internalFormat,format,type,
- &widthPowerOf2,&heightPowerOf2,&depthPowerOf2);
-
- levels = computeLog(widthPowerOf2);
- level = computeLog(heightPowerOf2);
- if (level > levels) levels=level;
- level = computeLog(depthPowerOf2);
- if (level > levels) levels=level;
-
- return gluBuild3DMipmapLevelsCore(target, internalFormat,
- width, height, depth,
- widthPowerOf2, heightPowerOf2,
- depthPowerOf2,
- format, type, 0, 0, levels,
- data);
-} /* gluBuild3DMipmaps() */
-
-static GLdouble extractUbyte(int isSwap, const void *ubyte)
-{
- isSwap= isSwap; /* turn off warnings */
-
- assert(*((const GLubyte *)ubyte) <= 255);
-
- return (GLdouble)(*((const GLubyte *)ubyte));
-} /* extractUbyte() */
-
-static void shoveUbyte(GLdouble value, int index, void *data)
-{
- assert(0.0 <= value && value < 256.0);
-
- ((GLubyte *)data)[index]= (GLubyte)value;
-} /* shoveUbyte() */
-
-static GLdouble extractSbyte(int isSwap, const void *sbyte)
-{
- isSwap= isSwap; /* turn off warnings */
-
- assert(*((const GLbyte *)sbyte) <= 127);
-
- return (GLdouble)(*((const GLbyte *)sbyte));
-} /* extractSbyte() */
-
-static void shoveSbyte(GLdouble value, int index, void *data)
-{
- ((GLbyte *)data)[index]= (GLbyte)value;
-} /* shoveSbyte() */
-
-static GLdouble extractUshort(int isSwap, const void *uitem)
-{
- GLushort ushort;
-
- if (isSwap) {
- ushort= __GLU_SWAP_2_BYTES(uitem);
- }
- else {
- ushort= *(const GLushort *)uitem;
- }
-
- assert(ushort <= 65535);
-
- return (GLdouble)ushort;
-} /* extractUshort() */
-
-static void shoveUshort(GLdouble value, int index, void *data)
-{
- assert(0.0 <= value && value < 65536.0);
-
- ((GLushort *)data)[index]= (GLushort)value;
-} /* shoveUshort() */
-
-static GLdouble extractSshort(int isSwap, const void *sitem)
-{
- GLshort sshort;
-
- if (isSwap) {
- sshort= __GLU_SWAP_2_BYTES(sitem);
- }
- else {
- sshort= *(const GLshort *)sitem;
- }
-
- assert(sshort <= 32767);
-
- return (GLdouble)sshort;
-} /* extractSshort() */
-
-static void shoveSshort(GLdouble value, int index, void *data)
-{
- assert(0.0 <= value && value < 32768.0);
-
- ((GLshort *)data)[index]= (GLshort)value;
-} /* shoveSshort() */
-
-static GLdouble extractUint(int isSwap, const void *uitem)
-{
- GLuint uint;
-
- if (isSwap) {
- uint= __GLU_SWAP_4_BYTES(uitem);
- }
- else {
- uint= *(const GLuint *)uitem;
- }
-
- assert(uint <= 0xffffffff);
-
- return (GLdouble)uint;
-} /* extractUint() */
-
-static void shoveUint(GLdouble value, int index, void *data)
-{
- assert(0.0 <= value && value <= (GLdouble) UINT_MAX);
-
- ((GLuint *)data)[index]= (GLuint)value;
-} /* shoveUint() */
-
-static GLdouble extractSint(int isSwap, const void *sitem)
-{
- GLint sint;
-
- if (isSwap) {
- sint= __GLU_SWAP_4_BYTES(sitem);
- }
- else {
- sint= *(const GLint *)sitem;
- }
-
- assert(sint <= 0x7fffffff);
-
- return (GLdouble)sint;
-} /* extractSint() */
-
-static void shoveSint(GLdouble value, int index, void *data)
-{
- assert(0.0 <= value && value <= (GLdouble) INT_MAX);
-
- ((GLint *)data)[index]= (GLint)value;
-} /* shoveSint() */
-
-static GLdouble extractFloat(int isSwap, const void *item)
-{
- GLfloat ffloat;
-
- if (isSwap) {
- ffloat= __GLU_SWAP_4_BYTES(item);
- }
- else {
- ffloat= *(const GLfloat *)item;
- }
-
- assert(ffloat <= 1.0);
-
- return (GLdouble)ffloat;
-} /* extractFloat() */
-
-static void shoveFloat(GLdouble value, int index, void *data)
-{
- assert(0.0 <= value && value <= 1.0);
-
- ((GLfloat *)data)[index]= value;
-} /* shoveFloat() */
-
-static void halveImageSlice(int components,
- GLdouble (*extract)(int, const void *),
- void (*shove)(GLdouble, int, void *),
- GLint width, GLint height, GLint depth,
- const void *dataIn, void *dataOut,
- GLint elementSizeInBytes,
- GLint groupSizeInBytes,
- GLint rowSizeInBytes,
- GLint imageSizeInBytes,
- GLint isSwap)
-{
- int ii, jj;
- int halfWidth= width / 2;
- int halfHeight= height / 2;
- int halfDepth= depth / 2;
- const char *src= (const char *)dataIn;
- int rowPadBytes= rowSizeInBytes - (width * groupSizeInBytes);
- int imagePadBytes= imageSizeInBytes - (width*height*groupSizeInBytes);
- int outIndex= 0;
-
- assert((width == 1 || height == 1) && depth >= 2);
-
- if (width == height) { /* a 1-pixel column viewed from top */
- /* printf("1-column\n");*/
- assert(width == 1 && height == 1);
- assert(depth >= 2);
-
- for (ii= 0; ii< halfDepth; ii++) {
- int cc;
-
- for (cc = 0; cc < components; cc++) {
- double totals[4];
- double extractTotals[BOX2][4];
- int kk;
-
- extractTotals[0][cc]= (*extract)(isSwap,src);
- extractTotals[1][cc]= (*extract)(isSwap,(src+imageSizeInBytes));
-
- /* average 2 pixels since only a column */
- totals[cc]= 0.0;
- /* totals[RED]= extractTotals[0][RED]+extractTotals[1][RED];
- * totals[RED]/= 2.0;
- */
- for (kk = 0; kk < BOX2; kk++) {
- totals[cc]+= extractTotals[kk][cc];
- }
- totals[cc]/= (double)BOX2;
-
- (*shove)(totals[cc],outIndex,dataOut);
- outIndex++;
- src+= elementSizeInBytes;
- } /* for cc */
-
- /* skip over to next group of 2 */
- src+= rowSizeInBytes;
- } /* for ii */
-
- assert(src == &((const char *)dataIn)[rowSizeInBytes*height*depth]);
- assert(outIndex == halfDepth * components);
- }
- else if (height == 1) { /* horizontal slice viewed from top */
- /* printf("horizontal slice\n"); */
- assert(width != 1);
-
- for (ii= 0; ii< halfDepth; ii++) {
- for (jj= 0; jj< halfWidth; jj++) {
- int cc;
-
- for (cc = 0; cc < components; cc++) {
- int kk;
- double totals[4];
- double extractTotals[BOX4][4];
-
- extractTotals[0][cc]=(*extract)(isSwap,src);
- extractTotals[1][cc]=(*extract)(isSwap,
- (src+groupSizeInBytes));
- extractTotals[2][cc]=(*extract)(isSwap,
- (src+imageSizeInBytes));
- extractTotals[3][cc]=(*extract)(isSwap,
- (src+imageSizeInBytes+groupSizeInBytes));
-
- /* grab 4 pixels to average */
- totals[cc]= 0.0;
- /* totals[RED]= extractTotals[0][RED]+extractTotals[1][RED]+
- * extractTotals[2][RED]+extractTotals[3][RED];
- * totals[RED]/= 4.0;
- */
- for (kk = 0; kk < BOX4; kk++) {
- totals[cc]+= extractTotals[kk][cc];
- }
- totals[cc]/= (double)BOX4;
-
- (*shove)(totals[cc],outIndex,dataOut);
- outIndex++;
-
- src+= elementSizeInBytes;
- } /* for cc */
-
- /* skip over to next horizontal square of 4 */
- src+= groupSizeInBytes;
- } /* for jj */
- src+= rowPadBytes;
-
- src+= rowSizeInBytes;
- } /* for ii */
-
- assert(src == &((const char *)dataIn)[rowSizeInBytes*height*depth]);
- assert(outIndex == halfWidth * halfDepth * components);
- }
- else if (width == 1) { /* vertical slice viewed from top */
- /* printf("vertical slice\n"); */
- assert(height != 1);
-
- for (ii= 0; ii< halfDepth; ii++) {
- for (jj= 0; jj< halfHeight; jj++) {
- int cc;
-
- for (cc = 0; cc < components; cc++) {
- int kk;
- double totals[4];
- double extractTotals[BOX4][4];
-
- extractTotals[0][cc]=(*extract)(isSwap,src);
- extractTotals[1][cc]=(*extract)(isSwap,
- (src+rowSizeInBytes));
- extractTotals[2][cc]=(*extract)(isSwap,
- (src+imageSizeInBytes));
- extractTotals[3][cc]=(*extract)(isSwap,
- (src+imageSizeInBytes+rowSizeInBytes));
-
- /* grab 4 pixels to average */
- totals[cc]= 0.0;
- /* totals[RED]= extractTotals[0][RED]+extractTotals[1][RED]+
- * extractTotals[2][RED]+extractTotals[3][RED];
- * totals[RED]/= 4.0;
- */
- for (kk = 0; kk < BOX4; kk++) {
- totals[cc]+= extractTotals[kk][cc];
- }
- totals[cc]/= (double)BOX4;
-
- (*shove)(totals[cc],outIndex,dataOut);
- outIndex++;
-
- src+= elementSizeInBytes;
- } /* for cc */
- src+= rowPadBytes;
-
- /* skip over to next vertical square of 4 */
- src+= rowSizeInBytes;
- } /* for jj */
- src+= imagePadBytes;
-
- src+= imageSizeInBytes;
- } /* for ii */
-
- assert(src == &((const char *)dataIn)[rowSizeInBytes*height*depth]);
- assert(outIndex == halfHeight * halfDepth * components);
- }
-
-} /* halveImageSlice() */
-
-static void halveImage3D(int components,
- GLdouble (*extract)(int, const void *),
- void (*shove)(GLdouble, int, void *),
- GLint width, GLint height, GLint depth,
- const void *dataIn, void *dataOut,
- GLint elementSizeInBytes,
- GLint groupSizeInBytes,
- GLint rowSizeInBytes,
- GLint imageSizeInBytes,
- GLint isSwap)
-{
- assert(depth > 1);
-
- /* a horizontal/vertical/one-column slice viewed from top */
- if (width == 1 || height == 1) {
- assert(1 <= depth);
-
- halveImageSlice(components,extract,shove, width, height, depth,
- dataIn, dataOut, elementSizeInBytes, groupSizeInBytes,
- rowSizeInBytes, imageSizeInBytes, isSwap);
- return;
- }
- {
- int ii, jj, dd;
-
- int halfWidth= width / 2;
- int halfHeight= height / 2;
- int halfDepth= depth / 2;
- const char *src= (const char *) dataIn;
- int rowPadBytes= rowSizeInBytes - (width*groupSizeInBytes);
- int imagePadBytes= imageSizeInBytes - (width*height*groupSizeInBytes);
- int outIndex= 0;
-
- for (dd= 0; dd < halfDepth; dd++) {
- for (ii= 0; ii< halfHeight; ii++) {
- for (jj= 0; jj< halfWidth; jj++) {
- int cc;
-
- for (cc= 0; cc < components; cc++) {
- int kk;
-#define BOX8 8
- double totals[4]; /* 4 is maximum components */
- double extractTotals[BOX8][4]; /* 4 is maximum components */
-
- extractTotals[0][cc]= (*extract)(isSwap,src);
- extractTotals[1][cc]= (*extract)(isSwap,
- (src+groupSizeInBytes));
- extractTotals[2][cc]= (*extract)(isSwap,
- (src+rowSizeInBytes));
- extractTotals[3][cc]= (*extract)(isSwap,
- (src+rowSizeInBytes+groupSizeInBytes));
-
- extractTotals[4][cc]= (*extract)(isSwap,
- (src+imageSizeInBytes));
-
- extractTotals[5][cc]= (*extract)(isSwap,
- (src+groupSizeInBytes+imageSizeInBytes));
- extractTotals[6][cc]= (*extract)(isSwap,
- (src+rowSizeInBytes+imageSizeInBytes));
- extractTotals[7][cc]= (*extract)(isSwap,
- (src+rowSizeInBytes+groupSizeInBytes+imageSizeInBytes));
-
- totals[cc]= 0.0;
-
- /* totals[RED]= extractTotals[0][RED]+extractTotals[1][RED]+
- * extractTotals[2][RED]+extractTotals[3][RED]+
- * extractTotals[4][RED]+extractTotals[5][RED]+
- * extractTotals[6][RED]+extractTotals[7][RED];
- * totals[RED]/= 8.0;
- */
- for (kk = 0; kk < BOX8; kk++) {
- totals[cc]+= extractTotals[kk][cc];
- }
- totals[cc]/= (double)BOX8;
-
- (*shove)(totals[cc],outIndex,dataOut);
-
- outIndex++;
-
- src+= elementSizeInBytes; /* go to next component */
- } /* for cc */
-
- /* skip over to next square of 4 */
- src+= groupSizeInBytes;
- } /* for jj */
- /* skip past pad bytes, if any, to get to next row */
- src+= rowPadBytes;
-
- /* src is at beginning of a row here, but it's the second row of
- * the square block of 4 pixels that we just worked on so we
- * need to go one more row.
- * i.e.,
- * OO...
- * here -->OO...
- * but want -->OO...
- * OO...
- * ...
- */
- src+= rowSizeInBytes;
- } /* for ii */
-
- /* skip past pad bytes, if any, to get to next image */
- src+= imagePadBytes;
-
- src+= imageSizeInBytes;
- } /* for dd */
-
- /* both pointers must reach one byte after the end */
- assert(src == &((const char *)dataIn)[rowSizeInBytes*height*depth]);
- assert(outIndex == halfWidth * halfHeight * halfDepth * components);
- }
-} /* halveImage3D() */
-
-
-
-/*** mipmap.c ***/
-
+/*
+ * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008)
+ * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice including the dates of first publication and
+ * either this permission notice or a reference to
+ * http://oss.sgi.com/projects/FreeB/
+ * shall be included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
+ * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ *
+ * Except as contained in this notice, the name of Silicon Graphics, Inc.
+ * shall not be used in advertising or otherwise to promote the sale, use or
+ * other dealings in this Software without prior written authorization from
+ * Silicon Graphics, Inc.
+ */
+
+#include "gluos.h"
+#include <assert.h>
+#include <GL/glu.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <limits.h> /* UINT_MAX */
+#include <math.h>
+
+typedef union {
+ unsigned char ub[4];
+ unsigned short us[2];
+ unsigned int ui;
+ char b[4];
+ short s[2];
+ int i;
+ float f;
+} Type_Widget;
+
+/* Pixel storage modes */
+typedef struct {
+ GLint pack_alignment;
+ GLint pack_row_length;
+ GLint pack_skip_rows;
+ GLint pack_skip_pixels;
+ GLint pack_lsb_first;
+ GLint pack_swap_bytes;
+ GLint pack_skip_images;
+ GLint pack_image_height;
+
+ GLint unpack_alignment;
+ GLint unpack_row_length;
+ GLint unpack_skip_rows;
+ GLint unpack_skip_pixels;
+ GLint unpack_lsb_first;
+ GLint unpack_swap_bytes;
+ GLint unpack_skip_images;
+ GLint unpack_image_height;
+} PixelStorageModes;
+
+static int gluBuild1DMipmapLevelsCore(GLenum, GLint,
+ GLsizei,
+ GLsizei,
+ GLenum, GLenum, GLint, GLint, GLint,
+ const void *);
+static int gluBuild2DMipmapLevelsCore(GLenum, GLint,
+ GLsizei, GLsizei,
+ GLsizei, GLsizei,
+ GLenum, GLenum, GLint, GLint, GLint,
+ const void *);
+static int gluBuild3DMipmapLevelsCore(GLenum, GLint,
+ GLsizei, GLsizei, GLsizei,
+ GLsizei, GLsizei, GLsizei,
+ GLenum, GLenum, GLint, GLint, GLint,
+ const void *);
+
+/*
+ * internal function declarations
+ */
+static GLfloat bytes_per_element(GLenum type);
+static GLint elements_per_group(GLenum format, GLenum type);
+static GLint is_index(GLenum format);
+static GLint image_size(GLint width, GLint height, GLenum format, GLenum type);
+static void fill_image(const PixelStorageModes *,
+ GLint width, GLint height, GLenum format,
+ GLenum type, GLboolean index_format,
+ const void *userdata, GLushort *newimage);
+static void empty_image(const PixelStorageModes *,
+ GLint width, GLint height, GLenum format,
+ GLenum type, GLboolean index_format,
+ const GLushort *oldimage, void *userdata);
+static void scale_internal(GLint components, GLint widthin, GLint heightin,
+ const GLushort *datain,
+ GLint widthout, GLint heightout,
+ GLushort *dataout);
+
+static void scale_internal_ubyte(GLint components, GLint widthin,
+ GLint heightin, const GLubyte *datain,
+ GLint widthout, GLint heightout,
+ GLubyte *dataout, GLint element_size,
+ GLint ysize, GLint group_size);
+static void scale_internal_byte(GLint components, GLint widthin,
+ GLint heightin, const GLbyte *datain,
+ GLint widthout, GLint heightout,
+ GLbyte *dataout, GLint element_size,
+ GLint ysize, GLint group_size);
+static void scale_internal_ushort(GLint components, GLint widthin,
+ GLint heightin, const GLushort *datain,
+ GLint widthout, GLint heightout,
+ GLushort *dataout, GLint element_size,
+ GLint ysize, GLint group_size,
+ GLint myswap_bytes);
+static void scale_internal_short(GLint components, GLint widthin,
+ GLint heightin, const GLshort *datain,
+ GLint widthout, GLint heightout,
+ GLshort *dataout, GLint element_size,
+ GLint ysize, GLint group_size,
+ GLint myswap_bytes);
+static void scale_internal_uint(GLint components, GLint widthin,
+ GLint heightin, const GLuint *datain,
+ GLint widthout, GLint heightout,
+ GLuint *dataout, GLint element_size,
+ GLint ysize, GLint group_size,
+ GLint myswap_bytes);
+static void scale_internal_int(GLint components, GLint widthin,
+ GLint heightin, const GLint *datain,
+ GLint widthout, GLint heightout,
+ GLint *dataout, GLint element_size,
+ GLint ysize, GLint group_size,
+ GLint myswap_bytes);
+static void scale_internal_float(GLint components, GLint widthin,
+ GLint heightin, const GLfloat *datain,
+ GLint widthout, GLint heightout,
+ GLfloat *dataout, GLint element_size,
+ GLint ysize, GLint group_size,
+ GLint myswap_bytes);
+
+static int checkMipmapArgs(GLenum, GLenum, GLenum);
+static GLboolean legalFormat(GLenum);
+static GLboolean legalType(GLenum);
+static GLboolean isTypePackedPixel(GLenum);
+static GLboolean isLegalFormatForPackedPixelType(GLenum, GLenum);
+static GLboolean isLegalLevels(GLint, GLint, GLint, GLint);
+static void closestFit(GLenum, GLint, GLint, GLint, GLenum, GLenum,
+ GLint *, GLint *);
+
+/* all extract/shove routines must return double to handle unsigned ints */
+static GLdouble extractUbyte(int, const void *);
+static void shoveUbyte(GLdouble, int, void *);
+static GLdouble extractSbyte(int, const void *);
+static void shoveSbyte(GLdouble, int, void *);
+static GLdouble extractUshort(int, const void *);
+static void shoveUshort(GLdouble, int, void *);
+static GLdouble extractSshort(int, const void *);
+static void shoveSshort(GLdouble, int, void *);
+static GLdouble extractUint(int, const void *);
+static void shoveUint(GLdouble, int, void *);
+static GLdouble extractSint(int, const void *);
+static void shoveSint(GLdouble, int, void *);
+static GLdouble extractFloat(int, const void *);
+static void shoveFloat(GLdouble, int, void *);
+static void halveImageSlice(int, GLdouble (*)(int, const void *),
+ void (*)(GLdouble, int, void *),
+ GLint, GLint, GLint,
+ const void *, void *,
+ GLint, GLint, GLint, GLint, GLint);
+static void halveImage3D(int, GLdouble (*)(int, const void *),
+ void (*)(GLdouble, int, void *),
+ GLint, GLint, GLint,
+ const void *, void *,
+ GLint, GLint, GLint, GLint, GLint);
+
+/* packedpixel type scale routines */
+static void extract332(int,const void *, GLfloat []);
+static void shove332(const GLfloat [],int ,void *);
+static void extract233rev(int,const void *, GLfloat []);
+static void shove233rev(const GLfloat [],int ,void *);
+static void extract565(int,const void *, GLfloat []);
+static void shove565(const GLfloat [],int ,void *);
+static void extract565rev(int,const void *, GLfloat []);
+static void shove565rev(const GLfloat [],int ,void *);
+static void extract4444(int,const void *, GLfloat []);
+static void shove4444(const GLfloat [],int ,void *);
+static void extract4444rev(int,const void *, GLfloat []);
+static void shove4444rev(const GLfloat [],int ,void *);
+static void extract5551(int,const void *, GLfloat []);
+static void shove5551(const GLfloat [],int ,void *);
+static void extract1555rev(int,const void *, GLfloat []);
+static void shove1555rev(const GLfloat [],int ,void *);
+static void extract8888(int,const void *, GLfloat []);
+static void shove8888(const GLfloat [],int ,void *);
+static void extract8888rev(int,const void *, GLfloat []);
+static void shove8888rev(const GLfloat [],int ,void *);
+static void extract1010102(int,const void *, GLfloat []);
+static void shove1010102(const GLfloat [],int ,void *);
+static void extract2101010rev(int,const void *, GLfloat []);
+static void shove2101010rev(const GLfloat [],int ,void *);
+static void scaleInternalPackedPixel(int,
+ void (*)(int, const void *,GLfloat []),
+ void (*)(const GLfloat [],int, void *),
+ GLint,GLint, const void *,
+ GLint,GLint,void *,GLint,GLint,GLint);
+static void halveImagePackedPixel(int,
+ void (*)(int, const void *,GLfloat []),
+ void (*)(const GLfloat [],int, void *),
+ GLint, GLint, const void *,
+ void *, GLint, GLint, GLint);
+static void halve1DimagePackedPixel(int,
+ void (*)(int, const void *,GLfloat []),
+ void (*)(const GLfloat [],int, void *),
+ GLint, GLint, const void *,
+ void *, GLint, GLint, GLint);
+
+static void halve1Dimage_ubyte(GLint, GLuint, GLuint,const GLubyte *,
+ GLubyte *, GLint, GLint, GLint);
+static void halve1Dimage_byte(GLint, GLuint, GLuint,const GLbyte *, GLbyte *,
+ GLint, GLint, GLint);
+static void halve1Dimage_ushort(GLint, GLuint, GLuint, const GLushort *,
+ GLushort *, GLint, GLint, GLint, GLint);
+static void halve1Dimage_short(GLint, GLuint, GLuint,const GLshort *, GLshort *,
+ GLint, GLint, GLint, GLint);
+static void halve1Dimage_uint(GLint, GLuint, GLuint, const GLuint *, GLuint *,
+ GLint, GLint, GLint, GLint);
+static void halve1Dimage_int(GLint, GLuint, GLuint, const GLint *, GLint *,
+ GLint, GLint, GLint, GLint);
+static void halve1Dimage_float(GLint, GLuint, GLuint, const GLfloat *, GLfloat *,
+ GLint, GLint, GLint, GLint);
+
+static GLint imageSize3D(GLint, GLint, GLint, GLenum,GLenum);
+static void fillImage3D(const PixelStorageModes *, GLint, GLint, GLint,GLenum,
+ GLenum, GLboolean, const void *, GLushort *);
+static void emptyImage3D(const PixelStorageModes *,
+ GLint, GLint, GLint, GLenum,
+ GLenum, GLboolean,
+ const GLushort *, void *);
+static void scaleInternal3D(GLint, GLint, GLint, GLint, const GLushort *,
+ GLint, GLint, GLint, GLushort *);
+
+static void retrieveStoreModes(PixelStorageModes *psm)
+{
+ glGetIntegerv(GL_UNPACK_ALIGNMENT, &psm->unpack_alignment);
+ glGetIntegerv(GL_UNPACK_ROW_LENGTH, &psm->unpack_row_length);
+ glGetIntegerv(GL_UNPACK_SKIP_ROWS, &psm->unpack_skip_rows);
+ glGetIntegerv(GL_UNPACK_SKIP_PIXELS, &psm->unpack_skip_pixels);
+ glGetIntegerv(GL_UNPACK_LSB_FIRST, &psm->unpack_lsb_first);
+ glGetIntegerv(GL_UNPACK_SWAP_BYTES, &psm->unpack_swap_bytes);
+
+ glGetIntegerv(GL_PACK_ALIGNMENT, &psm->pack_alignment);
+ glGetIntegerv(GL_PACK_ROW_LENGTH, &psm->pack_row_length);
+ glGetIntegerv(GL_PACK_SKIP_ROWS, &psm->pack_skip_rows);
+ glGetIntegerv(GL_PACK_SKIP_PIXELS, &psm->pack_skip_pixels);
+ glGetIntegerv(GL_PACK_LSB_FIRST, &psm->pack_lsb_first);
+ glGetIntegerv(GL_PACK_SWAP_BYTES, &psm->pack_swap_bytes);
+}
+
+static void retrieveStoreModes3D(PixelStorageModes *psm)
+{
+ glGetIntegerv(GL_UNPACK_ALIGNMENT, &psm->unpack_alignment);
+ glGetIntegerv(GL_UNPACK_ROW_LENGTH, &psm->unpack_row_length);
+ glGetIntegerv(GL_UNPACK_SKIP_ROWS, &psm->unpack_skip_rows);
+ glGetIntegerv(GL_UNPACK_SKIP_PIXELS, &psm->unpack_skip_pixels);
+ glGetIntegerv(GL_UNPACK_LSB_FIRST, &psm->unpack_lsb_first);
+ glGetIntegerv(GL_UNPACK_SWAP_BYTES, &psm->unpack_swap_bytes);
+ glGetIntegerv(GL_UNPACK_SKIP_IMAGES, &psm->unpack_skip_images);
+ glGetIntegerv(GL_UNPACK_IMAGE_HEIGHT, &psm->unpack_image_height);
+
+ glGetIntegerv(GL_PACK_ALIGNMENT, &psm->pack_alignment);
+ glGetIntegerv(GL_PACK_ROW_LENGTH, &psm->pack_row_length);
+ glGetIntegerv(GL_PACK_SKIP_ROWS, &psm->pack_skip_rows);
+ glGetIntegerv(GL_PACK_SKIP_PIXELS, &psm->pack_skip_pixels);
+ glGetIntegerv(GL_PACK_LSB_FIRST, &psm->pack_lsb_first);
+ glGetIntegerv(GL_PACK_SWAP_BYTES, &psm->pack_swap_bytes);
+ glGetIntegerv(GL_PACK_SKIP_IMAGES, &psm->pack_skip_images);
+ glGetIntegerv(GL_PACK_IMAGE_HEIGHT, &psm->pack_image_height);
+}
+
+static int computeLog(GLuint value)
+{
+ int i;
+
+ i = 0;
+
+ /* Error! */
+ if (value == 0) return -1;
+
+ for (;;) {
+ if (value & 1) {
+ /* Error ! */
+ if (value != 1) return -1;
+ return i;
+ }
+ value = value >> 1;
+ i++;
+ }
+}
+
+/*
+** Compute the nearest power of 2 number. This algorithm is a little
+** strange, but it works quite well.
+*/
+static int nearestPower(GLuint value)
+{
+ int i;
+
+ i = 1;
+
+ /* Error! */
+ if (value == 0) return -1;
+
+ for (;;) {
+ if (value == 1) {
+ return i;
+ } else if (value == 3) {
+ return i*4;
+ }
+ value = value >> 1;
+ i *= 2;
+ }
+}
+
+#define __GLU_SWAP_2_BYTES(s)\
+(GLushort)(((GLushort)((const GLubyte*)(s))[1])<<8 | ((const GLubyte*)(s))[0])
+
+#define __GLU_SWAP_4_BYTES(s)\
+(GLuint)(((GLuint)((const GLubyte*)(s))[3])<<24 | \
+ ((GLuint)((const GLubyte*)(s))[2])<<16 | \
+ ((GLuint)((const GLubyte*)(s))[1])<<8 | ((const GLubyte*)(s))[0])
+
+static void halveImage(GLint components, GLuint width, GLuint height,
+ const GLushort *datain, GLushort *dataout)
+{
+ int i, j, k;
+ int newwidth, newheight;
+ int delta;
+ GLushort *s;
+ const GLushort *t;
+
+ newwidth = width / 2;
+ newheight = height / 2;
+ delta = width * components;
+ s = dataout;
+ t = datain;
+
+ /* Piece o' cake! */
+ for (i = 0; i < newheight; i++) {
+ for (j = 0; j < newwidth; j++) {
+ for (k = 0; k < components; k++) {
+ s[0] = (t[0] + t[components] + t[delta] +
+ t[delta+components] + 2) / 4;
+ s++; t++;
+ }
+ t += components;
+ }
+ t += delta;
+ }
+}
+
+static void halveImage_ubyte(GLint components, GLuint width, GLuint height,
+ const GLubyte *datain, GLubyte *dataout,
+ GLint element_size, GLint ysize, GLint group_size)
+{
+ int i, j, k;
+ int newwidth, newheight;
+ int padBytes;
+ GLubyte *s;
+ const char *t;
+
+ /* handle case where there is only 1 column/row */
+ if (width == 1 || height == 1) {
+ assert( !(width == 1 && height == 1) ); /* can't be 1x1 */
+ halve1Dimage_ubyte(components,width,height,datain,dataout,
+ element_size,ysize,group_size);
+ return;
+ }
+
+ newwidth = width / 2;
+ newheight = height / 2;
+ padBytes = ysize - (width*group_size);
+ s = dataout;
+ t = (const char *)datain;
+
+ /* Piece o' cake! */
+ for (i = 0; i < newheight; i++) {
+ for (j = 0; j < newwidth; j++) {
+ for (k = 0; k < components; k++) {
+ s[0] = (*(const GLubyte*)t +
+ *(const GLubyte*)(t+group_size) +
+ *(const GLubyte*)(t+ysize) +
+ *(const GLubyte*)(t+ysize+group_size) + 2) / 4;
+ s++; t += element_size;
+ }
+ t += group_size;
+ }
+ t += padBytes;
+ t += ysize;
+ }
+}
+
+/* */
+static void halve1Dimage_ubyte(GLint components, GLuint width, GLuint height,
+ const GLubyte *dataIn, GLubyte *dataOut,
+ GLint element_size, GLint ysize,
+ GLint group_size)
+{
+ GLint halfWidth= width / 2;
+ GLint halfHeight= height / 2;
+ const char *src= (const char *) dataIn;
+ GLubyte *dest= dataOut;
+ int jj;
+
+ assert(width == 1 || height == 1); /* must be 1D */
+ assert(width != height); /* can't be square */
+
+ if (height == 1) { /* 1 row */
+ assert(width != 1); /* widthxheight can't be 1x1 */
+ halfHeight= 1;
+
+ for (jj= 0; jj< halfWidth; jj++) {
+ int kk;
+ for (kk= 0; kk< components; kk++) {
+ *dest= (*(const GLubyte*)src +
+ *(const GLubyte*)(src+group_size)) / 2;
+
+ src+= element_size;
+ dest++;
+ }
+ src+= group_size; /* skip to next 2 */
+ }
+ {
+ int padBytes= ysize - (width*group_size);
+ src+= padBytes; /* for assertion only */
+ }
+ }
+ else if (width == 1) { /* 1 column */
+ int padBytes= ysize - (width * group_size);
+ assert(height != 1); /* widthxheight can't be 1x1 */
+ halfWidth= 1;
+ /* one vertical column with possible pad bytes per row */
+ /* average two at a time */
+
+ for (jj= 0; jj< halfHeight; jj++) {
+ int kk;
+ for (kk= 0; kk< components; kk++) {
+ *dest= (*(const GLubyte*)src + *(const GLubyte*)(src+ysize)) / 2;
+
+ src+= element_size;
+ dest++;
+ }
+ src+= padBytes; /* add pad bytes, if any, to get to end to row */
+ src+= ysize;
+ }
+ }
+
+ assert(src == &((const char *)dataIn)[ysize*height]);
+ assert((char *)dest == &((char *)dataOut)
+ [components * element_size * halfWidth * halfHeight]);
+} /* halve1Dimage_ubyte() */
+
+static void halveImage_byte(GLint components, GLuint width, GLuint height,
+ const GLbyte *datain, GLbyte *dataout,
+ GLint element_size,
+ GLint ysize, GLint group_size)
+{
+ int i, j, k;
+ int newwidth, newheight;
+ int padBytes;
+ GLbyte *s;
+ const char *t;
+
+ /* handle case where there is only 1 column/row */
+ if (width == 1 || height == 1) {
+ assert( !(width == 1 && height == 1) ); /* can't be 1x1 */
+ halve1Dimage_byte(components,width,height,datain,dataout,
+ element_size,ysize,group_size);
+ return;
+ }
+
+ newwidth = width / 2;
+ newheight = height / 2;
+ padBytes = ysize - (width*group_size);
+ s = dataout;
+ t = (const char *)datain;
+
+ /* Piece o' cake! */
+ for (i = 0; i < newheight; i++) {
+ for (j = 0; j < newwidth; j++) {
+ for (k = 0; k < components; k++) {
+ s[0] = (*(const GLbyte*)t +
+ *(const GLbyte*)(t+group_size) +
+ *(const GLbyte*)(t+ysize) +
+ *(const GLbyte*)(t+ysize+group_size) + 2) / 4;
+ s++; t += element_size;
+ }
+ t += group_size;
+ }
+ t += padBytes;
+ t += ysize;
+ }
+}
+
+static void halve1Dimage_byte(GLint components, GLuint width, GLuint height,
+ const GLbyte *dataIn, GLbyte *dataOut,
+ GLint element_size,GLint ysize, GLint group_size)
+{
+ GLint halfWidth= width / 2;
+ GLint halfHeight= height / 2;
+ const char *src= (const char *) dataIn;
+ GLbyte *dest= dataOut;
+ int jj;
+
+ assert(width == 1 || height == 1); /* must be 1D */
+ assert(width != height); /* can't be square */
+
+ if (height == 1) { /* 1 row */
+ assert(width != 1); /* widthxheight can't be 1x1 */
+ halfHeight= 1;
+
+ for (jj= 0; jj< halfWidth; jj++) {
+ int kk;
+ for (kk= 0; kk< components; kk++) {
+ *dest= (*(const GLbyte*)src + *(const GLbyte*)(src+group_size)) / 2;
+
+ src+= element_size;
+ dest++;
+ }
+ src+= group_size; /* skip to next 2 */
+ }
+ {
+ int padBytes= ysize - (width*group_size);
+ src+= padBytes; /* for assertion only */
+ }
+ }
+ else if (width == 1) { /* 1 column */
+ int padBytes= ysize - (width * group_size);
+ assert(height != 1); /* widthxheight can't be 1x1 */
+ halfWidth= 1;
+ /* one vertical column with possible pad bytes per row */
+ /* average two at a time */
+
+ for (jj= 0; jj< halfHeight; jj++) {
+ int kk;
+ for (kk= 0; kk< components; kk++) {
+ *dest= (*(const GLbyte*)src + *(const GLbyte*)(src+ysize)) / 2;
+
+ src+= element_size;
+ dest++;
+ }
+ src+= padBytes; /* add pad bytes, if any, to get to end to row */
+ src+= ysize;
+ }
+
+ assert(src == &((const char *)dataIn)[ysize*height]);
+ }
+
+ assert((char *)dest == &((char *)dataOut)
+ [components * element_size * halfWidth * halfHeight]);
+} /* halve1Dimage_byte() */
+
+static void halveImage_ushort(GLint components, GLuint width, GLuint height,
+ const GLushort *datain, GLushort *dataout,
+ GLint element_size, GLint ysize, GLint group_size,
+ GLint myswap_bytes)
+{
+ int i, j, k;
+ int newwidth, newheight;
+ int padBytes;
+ GLushort *s;
+ const char *t;
+
+ /* handle case where there is only 1 column/row */
+ if (width == 1 || height == 1) {
+ assert( !(width == 1 && height == 1) ); /* can't be 1x1 */
+ halve1Dimage_ushort(components,width,height,datain,dataout,
+ element_size,ysize,group_size, myswap_bytes);
+ return;
+ }
+
+ newwidth = width / 2;
+ newheight = height / 2;
+ padBytes = ysize - (width*group_size);
+ s = dataout;
+ t = (const char *)datain;
+
+ /* Piece o' cake! */
+ if (!myswap_bytes)
+ for (i = 0; i < newheight; i++) {
+ for (j = 0; j < newwidth; j++) {
+ for (k = 0; k < components; k++) {
+ s[0] = (*(const GLushort*)t +
+ *(const GLushort*)(t+group_size) +
+ *(const GLushort*)(t+ysize) +
+ *(const GLushort*)(t+ysize+group_size) + 2) / 4;
+ s++; t += element_size;
+ }
+ t += group_size;
+ }
+ t += padBytes;
+ t += ysize;
+ }
+ else
+ for (i = 0; i < newheight; i++) {
+ for (j = 0; j < newwidth; j++) {
+ for (k = 0; k < components; k++) {
+ s[0] = (__GLU_SWAP_2_BYTES(t) +
+ __GLU_SWAP_2_BYTES(t+group_size) +
+ __GLU_SWAP_2_BYTES(t+ysize) +
+ __GLU_SWAP_2_BYTES(t+ysize+group_size)+ 2)/4;
+ s++; t += element_size;
+ }
+ t += group_size;
+ }
+ t += padBytes;
+ t += ysize;
+ }
+}
+
+static void halve1Dimage_ushort(GLint components, GLuint width, GLuint height,
+ const GLushort *dataIn, GLushort *dataOut,
+ GLint element_size, GLint ysize,
+ GLint group_size, GLint myswap_bytes)
+{
+ GLint halfWidth= width / 2;
+ GLint halfHeight= height / 2;
+ const char *src= (const char *) dataIn;
+ GLushort *dest= dataOut;
+ int jj;
+
+ assert(width == 1 || height == 1); /* must be 1D */
+ assert(width != height); /* can't be square */
+
+ if (height == 1) { /* 1 row */
+ assert(width != 1); /* widthxheight can't be 1x1 */
+ halfHeight= 1;
+
+ for (jj= 0; jj< halfWidth; jj++) {
+ int kk;
+ for (kk= 0; kk< components; kk++) {
+#define BOX2 2
+ GLushort ushort[BOX2];
+ if (myswap_bytes) {
+ ushort[0]= __GLU_SWAP_2_BYTES(src);
+ ushort[1]= __GLU_SWAP_2_BYTES(src+group_size);
+ }
+ else {
+ ushort[0]= *(const GLushort*)src;
+ ushort[1]= *(const GLushort*)(src+group_size);
+ }
+
+ *dest= (ushort[0] + ushort[1]) / 2;
+ src+= element_size;
+ dest++;
+ }
+ src+= group_size; /* skip to next 2 */
+ }
+ {
+ int padBytes= ysize - (width*group_size);
+ src+= padBytes; /* for assertion only */
+ }
+ }
+ else if (width == 1) { /* 1 column */
+ int padBytes= ysize - (width * group_size);
+ assert(height != 1); /* widthxheight can't be 1x1 */
+ halfWidth= 1;
+ /* one vertical column with possible pad bytes per row */
+ /* average two at a time */
+
+ for (jj= 0; jj< halfHeight; jj++) {
+ int kk;
+ for (kk= 0; kk< components; kk++) {
+#define BOX2 2
+ GLushort ushort[BOX2];
+ if (myswap_bytes) {
+ ushort[0]= __GLU_SWAP_2_BYTES(src);
+ ushort[1]= __GLU_SWAP_2_BYTES(src+ysize);
+ }
+ else {
+ ushort[0]= *(const GLushort*)src;
+ ushort[1]= *(const GLushort*)(src+ysize);
+ }
+ *dest= (ushort[0] + ushort[1]) / 2;
+
+ src+= element_size;
+ dest++;
+ }
+ src+= padBytes; /* add pad bytes, if any, to get to end to row */
+ src+= ysize;
+ }
+
+ assert(src == &((const char *)dataIn)[ysize*height]);
+ }
+
+ assert((char *)dest == &((char *)dataOut)
+ [components * element_size * halfWidth * halfHeight]);
+
+} /* halve1Dimage_ushort() */
+
+
+static void halveImage_short(GLint components, GLuint width, GLuint height,
+ const GLshort *datain, GLshort *dataout,
+ GLint element_size, GLint ysize, GLint group_size,
+ GLint myswap_bytes)
+{
+ int i, j, k;
+ int newwidth, newheight;
+ int padBytes;
+ GLshort *s;
+ const char *t;
+
+ /* handle case where there is only 1 column/row */
+ if (width == 1 || height == 1) {
+ assert( !(width == 1 && height == 1) ); /* can't be 1x1 */
+ halve1Dimage_short(components,width,height,datain,dataout,
+ element_size,ysize,group_size, myswap_bytes);
+ return;
+ }
+
+ newwidth = width / 2;
+ newheight = height / 2;
+ padBytes = ysize - (width*group_size);
+ s = dataout;
+ t = (const char *)datain;
+
+ /* Piece o' cake! */
+ if (!myswap_bytes)
+ for (i = 0; i < newheight; i++) {
+ for (j = 0; j < newwidth; j++) {
+ for (k = 0; k < components; k++) {
+ s[0] = (*(const GLshort*)t +
+ *(const GLshort*)(t+group_size) +
+ *(const GLshort*)(t+ysize) +
+ *(const GLshort*)(t+ysize+group_size) + 2) / 4;
+ s++; t += element_size;
+ }
+ t += group_size;
+ }
+ t += padBytes;
+ t += ysize;
+ }
+ else
+ for (i = 0; i < newheight; i++) {
+ for (j = 0; j < newwidth; j++) {
+ for (k = 0; k < components; k++) {
+ GLushort b;
+ GLint buf;
+ b = __GLU_SWAP_2_BYTES(t);
+ buf = *(const GLshort*)&b;
+ b = __GLU_SWAP_2_BYTES(t+group_size);
+ buf += *(const GLshort*)&b;
+ b = __GLU_SWAP_2_BYTES(t+ysize);
+ buf += *(const GLshort*)&b;
+ b = __GLU_SWAP_2_BYTES(t+ysize+group_size);
+ buf += *(const GLshort*)&b;
+ s[0] = (GLshort)((buf+2)/4);
+ s++; t += element_size;
+ }
+ t += group_size;
+ }
+ t += padBytes;
+ t += ysize;
+ }
+}
+
+static void halve1Dimage_short(GLint components, GLuint width, GLuint height,
+ const GLshort *dataIn, GLshort *dataOut,
+ GLint element_size, GLint ysize,
+ GLint group_size, GLint myswap_bytes)
+{
+ GLint halfWidth= width / 2;
+ GLint halfHeight= height / 2;
+ const char *src= (const char *) dataIn;
+ GLshort *dest= dataOut;
+ int jj;
+
+ assert(width == 1 || height == 1); /* must be 1D */
+ assert(width != height); /* can't be square */
+
+ if (height == 1) { /* 1 row */
+ assert(width != 1); /* widthxheight can't be 1x1 */
+ halfHeight= 1;
+
+ for (jj= 0; jj< halfWidth; jj++) {
+ int kk;
+ for (kk= 0; kk< components; kk++) {
+#define BOX2 2
+ GLshort sshort[BOX2];
+ if (myswap_bytes) {
+ sshort[0]= __GLU_SWAP_2_BYTES(src);
+ sshort[1]= __GLU_SWAP_2_BYTES(src+group_size);
+ }
+ else {
+ sshort[0]= *(const GLshort*)src;
+ sshort[1]= *(const GLshort*)(src+group_size);
+ }
+
+ *dest= (sshort[0] + sshort[1]) / 2;
+ src+= element_size;
+ dest++;
+ }
+ src+= group_size; /* skip to next 2 */
+ }
+ {
+ int padBytes= ysize - (width*group_size);
+ src+= padBytes; /* for assertion only */
+ }
+ }
+ else if (width == 1) { /* 1 column */
+ int padBytes= ysize - (width * group_size);
+ assert(height != 1); /* widthxheight can't be 1x1 */
+ halfWidth= 1;
+ /* one vertical column with possible pad bytes per row */
+ /* average two at a time */
+
+ for (jj= 0; jj< halfHeight; jj++) {
+ int kk;
+ for (kk= 0; kk< components; kk++) {
+#define BOX2 2
+ GLshort sshort[BOX2];
+ if (myswap_bytes) {
+ sshort[0]= __GLU_SWAP_2_BYTES(src);
+ sshort[1]= __GLU_SWAP_2_BYTES(src+ysize);
+ }
+ else {
+ sshort[0]= *(const GLshort*)src;
+ sshort[1]= *(const GLshort*)(src+ysize);
+ }
+ *dest= (sshort[0] + sshort[1]) / 2;
+
+ src+= element_size;
+ dest++;
+ }
+ src+= padBytes; /* add pad bytes, if any, to get to end to row */
+ src+= ysize;
+ }
+
+ assert(src == &((const char *)dataIn)[ysize*height]);
+ }
+
+ assert((char *)dest == &((char *)dataOut)
+ [components * element_size * halfWidth * halfHeight]);
+
+} /* halve1Dimage_short() */
+
+
+static void halveImage_uint(GLint components, GLuint width, GLuint height,
+ const GLuint *datain, GLuint *dataout,
+ GLint element_size, GLint ysize, GLint group_size,
+ GLint myswap_bytes)
+{
+ int i, j, k;
+ int newwidth, newheight;
+ int padBytes;
+ GLuint *s;
+ const char *t;
+
+ /* handle case where there is only 1 column/row */
+ if (width == 1 || height == 1) {
+ assert( !(width == 1 && height == 1) ); /* can't be 1x1 */
+ halve1Dimage_uint(components,width,height,datain,dataout,
+ element_size,ysize,group_size, myswap_bytes);
+ return;
+ }
+
+ newwidth = width / 2;
+ newheight = height / 2;
+ padBytes = ysize - (width*group_size);
+ s = dataout;
+ t = (const char *)datain;
+
+ /* Piece o' cake! */
+ if (!myswap_bytes)
+ for (i = 0; i < newheight; i++) {
+ for (j = 0; j < newwidth; j++) {
+ for (k = 0; k < components; k++) {
+ /* need to cast to double to hold large unsigned ints */
+ s[0] = ((double)*(const GLuint*)t +
+ (double)*(const GLuint*)(t+group_size) +
+ (double)*(const GLuint*)(t+ysize) +
+ (double)*(const GLuint*)(t+ysize+group_size))/4 + 0.5;
+ s++; t += element_size;
+
+ }
+ t += group_size;
+ }
+ t += padBytes;
+ t += ysize;
+ }
+ else
+ for (i = 0; i < newheight; i++) {
+ for (j = 0; j < newwidth; j++) {
+ for (k = 0; k < components; k++) {
+ /* need to cast to double to hold large unsigned ints */
+ GLdouble buf;
+ buf = (GLdouble)__GLU_SWAP_4_BYTES(t) +
+ (GLdouble)__GLU_SWAP_4_BYTES(t+group_size) +
+ (GLdouble)__GLU_SWAP_4_BYTES(t+ysize) +
+ (GLdouble)__GLU_SWAP_4_BYTES(t+ysize+group_size);
+ s[0] = (GLuint)(buf/4 + 0.5);
+
+ s++; t += element_size;
+ }
+ t += group_size;
+ }
+ t += padBytes;
+ t += ysize;
+ }
+}
+
+/* */
+static void halve1Dimage_uint(GLint components, GLuint width, GLuint height,
+ const GLuint *dataIn, GLuint *dataOut,
+ GLint element_size, GLint ysize,
+ GLint group_size, GLint myswap_bytes)
+{
+ GLint halfWidth= width / 2;
+ GLint halfHeight= height / 2;
+ const char *src= (const char *) dataIn;
+ GLuint *dest= dataOut;
+ int jj;
+
+ assert(width == 1 || height == 1); /* must be 1D */
+ assert(width != height); /* can't be square */
+
+ if (height == 1) { /* 1 row */
+ assert(width != 1); /* widthxheight can't be 1x1 */
+ halfHeight= 1;
+
+ for (jj= 0; jj< halfWidth; jj++) {
+ int kk;
+ for (kk= 0; kk< components; kk++) {
+#define BOX2 2
+ GLuint uint[BOX2];
+ if (myswap_bytes) {
+ uint[0]= __GLU_SWAP_4_BYTES(src);
+ uint[1]= __GLU_SWAP_4_BYTES(src+group_size);
+ }
+ else {
+ uint[0]= *(const GLuint*)src;
+ uint[1]= *(const GLuint*)(src+group_size);
+ }
+ *dest= ((double)uint[0]+(double)uint[1])/2.0;
+
+ src+= element_size;
+ dest++;
+ }
+ src+= group_size; /* skip to next 2 */
+ }
+ {
+ int padBytes= ysize - (width*group_size);
+ src+= padBytes; /* for assertion only */
+ }
+ }
+ else if (width == 1) { /* 1 column */
+ int padBytes= ysize - (width * group_size);
+ assert(height != 1); /* widthxheight can't be 1x1 */
+ halfWidth= 1;
+ /* one vertical column with possible pad bytes per row */
+ /* average two at a time */
+
+ for (jj= 0; jj< halfHeight; jj++) {
+ int kk;
+ for (kk= 0; kk< components; kk++) {
+#define BOX2 2
+ GLuint uint[BOX2];
+ if (myswap_bytes) {
+ uint[0]= __GLU_SWAP_4_BYTES(src);
+ uint[1]= __GLU_SWAP_4_BYTES(src+ysize);
+ }
+ else {
+ uint[0]= *(const GLuint*)src;
+ uint[1]= *(const GLuint*)(src+ysize);
+ }
+ *dest= ((double)uint[0]+(double)uint[1])/2.0;
+
+ src+= element_size;
+ dest++;
+ }
+ src+= padBytes; /* add pad bytes, if any, to get to end to row */
+ src+= ysize;
+ }
+
+ assert(src == &((const char *)dataIn)[ysize*height]);
+ }
+
+ assert((char *)dest == &((char *)dataOut)
+ [components * element_size * halfWidth * halfHeight]);
+
+} /* halve1Dimage_uint() */
+
+static void halveImage_int(GLint components, GLuint width, GLuint height,
+ const GLint *datain, GLint *dataout, GLint element_size,
+ GLint ysize, GLint group_size, GLint myswap_bytes)
+{
+ int i, j, k;
+ int newwidth, newheight;
+ int padBytes;
+ GLint *s;
+ const char *t;
+
+ /* handle case where there is only 1 column/row */
+ if (width == 1 || height == 1) {
+ assert( !(width == 1 && height == 1) ); /* can't be 1x1 */
+ halve1Dimage_int(components,width,height,datain,dataout,
+ element_size,ysize,group_size, myswap_bytes);
+ return;
+ }
+
+ newwidth = width / 2;
+ newheight = height / 2;
+ padBytes = ysize - (width*group_size);
+ s = dataout;
+ t = (const char *)datain;
+
+ /* Piece o' cake! */
+ if (!myswap_bytes)
+ for (i = 0; i < newheight; i++) {
+ for (j = 0; j < newwidth; j++) {
+ for (k = 0; k < components; k++) {
+ s[0] = ((float)*(const GLint*)t +
+ (float)*(const GLint*)(t+group_size) +
+ (float)*(const GLint*)(t+ysize) +
+ (float)*(const GLint*)(t+ysize+group_size))/4 + 0.5;
+ s++; t += element_size;
+ }
+ t += group_size;
+ }
+ t += padBytes;
+ t += ysize;
+ }
+ else
+ for (i = 0; i < newheight; i++) {
+ for (j = 0; j < newwidth; j++) {
+ for (k = 0; k < components; k++) {
+ GLuint b;
+ GLfloat buf;
+ b = __GLU_SWAP_4_BYTES(t);
+ buf = *(GLint*)&b;
+ b = __GLU_SWAP_4_BYTES(t+group_size);
+ buf += *(GLint*)&b;
+ b = __GLU_SWAP_4_BYTES(t+ysize);
+ buf += *(GLint*)&b;
+ b = __GLU_SWAP_4_BYTES(t+ysize+group_size);
+ buf += *(GLint*)&b;
+ s[0] = (GLint)(buf/4 + 0.5);
+
+ s++; t += element_size;
+ }
+ t += group_size;
+ }
+ t += padBytes;
+ t += ysize;
+ }
+}
+
+/* */
+static void halve1Dimage_int(GLint components, GLuint width, GLuint height,
+ const GLint *dataIn, GLint *dataOut,
+ GLint element_size, GLint ysize,
+ GLint group_size, GLint myswap_bytes)
+{
+ GLint halfWidth= width / 2;
+ GLint halfHeight= height / 2;
+ const char *src= (const char *) dataIn;
+ GLint *dest= dataOut;
+ int jj;
+
+ assert(width == 1 || height == 1); /* must be 1D */
+ assert(width != height); /* can't be square */
+
+ if (height == 1) { /* 1 row */
+ assert(width != 1); /* widthxheight can't be 1x1 */
+ halfHeight= 1;
+
+ for (jj= 0; jj< halfWidth; jj++) {
+ int kk;
+ for (kk= 0; kk< components; kk++) {
+#define BOX2 2
+ GLuint uint[BOX2];
+ if (myswap_bytes) {
+ uint[0]= __GLU_SWAP_4_BYTES(src);
+ uint[1]= __GLU_SWAP_4_BYTES(src+group_size);
+ }
+ else {
+ uint[0]= *(const GLuint*)src;
+ uint[1]= *(const GLuint*)(src+group_size);
+ }
+ *dest= ((float)uint[0]+(float)uint[1])/2.0;
+
+ src+= element_size;
+ dest++;
+ }
+ src+= group_size; /* skip to next 2 */
+ }
+ {
+ int padBytes= ysize - (width*group_size);
+ src+= padBytes; /* for assertion only */
+ }
+ }
+ else if (width == 1) { /* 1 column */
+ int padBytes= ysize - (width * group_size);
+ assert(height != 1); /* widthxheight can't be 1x1 */
+ halfWidth= 1;
+ /* one vertical column with possible pad bytes per row */
+ /* average two at a time */
+
+ for (jj= 0; jj< halfHeight; jj++) {
+ int kk;
+ for (kk= 0; kk< components; kk++) {
+#define BOX2 2
+ GLuint uint[BOX2];
+ if (myswap_bytes) {
+ uint[0]= __GLU_SWAP_4_BYTES(src);
+ uint[1]= __GLU_SWAP_4_BYTES(src+ysize);
+ }
+ else {
+ uint[0]= *(const GLuint*)src;
+ uint[1]= *(const GLuint*)(src+ysize);
+ }
+ *dest= ((float)uint[0]+(float)uint[1])/2.0;
+
+ src+= element_size;
+ dest++;
+ }
+ src+= padBytes; /* add pad bytes, if any, to get to end to row */
+ src+= ysize;
+ }
+
+ assert(src == &((const char *)dataIn)[ysize*height]);
+ }
+
+ assert((char *)dest == &((char *)dataOut)
+ [components * element_size * halfWidth * halfHeight]);
+
+} /* halve1Dimage_int() */
+
+
+static void halveImage_float(GLint components, GLuint width, GLuint height,
+ const GLfloat *datain, GLfloat *dataout,
+ GLint element_size, GLint ysize, GLint group_size,
+ GLint myswap_bytes)
+{
+ int i, j, k;
+ int newwidth, newheight;
+ int padBytes;
+ GLfloat *s;
+ const char *t;
+
+ /* handle case where there is only 1 column/row */
+ if (width == 1 || height == 1) {
+ assert( !(width == 1 && height == 1) ); /* can't be 1x1 */
+ halve1Dimage_float(components,width,height,datain,dataout,
+ element_size,ysize,group_size, myswap_bytes);
+ return;
+ }
+
+ newwidth = width / 2;
+ newheight = height / 2;
+ padBytes = ysize - (width*group_size);
+ s = dataout;
+ t = (const char *)datain;
+
+ /* Piece o' cake! */
+ if (!myswap_bytes)
+ for (i = 0; i < newheight; i++) {
+ for (j = 0; j < newwidth; j++) {
+ for (k = 0; k < components; k++) {
+ s[0] = (*(const GLfloat*)t +
+ *(const GLfloat*)(t+group_size) +
+ *(const GLfloat*)(t+ysize) +
+ *(const GLfloat*)(t+ysize+group_size)) / 4;
+ s++; t += element_size;
+ }
+ t += group_size;
+ }
+ t += padBytes;
+ t += ysize;
+ }
+ else
+ for (i = 0; i < newheight; i++) {
+ for (j = 0; j < newwidth; j++) {
+ for (k = 0; k < components; k++) {
+ union { GLuint b; GLfloat f; } swapbuf;
+ swapbuf.b = __GLU_SWAP_4_BYTES(t);
+ s[0] = swapbuf.f;
+ swapbuf.b = __GLU_SWAP_4_BYTES(t+group_size);
+ s[0] += swapbuf.f;
+ swapbuf.b = __GLU_SWAP_4_BYTES(t+ysize);
+ s[0] += swapbuf.f;
+ swapbuf.b = __GLU_SWAP_4_BYTES(t+ysize+group_size);
+ s[0] += swapbuf.f;
+ s[0] /= 4;
+ s++; t += element_size;
+ }
+ t += group_size;
+ }
+ t += padBytes;
+ t += ysize;
+ }
+}
+
+/* */
+static void halve1Dimage_float(GLint components, GLuint width, GLuint height,
+ const GLfloat *dataIn, GLfloat *dataOut,
+ GLint element_size, GLint ysize,
+ GLint group_size, GLint myswap_bytes)
+{
+ GLint halfWidth= width / 2;
+ GLint halfHeight= height / 2;
+ const char *src= (const char *) dataIn;
+ GLfloat *dest= dataOut;
+ int jj;
+
+ assert(width == 1 || height == 1); /* must be 1D */
+ assert(width != height); /* can't be square */
+
+ if (height == 1) { /* 1 row */
+ assert(width != 1); /* widthxheight can't be 1x1 */
+ halfHeight= 1;
+
+ for (jj= 0; jj< halfWidth; jj++) {
+ int kk;
+ for (kk= 0; kk< components; kk++) {
+#define BOX2 2
+ GLfloat sfloat[BOX2];
+ if (myswap_bytes) {
+ sfloat[0]= __GLU_SWAP_4_BYTES(src);
+ sfloat[1]= __GLU_SWAP_4_BYTES(src+group_size);
+ }
+ else {
+ sfloat[0]= *(const GLfloat*)src;
+ sfloat[1]= *(const GLfloat*)(src+group_size);
+ }
+
+ *dest= (sfloat[0] + sfloat[1]) / 2.0;
+ src+= element_size;
+ dest++;
+ }
+ src+= group_size; /* skip to next 2 */
+ }
+ {
+ int padBytes= ysize - (width*group_size);
+ src+= padBytes; /* for assertion only */
+ }
+ }
+ else if (width == 1) { /* 1 column */
+ int padBytes= ysize - (width * group_size);
+ assert(height != 1); /* widthxheight can't be 1x1 */
+ halfWidth= 1;
+ /* one vertical column with possible pad bytes per row */
+ /* average two at a time */
+
+ for (jj= 0; jj< halfHeight; jj++) {
+ int kk;
+ for (kk= 0; kk< components; kk++) {
+#define BOX2 2
+ GLfloat sfloat[BOX2];
+ if (myswap_bytes) {
+ sfloat[0]= __GLU_SWAP_4_BYTES(src);
+ sfloat[1]= __GLU_SWAP_4_BYTES(src+ysize);
+ }
+ else {
+ sfloat[0]= *(const GLfloat*)src;
+ sfloat[1]= *(const GLfloat*)(src+ysize);
+ }
+ *dest= (sfloat[0] + sfloat[1]) / 2.0;
+
+ src+= element_size;
+ dest++;
+ }
+ src+= padBytes; /* add pad bytes, if any, to get to end to row */
+ src+= ysize; /* skip to odd row */
+ }
+ }
+
+ assert(src == &((const char *)dataIn)[ysize*height]);
+ assert((char *)dest == &((char *)dataOut)
+ [components * element_size * halfWidth * halfHeight]);
+} /* halve1Dimage_float() */
+
+static void scale_internal(GLint components, GLint widthin, GLint heightin,
+ const GLushort *datain,
+ GLint widthout, GLint heightout,
+ GLushort *dataout)
+{
+ float x, lowx, highx, convx, halfconvx;
+ float y, lowy, highy, convy, halfconvy;
+ float xpercent,ypercent;
+ float percent;
+ /* Max components in a format is 4, so... */
+ float totals[4];
+ float area;
+ int i,j,k,yint,xint,xindex,yindex;
+ int temp;
+
+ if (widthin == widthout*2 && heightin == heightout*2) {
+ halveImage(components, widthin, heightin, datain, dataout);
+ return;
+ }
+ convy = (float) heightin/heightout;
+ convx = (float) widthin/widthout;
+ halfconvx = convx/2;
+ halfconvy = convy/2;
+ for (i = 0; i < heightout; i++) {
+ y = convy * (i+0.5);
+ if (heightin > heightout) {
+ highy = y + halfconvy;
+ lowy = y - halfconvy;
+ } else {
+ highy = y + 0.5;
+ lowy = y - 0.5;
+ }
+ for (j = 0; j < widthout; j++) {
+ x = convx * (j+0.5);
+ if (widthin > widthout) {
+ highx = x + halfconvx;
+ lowx = x - halfconvx;
+ } else {
+ highx = x + 0.5;
+ lowx = x - 0.5;
+ }
+
+ /*
+ ** Ok, now apply box filter to box that goes from (lowx, lowy)
+ ** to (highx, highy) on input data into this pixel on output
+ ** data.
+ */
+ totals[0] = totals[1] = totals[2] = totals[3] = 0.0;
+ area = 0.0;
+
+ y = lowy;
+ yint = floor(y);
+ while (y < highy) {
+ yindex = (yint + heightin) % heightin;
+ if (highy < yint+1) {
+ ypercent = highy - y;
+ } else {
+ ypercent = yint+1 - y;
+ }
+
+ x = lowx;
+ xint = floor(x);
+
+ while (x < highx) {
+ xindex = (xint + widthin) % widthin;
+ if (highx < xint+1) {
+ xpercent = highx - x;
+ } else {
+ xpercent = xint+1 - x;
+ }
+
+ percent = xpercent * ypercent;
+ area += percent;
+ temp = (xindex + (yindex * widthin)) * components;
+ for (k = 0; k < components; k++) {
+ totals[k] += datain[temp + k] * percent;
+ }
+
+ xint++;
+ x = xint;
+ }
+ yint++;
+ y = yint;
+ }
+
+ temp = (j + (i * widthout)) * components;
+ for (k = 0; k < components; k++) {
+ /* totals[] should be rounded in the case of enlarging an RGB
+ * ramp when the type is 332 or 4444
+ */
+ dataout[temp + k] = (totals[k]+0.5)/area;
+ }
+ }
+ }
+}
+
+static void scale_internal_ubyte(GLint components, GLint widthin,
+ GLint heightin, const GLubyte *datain,
+ GLint widthout, GLint heightout,
+ GLubyte *dataout, GLint element_size,
+ GLint ysize, GLint group_size)
+{
+ float convx;
+ float convy;
+ float percent;
+ /* Max components in a format is 4, so... */
+ float totals[4];
+ float area;
+ int i,j,k,xindex;
+
+ const char *temp, *temp0;
+ const char *temp_index;
+ int outindex;
+
+ int lowx_int, highx_int, lowy_int, highy_int;
+ float x_percent, y_percent;
+ float lowx_float, highx_float, lowy_float, highy_float;
+ float convy_float, convx_float;
+ int convy_int, convx_int;
+ int l, m;
+ const char *left, *right;
+
+ if (widthin == widthout*2 && heightin == heightout*2) {
+ halveImage_ubyte(components, widthin, heightin,
+ (const GLubyte *)datain, (GLubyte *)dataout,
+ element_size, ysize, group_size);
+ return;
+ }
+ convy = (float) heightin/heightout;
+ convx = (float) widthin/widthout;
+ convy_int = floor(convy);
+ convy_float = convy - convy_int;
+ convx_int = floor(convx);
+ convx_float = convx - convx_int;
+
+ area = convx * convy;
+
+ lowy_int = 0;
+ lowy_float = 0;
+ highy_int = convy_int;
+ highy_float = convy_float;
+
+ for (i = 0; i < heightout; i++) {
+ /* Clamp here to be sure we don't read beyond input buffer. */
+ if (highy_int >= heightin)
+ highy_int = heightin - 1;
+ lowx_int = 0;
+ lowx_float = 0;
+ highx_int = convx_int;
+ highx_float = convx_float;
+
+ for (j = 0; j < widthout; j++) {
+
+ /*
+ ** Ok, now apply box filter to box that goes from (lowx, lowy)
+ ** to (highx, highy) on input data into this pixel on output
+ ** data.
+ */
+ totals[0] = totals[1] = totals[2] = totals[3] = 0.0;
+
+ /* calculate the value for pixels in the 1st row */
+ xindex = lowx_int*group_size;
+ if((highy_int>lowy_int) && (highx_int>lowx_int)) {
+
+ y_percent = 1-lowy_float;
+ temp = (const char *)datain + xindex + lowy_int * ysize;
+ percent = y_percent * (1-lowx_float);
+ for (k = 0, temp_index = temp; k < components;
+ k++, temp_index += element_size) {
+ totals[k] += (GLubyte)(*(temp_index)) * percent;
+ }
+ left = temp;
+ for(l = lowx_int+1; l < highx_int; l++) {
+ temp += group_size;
+ for (k = 0, temp_index = temp; k < components;
+ k++, temp_index += element_size) {
+ totals[k] += (GLubyte)(*(temp_index)) * y_percent;
+ }
+ }
+ temp += group_size;
+ right = temp;
+ percent = y_percent * highx_float;
+ for (k = 0, temp_index = temp; k < components;
+ k++, temp_index += element_size) {
+ totals[k] += (GLubyte)(*(temp_index)) * percent;
+ }
+
+ /* calculate the value for pixels in the last row */
+ y_percent = highy_float;
+ percent = y_percent * (1-lowx_float);
+ temp = (const char *)datain + xindex + highy_int * ysize;
+ for (k = 0, temp_index = temp; k < components;
+ k++, temp_index += element_size) {
+ totals[k] += (GLubyte)(*(temp_index)) * percent;
+ }
+ for(l = lowx_int+1; l < highx_int; l++) {
+ temp += group_size;
+ for (k = 0, temp_index = temp; k < components;
+ k++, temp_index += element_size) {
+ totals[k] += (GLubyte)(*(temp_index)) * y_percent;
+ }
+ }
+ temp += group_size;
+ percent = y_percent * highx_float;
+ for (k = 0, temp_index = temp; k < components;
+ k++, temp_index += element_size) {
+ totals[k] += (GLubyte)(*(temp_index)) * percent;
+ }
+
+
+ /* calculate the value for pixels in the 1st and last column */
+ for(m = lowy_int+1; m < highy_int; m++) {
+ left += ysize;
+ right += ysize;
+ for (k = 0; k < components;
+ k++, left += element_size, right += element_size) {
+ totals[k] += (GLubyte)(*(left))*(1-lowx_float)
+ +(GLubyte)(*(right))*highx_float;
+ }
+ }
+ } else if (highy_int > lowy_int) {
+ x_percent = highx_float - lowx_float;
+ percent = (1-lowy_float)*x_percent;
+ temp = (const char *)datain + xindex + lowy_int*ysize;
+ for (k = 0, temp_index = temp; k < components;
+ k++, temp_index += element_size) {
+ totals[k] += (GLubyte)(*(temp_index)) * percent;
+ }
+ for(m = lowy_int+1; m < highy_int; m++) {
+ temp += ysize;
+ for (k = 0, temp_index = temp; k < components;
+ k++, temp_index += element_size) {
+ totals[k] += (GLubyte)(*(temp_index)) * x_percent;
+ }
+ }
+ percent = x_percent * highy_float;
+ temp += ysize;
+ for (k = 0, temp_index = temp; k < components;
+ k++, temp_index += element_size) {
+ totals[k] += (GLubyte)(*(temp_index)) * percent;
+ }
+ } else if (highx_int > lowx_int) {
+ y_percent = highy_float - lowy_float;
+ percent = (1-lowx_float)*y_percent;
+ temp = (const char *)datain + xindex + lowy_int*ysize;
+ for (k = 0, temp_index = temp; k < components;
+ k++, temp_index += element_size) {
+ totals[k] += (GLubyte)(*(temp_index)) * percent;
+ }
+ for (l = lowx_int+1; l < highx_int; l++) {
+ temp += group_size;
+ for (k = 0, temp_index = temp; k < components;
+ k++, temp_index += element_size) {
+ totals[k] += (GLubyte)(*(temp_index)) * y_percent;
+ }
+ }
+ temp += group_size;
+ percent = y_percent * highx_float;
+ for (k = 0, temp_index = temp; k < components;
+ k++, temp_index += element_size) {
+ totals[k] += (GLubyte)(*(temp_index)) * percent;
+ }
+ } else {
+ percent = (highy_float-lowy_float)*(highx_float-lowx_float);
+ temp = (const char *)datain + xindex + lowy_int * ysize;
+ for (k = 0, temp_index = temp; k < components;
+ k++, temp_index += element_size) {
+ totals[k] += (GLubyte)(*(temp_index)) * percent;
+ }
+ }
+
+
+
+ /* this is for the pixels in the body */
+ temp0 = (const char *)datain + xindex + group_size +
+ (lowy_int+1)*ysize;
+ for (m = lowy_int+1; m < highy_int; m++) {
+ temp = temp0;
+ for(l = lowx_int+1; l < highx_int; l++) {
+ for (k = 0, temp_index = temp; k < components;
+ k++, temp_index += element_size) {
+ totals[k] += (GLubyte)(*(temp_index));
+ }
+ temp += group_size;
+ }
+ temp0 += ysize;
+ }
+
+ outindex = (j + (i * widthout)) * components;
+ for (k = 0; k < components; k++) {
+ dataout[outindex + k] = totals[k]/area;
+ /*printf("totals[%d] = %f\n", k, totals[k]);*/
+ }
+ lowx_int = highx_int;
+ lowx_float = highx_float;
+ highx_int += convx_int;
+ highx_float += convx_float;
+ if(highx_float > 1) {
+ highx_float -= 1.0;
+ highx_int++;
+ }
+ }
+ lowy_int = highy_int;
+ lowy_float = highy_float;
+ highy_int += convy_int;
+ highy_float += convy_float;
+ if(highy_float > 1) {
+ highy_float -= 1.0;
+ highy_int++;
+ }
+ }
+}
+
+static void scale_internal_byte(GLint components, GLint widthin,
+ GLint heightin, const GLbyte *datain,
+ GLint widthout, GLint heightout,
+ GLbyte *dataout, GLint element_size,
+ GLint ysize, GLint group_size)
+{
+ float convx;
+ float convy;
+ float percent;
+ /* Max components in a format is 4, so... */
+ float totals[4];
+ float area;
+ int i,j,k,xindex;
+
+ const char *temp, *temp0;
+ const char *temp_index;
+ int outindex;
+
+ int lowx_int, highx_int, lowy_int, highy_int;
+ float x_percent, y_percent;
+ float lowx_float, highx_float, lowy_float, highy_float;
+ float convy_float, convx_float;
+ int convy_int, convx_int;
+ int l, m;
+ const char *left, *right;
+
+ if (widthin == widthout*2 && heightin == heightout*2) {
+ halveImage_byte(components, widthin, heightin,
+ (const GLbyte *)datain, (GLbyte *)dataout,
+ element_size, ysize, group_size);
+ return;
+ }
+ convy = (float) heightin/heightout;
+ convx = (float) widthin/widthout;
+ convy_int = floor(convy);
+ convy_float = convy - convy_int;
+ convx_int = floor(convx);
+ convx_float = convx - convx_int;
+
+ area = convx * convy;
+
+ lowy_int = 0;
+ lowy_float = 0;
+ highy_int = convy_int;
+ highy_float = convy_float;
+
+ for (i = 0; i < heightout; i++) {
+ /* Clamp here to be sure we don't read beyond input buffer. */
+ if (highy_int >= heightin)
+ highy_int = heightin - 1;
+ lowx_int = 0;
+ lowx_float = 0;
+ highx_int = convx_int;
+ highx_float = convx_float;
+
+ for (j = 0; j < widthout; j++) {
+
+ /*
+ ** Ok, now apply box filter to box that goes from (lowx, lowy)
+ ** to (highx, highy) on input data into this pixel on output
+ ** data.
+ */
+ totals[0] = totals[1] = totals[2] = totals[3] = 0.0;
+
+ /* calculate the value for pixels in the 1st row */
+ xindex = lowx_int*group_size;
+ if((highy_int>lowy_int) && (highx_int>lowx_int)) {
+
+ y_percent = 1-lowy_float;
+ temp = (const char *)datain + xindex + lowy_int * ysize;
+ percent = y_percent * (1-lowx_float);
+ for (k = 0, temp_index = temp; k < components;
+ k++, temp_index += element_size) {
+ totals[k] += (GLbyte)(*(temp_index)) * percent;
+ }
+ left = temp;
+ for(l = lowx_int+1; l < highx_int; l++) {
+ temp += group_size;
+ for (k = 0, temp_index = temp; k < components;
+ k++, temp_index += element_size) {
+ totals[k] += (GLbyte)(*(temp_index)) * y_percent;
+ }
+ }
+ temp += group_size;
+ right = temp;
+ percent = y_percent * highx_float;
+ for (k = 0, temp_index = temp; k < components;
+ k++, temp_index += element_size) {
+ totals[k] += (GLbyte)(*(temp_index)) * percent;
+ }
+
+ /* calculate the value for pixels in the last row */
+ y_percent = highy_float;
+ percent = y_percent * (1-lowx_float);
+ temp = (const char *)datain + xindex + highy_int * ysize;
+ for (k = 0, temp_index = temp; k < components;
+ k++, temp_index += element_size) {
+ totals[k] += (GLbyte)(*(temp_index)) * percent;
+ }
+ for(l = lowx_int+1; l < highx_int; l++) {
+ temp += group_size;
+ for (k = 0, temp_index = temp; k < components;
+ k++, temp_index += element_size) {
+ totals[k] += (GLbyte)(*(temp_index)) * y_percent;
+ }
+ }
+ temp += group_size;
+ percent = y_percent * highx_float;
+ for (k = 0, temp_index = temp; k < components;
+ k++, temp_index += element_size) {
+ totals[k] += (GLbyte)(*(temp_index)) * percent;
+ }
+
+
+ /* calculate the value for pixels in the 1st and last column */
+ for(m = lowy_int+1; m < highy_int; m++) {
+ left += ysize;
+ right += ysize;
+ for (k = 0; k < components;
+ k++, left += element_size, right += element_size) {
+ totals[k] += (GLbyte)(*(left))*(1-lowx_float)
+ +(GLbyte)(*(right))*highx_float;
+ }
+ }
+ } else if (highy_int > lowy_int) {
+ x_percent = highx_float - lowx_float;
+ percent = (1-lowy_float)*x_percent;
+ temp = (const char *)datain + xindex + lowy_int*ysize;
+ for (k = 0, temp_index = temp; k < components;
+ k++, temp_index += element_size) {
+ totals[k] += (GLbyte)(*(temp_index)) * percent;
+ }
+ for(m = lowy_int+1; m < highy_int; m++) {
+ temp += ysize;
+ for (k = 0, temp_index = temp; k < components;
+ k++, temp_index += element_size) {
+ totals[k] += (GLbyte)(*(temp_index)) * x_percent;
+ }
+ }
+ percent = x_percent * highy_float;
+ temp += ysize;
+ for (k = 0, temp_index = temp; k < components;
+ k++, temp_index += element_size) {
+ totals[k] += (GLbyte)(*(temp_index)) * percent;
+ }
+ } else if (highx_int > lowx_int) {
+ y_percent = highy_float - lowy_float;
+ percent = (1-lowx_float)*y_percent;
+ temp = (const char *)datain + xindex + lowy_int*ysize;
+ for (k = 0, temp_index = temp; k < components;
+ k++, temp_index += element_size) {
+ totals[k] += (GLbyte)(*(temp_index)) * percent;
+ }
+ for (l = lowx_int+1; l < highx_int; l++) {
+ temp += group_size;
+ for (k = 0, temp_index = temp; k < components;
+ k++, temp_index += element_size) {
+ totals[k] += (GLbyte)(*(temp_index)) * y_percent;
+ }
+ }
+ temp += group_size;
+ percent = y_percent * highx_float;
+ for (k = 0, temp_index = temp; k < components;
+ k++, temp_index += element_size) {
+ totals[k] += (GLbyte)(*(temp_index)) * percent;
+ }
+ } else {
+ percent = (highy_float-lowy_float)*(highx_float-lowx_float);
+ temp = (const char *)datain + xindex + lowy_int * ysize;
+ for (k = 0, temp_index = temp; k < components;
+ k++, temp_index += element_size) {
+ totals[k] += (GLbyte)(*(temp_index)) * percent;
+ }
+ }
+
+
+
+ /* this is for the pixels in the body */
+ temp0 = (const char *)datain + xindex + group_size +
+ (lowy_int+1)*ysize;
+ for (m = lowy_int+1; m < highy_int; m++) {
+ temp = temp0;
+ for(l = lowx_int+1; l < highx_int; l++) {
+ for (k = 0, temp_index = temp; k < components;
+ k++, temp_index += element_size) {
+ totals[k] += (GLbyte)(*(temp_index));
+ }
+ temp += group_size;
+ }
+ temp0 += ysize;
+ }
+
+ outindex = (j + (i * widthout)) * components;
+ for (k = 0; k < components; k++) {
+ dataout[outindex + k] = totals[k]/area;
+ /*printf("totals[%d] = %f\n", k, totals[k]);*/
+ }
+ lowx_int = highx_int;
+ lowx_float = highx_float;
+ highx_int += convx_int;
+ highx_float += convx_float;
+ if(highx_float > 1) {
+ highx_float -= 1.0;
+ highx_int++;
+ }
+ }
+ lowy_int = highy_int;
+ lowy_float = highy_float;
+ highy_int += convy_int;
+ highy_float += convy_float;
+ if(highy_float > 1) {
+ highy_float -= 1.0;
+ highy_int++;
+ }
+ }
+}
+
+static void scale_internal_ushort(GLint components, GLint widthin,
+ GLint heightin, const GLushort *datain,
+ GLint widthout, GLint heightout,
+ GLushort *dataout, GLint element_size,
+ GLint ysize, GLint group_size,
+ GLint myswap_bytes)
+{
+ float convx;
+ float convy;
+ float percent;
+ /* Max components in a format is 4, so... */
+ float totals[4];
+ float area;
+ int i,j,k,xindex;
+
+ const char *temp, *temp0;
+ const char *temp_index;
+ int outindex;
+
+ int lowx_int, highx_int, lowy_int, highy_int;
+ float x_percent, y_percent;
+ float lowx_float, highx_float, lowy_float, highy_float;
+ float convy_float, convx_float;
+ int convy_int, convx_int;
+ int l, m;
+ const char *left, *right;
+
+ if (widthin == widthout*2 && heightin == heightout*2) {
+ halveImage_ushort(components, widthin, heightin,
+ (const GLushort *)datain, (GLushort *)dataout,
+ element_size, ysize, group_size, myswap_bytes);
+ return;
+ }
+ convy = (float) heightin/heightout;
+ convx = (float) widthin/widthout;
+ convy_int = floor(convy);
+ convy_float = convy - convy_int;
+ convx_int = floor(convx);
+ convx_float = convx - convx_int;
+
+ area = convx * convy;
+
+ lowy_int = 0;
+ lowy_float = 0;
+ highy_int = convy_int;
+ highy_float = convy_float;
+
+ for (i = 0; i < heightout; i++) {
+ /* Clamp here to be sure we don't read beyond input buffer. */
+ if (highy_int >= heightin)
+ highy_int = heightin - 1;
+ lowx_int = 0;
+ lowx_float = 0;
+ highx_int = convx_int;
+ highx_float = convx_float;
+
+ for (j = 0; j < widthout; j++) {
+ /*
+ ** Ok, now apply box filter to box that goes from (lowx, lowy)
+ ** to (highx, highy) on input data into this pixel on output
+ ** data.
+ */
+ totals[0] = totals[1] = totals[2] = totals[3] = 0.0;
+
+ /* calculate the value for pixels in the 1st row */
+ xindex = lowx_int*group_size;
+ if((highy_int>lowy_int) && (highx_int>lowx_int)) {
+
+ y_percent = 1-lowy_float;
+ temp = (const char *)datain + xindex + lowy_int * ysize;
+ percent = y_percent * (1-lowx_float);
+ for (k = 0, temp_index = temp; k < components;
+ k++, temp_index += element_size) {
+ if (myswap_bytes) {
+ totals[k] += __GLU_SWAP_2_BYTES(temp_index) * percent;
+ } else {
+ totals[k] += *(const GLushort*)temp_index * percent;
+ }
+ }
+ left = temp;
+ for(l = lowx_int+1; l < highx_int; l++) {
+ temp += group_size;
+ for (k = 0, temp_index = temp; k < components;
+ k++, temp_index += element_size) {
+ if (myswap_bytes) {
+ totals[k] +=
+ __GLU_SWAP_2_BYTES(temp_index) * y_percent;
+ } else {
+ totals[k] += *(const GLushort*)temp_index * y_percent;
+ }
+ }
+ }
+ temp += group_size;
+ right = temp;
+ percent = y_percent * highx_float;
+ for (k = 0, temp_index = temp; k < components;
+ k++, temp_index += element_size) {
+ if (myswap_bytes) {
+ totals[k] += __GLU_SWAP_2_BYTES(temp_index) * percent;
+ } else {
+ totals[k] += *(const GLushort*)temp_index * percent;
+ }
+ }
+
+ /* calculate the value for pixels in the last row */
+ y_percent = highy_float;
+ percent = y_percent * (1-lowx_float);
+ temp = (const char *)datain + xindex + highy_int * ysize;
+ for (k = 0, temp_index = temp; k < components;
+ k++, temp_index += element_size) {
+ if (myswap_bytes) {
+ totals[k] += __GLU_SWAP_2_BYTES(temp_index) * percent;
+ } else {
+ totals[k] += *(const GLushort*)temp_index * percent;
+ }
+ }
+ for(l = lowx_int+1; l < highx_int; l++) {
+ temp += group_size;
+ for (k = 0, temp_index = temp; k < components;
+ k++, temp_index += element_size) {
+ if (myswap_bytes) {
+ totals[k] +=
+ __GLU_SWAP_2_BYTES(temp_index) * y_percent;
+ } else {
+ totals[k] += *(const GLushort*)temp_index * y_percent;
+ }
+ }
+ }
+ temp += group_size;
+ percent = y_percent * highx_float;
+ for (k = 0, temp_index = temp; k < components;
+ k++, temp_index += element_size) {
+ if (myswap_bytes) {
+ totals[k] += __GLU_SWAP_2_BYTES(temp_index) * percent;
+ } else {
+ totals[k] += *(const GLushort*)temp_index * percent;
+ }
+ }
+
+ /* calculate the value for pixels in the 1st and last column */
+ for(m = lowy_int+1; m < highy_int; m++) {
+ left += ysize;
+ right += ysize;
+ for (k = 0; k < components;
+ k++, left += element_size, right += element_size) {
+ if (myswap_bytes) {
+ totals[k] +=
+ __GLU_SWAP_2_BYTES(left) * (1-lowx_float) +
+ __GLU_SWAP_2_BYTES(right) * highx_float;
+ } else {
+ totals[k] += *(const GLushort*)left * (1-lowx_float)
+ + *(const GLushort*)right * highx_float;
+ }
+ }
+ }
+ } else if (highy_int > lowy_int) {
+ x_percent = highx_float - lowx_float;
+ percent = (1-lowy_float)*x_percent;
+ temp = (const char *)datain + xindex + lowy_int*ysize;
+ for (k = 0, temp_index = temp; k < components;
+ k++, temp_index += element_size) {
+ if (myswap_bytes) {
+ totals[k] += __GLU_SWAP_2_BYTES(temp_index) * percent;
+ } else {
+ totals[k] += *(const GLushort*)temp_index * percent;
+ }
+ }
+ for(m = lowy_int+1; m < highy_int; m++) {
+ temp += ysize;
+ for (k = 0, temp_index = temp; k < components;
+ k++, temp_index += element_size) {
+ if (myswap_bytes) {
+ totals[k] +=
+ __GLU_SWAP_2_BYTES(temp_index) * x_percent;
+ } else {
+ totals[k] += *(const GLushort*)temp_index * x_percent;
+ }
+ }
+ }
+ percent = x_percent * highy_float;
+ temp += ysize;
+ for (k = 0, temp_index = temp; k < components;
+ k++, temp_index += element_size) {
+ if (myswap_bytes) {
+ totals[k] += __GLU_SWAP_2_BYTES(temp_index) * percent;
+ } else {
+ totals[k] += *(const GLushort*)temp_index * percent;
+ }
+ }
+ } else if (highx_int > lowx_int) {
+ y_percent = highy_float - lowy_float;
+ percent = (1-lowx_float)*y_percent;
+ temp = (const char *)datain + xindex + lowy_int*ysize;
+ for (k = 0, temp_index = temp; k < components;
+ k++, temp_index += element_size) {
+ if (myswap_bytes) {
+ totals[k] += __GLU_SWAP_2_BYTES(temp_index) * percent;
+ } else {
+ totals[k] += *(const GLushort*)temp_index * percent;
+ }
+ }
+ for (l = lowx_int+1; l < highx_int; l++) {
+ temp += group_size;
+ for (k = 0, temp_index = temp; k < components;
+ k++, temp_index += element_size) {
+ if (myswap_bytes) {
+ totals[k] +=
+ __GLU_SWAP_2_BYTES(temp_index) * y_percent;
+ } else {
+ totals[k] += *(const GLushort*)temp_index * y_percent;
+ }
+ }
+ }
+ temp += group_size;
+ percent = y_percent * highx_float;
+ for (k = 0, temp_index = temp; k < components;
+ k++, temp_index += element_size) {
+ if (myswap_bytes) {
+ totals[k] += __GLU_SWAP_2_BYTES(temp_index) * percent;
+ } else {
+ totals[k] += *(const GLushort*)temp_index * percent;
+ }
+ }
+ } else {
+ percent = (highy_float-lowy_float)*(highx_float-lowx_float);
+ temp = (const char *)datain + xindex + lowy_int * ysize;
+ for (k = 0, temp_index = temp; k < components;
+ k++, temp_index += element_size) {
+ if (myswap_bytes) {
+ totals[k] += __GLU_SWAP_2_BYTES(temp_index) * percent;
+ } else {
+ totals[k] += *(const GLushort*)temp_index * percent;
+ }
+ }
+ }
+
+ /* this is for the pixels in the body */
+ temp0 = (const char *)datain + xindex + group_size +
+ (lowy_int+1)*ysize;
+ for (m = lowy_int+1; m < highy_int; m++) {
+ temp = temp0;
+ for(l = lowx_int+1; l < highx_int; l++) {
+ for (k = 0, temp_index = temp; k < components;
+ k++, temp_index += element_size) {
+ if (myswap_bytes) {
+ totals[k] += __GLU_SWAP_2_BYTES(temp_index);
+ } else {
+ totals[k] += *(const GLushort*)temp_index;
+ }
+ }
+ temp += group_size;
+ }
+ temp0 += ysize;
+ }
+
+ outindex = (j + (i * widthout)) * components;
+ for (k = 0; k < components; k++) {
+ dataout[outindex + k] = totals[k]/area;
+ /*printf("totals[%d] = %f\n", k, totals[k]);*/
+ }
+ lowx_int = highx_int;
+ lowx_float = highx_float;
+ highx_int += convx_int;
+ highx_float += convx_float;
+ if(highx_float > 1) {
+ highx_float -= 1.0;
+ highx_int++;
+ }
+ }
+ lowy_int = highy_int;
+ lowy_float = highy_float;
+ highy_int += convy_int;
+ highy_float += convy_float;
+ if(highy_float > 1) {
+ highy_float -= 1.0;
+ highy_int++;
+ }
+ }
+}
+
+static void scale_internal_short(GLint components, GLint widthin,
+ GLint heightin, const GLshort *datain,
+ GLint widthout, GLint heightout,
+ GLshort *dataout, GLint element_size,
+ GLint ysize, GLint group_size,
+ GLint myswap_bytes)
+{
+ float convx;
+ float convy;
+ float percent;
+ /* Max components in a format is 4, so... */
+ float totals[4];
+ float area;
+ int i,j,k,xindex;
+
+ const char *temp, *temp0;
+ const char *temp_index;
+ int outindex;
+
+ int lowx_int, highx_int, lowy_int, highy_int;
+ float x_percent, y_percent;
+ float lowx_float, highx_float, lowy_float, highy_float;
+ float convy_float, convx_float;
+ int convy_int, convx_int;
+ int l, m;
+ const char *left, *right;
+
+ GLushort swapbuf; /* unsigned buffer */
+
+ if (widthin == widthout*2 && heightin == heightout*2) {
+ halveImage_short(components, widthin, heightin,
+ (const GLshort *)datain, (GLshort *)dataout,
+ element_size, ysize, group_size, myswap_bytes);
+ return;
+ }
+ convy = (float) heightin/heightout;
+ convx = (float) widthin/widthout;
+ convy_int = floor(convy);
+ convy_float = convy - convy_int;
+ convx_int = floor(convx);
+ convx_float = convx - convx_int;
+
+ area = convx * convy;
+
+ lowy_int = 0;
+ lowy_float = 0;
+ highy_int = convy_int;
+ highy_float = convy_float;
+
+ for (i = 0; i < heightout; i++) {
+ /* Clamp here to be sure we don't read beyond input buffer. */
+ if (highy_int >= heightin)
+ highy_int = heightin - 1;
+ lowx_int = 0;
+ lowx_float = 0;
+ highx_int = convx_int;
+ highx_float = convx_float;
+
+ for (j = 0; j < widthout; j++) {
+ /*
+ ** Ok, now apply box filter to box that goes from (lowx, lowy)
+ ** to (highx, highy) on input data into this pixel on output
+ ** data.
+ */
+ totals[0] = totals[1] = totals[2] = totals[3] = 0.0;
+
+ /* calculate the value for pixels in the 1st row */
+ xindex = lowx_int*group_size;
+ if((highy_int>lowy_int) && (highx_int>lowx_int)) {
+
+ y_percent = 1-lowy_float;
+ temp = (const char *)datain + xindex + lowy_int * ysize;
+ percent = y_percent * (1-lowx_float);
+ for (k = 0, temp_index = temp; k < components;
+ k++, temp_index += element_size) {
+ if (myswap_bytes) {
+ swapbuf = __GLU_SWAP_2_BYTES(temp_index);
+ totals[k] += *(const GLshort*)&swapbuf * percent;
+ } else {
+ totals[k] += *(const GLshort*)temp_index * percent;
+ }
+ }
+ left = temp;
+ for(l = lowx_int+1; l < highx_int; l++) {
+ temp += group_size;
+ for (k = 0, temp_index = temp; k < components;
+ k++, temp_index += element_size) {
+ if (myswap_bytes) {
+ swapbuf = __GLU_SWAP_2_BYTES(temp_index);
+ totals[k] += *(const GLshort*)&swapbuf * y_percent;
+ } else {
+ totals[k] += *(const GLshort*)temp_index * y_percent;
+ }
+ }
+ }
+ temp += group_size;
+ right = temp;
+ percent = y_percent * highx_float;
+ for (k = 0, temp_index = temp; k < components;
+ k++, temp_index += element_size) {
+ if (myswap_bytes) {
+ swapbuf = __GLU_SWAP_2_BYTES(temp_index);
+ totals[k] += *(const GLshort*)&swapbuf * percent;
+ } else {
+ totals[k] += *(const GLshort*)temp_index * percent;
+ }
+ }
+
+ /* calculate the value for pixels in the last row */
+ y_percent = highy_float;
+ percent = y_percent * (1-lowx_float);
+ temp = (const char *)datain + xindex + highy_int * ysize;
+ for (k = 0, temp_index = temp; k < components;
+ k++, temp_index += element_size) {
+ if (myswap_bytes) {
+ swapbuf = __GLU_SWAP_2_BYTES(temp_index);
+ totals[k] += *(const GLshort*)&swapbuf * percent;
+ } else {
+ totals[k] += *(const GLshort*)temp_index * percent;
+ }
+ }
+ for(l = lowx_int+1; l < highx_int; l++) {
+ temp += group_size;
+ for (k = 0, temp_index = temp; k < components;
+ k++, temp_index += element_size) {
+ if (myswap_bytes) {
+ swapbuf = __GLU_SWAP_2_BYTES(temp_index);
+ totals[k] += *(const GLshort*)&swapbuf * y_percent;
+ } else {
+ totals[k] += *(const GLshort*)temp_index * y_percent;
+ }
+ }
+ }
+ temp += group_size;
+ percent = y_percent * highx_float;
+ for (k = 0, temp_index = temp; k < components;
+ k++, temp_index += element_size) {
+ if (myswap_bytes) {
+ swapbuf = __GLU_SWAP_2_BYTES(temp_index);
+ totals[k] += *(const GLshort*)&swapbuf * percent;
+ } else {
+ totals[k] += *(const GLshort*)temp_index * percent;
+ }
+ }
+
+ /* calculate the value for pixels in the 1st and last column */
+ for(m = lowy_int+1; m < highy_int; m++) {
+ left += ysize;
+ right += ysize;
+ for (k = 0; k < components;
+ k++, left += element_size, right += element_size) {
+ if (myswap_bytes) {
+ swapbuf = __GLU_SWAP_2_BYTES(left);
+ totals[k] += *(const GLshort*)&swapbuf * (1-lowx_float);
+ swapbuf = __GLU_SWAP_2_BYTES(right);
+ totals[k] += *(const GLshort*)&swapbuf * highx_float;
+ } else {
+ totals[k] += *(const GLshort*)left * (1-lowx_float)
+ + *(const GLshort*)right * highx_float;
+ }
+ }
+ }
+ } else if (highy_int > lowy_int) {
+ x_percent = highx_float - lowx_float;
+ percent = (1-lowy_float)*x_percent;
+ temp = (const char *)datain + xindex + lowy_int*ysize;
+ for (k = 0, temp_index = temp; k < components;
+ k++, temp_index += element_size) {
+ if (myswap_bytes) {
+ swapbuf = __GLU_SWAP_2_BYTES(temp_index);
+ totals[k] += *(const GLshort*)&swapbuf * percent;
+ } else {
+ totals[k] += *(const GLshort*)temp_index * percent;
+ }
+ }
+ for(m = lowy_int+1; m < highy_int; m++) {
+ temp += ysize;
+ for (k = 0, temp_index = temp; k < components;
+ k++, temp_index += element_size) {
+ if (myswap_bytes) {
+ swapbuf = __GLU_SWAP_2_BYTES(temp_index);
+ totals[k] += *(const GLshort*)&swapbuf * x_percent;
+ } else {
+ totals[k] += *(const GLshort*)temp_index * x_percent;
+ }
+ }
+ }
+ percent = x_percent * highy_float;
+ temp += ysize;
+ for (k = 0, temp_index = temp; k < components;
+ k++, temp_index += element_size) {
+ if (myswap_bytes) {
+ swapbuf = __GLU_SWAP_2_BYTES(temp_index);
+ totals[k] += *(const GLshort*)&swapbuf * percent;
+ } else {
+ totals[k] += *(const GLshort*)temp_index * percent;
+ }
+ }
+ } else if (highx_int > lowx_int) {
+ y_percent = highy_float - lowy_float;
+ percent = (1-lowx_float)*y_percent;
+
+ temp = (const char *)datain + xindex + lowy_int*ysize;
+ for (k = 0, temp_index = temp; k < components;
+ k++, temp_index += element_size) {
+ if (myswap_bytes) {
+ swapbuf = __GLU_SWAP_2_BYTES(temp_index);
+ totals[k] += *(const GLshort*)&swapbuf * percent;
+ } else {
+ totals[k] += *(const GLshort*)temp_index * percent;
+ }
+ }
+ for (l = lowx_int+1; l < highx_int; l++) {
+ temp += group_size;
+ for (k = 0, temp_index = temp; k < components;
+ k++, temp_index += element_size) {
+ if (myswap_bytes) {
+ swapbuf = __GLU_SWAP_2_BYTES(temp_index);
+ totals[k] += *(const GLshort*)&swapbuf * y_percent;
+ } else {
+ totals[k] += *(const GLshort*)temp_index * y_percent;
+ }
+ }
+ }
+ temp += group_size;
+ percent = y_percent * highx_float;
+ for (k = 0, temp_index = temp; k < components;
+ k++, temp_index += element_size) {
+ if (myswap_bytes) {
+ swapbuf = __GLU_SWAP_2_BYTES(temp_index);
+ totals[k] += *(const GLshort*)&swapbuf * percent;
+ } else {
+ totals[k] += *(const GLshort*)temp_index * percent;
+ }
+ }
+ } else {
+ percent = (highy_float-lowy_float)*(highx_float-lowx_float);
+ temp = (const char *)datain + xindex + lowy_int * ysize;
+ for (k = 0, temp_index = temp; k < components;
+ k++, temp_index += element_size) {
+ if (myswap_bytes) {
+ swapbuf = __GLU_SWAP_2_BYTES(temp_index);
+ totals[k] += *(const GLshort*)&swapbuf * percent;
+ } else {
+ totals[k] += *(const GLshort*)temp_index * percent;
+ }
+ }
+ }
+
+ /* this is for the pixels in the body */
+ temp0 = (const char *)datain + xindex + group_size +
+ (lowy_int+1)*ysize;
+ for (m = lowy_int+1; m < highy_int; m++) {
+ temp = temp0;
+ for(l = lowx_int+1; l < highx_int; l++) {
+ for (k = 0, temp_index = temp; k < components;
+ k++, temp_index += element_size) {
+ if (myswap_bytes) {
+ swapbuf = __GLU_SWAP_2_BYTES(temp_index);
+ totals[k] += *(const GLshort*)&swapbuf;
+ } else {
+ totals[k] += *(const GLshort*)temp_index;
+ }
+ }
+ temp += group_size;
+ }
+ temp0 += ysize;
+ }
+
+ outindex = (j + (i * widthout)) * components;
+ for (k = 0; k < components; k++) {
+ dataout[outindex + k] = totals[k]/area;
+ /*printf("totals[%d] = %f\n", k, totals[k]);*/
+ }
+ lowx_int = highx_int;
+ lowx_float = highx_float;
+ highx_int += convx_int;
+ highx_float += convx_float;
+ if(highx_float > 1) {
+ highx_float -= 1.0;
+ highx_int++;
+ }
+ }
+ lowy_int = highy_int;
+ lowy_float = highy_float;
+ highy_int += convy_int;
+ highy_float += convy_float;
+ if(highy_float > 1) {
+ highy_float -= 1.0;
+ highy_int++;
+ }
+ }
+}
+
+static void scale_internal_uint(GLint components, GLint widthin,
+ GLint heightin, const GLuint *datain,
+ GLint widthout, GLint heightout,
+ GLuint *dataout, GLint element_size,
+ GLint ysize, GLint group_size,
+ GLint myswap_bytes)
+{
+ float convx;
+ float convy;
+ float percent;
+ /* Max components in a format is 4, so... */
+ float totals[4];
+ float area;
+ int i,j,k,xindex;
+
+ const char *temp, *temp0;
+ const char *temp_index;
+ int outindex;
+
+ int lowx_int, highx_int, lowy_int, highy_int;
+ float x_percent, y_percent;
+ float lowx_float, highx_float, lowy_float, highy_float;
+ float convy_float, convx_float;
+ int convy_int, convx_int;
+ int l, m;
+ const char *left, *right;
+
+ if (widthin == widthout*2 && heightin == heightout*2) {
+ halveImage_uint(components, widthin, heightin,
+ (const GLuint *)datain, (GLuint *)dataout,
+ element_size, ysize, group_size, myswap_bytes);
+ return;
+ }
+ convy = (float) heightin/heightout;
+ convx = (float) widthin/widthout;
+ convy_int = floor(convy);
+ convy_float = convy - convy_int;
+ convx_int = floor(convx);
+ convx_float = convx - convx_int;
+
+ area = convx * convy;
+
+ lowy_int = 0;
+ lowy_float = 0;
+ highy_int = convy_int;
+ highy_float = convy_float;
+
+ for (i = 0; i < heightout; i++) {
+ /* Clamp here to be sure we don't read beyond input buffer. */
+ if (highy_int >= heightin)
+ highy_int = heightin - 1;
+ lowx_int = 0;
+ lowx_float = 0;
+ highx_int = convx_int;
+ highx_float = convx_float;
+
+ for (j = 0; j < widthout; j++) {
+ /*
+ ** Ok, now apply box filter to box that goes from (lowx, lowy)
+ ** to (highx, highy) on input data into this pixel on output
+ ** data.
+ */
+ totals[0] = totals[1] = totals[2] = totals[3] = 0.0;
+
+ /* calculate the value for pixels in the 1st row */
+ xindex = lowx_int*group_size;
+ if((highy_int>lowy_int) && (highx_int>lowx_int)) {
+
+ y_percent = 1-lowy_float;
+ temp = (const char *)datain + xindex + lowy_int * ysize;
+ percent = y_percent * (1-lowx_float);
+ for (k = 0, temp_index = temp; k < components;
+ k++, temp_index += element_size) {
+ if (myswap_bytes) {
+ totals[k] += __GLU_SWAP_4_BYTES(temp_index) * percent;
+ } else {
+ totals[k] += *(const GLuint*)temp_index * percent;
+ }
+ }
+ left = temp;
+ for(l = lowx_int+1; l < highx_int; l++) {
+ temp += group_size;
+ for (k = 0, temp_index = temp; k < components;
+ k++, temp_index += element_size) {
+ if (myswap_bytes) {
+ totals[k] +=
+ __GLU_SWAP_4_BYTES(temp_index) * y_percent;
+ } else {
+ totals[k] += *(const GLuint*)temp_index * y_percent;
+ }
+ }
+ }
+ temp += group_size;
+ right = temp;
+ percent = y_percent * highx_float;
+ for (k = 0, temp_index = temp; k < components;
+ k++, temp_index += element_size) {
+ if (myswap_bytes) {
+ totals[k] += __GLU_SWAP_4_BYTES(temp_index) * percent;
+ } else {
+ totals[k] += *(const GLuint*)temp_index * percent;
+ }
+ }
+
+ /* calculate the value for pixels in the last row */
+ y_percent = highy_float;
+ percent = y_percent * (1-lowx_float);
+ temp = (const char *)datain + xindex + highy_int * ysize;
+ for (k = 0, temp_index = temp; k < components;
+ k++, temp_index += element_size) {
+ if (myswap_bytes) {
+ totals[k] += __GLU_SWAP_4_BYTES(temp_index) * percent;
+ } else {
+ totals[k] += *(const GLuint*)temp_index * percent;
+ }
+ }
+ for(l = lowx_int+1; l < highx_int; l++) {
+ temp += group_size;
+ for (k = 0, temp_index = temp; k < components;
+ k++, temp_index += element_size) {
+ if (myswap_bytes) {
+ totals[k] +=
+ __GLU_SWAP_4_BYTES(temp_index) * y_percent;
+ } else {
+ totals[k] += *(const GLuint*)temp_index * y_percent;
+ }
+ }
+ }
+ temp += group_size;
+ percent = y_percent * highx_float;
+ for (k = 0, temp_index = temp; k < components;
+ k++, temp_index += element_size) {
+ if (myswap_bytes) {
+ totals[k] += __GLU_SWAP_4_BYTES(temp_index) * percent;
+ } else {
+ totals[k] += *(const GLuint*)temp_index * percent;
+ }
+ }
+
+ /* calculate the value for pixels in the 1st and last column */
+ for(m = lowy_int+1; m < highy_int; m++) {
+ left += ysize;
+ right += ysize;
+ for (k = 0; k < components;
+ k++, left += element_size, right += element_size) {
+ if (myswap_bytes) {
+ totals[k] +=
+ __GLU_SWAP_4_BYTES(left) * (1-lowx_float)
+ + __GLU_SWAP_4_BYTES(right) * highx_float;
+ } else {
+ totals[k] += *(const GLuint*)left * (1-lowx_float)
+ + *(const GLuint*)right * highx_float;
+ }
+ }
+ }
+ } else if (highy_int > lowy_int) {
+ x_percent = highx_float - lowx_float;
+ percent = (1-lowy_float)*x_percent;
+ temp = (const char *)datain + xindex + lowy_int*ysize;
+ for (k = 0, temp_index = temp; k < components;
+ k++, temp_index += element_size) {
+ if (myswap_bytes) {
+ totals[k] += __GLU_SWAP_4_BYTES(temp_index) * percent;
+ } else {
+ totals[k] += *(const GLuint*)temp_index * percent;
+ }
+ }
+ for(m = lowy_int+1; m < highy_int; m++) {
+ temp += ysize;
+ for (k = 0, temp_index = temp; k < components;
+ k++, temp_index += element_size) {
+ if (myswap_bytes) {
+ totals[k] +=
+ __GLU_SWAP_4_BYTES(temp_index) * x_percent;
+ } else {
+ totals[k] += *(const GLuint*)temp_index * x_percent;
+ }
+ }
+ }
+ percent = x_percent * highy_float;
+ temp += ysize;
+ for (k = 0, temp_index = temp; k < components;
+ k++, temp_index += element_size) {
+ if (myswap_bytes) {
+ totals[k] += __GLU_SWAP_4_BYTES(temp_index) * percent;
+ } else {
+ totals[k] += *(const GLuint*)temp_index * percent;
+ }
+ }
+ } else if (highx_int > lowx_int) {
+ y_percent = highy_float - lowy_float;
+ percent = (1-lowx_float)*y_percent;
+
+ temp = (const char *)datain + xindex + lowy_int*ysize;
+ for (k = 0, temp_index = temp; k < components;
+ k++, temp_index += element_size) {
+ if (myswap_bytes) {
+ totals[k] += __GLU_SWAP_4_BYTES(temp_index) * percent;
+ } else {
+ totals[k] += *(const GLuint*)temp_index * percent;
+ }
+ }
+ for (l = lowx_int+1; l < highx_int; l++) {
+ temp += group_size;
+ for (k = 0, temp_index = temp; k < components;
+ k++, temp_index += element_size) {
+ if (myswap_bytes) {
+ totals[k] +=
+ __GLU_SWAP_4_BYTES(temp_index) * y_percent;
+ } else {
+ totals[k] += *(const GLuint*)temp_index * y_percent;
+ }
+ }
+ }
+ temp += group_size;
+ percent = y_percent * highx_float;
+ for (k = 0, temp_index = temp; k < components;
+ k++, temp_index += element_size) {
+ if (myswap_bytes) {
+ totals[k] += __GLU_SWAP_4_BYTES(temp_index) * percent;
+ } else {
+ totals[k] += *(const GLuint*)temp_index * percent;
+ }
+ }
+ } else {
+ percent = (highy_float-lowy_float)*(highx_float-lowx_float);
+ temp = (const char *)datain + xindex + lowy_int * ysize;
+ for (k = 0, temp_index = temp; k < components;
+ k++, temp_index += element_size) {
+ if (myswap_bytes) {
+ totals[k] += __GLU_SWAP_4_BYTES(temp_index) * percent;
+ } else {
+ totals[k] += *(const GLuint*)temp_index * percent;
+ }
+ }
+ }
+
+ /* this is for the pixels in the body */
+ temp0 = (const char *)datain + xindex + group_size +
+ (lowy_int+1)*ysize;
+ for (m = lowy_int+1; m < highy_int; m++) {
+ temp = temp0;
+ for(l = lowx_int+1; l < highx_int; l++) {
+ for (k = 0, temp_index = temp; k < components;
+ k++, temp_index += element_size) {
+ if (myswap_bytes) {
+ totals[k] += __GLU_SWAP_4_BYTES(temp_index);
+ } else {
+ totals[k] += *(const GLuint*)temp_index;
+ }
+ }
+ temp += group_size;
+ }
+ temp0 += ysize;
+ }
+
+ outindex = (j + (i * widthout)) * components;
+ for (k = 0; k < components; k++) {
+ /* clamp at UINT_MAX */
+ float value= totals[k]/area;
+ if (value >= (float) UINT_MAX) { /* need '=' */
+ dataout[outindex + k] = UINT_MAX;
+ }
+ else dataout[outindex + k] = value;
+ }
+ lowx_int = highx_int;
+ lowx_float = highx_float;
+ highx_int += convx_int;
+ highx_float += convx_float;
+ if(highx_float > 1) {
+ highx_float -= 1.0;
+ highx_int++;
+ }
+ }
+ lowy_int = highy_int;
+ lowy_float = highy_float;
+ highy_int += convy_int;
+ highy_float += convy_float;
+ if(highy_float > 1) {
+ highy_float -= 1.0;
+ highy_int++;
+ }
+ }
+}
+
+
+
+static void scale_internal_int(GLint components, GLint widthin,
+ GLint heightin, const GLint *datain,
+ GLint widthout, GLint heightout,
+ GLint *dataout, GLint element_size,
+ GLint ysize, GLint group_size,
+ GLint myswap_bytes)
+{
+ float convx;
+ float convy;
+ float percent;
+ /* Max components in a format is 4, so... */
+ float totals[4];
+ float area;
+ int i,j,k,xindex;
+
+ const char *temp, *temp0;
+ const char *temp_index;
+ int outindex;
+
+ int lowx_int, highx_int, lowy_int, highy_int;
+ float x_percent, y_percent;
+ float lowx_float, highx_float, lowy_float, highy_float;
+ float convy_float, convx_float;
+ int convy_int, convx_int;
+ int l, m;
+ const char *left, *right;
+
+ GLuint swapbuf; /* unsigned buffer */
+
+ if (widthin == widthout*2 && heightin == heightout*2) {
+ halveImage_int(components, widthin, heightin,
+ (const GLint *)datain, (GLint *)dataout,
+ element_size, ysize, group_size, myswap_bytes);
+ return;
+ }
+ convy = (float) heightin/heightout;
+ convx = (float) widthin/widthout;
+ convy_int = floor(convy);
+ convy_float = convy - convy_int;
+ convx_int = floor(convx);
+ convx_float = convx - convx_int;
+
+ area = convx * convy;
+
+ lowy_int = 0;
+ lowy_float = 0;
+ highy_int = convy_int;
+ highy_float = convy_float;
+
+ for (i = 0; i < heightout; i++) {
+ /* Clamp here to be sure we don't read beyond input buffer. */
+ if (highy_int >= heightin)
+ highy_int = heightin - 1;
+ lowx_int = 0;
+ lowx_float = 0;
+ highx_int = convx_int;
+ highx_float = convx_float;
+
+ for (j = 0; j < widthout; j++) {
+ /*
+ ** Ok, now apply box filter to box that goes from (lowx, lowy)
+ ** to (highx, highy) on input data into this pixel on output
+ ** data.
+ */
+ totals[0] = totals[1] = totals[2] = totals[3] = 0.0;
+
+ /* calculate the value for pixels in the 1st row */
+ xindex = lowx_int*group_size;
+ if((highy_int>lowy_int) && (highx_int>lowx_int)) {
+
+ y_percent = 1-lowy_float;
+ temp = (const char *)datain + xindex + lowy_int * ysize;
+ percent = y_percent * (1-lowx_float);
+ for (k = 0, temp_index = temp; k < components;
+ k++, temp_index += element_size) {
+ if (myswap_bytes) {
+ swapbuf = __GLU_SWAP_4_BYTES(temp_index);
+ totals[k] += *(const GLint*)&swapbuf * percent;
+ } else {
+ totals[k] += *(const GLint*)temp_index * percent;
+ }
+ }
+ left = temp;
+ for(l = lowx_int+1; l < highx_int; l++) {
+ temp += group_size;
+ for (k = 0, temp_index = temp; k < components;
+ k++, temp_index += element_size) {
+ if (myswap_bytes) {
+ swapbuf = __GLU_SWAP_4_BYTES(temp_index);
+ totals[k] += *(const GLint*)&swapbuf * y_percent;
+ } else {
+ totals[k] += *(const GLint*)temp_index * y_percent;
+ }
+ }
+ }
+ temp += group_size;
+ right = temp;
+ percent = y_percent * highx_float;
+ for (k = 0, temp_index = temp; k < components;
+ k++, temp_index += element_size) {
+ if (myswap_bytes) {
+ swapbuf = __GLU_SWAP_4_BYTES(temp_index);
+ totals[k] += *(const GLint*)&swapbuf * percent;
+ } else {
+ totals[k] += *(const GLint*)temp_index * percent;
+ }
+ }
+
+ /* calculate the value for pixels in the last row */
+ y_percent = highy_float;
+ percent = y_percent * (1-lowx_float);
+ temp = (const char *)datain + xindex + highy_int * ysize;
+ for (k = 0, temp_index = temp; k < components;
+ k++, temp_index += element_size) {
+ if (myswap_bytes) {
+ swapbuf = __GLU_SWAP_4_BYTES(temp_index);
+ totals[k] += *(const GLint*)&swapbuf * percent;
+ } else {
+ totals[k] += *(const GLint*)temp_index * percent;
+ }
+ }
+ for(l = lowx_int+1; l < highx_int; l++) {
+ temp += group_size;
+ for (k = 0, temp_index = temp; k < components;
+ k++, temp_index += element_size) {
+ if (myswap_bytes) {
+ swapbuf = __GLU_SWAP_4_BYTES(temp_index);
+ totals[k] += *(const GLint*)&swapbuf * y_percent;
+ } else {
+ totals[k] += *(const GLint*)temp_index * y_percent;
+ }
+ }
+ }
+ temp += group_size;
+ percent = y_percent * highx_float;
+ for (k = 0, temp_index = temp; k < components;
+ k++, temp_index += element_size) {
+ if (myswap_bytes) {
+ swapbuf = __GLU_SWAP_4_BYTES(temp_index);
+ totals[k] += *(const GLint*)&swapbuf * percent;
+ } else {
+ totals[k] += *(const GLint*)temp_index * percent;
+ }
+ }
+
+ /* calculate the value for pixels in the 1st and last column */
+ for(m = lowy_int+1; m < highy_int; m++) {
+ left += ysize;
+ right += ysize;
+ for (k = 0; k < components;
+ k++, left += element_size, right += element_size) {
+ if (myswap_bytes) {
+ swapbuf = __GLU_SWAP_4_BYTES(left);
+ totals[k] += *(const GLint*)&swapbuf * (1-lowx_float);
+ swapbuf = __GLU_SWAP_4_BYTES(right);
+ totals[k] += *(const GLint*)&swapbuf * highx_float;
+ } else {
+ totals[k] += *(const GLint*)left * (1-lowx_float)
+ + *(const GLint*)right * highx_float;
+ }
+ }
+ }
+ } else if (highy_int > lowy_int) {
+ x_percent = highx_float - lowx_float;
+ percent = (1-lowy_float)*x_percent;
+ temp = (const char *)datain + xindex + lowy_int*ysize;
+ for (k = 0, temp_index = temp; k < components;
+ k++, temp_index += element_size) {
+ if (myswap_bytes) {
+ swapbuf = __GLU_SWAP_4_BYTES(temp_index);
+ totals[k] += *(const GLint*)&swapbuf * percent;
+ } else {
+ totals[k] += *(const GLint*)temp_index * percent;
+ }
+ }
+ for(m = lowy_int+1; m < highy_int; m++) {
+ temp += ysize;
+ for (k = 0, temp_index = temp; k < components;
+ k++, temp_index += element_size) {
+ if (myswap_bytes) {
+ swapbuf = __GLU_SWAP_4_BYTES(temp_index);
+ totals[k] += *(const GLint*)&swapbuf * x_percent;
+ } else {
+ totals[k] += *(const GLint*)temp_index * x_percent;
+ }
+ }
+ }
+ percent = x_percent * highy_float;
+ temp += ysize;
+ for (k = 0, temp_index = temp; k < components;
+ k++, temp_index += element_size) {
+ if (myswap_bytes) {
+ swapbuf = __GLU_SWAP_4_BYTES(temp_index);
+ totals[k] += *(const GLint*)&swapbuf * percent;
+ } else {
+ totals[k] += *(const GLint*)temp_index * percent;
+ }
+ }
+ } else if (highx_int > lowx_int) {
+ y_percent = highy_float - lowy_float;
+ percent = (1-lowx_float)*y_percent;
+
+ temp = (const char *)datain + xindex + lowy_int*ysize;
+ for (k = 0, temp_index = temp; k < components;
+ k++, temp_index += element_size) {
+ if (myswap_bytes) {
+ swapbuf = __GLU_SWAP_4_BYTES(temp_index);
+ totals[k] += *(const GLint*)&swapbuf * percent;
+ } else {
+ totals[k] += *(const GLint*)temp_index * percent;
+ }
+ }
+ for (l = lowx_int+1; l < highx_int; l++) {
+ temp += group_size;
+ for (k = 0, temp_index = temp; k < components;
+ k++, temp_index += element_size) {
+ if (myswap_bytes) {
+ swapbuf = __GLU_SWAP_4_BYTES(temp_index);
+ totals[k] += *(const GLint*)&swapbuf * y_percent;
+ } else {
+ totals[k] += *(const GLint*)temp_index * y_percent;
+ }
+ }
+ }
+ temp += group_size;
+ percent = y_percent * highx_float;
+ for (k = 0, temp_index = temp; k < components;
+ k++, temp_index += element_size) {
+ if (myswap_bytes) {
+ swapbuf = __GLU_SWAP_4_BYTES(temp_index);
+ totals[k] += *(const GLint*)&swapbuf * percent;
+ } else {
+ totals[k] += *(const GLint*)temp_index * percent;
+ }
+ }
+ } else {
+ percent = (highy_float-lowy_float)*(highx_float-lowx_float);
+ temp = (const char *)datain + xindex + lowy_int * ysize;
+ for (k = 0, temp_index = temp; k < components;
+ k++, temp_index += element_size) {
+ if (myswap_bytes) {
+ swapbuf = __GLU_SWAP_4_BYTES(temp_index);
+ totals[k] += *(const GLint*)&swapbuf * percent;
+ } else {
+ totals[k] += *(const GLint*)temp_index * percent;
+ }
+ }
+ }
+
+ /* this is for the pixels in the body */
+ temp0 = (const char *)datain + xindex + group_size +
+ (lowy_int+1)*ysize;
+ for (m = lowy_int+1; m < highy_int; m++) {
+ temp = temp0;
+ for(l = lowx_int+1; l < highx_int; l++) {
+ for (k = 0, temp_index = temp; k < components;
+ k++, temp_index += element_size) {
+ if (myswap_bytes) {
+ swapbuf = __GLU_SWAP_4_BYTES(temp_index);
+ totals[k] += *(const GLint*)&swapbuf;
+ } else {
+ totals[k] += *(const GLint*)temp_index;
+ }
+ }
+ temp += group_size;
+ }
+ temp0 += ysize;
+ }
+
+ outindex = (j + (i * widthout)) * components;
+ for (k = 0; k < components; k++) {
+ dataout[outindex + k] = totals[k]/area;
+ /*printf("totals[%d] = %f\n", k, totals[k]);*/
+ }
+ lowx_int = highx_int;
+ lowx_float = highx_float;
+ highx_int += convx_int;
+ highx_float += convx_float;
+ if(highx_float > 1) {
+ highx_float -= 1.0;
+ highx_int++;
+ }
+ }
+ lowy_int = highy_int;
+ lowy_float = highy_float;
+ highy_int += convy_int;
+ highy_float += convy_float;
+ if(highy_float > 1) {
+ highy_float -= 1.0;
+ highy_int++;
+ }
+ }
+}
+
+
+
+static void scale_internal_float(GLint components, GLint widthin,
+ GLint heightin, const GLfloat *datain,
+ GLint widthout, GLint heightout,
+ GLfloat *dataout, GLint element_size,
+ GLint ysize, GLint group_size,
+ GLint myswap_bytes)
+{
+ float convx;
+ float convy;
+ float percent;
+ /* Max components in a format is 4, so... */
+ float totals[4];
+ float area;
+ int i,j,k,xindex;
+
+ const char *temp, *temp0;
+ const char *temp_index;
+ int outindex;
+
+ int lowx_int, highx_int, lowy_int, highy_int;
+ float x_percent, y_percent;
+ float lowx_float, highx_float, lowy_float, highy_float;
+ float convy_float, convx_float;
+ int convy_int, convx_int;
+ int l, m;
+ const char *left, *right;
+
+ union { GLuint b; GLfloat f; } swapbuf;
+
+ if (widthin == widthout*2 && heightin == heightout*2) {
+ halveImage_float(components, widthin, heightin,
+ (const GLfloat *)datain, (GLfloat *)dataout,
+ element_size, ysize, group_size, myswap_bytes);
+ return;
+ }
+ convy = (float) heightin/heightout;
+ convx = (float) widthin/widthout;
+ convy_int = floor(convy);
+ convy_float = convy - convy_int;
+ convx_int = floor(convx);
+ convx_float = convx - convx_int;
+
+ area = convx * convy;
+
+ lowy_int = 0;
+ lowy_float = 0;
+ highy_int = convy_int;
+ highy_float = convy_float;
+
+ for (i = 0; i < heightout; i++) {
+ /* Clamp here to be sure we don't read beyond input buffer. */
+ if (highy_int >= heightin)
+ highy_int = heightin - 1;
+ lowx_int = 0;
+ lowx_float = 0;
+ highx_int = convx_int;
+ highx_float = convx_float;
+
+ for (j = 0; j < widthout; j++) {
+ /*
+ ** Ok, now apply box filter to box that goes from (lowx, lowy)
+ ** to (highx, highy) on input data into this pixel on output
+ ** data.
+ */
+ totals[0] = totals[1] = totals[2] = totals[3] = 0.0;
+
+ /* calculate the value for pixels in the 1st row */
+ xindex = lowx_int*group_size;
+ if((highy_int>lowy_int) && (highx_int>lowx_int)) {
+
+ y_percent = 1-lowy_float;
+ temp = (const char *)datain + xindex + lowy_int * ysize;
+ percent = y_percent * (1-lowx_float);
+ for (k = 0, temp_index = temp; k < components;
+ k++, temp_index += element_size) {
+ if (myswap_bytes) {
+ swapbuf.b = __GLU_SWAP_4_BYTES(temp_index);
+ totals[k] += swapbuf.f * percent;
+ } else {
+ totals[k] += *(const GLfloat*)temp_index * percent;
+ }
+ }
+ left = temp;
+ for(l = lowx_int+1; l < highx_int; l++) {
+ temp += group_size;
+ for (k = 0, temp_index = temp; k < components;
+ k++, temp_index += element_size) {
+ if (myswap_bytes) {
+ swapbuf.b = __GLU_SWAP_4_BYTES(temp_index);
+ totals[k] += swapbuf.f * y_percent;
+ } else {
+ totals[k] += *(const GLfloat*)temp_index * y_percent;
+ }
+ }
+ }
+ temp += group_size;
+ right = temp;
+ percent = y_percent * highx_float;
+ for (k = 0, temp_index = temp; k < components;
+ k++, temp_index += element_size) {
+ if (myswap_bytes) {
+ swapbuf.b = __GLU_SWAP_4_BYTES(temp_index);
+ totals[k] += swapbuf.f * percent;
+ } else {
+ totals[k] += *(const GLfloat*)temp_index * percent;
+ }
+ }
+
+ /* calculate the value for pixels in the last row */
+ y_percent = highy_float;
+ percent = y_percent * (1-lowx_float);
+ temp = (const char *)datain + xindex + highy_int * ysize;
+ for (k = 0, temp_index = temp; k < components;
+ k++, temp_index += element_size) {
+ if (myswap_bytes) {
+ swapbuf.b = __GLU_SWAP_4_BYTES(temp_index);
+ totals[k] += swapbuf.f * percent;
+ } else {
+ totals[k] += *(const GLfloat*)temp_index * percent;
+ }
+ }
+ for(l = lowx_int+1; l < highx_int; l++) {
+ temp += group_size;
+ for (k = 0, temp_index = temp; k < components;
+ k++, temp_index += element_size) {
+ if (myswap_bytes) {
+ swapbuf.b = __GLU_SWAP_4_BYTES(temp_index);
+ totals[k] += swapbuf.f * y_percent;
+ } else {
+ totals[k] += *(const GLfloat*)temp_index * y_percent;
+ }
+ }
+ }
+ temp += group_size;
+ percent = y_percent * highx_float;
+ for (k = 0, temp_index = temp; k < components;
+ k++, temp_index += element_size) {
+ if (myswap_bytes) {
+ swapbuf.b = __GLU_SWAP_4_BYTES(temp_index);
+ totals[k] += swapbuf.f * percent;
+ } else {
+ totals[k] += *(const GLfloat*)temp_index * percent;
+ }
+ }
+
+ /* calculate the value for pixels in the 1st and last column */
+ for(m = lowy_int+1; m < highy_int; m++) {
+ left += ysize;
+ right += ysize;
+ for (k = 0; k < components;
+ k++, left += element_size, right += element_size) {
+ if (myswap_bytes) {
+ swapbuf.b = __GLU_SWAP_4_BYTES(left);
+ totals[k] += swapbuf.f * (1-lowx_float);
+ swapbuf.b = __GLU_SWAP_4_BYTES(right);
+ totals[k] += swapbuf.f * highx_float;
+ } else {
+ totals[k] += *(const GLfloat*)left * (1-lowx_float)
+ + *(const GLfloat*)right * highx_float;
+ }
+ }
+ }
+ } else if (highy_int > lowy_int) {
+ x_percent = highx_float - lowx_float;
+ percent = (1-lowy_float)*x_percent;
+ temp = (const char *)datain + xindex + lowy_int*ysize;
+ for (k = 0, temp_index = temp; k < components;
+ k++, temp_index += element_size) {
+ if (myswap_bytes) {
+ swapbuf.b = __GLU_SWAP_4_BYTES(temp_index);
+ totals[k] += swapbuf.f * percent;
+ } else {
+ totals[k] += *(const GLfloat*)temp_index * percent;
+ }
+ }
+ for(m = lowy_int+1; m < highy_int; m++) {
+ temp += ysize;
+ for (k = 0, temp_index = temp; k < components;
+ k++, temp_index += element_size) {
+ if (myswap_bytes) {
+ swapbuf.b = __GLU_SWAP_4_BYTES(temp_index);
+ totals[k] += swapbuf.f * x_percent;
+ } else {
+ totals[k] += *(const GLfloat*)temp_index * x_percent;
+ }
+ }
+ }
+ percent = x_percent * highy_float;
+ temp += ysize;
+ for (k = 0, temp_index = temp; k < components;
+ k++, temp_index += element_size) {
+ if (myswap_bytes) {
+ swapbuf.b = __GLU_SWAP_4_BYTES(temp_index);
+ totals[k] += swapbuf.f * percent;
+ } else {
+ totals[k] += *(const GLfloat*)temp_index * percent;
+ }
+ }
+ } else if (highx_int > lowx_int) {
+ y_percent = highy_float - lowy_float;
+ percent = (1-lowx_float)*y_percent;
+
+ temp = (const char *)datain + xindex + lowy_int*ysize;
+ for (k = 0, temp_index = temp; k < components;
+ k++, temp_index += element_size) {
+ if (myswap_bytes) {
+ swapbuf.b = __GLU_SWAP_4_BYTES(temp_index);
+ totals[k] += swapbuf.f * percent;
+ } else {
+ totals[k] += *(const GLfloat*)temp_index * percent;
+ }
+ }
+ for (l = lowx_int+1; l < highx_int; l++) {
+ temp += group_size;
+ for (k = 0, temp_index = temp; k < components;
+ k++, temp_index += element_size) {
+ if (myswap_bytes) {
+ swapbuf.b = __GLU_SWAP_4_BYTES(temp_index);
+ totals[k] += swapbuf.f * y_percent;
+ } else {
+ totals[k] += *(const GLfloat*)temp_index * y_percent;
+ }
+ }
+ }
+ temp += group_size;
+ percent = y_percent * highx_float;
+ for (k = 0, temp_index = temp; k < components;
+ k++, temp_index += element_size) {
+ if (myswap_bytes) {
+ swapbuf.b = __GLU_SWAP_4_BYTES(temp_index);
+ totals[k] += swapbuf.f * percent;
+ } else {
+ totals[k] += *(const GLfloat*)temp_index * percent;
+ }
+ }
+ } else {
+ percent = (highy_float-lowy_float)*(highx_float-lowx_float);
+ temp = (const char *)datain + xindex + lowy_int * ysize;
+ for (k = 0, temp_index = temp; k < components;
+ k++, temp_index += element_size) {
+ if (myswap_bytes) {
+ swapbuf.b = __GLU_SWAP_4_BYTES(temp_index);
+ totals[k] += swapbuf.f * percent;
+ } else {
+ totals[k] += *(const GLfloat*)temp_index * percent;
+ }
+ }
+ }
+
+ /* this is for the pixels in the body */
+ temp0 = (const char *)datain + xindex + group_size +
+ (lowy_int+1)*ysize;
+ for (m = lowy_int+1; m < highy_int; m++) {
+ temp = temp0;
+ for(l = lowx_int+1; l < highx_int; l++) {
+ for (k = 0, temp_index = temp; k < components;
+ k++, temp_index += element_size) {
+ if (myswap_bytes) {
+ swapbuf.b = __GLU_SWAP_4_BYTES(temp_index);
+ totals[k] += swapbuf.f;
+ } else {
+ totals[k] += *(const GLfloat*)temp_index;
+ }
+ }
+ temp += group_size;
+ }
+ temp0 += ysize;
+ }
+
+ outindex = (j + (i * widthout)) * components;
+ for (k = 0; k < components; k++) {
+ dataout[outindex + k] = totals[k]/area;
+ /*printf("totals[%d] = %f\n", k, totals[k]);*/
+ }
+ lowx_int = highx_int;
+ lowx_float = highx_float;
+ highx_int += convx_int;
+ highx_float += convx_float;
+ if(highx_float > 1) {
+ highx_float -= 1.0;
+ highx_int++;
+ }
+ }
+ lowy_int = highy_int;
+ lowy_float = highy_float;
+ highy_int += convy_int;
+ highy_float += convy_float;
+ if(highy_float > 1) {
+ highy_float -= 1.0;
+ highy_int++;
+ }
+ }
+}
+
+static int checkMipmapArgs(GLenum internalFormat, GLenum format, GLenum type)
+{
+ if (!legalFormat(format) || !legalType(type)) {
+ return GLU_INVALID_ENUM;
+ }
+ if (format == GL_STENCIL_INDEX) {
+ return GLU_INVALID_ENUM;
+ }
+
+ if (!isLegalFormatForPackedPixelType(format, type)) {
+ return GLU_INVALID_OPERATION;
+ }
+
+ return 0;
+} /* checkMipmapArgs() */
+
+static GLboolean legalFormat(GLenum format)
+{
+ switch(format) {
+ case GL_COLOR_INDEX:
+ case GL_STENCIL_INDEX:
+ case GL_DEPTH_COMPONENT:
+ case GL_RED:
+ case GL_GREEN:
+ case GL_BLUE:
+ case GL_ALPHA:
+ case GL_RGB:
+ case GL_RGBA:
+ case GL_LUMINANCE:
+ case GL_LUMINANCE_ALPHA:
+ case GL_BGR:
+ case GL_BGRA:
+ return GL_TRUE;
+ default:
+ return GL_FALSE;
+ }
+}
+
+
+static GLboolean legalType(GLenum type)
+{
+ switch(type) {
+ case GL_BITMAP:
+ case GL_BYTE:
+ case GL_UNSIGNED_BYTE:
+ case GL_SHORT:
+ case GL_UNSIGNED_SHORT:
+ case GL_INT:
+ case GL_UNSIGNED_INT:
+ case GL_FLOAT:
+ case GL_UNSIGNED_BYTE_3_3_2:
+ case GL_UNSIGNED_BYTE_2_3_3_REV:
+ case GL_UNSIGNED_SHORT_5_6_5:
+ case GL_UNSIGNED_SHORT_5_6_5_REV:
+ case GL_UNSIGNED_SHORT_4_4_4_4:
+ case GL_UNSIGNED_SHORT_4_4_4_4_REV:
+ case GL_UNSIGNED_SHORT_5_5_5_1:
+ case GL_UNSIGNED_SHORT_1_5_5_5_REV:
+ case GL_UNSIGNED_INT_8_8_8_8:
+ case GL_UNSIGNED_INT_8_8_8_8_REV:
+ case GL_UNSIGNED_INT_10_10_10_2:
+ case GL_UNSIGNED_INT_2_10_10_10_REV:
+ return GL_TRUE;
+ default:
+ return GL_FALSE;
+ }
+}
+
+/* */
+static GLboolean isTypePackedPixel(GLenum type)
+{
+ assert(legalType(type));
+
+ if (type == GL_UNSIGNED_BYTE_3_3_2 ||
+ type == GL_UNSIGNED_BYTE_2_3_3_REV ||
+ type == GL_UNSIGNED_SHORT_5_6_5 ||
+ type == GL_UNSIGNED_SHORT_5_6_5_REV ||
+ type == GL_UNSIGNED_SHORT_4_4_4_4 ||
+ type == GL_UNSIGNED_SHORT_4_4_4_4_REV ||
+ type == GL_UNSIGNED_SHORT_5_5_5_1 ||
+ type == GL_UNSIGNED_SHORT_1_5_5_5_REV ||
+ type == GL_UNSIGNED_INT_8_8_8_8 ||
+ type == GL_UNSIGNED_INT_8_8_8_8_REV ||
+ type == GL_UNSIGNED_INT_10_10_10_2 ||
+ type == GL_UNSIGNED_INT_2_10_10_10_REV) {
+ return 1;
+ }
+ else return 0;
+} /* isTypePackedPixel() */
+
+/* Determines if the packed pixel type is compatible with the format */
+static GLboolean isLegalFormatForPackedPixelType(GLenum format, GLenum type)
+{
+ /* if not a packed pixel type then return true */
+ if (!isTypePackedPixel(type)) {
+ return GL_TRUE;
+ }
+
+ /* 3_3_2/2_3_3_REV & 5_6_5/5_6_5_REV are only compatible with RGB */
+ if ((type == GL_UNSIGNED_BYTE_3_3_2 || type == GL_UNSIGNED_BYTE_2_3_3_REV||
+ type == GL_UNSIGNED_SHORT_5_6_5|| type == GL_UNSIGNED_SHORT_5_6_5_REV)
+ && format != GL_RGB)
+ return GL_FALSE;
+
+ /* 4_4_4_4/4_4_4_4_REV & 5_5_5_1/1_5_5_5_REV & 8_8_8_8/8_8_8_8_REV &
+ * 10_10_10_2/2_10_10_10_REV are only compatible with RGBA, BGRA & ABGR_EXT.
+ */
+ if ((type == GL_UNSIGNED_SHORT_4_4_4_4 ||
+ type == GL_UNSIGNED_SHORT_4_4_4_4_REV ||
+ type == GL_UNSIGNED_SHORT_5_5_5_1 ||
+ type == GL_UNSIGNED_SHORT_1_5_5_5_REV ||
+ type == GL_UNSIGNED_INT_8_8_8_8 ||
+ type == GL_UNSIGNED_INT_8_8_8_8_REV ||
+ type == GL_UNSIGNED_INT_10_10_10_2 ||
+ type == GL_UNSIGNED_INT_2_10_10_10_REV) &&
+ (format != GL_RGBA &&
+ format != GL_BGRA)) {
+ return GL_FALSE;
+ }
+
+ return GL_TRUE;
+} /* isLegalFormatForPackedPixelType() */
+
+static GLboolean isLegalLevels(GLint userLevel,GLint baseLevel,GLint maxLevel,
+ GLint totalLevels)
+{
+ if (baseLevel < 0 || baseLevel < userLevel || maxLevel < baseLevel ||
+ totalLevels < maxLevel)
+ return GL_FALSE;
+ else return GL_TRUE;
+} /* isLegalLevels() */
+
+/* Given user requested texture size, determine if it fits. If it
+ * doesn't then halve both sides and make the determination again
+ * until it does fit (for IR only).
+ * Note that proxy textures are not implemented in RE* even though
+ * they advertise the texture extension.
+ * Note that proxy textures are implemented but not according to spec in
+ * IMPACT*.
+ */
+static void closestFit(GLenum target, GLint width, GLint height,
+ GLint internalFormat, GLenum format, GLenum type,
+ GLint *newWidth, GLint *newHeight)
+{
+ /* Use proxy textures if OpenGL version is >= 1.1 */
+ if ( (strtod((const char *)glGetString(GL_VERSION),NULL) >= 1.1)
+ ) {
+ GLint widthPowerOf2= nearestPower(width);
+ GLint heightPowerOf2= nearestPower(height);
+ GLint proxyWidth;
+
+ do {
+ /* compute level 1 width & height, clamping each at 1 */
+ GLint widthAtLevelOne= (widthPowerOf2 > 1) ?
+ widthPowerOf2 >> 1 :
+ widthPowerOf2;
+ GLint heightAtLevelOne= (heightPowerOf2 > 1) ?
+ heightPowerOf2 >> 1 :
+ heightPowerOf2;
+ GLenum proxyTarget;
+ assert(widthAtLevelOne > 0); assert(heightAtLevelOne > 0);
+
+ /* does width x height at level 1 & all their mipmaps fit? */
+ if (target == GL_TEXTURE_2D || target == GL_PROXY_TEXTURE_2D) {
+ proxyTarget = GL_PROXY_TEXTURE_2D;
+ glTexImage2D(proxyTarget, 1, /* must be non-zero */
+ internalFormat,
+ widthAtLevelOne,heightAtLevelOne,0,format,type,NULL);
+ } else
+#if defined(GL_ARB_texture_cube_map)
+ if ((target == GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB) ||
+ (target == GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB) ||
+ (target == GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB) ||
+ (target == GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB) ||
+ (target == GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB) ||
+ (target == GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB)) {
+ proxyTarget = GL_PROXY_TEXTURE_CUBE_MAP_ARB;
+ glTexImage2D(proxyTarget, 1, /* must be non-zero */
+ internalFormat,
+ widthAtLevelOne,heightAtLevelOne,0,format,type,NULL);
+ } else
+#endif /* GL_ARB_texture_cube_map */
+ {
+ assert(target == GL_TEXTURE_1D || target == GL_PROXY_TEXTURE_1D);
+ proxyTarget = GL_PROXY_TEXTURE_1D;
+ glTexImage1D(proxyTarget, 1, /* must be non-zero */
+ internalFormat,widthAtLevelOne,0,format,type,NULL);
+ }
+ glGetTexLevelParameteriv(proxyTarget, 1,GL_TEXTURE_WIDTH,&proxyWidth);
+ /* does it fit??? */
+ if (proxyWidth == 0) { /* nope, so try again with these sizes */
+ if (widthPowerOf2 == 1 && heightPowerOf2 == 1) {
+ /* An 1x1 texture couldn't fit for some reason, so
+ * break out. This should never happen. But things
+ * happen. The disadvantage with this if-statement is
+ * that we will never be aware of when this happens
+ * since it will silently branch out.
+ */
+ goto noProxyTextures;
+ }
+ widthPowerOf2= widthAtLevelOne;
+ heightPowerOf2= heightAtLevelOne;
+ }
+ /* else it does fit */
+ } while (proxyWidth == 0);
+ /* loop must terminate! */
+
+ /* return the width & height at level 0 that fits */
+ *newWidth= widthPowerOf2;
+ *newHeight= heightPowerOf2;
+/*printf("Proxy Textures\n");*/
+ } /* if gluCheckExtension() */
+ else { /* no texture extension, so do this instead */
+ GLint maxsize;
+
+noProxyTextures:
+
+ glGetIntegerv(GL_MAX_TEXTURE_SIZE, &maxsize);
+ /* clamp user's texture sizes to maximum sizes, if necessary */
+ *newWidth = nearestPower(width);
+ if (*newWidth > maxsize) *newWidth = maxsize;
+ *newHeight = nearestPower(height);
+ if (*newHeight > maxsize) *newHeight = maxsize;
+/*printf("NO proxy textures\n");*/
+ }
+} /* closestFit() */
+
+GLint GLAPIENTRY
+gluScaleImage(GLenum format, GLsizei widthin, GLsizei heightin,
+ GLenum typein, const void *datain,
+ GLsizei widthout, GLsizei heightout, GLenum typeout,
+ void *dataout)
+{
+ int components;
+ GLushort *beforeImage;
+ GLushort *afterImage;
+ PixelStorageModes psm;
+
+ if (widthin == 0 || heightin == 0 || widthout == 0 || heightout == 0) {
+ return 0;
+ }
+ if (widthin < 0 || heightin < 0 || widthout < 0 || heightout < 0) {
+ return GLU_INVALID_VALUE;
+ }
+ if (!legalFormat(format) || !legalType(typein) || !legalType(typeout)) {
+ return GLU_INVALID_ENUM;
+ }
+ if (!isLegalFormatForPackedPixelType(format, typein)) {
+ return GLU_INVALID_OPERATION;
+ }
+ if (!isLegalFormatForPackedPixelType(format, typeout)) {
+ return GLU_INVALID_OPERATION;
+ }
+ beforeImage =
+ malloc(image_size(widthin, heightin, format, GL_UNSIGNED_SHORT));
+ afterImage =
+ malloc(image_size(widthout, heightout, format, GL_UNSIGNED_SHORT));
+ if (beforeImage == NULL || afterImage == NULL) {
+ free(beforeImage);
+ free(afterImage);
+ return GLU_OUT_OF_MEMORY;
+ }
+
+ retrieveStoreModes(&psm);
+ fill_image(&psm,widthin, heightin, format, typein, is_index(format),
+ datain, beforeImage);
+ components = elements_per_group(format, 0);
+ scale_internal(components, widthin, heightin, beforeImage,
+ widthout, heightout, afterImage);
+ empty_image(&psm,widthout, heightout, format, typeout,
+ is_index(format), afterImage, dataout);
+ free((GLbyte *) beforeImage);
+ free((GLbyte *) afterImage);
+
+ return 0;
+}
+
+int gluBuild1DMipmapLevelsCore(GLenum target, GLint internalFormat,
+ GLsizei width,
+ GLsizei widthPowerOf2,
+ GLenum format, GLenum type,
+ GLint userLevel, GLint baseLevel,GLint maxLevel,
+ const void *data)
+{
+ GLint newwidth;
+ GLint level, levels;
+ GLushort *newImage;
+ GLint newImage_width;
+ GLushort *otherImage;
+ GLushort *imageTemp;
+ GLint memreq;
+ GLint cmpts;
+ PixelStorageModes psm;
+
+ assert(checkMipmapArgs(internalFormat,format,type) == 0);
+ assert(width >= 1);
+
+ otherImage = NULL;
+
+ newwidth= widthPowerOf2;
+ levels = computeLog(newwidth);
+
+ levels+= userLevel;
+
+ retrieveStoreModes(&psm);
+ newImage = (GLushort *)
+ malloc(image_size(width, 1, format, GL_UNSIGNED_SHORT));
+ newImage_width = width;
+ if (newImage == NULL) {
+ return GLU_OUT_OF_MEMORY;
+ }
+ fill_image(&psm,width, 1, format, type, is_index(format),
+ data, newImage);
+ cmpts = elements_per_group(format,type);
+ glPixelStorei(GL_UNPACK_ALIGNMENT, 2);
+ glPixelStorei(GL_UNPACK_SKIP_ROWS, 0);
+ glPixelStorei(GL_UNPACK_SKIP_PIXELS, 0);
+ glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
+ /*
+ ** If swap_bytes was set, swapping occurred in fill_image.
+ */
+ glPixelStorei(GL_UNPACK_SWAP_BYTES, GL_FALSE);
+
+ for (level = userLevel; level <= levels; level++) {
+ if (newImage_width == newwidth) {
+ /* Use newImage for this level */
+ if (baseLevel <= level && level <= maxLevel) {
+ glTexImage1D(target, level, internalFormat, newImage_width,
+ 0, format, GL_UNSIGNED_SHORT, (void *) newImage);
+ }
+ } else {
+ if (otherImage == NULL) {
+ memreq = image_size(newwidth, 1, format, GL_UNSIGNED_SHORT);
+ otherImage = (GLushort *) malloc(memreq);
+ if (otherImage == NULL) {
+ glPixelStorei(GL_UNPACK_ALIGNMENT, psm.unpack_alignment);
+ glPixelStorei(GL_UNPACK_SKIP_ROWS, psm.unpack_skip_rows);
+ glPixelStorei(GL_UNPACK_SKIP_PIXELS,psm.unpack_skip_pixels);
+ glPixelStorei(GL_UNPACK_ROW_LENGTH, psm.unpack_row_length);
+ glPixelStorei(GL_UNPACK_SWAP_BYTES, psm.unpack_swap_bytes);
+ free(newImage);
+ return GLU_OUT_OF_MEMORY;
+ }
+ }
+ scale_internal(cmpts, newImage_width, 1, newImage,
+ newwidth, 1, otherImage);
+ /* Swap newImage and otherImage */
+ imageTemp = otherImage;
+ otherImage = newImage;
+ newImage = imageTemp;
+
+ newImage_width = newwidth;
+ if (baseLevel <= level && level <= maxLevel) {
+ glTexImage1D(target, level, internalFormat, newImage_width,
+ 0, format, GL_UNSIGNED_SHORT, (void *) newImage);
+ }
+ }
+ if (newwidth > 1) newwidth /= 2;
+ }
+ glPixelStorei(GL_UNPACK_ALIGNMENT, psm.unpack_alignment);
+ glPixelStorei(GL_UNPACK_SKIP_ROWS, psm.unpack_skip_rows);
+ glPixelStorei(GL_UNPACK_SKIP_PIXELS, psm.unpack_skip_pixels);
+ glPixelStorei(GL_UNPACK_ROW_LENGTH, psm.unpack_row_length);
+ glPixelStorei(GL_UNPACK_SWAP_BYTES, psm.unpack_swap_bytes);
+
+ free((GLbyte *) newImage);
+ if (otherImage) {
+ free((GLbyte *) otherImage);
+ }
+ return 0;
+}
+
+GLint GLAPIENTRY
+gluBuild1DMipmapLevels(GLenum target, GLint internalFormat,
+ GLsizei width,
+ GLenum format, GLenum type,
+ GLint userLevel, GLint baseLevel, GLint maxLevel,
+ const void *data)
+{
+ int levels;
+
+ int rc= checkMipmapArgs(internalFormat,format,type);
+ if (rc != 0) return rc;
+
+ if (width < 1) {
+ return GLU_INVALID_VALUE;
+ }
+
+ levels = computeLog(width);
+
+ levels+= userLevel;
+ if (!isLegalLevels(userLevel,baseLevel,maxLevel,levels))
+ return GLU_INVALID_VALUE;
+
+ return gluBuild1DMipmapLevelsCore(target, internalFormat,
+ width,
+ width,format, type,
+ userLevel, baseLevel, maxLevel,
+ data);
+} /* gluBuild1DMipmapLevels() */
+
+GLint GLAPIENTRY
+gluBuild1DMipmaps(GLenum target, GLint internalFormat, GLsizei width,
+ GLenum format, GLenum type,
+ const void *data)
+{
+ GLint widthPowerOf2;
+ int levels;
+ GLint dummy;
+
+ int rc= checkMipmapArgs(internalFormat,format,type);
+ if (rc != 0) return rc;
+
+ if (width < 1) {
+ return GLU_INVALID_VALUE;
+ }
+
+ closestFit(target,width,1,internalFormat,format,type,&widthPowerOf2,&dummy);
+ levels = computeLog(widthPowerOf2);
+
+ return gluBuild1DMipmapLevelsCore(target,internalFormat,
+ width,
+ widthPowerOf2,
+ format,type,0,0,levels,data);
+}
+
+static int bitmapBuild2DMipmaps(GLenum target, GLint internalFormat,
+ GLint width, GLint height, GLenum format,
+ GLenum type, const void *data)
+{
+ GLint newwidth, newheight;
+ GLint level, levels;
+ GLushort *newImage;
+ GLint newImage_width;
+ GLint newImage_height;
+ GLushort *otherImage;
+ GLushort *imageTemp;
+ GLint memreq;
+ GLint cmpts;
+ PixelStorageModes psm;
+
+ retrieveStoreModes(&psm);
+
+#if 0
+ glGetIntegerv(GL_MAX_TEXTURE_SIZE, &maxsize);
+ newwidth = nearestPower(width);
+ if (newwidth > maxsize) newwidth = maxsize;
+ newheight = nearestPower(height);
+ if (newheight > maxsize) newheight = maxsize;
+#else
+ closestFit(target,width,height,internalFormat,format,type,
+ &newwidth,&newheight);
+#endif
+ levels = computeLog(newwidth);
+ level = computeLog(newheight);
+ if (level > levels) levels=level;
+
+ otherImage = NULL;
+ newImage = (GLushort *)
+ malloc(image_size(width, height, format, GL_UNSIGNED_SHORT));
+ newImage_width = width;
+ newImage_height = height;
+ if (newImage == NULL) {
+ return GLU_OUT_OF_MEMORY;
+ }
+
+ fill_image(&psm,width, height, format, type, is_index(format),
+ data, newImage);
+
+ cmpts = elements_per_group(format,type);
+ glPixelStorei(GL_UNPACK_ALIGNMENT, 2);
+ glPixelStorei(GL_UNPACK_SKIP_ROWS, 0);
+ glPixelStorei(GL_UNPACK_SKIP_PIXELS, 0);
+ glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
+ /*
+ ** If swap_bytes was set, swapping occurred in fill_image.
+ */
+ glPixelStorei(GL_UNPACK_SWAP_BYTES, GL_FALSE);
+
+ for (level = 0; level <= levels; level++) {
+ if (newImage_width == newwidth && newImage_height == newheight) { /* Use newImage for this level */
+ glTexImage2D(target, level, internalFormat, newImage_width,
+ newImage_height, 0, format, GL_UNSIGNED_SHORT,
+ (void *) newImage);
+ } else {
+ if (otherImage == NULL) {
+ memreq =
+ image_size(newwidth, newheight, format, GL_UNSIGNED_SHORT);
+ otherImage = (GLushort *) malloc(memreq);
+ if (otherImage == NULL) {
+ glPixelStorei(GL_UNPACK_ALIGNMENT, psm.unpack_alignment);
+ glPixelStorei(GL_UNPACK_SKIP_ROWS, psm.unpack_skip_rows);
+ glPixelStorei(GL_UNPACK_SKIP_PIXELS,psm.unpack_skip_pixels);
+ glPixelStorei(GL_UNPACK_ROW_LENGTH, psm.unpack_row_length);
+ glPixelStorei(GL_UNPACK_SWAP_BYTES, psm.unpack_swap_bytes);
+ free(newImage);
+ return GLU_OUT_OF_MEMORY;
+ }
+ }
+ scale_internal(cmpts, newImage_width, newImage_height, newImage,
+ newwidth, newheight, otherImage);
+ /* Swap newImage and otherImage */
+ imageTemp = otherImage;
+ otherImage = newImage;
+ newImage = imageTemp;
+
+ newImage_width = newwidth;
+ newImage_height = newheight;
+ glTexImage2D(target, level, internalFormat, newImage_width,
+ newImage_height, 0, format, GL_UNSIGNED_SHORT,
+ (void *) newImage);
+ }
+ if (newwidth > 1) newwidth /= 2;
+ if (newheight > 1) newheight /= 2;
+ }
+ glPixelStorei(GL_UNPACK_ALIGNMENT, psm.unpack_alignment);
+ glPixelStorei(GL_UNPACK_SKIP_ROWS, psm.unpack_skip_rows);
+ glPixelStorei(GL_UNPACK_SKIP_PIXELS, psm.unpack_skip_pixels);
+ glPixelStorei(GL_UNPACK_ROW_LENGTH, psm.unpack_row_length);
+ glPixelStorei(GL_UNPACK_SWAP_BYTES, psm.unpack_swap_bytes);
+
+ free((GLbyte *) newImage);
+ if (otherImage) {
+ free((GLbyte *) otherImage);
+ }
+ return 0;
+}
+
+/* To make swapping images less error prone */
+#define __GLU_INIT_SWAP_IMAGE void *tmpImage
+#define __GLU_SWAP_IMAGE(a,b) tmpImage = a; a = b; b = tmpImage;
+
+static int gluBuild2DMipmapLevelsCore(GLenum target, GLint internalFormat,
+ GLsizei width, GLsizei height,
+ GLsizei widthPowerOf2,
+ GLsizei heightPowerOf2,
+ GLenum format, GLenum type,
+ GLint userLevel,
+ GLint baseLevel,GLint maxLevel,
+ const void *data)
+{
+ GLint newwidth, newheight;
+ GLint level, levels;
+ const void *usersImage; /* passed from user. Don't touch! */
+ void *srcImage, *dstImage; /* scratch area to build mipmapped images */
+ __GLU_INIT_SWAP_IMAGE;
+ GLint memreq;
+ GLint cmpts;
+
+ GLint myswap_bytes, groups_per_line, element_size, group_size;
+ GLint rowsize, padding;
+ PixelStorageModes psm;
+
+ assert(checkMipmapArgs(internalFormat,format,type) == 0);
+ assert(width >= 1 && height >= 1);
+
+ if(type == GL_BITMAP) {
+ return bitmapBuild2DMipmaps(target, internalFormat, width, height,
+ format, type, data);
+ }
+
+ srcImage = dstImage = NULL;
+
+ newwidth= widthPowerOf2;
+ newheight= heightPowerOf2;
+ levels = computeLog(newwidth);
+ level = computeLog(newheight);
+ if (level > levels) levels=level;
+
+ levels+= userLevel;
+
+ retrieveStoreModes(&psm);
+ myswap_bytes = psm.unpack_swap_bytes;
+ cmpts = elements_per_group(format,type);
+ if (psm.unpack_row_length > 0) {
+ groups_per_line = psm.unpack_row_length;
+ } else {
+ groups_per_line = width;
+ }
+
+ element_size = bytes_per_element(type);
+ group_size = element_size * cmpts;
+ if (element_size == 1) myswap_bytes = 0;
+
+ rowsize = groups_per_line * group_size;
+ padding = (rowsize % psm.unpack_alignment);
+ if (padding) {
+ rowsize += psm.unpack_alignment - padding;
+ }
+ usersImage = (const GLubyte *) data + psm.unpack_skip_rows * rowsize +
+ psm.unpack_skip_pixels * group_size;
+
+ glPixelStorei(GL_UNPACK_SKIP_ROWS, 0);
+ glPixelStorei(GL_UNPACK_SKIP_PIXELS, 0);
+ glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
+
+ level = userLevel;
+
+ /* already power-of-two square */
+ if (width == newwidth && height == newheight) {
+ /* Use usersImage for level userLevel */
+ if (baseLevel <= level && level <= maxLevel) {
+ glPixelStorei(GL_UNPACK_ROW_LENGTH, psm.unpack_row_length);
+ glTexImage2D(target, level, internalFormat, width,
+ height, 0, format, type,
+ usersImage);
+ }
+ glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
+ if(levels == 0) { /* we're done. clean up and return */
+ glPixelStorei(GL_UNPACK_ALIGNMENT, psm.unpack_alignment);
+ glPixelStorei(GL_UNPACK_SKIP_ROWS, psm.unpack_skip_rows);
+ glPixelStorei(GL_UNPACK_SKIP_PIXELS, psm.unpack_skip_pixels);
+ glPixelStorei(GL_UNPACK_ROW_LENGTH, psm.unpack_row_length);
+ glPixelStorei(GL_UNPACK_SWAP_BYTES, psm.unpack_swap_bytes);
+ return 0;
+ }
+ {
+ int nextWidth= newwidth/2;
+ int nextHeight= newheight/2;
+
+ /* clamp to 1 */
+ if (nextWidth < 1) nextWidth= 1;
+ if (nextHeight < 1) nextHeight= 1;
+ memreq = image_size(nextWidth, nextHeight, format, type);
+ }
+
+ switch(type) {
+ case GL_UNSIGNED_BYTE:
+ dstImage = (GLubyte *)malloc(memreq);
+ break;
+ case GL_BYTE:
+ dstImage = (GLbyte *)malloc(memreq);
+ break;
+ case GL_UNSIGNED_SHORT:
+ dstImage = (GLushort *)malloc(memreq);
+ break;
+ case GL_SHORT:
+ dstImage = (GLshort *)malloc(memreq);
+ break;
+ case GL_UNSIGNED_INT:
+ dstImage = (GLuint *)malloc(memreq);
+ break;
+ case GL_INT:
+ dstImage = (GLint *)malloc(memreq);
+ break;
+ case GL_FLOAT:
+ dstImage = (GLfloat *)malloc(memreq);
+ break;
+ case GL_UNSIGNED_BYTE_3_3_2:
+ case GL_UNSIGNED_BYTE_2_3_3_REV:
+ dstImage = (GLubyte *)malloc(memreq);
+ break;
+ case GL_UNSIGNED_SHORT_5_6_5:
+ case GL_UNSIGNED_SHORT_5_6_5_REV:
+ case GL_UNSIGNED_SHORT_4_4_4_4:
+ case GL_UNSIGNED_SHORT_4_4_4_4_REV:
+ case GL_UNSIGNED_SHORT_5_5_5_1:
+ case GL_UNSIGNED_SHORT_1_5_5_5_REV:
+ dstImage = (GLushort *)malloc(memreq);
+ break;
+ case GL_UNSIGNED_INT_8_8_8_8:
+ case GL_UNSIGNED_INT_8_8_8_8_REV:
+ case GL_UNSIGNED_INT_10_10_10_2:
+ case GL_UNSIGNED_INT_2_10_10_10_REV:
+ dstImage = (GLuint *)malloc(memreq);
+ break;
+ default:
+ return GLU_INVALID_ENUM;
+ }
+ if (dstImage == NULL) {
+ glPixelStorei(GL_UNPACK_ALIGNMENT, psm.unpack_alignment);
+ glPixelStorei(GL_UNPACK_SKIP_ROWS, psm.unpack_skip_rows);
+ glPixelStorei(GL_UNPACK_SKIP_PIXELS, psm.unpack_skip_pixels);
+ glPixelStorei(GL_UNPACK_ROW_LENGTH, psm.unpack_row_length);
+ glPixelStorei(GL_UNPACK_SWAP_BYTES, psm.unpack_swap_bytes);
+ return GLU_OUT_OF_MEMORY;
+ }
+ else
+ switch(type) {
+ case GL_UNSIGNED_BYTE:
+ halveImage_ubyte(cmpts, width, height,
+ (const GLubyte *)usersImage, (GLubyte *)dstImage,
+ element_size, rowsize, group_size);
+ break;
+ case GL_BYTE:
+ halveImage_byte(cmpts, width, height,
+ (const GLbyte *)usersImage, (GLbyte *)dstImage,
+ element_size, rowsize, group_size);
+ break;
+ case GL_UNSIGNED_SHORT:
+ halveImage_ushort(cmpts, width, height,
+ (const GLushort *)usersImage, (GLushort *)dstImage,
+ element_size, rowsize, group_size, myswap_bytes);
+ break;
+ case GL_SHORT:
+ halveImage_short(cmpts, width, height,
+ (const GLshort *)usersImage, (GLshort *)dstImage,
+ element_size, rowsize, group_size, myswap_bytes);
+ break;
+ case GL_UNSIGNED_INT:
+ halveImage_uint(cmpts, width, height,
+ (const GLuint *)usersImage, (GLuint *)dstImage,
+ element_size, rowsize, group_size, myswap_bytes);
+ break;
+ case GL_INT:
+ halveImage_int(cmpts, width, height,
+ (const GLint *)usersImage, (GLint *)dstImage,
+ element_size, rowsize, group_size, myswap_bytes);
+ break;
+ case GL_FLOAT:
+ halveImage_float(cmpts, width, height,
+ (const GLfloat *)usersImage, (GLfloat *)dstImage,
+ element_size, rowsize, group_size, myswap_bytes);
+ break;
+ case GL_UNSIGNED_BYTE_3_3_2:
+ assert(format == GL_RGB);
+ halveImagePackedPixel(3,extract332,shove332,
+ width,height,usersImage,dstImage,
+ element_size,rowsize,myswap_bytes);
+ break;
+ case GL_UNSIGNED_BYTE_2_3_3_REV:
+ assert(format == GL_RGB);
+ halveImagePackedPixel(3,extract233rev,shove233rev,
+ width,height,usersImage,dstImage,
+ element_size,rowsize,myswap_bytes);
+ break;
+ case GL_UNSIGNED_SHORT_5_6_5:
+ halveImagePackedPixel(3,extract565,shove565,
+ width,height,usersImage,dstImage,
+ element_size,rowsize,myswap_bytes);
+ break;
+ case GL_UNSIGNED_SHORT_5_6_5_REV:
+ halveImagePackedPixel(3,extract565rev,shove565rev,
+ width,height,usersImage,dstImage,
+ element_size,rowsize,myswap_bytes);
+ break;
+ case GL_UNSIGNED_SHORT_4_4_4_4:
+ halveImagePackedPixel(4,extract4444,shove4444,
+ width,height,usersImage,dstImage,
+ element_size,rowsize,myswap_bytes);
+ break;
+ case GL_UNSIGNED_SHORT_4_4_4_4_REV:
+ halveImagePackedPixel(4,extract4444rev,shove4444rev,
+ width,height,usersImage,dstImage,
+ element_size,rowsize,myswap_bytes);
+ break;
+ case GL_UNSIGNED_SHORT_5_5_5_1:
+ halveImagePackedPixel(4,extract5551,shove5551,
+ width,height,usersImage,dstImage,
+ element_size,rowsize,myswap_bytes);
+ break;
+ case GL_UNSIGNED_SHORT_1_5_5_5_REV:
+ halveImagePackedPixel(4,extract1555rev,shove1555rev,
+ width,height,usersImage,dstImage,
+ element_size,rowsize,myswap_bytes);
+ break;
+ case GL_UNSIGNED_INT_8_8_8_8:
+ halveImagePackedPixel(4,extract8888,shove8888,
+ width,height,usersImage,dstImage,
+ element_size,rowsize,myswap_bytes);
+ break;
+ case GL_UNSIGNED_INT_8_8_8_8_REV:
+ halveImagePackedPixel(4,extract8888rev,shove8888rev,
+ width,height,usersImage,dstImage,
+ element_size,rowsize,myswap_bytes);
+ break;
+ case GL_UNSIGNED_INT_10_10_10_2:
+ halveImagePackedPixel(4,extract1010102,shove1010102,
+ width,height,usersImage,dstImage,
+ element_size,rowsize,myswap_bytes);
+ break;
+ case GL_UNSIGNED_INT_2_10_10_10_REV:
+ halveImagePackedPixel(4,extract2101010rev,shove2101010rev,
+ width,height,usersImage,dstImage,
+ element_size,rowsize,myswap_bytes);
+ break;
+ default:
+ assert(0);
+ break;
+ }
+ newwidth = width/2;
+ newheight = height/2;
+ /* clamp to 1 */
+ if (newwidth < 1) newwidth= 1;
+ if (newheight < 1) newheight= 1;
+
+ myswap_bytes = 0;
+ rowsize = newwidth * group_size;
+ memreq = image_size(newwidth, newheight, format, type);
+ /* Swap srcImage and dstImage */
+ __GLU_SWAP_IMAGE(srcImage,dstImage);
+ switch(type) {
+ case GL_UNSIGNED_BYTE:
+ dstImage = (GLubyte *)malloc(memreq);
+ break;
+ case GL_BYTE:
+ dstImage = (GLbyte *)malloc(memreq);
+ break;
+ case GL_UNSIGNED_SHORT:
+ dstImage = (GLushort *)malloc(memreq);
+ break;
+ case GL_SHORT:
+ dstImage = (GLshort *)malloc(memreq);
+ break;
+ case GL_UNSIGNED_INT:
+ dstImage = (GLuint *)malloc(memreq);
+ break;
+ case GL_INT:
+ dstImage = (GLint *)malloc(memreq);
+ break;
+ case GL_FLOAT:
+ dstImage = (GLfloat *)malloc(memreq);
+ break;
+ case GL_UNSIGNED_BYTE_3_3_2:
+ case GL_UNSIGNED_BYTE_2_3_3_REV:
+ dstImage = (GLubyte *)malloc(memreq);
+ break;
+ case GL_UNSIGNED_SHORT_5_6_5:
+ case GL_UNSIGNED_SHORT_5_6_5_REV:
+ case GL_UNSIGNED_SHORT_4_4_4_4:
+ case GL_UNSIGNED_SHORT_4_4_4_4_REV:
+ case GL_UNSIGNED_SHORT_5_5_5_1:
+ case GL_UNSIGNED_SHORT_1_5_5_5_REV:
+ dstImage = (GLushort *)malloc(memreq);
+ break;
+ case GL_UNSIGNED_INT_8_8_8_8:
+ case GL_UNSIGNED_INT_8_8_8_8_REV:
+ case GL_UNSIGNED_INT_10_10_10_2:
+ case GL_UNSIGNED_INT_2_10_10_10_REV:
+ dstImage = (GLuint *)malloc(memreq);
+ break;
+ default:
+ return GLU_INVALID_ENUM;
+ }
+ if (dstImage == NULL) {
+ glPixelStorei(GL_UNPACK_ALIGNMENT, psm.unpack_alignment);
+ glPixelStorei(GL_UNPACK_SKIP_ROWS, psm.unpack_skip_rows);
+ glPixelStorei(GL_UNPACK_SKIP_PIXELS, psm.unpack_skip_pixels);
+ glPixelStorei(GL_UNPACK_ROW_LENGTH, psm.unpack_row_length);
+ glPixelStorei(GL_UNPACK_SWAP_BYTES, psm.unpack_swap_bytes);
+ free(srcImage);
+ return GLU_OUT_OF_MEMORY;
+ }
+ /* level userLevel+1 is in srcImage; level userLevel already saved */
+ level = userLevel+1;
+ } else { /* user's image is *not* nice power-of-2 sized square */
+ memreq = image_size(newwidth, newheight, format, type);
+ switch(type) {
+ case GL_UNSIGNED_BYTE:
+ dstImage = (GLubyte *)malloc(memreq);
+ break;
+ case GL_BYTE:
+ dstImage = (GLbyte *)malloc(memreq);
+ break;
+ case GL_UNSIGNED_SHORT:
+ dstImage = (GLushort *)malloc(memreq);
+ break;
+ case GL_SHORT:
+ dstImage = (GLshort *)malloc(memreq);
+ break;
+ case GL_UNSIGNED_INT:
+ dstImage = (GLuint *)malloc(memreq);
+ break;
+ case GL_INT:
+ dstImage = (GLint *)malloc(memreq);
+ break;
+ case GL_FLOAT:
+ dstImage = (GLfloat *)malloc(memreq);
+ break;
+ case GL_UNSIGNED_BYTE_3_3_2:
+ case GL_UNSIGNED_BYTE_2_3_3_REV:
+ dstImage = (GLubyte *)malloc(memreq);
+ break;
+ case GL_UNSIGNED_SHORT_5_6_5:
+ case GL_UNSIGNED_SHORT_5_6_5_REV:
+ case GL_UNSIGNED_SHORT_4_4_4_4:
+ case GL_UNSIGNED_SHORT_4_4_4_4_REV:
+ case GL_UNSIGNED_SHORT_5_5_5_1:
+ case GL_UNSIGNED_SHORT_1_5_5_5_REV:
+ dstImage = (GLushort *)malloc(memreq);
+ break;
+ case GL_UNSIGNED_INT_8_8_8_8:
+ case GL_UNSIGNED_INT_8_8_8_8_REV:
+ case GL_UNSIGNED_INT_10_10_10_2:
+ case GL_UNSIGNED_INT_2_10_10_10_REV:
+ dstImage = (GLuint *)malloc(memreq);
+ break;
+ default:
+ return GLU_INVALID_ENUM;
+ }
+
+ if (dstImage == NULL) {
+ glPixelStorei(GL_UNPACK_ALIGNMENT, psm.unpack_alignment);
+ glPixelStorei(GL_UNPACK_SKIP_ROWS, psm.unpack_skip_rows);
+ glPixelStorei(GL_UNPACK_SKIP_PIXELS, psm.unpack_skip_pixels);
+ glPixelStorei(GL_UNPACK_ROW_LENGTH, psm.unpack_row_length);
+ glPixelStorei(GL_UNPACK_SWAP_BYTES, psm.unpack_swap_bytes);
+ return GLU_OUT_OF_MEMORY;
+ }
+
+ switch(type) {
+ case GL_UNSIGNED_BYTE:
+ scale_internal_ubyte(cmpts, width, height,
+ (const GLubyte *)usersImage, newwidth, newheight,
+ (GLubyte *)dstImage, element_size,
+ rowsize, group_size);
+ break;
+ case GL_BYTE:
+ scale_internal_byte(cmpts, width, height,
+ (const GLbyte *)usersImage, newwidth, newheight,
+ (GLbyte *)dstImage, element_size,
+ rowsize, group_size);
+ break;
+ case GL_UNSIGNED_SHORT:
+ scale_internal_ushort(cmpts, width, height,
+ (const GLushort *)usersImage, newwidth, newheight,
+ (GLushort *)dstImage, element_size,
+ rowsize, group_size, myswap_bytes);
+ break;
+ case GL_SHORT:
+ scale_internal_short(cmpts, width, height,
+ (const GLshort *)usersImage, newwidth, newheight,
+ (GLshort *)dstImage, element_size,
+ rowsize, group_size, myswap_bytes);
+ break;
+ case GL_UNSIGNED_INT:
+ scale_internal_uint(cmpts, width, height,
+ (const GLuint *)usersImage, newwidth, newheight,
+ (GLuint *)dstImage, element_size,
+ rowsize, group_size, myswap_bytes);
+ break;
+ case GL_INT:
+ scale_internal_int(cmpts, width, height,
+ (const GLint *)usersImage, newwidth, newheight,
+ (GLint *)dstImage, element_size,
+ rowsize, group_size, myswap_bytes);
+ break;
+ case GL_FLOAT:
+ scale_internal_float(cmpts, width, height,
+ (const GLfloat *)usersImage, newwidth, newheight,
+ (GLfloat *)dstImage, element_size,
+ rowsize, group_size, myswap_bytes);
+ break;
+ case GL_UNSIGNED_BYTE_3_3_2:
+ scaleInternalPackedPixel(3,extract332,shove332,
+ width, height,usersImage,
+ newwidth,newheight,(void *)dstImage,
+ element_size,rowsize,myswap_bytes);
+ break;
+ case GL_UNSIGNED_BYTE_2_3_3_REV:
+ scaleInternalPackedPixel(3,extract233rev,shove233rev,
+ width, height,usersImage,
+ newwidth,newheight,(void *)dstImage,
+ element_size,rowsize,myswap_bytes);
+ break;
+ case GL_UNSIGNED_SHORT_5_6_5:
+ scaleInternalPackedPixel(3,extract565,shove565,
+ width, height,usersImage,
+ newwidth,newheight,(void *)dstImage,
+ element_size,rowsize,myswap_bytes);
+ break;
+ case GL_UNSIGNED_SHORT_5_6_5_REV:
+ scaleInternalPackedPixel(3,extract565rev,shove565rev,
+ width, height,usersImage,
+ newwidth,newheight,(void *)dstImage,
+ element_size,rowsize,myswap_bytes);
+ break;
+ case GL_UNSIGNED_SHORT_4_4_4_4:
+ scaleInternalPackedPixel(4,extract4444,shove4444,
+ width, height,usersImage,
+ newwidth,newheight,(void *)dstImage,
+ element_size,rowsize,myswap_bytes);
+ break;
+ case GL_UNSIGNED_SHORT_4_4_4_4_REV:
+ scaleInternalPackedPixel(4,extract4444rev,shove4444rev,
+ width, height,usersImage,
+ newwidth,newheight,(void *)dstImage,
+ element_size,rowsize,myswap_bytes);
+ break;
+ case GL_UNSIGNED_SHORT_5_5_5_1:
+ scaleInternalPackedPixel(4,extract5551,shove5551,
+ width, height,usersImage,
+ newwidth,newheight,(void *)dstImage,
+ element_size,rowsize,myswap_bytes);
+ break;
+ case GL_UNSIGNED_SHORT_1_5_5_5_REV:
+ scaleInternalPackedPixel(4,extract1555rev,shove1555rev,
+ width, height,usersImage,
+ newwidth,newheight,(void *)dstImage,
+ element_size,rowsize,myswap_bytes);
+ break;
+ case GL_UNSIGNED_INT_8_8_8_8:
+ scaleInternalPackedPixel(4,extract8888,shove8888,
+ width, height,usersImage,
+ newwidth,newheight,(void *)dstImage,
+ element_size,rowsize,myswap_bytes);
+ break;
+ case GL_UNSIGNED_INT_8_8_8_8_REV:
+ scaleInternalPackedPixel(4,extract8888rev,shove8888rev,
+ width, height,usersImage,
+ newwidth,newheight,(void *)dstImage,
+ element_size,rowsize,myswap_bytes);
+ break;
+ case GL_UNSIGNED_INT_10_10_10_2:
+ scaleInternalPackedPixel(4,extract1010102,shove1010102,
+ width, height,usersImage,
+ newwidth,newheight,(void *)dstImage,
+ element_size,rowsize,myswap_bytes);
+ break;
+ case GL_UNSIGNED_INT_2_10_10_10_REV:
+ scaleInternalPackedPixel(4,extract2101010rev,shove2101010rev,
+ width, height,usersImage,
+ newwidth,newheight,(void *)dstImage,
+ element_size,rowsize,myswap_bytes);
+ break;
+ default:
+ assert(0);
+ break;
+ }
+ myswap_bytes = 0;
+ rowsize = newwidth * group_size;
+ /* Swap dstImage and srcImage */
+ __GLU_SWAP_IMAGE(srcImage,dstImage);
+
+ if(levels != 0) { /* use as little memory as possible */
+ {
+ int nextWidth= newwidth/2;
+ int nextHeight= newheight/2;
+ if (nextWidth < 1) nextWidth= 1;
+ if (nextHeight < 1) nextHeight= 1;
+
+ memreq = image_size(nextWidth, nextHeight, format, type);
+ }
+
+ switch(type) {
+ case GL_UNSIGNED_BYTE:
+ dstImage = (GLubyte *)malloc(memreq);
+ break;
+ case GL_BYTE:
+ dstImage = (GLbyte *)malloc(memreq);
+ break;
+ case GL_UNSIGNED_SHORT:
+ dstImage = (GLushort *)malloc(memreq);
+ break;
+ case GL_SHORT:
+ dstImage = (GLshort *)malloc(memreq);
+ break;
+ case GL_UNSIGNED_INT:
+ dstImage = (GLuint *)malloc(memreq);
+ break;
+ case GL_INT:
+ dstImage = (GLint *)malloc(memreq);
+ break;
+ case GL_FLOAT:
+ dstImage = (GLfloat *)malloc(memreq);
+ break;
+ case GL_UNSIGNED_BYTE_3_3_2:
+ case GL_UNSIGNED_BYTE_2_3_3_REV:
+ dstImage = (GLubyte *)malloc(memreq);
+ break;
+ case GL_UNSIGNED_SHORT_5_6_5:
+ case GL_UNSIGNED_SHORT_5_6_5_REV:
+ case GL_UNSIGNED_SHORT_4_4_4_4:
+ case GL_UNSIGNED_SHORT_4_4_4_4_REV:
+ case GL_UNSIGNED_SHORT_5_5_5_1:
+ case GL_UNSIGNED_SHORT_1_5_5_5_REV:
+ dstImage = (GLushort *)malloc(memreq);
+ break;
+ case GL_UNSIGNED_INT_8_8_8_8:
+ case GL_UNSIGNED_INT_8_8_8_8_REV:
+ case GL_UNSIGNED_INT_10_10_10_2:
+ case GL_UNSIGNED_INT_2_10_10_10_REV:
+ dstImage = (GLuint *)malloc(memreq);
+ break;
+ default:
+ return GLU_INVALID_ENUM;
+ }
+ if (dstImage == NULL) {
+ glPixelStorei(GL_UNPACK_ALIGNMENT, psm.unpack_alignment);
+ glPixelStorei(GL_UNPACK_SKIP_ROWS, psm.unpack_skip_rows);
+ glPixelStorei(GL_UNPACK_SKIP_PIXELS, psm.unpack_skip_pixels);
+ glPixelStorei(GL_UNPACK_ROW_LENGTH, psm.unpack_row_length);
+ glPixelStorei(GL_UNPACK_SWAP_BYTES, psm.unpack_swap_bytes);
+ free(srcImage);
+ return GLU_OUT_OF_MEMORY;
+ }
+ }
+ /* level userLevel is in srcImage; nothing saved yet */
+ level = userLevel;
+ }
+
+ glPixelStorei(GL_UNPACK_SWAP_BYTES, GL_FALSE);
+ if (baseLevel <= level && level <= maxLevel) {
+ glTexImage2D(target, level, internalFormat, newwidth, newheight, 0,
+ format, type, (void *)srcImage);
+ }
+
+ level++; /* update current level for the loop */
+ for (; level <= levels; level++) {
+ switch(type) {
+ case GL_UNSIGNED_BYTE:
+ halveImage_ubyte(cmpts, newwidth, newheight,
+ (GLubyte *)srcImage, (GLubyte *)dstImage, element_size,
+ rowsize, group_size);
+ break;
+ case GL_BYTE:
+ halveImage_byte(cmpts, newwidth, newheight,
+ (GLbyte *)srcImage, (GLbyte *)dstImage, element_size,
+ rowsize, group_size);
+ break;
+ case GL_UNSIGNED_SHORT:
+ halveImage_ushort(cmpts, newwidth, newheight,
+ (GLushort *)srcImage, (GLushort *)dstImage, element_size,
+ rowsize, group_size, myswap_bytes);
+ break;
+ case GL_SHORT:
+ halveImage_short(cmpts, newwidth, newheight,
+ (GLshort *)srcImage, (GLshort *)dstImage, element_size,
+ rowsize, group_size, myswap_bytes);
+ break;
+ case GL_UNSIGNED_INT:
+ halveImage_uint(cmpts, newwidth, newheight,
+ (GLuint *)srcImage, (GLuint *)dstImage, element_size,
+ rowsize, group_size, myswap_bytes);
+ break;
+ case GL_INT:
+ halveImage_int(cmpts, newwidth, newheight,
+ (GLint *)srcImage, (GLint *)dstImage, element_size,
+ rowsize, group_size, myswap_bytes);
+ break;
+ case GL_FLOAT:
+ halveImage_float(cmpts, newwidth, newheight,
+ (GLfloat *)srcImage, (GLfloat *)dstImage, element_size,
+ rowsize, group_size, myswap_bytes);
+ break;
+ case GL_UNSIGNED_BYTE_3_3_2:
+ halveImagePackedPixel(3,extract332,shove332,
+ newwidth,newheight,
+ srcImage,dstImage,element_size,rowsize,
+ myswap_bytes);
+ break;
+ case GL_UNSIGNED_BYTE_2_3_3_REV:
+ halveImagePackedPixel(3,extract233rev,shove233rev,
+ newwidth,newheight,
+ srcImage,dstImage,element_size,rowsize,
+ myswap_bytes);
+ break;
+ case GL_UNSIGNED_SHORT_5_6_5:
+ halveImagePackedPixel(3,extract565,shove565,
+ newwidth,newheight,
+ srcImage,dstImage,element_size,rowsize,
+ myswap_bytes);
+ break;
+ case GL_UNSIGNED_SHORT_5_6_5_REV:
+ halveImagePackedPixel(3,extract565rev,shove565rev,
+ newwidth,newheight,
+ srcImage,dstImage,element_size,rowsize,
+ myswap_bytes);
+ break;
+ case GL_UNSIGNED_SHORT_4_4_4_4:
+ halveImagePackedPixel(4,extract4444,shove4444,
+ newwidth,newheight,
+ srcImage,dstImage,element_size,rowsize,
+ myswap_bytes);
+ break;
+ case GL_UNSIGNED_SHORT_4_4_4_4_REV:
+ halveImagePackedPixel(4,extract4444rev,shove4444rev,
+ newwidth,newheight,
+ srcImage,dstImage,element_size,rowsize,
+ myswap_bytes);
+ break;
+ case GL_UNSIGNED_SHORT_5_5_5_1:
+ halveImagePackedPixel(4,extract5551,shove5551,
+ newwidth,newheight,
+ srcImage,dstImage,element_size,rowsize,
+ myswap_bytes);
+ break;
+ case GL_UNSIGNED_SHORT_1_5_5_5_REV:
+ halveImagePackedPixel(4,extract1555rev,shove1555rev,
+ newwidth,newheight,
+ srcImage,dstImage,element_size,rowsize,
+ myswap_bytes);
+ break;
+ case GL_UNSIGNED_INT_8_8_8_8:
+ halveImagePackedPixel(4,extract8888,shove8888,
+ newwidth,newheight,
+ srcImage,dstImage,element_size,rowsize,
+ myswap_bytes);
+ break;
+ case GL_UNSIGNED_INT_8_8_8_8_REV:
+ halveImagePackedPixel(4,extract8888rev,shove8888rev,
+ newwidth,newheight,
+ srcImage,dstImage,element_size,rowsize,
+ myswap_bytes);
+ break;
+ case GL_UNSIGNED_INT_10_10_10_2:
+ halveImagePackedPixel(4,extract1010102,shove1010102,
+ newwidth,newheight,
+ srcImage,dstImage,element_size,rowsize,
+ myswap_bytes);
+ break;
+ case GL_UNSIGNED_INT_2_10_10_10_REV:
+ halveImagePackedPixel(4,extract2101010rev,shove2101010rev,
+ newwidth,newheight,
+ srcImage,dstImage,element_size,rowsize,
+ myswap_bytes);
+ break;
+ default:
+ assert(0);
+ break;
+ }
+
+ __GLU_SWAP_IMAGE(srcImage,dstImage);
+
+ if (newwidth > 1) { newwidth /= 2; rowsize /= 2;}
+ if (newheight > 1) newheight /= 2;
+ {
+ /* compute amount to pad per row, if any */
+ int rowPad= rowsize % psm.unpack_alignment;
+
+ /* should row be padded? */
+ if (rowPad == 0) { /* nope, row should not be padded */
+ /* call tex image with srcImage untouched since it's not padded */
+ if (baseLevel <= level && level <= maxLevel) {
+ glTexImage2D(target, level, internalFormat, newwidth, newheight, 0,
+ format, type, (void *) srcImage);
+ }
+ }
+ else { /* yes, row should be padded */
+ /* compute length of new row in bytes, including padding */
+ int newRowLength= rowsize + psm.unpack_alignment - rowPad;
+ int ii; unsigned char *dstTrav, *srcTrav; /* indices for copying */
+
+ /* allocate new image for mipmap of size newRowLength x newheight */
+ void *newMipmapImage= malloc((size_t) (newRowLength*newheight));
+ if (newMipmapImage == NULL) {
+ /* out of memory so return */
+ glPixelStorei(GL_UNPACK_ALIGNMENT, psm.unpack_alignment);
+ glPixelStorei(GL_UNPACK_SKIP_ROWS, psm.unpack_skip_rows);
+ glPixelStorei(GL_UNPACK_SKIP_PIXELS, psm.unpack_skip_pixels);
+ glPixelStorei(GL_UNPACK_ROW_LENGTH, psm.unpack_row_length);
+ glPixelStorei(GL_UNPACK_SWAP_BYTES, psm.unpack_swap_bytes);
+ return GLU_OUT_OF_MEMORY;
+ }
+
+ /* copy image from srcImage into newMipmapImage by rows */
+ for (ii= 0,
+ dstTrav= (unsigned char *) newMipmapImage,
+ srcTrav= (unsigned char *) srcImage;
+ ii< newheight;
+ ii++,
+ dstTrav+= newRowLength, /* make sure the correct distance... */
+ srcTrav+= rowsize) { /* ...is skipped */
+ memcpy(dstTrav,srcTrav,rowsize);
+ /* note that the pad bytes are not visited and will contain
+ * garbage, which is ok.
+ */
+ }
+
+ /* ...and use this new image for mipmapping instead */
+ if (baseLevel <= level && level <= maxLevel) {
+ glTexImage2D(target, level, internalFormat, newwidth, newheight, 0,
+ format, type, newMipmapImage);
+ }
+ free(newMipmapImage); /* don't forget to free it! */
+ } /* else */
+ }
+ } /* for level */
+ glPixelStorei(GL_UNPACK_ALIGNMENT, psm.unpack_alignment);
+ glPixelStorei(GL_UNPACK_SKIP_ROWS, psm.unpack_skip_rows);
+ glPixelStorei(GL_UNPACK_SKIP_PIXELS, psm.unpack_skip_pixels);
+ glPixelStorei(GL_UNPACK_ROW_LENGTH, psm.unpack_row_length);
+ glPixelStorei(GL_UNPACK_SWAP_BYTES, psm.unpack_swap_bytes);
+
+ free(srcImage); /*if you get to here, a srcImage has always been malloc'ed*/
+ if (dstImage) { /* if it's non-rectangular and only 1 level */
+ free(dstImage);
+ }
+ return 0;
+} /* gluBuild2DMipmapLevelsCore() */
+
+GLint GLAPIENTRY
+gluBuild2DMipmapLevels(GLenum target, GLint internalFormat,
+ GLsizei width, GLsizei height,
+ GLenum format, GLenum type,
+ GLint userLevel, GLint baseLevel, GLint maxLevel,
+ const void *data)
+{
+ int level, levels;
+
+ int rc= checkMipmapArgs(internalFormat,format,type);
+ if (rc != 0) return rc;
+
+ if (width < 1 || height < 1) {
+ return GLU_INVALID_VALUE;
+ }
+
+ levels = computeLog(width);
+ level = computeLog(height);
+ if (level > levels) levels=level;
+
+ levels+= userLevel;
+ if (!isLegalLevels(userLevel,baseLevel,maxLevel,levels))
+ return GLU_INVALID_VALUE;
+
+ return gluBuild2DMipmapLevelsCore(target, internalFormat,
+ width, height,
+ width, height,
+ format, type,
+ userLevel, baseLevel, maxLevel,
+ data);
+} /* gluBuild2DMipmapLevels() */
+
+GLint GLAPIENTRY
+gluBuild2DMipmaps(GLenum target, GLint internalFormat,
+ GLsizei width, GLsizei height,
+ GLenum format, GLenum type,
+ const void *data)
+{
+ GLint widthPowerOf2, heightPowerOf2;
+ int level, levels;
+
+ int rc= checkMipmapArgs(internalFormat,format,type);
+ if (rc != 0) return rc;
+
+ if (width < 1 || height < 1) {
+ return GLU_INVALID_VALUE;
+ }
+
+ closestFit(target,width,height,internalFormat,format,type,
+ &widthPowerOf2,&heightPowerOf2);
+
+ levels = computeLog(widthPowerOf2);
+ level = computeLog(heightPowerOf2);
+ if (level > levels) levels=level;
+
+ return gluBuild2DMipmapLevelsCore(target,internalFormat,
+ width, height,
+ widthPowerOf2,heightPowerOf2,
+ format,type,
+ 0,0,levels,data);
+} /* gluBuild2DMipmaps() */
+
+#if 0
+/*
+** This routine is for the limited case in which
+** type == GL_UNSIGNED_BYTE && format != index &&
+** unpack_alignment = 1 && unpack_swap_bytes == false
+**
+** so all of the work data can be kept as ubytes instead of shorts.
+*/
+static int fastBuild2DMipmaps(const PixelStorageModes *psm,
+ GLenum target, GLint components, GLint width,
+ GLint height, GLenum format,
+ GLenum type, void *data)
+{
+ GLint newwidth, newheight;
+ GLint level, levels;
+ GLubyte *newImage;
+ GLint newImage_width;
+ GLint newImage_height;
+ GLubyte *otherImage;
+ GLubyte *imageTemp;
+ GLint memreq;
+ GLint cmpts;
+
+
+#if 0
+ glGetIntegerv(GL_MAX_TEXTURE_SIZE, &maxsize);
+ newwidth = nearestPower(width);
+ if (newwidth > maxsize) newwidth = maxsize;
+ newheight = nearestPower(height);
+ if (newheight > maxsize) newheight = maxsize;
+#else
+ closestFit(target,width,height,components,format,type,
+ &newwidth,&newheight);
+#endif
+ levels = computeLog(newwidth);
+ level = computeLog(newheight);
+ if (level > levels) levels=level;
+
+ cmpts = elements_per_group(format,type);
+
+ otherImage = NULL;
+ /**
+ ** No need to copy the user data if its in the packed correctly.
+ ** Make sure that later routines don't change that data.
+ */
+ if (psm->unpack_skip_rows == 0 && psm->unpack_skip_pixels == 0) {
+ newImage = (GLubyte *)data;
+ newImage_width = width;
+ newImage_height = height;
+ } else {
+ GLint rowsize;
+ GLint groups_per_line;
+ GLint elements_per_line;
+ const GLubyte *start;
+ const GLubyte *iter;
+ GLubyte *iter2;
+ GLint i, j;
+
+ newImage = (GLubyte *)
+ malloc(image_size(width, height, format, GL_UNSIGNED_BYTE));
+ newImage_width = width;
+ newImage_height = height;
+ if (newImage == NULL) {
+ return GLU_OUT_OF_MEMORY;
+ }
+
+ /*
+ ** Abbreviated version of fill_image for this restricted case.
+ */
+ if (psm->unpack_row_length > 0) {
+ groups_per_line = psm->unpack_row_length;
+ } else {
+ groups_per_line = width;
+ }
+ rowsize = groups_per_line * cmpts;
+ elements_per_line = width * cmpts;
+ start = (const GLubyte *) data + psm->unpack_skip_rows * rowsize +
+ psm->unpack_skip_pixels * cmpts;
+ iter2 = newImage;
+
+ for (i = 0; i < height; i++) {
+ iter = start;
+ for (j = 0; j < elements_per_line; j++) {
+ *iter2 = *iter;
+ iter++;
+ iter2++;
+ }
+ start += rowsize;
+ }
+ }
+
+
+ glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
+ glPixelStorei(GL_UNPACK_SKIP_ROWS, 0);
+ glPixelStorei(GL_UNPACK_SKIP_PIXELS, 0);
+ glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
+ glPixelStorei(GL_UNPACK_SWAP_BYTES, GL_FALSE);
+
+ for (level = 0; level <= levels; level++) {
+ if (newImage_width == newwidth && newImage_height == newheight) {
+ /* Use newImage for this level */
+ glTexImage2D(target, level, components, newImage_width,
+ newImage_height, 0, format, GL_UNSIGNED_BYTE,
+ (void *) newImage);
+ } else {
+ if (otherImage == NULL) {
+ memreq =
+ image_size(newwidth, newheight, format, GL_UNSIGNED_BYTE);
+ otherImage = (GLubyte *) malloc(memreq);
+ if (otherImage == NULL) {
+ glPixelStorei(GL_UNPACK_ALIGNMENT, psm->unpack_alignment);
+ glPixelStorei(GL_UNPACK_SKIP_ROWS, psm->unpack_skip_rows);
+ glPixelStorei(GL_UNPACK_SKIP_PIXELS, psm->unpack_skip_pixels);
+ glPixelStorei(GL_UNPACK_ROW_LENGTH,psm->unpack_row_length);
+ glPixelStorei(GL_UNPACK_SWAP_BYTES,psm->unpack_swap_bytes);
+ return GLU_OUT_OF_MEMORY;
+ }
+ }
+/*
+ scale_internal_ubyte(cmpts, newImage_width, newImage_height,
+ newImage, newwidth, newheight, otherImage);
+*/
+ /* Swap newImage and otherImage */
+ imageTemp = otherImage;
+ otherImage = newImage;
+ newImage = imageTemp;
+
+ newImage_width = newwidth;
+ newImage_height = newheight;
+ glTexImage2D(target, level, components, newImage_width,
+ newImage_height, 0, format, GL_UNSIGNED_BYTE,
+ (void *) newImage);
+ }
+ if (newwidth > 1) newwidth /= 2;
+ if (newheight > 1) newheight /= 2;
+ }
+ glPixelStorei(GL_UNPACK_ALIGNMENT, psm->unpack_alignment);
+ glPixelStorei(GL_UNPACK_SKIP_ROWS, psm->unpack_skip_rows);
+ glPixelStorei(GL_UNPACK_SKIP_PIXELS, psm->unpack_skip_pixels);
+ glPixelStorei(GL_UNPACK_ROW_LENGTH, psm->unpack_row_length);
+ glPixelStorei(GL_UNPACK_SWAP_BYTES, psm->unpack_swap_bytes);
+
+ if (newImage != (const GLubyte *)data) {
+ free((GLbyte *) newImage);
+ }
+ if (otherImage && otherImage != (const GLubyte *)data) {
+ free((GLbyte *) otherImage);
+ }
+ return 0;
+}
+#endif
+
+/*
+ * Utility Routines
+ */
+static GLint elements_per_group(GLenum format, GLenum type)
+{
+ /*
+ * Return the number of elements per group of a specified format
+ */
+
+ /* If the type is packedpixels then answer is 1 (ignore format) */
+ if (type == GL_UNSIGNED_BYTE_3_3_2 ||
+ type == GL_UNSIGNED_BYTE_2_3_3_REV ||
+ type == GL_UNSIGNED_SHORT_5_6_5 ||
+ type == GL_UNSIGNED_SHORT_5_6_5_REV ||
+ type == GL_UNSIGNED_SHORT_4_4_4_4 ||
+ type == GL_UNSIGNED_SHORT_4_4_4_4_REV ||
+ type == GL_UNSIGNED_SHORT_5_5_5_1 ||
+ type == GL_UNSIGNED_SHORT_1_5_5_5_REV ||
+ type == GL_UNSIGNED_INT_8_8_8_8 ||
+ type == GL_UNSIGNED_INT_8_8_8_8_REV ||
+ type == GL_UNSIGNED_INT_10_10_10_2 ||
+ type == GL_UNSIGNED_INT_2_10_10_10_REV) {
+ return 1;
+ }
+
+ /* Types are not packed pixels, so get elements per group */
+ switch(format) {
+ case GL_RGB:
+ case GL_BGR:
+ return 3;
+ case GL_LUMINANCE_ALPHA:
+ return 2;
+ case GL_RGBA:
+ case GL_BGRA:
+ return 4;
+ default:
+ return 1;
+ }
+}
+
+static GLfloat bytes_per_element(GLenum type)
+{
+ /*
+ * Return the number of bytes per element, based on the element type
+ */
+ switch(type) {
+ case GL_BITMAP:
+ return 1.0 / 8.0;
+ case GL_UNSIGNED_SHORT:
+ return(sizeof(GLushort));
+ case GL_SHORT:
+ return(sizeof(GLshort));
+ case GL_UNSIGNED_BYTE:
+ return(sizeof(GLubyte));
+ case GL_BYTE:
+ return(sizeof(GLbyte));
+ case GL_INT:
+ return(sizeof(GLint));
+ case GL_UNSIGNED_INT:
+ return(sizeof(GLuint));
+ case GL_FLOAT:
+ return(sizeof(GLfloat));
+ case GL_UNSIGNED_BYTE_3_3_2:
+ case GL_UNSIGNED_BYTE_2_3_3_REV:
+ return(sizeof(GLubyte));
+ case GL_UNSIGNED_SHORT_5_6_5:
+ case GL_UNSIGNED_SHORT_5_6_5_REV:
+ case GL_UNSIGNED_SHORT_4_4_4_4:
+ case GL_UNSIGNED_SHORT_4_4_4_4_REV:
+ case GL_UNSIGNED_SHORT_5_5_5_1:
+ case GL_UNSIGNED_SHORT_1_5_5_5_REV:
+ return(sizeof(GLushort));
+ case GL_UNSIGNED_INT_8_8_8_8:
+ case GL_UNSIGNED_INT_8_8_8_8_REV:
+ case GL_UNSIGNED_INT_10_10_10_2:
+ case GL_UNSIGNED_INT_2_10_10_10_REV:
+ return(sizeof(GLuint));
+ default:
+ return 4;
+ }
+}
+
+static GLint is_index(GLenum format)
+{
+ return format == GL_COLOR_INDEX || format == GL_STENCIL_INDEX;
+}
+
+/*
+** Compute memory required for internal packed array of data of given type
+** and format.
+*/
+static GLint image_size(GLint width, GLint height, GLenum format, GLenum type)
+{
+ int bytes_per_row;
+ int components;
+
+assert(width > 0);
+assert(height > 0);
+ components = elements_per_group(format,type);
+ if (type == GL_BITMAP) {
+ bytes_per_row = (width + 7) / 8;
+ } else {
+ bytes_per_row = bytes_per_element(type) * width;
+ }
+ return bytes_per_row * height * components;
+}
+
+/*
+** Extract array from user's data applying all pixel store modes.
+** The internal format used is an array of unsigned shorts.
+*/
+static void fill_image(const PixelStorageModes *psm,
+ GLint width, GLint height, GLenum format,
+ GLenum type, GLboolean index_format,
+ const void *userdata, GLushort *newimage)
+{
+ GLint components;
+ GLint element_size;
+ GLint rowsize;
+ GLint padding;
+ GLint groups_per_line;
+ GLint group_size;
+ GLint elements_per_line;
+ const GLubyte *start;
+ const GLubyte *iter;
+ GLushort *iter2;
+ GLint i, j, k;
+ GLint myswap_bytes;
+
+ myswap_bytes = psm->unpack_swap_bytes;
+ components = elements_per_group(format,type);
+ if (psm->unpack_row_length > 0) {
+ groups_per_line = psm->unpack_row_length;
+ } else {
+ groups_per_line = width;
+ }
+
+ /* All formats except GL_BITMAP fall out trivially */
+ if (type == GL_BITMAP) {
+ GLint bit_offset;
+ GLint current_bit;
+
+ rowsize = (groups_per_line * components + 7) / 8;
+ padding = (rowsize % psm->unpack_alignment);
+ if (padding) {
+ rowsize += psm->unpack_alignment - padding;
+ }
+ start = (const GLubyte *) userdata + psm->unpack_skip_rows * rowsize +
+ (psm->unpack_skip_pixels * components / 8);
+ elements_per_line = width * components;
+ iter2 = newimage;
+ for (i = 0; i < height; i++) {
+ iter = start;
+ bit_offset = (psm->unpack_skip_pixels * components) % 8;
+ for (j = 0; j < elements_per_line; j++) {
+ /* Retrieve bit */
+ if (psm->unpack_lsb_first) {
+ current_bit = iter[0] & (1 << bit_offset);
+ } else {
+ current_bit = iter[0] & (1 << (7 - bit_offset));
+ }
+ if (current_bit) {
+ if (index_format) {
+ *iter2 = 1;
+ } else {
+ *iter2 = 65535;
+ }
+ } else {
+ *iter2 = 0;
+ }
+ bit_offset++;
+ if (bit_offset == 8) {
+ bit_offset = 0;
+ iter++;
+ }
+ iter2++;
+ }
+ start += rowsize;
+ }
+ } else {
+ element_size = bytes_per_element(type);
+ group_size = element_size * components;
+ if (element_size == 1) myswap_bytes = 0;
+
+ rowsize = groups_per_line * group_size;
+ padding = (rowsize % psm->unpack_alignment);
+ if (padding) {
+ rowsize += psm->unpack_alignment - padding;
+ }
+ start = (const GLubyte *) userdata + psm->unpack_skip_rows * rowsize +
+ psm->unpack_skip_pixels * group_size;
+ elements_per_line = width * components;
+
+ iter2 = newimage;
+ for (i = 0; i < height; i++) {
+ iter = start;
+ for (j = 0; j < elements_per_line; j++) {
+ Type_Widget widget;
+ float extractComponents[4];
+
+ switch(type) {
+ case GL_UNSIGNED_BYTE_3_3_2:
+ extract332(0,iter,extractComponents);
+ for (k = 0; k < 3; k++) {
+ *iter2++ = (GLushort)(extractComponents[k]*65535);
+ }
+ break;
+ case GL_UNSIGNED_BYTE_2_3_3_REV:
+ extract233rev(0,iter,extractComponents);
+ for (k = 0; k < 3; k++) {
+ *iter2++ = (GLushort)(extractComponents[k]*65535);
+ }
+ break;
+ case GL_UNSIGNED_BYTE:
+ if (index_format) {
+ *iter2++ = *iter;
+ } else {
+ *iter2++ = (*iter) * 257;
+ }
+ break;
+ case GL_BYTE:
+ if (index_format) {
+ *iter2++ = *((const GLbyte *) iter);
+ } else {
+ /* rough approx */
+ *iter2++ = (*((const GLbyte *) iter)) * 516;
+ }
+ break;
+ case GL_UNSIGNED_SHORT_5_6_5:
+ extract565(myswap_bytes,iter,extractComponents);
+ for (k = 0; k < 3; k++) {
+ *iter2++ = (GLushort)(extractComponents[k]*65535);
+ }
+ break;
+ case GL_UNSIGNED_SHORT_5_6_5_REV:
+ extract565rev(myswap_bytes,iter,extractComponents);
+ for (k = 0; k < 3; k++) {
+ *iter2++ = (GLushort)(extractComponents[k]*65535);
+ }
+ break;
+ case GL_UNSIGNED_SHORT_4_4_4_4:
+ extract4444(myswap_bytes,iter,extractComponents);
+ for (k = 0; k < 4; k++) {
+ *iter2++ = (GLushort)(extractComponents[k]*65535);
+ }
+ break;
+ case GL_UNSIGNED_SHORT_4_4_4_4_REV:
+ extract4444rev(myswap_bytes,iter,extractComponents);
+ for (k = 0; k < 4; k++) {
+ *iter2++ = (GLushort)(extractComponents[k]*65535);
+ }
+ break;
+ case GL_UNSIGNED_SHORT_5_5_5_1:
+ extract5551(myswap_bytes,iter,extractComponents);
+ for (k = 0; k < 4; k++) {
+ *iter2++ = (GLushort)(extractComponents[k]*65535);
+ }
+ break;
+ case GL_UNSIGNED_SHORT_1_5_5_5_REV:
+ extract1555rev(myswap_bytes,iter,extractComponents);
+ for (k = 0; k < 4; k++) {
+ *iter2++ = (GLushort)(extractComponents[k]*65535);
+ }
+ break;
+ case GL_UNSIGNED_SHORT:
+ case GL_SHORT:
+ if (myswap_bytes) {
+ widget.ub[0] = iter[1];
+ widget.ub[1] = iter[0];
+ } else {
+ widget.ub[0] = iter[0];
+ widget.ub[1] = iter[1];
+ }
+ if (type == GL_SHORT) {
+ if (index_format) {
+ *iter2++ = widget.s[0];
+ } else {
+ /* rough approx */
+ *iter2++ = widget.s[0]*2;
+ }
+ } else {
+ *iter2++ = widget.us[0];
+ }
+ break;
+ case GL_UNSIGNED_INT_8_8_8_8:
+ extract8888(myswap_bytes,iter,extractComponents);
+ for (k = 0; k < 4; k++) {
+ *iter2++ = (GLushort)(extractComponents[k]*65535);
+ }
+ break;
+ case GL_UNSIGNED_INT_8_8_8_8_REV:
+ extract8888rev(myswap_bytes,iter,extractComponents);
+ for (k = 0; k < 4; k++) {
+ *iter2++ = (GLushort)(extractComponents[k]*65535);
+ }
+ break;
+ case GL_UNSIGNED_INT_10_10_10_2:
+ extract1010102(myswap_bytes,iter,extractComponents);
+ for (k = 0; k < 4; k++) {
+ *iter2++ = (GLushort)(extractComponents[k]*65535);
+ }
+ break;
+ case GL_UNSIGNED_INT_2_10_10_10_REV:
+ extract2101010rev(myswap_bytes,iter,extractComponents);
+ for (k = 0; k < 4; k++) {
+ *iter2++ = (GLushort)(extractComponents[k]*65535);
+ }
+ break;
+ case GL_INT:
+ case GL_UNSIGNED_INT:
+ case GL_FLOAT:
+ if (myswap_bytes) {
+ widget.ub[0] = iter[3];
+ widget.ub[1] = iter[2];
+ widget.ub[2] = iter[1];
+ widget.ub[3] = iter[0];
+ } else {
+ widget.ub[0] = iter[0];
+ widget.ub[1] = iter[1];
+ widget.ub[2] = iter[2];
+ widget.ub[3] = iter[3];
+ }
+ if (type == GL_FLOAT) {
+ if (index_format) {
+ *iter2++ = widget.f;
+ } else {
+ *iter2++ = 65535 * widget.f;
+ }
+ } else if (type == GL_UNSIGNED_INT) {
+ if (index_format) {
+ *iter2++ = widget.ui;
+ } else {
+ *iter2++ = widget.ui >> 16;
+ }
+ } else {
+ if (index_format) {
+ *iter2++ = widget.i;
+ } else {
+ *iter2++ = widget.i >> 15;
+ }
+ }
+ break;
+ }
+ iter += element_size;
+ } /* for j */
+ start += rowsize;
+#if 1
+ /* want 'iter' pointing at start, not within, row for assertion
+ * purposes
+ */
+ iter= start;
+#endif
+ } /* for i */
+
+ /* iterators should be one byte past end */
+ if (!isTypePackedPixel(type)) {
+ assert(iter2 == &newimage[width*height*components]);
+ }
+ else {
+ assert(iter2 == &newimage[width*height*
+ elements_per_group(format,0)]);
+ }
+ assert( iter == &((const GLubyte *)userdata)[rowsize*height +
+ psm->unpack_skip_rows * rowsize +
+ psm->unpack_skip_pixels * group_size] );
+
+ } /* else */
+} /* fill_image() */
+
+/*
+** Insert array into user's data applying all pixel store modes.
+** The internal format is an array of unsigned shorts.
+** empty_image() because it is the opposite of fill_image().
+*/
+static void empty_image(const PixelStorageModes *psm,
+ GLint width, GLint height, GLenum format,
+ GLenum type, GLboolean index_format,
+ const GLushort *oldimage, void *userdata)
+{
+ GLint components;
+ GLint element_size;
+ GLint rowsize;
+ GLint padding;
+ GLint groups_per_line;
+ GLint group_size;
+ GLint elements_per_line;
+ GLubyte *start;
+ GLubyte *iter;
+ const GLushort *iter2;
+ GLint i, j, k;
+ GLint myswap_bytes;
+
+ myswap_bytes = psm->pack_swap_bytes;
+ components = elements_per_group(format,type);
+ if (psm->pack_row_length > 0) {
+ groups_per_line = psm->pack_row_length;
+ } else {
+ groups_per_line = width;
+ }
+
+ /* All formats except GL_BITMAP fall out trivially */
+ if (type == GL_BITMAP) {
+ GLint bit_offset;
+ GLint current_bit;
+
+ rowsize = (groups_per_line * components + 7) / 8;
+ padding = (rowsize % psm->pack_alignment);
+ if (padding) {
+ rowsize += psm->pack_alignment - padding;
+ }
+ start = (GLubyte *) userdata + psm->pack_skip_rows * rowsize +
+ (psm->pack_skip_pixels * components / 8);
+ elements_per_line = width * components;
+ iter2 = oldimage;
+ for (i = 0; i < height; i++) {
+ iter = start;
+ bit_offset = (psm->pack_skip_pixels * components) % 8;
+ for (j = 0; j < elements_per_line; j++) {
+ if (index_format) {
+ current_bit = iter2[0] & 1;
+ } else {
+ if (iter2[0] > 32767) {
+ current_bit = 1;
+ } else {
+ current_bit = 0;
+ }
+ }
+
+ if (current_bit) {
+ if (psm->pack_lsb_first) {
+ *iter |= (1 << bit_offset);
+ } else {
+ *iter |= (1 << (7 - bit_offset));
+ }
+ } else {
+ if (psm->pack_lsb_first) {
+ *iter &= ~(1 << bit_offset);
+ } else {
+ *iter &= ~(1 << (7 - bit_offset));
+ }
+ }
+
+ bit_offset++;
+ if (bit_offset == 8) {
+ bit_offset = 0;
+ iter++;
+ }
+ iter2++;
+ }
+ start += rowsize;
+ }
+ } else {
+ float shoveComponents[4];
+
+ element_size = bytes_per_element(type);
+ group_size = element_size * components;
+ if (element_size == 1) myswap_bytes = 0;
+
+ rowsize = groups_per_line * group_size;
+ padding = (rowsize % psm->pack_alignment);
+ if (padding) {
+ rowsize += psm->pack_alignment - padding;
+ }
+ start = (GLubyte *) userdata + psm->pack_skip_rows * rowsize +
+ psm->pack_skip_pixels * group_size;
+ elements_per_line = width * components;
+
+ iter2 = oldimage;
+ for (i = 0; i < height; i++) {
+ iter = start;
+ for (j = 0; j < elements_per_line; j++) {
+ Type_Widget widget;
+
+ switch(type) {
+ case GL_UNSIGNED_BYTE_3_3_2:
+ for (k = 0; k < 3; k++) {
+ shoveComponents[k]= *iter2++ / 65535.0;
+ }
+ shove332(shoveComponents,0,(void *)iter);
+ break;
+ case GL_UNSIGNED_BYTE_2_3_3_REV:
+ for (k = 0; k < 3; k++) {
+ shoveComponents[k]= *iter2++ / 65535.0;
+ }
+ shove233rev(shoveComponents,0,(void *)iter);
+ break;
+ case GL_UNSIGNED_BYTE:
+ if (index_format) {
+ *iter = *iter2++;
+ } else {
+ *iter = *iter2++ >> 8;
+ }
+ break;
+ case GL_BYTE:
+ if (index_format) {
+ *((GLbyte *) iter) = *iter2++;
+ } else {
+ *((GLbyte *) iter) = *iter2++ >> 9;
+ }
+ break;
+ case GL_UNSIGNED_SHORT_5_6_5:
+ for (k = 0; k < 3; k++) {
+ shoveComponents[k]= *iter2++ / 65535.0;
+ }
+ shove565(shoveComponents,0,(void *)&widget.us[0]);
+ if (myswap_bytes) {
+ iter[0] = widget.ub[1];
+ iter[1] = widget.ub[0];
+ }
+ else {
+ *(GLushort *)iter = widget.us[0];
+ }
+ break;
+ case GL_UNSIGNED_SHORT_5_6_5_REV:
+ for (k = 0; k < 3; k++) {
+ shoveComponents[k]= *iter2++ / 65535.0;
+ }
+ shove565rev(shoveComponents,0,(void *)&widget.us[0]);
+ if (myswap_bytes) {
+ iter[0] = widget.ub[1];
+ iter[1] = widget.ub[0];
+ }
+ else {
+ *(GLushort *)iter = widget.us[0];
+ }
+ break;
+ case GL_UNSIGNED_SHORT_4_4_4_4:
+ for (k = 0; k < 4; k++) {
+ shoveComponents[k]= *iter2++ / 65535.0;
+ }
+ shove4444(shoveComponents,0,(void *)&widget.us[0]);
+ if (myswap_bytes) {
+ iter[0] = widget.ub[1];
+ iter[1] = widget.ub[0];
+ } else {
+ *(GLushort *)iter = widget.us[0];
+ }
+ break;
+ case GL_UNSIGNED_SHORT_4_4_4_4_REV:
+ for (k = 0; k < 4; k++) {
+ shoveComponents[k]= *iter2++ / 65535.0;
+ }
+ shove4444rev(shoveComponents,0,(void *)&widget.us[0]);
+ if (myswap_bytes) {
+ iter[0] = widget.ub[1];
+ iter[1] = widget.ub[0];
+ } else {
+ *(GLushort *)iter = widget.us[0];
+ }
+ break;
+ case GL_UNSIGNED_SHORT_5_5_5_1:
+ for (k = 0; k < 4; k++) {
+ shoveComponents[k]= *iter2++ / 65535.0;
+ }
+ shove5551(shoveComponents,0,(void *)&widget.us[0]);
+ if (myswap_bytes) {
+ iter[0] = widget.ub[1];
+ iter[1] = widget.ub[0];
+ } else {
+ *(GLushort *)iter = widget.us[0];
+ }
+ break;
+ case GL_UNSIGNED_SHORT_1_5_5_5_REV:
+ for (k = 0; k < 4; k++) {
+ shoveComponents[k]= *iter2++ / 65535.0;
+ }
+ shove1555rev(shoveComponents,0,(void *)&widget.us[0]);
+ if (myswap_bytes) {
+ iter[0] = widget.ub[1];
+ iter[1] = widget.ub[0];
+ } else {
+ *(GLushort *)iter = widget.us[0];
+ }
+ break;
+ case GL_UNSIGNED_SHORT:
+ case GL_SHORT:
+ if (type == GL_SHORT) {
+ if (index_format) {
+ widget.s[0] = *iter2++;
+ } else {
+ widget.s[0] = *iter2++ >> 1;
+ }
+ } else {
+ widget.us[0] = *iter2++;
+ }
+ if (myswap_bytes) {
+ iter[0] = widget.ub[1];
+ iter[1] = widget.ub[0];
+ } else {
+ iter[0] = widget.ub[0];
+ iter[1] = widget.ub[1];
+ }
+ break;
+ case GL_UNSIGNED_INT_8_8_8_8:
+ for (k = 0; k < 4; k++) {
+ shoveComponents[k]= *iter2++ / 65535.0;
+ }
+ shove8888(shoveComponents,0,(void *)&widget.ui);
+ if (myswap_bytes) {
+ iter[3] = widget.ub[0];
+ iter[2] = widget.ub[1];
+ iter[1] = widget.ub[2];
+ iter[0] = widget.ub[3];
+ } else {
+ *(GLuint *)iter= widget.ui;
+ }
+
+ break;
+ case GL_UNSIGNED_INT_8_8_8_8_REV:
+ for (k = 0; k < 4; k++) {
+ shoveComponents[k]= *iter2++ / 65535.0;
+ }
+ shove8888rev(shoveComponents,0,(void *)&widget.ui);
+ if (myswap_bytes) {
+ iter[3] = widget.ub[0];
+ iter[2] = widget.ub[1];
+ iter[1] = widget.ub[2];
+ iter[0] = widget.ub[3];
+ } else {
+ *(GLuint *)iter= widget.ui;
+ }
+ break;
+ case GL_UNSIGNED_INT_10_10_10_2:
+ for (k = 0; k < 4; k++) {
+ shoveComponents[k]= *iter2++ / 65535.0;
+ }
+ shove1010102(shoveComponents,0,(void *)&widget.ui);
+ if (myswap_bytes) {
+ iter[3] = widget.ub[0];
+ iter[2] = widget.ub[1];
+ iter[1] = widget.ub[2];
+ iter[0] = widget.ub[3];
+ } else {
+ *(GLuint *)iter= widget.ui;
+ }
+ break;
+ case GL_UNSIGNED_INT_2_10_10_10_REV:
+ for (k = 0; k < 4; k++) {
+ shoveComponents[k]= *iter2++ / 65535.0;
+ }
+ shove2101010rev(shoveComponents,0,(void *)&widget.ui);
+ if (myswap_bytes) {
+ iter[3] = widget.ub[0];
+ iter[2] = widget.ub[1];
+ iter[1] = widget.ub[2];
+ iter[0] = widget.ub[3];
+ } else {
+ *(GLuint *)iter= widget.ui;
+ }
+ break;
+ case GL_INT:
+ case GL_UNSIGNED_INT:
+ case GL_FLOAT:
+ if (type == GL_FLOAT) {
+ if (index_format) {
+ widget.f = *iter2++;
+ } else {
+ widget.f = *iter2++ / (float) 65535.0;
+ }
+ } else if (type == GL_UNSIGNED_INT) {
+ if (index_format) {
+ widget.ui = *iter2++;
+ } else {
+ widget.ui = (unsigned int) *iter2++ * 65537;
+ }
+ } else {
+ if (index_format) {
+ widget.i = *iter2++;
+ } else {
+ widget.i = ((unsigned int) *iter2++ * 65537)/2;
+ }
+ }
+ if (myswap_bytes) {
+ iter[3] = widget.ub[0];
+ iter[2] = widget.ub[1];
+ iter[1] = widget.ub[2];
+ iter[0] = widget.ub[3];
+ } else {
+ iter[0] = widget.ub[0];
+ iter[1] = widget.ub[1];
+ iter[2] = widget.ub[2];
+ iter[3] = widget.ub[3];
+ }
+ break;
+ }
+ iter += element_size;
+ } /* for j */
+ start += rowsize;
+#if 1
+ /* want 'iter' pointing at start, not within, row for assertion
+ * purposes
+ */
+ iter= start;
+#endif
+ } /* for i */
+
+ /* iterators should be one byte past end */
+ if (!isTypePackedPixel(type)) {
+ assert(iter2 == &oldimage[width*height*components]);
+ }
+ else {
+ assert(iter2 == &oldimage[width*height*
+ elements_per_group(format,0)]);
+ }
+ assert( iter == &((GLubyte *)userdata)[rowsize*height +
+ psm->pack_skip_rows * rowsize +
+ psm->pack_skip_pixels * group_size] );
+
+ } /* else */
+} /* empty_image() */
+
+/*--------------------------------------------------------------------------
+ * Decimation of packed pixel types
+ *--------------------------------------------------------------------------
+ */
+static void extract332(int isSwap,
+ const void *packedPixel, GLfloat extractComponents[])
+{
+ GLubyte ubyte= *(const GLubyte *)packedPixel;
+
+ isSwap= isSwap; /* turn off warnings */
+
+ /* 11100000 == 0xe0 */
+ /* 00011100 == 0x1c */
+ /* 00000011 == 0x03 */
+
+ extractComponents[0]= (float)((ubyte & 0xe0) >> 5) / 7.0;
+ extractComponents[1]= (float)((ubyte & 0x1c) >> 2) / 7.0; /* 7 = 2^3-1 */
+ extractComponents[2]= (float)((ubyte & 0x03) ) / 3.0; /* 3 = 2^2-1 */
+} /* extract332() */
+
+static void shove332(const GLfloat shoveComponents[],
+ int index, void *packedPixel)
+{
+ /* 11100000 == 0xe0 */
+ /* 00011100 == 0x1c */
+ /* 00000011 == 0x03 */
+
+ assert(0.0 <= shoveComponents[0] && shoveComponents[0] <= 1.0);
+ assert(0.0 <= shoveComponents[1] && shoveComponents[1] <= 1.0);
+ assert(0.0 <= shoveComponents[2] && shoveComponents[2] <= 1.0);
+
+ /* due to limited precision, need to round before shoving */
+ ((GLubyte *)packedPixel)[index] =
+ ((GLubyte)((shoveComponents[0] * 7)+0.5) << 5) & 0xe0;
+ ((GLubyte *)packedPixel)[index] |=
+ ((GLubyte)((shoveComponents[1] * 7)+0.5) << 2) & 0x1c;
+ ((GLubyte *)packedPixel)[index] |=
+ ((GLubyte)((shoveComponents[2] * 3)+0.5) ) & 0x03;
+} /* shove332() */
+
+static void extract233rev(int isSwap,
+ const void *packedPixel, GLfloat extractComponents[])
+{
+ GLubyte ubyte= *(const GLubyte *)packedPixel;
+
+ isSwap= isSwap; /* turn off warnings */
+
+ /* 0000,0111 == 0x07 */
+ /* 0011,1000 == 0x38 */
+ /* 1100,0000 == 0xC0 */
+
+ extractComponents[0]= (float)((ubyte & 0x07) ) / 7.0;
+ extractComponents[1]= (float)((ubyte & 0x38) >> 3) / 7.0;
+ extractComponents[2]= (float)((ubyte & 0xC0) >> 6) / 3.0;
+} /* extract233rev() */
+
+static void shove233rev(const GLfloat shoveComponents[],
+ int index, void *packedPixel)
+{
+ /* 0000,0111 == 0x07 */
+ /* 0011,1000 == 0x38 */
+ /* 1100,0000 == 0xC0 */
+
+ assert(0.0 <= shoveComponents[0] && shoveComponents[0] <= 1.0);
+ assert(0.0 <= shoveComponents[1] && shoveComponents[1] <= 1.0);
+ assert(0.0 <= shoveComponents[2] && shoveComponents[2] <= 1.0);
+
+ /* due to limited precision, need to round before shoving */
+ ((GLubyte *)packedPixel)[index] =
+ ((GLubyte)((shoveComponents[0] * 7.0)+0.5) ) & 0x07;
+ ((GLubyte *)packedPixel)[index]|=
+ ((GLubyte)((shoveComponents[1] * 7.0)+0.5) << 3) & 0x38;
+ ((GLubyte *)packedPixel)[index]|=
+ ((GLubyte)((shoveComponents[2] * 3.0)+0.5) << 6) & 0xC0;
+} /* shove233rev() */
+
+static void extract565(int isSwap,
+ const void *packedPixel, GLfloat extractComponents[])
+{
+ GLushort ushort;
+
+ if (isSwap) {
+ ushort= __GLU_SWAP_2_BYTES(packedPixel);
+ }
+ else {
+ ushort= *(const GLushort *)packedPixel;
+ }
+
+ /* 11111000,00000000 == 0xf800 */
+ /* 00000111,11100000 == 0x07e0 */
+ /* 00000000,00011111 == 0x001f */
+
+ extractComponents[0]=(float)((ushort & 0xf800) >> 11) / 31.0;/* 31 = 2^5-1*/
+ extractComponents[1]=(float)((ushort & 0x07e0) >> 5) / 63.0;/* 63 = 2^6-1*/
+ extractComponents[2]=(float)((ushort & 0x001f) ) / 31.0;
+} /* extract565() */
+
+static void shove565(const GLfloat shoveComponents[],
+ int index,void *packedPixel)
+{
+ /* 11111000,00000000 == 0xf800 */
+ /* 00000111,11100000 == 0x07e0 */
+ /* 00000000,00011111 == 0x001f */
+
+ assert(0.0 <= shoveComponents[0] && shoveComponents[0] <= 1.0);
+ assert(0.0 <= shoveComponents[1] && shoveComponents[1] <= 1.0);
+ assert(0.0 <= shoveComponents[2] && shoveComponents[2] <= 1.0);
+
+ /* due to limited precision, need to round before shoving */
+ ((GLushort *)packedPixel)[index] =
+ ((GLushort)((shoveComponents[0] * 31)+0.5) << 11) & 0xf800;
+ ((GLushort *)packedPixel)[index]|=
+ ((GLushort)((shoveComponents[1] * 63)+0.5) << 5) & 0x07e0;
+ ((GLushort *)packedPixel)[index]|=
+ ((GLushort)((shoveComponents[2] * 31)+0.5) ) & 0x001f;
+} /* shove565() */
+
+static void extract565rev(int isSwap,
+ const void *packedPixel, GLfloat extractComponents[])
+{
+ GLushort ushort;
+
+ if (isSwap) {
+ ushort= __GLU_SWAP_2_BYTES(packedPixel);
+ }
+ else {
+ ushort= *(const GLushort *)packedPixel;
+ }
+
+ /* 00000000,00011111 == 0x001f */
+ /* 00000111,11100000 == 0x07e0 */
+ /* 11111000,00000000 == 0xf800 */
+
+ extractComponents[0]= (float)((ushort & 0x001F) ) / 31.0;
+ extractComponents[1]= (float)((ushort & 0x07E0) >> 5) / 63.0;
+ extractComponents[2]= (float)((ushort & 0xF800) >> 11) / 31.0;
+} /* extract565rev() */
+
+static void shove565rev(const GLfloat shoveComponents[],
+ int index,void *packedPixel)
+{
+ /* 00000000,00011111 == 0x001f */
+ /* 00000111,11100000 == 0x07e0 */
+ /* 11111000,00000000 == 0xf800 */
+
+ assert(0.0 <= shoveComponents[0] && shoveComponents[0] <= 1.0);
+ assert(0.0 <= shoveComponents[1] && shoveComponents[1] <= 1.0);
+ assert(0.0 <= shoveComponents[2] && shoveComponents[2] <= 1.0);
+
+ /* due to limited precision, need to round before shoving */
+ ((GLushort *)packedPixel)[index] =
+ ((GLushort)((shoveComponents[0] * 31.0)+0.5) ) & 0x001F;
+ ((GLushort *)packedPixel)[index]|=
+ ((GLushort)((shoveComponents[1] * 63.0)+0.5) << 5) & 0x07E0;
+ ((GLushort *)packedPixel)[index]|=
+ ((GLushort)((shoveComponents[2] * 31.0)+0.5) << 11) & 0xF800;
+} /* shove565rev() */
+
+static void extract4444(int isSwap,const void *packedPixel,
+ GLfloat extractComponents[])
+{
+ GLushort ushort;
+
+ if (isSwap) {
+ ushort= __GLU_SWAP_2_BYTES(packedPixel);
+ }
+ else {
+ ushort= *(const GLushort *)packedPixel;
+ }
+
+ /* 11110000,00000000 == 0xf000 */
+ /* 00001111,00000000 == 0x0f00 */
+ /* 00000000,11110000 == 0x00f0 */
+ /* 00000000,00001111 == 0x000f */
+
+ extractComponents[0]= (float)((ushort & 0xf000) >> 12) / 15.0;/* 15=2^4-1 */
+ extractComponents[1]= (float)((ushort & 0x0f00) >> 8) / 15.0;
+ extractComponents[2]= (float)((ushort & 0x00f0) >> 4) / 15.0;
+ extractComponents[3]= (float)((ushort & 0x000f) ) / 15.0;
+} /* extract4444() */
+
+static void shove4444(const GLfloat shoveComponents[],
+ int index,void *packedPixel)
+{
+ assert(0.0 <= shoveComponents[0] && shoveComponents[0] <= 1.0);
+ assert(0.0 <= shoveComponents[1] && shoveComponents[1] <= 1.0);
+ assert(0.0 <= shoveComponents[2] && shoveComponents[2] <= 1.0);
+ assert(0.0 <= shoveComponents[3] && shoveComponents[3] <= 1.0);
+
+ /* due to limited precision, need to round before shoving */
+ ((GLushort *)packedPixel)[index] =
+ ((GLushort)((shoveComponents[0] * 15)+0.5) << 12) & 0xf000;
+ ((GLushort *)packedPixel)[index]|=
+ ((GLushort)((shoveComponents[1] * 15)+0.5) << 8) & 0x0f00;
+ ((GLushort *)packedPixel)[index]|=
+ ((GLushort)((shoveComponents[2] * 15)+0.5) << 4) & 0x00f0;
+ ((GLushort *)packedPixel)[index]|=
+ ((GLushort)((shoveComponents[3] * 15)+0.5) ) & 0x000f;
+} /* shove4444() */
+
+static void extract4444rev(int isSwap,const void *packedPixel,
+ GLfloat extractComponents[])
+{
+ GLushort ushort;
+
+ if (isSwap) {
+ ushort= __GLU_SWAP_2_BYTES(packedPixel);
+ }
+ else {
+ ushort= *(const GLushort *)packedPixel;
+ }
+
+ /* 00000000,00001111 == 0x000f */
+ /* 00000000,11110000 == 0x00f0 */
+ /* 00001111,00000000 == 0x0f00 */
+ /* 11110000,00000000 == 0xf000 */
+
+ /* 15 = 2^4-1 */
+ extractComponents[0]= (float)((ushort & 0x000F) ) / 15.0;
+ extractComponents[1]= (float)((ushort & 0x00F0) >> 4) / 15.0;
+ extractComponents[2]= (float)((ushort & 0x0F00) >> 8) / 15.0;
+ extractComponents[3]= (float)((ushort & 0xF000) >> 12) / 15.0;
+} /* extract4444rev() */
+
+static void shove4444rev(const GLfloat shoveComponents[],
+ int index,void *packedPixel)
+{
+ /* 00000000,00001111 == 0x000f */
+ /* 00000000,11110000 == 0x00f0 */
+ /* 00001111,00000000 == 0x0f00 */
+ /* 11110000,00000000 == 0xf000 */
+
+ assert(0.0 <= shoveComponents[0] && shoveComponents[0] <= 1.0);
+ assert(0.0 <= shoveComponents[1] && shoveComponents[1] <= 1.0);
+ assert(0.0 <= shoveComponents[2] && shoveComponents[2] <= 1.0);
+ assert(0.0 <= shoveComponents[3] && shoveComponents[3] <= 1.0);
+
+ /* due to limited precision, need to round before shoving */
+ ((GLushort *)packedPixel)[index] =
+ ((GLushort)((shoveComponents[0] * 15)+0.5) ) & 0x000F;
+ ((GLushort *)packedPixel)[index]|=
+ ((GLushort)((shoveComponents[1] * 15)+0.5) << 4) & 0x00F0;
+ ((GLushort *)packedPixel)[index]|=
+ ((GLushort)((shoveComponents[2] * 15)+0.5) << 8) & 0x0F00;
+ ((GLushort *)packedPixel)[index]|=
+ ((GLushort)((shoveComponents[3] * 15)+0.5) << 12) & 0xF000;
+} /* shove4444rev() */
+
+static void extract5551(int isSwap,const void *packedPixel,
+ GLfloat extractComponents[])
+{
+ GLushort ushort;
+
+ if (isSwap) {
+ ushort= __GLU_SWAP_2_BYTES(packedPixel);
+ }
+ else {
+ ushort= *(const GLushort *)packedPixel;
+ }
+
+ /* 11111000,00000000 == 0xf800 */
+ /* 00000111,11000000 == 0x07c0 */
+ /* 00000000,00111110 == 0x003e */
+ /* 00000000,00000001 == 0x0001 */
+
+ extractComponents[0]=(float)((ushort & 0xf800) >> 11) / 31.0;/* 31 = 2^5-1*/
+ extractComponents[1]=(float)((ushort & 0x07c0) >> 6) / 31.0;
+ extractComponents[2]=(float)((ushort & 0x003e) >> 1) / 31.0;
+ extractComponents[3]=(float)((ushort & 0x0001) );
+} /* extract5551() */
+
+static void shove5551(const GLfloat shoveComponents[],
+ int index,void *packedPixel)
+{
+ /* 11111000,00000000 == 0xf800 */
+ /* 00000111,11000000 == 0x07c0 */
+ /* 00000000,00111110 == 0x003e */
+ /* 00000000,00000001 == 0x0001 */
+
+ assert(0.0 <= shoveComponents[0] && shoveComponents[0] <= 1.0);
+ assert(0.0 <= shoveComponents[1] && shoveComponents[1] <= 1.0);
+ assert(0.0 <= shoveComponents[2] && shoveComponents[2] <= 1.0);
+ assert(0.0 <= shoveComponents[3] && shoveComponents[3] <= 1.0);
+
+ /* due to limited precision, need to round before shoving */
+ ((GLushort *)packedPixel)[index] =
+ ((GLushort)((shoveComponents[0] * 31)+0.5) << 11) & 0xf800;
+ ((GLushort *)packedPixel)[index]|=
+ ((GLushort)((shoveComponents[1] * 31)+0.5) << 6) & 0x07c0;
+ ((GLushort *)packedPixel)[index]|=
+ ((GLushort)((shoveComponents[2] * 31)+0.5) << 1) & 0x003e;
+ ((GLushort *)packedPixel)[index]|=
+ ((GLushort)((shoveComponents[3])+0.5) ) & 0x0001;
+} /* shove5551() */
+
+static void extract1555rev(int isSwap,const void *packedPixel,
+ GLfloat extractComponents[])
+{
+ GLushort ushort;
+
+ if (isSwap) {
+ ushort= __GLU_SWAP_2_BYTES(packedPixel);
+ }
+ else {
+ ushort= *(const GLushort *)packedPixel;
+ }
+
+ /* 00000000,00011111 == 0x001F */
+ /* 00000011,11100000 == 0x03E0 */
+ /* 01111100,00000000 == 0x7C00 */
+ /* 10000000,00000000 == 0x8000 */
+
+ /* 31 = 2^5-1 */
+ extractComponents[0]= (float)((ushort & 0x001F) ) / 31.0;
+ extractComponents[1]= (float)((ushort & 0x03E0) >> 5) / 31.0;
+ extractComponents[2]= (float)((ushort & 0x7C00) >> 10) / 31.0;
+ extractComponents[3]= (float)((ushort & 0x8000) >> 15);
+} /* extract1555rev() */
+
+static void shove1555rev(const GLfloat shoveComponents[],
+ int index,void *packedPixel)
+{
+ /* 00000000,00011111 == 0x001F */
+ /* 00000011,11100000 == 0x03E0 */
+ /* 01111100,00000000 == 0x7C00 */
+ /* 10000000,00000000 == 0x8000 */
+
+ assert(0.0 <= shoveComponents[0] && shoveComponents[0] <= 1.0);
+ assert(0.0 <= shoveComponents[1] && shoveComponents[1] <= 1.0);
+ assert(0.0 <= shoveComponents[2] && shoveComponents[2] <= 1.0);
+ assert(0.0 <= shoveComponents[3] && shoveComponents[3] <= 1.0);
+
+ /* due to limited precision, need to round before shoving */
+ ((GLushort *)packedPixel)[index] =
+ ((GLushort)((shoveComponents[0] * 31)+0.5) ) & 0x001F;
+ ((GLushort *)packedPixel)[index]|=
+ ((GLushort)((shoveComponents[1] * 31)+0.5) << 5) & 0x03E0;
+ ((GLushort *)packedPixel)[index]|=
+ ((GLushort)((shoveComponents[2] * 31)+0.5) << 10) & 0x7C00;
+ ((GLushort *)packedPixel)[index]|=
+ ((GLushort)((shoveComponents[3])+0.5) << 15) & 0x8000;
+} /* shove1555rev() */
+
+static void extract8888(int isSwap,
+ const void *packedPixel, GLfloat extractComponents[])
+{
+ GLuint uint;
+
+ if (isSwap) {
+ uint= __GLU_SWAP_4_BYTES(packedPixel);
+ }
+ else {
+ uint= *(const GLuint *)packedPixel;
+ }
+
+ /* 11111111,00000000,00000000,00000000 == 0xff000000 */
+ /* 00000000,11111111,00000000,00000000 == 0x00ff0000 */
+ /* 00000000,00000000,11111111,00000000 == 0x0000ff00 */
+ /* 00000000,00000000,00000000,11111111 == 0x000000ff */
+
+ /* 255 = 2^8-1 */
+ extractComponents[0]= (float)((uint & 0xff000000) >> 24) / 255.0;
+ extractComponents[1]= (float)((uint & 0x00ff0000) >> 16) / 255.0;
+ extractComponents[2]= (float)((uint & 0x0000ff00) >> 8) / 255.0;
+ extractComponents[3]= (float)((uint & 0x000000ff) ) / 255.0;
+} /* extract8888() */
+
+static void shove8888(const GLfloat shoveComponents[],
+ int index,void *packedPixel)
+{
+ /* 11111111,00000000,00000000,00000000 == 0xff000000 */
+ /* 00000000,11111111,00000000,00000000 == 0x00ff0000 */
+ /* 00000000,00000000,11111111,00000000 == 0x0000ff00 */
+ /* 00000000,00000000,00000000,11111111 == 0x000000ff */
+
+ assert(0.0 <= shoveComponents[0] && shoveComponents[0] <= 1.0);
+ assert(0.0 <= shoveComponents[1] && shoveComponents[1] <= 1.0);
+ assert(0.0 <= shoveComponents[2] && shoveComponents[2] <= 1.0);
+ assert(0.0 <= shoveComponents[3] && shoveComponents[3] <= 1.0);
+
+ /* due to limited precision, need to round before shoving */
+ ((GLuint *)packedPixel)[index] =
+ ((GLuint)((shoveComponents[0] * 255)+0.5) << 24) & 0xff000000;
+ ((GLuint *)packedPixel)[index]|=
+ ((GLuint)((shoveComponents[1] * 255)+0.5) << 16) & 0x00ff0000;
+ ((GLuint *)packedPixel)[index]|=
+ ((GLuint)((shoveComponents[2] * 255)+0.5) << 8) & 0x0000ff00;
+ ((GLuint *)packedPixel)[index]|=
+ ((GLuint)((shoveComponents[3] * 255)+0.5) ) & 0x000000ff;
+} /* shove8888() */
+
+static void extract8888rev(int isSwap,
+ const void *packedPixel,GLfloat extractComponents[])
+{
+ GLuint uint;
+
+ if (isSwap) {
+ uint= __GLU_SWAP_4_BYTES(packedPixel);
+ }
+ else {
+ uint= *(const GLuint *)packedPixel;
+ }
+
+ /* 00000000,00000000,00000000,11111111 == 0x000000ff */
+ /* 00000000,00000000,11111111,00000000 == 0x0000ff00 */
+ /* 00000000,11111111,00000000,00000000 == 0x00ff0000 */
+ /* 11111111,00000000,00000000,00000000 == 0xff000000 */
+
+ /* 255 = 2^8-1 */
+ extractComponents[0]= (float)((uint & 0x000000FF) ) / 255.0;
+ extractComponents[1]= (float)((uint & 0x0000FF00) >> 8) / 255.0;
+ extractComponents[2]= (float)((uint & 0x00FF0000) >> 16) / 255.0;
+ extractComponents[3]= (float)((uint & 0xFF000000) >> 24) / 255.0;
+} /* extract8888rev() */
+
+static void shove8888rev(const GLfloat shoveComponents[],
+ int index,void *packedPixel)
+{
+ /* 00000000,00000000,00000000,11111111 == 0x000000ff */
+ /* 00000000,00000000,11111111,00000000 == 0x0000ff00 */
+ /* 00000000,11111111,00000000,00000000 == 0x00ff0000 */
+ /* 11111111,00000000,00000000,00000000 == 0xff000000 */
+
+ assert(0.0 <= shoveComponents[0] && shoveComponents[0] <= 1.0);
+ assert(0.0 <= shoveComponents[1] && shoveComponents[1] <= 1.0);
+ assert(0.0 <= shoveComponents[2] && shoveComponents[2] <= 1.0);
+ assert(0.0 <= shoveComponents[3] && shoveComponents[3] <= 1.0);
+
+ /* due to limited precision, need to round before shoving */
+ ((GLuint *)packedPixel)[index] =
+ ((GLuint)((shoveComponents[0] * 255)+0.5) ) & 0x000000FF;
+ ((GLuint *)packedPixel)[index]|=
+ ((GLuint)((shoveComponents[1] * 255)+0.5) << 8) & 0x0000FF00;
+ ((GLuint *)packedPixel)[index]|=
+ ((GLuint)((shoveComponents[2] * 255)+0.5) << 16) & 0x00FF0000;
+ ((GLuint *)packedPixel)[index]|=
+ ((GLuint)((shoveComponents[3] * 255)+0.5) << 24) & 0xFF000000;
+} /* shove8888rev() */
+
+static void extract1010102(int isSwap,
+ const void *packedPixel,GLfloat extractComponents[])
+{
+ GLuint uint;
+
+ if (isSwap) {
+ uint= __GLU_SWAP_4_BYTES(packedPixel);
+ }
+ else {
+ uint= *(const GLuint *)packedPixel;
+ }
+
+ /* 11111111,11000000,00000000,00000000 == 0xffc00000 */
+ /* 00000000,00111111,11110000,00000000 == 0x003ff000 */
+ /* 00000000,00000000,00001111,11111100 == 0x00000ffc */
+ /* 00000000,00000000,00000000,00000011 == 0x00000003 */
+
+ /* 1023 = 2^10-1 */
+ extractComponents[0]= (float)((uint & 0xffc00000) >> 22) / 1023.0;
+ extractComponents[1]= (float)((uint & 0x003ff000) >> 12) / 1023.0;
+ extractComponents[2]= (float)((uint & 0x00000ffc) >> 2) / 1023.0;
+ extractComponents[3]= (float)((uint & 0x00000003) ) / 3.0;
+} /* extract1010102() */
+
+static void shove1010102(const GLfloat shoveComponents[],
+ int index,void *packedPixel)
+{
+ /* 11111111,11000000,00000000,00000000 == 0xffc00000 */
+ /* 00000000,00111111,11110000,00000000 == 0x003ff000 */
+ /* 00000000,00000000,00001111,11111100 == 0x00000ffc */
+ /* 00000000,00000000,00000000,00000011 == 0x00000003 */
+
+ assert(0.0 <= shoveComponents[0] && shoveComponents[0] <= 1.0);
+ assert(0.0 <= shoveComponents[1] && shoveComponents[1] <= 1.0);
+ assert(0.0 <= shoveComponents[2] && shoveComponents[2] <= 1.0);
+ assert(0.0 <= shoveComponents[3] && shoveComponents[3] <= 1.0);
+
+ /* due to limited precision, need to round before shoving */
+ ((GLuint *)packedPixel)[index] =
+ ((GLuint)((shoveComponents[0] * 1023)+0.5) << 22) & 0xffc00000;
+ ((GLuint *)packedPixel)[index]|=
+ ((GLuint)((shoveComponents[1] * 1023)+0.5) << 12) & 0x003ff000;
+ ((GLuint *)packedPixel)[index]|=
+ ((GLuint)((shoveComponents[2] * 1023)+0.5) << 2) & 0x00000ffc;
+ ((GLuint *)packedPixel)[index]|=
+ ((GLuint)((shoveComponents[3] * 3)+0.5) ) & 0x00000003;
+} /* shove1010102() */
+
+static void extract2101010rev(int isSwap,
+ const void *packedPixel,
+ GLfloat extractComponents[])
+{
+ GLuint uint;
+
+ if (isSwap) {
+ uint= __GLU_SWAP_4_BYTES(packedPixel);
+ }
+ else {
+ uint= *(const GLuint *)packedPixel;
+ }
+
+ /* 00000000,00000000,00000011,11111111 == 0x000003FF */
+ /* 00000000,00001111,11111100,00000000 == 0x000FFC00 */
+ /* 00111111,11110000,00000000,00000000 == 0x3FF00000 */
+ /* 11000000,00000000,00000000,00000000 == 0xC0000000 */
+
+ /* 1023 = 2^10-1 */
+ extractComponents[0]= (float)((uint & 0x000003FF) ) / 1023.0;
+ extractComponents[1]= (float)((uint & 0x000FFC00) >> 10) / 1023.0;
+ extractComponents[2]= (float)((uint & 0x3FF00000) >> 20) / 1023.0;
+ extractComponents[3]= (float)((uint & 0xC0000000) >> 30) / 3.0;
+ /* 3 = 2^2-1 */
+} /* extract2101010rev() */
+
+static void shove2101010rev(const GLfloat shoveComponents[],
+ int index,void *packedPixel)
+{
+ /* 00000000,00000000,00000011,11111111 == 0x000003FF */
+ /* 00000000,00001111,11111100,00000000 == 0x000FFC00 */
+ /* 00111111,11110000,00000000,00000000 == 0x3FF00000 */
+ /* 11000000,00000000,00000000,00000000 == 0xC0000000 */
+
+ assert(0.0 <= shoveComponents[0] && shoveComponents[0] <= 1.0);
+ assert(0.0 <= shoveComponents[1] && shoveComponents[1] <= 1.0);
+ assert(0.0 <= shoveComponents[2] && shoveComponents[2] <= 1.0);
+ assert(0.0 <= shoveComponents[3] && shoveComponents[3] <= 1.0);
+
+ /* due to limited precision, need to round before shoving */
+ ((GLuint *)packedPixel)[index] =
+ ((GLuint)((shoveComponents[0] * 1023)+0.5) ) & 0x000003FF;
+ ((GLuint *)packedPixel)[index]|=
+ ((GLuint)((shoveComponents[1] * 1023)+0.5) << 10) & 0x000FFC00;
+ ((GLuint *)packedPixel)[index]|=
+ ((GLuint)((shoveComponents[2] * 1023)+0.5) << 20) & 0x3FF00000;
+ ((GLuint *)packedPixel)[index]|=
+ ((GLuint)((shoveComponents[3] * 3)+0.5) << 30) & 0xC0000000;
+} /* shove2101010rev() */
+
+static void scaleInternalPackedPixel(int components,
+ void (*extractPackedPixel)
+ (int, const void *,GLfloat []),
+ void (*shovePackedPixel)
+ (const GLfloat [], int, void *),
+ GLint widthIn,GLint heightIn,
+ const void *dataIn,
+ GLint widthOut,GLint heightOut,
+ void *dataOut,
+ GLint pixelSizeInBytes,
+ GLint rowSizeInBytes,GLint isSwap)
+{
+ float convx;
+ float convy;
+ float percent;
+
+ /* Max components in a format is 4, so... */
+ float totals[4];
+ float extractTotals[4], extractMoreTotals[4], shoveTotals[4];
+
+ float area;
+ int i,j,k,xindex;
+
+ const char *temp, *temp0;
+ int outindex;
+
+ int lowx_int, highx_int, lowy_int, highy_int;
+ float x_percent, y_percent;
+ float lowx_float, highx_float, lowy_float, highy_float;
+ float convy_float, convx_float;
+ int convy_int, convx_int;
+ int l, m;
+ const char *left, *right;
+
+ if (widthIn == widthOut*2 && heightIn == heightOut*2) {
+ halveImagePackedPixel(components,extractPackedPixel,shovePackedPixel,
+ widthIn, heightIn, dataIn, dataOut,
+ pixelSizeInBytes,rowSizeInBytes,isSwap);
+ return;
+ }
+ convy = (float) heightIn/heightOut;
+ convx = (float) widthIn/widthOut;
+ convy_int = floor(convy);
+ convy_float = convy - convy_int;
+ convx_int = floor(convx);
+ convx_float = convx - convx_int;
+
+ area = convx * convy;
+
+ lowy_int = 0;
+ lowy_float = 0;
+ highy_int = convy_int;
+ highy_float = convy_float;
+
+ for (i = 0; i < heightOut; i++) {
+ lowx_int = 0;
+ lowx_float = 0;
+ highx_int = convx_int;
+ highx_float = convx_float;
+
+ for (j = 0; j < widthOut; j++) {
+ /*
+ ** Ok, now apply box filter to box that goes from (lowx, lowy)
+ ** to (highx, highy) on input data into this pixel on output
+ ** data.
+ */
+ totals[0] = totals[1] = totals[2] = totals[3] = 0.0;
+
+ /* calculate the value for pixels in the 1st row */
+ xindex = lowx_int*pixelSizeInBytes;
+ if((highy_int>lowy_int) && (highx_int>lowx_int)) {
+
+ y_percent = 1-lowy_float;
+ temp = (const char *)dataIn + xindex + lowy_int * rowSizeInBytes;
+ percent = y_percent * (1-lowx_float);
+#if 0
+ for (k = 0, temp_index = temp; k < components;
+ k++, temp_index += element_size) {
+ if (myswap_bytes) {
+ totals[k] += __GLU_SWAP_2_BYTES(temp_index) * percent;
+ } else {
+ totals[k] += *(const GLushort*)temp_index * percent;
+ }
+ }
+#else
+ (*extractPackedPixel)(isSwap,temp,extractTotals);
+ for (k = 0; k < components; k++) {
+ totals[k]+= extractTotals[k] * percent;
+ }
+#endif
+ left = temp;
+ for(l = lowx_int+1; l < highx_int; l++) {
+ temp += pixelSizeInBytes;
+#if 0
+ for (k = 0, temp_index = temp; k < components;
+ k++, temp_index += element_size) {
+ if (myswap_bytes) {
+ totals[k] +=
+ __GLU_SWAP_2_BYTES(temp_index) * y_percent;
+ } else {
+ totals[k] += *(const GLushort*)temp_index * y_percent;
+ }
+ }
+#else
+ (*extractPackedPixel)(isSwap,temp,extractTotals);
+ for (k = 0; k < components; k++) {
+ totals[k]+= extractTotals[k] * y_percent;
+ }
+#endif
+ }
+ temp += pixelSizeInBytes;
+ right = temp;
+ percent = y_percent * highx_float;
+#if 0
+ for (k = 0, temp_index = temp; k < components;
+ k++, temp_index += element_size) {
+ if (myswap_bytes) {
+ totals[k] += __GLU_SWAP_2_BYTES(temp_index) * percent;
+ } else {
+ totals[k] += *(const GLushort*)temp_index * percent;
+ }
+ }
+#else
+ (*extractPackedPixel)(isSwap,temp,extractTotals);
+ for (k = 0; k < components; k++) {
+ totals[k]+= extractTotals[k] * percent;
+ }
+#endif
+
+ /* calculate the value for pixels in the last row */
+
+ y_percent = highy_float;
+ percent = y_percent * (1-lowx_float);
+ temp = (const char *)dataIn + xindex + highy_int * rowSizeInBytes;
+#if 0
+ for (k = 0, temp_index = temp; k < components;
+ k++, temp_index += element_size) {
+ if (myswap_bytes) {
+ totals[k] += __GLU_SWAP_2_BYTES(temp_index) * percent;
+ } else {
+ totals[k] += *(const GLushort*)temp_index * percent;
+ }
+ }
+#else
+ (*extractPackedPixel)(isSwap,temp,extractTotals);
+ for (k = 0; k < components; k++) {
+ totals[k]+= extractTotals[k] * percent;
+ }
+#endif
+ for(l = lowx_int+1; l < highx_int; l++) {
+ temp += pixelSizeInBytes;
+#if 0
+ for (k = 0, temp_index = temp; k < components;
+ k++, temp_index += element_size) {
+ if (myswap_bytes) {
+ totals[k] +=
+ __GLU_SWAP_2_BYTES(temp_index) * y_percent;
+ } else {
+ totals[k] += *(const GLushort*)temp_index * y_percent;
+ }
+ }
+#else
+ (*extractPackedPixel)(isSwap,temp,extractTotals);
+ for (k = 0; k < components; k++) {
+ totals[k]+= extractTotals[k] * y_percent;
+ }
+#endif
+
+ }
+ temp += pixelSizeInBytes;
+ percent = y_percent * highx_float;
+#if 0
+ for (k = 0, temp_index = temp; k < components;
+ k++, temp_index += element_size) {
+ if (myswap_bytes) {
+ totals[k] += __GLU_SWAP_2_BYTES(temp_index) * percent;
+ } else {
+ totals[k] += *(const GLushort*)temp_index * percent;
+ }
+ }
+#else
+ (*extractPackedPixel)(isSwap,temp,extractTotals);
+ for (k = 0; k < components; k++) {
+ totals[k]+= extractTotals[k] * percent;
+ }
+#endif
+
+ /* calculate the value for pixels in the 1st and last column */
+ for(m = lowy_int+1; m < highy_int; m++) {
+ left += rowSizeInBytes;
+ right += rowSizeInBytes;
+#if 0
+ for (k = 0; k < components;
+ k++, left += element_size, right += element_size) {
+ if (myswap_bytes) {
+ totals[k] +=
+ __GLU_SWAP_2_BYTES(left) * (1-lowx_float) +
+ __GLU_SWAP_2_BYTES(right) * highx_float;
+ } else {
+ totals[k] += *(const GLushort*)left * (1-lowx_float)
+ + *(const GLushort*)right * highx_float;
+ }
+ }
+#else
+ (*extractPackedPixel)(isSwap,left,extractTotals);
+ (*extractPackedPixel)(isSwap,right,extractMoreTotals);
+ for (k = 0; k < components; k++) {
+ totals[k]+= (extractTotals[k]*(1-lowx_float) +
+ extractMoreTotals[k]*highx_float);
+ }
+#endif
+ }
+ } else if (highy_int > lowy_int) {
+ x_percent = highx_float - lowx_float;
+ percent = (1-lowy_float)*x_percent;
+ temp = (const char *)dataIn + xindex + lowy_int*rowSizeInBytes;
+#if 0
+ for (k = 0, temp_index = temp; k < components;
+ k++, temp_index += element_size) {
+ if (myswap_bytes) {
+ totals[k] += __GLU_SWAP_2_BYTES(temp_index) * percent;
+ } else {
+ totals[k] += *(const GLushort*)temp_index * percent;
+ }
+ }
+#else
+ (*extractPackedPixel)(isSwap,temp,extractTotals);
+ for (k = 0; k < components; k++) {
+ totals[k]+= extractTotals[k] * percent;
+ }
+#endif
+ for(m = lowy_int+1; m < highy_int; m++) {
+ temp += rowSizeInBytes;
+#if 0
+ for (k = 0, temp_index = temp; k < components;
+ k++, temp_index += element_size) {
+ if (myswap_bytes) {
+ totals[k] +=
+ __GLU_SWAP_2_BYTES(temp_index) * x_percent;
+ } else {
+ totals[k] += *(const GLushort*)temp_index * x_percent;
+ }
+ }
+#else
+ (*extractPackedPixel)(isSwap,temp,extractTotals);
+ for (k = 0; k < components; k++) {
+ totals[k]+= extractTotals[k] * x_percent;
+ }
+#endif
+ }
+ percent = x_percent * highy_float;
+ temp += rowSizeInBytes;
+#if 0
+ for (k = 0, temp_index = temp; k < components;
+ k++, temp_index += element_size) {
+ if (myswap_bytes) {
+ totals[k] += __GLU_SWAP_2_BYTES(temp_index) * percent;
+ } else {
+ totals[k] += *(const GLushort*)temp_index * percent;
+ }
+ }
+#else
+ (*extractPackedPixel)(isSwap,temp,extractTotals);
+ for (k = 0; k < components; k++) {
+ totals[k]+= extractTotals[k] * percent;
+ }
+#endif
+ } else if (highx_int > lowx_int) {
+ y_percent = highy_float - lowy_float;
+ percent = (1-lowx_float)*y_percent;
+ temp = (const char *)dataIn + xindex + lowy_int*rowSizeInBytes;
+#if 0
+ for (k = 0, temp_index = temp; k < components;
+ k++, temp_index += element_size) {
+ if (myswap_bytes) {
+ totals[k] += __GLU_SWAP_2_BYTES(temp_index) * percent;
+ } else {
+ totals[k] += *(const GLushort*)temp_index * percent;
+ }
+ }
+#else
+ (*extractPackedPixel)(isSwap,temp,extractTotals);
+ for (k = 0; k < components; k++) {
+ totals[k]+= extractTotals[k] * percent;
+ }
+#endif
+ for (l = lowx_int+1; l < highx_int; l++) {
+ temp += pixelSizeInBytes;
+#if 0
+ for (k = 0, temp_index = temp; k < components;
+ k++, temp_index += element_size) {
+ if (myswap_bytes) {
+ totals[k] +=
+ __GLU_SWAP_2_BYTES(temp_index) * y_percent;
+ } else {
+ totals[k] += *(const GLushort*)temp_index * y_percent;
+ }
+ }
+#else
+ (*extractPackedPixel)(isSwap,temp,extractTotals);
+ for (k = 0; k < components; k++) {
+ totals[k]+= extractTotals[k] * y_percent;
+ }
+#endif
+ }
+ temp += pixelSizeInBytes;
+ percent = y_percent * highx_float;
+#if 0
+ for (k = 0, temp_index = temp; k < components;
+ k++, temp_index += element_size) {
+ if (myswap_bytes) {
+ totals[k] += __GLU_SWAP_2_BYTES(temp_index) * percent;
+ } else {
+ totals[k] += *(const GLushort*)temp_index * percent;
+ }
+ }
+#else
+ (*extractPackedPixel)(isSwap,temp,extractTotals);
+ for (k = 0; k < components; k++) {
+ totals[k]+= extractTotals[k] * percent;
+ }
+#endif
+ } else {
+ percent = (highy_float-lowy_float)*(highx_float-lowx_float);
+ temp = (const char *)dataIn + xindex + lowy_int * rowSizeInBytes;
+#if 0
+ for (k = 0, temp_index = temp; k < components;
+ k++, temp_index += element_size) {
+ if (myswap_bytes) {
+ totals[k] += __GLU_SWAP_2_BYTES(temp_index) * percent;
+ } else {
+ totals[k] += *(const GLushort*)temp_index * percent;
+ }
+ }
+#else
+ (*extractPackedPixel)(isSwap,temp,extractTotals);
+ for (k = 0; k < components; k++) {
+ totals[k]+= extractTotals[k] * percent;
+ }
+#endif
+ }
+
+ /* this is for the pixels in the body */
+ temp0 = (const char *)dataIn + xindex + pixelSizeInBytes + (lowy_int+1)*rowSizeInBytes;
+ for (m = lowy_int+1; m < highy_int; m++) {
+ temp = temp0;
+ for(l = lowx_int+1; l < highx_int; l++) {
+#if 0
+ for (k = 0, temp_index = temp; k < components;
+ k++, temp_index += element_size) {
+ if (myswap_bytes) {
+ totals[k] += __GLU_SWAP_2_BYTES(temp_index);
+ } else {
+ totals[k] += *(const GLushort*)temp_index;
+ }
+ }
+#else
+ (*extractPackedPixel)(isSwap,temp,extractTotals);
+ for (k = 0; k < components; k++) {
+ totals[k]+= extractTotals[k];
+ }
+#endif
+ temp += pixelSizeInBytes;
+ }
+ temp0 += rowSizeInBytes;
+ }
+
+ outindex = (j + (i * widthOut)); /* * (components == 1) */
+#if 0
+ for (k = 0; k < components; k++) {
+ dataout[outindex + k] = totals[k]/area;
+ /*printf("totals[%d] = %f\n", k, totals[k]);*/
+ }
+#else
+ for (k = 0; k < components; k++) {
+ shoveTotals[k]= totals[k]/area;
+ }
+ (*shovePackedPixel)(shoveTotals,outindex,(void *)dataOut);
+#endif
+ lowx_int = highx_int;
+ lowx_float = highx_float;
+ highx_int += convx_int;
+ highx_float += convx_float;
+ if(highx_float > 1) {
+ highx_float -= 1.0;
+ highx_int++;
+ }
+ }
+ lowy_int = highy_int;
+ lowy_float = highy_float;
+ highy_int += convy_int;
+ highy_float += convy_float;
+ if(highy_float > 1) {
+ highy_float -= 1.0;
+ highy_int++;
+ }
+ }
+
+ assert(outindex == (widthOut*heightOut - 1));
+} /* scaleInternalPackedPixel() */
+
+/* rowSizeInBytes is at least the width (in bytes) due to padding on
+ * inputs; not always equal. Output NEVER has row padding.
+ */
+static void halveImagePackedPixel(int components,
+ void (*extractPackedPixel)
+ (int, const void *,GLfloat []),
+ void (*shovePackedPixel)
+ (const GLfloat [],int, void *),
+ GLint width, GLint height,
+ const void *dataIn, void *dataOut,
+ GLint pixelSizeInBytes,
+ GLint rowSizeInBytes, GLint isSwap)
+{
+ /* handle case where there is only 1 column/row */
+ if (width == 1 || height == 1) {
+ assert(!(width == 1 && height == 1)); /* can't be 1x1 */
+ halve1DimagePackedPixel(components,extractPackedPixel,shovePackedPixel,
+ width,height,dataIn,dataOut,pixelSizeInBytes,
+ rowSizeInBytes,isSwap);
+ return;
+ }
+
+ {
+ int ii, jj;
+
+ int halfWidth= width / 2;
+ int halfHeight= height / 2;
+ const char *src= (const char *) dataIn;
+ int padBytes= rowSizeInBytes - (width*pixelSizeInBytes);
+ int outIndex= 0;
+
+ for (ii= 0; ii< halfHeight; ii++) {
+ for (jj= 0; jj< halfWidth; jj++) {
+#define BOX4 4
+ float totals[4]; /* 4 is maximum components */
+ float extractTotals[BOX4][4]; /* 4 is maximum components */
+ int cc;
+
+ (*extractPackedPixel)(isSwap,src,
+ &extractTotals[0][0]);
+ (*extractPackedPixel)(isSwap,(src+pixelSizeInBytes),
+ &extractTotals[1][0]);
+ (*extractPackedPixel)(isSwap,(src+rowSizeInBytes),
+ &extractTotals[2][0]);
+ (*extractPackedPixel)(isSwap,
+ (src+rowSizeInBytes+pixelSizeInBytes),
+ &extractTotals[3][0]);
+ for (cc = 0; cc < components; cc++) {
+ int kk;
+
+ /* grab 4 pixels to average */
+ totals[cc]= 0.0;
+ /* totals[RED]= extractTotals[0][RED]+extractTotals[1][RED]+
+ * extractTotals[2][RED]+extractTotals[3][RED];
+ * totals[RED]/= 4.0;
+ */
+ for (kk = 0; kk < BOX4; kk++) {
+ totals[cc]+= extractTotals[kk][cc];
+ }
+ totals[cc]/= (float)BOX4;
+ }
+ (*shovePackedPixel)(totals,outIndex,dataOut);
+
+ outIndex++;
+ /* skip over to next square of 4 */
+ src+= pixelSizeInBytes + pixelSizeInBytes;
+ }
+ /* skip past pad bytes, if any, to get to next row */
+ src+= padBytes;
+
+ /* src is at beginning of a row here, but it's the second row of
+ * the square block of 4 pixels that we just worked on so we
+ * need to go one more row.
+ * i.e.,
+ * OO...
+ * here -->OO...
+ * but want -->OO...
+ * OO...
+ * ...
+ */
+ src+= rowSizeInBytes;
+ }
+
+ /* both pointers must reach one byte after the end */
+ assert(src == &((const char *)dataIn)[rowSizeInBytes*height]);
+ assert(outIndex == halfWidth * halfHeight);
+ }
+} /* halveImagePackedPixel() */
+
+static void halve1DimagePackedPixel(int components,
+ void (*extractPackedPixel)
+ (int, const void *,GLfloat []),
+ void (*shovePackedPixel)
+ (const GLfloat [],int, void *),
+ GLint width, GLint height,
+ const void *dataIn, void *dataOut,
+ GLint pixelSizeInBytes,
+ GLint rowSizeInBytes, GLint isSwap)
+{
+ int halfWidth= width / 2;
+ int halfHeight= height / 2;
+ const char *src= (const char *) dataIn;
+ int jj;
+
+ assert(width == 1 || height == 1); /* must be 1D */
+ assert(width != height); /* can't be square */
+
+ if (height == 1) { /* 1 row */
+ int outIndex= 0;
+
+ assert(width != 1); /* widthxheight can't be 1x1 */
+ halfHeight= 1;
+
+ /* one horizontal row with possible pad bytes */
+
+ for (jj= 0; jj< halfWidth; jj++) {
+#define BOX2 2
+ float totals[4]; /* 4 is maximum components */
+ float extractTotals[BOX2][4]; /* 4 is maximum components */
+ int cc;
+
+ /* average two at a time, instead of four */
+ (*extractPackedPixel)(isSwap,src,
+ &extractTotals[0][0]);
+ (*extractPackedPixel)(isSwap,(src+pixelSizeInBytes),
+ &extractTotals[1][0]);
+ for (cc = 0; cc < components; cc++) {
+ int kk;
+
+ /* grab 2 pixels to average */
+ totals[cc]= 0.0;
+ /* totals[RED]= extractTotals[0][RED]+extractTotals[1][RED];
+ * totals[RED]/= 2.0;
+ */
+ for (kk = 0; kk < BOX2; kk++) {
+ totals[cc]+= extractTotals[kk][cc];
+ }
+ totals[cc]/= (float)BOX2;
+ }
+ (*shovePackedPixel)(totals,outIndex,dataOut);
+
+ outIndex++;
+ /* skip over to next group of 2 */
+ src+= pixelSizeInBytes + pixelSizeInBytes;
+ }
+
+ {
+ int padBytes= rowSizeInBytes - (width*pixelSizeInBytes);
+ src+= padBytes; /* for assertion only */
+ }
+ assert(src == &((const char *)dataIn)[rowSizeInBytes]);
+ assert(outIndex == halfWidth * halfHeight);
+ }
+ else if (width == 1) { /* 1 column */
+ int outIndex= 0;
+
+ assert(height != 1); /* widthxheight can't be 1x1 */
+ halfWidth= 1;
+ /* one vertical column with possible pad bytes per row */
+ /* average two at a time */
+
+ for (jj= 0; jj< halfHeight; jj++) {
+#define BOX2 2
+ float totals[4]; /* 4 is maximum components */
+ float extractTotals[BOX2][4]; /* 4 is maximum components */
+ int cc;
+
+ /* average two at a time, instead of four */
+ (*extractPackedPixel)(isSwap,src,
+ &extractTotals[0][0]);
+ (*extractPackedPixel)(isSwap,(src+rowSizeInBytes),
+ &extractTotals[1][0]);
+ for (cc = 0; cc < components; cc++) {
+ int kk;
+
+ /* grab 2 pixels to average */
+ totals[cc]= 0.0;
+ /* totals[RED]= extractTotals[0][RED]+extractTotals[1][RED];
+ * totals[RED]/= 2.0;
+ */
+ for (kk = 0; kk < BOX2; kk++) {
+ totals[cc]+= extractTotals[kk][cc];
+ }
+ totals[cc]/= (float)BOX2;
+ }
+ (*shovePackedPixel)(totals,outIndex,dataOut);
+
+ outIndex++;
+ src+= rowSizeInBytes + rowSizeInBytes; /* go to row after next */
+ }
+
+ assert(src == &((const char *)dataIn)[rowSizeInBytes*height]);
+ assert(outIndex == halfWidth * halfHeight);
+ }
+} /* halve1DimagePackedPixel() */
+
+/*===========================================================================*/
+
+#ifdef RESOLVE_3D_TEXTURE_SUPPORT
+/*
+ * This section ensures that GLU 1.3 will load and run on
+ * a GL 1.1 implementation. It dynamically resolves the
+ * call to glTexImage3D() which might not be available.
+ * Or is it might be supported as an extension.
+ * Contributed by Gerk Huisma <gerk@five-d.demon.nl>.
+ */
+
+typedef void (GLAPIENTRY *TexImage3Dproc)( GLenum target, GLint level,
+ GLenum internalFormat,
+ GLsizei width, GLsizei height,
+ GLsizei depth, GLint border,
+ GLenum format, GLenum type,
+ const GLvoid *pixels );
+
+static TexImage3Dproc pTexImage3D = 0;
+
+#if !defined(_WIN32) && !defined(__WIN32__)
+# include <dlfcn.h>
+# include <sys/types.h>
+#else
+ WINGDIAPI PROC WINAPI wglGetProcAddress(LPCSTR);
+#endif
+
+static void gluTexImage3D( GLenum target, GLint level,
+ GLenum internalFormat,
+ GLsizei width, GLsizei height,
+ GLsizei depth, GLint border,
+ GLenum format, GLenum type,
+ const GLvoid *pixels )
+{
+ if (!pTexImage3D) {
+#if defined(_WIN32) || defined(__WIN32__)
+ pTexImage3D = (TexImage3Dproc) wglGetProcAddress("glTexImage3D");
+ if (!pTexImage3D)
+ pTexImage3D = (TexImage3Dproc) wglGetProcAddress("glTexImage3DEXT");
+#else
+ void *libHandle = dlopen("libgl.so", RTLD_LAZY);
+ pTexImage3D = (TexImage3Dproc) dlsym(libHandle, "glTexImage3D" );
+ if (!pTexImage3D)
+ pTexImage3D = (TexImage3Dproc) dlsym(libHandle,"glTexImage3DEXT");
+ dlclose(libHandle);
+#endif
+ }
+
+ /* Now call glTexImage3D */
+ if (pTexImage3D)
+ pTexImage3D(target, level, internalFormat, width, height,
+ depth, border, format, type, pixels);
+}
+
+#else
+
+/* Only bind to a GL 1.2 implementation: */
+#define gluTexImage3D glTexImage3D
+
+#endif
+
+static GLint imageSize3D(GLint width, GLint height, GLint depth,
+ GLenum format, GLenum type)
+{
+ int components= elements_per_group(format,type);
+ int bytes_per_row= bytes_per_element(type) * width;
+
+assert(width > 0 && height > 0 && depth > 0);
+assert(type != GL_BITMAP);
+
+ return bytes_per_row * height * depth * components;
+} /* imageSize3D() */
+
+static void fillImage3D(const PixelStorageModes *psm,
+ GLint width, GLint height, GLint depth, GLenum format,
+ GLenum type, GLboolean indexFormat,
+ const void *userImage, GLushort *newImage)
+{
+ int myswapBytes;
+ int components;
+ int groupsPerLine;
+ int elementSize;
+ int groupSize;
+ int rowSize;
+ int padding;
+ int elementsPerLine;
+ int rowsPerImage;
+ int imageSize;
+ const GLubyte *start, *rowStart, *iter;
+ GLushort *iter2;
+ int ww, hh, dd, k;
+
+ myswapBytes= psm->unpack_swap_bytes;
+ components= elements_per_group(format,type);
+ if (psm->unpack_row_length > 0) {
+ groupsPerLine= psm->unpack_row_length;
+ }
+ else {
+ groupsPerLine= width;
+ }
+ elementSize= bytes_per_element(type);
+ groupSize= elementSize * components;
+ if (elementSize == 1) myswapBytes= 0;
+
+ /* 3dstuff begin */
+ if (psm->unpack_image_height > 0) {
+ rowsPerImage= psm->unpack_image_height;
+ }
+ else {
+ rowsPerImage= height;
+ }
+ /* 3dstuff end */
+
+ rowSize= groupsPerLine * groupSize;
+ padding= rowSize % psm->unpack_alignment;
+ if (padding) {
+ rowSize+= psm->unpack_alignment - padding;
+ }
+
+ imageSize= rowsPerImage * rowSize; /* 3dstuff */
+
+ start= (const GLubyte *)userImage + psm->unpack_skip_rows * rowSize +
+ psm->unpack_skip_pixels * groupSize +
+ /*3dstuff*/
+ psm->unpack_skip_images * imageSize;
+ elementsPerLine = width * components;
+
+ iter2= newImage;
+ for (dd= 0; dd < depth; dd++) {
+ rowStart= start;
+
+ for (hh= 0; hh < height; hh++) {
+ iter= rowStart;
+
+ for (ww= 0; ww < elementsPerLine; ww++) {
+ Type_Widget widget;
+ float extractComponents[4];
+
+ switch(type) {
+ case GL_UNSIGNED_BYTE:
+ if (indexFormat) {
+ *iter2++ = *iter;
+ } else {
+ *iter2++ = (*iter) * 257;
+ }
+ break;
+ case GL_BYTE:
+ if (indexFormat) {
+ *iter2++ = *((const GLbyte *) iter);
+ } else {
+ /* rough approx */
+ *iter2++ = (*((const GLbyte *) iter)) * 516;
+ }
+ break;
+ case GL_UNSIGNED_BYTE_3_3_2:
+ extract332(0,iter,extractComponents);
+ for (k = 0; k < 3; k++) {
+ *iter2++ = (GLushort)(extractComponents[k]*65535);
+ }
+ break;
+ case GL_UNSIGNED_BYTE_2_3_3_REV:
+ extract233rev(0,iter,extractComponents);
+ for (k = 0; k < 3; k++) {
+ *iter2++ = (GLushort)(extractComponents[k]*65535);
+ }
+ break;
+ case GL_UNSIGNED_SHORT_5_6_5:
+ extract565(myswapBytes,iter,extractComponents);
+ for (k = 0; k < 3; k++) {
+ *iter2++ = (GLushort)(extractComponents[k]*65535);
+ }
+ break;
+ case GL_UNSIGNED_SHORT_5_6_5_REV:
+ extract565rev(myswapBytes,iter,extractComponents);
+ for (k = 0; k < 3; k++) {
+ *iter2++ = (GLushort)(extractComponents[k]*65535);
+ }
+ break;
+ case GL_UNSIGNED_SHORT_4_4_4_4:
+ extract4444(myswapBytes,iter,extractComponents);
+ for (k = 0; k < 4; k++) {
+ *iter2++ = (GLushort)(extractComponents[k]*65535);
+ }
+ break;
+ case GL_UNSIGNED_SHORT_4_4_4_4_REV:
+ extract4444rev(myswapBytes,iter,extractComponents);
+ for (k = 0; k < 4; k++) {
+ *iter2++ = (GLushort)(extractComponents[k]*65535);
+ }
+ break;
+ case GL_UNSIGNED_SHORT_5_5_5_1:
+ extract5551(myswapBytes,iter,extractComponents);
+ for (k = 0; k < 4; k++) {
+ *iter2++ = (GLushort)(extractComponents[k]*65535);
+ }
+ break;
+ case GL_UNSIGNED_SHORT_1_5_5_5_REV:
+ extract1555rev(myswapBytes,iter,extractComponents);
+ for (k = 0; k < 4; k++) {
+ *iter2++ = (GLushort)(extractComponents[k]*65535);
+ }
+ break;
+ case GL_UNSIGNED_SHORT:
+ case GL_SHORT:
+ if (myswapBytes) {
+ widget.ub[0] = iter[1];
+ widget.ub[1] = iter[0];
+ } else {
+ widget.ub[0] = iter[0];
+ widget.ub[1] = iter[1];
+ }
+ if (type == GL_SHORT) {
+ if (indexFormat) {
+ *iter2++ = widget.s[0];
+ } else {
+ /* rough approx */
+ *iter2++ = widget.s[0]*2;
+ }
+ } else {
+ *iter2++ = widget.us[0];
+ }
+ break;
+ case GL_UNSIGNED_INT_8_8_8_8:
+ extract8888(myswapBytes,iter,extractComponents);
+ for (k = 0; k < 4; k++) {
+ *iter2++ = (GLushort)(extractComponents[k]*65535);
+ }
+ break;
+ case GL_UNSIGNED_INT_8_8_8_8_REV:
+ extract8888rev(myswapBytes,iter,extractComponents);
+ for (k = 0; k < 4; k++) {
+ *iter2++ = (GLushort)(extractComponents[k]*65535);
+ }
+ break;
+ case GL_UNSIGNED_INT_10_10_10_2:
+ extract1010102(myswapBytes,iter,extractComponents);
+ for (k = 0; k < 4; k++) {
+ *iter2++ = (GLushort)(extractComponents[k]*65535);
+ }
+ break;
+ case GL_UNSIGNED_INT_2_10_10_10_REV:
+ extract2101010rev(myswapBytes,iter,extractComponents);
+ for (k = 0; k < 4; k++) {
+ *iter2++ = (GLushort)(extractComponents[k]*65535);
+ }
+ break;
+ case GL_INT:
+ case GL_UNSIGNED_INT:
+ case GL_FLOAT:
+ if (myswapBytes) {
+ widget.ub[0] = iter[3];
+ widget.ub[1] = iter[2];
+ widget.ub[2] = iter[1];
+ widget.ub[3] = iter[0];
+ } else {
+ widget.ub[0] = iter[0];
+ widget.ub[1] = iter[1];
+ widget.ub[2] = iter[2];
+ widget.ub[3] = iter[3];
+ }
+ if (type == GL_FLOAT) {
+ if (indexFormat) {
+ *iter2++ = widget.f;
+ } else {
+ *iter2++ = 65535 * widget.f;
+ }
+ } else if (type == GL_UNSIGNED_INT) {
+ if (indexFormat) {
+ *iter2++ = widget.ui;
+ } else {
+ *iter2++ = widget.ui >> 16;
+ }
+ } else {
+ if (indexFormat) {
+ *iter2++ = widget.i;
+ } else {
+ *iter2++ = widget.i >> 15;
+ }
+ }
+ break;
+ default:
+ assert(0);
+ }
+
+ iter+= elementSize;
+ } /* for ww */
+ rowStart+= rowSize;
+
+ iter= rowStart; /* for assertion purposes */
+ } /* for hh */
+
+ start+= imageSize;
+ } /* for dd */
+
+ /* iterators should be one byte past end */
+ if (!isTypePackedPixel(type)) {
+ assert(iter2 == &newImage[width*height*depth*components]);
+ }
+ else {
+ assert(iter2 == &newImage[width*height*depth*
+ elements_per_group(format,0)]);
+ }
+ assert( iter == &((const GLubyte *)userImage)[rowSize*height*depth +
+ psm->unpack_skip_rows * rowSize +
+ psm->unpack_skip_pixels * groupSize +
+ /*3dstuff*/
+ psm->unpack_skip_images * imageSize] );
+} /* fillImage3D () */
+
+static void scaleInternal3D(GLint components,
+ GLint widthIn, GLint heightIn, GLint depthIn,
+ const GLushort *dataIn,
+ GLint widthOut, GLint heightOut, GLint depthOut,
+ GLushort *dataOut)
+{
+ float x, lowx, highx, convx, halfconvx;
+ float y, lowy, highy, convy, halfconvy;
+ float z, lowz, highz, convz, halfconvz;
+ float xpercent,ypercent,zpercent;
+ float percent;
+ /* Max components in a format is 4, so... */
+ float totals[4];
+ float volume;
+ int i,j,d,k,zint,yint,xint,xindex,yindex,zindex;
+ int temp;
+
+ convz = (float) depthIn/depthOut;
+ convy = (float) heightIn/heightOut;
+ convx = (float) widthIn/widthOut;
+ halfconvx = convx/2;
+ halfconvy = convy/2;
+ halfconvz = convz/2;
+ for (d = 0; d < depthOut; d++) {
+ z = convz * (d+0.5);
+ if (depthIn > depthOut) {
+ highz = z + halfconvz;
+ lowz = z - halfconvz;
+ } else {
+ highz = z + 0.5;
+ lowz = z - 0.5;
+ }
+ for (i = 0; i < heightOut; i++) {
+ y = convy * (i+0.5);
+ if (heightIn > heightOut) {
+ highy = y + halfconvy;
+ lowy = y - halfconvy;
+ } else {
+ highy = y + 0.5;
+ lowy = y - 0.5;
+ }
+ for (j = 0; j < widthOut; j++) {
+ x = convx * (j+0.5);
+ if (widthIn > widthOut) {
+ highx = x + halfconvx;
+ lowx = x - halfconvx;
+ } else {
+ highx = x + 0.5;
+ lowx = x - 0.5;
+ }
+
+ /*
+ ** Ok, now apply box filter to box that goes from (lowx, lowy,
+ ** lowz) to (highx, highy, highz) on input data into this pixel
+ ** on output data.
+ */
+ totals[0] = totals[1] = totals[2] = totals[3] = 0.0;
+ volume = 0.0;
+
+ z = lowz;
+ zint = floor(z);
+ while (z < highz) {
+ zindex = (zint + depthIn) % depthIn;
+ if (highz < zint+1) {
+ zpercent = highz - z;
+ } else {
+ zpercent = zint+1 - z;
+ }
+
+ y = lowy;
+ yint = floor(y);
+ while (y < highy) {
+ yindex = (yint + heightIn) % heightIn;
+ if (highy < yint+1) {
+ ypercent = highy - y;
+ } else {
+ ypercent = yint+1 - y;
+ }
+
+ x = lowx;
+ xint = floor(x);
+
+ while (x < highx) {
+ xindex = (xint + widthIn) % widthIn;
+ if (highx < xint+1) {
+ xpercent = highx - x;
+ } else {
+ xpercent = xint+1 - x;
+ }
+
+ percent = xpercent * ypercent * zpercent;
+ volume += percent;
+
+ temp = (xindex + (yindex*widthIn) +
+ (zindex*widthIn*heightIn)) * components;
+ for (k = 0; k < components; k++) {
+ assert(0 <= (temp+k) &&
+ (temp+k) <
+ (widthIn*heightIn*depthIn*components));
+ totals[k] += dataIn[temp + k] * percent;
+ }
+
+ xint++;
+ x = xint;
+ } /* while x */
+
+ yint++;
+ y = yint;
+ } /* while y */
+
+ zint++;
+ z = zint;
+ } /* while z */
+
+ temp = (j + (i * widthOut) +
+ (d*widthOut*heightOut)) * components;
+ for (k = 0; k < components; k++) {
+ /* totals[] should be rounded in the case of enlarging an
+ * RGB ramp when the type is 332 or 4444
+ */
+ assert(0 <= (temp+k) &&
+ (temp+k) < (widthOut*heightOut*depthOut*components));
+ dataOut[temp + k] = (totals[k]+0.5)/volume;
+ }
+ } /* for j */
+ } /* for i */
+ } /* for d */
+} /* scaleInternal3D() */
+
+static void emptyImage3D(const PixelStorageModes *psm,
+ GLint width, GLint height, GLint depth,
+ GLenum format, GLenum type, GLboolean indexFormat,
+ const GLushort *oldImage, void *userImage)
+{
+ int myswapBytes;
+ int components;
+ int groupsPerLine;
+ int elementSize;
+ int groupSize;
+ int rowSize;
+ int padding;
+ GLubyte *start, *rowStart, *iter;
+ int elementsPerLine;
+ const GLushort *iter2;
+ int ii, jj, dd, k;
+ int rowsPerImage;
+ int imageSize;
+
+ myswapBytes= psm->pack_swap_bytes;
+ components = elements_per_group(format,type);
+ if (psm->pack_row_length > 0) {
+ groupsPerLine = psm->pack_row_length;
+ }
+ else {
+ groupsPerLine = width;
+ }
+
+ elementSize= bytes_per_element(type);
+ groupSize= elementSize * components;
+ if (elementSize == 1) myswapBytes= 0;
+
+ /* 3dstuff begin */
+ if (psm->pack_image_height > 0) {
+ rowsPerImage= psm->pack_image_height;
+ }
+ else {
+ rowsPerImage= height;
+ }
+
+ /* 3dstuff end */
+
+ rowSize = groupsPerLine * groupSize;
+ padding = rowSize % psm->pack_alignment;
+ if (padding) {
+ rowSize+= psm->pack_alignment - padding;
+ }
+
+ imageSize= rowsPerImage * rowSize; /* 3dstuff */
+
+ start = (GLubyte *)userImage + psm->pack_skip_rows * rowSize +
+ psm->pack_skip_pixels * groupSize +
+ /*3dstuff*/
+ psm->pack_skip_images * imageSize;
+ elementsPerLine= width * components;
+
+ iter2 = oldImage;
+ for (dd= 0; dd < depth; dd++) {
+ rowStart= start;
+
+ for (ii= 0; ii< height; ii++) {
+ iter = rowStart;
+
+ for (jj = 0; jj < elementsPerLine; jj++) {
+ Type_Widget widget;
+ float shoveComponents[4];
+
+ switch(type){
+ case GL_UNSIGNED_BYTE:
+ if (indexFormat) {
+ *iter = *iter2++;
+ } else {
+ *iter = *iter2++ >> 8;
+ }
+ break;
+ case GL_BYTE:
+ if (indexFormat) {
+ *((GLbyte *) iter) = *iter2++;
+ } else {
+ *((GLbyte *) iter) = *iter2++ >> 9;
+ }
+ break;
+ case GL_UNSIGNED_BYTE_3_3_2:
+ for (k = 0; k < 3; k++) {
+ shoveComponents[k]= *iter2++ / 65535.0;
+ }
+ shove332(shoveComponents,0,(void *)iter);
+ break;
+ case GL_UNSIGNED_BYTE_2_3_3_REV:
+ for (k = 0; k < 3; k++) {
+ shoveComponents[k]= *iter2++ / 65535.0;
+ }
+ shove233rev(shoveComponents,0,(void *)iter);
+ break;
+ case GL_UNSIGNED_SHORT_5_6_5:
+ for (k = 0; k < 3; k++) {
+ shoveComponents[k]= *iter2++ / 65535.0;
+ }
+ shove565(shoveComponents,0,(void *)&widget.us[0]);
+ if (myswapBytes) {
+ iter[0] = widget.ub[1];
+ iter[1] = widget.ub[0];
+ }
+ else {
+ *(GLushort *)iter = widget.us[0];
+ }
+ break;
+ case GL_UNSIGNED_SHORT_5_6_5_REV:
+ for (k = 0; k < 3; k++) {
+ shoveComponents[k]= *iter2++ / 65535.0;
+ }
+ shove565rev(shoveComponents,0,(void *)&widget.us[0]);
+ if (myswapBytes) {
+ iter[0] = widget.ub[1];
+ iter[1] = widget.ub[0];
+ }
+ else {
+ *(GLushort *)iter = widget.us[0];
+ }
+ break;
+ case GL_UNSIGNED_SHORT_4_4_4_4:
+ for (k = 0; k < 4; k++) {
+ shoveComponents[k]= *iter2++ / 65535.0;
+ }
+ shove4444(shoveComponents,0,(void *)&widget.us[0]);
+ if (myswapBytes) {
+ iter[0] = widget.ub[1];
+ iter[1] = widget.ub[0];
+ } else {
+ *(GLushort *)iter = widget.us[0];
+ }
+ break;
+ case GL_UNSIGNED_SHORT_4_4_4_4_REV:
+ for (k = 0; k < 4; k++) {
+ shoveComponents[k]= *iter2++ / 65535.0;
+ }
+ shove4444rev(shoveComponents,0,(void *)&widget.us[0]);
+ if (myswapBytes) {
+ iter[0] = widget.ub[1];
+ iter[1] = widget.ub[0];
+ } else {
+ *(GLushort *)iter = widget.us[0];
+ }
+ break;
+ case GL_UNSIGNED_SHORT_5_5_5_1:
+ for (k = 0; k < 4; k++) {
+ shoveComponents[k]= *iter2++ / 65535.0;
+ }
+ shove5551(shoveComponents,0,(void *)&widget.us[0]);
+ if (myswapBytes) {
+ iter[0] = widget.ub[1];
+ iter[1] = widget.ub[0];
+ } else {
+ *(GLushort *)iter = widget.us[0];
+ }
+ break;
+ case GL_UNSIGNED_SHORT_1_5_5_5_REV:
+ for (k = 0; k < 4; k++) {
+ shoveComponents[k]= *iter2++ / 65535.0;
+ }
+ shove1555rev(shoveComponents,0,(void *)&widget.us[0]);
+ if (myswapBytes) {
+ iter[0] = widget.ub[1];
+ iter[1] = widget.ub[0];
+ } else {
+ *(GLushort *)iter = widget.us[0];
+ }
+ break;
+ case GL_UNSIGNED_SHORT:
+ case GL_SHORT:
+ if (type == GL_SHORT) {
+ if (indexFormat) {
+ widget.s[0] = *iter2++;
+ } else {
+ widget.s[0] = *iter2++ >> 1;
+ }
+ } else {
+ widget.us[0] = *iter2++;
+ }
+ if (myswapBytes) {
+ iter[0] = widget.ub[1];
+ iter[1] = widget.ub[0];
+ } else {
+ iter[0] = widget.ub[0];
+ iter[1] = widget.ub[1];
+ }
+ break;
+ case GL_UNSIGNED_INT_8_8_8_8:
+ for (k = 0; k < 4; k++) {
+ shoveComponents[k]= *iter2++ / 65535.0;
+ }
+ shove8888(shoveComponents,0,(void *)&widget.ui);
+ if (myswapBytes) {
+ iter[3] = widget.ub[0];
+ iter[2] = widget.ub[1];
+ iter[1] = widget.ub[2];
+ iter[0] = widget.ub[3];
+ } else {
+ *(GLuint *)iter= widget.ui;
+ }
+ break;
+ case GL_UNSIGNED_INT_8_8_8_8_REV:
+ for (k = 0; k < 4; k++) {
+ shoveComponents[k]= *iter2++ / 65535.0;
+ }
+ shove8888rev(shoveComponents,0,(void *)&widget.ui);
+ if (myswapBytes) {
+ iter[3] = widget.ub[0];
+ iter[2] = widget.ub[1];
+ iter[1] = widget.ub[2];
+ iter[0] = widget.ub[3];
+ } else {
+ *(GLuint *)iter= widget.ui;
+ }
+ break;
+ case GL_UNSIGNED_INT_10_10_10_2:
+ for (k = 0; k < 4; k++) {
+ shoveComponents[k]= *iter2++ / 65535.0;
+ }
+ shove1010102(shoveComponents,0,(void *)&widget.ui);
+ if (myswapBytes) {
+ iter[3] = widget.ub[0];
+ iter[2] = widget.ub[1];
+ iter[1] = widget.ub[2];
+ iter[0] = widget.ub[3];
+ } else {
+ *(GLuint *)iter= widget.ui;
+ }
+ break;
+ case GL_UNSIGNED_INT_2_10_10_10_REV:
+ for (k = 0; k < 4; k++) {
+ shoveComponents[k]= *iter2++ / 65535.0;
+ }
+ shove2101010rev(shoveComponents,0,(void *)&widget.ui);
+ if (myswapBytes) {
+ iter[3] = widget.ub[0];
+ iter[2] = widget.ub[1];
+ iter[1] = widget.ub[2];
+ iter[0] = widget.ub[3];
+ } else {
+ *(GLuint *)iter= widget.ui;
+ }
+ break;
+ case GL_INT:
+ case GL_UNSIGNED_INT:
+ case GL_FLOAT:
+ if (type == GL_FLOAT) {
+ if (indexFormat) {
+ widget.f = *iter2++;
+ } else {
+ widget.f = *iter2++ / (float) 65535.0;
+ }
+ } else if (type == GL_UNSIGNED_INT) {
+ if (indexFormat) {
+ widget.ui = *iter2++;
+ } else {
+ widget.ui = (unsigned int) *iter2++ * 65537;
+ }
+ } else {
+ if (indexFormat) {
+ widget.i = *iter2++;
+ } else {
+ widget.i = ((unsigned int) *iter2++ * 65537)/2;
+ }
+ }
+ if (myswapBytes) {
+ iter[3] = widget.ub[0];
+ iter[2] = widget.ub[1];
+ iter[1] = widget.ub[2];
+ iter[0] = widget.ub[3];
+ } else {
+ iter[0] = widget.ub[0];
+ iter[1] = widget.ub[1];
+ iter[2] = widget.ub[2];
+ iter[3] = widget.ub[3];
+ }
+ break;
+ default:
+ assert(0);
+ }
+
+ iter+= elementSize;
+ } /* for jj */
+
+ rowStart+= rowSize;
+ } /* for ii */
+
+ start+= imageSize;
+ } /* for dd */
+
+ /* iterators should be one byte past end */
+ if (!isTypePackedPixel(type)) {
+ assert(iter2 == &oldImage[width*height*depth*components]);
+ }
+ else {
+ assert(iter2 == &oldImage[width*height*depth*
+ elements_per_group(format,0)]);
+ }
+ assert( iter == &((GLubyte *)userImage)[rowSize*height*depth +
+ psm->unpack_skip_rows * rowSize +
+ psm->unpack_skip_pixels * groupSize +
+ /*3dstuff*/
+ psm->unpack_skip_images * imageSize] );
+} /* emptyImage3D() */
+
+static
+int gluScaleImage3D(GLenum format,
+ GLint widthIn, GLint heightIn, GLint depthIn,
+ GLenum typeIn, const void *dataIn,
+ GLint widthOut, GLint heightOut, GLint depthOut,
+ GLenum typeOut, void *dataOut)
+{
+ int components;
+ GLushort *beforeImage, *afterImage;
+ PixelStorageModes psm;
+
+ if (widthIn == 0 || heightIn == 0 || depthIn == 0 ||
+ widthOut == 0 || heightOut == 0 || depthOut == 0) {
+ return 0;
+ }
+
+ if (widthIn < 0 || heightIn < 0 || depthIn < 0 ||
+ widthOut < 0 || heightOut < 0 || depthOut < 0) {
+ return GLU_INVALID_VALUE;
+ }
+
+ if (!legalFormat(format) || !legalType(typeIn) || !legalType(typeOut) ||
+ typeIn == GL_BITMAP || typeOut == GL_BITMAP) {
+ return GLU_INVALID_ENUM;
+ }
+ if (!isLegalFormatForPackedPixelType(format, typeIn)) {
+ return GLU_INVALID_OPERATION;
+ }
+ if (!isLegalFormatForPackedPixelType(format, typeOut)) {
+ return GLU_INVALID_OPERATION;
+ }
+
+ beforeImage = malloc(imageSize3D(widthIn, heightIn, depthIn, format,
+ GL_UNSIGNED_SHORT));
+ afterImage = malloc(imageSize3D(widthOut, heightOut, depthOut, format,
+ GL_UNSIGNED_SHORT));
+ if (beforeImage == NULL || afterImage == NULL) {
+ free(beforeImage);
+ free(afterImage);
+ return GLU_OUT_OF_MEMORY;
+ }
+ retrieveStoreModes3D(&psm);
+
+ fillImage3D(&psm,widthIn,heightIn,depthIn,format,typeIn, is_index(format),
+ dataIn, beforeImage);
+ components = elements_per_group(format,0);
+ scaleInternal3D(components,widthIn,heightIn,depthIn,beforeImage,
+ widthOut,heightOut,depthOut,afterImage);
+ emptyImage3D(&psm,widthOut,heightOut,depthOut,format,typeOut,
+ is_index(format),afterImage, dataOut);
+ free((void *) beforeImage);
+ free((void *) afterImage);
+
+ return 0;
+} /* gluScaleImage3D() */
+
+
+static void closestFit3D(GLenum target, GLint width, GLint height, GLint depth,
+ GLint internalFormat, GLenum format, GLenum type,
+ GLint *newWidth, GLint *newHeight, GLint *newDepth)
+{
+ GLint widthPowerOf2= nearestPower(width);
+ GLint heightPowerOf2= nearestPower(height);
+ GLint depthPowerOf2= nearestPower(depth);
+ GLint proxyWidth;
+
+ do {
+ /* compute level 1 width & height & depth, clamping each at 1 */
+ GLint widthAtLevelOne= (widthPowerOf2 > 1) ?
+ widthPowerOf2 >> 1 :
+ widthPowerOf2;
+ GLint heightAtLevelOne= (heightPowerOf2 > 1) ?
+ heightPowerOf2 >> 1 :
+ heightPowerOf2;
+ GLint depthAtLevelOne= (depthPowerOf2 > 1) ?
+ depthPowerOf2 >> 1 :
+ depthPowerOf2;
+ GLenum proxyTarget = GL_PROXY_TEXTURE_3D;
+ assert(widthAtLevelOne > 0);
+ assert(heightAtLevelOne > 0);
+ assert(depthAtLevelOne > 0);
+
+ /* does width x height x depth at level 1 & all their mipmaps fit? */
+ assert(target == GL_TEXTURE_3D || target == GL_PROXY_TEXTURE_3D);
+ gluTexImage3D(proxyTarget, 1, /* must be non-zero */
+ internalFormat,
+ widthAtLevelOne,heightAtLevelOne,depthAtLevelOne,
+ 0,format,type,NULL);
+ glGetTexLevelParameteriv(proxyTarget, 1,GL_TEXTURE_WIDTH,&proxyWidth);
+ /* does it fit??? */
+ if (proxyWidth == 0) { /* nope, so try again with these sizes */
+ if (widthPowerOf2 == 1 && heightPowerOf2 == 1 &&
+ depthPowerOf2 == 1) {
+ *newWidth= *newHeight= *newDepth= 1; /* must fit 1x1x1 texture */
+ return;
+ }
+ widthPowerOf2= widthAtLevelOne;
+ heightPowerOf2= heightAtLevelOne;
+ depthPowerOf2= depthAtLevelOne;
+ }
+ /* else it does fit */
+ } while (proxyWidth == 0);
+ /* loop must terminate! */
+
+ /* return the width & height at level 0 that fits */
+ *newWidth= widthPowerOf2;
+ *newHeight= heightPowerOf2;
+ *newDepth= depthPowerOf2;
+/*printf("Proxy Textures\n");*/
+} /* closestFit3D() */
+
+static void halveImagePackedPixelSlice(int components,
+ void (*extractPackedPixel)
+ (int, const void *,GLfloat []),
+ void (*shovePackedPixel)
+ (const GLfloat [],int, void *),
+ GLint width, GLint height, GLint depth,
+ const void *dataIn, void *dataOut,
+ GLint pixelSizeInBytes,
+ GLint rowSizeInBytes,
+ GLint imageSizeInBytes,
+ GLint isSwap)
+{
+ int ii, jj;
+ int halfWidth= width / 2;
+ int halfHeight= height / 2;
+ int halfDepth= depth / 2;
+ const char *src= (const char *)dataIn;
+ int outIndex= 0;
+
+ assert((width == 1 || height == 1) && depth >= 2);
+
+ if (width == height) { /* a 1-pixel column viewed from top */
+ assert(width == 1 && height == 1);
+ assert(depth >= 2);
+
+ for (ii= 0; ii< halfDepth; ii++) {
+ float totals[4];
+ float extractTotals[BOX2][4];
+ int cc;
+
+ (*extractPackedPixel)(isSwap,src,&extractTotals[0][0]);
+ (*extractPackedPixel)(isSwap,(src+imageSizeInBytes),
+ &extractTotals[1][0]);
+ for (cc = 0; cc < components; cc++) {
+ int kk;
+
+ /* average 2 pixels since only a column */
+ totals[cc]= 0.0;
+ /* totals[RED]= extractTotals[0][RED]+extractTotals[1][RED];
+ * totals[RED]/= 2.0;
+ */
+ for (kk = 0; kk < BOX2; kk++) {
+ totals[cc]+= extractTotals[kk][cc];
+ }
+ totals[cc]/= (float)BOX2;
+ } /* for cc */
+
+ (*shovePackedPixel)(totals,outIndex,dataOut);
+ outIndex++;
+ /* skip over to next group of 2 */
+ src+= imageSizeInBytes + imageSizeInBytes;
+ } /* for ii */
+ }
+ else if (height == 1) { /* horizontal slice viewed from top */
+ assert(width != 1);
+
+ for (ii= 0; ii< halfDepth; ii++) {
+ for (jj= 0; jj< halfWidth; jj++) {
+ float totals[4];
+ float extractTotals[BOX4][4];
+ int cc;
+
+ (*extractPackedPixel)(isSwap,src,
+ &extractTotals[0][0]);
+ (*extractPackedPixel)(isSwap,(src+pixelSizeInBytes),
+ &extractTotals[1][0]);
+ (*extractPackedPixel)(isSwap,(src+imageSizeInBytes),
+ &extractTotals[2][0]);
+ (*extractPackedPixel)(isSwap,
+ (src+imageSizeInBytes+pixelSizeInBytes),
+ &extractTotals[3][0]);
+ for (cc = 0; cc < components; cc++) {
+ int kk;
+
+ /* grab 4 pixels to average */
+ totals[cc]= 0.0;
+ /* totals[RED]= extractTotals[0][RED]+extractTotals[1][RED]+
+ * extractTotals[2][RED]+extractTotals[3][RED];
+ * totals[RED]/= 4.0;
+ */
+ for (kk = 0; kk < BOX4; kk++) {
+ totals[cc]+= extractTotals[kk][cc];
+ }
+ totals[cc]/= (float)BOX4;
+ }
+ (*shovePackedPixel)(totals,outIndex,dataOut);
+
+ outIndex++;
+ /* skip over to next horizontal square of 4 */
+ src+= imageSizeInBytes + imageSizeInBytes;
+ }
+ }
+
+ /* assert() */
+ }
+ else if (width == 1) { /* vertical slice viewed from top */
+ assert(height != 1);
+
+ for (ii= 0; ii< halfDepth; ii++) {
+ for (jj= 0; jj< halfHeight; jj++) {
+ float totals[4];
+ float extractTotals[BOX4][4];
+ int cc;
+
+ (*extractPackedPixel)(isSwap,src,
+ &extractTotals[0][0]);
+ (*extractPackedPixel)(isSwap,(src+rowSizeInBytes),
+ &extractTotals[1][0]);
+ (*extractPackedPixel)(isSwap,(src+imageSizeInBytes),
+ &extractTotals[2][0]);
+ (*extractPackedPixel)(isSwap,
+ (src+imageSizeInBytes+rowSizeInBytes),
+ &extractTotals[3][0]);
+ for (cc = 0; cc < components; cc++) {
+ int kk;
+
+ /* grab 4 pixels to average */
+ totals[cc]= 0.0;
+ /* totals[RED]= extractTotals[0][RED]+extractTotals[1][RED]+
+ * extractTotals[2][RED]+extractTotals[3][RED];
+ * totals[RED]/= 4.0;
+ */
+ for (kk = 0; kk < BOX4; kk++) {
+ totals[cc]+= extractTotals[kk][cc];
+ }
+ totals[cc]/= (float)BOX4;
+ }
+ (*shovePackedPixel)(totals,outIndex,dataOut);
+
+ outIndex++;
+
+ /* skip over to next vertical square of 4 */
+ src+= imageSizeInBytes + imageSizeInBytes;
+ }
+ }
+ /* assert() */
+ }
+
+} /* halveImagePackedPixelSlice() */
+
+static void halveImagePackedPixel3D(int components,
+ void (*extractPackedPixel)
+ (int, const void *,GLfloat []),
+ void (*shovePackedPixel)
+ (const GLfloat [],int, void *),
+ GLint width, GLint height, GLint depth,
+ const void *dataIn, void *dataOut,
+ GLint pixelSizeInBytes,
+ GLint rowSizeInBytes,
+ GLint imageSizeInBytes,
+ GLint isSwap)
+{
+ if (depth == 1) {
+ assert(1 <= width && 1 <= height);
+
+ halveImagePackedPixel(components,extractPackedPixel,shovePackedPixel,
+ width,height,dataIn,dataOut,pixelSizeInBytes,
+ rowSizeInBytes,isSwap);
+ return;
+ }
+ /* a horizontal or vertical slice viewed from top */
+ else if (width == 1 || height == 1) {
+ assert(1 <= depth);
+
+ halveImagePackedPixelSlice(components,
+ extractPackedPixel,shovePackedPixel,
+ width, height, depth, dataIn, dataOut,
+ pixelSizeInBytes, rowSizeInBytes,
+ imageSizeInBytes, isSwap);
+ return;
+ }
+ {
+ int ii, jj, dd;
+
+ int halfWidth= width / 2;
+ int halfHeight= height / 2;
+ int halfDepth= depth / 2;
+ const char *src= (const char *) dataIn;
+ int padBytes= rowSizeInBytes - (width*pixelSizeInBytes);
+ int outIndex= 0;
+
+ for (dd= 0; dd < halfDepth; dd++) {
+ for (ii= 0; ii< halfHeight; ii++) {
+ for (jj= 0; jj< halfWidth; jj++) {
+#define BOX8 8
+ float totals[4]; /* 4 is maximum components */
+ float extractTotals[BOX8][4]; /* 4 is maximum components */
+ int cc;
+
+ (*extractPackedPixel)(isSwap,src,
+ &extractTotals[0][0]);
+ (*extractPackedPixel)(isSwap,(src+pixelSizeInBytes),
+ &extractTotals[1][0]);
+ (*extractPackedPixel)(isSwap,(src+rowSizeInBytes),
+ &extractTotals[2][0]);
+ (*extractPackedPixel)(isSwap,
+ (src+rowSizeInBytes+pixelSizeInBytes),
+ &extractTotals[3][0]);
+
+ (*extractPackedPixel)(isSwap,(src+imageSizeInBytes),
+ &extractTotals[4][0]);
+ (*extractPackedPixel)(isSwap,(src+pixelSizeInBytes+imageSizeInBytes),
+ &extractTotals[5][0]);
+ (*extractPackedPixel)(isSwap,(src+rowSizeInBytes+imageSizeInBytes),
+ &extractTotals[6][0]);
+ (*extractPackedPixel)(isSwap,
+ (src+rowSizeInBytes+pixelSizeInBytes+imageSizeInBytes),
+ &extractTotals[7][0]);
+ for (cc = 0; cc < components; cc++) {
+ int kk;
+
+ /* grab 8 pixels to average */
+ totals[cc]= 0.0;
+ /* totals[RED]= extractTotals[0][RED]+extractTotals[1][RED]+
+ * extractTotals[2][RED]+extractTotals[3][RED]+
+ * extractTotals[4][RED]+extractTotals[5][RED]+
+ * extractTotals[6][RED]+extractTotals[7][RED];
+ * totals[RED]/= 8.0;
+ */
+ for (kk = 0; kk < BOX8; kk++) {
+ totals[cc]+= extractTotals[kk][cc];
+ }
+ totals[cc]/= (float)BOX8;
+ }
+ (*shovePackedPixel)(totals,outIndex,dataOut);
+
+ outIndex++;
+ /* skip over to next square of 4 */
+ src+= pixelSizeInBytes + pixelSizeInBytes;
+ }
+ /* skip past pad bytes, if any, to get to next row */
+ src+= padBytes;
+
+ /* src is at beginning of a row here, but it's the second row of
+ * the square block of 4 pixels that we just worked on so we
+ * need to go one more row.
+ * i.e.,
+ * OO...
+ * here -->OO...
+ * but want -->OO...
+ * OO...
+ * ...
+ */
+ src+= rowSizeInBytes;
+ }
+
+ src+= imageSizeInBytes;
+ } /* for dd */
+
+ /* both pointers must reach one byte after the end */
+ assert(src == &((const char *)dataIn)[rowSizeInBytes*height*depth]);
+ assert(outIndex == halfWidth * halfHeight * halfDepth);
+ } /* for dd */
+
+} /* halveImagePackedPixel3D() */
+
+static int gluBuild3DMipmapLevelsCore(GLenum target, GLint internalFormat,
+ GLsizei width,
+ GLsizei height,
+ GLsizei depth,
+ GLsizei widthPowerOf2,
+ GLsizei heightPowerOf2,
+ GLsizei depthPowerOf2,
+ GLenum format, GLenum type,
+ GLint userLevel,
+ GLint baseLevel,GLint maxLevel,
+ const void *data)
+{
+ GLint newWidth, newHeight, newDepth;
+ GLint level, levels;
+ const void *usersImage;
+ void *srcImage, *dstImage;
+ __GLU_INIT_SWAP_IMAGE;
+ GLint memReq;
+ GLint cmpts;
+
+ GLint myswapBytes, groupsPerLine, elementSize, groupSize;
+ GLint rowsPerImage, imageSize;
+ GLint rowSize, padding;
+ PixelStorageModes psm;
+
+ assert(checkMipmapArgs(internalFormat,format,type) == 0);
+ assert(width >= 1 && height >= 1 && depth >= 1);
+ assert(type != GL_BITMAP);
+
+ srcImage = dstImage = NULL;
+
+ newWidth= widthPowerOf2;
+ newHeight= heightPowerOf2;
+ newDepth= depthPowerOf2;
+ levels = computeLog(newWidth);
+ level = computeLog(newHeight);
+ if (level > levels) levels=level;
+ level = computeLog(newDepth);
+ if (level > levels) levels=level;
+
+ levels+= userLevel;
+
+ retrieveStoreModes3D(&psm);
+ myswapBytes = psm.unpack_swap_bytes;
+ cmpts = elements_per_group(format,type);
+ if (psm.unpack_row_length > 0) {
+ groupsPerLine = psm.unpack_row_length;
+ } else {
+ groupsPerLine = width;
+ }
+
+ elementSize = bytes_per_element(type);
+ groupSize = elementSize * cmpts;
+ if (elementSize == 1) myswapBytes = 0;
+
+ /* 3dstuff begin */
+ if (psm.unpack_image_height > 0) {
+ rowsPerImage= psm.unpack_image_height;
+ }
+ else {
+ rowsPerImage= height;
+ }
+
+ /* 3dstuff end */
+ rowSize = groupsPerLine * groupSize;
+ padding = (rowSize % psm.unpack_alignment);
+ if (padding) {
+ rowSize += psm.unpack_alignment - padding;
+ }
+
+ imageSize= rowsPerImage * rowSize; /* 3dstuff */
+
+ usersImage = (const GLubyte *)data + psm.unpack_skip_rows * rowSize +
+ psm.unpack_skip_pixels * groupSize +
+ /* 3dstuff */
+ psm.unpack_skip_images * imageSize;
+
+ glPixelStorei(GL_UNPACK_SKIP_ROWS, 0);
+ glPixelStorei(GL_UNPACK_SKIP_PIXELS, 0);
+ glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
+ glPixelStorei(GL_UNPACK_SKIP_IMAGES, 0);
+ glPixelStorei(GL_UNPACK_IMAGE_HEIGHT, 0);
+
+ level = userLevel;
+
+ if (width == newWidth && height == newHeight && depth == newDepth) {
+ /* Use usersImage for level userLevel */
+ if (baseLevel <= level && level <= maxLevel) {
+ gluTexImage3D(target, level, internalFormat, width,
+ height, depth, 0, format, type,
+ usersImage);
+ }
+ if(levels == 0) { /* we're done. clean up and return */
+ glPixelStorei(GL_UNPACK_ALIGNMENT, psm.unpack_alignment);
+ glPixelStorei(GL_UNPACK_SKIP_ROWS, psm.unpack_skip_rows);
+ glPixelStorei(GL_UNPACK_SKIP_PIXELS, psm.unpack_skip_pixels);
+ glPixelStorei(GL_UNPACK_ROW_LENGTH, psm.unpack_row_length);
+ glPixelStorei(GL_UNPACK_SWAP_BYTES, psm.unpack_swap_bytes);
+ glPixelStorei(GL_UNPACK_SKIP_IMAGES, psm.unpack_skip_images);
+ glPixelStorei(GL_UNPACK_IMAGE_HEIGHT, psm.unpack_image_height);
+ return 0;
+ }
+ {
+ int nextWidth= newWidth/2;
+ int nextHeight= newHeight/2;
+ int nextDepth= newDepth/2;
+
+ /* clamp to 1 */
+ if (nextWidth < 1) nextWidth= 1;
+ if (nextHeight < 1) nextHeight= 1;
+ if (nextDepth < 1) nextDepth= 1;
+ memReq = imageSize3D(nextWidth, nextHeight, nextDepth, format, type);
+ }
+ switch(type) {
+ case GL_UNSIGNED_BYTE:
+ dstImage = (GLubyte *)malloc(memReq);
+ break;
+ case GL_BYTE:
+ dstImage = (GLbyte *)malloc(memReq);
+ break;
+ case GL_UNSIGNED_SHORT:
+ dstImage = (GLushort *)malloc(memReq);
+ break;
+ case GL_SHORT:
+ dstImage = (GLshort *)malloc(memReq);
+ break;
+ case GL_UNSIGNED_INT:
+ dstImage = (GLuint *)malloc(memReq);
+ break;
+ case GL_INT:
+ dstImage = (GLint *)malloc(memReq);
+ break;
+ case GL_FLOAT:
+ dstImage = (GLfloat *)malloc(memReq);
+ break;
+ case GL_UNSIGNED_BYTE_3_3_2:
+ case GL_UNSIGNED_BYTE_2_3_3_REV:
+ dstImage = (GLubyte *)malloc(memReq);
+ break;
+ case GL_UNSIGNED_SHORT_5_6_5:
+ case GL_UNSIGNED_SHORT_5_6_5_REV:
+ case GL_UNSIGNED_SHORT_4_4_4_4:
+ case GL_UNSIGNED_SHORT_4_4_4_4_REV:
+ case GL_UNSIGNED_SHORT_5_5_5_1:
+ case GL_UNSIGNED_SHORT_1_5_5_5_REV:
+ dstImage = (GLushort *)malloc(memReq);
+ break;
+ case GL_UNSIGNED_INT_8_8_8_8:
+ case GL_UNSIGNED_INT_8_8_8_8_REV:
+ case GL_UNSIGNED_INT_10_10_10_2:
+ case GL_UNSIGNED_INT_2_10_10_10_REV:
+ dstImage = (GLuint *)malloc(memReq);
+ break;
+ default:
+ return GLU_INVALID_ENUM; /* assertion */
+ }
+ if (dstImage == NULL) {
+ glPixelStorei(GL_UNPACK_ALIGNMENT, psm.unpack_alignment);
+ glPixelStorei(GL_UNPACK_SKIP_ROWS, psm.unpack_skip_rows);
+ glPixelStorei(GL_UNPACK_SKIP_PIXELS, psm.unpack_skip_pixels);
+ glPixelStorei(GL_UNPACK_ROW_LENGTH, psm.unpack_row_length);
+ glPixelStorei(GL_UNPACK_SWAP_BYTES, psm.unpack_swap_bytes);
+ glPixelStorei(GL_UNPACK_SKIP_IMAGES, psm.unpack_skip_images);
+ glPixelStorei(GL_UNPACK_IMAGE_HEIGHT, psm.unpack_image_height);
+ return GLU_OUT_OF_MEMORY;
+ }
+ else
+ switch(type) {
+ case GL_UNSIGNED_BYTE:
+ if (depth > 1) {
+ halveImage3D(cmpts,extractUbyte,shoveUbyte,
+ width,height,depth,
+ usersImage,dstImage,elementSize,groupSize,rowSize,
+ imageSize,myswapBytes);
+ }
+ else {
+ halveImage_ubyte(cmpts,width,height,usersImage,dstImage,
+ elementSize,rowSize,groupSize);
+ }
+ break;
+ case GL_BYTE:
+ if (depth > 1) {
+ halveImage3D(cmpts,extractSbyte,shoveSbyte,
+ width,height,depth,
+ usersImage,dstImage,elementSize,groupSize,rowSize,
+ imageSize,myswapBytes);
+ }
+ else {
+ halveImage_byte(cmpts,width,height,usersImage,dstImage,
+ elementSize,rowSize,groupSize);
+ }
+ break;
+ case GL_UNSIGNED_SHORT:
+ if (depth > 1) {
+ halveImage3D(cmpts,extractUshort,shoveUshort,
+ width,height,depth,
+ usersImage,dstImage,elementSize,groupSize,rowSize,
+ imageSize,myswapBytes);
+ }
+ else {
+ halveImage_ushort(cmpts,width,height,usersImage,dstImage,
+ elementSize,rowSize,groupSize,myswapBytes);
+ }
+ break;
+ case GL_SHORT:
+ if (depth > 1) {
+ halveImage3D(cmpts,extractSshort,shoveSshort,
+ width,height,depth,
+ usersImage,dstImage,elementSize,groupSize,rowSize,
+ imageSize,myswapBytes);
+ }
+ else {
+ halveImage_short(cmpts,width,height,usersImage,dstImage,
+ elementSize,rowSize,groupSize,myswapBytes);
+ }
+ break;
+ case GL_UNSIGNED_INT:
+ if (depth > 1) {
+ halveImage3D(cmpts,extractUint,shoveUint,
+ width,height,depth,
+ usersImage,dstImage,elementSize,groupSize,rowSize,
+ imageSize,myswapBytes);
+ }
+ else {
+ halveImage_uint(cmpts,width,height,usersImage,dstImage,
+ elementSize,rowSize,groupSize,myswapBytes);
+ }
+ break;
+ case GL_INT:
+ if (depth > 1) {
+ halveImage3D(cmpts,extractSint,shoveSint,
+ width,height,depth,
+ usersImage,dstImage,elementSize,groupSize,rowSize,
+ imageSize,myswapBytes);
+ }
+ else {
+ halveImage_int(cmpts,width,height,usersImage,dstImage,
+ elementSize,rowSize,groupSize,myswapBytes);
+ }
+ break;
+ case GL_FLOAT:
+ if (depth > 1 ) {
+ halveImage3D(cmpts,extractFloat,shoveFloat,
+ width,height,depth,
+ usersImage,dstImage,elementSize,groupSize,rowSize,
+ imageSize,myswapBytes);
+ }
+ else {
+ halveImage_float(cmpts,width,height,usersImage,dstImage,
+ elementSize,rowSize,groupSize,myswapBytes);
+ }
+ break;
+ case GL_UNSIGNED_BYTE_3_3_2:
+ assert(format == GL_RGB);
+ halveImagePackedPixel3D(3,extract332,shove332,
+ width,height,depth,usersImage,dstImage,
+ elementSize,rowSize,imageSize,myswapBytes);
+ break;
+ case GL_UNSIGNED_BYTE_2_3_3_REV:
+ assert(format == GL_RGB);
+ halveImagePackedPixel3D(3,extract233rev,shove233rev,
+ width,height,depth,usersImage,dstImage,
+ elementSize,rowSize,imageSize,myswapBytes);
+ break;
+ case GL_UNSIGNED_SHORT_5_6_5:
+ halveImagePackedPixel3D(3,extract565,shove565,
+ width,height,depth,usersImage,dstImage,
+ elementSize,rowSize,imageSize,myswapBytes);
+ break;
+ case GL_UNSIGNED_SHORT_5_6_5_REV:
+ halveImagePackedPixel3D(3,extract565rev,shove565rev,
+ width,height,depth,usersImage,dstImage,
+ elementSize,rowSize,imageSize,myswapBytes);
+ break;
+ case GL_UNSIGNED_SHORT_4_4_4_4:
+ halveImagePackedPixel3D(4,extract4444,shove4444,
+ width,height,depth,usersImage,dstImage,
+ elementSize,rowSize,imageSize,myswapBytes);
+ break;
+ case GL_UNSIGNED_SHORT_4_4_4_4_REV:
+ halveImagePackedPixel3D(4,extract4444rev,shove4444rev,
+ width,height,depth,usersImage,dstImage,
+ elementSize,rowSize,imageSize,myswapBytes);
+ break;
+ case GL_UNSIGNED_SHORT_5_5_5_1:
+ halveImagePackedPixel3D(4,extract5551,shove5551,
+ width,height,depth,usersImage,dstImage,
+ elementSize,rowSize,imageSize,myswapBytes);
+ break;
+ case GL_UNSIGNED_SHORT_1_5_5_5_REV:
+ halveImagePackedPixel3D(4,extract1555rev,shove1555rev,
+ width,height,depth,usersImage,dstImage,
+ elementSize,rowSize,imageSize,myswapBytes);
+ break;
+ case GL_UNSIGNED_INT_8_8_8_8:
+ halveImagePackedPixel3D(4,extract8888,shove8888,
+ width,height,depth,usersImage,dstImage,
+ elementSize,rowSize,imageSize,myswapBytes);
+ break;
+ case GL_UNSIGNED_INT_8_8_8_8_REV:
+ halveImagePackedPixel3D(4,extract8888rev,shove8888rev,
+ width,height,depth,usersImage,dstImage,
+ elementSize,rowSize,imageSize,myswapBytes);
+ break;
+ case GL_UNSIGNED_INT_10_10_10_2:
+ halveImagePackedPixel3D(4,extract1010102,shove1010102,
+ width,height,depth,usersImage,dstImage,
+ elementSize,rowSize,imageSize,myswapBytes);
+ break;
+ case GL_UNSIGNED_INT_2_10_10_10_REV:
+ halveImagePackedPixel3D(4,extract2101010rev,shove2101010rev,
+ width,height,depth,usersImage,dstImage,
+ elementSize,rowSize,imageSize,myswapBytes);
+ break;
+ default:
+ assert(0);
+ break;
+ }
+ newWidth = width/2;
+ newHeight = height/2;
+ newDepth = depth/2;
+ /* clamp to 1 */
+ if (newWidth < 1) newWidth= 1;
+ if (newHeight < 1) newHeight= 1;
+ if (newDepth < 1) newDepth= 1;
+
+ myswapBytes = 0;
+ rowSize = newWidth * groupSize;
+ imageSize= rowSize * newHeight; /* 3dstuff */
+ memReq = imageSize3D(newWidth, newHeight, newDepth, format, type);
+ /* Swap srcImage and dstImage */
+ __GLU_SWAP_IMAGE(srcImage,dstImage);
+ switch(type) {
+ case GL_UNSIGNED_BYTE:
+ dstImage = (GLubyte *)malloc(memReq);
+ break;
+ case GL_BYTE:
+ dstImage = (GLbyte *)malloc(memReq);
+ break;
+ case GL_UNSIGNED_SHORT:
+ dstImage = (GLushort *)malloc(memReq);
+ break;
+ case GL_SHORT:
+ dstImage = (GLshort *)malloc(memReq);
+ break;
+ case GL_UNSIGNED_INT:
+ dstImage = (GLuint *)malloc(memReq);
+ break;
+ case GL_INT:
+ dstImage = (GLint *)malloc(memReq);
+ break;
+ case GL_FLOAT:
+ dstImage = (GLfloat *)malloc(memReq);
+ break;
+ case GL_UNSIGNED_BYTE_3_3_2:
+ case GL_UNSIGNED_BYTE_2_3_3_REV:
+ dstImage = (GLubyte *)malloc(memReq);
+ break;
+ case GL_UNSIGNED_SHORT_5_6_5:
+ case GL_UNSIGNED_SHORT_5_6_5_REV:
+ case GL_UNSIGNED_SHORT_4_4_4_4:
+ case GL_UNSIGNED_SHORT_4_4_4_4_REV:
+ case GL_UNSIGNED_SHORT_5_5_5_1:
+ case GL_UNSIGNED_SHORT_1_5_5_5_REV:
+ dstImage = (GLushort *)malloc(memReq);
+ break;
+ case GL_UNSIGNED_INT_8_8_8_8:
+ case GL_UNSIGNED_INT_8_8_8_8_REV:
+ case GL_UNSIGNED_INT_10_10_10_2:
+ case GL_UNSIGNED_INT_2_10_10_10_REV:
+ dstImage = (GLuint *)malloc(memReq);
+ break;
+ default:
+ return GLU_INVALID_ENUM; /* assertion */
+ }
+ if (dstImage == NULL) {
+ glPixelStorei(GL_UNPACK_ALIGNMENT, psm.unpack_alignment);
+ glPixelStorei(GL_UNPACK_SKIP_ROWS, psm.unpack_skip_rows);
+ glPixelStorei(GL_UNPACK_SKIP_PIXELS, psm.unpack_skip_pixels);
+ glPixelStorei(GL_UNPACK_ROW_LENGTH, psm.unpack_row_length);
+ glPixelStorei(GL_UNPACK_SWAP_BYTES, psm.unpack_swap_bytes);
+ glPixelStorei(GL_UNPACK_SKIP_IMAGES, psm.unpack_skip_images);
+ glPixelStorei(GL_UNPACK_IMAGE_HEIGHT, psm.unpack_image_height);
+ free(srcImage);
+ return GLU_OUT_OF_MEMORY;
+ }
+ /* level userLevel+1 is in srcImage; level userLevel already saved */
+ level = userLevel+1;
+ } else {/* user's image is *not* nice power-of-2 sized square */
+ memReq = imageSize3D(newWidth, newHeight, newDepth, format, type);
+ switch(type) {
+ case GL_UNSIGNED_BYTE:
+ dstImage = (GLubyte *)malloc(memReq);
+ break;
+ case GL_BYTE:
+ dstImage = (GLbyte *)malloc(memReq);
+ break;
+ case GL_UNSIGNED_SHORT:
+ dstImage = (GLushort *)malloc(memReq);
+ break;
+ case GL_SHORT:
+ dstImage = (GLshort *)malloc(memReq);
+ break;
+ case GL_UNSIGNED_INT:
+ dstImage = (GLuint *)malloc(memReq);
+ break;
+ case GL_INT:
+ dstImage = (GLint *)malloc(memReq);
+ break;
+ case GL_FLOAT:
+ dstImage = (GLfloat *)malloc(memReq);
+ break;
+ case GL_UNSIGNED_BYTE_3_3_2:
+ case GL_UNSIGNED_BYTE_2_3_3_REV:
+ dstImage = (GLubyte *)malloc(memReq);
+ break;
+ case GL_UNSIGNED_SHORT_5_6_5:
+ case GL_UNSIGNED_SHORT_5_6_5_REV:
+ case GL_UNSIGNED_SHORT_4_4_4_4:
+ case GL_UNSIGNED_SHORT_4_4_4_4_REV:
+ case GL_UNSIGNED_SHORT_5_5_5_1:
+ case GL_UNSIGNED_SHORT_1_5_5_5_REV:
+ dstImage = (GLushort *)malloc(memReq);
+ break;
+ case GL_UNSIGNED_INT_8_8_8_8:
+ case GL_UNSIGNED_INT_8_8_8_8_REV:
+ case GL_UNSIGNED_INT_10_10_10_2:
+ case GL_UNSIGNED_INT_2_10_10_10_REV:
+ dstImage = (GLuint *)malloc(memReq);
+ break;
+ default:
+ return GLU_INVALID_ENUM; /* assertion */
+ }
+
+ if (dstImage == NULL) {
+ glPixelStorei(GL_UNPACK_ALIGNMENT, psm.unpack_alignment);
+ glPixelStorei(GL_UNPACK_SKIP_ROWS, psm.unpack_skip_rows);
+ glPixelStorei(GL_UNPACK_SKIP_PIXELS, psm.unpack_skip_pixels);
+ glPixelStorei(GL_UNPACK_ROW_LENGTH, psm.unpack_row_length);
+ glPixelStorei(GL_UNPACK_SWAP_BYTES, psm.unpack_swap_bytes);
+ glPixelStorei(GL_UNPACK_SKIP_IMAGES, psm.unpack_skip_images);
+ glPixelStorei(GL_UNPACK_IMAGE_HEIGHT, psm.unpack_image_height);
+ return GLU_OUT_OF_MEMORY;
+ }
+ /*printf("Build3DMipmaps(): ScaleImage3D %d %d %d->%d %d %d\n",
+ width,height,depth,newWidth,newHeight,newDepth);*/
+
+ gluScaleImage3D(format, width, height, depth, type, usersImage,
+ newWidth, newHeight, newDepth, type, dstImage);
+
+ myswapBytes = 0;
+ rowSize = newWidth * groupSize;
+ imageSize = rowSize * newHeight; /* 3dstuff */
+ /* Swap dstImage and srcImage */
+ __GLU_SWAP_IMAGE(srcImage,dstImage);
+
+ if(levels != 0) { /* use as little memory as possible */
+ {
+ int nextWidth= newWidth/2;
+ int nextHeight= newHeight/2;
+ int nextDepth= newDepth/2;
+ if (nextWidth < 1) nextWidth= 1;
+ if (nextHeight < 1) nextHeight= 1;
+ if (nextDepth < 1) nextDepth= 1;
+
+ memReq = imageSize3D(nextWidth, nextHeight, nextDepth, format, type);
+ }
+ switch(type) {
+ case GL_UNSIGNED_BYTE:
+ dstImage = (GLubyte *)malloc(memReq);
+ break;
+ case GL_BYTE:
+ dstImage = (GLbyte *)malloc(memReq);
+ break;
+ case GL_UNSIGNED_SHORT:
+ dstImage = (GLushort *)malloc(memReq);
+ break;
+ case GL_SHORT:
+ dstImage = (GLshort *)malloc(memReq);
+ break;
+ case GL_UNSIGNED_INT:
+ dstImage = (GLuint *)malloc(memReq);
+ break;
+ case GL_INT:
+ dstImage = (GLint *)malloc(memReq);
+ break;
+ case GL_FLOAT:
+ dstImage = (GLfloat *)malloc(memReq);
+ break;
+ case GL_UNSIGNED_BYTE_3_3_2:
+ case GL_UNSIGNED_BYTE_2_3_3_REV:
+ dstImage = (GLubyte *)malloc(memReq);
+ break;
+ case GL_UNSIGNED_SHORT_5_6_5:
+ case GL_UNSIGNED_SHORT_5_6_5_REV:
+ case GL_UNSIGNED_SHORT_4_4_4_4:
+ case GL_UNSIGNED_SHORT_4_4_4_4_REV:
+ case GL_UNSIGNED_SHORT_5_5_5_1:
+ case GL_UNSIGNED_SHORT_1_5_5_5_REV:
+ dstImage = (GLushort *)malloc(memReq);
+ break;
+ case GL_UNSIGNED_INT_8_8_8_8:
+ case GL_UNSIGNED_INT_8_8_8_8_REV:
+ case GL_UNSIGNED_INT_10_10_10_2:
+ case GL_UNSIGNED_INT_2_10_10_10_REV:
+ dstImage = (GLuint *)malloc(memReq);
+ break;
+ default:
+ return GLU_INVALID_ENUM; /* assertion */
+ }
+ if (dstImage == NULL) {
+ glPixelStorei(GL_UNPACK_ALIGNMENT, psm.unpack_alignment);
+ glPixelStorei(GL_UNPACK_SKIP_ROWS, psm.unpack_skip_rows);
+ glPixelStorei(GL_UNPACK_SKIP_PIXELS, psm.unpack_skip_pixels);
+ glPixelStorei(GL_UNPACK_ROW_LENGTH, psm.unpack_row_length);
+ glPixelStorei(GL_UNPACK_SWAP_BYTES, psm.unpack_swap_bytes);
+ glPixelStorei(GL_UNPACK_SKIP_IMAGES, psm.unpack_skip_images);
+ glPixelStorei(GL_UNPACK_IMAGE_HEIGHT, psm.unpack_image_height);
+ free(srcImage);
+ return GLU_OUT_OF_MEMORY;
+ }
+ }
+ /* level userLevel is in srcImage; nothing saved yet */
+ level = userLevel;
+ }
+
+ glPixelStorei(GL_UNPACK_SWAP_BYTES, GL_FALSE);
+ if (baseLevel <= level && level <= maxLevel) {
+ gluTexImage3D(target, level, internalFormat, newWidth, newHeight, newDepth,
+ 0,format, type, (void *)srcImage);
+ }
+ level++; /* update current level for the loop */
+ for (; level <= levels; level++) {
+ switch(type) {
+ case GL_UNSIGNED_BYTE:
+ if (newDepth > 1) {
+ halveImage3D(cmpts,extractUbyte,shoveUbyte,
+ newWidth,newHeight,newDepth,
+ srcImage,dstImage,elementSize,groupSize,rowSize,
+ imageSize,myswapBytes);
+ }
+ else {
+ halveImage_ubyte(cmpts,newWidth,newHeight,srcImage,dstImage,
+ elementSize,rowSize,groupSize);
+ }
+ break;
+ case GL_BYTE:
+ if (newDepth > 1) {
+ halveImage3D(cmpts,extractSbyte,shoveSbyte,
+ newWidth,newHeight,newDepth,
+ srcImage,dstImage,elementSize,groupSize,rowSize,
+ imageSize,myswapBytes);
+ }
+ else {
+ halveImage_byte(cmpts,newWidth,newHeight,srcImage,dstImage,
+ elementSize,rowSize,groupSize);
+ }
+ break;
+ case GL_UNSIGNED_SHORT:
+ if (newDepth > 1) {
+ halveImage3D(cmpts,extractUshort,shoveUshort,
+ newWidth,newHeight,newDepth,
+ srcImage,dstImage,elementSize,groupSize,rowSize,
+ imageSize,myswapBytes);
+ }
+ else {
+ halveImage_ushort(cmpts,newWidth,newHeight,srcImage,dstImage,
+ elementSize,rowSize,groupSize,myswapBytes);
+ }
+ break;
+ case GL_SHORT:
+ if (newDepth > 1) {
+ halveImage3D(cmpts,extractSshort,shoveSshort,
+ newWidth,newHeight,newDepth,
+ srcImage,dstImage,elementSize,groupSize,rowSize,
+ imageSize,myswapBytes);
+ }
+ else {
+ halveImage_short(cmpts,newWidth,newHeight,srcImage,dstImage,
+ elementSize,rowSize,groupSize,myswapBytes);
+ }
+ break;
+ case GL_UNSIGNED_INT:
+ if (newDepth > 1) {
+ halveImage3D(cmpts,extractUint,shoveUint,
+ newWidth,newHeight,newDepth,
+ srcImage,dstImage,elementSize,groupSize,rowSize,
+ imageSize,myswapBytes);
+ }
+ else {
+ halveImage_uint(cmpts,newWidth,newHeight,srcImage,dstImage,
+ elementSize,rowSize,groupSize,myswapBytes);
+ }
+ break;
+ case GL_INT:
+ if (newDepth > 1) {
+ halveImage3D(cmpts,extractSint,shoveSint,
+ newWidth,newHeight,newDepth,
+ srcImage,dstImage,elementSize,groupSize,rowSize,
+ imageSize,myswapBytes);
+ }
+ else {
+ halveImage_int(cmpts,newWidth,newHeight,srcImage,dstImage,
+ elementSize,rowSize,groupSize,myswapBytes);
+ }
+ break;
+ case GL_FLOAT:
+ if (newDepth > 1) {
+ halveImage3D(cmpts,extractFloat,shoveFloat,
+ newWidth,newHeight,newDepth,
+ srcImage,dstImage,elementSize,groupSize,rowSize,
+ imageSize,myswapBytes);
+ }
+ else {
+ halveImage_float(cmpts,newWidth,newHeight,srcImage,dstImage,
+ elementSize,rowSize,groupSize,myswapBytes);
+ }
+ break;
+ case GL_UNSIGNED_BYTE_3_3_2:
+ halveImagePackedPixel3D(3,extract332,shove332,
+ newWidth,newHeight,newDepth,
+ srcImage,dstImage,elementSize,rowSize,
+ imageSize,myswapBytes);
+ break;
+ case GL_UNSIGNED_BYTE_2_3_3_REV:
+ halveImagePackedPixel3D(3,extract233rev,shove233rev,
+ newWidth,newHeight,newDepth,
+ srcImage,dstImage,elementSize,rowSize,
+ imageSize,myswapBytes);
+ break;
+ case GL_UNSIGNED_SHORT_5_6_5:
+ halveImagePackedPixel3D(3,extract565,shove565,
+ newWidth,newHeight,newDepth,
+ srcImage,dstImage,elementSize,rowSize,
+ imageSize,myswapBytes);
+ break;
+ case GL_UNSIGNED_SHORT_5_6_5_REV:
+ halveImagePackedPixel3D(3,extract565rev,shove565rev,
+ newWidth,newHeight,newDepth,
+ srcImage,dstImage,elementSize,rowSize,
+ imageSize,myswapBytes);
+ break;
+ case GL_UNSIGNED_SHORT_4_4_4_4:
+ halveImagePackedPixel3D(4,extract4444,shove4444,
+ newWidth,newHeight,newDepth,
+ srcImage,dstImage,elementSize,rowSize,
+ imageSize,myswapBytes);
+ break;
+ case GL_UNSIGNED_SHORT_4_4_4_4_REV:
+ halveImagePackedPixel3D(4,extract4444rev,shove4444rev,
+ newWidth,newHeight,newDepth,
+ srcImage,dstImage,elementSize,rowSize,
+ imageSize,myswapBytes);
+ break;
+ case GL_UNSIGNED_SHORT_5_5_5_1:
+ halveImagePackedPixel3D(4,extract5551,shove5551,
+ newWidth,newHeight,newDepth,
+ srcImage,dstImage,elementSize,rowSize,
+ imageSize,myswapBytes);
+ break;
+ case GL_UNSIGNED_SHORT_1_5_5_5_REV:
+ halveImagePackedPixel3D(4,extract1555rev,shove1555rev,
+ newWidth,newHeight,newDepth,
+ srcImage,dstImage,elementSize,rowSize,
+ imageSize,myswapBytes);
+ break;
+ case GL_UNSIGNED_INT_8_8_8_8:
+ halveImagePackedPixel3D(4,extract8888,shove8888,
+ newWidth,newHeight,newDepth,
+ srcImage,dstImage,elementSize,rowSize,
+ imageSize,myswapBytes);
+ break;
+ case GL_UNSIGNED_INT_8_8_8_8_REV:
+ halveImagePackedPixel3D(4,extract8888rev,shove8888rev,
+ newWidth,newHeight,newDepth,
+ srcImage,dstImage,elementSize,rowSize,
+ imageSize,myswapBytes);
+ break;
+ case GL_UNSIGNED_INT_10_10_10_2:
+ halveImagePackedPixel3D(4,extract1010102,shove1010102,
+ newWidth,newHeight,newDepth,
+ srcImage,dstImage,elementSize,rowSize,
+ imageSize,myswapBytes);
+ break;
+ case GL_UNSIGNED_INT_2_10_10_10_REV:
+ halveImagePackedPixel3D(4,extract2101010rev,shove2101010rev,
+ newWidth,newHeight,newDepth,
+ srcImage,dstImage,elementSize,rowSize,
+ imageSize,myswapBytes);
+ break;
+ default:
+ assert(0);
+ break;
+ }
+
+ __GLU_SWAP_IMAGE(srcImage,dstImage);
+
+ if (newWidth > 1) { newWidth /= 2; rowSize /= 2;}
+ if (newHeight > 1) { newHeight /= 2; imageSize = rowSize * newHeight; }
+ if (newDepth > 1) newDepth /= 2;
+ {
+ /* call tex image with srcImage untouched since it's not padded */
+ if (baseLevel <= level && level <= maxLevel) {
+ gluTexImage3D(target, level, internalFormat, newWidth, newHeight,
+ newDepth,0, format, type, (void *) srcImage);
+ }
+ }
+ } /* for level */
+ glPixelStorei(GL_UNPACK_ALIGNMENT, psm.unpack_alignment);
+ glPixelStorei(GL_UNPACK_SKIP_ROWS, psm.unpack_skip_rows);
+ glPixelStorei(GL_UNPACK_SKIP_PIXELS, psm.unpack_skip_pixels);
+ glPixelStorei(GL_UNPACK_ROW_LENGTH, psm.unpack_row_length);
+ glPixelStorei(GL_UNPACK_SWAP_BYTES, psm.unpack_swap_bytes);
+ glPixelStorei(GL_UNPACK_SKIP_IMAGES, psm.unpack_skip_images);
+ glPixelStorei(GL_UNPACK_IMAGE_HEIGHT, psm.unpack_image_height);
+
+ free(srcImage); /*if you get to here, a srcImage has always been malloc'ed*/
+ if (dstImage) { /* if it's non-rectangular and only 1 level */
+ free(dstImage);
+ }
+ return 0;
+} /* gluBuild3DMipmapLevelsCore() */
+
+GLint GLAPIENTRY
+gluBuild3DMipmapLevels(GLenum target, GLint internalFormat,
+ GLsizei width, GLsizei height, GLsizei depth,
+ GLenum format, GLenum type,
+ GLint userLevel, GLint baseLevel, GLint maxLevel,
+ const void *data)
+{
+ int level, levels;
+
+ int rc= checkMipmapArgs(internalFormat,format,type);
+ if (rc != 0) return rc;
+
+ if (width < 1 || height < 1 || depth < 1) {
+ return GLU_INVALID_VALUE;
+ }
+
+ if(type == GL_BITMAP) {
+ return GLU_INVALID_ENUM;
+ }
+
+ levels = computeLog(width);
+ level = computeLog(height);
+ if (level > levels) levels=level;
+ level = computeLog(depth);
+ if (level > levels) levels=level;
+
+ levels+= userLevel;
+ if (!isLegalLevels(userLevel,baseLevel,maxLevel,levels))
+ return GLU_INVALID_VALUE;
+
+ return gluBuild3DMipmapLevelsCore(target, internalFormat,
+ width, height, depth,
+ width, height, depth,
+ format, type,
+ userLevel, baseLevel, maxLevel,
+ data);
+} /* gluBuild3DMipmapLevels() */
+
+GLint GLAPIENTRY
+gluBuild3DMipmaps(GLenum target, GLint internalFormat,
+ GLsizei width, GLsizei height, GLsizei depth,
+ GLenum format, GLenum type, const void *data)
+{
+ GLint widthPowerOf2, heightPowerOf2, depthPowerOf2;
+ int level, levels;
+
+ int rc= checkMipmapArgs(internalFormat,format,type);
+ if (rc != 0) return rc;
+
+ if (width < 1 || height < 1 || depth < 1) {
+ return GLU_INVALID_VALUE;
+ }
+
+ if(type == GL_BITMAP) {
+ return GLU_INVALID_ENUM;
+ }
+
+ closestFit3D(target,width,height,depth,internalFormat,format,type,
+ &widthPowerOf2,&heightPowerOf2,&depthPowerOf2);
+
+ levels = computeLog(widthPowerOf2);
+ level = computeLog(heightPowerOf2);
+ if (level > levels) levels=level;
+ level = computeLog(depthPowerOf2);
+ if (level > levels) levels=level;
+
+ return gluBuild3DMipmapLevelsCore(target, internalFormat,
+ width, height, depth,
+ widthPowerOf2, heightPowerOf2,
+ depthPowerOf2,
+ format, type, 0, 0, levels,
+ data);
+} /* gluBuild3DMipmaps() */
+
+static GLdouble extractUbyte(int isSwap, const void *ubyte)
+{
+ isSwap= isSwap; /* turn off warnings */
+
+ assert(*((const GLubyte *)ubyte) <= 255);
+
+ return (GLdouble)(*((const GLubyte *)ubyte));
+} /* extractUbyte() */
+
+static void shoveUbyte(GLdouble value, int index, void *data)
+{
+ assert(0.0 <= value && value < 256.0);
+
+ ((GLubyte *)data)[index]= (GLubyte)value;
+} /* shoveUbyte() */
+
+static GLdouble extractSbyte(int isSwap, const void *sbyte)
+{
+ isSwap= isSwap; /* turn off warnings */
+
+ assert(*((const GLbyte *)sbyte) <= 127);
+
+ return (GLdouble)(*((const GLbyte *)sbyte));
+} /* extractSbyte() */
+
+static void shoveSbyte(GLdouble value, int index, void *data)
+{
+ ((GLbyte *)data)[index]= (GLbyte)value;
+} /* shoveSbyte() */
+
+static GLdouble extractUshort(int isSwap, const void *uitem)
+{
+ GLushort ushort;
+
+ if (isSwap) {
+ ushort= __GLU_SWAP_2_BYTES(uitem);
+ }
+ else {
+ ushort= *(const GLushort *)uitem;
+ }
+
+ assert(ushort <= 65535);
+
+ return (GLdouble)ushort;
+} /* extractUshort() */
+
+static void shoveUshort(GLdouble value, int index, void *data)
+{
+ assert(0.0 <= value && value < 65536.0);
+
+ ((GLushort *)data)[index]= (GLushort)value;
+} /* shoveUshort() */
+
+static GLdouble extractSshort(int isSwap, const void *sitem)
+{
+ GLshort sshort;
+
+ if (isSwap) {
+ sshort= __GLU_SWAP_2_BYTES(sitem);
+ }
+ else {
+ sshort= *(const GLshort *)sitem;
+ }
+
+ assert(sshort <= 32767);
+
+ return (GLdouble)sshort;
+} /* extractSshort() */
+
+static void shoveSshort(GLdouble value, int index, void *data)
+{
+ assert(0.0 <= value && value < 32768.0);
+
+ ((GLshort *)data)[index]= (GLshort)value;
+} /* shoveSshort() */
+
+static GLdouble extractUint(int isSwap, const void *uitem)
+{
+ GLuint uint;
+
+ if (isSwap) {
+ uint= __GLU_SWAP_4_BYTES(uitem);
+ }
+ else {
+ uint= *(const GLuint *)uitem;
+ }
+
+ assert(uint <= 0xffffffff);
+
+ return (GLdouble)uint;
+} /* extractUint() */
+
+static void shoveUint(GLdouble value, int index, void *data)
+{
+ assert(0.0 <= value && value <= (GLdouble) UINT_MAX);
+
+ ((GLuint *)data)[index]= (GLuint)value;
+} /* shoveUint() */
+
+static GLdouble extractSint(int isSwap, const void *sitem)
+{
+ GLint sint;
+
+ if (isSwap) {
+ sint= __GLU_SWAP_4_BYTES(sitem);
+ }
+ else {
+ sint= *(const GLint *)sitem;
+ }
+
+ assert(sint <= 0x7fffffff);
+
+ return (GLdouble)sint;
+} /* extractSint() */
+
+static void shoveSint(GLdouble value, int index, void *data)
+{
+ assert(0.0 <= value && value <= (GLdouble) INT_MAX);
+
+ ((GLint *)data)[index]= (GLint)value;
+} /* shoveSint() */
+
+static GLdouble extractFloat(int isSwap, const void *item)
+{
+ GLfloat ffloat;
+
+ if (isSwap) {
+ ffloat= __GLU_SWAP_4_BYTES(item);
+ }
+ else {
+ ffloat= *(const GLfloat *)item;
+ }
+
+ assert(ffloat <= 1.0);
+
+ return (GLdouble)ffloat;
+} /* extractFloat() */
+
+static void shoveFloat(GLdouble value, int index, void *data)
+{
+ assert(0.0 <= value && value <= 1.0);
+
+ ((GLfloat *)data)[index]= value;
+} /* shoveFloat() */
+
+static void halveImageSlice(int components,
+ GLdouble (*extract)(int, const void *),
+ void (*shove)(GLdouble, int, void *),
+ GLint width, GLint height, GLint depth,
+ const void *dataIn, void *dataOut,
+ GLint elementSizeInBytes,
+ GLint groupSizeInBytes,
+ GLint rowSizeInBytes,
+ GLint imageSizeInBytes,
+ GLint isSwap)
+{
+ int ii, jj;
+ int halfWidth= width / 2;
+ int halfHeight= height / 2;
+ int halfDepth= depth / 2;
+ const char *src= (const char *)dataIn;
+ int rowPadBytes= rowSizeInBytes - (width * groupSizeInBytes);
+ int imagePadBytes= imageSizeInBytes - (width*height*groupSizeInBytes);
+ int outIndex= 0;
+
+ assert((width == 1 || height == 1) && depth >= 2);
+
+ if (width == height) { /* a 1-pixel column viewed from top */
+ /* printf("1-column\n");*/
+ assert(width == 1 && height == 1);
+ assert(depth >= 2);
+
+ for (ii= 0; ii< halfDepth; ii++) {
+ int cc;
+
+ for (cc = 0; cc < components; cc++) {
+ double totals[4];
+ double extractTotals[BOX2][4];
+ int kk;
+
+ extractTotals[0][cc]= (*extract)(isSwap,src);
+ extractTotals[1][cc]= (*extract)(isSwap,(src+imageSizeInBytes));
+
+ /* average 2 pixels since only a column */
+ totals[cc]= 0.0;
+ /* totals[RED]= extractTotals[0][RED]+extractTotals[1][RED];
+ * totals[RED]/= 2.0;
+ */
+ for (kk = 0; kk < BOX2; kk++) {
+ totals[cc]+= extractTotals[kk][cc];
+ }
+ totals[cc]/= (double)BOX2;
+
+ (*shove)(totals[cc],outIndex,dataOut);
+ outIndex++;
+ src+= elementSizeInBytes;
+ } /* for cc */
+
+ /* skip over to next group of 2 */
+ src+= rowSizeInBytes;
+ } /* for ii */
+
+ assert(src == &((const char *)dataIn)[rowSizeInBytes*height*depth]);
+ assert(outIndex == halfDepth * components);
+ }
+ else if (height == 1) { /* horizontal slice viewed from top */
+ /* printf("horizontal slice\n"); */
+ assert(width != 1);
+
+ for (ii= 0; ii< halfDepth; ii++) {
+ for (jj= 0; jj< halfWidth; jj++) {
+ int cc;
+
+ for (cc = 0; cc < components; cc++) {
+ int kk;
+ double totals[4];
+ double extractTotals[BOX4][4];
+
+ extractTotals[0][cc]=(*extract)(isSwap,src);
+ extractTotals[1][cc]=(*extract)(isSwap,
+ (src+groupSizeInBytes));
+ extractTotals[2][cc]=(*extract)(isSwap,
+ (src+imageSizeInBytes));
+ extractTotals[3][cc]=(*extract)(isSwap,
+ (src+imageSizeInBytes+groupSizeInBytes));
+
+ /* grab 4 pixels to average */
+ totals[cc]= 0.0;
+ /* totals[RED]= extractTotals[0][RED]+extractTotals[1][RED]+
+ * extractTotals[2][RED]+extractTotals[3][RED];
+ * totals[RED]/= 4.0;
+ */
+ for (kk = 0; kk < BOX4; kk++) {
+ totals[cc]+= extractTotals[kk][cc];
+ }
+ totals[cc]/= (double)BOX4;
+
+ (*shove)(totals[cc],outIndex,dataOut);
+ outIndex++;
+
+ src+= elementSizeInBytes;
+ } /* for cc */
+
+ /* skip over to next horizontal square of 4 */
+ src+= groupSizeInBytes;
+ } /* for jj */
+ src+= rowPadBytes;
+
+ src+= rowSizeInBytes;
+ } /* for ii */
+
+ assert(src == &((const char *)dataIn)[rowSizeInBytes*height*depth]);
+ assert(outIndex == halfWidth * halfDepth * components);
+ }
+ else if (width == 1) { /* vertical slice viewed from top */
+ /* printf("vertical slice\n"); */
+ assert(height != 1);
+
+ for (ii= 0; ii< halfDepth; ii++) {
+ for (jj= 0; jj< halfHeight; jj++) {
+ int cc;
+
+ for (cc = 0; cc < components; cc++) {
+ int kk;
+ double totals[4];
+ double extractTotals[BOX4][4];
+
+ extractTotals[0][cc]=(*extract)(isSwap,src);
+ extractTotals[1][cc]=(*extract)(isSwap,
+ (src+rowSizeInBytes));
+ extractTotals[2][cc]=(*extract)(isSwap,
+ (src+imageSizeInBytes));
+ extractTotals[3][cc]=(*extract)(isSwap,
+ (src+imageSizeInBytes+rowSizeInBytes));
+
+ /* grab 4 pixels to average */
+ totals[cc]= 0.0;
+ /* totals[RED]= extractTotals[0][RED]+extractTotals[1][RED]+
+ * extractTotals[2][RED]+extractTotals[3][RED];
+ * totals[RED]/= 4.0;
+ */
+ for (kk = 0; kk < BOX4; kk++) {
+ totals[cc]+= extractTotals[kk][cc];
+ }
+ totals[cc]/= (double)BOX4;
+
+ (*shove)(totals[cc],outIndex,dataOut);
+ outIndex++;
+
+ src+= elementSizeInBytes;
+ } /* for cc */
+ src+= rowPadBytes;
+
+ /* skip over to next vertical square of 4 */
+ src+= rowSizeInBytes;
+ } /* for jj */
+ src+= imagePadBytes;
+
+ src+= imageSizeInBytes;
+ } /* for ii */
+
+ assert(src == &((const char *)dataIn)[rowSizeInBytes*height*depth]);
+ assert(outIndex == halfHeight * halfDepth * components);
+ }
+
+} /* halveImageSlice() */
+
+static void halveImage3D(int components,
+ GLdouble (*extract)(int, const void *),
+ void (*shove)(GLdouble, int, void *),
+ GLint width, GLint height, GLint depth,
+ const void *dataIn, void *dataOut,
+ GLint elementSizeInBytes,
+ GLint groupSizeInBytes,
+ GLint rowSizeInBytes,
+ GLint imageSizeInBytes,
+ GLint isSwap)
+{
+ assert(depth > 1);
+
+ /* a horizontal/vertical/one-column slice viewed from top */
+ if (width == 1 || height == 1) {
+ assert(1 <= depth);
+
+ halveImageSlice(components,extract,shove, width, height, depth,
+ dataIn, dataOut, elementSizeInBytes, groupSizeInBytes,
+ rowSizeInBytes, imageSizeInBytes, isSwap);
+ return;
+ }
+ {
+ int ii, jj, dd;
+
+ int halfWidth= width / 2;
+ int halfHeight= height / 2;
+ int halfDepth= depth / 2;
+ const char *src= (const char *) dataIn;
+ int rowPadBytes= rowSizeInBytes - (width*groupSizeInBytes);
+ int imagePadBytes= imageSizeInBytes - (width*height*groupSizeInBytes);
+ int outIndex= 0;
+
+ for (dd= 0; dd < halfDepth; dd++) {
+ for (ii= 0; ii< halfHeight; ii++) {
+ for (jj= 0; jj< halfWidth; jj++) {
+ int cc;
+
+ for (cc= 0; cc < components; cc++) {
+ int kk;
+#define BOX8 8
+ double totals[4]; /* 4 is maximum components */
+ double extractTotals[BOX8][4]; /* 4 is maximum components */
+
+ extractTotals[0][cc]= (*extract)(isSwap,src);
+ extractTotals[1][cc]= (*extract)(isSwap,
+ (src+groupSizeInBytes));
+ extractTotals[2][cc]= (*extract)(isSwap,
+ (src+rowSizeInBytes));
+ extractTotals[3][cc]= (*extract)(isSwap,
+ (src+rowSizeInBytes+groupSizeInBytes));
+
+ extractTotals[4][cc]= (*extract)(isSwap,
+ (src+imageSizeInBytes));
+
+ extractTotals[5][cc]= (*extract)(isSwap,
+ (src+groupSizeInBytes+imageSizeInBytes));
+ extractTotals[6][cc]= (*extract)(isSwap,
+ (src+rowSizeInBytes+imageSizeInBytes));
+ extractTotals[7][cc]= (*extract)(isSwap,
+ (src+rowSizeInBytes+groupSizeInBytes+imageSizeInBytes));
+
+ totals[cc]= 0.0;
+
+ /* totals[RED]= extractTotals[0][RED]+extractTotals[1][RED]+
+ * extractTotals[2][RED]+extractTotals[3][RED]+
+ * extractTotals[4][RED]+extractTotals[5][RED]+
+ * extractTotals[6][RED]+extractTotals[7][RED];
+ * totals[RED]/= 8.0;
+ */
+ for (kk = 0; kk < BOX8; kk++) {
+ totals[cc]+= extractTotals[kk][cc];
+ }
+ totals[cc]/= (double)BOX8;
+
+ (*shove)(totals[cc],outIndex,dataOut);
+
+ outIndex++;
+
+ src+= elementSizeInBytes; /* go to next component */
+ } /* for cc */
+
+ /* skip over to next square of 4 */
+ src+= groupSizeInBytes;
+ } /* for jj */
+ /* skip past pad bytes, if any, to get to next row */
+ src+= rowPadBytes;
+
+ /* src is at beginning of a row here, but it's the second row of
+ * the square block of 4 pixels that we just worked on so we
+ * need to go one more row.
+ * i.e.,
+ * OO...
+ * here -->OO...
+ * but want -->OO...
+ * OO...
+ * ...
+ */
+ src+= rowSizeInBytes;
+ } /* for ii */
+
+ /* skip past pad bytes, if any, to get to next image */
+ src+= imagePadBytes;
+
+ src+= imageSizeInBytes;
+ } /* for dd */
+
+ /* both pointers must reach one byte after the end */
+ assert(src == &((const char *)dataIn)[rowSizeInBytes*height*depth]);
+ assert(outIndex == halfWidth * halfHeight * halfDepth * components);
+ }
+} /* halveImage3D() */
+
+
+
+/*** mipmap.c ***/
+
diff --git a/mesalib/src/mapi/glapi/gen/GL3x.xml b/mesalib/src/mapi/glapi/gen/GL3x.xml
index cec9c916e..148635c37 100644
--- a/mesalib/src/mapi/glapi/gen/GL3x.xml
+++ b/mesalib/src/mapi/glapi/gen/GL3x.xml
@@ -1,589 +1,589 @@
-<?xml version="1.0"?>
-<!DOCTYPE OpenGLAPI SYSTEM "gl_API.dtd">
-
-<!-- Note: no GLX protocol info yet. -->
-
-<OpenGLAPI>
-
-<category name="3.0">
-
- <enum name="COMPARE_REF_TO_TEXTURE" value="0x884E"/>
- <enum name="CLIP_DISTANCE0" value="0x3000"/>
- <enum name="CLIP_DISTANCE1" value="0x3001"/>
- <enum name="CLIP_DISTANCE2" value="0x3002"/>
- <enum name="CLIP_DISTANCE3" value="0x3003"/>
- <enum name="CLIP_DISTANCE4" value="0x3004"/>
- <enum name="CLIP_DISTANCE5" value="0x3005"/>
- <enum name="CLIP_DISTANCE6" value="0x3006"/>
- <enum name="CLIP_DISTANCE7" value="0x3007"/>
- <enum name="MAX_CLIP_DISTANCES" value="0x0D32"/>
- <enum name="MAJOR_VERSION" value="0x821B"/>
- <enum name="MINOR_VERSION" value="0x821C"/>
- <enum name="NUM_EXTENSIONS" value="0x821D"/>
- <enum name="CONTEXT_FLAGS" value="0x821E"/>
- <enum name="DEPTH_BUFFER" value="0x8223"/>
- <enum name="STENCIL_BUFFER" value="0x8224"/>
- <enum name="COMPRESSED_RED" value="0x8225"/>
- <enum name="COMPRESSED_RG" value="0x8226"/>
- <enum name="CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT" value="0x0001"/>
- <enum name="RGBA32F" value="0x8814"/>
- <enum name="RGB32F" value="0x8815"/>
- <enum name="RGBA16F" value="0x881A"/>
- <enum name="RGB16F" value="0x881B"/>
- <enum name="VERTEX_ATTRIB_ARRAY_INTEGER" value="0x88FD"/>
- <enum name="MAX_ARRAY_TEXTURE_LAYERS" value="0x88FF"/>
- <enum name="MIN_PROGRAM_TEXEL_OFFSET" value="0x8904"/>
- <enum name="MAX_PROGRAM_TEXEL_OFFSET" value="0x8905"/>
- <enum name="CLAMP_READ_COLOR" value="0x891C"/>
- <enum name="FIXED_ONLY" value="0x891D"/>
- <enum name="MAX_VARYING_COMPONENTS" value="0x8B4B"/>
- <enum name="TEXTURE_1D_ARRAY" value="0x8C18"/>
- <enum name="PROXY_TEXTURE_1D_ARRAY" value="0x8C19"/>
- <enum name="TEXTURE_2D_ARRAY" value="0x8C1A"/>
- <enum name="PROXY_TEXTURE_2D_ARRAY" value="0x8C1B"/>
- <enum name="TEXTURE_BINDING_1D_ARRAY" value="0x8C1C"/>
- <enum name="TEXTURE_BINDING_2D_ARRAY" value="0x8C1D"/>
- <enum name="R11F_G11F_B10F" value="0x8C3A"/>
- <enum name="UNSIGNED_INT_10F_11F_11F_REV" value="0x8C3B"/>
- <enum name="RGB9_E5" value="0x8C3D"/>
- <enum name="UNSIGNED_INT_5_9_9_9_REV" value="0x8C3E"/>
- <enum name="TEXTURE_SHARED_SIZE" value="0x8C3F"/>
- <enum name="TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH" value="0x8C76"/>
- <enum name="TRANSFORM_FEEDBACK_BUFFER_MODE" value="0x8C7F"/>
- <enum name="MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS" value="0x8C80"/>
- <enum name="TRANSFORM_FEEDBACK_VARYINGS" value="0x8C83"/>
- <enum name="TRANSFORM_FEEDBACK_BUFFER_START" value="0x8C84"/>
- <enum name="TRANSFORM_FEEDBACK_BUFFER_SIZE" value="0x8C85"/>
- <enum name="PRIMITIVES_GENERATED" value="0x8C87"/>
- <enum name="TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN" value="0x8C88"/>
- <enum name="RASTERIZER_DISCARD" value="0x8C89"/>
- <enum name="MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS" value="0x8C8A"/>
- <enum name="MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS" value="0x8C8B"/>
- <enum name="INTERLEAVED_ATTRIBS" value="0x8C8C"/>
- <enum name="SEPARATE_ATTRIBS" value="0x8C8D"/>
- <enum name="TRANSFORM_FEEDBACK_BUFFER" value="0x8C8E"/>
- <enum name="TRANSFORM_FEEDBACK_BUFFER_BINDING" value="0x8C8F"/>
- <enum name="RGBA32UI" value="0x8D70"/>
- <enum name="RGB32UI" value="0x8D71"/>
- <enum name="RGBA16UI" value="0x8D76"/>
- <enum name="RGB16UI" value="0x8D77"/>
- <enum name="RGBA8UI" value="0x8D7C"/>
- <enum name="RGB8UI" value="0x8D7D"/>
- <enum name="RGBA32I" value="0x8D82"/>
- <enum name="RGB32I" value="0x8D83"/>
- <enum name="RGBA16I" value="0x8D88"/>
- <enum name="RGB16I" value="0x8D89"/>
- <enum name="RGBA8I" value="0x8D8E"/>
- <enum name="RGB8I" value="0x8D8F"/>
- <enum name="RED_INTEGER" value="0x8D94"/>
- <enum name="GREEN_INTEGER" value="0x8D95"/>
- <enum name="BLUE_INTEGER" value="0x8D96"/>
- <enum name="RGB_INTEGER" value="0x8D98"/>
- <enum name="RGBA_INTEGER" value="0x8D99"/>
- <enum name="BGR_INTEGER" value="0x8D9A"/>
- <enum name="BGRA_INTEGER" value="0x8D9B"/>
- <enum name="SAMPLER_1D_ARRAY" value="0x8DC0"/>
- <enum name="SAMPLER_2D_ARRAY" value="0x8DC1"/>
- <enum name="SAMPLER_1D_ARRAY_SHADOW" value="0x8DC3"/>
- <enum name="SAMPLER_2D_ARRAY_SHADOW" value="0x8DC4"/>
- <enum name="SAMPLER_CUBE_SHADOW" value="0x8DC5"/>
- <enum name="UNSIGNED_INT_VEC2" value="0x8DC6"/>
- <enum name="UNSIGNED_INT_VEC3" value="0x8DC7"/>
- <enum name="UNSIGNED_INT_VEC4" value="0x8DC8"/>
- <enum name="INT_SAMPLER_1D" value="0x8DC9"/>
- <enum name="INT_SAMPLER_2D" value="0x8DCA"/>
- <enum name="INT_SAMPLER_3D" value="0x8DCB"/>
- <enum name="INT_SAMPLER_CUBE" value="0x8DCC"/>
- <enum name="INT_SAMPLER_1D_ARRAY" value="0x8DCE"/>
- <enum name="INT_SAMPLER_2D_ARRAY" value="0x8DCF"/>
- <enum name="UNSIGNED_INT_SAMPLER_1D" value="0x8DD1"/>
- <enum name="UNSIGNED_INT_SAMPLER_2D" value="0x8DD2"/>
- <enum name="UNSIGNED_INT_SAMPLER_3D" value="0x8DD3"/>
- <enum name="UNSIGNED_INT_SAMPLER_CUBE" value="0x8DD4"/>
- <enum name="UNSIGNED_INT_SAMPLER_1D_ARRAY" value="0x8DD6"/>
- <enum name="UNSIGNED_INT_SAMPLER_2D_ARRAY" value="0x8DD7"/>
- <enum name="QUERY_WAIT" value="0x8E13"/>
- <enum name="QUERY_NO_WAIT" value="0x8E14"/>
- <enum name="QUERY_BY_REGION_WAIT" value="0x8E15"/>
- <enum name="QUERY_BY_REGION_NO_WAIT" value="0x8E16"/>
- <enum name="BUFFER_ACCESS_FLAGS" value="0x911F"/>
- <enum name="BUFFER_MAP_LENGTH" value="0x9120"/>
- <enum name="BUFFER_MAP_OFFSET" value="0x9121"/>
-
- <!-- These functions are unique to GL3 -->
-
- <function name="ClearBufferiv" offset="assign">
- <param name="buffer" type="GLenum"/>
- <param name="drawbuffer" type="GLint"/>
- <param name="value" type="const GLint *"/>
- </function>
-
- <function name="ClearBufferuiv" offset="assign">
- <param name="buffer" type="GLenum"/>
- <param name="drawbuffer" type="GLint"/>
- <param name="value" type="const GLuint *"/>
- </function>
-
- <function name="ClearBufferfv" offset="assign">
- <param name="buffer" type="GLenum"/>
- <param name="drawbuffer" type="GLint"/>
- <param name="value" type="const GLfloat *"/>
- </function>
-
- <function name="ClearBufferfi" offset="assign">
- <param name="buffer" type="GLenum"/>
- <param name="drawbuffer" type="GLint"/>
- <param name="depth" type="GLfloat"/>
- <param name="stencil" type="GLint"/>
- </function>
-
- <function name="GetStringi" offset="assign">
- <param name="name" type="GLenum"/>
- <param name="index" type="GLuint"/>
- <return type="const GLubyte *"/>
- </function>
-
- <function name="ClampColor" offset="assign">
- <param name="target" type="GLenum"/>
- <param name="clamp" type="GLenum"/>
- </function>
-
- <!-- These functions alias ones form GL_ARB_draw_buffers2 -->
-
- <function name="ColorMaski" alias="ColorMaskIndexedEXT">
- <param name="buf" type="GLuint"/>
- <param name="r" type="GLboolean"/>
- <param name="g" type="GLboolean"/>
- <param name="b" type="GLboolean"/>
- <param name="a" type="GLboolean"/>
- </function>
-
- <function name="GetBooleani_v" alias="GetBooleanIndexedvEXT">
- <param name="value" type="GLenum"/>
- <param name="index" type="GLuint"/>
- <param name="data" type="GLboolean *"/>
- </function>
-
- <function name="GetIntegeri_v" alias="GetIntegerIndexedvEXT">
- <param name="value" type="GLenum"/>
- <param name="index" type="GLuint"/>
- <param name="data" type="GLint *"/>
- </function>
-
- <function name="Enablei" alias="EnableIndexedEXT">
- <param name="target" type="GLenum"/>
- <param name="index" type="GLuint"/>
- </function>
-
- <function name="Disablei" alias="DisableIndexedEXT">
- <param name="target" type="GLenum"/>
- <param name="index" type="GLuint"/>
- </function>
-
- <function name="IsEnabledi" alias="IsEnabledIndexedEXT">
- <param name="target" type="GLenum"/>
- <param name="index" type="GLuint"/>
- <return type="GLboolean"/>
- </function>
-
- <!-- These functions alias ones form GL_EXT_transform_feedback -->
-
- <function name="GetFragDataLocation" alias="GetFragDataLocationEXT">
- <param name="program" type="GLuint"/>
- <param name="name" type="const GLchar *"/>
- <return type="GLint"/>
- </function>
-
- <function name="BindFragDataLocation" alias="BindFragDataLocationEXT">
- <param name="program" type="GLuint"/>
- <param name="colorNumber" type="GLuint"/>
- <param name="name" type="const GLchar *"/>
- </function>
-
- <function name="BeginTransformFeedback" alias="BeginTransformFeedbackEXT">
- <param name="mode" type="GLenum"/>
- </function>
-
- <function name="EndTransformFeedback" alias="EndTransformFeedbackEXT">
- </function>
-
- <function name="BindBufferRange" alias="BindBufferRangeEXT">
- <param name="target" type="GLenum"/>
- <param name="index" type="GLuint"/>
- <param name="buffer" type="GLuint"/>
- <param name="offset" type="GLintptr"/>
- <param name="size" type="GLsizeiptr"/>
- </function>
-
- <function name="BindBufferBase" alias="BindBufferBaseEXT">
- <param name="target" type="GLenum"/>
- <param name="index" type="GLuint"/>
- <param name="buffer" type="GLuint"/>
- </function>
-
- <function name="TransformFeedbackVaryings" alias="TransformFeedbackVaryingsEXT">
- <param name="program" type="GLuint"/>
- <param name="count" type="GLsizei"/>
- <param name="varyings" type="const GLchar* *"/>
- <param name="bufferMode" type="GLenum"/>
- </function>
-
- <function name="GetTransformFeedbackVarying" alias="GetTransformFeedbackVaryingEXT">
- <param name="program" type="GLuint"/>
- <param name="index" type="GLuint"/>
- <param name="bufSize" type="GLsizei"/>
- <param name="length" type="GLsizei *"/>
- <param name="size" type="GLsizei *"/>
- <param name="type" type="GLenum *"/>
- <param name="name" type="GLchar *"/>
- </function>
-
- <!-- These functions alias ones from GL_NV_conditional_render -->
-
- <function name="BeginConditionalRender" alias="BeginConditionalRenderNV">
- <param name="query" type="GLuint"/>
- <param name="mode" type="GLenum"/>
- </function>
-
- <function name="EndConditionalRender" alias="EndConditionalRenderNV">
- </function>
-
- <!-- These functions alias ones from GL_EXT_gpu_shader4 -->
-
- <function name="VertexAttribIPointer" alias="VertexAttribIPointerEXT">
- <param name="index" type="GLuint"/>
- <param name="size" type="GLint"/>
- <param name="type" type="GLenum"/>
- <param name="stride" type="GLsizei"/>
- <param name="pointer" type="const GLvoid *"/>
- </function>
-
- <function name="GetVertexAttribIiv" alias="GetVertexAttribIivEXT">
- <param name="index" type="GLuint"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLint *"/>
- </function>
-
- <function name="GetVertexAttribIuiv" alias="GetVertexAttribIuivEXT">
- <param name="index" type="GLuint"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLuint *"/>
- </function>
-
- <function name="VertexAttribI1i" alias="VertexAttribI1iEXT">
- <param name="index" type="GLuint"/>
- <param name="x" type="GLint"/>
- </function>
-
- <function name="VertexAttribI2i" alias="VertexAttribI2iEXT">
- <param name="index" type="GLuint"/>
- <param name="x" type="GLint"/>
- <param name="y" type="GLint"/>
- </function>
-
- <function name="VertexAttribI3i" alias="VertexAttribI3iEXT">
- <param name="index" type="GLuint"/>
- <param name="x" type="GLint"/>
- <param name="y" type="GLint"/>
- <param name="z" type="GLint"/>
- </function>
-
- <function name="VertexAttribI4i" alias="VertexAttribI4iEXT">
- <param name="index" type="GLuint"/>
- <param name="x" type="GLint"/>
- <param name="y" type="GLint"/>
- <param name="z" type="GLint"/>
- <param name="w" type="GLint"/>
- </function>
-
- <function name="VertexAttribI1ui" alias="VertexAttribI1uiEXT">
- <param name="index" type="GLuint"/>
- <param name="x" type="GLuint"/>
- </function>
-
- <function name="VertexAttribI2ui" alias="VertexAttribI2uiEXT">
- <param name="index" type="GLuint"/>
- <param name="x" type="GLuint"/>
- <param name="y" type="GLuint"/>
- </function>
-
- <function name="VertexAttribI3ui" alias="VertexAttribI3uiEXT">
- <param name="index" type="GLuint"/>
- <param name="x" type="GLuint"/>
- <param name="y" type="GLuint"/>
- <param name="z" type="GLuint"/>
- </function>
-
- <function name="VertexAttribI4ui" alias="VertexAttribI4uiEXT">
- <param name="index" type="GLuint"/>
- <param name="x" type="GLuint"/>
- <param name="y" type="GLuint"/>
- <param name="z" type="GLuint"/>
- <param name="w" type="GLuint"/>
- </function>
-
- <function name="VertexAttribI1iv" alias="VertexAttribI1ivEXT">
- <param name="index" type="GLuint"/>
- <param name="v" type="const GLint *"/>
- </function>
-
- <function name="VertexAttribI2iv" alias="VertexAttribI2ivEXT">
- <param name="index" type="GLuint"/>
- <param name="v" type="const GLint *"/>
- </function>
-
- <function name="VertexAttribI3iv" alias="VertexAttribI3ivEXT">
- <param name="index" type="GLuint"/>
- <param name="v" type="const GLint *"/>
- </function>
-
- <function name="VertexAttribI4iv" alias="VertexAttribI4ivEXT">
- <param name="index" type="GLuint"/>
- <param name="v" type="const GLint *"/>
- </function>
-
- <function name="VertexAttribI1uiv" alias="VertexAttribI1uivEXT">
- <param name="index" type="GLuint"/>
- <param name="v" type="const GLuint *"/>
- </function>
-
- <function name="VertexAttribI2uiv" alias="VertexAttribI2uivEXT">
- <param name="index" type="GLuint"/>
- <param name="v" type="const GLuint *"/>
- </function>
-
- <function name="VertexAttribI3uiv" alias="VertexAttribI3uivEXT">
- <param name="index" type="GLuint"/>
- <param name="v" type="const GLuint *"/>
- </function>
-
- <function name="VertexAttribI4uiv" alias="VertexAttribI4uivEXT">
- <param name="index" type="GLuint"/>
- <param name="v" type="const GLuint *"/>
- </function>
-
- <function name="VertexAttribI4bv" alias="VertexAttribI4bvEXT">
- <param name="index" type="GLuint"/>
- <param name="v" type="const GLbyte *"/>
- </function>
-
- <function name="VertexAttribI4sv" alias="VertexAttribI4svEXT">
- <param name="index" type="GLuint"/>
- <param name="v" type="const GLshort *"/>
- </function>
-
- <function name="VertexAttribI4ubv" alias="VertexAttribI4ubvEXT">
- <param name="index" type="GLuint"/>
- <param name="v" type="const GLubyte *"/>
- </function>
-
- <function name="VertexAttribI4usv" alias="VertexAttribI4usvEXT">
- <param name="index" type="GLuint"/>
- <param name="v" type="const GLushort *"/>
- </function>
-
- <function name="GetUniformuiv" alias="GetUniformuivEXT">
- <param name="program" type="GLuint"/>
- <param name="location" type="GLint"/>
- <param name="params" type="GLuint *"/>
- </function>
-
- <function name="Uniform1ui" alias="Uniform1uiEXT">
- <param name="location" type="GLint"/>
- <param name="x" type="GLuint"/>
- </function>
-
- <function name="Uniform2ui" alias="Uniform2uiEXT">
- <param name="location" type="GLint"/>
- <param name="x" type="GLuint"/>
- <param name="y" type="GLuint"/>
- </function>
-
- <function name="Uniform3ui" alias="Uniform3uiEXT">
- <param name="location" type="GLint"/>
- <param name="x" type="GLuint"/>
- <param name="y" type="GLuint"/>
- <param name="z" type="GLuint"/>
- </function>
-
- <function name="Uniform4ui" alias="Uniform4uiEXT">
- <param name="location" type="GLint"/>
- <param name="x" type="GLuint"/>
- <param name="y" type="GLuint"/>
- <param name="z" type="GLuint"/>
- <param name="w" type="GLuint"/>
- </function>
-
- <function name="Uniform1uiv" alias="Uniform1uivEXT">
- <param name="location" type="GLint"/>
- <param name="count" type="GLsizei"/>
- <param name="value" type="const GLuint *"/>
- </function>
-
- <function name="Uniform2uiv" alias="Uniform2uivEXT">
- <param name="location" type="GLint"/>
- <param name="count" type="GLsizei"/>
- <param name="value" type="const GLuint *"/>
- </function>
-
- <function name="Uniform3uiv" alias="Uniform3uivEXT">
- <param name="location" type="GLint"/>
- <param name="count" type="GLsizei"/>
- <param name="value" type="const GLuint *"/>
- </function>
-
- <function name="Uniform4uiv" alias="Uniform4uivEXT">
- <param name="location" type="GLint"/>
- <param name="count" type="GLsizei"/>
- <param name="value" type="const GLuint *"/>
- </function>
-
- <!-- These functions alias ones from GL_EXT_texture_integer -->
-
- <function name="TexParameterIiv" alias="TexParameterIivEXT">
- <param name="target" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="const GLint *"/>
- </function>
-
- <function name="TexParameterIuiv" alias="TexParameterIuivEXT">
- <param name="target" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="const GLuint *"/>
- </function>
-
- <function name="GetTexParameterIiv" alias="GetTexParameterIivEXT">
- <param name="target" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLint *"/>
- </function>
-
- <function name="GetTexParameterIuiv" alias="GetTexParameterIuivEXT">
- <param name="target" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLuint *"/>
- </function>
-
-</category>
-
-
-<category name="3.1">
-
- <enum name="SAMPLER_2D_RECT" value="0x8B63"/>
- <enum name="SAMPLER_2D_RECT_SHADOW" value="0x8B64"/>
- <enum name="SAMPLER_BUFFER" value="0x8DC2"/>
- <enum name="INT_SAMPLER_2D_RECT" value="0x8DCD"/>
- <enum name="INT_SAMPLER_BUFFER" value="0x8DD0"/>
- <enum name="UNSIGNED_INT_SAMPLER_2D_RECT" value="0x8DD5"/>
- <enum name="UNSIGNED_INT_SAMPLER_BUFFER" value="0x8DD8"/>
- <enum name="TEXTURE_BUFFER" value="0x8C2A"/>
- <enum name="MAX_TEXTURE_BUFFER_SIZE" value="0x8C2B"/>
- <enum name="TEXTURE_BINDING_BUFFER" value="0x8C2C"/>
- <enum name="TEXTURE_BUFFER_DATA_STORE_BINDING" value="0x8C2D"/>
- <enum name="TEXTURE_BUFFER_FORMAT" value="0x8C2E"/>
- <enum name="TEXTURE_RECTANGLE" value="0x84F5"/>
- <enum name="TEXTURE_BINDING_RECTANGLE" value="0x84F6"/>
- <enum name="PROXY_TEXTURE_RECTANGLE" value="0x84F7"/>
- <enum name="MAX_RECTANGLE_TEXTURE_SIZE" value="0x84F8"/>
- <enum name="RED_SNORM" value="0x8F90"/>
- <enum name="RG_SNORM" value="0x8F91"/>
- <enum name="RGB_SNORM" value="0x8F92"/>
- <enum name="RGBA_SNORM" value="0x8F93"/>
- <enum name="R8_SNORM" value="0x8F94"/>
- <enum name="RG8_SNORM" value="0x8F95"/>
- <enum name="RGB8_SNORM" value="0x8F96"/>
- <enum name="RGBA8_SNORM" value="0x8F97"/>
- <enum name="R16_SNORM" value="0x8F98"/>
- <enum name="RG16_SNORM" value="0x8F99"/>
- <enum name="RGB16_SNORM" value="0x8F9A"/>
- <enum name="RGBA16_SNORM" value="0x8F9B"/>
- <enum name="SIGNED_NORMALIZED" value="0x8F9C"/>
- <enum name="PRIMITIVE_RESTART" value="0x8F9D"/>
- <enum name="PRIMITIVE_RESTART_INDEX" value="0x8F9E"/>
-
- <function name="DrawArraysInstanced" alias="DrawArraysInstancedARB">
- <param name="mode" type="GLenum"/>
- <param name="first" type="GLint"/>
- <param name="count" type="GLsizei"/>
- <param name="primcount" type="GLsizei"/>
- </function>
-
- <function name="DrawElementsInstanced" alias="DrawElementsInstancedARB">
- <param name="mode" type="GLenum"/>
- <param name="count" type="GLsizei"/>
- <param name="type" type="GLenum"/>
- <param name="indices" type="const GLvoid *"/>
- <param name="primcount" type="GLsizei"/>
- </function>
-
- <function name="TexBuffer" offset="assign">
- <param name="target" type="GLenum"/>
- <param name="internalFormat" type="GLenum"/>
- <param name="buffer" type="GLuint"/>
- </function>
-
- <function name="PrimitiveRestartIndex" alias="PrimitiveRestartIndexNV">
- <param name="index" type="GLuint"/>
- </function>
-
-</category>
-
-
-<category name="3.2">
-
- <enum name="CONTEXT_CORE_PROFILE_BIT" value="0x00000001"/>
- <enum name="CONTEXT_COMPATIBILITY_PROFILE_BIT" value="0x00000002"/>
- <enum name="LINES_ADJACENCY" value="0x000A"/>
- <enum name="LINE_STRIP_ADJACENCY" value="0x000B"/>
- <enum name="TRIANGLES_ADJACENCY" value="0x000C"/>
- <enum name="TRIANGLE_STRIP_ADJACENCY" value="0x000D"/>
- <enum name="PROGRAM_POINT_SIZE" value="0x8642"/>
- <enum name="MAX_GEOMETRY_TEXTURE_IMAGE_UNITS" value="0x8C29"/>
- <enum name="FRAMEBUFFER_ATTACHMENT_LAYERED" value="0x8DA7"/>
- <enum name="FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS" value="0x8DA8"/>
- <enum name="GEOMETRY_SHADER" value="0x8DD9"/>
- <enum name="GEOMETRY_VERTICES_OUT" value="0x8916"/>
- <enum name="GEOMETRY_INPUT_TYPE" value="0x8917"/>
- <enum name="GEOMETRY_OUTPUT_TYPE" value="0x8918"/>
- <enum name="MAX_GEOMETRY_UNIFORM_COMPONENTS" value="0x8DDF"/>
- <enum name="MAX_GEOMETRY_OUTPUT_VERTICES" value="0x8DE0"/>
- <enum name="MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS" value="0x8DE1"/>
- <enum name="MAX_VERTEX_OUTPUT_COMPONENTS" value="0x9122"/>
- <enum name="MAX_GEOMETRY_INPUT_COMPONENTS" value="0x9123"/>
- <enum name="MAX_GEOMETRY_OUTPUT_COMPONENTS" value="0x9124"/>
- <enum name="MAX_FRAGMENT_INPUT_COMPONENTS" value="0x9125"/>
- <enum name="CONTEXT_PROFILE_MASK" value="0x9126"/>
-
- <function name="GetInteger64i_v" offset="assign">
- <param name="cap" type="GLenum"/>
- <param name="index" type="GLuint"/>
- <param name="data" type="GLint64 *"/>
- </function>
-
- <function name="GetBufferParameteri64v" offset="assign">
- <param name="target" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLint64 *"/>
- </function>
-
- <function name="FramebufferTexture" offset="assign">
- <param name="target" type="GLenum"/>
- <param name="attachment" type="GLenum"/>
- <param name="texture" type="GLuint"/>
- <param name="level" type="GLint"/>
- </function>
-
-</category>
-
-
-<category name="3.3">
- <!-- There are other new functions and tokens defined by other extensions -->
-
- <function name="VertexAttribDivisor" offset="assign">
- <param name="index" type="GLuint"/>
- <param name="divisor" type="GLuint"/>
- </function>
-
-</category>
-
-</OpenGLAPI>
+<?xml version="1.0"?>
+<!DOCTYPE OpenGLAPI SYSTEM "gl_API.dtd">
+
+<!-- Note: no GLX protocol info yet. -->
+
+<OpenGLAPI>
+
+<category name="3.0">
+
+ <enum name="COMPARE_REF_TO_TEXTURE" value="0x884E"/>
+ <enum name="CLIP_DISTANCE0" value="0x3000"/>
+ <enum name="CLIP_DISTANCE1" value="0x3001"/>
+ <enum name="CLIP_DISTANCE2" value="0x3002"/>
+ <enum name="CLIP_DISTANCE3" value="0x3003"/>
+ <enum name="CLIP_DISTANCE4" value="0x3004"/>
+ <enum name="CLIP_DISTANCE5" value="0x3005"/>
+ <enum name="CLIP_DISTANCE6" value="0x3006"/>
+ <enum name="CLIP_DISTANCE7" value="0x3007"/>
+ <enum name="MAX_CLIP_DISTANCES" value="0x0D32"/>
+ <enum name="MAJOR_VERSION" value="0x821B"/>
+ <enum name="MINOR_VERSION" value="0x821C"/>
+ <enum name="NUM_EXTENSIONS" value="0x821D"/>
+ <enum name="CONTEXT_FLAGS" value="0x821E"/>
+ <enum name="DEPTH_BUFFER" value="0x8223"/>
+ <enum name="STENCIL_BUFFER" value="0x8224"/>
+ <enum name="COMPRESSED_RED" value="0x8225"/>
+ <enum name="COMPRESSED_RG" value="0x8226"/>
+ <enum name="CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT" value="0x0001"/>
+ <enum name="RGBA32F" value="0x8814"/>
+ <enum name="RGB32F" value="0x8815"/>
+ <enum name="RGBA16F" value="0x881A"/>
+ <enum name="RGB16F" value="0x881B"/>
+ <enum name="VERTEX_ATTRIB_ARRAY_INTEGER" value="0x88FD"/>
+ <enum name="MAX_ARRAY_TEXTURE_LAYERS" value="0x88FF"/>
+ <enum name="MIN_PROGRAM_TEXEL_OFFSET" value="0x8904"/>
+ <enum name="MAX_PROGRAM_TEXEL_OFFSET" value="0x8905"/>
+ <enum name="CLAMP_READ_COLOR" value="0x891C"/>
+ <enum name="FIXED_ONLY" value="0x891D"/>
+ <enum name="MAX_VARYING_COMPONENTS" value="0x8B4B"/>
+ <enum name="TEXTURE_1D_ARRAY" value="0x8C18"/>
+ <enum name="PROXY_TEXTURE_1D_ARRAY" value="0x8C19"/>
+ <enum name="TEXTURE_2D_ARRAY" value="0x8C1A"/>
+ <enum name="PROXY_TEXTURE_2D_ARRAY" value="0x8C1B"/>
+ <enum name="TEXTURE_BINDING_1D_ARRAY" value="0x8C1C"/>
+ <enum name="TEXTURE_BINDING_2D_ARRAY" value="0x8C1D"/>
+ <enum name="R11F_G11F_B10F" value="0x8C3A"/>
+ <enum name="UNSIGNED_INT_10F_11F_11F_REV" value="0x8C3B"/>
+ <enum name="RGB9_E5" value="0x8C3D"/>
+ <enum name="UNSIGNED_INT_5_9_9_9_REV" value="0x8C3E"/>
+ <enum name="TEXTURE_SHARED_SIZE" value="0x8C3F"/>
+ <enum name="TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH" value="0x8C76"/>
+ <enum name="TRANSFORM_FEEDBACK_BUFFER_MODE" value="0x8C7F"/>
+ <enum name="MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS" value="0x8C80"/>
+ <enum name="TRANSFORM_FEEDBACK_VARYINGS" value="0x8C83"/>
+ <enum name="TRANSFORM_FEEDBACK_BUFFER_START" value="0x8C84"/>
+ <enum name="TRANSFORM_FEEDBACK_BUFFER_SIZE" value="0x8C85"/>
+ <enum name="PRIMITIVES_GENERATED" value="0x8C87"/>
+ <enum name="TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN" value="0x8C88"/>
+ <enum name="RASTERIZER_DISCARD" value="0x8C89"/>
+ <enum name="MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS" value="0x8C8A"/>
+ <enum name="MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS" value="0x8C8B"/>
+ <enum name="INTERLEAVED_ATTRIBS" value="0x8C8C"/>
+ <enum name="SEPARATE_ATTRIBS" value="0x8C8D"/>
+ <enum name="TRANSFORM_FEEDBACK_BUFFER" value="0x8C8E"/>
+ <enum name="TRANSFORM_FEEDBACK_BUFFER_BINDING" value="0x8C8F"/>
+ <enum name="RGBA32UI" value="0x8D70"/>
+ <enum name="RGB32UI" value="0x8D71"/>
+ <enum name="RGBA16UI" value="0x8D76"/>
+ <enum name="RGB16UI" value="0x8D77"/>
+ <enum name="RGBA8UI" value="0x8D7C"/>
+ <enum name="RGB8UI" value="0x8D7D"/>
+ <enum name="RGBA32I" value="0x8D82"/>
+ <enum name="RGB32I" value="0x8D83"/>
+ <enum name="RGBA16I" value="0x8D88"/>
+ <enum name="RGB16I" value="0x8D89"/>
+ <enum name="RGBA8I" value="0x8D8E"/>
+ <enum name="RGB8I" value="0x8D8F"/>
+ <enum name="RED_INTEGER" value="0x8D94"/>
+ <enum name="GREEN_INTEGER" value="0x8D95"/>
+ <enum name="BLUE_INTEGER" value="0x8D96"/>
+ <enum name="RGB_INTEGER" value="0x8D98"/>
+ <enum name="RGBA_INTEGER" value="0x8D99"/>
+ <enum name="BGR_INTEGER" value="0x8D9A"/>
+ <enum name="BGRA_INTEGER" value="0x8D9B"/>
+ <enum name="SAMPLER_1D_ARRAY" value="0x8DC0"/>
+ <enum name="SAMPLER_2D_ARRAY" value="0x8DC1"/>
+ <enum name="SAMPLER_1D_ARRAY_SHADOW" value="0x8DC3"/>
+ <enum name="SAMPLER_2D_ARRAY_SHADOW" value="0x8DC4"/>
+ <enum name="SAMPLER_CUBE_SHADOW" value="0x8DC5"/>
+ <enum name="UNSIGNED_INT_VEC2" value="0x8DC6"/>
+ <enum name="UNSIGNED_INT_VEC3" value="0x8DC7"/>
+ <enum name="UNSIGNED_INT_VEC4" value="0x8DC8"/>
+ <enum name="INT_SAMPLER_1D" value="0x8DC9"/>
+ <enum name="INT_SAMPLER_2D" value="0x8DCA"/>
+ <enum name="INT_SAMPLER_3D" value="0x8DCB"/>
+ <enum name="INT_SAMPLER_CUBE" value="0x8DCC"/>
+ <enum name="INT_SAMPLER_1D_ARRAY" value="0x8DCE"/>
+ <enum name="INT_SAMPLER_2D_ARRAY" value="0x8DCF"/>
+ <enum name="UNSIGNED_INT_SAMPLER_1D" value="0x8DD1"/>
+ <enum name="UNSIGNED_INT_SAMPLER_2D" value="0x8DD2"/>
+ <enum name="UNSIGNED_INT_SAMPLER_3D" value="0x8DD3"/>
+ <enum name="UNSIGNED_INT_SAMPLER_CUBE" value="0x8DD4"/>
+ <enum name="UNSIGNED_INT_SAMPLER_1D_ARRAY" value="0x8DD6"/>
+ <enum name="UNSIGNED_INT_SAMPLER_2D_ARRAY" value="0x8DD7"/>
+ <enum name="QUERY_WAIT" value="0x8E13"/>
+ <enum name="QUERY_NO_WAIT" value="0x8E14"/>
+ <enum name="QUERY_BY_REGION_WAIT" value="0x8E15"/>
+ <enum name="QUERY_BY_REGION_NO_WAIT" value="0x8E16"/>
+ <enum name="BUFFER_ACCESS_FLAGS" value="0x911F"/>
+ <enum name="BUFFER_MAP_LENGTH" value="0x9120"/>
+ <enum name="BUFFER_MAP_OFFSET" value="0x9121"/>
+
+ <!-- These functions are unique to GL3 -->
+
+ <function name="ClearBufferiv" offset="assign">
+ <param name="buffer" type="GLenum"/>
+ <param name="drawbuffer" type="GLint"/>
+ <param name="value" type="const GLint *"/>
+ </function>
+
+ <function name="ClearBufferuiv" offset="assign">
+ <param name="buffer" type="GLenum"/>
+ <param name="drawbuffer" type="GLint"/>
+ <param name="value" type="const GLuint *"/>
+ </function>
+
+ <function name="ClearBufferfv" offset="assign">
+ <param name="buffer" type="GLenum"/>
+ <param name="drawbuffer" type="GLint"/>
+ <param name="value" type="const GLfloat *"/>
+ </function>
+
+ <function name="ClearBufferfi" offset="assign">
+ <param name="buffer" type="GLenum"/>
+ <param name="drawbuffer" type="GLint"/>
+ <param name="depth" type="GLfloat"/>
+ <param name="stencil" type="GLint"/>
+ </function>
+
+ <function name="GetStringi" offset="assign">
+ <param name="name" type="GLenum"/>
+ <param name="index" type="GLuint"/>
+ <return type="const GLubyte *"/>
+ </function>
+
+ <function name="ClampColor" offset="assign">
+ <param name="target" type="GLenum"/>
+ <param name="clamp" type="GLenum"/>
+ </function>
+
+ <!-- These functions alias ones form GL_ARB_draw_buffers2 -->
+
+ <function name="ColorMaski" alias="ColorMaskIndexedEXT">
+ <param name="buf" type="GLuint"/>
+ <param name="r" type="GLboolean"/>
+ <param name="g" type="GLboolean"/>
+ <param name="b" type="GLboolean"/>
+ <param name="a" type="GLboolean"/>
+ </function>
+
+ <function name="GetBooleani_v" alias="GetBooleanIndexedvEXT">
+ <param name="value" type="GLenum"/>
+ <param name="index" type="GLuint"/>
+ <param name="data" type="GLboolean *"/>
+ </function>
+
+ <function name="GetIntegeri_v" alias="GetIntegerIndexedvEXT">
+ <param name="value" type="GLenum"/>
+ <param name="index" type="GLuint"/>
+ <param name="data" type="GLint *"/>
+ </function>
+
+ <function name="Enablei" alias="EnableIndexedEXT">
+ <param name="target" type="GLenum"/>
+ <param name="index" type="GLuint"/>
+ </function>
+
+ <function name="Disablei" alias="DisableIndexedEXT">
+ <param name="target" type="GLenum"/>
+ <param name="index" type="GLuint"/>
+ </function>
+
+ <function name="IsEnabledi" alias="IsEnabledIndexedEXT">
+ <param name="target" type="GLenum"/>
+ <param name="index" type="GLuint"/>
+ <return type="GLboolean"/>
+ </function>
+
+ <!-- These functions alias ones form GL_EXT_transform_feedback -->
+
+ <function name="GetFragDataLocation" alias="GetFragDataLocationEXT">
+ <param name="program" type="GLuint"/>
+ <param name="name" type="const GLchar *"/>
+ <return type="GLint"/>
+ </function>
+
+ <function name="BindFragDataLocation" alias="BindFragDataLocationEXT">
+ <param name="program" type="GLuint"/>
+ <param name="colorNumber" type="GLuint"/>
+ <param name="name" type="const GLchar *"/>
+ </function>
+
+ <function name="BeginTransformFeedback" alias="BeginTransformFeedbackEXT">
+ <param name="mode" type="GLenum"/>
+ </function>
+
+ <function name="EndTransformFeedback" alias="EndTransformFeedbackEXT">
+ </function>
+
+ <function name="BindBufferRange" alias="BindBufferRangeEXT">
+ <param name="target" type="GLenum"/>
+ <param name="index" type="GLuint"/>
+ <param name="buffer" type="GLuint"/>
+ <param name="offset" type="GLintptr"/>
+ <param name="size" type="GLsizeiptr"/>
+ </function>
+
+ <function name="BindBufferBase" alias="BindBufferBaseEXT">
+ <param name="target" type="GLenum"/>
+ <param name="index" type="GLuint"/>
+ <param name="buffer" type="GLuint"/>
+ </function>
+
+ <function name="TransformFeedbackVaryings" alias="TransformFeedbackVaryingsEXT">
+ <param name="program" type="GLuint"/>
+ <param name="count" type="GLsizei"/>
+ <param name="varyings" type="const GLchar* *"/>
+ <param name="bufferMode" type="GLenum"/>
+ </function>
+
+ <function name="GetTransformFeedbackVarying" alias="GetTransformFeedbackVaryingEXT">
+ <param name="program" type="GLuint"/>
+ <param name="index" type="GLuint"/>
+ <param name="bufSize" type="GLsizei"/>
+ <param name="length" type="GLsizei *"/>
+ <param name="size" type="GLsizei *"/>
+ <param name="type" type="GLenum *"/>
+ <param name="name" type="GLchar *"/>
+ </function>
+
+ <!-- These functions alias ones from GL_NV_conditional_render -->
+
+ <function name="BeginConditionalRender" alias="BeginConditionalRenderNV">
+ <param name="query" type="GLuint"/>
+ <param name="mode" type="GLenum"/>
+ </function>
+
+ <function name="EndConditionalRender" alias="EndConditionalRenderNV">
+ </function>
+
+ <!-- These functions alias ones from GL_EXT_gpu_shader4 -->
+
+ <function name="VertexAttribIPointer" alias="VertexAttribIPointerEXT">
+ <param name="index" type="GLuint"/>
+ <param name="size" type="GLint"/>
+ <param name="type" type="GLenum"/>
+ <param name="stride" type="GLsizei"/>
+ <param name="pointer" type="const GLvoid *"/>
+ </function>
+
+ <function name="GetVertexAttribIiv" alias="GetVertexAttribIivEXT">
+ <param name="index" type="GLuint"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLint *"/>
+ </function>
+
+ <function name="GetVertexAttribIuiv" alias="GetVertexAttribIuivEXT">
+ <param name="index" type="GLuint"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLuint *"/>
+ </function>
+
+ <function name="VertexAttribI1i" alias="VertexAttribI1iEXT">
+ <param name="index" type="GLuint"/>
+ <param name="x" type="GLint"/>
+ </function>
+
+ <function name="VertexAttribI2i" alias="VertexAttribI2iEXT">
+ <param name="index" type="GLuint"/>
+ <param name="x" type="GLint"/>
+ <param name="y" type="GLint"/>
+ </function>
+
+ <function name="VertexAttribI3i" alias="VertexAttribI3iEXT">
+ <param name="index" type="GLuint"/>
+ <param name="x" type="GLint"/>
+ <param name="y" type="GLint"/>
+ <param name="z" type="GLint"/>
+ </function>
+
+ <function name="VertexAttribI4i" alias="VertexAttribI4iEXT">
+ <param name="index" type="GLuint"/>
+ <param name="x" type="GLint"/>
+ <param name="y" type="GLint"/>
+ <param name="z" type="GLint"/>
+ <param name="w" type="GLint"/>
+ </function>
+
+ <function name="VertexAttribI1ui" alias="VertexAttribI1uiEXT">
+ <param name="index" type="GLuint"/>
+ <param name="x" type="GLuint"/>
+ </function>
+
+ <function name="VertexAttribI2ui" alias="VertexAttribI2uiEXT">
+ <param name="index" type="GLuint"/>
+ <param name="x" type="GLuint"/>
+ <param name="y" type="GLuint"/>
+ </function>
+
+ <function name="VertexAttribI3ui" alias="VertexAttribI3uiEXT">
+ <param name="index" type="GLuint"/>
+ <param name="x" type="GLuint"/>
+ <param name="y" type="GLuint"/>
+ <param name="z" type="GLuint"/>
+ </function>
+
+ <function name="VertexAttribI4ui" alias="VertexAttribI4uiEXT">
+ <param name="index" type="GLuint"/>
+ <param name="x" type="GLuint"/>
+ <param name="y" type="GLuint"/>
+ <param name="z" type="GLuint"/>
+ <param name="w" type="GLuint"/>
+ </function>
+
+ <function name="VertexAttribI1iv" alias="VertexAttribI1ivEXT">
+ <param name="index" type="GLuint"/>
+ <param name="v" type="const GLint *"/>
+ </function>
+
+ <function name="VertexAttribI2iv" alias="VertexAttribI2ivEXT">
+ <param name="index" type="GLuint"/>
+ <param name="v" type="const GLint *"/>
+ </function>
+
+ <function name="VertexAttribI3iv" alias="VertexAttribI3ivEXT">
+ <param name="index" type="GLuint"/>
+ <param name="v" type="const GLint *"/>
+ </function>
+
+ <function name="VertexAttribI4iv" alias="VertexAttribI4ivEXT">
+ <param name="index" type="GLuint"/>
+ <param name="v" type="const GLint *"/>
+ </function>
+
+ <function name="VertexAttribI1uiv" alias="VertexAttribI1uivEXT">
+ <param name="index" type="GLuint"/>
+ <param name="v" type="const GLuint *"/>
+ </function>
+
+ <function name="VertexAttribI2uiv" alias="VertexAttribI2uivEXT">
+ <param name="index" type="GLuint"/>
+ <param name="v" type="const GLuint *"/>
+ </function>
+
+ <function name="VertexAttribI3uiv" alias="VertexAttribI3uivEXT">
+ <param name="index" type="GLuint"/>
+ <param name="v" type="const GLuint *"/>
+ </function>
+
+ <function name="VertexAttribI4uiv" alias="VertexAttribI4uivEXT">
+ <param name="index" type="GLuint"/>
+ <param name="v" type="const GLuint *"/>
+ </function>
+
+ <function name="VertexAttribI4bv" alias="VertexAttribI4bvEXT">
+ <param name="index" type="GLuint"/>
+ <param name="v" type="const GLbyte *"/>
+ </function>
+
+ <function name="VertexAttribI4sv" alias="VertexAttribI4svEXT">
+ <param name="index" type="GLuint"/>
+ <param name="v" type="const GLshort *"/>
+ </function>
+
+ <function name="VertexAttribI4ubv" alias="VertexAttribI4ubvEXT">
+ <param name="index" type="GLuint"/>
+ <param name="v" type="const GLubyte *"/>
+ </function>
+
+ <function name="VertexAttribI4usv" alias="VertexAttribI4usvEXT">
+ <param name="index" type="GLuint"/>
+ <param name="v" type="const GLushort *"/>
+ </function>
+
+ <function name="GetUniformuiv" alias="GetUniformuivEXT">
+ <param name="program" type="GLuint"/>
+ <param name="location" type="GLint"/>
+ <param name="params" type="GLuint *"/>
+ </function>
+
+ <function name="Uniform1ui" alias="Uniform1uiEXT">
+ <param name="location" type="GLint"/>
+ <param name="x" type="GLuint"/>
+ </function>
+
+ <function name="Uniform2ui" alias="Uniform2uiEXT">
+ <param name="location" type="GLint"/>
+ <param name="x" type="GLuint"/>
+ <param name="y" type="GLuint"/>
+ </function>
+
+ <function name="Uniform3ui" alias="Uniform3uiEXT">
+ <param name="location" type="GLint"/>
+ <param name="x" type="GLuint"/>
+ <param name="y" type="GLuint"/>
+ <param name="z" type="GLuint"/>
+ </function>
+
+ <function name="Uniform4ui" alias="Uniform4uiEXT">
+ <param name="location" type="GLint"/>
+ <param name="x" type="GLuint"/>
+ <param name="y" type="GLuint"/>
+ <param name="z" type="GLuint"/>
+ <param name="w" type="GLuint"/>
+ </function>
+
+ <function name="Uniform1uiv" alias="Uniform1uivEXT">
+ <param name="location" type="GLint"/>
+ <param name="count" type="GLsizei"/>
+ <param name="value" type="const GLuint *"/>
+ </function>
+
+ <function name="Uniform2uiv" alias="Uniform2uivEXT">
+ <param name="location" type="GLint"/>
+ <param name="count" type="GLsizei"/>
+ <param name="value" type="const GLuint *"/>
+ </function>
+
+ <function name="Uniform3uiv" alias="Uniform3uivEXT">
+ <param name="location" type="GLint"/>
+ <param name="count" type="GLsizei"/>
+ <param name="value" type="const GLuint *"/>
+ </function>
+
+ <function name="Uniform4uiv" alias="Uniform4uivEXT">
+ <param name="location" type="GLint"/>
+ <param name="count" type="GLsizei"/>
+ <param name="value" type="const GLuint *"/>
+ </function>
+
+ <!-- These functions alias ones from GL_EXT_texture_integer -->
+
+ <function name="TexParameterIiv" alias="TexParameterIivEXT">
+ <param name="target" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="const GLint *"/>
+ </function>
+
+ <function name="TexParameterIuiv" alias="TexParameterIuivEXT">
+ <param name="target" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="const GLuint *"/>
+ </function>
+
+ <function name="GetTexParameterIiv" alias="GetTexParameterIivEXT">
+ <param name="target" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLint *"/>
+ </function>
+
+ <function name="GetTexParameterIuiv" alias="GetTexParameterIuivEXT">
+ <param name="target" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLuint *"/>
+ </function>
+
+</category>
+
+
+<category name="3.1">
+
+ <enum name="SAMPLER_2D_RECT" value="0x8B63"/>
+ <enum name="SAMPLER_2D_RECT_SHADOW" value="0x8B64"/>
+ <enum name="SAMPLER_BUFFER" value="0x8DC2"/>
+ <enum name="INT_SAMPLER_2D_RECT" value="0x8DCD"/>
+ <enum name="INT_SAMPLER_BUFFER" value="0x8DD0"/>
+ <enum name="UNSIGNED_INT_SAMPLER_2D_RECT" value="0x8DD5"/>
+ <enum name="UNSIGNED_INT_SAMPLER_BUFFER" value="0x8DD8"/>
+ <enum name="TEXTURE_BUFFER" value="0x8C2A"/>
+ <enum name="MAX_TEXTURE_BUFFER_SIZE" value="0x8C2B"/>
+ <enum name="TEXTURE_BINDING_BUFFER" value="0x8C2C"/>
+ <enum name="TEXTURE_BUFFER_DATA_STORE_BINDING" value="0x8C2D"/>
+ <enum name="TEXTURE_BUFFER_FORMAT" value="0x8C2E"/>
+ <enum name="TEXTURE_RECTANGLE" value="0x84F5"/>
+ <enum name="TEXTURE_BINDING_RECTANGLE" value="0x84F6"/>
+ <enum name="PROXY_TEXTURE_RECTANGLE" value="0x84F7"/>
+ <enum name="MAX_RECTANGLE_TEXTURE_SIZE" value="0x84F8"/>
+ <enum name="RED_SNORM" value="0x8F90"/>
+ <enum name="RG_SNORM" value="0x8F91"/>
+ <enum name="RGB_SNORM" value="0x8F92"/>
+ <enum name="RGBA_SNORM" value="0x8F93"/>
+ <enum name="R8_SNORM" value="0x8F94"/>
+ <enum name="RG8_SNORM" value="0x8F95"/>
+ <enum name="RGB8_SNORM" value="0x8F96"/>
+ <enum name="RGBA8_SNORM" value="0x8F97"/>
+ <enum name="R16_SNORM" value="0x8F98"/>
+ <enum name="RG16_SNORM" value="0x8F99"/>
+ <enum name="RGB16_SNORM" value="0x8F9A"/>
+ <enum name="RGBA16_SNORM" value="0x8F9B"/>
+ <enum name="SIGNED_NORMALIZED" value="0x8F9C"/>
+ <enum name="PRIMITIVE_RESTART" value="0x8F9D"/>
+ <enum name="PRIMITIVE_RESTART_INDEX" value="0x8F9E"/>
+
+ <function name="DrawArraysInstanced" alias="DrawArraysInstancedARB">
+ <param name="mode" type="GLenum"/>
+ <param name="first" type="GLint"/>
+ <param name="count" type="GLsizei"/>
+ <param name="primcount" type="GLsizei"/>
+ </function>
+
+ <function name="DrawElementsInstanced" alias="DrawElementsInstancedARB">
+ <param name="mode" type="GLenum"/>
+ <param name="count" type="GLsizei"/>
+ <param name="type" type="GLenum"/>
+ <param name="indices" type="const GLvoid *"/>
+ <param name="primcount" type="GLsizei"/>
+ </function>
+
+ <function name="TexBuffer" offset="assign">
+ <param name="target" type="GLenum"/>
+ <param name="internalFormat" type="GLenum"/>
+ <param name="buffer" type="GLuint"/>
+ </function>
+
+ <function name="PrimitiveRestartIndex" alias="PrimitiveRestartIndexNV">
+ <param name="index" type="GLuint"/>
+ </function>
+
+</category>
+
+
+<category name="3.2">
+
+ <enum name="CONTEXT_CORE_PROFILE_BIT" value="0x00000001"/>
+ <enum name="CONTEXT_COMPATIBILITY_PROFILE_BIT" value="0x00000002"/>
+ <enum name="LINES_ADJACENCY" value="0x000A"/>
+ <enum name="LINE_STRIP_ADJACENCY" value="0x000B"/>
+ <enum name="TRIANGLES_ADJACENCY" value="0x000C"/>
+ <enum name="TRIANGLE_STRIP_ADJACENCY" value="0x000D"/>
+ <enum name="PROGRAM_POINT_SIZE" value="0x8642"/>
+ <enum name="MAX_GEOMETRY_TEXTURE_IMAGE_UNITS" value="0x8C29"/>
+ <enum name="FRAMEBUFFER_ATTACHMENT_LAYERED" value="0x8DA7"/>
+ <enum name="FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS" value="0x8DA8"/>
+ <enum name="GEOMETRY_SHADER" value="0x8DD9"/>
+ <enum name="GEOMETRY_VERTICES_OUT" value="0x8916"/>
+ <enum name="GEOMETRY_INPUT_TYPE" value="0x8917"/>
+ <enum name="GEOMETRY_OUTPUT_TYPE" value="0x8918"/>
+ <enum name="MAX_GEOMETRY_UNIFORM_COMPONENTS" value="0x8DDF"/>
+ <enum name="MAX_GEOMETRY_OUTPUT_VERTICES" value="0x8DE0"/>
+ <enum name="MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS" value="0x8DE1"/>
+ <enum name="MAX_VERTEX_OUTPUT_COMPONENTS" value="0x9122"/>
+ <enum name="MAX_GEOMETRY_INPUT_COMPONENTS" value="0x9123"/>
+ <enum name="MAX_GEOMETRY_OUTPUT_COMPONENTS" value="0x9124"/>
+ <enum name="MAX_FRAGMENT_INPUT_COMPONENTS" value="0x9125"/>
+ <enum name="CONTEXT_PROFILE_MASK" value="0x9126"/>
+
+ <function name="GetInteger64i_v" offset="assign">
+ <param name="cap" type="GLenum"/>
+ <param name="index" type="GLuint"/>
+ <param name="data" type="GLint64 *"/>
+ </function>
+
+ <function name="GetBufferParameteri64v" offset="assign">
+ <param name="target" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLint64 *"/>
+ </function>
+
+ <function name="FramebufferTexture" offset="assign">
+ <param name="target" type="GLenum"/>
+ <param name="attachment" type="GLenum"/>
+ <param name="texture" type="GLuint"/>
+ <param name="level" type="GLint"/>
+ </function>
+
+</category>
+
+
+<category name="3.3">
+ <!-- There are other new functions and tokens defined by other extensions -->
+
+ <function name="VertexAttribDivisor" offset="assign">
+ <param name="index" type="GLuint"/>
+ <param name="divisor" type="GLuint"/>
+ </function>
+
+</category>
+
+</OpenGLAPI>
diff --git a/mesalib/src/mapi/glapi/gen/Makefile b/mesalib/src/mapi/glapi/gen/Makefile
index 87b928ccf..8dec628dd 100644
--- a/mesalib/src/mapi/glapi/gen/Makefile
+++ b/mesalib/src/mapi/glapi/gen/Makefile
@@ -1,231 +1,231 @@
-# This file isn't used during a normal compilation since we don't want to
-# require Python in order to compile Mesa.
-# Instead, when the Mesa developers update/change the API interface it's
-# up to him/her to re-run this makefile and check in the newly generated files.
-
-
-TOP = ../../../..
-include $(TOP)/configs/current
-
-MESA_DIR = $(TOP)/src/mesa
-MESA_GLAPI_DIR = $(TOP)/src/mapi/glapi
-MESA_MAPI_DIR = $(TOP)/src/mapi/mapi
-MESA_GLX_DIR = $(TOP)/src/glx
-
-MESA_GLAPI_OUTPUTS = \
- $(MESA_GLAPI_DIR)/glapi_mapi_tmp.h \
- $(MESA_GLAPI_DIR)/glprocs.h \
- $(MESA_GLAPI_DIR)/glapitemp.h \
- $(MESA_GLAPI_DIR)/glapitable.h
-
-MESA_GLAPI_ASM_OUTPUTS = \
- $(MESA_GLAPI_DIR)/glapi_x86.S \
- $(MESA_GLAPI_DIR)/glapi_x86-64.S \
- $(MESA_GLAPI_DIR)/glapi_sparc.S
-
-MESA_OUTPUTS = \
- $(MESA_GLAPI_OUTPUTS) \
- $(MESA_GLAPI_ASM_OUTPUTS) \
- $(MESA_DIR)/main/enums.c \
- $(MESA_DIR)/main/glapidispatch.h \
- $(MESA_DIR)/main/remap_helper.h \
- $(MESA_GLX_DIR)/indirect.c \
- $(MESA_GLX_DIR)/indirect.h \
- $(MESA_GLX_DIR)/indirect_init.c \
- $(MESA_GLX_DIR)/indirect_size.h \
- $(MESA_GLX_DIR)/indirect_size.c
-
-######################################################################
-
-XORG_GLX_DIR = $(XORG_BASE)/glx
-XORG_GLAPI_DIR = $(XORG_BASE)/glx
-
-XORG_GLAPI_FILES = \
- $(XORG_GLAPI_DIR)/glapi_getproc.c \
- $(XORG_GLAPI_DIR)/glapi_nop.c \
- $(XORG_GLAPI_DIR)/glthread.c \
- $(XORG_GLAPI_DIR)/glthread.h
-
-XORG_GLAPI_OUTPUTS = \
- $(XORG_GLAPI_DIR)/glprocs.h \
- $(XORG_GLAPI_DIR)/glapioffsets.h \
- $(XORG_GLAPI_DIR)/glapitable.h \
- $(XORG_GLAPI_DIR)/glapidispatch.h
-
-XORG_OUTPUTS = \
- $(XORG_GLAPI_FILES) \
- $(XORG_GLAPI_OUTPUTS) \
- $(XORG_GLX_DIR)/indirect_dispatch.c \
- $(XORG_GLX_DIR)/indirect_dispatch_swap.c \
- $(XORG_GLX_DIR)/indirect_dispatch.h \
- $(XORG_GLX_DIR)/indirect_reqsize.c \
- $(XORG_GLX_DIR)/indirect_reqsize.h \
- $(XORG_GLX_DIR)/indirect_size.h \
- $(XORG_GLX_DIR)/indirect_size_get.c \
- $(XORG_GLX_DIR)/indirect_size_get.h \
- $(XORG_GLX_DIR)/indirect_table.c
-
-######################################################################
-
-API_XML = \
- gl_API.xml \
- ARB_color_buffer_float.xml \
- ARB_copy_buffer.xml \
- ARB_depth_clamp.xml \
- ARB_draw_buffers_blend.xml \
- ARB_draw_elements_base_vertex.xml \
- ARB_draw_instanced.xml \
- ARB_ES2_compatibility.xml \
- ARB_framebuffer_object.xml \
- ARB_geometry_shader4.xml \
- ARB_instanced_arrays.xml \
- ARB_map_buffer_range.xml \
- ARB_robustness.xml \
- ARB_sampler_objects.xml \
- ARB_seamless_cube_map.xml \
- ARB_sync.xml \
- ARB_texture_buffer_object.xml \
- ARB_vertex_array_object.xml \
- AMD_draw_buffers_blend.xml \
- APPLE_object_purgeable.xml \
- APPLE_vertex_array_object.xml \
- EXT_draw_buffers2.xml \
- EXT_framebuffer_object.xml \
- EXT_gpu_shader4.xml \
- EXT_packed_depth_stencil.xml \
- EXT_provoking_vertex.xml \
- EXT_separate_shader_objects.xml \
- EXT_texture_array.xml \
- EXT_texture_integer.xml \
- EXT_transform_feedback.xml \
- NV_conditional_render.xml \
- NV_primitive_restart.xml \
- NV_texture_barrier.xml \
- OES_EGL_image.xml \
- GL3x.xml
-
-
-COMMON = $(API_XML) gl_XML.py glX_XML.py license.py typeexpr.py
-
-COMMON_ES = \
- $(COMMON) \
- gl_and_es_API.xml \
- es_EXT.xml \
- ARB_ES2_compatibility.xml \
- ARB_get_program_binary.xml \
- OES_fixed_point.xml \
- OES_single_precision.xml
-
-COMMON_GLX = $(COMMON) glX_API.xml glX_XML.py glX_proto_common.py
-
-######################################################################
-
-all: mesa xorg
-
-mesa: $(MESA_OUTPUTS)
-
-xorg: check-xorg-source $(XORG_OUTPUTS)
-
-check-xorg-source:
- @if ! test -d $(XORG_GLX_DIR); then \
- echo "ERROR: Must specify path to xserver/GL/ checkout; set XORG_BASE env var."; \
- exit 1; \
- fi
-
-clean:
- -rm -f *~ *.pyo
- -rm -f $(MESA_OUTPUTS)
-
-######################################################################
-
-$(XORG_GLAPI_DIR)/%.c: $(MESA_GLAPI_DIR)/%.c
- cp $< $@
-
-$(XORG_GLAPI_DIR)/%.h: $(MESA_GLAPI_DIR)/%.h
- cp $< $@
-
-######################################################################
-
-$(MESA_GLAPI_DIR)/glapi_mapi_tmp.h: $(MESA_MAPI_DIR)/mapi_abi.py $(COMMON_ES)
- $(PYTHON2) $(PYTHON_FLAGS) $< \
- --printer glapi --mode lib gl_and_es_API.xml > $@
-
-$(MESA_GLAPI_DIR)/glprocs.h: gl_procs.py $(COMMON)
- $(PYTHON2) $(PYTHON_FLAGS) $< > $@
-
-$(MESA_GLAPI_DIR)/glapitemp.h: gl_apitemp.py $(COMMON)
- $(PYTHON2) $(PYTHON_FLAGS) $< > $@
-
-$(MESA_GLAPI_DIR)/glapitable.h: gl_table.py $(COMMON)
- $(PYTHON2) $(PYTHON_FLAGS) $< > $@
-
-######################################################################
-
-$(MESA_GLAPI_DIR)/glapi_x86.S: gl_x86_asm.py $(COMMON)
- $(PYTHON2) $(PYTHON_FLAGS) $< > $@
-
-$(MESA_GLAPI_DIR)/glapi_x86-64.S: gl_x86-64_asm.py $(COMMON)
- $(PYTHON2) $(PYTHON_FLAGS) $< > $@
-
-$(MESA_GLAPI_DIR)/glapi_sparc.S: gl_SPARC_asm.py $(COMMON)
- $(PYTHON2) $(PYTHON_FLAGS) $< > $@
-
-######################################################################
-
-$(MESA_DIR)/main/enums.c: gl_enums.py $(COMMON) $(ES_API)
- $(PYTHON2) $(PYTHON_FLAGS) $< -f gl_API.xml \
- -f $(MESA_GLAPI_DIR)/gen-es/es1_API.xml \
- -f $(MESA_GLAPI_DIR)/gen-es/es2_API.xml > $@
-
-$(MESA_DIR)/main/glapidispatch.h: gl_table.py $(COMMON)
- $(PYTHON2) $(PYTHON_FLAGS) $< -m remap_table > $@
-
-$(MESA_DIR)/main/remap_helper.h: remap_helper.py $(COMMON)
- $(PYTHON2) $(PYTHON_FLAGS) $< > $@
-
-######################################################################
-
-$(MESA_GLX_DIR)/indirect.c: glX_proto_send.py $(COMMON_GLX)
- $(PYTHON2) $(PYTHON_FLAGS) $< -m proto | $(INDENT) $(INDENT_FLAGS) > $@
-
-$(MESA_GLX_DIR)/indirect.h: glX_proto_send.py $(COMMON_GLX)
- $(PYTHON2) $(PYTHON_FLAGS) $< -m init_h > $@
-
-$(MESA_GLX_DIR)/indirect_init.c: glX_proto_send.py $(COMMON_GLX)
- $(PYTHON2) $(PYTHON_FLAGS) $< -m init_c > $@
-
-$(MESA_GLX_DIR)/indirect_size.h $(XORG_GLX_DIR)/indirect_size.h: glX_proto_size.py $(COMMON_GLX)
- $(PYTHON2) $(PYTHON_FLAGS) $< -m size_h --only-set -h _INDIRECT_SIZE_H_ \
- | $(INDENT) $(INDENT_FLAGS) > $@
-
-$(MESA_GLX_DIR)/indirect_size.c: glX_proto_size.py $(COMMON_GLX)
- $(PYTHON2) $(PYTHON_FLAGS) $< -m size_c --only-set \
- | $(INDENT) $(INDENT_FLAGS) > $@
-
-######################################################################
-
-$(XORG_GLX_DIR)/indirect_dispatch.c: glX_proto_recv.py $(COMMON_GLX)
- $(PYTHON2) $(PYTHON_FLAGS) $< -m dispatch_c > $@
-
-$(XORG_GLX_DIR)/indirect_dispatch_swap.c: glX_proto_recv.py $(COMMON_GLX)
- $(PYTHON2) $(PYTHON_FLAGS) $< -m dispatch_c -s > $@
-
-$(XORG_GLX_DIR)/indirect_dispatch.h: glX_proto_recv.py gl_and_glX_API.xml $(COMMON_GLX)
- $(PYTHON2) $(PYTHON_FLAGS) $< -m dispatch_h -f gl_and_glX_API.xml -s > $@
-
-$(XORG_GLX_DIR)/indirect_size_get.h: glX_proto_size.py $(COMMON_GLX)
- $(PYTHON2) $(PYTHON_FLAGS) $< -m size_h --only-get -h '_INDIRECT_SIZE_GET_H_' \
- | $(INDENT) $(INDENT_FLAGS) > $@
-
-$(XORG_GLX_DIR)/indirect_size_get.c: glX_proto_size.py $(COMMON_GLX)
- $(PYTHON2) $(PYTHON_FLAGS) $< -m size_c | $(INDENT) $(INDENT_FLAGS) > $@
-
-$(XORG_GLX_DIR)/indirect_reqsize.h: glX_proto_size.py $(COMMON_GLX)
- $(PYTHON2) $(PYTHON_FLAGS) $< -m reqsize_h --only-get -h '_INDIRECT_SIZE_GET_H_' \
- | $(INDENT) $(INDENT_FLAGS) -l200 > $@
-
-$(XORG_GLX_DIR)/indirect_reqsize.c: glX_proto_size.py $(COMMON_GLX)
- $(PYTHON2) $(PYTHON_FLAGS) $< -m reqsize_c | $(INDENT) $(INDENT_FLAGS) > $@
-
-$(XORG_GLX_DIR)/indirect_table.c: glX_server_table.py gl_and_glX_API.xml $(COMMON_GLX)
- $(PYTHON2) $(PYTHON_FLAGS) $< -f gl_and_glX_API.xml > $@
+# This file isn't used during a normal compilation since we don't want to
+# require Python in order to compile Mesa.
+# Instead, when the Mesa developers update/change the API interface it's
+# up to him/her to re-run this makefile and check in the newly generated files.
+
+
+TOP = ../../../..
+include $(TOP)/configs/current
+
+MESA_DIR = $(TOP)/src/mesa
+MESA_GLAPI_DIR = $(TOP)/src/mapi/glapi
+MESA_MAPI_DIR = $(TOP)/src/mapi/mapi
+MESA_GLX_DIR = $(TOP)/src/glx
+
+MESA_GLAPI_OUTPUTS = \
+ $(MESA_GLAPI_DIR)/glapi_mapi_tmp.h \
+ $(MESA_GLAPI_DIR)/glprocs.h \
+ $(MESA_GLAPI_DIR)/glapitemp.h \
+ $(MESA_GLAPI_DIR)/glapitable.h
+
+MESA_GLAPI_ASM_OUTPUTS = \
+ $(MESA_GLAPI_DIR)/glapi_x86.S \
+ $(MESA_GLAPI_DIR)/glapi_x86-64.S \
+ $(MESA_GLAPI_DIR)/glapi_sparc.S
+
+MESA_OUTPUTS = \
+ $(MESA_GLAPI_OUTPUTS) \
+ $(MESA_GLAPI_ASM_OUTPUTS) \
+ $(MESA_DIR)/main/enums.c \
+ $(MESA_DIR)/main/glapidispatch.h \
+ $(MESA_DIR)/main/remap_helper.h \
+ $(MESA_GLX_DIR)/indirect.c \
+ $(MESA_GLX_DIR)/indirect.h \
+ $(MESA_GLX_DIR)/indirect_init.c \
+ $(MESA_GLX_DIR)/indirect_size.h \
+ $(MESA_GLX_DIR)/indirect_size.c
+
+######################################################################
+
+XORG_GLX_DIR = $(XORG_BASE)/glx
+XORG_GLAPI_DIR = $(XORG_BASE)/glx
+
+XORG_GLAPI_FILES = \
+ $(XORG_GLAPI_DIR)/glapi_getproc.c \
+ $(XORG_GLAPI_DIR)/glapi_nop.c \
+ $(XORG_GLAPI_DIR)/glthread.c \
+ $(XORG_GLAPI_DIR)/glthread.h
+
+XORG_GLAPI_OUTPUTS = \
+ $(XORG_GLAPI_DIR)/glprocs.h \
+ $(XORG_GLAPI_DIR)/glapioffsets.h \
+ $(XORG_GLAPI_DIR)/glapitable.h \
+ $(XORG_GLAPI_DIR)/glapidispatch.h
+
+XORG_OUTPUTS = \
+ $(XORG_GLAPI_FILES) \
+ $(XORG_GLAPI_OUTPUTS) \
+ $(XORG_GLX_DIR)/indirect_dispatch.c \
+ $(XORG_GLX_DIR)/indirect_dispatch_swap.c \
+ $(XORG_GLX_DIR)/indirect_dispatch.h \
+ $(XORG_GLX_DIR)/indirect_reqsize.c \
+ $(XORG_GLX_DIR)/indirect_reqsize.h \
+ $(XORG_GLX_DIR)/indirect_size.h \
+ $(XORG_GLX_DIR)/indirect_size_get.c \
+ $(XORG_GLX_DIR)/indirect_size_get.h \
+ $(XORG_GLX_DIR)/indirect_table.c
+
+######################################################################
+
+API_XML = \
+ gl_API.xml \
+ ARB_color_buffer_float.xml \
+ ARB_copy_buffer.xml \
+ ARB_depth_clamp.xml \
+ ARB_draw_buffers_blend.xml \
+ ARB_draw_elements_base_vertex.xml \
+ ARB_draw_instanced.xml \
+ ARB_ES2_compatibility.xml \
+ ARB_framebuffer_object.xml \
+ ARB_geometry_shader4.xml \
+ ARB_instanced_arrays.xml \
+ ARB_map_buffer_range.xml \
+ ARB_robustness.xml \
+ ARB_sampler_objects.xml \
+ ARB_seamless_cube_map.xml \
+ ARB_sync.xml \
+ ARB_texture_buffer_object.xml \
+ ARB_vertex_array_object.xml \
+ AMD_draw_buffers_blend.xml \
+ APPLE_object_purgeable.xml \
+ APPLE_vertex_array_object.xml \
+ EXT_draw_buffers2.xml \
+ EXT_framebuffer_object.xml \
+ EXT_gpu_shader4.xml \
+ EXT_packed_depth_stencil.xml \
+ EXT_provoking_vertex.xml \
+ EXT_separate_shader_objects.xml \
+ EXT_texture_array.xml \
+ EXT_texture_integer.xml \
+ EXT_transform_feedback.xml \
+ NV_conditional_render.xml \
+ NV_primitive_restart.xml \
+ NV_texture_barrier.xml \
+ OES_EGL_image.xml \
+ GL3x.xml
+
+
+COMMON = $(API_XML) gl_XML.py glX_XML.py license.py typeexpr.py
+
+COMMON_ES = \
+ $(COMMON) \
+ gl_and_es_API.xml \
+ es_EXT.xml \
+ ARB_ES2_compatibility.xml \
+ ARB_get_program_binary.xml \
+ OES_fixed_point.xml \
+ OES_single_precision.xml
+
+COMMON_GLX = $(COMMON) glX_API.xml glX_XML.py glX_proto_common.py
+
+######################################################################
+
+all: mesa xorg
+
+mesa: $(MESA_OUTPUTS)
+
+xorg: check-xorg-source $(XORG_OUTPUTS)
+
+check-xorg-source:
+ @if ! test -d $(XORG_GLX_DIR); then \
+ echo "ERROR: Must specify path to xserver/GL/ checkout; set XORG_BASE env var."; \
+ exit 1; \
+ fi
+
+clean:
+ -rm -f *~ *.pyo
+ -rm -f $(MESA_OUTPUTS)
+
+######################################################################
+
+$(XORG_GLAPI_DIR)/%.c: $(MESA_GLAPI_DIR)/%.c
+ cp $< $@
+
+$(XORG_GLAPI_DIR)/%.h: $(MESA_GLAPI_DIR)/%.h
+ cp $< $@
+
+######################################################################
+
+$(MESA_GLAPI_DIR)/glapi_mapi_tmp.h: $(MESA_MAPI_DIR)/mapi_abi.py $(COMMON_ES)
+ $(PYTHON2) $(PYTHON_FLAGS) $< \
+ --printer glapi --mode lib gl_and_es_API.xml > $@
+
+$(MESA_GLAPI_DIR)/glprocs.h: gl_procs.py $(COMMON)
+ $(PYTHON2) $(PYTHON_FLAGS) $< > $@
+
+$(MESA_GLAPI_DIR)/glapitemp.h: gl_apitemp.py $(COMMON)
+ $(PYTHON2) $(PYTHON_FLAGS) $< > $@
+
+$(MESA_GLAPI_DIR)/glapitable.h: gl_table.py $(COMMON)
+ $(PYTHON2) $(PYTHON_FLAGS) $< > $@
+
+######################################################################
+
+$(MESA_GLAPI_DIR)/glapi_x86.S: gl_x86_asm.py $(COMMON)
+ $(PYTHON2) $(PYTHON_FLAGS) $< > $@
+
+$(MESA_GLAPI_DIR)/glapi_x86-64.S: gl_x86-64_asm.py $(COMMON)
+ $(PYTHON2) $(PYTHON_FLAGS) $< > $@
+
+$(MESA_GLAPI_DIR)/glapi_sparc.S: gl_SPARC_asm.py $(COMMON)
+ $(PYTHON2) $(PYTHON_FLAGS) $< > $@
+
+######################################################################
+
+$(MESA_DIR)/main/enums.c: gl_enums.py $(COMMON) $(ES_API)
+ $(PYTHON2) $(PYTHON_FLAGS) $< -f gl_API.xml \
+ -f $(MESA_GLAPI_DIR)/gen-es/es1_API.xml \
+ -f $(MESA_GLAPI_DIR)/gen-es/es2_API.xml > $@
+
+$(MESA_DIR)/main/glapidispatch.h: gl_table.py $(COMMON)
+ $(PYTHON2) $(PYTHON_FLAGS) $< -m remap_table > $@
+
+$(MESA_DIR)/main/remap_helper.h: remap_helper.py $(COMMON)
+ $(PYTHON2) $(PYTHON_FLAGS) $< > $@
+
+######################################################################
+
+$(MESA_GLX_DIR)/indirect.c: glX_proto_send.py $(COMMON_GLX)
+ $(PYTHON2) $(PYTHON_FLAGS) $< -m proto | $(INDENT) $(INDENT_FLAGS) > $@
+
+$(MESA_GLX_DIR)/indirect.h: glX_proto_send.py $(COMMON_GLX)
+ $(PYTHON2) $(PYTHON_FLAGS) $< -m init_h > $@
+
+$(MESA_GLX_DIR)/indirect_init.c: glX_proto_send.py $(COMMON_GLX)
+ $(PYTHON2) $(PYTHON_FLAGS) $< -m init_c > $@
+
+$(MESA_GLX_DIR)/indirect_size.h $(XORG_GLX_DIR)/indirect_size.h: glX_proto_size.py $(COMMON_GLX)
+ $(PYTHON2) $(PYTHON_FLAGS) $< -m size_h --only-set -h _INDIRECT_SIZE_H_ \
+ | $(INDENT) $(INDENT_FLAGS) > $@
+
+$(MESA_GLX_DIR)/indirect_size.c: glX_proto_size.py $(COMMON_GLX)
+ $(PYTHON2) $(PYTHON_FLAGS) $< -m size_c --only-set \
+ | $(INDENT) $(INDENT_FLAGS) > $@
+
+######################################################################
+
+$(XORG_GLX_DIR)/indirect_dispatch.c: glX_proto_recv.py $(COMMON_GLX)
+ $(PYTHON2) $(PYTHON_FLAGS) $< -m dispatch_c > $@
+
+$(XORG_GLX_DIR)/indirect_dispatch_swap.c: glX_proto_recv.py $(COMMON_GLX)
+ $(PYTHON2) $(PYTHON_FLAGS) $< -m dispatch_c -s > $@
+
+$(XORG_GLX_DIR)/indirect_dispatch.h: glX_proto_recv.py gl_and_glX_API.xml $(COMMON_GLX)
+ $(PYTHON2) $(PYTHON_FLAGS) $< -m dispatch_h -f gl_and_glX_API.xml -s > $@
+
+$(XORG_GLX_DIR)/indirect_size_get.h: glX_proto_size.py $(COMMON_GLX)
+ $(PYTHON2) $(PYTHON_FLAGS) $< -m size_h --only-get -h '_INDIRECT_SIZE_GET_H_' \
+ | $(INDENT) $(INDENT_FLAGS) > $@
+
+$(XORG_GLX_DIR)/indirect_size_get.c: glX_proto_size.py $(COMMON_GLX)
+ $(PYTHON2) $(PYTHON_FLAGS) $< -m size_c | $(INDENT) $(INDENT_FLAGS) > $@
+
+$(XORG_GLX_DIR)/indirect_reqsize.h: glX_proto_size.py $(COMMON_GLX)
+ $(PYTHON2) $(PYTHON_FLAGS) $< -m reqsize_h --only-get -h '_INDIRECT_SIZE_GET_H_' \
+ | $(INDENT) $(INDENT_FLAGS) -l200 > $@
+
+$(XORG_GLX_DIR)/indirect_reqsize.c: glX_proto_size.py $(COMMON_GLX)
+ $(PYTHON2) $(PYTHON_FLAGS) $< -m reqsize_c | $(INDENT) $(INDENT_FLAGS) > $@
+
+$(XORG_GLX_DIR)/indirect_table.c: glX_server_table.py gl_and_glX_API.xml $(COMMON_GLX)
+ $(PYTHON2) $(PYTHON_FLAGS) $< -f gl_and_glX_API.xml > $@
diff --git a/mesalib/src/mapi/glapi/gen/gen.bat b/mesalib/src/mapi/glapi/gen/gen.bat
new file mode 100644
index 000000000..2b1826a81
--- /dev/null
+++ b/mesalib/src/mapi/glapi/gen/gen.bat
@@ -0,0 +1,20 @@
+echo on
+glx_server_table.py -f gl_and_glX_API.xml > indirect_table.c
+glx_proto_size.py -m size_h --only-set -h _INDIRECT_SIZE_H_ > indirect_size.h
+glx_proto_size.py -m size_c --only-set > indirect_size.c
+glx_proto_size.py -m size_h --only-get -h _INDIRECT_SIZE_GET_H_ > indirect_size_get.h
+glx_proto_size.py -m size_c --only-get > indirect_size_get.c
+glx_proto_size.py -m reqsize_c > indirect_reqsize.c
+glx_proto_size.py -m reqsize_h --only-get -h _INDIRECT_SIZE_GET_H_ > indirect_reqsize.h
+glx_proto_recv.py -m dispatch_c > indirect_dispatch.c
+glx_proto_recv.py -m dispatch_c -s > indirect_dispatch_swap.c
+glx_proto_recv.py -m dispatch_h -f gl_and_glX_API.xml -s > indirect_dispatch.h
+gl_table.py > glapitable.h
+gl_table.py -m remap_table > dispatch.h
+rem gl_offsets.py > glapioffsets.h
+gl_apitemp.py > glapitemp.h
+gl_procs.py > glprocs.h
+
+glX_proto_send.py -m proto > indirect.c
+glX_proto_send.py -m init_h > indirect.h
+glX_proto_send.py -m init_c > indirect_init.c
diff --git a/mesalib/src/mapi/glapi/gen/gl_API.xml b/mesalib/src/mapi/glapi/gen/gl_API.xml
index 7a7b1e903..a4d3f160b 100644
--- a/mesalib/src/mapi/glapi/gen/gl_API.xml
+++ b/mesalib/src/mapi/glapi/gen/gl_API.xml
@@ -1,12540 +1,12540 @@
-<?xml version="1.0"?>
-<!DOCTYPE OpenGLAPI SYSTEM "gl_API.dtd">
-
-<OpenGLAPI>
-
-<!-- Core versions sorted by version number. -->
-
-<category name="1.0">
- <enum name="FALSE" value="0x0"/>
- <enum name="TRUE" value="0x1"/>
- <enum name="ZERO" value="0x0"/>
- <enum name="ONE" value="0x1"/>
- <enum name="NONE" value="0x0"/>
- <enum name="NO_ERROR" value="0x0"/>
- <enum name="POINTS" value="0x0000"/>
- <enum name="LINES" value="0x0001"/>
- <enum name="LINE_LOOP" value="0x0002"/>
- <enum name="LINE_STRIP" value="0x0003"/>
- <enum name="TRIANGLES" value="0x0004"/>
- <enum name="TRIANGLE_STRIP" value="0x0005"/>
- <enum name="TRIANGLE_FAN" value="0x0006"/>
- <enum name="QUADS" value="0x0007"/>
- <enum name="QUAD_STRIP" value="0x0008"/>
- <enum name="POLYGON" value="0x0009"/>
- <enum name="ACCUM" value="0x0100"/>
- <enum name="LOAD" value="0x0101"/>
- <enum name="RETURN" value="0x0102"/>
- <enum name="MULT" value="0x0103"/>
- <enum name="ADD" value="0x0104"/>
- <enum name="NEVER" value="0x0200"/>
- <enum name="LESS" value="0x0201"/>
- <enum name="EQUAL" value="0x0202"/>
- <enum name="LEQUAL" value="0x0203"/>
- <enum name="GREATER" value="0x0204"/>
- <enum name="NOTEQUAL" value="0x0205"/>
- <enum name="GEQUAL" value="0x0206"/>
- <enum name="ALWAYS" value="0x0207"/>
- <enum name="SRC_COLOR" value="0x0300"/>
- <enum name="ONE_MINUS_SRC_COLOR" value="0x0301"/>
- <enum name="SRC_ALPHA" value="0x0302"/>
- <enum name="ONE_MINUS_SRC_ALPHA" value="0x0303"/>
- <enum name="DST_ALPHA" value="0x0304"/>
- <enum name="ONE_MINUS_DST_ALPHA" value="0x0305"/>
- <enum name="DST_COLOR" value="0x0306"/>
- <enum name="ONE_MINUS_DST_COLOR" value="0x0307"/>
- <enum name="SRC_ALPHA_SATURATE" value="0x0308"/>
- <enum name="FRONT_LEFT" value="0x0400"/>
- <enum name="FRONT_RIGHT" value="0x0401"/>
- <enum name="BACK_LEFT" value="0x0402"/>
- <enum name="BACK_RIGHT" value="0x0403"/>
- <enum name="FRONT" value="0x0404"/>
- <enum name="BACK" value="0x0405"/>
- <enum name="LEFT" value="0x0406"/>
- <enum name="RIGHT" value="0x0407"/>
- <enum name="FRONT_AND_BACK" value="0x0408"/>
- <enum name="AUX0" value="0x0409"/>
- <enum name="AUX1" value="0x040A"/>
- <enum name="AUX2" value="0x040B"/>
- <enum name="AUX3" value="0x040C"/>
- <enum name="INVALID_VALUE" value="0x0501"/>
- <enum name="INVALID_ENUM" value="0x0500"/>
- <enum name="INVALID_OPERATION" value="0x0502"/>
- <enum name="STACK_OVERFLOW" value="0x0503"/>
- <enum name="STACK_UNDERFLOW" value="0x0504"/>
- <enum name="OUT_OF_MEMORY" value="0x0505"/>
- <enum name="2D" value="0x0600"/>
- <enum name="3D" value="0x0601"/>
- <enum name="3D_COLOR" value="0x0602"/>
- <enum name="3D_COLOR_TEXTURE" value="0x0603"/>
- <enum name="4D_COLOR_TEXTURE" value="0x0604"/>
- <enum name="PASS_THROUGH_TOKEN" value="0x0700"/>
- <enum name="POINT_TOKEN" value="0x0701"/>
- <enum name="LINE_TOKEN" value="0x0702"/>
- <enum name="POLYGON_TOKEN" value="0x0703"/>
- <enum name="BITMAP_TOKEN" value="0x0704"/>
- <enum name="DRAW_PIXEL_TOKEN" value="0x0705"/>
- <enum name="COPY_PIXEL_TOKEN" value="0x0706"/>
- <enum name="LINE_RESET_TOKEN" value="0x0707"/>
- <enum name="EXP" value="0x0800"/>
- <enum name="EXP2" value="0x0801"/>
- <enum name="CW" value="0x0900"/>
- <enum name="CCW" value="0x0901"/>
- <enum name="COEFF" value="0x0A00"/>
- <enum name="ORDER" value="0x0A01"/>
- <enum name="DOMAIN" value="0x0A02"/>
- <enum name="CURRENT_COLOR" count="4" value="0x0B00">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="CURRENT_INDEX" count="1" value="0x0B01">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="CURRENT_NORMAL" count="3" value="0x0B02">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="CURRENT_TEXTURE_COORDS" count="4" value="0x0B03">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="CURRENT_RASTER_COLOR" count="4" value="0x0B04">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="CURRENT_RASTER_INDEX" count="1" value="0x0B05">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="CURRENT_RASTER_TEXTURE_COORDS" count="4" value="0x0B06">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="CURRENT_RASTER_POSITION" count="4" value="0x0B07">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="CURRENT_RASTER_POSITION_VALID" count="1" value="0x0B08">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="CURRENT_RASTER_DISTANCE" count="1" value="0x0B09">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="POINT_SMOOTH" count="1" value="0x0B10">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="POINT_SIZE" count="1" value="0x0B11">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="POINT_SIZE_RANGE" count="2" value="0x0B12">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="POINT_SIZE_GRANULARITY" count="1" value="0x0B13">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="LINE_SMOOTH" count="1" value="0x0B20">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="LINE_WIDTH" count="1" value="0x0B21">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="LINE_WIDTH_RANGE" count="2" value="0x0B22">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="LINE_WIDTH_GRANULARITY" count="1" value="0x0B23">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="LINE_STIPPLE" count="1" value="0x0B24">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="LINE_STIPPLE_PATTERN" count="1" value="0x0B25">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="LINE_STIPPLE_REPEAT" count="1" value="0x0B26">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="LIST_MODE" count="1" value="0x0B30">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="MAX_LIST_NESTING" count="1" value="0x0B31">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="LIST_BASE" count="1" value="0x0B32">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="LIST_INDEX" count="1" value="0x0B33">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="POLYGON_MODE" count="2" value="0x0B40">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="POLYGON_SMOOTH" count="1" value="0x0B41">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="POLYGON_STIPPLE" count="1" value="0x0B42">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="EDGE_FLAG" count="1" value="0x0B43">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="CULL_FACE" count="1" value="0x0B44">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="CULL_FACE_MODE" count="1" value="0x0B45">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="FRONT_FACE" count="1" value="0x0B46">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="LIGHTING" count="1" value="0x0B50">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="LIGHT_MODEL_LOCAL_VIEWER" count="1" value="0x0B51">
- <size name="LightModelfv"/>
- <size name="LightModeliv"/>
- <size name="Get" mode="get"/>
- </enum>
- <enum name="LIGHT_MODEL_TWO_SIDE" count="1" value="0x0B52">
- <size name="LightModelfv"/>
- <size name="LightModeliv"/>
- <size name="Get" mode="get"/>
- </enum>
- <enum name="LIGHT_MODEL_AMBIENT" count="4" value="0x0B53">
- <size name="LightModelfv"/>
- <size name="LightModeliv"/>
- <size name="Get" mode="get"/>
- </enum>
- <enum name="SHADE_MODEL" count="1" value="0x0B54">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="COLOR_MATERIAL_FACE" count="1" value="0x0B55">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="COLOR_MATERIAL_PARAMETER" count="1" value="0x0B56">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="COLOR_MATERIAL" count="1" value="0x0B57">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="FOG" count="1" value="0x0B60">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="FOG_INDEX" count="1" value="0x0B61">
- <size name="Fogfv"/>
- <size name="Fogiv"/>
- <size name="Get" mode="get"/>
- </enum>
- <enum name="FOG_DENSITY" count="1" value="0x0B62">
- <size name="Fogfv"/>
- <size name="Fogiv"/>
- <size name="Get" mode="get"/>
- </enum>
- <enum name="FOG_START" count="1" value="0x0B63">
- <size name="Fogfv"/>
- <size name="Fogiv"/>
- <size name="Get" mode="get"/>
- </enum>
- <enum name="FOG_END" count="1" value="0x0B64">
- <size name="Fogfv"/>
- <size name="Fogiv"/>
- <size name="Get" mode="get"/>
- </enum>
- <enum name="FOG_MODE" count="1" value="0x0B65">
- <size name="Fogfv"/>
- <size name="Fogiv"/>
- <size name="Get" mode="get"/>
- </enum>
- <enum name="FOG_COLOR" count="4" value="0x0B66">
- <size name="Fogfv"/>
- <size name="Fogiv"/>
- <size name="Get" mode="get"/>
- </enum>
- <enum name="DEPTH_RANGE" count="2" value="0x0B70">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="DEPTH_TEST" count="1" value="0x0B71">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="DEPTH_WRITEMASK" count="1" value="0x0B72">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="DEPTH_CLEAR_VALUE" count="1" value="0x0B73">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="DEPTH_FUNC" count="1" value="0x0B74">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="ACCUM_CLEAR_VALUE" count="4" value="0x0B80">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="STENCIL_TEST" count="1" value="0x0B90">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="STENCIL_CLEAR_VALUE" count="1" value="0x0B91">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="STENCIL_FUNC" count="1" value="0x0B92">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="STENCIL_VALUE_MASK" count="1" value="0x0B93">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="STENCIL_FAIL" count="1" value="0x0B94">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="STENCIL_PASS_DEPTH_FAIL" count="1" value="0x0B95">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="STENCIL_PASS_DEPTH_PASS" count="1" value="0x0B96">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="STENCIL_REF" count="1" value="0x0B97">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="STENCIL_WRITEMASK" count="1" value="0x0B98">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="MATRIX_MODE" count="1" value="0x0BA0">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="NORMALIZE" count="1" value="0x0BA1">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="VIEWPORT" count="4" value="0x0BA2">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="MODELVIEW_STACK_DEPTH" count="1" value="0x0BA3">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="PROJECTION_STACK_DEPTH" count="1" value="0x0BA4">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="TEXTURE_STACK_DEPTH" count="1" value="0x0BA5">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="MODELVIEW_MATRIX" count="16" value="0x0BA6">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="PROJECTION_MATRIX" count="16" value="0x0BA7">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="TEXTURE_MATRIX" count="16" value="0x0BA8">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="ATTRIB_STACK_DEPTH" count="1" value="0x0BB0">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="CLIENT_ATTRIB_STACK_DEPTH" count="1" value="0x0BB1">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="ALPHA_TEST" count="1" value="0x0BC0">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="ALPHA_TEST_FUNC" count="1" value="0x0BC1">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="ALPHA_TEST_REF" count="1" value="0x0BC2">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="DITHER" count="1" value="0x0BD0">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="BLEND_DST" count="1" value="0x0BE0">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="BLEND_SRC" count="1" value="0x0BE1">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="BLEND" count="1" value="0x0BE2">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="LOGIC_OP_MODE" count="1" value="0x0BF0">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="LOGIC_OP" count="1" value="0x0BF1">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="AUX_BUFFERS" count="1" value="0x0C00">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="DRAW_BUFFER" count="1" value="0x0C01">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="READ_BUFFER" count="1" value="0x0C02">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="SCISSOR_BOX" count="4" value="0x0C10">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="SCISSOR_TEST" count="1" value="0x0C11">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="INDEX_CLEAR_VALUE" count="1" value="0x0C20">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="INDEX_WRITEMASK" count="1" value="0x0C21">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="COLOR_CLEAR_VALUE" count="4" value="0x0C22">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="COLOR_WRITEMASK" count="4" value="0x0C23">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="INDEX_MODE" count="1" value="0x0C30">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="RGBA_MODE" count="1" value="0x0C31">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="DOUBLEBUFFER" count="1" value="0x0C32">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="STEREO" count="1" value="0x0C33">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="RENDER_MODE" count="1" value="0x0C40">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="PERSPECTIVE_CORRECTION_HINT" count="1" value="0x0C50">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="POINT_SMOOTH_HINT" count="1" value="0x0C51">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="LINE_SMOOTH_HINT" count="1" value="0x0C52">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="POLYGON_SMOOTH_HINT" count="1" value="0x0C53">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="FOG_HINT" count="1" value="0x0C54">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="TEXTURE_GEN_S" count="1" value="0x0C60">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="TEXTURE_GEN_T" count="1" value="0x0C61">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="TEXTURE_GEN_R" count="1" value="0x0C62">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="TEXTURE_GEN_Q" count="1" value="0x0C63">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="PIXEL_MAP_I_TO_I" count="1" value="0x0C70">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="PIXEL_MAP_S_TO_S" value="0x0C71"/>
- <enum name="PIXEL_MAP_I_TO_R" value="0x0C72"/>
- <enum name="PIXEL_MAP_I_TO_G" value="0x0C73"/>
- <enum name="PIXEL_MAP_I_TO_B" value="0x0C74"/>
- <enum name="PIXEL_MAP_I_TO_A" value="0x0C75"/>
- <enum name="PIXEL_MAP_R_TO_R" value="0x0C76"/>
- <enum name="PIXEL_MAP_G_TO_G" value="0x0C77"/>
- <enum name="PIXEL_MAP_B_TO_B" value="0x0C78"/>
- <enum name="PIXEL_MAP_A_TO_A" value="0x0C79"/>
- <enum name="PIXEL_MAP_I_TO_I_SIZE" count="1" value="0x0CB0">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="PIXEL_MAP_S_TO_S_SIZE" count="1" value="0x0CB1">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="PIXEL_MAP_I_TO_R_SIZE" count="1" value="0x0CB2">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="PIXEL_MAP_I_TO_G_SIZE" count="1" value="0x0CB3">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="PIXEL_MAP_I_TO_B_SIZE" count="1" value="0x0CB4">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="PIXEL_MAP_I_TO_A_SIZE" count="1" value="0x0CB5">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="PIXEL_MAP_R_TO_R_SIZE" count="1" value="0x0CB6">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="PIXEL_MAP_G_TO_G_SIZE" count="1" value="0x0CB7">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="PIXEL_MAP_B_TO_B_SIZE" count="1" value="0x0CB8">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="PIXEL_MAP_A_TO_A_SIZE" count="1" value="0x0CB9">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="UNPACK_SWAP_BYTES" count="1" value="0x0CF0">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="UNPACK_LSB_FIRST" count="1" value="0x0CF1">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="UNPACK_ROW_LENGTH" count="1" value="0x0CF2">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="UNPACK_SKIP_PIXELS" count="1" value="0x0CF4">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="UNPACK_SKIP_ROWS" count="1" value="0x0CF3">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="UNPACK_ALIGNMENT" count="1" value="0x0CF5">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="PACK_SWAP_BYTES" count="1" value="0x0D00">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="PACK_LSB_FIRST" count="1" value="0x0D01">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="PACK_ROW_LENGTH" count="1" value="0x0D02">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="PACK_SKIP_ROWS" count="1" value="0x0D03">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="PACK_SKIP_PIXELS" count="1" value="0x0D04">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="PACK_ALIGNMENT" count="1" value="0x0D05">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="MAP_COLOR" count="1" value="0x0D10">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="MAP_STENCIL" count="1" value="0x0D11">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="INDEX_SHIFT" count="1" value="0x0D12">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="INDEX_OFFSET" count="1" value="0x0D13">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="RED_SCALE" count="1" value="0x0D14">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="RED_BIAS" count="1" value="0x0D15">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="ZOOM_X" count="1" value="0x0D16">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="ZOOM_Y" count="1" value="0x0D17">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="GREEN_SCALE" count="1" value="0x0D18">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="GREEN_BIAS" count="1" value="0x0D19">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="BLUE_SCALE" count="1" value="0x0D1A">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="BLUE_BIAS" count="1" value="0x0D1B">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="ALPHA_SCALE" count="1" value="0x0D1C">
- <size name="TexEnvfv"/>
- <size name="TexEnviv"/>
- <size name="GetTexEnvfv" mode="get"/>
- <size name="GetTexEnviv" mode="get"/>
- <size name="Get" mode="get"/>
- </enum>
- <enum name="ALPHA_BIAS" count="1" value="0x0D1D">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="DEPTH_SCALE" count="1" value="0x0D1E">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="DEPTH_BIAS" count="1" value="0x0D1F">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="MAX_EVAL_ORDER" count="1" value="0x0D30">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="MAX_LIGHTS" count="1" value="0x0D31">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="MAX_CLIP_PLANES" count="1" value="0x0D32">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="MAX_TEXTURE_SIZE" count="1" value="0x0D33">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="MAX_PIXEL_MAP_TABLE" count="1" value="0x0D34">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="MAX_ATTRIB_STACK_DEPTH" count="1" value="0x0D35">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="MAX_MODELVIEW_STACK_DEPTH" count="1" value="0x0D36">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="MAX_NAME_STACK_DEPTH" count="1" value="0x0D37">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="MAX_PROJECTION_STACK_DEPTH" count="1" value="0x0D38">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="MAX_TEXTURE_STACK_DEPTH" count="1" value="0x0D39">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="MAX_VIEWPORT_DIMS" count="2" value="0x0D3A">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="MAX_CLIENT_ATTRIB_STACK_DEPTH" count="1" value="0x0D3B">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="SUBPIXEL_BITS" count="1" value="0x0D50">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="INDEX_BITS" count="1" value="0x0D51">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="RED_BITS" count="1" value="0x0D52">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="GREEN_BITS" count="1" value="0x0D53">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="BLUE_BITS" count="1" value="0x0D54">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="ALPHA_BITS" count="1" value="0x0D55">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="DEPTH_BITS" count="1" value="0x0D56">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="STENCIL_BITS" count="1" value="0x0D57">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="ACCUM_RED_BITS" count="1" value="0x0D58">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="ACCUM_GREEN_BITS" count="1" value="0x0D59">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="ACCUM_BLUE_BITS" count="1" value="0x0D5A">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="ACCUM_ALPHA_BITS" count="1" value="0x0D5B">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="NAME_STACK_DEPTH" count="1" value="0x0D70">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="AUTO_NORMAL" count="1" value="0x0D80">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="MAP1_COLOR_4" count="4" value="0x0D90">
- <size name="Map1d"/>
- <size name="Map1f"/>
- <size name="Get" count="1" mode="get"/>
- </enum>
- <enum name="MAP1_INDEX" count="1" value="0x0D91">
- <size name="Map1d"/>
- <size name="Map1f"/>
- <size name="Get" count="1" mode="get"/>
- </enum>
- <enum name="MAP1_NORMAL" count="3" value="0x0D92">
- <size name="Map1d"/>
- <size name="Map1f"/>
- <size name="Get" count="1" mode="get"/>
- </enum>
- <enum name="MAP1_TEXTURE_COORD_1" count="1" value="0x0D93">
- <size name="Map1d"/>
- <size name="Map1f"/>
- <size name="Get" count="1" mode="get"/>
- </enum>
- <enum name="MAP1_TEXTURE_COORD_2" count="2" value="0x0D94">
- <size name="Map1d"/>
- <size name="Map1f"/>
- <size name="Get" count="1" mode="get"/>
- </enum>
- <enum name="MAP1_TEXTURE_COORD_3" count="3" value="0x0D95">
- <size name="Map1d"/>
- <size name="Map1f"/>
- <size name="Get" count="1" mode="get"/>
- </enum>
- <enum name="MAP1_TEXTURE_COORD_4" count="4" value="0x0D96">
- <size name="Map1d"/>
- <size name="Map1f"/>
- <size name="Get" count="1" mode="get"/>
- </enum>
- <enum name="MAP1_VERTEX_3" count="3" value="0x0D97">
- <size name="Map1d"/>
- <size name="Map1f"/>
- <size name="Get" count="1" mode="get"/>
- </enum>
- <enum name="MAP1_VERTEX_4" count="4" value="0x0D98">
- <size name="Map1d"/>
- <size name="Map1f"/>
- <size name="Get" count="1" mode="get"/>
- </enum>
- <enum name="MAP2_COLOR_4" count="4" value="0x0DB0">
- <size name="Map2d"/>
- <size name="Map2f"/>
- <size name="Get" count="1" mode="get"/>
- </enum>
- <enum name="MAP2_INDEX" count="1" value="0x0DB1">
- <size name="Map2d"/>
- <size name="Map2f"/>
- <size name="Get" count="1" mode="get"/>
- </enum>
- <enum name="MAP2_NORMAL" count="3" value="0x0DB2">
- <size name="Map2d"/>
- <size name="Map2f"/>
- <size name="Get" count="1" mode="get"/>
- </enum>
- <enum name="MAP2_TEXTURE_COORD_1" count="1" value="0x0DB3">
- <size name="Map2d"/>
- <size name="Map2f"/>
- <size name="Get" count="1" mode="get"/>
- </enum>
- <enum name="MAP2_TEXTURE_COORD_2" count="2" value="0x0DB4">
- <size name="Map2d"/>
- <size name="Map2f"/>
- <size name="Get" count="1" mode="get"/>
- </enum>
- <enum name="MAP2_TEXTURE_COORD_3" count="3" value="0x0DB5">
- <size name="Map2d"/>
- <size name="Map2f"/>
- <size name="Get" count="1" mode="get"/>
- </enum>
- <enum name="MAP2_TEXTURE_COORD_4" count="4" value="0x0DB6">
- <size name="Map2d"/>
- <size name="Map2f"/>
- <size name="Get" count="1" mode="get"/>
- </enum>
- <enum name="MAP2_VERTEX_3" count="3" value="0x0DB7">
- <size name="Map2d"/>
- <size name="Map2f"/>
- <size name="Get" count="1" mode="get"/>
- </enum>
- <enum name="MAP2_VERTEX_4" count="4" value="0x0DB8">
- <size name="Map2d"/>
- <size name="Map2f"/>
- <size name="Get" count="1" mode="get"/>
- </enum>
- <enum name="MAP1_GRID_DOMAIN" count="2" value="0x0DD0">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="MAP1_GRID_SEGMENTS" count="1" value="0x0DD1">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="MAP2_GRID_DOMAIN" count="4" value="0x0DD2">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="MAP2_GRID_SEGMENTS" count="2" value="0x0DD3">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="TEXTURE_1D" count="1" value="0x0DE0">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="TEXTURE_2D" count="1" value="0x0DE1">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="FEEDBACK_BUFFER_POINTER" value="0x0DF0"/>
- <enum name="FEEDBACK_BUFFER_SIZE" value="0x0DF1"/>
- <enum name="FEEDBACK_BUFFER_TYPE" value="0x0DF2"/>
- <enum name="SELECTION_BUFFER_POINTER" value="0x0DF3"/>
- <enum name="SELECTION_BUFFER_SIZE" value="0x0DF4"/>
- <enum name="TEXTURE_WIDTH" count="1" value="0x1000">
- <size name="GetTexLevelParameterfv" mode="get"/>
- <size name="GetTexLevelParameteriv" mode="get"/>
- </enum>
- <enum name="TEXTURE_HEIGHT" count="1" value="0x1001">
- <size name="GetTexLevelParameterfv" mode="get"/>
- <size name="GetTexLevelParameteriv" mode="get"/>
- </enum>
- <enum name="TEXTURE_BORDER" count="1" value="0x1005">
- <size name="GetTexLevelParameterfv" mode="get"/>
- <size name="GetTexLevelParameteriv" mode="get"/>
- </enum>
- <enum name="TEXTURE_COMPONENTS" count="1" value="0x1003">
- <size name="GetTexLevelParameterfv" mode="get"/>
- <size name="GetTexLevelParameteriv" mode="get"/>
- </enum>
- <enum name="TEXTURE_BORDER_COLOR" count="4" value="0x1004">
- <size name="TexParameterfv"/>
- <size name="TexParameteriv"/>
- <size name="GetTexParameterfv" mode="get"/>
- <size name="GetTexParameteriv" mode="get"/>
- </enum>
- <enum name="DONT_CARE" value="0x1100"/>
- <enum name="FASTEST" value="0x1101"/>
- <enum name="NICEST" value="0x1102"/>
- <enum name="AMBIENT" count="4" value="0x1200">
- <size name="Materialfv"/>
- <size name="Materialiv"/>
- <size name="Lightfv"/>
- <size name="Lightiv"/>
- <size name="GetMaterialfv" mode="get"/>
- <size name="GetMaterialiv" mode="get"/>
- <size name="GetLightfv" mode="get"/>
- <size name="GetLightiv" mode="get"/>
- </enum>
- <enum name="DIFFUSE" count="4" value="0x1201">
- <size name="Materialfv"/>
- <size name="Materialiv"/>
- <size name="Lightfv"/>
- <size name="Lightiv"/>
- <size name="GetMaterialfv" mode="get"/>
- <size name="GetMaterialiv" mode="get"/>
- <size name="GetLightfv" mode="get"/>
- <size name="GetLightiv" mode="get"/>
- </enum>
- <enum name="SPECULAR" count="4" value="0x1202">
- <size name="Materialfv"/>
- <size name="Materialiv"/>
- <size name="Lightfv"/>
- <size name="Lightiv"/>
- <size name="GetMaterialfv" mode="get"/>
- <size name="GetMaterialiv" mode="get"/>
- <size name="GetLightfv" mode="get"/>
- <size name="GetLightiv" mode="get"/>
- </enum>
- <enum name="POSITION" count="4" value="0x1203">
- <size name="Lightfv"/>
- <size name="Lightiv"/>
- <size name="GetLightfv" mode="get"/>
- <size name="GetLightiv" mode="get"/>
- </enum>
- <enum name="SPOT_DIRECTION" count="3" value="0x1204">
- <size name="Lightfv"/>
- <size name="Lightiv"/>
- <size name="GetLightfv" mode="get"/>
- <size name="GetLightiv" mode="get"/>
- </enum>
- <enum name="SPOT_EXPONENT" count="1" value="0x1205">
- <size name="Lightfv"/>
- <size name="Lightiv"/>
- <size name="GetLightfv" mode="get"/>
- <size name="GetLightiv" mode="get"/>
- </enum>
- <enum name="SPOT_CUTOFF" count="1" value="0x1206">
- <size name="Lightfv"/>
- <size name="Lightiv"/>
- <size name="GetLightfv" mode="get"/>
- <size name="GetLightiv" mode="get"/>
- </enum>
- <enum name="CONSTANT_ATTENUATION" count="1" value="0x1207">
- <size name="Lightfv"/>
- <size name="Lightiv"/>
- <size name="GetLightfv" mode="get"/>
- <size name="GetLightiv" mode="get"/>
- </enum>
- <enum name="LINEAR_ATTENUATION" count="1" value="0x1208">
- <size name="Lightfv"/>
- <size name="Lightiv"/>
- <size name="GetLightfv" mode="get"/>
- <size name="GetLightiv" mode="get"/>
- </enum>
- <enum name="QUADRATIC_ATTENUATION" count="1" value="0x1209">
- <size name="Lightfv"/>
- <size name="Lightiv"/>
- <size name="GetLightfv" mode="get"/>
- <size name="GetLightiv" mode="get"/>
- </enum>
- <enum name="COMPILE" value="0x1300"/>
- <enum name="COMPILE_AND_EXECUTE" value="0x1301"/>
- <enum name="BYTE" count="1" value="0x1400">
- <size name="CallLists"/>
- </enum>
- <enum name="UNSIGNED_BYTE" count="1" value="0x1401">
- <size name="CallLists"/>
- </enum>
- <enum name="SHORT" count="2" value="0x1402">
- <size name="CallLists"/>
- </enum>
- <enum name="UNSIGNED_SHORT" count="2" value="0x1403">
- <size name="CallLists"/>
- </enum>
- <enum name="INT" count="4" value="0x1404">
- <size name="CallLists"/>
- </enum>
- <enum name="UNSIGNED_INT" count="4" value="0x1405">
- <size name="CallLists"/>
- </enum>
- <enum name="FLOAT" count="4" value="0x1406">
- <size name="CallLists"/>
- </enum>
- <enum name="2_BYTES" count="2" value="0x1407">
- <size name="CallLists"/>
- </enum>
- <enum name="3_BYTES" count="3" value="0x1408">
- <size name="CallLists"/>
- </enum>
- <enum name="4_BYTES" count="4" value="0x1409">
- <size name="CallLists"/>
- </enum>
- <enum name="HALF_FLOAT" count="2" value="0x140B">
- <size name="CallLists"/>
- </enum>
- <enum name="CLEAR" value="0x1500"/>
- <enum name="AND" value="0x1501"/>
- <enum name="AND_REVERSE" value="0x1502"/>
- <enum name="COPY" value="0x1503"/>
- <enum name="AND_INVERTED" value="0x1504"/>
- <enum name="NOOP" value="0x1505"/>
- <enum name="XOR" value="0x1506"/>
- <enum name="OR" value="0x1507"/>
- <enum name="NOR" value="0x1508"/>
- <enum name="EQUIV" value="0x1509"/>
- <enum name="INVERT" value="0x150A"/>
- <enum name="OR_REVERSE" value="0x150B"/>
- <enum name="COPY_INVERTED" value="0x150C"/>
- <enum name="OR_INVERTED" value="0x150D"/>
- <enum name="NAND" value="0x150E"/>
- <enum name="SET" value="0x150F"/>
- <enum name="EMISSION" count="4" value="0x1600">
- <size name="Materialfv"/>
- <size name="Materialiv"/>
- <size name="GetMaterialfv" mode="get"/>
- <size name="GetMaterialiv" mode="get"/>
- </enum>
- <enum name="SHININESS" count="1" value="0x1601">
- <size name="Materialfv"/>
- <size name="Materialiv"/>
- <size name="GetMaterialfv" mode="get"/>
- <size name="GetMaterialiv" mode="get"/>
- </enum>
- <enum name="AMBIENT_AND_DIFFUSE" count="4" value="0x1602">
- <size name="Materialfv"/>
- <size name="Materialiv"/>
- <size name="GetMaterialfv" mode="get"/>
- <size name="GetMaterialiv" mode="get"/>
- </enum>
- <enum name="COLOR_INDEXES" count="3" value="0x1603">
- <size name="Materialfv"/>
- <size name="Materialiv"/>
- <size name="GetMaterialfv" mode="get"/>
- <size name="GetMaterialiv" mode="get"/>
- </enum>
- <enum name="MODELVIEW" value="0x1700"/>
- <enum name="PROJECTION" value="0x1701"/>
- <enum name="TEXTURE" value="0x1702"/>
- <enum name="COLOR" value="0x1800"/>
- <enum name="DEPTH" value="0x1801"/>
- <enum name="STENCIL" value="0x1802"/>
- <enum name="COLOR_INDEX" value="0x1900"/>
- <enum name="STENCIL_INDEX" value="0x1901"/>
- <enum name="DEPTH_COMPONENT" value="0x1902"/>
- <enum name="RED" value="0x1903"/>
- <enum name="GREEN" value="0x1904"/>
- <enum name="BLUE" value="0x1905"/>
- <enum name="ALPHA" value="0x1906"/>
- <enum name="RGBA" value="0x1908"/>
- <enum name="RGB" value="0x1907"/>
- <enum name="LUMINANCE" value="0x1909"/>
- <enum name="LUMINANCE_ALPHA" value="0x190A"/>
- <enum name="BITMAP" value="0x1A00"/>
- <enum name="POINT" value="0x1B00"/>
- <enum name="LINE" value="0x1B01"/>
- <enum name="FILL" value="0x1B02"/>
- <enum name="FEEDBACK" value="0x1C01"/>
- <enum name="RENDER" value="0x1C00"/>
- <enum name="SELECT" value="0x1C02"/>
- <enum name="FLAT" value="0x1D00"/>
- <enum name="SMOOTH" value="0x1D01"/>
- <enum name="KEEP" value="0x1E00"/>
- <enum name="REPLACE" value="0x1E01"/>
- <enum name="INCR" value="0x1E02"/>
- <enum name="DECR" value="0x1E03"/>
- <enum name="VENDOR" value="0x1F00"/>
- <enum name="RENDERER" value="0x1F01"/>
- <enum name="VERSION" value="0x1F02"/>
- <enum name="EXTENSIONS" value="0x1F03"/>
- <enum name="S" value="0x2000"/>
- <enum name="T" value="0x2001"/>
- <enum name="R" value="0x2002"/>
- <enum name="Q" value="0x2003"/>
- <enum name="MODULATE" value="0x2100"/>
- <enum name="DECAL" value="0x2101"/>
- <enum name="TEXTURE_ENV_MODE" count="1" value="0x2200">
- <size name="TexEnvfv"/>
- <size name="TexEnviv"/>
- <size name="GetTexEnvfv" mode="get"/>
- <size name="GetTexEnviv" mode="get"/>
- </enum>
- <enum name="TEXTURE_ENV_COLOR" count="4" value="0x2201">
- <size name="TexEnvfv"/>
- <size name="TexEnviv"/>
- <size name="GetTexEnvfv" mode="get"/>
- <size name="GetTexEnviv" mode="get"/>
- </enum>
- <enum name="TEXTURE_ENV" value="0x2300"/>
- <enum name="EYE_LINEAR" value="0x2400"/>
- <enum name="OBJECT_LINEAR" value="0x2401"/>
- <enum name="SPHERE_MAP" value="0x2402"/>
- <enum name="TEXTURE_GEN_MODE" count="1" value="0x2500">
- <size name="TexGendv"/>
- <size name="TexGenfv"/>
- <size name="TexGeniv"/>
- <size name="GetTexGendv" mode="get"/>
- <size name="GetTexGenfv" mode="get"/>
- <size name="GetTexGeniv" mode="get"/>
- </enum>
- <enum name="OBJECT_PLANE" count="4" value="0x2501">
- <size name="TexGendv"/>
- <size name="TexGenfv"/>
- <size name="TexGeniv"/>
- <size name="GetTexGendv" mode="get"/>
- <size name="GetTexGenfv" mode="get"/>
- <size name="GetTexGeniv" mode="get"/>
- </enum>
- <enum name="EYE_PLANE" count="4" value="0x2502">
- <size name="TexGendv"/>
- <size name="TexGenfv"/>
- <size name="TexGeniv"/>
- <size name="GetTexGendv" mode="get"/>
- <size name="GetTexGenfv" mode="get"/>
- <size name="GetTexGeniv" mode="get"/>
- </enum>
- <enum name="NEAREST" value="0x2600"/>
- <enum name="LINEAR" value="0x2601"/>
- <enum name="NEAREST_MIPMAP_NEAREST" value="0x2700"/>
- <enum name="LINEAR_MIPMAP_NEAREST" value="0x2701"/>
- <enum name="NEAREST_MIPMAP_LINEAR" value="0x2702"/>
- <enum name="LINEAR_MIPMAP_LINEAR" value="0x2703"/>
- <enum name="TEXTURE_MAG_FILTER" count="1" value="0x2800">
- <size name="TexParameterfv"/>
- <size name="TexParameteriv"/>
- <size name="GetTexParameterfv" mode="get"/>
- <size name="GetTexParameteriv" mode="get"/>
- </enum>
- <enum name="TEXTURE_MIN_FILTER" count="1" value="0x2801">
- <size name="TexParameterfv"/>
- <size name="TexParameteriv"/>
- <size name="GetTexParameterfv" mode="get"/>
- <size name="GetTexParameteriv" mode="get"/>
- </enum>
- <enum name="TEXTURE_WRAP_S" count="1" value="0x2802">
- <size name="TexParameterfv"/>
- <size name="TexParameteriv"/>
- <size name="GetTexParameterfv" mode="get"/>
- <size name="GetTexParameteriv" mode="get"/>
- </enum>
- <enum name="TEXTURE_WRAP_T" count="1" value="0x2803">
- <size name="TexParameterfv"/>
- <size name="TexParameteriv"/>
- <size name="GetTexParameterfv" mode="get"/>
- <size name="GetTexParameteriv" mode="get"/>
- </enum>
- <enum name="CLAMP" value="0x2900"/>
- <enum name="REPEAT" value="0x2901"/>
- <enum name="CLIP_PLANE0" count="1" value="0x3000">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="CLIP_PLANE1" count="1" value="0x3001">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="CLIP_PLANE2" count="1" value="0x3002">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="CLIP_PLANE3" count="1" value="0x3003">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="CLIP_PLANE4" count="1" value="0x3004">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="CLIP_PLANE5" count="1" value="0x3005">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="LIGHT0" count="1" value="0x4000">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="LIGHT1" count="1" value="0x4001">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="LIGHT2" count="1" value="0x4002">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="LIGHT3" count="1" value="0x4003">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="LIGHT4" count="1" value="0x4004">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="LIGHT5" count="1" value="0x4005">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="LIGHT6" count="1" value="0x4006">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="LIGHT7" count="1" value="0x4007">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="CURRENT_BIT" value="0x00000001"/>
- <enum name="POINT_BIT" value="0x00000002"/>
- <enum name="LINE_BIT" value="0x00000004"/>
- <enum name="POLYGON_BIT" value="0x00000008"/>
- <enum name="POLYGON_STIPPLE_BIT" value="0x00000010"/>
- <enum name="PIXEL_MODE_BIT" value="0x00000020"/>
- <enum name="LIGHTING_BIT" value="0x00000040"/>
- <enum name="FOG_BIT" value="0x00000080"/>
- <enum name="DEPTH_BUFFER_BIT" value="0x00000100"/>
- <enum name="ACCUM_BUFFER_BIT" value="0x00000200"/>
- <enum name="STENCIL_BUFFER_BIT" value="0x00000400"/>
- <enum name="VIEWPORT_BIT" value="0x00000800"/>
- <enum name="TRANSFORM_BIT" value="0x00001000"/>
- <enum name="ENABLE_BIT" value="0x00002000"/>
- <enum name="COLOR_BUFFER_BIT" value="0x00004000"/>
- <enum name="HINT_BIT" value="0x00008000"/>
- <enum name="EVAL_BIT" value="0x00010000"/>
- <enum name="LIST_BIT" value="0x00020000"/>
- <enum name="TEXTURE_BIT" value="0x00040000"/>
- <enum name="SCISSOR_BIT" value="0x00080000"/>
- <enum name="ALL_ATTRIB_BITS" value="0x000FFFFF"/>
-
- <type name="double" size="8" float="true" glx_name="FLOAT64"/>
- <type name="clampd" size="8" float="true" glx_name="FLOAT64"/>
-
- <type name="float" size="4" float="true" glx_name="FLOAT32"/>
- <type name="clampf" size="4" float="true" glx_name="FLOAT32"/>
-
- <type name="int" size="4" glx_name="CARD32"/>
- <type name="uint" size="4" unsigned="true" glx_name="CARD32"/>
- <type name="sizei" size="4" unsigned="true" glx_name="CARD32"/>
- <type name="enum" size="4" unsigned="true" glx_name="ENUM"/>
- <type name="bitfield" size="4" unsigned="true" glx_name="CARD32"/>
-
- <type name="short" size="2" glx_name="CARD16"/>
- <type name="ushort" size="2" unsigned="true" glx_name="CARD16"/>
-
- <type name="byte" size="1" glx_name="CARD8"/>
- <type name="ubyte" size="1" unsigned="true" glx_name="CARD8"/>
- <type name="boolean" size="1" unsigned="true" glx_name="CARD8"/>
-
- <type name="void" size="1"/>
-
- <function name="NewList" offset="0">
- <param name="list" type="GLuint"/>
- <param name="mode" type="GLenum"/>
- <glx sop="101"/>
- </function>
-
- <function name="EndList" offset="1">
- <glx sop="102"/>
- </function>
-
- <function name="CallList" offset="2">
- <param name="list" type="GLuint"/>
- <glx rop="1"/>
- </function>
-
- <function name="CallLists" offset="3">
- <param name="n" type="GLsizei" counter="true"/>
- <param name="type" type="GLenum"/>
- <param name="lists" type="const GLvoid *" variable_param="type" count="n"/>
- <glx rop="2" large="true"/>
- </function>
-
- <function name="DeleteLists" offset="4">
- <param name="list" type="GLuint"/>
- <param name="range" type="GLsizei"/>
- <glx sop="103"/>
- </function>
-
- <function name="GenLists" offset="5">
- <param name="range" type="GLsizei"/>
- <return type="GLuint"/>
- <glx sop="104"/>
- </function>
-
- <function name="ListBase" offset="6">
- <param name="base" type="GLuint"/>
- <glx rop="3"/>
- </function>
-
- <function name="Begin" offset="7">
- <param name="mode" type="GLenum"/>
- <glx rop="4"/>
- </function>
-
- <function name="Bitmap" offset="8">
- <param name="width" type="GLsizei"/>
- <param name="height" type="GLsizei"/>
- <param name="xorig" type="GLfloat"/>
- <param name="yorig" type="GLfloat"/>
- <param name="xmove" type="GLfloat"/>
- <param name="ymove" type="GLfloat"/>
- <param name="bitmap" type="const GLubyte *" img_width="width" img_height="height" img_format="GL_COLOR_INDEX" img_type="GL_BITMAP" img_target="0" img_pad_dimensions="false"/>
- <glx rop="5" large="true"/>
- </function>
-
- <function name="Color3b" offset="9" vectorequiv="Color3bv">
- <param name="red" type="GLbyte"/>
- <param name="green" type="GLbyte"/>
- <param name="blue" type="GLbyte"/>
- </function>
-
- <function name="Color3bv" offset="10">
- <param name="v" type="const GLbyte *" count="3"/>
- <glx rop="6"/>
- </function>
-
- <function name="Color3d" offset="11" vectorequiv="Color3dv">
- <param name="red" type="GLdouble"/>
- <param name="green" type="GLdouble"/>
- <param name="blue" type="GLdouble"/>
- </function>
-
- <function name="Color3dv" offset="12">
- <param name="v" type="const GLdouble *" count="3"/>
- <glx rop="7"/>
- </function>
-
- <function name="Color3f" offset="13" vectorequiv="Color3fv">
- <param name="red" type="GLfloat"/>
- <param name="green" type="GLfloat"/>
- <param name="blue" type="GLfloat"/>
- </function>
-
- <function name="Color3fv" offset="14">
- <param name="v" type="const GLfloat *" count="3"/>
- <glx rop="8"/>
- </function>
-
- <function name="Color3i" offset="15" vectorequiv="Color3iv">
- <param name="red" type="GLint"/>
- <param name="green" type="GLint"/>
- <param name="blue" type="GLint"/>
- </function>
-
- <function name="Color3iv" offset="16">
- <param name="v" type="const GLint *" count="3"/>
- <glx rop="9"/>
- </function>
-
- <function name="Color3s" offset="17" vectorequiv="Color3sv">
- <param name="red" type="GLshort"/>
- <param name="green" type="GLshort"/>
- <param name="blue" type="GLshort"/>
- </function>
-
- <function name="Color3sv" offset="18">
- <param name="v" type="const GLshort *" count="3"/>
- <glx rop="10"/>
- </function>
-
- <function name="Color3ub" offset="19" vectorequiv="Color3ubv">
- <param name="red" type="GLubyte"/>
- <param name="green" type="GLubyte"/>
- <param name="blue" type="GLubyte"/>
- </function>
-
- <function name="Color3ubv" offset="20">
- <param name="v" type="const GLubyte *" count="3"/>
- <glx rop="11"/>
- </function>
-
- <function name="Color3ui" offset="21" vectorequiv="Color3uiv">
- <param name="red" type="GLuint"/>
- <param name="green" type="GLuint"/>
- <param name="blue" type="GLuint"/>
- </function>
-
- <function name="Color3uiv" offset="22">
- <param name="v" type="const GLuint *" count="3"/>
- <glx rop="12"/>
- </function>
-
- <function name="Color3us" offset="23" vectorequiv="Color3usv">
- <param name="red" type="GLushort"/>
- <param name="green" type="GLushort"/>
- <param name="blue" type="GLushort"/>
- </function>
-
- <function name="Color3usv" offset="24">
- <param name="v" type="const GLushort *" count="3"/>
- <glx rop="13"/>
- </function>
-
- <function name="Color4b" offset="25" vectorequiv="Color4bv">
- <param name="red" type="GLbyte"/>
- <param name="green" type="GLbyte"/>
- <param name="blue" type="GLbyte"/>
- <param name="alpha" type="GLbyte"/>
- </function>
-
- <function name="Color4bv" offset="26">
- <param name="v" type="const GLbyte *" count="4"/>
- <glx rop="14"/>
- </function>
-
- <function name="Color4d" offset="27" vectorequiv="Color4dv">
- <param name="red" type="GLdouble"/>
- <param name="green" type="GLdouble"/>
- <param name="blue" type="GLdouble"/>
- <param name="alpha" type="GLdouble"/>
- </function>
-
- <function name="Color4dv" offset="28">
- <param name="v" type="const GLdouble *" count="4"/>
- <glx rop="15"/>
- </function>
-
- <function name="Color4f" offset="29" vectorequiv="Color4fv">
- <param name="red" type="GLfloat"/>
- <param name="green" type="GLfloat"/>
- <param name="blue" type="GLfloat"/>
- <param name="alpha" type="GLfloat"/>
- </function>
-
- <function name="Color4fv" offset="30">
- <param name="v" type="const GLfloat *" count="4"/>
- <glx rop="16"/>
- </function>
-
- <function name="Color4i" offset="31" vectorequiv="Color4iv">
- <param name="red" type="GLint"/>
- <param name="green" type="GLint"/>
- <param name="blue" type="GLint"/>
- <param name="alpha" type="GLint"/>
- </function>
-
- <function name="Color4iv" offset="32">
- <param name="v" type="const GLint *" count="4"/>
- <glx rop="17"/>
- </function>
-
- <function name="Color4s" offset="33" vectorequiv="Color4sv">
- <param name="red" type="GLshort"/>
- <param name="green" type="GLshort"/>
- <param name="blue" type="GLshort"/>
- <param name="alpha" type="GLshort"/>
- </function>
-
- <function name="Color4sv" offset="34">
- <param name="v" type="const GLshort *" count="4"/>
- <glx rop="18"/>
- </function>
-
- <function name="Color4ub" offset="35" vectorequiv="Color4ubv">
- <param name="red" type="GLubyte"/>
- <param name="green" type="GLubyte"/>
- <param name="blue" type="GLubyte"/>
- <param name="alpha" type="GLubyte"/>
- </function>
-
- <function name="Color4ubv" offset="36">
- <param name="v" type="const GLubyte *" count="4"/>
- <glx rop="19"/>
- </function>
-
- <function name="Color4ui" offset="37" vectorequiv="Color4uiv">
- <param name="red" type="GLuint"/>
- <param name="green" type="GLuint"/>
- <param name="blue" type="GLuint"/>
- <param name="alpha" type="GLuint"/>
- </function>
-
- <function name="Color4uiv" offset="38">
- <param name="v" type="const GLuint *" count="4"/>
- <glx rop="20"/>
- </function>
-
- <function name="Color4us" offset="39" vectorequiv="Color4usv">
- <param name="red" type="GLushort"/>
- <param name="green" type="GLushort"/>
- <param name="blue" type="GLushort"/>
- <param name="alpha" type="GLushort"/>
- </function>
-
- <function name="Color4usv" offset="40">
- <param name="v" type="const GLushort *" count="4"/>
- <glx rop="21"/>
- </function>
-
- <function name="EdgeFlag" offset="41" vectorequiv="EdgeFlagv">
- <param name="flag" type="GLboolean"/>
- </function>
-
- <function name="EdgeFlagv" offset="42">
- <param name="flag" type="const GLboolean *" count="1"/>
- <glx rop="22"/>
- </function>
-
- <function name="End" offset="43">
- <glx rop="23"/>
- </function>
-
- <function name="Indexd" offset="44" vectorequiv="Indexdv">
- <param name="c" type="GLdouble"/>
- </function>
-
- <function name="Indexdv" offset="45">
- <param name="c" type="const GLdouble *" count="1"/>
- <glx rop="24"/>
- </function>
-
- <function name="Indexf" offset="46" vectorequiv="Indexfv">
- <param name="c" type="GLfloat"/>
- </function>
-
- <function name="Indexfv" offset="47">
- <param name="c" type="const GLfloat *" count="1"/>
- <glx rop="25"/>
- </function>
-
- <function name="Indexi" offset="48" vectorequiv="Indexiv">
- <param name="c" type="GLint"/>
- </function>
-
- <function name="Indexiv" offset="49">
- <param name="c" type="const GLint *" count="1"/>
- <glx rop="26"/>
- </function>
-
- <function name="Indexs" offset="50" vectorequiv="Indexsv">
- <param name="c" type="GLshort"/>
- </function>
-
- <function name="Indexsv" offset="51">
- <param name="c" type="const GLshort *" count="1"/>
- <glx rop="27"/>
- </function>
-
- <function name="Normal3b" offset="52" vectorequiv="Normal3bv">
- <param name="nx" type="GLbyte"/>
- <param name="ny" type="GLbyte"/>
- <param name="nz" type="GLbyte"/>
- </function>
-
- <function name="Normal3bv" offset="53">
- <param name="v" type="const GLbyte *" count="3"/>
- <glx rop="28"/>
- </function>
-
- <function name="Normal3d" offset="54" vectorequiv="Normal3dv">
- <param name="nx" type="GLdouble"/>
- <param name="ny" type="GLdouble"/>
- <param name="nz" type="GLdouble"/>
- </function>
-
- <function name="Normal3dv" offset="55">
- <param name="v" type="const GLdouble *" count="3"/>
- <glx rop="29"/>
- </function>
-
- <function name="Normal3f" offset="56" vectorequiv="Normal3fv">
- <param name="nx" type="GLfloat"/>
- <param name="ny" type="GLfloat"/>
- <param name="nz" type="GLfloat"/>
- </function>
-
- <function name="Normal3fv" offset="57">
- <param name="v" type="const GLfloat *" count="3"/>
- <glx rop="30"/>
- </function>
-
- <function name="Normal3i" offset="58" vectorequiv="Normal3iv">
- <param name="nx" type="GLint"/>
- <param name="ny" type="GLint"/>
- <param name="nz" type="GLint"/>
- </function>
-
- <function name="Normal3iv" offset="59">
- <param name="v" type="const GLint *" count="3"/>
- <glx rop="31"/>
- </function>
-
- <function name="Normal3s" offset="60" vectorequiv="Normal3sv">
- <param name="nx" type="GLshort"/>
- <param name="ny" type="GLshort"/>
- <param name="nz" type="GLshort"/>
- </function>
-
- <function name="Normal3sv" offset="61">
- <param name="v" type="const GLshort *" count="3"/>
- <glx rop="32"/>
- </function>
-
- <function name="RasterPos2d" offset="62" vectorequiv="RasterPos2dv">
- <param name="x" type="GLdouble"/>
- <param name="y" type="GLdouble"/>
- </function>
-
- <function name="RasterPos2dv" offset="63">
- <param name="v" type="const GLdouble *" count="2"/>
- <glx rop="33"/>
- </function>
-
- <function name="RasterPos2f" offset="64" vectorequiv="RasterPos2fv">
- <param name="x" type="GLfloat"/>
- <param name="y" type="GLfloat"/>
- </function>
-
- <function name="RasterPos2fv" offset="65">
- <param name="v" type="const GLfloat *" count="2"/>
- <glx rop="34"/>
- </function>
-
- <function name="RasterPos2i" offset="66" vectorequiv="RasterPos2iv">
- <param name="x" type="GLint"/>
- <param name="y" type="GLint"/>
- </function>
-
- <function name="RasterPos2iv" offset="67">
- <param name="v" type="const GLint *" count="2"/>
- <glx rop="35"/>
- </function>
-
- <function name="RasterPos2s" offset="68" vectorequiv="RasterPos2sv">
- <param name="x" type="GLshort"/>
- <param name="y" type="GLshort"/>
- </function>
-
- <function name="RasterPos2sv" offset="69">
- <param name="v" type="const GLshort *" count="2"/>
- <glx rop="36"/>
- </function>
-
- <function name="RasterPos3d" offset="70" vectorequiv="RasterPos3dv">
- <param name="x" type="GLdouble"/>
- <param name="y" type="GLdouble"/>
- <param name="z" type="GLdouble"/>
- </function>
-
- <function name="RasterPos3dv" offset="71">
- <param name="v" type="const GLdouble *" count="3"/>
- <glx rop="37"/>
- </function>
-
- <function name="RasterPos3f" offset="72" vectorequiv="RasterPos3fv">
- <param name="x" type="GLfloat"/>
- <param name="y" type="GLfloat"/>
- <param name="z" type="GLfloat"/>
- </function>
-
- <function name="RasterPos3fv" offset="73">
- <param name="v" type="const GLfloat *" count="3"/>
- <glx rop="38"/>
- </function>
-
- <function name="RasterPos3i" offset="74" vectorequiv="RasterPos3iv">
- <param name="x" type="GLint"/>
- <param name="y" type="GLint"/>
- <param name="z" type="GLint"/>
- </function>
-
- <function name="RasterPos3iv" offset="75">
- <param name="v" type="const GLint *" count="3"/>
- <glx rop="39"/>
- </function>
-
- <function name="RasterPos3s" offset="76" vectorequiv="RasterPos3sv">
- <param name="x" type="GLshort"/>
- <param name="y" type="GLshort"/>
- <param name="z" type="GLshort"/>
- </function>
-
- <function name="RasterPos3sv" offset="77">
- <param name="v" type="const GLshort *" count="3"/>
- <glx rop="40"/>
- </function>
-
- <function name="RasterPos4d" offset="78" vectorequiv="RasterPos4dv">
- <param name="x" type="GLdouble"/>
- <param name="y" type="GLdouble"/>
- <param name="z" type="GLdouble"/>
- <param name="w" type="GLdouble"/>
- </function>
-
- <function name="RasterPos4dv" offset="79">
- <param name="v" type="const GLdouble *" count="4"/>
- <glx rop="41"/>
- </function>
-
- <function name="RasterPos4f" offset="80" vectorequiv="RasterPos4fv">
- <param name="x" type="GLfloat"/>
- <param name="y" type="GLfloat"/>
- <param name="z" type="GLfloat"/>
- <param name="w" type="GLfloat"/>
- </function>
-
- <function name="RasterPos4fv" offset="81">
- <param name="v" type="const GLfloat *" count="4"/>
- <glx rop="42"/>
- </function>
-
- <function name="RasterPos4i" offset="82" vectorequiv="RasterPos4iv">
- <param name="x" type="GLint"/>
- <param name="y" type="GLint"/>
- <param name="z" type="GLint"/>
- <param name="w" type="GLint"/>
- </function>
-
- <function name="RasterPos4iv" offset="83">
- <param name="v" type="const GLint *" count="4"/>
- <glx rop="43"/>
- </function>
-
- <function name="RasterPos4s" offset="84" vectorequiv="RasterPos4sv">
- <param name="x" type="GLshort"/>
- <param name="y" type="GLshort"/>
- <param name="z" type="GLshort"/>
- <param name="w" type="GLshort"/>
- </function>
-
- <function name="RasterPos4sv" offset="85">
- <param name="v" type="const GLshort *" count="4"/>
- <glx rop="44"/>
- </function>
-
- <function name="Rectd" offset="86" vectorequiv="Rectdv">
- <param name="x1" type="GLdouble"/>
- <param name="y1" type="GLdouble"/>
- <param name="x2" type="GLdouble"/>
- <param name="y2" type="GLdouble"/>
- </function>
-
- <function name="Rectdv" offset="87">
- <param name="v1" type="const GLdouble *" count="2"/>
- <param name="v2" type="const GLdouble *" count="2"/>
- <glx rop="45"/>
- </function>
-
- <function name="Rectf" offset="88" vectorequiv="Rectfv">
- <param name="x1" type="GLfloat"/>
- <param name="y1" type="GLfloat"/>
- <param name="x2" type="GLfloat"/>
- <param name="y2" type="GLfloat"/>
- </function>
-
- <function name="Rectfv" offset="89">
- <param name="v1" type="const GLfloat *" count="2"/>
- <param name="v2" type="const GLfloat *" count="2"/>
- <glx rop="46"/>
- </function>
-
- <function name="Recti" offset="90" vectorequiv="Rectiv">
- <param name="x1" type="GLint"/>
- <param name="y1" type="GLint"/>
- <param name="x2" type="GLint"/>
- <param name="y2" type="GLint"/>
- </function>
-
- <function name="Rectiv" offset="91">
- <param name="v1" type="const GLint *" count="2"/>
- <param name="v2" type="const GLint *" count="2"/>
- <glx rop="47"/>
- </function>
-
- <function name="Rects" offset="92" vectorequiv="Rectsv">
- <param name="x1" type="GLshort"/>
- <param name="y1" type="GLshort"/>
- <param name="x2" type="GLshort"/>
- <param name="y2" type="GLshort"/>
- </function>
-
- <function name="Rectsv" offset="93">
- <param name="v1" type="const GLshort *" count="2"/>
- <param name="v2" type="const GLshort *" count="2"/>
- <glx rop="48"/>
- </function>
-
- <function name="TexCoord1d" offset="94" vectorequiv="TexCoord1dv">
- <param name="s" type="GLdouble"/>
- </function>
-
- <function name="TexCoord1dv" offset="95">
- <param name="v" type="const GLdouble *" count="1"/>
- <glx rop="49"/>
- </function>
-
- <function name="TexCoord1f" offset="96" vectorequiv="TexCoord1fv">
- <param name="s" type="GLfloat"/>
- </function>
-
- <function name="TexCoord1fv" offset="97">
- <param name="v" type="const GLfloat *" count="1"/>
- <glx rop="50"/>
- </function>
-
- <function name="TexCoord1i" offset="98" vectorequiv="TexCoord1iv">
- <param name="s" type="GLint"/>
- </function>
-
- <function name="TexCoord1iv" offset="99">
- <param name="v" type="const GLint *" count="1"/>
- <glx rop="51"/>
- </function>
-
- <function name="TexCoord1s" offset="100" vectorequiv="TexCoord1sv">
- <param name="s" type="GLshort"/>
- </function>
-
- <function name="TexCoord1sv" offset="101">
- <param name="v" type="const GLshort *" count="1"/>
- <glx rop="52"/>
- </function>
-
- <function name="TexCoord2d" offset="102" vectorequiv="TexCoord2dv">
- <param name="s" type="GLdouble"/>
- <param name="t" type="GLdouble"/>
- </function>
-
- <function name="TexCoord2dv" offset="103">
- <param name="v" type="const GLdouble *" count="2"/>
- <glx rop="53"/>
- </function>
-
- <function name="TexCoord2f" offset="104" vectorequiv="TexCoord2fv">
- <param name="s" type="GLfloat"/>
- <param name="t" type="GLfloat"/>
- </function>
-
- <function name="TexCoord2fv" offset="105">
- <param name="v" type="const GLfloat *" count="2"/>
- <glx rop="54"/>
- </function>
-
- <function name="TexCoord2i" offset="106" vectorequiv="TexCoord2iv">
- <param name="s" type="GLint"/>
- <param name="t" type="GLint"/>
- </function>
-
- <function name="TexCoord2iv" offset="107">
- <param name="v" type="const GLint *" count="2"/>
- <glx rop="55"/>
- </function>
-
- <function name="TexCoord2s" offset="108" vectorequiv="TexCoord2sv">
- <param name="s" type="GLshort"/>
- <param name="t" type="GLshort"/>
- </function>
-
- <function name="TexCoord2sv" offset="109">
- <param name="v" type="const GLshort *" count="2"/>
- <glx rop="56"/>
- </function>
-
- <function name="TexCoord3d" offset="110" vectorequiv="TexCoord3dv">
- <param name="s" type="GLdouble"/>
- <param name="t" type="GLdouble"/>
- <param name="r" type="GLdouble"/>
- </function>
-
- <function name="TexCoord3dv" offset="111">
- <param name="v" type="const GLdouble *" count="3"/>
- <glx rop="57"/>
- </function>
-
- <function name="TexCoord3f" offset="112" vectorequiv="TexCoord3fv">
- <param name="s" type="GLfloat"/>
- <param name="t" type="GLfloat"/>
- <param name="r" type="GLfloat"/>
- </function>
-
- <function name="TexCoord3fv" offset="113">
- <param name="v" type="const GLfloat *" count="3"/>
- <glx rop="58"/>
- </function>
-
- <function name="TexCoord3i" offset="114" vectorequiv="TexCoord3iv">
- <param name="s" type="GLint"/>
- <param name="t" type="GLint"/>
- <param name="r" type="GLint"/>
- </function>
-
- <function name="TexCoord3iv" offset="115">
- <param name="v" type="const GLint *" count="3"/>
- <glx rop="59"/>
- </function>
-
- <function name="TexCoord3s" offset="116" vectorequiv="TexCoord3sv">
- <param name="s" type="GLshort"/>
- <param name="t" type="GLshort"/>
- <param name="r" type="GLshort"/>
- </function>
-
- <function name="TexCoord3sv" offset="117">
- <param name="v" type="const GLshort *" count="3"/>
- <glx rop="60"/>
- </function>
-
- <function name="TexCoord4d" offset="118" vectorequiv="TexCoord4dv">
- <param name="s" type="GLdouble"/>
- <param name="t" type="GLdouble"/>
- <param name="r" type="GLdouble"/>
- <param name="q" type="GLdouble"/>
- </function>
-
- <function name="TexCoord4dv" offset="119">
- <param name="v" type="const GLdouble *" count="4"/>
- <glx rop="61"/>
- </function>
-
- <function name="TexCoord4f" offset="120" vectorequiv="TexCoord4fv">
- <param name="s" type="GLfloat"/>
- <param name="t" type="GLfloat"/>
- <param name="r" type="GLfloat"/>
- <param name="q" type="GLfloat"/>
- </function>
-
- <function name="TexCoord4fv" offset="121">
- <param name="v" type="const GLfloat *" count="4"/>
- <glx rop="62"/>
- </function>
-
- <function name="TexCoord4i" offset="122" vectorequiv="TexCoord4iv">
- <param name="s" type="GLint"/>
- <param name="t" type="GLint"/>
- <param name="r" type="GLint"/>
- <param name="q" type="GLint"/>
- </function>
-
- <function name="TexCoord4iv" offset="123">
- <param name="v" type="const GLint *" count="4"/>
- <glx rop="63"/>
- </function>
-
- <function name="TexCoord4s" offset="124" vectorequiv="TexCoord4sv">
- <param name="s" type="GLshort"/>
- <param name="t" type="GLshort"/>
- <param name="r" type="GLshort"/>
- <param name="q" type="GLshort"/>
- </function>
-
- <function name="TexCoord4sv" offset="125">
- <param name="v" type="const GLshort *" count="4"/>
- <glx rop="64"/>
- </function>
-
- <function name="Vertex2d" offset="126" vectorequiv="Vertex2dv">
- <param name="x" type="GLdouble"/>
- <param name="y" type="GLdouble"/>
- </function>
-
- <function name="Vertex2dv" offset="127">
- <param name="v" type="const GLdouble *" count="2"/>
- <glx rop="65"/>
- </function>
-
- <function name="Vertex2f" offset="128" vectorequiv="Vertex2fv">
- <param name="x" type="GLfloat"/>
- <param name="y" type="GLfloat"/>
- </function>
-
- <function name="Vertex2fv" offset="129">
- <param name="v" type="const GLfloat *" count="2"/>
- <glx rop="66"/>
- </function>
-
- <function name="Vertex2i" offset="130" vectorequiv="Vertex2iv">
- <param name="x" type="GLint"/>
- <param name="y" type="GLint"/>
- </function>
-
- <function name="Vertex2iv" offset="131">
- <param name="v" type="const GLint *" count="2"/>
- <glx rop="67"/>
- </function>
-
- <function name="Vertex2s" offset="132" vectorequiv="Vertex2sv">
- <param name="x" type="GLshort"/>
- <param name="y" type="GLshort"/>
- </function>
-
- <function name="Vertex2sv" offset="133">
- <param name="v" type="const GLshort *" count="2"/>
- <glx rop="68"/>
- </function>
-
- <function name="Vertex3d" offset="134" vectorequiv="Vertex3dv">
- <param name="x" type="GLdouble"/>
- <param name="y" type="GLdouble"/>
- <param name="z" type="GLdouble"/>
- </function>
-
- <function name="Vertex3dv" offset="135">
- <param name="v" type="const GLdouble *" count="3"/>
- <glx rop="69"/>
- </function>
-
- <function name="Vertex3f" offset="136" vectorequiv="Vertex3fv">
- <param name="x" type="GLfloat"/>
- <param name="y" type="GLfloat"/>
- <param name="z" type="GLfloat"/>
- </function>
-
- <function name="Vertex3fv" offset="137">
- <param name="v" type="const GLfloat *" count="3"/>
- <glx rop="70"/>
- </function>
-
- <function name="Vertex3i" offset="138" vectorequiv="Vertex3iv">
- <param name="x" type="GLint"/>
- <param name="y" type="GLint"/>
- <param name="z" type="GLint"/>
- </function>
-
- <function name="Vertex3iv" offset="139">
- <param name="v" type="const GLint *" count="3"/>
- <glx rop="71"/>
- </function>
-
- <function name="Vertex3s" offset="140" vectorequiv="Vertex3sv">
- <param name="x" type="GLshort"/>
- <param name="y" type="GLshort"/>
- <param name="z" type="GLshort"/>
- </function>
-
- <function name="Vertex3sv" offset="141">
- <param name="v" type="const GLshort *" count="3"/>
- <glx rop="72"/>
- </function>
-
- <function name="Vertex4d" offset="142" vectorequiv="Vertex4dv">
- <param name="x" type="GLdouble"/>
- <param name="y" type="GLdouble"/>
- <param name="z" type="GLdouble"/>
- <param name="w" type="GLdouble"/>
- </function>
-
- <function name="Vertex4dv" offset="143">
- <param name="v" type="const GLdouble *" count="4"/>
- <glx rop="73"/>
- </function>
-
- <function name="Vertex4f" offset="144" vectorequiv="Vertex4fv">
- <param name="x" type="GLfloat"/>
- <param name="y" type="GLfloat"/>
- <param name="z" type="GLfloat"/>
- <param name="w" type="GLfloat"/>
- </function>
-
- <function name="Vertex4fv" offset="145">
- <param name="v" type="const GLfloat *" count="4"/>
- <glx rop="74"/>
- </function>
-
- <function name="Vertex4i" offset="146" vectorequiv="Vertex4iv">
- <param name="x" type="GLint"/>
- <param name="y" type="GLint"/>
- <param name="z" type="GLint"/>
- <param name="w" type="GLint"/>
- </function>
-
- <function name="Vertex4iv" offset="147">
- <param name="v" type="const GLint *" count="4"/>
- <glx rop="75"/>
- </function>
-
- <function name="Vertex4s" offset="148" vectorequiv="Vertex4sv">
- <param name="x" type="GLshort"/>
- <param name="y" type="GLshort"/>
- <param name="z" type="GLshort"/>
- <param name="w" type="GLshort"/>
- </function>
-
- <function name="Vertex4sv" offset="149">
- <param name="v" type="const GLshort *" count="4"/>
- <glx rop="76"/>
- </function>
-
- <function name="ClipPlane" offset="150">
- <param name="plane" type="GLenum"/>
- <param name="equation" type="const GLdouble *" count="4"/>
- <glx rop="77"/>
- </function>
-
- <function name="ColorMaterial" offset="151">
- <param name="face" type="GLenum"/>
- <param name="mode" type="GLenum"/>
- <glx rop="78"/>
- </function>
-
- <function name="CullFace" offset="152">
- <param name="mode" type="GLenum"/>
- <glx rop="79"/>
- </function>
-
- <function name="Fogf" offset="153">
- <param name="pname" type="GLenum"/>
- <param name="param" type="GLfloat"/>
- <glx rop="80"/>
- </function>
-
- <function name="Fogfv" offset="154">
- <param name="pname" type="GLenum"/>
- <param name="params" type="const GLfloat *" variable_param="pname"/>
- <glx rop="81"/>
- </function>
-
- <function name="Fogi" offset="155">
- <param name="pname" type="GLenum"/>
- <param name="param" type="GLint"/>
- <glx rop="82"/>
- </function>
-
- <function name="Fogiv" offset="156">
- <param name="pname" type="GLenum"/>
- <param name="params" type="const GLint *" variable_param="pname"/>
- <glx rop="83"/>
- </function>
-
- <function name="FrontFace" offset="157">
- <param name="mode" type="GLenum"/>
- <glx rop="84"/>
- </function>
-
- <function name="Hint" offset="158">
- <param name="target" type="GLenum"/>
- <param name="mode" type="GLenum"/>
- <glx rop="85"/>
- </function>
-
- <function name="Lightf" offset="159">
- <param name="light" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="param" type="GLfloat"/>
- <glx rop="86"/>
- </function>
-
- <function name="Lightfv" offset="160">
- <param name="light" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="const GLfloat *" variable_param="pname"/>
- <glx rop="87"/>
- </function>
-
- <function name="Lighti" offset="161">
- <param name="light" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="param" type="GLint"/>
- <glx rop="88"/>
- </function>
-
- <function name="Lightiv" offset="162">
- <param name="light" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="const GLint *" variable_param="pname"/>
- <glx rop="89"/>
- </function>
-
- <function name="LightModelf" offset="163">
- <param name="pname" type="GLenum"/>
- <param name="param" type="GLfloat"/>
- <glx rop="90"/>
- </function>
-
- <function name="LightModelfv" offset="164">
- <param name="pname" type="GLenum"/>
- <param name="params" type="const GLfloat *" variable_param="pname"/>
- <glx rop="91"/>
- </function>
-
- <function name="LightModeli" offset="165">
- <param name="pname" type="GLenum"/>
- <param name="param" type="GLint"/>
- <glx rop="92"/>
- </function>
-
- <function name="LightModeliv" offset="166">
- <param name="pname" type="GLenum"/>
- <param name="params" type="const GLint *" variable_param="pname"/>
- <glx rop="93"/>
- </function>
-
- <function name="LineStipple" offset="167">
- <param name="factor" type="GLint"/>
- <param name="pattern" type="GLushort"/>
- <glx rop="94"/>
- </function>
-
- <function name="LineWidth" offset="168">
- <param name="width" type="GLfloat"/>
- <glx rop="95"/>
- </function>
-
- <function name="Materialf" offset="169">
- <param name="face" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="param" type="GLfloat"/>
- <glx rop="96"/>
- </function>
-
- <function name="Materialfv" offset="170">
- <param name="face" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="const GLfloat *" variable_param="pname"/>
- <glx rop="97"/>
- </function>
-
- <function name="Materiali" offset="171">
- <param name="face" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="param" type="GLint"/>
- <glx rop="98"/>
- </function>
-
- <function name="Materialiv" offset="172">
- <param name="face" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="const GLint *" variable_param="pname"/>
- <glx rop="99"/>
- </function>
-
- <function name="PointSize" offset="173">
- <param name="size" type="GLfloat"/>
- <glx rop="100"/>
- </function>
-
- <function name="PolygonMode" offset="174">
- <param name="face" type="GLenum"/>
- <param name="mode" type="GLenum"/>
- <glx rop="101"/>
- </function>
-
- <function name="PolygonStipple" offset="175">
- <param name="mask" type="const GLubyte *" img_width="32" img_height="32" img_format="GL_COLOR_INDEX" img_type="GL_BITMAP" img_target="0" img_pad_dimensions="false"/>
- <glx rop="102"/>
- </function>
-
- <function name="Scissor" offset="176">
- <param name="x" type="GLint"/>
- <param name="y" type="GLint"/>
- <param name="width" type="GLsizei"/>
- <param name="height" type="GLsizei"/>
- <glx rop="103"/>
- </function>
-
- <function name="ShadeModel" offset="177">
- <param name="mode" type="GLenum"/>
- <glx rop="104"/>
- </function>
-
- <function name="TexParameterf" offset="178">
- <param name="target" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="param" type="GLfloat"/>
- <glx rop="105"/>
- </function>
-
- <function name="TexParameterfv" offset="179">
- <param name="target" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="const GLfloat *" variable_param="pname"/>
- <glx rop="106"/>
- </function>
-
- <function name="TexParameteri" offset="180">
- <param name="target" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="param" type="GLint"/>
- <glx rop="107"/>
- </function>
-
- <function name="TexParameteriv" offset="181">
- <param name="target" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="const GLint *" variable_param="pname"/>
- <glx rop="108"/>
- </function>
-
- <function name="TexImage1D" offset="182">
- <param name="target" type="GLenum"/>
- <param name="level" type="GLint"/>
- <param name="internalformat" type="GLint"/>
- <param name="width" type="GLsizei"/>
- <param name="border" type="GLint"/>
- <param name="format" type="GLenum"/>
- <param name="type" type="GLenum"/>
- <param name="pixels" type="const GLvoid *" img_width="width" img_format="format" img_type="type" img_target="target" img_send_null="true" img_pad_dimensions="true"/>
- <glx rop="109" large="true"/>
- </function>
-
- <function name="TexImage2D" offset="183">
- <param name="target" type="GLenum"/>
- <param name="level" type="GLint"/>
- <param name="internalformat" type="GLint"/>
- <param name="width" type="GLsizei"/>
- <param name="height" type="GLsizei"/>
- <param name="border" type="GLint"/>
- <param name="format" type="GLenum"/>
- <param name="type" type="GLenum"/>
- <param name="pixels" type="const GLvoid *" img_width="width" img_height="height" img_format="format" img_type="type" img_target="target" img_send_null="true" img_pad_dimensions="true"/>
- <glx rop="110" large="true"/>
- </function>
-
- <function name="TexEnvf" offset="184">
- <param name="target" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="param" type="GLfloat"/>
- <glx rop="111"/>
- </function>
-
- <function name="TexEnvfv" offset="185">
- <param name="target" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="const GLfloat *" variable_param="pname"/>
- <glx rop="112"/>
- </function>
-
- <function name="TexEnvi" offset="186">
- <param name="target" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="param" type="GLint"/>
- <glx rop="113"/>
- </function>
-
- <function name="TexEnviv" offset="187">
- <param name="target" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="const GLint *" variable_param="pname"/>
- <glx rop="114"/>
- </function>
-
- <function name="TexGend" offset="188">
- <param name="coord" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="param" type="GLdouble"/>
- <glx rop="115"/>
- </function>
-
- <function name="TexGendv" offset="189">
- <param name="coord" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="const GLdouble *" variable_param="pname"/>
- <glx rop="116"/>
- </function>
-
- <function name="TexGenf" offset="190">
- <param name="coord" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="param" type="GLfloat"/>
- <glx rop="117"/>
- </function>
-
- <function name="TexGenfv" offset="191">
- <param name="coord" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="const GLfloat *" variable_param="pname"/>
- <glx rop="118"/>
- </function>
-
- <function name="TexGeni" offset="192">
- <param name="coord" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="param" type="GLint"/>
- <glx rop="119"/>
- </function>
-
- <function name="TexGeniv" offset="193">
- <param name="coord" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="const GLint *" variable_param="pname"/>
- <glx rop="120"/>
- </function>
-
- <function name="FeedbackBuffer" offset="194">
- <param name="size" type="GLsizei"/>
- <param name="type" type="GLenum"/>
- <param name="buffer" type="GLfloat *" output="true"/>
- <glx sop="105" handcode="true"/>
- </function>
-
- <function name="SelectBuffer" offset="195">
- <param name="size" type="GLsizei"/>
- <param name="buffer" type="GLuint *" output="true"/>
- <glx sop="106" handcode="true"/>
- </function>
-
- <function name="RenderMode" offset="196">
- <param name="mode" type="GLenum"/>
- <return type="GLint"/>
- <glx sop="107" handcode="true"/>
- </function>
-
- <function name="InitNames" offset="197">
- <glx rop="121"/>
- </function>
-
- <function name="LoadName" offset="198">
- <param name="name" type="GLuint"/>
- <glx rop="122"/>
- </function>
-
- <function name="PassThrough" offset="199">
- <param name="token" type="GLfloat"/>
- <glx rop="123"/>
- </function>
-
- <function name="PopName" offset="200">
- <glx rop="124"/>
- </function>
-
- <function name="PushName" offset="201">
- <param name="name" type="GLuint"/>
- <glx rop="125"/>
- </function>
-
- <function name="DrawBuffer" offset="202">
- <param name="mode" type="GLenum"/>
- <glx rop="126"/>
- </function>
-
- <function name="Clear" offset="203">
- <param name="mask" type="GLbitfield"/>
- <glx rop="127"/>
- </function>
-
- <function name="ClearAccum" offset="204">
- <param name="red" type="GLfloat"/>
- <param name="green" type="GLfloat"/>
- <param name="blue" type="GLfloat"/>
- <param name="alpha" type="GLfloat"/>
- <glx rop="128"/>
- </function>
-
- <function name="ClearIndex" offset="205">
- <param name="c" type="GLfloat"/>
- <glx rop="129"/>
- </function>
-
- <function name="ClearColor" offset="206">
- <param name="red" type="GLclampf"/>
- <param name="green" type="GLclampf"/>
- <param name="blue" type="GLclampf"/>
- <param name="alpha" type="GLclampf"/>
- <glx rop="130"/>
- </function>
-
- <function name="ClearStencil" offset="207">
- <param name="s" type="GLint"/>
- <glx rop="131"/>
- </function>
-
- <function name="ClearDepth" offset="208">
- <param name="depth" type="GLclampd"/>
- <glx rop="132"/>
- </function>
-
- <function name="StencilMask" offset="209">
- <param name="mask" type="GLuint"/>
- <glx rop="133"/>
- </function>
-
- <function name="ColorMask" offset="210">
- <param name="red" type="GLboolean"/>
- <param name="green" type="GLboolean"/>
- <param name="blue" type="GLboolean"/>
- <param name="alpha" type="GLboolean"/>
- <glx rop="134"/>
- </function>
-
- <function name="DepthMask" offset="211">
- <param name="flag" type="GLboolean"/>
- <glx rop="135"/>
- </function>
-
- <function name="IndexMask" offset="212">
- <param name="mask" type="GLuint"/>
- <glx rop="136"/>
- </function>
-
- <function name="Accum" offset="213">
- <param name="op" type="GLenum"/>
- <param name="value" type="GLfloat"/>
- <glx rop="137"/>
- </function>
-
- <function name="Disable" offset="214">
- <param name="cap" type="GLenum"/>
- <glx rop="138" handcode="client"/>
- </function>
-
- <function name="Enable" offset="215">
- <param name="cap" type="GLenum"/>
- <glx rop="139" handcode="client"/>
- </function>
-
- <function name="Finish" offset="216">
- <glx sop="108" handcode="true"/>
- </function>
-
- <function name="Flush" offset="217">
- <glx sop="142" handcode="true"/>
- </function>
-
- <function name="PopAttrib" offset="218">
- <glx rop="141"/>
- </function>
-
- <function name="PushAttrib" offset="219">
- <param name="mask" type="GLbitfield"/>
- <glx rop="142"/>
- </function>
-
- <function name="Map1d" offset="220">
- <param name="target" type="GLenum"/>
- <param name="u1" type="GLdouble"/>
- <param name="u2" type="GLdouble"/>
- <param name="stride" type="GLint" client_only="true"/>
- <param name="order" type="GLint"/>
- <param name="points" type="const GLdouble *" variable_param="order"/>
- <glx rop="143" handcode="true"/>
- </function>
-
- <function name="Map1f" offset="221">
- <param name="target" type="GLenum"/>
- <param name="u1" type="GLfloat"/>
- <param name="u2" type="GLfloat"/>
- <param name="stride" type="GLint" client_only="true"/>
- <param name="order" type="GLint"/>
- <param name="points" type="const GLfloat *" variable_param="order"/>
- <glx rop="144" handcode="true"/>
- </function>
-
- <function name="Map2d" offset="222">
- <param name="target" type="GLenum"/>
- <param name="u1" type="GLdouble"/>
- <param name="u2" type="GLdouble"/>
- <param name="ustride" type="GLint" client_only="true"/>
- <param name="uorder" type="GLint"/>
- <param name="v1" type="GLdouble"/>
- <param name="v2" type="GLdouble"/>
- <param name="vstride" type="GLint" client_only="true"/>
- <param name="vorder" type="GLint"/>
- <param name="points" type="const GLdouble *" variable_param="uorder"/>
- <glx rop="145" handcode="true"/>
- </function>
-
- <function name="Map2f" offset="223">
- <param name="target" type="GLenum"/>
- <param name="u1" type="GLfloat"/>
- <param name="u2" type="GLfloat"/>
- <param name="ustride" type="GLint" client_only="true"/>
- <param name="uorder" type="GLint"/>
- <param name="v1" type="GLfloat"/>
- <param name="v2" type="GLfloat"/>
- <param name="vstride" type="GLint" client_only="true"/>
- <param name="vorder" type="GLint"/>
- <param name="points" type="const GLfloat *" variable_param="uorder"/>
- <glx rop="146" handcode="true"/>
- </function>
-
- <function name="MapGrid1d" offset="224">
- <param name="un" type="GLint"/>
- <param name="u1" type="GLdouble"/>
- <param name="u2" type="GLdouble"/>
- <glx rop="147"/>
- </function>
-
- <function name="MapGrid1f" offset="225">
- <param name="un" type="GLint"/>
- <param name="u1" type="GLfloat"/>
- <param name="u2" type="GLfloat"/>
- <glx rop="148"/>
- </function>
-
- <function name="MapGrid2d" offset="226">
- <param name="un" type="GLint"/>
- <param name="u1" type="GLdouble"/>
- <param name="u2" type="GLdouble"/>
- <param name="vn" type="GLint"/>
- <param name="v1" type="GLdouble"/>
- <param name="v2" type="GLdouble"/>
- <glx rop="149"/>
- </function>
-
- <function name="MapGrid2f" offset="227">
- <param name="un" type="GLint"/>
- <param name="u1" type="GLfloat"/>
- <param name="u2" type="GLfloat"/>
- <param name="vn" type="GLint"/>
- <param name="v1" type="GLfloat"/>
- <param name="v2" type="GLfloat"/>
- <glx rop="150"/>
- </function>
-
- <function name="EvalCoord1d" offset="228" vectorequiv="EvalCoord1dv">
- <param name="u" type="GLdouble"/>
- </function>
-
- <function name="EvalCoord1dv" offset="229">
- <param name="u" type="const GLdouble *" count="1"/>
- <glx rop="151"/>
- </function>
-
- <function name="EvalCoord1f" offset="230" vectorequiv="EvalCoord1fv">
- <param name="u" type="GLfloat"/>
- </function>
-
- <function name="EvalCoord1fv" offset="231">
- <param name="u" type="const GLfloat *" count="1"/>
- <glx rop="152"/>
- </function>
-
- <function name="EvalCoord2d" offset="232" vectorequiv="EvalCoord2dv">
- <param name="u" type="GLdouble"/>
- <param name="v" type="GLdouble"/>
- </function>
-
- <function name="EvalCoord2dv" offset="233">
- <param name="u" type="const GLdouble *" count="2"/>
- <glx rop="153"/>
- </function>
-
- <function name="EvalCoord2f" offset="234" vectorequiv="EvalCoord2fv">
- <param name="u" type="GLfloat"/>
- <param name="v" type="GLfloat"/>
- </function>
-
- <function name="EvalCoord2fv" offset="235">
- <param name="u" type="const GLfloat *" count="2"/>
- <glx rop="154"/>
- </function>
-
- <function name="EvalMesh1" offset="236">
- <param name="mode" type="GLenum"/>
- <param name="i1" type="GLint"/>
- <param name="i2" type="GLint"/>
- <glx rop="155"/>
- </function>
-
- <function name="EvalPoint1" offset="237">
- <param name="i" type="GLint"/>
- <glx rop="156"/>
- </function>
-
- <function name="EvalMesh2" offset="238">
- <param name="mode" type="GLenum"/>
- <param name="i1" type="GLint"/>
- <param name="i2" type="GLint"/>
- <param name="j1" type="GLint"/>
- <param name="j2" type="GLint"/>
- <glx rop="157"/>
- </function>
-
- <function name="EvalPoint2" offset="239">
- <param name="i" type="GLint"/>
- <param name="j" type="GLint"/>
- <glx rop="158"/>
- </function>
-
- <function name="AlphaFunc" offset="240">
- <param name="func" type="GLenum"/>
- <param name="ref" type="GLclampf"/>
- <glx rop="159"/>
- </function>
-
- <function name="BlendFunc" offset="241">
- <param name="sfactor" type="GLenum"/>
- <param name="dfactor" type="GLenum"/>
- <glx rop="160"/>
- </function>
-
- <function name="LogicOp" offset="242">
- <param name="opcode" type="GLenum"/>
- <glx rop="161"/>
- </function>
-
- <function name="StencilFunc" offset="243">
- <param name="func" type="GLenum"/>
- <param name="ref" type="GLint"/>
- <param name="mask" type="GLuint"/>
- <glx rop="162"/>
- </function>
-
- <function name="StencilOp" offset="244">
- <param name="fail" type="GLenum"/>
- <param name="zfail" type="GLenum"/>
- <param name="zpass" type="GLenum"/>
- <glx rop="163"/>
- </function>
-
- <function name="DepthFunc" offset="245">
- <param name="func" type="GLenum"/>
- <glx rop="164"/>
- </function>
-
- <function name="PixelZoom" offset="246">
- <param name="xfactor" type="GLfloat"/>
- <param name="yfactor" type="GLfloat"/>
- <glx rop="165"/>
- </function>
-
- <function name="PixelTransferf" offset="247">
- <param name="pname" type="GLenum"/>
- <param name="param" type="GLfloat"/>
- <glx rop="166"/>
- </function>
-
- <function name="PixelTransferi" offset="248">
- <param name="pname" type="GLenum"/>
- <param name="param" type="GLint"/>
- <glx rop="167"/>
- </function>
-
- <function name="PixelStoref" offset="249">
- <param name="pname" type="GLenum"/>
- <param name="param" type="GLfloat"/>
- <glx sop="109" handcode="client"/>
- </function>
-
- <function name="PixelStorei" offset="250">
- <param name="pname" type="GLenum"/>
- <param name="param" type="GLint"/>
- <glx sop="110" handcode="client"/>
- </function>
-
- <function name="PixelMapfv" offset="251">
- <param name="map" type="GLenum"/>
- <param name="mapsize" type="GLsizei" counter="true"/>
- <param name="values" type="const GLfloat *" count="mapsize"/>
- <glx rop="168" large="true"/>
- </function>
-
- <function name="PixelMapuiv" offset="252">
- <param name="map" type="GLenum"/>
- <param name="mapsize" type="GLsizei" counter="true"/>
- <param name="values" type="const GLuint *" count="mapsize"/>
- <glx rop="169" large="true"/>
- </function>
-
- <function name="PixelMapusv" offset="253">
- <param name="map" type="GLenum"/>
- <param name="mapsize" type="GLsizei" counter="true"/>
- <param name="values" type="const GLushort *" count="mapsize"/>
- <glx rop="170" large="true"/>
- </function>
-
- <function name="ReadBuffer" offset="254">
- <param name="mode" type="GLenum"/>
- <glx rop="171"/>
- </function>
-
- <function name="CopyPixels" offset="255">
- <param name="x" type="GLint"/>
- <param name="y" type="GLint"/>
- <param name="width" type="GLsizei"/>
- <param name="height" type="GLsizei"/>
- <param name="type" type="GLenum"/>
- <glx rop="172"/>
- </function>
-
- <function name="ReadPixels" offset="256">
- <param name="x" type="GLint"/>
- <param name="y" type="GLint"/>
- <param name="width" type="GLsizei"/>
- <param name="height" type="GLsizei"/>
- <param name="format" type="GLenum"/>
- <param name="type" type="GLenum"/>
- <param name="pixels" type="GLvoid *" output="true" img_width="width" img_height="height" img_format="format" img_type="type" img_target="0"/>
- <glx sop="111"/>
- </function>
-
- <function name="DrawPixels" offset="257">
- <param name="width" type="GLsizei"/>
- <param name="height" type="GLsizei"/>
- <param name="format" type="GLenum"/>
- <param name="type" type="GLenum"/>
- <param name="pixels" type="const GLvoid *" img_width="width" img_height="height" img_format="format" img_type="type" img_target="0" img_pad_dimensions="false"/>
- <glx rop="173" large="true"/>
- </function>
-
- <function name="GetBooleanv" offset="258">
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLboolean *" output="true" variable_param="pname"/>
- <glx sop="112" handcode="client"/>
- </function>
-
- <function name="GetClipPlane" offset="259">
- <param name="plane" type="GLenum"/>
- <param name="equation" type="GLdouble *" output="true" count="4"/>
- <glx sop="113" always_array="true"/>
- </function>
-
- <function name="GetDoublev" offset="260">
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLdouble *" output="true" variable_param="pname"/>
- <glx sop="114" handcode="client"/>
- </function>
-
- <function name="GetError" offset="261">
- <return type="GLenum"/>
- <glx sop="115" handcode="client"/>
- </function>
-
- <function name="GetFloatv" offset="262">
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLfloat *" output="true" variable_param="pname"/>
- <glx sop="116" handcode="client"/>
- </function>
-
- <function name="GetIntegerv" offset="263">
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLint *" output="true" variable_param="pname"/>
- <glx sop="117" handcode="client"/>
- </function>
-
- <function name="GetLightfv" offset="264">
- <param name="light" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLfloat *" output="true" variable_param="pname"/>
- <glx sop="118"/>
- </function>
-
- <function name="GetLightiv" offset="265">
- <param name="light" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLint *" output="true" variable_param="pname"/>
- <glx sop="119"/>
- </function>
-
- <function name="GetMapdv" offset="266">
- <param name="target" type="GLenum"/>
- <param name="query" type="GLenum"/>
- <param name="v" type="GLdouble *" output="true" variable_param="target query"/>
- <glx sop="120"/>
- </function>
-
- <function name="GetMapfv" offset="267">
- <param name="target" type="GLenum"/>
- <param name="query" type="GLenum"/>
- <param name="v" type="GLfloat *" output="true" variable_param="target query"/>
- <glx sop="121"/>
- </function>
-
- <function name="GetMapiv" offset="268">
- <param name="target" type="GLenum"/>
- <param name="query" type="GLenum"/>
- <param name="v" type="GLint *" output="true" variable_param="target query"/>
- <glx sop="122"/>
- </function>
-
- <function name="GetMaterialfv" offset="269">
- <param name="face" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLfloat *" output="true" variable_param="pname"/>
- <glx sop="123"/>
- </function>
-
- <function name="GetMaterialiv" offset="270">
- <param name="face" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLint *" output="true" variable_param="pname"/>
- <glx sop="124"/>
- </function>
-
- <function name="GetPixelMapfv" offset="271">
- <param name="map" type="GLenum"/>
- <param name="values" type="GLfloat *" output="true" variable_param="map"/>
- <glx sop="125"/>
- </function>
-
- <function name="GetPixelMapuiv" offset="272">
- <param name="map" type="GLenum"/>
- <param name="values" type="GLuint *" output="true" variable_param="map"/>
- <glx sop="126"/>
- </function>
-
- <function name="GetPixelMapusv" offset="273">
- <param name="map" type="GLenum"/>
- <param name="values" type="GLushort *" output="true" variable_param="map"/>
- <glx sop="127"/>
- </function>
-
- <function name="GetPolygonStipple" offset="274">
- <param name="mask" type="GLubyte *" output="true" img_width="32" img_height="32" img_format="GL_COLOR_INDEX" img_type="GL_BITMAP"/>
- <glx sop="128"/>
- </function>
-
- <function name="GetString" offset="275">
- <param name="name" type="GLenum"/>
- <return type="const GLubyte *"/>
- <glx sop="129" handcode="true"/>
- </function>
-
- <function name="GetTexEnvfv" offset="276">
- <param name="target" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLfloat *" output="true" variable_param="pname"/>
- <glx sop="130"/>
- </function>
-
- <function name="GetTexEnviv" offset="277">
- <param name="target" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLint *" output="true" variable_param="pname"/>
- <glx sop="131"/>
- </function>
-
- <function name="GetTexGendv" offset="278">
- <param name="coord" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLdouble *" output="true" variable_param="pname"/>
- <glx sop="132"/>
- </function>
-
- <function name="GetTexGenfv" offset="279">
- <param name="coord" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLfloat *" output="true" variable_param="pname"/>
- <glx sop="133"/>
- </function>
-
- <function name="GetTexGeniv" offset="280">
- <param name="coord" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLint *" output="true" variable_param="pname"/>
- <glx sop="134"/>
- </function>
-
- <function name="GetTexImage" offset="281">
- <param name="target" type="GLenum"/>
- <param name="level" type="GLint"/>
- <param name="format" type="GLenum"/>
- <param name="type" type="GLenum"/>
- <param name="pixels" type="GLvoid *" output="true" img_width="width" img_height="height" img_depth="depth" img_format="format" img_type="type"/>
- <glx sop="135" dimensions_in_reply="true"/>
- </function>
-
- <function name="GetTexParameterfv" offset="282">
- <param name="target" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLfloat *" output="true" variable_param="pname"/>
- <glx sop="136"/>
- </function>
-
- <function name="GetTexParameteriv" offset="283">
- <param name="target" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLint *" output="true" variable_param="pname"/>
- <glx sop="137"/>
- </function>
-
- <function name="GetTexLevelParameterfv" offset="284">
- <param name="target" type="GLenum"/>
- <param name="level" type="GLint"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLfloat *" output="true" variable_param="pname"/>
- <glx sop="138"/>
- </function>
-
- <function name="GetTexLevelParameteriv" offset="285">
- <param name="target" type="GLenum"/>
- <param name="level" type="GLint"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLint *" output="true" variable_param="pname"/>
- <glx sop="139"/>
- </function>
-
- <function name="IsEnabled" offset="286">
- <param name="cap" type="GLenum"/>
- <return type="GLboolean"/>
- <glx sop="140" handcode="client"/>
- </function>
-
- <function name="IsList" offset="287">
- <param name="list" type="GLuint"/>
- <return type="GLboolean"/>
- <glx sop="141"/>
- </function>
-
- <function name="DepthRange" offset="288">
- <param name="zNear" type="GLclampd"/>
- <param name="zFar" type="GLclampd"/>
- <glx rop="174"/>
- </function>
-
- <function name="Frustum" offset="289">
- <param name="left" type="GLdouble"/>
- <param name="right" type="GLdouble"/>
- <param name="bottom" type="GLdouble"/>
- <param name="top" type="GLdouble"/>
- <param name="zNear" type="GLdouble"/>
- <param name="zFar" type="GLdouble"/>
- <glx rop="175"/>
- </function>
-
- <function name="LoadIdentity" offset="290">
- <glx rop="176"/>
- </function>
-
- <function name="LoadMatrixf" offset="291">
- <param name="m" type="const GLfloat *" count="16"/>
- <glx rop="177"/>
- </function>
-
- <function name="LoadMatrixd" offset="292">
- <param name="m" type="const GLdouble *" count="16"/>
- <glx rop="178"/>
- </function>
-
- <function name="MatrixMode" offset="293">
- <param name="mode" type="GLenum"/>
- <glx rop="179"/>
- </function>
-
- <function name="MultMatrixf" offset="294">
- <param name="m" type="const GLfloat *" count="16"/>
- <glx rop="180"/>
- </function>
-
- <function name="MultMatrixd" offset="295">
- <param name="m" type="const GLdouble *" count="16"/>
- <glx rop="181"/>
- </function>
-
- <function name="Ortho" offset="296">
- <param name="left" type="GLdouble"/>
- <param name="right" type="GLdouble"/>
- <param name="bottom" type="GLdouble"/>
- <param name="top" type="GLdouble"/>
- <param name="zNear" type="GLdouble"/>
- <param name="zFar" type="GLdouble"/>
- <glx rop="182"/>
- </function>
-
- <function name="PopMatrix" offset="297">
- <glx rop="183"/>
- </function>
-
- <function name="PushMatrix" offset="298">
- <glx rop="184"/>
- </function>
-
- <function name="Rotated" offset="299">
- <param name="angle" type="GLdouble"/>
- <param name="x" type="GLdouble"/>
- <param name="y" type="GLdouble"/>
- <param name="z" type="GLdouble"/>
- <glx rop="185"/>
- </function>
-
- <function name="Rotatef" offset="300">
- <param name="angle" type="GLfloat"/>
- <param name="x" type="GLfloat"/>
- <param name="y" type="GLfloat"/>
- <param name="z" type="GLfloat"/>
- <glx rop="186"/>
- </function>
-
- <function name="Scaled" offset="301">
- <param name="x" type="GLdouble"/>
- <param name="y" type="GLdouble"/>
- <param name="z" type="GLdouble"/>
- <glx rop="187"/>
- </function>
-
- <function name="Scalef" offset="302">
- <param name="x" type="GLfloat"/>
- <param name="y" type="GLfloat"/>
- <param name="z" type="GLfloat"/>
- <glx rop="188"/>
- </function>
-
- <function name="Translated" offset="303">
- <param name="x" type="GLdouble"/>
- <param name="y" type="GLdouble"/>
- <param name="z" type="GLdouble"/>
- <glx rop="189"/>
- </function>
-
- <function name="Translatef" offset="304">
- <param name="x" type="GLfloat"/>
- <param name="y" type="GLfloat"/>
- <param name="z" type="GLfloat"/>
- <glx rop="190"/>
- </function>
-
- <function name="Viewport" offset="305">
- <param name="x" type="GLint"/>
- <param name="y" type="GLint"/>
- <param name="width" type="GLsizei"/>
- <param name="height" type="GLsizei"/>
- <glx rop="191"/>
- </function>
-</category>
-
-<category name="1.1">
- <enum name="INDEX_LOGIC_OP" value="0x0BF1"/>
- <enum name="COLOR_LOGIC_OP" value="0x0BF2"/>
- <enum name="TEXTURE_INTERNAL_FORMAT" value="0x1003"/>
- <enum name="DOUBLE" value="0x140A"/>
- <enum name="POLYGON_OFFSET_UNITS" count="1" value="0x2A00">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="POLYGON_OFFSET_POINT" value="0x2A01"/>
- <enum name="POLYGON_OFFSET_LINE" value="0x2A02"/>
- <enum name="R3_G3_B2" value="0x2A10"/>
- <enum name="V2F" value="0x2A20"/>
- <enum name="V3F" value="0x2A21"/>
- <enum name="C4UB_V2F" value="0x2A22"/>
- <enum name="C4UB_V3F" value="0x2A23"/>
- <enum name="C3F_V3F" value="0x2A24"/>
- <enum name="N3F_V3F" value="0x2A25"/>
- <enum name="C4F_N3F_V3F" value="0x2A26"/>
- <enum name="T2F_V3F" value="0x2A27"/>
- <enum name="T4F_V4F" value="0x2A28"/>
- <enum name="T2F_C4UB_V3F" value="0x2A29"/>
- <enum name="T2F_C3F_V3F" value="0x2A2A"/>
- <enum name="T2F_N3F_V3F" value="0x2A2B"/>
- <enum name="T2F_C4F_N3F_V3F" value="0x2A2C"/>
- <enum name="T4F_C4F_N3F_V4F" value="0x2A2D"/>
- <enum name="POLYGON_OFFSET_FILL" value="0x8037"/>
- <enum name="POLYGON_OFFSET_FACTOR" count="1" value="0x8038">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="POLYGON_OFFSET_BIAS" value="0x8039"/>
- <enum name="ALPHA4" value="0x803B"/>
- <enum name="ALPHA8" value="0x803C"/>
- <enum name="ALPHA12" value="0x803D"/>
- <enum name="ALPHA16" value="0x803E"/>
- <enum name="LUMINANCE4" value="0x803F"/>
- <enum name="LUMINANCE8" value="0x8040"/>
- <enum name="LUMINANCE12" value="0x8041"/>
- <enum name="LUMINANCE16" value="0x8042"/>
- <enum name="LUMINANCE4_ALPHA4" value="0x8043"/>
- <enum name="LUMINANCE6_ALPHA2" value="0x8044"/>
- <enum name="LUMINANCE8_ALPHA8" value="0x8045"/>
- <enum name="LUMINANCE12_ALPHA4" value="0x8046"/>
- <enum name="LUMINANCE12_ALPHA12" value="0x8047"/>
- <enum name="LUMINANCE16_ALPHA16" value="0x8048"/>
- <enum name="INTENSITY" value="0x8049"/>
- <enum name="INTENSITY4" value="0x804A"/>
- <enum name="INTENSITY8" value="0x804B"/>
- <enum name="INTENSITY12" value="0x804C"/>
- <enum name="INTENSITY16" value="0x804D"/>
- <enum name="RGB4" value="0x804F"/>
- <enum name="RGB5" value="0x8050"/>
- <enum name="RGB8" value="0x8051"/>
- <enum name="RGB10" value="0x8052"/>
- <enum name="RGB12" value="0x8053"/>
- <enum name="RGB16" value="0x8054"/>
- <enum name="RGBA2" value="0x8055"/>
- <enum name="RGBA4" value="0x8056"/>
- <enum name="RGB5_A1" value="0x8057"/>
- <enum name="RGBA8" value="0x8058"/>
- <enum name="RGB10_A2" value="0x8059"/>
- <enum name="RGBA12" value="0x805A"/>
- <enum name="RGBA16" value="0x805B"/>
- <enum name="TEXTURE_RED_SIZE" count="1" value="0x805C">
- <size name="GetTexLevelParameterfv" mode="get"/>
- <size name="GetTexLevelParameteriv" mode="get"/>
- </enum>
- <enum name="TEXTURE_GREEN_SIZE" count="1" value="0x805D">
- <size name="GetTexLevelParameterfv" mode="get"/>
- <size name="GetTexLevelParameteriv" mode="get"/>
- </enum>
- <enum name="TEXTURE_BLUE_SIZE" count="1" value="0x805E">
- <size name="GetTexLevelParameterfv" mode="get"/>
- <size name="GetTexLevelParameteriv" mode="get"/>
- </enum>
- <enum name="TEXTURE_ALPHA_SIZE" count="1" value="0x805F">
- <size name="GetTexLevelParameterfv" mode="get"/>
- <size name="GetTexLevelParameteriv" mode="get"/>
- </enum>
- <enum name="TEXTURE_LUMINANCE_SIZE" count="1" value="0x8060">
- <size name="GetTexLevelParameterfv" mode="get"/>
- <size name="GetTexLevelParameteriv" mode="get"/>
- </enum>
- <enum name="TEXTURE_INTENSITY_SIZE" count="1" value="0x8061">
- <size name="GetTexLevelParameterfv" mode="get"/>
- <size name="GetTexLevelParameteriv" mode="get"/>
- </enum>
- <enum name="PROXY_TEXTURE_1D" value="0x8063"/>
- <enum name="PROXY_TEXTURE_2D" value="0x8064"/>
- <enum name="TEXTURE_PRIORITY" count="1" value="0x8066">
- <size name="TexParameterfv"/>
- <size name="TexParameteriv"/>
- <size name="GetTexParameterfv" mode="get"/>
- <size name="GetTexParameteriv" mode="get"/>
- </enum>
- <enum name="TEXTURE_RESIDENT" count="1" value="0x8067">
- <size name="GetTexParameterfv" mode="get"/>
- <size name="GetTexParameteriv" mode="get"/>
- </enum>
- <enum name="TEXTURE_BINDING_1D" count="1" value="0x8068">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="TEXTURE_BINDING_2D" count="1" value="0x8069">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="VERTEX_ARRAY" count="1" value="0x8074">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="NORMAL_ARRAY" count="1" value="0x8075">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="COLOR_ARRAY" count="1" value="0x8076">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="INDEX_ARRAY" count="1" value="0x8077">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="TEXTURE_COORD_ARRAY" count="1" value="0x8078">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="EDGE_FLAG_ARRAY" count="1" value="0x8079">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="VERTEX_ARRAY_SIZE" count="1" value="0x807A">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="VERTEX_ARRAY_TYPE" count="1" value="0x807B">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="VERTEX_ARRAY_STRIDE" count="1" value="0x807C">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="NORMAL_ARRAY_TYPE" count="1" value="0x807E">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="NORMAL_ARRAY_STRIDE" count="1" value="0x807F">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="COLOR_ARRAY_SIZE" count="1" value="0x8081">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="COLOR_ARRAY_TYPE" count="1" value="0x8082">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="COLOR_ARRAY_STRIDE" count="1" value="0x8083">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="INDEX_ARRAY_TYPE" count="1" value="0x8085">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="INDEX_ARRAY_STRIDE" count="1" value="0x8086">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="TEXTURE_COORD_ARRAY_SIZE" count="1" value="0x8088">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="TEXTURE_COORD_ARRAY_TYPE" count="1" value="0x8089">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="TEXTURE_COORD_ARRAY_STRIDE" count="1" value="0x808A">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="EDGE_FLAG_ARRAY_STRIDE" count="1" value="0x808C">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="VERTEX_ARRAY_POINTER" value="0x808E"/>
- <enum name="NORMAL_ARRAY_POINTER" value="0x808F"/>
- <enum name="COLOR_ARRAY_POINTER" value="0x8090"/>
- <enum name="INDEX_ARRAY_POINTER" value="0x8091"/>
- <enum name="TEXTURE_COORD_ARRAY_POINTER" value="0x8092"/>
- <enum name="EDGE_FLAG_ARRAY_POINTER" value="0x8093"/>
- <enum name="CLIENT_PIXEL_STORE_BIT" value="0x00000001"/>
- <enum name="CLIENT_VERTEX_ARRAY_BIT" value="0x00000002"/>
- <enum name="ALL_CLIENT_ATTRIB_BITS" value="0xFFFFFFFF"/>
- <enum name="CLIENT_ALL_ATTRIB_BITS" value="0xFFFFFFFF"/>
-
- <function name="ArrayElement" offset="306">
- <param name="i" type="GLint"/>
- <glx handcode="true"/>
- </function>
-
- <function name="ColorPointer" offset="308">
- <param name="size" type="GLint"/>
- <param name="type" type="GLenum"/>
- <param name="stride" type="GLsizei"/>
- <param name="pointer" type="const GLvoid *"/>
- <glx handcode="true"/>
- </function>
-
- <function name="DisableClientState" offset="309">
- <param name="array" type="GLenum"/>
- <glx handcode="true"/>
- </function>
-
- <function name="DrawArrays" offset="310">
- <param name="mode" type="GLenum"/>
- <param name="first" type="GLint"/>
- <param name="count" type="GLsizei"/>
- <glx rop="193" handcode="true"/>
- </function>
-
- <function name="DrawElements" offset="311">
- <param name="mode" type="GLenum"/>
- <param name="count" type="GLsizei"/>
- <param name="type" type="GLenum"/>
- <param name="indices" type="const GLvoid *"/>
- <glx handcode="true"/>
- </function>
-
- <function name="EdgeFlagPointer" offset="312">
- <param name="stride" type="GLsizei"/>
- <param name="pointer" type="const GLvoid *"/>
- <glx handcode="true"/>
- </function>
-
- <function name="EnableClientState" offset="313">
- <param name="array" type="GLenum"/>
- <glx handcode="true"/>
- </function>
-
- <function name="GetPointerv" offset="329">
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLvoid **" output="true"/>
- <glx handcode="true"/>
- </function>
-
- <function name="IndexPointer" offset="314">
- <param name="type" type="GLenum"/>
- <param name="stride" type="GLsizei"/>
- <param name="pointer" type="const GLvoid *"/>
- <glx handcode="true"/>
- </function>
-
- <function name="InterleavedArrays" offset="317">
- <param name="format" type="GLenum"/>
- <param name="stride" type="GLsizei"/>
- <param name="pointer" type="const GLvoid *"/>
- <glx handcode="true"/>
- </function>
-
- <function name="NormalPointer" offset="318">
- <param name="type" type="GLenum"/>
- <param name="stride" type="GLsizei"/>
- <param name="pointer" type="const GLvoid *"/>
- <glx handcode="true"/>
- </function>
-
- <function name="TexCoordPointer" offset="320">
- <param name="size" type="GLint"/>
- <param name="type" type="GLenum"/>
- <param name="stride" type="GLsizei"/>
- <param name="pointer" type="const GLvoid *"/>
- <glx handcode="true"/>
- </function>
-
- <function name="VertexPointer" offset="321">
- <param name="size" type="GLint"/>
- <param name="type" type="GLenum"/>
- <param name="stride" type="GLsizei"/>
- <param name="pointer" type="const GLvoid *"/>
- <glx handcode="true"/>
- </function>
-
- <function name="PolygonOffset" offset="319">
- <param name="factor" type="GLfloat"/>
- <param name="units" type="GLfloat"/>
- <glx rop="192"/>
- </function>
-
- <function name="CopyTexImage1D" offset="323">
- <param name="target" type="GLenum"/>
- <param name="level" type="GLint"/>
- <param name="internalformat" type="GLenum"/>
- <param name="x" type="GLint"/>
- <param name="y" type="GLint"/>
- <param name="width" type="GLsizei"/>
- <param name="border" type="GLint"/>
- <glx rop="4119"/>
- </function>
-
- <function name="CopyTexImage2D" offset="324">
- <param name="target" type="GLenum"/>
- <param name="level" type="GLint"/>
- <param name="internalformat" type="GLenum"/>
- <param name="x" type="GLint"/>
- <param name="y" type="GLint"/>
- <param name="width" type="GLsizei"/>
- <param name="height" type="GLsizei"/>
- <param name="border" type="GLint"/>
- <glx rop="4120"/>
- </function>
-
- <function name="CopyTexSubImage1D" offset="325">
- <param name="target" type="GLenum"/>
- <param name="level" type="GLint"/>
- <param name="xoffset" type="GLint"/>
- <param name="x" type="GLint"/>
- <param name="y" type="GLint"/>
- <param name="width" type="GLsizei"/>
- <glx rop="4121"/>
- </function>
-
- <function name="CopyTexSubImage2D" offset="326">
- <param name="target" type="GLenum"/>
- <param name="level" type="GLint"/>
- <param name="xoffset" type="GLint"/>
- <param name="yoffset" type="GLint"/>
- <param name="x" type="GLint"/>
- <param name="y" type="GLint"/>
- <param name="width" type="GLsizei"/>
- <param name="height" type="GLsizei"/>
- <glx rop="4122"/>
- </function>
-
- <function name="TexSubImage1D" offset="332">
- <param name="target" type="GLenum"/>
- <param name="level" type="GLint"/>
- <param name="xoffset" type="GLint"/>
- <param name="width" type="GLsizei"/>
- <param name="format" type="GLenum"/>
- <param name="type" type="GLenum"/>
- <param name="UNUSED" type="GLuint" padding="true"/>
- <param name="pixels" type="const GLvoid *" img_width="width" img_xoff="xoffset" img_format="format" img_type="type" img_target="target" img_pad_dimensions="true"/>
- <glx rop="4099" large="true"/>
- </function>
-
- <function name="TexSubImage2D" offset="333">
- <param name="target" type="GLenum"/>
- <param name="level" type="GLint"/>
- <param name="xoffset" type="GLint"/>
- <param name="yoffset" type="GLint"/>
- <param name="width" type="GLsizei"/>
- <param name="height" type="GLsizei"/>
- <param name="format" type="GLenum"/>
- <param name="type" type="GLenum"/>
- <param name="UNUSED" type="GLuint" padding="true"/>
- <param name="pixels" type="const GLvoid *" img_width="width" img_height="height" img_xoff="xoffset" img_yoff="yoffset" img_format="format" img_type="type" img_target="target" img_pad_dimensions="true"/>
- <glx rop="4100" large="true"/>
- </function>
-
- <function name="AreTexturesResident" offset="322">
- <param name="n" type="GLsizei" counter="true"/>
- <param name="textures" type="const GLuint *" count="n"/>
- <param name="residences" type="GLboolean *" output="true" count="n"/>
- <return type="GLboolean"/>
- <glx sop="143" handcode="client" always_array="true"/>
- </function>
-
- <function name="BindTexture" offset="307">
- <param name="target" type="GLenum"/>
- <param name="texture" type="GLuint"/>
- <glx rop="4117"/>
- </function>
-
- <function name="DeleteTextures" offset="327">
- <param name="n" type="GLsizei" counter="true"/>
- <param name="textures" type="const GLuint *" count="n"/>
- <glx sop="144"/>
- </function>
-
- <function name="GenTextures" offset="328">
- <param name="n" type="GLsizei" counter="true"/>
- <param name="textures" type="GLuint *" output="true" count="n"/>
- <glx sop="145" always_array="true"/>
- </function>
-
- <function name="IsTexture" offset="330">
- <param name="texture" type="GLuint"/>
- <return type="GLboolean"/>
- <glx sop="146"/>
- </function>
-
- <function name="PrioritizeTextures" offset="331">
- <param name="n" type="GLsizei" counter="true"/>
- <param name="textures" type="const GLuint *" count="n"/>
- <param name="priorities" type="const GLclampf *" count="n"/>
- <glx rop="4118"/>
- </function>
-
- <function name="Indexub" offset="315" vectorequiv="Indexubv">
- <param name="c" type="GLubyte"/>
- </function>
-
- <function name="Indexubv" offset="316">
- <param name="c" type="const GLubyte *" count="1"/>
- <glx rop="194"/>
- </function>
-
- <function name="PopClientAttrib" offset="334">
- <glx handcode="true"/>
- </function>
-
- <function name="PushClientAttrib" offset="335">
- <param name="mask" type="GLbitfield"/>
- <glx handcode="true"/>
- </function>
-</category>
-
-<category name="1.2">
- <enum name="UNSIGNED_BYTE_3_3_2" value="0x8032"/>
- <enum name="UNSIGNED_SHORT_4_4_4_4" value="0x8033"/>
- <enum name="UNSIGNED_SHORT_5_5_5_1" value="0x8034"/>
- <enum name="UNSIGNED_INT_8_8_8_8" value="0x8035"/>
- <enum name="UNSIGNED_INT_10_10_10_2" value="0x8036"/>
- <enum name="RESCALE_NORMAL" count="1" value="0x803A">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="TEXTURE_BINDING_3D" count="1" value="0x806A">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="PACK_SKIP_IMAGES" count="1" value="0x806B">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="PACK_IMAGE_HEIGHT" count="1" value="0x806C">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="UNPACK_SKIP_IMAGES" count="1" value="0x806D">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="UNPACK_IMAGE_HEIGHT" count="1" value="0x806E">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="TEXTURE_3D" count="1" value="0x806F">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="PROXY_TEXTURE_3D" value="0x8070"/>
- <enum name="TEXTURE_DEPTH" count="1" value="0x8071">
- <size name="GetTexLevelParameterfv" mode="get"/>
- <size name="GetTexLevelParameteriv" mode="get"/>
- </enum>
- <enum name="TEXTURE_WRAP_R" count="1" value="0x8072">
- <size name="TexParameterfv"/>
- <size name="TexParameteriv"/>
- <size name="GetTexParameterfv" mode="get"/>
- <size name="GetTexParameteriv" mode="get"/>
- </enum>
- <enum name="MAX_3D_TEXTURE_SIZE" count="1" value="0x8073">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="UNSIGNED_BYTE_2_3_3_REV" value="0x8362"/>
- <enum name="UNSIGNED_SHORT_5_6_5" value="0x8363"/>
- <enum name="UNSIGNED_SHORT_5_6_5_REV" value="0x8364"/>
- <enum name="UNSIGNED_SHORT_4_4_4_4_REV" value="0x8365"/>
- <enum name="UNSIGNED_SHORT_1_5_5_5_REV" value="0x8366"/>
- <enum name="UNSIGNED_INT_8_8_8_8_REV" value="0x8367"/>
- <enum name="UNSIGNED_INT_2_10_10_10_REV" value="0x8368"/>
- <enum name="BGR" value="0x80E0"/>
- <enum name="BGRA" value="0x80E1"/>
- <enum name="MAX_ELEMENTS_VERTICES" count="1" value="0x80E8">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="MAX_ELEMENTS_INDICES" count="1" value="0x80E9">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="CLAMP_TO_EDGE" value="0x812F"/>
- <enum name="TEXTURE_MIN_LOD" count="1" value="0x813A">
- <size name="TexParameterfv"/>
- <size name="TexParameteriv"/>
- <size name="GetTexParameterfv" mode="get"/>
- <size name="GetTexParameteriv" mode="get"/>
- </enum>
- <enum name="TEXTURE_MAX_LOD" count="1" value="0x813B">
- <size name="TexParameterfv"/>
- <size name="TexParameteriv"/>
- <size name="GetTexParameterfv" mode="get"/>
- <size name="GetTexParameteriv" mode="get"/>
- </enum>
- <enum name="TEXTURE_BASE_LEVEL" count="1" value="0x813C">
- <size name="TexParameterfv"/>
- <size name="TexParameteriv"/>
- <size name="GetTexParameterfv" mode="get"/>
- <size name="GetTexParameteriv" mode="get"/>
- </enum>
- <enum name="TEXTURE_MAX_LEVEL" count="1" value="0x813D">
- <size name="TexParameterfv"/>
- <size name="TexParameteriv"/>
- <size name="GetTexParameterfv" mode="get"/>
- <size name="GetTexParameteriv" mode="get"/>
- </enum>
- <enum name="LIGHT_MODEL_COLOR_CONTROL" count="1" value="0x81F8">
- <size name="LightModelfv"/>
- <size name="LightModeliv"/>
- <size name="Get" mode="get"/>
- </enum>
- <enum name="SINGLE_COLOR" value="0x81F9"/>
- <enum name="SEPARATE_SPECULAR_COLOR" value="0x81FA"/>
- <enum name="SMOOTH_POINT_SIZE_RANGE" count="2" value="0x0B12">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="SMOOTH_POINT_SIZE_GRANULARITY" count="1" value="0x0B13">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="SMOOTH_LINE_WIDTH_RANGE" count="2" value="0x0B22">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="SMOOTH_LINE_WIDTH_GRANULARITY" count="1" value="0x0B23">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="ALIASED_POINT_SIZE_RANGE" count="2" value="0x846D">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="ALIASED_LINE_WIDTH_RANGE" count="2" value="0x846E">
- <size name="Get" mode="get"/>
- </enum>
-
- <!-- These enums are actually part of the ARB_imaging subset. -->
-
- <enum name="CONSTANT_COLOR" value="0x8001"/>
- <enum name="ONE_MINUS_CONSTANT_COLOR" value="0x8002"/>
- <enum name="CONSTANT_ALPHA" value="0x8003"/>
- <enum name="ONE_MINUS_CONSTANT_ALPHA" value="0x8004"/>
- <enum name="BLEND_COLOR" count="4" value="0x8005">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="FUNC_ADD" value="0x8006"/>
- <enum name="MIN" value="0x8007"/>
- <enum name="MAX" value="0x8008"/>
- <enum name="BLEND_EQUATION" count="1" value="0x8009">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="FUNC_SUBTRACT" value="0x800A"/>
- <enum name="FUNC_REVERSE_SUBTRACT" value="0x800B"/>
- <enum name="CONVOLUTION_1D" count="1" value="0x8010">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="CONVOLUTION_2D" count="1" value="0x8011">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="SEPARABLE_2D" count="1" value="0x8012">
- <size name="Get" mode="get"/>
- </enum>
-
- <enum name="CONVOLUTION_BORDER_MODE" count="1" value="0x8013">
- <size name="ConvolutionParameterfv"/>
- <size name="ConvolutionParameteriv"/>
- <size name="GetConvolutionParameterfv" mode="get"/>
- <size name="GetConvolutionParameteriv" mode="get"/>
- </enum>
- <enum name="CONVOLUTION_BORDER_COLOR" count="4" value="0x8154">
- <size name="ConvolutionParameterfv"/>
- <size name="ConvolutionParameteriv"/>
- <size name="GetConvolutionParameterfv" mode="get"/>
- <size name="GetConvolutionParameteriv" mode="get"/>
- </enum>
- <enum name="CONVOLUTION_FILTER_SCALE" count="4" value="0x8014">
- <size name="ConvolutionParameterfv"/>
- <size name="ConvolutionParameteriv"/>
- <size name="GetConvolutionParameterfv" mode="get"/>
- <size name="GetConvolutionParameteriv" mode="get"/>
- </enum>
- <enum name="CONVOLUTION_FILTER_BIAS" count="4" value="0x8015">
- <size name="ConvolutionParameterfv"/>
- <size name="ConvolutionParameteriv"/>
- <size name="GetConvolutionParameterfv" mode="get"/>
- <size name="GetConvolutionParameteriv" mode="get"/>
- </enum>
- <enum name="REDUCE" value="0x8016"/>
- <enum name="CONVOLUTION_FORMAT" count="1" value="0x8017">
- <size name="GetConvolutionParameterfv" mode="get"/>
- <size name="GetConvolutionParameteriv" mode="get"/>
- </enum>
- <enum name="CONVOLUTION_WIDTH" count="1" value="0x8018">
- <size name="GetConvolutionParameterfv" mode="get"/>
- <size name="GetConvolutionParameteriv" mode="get"/>
- </enum>
- <enum name="CONVOLUTION_HEIGHT" count="1" value="0x8019">
- <size name="GetConvolutionParameterfv" mode="get"/>
- <size name="GetConvolutionParameteriv" mode="get"/>
- </enum>
- <enum name="MAX_CONVOLUTION_WIDTH" count="1" value="0x801A">
- <size name="GetConvolutionParameterfv" mode="get"/>
- <size name="GetConvolutionParameteriv" mode="get"/>
- <size name="Get" mode="get"/>
- </enum>
- <enum name="MAX_CONVOLUTION_HEIGHT" count="1" value="0x801B">
- <size name="GetConvolutionParameterfv" mode="get"/>
- <size name="GetConvolutionParameteriv" mode="get"/>
- <size name="Get" mode="get"/>
- </enum>
- <enum name="POST_CONVOLUTION_RED_SCALE" count="1" value="0x801C">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="POST_CONVOLUTION_GREEN_SCALE" count="1" value="0x801D">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="POST_CONVOLUTION_BLUE_SCALE" count="1" value="0x801E">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="POST_CONVOLUTION_ALPHA_SCALE" count="1" value="0x801F">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="POST_CONVOLUTION_RED_BIAS" count="1" value="0x8020">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="POST_CONVOLUTION_GREEN_BIAS" count="1" value="0x8021">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="POST_CONVOLUTION_BLUE_BIAS" count="1" value="0x8022">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="POST_CONVOLUTION_ALPHA_BIAS" count="1" value="0x8023">
- <size name="Get" mode="get"/>
- </enum>
-
- <enum name="HISTOGRAM" count="1" value="0x8024">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="PROXY_HISTOGRAM" value="0x8025"/>
- <enum name="HISTOGRAM_WIDTH" count="1" value="0x8026">
- <size name="GetHistogramParameterfv" mode="get"/>
- <size name="GetHistogramParameteriv" mode="get"/>
- </enum>
- <enum name="HISTOGRAM_FORMAT" count="1" value="0x8027">
- <size name="GetHistogramParameterfv" mode="get"/>
- <size name="GetHistogramParameteriv" mode="get"/>
- </enum>
- <enum name="HISTOGRAM_RED_SIZE" count="1" value="0x8028">
- <size name="GetHistogramParameterfv" mode="get"/>
- <size name="GetHistogramParameteriv" mode="get"/>
- </enum>
- <enum name="HISTOGRAM_GREEN_SIZE" count="1" value="0x8029">
- <size name="GetHistogramParameterfv" mode="get"/>
- <size name="GetHistogramParameteriv" mode="get"/>
- </enum>
- <enum name="HISTOGRAM_BLUE_SIZE" count="1" value="0x802A">
- <size name="GetHistogramParameterfv" mode="get"/>
- <size name="GetHistogramParameteriv" mode="get"/>
- </enum>
- <enum name="HISTOGRAM_ALPHA_SIZE" count="1" value="0x802B">
- <size name="GetHistogramParameterfv" mode="get"/>
- <size name="GetHistogramParameteriv" mode="get"/>
- </enum>
- <enum name="HISTOGRAM_LUMINANCE_SIZE" count="1" value="0x802C">
- <size name="GetHistogramParameterfv" mode="get"/>
- <size name="GetHistogramParameteriv" mode="get"/>
- </enum>
- <enum name="HISTOGRAM_SINK" count="1" value="0x802D">
- <size name="GetHistogramParameterfv" mode="get"/>
- <size name="GetHistogramParameteriv" mode="get"/>
- </enum>
- <enum name="MINMAX" count="1" value="0x802E">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="MINMAX_FORMAT" count="1" value="0x802F">
- <size name="GetMinmaxParameterfv" mode="get"/>
- <size name="GetMinmaxParameteriv" mode="get"/>
- </enum>
- <enum name="MINMAX_SINK" count="1" value="0x8030">
- <size name="GetMinmaxParameterfv" mode="get"/>
- <size name="GetMinmaxParameteriv" mode="get"/>
- </enum>
-
- <enum name="COLOR_MATRIX" count="16" value="0x80B1">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="COLOR_MATRIX_STACK_DEPTH" count="1" value="0x80B2">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="MAX_COLOR_MATRIX_STACK_DEPTH" count="1" value="0x80B3">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="POST_COLOR_MATRIX_RED_SCALE" count="1" value="0x80B4">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="POST_COLOR_MATRIX_GREEN_SCALE" count="1" value="0x80B5">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="POST_COLOR_MATRIX_BLUE_SCALE" count="1" value="0x80B6">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="POST_COLOR_MATRIX_ALPHA_SCALE" count="1" value="0x80B7">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="POST_COLOR_MATRIX_RED_BIAS" count="1" value="0x80B8">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="POST_COLOR_MATRIX_GREEN_BIAS" count="1" value="0x80B9">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="POST_COLOR_MATRIX_BLUE_BIAS" count="1" value="0x80BA">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="POST_COLOR_MATRIX_ALPHA_BIAS" count="1" value="0x80BB">
- <size name="Get" mode="get"/>
- </enum>
-
- <enum name="COLOR_TABLE" count="1" value="0x80D0">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="POST_CONVOLUTION_COLOR_TABLE" count="1" value="0x80D1">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="POST_COLOR_MATRIX_COLOR_TABLE" count="1" value="0x80D2">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="PROXY_COLOR_TABLE" value="0x80D3"/>
- <enum name="PROXY_POST_CONVOLUTION_COLOR_TABLE" value="0x80D4"/>
- <enum name="PROXY_POST_COLOR_MATRIX_COLOR_TABLE" value="0x80D5"/>
-
- <enum name="COLOR_TABLE_SCALE" count="4" value="0x80D6">
- <size name="ColorTableParameterfv"/>
- <size name="ColorTableParameteriv"/>
- <size name="GetColorTableParameterfv" mode="get"/>
- <size name="GetColorTableParameteriv" mode="get"/>
- </enum>
- <enum name="COLOR_TABLE_BIAS" count="4" value="0x80D7">
- <size name="ColorTableParameterfv"/>
- <size name="ColorTableParameteriv"/>
- <size name="GetColorTableParameterfv" mode="get"/>
- <size name="GetColorTableParameteriv" mode="get"/>
- </enum>
- <enum name="COLOR_TABLE_FORMAT" count="1" value="0x80D8">
- <size name="GetColorTableParameterfv" mode="get"/>
- <size name="GetColorTableParameteriv" mode="get"/>
- </enum>
- <enum name="COLOR_TABLE_WIDTH" count="1" value="0x80D9">
- <size name="GetColorTableParameterfv" mode="get"/>
- <size name="GetColorTableParameteriv" mode="get"/>
- </enum>
- <enum name="COLOR_TABLE_RED_SIZE" count="1" value="0x80DA">
- <size name="GetColorTableParameterfv" mode="get"/>
- <size name="GetColorTableParameteriv" mode="get"/>
- </enum>
- <enum name="COLOR_TABLE_GREEN_SIZE" count="1" value="0x80DB">
- <size name="GetColorTableParameterfv" mode="get"/>
- <size name="GetColorTableParameteriv" mode="get"/>
- </enum>
- <enum name="COLOR_TABLE_BLUE_SIZE" count="1" value="0x80DC">
- <size name="GetColorTableParameterfv" mode="get"/>
- <size name="GetColorTableParameteriv" mode="get"/>
- </enum>
- <enum name="COLOR_TABLE_ALPHA_SIZE" count="1" value="0x80DD">
- <size name="GetColorTableParameterfv" mode="get"/>
- <size name="GetColorTableParameteriv" mode="get"/>
- </enum>
- <enum name="COLOR_TABLE_LUMINANCE_SIZE" count="1" value="0x80DE">
- <size name="GetColorTableParameterfv" mode="get"/>
- <size name="GetColorTableParameteriv" mode="get"/>
- </enum>
- <enum name="COLOR_TABLE_INTENSITY_SIZE" count="1" value="0x80DF">
- <size name="GetColorTableParameterfv" mode="get"/>
- <size name="GetColorTableParameteriv" mode="get"/>
- </enum>
-
-
- <function name="BlendColor" offset="336">
- <param name="red" type="GLclampf"/>
- <param name="green" type="GLclampf"/>
- <param name="blue" type="GLclampf"/>
- <param name="alpha" type="GLclampf"/>
- <glx rop="4096"/>
- </function>
-
- <function name="BlendEquation" offset="337">
- <param name="mode" type="GLenum"/>
- <glx rop="4097"/>
- </function>
-
- <function name="DrawRangeElements" offset="338">
- <param name="mode" type="GLenum"/>
- <param name="start" type="GLuint"/>
- <param name="end" type="GLuint"/>
- <param name="count" type="GLsizei"/>
- <param name="type" type="GLenum"/>
- <param name="indices" type="const GLvoid *"/>
- <glx handcode="true"/>
- </function>
-
- <function name="ColorTable" offset="339">
- <param name="target" type="GLenum"/>
- <param name="internalformat" type="GLenum"/>
- <param name="width" type="GLsizei"/>
- <param name="format" type="GLenum"/>
- <param name="type" type="GLenum"/>
- <param name="table" type="const GLvoid *" img_width="width" img_pad_dimensions="false" img_format="format" img_type="type" img_target="target"/>
- <glx rop="2053" large="true"/>
- </function>
-
- <function name="ColorTableParameterfv" offset="340">
- <param name="target" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="const GLfloat *" variable_param="pname"/>
- <glx rop="2054"/>
- </function>
-
- <function name="ColorTableParameteriv" offset="341">
- <param name="target" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="const GLint *" variable_param="pname"/>
- <glx rop="2055"/>
- </function>
-
- <function name="CopyColorTable" offset="342">
- <param name="target" type="GLenum"/>
- <param name="internalformat" type="GLenum"/>
- <param name="x" type="GLint"/>
- <param name="y" type="GLint"/>
- <param name="width" type="GLsizei"/>
- <glx rop="2056"/>
- </function>
-
- <function name="GetColorTable" offset="343">
- <param name="target" type="GLenum"/>
- <param name="format" type="GLenum"/>
- <param name="type" type="GLenum"/>
- <param name="table" type="GLvoid *" output="true" img_width="width" img_format="format" img_type="type"/>
- <glx sop="147" dimensions_in_reply="true"/>
- </function>
-
- <function name="GetColorTableParameterfv" offset="344">
- <param name="target" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLfloat *" output="true" variable_param="pname"/>
- <glx sop="148"/>
- </function>
-
- <function name="GetColorTableParameteriv" offset="345">
- <param name="target" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLint *" output="true" variable_param="pname"/>
- <glx sop="149"/>
- </function>
-
- <function name="ColorSubTable" offset="346">
- <param name="target" type="GLenum"/>
- <param name="start" type="GLsizei"/>
- <param name="count" type="GLsizei"/>
- <param name="format" type="GLenum"/>
- <param name="type" type="GLenum"/>
- <param name="data" type="const GLvoid *" img_width="count" img_pad_dimensions="false" img_format="format" img_type="type" img_target="target"/>
- <glx rop="195" large="true"/>
- </function>
-
- <function name="CopyColorSubTable" offset="347">
- <param name="target" type="GLenum"/>
- <param name="start" type="GLsizei"/>
- <param name="x" type="GLint"/>
- <param name="y" type="GLint"/>
- <param name="width" type="GLsizei"/>
- <glx rop="196"/>
- </function>
-
- <function name="ConvolutionFilter1D" offset="348">
- <param name="target" type="GLenum"/>
- <param name="internalformat" type="GLenum"/>
- <param name="width" type="GLsizei"/>
- <param name="format" type="GLenum"/>
- <param name="type" type="GLenum"/>
- <param name="image" type="const GLvoid *" img_width="width" img_format="format" img_type="type" img_target="target" img_pad_dimensions="true"/>
- <glx rop="4101" large="true"/>
- </function>
-
- <function name="ConvolutionFilter2D" offset="349">
- <param name="target" type="GLenum"/>
- <param name="internalformat" type="GLenum"/>
- <param name="width" type="GLsizei"/>
- <param name="height" type="GLsizei"/>
- <param name="format" type="GLenum"/>
- <param name="type" type="GLenum"/>
- <param name="image" type="const GLvoid *" img_width="width" img_height="height" img_format="format" img_type="type" img_target="target" img_pad_dimensions="true"/>
- <glx rop="4102" large="true"/>
- </function>
-
- <function name="ConvolutionParameterf" offset="350">
- <param name="target" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLfloat"/>
- <glx rop="4103"/>
- </function>
-
- <function name="ConvolutionParameterfv" offset="351">
- <param name="target" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="const GLfloat *" variable_param="pname"/>
- <glx rop="4104"/>
- </function>
-
- <function name="ConvolutionParameteri" offset="352">
- <param name="target" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLint"/>
- <glx rop="4105"/>
- </function>
-
- <function name="ConvolutionParameteriv" offset="353">
- <param name="target" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="const GLint *" variable_param="pname"/>
- <glx rop="4106"/>
- </function>
-
- <function name="CopyConvolutionFilter1D" offset="354">
- <param name="target" type="GLenum"/>
- <param name="internalformat" type="GLenum"/>
- <param name="x" type="GLint"/>
- <param name="y" type="GLint"/>
- <param name="width" type="GLsizei"/>
- <glx rop="4107"/>
- </function>
-
- <function name="CopyConvolutionFilter2D" offset="355">
- <param name="target" type="GLenum"/>
- <param name="internalformat" type="GLenum"/>
- <param name="x" type="GLint"/>
- <param name="y" type="GLint"/>
- <param name="width" type="GLsizei"/>
- <param name="height" type="GLsizei"/>
- <glx rop="4108"/>
- </function>
-
- <function name="GetConvolutionFilter" offset="356">
- <param name="target" type="GLenum"/>
- <param name="format" type="GLenum"/>
- <param name="type" type="GLenum"/>
- <param name="image" type="GLvoid *" output="true" img_width="width" img_height="height" img_format="format" img_type="type"/>
- <glx sop="150" dimensions_in_reply="true"/>
- </function>
-
- <function name="GetConvolutionParameterfv" offset="357">
- <param name="target" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLfloat *" output="true" variable_param="pname"/>
- <glx sop="151"/>
- </function>
-
- <function name="GetConvolutionParameteriv" offset="358">
- <param name="target" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLint *" output="true" variable_param="pname"/>
- <glx sop="152"/>
- </function>
-
- <function name="GetSeparableFilter" offset="359">
- <param name="target" type="GLenum"/>
- <param name="format" type="GLenum"/>
- <param name="type" type="GLenum"/>
- <param name="row" type="GLvoid *" output="true"/>
- <param name="column" type="GLvoid *" output="true"/>
- <param name="span" type="GLvoid *" output="true"/>
- <glx sop="153" handcode="true"/>
- </function>
-
- <function name="SeparableFilter2D" offset="360">
- <param name="target" type="GLenum"/>
- <param name="internalformat" type="GLenum"/>
- <param name="width" type="GLsizei"/>
- <param name="height" type="GLsizei"/>
- <param name="format" type="GLenum"/>
- <param name="type" type="GLenum"/>
- <param name="row" type="const GLvoid *"/>
- <param name="column" type="const GLvoid *"/>
- <glx rop="4109" handcode="true"/>
- </function>
-
- <function name="GetHistogram" offset="361">
- <param name="target" type="GLenum"/>
- <param name="reset" type="GLboolean"/>
- <param name="format" type="GLenum"/>
- <param name="type" type="GLenum"/>
- <param name="values" type="GLvoid *" output="true" img_width="width" img_format="format" img_type="type"/>
- <glx sop="154" dimensions_in_reply="true" img_reset="reset"/>
- </function>
-
- <function name="GetHistogramParameterfv" offset="362">
- <param name="target" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLfloat *" output="true" variable_param="pname"/>
- <glx sop="155"/>
- </function>
-
- <function name="GetHistogramParameteriv" offset="363">
- <param name="target" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLint *" output="true" variable_param="pname"/>
- <glx sop="156"/>
- </function>
-
- <function name="GetMinmax" offset="364">
- <param name="target" type="GLenum"/>
- <param name="reset" type="GLboolean"/>
- <param name="format" type="GLenum"/>
- <param name="type" type="GLenum"/>
- <param name="values" type="GLvoid *" output="true" img_width="2" img_format="format" img_type="type"/>
- <glx sop="157" img_reset="reset"/>
- </function>
-
- <function name="GetMinmaxParameterfv" offset="365">
- <param name="target" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLfloat *" output="true" variable_param="pname"/>
- <glx sop="158"/>
- </function>
-
- <function name="GetMinmaxParameteriv" offset="366">
- <param name="target" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLint *" output="true" variable_param="pname"/>
- <glx sop="159"/>
- </function>
-
- <function name="Histogram" offset="367">
- <param name="target" type="GLenum"/>
- <param name="width" type="GLsizei"/>
- <param name="internalformat" type="GLenum"/>
- <param name="sink" type="GLboolean"/>
- <glx rop="4110"/>
- </function>
-
- <function name="Minmax" offset="368">
- <param name="target" type="GLenum"/>
- <param name="internalformat" type="GLenum"/>
- <param name="sink" type="GLboolean"/>
- <glx rop="4111"/>
- </function>
-
- <function name="ResetHistogram" offset="369">
- <param name="target" type="GLenum"/>
- <glx rop="4112"/>
- </function>
-
- <function name="ResetMinmax" offset="370">
- <param name="target" type="GLenum"/>
- <glx rop="4113"/>
- </function>
-
- <function name="TexImage3D" offset="371">
- <param name="target" type="GLenum"/>
- <param name="level" type="GLint"/>
- <param name="internalformat" type="GLint"/>
- <param name="width" type="GLsizei"/>
- <param name="height" type="GLsizei"/>
- <param name="depth" type="GLsizei"/>
- <param name="border" type="GLint"/>
- <param name="format" type="GLenum"/>
- <param name="type" type="GLenum"/>
- <param name="pixels" type="const GLvoid *" img_width="width" img_height="height" img_depth="depth" img_format="format" img_type="type" img_target="target" img_null_flag="true" img_pad_dimensions="true"/>
- <glx rop="4114" large="true"/>
- </function>
-
- <function name="TexSubImage3D" offset="372">
- <param name="target" type="GLenum"/>
- <param name="level" type="GLint"/>
- <param name="xoffset" type="GLint"/>
- <param name="yoffset" type="GLint"/>
- <param name="zoffset" type="GLint"/>
- <param name="width" type="GLsizei"/>
- <param name="height" type="GLsizei"/>
- <param name="depth" type="GLsizei"/>
- <param name="format" type="GLenum"/>
- <param name="type" type="GLenum"/>
- <param name="UNUSED" type="GLuint" padding="true"/>
- <param name="pixels" type="const GLvoid *" img_width="width" img_height="height" img_depth="depth" img_xoff="xoffset" img_yoff="yoffset" img_zoff="zoffset" img_format="format" img_type="type" img_target="target" img_pad_dimensions="true"/>
- <glx rop="4115" large="true"/>
- </function>
-
- <function name="CopyTexSubImage3D" offset="373">
- <param name="target" type="GLenum"/>
- <param name="level" type="GLint"/>
- <param name="xoffset" type="GLint"/>
- <param name="yoffset" type="GLint"/>
- <param name="zoffset" type="GLint"/>
- <param name="x" type="GLint"/>
- <param name="y" type="GLint"/>
- <param name="width" type="GLsizei"/>
- <param name="height" type="GLsizei"/>
- <glx rop="4123"/>
- </function>
-</category>
-
-<category name="1.3">
- <enum name="TEXTURE0" value="0x84C0"/>
- <enum name="TEXTURE1" value="0x84C1"/>
- <enum name="TEXTURE2" value="0x84C2"/>
- <enum name="TEXTURE3" value="0x84C3"/>
- <enum name="TEXTURE4" value="0x84C4"/>
- <enum name="TEXTURE5" value="0x84C5"/>
- <enum name="TEXTURE6" value="0x84C6"/>
- <enum name="TEXTURE7" value="0x84C7"/>
- <enum name="TEXTURE8" value="0x84C8"/>
- <enum name="TEXTURE9" value="0x84C9"/>
- <enum name="TEXTURE10" value="0x84CA"/>
- <enum name="TEXTURE11" value="0x84CB"/>
- <enum name="TEXTURE12" value="0x84CC"/>
- <enum name="TEXTURE13" value="0x84CD"/>
- <enum name="TEXTURE14" value="0x84CE"/>
- <enum name="TEXTURE15" value="0x84CF"/>
- <enum name="TEXTURE16" value="0x84D0"/>
- <enum name="TEXTURE17" value="0x84D1"/>
- <enum name="TEXTURE18" value="0x84D2"/>
- <enum name="TEXTURE19" value="0x84D3"/>
- <enum name="TEXTURE20" value="0x84D4"/>
- <enum name="TEXTURE21" value="0x84D5"/>
- <enum name="TEXTURE22" value="0x84D6"/>
- <enum name="TEXTURE23" value="0x84D7"/>
- <enum name="TEXTURE24" value="0x84D8"/>
- <enum name="TEXTURE25" value="0x84D9"/>
- <enum name="TEXTURE26" value="0x84DA"/>
- <enum name="TEXTURE27" value="0x84DB"/>
- <enum name="TEXTURE28" value="0x84DC"/>
- <enum name="TEXTURE29" value="0x84DD"/>
- <enum name="TEXTURE30" value="0x84DE"/>
- <enum name="TEXTURE31" value="0x84DF"/>
- <enum name="ACTIVE_TEXTURE" count="1" value="0x84E0">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="CLIENT_ACTIVE_TEXTURE" count="1" value="0x84E1">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="MAX_TEXTURE_UNITS" count="1" value="0x84E2">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="TRANSPOSE_MODELVIEW_MATRIX" value="0x84E3"/>
- <enum name="TRANSPOSE_PROJECTION_MATRIX" value="0x84E4"/>
- <enum name="TRANSPOSE_TEXTURE_MATRIX" value="0x84E5"/>
- <enum name="TRANSPOSE_COLOR_MATRIX" value="0x84E6"/>
- <enum name="MULTISAMPLE" count="1" value="0x809D">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="SAMPLE_ALPHA_TO_COVERAGE" count="1" value="0x809E">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="SAMPLE_ALPHA_TO_ONE" count="1" value="0x809F">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="SAMPLE_COVERAGE" count="1" value="0x80A0">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="SAMPLE_BUFFERS" count="1" value="0x80A8">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="SAMPLES" count="1" value="0x80A9">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="SAMPLE_COVERAGE_VALUE" count="1" value="0x80AA">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="SAMPLE_COVERAGE_INVERT" count="1" value="0x80AB">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="MULTISAMPLE_BIT" value="0x20000000"/>
- <enum name="NORMAL_MAP" value="0x8511"/>
- <enum name="REFLECTION_MAP" value="0x8512"/>
- <enum name="TEXTURE_CUBE_MAP" count="1" value="0x8513">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="TEXTURE_BINDING_CUBE_MAP" count="1" value="0x8514">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="TEXTURE_CUBE_MAP_POSITIVE_X" value="0x8515"/>
- <enum name="TEXTURE_CUBE_MAP_NEGATIVE_X" value="0x8516"/>
- <enum name="TEXTURE_CUBE_MAP_POSITIVE_Y" value="0x8517"/>
- <enum name="TEXTURE_CUBE_MAP_NEGATIVE_Y" value="0x8518"/>
- <enum name="TEXTURE_CUBE_MAP_POSITIVE_Z" value="0x8519"/>
- <enum name="TEXTURE_CUBE_MAP_NEGATIVE_Z" value="0x851A"/>
- <enum name="PROXY_TEXTURE_CUBE_MAP" value="0x851B"/>
- <enum name="MAX_CUBE_MAP_TEXTURE_SIZE" count="1" value="0x851C">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="COMPRESSED_ALPHA" value="0x84E9"/>
- <enum name="COMPRESSED_LUMINANCE" value="0x84EA"/>
- <enum name="COMPRESSED_LUMINANCE_ALPHA" value="0x84EB"/>
- <enum name="COMPRESSED_INTENSITY" value="0x84EC"/>
- <enum name="COMPRESSED_RGB" value="0x84ED"/>
- <enum name="COMPRESSED_RGBA" value="0x84EE"/>
- <enum name="TEXTURE_COMPRESSION_HINT" count="1" value="0x84EF">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="TEXTURE_COMPRESSED_IMAGE_SIZE" count="1" value="0x86A0">
- <size name="GetTexLevelParameterfv" mode="get"/>
- <size name="GetTexLevelParameteriv" mode="get"/>
- </enum>
- <enum name="TEXTURE_COMPRESSED" count="1" value="0x86A1">
- <size name="GetTexLevelParameterfv" mode="get"/>
- <size name="GetTexLevelParameteriv" mode="get"/>
- </enum>
- <enum name="NUM_COMPRESSED_TEXTURE_FORMATS" count="1" value="0x86A2">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="COMPRESSED_TEXTURE_FORMATS" count="-1" value="0x86A3">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="CLAMP_TO_BORDER" value="0x812D"/>
- <enum name="COMBINE" value="0x8570"/>
- <enum name="COMBINE_RGB" count="1" value="0x8571">
- <size name="TexEnvfv"/>
- <size name="TexEnviv"/>
- <size name="GetTexEnvfv" mode="get"/>
- <size name="GetTexEnviv" mode="get"/>
- </enum>
- <enum name="COMBINE_ALPHA" count="1" value="0x8572">
- <size name="TexEnvfv"/>
- <size name="TexEnviv"/>
- <size name="GetTexEnvfv" mode="get"/>
- <size name="GetTexEnviv" mode="get"/>
- </enum>
- <enum name="SOURCE0_RGB" count="1" value="0x8580">
- <size name="TexEnvfv"/>
- <size name="TexEnviv"/>
- <size name="GetTexEnvfv" mode="get"/>
- <size name="GetTexEnviv" mode="get"/>
- </enum>
- <enum name="SOURCE1_RGB" count="1" value="0x8581">
- <size name="TexEnvfv"/>
- <size name="TexEnviv"/>
- <size name="GetTexEnvfv" mode="get"/>
- <size name="GetTexEnviv" mode="get"/>
- </enum>
- <enum name="SOURCE2_RGB" count="1" value="0x8582">
- <size name="TexEnvfv"/>
- <size name="TexEnviv"/>
- <size name="GetTexEnvfv" mode="get"/>
- <size name="GetTexEnviv" mode="get"/>
- </enum>
- <enum name="SOURCE0_ALPHA" count="1" value="0x8588">
- <size name="TexEnvfv"/>
- <size name="TexEnviv"/>
- <size name="GetTexEnvfv" mode="get"/>
- <size name="GetTexEnviv" mode="get"/>
- </enum>
- <enum name="SOURCE1_ALPHA" count="1" value="0x8589">
- <size name="TexEnvfv"/>
- <size name="TexEnviv"/>
- <size name="GetTexEnvfv" mode="get"/>
- <size name="GetTexEnviv" mode="get"/>
- </enum>
- <enum name="SOURCE2_ALPHA" count="1" value="0x858A">
- <size name="TexEnvfv"/>
- <size name="TexEnviv"/>
- <size name="GetTexEnvfv" mode="get"/>
- <size name="GetTexEnviv" mode="get"/>
- </enum>
- <enum name="OPERAND0_RGB" count="1" value="0x8590">
- <size name="TexEnvfv"/>
- <size name="TexEnviv"/>
- <size name="GetTexEnvfv" mode="get"/>
- <size name="GetTexEnviv" mode="get"/>
- </enum>
- <enum name="OPERAND1_RGB" count="1" value="0x8591">
- <size name="TexEnvfv"/>
- <size name="TexEnviv"/>
- <size name="GetTexEnvfv" mode="get"/>
- <size name="GetTexEnviv" mode="get"/>
- </enum>
- <enum name="OPERAND2_RGB" count="1" value="0x8592">
- <size name="TexEnvfv"/>
- <size name="TexEnviv"/>
- <size name="GetTexEnvfv" mode="get"/>
- <size name="GetTexEnviv" mode="get"/>
- </enum>
- <enum name="OPERAND0_ALPHA" count="1" value="0x8598">
- <size name="TexEnvfv"/>
- <size name="TexEnviv"/>
- <size name="GetTexEnvfv" mode="get"/>
- <size name="GetTexEnviv" mode="get"/>
- </enum>
- <enum name="OPERAND1_ALPHA" count="1" value="0x8599">
- <size name="TexEnvfv"/>
- <size name="TexEnviv"/>
- <size name="GetTexEnvfv" mode="get"/>
- <size name="GetTexEnviv" mode="get"/>
- </enum>
- <enum name="OPERAND2_ALPHA" count="1" value="0x859A">
- <size name="TexEnvfv"/>
- <size name="TexEnviv"/>
- <size name="GetTexEnvfv" mode="get"/>
- <size name="GetTexEnviv" mode="get"/>
- </enum>
- <enum name="RGB_SCALE" count="1" value="0x8573">
- <size name="TexEnvfv"/>
- <size name="TexEnviv"/>
- <size name="GetTexEnvfv" mode="get"/>
- <size name="GetTexEnviv" mode="get"/>
- </enum>
- <enum name="ADD_SIGNED" value="0x8574"/>
- <enum name="INTERPOLATE" value="0x8575"/>
- <enum name="SUBTRACT" value="0x84E7"/>
- <enum name="CONSTANT" value="0x8576"/>
- <enum name="PRIMARY_COLOR" value="0x8577"/>
- <enum name="PREVIOUS" value="0x8578"/>
- <enum name="DOT3_RGB" value="0x86AE"/>
- <enum name="DOT3_RGBA" value="0x86AF"/>
-
- <function name="ActiveTexture" alias="ActiveTextureARB">
- <param name="texture" type="GLenum"/>
- </function>
-
- <function name="ClientActiveTexture" alias="ClientActiveTextureARB">
- <param name="texture" type="GLenum"/>
- </function>
-
- <function name="MultiTexCoord1d" alias="MultiTexCoord1dARB">
- <param name="target" type="GLenum"/>
- <param name="s" type="GLdouble"/>
- </function>
-
- <function name="MultiTexCoord1dv" alias="MultiTexCoord1dvARB">
- <param name="target" type="GLenum"/>
- <param name="v" type="const GLdouble *"/>
- </function>
-
- <function name="MultiTexCoord1f" alias="MultiTexCoord1fARB">
- <param name="target" type="GLenum"/>
- <param name="s" type="GLfloat"/>
- </function>
-
- <function name="MultiTexCoord1fv" alias="MultiTexCoord1fvARB">
- <param name="target" type="GLenum"/>
- <param name="v" type="const GLfloat *"/>
- </function>
-
- <function name="MultiTexCoord1i" alias="MultiTexCoord1iARB">
- <param name="target" type="GLenum"/>
- <param name="s" type="GLint"/>
- </function>
-
- <function name="MultiTexCoord1iv" alias="MultiTexCoord1ivARB">
- <param name="target" type="GLenum"/>
- <param name="v" type="const GLint *"/>
- </function>
-
- <function name="MultiTexCoord1s" alias="MultiTexCoord1sARB">
- <param name="target" type="GLenum"/>
- <param name="s" type="GLshort"/>
- </function>
-
- <function name="MultiTexCoord1sv" alias="MultiTexCoord1svARB">
- <param name="target" type="GLenum"/>
- <param name="v" type="const GLshort *"/>
- </function>
-
- <function name="MultiTexCoord2d" alias="MultiTexCoord2dARB">
- <param name="target" type="GLenum"/>
- <param name="s" type="GLdouble"/>
- <param name="t" type="GLdouble"/>
- </function>
-
- <function name="MultiTexCoord2dv" alias="MultiTexCoord2dvARB">
- <param name="target" type="GLenum"/>
- <param name="v" type="const GLdouble *"/>
- </function>
-
- <function name="MultiTexCoord2f" alias="MultiTexCoord2fARB">
- <param name="target" type="GLenum"/>
- <param name="s" type="GLfloat"/>
- <param name="t" type="GLfloat"/>
- </function>
-
- <function name="MultiTexCoord2fv" alias="MultiTexCoord2fvARB">
- <param name="target" type="GLenum"/>
- <param name="v" type="const GLfloat *"/>
- </function>
-
- <function name="MultiTexCoord2i" alias="MultiTexCoord2iARB">
- <param name="target" type="GLenum"/>
- <param name="s" type="GLint"/>
- <param name="t" type="GLint"/>
- </function>
-
- <function name="MultiTexCoord2iv" alias="MultiTexCoord2ivARB">
- <param name="target" type="GLenum"/>
- <param name="v" type="const GLint *"/>
- </function>
-
- <function name="MultiTexCoord2s" alias="MultiTexCoord2sARB">
- <param name="target" type="GLenum"/>
- <param name="s" type="GLshort"/>
- <param name="t" type="GLshort"/>
- </function>
-
- <function name="MultiTexCoord2sv" alias="MultiTexCoord2svARB">
- <param name="target" type="GLenum"/>
- <param name="v" type="const GLshort *"/>
- </function>
-
- <function name="MultiTexCoord3d" alias="MultiTexCoord3dARB">
- <param name="target" type="GLenum"/>
- <param name="s" type="GLdouble"/>
- <param name="t" type="GLdouble"/>
- <param name="r" type="GLdouble"/>
- </function>
-
- <function name="MultiTexCoord3dv" alias="MultiTexCoord3dvARB">
- <param name="target" type="GLenum"/>
- <param name="v" type="const GLdouble *"/>
- </function>
-
- <function name="MultiTexCoord3f" alias="MultiTexCoord3fARB">
- <param name="target" type="GLenum"/>
- <param name="s" type="GLfloat"/>
- <param name="t" type="GLfloat"/>
- <param name="r" type="GLfloat"/>
- </function>
-
- <function name="MultiTexCoord3fv" alias="MultiTexCoord3fvARB">
- <param name="target" type="GLenum"/>
- <param name="v" type="const GLfloat *"/>
- </function>
-
- <function name="MultiTexCoord3i" alias="MultiTexCoord3iARB">
- <param name="target" type="GLenum"/>
- <param name="s" type="GLint"/>
- <param name="t" type="GLint"/>
- <param name="r" type="GLint"/>
- </function>
-
- <function name="MultiTexCoord3iv" alias="MultiTexCoord3ivARB">
- <param name="target" type="GLenum"/>
- <param name="v" type="const GLint *"/>
- </function>
-
- <function name="MultiTexCoord3s" alias="MultiTexCoord3sARB">
- <param name="target" type="GLenum"/>
- <param name="s" type="GLshort"/>
- <param name="t" type="GLshort"/>
- <param name="r" type="GLshort"/>
- </function>
-
- <function name="MultiTexCoord3sv" alias="MultiTexCoord3svARB">
- <param name="target" type="GLenum"/>
- <param name="v" type="const GLshort *"/>
- </function>
-
- <function name="MultiTexCoord4d" alias="MultiTexCoord4dARB">
- <param name="target" type="GLenum"/>
- <param name="s" type="GLdouble"/>
- <param name="t" type="GLdouble"/>
- <param name="r" type="GLdouble"/>
- <param name="q" type="GLdouble"/>
- </function>
-
- <function name="MultiTexCoord4dv" alias="MultiTexCoord4dvARB">
- <param name="target" type="GLenum"/>
- <param name="v" type="const GLdouble *"/>
- </function>
-
- <function name="MultiTexCoord4f" alias="MultiTexCoord4fARB">
- <param name="target" type="GLenum"/>
- <param name="s" type="GLfloat"/>
- <param name="t" type="GLfloat"/>
- <param name="r" type="GLfloat"/>
- <param name="q" type="GLfloat"/>
- </function>
-
- <function name="MultiTexCoord4fv" alias="MultiTexCoord4fvARB">
- <param name="target" type="GLenum"/>
- <param name="v" type="const GLfloat *"/>
- </function>
-
- <function name="MultiTexCoord4i" alias="MultiTexCoord4iARB">
- <param name="target" type="GLenum"/>
- <param name="s" type="GLint"/>
- <param name="t" type="GLint"/>
- <param name="r" type="GLint"/>
- <param name="q" type="GLint"/>
- </function>
-
- <function name="MultiTexCoord4iv" alias="MultiTexCoord4ivARB">
- <param name="target" type="GLenum"/>
- <param name="v" type="const GLint *"/>
- </function>
-
- <function name="MultiTexCoord4s" alias="MultiTexCoord4sARB">
- <param name="target" type="GLenum"/>
- <param name="s" type="GLshort"/>
- <param name="t" type="GLshort"/>
- <param name="r" type="GLshort"/>
- <param name="q" type="GLshort"/>
- </function>
-
- <function name="MultiTexCoord4sv" alias="MultiTexCoord4svARB">
- <param name="target" type="GLenum"/>
- <param name="v" type="const GLshort *"/>
- </function>
-
- <function name="LoadTransposeMatrixf" alias="LoadTransposeMatrixfARB">
- <param name="m" type="const GLfloat *"/>
- </function>
-
- <function name="LoadTransposeMatrixd" alias="LoadTransposeMatrixdARB">
- <param name="m" type="const GLdouble *"/>
- </function>
-
- <function name="MultTransposeMatrixf" alias="MultTransposeMatrixfARB">
- <param name="m" type="const GLfloat *"/>
- </function>
-
- <function name="MultTransposeMatrixd" alias="MultTransposeMatrixdARB">
- <param name="m" type="const GLdouble *"/>
- </function>
-
- <function name="SampleCoverage" alias="SampleCoverageARB">
- <param name="value" type="GLclampf"/>
- <param name="invert" type="GLboolean"/>
- </function>
-
- <function name="CompressedTexImage3D" alias="CompressedTexImage3DARB">
- <param name="target" type="GLenum"/>
- <param name="level" type="GLint"/>
- <param name="internalformat" type="GLenum"/>
- <param name="width" type="GLsizei"/>
- <param name="height" type="GLsizei"/>
- <param name="depth" type="GLsizei"/>
- <param name="border" type="GLint"/>
- <param name="imageSize" type="GLsizei"/>
- <param name="data" type="const GLvoid *"/>
- </function>
-
- <function name="CompressedTexImage2D" alias="CompressedTexImage2DARB">
- <param name="target" type="GLenum"/>
- <param name="level" type="GLint"/>
- <param name="internalformat" type="GLenum"/>
- <param name="width" type="GLsizei"/>
- <param name="height" type="GLsizei"/>
- <param name="border" type="GLint"/>
- <param name="imageSize" type="GLsizei"/>
- <param name="data" type="const GLvoid *"/>
- </function>
-
- <function name="CompressedTexImage1D" alias="CompressedTexImage1DARB">
- <param name="target" type="GLenum"/>
- <param name="level" type="GLint"/>
- <param name="internalformat" type="GLenum"/>
- <param name="width" type="GLsizei"/>
- <param name="border" type="GLint"/>
- <param name="imageSize" type="GLsizei"/>
- <param name="data" type="const GLvoid *"/>
- </function>
-
- <function name="CompressedTexSubImage3D" alias="CompressedTexSubImage3DARB">
- <param name="target" type="GLenum"/>
- <param name="level" type="GLint"/>
- <param name="xoffset" type="GLint"/>
- <param name="yoffset" type="GLint"/>
- <param name="zoffset" type="GLint"/>
- <param name="width" type="GLsizei"/>
- <param name="height" type="GLsizei"/>
- <param name="depth" type="GLsizei"/>
- <param name="format" type="GLenum"/>
- <param name="imageSize" type="GLsizei"/>
- <param name="data" type="const GLvoid *"/>
- </function>
-
- <function name="CompressedTexSubImage2D" alias="CompressedTexSubImage2DARB">
- <param name="target" type="GLenum"/>
- <param name="level" type="GLint"/>
- <param name="xoffset" type="GLint"/>
- <param name="yoffset" type="GLint"/>
- <param name="width" type="GLsizei"/>
- <param name="height" type="GLsizei"/>
- <param name="format" type="GLenum"/>
- <param name="imageSize" type="GLsizei"/>
- <param name="data" type="const GLvoid *"/>
- </function>
-
- <function name="CompressedTexSubImage1D" alias="CompressedTexSubImage1DARB">
- <param name="target" type="GLenum"/>
- <param name="level" type="GLint"/>
- <param name="xoffset" type="GLint"/>
- <param name="width" type="GLsizei"/>
- <param name="format" type="GLenum"/>
- <param name="imageSize" type="GLsizei"/>
- <param name="data" type="const GLvoid *"/>
- </function>
-
- <function name="GetCompressedTexImage" alias="GetCompressedTexImageARB">
- <param name="target" type="GLenum"/>
- <param name="level" type="GLint"/>
- <param name="img" type="GLvoid *" output="true"/>
- </function>
-</category>
-
-<category name="1.4">
- <enum name="BLEND_DST_RGB" count="1" value="0x80C8">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="BLEND_SRC_RGB" count="1" value="0x80C9">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="BLEND_DST_ALPHA" count="1" value="0x80CA">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="BLEND_SRC_ALPHA" count="1" value="0x80CB">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="POINT_SIZE_MIN" count="1" value="0x8126">
- <size name="PointParameterfvEXT"/>
- <size name="Get" mode="get"/>
- </enum>
- <enum name="POINT_SIZE_MAX" count="1" value="0x8127">
- <size name="PointParameterfvEXT"/>
- <size name="Get" mode="get"/>
- </enum>
- <enum name="POINT_FADE_THRESHOLD_SIZE" count="1" value="0x8128">
- <size name="PointParameterfvEXT"/>
- <size name="Get" mode="get"/>
- </enum>
- <enum name="POINT_DISTANCE_ATTENUATION" count="3" value="0x8129">
- <size name="PointParameterfvEXT"/>
- <size name="Get" mode="get"/>
- </enum>
- <enum name="GENERATE_MIPMAP" count="1" value="0x8191">
- <size name="TexParameterfv"/>
- <size name="TexParameteriv"/>
- <size name="GetTexParameterfv" mode="get"/>
- <size name="GetTexParameteriv" mode="get"/>
- </enum>
- <enum name="GENERATE_MIPMAP_HINT" value="0x8192"/>
- <enum name="DEPTH_COMPONENT16" value="0x81A5"/>
- <enum name="DEPTH_COMPONENT24" value="0x81A6"/>
- <enum name="DEPTH_COMPONENT32" value="0x81A7"/>
- <enum name="MIRRORED_REPEAT" value="0x8370"/>
- <enum name="FOG_COORDINATE_SOURCE" count="1" value="0x8450">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="FOG_COORDINATE" value="0x8451"/>
- <enum name="FRAGMENT_DEPTH" value="0x8452"/>
- <enum name="CURRENT_FOG_COORDINATE" count="1" value="0x8453">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="FOG_COORDINATE_ARRAY_TYPE" count="1" value="0x8454">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="FOG_COORDINATE_ARRAY_STRIDE" count="1" value="0x8455">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="FOG_COORDINATE_ARRAY_POINTER" value="0x8456"/>
- <enum name="FOG_COORDINATE_ARRAY" count="1" value="0x8457">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="COLOR_SUM" value="0x8458"/>
- <enum name="CURRENT_SECONDARY_COLOR" count="4" value="0x8459">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="SECONDARY_COLOR_ARRAY_SIZE" count="1" value="0x845A">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="SECONDARY_COLOR_ARRAY_TYPE" count="1" value="0x845B">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="SECONDARY_COLOR_ARRAY_STRIDE" count="1" value="0x845C">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="SECONDARY_COLOR_ARRAY_POINTER" value="0x845D"/>
- <enum name="SECONDARY_COLOR_ARRAY" count="1" value="0x845E">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="MAX_TEXTURE_LOD_BIAS" count="1" value="0x84FD">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="TEXTURE_FILTER_CONTROL" value="0x8500"/>
- <enum name="TEXTURE_LOD_BIAS" count="1" value="0x8501">
- <size name="TexEnvfv"/>
- <size name="TexEnviv"/>
- <size name="TexParameterfv"/>
- <size name="TexParameteriv"/>
- <size name="GetTexEnvfv" mode="get"/>
- <size name="GetTexEnviv" mode="get"/>
- <size name="GetTexParameterfv" mode="get"/>
- <size name="GetTexParameteriv" mode="get"/>
- </enum>
- <enum name="INCR_WRAP" value="0x8507"/>
- <enum name="DECR_WRAP" value="0x8508"/>
- <enum name="TEXTURE_DEPTH_SIZE" count="1" value="0x884A">
- <size name="GetTexLevelParameterfv" mode="get"/>
- <size name="GetTexLevelParameteriv" mode="get"/>
- </enum>
- <enum name="DEPTH_TEXTURE_MODE" count="1" value="0x884B">
- <size name="TexParameterfv"/>
- <size name="TexParameteriv"/>
- <size name="GetTexParameterfv" mode="get"/>
- <size name="GetTexParameteriv" mode="get"/>
- </enum>
- <enum name="TEXTURE_COMPARE_MODE" count="1" value="0x884C">
- <size name="TexParameterfv"/>
- <size name="TexParameteriv"/>
- <size name="GetTexParameterfv" mode="get"/>
- <size name="GetTexParameteriv" mode="get"/>
- </enum>
- <enum name="TEXTURE_COMPARE_FUNC" count="1" value="0x884D">
- <size name="TexParameterfv"/>
- <size name="TexParameteriv"/>
- <size name="GetTexParameterfv" mode="get"/>
- <size name="GetTexParameteriv" mode="get"/>
- </enum>
- <enum name="COMPARE_R_TO_TEXTURE" value="0x884E"/>
-
- <function name="BlendFuncSeparate" alias="BlendFuncSeparateEXT">
- <param name="sfactorRGB" type="GLenum"/>
- <param name="dfactorRGB" type="GLenum"/>
- <param name="sfactorAlpha" type="GLenum"/>
- <param name="dfactorAlpha" type="GLenum"/>
- </function>
-
- <function name="FogCoordf" alias="FogCoordfEXT">
- <param name="coord" type="GLfloat"/>
- </function>
-
- <function name="FogCoordfv" alias="FogCoordfvEXT">
- <param name="coord" type="const GLfloat *"/>
- </function>
-
- <function name="FogCoordd" alias="FogCoorddEXT">
- <param name="coord" type="GLdouble"/>
- </function>
-
- <function name="FogCoorddv" alias="FogCoorddvEXT">
- <param name="coord" type="const GLdouble *"/>
- </function>
-
- <function name="FogCoordPointer" alias="FogCoordPointerEXT">
- <param name="type" type="GLenum"/>
- <param name="stride" type="GLsizei"/>
- <param name="pointer" type="const GLvoid *"/>
- </function>
-
- <function name="MultiDrawArrays" alias="MultiDrawArraysEXT">
- <param name="mode" type="GLenum"/>
- <param name="first" type="const GLint *"/>
- <param name="count" type="const GLsizei *"/>
- <param name="primcount" type="GLsizei"/>
- </function>
-
- <function name="MultiDrawElements" alias="MultiDrawElementsEXT">
- <param name="mode" type="GLenum"/>
- <param name="count" type="const GLsizei *"/>
- <param name="type" type="GLenum"/>
- <param name="indices" type="const GLvoid **"/>
- <param name="primcount" type="GLsizei"/>
- </function>
-
- <function name="PointParameterf" alias="PointParameterfEXT">
- <param name="pname" type="GLenum"/>
- <param name="param" type="GLfloat"/>
- </function>
-
- <function name="PointParameterfv" alias="PointParameterfvEXT">
- <param name="pname" type="GLenum"/>
- <param name="params" type="const GLfloat *"/>
- </function>
-
- <function name="PointParameteri" alias="PointParameteriNV">
- <param name="pname" type="GLenum"/>
- <param name="param" type="GLint"/>
- </function>
-
- <function name="PointParameteriv" alias="PointParameterivNV">
- <param name="pname" type="GLenum"/>
- <param name="params" type="const GLint *"/>
- </function>
-
- <function name="SecondaryColor3b" alias="SecondaryColor3bEXT">
- <param name="red" type="GLbyte"/>
- <param name="green" type="GLbyte"/>
- <param name="blue" type="GLbyte"/>
- </function>
-
- <function name="SecondaryColor3bv" alias="SecondaryColor3bvEXT">
- <param name="v" type="const GLbyte *"/>
- </function>
-
- <function name="SecondaryColor3d" alias="SecondaryColor3dEXT">
- <param name="red" type="GLdouble"/>
- <param name="green" type="GLdouble"/>
- <param name="blue" type="GLdouble"/>
- </function>
-
- <function name="SecondaryColor3dv" alias="SecondaryColor3dvEXT">
- <param name="v" type="const GLdouble *"/>
- </function>
-
- <function name="SecondaryColor3f" alias="SecondaryColor3fEXT">
- <param name="red" type="GLfloat"/>
- <param name="green" type="GLfloat"/>
- <param name="blue" type="GLfloat"/>
- </function>
-
- <function name="SecondaryColor3fv" alias="SecondaryColor3fvEXT">
- <param name="v" type="const GLfloat *"/>
- </function>
-
- <function name="SecondaryColor3i" alias="SecondaryColor3iEXT">
- <param name="red" type="GLint"/>
- <param name="green" type="GLint"/>
- <param name="blue" type="GLint"/>
- </function>
-
- <function name="SecondaryColor3iv" alias="SecondaryColor3ivEXT">
- <param name="v" type="const GLint *"/>
- </function>
-
- <function name="SecondaryColor3s" alias="SecondaryColor3sEXT">
- <param name="red" type="GLshort"/>
- <param name="green" type="GLshort"/>
- <param name="blue" type="GLshort"/>
- </function>
-
- <function name="SecondaryColor3sv" alias="SecondaryColor3svEXT">
- <param name="v" type="const GLshort *"/>
- </function>
-
- <function name="SecondaryColor3ub" alias="SecondaryColor3ubEXT">
- <param name="red" type="GLubyte"/>
- <param name="green" type="GLubyte"/>
- <param name="blue" type="GLubyte"/>
- </function>
-
- <function name="SecondaryColor3ubv" alias="SecondaryColor3ubvEXT">
- <param name="v" type="const GLubyte *"/>
- </function>
-
- <function name="SecondaryColor3ui" alias="SecondaryColor3uiEXT">
- <param name="red" type="GLuint"/>
- <param name="green" type="GLuint"/>
- <param name="blue" type="GLuint"/>
- </function>
-
- <function name="SecondaryColor3uiv" alias="SecondaryColor3uivEXT">
- <param name="v" type="const GLuint *"/>
- </function>
-
- <function name="SecondaryColor3us" alias="SecondaryColor3usEXT">
- <param name="red" type="GLushort"/>
- <param name="green" type="GLushort"/>
- <param name="blue" type="GLushort"/>
- </function>
-
- <function name="SecondaryColor3usv" alias="SecondaryColor3usvEXT">
- <param name="v" type="const GLushort *"/>
- </function>
-
- <function name="SecondaryColorPointer" alias="SecondaryColorPointerEXT">
- <param name="size" type="GLint"/>
- <param name="type" type="GLenum"/>
- <param name="stride" type="GLsizei"/>
- <param name="pointer" type="const GLvoid *"/>
- </function>
-
- <function name="WindowPos2d" alias="WindowPos2dMESA">
- <param name="x" type="GLdouble"/>
- <param name="y" type="GLdouble"/>
- </function>
-
- <function name="WindowPos2dv" alias="WindowPos2dvMESA">
- <param name="v" type="const GLdouble *"/>
- </function>
-
- <function name="WindowPos2f" alias="WindowPos2fMESA">
- <param name="x" type="GLfloat"/>
- <param name="y" type="GLfloat"/>
- </function>
-
- <function name="WindowPos2fv" alias="WindowPos2fvMESA">
- <param name="v" type="const GLfloat *"/>
- </function>
-
- <function name="WindowPos2i" alias="WindowPos2iMESA">
- <param name="x" type="GLint"/>
- <param name="y" type="GLint"/>
- </function>
-
- <function name="WindowPos2iv" alias="WindowPos2ivMESA">
- <param name="v" type="const GLint *"/>
- </function>
-
- <function name="WindowPos2s" alias="WindowPos2sMESA">
- <param name="x" type="GLshort"/>
- <param name="y" type="GLshort"/>
- </function>
-
- <function name="WindowPos2sv" alias="WindowPos2svMESA">
- <param name="v" type="const GLshort *"/>
- </function>
-
- <function name="WindowPos3d" alias="WindowPos3dMESA">
- <param name="x" type="GLdouble"/>
- <param name="y" type="GLdouble"/>
- <param name="z" type="GLdouble"/>
- </function>
-
- <function name="WindowPos3dv" alias="WindowPos3dvMESA">
- <param name="v" type="const GLdouble *"/>
- </function>
-
- <function name="WindowPos3f" alias="WindowPos3fMESA">
- <param name="x" type="GLfloat"/>
- <param name="y" type="GLfloat"/>
- <param name="z" type="GLfloat"/>
- </function>
-
- <function name="WindowPos3fv" alias="WindowPos3fvMESA">
- <param name="v" type="const GLfloat *"/>
- </function>
-
- <function name="WindowPos3i" alias="WindowPos3iMESA">
- <param name="x" type="GLint"/>
- <param name="y" type="GLint"/>
- <param name="z" type="GLint"/>
- </function>
-
- <function name="WindowPos3iv" alias="WindowPos3ivMESA">
- <param name="v" type="const GLint *"/>
- </function>
-
- <function name="WindowPos3s" alias="WindowPos3sMESA">
- <param name="x" type="GLshort"/>
- <param name="y" type="GLshort"/>
- <param name="z" type="GLshort"/>
- </function>
-
- <function name="WindowPos3sv" alias="WindowPos3svMESA">
- <param name="v" type="const GLshort *"/>
- </function>
-</category>
-
-<category name="1.5">
- <enum name="BUFFER_SIZE" value="0x8764"/>
- <enum name="BUFFER_USAGE" value="0x8765"/>
- <enum name="QUERY_COUNTER_BITS" value="0x8864"/>
- <enum name="CURRENT_QUERY" value="0x8865"/>
- <enum name="QUERY_RESULT" value="0x8866"/>
- <enum name="QUERY_RESULT_AVAILABLE" value="0x8867"/>
- <enum name="ARRAY_BUFFER" value="0x8892"/>
- <enum name="ELEMENT_ARRAY_BUFFER" value="0x8893"/>
- <enum name="ARRAY_BUFFER_BINDING" value="0x8894"/>
- <enum name="ELEMENT_ARRAY_BUFFER_BINDING" value="0x8895"/>
- <enum name="VERTEX_ARRAY_BUFFER_BINDING" value="0x8896"/>
- <enum name="NORMAL_ARRAY_BUFFER_BINDING" value="0x8897"/>
- <enum name="COLOR_ARRAY_BUFFER_BINDING" value="0x8898"/>
- <enum name="INDEX_ARRAY_BUFFER_BINDING" value="0x8899"/>
- <enum name="TEXTURE_COORD_ARRAY_BUFFER_BINDING" value="0x889A"/>
- <enum name="EDGE_FLAG_ARRAY_BUFFER_BINDING" value="0x889B"/>
- <enum name="SECONDARY_COLOR_ARRAY_BUFFER_BINDING" value="0x889C"/>
- <enum name="FOG_COORDINATE_ARRAY_BUFFER_BINDING" value="0x889D"/>
- <enum name="WEIGHT_ARRAY_BUFFER_BINDING" value="0x889E"/>
- <enum name="VERTEX_ATTRIB_ARRAY_BUFFER_BINDING" value="0x889F"/>
- <enum name="READ_ONLY" value="0x88B8"/>
- <enum name="WRITE_ONLY" value="0x88B9"/>
- <enum name="READ_WRITE" value="0x88BA"/>
- <enum name="BUFFER_ACCESS" value="0x88BB"/>
- <enum name="BUFFER_MAPPED" value="0x88BC"/>
- <enum name="BUFFER_MAP_POINTER" value="0x88BD"/>
- <enum name="STREAM_DRAW" value="0x88E0"/>
- <enum name="STREAM_READ" value="0x88E1"/>
- <enum name="STREAM_COPY" value="0x88E2"/>
- <enum name="STATIC_DRAW" value="0x88E4"/>
- <enum name="STATIC_READ" value="0x88E5"/>
- <enum name="STATIC_COPY" value="0x88E6"/>
- <enum name="DYNAMIC_DRAW" value="0x88E8"/>
- <enum name="DYNAMIC_READ" value="0x88E9"/>
- <enum name="DYNAMIC_COPY" value="0x88EA"/>
- <enum name="SAMPLES_PASSED" count="1" value="0x8914"/>
- <enum name="FOG_COORD_SRC" value="0x8450">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="FOG_COORD" value="0x8451"/>
- <enum name="CURRENT_FOG_COORD" count="1" value="0x8453">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="FOG_COORD_ARRAY_TYPE" count="1" value="0x8454">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="FOG_COORD_ARRAY_STRIDE" count="1" value="0x8455">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="FOG_COORD_ARRAY_POINTER" value="0x8456"/>
- <enum name="FOG_COORD_ARRAY" count="1" value="0x8457">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="FOG_COORD_ARRAY_BUFFER_BINDING" value="0x889D"/>
- <enum name="SRC0_RGB" value="0x8580"/>
- <enum name="SRC1_RGB" value="0x8581"/>
- <enum name="SRC2_RGB" value="0x8582"/>
- <enum name="SRC0_ALPHA" value="0x8588"/>
- <enum name="SRC1_ALPHA" value="0x8589"/>
- <enum name="SRC2_ALPHA" value="0x858A"/>
-
- <type name="intptr" size="4" glx_name="CARD32"/>
- <type name="sizeiptr" size="4" unsigned="true" glx_name="CARD32"/>
-
- <function name="BindBuffer" alias="BindBufferARB">
- <param name="target" type="GLenum"/>
- <param name="buffer" type="GLuint"/>
- </function>
-
- <function name="BufferData" alias="BufferDataARB">
- <param name="target" type="GLenum"/>
- <param name="size" type="GLsizeiptr"/>
- <param name="data" type="const GLvoid *"/>
- <param name="usage" type="GLenum"/>
- </function>
-
- <function name="BufferSubData" alias="BufferSubDataARB">
- <param name="target" type="GLenum"/>
- <param name="offset" type="GLintptr"/>
- <param name="size" type="GLsizeiptr"/>
- <param name="data" type="const GLvoid *"/>
- </function>
-
- <function name="DeleteBuffers" alias="DeleteBuffersARB">
- <param name="n" type="GLsizei"/>
- <param name="buffer" type="const GLuint *"/>
- </function>
-
- <function name="GenBuffers" alias="GenBuffersARB">
- <param name="n" type="GLsizei" counter="true"/>
- <param name="buffer" type="GLuint *" output="true" count="n"/>
- </function>
-
- <function name="GetBufferParameteriv" alias="GetBufferParameterivARB">
- <param name="target" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLint *" output="true" variable_param="pname"/>
- </function>
-
- <function name="GetBufferPointerv" alias="GetBufferPointervARB">
- <param name="target" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLvoid **" output="true"/>
- </function>
-
- <function name="GetBufferSubData" alias="GetBufferSubDataARB">
- <param name="target" type="GLenum"/>
- <param name="offset" type="GLintptr"/>
- <param name="size" type="GLsizeiptr"/>
- <param name="data" type="GLvoid *" output="true"/>
- </function>
-
- <function name="IsBuffer" alias="IsBufferARB">
- <param name="buffer" type="GLuint"/>
- <return type="GLboolean"/>
- </function>
-
- <function name="MapBuffer" alias="MapBufferARB">
- <param name="target" type="GLenum"/>
- <param name="access" type="GLenum"/>
- <return type="GLvoid *"/>
- </function>
-
- <function name="UnmapBuffer" alias="UnmapBufferARB">
- <param name="target" type="GLenum"/>
- <return type="GLboolean"/>
- </function>
-
- <function name="GenQueries" alias="GenQueriesARB">
- <param name="n" type="GLsizei" counter="true"/>
- <param name="ids" type="GLuint *" output="true" count="n"/>
- </function>
-
- <function name="DeleteQueries" alias="DeleteQueriesARB">
- <param name="n" type="GLsizei"/>
- <param name="ids" type="const GLuint *"/>
- </function>
-
- <function name="IsQuery" alias="IsQueryARB">
- <param name="id" type="GLuint"/>
- <return type="GLboolean"/>
- </function>
-
- <function name="BeginQuery" alias="BeginQueryARB">
- <param name="target" type="GLenum"/>
- <param name="id" type="GLuint"/>
- </function>
-
- <function name="EndQuery" alias="EndQueryARB">
- <param name="target" type="GLenum"/>
- </function>
-
- <function name="GetQueryiv" alias="GetQueryivARB">
- <param name="target" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLint *" output="true" variable_param="pname"/>
- </function>
-
- <function name="GetQueryObjectiv" alias="GetQueryObjectivARB">
- <param name="id" type="GLuint"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLint *" output="true" variable_param="pname"/>
- </function>
-
- <function name="GetQueryObjectuiv" alias="GetQueryObjectuivARB">
- <param name="id" type="GLuint"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLuint *" output="true" variable_param="pname"/>
- </function>
-</category>
-
-
-<category name="2.0">
- <!-- XXX some of the enums and functions probably need additional -->
- <!-- flags/attributes. -->
-
- <type name="char" size="1" glx_name="CARD8"/>
-
- <enum name="BLEND_EQUATION_RGB" value="0x8009"/>
- <enum name="VERTEX_ATTRIB_ARRAY_ENABLED" value="0x8622"/>
- <enum name="VERTEX_ATTRIB_ARRAY_SIZE" value="0x8623"/>
- <enum name="VERTEX_ATTRIB_ARRAY_STRIDE" value="0x8624"/>
- <enum name="VERTEX_ATTRIB_ARRAY_TYPE" value="0x8625"/>
- <enum name="CURRENT_VERTEX_ATTRIB" value="0x8626"/>
- <enum name="VERTEX_PROGRAM_POINT_SIZE" value="0x8642"/>
- <enum name="VERTEX_PROGRAM_TWO_SIDE" value="0x8643"/>
- <enum name="VERTEX_ATTRIB_ARRAY_POINTER" value="0x8645"/>
- <enum name="STENCIL_BACK_FUNC" value="0x8800"/>
- <enum name="STENCIL_BACK_FAIL" value="0x8801"/>
- <enum name="STENCIL_BACK_PASS_DEPTH_FAIL" value="0x8802"/>
- <enum name="STENCIL_BACK_PASS_DEPTH_PASS" value="0x8803"/>
- <enum name="MAX_DRAW_BUFFERS" value="0x8824"/>
- <enum name="DRAW_BUFFER0" value="0x8825"/>
- <enum name="DRAW_BUFFER1" value="0x8826"/>
- <enum name="DRAW_BUFFER2" value="0x8827"/>
- <enum name="DRAW_BUFFER3" value="0x8828"/>
- <enum name="DRAW_BUFFER4" value="0x8829"/>
- <enum name="DRAW_BUFFER5" value="0x882A"/>
- <enum name="DRAW_BUFFER6" value="0x882B"/>
- <enum name="DRAW_BUFFER7" value="0x882C"/>
- <enum name="DRAW_BUFFER8" value="0x882D"/>
- <enum name="DRAW_BUFFER9" value="0x882E"/>
- <enum name="DRAW_BUFFER10" value="0x882F"/>
- <enum name="DRAW_BUFFER11" value="0x8830"/>
- <enum name="DRAW_BUFFER12" value="0x8831"/>
- <enum name="DRAW_BUFFER13" value="0x8832"/>
- <enum name="DRAW_BUFFER14" value="0x8833"/>
- <enum name="DRAW_BUFFER15" value="0x8834"/>
- <enum name="BLEND_EQUATION_ALPHA" value="0x883D"/>
- <enum name="POINT_SPRITE" value="0x8861"/>
- <enum name="COORD_REPLACE" value="0x8862"/>
- <enum name="MAX_VERTEX_ATTRIBS" value="0x8869"/>
- <enum name="VERTEX_ATTRIB_ARRAY_NORMALIZED" value="0x886A"/>
- <enum name="MAX_TEXTURE_COORDS" value="0x8871"/>
- <enum name="MAX_TEXTURE_IMAGE_UNITS" value="0x8872"/>
- <enum name="FRAGMENT_SHADER" value="0x8B30"/>
- <enum name="VERTEX_SHADER" value="0x8B31"/>
- <enum name="MAX_FRAGMENT_UNIFORM_COMPONENTS" value="0x8B49"/>
- <enum name="MAX_VERTEX_UNIFORM_COMPONENTS" value="0x8B4A"/>
- <enum name="MAX_VARYING_FLOATS" value="0x8B4B"/>
- <enum name="MAX_VERTEX_TEXTURE_IMAGE_UNITS" value="0x8B4C"/>
- <enum name="MAX_COMBINED_TEXTURE_IMAGE_UNITS" value="0x8B4D"/>
- <enum name="SHADER_TYPE" value="0x8B4F"/>
- <enum name="FLOAT_VEC2" value="0x8B50"/>
- <enum name="FLOAT_VEC3" value="0x8B51"/>
- <enum name="FLOAT_VEC4" value="0x8B52"/>
- <enum name="INT_VEC2" value="0x8B53"/>
- <enum name="INT_VEC3" value="0x8B54"/>
- <enum name="INT_VEC4" value="0x8B55"/>
- <enum name="BOOL" value="0x8B56"/>
- <enum name="BOOL_VEC2" value="0x8B57"/>
- <enum name="BOOL_VEC3" value="0x8B58"/>
- <enum name="BOOL_VEC4" value="0x8B59"/>
- <enum name="FLOAT_MAT2" value="0x8B5A"/>
- <enum name="FLOAT_MAT3" value="0x8B5B"/>
- <enum name="FLOAT_MAT4" value="0x8B5C"/>
- <enum name="SAMPLER_1D" value="0x8B5D"/>
- <enum name="SAMPLER_2D" value="0x8B5E"/>
- <enum name="SAMPLER_3D" value="0x8B5F"/>
- <enum name="SAMPLER_CUBE" value="0x8B60"/>
- <enum name="SAMPLER_1D_SHADOW" value="0x8B61"/>
- <enum name="SAMPLER_2D_SHADOW" value="0x8B62"/>
- <enum name="DELETE_STATUS" value="0x8B80"/>
- <enum name="COMPILE_STATUS" value="0x8B81"/>
- <enum name="LINK_STATUS" value="0x8B82"/>
- <enum name="VALIDATE_STATUS" value="0x8B83"/>
- <enum name="INFO_LOG_LENGTH" value="0x8B84"/>
- <enum name="ATTACHED_SHADERS" value="0x8B85"/>
- <enum name="ACTIVE_UNIFORMS" value="0x8B86"/>
- <enum name="ACTIVE_UNIFORM_MAX_LENGTH" value="0x8B87"/>
- <enum name="SHADER_SOURCE_LENGTH" value="0x8B88"/>
- <enum name="ACTIVE_ATTRIBUTES" value="0x8B89"/>
- <enum name="ACTIVE_ATTRIBUTE_MAX_LENGTH" value="0x8B8A"/>
- <enum name="FRAGMENT_SHADER_DERIVATIVE_HINT" value="0x8B8B"/>
- <enum name="SHADING_LANGUAGE_VERSION" value="0x8B8C"/>
- <enum name="CURRENT_PROGRAM" value="0x8B8D"/>
- <enum name="POINT_SPRITE_COORD_ORIGIN" count="1" value="0x8CA0">
- <size name="PointParameterfvEXT"/>
- <size name="PointParameterivNV"/>
- </enum>
- <enum name="LOWER_LEFT" value="0x8CA1"/>
- <enum name="UPPER_LEFT" value="0x8CA2"/>
- <enum name="STENCIL_BACK_REF" value="0x8CA3"/>
- <enum name="STENCIL_BACK_VALUE_MASK" value="0x8CA4"/>
- <enum name="STENCIL_BACK_WRITEMASK" value="0x8CA5"/>
-
- <function name="BlendEquationSeparate" alias="BlendEquationSeparateEXT">
- <param name="modeRGB" type="GLenum"/>
- <param name="modeA" type="GLenum"/>
- </function>
-
- <function name="DrawBuffers" alias="DrawBuffersARB">
- <param name="n" type="GLsizei" counter="true"/>
- <param name="bufs" type="const GLenum *" count="n"/>
- </function>
-
- <function name="StencilFuncSeparate" offset="assign">
- <param name="face" type="GLenum"/>
- <param name="func" type="GLenum"/>
- <param name="ref" type="GLint"/>
- <param name="mask" type="GLuint"/>
- <glx ignore="true"/>
- </function>
-
- <function name="StencilOpSeparate" offset="assign">
- <param name="face" type="GLenum"/>
- <param name="sfail" type="GLenum"/>
- <param name="zfail" type="GLenum"/>
- <param name="zpass" type="GLenum"/>
- <glx ignore="true"/>
- </function>
-
- <function name="StencilMaskSeparate" offset="assign">
- <param name="face" type="GLenum"/>
- <param name="mask" type="GLuint"/>
- <glx ignore="true"/>
- </function>
-
- <function name="AttachShader" offset="assign">
- <param name="program" type="GLuint"/>
- <param name="shader" type="GLuint"/>
- <glx ignore="true"/>
- </function>
-
- <function name="BindAttribLocation" alias="BindAttribLocationARB">
- <param name="program" type="GLuint"/>
- <param name="index" type="GLuint"/>
- <param name="name" type="const GLchar *"/>
- <glx ignore="true"/>
- </function>
-
- <function name="CompileShader" alias="CompileShaderARB">
- <param name="shader" type="GLuint"/>
- <glx ignore="true"/>
- </function>
-
- <function name="CreateProgram" offset="assign">
- <return type="GLuint"/>
- <glx ignore="true"/>
- </function>
-
- <function name="CreateShader" offset="assign">
- <param name="type" type="GLenum"/>
- <return type="GLuint"/>
- <glx ignore="true"/>
- </function>
-
- <function name="DeleteProgram" offset="assign">
- <param name="program" type="GLuint"/>
- <glx ignore="true"/>
- </function>
-
- <function name="DeleteShader" offset="assign">
- <param name="program" type="GLuint"/>
- <glx ignore="true"/>
- </function>
-
- <function name="DetachShader" offset="assign">
- <param name="program" type="GLuint"/>
- <param name="shader" type="GLuint"/>
- <glx ignore="true"/>
- </function>
-
- <function name="DisableVertexAttribArray" alias="DisableVertexAttribArrayARB">
- <param name="index" type="GLuint"/>
- <glx ignore="true"/>
- </function>
-
- <function name="EnableVertexAttribArray" alias="EnableVertexAttribArrayARB">
- <param name="index" type="GLuint"/>
- <glx ignore="true"/>
- </function>
-
- <function name="GetActiveAttrib" alias="GetActiveAttribARB">
- <param name="program" type="GLuint"/>
- <param name="index" type="GLuint"/>
- <param name="bufSize" type="GLsizei "/>
- <param name="length" type="GLsizei *" output="true"/>
- <param name="size" type="GLint *" output="true"/>
- <param name="type" type="GLenum *" output="true"/>
- <param name="name" type="GLchar *" output="true"/>
- <glx ignore="true"/>
- </function>
-
- <function name="GetActiveUniform" alias="GetActiveUniformARB">
- <param name="program" type="GLuint"/>
- <param name="index" type="GLuint"/>
- <param name="bufSize" type="GLsizei"/>
- <param name="length" type="GLsizei *" output="true"/>
- <param name="size" type="GLint *" output="true"/>
- <param name="type" type="GLenum *" output="true"/>
- <param name="name" type="GLchar *" output="true"/>
- <glx ignore="true"/>
- </function>
-
- <function name="GetAttachedShaders" offset="assign">
- <param name="program" type="GLuint"/>
- <param name="maxCount" type="GLsizei"/>
- <param name="count" type="GLsizei *" output="true"/>
- <param name="obj" type="GLuint *" output="true"/>
- <glx ignore="true"/>
- </function>
-
- <function name="GetAttribLocation" alias="GetAttribLocationARB">
- <param name="program" type="GLuint"/>
- <param name="name" type="const GLchar *"/>
- <return type="GLint"/>
- <glx ignore="true"/>
- </function>
-
- <function name="GetProgramiv" offset="assign">
- <param name="program" type="GLuint"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLint *"/>
- <glx ignore="true"/>
- </function>
-
- <function name="GetProgramInfoLog" offset="assign">
- <param name="program" type="GLuint"/>
- <param name="bufSize" type="GLsizei"/>
- <param name="length" type="GLsizei *"/>
- <param name="infoLog" type="GLchar *"/>
- <glx ignore="true"/>
- </function>
-
- <function name="GetShaderiv" offset="assign">
- <param name="shader" type="GLuint"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLint *"/>
- <glx ignore="true"/>
- </function>
-
- <function name="GetShaderInfoLog" offset="assign">
- <param name="shader" type="GLuint"/>
- <param name="bufSize" type="GLsizei"/>
- <param name="length" type="GLsizei *"/>
- <param name="infoLog" type="GLchar *"/>
- <glx ignore="true"/>
- </function>
-
- <function name="GetShaderSource" alias="GetShaderSourceARB">
- <param name="shader" type="GLuint"/>
- <param name="bufSize" type="GLsizei"/>
- <param name="length" type="GLsizei *" output="true"/>
- <param name="source" type="GLchar *" output="true"/>
- <glx ignore="true"/>
- </function>
-
- <function name="GetUniformLocation" alias="GetUniformLocationARB">
- <param name="program" type="GLuint"/>
- <param name="name" type="const GLchar *"/>
- <return type="GLint"/>
- <glx ignore="true"/>
- </function>
-
- <function name="GetUniformfv" alias="GetUniformfvARB">
- <param name="program" type="GLuint"/>
- <param name="location" type="GLint"/>
- <param name="params" type="GLfloat *" output="true"/>
- <glx ignore="true"/>
- </function>
-
- <function name="GetUniformiv" alias="GetUniformivARB">
- <param name="program" type="GLuint"/>
- <param name="location" type="GLint"/>
- <param name="params" type="GLint *"/>
- <glx ignore="true"/>
- </function>
-
- <function name="GetVertexAttribdv" alias="GetVertexAttribdvARB">
- <param name="index" type="GLuint"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLdouble *" output="true" variable_param="pname"/>
- <glx ignore="true"/>
- </function>
-
- <function name="GetVertexAttribfv" alias="GetVertexAttribfvARB">
- <param name="index" type="GLuint"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLfloat *" output="true" variable_param="pname"/>
- <glx ignore="true"/>
- </function>
-
- <function name="GetVertexAttribiv" alias="GetVertexAttribivARB">
- <param name="index" type="GLuint"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLint *" output="true" variable_param="pname"/>
- <glx ignore="true"/>
- </function>
-
- <function name="GetVertexAttribPointerv" alias="GetVertexAttribPointervNV">
- <param name="index" type="GLuint"/>
- <param name="pname" type="GLenum"/>
- <param name="pointer" type="GLvoid **" output="true"/>
- <glx ignore="true"/>
- </function>
-
- <function name="IsProgram" offset="assign">
- <param name="program" type="GLuint"/>
- <return type="GLboolean"/>
- <glx ignore="true"/>
- </function>
-
- <function name="IsShader" offset="assign">
- <param name="shader" type="GLuint"/>
- <return type="GLboolean"/>
- <glx ignore="true"/>
- </function>
-
- <function name="LinkProgram" alias="LinkProgramARB">
- <param name="program" type="GLuint"/>
- <glx ignore="true"/>
- </function>
-
- <function name="ShaderSource" alias="ShaderSourceARB">
- <param name="shader" type="GLuint"/>
- <param name="count" type="GLsizei"/>
- <param name="string" type="const GLchar **"/>
- <param name="length" type="const GLint *"/>
- <glx ignore="true"/>
- </function>
-
- <function name="UseProgram" alias="UseProgramObjectARB">
- <param name="program" type="GLuint"/>
- <glx ignore="true"/>
- </function>
-
- <function name="Uniform1f" alias="Uniform1fARB">
- <param name="location" type="GLint"/>
- <param name="v0" type="GLfloat"/>
- <glx ignore="true"/>
- </function>
- <function name="Uniform2f" alias="Uniform2fARB">
- <param name="location" type="GLint"/>
- <param name="v0" type="GLfloat"/>
- <param name="v1" type="GLfloat"/>
- <glx ignore="true"/>
- </function>
- <function name="Uniform3f" alias="Uniform3fARB">
- <param name="location" type="GLint"/>
- <param name="v0" type="GLfloat"/>
- <param name="v1" type="GLfloat"/>
- <param name="v2" type="GLfloat"/>
- <glx ignore="true"/>
- </function>
- <function name="Uniform4f" alias="Uniform4fARB">
- <param name="location" type="GLint"/>
- <param name="v0" type="GLfloat"/>
- <param name="v1" type="GLfloat"/>
- <param name="v2" type="GLfloat"/>
- <param name="v3" type="GLfloat"/>
- <glx ignore="true"/>
- </function>
-
- <function name="Uniform1i" alias="Uniform1iARB">
- <param name="location" type="GLint"/>
- <param name="v0" type="GLint"/>
- <glx ignore="true"/>
- </function>
- <function name="Uniform2i" alias="Uniform2iARB">
- <param name="location" type="GLint"/>
- <param name="v0" type="GLint"/>
- <param name="v1" type="GLint"/>
- <glx ignore="true"/>
- </function>
- <function name="Uniform3i" alias="Uniform3iARB">
- <param name="location" type="GLint"/>
- <param name="v0" type="GLint"/>
- <param name="v1" type="GLint"/>
- <param name="v2" type="GLint"/>
- <glx ignore="true"/>
- </function>
- <function name="Uniform4i" alias="Uniform4iARB">
- <param name="location" type="GLint"/>
- <param name="v0" type="GLint"/>
- <param name="v1" type="GLint"/>
- <param name="v2" type="GLint"/>
- <param name="v3" type="GLint"/>
- <glx ignore="true"/>
- </function>
-
- <function name="Uniform1fv" alias="Uniform1fvARB">
- <param name="location" type="GLint"/>
- <param name="count" type="GLsizei"/>
- <param name="value" type="const GLfloat *"/>
- <glx ignore="true"/>
- </function>
- <function name="Uniform2fv" alias="Uniform2fvARB">
- <param name="location" type="GLint"/>
- <param name="count" type="GLsizei"/>
- <param name="value" type="const GLfloat *"/>
- <glx ignore="true"/>
- </function>
- <function name="Uniform3fv" alias="Uniform3fvARB">
- <param name="location" type="GLint"/>
- <param name="count" type="GLsizei"/>
- <param name="value" type="const GLfloat *"/>
- <glx ignore="true"/>
- </function>
- <function name="Uniform4fv" alias="Uniform4fvARB">
- <param name="location" type="GLint"/>
- <param name="count" type="GLsizei"/>
- <param name="value" type="const GLfloat *"/>
- <glx ignore="true"/>
- </function>
-
- <function name="Uniform1iv" alias="Uniform1ivARB">
- <param name="location" type="GLint"/>
- <param name="count" type="GLsizei"/>
- <param name="value" type="const GLint *"/>
- <glx ignore="true"/>
- </function>
- <function name="Uniform2iv" alias="Uniform2ivARB">
- <param name="location" type="GLint"/>
- <param name="count" type="GLsizei"/>
- <param name="value" type="const GLint *"/>
- <glx ignore="true"/>
- </function>
- <function name="Uniform3iv" alias="Uniform3ivARB">
- <param name="location" type="GLint"/>
- <param name="count" type="GLsizei"/>
- <param name="value" type="const GLint *"/>
- <glx ignore="true"/>
- </function>
- <function name="Uniform4iv" alias="Uniform4ivARB">
- <param name="location" type="GLint"/>
- <param name="count" type="GLsizei"/>
- <param name="value" type="const GLint *"/>
- <glx ignore="true"/>
- </function>
-
- <function name="UniformMatrix2fv" alias="UniformMatrix2fvARB">
- <param name="location" type="GLint"/>
- <param name="count" type="GLsizei"/>
- <param name="transpose" type="GLboolean"/>
- <param name="value" type="const GLfloat *"/>
- <glx ignore="true"/>
- </function>
- <function name="UniformMatrix3fv" alias="UniformMatrix3fvARB">
- <param name="location" type="GLint"/>
- <param name="count" type="GLsizei"/>
- <param name="transpose" type="GLboolean"/>
- <param name="value" type="const GLfloat *"/>
- <glx ignore="true"/>
- </function>
- <function name="UniformMatrix4fv" alias="UniformMatrix4fvARB">
- <param name="location" type="GLint"/>
- <param name="count" type="GLsizei"/>
- <param name="transpose" type="GLboolean"/>
- <param name="value" type="const GLfloat *"/>
- <glx ignore="true"/>
- </function>
-
- <function name="ValidateProgram" alias="ValidateProgramARB">
- <param name="program" type="GLuint"/>
- <glx ignore="true"/>
- </function>
-
- <function name="VertexAttrib1d" alias="VertexAttrib1dARB">
- <param name="index" type="GLuint"/>
- <param name="x" type="GLdouble"/>
- </function>
- <function name="VertexAttrib1dv" alias="VertexAttrib1dvARB">
- <param name="index" type="GLuint"/>
- <param name="v" type="const GLdouble *"/>
- </function>
- <function name="VertexAttrib1f" alias="VertexAttrib1fARB">
- <param name="index" type="GLuint"/>
- <param name="x" type="GLfloat"/>
- </function>
- <function name="VertexAttrib1fv" alias="VertexAttrib1fvARB">
- <param name="index" type="GLuint"/>
- <param name="v" type="const GLfloat *"/>
- </function>
- <function name="VertexAttrib1s" alias="VertexAttrib1sARB">
- <param name="index" type="GLuint"/>
- <param name="x" type="GLshort"/>
- </function>
- <function name="VertexAttrib1sv" alias="VertexAttrib1svARB">
- <param name="index" type="GLuint"/>
- <param name="v" type="const GLshort *"/>
- </function>
-
- <function name="VertexAttrib2d" alias="VertexAttrib2dARB">
- <param name="index" type="GLuint"/>
- <param name="x" type="GLdouble"/>
- <param name="y" type="GLdouble"/>
- </function>
- <function name="VertexAttrib2dv" alias="VertexAttrib2dvARB">
- <param name="index" type="GLuint"/>
- <param name="v" type="const GLdouble *"/>
- </function>
- <function name="VertexAttrib2f" alias="VertexAttrib2fARB">
- <param name="index" type="GLuint"/>
- <param name="x" type="GLfloat"/>
- <param name="y" type="GLfloat"/>
- </function>
- <function name="VertexAttrib2fv" alias="VertexAttrib2fvARB">
- <param name="index" type="GLuint"/>
- <param name="v" type="const GLfloat *"/>
- </function>
- <function name="VertexAttrib2s" alias="VertexAttrib2sARB">
- <param name="index" type="GLuint"/>
- <param name="x" type="GLshort"/>
- <param name="y" type="GLshort"/>
- </function>
- <function name="VertexAttrib2sv" alias="VertexAttrib2svARB">
- <param name="index" type="GLuint"/>
- <param name="v" type="const GLshort *"/>
- </function>
-
- <function name="VertexAttrib3d" alias="VertexAttrib3dARB">
- <param name="index" type="GLuint"/>
- <param name="x" type="GLdouble"/>
- <param name="y" type="GLdouble"/>
- <param name="z" type="GLdouble"/>
- </function>
- <function name="VertexAttrib3dv" alias="VertexAttrib3dvARB">
- <param name="index" type="GLuint"/>
- <param name="v" type="const GLdouble *"/>
- </function>
- <function name="VertexAttrib3f" alias="VertexAttrib3fARB">
- <param name="index" type="GLuint"/>
- <param name="x" type="GLfloat"/>
- <param name="y" type="GLfloat"/>
- <param name="z" type="GLfloat"/>
- </function>
- <function name="VertexAttrib3fv" alias="VertexAttrib3fvARB">
- <param name="index" type="GLuint"/>
- <param name="v" type="const GLfloat *"/>
- </function>
- <function name="VertexAttrib3s" alias="VertexAttrib3sARB">
- <param name="index" type="GLuint"/>
- <param name="x" type="GLshort"/>
- <param name="y" type="GLshort"/>
- <param name="z" type="GLshort"/>
- </function>
- <function name="VertexAttrib3sv" alias="VertexAttrib3svARB">
- <param name="index" type="GLuint"/>
- <param name="v" type="const GLshort *"/>
- </function>
-
- <function name="VertexAttrib4Nbv" alias="VertexAttrib4NbvARB">
- <param name="index" type="GLuint"/>
- <param name="v" type="const GLbyte *"/>
- </function>
- <function name="VertexAttrib4Niv" alias="VertexAttrib4NivARB">
- <param name="index" type="GLuint"/>
- <param name="v" type="const GLint *"/>
- </function>
- <function name="VertexAttrib4Nsv" alias="VertexAttrib4NsvARB">
- <param name="index" type="GLuint"/>
- <param name="v" type="const GLshort *"/>
- </function>
- <function name="VertexAttrib4Nub" alias="VertexAttrib4NubARB">
- <param name="index" type="GLuint"/>
- <param name="x" type="GLubyte"/>
- <param name="y" type="GLubyte"/>
- <param name="z" type="GLubyte"/>
- <param name="w" type="GLubyte"/>
- </function>
- <function name="VertexAttrib4Nubv" alias="VertexAttrib4NubvARB">
- <param name="index" type="GLuint"/>
- <param name="v" type="const GLubyte *"/>
- </function>
- <function name="VertexAttrib4Nuiv" alias="VertexAttrib4NuivARB">
- <param name="index" type="GLuint"/>
- <param name="v" type="const GLuint *"/>
- </function>
- <function name="VertexAttrib4Nusv" alias="VertexAttrib4NusvARB">
- <param name="index" type="GLuint"/>
- <param name="v" type="const GLushort *"/>
- </function>
- <function name="VertexAttrib4bv" alias="VertexAttrib4bvARB">
- <param name="index" type="GLuint"/>
- <param name="v" type="const GLbyte *" count="4"/>
- </function>
- <function name="VertexAttrib4d" alias="VertexAttrib4dARB">
- <param name="index" type="GLuint"/>
- <param name="x" type="GLdouble"/>
- <param name="y" type="GLdouble"/>
- <param name="z" type="GLdouble"/>
- <param name="w" type="GLdouble"/>
- </function>
- <function name="VertexAttrib4dv" alias="VertexAttrib4dvARB">
- <param name="index" type="GLuint"/>
- <param name="v" type="const GLdouble *"/>
- </function>
- <function name="VertexAttrib4f" alias="VertexAttrib4fARB">
- <param name="index" type="GLuint"/>
- <param name="x" type="GLfloat"/>
- <param name="y" type="GLfloat"/>
- <param name="z" type="GLfloat"/>
- <param name="w" type="GLfloat"/>
- </function>
- <function name="VertexAttrib4fv" alias="VertexAttrib4fvARB">
- <param name="index" type="GLuint"/>
- <param name="v" type="const GLfloat *"/>
- </function>
- <function name="VertexAttrib4iv" alias="VertexAttrib4ivARB">
- <param name="index" type="GLuint"/>
- <param name="v" type="const GLint *" count="4"/>
- </function>
- <function name="VertexAttrib4s" alias="VertexAttrib4sARB">
- <param name="index" type="GLuint"/>
- <param name="x" type="GLshort"/>
- <param name="y" type="GLshort"/>
- <param name="z" type="GLshort"/>
- <param name="w" type="GLshort"/>
- </function>
- <function name="VertexAttrib4sv" alias="VertexAttrib4svARB">
- <param name="index" type="GLuint"/>
- <param name="v" type="const GLshort *"/>
- </function>
- <function name="VertexAttrib4ubv" alias="VertexAttrib4ubvARB">
- <param name="index" type="GLuint"/>
- <param name="v" type="const GLubyte *" count="4"/>
- </function>
- <function name="VertexAttrib4uiv" alias="VertexAttrib4uivARB">
- <param name="index" type="GLuint"/>
- <param name="v" type="const GLuint *" count="4"/>
- </function>
- <function name="VertexAttrib4usv" alias="VertexAttrib4usvARB">
- <param name="index" type="GLuint"/>
- <param name="v" type="const GLushort *" count="4"/>
- </function>
-
- <function name="VertexAttribPointer" alias="VertexAttribPointerARB">
- <param name="index" type="GLuint"/>
- <param name="size" type="GLint"/>
- <param name="type" type="GLenum"/>
- <param name="normalized" type="GLboolean"/>
- <param name="stride" type="GLsizei"/>
- <param name="pointer" type="const GLvoid *"/>
- </function>
-
-</category>
-
-
-<category name="2.1">
- <!-- XXX some of the enums and functions probably need additional -->
- <!-- flags/attributes. -->
-
- <enum name="CURRENT_RASTER_SECONDARY_COLOR" value="0x845F"/>
- <enum name="PIXEL_PACK_BUFFER" value="0x88EB"/>
- <enum name="PIXEL_UNPACK_BUFFER" value="0x88EC"/>
- <enum name="PIXEL_PACK_BUFFER_BINDING" value="0x88ED"/>
- <enum name="PIXEL_UNPACK_BUFFER_BINDING" value="0x88EF"/>
- <enum name="FLOAT_MAT2x3" value="0x8B65"/>
- <enum name="FLOAT_MAT2x4" value="0x8B66"/>
- <enum name="FLOAT_MAT3x2" value="0x8B67"/>
- <enum name="FLOAT_MAT3x4" value="0x8B68"/>
- <enum name="FLOAT_MAT4x2" value="0x8B69"/>
- <enum name="FLOAT_MAT4x3" value="0x8B6A"/>
- <enum name="SRGB" value="0x8C40"/>
- <enum name="SRGB8" value="0x8C41"/>
- <enum name="SRGB_ALPHA" value="0x8C42"/>
- <enum name="SRGB8_ALPHA8" value="0x8C43"/>
- <enum name="SLUMINANCE_ALPHA" value="0x8C44"/>
- <enum name="SLUMINANCE8_ALPHA8" value="0x8C45"/>
- <enum name="SLUMINANCE" value="0x8C46"/>
- <enum name="SLUMINANCE8" value="0x8C47"/>
- <enum name="COMPRESSED_SRGB" value="0x8C48"/>
- <enum name="COMPRESSED_SRGB_ALPHA" value="0x8C49"/>
- <enum name="COMPRESSED_SLUMINANCE" value="0x8C4A"/>
- <enum name="COMPRESSED_SLUMINANCE_ALPHA" value="0x8C4B"/>
-
- <function name="UniformMatrix2x3fv" offset="assign">
- <param name="location" type="GLint"/>
- <param name="count" type="GLsizei"/>
- <param name="transpose" type="GLboolean"/>
- <param name="value" type="const GLfloat *"/>
- <glx ignore="true"/>
- </function>
- <function name="UniformMatrix3x2fv" offset="assign">
- <param name="location" type="GLint"/>
- <param name="count" type="GLsizei"/>
- <param name="transpose" type="GLboolean"/>
- <param name="value" type="const GLfloat *"/>
- <glx ignore="true"/>
- </function>
- <function name="UniformMatrix2x4fv" offset="assign">
- <param name="location" type="GLint"/>
- <param name="count" type="GLsizei"/>
- <param name="transpose" type="GLboolean"/>
- <param name="value" type="const GLfloat *"/>
- <glx ignore="true"/>
- </function>
- <function name="UniformMatrix4x2fv" offset="assign">
- <param name="location" type="GLint"/>
- <param name="count" type="GLsizei"/>
- <param name="transpose" type="GLboolean"/>
- <param name="value" type="const GLfloat *"/>
- <glx ignore="true"/>
- </function>
- <function name="UniformMatrix3x4fv" offset="assign">
- <param name="location" type="GLint"/>
- <param name="count" type="GLsizei"/>
- <param name="transpose" type="GLboolean"/>
- <param name="value" type="const GLfloat *"/>
- <glx ignore="true"/>
- </function>
- <function name="UniformMatrix4x3fv" offset="assign">
- <param name="location" type="GLint"/>
- <param name="count" type="GLsizei"/>
- <param name="transpose" type="GLboolean"/>
- <param name="value" type="const GLfloat *"/>
- <glx ignore="true"/>
- </function>
-
-</category>
-
-
-<!-- ARB extensions sorted by extension number. -->
-
-<category name="GL_ARB_multitexture" number="1">
- <enum name="TEXTURE0_ARB" value="0x84C0"/>
- <enum name="TEXTURE1_ARB" value="0x84C1"/>
- <enum name="TEXTURE2_ARB" value="0x84C2"/>
- <enum name="TEXTURE3_ARB" value="0x84C3"/>
- <enum name="TEXTURE4_ARB" value="0x84C4"/>
- <enum name="TEXTURE5_ARB" value="0x84C5"/>
- <enum name="TEXTURE6_ARB" value="0x84C6"/>
- <enum name="TEXTURE7_ARB" value="0x84C7"/>
- <enum name="TEXTURE8_ARB" value="0x84C8"/>
- <enum name="TEXTURE9_ARB" value="0x84C9"/>
- <enum name="TEXTURE10_ARB" value="0x84CA"/>
- <enum name="TEXTURE11_ARB" value="0x84CB"/>
- <enum name="TEXTURE12_ARB" value="0x84CC"/>
- <enum name="TEXTURE13_ARB" value="0x84CD"/>
- <enum name="TEXTURE14_ARB" value="0x84CE"/>
- <enum name="TEXTURE15_ARB" value="0x84CF"/>
- <enum name="TEXTURE16_ARB" value="0x84D0"/>
- <enum name="TEXTURE17_ARB" value="0x84D1"/>
- <enum name="TEXTURE18_ARB" value="0x84D2"/>
- <enum name="TEXTURE19_ARB" value="0x84D3"/>
- <enum name="TEXTURE20_ARB" value="0x84D4"/>
- <enum name="TEXTURE21_ARB" value="0x84D5"/>
- <enum name="TEXTURE22_ARB" value="0x84D6"/>
- <enum name="TEXTURE23_ARB" value="0x84D7"/>
- <enum name="TEXTURE24_ARB" value="0x84D8"/>
- <enum name="TEXTURE25_ARB" value="0x84D9"/>
- <enum name="TEXTURE26_ARB" value="0x84DA"/>
- <enum name="TEXTURE27_ARB" value="0x84DB"/>
- <enum name="TEXTURE28_ARB" value="0x84DC"/>
- <enum name="TEXTURE29_ARB" value="0x84DD"/>
- <enum name="TEXTURE30_ARB" value="0x84DE"/>
- <enum name="TEXTURE31_ARB" value="0x84DF"/>
- <enum name="ACTIVE_TEXTURE_ARB" count="1" value="0x84E0">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="CLIENT_ACTIVE_TEXTURE_ARB" count="1" value="0x84E1">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="MAX_TEXTURE_UNITS_ARB" count="1" value="0x84E2">
- <size name="Get" mode="get"/>
- </enum>
-
- <function name="ActiveTextureARB" offset="374">
- <param name="texture" type="GLenum"/>
- <glx rop="197"/>
- </function>
-
- <function name="ClientActiveTextureARB" offset="375">
- <param name="texture" type="GLenum"/>
- <glx handcode="true"/>
- </function>
-
- <function name="MultiTexCoord1dARB" offset="376" vectorequiv="MultiTexCoord1dvARB">
- <param name="target" type="GLenum"/>
- <param name="s" type="GLdouble"/>
- </function>
-
- <function name="MultiTexCoord1dvARB" offset="377">
- <param name="target" type="GLenum"/>
- <param name="v" type="const GLdouble *" count="1"/>
- <glx rop="198"/>
- </function>
-
- <function name="MultiTexCoord1fARB" offset="378" vectorequiv="MultiTexCoord1fvARB">
- <param name="target" type="GLenum"/>
- <param name="s" type="GLfloat"/>
- </function>
-
- <function name="MultiTexCoord1fvARB" offset="379">
- <param name="target" type="GLenum"/>
- <param name="v" type="const GLfloat *" count="1"/>
- <glx rop="199"/>
- </function>
-
- <function name="MultiTexCoord1iARB" offset="380" vectorequiv="MultiTexCoord1ivARB">
- <param name="target" type="GLenum"/>
- <param name="s" type="GLint"/>
- </function>
-
- <function name="MultiTexCoord1ivARB" offset="381">
- <param name="target" type="GLenum"/>
- <param name="v" type="const GLint *" count="1"/>
- <glx rop="200"/>
- </function>
-
- <function name="MultiTexCoord1sARB" offset="382" vectorequiv="MultiTexCoord1svARB">
- <param name="target" type="GLenum"/>
- <param name="s" type="GLshort"/>
- </function>
-
- <function name="MultiTexCoord1svARB" offset="383">
- <param name="target" type="GLenum"/>
- <param name="v" type="const GLshort *" count="1"/>
- <glx rop="201"/>
- </function>
-
- <function name="MultiTexCoord2dARB" offset="384" vectorequiv="MultiTexCoord2dvARB">
- <param name="target" type="GLenum"/>
- <param name="s" type="GLdouble"/>
- <param name="t" type="GLdouble"/>
- </function>
-
- <function name="MultiTexCoord2dvARB" offset="385">
- <param name="target" type="GLenum"/>
- <param name="v" type="const GLdouble *" count="2"/>
- <glx rop="202"/>
- </function>
-
- <function name="MultiTexCoord2fARB" offset="386" vectorequiv="MultiTexCoord2fvARB">
- <param name="target" type="GLenum"/>
- <param name="s" type="GLfloat"/>
- <param name="t" type="GLfloat"/>
- </function>
-
- <function name="MultiTexCoord2fvARB" offset="387">
- <param name="target" type="GLenum"/>
- <param name="v" type="const GLfloat *" count="2"/>
- <glx rop="203"/>
- </function>
-
- <function name="MultiTexCoord2iARB" offset="388" vectorequiv="MultiTexCoord2ivARB">
- <param name="target" type="GLenum"/>
- <param name="s" type="GLint"/>
- <param name="t" type="GLint"/>
- </function>
-
- <function name="MultiTexCoord2ivARB" offset="389">
- <param name="target" type="GLenum"/>
- <param name="v" type="const GLint *" count="2"/>
- <glx rop="204"/>
- </function>
-
- <function name="MultiTexCoord2sARB" offset="390" vectorequiv="MultiTexCoord2svARB">
- <param name="target" type="GLenum"/>
- <param name="s" type="GLshort"/>
- <param name="t" type="GLshort"/>
- </function>
-
- <function name="MultiTexCoord2svARB" offset="391">
- <param name="target" type="GLenum"/>
- <param name="v" type="const GLshort *" count="2"/>
- <glx rop="205"/>
- </function>
-
- <function name="MultiTexCoord3dARB" offset="392" vectorequiv="MultiTexCoord3dvARB">
- <param name="target" type="GLenum"/>
- <param name="s" type="GLdouble"/>
- <param name="t" type="GLdouble"/>
- <param name="r" type="GLdouble"/>
- </function>
-
- <function name="MultiTexCoord3dvARB" offset="393">
- <param name="target" type="GLenum"/>
- <param name="v" type="const GLdouble *" count="3"/>
- <glx rop="206"/>
- </function>
-
- <function name="MultiTexCoord3fARB" offset="394" vectorequiv="MultiTexCoord3fvARB">
- <param name="target" type="GLenum"/>
- <param name="s" type="GLfloat"/>
- <param name="t" type="GLfloat"/>
- <param name="r" type="GLfloat"/>
- </function>
-
- <function name="MultiTexCoord3fvARB" offset="395">
- <param name="target" type="GLenum"/>
- <param name="v" type="const GLfloat *" count="3"/>
- <glx rop="207"/>
- </function>
-
- <function name="MultiTexCoord3iARB" offset="396" vectorequiv="MultiTexCoord3ivARB">
- <param name="target" type="GLenum"/>
- <param name="s" type="GLint"/>
- <param name="t" type="GLint"/>
- <param name="r" type="GLint"/>
- </function>
-
- <function name="MultiTexCoord3ivARB" offset="397">
- <param name="target" type="GLenum"/>
- <param name="v" type="const GLint *" count="3"/>
- <glx rop="208"/>
- </function>
-
- <function name="MultiTexCoord3sARB" offset="398" vectorequiv="MultiTexCoord3svARB">
- <param name="target" type="GLenum"/>
- <param name="s" type="GLshort"/>
- <param name="t" type="GLshort"/>
- <param name="r" type="GLshort"/>
- </function>
-
- <function name="MultiTexCoord3svARB" offset="399">
- <param name="target" type="GLenum"/>
- <param name="v" type="const GLshort *" count="3"/>
- <glx rop="209"/>
- </function>
-
- <function name="MultiTexCoord4dARB" offset="400" vectorequiv="MultiTexCoord4dvARB">
- <param name="target" type="GLenum"/>
- <param name="s" type="GLdouble"/>
- <param name="t" type="GLdouble"/>
- <param name="r" type="GLdouble"/>
- <param name="q" type="GLdouble"/>
- </function>
-
- <function name="MultiTexCoord4dvARB" offset="401">
- <param name="target" type="GLenum"/>
- <param name="v" type="const GLdouble *" count="4"/>
- <glx rop="210"/>
- </function>
-
- <function name="MultiTexCoord4fARB" offset="402" vectorequiv="MultiTexCoord4fvARB">
- <param name="target" type="GLenum"/>
- <param name="s" type="GLfloat"/>
- <param name="t" type="GLfloat"/>
- <param name="r" type="GLfloat"/>
- <param name="q" type="GLfloat"/>
- </function>
-
- <function name="MultiTexCoord4fvARB" offset="403">
- <param name="target" type="GLenum"/>
- <param name="v" type="const GLfloat *" count="4"/>
- <glx rop="211"/>
- </function>
-
- <function name="MultiTexCoord4iARB" offset="404" vectorequiv="MultiTexCoord4ivARB">
- <param name="target" type="GLenum"/>
- <param name="s" type="GLint"/>
- <param name="t" type="GLint"/>
- <param name="r" type="GLint"/>
- <param name="q" type="GLint"/>
- </function>
-
- <function name="MultiTexCoord4ivARB" offset="405">
- <param name="target" type="GLenum"/>
- <param name="v" type="const GLint *" count="4"/>
- <glx rop="212"/>
- </function>
-
- <function name="MultiTexCoord4sARB" offset="406" vectorequiv="MultiTexCoord4svARB">
- <param name="target" type="GLenum"/>
- <param name="s" type="GLshort"/>
- <param name="t" type="GLshort"/>
- <param name="r" type="GLshort"/>
- <param name="q" type="GLshort"/>
- </function>
-
- <function name="MultiTexCoord4svARB" offset="407">
- <param name="target" type="GLenum"/>
- <param name="v" type="const GLshort *" count="4"/>
- <glx rop="213"/>
- </function>
-</category>
-
-<!-- ARB extension number 2 is a GLX extension. -->
-
-<category name="GL_ARB_transpose_matrix" number="3">
- <enum name="TRANSPOSE_MODELVIEW_MATRIX_ARB" value="0x84E3"/>
- <enum name="TRANSPOSE_PROJECTION_MATRIX_ARB" value="0x84E4"/>
- <enum name="TRANSPOSE_TEXTURE_MATRIX_ARB" value="0x84E5"/>
- <enum name="TRANSPOSE_COLOR_MATRIX_ARB" value="0x84E6"/>
-
- <function name="LoadTransposeMatrixfARB" offset="assign">
- <param name="m" type="const GLfloat *"/>
- <glx handcode="true"/>
- </function>
-
- <function name="LoadTransposeMatrixdARB" offset="assign">
- <param name="m" type="const GLdouble *"/>
- <glx handcode="true"/>
- </function>
-
- <function name="MultTransposeMatrixfARB" offset="assign">
- <param name="m" type="const GLfloat *"/>
- <glx handcode="true"/>
- </function>
-
- <function name="MultTransposeMatrixdARB" offset="assign">
- <param name="m" type="const GLdouble *"/>
- <glx handcode="true"/>
- </function>
-</category>
-
-<!-- ARB extension number 4 is a WGL extension. -->
-
-<category name="GL_ARB_multisample" number="5">
- <enum name="MULTISAMPLE_ARB" count="1" value="0x809D">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="SAMPLE_ALPHA_TO_COVERAGE_ARB" count="1" value="0x809E">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="SAMPLE_ALPHA_TO_ONE_ARB" count="1" value="0x809F">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="SAMPLE_COVERAGE_ARB" count="1" value="0x80A0">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="SAMPLE_BUFFERS_ARB" count="1" value="0x80A8">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="SAMPLES_ARB" count="1" value="0x80A9">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="SAMPLE_COVERAGE_VALUE_ARB" count="1" value="0x80AA">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="SAMPLE_COVERAGE_INVERT_ARB" count="1" value="0x80AB">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="MULTISAMPLE_BIT_ARB" value="0x20000000"/>
-
- <function name="SampleCoverageARB" offset="assign">
- <param name="value" type="GLclampf"/>
- <param name="invert" type="GLboolean"/>
- <glx rop="229"/>
- </function>
-</category>
-
-<category name="GL_ARB_texture_env_add" number="6">
- <!-- No new functions, types, enums. -->
-</category>
-
-<category name="GL_ARB_texture_cube_map" number="7">
- <enum name="NORMAL_MAP_ARB" value="0x8511"/>
- <enum name="REFLECTION_MAP_ARB" value="0x8512"/>
- <enum name="TEXTURE_CUBE_MAP_ARB" count="1" value="0x8513">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="TEXTURE_BINDING_CUBE_MAP_ARB" count="1" value="0x8514">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="TEXTURE_CUBE_MAP_POSITIVE_X_ARB" value="0x8515"/>
- <enum name="TEXTURE_CUBE_MAP_NEGATIVE_X_ARB" value="0x8516"/>
- <enum name="TEXTURE_CUBE_MAP_POSITIVE_Y_ARB" value="0x8517"/>
- <enum name="TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB" value="0x8518"/>
- <enum name="TEXTURE_CUBE_MAP_POSITIVE_Z_ARB" value="0x8519"/>
- <enum name="TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB" value="0x851A"/>
- <enum name="PROXY_TEXTURE_CUBE_MAP_ARB" value="0x851B"/>
- <enum name="MAX_CUBE_MAP_TEXTURE_SIZE_ARB" count="1" value="0x851C">
- <size name="Get" mode="get"/>
- </enum>
-</category>
-
-<!-- ARB extension number 8 is a WGL extension. -->
-<!-- ARB extension number 9 is a WGL extension. -->
-<!-- ARB extension number 10 is a WGL extension. -->
-<!-- ARB extension number 11 is a WGL extension. -->
-
-<category name="GL_ARB_texture_compression" number="12">
- <enum name="COMPRESSED_ALPHA_ARB" value="0x84E9"/>
- <enum name="COMPRESSED_LUMINANCE_ARB" value="0x84EA"/>
- <enum name="COMPRESSED_LUMINANCE_ALPHA_ARB" value="0x84EB"/>
- <enum name="COMPRESSED_INTENSITY_ARB" value="0x84EC"/>
- <enum name="COMPRESSED_RGB_ARB" value="0x84ED"/>
- <enum name="COMPRESSED_RGBA_ARB" value="0x84EE"/>
- <enum name="TEXTURE_COMPRESSION_HINT_ARB" count="1" value="0x84EF">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="TEXTURE_COMPRESSED_IMAGE_SIZE_ARB" count="1" value="0x86A0">
- <size name="GetTexLevelParameterfv" mode="get"/>
- <size name="GetTexLevelParameteriv" mode="get"/>
- </enum>
- <enum name="TEXTURE_COMPRESSED_ARB" count="1" value="0x86A1">
- <size name="GetTexLevelParameterfv" mode="get"/>
- <size name="GetTexLevelParameteriv" mode="get"/>
- </enum>
- <enum name="NUM_COMPRESSED_TEXTURE_FORMATS_ARB" count="1" value="0x86A2">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="TEXTURE_COMPRESSED_FORMATS_ARB" value="0x86A3"/>
-
- <function name="CompressedTexImage3DARB" offset="assign">
- <param name="target" type="GLenum"/>
- <param name="level" type="GLint"/>
- <param name="internalformat" type="GLenum"/>
- <param name="width" type="GLsizei"/>
- <param name="height" type="GLsizei"/>
- <param name="depth" type="GLsizei"/>
- <param name="border" type="GLint"/>
- <param name="imageSize" type="GLsizei" counter="true"/>
- <param name="data" type="const GLvoid *" count="imageSize"/>
- <glx rop="216" handcode="client"/>
- </function>
-
- <function name="CompressedTexImage2DARB" offset="assign">
- <param name="target" type="GLenum"/>
- <param name="level" type="GLint"/>
- <param name="internalformat" type="GLenum"/>
- <param name="width" type="GLsizei"/>
- <param name="height" type="GLsizei"/>
- <param name="border" type="GLint"/>
- <param name="imageSize" type="GLsizei" counter="true"/>
- <param name="data" type="const GLvoid *" count="imageSize"/>
- <glx rop="215" handcode="client"/>
- </function>
-
- <function name="CompressedTexImage1DARB" offset="assign">
- <param name="target" type="GLenum"/>
- <param name="level" type="GLint"/>
- <param name="internalformat" type="GLenum"/>
- <param name="width" type="GLsizei"/>
- <param name="border" type="GLint"/>
- <param name="imageSize" type="GLsizei" counter="true"/>
- <param name="data" type="const GLvoid *" count="imageSize"/>
- <glx rop="214" handcode="client"/>
- </function>
-
- <function name="CompressedTexSubImage3DARB" offset="assign">
- <param name="target" type="GLenum"/>
- <param name="level" type="GLint"/>
- <param name="xoffset" type="GLint"/>
- <param name="yoffset" type="GLint"/>
- <param name="zoffset" type="GLint"/>
- <param name="width" type="GLsizei"/>
- <param name="height" type="GLsizei"/>
- <param name="depth" type="GLsizei"/>
- <param name="format" type="GLenum"/>
- <param name="imageSize" type="GLsizei" counter="true"/>
- <param name="data" type="const GLvoid *" count="imageSize"/>
- <glx rop="219" handcode="client"/>
- </function>
-
- <function name="CompressedTexSubImage2DARB" offset="assign">
- <param name="target" type="GLenum"/>
- <param name="level" type="GLint"/>
- <param name="xoffset" type="GLint"/>
- <param name="yoffset" type="GLint"/>
- <param name="width" type="GLsizei"/>
- <param name="height" type="GLsizei"/>
- <param name="format" type="GLenum"/>
- <param name="imageSize" type="GLsizei" counter="true"/>
- <param name="data" type="const GLvoid *" count="imageSize"/>
- <glx rop="218" handcode="client"/>
- </function>
-
- <function name="CompressedTexSubImage1DARB" offset="assign">
- <param name="target" type="GLenum"/>
- <param name="level" type="GLint"/>
- <param name="xoffset" type="GLint"/>
- <param name="width" type="GLsizei"/>
- <param name="format" type="GLenum"/>
- <param name="imageSize" type="GLsizei" counter="true"/>
- <param name="data" type="const GLvoid *" count="imageSize"/>
- <glx rop="217" handcode="client"/>
- </function>
-
- <function name="GetCompressedTexImageARB" offset="assign">
- <param name="target" type="GLenum"/>
- <param name="level" type="GLint"/>
- <param name="img" type="GLvoid *" output="true"/>
-
- <!-- This has to be hand coded because the image size is in the
- "wrong" place. Technically, this should be a
- 'always_array="true"' case. The size field in the reply would
- be at offset 12. However, the size is actually at offset 16.
- This is where the 'width' is in a GetTexImage reply. -->
- <glx sop="160" handcode="true"/>
- </function>
-</category>
-
-<category name="GL_ARB_texture_border_clamp" number="13">
- <enum name="CLAMP_TO_BORDER_ARB" value="0x812D"/>
-</category>
-
-<category name="GL_ARB_point_parameters" number="14">
- <enum name="POINT_SIZE_MIN_ARB" count="1" value="0x8126">
- <size name="PointParameterfvEXT"/>
- </enum>
- <enum name="POINT_SIZE_MAX_ARB" count="1" value="0x8127">
- <size name="PointParameterfvEXT"/>
- </enum>
- <enum name="POINT_FADE_THRESHOLD_SIZE_ARB" count="1" value="0x8128">
- <size name="PointParameterfvEXT"/>
- </enum>
- <enum name="POINT_DISTANCE_ATTENUATION_ARB" count="3" value="0x8129">
- <size name="PointParameterfvEXT"/>
- </enum>
-
- <function name="PointParameterfARB" alias="PointParameterfEXT">
- <param name="pname" type="GLenum"/>
- <param name="param" type="GLfloat"/>
- <glx rop="2065"/>
- </function>
-
- <function name="PointParameterfvARB" alias="PointParameterfvEXT">
- <param name="pname" type="GLenum"/>
- <param name="params" type="const GLfloat *" variable_param="pname"/>
- <glx rop="2066"/>
- </function>
-</category>
-
-<category name="GL_ARB_vertex_blend" number="15">
- <enum name="MAX_VERTEX_UNITS_ARB" count="1" value="0x86A4">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="ACTIVE_VERTEX_UNITS_ARB" count="1" value="0x86A5">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="WEIGHT_SUM_UNITY_ARB" count="1" value="0x86A6">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="VERTEX_BLEND_ARB" count="1" value="0x86A7">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="CURRENT_WEIGHT_ARB" count="1" value="0x86A8">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="WEIGHT_ARRAY_TYPE_ARB" count="1" value="0x86A9">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="WEIGHT_ARRAY_STRIDE_ARB" count="1" value="0x86AA">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="WEIGHT_ARRAY_SIZE_ARB" count="1" value="0x86AB">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="WEIGHT_ARRAY_POINTER_ARB" value="0x86AC"/>
- <enum name="WEIGHT_ARRAY_ARB" count="1" value="0x86AD">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="MODELVIEW0_ARB" count="16" value="0x1700">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="MODELVIEW1_ARB" count="16" value="0x850A">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="MODELVIEW2_ARB" count="16" value="0x8722">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="MODELVIEW3_ARB" count="16" value="0x8723">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="MODELVIEW4_ARB" count="16" value="0x8724">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="MODELVIEW5_ARB" count="16" value="0x8725">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="MODELVIEW6_ARB" count="16" value="0x8726">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="MODELVIEW7_ARB" count="16" value="0x8727">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="MODELVIEW8_ARB" count="16" value="0x8728">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="MODELVIEW9_ARB" count="16" value="0x8729">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="MODELVIEW10_ARB" count="16" value="0x872A">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="MODELVIEW11_ARB" count="16" value="0x872B">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="MODELVIEW12_ARB" count="16" value="0x872C">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="MODELVIEW13_ARB" count="16" value="0x872D">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="MODELVIEW14_ARB" count="16" value="0x872E">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="MODELVIEW15_ARB" count="16" value="0x872F">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="MODELVIEW16_ARB" count="16" value="0x8730">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="MODELVIEW17_ARB" count="16" value="0x8731">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="MODELVIEW18_ARB" count="16" value="0x8732">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="MODELVIEW19_ARB" count="16" value="0x8733">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="MODELVIEW20_ARB" count="16" value="0x8734">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="MODELVIEW21_ARB" count="16" value="0x8735">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="MODELVIEW22_ARB" count="16" value="0x8736">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="MODELVIEW23_ARB" count="16" value="0x8737">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="MODELVIEW24_ARB" count="16" value="0x8738">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="MODELVIEW25_ARB" count="16" value="0x8739">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="MODELVIEW26_ARB" count="16" value="0x873A">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="MODELVIEW27_ARB" count="16" value="0x873B">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="MODELVIEW28_ARB" count="16" value="0x873C">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="MODELVIEW29_ARB" count="16" value="0x873D">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="MODELVIEW30_ARB" count="16" value="0x873E">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="MODELVIEW31_ARB" count="16" value="0x873F">
- <size name="Get" mode="get"/>
- </enum>
-
- <function name="WeightbvARB">
- <param name="size" type="GLint"/>
- <param name="weights" type="const GLbyte *"/>
- </function>
-
- <function name="WeightsvARB">
- <param name="size" type="GLint"/>
- <param name="weights" type="const GLshort *"/>
- </function>
-
- <function name="WeightivARB">
- <param name="size" type="GLint"/>
- <param name="weights" type="const GLint *"/>
- </function>
-
- <function name="WeightfvARB">
- <param name="size" type="GLint"/>
- <param name="weights" type="const GLfloat *"/>
- </function>
-
- <function name="WeightdvARB">
- <param name="size" type="GLint"/>
- <param name="weights" type="const GLdouble *"/>
- </function>
-
- <function name="WeightubvARB">
- <param name="size" type="GLint"/>
- <param name="weights" type="const GLubyte *"/>
- </function>
-
- <function name="WeightusvARB">
- <param name="size" type="GLint"/>
- <param name="weights" type="const GLushort *"/>
- </function>
-
- <function name="WeightuivARB">
- <param name="size" type="GLint"/>
- <param name="weights" type="const GLuint *"/>
- </function>
-
- <function name="WeightPointerARB">
- <param name="size" type="GLint"/>
- <param name="type" type="GLenum"/>
- <param name="stride" type="GLsizei"/>
- <param name="pointer" type="const GLvoid *"/>
- <glx handcode="true"/>
- </function>
-
- <function name="VertexBlendARB">
- <param name="count" type="GLint"/>
- </function>
-</category>
-
-<category name="GL_ARB_matrix_palette" number="16">
- <enum name="MATRIX_PALETTE_ARB" count="1" value="0x8840">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="MAX_MATRIX_PALETTE_STACK_DEPTH_ARB" count="1" value="0x8841">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="MAX_PALETTE_MATRICES_ARB" count="1" value="0x8842">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="CURRENT_PALETTE_MATRIX_ARB" count="1" value="0x8843">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="MATRIX_INDEX_ARRAY_ARB" count="1" value="0x8844">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="CURRENT_MATRIX_INDEX_ARB" count="1" value="0x8845">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="MATRIX_INDEX_ARRAY_SIZE_ARB" count="1" value="0x8846">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="MATRIX_INDEX_ARRAY_TYPE_ARB" count="1" value="0x8847">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="MATRIX_INDEX_ARRAY_STRIDE_ARB" count="1" value="0x8848">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="MATRIX_INDEX_ARRAY_POINTER_ARB" value="0x8849"/>
-
- <function name="CurrentPaletteMatrixARB">
- <param name="index" type="GLint"/>
- <glx ignore="true" rop="4329"/>
- </function>
-
- <function name="MatrixIndexubvARB">
- <param name="size" type="GLint" counter="true"/>
- <param name="indices" type="const GLubyte *" count="size"/>
- <glx ignore="true" rop="4326"/>
- </function>
-
- <function name="MatrixIndexusvARB">
- <param name="size" type="GLint" counter="true"/>
- <param name="indices" type="const GLushort *" count="size"/>
- <glx ignore="true" rop="4327"/>
- </function>
-
- <function name="MatrixIndexuivARB">
- <param name="size" type="GLint" counter="true"/>
- <param name="indices" type="const GLuint *" count="size"/>
- <glx ignore="true" rop="4328"/>
- </function>
-
- <function name="MatrixIndexPointerARB">
- <param name="size" type="GLint"/>
- <param name="type" type="GLenum"/>
- <param name="stride" type="GLsizei"/>
- <param name="pointer" type="const GLvoid *"/>
- <glx handcode="true"/>
- </function>
-</category>
-
-<category name="GL_ARB_texture_env_combine" number="17">
- <enum name="COMBINE_ARB" value="0x8570"/>
- <enum name="COMBINE_RGB_ARB" value="0x8571"/>
- <enum name="COMBINE_ALPHA_ARB" value="0x8572"/>
- <enum name="SOURCE0_RGB_ARB" value="0x8580"/>
- <enum name="SOURCE1_RGB_ARB" value="0x8581"/>
- <enum name="SOURCE2_RGB_ARB" value="0x8582"/>
- <enum name="SOURCE0_ALPHA_ARB" value="0x8588"/>
- <enum name="SOURCE1_ALPHA_ARB" value="0x8589"/>
- <enum name="SOURCE2_ALPHA_ARB" value="0x858A"/>
- <enum name="OPERAND0_RGB_ARB" value="0x8590"/>
- <enum name="OPERAND1_RGB_ARB" value="0x8591"/>
- <enum name="OPERAND2_RGB_ARB" value="0x8592"/>
- <enum name="OPERAND0_ALPHA_ARB" value="0x8598"/>
- <enum name="OPERAND1_ALPHA_ARB" value="0x8599"/>
- <enum name="OPERAND2_ALPHA_ARB" value="0x859A"/>
- <enum name="RGB_SCALE_ARB" value="0x8573"/>
- <enum name="ADD_SIGNED_ARB" value="0x8574"/>
- <enum name="INTERPOLATE_ARB" value="0x8575"/>
- <enum name="SUBTRACT_ARB" value="0x84E7"/>
- <enum name="CONSTANT_ARB" value="0x8576"/>
- <enum name="PRIMARY_COLOR_ARB" value="0x8577"/>
- <enum name="PREVIOUS_ARB" value="0x8578"/>
-</category>
-
-<category name="GL_ARB_texture_env_crossbar" number="18">
- <!-- No new functions, types, enums. -->
-</category>
-
-<category name="GL_ARB_texture_env_dot3" number="19">
- <enum name="DOT3_RGB_ARB" value="0x86AE"/>
- <enum name="DOT3_RGBA_ARB" value="0x86AF"/>
-</category>
-
-<!-- ARB extension number 20 is a WGL extension. -->
-
-<category name="GL_ARB_texture_mirrored_repeat" number="21">
- <enum name="MIRRORED_REPEAT_ARB" value="0x8370"/>
-</category>
-
-<category name="GL_ARB_depth_texture" number="22">
- <enum name="DEPTH_COMPONENT16_ARB" value="0x81A5"/>
- <enum name="DEPTH_COMPONENT24_ARB" value="0x81A6"/>
- <enum name="DEPTH_COMPONENT32_ARB" value="0x81A7"/>
- <enum name="TEXTURE_DEPTH_SIZE_ARB" count="1" value="0x884A">
- <size name="GetTexLevelParameterfv" mode="get"/>
- <size name="GetTexLevelParameteriv" mode="get"/>
- </enum>
- <enum name="DEPTH_TEXTURE_MODE_ARB" count="1" value="0x884B">
- <size name="TexParameterfv"/>
- <size name="TexParameteriv"/>
- <size name="GetTexParameterfv" mode="get"/>
- <size name="GetTexParameteriv" mode="get"/>
- </enum>
-</category>
-
-<category name="GL_ARB_shadow" number="23">
- <enum name="TEXTURE_COMPARE_MODE_ARB" count="1" value="0x884C">
- <size name="TexParameterfv"/>
- <size name="TexParameteriv"/>
- <size name="GetTexParameterfv" mode="get"/>
- <size name="GetTexParameteriv" mode="get"/>
- </enum>
- <enum name="TEXTURE_COMPARE_FUNC_ARB" count="1" value="0x884D">
- <size name="TexParameterfv"/>
- <size name="TexParameteriv"/>
- <size name="GetTexParameterfv" mode="get"/>
- <size name="GetTexParameteriv" mode="get"/>
- </enum>
- <enum name="COMPARE_R_TO_TEXTURE_ARB" value="0x884E"/>
-</category>
-
-<category name="GL_ARB_shadow_ambient" number="24">
- <enum name="TEXTURE_COMPARE_FAIL_VALUE_ARB" count="1" value="0x80BF">
- <size name="TexParameterfv"/>
- <size name="TexParameteriv"/>
- <size name="GetTexParameterfv" mode="get"/>
- <size name="GetTexParameteriv" mode="get"/>
- </enum>
-</category>
-
-<category name="GL_ARB_window_pos" number="25">
- <function name="WindowPos2dARB" alias="WindowPos2dMESA">
- <param name="x" type="GLdouble"/>
- <param name="y" type="GLdouble"/>
- </function>
-
- <function name="WindowPos2fARB" alias="WindowPos2fMESA">
- <param name="x" type="GLfloat"/>
- <param name="y" type="GLfloat"/>
- </function>
-
- <function name="WindowPos2iARB" alias="WindowPos2iMESA">
- <param name="x" type="GLint"/>
- <param name="y" type="GLint"/>
- </function>
-
- <function name="WindowPos2sARB" alias="WindowPos2sMESA">
- <param name="x" type="GLshort"/>
- <param name="y" type="GLshort"/>
- </function>
-
- <function name="WindowPos2dvARB" alias="WindowPos2dvMESA">
- <param name="v" type="const GLdouble *"/>
- </function>
-
- <function name="WindowPos2fvARB" alias="WindowPos2fvMESA">
- <param name="v" type="const GLfloat *"/>
- </function>
-
- <function name="WindowPos2ivARB" alias="WindowPos2ivMESA">
- <param name="v" type="const GLint *"/>
- </function>
-
- <function name="WindowPos2svARB" alias="WindowPos2svMESA">
- <param name="v" type="const GLshort *"/>
- </function>
-
- <function name="WindowPos3dARB" alias="WindowPos3dMESA">
- <param name="x" type="GLdouble"/>
- <param name="y" type="GLdouble"/>
- <param name="z" type="GLdouble"/>
- </function>
-
- <function name="WindowPos3fARB" alias="WindowPos3fMESA">
- <param name="x" type="GLfloat"/>
- <param name="y" type="GLfloat"/>
- <param name="z" type="GLfloat"/>
- </function>
-
- <function name="WindowPos3iARB" alias="WindowPos3iMESA">
- <param name="x" type="GLint"/>
- <param name="y" type="GLint"/>
- <param name="z" type="GLint"/>
- </function>
-
- <function name="WindowPos3sARB" alias="WindowPos3sMESA">
- <param name="x" type="GLshort"/>
- <param name="y" type="GLshort"/>
- <param name="z" type="GLshort"/>
- </function>
-
- <function name="WindowPos3dvARB" alias="WindowPos3dvMESA">
- <param name="v" type="const GLdouble *"/>
- </function>
-
- <function name="WindowPos3fvARB" alias="WindowPos3fvMESA">
- <param name="v" type="const GLfloat *"/>
- </function>
-
- <function name="WindowPos3ivARB" alias="WindowPos3ivMESA">
- <param name="v" type="const GLint *"/>
- </function>
-
- <function name="WindowPos3svARB" alias="WindowPos3svMESA">
- <param name="v" type="const GLshort *"/>
- </function>
-</category>
-
-<category name="GL_ARB_vertex_program" number="26">
- <enum name="COLOR_SUM_ARB" count="1" value="0x8458">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="VERTEX_PROGRAM_ARB" count="1" value="0x8620">
- <size name="GetVertexAttribdvARB" mode="get"/>
- <size name="GetVertexAttribfvARB" mode="get"/>
- <size name="GetVertexAttribivARB" mode="get"/>
- <size name="Get" mode="get"/>
- </enum>
- <enum name="VERTEX_ATTRIB_ARRAY_ENABLED_ARB" count="1" value="0x8622">
- <size name="GetVertexAttribdvARB" mode="get"/>
- <size name="GetVertexAttribfvARB" mode="get"/>
- <size name="GetVertexAttribivARB" mode="get"/>
- </enum>
- <enum name="VERTEX_ATTRIB_ARRAY_SIZE_ARB" count="1" value="0x8623">
- <size name="GetVertexAttribdvARB" mode="get"/>
- <size name="GetVertexAttribfvARB" mode="get"/>
- <size name="GetVertexAttribivARB" mode="get"/>
- </enum>
- <enum name="VERTEX_ATTRIB_ARRAY_STRIDE_ARB" count="1" value="0x8624">
- <size name="GetVertexAttribdvARB" mode="get"/>
- <size name="GetVertexAttribfvARB" mode="get"/>
- <size name="GetVertexAttribivARB" mode="get"/>
- </enum>
- <enum name="VERTEX_ATTRIB_ARRAY_TYPE_ARB" count="1" value="0x8625">
- <size name="GetVertexAttribdvARB" mode="get"/>
- <size name="GetVertexAttribfvARB" mode="get"/>
- <size name="GetVertexAttribivARB" mode="get"/>
- </enum>
- <enum name="CURRENT_VERTEX_ATTRIB_ARB" count="1" value="0x8626">
- <size name="GetVertexAttribdvARB" mode="get"/>
- <size name="GetVertexAttribfvARB" mode="get"/>
- <size name="GetVertexAttribivARB" mode="get"/>
- </enum>
- <enum name="PROGRAM_LENGTH_ARB" count="1" value="0x8627">
- <size name="GetProgramivARB" mode="get"/>
- </enum>
- <enum name="PROGRAM_STRING_ARB" value="0x8628"/>
- <enum name="MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB" count="1" value="0x862E">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="MAX_PROGRAM_MATRICES_ARB" count="1" value="0x862F">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="CURRENT_MATRIX_STACK_DEPTH_ARB" count="1" value="0x8640">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="CURRENT_MATRIX_ARB" count="16" value="0x8641">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="VERTEX_PROGRAM_POINT_SIZE_ARB" count="1" value="0x8642">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="VERTEX_PROGRAM_TWO_SIDE_ARB" count="1" value="0x8643">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="VERTEX_ATTRIB_ARRAY_POINTER_ARB" value="0x8645"/>
- <enum name="PROGRAM_ERROR_POSITION_ARB" count="1" value="0x864B">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="PROGRAM_BINDING_ARB" count="1" value="0x8677">
- <size name="GetProgramivARB" mode="get"/>
- </enum>
- <enum name="MAX_VERTEX_ATTRIBS_ARB" count="1" value="0x8869">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB" value="0x886A"/>
- <enum name="PROGRAM_ERROR_STRING_ARB" value="0x8874"/>
- <enum name="PROGRAM_FORMAT_ASCII_ARB" value="0x8875"/>
- <enum name="PROGRAM_FORMAT_ARB" count="1" value="0x8876">
- <size name="GetProgramivARB" mode="get"/>
- </enum>
- <enum name="PROGRAM_INSTRUCTIONS_ARB" count="1" value="0x88A0">
- <size name="GetProgramivARB" mode="get"/>
- </enum>
- <enum name="MAX_PROGRAM_INSTRUCTIONS_ARB" count="1" value="0x88A1">
- <size name="GetProgramivARB" mode="get"/>
- </enum>
- <enum name="PROGRAM_NATIVE_INSTRUCTIONS_ARB" count="1" value="0x88A2">
- <size name="GetProgramivARB" mode="get"/>
- </enum>
- <enum name="MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB" count="1" value="0x88A3">
- <size name="GetProgramivARB" mode="get"/>
- </enum>
- <enum name="PROGRAM_TEMPORARIES_ARB" count="1" value="0x88A4">
- <size name="GetProgramivARB" mode="get"/>
- </enum>
- <enum name="MAX_PROGRAM_TEMPORARIES_ARB" count="1" value="0x88A5">
- <size name="GetProgramivARB" mode="get"/>
- </enum>
- <enum name="PROGRAM_NATIVE_TEMPORARIES_ARB" count="1" value="0x88A6">
- <size name="GetProgramivARB" mode="get"/>
- </enum>
- <enum name="MAX_PROGRAM_NATIVE_TEMPORARIES_ARB" count="1" value="0x88A7">
- <size name="GetProgramivARB" mode="get"/>
- </enum>
- <enum name="PROGRAM_PARAMETERS_ARB" count="1" value="0x88A8">
- <size name="GetProgramivARB" mode="get"/>
- </enum>
- <enum name="MAX_PROGRAM_PARAMETERS_ARB" count="1" value="0x88A9">
- <size name="GetProgramivARB" mode="get"/>
- </enum>
- <enum name="PROGRAM_NATIVE_PARAMETERS_ARB" count="1" value="0x88AA">
- <size name="GetProgramivARB" mode="get"/>
- </enum>
- <enum name="MAX_PROGRAM_NATIVE_PARAMETERS_ARB" count="1" value="0x88AB">
- <size name="GetProgramivARB" mode="get"/>
- </enum>
- <enum name="PROGRAM_ATTRIBS_ARB" count="1" value="0x88AC">
- <size name="GetProgramivARB" mode="get"/>
- </enum>
- <enum name="MAX_PROGRAM_ATTRIBS_ARB" count="1" value="0x88AD">
- <size name="GetProgramivARB" mode="get"/>
- </enum>
- <enum name="PROGRAM_NATIVE_ATTRIBS_ARB" count="1" value="0x88AE">
- <size name="GetProgramivARB" mode="get"/>
- </enum>
- <enum name="MAX_PROGRAM_NATIVE_ATTRIBS_ARB" count="1" value="0x88AF">
- <size name="GetProgramivARB" mode="get"/>
- </enum>
- <enum name="PROGRAM_ADDRESS_REGISTERS_ARB" count="1" value="0x88B0">
- <size name="GetProgramivARB" mode="get"/>
- </enum>
- <enum name="MAX_PROGRAM_ADDRESS_REGISTERS_ARB" count="1" value="0x88B1">
- <size name="GetProgramivARB" mode="get"/>
- </enum>
- <enum name="PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB" count="1" value="0x88B2">
- <size name="GetProgramivARB" mode="get"/>
- </enum>
- <enum name="MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB" count="1" value="0x88B3">
- <size name="GetProgramivARB" mode="get"/>
- </enum>
- <enum name="MAX_PROGRAM_LOCAL_PARAMETERS_ARB" count="1" value="0x88B4">
- <size name="GetProgramivARB" mode="get"/>
- </enum>
- <enum name="MAX_PROGRAM_ENV_PARAMETERS_ARB" count="1" value="0x88B5">
- <size name="GetProgramivARB" mode="get"/>
- </enum>
- <enum name="PROGRAM_UNDER_NATIVE_LIMITS_ARB" count="1" value="0x88B6">
- <size name="GetProgramivARB" mode="get"/>
- </enum>
- <enum name="TRANSPOSE_CURRENT_MATRIX_ARB" count="16" value="0x88B7">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="MATRIX0_ARB" value="0x88C0"/>
- <enum name="MATRIX1_ARB" value="0x88C1"/>
- <enum name="MATRIX2_ARB" value="0x88C2"/>
- <enum name="MATRIX3_ARB" value="0x88C3"/>
- <enum name="MATRIX4_ARB" value="0x88C4"/>
- <enum name="MATRIX5_ARB" value="0x88C5"/>
- <enum name="MATRIX6_ARB" value="0x88C6"/>
- <enum name="MATRIX7_ARB" value="0x88C7"/>
- <enum name="MATRIX8_ARB" value="0x88C8"/>
- <enum name="MATRIX9_ARB" value="0x88C9"/>
- <enum name="MATRIX10_ARB" value="0x88CA"/>
- <enum name="MATRIX11_ARB" value="0x88CB"/>
- <enum name="MATRIX12_ARB" value="0x88CC"/>
- <enum name="MATRIX13_ARB" value="0x88CD"/>
- <enum name="MATRIX14_ARB" value="0x88CE"/>
- <enum name="MATRIX15_ARB" value="0x88CF"/>
- <enum name="MATRIX16_ARB" value="0x88D0"/>
- <enum name="MATRIX17_ARB" value="0x88D1"/>
- <enum name="MATRIX18_ARB" value="0x88D2"/>
- <enum name="MATRIX19_ARB" value="0x88D3"/>
- <enum name="MATRIX20_ARB" value="0x88D4"/>
- <enum name="MATRIX21_ARB" value="0x88D5"/>
- <enum name="MATRIX22_ARB" value="0x88D6"/>
- <enum name="MATRIX23_ARB" value="0x88D7"/>
- <enum name="MATRIX24_ARB" value="0x88D8"/>
- <enum name="MATRIX25_ARB" value="0x88D9"/>
- <enum name="MATRIX26_ARB" value="0x88DA"/>
- <enum name="MATRIX27_ARB" value="0x88DB"/>
- <enum name="MATRIX28_ARB" value="0x88DC"/>
- <enum name="MATRIX29_ARB" value="0x88DD"/>
- <enum name="MATRIX30_ARB" value="0x88DE"/>
- <enum name="MATRIX31_ARB" value="0x88DF"/>
-
- <function name="GetVertexAttribdvARB" offset="assign">
- <param name="index" type="GLuint"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLdouble *" output="true" variable_param="pname"/>
- <glx handcode="client" vendorpriv="1301"/>
- </function>
-
- <function name="GetVertexAttribfvARB" offset="assign">
- <param name="index" type="GLuint"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLfloat *" output="true" variable_param="pname"/>
- <glx handcode="client" vendorpriv="1302"/>
- </function>
-
- <function name="GetVertexAttribivARB" offset="assign">
- <param name="index" type="GLuint"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLint *" output="true" variable_param="pname"/>
- <glx handcode="client" vendorpriv="1303"/>
- </function>
-
- <function name="VertexAttrib1dARB" offset="assign" vectorequiv="VertexAttrib1dvARB">
- <param name="index" type="GLuint"/>
- <param name="x" type="GLdouble"/>
- </function>
-
- <function name="VertexAttrib1dvARB" offset="assign">
- <param name="index" type="GLuint"/>
- <param name="v" type="const GLdouble *" count="1"/>
- <glx rop="4197" doubles_in_order="true"/>
- </function>
-
- <function name="VertexAttrib1fARB" offset="assign" vectorequiv="VertexAttrib1fvARB">
- <param name="index" type="GLuint"/>
- <param name="x" type="GLfloat"/>
- </function>
-
- <function name="VertexAttrib1fvARB" offset="assign">
- <param name="index" type="GLuint"/>
- <param name="v" type="const GLfloat *" count="1"/>
- <glx rop="4193"/>
- </function>
-
- <function name="VertexAttrib1sARB" offset="assign" vectorequiv="VertexAttrib1svARB">
- <param name="index" type="GLuint"/>
- <param name="x" type="GLshort"/>
- </function>
-
- <function name="VertexAttrib1svARB" offset="assign">
- <param name="index" type="GLuint"/>
- <param name="v" type="const GLshort *" count="1"/>
- <glx rop="4189"/>
- </function>
-
- <function name="VertexAttrib2dARB" offset="assign" vectorequiv="VertexAttrib2dvARB">
- <param name="index" type="GLuint"/>
- <param name="x" type="GLdouble"/>
- <param name="y" type="GLdouble"/>
- </function>
-
- <function name="VertexAttrib2dvARB" offset="assign">
- <param name="index" type="GLuint"/>
- <param name="v" type="const GLdouble *" count="2"/>
- <glx rop="4198" doubles_in_order="true"/>
- </function>
-
- <function name="VertexAttrib2fARB" offset="assign" vectorequiv="VertexAttrib2fvARB">
- <param name="index" type="GLuint"/>
- <param name="x" type="GLfloat"/>
- <param name="y" type="GLfloat"/>
- </function>
-
- <function name="VertexAttrib2fvARB" offset="assign">
- <param name="index" type="GLuint"/>
- <param name="v" type="const GLfloat *" count="2"/>
- <glx rop="4194"/>
- </function>
-
- <function name="VertexAttrib2sARB" offset="assign" vectorequiv="VertexAttrib2svARB">
- <param name="index" type="GLuint"/>
- <param name="x" type="GLshort"/>
- <param name="y" type="GLshort"/>
- </function>
-
- <function name="VertexAttrib2svARB" offset="assign">
- <param name="index" type="GLuint"/>
- <param name="v" type="const GLshort *" count="2"/>
- <glx rop="4190"/>
- </function>
-
- <function name="VertexAttrib3dARB" offset="assign" vectorequiv="VertexAttrib3dvARB">
- <param name="index" type="GLuint"/>
- <param name="x" type="GLdouble"/>
- <param name="y" type="GLdouble"/>
- <param name="z" type="GLdouble"/>
- </function>
-
- <function name="VertexAttrib3dvARB" offset="assign">
- <param name="index" type="GLuint"/>
- <param name="v" type="const GLdouble *" count="3"/>
- <glx rop="4199" doubles_in_order="true"/>
- </function>
-
- <function name="VertexAttrib3fARB" offset="assign" vectorequiv="VertexAttrib3fvARB">
- <param name="index" type="GLuint"/>
- <param name="x" type="GLfloat"/>
- <param name="y" type="GLfloat"/>
- <param name="z" type="GLfloat"/>
- </function>
-
- <function name="VertexAttrib3fvARB" offset="assign">
- <param name="index" type="GLuint"/>
- <param name="v" type="const GLfloat *" count="3"/>
- <glx rop="4195"/>
- </function>
-
- <function name="VertexAttrib3sARB" offset="assign" vectorequiv="VertexAttrib3svARB">
- <param name="index" type="GLuint"/>
- <param name="x" type="GLshort"/>
- <param name="y" type="GLshort"/>
- <param name="z" type="GLshort"/>
- </function>
-
- <function name="VertexAttrib3svARB" offset="assign">
- <param name="index" type="GLuint"/>
- <param name="v" type="const GLshort *" count="3"/>
- <glx rop="4191"/>
- </function>
-
- <function name="VertexAttrib4dARB" offset="assign" vectorequiv="VertexAttrib4dvARB">
- <param name="index" type="GLuint"/>
- <param name="x" type="GLdouble"/>
- <param name="y" type="GLdouble"/>
- <param name="z" type="GLdouble"/>
- <param name="w" type="GLdouble"/>
- </function>
-
- <function name="VertexAttrib4dvARB" offset="assign">
- <param name="index" type="GLuint"/>
- <param name="v" type="const GLdouble *" count="4"/>
- <glx rop="4200" doubles_in_order="true"/>
- </function>
-
- <function name="VertexAttrib4fARB" offset="assign" vectorequiv="VertexAttrib4fvARB">
- <param name="index" type="GLuint"/>
- <param name="x" type="GLfloat"/>
- <param name="y" type="GLfloat"/>
- <param name="z" type="GLfloat"/>
- <param name="w" type="GLfloat"/>
- </function>
-
- <function name="VertexAttrib4fvARB" offset="assign">
- <param name="index" type="GLuint"/>
- <param name="v" type="const GLfloat *" count="4"/>
- <glx rop="4196"/>
- </function>
-
- <function name="VertexAttrib4sARB" offset="assign" vectorequiv="VertexAttrib4svARB">
- <param name="index" type="GLuint"/>
- <param name="x" type="GLshort"/>
- <param name="y" type="GLshort"/>
- <param name="z" type="GLshort"/>
- <param name="w" type="GLshort"/>
- </function>
-
- <function name="VertexAttrib4svARB" offset="assign">
- <param name="index" type="GLuint"/>
- <param name="v" type="const GLshort *" count="4"/>
- <glx rop="4192"/>
- </function>
-
- <function name="VertexAttrib4NubARB" offset="assign" vectorequiv="VertexAttrib4NubvARB">
- <param name="index" type="GLuint"/>
- <param name="x" type="GLubyte"/>
- <param name="y" type="GLubyte"/>
- <param name="z" type="GLubyte"/>
- <param name="w" type="GLubyte"/>
- </function>
-
- <function name="VertexAttrib4NubvARB" offset="assign">
- <param name="index" type="GLuint"/>
- <param name="v" type="const GLubyte *" count="4"/>
- <glx rop="4201"/>
- </function>
-
- <function name="VertexAttrib4bvARB" offset="assign">
- <param name="index" type="GLuint"/>
- <param name="v" type="const GLbyte *" count="4"/>
- <glx rop="4230"/>
- </function>
-
- <function name="VertexAttrib4ivARB" offset="assign">
- <param name="index" type="GLuint"/>
- <param name="v" type="const GLint *" count="4"/>
- <glx rop="4231"/>
- </function>
-
- <function name="VertexAttrib4ubvARB" offset="assign">
- <param name="index" type="GLuint"/>
- <param name="v" type="const GLubyte *" count="4"/>
- <glx rop="4232"/>
- </function>
-
- <function name="VertexAttrib4usvARB" offset="assign">
- <param name="index" type="GLuint"/>
- <param name="v" type="const GLushort *" count="4"/>
- <glx rop="4233"/>
- </function>
-
- <function name="VertexAttrib4uivARB" offset="assign">
- <param name="index" type="GLuint"/>
- <param name="v" type="const GLuint *" count="4"/>
- <glx rop="4234"/>
- </function>
-
- <function name="VertexAttrib4NbvARB" offset="assign">
- <param name="index" type="GLuint"/>
- <param name="v" type="const GLbyte *" count="4"/>
- <glx rop="4235"/>
- </function>
-
- <function name="VertexAttrib4NsvARB" offset="assign">
- <param name="index" type="GLuint"/>
- <param name="v" type="const GLshort *" count="4"/>
- <glx rop="4236"/>
- </function>
-
- <function name="VertexAttrib4NivARB" offset="assign">
- <param name="index" type="GLuint"/>
- <param name="v" type="const GLint *" count="4"/>
- <glx rop="4237"/>
- </function>
-
- <function name="VertexAttrib4NusvARB" offset="assign">
- <param name="index" type="GLuint"/>
- <param name="v" type="const GLushort *" count="4"/>
- <glx rop="4238"/>
- </function>
-
- <function name="VertexAttrib4NuivARB" offset="assign">
- <param name="index" type="GLuint"/>
- <param name="v" type="const GLuint *" count="4"/>
- <glx rop="4239"/>
- </function>
-
- <function name="VertexAttribPointerARB" offset="assign">
- <param name="index" type="GLuint"/>
- <param name="size" type="GLint"/>
- <param name="type" type="GLenum"/>
- <param name="normalized" type="GLboolean"/>
- <param name="stride" type="GLsizei"/>
- <param name="pointer" type="const GLvoid *"/>
- <glx handcode="true"/>
- </function>
-
- <function name="EnableVertexAttribArrayARB" offset="assign">
- <param name="index" type="GLuint"/>
- <glx handcode="true"/>
- </function>
-
- <function name="DisableVertexAttribArrayARB" offset="assign">
- <param name="index" type="GLuint"/>
- <glx handcode="true"/>
- </function>
-
- <function name="ProgramStringARB" offset="assign">
- <param name="target" type="GLenum"/>
- <param name="format" type="GLenum"/>
- <param name="len" type="GLsizei" counter="true"/>
- <param name="string" type="const GLvoid *" count="len"/>
- <glx rop="4217" large="true"/>
- </function>
-
- <function name="BindProgramARB" alias="BindProgramNV">
- <param name="target" type="GLenum"/>
- <param name="program" type="GLuint"/>
- </function>
-
- <function name="DeleteProgramsARB" alias="DeleteProgramsNV">
- <param name="n" type="GLsizei"/>
- <param name="programs" type="const GLuint *"/>
- </function>
-
- <function name="GenProgramsARB" alias="GenProgramsNV">
- <param name="n" type="GLsizei" counter="true"/>
- <param name="programs" type="GLuint *" output="true" count="n"/>
- </function>
-
- <function name="IsProgramARB" alias="IsProgramNV">
- <param name="program" type="GLuint"/>
- <return type="GLboolean"/>
- </function>
-
- <function name="ProgramEnvParameter4dARB" offset="assign" vectorequiv="ProgramEnvParameter4dvARB">
- <param name="target" type="GLenum"/>
- <param name="index" type="GLuint"/>
- <param name="x" type="GLdouble"/>
- <param name="y" type="GLdouble"/>
- <param name="z" type="GLdouble"/>
- <param name="w" type="GLdouble"/>
- </function>
-
- <function name="ProgramEnvParameter4dvARB" offset="assign">
- <param name="target" type="GLenum"/>
- <param name="index" type="GLuint"/>
- <param name="params" type="const GLdouble *" count="4"/>
- <glx rop="4185" doubles_in_order="true"/>
- </function>
-
- <function name="ProgramEnvParameter4fARB" offset="assign" vectorequiv="ProgramEnvParameter4fvARB">
- <param name="target" type="GLenum"/>
- <param name="index" type="GLuint"/>
- <param name="x" type="GLfloat"/>
- <param name="y" type="GLfloat"/>
- <param name="z" type="GLfloat"/>
- <param name="w" type="GLfloat"/>
- </function>
-
- <function name="ProgramEnvParameter4fvARB" offset="assign">
- <param name="target" type="GLenum"/>
- <param name="index" type="GLuint"/>
- <param name="params" type="const GLfloat *" count="4"/>
- <glx rop="4184"/>
- </function>
-
- <function name="ProgramLocalParameter4dARB" offset="assign" vectorequiv="ProgramLocalParameter4dvARB">
- <param name="target" type="GLenum"/>
- <param name="index" type="GLuint"/>
- <param name="x" type="GLdouble"/>
- <param name="y" type="GLdouble"/>
- <param name="z" type="GLdouble"/>
- <param name="w" type="GLdouble"/>
- </function>
-
- <function name="ProgramLocalParameter4dvARB" offset="assign">
- <param name="target" type="GLenum"/>
- <param name="index" type="GLuint"/>
- <param name="params" type="const GLdouble *" count="4"/>
- <glx rop="4216" doubles_in_order="true"/>
- </function>
-
- <function name="ProgramLocalParameter4fARB" offset="assign" vectorequiv="ProgramLocalParameter4fvARB">
- <param name="target" type="GLenum"/>
- <param name="index" type="GLuint"/>
- <param name="x" type="GLfloat"/>
- <param name="y" type="GLfloat"/>
- <param name="z" type="GLfloat"/>
- <param name="w" type="GLfloat"/>
- </function>
-
- <function name="ProgramLocalParameter4fvARB" offset="assign">
- <param name="target" type="GLenum"/>
- <param name="index" type="GLuint"/>
- <param name="params" type="const GLfloat *" count="4"/>
- <glx rop="4215"/>
- </function>
-
- <!-- The GetProgramEnvParameter[df]vARB are handcoded because there
- is an extra CARD32 of padding after the "index" field. Originally,
- GetProgranEnvParameter[df]vARB and GetProgramParameter[df]vNV
- shared the same GLX protocol. The pad field was where the pname
- parameter was in the NV functions. When this error was discovered
- and fixed, there was already at least one implementation of
- GLX protocol for ARB_vertex_program, but there were no
- implementations of NV_vertex_program. The sollution was to renumber
- the opcodes for NV_vertex_program and convert the unused field in
- the ARB_vertex_program protocol to unused padding.
- -->
-
- <function name="GetProgramEnvParameterdvARB" offset="assign">
- <param name="target" type="GLenum"/>
- <param name="index" type="GLuint"/>
- <param name="params" type="GLdouble *" output="true" count="4"/>
- <glx vendorpriv="1297" handcode="client" doubles_in_order="true"/>
- </function>
-
- <function name="GetProgramEnvParameterfvARB" offset="assign">
- <param name="target" type="GLenum"/>
- <param name="index" type="GLuint"/>
- <param name="params" type="GLfloat *" output="true" count="4"/>
- <glx vendorpriv="1296" handcode="client"/>
- </function>
-
- <function name="GetProgramLocalParameterdvARB" offset="assign">
- <param name="target" type="GLenum"/>
- <param name="index" type="GLuint"/>
- <param name="params" type="GLdouble *" output="true" count="4"/>
- <glx vendorpriv="1306" handcode="client" doubles_in_order="true"/>
- </function>
-
- <function name="GetProgramLocalParameterfvARB" offset="assign">
- <param name="target" type="GLenum"/>
- <param name="index" type="GLuint"/>
- <param name="params" type="GLfloat *" output="true" count="4"/>
- <glx vendorpriv="1305" handcode="client"/>
- </function>
-
-
- <function name="GetProgramivARB" offset="assign">
- <param name="target" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLint *" output="true" variable_param="pname"/>
- <glx vendorpriv="1307"/>
- </function>
-
- <function name="GetProgramStringARB" offset="assign">
- <param name="target" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="string" type="GLvoid *" output="true"/>
- <glx vendorpriv="1308" handcode="server" always_array="true"/>
- </function>
-
- <function name="GetVertexAttribPointervARB" alias="GetVertexAttribPointervNV">
- <param name="index" type="GLuint"/>
- <param name="pname" type="GLenum"/>
- <param name="pointer" type="GLvoid **" output="true"/>
- </function>
-</category>
-
-<category name="GL_ARB_fragment_program" number="27">
- <enum name="FRAGMENT_PROGRAM_ARB" count="1" value="0x8804">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="PROGRAM_ALU_INSTRUCTIONS_ARB" count="1" value="0x8805">
- <size name="GetProgramivARB" mode="get"/>
- </enum>
- <enum name="PROGRAM_TEX_INSTRUCTIONS_ARB" count="1" value="0x8806">
- <size name="GetProgramivARB" mode="get"/>
- </enum>
- <enum name="PROGRAM_TEX_INDIRECTIONS_ARB" count="1" value="0x8807">
- <size name="GetProgramivARB" mode="get"/>
- </enum>
- <enum name="PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB" count="1" value="0x8808">
- <size name="GetProgramivARB" mode="get"/>
- </enum>
- <enum name="PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB" count="1" value="0x8809">
- <size name="GetProgramivARB" mode="get"/>
- </enum>
- <enum name="PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB" count="1" value="0x880A">
- <size name="GetProgramivARB" mode="get"/>
- </enum>
- <enum name="MAX_PROGRAM_ALU_INSTRUCTIONS_ARB" count="1" value="0x880B">
- <size name="GetProgramivARB" mode="get"/>
- </enum>
- <enum name="MAX_PROGRAM_TEX_INSTRUCTIONS_ARB" count="1" value="0x880C">
- <size name="GetProgramivARB" mode="get"/>
- </enum>
- <enum name="MAX_PROGRAM_TEX_INDIRECTIONS_ARB" count="1" value="0x880D">
- <size name="GetProgramivARB" mode="get"/>
- </enum>
- <enum name="MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB" count="1" value="0x880E">
- <size name="GetProgramivARB" mode="get"/>
- </enum>
- <enum name="MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB" count="1" value="0x880F">
- <size name="GetProgramivARB" mode="get"/>
- </enum>
- <enum name="MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB" count="1" value="0x8810">
- <size name="GetProgramivARB" mode="get"/>
- </enum>
- <enum name="MAX_TEXTURE_COORDS_ARB" count="1" value="0x8871">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="MAX_TEXTURE_IMAGE_UNITS_ARB" count="1" value="0x8872">
- <size name="Get" mode="get"/>
- </enum>
-</category>
-
-<category name="GL_ARB_vertex_buffer_object" number="28">
- <enum name="BUFFER_SIZE_ARB" count="1" value="0x8764">
- <size name="GetBufferParameterivARB" mode="get"/>
- </enum>
- <enum name="BUFFER_USAGE_ARB" count="1" value="0x8765">
- <size name="GetBufferParameterivARB" mode="get"/>
- </enum>
- <enum name="ARRAY_BUFFER_BINDING_ARB" count="1" value="0x8894">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="ELEMENT_ARRAY_BUFFER_BINDING_ARB" count="1" value="0x8895">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="VERTEX_ARRAY_BUFFER_BINDING_ARB" count="1" value="0x8896">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="NORMAL_ARRAY_BUFFER_BINDING_ARB" count="1" value="0x8897">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="COLOR_ARRAY_BUFFER_BINDING_ARB" count="1" value="0x8898">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="INDEX_ARRAY_BUFFER_BINDING_ARB" count="1" value="0x8899">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB" count="1" value="0x889A">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB" count="1" value="0x889B">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB" count="1" value="0x889C">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB" count="1" value="0x889D">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="WEIGHT_ARRAY_BUFFER_BINDING_ARB" count="1" value="0x889E">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB" count="1" value="0x889F">
- <size name="GetVertexAttribdvARB" mode="get"/>
- <size name="GetVertexAttribfvARB" mode="get"/>
- <size name="GetVertexAttribivARB" mode="get"/>
- </enum>
- <enum name="READ_ONLY_ARB" value="0x88B8"/>
- <enum name="WRITE_ONLY_ARB" value="0x88B9"/>
- <enum name="READ_WRITE_ARB" value="0x88BA"/>
- <enum name="BUFFER_ACCESS_ARB" count="1" value="0x88BB">
- <size name="GetBufferParameterivARB" mode="get"/>
- </enum>
- <enum name="BUFFER_MAPPED_ARB" count="1" value="0x88BC">
- <size name="GetBufferParameterivARB" mode="get"/>
- </enum>
- <enum name="BUFFER_MAP_POINTER_ARB" value="0x88BD"/>
- <enum name="STREAM_DRAW_ARB" value="0x88E0"/>
- <enum name="STREAM_READ_ARB" value="0x88E1"/>
- <enum name="STREAM_COPY_ARB" value="0x88E2"/>
- <enum name="STATIC_DRAW_ARB" value="0x88E4"/>
- <enum name="STATIC_READ_ARB" value="0x88E5"/>
- <enum name="STATIC_COPY_ARB" value="0x88E6"/>
- <enum name="DYNAMIC_DRAW_ARB" value="0x88E8"/>
- <enum name="DYNAMIC_READ_ARB" value="0x88E9"/>
- <enum name="DYNAMIC_COPY_ARB" value="0x88EA"/>
-
- <type name="intptrARB" size="4" glx_name="CARD32"/>
- <type name="sizeiptrARB" size="4" unsigned="true" glx_name="CARD32"/>
-
- <function name="BindBufferARB" offset="assign">
- <param name="target" type="GLenum"/>
- <param name="buffer" type="GLuint"/>
- <glx ignore="true"/>
- </function>
-
- <function name="BufferDataARB" offset="assign">
- <param name="target" type="GLenum"/>
- <param name="size" type="GLsizeiptrARB" counter="true"/>
- <param name="data" type="const GLvoid *" count="size" img_null_flag="true"/>
- <param name="usage" type="GLenum"/>
- <glx ignore="true"/>
- </function>
-
- <function name="BufferSubDataARB" offset="assign">
- <param name="target" type="GLenum"/>
- <param name="offset" type="GLintptrARB"/>
- <param name="size" type="GLsizeiptrARB" counter="true"/>
- <param name="data" type="const GLvoid *" count="size"/>
- <glx ignore="true"/>
- </function>
-
- <function name="DeleteBuffersARB" offset="assign">
- <param name="n" type="GLsizei" counter="true"/>
- <param name="buffer" type="const GLuint *" count="n"/>
- <glx ignore="true"/>
- </function>
-
- <function name="GenBuffersARB" offset="assign">
- <param name="n" type="GLsizei" counter="true"/>
- <param name="buffer" type="GLuint *" output="true" count="n"/>
- <glx ignore="true"/>
- </function>
-
- <function name="GetBufferParameterivARB" offset="assign">
- <param name="target" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLint *" output="true" variable_param="pname"/>
- <glx ignore="true"/>
- </function>
-
- <function name="GetBufferPointervARB" offset="assign">
- <param name="target" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLvoid **" output="true"/>
- <glx ignore="true"/>
- </function>
-
- <function name="GetBufferSubDataARB" offset="assign">
- <param name="target" type="GLenum"/>
- <param name="offset" type="GLintptrARB"/>
- <param name="size" type="GLsizeiptrARB" counter="true"/>
- <param name="data" type="GLvoid *" output="true" count="size"/>
- <glx ignore="true"/>
- </function>
-
- <function name="IsBufferARB" offset="assign">
- <param name="buffer" type="GLuint"/>
- <return type="GLboolean"/>
- <glx ignore="true"/>
- </function>
-
- <function name="MapBufferARB" offset="assign">
- <param name="target" type="GLenum"/>
- <param name="access" type="GLenum"/>
- <return type="GLvoid *"/>
- <glx ignore="true"/>
- </function>
-
- <function name="UnmapBufferARB" offset="assign">
- <param name="target" type="GLenum"/>
- <return type="GLboolean"/>
- <glx ignore="true"/>
- </function>
-</category>
-
-<category name="GL_ARB_occlusion_query" number="29">
- <enum name="QUERY_COUNTER_BITS_ARB" count="1" value="0x8864">
- <size name="GetQueryivARB" mode="get"/>
- </enum>
- <enum name="CURRENT_QUERY_ARB" count="1" value="0x8865">
- <size name="GetQueryivARB" mode="get"/>
- </enum>
- <enum name="QUERY_RESULT_ARB" count="1" value="0x8866">
- <size name="GetQueryObjectivARB" mode="get"/>
- <size name="GetQueryObjectuivARB" mode="get"/>
- </enum>
- <enum name="QUERY_RESULT_AVAILABLE_ARB" count="1" value="0x8867">
- <size name="GetQueryObjectivARB" mode="get"/>
- <size name="GetQueryObjectuivARB" mode="get"/>
- </enum>
- <enum name="SAMPLES_PASSED_ARB" value="0x8914"/>
-
- <function name="GenQueriesARB" offset="assign">
- <param name="n" type="GLsizei" counter="true"/>
- <param name="ids" type="GLuint *" output="true" count="n"/>
- <glx sop="162" always_array="true"/>
- </function>
-
- <function name="DeleteQueriesARB" offset="assign">
- <param name="n" type="GLsizei" counter="true"/>
- <param name="ids" type="const GLuint *" count="n"/>
- <glx sop="161"/>
- </function>
-
- <function name="IsQueryARB" offset="assign">
- <param name="id" type="GLuint"/>
- <return type="GLboolean"/>
- <glx sop="163"/>
- </function>
-
- <function name="BeginQueryARB" offset="assign">
- <param name="target" type="GLenum"/>
- <param name="id" type="GLuint"/>
- <glx rop="231"/>
- </function>
-
- <function name="EndQueryARB" offset="assign">
- <param name="target" type="GLenum"/>
- <glx rop="232"/>
- </function>
-
- <function name="GetQueryivARB" offset="assign">
- <param name="target" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLint *" output="true" variable_param="pname"/>
- <glx sop="164"/>
- </function>
-
- <function name="GetQueryObjectivARB" offset="assign">
- <param name="id" type="GLuint"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLint *" output="true" variable_param="pname"/>
- <glx sop="165"/>
- </function>
-
- <function name="GetQueryObjectuivARB" offset="assign">
- <param name="id" type="GLuint"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLuint *" output="true" variable_param="pname"/>
- <glx sop="166"/>
- </function>
-</category>
-
-<category name="GL_ARB_shader_objects" number="30">
- <enum name="PROGRAM_OBJECT_ARB" value="0x8B40"/>
- <enum name="SHADER_OBJECT_ARB" value="0x8B48"/>
- <enum name="OBJECT_TYPE_ARB" value="0x8B4E"/>
- <enum name="OBJECT_SUBTYPE_ARB" value="0x8B4F"/>
- <enum name="FLOAT_VEC2_ARB" value="0x8B50"/>
- <enum name="FLOAT_VEC3_ARB" value="0x8B51"/>
- <enum name="FLOAT_VEC4_ARB" value="0x8B52"/>
- <enum name="INT_VEC2_ARB" value="0x8B53"/>
- <enum name="INT_VEC3_ARB" value="0x8B54"/>
- <enum name="INT_VEC4_ARB" value="0x8B55"/>
- <enum name="BOOL_ARB" value="0x8B56"/>
- <enum name="BOOL_VEC2_ARB" value="0x8B57"/>
- <enum name="BOOL_VEC3_ARB" value="0x8B58"/>
- <enum name="BOOL_VEC4_ARB" value="0x8B59"/>
- <enum name="FLOAT_MAT2_ARB" value="0x8B5A"/>
- <enum name="FLOAT_MAT3_ARB" value="0x8B5B"/>
- <enum name="FLOAT_MAT4_ARB" value="0x8B5C"/>
- <enum name="OBJECT_DELETE_STATUS_ARB" value="0x8B80"/>
- <enum name="OBJECT_COMPILE_STATUS_ARB" value="0x8B81"/>
- <enum name="OBJECT_LINK_STATUS_ARB" value="0x8B82"/>
- <enum name="OBJECT_VALIDATE_STATUS_ARB" value="0x8B83"/>
- <enum name="OBJECT_INFO_LOG_LENGTH_ARB" value="0x8B84"/>
- <enum name="OBJECT_ATTACHED_OBJECTS_ARB" value="0x8B85"/>
- <enum name="OBJECT_ACTIVE_UNIFORMS_ARB" value="0x8B86"/>
- <enum name="OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB" value="0x8B87"/>
- <enum name="OBJECT_SHADER_SOURCE_LENGTH_ARB" value="0x8B88"/>
-
- <type name="charARB" size="1" glx_name="CARD8"/>
- <type name="handleARB" size="4" glx_name="CARD32"/>
-
- <function name="DeleteObjectARB" offset="assign">
- <param name="obj" type="GLhandleARB"/>
- <glx ignore="true"/>
- </function>
-
- <function name="GetHandleARB" offset="assign">
- <param name="pname" type="GLenum"/>
- <return type="GLhandleARB"/>
- <glx ignore="true"/>
- </function>
-
- <function name="DetachObjectARB" offset="assign">
- <param name="containerObj" type="GLhandleARB"/>
- <param name="attachedObj" type="GLhandleARB"/>
- <glx ignore="true"/>
- </function>
-
- <function name="CreateShaderObjectARB" offset="assign">
- <param name="shaderType" type="GLenum"/>
- <return type="GLhandleARB"/>
- <glx ignore="true"/>
- </function>
-
- <function name="ShaderSourceARB" offset="assign">
- <param name="shader" type="GLhandleARB"/>
- <param name="count" type="GLsizei"/>
- <param name="string" type="const GLcharARB **"/>
- <param name="length" type="const GLint *"/>
- <glx ignore="true"/>
- </function>
-
- <function name="CompileShaderARB" offset="assign">
- <param name="shader" type="GLhandleARB"/>
- <glx ignore="true"/>
- </function>
-
- <function name="CreateProgramObjectARB" offset="assign">
- <return type="GLhandleARB"/>
- <glx ignore="true"/>
- </function>
-
- <function name="AttachObjectARB" offset="assign">
- <param name="containerObj" type="GLhandleARB"/>
- <param name="obj" type="GLhandleARB"/>
- <glx ignore="true"/>
- </function>
-
- <function name="LinkProgramARB" offset="assign">
- <param name="program" type="GLhandleARB"/>
- <glx ignore="true"/>
- </function>
-
- <function name="UseProgramObjectARB" offset="assign">
- <param name="program" type="GLhandleARB"/>
- <glx ignore="true"/>
- </function>
-
- <function name="ValidateProgramARB" offset="assign">
- <param name="program" type="GLhandleARB"/>
- <glx ignore="true"/>
- </function>
-
- <function name="Uniform1fARB" offset="assign">
- <param name="location" type="GLint"/>
- <param name="v0" type="GLfloat"/>
- <glx ignore="true"/>
- </function>
-
- <function name="Uniform2fARB" offset="assign">
- <param name="location" type="GLint"/>
- <param name="v0" type="GLfloat"/>
- <param name="v1" type="GLfloat"/>
- <glx ignore="true"/>
- </function>
-
- <function name="Uniform3fARB" offset="assign">
- <param name="location" type="GLint"/>
- <param name="v0" type="GLfloat"/>
- <param name="v1" type="GLfloat"/>
- <param name="v2" type="GLfloat"/>
- <glx ignore="true"/>
- </function>
-
- <function name="Uniform4fARB" offset="assign">
- <param name="location" type="GLint"/>
- <param name="v0" type="GLfloat"/>
- <param name="v1" type="GLfloat"/>
- <param name="v2" type="GLfloat"/>
- <param name="v3" type="GLfloat"/>
- <glx ignore="true"/>
- </function>
-
- <function name="Uniform1iARB" offset="assign">
- <param name="location" type="GLint"/>
- <param name="v0" type="GLint"/>
- <glx ignore="true"/>
- </function>
-
- <function name="Uniform2iARB" offset="assign">
- <param name="location" type="GLint"/>
- <param name="v0" type="GLint"/>
- <param name="v1" type="GLint"/>
- <glx ignore="true"/>
- </function>
-
- <function name="Uniform3iARB" offset="assign">
- <param name="location" type="GLint"/>
- <param name="v0" type="GLint"/>
- <param name="v1" type="GLint"/>
- <param name="v2" type="GLint"/>
- <glx ignore="true"/>
- </function>
-
- <function name="Uniform4iARB" offset="assign">
- <param name="location" type="GLint"/>
- <param name="v0" type="GLint"/>
- <param name="v1" type="GLint"/>
- <param name="v2" type="GLint"/>
- <param name="v3" type="GLint"/>
- <glx ignore="true"/>
- </function>
-
- <function name="Uniform1fvARB" offset="assign">
- <param name="location" type="GLint"/>
- <param name="count" type="GLsizei"/>
- <param name="value" type="const GLfloat *"/>
- <glx ignore="true"/>
- </function>
-
- <function name="Uniform2fvARB" offset="assign">
- <param name="location" type="GLint"/>
- <param name="count" type="GLsizei"/>
- <param name="value" type="const GLfloat *"/>
- <glx ignore="true"/>
- </function>
-
- <function name="Uniform3fvARB" offset="assign">
- <param name="location" type="GLint"/>
- <param name="count" type="GLsizei"/>
- <param name="value" type="const GLfloat *"/>
- <glx ignore="true"/>
- </function>
-
- <function name="Uniform4fvARB" offset="assign">
- <param name="location" type="GLint"/>
- <param name="count" type="GLsizei"/>
- <param name="value" type="const GLfloat *"/>
- <glx ignore="true"/>
- </function>
-
- <function name="Uniform1ivARB" offset="assign">
- <param name="location" type="GLint"/>
- <param name="count" type="GLsizei"/>
- <param name="value" type="const GLint *"/>
- <glx ignore="true"/>
- </function>
-
- <function name="Uniform2ivARB" offset="assign">
- <param name="location" type="GLint"/>
- <param name="count" type="GLsizei"/>
- <param name="value" type="const GLint *"/>
- <glx ignore="true"/>
- </function>
-
- <function name="Uniform3ivARB" offset="assign">
- <param name="location" type="GLint"/>
- <param name="count" type="GLsizei"/>
- <param name="value" type="const GLint *"/>
- <glx ignore="true"/>
- </function>
-
- <function name="Uniform4ivARB" offset="assign">
- <param name="location" type="GLint"/>
- <param name="count" type="GLsizei"/>
- <param name="value" type="const GLint *"/>
- <glx ignore="true"/>
- </function>
-
- <function name="UniformMatrix2fvARB" offset="assign">
- <param name="location" type="GLint"/>
- <param name="count" type="GLsizei"/>
- <param name="transpose" type="GLboolean"/>
- <param name="value" type="const GLfloat *"/>
- <glx ignore="true"/>
- </function>
-
- <function name="UniformMatrix3fvARB" offset="assign">
- <param name="location" type="GLint"/>
- <param name="count" type="GLsizei"/>
- <param name="transpose" type="GLboolean"/>
- <param name="value" type="const GLfloat *"/>
- <glx ignore="true"/>
- </function>
-
- <function name="UniformMatrix4fvARB" offset="assign">
- <param name="location" type="GLint"/>
- <param name="count" type="GLsizei"/>
- <param name="transpose" type="GLboolean"/>
- <param name="value" type="const GLfloat *"/>
- <glx ignore="true"/>
- </function>
-
- <function name="GetObjectParameterfvARB" offset="assign">
- <param name="obj" type="GLhandleARB"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLfloat *" output="true"/>
- <glx ignore="true"/>
- </function>
-
- <function name="GetObjectParameterivARB" offset="assign">
- <param name="obj" type="GLhandleARB"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLint *" output="true"/>
- <glx ignore="true"/>
- </function>
-
- <function name="GetInfoLogARB" offset="assign">
- <param name="obj" type="GLhandleARB"/>
- <param name="maxLength" type="GLsizei"/>
- <param name="length" type="GLsizei *" output="true"/>
- <param name="infoLog" type="GLcharARB *" output="true"/>
- <glx ignore="true"/>
- </function>
-
- <function name="GetAttachedObjectsARB" offset="assign">
- <param name="containerObj" type="GLhandleARB"/>
- <param name="maxLength" type="GLsizei"/>
- <param name="length" type="GLsizei *" output="true"/>
- <param name="infoLog" type="GLhandleARB *" output="true"/>
- <glx ignore="true"/>
- </function>
-
- <function name="GetUniformLocationARB" offset="assign">
- <param name="program" type="GLhandleARB"/>
- <param name="name" type="const GLcharARB *"/>
- <return type="GLint"/>
- <glx ignore="true"/>
- </function>
-
- <function name="GetActiveUniformARB" offset="assign">
- <param name="program" type="GLhandleARB"/>
- <param name="index" type="GLuint"/>
- <param name="bufSize" type="GLsizei"/>
- <param name="length" type="GLsizei *" output="true"/>
- <param name="size" type="GLint *" output="true"/>
- <param name="type" type="GLenum *" output="true"/>
- <param name="name" type="GLcharARB *" output="true"/>
- <glx ignore="true"/>
- </function>
-
- <function name="GetUniformfvARB" offset="assign">
- <param name="program" type="GLhandleARB"/>
- <param name="location" type="GLint"/>
- <param name="params" type="GLfloat *" output="true"/>
- <glx ignore="true"/>
- </function>
-
- <function name="GetUniformivARB" offset="assign">
- <param name="program" type="GLhandleARB"/>
- <param name="location" type="GLint"/>
- <param name="params" type="GLint *" output="true"/>
- <glx ignore="true"/>
- </function>
-
- <function name="GetShaderSourceARB" offset="assign">
- <param name="shader" type="GLhandleARB"/>
- <param name="bufSize" type="GLsizei"/>
- <param name="length" type="GLsizei *" output="true"/>
- <param name="source" type="GLcharARB *" output="true"/>
- <glx ignore="true"/>
- </function>
-</category>
-
-<category name="GL_ARB_vertex_shader" number="31">
- <enum name="VERTEX_SHADER_ARB" value="0x8B31"/>
- <enum name="MAX_VERTEX_UNIFORM_COMPONENTS_ARB" value="0x8B4A"/>
- <enum name="MAX_VARYING_FLOATS_ARB" value="0x8B4B"/>
- <enum name="MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB" value="0x8B4C"/>
- <enum name="MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB" value="0x8B4D"/>
- <enum name="OBJECT_ACTIVE_ATTRIBUTES_ARB" value="0x8B89"/>
- <enum name="OBJECT_ACTIVE_ATTRIBUTE_MAX_LENGTH_ARB" value="0x8B8A"/>
-
- <function name="BindAttribLocationARB" offset="assign">
- <param name="program" type="GLhandleARB"/>
- <param name="index" type="GLuint"/>
- <param name="name" type="const GLcharARB *"/>
- <glx ignore="true"/>
- </function>
-
- <function name="GetActiveAttribARB" offset="assign">
- <param name="program" type="GLhandleARB"/>
- <param name="index" type="GLuint"/>
- <param name="bufSize" type="GLsizei"/>
- <param name="length" type="GLsizei *" output="true"/>
- <param name="size" type="GLint *" output="true"/>
- <param name="type" type="GLenum *" output="true"/>
- <param name="name" type="GLcharARB *" output="true"/>
- <glx ignore="true"/>
- </function>
-
- <function name="GetAttribLocationARB" offset="assign">
- <param name="program" type="GLhandleARB"/>
- <param name="name" type="const GLcharARB *"/>
- <return type="GLint"/>
- <glx ignore="true"/>
- </function>
-</category>
-
-<category name="GL_ARB_fragment_shader" number="32">
- <enum name="FRAGMENT_SHADER_ARB" value="0x8B30"/>
- <enum name="MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB" value="0x8B49"/>
-</category>
-
-<category name="GL_ARB_shading_language_100" number="33">
- <!-- No new functions, types, enums. -->
-</category>
-
-<category name="GL_ARB_texture_non_power_of_two" number="34">
- <!-- No new functions, types, enums. -->
-</category>
-
-<category name="GL_ARB_point_sprite" number="35">
- <enum name="POINT_SPRITE_ARB" count="1" value="0x8861">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="COORD_REPLACE_ARB" count="1" value="0x8862">
- <size name="TexEnvfv"/>
- <size name="TexEnviv"/>
- <size name="GetTexEnvfv" mode="get"/>
- <size name="GetTexEnviv" mode="get"/>
- </enum>
-</category>
-
-<category name="GL_ARB_fragment_program_shadow" number="36">
- <!-- No new functions, types, enums. -->
-</category>
-
-<category name="GL_ARB_draw_buffers" number="37">
- <enum name="MAX_DRAW_BUFFERS_ARB" count="1" value="0x8824">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="DRAW_BUFFER0_ARB" count="1" value="0x8825">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="DRAW_BUFFER1_ARB" count="1" value="0x8826">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="DRAW_BUFFER2_ARB" count="1" value="0x8827">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="DRAW_BUFFER3_ARB" count="1" value="0x8828">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="DRAW_BUFFER4_ARB" count="1" value="0x8829">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="DRAW_BUFFER5_ARB" count="1" value="0x882A">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="DRAW_BUFFER6_ARB" count="1" value="0x882B">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="DRAW_BUFFER7_ARB" count="1" value="0x882C">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="DRAW_BUFFER8_ARB" count="1" value="0x882D">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="DRAW_BUFFER9_ARB" count="1" value="0x882E">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="DRAW_BUFFER10_ARB" count="1" value="0x882F">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="DRAW_BUFFER11_ARB" count="1" value="0x8830">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="DRAW_BUFFER12_ARB" count="1" value="0x8831">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="DRAW_BUFFER13_ARB" count="1" value="0x8832">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="DRAW_BUFFER14_ARB" count="1" value="0x8833">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="DRAW_BUFFER15_ARB" count="1" value="0x8834">
- <size name="Get" mode="get"/>
- </enum>
-
- <function name="DrawBuffersARB" offset="assign">
- <param name="n" type="GLsizei" counter="true"/>
- <param name="bufs" type="const GLenum *" count="n"/>
- <glx rop="233" large="true"/>
- </function>
-</category>
-
-<category name="GL_ARB_texture_rectangle" number="38">
- <enum name="TEXTURE_RECTANGLE_ARB" count="1" value="0x84F5">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="TEXTURE_BINDING_RECTANGLE_ARB" count="1" value="0x84F6">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="PROXY_TEXTURE_RECTANGLE_ARB" value="0x84F7"/>
- <enum name="MAX_RECTANGLE_TEXTURE_SIZE_ARB" count="1" value="0x84F8">
- <size name="Get" mode="get"/>
- </enum>
-</category>
-
-<xi:include href="ARB_ES2_compatibility.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
-
-<xi:include href="ARB_framebuffer_object.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
-
-<xi:include href="ARB_copy_buffer.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
-
-<xi:include href="ARB_depth_clamp.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
-
-<xi:include href="ARB_map_buffer_range.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
-
-<xi:include href="ARB_vertex_array_object.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
-
-<xi:include href="ARB_sync.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
-
-<xi:include href="ARB_seamless_cube_map.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
-
-<xi:include href="ARB_draw_elements_base_vertex.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
-
-<xi:include href="NV_conditional_render.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
-
-<xi:include href="NV_primitive_restart.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
-
-<xi:include href="NV_texture_barrier.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
-
-<xi:include href="ARB_sampler_objects.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
-
-<xi:include href="EXT_transform_feedback.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
-
-<xi:include href="ARB_draw_instanced.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
-
-<xi:include href="ARB_geometry_shader4.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
-
-<xi:include href="ARB_color_buffer_float.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
-
-<xi:include href="ARB_robustness.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
-
-<!-- Non-ARB extensions sorted by extension number. -->
-
-<category name="GL_EXT_blend_color" number="2">
- <enum name="CONSTANT_COLOR_EXT" value="0x8001"/>
- <enum name="ONE_MINUS_CONSTANT_COLOR_EXT" value="0x8002"/>
- <enum name="CONSTANT_ALPHA_EXT" value="0x8003"/>
- <enum name="ONE_MINUS_CONSTANT_ALPHA_EXT" value="0x8004"/>
- <enum name="BLEND_COLOR_EXT" count="4" value="0x8005">
- <size name="Get" mode="get"/>
- </enum>
-
- <function name="BlendColorEXT" alias="BlendColor">
- <param name="red" type="GLclampf"/>
- <param name="green" type="GLclampf"/>
- <param name="blue" type="GLclampf"/>
- <param name="alpha" type="GLclampf"/>
- </function>
-</category>
-
-<category name="GL_EXT_polygon_offset" number="3">
- <function name="PolygonOffsetEXT" offset="assign">
- <param name="factor" type="GLfloat"/>
- <param name="bias" type="GLfloat"/>
- <glx rop="4098" ignore="true"/>
- </function>
-</category>
-
-<category name="GL_EXT_texture" number="4">
- <enum name="ALPHA4_EXT" value="0x803B"/>
- <enum name="ALPHA8_EXT" value="0x803C"/>
- <enum name="ALPHA12_EXT" value="0x803D"/>
- <enum name="ALPHA16_EXT" value="0x803E"/>
- <enum name="LUMINANCE4_EXT" value="0x803F"/>
- <enum name="LUMINANCE8_EXT" value="0x8040"/>
- <enum name="LUMINANCE12_EXT" value="0x8041"/>
- <enum name="LUMINANCE16_EXT" value="0x8042"/>
- <enum name="LUMINANCE4_ALPHA4_EXT" value="0x8043"/>
- <enum name="LUMINANCE6_ALPHA2_EXT" value="0x8044"/>
- <enum name="LUMINANCE8_ALPHA8_EXT" value="0x8045"/>
- <enum name="LUMINANCE12_ALPHA4_EXT" value="0x8046"/>
- <enum name="LUMINANCE12_ALPHA12_EXT" value="0x8047"/>
- <enum name="LUMINANCE16_ALPHA16_EXT" value="0x8048"/>
- <enum name="INTENSITY_EXT" value="0x8049"/>
- <enum name="INTENSITY4_EXT" value="0x804A"/>
- <enum name="INTENSITY8_EXT" value="0x804B"/>
- <enum name="INTENSITY12_EXT" value="0x804C"/>
- <enum name="INTENSITY16_EXT" value="0x804D"/>
- <enum name="RGB2_EXT" value="0x804E"/>
- <enum name="RGB4_EXT" value="0x804F"/>
- <enum name="RGB5_EXT" value="0x8050"/>
- <enum name="RGB8_EXT" value="0x8051"/>
- <enum name="RGB10_EXT" value="0x8052"/>
- <enum name="RGB12_EXT" value="0x8053"/>
- <enum name="RGB16_EXT" value="0x8054"/>
- <enum name="RGBA2_EXT" value="0x8055"/>
- <enum name="RGBA4_EXT" value="0x8056"/>
- <enum name="RGB5_A1_EXT" value="0x8057"/>
- <enum name="RGBA8_EXT" value="0x8058"/>
- <enum name="RGB10_A2_EXT" value="0x8059"/>
- <enum name="RGBA12_EXT" value="0x805A"/>
- <enum name="RGBA16_EXT" value="0x805B"/>
- <enum name="TEXTURE_RED_SIZE_EXT" count="1" value="0x805C">
- <size name="GetTexLevelParameterfv" mode="get"/>
- <size name="GetTexLevelParameteriv" mode="get"/>
- </enum>
- <enum name="TEXTURE_GREEN_SIZE_EXT" count="1" value="0x805D">
- <size name="GetTexLevelParameterfv" mode="get"/>
- <size name="GetTexLevelParameteriv" mode="get"/>
- </enum>
- <enum name="TEXTURE_BLUE_SIZE_EXT" count="1" value="0x805E">
- <size name="GetTexLevelParameterfv" mode="get"/>
- <size name="GetTexLevelParameteriv" mode="get"/>
- </enum>
- <enum name="TEXTURE_ALPHA_SIZE_EXT" count="1" value="0x805F">
- <size name="GetTexLevelParameterfv" mode="get"/>
- <size name="GetTexLevelParameteriv" mode="get"/>
- </enum>
- <enum name="TEXTURE_LUMINANCE_SIZE_EXT" count="1" value="0x8060">
- <size name="GetTexLevelParameterfv" mode="get"/>
- <size name="GetTexLevelParameteriv" mode="get"/>
- </enum>
- <enum name="TEXTURE_INTENSITY_SIZE_EXT" count="1" value="0x8061">
- <size name="GetTexLevelParameterfv" mode="get"/>
- <size name="GetTexLevelParameteriv" mode="get"/>
- </enum>
- <enum name="REPLACE_EXT" value="0x8062"/>
- <enum name="PROXY_TEXTURE_1D_EXT" value="0x8063"/>
- <enum name="PROXY_TEXTURE_2D_EXT" value="0x8064"/>
- <enum name="TEXTURE_TOO_LARGE_EXT" value="0x8065"/>
-</category>
-
-<!-- Extension number 5 is not listed in the extension registry. -->
-
-<category name="GL_EXT_texture3D" number="6">
- <function name="TexImage3DEXT" alias="TexImage3D">
- <param name="target" type="GLenum"/>
- <param name="level" type="GLint"/>
- <param name="internalformat" type="GLenum"/>
- <param name="width" type="GLsizei"/>
- <param name="height" type="GLsizei"/>
- <param name="depth" type="GLsizei"/>
- <param name="border" type="GLint"/>
- <param name="format" type="GLenum"/>
- <param name="type" type="GLenum"/>
- <param name="pixels" type="const GLvoid *"/>
- </function>
-
- <function name="TexSubImage3DEXT" alias="TexSubImage3D">
- <param name="target" type="GLenum"/>
- <param name="level" type="GLint"/>
- <param name="xoffset" type="GLint"/>
- <param name="yoffset" type="GLint"/>
- <param name="zoffset" type="GLint"/>
- <param name="width" type="GLsizei"/>
- <param name="height" type="GLsizei"/>
- <param name="depth" type="GLsizei"/>
- <param name="format" type="GLenum"/>
- <param name="type" type="GLenum"/>
- <param name="UNUSED" type="GLuint" padding="true"/>
- <param name="pixels" type="const GLvoid *"/>
- </function>
-</category>
-
-<category name="GL_SGIS_texture_filter4" number="7">
- <function name="GetTexFilterFuncSGIS">
- <param name="target" type="GLenum"/>
- <param name="filter" type="GLenum"/>
- <param name="weights" type="GLfloat *" output="true"/>
- <glx vendorpriv="4101" ignore="true"/>
- </function>
-
- <function name="TexFilterFuncSGIS">
- <param name="target" type="GLenum"/>
- <param name="filter" type="GLenum"/>
- <param name="n" type="GLsizei" counter="true"/>
- <param name="weights" type="const GLfloat *" count="n"/>
- <glx rop="2064" ignore="true"/>
- </function>
-</category>
-
-<!-- Extension number 8 is not listed in the extension registry. -->
-
-<category name="GL_EXT_subtexture" number="9">
- <function name="TexSubImage1DEXT" alias="TexSubImage1D">
- <param name="target" type="GLenum"/>
- <param name="level" type="GLint"/>
- <param name="xoffset" type="GLint"/>
- <param name="width" type="GLsizei"/>
- <param name="format" type="GLenum"/>
- <param name="type" type="GLenum"/>
- <param name="UNUSED" type="GLuint" padding="true"/>
- <param name="pixels" type="const GLvoid *"/>
- </function>
-
- <function name="TexSubImage2DEXT" alias="TexSubImage2D">
- <param name="target" type="GLenum"/>
- <param name="level" type="GLint"/>
- <param name="xoffset" type="GLint"/>
- <param name="yoffset" type="GLint"/>
- <param name="width" type="GLsizei"/>
- <param name="height" type="GLsizei"/>
- <param name="format" type="GLenum"/>
- <param name="type" type="GLenum"/>
- <param name="UNUSED" type="GLuint" padding="true"/>
- <param name="pixels" type="const GLvoid *"/>
- </function>
-</category>
-
-<category name="GL_EXT_copy_texture" number="10">
- <function name="CopyTexImage1DEXT" alias="CopyTexImage1D">
- <param name="target" type="GLenum"/>
- <param name="level" type="GLint"/>
- <param name="internalformat" type="GLenum"/>
- <param name="x" type="GLint"/>
- <param name="y" type="GLint"/>
- <param name="width" type="GLsizei"/>
- <param name="border" type="GLint"/>
- </function>
-
- <function name="CopyTexImage2DEXT" alias="CopyTexImage2D">
- <param name="target" type="GLenum"/>
- <param name="level" type="GLint"/>
- <param name="internalformat" type="GLenum"/>
- <param name="x" type="GLint"/>
- <param name="y" type="GLint"/>
- <param name="width" type="GLsizei"/>
- <param name="height" type="GLsizei"/>
- <param name="border" type="GLint"/>
- </function>
-
- <function name="CopyTexSubImage1DEXT" alias="CopyTexSubImage1D">
- <param name="target" type="GLenum"/>
- <param name="level" type="GLint"/>
- <param name="xoffset" type="GLint"/>
- <param name="x" type="GLint"/>
- <param name="y" type="GLint"/>
- <param name="width" type="GLsizei"/>
- </function>
-
- <function name="CopyTexSubImage2DEXT" alias="CopyTexSubImage2D">
- <param name="target" type="GLenum"/>
- <param name="level" type="GLint"/>
- <param name="xoffset" type="GLint"/>
- <param name="yoffset" type="GLint"/>
- <param name="x" type="GLint"/>
- <param name="y" type="GLint"/>
- <param name="width" type="GLsizei"/>
- <param name="height" type="GLsizei"/>
- </function>
-
- <function name="CopyTexSubImage3DEXT" alias="CopyTexSubImage3D">
- <param name="target" type="GLenum"/>
- <param name="level" type="GLint"/>
- <param name="xoffset" type="GLint"/>
- <param name="yoffset" type="GLint"/>
- <param name="zoffset" type="GLint"/>
- <param name="x" type="GLint"/>
- <param name="y" type="GLint"/>
- <param name="width" type="GLsizei"/>
- <param name="height" type="GLsizei"/>
- </function>
-</category>
-
-<category name="GL_EXT_histogram" number="11">
- <enum name="HISTOGRAM_EXT" value="0x8024"/>
- <enum name="PROXY_HISTOGRAM_EXT" value="0x8025"/>
- <enum name="HISTOGRAM_WIDTH_EXT" count="1" value="0x8026">
- <size name="GetHistogramParameterfvEXT" mode="get"/>
- <size name="GetHistogramParameterivEXT" mode="get"/>
- </enum>
- <enum name="HISTOGRAM_FORMAT_EXT" count="1" value="0x8027">
- <size name="GetHistogramParameterfvEXT" mode="get"/>
- <size name="GetHistogramParameterivEXT" mode="get"/>
- </enum>
- <enum name="HISTOGRAM_RED_SIZE_EXT" count="1" value="0x8028">
- <size name="GetHistogramParameterfvEXT" mode="get"/>
- <size name="GetHistogramParameterivEXT" mode="get"/>
- </enum>
- <enum name="HISTOGRAM_GREEN_SIZE_EXT" count="1" value="0x8029">
- <size name="GetHistogramParameterfvEXT" mode="get"/>
- <size name="GetHistogramParameterivEXT" mode="get"/>
- </enum>
- <enum name="HISTOGRAM_BLUE_SIZE_EXT" count="1" value="0x802A">
- <size name="GetHistogramParameterfvEXT" mode="get"/>
- <size name="GetHistogramParameterivEXT" mode="get"/>
- </enum>
- <enum name="HISTOGRAM_ALPHA_SIZE_EXT" count="1" value="0x802B">
- <size name="GetHistogramParameterfvEXT" mode="get"/>
- <size name="GetHistogramParameterivEXT" mode="get"/>
- </enum>
- <enum name="HISTOGRAM_LUMINANCE_SIZE_EXT" count="1" value="0x802C">
- <size name="GetHistogramParameterfvEXT" mode="get"/>
- <size name="GetHistogramParameterivEXT" mode="get"/>
- </enum>
- <enum name="HISTOGRAM_SINK_EXT" count="1" value="0x802D">
- <size name="GetHistogramParameterfvEXT" mode="get"/>
- <size name="GetHistogramParameterivEXT" mode="get"/>
- </enum>
- <enum name="MINMAX_EXT" value="0x802E"/>
- <enum name="MINMAX_FORMAT_EXT" count="1" value="0x802F">
- <size name="GetMinmaxParameterfvEXT" mode="get"/>
- <size name="GetMinmaxParameterivEXT" mode="get"/>
- </enum>
- <enum name="MINMAX_SINK_EXT" count="1" value="0x8030">
- <size name="GetMinmaxParameterfvEXT" mode="get"/>
- <size name="GetMinmaxParameterivEXT" mode="get"/>
- </enum>
- <enum name="TABLE_TOO_LARGE_EXT" value="0x8031"/>
-
- <function name="GetHistogramEXT" alias="GetHistogram" static_dispatch="false">
- <param name="target" type="GLenum"/>
- <param name="reset" type="GLboolean"/>
- <param name="format" type="GLenum"/>
- <param name="type" type="GLenum"/>
- <param name="values" type="GLvoid *" output="true" img_width="width" img_format="format" img_type="type"/>
- <glx vendorpriv="5" dimensions_in_reply="true" img_reset="reset"/>
- </function>
-
- <function name="GetHistogramParameterfvEXT" alias="GetHistogramParameterfv" static_dispatch="false">
- <param name="target" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLfloat *" output="true" variable_param="pname"/>
- <glx vendorpriv="6"/>
- </function>
-
- <function name="GetHistogramParameterivEXT" alias="GetHistogramParameteriv" static_dispatch="false">
- <param name="target" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLint *" output="true" variable_param="pname"/>
- <glx vendorpriv="7"/>
- </function>
-
- <function name="GetMinmaxEXT" alias="GetMinmax" static_dispatch="false">
- <param name="target" type="GLenum"/>
- <param name="reset" type="GLboolean"/>
- <param name="format" type="GLenum"/>
- <param name="type" type="GLenum"/>
- <param name="values" type="GLvoid *" output="true" img_width="2" img_format="format" img_type="type"/>
- <glx vendorpriv="8" img_reset="reset"/>
- </function>
-
- <function name="GetMinmaxParameterfvEXT" alias="GetMinmaxParameterfv" static_dispatch="false">
- <param name="target" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLfloat *" output="true" variable_param="pname"/>
- <glx vendorpriv="9"/>
- </function>
-
- <function name="GetMinmaxParameterivEXT" alias="GetMinmaxParameteriv" static_dispatch="false">
- <param name="target" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLint *" output="true" variable_param="pname"/>
- <glx vendorpriv="10"/>
- </function>
-
- <function name="HistogramEXT" alias="Histogram" static_dispatch="false">
- <param name="target" type="GLenum"/>
- <param name="width" type="GLsizei"/>
- <param name="internalformat" type="GLenum"/>
- <param name="sink" type="GLboolean"/>
- </function>
-
- <function name="MinmaxEXT" alias="Minmax" static_dispatch="false">
- <param name="target" type="GLenum"/>
- <param name="internalformat" type="GLenum"/>
- <param name="sink" type="GLboolean"/>
- </function>
-
- <function name="ResetHistogramEXT" alias="ResetHistogram" static_dispatch="false">
- <param name="target" type="GLenum"/>
- </function>
-
- <function name="ResetMinmaxEXT" alias="ResetMinmax" static_dispatch="false">
- <param name="target" type="GLenum"/>
- </function>
-</category>
-
-<category name="GL_EXT_convolution" number="12">
- <enum name="CONVOLUTION_BORDER_MODE_EXT" count="1" value="0x8013">
- <size name="ConvolutionParameterfv"/>
- <size name="ConvolutionParameteriv"/>
- <size name="GetConvolutionParameterfv" mode="get"/>
- <size name="GetConvolutionParameteriv" mode="get"/>
- </enum>
- <enum name="CONVOLUTION_FILTER_SCALE_EXT" count="4" value="0x8014">
- <size name="ConvolutionParameterfv"/>
- <size name="ConvolutionParameteriv"/>
- <size name="GetConvolutionParameterfv" mode="get"/>
- <size name="GetConvolutionParameteriv" mode="get"/>
- </enum>
- <enum name="CONVOLUTION_FILTER_BIAS_EXT" count="4" value="0x8015">
- <size name="ConvolutionParameterfv"/>
- <size name="ConvolutionParameteriv"/>
- <size name="GetConvolutionParameterfv" mode="get"/>
- <size name="GetConvolutionParameteriv" mode="get"/>
- </enum>
- <enum name="REDUCE_EXT" value="0x8016"/>
- <enum name="CONVOLUTION_FORMAT_EXT" count="1" value="0x8017">
- <size name="GetConvolutionParameterfv" mode="get"/>
- <size name="GetConvolutionParameteriv" mode="get"/>
- </enum>
- <enum name="CONVOLUTION_WIDTH_EXT" count="1" value="0x8018">
- <size name="GetConvolutionParameterfv" mode="get"/>
- <size name="GetConvolutionParameteriv" mode="get"/>
- </enum>
- <enum name="CONVOLUTION_HEIGHT_EXT" count="1" value="0x8019">
- <size name="GetConvolutionParameterfv" mode="get"/>
- <size name="GetConvolutionParameteriv" mode="get"/>
- </enum>
- <enum name="MAX_CONVOLUTION_WIDTH_EXT" count="1" value="0x801A">
- <size name="GetConvolutionParameterfv" mode="get"/>
- <size name="GetConvolutionParameteriv" mode="get"/>
- <size name="Get" mode="get"/>
- </enum>
- <enum name="MAX_CONVOLUTION_HEIGHT_EXT" count="1" value="0x801B">
- <size name="GetConvolutionParameterfv" mode="get"/>
- <size name="GetConvolutionParameteriv" mode="get"/>
- <size name="Get" mode="get"/>
- </enum>
- <enum name="POST_CONVOLUTION_RED_SCALE_EXT" count="1" value="0x801C">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="POST_CONVOLUTION_GREEN_SCALE_EXT" count="1" value="0x801D">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="POST_CONVOLUTION_BLUE_SCALE_EXT" count="1" value="0x801E">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="POST_CONVOLUTION_ALPHA_SCALE_EXT" count="1" value="0x801F">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="POST_CONVOLUTION_RED_BIAS_EXT" count="1" value="0x8020">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="POST_CONVOLUTION_GREEN_BIAS_EXT" count="1" value="0x8021">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="POST_CONVOLUTION_BLUE_BIAS_EXT" count="1" value="0x8022">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="POST_CONVOLUTION_ALPHA_BIAS_EXT" count="1" value="0x8023">
- <size name="Get" mode="get"/>
- </enum>
-
- <function name="ConvolutionFilter1DEXT" alias="ConvolutionFilter1D" static_dispatch="false">
- <param name="target" type="GLenum"/>
- <param name="internalformat" type="GLenum"/>
- <param name="width" type="GLsizei"/>
- <param name="format" type="GLenum"/>
- <param name="type" type="GLenum"/>
- <param name="image" type="const GLvoid *"/>
- </function>
-
- <function name="ConvolutionFilter2DEXT" alias="ConvolutionFilter2D" static_dispatch="false">
- <param name="target" type="GLenum"/>
- <param name="internalformat" type="GLenum"/>
- <param name="width" type="GLsizei"/>
- <param name="height" type="GLsizei"/>
- <param name="format" type="GLenum"/>
- <param name="type" type="GLenum"/>
- <param name="image" type="const GLvoid *"/>
- </function>
-
- <function name="ConvolutionParameterfEXT" alias="ConvolutionParameterf" static_dispatch="false">
- <param name="target" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLfloat"/>
- </function>
-
- <function name="ConvolutionParameterfvEXT" alias="ConvolutionParameterfv" static_dispatch="false">
- <param name="target" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="const GLfloat *"/>
- </function>
-
- <function name="ConvolutionParameteriEXT" alias="ConvolutionParameteri" static_dispatch="false">
- <param name="target" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLint"/>
- </function>
-
- <function name="ConvolutionParameterivEXT" alias="ConvolutionParameteriv" static_dispatch="false">
- <param name="target" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="const GLint *"/>
- </function>
-
- <function name="CopyConvolutionFilter1DEXT" alias="CopyConvolutionFilter1D" static_dispatch="false">
- <param name="target" type="GLenum"/>
- <param name="internalformat" type="GLenum"/>
- <param name="x" type="GLint"/>
- <param name="y" type="GLint"/>
- <param name="width" type="GLsizei"/>
- </function>
-
- <function name="CopyConvolutionFilter2DEXT" alias="CopyConvolutionFilter2D" static_dispatch="false">
- <param name="target" type="GLenum"/>
- <param name="internalformat" type="GLenum"/>
- <param name="x" type="GLint"/>
- <param name="y" type="GLint"/>
- <param name="width" type="GLsizei"/>
- <param name="height" type="GLsizei"/>
- </function>
-
- <function name="GetConvolutionFilterEXT" alias="GetConvolutionFilter" static_dispatch="false">
- <param name="target" type="GLenum"/>
- <param name="format" type="GLenum"/>
- <param name="type" type="GLenum"/>
- <param name="image" type="GLvoid *" output="true" img_width="width" img_height="height" img_format="format" img_type="type"/>
- <glx vendorpriv="1" dimensions_in_reply="true"/>
- </function>
-
- <function name="GetConvolutionParameterfvEXT" alias="GetConvolutionParameterfv" static_dispatch="false">
- <param name="target" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLfloat *" output="true" variable_param="pname"/>
- <glx vendorpriv="2"/>
- </function>
-
- <function name="GetConvolutionParameterivEXT" alias="GetConvolutionParameteriv" static_dispatch="false">
- <param name="target" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLint *" output="true" variable_param="pname"/>
- <glx vendorpriv="3"/>
- </function>
-
- <function name="GetSeparableFilterEXT" alias="GetSeparableFilter" static_dispatch="false">
- <param name="target" type="GLenum"/>
- <param name="format" type="GLenum"/>
- <param name="type" type="GLenum"/>
- <param name="row" type="GLvoid *" output="true"/>
- <param name="column" type="GLvoid *" output="true"/>
- <param name="span" type="GLvoid *" output="true"/>
- <glx vendorpriv="4" handcode="true"/>
- </function>
-
- <function name="SeparableFilter2DEXT" alias="SeparableFilter2D" static_dispatch="false">
- <param name="target" type="GLenum"/>
- <param name="internalformat" type="GLenum"/>
- <param name="width" type="GLsizei"/>
- <param name="height" type="GLsizei"/>
- <param name="format" type="GLenum"/>
- <param name="type" type="GLenum"/>
- <param name="row" type="const GLvoid *"/>
- <param name="column" type="const GLvoid *"/>
- </function>
-</category>
-
-<category name="GL_SGI_color_matrix" number="13">
- <enum name="COLOR_MATRIX_SGI" value="0x80B1"/>
- <enum name="COLOR_MATRIX_STACK_DEPTH_SGI" value="0x80B2"/>
- <enum name="MAX_COLOR_MATRIX_STACK_DEPTH_SGI" value="0x80B3"/>
- <enum name="POST_COLOR_MATRIX_RED_SCALE_SGI" value="0x80B4"/>
- <enum name="POST_COLOR_MATRIX_GREEN_SCALE_SGI" value="0x80B5"/>
- <enum name="POST_COLOR_MATRIX_BLUE_SCALE_SGI" value="0x80B6"/>
- <enum name="POST_COLOR_MATRIX_ALPHA_SCALE_SGI" value="0x80B7"/>
- <enum name="POST_COLOR_MATRIX_RED_BIAS_SGI" value="0x80B8"/>
- <enum name="POST_COLOR_MATRIX_GREEN_BIAS_SGI" value="0x80B9"/>
- <enum name="POST_COLOR_MATRIX_BLUE_BIAS_SGI" value="0x80BA"/>
- <enum name="POST_COLOR_MATRIX_ALPHA_BIAS_SGI" value="0x80BB"/>
-</category>
-
-<category name="GL_SGI_color_table" number="14">
- <enum name="COLOR_TABLE_SCALE_SGI" count="4" value="0x80D6">
- <size name="ColorTableParameterfvSGI"/>
- <size name="ColorTableParameterivSGI"/>
- <size name="GetColorTableParameterfvSGI" mode="get"/>
- <size name="GetColorTableParameterivSGI" mode="get"/>
- </enum>
- <enum name="COLOR_TABLE_BIAS_SGI" count="4" value="0x80D7">
- <size name="ColorTableParameterfvSGI"/>
- <size name="ColorTableParameterivSGI"/>
- <size name="GetColorTableParameterfvSGI" mode="get"/>
- <size name="GetColorTableParameterivSGI" mode="get"/>
- </enum>
- <enum name="COLOR_TABLE_FORMAT_SGI" count="1" value="0x80D8">
- <size name="GetColorTableParameterfvSGI" mode="get"/>
- <size name="GetColorTableParameterivSGI" mode="get"/>
- </enum>
- <enum name="COLOR_TABLE_WIDTH_SGI" count="1" value="0x80D9">
- <size name="GetColorTableParameterfvSGI" mode="get"/>
- <size name="GetColorTableParameterivSGI" mode="get"/>
- </enum>
- <enum name="COLOR_TABLE_RED_SIZE_SGI" count="1" value="0x80DA">
- <size name="GetColorTableParameterfvSGI" mode="get"/>
- <size name="GetColorTableParameterivSGI" mode="get"/>
- </enum>
- <enum name="COLOR_TABLE_GREEN_SIZE_SGI" count="1" value="0x80DB">
- <size name="GetColorTableParameterfvSGI" mode="get"/>
- <size name="GetColorTableParameterivSGI" mode="get"/>
- </enum>
- <enum name="COLOR_TABLE_BLUE_SIZE_SGI" count="1" value="0x80DC">
- <size name="GetColorTableParameterfvSGI" mode="get"/>
- <size name="GetColorTableParameterivSGI" mode="get"/>
- </enum>
- <enum name="COLOR_TABLE_ALPHA_SIZE_SGI" count="1" value="0x80DD">
- <size name="GetColorTableParameterfvSGI" mode="get"/>
- <size name="GetColorTableParameterivSGI" mode="get"/>
- </enum>
- <enum name="COLOR_TABLE_LUMINANCE_SIZE_SGI" count="1" value="0x80DE">
- <size name="GetColorTableParameterfvSGI" mode="get"/>
- <size name="GetColorTableParameterivSGI" mode="get"/>
- </enum>
- <enum name="COLOR_TABLE_INTENSITY_SIZE_SGI" count="1" value="0x80DF">
- <size name="GetColorTableParameterfvSGI" mode="get"/>
- <size name="GetColorTableParameterivSGI" mode="get"/>
- </enum>
-
- <function name="ColorTableSGI" alias="ColorTable" static_dispatch="false">
- <param name="target" type="GLenum"/>
- <param name="internalformat" type="GLenum"/>
- <param name="width" type="GLsizei"/>
- <param name="format" type="GLenum"/>
- <param name="type" type="GLenum"/>
- <param name="table" type="const GLvoid *"/>
- </function>
-
- <function name="ColorTableParameterfvSGI" alias="ColorTableParameterfv" static_dispatch="false">
- <param name="target" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="const GLfloat *"/>
- </function>
-
- <function name="ColorTableParameterivSGI" alias="ColorTableParameteriv" static_dispatch="false">
- <param name="target" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="const GLint *"/>
- </function>
-
- <function name="CopyColorTableSGI" alias="CopyColorTable" static_dispatch="false">
- <param name="target" type="GLenum"/>
- <param name="internalformat" type="GLenum"/>
- <param name="x" type="GLint"/>
- <param name="y" type="GLint"/>
- <param name="width" type="GLsizei"/>
- </function>
-
- <function name="GetColorTableSGI" alias="GetColorTable" static_dispatch="false">
- <param name="target" type="GLenum"/>
- <param name="format" type="GLenum"/>
- <param name="type" type="GLenum"/>
- <param name="table" type="GLvoid *" output="true" img_width="width" img_format="format" img_type="type"/>
- <glx vendorpriv="4098" dimensions_in_reply="true"/>
- </function>
-
- <function name="GetColorTableParameterfvSGI" alias="GetColorTableParameterfv" static_dispatch="false">
- <param name="target" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLfloat *" output="true" variable_param="pname"/>
- <glx vendorpriv="4099"/>
- </function>
-
- <function name="GetColorTableParameterivSGI" alias="GetColorTableParameteriv" static_dispatch="false">
- <param name="target" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLint *" output="true" variable_param="pname"/>
- <glx vendorpriv="4100"/>
- </function>
-</category>
-
-<category name="GL_SGIS_pixel_texture" number="15">
- <function name="PixelTexGenParameteriSGIS" offset="assign" static_dispatch="false">
- <param name="pname" type="GLenum"/>
- <param name="param" type="GLint"/>
- <glx ignore="true"/>
- </function>
-
- <function name="PixelTexGenParameterivSGIS" offset="assign" static_dispatch="false">
- <param name="pname" type="GLenum"/>
- <param name="params" type="const GLint *"/>
- <glx ignore="true"/>
- </function>
-
- <function name="PixelTexGenParameterfSGIS" offset="assign" static_dispatch="false">
- <param name="pname" type="GLenum"/>
- <param name="param" type="GLfloat"/>
- <glx ignore="true"/>
- </function>
-
- <function name="PixelTexGenParameterfvSGIS" offset="assign" static_dispatch="false">
- <param name="pname" type="GLenum"/>
- <param name="params" type="const GLfloat *"/>
- <glx ignore="true"/>
- </function>
-
- <function name="GetPixelTexGenParameterivSGIS" offset="assign" static_dispatch="false">
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLint *" output="true" variable_param="pname"/>
- <glx ignore="true"/>
- </function>
-
- <function name="GetPixelTexGenParameterfvSGIS" offset="assign" static_dispatch="false">
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLfloat *" output="true" variable_param="pname"/>
- <glx ignore="true"/>
- </function>
-</category>
-
-<category name="GL_SGIS_texture4D" number="16">
- <function name="TexImage4DSGIS">
- <param name="target" type="GLenum"/>
- <param name="level" type="GLint"/>
- <param name="internalformat" type="GLenum"/>
- <param name="width" type="GLsizei"/>
- <param name="height" type="GLsizei"/>
- <param name="depth" type="GLsizei"/>
- <param name="size4d" type="GLsizei"/>
- <param name="border" type="GLint"/>
- <param name="format" type="GLenum"/>
- <param name="type" type="GLenum"/>
- <param name="pixels" type="const GLvoid *" img_width="width" img_height="height" img_depth="depth" img_extent="size4d" img_format="format" img_type="type" img_target="target" img_null_flag="true" img_pad_dimensions="true"/>
- <glx rop="2057" ignore="true"/>
- </function>
-
- <function name="TexSubImage4DSGIS">
- <param name="target" type="GLenum"/>
- <param name="level" type="GLint"/>
- <param name="xoffset" type="GLint"/>
- <param name="yoffset" type="GLint"/>
- <param name="zoffset" type="GLint"/>
- <param name="woffset" type="GLint"/>
- <param name="width" type="GLsizei"/>
- <param name="height" type="GLsizei"/>
- <param name="depth" type="GLsizei"/>
- <param name="size4d" type="GLsizei"/>
- <param name="format" type="GLenum"/>
- <param name="type" type="GLenum"/>
- <param name="UNUSED" type="GLuint" padding="true"/>
- <param name="pixels" type="const GLvoid *" img_width="width" img_height="height" img_depth="depth" img_extent="size4d" img_xoff="xoffset" img_yoff="yoffset" img_zoff="zoffset" img_woff="woffset" img_format="format" img_type="type" img_target="target" img_pad_dimensions="true"/>
- <glx rop="2058" ignore="true"/>
- </function>
-</category>
-
-<category name="GL_SGI_texture_color_table" number="17">
- <enum name="TEXTURE_COLOR_TABLE_SGI" value="0x80BC"/>
- <enum name="PROXY_TEXTURE_COLOR_TABLE_SGI" value="0x80BD"/>
-</category>
-
-<!-- Extension number 19 is not listed in the extension registry. -->
-
-<category name="GL_EXT_texture_object" number="20">
- <function name="AreTexturesResidentEXT" alias="AreTexturesResident">
- <param name="n" type="GLsizei" counter="true"/>
- <param name="textures" type="const GLuint *" count="n"/>
- <param name="residences" type="GLboolean *" output="true" count="n"/>
- <return type="GLboolean"/>
- <glx vendorpriv="11" handcode="client" always_array="true"/>
- </function>
-
- <function name="BindTextureEXT" alias="BindTexture">
- <param name="target" type="GLenum"/>
- <param name="texture" type="GLuint"/>
- </function>
-
- <function name="DeleteTexturesEXT" alias="DeleteTextures">
- <param name="n" type="GLsizei" counter="true"/>
- <param name="textures" type="const GLuint *" count="n"/>
- <glx vendorpriv="12"/>
- </function>
-
- <function name="GenTexturesEXT" alias="GenTextures">
- <param name="n" type="GLsizei" counter="true"/>
- <param name="textures" type="GLuint *" output="true" count="n"/>
- <glx vendorpriv="13" always_array="true"/>
- </function>
-
- <function name="IsTextureEXT" alias="IsTexture">
- <param name="texture" type="GLuint"/>
- <return type="GLboolean"/>
- <glx vendorpriv="14"/>
- </function>
-
- <function name="PrioritizeTexturesEXT" alias="PrioritizeTextures">
- <param name="n" type="GLsizei"/>
- <param name="textures" type="const GLuint *"/>
- <param name="priorities" type="const GLclampf *"/>
- </function>
-</category>
-
-<category name="GL_SGIS_detail_texture" number="21">
- <function name="DetailTexFuncSGIS">
- <param name="target" type="GLenum"/>
- <param name="n" type="GLsizei" counter="true"/>
- <param name="points" type="const GLfloat *" count="n"/>
- <glx rop="2051" ignore="true"/>
- </function>
-
- <function name="GetDetailTexFuncSGIS">
- <param name="target" type="GLenum"/>
- <param name="points" type="GLfloat *" output="true"/>
- <glx vendorpriv="4096" ignore="true"/>
- </function>
-</category>
-
-<category name="GL_SGIS_sharpen_texture" number="22">
- <function name="SharpenTexFuncSGIS">
- <param name="target" type="GLenum"/>
- <param name="n" type="GLsizei" counter="true"/>
- <param name="points" type="const GLfloat *" count="n" count_scale="2"/>
- <glx rop="2052" ignore="true"/>
- </function>
-
- <function name="GetSharpenTexFuncSGIS">
- <param name="target" type="GLenum"/>
- <param name="points" type="GLfloat *" output="true"/>
- <glx vendorpriv="4097" ignore="true"/>
- </function>
-</category>
-
-<category name="GL_SGIS_multisample" number="25">
- <function name="SampleMaskSGIS" offset="assign" static_dispatch="false">
- <param name="value" type="GLclampf"/>
- <param name="invert" type="GLboolean"/>
- <glx rop="2048"/>
- </function>
-
- <function name="SamplePatternSGIS" offset="assign" static_dispatch="false">
- <param name="pattern" type="GLenum"/>
- <glx rop="2049"/>
- </function>
-</category>
-
-<!-- Extension number 26 is not listed in the extension registry. -->
-
-<category name="GL_EXT_rescale_normal" number="27">
- <enum name="RESCALE_NORMAL_EXT" count="1" value="0x803A">
- <size name="Get" mode="get"/>
- </enum>
-</category>
-
-<!-- Extension number 28 is a GLX extension. -->
-<!-- Extension number 29 is not listed in the extension registry. -->
-
-<category name="GL_EXT_vertex_array" number="30">
- <function name="ArrayElementEXT" alias="ArrayElement">
- <param name="i" type="GLint"/>
- </function>
-
- <function name="ColorPointerEXT" offset="assign">
- <param name="size" type="GLint"/>
- <param name="type" type="GLenum"/>
- <param name="stride" type="GLsizei"/>
- <param name="count" type="GLsizei"/>
- <param name="pointer" type="const GLvoid *"/>
- <glx handcode="true"/>
- </function>
-
- <function name="DrawArraysEXT" alias="DrawArrays">
- <param name="mode" type="GLenum"/>
- <param name="first" type="GLint"/>
- <param name="count" type="GLsizei"/>
- </function>
-
- <function name="EdgeFlagPointerEXT" offset="assign">
- <param name="stride" type="GLsizei"/>
- <param name="count" type="GLsizei"/>
- <param name="pointer" type="const GLboolean *"/>
- <glx handcode="true"/>
- </function>
-
- <function name="GetPointervEXT" alias="GetPointerv">
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLvoid **" output="true"/>
- </function>
-
- <function name="IndexPointerEXT" offset="assign">
- <param name="type" type="GLenum"/>
- <param name="stride" type="GLsizei"/>
- <param name="count" type="GLsizei"/>
- <param name="pointer" type="const GLvoid *"/>
- <glx handcode="true"/>
- </function>
-
- <function name="NormalPointerEXT" offset="assign">
- <param name="type" type="GLenum"/>
- <param name="stride" type="GLsizei"/>
- <param name="count" type="GLsizei"/>
- <param name="pointer" type="const GLvoid *"/>
- <glx handcode="true"/>
- </function>
-
- <function name="TexCoordPointerEXT" offset="assign">
- <param name="size" type="GLint"/>
- <param name="type" type="GLenum"/>
- <param name="stride" type="GLsizei"/>
- <param name="count" type="GLsizei"/>
- <param name="pointer" type="const GLvoid *"/>
- <glx handcode="true"/>
- </function>
-
- <function name="VertexPointerEXT" offset="assign">
- <param name="size" type="GLint"/>
- <param name="type" type="GLenum"/>
- <param name="stride" type="GLsizei"/>
- <param name="count" type="GLsizei"/>
- <param name="pointer" type="const GLvoid *"/>
- <glx handcode="true"/>
- </function>
-</category>
-
-<category name="GL_SGIS_generate_mipmap" number="32">
- <enum name="GENERATE_MIPMAP_SGIS" count="1" value="0x8191">
- <size name="TexParameterfv"/>
- <size name="TexParameteriv"/>
- <size name="GetTexParameterfv" mode="get"/>
- <size name="GetTexParameteriv" mode="get"/>
- </enum>
- <enum name="GENERATE_MIPMAP_HINT_SGIS" value="0x8192"/>
-</category>
-
-<category name="GL_SGIX_clipmap" number="33">
- <enum name="LINEAR_CLIPMAP_LINEAR_SGIX" value="0x8170"/>
- <enum name="TEXTURE_CLIPMAP_CENTER_SGIX" count="2" value="0x8171">
- <size name="TexParameterfv"/>
- <size name="TexParameteriv"/>
- <size name="GetTexParameterfv" mode="get"/>
- <size name="GetTexParameteriv" mode="get"/>
- </enum>
- <enum name="TEXTURE_CLIPMAP_FRAME_SGIX" count="1" value="0x8172">
- <size name="TexParameterfv"/>
- <size name="TexParameteriv"/>
- <size name="GetTexParameterfv" mode="get"/>
- <size name="GetTexParameteriv" mode="get"/>
- </enum>
- <enum name="TEXTURE_CLIPMAP_OFFSET_SGIX" count="2" value="0x8173">
- <size name="TexParameterfv"/>
- <size name="TexParameteriv"/>
- <size name="GetTexParameterfv" mode="get"/>
- <size name="GetTexParameteriv" mode="get"/>
- </enum>
- <enum name="TEXTURE_CLIPMAP_VIRTUAL_DEPTH_SGIX" count="3" value="0x8174">
- <size name="TexParameterfv"/>
- <size name="TexParameteriv"/>
- <size name="GetTexParameterfv" mode="get"/>
- <size name="GetTexParameteriv" mode="get"/>
- </enum>
- <enum name="TEXTURE_CLIPMAP_LOD_OFFSET_SGIX" value="0x8175"/>
- <enum name="TEXTURE_CLIPMAP_DEPTH_SGIX" value="0x8176"/>
- <enum name="MAX_CLIPMAP_DEPTH_SGIX" value="0x8177"/>
- <enum name="MAX_CLIPMAP_VIRTUAL_DEPTH_SGIX" value="0x8178"/>
- <enum name="NEAREST_CLIPMAP_NEAREST_SGIX" value="0x844D"/>
- <enum name="NEAREST_CLIPMAP_LINEAR_SGIX" value="0x844E"/>
- <enum name="LINEAR_CLIPMAP_NEAREST_SGIX" value="0x844F"/>
-</category>
-
-<category name="GL_SGIX_shadow" number="34">
- <enum name="TEXTURE_COMPARE_SGIX" count="1" value="0x819A">
- <size name="TexParameterfv"/>
- <size name="TexParameteriv"/>
- <size name="GetTexParameterfv" mode="get"/>
- <size name="GetTexParameteriv" mode="get"/>
- </enum>
- <enum name="TEXTURE_COMPARE_OPERATOR_SGIX" count="1" value="0x819B">
- <size name="TexParameterfv"/>
- <size name="TexParameteriv"/>
- <size name="GetTexParameterfv" mode="get"/>
- <size name="GetTexParameteriv" mode="get"/>
- </enum>
- <enum name="TEXTURE_LEQUAL_R_SGIX" value="0x819C"/>
- <enum name="TEXTURE_GEQUAL_R_SGIX" value="0x819D"/>
-</category>
-
-<category name="GL_SGIS_texture_edge_clamp" number="35">
- <enum name="CLAMP_TO_EDGE_SGIS" value="0x812F"/>
-</category>
-
-<category name="GL_SGIS_texture_border_clamp" number="36">
- <enum name="CLAMP_TO_BORDER_SGIS" value="0x812D"/>
-</category>
-
-<category name="GL_EXT_blend_minmax" number="37">
- <enum name="FUNC_ADD_EXT" value="0x8006"/>
- <enum name="MIN_EXT" value="0x8007"/>
- <enum name="MAX_EXT" value="0x8008"/>
- <enum name="BLEND_EQUATION_EXT" count="1" value="0x8009">
- <size name="Get" mode="get"/>
- </enum>
-
- <function name="BlendEquationEXT" alias="BlendEquation">
- <param name="mode" type="GLenum"/>
- </function>
-</category>
-
-<category name="GL_EXT_blend_subtract" number="38">
- <enum name="FUNC_SUBTRACT_EXT" value="0x800A"/>
- <enum name="FUNC_REVERSE_SUBTRACT_EXT" value="0x800B"/>
-
- <!-- <function name="BlendEquationEXT" alias="BlendEquation">
- <param name="mode" type="GLenum"/>
- </function> -->
-</category>
-
-<!-- Extension number 40 is a GLX extension. -->
-<!-- Extension number 41 is a GLX extension. -->
-<!-- Extension number 42 is a GLX extension. -->
-<!-- Extension number 43 is a GLX extension. -->
-<!-- Extension number 44 is a GLX extension. -->
-<!-- Extension number 46 is not listed in the extension registry. -->
-<!-- Extension number 47 is a GLX extension. -->
-<!-- Extension number 48 is not listed in the extension registry. -->
-<!-- Extension number 49 is a GLX extension. -->
-<!-- Extension number 50 is a GLX extension. -->
-
-<category name="GL_SGIX_sprite" number="52">
- <function name="SpriteParameterfSGIX">
- <param name="pname" type="GLenum"/>
- <param name="param" type="GLfloat"/>
- <glx ignore="true"/>
- </function>
-
- <function name="SpriteParameterfvSGIX">
- <param name="pname" type="GLenum"/>
- <param name="params" type="const GLfloat *"/>
- <glx ignore="true"/>
- </function>
-
- <function name="SpriteParameteriSGIX">
- <param name="pname" type="GLenum"/>
- <param name="param" type="GLint"/>
- <glx ignore="true"/>
- </function>
-
- <function name="SpriteParameterivSGIX">
- <param name="pname" type="GLenum"/>
- <param name="params" type="const GLint *"/>
- <glx ignore="true"/>
- </function>
-</category>
-
-<category name="GL_EXT_point_parameters" number="54">
- <enum name="POINT_SIZE_MIN_EXT" count="1" value="0x8126">
- <size name="PointParameterfvEXT"/>
- </enum>
- <enum name="POINT_SIZE_MAX_EXT" count="1" value="0x8127">
- <size name="PointParameterfvEXT"/>
- </enum>
- <enum name="POINT_FADE_THRESHOLD_SIZE_EXT" count="1" value="0x8128">
- <size name="PointParameterfvEXT"/>
- </enum>
- <enum name="POINT_DISTANCE_ATTENUATION_EXT" count="3" value="0x8129">
- <size name="PointParameterfvEXT"/>
- </enum>
-
- <function name="PointParameterfEXT" offset="assign">
- <param name="pname" type="GLenum"/>
- <param name="param" type="GLfloat"/>
- <glx rop="2065"/>
- </function>
-
- <function name="PointParameterfvEXT" offset="assign">
- <param name="pname" type="GLenum"/>
- <param name="params" type="const GLfloat *" variable_param="pname"/>
- <glx rop="2066"/>
- </function>
-</category>
-
-<category name="GL_SGIX_instruments" number="55">
- <function name="GetInstrumentsSGIX">
- <return type="GLint"/>
- <glx ignore="true"/>
- </function>
-
- <function name="InstrumentsBufferSGIX">
- <param name="size" type="GLsizei"/>
- <param name="buffer" type="GLint *" output="true"/>
- <glx ignore="true"/>
- </function>
-
- <function name="PollInstrumentsSGIX">
- <param name="marker_p" type="GLint *" output="true"/>
- <return type="GLint"/>
- <glx ignore="true"/>
- </function>
-
- <function name="ReadInstrumentsSGIX">
- <param name="marker" type="GLint"/>
- <glx ignore="true"/>
- </function>
-
- <function name="StartInstrumentsSGIX">
- <glx ignore="true"/>
- </function>
-
- <function name="StopInstrumentsSGIX">
- <param name="marker" type="GLint"/>
- <glx ignore="true"/>
- </function>
-</category>
-
-<category name="GL_SGIX_texture_scale_bias" number="56">
- <enum name="POST_TEXTURE_FILTER_BIAS_SGIX" count="4" value="0x8179">
- <size name="TexParameterfv"/>
- <size name="TexParameteriv"/>
- <size name="GetTexParameterfv" mode="get"/>
- <size name="GetTexParameteriv" mode="get"/>
- </enum>
- <enum name="POST_TEXTURE_FILTER_SCALE_SGIX" count="4" value="0x817A">
- <size name="TexParameterfv"/>
- <size name="TexParameteriv"/>
- <size name="GetTexParameterfv" mode="get"/>
- <size name="GetTexParameteriv" mode="get"/>
- </enum>
- <enum name="POST_TEXTURE_FILTER_BIAS_RANGE_SGIX" value="0x817B"/>
- <enum name="POST_TEXTURE_FILTER_SCALE_RANGE_SGIX" value="0x817C"/>
-</category>
-
-<category name="GL_SGIX_framezoom" number="57">
- <function name="FrameZoomSGIX">
- <param name="factor" type="GLint"/>
- <glx rop="2072" ignore="true"/>
- </function>
-</category>
-
-<category name="GL_SGIX_tag_sample_buffer" number="58">
- <function name="TagSampleBufferSGIX">
- <glx rop="2050" ignore="true"/>
- </function>
-</category>
-
-<!-- Extension number 59 is not listed in the extension registry. -->
-
-<category name="GL_SGIX_reference_plane" number="60">
- <function name="ReferencePlaneSGIX">
- <param name="equation" type="const GLdouble *" count="4"/>
- <glx rop="2071" ignore="true"/>
- </function>
-</category>
-
-<category name="GL_SGIX_flush_raster" number="61">
- <function name="FlushRasterSGIX">
- <glx vendorpriv="4105" ignore="true"/>
- </function>
-</category>
-
-<!-- Extension number 62 is a GLX extension. -->
-
-<category name="GL_SGIX_depth_texture" number="63">
- <enum name="DEPTH_COMPONENT16_SGIX" value="0x81A5"/>
- <enum name="DEPTH_COMPONENT24_SGIX" value="0x81A6"/>
- <enum name="DEPTH_COMPONENT32_SGIX" value="0x81A7"/>
-</category>
-
-<category name="GL_SGIS_fog_function" number="64">
- <function name="FogFuncSGIS">
- <param name="n" type="GLsizei" counter="true"/>
- <param name="points" type="const GLfloat *" count="n" count_scale="2"/>
- <glx rop="2067" ignore="true"/>
- </function>
-
- <function name="GetFogFuncSGIS">
- <param name="points" type="GLfloat *" output="true"/>
- <!-- GLX protocol for this function is unknown. -->
- </function>
-</category>
-
-<category name="GL_SGIX_fog_offset" number="65">
- <enum name="FOG_OFFSET_SGIX" value="0x8198"/>
- <enum name="FOG_OFFSET_VALUE_SGIX" count="1" value="0x8199">
- <size name="Fogfv"/>
- <size name="Fogiv"/>
- </enum>
-</category>
-
-<category name="GL_HP_image_transform" number="66">
- <function name="ImageTransformParameteriHP">
- <param name="target" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="param" type="GLint"/>
- </function>
-
- <function name="ImageTransformParameterfHP">
- <param name="target" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="param" type="GLfloat"/>
- </function>
-
- <function name="ImageTransformParameterivHP">
- <param name="target" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="const GLint *"/>
- </function>
-
- <function name="ImageTransformParameterfvHP">
- <param name="target" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="const GLfloat *"/>
- </function>
-
- <function name="GetImageTransformParameterivHP">
- <param name="target" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLint *" output="true" variable_param="pname"/>
- </function>
-
- <function name="GetImageTransformParameterfvHP">
- <param name="target" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLfloat *" output="true" variable_param="pname"/>
- </function>
-</category>
-
-<category name="GL_HP_convolution_border_modes" number="67">
- <enum name="IGNORE_BORDER_HP" value="0x8150"/>
- <enum name="CONSTANT_BORDER_HP" value="0x8151"/>
- <enum name="REPLICATE_BORDER_HP" value="0x8153"/>
- <enum name="CONVOLUTION_BORDER_COLOR_HP" count="4" value="0x8154">
- <size name="ConvolutionParameterfv"/>
- <size name="ConvolutionParameteriv"/>
- <size name="GetConvolutionParameterfv" mode="get"/>
- <size name="GetConvolutionParameteriv" mode="get"/>
- </enum>
-</category>
-
-<!-- Extension number 68 is not listed in the extension registry. -->
-<!-- Extension number 70 is not listed in the extension registry. -->
-<!-- Extension number 71 is not listed in the extension registry. -->
-<!-- Extension number 72 is not listed in the extension registry. -->
-<!-- Extension number 73 is not listed in the extension registry. -->
-
-<category name="GL_EXT_color_subtable" number="74">
- <function name="ColorSubTableEXT" alias="ColorSubTable" static_dispatch="false">
- <param name="target" type="GLenum"/>
- <param name="start" type="GLsizei"/>
- <param name="count" type="GLsizei"/>
- <param name="format" type="GLenum"/>
- <param name="type" type="GLenum"/>
- <param name="data" type="const GLvoid *"/>
- </function>
-
- <function name="CopyColorSubTableEXT" alias="CopyColorSubTable" static_dispatch="false">
- <param name="target" type="GLenum"/>
- <param name="start" type="GLsizei"/>
- <param name="x" type="GLint"/>
- <param name="y" type="GLint"/>
- <param name="width" type="GLsizei"/>
- </function>
-</category>
-
-<!-- Extension number 75 is a GLU extension. -->
-
-<category name="GL_PGI_misc_hints" number="77">
- <function name="HintPGI">
- <param name="target" type="GLenum"/>
- <param name="mode" type="GLint"/>
- <glx ignore="true"/>
- </function>
-</category>
-
-<category name="GL_EXT_paletted_texture" number="78">
- <enum name="COLOR_TABLE_FORMAT_EXT" count="1" value="0x80D8">
- <size name="GetColorTableParameterfv" mode="get"/>
- <size name="GetColorTableParameteriv" mode="get"/>
- </enum>
- <enum name="COLOR_TABLE_WIDTH_EXT" count="1" value="0x80D9">
- <size name="GetColorTableParameterfv" mode="get"/>
- <size name="GetColorTableParameteriv" mode="get"/>
- </enum>
- <enum name="COLOR_TABLE_RED_SIZE_EXT" count="1" value="0x80DA">
- <size name="GetColorTableParameterfv" mode="get"/>
- <size name="GetColorTableParameteriv" mode="get"/>
- </enum>
- <enum name="COLOR_TABLE_GREEN_SIZE_EXT" count="1" value="0x80DB">
- <size name="GetColorTableParameterfv" mode="get"/>
- <size name="GetColorTableParameteriv" mode="get"/>
- </enum>
- <enum name="COLOR_TABLE_BLUE_SIZE_EXT" count="1" value="0x80DC">
- <size name="GetColorTableParameterfv" mode="get"/>
- <size name="GetColorTableParameteriv" mode="get"/>
- </enum>
- <enum name="COLOR_TABLE_ALPHA_SIZE_EXT" count="1" value="0x80DD">
- <size name="GetColorTableParameterfv" mode="get"/>
- <size name="GetColorTableParameteriv" mode="get"/>
- </enum>
- <enum name="COLOR_TABLE_LUMINANCE_SIZE_EXT" count="1" value="0x80DE">
- <size name="GetColorTableParameterfv" mode="get"/>
- <size name="GetColorTableParameteriv" mode="get"/>
- </enum>
- <enum name="COLOR_TABLE_INTENSITY_SIZE_EXT" count="1" value="0x80DF">
- <size name="GetColorTableParameterfv" mode="get"/>
- <size name="GetColorTableParameteriv" mode="get"/>
- </enum>
- <enum name="TEXTURE_INDEX_SIZE_EXT" count="1" value="0x80ED">
- <size name="GetTexLevelParameterfv" mode="get"/>
- <size name="GetTexLevelParameteriv" mode="get"/>
- </enum>
-
- <function name="ColorTableEXT" alias="ColorTable">
- <param name="target" type="GLenum"/>
- <param name="internalformat" type="GLenum"/>
- <param name="width" type="GLsizei"/>
- <param name="format" type="GLenum"/>
- <param name="type" type="GLenum"/>
- <param name="table" type="const GLvoid *"/>
- </function>
-
- <function name="GetColorTableEXT" alias="GetColorTable">
- <param name="target" type="GLenum"/>
- <param name="format" type="GLenum"/>
- <param name="type" type="GLenum"/>
- <param name="table" type="GLvoid *" output="true" img_width="width" img_format="format" img_type="type"/>
- <glx vendorpriv="4098" dimensions_in_reply="true"/>
- </function>
-
- <function name="GetColorTableParameterivEXT" alias="GetColorTableParameteriv">
- <param name="target" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLint *" output="true" variable_param="pname"/>
- <glx vendorpriv="4100"/>
- </function>
-
- <function name="GetColorTableParameterfvEXT" alias="GetColorTableParameterfv">
- <param name="target" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLfloat *" output="true" variable_param="pname"/>
- <glx vendorpriv="4099"/>
- </function>
-</category>
-
-<category name="GL_EXT_clip_volume_hint" number="79">
- <enum name="CLIP_VOLUME_CLIPPING_HINT_EXT" count="1" value="0x80F0">
- <size name="Get" mode="get"/>
- </enum>
-</category>
-
-<category name="GL_SGIX_list_priority" number="80">
- <function name="GetListParameterfvSGIX">
- <param name="list" type="GLuint"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLfloat *" output="true" variable_param="pname"/>
- <glx ignore="true"/>
- </function>
-
- <function name="GetListParameterivSGIX">
- <param name="list" type="GLuint"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLint *" output="true" variable_param="pname"/>
- <glx ignore="true"/>
- </function>
-
- <function name="ListParameterfSGIX">
- <param name="list" type="GLuint"/>
- <param name="pname" type="GLenum"/>
- <param name="param" type="GLfloat"/>
- <glx ignore="true"/>
- </function>
-
- <function name="ListParameterfvSGIX">
- <param name="list" type="GLuint"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="const GLfloat *"/>
- <glx ignore="true"/>
- </function>
-
- <function name="ListParameteriSGIX">
- <param name="list" type="GLuint"/>
- <param name="pname" type="GLenum"/>
- <param name="param" type="GLint"/>
- <glx ignore="true"/>
- </function>
-
- <function name="ListParameterivSGIX">
- <param name="list" type="GLuint"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="const GLint *"/>
- <glx ignore="true"/>
- </function>
-</category>
-
-<!-- Extension number 82 is not listed in the extension registry. -->
-<!-- Extension number 83 is a GLX extension. -->
-
-<category name="GL_SGIX_texture_lod_bias" number="84">
- <enum name="TEXTURE_LOD_BIAS_S_SGIX" count="1" value="0x818E">
- <size name="TexParameterfv"/>
- <size name="TexParameteriv"/>
- <size name="GetTexParameterfv" mode="get"/>
- <size name="GetTexParameteriv" mode="get"/>
- </enum>
- <enum name="TEXTURE_LOD_BIAS_T_SGIX" count="1" value="0x818F">
- <size name="TexParameterfv"/>
- <size name="TexParameteriv"/>
- <size name="GetTexParameterfv" mode="get"/>
- <size name="GetTexParameteriv" mode="get"/>
- </enum>
- <enum name="TEXTURE_LOD_BIAS_R_SGIX" count="1" value="0x8190">
- <size name="TexParameterfv"/>
- <size name="TexParameteriv"/>
- <size name="GetTexParameterfv" mode="get"/>
- <size name="GetTexParameteriv" mode="get"/>
- </enum>
-</category>
-
-<!-- Extension number 85 is a GLU extension. -->
-<!-- Extension number 86 is a GLX extension. -->
-<!-- Extension number 87 is not listed in the extension registry. -->
-<!-- Extension number 88 is not listed in the extension registry. -->
-<!-- Extension number 89 is not listed in the extension registry. -->
-
-
-<category name="GL_SGIX_shadow_ambient" number="90">
- <enum name="SHADOW_AMBIENT_SGIX" count="1" value="0x80BF">
- <size name="TexParameterfv"/>
- <size name="TexParameteriv"/>
- <size name="GetTexParameterfv" mode="get"/>
- <size name="GetTexParameteriv" mode="get"/>
- </enum>
-</category>
-
-<!-- Extension number 91 is a GLX extension. -->
-<!-- Extension number 92 is a GLX extension. -->
-
-<category name="GL_EXT_index_material" number="94">
- <function name="IndexMaterialEXT">
- <param name="face" type="GLenum"/>
- <param name="mode" type="GLenum"/>
- <glx ignore="true"/>
- </function>
-</category>
-
-<category name="GL_EXT_index_func" number="95">
- <function name="IndexFuncEXT">
- <param name="func" type="GLenum"/>
- <param name="ref" type="GLclampf"/>
- <glx ignore="true"/>
- </function>
-</category>
-
-<category name="GL_EXT_compiled_vertex_array" number="97">
- <function name="LockArraysEXT" offset="assign">
- <param name="first" type="GLint"/>
- <param name="count" type="GLsizei"/>
- <glx handcode="true" ignore="true"/>
- </function>
-
- <function name="UnlockArraysEXT" offset="assign">
- <glx handcode="true" ignore="true"/>
- </function>
-</category>
-
-<category name="GL_EXT_cull_vertex" number="98">
- <enum name="CULL_VERTEX_EXT" value="0x81AA"/>
- <enum name="CULL_VERTEX_OBJECT_POSITION_EXT" count="4" value="0x81AB">
- <size name="CullParameterfv"/>
- <size name="CullParameterdv"/>
- </enum>
- <enum name="CULL_VERTEX_EYE_POSITION_EXT" count="4" value="0x81AC">
- <size name="CullParameterfv"/>
- <size name="CullParameterdv"/>
- </enum>
-
- <function name="CullParameterdvEXT">
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLdouble *"/> <!-- Spec bug. Should be const. -->
- <glx ignore="true"/>
- </function>
-
- <function name="CullParameterfvEXT">
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLfloat *"/> <!-- Spec bug. Should be const. -->
- <glx ignore="true"/>
- </function>
-</category>
-
-<!-- Extension number 99 is not listed in the extension registry. -->
-<!-- Extension number 100 is a GLU extension. -->
-
-<!-- Shouldn't this be EXT_fragment_lighting? -->
-<category name="GL_SGIX_fragment_lighting" number="102">
- <function name="FragmentColorMaterialSGIX">
- <param name="face" type="GLenum"/>
- <param name="mode" type="GLenum"/>
- <glx ignore="true"/>
- </function>
-
- <function name="FragmentLightfSGIX">
- <param name="light" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="param" type="GLfloat"/>
- <glx ignore="true"/>
- </function>
-
- <function name="FragmentLightfvSGIX">
- <param name="light" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="const GLfloat *"/>
- <glx ignore="true"/>
- </function>
-
- <function name="FragmentLightiSGIX">
- <param name="light" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="param" type="GLint"/>
- <glx ignore="true"/>
- </function>
-
- <function name="FragmentLightivSGIX">
- <param name="light" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="const GLint *"/>
- <glx ignore="true"/>
- </function>
-
- <function name="FragmentLightModelfSGIX">
- <param name="pname" type="GLenum"/>
- <param name="param" type="GLfloat"/>
- <glx ignore="true"/>
- </function>
-
- <function name="FragmentLightModelfvSGIX">
- <param name="pname" type="GLenum"/>
- <param name="params" type="const GLfloat *"/>
- <glx ignore="true"/>
- </function>
-
- <function name="FragmentLightModeliSGIX">
- <param name="pname" type="GLenum"/>
- <param name="param" type="GLint"/>
- <glx ignore="true"/>
- </function>
-
- <function name="FragmentLightModelivSGIX">
- <param name="pname" type="GLenum"/>
- <param name="params" type="const GLint *"/>
- <glx ignore="true"/>
- </function>
-
- <function name="FragmentMaterialfSGIX">
- <param name="face" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="param" type="GLfloat"/>
- <glx ignore="true"/>
- </function>
-
- <function name="FragmentMaterialfvSGIX">
- <param name="face" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="const GLfloat *"/>
- <glx ignore="true"/>
- </function>
-
- <function name="FragmentMaterialiSGIX">
- <param name="face" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="param" type="GLint"/>
- <glx ignore="true"/>
- </function>
-
- <function name="FragmentMaterialivSGIX">
- <param name="face" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="const GLint *"/>
- <glx ignore="true"/>
- </function>
-
- <function name="GetFragmentLightfvSGIX">
- <param name="light" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLfloat *" output="true" variable_param="pname"/>
- <glx ignore="true"/>
- </function>
-
- <function name="GetFragmentLightivSGIX">
- <param name="light" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLint *" output="true" variable_param="pname"/>
- <glx ignore="true"/>
- </function>
-
- <function name="GetFragmentMaterialfvSGIX">
- <param name="face" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLfloat *" output="true" variable_param="pname"/>
- <glx ignore="true"/>
- </function>
-
- <function name="GetFragmentMaterialivSGIX">
- <param name="face" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLint *" output="true" variable_param="pname"/>
- <glx ignore="true"/>
- </function>
-
- <function name="LightEnviSGIX">
- <param name="pname" type="GLenum"/>
- <param name="param" type="GLint"/>
- <glx ignore="true"/>
- </function>
-</category>
-
-<!-- Extension number 103 is not listed in the extension registry. -->
-<!-- Extension number 104 is not listed in the extension registry. -->
-<!-- Extension number 105 is not listed in the extension registry. -->
-<!-- Extension number 106 is not listed in the extension registry. -->
-<!-- Extension number 107 is not listed in the extension registry. -->
-<!-- Extension number 108 is not listed in the extension registry. -->
-<!-- Extension number 109 is not listed in the extension registry. -->
-
-<category name="GL_IBM_rasterpos_clip" number="110">
- <enum name="RASTER_POSITION_UNCLIPPED_IBM" count="1" value="0x19262">
- <size name="Get" mode="get"/>
- </enum>
-</category>
-
-<category name="GL_EXT_draw_range_elements" number="112">
- <function name="DrawRangeElementsEXT" alias="DrawRangeElements">
- <param name="mode" type="GLenum"/>
- <param name="start" type="GLuint"/>
- <param name="end" type="GLuint"/>
- <param name="count" type="GLsizei"/>
- <param name="type" type="GLenum"/>
- <param name="indices" type="const GLvoid *"/>
- <glx handcode="true"/>
- </function>
-</category>
-
-<!-- Extension number 115 is a GLX extension. -->
-<!-- Extension number 116 is not listed in the extension registry. -->
-
-<category name="GL_EXT_light_texture" number="117">
- <function name="ApplyTextureEXT">
- <param name="mode" type="GLenum"/>
- </function>
-
- <function name="TextureLightEXT">
- <param name="pname" type="GLenum"/>
- </function>
-
- <function name="TextureMaterialEXT">
- <param name="face" type="GLenum"/>
- <param name="mode" type="GLenum"/>
- </function>
-</category>
-
-<!-- Extension number 118 is not listed in the extension registry. -->
-<!-- Extension number 121 is not listed in the extension registry. -->
-<!-- Extension number 122 is not listed in the extension registry. -->
-<!-- Extension number 123 is not listed in the extension registry. -->
-<!-- Extension number 124 is not listed in the extension registry. -->
-<!-- Extension number 125 is not listed in the extension registry. -->
-<!-- Extension number 126 is not listed in the extension registry. -->
-<!-- Extension number 128 is not listed in the extension registry. -->
-<!-- Extension number 130 is not listed in the extension registry. -->
-<!-- Extension number 131 is not listed in the extension registry. -->
-
-<category name="GL_SGIX_async" number="132">
- <function name="AsyncMarkerSGIX">
- <param name="marker" type="GLuint"/>
- </function>
-
- <function name="FinishAsyncSGIX">
- <param name="markerp" type="GLuint *"/> <!-- Spec bug. Should be const. -->
- <return type="GLint"/>
- </function>
-
- <function name="PollAsyncSGIX">
- <param name="markerp" type="GLuint *"/> <!-- Spec bug. Should be const. -->
- <return type="GLint"/>
- </function>
-
- <function name="GenAsyncMarkersSGIX">
- <param name="range" type="GLsizei"/>
- <return type="GLuint"/>
- </function>
-
- <function name="DeleteAsyncMarkersSGIX">
- <param name="marker" type="GLuint"/>
- <param name="range" type="GLsizei"/>
- </function>
-
- <function name="IsAsyncMarkerSGIX">
- <param name="marker" type="GLuint"/>
- <return type="GLboolean"/>
- </function>
-</category>
-
-<category name="GL_INTEL_parallel_arrays" number="136">
- <function name="VertexPointervINTEL">
- <param name="size" type="GLint"/>
- <param name="type" type="GLenum"/>
- <param name="pointer" type="const GLvoid **"/>
- </function>
-
- <function name="NormalPointervINTEL">
- <param name="type" type="GLenum"/>
- <param name="pointer" type="const GLvoid **"/>
- </function>
-
- <function name="ColorPointervINTEL">
- <param name="size" type="GLint"/>
- <param name="type" type="GLenum"/>
- <param name="pointer" type="const GLvoid **"/>
- </function>
-
- <function name="TexCoordPointervINTEL">
- <param name="size" type="GLint"/>
- <param name="type" type="GLenum"/>
- <param name="pointer" type="const GLvoid **"/>
- </function>
-</category>
-
-<category name="GL_HP_occlusion_test" number="137">
- <enum name="OCCLUSION_TEST_HP" count="1" value="0x8165">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="OCCLUSION_TEST_RESULT_HP" count="1" value="0x8166">
- <size name="Get" mode="get"/>
- </enum>
-</category>
-
-<category name="GL_EXT_pixel_transform" number="138">
- <function name="PixelTransformParameteriEXT">
- <param name="target" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="param" type="GLint"/>
- </function>
-
- <function name="PixelTransformParameterfEXT">
- <param name="target" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="param" type="GLfloat"/>
- </function>
-
- <function name="PixelTransformParameterivEXT">
- <param name="target" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="const GLint *"/>
- </function>
-
- <function name="PixelTransformParameterfvEXT">
- <param name="target" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="const GLfloat *"/>
- </function>
-</category>
-
-<!-- Extension number 140 is not listed in the extension registry. -->
-
-<category name="GL_EXT_shared_texture_palette" number="141">
- <enum name="SHARED_TEXTURE_PALETTE_EXT" count="1" value="0x81FB"/>
-</category>
-
-<!-- Extension number 142 is a GLX extension. -->
-<!-- Extension number 143 is not listed in the extension registry. -->
-
-<category name="GL_EXT_separate_specular_color" number="144">
- <enum name="LIGHT_MODEL_COLOR_CONTROL_EXT" count="1" value="0x81F8">
- <size name="LightModelfv"/>
- <size name="LightModeliv"/>
- </enum>
- <enum name="SINGLE_COLOR_EXT" value="0x81F9"/>
- <enum name="SEPARATE_SPECULAR_COLOR_EXT" value="0x81FA"/>
-</category>
-
-<category name="GL_EXT_secondary_color" number="145">
- <function name="SecondaryColor3bEXT" offset="assign" vectorequiv="SecondaryColor3bvEXT">
- <param name="red" type="GLbyte"/>
- <param name="green" type="GLbyte"/>
- <param name="blue" type="GLbyte"/>
- </function>
-
- <function name="SecondaryColor3bvEXT" offset="assign">
- <param name="v" type="const GLbyte *" count="3"/>
- <glx rop="4126"/>
- </function>
-
- <function name="SecondaryColor3dEXT" offset="assign" vectorequiv="SecondaryColor3dvEXT">
- <param name="red" type="GLdouble"/>
- <param name="green" type="GLdouble"/>
- <param name="blue" type="GLdouble"/>
- </function>
-
- <function name="SecondaryColor3dvEXT" offset="assign">
- <param name="v" type="const GLdouble *" count="3"/>
- <glx rop="4130"/>
- </function>
-
- <function name="SecondaryColor3fEXT" offset="assign" vectorequiv="SecondaryColor3fvEXT">
- <param name="red" type="GLfloat"/>
- <param name="green" type="GLfloat"/>
- <param name="blue" type="GLfloat"/>
- </function>
-
- <function name="SecondaryColor3fvEXT" offset="assign">
- <param name="v" type="const GLfloat *" count="3"/>
- <glx rop="4129"/>
- </function>
-
- <function name="SecondaryColor3iEXT" offset="assign" vectorequiv="SecondaryColor3ivEXT">
- <param name="red" type="GLint"/>
- <param name="green" type="GLint"/>
- <param name="blue" type="GLint"/>
- </function>
-
- <function name="SecondaryColor3ivEXT" offset="assign">
- <param name="v" type="const GLint *" count="3"/>
- <glx rop="4128"/>
- </function>
-
- <function name="SecondaryColor3sEXT" offset="assign" vectorequiv="SecondaryColor3svEXT">
- <param name="red" type="GLshort"/>
- <param name="green" type="GLshort"/>
- <param name="blue" type="GLshort"/>
- </function>
-
- <function name="SecondaryColor3svEXT" offset="assign">
- <param name="v" type="const GLshort *" count="3"/>
- <glx rop="4127"/>
- </function>
-
- <function name="SecondaryColor3ubEXT" offset="assign" vectorequiv="SecondaryColor3ubvEXT">
- <param name="red" type="GLubyte"/>
- <param name="green" type="GLubyte"/>
- <param name="blue" type="GLubyte"/>
- </function>
-
- <function name="SecondaryColor3ubvEXT" offset="assign">
- <param name="v" type="const GLubyte *" count="3"/>
- <glx rop="4131"/>
- </function>
-
- <function name="SecondaryColor3uiEXT" offset="assign" vectorequiv="SecondaryColor3uivEXT">
- <param name="red" type="GLuint"/>
- <param name="green" type="GLuint"/>
- <param name="blue" type="GLuint"/>
- </function>
-
- <function name="SecondaryColor3uivEXT" offset="assign">
- <param name="v" type="const GLuint *" count="3"/>
- <glx rop="4133"/>
- </function>
-
- <function name="SecondaryColor3usEXT" offset="assign" vectorequiv="SecondaryColor3usvEXT">
- <param name="red" type="GLushort"/>
- <param name="green" type="GLushort"/>
- <param name="blue" type="GLushort"/>
- </function>
-
- <function name="SecondaryColor3usvEXT" offset="assign">
- <param name="v" type="const GLushort *" count="3"/>
- <glx rop="4132"/>
- </function>
-
- <function name="SecondaryColorPointerEXT" offset="assign">
- <param name="size" type="GLint"/>
- <param name="type" type="GLenum"/>
- <param name="stride" type="GLsizei"/>
- <param name="pointer" type="const GLvoid *"/>
- <glx handcode="true"/>
- </function>
-</category>
-
-<category name="GL_EXT_texture_perturb_normal" number="147">
- <function name="TextureNormalEXT">
- <param name="mode" type="GLenum"/>
- </function>
-</category>
-
-<category name="GL_EXT_multi_draw_arrays" number="148">
- <function name="MultiDrawArraysEXT" offset="assign">
- <param name="mode" type="GLenum"/>
- <param name="first" type="const GLint *"/>
- <param name="count" type="const GLsizei *"/>
- <param name="primcount" type="GLsizei"/>
- <glx handcode="true"/>
- </function>
-
- <function name="MultiDrawElementsEXT" offset="assign">
- <param name="mode" type="GLenum"/>
- <param name="count" type="const GLsizei *"/>
- <param name="type" type="GLenum"/>
- <param name="indices" type="const GLvoid **"/>
- <param name="primcount" type="GLsizei"/>
- <glx handcode="true"/>
- </function>
-</category>
-
-<category name="GL_EXT_fog_coord" number="149">
- <function name="FogCoordfEXT" offset="assign" vectorequiv="FogCoordfvEXT">
- <param name="coord" type="GLfloat"/>
- </function>
-
- <function name="FogCoordfvEXT" offset="assign">
- <param name="coord" type="const GLfloat *" count="1"/>
- <glx rop="4124"/>
- </function>
-
- <function name="FogCoorddEXT" offset="assign" vectorequiv="FogCoorddvEXT">
- <param name="coord" type="GLdouble"/>
- </function>
-
- <function name="FogCoorddvEXT" offset="assign">
- <param name="coord" type="const GLdouble *" count="1"/>
- <glx rop="4125"/>
- </function>
-
- <function name="FogCoordPointerEXT" offset="assign">
- <param name="type" type="GLenum"/>
- <param name="stride" type="GLsizei"/>
- <param name="pointer" type="const GLvoid *"/>
- <glx handcode="true"/>
- </function>
-</category>
-
-<!-- Extension number 150 is not listed in the extension registry. -->
-<!-- Extension number 151 is not listed in the extension registry. -->
-<!-- Extension number 152 is not listed in the extension registry. -->
-<!-- Extension number 153 is not listed in the extension registry. -->
-<!-- Extension number 154 is not listed in the extension registry. -->
-
-<category name="GL_EXT_coordinate_frame" number="156">
- <function name="Tangent3bEXT">
- <param name="tx" type="GLbyte"/>
- <param name="ty" type="GLbyte"/>
- <param name="tz" type="GLbyte"/>
- </function>
-
- <function name="Tangent3bvEXT">
- <param name="v" type="const GLbyte *"/>
- </function>
-
- <function name="Tangent3dEXT">
- <param name="tx" type="GLdouble"/>
- <param name="ty" type="GLdouble"/>
- <param name="tz" type="GLdouble"/>
- </function>
-
- <function name="Tangent3dvEXT">
- <param name="v" type="const GLdouble *"/>
- </function>
-
- <function name="Tangent3fEXT">
- <param name="tx" type="GLfloat"/>
- <param name="ty" type="GLfloat"/>
- <param name="tz" type="GLfloat"/>
- </function>
-
- <function name="Tangent3fvEXT">
- <param name="v" type="const GLfloat *"/>
- </function>
-
- <function name="Tangent3iEXT">
- <param name="tx" type="GLint"/>
- <param name="ty" type="GLint"/>
- <param name="tz" type="GLint"/>
- </function>
-
- <function name="Tangent3ivEXT">
- <param name="v" type="const GLint *"/>
- </function>
-
- <function name="Tangent3sEXT">
- <param name="tx" type="GLshort"/>
- <param name="ty" type="GLshort"/>
- <param name="tz" type="GLshort"/>
- </function>
-
- <function name="Tangent3svEXT">
- <param name="v" type="const GLshort *"/>
- </function>
-
- <function name="Binormal3bEXT">
- <param name="bx" type="GLbyte"/>
- <param name="by" type="GLbyte"/>
- <param name="bz" type="GLbyte"/>
- </function>
-
- <function name="Binormal3bvEXT">
- <param name="v" type="const GLbyte *"/>
- </function>
-
- <function name="Binormal3dEXT">
- <param name="bx" type="GLdouble"/>
- <param name="by" type="GLdouble"/>
- <param name="bz" type="GLdouble"/>
- </function>
-
- <function name="Binormal3dvEXT">
- <param name="v" type="const GLdouble *"/>
- </function>
-
- <function name="Binormal3fEXT">
- <param name="bx" type="GLfloat"/>
- <param name="by" type="GLfloat"/>
- <param name="bz" type="GLfloat"/>
- </function>
-
- <function name="Binormal3fvEXT">
- <param name="v" type="const GLfloat *"/>
- </function>
-
- <function name="Binormal3iEXT">
- <param name="bx" type="GLint"/>
- <param name="by" type="GLint"/>
- <param name="bz" type="GLint"/>
- </function>
-
- <function name="Binormal3ivEXT">
- <param name="v" type="const GLint *"/>
- </function>
-
- <function name="Binormal3sEXT">
- <param name="bx" type="GLshort"/>
- <param name="by" type="GLshort"/>
- <param name="bz" type="GLshort"/>
- </function>
-
- <function name="Binormal3svEXT">
- <param name="v" type="const GLshort *"/>
- </function>
-
- <function name="TangentPointerEXT">
- <param name="type" type="GLenum"/>
- <param name="stride" type="GLsizei"/>
- <param name="pointer" type="const GLvoid *"/>
- </function>
-
- <function name="BinormalPointerEXT">
- <param name="type" type="GLenum"/>
- <param name="stride" type="GLsizei"/>
- <param name="pointer" type="const GLvoid *"/>
- </function>
-</category>
-
-<!-- Extension number 157 is not listed in the extension registry. -->
-
-<category name="GL_EXT_texture_env_combine" number="158">
- <enum name="COMBINE_EXT" value="0x8570"/>
- <enum name="COMBINE_RGB_EXT" count="1" value="0x8571"/>
- <enum name="COMBINE_ALPHA_EXT" count="1" value="0x8572"/>
- <enum name="RGB_SCALE_EXT" count="1" value="0x8573"/>
- <enum name="ADD_SIGNED_EXT" value="0x8574"/>
- <enum name="INTERPOLATE_EXT" value="0x8575"/>
- <enum name="CONSTANT_EXT" value="0x8576"/>
- <enum name="PRIMARY_COLOR_EXT" value="0x8577"/>
- <enum name="PREVIOUS_EXT" value="0x8578"/>
- <enum name="SOURCE0_RGB_EXT" count="1" value="0x8580"/>
- <enum name="SOURCE1_RGB_EXT" count="1" value="0x8581"/>
- <enum name="SOURCE2_RGB_EXT" count="1" value="0x8582"/>
- <enum name="SOURCE0_ALPHA_EXT" count="1" value="0x8588"/>
- <enum name="SOURCE1_ALPHA_EXT" count="1" value="0x8589"/>
- <enum name="SOURCE2_ALPHA_EXT" count="1" value="0x858A"/>
- <enum name="OPERAND0_RGB_EXT" count="1" value="0x8590"/>
- <enum name="OPERAND1_RGB_EXT" count="1" value="0x8591"/>
- <enum name="OPERAND2_RGB_EXT" count="1" value="0x8592"/>
- <enum name="OPERAND0_ALPHA_EXT" count="1" value="0x8598"/>
- <enum name="OPERAND1_ALPHA_EXT" count="1" value="0x8599"/>
- <enum name="OPERAND2_ALPHA_EXT" count="1" value="0x859A"/>
-</category>
-
-<category name="GL_SGIX_pixel_texture" number="160">
- <function name="PixelTexGenSGIX" offset="assign" static_dispatch="false">
- <param name="mode" type="GLenum"/>
- <glx rop="2059" ignore="true"/>
- </function>
-</category>
-
-<!-- Extension number 161 is not listed in the extension registry. -->
-<!-- Extension number 162 is not listed in the extension registry. -->
-
-<category name="GL_SUNX_constant_data" number="163">
- <function name="FinishTextureSUNX">
- </function>
-</category>
-
-<category name="GL_SUN_global_alpha" number="164">
- <function name="GlobalAlphaFactorbSUN">
- <param name="factor" type="GLbyte"/>
- </function>
-
- <function name="GlobalAlphaFactorsSUN">
- <param name="factor" type="GLshort"/>
- </function>
-
- <function name="GlobalAlphaFactoriSUN">
- <param name="factor" type="GLint"/>
- </function>
-
- <function name="GlobalAlphaFactorfSUN">
- <param name="factor" type="GLfloat"/>
- </function>
-
- <function name="GlobalAlphaFactordSUN">
- <param name="factor" type="GLdouble"/>
- </function>
-
- <function name="GlobalAlphaFactorubSUN">
- <param name="factor" type="GLubyte"/>
- </function>
-
- <function name="GlobalAlphaFactorusSUN">
- <param name="factor" type="GLushort"/>
- </function>
-
- <function name="GlobalAlphaFactoruiSUN">
- <param name="factor" type="GLuint"/>
- </function>
-</category>
-
-<category name="GL_SUN_triangle_list" number="165">
- <function name="ReplacementCodeuiSUN">
- <param name="code" type="GLuint"/>
- </function>
-
- <function name="ReplacementCodeusSUN">
- <param name="code" type="GLushort"/>
- </function>
-
- <function name="ReplacementCodeubSUN">
- <param name="code" type="GLubyte"/>
- </function>
-
- <function name="ReplacementCodeuivSUN">
- <param name="code" type="const GLuint *"/>
- </function>
-
- <function name="ReplacementCodeusvSUN">
- <param name="code" type="const GLushort *"/>
- </function>
-
- <function name="ReplacementCodeubvSUN">
- <param name="code" type="const GLubyte *"/>
- </function>
-
- <function name="ReplacementCodePointerSUN">
- <param name="type" type="GLenum"/>
- <param name="stride" type="GLsizei"/>
- <param name="pointer" type="const GLvoid *"/>
- </function>
-</category>
-
-<category name="GL_SUN_vertex" number="166">
- <function name="Color4ubVertex2fSUN">
- <param name="r" type="GLubyte"/>
- <param name="g" type="GLubyte"/>
- <param name="b" type="GLubyte"/>
- <param name="a" type="GLubyte"/>
- <param name="x" type="GLfloat"/>
- <param name="y" type="GLfloat"/>
- </function>
-
- <function name="Color4ubVertex2fvSUN">
- <param name="c" type="const GLubyte *"/>
- <param name="v" type="const GLfloat *"/>
- </function>
-
- <function name="Color4ubVertex3fSUN">
- <param name="r" type="GLubyte"/>
- <param name="g" type="GLubyte"/>
- <param name="b" type="GLubyte"/>
- <param name="a" type="GLubyte"/>
- <param name="x" type="GLfloat"/>
- <param name="y" type="GLfloat"/>
- <param name="z" type="GLfloat"/>
- </function>
-
- <function name="Color4ubVertex3fvSUN">
- <param name="c" type="const GLubyte *"/>
- <param name="v" type="const GLfloat *"/>
- </function>
-
- <function name="Color3fVertex3fSUN">
- <param name="r" type="GLfloat"/>
- <param name="g" type="GLfloat"/>
- <param name="b" type="GLfloat"/>
- <param name="x" type="GLfloat"/>
- <param name="y" type="GLfloat"/>
- <param name="z" type="GLfloat"/>
- </function>
-
- <function name="Color3fVertex3fvSUN">
- <param name="c" type="const GLfloat *"/>
- <param name="v" type="const GLfloat *"/>
- </function>
-
- <function name="Normal3fVertex3fSUN">
- <param name="nx" type="GLfloat"/>
- <param name="ny" type="GLfloat"/>
- <param name="nz" type="GLfloat"/>
- <param name="x" type="GLfloat"/>
- <param name="y" type="GLfloat"/>
- <param name="z" type="GLfloat"/>
- </function>
-
- <function name="Normal3fVertex3fvSUN">
- <param name="n" type="const GLfloat *"/>
- <param name="v" type="const GLfloat *"/>
- </function>
-
- <function name="Color4fNormal3fVertex3fSUN">
- <param name="r" type="GLfloat"/>
- <param name="g" type="GLfloat"/>
- <param name="b" type="GLfloat"/>
- <param name="a" type="GLfloat"/>
- <param name="nx" type="GLfloat"/>
- <param name="ny" type="GLfloat"/>
- <param name="nz" type="GLfloat"/>
- <param name="x" type="GLfloat"/>
- <param name="y" type="GLfloat"/>
- <param name="z" type="GLfloat"/>
- </function>
-
- <function name="Color4fNormal3fVertex3fvSUN">
- <param name="c" type="const GLfloat *"/>
- <param name="n" type="const GLfloat *"/>
- <param name="v" type="const GLfloat *"/>
- </function>
-
- <function name="TexCoord2fVertex3fSUN">
- <param name="s" type="GLfloat"/>
- <param name="t" type="GLfloat"/>
- <param name="x" type="GLfloat"/>
- <param name="y" type="GLfloat"/>
- <param name="z" type="GLfloat"/>
- </function>
-
- <function name="TexCoord2fVertex3fvSUN">
- <param name="tc" type="const GLfloat *"/>
- <param name="v" type="const GLfloat *"/>
- </function>
-
- <function name="TexCoord4fVertex4fSUN">
- <param name="s" type="GLfloat"/>
- <param name="t" type="GLfloat"/>
- <param name="p" type="GLfloat"/>
- <param name="q" type="GLfloat"/>
- <param name="x" type="GLfloat"/>
- <param name="y" type="GLfloat"/>
- <param name="z" type="GLfloat"/>
- <param name="w" type="GLfloat"/>
- </function>
-
- <function name="TexCoord4fVertex4fvSUN">
- <param name="tc" type="const GLfloat *"/>
- <param name="v" type="const GLfloat *"/>
- </function>
-
- <function name="TexCoord2fColor4ubVertex3fSUN">
- <param name="s" type="GLfloat"/>
- <param name="t" type="GLfloat"/>
- <param name="r" type="GLubyte"/>
- <param name="g" type="GLubyte"/>
- <param name="b" type="GLubyte"/>
- <param name="a" type="GLubyte"/>
- <param name="x" type="GLfloat"/>
- <param name="y" type="GLfloat"/>
- <param name="z" type="GLfloat"/>
- </function>
-
- <function name="TexCoord2fColor4ubVertex3fvSUN">
- <param name="tc" type="const GLfloat *"/>
- <param name="c" type="const GLubyte *"/>
- <param name="v" type="const GLfloat *"/>
- </function>
-
- <function name="TexCoord2fColor3fVertex3fSUN">
- <param name="s" type="GLfloat"/>
- <param name="t" type="GLfloat"/>
- <param name="r" type="GLfloat"/>
- <param name="g" type="GLfloat"/>
- <param name="b" type="GLfloat"/>
- <param name="x" type="GLfloat"/>
- <param name="y" type="GLfloat"/>
- <param name="z" type="GLfloat"/>
- </function>
-
- <function name="TexCoord2fColor3fVertex3fvSUN">
- <param name="tc" type="const GLfloat *"/>
- <param name="c" type="const GLfloat *"/>
- <param name="v" type="const GLfloat *"/>
- </function>
-
- <function name="TexCoord2fNormal3fVertex3fSUN">
- <param name="s" type="GLfloat"/>
- <param name="t" type="GLfloat"/>
- <param name="nx" type="GLfloat"/>
- <param name="ny" type="GLfloat"/>
- <param name="nz" type="GLfloat"/>
- <param name="x" type="GLfloat"/>
- <param name="y" type="GLfloat"/>
- <param name="z" type="GLfloat"/>
- </function>
-
- <function name="TexCoord2fNormal3fVertex3fvSUN">
- <param name="tc" type="const GLfloat *"/>
- <param name="n" type="const GLfloat *"/>
- <param name="v" type="const GLfloat *"/>
- </function>
-
- <function name="TexCoord2fColor4fNormal3fVertex3fSUN">
- <param name="s" type="GLfloat"/>
- <param name="t" type="GLfloat"/>
- <param name="r" type="GLfloat"/>
- <param name="g" type="GLfloat"/>
- <param name="b" type="GLfloat"/>
- <param name="a" type="GLfloat"/>
- <param name="nx" type="GLfloat"/>
- <param name="ny" type="GLfloat"/>
- <param name="nz" type="GLfloat"/>
- <param name="x" type="GLfloat"/>
- <param name="y" type="GLfloat"/>
- <param name="z" type="GLfloat"/>
- </function>
-
- <function name="TexCoord2fColor4fNormal3fVertex3fvSUN">
- <param name="tc" type="const GLfloat *"/>
- <param name="c" type="const GLfloat *"/>
- <param name="n" type="const GLfloat *"/>
- <param name="v" type="const GLfloat *"/>
- </function>
-
- <function name="TexCoord4fColor4fNormal3fVertex4fSUN">
- <param name="s" type="GLfloat"/>
- <param name="t" type="GLfloat"/>
- <param name="p" type="GLfloat"/>
- <param name="q" type="GLfloat"/>
- <param name="r" type="GLfloat"/>
- <param name="g" type="GLfloat"/>
- <param name="b" type="GLfloat"/>
- <param name="a" type="GLfloat"/>
- <param name="nx" type="GLfloat"/>
- <param name="ny" type="GLfloat"/>
- <param name="nz" type="GLfloat"/>
- <param name="x" type="GLfloat"/>
- <param name="y" type="GLfloat"/>
- <param name="z" type="GLfloat"/>
- <param name="w" type="GLfloat"/>
- </function>
-
- <function name="TexCoord4fColor4fNormal3fVertex4fvSUN">
- <param name="tc" type="const GLfloat *"/>
- <param name="c" type="const GLfloat *"/>
- <param name="n" type="const GLfloat *"/>
- <param name="v" type="const GLfloat *"/>
- </function>
-
- <function name="ReplacementCodeuiVertex3fSUN">
- <param name="rc" type="GLuint"/>
- <param name="x" type="GLfloat"/>
- <param name="y" type="GLfloat"/>
- <param name="z" type="GLfloat"/>
- </function>
-
- <function name="ReplacementCodeuiVertex3fvSUN">
- <param name="rc" type="const GLuint *"/>
- <param name="v" type="const GLfloat *"/>
- </function>
-
- <function name="ReplacementCodeuiColor4ubVertex3fSUN">
- <param name="rc" type="GLuint"/>
- <param name="r" type="GLubyte"/>
- <param name="g" type="GLubyte"/>
- <param name="b" type="GLubyte"/>
- <param name="a" type="GLubyte"/>
- <param name="x" type="GLfloat"/>
- <param name="y" type="GLfloat"/>
- <param name="z" type="GLfloat"/>
- </function>
-
- <function name="ReplacementCodeuiColor4ubVertex3fvSUN">
- <param name="rc" type="const GLuint *"/>
- <param name="c" type="const GLubyte *"/>
- <param name="v" type="const GLfloat *"/>
- </function>
-
- <function name="ReplacementCodeuiColor3fVertex3fSUN">
- <param name="rc" type="GLuint"/>
- <param name="r" type="GLfloat"/>
- <param name="g" type="GLfloat"/>
- <param name="b" type="GLfloat"/>
- <param name="x" type="GLfloat"/>
- <param name="y" type="GLfloat"/>
- <param name="z" type="GLfloat"/>
- </function>
-
- <function name="ReplacementCodeuiColor3fVertex3fvSUN">
- <param name="rc" type="const GLuint *"/>
- <param name="c" type="const GLfloat *"/>
- <param name="v" type="const GLfloat *"/>
- </function>
-
- <function name="ReplacementCodeuiNormal3fVertex3fSUN">
- <param name="rc" type="GLuint"/>
- <param name="nx" type="GLfloat"/>
- <param name="ny" type="GLfloat"/>
- <param name="nz" type="GLfloat"/>
- <param name="x" type="GLfloat"/>
- <param name="y" type="GLfloat"/>
- <param name="z" type="GLfloat"/>
- </function>
-
- <function name="ReplacementCodeuiNormal3fVertex3fvSUN">
- <param name="rc" type="const GLuint *"/>
- <param name="n" type="const GLfloat *"/>
- <param name="v" type="const GLfloat *"/>
- </function>
-
- <function name="ReplacementCodeuiColor4fNormal3fVertex3fSUN">
- <param name="rc" type="GLuint"/>
- <param name="r" type="GLfloat"/>
- <param name="g" type="GLfloat"/>
- <param name="b" type="GLfloat"/>
- <param name="a" type="GLfloat"/>
- <param name="nx" type="GLfloat"/>
- <param name="ny" type="GLfloat"/>
- <param name="nz" type="GLfloat"/>
- <param name="x" type="GLfloat"/>
- <param name="y" type="GLfloat"/>
- <param name="z" type="GLfloat"/>
- </function>
-
- <function name="ReplacementCodeuiColor4fNormal3fVertex3fvSUN">
- <param name="rc" type="const GLuint *"/>
- <param name="c" type="const GLfloat *"/>
- <param name="n" type="const GLfloat *"/>
- <param name="v" type="const GLfloat *"/>
- </function>
-
- <function name="ReplacementCodeuiTexCoord2fVertex3fSUN">
- <param name="rc" type="GLuint"/>
- <param name="s" type="GLfloat"/>
- <param name="t" type="GLfloat"/>
- <param name="x" type="GLfloat"/>
- <param name="y" type="GLfloat"/>
- <param name="z" type="GLfloat"/>
- </function>
-
- <function name="ReplacementCodeuiTexCoord2fVertex3fvSUN">
- <param name="rc" type="const GLuint *"/>
- <param name="tc" type="const GLfloat *"/>
- <param name="v" type="const GLfloat *"/>
- </function>
-
- <function name="ReplacementCodeuiTexCoord2fNormal3fVertex3fSUN">
- <param name="rc" type="GLuint"/>
- <param name="s" type="GLfloat"/>
- <param name="t" type="GLfloat"/>
- <param name="nx" type="GLfloat"/>
- <param name="ny" type="GLfloat"/>
- <param name="nz" type="GLfloat"/>
- <param name="x" type="GLfloat"/>
- <param name="y" type="GLfloat"/>
- <param name="z" type="GLfloat"/>
- </function>
-
- <function name="ReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN">
- <param name="rc" type="const GLuint *"/>
- <param name="tc" type="const GLfloat *"/>
- <param name="n" type="const GLfloat *"/>
- <param name="v" type="const GLfloat *"/>
- </function>
-
- <function name="ReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN">
- <param name="rc" type="GLuint"/>
- <param name="s" type="GLfloat"/>
- <param name="t" type="GLfloat"/>
- <param name="r" type="GLfloat"/>
- <param name="g" type="GLfloat"/>
- <param name="b" type="GLfloat"/>
- <param name="a" type="GLfloat"/>
- <param name="nx" type="GLfloat"/>
- <param name="ny" type="GLfloat"/>
- <param name="nz" type="GLfloat"/>
- <param name="x" type="GLfloat"/>
- <param name="y" type="GLfloat"/>
- <param name="z" type="GLfloat"/>
- </function>
-
- <function name="ReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN">
- <param name="rc" type="const GLuint *"/>
- <param name="tc" type="const GLfloat *"/>
- <param name="c" type="const GLfloat *"/>
- <param name="n" type="const GLfloat *"/>
- <param name="v" type="const GLfloat *"/>
- </function>
-</category>
-
-<!-- Extension number 167 is a WGL extension. -->
-<!-- Extension number 168 is a WGL extension. -->
-<!-- Extension number 169 is a WGL extension. -->
-<!-- Extension number 170 is a WGL extension. -->
-<!-- Extension number 171 is a WGL extension. -->
-<!-- Extension number 172 is a WGL extension. -->
-
-<category name="GL_EXT_blend_func_separate" number="173">
- <function name="BlendFuncSeparateEXT" offset="assign">
- <param name="sfactorRGB" type="GLenum"/>
- <param name="dfactorRGB" type="GLenum"/>
- <param name="sfactorAlpha" type="GLenum"/>
- <param name="dfactorAlpha" type="GLenum"/>
- <glx rop="4134"/>
- </function>
-</category>
-
-<category name="GL_EXT_stencil_wrap" number="176">
- <enum name="INCR_WRAP_EXT" value="0x8507"/>
- <enum name="DECR_WRAP_EXT" value="0x8508"/>
-</category>
-
-<!-- Extension number 177 is a WGL extension. -->
-
-<category name="GL_NV_texgen_reflection" number="179">
- <enum name="NORMAL_MAP_NV" value="0x8511"/>
- <enum name="REFLECTION_MAP_NV" value="0x8512"/>
-</category>
-
-<!-- Extension number 180 is not listed in the extension registry. -->
-
-<category name="GL_SUN_convolution_border_modes" number="182">
- <enum name="WRAP_BORDER_SUN" value="0x81D4"/>
-</category>
-
-<!-- Extension number 183 is a GLX extension. -->
-<!-- Extension number 184 is not listed in the extension registry. -->
-
-<category name="GL_EXT_texture_env_add" number="185">
- <!-- No new functions, types, enums. -->
-</category>
-
-<category name="GL_EXT_texture_lod_bias" number="186">
- <enum name="TEXTURE_LOD_BIAS_EXT" count="1" value="0x8501">
- <size name="TexParameterfv"/>
- <size name="TexParameteriv"/>
- <size name="GetTexParameterfv" mode="get"/>
- <size name="GetTexParameteriv" mode="get"/>
- </enum>
-</category>
-
-<category name="GL_EXT_texture_filter_anisotropic" number="187">
- <enum name="TEXTURE_MAX_ANISOTROPY_EXT" count="1" value="0x84FE">
- <size name="TexParameterfv"/>
- <size name="TexParameteriv"/>
- <size name="GetTexParameterfv" mode="get"/>
- <size name="GetTexParameteriv" mode="get"/>
- </enum>
- <enum name="MAX_TEXTURE_MAX_ANISOTROPY_EXT" count="1" value="0x84FF">
- <size name="Get" mode="get"/>
- </enum>
-</category>
-
-<category name="GL_EXT_vertex_weighting" number="188">
- <function name="VertexWeightfEXT" vectorequiv="VertexWeightfvEXT">
- <param name="weight" type="GLfloat"/>
- <glx ignore="true"/>
- </function>
-
- <function name="VertexWeightfvEXT">
- <param name="weight" type="const GLfloat *" count="1"/>
- <glx rop="4135" ignore="true"/>
- </function>
-
- <function name="VertexWeightPointerEXT">
- <param name="size" type="GLsizei"/>
- <param name="type" type="GLenum"/>
- <param name="stride" type="GLsizei"/>
- <param name="pointer" type="const GLvoid *"/>
- <glx handcode="true" ignore="true"/>
- </function>
-</category>
-
-<category name="GL_NV_light_max_exponent" number="189">
- <enum name="MAX_SHININESS_NV" count="1" value="0x8504">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="MAX_SPOT_EXPONENT_NV" count="1" value="0x8505">
- <size name="Get" mode="get"/>
- </enum>
-</category>
-
-<category name="GL_NV_vertex_array_range" number="190">
- <function name="FlushVertexArrayRangeNV" offset="assign">
- <glx ignore="true"/>
- </function>
-
- <function name="VertexArrayRangeNV" offset="assign">
- <param name="length" type="GLsizei"/>
- <param name="pointer" type="const GLvoid *"/>
- <glx ignore="true"/>
- </function>
-</category>
-
-<category name="GL_NV_register_combiners" number="191">
- <function name="CombinerParameterfvNV" offset="assign">
- <param name="pname" type="GLenum"/>
- <param name="params" type="const GLfloat *" variable_param="pname"/>
- <glx rop="4137" ignore="true"/>
- </function>
-
- <function name="CombinerParameterfNV" offset="assign">
- <param name="pname" type="GLenum"/>
- <param name="param" type="GLfloat"/>
- <glx rop="4136" ignore="true"/>
- </function>
-
- <function name="CombinerParameterivNV" offset="assign">
- <param name="pname" type="GLenum"/>
- <param name="params" type="const GLint *" variable_param="pname"/>
- <glx rop="4139" ignore="true"/>
- </function>
-
- <function name="CombinerParameteriNV" offset="assign">
- <param name="pname" type="GLenum"/>
- <param name="param" type="GLint"/>
- <glx rop="4138" ignore="true"/>
- </function>
-
- <function name="CombinerInputNV" offset="assign">
- <param name="stage" type="GLenum"/>
- <param name="portion" type="GLenum"/>
- <param name="variable" type="GLenum"/>
- <param name="input" type="GLenum"/>
- <param name="mapping" type="GLenum"/>
- <param name="componentUsage" type="GLenum"/>
- <glx rop="4140" ignore="true"/>
- </function>
-
- <function name="CombinerOutputNV" offset="assign">
- <param name="stage" type="GLenum"/>
- <param name="portion" type="GLenum"/>
- <param name="abOutput" type="GLenum"/>
- <param name="cdOutput" type="GLenum"/>
- <param name="sumOutput" type="GLenum"/>
- <param name="scale" type="GLenum"/>
- <param name="bias" type="GLenum"/>
- <param name="abDotProduct" type="GLboolean"/>
- <param name="cdDotProduct" type="GLboolean"/>
- <param name="muxSum" type="GLboolean"/>
- <glx rop="4141" ignore="true"/>
- </function>
-
- <function name="FinalCombinerInputNV" offset="assign">
- <param name="variable" type="GLenum"/>
- <param name="input" type="GLenum"/>
- <param name="mapping" type="GLenum"/>
- <param name="componentUsage" type="GLenum"/>
- <glx rop="4142" ignore="true"/>
- </function>
-
- <function name="GetCombinerInputParameterfvNV" offset="assign">
- <param name="stage" type="GLenum"/>
- <param name="portion" type="GLenum"/>
- <param name="variable" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLfloat *" output="true"/>
- <glx vendorpriv="1270" ignore="true"/>
- </function>
-
- <function name="GetCombinerInputParameterivNV" offset="assign">
- <param name="stage" type="GLenum"/>
- <param name="portion" type="GLenum"/>
- <param name="variable" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLint *" output="true"/>
- <glx vendorpriv="1271" ignore="true"/>
- </function>
-
- <function name="GetCombinerOutputParameterfvNV" offset="assign">
- <param name="stage" type="GLenum"/>
- <param name="portion" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLfloat *" output="true"/>
- <glx vendorpriv="1272" ignore="true"/>
- </function>
-
- <function name="GetCombinerOutputParameterivNV" offset="assign">
- <param name="stage" type="GLenum"/>
- <param name="portion" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLint *" output="true"/>
- <glx vendorpriv="1273" ignore="true"/>
- </function>
-
- <function name="GetFinalCombinerInputParameterfvNV" offset="assign">
- <param name="variable" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLfloat *" output="true"/>
- <glx vendorpriv="1274" ignore="true"/>
- </function>
-
- <function name="GetFinalCombinerInputParameterivNV" offset="assign">
- <param name="variable" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLint *" output="true"/>
- <glx vendorpriv="1275" ignore="true"/>
- </function>
-</category>
-
-<category name="GL_NV_fog_distance" number="192">
- <enum name="FOG_DISTANCE_MODE_NV" count="1" value="0x855A">
- <size name="Fogfv"/>
- <size name="Fogiv"/>
- <size name="Get" mode="get"/>
- </enum>
- <enum name="EYE_RADIAL_NV" value="0x855B"/>
- <enum name="EYE_PLANE_ABSOLUTE_NV" value="0x855C"/>
-</category>
-
-<category name="GL_NV_blend_square" number="194">
- <!-- No new functions, types, enums. -->
-</category>
-
-<category name="GL_NV_texture_env_combine4" number="195">
- <enum name="COMBINE4" value="0x8503"/>
- <enum name="SOURCE3_RGB_NV" count="1" value="0x8583">
- <size name="TexEnvfv"/>
- <size name="TexEnviv"/>
- <size name="GetTexEnvfv" mode="get"/>
- <size name="GetTexEnviv" mode="get"/>
- </enum>
- <enum name="SOURCE3_ALPHA_NV" count="1" value="0x858B">
- <size name="TexEnvfv"/>
- <size name="TexEnviv"/>
- <size name="GetTexEnvfv" mode="get"/>
- <size name="GetTexEnviv" mode="get"/>
- </enum>
- <enum name="OPERAND3_RGB_NV" count="1" value="0x8593">
- <size name="TexEnvfv"/>
- <size name="TexEnviv"/>
- <size name="GetTexEnvfv" mode="get"/>
- <size name="GetTexEnviv" mode="get"/>
- </enum>
- <enum name="OPERAND3_ALPHA_NV" count="1" value="0x859B">
- <size name="TexEnvfv"/>
- <size name="TexEnviv"/>
- <size name="GetTexEnvfv" mode="get"/>
- <size name="GetTexEnviv" mode="get"/>
- </enum>
-</category>
-
-<category name="GL_MESA_resize_buffers" number="196">
- <function name="ResizeBuffersMESA" offset="assign">
- <glx ignore="true"/>
- </function>
-</category>
-
-<category name="GL_MESA_window_pos" number="197">
- <function name="WindowPos2dMESA" offset="assign">
- <param name="x" type="GLdouble"/>
- <param name="y" type="GLdouble"/>
- <glx handcode="true"/>
- </function>
-
- <function name="WindowPos2dvMESA" offset="assign">
- <param name="v" type="const GLdouble *"/>
- <glx handcode="true"/>
- </function>
-
- <function name="WindowPos2fMESA" offset="assign">
- <param name="x" type="GLfloat"/>
- <param name="y" type="GLfloat"/>
- <glx handcode="true"/>
- </function>
-
- <function name="WindowPos2fvMESA" offset="assign">
- <param name="v" type="const GLfloat *"/>
- <glx handcode="true"/>
- </function>
-
- <function name="WindowPos2iMESA" offset="assign">
- <param name="x" type="GLint"/>
- <param name="y" type="GLint"/>
- <glx handcode="true"/>
- </function>
-
- <function name="WindowPos2ivMESA" offset="assign">
- <param name="v" type="const GLint *"/>
- <glx handcode="true"/>
- </function>
-
- <function name="WindowPos2sMESA" offset="assign">
- <param name="x" type="GLshort"/>
- <param name="y" type="GLshort"/>
- <glx handcode="true"/>
- </function>
-
- <function name="WindowPos2svMESA" offset="assign">
- <param name="v" type="const GLshort *"/>
- <glx handcode="true"/>
- </function>
-
- <function name="WindowPos3dMESA" offset="assign">
- <param name="x" type="GLdouble"/>
- <param name="y" type="GLdouble"/>
- <param name="z" type="GLdouble"/>
- <glx handcode="true"/>
- </function>
-
- <function name="WindowPos3dvMESA" offset="assign">
- <param name="v" type="const GLdouble *"/>
- <glx handcode="true"/>
- </function>
-
- <function name="WindowPos3fMESA" offset="assign" vectorequiv="WindowPos3fvMESA">
- <param name="x" type="GLfloat"/>
- <param name="y" type="GLfloat"/>
- <param name="z" type="GLfloat"/>
- </function>
-
- <function name="WindowPos3fvMESA" offset="assign">
- <param name="v" type="const GLfloat *" count="3"/>
- <glx rop="230"/>
- </function>
-
- <function name="WindowPos3iMESA" offset="assign">
- <param name="x" type="GLint"/>
- <param name="y" type="GLint"/>
- <param name="z" type="GLint"/>
- <glx handcode="true"/>
- </function>
-
- <function name="WindowPos3ivMESA" offset="assign">
- <param name="v" type="const GLint *"/>
- <glx handcode="true"/>
- </function>
-
- <function name="WindowPos3sMESA" offset="assign">
- <param name="x" type="GLshort"/>
- <param name="y" type="GLshort"/>
- <param name="z" type="GLshort"/>
- <glx handcode="true"/>
- </function>
-
- <function name="WindowPos3svMESA" offset="assign">
- <param name="v" type="const GLshort *"/>
- <glx handcode="true"/>
- </function>
-
- <function name="WindowPos4dMESA" offset="assign">
- <param name="x" type="GLdouble"/>
- <param name="y" type="GLdouble"/>
- <param name="z" type="GLdouble"/>
- <param name="w" type="GLdouble"/>
- <glx ignore="true"/>
- </function>
-
- <function name="WindowPos4dvMESA" offset="assign">
- <param name="v" type="const GLdouble *"/>
- <glx ignore="true"/>
- </function>
-
- <function name="WindowPos4fMESA" offset="assign">
- <param name="x" type="GLfloat"/>
- <param name="y" type="GLfloat"/>
- <param name="z" type="GLfloat"/>
- <param name="w" type="GLfloat"/>
- <glx ignore="true"/>
- </function>
-
- <function name="WindowPos4fvMESA" offset="assign">
- <param name="v" type="const GLfloat *"/>
- <glx ignore="true"/>
- </function>
-
- <function name="WindowPos4iMESA" offset="assign">
- <param name="x" type="GLint"/>
- <param name="y" type="GLint"/>
- <param name="z" type="GLint"/>
- <param name="w" type="GLint"/>
- <glx ignore="true"/>
- </function>
-
- <function name="WindowPos4ivMESA" offset="assign">
- <param name="v" type="const GLint *"/>
- <glx ignore="true"/>
- </function>
-
- <function name="WindowPos4sMESA" offset="assign">
- <param name="x" type="GLshort"/>
- <param name="y" type="GLshort"/>
- <param name="z" type="GLshort"/>
- <param name="w" type="GLshort"/>
- <glx ignore="true"/>
- </function>
-
- <function name="WindowPos4svMESA" offset="assign">
- <param name="v" type="const GLshort *"/>
- <glx ignore="true"/>
- </function>
-</category>
-
-<category name="GL_EXT_texture_compression_s3tc" number="198">
- <enum name="COMPRESSED_RGB_S3TC_DXT1_EXT" value="0x83F0"/>
- <enum name="COMPRESSED_RGBA_S3TC_DXT1_EXT" value="0x83F1"/>
- <enum name="COMPRESSED_RGBA_S3TC_DXT3_EXT" value="0x83F2"/>
- <enum name="COMPRESSED_RGBA_S3TC_DXT5_EXT" value="0x83F3"/>
-</category>
-
-<category name="GL_IBM_multimode_draw_arrays" number="200">
- <function name="MultiModeDrawArraysIBM" offset="assign" static_dispatch="false">
- <param name="mode" type="const GLenum *"/>
- <param name="first" type="const GLint *"/>
- <param name="count" type="const GLsizei *"/>
- <param name="primcount" type="GLsizei"/>
- <param name="modestride" type="GLint"/>
- <glx handcode="true" ignore="true"/>
- </function>
-
- <function name="MultiModeDrawElementsIBM" offset="assign" static_dispatch="false">
- <param name="mode" type="const GLenum *"/>
- <param name="count" type="const GLsizei *"/>
- <param name="type" type="GLenum"/>
- <param name="indices" type="const GLvoid * const *"/>
- <param name="primcount" type="GLsizei"/>
- <param name="modestride" type="GLint"/>
- <glx handcode="true" ignore="true"/>
- </function>
-</category>
-
-<category name="GL_IBM_vertex_array_lists" number="201">
- <function name="ColorPointerListIBM">
- <param name="size" type="GLint"/>
- <param name="type" type="GLenum"/>
- <param name="stride" type="GLint"/>
- <param name="pointer" type="const GLvoid **"/>
- <param name="ptrstride" type="GLint"/>
- </function>
-
- <function name="SecondaryColorPointerListIBM">
- <param name="size" type="GLint"/>
- <param name="type" type="GLenum"/>
- <param name="stride" type="GLint"/>
- <param name="pointer" type="const GLvoid **"/>
- <param name="ptrstride" type="GLint"/>
- </function>
-
- <function name="EdgeFlagPointerListIBM">
- <param name="stride" type="GLint"/>
- <param name="pointer" type="const GLboolean **"/>
- <param name="ptrstride" type="GLint"/>
- </function>
-
- <function name="FogCoordPointerListIBM">
- <param name="type" type="GLenum"/>
- <param name="stride" type="GLint"/>
- <param name="pointer" type="const GLvoid **"/>
- <param name="ptrstride" type="GLint"/>
- </function>
-
- <function name="IndexPointerListIBM">
- <param name="type" type="GLenum"/>
- <param name="stride" type="GLint"/>
- <param name="pointer" type="const GLvoid **"/>
- <param name="ptrstride" type="GLint"/>
- </function>
-
- <function name="NormalPointerListIBM">
- <param name="type" type="GLenum"/>
- <param name="stride" type="GLint"/>
- <param name="pointer" type="const GLvoid **"/>
- <param name="ptrstride" type="GLint"/>
- </function>
-
- <function name="TexCoordPointerListIBM">
- <param name="size" type="GLint"/>
- <param name="type" type="GLenum"/>
- <param name="stride" type="GLint"/>
- <param name="pointer" type="const GLvoid **"/>
- <param name="ptrstride" type="GLint"/>
- </function>
-
- <function name="VertexPointerListIBM">
- <param name="size" type="GLint"/>
- <param name="type" type="GLenum"/>
- <param name="stride" type="GLint"/>
- <param name="pointer" type="const GLvoid **"/>
- <param name="ptrstride" type="GLint"/>
- </function>
-</category>
-
-<!-- Extension number 202 is not listed in the extension registry. -->
-<!-- Extension number 203 is not listed in the extension registry. -->
-<!-- Extension number 204 is not listed in the extension registry. -->
-<!-- Extension number 205 is not listed in the extension registry. -->
-
-<category name="GL_3DFX_texture_compression_FXT1" number="206">
- <enum name="COMPRESSED_RGB_FXT1_3DFX" value="0x86B0"/>
- <enum name="COMPRESSED_RGBA_FXT1_3DFX" value="0x86B1"/>
-</category>
-
-<category name="GL_3DFX_multisample" number="207">
- <enum name="MULTISAMPLE_3DFX" value="0x86B2"/>
- <enum name="SAMPLE_BUFFERS_3DFX" value="0x86B3"/>
- <enum name="SAMPLES_3DFX" value="0x86B4"/>
- <enum name="MULTISAMPLE_BIT_3DFX" value="0x20000000"/>
-</category>
-
-<category name="GL_3DFX_tbuffer" number="208">
- <function name="TbufferMask3DFX">
- <param name="mask" type="GLuint"/>
- <glx ignore="true"/>
- </function>
-</category>
-
-<category name="GL_EXT_multisample" number="209">
- <function name="SampleMaskEXT" alias="SampleMaskSGIS" static_dispatch="false">
- <param name="value" type="GLclampf"/>
- <param name="invert" type="GLboolean"/>
- </function>
-
- <function name="SamplePatternEXT" alias="SamplePatternSGIS" static_dispatch="false">
- <param name="pattern" type="GLenum"/>
- </function>
-</category>
-
-<!-- Extension number 211 is not listed in the extension registry. -->
-<!-- Extension number 213 is not listed in the extension registry. -->
-
-<category name="GL_SGIS_texture_color_mask" number="214">
- <enum name="TEXTURE_COLOR_WRITEMASK_SGIS" value="0x81EF"/>
-
- <function name="TextureColorMaskSGIS">
- <param name="red" type="GLboolean"/>
- <param name="green" type="GLboolean"/>
- <param name="blue" type="GLboolean"/>
- <param name="alpha" type="GLboolean"/>
- <glx rop="2082" ignore="true"/>
- </function>
-</category>
-
-<!-- Extension number 215 is a GLX extension. -->
-<!-- Extension number 216 is a GLX extension. -->
-<!-- Extension number 217 is a GLX extension. -->
-<!-- Extension number 218 is a GLX extension. -->
-<!-- Extension number 219 is not listed in the extension registry. -->
-
-<category name="GL_EXT_texture_env_dot3" number="220">
- <enum name="DOT3_RGB_EXT" value="0x8740"/>
- <enum name="DOT3_RGBA_EXT" value="0x8741"/>
-</category>
-
-<category name="GL_ATI_texture_mirror_once" number="221">
- <enum name="MIRROR_CLAMP_ATI" value="0x8742"/>
- <enum name="MIRROR_CLAMP_TO_EDGE_ATI" value="0x8743"/>
-</category>
-
-<category name="GL_NV_fence" number="222">
- <function name="DeleteFencesNV" offset="assign" static_dispatch="false">
- <param name="n" type="GLsizei"/>
- <param name="fences" type="const GLuint *"/>
- <glx ignore="true"/>
- </function>
-
- <function name="GenFencesNV" offset="assign" static_dispatch="false">
- <param name="n" type="GLsizei" counter="true"/>
- <param name="fences" type="GLuint *" output="true" count="n"/>
- <glx ignore="true"/>
- </function>
-
- <function name="IsFenceNV" offset="assign" static_dispatch="false">
- <param name="fence" type="GLuint"/>
- <return type="GLboolean"/>
- <glx ignore="true"/>
- </function>
-
- <function name="TestFenceNV" offset="assign" static_dispatch="false">
- <param name="fence" type="GLuint"/>
- <return type="GLboolean"/>
- <glx ignore="true"/>
- </function>
-
- <function name="GetFenceivNV" offset="assign" static_dispatch="false">
- <param name="fence" type="GLuint"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLint *" output="true"/>
- <glx ignore="true"/>
- </function>
-
- <function name="FinishFenceNV" offset="assign" static_dispatch="false">
- <param name="fence" type="GLuint"/>
- <glx ignore="true"/>
- </function>
-
- <function name="SetFenceNV" offset="assign" static_dispatch="false">
- <param name="fence" type="GLuint"/>
- <param name="condition" type="GLenum"/>
- <glx ignore="true"/>
- </function>
-</category>
-
-<category name="GL_IBM_texture_mirrored_repeat" number="224">
- <enum name="MIRRORED_REPEAT_IBM" value="0x8370"/>
-</category>
-
-<category name="GL_NV_evaluators" number="225">
- <function name="MapControlPointsNV">
- <param name="target" type="GLenum"/>
- <param name="index" type="GLuint"/>
- <param name="type" type="GLenum"/>
- <param name="ustride" type="GLsizei"/>
- <param name="vstride" type="GLsizei"/>
- <param name="uorder" type="GLint"/>
- <param name="vorder" type="GLint"/>
- <param name="packed" type="GLboolean"/>
- <param name="points" type="const GLvoid *"/>
- </function>
-
- <function name="MapParameterivNV">
- <param name="target" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="const GLint *"/>
- </function>
-
- <function name="MapParameterfvNV">
- <param name="target" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="const GLfloat *"/>
- </function>
-
- <function name="GetMapControlPointsNV">
- <param name="target" type="GLenum"/>
- <param name="index" type="GLuint"/>
- <param name="type" type="GLenum"/>
- <param name="ustride" type="GLsizei"/>
- <param name="vstride" type="GLsizei"/>
- <param name="packed" type="GLboolean"/>
- <param name="points" type="GLvoid *" output="true"/>
- </function>
-
- <function name="GetMapParameterivNV">
- <param name="target" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLint *" output="true"/>
- </function>
-
- <function name="GetMapParameterfvNV">
- <param name="target" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLfloat *" output="true"/>
- </function>
-
- <function name="GetMapAttribParameterivNV">
- <param name="target" type="GLenum"/>
- <param name="index" type="GLuint"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLint *" output="true"/>
- </function>
-
- <function name="GetMapAttribParameterfvNV">
- <param name="target" type="GLenum"/>
- <param name="index" type="GLuint"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLfloat *" output="true"/>
- </function>
-
- <function name="EvalMapsNV">
- <param name="target" type="GLenum"/>
- <param name="mode" type="GLenum"/>
- </function>
-</category>
-
-<category name="GL_NV_packed_depth_stencil" number="226">
- <enum name="DEPTH_STENCIL_NV" value="0x84F9"/>
- <enum name="UNSIGNED_INT_24_8_NV" value="0x84FA"/>
-</category>
-
-<category name="GL_NV_register_combiners2" number="227">
- <function name="CombinerStageParameterfvNV">
- <param name="stage" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="const GLfloat *"/>
- </function>
-
- <function name="GetCombinerStageParameterfvNV">
- <param name="stage" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLfloat *" output="true"/>
- </function>
-</category>
-
-<category name="GL_NV_texture_compression_vtc" number="228">
- <enum name="COMPRESSED_RGB_S3TC_DXT1_EXT" value="0x83F0"/>
- <enum name="COMPRESSED_RGBA_S3TC_DXT1_EXT" value="0x83F1"/>
- <enum name="COMPRESSED_RGBA_S3TC_DXT3_EXT" value="0x83F2"/>
- <enum name="COMPRESSED_RGBA_S3TC_DXT5_EXT" value="0x83F3"/>
-</category>
-
-<category name="GL_NV_texture_rectangle" number="229">
- <enum name="TEXTURE_RECTANGLE_NV" count="1" value="0x84F5">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="TEXTURE_BINDING_RECTANGLE_NV" count="1" value="0x84F6">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="PROXY_TEXTURE_RECTANGLE_NV" value="0x84F7"/>
- <enum name="MAX_RECTANGLE_TEXTURE_SIZE_NV" count="1" value="0x84F8">
- <size name="Get" mode="get"/>
- </enum>
-</category>
-
-<category name="GL_NV_vertex_program" number="233">
- <enum name="VERTEX_PROGRAM_NV" value="0x8620"/>
- <enum name="VERTEX_STATE_PROGRAM_NV" value="0x8621"/>
- <enum name="ATTRIB_ARRAY_SIZE_NV" count="1" value="0x8623">
- <size name="GetVertexAttribdvNV" mode="get"/>
- <size name="GetVertexAttribfvNV" mode="get"/>
- <size name="GetVertexAttribivNV" mode="get"/>
- </enum>
- <enum name="ATTRIB_ARRAY_STRIDE_NV" count="1" value="0x8624">
- <size name="GetVertexAttribdvNV" mode="get"/>
- <size name="GetVertexAttribfvNV" mode="get"/>
- <size name="GetVertexAttribivNV" mode="get"/>
- </enum>
- <enum name="ATTRIB_ARRAY_TYPE_NV" count="1" value="0x8625">
- <size name="GetVertexAttribdvNV" mode="get"/>
- <size name="GetVertexAttribfvNV" mode="get"/>
- <size name="GetVertexAttribivNV" mode="get"/>
- </enum>
- <enum name="CURRENT_ATTRIB_NV" count="1" value="0x8626">
- <size name="GetVertexAttribdvNV" mode="get"/>
- <size name="GetVertexAttribfvNV" mode="get"/>
- <size name="GetVertexAttribivNV" mode="get"/>
- </enum>
- <enum name="PROGRAM_LENGTH_NV" count="1" value="0x8627">
- <size name="GetProgramivNV" mode="get"/>
- </enum>
- <enum name="PROGRAM_STRING_NV" value="0x8628"/>
- <enum name="MODELVIEW_PROJECTION_NV" value="0x8629"/>
- <enum name="IDENTITY_NV" value="0x862A"/>
- <enum name="INVERSE_NV" value="0x862B"/>
- <enum name="TRANSPOSE_NV" value="0x862C"/>
- <enum name="INVERSE_TRANSPOSE_NV" value="0x862D"/>
- <enum name="MAX_TRACK_MATRIX_STACK_DEPTH_NV" value="0x862E"/>
- <enum name="MAX_TRACK_MATRICES_NV" value="0x862F"/>
- <enum name="MATRIX0_NV" value="0x8630"/>
- <enum name="MATRIX1_NV" value="0x8631"/>
- <enum name="MATRIX2_NV" value="0x8632"/>
- <enum name="MATRIX3_NV" value="0x8633"/>
- <enum name="MATRIX4_NV" value="0x8634"/>
- <enum name="MATRIX5_NV" value="0x8635"/>
- <enum name="MATRIX6_NV" value="0x8636"/>
- <enum name="MATRIX7_NV" value="0x8637"/>
- <enum name="CURRENT_MATRIX_STACK_DEPTH_NV" value="0x8640"/>
- <enum name="CURRENT_MATRIX_NV" value="0x8641"/>
- <enum name="VERTEX_PROGRAM_POINT_SIZE_NV" value="0x8642"/>
- <enum name="VERTEX_PROGRAM_TWO_SIDE_NV" value="0x8643"/>
- <enum name="PROGRAM_PARAMETER_NV" value="0x8644"/>
- <enum name="ATTRIB_ARRAY_POINTER_NV" value="0x8645"/>
- <enum name="PROGRAM_TARGET_NV" count="1" value="0x8646">
- <size name="GetProgramivNV" mode="get"/>
- </enum>
- <enum name="PROGRAM_RESIDENT_NV" count="1" value="0x8647">
- <size name="GetProgramivNV" mode="get"/>
- </enum>
- <enum name="TRACK_MATRIX_NV" value="0x8648"/>
- <enum name="TRACK_MATRIX_TRANSFORM_NV" value="0x8649"/>
- <enum name="VERTEX_PROGRAM_BINDING_NV" value="0x864A"/>
- <enum name="PROGRAM_ERROR_POSITION_NV" value="0x864B"/>
- <enum name="VERTEX_ATTRIB_ARRAY0_NV" value="0x8650"/>
- <enum name="VERTEX_ATTRIB_ARRAY1_NV" value="0x8651"/>
- <enum name="VERTEX_ATTRIB_ARRAY2_NV" value="0x8652"/>
- <enum name="VERTEX_ATTRIB_ARRAY3_NV" value="0x8653"/>
- <enum name="VERTEX_ATTRIB_ARRAY4_NV" value="0x8654"/>
- <enum name="VERTEX_ATTRIB_ARRAY5_NV" value="0x8655"/>
- <enum name="VERTEX_ATTRIB_ARRAY6_NV" value="0x8656"/>
- <enum name="VERTEX_ATTRIB_ARRAY7_NV" value="0x8657"/>
- <enum name="VERTEX_ATTRIB_ARRAY8_NV" value="0x8658"/>
- <enum name="VERTEX_ATTRIB_ARRAY9_NV" value="0x8659"/>
- <enum name="VERTEX_ATTRIB_ARRAY10_NV" value="0x865A"/>
- <enum name="VERTEX_ATTRIB_ARRAY11_NV" value="0x865B"/>
- <enum name="VERTEX_ATTRIB_ARRAY12_NV" value="0x865C"/>
- <enum name="VERTEX_ATTRIB_ARRAY13_NV" value="0x865D"/>
- <enum name="VERTEX_ATTRIB_ARRAY14_NV" value="0x865E"/>
- <enum name="VERTEX_ATTRIB_ARRAY15_NV" value="0x865F"/>
- <enum name="MAP1_VERTEX_ATTRIB0_4_NV" value="0x8660"/>
- <enum name="MAP1_VERTEX_ATTRIB1_4_NV" value="0x8661"/>
- <enum name="MAP1_VERTEX_ATTRIB2_4_NV" value="0x8662"/>
- <enum name="MAP1_VERTEX_ATTRIB3_4_NV" value="0x8663"/>
- <enum name="MAP1_VERTEX_ATTRIB4_4_NV" value="0x8664"/>
- <enum name="MAP1_VERTEX_ATTRIB5_4_NV" value="0x8665"/>
- <enum name="MAP1_VERTEX_ATTRIB6_4_NV" value="0x8666"/>
- <enum name="MAP1_VERTEX_ATTRIB7_4_NV" value="0x8667"/>
- <enum name="MAP1_VERTEX_ATTRIB8_4_NV" value="0x8668"/>
- <enum name="MAP1_VERTEX_ATTRIB9_4_NV" value="0x8669"/>
- <enum name="MAP1_VERTEX_ATTRIB10_4_NV" value="0x866A"/>
- <enum name="MAP1_VERTEX_ATTRIB11_4_NV" value="0x866B"/>
- <enum name="MAP1_VERTEX_ATTRIB12_4_NV" value="0x866C"/>
- <enum name="MAP1_VERTEX_ATTRIB13_4_NV" value="0x866D"/>
- <enum name="MAP1_VERTEX_ATTRIB14_4_NV" value="0x866E"/>
- <enum name="MAP1_VERTEX_ATTRIB15_4_NV" value="0x866F"/>
- <enum name="MAP2_VERTEX_ATTRIB0_4_NV" value="0x8670"/>
- <enum name="MAP2_VERTEX_ATTRIB1_4_NV" value="0x8671"/>
- <enum name="MAP2_VERTEX_ATTRIB2_4_NV" value="0x8672"/>
- <enum name="MAP2_VERTEX_ATTRIB3_4_NV" value="0x8673"/>
- <enum name="MAP2_VERTEX_ATTRIB4_4_NV" value="0x8674"/>
- <enum name="MAP2_VERTEX_ATTRIB5_4_NV" value="0x8675"/>
- <enum name="MAP2_VERTEX_ATTRIB6_4_NV" value="0x8676"/>
- <enum name="MAP2_VERTEX_ATTRIB7_4_NV" value="0x8677"/>
- <enum name="MAP2_VERTEX_ATTRIB8_4_NV" value="0x8678"/>
- <enum name="MAP2_VERTEX_ATTRIB9_4_NV" value="0x8679"/>
- <enum name="MAP2_VERTEX_ATTRIB10_4_NV" value="0x867A"/>
- <enum name="MAP2_VERTEX_ATTRIB11_4_NV" value="0x867B"/>
- <enum name="MAP2_VERTEX_ATTRIB12_4_NV" value="0x867C"/>
- <enum name="MAP2_VERTEX_ATTRIB13_4_NV" value="0x867D"/>
- <enum name="MAP2_VERTEX_ATTRIB14_4_NV" value="0x867E"/>
- <enum name="MAP2_VERTEX_ATTRIB15_4_NV" value="0x867F"/>
-
- <function name="AreProgramsResidentNV" offset="assign">
- <param name="n" type="GLsizei" counter="true"/>
- <param name="ids" type="const GLuint *" count="n"/>
- <param name="residences" type="GLboolean *" output="true" count="n"/>
- <return type="GLboolean"/>
- <glx vendorpriv="1293"/>
- </function>
-
- <function name="BindProgramNV" offset="assign">
- <param name="target" type="GLenum"/>
- <param name="program" type="GLuint"/>
- <glx rop="4180"/>
- </function>
-
- <function name="DeleteProgramsNV" offset="assign">
- <param name="n" type="GLsizei" counter="true"/>
- <param name="programs" type="const GLuint *" count="n"/>
- <glx vendorpriv="1294"/>
- </function>
-
- <function name="ExecuteProgramNV" offset="assign">
- <param name="target" type="GLenum"/>
- <param name="id" type="GLuint"/>
- <param name="params" type="const GLfloat *" count="4"/>
- <glx rop="4181"/>
- </function>
-
- <function name="GenProgramsNV" offset="assign">
- <param name="n" type="GLsizei" counter="true"/>
- <param name="programs" type="GLuint *" output="true" count="n"/>
- <glx vendorpriv="1295" always_array="true"/>
- </function>
-
- <!-- This isn't 100% correct. Currently, the only valid value of pname
- is GL_PROGRAM_PARAMETER_NV, and the count for that pname is always
- 4. This is why the pname parameter was removed in the ARB version
- of these functions.
- -->
-
- <function name="GetProgramParameterdvNV" offset="assign">
- <param name="target" type="GLenum"/>
- <param name="index" type="GLuint"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLdouble *" output="true" count="4"/>
- <glx vendorpriv="1297"/>
- </function>
-
- <function name="GetProgramParameterfvNV" offset="assign">
- <param name="target" type="GLenum"/>
- <param name="index" type="GLuint"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLfloat *" output="true" count="4"/>
- <glx vendorpriv="1296"/>
- </function>
-
- <function name="GetProgramivNV" offset="assign">
- <param name="id" type="GLuint"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLint *" output="true" variable_param="pname"/>
- <glx vendorpriv="1298"/>
- </function>
-
- <function name="GetProgramStringNV" offset="assign">
- <param name="id" type="GLuint"/>
- <param name="pname" type="GLenum"/>
- <param name="program" type="GLubyte *" output="true"/>
- <glx vendorpriv="1299" handcode="server" always_array="true"/>
- </function>
-
- <function name="GetTrackMatrixivNV" offset="assign">
- <param name="target" type="GLenum"/>
- <param name="address" type="GLuint"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLint *" output="true" count="1"/>
- <glx vendorpriv="1300"/>
- </function>
-
- <function name="GetVertexAttribdvNV" offset="assign">
- <param name="index" type="GLuint"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLdouble *" output="true" variable_param="pname"/>
- <glx vendorpriv="1301"/>
- </function>
-
- <function name="GetVertexAttribfvNV" offset="assign">
- <param name="index" type="GLuint"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLfloat *" output="true" variable_param="pname"/>
- <glx vendorpriv="1302"/>
- </function>
-
- <function name="GetVertexAttribivNV" offset="assign">
- <param name="index" type="GLuint"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLint *" output="true" variable_param="pname"/>
- <glx vendorpriv="1303"/>
- </function>
-
- <function name="GetVertexAttribPointervNV" offset="assign">
- <param name="index" type="GLuint"/>
- <param name="pname" type="GLenum"/>
- <param name="pointer" type="GLvoid **" output="true"/>
- <glx handcode="true"/>
- </function>
-
- <function name="IsProgramNV" offset="assign">
- <param name="program" type="GLuint"/>
- <return type="GLboolean"/>
- <glx vendorpriv="1304"/>
- </function>
-
- <function name="LoadProgramNV" offset="assign">
- <param name="target" type="GLenum"/>
- <param name="id" type="GLuint"/>
- <param name="len" type="GLsizei" counter="true"/>
- <param name="program" type="const GLubyte *" count="len"/>
- <glx rop="4183"/>
- </function>
-
- <function name="ProgramParameter4dNV" alias="ProgramEnvParameter4dARB">
- <param name="target" type="GLenum"/>
- <param name="index" type="GLuint"/>
- <param name="x" type="GLdouble"/>
- <param name="y" type="GLdouble"/>
- <param name="z" type="GLdouble"/>
- <param name="w" type="GLdouble"/>
- </function>
-
- <function name="ProgramParameter4dvNV" alias="ProgramEnvParameter4dvARB">
- <param name="target" type="GLenum"/>
- <param name="index" type="GLuint"/>
- <param name="params" type="const GLdouble *"/>
- </function>
-
- <function name="ProgramParameter4fNV" alias="ProgramEnvParameter4fARB">
- <param name="target" type="GLenum"/>
- <param name="index" type="GLuint"/>
- <param name="x" type="GLfloat"/>
- <param name="y" type="GLfloat"/>
- <param name="z" type="GLfloat"/>
- <param name="w" type="GLfloat"/>
- </function>
-
- <function name="ProgramParameter4fvNV" alias="ProgramEnvParameter4fvARB">
- <param name="target" type="GLenum"/>
- <param name="index" type="GLuint"/>
- <param name="params" type="const GLfloat *"/>
- </function>
-
- <function name="ProgramParameters4dvNV" offset="assign">
- <param name="target" type="GLenum"/>
- <param name="index" type="GLuint"/>
- <param name="num" type="GLsizei" counter="true"/>
- <param name="params" type="const GLdouble *" count="num" count_scale="4"/>
- <glx rop="4187"/>
- </function>
-
- <function name="ProgramParameters4fvNV" offset="assign">
- <param name="target" type="GLenum"/>
- <param name="index" type="GLuint"/>
- <param name="num" type="GLsizei" counter="true"/>
- <param name="params" type="const GLfloat *" count="num" count_scale="4"/>
- <glx rop="4186"/>
- </function>
-
- <function name="RequestResidentProgramsNV" offset="assign">
- <param name="n" type="GLsizei" counter="true"/>
- <param name="ids" type="const GLuint *" count="n"/>
- <glx rop="4182"/>
- </function>
-
- <function name="TrackMatrixNV" offset="assign">
- <param name="target" type="GLenum"/>
- <param name="address" type="GLuint"/>
- <param name="matrix" type="GLenum"/>
- <param name="transform" type="GLenum"/>
- <glx rop="4188"/>
- </function>
-
- <function name="VertexAttribPointerNV" offset="assign">
- <param name="index" type="GLuint"/>
- <param name="size" type="GLint"/>
- <param name="type" type="GLenum"/>
- <param name="stride" type="GLsizei"/>
- <param name="pointer" type="const GLvoid *"/>
- <glx handcode="true"/>
- </function>
-
- <function name="VertexAttrib1sNV" offset="assign" vectorequiv="VertexAttrib1svNV">
- <param name="index" type="GLuint"/>
- <param name="x" type="GLshort"/>
- </function>
-
- <function name="VertexAttrib1svNV" offset="assign">
- <param name="index" type="GLuint"/>
- <param name="v" type="const GLshort *" count="1"/>
- <glx rop="4265"/>
- </function>
-
- <function name="VertexAttrib2sNV" offset="assign" vectorequiv="VertexAttrib2svNV">
- <param name="index" type="GLuint"/>
- <param name="x" type="GLshort"/>
- <param name="y" type="GLshort"/>
- </function>
-
- <function name="VertexAttrib2svNV" offset="assign">
- <param name="index" type="GLuint"/>
- <param name="v" type="const GLshort *" count="2"/>
- <glx rop="4266"/>
- </function>
-
- <function name="VertexAttrib3sNV" offset="assign" vectorequiv="VertexAttrib3svNV">
- <param name="index" type="GLuint"/>
- <param name="x" type="GLshort"/>
- <param name="y" type="GLshort"/>
- <param name="z" type="GLshort"/>
- </function>
-
- <function name="VertexAttrib3svNV" offset="assign">
- <param name="index" type="GLuint"/>
- <param name="v" type="const GLshort *" count="3"/>
- <glx rop="4267"/>
- </function>
-
- <function name="VertexAttrib4sNV" offset="assign" vectorequiv="VertexAttrib4svNV">
- <param name="index" type="GLuint"/>
- <param name="x" type="GLshort"/>
- <param name="y" type="GLshort"/>
- <param name="z" type="GLshort"/>
- <param name="w" type="GLshort"/>
- </function>
-
- <function name="VertexAttrib4svNV" offset="assign">
- <param name="index" type="GLuint"/>
- <param name="v" type="const GLshort *" count="4"/>
- <glx rop="4268"/>
- </function>
-
- <function name="VertexAttrib1fNV" offset="assign" vectorequiv="VertexAttrib1fvNV">
- <param name="index" type="GLuint"/>
- <param name="x" type="GLfloat"/>
- </function>
-
- <function name="VertexAttrib1fvNV" offset="assign">
- <param name="index" type="GLuint"/>
- <param name="v" type="const GLfloat *" count="1"/>
- <glx rop="4269"/>
- </function>
-
- <function name="VertexAttrib2fNV" offset="assign" vectorequiv="VertexAttrib2fvNV">
- <param name="index" type="GLuint"/>
- <param name="x" type="GLfloat"/>
- <param name="y" type="GLfloat"/>
- </function>
-
- <function name="VertexAttrib2fvNV" offset="assign">
- <param name="index" type="GLuint"/>
- <param name="v" type="const GLfloat *" count="2"/>
- <glx rop="4270"/>
- </function>
-
- <function name="VertexAttrib3fNV" offset="assign" vectorequiv="VertexAttrib3fvNV">
- <param name="index" type="GLuint"/>
- <param name="x" type="GLfloat"/>
- <param name="y" type="GLfloat"/>
- <param name="z" type="GLfloat"/>
- </function>
-
- <function name="VertexAttrib3fvNV" offset="assign">
- <param name="index" type="GLuint"/>
- <param name="v" type="const GLfloat *" count="3"/>
- <glx rop="4271"/>
- </function>
-
- <function name="VertexAttrib4fNV" offset="assign" vectorequiv="VertexAttrib4fvNV">
- <param name="index" type="GLuint"/>
- <param name="x" type="GLfloat"/>
- <param name="y" type="GLfloat"/>
- <param name="z" type="GLfloat"/>
- <param name="w" type="GLfloat"/>
- </function>
-
- <function name="VertexAttrib4fvNV" offset="assign">
- <param name="index" type="GLuint"/>
- <param name="v" type="const GLfloat *" count="4"/>
- <glx rop="4272"/>
- </function>
-
- <function name="VertexAttrib1dNV" offset="assign" vectorequiv="VertexAttrib1dvNV">
- <param name="index" type="GLuint"/>
- <param name="x" type="GLdouble"/>
- </function>
-
- <function name="VertexAttrib1dvNV" offset="assign">
- <param name="index" type="GLuint"/>
- <param name="v" type="const GLdouble *" count="1"/>
- <glx rop="4273" doubles_in_order="true"/>
- </function>
-
- <function name="VertexAttrib2dNV" offset="assign" vectorequiv="VertexAttrib2dvNV">
- <param name="index" type="GLuint"/>
- <param name="x" type="GLdouble"/>
- <param name="y" type="GLdouble"/>
- </function>
-
- <function name="VertexAttrib2dvNV" offset="assign">
- <param name="index" type="GLuint"/>
- <param name="v" type="const GLdouble *" count="2"/>
- <glx rop="4274" doubles_in_order="true"/>
- </function>
-
- <function name="VertexAttrib3dNV" offset="assign" vectorequiv="VertexAttrib3dvNV">
- <param name="index" type="GLuint"/>
- <param name="x" type="GLdouble"/>
- <param name="y" type="GLdouble"/>
- <param name="z" type="GLdouble"/>
- </function>
-
- <function name="VertexAttrib3dvNV" offset="assign">
- <param name="index" type="GLuint"/>
- <param name="v" type="const GLdouble *" count="3"/>
- <glx rop="4275" doubles_in_order="true"/>
- </function>
-
- <function name="VertexAttrib4dNV" offset="assign" vectorequiv="VertexAttrib4dvNV">
- <param name="index" type="GLuint"/>
- <param name="x" type="GLdouble"/>
- <param name="y" type="GLdouble"/>
- <param name="z" type="GLdouble"/>
- <param name="w" type="GLdouble"/>
- </function>
-
- <function name="VertexAttrib4dvNV" offset="assign">
- <param name="index" type="GLuint"/>
- <param name="v" type="const GLdouble *" count="4"/>
- <glx rop="4276" doubles_in_order="true"/>
- </function>
-
- <function name="VertexAttrib4ubNV" offset="assign" vectorequiv="VertexAttrib4ubvNV">
- <param name="index" type="GLuint"/>
- <param name="x" type="GLubyte"/>
- <param name="y" type="GLubyte"/>
- <param name="z" type="GLubyte"/>
- <param name="w" type="GLubyte"/>
- </function>
-
- <function name="VertexAttrib4ubvNV" offset="assign">
- <param name="index" type="GLuint"/>
- <param name="v" type="const GLubyte *" count="4"/>
- <glx rop="4277"/>
- </function>
-
- <function name="VertexAttribs1svNV" offset="assign">
- <param name="index" type="GLuint"/>
- <param name="n" type="GLsizei" counter="true"/>
- <param name="v" type="const GLshort *" count="n"/>
- <glx rop="4202"/>
- </function>
-
- <function name="VertexAttribs2svNV" offset="assign">
- <param name="index" type="GLuint"/>
- <param name="n" type="GLsizei" counter="true"/>
- <param name="v" type="const GLshort *" count="n" count_scale="2"/>
- <glx rop="4203"/>
- </function>
-
- <function name="VertexAttribs3svNV" offset="assign">
- <param name="index" type="GLuint"/>
- <param name="n" type="GLsizei" counter="true"/>
- <param name="v" type="const GLshort *" count="n" count_scale="3"/>
- <glx rop="4204"/>
- </function>
-
- <function name="VertexAttribs4svNV" offset="assign">
- <param name="index" type="GLuint"/>
- <param name="n" type="GLsizei" counter="true"/>
- <param name="v" type="const GLshort *" count="n" count_scale="4"/>
- <glx rop="4205"/>
- </function>
-
- <function name="VertexAttribs1fvNV" offset="assign">
- <param name="index" type="GLuint"/>
- <param name="n" type="GLsizei" counter="true"/>
- <param name="v" type="const GLfloat *" count="n"/>
- <glx rop="4206"/>
- </function>
-
- <function name="VertexAttribs2fvNV" offset="assign">
- <param name="index" type="GLuint"/>
- <param name="n" type="GLsizei" counter="true"/>
- <param name="v" type="const GLfloat *" count="n" count_scale="2"/>
- <glx rop="4207"/>
- </function>
-
- <function name="VertexAttribs3fvNV" offset="assign">
- <param name="index" type="GLuint"/>
- <param name="n" type="GLsizei" counter="true"/>
- <param name="v" type="const GLfloat *" count="n" count_scale="3"/>
- <glx rop="4208"/>
- </function>
-
- <function name="VertexAttribs4fvNV" offset="assign">
- <param name="index" type="GLuint"/>
- <param name="n" type="GLsizei" counter="true"/>
- <param name="v" type="const GLfloat *" count="n" count_scale="4"/>
- <glx rop="4209"/>
- </function>
-
- <function name="VertexAttribs1dvNV" offset="assign">
- <param name="index" type="GLuint"/>
- <param name="n" type="GLsizei" counter="true"/>
- <param name="v" type="const GLdouble *" count="n"/>
- <glx rop="4210" doubles_in_order="true"/>
- </function>
-
- <function name="VertexAttribs2dvNV" offset="assign">
- <param name="index" type="GLuint"/>
- <param name="n" type="GLsizei" counter="true"/>
- <param name="v" type="const GLdouble *" count="n" count_scale="2"/>
- <glx rop="4211" doubles_in_order="true"/>
- </function>
-
- <function name="VertexAttribs3dvNV" offset="assign">
- <param name="index" type="GLuint"/>
- <param name="n" type="GLsizei" counter="true"/>
- <param name="v" type="const GLdouble *" count="n" count_scale="3"/>
- <glx rop="4212" doubles_in_order="true"/>
- </function>
-
- <function name="VertexAttribs4dvNV" offset="assign">
- <param name="index" type="GLuint"/>
- <param name="n" type="GLsizei" counter="true"/>
- <param name="v" type="const GLdouble *" count="n" count_scale="4"/>
- <glx rop="4213" doubles_in_order="true"/>
- </function>
-
- <function name="VertexAttribs4ubvNV" offset="assign">
- <param name="index" type="GLuint"/>
- <param name="n" type="GLsizei" counter="true"/>
- <param name="v" type="const GLubyte *" count="n" count_scale="4"/>
- <glx rop="4214"/>
- </function>
-</category>
-
-<!-- Extension number 234 is a GLX extension. -->
-
-<category name="GL_SGIX_texture_coordinate_clamp" number="235">
- <enum name="TEXTURE_MAX_CLAMP_S_SGIX" count="1" value="0x8369">
- <size name="TexParameterfv"/>
- <size name="TexParameteriv"/>
- <size name="GetTexParameterfv" mode="get"/>
- <size name="GetTexParameteriv" mode="get"/>
- </enum>
- <enum name="TEXTURE_MAX_CLAMP_T_SGIX" count="1" value="0x836A">
- <size name="TexParameterfv"/>
- <size name="TexParameteriv"/>
- <size name="GetTexParameterfv" mode="get"/>
- <size name="GetTexParameteriv" mode="get"/>
- </enum>
- <enum name="TEXTURE_MAX_CLAMP_R_SGIX" count="1" value="0x836B">
- <size name="TexParameterfv"/>
- <size name="TexParameteriv"/>
- <size name="GetTexParameterfv" mode="get"/>
- <size name="GetTexParameteriv" mode="get"/>
- </enum>
-</category>
-
-<!-- Extension number 236 is not listed in the extension registry. -->
-<!-- Extension number 237 is a GLX extension. -->
-<!-- Extension number 238 is a GLX extension. -->
-<!-- Extension number 242 is a WGL extension. -->
-
-<category name="GL_NV_copy_depth_to_color" number="243">
- <enum name="DEPTH_STENCIL_TO_RGBA_NV" value="0x886E"/>
- <enum name="DEPTH_STENCIL_TO_BGRA_NV" value="0x886F"/>
-</category>
-
-<category name="GL_ATI_envmap_bumpmap" number="244">
- <enum name="BUMP_ROT_MATRIX_ATI" count="4" value="0x8775">
- <size name="TexBumpParameterfv"/>
- <size name="TexBumpParameteriv"/>
- <size name="GetTexBumpParameterfv" mode="get"/>
- <size name="GetTexBumpParameteriv" mode="get"/>
- </enum>
- <enum name="BUMP_ROT_MATRIX_SIZE_ATI" count="1" value="0x8776">
- <size name="GetTexBumpParameterfv" mode="get"/>
- <size name="GetTexBumpParameteriv" mode="get"/>
- </enum>
- <enum name="BUMP_NUM_TEX_UNITS_ATI" count="1" value="0x8777">
- <size name="GetTexBumpParameterfv" mode="get"/>
- <size name="GetTexBumpParameteriv" mode="get"/>
- </enum>
- <enum name="BUMP_TEX_UNITS_ATI" count="-1" value="0x8778">
- <size name="GetTexBumpParameterfv" mode="get"/>
- <size name="GetTexBumpParameteriv" mode="get"/>
- </enum>
- <enum name="DUDV_ATI" value="0x8779"/>
- <enum name="DU8DV8_ATI" value="0x877A"/>
- <enum name="BUMP_ENVMAP_ATI" value="0x877B"/>
- <enum name="BUMP_TARGET_ATI" count="1" value="0x877C">
- <size name="TexEnviv"/>
- <size name="TexEnvfv"/>
- <size name="GetTexEnviv" mode="get"/>
- <size name="GetTexEnvfv" mode="get"/>
- </enum>
- <function name="TexBumpParameterfvATI" offset="assign">
- <param name="pname" type="GLenum"/>
- <param name="param" type="const GLfloat *" variable_param="pname"/>
- <glx ignore="true"/>
- </function>
- <function name="TexBumpParameterivATI" offset="assign">
- <param name="pname" type="GLenum"/>
- <param name="param" type="const GLint *" variable_param="pname"/>
- <glx ignore="true"/>
- </function>
- <function name="GetTexBumpParameterfvATI" offset="assign">
- <param name="pname" type="GLenum"/>
- <param name="param" type="GLfloat *" variable_param="pname"/>
- <glx ignore="true"/>
- </function>
- <function name="GetTexBumpParameterivATI" offset="assign">
- <param name="pname" type="GLenum"/>
- <param name="param" type="GLint *" variable_param="pname"/>
- <glx ignore="true"/>
- </function>
-</category>
-
-<category name="GL_ATI_fragment_shader" number="245">
- <function name="GenFragmentShadersATI" offset="assign">
- <return type="GLuint"/>
- <param name="range" type="GLuint"/>
- <glx ignore="true"/>
- </function>
-
- <function name="BindFragmentShaderATI" offset="assign">
- <param name="id" type="GLuint"/>
- <glx ignore="true"/>
- </function>
-
- <function name="DeleteFragmentShaderATI" offset="assign">
- <param name="id" type="GLuint"/>
- <glx ignore="true"/>
- </function>
-
- <function name="BeginFragmentShaderATI" offset="assign">
- <glx ignore="true"/>
- </function>
-
- <function name="EndFragmentShaderATI" offset="assign">
- <glx ignore="true"/>
- </function>
-
- <function name="PassTexCoordATI" offset="assign">
- <param name="dst" type="GLuint"/>
- <param name="coord" type="GLuint"/>
- <param name="swizzle" type="GLenum"/>
- <glx ignore="true"/>
- </function>
-
- <function name="SampleMapATI" offset="assign">
- <param name="dst" type="GLuint"/>
- <param name="interp" type="GLuint"/>
- <param name="swizzle" type="GLenum"/>
- <glx ignore="true"/>
- </function>
-
- <function name="ColorFragmentOp1ATI" offset="assign">
- <param name="op" type="GLenum"/>
- <param name="dst" type="GLuint"/>
- <param name="dstMask" type="GLuint"/>
- <param name="dstMod" type="GLuint"/>
- <param name="arg1" type="GLuint"/>
- <param name="arg1Rep" type="GLuint"/>
- <param name="arg1Mod" type="GLuint"/>
- <glx ignore="true"/>
- </function>
-
- <function name="ColorFragmentOp2ATI" offset="assign">
- <param name="op" type="GLenum"/>
- <param name="dst" type="GLuint"/>
- <param name="dstMask" type="GLuint"/>
- <param name="dstMod" type="GLuint"/>
- <param name="arg1" type="GLuint"/>
- <param name="arg1Rep" type="GLuint"/>
- <param name="arg1Mod" type="GLuint"/>
- <param name="arg2" type="GLuint"/>
- <param name="arg2Rep" type="GLuint"/>
- <param name="arg2Mod" type="GLuint"/>
- <glx ignore="true"/>
- </function>
-
- <function name="ColorFragmentOp3ATI" offset="assign">
- <param name="op" type="GLenum"/>
- <param name="dst" type="GLuint"/>
- <param name="dstMask" type="GLuint"/>
- <param name="dstMod" type="GLuint"/>
- <param name="arg1" type="GLuint"/>
- <param name="arg1Rep" type="GLuint"/>
- <param name="arg1Mod" type="GLuint"/>
- <param name="arg2" type="GLuint"/>
- <param name="arg2Rep" type="GLuint"/>
- <param name="arg2Mod" type="GLuint"/>
- <param name="arg3" type="GLuint"/>
- <param name="arg3Rep" type="GLuint"/>
- <param name="arg3Mod" type="GLuint"/>
- <glx ignore="true"/>
- </function>
-
- <function name="AlphaFragmentOp1ATI" offset="assign">
- <param name="op" type="GLenum"/>
- <param name="dst" type="GLuint"/>
- <param name="dstMod" type="GLuint"/>
- <param name="arg1" type="GLuint"/>
- <param name="arg1Rep" type="GLuint"/>
- <param name="arg1Mod" type="GLuint"/>
- <glx ignore="true"/>
- </function>
-
- <function name="AlphaFragmentOp2ATI" offset="assign">
- <param name="op" type="GLenum"/>
- <param name="dst" type="GLuint"/>
- <param name="dstMod" type="GLuint"/>
- <param name="arg1" type="GLuint"/>
- <param name="arg1Rep" type="GLuint"/>
- <param name="arg1Mod" type="GLuint"/>
- <param name="arg2" type="GLuint"/>
- <param name="arg2Rep" type="GLuint"/>
- <param name="arg2Mod" type="GLuint"/>
- <glx ignore="true"/>
- </function>
-
- <function name="AlphaFragmentOp3ATI" offset="assign">
- <param name="op" type="GLenum"/>
- <param name="dst" type="GLuint"/>
- <param name="dstMod" type="GLuint"/>
- <param name="arg1" type="GLuint"/>
- <param name="arg1Rep" type="GLuint"/>
- <param name="arg1Mod" type="GLuint"/>
- <param name="arg2" type="GLuint"/>
- <param name="arg2Rep" type="GLuint"/>
- <param name="arg2Mod" type="GLuint"/>
- <param name="arg3" type="GLuint"/>
- <param name="arg3Rep" type="GLuint"/>
- <param name="arg3Mod" type="GLuint"/>
- <glx ignore="true"/>
- </function>
-
- <function name="SetFragmentShaderConstantATI" offset="assign">
- <param name="dst" type="GLuint"/>
- <param name="value" type="const GLfloat *"/>
- <glx ignore="true"/>
- </function>
-</category>
-
-<!-- Extension number 250 is a WGL extension. -->
-<!-- Extension number 251 is a WGL extension. -->
-<!-- Extension number 252 is a WGL extension. -->
-<!-- Extension number 253 is a WGL extension. -->
-<!-- Extension number 254 is a WGL extension. -->
-<!-- Extension number 255 is a WGL extension. -->
-
-<category name="GL_SUN_mesh_array" number="257">
- <enum name="QUAD_MESH_SUN" value="0x8614"/>
- <enum name="TRIANGLE_MESH_SUN" value="0x8615"/>
-
- <function name="DrawMeshArraysSUN">
- <param name="mode" type="GLenum"/>
- <param name="first" type="GLint"/>
- <param name="count" type="GLsizei"/>
- <param name="width" type="GLsizei"/>
- </function>
-</category>
-
-<category name="GL_SUN_slice_accum" number="258">
- <enum name="SLICE_ACCUM_SUN" value="0x85CC"/>
-</category>
-
-<category name="GL_NV_multisample_filter_hint" number="259">
- <enum name="MULTISAMPLE_FILTER_HINT_NV" count="1" value="0x8534">
- <size name="Get" mode="get"/>
- </enum>
-</category>
-
-<category name="GL_NV_depth_clamp" number="260">
- <enum name="DEPTH_CLAMP_NV" count="1" value="0x864F">
- <size name="Get" mode="get"/>
- </enum>
-</category>
-
-<category name="GL_NV_point_sprite" number="262">
- <!-- These existing enums can be passed as a parameter to the function
- added for this extension. -->
-
- <enum name="POINT_SIZE_MIN_EXT" count="1" value="0x8126">
- <size name="PointParameterivNV"/>
- </enum>
- <enum name="POINT_SIZE_MAX_EXT" count="1" value="0x8127">
- <size name="PointParameterivNV"/>
- </enum>
- <enum name="POINT_FADE_THRESHOLD_SIZE_EXT" count="1" value="0x8128">
- <size name="PointParameterivNV"/>
- </enum>
- <enum name="POINT_DISTANCE_ATTENUATION_EXT" count="3" value="0x8129">
- <size name="PointParameterivNV"/>
- </enum>
-
- <enum name="POINT_SPRITE_NV" count="1" value="0x8861">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="COORD_REPLACE_NV" count="1" value="0x8862">
- <size name="TexEnvfv"/>
- <size name="TexEnviv"/>
- <size name="GetTexEnvfv" mode="get"/>
- <size name="GetTexEnviv" mode="get"/>
- </enum>
- <enum name="POINT_SPRITE_R_MODE_NV" count="1" value="0x8863">
- <size name="PointParameterfvEXT"/>
- <size name="PointParameterivNV"/>
- <size name="Get" mode="get"/>
- </enum>
-
- <function name="PointParameteriNV" offset="assign">
- <param name="pname" type="GLenum"/>
- <param name="param" type="GLint"/>
- <glx rop="4221"/>
- </function>
-
- <function name="PointParameterivNV" offset="assign">
- <param name="pname" type="GLenum"/>
- <param name="params" type="const GLint *" variable_param="pname"/>
- <glx rop="4222"/>
- </function>
-</category>
-
-<!-- Extension number 263 is a WGL extension. -->
-<!-- Extension number 264 is a WGL extension. -->
-
-<category name="GL_EXT_shadow_funcs" number="267">
- <!-- No new functions, types, enums. -->
-</category>
-
-<category name="GL_EXT_stencil_two_side" number="268">
- <enum name="STENCIL_TEST_TWO_SIDE_EXT" count="1" value="0x8910">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="ACTIVE_STENCIL_FACE_EXT" count="1" value="0x8911">
- <size name="Get" mode="get"/>
- </enum>
-
- <function name="ActiveStencilFaceEXT" offset="assign" static_dispatch="false">
- <param name="face" type="GLenum"/>
- <glx rop="4220"/>
- </function>
-</category>
-
-<xi:include href="APPLE_object_purgeable.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
-<xi:include href="APPLE_vertex_array_object.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
-
-<category name="GL_APPLE_ycbcr_422" number="275">
- <enum name="YCBCR_422_APPLE" value="0x85B9"/>
- <enum name="UNSIGNED_SHORT_8_8_APPLE" value="0x85BA"/>
- <enum name="UNSIGNED_SHORT_8_8_REV_APPLE" value="0x85BB"/>
-</category>
-
-<category name="GL_S3_s3tc" number="276">
- <enum name="RGB_S3TC" value="0x83A0"/>
- <enum name="RGB4_S3TC" value="0x83A1"/>
- <enum name="RGBA_S3TC" value="0x83A2"/>
- <enum name="RGBA4_S3TC" value="0x83A3"/>
- <enum name="RGBA_DXT5_S3TC" value="0x83A4"/>
- <enum name="RGBA4_DXT5_S3TC" value="0x83A5"/>
-</category>
-
-<category name="GL_ATI_draw_buffers" number="277">
- <enum name="MAX_DRAW_BUFFERS_ATI" count="1" value="0x8824">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="DRAW_BUFFER0_ATI" count="1" value="0x8825">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="DRAW_BUFFER1_ATI" count="1" value="0x8826">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="DRAW_BUFFER2_ATI" count="1" value="0x8827">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="DRAW_BUFFER3_ATI" count="1" value="0x8828">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="DRAW_BUFFER4_ATI" count="1" value="0x8829">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="DRAW_BUFFER5_ATI" count="1" value="0x882A">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="DRAW_BUFFER6_ATI" count="1" value="0x882B">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="DRAW_BUFFER7_ATI" count="1" value="0x882C">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="DRAW_BUFFER8_ATI" count="1" value="0x882D">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="DRAW_BUFFER9_ATI" count="1" value="0x882E">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="DRAW_BUFFER10_ATI" count="1" value="0x882F">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="DRAW_BUFFER11_ATI" count="1" value="0x8830">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="DRAW_BUFFER12_ATI" count="1" value="0x8831">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="DRAW_BUFFER13_ATI" count="1" value="0x8832">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="DRAW_BUFFER14_ATI" count="1" value="0x8833">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="DRAW_BUFFER15_ATI" count="1" value="0x8834">
- <size name="Get" mode="get"/>
- </enum>
-
- <function name="DrawBuffersATI" alias="DrawBuffersARB">
- <param name="n" type="GLsizei" counter="true"/>
- <param name="bufs" type="const GLenum *" count="n"/>
- </function>
-</category>
-
-<!-- Extension number 278 is a WGL extension. -->
-
-<category name="GL_ATI_texture_env_combine3" number="279">
- <enum name="MODULATE_ADD_ATI" value="0x8744"/>
- <enum name="MODULATE_SIGNED_ADD_ATI" value="0x8745"/>
- <enum name="MODULATE_SUBTRACT_ATI" value="0x8746"/>
-</category>
-
-<category name="GL_NV_fragment_program" number="282">
- <function name="ProgramNamedParameter4fNV" offset="assign" vectorequiv="ProgramNamedParameter4fvNV">
- <param name="id" type="GLuint"/>
- <param name="len" type="GLsizei" counter="true"/>
- <param name="name" type="const GLubyte *" count="len"/>
- <param name="x" type="GLfloat"/>
- <param name="y" type="GLfloat"/>
- <param name="z" type="GLfloat"/>
- <param name="w" type="GLfloat"/>
- </function>
-
- <function name="ProgramNamedParameter4dNV" offset="assign" vectorequiv="ProgramNamedParameter4dvNV">
- <param name="id" type="GLuint"/>
- <param name="len" type="GLsizei" counter="true"/>
- <param name="name" type="const GLubyte *" count="len"/>
- <param name="x" type="GLdouble"/>
- <param name="y" type="GLdouble"/>
- <param name="z" type="GLdouble"/>
- <param name="w" type="GLdouble"/>
- </function>
-
- <function name="ProgramNamedParameter4fvNV" offset="assign">
- <param name="id" type="GLuint"/>
- <param name="len" type="GLsizei" counter="true"/>
- <param name="name" type="const GLubyte *" count="len"/>
- <param name="v" type="const GLfloat *" count="4"/>
- <glx rop="4218"/>
- </function>
-
- <function name="ProgramNamedParameter4dvNV" offset="assign">
- <param name="id" type="GLuint"/>
- <param name="len" type="GLsizei" counter="true"/>
- <param name="name" type="const GLubyte *" count="len"/>
- <param name="v" type="const GLdouble *" count="4"/>
- <glx rop="4219"/>
- </function>
-
- <function name="GetProgramNamedParameterfvNV" offset="assign">
- <param name="id" type="GLuint"/>
- <param name="len" type="GLsizei" counter="true"/>
- <param name="name" type="const GLubyte *" count="len"/>
- <param name="params" type="GLfloat *" output="true" count="4"/>
- <glx vendorpriv="1310" always_array="true"/>
- </function>
-
- <function name="GetProgramNamedParameterdvNV" offset="assign">
- <param name="id" type="GLuint"/>
- <param name="len" type="GLsizei" counter="true"/>
- <param name="name" type="const GLubyte *" count="len"/>
- <param name="params" type="GLdouble *" output="true" count="4"/>
- <glx vendorpriv="1311" always_array="true"/>
- </function>
-</category>
-
-<category name="GL_NV_texture_expand_normal" number="286">
- <enum name="TEXTURE_UNSIGNED_REMAP_MODE_NV" count="1" value="0x888F">
- <size name="TexParameterfv"/>
- <size name="TexParameteriv"/>
- <size name="GetTexParameterfv" mode="get"/>
- <size name="GetTexParameteriv" mode="get"/>
- </enum>
-</category>
-
-<category name="GL_OES_compressed_paletted_texture" number="294">
- <enum name="PALETTE4_RGB8_OES" value="0x8B90"/>
- <enum name="PALETTE4_RGBA8_OES" value="0x8B91"/>
- <enum name="PALETTE4_R5_G6_B5_OES" value="0x8B92"/>
- <enum name="PALETTE4_RGBA4_OES" value="0x8B93"/>
- <enum name="PALETTE4_RGB5_A1_OES" value="0x8B94"/>
- <enum name="PALETTE8_RGB8_OES" value="0x8B95"/>
- <enum name="PALETTE8_RGBA8_OES" value="0x8B96"/>
- <enum name="PALETTE8_R5_G6_B5_OES" value="0x8B97"/>
- <enum name="PALETTE8_RGBA4_OES" value="0x8B98"/>
- <enum name="PALETTE8_RGB5_A1_OES" value="0x8B99"/>
-</category>
-
-<category name="GL_OES_read_format" number="295">
- <enum name="IMPLEMENTATION_COLOR_READ_TYPE_OES" value="0x8B9A"/>
- <enum name="IMPLEMENTATION_COLOR_READ_FORMAT_OES" value="0x8B9B"/>
-</category>
-
-<category name="GL_EXT_depth_bounds_test" number="297">
- <enum name="DEPTH_BOUNDS_TEST_EXT" count="1" value="0x8890">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="DEPTH_BOUNDS_EXT" count="2" value="0x8891">
- <size name="Get" mode="get"/>
- </enum>
-
- <function name="DepthBoundsEXT" offset="assign" static_dispatch="false">
- <param name="zmin" type="GLclampd"/>
- <param name="zmax" type="GLclampd"/>
- <glx rop="4229" ignore="true"/>
- </function>
-</category>
-
-<category name="GL_EXT_texture_mirror_clamp" number="298">
- <enum name="MIRROR_CLAMP_EXT" value="0x8742"/>
- <enum name="MIRROR_CLAMP_TO_EDGE_EXT" value="0x8743"/>
- <enum name="MIRROR_CLAMP_TO_BORDER_EXT" value="0x8912"/>
-</category>
-
-<category name="GL_EXT_blend_equation_separate" number="299">
- <enum name="BLEND_EQUATION_RGB_EXT" count="1" value="0x8009">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="BLEND_EQUATION_ALPHA_EXT" count="1" value="0x883D">
- <size name="Get" mode="get"/>
- </enum>
-
- <function name="BlendEquationSeparateEXT" offset="assign" static_dispatch="false">
- <param name="modeRGB" type="GLenum"/>
- <param name="modeA" type="GLenum"/>
- <glx rop="4228"/>
- </function>
-</category>
-
-<category name="GL_MESA_pack_invert" number="300">
- <enum name="PACK_INVERT_MESA" count="1" value="0x8758">
- <size name="Get" mode="get"/>
- </enum>
-</category>
-
-<category name="GL_MESA_ycbcr_texture" number="301">
- <enum name="YCBCR_MESA" value="0x8757"/>
- <enum name="UNSIGNED_SHORT_8_8_MESA" value="0x85BA"/>
- <enum name="UNSIGNED_SHORT_8_8_REV_MESA" value="0x85BB"/>
-</category>
-
-<category name="GL_EXT_pixel_buffer_object" number="302">
- <enum name="PIXEL_PACK_BUFFER_EXT" value="0x88EB"/>
- <enum name="PIXEL_UNPACK_BUFFER_EXT" value="0x88EC"/>
- <enum name="PIXEL_PACK_BUFFER_BINDING_EXT" value="0x88ED"/>
- <enum name="PIXEL_UNPACK_BUFFER_BINDING_EXT" value="0x88EF"/>
-</category>
-
-<category name="GL_NV_fragment_program_option" number="303">
- <!-- No new functions, types, enums. -->
-</category>
-
-<category name="GL_NV_fragment_program2" number="304">
- <enum name="MAX_PROGRAM_EXEC_INSTRUCTIONS_NV" count="1" value="0x88F4">
- <size name="GetProgramivARB" mode="get"/>
- </enum>
- <enum name="MAX_PROGRAM_CALL_DEPTH_NV" count="1" value="0x88F5">
- <size name="GetProgramivARB" mode="get"/>
- </enum>
- <enum name="MAX_PROGRAM_IF_DEPTH_NV" count="1" value="0x88F6">
- <size name="GetProgramivARB" mode="get"/>
- </enum>
- <enum name="MAX_PROGRAM_LOOP_DEPTH_NV" count="1" value="0x88F7">
- <size name="GetProgramivARB" mode="get"/>
- </enum>
- <enum name="MAX_PROGRAM_LOOP_COUNT_NV" count="1" value="0x88F8">
- <size name="GetProgramivARB" mode="get"/>
- </enum>
-</category>
-
-<category name="GL_NV_vertex_program2_option" number="305">
- <enum name="MAX_PROGRAM_EXEC_INSTRUCTIONS_NV" count="1" value="0x88F4">
- <size name="GetProgramivARB" mode="get"/>
- </enum>
- <enum name="MAX_PROGRAM_CALL_DEPTH_NV" count="1" value="0x88F5">
- <size name="GetProgramivARB" mode="get"/>
- </enum>
-</category>
-
-<category name="GL_NV_vertex_program3" number="306">
- <enum name="MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB" count="1" value="0x8B4C"/>
-</category>
-
-<!-- Extension number 307 is a GLX extension. -->
-<!-- Extension number 308 is a GLX extension. -->
-
-<category name="GL_EXT_texture_compression_dxt1" number="309">
- <enum name="COMPRESSED_RGB_S3TC_DXT1_EXT" value="0x83F0"/>
- <enum name="COMPRESSED_RGBA_S3TC_DXT1_EXT" value="0x83F1"/>
-</category>
-
-<xi:include href="EXT_framebuffer_object.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
-
-<xi:include href="EXT_packed_depth_stencil.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
-
-<xi:include href="EXT_provoking_vertex.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
-
-<xi:include href="EXT_draw_buffers2.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
-
-
-<category name="GL_APPLE_flush_buffer_range" number="321">
- <enum name="BUFFER_SERIALIZED_MODIFY_APPLE" count="1" value="0x8A12">
- <size name="GetBufferParameteriv" mode="get"/>
- </enum>
- <enum name="BUFFER_FLUSHING_UNMAP_APPLE" count="1" value="0x8A13">
- <size name="GetBufferParameteriv" mode="get"/>
- </enum>
- <function name="BufferParameteriAPPLE" offset="assign" static_dispatch="false">
- <param name="target" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="param" type="GLint"/>
- </function>
- <function name="FlushMappedBufferRangeAPPLE" offset="assign" static_dispatch="false">
- <param name="target" type="GLenum"/>
- <param name="offset" type="GLintptr"/>
- <param name="size" type="GLsizeiptr"/>
- </function>
-</category>
-
-<xi:include href="EXT_texture_array.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
-
-<category name="GL_APPLE_texture_range" number="367">
- <enum name="TEXTURE_STORAGE_HINT_APPLE" count="1" value="0x85BC">
- <size name="TexParameteriv"/>
- <size name="TexParameterfv"/>
- <size name="GetTexParameteriv" mode="get"/>
- <size name="GetTexParameterfv" mode="get"/>
- </enum>
- <enum name="STORAGE_PRIVATE_APPLE" count="1" value="0x85BD">
- <size name="TexParameteriv"/>
- <size name="TexParameterfv"/>
- </enum>
- <enum name="STORAGE_CACHED_APPLE" count="1" value="0x85BE">
- <size name="TexParameteriv"/>
- <size name="TexParameterfv"/>
- </enum>
- <enum name="STORAGE_SHARED_APPLE" count="1" value="0x85BF">
- <size name="TexParameteriv"/>
- <size name="TexParameterfv"/>
- </enum>
- <enum name="TEXTURE_RANGE_LENGTH_APPLE" count="1" value="0x85B7">
- <size name="GetTexParameteriv" mode="get"/>
- <size name="GetTexParameterfv" mode="get"/>
- </enum>
- <enum name="TEXTURE_RANGE_POINTER_APPLE" count="1" value="0x85B8">
- <size name="GetTexParameterPointervAPPLE" mode="get"/>
- </enum>
- <function name="TextureRangeAPPLE" offset="assign" static_dispatch="false">
- <param name="target" type="GLenum"/>
- <param name="length" type="GLsizei"/>
- <param name="pointer" type="GLvoid *"/>
- </function>
- <function name="GetTexParameterPointervAPPLE" offset="assign" static_dispatch="false">
- <param name="target" type="GLenum"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLvoid **"/>
- </function>
-</category>
-
-<xi:include href="EXT_separate_shader_objects.xml"
- xmlns:xi="http://www.w3.org/2001/XInclude"/>
-
-<!-- Unnumbered extensions sorted by name. -->
-
-<category name="GL_ATI_blend_equation_separate">
- <function name="BlendEquationSeparateATI" alias="BlendEquationSeparateEXT" static_dispatch="false">
- <param name="modeRGB" type="GLenum"/>
- <param name="modeA" type="GLenum"/>
- </function>
-</category>
-
-<category name="GL_ATI_separate_stencil">
- <enum name="STENCIL_BACK_FUNC_ATI" count="1" value="0x8800">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="STENCIL_BACK_FAIL_ATI" count="1" value="0x8801">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="STENCIL_BACK_PASS_DEPTH_FAIL_ATI" count="1" value="0x8802">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="STENCIL_BACK_PASS_DEPTH_PASS_ATI" count="1" value="0x8803">
- <size name="Get" mode="get"/>
- </enum>
-
- <function name="StencilOpSeparateATI" alias="StencilOpSeparate" static_dispatch="false">
- <param name="face" type="GLenum"/>
- <param name="sfail" type="GLenum"/>
- <param name="zfail" type="GLenum"/>
- <param name="zpass" type="GLenum"/>
- </function>
- <function name="StencilFuncSeparateATI" offset="assign" static_dispatch="false">
- <param name="frontfunc" type="GLenum"/>
- <param name="backfunc" type="GLenum"/>
- <param name="ref" type="GLint"/>
- <param name="mask" type="GLuint"/>
- </function>
-
-</category>
-
-<category name="GL_EXT_gpu_program_parameters">
- <function name="ProgramEnvParameters4fvEXT" offset="assign" static_dispatch="false">
- <param name="target" type="GLenum"/>
- <param name="index" type="GLuint"/>
- <param name="count" type="GLsizei"/>
- <param name="params" type="const GLfloat *"/>
- </function>
-
- <function name="ProgramLocalParameters4fvEXT" offset="assign" static_dispatch="false">
- <param name="target" type="GLenum"/>
- <param name="index" type="GLuint"/>
- <param name="count" type="GLsizei"/>
- <param name="params" type="const GLfloat *"/>
- </function>
-</category>
-
-<category name="GL_EXT_timer_query">
- <enum name="TIME_ELAPSED_EXT" value="0x88BF"/>
- <type name="int64EXT" size="8"/>
- <type name="uint64EXT" unsigned="true" size="8"/>
- <function name="GetQueryObjecti64vEXT" offset="assign" static_dispatch="false">
- <param name="id" type="GLuint"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLint64EXT *"/>
- </function>
- <function name="GetQueryObjectui64vEXT" offset="assign" static_dispatch="false">
- <param name="id" type="GLuint"/>
- <param name="pname" type="GLenum"/>
- <param name="params" type="GLuint64EXT *"/>
- </function>
-</category>
-
-<category name="GL_INGR_blend_func_separate">
- <function name="BlendFuncSeparateINGR" alias="BlendFuncSeparateEXT" static_dispatch="false">
- <param name="sfactorRGB" type="GLenum"/>
- <param name="dfactorRGB" type="GLenum"/>
- <param name="sfactorAlpha" type="GLenum"/>
- <param name="dfactorAlpha" type="GLenum"/>
- </function>
-</category>
-
-<category name="GL_MESA_texture_signed_rgba">
- <enum name="SIGNED_NORMALIZED" value="0x8F9C"/>
- <enum name="RGBA_SNORM" value="0x8F93"/>
- <enum name="RGBA8_SNORM" value="0x8F97"/>
-</category>
-
-<category name="GL_MESA_shader_debug">
- <enum name="DEBUG_OBJECT_MESA" value="0x8759"/>
- <enum name="DEBUG_PRINT_MESA" value="0x875A"/>
- <enum name="DEBUG_ASSERT_MESA" value="0x875B"/>
- <function name="CreateDebugObjectMESA">
- <return type="GLhandleARB"/>
- <glx ignore="true"/>
- </function>
- <function name="ClearDebugLogMESA">
- <param name="obj" type="GLhandleARB"/>
- <param name="logType" type="GLenum"/>
- <param name="shaderType" type="GLenum"/>
- <glx ignore="true"/>
- </function>
- <function name="GetDebugLogMESA">
- <param name="obj" type="GLhandleARB"/>
- <param name="logType" type="GLenum"/>
- <param name="shaderType" type="GLenum"/>
- <param name="maxLength" type="GLsizei"/>
- <param name="length" type="GLsizei *" output="true"/>
- <param name="debugLog" type="GLcharARB *" output="true"/>
- <glx ignore="true"/>
- </function>
- <function name="GetDebugLogLengthMESA">
- <return type="GLsizei"/>
- <param name="obj" type="GLhandleARB"/>
- <param name="logType" type="GLenum"/>
- <param name="shaderType" type="GLenum"/>
- <glx ignore="true"/>
- </function>
-</category>
-
-<category name="GL_SGIS_point_parameters">
- <enum name="POINT_SIZE_MIN_SGIS" count="1" value="0x8126">
- <size name="PointParameterfvEXT"/>
- </enum>
- <enum name="POINT_SIZE_MAX_SGIS" count="1" value="0x8127">
- <size name="PointParameterfvEXT"/>
- </enum>
- <enum name="POINT_FADE_THRESHOLD_SIZE_SGIS" count="1" value="0x8128">
- <size name="PointParameterfvEXT"/>
- </enum>
- <enum name="POINT_DISTANCE_ATTENUATION_SGIS" count="3" value="0x8129">
- <size name="PointParameterfvEXT"/>
- </enum>
-
- <function name="PointParameterfSGIS" alias="PointParameterfEXT" static_dispatch="false">
- <param name="pname" type="GLenum"/>
- <param name="param" type="GLfloat"/>
- </function>
-
- <function name="PointParameterfvSGIS" alias="PointParameterfvEXT" static_dispatch="false">
- <param name="pname" type="GLenum"/>
- <param name="params" type="const GLfloat *"/>
- </function>
-</category>
-
-<category name="GL_SGIX_igloo_interface">
- <function name="IglooInterfaceSGIX">
- <param name="pname" type="GLenum"/>
- <param name="params" type="const GLvoid *"/>
- </function>
-</category>
-
-<category name="GL_SGIX_polynomial_ffd">
- <function name="DeformationMap3dSGIX">
- <param name="target" type="GLenum"/>
- <param name="u1" type="GLdouble"/>
- <param name="u2" type="GLdouble"/>
- <param name="ustride" type="GLint"/>
- <param name="uorder" type="GLint"/>
- <param name="v1" type="GLdouble"/>
- <param name="v2" type="GLdouble"/>
- <param name="vstride" type="GLint"/>
- <param name="vorder" type="GLint"/>
- <param name="w1" type="GLdouble"/>
- <param name="w2" type="GLdouble"/>
- <param name="wstride" type="GLint"/>
- <param name="worder" type="GLint"/>
- <param name="points" type="const GLdouble *"/>
- </function>
-
- <function name="DeformationMap3fSGIX">
- <param name="target" type="GLenum"/>
- <param name="u1" type="GLfloat"/>
- <param name="u2" type="GLfloat"/>
- <param name="ustride" type="GLint"/>
- <param name="uorder" type="GLint"/>
- <param name="v1" type="GLfloat"/>
- <param name="v2" type="GLfloat"/>
- <param name="vstride" type="GLint"/>
- <param name="vorder" type="GLint"/>
- <param name="w1" type="GLfloat"/>
- <param name="w2" type="GLfloat"/>
- <param name="wstride" type="GLint"/>
- <param name="worder" type="GLint"/>
- <param name="points" type="const GLfloat *"/>
- </function>
-
- <function name="DeformSGIX">
- <param name="mask" type="GLenum"/>
- </function>
-
- <function name="LoadIdentityDeformationMapSGIX">
- <param name="mask" type="GLenum"/>
- </function>
-</category>
-
-<xi:include href="OES_EGL_image.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
-
-<xi:include href="EXT_texture_integer.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
-
-<xi:include href="EXT_gpu_shader4.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
-<xi:include href="GL3x.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
-
-<xi:include href="ARB_instanced_arrays.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
-
-<xi:include href="ARB_draw_buffers_blend.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
-<xi:include href="AMD_draw_buffers_blend.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
-
-<xi:include href="ARB_texture_buffer_object.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
-
-</OpenGLAPI>
+<?xml version="1.0"?>
+<!DOCTYPE OpenGLAPI SYSTEM "gl_API.dtd">
+
+<OpenGLAPI>
+
+<!-- Core versions sorted by version number. -->
+
+<category name="1.0">
+ <enum name="FALSE" value="0x0"/>
+ <enum name="TRUE" value="0x1"/>
+ <enum name="ZERO" value="0x0"/>
+ <enum name="ONE" value="0x1"/>
+ <enum name="NONE" value="0x0"/>
+ <enum name="NO_ERROR" value="0x0"/>
+ <enum name="POINTS" value="0x0000"/>
+ <enum name="LINES" value="0x0001"/>
+ <enum name="LINE_LOOP" value="0x0002"/>
+ <enum name="LINE_STRIP" value="0x0003"/>
+ <enum name="TRIANGLES" value="0x0004"/>
+ <enum name="TRIANGLE_STRIP" value="0x0005"/>
+ <enum name="TRIANGLE_FAN" value="0x0006"/>
+ <enum name="QUADS" value="0x0007"/>
+ <enum name="QUAD_STRIP" value="0x0008"/>
+ <enum name="POLYGON" value="0x0009"/>
+ <enum name="ACCUM" value="0x0100"/>
+ <enum name="LOAD" value="0x0101"/>
+ <enum name="RETURN" value="0x0102"/>
+ <enum name="MULT" value="0x0103"/>
+ <enum name="ADD" value="0x0104"/>
+ <enum name="NEVER" value="0x0200"/>
+ <enum name="LESS" value="0x0201"/>
+ <enum name="EQUAL" value="0x0202"/>
+ <enum name="LEQUAL" value="0x0203"/>
+ <enum name="GREATER" value="0x0204"/>
+ <enum name="NOTEQUAL" value="0x0205"/>
+ <enum name="GEQUAL" value="0x0206"/>
+ <enum name="ALWAYS" value="0x0207"/>
+ <enum name="SRC_COLOR" value="0x0300"/>
+ <enum name="ONE_MINUS_SRC_COLOR" value="0x0301"/>
+ <enum name="SRC_ALPHA" value="0x0302"/>
+ <enum name="ONE_MINUS_SRC_ALPHA" value="0x0303"/>
+ <enum name="DST_ALPHA" value="0x0304"/>
+ <enum name="ONE_MINUS_DST_ALPHA" value="0x0305"/>
+ <enum name="DST_COLOR" value="0x0306"/>
+ <enum name="ONE_MINUS_DST_COLOR" value="0x0307"/>
+ <enum name="SRC_ALPHA_SATURATE" value="0x0308"/>
+ <enum name="FRONT_LEFT" value="0x0400"/>
+ <enum name="FRONT_RIGHT" value="0x0401"/>
+ <enum name="BACK_LEFT" value="0x0402"/>
+ <enum name="BACK_RIGHT" value="0x0403"/>
+ <enum name="FRONT" value="0x0404"/>
+ <enum name="BACK" value="0x0405"/>
+ <enum name="LEFT" value="0x0406"/>
+ <enum name="RIGHT" value="0x0407"/>
+ <enum name="FRONT_AND_BACK" value="0x0408"/>
+ <enum name="AUX0" value="0x0409"/>
+ <enum name="AUX1" value="0x040A"/>
+ <enum name="AUX2" value="0x040B"/>
+ <enum name="AUX3" value="0x040C"/>
+ <enum name="INVALID_VALUE" value="0x0501"/>
+ <enum name="INVALID_ENUM" value="0x0500"/>
+ <enum name="INVALID_OPERATION" value="0x0502"/>
+ <enum name="STACK_OVERFLOW" value="0x0503"/>
+ <enum name="STACK_UNDERFLOW" value="0x0504"/>
+ <enum name="OUT_OF_MEMORY" value="0x0505"/>
+ <enum name="2D" value="0x0600"/>
+ <enum name="3D" value="0x0601"/>
+ <enum name="3D_COLOR" value="0x0602"/>
+ <enum name="3D_COLOR_TEXTURE" value="0x0603"/>
+ <enum name="4D_COLOR_TEXTURE" value="0x0604"/>
+ <enum name="PASS_THROUGH_TOKEN" value="0x0700"/>
+ <enum name="POINT_TOKEN" value="0x0701"/>
+ <enum name="LINE_TOKEN" value="0x0702"/>
+ <enum name="POLYGON_TOKEN" value="0x0703"/>
+ <enum name="BITMAP_TOKEN" value="0x0704"/>
+ <enum name="DRAW_PIXEL_TOKEN" value="0x0705"/>
+ <enum name="COPY_PIXEL_TOKEN" value="0x0706"/>
+ <enum name="LINE_RESET_TOKEN" value="0x0707"/>
+ <enum name="EXP" value="0x0800"/>
+ <enum name="EXP2" value="0x0801"/>
+ <enum name="CW" value="0x0900"/>
+ <enum name="CCW" value="0x0901"/>
+ <enum name="COEFF" value="0x0A00"/>
+ <enum name="ORDER" value="0x0A01"/>
+ <enum name="DOMAIN" value="0x0A02"/>
+ <enum name="CURRENT_COLOR" count="4" value="0x0B00">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="CURRENT_INDEX" count="1" value="0x0B01">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="CURRENT_NORMAL" count="3" value="0x0B02">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="CURRENT_TEXTURE_COORDS" count="4" value="0x0B03">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="CURRENT_RASTER_COLOR" count="4" value="0x0B04">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="CURRENT_RASTER_INDEX" count="1" value="0x0B05">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="CURRENT_RASTER_TEXTURE_COORDS" count="4" value="0x0B06">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="CURRENT_RASTER_POSITION" count="4" value="0x0B07">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="CURRENT_RASTER_POSITION_VALID" count="1" value="0x0B08">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="CURRENT_RASTER_DISTANCE" count="1" value="0x0B09">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="POINT_SMOOTH" count="1" value="0x0B10">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="POINT_SIZE" count="1" value="0x0B11">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="POINT_SIZE_RANGE" count="2" value="0x0B12">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="POINT_SIZE_GRANULARITY" count="1" value="0x0B13">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="LINE_SMOOTH" count="1" value="0x0B20">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="LINE_WIDTH" count="1" value="0x0B21">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="LINE_WIDTH_RANGE" count="2" value="0x0B22">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="LINE_WIDTH_GRANULARITY" count="1" value="0x0B23">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="LINE_STIPPLE" count="1" value="0x0B24">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="LINE_STIPPLE_PATTERN" count="1" value="0x0B25">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="LINE_STIPPLE_REPEAT" count="1" value="0x0B26">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="LIST_MODE" count="1" value="0x0B30">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="MAX_LIST_NESTING" count="1" value="0x0B31">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="LIST_BASE" count="1" value="0x0B32">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="LIST_INDEX" count="1" value="0x0B33">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="POLYGON_MODE" count="2" value="0x0B40">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="POLYGON_SMOOTH" count="1" value="0x0B41">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="POLYGON_STIPPLE" count="1" value="0x0B42">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="EDGE_FLAG" count="1" value="0x0B43">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="CULL_FACE" count="1" value="0x0B44">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="CULL_FACE_MODE" count="1" value="0x0B45">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="FRONT_FACE" count="1" value="0x0B46">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="LIGHTING" count="1" value="0x0B50">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="LIGHT_MODEL_LOCAL_VIEWER" count="1" value="0x0B51">
+ <size name="LightModelfv" mode="get"/>
+ <size name="LightModeliv" mode="get"/>
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="LIGHT_MODEL_TWO_SIDE" count="1" value="0x0B52">
+ <size name="LightModelfv" mode="get"/>
+ <size name="LightModeliv" mode="get"/>
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="LIGHT_MODEL_AMBIENT" count="4" value="0x0B53">
+ <size name="LightModelfv" mode="get"/>
+ <size name="LightModeliv" mode="get"/>
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="SHADE_MODEL" count="1" value="0x0B54">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="COLOR_MATERIAL_FACE" count="1" value="0x0B55">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="COLOR_MATERIAL_PARAMETER" count="1" value="0x0B56">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="COLOR_MATERIAL" count="1" value="0x0B57">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="FOG" count="1" value="0x0B60">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="FOG_INDEX" count="1" value="0x0B61">
+ <size name="Fogfv" mode="get"/>
+ <size name="Fogiv" mode="get"/>
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="FOG_DENSITY" count="1" value="0x0B62">
+ <size name="Fogfv" mode="get"/>
+ <size name="Fogiv" mode="get"/>
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="FOG_START" count="1" value="0x0B63">
+ <size name="Fogfv" mode="get"/>
+ <size name="Fogiv" mode="get"/>
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="FOG_END" count="1" value="0x0B64">
+ <size name="Fogfv" mode="get"/>
+ <size name="Fogiv" mode="get"/>
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="FOG_MODE" count="1" value="0x0B65">
+ <size name="Fogfv" mode="get"/>
+ <size name="Fogiv" mode="get"/>
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="FOG_COLOR" count="4" value="0x0B66">
+ <size name="Fogfv" mode="get"/>
+ <size name="Fogiv" mode="get"/>
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="DEPTH_RANGE" count="2" value="0x0B70">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="DEPTH_TEST" count="1" value="0x0B71">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="DEPTH_WRITEMASK" count="1" value="0x0B72">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="DEPTH_CLEAR_VALUE" count="1" value="0x0B73">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="DEPTH_FUNC" count="1" value="0x0B74">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="ACCUM_CLEAR_VALUE" count="4" value="0x0B80">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="STENCIL_TEST" count="1" value="0x0B90">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="STENCIL_CLEAR_VALUE" count="1" value="0x0B91">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="STENCIL_FUNC" count="1" value="0x0B92">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="STENCIL_VALUE_MASK" count="1" value="0x0B93">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="STENCIL_FAIL" count="1" value="0x0B94">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="STENCIL_PASS_DEPTH_FAIL" count="1" value="0x0B95">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="STENCIL_PASS_DEPTH_PASS" count="1" value="0x0B96">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="STENCIL_REF" count="1" value="0x0B97">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="STENCIL_WRITEMASK" count="1" value="0x0B98">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="MATRIX_MODE" count="1" value="0x0BA0">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="NORMALIZE" count="1" value="0x0BA1">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="VIEWPORT" count="4" value="0x0BA2">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="MODELVIEW_STACK_DEPTH" count="1" value="0x0BA3">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="PROJECTION_STACK_DEPTH" count="1" value="0x0BA4">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="TEXTURE_STACK_DEPTH" count="1" value="0x0BA5">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="MODELVIEW_MATRIX" count="16" value="0x0BA6">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="PROJECTION_MATRIX" count="16" value="0x0BA7">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="TEXTURE_MATRIX" count="16" value="0x0BA8">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="ATTRIB_STACK_DEPTH" count="1" value="0x0BB0">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="CLIENT_ATTRIB_STACK_DEPTH" count="1" value="0x0BB1">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="ALPHA_TEST" count="1" value="0x0BC0">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="ALPHA_TEST_FUNC" count="1" value="0x0BC1">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="ALPHA_TEST_REF" count="1" value="0x0BC2">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="DITHER" count="1" value="0x0BD0">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="BLEND_DST" count="1" value="0x0BE0">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="BLEND_SRC" count="1" value="0x0BE1">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="BLEND" count="1" value="0x0BE2">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="LOGIC_OP_MODE" count="1" value="0x0BF0">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="LOGIC_OP" count="1" value="0x0BF1">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="AUX_BUFFERS" count="1" value="0x0C00">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="DRAW_BUFFER" count="1" value="0x0C01">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="READ_BUFFER" count="1" value="0x0C02">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="SCISSOR_BOX" count="4" value="0x0C10">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="SCISSOR_TEST" count="1" value="0x0C11">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="INDEX_CLEAR_VALUE" count="1" value="0x0C20">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="INDEX_WRITEMASK" count="1" value="0x0C21">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="COLOR_CLEAR_VALUE" count="4" value="0x0C22">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="COLOR_WRITEMASK" count="4" value="0x0C23">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="INDEX_MODE" count="1" value="0x0C30">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="RGBA_MODE" count="1" value="0x0C31">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="DOUBLEBUFFER" count="1" value="0x0C32">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="STEREO" count="1" value="0x0C33">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="RENDER_MODE" count="1" value="0x0C40">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="PERSPECTIVE_CORRECTION_HINT" count="1" value="0x0C50">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="POINT_SMOOTH_HINT" count="1" value="0x0C51">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="LINE_SMOOTH_HINT" count="1" value="0x0C52">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="POLYGON_SMOOTH_HINT" count="1" value="0x0C53">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="FOG_HINT" count="1" value="0x0C54">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="TEXTURE_GEN_S" count="1" value="0x0C60">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="TEXTURE_GEN_T" count="1" value="0x0C61">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="TEXTURE_GEN_R" count="1" value="0x0C62">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="TEXTURE_GEN_Q" count="1" value="0x0C63">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="PIXEL_MAP_I_TO_I" count="1" value="0x0C70">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="PIXEL_MAP_S_TO_S" value="0x0C71"/>
+ <enum name="PIXEL_MAP_I_TO_R" value="0x0C72"/>
+ <enum name="PIXEL_MAP_I_TO_G" value="0x0C73"/>
+ <enum name="PIXEL_MAP_I_TO_B" value="0x0C74"/>
+ <enum name="PIXEL_MAP_I_TO_A" value="0x0C75"/>
+ <enum name="PIXEL_MAP_R_TO_R" value="0x0C76"/>
+ <enum name="PIXEL_MAP_G_TO_G" value="0x0C77"/>
+ <enum name="PIXEL_MAP_B_TO_B" value="0x0C78"/>
+ <enum name="PIXEL_MAP_A_TO_A" value="0x0C79"/>
+ <enum name="PIXEL_MAP_I_TO_I_SIZE" count="1" value="0x0CB0">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="PIXEL_MAP_S_TO_S_SIZE" count="1" value="0x0CB1">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="PIXEL_MAP_I_TO_R_SIZE" count="1" value="0x0CB2">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="PIXEL_MAP_I_TO_G_SIZE" count="1" value="0x0CB3">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="PIXEL_MAP_I_TO_B_SIZE" count="1" value="0x0CB4">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="PIXEL_MAP_I_TO_A_SIZE" count="1" value="0x0CB5">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="PIXEL_MAP_R_TO_R_SIZE" count="1" value="0x0CB6">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="PIXEL_MAP_G_TO_G_SIZE" count="1" value="0x0CB7">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="PIXEL_MAP_B_TO_B_SIZE" count="1" value="0x0CB8">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="PIXEL_MAP_A_TO_A_SIZE" count="1" value="0x0CB9">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="UNPACK_SWAP_BYTES" count="1" value="0x0CF0">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="UNPACK_LSB_FIRST" count="1" value="0x0CF1">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="UNPACK_ROW_LENGTH" count="1" value="0x0CF2">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="UNPACK_SKIP_PIXELS" count="1" value="0x0CF4">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="UNPACK_SKIP_ROWS" count="1" value="0x0CF3">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="UNPACK_ALIGNMENT" count="1" value="0x0CF5">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="PACK_SWAP_BYTES" count="1" value="0x0D00">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="PACK_LSB_FIRST" count="1" value="0x0D01">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="PACK_ROW_LENGTH" count="1" value="0x0D02">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="PACK_SKIP_ROWS" count="1" value="0x0D03">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="PACK_SKIP_PIXELS" count="1" value="0x0D04">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="PACK_ALIGNMENT" count="1" value="0x0D05">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="MAP_COLOR" count="1" value="0x0D10">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="MAP_STENCIL" count="1" value="0x0D11">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="INDEX_SHIFT" count="1" value="0x0D12">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="INDEX_OFFSET" count="1" value="0x0D13">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="RED_SCALE" count="1" value="0x0D14">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="RED_BIAS" count="1" value="0x0D15">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="ZOOM_X" count="1" value="0x0D16">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="ZOOM_Y" count="1" value="0x0D17">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="GREEN_SCALE" count="1" value="0x0D18">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="GREEN_BIAS" count="1" value="0x0D19">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="BLUE_SCALE" count="1" value="0x0D1A">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="BLUE_BIAS" count="1" value="0x0D1B">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="ALPHA_SCALE" count="1" value="0x0D1C">
+ <size name="TexEnvfv" mode="get"/>
+ <size name="TexEnviv" mode="get"/>
+ <size name="GetTexEnvfv" mode="get"/>
+ <size name="GetTexEnviv" mode="get"/>
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="ALPHA_BIAS" count="1" value="0x0D1D">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="DEPTH_SCALE" count="1" value="0x0D1E">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="DEPTH_BIAS" count="1" value="0x0D1F">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="MAX_EVAL_ORDER" count="1" value="0x0D30">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="MAX_LIGHTS" count="1" value="0x0D31">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="MAX_CLIP_PLANES" count="1" value="0x0D32">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="MAX_TEXTURE_SIZE" count="1" value="0x0D33">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="MAX_PIXEL_MAP_TABLE" count="1" value="0x0D34">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="MAX_ATTRIB_STACK_DEPTH" count="1" value="0x0D35">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="MAX_MODELVIEW_STACK_DEPTH" count="1" value="0x0D36">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="MAX_NAME_STACK_DEPTH" count="1" value="0x0D37">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="MAX_PROJECTION_STACK_DEPTH" count="1" value="0x0D38">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="MAX_TEXTURE_STACK_DEPTH" count="1" value="0x0D39">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="MAX_VIEWPORT_DIMS" count="2" value="0x0D3A">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="MAX_CLIENT_ATTRIB_STACK_DEPTH" count="1" value="0x0D3B">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="SUBPIXEL_BITS" count="1" value="0x0D50">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="INDEX_BITS" count="1" value="0x0D51">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="RED_BITS" count="1" value="0x0D52">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="GREEN_BITS" count="1" value="0x0D53">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="BLUE_BITS" count="1" value="0x0D54">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="ALPHA_BITS" count="1" value="0x0D55">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="DEPTH_BITS" count="1" value="0x0D56">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="STENCIL_BITS" count="1" value="0x0D57">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="ACCUM_RED_BITS" count="1" value="0x0D58">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="ACCUM_GREEN_BITS" count="1" value="0x0D59">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="ACCUM_BLUE_BITS" count="1" value="0x0D5A">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="ACCUM_ALPHA_BITS" count="1" value="0x0D5B">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="NAME_STACK_DEPTH" count="1" value="0x0D70">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="AUTO_NORMAL" count="1" value="0x0D80">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="MAP1_COLOR_4" count="4" value="0x0D90">
+ <size name="Map1d" mode="get"/>
+ <size name="Map1f" mode="get"/>
+ <size name="Get" count="1" mode="get"/>
+ </enum>
+ <enum name="MAP1_INDEX" count="1" value="0x0D91">
+ <size name="Map1d" mode="get"/>
+ <size name="Map1f" mode="get"/>
+ <size name="Get" count="1" mode="get"/>
+ </enum>
+ <enum name="MAP1_NORMAL" count="3" value="0x0D92">
+ <size name="Map1d" mode="get"/>
+ <size name="Map1f" mode="get"/>
+ <size name="Get" count="1" mode="get"/>
+ </enum>
+ <enum name="MAP1_TEXTURE_COORD_1" count="1" value="0x0D93">
+ <size name="Map1d" mode="get"/>
+ <size name="Map1f" mode="get"/>
+ <size name="Get" count="1" mode="get"/>
+ </enum>
+ <enum name="MAP1_TEXTURE_COORD_2" count="2" value="0x0D94">
+ <size name="Map1d" mode="get"/>
+ <size name="Map1f" mode="get"/>
+ <size name="Get" count="1" mode="get"/>
+ </enum>
+ <enum name="MAP1_TEXTURE_COORD_3" count="3" value="0x0D95">
+ <size name="Map1d" mode="get"/>
+ <size name="Map1f" mode="get"/>
+ <size name="Get" count="1" mode="get"/>
+ </enum>
+ <enum name="MAP1_TEXTURE_COORD_4" count="4" value="0x0D96">
+ <size name="Map1d" mode="get"/>
+ <size name="Map1f" mode="get"/>
+ <size name="Get" count="1" mode="get"/>
+ </enum>
+ <enum name="MAP1_VERTEX_3" count="3" value="0x0D97">
+ <size name="Map1d" mode="get"/>
+ <size name="Map1f" mode="get"/>
+ <size name="Get" count="1" mode="get"/>
+ </enum>
+ <enum name="MAP1_VERTEX_4" count="4" value="0x0D98">
+ <size name="Map1d" mode="get"/>
+ <size name="Map1f" mode="get"/>
+ <size name="Get" count="1" mode="get"/>
+ </enum>
+ <enum name="MAP2_COLOR_4" count="4" value="0x0DB0">
+ <size name="Map2d" mode="get"/>
+ <size name="Map2f" mode="get"/>
+ <size name="Get" count="1" mode="get"/>
+ </enum>
+ <enum name="MAP2_INDEX" count="1" value="0x0DB1">
+ <size name="Map2d" mode="get"/>
+ <size name="Map2f" mode="get"/>
+ <size name="Get" count="1" mode="get"/>
+ </enum>
+ <enum name="MAP2_NORMAL" count="3" value="0x0DB2">
+ <size name="Map2d" mode="get"/>
+ <size name="Map2f" mode="get"/>
+ <size name="Get" count="1" mode="get"/>
+ </enum>
+ <enum name="MAP2_TEXTURE_COORD_1" count="1" value="0x0DB3">
+ <size name="Map2d" mode="get"/>
+ <size name="Map2f" mode="get"/>
+ <size name="Get" count="1" mode="get"/>
+ </enum>
+ <enum name="MAP2_TEXTURE_COORD_2" count="2" value="0x0DB4">
+ <size name="Map2d" mode="get"/>
+ <size name="Map2f" mode="get"/>
+ <size name="Get" count="1" mode="get"/>
+ </enum>
+ <enum name="MAP2_TEXTURE_COORD_3" count="3" value="0x0DB5">
+ <size name="Map2d" mode="get"/>
+ <size name="Map2f" mode="get"/>
+ <size name="Get" count="1" mode="get"/>
+ </enum>
+ <enum name="MAP2_TEXTURE_COORD_4" count="4" value="0x0DB6">
+ <size name="Map2d" mode="get"/>
+ <size name="Map2f" mode="get"/>
+ <size name="Get" count="1" mode="get"/>
+ </enum>
+ <enum name="MAP2_VERTEX_3" count="3" value="0x0DB7">
+ <size name="Map2d" mode="get"/>
+ <size name="Map2f" mode="get"/>
+ <size name="Get" count="1" mode="get"/>
+ </enum>
+ <enum name="MAP2_VERTEX_4" count="4" value="0x0DB8">
+ <size name="Map2d" mode="get"/>
+ <size name="Map2f" mode="get"/>
+ <size name="Get" count="1" mode="get"/>
+ </enum>
+ <enum name="MAP1_GRID_DOMAIN" count="2" value="0x0DD0">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="MAP1_GRID_SEGMENTS" count="1" value="0x0DD1">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="MAP2_GRID_DOMAIN" count="4" value="0x0DD2">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="MAP2_GRID_SEGMENTS" count="2" value="0x0DD3">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="TEXTURE_1D" count="1" value="0x0DE0">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="TEXTURE_2D" count="1" value="0x0DE1">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="FEEDBACK_BUFFER_POINTER" value="0x0DF0"/>
+ <enum name="FEEDBACK_BUFFER_SIZE" value="0x0DF1"/>
+ <enum name="FEEDBACK_BUFFER_TYPE" value="0x0DF2"/>
+ <enum name="SELECTION_BUFFER_POINTER" value="0x0DF3"/>
+ <enum name="SELECTION_BUFFER_SIZE" value="0x0DF4"/>
+ <enum name="TEXTURE_WIDTH" count="1" value="0x1000">
+ <size name="GetTexLevelParameterfv" mode="get"/>
+ <size name="GetTexLevelParameteriv" mode="get"/>
+ </enum>
+ <enum name="TEXTURE_HEIGHT" count="1" value="0x1001">
+ <size name="GetTexLevelParameterfv" mode="get"/>
+ <size name="GetTexLevelParameteriv" mode="get"/>
+ </enum>
+ <enum name="TEXTURE_BORDER" count="1" value="0x1005">
+ <size name="GetTexLevelParameterfv" mode="get"/>
+ <size name="GetTexLevelParameteriv" mode="get"/>
+ </enum>
+ <enum name="TEXTURE_COMPONENTS" count="1" value="0x1003">
+ <size name="GetTexLevelParameterfv" mode="get"/>
+ <size name="GetTexLevelParameteriv" mode="get"/>
+ </enum>
+ <enum name="TEXTURE_BORDER_COLOR" count="4" value="0x1004">
+ <size name="TexParameterfv" mode="get"/>
+ <size name="TexParameteriv" mode="get"/>
+ <size name="GetTexParameterfv" mode="get"/>
+ <size name="GetTexParameteriv" mode="get"/>
+ </enum>
+ <enum name="DONT_CARE" value="0x1100"/>
+ <enum name="FASTEST" value="0x1101"/>
+ <enum name="NICEST" value="0x1102"/>
+ <enum name="AMBIENT" count="4" value="0x1200">
+ <size name="Materialfv" mode="get"/>
+ <size name="Materialiv" mode="get"/>
+ <size name="Lightfv" mode="get"/>
+ <size name="Lightiv" mode="get"/>
+ <size name="GetMaterialfv" mode="get"/>
+ <size name="GetMaterialiv" mode="get"/>
+ <size name="GetLightfv" mode="get"/>
+ <size name="GetLightiv" mode="get"/>
+ </enum>
+ <enum name="DIFFUSE" count="4" value="0x1201">
+ <size name="Materialfv" mode="get"/>
+ <size name="Materialiv" mode="get"/>
+ <size name="Lightfv" mode="get"/>
+ <size name="Lightiv" mode="get"/>
+ <size name="GetMaterialfv" mode="get"/>
+ <size name="GetMaterialiv" mode="get"/>
+ <size name="GetLightfv" mode="get"/>
+ <size name="GetLightiv" mode="get"/>
+ </enum>
+ <enum name="SPECULAR" count="4" value="0x1202">
+ <size name="Materialfv" mode="get"/>
+ <size name="Materialiv" mode="get"/>
+ <size name="Lightfv" mode="get"/>
+ <size name="Lightiv" mode="get"/>
+ <size name="GetMaterialfv" mode="get"/>
+ <size name="GetMaterialiv" mode="get"/>
+ <size name="GetLightfv" mode="get"/>
+ <size name="GetLightiv" mode="get"/>
+ </enum>
+ <enum name="POSITION" count="4" value="0x1203">
+ <size name="Lightfv" mode="get"/>
+ <size name="Lightiv" mode="get"/>
+ <size name="GetLightfv" mode="get"/>
+ <size name="GetLightiv" mode="get"/>
+ </enum>
+ <enum name="SPOT_DIRECTION" count="3" value="0x1204">
+ <size name="Lightfv" mode="get"/>
+ <size name="Lightiv" mode="get"/>
+ <size name="GetLightfv" mode="get"/>
+ <size name="GetLightiv" mode="get"/>
+ </enum>
+ <enum name="SPOT_EXPONENT" count="1" value="0x1205">
+ <size name="Lightfv" mode="get"/>
+ <size name="Lightiv" mode="get"/>
+ <size name="GetLightfv" mode="get"/>
+ <size name="GetLightiv" mode="get"/>
+ </enum>
+ <enum name="SPOT_CUTOFF" count="1" value="0x1206">
+ <size name="Lightfv" mode="get"/>
+ <size name="Lightiv" mode="get"/>
+ <size name="GetLightfv" mode="get"/>
+ <size name="GetLightiv" mode="get"/>
+ </enum>
+ <enum name="CONSTANT_ATTENUATION" count="1" value="0x1207">
+ <size name="Lightfv" mode="get"/>
+ <size name="Lightiv" mode="get"/>
+ <size name="GetLightfv" mode="get"/>
+ <size name="GetLightiv" mode="get"/>
+ </enum>
+ <enum name="LINEAR_ATTENUATION" count="1" value="0x1208">
+ <size name="Lightfv" mode="get"/>
+ <size name="Lightiv" mode="get"/>
+ <size name="GetLightfv" mode="get"/>
+ <size name="GetLightiv" mode="get"/>
+ </enum>
+ <enum name="QUADRATIC_ATTENUATION" count="1" value="0x1209">
+ <size name="Lightfv" mode="get"/>
+ <size name="Lightiv" mode="get"/>
+ <size name="GetLightfv" mode="get"/>
+ <size name="GetLightiv" mode="get"/>
+ </enum>
+ <enum name="COMPILE" value="0x1300"/>
+ <enum name="COMPILE_AND_EXECUTE" value="0x1301"/>
+ <enum name="BYTE" count="1" value="0x1400">
+ <size name="CallLists" mode="get"/>
+ </enum>
+ <enum name="UNSIGNED_BYTE" count="1" value="0x1401">
+ <size name="CallLists" mode="get"/>
+ </enum>
+ <enum name="SHORT" count="2" value="0x1402">
+ <size name="CallLists" mode="get"/>
+ </enum>
+ <enum name="UNSIGNED_SHORT" count="2" value="0x1403">
+ <size name="CallLists" mode="get"/>
+ </enum>
+ <enum name="INT" count="4" value="0x1404">
+ <size name="CallLists" mode="get"/>
+ </enum>
+ <enum name="UNSIGNED_INT" count="4" value="0x1405">
+ <size name="CallLists" mode="get"/>
+ </enum>
+ <enum name="FLOAT" count="4" value="0x1406">
+ <size name="CallLists" mode="get"/>
+ </enum>
+ <enum name="2_BYTES" count="2" value="0x1407">
+ <size name="CallLists" mode="get"/>
+ </enum>
+ <enum name="3_BYTES" count="3" value="0x1408">
+ <size name="CallLists" mode="get"/>
+ </enum>
+ <enum name="4_BYTES" count="4" value="0x1409">
+ <size name="CallLists" mode="get"/>
+ </enum>
+ <enum name="HALF_FLOAT" count="2" value="0x140B">
+ <size name="CallLists" mode="get"/>
+ </enum>
+ <enum name="CLEAR" value="0x1500"/>
+ <enum name="AND" value="0x1501"/>
+ <enum name="AND_REVERSE" value="0x1502"/>
+ <enum name="COPY" value="0x1503"/>
+ <enum name="AND_INVERTED" value="0x1504"/>
+ <enum name="NOOP" value="0x1505"/>
+ <enum name="XOR" value="0x1506"/>
+ <enum name="OR" value="0x1507"/>
+ <enum name="NOR" value="0x1508"/>
+ <enum name="EQUIV" value="0x1509"/>
+ <enum name="INVERT" value="0x150A"/>
+ <enum name="OR_REVERSE" value="0x150B"/>
+ <enum name="COPY_INVERTED" value="0x150C"/>
+ <enum name="OR_INVERTED" value="0x150D"/>
+ <enum name="NAND" value="0x150E"/>
+ <enum name="SET" value="0x150F"/>
+ <enum name="EMISSION" count="4" value="0x1600">
+ <size name="Materialfv" mode="get"/>
+ <size name="Materialiv" mode="get"/>
+ <size name="GetMaterialfv" mode="get"/>
+ <size name="GetMaterialiv" mode="get"/>
+ </enum>
+ <enum name="SHININESS" count="1" value="0x1601">
+ <size name="Materialfv" mode="get"/>
+ <size name="Materialiv" mode="get"/>
+ <size name="GetMaterialfv" mode="get"/>
+ <size name="GetMaterialiv" mode="get"/>
+ </enum>
+ <enum name="AMBIENT_AND_DIFFUSE" count="4" value="0x1602">
+ <size name="Materialfv" mode="get"/>
+ <size name="Materialiv" mode="get"/>
+ <size name="GetMaterialfv" mode="get"/>
+ <size name="GetMaterialiv" mode="get"/>
+ </enum>
+ <enum name="COLOR_INDEXES" count="3" value="0x1603">
+ <size name="Materialfv" mode="get"/>
+ <size name="Materialiv" mode="get"/>
+ <size name="GetMaterialfv" mode="get"/>
+ <size name="GetMaterialiv" mode="get"/>
+ </enum>
+ <enum name="MODELVIEW" value="0x1700"/>
+ <enum name="PROJECTION" value="0x1701"/>
+ <enum name="TEXTURE" value="0x1702"/>
+ <enum name="COLOR" value="0x1800"/>
+ <enum name="DEPTH" value="0x1801"/>
+ <enum name="STENCIL" value="0x1802"/>
+ <enum name="COLOR_INDEX" value="0x1900"/>
+ <enum name="STENCIL_INDEX" value="0x1901"/>
+ <enum name="DEPTH_COMPONENT" value="0x1902"/>
+ <enum name="RED" value="0x1903"/>
+ <enum name="GREEN" value="0x1904"/>
+ <enum name="BLUE" value="0x1905"/>
+ <enum name="ALPHA" value="0x1906"/>
+ <enum name="RGBA" value="0x1908"/>
+ <enum name="RGB" value="0x1907"/>
+ <enum name="LUMINANCE" value="0x1909"/>
+ <enum name="LUMINANCE_ALPHA" value="0x190A"/>
+ <enum name="BITMAP" value="0x1A00"/>
+ <enum name="POINT" value="0x1B00"/>
+ <enum name="LINE" value="0x1B01"/>
+ <enum name="FILL" value="0x1B02"/>
+ <enum name="FEEDBACK" value="0x1C01"/>
+ <enum name="RENDER" value="0x1C00"/>
+ <enum name="SELECT" value="0x1C02"/>
+ <enum name="FLAT" value="0x1D00"/>
+ <enum name="SMOOTH" value="0x1D01"/>
+ <enum name="KEEP" value="0x1E00"/>
+ <enum name="REPLACE" value="0x1E01"/>
+ <enum name="INCR" value="0x1E02"/>
+ <enum name="DECR" value="0x1E03"/>
+ <enum name="VENDOR" value="0x1F00"/>
+ <enum name="RENDERER" value="0x1F01"/>
+ <enum name="VERSION" value="0x1F02"/>
+ <enum name="EXTENSIONS" value="0x1F03"/>
+ <enum name="S" value="0x2000"/>
+ <enum name="T" value="0x2001"/>
+ <enum name="R" value="0x2002"/>
+ <enum name="Q" value="0x2003"/>
+ <enum name="MODULATE" value="0x2100"/>
+ <enum name="DECAL" value="0x2101"/>
+ <enum name="TEXTURE_ENV_MODE" count="1" value="0x2200">
+ <size name="TexEnvfv" mode="get"/>
+ <size name="TexEnviv" mode="get"/>
+ <size name="GetTexEnvfv" mode="get"/>
+ <size name="GetTexEnviv" mode="get"/>
+ </enum>
+ <enum name="TEXTURE_ENV_COLOR" count="4" value="0x2201">
+ <size name="TexEnvfv" mode="get"/>
+ <size name="TexEnviv" mode="get"/>
+ <size name="GetTexEnvfv" mode="get"/>
+ <size name="GetTexEnviv" mode="get"/>
+ </enum>
+ <enum name="TEXTURE_ENV" value="0x2300"/>
+ <enum name="EYE_LINEAR" value="0x2400"/>
+ <enum name="OBJECT_LINEAR" value="0x2401"/>
+ <enum name="SPHERE_MAP" value="0x2402"/>
+ <enum name="TEXTURE_GEN_MODE" count="1" value="0x2500">
+ <size name="TexGendv" mode="get"/>
+ <size name="TexGenfv" mode="get"/>
+ <size name="TexGeniv" mode="get"/>
+ <size name="GetTexGendv" mode="get"/>
+ <size name="GetTexGenfv" mode="get"/>
+ <size name="GetTexGeniv" mode="get"/>
+ </enum>
+ <enum name="OBJECT_PLANE" count="4" value="0x2501">
+ <size name="TexGendv" mode="get"/>
+ <size name="TexGenfv" mode="get"/>
+ <size name="TexGeniv" mode="get"/>
+ <size name="GetTexGendv" mode="get"/>
+ <size name="GetTexGenfv" mode="get"/>
+ <size name="GetTexGeniv" mode="get"/>
+ </enum>
+ <enum name="EYE_PLANE" count="4" value="0x2502">
+ <size name="TexGendv" mode="get"/>
+ <size name="TexGenfv" mode="get"/>
+ <size name="TexGeniv" mode="get"/>
+ <size name="GetTexGendv" mode="get"/>
+ <size name="GetTexGenfv" mode="get"/>
+ <size name="GetTexGeniv" mode="get"/>
+ </enum>
+ <enum name="NEAREST" value="0x2600"/>
+ <enum name="LINEAR" value="0x2601"/>
+ <enum name="NEAREST_MIPMAP_NEAREST" value="0x2700"/>
+ <enum name="LINEAR_MIPMAP_NEAREST" value="0x2701"/>
+ <enum name="NEAREST_MIPMAP_LINEAR" value="0x2702"/>
+ <enum name="LINEAR_MIPMAP_LINEAR" value="0x2703"/>
+ <enum name="TEXTURE_MAG_FILTER" count="1" value="0x2800">
+ <size name="TexParameterfv" mode="get"/>
+ <size name="TexParameteriv" mode="get"/>
+ <size name="GetTexParameterfv" mode="get"/>
+ <size name="GetTexParameteriv" mode="get"/>
+ </enum>
+ <enum name="TEXTURE_MIN_FILTER" count="1" value="0x2801">
+ <size name="TexParameterfv" mode="get"/>
+ <size name="TexParameteriv" mode="get"/>
+ <size name="GetTexParameterfv" mode="get"/>
+ <size name="GetTexParameteriv" mode="get"/>
+ </enum>
+ <enum name="TEXTURE_WRAP_S" count="1" value="0x2802">
+ <size name="TexParameterfv" mode="get"/>
+ <size name="TexParameteriv" mode="get"/>
+ <size name="GetTexParameterfv" mode="get"/>
+ <size name="GetTexParameteriv" mode="get"/>
+ </enum>
+ <enum name="TEXTURE_WRAP_T" count="1" value="0x2803">
+ <size name="TexParameterfv" mode="get"/>
+ <size name="TexParameteriv" mode="get"/>
+ <size name="GetTexParameterfv" mode="get"/>
+ <size name="GetTexParameteriv" mode="get"/>
+ </enum>
+ <enum name="CLAMP" value="0x2900"/>
+ <enum name="REPEAT" value="0x2901"/>
+ <enum name="CLIP_PLANE0" count="1" value="0x3000">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="CLIP_PLANE1" count="1" value="0x3001">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="CLIP_PLANE2" count="1" value="0x3002">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="CLIP_PLANE3" count="1" value="0x3003">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="CLIP_PLANE4" count="1" value="0x3004">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="CLIP_PLANE5" count="1" value="0x3005">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="LIGHT0" count="1" value="0x4000">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="LIGHT1" count="1" value="0x4001">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="LIGHT2" count="1" value="0x4002">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="LIGHT3" count="1" value="0x4003">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="LIGHT4" count="1" value="0x4004">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="LIGHT5" count="1" value="0x4005">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="LIGHT6" count="1" value="0x4006">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="LIGHT7" count="1" value="0x4007">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="CURRENT_BIT" value="0x00000001"/>
+ <enum name="POINT_BIT" value="0x00000002"/>
+ <enum name="LINE_BIT" value="0x00000004"/>
+ <enum name="POLYGON_BIT" value="0x00000008"/>
+ <enum name="POLYGON_STIPPLE_BIT" value="0x00000010"/>
+ <enum name="PIXEL_MODE_BIT" value="0x00000020"/>
+ <enum name="LIGHTING_BIT" value="0x00000040"/>
+ <enum name="FOG_BIT" value="0x00000080"/>
+ <enum name="DEPTH_BUFFER_BIT" value="0x00000100"/>
+ <enum name="ACCUM_BUFFER_BIT" value="0x00000200"/>
+ <enum name="STENCIL_BUFFER_BIT" value="0x00000400"/>
+ <enum name="VIEWPORT_BIT" value="0x00000800"/>
+ <enum name="TRANSFORM_BIT" value="0x00001000"/>
+ <enum name="ENABLE_BIT" value="0x00002000"/>
+ <enum name="COLOR_BUFFER_BIT" value="0x00004000"/>
+ <enum name="HINT_BIT" value="0x00008000"/>
+ <enum name="EVAL_BIT" value="0x00010000"/>
+ <enum name="LIST_BIT" value="0x00020000"/>
+ <enum name="TEXTURE_BIT" value="0x00040000"/>
+ <enum name="SCISSOR_BIT" value="0x00080000"/>
+ <enum name="ALL_ATTRIB_BITS" value="0x000FFFFF"/>
+
+ <type name="double" size="8" float="true" glx_name="FLOAT64"/>
+ <type name="clampd" size="8" float="true" glx_name="FLOAT64"/>
+
+ <type name="float" size="4" float="true" glx_name="FLOAT32"/>
+ <type name="clampf" size="4" float="true" glx_name="FLOAT32"/>
+
+ <type name="int" size="4" glx_name="CARD32"/>
+ <type name="uint" size="4" unsigned="true" glx_name="CARD32"/>
+ <type name="sizei" size="4" unsigned="true" glx_name="CARD32"/>
+ <type name="enum" size="4" unsigned="true" glx_name="ENUM"/>
+ <type name="bitfield" size="4" unsigned="true" glx_name="CARD32"/>
+
+ <type name="short" size="2" glx_name="CARD16"/>
+ <type name="ushort" size="2" unsigned="true" glx_name="CARD16"/>
+
+ <type name="byte" size="1" glx_name="CARD8"/>
+ <type name="ubyte" size="1" unsigned="true" glx_name="CARD8"/>
+ <type name="boolean" size="1" unsigned="true" glx_name="CARD8"/>
+
+ <type name="void" size="1"/>
+
+ <function name="NewList" offset="0">
+ <param name="list" type="GLuint"/>
+ <param name="mode" type="GLenum"/>
+ <glx sop="101"/>
+ </function>
+
+ <function name="EndList" offset="1">
+ <glx sop="102"/>
+ </function>
+
+ <function name="CallList" offset="2">
+ <param name="list" type="GLuint"/>
+ <glx rop="1"/>
+ </function>
+
+ <function name="CallLists" offset="3">
+ <param name="n" type="GLsizei" counter="true"/>
+ <param name="type" type="GLenum"/>
+ <param name="lists" type="const GLvoid *" variable_param="type" count="n"/>
+ <glx rop="2" large="true"/>
+ </function>
+
+ <function name="DeleteLists" offset="4">
+ <param name="list" type="GLuint"/>
+ <param name="range" type="GLsizei"/>
+ <glx sop="103"/>
+ </function>
+
+ <function name="GenLists" offset="5">
+ <param name="range" type="GLsizei"/>
+ <return type="GLuint"/>
+ <glx sop="104"/>
+ </function>
+
+ <function name="ListBase" offset="6">
+ <param name="base" type="GLuint"/>
+ <glx rop="3"/>
+ </function>
+
+ <function name="Begin" offset="7">
+ <param name="mode" type="GLenum"/>
+ <glx rop="4"/>
+ </function>
+
+ <function name="Bitmap" offset="8">
+ <param name="width" type="GLsizei"/>
+ <param name="height" type="GLsizei"/>
+ <param name="xorig" type="GLfloat"/>
+ <param name="yorig" type="GLfloat"/>
+ <param name="xmove" type="GLfloat"/>
+ <param name="ymove" type="GLfloat"/>
+ <param name="bitmap" type="const GLubyte *" img_width="width" img_height="height" img_format="GL_COLOR_INDEX" img_type="GL_BITMAP" img_target="0" img_pad_dimensions="false"/>
+ <glx rop="5" large="true"/>
+ </function>
+
+ <function name="Color3b" offset="9" vectorequiv="Color3bv">
+ <param name="red" type="GLbyte"/>
+ <param name="green" type="GLbyte"/>
+ <param name="blue" type="GLbyte"/>
+ </function>
+
+ <function name="Color3bv" offset="10">
+ <param name="v" type="const GLbyte *" count="3"/>
+ <glx rop="6"/>
+ </function>
+
+ <function name="Color3d" offset="11" vectorequiv="Color3dv">
+ <param name="red" type="GLdouble"/>
+ <param name="green" type="GLdouble"/>
+ <param name="blue" type="GLdouble"/>
+ </function>
+
+ <function name="Color3dv" offset="12">
+ <param name="v" type="const GLdouble *" count="3"/>
+ <glx rop="7"/>
+ </function>
+
+ <function name="Color3f" offset="13" vectorequiv="Color3fv">
+ <param name="red" type="GLfloat"/>
+ <param name="green" type="GLfloat"/>
+ <param name="blue" type="GLfloat"/>
+ </function>
+
+ <function name="Color3fv" offset="14">
+ <param name="v" type="const GLfloat *" count="3"/>
+ <glx rop="8"/>
+ </function>
+
+ <function name="Color3i" offset="15" vectorequiv="Color3iv">
+ <param name="red" type="GLint"/>
+ <param name="green" type="GLint"/>
+ <param name="blue" type="GLint"/>
+ </function>
+
+ <function name="Color3iv" offset="16">
+ <param name="v" type="const GLint *" count="3"/>
+ <glx rop="9"/>
+ </function>
+
+ <function name="Color3s" offset="17" vectorequiv="Color3sv">
+ <param name="red" type="GLshort"/>
+ <param name="green" type="GLshort"/>
+ <param name="blue" type="GLshort"/>
+ </function>
+
+ <function name="Color3sv" offset="18">
+ <param name="v" type="const GLshort *" count="3"/>
+ <glx rop="10"/>
+ </function>
+
+ <function name="Color3ub" offset="19" vectorequiv="Color3ubv">
+ <param name="red" type="GLubyte"/>
+ <param name="green" type="GLubyte"/>
+ <param name="blue" type="GLubyte"/>
+ </function>
+
+ <function name="Color3ubv" offset="20">
+ <param name="v" type="const GLubyte *" count="3"/>
+ <glx rop="11"/>
+ </function>
+
+ <function name="Color3ui" offset="21" vectorequiv="Color3uiv">
+ <param name="red" type="GLuint"/>
+ <param name="green" type="GLuint"/>
+ <param name="blue" type="GLuint"/>
+ </function>
+
+ <function name="Color3uiv" offset="22">
+ <param name="v" type="const GLuint *" count="3"/>
+ <glx rop="12"/>
+ </function>
+
+ <function name="Color3us" offset="23" vectorequiv="Color3usv">
+ <param name="red" type="GLushort"/>
+ <param name="green" type="GLushort"/>
+ <param name="blue" type="GLushort"/>
+ </function>
+
+ <function name="Color3usv" offset="24">
+ <param name="v" type="const GLushort *" count="3"/>
+ <glx rop="13"/>
+ </function>
+
+ <function name="Color4b" offset="25" vectorequiv="Color4bv">
+ <param name="red" type="GLbyte"/>
+ <param name="green" type="GLbyte"/>
+ <param name="blue" type="GLbyte"/>
+ <param name="alpha" type="GLbyte"/>
+ </function>
+
+ <function name="Color4bv" offset="26">
+ <param name="v" type="const GLbyte *" count="4"/>
+ <glx rop="14"/>
+ </function>
+
+ <function name="Color4d" offset="27" vectorequiv="Color4dv">
+ <param name="red" type="GLdouble"/>
+ <param name="green" type="GLdouble"/>
+ <param name="blue" type="GLdouble"/>
+ <param name="alpha" type="GLdouble"/>
+ </function>
+
+ <function name="Color4dv" offset="28">
+ <param name="v" type="const GLdouble *" count="4"/>
+ <glx rop="15"/>
+ </function>
+
+ <function name="Color4f" offset="29" vectorequiv="Color4fv">
+ <param name="red" type="GLfloat"/>
+ <param name="green" type="GLfloat"/>
+ <param name="blue" type="GLfloat"/>
+ <param name="alpha" type="GLfloat"/>
+ </function>
+
+ <function name="Color4fv" offset="30">
+ <param name="v" type="const GLfloat *" count="4"/>
+ <glx rop="16"/>
+ </function>
+
+ <function name="Color4i" offset="31" vectorequiv="Color4iv">
+ <param name="red" type="GLint"/>
+ <param name="green" type="GLint"/>
+ <param name="blue" type="GLint"/>
+ <param name="alpha" type="GLint"/>
+ </function>
+
+ <function name="Color4iv" offset="32">
+ <param name="v" type="const GLint *" count="4"/>
+ <glx rop="17"/>
+ </function>
+
+ <function name="Color4s" offset="33" vectorequiv="Color4sv">
+ <param name="red" type="GLshort"/>
+ <param name="green" type="GLshort"/>
+ <param name="blue" type="GLshort"/>
+ <param name="alpha" type="GLshort"/>
+ </function>
+
+ <function name="Color4sv" offset="34">
+ <param name="v" type="const GLshort *" count="4"/>
+ <glx rop="18"/>
+ </function>
+
+ <function name="Color4ub" offset="35" vectorequiv="Color4ubv">
+ <param name="red" type="GLubyte"/>
+ <param name="green" type="GLubyte"/>
+ <param name="blue" type="GLubyte"/>
+ <param name="alpha" type="GLubyte"/>
+ </function>
+
+ <function name="Color4ubv" offset="36">
+ <param name="v" type="const GLubyte *" count="4"/>
+ <glx rop="19"/>
+ </function>
+
+ <function name="Color4ui" offset="37" vectorequiv="Color4uiv">
+ <param name="red" type="GLuint"/>
+ <param name="green" type="GLuint"/>
+ <param name="blue" type="GLuint"/>
+ <param name="alpha" type="GLuint"/>
+ </function>
+
+ <function name="Color4uiv" offset="38">
+ <param name="v" type="const GLuint *" count="4"/>
+ <glx rop="20"/>
+ </function>
+
+ <function name="Color4us" offset="39" vectorequiv="Color4usv">
+ <param name="red" type="GLushort"/>
+ <param name="green" type="GLushort"/>
+ <param name="blue" type="GLushort"/>
+ <param name="alpha" type="GLushort"/>
+ </function>
+
+ <function name="Color4usv" offset="40">
+ <param name="v" type="const GLushort *" count="4"/>
+ <glx rop="21"/>
+ </function>
+
+ <function name="EdgeFlag" offset="41" vectorequiv="EdgeFlagv">
+ <param name="flag" type="GLboolean"/>
+ </function>
+
+ <function name="EdgeFlagv" offset="42">
+ <param name="flag" type="const GLboolean *" count="1"/>
+ <glx rop="22"/>
+ </function>
+
+ <function name="End" offset="43">
+ <glx rop="23"/>
+ </function>
+
+ <function name="Indexd" offset="44" vectorequiv="Indexdv">
+ <param name="c" type="GLdouble"/>
+ </function>
+
+ <function name="Indexdv" offset="45">
+ <param name="c" type="const GLdouble *" count="1"/>
+ <glx rop="24"/>
+ </function>
+
+ <function name="Indexf" offset="46" vectorequiv="Indexfv">
+ <param name="c" type="GLfloat"/>
+ </function>
+
+ <function name="Indexfv" offset="47">
+ <param name="c" type="const GLfloat *" count="1"/>
+ <glx rop="25"/>
+ </function>
+
+ <function name="Indexi" offset="48" vectorequiv="Indexiv">
+ <param name="c" type="GLint"/>
+ </function>
+
+ <function name="Indexiv" offset="49">
+ <param name="c" type="const GLint *" count="1"/>
+ <glx rop="26"/>
+ </function>
+
+ <function name="Indexs" offset="50" vectorequiv="Indexsv">
+ <param name="c" type="GLshort"/>
+ </function>
+
+ <function name="Indexsv" offset="51">
+ <param name="c" type="const GLshort *" count="1"/>
+ <glx rop="27"/>
+ </function>
+
+ <function name="Normal3b" offset="52" vectorequiv="Normal3bv">
+ <param name="nx" type="GLbyte"/>
+ <param name="ny" type="GLbyte"/>
+ <param name="nz" type="GLbyte"/>
+ </function>
+
+ <function name="Normal3bv" offset="53">
+ <param name="v" type="const GLbyte *" count="3"/>
+ <glx rop="28"/>
+ </function>
+
+ <function name="Normal3d" offset="54" vectorequiv="Normal3dv">
+ <param name="nx" type="GLdouble"/>
+ <param name="ny" type="GLdouble"/>
+ <param name="nz" type="GLdouble"/>
+ </function>
+
+ <function name="Normal3dv" offset="55">
+ <param name="v" type="const GLdouble *" count="3"/>
+ <glx rop="29"/>
+ </function>
+
+ <function name="Normal3f" offset="56" vectorequiv="Normal3fv">
+ <param name="nx" type="GLfloat"/>
+ <param name="ny" type="GLfloat"/>
+ <param name="nz" type="GLfloat"/>
+ </function>
+
+ <function name="Normal3fv" offset="57">
+ <param name="v" type="const GLfloat *" count="3"/>
+ <glx rop="30"/>
+ </function>
+
+ <function name="Normal3i" offset="58" vectorequiv="Normal3iv">
+ <param name="nx" type="GLint"/>
+ <param name="ny" type="GLint"/>
+ <param name="nz" type="GLint"/>
+ </function>
+
+ <function name="Normal3iv" offset="59">
+ <param name="v" type="const GLint *" count="3"/>
+ <glx rop="31"/>
+ </function>
+
+ <function name="Normal3s" offset="60" vectorequiv="Normal3sv">
+ <param name="nx" type="GLshort"/>
+ <param name="ny" type="GLshort"/>
+ <param name="nz" type="GLshort"/>
+ </function>
+
+ <function name="Normal3sv" offset="61">
+ <param name="v" type="const GLshort *" count="3"/>
+ <glx rop="32"/>
+ </function>
+
+ <function name="RasterPos2d" offset="62" vectorequiv="RasterPos2dv">
+ <param name="x" type="GLdouble"/>
+ <param name="y" type="GLdouble"/>
+ </function>
+
+ <function name="RasterPos2dv" offset="63">
+ <param name="v" type="const GLdouble *" count="2"/>
+ <glx rop="33"/>
+ </function>
+
+ <function name="RasterPos2f" offset="64" vectorequiv="RasterPos2fv">
+ <param name="x" type="GLfloat"/>
+ <param name="y" type="GLfloat"/>
+ </function>
+
+ <function name="RasterPos2fv" offset="65">
+ <param name="v" type="const GLfloat *" count="2"/>
+ <glx rop="34"/>
+ </function>
+
+ <function name="RasterPos2i" offset="66" vectorequiv="RasterPos2iv">
+ <param name="x" type="GLint"/>
+ <param name="y" type="GLint"/>
+ </function>
+
+ <function name="RasterPos2iv" offset="67">
+ <param name="v" type="const GLint *" count="2"/>
+ <glx rop="35"/>
+ </function>
+
+ <function name="RasterPos2s" offset="68" vectorequiv="RasterPos2sv">
+ <param name="x" type="GLshort"/>
+ <param name="y" type="GLshort"/>
+ </function>
+
+ <function name="RasterPos2sv" offset="69">
+ <param name="v" type="const GLshort *" count="2"/>
+ <glx rop="36"/>
+ </function>
+
+ <function name="RasterPos3d" offset="70" vectorequiv="RasterPos3dv">
+ <param name="x" type="GLdouble"/>
+ <param name="y" type="GLdouble"/>
+ <param name="z" type="GLdouble"/>
+ </function>
+
+ <function name="RasterPos3dv" offset="71">
+ <param name="v" type="const GLdouble *" count="3"/>
+ <glx rop="37"/>
+ </function>
+
+ <function name="RasterPos3f" offset="72" vectorequiv="RasterPos3fv">
+ <param name="x" type="GLfloat"/>
+ <param name="y" type="GLfloat"/>
+ <param name="z" type="GLfloat"/>
+ </function>
+
+ <function name="RasterPos3fv" offset="73">
+ <param name="v" type="const GLfloat *" count="3"/>
+ <glx rop="38"/>
+ </function>
+
+ <function name="RasterPos3i" offset="74" vectorequiv="RasterPos3iv">
+ <param name="x" type="GLint"/>
+ <param name="y" type="GLint"/>
+ <param name="z" type="GLint"/>
+ </function>
+
+ <function name="RasterPos3iv" offset="75">
+ <param name="v" type="const GLint *" count="3"/>
+ <glx rop="39"/>
+ </function>
+
+ <function name="RasterPos3s" offset="76" vectorequiv="RasterPos3sv">
+ <param name="x" type="GLshort"/>
+ <param name="y" type="GLshort"/>
+ <param name="z" type="GLshort"/>
+ </function>
+
+ <function name="RasterPos3sv" offset="77">
+ <param name="v" type="const GLshort *" count="3"/>
+ <glx rop="40"/>
+ </function>
+
+ <function name="RasterPos4d" offset="78" vectorequiv="RasterPos4dv">
+ <param name="x" type="GLdouble"/>
+ <param name="y" type="GLdouble"/>
+ <param name="z" type="GLdouble"/>
+ <param name="w" type="GLdouble"/>
+ </function>
+
+ <function name="RasterPos4dv" offset="79">
+ <param name="v" type="const GLdouble *" count="4"/>
+ <glx rop="41"/>
+ </function>
+
+ <function name="RasterPos4f" offset="80" vectorequiv="RasterPos4fv">
+ <param name="x" type="GLfloat"/>
+ <param name="y" type="GLfloat"/>
+ <param name="z" type="GLfloat"/>
+ <param name="w" type="GLfloat"/>
+ </function>
+
+ <function name="RasterPos4fv" offset="81">
+ <param name="v" type="const GLfloat *" count="4"/>
+ <glx rop="42"/>
+ </function>
+
+ <function name="RasterPos4i" offset="82" vectorequiv="RasterPos4iv">
+ <param name="x" type="GLint"/>
+ <param name="y" type="GLint"/>
+ <param name="z" type="GLint"/>
+ <param name="w" type="GLint"/>
+ </function>
+
+ <function name="RasterPos4iv" offset="83">
+ <param name="v" type="const GLint *" count="4"/>
+ <glx rop="43"/>
+ </function>
+
+ <function name="RasterPos4s" offset="84" vectorequiv="RasterPos4sv">
+ <param name="x" type="GLshort"/>
+ <param name="y" type="GLshort"/>
+ <param name="z" type="GLshort"/>
+ <param name="w" type="GLshort"/>
+ </function>
+
+ <function name="RasterPos4sv" offset="85">
+ <param name="v" type="const GLshort *" count="4"/>
+ <glx rop="44"/>
+ </function>
+
+ <function name="Rectd" offset="86" vectorequiv="Rectdv">
+ <param name="x1" type="GLdouble"/>
+ <param name="y1" type="GLdouble"/>
+ <param name="x2" type="GLdouble"/>
+ <param name="y2" type="GLdouble"/>
+ </function>
+
+ <function name="Rectdv" offset="87">
+ <param name="v1" type="const GLdouble *" count="2"/>
+ <param name="v2" type="const GLdouble *" count="2"/>
+ <glx rop="45"/>
+ </function>
+
+ <function name="Rectf" offset="88" vectorequiv="Rectfv">
+ <param name="x1" type="GLfloat"/>
+ <param name="y1" type="GLfloat"/>
+ <param name="x2" type="GLfloat"/>
+ <param name="y2" type="GLfloat"/>
+ </function>
+
+ <function name="Rectfv" offset="89">
+ <param name="v1" type="const GLfloat *" count="2"/>
+ <param name="v2" type="const GLfloat *" count="2"/>
+ <glx rop="46"/>
+ </function>
+
+ <function name="Recti" offset="90" vectorequiv="Rectiv">
+ <param name="x1" type="GLint"/>
+ <param name="y1" type="GLint"/>
+ <param name="x2" type="GLint"/>
+ <param name="y2" type="GLint"/>
+ </function>
+
+ <function name="Rectiv" offset="91">
+ <param name="v1" type="const GLint *" count="2"/>
+ <param name="v2" type="const GLint *" count="2"/>
+ <glx rop="47"/>
+ </function>
+
+ <function name="Rects" offset="92" vectorequiv="Rectsv">
+ <param name="x1" type="GLshort"/>
+ <param name="y1" type="GLshort"/>
+ <param name="x2" type="GLshort"/>
+ <param name="y2" type="GLshort"/>
+ </function>
+
+ <function name="Rectsv" offset="93">
+ <param name="v1" type="const GLshort *" count="2"/>
+ <param name="v2" type="const GLshort *" count="2"/>
+ <glx rop="48"/>
+ </function>
+
+ <function name="TexCoord1d" offset="94" vectorequiv="TexCoord1dv">
+ <param name="s" type="GLdouble"/>
+ </function>
+
+ <function name="TexCoord1dv" offset="95">
+ <param name="v" type="const GLdouble *" count="1"/>
+ <glx rop="49"/>
+ </function>
+
+ <function name="TexCoord1f" offset="96" vectorequiv="TexCoord1fv">
+ <param name="s" type="GLfloat"/>
+ </function>
+
+ <function name="TexCoord1fv" offset="97">
+ <param name="v" type="const GLfloat *" count="1"/>
+ <glx rop="50"/>
+ </function>
+
+ <function name="TexCoord1i" offset="98" vectorequiv="TexCoord1iv">
+ <param name="s" type="GLint"/>
+ </function>
+
+ <function name="TexCoord1iv" offset="99">
+ <param name="v" type="const GLint *" count="1"/>
+ <glx rop="51"/>
+ </function>
+
+ <function name="TexCoord1s" offset="100" vectorequiv="TexCoord1sv">
+ <param name="s" type="GLshort"/>
+ </function>
+
+ <function name="TexCoord1sv" offset="101">
+ <param name="v" type="const GLshort *" count="1"/>
+ <glx rop="52"/>
+ </function>
+
+ <function name="TexCoord2d" offset="102" vectorequiv="TexCoord2dv">
+ <param name="s" type="GLdouble"/>
+ <param name="t" type="GLdouble"/>
+ </function>
+
+ <function name="TexCoord2dv" offset="103">
+ <param name="v" type="const GLdouble *" count="2"/>
+ <glx rop="53"/>
+ </function>
+
+ <function name="TexCoord2f" offset="104" vectorequiv="TexCoord2fv">
+ <param name="s" type="GLfloat"/>
+ <param name="t" type="GLfloat"/>
+ </function>
+
+ <function name="TexCoord2fv" offset="105">
+ <param name="v" type="const GLfloat *" count="2"/>
+ <glx rop="54"/>
+ </function>
+
+ <function name="TexCoord2i" offset="106" vectorequiv="TexCoord2iv">
+ <param name="s" type="GLint"/>
+ <param name="t" type="GLint"/>
+ </function>
+
+ <function name="TexCoord2iv" offset="107">
+ <param name="v" type="const GLint *" count="2"/>
+ <glx rop="55"/>
+ </function>
+
+ <function name="TexCoord2s" offset="108" vectorequiv="TexCoord2sv">
+ <param name="s" type="GLshort"/>
+ <param name="t" type="GLshort"/>
+ </function>
+
+ <function name="TexCoord2sv" offset="109">
+ <param name="v" type="const GLshort *" count="2"/>
+ <glx rop="56"/>
+ </function>
+
+ <function name="TexCoord3d" offset="110" vectorequiv="TexCoord3dv">
+ <param name="s" type="GLdouble"/>
+ <param name="t" type="GLdouble"/>
+ <param name="r" type="GLdouble"/>
+ </function>
+
+ <function name="TexCoord3dv" offset="111">
+ <param name="v" type="const GLdouble *" count="3"/>
+ <glx rop="57"/>
+ </function>
+
+ <function name="TexCoord3f" offset="112" vectorequiv="TexCoord3fv">
+ <param name="s" type="GLfloat"/>
+ <param name="t" type="GLfloat"/>
+ <param name="r" type="GLfloat"/>
+ </function>
+
+ <function name="TexCoord3fv" offset="113">
+ <param name="v" type="const GLfloat *" count="3"/>
+ <glx rop="58"/>
+ </function>
+
+ <function name="TexCoord3i" offset="114" vectorequiv="TexCoord3iv">
+ <param name="s" type="GLint"/>
+ <param name="t" type="GLint"/>
+ <param name="r" type="GLint"/>
+ </function>
+
+ <function name="TexCoord3iv" offset="115">
+ <param name="v" type="const GLint *" count="3"/>
+ <glx rop="59"/>
+ </function>
+
+ <function name="TexCoord3s" offset="116" vectorequiv="TexCoord3sv">
+ <param name="s" type="GLshort"/>
+ <param name="t" type="GLshort"/>
+ <param name="r" type="GLshort"/>
+ </function>
+
+ <function name="TexCoord3sv" offset="117">
+ <param name="v" type="const GLshort *" count="3"/>
+ <glx rop="60"/>
+ </function>
+
+ <function name="TexCoord4d" offset="118" vectorequiv="TexCoord4dv">
+ <param name="s" type="GLdouble"/>
+ <param name="t" type="GLdouble"/>
+ <param name="r" type="GLdouble"/>
+ <param name="q" type="GLdouble"/>
+ </function>
+
+ <function name="TexCoord4dv" offset="119">
+ <param name="v" type="const GLdouble *" count="4"/>
+ <glx rop="61"/>
+ </function>
+
+ <function name="TexCoord4f" offset="120" vectorequiv="TexCoord4fv">
+ <param name="s" type="GLfloat"/>
+ <param name="t" type="GLfloat"/>
+ <param name="r" type="GLfloat"/>
+ <param name="q" type="GLfloat"/>
+ </function>
+
+ <function name="TexCoord4fv" offset="121">
+ <param name="v" type="const GLfloat *" count="4"/>
+ <glx rop="62"/>
+ </function>
+
+ <function name="TexCoord4i" offset="122" vectorequiv="TexCoord4iv">
+ <param name="s" type="GLint"/>
+ <param name="t" type="GLint"/>
+ <param name="r" type="GLint"/>
+ <param name="q" type="GLint"/>
+ </function>
+
+ <function name="TexCoord4iv" offset="123">
+ <param name="v" type="const GLint *" count="4"/>
+ <glx rop="63"/>
+ </function>
+
+ <function name="TexCoord4s" offset="124" vectorequiv="TexCoord4sv">
+ <param name="s" type="GLshort"/>
+ <param name="t" type="GLshort"/>
+ <param name="r" type="GLshort"/>
+ <param name="q" type="GLshort"/>
+ </function>
+
+ <function name="TexCoord4sv" offset="125">
+ <param name="v" type="const GLshort *" count="4"/>
+ <glx rop="64"/>
+ </function>
+
+ <function name="Vertex2d" offset="126" vectorequiv="Vertex2dv">
+ <param name="x" type="GLdouble"/>
+ <param name="y" type="GLdouble"/>
+ </function>
+
+ <function name="Vertex2dv" offset="127">
+ <param name="v" type="const GLdouble *" count="2"/>
+ <glx rop="65"/>
+ </function>
+
+ <function name="Vertex2f" offset="128" vectorequiv="Vertex2fv">
+ <param name="x" type="GLfloat"/>
+ <param name="y" type="GLfloat"/>
+ </function>
+
+ <function name="Vertex2fv" offset="129">
+ <param name="v" type="const GLfloat *" count="2"/>
+ <glx rop="66"/>
+ </function>
+
+ <function name="Vertex2i" offset="130" vectorequiv="Vertex2iv">
+ <param name="x" type="GLint"/>
+ <param name="y" type="GLint"/>
+ </function>
+
+ <function name="Vertex2iv" offset="131">
+ <param name="v" type="const GLint *" count="2"/>
+ <glx rop="67"/>
+ </function>
+
+ <function name="Vertex2s" offset="132" vectorequiv="Vertex2sv">
+ <param name="x" type="GLshort"/>
+ <param name="y" type="GLshort"/>
+ </function>
+
+ <function name="Vertex2sv" offset="133">
+ <param name="v" type="const GLshort *" count="2"/>
+ <glx rop="68"/>
+ </function>
+
+ <function name="Vertex3d" offset="134" vectorequiv="Vertex3dv">
+ <param name="x" type="GLdouble"/>
+ <param name="y" type="GLdouble"/>
+ <param name="z" type="GLdouble"/>
+ </function>
+
+ <function name="Vertex3dv" offset="135">
+ <param name="v" type="const GLdouble *" count="3"/>
+ <glx rop="69"/>
+ </function>
+
+ <function name="Vertex3f" offset="136" vectorequiv="Vertex3fv">
+ <param name="x" type="GLfloat"/>
+ <param name="y" type="GLfloat"/>
+ <param name="z" type="GLfloat"/>
+ </function>
+
+ <function name="Vertex3fv" offset="137">
+ <param name="v" type="const GLfloat *" count="3"/>
+ <glx rop="70"/>
+ </function>
+
+ <function name="Vertex3i" offset="138" vectorequiv="Vertex3iv">
+ <param name="x" type="GLint"/>
+ <param name="y" type="GLint"/>
+ <param name="z" type="GLint"/>
+ </function>
+
+ <function name="Vertex3iv" offset="139">
+ <param name="v" type="const GLint *" count="3"/>
+ <glx rop="71"/>
+ </function>
+
+ <function name="Vertex3s" offset="140" vectorequiv="Vertex3sv">
+ <param name="x" type="GLshort"/>
+ <param name="y" type="GLshort"/>
+ <param name="z" type="GLshort"/>
+ </function>
+
+ <function name="Vertex3sv" offset="141">
+ <param name="v" type="const GLshort *" count="3"/>
+ <glx rop="72"/>
+ </function>
+
+ <function name="Vertex4d" offset="142" vectorequiv="Vertex4dv">
+ <param name="x" type="GLdouble"/>
+ <param name="y" type="GLdouble"/>
+ <param name="z" type="GLdouble"/>
+ <param name="w" type="GLdouble"/>
+ </function>
+
+ <function name="Vertex4dv" offset="143">
+ <param name="v" type="const GLdouble *" count="4"/>
+ <glx rop="73"/>
+ </function>
+
+ <function name="Vertex4f" offset="144" vectorequiv="Vertex4fv">
+ <param name="x" type="GLfloat"/>
+ <param name="y" type="GLfloat"/>
+ <param name="z" type="GLfloat"/>
+ <param name="w" type="GLfloat"/>
+ </function>
+
+ <function name="Vertex4fv" offset="145">
+ <param name="v" type="const GLfloat *" count="4"/>
+ <glx rop="74"/>
+ </function>
+
+ <function name="Vertex4i" offset="146" vectorequiv="Vertex4iv">
+ <param name="x" type="GLint"/>
+ <param name="y" type="GLint"/>
+ <param name="z" type="GLint"/>
+ <param name="w" type="GLint"/>
+ </function>
+
+ <function name="Vertex4iv" offset="147">
+ <param name="v" type="const GLint *" count="4"/>
+ <glx rop="75"/>
+ </function>
+
+ <function name="Vertex4s" offset="148" vectorequiv="Vertex4sv">
+ <param name="x" type="GLshort"/>
+ <param name="y" type="GLshort"/>
+ <param name="z" type="GLshort"/>
+ <param name="w" type="GLshort"/>
+ </function>
+
+ <function name="Vertex4sv" offset="149">
+ <param name="v" type="const GLshort *" count="4"/>
+ <glx rop="76"/>
+ </function>
+
+ <function name="ClipPlane" offset="150">
+ <param name="plane" type="GLenum"/>
+ <param name="equation" type="const GLdouble *" count="4"/>
+ <glx rop="77"/>
+ </function>
+
+ <function name="ColorMaterial" offset="151">
+ <param name="face" type="GLenum"/>
+ <param name="mode" type="GLenum"/>
+ <glx rop="78"/>
+ </function>
+
+ <function name="CullFace" offset="152">
+ <param name="mode" type="GLenum"/>
+ <glx rop="79"/>
+ </function>
+
+ <function name="Fogf" offset="153">
+ <param name="pname" type="GLenum"/>
+ <param name="param" type="GLfloat"/>
+ <glx rop="80"/>
+ </function>
+
+ <function name="Fogfv" offset="154">
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="const GLfloat *" variable_param="pname"/>
+ <glx rop="81"/>
+ </function>
+
+ <function name="Fogi" offset="155">
+ <param name="pname" type="GLenum"/>
+ <param name="param" type="GLint"/>
+ <glx rop="82"/>
+ </function>
+
+ <function name="Fogiv" offset="156">
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="const GLint *" variable_param="pname"/>
+ <glx rop="83"/>
+ </function>
+
+ <function name="FrontFace" offset="157">
+ <param name="mode" type="GLenum"/>
+ <glx rop="84"/>
+ </function>
+
+ <function name="Hint" offset="158">
+ <param name="target" type="GLenum"/>
+ <param name="mode" type="GLenum"/>
+ <glx rop="85"/>
+ </function>
+
+ <function name="Lightf" offset="159">
+ <param name="light" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="param" type="GLfloat"/>
+ <glx rop="86"/>
+ </function>
+
+ <function name="Lightfv" offset="160">
+ <param name="light" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="const GLfloat *" variable_param="pname"/>
+ <glx rop="87"/>
+ </function>
+
+ <function name="Lighti" offset="161">
+ <param name="light" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="param" type="GLint"/>
+ <glx rop="88"/>
+ </function>
+
+ <function name="Lightiv" offset="162">
+ <param name="light" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="const GLint *" variable_param="pname"/>
+ <glx rop="89"/>
+ </function>
+
+ <function name="LightModelf" offset="163">
+ <param name="pname" type="GLenum"/>
+ <param name="param" type="GLfloat"/>
+ <glx rop="90"/>
+ </function>
+
+ <function name="LightModelfv" offset="164">
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="const GLfloat *" variable_param="pname"/>
+ <glx rop="91"/>
+ </function>
+
+ <function name="LightModeli" offset="165">
+ <param name="pname" type="GLenum"/>
+ <param name="param" type="GLint"/>
+ <glx rop="92"/>
+ </function>
+
+ <function name="LightModeliv" offset="166">
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="const GLint *" variable_param="pname"/>
+ <glx rop="93"/>
+ </function>
+
+ <function name="LineStipple" offset="167">
+ <param name="factor" type="GLint"/>
+ <param name="pattern" type="GLushort"/>
+ <glx rop="94"/>
+ </function>
+
+ <function name="LineWidth" offset="168">
+ <param name="width" type="GLfloat"/>
+ <glx rop="95"/>
+ </function>
+
+ <function name="Materialf" offset="169">
+ <param name="face" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="param" type="GLfloat"/>
+ <glx rop="96"/>
+ </function>
+
+ <function name="Materialfv" offset="170">
+ <param name="face" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="const GLfloat *" variable_param="pname"/>
+ <glx rop="97"/>
+ </function>
+
+ <function name="Materiali" offset="171">
+ <param name="face" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="param" type="GLint"/>
+ <glx rop="98"/>
+ </function>
+
+ <function name="Materialiv" offset="172">
+ <param name="face" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="const GLint *" variable_param="pname"/>
+ <glx rop="99"/>
+ </function>
+
+ <function name="PointSize" offset="173">
+ <param name="size" type="GLfloat"/>
+ <glx rop="100"/>
+ </function>
+
+ <function name="PolygonMode" offset="174">
+ <param name="face" type="GLenum"/>
+ <param name="mode" type="GLenum"/>
+ <glx rop="101"/>
+ </function>
+
+ <function name="PolygonStipple" offset="175">
+ <param name="mask" type="const GLubyte *" img_width="32" img_height="32" img_format="GL_COLOR_INDEX" img_type="GL_BITMAP" img_target="0" img_pad_dimensions="false"/>
+ <glx rop="102"/>
+ </function>
+
+ <function name="Scissor" offset="176">
+ <param name="x" type="GLint"/>
+ <param name="y" type="GLint"/>
+ <param name="width" type="GLsizei"/>
+ <param name="height" type="GLsizei"/>
+ <glx rop="103"/>
+ </function>
+
+ <function name="ShadeModel" offset="177">
+ <param name="mode" type="GLenum"/>
+ <glx rop="104"/>
+ </function>
+
+ <function name="TexParameterf" offset="178">
+ <param name="target" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="param" type="GLfloat"/>
+ <glx rop="105"/>
+ </function>
+
+ <function name="TexParameterfv" offset="179">
+ <param name="target" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="const GLfloat *" variable_param="pname"/>
+ <glx rop="106"/>
+ </function>
+
+ <function name="TexParameteri" offset="180">
+ <param name="target" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="param" type="GLint"/>
+ <glx rop="107"/>
+ </function>
+
+ <function name="TexParameteriv" offset="181">
+ <param name="target" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="const GLint *" variable_param="pname"/>
+ <glx rop="108"/>
+ </function>
+
+ <function name="TexImage1D" offset="182">
+ <param name="target" type="GLenum"/>
+ <param name="level" type="GLint"/>
+ <param name="internalformat" type="GLint"/>
+ <param name="width" type="GLsizei"/>
+ <param name="border" type="GLint"/>
+ <param name="format" type="GLenum"/>
+ <param name="type" type="GLenum"/>
+ <param name="pixels" type="const GLvoid *" img_width="width" img_format="format" img_type="type" img_target="target" img_send_null="true" img_pad_dimensions="true"/>
+ <glx rop="109" large="true"/>
+ </function>
+
+ <function name="TexImage2D" offset="183">
+ <param name="target" type="GLenum"/>
+ <param name="level" type="GLint"/>
+ <param name="internalformat" type="GLint"/>
+ <param name="width" type="GLsizei"/>
+ <param name="height" type="GLsizei"/>
+ <param name="border" type="GLint"/>
+ <param name="format" type="GLenum"/>
+ <param name="type" type="GLenum"/>
+ <param name="pixels" type="const GLvoid *" img_width="width" img_height="height" img_format="format" img_type="type" img_target="target" img_send_null="true" img_pad_dimensions="true"/>
+ <glx rop="110" large="true"/>
+ </function>
+
+ <function name="TexEnvf" offset="184">
+ <param name="target" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="param" type="GLfloat"/>
+ <glx rop="111"/>
+ </function>
+
+ <function name="TexEnvfv" offset="185">
+ <param name="target" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="const GLfloat *" variable_param="pname"/>
+ <glx rop="112"/>
+ </function>
+
+ <function name="TexEnvi" offset="186">
+ <param name="target" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="param" type="GLint"/>
+ <glx rop="113"/>
+ </function>
+
+ <function name="TexEnviv" offset="187">
+ <param name="target" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="const GLint *" variable_param="pname"/>
+ <glx rop="114"/>
+ </function>
+
+ <function name="TexGend" offset="188">
+ <param name="coord" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="param" type="GLdouble"/>
+ <glx rop="115"/>
+ </function>
+
+ <function name="TexGendv" offset="189">
+ <param name="coord" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="const GLdouble *" variable_param="pname"/>
+ <glx rop="116"/>
+ </function>
+
+ <function name="TexGenf" offset="190">
+ <param name="coord" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="param" type="GLfloat"/>
+ <glx rop="117"/>
+ </function>
+
+ <function name="TexGenfv" offset="191">
+ <param name="coord" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="const GLfloat *" variable_param="pname"/>
+ <glx rop="118"/>
+ </function>
+
+ <function name="TexGeni" offset="192">
+ <param name="coord" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="param" type="GLint"/>
+ <glx rop="119"/>
+ </function>
+
+ <function name="TexGeniv" offset="193">
+ <param name="coord" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="const GLint *" variable_param="pname"/>
+ <glx rop="120"/>
+ </function>
+
+ <function name="FeedbackBuffer" offset="194">
+ <param name="size" type="GLsizei"/>
+ <param name="type" type="GLenum"/>
+ <param name="buffer" type="GLfloat *" output="true"/>
+ <glx sop="105" handcode="true"/>
+ </function>
+
+ <function name="SelectBuffer" offset="195">
+ <param name="size" type="GLsizei"/>
+ <param name="buffer" type="GLuint *" output="true"/>
+ <glx sop="106" handcode="true"/>
+ </function>
+
+ <function name="RenderMode" offset="196">
+ <param name="mode" type="GLenum"/>
+ <return type="GLint"/>
+ <glx sop="107" handcode="true"/>
+ </function>
+
+ <function name="InitNames" offset="197">
+ <glx rop="121"/>
+ </function>
+
+ <function name="LoadName" offset="198">
+ <param name="name" type="GLuint"/>
+ <glx rop="122"/>
+ </function>
+
+ <function name="PassThrough" offset="199">
+ <param name="token" type="GLfloat"/>
+ <glx rop="123"/>
+ </function>
+
+ <function name="PopName" offset="200">
+ <glx rop="124"/>
+ </function>
+
+ <function name="PushName" offset="201">
+ <param name="name" type="GLuint"/>
+ <glx rop="125"/>
+ </function>
+
+ <function name="DrawBuffer" offset="202">
+ <param name="mode" type="GLenum"/>
+ <glx rop="126"/>
+ </function>
+
+ <function name="Clear" offset="203">
+ <param name="mask" type="GLbitfield"/>
+ <glx rop="127"/>
+ </function>
+
+ <function name="ClearAccum" offset="204">
+ <param name="red" type="GLfloat"/>
+ <param name="green" type="GLfloat"/>
+ <param name="blue" type="GLfloat"/>
+ <param name="alpha" type="GLfloat"/>
+ <glx rop="128"/>
+ </function>
+
+ <function name="ClearIndex" offset="205">
+ <param name="c" type="GLfloat"/>
+ <glx rop="129"/>
+ </function>
+
+ <function name="ClearColor" offset="206">
+ <param name="red" type="GLclampf"/>
+ <param name="green" type="GLclampf"/>
+ <param name="blue" type="GLclampf"/>
+ <param name="alpha" type="GLclampf"/>
+ <glx rop="130"/>
+ </function>
+
+ <function name="ClearStencil" offset="207">
+ <param name="s" type="GLint"/>
+ <glx rop="131"/>
+ </function>
+
+ <function name="ClearDepth" offset="208">
+ <param name="depth" type="GLclampd"/>
+ <glx rop="132"/>
+ </function>
+
+ <function name="StencilMask" offset="209">
+ <param name="mask" type="GLuint"/>
+ <glx rop="133"/>
+ </function>
+
+ <function name="ColorMask" offset="210">
+ <param name="red" type="GLboolean"/>
+ <param name="green" type="GLboolean"/>
+ <param name="blue" type="GLboolean"/>
+ <param name="alpha" type="GLboolean"/>
+ <glx rop="134"/>
+ </function>
+
+ <function name="DepthMask" offset="211">
+ <param name="flag" type="GLboolean"/>
+ <glx rop="135"/>
+ </function>
+
+ <function name="IndexMask" offset="212">
+ <param name="mask" type="GLuint"/>
+ <glx rop="136"/>
+ </function>
+
+ <function name="Accum" offset="213">
+ <param name="op" type="GLenum"/>
+ <param name="value" type="GLfloat"/>
+ <glx rop="137"/>
+ </function>
+
+ <function name="Disable" offset="214">
+ <param name="cap" type="GLenum"/>
+ <glx rop="138" handcode="client"/>
+ </function>
+
+ <function name="Enable" offset="215">
+ <param name="cap" type="GLenum"/>
+ <glx rop="139" handcode="client"/>
+ </function>
+
+ <function name="Finish" offset="216">
+ <glx sop="108" handcode="true"/>
+ </function>
+
+ <function name="Flush" offset="217">
+ <glx sop="142" handcode="true"/>
+ </function>
+
+ <function name="PopAttrib" offset="218">
+ <glx rop="141"/>
+ </function>
+
+ <function name="PushAttrib" offset="219">
+ <param name="mask" type="GLbitfield"/>
+ <glx rop="142"/>
+ </function>
+
+ <function name="Map1d" offset="220">
+ <param name="target" type="GLenum"/>
+ <param name="u1" type="GLdouble"/>
+ <param name="u2" type="GLdouble"/>
+ <param name="stride" type="GLint" client_only="true"/>
+ <param name="order" type="GLint"/>
+ <param name="points" type="const GLdouble *" variable_param="order"/>
+ <glx rop="143" handcode="true"/>
+ </function>
+
+ <function name="Map1f" offset="221">
+ <param name="target" type="GLenum"/>
+ <param name="u1" type="GLfloat"/>
+ <param name="u2" type="GLfloat"/>
+ <param name="stride" type="GLint" client_only="true"/>
+ <param name="order" type="GLint"/>
+ <param name="points" type="const GLfloat *" variable_param="order"/>
+ <glx rop="144" handcode="true"/>
+ </function>
+
+ <function name="Map2d" offset="222">
+ <param name="target" type="GLenum"/>
+ <param name="u1" type="GLdouble"/>
+ <param name="u2" type="GLdouble"/>
+ <param name="ustride" type="GLint" client_only="true"/>
+ <param name="uorder" type="GLint"/>
+ <param name="v1" type="GLdouble"/>
+ <param name="v2" type="GLdouble"/>
+ <param name="vstride" type="GLint" client_only="true"/>
+ <param name="vorder" type="GLint"/>
+ <param name="points" type="const GLdouble *" variable_param="uorder"/>
+ <glx rop="145" handcode="true"/>
+ </function>
+
+ <function name="Map2f" offset="223">
+ <param name="target" type="GLenum"/>
+ <param name="u1" type="GLfloat"/>
+ <param name="u2" type="GLfloat"/>
+ <param name="ustride" type="GLint" client_only="true"/>
+ <param name="uorder" type="GLint"/>
+ <param name="v1" type="GLfloat"/>
+ <param name="v2" type="GLfloat"/>
+ <param name="vstride" type="GLint" client_only="true"/>
+ <param name="vorder" type="GLint"/>
+ <param name="points" type="const GLfloat *" variable_param="uorder"/>
+ <glx rop="146" handcode="true"/>
+ </function>
+
+ <function name="MapGrid1d" offset="224">
+ <param name="un" type="GLint"/>
+ <param name="u1" type="GLdouble"/>
+ <param name="u2" type="GLdouble"/>
+ <glx rop="147"/>
+ </function>
+
+ <function name="MapGrid1f" offset="225">
+ <param name="un" type="GLint"/>
+ <param name="u1" type="GLfloat"/>
+ <param name="u2" type="GLfloat"/>
+ <glx rop="148"/>
+ </function>
+
+ <function name="MapGrid2d" offset="226">
+ <param name="un" type="GLint"/>
+ <param name="u1" type="GLdouble"/>
+ <param name="u2" type="GLdouble"/>
+ <param name="vn" type="GLint"/>
+ <param name="v1" type="GLdouble"/>
+ <param name="v2" type="GLdouble"/>
+ <glx rop="149"/>
+ </function>
+
+ <function name="MapGrid2f" offset="227">
+ <param name="un" type="GLint"/>
+ <param name="u1" type="GLfloat"/>
+ <param name="u2" type="GLfloat"/>
+ <param name="vn" type="GLint"/>
+ <param name="v1" type="GLfloat"/>
+ <param name="v2" type="GLfloat"/>
+ <glx rop="150"/>
+ </function>
+
+ <function name="EvalCoord1d" offset="228" vectorequiv="EvalCoord1dv">
+ <param name="u" type="GLdouble"/>
+ </function>
+
+ <function name="EvalCoord1dv" offset="229">
+ <param name="u" type="const GLdouble *" count="1"/>
+ <glx rop="151"/>
+ </function>
+
+ <function name="EvalCoord1f" offset="230" vectorequiv="EvalCoord1fv">
+ <param name="u" type="GLfloat"/>
+ </function>
+
+ <function name="EvalCoord1fv" offset="231">
+ <param name="u" type="const GLfloat *" count="1"/>
+ <glx rop="152"/>
+ </function>
+
+ <function name="EvalCoord2d" offset="232" vectorequiv="EvalCoord2dv">
+ <param name="u" type="GLdouble"/>
+ <param name="v" type="GLdouble"/>
+ </function>
+
+ <function name="EvalCoord2dv" offset="233">
+ <param name="u" type="const GLdouble *" count="2"/>
+ <glx rop="153"/>
+ </function>
+
+ <function name="EvalCoord2f" offset="234" vectorequiv="EvalCoord2fv">
+ <param name="u" type="GLfloat"/>
+ <param name="v" type="GLfloat"/>
+ </function>
+
+ <function name="EvalCoord2fv" offset="235">
+ <param name="u" type="const GLfloat *" count="2"/>
+ <glx rop="154"/>
+ </function>
+
+ <function name="EvalMesh1" offset="236">
+ <param name="mode" type="GLenum"/>
+ <param name="i1" type="GLint"/>
+ <param name="i2" type="GLint"/>
+ <glx rop="155"/>
+ </function>
+
+ <function name="EvalPoint1" offset="237">
+ <param name="i" type="GLint"/>
+ <glx rop="156"/>
+ </function>
+
+ <function name="EvalMesh2" offset="238">
+ <param name="mode" type="GLenum"/>
+ <param name="i1" type="GLint"/>
+ <param name="i2" type="GLint"/>
+ <param name="j1" type="GLint"/>
+ <param name="j2" type="GLint"/>
+ <glx rop="157"/>
+ </function>
+
+ <function name="EvalPoint2" offset="239">
+ <param name="i" type="GLint"/>
+ <param name="j" type="GLint"/>
+ <glx rop="158"/>
+ </function>
+
+ <function name="AlphaFunc" offset="240">
+ <param name="func" type="GLenum"/>
+ <param name="ref" type="GLclampf"/>
+ <glx rop="159"/>
+ </function>
+
+ <function name="BlendFunc" offset="241">
+ <param name="sfactor" type="GLenum"/>
+ <param name="dfactor" type="GLenum"/>
+ <glx rop="160"/>
+ </function>
+
+ <function name="LogicOp" offset="242">
+ <param name="opcode" type="GLenum"/>
+ <glx rop="161"/>
+ </function>
+
+ <function name="StencilFunc" offset="243">
+ <param name="func" type="GLenum"/>
+ <param name="ref" type="GLint"/>
+ <param name="mask" type="GLuint"/>
+ <glx rop="162"/>
+ </function>
+
+ <function name="StencilOp" offset="244">
+ <param name="fail" type="GLenum"/>
+ <param name="zfail" type="GLenum"/>
+ <param name="zpass" type="GLenum"/>
+ <glx rop="163"/>
+ </function>
+
+ <function name="DepthFunc" offset="245">
+ <param name="func" type="GLenum"/>
+ <glx rop="164"/>
+ </function>
+
+ <function name="PixelZoom" offset="246">
+ <param name="xfactor" type="GLfloat"/>
+ <param name="yfactor" type="GLfloat"/>
+ <glx rop="165"/>
+ </function>
+
+ <function name="PixelTransferf" offset="247">
+ <param name="pname" type="GLenum"/>
+ <param name="param" type="GLfloat"/>
+ <glx rop="166"/>
+ </function>
+
+ <function name="PixelTransferi" offset="248">
+ <param name="pname" type="GLenum"/>
+ <param name="param" type="GLint"/>
+ <glx rop="167"/>
+ </function>
+
+ <function name="PixelStoref" offset="249">
+ <param name="pname" type="GLenum"/>
+ <param name="param" type="GLfloat"/>
+ <glx sop="109" handcode="client"/>
+ </function>
+
+ <function name="PixelStorei" offset="250">
+ <param name="pname" type="GLenum"/>
+ <param name="param" type="GLint"/>
+ <glx sop="110" handcode="client"/>
+ </function>
+
+ <function name="PixelMapfv" offset="251">
+ <param name="map" type="GLenum"/>
+ <param name="mapsize" type="GLsizei" counter="true"/>
+ <param name="values" type="const GLfloat *" count="mapsize"/>
+ <glx rop="168" large="true"/>
+ </function>
+
+ <function name="PixelMapuiv" offset="252">
+ <param name="map" type="GLenum"/>
+ <param name="mapsize" type="GLsizei" counter="true"/>
+ <param name="values" type="const GLuint *" count="mapsize"/>
+ <glx rop="169" large="true"/>
+ </function>
+
+ <function name="PixelMapusv" offset="253">
+ <param name="map" type="GLenum"/>
+ <param name="mapsize" type="GLsizei" counter="true"/>
+ <param name="values" type="const GLushort *" count="mapsize"/>
+ <glx rop="170" large="true"/>
+ </function>
+
+ <function name="ReadBuffer" offset="254">
+ <param name="mode" type="GLenum"/>
+ <glx rop="171"/>
+ </function>
+
+ <function name="CopyPixels" offset="255">
+ <param name="x" type="GLint"/>
+ <param name="y" type="GLint"/>
+ <param name="width" type="GLsizei"/>
+ <param name="height" type="GLsizei"/>
+ <param name="type" type="GLenum"/>
+ <glx rop="172"/>
+ </function>
+
+ <function name="ReadPixels" offset="256">
+ <param name="x" type="GLint"/>
+ <param name="y" type="GLint"/>
+ <param name="width" type="GLsizei"/>
+ <param name="height" type="GLsizei"/>
+ <param name="format" type="GLenum"/>
+ <param name="type" type="GLenum"/>
+ <param name="pixels" type="GLvoid *" output="true" img_width="width" img_height="height" img_format="format" img_type="type" img_target="0"/>
+ <glx sop="111"/>
+ </function>
+
+ <function name="DrawPixels" offset="257">
+ <param name="width" type="GLsizei"/>
+ <param name="height" type="GLsizei"/>
+ <param name="format" type="GLenum"/>
+ <param name="type" type="GLenum"/>
+ <param name="pixels" type="const GLvoid *" img_width="width" img_height="height" img_format="format" img_type="type" img_target="0" img_pad_dimensions="false"/>
+ <glx rop="173" large="true"/>
+ </function>
+
+ <function name="GetBooleanv" offset="258">
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLboolean *" output="true" variable_param="pname"/>
+ <glx sop="112" handcode="client"/>
+ </function>
+
+ <function name="GetClipPlane" offset="259">
+ <param name="plane" type="GLenum"/>
+ <param name="equation" type="GLdouble *" output="true" count="4"/>
+ <glx sop="113" always_array="true"/>
+ </function>
+
+ <function name="GetDoublev" offset="260">
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLdouble *" output="true" variable_param="pname"/>
+ <glx sop="114" handcode="client"/>
+ </function>
+
+ <function name="GetError" offset="261">
+ <return type="GLenum"/>
+ <glx sop="115" handcode="client"/>
+ </function>
+
+ <function name="GetFloatv" offset="262">
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLfloat *" output="true" variable_param="pname"/>
+ <glx sop="116" handcode="client"/>
+ </function>
+
+ <function name="GetIntegerv" offset="263">
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLint *" output="true" variable_param="pname"/>
+ <glx sop="117" handcode="client"/>
+ </function>
+
+ <function name="GetLightfv" offset="264">
+ <param name="light" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLfloat *" output="true" variable_param="pname"/>
+ <glx sop="118"/>
+ </function>
+
+ <function name="GetLightiv" offset="265">
+ <param name="light" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLint *" output="true" variable_param="pname"/>
+ <glx sop="119"/>
+ </function>
+
+ <function name="GetMapdv" offset="266">
+ <param name="target" type="GLenum"/>
+ <param name="query" type="GLenum"/>
+ <param name="v" type="GLdouble *" output="true" variable_param="target query"/>
+ <glx sop="120"/>
+ </function>
+
+ <function name="GetMapfv" offset="267">
+ <param name="target" type="GLenum"/>
+ <param name="query" type="GLenum"/>
+ <param name="v" type="GLfloat *" output="true" variable_param="target query"/>
+ <glx sop="121"/>
+ </function>
+
+ <function name="GetMapiv" offset="268">
+ <param name="target" type="GLenum"/>
+ <param name="query" type="GLenum"/>
+ <param name="v" type="GLint *" output="true" variable_param="target query"/>
+ <glx sop="122"/>
+ </function>
+
+ <function name="GetMaterialfv" offset="269">
+ <param name="face" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLfloat *" output="true" variable_param="pname"/>
+ <glx sop="123"/>
+ </function>
+
+ <function name="GetMaterialiv" offset="270">
+ <param name="face" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLint *" output="true" variable_param="pname"/>
+ <glx sop="124"/>
+ </function>
+
+ <function name="GetPixelMapfv" offset="271">
+ <param name="map" type="GLenum"/>
+ <param name="values" type="GLfloat *" output="true" variable_param="map"/>
+ <glx sop="125"/>
+ </function>
+
+ <function name="GetPixelMapuiv" offset="272">
+ <param name="map" type="GLenum"/>
+ <param name="values" type="GLuint *" output="true" variable_param="map"/>
+ <glx sop="126"/>
+ </function>
+
+ <function name="GetPixelMapusv" offset="273">
+ <param name="map" type="GLenum"/>
+ <param name="values" type="GLushort *" output="true" variable_param="map"/>
+ <glx sop="127"/>
+ </function>
+
+ <function name="GetPolygonStipple" offset="274">
+ <param name="mask" type="GLubyte *" output="true" img_width="32" img_height="32" img_format="GL_COLOR_INDEX" img_type="GL_BITMAP"/>
+ <glx sop="128"/>
+ </function>
+
+ <function name="GetString" offset="275">
+ <param name="name" type="GLenum"/>
+ <return type="const GLubyte *"/>
+ <glx sop="129" handcode="true"/>
+ </function>
+
+ <function name="GetTexEnvfv" offset="276">
+ <param name="target" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLfloat *" output="true" variable_param="pname"/>
+ <glx sop="130"/>
+ </function>
+
+ <function name="GetTexEnviv" offset="277">
+ <param name="target" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLint *" output="true" variable_param="pname"/>
+ <glx sop="131"/>
+ </function>
+
+ <function name="GetTexGendv" offset="278">
+ <param name="coord" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLdouble *" output="true" variable_param="pname"/>
+ <glx sop="132"/>
+ </function>
+
+ <function name="GetTexGenfv" offset="279">
+ <param name="coord" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLfloat *" output="true" variable_param="pname"/>
+ <glx sop="133"/>
+ </function>
+
+ <function name="GetTexGeniv" offset="280">
+ <param name="coord" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLint *" output="true" variable_param="pname"/>
+ <glx sop="134"/>
+ </function>
+
+ <function name="GetTexImage" offset="281">
+ <param name="target" type="GLenum"/>
+ <param name="level" type="GLint"/>
+ <param name="format" type="GLenum"/>
+ <param name="type" type="GLenum"/>
+ <param name="pixels" type="GLvoid *" output="true" img_width="width" img_height="height" img_depth="depth" img_format="format" img_type="type"/>
+ <glx sop="135" dimensions_in_reply="true"/>
+ </function>
+
+ <function name="GetTexParameterfv" offset="282">
+ <param name="target" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLfloat *" output="true" variable_param="pname"/>
+ <glx sop="136"/>
+ </function>
+
+ <function name="GetTexParameteriv" offset="283">
+ <param name="target" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLint *" output="true" variable_param="pname"/>
+ <glx sop="137"/>
+ </function>
+
+ <function name="GetTexLevelParameterfv" offset="284">
+ <param name="target" type="GLenum"/>
+ <param name="level" type="GLint"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLfloat *" output="true" variable_param="pname"/>
+ <glx sop="138"/>
+ </function>
+
+ <function name="GetTexLevelParameteriv" offset="285">
+ <param name="target" type="GLenum"/>
+ <param name="level" type="GLint"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLint *" output="true" variable_param="pname"/>
+ <glx sop="139"/>
+ </function>
+
+ <function name="IsEnabled" offset="286">
+ <param name="cap" type="GLenum"/>
+ <return type="GLboolean"/>
+ <glx sop="140" handcode="client"/>
+ </function>
+
+ <function name="IsList" offset="287">
+ <param name="list" type="GLuint"/>
+ <return type="GLboolean"/>
+ <glx sop="141"/>
+ </function>
+
+ <function name="DepthRange" offset="288">
+ <param name="zNear" type="GLclampd"/>
+ <param name="zFar" type="GLclampd"/>
+ <glx rop="174"/>
+ </function>
+
+ <function name="Frustum" offset="289">
+ <param name="left" type="GLdouble"/>
+ <param name="right" type="GLdouble"/>
+ <param name="bottom" type="GLdouble"/>
+ <param name="top" type="GLdouble"/>
+ <param name="zNear" type="GLdouble"/>
+ <param name="zFar" type="GLdouble"/>
+ <glx rop="175"/>
+ </function>
+
+ <function name="LoadIdentity" offset="290">
+ <glx rop="176"/>
+ </function>
+
+ <function name="LoadMatrixf" offset="291">
+ <param name="m" type="const GLfloat *" count="16"/>
+ <glx rop="177"/>
+ </function>
+
+ <function name="LoadMatrixd" offset="292">
+ <param name="m" type="const GLdouble *" count="16"/>
+ <glx rop="178"/>
+ </function>
+
+ <function name="MatrixMode" offset="293">
+ <param name="mode" type="GLenum"/>
+ <glx rop="179"/>
+ </function>
+
+ <function name="MultMatrixf" offset="294">
+ <param name="m" type="const GLfloat *" count="16"/>
+ <glx rop="180"/>
+ </function>
+
+ <function name="MultMatrixd" offset="295">
+ <param name="m" type="const GLdouble *" count="16"/>
+ <glx rop="181"/>
+ </function>
+
+ <function name="Ortho" offset="296">
+ <param name="left" type="GLdouble"/>
+ <param name="right" type="GLdouble"/>
+ <param name="bottom" type="GLdouble"/>
+ <param name="top" type="GLdouble"/>
+ <param name="zNear" type="GLdouble"/>
+ <param name="zFar" type="GLdouble"/>
+ <glx rop="182"/>
+ </function>
+
+ <function name="PopMatrix" offset="297">
+ <glx rop="183"/>
+ </function>
+
+ <function name="PushMatrix" offset="298">
+ <glx rop="184"/>
+ </function>
+
+ <function name="Rotated" offset="299">
+ <param name="angle" type="GLdouble"/>
+ <param name="x" type="GLdouble"/>
+ <param name="y" type="GLdouble"/>
+ <param name="z" type="GLdouble"/>
+ <glx rop="185"/>
+ </function>
+
+ <function name="Rotatef" offset="300">
+ <param name="angle" type="GLfloat"/>
+ <param name="x" type="GLfloat"/>
+ <param name="y" type="GLfloat"/>
+ <param name="z" type="GLfloat"/>
+ <glx rop="186"/>
+ </function>
+
+ <function name="Scaled" offset="301">
+ <param name="x" type="GLdouble"/>
+ <param name="y" type="GLdouble"/>
+ <param name="z" type="GLdouble"/>
+ <glx rop="187"/>
+ </function>
+
+ <function name="Scalef" offset="302">
+ <param name="x" type="GLfloat"/>
+ <param name="y" type="GLfloat"/>
+ <param name="z" type="GLfloat"/>
+ <glx rop="188"/>
+ </function>
+
+ <function name="Translated" offset="303">
+ <param name="x" type="GLdouble"/>
+ <param name="y" type="GLdouble"/>
+ <param name="z" type="GLdouble"/>
+ <glx rop="189"/>
+ </function>
+
+ <function name="Translatef" offset="304">
+ <param name="x" type="GLfloat"/>
+ <param name="y" type="GLfloat"/>
+ <param name="z" type="GLfloat"/>
+ <glx rop="190"/>
+ </function>
+
+ <function name="Viewport" offset="305">
+ <param name="x" type="GLint"/>
+ <param name="y" type="GLint"/>
+ <param name="width" type="GLsizei"/>
+ <param name="height" type="GLsizei"/>
+ <glx rop="191"/>
+ </function>
+</category>
+
+<category name="1.1">
+ <enum name="INDEX_LOGIC_OP" value="0x0BF1"/>
+ <enum name="COLOR_LOGIC_OP" value="0x0BF2"/>
+ <enum name="TEXTURE_INTERNAL_FORMAT" value="0x1003"/>
+ <enum name="DOUBLE" value="0x140A"/>
+ <enum name="POLYGON_OFFSET_UNITS" count="1" value="0x2A00">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="POLYGON_OFFSET_POINT" value="0x2A01"/>
+ <enum name="POLYGON_OFFSET_LINE" value="0x2A02"/>
+ <enum name="R3_G3_B2" value="0x2A10"/>
+ <enum name="V2F" value="0x2A20"/>
+ <enum name="V3F" value="0x2A21"/>
+ <enum name="C4UB_V2F" value="0x2A22"/>
+ <enum name="C4UB_V3F" value="0x2A23"/>
+ <enum name="C3F_V3F" value="0x2A24"/>
+ <enum name="N3F_V3F" value="0x2A25"/>
+ <enum name="C4F_N3F_V3F" value="0x2A26"/>
+ <enum name="T2F_V3F" value="0x2A27"/>
+ <enum name="T4F_V4F" value="0x2A28"/>
+ <enum name="T2F_C4UB_V3F" value="0x2A29"/>
+ <enum name="T2F_C3F_V3F" value="0x2A2A"/>
+ <enum name="T2F_N3F_V3F" value="0x2A2B"/>
+ <enum name="T2F_C4F_N3F_V3F" value="0x2A2C"/>
+ <enum name="T4F_C4F_N3F_V4F" value="0x2A2D"/>
+ <enum name="POLYGON_OFFSET_FILL" value="0x8037"/>
+ <enum name="POLYGON_OFFSET_FACTOR" count="1" value="0x8038">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="POLYGON_OFFSET_BIAS" value="0x8039"/>
+ <enum name="ALPHA4" value="0x803B"/>
+ <enum name="ALPHA8" value="0x803C"/>
+ <enum name="ALPHA12" value="0x803D"/>
+ <enum name="ALPHA16" value="0x803E"/>
+ <enum name="LUMINANCE4" value="0x803F"/>
+ <enum name="LUMINANCE8" value="0x8040"/>
+ <enum name="LUMINANCE12" value="0x8041"/>
+ <enum name="LUMINANCE16" value="0x8042"/>
+ <enum name="LUMINANCE4_ALPHA4" value="0x8043"/>
+ <enum name="LUMINANCE6_ALPHA2" value="0x8044"/>
+ <enum name="LUMINANCE8_ALPHA8" value="0x8045"/>
+ <enum name="LUMINANCE12_ALPHA4" value="0x8046"/>
+ <enum name="LUMINANCE12_ALPHA12" value="0x8047"/>
+ <enum name="LUMINANCE16_ALPHA16" value="0x8048"/>
+ <enum name="INTENSITY" value="0x8049"/>
+ <enum name="INTENSITY4" value="0x804A"/>
+ <enum name="INTENSITY8" value="0x804B"/>
+ <enum name="INTENSITY12" value="0x804C"/>
+ <enum name="INTENSITY16" value="0x804D"/>
+ <enum name="RGB4" value="0x804F"/>
+ <enum name="RGB5" value="0x8050"/>
+ <enum name="RGB8" value="0x8051"/>
+ <enum name="RGB10" value="0x8052"/>
+ <enum name="RGB12" value="0x8053"/>
+ <enum name="RGB16" value="0x8054"/>
+ <enum name="RGBA2" value="0x8055"/>
+ <enum name="RGBA4" value="0x8056"/>
+ <enum name="RGB5_A1" value="0x8057"/>
+ <enum name="RGBA8" value="0x8058"/>
+ <enum name="RGB10_A2" value="0x8059"/>
+ <enum name="RGBA12" value="0x805A"/>
+ <enum name="RGBA16" value="0x805B"/>
+ <enum name="TEXTURE_RED_SIZE" count="1" value="0x805C">
+ <size name="GetTexLevelParameterfv" mode="get"/>
+ <size name="GetTexLevelParameteriv" mode="get"/>
+ </enum>
+ <enum name="TEXTURE_GREEN_SIZE" count="1" value="0x805D">
+ <size name="GetTexLevelParameterfv" mode="get"/>
+ <size name="GetTexLevelParameteriv" mode="get"/>
+ </enum>
+ <enum name="TEXTURE_BLUE_SIZE" count="1" value="0x805E">
+ <size name="GetTexLevelParameterfv" mode="get"/>
+ <size name="GetTexLevelParameteriv" mode="get"/>
+ </enum>
+ <enum name="TEXTURE_ALPHA_SIZE" count="1" value="0x805F">
+ <size name="GetTexLevelParameterfv" mode="get"/>
+ <size name="GetTexLevelParameteriv" mode="get"/>
+ </enum>
+ <enum name="TEXTURE_LUMINANCE_SIZE" count="1" value="0x8060">
+ <size name="GetTexLevelParameterfv" mode="get"/>
+ <size name="GetTexLevelParameteriv" mode="get"/>
+ </enum>
+ <enum name="TEXTURE_INTENSITY_SIZE" count="1" value="0x8061">
+ <size name="GetTexLevelParameterfv" mode="get"/>
+ <size name="GetTexLevelParameteriv" mode="get"/>
+ </enum>
+ <enum name="PROXY_TEXTURE_1D" value="0x8063"/>
+ <enum name="PROXY_TEXTURE_2D" value="0x8064"/>
+ <enum name="TEXTURE_PRIORITY" count="1" value="0x8066">
+ <size name="TexParameterfv" mode="get"/>
+ <size name="TexParameteriv" mode="get"/>
+ <size name="GetTexParameterfv" mode="get"/>
+ <size name="GetTexParameteriv" mode="get"/>
+ </enum>
+ <enum name="TEXTURE_RESIDENT" count="1" value="0x8067">
+ <size name="GetTexParameterfv" mode="get"/>
+ <size name="GetTexParameteriv" mode="get"/>
+ </enum>
+ <enum name="TEXTURE_BINDING_1D" count="1" value="0x8068">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="TEXTURE_BINDING_2D" count="1" value="0x8069">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="VERTEX_ARRAY" count="1" value="0x8074">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="NORMAL_ARRAY" count="1" value="0x8075">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="COLOR_ARRAY" count="1" value="0x8076">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="INDEX_ARRAY" count="1" value="0x8077">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="TEXTURE_COORD_ARRAY" count="1" value="0x8078">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="EDGE_FLAG_ARRAY" count="1" value="0x8079">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="VERTEX_ARRAY_SIZE" count="1" value="0x807A">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="VERTEX_ARRAY_TYPE" count="1" value="0x807B">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="VERTEX_ARRAY_STRIDE" count="1" value="0x807C">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="NORMAL_ARRAY_TYPE" count="1" value="0x807E">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="NORMAL_ARRAY_STRIDE" count="1" value="0x807F">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="COLOR_ARRAY_SIZE" count="1" value="0x8081">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="COLOR_ARRAY_TYPE" count="1" value="0x8082">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="COLOR_ARRAY_STRIDE" count="1" value="0x8083">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="INDEX_ARRAY_TYPE" count="1" value="0x8085">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="INDEX_ARRAY_STRIDE" count="1" value="0x8086">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="TEXTURE_COORD_ARRAY_SIZE" count="1" value="0x8088">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="TEXTURE_COORD_ARRAY_TYPE" count="1" value="0x8089">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="TEXTURE_COORD_ARRAY_STRIDE" count="1" value="0x808A">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="EDGE_FLAG_ARRAY_STRIDE" count="1" value="0x808C">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="VERTEX_ARRAY_POINTER" value="0x808E"/>
+ <enum name="NORMAL_ARRAY_POINTER" value="0x808F"/>
+ <enum name="COLOR_ARRAY_POINTER" value="0x8090"/>
+ <enum name="INDEX_ARRAY_POINTER" value="0x8091"/>
+ <enum name="TEXTURE_COORD_ARRAY_POINTER" value="0x8092"/>
+ <enum name="EDGE_FLAG_ARRAY_POINTER" value="0x8093"/>
+ <enum name="CLIENT_PIXEL_STORE_BIT" value="0x00000001"/>
+ <enum name="CLIENT_VERTEX_ARRAY_BIT" value="0x00000002"/>
+ <enum name="ALL_CLIENT_ATTRIB_BITS" value="0xFFFFFFFF"/>
+ <enum name="CLIENT_ALL_ATTRIB_BITS" value="0xFFFFFFFF"/>
+
+ <function name="ArrayElement" offset="306">
+ <param name="i" type="GLint"/>
+ <glx handcode="true"/>
+ </function>
+
+ <function name="ColorPointer" offset="308">
+ <param name="size" type="GLint"/>
+ <param name="type" type="GLenum"/>
+ <param name="stride" type="GLsizei"/>
+ <param name="pointer" type="const GLvoid *"/>
+ <glx handcode="true"/>
+ </function>
+
+ <function name="DisableClientState" offset="309">
+ <param name="array" type="GLenum"/>
+ <glx handcode="true"/>
+ </function>
+
+ <function name="DrawArrays" offset="310">
+ <param name="mode" type="GLenum"/>
+ <param name="first" type="GLint"/>
+ <param name="count" type="GLsizei"/>
+ <glx rop="193" handcode="true"/>
+ </function>
+
+ <function name="DrawElements" offset="311">
+ <param name="mode" type="GLenum"/>
+ <param name="count" type="GLsizei"/>
+ <param name="type" type="GLenum"/>
+ <param name="indices" type="const GLvoid *"/>
+ <glx handcode="true"/>
+ </function>
+
+ <function name="EdgeFlagPointer" offset="312">
+ <param name="stride" type="GLsizei"/>
+ <param name="pointer" type="const GLvoid *"/>
+ <glx handcode="true"/>
+ </function>
+
+ <function name="EnableClientState" offset="313">
+ <param name="array" type="GLenum"/>
+ <glx handcode="true"/>
+ </function>
+
+ <function name="GetPointerv" offset="329">
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLvoid **" output="true"/>
+ <glx handcode="true"/>
+ </function>
+
+ <function name="IndexPointer" offset="314">
+ <param name="type" type="GLenum"/>
+ <param name="stride" type="GLsizei"/>
+ <param name="pointer" type="const GLvoid *"/>
+ <glx handcode="true"/>
+ </function>
+
+ <function name="InterleavedArrays" offset="317">
+ <param name="format" type="GLenum"/>
+ <param name="stride" type="GLsizei"/>
+ <param name="pointer" type="const GLvoid *"/>
+ <glx handcode="true"/>
+ </function>
+
+ <function name="NormalPointer" offset="318">
+ <param name="type" type="GLenum"/>
+ <param name="stride" type="GLsizei"/>
+ <param name="pointer" type="const GLvoid *"/>
+ <glx handcode="true"/>
+ </function>
+
+ <function name="TexCoordPointer" offset="320">
+ <param name="size" type="GLint"/>
+ <param name="type" type="GLenum"/>
+ <param name="stride" type="GLsizei"/>
+ <param name="pointer" type="const GLvoid *"/>
+ <glx handcode="true"/>
+ </function>
+
+ <function name="VertexPointer" offset="321">
+ <param name="size" type="GLint"/>
+ <param name="type" type="GLenum"/>
+ <param name="stride" type="GLsizei"/>
+ <param name="pointer" type="const GLvoid *"/>
+ <glx handcode="true"/>
+ </function>
+
+ <function name="PolygonOffset" offset="319">
+ <param name="factor" type="GLfloat"/>
+ <param name="units" type="GLfloat"/>
+ <glx rop="192"/>
+ </function>
+
+ <function name="CopyTexImage1D" offset="323">
+ <param name="target" type="GLenum"/>
+ <param name="level" type="GLint"/>
+ <param name="internalformat" type="GLenum"/>
+ <param name="x" type="GLint"/>
+ <param name="y" type="GLint"/>
+ <param name="width" type="GLsizei"/>
+ <param name="border" type="GLint"/>
+ <glx rop="4119"/>
+ </function>
+
+ <function name="CopyTexImage2D" offset="324">
+ <param name="target" type="GLenum"/>
+ <param name="level" type="GLint"/>
+ <param name="internalformat" type="GLenum"/>
+ <param name="x" type="GLint"/>
+ <param name="y" type="GLint"/>
+ <param name="width" type="GLsizei"/>
+ <param name="height" type="GLsizei"/>
+ <param name="border" type="GLint"/>
+ <glx rop="4120"/>
+ </function>
+
+ <function name="CopyTexSubImage1D" offset="325">
+ <param name="target" type="GLenum"/>
+ <param name="level" type="GLint"/>
+ <param name="xoffset" type="GLint"/>
+ <param name="x" type="GLint"/>
+ <param name="y" type="GLint"/>
+ <param name="width" type="GLsizei"/>
+ <glx rop="4121"/>
+ </function>
+
+ <function name="CopyTexSubImage2D" offset="326">
+ <param name="target" type="GLenum"/>
+ <param name="level" type="GLint"/>
+ <param name="xoffset" type="GLint"/>
+ <param name="yoffset" type="GLint"/>
+ <param name="x" type="GLint"/>
+ <param name="y" type="GLint"/>
+ <param name="width" type="GLsizei"/>
+ <param name="height" type="GLsizei"/>
+ <glx rop="4122"/>
+ </function>
+
+ <function name="TexSubImage1D" offset="332">
+ <param name="target" type="GLenum"/>
+ <param name="level" type="GLint"/>
+ <param name="xoffset" type="GLint"/>
+ <param name="width" type="GLsizei"/>
+ <param name="format" type="GLenum"/>
+ <param name="type" type="GLenum"/>
+ <param name="UNUSED" type="GLuint" padding="true"/>
+ <param name="pixels" type="const GLvoid *" img_width="width" img_xoff="xoffset" img_format="format" img_type="type" img_target="target" img_pad_dimensions="true"/>
+ <glx rop="4099" large="true"/>
+ </function>
+
+ <function name="TexSubImage2D" offset="333">
+ <param name="target" type="GLenum"/>
+ <param name="level" type="GLint"/>
+ <param name="xoffset" type="GLint"/>
+ <param name="yoffset" type="GLint"/>
+ <param name="width" type="GLsizei"/>
+ <param name="height" type="GLsizei"/>
+ <param name="format" type="GLenum"/>
+ <param name="type" type="GLenum"/>
+ <param name="UNUSED" type="GLuint" padding="true"/>
+ <param name="pixels" type="const GLvoid *" img_width="width" img_height="height" img_xoff="xoffset" img_yoff="yoffset" img_format="format" img_type="type" img_target="target" img_pad_dimensions="true"/>
+ <glx rop="4100" large="true"/>
+ </function>
+
+ <function name="AreTexturesResident" offset="322">
+ <param name="n" type="GLsizei" counter="true"/>
+ <param name="textures" type="const GLuint *" count="n"/>
+ <param name="residences" type="GLboolean *" output="true" count="n"/>
+ <return type="GLboolean"/>
+ <glx sop="143" handcode="client" always_array="true"/>
+ </function>
+
+ <function name="BindTexture" offset="307">
+ <param name="target" type="GLenum"/>
+ <param name="texture" type="GLuint"/>
+ <glx rop="4117"/>
+ </function>
+
+ <function name="DeleteTextures" offset="327">
+ <param name="n" type="GLsizei" counter="true"/>
+ <param name="textures" type="const GLuint *" count="n"/>
+ <glx sop="144"/>
+ </function>
+
+ <function name="GenTextures" offset="328">
+ <param name="n" type="GLsizei" counter="true"/>
+ <param name="textures" type="GLuint *" output="true" count="n"/>
+ <glx sop="145" always_array="true"/>
+ </function>
+
+ <function name="IsTexture" offset="330">
+ <param name="texture" type="GLuint"/>
+ <return type="GLboolean"/>
+ <glx sop="146"/>
+ </function>
+
+ <function name="PrioritizeTextures" offset="331">
+ <param name="n" type="GLsizei" counter="true"/>
+ <param name="textures" type="const GLuint *" count="n"/>
+ <param name="priorities" type="const GLclampf *" count="n"/>
+ <glx rop="4118"/>
+ </function>
+
+ <function name="Indexub" offset="315" vectorequiv="Indexubv">
+ <param name="c" type="GLubyte"/>
+ </function>
+
+ <function name="Indexubv" offset="316">
+ <param name="c" type="const GLubyte *" count="1"/>
+ <glx rop="194"/>
+ </function>
+
+ <function name="PopClientAttrib" offset="334">
+ <glx handcode="true"/>
+ </function>
+
+ <function name="PushClientAttrib" offset="335">
+ <param name="mask" type="GLbitfield"/>
+ <glx handcode="true"/>
+ </function>
+</category>
+
+<category name="1.2">
+ <enum name="UNSIGNED_BYTE_3_3_2" value="0x8032"/>
+ <enum name="UNSIGNED_SHORT_4_4_4_4" value="0x8033"/>
+ <enum name="UNSIGNED_SHORT_5_5_5_1" value="0x8034"/>
+ <enum name="UNSIGNED_INT_8_8_8_8" value="0x8035"/>
+ <enum name="UNSIGNED_INT_10_10_10_2" value="0x8036"/>
+ <enum name="RESCALE_NORMAL" count="1" value="0x803A">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="TEXTURE_BINDING_3D" count="1" value="0x806A">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="PACK_SKIP_IMAGES" count="1" value="0x806B">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="PACK_IMAGE_HEIGHT" count="1" value="0x806C">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="UNPACK_SKIP_IMAGES" count="1" value="0x806D">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="UNPACK_IMAGE_HEIGHT" count="1" value="0x806E">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="TEXTURE_3D" count="1" value="0x806F">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="PROXY_TEXTURE_3D" value="0x8070"/>
+ <enum name="TEXTURE_DEPTH" count="1" value="0x8071">
+ <size name="GetTexLevelParameterfv" mode="get"/>
+ <size name="GetTexLevelParameteriv" mode="get"/>
+ </enum>
+ <enum name="TEXTURE_WRAP_R" count="1" value="0x8072">
+ <size name="TexParameterfv" mode="get"/>
+ <size name="TexParameteriv" mode="get"/>
+ <size name="GetTexParameterfv" mode="get"/>
+ <size name="GetTexParameteriv" mode="get"/>
+ </enum>
+ <enum name="MAX_3D_TEXTURE_SIZE" count="1" value="0x8073">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="UNSIGNED_BYTE_2_3_3_REV" value="0x8362"/>
+ <enum name="UNSIGNED_SHORT_5_6_5" value="0x8363"/>
+ <enum name="UNSIGNED_SHORT_5_6_5_REV" value="0x8364"/>
+ <enum name="UNSIGNED_SHORT_4_4_4_4_REV" value="0x8365"/>
+ <enum name="UNSIGNED_SHORT_1_5_5_5_REV" value="0x8366"/>
+ <enum name="UNSIGNED_INT_8_8_8_8_REV" value="0x8367"/>
+ <enum name="UNSIGNED_INT_2_10_10_10_REV" value="0x8368"/>
+ <enum name="BGR" value="0x80E0"/>
+ <enum name="BGRA" value="0x80E1"/>
+ <enum name="MAX_ELEMENTS_VERTICES" count="1" value="0x80E8">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="MAX_ELEMENTS_INDICES" count="1" value="0x80E9">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="CLAMP_TO_EDGE" value="0x812F"/>
+ <enum name="TEXTURE_MIN_LOD" count="1" value="0x813A">
+ <size name="TexParameterfv" mode="get"/>
+ <size name="TexParameteriv" mode="get"/>
+ <size name="GetTexParameterfv" mode="get"/>
+ <size name="GetTexParameteriv" mode="get"/>
+ </enum>
+ <enum name="TEXTURE_MAX_LOD" count="1" value="0x813B">
+ <size name="TexParameterfv" mode="get"/>
+ <size name="TexParameteriv" mode="get"/>
+ <size name="GetTexParameterfv" mode="get"/>
+ <size name="GetTexParameteriv" mode="get"/>
+ </enum>
+ <enum name="TEXTURE_BASE_LEVEL" count="1" value="0x813C">
+ <size name="TexParameterfv" mode="get"/>
+ <size name="TexParameteriv" mode="get"/>
+ <size name="GetTexParameterfv" mode="get"/>
+ <size name="GetTexParameteriv" mode="get"/>
+ </enum>
+ <enum name="TEXTURE_MAX_LEVEL" count="1" value="0x813D">
+ <size name="TexParameterfv" mode="get"/>
+ <size name="TexParameteriv" mode="get"/>
+ <size name="GetTexParameterfv" mode="get"/>
+ <size name="GetTexParameteriv" mode="get"/>
+ </enum>
+ <enum name="LIGHT_MODEL_COLOR_CONTROL" count="1" value="0x81F8">
+ <size name="LightModelfv" mode="get"/>
+ <size name="LightModeliv" mode="get"/>
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="SINGLE_COLOR" value="0x81F9"/>
+ <enum name="SEPARATE_SPECULAR_COLOR" value="0x81FA"/>
+ <enum name="SMOOTH_POINT_SIZE_RANGE" count="2" value="0x0B12">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="SMOOTH_POINT_SIZE_GRANULARITY" count="1" value="0x0B13">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="SMOOTH_LINE_WIDTH_RANGE" count="2" value="0x0B22">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="SMOOTH_LINE_WIDTH_GRANULARITY" count="1" value="0x0B23">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="ALIASED_POINT_SIZE_RANGE" count="2" value="0x846D">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="ALIASED_LINE_WIDTH_RANGE" count="2" value="0x846E">
+ <size name="Get" mode="get"/>
+ </enum>
+
+ <!-- These enums are actually part of the ARB_imaging subset. -->
+
+ <enum name="CONSTANT_COLOR" value="0x8001"/>
+ <enum name="ONE_MINUS_CONSTANT_COLOR" value="0x8002"/>
+ <enum name="CONSTANT_ALPHA" value="0x8003"/>
+ <enum name="ONE_MINUS_CONSTANT_ALPHA" value="0x8004"/>
+ <enum name="BLEND_COLOR" count="4" value="0x8005">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="FUNC_ADD" value="0x8006"/>
+ <enum name="MIN" value="0x8007"/>
+ <enum name="MAX" value="0x8008"/>
+ <enum name="BLEND_EQUATION" count="1" value="0x8009">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="FUNC_SUBTRACT" value="0x800A"/>
+ <enum name="FUNC_REVERSE_SUBTRACT" value="0x800B"/>
+ <enum name="CONVOLUTION_1D" count="1" value="0x8010">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="CONVOLUTION_2D" count="1" value="0x8011">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="SEPARABLE_2D" count="1" value="0x8012">
+ <size name="Get" mode="get"/>
+ </enum>
+
+ <enum name="CONVOLUTION_BORDER_MODE" count="1" value="0x8013">
+ <size name="ConvolutionParameterfv" mode="get"/>
+ <size name="ConvolutionParameteriv" mode="get"/>
+ <size name="GetConvolutionParameterfv" mode="get"/>
+ <size name="GetConvolutionParameteriv" mode="get"/>
+ </enum>
+ <enum name="CONVOLUTION_BORDER_COLOR" count="4" value="0x8154">
+ <size name="ConvolutionParameterfv" mode="get"/>
+ <size name="ConvolutionParameteriv" mode="get"/>
+ <size name="GetConvolutionParameterfv" mode="get"/>
+ <size name="GetConvolutionParameteriv" mode="get"/>
+ </enum>
+ <enum name="CONVOLUTION_FILTER_SCALE" count="4" value="0x8014">
+ <size name="ConvolutionParameterfv" mode="get"/>
+ <size name="ConvolutionParameteriv" mode="get"/>
+ <size name="GetConvolutionParameterfv" mode="get"/>
+ <size name="GetConvolutionParameteriv" mode="get"/>
+ </enum>
+ <enum name="CONVOLUTION_FILTER_BIAS" count="4" value="0x8015">
+ <size name="ConvolutionParameterfv" mode="get"/>
+ <size name="ConvolutionParameteriv" mode="get"/>
+ <size name="GetConvolutionParameterfv" mode="get"/>
+ <size name="GetConvolutionParameteriv" mode="get"/>
+ </enum>
+ <enum name="REDUCE" value="0x8016"/>
+ <enum name="CONVOLUTION_FORMAT" count="1" value="0x8017">
+ <size name="GetConvolutionParameterfv" mode="get"/>
+ <size name="GetConvolutionParameteriv" mode="get"/>
+ </enum>
+ <enum name="CONVOLUTION_WIDTH" count="1" value="0x8018">
+ <size name="GetConvolutionParameterfv" mode="get"/>
+ <size name="GetConvolutionParameteriv" mode="get"/>
+ </enum>
+ <enum name="CONVOLUTION_HEIGHT" count="1" value="0x8019">
+ <size name="GetConvolutionParameterfv" mode="get"/>
+ <size name="GetConvolutionParameteriv" mode="get"/>
+ </enum>
+ <enum name="MAX_CONVOLUTION_WIDTH" count="1" value="0x801A">
+ <size name="GetConvolutionParameterfv" mode="get"/>
+ <size name="GetConvolutionParameteriv" mode="get"/>
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="MAX_CONVOLUTION_HEIGHT" count="1" value="0x801B">
+ <size name="GetConvolutionParameterfv" mode="get"/>
+ <size name="GetConvolutionParameteriv" mode="get"/>
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="POST_CONVOLUTION_RED_SCALE" count="1" value="0x801C">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="POST_CONVOLUTION_GREEN_SCALE" count="1" value="0x801D">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="POST_CONVOLUTION_BLUE_SCALE" count="1" value="0x801E">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="POST_CONVOLUTION_ALPHA_SCALE" count="1" value="0x801F">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="POST_CONVOLUTION_RED_BIAS" count="1" value="0x8020">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="POST_CONVOLUTION_GREEN_BIAS" count="1" value="0x8021">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="POST_CONVOLUTION_BLUE_BIAS" count="1" value="0x8022">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="POST_CONVOLUTION_ALPHA_BIAS" count="1" value="0x8023">
+ <size name="Get" mode="get"/>
+ </enum>
+
+ <enum name="HISTOGRAM" count="1" value="0x8024">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="PROXY_HISTOGRAM" value="0x8025"/>
+ <enum name="HISTOGRAM_WIDTH" count="1" value="0x8026">
+ <size name="GetHistogramParameterfv" mode="get"/>
+ <size name="GetHistogramParameteriv" mode="get"/>
+ </enum>
+ <enum name="HISTOGRAM_FORMAT" count="1" value="0x8027">
+ <size name="GetHistogramParameterfv" mode="get"/>
+ <size name="GetHistogramParameteriv" mode="get"/>
+ </enum>
+ <enum name="HISTOGRAM_RED_SIZE" count="1" value="0x8028">
+ <size name="GetHistogramParameterfv" mode="get"/>
+ <size name="GetHistogramParameteriv" mode="get"/>
+ </enum>
+ <enum name="HISTOGRAM_GREEN_SIZE" count="1" value="0x8029">
+ <size name="GetHistogramParameterfv" mode="get"/>
+ <size name="GetHistogramParameteriv" mode="get"/>
+ </enum>
+ <enum name="HISTOGRAM_BLUE_SIZE" count="1" value="0x802A">
+ <size name="GetHistogramParameterfv" mode="get"/>
+ <size name="GetHistogramParameteriv" mode="get"/>
+ </enum>
+ <enum name="HISTOGRAM_ALPHA_SIZE" count="1" value="0x802B">
+ <size name="GetHistogramParameterfv" mode="get"/>
+ <size name="GetHistogramParameteriv" mode="get"/>
+ </enum>
+ <enum name="HISTOGRAM_LUMINANCE_SIZE" count="1" value="0x802C">
+ <size name="GetHistogramParameterfv" mode="get"/>
+ <size name="GetHistogramParameteriv" mode="get"/>
+ </enum>
+ <enum name="HISTOGRAM_SINK" count="1" value="0x802D">
+ <size name="GetHistogramParameterfv" mode="get"/>
+ <size name="GetHistogramParameteriv" mode="get"/>
+ </enum>
+ <enum name="MINMAX" count="1" value="0x802E">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="MINMAX_FORMAT" count="1" value="0x802F">
+ <size name="GetMinmaxParameterfv" mode="get"/>
+ <size name="GetMinmaxParameteriv" mode="get"/>
+ </enum>
+ <enum name="MINMAX_SINK" count="1" value="0x8030">
+ <size name="GetMinmaxParameterfv" mode="get"/>
+ <size name="GetMinmaxParameteriv" mode="get"/>
+ </enum>
+
+ <enum name="COLOR_MATRIX" count="16" value="0x80B1">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="COLOR_MATRIX_STACK_DEPTH" count="1" value="0x80B2">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="MAX_COLOR_MATRIX_STACK_DEPTH" count="1" value="0x80B3">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="POST_COLOR_MATRIX_RED_SCALE" count="1" value="0x80B4">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="POST_COLOR_MATRIX_GREEN_SCALE" count="1" value="0x80B5">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="POST_COLOR_MATRIX_BLUE_SCALE" count="1" value="0x80B6">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="POST_COLOR_MATRIX_ALPHA_SCALE" count="1" value="0x80B7">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="POST_COLOR_MATRIX_RED_BIAS" count="1" value="0x80B8">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="POST_COLOR_MATRIX_GREEN_BIAS" count="1" value="0x80B9">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="POST_COLOR_MATRIX_BLUE_BIAS" count="1" value="0x80BA">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="POST_COLOR_MATRIX_ALPHA_BIAS" count="1" value="0x80BB">
+ <size name="Get" mode="get"/>
+ </enum>
+
+ <enum name="COLOR_TABLE" count="1" value="0x80D0">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="POST_CONVOLUTION_COLOR_TABLE" count="1" value="0x80D1">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="POST_COLOR_MATRIX_COLOR_TABLE" count="1" value="0x80D2">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="PROXY_COLOR_TABLE" value="0x80D3"/>
+ <enum name="PROXY_POST_CONVOLUTION_COLOR_TABLE" value="0x80D4"/>
+ <enum name="PROXY_POST_COLOR_MATRIX_COLOR_TABLE" value="0x80D5"/>
+
+ <enum name="COLOR_TABLE_SCALE" count="4" value="0x80D6">
+ <size name="ColorTableParameterfv" mode="get"/>
+ <size name="ColorTableParameteriv" mode="get"/>
+ <size name="GetColorTableParameterfv" mode="get"/>
+ <size name="GetColorTableParameteriv" mode="get"/>
+ </enum>
+ <enum name="COLOR_TABLE_BIAS" count="4" value="0x80D7">
+ <size name="ColorTableParameterfv" mode="get"/>
+ <size name="ColorTableParameteriv" mode="get"/>
+ <size name="GetColorTableParameterfv" mode="get"/>
+ <size name="GetColorTableParameteriv" mode="get"/>
+ </enum>
+ <enum name="COLOR_TABLE_FORMAT" count="1" value="0x80D8">
+ <size name="GetColorTableParameterfv" mode="get"/>
+ <size name="GetColorTableParameteriv" mode="get"/>
+ </enum>
+ <enum name="COLOR_TABLE_WIDTH" count="1" value="0x80D9">
+ <size name="GetColorTableParameterfv" mode="get"/>
+ <size name="GetColorTableParameteriv" mode="get"/>
+ </enum>
+ <enum name="COLOR_TABLE_RED_SIZE" count="1" value="0x80DA">
+ <size name="GetColorTableParameterfv" mode="get"/>
+ <size name="GetColorTableParameteriv" mode="get"/>
+ </enum>
+ <enum name="COLOR_TABLE_GREEN_SIZE" count="1" value="0x80DB">
+ <size name="GetColorTableParameterfv" mode="get"/>
+ <size name="GetColorTableParameteriv" mode="get"/>
+ </enum>
+ <enum name="COLOR_TABLE_BLUE_SIZE" count="1" value="0x80DC">
+ <size name="GetColorTableParameterfv" mode="get"/>
+ <size name="GetColorTableParameteriv" mode="get"/>
+ </enum>
+ <enum name="COLOR_TABLE_ALPHA_SIZE" count="1" value="0x80DD">
+ <size name="GetColorTableParameterfv" mode="get"/>
+ <size name="GetColorTableParameteriv" mode="get"/>
+ </enum>
+ <enum name="COLOR_TABLE_LUMINANCE_SIZE" count="1" value="0x80DE">
+ <size name="GetColorTableParameterfv" mode="get"/>
+ <size name="GetColorTableParameteriv" mode="get"/>
+ </enum>
+ <enum name="COLOR_TABLE_INTENSITY_SIZE" count="1" value="0x80DF">
+ <size name="GetColorTableParameterfv" mode="get"/>
+ <size name="GetColorTableParameteriv" mode="get"/>
+ </enum>
+
+
+ <function name="BlendColor" offset="336">
+ <param name="red" type="GLclampf"/>
+ <param name="green" type="GLclampf"/>
+ <param name="blue" type="GLclampf"/>
+ <param name="alpha" type="GLclampf"/>
+ <glx rop="4096"/>
+ </function>
+
+ <function name="BlendEquation" offset="337">
+ <param name="mode" type="GLenum"/>
+ <glx rop="4097"/>
+ </function>
+
+ <function name="DrawRangeElements" offset="338">
+ <param name="mode" type="GLenum"/>
+ <param name="start" type="GLuint"/>
+ <param name="end" type="GLuint"/>
+ <param name="count" type="GLsizei"/>
+ <param name="type" type="GLenum"/>
+ <param name="indices" type="const GLvoid *"/>
+ <glx handcode="true"/>
+ </function>
+
+ <function name="ColorTable" offset="339">
+ <param name="target" type="GLenum"/>
+ <param name="internalformat" type="GLenum"/>
+ <param name="width" type="GLsizei"/>
+ <param name="format" type="GLenum"/>
+ <param name="type" type="GLenum"/>
+ <param name="table" type="const GLvoid *" img_width="width" img_pad_dimensions="false" img_format="format" img_type="type" img_target="target"/>
+ <glx rop="2053" large="true"/>
+ </function>
+
+ <function name="ColorTableParameterfv" offset="340">
+ <param name="target" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="const GLfloat *" variable_param="pname"/>
+ <glx rop="2054"/>
+ </function>
+
+ <function name="ColorTableParameteriv" offset="341">
+ <param name="target" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="const GLint *" variable_param="pname"/>
+ <glx rop="2055"/>
+ </function>
+
+ <function name="CopyColorTable" offset="342">
+ <param name="target" type="GLenum"/>
+ <param name="internalformat" type="GLenum"/>
+ <param name="x" type="GLint"/>
+ <param name="y" type="GLint"/>
+ <param name="width" type="GLsizei"/>
+ <glx rop="2056"/>
+ </function>
+
+ <function name="GetColorTable" offset="343">
+ <param name="target" type="GLenum"/>
+ <param name="format" type="GLenum"/>
+ <param name="type" type="GLenum"/>
+ <param name="table" type="GLvoid *" output="true" img_width="width" img_format="format" img_type="type"/>
+ <glx sop="147" dimensions_in_reply="true"/>
+ </function>
+
+ <function name="GetColorTableParameterfv" offset="344">
+ <param name="target" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLfloat *" output="true" variable_param="pname"/>
+ <glx sop="148"/>
+ </function>
+
+ <function name="GetColorTableParameteriv" offset="345">
+ <param name="target" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLint *" output="true" variable_param="pname"/>
+ <glx sop="149"/>
+ </function>
+
+ <function name="ColorSubTable" offset="346">
+ <param name="target" type="GLenum"/>
+ <param name="start" type="GLsizei"/>
+ <param name="count" type="GLsizei"/>
+ <param name="format" type="GLenum"/>
+ <param name="type" type="GLenum"/>
+ <param name="data" type="const GLvoid *" img_width="count" img_pad_dimensions="false" img_format="format" img_type="type" img_target="target"/>
+ <glx rop="195" large="true"/>
+ </function>
+
+ <function name="CopyColorSubTable" offset="347">
+ <param name="target" type="GLenum"/>
+ <param name="start" type="GLsizei"/>
+ <param name="x" type="GLint"/>
+ <param name="y" type="GLint"/>
+ <param name="width" type="GLsizei"/>
+ <glx rop="196"/>
+ </function>
+
+ <function name="ConvolutionFilter1D" offset="348">
+ <param name="target" type="GLenum"/>
+ <param name="internalformat" type="GLenum"/>
+ <param name="width" type="GLsizei"/>
+ <param name="format" type="GLenum"/>
+ <param name="type" type="GLenum"/>
+ <param name="image" type="const GLvoid *" img_width="width" img_format="format" img_type="type" img_target="target" img_pad_dimensions="true"/>
+ <glx rop="4101" large="true"/>
+ </function>
+
+ <function name="ConvolutionFilter2D" offset="349">
+ <param name="target" type="GLenum"/>
+ <param name="internalformat" type="GLenum"/>
+ <param name="width" type="GLsizei"/>
+ <param name="height" type="GLsizei"/>
+ <param name="format" type="GLenum"/>
+ <param name="type" type="GLenum"/>
+ <param name="image" type="const GLvoid *" img_width="width" img_height="height" img_format="format" img_type="type" img_target="target" img_pad_dimensions="true"/>
+ <glx rop="4102" large="true"/>
+ </function>
+
+ <function name="ConvolutionParameterf" offset="350">
+ <param name="target" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLfloat"/>
+ <glx rop="4103"/>
+ </function>
+
+ <function name="ConvolutionParameterfv" offset="351">
+ <param name="target" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="const GLfloat *" variable_param="pname"/>
+ <glx rop="4104"/>
+ </function>
+
+ <function name="ConvolutionParameteri" offset="352">
+ <param name="target" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLint"/>
+ <glx rop="4105"/>
+ </function>
+
+ <function name="ConvolutionParameteriv" offset="353">
+ <param name="target" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="const GLint *" variable_param="pname"/>
+ <glx rop="4106"/>
+ </function>
+
+ <function name="CopyConvolutionFilter1D" offset="354">
+ <param name="target" type="GLenum"/>
+ <param name="internalformat" type="GLenum"/>
+ <param name="x" type="GLint"/>
+ <param name="y" type="GLint"/>
+ <param name="width" type="GLsizei"/>
+ <glx rop="4107"/>
+ </function>
+
+ <function name="CopyConvolutionFilter2D" offset="355">
+ <param name="target" type="GLenum"/>
+ <param name="internalformat" type="GLenum"/>
+ <param name="x" type="GLint"/>
+ <param name="y" type="GLint"/>
+ <param name="width" type="GLsizei"/>
+ <param name="height" type="GLsizei"/>
+ <glx rop="4108"/>
+ </function>
+
+ <function name="GetConvolutionFilter" offset="356">
+ <param name="target" type="GLenum"/>
+ <param name="format" type="GLenum"/>
+ <param name="type" type="GLenum"/>
+ <param name="image" type="GLvoid *" output="true" img_width="width" img_height="height" img_format="format" img_type="type"/>
+ <glx sop="150" dimensions_in_reply="true"/>
+ </function>
+
+ <function name="GetConvolutionParameterfv" offset="357">
+ <param name="target" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLfloat *" output="true" variable_param="pname"/>
+ <glx sop="151"/>
+ </function>
+
+ <function name="GetConvolutionParameteriv" offset="358">
+ <param name="target" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLint *" output="true" variable_param="pname"/>
+ <glx sop="152"/>
+ </function>
+
+ <function name="GetSeparableFilter" offset="359">
+ <param name="target" type="GLenum"/>
+ <param name="format" type="GLenum"/>
+ <param name="type" type="GLenum"/>
+ <param name="row" type="GLvoid *" output="true"/>
+ <param name="column" type="GLvoid *" output="true"/>
+ <param name="span" type="GLvoid *" output="true"/>
+ <glx sop="153" handcode="true"/>
+ </function>
+
+ <function name="SeparableFilter2D" offset="360">
+ <param name="target" type="GLenum"/>
+ <param name="internalformat" type="GLenum"/>
+ <param name="width" type="GLsizei"/>
+ <param name="height" type="GLsizei"/>
+ <param name="format" type="GLenum"/>
+ <param name="type" type="GLenum"/>
+ <param name="row" type="const GLvoid *"/>
+ <param name="column" type="const GLvoid *"/>
+ <glx rop="4109" handcode="true"/>
+ </function>
+
+ <function name="GetHistogram" offset="361">
+ <param name="target" type="GLenum"/>
+ <param name="reset" type="GLboolean"/>
+ <param name="format" type="GLenum"/>
+ <param name="type" type="GLenum"/>
+ <param name="values" type="GLvoid *" output="true" img_width="width" img_format="format" img_type="type"/>
+ <glx sop="154" dimensions_in_reply="true" img_reset="reset"/>
+ </function>
+
+ <function name="GetHistogramParameterfv" offset="362">
+ <param name="target" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLfloat *" output="true" variable_param="pname"/>
+ <glx sop="155"/>
+ </function>
+
+ <function name="GetHistogramParameteriv" offset="363">
+ <param name="target" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLint *" output="true" variable_param="pname"/>
+ <glx sop="156"/>
+ </function>
+
+ <function name="GetMinmax" offset="364">
+ <param name="target" type="GLenum"/>
+ <param name="reset" type="GLboolean"/>
+ <param name="format" type="GLenum"/>
+ <param name="type" type="GLenum"/>
+ <param name="values" type="GLvoid *" output="true" img_width="2" img_format="format" img_type="type"/>
+ <glx sop="157" img_reset="reset"/>
+ </function>
+
+ <function name="GetMinmaxParameterfv" offset="365">
+ <param name="target" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLfloat *" output="true" variable_param="pname"/>
+ <glx sop="158"/>
+ </function>
+
+ <function name="GetMinmaxParameteriv" offset="366">
+ <param name="target" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLint *" output="true" variable_param="pname"/>
+ <glx sop="159"/>
+ </function>
+
+ <function name="Histogram" offset="367">
+ <param name="target" type="GLenum"/>
+ <param name="width" type="GLsizei"/>
+ <param name="internalformat" type="GLenum"/>
+ <param name="sink" type="GLboolean"/>
+ <glx rop="4110"/>
+ </function>
+
+ <function name="Minmax" offset="368">
+ <param name="target" type="GLenum"/>
+ <param name="internalformat" type="GLenum"/>
+ <param name="sink" type="GLboolean"/>
+ <glx rop="4111"/>
+ </function>
+
+ <function name="ResetHistogram" offset="369">
+ <param name="target" type="GLenum"/>
+ <glx rop="4112"/>
+ </function>
+
+ <function name="ResetMinmax" offset="370">
+ <param name="target" type="GLenum"/>
+ <glx rop="4113"/>
+ </function>
+
+ <function name="TexImage3D" offset="371">
+ <param name="target" type="GLenum"/>
+ <param name="level" type="GLint"/>
+ <param name="internalformat" type="GLint"/>
+ <param name="width" type="GLsizei"/>
+ <param name="height" type="GLsizei"/>
+ <param name="depth" type="GLsizei"/>
+ <param name="border" type="GLint"/>
+ <param name="format" type="GLenum"/>
+ <param name="type" type="GLenum"/>
+ <param name="pixels" type="const GLvoid *" img_width="width" img_height="height" img_depth="depth" img_format="format" img_type="type" img_target="target" img_null_flag="true" img_pad_dimensions="true"/>
+ <glx rop="4114" large="true"/>
+ </function>
+
+ <function name="TexSubImage3D" offset="372">
+ <param name="target" type="GLenum"/>
+ <param name="level" type="GLint"/>
+ <param name="xoffset" type="GLint"/>
+ <param name="yoffset" type="GLint"/>
+ <param name="zoffset" type="GLint"/>
+ <param name="width" type="GLsizei"/>
+ <param name="height" type="GLsizei"/>
+ <param name="depth" type="GLsizei"/>
+ <param name="format" type="GLenum"/>
+ <param name="type" type="GLenum"/>
+ <param name="UNUSED" type="GLuint" padding="true"/>
+ <param name="pixels" type="const GLvoid *" img_width="width" img_height="height" img_depth="depth" img_xoff="xoffset" img_yoff="yoffset" img_zoff="zoffset" img_format="format" img_type="type" img_target="target" img_pad_dimensions="true"/>
+ <glx rop="4115" large="true"/>
+ </function>
+
+ <function name="CopyTexSubImage3D" offset="373">
+ <param name="target" type="GLenum"/>
+ <param name="level" type="GLint"/>
+ <param name="xoffset" type="GLint"/>
+ <param name="yoffset" type="GLint"/>
+ <param name="zoffset" type="GLint"/>
+ <param name="x" type="GLint"/>
+ <param name="y" type="GLint"/>
+ <param name="width" type="GLsizei"/>
+ <param name="height" type="GLsizei"/>
+ <glx rop="4123"/>
+ </function>
+</category>
+
+<category name="1.3">
+ <enum name="TEXTURE0" value="0x84C0"/>
+ <enum name="TEXTURE1" value="0x84C1"/>
+ <enum name="TEXTURE2" value="0x84C2"/>
+ <enum name="TEXTURE3" value="0x84C3"/>
+ <enum name="TEXTURE4" value="0x84C4"/>
+ <enum name="TEXTURE5" value="0x84C5"/>
+ <enum name="TEXTURE6" value="0x84C6"/>
+ <enum name="TEXTURE7" value="0x84C7"/>
+ <enum name="TEXTURE8" value="0x84C8"/>
+ <enum name="TEXTURE9" value="0x84C9"/>
+ <enum name="TEXTURE10" value="0x84CA"/>
+ <enum name="TEXTURE11" value="0x84CB"/>
+ <enum name="TEXTURE12" value="0x84CC"/>
+ <enum name="TEXTURE13" value="0x84CD"/>
+ <enum name="TEXTURE14" value="0x84CE"/>
+ <enum name="TEXTURE15" value="0x84CF"/>
+ <enum name="TEXTURE16" value="0x84D0"/>
+ <enum name="TEXTURE17" value="0x84D1"/>
+ <enum name="TEXTURE18" value="0x84D2"/>
+ <enum name="TEXTURE19" value="0x84D3"/>
+ <enum name="TEXTURE20" value="0x84D4"/>
+ <enum name="TEXTURE21" value="0x84D5"/>
+ <enum name="TEXTURE22" value="0x84D6"/>
+ <enum name="TEXTURE23" value="0x84D7"/>
+ <enum name="TEXTURE24" value="0x84D8"/>
+ <enum name="TEXTURE25" value="0x84D9"/>
+ <enum name="TEXTURE26" value="0x84DA"/>
+ <enum name="TEXTURE27" value="0x84DB"/>
+ <enum name="TEXTURE28" value="0x84DC"/>
+ <enum name="TEXTURE29" value="0x84DD"/>
+ <enum name="TEXTURE30" value="0x84DE"/>
+ <enum name="TEXTURE31" value="0x84DF"/>
+ <enum name="ACTIVE_TEXTURE" count="1" value="0x84E0">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="CLIENT_ACTIVE_TEXTURE" count="1" value="0x84E1">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="MAX_TEXTURE_UNITS" count="1" value="0x84E2">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="TRANSPOSE_MODELVIEW_MATRIX" value="0x84E3"/>
+ <enum name="TRANSPOSE_PROJECTION_MATRIX" value="0x84E4"/>
+ <enum name="TRANSPOSE_TEXTURE_MATRIX" value="0x84E5"/>
+ <enum name="TRANSPOSE_COLOR_MATRIX" value="0x84E6"/>
+ <enum name="MULTISAMPLE" count="1" value="0x809D">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="SAMPLE_ALPHA_TO_COVERAGE" count="1" value="0x809E">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="SAMPLE_ALPHA_TO_ONE" count="1" value="0x809F">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="SAMPLE_COVERAGE" count="1" value="0x80A0">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="SAMPLE_BUFFERS" count="1" value="0x80A8">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="SAMPLES" count="1" value="0x80A9">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="SAMPLE_COVERAGE_VALUE" count="1" value="0x80AA">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="SAMPLE_COVERAGE_INVERT" count="1" value="0x80AB">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="MULTISAMPLE_BIT" value="0x20000000"/>
+ <enum name="NORMAL_MAP" value="0x8511"/>
+ <enum name="REFLECTION_MAP" value="0x8512"/>
+ <enum name="TEXTURE_CUBE_MAP" count="1" value="0x8513">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="TEXTURE_BINDING_CUBE_MAP" count="1" value="0x8514">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="TEXTURE_CUBE_MAP_POSITIVE_X" value="0x8515"/>
+ <enum name="TEXTURE_CUBE_MAP_NEGATIVE_X" value="0x8516"/>
+ <enum name="TEXTURE_CUBE_MAP_POSITIVE_Y" value="0x8517"/>
+ <enum name="TEXTURE_CUBE_MAP_NEGATIVE_Y" value="0x8518"/>
+ <enum name="TEXTURE_CUBE_MAP_POSITIVE_Z" value="0x8519"/>
+ <enum name="TEXTURE_CUBE_MAP_NEGATIVE_Z" value="0x851A"/>
+ <enum name="PROXY_TEXTURE_CUBE_MAP" value="0x851B"/>
+ <enum name="MAX_CUBE_MAP_TEXTURE_SIZE" count="1" value="0x851C">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="COMPRESSED_ALPHA" value="0x84E9"/>
+ <enum name="COMPRESSED_LUMINANCE" value="0x84EA"/>
+ <enum name="COMPRESSED_LUMINANCE_ALPHA" value="0x84EB"/>
+ <enum name="COMPRESSED_INTENSITY" value="0x84EC"/>
+ <enum name="COMPRESSED_RGB" value="0x84ED"/>
+ <enum name="COMPRESSED_RGBA" value="0x84EE"/>
+ <enum name="TEXTURE_COMPRESSION_HINT" count="1" value="0x84EF">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="TEXTURE_COMPRESSED_IMAGE_SIZE" count="1" value="0x86A0">
+ <size name="GetTexLevelParameterfv" mode="get"/>
+ <size name="GetTexLevelParameteriv" mode="get"/>
+ </enum>
+ <enum name="TEXTURE_COMPRESSED" count="1" value="0x86A1">
+ <size name="GetTexLevelParameterfv" mode="get"/>
+ <size name="GetTexLevelParameteriv" mode="get"/>
+ </enum>
+ <enum name="NUM_COMPRESSED_TEXTURE_FORMATS" count="1" value="0x86A2">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="COMPRESSED_TEXTURE_FORMATS" count="-1" value="0x86A3">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="CLAMP_TO_BORDER" value="0x812D"/>
+ <enum name="COMBINE" value="0x8570"/>
+ <enum name="COMBINE_RGB" count="1" value="0x8571">
+ <size name="TexEnvfv" mode="get"/>
+ <size name="TexEnviv" mode="get"/>
+ <size name="GetTexEnvfv" mode="get"/>
+ <size name="GetTexEnviv" mode="get"/>
+ </enum>
+ <enum name="COMBINE_ALPHA" count="1" value="0x8572">
+ <size name="TexEnvfv" mode="get"/>
+ <size name="TexEnviv" mode="get"/>
+ <size name="GetTexEnvfv" mode="get"/>
+ <size name="GetTexEnviv" mode="get"/>
+ </enum>
+ <enum name="SOURCE0_RGB" count="1" value="0x8580">
+ <size name="TexEnvfv" mode="get"/>
+ <size name="TexEnviv" mode="get"/>
+ <size name="GetTexEnvfv" mode="get"/>
+ <size name="GetTexEnviv" mode="get"/>
+ </enum>
+ <enum name="SOURCE1_RGB" count="1" value="0x8581">
+ <size name="TexEnvfv" mode="get"/>
+ <size name="TexEnviv" mode="get"/>
+ <size name="GetTexEnvfv" mode="get"/>
+ <size name="GetTexEnviv" mode="get"/>
+ </enum>
+ <enum name="SOURCE2_RGB" count="1" value="0x8582">
+ <size name="TexEnvfv" mode="get"/>
+ <size name="TexEnviv" mode="get"/>
+ <size name="GetTexEnvfv" mode="get"/>
+ <size name="GetTexEnviv" mode="get"/>
+ </enum>
+ <enum name="SOURCE0_ALPHA" count="1" value="0x8588">
+ <size name="TexEnvfv" mode="get"/>
+ <size name="TexEnviv" mode="get"/>
+ <size name="GetTexEnvfv" mode="get"/>
+ <size name="GetTexEnviv" mode="get"/>
+ </enum>
+ <enum name="SOURCE1_ALPHA" count="1" value="0x8589">
+ <size name="TexEnvfv" mode="get"/>
+ <size name="TexEnviv" mode="get"/>
+ <size name="GetTexEnvfv" mode="get"/>
+ <size name="GetTexEnviv" mode="get"/>
+ </enum>
+ <enum name="SOURCE2_ALPHA" count="1" value="0x858A">
+ <size name="TexEnvfv" mode="get"/>
+ <size name="TexEnviv" mode="get"/>
+ <size name="GetTexEnvfv" mode="get"/>
+ <size name="GetTexEnviv" mode="get"/>
+ </enum>
+ <enum name="OPERAND0_RGB" count="1" value="0x8590">
+ <size name="TexEnvfv" mode="get"/>
+ <size name="TexEnviv" mode="get"/>
+ <size name="GetTexEnvfv" mode="get"/>
+ <size name="GetTexEnviv" mode="get"/>
+ </enum>
+ <enum name="OPERAND1_RGB" count="1" value="0x8591">
+ <size name="TexEnvfv" mode="get"/>
+ <size name="TexEnviv" mode="get"/>
+ <size name="GetTexEnvfv" mode="get"/>
+ <size name="GetTexEnviv" mode="get"/>
+ </enum>
+ <enum name="OPERAND2_RGB" count="1" value="0x8592">
+ <size name="TexEnvfv" mode="get"/>
+ <size name="TexEnviv" mode="get"/>
+ <size name="GetTexEnvfv" mode="get"/>
+ <size name="GetTexEnviv" mode="get"/>
+ </enum>
+ <enum name="OPERAND0_ALPHA" count="1" value="0x8598">
+ <size name="TexEnvfv" mode="get"/>
+ <size name="TexEnviv" mode="get"/>
+ <size name="GetTexEnvfv" mode="get"/>
+ <size name="GetTexEnviv" mode="get"/>
+ </enum>
+ <enum name="OPERAND1_ALPHA" count="1" value="0x8599">
+ <size name="TexEnvfv" mode="get"/>
+ <size name="TexEnviv" mode="get"/>
+ <size name="GetTexEnvfv" mode="get"/>
+ <size name="GetTexEnviv" mode="get"/>
+ </enum>
+ <enum name="OPERAND2_ALPHA" count="1" value="0x859A">
+ <size name="TexEnvfv" mode="get"/>
+ <size name="TexEnviv" mode="get"/>
+ <size name="GetTexEnvfv" mode="get"/>
+ <size name="GetTexEnviv" mode="get"/>
+ </enum>
+ <enum name="RGB_SCALE" count="1" value="0x8573">
+ <size name="TexEnvfv" mode="get"/>
+ <size name="TexEnviv" mode="get"/>
+ <size name="GetTexEnvfv" mode="get"/>
+ <size name="GetTexEnviv" mode="get"/>
+ </enum>
+ <enum name="ADD_SIGNED" value="0x8574"/>
+ <enum name="INTERPOLATE" value="0x8575"/>
+ <enum name="SUBTRACT" value="0x84E7"/>
+ <enum name="CONSTANT" value="0x8576"/>
+ <enum name="PRIMARY_COLOR" value="0x8577"/>
+ <enum name="PREVIOUS" value="0x8578"/>
+ <enum name="DOT3_RGB" value="0x86AE"/>
+ <enum name="DOT3_RGBA" value="0x86AF"/>
+
+ <function name="ActiveTexture" alias="ActiveTextureARB">
+ <param name="texture" type="GLenum"/>
+ </function>
+
+ <function name="ClientActiveTexture" alias="ClientActiveTextureARB">
+ <param name="texture" type="GLenum"/>
+ </function>
+
+ <function name="MultiTexCoord1d" alias="MultiTexCoord1dARB">
+ <param name="target" type="GLenum"/>
+ <param name="s" type="GLdouble"/>
+ </function>
+
+ <function name="MultiTexCoord1dv" alias="MultiTexCoord1dvARB">
+ <param name="target" type="GLenum"/>
+ <param name="v" type="const GLdouble *"/>
+ </function>
+
+ <function name="MultiTexCoord1f" alias="MultiTexCoord1fARB">
+ <param name="target" type="GLenum"/>
+ <param name="s" type="GLfloat"/>
+ </function>
+
+ <function name="MultiTexCoord1fv" alias="MultiTexCoord1fvARB">
+ <param name="target" type="GLenum"/>
+ <param name="v" type="const GLfloat *"/>
+ </function>
+
+ <function name="MultiTexCoord1i" alias="MultiTexCoord1iARB">
+ <param name="target" type="GLenum"/>
+ <param name="s" type="GLint"/>
+ </function>
+
+ <function name="MultiTexCoord1iv" alias="MultiTexCoord1ivARB">
+ <param name="target" type="GLenum"/>
+ <param name="v" type="const GLint *"/>
+ </function>
+
+ <function name="MultiTexCoord1s" alias="MultiTexCoord1sARB">
+ <param name="target" type="GLenum"/>
+ <param name="s" type="GLshort"/>
+ </function>
+
+ <function name="MultiTexCoord1sv" alias="MultiTexCoord1svARB">
+ <param name="target" type="GLenum"/>
+ <param name="v" type="const GLshort *"/>
+ </function>
+
+ <function name="MultiTexCoord2d" alias="MultiTexCoord2dARB">
+ <param name="target" type="GLenum"/>
+ <param name="s" type="GLdouble"/>
+ <param name="t" type="GLdouble"/>
+ </function>
+
+ <function name="MultiTexCoord2dv" alias="MultiTexCoord2dvARB">
+ <param name="target" type="GLenum"/>
+ <param name="v" type="const GLdouble *"/>
+ </function>
+
+ <function name="MultiTexCoord2f" alias="MultiTexCoord2fARB">
+ <param name="target" type="GLenum"/>
+ <param name="s" type="GLfloat"/>
+ <param name="t" type="GLfloat"/>
+ </function>
+
+ <function name="MultiTexCoord2fv" alias="MultiTexCoord2fvARB">
+ <param name="target" type="GLenum"/>
+ <param name="v" type="const GLfloat *"/>
+ </function>
+
+ <function name="MultiTexCoord2i" alias="MultiTexCoord2iARB">
+ <param name="target" type="GLenum"/>
+ <param name="s" type="GLint"/>
+ <param name="t" type="GLint"/>
+ </function>
+
+ <function name="MultiTexCoord2iv" alias="MultiTexCoord2ivARB">
+ <param name="target" type="GLenum"/>
+ <param name="v" type="const GLint *"/>
+ </function>
+
+ <function name="MultiTexCoord2s" alias="MultiTexCoord2sARB">
+ <param name="target" type="GLenum"/>
+ <param name="s" type="GLshort"/>
+ <param name="t" type="GLshort"/>
+ </function>
+
+ <function name="MultiTexCoord2sv" alias="MultiTexCoord2svARB">
+ <param name="target" type="GLenum"/>
+ <param name="v" type="const GLshort *"/>
+ </function>
+
+ <function name="MultiTexCoord3d" alias="MultiTexCoord3dARB">
+ <param name="target" type="GLenum"/>
+ <param name="s" type="GLdouble"/>
+ <param name="t" type="GLdouble"/>
+ <param name="r" type="GLdouble"/>
+ </function>
+
+ <function name="MultiTexCoord3dv" alias="MultiTexCoord3dvARB">
+ <param name="target" type="GLenum"/>
+ <param name="v" type="const GLdouble *"/>
+ </function>
+
+ <function name="MultiTexCoord3f" alias="MultiTexCoord3fARB">
+ <param name="target" type="GLenum"/>
+ <param name="s" type="GLfloat"/>
+ <param name="t" type="GLfloat"/>
+ <param name="r" type="GLfloat"/>
+ </function>
+
+ <function name="MultiTexCoord3fv" alias="MultiTexCoord3fvARB">
+ <param name="target" type="GLenum"/>
+ <param name="v" type="const GLfloat *"/>
+ </function>
+
+ <function name="MultiTexCoord3i" alias="MultiTexCoord3iARB">
+ <param name="target" type="GLenum"/>
+ <param name="s" type="GLint"/>
+ <param name="t" type="GLint"/>
+ <param name="r" type="GLint"/>
+ </function>
+
+ <function name="MultiTexCoord3iv" alias="MultiTexCoord3ivARB">
+ <param name="target" type="GLenum"/>
+ <param name="v" type="const GLint *"/>
+ </function>
+
+ <function name="MultiTexCoord3s" alias="MultiTexCoord3sARB">
+ <param name="target" type="GLenum"/>
+ <param name="s" type="GLshort"/>
+ <param name="t" type="GLshort"/>
+ <param name="r" type="GLshort"/>
+ </function>
+
+ <function name="MultiTexCoord3sv" alias="MultiTexCoord3svARB">
+ <param name="target" type="GLenum"/>
+ <param name="v" type="const GLshort *"/>
+ </function>
+
+ <function name="MultiTexCoord4d" alias="MultiTexCoord4dARB">
+ <param name="target" type="GLenum"/>
+ <param name="s" type="GLdouble"/>
+ <param name="t" type="GLdouble"/>
+ <param name="r" type="GLdouble"/>
+ <param name="q" type="GLdouble"/>
+ </function>
+
+ <function name="MultiTexCoord4dv" alias="MultiTexCoord4dvARB">
+ <param name="target" type="GLenum"/>
+ <param name="v" type="const GLdouble *"/>
+ </function>
+
+ <function name="MultiTexCoord4f" alias="MultiTexCoord4fARB">
+ <param name="target" type="GLenum"/>
+ <param name="s" type="GLfloat"/>
+ <param name="t" type="GLfloat"/>
+ <param name="r" type="GLfloat"/>
+ <param name="q" type="GLfloat"/>
+ </function>
+
+ <function name="MultiTexCoord4fv" alias="MultiTexCoord4fvARB">
+ <param name="target" type="GLenum"/>
+ <param name="v" type="const GLfloat *"/>
+ </function>
+
+ <function name="MultiTexCoord4i" alias="MultiTexCoord4iARB">
+ <param name="target" type="GLenum"/>
+ <param name="s" type="GLint"/>
+ <param name="t" type="GLint"/>
+ <param name="r" type="GLint"/>
+ <param name="q" type="GLint"/>
+ </function>
+
+ <function name="MultiTexCoord4iv" alias="MultiTexCoord4ivARB">
+ <param name="target" type="GLenum"/>
+ <param name="v" type="const GLint *"/>
+ </function>
+
+ <function name="MultiTexCoord4s" alias="MultiTexCoord4sARB">
+ <param name="target" type="GLenum"/>
+ <param name="s" type="GLshort"/>
+ <param name="t" type="GLshort"/>
+ <param name="r" type="GLshort"/>
+ <param name="q" type="GLshort"/>
+ </function>
+
+ <function name="MultiTexCoord4sv" alias="MultiTexCoord4svARB">
+ <param name="target" type="GLenum"/>
+ <param name="v" type="const GLshort *"/>
+ </function>
+
+ <function name="LoadTransposeMatrixf" alias="LoadTransposeMatrixfARB">
+ <param name="m" type="const GLfloat *"/>
+ </function>
+
+ <function name="LoadTransposeMatrixd" alias="LoadTransposeMatrixdARB">
+ <param name="m" type="const GLdouble *"/>
+ </function>
+
+ <function name="MultTransposeMatrixf" alias="MultTransposeMatrixfARB">
+ <param name="m" type="const GLfloat *"/>
+ </function>
+
+ <function name="MultTransposeMatrixd" alias="MultTransposeMatrixdARB">
+ <param name="m" type="const GLdouble *"/>
+ </function>
+
+ <function name="SampleCoverage" alias="SampleCoverageARB">
+ <param name="value" type="GLclampf"/>
+ <param name="invert" type="GLboolean"/>
+ </function>
+
+ <function name="CompressedTexImage3D" alias="CompressedTexImage3DARB">
+ <param name="target" type="GLenum"/>
+ <param name="level" type="GLint"/>
+ <param name="internalformat" type="GLenum"/>
+ <param name="width" type="GLsizei"/>
+ <param name="height" type="GLsizei"/>
+ <param name="depth" type="GLsizei"/>
+ <param name="border" type="GLint"/>
+ <param name="imageSize" type="GLsizei"/>
+ <param name="data" type="const GLvoid *"/>
+ </function>
+
+ <function name="CompressedTexImage2D" alias="CompressedTexImage2DARB">
+ <param name="target" type="GLenum"/>
+ <param name="level" type="GLint"/>
+ <param name="internalformat" type="GLenum"/>
+ <param name="width" type="GLsizei"/>
+ <param name="height" type="GLsizei"/>
+ <param name="border" type="GLint"/>
+ <param name="imageSize" type="GLsizei"/>
+ <param name="data" type="const GLvoid *"/>
+ </function>
+
+ <function name="CompressedTexImage1D" alias="CompressedTexImage1DARB">
+ <param name="target" type="GLenum"/>
+ <param name="level" type="GLint"/>
+ <param name="internalformat" type="GLenum"/>
+ <param name="width" type="GLsizei"/>
+ <param name="border" type="GLint"/>
+ <param name="imageSize" type="GLsizei"/>
+ <param name="data" type="const GLvoid *"/>
+ </function>
+
+ <function name="CompressedTexSubImage3D" alias="CompressedTexSubImage3DARB">
+ <param name="target" type="GLenum"/>
+ <param name="level" type="GLint"/>
+ <param name="xoffset" type="GLint"/>
+ <param name="yoffset" type="GLint"/>
+ <param name="zoffset" type="GLint"/>
+ <param name="width" type="GLsizei"/>
+ <param name="height" type="GLsizei"/>
+ <param name="depth" type="GLsizei"/>
+ <param name="format" type="GLenum"/>
+ <param name="imageSize" type="GLsizei"/>
+ <param name="data" type="const GLvoid *"/>
+ </function>
+
+ <function name="CompressedTexSubImage2D" alias="CompressedTexSubImage2DARB">
+ <param name="target" type="GLenum"/>
+ <param name="level" type="GLint"/>
+ <param name="xoffset" type="GLint"/>
+ <param name="yoffset" type="GLint"/>
+ <param name="width" type="GLsizei"/>
+ <param name="height" type="GLsizei"/>
+ <param name="format" type="GLenum"/>
+ <param name="imageSize" type="GLsizei"/>
+ <param name="data" type="const GLvoid *"/>
+ </function>
+
+ <function name="CompressedTexSubImage1D" alias="CompressedTexSubImage1DARB">
+ <param name="target" type="GLenum"/>
+ <param name="level" type="GLint"/>
+ <param name="xoffset" type="GLint"/>
+ <param name="width" type="GLsizei"/>
+ <param name="format" type="GLenum"/>
+ <param name="imageSize" type="GLsizei"/>
+ <param name="data" type="const GLvoid *"/>
+ </function>
+
+ <function name="GetCompressedTexImage" alias="GetCompressedTexImageARB">
+ <param name="target" type="GLenum"/>
+ <param name="level" type="GLint"/>
+ <param name="img" type="GLvoid *" output="true"/>
+ </function>
+</category>
+
+<category name="1.4">
+ <enum name="BLEND_DST_RGB" count="1" value="0x80C8">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="BLEND_SRC_RGB" count="1" value="0x80C9">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="BLEND_DST_ALPHA" count="1" value="0x80CA">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="BLEND_SRC_ALPHA" count="1" value="0x80CB">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="POINT_SIZE_MIN" count="1" value="0x8126">
+ <size name="PointParameterfvEXT" mode="get"/>
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="POINT_SIZE_MAX" count="1" value="0x8127">
+ <size name="PointParameterfvEXT" mode="get"/>
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="POINT_FADE_THRESHOLD_SIZE" count="1" value="0x8128">
+ <size name="PointParameterfvEXT" mode="get"/>
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="POINT_DISTANCE_ATTENUATION" count="3" value="0x8129">
+ <size name="PointParameterfvEXT" mode="get"/>
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="GENERATE_MIPMAP" count="1" value="0x8191">
+ <size name="TexParameterfv" mode="get"/>
+ <size name="TexParameteriv" mode="get"/>
+ <size name="GetTexParameterfv" mode="get"/>
+ <size name="GetTexParameteriv" mode="get"/>
+ </enum>
+ <enum name="GENERATE_MIPMAP_HINT" value="0x8192"/>
+ <enum name="DEPTH_COMPONENT16" value="0x81A5"/>
+ <enum name="DEPTH_COMPONENT24" value="0x81A6"/>
+ <enum name="DEPTH_COMPONENT32" value="0x81A7"/>
+ <enum name="MIRRORED_REPEAT" value="0x8370"/>
+ <enum name="FOG_COORDINATE_SOURCE" count="1" value="0x8450">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="FOG_COORDINATE" value="0x8451"/>
+ <enum name="FRAGMENT_DEPTH" value="0x8452"/>
+ <enum name="CURRENT_FOG_COORDINATE" count="1" value="0x8453">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="FOG_COORDINATE_ARRAY_TYPE" count="1" value="0x8454">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="FOG_COORDINATE_ARRAY_STRIDE" count="1" value="0x8455">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="FOG_COORDINATE_ARRAY_POINTER" value="0x8456"/>
+ <enum name="FOG_COORDINATE_ARRAY" count="1" value="0x8457">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="COLOR_SUM" value="0x8458"/>
+ <enum name="CURRENT_SECONDARY_COLOR" count="4" value="0x8459">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="SECONDARY_COLOR_ARRAY_SIZE" count="1" value="0x845A">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="SECONDARY_COLOR_ARRAY_TYPE" count="1" value="0x845B">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="SECONDARY_COLOR_ARRAY_STRIDE" count="1" value="0x845C">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="SECONDARY_COLOR_ARRAY_POINTER" value="0x845D"/>
+ <enum name="SECONDARY_COLOR_ARRAY" count="1" value="0x845E">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="MAX_TEXTURE_LOD_BIAS" count="1" value="0x84FD">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="TEXTURE_FILTER_CONTROL" value="0x8500"/>
+ <enum name="TEXTURE_LOD_BIAS" count="1" value="0x8501">
+ <size name="TexEnvfv" mode="get"/>
+ <size name="TexEnviv" mode="get"/>
+ <size name="TexParameterfv" mode="get"/>
+ <size name="TexParameteriv" mode="get"/>
+ <size name="GetTexEnvfv" mode="get"/>
+ <size name="GetTexEnviv" mode="get"/>
+ <size name="GetTexParameterfv" mode="get"/>
+ <size name="GetTexParameteriv" mode="get"/>
+ </enum>
+ <enum name="INCR_WRAP" value="0x8507"/>
+ <enum name="DECR_WRAP" value="0x8508"/>
+ <enum name="TEXTURE_DEPTH_SIZE" count="1" value="0x884A">
+ <size name="GetTexLevelParameterfv" mode="get"/>
+ <size name="GetTexLevelParameteriv" mode="get"/>
+ </enum>
+ <enum name="DEPTH_TEXTURE_MODE" count="1" value="0x884B">
+ <size name="TexParameterfv" mode="get"/>
+ <size name="TexParameteriv" mode="get"/>
+ <size name="GetTexParameterfv" mode="get"/>
+ <size name="GetTexParameteriv" mode="get"/>
+ </enum>
+ <enum name="TEXTURE_COMPARE_MODE" count="1" value="0x884C">
+ <size name="TexParameterfv" mode="get"/>
+ <size name="TexParameteriv" mode="get"/>
+ <size name="GetTexParameterfv" mode="get"/>
+ <size name="GetTexParameteriv" mode="get"/>
+ </enum>
+ <enum name="TEXTURE_COMPARE_FUNC" count="1" value="0x884D">
+ <size name="TexParameterfv" mode="get"/>
+ <size name="TexParameteriv" mode="get"/>
+ <size name="GetTexParameterfv" mode="get"/>
+ <size name="GetTexParameteriv" mode="get"/>
+ </enum>
+ <enum name="COMPARE_R_TO_TEXTURE" value="0x884E"/>
+
+ <function name="BlendFuncSeparate" alias="BlendFuncSeparateEXT">
+ <param name="sfactorRGB" type="GLenum"/>
+ <param name="dfactorRGB" type="GLenum"/>
+ <param name="sfactorAlpha" type="GLenum"/>
+ <param name="dfactorAlpha" type="GLenum"/>
+ </function>
+
+ <function name="FogCoordf" alias="FogCoordfEXT">
+ <param name="coord" type="GLfloat"/>
+ </function>
+
+ <function name="FogCoordfv" alias="FogCoordfvEXT">
+ <param name="coord" type="const GLfloat *"/>
+ </function>
+
+ <function name="FogCoordd" alias="FogCoorddEXT">
+ <param name="coord" type="GLdouble"/>
+ </function>
+
+ <function name="FogCoorddv" alias="FogCoorddvEXT">
+ <param name="coord" type="const GLdouble *"/>
+ </function>
+
+ <function name="FogCoordPointer" alias="FogCoordPointerEXT">
+ <param name="type" type="GLenum"/>
+ <param name="stride" type="GLsizei"/>
+ <param name="pointer" type="const GLvoid *"/>
+ </function>
+
+ <function name="MultiDrawArrays" alias="MultiDrawArraysEXT">
+ <param name="mode" type="GLenum"/>
+ <param name="first" type="const GLint *"/>
+ <param name="count" type="const GLsizei *"/>
+ <param name="primcount" type="GLsizei"/>
+ </function>
+
+ <function name="MultiDrawElements" alias="MultiDrawElementsEXT">
+ <param name="mode" type="GLenum"/>
+ <param name="count" type="const GLsizei *"/>
+ <param name="type" type="GLenum"/>
+ <param name="indices" type="const GLvoid **"/>
+ <param name="primcount" type="GLsizei"/>
+ </function>
+
+ <function name="PointParameterf" alias="PointParameterfEXT">
+ <param name="pname" type="GLenum"/>
+ <param name="param" type="GLfloat"/>
+ </function>
+
+ <function name="PointParameterfv" alias="PointParameterfvEXT">
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="const GLfloat *"/>
+ </function>
+
+ <function name="PointParameteri" alias="PointParameteriNV">
+ <param name="pname" type="GLenum"/>
+ <param name="param" type="GLint"/>
+ </function>
+
+ <function name="PointParameteriv" alias="PointParameterivNV">
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="const GLint *"/>
+ </function>
+
+ <function name="SecondaryColor3b" alias="SecondaryColor3bEXT">
+ <param name="red" type="GLbyte"/>
+ <param name="green" type="GLbyte"/>
+ <param name="blue" type="GLbyte"/>
+ </function>
+
+ <function name="SecondaryColor3bv" alias="SecondaryColor3bvEXT">
+ <param name="v" type="const GLbyte *"/>
+ </function>
+
+ <function name="SecondaryColor3d" alias="SecondaryColor3dEXT">
+ <param name="red" type="GLdouble"/>
+ <param name="green" type="GLdouble"/>
+ <param name="blue" type="GLdouble"/>
+ </function>
+
+ <function name="SecondaryColor3dv" alias="SecondaryColor3dvEXT">
+ <param name="v" type="const GLdouble *"/>
+ </function>
+
+ <function name="SecondaryColor3f" alias="SecondaryColor3fEXT">
+ <param name="red" type="GLfloat"/>
+ <param name="green" type="GLfloat"/>
+ <param name="blue" type="GLfloat"/>
+ </function>
+
+ <function name="SecondaryColor3fv" alias="SecondaryColor3fvEXT">
+ <param name="v" type="const GLfloat *"/>
+ </function>
+
+ <function name="SecondaryColor3i" alias="SecondaryColor3iEXT">
+ <param name="red" type="GLint"/>
+ <param name="green" type="GLint"/>
+ <param name="blue" type="GLint"/>
+ </function>
+
+ <function name="SecondaryColor3iv" alias="SecondaryColor3ivEXT">
+ <param name="v" type="const GLint *"/>
+ </function>
+
+ <function name="SecondaryColor3s" alias="SecondaryColor3sEXT">
+ <param name="red" type="GLshort"/>
+ <param name="green" type="GLshort"/>
+ <param name="blue" type="GLshort"/>
+ </function>
+
+ <function name="SecondaryColor3sv" alias="SecondaryColor3svEXT">
+ <param name="v" type="const GLshort *"/>
+ </function>
+
+ <function name="SecondaryColor3ub" alias="SecondaryColor3ubEXT">
+ <param name="red" type="GLubyte"/>
+ <param name="green" type="GLubyte"/>
+ <param name="blue" type="GLubyte"/>
+ </function>
+
+ <function name="SecondaryColor3ubv" alias="SecondaryColor3ubvEXT">
+ <param name="v" type="const GLubyte *"/>
+ </function>
+
+ <function name="SecondaryColor3ui" alias="SecondaryColor3uiEXT">
+ <param name="red" type="GLuint"/>
+ <param name="green" type="GLuint"/>
+ <param name="blue" type="GLuint"/>
+ </function>
+
+ <function name="SecondaryColor3uiv" alias="SecondaryColor3uivEXT">
+ <param name="v" type="const GLuint *"/>
+ </function>
+
+ <function name="SecondaryColor3us" alias="SecondaryColor3usEXT">
+ <param name="red" type="GLushort"/>
+ <param name="green" type="GLushort"/>
+ <param name="blue" type="GLushort"/>
+ </function>
+
+ <function name="SecondaryColor3usv" alias="SecondaryColor3usvEXT">
+ <param name="v" type="const GLushort *"/>
+ </function>
+
+ <function name="SecondaryColorPointer" alias="SecondaryColorPointerEXT">
+ <param name="size" type="GLint"/>
+ <param name="type" type="GLenum"/>
+ <param name="stride" type="GLsizei"/>
+ <param name="pointer" type="const GLvoid *"/>
+ </function>
+
+ <function name="WindowPos2d" alias="WindowPos2dMESA">
+ <param name="x" type="GLdouble"/>
+ <param name="y" type="GLdouble"/>
+ </function>
+
+ <function name="WindowPos2dv" alias="WindowPos2dvMESA">
+ <param name="v" type="const GLdouble *"/>
+ </function>
+
+ <function name="WindowPos2f" alias="WindowPos2fMESA">
+ <param name="x" type="GLfloat"/>
+ <param name="y" type="GLfloat"/>
+ </function>
+
+ <function name="WindowPos2fv" alias="WindowPos2fvMESA">
+ <param name="v" type="const GLfloat *"/>
+ </function>
+
+ <function name="WindowPos2i" alias="WindowPos2iMESA">
+ <param name="x" type="GLint"/>
+ <param name="y" type="GLint"/>
+ </function>
+
+ <function name="WindowPos2iv" alias="WindowPos2ivMESA">
+ <param name="v" type="const GLint *"/>
+ </function>
+
+ <function name="WindowPos2s" alias="WindowPos2sMESA">
+ <param name="x" type="GLshort"/>
+ <param name="y" type="GLshort"/>
+ </function>
+
+ <function name="WindowPos2sv" alias="WindowPos2svMESA">
+ <param name="v" type="const GLshort *"/>
+ </function>
+
+ <function name="WindowPos3d" alias="WindowPos3dMESA">
+ <param name="x" type="GLdouble"/>
+ <param name="y" type="GLdouble"/>
+ <param name="z" type="GLdouble"/>
+ </function>
+
+ <function name="WindowPos3dv" alias="WindowPos3dvMESA">
+ <param name="v" type="const GLdouble *"/>
+ </function>
+
+ <function name="WindowPos3f" alias="WindowPos3fMESA">
+ <param name="x" type="GLfloat"/>
+ <param name="y" type="GLfloat"/>
+ <param name="z" type="GLfloat"/>
+ </function>
+
+ <function name="WindowPos3fv" alias="WindowPos3fvMESA">
+ <param name="v" type="const GLfloat *"/>
+ </function>
+
+ <function name="WindowPos3i" alias="WindowPos3iMESA">
+ <param name="x" type="GLint"/>
+ <param name="y" type="GLint"/>
+ <param name="z" type="GLint"/>
+ </function>
+
+ <function name="WindowPos3iv" alias="WindowPos3ivMESA">
+ <param name="v" type="const GLint *"/>
+ </function>
+
+ <function name="WindowPos3s" alias="WindowPos3sMESA">
+ <param name="x" type="GLshort"/>
+ <param name="y" type="GLshort"/>
+ <param name="z" type="GLshort"/>
+ </function>
+
+ <function name="WindowPos3sv" alias="WindowPos3svMESA">
+ <param name="v" type="const GLshort *"/>
+ </function>
+</category>
+
+<category name="1.5">
+ <enum name="BUFFER_SIZE" value="0x8764"/>
+ <enum name="BUFFER_USAGE" value="0x8765"/>
+ <enum name="QUERY_COUNTER_BITS" value="0x8864"/>
+ <enum name="CURRENT_QUERY" value="0x8865"/>
+ <enum name="QUERY_RESULT" value="0x8866"/>
+ <enum name="QUERY_RESULT_AVAILABLE" value="0x8867"/>
+ <enum name="ARRAY_BUFFER" value="0x8892"/>
+ <enum name="ELEMENT_ARRAY_BUFFER" value="0x8893"/>
+ <enum name="ARRAY_BUFFER_BINDING" value="0x8894"/>
+ <enum name="ELEMENT_ARRAY_BUFFER_BINDING" value="0x8895"/>
+ <enum name="VERTEX_ARRAY_BUFFER_BINDING" value="0x8896"/>
+ <enum name="NORMAL_ARRAY_BUFFER_BINDING" value="0x8897"/>
+ <enum name="COLOR_ARRAY_BUFFER_BINDING" value="0x8898"/>
+ <enum name="INDEX_ARRAY_BUFFER_BINDING" value="0x8899"/>
+ <enum name="TEXTURE_COORD_ARRAY_BUFFER_BINDING" value="0x889A"/>
+ <enum name="EDGE_FLAG_ARRAY_BUFFER_BINDING" value="0x889B"/>
+ <enum name="SECONDARY_COLOR_ARRAY_BUFFER_BINDING" value="0x889C"/>
+ <enum name="FOG_COORDINATE_ARRAY_BUFFER_BINDING" value="0x889D"/>
+ <enum name="WEIGHT_ARRAY_BUFFER_BINDING" value="0x889E"/>
+ <enum name="VERTEX_ATTRIB_ARRAY_BUFFER_BINDING" value="0x889F"/>
+ <enum name="READ_ONLY" value="0x88B8"/>
+ <enum name="WRITE_ONLY" value="0x88B9"/>
+ <enum name="READ_WRITE" value="0x88BA"/>
+ <enum name="BUFFER_ACCESS" value="0x88BB"/>
+ <enum name="BUFFER_MAPPED" value="0x88BC"/>
+ <enum name="BUFFER_MAP_POINTER" value="0x88BD"/>
+ <enum name="STREAM_DRAW" value="0x88E0"/>
+ <enum name="STREAM_READ" value="0x88E1"/>
+ <enum name="STREAM_COPY" value="0x88E2"/>
+ <enum name="STATIC_DRAW" value="0x88E4"/>
+ <enum name="STATIC_READ" value="0x88E5"/>
+ <enum name="STATIC_COPY" value="0x88E6"/>
+ <enum name="DYNAMIC_DRAW" value="0x88E8"/>
+ <enum name="DYNAMIC_READ" value="0x88E9"/>
+ <enum name="DYNAMIC_COPY" value="0x88EA"/>
+ <enum name="SAMPLES_PASSED" count="1" value="0x8914"/>
+ <enum name="FOG_COORD_SRC" value="0x8450">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="FOG_COORD" value="0x8451"/>
+ <enum name="CURRENT_FOG_COORD" count="1" value="0x8453">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="FOG_COORD_ARRAY_TYPE" count="1" value="0x8454">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="FOG_COORD_ARRAY_STRIDE" count="1" value="0x8455">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="FOG_COORD_ARRAY_POINTER" value="0x8456"/>
+ <enum name="FOG_COORD_ARRAY" count="1" value="0x8457">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="FOG_COORD_ARRAY_BUFFER_BINDING" value="0x889D"/>
+ <enum name="SRC0_RGB" value="0x8580"/>
+ <enum name="SRC1_RGB" value="0x8581"/>
+ <enum name="SRC2_RGB" value="0x8582"/>
+ <enum name="SRC0_ALPHA" value="0x8588"/>
+ <enum name="SRC1_ALPHA" value="0x8589"/>
+ <enum name="SRC2_ALPHA" value="0x858A"/>
+
+ <type name="intptr" size="4" glx_name="CARD32"/>
+ <type name="sizeiptr" size="4" unsigned="true" glx_name="CARD32"/>
+
+ <function name="BindBuffer" alias="BindBufferARB">
+ <param name="target" type="GLenum"/>
+ <param name="buffer" type="GLuint"/>
+ </function>
+
+ <function name="BufferData" alias="BufferDataARB">
+ <param name="target" type="GLenum"/>
+ <param name="size" type="GLsizeiptr"/>
+ <param name="data" type="const GLvoid *"/>
+ <param name="usage" type="GLenum"/>
+ </function>
+
+ <function name="BufferSubData" alias="BufferSubDataARB">
+ <param name="target" type="GLenum"/>
+ <param name="offset" type="GLintptr"/>
+ <param name="size" type="GLsizeiptr"/>
+ <param name="data" type="const GLvoid *"/>
+ </function>
+
+ <function name="DeleteBuffers" alias="DeleteBuffersARB">
+ <param name="n" type="GLsizei"/>
+ <param name="buffer" type="const GLuint *"/>
+ </function>
+
+ <function name="GenBuffers" alias="GenBuffersARB">
+ <param name="n" type="GLsizei" counter="true"/>
+ <param name="buffer" type="GLuint *" output="true" count="n"/>
+ </function>
+
+ <function name="GetBufferParameteriv" alias="GetBufferParameterivARB">
+ <param name="target" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLint *" output="true" variable_param="pname"/>
+ </function>
+
+ <function name="GetBufferPointerv" alias="GetBufferPointervARB">
+ <param name="target" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLvoid **" output="true"/>
+ </function>
+
+ <function name="GetBufferSubData" alias="GetBufferSubDataARB">
+ <param name="target" type="GLenum"/>
+ <param name="offset" type="GLintptr"/>
+ <param name="size" type="GLsizeiptr"/>
+ <param name="data" type="GLvoid *" output="true"/>
+ </function>
+
+ <function name="IsBuffer" alias="IsBufferARB">
+ <param name="buffer" type="GLuint"/>
+ <return type="GLboolean"/>
+ </function>
+
+ <function name="MapBuffer" alias="MapBufferARB">
+ <param name="target" type="GLenum"/>
+ <param name="access" type="GLenum"/>
+ <return type="GLvoid *"/>
+ </function>
+
+ <function name="UnmapBuffer" alias="UnmapBufferARB">
+ <param name="target" type="GLenum"/>
+ <return type="GLboolean"/>
+ </function>
+
+ <function name="GenQueries" alias="GenQueriesARB">
+ <param name="n" type="GLsizei" counter="true"/>
+ <param name="ids" type="GLuint *" output="true" count="n"/>
+ </function>
+
+ <function name="DeleteQueries" alias="DeleteQueriesARB">
+ <param name="n" type="GLsizei"/>
+ <param name="ids" type="const GLuint *"/>
+ </function>
+
+ <function name="IsQuery" alias="IsQueryARB">
+ <param name="id" type="GLuint"/>
+ <return type="GLboolean"/>
+ </function>
+
+ <function name="BeginQuery" alias="BeginQueryARB">
+ <param name="target" type="GLenum"/>
+ <param name="id" type="GLuint"/>
+ </function>
+
+ <function name="EndQuery" alias="EndQueryARB">
+ <param name="target" type="GLenum"/>
+ </function>
+
+ <function name="GetQueryiv" alias="GetQueryivARB">
+ <param name="target" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLint *" output="true" variable_param="pname"/>
+ </function>
+
+ <function name="GetQueryObjectiv" alias="GetQueryObjectivARB">
+ <param name="id" type="GLuint"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLint *" output="true" variable_param="pname"/>
+ </function>
+
+ <function name="GetQueryObjectuiv" alias="GetQueryObjectuivARB">
+ <param name="id" type="GLuint"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLuint *" output="true" variable_param="pname"/>
+ </function>
+</category>
+
+
+<category name="2.0">
+ <!-- XXX some of the enums and functions probably need additional -->
+ <!-- flags/attributes. -->
+
+ <type name="char" size="1" glx_name="CARD8"/>
+
+ <enum name="BLEND_EQUATION_RGB" value="0x8009"/>
+ <enum name="VERTEX_ATTRIB_ARRAY_ENABLED" value="0x8622"/>
+ <enum name="VERTEX_ATTRIB_ARRAY_SIZE" value="0x8623"/>
+ <enum name="VERTEX_ATTRIB_ARRAY_STRIDE" value="0x8624"/>
+ <enum name="VERTEX_ATTRIB_ARRAY_TYPE" value="0x8625"/>
+ <enum name="CURRENT_VERTEX_ATTRIB" value="0x8626"/>
+ <enum name="VERTEX_PROGRAM_POINT_SIZE" value="0x8642"/>
+ <enum name="VERTEX_PROGRAM_TWO_SIDE" value="0x8643"/>
+ <enum name="VERTEX_ATTRIB_ARRAY_POINTER" value="0x8645"/>
+ <enum name="STENCIL_BACK_FUNC" value="0x8800"/>
+ <enum name="STENCIL_BACK_FAIL" value="0x8801"/>
+ <enum name="STENCIL_BACK_PASS_DEPTH_FAIL" value="0x8802"/>
+ <enum name="STENCIL_BACK_PASS_DEPTH_PASS" value="0x8803"/>
+ <enum name="MAX_DRAW_BUFFERS" value="0x8824"/>
+ <enum name="DRAW_BUFFER0" value="0x8825"/>
+ <enum name="DRAW_BUFFER1" value="0x8826"/>
+ <enum name="DRAW_BUFFER2" value="0x8827"/>
+ <enum name="DRAW_BUFFER3" value="0x8828"/>
+ <enum name="DRAW_BUFFER4" value="0x8829"/>
+ <enum name="DRAW_BUFFER5" value="0x882A"/>
+ <enum name="DRAW_BUFFER6" value="0x882B"/>
+ <enum name="DRAW_BUFFER7" value="0x882C"/>
+ <enum name="DRAW_BUFFER8" value="0x882D"/>
+ <enum name="DRAW_BUFFER9" value="0x882E"/>
+ <enum name="DRAW_BUFFER10" value="0x882F"/>
+ <enum name="DRAW_BUFFER11" value="0x8830"/>
+ <enum name="DRAW_BUFFER12" value="0x8831"/>
+ <enum name="DRAW_BUFFER13" value="0x8832"/>
+ <enum name="DRAW_BUFFER14" value="0x8833"/>
+ <enum name="DRAW_BUFFER15" value="0x8834"/>
+ <enum name="BLEND_EQUATION_ALPHA" value="0x883D"/>
+ <enum name="POINT_SPRITE" value="0x8861"/>
+ <enum name="COORD_REPLACE" value="0x8862"/>
+ <enum name="MAX_VERTEX_ATTRIBS" value="0x8869"/>
+ <enum name="VERTEX_ATTRIB_ARRAY_NORMALIZED" value="0x886A"/>
+ <enum name="MAX_TEXTURE_COORDS" value="0x8871"/>
+ <enum name="MAX_TEXTURE_IMAGE_UNITS" value="0x8872"/>
+ <enum name="FRAGMENT_SHADER" value="0x8B30"/>
+ <enum name="VERTEX_SHADER" value="0x8B31"/>
+ <enum name="MAX_FRAGMENT_UNIFORM_COMPONENTS" value="0x8B49"/>
+ <enum name="MAX_VERTEX_UNIFORM_COMPONENTS" value="0x8B4A"/>
+ <enum name="MAX_VARYING_FLOATS" value="0x8B4B"/>
+ <enum name="MAX_VERTEX_TEXTURE_IMAGE_UNITS" value="0x8B4C"/>
+ <enum name="MAX_COMBINED_TEXTURE_IMAGE_UNITS" value="0x8B4D"/>
+ <enum name="SHADER_TYPE" value="0x8B4F"/>
+ <enum name="FLOAT_VEC2" value="0x8B50"/>
+ <enum name="FLOAT_VEC3" value="0x8B51"/>
+ <enum name="FLOAT_VEC4" value="0x8B52"/>
+ <enum name="INT_VEC2" value="0x8B53"/>
+ <enum name="INT_VEC3" value="0x8B54"/>
+ <enum name="INT_VEC4" value="0x8B55"/>
+ <enum name="BOOL" value="0x8B56"/>
+ <enum name="BOOL_VEC2" value="0x8B57"/>
+ <enum name="BOOL_VEC3" value="0x8B58"/>
+ <enum name="BOOL_VEC4" value="0x8B59"/>
+ <enum name="FLOAT_MAT2" value="0x8B5A"/>
+ <enum name="FLOAT_MAT3" value="0x8B5B"/>
+ <enum name="FLOAT_MAT4" value="0x8B5C"/>
+ <enum name="SAMPLER_1D" value="0x8B5D"/>
+ <enum name="SAMPLER_2D" value="0x8B5E"/>
+ <enum name="SAMPLER_3D" value="0x8B5F"/>
+ <enum name="SAMPLER_CUBE" value="0x8B60"/>
+ <enum name="SAMPLER_1D_SHADOW" value="0x8B61"/>
+ <enum name="SAMPLER_2D_SHADOW" value="0x8B62"/>
+ <enum name="DELETE_STATUS" value="0x8B80"/>
+ <enum name="COMPILE_STATUS" value="0x8B81"/>
+ <enum name="LINK_STATUS" value="0x8B82"/>
+ <enum name="VALIDATE_STATUS" value="0x8B83"/>
+ <enum name="INFO_LOG_LENGTH" value="0x8B84"/>
+ <enum name="ATTACHED_SHADERS" value="0x8B85"/>
+ <enum name="ACTIVE_UNIFORMS" value="0x8B86"/>
+ <enum name="ACTIVE_UNIFORM_MAX_LENGTH" value="0x8B87"/>
+ <enum name="SHADER_SOURCE_LENGTH" value="0x8B88"/>
+ <enum name="ACTIVE_ATTRIBUTES" value="0x8B89"/>
+ <enum name="ACTIVE_ATTRIBUTE_MAX_LENGTH" value="0x8B8A"/>
+ <enum name="FRAGMENT_SHADER_DERIVATIVE_HINT" value="0x8B8B"/>
+ <enum name="SHADING_LANGUAGE_VERSION" value="0x8B8C"/>
+ <enum name="CURRENT_PROGRAM" value="0x8B8D"/>
+ <enum name="POINT_SPRITE_COORD_ORIGIN" count="1" value="0x8CA0">
+ <size name="PointParameterfvEXT" mode="get"/>
+ <size name="PointParameterivNV" mode="get"/>
+ </enum>
+ <enum name="LOWER_LEFT" value="0x8CA1"/>
+ <enum name="UPPER_LEFT" value="0x8CA2"/>
+ <enum name="STENCIL_BACK_REF" value="0x8CA3"/>
+ <enum name="STENCIL_BACK_VALUE_MASK" value="0x8CA4"/>
+ <enum name="STENCIL_BACK_WRITEMASK" value="0x8CA5"/>
+
+ <function name="BlendEquationSeparate" alias="BlendEquationSeparateEXT">
+ <param name="modeRGB" type="GLenum"/>
+ <param name="modeA" type="GLenum"/>
+ </function>
+
+ <function name="DrawBuffers" alias="DrawBuffersARB">
+ <param name="n" type="GLsizei" counter="true"/>
+ <param name="bufs" type="const GLenum *" count="n"/>
+ </function>
+
+ <function name="StencilFuncSeparate" offset="assign">
+ <param name="face" type="GLenum"/>
+ <param name="func" type="GLenum"/>
+ <param name="ref" type="GLint"/>
+ <param name="mask" type="GLuint"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="StencilOpSeparate" offset="assign">
+ <param name="face" type="GLenum"/>
+ <param name="sfail" type="GLenum"/>
+ <param name="zfail" type="GLenum"/>
+ <param name="zpass" type="GLenum"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="StencilMaskSeparate" offset="assign">
+ <param name="face" type="GLenum"/>
+ <param name="mask" type="GLuint"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="AttachShader" offset="assign">
+ <param name="program" type="GLuint"/>
+ <param name="shader" type="GLuint"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="BindAttribLocation" alias="BindAttribLocationARB">
+ <param name="program" type="GLuint"/>
+ <param name="index" type="GLuint"/>
+ <param name="name" type="const GLchar *"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="CompileShader" alias="CompileShaderARB">
+ <param name="shader" type="GLuint"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="CreateProgram" offset="assign">
+ <return type="GLuint"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="CreateShader" offset="assign">
+ <param name="type" type="GLenum"/>
+ <return type="GLuint"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="DeleteProgram" offset="assign">
+ <param name="program" type="GLuint"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="DeleteShader" offset="assign">
+ <param name="program" type="GLuint"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="DetachShader" offset="assign">
+ <param name="program" type="GLuint"/>
+ <param name="shader" type="GLuint"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="DisableVertexAttribArray" alias="DisableVertexAttribArrayARB">
+ <param name="index" type="GLuint"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="EnableVertexAttribArray" alias="EnableVertexAttribArrayARB">
+ <param name="index" type="GLuint"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="GetActiveAttrib" alias="GetActiveAttribARB">
+ <param name="program" type="GLuint"/>
+ <param name="index" type="GLuint"/>
+ <param name="bufSize" type="GLsizei "/>
+ <param name="length" type="GLsizei *" output="true"/>
+ <param name="size" type="GLint *" output="true"/>
+ <param name="type" type="GLenum *" output="true"/>
+ <param name="name" type="GLchar *" output="true"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="GetActiveUniform" alias="GetActiveUniformARB">
+ <param name="program" type="GLuint"/>
+ <param name="index" type="GLuint"/>
+ <param name="bufSize" type="GLsizei"/>
+ <param name="length" type="GLsizei *" output="true"/>
+ <param name="size" type="GLint *" output="true"/>
+ <param name="type" type="GLenum *" output="true"/>
+ <param name="name" type="GLchar *" output="true"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="GetAttachedShaders" offset="assign">
+ <param name="program" type="GLuint"/>
+ <param name="maxCount" type="GLsizei"/>
+ <param name="count" type="GLsizei *" output="true"/>
+ <param name="obj" type="GLuint *" output="true"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="GetAttribLocation" alias="GetAttribLocationARB">
+ <param name="program" type="GLuint"/>
+ <param name="name" type="const GLchar *"/>
+ <return type="GLint"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="GetProgramiv" offset="assign">
+ <param name="program" type="GLuint"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLint *"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="GetProgramInfoLog" offset="assign">
+ <param name="program" type="GLuint"/>
+ <param name="bufSize" type="GLsizei"/>
+ <param name="length" type="GLsizei *"/>
+ <param name="infoLog" type="GLchar *"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="GetShaderiv" offset="assign">
+ <param name="shader" type="GLuint"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLint *"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="GetShaderInfoLog" offset="assign">
+ <param name="shader" type="GLuint"/>
+ <param name="bufSize" type="GLsizei"/>
+ <param name="length" type="GLsizei *"/>
+ <param name="infoLog" type="GLchar *"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="GetShaderSource" alias="GetShaderSourceARB">
+ <param name="shader" type="GLuint"/>
+ <param name="bufSize" type="GLsizei"/>
+ <param name="length" type="GLsizei *" output="true"/>
+ <param name="source" type="GLchar *" output="true"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="GetUniformLocation" alias="GetUniformLocationARB">
+ <param name="program" type="GLuint"/>
+ <param name="name" type="const GLchar *"/>
+ <return type="GLint"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="GetUniformfv" alias="GetUniformfvARB">
+ <param name="program" type="GLuint"/>
+ <param name="location" type="GLint"/>
+ <param name="params" type="GLfloat *" output="true"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="GetUniformiv" alias="GetUniformivARB">
+ <param name="program" type="GLuint"/>
+ <param name="location" type="GLint"/>
+ <param name="params" type="GLint *"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="GetVertexAttribdv" alias="GetVertexAttribdvARB">
+ <param name="index" type="GLuint"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLdouble *" output="true" variable_param="pname"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="GetVertexAttribfv" alias="GetVertexAttribfvARB">
+ <param name="index" type="GLuint"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLfloat *" output="true" variable_param="pname"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="GetVertexAttribiv" alias="GetVertexAttribivARB">
+ <param name="index" type="GLuint"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLint *" output="true" variable_param="pname"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="GetVertexAttribPointerv" alias="GetVertexAttribPointervNV">
+ <param name="index" type="GLuint"/>
+ <param name="pname" type="GLenum"/>
+ <param name="pointer" type="GLvoid **" output="true"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="IsProgram" offset="assign">
+ <param name="program" type="GLuint"/>
+ <return type="GLboolean"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="IsShader" offset="assign">
+ <param name="shader" type="GLuint"/>
+ <return type="GLboolean"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="LinkProgram" alias="LinkProgramARB">
+ <param name="program" type="GLuint"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="ShaderSource" alias="ShaderSourceARB">
+ <param name="shader" type="GLuint"/>
+ <param name="count" type="GLsizei"/>
+ <param name="string" type="const GLchar **"/>
+ <param name="length" type="const GLint *"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="UseProgram" alias="UseProgramObjectARB">
+ <param name="program" type="GLuint"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="Uniform1f" alias="Uniform1fARB">
+ <param name="location" type="GLint"/>
+ <param name="v0" type="GLfloat"/>
+ <glx ignore="true"/>
+ </function>
+ <function name="Uniform2f" alias="Uniform2fARB">
+ <param name="location" type="GLint"/>
+ <param name="v0" type="GLfloat"/>
+ <param name="v1" type="GLfloat"/>
+ <glx ignore="true"/>
+ </function>
+ <function name="Uniform3f" alias="Uniform3fARB">
+ <param name="location" type="GLint"/>
+ <param name="v0" type="GLfloat"/>
+ <param name="v1" type="GLfloat"/>
+ <param name="v2" type="GLfloat"/>
+ <glx ignore="true"/>
+ </function>
+ <function name="Uniform4f" alias="Uniform4fARB">
+ <param name="location" type="GLint"/>
+ <param name="v0" type="GLfloat"/>
+ <param name="v1" type="GLfloat"/>
+ <param name="v2" type="GLfloat"/>
+ <param name="v3" type="GLfloat"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="Uniform1i" alias="Uniform1iARB">
+ <param name="location" type="GLint"/>
+ <param name="v0" type="GLint"/>
+ <glx ignore="true"/>
+ </function>
+ <function name="Uniform2i" alias="Uniform2iARB">
+ <param name="location" type="GLint"/>
+ <param name="v0" type="GLint"/>
+ <param name="v1" type="GLint"/>
+ <glx ignore="true"/>
+ </function>
+ <function name="Uniform3i" alias="Uniform3iARB">
+ <param name="location" type="GLint"/>
+ <param name="v0" type="GLint"/>
+ <param name="v1" type="GLint"/>
+ <param name="v2" type="GLint"/>
+ <glx ignore="true"/>
+ </function>
+ <function name="Uniform4i" alias="Uniform4iARB">
+ <param name="location" type="GLint"/>
+ <param name="v0" type="GLint"/>
+ <param name="v1" type="GLint"/>
+ <param name="v2" type="GLint"/>
+ <param name="v3" type="GLint"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="Uniform1fv" alias="Uniform1fvARB">
+ <param name="location" type="GLint"/>
+ <param name="count" type="GLsizei"/>
+ <param name="value" type="const GLfloat *"/>
+ <glx ignore="true"/>
+ </function>
+ <function name="Uniform2fv" alias="Uniform2fvARB">
+ <param name="location" type="GLint"/>
+ <param name="count" type="GLsizei"/>
+ <param name="value" type="const GLfloat *"/>
+ <glx ignore="true"/>
+ </function>
+ <function name="Uniform3fv" alias="Uniform3fvARB">
+ <param name="location" type="GLint"/>
+ <param name="count" type="GLsizei"/>
+ <param name="value" type="const GLfloat *"/>
+ <glx ignore="true"/>
+ </function>
+ <function name="Uniform4fv" alias="Uniform4fvARB">
+ <param name="location" type="GLint"/>
+ <param name="count" type="GLsizei"/>
+ <param name="value" type="const GLfloat *"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="Uniform1iv" alias="Uniform1ivARB">
+ <param name="location" type="GLint"/>
+ <param name="count" type="GLsizei"/>
+ <param name="value" type="const GLint *"/>
+ <glx ignore="true"/>
+ </function>
+ <function name="Uniform2iv" alias="Uniform2ivARB">
+ <param name="location" type="GLint"/>
+ <param name="count" type="GLsizei"/>
+ <param name="value" type="const GLint *"/>
+ <glx ignore="true"/>
+ </function>
+ <function name="Uniform3iv" alias="Uniform3ivARB">
+ <param name="location" type="GLint"/>
+ <param name="count" type="GLsizei"/>
+ <param name="value" type="const GLint *"/>
+ <glx ignore="true"/>
+ </function>
+ <function name="Uniform4iv" alias="Uniform4ivARB">
+ <param name="location" type="GLint"/>
+ <param name="count" type="GLsizei"/>
+ <param name="value" type="const GLint *"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="UniformMatrix2fv" alias="UniformMatrix2fvARB">
+ <param name="location" type="GLint"/>
+ <param name="count" type="GLsizei"/>
+ <param name="transpose" type="GLboolean"/>
+ <param name="value" type="const GLfloat *"/>
+ <glx ignore="true"/>
+ </function>
+ <function name="UniformMatrix3fv" alias="UniformMatrix3fvARB">
+ <param name="location" type="GLint"/>
+ <param name="count" type="GLsizei"/>
+ <param name="transpose" type="GLboolean"/>
+ <param name="value" type="const GLfloat *"/>
+ <glx ignore="true"/>
+ </function>
+ <function name="UniformMatrix4fv" alias="UniformMatrix4fvARB">
+ <param name="location" type="GLint"/>
+ <param name="count" type="GLsizei"/>
+ <param name="transpose" type="GLboolean"/>
+ <param name="value" type="const GLfloat *"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="ValidateProgram" alias="ValidateProgramARB">
+ <param name="program" type="GLuint"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="VertexAttrib1d" alias="VertexAttrib1dARB">
+ <param name="index" type="GLuint"/>
+ <param name="x" type="GLdouble"/>
+ </function>
+ <function name="VertexAttrib1dv" alias="VertexAttrib1dvARB">
+ <param name="index" type="GLuint"/>
+ <param name="v" type="const GLdouble *"/>
+ </function>
+ <function name="VertexAttrib1f" alias="VertexAttrib1fARB">
+ <param name="index" type="GLuint"/>
+ <param name="x" type="GLfloat"/>
+ </function>
+ <function name="VertexAttrib1fv" alias="VertexAttrib1fvARB">
+ <param name="index" type="GLuint"/>
+ <param name="v" type="const GLfloat *"/>
+ </function>
+ <function name="VertexAttrib1s" alias="VertexAttrib1sARB">
+ <param name="index" type="GLuint"/>
+ <param name="x" type="GLshort"/>
+ </function>
+ <function name="VertexAttrib1sv" alias="VertexAttrib1svARB">
+ <param name="index" type="GLuint"/>
+ <param name="v" type="const GLshort *"/>
+ </function>
+
+ <function name="VertexAttrib2d" alias="VertexAttrib2dARB">
+ <param name="index" type="GLuint"/>
+ <param name="x" type="GLdouble"/>
+ <param name="y" type="GLdouble"/>
+ </function>
+ <function name="VertexAttrib2dv" alias="VertexAttrib2dvARB">
+ <param name="index" type="GLuint"/>
+ <param name="v" type="const GLdouble *"/>
+ </function>
+ <function name="VertexAttrib2f" alias="VertexAttrib2fARB">
+ <param name="index" type="GLuint"/>
+ <param name="x" type="GLfloat"/>
+ <param name="y" type="GLfloat"/>
+ </function>
+ <function name="VertexAttrib2fv" alias="VertexAttrib2fvARB">
+ <param name="index" type="GLuint"/>
+ <param name="v" type="const GLfloat *"/>
+ </function>
+ <function name="VertexAttrib2s" alias="VertexAttrib2sARB">
+ <param name="index" type="GLuint"/>
+ <param name="x" type="GLshort"/>
+ <param name="y" type="GLshort"/>
+ </function>
+ <function name="VertexAttrib2sv" alias="VertexAttrib2svARB">
+ <param name="index" type="GLuint"/>
+ <param name="v" type="const GLshort *"/>
+ </function>
+
+ <function name="VertexAttrib3d" alias="VertexAttrib3dARB">
+ <param name="index" type="GLuint"/>
+ <param name="x" type="GLdouble"/>
+ <param name="y" type="GLdouble"/>
+ <param name="z" type="GLdouble"/>
+ </function>
+ <function name="VertexAttrib3dv" alias="VertexAttrib3dvARB">
+ <param name="index" type="GLuint"/>
+ <param name="v" type="const GLdouble *"/>
+ </function>
+ <function name="VertexAttrib3f" alias="VertexAttrib3fARB">
+ <param name="index" type="GLuint"/>
+ <param name="x" type="GLfloat"/>
+ <param name="y" type="GLfloat"/>
+ <param name="z" type="GLfloat"/>
+ </function>
+ <function name="VertexAttrib3fv" alias="VertexAttrib3fvARB">
+ <param name="index" type="GLuint"/>
+ <param name="v" type="const GLfloat *"/>
+ </function>
+ <function name="VertexAttrib3s" alias="VertexAttrib3sARB">
+ <param name="index" type="GLuint"/>
+ <param name="x" type="GLshort"/>
+ <param name="y" type="GLshort"/>
+ <param name="z" type="GLshort"/>
+ </function>
+ <function name="VertexAttrib3sv" alias="VertexAttrib3svARB">
+ <param name="index" type="GLuint"/>
+ <param name="v" type="const GLshort *"/>
+ </function>
+
+ <function name="VertexAttrib4Nbv" alias="VertexAttrib4NbvARB">
+ <param name="index" type="GLuint"/>
+ <param name="v" type="const GLbyte *"/>
+ </function>
+ <function name="VertexAttrib4Niv" alias="VertexAttrib4NivARB">
+ <param name="index" type="GLuint"/>
+ <param name="v" type="const GLint *"/>
+ </function>
+ <function name="VertexAttrib4Nsv" alias="VertexAttrib4NsvARB">
+ <param name="index" type="GLuint"/>
+ <param name="v" type="const GLshort *"/>
+ </function>
+ <function name="VertexAttrib4Nub" alias="VertexAttrib4NubARB">
+ <param name="index" type="GLuint"/>
+ <param name="x" type="GLubyte"/>
+ <param name="y" type="GLubyte"/>
+ <param name="z" type="GLubyte"/>
+ <param name="w" type="GLubyte"/>
+ </function>
+ <function name="VertexAttrib4Nubv" alias="VertexAttrib4NubvARB">
+ <param name="index" type="GLuint"/>
+ <param name="v" type="const GLubyte *"/>
+ </function>
+ <function name="VertexAttrib4Nuiv" alias="VertexAttrib4NuivARB">
+ <param name="index" type="GLuint"/>
+ <param name="v" type="const GLuint *"/>
+ </function>
+ <function name="VertexAttrib4Nusv" alias="VertexAttrib4NusvARB">
+ <param name="index" type="GLuint"/>
+ <param name="v" type="const GLushort *"/>
+ </function>
+ <function name="VertexAttrib4bv" alias="VertexAttrib4bvARB">
+ <param name="index" type="GLuint"/>
+ <param name="v" type="const GLbyte *" count="4"/>
+ </function>
+ <function name="VertexAttrib4d" alias="VertexAttrib4dARB">
+ <param name="index" type="GLuint"/>
+ <param name="x" type="GLdouble"/>
+ <param name="y" type="GLdouble"/>
+ <param name="z" type="GLdouble"/>
+ <param name="w" type="GLdouble"/>
+ </function>
+ <function name="VertexAttrib4dv" alias="VertexAttrib4dvARB">
+ <param name="index" type="GLuint"/>
+ <param name="v" type="const GLdouble *"/>
+ </function>
+ <function name="VertexAttrib4f" alias="VertexAttrib4fARB">
+ <param name="index" type="GLuint"/>
+ <param name="x" type="GLfloat"/>
+ <param name="y" type="GLfloat"/>
+ <param name="z" type="GLfloat"/>
+ <param name="w" type="GLfloat"/>
+ </function>
+ <function name="VertexAttrib4fv" alias="VertexAttrib4fvARB">
+ <param name="index" type="GLuint"/>
+ <param name="v" type="const GLfloat *"/>
+ </function>
+ <function name="VertexAttrib4iv" alias="VertexAttrib4ivARB">
+ <param name="index" type="GLuint"/>
+ <param name="v" type="const GLint *" count="4"/>
+ </function>
+ <function name="VertexAttrib4s" alias="VertexAttrib4sARB">
+ <param name="index" type="GLuint"/>
+ <param name="x" type="GLshort"/>
+ <param name="y" type="GLshort"/>
+ <param name="z" type="GLshort"/>
+ <param name="w" type="GLshort"/>
+ </function>
+ <function name="VertexAttrib4sv" alias="VertexAttrib4svARB">
+ <param name="index" type="GLuint"/>
+ <param name="v" type="const GLshort *"/>
+ </function>
+ <function name="VertexAttrib4ubv" alias="VertexAttrib4ubvARB">
+ <param name="index" type="GLuint"/>
+ <param name="v" type="const GLubyte *" count="4"/>
+ </function>
+ <function name="VertexAttrib4uiv" alias="VertexAttrib4uivARB">
+ <param name="index" type="GLuint"/>
+ <param name="v" type="const GLuint *" count="4"/>
+ </function>
+ <function name="VertexAttrib4usv" alias="VertexAttrib4usvARB">
+ <param name="index" type="GLuint"/>
+ <param name="v" type="const GLushort *" count="4"/>
+ </function>
+
+ <function name="VertexAttribPointer" alias="VertexAttribPointerARB">
+ <param name="index" type="GLuint"/>
+ <param name="size" type="GLint"/>
+ <param name="type" type="GLenum"/>
+ <param name="normalized" type="GLboolean"/>
+ <param name="stride" type="GLsizei"/>
+ <param name="pointer" type="const GLvoid *"/>
+ </function>
+
+</category>
+
+
+<category name="2.1">
+ <!-- XXX some of the enums and functions probably need additional -->
+ <!-- flags/attributes. -->
+
+ <enum name="CURRENT_RASTER_SECONDARY_COLOR" value="0x845F"/>
+ <enum name="PIXEL_PACK_BUFFER" value="0x88EB"/>
+ <enum name="PIXEL_UNPACK_BUFFER" value="0x88EC"/>
+ <enum name="PIXEL_PACK_BUFFER_BINDING" value="0x88ED"/>
+ <enum name="PIXEL_UNPACK_BUFFER_BINDING" value="0x88EF"/>
+ <enum name="FLOAT_MAT2x3" value="0x8B65"/>
+ <enum name="FLOAT_MAT2x4" value="0x8B66"/>
+ <enum name="FLOAT_MAT3x2" value="0x8B67"/>
+ <enum name="FLOAT_MAT3x4" value="0x8B68"/>
+ <enum name="FLOAT_MAT4x2" value="0x8B69"/>
+ <enum name="FLOAT_MAT4x3" value="0x8B6A"/>
+ <enum name="SRGB" value="0x8C40"/>
+ <enum name="SRGB8" value="0x8C41"/>
+ <enum name="SRGB_ALPHA" value="0x8C42"/>
+ <enum name="SRGB8_ALPHA8" value="0x8C43"/>
+ <enum name="SLUMINANCE_ALPHA" value="0x8C44"/>
+ <enum name="SLUMINANCE8_ALPHA8" value="0x8C45"/>
+ <enum name="SLUMINANCE" value="0x8C46"/>
+ <enum name="SLUMINANCE8" value="0x8C47"/>
+ <enum name="COMPRESSED_SRGB" value="0x8C48"/>
+ <enum name="COMPRESSED_SRGB_ALPHA" value="0x8C49"/>
+ <enum name="COMPRESSED_SLUMINANCE" value="0x8C4A"/>
+ <enum name="COMPRESSED_SLUMINANCE_ALPHA" value="0x8C4B"/>
+
+ <function name="UniformMatrix2x3fv" offset="assign">
+ <param name="location" type="GLint"/>
+ <param name="count" type="GLsizei"/>
+ <param name="transpose" type="GLboolean"/>
+ <param name="value" type="const GLfloat *"/>
+ <glx ignore="true"/>
+ </function>
+ <function name="UniformMatrix3x2fv" offset="assign">
+ <param name="location" type="GLint"/>
+ <param name="count" type="GLsizei"/>
+ <param name="transpose" type="GLboolean"/>
+ <param name="value" type="const GLfloat *"/>
+ <glx ignore="true"/>
+ </function>
+ <function name="UniformMatrix2x4fv" offset="assign">
+ <param name="location" type="GLint"/>
+ <param name="count" type="GLsizei"/>
+ <param name="transpose" type="GLboolean"/>
+ <param name="value" type="const GLfloat *"/>
+ <glx ignore="true"/>
+ </function>
+ <function name="UniformMatrix4x2fv" offset="assign">
+ <param name="location" type="GLint"/>
+ <param name="count" type="GLsizei"/>
+ <param name="transpose" type="GLboolean"/>
+ <param name="value" type="const GLfloat *"/>
+ <glx ignore="true"/>
+ </function>
+ <function name="UniformMatrix3x4fv" offset="assign">
+ <param name="location" type="GLint"/>
+ <param name="count" type="GLsizei"/>
+ <param name="transpose" type="GLboolean"/>
+ <param name="value" type="const GLfloat *"/>
+ <glx ignore="true"/>
+ </function>
+ <function name="UniformMatrix4x3fv" offset="assign">
+ <param name="location" type="GLint"/>
+ <param name="count" type="GLsizei"/>
+ <param name="transpose" type="GLboolean"/>
+ <param name="value" type="const GLfloat *"/>
+ <glx ignore="true"/>
+ </function>
+
+</category>
+
+
+<!-- ARB extensions sorted by extension number. -->
+
+<category name="GL_ARB_multitexture" number="1">
+ <enum name="TEXTURE0_ARB" value="0x84C0"/>
+ <enum name="TEXTURE1_ARB" value="0x84C1"/>
+ <enum name="TEXTURE2_ARB" value="0x84C2"/>
+ <enum name="TEXTURE3_ARB" value="0x84C3"/>
+ <enum name="TEXTURE4_ARB" value="0x84C4"/>
+ <enum name="TEXTURE5_ARB" value="0x84C5"/>
+ <enum name="TEXTURE6_ARB" value="0x84C6"/>
+ <enum name="TEXTURE7_ARB" value="0x84C7"/>
+ <enum name="TEXTURE8_ARB" value="0x84C8"/>
+ <enum name="TEXTURE9_ARB" value="0x84C9"/>
+ <enum name="TEXTURE10_ARB" value="0x84CA"/>
+ <enum name="TEXTURE11_ARB" value="0x84CB"/>
+ <enum name="TEXTURE12_ARB" value="0x84CC"/>
+ <enum name="TEXTURE13_ARB" value="0x84CD"/>
+ <enum name="TEXTURE14_ARB" value="0x84CE"/>
+ <enum name="TEXTURE15_ARB" value="0x84CF"/>
+ <enum name="TEXTURE16_ARB" value="0x84D0"/>
+ <enum name="TEXTURE17_ARB" value="0x84D1"/>
+ <enum name="TEXTURE18_ARB" value="0x84D2"/>
+ <enum name="TEXTURE19_ARB" value="0x84D3"/>
+ <enum name="TEXTURE20_ARB" value="0x84D4"/>
+ <enum name="TEXTURE21_ARB" value="0x84D5"/>
+ <enum name="TEXTURE22_ARB" value="0x84D6"/>
+ <enum name="TEXTURE23_ARB" value="0x84D7"/>
+ <enum name="TEXTURE24_ARB" value="0x84D8"/>
+ <enum name="TEXTURE25_ARB" value="0x84D9"/>
+ <enum name="TEXTURE26_ARB" value="0x84DA"/>
+ <enum name="TEXTURE27_ARB" value="0x84DB"/>
+ <enum name="TEXTURE28_ARB" value="0x84DC"/>
+ <enum name="TEXTURE29_ARB" value="0x84DD"/>
+ <enum name="TEXTURE30_ARB" value="0x84DE"/>
+ <enum name="TEXTURE31_ARB" value="0x84DF"/>
+ <enum name="ACTIVE_TEXTURE_ARB" count="1" value="0x84E0">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="CLIENT_ACTIVE_TEXTURE_ARB" count="1" value="0x84E1">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="MAX_TEXTURE_UNITS_ARB" count="1" value="0x84E2">
+ <size name="Get" mode="get"/>
+ </enum>
+
+ <function name="ActiveTextureARB" offset="374">
+ <param name="texture" type="GLenum"/>
+ <glx rop="197"/>
+ </function>
+
+ <function name="ClientActiveTextureARB" offset="375">
+ <param name="texture" type="GLenum"/>
+ <glx handcode="true"/>
+ </function>
+
+ <function name="MultiTexCoord1dARB" offset="376" vectorequiv="MultiTexCoord1dvARB">
+ <param name="target" type="GLenum"/>
+ <param name="s" type="GLdouble"/>
+ </function>
+
+ <function name="MultiTexCoord1dvARB" offset="377">
+ <param name="target" type="GLenum"/>
+ <param name="v" type="const GLdouble *" count="1"/>
+ <glx rop="198"/>
+ </function>
+
+ <function name="MultiTexCoord1fARB" offset="378" vectorequiv="MultiTexCoord1fvARB">
+ <param name="target" type="GLenum"/>
+ <param name="s" type="GLfloat"/>
+ </function>
+
+ <function name="MultiTexCoord1fvARB" offset="379">
+ <param name="target" type="GLenum"/>
+ <param name="v" type="const GLfloat *" count="1"/>
+ <glx rop="199"/>
+ </function>
+
+ <function name="MultiTexCoord1iARB" offset="380" vectorequiv="MultiTexCoord1ivARB">
+ <param name="target" type="GLenum"/>
+ <param name="s" type="GLint"/>
+ </function>
+
+ <function name="MultiTexCoord1ivARB" offset="381">
+ <param name="target" type="GLenum"/>
+ <param name="v" type="const GLint *" count="1"/>
+ <glx rop="200"/>
+ </function>
+
+ <function name="MultiTexCoord1sARB" offset="382" vectorequiv="MultiTexCoord1svARB">
+ <param name="target" type="GLenum"/>
+ <param name="s" type="GLshort"/>
+ </function>
+
+ <function name="MultiTexCoord1svARB" offset="383">
+ <param name="target" type="GLenum"/>
+ <param name="v" type="const GLshort *" count="1"/>
+ <glx rop="201"/>
+ </function>
+
+ <function name="MultiTexCoord2dARB" offset="384" vectorequiv="MultiTexCoord2dvARB">
+ <param name="target" type="GLenum"/>
+ <param name="s" type="GLdouble"/>
+ <param name="t" type="GLdouble"/>
+ </function>
+
+ <function name="MultiTexCoord2dvARB" offset="385">
+ <param name="target" type="GLenum"/>
+ <param name="v" type="const GLdouble *" count="2"/>
+ <glx rop="202"/>
+ </function>
+
+ <function name="MultiTexCoord2fARB" offset="386" vectorequiv="MultiTexCoord2fvARB">
+ <param name="target" type="GLenum"/>
+ <param name="s" type="GLfloat"/>
+ <param name="t" type="GLfloat"/>
+ </function>
+
+ <function name="MultiTexCoord2fvARB" offset="387">
+ <param name="target" type="GLenum"/>
+ <param name="v" type="const GLfloat *" count="2"/>
+ <glx rop="203"/>
+ </function>
+
+ <function name="MultiTexCoord2iARB" offset="388" vectorequiv="MultiTexCoord2ivARB">
+ <param name="target" type="GLenum"/>
+ <param name="s" type="GLint"/>
+ <param name="t" type="GLint"/>
+ </function>
+
+ <function name="MultiTexCoord2ivARB" offset="389">
+ <param name="target" type="GLenum"/>
+ <param name="v" type="const GLint *" count="2"/>
+ <glx rop="204"/>
+ </function>
+
+ <function name="MultiTexCoord2sARB" offset="390" vectorequiv="MultiTexCoord2svARB">
+ <param name="target" type="GLenum"/>
+ <param name="s" type="GLshort"/>
+ <param name="t" type="GLshort"/>
+ </function>
+
+ <function name="MultiTexCoord2svARB" offset="391">
+ <param name="target" type="GLenum"/>
+ <param name="v" type="const GLshort *" count="2"/>
+ <glx rop="205"/>
+ </function>
+
+ <function name="MultiTexCoord3dARB" offset="392" vectorequiv="MultiTexCoord3dvARB">
+ <param name="target" type="GLenum"/>
+ <param name="s" type="GLdouble"/>
+ <param name="t" type="GLdouble"/>
+ <param name="r" type="GLdouble"/>
+ </function>
+
+ <function name="MultiTexCoord3dvARB" offset="393">
+ <param name="target" type="GLenum"/>
+ <param name="v" type="const GLdouble *" count="3"/>
+ <glx rop="206"/>
+ </function>
+
+ <function name="MultiTexCoord3fARB" offset="394" vectorequiv="MultiTexCoord3fvARB">
+ <param name="target" type="GLenum"/>
+ <param name="s" type="GLfloat"/>
+ <param name="t" type="GLfloat"/>
+ <param name="r" type="GLfloat"/>
+ </function>
+
+ <function name="MultiTexCoord3fvARB" offset="395">
+ <param name="target" type="GLenum"/>
+ <param name="v" type="const GLfloat *" count="3"/>
+ <glx rop="207"/>
+ </function>
+
+ <function name="MultiTexCoord3iARB" offset="396" vectorequiv="MultiTexCoord3ivARB">
+ <param name="target" type="GLenum"/>
+ <param name="s" type="GLint"/>
+ <param name="t" type="GLint"/>
+ <param name="r" type="GLint"/>
+ </function>
+
+ <function name="MultiTexCoord3ivARB" offset="397">
+ <param name="target" type="GLenum"/>
+ <param name="v" type="const GLint *" count="3"/>
+ <glx rop="208"/>
+ </function>
+
+ <function name="MultiTexCoord3sARB" offset="398" vectorequiv="MultiTexCoord3svARB">
+ <param name="target" type="GLenum"/>
+ <param name="s" type="GLshort"/>
+ <param name="t" type="GLshort"/>
+ <param name="r" type="GLshort"/>
+ </function>
+
+ <function name="MultiTexCoord3svARB" offset="399">
+ <param name="target" type="GLenum"/>
+ <param name="v" type="const GLshort *" count="3"/>
+ <glx rop="209"/>
+ </function>
+
+ <function name="MultiTexCoord4dARB" offset="400" vectorequiv="MultiTexCoord4dvARB">
+ <param name="target" type="GLenum"/>
+ <param name="s" type="GLdouble"/>
+ <param name="t" type="GLdouble"/>
+ <param name="r" type="GLdouble"/>
+ <param name="q" type="GLdouble"/>
+ </function>
+
+ <function name="MultiTexCoord4dvARB" offset="401">
+ <param name="target" type="GLenum"/>
+ <param name="v" type="const GLdouble *" count="4"/>
+ <glx rop="210"/>
+ </function>
+
+ <function name="MultiTexCoord4fARB" offset="402" vectorequiv="MultiTexCoord4fvARB">
+ <param name="target" type="GLenum"/>
+ <param name="s" type="GLfloat"/>
+ <param name="t" type="GLfloat"/>
+ <param name="r" type="GLfloat"/>
+ <param name="q" type="GLfloat"/>
+ </function>
+
+ <function name="MultiTexCoord4fvARB" offset="403">
+ <param name="target" type="GLenum"/>
+ <param name="v" type="const GLfloat *" count="4"/>
+ <glx rop="211"/>
+ </function>
+
+ <function name="MultiTexCoord4iARB" offset="404" vectorequiv="MultiTexCoord4ivARB">
+ <param name="target" type="GLenum"/>
+ <param name="s" type="GLint"/>
+ <param name="t" type="GLint"/>
+ <param name="r" type="GLint"/>
+ <param name="q" type="GLint"/>
+ </function>
+
+ <function name="MultiTexCoord4ivARB" offset="405">
+ <param name="target" type="GLenum"/>
+ <param name="v" type="const GLint *" count="4"/>
+ <glx rop="212"/>
+ </function>
+
+ <function name="MultiTexCoord4sARB" offset="406" vectorequiv="MultiTexCoord4svARB">
+ <param name="target" type="GLenum"/>
+ <param name="s" type="GLshort"/>
+ <param name="t" type="GLshort"/>
+ <param name="r" type="GLshort"/>
+ <param name="q" type="GLshort"/>
+ </function>
+
+ <function name="MultiTexCoord4svARB" offset="407">
+ <param name="target" type="GLenum"/>
+ <param name="v" type="const GLshort *" count="4"/>
+ <glx rop="213"/>
+ </function>
+</category>
+
+<!-- ARB extension number 2 is a GLX extension. -->
+
+<category name="GL_ARB_transpose_matrix" number="3">
+ <enum name="TRANSPOSE_MODELVIEW_MATRIX_ARB" value="0x84E3"/>
+ <enum name="TRANSPOSE_PROJECTION_MATRIX_ARB" value="0x84E4"/>
+ <enum name="TRANSPOSE_TEXTURE_MATRIX_ARB" value="0x84E5"/>
+ <enum name="TRANSPOSE_COLOR_MATRIX_ARB" value="0x84E6"/>
+
+ <function name="LoadTransposeMatrixfARB" offset="assign">
+ <param name="m" type="const GLfloat *"/>
+ <glx handcode="true"/>
+ </function>
+
+ <function name="LoadTransposeMatrixdARB" offset="assign">
+ <param name="m" type="const GLdouble *"/>
+ <glx handcode="true"/>
+ </function>
+
+ <function name="MultTransposeMatrixfARB" offset="assign">
+ <param name="m" type="const GLfloat *"/>
+ <glx handcode="true"/>
+ </function>
+
+ <function name="MultTransposeMatrixdARB" offset="assign">
+ <param name="m" type="const GLdouble *"/>
+ <glx handcode="true"/>
+ </function>
+</category>
+
+<!-- ARB extension number 4 is a WGL extension. -->
+
+<category name="GL_ARB_multisample" number="5">
+ <enum name="MULTISAMPLE_ARB" count="1" value="0x809D">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="SAMPLE_ALPHA_TO_COVERAGE_ARB" count="1" value="0x809E">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="SAMPLE_ALPHA_TO_ONE_ARB" count="1" value="0x809F">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="SAMPLE_COVERAGE_ARB" count="1" value="0x80A0">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="SAMPLE_BUFFERS_ARB" count="1" value="0x80A8">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="SAMPLES_ARB" count="1" value="0x80A9">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="SAMPLE_COVERAGE_VALUE_ARB" count="1" value="0x80AA">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="SAMPLE_COVERAGE_INVERT_ARB" count="1" value="0x80AB">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="MULTISAMPLE_BIT_ARB" value="0x20000000"/>
+
+ <function name="SampleCoverageARB" offset="assign">
+ <param name="value" type="GLclampf"/>
+ <param name="invert" type="GLboolean"/>
+ <glx rop="229"/>
+ </function>
+</category>
+
+<category name="GL_ARB_texture_env_add" number="6">
+ <!-- No new functions, types, enums. -->
+</category>
+
+<category name="GL_ARB_texture_cube_map" number="7">
+ <enum name="NORMAL_MAP_ARB" value="0x8511"/>
+ <enum name="REFLECTION_MAP_ARB" value="0x8512"/>
+ <enum name="TEXTURE_CUBE_MAP_ARB" count="1" value="0x8513">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="TEXTURE_BINDING_CUBE_MAP_ARB" count="1" value="0x8514">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="TEXTURE_CUBE_MAP_POSITIVE_X_ARB" value="0x8515"/>
+ <enum name="TEXTURE_CUBE_MAP_NEGATIVE_X_ARB" value="0x8516"/>
+ <enum name="TEXTURE_CUBE_MAP_POSITIVE_Y_ARB" value="0x8517"/>
+ <enum name="TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB" value="0x8518"/>
+ <enum name="TEXTURE_CUBE_MAP_POSITIVE_Z_ARB" value="0x8519"/>
+ <enum name="TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB" value="0x851A"/>
+ <enum name="PROXY_TEXTURE_CUBE_MAP_ARB" value="0x851B"/>
+ <enum name="MAX_CUBE_MAP_TEXTURE_SIZE_ARB" count="1" value="0x851C">
+ <size name="Get" mode="get"/>
+ </enum>
+</category>
+
+<!-- ARB extension number 8 is a WGL extension. -->
+<!-- ARB extension number 9 is a WGL extension. -->
+<!-- ARB extension number 10 is a WGL extension. -->
+<!-- ARB extension number 11 is a WGL extension. -->
+
+<category name="GL_ARB_texture_compression" number="12">
+ <enum name="COMPRESSED_ALPHA_ARB" value="0x84E9"/>
+ <enum name="COMPRESSED_LUMINANCE_ARB" value="0x84EA"/>
+ <enum name="COMPRESSED_LUMINANCE_ALPHA_ARB" value="0x84EB"/>
+ <enum name="COMPRESSED_INTENSITY_ARB" value="0x84EC"/>
+ <enum name="COMPRESSED_RGB_ARB" value="0x84ED"/>
+ <enum name="COMPRESSED_RGBA_ARB" value="0x84EE"/>
+ <enum name="TEXTURE_COMPRESSION_HINT_ARB" count="1" value="0x84EF">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="TEXTURE_COMPRESSED_IMAGE_SIZE_ARB" count="1" value="0x86A0">
+ <size name="GetTexLevelParameterfv" mode="get"/>
+ <size name="GetTexLevelParameteriv" mode="get"/>
+ </enum>
+ <enum name="TEXTURE_COMPRESSED_ARB" count="1" value="0x86A1">
+ <size name="GetTexLevelParameterfv" mode="get"/>
+ <size name="GetTexLevelParameteriv" mode="get"/>
+ </enum>
+ <enum name="NUM_COMPRESSED_TEXTURE_FORMATS_ARB" count="1" value="0x86A2">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="TEXTURE_COMPRESSED_FORMATS_ARB" value="0x86A3"/>
+
+ <function name="CompressedTexImage3DARB" offset="assign">
+ <param name="target" type="GLenum"/>
+ <param name="level" type="GLint"/>
+ <param name="internalformat" type="GLenum"/>
+ <param name="width" type="GLsizei"/>
+ <param name="height" type="GLsizei"/>
+ <param name="depth" type="GLsizei"/>
+ <param name="border" type="GLint"/>
+ <param name="imageSize" type="GLsizei" counter="true"/>
+ <param name="data" type="const GLvoid *" count="imageSize"/>
+ <glx rop="216" handcode="client"/>
+ </function>
+
+ <function name="CompressedTexImage2DARB" offset="assign">
+ <param name="target" type="GLenum"/>
+ <param name="level" type="GLint"/>
+ <param name="internalformat" type="GLenum"/>
+ <param name="width" type="GLsizei"/>
+ <param name="height" type="GLsizei"/>
+ <param name="border" type="GLint"/>
+ <param name="imageSize" type="GLsizei" counter="true"/>
+ <param name="data" type="const GLvoid *" count="imageSize"/>
+ <glx rop="215" handcode="client"/>
+ </function>
+
+ <function name="CompressedTexImage1DARB" offset="assign">
+ <param name="target" type="GLenum"/>
+ <param name="level" type="GLint"/>
+ <param name="internalformat" type="GLenum"/>
+ <param name="width" type="GLsizei"/>
+ <param name="border" type="GLint"/>
+ <param name="imageSize" type="GLsizei" counter="true"/>
+ <param name="data" type="const GLvoid *" count="imageSize"/>
+ <glx rop="214" handcode="client"/>
+ </function>
+
+ <function name="CompressedTexSubImage3DARB" offset="assign">
+ <param name="target" type="GLenum"/>
+ <param name="level" type="GLint"/>
+ <param name="xoffset" type="GLint"/>
+ <param name="yoffset" type="GLint"/>
+ <param name="zoffset" type="GLint"/>
+ <param name="width" type="GLsizei"/>
+ <param name="height" type="GLsizei"/>
+ <param name="depth" type="GLsizei"/>
+ <param name="format" type="GLenum"/>
+ <param name="imageSize" type="GLsizei" counter="true"/>
+ <param name="data" type="const GLvoid *" count="imageSize"/>
+ <glx rop="219" handcode="client"/>
+ </function>
+
+ <function name="CompressedTexSubImage2DARB" offset="assign">
+ <param name="target" type="GLenum"/>
+ <param name="level" type="GLint"/>
+ <param name="xoffset" type="GLint"/>
+ <param name="yoffset" type="GLint"/>
+ <param name="width" type="GLsizei"/>
+ <param name="height" type="GLsizei"/>
+ <param name="format" type="GLenum"/>
+ <param name="imageSize" type="GLsizei" counter="true"/>
+ <param name="data" type="const GLvoid *" count="imageSize"/>
+ <glx rop="218" handcode="client"/>
+ </function>
+
+ <function name="CompressedTexSubImage1DARB" offset="assign">
+ <param name="target" type="GLenum"/>
+ <param name="level" type="GLint"/>
+ <param name="xoffset" type="GLint"/>
+ <param name="width" type="GLsizei"/>
+ <param name="format" type="GLenum"/>
+ <param name="imageSize" type="GLsizei" counter="true"/>
+ <param name="data" type="const GLvoid *" count="imageSize"/>
+ <glx rop="217" handcode="client"/>
+ </function>
+
+ <function name="GetCompressedTexImageARB" offset="assign">
+ <param name="target" type="GLenum"/>
+ <param name="level" type="GLint"/>
+ <param name="img" type="GLvoid *" output="true"/>
+
+ <!-- This has to be hand coded because the image size is in the
+ "wrong" place. Technically, this should be a
+ 'always_array="true"' case. The size field in the reply would
+ be at offset 12. However, the size is actually at offset 16.
+ This is where the 'width' is in a GetTexImage reply. -->
+ <glx sop="160" handcode="true"/>
+ </function>
+</category>
+
+<category name="GL_ARB_texture_border_clamp" number="13">
+ <enum name="CLAMP_TO_BORDER_ARB" value="0x812D"/>
+</category>
+
+<category name="GL_ARB_point_parameters" number="14">
+ <enum name="POINT_SIZE_MIN_ARB" count="1" value="0x8126">
+ <size name="PointParameterfvEXT" mode="get"/>
+ </enum>
+ <enum name="POINT_SIZE_MAX_ARB" count="1" value="0x8127">
+ <size name="PointParameterfvEXT" mode="get"/>
+ </enum>
+ <enum name="POINT_FADE_THRESHOLD_SIZE_ARB" count="1" value="0x8128">
+ <size name="PointParameterfvEXT" mode="get"/>
+ </enum>
+ <enum name="POINT_DISTANCE_ATTENUATION_ARB" count="3" value="0x8129">
+ <size name="PointParameterfvEXT" mode="get"/>
+ </enum>
+
+ <function name="PointParameterfARB" alias="PointParameterfEXT">
+ <param name="pname" type="GLenum"/>
+ <param name="param" type="GLfloat"/>
+ <glx rop="2065"/>
+ </function>
+
+ <function name="PointParameterfvARB" alias="PointParameterfvEXT">
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="const GLfloat *" variable_param="pname"/>
+ <glx rop="2066"/>
+ </function>
+</category>
+
+<category name="GL_ARB_vertex_blend" number="15">
+ <enum name="MAX_VERTEX_UNITS_ARB" count="1" value="0x86A4">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="ACTIVE_VERTEX_UNITS_ARB" count="1" value="0x86A5">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="WEIGHT_SUM_UNITY_ARB" count="1" value="0x86A6">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="VERTEX_BLEND_ARB" count="1" value="0x86A7">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="CURRENT_WEIGHT_ARB" count="1" value="0x86A8">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="WEIGHT_ARRAY_TYPE_ARB" count="1" value="0x86A9">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="WEIGHT_ARRAY_STRIDE_ARB" count="1" value="0x86AA">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="WEIGHT_ARRAY_SIZE_ARB" count="1" value="0x86AB">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="WEIGHT_ARRAY_POINTER_ARB" value="0x86AC"/>
+ <enum name="WEIGHT_ARRAY_ARB" count="1" value="0x86AD">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="MODELVIEW0_ARB" count="16" value="0x1700">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="MODELVIEW1_ARB" count="16" value="0x850A">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="MODELVIEW2_ARB" count="16" value="0x8722">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="MODELVIEW3_ARB" count="16" value="0x8723">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="MODELVIEW4_ARB" count="16" value="0x8724">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="MODELVIEW5_ARB" count="16" value="0x8725">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="MODELVIEW6_ARB" count="16" value="0x8726">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="MODELVIEW7_ARB" count="16" value="0x8727">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="MODELVIEW8_ARB" count="16" value="0x8728">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="MODELVIEW9_ARB" count="16" value="0x8729">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="MODELVIEW10_ARB" count="16" value="0x872A">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="MODELVIEW11_ARB" count="16" value="0x872B">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="MODELVIEW12_ARB" count="16" value="0x872C">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="MODELVIEW13_ARB" count="16" value="0x872D">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="MODELVIEW14_ARB" count="16" value="0x872E">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="MODELVIEW15_ARB" count="16" value="0x872F">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="MODELVIEW16_ARB" count="16" value="0x8730">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="MODELVIEW17_ARB" count="16" value="0x8731">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="MODELVIEW18_ARB" count="16" value="0x8732">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="MODELVIEW19_ARB" count="16" value="0x8733">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="MODELVIEW20_ARB" count="16" value="0x8734">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="MODELVIEW21_ARB" count="16" value="0x8735">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="MODELVIEW22_ARB" count="16" value="0x8736">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="MODELVIEW23_ARB" count="16" value="0x8737">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="MODELVIEW24_ARB" count="16" value="0x8738">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="MODELVIEW25_ARB" count="16" value="0x8739">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="MODELVIEW26_ARB" count="16" value="0x873A">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="MODELVIEW27_ARB" count="16" value="0x873B">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="MODELVIEW28_ARB" count="16" value="0x873C">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="MODELVIEW29_ARB" count="16" value="0x873D">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="MODELVIEW30_ARB" count="16" value="0x873E">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="MODELVIEW31_ARB" count="16" value="0x873F">
+ <size name="Get" mode="get"/>
+ </enum>
+
+ <function name="WeightbvARB">
+ <param name="size" type="GLint"/>
+ <param name="weights" type="const GLbyte *"/>
+ </function>
+
+ <function name="WeightsvARB">
+ <param name="size" type="GLint"/>
+ <param name="weights" type="const GLshort *"/>
+ </function>
+
+ <function name="WeightivARB">
+ <param name="size" type="GLint"/>
+ <param name="weights" type="const GLint *"/>
+ </function>
+
+ <function name="WeightfvARB">
+ <param name="size" type="GLint"/>
+ <param name="weights" type="const GLfloat *"/>
+ </function>
+
+ <function name="WeightdvARB">
+ <param name="size" type="GLint"/>
+ <param name="weights" type="const GLdouble *"/>
+ </function>
+
+ <function name="WeightubvARB">
+ <param name="size" type="GLint"/>
+ <param name="weights" type="const GLubyte *"/>
+ </function>
+
+ <function name="WeightusvARB">
+ <param name="size" type="GLint"/>
+ <param name="weights" type="const GLushort *"/>
+ </function>
+
+ <function name="WeightuivARB">
+ <param name="size" type="GLint"/>
+ <param name="weights" type="const GLuint *"/>
+ </function>
+
+ <function name="WeightPointerARB">
+ <param name="size" type="GLint"/>
+ <param name="type" type="GLenum"/>
+ <param name="stride" type="GLsizei"/>
+ <param name="pointer" type="const GLvoid *"/>
+ <glx handcode="true"/>
+ </function>
+
+ <function name="VertexBlendARB">
+ <param name="count" type="GLint"/>
+ </function>
+</category>
+
+<category name="GL_ARB_matrix_palette" number="16">
+ <enum name="MATRIX_PALETTE_ARB" count="1" value="0x8840">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="MAX_MATRIX_PALETTE_STACK_DEPTH_ARB" count="1" value="0x8841">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="MAX_PALETTE_MATRICES_ARB" count="1" value="0x8842">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="CURRENT_PALETTE_MATRIX_ARB" count="1" value="0x8843">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="MATRIX_INDEX_ARRAY_ARB" count="1" value="0x8844">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="CURRENT_MATRIX_INDEX_ARB" count="1" value="0x8845">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="MATRIX_INDEX_ARRAY_SIZE_ARB" count="1" value="0x8846">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="MATRIX_INDEX_ARRAY_TYPE_ARB" count="1" value="0x8847">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="MATRIX_INDEX_ARRAY_STRIDE_ARB" count="1" value="0x8848">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="MATRIX_INDEX_ARRAY_POINTER_ARB" value="0x8849"/>
+
+ <function name="CurrentPaletteMatrixARB">
+ <param name="index" type="GLint"/>
+ <glx ignore="true" rop="4329"/>
+ </function>
+
+ <function name="MatrixIndexubvARB">
+ <param name="size" type="GLint" counter="true"/>
+ <param name="indices" type="const GLubyte *" count="size"/>
+ <glx ignore="true" rop="4326"/>
+ </function>
+
+ <function name="MatrixIndexusvARB">
+ <param name="size" type="GLint" counter="true"/>
+ <param name="indices" type="const GLushort *" count="size"/>
+ <glx ignore="true" rop="4327"/>
+ </function>
+
+ <function name="MatrixIndexuivARB">
+ <param name="size" type="GLint" counter="true"/>
+ <param name="indices" type="const GLuint *" count="size"/>
+ <glx ignore="true" rop="4328"/>
+ </function>
+
+ <function name="MatrixIndexPointerARB">
+ <param name="size" type="GLint"/>
+ <param name="type" type="GLenum"/>
+ <param name="stride" type="GLsizei"/>
+ <param name="pointer" type="const GLvoid *"/>
+ <glx handcode="true"/>
+ </function>
+</category>
+
+<category name="GL_ARB_texture_env_combine" number="17">
+ <enum name="COMBINE_ARB" value="0x8570"/>
+ <enum name="COMBINE_RGB_ARB" value="0x8571"/>
+ <enum name="COMBINE_ALPHA_ARB" value="0x8572"/>
+ <enum name="SOURCE0_RGB_ARB" value="0x8580"/>
+ <enum name="SOURCE1_RGB_ARB" value="0x8581"/>
+ <enum name="SOURCE2_RGB_ARB" value="0x8582"/>
+ <enum name="SOURCE0_ALPHA_ARB" value="0x8588"/>
+ <enum name="SOURCE1_ALPHA_ARB" value="0x8589"/>
+ <enum name="SOURCE2_ALPHA_ARB" value="0x858A"/>
+ <enum name="OPERAND0_RGB_ARB" value="0x8590"/>
+ <enum name="OPERAND1_RGB_ARB" value="0x8591"/>
+ <enum name="OPERAND2_RGB_ARB" value="0x8592"/>
+ <enum name="OPERAND0_ALPHA_ARB" value="0x8598"/>
+ <enum name="OPERAND1_ALPHA_ARB" value="0x8599"/>
+ <enum name="OPERAND2_ALPHA_ARB" value="0x859A"/>
+ <enum name="RGB_SCALE_ARB" value="0x8573"/>
+ <enum name="ADD_SIGNED_ARB" value="0x8574"/>
+ <enum name="INTERPOLATE_ARB" value="0x8575"/>
+ <enum name="SUBTRACT_ARB" value="0x84E7"/>
+ <enum name="CONSTANT_ARB" value="0x8576"/>
+ <enum name="PRIMARY_COLOR_ARB" value="0x8577"/>
+ <enum name="PREVIOUS_ARB" value="0x8578"/>
+</category>
+
+<category name="GL_ARB_texture_env_crossbar" number="18">
+ <!-- No new functions, types, enums. -->
+</category>
+
+<category name="GL_ARB_texture_env_dot3" number="19">
+ <enum name="DOT3_RGB_ARB" value="0x86AE"/>
+ <enum name="DOT3_RGBA_ARB" value="0x86AF"/>
+</category>
+
+<!-- ARB extension number 20 is a WGL extension. -->
+
+<category name="GL_ARB_texture_mirrored_repeat" number="21">
+ <enum name="MIRRORED_REPEAT_ARB" value="0x8370"/>
+</category>
+
+<category name="GL_ARB_depth_texture" number="22">
+ <enum name="DEPTH_COMPONENT16_ARB" value="0x81A5"/>
+ <enum name="DEPTH_COMPONENT24_ARB" value="0x81A6"/>
+ <enum name="DEPTH_COMPONENT32_ARB" value="0x81A7"/>
+ <enum name="TEXTURE_DEPTH_SIZE_ARB" count="1" value="0x884A">
+ <size name="GetTexLevelParameterfv" mode="get"/>
+ <size name="GetTexLevelParameteriv" mode="get"/>
+ </enum>
+ <enum name="DEPTH_TEXTURE_MODE_ARB" count="1" value="0x884B">
+ <size name="TexParameterfv" mode="get"/>
+ <size name="TexParameteriv" mode="get"/>
+ <size name="GetTexParameterfv" mode="get"/>
+ <size name="GetTexParameteriv" mode="get"/>
+ </enum>
+</category>
+
+<category name="GL_ARB_shadow" number="23">
+ <enum name="TEXTURE_COMPARE_MODE_ARB" count="1" value="0x884C">
+ <size name="TexParameterfv" mode="get"/>
+ <size name="TexParameteriv" mode="get"/>
+ <size name="GetTexParameterfv" mode="get"/>
+ <size name="GetTexParameteriv" mode="get"/>
+ </enum>
+ <enum name="TEXTURE_COMPARE_FUNC_ARB" count="1" value="0x884D">
+ <size name="TexParameterfv" mode="get"/>
+ <size name="TexParameteriv" mode="get"/>
+ <size name="GetTexParameterfv" mode="get"/>
+ <size name="GetTexParameteriv" mode="get"/>
+ </enum>
+ <enum name="COMPARE_R_TO_TEXTURE_ARB" value="0x884E"/>
+</category>
+
+<category name="GL_ARB_shadow_ambient" number="24">
+ <enum name="TEXTURE_COMPARE_FAIL_VALUE_ARB" count="1" value="0x80BF">
+ <size name="TexParameterfv" mode="get"/>
+ <size name="TexParameteriv" mode="get"/>
+ <size name="GetTexParameterfv" mode="get"/>
+ <size name="GetTexParameteriv" mode="get"/>
+ </enum>
+</category>
+
+<category name="GL_ARB_window_pos" number="25">
+ <function name="WindowPos2dARB" alias="WindowPos2dMESA">
+ <param name="x" type="GLdouble"/>
+ <param name="y" type="GLdouble"/>
+ </function>
+
+ <function name="WindowPos2fARB" alias="WindowPos2fMESA">
+ <param name="x" type="GLfloat"/>
+ <param name="y" type="GLfloat"/>
+ </function>
+
+ <function name="WindowPos2iARB" alias="WindowPos2iMESA">
+ <param name="x" type="GLint"/>
+ <param name="y" type="GLint"/>
+ </function>
+
+ <function name="WindowPos2sARB" alias="WindowPos2sMESA">
+ <param name="x" type="GLshort"/>
+ <param name="y" type="GLshort"/>
+ </function>
+
+ <function name="WindowPos2dvARB" alias="WindowPos2dvMESA">
+ <param name="v" type="const GLdouble *"/>
+ </function>
+
+ <function name="WindowPos2fvARB" alias="WindowPos2fvMESA">
+ <param name="v" type="const GLfloat *"/>
+ </function>
+
+ <function name="WindowPos2ivARB" alias="WindowPos2ivMESA">
+ <param name="v" type="const GLint *"/>
+ </function>
+
+ <function name="WindowPos2svARB" alias="WindowPos2svMESA">
+ <param name="v" type="const GLshort *"/>
+ </function>
+
+ <function name="WindowPos3dARB" alias="WindowPos3dMESA">
+ <param name="x" type="GLdouble"/>
+ <param name="y" type="GLdouble"/>
+ <param name="z" type="GLdouble"/>
+ </function>
+
+ <function name="WindowPos3fARB" alias="WindowPos3fMESA">
+ <param name="x" type="GLfloat"/>
+ <param name="y" type="GLfloat"/>
+ <param name="z" type="GLfloat"/>
+ </function>
+
+ <function name="WindowPos3iARB" alias="WindowPos3iMESA">
+ <param name="x" type="GLint"/>
+ <param name="y" type="GLint"/>
+ <param name="z" type="GLint"/>
+ </function>
+
+ <function name="WindowPos3sARB" alias="WindowPos3sMESA">
+ <param name="x" type="GLshort"/>
+ <param name="y" type="GLshort"/>
+ <param name="z" type="GLshort"/>
+ </function>
+
+ <function name="WindowPos3dvARB" alias="WindowPos3dvMESA">
+ <param name="v" type="const GLdouble *"/>
+ </function>
+
+ <function name="WindowPos3fvARB" alias="WindowPos3fvMESA">
+ <param name="v" type="const GLfloat *"/>
+ </function>
+
+ <function name="WindowPos3ivARB" alias="WindowPos3ivMESA">
+ <param name="v" type="const GLint *"/>
+ </function>
+
+ <function name="WindowPos3svARB" alias="WindowPos3svMESA">
+ <param name="v" type="const GLshort *"/>
+ </function>
+</category>
+
+<category name="GL_ARB_vertex_program" number="26">
+ <enum name="COLOR_SUM_ARB" count="1" value="0x8458">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="VERTEX_PROGRAM_ARB" count="1" value="0x8620">
+ <size name="GetVertexAttribdvARB" mode="get"/>
+ <size name="GetVertexAttribfvARB" mode="get"/>
+ <size name="GetVertexAttribivARB" mode="get"/>
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="VERTEX_ATTRIB_ARRAY_ENABLED_ARB" count="1" value="0x8622">
+ <size name="GetVertexAttribdvARB" mode="get"/>
+ <size name="GetVertexAttribfvARB" mode="get"/>
+ <size name="GetVertexAttribivARB" mode="get"/>
+ </enum>
+ <enum name="VERTEX_ATTRIB_ARRAY_SIZE_ARB" count="1" value="0x8623">
+ <size name="GetVertexAttribdvARB" mode="get"/>
+ <size name="GetVertexAttribfvARB" mode="get"/>
+ <size name="GetVertexAttribivARB" mode="get"/>
+ </enum>
+ <enum name="VERTEX_ATTRIB_ARRAY_STRIDE_ARB" count="1" value="0x8624">
+ <size name="GetVertexAttribdvARB" mode="get"/>
+ <size name="GetVertexAttribfvARB" mode="get"/>
+ <size name="GetVertexAttribivARB" mode="get"/>
+ </enum>
+ <enum name="VERTEX_ATTRIB_ARRAY_TYPE_ARB" count="1" value="0x8625">
+ <size name="GetVertexAttribdvARB" mode="get"/>
+ <size name="GetVertexAttribfvARB" mode="get"/>
+ <size name="GetVertexAttribivARB" mode="get"/>
+ </enum>
+ <enum name="CURRENT_VERTEX_ATTRIB_ARB" count="1" value="0x8626">
+ <size name="GetVertexAttribdvARB" mode="get"/>
+ <size name="GetVertexAttribfvARB" mode="get"/>
+ <size name="GetVertexAttribivARB" mode="get"/>
+ </enum>
+ <enum name="PROGRAM_LENGTH_ARB" count="1" value="0x8627">
+ <size name="GetProgramivARB" mode="get"/>
+ </enum>
+ <enum name="PROGRAM_STRING_ARB" value="0x8628"/>
+ <enum name="MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB" count="1" value="0x862E">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="MAX_PROGRAM_MATRICES_ARB" count="1" value="0x862F">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="CURRENT_MATRIX_STACK_DEPTH_ARB" count="1" value="0x8640">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="CURRENT_MATRIX_ARB" count="16" value="0x8641">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="VERTEX_PROGRAM_POINT_SIZE_ARB" count="1" value="0x8642">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="VERTEX_PROGRAM_TWO_SIDE_ARB" count="1" value="0x8643">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="VERTEX_ATTRIB_ARRAY_POINTER_ARB" value="0x8645"/>
+ <enum name="PROGRAM_ERROR_POSITION_ARB" count="1" value="0x864B">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="PROGRAM_BINDING_ARB" count="1" value="0x8677">
+ <size name="GetProgramivARB" mode="get"/>
+ </enum>
+ <enum name="MAX_VERTEX_ATTRIBS_ARB" count="1" value="0x8869">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB" value="0x886A"/>
+ <enum name="PROGRAM_ERROR_STRING_ARB" value="0x8874"/>
+ <enum name="PROGRAM_FORMAT_ASCII_ARB" value="0x8875"/>
+ <enum name="PROGRAM_FORMAT_ARB" count="1" value="0x8876">
+ <size name="GetProgramivARB" mode="get"/>
+ </enum>
+ <enum name="PROGRAM_INSTRUCTIONS_ARB" count="1" value="0x88A0">
+ <size name="GetProgramivARB" mode="get"/>
+ </enum>
+ <enum name="MAX_PROGRAM_INSTRUCTIONS_ARB" count="1" value="0x88A1">
+ <size name="GetProgramivARB" mode="get"/>
+ </enum>
+ <enum name="PROGRAM_NATIVE_INSTRUCTIONS_ARB" count="1" value="0x88A2">
+ <size name="GetProgramivARB" mode="get"/>
+ </enum>
+ <enum name="MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB" count="1" value="0x88A3">
+ <size name="GetProgramivARB" mode="get"/>
+ </enum>
+ <enum name="PROGRAM_TEMPORARIES_ARB" count="1" value="0x88A4">
+ <size name="GetProgramivARB" mode="get"/>
+ </enum>
+ <enum name="MAX_PROGRAM_TEMPORARIES_ARB" count="1" value="0x88A5">
+ <size name="GetProgramivARB" mode="get"/>
+ </enum>
+ <enum name="PROGRAM_NATIVE_TEMPORARIES_ARB" count="1" value="0x88A6">
+ <size name="GetProgramivARB" mode="get"/>
+ </enum>
+ <enum name="MAX_PROGRAM_NATIVE_TEMPORARIES_ARB" count="1" value="0x88A7">
+ <size name="GetProgramivARB" mode="get"/>
+ </enum>
+ <enum name="PROGRAM_PARAMETERS_ARB" count="1" value="0x88A8">
+ <size name="GetProgramivARB" mode="get"/>
+ </enum>
+ <enum name="MAX_PROGRAM_PARAMETERS_ARB" count="1" value="0x88A9">
+ <size name="GetProgramivARB" mode="get"/>
+ </enum>
+ <enum name="PROGRAM_NATIVE_PARAMETERS_ARB" count="1" value="0x88AA">
+ <size name="GetProgramivARB" mode="get"/>
+ </enum>
+ <enum name="MAX_PROGRAM_NATIVE_PARAMETERS_ARB" count="1" value="0x88AB">
+ <size name="GetProgramivARB" mode="get"/>
+ </enum>
+ <enum name="PROGRAM_ATTRIBS_ARB" count="1" value="0x88AC">
+ <size name="GetProgramivARB" mode="get"/>
+ </enum>
+ <enum name="MAX_PROGRAM_ATTRIBS_ARB" count="1" value="0x88AD">
+ <size name="GetProgramivARB" mode="get"/>
+ </enum>
+ <enum name="PROGRAM_NATIVE_ATTRIBS_ARB" count="1" value="0x88AE">
+ <size name="GetProgramivARB" mode="get"/>
+ </enum>
+ <enum name="MAX_PROGRAM_NATIVE_ATTRIBS_ARB" count="1" value="0x88AF">
+ <size name="GetProgramivARB" mode="get"/>
+ </enum>
+ <enum name="PROGRAM_ADDRESS_REGISTERS_ARB" count="1" value="0x88B0">
+ <size name="GetProgramivARB" mode="get"/>
+ </enum>
+ <enum name="MAX_PROGRAM_ADDRESS_REGISTERS_ARB" count="1" value="0x88B1">
+ <size name="GetProgramivARB" mode="get"/>
+ </enum>
+ <enum name="PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB" count="1" value="0x88B2">
+ <size name="GetProgramivARB" mode="get"/>
+ </enum>
+ <enum name="MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB" count="1" value="0x88B3">
+ <size name="GetProgramivARB" mode="get"/>
+ </enum>
+ <enum name="MAX_PROGRAM_LOCAL_PARAMETERS_ARB" count="1" value="0x88B4">
+ <size name="GetProgramivARB" mode="get"/>
+ </enum>
+ <enum name="MAX_PROGRAM_ENV_PARAMETERS_ARB" count="1" value="0x88B5">
+ <size name="GetProgramivARB" mode="get"/>
+ </enum>
+ <enum name="PROGRAM_UNDER_NATIVE_LIMITS_ARB" count="1" value="0x88B6">
+ <size name="GetProgramivARB" mode="get"/>
+ </enum>
+ <enum name="TRANSPOSE_CURRENT_MATRIX_ARB" count="16" value="0x88B7">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="MATRIX0_ARB" value="0x88C0"/>
+ <enum name="MATRIX1_ARB" value="0x88C1"/>
+ <enum name="MATRIX2_ARB" value="0x88C2"/>
+ <enum name="MATRIX3_ARB" value="0x88C3"/>
+ <enum name="MATRIX4_ARB" value="0x88C4"/>
+ <enum name="MATRIX5_ARB" value="0x88C5"/>
+ <enum name="MATRIX6_ARB" value="0x88C6"/>
+ <enum name="MATRIX7_ARB" value="0x88C7"/>
+ <enum name="MATRIX8_ARB" value="0x88C8"/>
+ <enum name="MATRIX9_ARB" value="0x88C9"/>
+ <enum name="MATRIX10_ARB" value="0x88CA"/>
+ <enum name="MATRIX11_ARB" value="0x88CB"/>
+ <enum name="MATRIX12_ARB" value="0x88CC"/>
+ <enum name="MATRIX13_ARB" value="0x88CD"/>
+ <enum name="MATRIX14_ARB" value="0x88CE"/>
+ <enum name="MATRIX15_ARB" value="0x88CF"/>
+ <enum name="MATRIX16_ARB" value="0x88D0"/>
+ <enum name="MATRIX17_ARB" value="0x88D1"/>
+ <enum name="MATRIX18_ARB" value="0x88D2"/>
+ <enum name="MATRIX19_ARB" value="0x88D3"/>
+ <enum name="MATRIX20_ARB" value="0x88D4"/>
+ <enum name="MATRIX21_ARB" value="0x88D5"/>
+ <enum name="MATRIX22_ARB" value="0x88D6"/>
+ <enum name="MATRIX23_ARB" value="0x88D7"/>
+ <enum name="MATRIX24_ARB" value="0x88D8"/>
+ <enum name="MATRIX25_ARB" value="0x88D9"/>
+ <enum name="MATRIX26_ARB" value="0x88DA"/>
+ <enum name="MATRIX27_ARB" value="0x88DB"/>
+ <enum name="MATRIX28_ARB" value="0x88DC"/>
+ <enum name="MATRIX29_ARB" value="0x88DD"/>
+ <enum name="MATRIX30_ARB" value="0x88DE"/>
+ <enum name="MATRIX31_ARB" value="0x88DF"/>
+
+ <function name="GetVertexAttribdvARB" offset="assign">
+ <param name="index" type="GLuint"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLdouble *" output="true" variable_param="pname"/>
+ <glx handcode="client" vendorpriv="1301"/>
+ </function>
+
+ <function name="GetVertexAttribfvARB" offset="assign">
+ <param name="index" type="GLuint"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLfloat *" output="true" variable_param="pname"/>
+ <glx handcode="client" vendorpriv="1302"/>
+ </function>
+
+ <function name="GetVertexAttribivARB" offset="assign">
+ <param name="index" type="GLuint"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLint *" output="true" variable_param="pname"/>
+ <glx handcode="client" vendorpriv="1303"/>
+ </function>
+
+ <function name="VertexAttrib1dARB" offset="assign" vectorequiv="VertexAttrib1dvARB">
+ <param name="index" type="GLuint"/>
+ <param name="x" type="GLdouble"/>
+ </function>
+
+ <function name="VertexAttrib1dvARB" offset="assign">
+ <param name="index" type="GLuint"/>
+ <param name="v" type="const GLdouble *" count="1"/>
+ <glx rop="4197" doubles_in_order="true"/>
+ </function>
+
+ <function name="VertexAttrib1fARB" offset="assign" vectorequiv="VertexAttrib1fvARB">
+ <param name="index" type="GLuint"/>
+ <param name="x" type="GLfloat"/>
+ </function>
+
+ <function name="VertexAttrib1fvARB" offset="assign">
+ <param name="index" type="GLuint"/>
+ <param name="v" type="const GLfloat *" count="1"/>
+ <glx rop="4193"/>
+ </function>
+
+ <function name="VertexAttrib1sARB" offset="assign" vectorequiv="VertexAttrib1svARB">
+ <param name="index" type="GLuint"/>
+ <param name="x" type="GLshort"/>
+ </function>
+
+ <function name="VertexAttrib1svARB" offset="assign">
+ <param name="index" type="GLuint"/>
+ <param name="v" type="const GLshort *" count="1"/>
+ <glx rop="4189"/>
+ </function>
+
+ <function name="VertexAttrib2dARB" offset="assign" vectorequiv="VertexAttrib2dvARB">
+ <param name="index" type="GLuint"/>
+ <param name="x" type="GLdouble"/>
+ <param name="y" type="GLdouble"/>
+ </function>
+
+ <function name="VertexAttrib2dvARB" offset="assign">
+ <param name="index" type="GLuint"/>
+ <param name="v" type="const GLdouble *" count="2"/>
+ <glx rop="4198" doubles_in_order="true"/>
+ </function>
+
+ <function name="VertexAttrib2fARB" offset="assign" vectorequiv="VertexAttrib2fvARB">
+ <param name="index" type="GLuint"/>
+ <param name="x" type="GLfloat"/>
+ <param name="y" type="GLfloat"/>
+ </function>
+
+ <function name="VertexAttrib2fvARB" offset="assign">
+ <param name="index" type="GLuint"/>
+ <param name="v" type="const GLfloat *" count="2"/>
+ <glx rop="4194"/>
+ </function>
+
+ <function name="VertexAttrib2sARB" offset="assign" vectorequiv="VertexAttrib2svARB">
+ <param name="index" type="GLuint"/>
+ <param name="x" type="GLshort"/>
+ <param name="y" type="GLshort"/>
+ </function>
+
+ <function name="VertexAttrib2svARB" offset="assign">
+ <param name="index" type="GLuint"/>
+ <param name="v" type="const GLshort *" count="2"/>
+ <glx rop="4190"/>
+ </function>
+
+ <function name="VertexAttrib3dARB" offset="assign" vectorequiv="VertexAttrib3dvARB">
+ <param name="index" type="GLuint"/>
+ <param name="x" type="GLdouble"/>
+ <param name="y" type="GLdouble"/>
+ <param name="z" type="GLdouble"/>
+ </function>
+
+ <function name="VertexAttrib3dvARB" offset="assign">
+ <param name="index" type="GLuint"/>
+ <param name="v" type="const GLdouble *" count="3"/>
+ <glx rop="4199" doubles_in_order="true"/>
+ </function>
+
+ <function name="VertexAttrib3fARB" offset="assign" vectorequiv="VertexAttrib3fvARB">
+ <param name="index" type="GLuint"/>
+ <param name="x" type="GLfloat"/>
+ <param name="y" type="GLfloat"/>
+ <param name="z" type="GLfloat"/>
+ </function>
+
+ <function name="VertexAttrib3fvARB" offset="assign">
+ <param name="index" type="GLuint"/>
+ <param name="v" type="const GLfloat *" count="3"/>
+ <glx rop="4195"/>
+ </function>
+
+ <function name="VertexAttrib3sARB" offset="assign" vectorequiv="VertexAttrib3svARB">
+ <param name="index" type="GLuint"/>
+ <param name="x" type="GLshort"/>
+ <param name="y" type="GLshort"/>
+ <param name="z" type="GLshort"/>
+ </function>
+
+ <function name="VertexAttrib3svARB" offset="assign">
+ <param name="index" type="GLuint"/>
+ <param name="v" type="const GLshort *" count="3"/>
+ <glx rop="4191"/>
+ </function>
+
+ <function name="VertexAttrib4dARB" offset="assign" vectorequiv="VertexAttrib4dvARB">
+ <param name="index" type="GLuint"/>
+ <param name="x" type="GLdouble"/>
+ <param name="y" type="GLdouble"/>
+ <param name="z" type="GLdouble"/>
+ <param name="w" type="GLdouble"/>
+ </function>
+
+ <function name="VertexAttrib4dvARB" offset="assign">
+ <param name="index" type="GLuint"/>
+ <param name="v" type="const GLdouble *" count="4"/>
+ <glx rop="4200" doubles_in_order="true"/>
+ </function>
+
+ <function name="VertexAttrib4fARB" offset="assign" vectorequiv="VertexAttrib4fvARB">
+ <param name="index" type="GLuint"/>
+ <param name="x" type="GLfloat"/>
+ <param name="y" type="GLfloat"/>
+ <param name="z" type="GLfloat"/>
+ <param name="w" type="GLfloat"/>
+ </function>
+
+ <function name="VertexAttrib4fvARB" offset="assign">
+ <param name="index" type="GLuint"/>
+ <param name="v" type="const GLfloat *" count="4"/>
+ <glx rop="4196"/>
+ </function>
+
+ <function name="VertexAttrib4sARB" offset="assign" vectorequiv="VertexAttrib4svARB">
+ <param name="index" type="GLuint"/>
+ <param name="x" type="GLshort"/>
+ <param name="y" type="GLshort"/>
+ <param name="z" type="GLshort"/>
+ <param name="w" type="GLshort"/>
+ </function>
+
+ <function name="VertexAttrib4svARB" offset="assign">
+ <param name="index" type="GLuint"/>
+ <param name="v" type="const GLshort *" count="4"/>
+ <glx rop="4192"/>
+ </function>
+
+ <function name="VertexAttrib4NubARB" offset="assign" vectorequiv="VertexAttrib4NubvARB">
+ <param name="index" type="GLuint"/>
+ <param name="x" type="GLubyte"/>
+ <param name="y" type="GLubyte"/>
+ <param name="z" type="GLubyte"/>
+ <param name="w" type="GLubyte"/>
+ </function>
+
+ <function name="VertexAttrib4NubvARB" offset="assign">
+ <param name="index" type="GLuint"/>
+ <param name="v" type="const GLubyte *" count="4"/>
+ <glx rop="4201"/>
+ </function>
+
+ <function name="VertexAttrib4bvARB" offset="assign">
+ <param name="index" type="GLuint"/>
+ <param name="v" type="const GLbyte *" count="4"/>
+ <glx rop="4230"/>
+ </function>
+
+ <function name="VertexAttrib4ivARB" offset="assign">
+ <param name="index" type="GLuint"/>
+ <param name="v" type="const GLint *" count="4"/>
+ <glx rop="4231"/>
+ </function>
+
+ <function name="VertexAttrib4ubvARB" offset="assign">
+ <param name="index" type="GLuint"/>
+ <param name="v" type="const GLubyte *" count="4"/>
+ <glx rop="4232"/>
+ </function>
+
+ <function name="VertexAttrib4usvARB" offset="assign">
+ <param name="index" type="GLuint"/>
+ <param name="v" type="const GLushort *" count="4"/>
+ <glx rop="4233"/>
+ </function>
+
+ <function name="VertexAttrib4uivARB" offset="assign">
+ <param name="index" type="GLuint"/>
+ <param name="v" type="const GLuint *" count="4"/>
+ <glx rop="4234"/>
+ </function>
+
+ <function name="VertexAttrib4NbvARB" offset="assign">
+ <param name="index" type="GLuint"/>
+ <param name="v" type="const GLbyte *" count="4"/>
+ <glx rop="4235"/>
+ </function>
+
+ <function name="VertexAttrib4NsvARB" offset="assign">
+ <param name="index" type="GLuint"/>
+ <param name="v" type="const GLshort *" count="4"/>
+ <glx rop="4236"/>
+ </function>
+
+ <function name="VertexAttrib4NivARB" offset="assign">
+ <param name="index" type="GLuint"/>
+ <param name="v" type="const GLint *" count="4"/>
+ <glx rop="4237"/>
+ </function>
+
+ <function name="VertexAttrib4NusvARB" offset="assign">
+ <param name="index" type="GLuint"/>
+ <param name="v" type="const GLushort *" count="4"/>
+ <glx rop="4238"/>
+ </function>
+
+ <function name="VertexAttrib4NuivARB" offset="assign">
+ <param name="index" type="GLuint"/>
+ <param name="v" type="const GLuint *" count="4"/>
+ <glx rop="4239"/>
+ </function>
+
+ <function name="VertexAttribPointerARB" offset="assign">
+ <param name="index" type="GLuint"/>
+ <param name="size" type="GLint"/>
+ <param name="type" type="GLenum"/>
+ <param name="normalized" type="GLboolean"/>
+ <param name="stride" type="GLsizei"/>
+ <param name="pointer" type="const GLvoid *"/>
+ <glx handcode="true"/>
+ </function>
+
+ <function name="EnableVertexAttribArrayARB" offset="assign">
+ <param name="index" type="GLuint"/>
+ <glx handcode="true"/>
+ </function>
+
+ <function name="DisableVertexAttribArrayARB" offset="assign">
+ <param name="index" type="GLuint"/>
+ <glx handcode="true"/>
+ </function>
+
+ <function name="ProgramStringARB" offset="assign">
+ <param name="target" type="GLenum"/>
+ <param name="format" type="GLenum"/>
+ <param name="len" type="GLsizei" counter="true"/>
+ <param name="string" type="const GLvoid *" count="len"/>
+ <glx rop="4217" large="true"/>
+ </function>
+
+ <function name="BindProgramARB" alias="BindProgramNV">
+ <param name="target" type="GLenum"/>
+ <param name="program" type="GLuint"/>
+ </function>
+
+ <function name="DeleteProgramsARB" alias="DeleteProgramsNV">
+ <param name="n" type="GLsizei"/>
+ <param name="programs" type="const GLuint *"/>
+ </function>
+
+ <function name="GenProgramsARB" alias="GenProgramsNV">
+ <param name="n" type="GLsizei" counter="true"/>
+ <param name="programs" type="GLuint *" output="true" count="n"/>
+ </function>
+
+ <function name="IsProgramARB" alias="IsProgramNV">
+ <param name="program" type="GLuint"/>
+ <return type="GLboolean"/>
+ </function>
+
+ <function name="ProgramEnvParameter4dARB" offset="assign" vectorequiv="ProgramEnvParameter4dvARB">
+ <param name="target" type="GLenum"/>
+ <param name="index" type="GLuint"/>
+ <param name="x" type="GLdouble"/>
+ <param name="y" type="GLdouble"/>
+ <param name="z" type="GLdouble"/>
+ <param name="w" type="GLdouble"/>
+ </function>
+
+ <function name="ProgramEnvParameter4dvARB" offset="assign">
+ <param name="target" type="GLenum"/>
+ <param name="index" type="GLuint"/>
+ <param name="params" type="const GLdouble *" count="4"/>
+ <glx rop="4185" doubles_in_order="true"/>
+ </function>
+
+ <function name="ProgramEnvParameter4fARB" offset="assign" vectorequiv="ProgramEnvParameter4fvARB">
+ <param name="target" type="GLenum"/>
+ <param name="index" type="GLuint"/>
+ <param name="x" type="GLfloat"/>
+ <param name="y" type="GLfloat"/>
+ <param name="z" type="GLfloat"/>
+ <param name="w" type="GLfloat"/>
+ </function>
+
+ <function name="ProgramEnvParameter4fvARB" offset="assign">
+ <param name="target" type="GLenum"/>
+ <param name="index" type="GLuint"/>
+ <param name="params" type="const GLfloat *" count="4"/>
+ <glx rop="4184"/>
+ </function>
+
+ <function name="ProgramLocalParameter4dARB" offset="assign" vectorequiv="ProgramLocalParameter4dvARB">
+ <param name="target" type="GLenum"/>
+ <param name="index" type="GLuint"/>
+ <param name="x" type="GLdouble"/>
+ <param name="y" type="GLdouble"/>
+ <param name="z" type="GLdouble"/>
+ <param name="w" type="GLdouble"/>
+ </function>
+
+ <function name="ProgramLocalParameter4dvARB" offset="assign">
+ <param name="target" type="GLenum"/>
+ <param name="index" type="GLuint"/>
+ <param name="params" type="const GLdouble *" count="4"/>
+ <glx rop="4216" doubles_in_order="true"/>
+ </function>
+
+ <function name="ProgramLocalParameter4fARB" offset="assign" vectorequiv="ProgramLocalParameter4fvARB">
+ <param name="target" type="GLenum"/>
+ <param name="index" type="GLuint"/>
+ <param name="x" type="GLfloat"/>
+ <param name="y" type="GLfloat"/>
+ <param name="z" type="GLfloat"/>
+ <param name="w" type="GLfloat"/>
+ </function>
+
+ <function name="ProgramLocalParameter4fvARB" offset="assign">
+ <param name="target" type="GLenum"/>
+ <param name="index" type="GLuint"/>
+ <param name="params" type="const GLfloat *" count="4"/>
+ <glx rop="4215"/>
+ </function>
+
+ <!-- The GetProgramEnvParameter[df]vARB are handcoded because there
+ is an extra CARD32 of padding after the "index" field. Originally,
+ GetProgranEnvParameter[df]vARB and GetProgramParameter[df]vNV
+ shared the same GLX protocol. The pad field was where the pname
+ parameter was in the NV functions. When this error was discovered
+ and fixed, there was already at least one implementation of
+ GLX protocol for ARB_vertex_program, but there were no
+ implementations of NV_vertex_program. The sollution was to renumber
+ the opcodes for NV_vertex_program and convert the unused field in
+ the ARB_vertex_program protocol to unused padding.
+ -->
+
+ <function name="GetProgramEnvParameterdvARB" offset="assign">
+ <param name="target" type="GLenum"/>
+ <param name="index" type="GLuint"/>
+ <param name="params" type="GLdouble *" output="true" count="4"/>
+ <glx vendorpriv="1297" handcode="client" doubles_in_order="true"/>
+ </function>
+
+ <function name="GetProgramEnvParameterfvARB" offset="assign">
+ <param name="target" type="GLenum"/>
+ <param name="index" type="GLuint"/>
+ <param name="params" type="GLfloat *" output="true" count="4"/>
+ <glx vendorpriv="1296" handcode="client"/>
+ </function>
+
+ <function name="GetProgramLocalParameterdvARB" offset="assign">
+ <param name="target" type="GLenum"/>
+ <param name="index" type="GLuint"/>
+ <param name="params" type="GLdouble *" output="true" count="4"/>
+ <glx vendorpriv="1306" handcode="client" doubles_in_order="true"/>
+ </function>
+
+ <function name="GetProgramLocalParameterfvARB" offset="assign">
+ <param name="target" type="GLenum"/>
+ <param name="index" type="GLuint"/>
+ <param name="params" type="GLfloat *" output="true" count="4"/>
+ <glx vendorpriv="1305" handcode="client"/>
+ </function>
+
+
+ <function name="GetProgramivARB" offset="assign">
+ <param name="target" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLint *" output="true" variable_param="pname"/>
+ <glx vendorpriv="1307"/>
+ </function>
+
+ <function name="GetProgramStringARB" offset="assign">
+ <param name="target" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="string" type="GLvoid *" output="true"/>
+ <glx vendorpriv="1308" handcode="server" always_array="true"/>
+ </function>
+
+ <function name="GetVertexAttribPointervARB" alias="GetVertexAttribPointervNV">
+ <param name="index" type="GLuint"/>
+ <param name="pname" type="GLenum"/>
+ <param name="pointer" type="GLvoid **" output="true"/>
+ </function>
+</category>
+
+<category name="GL_ARB_fragment_program" number="27">
+ <enum name="FRAGMENT_PROGRAM_ARB" count="1" value="0x8804">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="PROGRAM_ALU_INSTRUCTIONS_ARB" count="1" value="0x8805">
+ <size name="GetProgramivARB" mode="get"/>
+ </enum>
+ <enum name="PROGRAM_TEX_INSTRUCTIONS_ARB" count="1" value="0x8806">
+ <size name="GetProgramivARB" mode="get"/>
+ </enum>
+ <enum name="PROGRAM_TEX_INDIRECTIONS_ARB" count="1" value="0x8807">
+ <size name="GetProgramivARB" mode="get"/>
+ </enum>
+ <enum name="PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB" count="1" value="0x8808">
+ <size name="GetProgramivARB" mode="get"/>
+ </enum>
+ <enum name="PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB" count="1" value="0x8809">
+ <size name="GetProgramivARB" mode="get"/>
+ </enum>
+ <enum name="PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB" count="1" value="0x880A">
+ <size name="GetProgramivARB" mode="get"/>
+ </enum>
+ <enum name="MAX_PROGRAM_ALU_INSTRUCTIONS_ARB" count="1" value="0x880B">
+ <size name="GetProgramivARB" mode="get"/>
+ </enum>
+ <enum name="MAX_PROGRAM_TEX_INSTRUCTIONS_ARB" count="1" value="0x880C">
+ <size name="GetProgramivARB" mode="get"/>
+ </enum>
+ <enum name="MAX_PROGRAM_TEX_INDIRECTIONS_ARB" count="1" value="0x880D">
+ <size name="GetProgramivARB" mode="get"/>
+ </enum>
+ <enum name="MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB" count="1" value="0x880E">
+ <size name="GetProgramivARB" mode="get"/>
+ </enum>
+ <enum name="MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB" count="1" value="0x880F">
+ <size name="GetProgramivARB" mode="get"/>
+ </enum>
+ <enum name="MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB" count="1" value="0x8810">
+ <size name="GetProgramivARB" mode="get"/>
+ </enum>
+ <enum name="MAX_TEXTURE_COORDS_ARB" count="1" value="0x8871">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="MAX_TEXTURE_IMAGE_UNITS_ARB" count="1" value="0x8872">
+ <size name="Get" mode="get"/>
+ </enum>
+</category>
+
+<category name="GL_ARB_vertex_buffer_object" number="28">
+ <enum name="BUFFER_SIZE_ARB" count="1" value="0x8764">
+ <size name="GetBufferParameterivARB" mode="get"/>
+ </enum>
+ <enum name="BUFFER_USAGE_ARB" count="1" value="0x8765">
+ <size name="GetBufferParameterivARB" mode="get"/>
+ </enum>
+ <enum name="ARRAY_BUFFER_BINDING_ARB" count="1" value="0x8894">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="ELEMENT_ARRAY_BUFFER_BINDING_ARB" count="1" value="0x8895">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="VERTEX_ARRAY_BUFFER_BINDING_ARB" count="1" value="0x8896">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="NORMAL_ARRAY_BUFFER_BINDING_ARB" count="1" value="0x8897">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="COLOR_ARRAY_BUFFER_BINDING_ARB" count="1" value="0x8898">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="INDEX_ARRAY_BUFFER_BINDING_ARB" count="1" value="0x8899">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB" count="1" value="0x889A">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB" count="1" value="0x889B">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB" count="1" value="0x889C">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB" count="1" value="0x889D">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="WEIGHT_ARRAY_BUFFER_BINDING_ARB" count="1" value="0x889E">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB" count="1" value="0x889F">
+ <size name="GetVertexAttribdvARB" mode="get"/>
+ <size name="GetVertexAttribfvARB" mode="get"/>
+ <size name="GetVertexAttribivARB" mode="get"/>
+ </enum>
+ <enum name="READ_ONLY_ARB" value="0x88B8"/>
+ <enum name="WRITE_ONLY_ARB" value="0x88B9"/>
+ <enum name="READ_WRITE_ARB" value="0x88BA"/>
+ <enum name="BUFFER_ACCESS_ARB" count="1" value="0x88BB">
+ <size name="GetBufferParameterivARB" mode="get"/>
+ </enum>
+ <enum name="BUFFER_MAPPED_ARB" count="1" value="0x88BC">
+ <size name="GetBufferParameterivARB" mode="get"/>
+ </enum>
+ <enum name="BUFFER_MAP_POINTER_ARB" value="0x88BD"/>
+ <enum name="STREAM_DRAW_ARB" value="0x88E0"/>
+ <enum name="STREAM_READ_ARB" value="0x88E1"/>
+ <enum name="STREAM_COPY_ARB" value="0x88E2"/>
+ <enum name="STATIC_DRAW_ARB" value="0x88E4"/>
+ <enum name="STATIC_READ_ARB" value="0x88E5"/>
+ <enum name="STATIC_COPY_ARB" value="0x88E6"/>
+ <enum name="DYNAMIC_DRAW_ARB" value="0x88E8"/>
+ <enum name="DYNAMIC_READ_ARB" value="0x88E9"/>
+ <enum name="DYNAMIC_COPY_ARB" value="0x88EA"/>
+
+ <type name="intptrARB" size="4" glx_name="CARD32"/>
+ <type name="sizeiptrARB" size="4" unsigned="true" glx_name="CARD32"/>
+
+ <function name="BindBufferARB" offset="assign">
+ <param name="target" type="GLenum"/>
+ <param name="buffer" type="GLuint"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="BufferDataARB" offset="assign">
+ <param name="target" type="GLenum"/>
+ <param name="size" type="GLsizeiptrARB" counter="true"/>
+ <param name="data" type="const GLvoid *" count="size" img_null_flag="true"/>
+ <param name="usage" type="GLenum"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="BufferSubDataARB" offset="assign">
+ <param name="target" type="GLenum"/>
+ <param name="offset" type="GLintptrARB"/>
+ <param name="size" type="GLsizeiptrARB" counter="true"/>
+ <param name="data" type="const GLvoid *" count="size"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="DeleteBuffersARB" offset="assign">
+ <param name="n" type="GLsizei" counter="true"/>
+ <param name="buffer" type="const GLuint *" count="n"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="GenBuffersARB" offset="assign">
+ <param name="n" type="GLsizei" counter="true"/>
+ <param name="buffer" type="GLuint *" output="true" count="n"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="GetBufferParameterivARB" offset="assign">
+ <param name="target" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLint *" output="true" variable_param="pname"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="GetBufferPointervARB" offset="assign">
+ <param name="target" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLvoid **" output="true"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="GetBufferSubDataARB" offset="assign">
+ <param name="target" type="GLenum"/>
+ <param name="offset" type="GLintptrARB"/>
+ <param name="size" type="GLsizeiptrARB" counter="true"/>
+ <param name="data" type="GLvoid *" output="true" count="size"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="IsBufferARB" offset="assign">
+ <param name="buffer" type="GLuint"/>
+ <return type="GLboolean"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="MapBufferARB" offset="assign">
+ <param name="target" type="GLenum"/>
+ <param name="access" type="GLenum"/>
+ <return type="GLvoid *"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="UnmapBufferARB" offset="assign">
+ <param name="target" type="GLenum"/>
+ <return type="GLboolean"/>
+ <glx ignore="true"/>
+ </function>
+</category>
+
+<category name="GL_ARB_occlusion_query" number="29">
+ <enum name="QUERY_COUNTER_BITS_ARB" count="1" value="0x8864">
+ <size name="GetQueryivARB" mode="get"/>
+ </enum>
+ <enum name="CURRENT_QUERY_ARB" count="1" value="0x8865">
+ <size name="GetQueryivARB" mode="get"/>
+ </enum>
+ <enum name="QUERY_RESULT_ARB" count="1" value="0x8866">
+ <size name="GetQueryObjectivARB" mode="get"/>
+ <size name="GetQueryObjectuivARB" mode="get"/>
+ </enum>
+ <enum name="QUERY_RESULT_AVAILABLE_ARB" count="1" value="0x8867">
+ <size name="GetQueryObjectivARB" mode="get"/>
+ <size name="GetQueryObjectuivARB" mode="get"/>
+ </enum>
+ <enum name="SAMPLES_PASSED_ARB" value="0x8914"/>
+
+ <function name="GenQueriesARB" offset="assign">
+ <param name="n" type="GLsizei" counter="true"/>
+ <param name="ids" type="GLuint *" output="true" count="n"/>
+ <glx sop="162" always_array="true"/>
+ </function>
+
+ <function name="DeleteQueriesARB" offset="assign">
+ <param name="n" type="GLsizei" counter="true"/>
+ <param name="ids" type="const GLuint *" count="n"/>
+ <glx sop="161"/>
+ </function>
+
+ <function name="IsQueryARB" offset="assign">
+ <param name="id" type="GLuint"/>
+ <return type="GLboolean"/>
+ <glx sop="163"/>
+ </function>
+
+ <function name="BeginQueryARB" offset="assign">
+ <param name="target" type="GLenum"/>
+ <param name="id" type="GLuint"/>
+ <glx rop="231"/>
+ </function>
+
+ <function name="EndQueryARB" offset="assign">
+ <param name="target" type="GLenum"/>
+ <glx rop="232"/>
+ </function>
+
+ <function name="GetQueryivARB" offset="assign">
+ <param name="target" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLint *" output="true" variable_param="pname"/>
+ <glx sop="164"/>
+ </function>
+
+ <function name="GetQueryObjectivARB" offset="assign">
+ <param name="id" type="GLuint"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLint *" output="true" variable_param="pname"/>
+ <glx sop="165"/>
+ </function>
+
+ <function name="GetQueryObjectuivARB" offset="assign">
+ <param name="id" type="GLuint"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLuint *" output="true" variable_param="pname"/>
+ <glx sop="166"/>
+ </function>
+</category>
+
+<category name="GL_ARB_shader_objects" number="30">
+ <enum name="PROGRAM_OBJECT_ARB" value="0x8B40"/>
+ <enum name="SHADER_OBJECT_ARB" value="0x8B48"/>
+ <enum name="OBJECT_TYPE_ARB" value="0x8B4E"/>
+ <enum name="OBJECT_SUBTYPE_ARB" value="0x8B4F"/>
+ <enum name="FLOAT_VEC2_ARB" value="0x8B50"/>
+ <enum name="FLOAT_VEC3_ARB" value="0x8B51"/>
+ <enum name="FLOAT_VEC4_ARB" value="0x8B52"/>
+ <enum name="INT_VEC2_ARB" value="0x8B53"/>
+ <enum name="INT_VEC3_ARB" value="0x8B54"/>
+ <enum name="INT_VEC4_ARB" value="0x8B55"/>
+ <enum name="BOOL_ARB" value="0x8B56"/>
+ <enum name="BOOL_VEC2_ARB" value="0x8B57"/>
+ <enum name="BOOL_VEC3_ARB" value="0x8B58"/>
+ <enum name="BOOL_VEC4_ARB" value="0x8B59"/>
+ <enum name="FLOAT_MAT2_ARB" value="0x8B5A"/>
+ <enum name="FLOAT_MAT3_ARB" value="0x8B5B"/>
+ <enum name="FLOAT_MAT4_ARB" value="0x8B5C"/>
+ <enum name="OBJECT_DELETE_STATUS_ARB" value="0x8B80"/>
+ <enum name="OBJECT_COMPILE_STATUS_ARB" value="0x8B81"/>
+ <enum name="OBJECT_LINK_STATUS_ARB" value="0x8B82"/>
+ <enum name="OBJECT_VALIDATE_STATUS_ARB" value="0x8B83"/>
+ <enum name="OBJECT_INFO_LOG_LENGTH_ARB" value="0x8B84"/>
+ <enum name="OBJECT_ATTACHED_OBJECTS_ARB" value="0x8B85"/>
+ <enum name="OBJECT_ACTIVE_UNIFORMS_ARB" value="0x8B86"/>
+ <enum name="OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB" value="0x8B87"/>
+ <enum name="OBJECT_SHADER_SOURCE_LENGTH_ARB" value="0x8B88"/>
+
+ <type name="charARB" size="1" glx_name="CARD8"/>
+ <type name="handleARB" size="4" glx_name="CARD32"/>
+
+ <function name="DeleteObjectARB" offset="assign">
+ <param name="obj" type="GLhandleARB"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="GetHandleARB" offset="assign">
+ <param name="pname" type="GLenum"/>
+ <return type="GLhandleARB"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="DetachObjectARB" offset="assign">
+ <param name="containerObj" type="GLhandleARB"/>
+ <param name="attachedObj" type="GLhandleARB"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="CreateShaderObjectARB" offset="assign">
+ <param name="shaderType" type="GLenum"/>
+ <return type="GLhandleARB"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="ShaderSourceARB" offset="assign">
+ <param name="shader" type="GLhandleARB"/>
+ <param name="count" type="GLsizei"/>
+ <param name="string" type="const GLcharARB **"/>
+ <param name="length" type="const GLint *"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="CompileShaderARB" offset="assign">
+ <param name="shader" type="GLhandleARB"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="CreateProgramObjectARB" offset="assign">
+ <return type="GLhandleARB"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="AttachObjectARB" offset="assign">
+ <param name="containerObj" type="GLhandleARB"/>
+ <param name="obj" type="GLhandleARB"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="LinkProgramARB" offset="assign">
+ <param name="program" type="GLhandleARB"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="UseProgramObjectARB" offset="assign">
+ <param name="program" type="GLhandleARB"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="ValidateProgramARB" offset="assign">
+ <param name="program" type="GLhandleARB"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="Uniform1fARB" offset="assign">
+ <param name="location" type="GLint"/>
+ <param name="v0" type="GLfloat"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="Uniform2fARB" offset="assign">
+ <param name="location" type="GLint"/>
+ <param name="v0" type="GLfloat"/>
+ <param name="v1" type="GLfloat"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="Uniform3fARB" offset="assign">
+ <param name="location" type="GLint"/>
+ <param name="v0" type="GLfloat"/>
+ <param name="v1" type="GLfloat"/>
+ <param name="v2" type="GLfloat"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="Uniform4fARB" offset="assign">
+ <param name="location" type="GLint"/>
+ <param name="v0" type="GLfloat"/>
+ <param name="v1" type="GLfloat"/>
+ <param name="v2" type="GLfloat"/>
+ <param name="v3" type="GLfloat"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="Uniform1iARB" offset="assign">
+ <param name="location" type="GLint"/>
+ <param name="v0" type="GLint"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="Uniform2iARB" offset="assign">
+ <param name="location" type="GLint"/>
+ <param name="v0" type="GLint"/>
+ <param name="v1" type="GLint"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="Uniform3iARB" offset="assign">
+ <param name="location" type="GLint"/>
+ <param name="v0" type="GLint"/>
+ <param name="v1" type="GLint"/>
+ <param name="v2" type="GLint"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="Uniform4iARB" offset="assign">
+ <param name="location" type="GLint"/>
+ <param name="v0" type="GLint"/>
+ <param name="v1" type="GLint"/>
+ <param name="v2" type="GLint"/>
+ <param name="v3" type="GLint"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="Uniform1fvARB" offset="assign">
+ <param name="location" type="GLint"/>
+ <param name="count" type="GLsizei"/>
+ <param name="value" type="const GLfloat *"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="Uniform2fvARB" offset="assign">
+ <param name="location" type="GLint"/>
+ <param name="count" type="GLsizei"/>
+ <param name="value" type="const GLfloat *"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="Uniform3fvARB" offset="assign">
+ <param name="location" type="GLint"/>
+ <param name="count" type="GLsizei"/>
+ <param name="value" type="const GLfloat *"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="Uniform4fvARB" offset="assign">
+ <param name="location" type="GLint"/>
+ <param name="count" type="GLsizei"/>
+ <param name="value" type="const GLfloat *"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="Uniform1ivARB" offset="assign">
+ <param name="location" type="GLint"/>
+ <param name="count" type="GLsizei"/>
+ <param name="value" type="const GLint *"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="Uniform2ivARB" offset="assign">
+ <param name="location" type="GLint"/>
+ <param name="count" type="GLsizei"/>
+ <param name="value" type="const GLint *"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="Uniform3ivARB" offset="assign">
+ <param name="location" type="GLint"/>
+ <param name="count" type="GLsizei"/>
+ <param name="value" type="const GLint *"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="Uniform4ivARB" offset="assign">
+ <param name="location" type="GLint"/>
+ <param name="count" type="GLsizei"/>
+ <param name="value" type="const GLint *"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="UniformMatrix2fvARB" offset="assign">
+ <param name="location" type="GLint"/>
+ <param name="count" type="GLsizei"/>
+ <param name="transpose" type="GLboolean"/>
+ <param name="value" type="const GLfloat *"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="UniformMatrix3fvARB" offset="assign">
+ <param name="location" type="GLint"/>
+ <param name="count" type="GLsizei"/>
+ <param name="transpose" type="GLboolean"/>
+ <param name="value" type="const GLfloat *"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="UniformMatrix4fvARB" offset="assign">
+ <param name="location" type="GLint"/>
+ <param name="count" type="GLsizei"/>
+ <param name="transpose" type="GLboolean"/>
+ <param name="value" type="const GLfloat *"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="GetObjectParameterfvARB" offset="assign">
+ <param name="obj" type="GLhandleARB"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLfloat *" output="true"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="GetObjectParameterivARB" offset="assign">
+ <param name="obj" type="GLhandleARB"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLint *" output="true"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="GetInfoLogARB" offset="assign">
+ <param name="obj" type="GLhandleARB"/>
+ <param name="maxLength" type="GLsizei"/>
+ <param name="length" type="GLsizei *" output="true"/>
+ <param name="infoLog" type="GLcharARB *" output="true"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="GetAttachedObjectsARB" offset="assign">
+ <param name="containerObj" type="GLhandleARB"/>
+ <param name="maxLength" type="GLsizei"/>
+ <param name="length" type="GLsizei *" output="true"/>
+ <param name="infoLog" type="GLhandleARB *" output="true"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="GetUniformLocationARB" offset="assign">
+ <param name="program" type="GLhandleARB"/>
+ <param name="name" type="const GLcharARB *"/>
+ <return type="GLint"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="GetActiveUniformARB" offset="assign">
+ <param name="program" type="GLhandleARB"/>
+ <param name="index" type="GLuint"/>
+ <param name="bufSize" type="GLsizei"/>
+ <param name="length" type="GLsizei *" output="true"/>
+ <param name="size" type="GLint *" output="true"/>
+ <param name="type" type="GLenum *" output="true"/>
+ <param name="name" type="GLcharARB *" output="true"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="GetUniformfvARB" offset="assign">
+ <param name="program" type="GLhandleARB"/>
+ <param name="location" type="GLint"/>
+ <param name="params" type="GLfloat *" output="true"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="GetUniformivARB" offset="assign">
+ <param name="program" type="GLhandleARB"/>
+ <param name="location" type="GLint"/>
+ <param name="params" type="GLint *" output="true"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="GetShaderSourceARB" offset="assign">
+ <param name="shader" type="GLhandleARB"/>
+ <param name="bufSize" type="GLsizei"/>
+ <param name="length" type="GLsizei *" output="true"/>
+ <param name="source" type="GLcharARB *" output="true"/>
+ <glx ignore="true"/>
+ </function>
+</category>
+
+<category name="GL_ARB_vertex_shader" number="31">
+ <enum name="VERTEX_SHADER_ARB" value="0x8B31"/>
+ <enum name="MAX_VERTEX_UNIFORM_COMPONENTS_ARB" value="0x8B4A"/>
+ <enum name="MAX_VARYING_FLOATS_ARB" value="0x8B4B"/>
+ <enum name="MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB" value="0x8B4C"/>
+ <enum name="MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB" value="0x8B4D"/>
+ <enum name="OBJECT_ACTIVE_ATTRIBUTES_ARB" value="0x8B89"/>
+ <enum name="OBJECT_ACTIVE_ATTRIBUTE_MAX_LENGTH_ARB" value="0x8B8A"/>
+
+ <function name="BindAttribLocationARB" offset="assign">
+ <param name="program" type="GLhandleARB"/>
+ <param name="index" type="GLuint"/>
+ <param name="name" type="const GLcharARB *"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="GetActiveAttribARB" offset="assign">
+ <param name="program" type="GLhandleARB"/>
+ <param name="index" type="GLuint"/>
+ <param name="bufSize" type="GLsizei"/>
+ <param name="length" type="GLsizei *" output="true"/>
+ <param name="size" type="GLint *" output="true"/>
+ <param name="type" type="GLenum *" output="true"/>
+ <param name="name" type="GLcharARB *" output="true"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="GetAttribLocationARB" offset="assign">
+ <param name="program" type="GLhandleARB"/>
+ <param name="name" type="const GLcharARB *"/>
+ <return type="GLint"/>
+ <glx ignore="true"/>
+ </function>
+</category>
+
+<category name="GL_ARB_fragment_shader" number="32">
+ <enum name="FRAGMENT_SHADER_ARB" value="0x8B30"/>
+ <enum name="MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB" value="0x8B49"/>
+</category>
+
+<category name="GL_ARB_shading_language_100" number="33">
+ <!-- No new functions, types, enums. -->
+</category>
+
+<category name="GL_ARB_texture_non_power_of_two" number="34">
+ <!-- No new functions, types, enums. -->
+</category>
+
+<category name="GL_ARB_point_sprite" number="35">
+ <enum name="POINT_SPRITE_ARB" count="1" value="0x8861">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="COORD_REPLACE_ARB" count="1" value="0x8862">
+ <size name="TexEnvfv" mode="get"/>
+ <size name="TexEnviv" mode="get"/>
+ <size name="GetTexEnvfv" mode="get"/>
+ <size name="GetTexEnviv" mode="get"/>
+ </enum>
+</category>
+
+<category name="GL_ARB_fragment_program_shadow" number="36">
+ <!-- No new functions, types, enums. -->
+</category>
+
+<category name="GL_ARB_draw_buffers" number="37">
+ <enum name="MAX_DRAW_BUFFERS_ARB" count="1" value="0x8824">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="DRAW_BUFFER0_ARB" count="1" value="0x8825">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="DRAW_BUFFER1_ARB" count="1" value="0x8826">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="DRAW_BUFFER2_ARB" count="1" value="0x8827">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="DRAW_BUFFER3_ARB" count="1" value="0x8828">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="DRAW_BUFFER4_ARB" count="1" value="0x8829">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="DRAW_BUFFER5_ARB" count="1" value="0x882A">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="DRAW_BUFFER6_ARB" count="1" value="0x882B">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="DRAW_BUFFER7_ARB" count="1" value="0x882C">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="DRAW_BUFFER8_ARB" count="1" value="0x882D">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="DRAW_BUFFER9_ARB" count="1" value="0x882E">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="DRAW_BUFFER10_ARB" count="1" value="0x882F">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="DRAW_BUFFER11_ARB" count="1" value="0x8830">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="DRAW_BUFFER12_ARB" count="1" value="0x8831">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="DRAW_BUFFER13_ARB" count="1" value="0x8832">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="DRAW_BUFFER14_ARB" count="1" value="0x8833">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="DRAW_BUFFER15_ARB" count="1" value="0x8834">
+ <size name="Get" mode="get"/>
+ </enum>
+
+ <function name="DrawBuffersARB" offset="assign">
+ <param name="n" type="GLsizei" counter="true"/>
+ <param name="bufs" type="const GLenum *" count="n"/>
+ <glx rop="233" large="true"/>
+ </function>
+</category>
+
+<category name="GL_ARB_texture_rectangle" number="38">
+ <enum name="TEXTURE_RECTANGLE_ARB" count="1" value="0x84F5">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="TEXTURE_BINDING_RECTANGLE_ARB" count="1" value="0x84F6">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="PROXY_TEXTURE_RECTANGLE_ARB" value="0x84F7"/>
+ <enum name="MAX_RECTANGLE_TEXTURE_SIZE_ARB" count="1" value="0x84F8">
+ <size name="Get" mode="get"/>
+ </enum>
+</category>
+
+<xi:include href="ARB_ES2_compatibility.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
+
+<xi:include href="ARB_framebuffer_object.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
+
+<xi:include href="ARB_copy_buffer.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
+
+<xi:include href="ARB_depth_clamp.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
+
+<xi:include href="ARB_map_buffer_range.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
+
+<xi:include href="ARB_vertex_array_object.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
+
+<xi:include href="ARB_sync.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
+
+<xi:include href="ARB_seamless_cube_map.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
+
+<xi:include href="ARB_draw_elements_base_vertex.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
+
+<xi:include href="NV_conditional_render.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
+
+<xi:include href="NV_primitive_restart.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
+
+<xi:include href="NV_texture_barrier.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
+
+<xi:include href="ARB_sampler_objects.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
+
+<xi:include href="EXT_transform_feedback.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
+
+<xi:include href="ARB_draw_instanced.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
+
+<xi:include href="ARB_geometry_shader4.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
+
+<xi:include href="ARB_color_buffer_float.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
+
+<xi:include href="ARB_robustness.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
+
+<!-- Non-ARB extensions sorted by extension number. -->
+
+<category name="GL_EXT_blend_color" number="2">
+ <enum name="CONSTANT_COLOR_EXT" value="0x8001"/>
+ <enum name="ONE_MINUS_CONSTANT_COLOR_EXT" value="0x8002"/>
+ <enum name="CONSTANT_ALPHA_EXT" value="0x8003"/>
+ <enum name="ONE_MINUS_CONSTANT_ALPHA_EXT" value="0x8004"/>
+ <enum name="BLEND_COLOR_EXT" count="4" value="0x8005">
+ <size name="Get" mode="get"/>
+ </enum>
+
+ <function name="BlendColorEXT" alias="BlendColor">
+ <param name="red" type="GLclampf"/>
+ <param name="green" type="GLclampf"/>
+ <param name="blue" type="GLclampf"/>
+ <param name="alpha" type="GLclampf"/>
+ </function>
+</category>
+
+<category name="GL_EXT_polygon_offset" number="3">
+ <function name="PolygonOffsetEXT" offset="assign">
+ <param name="factor" type="GLfloat"/>
+ <param name="bias" type="GLfloat"/>
+ <glx rop="4098" ignore="true"/>
+ </function>
+</category>
+
+<category name="GL_EXT_texture" number="4">
+ <enum name="ALPHA4_EXT" value="0x803B"/>
+ <enum name="ALPHA8_EXT" value="0x803C"/>
+ <enum name="ALPHA12_EXT" value="0x803D"/>
+ <enum name="ALPHA16_EXT" value="0x803E"/>
+ <enum name="LUMINANCE4_EXT" value="0x803F"/>
+ <enum name="LUMINANCE8_EXT" value="0x8040"/>
+ <enum name="LUMINANCE12_EXT" value="0x8041"/>
+ <enum name="LUMINANCE16_EXT" value="0x8042"/>
+ <enum name="LUMINANCE4_ALPHA4_EXT" value="0x8043"/>
+ <enum name="LUMINANCE6_ALPHA2_EXT" value="0x8044"/>
+ <enum name="LUMINANCE8_ALPHA8_EXT" value="0x8045"/>
+ <enum name="LUMINANCE12_ALPHA4_EXT" value="0x8046"/>
+ <enum name="LUMINANCE12_ALPHA12_EXT" value="0x8047"/>
+ <enum name="LUMINANCE16_ALPHA16_EXT" value="0x8048"/>
+ <enum name="INTENSITY_EXT" value="0x8049"/>
+ <enum name="INTENSITY4_EXT" value="0x804A"/>
+ <enum name="INTENSITY8_EXT" value="0x804B"/>
+ <enum name="INTENSITY12_EXT" value="0x804C"/>
+ <enum name="INTENSITY16_EXT" value="0x804D"/>
+ <enum name="RGB2_EXT" value="0x804E"/>
+ <enum name="RGB4_EXT" value="0x804F"/>
+ <enum name="RGB5_EXT" value="0x8050"/>
+ <enum name="RGB8_EXT" value="0x8051"/>
+ <enum name="RGB10_EXT" value="0x8052"/>
+ <enum name="RGB12_EXT" value="0x8053"/>
+ <enum name="RGB16_EXT" value="0x8054"/>
+ <enum name="RGBA2_EXT" value="0x8055"/>
+ <enum name="RGBA4_EXT" value="0x8056"/>
+ <enum name="RGB5_A1_EXT" value="0x8057"/>
+ <enum name="RGBA8_EXT" value="0x8058"/>
+ <enum name="RGB10_A2_EXT" value="0x8059"/>
+ <enum name="RGBA12_EXT" value="0x805A"/>
+ <enum name="RGBA16_EXT" value="0x805B"/>
+ <enum name="TEXTURE_RED_SIZE_EXT" count="1" value="0x805C">
+ <size name="GetTexLevelParameterfv" mode="get"/>
+ <size name="GetTexLevelParameteriv" mode="get"/>
+ </enum>
+ <enum name="TEXTURE_GREEN_SIZE_EXT" count="1" value="0x805D">
+ <size name="GetTexLevelParameterfv" mode="get"/>
+ <size name="GetTexLevelParameteriv" mode="get"/>
+ </enum>
+ <enum name="TEXTURE_BLUE_SIZE_EXT" count="1" value="0x805E">
+ <size name="GetTexLevelParameterfv" mode="get"/>
+ <size name="GetTexLevelParameteriv" mode="get"/>
+ </enum>
+ <enum name="TEXTURE_ALPHA_SIZE_EXT" count="1" value="0x805F">
+ <size name="GetTexLevelParameterfv" mode="get"/>
+ <size name="GetTexLevelParameteriv" mode="get"/>
+ </enum>
+ <enum name="TEXTURE_LUMINANCE_SIZE_EXT" count="1" value="0x8060">
+ <size name="GetTexLevelParameterfv" mode="get"/>
+ <size name="GetTexLevelParameteriv" mode="get"/>
+ </enum>
+ <enum name="TEXTURE_INTENSITY_SIZE_EXT" count="1" value="0x8061">
+ <size name="GetTexLevelParameterfv" mode="get"/>
+ <size name="GetTexLevelParameteriv" mode="get"/>
+ </enum>
+ <enum name="REPLACE_EXT" value="0x8062"/>
+ <enum name="PROXY_TEXTURE_1D_EXT" value="0x8063"/>
+ <enum name="PROXY_TEXTURE_2D_EXT" value="0x8064"/>
+ <enum name="TEXTURE_TOO_LARGE_EXT" value="0x8065"/>
+</category>
+
+<!-- Extension number 5 is not listed in the extension registry. -->
+
+<category name="GL_EXT_texture3D" number="6">
+ <function name="TexImage3DEXT" alias="TexImage3D">
+ <param name="target" type="GLenum"/>
+ <param name="level" type="GLint"/>
+ <param name="internalformat" type="GLenum"/>
+ <param name="width" type="GLsizei"/>
+ <param name="height" type="GLsizei"/>
+ <param name="depth" type="GLsizei"/>
+ <param name="border" type="GLint"/>
+ <param name="format" type="GLenum"/>
+ <param name="type" type="GLenum"/>
+ <param name="pixels" type="const GLvoid *"/>
+ </function>
+
+ <function name="TexSubImage3DEXT" alias="TexSubImage3D">
+ <param name="target" type="GLenum"/>
+ <param name="level" type="GLint"/>
+ <param name="xoffset" type="GLint"/>
+ <param name="yoffset" type="GLint"/>
+ <param name="zoffset" type="GLint"/>
+ <param name="width" type="GLsizei"/>
+ <param name="height" type="GLsizei"/>
+ <param name="depth" type="GLsizei"/>
+ <param name="format" type="GLenum"/>
+ <param name="type" type="GLenum"/>
+ <param name="UNUSED" type="GLuint" padding="true"/>
+ <param name="pixels" type="const GLvoid *"/>
+ </function>
+</category>
+
+<category name="GL_SGIS_texture_filter4" number="7">
+ <function name="GetTexFilterFuncSGIS">
+ <param name="target" type="GLenum"/>
+ <param name="filter" type="GLenum"/>
+ <param name="weights" type="GLfloat *" output="true"/>
+ <glx vendorpriv="4101" ignore="true"/>
+ </function>
+
+ <function name="TexFilterFuncSGIS">
+ <param name="target" type="GLenum"/>
+ <param name="filter" type="GLenum"/>
+ <param name="n" type="GLsizei" counter="true"/>
+ <param name="weights" type="const GLfloat *" count="n"/>
+ <glx rop="2064" ignore="true"/>
+ </function>
+</category>
+
+<!-- Extension number 8 is not listed in the extension registry. -->
+
+<category name="GL_EXT_subtexture" number="9">
+ <function name="TexSubImage1DEXT" alias="TexSubImage1D">
+ <param name="target" type="GLenum"/>
+ <param name="level" type="GLint"/>
+ <param name="xoffset" type="GLint"/>
+ <param name="width" type="GLsizei"/>
+ <param name="format" type="GLenum"/>
+ <param name="type" type="GLenum"/>
+ <param name="UNUSED" type="GLuint" padding="true"/>
+ <param name="pixels" type="const GLvoid *"/>
+ </function>
+
+ <function name="TexSubImage2DEXT" alias="TexSubImage2D">
+ <param name="target" type="GLenum"/>
+ <param name="level" type="GLint"/>
+ <param name="xoffset" type="GLint"/>
+ <param name="yoffset" type="GLint"/>
+ <param name="width" type="GLsizei"/>
+ <param name="height" type="GLsizei"/>
+ <param name="format" type="GLenum"/>
+ <param name="type" type="GLenum"/>
+ <param name="UNUSED" type="GLuint" padding="true"/>
+ <param name="pixels" type="const GLvoid *"/>
+ </function>
+</category>
+
+<category name="GL_EXT_copy_texture" number="10">
+ <function name="CopyTexImage1DEXT" alias="CopyTexImage1D">
+ <param name="target" type="GLenum"/>
+ <param name="level" type="GLint"/>
+ <param name="internalformat" type="GLenum"/>
+ <param name="x" type="GLint"/>
+ <param name="y" type="GLint"/>
+ <param name="width" type="GLsizei"/>
+ <param name="border" type="GLint"/>
+ </function>
+
+ <function name="CopyTexImage2DEXT" alias="CopyTexImage2D">
+ <param name="target" type="GLenum"/>
+ <param name="level" type="GLint"/>
+ <param name="internalformat" type="GLenum"/>
+ <param name="x" type="GLint"/>
+ <param name="y" type="GLint"/>
+ <param name="width" type="GLsizei"/>
+ <param name="height" type="GLsizei"/>
+ <param name="border" type="GLint"/>
+ </function>
+
+ <function name="CopyTexSubImage1DEXT" alias="CopyTexSubImage1D">
+ <param name="target" type="GLenum"/>
+ <param name="level" type="GLint"/>
+ <param name="xoffset" type="GLint"/>
+ <param name="x" type="GLint"/>
+ <param name="y" type="GLint"/>
+ <param name="width" type="GLsizei"/>
+ </function>
+
+ <function name="CopyTexSubImage2DEXT" alias="CopyTexSubImage2D">
+ <param name="target" type="GLenum"/>
+ <param name="level" type="GLint"/>
+ <param name="xoffset" type="GLint"/>
+ <param name="yoffset" type="GLint"/>
+ <param name="x" type="GLint"/>
+ <param name="y" type="GLint"/>
+ <param name="width" type="GLsizei"/>
+ <param name="height" type="GLsizei"/>
+ </function>
+
+ <function name="CopyTexSubImage3DEXT" alias="CopyTexSubImage3D">
+ <param name="target" type="GLenum"/>
+ <param name="level" type="GLint"/>
+ <param name="xoffset" type="GLint"/>
+ <param name="yoffset" type="GLint"/>
+ <param name="zoffset" type="GLint"/>
+ <param name="x" type="GLint"/>
+ <param name="y" type="GLint"/>
+ <param name="width" type="GLsizei"/>
+ <param name="height" type="GLsizei"/>
+ </function>
+</category>
+
+<category name="GL_EXT_histogram" number="11">
+ <enum name="HISTOGRAM_EXT" value="0x8024"/>
+ <enum name="PROXY_HISTOGRAM_EXT" value="0x8025"/>
+ <enum name="HISTOGRAM_WIDTH_EXT" count="1" value="0x8026">
+ <size name="GetHistogramParameterfvEXT" mode="get"/>
+ <size name="GetHistogramParameterivEXT" mode="get"/>
+ </enum>
+ <enum name="HISTOGRAM_FORMAT_EXT" count="1" value="0x8027">
+ <size name="GetHistogramParameterfvEXT" mode="get"/>
+ <size name="GetHistogramParameterivEXT" mode="get"/>
+ </enum>
+ <enum name="HISTOGRAM_RED_SIZE_EXT" count="1" value="0x8028">
+ <size name="GetHistogramParameterfvEXT" mode="get"/>
+ <size name="GetHistogramParameterivEXT" mode="get"/>
+ </enum>
+ <enum name="HISTOGRAM_GREEN_SIZE_EXT" count="1" value="0x8029">
+ <size name="GetHistogramParameterfvEXT" mode="get"/>
+ <size name="GetHistogramParameterivEXT" mode="get"/>
+ </enum>
+ <enum name="HISTOGRAM_BLUE_SIZE_EXT" count="1" value="0x802A">
+ <size name="GetHistogramParameterfvEXT" mode="get"/>
+ <size name="GetHistogramParameterivEXT" mode="get"/>
+ </enum>
+ <enum name="HISTOGRAM_ALPHA_SIZE_EXT" count="1" value="0x802B">
+ <size name="GetHistogramParameterfvEXT" mode="get"/>
+ <size name="GetHistogramParameterivEXT" mode="get"/>
+ </enum>
+ <enum name="HISTOGRAM_LUMINANCE_SIZE_EXT" count="1" value="0x802C">
+ <size name="GetHistogramParameterfvEXT" mode="get"/>
+ <size name="GetHistogramParameterivEXT" mode="get"/>
+ </enum>
+ <enum name="HISTOGRAM_SINK_EXT" count="1" value="0x802D">
+ <size name="GetHistogramParameterfvEXT" mode="get"/>
+ <size name="GetHistogramParameterivEXT" mode="get"/>
+ </enum>
+ <enum name="MINMAX_EXT" value="0x802E"/>
+ <enum name="MINMAX_FORMAT_EXT" count="1" value="0x802F">
+ <size name="GetMinmaxParameterfvEXT" mode="get"/>
+ <size name="GetMinmaxParameterivEXT" mode="get"/>
+ </enum>
+ <enum name="MINMAX_SINK_EXT" count="1" value="0x8030">
+ <size name="GetMinmaxParameterfvEXT" mode="get"/>
+ <size name="GetMinmaxParameterivEXT" mode="get"/>
+ </enum>
+ <enum name="TABLE_TOO_LARGE_EXT" value="0x8031"/>
+
+ <function name="GetHistogramEXT" alias="GetHistogram" static_dispatch="false">
+ <param name="target" type="GLenum"/>
+ <param name="reset" type="GLboolean"/>
+ <param name="format" type="GLenum"/>
+ <param name="type" type="GLenum"/>
+ <param name="values" type="GLvoid *" output="true" img_width="width" img_format="format" img_type="type"/>
+ <glx vendorpriv="5" dimensions_in_reply="true" img_reset="reset"/>
+ </function>
+
+ <function name="GetHistogramParameterfvEXT" alias="GetHistogramParameterfv" static_dispatch="false">
+ <param name="target" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLfloat *" output="true" variable_param="pname"/>
+ <glx vendorpriv="6"/>
+ </function>
+
+ <function name="GetHistogramParameterivEXT" alias="GetHistogramParameteriv" static_dispatch="false">
+ <param name="target" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLint *" output="true" variable_param="pname"/>
+ <glx vendorpriv="7"/>
+ </function>
+
+ <function name="GetMinmaxEXT" alias="GetMinmax" static_dispatch="false">
+ <param name="target" type="GLenum"/>
+ <param name="reset" type="GLboolean"/>
+ <param name="format" type="GLenum"/>
+ <param name="type" type="GLenum"/>
+ <param name="values" type="GLvoid *" output="true" img_width="2" img_format="format" img_type="type"/>
+ <glx vendorpriv="8" img_reset="reset"/>
+ </function>
+
+ <function name="GetMinmaxParameterfvEXT" alias="GetMinmaxParameterfv" static_dispatch="false">
+ <param name="target" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLfloat *" output="true" variable_param="pname"/>
+ <glx vendorpriv="9"/>
+ </function>
+
+ <function name="GetMinmaxParameterivEXT" alias="GetMinmaxParameteriv" static_dispatch="false">
+ <param name="target" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLint *" output="true" variable_param="pname"/>
+ <glx vendorpriv="10"/>
+ </function>
+
+ <function name="HistogramEXT" alias="Histogram" static_dispatch="false">
+ <param name="target" type="GLenum"/>
+ <param name="width" type="GLsizei"/>
+ <param name="internalformat" type="GLenum"/>
+ <param name="sink" type="GLboolean"/>
+ </function>
+
+ <function name="MinmaxEXT" alias="Minmax" static_dispatch="false">
+ <param name="target" type="GLenum"/>
+ <param name="internalformat" type="GLenum"/>
+ <param name="sink" type="GLboolean"/>
+ </function>
+
+ <function name="ResetHistogramEXT" alias="ResetHistogram" static_dispatch="false">
+ <param name="target" type="GLenum"/>
+ </function>
+
+ <function name="ResetMinmaxEXT" alias="ResetMinmax" static_dispatch="false">
+ <param name="target" type="GLenum"/>
+ </function>
+</category>
+
+<category name="GL_EXT_convolution" number="12">
+ <enum name="CONVOLUTION_BORDER_MODE_EXT" count="1" value="0x8013">
+ <size name="ConvolutionParameterfv" mode="get"/>
+ <size name="ConvolutionParameteriv" mode="get"/>
+ <size name="GetConvolutionParameterfv" mode="get"/>
+ <size name="GetConvolutionParameteriv" mode="get"/>
+ </enum>
+ <enum name="CONVOLUTION_FILTER_SCALE_EXT" count="4" value="0x8014">
+ <size name="ConvolutionParameterfv" mode="get"/>
+ <size name="ConvolutionParameteriv" mode="get"/>
+ <size name="GetConvolutionParameterfv" mode="get"/>
+ <size name="GetConvolutionParameteriv" mode="get"/>
+ </enum>
+ <enum name="CONVOLUTION_FILTER_BIAS_EXT" count="4" value="0x8015">
+ <size name="ConvolutionParameterfv" mode="get"/>
+ <size name="ConvolutionParameteriv" mode="get"/>
+ <size name="GetConvolutionParameterfv" mode="get"/>
+ <size name="GetConvolutionParameteriv" mode="get"/>
+ </enum>
+ <enum name="REDUCE_EXT" value="0x8016"/>
+ <enum name="CONVOLUTION_FORMAT_EXT" count="1" value="0x8017">
+ <size name="GetConvolutionParameterfv" mode="get"/>
+ <size name="GetConvolutionParameteriv" mode="get"/>
+ </enum>
+ <enum name="CONVOLUTION_WIDTH_EXT" count="1" value="0x8018">
+ <size name="GetConvolutionParameterfv" mode="get"/>
+ <size name="GetConvolutionParameteriv" mode="get"/>
+ </enum>
+ <enum name="CONVOLUTION_HEIGHT_EXT" count="1" value="0x8019">
+ <size name="GetConvolutionParameterfv" mode="get"/>
+ <size name="GetConvolutionParameteriv" mode="get"/>
+ </enum>
+ <enum name="MAX_CONVOLUTION_WIDTH_EXT" count="1" value="0x801A">
+ <size name="GetConvolutionParameterfv" mode="get"/>
+ <size name="GetConvolutionParameteriv" mode="get"/>
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="MAX_CONVOLUTION_HEIGHT_EXT" count="1" value="0x801B">
+ <size name="GetConvolutionParameterfv" mode="get"/>
+ <size name="GetConvolutionParameteriv" mode="get"/>
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="POST_CONVOLUTION_RED_SCALE_EXT" count="1" value="0x801C">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="POST_CONVOLUTION_GREEN_SCALE_EXT" count="1" value="0x801D">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="POST_CONVOLUTION_BLUE_SCALE_EXT" count="1" value="0x801E">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="POST_CONVOLUTION_ALPHA_SCALE_EXT" count="1" value="0x801F">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="POST_CONVOLUTION_RED_BIAS_EXT" count="1" value="0x8020">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="POST_CONVOLUTION_GREEN_BIAS_EXT" count="1" value="0x8021">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="POST_CONVOLUTION_BLUE_BIAS_EXT" count="1" value="0x8022">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="POST_CONVOLUTION_ALPHA_BIAS_EXT" count="1" value="0x8023">
+ <size name="Get" mode="get"/>
+ </enum>
+
+ <function name="ConvolutionFilter1DEXT" alias="ConvolutionFilter1D" static_dispatch="false">
+ <param name="target" type="GLenum"/>
+ <param name="internalformat" type="GLenum"/>
+ <param name="width" type="GLsizei"/>
+ <param name="format" type="GLenum"/>
+ <param name="type" type="GLenum"/>
+ <param name="image" type="const GLvoid *"/>
+ </function>
+
+ <function name="ConvolutionFilter2DEXT" alias="ConvolutionFilter2D" static_dispatch="false">
+ <param name="target" type="GLenum"/>
+ <param name="internalformat" type="GLenum"/>
+ <param name="width" type="GLsizei"/>
+ <param name="height" type="GLsizei"/>
+ <param name="format" type="GLenum"/>
+ <param name="type" type="GLenum"/>
+ <param name="image" type="const GLvoid *"/>
+ </function>
+
+ <function name="ConvolutionParameterfEXT" alias="ConvolutionParameterf" static_dispatch="false">
+ <param name="target" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLfloat"/>
+ </function>
+
+ <function name="ConvolutionParameterfvEXT" alias="ConvolutionParameterfv" static_dispatch="false">
+ <param name="target" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="const GLfloat *"/>
+ </function>
+
+ <function name="ConvolutionParameteriEXT" alias="ConvolutionParameteri" static_dispatch="false">
+ <param name="target" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLint"/>
+ </function>
+
+ <function name="ConvolutionParameterivEXT" alias="ConvolutionParameteriv" static_dispatch="false">
+ <param name="target" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="const GLint *"/>
+ </function>
+
+ <function name="CopyConvolutionFilter1DEXT" alias="CopyConvolutionFilter1D" static_dispatch="false">
+ <param name="target" type="GLenum"/>
+ <param name="internalformat" type="GLenum"/>
+ <param name="x" type="GLint"/>
+ <param name="y" type="GLint"/>
+ <param name="width" type="GLsizei"/>
+ </function>
+
+ <function name="CopyConvolutionFilter2DEXT" alias="CopyConvolutionFilter2D" static_dispatch="false">
+ <param name="target" type="GLenum"/>
+ <param name="internalformat" type="GLenum"/>
+ <param name="x" type="GLint"/>
+ <param name="y" type="GLint"/>
+ <param name="width" type="GLsizei"/>
+ <param name="height" type="GLsizei"/>
+ </function>
+
+ <function name="GetConvolutionFilterEXT" alias="GetConvolutionFilter" static_dispatch="false">
+ <param name="target" type="GLenum"/>
+ <param name="format" type="GLenum"/>
+ <param name="type" type="GLenum"/>
+ <param name="image" type="GLvoid *" output="true" img_width="width" img_height="height" img_format="format" img_type="type"/>
+ <glx vendorpriv="1" dimensions_in_reply="true"/>
+ </function>
+
+ <function name="GetConvolutionParameterfvEXT" alias="GetConvolutionParameterfv" static_dispatch="false">
+ <param name="target" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLfloat *" output="true" variable_param="pname"/>
+ <glx vendorpriv="2"/>
+ </function>
+
+ <function name="GetConvolutionParameterivEXT" alias="GetConvolutionParameteriv" static_dispatch="false">
+ <param name="target" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLint *" output="true" variable_param="pname"/>
+ <glx vendorpriv="3"/>
+ </function>
+
+ <function name="GetSeparableFilterEXT" alias="GetSeparableFilter" static_dispatch="false">
+ <param name="target" type="GLenum"/>
+ <param name="format" type="GLenum"/>
+ <param name="type" type="GLenum"/>
+ <param name="row" type="GLvoid *" output="true"/>
+ <param name="column" type="GLvoid *" output="true"/>
+ <param name="span" type="GLvoid *" output="true"/>
+ <glx vendorpriv="4" handcode="true"/>
+ </function>
+
+ <function name="SeparableFilter2DEXT" alias="SeparableFilter2D" static_dispatch="false">
+ <param name="target" type="GLenum"/>
+ <param name="internalformat" type="GLenum"/>
+ <param name="width" type="GLsizei"/>
+ <param name="height" type="GLsizei"/>
+ <param name="format" type="GLenum"/>
+ <param name="type" type="GLenum"/>
+ <param name="row" type="const GLvoid *"/>
+ <param name="column" type="const GLvoid *"/>
+ </function>
+</category>
+
+<category name="GL_SGI_color_matrix" number="13">
+ <enum name="COLOR_MATRIX_SGI" value="0x80B1"/>
+ <enum name="COLOR_MATRIX_STACK_DEPTH_SGI" value="0x80B2"/>
+ <enum name="MAX_COLOR_MATRIX_STACK_DEPTH_SGI" value="0x80B3"/>
+ <enum name="POST_COLOR_MATRIX_RED_SCALE_SGI" value="0x80B4"/>
+ <enum name="POST_COLOR_MATRIX_GREEN_SCALE_SGI" value="0x80B5"/>
+ <enum name="POST_COLOR_MATRIX_BLUE_SCALE_SGI" value="0x80B6"/>
+ <enum name="POST_COLOR_MATRIX_ALPHA_SCALE_SGI" value="0x80B7"/>
+ <enum name="POST_COLOR_MATRIX_RED_BIAS_SGI" value="0x80B8"/>
+ <enum name="POST_COLOR_MATRIX_GREEN_BIAS_SGI" value="0x80B9"/>
+ <enum name="POST_COLOR_MATRIX_BLUE_BIAS_SGI" value="0x80BA"/>
+ <enum name="POST_COLOR_MATRIX_ALPHA_BIAS_SGI" value="0x80BB"/>
+</category>
+
+<category name="GL_SGI_color_table" number="14">
+ <enum name="COLOR_TABLE_SCALE_SGI" count="4" value="0x80D6">
+ <size name="ColorTableParameterfvSGI"/>
+ <size name="ColorTableParameterivSGI"/>
+ <size name="GetColorTableParameterfvSGI" mode="get"/>
+ <size name="GetColorTableParameterivSGI" mode="get"/>
+ </enum>
+ <enum name="COLOR_TABLE_BIAS_SGI" count="4" value="0x80D7">
+ <size name="ColorTableParameterfvSGI"/>
+ <size name="ColorTableParameterivSGI"/>
+ <size name="GetColorTableParameterfvSGI" mode="get"/>
+ <size name="GetColorTableParameterivSGI" mode="get"/>
+ </enum>
+ <enum name="COLOR_TABLE_FORMAT_SGI" count="1" value="0x80D8">
+ <size name="GetColorTableParameterfvSGI" mode="get"/>
+ <size name="GetColorTableParameterivSGI" mode="get"/>
+ </enum>
+ <enum name="COLOR_TABLE_WIDTH_SGI" count="1" value="0x80D9">
+ <size name="GetColorTableParameterfvSGI" mode="get"/>
+ <size name="GetColorTableParameterivSGI" mode="get"/>
+ </enum>
+ <enum name="COLOR_TABLE_RED_SIZE_SGI" count="1" value="0x80DA">
+ <size name="GetColorTableParameterfvSGI" mode="get"/>
+ <size name="GetColorTableParameterivSGI" mode="get"/>
+ </enum>
+ <enum name="COLOR_TABLE_GREEN_SIZE_SGI" count="1" value="0x80DB">
+ <size name="GetColorTableParameterfvSGI" mode="get"/>
+ <size name="GetColorTableParameterivSGI" mode="get"/>
+ </enum>
+ <enum name="COLOR_TABLE_BLUE_SIZE_SGI" count="1" value="0x80DC">
+ <size name="GetColorTableParameterfvSGI" mode="get"/>
+ <size name="GetColorTableParameterivSGI" mode="get"/>
+ </enum>
+ <enum name="COLOR_TABLE_ALPHA_SIZE_SGI" count="1" value="0x80DD">
+ <size name="GetColorTableParameterfvSGI" mode="get"/>
+ <size name="GetColorTableParameterivSGI" mode="get"/>
+ </enum>
+ <enum name="COLOR_TABLE_LUMINANCE_SIZE_SGI" count="1" value="0x80DE">
+ <size name="GetColorTableParameterfvSGI" mode="get"/>
+ <size name="GetColorTableParameterivSGI" mode="get"/>
+ </enum>
+ <enum name="COLOR_TABLE_INTENSITY_SIZE_SGI" count="1" value="0x80DF">
+ <size name="GetColorTableParameterfvSGI" mode="get"/>
+ <size name="GetColorTableParameterivSGI" mode="get"/>
+ </enum>
+
+ <function name="ColorTableSGI" alias="ColorTable" static_dispatch="false">
+ <param name="target" type="GLenum"/>
+ <param name="internalformat" type="GLenum"/>
+ <param name="width" type="GLsizei"/>
+ <param name="format" type="GLenum"/>
+ <param name="type" type="GLenum"/>
+ <param name="table" type="const GLvoid *"/>
+ </function>
+
+ <function name="ColorTableParameterfvSGI" alias="ColorTableParameterfv" static_dispatch="false">
+ <param name="target" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="const GLfloat *"/>
+ </function>
+
+ <function name="ColorTableParameterivSGI" alias="ColorTableParameteriv" static_dispatch="false">
+ <param name="target" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="const GLint *"/>
+ </function>
+
+ <function name="CopyColorTableSGI" alias="CopyColorTable" static_dispatch="false">
+ <param name="target" type="GLenum"/>
+ <param name="internalformat" type="GLenum"/>
+ <param name="x" type="GLint"/>
+ <param name="y" type="GLint"/>
+ <param name="width" type="GLsizei"/>
+ </function>
+
+ <function name="GetColorTableSGI" alias="GetColorTable" static_dispatch="false">
+ <param name="target" type="GLenum"/>
+ <param name="format" type="GLenum"/>
+ <param name="type" type="GLenum"/>
+ <param name="table" type="GLvoid *" output="true" img_width="width" img_format="format" img_type="type"/>
+ <glx vendorpriv="4098" dimensions_in_reply="true"/>
+ </function>
+
+ <function name="GetColorTableParameterfvSGI" alias="GetColorTableParameterfv" static_dispatch="false">
+ <param name="target" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLfloat *" output="true" variable_param="pname"/>
+ <glx vendorpriv="4099"/>
+ </function>
+
+ <function name="GetColorTableParameterivSGI" alias="GetColorTableParameteriv" static_dispatch="false">
+ <param name="target" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLint *" output="true" variable_param="pname"/>
+ <glx vendorpriv="4100"/>
+ </function>
+</category>
+
+<category name="GL_SGIS_pixel_texture" number="15">
+ <function name="PixelTexGenParameteriSGIS" offset="assign" static_dispatch="false">
+ <param name="pname" type="GLenum"/>
+ <param name="param" type="GLint"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="PixelTexGenParameterivSGIS" offset="assign" static_dispatch="false">
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="const GLint *"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="PixelTexGenParameterfSGIS" offset="assign" static_dispatch="false">
+ <param name="pname" type="GLenum"/>
+ <param name="param" type="GLfloat"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="PixelTexGenParameterfvSGIS" offset="assign" static_dispatch="false">
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="const GLfloat *"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="GetPixelTexGenParameterivSGIS" offset="assign" static_dispatch="false">
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLint *" output="true" variable_param="pname"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="GetPixelTexGenParameterfvSGIS" offset="assign" static_dispatch="false">
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLfloat *" output="true" variable_param="pname"/>
+ <glx ignore="true"/>
+ </function>
+</category>
+
+<category name="GL_SGIS_texture4D" number="16">
+ <function name="TexImage4DSGIS">
+ <param name="target" type="GLenum"/>
+ <param name="level" type="GLint"/>
+ <param name="internalformat" type="GLenum"/>
+ <param name="width" type="GLsizei"/>
+ <param name="height" type="GLsizei"/>
+ <param name="depth" type="GLsizei"/>
+ <param name="size4d" type="GLsizei"/>
+ <param name="border" type="GLint"/>
+ <param name="format" type="GLenum"/>
+ <param name="type" type="GLenum"/>
+ <param name="pixels" type="const GLvoid *" img_width="width" img_height="height" img_depth="depth" img_extent="size4d" img_format="format" img_type="type" img_target="target" img_null_flag="true" img_pad_dimensions="true"/>
+ <glx rop="2057" ignore="true"/>
+ </function>
+
+ <function name="TexSubImage4DSGIS">
+ <param name="target" type="GLenum"/>
+ <param name="level" type="GLint"/>
+ <param name="xoffset" type="GLint"/>
+ <param name="yoffset" type="GLint"/>
+ <param name="zoffset" type="GLint"/>
+ <param name="woffset" type="GLint"/>
+ <param name="width" type="GLsizei"/>
+ <param name="height" type="GLsizei"/>
+ <param name="depth" type="GLsizei"/>
+ <param name="size4d" type="GLsizei"/>
+ <param name="format" type="GLenum"/>
+ <param name="type" type="GLenum"/>
+ <param name="UNUSED" type="GLuint" padding="true"/>
+ <param name="pixels" type="const GLvoid *" img_width="width" img_height="height" img_depth="depth" img_extent="size4d" img_xoff="xoffset" img_yoff="yoffset" img_zoff="zoffset" img_woff="woffset" img_format="format" img_type="type" img_target="target" img_pad_dimensions="true"/>
+ <glx rop="2058" ignore="true"/>
+ </function>
+</category>
+
+<category name="GL_SGI_texture_color_table" number="17">
+ <enum name="TEXTURE_COLOR_TABLE_SGI" value="0x80BC"/>
+ <enum name="PROXY_TEXTURE_COLOR_TABLE_SGI" value="0x80BD"/>
+</category>
+
+<!-- Extension number 19 is not listed in the extension registry. -->
+
+<category name="GL_EXT_texture_object" number="20">
+ <function name="AreTexturesResidentEXT" alias="AreTexturesResident">
+ <param name="n" type="GLsizei" counter="true"/>
+ <param name="textures" type="const GLuint *" count="n"/>
+ <param name="residences" type="GLboolean *" output="true" count="n"/>
+ <return type="GLboolean"/>
+ <glx vendorpriv="11" handcode="client" always_array="true"/>
+ </function>
+
+ <function name="BindTextureEXT" alias="BindTexture">
+ <param name="target" type="GLenum"/>
+ <param name="texture" type="GLuint"/>
+ </function>
+
+ <function name="DeleteTexturesEXT" alias="DeleteTextures">
+ <param name="n" type="GLsizei" counter="true"/>
+ <param name="textures" type="const GLuint *" count="n"/>
+ <glx vendorpriv="12"/>
+ </function>
+
+ <function name="GenTexturesEXT" alias="GenTextures">
+ <param name="n" type="GLsizei" counter="true"/>
+ <param name="textures" type="GLuint *" output="true" count="n"/>
+ <glx vendorpriv="13" always_array="true"/>
+ </function>
+
+ <function name="IsTextureEXT" alias="IsTexture">
+ <param name="texture" type="GLuint"/>
+ <return type="GLboolean"/>
+ <glx vendorpriv="14"/>
+ </function>
+
+ <function name="PrioritizeTexturesEXT" alias="PrioritizeTextures">
+ <param name="n" type="GLsizei"/>
+ <param name="textures" type="const GLuint *"/>
+ <param name="priorities" type="const GLclampf *"/>
+ </function>
+</category>
+
+<category name="GL_SGIS_detail_texture" number="21">
+ <function name="DetailTexFuncSGIS">
+ <param name="target" type="GLenum"/>
+ <param name="n" type="GLsizei" counter="true"/>
+ <param name="points" type="const GLfloat *" count="n"/>
+ <glx rop="2051" ignore="true"/>
+ </function>
+
+ <function name="GetDetailTexFuncSGIS">
+ <param name="target" type="GLenum"/>
+ <param name="points" type="GLfloat *" output="true"/>
+ <glx vendorpriv="4096" ignore="true"/>
+ </function>
+</category>
+
+<category name="GL_SGIS_sharpen_texture" number="22">
+ <function name="SharpenTexFuncSGIS">
+ <param name="target" type="GLenum"/>
+ <param name="n" type="GLsizei" counter="true"/>
+ <param name="points" type="const GLfloat *" count="n" count_scale="2"/>
+ <glx rop="2052" ignore="true"/>
+ </function>
+
+ <function name="GetSharpenTexFuncSGIS">
+ <param name="target" type="GLenum"/>
+ <param name="points" type="GLfloat *" output="true"/>
+ <glx vendorpriv="4097" ignore="true"/>
+ </function>
+</category>
+
+<category name="GL_SGIS_multisample" number="25">
+ <function name="SampleMaskSGIS" offset="assign" static_dispatch="false">
+ <param name="value" type="GLclampf"/>
+ <param name="invert" type="GLboolean"/>
+ <glx rop="2048"/>
+ </function>
+
+ <function name="SamplePatternSGIS" offset="assign" static_dispatch="false">
+ <param name="pattern" type="GLenum"/>
+ <glx rop="2049"/>
+ </function>
+</category>
+
+<!-- Extension number 26 is not listed in the extension registry. -->
+
+<category name="GL_EXT_rescale_normal" number="27">
+ <enum name="RESCALE_NORMAL_EXT" count="1" value="0x803A">
+ <size name="Get" mode="get"/>
+ </enum>
+</category>
+
+<!-- Extension number 28 is a GLX extension. -->
+<!-- Extension number 29 is not listed in the extension registry. -->
+
+<category name="GL_EXT_vertex_array" number="30">
+ <function name="ArrayElementEXT" alias="ArrayElement">
+ <param name="i" type="GLint"/>
+ </function>
+
+ <function name="ColorPointerEXT" offset="assign">
+ <param name="size" type="GLint"/>
+ <param name="type" type="GLenum"/>
+ <param name="stride" type="GLsizei"/>
+ <param name="count" type="GLsizei"/>
+ <param name="pointer" type="const GLvoid *"/>
+ <glx handcode="true"/>
+ </function>
+
+ <function name="DrawArraysEXT" alias="DrawArrays">
+ <param name="mode" type="GLenum"/>
+ <param name="first" type="GLint"/>
+ <param name="count" type="GLsizei"/>
+ </function>
+
+ <function name="EdgeFlagPointerEXT" offset="assign">
+ <param name="stride" type="GLsizei"/>
+ <param name="count" type="GLsizei"/>
+ <param name="pointer" type="const GLboolean *"/>
+ <glx handcode="true"/>
+ </function>
+
+ <function name="GetPointervEXT" alias="GetPointerv">
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLvoid **" output="true"/>
+ </function>
+
+ <function name="IndexPointerEXT" offset="assign">
+ <param name="type" type="GLenum"/>
+ <param name="stride" type="GLsizei"/>
+ <param name="count" type="GLsizei"/>
+ <param name="pointer" type="const GLvoid *"/>
+ <glx handcode="true"/>
+ </function>
+
+ <function name="NormalPointerEXT" offset="assign">
+ <param name="type" type="GLenum"/>
+ <param name="stride" type="GLsizei"/>
+ <param name="count" type="GLsizei"/>
+ <param name="pointer" type="const GLvoid *"/>
+ <glx handcode="true"/>
+ </function>
+
+ <function name="TexCoordPointerEXT" offset="assign">
+ <param name="size" type="GLint"/>
+ <param name="type" type="GLenum"/>
+ <param name="stride" type="GLsizei"/>
+ <param name="count" type="GLsizei"/>
+ <param name="pointer" type="const GLvoid *"/>
+ <glx handcode="true"/>
+ </function>
+
+ <function name="VertexPointerEXT" offset="assign">
+ <param name="size" type="GLint"/>
+ <param name="type" type="GLenum"/>
+ <param name="stride" type="GLsizei"/>
+ <param name="count" type="GLsizei"/>
+ <param name="pointer" type="const GLvoid *"/>
+ <glx handcode="true"/>
+ </function>
+</category>
+
+<category name="GL_SGIS_generate_mipmap" number="32">
+ <enum name="GENERATE_MIPMAP_SGIS" count="1" value="0x8191">
+ <size name="TexParameterfv" mode="get"/>
+ <size name="TexParameteriv" mode="get"/>
+ <size name="GetTexParameterfv" mode="get"/>
+ <size name="GetTexParameteriv" mode="get"/>
+ </enum>
+ <enum name="GENERATE_MIPMAP_HINT_SGIS" value="0x8192"/>
+</category>
+
+<category name="GL_SGIX_clipmap" number="33">
+ <enum name="LINEAR_CLIPMAP_LINEAR_SGIX" value="0x8170"/>
+ <enum name="TEXTURE_CLIPMAP_CENTER_SGIX" count="2" value="0x8171">
+ <size name="TexParameterfv" mode="get"/>
+ <size name="TexParameteriv" mode="get"/>
+ <size name="GetTexParameterfv" mode="get"/>
+ <size name="GetTexParameteriv" mode="get"/>
+ </enum>
+ <enum name="TEXTURE_CLIPMAP_FRAME_SGIX" count="1" value="0x8172">
+ <size name="TexParameterfv" mode="get"/>
+ <size name="TexParameteriv" mode="get"/>
+ <size name="GetTexParameterfv" mode="get"/>
+ <size name="GetTexParameteriv" mode="get"/>
+ </enum>
+ <enum name="TEXTURE_CLIPMAP_OFFSET_SGIX" count="2" value="0x8173">
+ <size name="TexParameterfv" mode="get"/>
+ <size name="TexParameteriv" mode="get"/>
+ <size name="GetTexParameterfv" mode="get"/>
+ <size name="GetTexParameteriv" mode="get"/>
+ </enum>
+ <enum name="TEXTURE_CLIPMAP_VIRTUAL_DEPTH_SGIX" count="3" value="0x8174">
+ <size name="TexParameterfv" mode="get"/>
+ <size name="TexParameteriv" mode="get"/>
+ <size name="GetTexParameterfv" mode="get"/>
+ <size name="GetTexParameteriv" mode="get"/>
+ </enum>
+ <enum name="TEXTURE_CLIPMAP_LOD_OFFSET_SGIX" value="0x8175"/>
+ <enum name="TEXTURE_CLIPMAP_DEPTH_SGIX" value="0x8176"/>
+ <enum name="MAX_CLIPMAP_DEPTH_SGIX" value="0x8177"/>
+ <enum name="MAX_CLIPMAP_VIRTUAL_DEPTH_SGIX" value="0x8178"/>
+ <enum name="NEAREST_CLIPMAP_NEAREST_SGIX" value="0x844D"/>
+ <enum name="NEAREST_CLIPMAP_LINEAR_SGIX" value="0x844E"/>
+ <enum name="LINEAR_CLIPMAP_NEAREST_SGIX" value="0x844F"/>
+</category>
+
+<category name="GL_SGIX_shadow" number="34">
+ <enum name="TEXTURE_COMPARE_SGIX" count="1" value="0x819A">
+ <size name="TexParameterfv" mode="get"/>
+ <size name="TexParameteriv" mode="get"/>
+ <size name="GetTexParameterfv" mode="get"/>
+ <size name="GetTexParameteriv" mode="get"/>
+ </enum>
+ <enum name="TEXTURE_COMPARE_OPERATOR_SGIX" count="1" value="0x819B">
+ <size name="TexParameterfv" mode="get"/>
+ <size name="TexParameteriv" mode="get"/>
+ <size name="GetTexParameterfv" mode="get"/>
+ <size name="GetTexParameteriv" mode="get"/>
+ </enum>
+ <enum name="TEXTURE_LEQUAL_R_SGIX" value="0x819C"/>
+ <enum name="TEXTURE_GEQUAL_R_SGIX" value="0x819D"/>
+</category>
+
+<category name="GL_SGIS_texture_edge_clamp" number="35">
+ <enum name="CLAMP_TO_EDGE_SGIS" value="0x812F"/>
+</category>
+
+<category name="GL_SGIS_texture_border_clamp" number="36">
+ <enum name="CLAMP_TO_BORDER_SGIS" value="0x812D"/>
+</category>
+
+<category name="GL_EXT_blend_minmax" number="37">
+ <enum name="FUNC_ADD_EXT" value="0x8006"/>
+ <enum name="MIN_EXT" value="0x8007"/>
+ <enum name="MAX_EXT" value="0x8008"/>
+ <enum name="BLEND_EQUATION_EXT" count="1" value="0x8009">
+ <size name="Get" mode="get"/>
+ </enum>
+
+ <function name="BlendEquationEXT" alias="BlendEquation">
+ <param name="mode" type="GLenum"/>
+ </function>
+</category>
+
+<category name="GL_EXT_blend_subtract" number="38">
+ <enum name="FUNC_SUBTRACT_EXT" value="0x800A"/>
+ <enum name="FUNC_REVERSE_SUBTRACT_EXT" value="0x800B"/>
+
+ <!-- <function name="BlendEquationEXT" alias="BlendEquation">
+ <param name="mode" type="GLenum"/>
+ </function> -->
+</category>
+
+<!-- Extension number 40 is a GLX extension. -->
+<!-- Extension number 41 is a GLX extension. -->
+<!-- Extension number 42 is a GLX extension. -->
+<!-- Extension number 43 is a GLX extension. -->
+<!-- Extension number 44 is a GLX extension. -->
+<!-- Extension number 46 is not listed in the extension registry. -->
+<!-- Extension number 47 is a GLX extension. -->
+<!-- Extension number 48 is not listed in the extension registry. -->
+<!-- Extension number 49 is a GLX extension. -->
+<!-- Extension number 50 is a GLX extension. -->
+
+<category name="GL_SGIX_sprite" number="52">
+ <function name="SpriteParameterfSGIX">
+ <param name="pname" type="GLenum"/>
+ <param name="param" type="GLfloat"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="SpriteParameterfvSGIX">
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="const GLfloat *"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="SpriteParameteriSGIX">
+ <param name="pname" type="GLenum"/>
+ <param name="param" type="GLint"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="SpriteParameterivSGIX">
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="const GLint *"/>
+ <glx ignore="true"/>
+ </function>
+</category>
+
+<category name="GL_EXT_point_parameters" number="54">
+ <enum name="POINT_SIZE_MIN_EXT" count="1" value="0x8126">
+ <size name="PointParameterfvEXT" mode="get"/>
+ </enum>
+ <enum name="POINT_SIZE_MAX_EXT" count="1" value="0x8127">
+ <size name="PointParameterfvEXT" mode="get"/>
+ </enum>
+ <enum name="POINT_FADE_THRESHOLD_SIZE_EXT" count="1" value="0x8128">
+ <size name="PointParameterfvEXT" mode="get"/>
+ </enum>
+ <enum name="POINT_DISTANCE_ATTENUATION_EXT" count="3" value="0x8129">
+ <size name="PointParameterfvEXT" mode="get"/>
+ </enum>
+
+ <function name="PointParameterfEXT" offset="assign">
+ <param name="pname" type="GLenum"/>
+ <param name="param" type="GLfloat"/>
+ <glx rop="2065"/>
+ </function>
+
+ <function name="PointParameterfvEXT" offset="assign">
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="const GLfloat *" variable_param="pname"/>
+ <glx rop="2066"/>
+ </function>
+</category>
+
+<category name="GL_SGIX_instruments" number="55">
+ <function name="GetInstrumentsSGIX">
+ <return type="GLint"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="InstrumentsBufferSGIX">
+ <param name="size" type="GLsizei"/>
+ <param name="buffer" type="GLint *" output="true"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="PollInstrumentsSGIX">
+ <param name="marker_p" type="GLint *" output="true"/>
+ <return type="GLint"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="ReadInstrumentsSGIX">
+ <param name="marker" type="GLint"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="StartInstrumentsSGIX">
+ <glx ignore="true"/>
+ </function>
+
+ <function name="StopInstrumentsSGIX">
+ <param name="marker" type="GLint"/>
+ <glx ignore="true"/>
+ </function>
+</category>
+
+<category name="GL_SGIX_texture_scale_bias" number="56">
+ <enum name="POST_TEXTURE_FILTER_BIAS_SGIX" count="4" value="0x8179">
+ <size name="TexParameterfv" mode="get"/>
+ <size name="TexParameteriv" mode="get"/>
+ <size name="GetTexParameterfv" mode="get"/>
+ <size name="GetTexParameteriv" mode="get"/>
+ </enum>
+ <enum name="POST_TEXTURE_FILTER_SCALE_SGIX" count="4" value="0x817A">
+ <size name="TexParameterfv" mode="get"/>
+ <size name="TexParameteriv" mode="get"/>
+ <size name="GetTexParameterfv" mode="get"/>
+ <size name="GetTexParameteriv" mode="get"/>
+ </enum>
+ <enum name="POST_TEXTURE_FILTER_BIAS_RANGE_SGIX" value="0x817B"/>
+ <enum name="POST_TEXTURE_FILTER_SCALE_RANGE_SGIX" value="0x817C"/>
+</category>
+
+<category name="GL_SGIX_framezoom" number="57">
+ <function name="FrameZoomSGIX">
+ <param name="factor" type="GLint"/>
+ <glx rop="2072" ignore="true"/>
+ </function>
+</category>
+
+<category name="GL_SGIX_tag_sample_buffer" number="58">
+ <function name="TagSampleBufferSGIX">
+ <glx rop="2050" ignore="true"/>
+ </function>
+</category>
+
+<!-- Extension number 59 is not listed in the extension registry. -->
+
+<category name="GL_SGIX_reference_plane" number="60">
+ <function name="ReferencePlaneSGIX">
+ <param name="equation" type="const GLdouble *" count="4"/>
+ <glx rop="2071" ignore="true"/>
+ </function>
+</category>
+
+<category name="GL_SGIX_flush_raster" number="61">
+ <function name="FlushRasterSGIX">
+ <glx vendorpriv="4105" ignore="true"/>
+ </function>
+</category>
+
+<!-- Extension number 62 is a GLX extension. -->
+
+<category name="GL_SGIX_depth_texture" number="63">
+ <enum name="DEPTH_COMPONENT16_SGIX" value="0x81A5"/>
+ <enum name="DEPTH_COMPONENT24_SGIX" value="0x81A6"/>
+ <enum name="DEPTH_COMPONENT32_SGIX" value="0x81A7"/>
+</category>
+
+<category name="GL_SGIS_fog_function" number="64">
+ <function name="FogFuncSGIS">
+ <param name="n" type="GLsizei" counter="true"/>
+ <param name="points" type="const GLfloat *" count="n" count_scale="2"/>
+ <glx rop="2067" ignore="true"/>
+ </function>
+
+ <function name="GetFogFuncSGIS">
+ <param name="points" type="GLfloat *" output="true"/>
+ <!-- GLX protocol for this function is unknown. -->
+ </function>
+</category>
+
+<category name="GL_SGIX_fog_offset" number="65">
+ <enum name="FOG_OFFSET_SGIX" value="0x8198"/>
+ <enum name="FOG_OFFSET_VALUE_SGIX" count="1" value="0x8199">
+ <size name="Fogfv" mode="get"/>
+ <size name="Fogiv" mode="get"/>
+ </enum>
+</category>
+
+<category name="GL_HP_image_transform" number="66">
+ <function name="ImageTransformParameteriHP">
+ <param name="target" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="param" type="GLint"/>
+ </function>
+
+ <function name="ImageTransformParameterfHP">
+ <param name="target" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="param" type="GLfloat"/>
+ </function>
+
+ <function name="ImageTransformParameterivHP">
+ <param name="target" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="const GLint *"/>
+ </function>
+
+ <function name="ImageTransformParameterfvHP">
+ <param name="target" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="const GLfloat *"/>
+ </function>
+
+ <function name="GetImageTransformParameterivHP">
+ <param name="target" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLint *" output="true" variable_param="pname"/>
+ </function>
+
+ <function name="GetImageTransformParameterfvHP">
+ <param name="target" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLfloat *" output="true" variable_param="pname"/>
+ </function>
+</category>
+
+<category name="GL_HP_convolution_border_modes" number="67">
+ <enum name="IGNORE_BORDER_HP" value="0x8150"/>
+ <enum name="CONSTANT_BORDER_HP" value="0x8151"/>
+ <enum name="REPLICATE_BORDER_HP" value="0x8153"/>
+ <enum name="CONVOLUTION_BORDER_COLOR_HP" count="4" value="0x8154">
+ <size name="ConvolutionParameterfv" mode="get"/>
+ <size name="ConvolutionParameteriv" mode="get"/>
+ <size name="GetConvolutionParameterfv" mode="get"/>
+ <size name="GetConvolutionParameteriv" mode="get"/>
+ </enum>
+</category>
+
+<!-- Extension number 68 is not listed in the extension registry. -->
+<!-- Extension number 70 is not listed in the extension registry. -->
+<!-- Extension number 71 is not listed in the extension registry. -->
+<!-- Extension number 72 is not listed in the extension registry. -->
+<!-- Extension number 73 is not listed in the extension registry. -->
+
+<category name="GL_EXT_color_subtable" number="74">
+ <function name="ColorSubTableEXT" alias="ColorSubTable" static_dispatch="false">
+ <param name="target" type="GLenum"/>
+ <param name="start" type="GLsizei"/>
+ <param name="count" type="GLsizei"/>
+ <param name="format" type="GLenum"/>
+ <param name="type" type="GLenum"/>
+ <param name="data" type="const GLvoid *"/>
+ </function>
+
+ <function name="CopyColorSubTableEXT" alias="CopyColorSubTable" static_dispatch="false">
+ <param name="target" type="GLenum"/>
+ <param name="start" type="GLsizei"/>
+ <param name="x" type="GLint"/>
+ <param name="y" type="GLint"/>
+ <param name="width" type="GLsizei"/>
+ </function>
+</category>
+
+<!-- Extension number 75 is a GLU extension. -->
+
+<category name="GL_PGI_misc_hints" number="77">
+ <function name="HintPGI">
+ <param name="target" type="GLenum"/>
+ <param name="mode" type="GLint"/>
+ <glx ignore="true"/>
+ </function>
+</category>
+
+<category name="GL_EXT_paletted_texture" number="78">
+ <enum name="COLOR_TABLE_FORMAT_EXT" count="1" value="0x80D8">
+ <size name="GetColorTableParameterfv" mode="get"/>
+ <size name="GetColorTableParameteriv" mode="get"/>
+ </enum>
+ <enum name="COLOR_TABLE_WIDTH_EXT" count="1" value="0x80D9">
+ <size name="GetColorTableParameterfv" mode="get"/>
+ <size name="GetColorTableParameteriv" mode="get"/>
+ </enum>
+ <enum name="COLOR_TABLE_RED_SIZE_EXT" count="1" value="0x80DA">
+ <size name="GetColorTableParameterfv" mode="get"/>
+ <size name="GetColorTableParameteriv" mode="get"/>
+ </enum>
+ <enum name="COLOR_TABLE_GREEN_SIZE_EXT" count="1" value="0x80DB">
+ <size name="GetColorTableParameterfv" mode="get"/>
+ <size name="GetColorTableParameteriv" mode="get"/>
+ </enum>
+ <enum name="COLOR_TABLE_BLUE_SIZE_EXT" count="1" value="0x80DC">
+ <size name="GetColorTableParameterfv" mode="get"/>
+ <size name="GetColorTableParameteriv" mode="get"/>
+ </enum>
+ <enum name="COLOR_TABLE_ALPHA_SIZE_EXT" count="1" value="0x80DD">
+ <size name="GetColorTableParameterfv" mode="get"/>
+ <size name="GetColorTableParameteriv" mode="get"/>
+ </enum>
+ <enum name="COLOR_TABLE_LUMINANCE_SIZE_EXT" count="1" value="0x80DE">
+ <size name="GetColorTableParameterfv" mode="get"/>
+ <size name="GetColorTableParameteriv" mode="get"/>
+ </enum>
+ <enum name="COLOR_TABLE_INTENSITY_SIZE_EXT" count="1" value="0x80DF">
+ <size name="GetColorTableParameterfv" mode="get"/>
+ <size name="GetColorTableParameteriv" mode="get"/>
+ </enum>
+ <enum name="TEXTURE_INDEX_SIZE_EXT" count="1" value="0x80ED">
+ <size name="GetTexLevelParameterfv" mode="get"/>
+ <size name="GetTexLevelParameteriv" mode="get"/>
+ </enum>
+
+ <function name="ColorTableEXT" alias="ColorTable">
+ <param name="target" type="GLenum"/>
+ <param name="internalformat" type="GLenum"/>
+ <param name="width" type="GLsizei"/>
+ <param name="format" type="GLenum"/>
+ <param name="type" type="GLenum"/>
+ <param name="table" type="const GLvoid *"/>
+ </function>
+
+ <function name="GetColorTableEXT" alias="GetColorTable">
+ <param name="target" type="GLenum"/>
+ <param name="format" type="GLenum"/>
+ <param name="type" type="GLenum"/>
+ <param name="table" type="GLvoid *" output="true" img_width="width" img_format="format" img_type="type"/>
+ <glx vendorpriv="4098" dimensions_in_reply="true"/>
+ </function>
+
+ <function name="GetColorTableParameterivEXT" alias="GetColorTableParameteriv">
+ <param name="target" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLint *" output="true" variable_param="pname"/>
+ <glx vendorpriv="4100"/>
+ </function>
+
+ <function name="GetColorTableParameterfvEXT" alias="GetColorTableParameterfv">
+ <param name="target" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLfloat *" output="true" variable_param="pname"/>
+ <glx vendorpriv="4099"/>
+ </function>
+</category>
+
+<category name="GL_EXT_clip_volume_hint" number="79">
+ <enum name="CLIP_VOLUME_CLIPPING_HINT_EXT" count="1" value="0x80F0">
+ <size name="Get" mode="get"/>
+ </enum>
+</category>
+
+<category name="GL_SGIX_list_priority" number="80">
+ <function name="GetListParameterfvSGIX">
+ <param name="list" type="GLuint"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLfloat *" output="true" variable_param="pname"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="GetListParameterivSGIX">
+ <param name="list" type="GLuint"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLint *" output="true" variable_param="pname"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="ListParameterfSGIX">
+ <param name="list" type="GLuint"/>
+ <param name="pname" type="GLenum"/>
+ <param name="param" type="GLfloat"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="ListParameterfvSGIX">
+ <param name="list" type="GLuint"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="const GLfloat *"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="ListParameteriSGIX">
+ <param name="list" type="GLuint"/>
+ <param name="pname" type="GLenum"/>
+ <param name="param" type="GLint"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="ListParameterivSGIX">
+ <param name="list" type="GLuint"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="const GLint *"/>
+ <glx ignore="true"/>
+ </function>
+</category>
+
+<!-- Extension number 82 is not listed in the extension registry. -->
+<!-- Extension number 83 is a GLX extension. -->
+
+<category name="GL_SGIX_texture_lod_bias" number="84">
+ <enum name="TEXTURE_LOD_BIAS_S_SGIX" count="1" value="0x818E">
+ <size name="TexParameterfv" mode="get"/>
+ <size name="TexParameteriv" mode="get"/>
+ <size name="GetTexParameterfv" mode="get"/>
+ <size name="GetTexParameteriv" mode="get"/>
+ </enum>
+ <enum name="TEXTURE_LOD_BIAS_T_SGIX" count="1" value="0x818F">
+ <size name="TexParameterfv" mode="get"/>
+ <size name="TexParameteriv" mode="get"/>
+ <size name="GetTexParameterfv" mode="get"/>
+ <size name="GetTexParameteriv" mode="get"/>
+ </enum>
+ <enum name="TEXTURE_LOD_BIAS_R_SGIX" count="1" value="0x8190">
+ <size name="TexParameterfv" mode="get"/>
+ <size name="TexParameteriv" mode="get"/>
+ <size name="GetTexParameterfv" mode="get"/>
+ <size name="GetTexParameteriv" mode="get"/>
+ </enum>
+</category>
+
+<!-- Extension number 85 is a GLU extension. -->
+<!-- Extension number 86 is a GLX extension. -->
+<!-- Extension number 87 is not listed in the extension registry. -->
+<!-- Extension number 88 is not listed in the extension registry. -->
+<!-- Extension number 89 is not listed in the extension registry. -->
+
+
+<category name="GL_SGIX_shadow_ambient" number="90">
+ <enum name="SHADOW_AMBIENT_SGIX" count="1" value="0x80BF">
+ <size name="TexParameterfv" mode="get"/>
+ <size name="TexParameteriv" mode="get"/>
+ <size name="GetTexParameterfv" mode="get"/>
+ <size name="GetTexParameteriv" mode="get"/>
+ </enum>
+</category>
+
+<!-- Extension number 91 is a GLX extension. -->
+<!-- Extension number 92 is a GLX extension. -->
+
+<category name="GL_EXT_index_material" number="94">
+ <function name="IndexMaterialEXT">
+ <param name="face" type="GLenum"/>
+ <param name="mode" type="GLenum"/>
+ <glx ignore="true"/>
+ </function>
+</category>
+
+<category name="GL_EXT_index_func" number="95">
+ <function name="IndexFuncEXT">
+ <param name="func" type="GLenum"/>
+ <param name="ref" type="GLclampf"/>
+ <glx ignore="true"/>
+ </function>
+</category>
+
+<category name="GL_EXT_compiled_vertex_array" number="97">
+ <function name="LockArraysEXT" offset="assign">
+ <param name="first" type="GLint"/>
+ <param name="count" type="GLsizei"/>
+ <glx handcode="true" ignore="true"/>
+ </function>
+
+ <function name="UnlockArraysEXT" offset="assign">
+ <glx handcode="true" ignore="true"/>
+ </function>
+</category>
+
+<category name="GL_EXT_cull_vertex" number="98">
+ <enum name="CULL_VERTEX_EXT" value="0x81AA"/>
+ <enum name="CULL_VERTEX_OBJECT_POSITION_EXT" count="4" value="0x81AB">
+ <size name="CullParameterfv"/>
+ <size name="CullParameterdv"/>
+ </enum>
+ <enum name="CULL_VERTEX_EYE_POSITION_EXT" count="4" value="0x81AC">
+ <size name="CullParameterfv"/>
+ <size name="CullParameterdv"/>
+ </enum>
+
+ <function name="CullParameterdvEXT">
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLdouble *"/> <!-- Spec bug. Should be const. -->
+ <glx ignore="true"/>
+ </function>
+
+ <function name="CullParameterfvEXT">
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLfloat *"/> <!-- Spec bug. Should be const. -->
+ <glx ignore="true"/>
+ </function>
+</category>
+
+<!-- Extension number 99 is not listed in the extension registry. -->
+<!-- Extension number 100 is a GLU extension. -->
+
+<!-- Shouldn't this be EXT_fragment_lighting? -->
+<category name="GL_SGIX_fragment_lighting" number="102">
+ <function name="FragmentColorMaterialSGIX">
+ <param name="face" type="GLenum"/>
+ <param name="mode" type="GLenum"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="FragmentLightfSGIX">
+ <param name="light" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="param" type="GLfloat"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="FragmentLightfvSGIX">
+ <param name="light" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="const GLfloat *"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="FragmentLightiSGIX">
+ <param name="light" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="param" type="GLint"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="FragmentLightivSGIX">
+ <param name="light" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="const GLint *"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="FragmentLightModelfSGIX">
+ <param name="pname" type="GLenum"/>
+ <param name="param" type="GLfloat"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="FragmentLightModelfvSGIX">
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="const GLfloat *"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="FragmentLightModeliSGIX">
+ <param name="pname" type="GLenum"/>
+ <param name="param" type="GLint"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="FragmentLightModelivSGIX">
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="const GLint *"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="FragmentMaterialfSGIX">
+ <param name="face" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="param" type="GLfloat"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="FragmentMaterialfvSGIX">
+ <param name="face" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="const GLfloat *"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="FragmentMaterialiSGIX">
+ <param name="face" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="param" type="GLint"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="FragmentMaterialivSGIX">
+ <param name="face" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="const GLint *"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="GetFragmentLightfvSGIX">
+ <param name="light" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLfloat *" output="true" variable_param="pname"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="GetFragmentLightivSGIX">
+ <param name="light" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLint *" output="true" variable_param="pname"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="GetFragmentMaterialfvSGIX">
+ <param name="face" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLfloat *" output="true" variable_param="pname"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="GetFragmentMaterialivSGIX">
+ <param name="face" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLint *" output="true" variable_param="pname"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="LightEnviSGIX">
+ <param name="pname" type="GLenum"/>
+ <param name="param" type="GLint"/>
+ <glx ignore="true"/>
+ </function>
+</category>
+
+<!-- Extension number 103 is not listed in the extension registry. -->
+<!-- Extension number 104 is not listed in the extension registry. -->
+<!-- Extension number 105 is not listed in the extension registry. -->
+<!-- Extension number 106 is not listed in the extension registry. -->
+<!-- Extension number 107 is not listed in the extension registry. -->
+<!-- Extension number 108 is not listed in the extension registry. -->
+<!-- Extension number 109 is not listed in the extension registry. -->
+
+<category name="GL_IBM_rasterpos_clip" number="110">
+ <enum name="RASTER_POSITION_UNCLIPPED_IBM" count="1" value="0x19262">
+ <size name="Get" mode="get"/>
+ </enum>
+</category>
+
+<category name="GL_EXT_draw_range_elements" number="112">
+ <function name="DrawRangeElementsEXT" alias="DrawRangeElements">
+ <param name="mode" type="GLenum"/>
+ <param name="start" type="GLuint"/>
+ <param name="end" type="GLuint"/>
+ <param name="count" type="GLsizei"/>
+ <param name="type" type="GLenum"/>
+ <param name="indices" type="const GLvoid *"/>
+ <glx handcode="true"/>
+ </function>
+</category>
+
+<!-- Extension number 115 is a GLX extension. -->
+<!-- Extension number 116 is not listed in the extension registry. -->
+
+<category name="GL_EXT_light_texture" number="117">
+ <function name="ApplyTextureEXT">
+ <param name="mode" type="GLenum"/>
+ </function>
+
+ <function name="TextureLightEXT">
+ <param name="pname" type="GLenum"/>
+ </function>
+
+ <function name="TextureMaterialEXT">
+ <param name="face" type="GLenum"/>
+ <param name="mode" type="GLenum"/>
+ </function>
+</category>
+
+<!-- Extension number 118 is not listed in the extension registry. -->
+<!-- Extension number 121 is not listed in the extension registry. -->
+<!-- Extension number 122 is not listed in the extension registry. -->
+<!-- Extension number 123 is not listed in the extension registry. -->
+<!-- Extension number 124 is not listed in the extension registry. -->
+<!-- Extension number 125 is not listed in the extension registry. -->
+<!-- Extension number 126 is not listed in the extension registry. -->
+<!-- Extension number 128 is not listed in the extension registry. -->
+<!-- Extension number 130 is not listed in the extension registry. -->
+<!-- Extension number 131 is not listed in the extension registry. -->
+
+<category name="GL_SGIX_async" number="132">
+ <function name="AsyncMarkerSGIX">
+ <param name="marker" type="GLuint"/>
+ </function>
+
+ <function name="FinishAsyncSGIX">
+ <param name="markerp" type="GLuint *"/> <!-- Spec bug. Should be const. -->
+ <return type="GLint"/>
+ </function>
+
+ <function name="PollAsyncSGIX">
+ <param name="markerp" type="GLuint *"/> <!-- Spec bug. Should be const. -->
+ <return type="GLint"/>
+ </function>
+
+ <function name="GenAsyncMarkersSGIX">
+ <param name="range" type="GLsizei"/>
+ <return type="GLuint"/>
+ </function>
+
+ <function name="DeleteAsyncMarkersSGIX">
+ <param name="marker" type="GLuint"/>
+ <param name="range" type="GLsizei"/>
+ </function>
+
+ <function name="IsAsyncMarkerSGIX">
+ <param name="marker" type="GLuint"/>
+ <return type="GLboolean"/>
+ </function>
+</category>
+
+<category name="GL_INTEL_parallel_arrays" number="136">
+ <function name="VertexPointervINTEL">
+ <param name="size" type="GLint"/>
+ <param name="type" type="GLenum"/>
+ <param name="pointer" type="const GLvoid **"/>
+ </function>
+
+ <function name="NormalPointervINTEL">
+ <param name="type" type="GLenum"/>
+ <param name="pointer" type="const GLvoid **"/>
+ </function>
+
+ <function name="ColorPointervINTEL">
+ <param name="size" type="GLint"/>
+ <param name="type" type="GLenum"/>
+ <param name="pointer" type="const GLvoid **"/>
+ </function>
+
+ <function name="TexCoordPointervINTEL">
+ <param name="size" type="GLint"/>
+ <param name="type" type="GLenum"/>
+ <param name="pointer" type="const GLvoid **"/>
+ </function>
+</category>
+
+<category name="GL_HP_occlusion_test" number="137">
+ <enum name="OCCLUSION_TEST_HP" count="1" value="0x8165">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="OCCLUSION_TEST_RESULT_HP" count="1" value="0x8166">
+ <size name="Get" mode="get"/>
+ </enum>
+</category>
+
+<category name="GL_EXT_pixel_transform" number="138">
+ <function name="PixelTransformParameteriEXT">
+ <param name="target" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="param" type="GLint"/>
+ </function>
+
+ <function name="PixelTransformParameterfEXT">
+ <param name="target" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="param" type="GLfloat"/>
+ </function>
+
+ <function name="PixelTransformParameterivEXT">
+ <param name="target" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="const GLint *"/>
+ </function>
+
+ <function name="PixelTransformParameterfvEXT">
+ <param name="target" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="const GLfloat *"/>
+ </function>
+</category>
+
+<!-- Extension number 140 is not listed in the extension registry. -->
+
+<category name="GL_EXT_shared_texture_palette" number="141">
+ <enum name="SHARED_TEXTURE_PALETTE_EXT" count="1" value="0x81FB"/>
+</category>
+
+<!-- Extension number 142 is a GLX extension. -->
+<!-- Extension number 143 is not listed in the extension registry. -->
+
+<category name="GL_EXT_separate_specular_color" number="144">
+ <enum name="LIGHT_MODEL_COLOR_CONTROL_EXT" count="1" value="0x81F8">
+ <size name="LightModelfv" mode="get"/>
+ <size name="LightModeliv" mode="get"/>
+ </enum>
+ <enum name="SINGLE_COLOR_EXT" value="0x81F9"/>
+ <enum name="SEPARATE_SPECULAR_COLOR_EXT" value="0x81FA"/>
+</category>
+
+<category name="GL_EXT_secondary_color" number="145">
+ <function name="SecondaryColor3bEXT" offset="assign" vectorequiv="SecondaryColor3bvEXT">
+ <param name="red" type="GLbyte"/>
+ <param name="green" type="GLbyte"/>
+ <param name="blue" type="GLbyte"/>
+ </function>
+
+ <function name="SecondaryColor3bvEXT" offset="assign">
+ <param name="v" type="const GLbyte *" count="3"/>
+ <glx rop="4126"/>
+ </function>
+
+ <function name="SecondaryColor3dEXT" offset="assign" vectorequiv="SecondaryColor3dvEXT">
+ <param name="red" type="GLdouble"/>
+ <param name="green" type="GLdouble"/>
+ <param name="blue" type="GLdouble"/>
+ </function>
+
+ <function name="SecondaryColor3dvEXT" offset="assign">
+ <param name="v" type="const GLdouble *" count="3"/>
+ <glx rop="4130"/>
+ </function>
+
+ <function name="SecondaryColor3fEXT" offset="assign" vectorequiv="SecondaryColor3fvEXT">
+ <param name="red" type="GLfloat"/>
+ <param name="green" type="GLfloat"/>
+ <param name="blue" type="GLfloat"/>
+ </function>
+
+ <function name="SecondaryColor3fvEXT" offset="assign">
+ <param name="v" type="const GLfloat *" count="3"/>
+ <glx rop="4129"/>
+ </function>
+
+ <function name="SecondaryColor3iEXT" offset="assign" vectorequiv="SecondaryColor3ivEXT">
+ <param name="red" type="GLint"/>
+ <param name="green" type="GLint"/>
+ <param name="blue" type="GLint"/>
+ </function>
+
+ <function name="SecondaryColor3ivEXT" offset="assign">
+ <param name="v" type="const GLint *" count="3"/>
+ <glx rop="4128"/>
+ </function>
+
+ <function name="SecondaryColor3sEXT" offset="assign" vectorequiv="SecondaryColor3svEXT">
+ <param name="red" type="GLshort"/>
+ <param name="green" type="GLshort"/>
+ <param name="blue" type="GLshort"/>
+ </function>
+
+ <function name="SecondaryColor3svEXT" offset="assign">
+ <param name="v" type="const GLshort *" count="3"/>
+ <glx rop="4127"/>
+ </function>
+
+ <function name="SecondaryColor3ubEXT" offset="assign" vectorequiv="SecondaryColor3ubvEXT">
+ <param name="red" type="GLubyte"/>
+ <param name="green" type="GLubyte"/>
+ <param name="blue" type="GLubyte"/>
+ </function>
+
+ <function name="SecondaryColor3ubvEXT" offset="assign">
+ <param name="v" type="const GLubyte *" count="3"/>
+ <glx rop="4131"/>
+ </function>
+
+ <function name="SecondaryColor3uiEXT" offset="assign" vectorequiv="SecondaryColor3uivEXT">
+ <param name="red" type="GLuint"/>
+ <param name="green" type="GLuint"/>
+ <param name="blue" type="GLuint"/>
+ </function>
+
+ <function name="SecondaryColor3uivEXT" offset="assign">
+ <param name="v" type="const GLuint *" count="3"/>
+ <glx rop="4133"/>
+ </function>
+
+ <function name="SecondaryColor3usEXT" offset="assign" vectorequiv="SecondaryColor3usvEXT">
+ <param name="red" type="GLushort"/>
+ <param name="green" type="GLushort"/>
+ <param name="blue" type="GLushort"/>
+ </function>
+
+ <function name="SecondaryColor3usvEXT" offset="assign">
+ <param name="v" type="const GLushort *" count="3"/>
+ <glx rop="4132"/>
+ </function>
+
+ <function name="SecondaryColorPointerEXT" offset="assign">
+ <param name="size" type="GLint"/>
+ <param name="type" type="GLenum"/>
+ <param name="stride" type="GLsizei"/>
+ <param name="pointer" type="const GLvoid *"/>
+ <glx handcode="true"/>
+ </function>
+</category>
+
+<category name="GL_EXT_texture_perturb_normal" number="147">
+ <function name="TextureNormalEXT">
+ <param name="mode" type="GLenum"/>
+ </function>
+</category>
+
+<category name="GL_EXT_multi_draw_arrays" number="148">
+ <function name="MultiDrawArraysEXT" offset="assign">
+ <param name="mode" type="GLenum"/>
+ <param name="first" type="const GLint *"/>
+ <param name="count" type="const GLsizei *"/>
+ <param name="primcount" type="GLsizei"/>
+ <glx handcode="true"/>
+ </function>
+
+ <function name="MultiDrawElementsEXT" offset="assign">
+ <param name="mode" type="GLenum"/>
+ <param name="count" type="const GLsizei *"/>
+ <param name="type" type="GLenum"/>
+ <param name="indices" type="const GLvoid **"/>
+ <param name="primcount" type="GLsizei"/>
+ <glx handcode="true"/>
+ </function>
+</category>
+
+<category name="GL_EXT_fog_coord" number="149">
+ <function name="FogCoordfEXT" offset="assign" vectorequiv="FogCoordfvEXT">
+ <param name="coord" type="GLfloat"/>
+ </function>
+
+ <function name="FogCoordfvEXT" offset="assign">
+ <param name="coord" type="const GLfloat *" count="1"/>
+ <glx rop="4124"/>
+ </function>
+
+ <function name="FogCoorddEXT" offset="assign" vectorequiv="FogCoorddvEXT">
+ <param name="coord" type="GLdouble"/>
+ </function>
+
+ <function name="FogCoorddvEXT" offset="assign">
+ <param name="coord" type="const GLdouble *" count="1"/>
+ <glx rop="4125"/>
+ </function>
+
+ <function name="FogCoordPointerEXT" offset="assign">
+ <param name="type" type="GLenum"/>
+ <param name="stride" type="GLsizei"/>
+ <param name="pointer" type="const GLvoid *"/>
+ <glx handcode="true"/>
+ </function>
+</category>
+
+<!-- Extension number 150 is not listed in the extension registry. -->
+<!-- Extension number 151 is not listed in the extension registry. -->
+<!-- Extension number 152 is not listed in the extension registry. -->
+<!-- Extension number 153 is not listed in the extension registry. -->
+<!-- Extension number 154 is not listed in the extension registry. -->
+
+<category name="GL_EXT_coordinate_frame" number="156">
+ <function name="Tangent3bEXT">
+ <param name="tx" type="GLbyte"/>
+ <param name="ty" type="GLbyte"/>
+ <param name="tz" type="GLbyte"/>
+ </function>
+
+ <function name="Tangent3bvEXT">
+ <param name="v" type="const GLbyte *"/>
+ </function>
+
+ <function name="Tangent3dEXT">
+ <param name="tx" type="GLdouble"/>
+ <param name="ty" type="GLdouble"/>
+ <param name="tz" type="GLdouble"/>
+ </function>
+
+ <function name="Tangent3dvEXT">
+ <param name="v" type="const GLdouble *"/>
+ </function>
+
+ <function name="Tangent3fEXT">
+ <param name="tx" type="GLfloat"/>
+ <param name="ty" type="GLfloat"/>
+ <param name="tz" type="GLfloat"/>
+ </function>
+
+ <function name="Tangent3fvEXT">
+ <param name="v" type="const GLfloat *"/>
+ </function>
+
+ <function name="Tangent3iEXT">
+ <param name="tx" type="GLint"/>
+ <param name="ty" type="GLint"/>
+ <param name="tz" type="GLint"/>
+ </function>
+
+ <function name="Tangent3ivEXT">
+ <param name="v" type="const GLint *"/>
+ </function>
+
+ <function name="Tangent3sEXT">
+ <param name="tx" type="GLshort"/>
+ <param name="ty" type="GLshort"/>
+ <param name="tz" type="GLshort"/>
+ </function>
+
+ <function name="Tangent3svEXT">
+ <param name="v" type="const GLshort *"/>
+ </function>
+
+ <function name="Binormal3bEXT">
+ <param name="bx" type="GLbyte"/>
+ <param name="by" type="GLbyte"/>
+ <param name="bz" type="GLbyte"/>
+ </function>
+
+ <function name="Binormal3bvEXT">
+ <param name="v" type="const GLbyte *"/>
+ </function>
+
+ <function name="Binormal3dEXT">
+ <param name="bx" type="GLdouble"/>
+ <param name="by" type="GLdouble"/>
+ <param name="bz" type="GLdouble"/>
+ </function>
+
+ <function name="Binormal3dvEXT">
+ <param name="v" type="const GLdouble *"/>
+ </function>
+
+ <function name="Binormal3fEXT">
+ <param name="bx" type="GLfloat"/>
+ <param name="by" type="GLfloat"/>
+ <param name="bz" type="GLfloat"/>
+ </function>
+
+ <function name="Binormal3fvEXT">
+ <param name="v" type="const GLfloat *"/>
+ </function>
+
+ <function name="Binormal3iEXT">
+ <param name="bx" type="GLint"/>
+ <param name="by" type="GLint"/>
+ <param name="bz" type="GLint"/>
+ </function>
+
+ <function name="Binormal3ivEXT">
+ <param name="v" type="const GLint *"/>
+ </function>
+
+ <function name="Binormal3sEXT">
+ <param name="bx" type="GLshort"/>
+ <param name="by" type="GLshort"/>
+ <param name="bz" type="GLshort"/>
+ </function>
+
+ <function name="Binormal3svEXT">
+ <param name="v" type="const GLshort *"/>
+ </function>
+
+ <function name="TangentPointerEXT">
+ <param name="type" type="GLenum"/>
+ <param name="stride" type="GLsizei"/>
+ <param name="pointer" type="const GLvoid *"/>
+ </function>
+
+ <function name="BinormalPointerEXT">
+ <param name="type" type="GLenum"/>
+ <param name="stride" type="GLsizei"/>
+ <param name="pointer" type="const GLvoid *"/>
+ </function>
+</category>
+
+<!-- Extension number 157 is not listed in the extension registry. -->
+
+<category name="GL_EXT_texture_env_combine" number="158">
+ <enum name="COMBINE_EXT" value="0x8570"/>
+ <enum name="COMBINE_RGB_EXT" count="1" value="0x8571"/>
+ <enum name="COMBINE_ALPHA_EXT" count="1" value="0x8572"/>
+ <enum name="RGB_SCALE_EXT" count="1" value="0x8573"/>
+ <enum name="ADD_SIGNED_EXT" value="0x8574"/>
+ <enum name="INTERPOLATE_EXT" value="0x8575"/>
+ <enum name="CONSTANT_EXT" value="0x8576"/>
+ <enum name="PRIMARY_COLOR_EXT" value="0x8577"/>
+ <enum name="PREVIOUS_EXT" value="0x8578"/>
+ <enum name="SOURCE0_RGB_EXT" count="1" value="0x8580"/>
+ <enum name="SOURCE1_RGB_EXT" count="1" value="0x8581"/>
+ <enum name="SOURCE2_RGB_EXT" count="1" value="0x8582"/>
+ <enum name="SOURCE0_ALPHA_EXT" count="1" value="0x8588"/>
+ <enum name="SOURCE1_ALPHA_EXT" count="1" value="0x8589"/>
+ <enum name="SOURCE2_ALPHA_EXT" count="1" value="0x858A"/>
+ <enum name="OPERAND0_RGB_EXT" count="1" value="0x8590"/>
+ <enum name="OPERAND1_RGB_EXT" count="1" value="0x8591"/>
+ <enum name="OPERAND2_RGB_EXT" count="1" value="0x8592"/>
+ <enum name="OPERAND0_ALPHA_EXT" count="1" value="0x8598"/>
+ <enum name="OPERAND1_ALPHA_EXT" count="1" value="0x8599"/>
+ <enum name="OPERAND2_ALPHA_EXT" count="1" value="0x859A"/>
+</category>
+
+<category name="GL_SGIX_pixel_texture" number="160">
+ <function name="PixelTexGenSGIX" offset="assign" static_dispatch="false">
+ <param name="mode" type="GLenum"/>
+ <glx rop="2059" ignore="true"/>
+ </function>
+</category>
+
+<!-- Extension number 161 is not listed in the extension registry. -->
+<!-- Extension number 162 is not listed in the extension registry. -->
+
+<category name="GL_SUNX_constant_data" number="163">
+ <function name="FinishTextureSUNX">
+ </function>
+</category>
+
+<category name="GL_SUN_global_alpha" number="164">
+ <function name="GlobalAlphaFactorbSUN">
+ <param name="factor" type="GLbyte"/>
+ </function>
+
+ <function name="GlobalAlphaFactorsSUN">
+ <param name="factor" type="GLshort"/>
+ </function>
+
+ <function name="GlobalAlphaFactoriSUN">
+ <param name="factor" type="GLint"/>
+ </function>
+
+ <function name="GlobalAlphaFactorfSUN">
+ <param name="factor" type="GLfloat"/>
+ </function>
+
+ <function name="GlobalAlphaFactordSUN">
+ <param name="factor" type="GLdouble"/>
+ </function>
+
+ <function name="GlobalAlphaFactorubSUN">
+ <param name="factor" type="GLubyte"/>
+ </function>
+
+ <function name="GlobalAlphaFactorusSUN">
+ <param name="factor" type="GLushort"/>
+ </function>
+
+ <function name="GlobalAlphaFactoruiSUN">
+ <param name="factor" type="GLuint"/>
+ </function>
+</category>
+
+<category name="GL_SUN_triangle_list" number="165">
+ <function name="ReplacementCodeuiSUN">
+ <param name="code" type="GLuint"/>
+ </function>
+
+ <function name="ReplacementCodeusSUN">
+ <param name="code" type="GLushort"/>
+ </function>
+
+ <function name="ReplacementCodeubSUN">
+ <param name="code" type="GLubyte"/>
+ </function>
+
+ <function name="ReplacementCodeuivSUN">
+ <param name="code" type="const GLuint *"/>
+ </function>
+
+ <function name="ReplacementCodeusvSUN">
+ <param name="code" type="const GLushort *"/>
+ </function>
+
+ <function name="ReplacementCodeubvSUN">
+ <param name="code" type="const GLubyte *"/>
+ </function>
+
+ <function name="ReplacementCodePointerSUN">
+ <param name="type" type="GLenum"/>
+ <param name="stride" type="GLsizei"/>
+ <param name="pointer" type="const GLvoid *"/>
+ </function>
+</category>
+
+<category name="GL_SUN_vertex" number="166">
+ <function name="Color4ubVertex2fSUN">
+ <param name="r" type="GLubyte"/>
+ <param name="g" type="GLubyte"/>
+ <param name="b" type="GLubyte"/>
+ <param name="a" type="GLubyte"/>
+ <param name="x" type="GLfloat"/>
+ <param name="y" type="GLfloat"/>
+ </function>
+
+ <function name="Color4ubVertex2fvSUN">
+ <param name="c" type="const GLubyte *"/>
+ <param name="v" type="const GLfloat *"/>
+ </function>
+
+ <function name="Color4ubVertex3fSUN">
+ <param name="r" type="GLubyte"/>
+ <param name="g" type="GLubyte"/>
+ <param name="b" type="GLubyte"/>
+ <param name="a" type="GLubyte"/>
+ <param name="x" type="GLfloat"/>
+ <param name="y" type="GLfloat"/>
+ <param name="z" type="GLfloat"/>
+ </function>
+
+ <function name="Color4ubVertex3fvSUN">
+ <param name="c" type="const GLubyte *"/>
+ <param name="v" type="const GLfloat *"/>
+ </function>
+
+ <function name="Color3fVertex3fSUN">
+ <param name="r" type="GLfloat"/>
+ <param name="g" type="GLfloat"/>
+ <param name="b" type="GLfloat"/>
+ <param name="x" type="GLfloat"/>
+ <param name="y" type="GLfloat"/>
+ <param name="z" type="GLfloat"/>
+ </function>
+
+ <function name="Color3fVertex3fvSUN">
+ <param name="c" type="const GLfloat *"/>
+ <param name="v" type="const GLfloat *"/>
+ </function>
+
+ <function name="Normal3fVertex3fSUN">
+ <param name="nx" type="GLfloat"/>
+ <param name="ny" type="GLfloat"/>
+ <param name="nz" type="GLfloat"/>
+ <param name="x" type="GLfloat"/>
+ <param name="y" type="GLfloat"/>
+ <param name="z" type="GLfloat"/>
+ </function>
+
+ <function name="Normal3fVertex3fvSUN">
+ <param name="n" type="const GLfloat *"/>
+ <param name="v" type="const GLfloat *"/>
+ </function>
+
+ <function name="Color4fNormal3fVertex3fSUN">
+ <param name="r" type="GLfloat"/>
+ <param name="g" type="GLfloat"/>
+ <param name="b" type="GLfloat"/>
+ <param name="a" type="GLfloat"/>
+ <param name="nx" type="GLfloat"/>
+ <param name="ny" type="GLfloat"/>
+ <param name="nz" type="GLfloat"/>
+ <param name="x" type="GLfloat"/>
+ <param name="y" type="GLfloat"/>
+ <param name="z" type="GLfloat"/>
+ </function>
+
+ <function name="Color4fNormal3fVertex3fvSUN">
+ <param name="c" type="const GLfloat *"/>
+ <param name="n" type="const GLfloat *"/>
+ <param name="v" type="const GLfloat *"/>
+ </function>
+
+ <function name="TexCoord2fVertex3fSUN">
+ <param name="s" type="GLfloat"/>
+ <param name="t" type="GLfloat"/>
+ <param name="x" type="GLfloat"/>
+ <param name="y" type="GLfloat"/>
+ <param name="z" type="GLfloat"/>
+ </function>
+
+ <function name="TexCoord2fVertex3fvSUN">
+ <param name="tc" type="const GLfloat *"/>
+ <param name="v" type="const GLfloat *"/>
+ </function>
+
+ <function name="TexCoord4fVertex4fSUN">
+ <param name="s" type="GLfloat"/>
+ <param name="t" type="GLfloat"/>
+ <param name="p" type="GLfloat"/>
+ <param name="q" type="GLfloat"/>
+ <param name="x" type="GLfloat"/>
+ <param name="y" type="GLfloat"/>
+ <param name="z" type="GLfloat"/>
+ <param name="w" type="GLfloat"/>
+ </function>
+
+ <function name="TexCoord4fVertex4fvSUN">
+ <param name="tc" type="const GLfloat *"/>
+ <param name="v" type="const GLfloat *"/>
+ </function>
+
+ <function name="TexCoord2fColor4ubVertex3fSUN">
+ <param name="s" type="GLfloat"/>
+ <param name="t" type="GLfloat"/>
+ <param name="r" type="GLubyte"/>
+ <param name="g" type="GLubyte"/>
+ <param name="b" type="GLubyte"/>
+ <param name="a" type="GLubyte"/>
+ <param name="x" type="GLfloat"/>
+ <param name="y" type="GLfloat"/>
+ <param name="z" type="GLfloat"/>
+ </function>
+
+ <function name="TexCoord2fColor4ubVertex3fvSUN">
+ <param name="tc" type="const GLfloat *"/>
+ <param name="c" type="const GLubyte *"/>
+ <param name="v" type="const GLfloat *"/>
+ </function>
+
+ <function name="TexCoord2fColor3fVertex3fSUN">
+ <param name="s" type="GLfloat"/>
+ <param name="t" type="GLfloat"/>
+ <param name="r" type="GLfloat"/>
+ <param name="g" type="GLfloat"/>
+ <param name="b" type="GLfloat"/>
+ <param name="x" type="GLfloat"/>
+ <param name="y" type="GLfloat"/>
+ <param name="z" type="GLfloat"/>
+ </function>
+
+ <function name="TexCoord2fColor3fVertex3fvSUN">
+ <param name="tc" type="const GLfloat *"/>
+ <param name="c" type="const GLfloat *"/>
+ <param name="v" type="const GLfloat *"/>
+ </function>
+
+ <function name="TexCoord2fNormal3fVertex3fSUN">
+ <param name="s" type="GLfloat"/>
+ <param name="t" type="GLfloat"/>
+ <param name="nx" type="GLfloat"/>
+ <param name="ny" type="GLfloat"/>
+ <param name="nz" type="GLfloat"/>
+ <param name="x" type="GLfloat"/>
+ <param name="y" type="GLfloat"/>
+ <param name="z" type="GLfloat"/>
+ </function>
+
+ <function name="TexCoord2fNormal3fVertex3fvSUN">
+ <param name="tc" type="const GLfloat *"/>
+ <param name="n" type="const GLfloat *"/>
+ <param name="v" type="const GLfloat *"/>
+ </function>
+
+ <function name="TexCoord2fColor4fNormal3fVertex3fSUN">
+ <param name="s" type="GLfloat"/>
+ <param name="t" type="GLfloat"/>
+ <param name="r" type="GLfloat"/>
+ <param name="g" type="GLfloat"/>
+ <param name="b" type="GLfloat"/>
+ <param name="a" type="GLfloat"/>
+ <param name="nx" type="GLfloat"/>
+ <param name="ny" type="GLfloat"/>
+ <param name="nz" type="GLfloat"/>
+ <param name="x" type="GLfloat"/>
+ <param name="y" type="GLfloat"/>
+ <param name="z" type="GLfloat"/>
+ </function>
+
+ <function name="TexCoord2fColor4fNormal3fVertex3fvSUN">
+ <param name="tc" type="const GLfloat *"/>
+ <param name="c" type="const GLfloat *"/>
+ <param name="n" type="const GLfloat *"/>
+ <param name="v" type="const GLfloat *"/>
+ </function>
+
+ <function name="TexCoord4fColor4fNormal3fVertex4fSUN">
+ <param name="s" type="GLfloat"/>
+ <param name="t" type="GLfloat"/>
+ <param name="p" type="GLfloat"/>
+ <param name="q" type="GLfloat"/>
+ <param name="r" type="GLfloat"/>
+ <param name="g" type="GLfloat"/>
+ <param name="b" type="GLfloat"/>
+ <param name="a" type="GLfloat"/>
+ <param name="nx" type="GLfloat"/>
+ <param name="ny" type="GLfloat"/>
+ <param name="nz" type="GLfloat"/>
+ <param name="x" type="GLfloat"/>
+ <param name="y" type="GLfloat"/>
+ <param name="z" type="GLfloat"/>
+ <param name="w" type="GLfloat"/>
+ </function>
+
+ <function name="TexCoord4fColor4fNormal3fVertex4fvSUN">
+ <param name="tc" type="const GLfloat *"/>
+ <param name="c" type="const GLfloat *"/>
+ <param name="n" type="const GLfloat *"/>
+ <param name="v" type="const GLfloat *"/>
+ </function>
+
+ <function name="ReplacementCodeuiVertex3fSUN">
+ <param name="rc" type="GLuint"/>
+ <param name="x" type="GLfloat"/>
+ <param name="y" type="GLfloat"/>
+ <param name="z" type="GLfloat"/>
+ </function>
+
+ <function name="ReplacementCodeuiVertex3fvSUN">
+ <param name="rc" type="const GLuint *"/>
+ <param name="v" type="const GLfloat *"/>
+ </function>
+
+ <function name="ReplacementCodeuiColor4ubVertex3fSUN">
+ <param name="rc" type="GLuint"/>
+ <param name="r" type="GLubyte"/>
+ <param name="g" type="GLubyte"/>
+ <param name="b" type="GLubyte"/>
+ <param name="a" type="GLubyte"/>
+ <param name="x" type="GLfloat"/>
+ <param name="y" type="GLfloat"/>
+ <param name="z" type="GLfloat"/>
+ </function>
+
+ <function name="ReplacementCodeuiColor4ubVertex3fvSUN">
+ <param name="rc" type="const GLuint *"/>
+ <param name="c" type="const GLubyte *"/>
+ <param name="v" type="const GLfloat *"/>
+ </function>
+
+ <function name="ReplacementCodeuiColor3fVertex3fSUN">
+ <param name="rc" type="GLuint"/>
+ <param name="r" type="GLfloat"/>
+ <param name="g" type="GLfloat"/>
+ <param name="b" type="GLfloat"/>
+ <param name="x" type="GLfloat"/>
+ <param name="y" type="GLfloat"/>
+ <param name="z" type="GLfloat"/>
+ </function>
+
+ <function name="ReplacementCodeuiColor3fVertex3fvSUN">
+ <param name="rc" type="const GLuint *"/>
+ <param name="c" type="const GLfloat *"/>
+ <param name="v" type="const GLfloat *"/>
+ </function>
+
+ <function name="ReplacementCodeuiNormal3fVertex3fSUN">
+ <param name="rc" type="GLuint"/>
+ <param name="nx" type="GLfloat"/>
+ <param name="ny" type="GLfloat"/>
+ <param name="nz" type="GLfloat"/>
+ <param name="x" type="GLfloat"/>
+ <param name="y" type="GLfloat"/>
+ <param name="z" type="GLfloat"/>
+ </function>
+
+ <function name="ReplacementCodeuiNormal3fVertex3fvSUN">
+ <param name="rc" type="const GLuint *"/>
+ <param name="n" type="const GLfloat *"/>
+ <param name="v" type="const GLfloat *"/>
+ </function>
+
+ <function name="ReplacementCodeuiColor4fNormal3fVertex3fSUN">
+ <param name="rc" type="GLuint"/>
+ <param name="r" type="GLfloat"/>
+ <param name="g" type="GLfloat"/>
+ <param name="b" type="GLfloat"/>
+ <param name="a" type="GLfloat"/>
+ <param name="nx" type="GLfloat"/>
+ <param name="ny" type="GLfloat"/>
+ <param name="nz" type="GLfloat"/>
+ <param name="x" type="GLfloat"/>
+ <param name="y" type="GLfloat"/>
+ <param name="z" type="GLfloat"/>
+ </function>
+
+ <function name="ReplacementCodeuiColor4fNormal3fVertex3fvSUN">
+ <param name="rc" type="const GLuint *"/>
+ <param name="c" type="const GLfloat *"/>
+ <param name="n" type="const GLfloat *"/>
+ <param name="v" type="const GLfloat *"/>
+ </function>
+
+ <function name="ReplacementCodeuiTexCoord2fVertex3fSUN">
+ <param name="rc" type="GLuint"/>
+ <param name="s" type="GLfloat"/>
+ <param name="t" type="GLfloat"/>
+ <param name="x" type="GLfloat"/>
+ <param name="y" type="GLfloat"/>
+ <param name="z" type="GLfloat"/>
+ </function>
+
+ <function name="ReplacementCodeuiTexCoord2fVertex3fvSUN">
+ <param name="rc" type="const GLuint *"/>
+ <param name="tc" type="const GLfloat *"/>
+ <param name="v" type="const GLfloat *"/>
+ </function>
+
+ <function name="ReplacementCodeuiTexCoord2fNormal3fVertex3fSUN">
+ <param name="rc" type="GLuint"/>
+ <param name="s" type="GLfloat"/>
+ <param name="t" type="GLfloat"/>
+ <param name="nx" type="GLfloat"/>
+ <param name="ny" type="GLfloat"/>
+ <param name="nz" type="GLfloat"/>
+ <param name="x" type="GLfloat"/>
+ <param name="y" type="GLfloat"/>
+ <param name="z" type="GLfloat"/>
+ </function>
+
+ <function name="ReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN">
+ <param name="rc" type="const GLuint *"/>
+ <param name="tc" type="const GLfloat *"/>
+ <param name="n" type="const GLfloat *"/>
+ <param name="v" type="const GLfloat *"/>
+ </function>
+
+ <function name="ReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN">
+ <param name="rc" type="GLuint"/>
+ <param name="s" type="GLfloat"/>
+ <param name="t" type="GLfloat"/>
+ <param name="r" type="GLfloat"/>
+ <param name="g" type="GLfloat"/>
+ <param name="b" type="GLfloat"/>
+ <param name="a" type="GLfloat"/>
+ <param name="nx" type="GLfloat"/>
+ <param name="ny" type="GLfloat"/>
+ <param name="nz" type="GLfloat"/>
+ <param name="x" type="GLfloat"/>
+ <param name="y" type="GLfloat"/>
+ <param name="z" type="GLfloat"/>
+ </function>
+
+ <function name="ReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN">
+ <param name="rc" type="const GLuint *"/>
+ <param name="tc" type="const GLfloat *"/>
+ <param name="c" type="const GLfloat *"/>
+ <param name="n" type="const GLfloat *"/>
+ <param name="v" type="const GLfloat *"/>
+ </function>
+</category>
+
+<!-- Extension number 167 is a WGL extension. -->
+<!-- Extension number 168 is a WGL extension. -->
+<!-- Extension number 169 is a WGL extension. -->
+<!-- Extension number 170 is a WGL extension. -->
+<!-- Extension number 171 is a WGL extension. -->
+<!-- Extension number 172 is a WGL extension. -->
+
+<category name="GL_EXT_blend_func_separate" number="173">
+ <function name="BlendFuncSeparateEXT" offset="assign">
+ <param name="sfactorRGB" type="GLenum"/>
+ <param name="dfactorRGB" type="GLenum"/>
+ <param name="sfactorAlpha" type="GLenum"/>
+ <param name="dfactorAlpha" type="GLenum"/>
+ <glx rop="4134"/>
+ </function>
+</category>
+
+<category name="GL_EXT_stencil_wrap" number="176">
+ <enum name="INCR_WRAP_EXT" value="0x8507"/>
+ <enum name="DECR_WRAP_EXT" value="0x8508"/>
+</category>
+
+<!-- Extension number 177 is a WGL extension. -->
+
+<category name="GL_NV_texgen_reflection" number="179">
+ <enum name="NORMAL_MAP_NV" value="0x8511"/>
+ <enum name="REFLECTION_MAP_NV" value="0x8512"/>
+</category>
+
+<!-- Extension number 180 is not listed in the extension registry. -->
+
+<category name="GL_SUN_convolution_border_modes" number="182">
+ <enum name="WRAP_BORDER_SUN" value="0x81D4"/>
+</category>
+
+<!-- Extension number 183 is a GLX extension. -->
+<!-- Extension number 184 is not listed in the extension registry. -->
+
+<category name="GL_EXT_texture_env_add" number="185">
+ <!-- No new functions, types, enums. -->
+</category>
+
+<category name="GL_EXT_texture_lod_bias" number="186">
+ <enum name="TEXTURE_LOD_BIAS_EXT" count="1" value="0x8501">
+ <size name="TexParameterfv" mode="get"/>
+ <size name="TexParameteriv" mode="get"/>
+ <size name="GetTexParameterfv" mode="get"/>
+ <size name="GetTexParameteriv" mode="get"/>
+ </enum>
+</category>
+
+<category name="GL_EXT_texture_filter_anisotropic" number="187">
+ <enum name="TEXTURE_MAX_ANISOTROPY_EXT" count="1" value="0x84FE">
+ <size name="TexParameterfv" mode="get"/>
+ <size name="TexParameteriv" mode="get"/>
+ <size name="GetTexParameterfv" mode="get"/>
+ <size name="GetTexParameteriv" mode="get"/>
+ </enum>
+ <enum name="MAX_TEXTURE_MAX_ANISOTROPY_EXT" count="1" value="0x84FF">
+ <size name="Get" mode="get"/>
+ </enum>
+</category>
+
+<category name="GL_EXT_vertex_weighting" number="188">
+ <function name="VertexWeightfEXT" vectorequiv="VertexWeightfvEXT">
+ <param name="weight" type="GLfloat"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="VertexWeightfvEXT">
+ <param name="weight" type="const GLfloat *" count="1"/>
+ <glx rop="4135" ignore="true"/>
+ </function>
+
+ <function name="VertexWeightPointerEXT">
+ <param name="size" type="GLsizei"/>
+ <param name="type" type="GLenum"/>
+ <param name="stride" type="GLsizei"/>
+ <param name="pointer" type="const GLvoid *"/>
+ <glx handcode="true" ignore="true"/>
+ </function>
+</category>
+
+<category name="GL_NV_light_max_exponent" number="189">
+ <enum name="MAX_SHININESS_NV" count="1" value="0x8504">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="MAX_SPOT_EXPONENT_NV" count="1" value="0x8505">
+ <size name="Get" mode="get"/>
+ </enum>
+</category>
+
+<category name="GL_NV_vertex_array_range" number="190">
+ <function name="FlushVertexArrayRangeNV" offset="assign">
+ <glx ignore="true"/>
+ </function>
+
+ <function name="VertexArrayRangeNV" offset="assign">
+ <param name="length" type="GLsizei"/>
+ <param name="pointer" type="const GLvoid *"/>
+ <glx ignore="true"/>
+ </function>
+</category>
+
+<category name="GL_NV_register_combiners" number="191">
+ <function name="CombinerParameterfvNV" offset="assign">
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="const GLfloat *" variable_param="pname"/>
+ <glx rop="4137" ignore="true"/>
+ </function>
+
+ <function name="CombinerParameterfNV" offset="assign">
+ <param name="pname" type="GLenum"/>
+ <param name="param" type="GLfloat"/>
+ <glx rop="4136" ignore="true"/>
+ </function>
+
+ <function name="CombinerParameterivNV" offset="assign">
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="const GLint *" variable_param="pname"/>
+ <glx rop="4139" ignore="true"/>
+ </function>
+
+ <function name="CombinerParameteriNV" offset="assign">
+ <param name="pname" type="GLenum"/>
+ <param name="param" type="GLint"/>
+ <glx rop="4138" ignore="true"/>
+ </function>
+
+ <function name="CombinerInputNV" offset="assign">
+ <param name="stage" type="GLenum"/>
+ <param name="portion" type="GLenum"/>
+ <param name="variable" type="GLenum"/>
+ <param name="input" type="GLenum"/>
+ <param name="mapping" type="GLenum"/>
+ <param name="componentUsage" type="GLenum"/>
+ <glx rop="4140" ignore="true"/>
+ </function>
+
+ <function name="CombinerOutputNV" offset="assign">
+ <param name="stage" type="GLenum"/>
+ <param name="portion" type="GLenum"/>
+ <param name="abOutput" type="GLenum"/>
+ <param name="cdOutput" type="GLenum"/>
+ <param name="sumOutput" type="GLenum"/>
+ <param name="scale" type="GLenum"/>
+ <param name="bias" type="GLenum"/>
+ <param name="abDotProduct" type="GLboolean"/>
+ <param name="cdDotProduct" type="GLboolean"/>
+ <param name="muxSum" type="GLboolean"/>
+ <glx rop="4141" ignore="true"/>
+ </function>
+
+ <function name="FinalCombinerInputNV" offset="assign">
+ <param name="variable" type="GLenum"/>
+ <param name="input" type="GLenum"/>
+ <param name="mapping" type="GLenum"/>
+ <param name="componentUsage" type="GLenum"/>
+ <glx rop="4142" ignore="true"/>
+ </function>
+
+ <function name="GetCombinerInputParameterfvNV" offset="assign">
+ <param name="stage" type="GLenum"/>
+ <param name="portion" type="GLenum"/>
+ <param name="variable" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLfloat *" output="true"/>
+ <glx vendorpriv="1270" ignore="true"/>
+ </function>
+
+ <function name="GetCombinerInputParameterivNV" offset="assign">
+ <param name="stage" type="GLenum"/>
+ <param name="portion" type="GLenum"/>
+ <param name="variable" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLint *" output="true"/>
+ <glx vendorpriv="1271" ignore="true"/>
+ </function>
+
+ <function name="GetCombinerOutputParameterfvNV" offset="assign">
+ <param name="stage" type="GLenum"/>
+ <param name="portion" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLfloat *" output="true"/>
+ <glx vendorpriv="1272" ignore="true"/>
+ </function>
+
+ <function name="GetCombinerOutputParameterivNV" offset="assign">
+ <param name="stage" type="GLenum"/>
+ <param name="portion" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLint *" output="true"/>
+ <glx vendorpriv="1273" ignore="true"/>
+ </function>
+
+ <function name="GetFinalCombinerInputParameterfvNV" offset="assign">
+ <param name="variable" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLfloat *" output="true"/>
+ <glx vendorpriv="1274" ignore="true"/>
+ </function>
+
+ <function name="GetFinalCombinerInputParameterivNV" offset="assign">
+ <param name="variable" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLint *" output="true"/>
+ <glx vendorpriv="1275" ignore="true"/>
+ </function>
+</category>
+
+<category name="GL_NV_fog_distance" number="192">
+ <enum name="FOG_DISTANCE_MODE_NV" count="1" value="0x855A">
+ <size name="Fogfv" mode="get"/>
+ <size name="Fogiv" mode="get"/>
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="EYE_RADIAL_NV" value="0x855B"/>
+ <enum name="EYE_PLANE_ABSOLUTE_NV" value="0x855C"/>
+</category>
+
+<category name="GL_NV_blend_square" number="194">
+ <!-- No new functions, types, enums. -->
+</category>
+
+<category name="GL_NV_texture_env_combine4" number="195">
+ <enum name="COMBINE4" value="0x8503"/>
+ <enum name="SOURCE3_RGB_NV" count="1" value="0x8583">
+ <size name="TexEnvfv" mode="get"/>
+ <size name="TexEnviv" mode="get"/>
+ <size name="GetTexEnvfv" mode="get"/>
+ <size name="GetTexEnviv" mode="get"/>
+ </enum>
+ <enum name="SOURCE3_ALPHA_NV" count="1" value="0x858B">
+ <size name="TexEnvfv" mode="get"/>
+ <size name="TexEnviv" mode="get"/>
+ <size name="GetTexEnvfv" mode="get"/>
+ <size name="GetTexEnviv" mode="get"/>
+ </enum>
+ <enum name="OPERAND3_RGB_NV" count="1" value="0x8593">
+ <size name="TexEnvfv" mode="get"/>
+ <size name="TexEnviv" mode="get"/>
+ <size name="GetTexEnvfv" mode="get"/>
+ <size name="GetTexEnviv" mode="get"/>
+ </enum>
+ <enum name="OPERAND3_ALPHA_NV" count="1" value="0x859B">
+ <size name="TexEnvfv" mode="get"/>
+ <size name="TexEnviv" mode="get"/>
+ <size name="GetTexEnvfv" mode="get"/>
+ <size name="GetTexEnviv" mode="get"/>
+ </enum>
+</category>
+
+<category name="GL_MESA_resize_buffers" number="196">
+ <function name="ResizeBuffersMESA" offset="assign">
+ <glx ignore="true"/>
+ </function>
+</category>
+
+<category name="GL_MESA_window_pos" number="197">
+ <function name="WindowPos2dMESA" offset="assign">
+ <param name="x" type="GLdouble"/>
+ <param name="y" type="GLdouble"/>
+ <glx handcode="true"/>
+ </function>
+
+ <function name="WindowPos2dvMESA" offset="assign">
+ <param name="v" type="const GLdouble *"/>
+ <glx handcode="true"/>
+ </function>
+
+ <function name="WindowPos2fMESA" offset="assign">
+ <param name="x" type="GLfloat"/>
+ <param name="y" type="GLfloat"/>
+ <glx handcode="true"/>
+ </function>
+
+ <function name="WindowPos2fvMESA" offset="assign">
+ <param name="v" type="const GLfloat *"/>
+ <glx handcode="true"/>
+ </function>
+
+ <function name="WindowPos2iMESA" offset="assign">
+ <param name="x" type="GLint"/>
+ <param name="y" type="GLint"/>
+ <glx handcode="true"/>
+ </function>
+
+ <function name="WindowPos2ivMESA" offset="assign">
+ <param name="v" type="const GLint *"/>
+ <glx handcode="true"/>
+ </function>
+
+ <function name="WindowPos2sMESA" offset="assign">
+ <param name="x" type="GLshort"/>
+ <param name="y" type="GLshort"/>
+ <glx handcode="true"/>
+ </function>
+
+ <function name="WindowPos2svMESA" offset="assign">
+ <param name="v" type="const GLshort *"/>
+ <glx handcode="true"/>
+ </function>
+
+ <function name="WindowPos3dMESA" offset="assign">
+ <param name="x" type="GLdouble"/>
+ <param name="y" type="GLdouble"/>
+ <param name="z" type="GLdouble"/>
+ <glx handcode="true"/>
+ </function>
+
+ <function name="WindowPos3dvMESA" offset="assign">
+ <param name="v" type="const GLdouble *"/>
+ <glx handcode="true"/>
+ </function>
+
+ <function name="WindowPos3fMESA" offset="assign" vectorequiv="WindowPos3fvMESA">
+ <param name="x" type="GLfloat"/>
+ <param name="y" type="GLfloat"/>
+ <param name="z" type="GLfloat"/>
+ </function>
+
+ <function name="WindowPos3fvMESA" offset="assign">
+ <param name="v" type="const GLfloat *" count="3"/>
+ <glx rop="230"/>
+ </function>
+
+ <function name="WindowPos3iMESA" offset="assign">
+ <param name="x" type="GLint"/>
+ <param name="y" type="GLint"/>
+ <param name="z" type="GLint"/>
+ <glx handcode="true"/>
+ </function>
+
+ <function name="WindowPos3ivMESA" offset="assign">
+ <param name="v" type="const GLint *"/>
+ <glx handcode="true"/>
+ </function>
+
+ <function name="WindowPos3sMESA" offset="assign">
+ <param name="x" type="GLshort"/>
+ <param name="y" type="GLshort"/>
+ <param name="z" type="GLshort"/>
+ <glx handcode="true"/>
+ </function>
+
+ <function name="WindowPos3svMESA" offset="assign">
+ <param name="v" type="const GLshort *"/>
+ <glx handcode="true"/>
+ </function>
+
+ <function name="WindowPos4dMESA" offset="assign">
+ <param name="x" type="GLdouble"/>
+ <param name="y" type="GLdouble"/>
+ <param name="z" type="GLdouble"/>
+ <param name="w" type="GLdouble"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="WindowPos4dvMESA" offset="assign">
+ <param name="v" type="const GLdouble *"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="WindowPos4fMESA" offset="assign">
+ <param name="x" type="GLfloat"/>
+ <param name="y" type="GLfloat"/>
+ <param name="z" type="GLfloat"/>
+ <param name="w" type="GLfloat"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="WindowPos4fvMESA" offset="assign">
+ <param name="v" type="const GLfloat *"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="WindowPos4iMESA" offset="assign">
+ <param name="x" type="GLint"/>
+ <param name="y" type="GLint"/>
+ <param name="z" type="GLint"/>
+ <param name="w" type="GLint"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="WindowPos4ivMESA" offset="assign">
+ <param name="v" type="const GLint *"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="WindowPos4sMESA" offset="assign">
+ <param name="x" type="GLshort"/>
+ <param name="y" type="GLshort"/>
+ <param name="z" type="GLshort"/>
+ <param name="w" type="GLshort"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="WindowPos4svMESA" offset="assign">
+ <param name="v" type="const GLshort *"/>
+ <glx ignore="true"/>
+ </function>
+</category>
+
+<category name="GL_EXT_texture_compression_s3tc" number="198">
+ <enum name="COMPRESSED_RGB_S3TC_DXT1_EXT" value="0x83F0"/>
+ <enum name="COMPRESSED_RGBA_S3TC_DXT1_EXT" value="0x83F1"/>
+ <enum name="COMPRESSED_RGBA_S3TC_DXT3_EXT" value="0x83F2"/>
+ <enum name="COMPRESSED_RGBA_S3TC_DXT5_EXT" value="0x83F3"/>
+</category>
+
+<category name="GL_IBM_multimode_draw_arrays" number="200">
+ <function name="MultiModeDrawArraysIBM" offset="assign" static_dispatch="false">
+ <param name="mode" type="const GLenum *"/>
+ <param name="first" type="const GLint *"/>
+ <param name="count" type="const GLsizei *"/>
+ <param name="primcount" type="GLsizei"/>
+ <param name="modestride" type="GLint"/>
+ <glx handcode="true" ignore="true"/>
+ </function>
+
+ <function name="MultiModeDrawElementsIBM" offset="assign" static_dispatch="false">
+ <param name="mode" type="const GLenum *"/>
+ <param name="count" type="const GLsizei *"/>
+ <param name="type" type="GLenum"/>
+ <param name="indices" type="const GLvoid * const *"/>
+ <param name="primcount" type="GLsizei"/>
+ <param name="modestride" type="GLint"/>
+ <glx handcode="true" ignore="true"/>
+ </function>
+</category>
+
+<category name="GL_IBM_vertex_array_lists" number="201">
+ <function name="ColorPointerListIBM">
+ <param name="size" type="GLint"/>
+ <param name="type" type="GLenum"/>
+ <param name="stride" type="GLint"/>
+ <param name="pointer" type="const GLvoid **"/>
+ <param name="ptrstride" type="GLint"/>
+ </function>
+
+ <function name="SecondaryColorPointerListIBM">
+ <param name="size" type="GLint"/>
+ <param name="type" type="GLenum"/>
+ <param name="stride" type="GLint"/>
+ <param name="pointer" type="const GLvoid **"/>
+ <param name="ptrstride" type="GLint"/>
+ </function>
+
+ <function name="EdgeFlagPointerListIBM">
+ <param name="stride" type="GLint"/>
+ <param name="pointer" type="const GLboolean **"/>
+ <param name="ptrstride" type="GLint"/>
+ </function>
+
+ <function name="FogCoordPointerListIBM">
+ <param name="type" type="GLenum"/>
+ <param name="stride" type="GLint"/>
+ <param name="pointer" type="const GLvoid **"/>
+ <param name="ptrstride" type="GLint"/>
+ </function>
+
+ <function name="IndexPointerListIBM">
+ <param name="type" type="GLenum"/>
+ <param name="stride" type="GLint"/>
+ <param name="pointer" type="const GLvoid **"/>
+ <param name="ptrstride" type="GLint"/>
+ </function>
+
+ <function name="NormalPointerListIBM">
+ <param name="type" type="GLenum"/>
+ <param name="stride" type="GLint"/>
+ <param name="pointer" type="const GLvoid **"/>
+ <param name="ptrstride" type="GLint"/>
+ </function>
+
+ <function name="TexCoordPointerListIBM">
+ <param name="size" type="GLint"/>
+ <param name="type" type="GLenum"/>
+ <param name="stride" type="GLint"/>
+ <param name="pointer" type="const GLvoid **"/>
+ <param name="ptrstride" type="GLint"/>
+ </function>
+
+ <function name="VertexPointerListIBM">
+ <param name="size" type="GLint"/>
+ <param name="type" type="GLenum"/>
+ <param name="stride" type="GLint"/>
+ <param name="pointer" type="const GLvoid **"/>
+ <param name="ptrstride" type="GLint"/>
+ </function>
+</category>
+
+<!-- Extension number 202 is not listed in the extension registry. -->
+<!-- Extension number 203 is not listed in the extension registry. -->
+<!-- Extension number 204 is not listed in the extension registry. -->
+<!-- Extension number 205 is not listed in the extension registry. -->
+
+<category name="GL_3DFX_texture_compression_FXT1" number="206">
+ <enum name="COMPRESSED_RGB_FXT1_3DFX" value="0x86B0"/>
+ <enum name="COMPRESSED_RGBA_FXT1_3DFX" value="0x86B1"/>
+</category>
+
+<category name="GL_3DFX_multisample" number="207">
+ <enum name="MULTISAMPLE_3DFX" value="0x86B2"/>
+ <enum name="SAMPLE_BUFFERS_3DFX" value="0x86B3"/>
+ <enum name="SAMPLES_3DFX" value="0x86B4"/>
+ <enum name="MULTISAMPLE_BIT_3DFX" value="0x20000000"/>
+</category>
+
+<category name="GL_3DFX_tbuffer" number="208">
+ <function name="TbufferMask3DFX">
+ <param name="mask" type="GLuint"/>
+ <glx ignore="true"/>
+ </function>
+</category>
+
+<category name="GL_EXT_multisample" number="209">
+ <function name="SampleMaskEXT" alias="SampleMaskSGIS" static_dispatch="false">
+ <param name="value" type="GLclampf"/>
+ <param name="invert" type="GLboolean"/>
+ </function>
+
+ <function name="SamplePatternEXT" alias="SamplePatternSGIS" static_dispatch="false">
+ <param name="pattern" type="GLenum"/>
+ </function>
+</category>
+
+<!-- Extension number 211 is not listed in the extension registry. -->
+<!-- Extension number 213 is not listed in the extension registry. -->
+
+<category name="GL_SGIS_texture_color_mask" number="214">
+ <enum name="TEXTURE_COLOR_WRITEMASK_SGIS" value="0x81EF"/>
+
+ <function name="TextureColorMaskSGIS">
+ <param name="red" type="GLboolean"/>
+ <param name="green" type="GLboolean"/>
+ <param name="blue" type="GLboolean"/>
+ <param name="alpha" type="GLboolean"/>
+ <glx rop="2082" ignore="true"/>
+ </function>
+</category>
+
+<!-- Extension number 215 is a GLX extension. -->
+<!-- Extension number 216 is a GLX extension. -->
+<!-- Extension number 217 is a GLX extension. -->
+<!-- Extension number 218 is a GLX extension. -->
+<!-- Extension number 219 is not listed in the extension registry. -->
+
+<category name="GL_EXT_texture_env_dot3" number="220">
+ <enum name="DOT3_RGB_EXT" value="0x8740"/>
+ <enum name="DOT3_RGBA_EXT" value="0x8741"/>
+</category>
+
+<category name="GL_ATI_texture_mirror_once" number="221">
+ <enum name="MIRROR_CLAMP_ATI" value="0x8742"/>
+ <enum name="MIRROR_CLAMP_TO_EDGE_ATI" value="0x8743"/>
+</category>
+
+<category name="GL_NV_fence" number="222">
+ <function name="DeleteFencesNV" offset="assign" static_dispatch="false">
+ <param name="n" type="GLsizei"/>
+ <param name="fences" type="const GLuint *"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="GenFencesNV" offset="assign" static_dispatch="false">
+ <param name="n" type="GLsizei" counter="true"/>
+ <param name="fences" type="GLuint *" output="true" count="n"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="IsFenceNV" offset="assign" static_dispatch="false">
+ <param name="fence" type="GLuint"/>
+ <return type="GLboolean"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="TestFenceNV" offset="assign" static_dispatch="false">
+ <param name="fence" type="GLuint"/>
+ <return type="GLboolean"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="GetFenceivNV" offset="assign" static_dispatch="false">
+ <param name="fence" type="GLuint"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLint *" output="true"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="FinishFenceNV" offset="assign" static_dispatch="false">
+ <param name="fence" type="GLuint"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="SetFenceNV" offset="assign" static_dispatch="false">
+ <param name="fence" type="GLuint"/>
+ <param name="condition" type="GLenum"/>
+ <glx ignore="true"/>
+ </function>
+</category>
+
+<category name="GL_IBM_texture_mirrored_repeat" number="224">
+ <enum name="MIRRORED_REPEAT_IBM" value="0x8370"/>
+</category>
+
+<category name="GL_NV_evaluators" number="225">
+ <function name="MapControlPointsNV">
+ <param name="target" type="GLenum"/>
+ <param name="index" type="GLuint"/>
+ <param name="type" type="GLenum"/>
+ <param name="ustride" type="GLsizei"/>
+ <param name="vstride" type="GLsizei"/>
+ <param name="uorder" type="GLint"/>
+ <param name="vorder" type="GLint"/>
+ <param name="packed" type="GLboolean"/>
+ <param name="points" type="const GLvoid *"/>
+ </function>
+
+ <function name="MapParameterivNV">
+ <param name="target" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="const GLint *"/>
+ </function>
+
+ <function name="MapParameterfvNV">
+ <param name="target" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="const GLfloat *"/>
+ </function>
+
+ <function name="GetMapControlPointsNV">
+ <param name="target" type="GLenum"/>
+ <param name="index" type="GLuint"/>
+ <param name="type" type="GLenum"/>
+ <param name="ustride" type="GLsizei"/>
+ <param name="vstride" type="GLsizei"/>
+ <param name="packed" type="GLboolean"/>
+ <param name="points" type="GLvoid *" output="true"/>
+ </function>
+
+ <function name="GetMapParameterivNV">
+ <param name="target" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLint *" output="true"/>
+ </function>
+
+ <function name="GetMapParameterfvNV">
+ <param name="target" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLfloat *" output="true"/>
+ </function>
+
+ <function name="GetMapAttribParameterivNV">
+ <param name="target" type="GLenum"/>
+ <param name="index" type="GLuint"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLint *" output="true"/>
+ </function>
+
+ <function name="GetMapAttribParameterfvNV">
+ <param name="target" type="GLenum"/>
+ <param name="index" type="GLuint"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLfloat *" output="true"/>
+ </function>
+
+ <function name="EvalMapsNV">
+ <param name="target" type="GLenum"/>
+ <param name="mode" type="GLenum"/>
+ </function>
+</category>
+
+<category name="GL_NV_packed_depth_stencil" number="226">
+ <enum name="DEPTH_STENCIL_NV" value="0x84F9"/>
+ <enum name="UNSIGNED_INT_24_8_NV" value="0x84FA"/>
+</category>
+
+<category name="GL_NV_register_combiners2" number="227">
+ <function name="CombinerStageParameterfvNV">
+ <param name="stage" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="const GLfloat *"/>
+ </function>
+
+ <function name="GetCombinerStageParameterfvNV">
+ <param name="stage" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLfloat *" output="true"/>
+ </function>
+</category>
+
+<category name="GL_NV_texture_compression_vtc" number="228">
+ <enum name="COMPRESSED_RGB_S3TC_DXT1_EXT" value="0x83F0"/>
+ <enum name="COMPRESSED_RGBA_S3TC_DXT1_EXT" value="0x83F1"/>
+ <enum name="COMPRESSED_RGBA_S3TC_DXT3_EXT" value="0x83F2"/>
+ <enum name="COMPRESSED_RGBA_S3TC_DXT5_EXT" value="0x83F3"/>
+</category>
+
+<category name="GL_NV_texture_rectangle" number="229">
+ <enum name="TEXTURE_RECTANGLE_NV" count="1" value="0x84F5">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="TEXTURE_BINDING_RECTANGLE_NV" count="1" value="0x84F6">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="PROXY_TEXTURE_RECTANGLE_NV" value="0x84F7"/>
+ <enum name="MAX_RECTANGLE_TEXTURE_SIZE_NV" count="1" value="0x84F8">
+ <size name="Get" mode="get"/>
+ </enum>
+</category>
+
+<category name="GL_NV_vertex_program" number="233">
+ <enum name="VERTEX_PROGRAM_NV" value="0x8620"/>
+ <enum name="VERTEX_STATE_PROGRAM_NV" value="0x8621"/>
+ <enum name="ATTRIB_ARRAY_SIZE_NV" count="1" value="0x8623">
+ <size name="GetVertexAttribdvNV" mode="get"/>
+ <size name="GetVertexAttribfvNV" mode="get"/>
+ <size name="GetVertexAttribivNV" mode="get"/>
+ </enum>
+ <enum name="ATTRIB_ARRAY_STRIDE_NV" count="1" value="0x8624">
+ <size name="GetVertexAttribdvNV" mode="get"/>
+ <size name="GetVertexAttribfvNV" mode="get"/>
+ <size name="GetVertexAttribivNV" mode="get"/>
+ </enum>
+ <enum name="ATTRIB_ARRAY_TYPE_NV" count="1" value="0x8625">
+ <size name="GetVertexAttribdvNV" mode="get"/>
+ <size name="GetVertexAttribfvNV" mode="get"/>
+ <size name="GetVertexAttribivNV" mode="get"/>
+ </enum>
+ <enum name="CURRENT_ATTRIB_NV" count="1" value="0x8626">
+ <size name="GetVertexAttribdvNV" mode="get"/>
+ <size name="GetVertexAttribfvNV" mode="get"/>
+ <size name="GetVertexAttribivNV" mode="get"/>
+ </enum>
+ <enum name="PROGRAM_LENGTH_NV" count="1" value="0x8627">
+ <size name="GetProgramivNV" mode="get"/>
+ </enum>
+ <enum name="PROGRAM_STRING_NV" value="0x8628"/>
+ <enum name="MODELVIEW_PROJECTION_NV" value="0x8629"/>
+ <enum name="IDENTITY_NV" value="0x862A"/>
+ <enum name="INVERSE_NV" value="0x862B"/>
+ <enum name="TRANSPOSE_NV" value="0x862C"/>
+ <enum name="INVERSE_TRANSPOSE_NV" value="0x862D"/>
+ <enum name="MAX_TRACK_MATRIX_STACK_DEPTH_NV" value="0x862E"/>
+ <enum name="MAX_TRACK_MATRICES_NV" value="0x862F"/>
+ <enum name="MATRIX0_NV" value="0x8630"/>
+ <enum name="MATRIX1_NV" value="0x8631"/>
+ <enum name="MATRIX2_NV" value="0x8632"/>
+ <enum name="MATRIX3_NV" value="0x8633"/>
+ <enum name="MATRIX4_NV" value="0x8634"/>
+ <enum name="MATRIX5_NV" value="0x8635"/>
+ <enum name="MATRIX6_NV" value="0x8636"/>
+ <enum name="MATRIX7_NV" value="0x8637"/>
+ <enum name="CURRENT_MATRIX_STACK_DEPTH_NV" value="0x8640"/>
+ <enum name="CURRENT_MATRIX_NV" value="0x8641"/>
+ <enum name="VERTEX_PROGRAM_POINT_SIZE_NV" value="0x8642"/>
+ <enum name="VERTEX_PROGRAM_TWO_SIDE_NV" value="0x8643"/>
+ <enum name="PROGRAM_PARAMETER_NV" value="0x8644"/>
+ <enum name="ATTRIB_ARRAY_POINTER_NV" value="0x8645"/>
+ <enum name="PROGRAM_TARGET_NV" count="1" value="0x8646">
+ <size name="GetProgramivNV" mode="get"/>
+ </enum>
+ <enum name="PROGRAM_RESIDENT_NV" count="1" value="0x8647">
+ <size name="GetProgramivNV" mode="get"/>
+ </enum>
+ <enum name="TRACK_MATRIX_NV" value="0x8648"/>
+ <enum name="TRACK_MATRIX_TRANSFORM_NV" value="0x8649"/>
+ <enum name="VERTEX_PROGRAM_BINDING_NV" value="0x864A"/>
+ <enum name="PROGRAM_ERROR_POSITION_NV" value="0x864B"/>
+ <enum name="VERTEX_ATTRIB_ARRAY0_NV" value="0x8650"/>
+ <enum name="VERTEX_ATTRIB_ARRAY1_NV" value="0x8651"/>
+ <enum name="VERTEX_ATTRIB_ARRAY2_NV" value="0x8652"/>
+ <enum name="VERTEX_ATTRIB_ARRAY3_NV" value="0x8653"/>
+ <enum name="VERTEX_ATTRIB_ARRAY4_NV" value="0x8654"/>
+ <enum name="VERTEX_ATTRIB_ARRAY5_NV" value="0x8655"/>
+ <enum name="VERTEX_ATTRIB_ARRAY6_NV" value="0x8656"/>
+ <enum name="VERTEX_ATTRIB_ARRAY7_NV" value="0x8657"/>
+ <enum name="VERTEX_ATTRIB_ARRAY8_NV" value="0x8658"/>
+ <enum name="VERTEX_ATTRIB_ARRAY9_NV" value="0x8659"/>
+ <enum name="VERTEX_ATTRIB_ARRAY10_NV" value="0x865A"/>
+ <enum name="VERTEX_ATTRIB_ARRAY11_NV" value="0x865B"/>
+ <enum name="VERTEX_ATTRIB_ARRAY12_NV" value="0x865C"/>
+ <enum name="VERTEX_ATTRIB_ARRAY13_NV" value="0x865D"/>
+ <enum name="VERTEX_ATTRIB_ARRAY14_NV" value="0x865E"/>
+ <enum name="VERTEX_ATTRIB_ARRAY15_NV" value="0x865F"/>
+ <enum name="MAP1_VERTEX_ATTRIB0_4_NV" value="0x8660"/>
+ <enum name="MAP1_VERTEX_ATTRIB1_4_NV" value="0x8661"/>
+ <enum name="MAP1_VERTEX_ATTRIB2_4_NV" value="0x8662"/>
+ <enum name="MAP1_VERTEX_ATTRIB3_4_NV" value="0x8663"/>
+ <enum name="MAP1_VERTEX_ATTRIB4_4_NV" value="0x8664"/>
+ <enum name="MAP1_VERTEX_ATTRIB5_4_NV" value="0x8665"/>
+ <enum name="MAP1_VERTEX_ATTRIB6_4_NV" value="0x8666"/>
+ <enum name="MAP1_VERTEX_ATTRIB7_4_NV" value="0x8667"/>
+ <enum name="MAP1_VERTEX_ATTRIB8_4_NV" value="0x8668"/>
+ <enum name="MAP1_VERTEX_ATTRIB9_4_NV" value="0x8669"/>
+ <enum name="MAP1_VERTEX_ATTRIB10_4_NV" value="0x866A"/>
+ <enum name="MAP1_VERTEX_ATTRIB11_4_NV" value="0x866B"/>
+ <enum name="MAP1_VERTEX_ATTRIB12_4_NV" value="0x866C"/>
+ <enum name="MAP1_VERTEX_ATTRIB13_4_NV" value="0x866D"/>
+ <enum name="MAP1_VERTEX_ATTRIB14_4_NV" value="0x866E"/>
+ <enum name="MAP1_VERTEX_ATTRIB15_4_NV" value="0x866F"/>
+ <enum name="MAP2_VERTEX_ATTRIB0_4_NV" value="0x8670"/>
+ <enum name="MAP2_VERTEX_ATTRIB1_4_NV" value="0x8671"/>
+ <enum name="MAP2_VERTEX_ATTRIB2_4_NV" value="0x8672"/>
+ <enum name="MAP2_VERTEX_ATTRIB3_4_NV" value="0x8673"/>
+ <enum name="MAP2_VERTEX_ATTRIB4_4_NV" value="0x8674"/>
+ <enum name="MAP2_VERTEX_ATTRIB5_4_NV" value="0x8675"/>
+ <enum name="MAP2_VERTEX_ATTRIB6_4_NV" value="0x8676"/>
+ <enum name="MAP2_VERTEX_ATTRIB7_4_NV" value="0x8677"/>
+ <enum name="MAP2_VERTEX_ATTRIB8_4_NV" value="0x8678"/>
+ <enum name="MAP2_VERTEX_ATTRIB9_4_NV" value="0x8679"/>
+ <enum name="MAP2_VERTEX_ATTRIB10_4_NV" value="0x867A"/>
+ <enum name="MAP2_VERTEX_ATTRIB11_4_NV" value="0x867B"/>
+ <enum name="MAP2_VERTEX_ATTRIB12_4_NV" value="0x867C"/>
+ <enum name="MAP2_VERTEX_ATTRIB13_4_NV" value="0x867D"/>
+ <enum name="MAP2_VERTEX_ATTRIB14_4_NV" value="0x867E"/>
+ <enum name="MAP2_VERTEX_ATTRIB15_4_NV" value="0x867F"/>
+
+ <function name="AreProgramsResidentNV" offset="assign">
+ <param name="n" type="GLsizei" counter="true"/>
+ <param name="ids" type="const GLuint *" count="n"/>
+ <param name="residences" type="GLboolean *" output="true" count="n"/>
+ <return type="GLboolean"/>
+ <glx vendorpriv="1293"/>
+ </function>
+
+ <function name="BindProgramNV" offset="assign">
+ <param name="target" type="GLenum"/>
+ <param name="program" type="GLuint"/>
+ <glx rop="4180"/>
+ </function>
+
+ <function name="DeleteProgramsNV" offset="assign">
+ <param name="n" type="GLsizei" counter="true"/>
+ <param name="programs" type="const GLuint *" count="n"/>
+ <glx vendorpriv="1294"/>
+ </function>
+
+ <function name="ExecuteProgramNV" offset="assign">
+ <param name="target" type="GLenum"/>
+ <param name="id" type="GLuint"/>
+ <param name="params" type="const GLfloat *" count="4"/>
+ <glx rop="4181"/>
+ </function>
+
+ <function name="GenProgramsNV" offset="assign">
+ <param name="n" type="GLsizei" counter="true"/>
+ <param name="programs" type="GLuint *" output="true" count="n"/>
+ <glx vendorpriv="1295" always_array="true"/>
+ </function>
+
+ <!-- This isn't 100% correct. Currently, the only valid value of pname
+ is GL_PROGRAM_PARAMETER_NV, and the count for that pname is always
+ 4. This is why the pname parameter was removed in the ARB version
+ of these functions.
+ -->
+
+ <function name="GetProgramParameterdvNV" offset="assign">
+ <param name="target" type="GLenum"/>
+ <param name="index" type="GLuint"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLdouble *" output="true" count="4"/>
+ <glx vendorpriv="1297"/>
+ </function>
+
+ <function name="GetProgramParameterfvNV" offset="assign">
+ <param name="target" type="GLenum"/>
+ <param name="index" type="GLuint"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLfloat *" output="true" count="4"/>
+ <glx vendorpriv="1296"/>
+ </function>
+
+ <function name="GetProgramivNV" offset="assign">
+ <param name="id" type="GLuint"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLint *" output="true" variable_param="pname"/>
+ <glx vendorpriv="1298"/>
+ </function>
+
+ <function name="GetProgramStringNV" offset="assign">
+ <param name="id" type="GLuint"/>
+ <param name="pname" type="GLenum"/>
+ <param name="program" type="GLubyte *" output="true"/>
+ <glx vendorpriv="1299" handcode="server" always_array="true"/>
+ </function>
+
+ <function name="GetTrackMatrixivNV" offset="assign">
+ <param name="target" type="GLenum"/>
+ <param name="address" type="GLuint"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLint *" output="true" count="1"/>
+ <glx vendorpriv="1300"/>
+ </function>
+
+ <function name="GetVertexAttribdvNV" offset="assign">
+ <param name="index" type="GLuint"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLdouble *" output="true" variable_param="pname"/>
+ <glx vendorpriv="1301"/>
+ </function>
+
+ <function name="GetVertexAttribfvNV" offset="assign">
+ <param name="index" type="GLuint"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLfloat *" output="true" variable_param="pname"/>
+ <glx vendorpriv="1302"/>
+ </function>
+
+ <function name="GetVertexAttribivNV" offset="assign">
+ <param name="index" type="GLuint"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLint *" output="true" variable_param="pname"/>
+ <glx vendorpriv="1303"/>
+ </function>
+
+ <function name="GetVertexAttribPointervNV" offset="assign">
+ <param name="index" type="GLuint"/>
+ <param name="pname" type="GLenum"/>
+ <param name="pointer" type="GLvoid **" output="true"/>
+ <glx handcode="true"/>
+ </function>
+
+ <function name="IsProgramNV" offset="assign">
+ <param name="program" type="GLuint"/>
+ <return type="GLboolean"/>
+ <glx vendorpriv="1304"/>
+ </function>
+
+ <function name="LoadProgramNV" offset="assign">
+ <param name="target" type="GLenum"/>
+ <param name="id" type="GLuint"/>
+ <param name="len" type="GLsizei" counter="true"/>
+ <param name="program" type="const GLubyte *" count="len"/>
+ <glx rop="4183"/>
+ </function>
+
+ <function name="ProgramParameter4dNV" alias="ProgramEnvParameter4dARB">
+ <param name="target" type="GLenum"/>
+ <param name="index" type="GLuint"/>
+ <param name="x" type="GLdouble"/>
+ <param name="y" type="GLdouble"/>
+ <param name="z" type="GLdouble"/>
+ <param name="w" type="GLdouble"/>
+ </function>
+
+ <function name="ProgramParameter4dvNV" alias="ProgramEnvParameter4dvARB">
+ <param name="target" type="GLenum"/>
+ <param name="index" type="GLuint"/>
+ <param name="params" type="const GLdouble *"/>
+ </function>
+
+ <function name="ProgramParameter4fNV" alias="ProgramEnvParameter4fARB">
+ <param name="target" type="GLenum"/>
+ <param name="index" type="GLuint"/>
+ <param name="x" type="GLfloat"/>
+ <param name="y" type="GLfloat"/>
+ <param name="z" type="GLfloat"/>
+ <param name="w" type="GLfloat"/>
+ </function>
+
+ <function name="ProgramParameter4fvNV" alias="ProgramEnvParameter4fvARB">
+ <param name="target" type="GLenum"/>
+ <param name="index" type="GLuint"/>
+ <param name="params" type="const GLfloat *"/>
+ </function>
+
+ <function name="ProgramParameters4dvNV" offset="assign">
+ <param name="target" type="GLenum"/>
+ <param name="index" type="GLuint"/>
+ <param name="num" type="GLsizei" counter="true"/>
+ <param name="params" type="const GLdouble *" count="num" count_scale="4"/>
+ <glx rop="4187"/>
+ </function>
+
+ <function name="ProgramParameters4fvNV" offset="assign">
+ <param name="target" type="GLenum"/>
+ <param name="index" type="GLuint"/>
+ <param name="num" type="GLsizei" counter="true"/>
+ <param name="params" type="const GLfloat *" count="num" count_scale="4"/>
+ <glx rop="4186"/>
+ </function>
+
+ <function name="RequestResidentProgramsNV" offset="assign">
+ <param name="n" type="GLsizei" counter="true"/>
+ <param name="ids" type="const GLuint *" count="n"/>
+ <glx rop="4182"/>
+ </function>
+
+ <function name="TrackMatrixNV" offset="assign">
+ <param name="target" type="GLenum"/>
+ <param name="address" type="GLuint"/>
+ <param name="matrix" type="GLenum"/>
+ <param name="transform" type="GLenum"/>
+ <glx rop="4188"/>
+ </function>
+
+ <function name="VertexAttribPointerNV" offset="assign">
+ <param name="index" type="GLuint"/>
+ <param name="size" type="GLint"/>
+ <param name="type" type="GLenum"/>
+ <param name="stride" type="GLsizei"/>
+ <param name="pointer" type="const GLvoid *"/>
+ <glx handcode="true"/>
+ </function>
+
+ <function name="VertexAttrib1sNV" offset="assign" vectorequiv="VertexAttrib1svNV">
+ <param name="index" type="GLuint"/>
+ <param name="x" type="GLshort"/>
+ </function>
+
+ <function name="VertexAttrib1svNV" offset="assign">
+ <param name="index" type="GLuint"/>
+ <param name="v" type="const GLshort *" count="1"/>
+ <glx rop="4265"/>
+ </function>
+
+ <function name="VertexAttrib2sNV" offset="assign" vectorequiv="VertexAttrib2svNV">
+ <param name="index" type="GLuint"/>
+ <param name="x" type="GLshort"/>
+ <param name="y" type="GLshort"/>
+ </function>
+
+ <function name="VertexAttrib2svNV" offset="assign">
+ <param name="index" type="GLuint"/>
+ <param name="v" type="const GLshort *" count="2"/>
+ <glx rop="4266"/>
+ </function>
+
+ <function name="VertexAttrib3sNV" offset="assign" vectorequiv="VertexAttrib3svNV">
+ <param name="index" type="GLuint"/>
+ <param name="x" type="GLshort"/>
+ <param name="y" type="GLshort"/>
+ <param name="z" type="GLshort"/>
+ </function>
+
+ <function name="VertexAttrib3svNV" offset="assign">
+ <param name="index" type="GLuint"/>
+ <param name="v" type="const GLshort *" count="3"/>
+ <glx rop="4267"/>
+ </function>
+
+ <function name="VertexAttrib4sNV" offset="assign" vectorequiv="VertexAttrib4svNV">
+ <param name="index" type="GLuint"/>
+ <param name="x" type="GLshort"/>
+ <param name="y" type="GLshort"/>
+ <param name="z" type="GLshort"/>
+ <param name="w" type="GLshort"/>
+ </function>
+
+ <function name="VertexAttrib4svNV" offset="assign">
+ <param name="index" type="GLuint"/>
+ <param name="v" type="const GLshort *" count="4"/>
+ <glx rop="4268"/>
+ </function>
+
+ <function name="VertexAttrib1fNV" offset="assign" vectorequiv="VertexAttrib1fvNV">
+ <param name="index" type="GLuint"/>
+ <param name="x" type="GLfloat"/>
+ </function>
+
+ <function name="VertexAttrib1fvNV" offset="assign">
+ <param name="index" type="GLuint"/>
+ <param name="v" type="const GLfloat *" count="1"/>
+ <glx rop="4269"/>
+ </function>
+
+ <function name="VertexAttrib2fNV" offset="assign" vectorequiv="VertexAttrib2fvNV">
+ <param name="index" type="GLuint"/>
+ <param name="x" type="GLfloat"/>
+ <param name="y" type="GLfloat"/>
+ </function>
+
+ <function name="VertexAttrib2fvNV" offset="assign">
+ <param name="index" type="GLuint"/>
+ <param name="v" type="const GLfloat *" count="2"/>
+ <glx rop="4270"/>
+ </function>
+
+ <function name="VertexAttrib3fNV" offset="assign" vectorequiv="VertexAttrib3fvNV">
+ <param name="index" type="GLuint"/>
+ <param name="x" type="GLfloat"/>
+ <param name="y" type="GLfloat"/>
+ <param name="z" type="GLfloat"/>
+ </function>
+
+ <function name="VertexAttrib3fvNV" offset="assign">
+ <param name="index" type="GLuint"/>
+ <param name="v" type="const GLfloat *" count="3"/>
+ <glx rop="4271"/>
+ </function>
+
+ <function name="VertexAttrib4fNV" offset="assign" vectorequiv="VertexAttrib4fvNV">
+ <param name="index" type="GLuint"/>
+ <param name="x" type="GLfloat"/>
+ <param name="y" type="GLfloat"/>
+ <param name="z" type="GLfloat"/>
+ <param name="w" type="GLfloat"/>
+ </function>
+
+ <function name="VertexAttrib4fvNV" offset="assign">
+ <param name="index" type="GLuint"/>
+ <param name="v" type="const GLfloat *" count="4"/>
+ <glx rop="4272"/>
+ </function>
+
+ <function name="VertexAttrib1dNV" offset="assign" vectorequiv="VertexAttrib1dvNV">
+ <param name="index" type="GLuint"/>
+ <param name="x" type="GLdouble"/>
+ </function>
+
+ <function name="VertexAttrib1dvNV" offset="assign">
+ <param name="index" type="GLuint"/>
+ <param name="v" type="const GLdouble *" count="1"/>
+ <glx rop="4273" doubles_in_order="true"/>
+ </function>
+
+ <function name="VertexAttrib2dNV" offset="assign" vectorequiv="VertexAttrib2dvNV">
+ <param name="index" type="GLuint"/>
+ <param name="x" type="GLdouble"/>
+ <param name="y" type="GLdouble"/>
+ </function>
+
+ <function name="VertexAttrib2dvNV" offset="assign">
+ <param name="index" type="GLuint"/>
+ <param name="v" type="const GLdouble *" count="2"/>
+ <glx rop="4274" doubles_in_order="true"/>
+ </function>
+
+ <function name="VertexAttrib3dNV" offset="assign" vectorequiv="VertexAttrib3dvNV">
+ <param name="index" type="GLuint"/>
+ <param name="x" type="GLdouble"/>
+ <param name="y" type="GLdouble"/>
+ <param name="z" type="GLdouble"/>
+ </function>
+
+ <function name="VertexAttrib3dvNV" offset="assign">
+ <param name="index" type="GLuint"/>
+ <param name="v" type="const GLdouble *" count="3"/>
+ <glx rop="4275" doubles_in_order="true"/>
+ </function>
+
+ <function name="VertexAttrib4dNV" offset="assign" vectorequiv="VertexAttrib4dvNV">
+ <param name="index" type="GLuint"/>
+ <param name="x" type="GLdouble"/>
+ <param name="y" type="GLdouble"/>
+ <param name="z" type="GLdouble"/>
+ <param name="w" type="GLdouble"/>
+ </function>
+
+ <function name="VertexAttrib4dvNV" offset="assign">
+ <param name="index" type="GLuint"/>
+ <param name="v" type="const GLdouble *" count="4"/>
+ <glx rop="4276" doubles_in_order="true"/>
+ </function>
+
+ <function name="VertexAttrib4ubNV" offset="assign" vectorequiv="VertexAttrib4ubvNV">
+ <param name="index" type="GLuint"/>
+ <param name="x" type="GLubyte"/>
+ <param name="y" type="GLubyte"/>
+ <param name="z" type="GLubyte"/>
+ <param name="w" type="GLubyte"/>
+ </function>
+
+ <function name="VertexAttrib4ubvNV" offset="assign">
+ <param name="index" type="GLuint"/>
+ <param name="v" type="const GLubyte *" count="4"/>
+ <glx rop="4277"/>
+ </function>
+
+ <function name="VertexAttribs1svNV" offset="assign">
+ <param name="index" type="GLuint"/>
+ <param name="n" type="GLsizei" counter="true"/>
+ <param name="v" type="const GLshort *" count="n"/>
+ <glx rop="4202"/>
+ </function>
+
+ <function name="VertexAttribs2svNV" offset="assign">
+ <param name="index" type="GLuint"/>
+ <param name="n" type="GLsizei" counter="true"/>
+ <param name="v" type="const GLshort *" count="n" count_scale="2"/>
+ <glx rop="4203"/>
+ </function>
+
+ <function name="VertexAttribs3svNV" offset="assign">
+ <param name="index" type="GLuint"/>
+ <param name="n" type="GLsizei" counter="true"/>
+ <param name="v" type="const GLshort *" count="n" count_scale="3"/>
+ <glx rop="4204"/>
+ </function>
+
+ <function name="VertexAttribs4svNV" offset="assign">
+ <param name="index" type="GLuint"/>
+ <param name="n" type="GLsizei" counter="true"/>
+ <param name="v" type="const GLshort *" count="n" count_scale="4"/>
+ <glx rop="4205"/>
+ </function>
+
+ <function name="VertexAttribs1fvNV" offset="assign">
+ <param name="index" type="GLuint"/>
+ <param name="n" type="GLsizei" counter="true"/>
+ <param name="v" type="const GLfloat *" count="n"/>
+ <glx rop="4206"/>
+ </function>
+
+ <function name="VertexAttribs2fvNV" offset="assign">
+ <param name="index" type="GLuint"/>
+ <param name="n" type="GLsizei" counter="true"/>
+ <param name="v" type="const GLfloat *" count="n" count_scale="2"/>
+ <glx rop="4207"/>
+ </function>
+
+ <function name="VertexAttribs3fvNV" offset="assign">
+ <param name="index" type="GLuint"/>
+ <param name="n" type="GLsizei" counter="true"/>
+ <param name="v" type="const GLfloat *" count="n" count_scale="3"/>
+ <glx rop="4208"/>
+ </function>
+
+ <function name="VertexAttribs4fvNV" offset="assign">
+ <param name="index" type="GLuint"/>
+ <param name="n" type="GLsizei" counter="true"/>
+ <param name="v" type="const GLfloat *" count="n" count_scale="4"/>
+ <glx rop="4209"/>
+ </function>
+
+ <function name="VertexAttribs1dvNV" offset="assign">
+ <param name="index" type="GLuint"/>
+ <param name="n" type="GLsizei" counter="true"/>
+ <param name="v" type="const GLdouble *" count="n"/>
+ <glx rop="4210" doubles_in_order="true"/>
+ </function>
+
+ <function name="VertexAttribs2dvNV" offset="assign">
+ <param name="index" type="GLuint"/>
+ <param name="n" type="GLsizei" counter="true"/>
+ <param name="v" type="const GLdouble *" count="n" count_scale="2"/>
+ <glx rop="4211" doubles_in_order="true"/>
+ </function>
+
+ <function name="VertexAttribs3dvNV" offset="assign">
+ <param name="index" type="GLuint"/>
+ <param name="n" type="GLsizei" counter="true"/>
+ <param name="v" type="const GLdouble *" count="n" count_scale="3"/>
+ <glx rop="4212" doubles_in_order="true"/>
+ </function>
+
+ <function name="VertexAttribs4dvNV" offset="assign">
+ <param name="index" type="GLuint"/>
+ <param name="n" type="GLsizei" counter="true"/>
+ <param name="v" type="const GLdouble *" count="n" count_scale="4"/>
+ <glx rop="4213" doubles_in_order="true"/>
+ </function>
+
+ <function name="VertexAttribs4ubvNV" offset="assign">
+ <param name="index" type="GLuint"/>
+ <param name="n" type="GLsizei" counter="true"/>
+ <param name="v" type="const GLubyte *" count="n" count_scale="4"/>
+ <glx rop="4214"/>
+ </function>
+</category>
+
+<!-- Extension number 234 is a GLX extension. -->
+
+<category name="GL_SGIX_texture_coordinate_clamp" number="235">
+ <enum name="TEXTURE_MAX_CLAMP_S_SGIX" count="1" value="0x8369">
+ <size name="TexParameterfv" mode="get"/>
+ <size name="TexParameteriv" mode="get"/>
+ <size name="GetTexParameterfv" mode="get"/>
+ <size name="GetTexParameteriv" mode="get"/>
+ </enum>
+ <enum name="TEXTURE_MAX_CLAMP_T_SGIX" count="1" value="0x836A">
+ <size name="TexParameterfv" mode="get"/>
+ <size name="TexParameteriv" mode="get"/>
+ <size name="GetTexParameterfv" mode="get"/>
+ <size name="GetTexParameteriv" mode="get"/>
+ </enum>
+ <enum name="TEXTURE_MAX_CLAMP_R_SGIX" count="1" value="0x836B">
+ <size name="TexParameterfv" mode="get"/>
+ <size name="TexParameteriv" mode="get"/>
+ <size name="GetTexParameterfv" mode="get"/>
+ <size name="GetTexParameteriv" mode="get"/>
+ </enum>
+</category>
+
+<!-- Extension number 236 is not listed in the extension registry. -->
+<!-- Extension number 237 is a GLX extension. -->
+<!-- Extension number 238 is a GLX extension. -->
+<!-- Extension number 242 is a WGL extension. -->
+
+<category name="GL_NV_copy_depth_to_color" number="243">
+ <enum name="DEPTH_STENCIL_TO_RGBA_NV" value="0x886E"/>
+ <enum name="DEPTH_STENCIL_TO_BGRA_NV" value="0x886F"/>
+</category>
+
+<category name="GL_ATI_envmap_bumpmap" number="244">
+ <enum name="BUMP_ROT_MATRIX_ATI" count="4" value="0x8775">
+ <size name="TexBumpParameterfv"/>
+ <size name="TexBumpParameteriv"/>
+ <size name="GetTexBumpParameterfv" mode="get"/>
+ <size name="GetTexBumpParameteriv" mode="get"/>
+ </enum>
+ <enum name="BUMP_ROT_MATRIX_SIZE_ATI" count="1" value="0x8776">
+ <size name="GetTexBumpParameterfv" mode="get"/>
+ <size name="GetTexBumpParameteriv" mode="get"/>
+ </enum>
+ <enum name="BUMP_NUM_TEX_UNITS_ATI" count="1" value="0x8777">
+ <size name="GetTexBumpParameterfv" mode="get"/>
+ <size name="GetTexBumpParameteriv" mode="get"/>
+ </enum>
+ <enum name="BUMP_TEX_UNITS_ATI" count="-1" value="0x8778">
+ <size name="GetTexBumpParameterfv" mode="get"/>
+ <size name="GetTexBumpParameteriv" mode="get"/>
+ </enum>
+ <enum name="DUDV_ATI" value="0x8779"/>
+ <enum name="DU8DV8_ATI" value="0x877A"/>
+ <enum name="BUMP_ENVMAP_ATI" value="0x877B"/>
+ <enum name="BUMP_TARGET_ATI" count="1" value="0x877C">
+ <size name="TexEnviv" mode="get"/>
+ <size name="TexEnvfv" mode="get"/>
+ <size name="GetTexEnviv" mode="get"/>
+ <size name="GetTexEnvfv" mode="get"/>
+ </enum>
+ <function name="TexBumpParameterfvATI" offset="assign">
+ <param name="pname" type="GLenum"/>
+ <param name="param" type="const GLfloat *" variable_param="pname"/>
+ <glx ignore="true"/>
+ </function>
+ <function name="TexBumpParameterivATI" offset="assign">
+ <param name="pname" type="GLenum"/>
+ <param name="param" type="const GLint *" variable_param="pname"/>
+ <glx ignore="true"/>
+ </function>
+ <function name="GetTexBumpParameterfvATI" offset="assign">
+ <param name="pname" type="GLenum"/>
+ <param name="param" type="GLfloat *" variable_param="pname"/>
+ <glx ignore="true"/>
+ </function>
+ <function name="GetTexBumpParameterivATI" offset="assign">
+ <param name="pname" type="GLenum"/>
+ <param name="param" type="GLint *" variable_param="pname"/>
+ <glx ignore="true"/>
+ </function>
+</category>
+
+<category name="GL_ATI_fragment_shader" number="245">
+ <function name="GenFragmentShadersATI" offset="assign">
+ <return type="GLuint"/>
+ <param name="range" type="GLuint"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="BindFragmentShaderATI" offset="assign">
+ <param name="id" type="GLuint"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="DeleteFragmentShaderATI" offset="assign">
+ <param name="id" type="GLuint"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="BeginFragmentShaderATI" offset="assign">
+ <glx ignore="true"/>
+ </function>
+
+ <function name="EndFragmentShaderATI" offset="assign">
+ <glx ignore="true"/>
+ </function>
+
+ <function name="PassTexCoordATI" offset="assign">
+ <param name="dst" type="GLuint"/>
+ <param name="coord" type="GLuint"/>
+ <param name="swizzle" type="GLenum"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="SampleMapATI" offset="assign">
+ <param name="dst" type="GLuint"/>
+ <param name="interp" type="GLuint"/>
+ <param name="swizzle" type="GLenum"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="ColorFragmentOp1ATI" offset="assign">
+ <param name="op" type="GLenum"/>
+ <param name="dst" type="GLuint"/>
+ <param name="dstMask" type="GLuint"/>
+ <param name="dstMod" type="GLuint"/>
+ <param name="arg1" type="GLuint"/>
+ <param name="arg1Rep" type="GLuint"/>
+ <param name="arg1Mod" type="GLuint"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="ColorFragmentOp2ATI" offset="assign">
+ <param name="op" type="GLenum"/>
+ <param name="dst" type="GLuint"/>
+ <param name="dstMask" type="GLuint"/>
+ <param name="dstMod" type="GLuint"/>
+ <param name="arg1" type="GLuint"/>
+ <param name="arg1Rep" type="GLuint"/>
+ <param name="arg1Mod" type="GLuint"/>
+ <param name="arg2" type="GLuint"/>
+ <param name="arg2Rep" type="GLuint"/>
+ <param name="arg2Mod" type="GLuint"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="ColorFragmentOp3ATI" offset="assign">
+ <param name="op" type="GLenum"/>
+ <param name="dst" type="GLuint"/>
+ <param name="dstMask" type="GLuint"/>
+ <param name="dstMod" type="GLuint"/>
+ <param name="arg1" type="GLuint"/>
+ <param name="arg1Rep" type="GLuint"/>
+ <param name="arg1Mod" type="GLuint"/>
+ <param name="arg2" type="GLuint"/>
+ <param name="arg2Rep" type="GLuint"/>
+ <param name="arg2Mod" type="GLuint"/>
+ <param name="arg3" type="GLuint"/>
+ <param name="arg3Rep" type="GLuint"/>
+ <param name="arg3Mod" type="GLuint"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="AlphaFragmentOp1ATI" offset="assign">
+ <param name="op" type="GLenum"/>
+ <param name="dst" type="GLuint"/>
+ <param name="dstMod" type="GLuint"/>
+ <param name="arg1" type="GLuint"/>
+ <param name="arg1Rep" type="GLuint"/>
+ <param name="arg1Mod" type="GLuint"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="AlphaFragmentOp2ATI" offset="assign">
+ <param name="op" type="GLenum"/>
+ <param name="dst" type="GLuint"/>
+ <param name="dstMod" type="GLuint"/>
+ <param name="arg1" type="GLuint"/>
+ <param name="arg1Rep" type="GLuint"/>
+ <param name="arg1Mod" type="GLuint"/>
+ <param name="arg2" type="GLuint"/>
+ <param name="arg2Rep" type="GLuint"/>
+ <param name="arg2Mod" type="GLuint"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="AlphaFragmentOp3ATI" offset="assign">
+ <param name="op" type="GLenum"/>
+ <param name="dst" type="GLuint"/>
+ <param name="dstMod" type="GLuint"/>
+ <param name="arg1" type="GLuint"/>
+ <param name="arg1Rep" type="GLuint"/>
+ <param name="arg1Mod" type="GLuint"/>
+ <param name="arg2" type="GLuint"/>
+ <param name="arg2Rep" type="GLuint"/>
+ <param name="arg2Mod" type="GLuint"/>
+ <param name="arg3" type="GLuint"/>
+ <param name="arg3Rep" type="GLuint"/>
+ <param name="arg3Mod" type="GLuint"/>
+ <glx ignore="true"/>
+ </function>
+
+ <function name="SetFragmentShaderConstantATI" offset="assign">
+ <param name="dst" type="GLuint"/>
+ <param name="value" type="const GLfloat *"/>
+ <glx ignore="true"/>
+ </function>
+</category>
+
+<!-- Extension number 250 is a WGL extension. -->
+<!-- Extension number 251 is a WGL extension. -->
+<!-- Extension number 252 is a WGL extension. -->
+<!-- Extension number 253 is a WGL extension. -->
+<!-- Extension number 254 is a WGL extension. -->
+<!-- Extension number 255 is a WGL extension. -->
+
+<category name="GL_SUN_mesh_array" number="257">
+ <enum name="QUAD_MESH_SUN" value="0x8614"/>
+ <enum name="TRIANGLE_MESH_SUN" value="0x8615"/>
+
+ <function name="DrawMeshArraysSUN">
+ <param name="mode" type="GLenum"/>
+ <param name="first" type="GLint"/>
+ <param name="count" type="GLsizei"/>
+ <param name="width" type="GLsizei"/>
+ </function>
+</category>
+
+<category name="GL_SUN_slice_accum" number="258">
+ <enum name="SLICE_ACCUM_SUN" value="0x85CC"/>
+</category>
+
+<category name="GL_NV_multisample_filter_hint" number="259">
+ <enum name="MULTISAMPLE_FILTER_HINT_NV" count="1" value="0x8534">
+ <size name="Get" mode="get"/>
+ </enum>
+</category>
+
+<category name="GL_NV_depth_clamp" number="260">
+ <enum name="DEPTH_CLAMP_NV" count="1" value="0x864F">
+ <size name="Get" mode="get"/>
+ </enum>
+</category>
+
+<category name="GL_NV_point_sprite" number="262">
+ <!-- These existing enums can be passed as a parameter to the function
+ added for this extension. -->
+
+ <enum name="POINT_SIZE_MIN_EXT" count="1" value="0x8126">
+ <size name="PointParameterivNV" mode="get"/>
+ </enum>
+ <enum name="POINT_SIZE_MAX_EXT" count="1" value="0x8127">
+ <size name="PointParameterivNV" mode="get"/>
+ </enum>
+ <enum name="POINT_FADE_THRESHOLD_SIZE_EXT" count="1" value="0x8128">
+ <size name="PointParameterivNV" mode="get"/>
+ </enum>
+ <enum name="POINT_DISTANCE_ATTENUATION_EXT" count="3" value="0x8129">
+ <size name="PointParameterivNV" mode="get"/>
+ </enum>
+
+ <enum name="POINT_SPRITE_NV" count="1" value="0x8861">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="COORD_REPLACE_NV" count="1" value="0x8862">
+ <size name="TexEnvfv" mode="get"/>
+ <size name="TexEnviv" mode="get"/>
+ <size name="GetTexEnvfv" mode="get"/>
+ <size name="GetTexEnviv" mode="get"/>
+ </enum>
+ <enum name="POINT_SPRITE_R_MODE_NV" count="1" value="0x8863">
+ <size name="PointParameterfvEXT" mode="get"/>
+ <size name="PointParameterivNV" mode="get"/>
+ <size name="Get" mode="get"/>
+ </enum>
+
+ <function name="PointParameteriNV" offset="assign">
+ <param name="pname" type="GLenum"/>
+ <param name="param" type="GLint"/>
+ <glx rop="4221"/>
+ </function>
+
+ <function name="PointParameterivNV" offset="assign">
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="const GLint *" variable_param="pname"/>
+ <glx rop="4222"/>
+ </function>
+</category>
+
+<!-- Extension number 263 is a WGL extension. -->
+<!-- Extension number 264 is a WGL extension. -->
+
+<category name="GL_EXT_shadow_funcs" number="267">
+ <!-- No new functions, types, enums. -->
+</category>
+
+<category name="GL_EXT_stencil_two_side" number="268">
+ <enum name="STENCIL_TEST_TWO_SIDE_EXT" count="1" value="0x8910">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="ACTIVE_STENCIL_FACE_EXT" count="1" value="0x8911">
+ <size name="Get" mode="get"/>
+ </enum>
+
+ <function name="ActiveStencilFaceEXT" offset="assign" static_dispatch="false">
+ <param name="face" type="GLenum"/>
+ <glx rop="4220"/>
+ </function>
+</category>
+
+<xi:include href="APPLE_object_purgeable.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
+<xi:include href="APPLE_vertex_array_object.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
+
+<category name="GL_APPLE_ycbcr_422" number="275">
+ <enum name="YCBCR_422_APPLE" value="0x85B9"/>
+ <enum name="UNSIGNED_SHORT_8_8_APPLE" value="0x85BA"/>
+ <enum name="UNSIGNED_SHORT_8_8_REV_APPLE" value="0x85BB"/>
+</category>
+
+<category name="GL_S3_s3tc" number="276">
+ <enum name="RGB_S3TC" value="0x83A0"/>
+ <enum name="RGB4_S3TC" value="0x83A1"/>
+ <enum name="RGBA_S3TC" value="0x83A2"/>
+ <enum name="RGBA4_S3TC" value="0x83A3"/>
+ <enum name="RGBA_DXT5_S3TC" value="0x83A4"/>
+ <enum name="RGBA4_DXT5_S3TC" value="0x83A5"/>
+</category>
+
+<category name="GL_ATI_draw_buffers" number="277">
+ <enum name="MAX_DRAW_BUFFERS_ATI" count="1" value="0x8824">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="DRAW_BUFFER0_ATI" count="1" value="0x8825">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="DRAW_BUFFER1_ATI" count="1" value="0x8826">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="DRAW_BUFFER2_ATI" count="1" value="0x8827">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="DRAW_BUFFER3_ATI" count="1" value="0x8828">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="DRAW_BUFFER4_ATI" count="1" value="0x8829">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="DRAW_BUFFER5_ATI" count="1" value="0x882A">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="DRAW_BUFFER6_ATI" count="1" value="0x882B">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="DRAW_BUFFER7_ATI" count="1" value="0x882C">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="DRAW_BUFFER8_ATI" count="1" value="0x882D">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="DRAW_BUFFER9_ATI" count="1" value="0x882E">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="DRAW_BUFFER10_ATI" count="1" value="0x882F">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="DRAW_BUFFER11_ATI" count="1" value="0x8830">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="DRAW_BUFFER12_ATI" count="1" value="0x8831">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="DRAW_BUFFER13_ATI" count="1" value="0x8832">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="DRAW_BUFFER14_ATI" count="1" value="0x8833">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="DRAW_BUFFER15_ATI" count="1" value="0x8834">
+ <size name="Get" mode="get"/>
+ </enum>
+
+ <function name="DrawBuffersATI" alias="DrawBuffersARB">
+ <param name="n" type="GLsizei" counter="true"/>
+ <param name="bufs" type="const GLenum *" count="n"/>
+ </function>
+</category>
+
+<!-- Extension number 278 is a WGL extension. -->
+
+<category name="GL_ATI_texture_env_combine3" number="279">
+ <enum name="MODULATE_ADD_ATI" value="0x8744"/>
+ <enum name="MODULATE_SIGNED_ADD_ATI" value="0x8745"/>
+ <enum name="MODULATE_SUBTRACT_ATI" value="0x8746"/>
+</category>
+
+<category name="GL_NV_fragment_program" number="282">
+ <function name="ProgramNamedParameter4fNV" offset="assign" vectorequiv="ProgramNamedParameter4fvNV">
+ <param name="id" type="GLuint"/>
+ <param name="len" type="GLsizei" counter="true"/>
+ <param name="name" type="const GLubyte *" count="len"/>
+ <param name="x" type="GLfloat"/>
+ <param name="y" type="GLfloat"/>
+ <param name="z" type="GLfloat"/>
+ <param name="w" type="GLfloat"/>
+ </function>
+
+ <function name="ProgramNamedParameter4dNV" offset="assign" vectorequiv="ProgramNamedParameter4dvNV">
+ <param name="id" type="GLuint"/>
+ <param name="len" type="GLsizei" counter="true"/>
+ <param name="name" type="const GLubyte *" count="len"/>
+ <param name="x" type="GLdouble"/>
+ <param name="y" type="GLdouble"/>
+ <param name="z" type="GLdouble"/>
+ <param name="w" type="GLdouble"/>
+ </function>
+
+ <function name="ProgramNamedParameter4fvNV" offset="assign">
+ <param name="id" type="GLuint"/>
+ <param name="len" type="GLsizei" counter="true"/>
+ <param name="name" type="const GLubyte *" count="len"/>
+ <param name="v" type="const GLfloat *" count="4"/>
+ <glx rop="4218"/>
+ </function>
+
+ <function name="ProgramNamedParameter4dvNV" offset="assign">
+ <param name="id" type="GLuint"/>
+ <param name="len" type="GLsizei" counter="true"/>
+ <param name="name" type="const GLubyte *" count="len"/>
+ <param name="v" type="const GLdouble *" count="4"/>
+ <glx rop="4219"/>
+ </function>
+
+ <function name="GetProgramNamedParameterfvNV" offset="assign">
+ <param name="id" type="GLuint"/>
+ <param name="len" type="GLsizei" counter="true"/>
+ <param name="name" type="const GLubyte *" count="len"/>
+ <param name="params" type="GLfloat *" output="true" count="4"/>
+ <glx vendorpriv="1310" always_array="true"/>
+ </function>
+
+ <function name="GetProgramNamedParameterdvNV" offset="assign">
+ <param name="id" type="GLuint"/>
+ <param name="len" type="GLsizei" counter="true"/>
+ <param name="name" type="const GLubyte *" count="len"/>
+ <param name="params" type="GLdouble *" output="true" count="4"/>
+ <glx vendorpriv="1311" always_array="true"/>
+ </function>
+</category>
+
+<category name="GL_NV_texture_expand_normal" number="286">
+ <enum name="TEXTURE_UNSIGNED_REMAP_MODE_NV" count="1" value="0x888F">
+ <size name="TexParameterfv" mode="get"/>
+ <size name="TexParameteriv" mode="get"/>
+ <size name="GetTexParameterfv" mode="get"/>
+ <size name="GetTexParameteriv" mode="get"/>
+ </enum>
+</category>
+
+<category name="GL_OES_compressed_paletted_texture" number="294">
+ <enum name="PALETTE4_RGB8_OES" value="0x8B90"/>
+ <enum name="PALETTE4_RGBA8_OES" value="0x8B91"/>
+ <enum name="PALETTE4_R5_G6_B5_OES" value="0x8B92"/>
+ <enum name="PALETTE4_RGBA4_OES" value="0x8B93"/>
+ <enum name="PALETTE4_RGB5_A1_OES" value="0x8B94"/>
+ <enum name="PALETTE8_RGB8_OES" value="0x8B95"/>
+ <enum name="PALETTE8_RGBA8_OES" value="0x8B96"/>
+ <enum name="PALETTE8_R5_G6_B5_OES" value="0x8B97"/>
+ <enum name="PALETTE8_RGBA4_OES" value="0x8B98"/>
+ <enum name="PALETTE8_RGB5_A1_OES" value="0x8B99"/>
+</category>
+
+<category name="GL_OES_read_format" number="295">
+ <enum name="IMPLEMENTATION_COLOR_READ_TYPE_OES" value="0x8B9A"/>
+ <enum name="IMPLEMENTATION_COLOR_READ_FORMAT_OES" value="0x8B9B"/>
+</category>
+
+<category name="GL_EXT_depth_bounds_test" number="297">
+ <enum name="DEPTH_BOUNDS_TEST_EXT" count="1" value="0x8890">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="DEPTH_BOUNDS_EXT" count="2" value="0x8891">
+ <size name="Get" mode="get"/>
+ </enum>
+
+ <function name="DepthBoundsEXT" offset="assign" static_dispatch="false">
+ <param name="zmin" type="GLclampd"/>
+ <param name="zmax" type="GLclampd"/>
+ <glx rop="4229" ignore="true"/>
+ </function>
+</category>
+
+<category name="GL_EXT_texture_mirror_clamp" number="298">
+ <enum name="MIRROR_CLAMP_EXT" value="0x8742"/>
+ <enum name="MIRROR_CLAMP_TO_EDGE_EXT" value="0x8743"/>
+ <enum name="MIRROR_CLAMP_TO_BORDER_EXT" value="0x8912"/>
+</category>
+
+<category name="GL_EXT_blend_equation_separate" number="299">
+ <enum name="BLEND_EQUATION_RGB_EXT" count="1" value="0x8009">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="BLEND_EQUATION_ALPHA_EXT" count="1" value="0x883D">
+ <size name="Get" mode="get"/>
+ </enum>
+
+ <function name="BlendEquationSeparateEXT" offset="assign" static_dispatch="false">
+ <param name="modeRGB" type="GLenum"/>
+ <param name="modeA" type="GLenum"/>
+ <glx rop="4228"/>
+ </function>
+</category>
+
+<category name="GL_MESA_pack_invert" number="300">
+ <enum name="PACK_INVERT_MESA" count="1" value="0x8758">
+ <size name="Get" mode="get"/>
+ </enum>
+</category>
+
+<category name="GL_MESA_ycbcr_texture" number="301">
+ <enum name="YCBCR_MESA" value="0x8757"/>
+ <enum name="UNSIGNED_SHORT_8_8_MESA" value="0x85BA"/>
+ <enum name="UNSIGNED_SHORT_8_8_REV_MESA" value="0x85BB"/>
+</category>
+
+<category name="GL_EXT_pixel_buffer_object" number="302">
+ <enum name="PIXEL_PACK_BUFFER_EXT" value="0x88EB"/>
+ <enum name="PIXEL_UNPACK_BUFFER_EXT" value="0x88EC"/>
+ <enum name="PIXEL_PACK_BUFFER_BINDING_EXT" value="0x88ED"/>
+ <enum name="PIXEL_UNPACK_BUFFER_BINDING_EXT" value="0x88EF"/>
+</category>
+
+<category name="GL_NV_fragment_program_option" number="303">
+ <!-- No new functions, types, enums. -->
+</category>
+
+<category name="GL_NV_fragment_program2" number="304">
+ <enum name="MAX_PROGRAM_EXEC_INSTRUCTIONS_NV" count="1" value="0x88F4">
+ <size name="GetProgramivARB" mode="get"/>
+ </enum>
+ <enum name="MAX_PROGRAM_CALL_DEPTH_NV" count="1" value="0x88F5">
+ <size name="GetProgramivARB" mode="get"/>
+ </enum>
+ <enum name="MAX_PROGRAM_IF_DEPTH_NV" count="1" value="0x88F6">
+ <size name="GetProgramivARB" mode="get"/>
+ </enum>
+ <enum name="MAX_PROGRAM_LOOP_DEPTH_NV" count="1" value="0x88F7">
+ <size name="GetProgramivARB" mode="get"/>
+ </enum>
+ <enum name="MAX_PROGRAM_LOOP_COUNT_NV" count="1" value="0x88F8">
+ <size name="GetProgramivARB" mode="get"/>
+ </enum>
+</category>
+
+<category name="GL_NV_vertex_program2_option" number="305">
+ <enum name="MAX_PROGRAM_EXEC_INSTRUCTIONS_NV" count="1" value="0x88F4">
+ <size name="GetProgramivARB" mode="get"/>
+ </enum>
+ <enum name="MAX_PROGRAM_CALL_DEPTH_NV" count="1" value="0x88F5">
+ <size name="GetProgramivARB" mode="get"/>
+ </enum>
+</category>
+
+<category name="GL_NV_vertex_program3" number="306">
+ <enum name="MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB" count="1" value="0x8B4C"/>
+</category>
+
+<!-- Extension number 307 is a GLX extension. -->
+<!-- Extension number 308 is a GLX extension. -->
+
+<category name="GL_EXT_texture_compression_dxt1" number="309">
+ <enum name="COMPRESSED_RGB_S3TC_DXT1_EXT" value="0x83F0"/>
+ <enum name="COMPRESSED_RGBA_S3TC_DXT1_EXT" value="0x83F1"/>
+</category>
+
+<xi:include href="EXT_framebuffer_object.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
+
+<xi:include href="EXT_packed_depth_stencil.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
+
+<xi:include href="EXT_provoking_vertex.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
+
+<xi:include href="EXT_draw_buffers2.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
+
+
+<category name="GL_APPLE_flush_buffer_range" number="321">
+ <enum name="BUFFER_SERIALIZED_MODIFY_APPLE" count="1" value="0x8A12">
+ <size name="GetBufferParameteriv" mode="get"/>
+ </enum>
+ <enum name="BUFFER_FLUSHING_UNMAP_APPLE" count="1" value="0x8A13">
+ <size name="GetBufferParameteriv" mode="get"/>
+ </enum>
+ <function name="BufferParameteriAPPLE" offset="assign" static_dispatch="false">
+ <param name="target" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="param" type="GLint"/>
+ </function>
+ <function name="FlushMappedBufferRangeAPPLE" offset="assign" static_dispatch="false">
+ <param name="target" type="GLenum"/>
+ <param name="offset" type="GLintptr"/>
+ <param name="size" type="GLsizeiptr"/>
+ </function>
+</category>
+
+<xi:include href="EXT_texture_array.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
+
+<category name="GL_APPLE_texture_range" number="367">
+ <enum name="TEXTURE_STORAGE_HINT_APPLE" count="1" value="0x85BC">
+ <size name="TexParameteriv" mode="get"/>
+ <size name="TexParameterfv" mode="get"/>
+ <size name="GetTexParameteriv" mode="get"/>
+ <size name="GetTexParameterfv" mode="get"/>
+ </enum>
+ <enum name="STORAGE_PRIVATE_APPLE" count="1" value="0x85BD">
+ <size name="TexParameteriv" mode="get"/>
+ <size name="TexParameterfv" mode="get"/>
+ </enum>
+ <enum name="STORAGE_CACHED_APPLE" count="1" value="0x85BE">
+ <size name="TexParameteriv" mode="get"/>
+ <size name="TexParameterfv" mode="get"/>
+ </enum>
+ <enum name="STORAGE_SHARED_APPLE" count="1" value="0x85BF">
+ <size name="TexParameteriv" mode="get"/>
+ <size name="TexParameterfv" mode="get"/>
+ </enum>
+ <enum name="TEXTURE_RANGE_LENGTH_APPLE" count="1" value="0x85B7">
+ <size name="GetTexParameteriv" mode="get"/>
+ <size name="GetTexParameterfv" mode="get"/>
+ </enum>
+ <enum name="TEXTURE_RANGE_POINTER_APPLE" count="1" value="0x85B8">
+ <size name="GetTexParameterPointervAPPLE" mode="get"/>
+ </enum>
+ <function name="TextureRangeAPPLE" offset="assign" static_dispatch="false">
+ <param name="target" type="GLenum"/>
+ <param name="length" type="GLsizei"/>
+ <param name="pointer" type="GLvoid *"/>
+ </function>
+ <function name="GetTexParameterPointervAPPLE" offset="assign" static_dispatch="false">
+ <param name="target" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLvoid **"/>
+ </function>
+</category>
+
+<xi:include href="EXT_separate_shader_objects.xml"
+ xmlns:xi="http://www.w3.org/2001/XInclude"/>
+
+<!-- Unnumbered extensions sorted by name. -->
+
+<category name="GL_ATI_blend_equation_separate">
+ <function name="BlendEquationSeparateATI" alias="BlendEquationSeparateEXT" static_dispatch="false">
+ <param name="modeRGB" type="GLenum"/>
+ <param name="modeA" type="GLenum"/>
+ </function>
+</category>
+
+<category name="GL_ATI_separate_stencil">
+ <enum name="STENCIL_BACK_FUNC_ATI" count="1" value="0x8800">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="STENCIL_BACK_FAIL_ATI" count="1" value="0x8801">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="STENCIL_BACK_PASS_DEPTH_FAIL_ATI" count="1" value="0x8802">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="STENCIL_BACK_PASS_DEPTH_PASS_ATI" count="1" value="0x8803">
+ <size name="Get" mode="get"/>
+ </enum>
+
+ <function name="StencilOpSeparateATI" alias="StencilOpSeparate" static_dispatch="false">
+ <param name="face" type="GLenum"/>
+ <param name="sfail" type="GLenum"/>
+ <param name="zfail" type="GLenum"/>
+ <param name="zpass" type="GLenum"/>
+ </function>
+ <function name="StencilFuncSeparateATI" offset="assign" static_dispatch="false">
+ <param name="frontfunc" type="GLenum"/>
+ <param name="backfunc" type="GLenum"/>
+ <param name="ref" type="GLint"/>
+ <param name="mask" type="GLuint"/>
+ </function>
+
+</category>
+
+<category name="GL_EXT_gpu_program_parameters">
+ <function name="ProgramEnvParameters4fvEXT" offset="assign" static_dispatch="false">
+ <param name="target" type="GLenum"/>
+ <param name="index" type="GLuint"/>
+ <param name="count" type="GLsizei"/>
+ <param name="params" type="const GLfloat *"/>
+ </function>
+
+ <function name="ProgramLocalParameters4fvEXT" offset="assign" static_dispatch="false">
+ <param name="target" type="GLenum"/>
+ <param name="index" type="GLuint"/>
+ <param name="count" type="GLsizei"/>
+ <param name="params" type="const GLfloat *"/>
+ </function>
+</category>
+
+<category name="GL_EXT_timer_query">
+ <enum name="TIME_ELAPSED_EXT" value="0x88BF"/>
+ <type name="int64EXT" size="8"/>
+ <type name="uint64EXT" unsigned="true" size="8"/>
+ <function name="GetQueryObjecti64vEXT" offset="assign" static_dispatch="false">
+ <param name="id" type="GLuint"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLint64EXT *"/>
+ </function>
+ <function name="GetQueryObjectui64vEXT" offset="assign" static_dispatch="false">
+ <param name="id" type="GLuint"/>
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="GLuint64EXT *"/>
+ </function>
+</category>
+
+<category name="GL_INGR_blend_func_separate">
+ <function name="BlendFuncSeparateINGR" alias="BlendFuncSeparateEXT" static_dispatch="false">
+ <param name="sfactorRGB" type="GLenum"/>
+ <param name="dfactorRGB" type="GLenum"/>
+ <param name="sfactorAlpha" type="GLenum"/>
+ <param name="dfactorAlpha" type="GLenum"/>
+ </function>
+</category>
+
+<category name="GL_MESA_texture_signed_rgba">
+ <enum name="SIGNED_NORMALIZED" value="0x8F9C"/>
+ <enum name="RGBA_SNORM" value="0x8F93"/>
+ <enum name="RGBA8_SNORM" value="0x8F97"/>
+</category>
+
+<category name="GL_MESA_shader_debug">
+ <enum name="DEBUG_OBJECT_MESA" value="0x8759"/>
+ <enum name="DEBUG_PRINT_MESA" value="0x875A"/>
+ <enum name="DEBUG_ASSERT_MESA" value="0x875B"/>
+ <function name="CreateDebugObjectMESA">
+ <return type="GLhandleARB"/>
+ <glx ignore="true"/>
+ </function>
+ <function name="ClearDebugLogMESA">
+ <param name="obj" type="GLhandleARB"/>
+ <param name="logType" type="GLenum"/>
+ <param name="shaderType" type="GLenum"/>
+ <glx ignore="true"/>
+ </function>
+ <function name="GetDebugLogMESA">
+ <param name="obj" type="GLhandleARB"/>
+ <param name="logType" type="GLenum"/>
+ <param name="shaderType" type="GLenum"/>
+ <param name="maxLength" type="GLsizei"/>
+ <param name="length" type="GLsizei *" output="true"/>
+ <param name="debugLog" type="GLcharARB *" output="true"/>
+ <glx ignore="true"/>
+ </function>
+ <function name="GetDebugLogLengthMESA">
+ <return type="GLsizei"/>
+ <param name="obj" type="GLhandleARB"/>
+ <param name="logType" type="GLenum"/>
+ <param name="shaderType" type="GLenum"/>
+ <glx ignore="true"/>
+ </function>
+</category>
+
+<category name="GL_SGIS_point_parameters">
+ <enum name="POINT_SIZE_MIN_SGIS" count="1" value="0x8126">
+ <size name="PointParameterfvEXT" mode="get"/>
+ </enum>
+ <enum name="POINT_SIZE_MAX_SGIS" count="1" value="0x8127">
+ <size name="PointParameterfvEXT" mode="get"/>
+ </enum>
+ <enum name="POINT_FADE_THRESHOLD_SIZE_SGIS" count="1" value="0x8128">
+ <size name="PointParameterfvEXT" mode="get"/>
+ </enum>
+ <enum name="POINT_DISTANCE_ATTENUATION_SGIS" count="3" value="0x8129">
+ <size name="PointParameterfvEXT" mode="get"/>
+ </enum>
+
+ <function name="PointParameterfSGIS" alias="PointParameterfEXT" static_dispatch="false">
+ <param name="pname" type="GLenum"/>
+ <param name="param" type="GLfloat"/>
+ </function>
+
+ <function name="PointParameterfvSGIS" alias="PointParameterfvEXT" static_dispatch="false">
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="const GLfloat *"/>
+ </function>
+</category>
+
+<category name="GL_SGIX_igloo_interface">
+ <function name="IglooInterfaceSGIX">
+ <param name="pname" type="GLenum"/>
+ <param name="params" type="const GLvoid *"/>
+ </function>
+</category>
+
+<category name="GL_SGIX_polynomial_ffd">
+ <function name="DeformationMap3dSGIX">
+ <param name="target" type="GLenum"/>
+ <param name="u1" type="GLdouble"/>
+ <param name="u2" type="GLdouble"/>
+ <param name="ustride" type="GLint"/>
+ <param name="uorder" type="GLint"/>
+ <param name="v1" type="GLdouble"/>
+ <param name="v2" type="GLdouble"/>
+ <param name="vstride" type="GLint"/>
+ <param name="vorder" type="GLint"/>
+ <param name="w1" type="GLdouble"/>
+ <param name="w2" type="GLdouble"/>
+ <param name="wstride" type="GLint"/>
+ <param name="worder" type="GLint"/>
+ <param name="points" type="const GLdouble *"/>
+ </function>
+
+ <function name="DeformationMap3fSGIX">
+ <param name="target" type="GLenum"/>
+ <param name="u1" type="GLfloat"/>
+ <param name="u2" type="GLfloat"/>
+ <param name="ustride" type="GLint"/>
+ <param name="uorder" type="GLint"/>
+ <param name="v1" type="GLfloat"/>
+ <param name="v2" type="GLfloat"/>
+ <param name="vstride" type="GLint"/>
+ <param name="vorder" type="GLint"/>
+ <param name="w1" type="GLfloat"/>
+ <param name="w2" type="GLfloat"/>
+ <param name="wstride" type="GLint"/>
+ <param name="worder" type="GLint"/>
+ <param name="points" type="const GLfloat *"/>
+ </function>
+
+ <function name="DeformSGIX">
+ <param name="mask" type="GLenum"/>
+ </function>
+
+ <function name="LoadIdentityDeformationMapSGIX">
+ <param name="mask" type="GLenum"/>
+ </function>
+</category>
+
+<xi:include href="OES_EGL_image.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
+
+<xi:include href="EXT_texture_integer.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
+
+<xi:include href="EXT_gpu_shader4.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
+<xi:include href="GL3x.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
+
+<xi:include href="ARB_instanced_arrays.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
+
+<xi:include href="ARB_draw_buffers_blend.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
+<xi:include href="AMD_draw_buffers_blend.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
+
+<xi:include href="ARB_texture_buffer_object.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
+
+</OpenGLAPI>
diff --git a/mesalib/src/mapi/glapi/gen/gl_XML.py b/mesalib/src/mapi/glapi/gen/gl_XML.py
index 4d414e8b0..4bf2d02ba 100644
--- a/mesalib/src/mapi/glapi/gen/gl_XML.py
+++ b/mesalib/src/mapi/glapi/gen/gl_XML.py
@@ -1,967 +1,967 @@
-#!/usr/bin/env python
-
-# (C) Copyright IBM Corporation 2004, 2005
-# All Rights Reserved.
-#
-# Permission is hereby granted, free of charge, to any person obtaining a
-# copy of this software and associated documentation files (the "Software"),
-# to deal in the Software without restriction, including without limitation
-# on the rights to use, copy, modify, merge, publish, distribute, sub
-# license, and/or sell copies of the Software, and to permit persons to whom
-# the Software is furnished to do so, subject to the following conditions:
-#
-# The above copyright notice and this permission notice (including the next
-# paragraph) shall be included in all copies or substantial portions of the
-# Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
-# IBM AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
-# IN THE SOFTWARE.
-#
-# Authors:
-# Ian Romanick <idr@us.ibm.com>
-
-import libxml2
-import re, sys, string
-import typeexpr
-
-
-def parse_GL_API( file_name, factory = None ):
- doc = libxml2.readFile( file_name, None, libxml2.XML_PARSE_XINCLUDE + libxml2.XML_PARSE_NOBLANKS + libxml2.XML_PARSE_DTDVALID + libxml2.XML_PARSE_DTDATTR + libxml2.XML_PARSE_DTDLOAD + libxml2.XML_PARSE_NOENT )
- ret = doc.xincludeProcess()
-
- if not factory:
- factory = gl_item_factory()
-
- api = factory.create_item( "api", None, None )
- api.process_element( doc )
-
- # After the XML has been processed, we need to go back and assign
- # dispatch offsets to the functions that request that their offsets
- # be assigned by the scripts. Typically this means all functions
- # that are not part of the ABI.
-
- for func in api.functionIterateByCategory():
- if func.assign_offset:
- func.offset = api.next_offset;
- api.next_offset += 1
-
- doc.freeDoc()
-
- return api
-
-
-def is_attr_true( element, name ):
- """Read a name value from an element's attributes.
-
- The value read from the attribute list must be either 'true' or
- 'false'. If the value is 'false', zero will be returned. If the
- value is 'true', non-zero will be returned. An exception will be
- raised for any other value."""
-
- value = element.nsProp( name, None )
- if value == "true":
- return 1
- elif value == "false":
- return 0
- else:
- raise RuntimeError('Invalid value "%s" for boolean "%s".' % (value, name))
-
-
-class gl_print_base:
- """Base class of all API pretty-printers.
-
- In the model-view-controller pattern, this is the view. Any derived
- class will want to over-ride the printBody, printRealHader, and
- printRealFooter methods. Some derived classes may want to over-ride
- printHeader and printFooter, or even Print (though this is unlikely).
- """
-
- def __init__(self):
- # Name of the script that is generating the output file.
- # Every derived class should set this to the name of its
- # source file.
-
- self.name = "a"
-
-
- # License on the *generated* source file. This may differ
- # from the license on the script that is generating the file.
- # Every derived class should set this to some reasonable
- # value.
- #
- # See license.py for an example of a reasonable value.
-
- self.license = "The license for this file is unspecified."
-
-
- # The header_tag is the name of the C preprocessor define
- # used to prevent multiple inclusion. Typically only
- # generated C header files need this to be set. Setting it
- # causes code to be generated automatically in printHeader
- # and printFooter.
-
- self.header_tag = None
-
-
- # List of file-private defines that must be undefined at the
- # end of the file. This can be used in header files to define
- # names for use in the file, then undefine them at the end of
- # the header file.
-
- self.undef_list = []
- return
-
-
- def Print(self, api):
- self.printHeader()
- self.printBody(api)
- self.printFooter()
- return
-
-
- def printHeader(self):
- """Print the header associated with all files and call the printRealHeader method."""
-
- print '/* DO NOT EDIT - This file generated automatically by %s script */' \
- % (self.name)
- print ''
- print '/*'
- print ' * ' + self.license.replace('\n', '\n * ')
- print ' */'
- print ''
- if self.header_tag:
- print '#if !defined( %s )' % (self.header_tag)
- print '# define %s' % (self.header_tag)
- print ''
- self.printRealHeader();
- return
-
-
- def printFooter(self):
- """Print the header associated with all files and call the printRealFooter method."""
-
- self.printRealFooter()
-
- if self.undef_list:
- print ''
- for u in self.undef_list:
- print "# undef %s" % (u)
-
- if self.header_tag:
- print ''
- print '#endif /* !defined( %s ) */' % (self.header_tag)
-
-
- def printRealHeader(self):
- """Print the "real" header for the created file.
-
- In the base class, this function is empty. All derived
- classes should over-ride this function."""
- return
-
-
- def printRealFooter(self):
- """Print the "real" footer for the created file.
-
- In the base class, this function is empty. All derived
- classes should over-ride this function."""
- return
-
-
- def printPure(self):
- """Conditionally define `PURE' function attribute.
-
- Conditionally defines a preprocessor macro `PURE' that wraps
- GCC's `pure' function attribute. The conditional code can be
- easilly adapted to other compilers that support a similar
- feature.
-
- The name is also added to the file's undef_list.
- """
- self.undef_list.append("PURE")
- print """# if defined(__GNUC__) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590))
-# define PURE __attribute__((pure))
-# else
-# define PURE
-# endif"""
- return
-
-
- def printFastcall(self):
- """Conditionally define `FASTCALL' function attribute.
-
- Conditionally defines a preprocessor macro `FASTCALL' that
- wraps GCC's `fastcall' function attribute. The conditional
- code can be easilly adapted to other compilers that support a
- similar feature.
-
- The name is also added to the file's undef_list.
- """
-
- self.undef_list.append("FASTCALL")
- print """# if defined(__i386__) && defined(__GNUC__) && !defined(__CYGWIN__) && !defined(__MINGW32__)
-# define FASTCALL __attribute__((fastcall))
-# else
-# define FASTCALL
-# endif"""
- return
-
-
- def printVisibility(self, S, s):
- """Conditionally define visibility function attribute.
-
- Conditionally defines a preprocessor macro name S that wraps
- GCC's visibility function attribute. The visibility used is
- the parameter s. The conditional code can be easilly adapted
- to other compilers that support a similar feature.
-
- The name is also added to the file's undef_list.
- """
-
- self.undef_list.append(S)
- print """# if (defined(__GNUC__) && !defined(__CYGWIN__) && !defined(__MINGW32__)) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590) && defined(__ELF__))
-# define %s __attribute__((visibility("%s")))
-# else
-# define %s
-# endif""" % (S, s, S)
- return
-
-
- def printNoinline(self):
- """Conditionally define `NOINLINE' function attribute.
-
- Conditionally defines a preprocessor macro `NOINLINE' that
- wraps GCC's `noinline' function attribute. The conditional
- code can be easilly adapted to other compilers that support a
- similar feature.
-
- The name is also added to the file's undef_list.
- """
-
- self.undef_list.append("NOINLINE")
- print """# if defined(__GNUC__) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590))
-# define NOINLINE __attribute__((noinline))
-# else
-# define NOINLINE
-# endif"""
- return
-
-
-def real_function_name(element):
- name = element.nsProp( "name", None )
- alias = element.nsProp( "alias", None )
-
- if alias:
- return alias
- else:
- return name
-
-
-def real_category_name(c):
- if re.compile("[1-9][0-9]*[.][0-9]+").match(c):
- return "GL_VERSION_" + c.replace(".", "_")
- else:
- return c
-
-
-def classify_category(name, number):
- """Based on the category name and number, select a numerical class for it.
-
- Categories are divided into four classes numbered 0 through 3. The
- classes are:
-
- 0. Core GL versions, sorted by version number.
- 1. ARB extensions, sorted by extension number.
- 2. Non-ARB extensions, sorted by extension number.
- 3. Un-numbered extensions, sorted by extension name.
- """
-
- try:
- core_version = float(name)
- except Exception,e:
- core_version = 0.0
-
- if core_version > 0.0:
- cat_type = 0
- key = name
- elif name.startswith("GL_ARB_") or name.startswith("GLX_ARB_") or name.startswith("WGL_ARB_"):
- cat_type = 1
- key = int(number)
- else:
- if number != None:
- cat_type = 2
- key = int(number)
- else:
- cat_type = 3
- key = name
-
-
- return [cat_type, key]
-
-
-def create_parameter_string(parameters, include_names):
- """Create a parameter string from a list of gl_parameters."""
-
- list = []
- for p in parameters:
- if p.is_padding:
- continue
-
- if include_names:
- list.append( p.string() )
- else:
- list.append( p.type_string() )
-
- if len(list) == 0: list = ["void"]
-
- return string.join(list, ", ")
-
-
-class gl_item:
- def __init__(self, element, context):
- self.context = context
- self.name = element.nsProp( "name", None )
- self.category = real_category_name( element.parent.nsProp( "name", None ) )
- return
-
-
-class gl_type( gl_item ):
- def __init__(self, element, context):
- gl_item.__init__(self, element, context)
- self.size = int( element.nsProp( "size", None ), 0 )
-
- te = typeexpr.type_expression( None )
- tn = typeexpr.type_node()
- tn.size = int( element.nsProp( "size", None ), 0 )
- tn.integer = not is_attr_true( element, "float" )
- tn.unsigned = is_attr_true( element, "unsigned" )
- tn.name = "GL" + self.name
- te.set_base_type_node( tn )
-
- self.type_expr = te
- return
-
-
- def get_type_expression(self):
- return self.type_expr
-
-
-class gl_enum( gl_item ):
- def __init__(self, element, context):
- gl_item.__init__(self, element, context)
- self.value = int( element.nsProp( "value", None ), 0 )
-
- temp = element.nsProp( "count", None )
- if not temp or temp == "?":
- self.default_count = -1
- else:
- try:
- c = int(temp)
- except Exception,e:
- raise RuntimeError('Invalid count value "%s" for enum "%s" in function "%s" when an integer was expected.' % (temp, self.name, n))
-
- self.default_count = c
-
- return
-
-
- def priority(self):
- """Calculate a 'priority' for this enum name.
-
- When an enum is looked up by number, there may be many
- possible names, but only one is the 'prefered' name. The
- priority is used to select which name is the 'best'.
-
- Highest precedence is given to core GL name. ARB extension
- names have the next highest, followed by EXT extension names.
- Vendor extension names are the lowest.
- """
-
- if self.name.endswith( "_BIT" ):
- bias = 1
- else:
- bias = 0
-
- if self.category.startswith( "GL_VERSION_" ):
- priority = 0
- elif self.category.startswith( "GL_ARB_" ):
- priority = 2
- elif self.category.startswith( "GL_EXT_" ):
- priority = 4
- else:
- priority = 6
-
- return priority + bias
-
-
-
-class gl_parameter:
- def __init__(self, element, context):
- self.name = element.nsProp( "name", None )
-
- ts = element.nsProp( "type", None )
- self.type_expr = typeexpr.type_expression( ts, context )
-
- temp = element.nsProp( "variable_param", None )
- if temp:
- self.count_parameter_list = temp.split( ' ' )
- else:
- self.count_parameter_list = []
-
- # The count tag can be either a numeric string or the name of
- # a variable. If it is the name of a variable, the int(c)
- # statement will throw an exception, and the except block will
- # take over.
-
- c = element.nsProp( "count", None )
- try:
- count = int(c)
- self.count = count
- self.counter = None
- except Exception,e:
- count = 1
- self.count = 0
- self.counter = c
-
- self.count_scale = int(element.nsProp( "count_scale", None ))
-
- elements = (count * self.count_scale)
- if elements == 1:
- elements = 0
-
- #if ts == "GLdouble":
- # print '/* stack size -> %s = %u (before)*/' % (self.name, self.type_expr.get_stack_size())
- # print '/* # elements = %u */' % (elements)
- self.type_expr.set_elements( elements )
- #if ts == "GLdouble":
- # print '/* stack size -> %s = %u (after) */' % (self.name, self.type_expr.get_stack_size())
-
- self.is_client_only = is_attr_true( element, 'client_only' )
- self.is_counter = is_attr_true( element, 'counter' )
- self.is_output = is_attr_true( element, 'output' )
-
-
- # Pixel data has special parameters.
-
- self.width = element.nsProp('img_width', None)
- self.height = element.nsProp('img_height', None)
- self.depth = element.nsProp('img_depth', None)
- self.extent = element.nsProp('img_extent', None)
-
- self.img_xoff = element.nsProp('img_xoff', None)
- self.img_yoff = element.nsProp('img_yoff', None)
- self.img_zoff = element.nsProp('img_zoff', None)
- self.img_woff = element.nsProp('img_woff', None)
-
- self.img_format = element.nsProp('img_format', None)
- self.img_type = element.nsProp('img_type', None)
- self.img_target = element.nsProp('img_target', None)
-
- self.img_pad_dimensions = is_attr_true( element, 'img_pad_dimensions' )
- self.img_null_flag = is_attr_true( element, 'img_null_flag' )
- self.img_send_null = is_attr_true( element, 'img_send_null' )
-
- self.is_padding = is_attr_true( element, 'padding' )
- return
-
-
- def compatible(self, other):
- return 1
-
-
- def is_array(self):
- return self.is_pointer()
-
-
- def is_pointer(self):
- return self.type_expr.is_pointer()
-
-
- def is_image(self):
- if self.width:
- return 1
- else:
- return 0
-
-
- def is_variable_length(self):
- return len(self.count_parameter_list) or self.counter
-
-
- def is_64_bit(self):
- count = self.type_expr.get_element_count()
- if count:
- if (self.size() / count) == 8:
- return 1
- else:
- if self.size() == 8:
- return 1
-
- return 0
-
-
- def string(self):
- return self.type_expr.original_string + " " + self.name
-
-
- def type_string(self):
- return self.type_expr.original_string
-
-
- def get_base_type_string(self):
- return self.type_expr.get_base_name()
-
-
- def get_dimensions(self):
- if not self.width:
- return [ 0, "0", "0", "0", "0" ]
-
- dim = 1
- w = self.width
- h = "1"
- d = "1"
- e = "1"
-
- if self.height:
- dim = 2
- h = self.height
-
- if self.depth:
- dim = 3
- d = self.depth
-
- if self.extent:
- dim = 4
- e = self.extent
-
- return [ dim, w, h, d, e ]
-
-
- def get_stack_size(self):
- return self.type_expr.get_stack_size()
-
-
- def size(self):
- if self.is_image():
- return 0
- else:
- return self.type_expr.get_element_size()
-
-
- def get_element_count(self):
- c = self.type_expr.get_element_count()
- if c == 0:
- return 1
-
- return c
-
-
- def size_string(self, use_parens = 1):
- s = self.size()
- if self.counter or self.count_parameter_list:
- list = [ "compsize" ]
-
- if self.counter and self.count_parameter_list:
- list.append( self.counter )
- elif self.counter:
- list = [ self.counter ]
-
- if s > 1:
- list.append( str(s) )
-
- if len(list) > 1 and use_parens :
- return "(%s)" % (string.join(list, " * "))
- else:
- return string.join(list, " * ")
-
- elif self.is_image():
- return "compsize"
- else:
- return str(s)
-
-
- def format_string(self):
- if self.type_expr.original_string == "GLenum":
- return "0x%x"
- else:
- return self.type_expr.format_string()
-
-
-
-class gl_function( gl_item ):
- def __init__(self, element, context):
- self.context = context
- self.name = None
-
- self.entry_points = []
- self.return_type = "void"
- self.parameters = []
- self.offset = -1
- self.initialized = 0
- self.images = []
-
- self.assign_offset = 0
-
- self.static_entry_points = []
-
- # Track the parameter string (for the function prototype)
- # for each entry-point. This is done because some functions
- # change their prototype slightly when promoted from extension
- # to ARB extension to core. glTexImage3DEXT and glTexImage3D
- # are good examples of this. Scripts that need to generate
- # code for these differing aliases need to real prototype
- # for each entry-point. Otherwise, they may generate code
- # that won't compile.
-
- self.parameter_strings = {}
-
- self.process_element( element )
-
- return
-
-
- def process_element(self, element):
- name = element.nsProp( "name", None )
- alias = element.nsProp( "alias", None )
-
- if is_attr_true(element, "static_dispatch"):
- self.static_entry_points.append(name)
-
- self.entry_points.append( name )
- if alias:
- true_name = alias
- else:
- true_name = name
-
- # Only try to set the offset when a non-alias
- # entry-point is being processes.
-
- offset = element.nsProp( "offset", None )
- if offset:
- try:
- o = int( offset )
- self.offset = o
- except Exception, e:
- self.offset = -1
- if offset == "assign":
- self.assign_offset = 1
-
-
- if not self.name:
- self.name = true_name
- elif self.name != true_name:
- raise RuntimeError("Function true name redefined. Was %s, now %s." % (self.name, true_name))
-
-
- # There are two possible cases. The first time an entry-point
- # with data is seen, self.initialized will be 0. On that
- # pass, we just fill in the data. The next time an
- # entry-point with data is seen, self.initialized will be 1.
- # On that pass we have to make that the new values match the
- # valuse from the previous entry-point.
-
- parameters = []
- return_type = "void"
- child = element.children
- while child:
- if child.type == "element":
- if child.name == "return":
- return_type = child.nsProp( "type", None )
- elif child.name == "param":
- param = self.context.factory.create_item( "parameter", child, self.context)
- parameters.append( param )
-
- child = child.next
-
-
- if self.initialized:
- if self.return_type != return_type:
- raise RuntimeError( "Return type changed in %s. Was %s, now %s." % (name, self.return_type, return_type))
-
- if len(parameters) != len(self.parameters):
- raise RuntimeError( "Parameter count mismatch in %s. Was %d, now %d." % (name, len(self.parameters), len(parameters)))
-
- for j in range(0, len(parameters)):
- p1 = parameters[j]
- p2 = self.parameters[j]
- if not p1.compatible( p2 ):
- raise RuntimeError( 'Parameter type mismatch in %s. "%s" was "%s", now "%s".' % (name, p2.name, p2.type_expr.original_string, p1.type_expr.original_string))
-
-
- if true_name == name or not self.initialized:
- self.return_type = return_type
- self.parameters = parameters
-
- for param in self.parameters:
- if param.is_image():
- self.images.append( param )
-
- if element.children:
- self.initialized = 1
- self.parameter_strings[name] = create_parameter_string(parameters, 1)
- else:
- self.parameter_strings[name] = None
-
- return
-
-
- def get_images(self):
- """Return potentially empty list of input images."""
- return self.images
-
-
- def parameterIterator(self):
- return self.parameters.__iter__();
-
-
- def get_parameter_string(self, entrypoint = None):
- if entrypoint:
- s = self.parameter_strings[ entrypoint ]
- if s:
- return s
-
- return create_parameter_string( self.parameters, 1 )
-
- def get_called_parameter_string(self):
- p_string = ""
- comma = ""
-
- for p in self.parameterIterator():
- p_string = p_string + comma + p.name
- comma = ", "
-
- return p_string
-
-
- def is_abi(self):
- return (self.offset >= 0 and not self.assign_offset)
-
- def is_static_entry_point(self, name):
- return name in self.static_entry_points
-
- def dispatch_name(self):
- if self.name in self.static_entry_points:
- return self.name
- else:
- return "_dispatch_stub_%u" % (self.offset)
-
- def static_name(self, name):
- if name in self.static_entry_points:
- return name
- else:
- return "_dispatch_stub_%u" % (self.offset)
-
-
-class gl_item_factory:
- """Factory to create objects derived from gl_item."""
-
- def create_item(self, item_name, element, context):
- if item_name == "function":
- return gl_function(element, context)
- if item_name == "type":
- return gl_type(element, context)
- elif item_name == "enum":
- return gl_enum(element, context)
- elif item_name == "parameter":
- return gl_parameter(element, context)
- elif item_name == "api":
- return gl_api(self)
- else:
- return None
-
-
-class gl_api:
- def __init__(self, factory):
- self.functions_by_name = {}
- self.enums_by_name = {}
- self.types_by_name = {}
-
- self.category_dict = {}
- self.categories = [{}, {}, {}, {}]
-
- self.factory = factory
-
- self.next_offset = 0
-
- typeexpr.create_initial_types()
- return
-
-
- def process_element(self, doc):
- element = doc.children
- while element.type != "element" or element.name != "OpenGLAPI":
- element = element.next
-
- if element:
- self.process_OpenGLAPI(element)
- return
-
-
- def process_OpenGLAPI(self, element):
- child = element.children
- while child:
- if child.type == "element":
- if child.name == "category":
- self.process_category( child )
- elif child.name == "OpenGLAPI":
- self.process_OpenGLAPI( child )
-
- child = child.next
-
- return
-
-
- def process_category(self, cat):
- cat_name = cat.nsProp( "name", None )
- cat_number = cat.nsProp( "number", None )
-
- [cat_type, key] = classify_category(cat_name, cat_number)
- self.categories[cat_type][key] = [cat_name, cat_number]
-
- child = cat.children
- while child:
- if child.type == "element":
- if child.name == "function":
- func_name = real_function_name( child )
-
- temp_name = child.nsProp( "name", None )
- self.category_dict[ temp_name ] = [cat_name, cat_number]
-
- if self.functions_by_name.has_key( func_name ):
- func = self.functions_by_name[ func_name ]
- func.process_element( child )
- else:
- func = self.factory.create_item( "function", child, self )
- self.functions_by_name[ func_name ] = func
-
- if func.offset >= self.next_offset:
- self.next_offset = func.offset + 1
-
-
- elif child.name == "enum":
- enum = self.factory.create_item( "enum", child, self )
- self.enums_by_name[ enum.name ] = enum
- elif child.name == "type":
- t = self.factory.create_item( "type", child, self )
- self.types_by_name[ "GL" + t.name ] = t
-
-
- child = child.next
-
- return
-
-
- def functionIterateByCategory(self, cat = None):
- """Iterate over functions by category.
-
- If cat is None, all known functions are iterated in category
- order. See classify_category for details of the ordering.
- Within a category, functions are sorted by name. If cat is
- not None, then only functions in that category are iterated.
- """
- lists = [{}, {}, {}, {}]
-
- for func in self.functionIterateAll():
- [cat_name, cat_number] = self.category_dict[func.name]
-
- if (cat == None) or (cat == cat_name):
- [func_cat_type, key] = classify_category(cat_name, cat_number)
-
- if not lists[func_cat_type].has_key(key):
- lists[func_cat_type][key] = {}
-
- lists[func_cat_type][key][func.name] = func
-
-
- functions = []
- for func_cat_type in range(0,4):
- keys = lists[func_cat_type].keys()
- keys.sort()
-
- for key in keys:
- names = lists[func_cat_type][key].keys()
- names.sort()
-
- for name in names:
- functions.append(lists[func_cat_type][key][name])
-
- return functions.__iter__()
-
-
- def functionIterateByOffset(self):
- max_offset = -1
- for func in self.functions_by_name.itervalues():
- if func.offset > max_offset:
- max_offset = func.offset
-
-
- temp = [None for i in range(0, max_offset + 1)]
- for func in self.functions_by_name.itervalues():
- if func.offset != -1:
- temp[ func.offset ] = func
-
-
- list = []
- for i in range(0, max_offset + 1):
- if temp[i]:
- list.append(temp[i])
-
- return list.__iter__();
-
-
- def functionIterateAll(self):
- return self.functions_by_name.itervalues()
-
-
- def enumIterateByName(self):
- keys = self.enums_by_name.keys()
- keys.sort()
-
- list = []
- for enum in keys:
- list.append( self.enums_by_name[ enum ] )
-
- return list.__iter__()
-
-
- def categoryIterate(self):
- """Iterate over categories.
-
- Iterate over all known categories in the order specified by
- classify_category. Each iterated value is a tuple of the
- name and number (which may be None) of the category.
- """
-
- list = []
- for cat_type in range(0,4):
- keys = self.categories[cat_type].keys()
- keys.sort()
-
- for key in keys:
- list.append(self.categories[cat_type][key])
-
- return list.__iter__()
-
-
- def get_category_for_name( self, name ):
- if self.category_dict.has_key(name):
- return self.category_dict[name]
- else:
- return ["<unknown category>", None]
-
-
- def typeIterate(self):
- return self.types_by_name.itervalues()
-
-
- def find_type( self, type_name ):
- if type_name in self.types_by_name:
- return self.types_by_name[ type_name ].type_expr
- else:
- print "Unable to find base type matching \"%s\"." % (type_name)
- return None
+#!/usr/bin/env python
+
+# (C) Copyright IBM Corporation 2004, 2005
+# All Rights Reserved.
+#
+# Permission is hereby granted, free of charge, to any person obtaining a
+# copy of this software and associated documentation files (the "Software"),
+# to deal in the Software without restriction, including without limitation
+# on the rights to use, copy, modify, merge, publish, distribute, sub
+# license, and/or sell copies of the Software, and to permit persons to whom
+# the Software is furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice (including the next
+# paragraph) shall be included in all copies or substantial portions of the
+# Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
+# IBM AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+# IN THE SOFTWARE.
+#
+# Authors:
+# Ian Romanick <idr@us.ibm.com>
+
+import libxml2
+import re, sys, string
+import typeexpr
+
+
+def parse_GL_API( file_name, factory = None ):
+ doc = libxml2.readFile( file_name, None, libxml2.XML_PARSE_XINCLUDE + libxml2.XML_PARSE_NOBLANKS + libxml2.XML_PARSE_DTDVALID + libxml2.XML_PARSE_DTDATTR + libxml2.XML_PARSE_DTDLOAD + libxml2.XML_PARSE_NOENT )
+ ret = doc.xincludeProcess()
+
+ if not factory:
+ factory = gl_item_factory()
+
+ api = factory.create_item( "api", None, None )
+ api.process_element( doc )
+
+ # After the XML has been processed, we need to go back and assign
+ # dispatch offsets to the functions that request that their offsets
+ # be assigned by the scripts. Typically this means all functions
+ # that are not part of the ABI.
+
+ for func in api.functionIterateByCategory():
+ if func.assign_offset:
+ func.offset = api.next_offset;
+ api.next_offset += 1
+
+ doc.freeDoc()
+
+ return api
+
+
+def is_attr_true( element, name ):
+ """Read a name value from an element's attributes.
+
+ The value read from the attribute list must be either 'true' or
+ 'false'. If the value is 'false', zero will be returned. If the
+ value is 'true', non-zero will be returned. An exception will be
+ raised for any other value."""
+
+ value = element.nsProp( name, None )
+ if value == "true":
+ return 1
+ elif value == "false":
+ return 0
+ else:
+ raise RuntimeError('Invalid value "%s" for boolean "%s".' % (value, name))
+
+
+class gl_print_base:
+ """Base class of all API pretty-printers.
+
+ In the model-view-controller pattern, this is the view. Any derived
+ class will want to over-ride the printBody, printRealHader, and
+ printRealFooter methods. Some derived classes may want to over-ride
+ printHeader and printFooter, or even Print (though this is unlikely).
+ """
+
+ def __init__(self):
+ # Name of the script that is generating the output file.
+ # Every derived class should set this to the name of its
+ # source file.
+
+ self.name = "a"
+
+
+ # License on the *generated* source file. This may differ
+ # from the license on the script that is generating the file.
+ # Every derived class should set this to some reasonable
+ # value.
+ #
+ # See license.py for an example of a reasonable value.
+
+ self.license = "The license for this file is unspecified."
+
+
+ # The header_tag is the name of the C preprocessor define
+ # used to prevent multiple inclusion. Typically only
+ # generated C header files need this to be set. Setting it
+ # causes code to be generated automatically in printHeader
+ # and printFooter.
+
+ self.header_tag = None
+
+
+ # List of file-private defines that must be undefined at the
+ # end of the file. This can be used in header files to define
+ # names for use in the file, then undefine them at the end of
+ # the header file.
+
+ self.undef_list = []
+ return
+
+
+ def Print(self, api):
+ self.printHeader()
+ self.printBody(api)
+ self.printFooter()
+ return
+
+
+ def printHeader(self):
+ """Print the header associated with all files and call the printRealHeader method."""
+
+ print '/* DO NOT EDIT - This file generated automatically by %s script */' \
+ % (self.name)
+ print ''
+ print '/*'
+ print ' * ' + self.license.replace('\n', '\n * ')
+ print ' */'
+ print ''
+ if self.header_tag:
+ print '#if !defined( %s )' % (self.header_tag)
+ print '# define %s' % (self.header_tag)
+ print ''
+ self.printRealHeader();
+ return
+
+
+ def printFooter(self):
+ """Print the header associated with all files and call the printRealFooter method."""
+
+ self.printRealFooter()
+
+ if self.undef_list:
+ print ''
+ for u in self.undef_list:
+ print "# undef %s" % (u)
+
+ if self.header_tag:
+ print ''
+ print '#endif /* !defined( %s ) */' % (self.header_tag)
+
+
+ def printRealHeader(self):
+ """Print the "real" header for the created file.
+
+ In the base class, this function is empty. All derived
+ classes should over-ride this function."""
+ return
+
+
+ def printRealFooter(self):
+ """Print the "real" footer for the created file.
+
+ In the base class, this function is empty. All derived
+ classes should over-ride this function."""
+ return
+
+
+ def printPure(self):
+ """Conditionally define `PURE' function attribute.
+
+ Conditionally defines a preprocessor macro `PURE' that wraps
+ GCC's `pure' function attribute. The conditional code can be
+ easilly adapted to other compilers that support a similar
+ feature.
+
+ The name is also added to the file's undef_list.
+ """
+ self.undef_list.append("PURE")
+ print """# if defined(__GNUC__) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590))
+# define PURE __attribute__((pure))
+# else
+# define PURE
+# endif"""
+ return
+
+
+ def printFastcall(self):
+ """Conditionally define `FASTCALL' function attribute.
+
+ Conditionally defines a preprocessor macro `FASTCALL' that
+ wraps GCC's `fastcall' function attribute. The conditional
+ code can be easilly adapted to other compilers that support a
+ similar feature.
+
+ The name is also added to the file's undef_list.
+ """
+
+ self.undef_list.append("FASTCALL")
+ print """# if defined(__i386__) && defined(__GNUC__) && !defined(__CYGWIN__) && !defined(__MINGW32__)
+# define FASTCALL __attribute__((fastcall))
+# else
+# define FASTCALL
+# endif"""
+ return
+
+
+ def printVisibility(self, S, s):
+ """Conditionally define visibility function attribute.
+
+ Conditionally defines a preprocessor macro name S that wraps
+ GCC's visibility function attribute. The visibility used is
+ the parameter s. The conditional code can be easilly adapted
+ to other compilers that support a similar feature.
+
+ The name is also added to the file's undef_list.
+ """
+
+ self.undef_list.append(S)
+ print """# if (defined(__GNUC__) && !defined(__CYGWIN__) && !defined(__MINGW32__)) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590) && defined(__ELF__))
+# define %s __attribute__((visibility("%s")))
+# else
+# define %s
+# endif""" % (S, s, S)
+ return
+
+
+ def printNoinline(self):
+ """Conditionally define `NOINLINE' function attribute.
+
+ Conditionally defines a preprocessor macro `NOINLINE' that
+ wraps GCC's `noinline' function attribute. The conditional
+ code can be easilly adapted to other compilers that support a
+ similar feature.
+
+ The name is also added to the file's undef_list.
+ """
+
+ self.undef_list.append("NOINLINE")
+ print """# if defined(__GNUC__) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590))
+# define NOINLINE __attribute__((noinline))
+# else
+# define NOINLINE
+# endif"""
+ return
+
+
+def real_function_name(element):
+ name = element.nsProp( "name", None )
+ alias = element.nsProp( "alias", None )
+
+ if alias:
+ return alias
+ else:
+ return name
+
+
+def real_category_name(c):
+ if re.compile("[1-9][0-9]*[.][0-9]+").match(c):
+ return "GL_VERSION_" + c.replace(".", "_")
+ else:
+ return c
+
+
+def classify_category(name, number):
+ """Based on the category name and number, select a numerical class for it.
+
+ Categories are divided into four classes numbered 0 through 3. The
+ classes are:
+
+ 0. Core GL versions, sorted by version number.
+ 1. ARB extensions, sorted by extension number.
+ 2. Non-ARB extensions, sorted by extension number.
+ 3. Un-numbered extensions, sorted by extension name.
+ """
+
+ try:
+ core_version = float(name)
+ except Exception,e:
+ core_version = 0.0
+
+ if core_version > 0.0:
+ cat_type = 0
+ key = name
+ elif name.startswith("GL_ARB_") or name.startswith("GLX_ARB_") or name.startswith("WGL_ARB_"):
+ cat_type = 1
+ key = int(number)
+ else:
+ if number != None:
+ cat_type = 2
+ key = int(number)
+ else:
+ cat_type = 3
+ key = name
+
+
+ return [cat_type, key]
+
+
+def create_parameter_string(parameters, include_names):
+ """Create a parameter string from a list of gl_parameters."""
+
+ list = []
+ for p in parameters:
+ if p.is_padding:
+ continue
+
+ if include_names:
+ list.append( p.string() )
+ else:
+ list.append( p.type_string() )
+
+ if len(list) == 0: list = ["void"]
+
+ return string.join(list, ", ")
+
+
+class gl_item:
+ def __init__(self, element, context):
+ self.context = context
+ self.name = element.nsProp( "name", None )
+ self.category = real_category_name( element.parent.nsProp( "name", None ) )
+ return
+
+
+class gl_type( gl_item ):
+ def __init__(self, element, context):
+ gl_item.__init__(self, element, context)
+ self.size = int( element.nsProp( "size", None ), 0 )
+
+ te = typeexpr.type_expression( None )
+ tn = typeexpr.type_node()
+ tn.size = int( element.nsProp( "size", None ), 0 )
+ tn.integer = not is_attr_true( element, "float" )
+ tn.unsigned = is_attr_true( element, "unsigned" )
+ tn.name = "GL" + self.name
+ te.set_base_type_node( tn )
+
+ self.type_expr = te
+ return
+
+
+ def get_type_expression(self):
+ return self.type_expr
+
+
+class gl_enum( gl_item ):
+ def __init__(self, element, context):
+ gl_item.__init__(self, element, context)
+ self.value = int( element.nsProp( "value", None ), 0 )
+
+ temp = element.nsProp( "count", None )
+ if not temp or temp == "?":
+ self.default_count = -1
+ else:
+ try:
+ c = int(temp)
+ except Exception,e:
+ raise RuntimeError('Invalid count value "%s" for enum "%s" in function "%s" when an integer was expected.' % (temp, self.name, n))
+
+ self.default_count = c
+
+ return
+
+
+ def priority(self):
+ """Calculate a 'priority' for this enum name.
+
+ When an enum is looked up by number, there may be many
+ possible names, but only one is the 'prefered' name. The
+ priority is used to select which name is the 'best'.
+
+ Highest precedence is given to core GL name. ARB extension
+ names have the next highest, followed by EXT extension names.
+ Vendor extension names are the lowest.
+ """
+
+ if self.name.endswith( "_BIT" ):
+ bias = 1
+ else:
+ bias = 0
+
+ if self.category.startswith( "GL_VERSION_" ):
+ priority = 0
+ elif self.category.startswith( "GL_ARB_" ):
+ priority = 2
+ elif self.category.startswith( "GL_EXT_" ):
+ priority = 4
+ else:
+ priority = 6
+
+ return priority + bias
+
+
+
+class gl_parameter:
+ def __init__(self, element, context):
+ self.name = element.nsProp( "name", None )
+
+ ts = element.nsProp( "type", None )
+ self.type_expr = typeexpr.type_expression( ts, context )
+
+ temp = element.nsProp( "variable_param", None )
+ if temp:
+ self.count_parameter_list = temp.split( ' ' )
+ else:
+ self.count_parameter_list = []
+
+ # The count tag can be either a numeric string or the name of
+ # a variable. If it is the name of a variable, the int(c)
+ # statement will throw an exception, and the except block will
+ # take over.
+
+ c = element.nsProp( "count", None )
+ try:
+ count = int(c)
+ self.count = count
+ self.counter = None
+ except Exception,e:
+ count = 1
+ self.count = 0
+ self.counter = c
+
+ self.count_scale = int(element.nsProp( "count_scale", None ))
+
+ elements = (count * self.count_scale)
+ if elements == 1:
+ elements = 0
+
+ #if ts == "GLdouble":
+ # print '/* stack size -> %s = %u (before)*/' % (self.name, self.type_expr.get_stack_size())
+ # print '/* # elements = %u */' % (elements)
+ self.type_expr.set_elements( elements )
+ #if ts == "GLdouble":
+ # print '/* stack size -> %s = %u (after) */' % (self.name, self.type_expr.get_stack_size())
+
+ self.is_client_only = is_attr_true( element, 'client_only' )
+ self.is_counter = is_attr_true( element, 'counter' )
+ self.is_output = is_attr_true( element, 'output' )
+
+
+ # Pixel data has special parameters.
+
+ self.width = element.nsProp('img_width', None)
+ self.height = element.nsProp('img_height', None)
+ self.depth = element.nsProp('img_depth', None)
+ self.extent = element.nsProp('img_extent', None)
+
+ self.img_xoff = element.nsProp('img_xoff', None)
+ self.img_yoff = element.nsProp('img_yoff', None)
+ self.img_zoff = element.nsProp('img_zoff', None)
+ self.img_woff = element.nsProp('img_woff', None)
+
+ self.img_format = element.nsProp('img_format', None)
+ self.img_type = element.nsProp('img_type', None)
+ self.img_target = element.nsProp('img_target', None)
+
+ self.img_pad_dimensions = is_attr_true( element, 'img_pad_dimensions' )
+ self.img_null_flag = is_attr_true( element, 'img_null_flag' )
+ self.img_send_null = is_attr_true( element, 'img_send_null' )
+
+ self.is_padding = is_attr_true( element, 'padding' )
+ return
+
+
+ def compatible(self, other):
+ return 1
+
+
+ def is_array(self):
+ return self.is_pointer()
+
+
+ def is_pointer(self):
+ return self.type_expr.is_pointer()
+
+
+ def is_image(self):
+ if self.width:
+ return 1
+ else:
+ return 0
+
+
+ def is_variable_length(self):
+ return len(self.count_parameter_list) or self.counter
+
+
+ def is_64_bit(self):
+ count = self.type_expr.get_element_count()
+ if count:
+ if (self.size() / count) == 8:
+ return 1
+ else:
+ if self.size() == 8:
+ return 1
+
+ return 0
+
+
+ def string(self):
+ return self.type_expr.original_string + " " + self.name
+
+
+ def type_string(self):
+ return self.type_expr.original_string
+
+
+ def get_base_type_string(self):
+ return self.type_expr.get_base_name()
+
+
+ def get_dimensions(self):
+ if not self.width:
+ return [ 0, "0", "0", "0", "0" ]
+
+ dim = 1
+ w = self.width
+ h = "1"
+ d = "1"
+ e = "1"
+
+ if self.height:
+ dim = 2
+ h = self.height
+
+ if self.depth:
+ dim = 3
+ d = self.depth
+
+ if self.extent:
+ dim = 4
+ e = self.extent
+
+ return [ dim, w, h, d, e ]
+
+
+ def get_stack_size(self):
+ return self.type_expr.get_stack_size()
+
+
+ def size(self):
+ if self.is_image():
+ return 0
+ else:
+ return self.type_expr.get_element_size()
+
+
+ def get_element_count(self):
+ c = self.type_expr.get_element_count()
+ if c == 0:
+ return 1
+
+ return c
+
+
+ def size_string(self, use_parens = 1):
+ s = self.size()
+ if self.counter or self.count_parameter_list:
+ list = [ "compsize" ]
+
+ if self.counter and self.count_parameter_list:
+ list.append( self.counter )
+ elif self.counter:
+ list = [ self.counter ]
+
+ if s > 1:
+ list.append( str(s) )
+
+ if len(list) > 1 and use_parens :
+ return "(%s)" % (string.join(list, " * "))
+ else:
+ return string.join(list, " * ")
+
+ elif self.is_image():
+ return "compsize"
+ else:
+ return str(s)
+
+
+ def format_string(self):
+ if self.type_expr.original_string == "GLenum":
+ return "0x%x"
+ else:
+ return self.type_expr.format_string()
+
+
+
+class gl_function( gl_item ):
+ def __init__(self, element, context):
+ self.context = context
+ self.name = None
+
+ self.entry_points = []
+ self.return_type = "void"
+ self.parameters = []
+ self.offset = -1
+ self.initialized = 0
+ self.images = []
+
+ self.assign_offset = 0
+
+ self.static_entry_points = []
+
+ # Track the parameter string (for the function prototype)
+ # for each entry-point. This is done because some functions
+ # change their prototype slightly when promoted from extension
+ # to ARB extension to core. glTexImage3DEXT and glTexImage3D
+ # are good examples of this. Scripts that need to generate
+ # code for these differing aliases need to real prototype
+ # for each entry-point. Otherwise, they may generate code
+ # that won't compile.
+
+ self.parameter_strings = {}
+
+ self.process_element( element )
+
+ return
+
+
+ def process_element(self, element):
+ name = element.nsProp( "name", None )
+ alias = element.nsProp( "alias", None )
+
+ if is_attr_true(element, "static_dispatch"):
+ self.static_entry_points.append(name)
+
+ self.entry_points.append( name )
+ if alias:
+ true_name = alias
+ else:
+ true_name = name
+
+ # Only try to set the offset when a non-alias
+ # entry-point is being processes.
+
+ offset = element.nsProp( "offset", None )
+ if offset:
+ try:
+ o = int( offset )
+ self.offset = o
+ except Exception, e:
+ self.offset = -1
+ if offset == "assign":
+ self.assign_offset = 1
+
+
+ if not self.name:
+ self.name = true_name
+ elif self.name != true_name:
+ raise RuntimeError("Function true name redefined. Was %s, now %s." % (self.name, true_name))
+
+
+ # There are two possible cases. The first time an entry-point
+ # with data is seen, self.initialized will be 0. On that
+ # pass, we just fill in the data. The next time an
+ # entry-point with data is seen, self.initialized will be 1.
+ # On that pass we have to make that the new values match the
+ # valuse from the previous entry-point.
+
+ parameters = []
+ return_type = "void"
+ child = element.children
+ while child:
+ if child.type == "element":
+ if child.name == "return":
+ return_type = child.nsProp( "type", None )
+ elif child.name == "param":
+ param = self.context.factory.create_item( "parameter", child, self.context)
+ parameters.append( param )
+
+ child = child.next
+
+
+ if self.initialized:
+ if self.return_type != return_type:
+ raise RuntimeError( "Return type changed in %s. Was %s, now %s." % (name, self.return_type, return_type))
+
+ if len(parameters) != len(self.parameters):
+ raise RuntimeError( "Parameter count mismatch in %s. Was %d, now %d." % (name, len(self.parameters), len(parameters)))
+
+ for j in range(0, len(parameters)):
+ p1 = parameters[j]
+ p2 = self.parameters[j]
+ if not p1.compatible( p2 ):
+ raise RuntimeError( 'Parameter type mismatch in %s. "%s" was "%s", now "%s".' % (name, p2.name, p2.type_expr.original_string, p1.type_expr.original_string))
+
+
+ if true_name == name or not self.initialized:
+ self.return_type = return_type
+ self.parameters = parameters
+
+ for param in self.parameters:
+ if param.is_image():
+ self.images.append( param )
+
+ if element.children:
+ self.initialized = 1
+ self.parameter_strings[name] = create_parameter_string(parameters, 1)
+ else:
+ self.parameter_strings[name] = None
+
+ return
+
+
+ def get_images(self):
+ """Return potentially empty list of input images."""
+ return self.images
+
+
+ def parameterIterator(self):
+ return self.parameters.__iter__();
+
+
+ def get_parameter_string(self, entrypoint = None):
+ if entrypoint:
+ s = self.parameter_strings[ entrypoint ]
+ if s:
+ return s
+
+ return create_parameter_string( self.parameters, 1 )
+
+ def get_called_parameter_string(self):
+ p_string = ""
+ comma = ""
+
+ for p in self.parameterIterator():
+ p_string = p_string + comma + p.name
+ comma = ", "
+
+ return p_string
+
+
+ def is_abi(self):
+ return (self.offset >= 0 and not self.assign_offset)
+
+ def is_static_entry_point(self, name):
+ return name in self.static_entry_points
+
+ def dispatch_name(self):
+ if self.name in self.static_entry_points:
+ return self.name
+ else:
+ return "_dispatch_stub_%u" % (self.offset)
+
+ def static_name(self, name):
+ if name in self.static_entry_points:
+ return name
+ else:
+ return "_dispatch_stub_%u" % (self.offset)
+
+
+class gl_item_factory:
+ """Factory to create objects derived from gl_item."""
+
+ def create_item(self, item_name, element, context):
+ if item_name == "function":
+ return gl_function(element, context)
+ if item_name == "type":
+ return gl_type(element, context)
+ elif item_name == "enum":
+ return gl_enum(element, context)
+ elif item_name == "parameter":
+ return gl_parameter(element, context)
+ elif item_name == "api":
+ return gl_api(self)
+ else:
+ return None
+
+
+class gl_api:
+ def __init__(self, factory):
+ self.functions_by_name = {}
+ self.enums_by_name = {}
+ self.types_by_name = {}
+
+ self.category_dict = {}
+ self.categories = [{}, {}, {}, {}]
+
+ self.factory = factory
+
+ self.next_offset = 0
+
+ typeexpr.create_initial_types()
+ return
+
+
+ def process_element(self, doc):
+ element = doc.children
+ while element.type != "element" or element.name != "OpenGLAPI":
+ element = element.next
+
+ if element:
+ self.process_OpenGLAPI(element)
+ return
+
+
+ def process_OpenGLAPI(self, element):
+ child = element.children
+ while child:
+ if child.type == "element":
+ if child.name == "category":
+ self.process_category( child )
+ elif child.name == "OpenGLAPI":
+ self.process_OpenGLAPI( child )
+
+ child = child.next
+
+ return
+
+
+ def process_category(self, cat):
+ cat_name = cat.nsProp( "name", None )
+ cat_number = cat.nsProp( "number", None )
+
+ [cat_type, key] = classify_category(cat_name, cat_number)
+ self.categories[cat_type][key] = [cat_name, cat_number]
+
+ child = cat.children
+ while child:
+ if child.type == "element":
+ if child.name == "function":
+ func_name = real_function_name( child )
+
+ temp_name = child.nsProp( "name", None )
+ self.category_dict[ temp_name ] = [cat_name, cat_number]
+
+ if self.functions_by_name.has_key( func_name ):
+ func = self.functions_by_name[ func_name ]
+ func.process_element( child )
+ else:
+ func = self.factory.create_item( "function", child, self )
+ self.functions_by_name[ func_name ] = func
+
+ if func.offset >= self.next_offset:
+ self.next_offset = func.offset + 1
+
+
+ elif child.name == "enum":
+ enum = self.factory.create_item( "enum", child, self )
+ self.enums_by_name[ enum.name ] = enum
+ elif child.name == "type":
+ t = self.factory.create_item( "type", child, self )
+ self.types_by_name[ "GL" + t.name ] = t
+
+
+ child = child.next
+
+ return
+
+
+ def functionIterateByCategory(self, cat = None):
+ """Iterate over functions by category.
+
+ If cat is None, all known functions are iterated in category
+ order. See classify_category for details of the ordering.
+ Within a category, functions are sorted by name. If cat is
+ not None, then only functions in that category are iterated.
+ """
+ lists = [{}, {}, {}, {}]
+
+ for func in self.functionIterateAll():
+ [cat_name, cat_number] = self.category_dict[func.name]
+
+ if (cat == None) or (cat == cat_name):
+ [func_cat_type, key] = classify_category(cat_name, cat_number)
+
+ if not lists[func_cat_type].has_key(key):
+ lists[func_cat_type][key] = {}
+
+ lists[func_cat_type][key][func.name] = func
+
+
+ functions = []
+ for func_cat_type in range(0,4):
+ keys = lists[func_cat_type].keys()
+ keys.sort()
+
+ for key in keys:
+ names = lists[func_cat_type][key].keys()
+ names.sort()
+
+ for name in names:
+ functions.append(lists[func_cat_type][key][name])
+
+ return functions.__iter__()
+
+
+ def functionIterateByOffset(self):
+ max_offset = -1
+ for func in self.functions_by_name.itervalues():
+ if func.offset > max_offset:
+ max_offset = func.offset
+
+
+ temp = [None for i in range(0, max_offset + 1)]
+ for func in self.functions_by_name.itervalues():
+ if func.offset != -1:
+ temp[ func.offset ] = func
+
+
+ list = []
+ for i in range(0, max_offset + 1):
+ if temp[i]:
+ list.append(temp[i])
+
+ return list.__iter__();
+
+
+ def functionIterateAll(self):
+ return self.functions_by_name.itervalues()
+
+
+ def enumIterateByName(self):
+ keys = self.enums_by_name.keys()
+ keys.sort()
+
+ list = []
+ for enum in keys:
+ list.append( self.enums_by_name[ enum ] )
+
+ return list.__iter__()
+
+
+ def categoryIterate(self):
+ """Iterate over categories.
+
+ Iterate over all known categories in the order specified by
+ classify_category. Each iterated value is a tuple of the
+ name and number (which may be None) of the category.
+ """
+
+ list = []
+ for cat_type in range(0,4):
+ keys = self.categories[cat_type].keys()
+ keys.sort()
+
+ for key in keys:
+ list.append(self.categories[cat_type][key])
+
+ return list.__iter__()
+
+
+ def get_category_for_name( self, name ):
+ if self.category_dict.has_key(name):
+ return self.category_dict[name]
+ else:
+ return ["<unknown category>", None]
+
+
+ def typeIterate(self):
+ return self.types_by_name.itervalues()
+
+
+ def find_type( self, type_name ):
+ if type_name in self.types_by_name:
+ return self.types_by_name[ type_name ].type_expr
+ else:
+ print "Unable to find base type matching \"%s\"." % (type_name)
+ return None
diff --git a/mesalib/src/mapi/glapi/gen/gl_table.py b/mesalib/src/mapi/glapi/gen/gl_table.py
index 3f1707218..a1a9186a4 100644
--- a/mesalib/src/mapi/glapi/gen/gl_table.py
+++ b/mesalib/src/mapi/glapi/gen/gl_table.py
@@ -98,6 +98,9 @@ class PrintRemapTable(gl_XML.gl_print_base):
return
def printBody(self, api):
+ print '#ifdef _MSC_VER'
+ print '#define INLINE __inline'
+ print '#endif'
print '#define CALL_by_offset(disp, cast, offset, parameters) \\'
print ' (*(cast (GET_by_offset(disp, offset)))) parameters'
print '#define GET_by_offset(disp, offset) \\'
diff --git a/mesalib/src/mapi/glapi/glapi.h b/mesalib/src/mapi/glapi/glapi.h
index 1d4ac4674..746692692 100644
--- a/mesalib/src/mapi/glapi/glapi.h
+++ b/mesalib/src/mapi/glapi/glapi.h
@@ -44,7 +44,6 @@
#ifndef _GLAPI_H
#define _GLAPI_H
-
#ifdef _GLAPI_NO_EXPORTS
# define _GLAPI_EXPORT
#else /* _GLAPI_NO_EXPORTS */
@@ -61,117 +60,118 @@
# endif
#endif /* _GLAPI_NO_EXPORTS */
+#include "GL/gl.h"
+#include "GL/glext.h"
+#include "glthread.h"
+
+
+struct _glapi_table;
+
+typedef void (*_glapi_proc)(void); /* generic function pointer */
+
+typedef void (*_glapi_warning_func)(void *ctx, const char *str, ...);
-/* Is this needed? It is incomplete anyway. */
-#ifdef USE_MGL_NAMESPACE
+
+#if defined(USE_MGL_NAMESPACE)
#define _glapi_set_dispatch _mglapi_set_dispatch
#define _glapi_get_dispatch _mglapi_get_dispatch
#define _glapi_set_context _mglapi_set_context
#define _glapi_get_context _mglapi_get_context
-#define _glapi_Dispatch _mglapi_Dispatch
#define _glapi_Context _mglapi_Context
+#define _glapi_Dispatch _mglapi_Dispatch
#endif
-#include "glapi/glthread.h"
-typedef void (*_glapi_proc)(void);
-struct _glapi_table;
+/*
+ * Number of extension functions which we can dynamically add at runtime.
+ */
+#define MAX_EXTENSION_FUNCS 300
+/**
+ ** Define the GET_CURRENT_CONTEXT() macro.
+ ** \param C local variable which will hold the current context.
+ **/
#if defined (GLX_USE_TLS)
-_GLAPI_EXPORT extern __thread struct _glapi_table * _glapi_tls_Dispatch
- __attribute__((tls_model("initial-exec")));
-
-_GLAPI_EXPORT extern __thread void * _glapi_tls_Context
- __attribute__((tls_model("initial-exec")));
+_GLAPI_EXPORT extern __thread struct _glapi_table * _glapi_tls_Dispatch;
-_GLAPI_EXPORT extern const struct _glapi_table *_glapi_Dispatch;
_GLAPI_EXPORT extern const void *_glapi_Context;
+_GLAPI_EXPORT extern const struct _glapi_table *_glapi_Dispatch;
+
+_GLAPI_EXPORT extern __thread void * _glapi_tls_Context;
# define GET_DISPATCH() _glapi_tls_Dispatch
# define GET_CURRENT_CONTEXT(C) struct gl_context *C = (struct gl_context *) _glapi_tls_Context
#else
-_GLAPI_EXPORT extern struct _glapi_table *_glapi_Dispatch;
-_GLAPI_EXPORT extern void *_glapi_Context;
+#ifdef INSERVER
+#define SERVEXTERN _declspec(dllimport)
+#else
+#define SERVEXTERN _declspec(dllexport)
+#endif
+
+SERVEXTERN void *_glapi_Context;
+SERVEXTERN struct _glapi_table *_glapi_Dispatch;
# ifdef THREADS
# define GET_DISPATCH() \
(likely(_glapi_Dispatch) ? _glapi_Dispatch : _glapi_get_dispatch())
+
# define GET_CURRENT_CONTEXT(C) struct gl_context *C = (struct gl_context *) \
(likely(_glapi_Context) ? _glapi_Context : _glapi_get_context())
-
# else
-
# define GET_DISPATCH() _glapi_Dispatch
# define GET_CURRENT_CONTEXT(C) struct gl_context *C = (struct gl_context *) _glapi_Context
-
# endif
#endif /* defined (GLX_USE_TLS) */
-void
-_glapi_destroy_multithread(void);
-
+/**
+ ** GL API public functions
+ **/
-_GLAPI_EXPORT void
+SERVEXTERN void
_glapi_check_multithread(void);
-_GLAPI_EXPORT void
+SERVEXTERN void
_glapi_set_context(void *context);
-_GLAPI_EXPORT void *
+SERVEXTERN void *
_glapi_get_context(void);
-_GLAPI_EXPORT void
+SERVEXTERN void
_glapi_set_dispatch(struct _glapi_table *dispatch);
-_GLAPI_EXPORT struct _glapi_table *
+SERVEXTERN struct _glapi_table *
_glapi_get_dispatch(void);
+SERVEXTERN int
+_glapi_begin_dispatch_override(struct _glapi_table *override);
+
+SERVEXTERN void
+_glapi_end_dispatch_override(int layer);
-_GLAPI_EXPORT unsigned int
+struct _glapi_table *
+_glapi_get_override_dispatch(int layer);
+
+SERVEXTERN GLuint
_glapi_get_dispatch_table_size(void);
-_GLAPI_EXPORT int
+SERVEXTERN int
_glapi_add_dispatch( const char * const * function_names,
const char * parameter_signature );
-_GLAPI_EXPORT int
-_glapi_get_proc_offset(const char *funcName);
-
-
_GLAPI_EXPORT _glapi_proc
_glapi_get_proc_address(const char *funcName);
-
-_GLAPI_EXPORT const char *
-_glapi_get_proc_name(unsigned int offset);
-
-
-_GLAPI_EXPORT unsigned long
-_glthread_GetID(void);
-
-
-/*
- * These stubs are kept so that the old DRI drivers still load.
- */
-_GLAPI_EXPORT void
-_glapi_noop_enable_warnings(unsigned char enable);
-
-
-_GLAPI_EXPORT void
-_glapi_set_warning_func(_glapi_proc func);
-
-
-#endif /* _GLAPI_H */
+#endif
diff --git a/mesalib/src/mapi/glapi/glapi_getproc.c b/mesalib/src/mapi/glapi/glapi_getproc.c
index 21380ea41..d5c72f29b 100644
--- a/mesalib/src/mapi/glapi/glapi_getproc.c
+++ b/mesalib/src/mapi/glapi/glapi_getproc.c
@@ -369,6 +369,7 @@ set_entry_info( struct _glapi_function * entry, const char * signature, unsigned
* the parameter signature of a static function.
*/
+#ifndef INSERVER
int
_glapi_add_dispatch( const char * const * function_names,
const char * parameter_signature )
@@ -478,12 +479,12 @@ _glapi_add_dispatch( const char * const * function_names,
return offset;
}
-
+#endif
/**
* Return offset of entrypoint for named function within dispatch table.
*/
-GLint
+GLint _GLAPI_EXPORT
_glapi_get_proc_offset(const char *funcName)
{
GLint offset;
@@ -504,7 +505,7 @@ _glapi_get_proc_offset(const char *funcName)
* in the name of static functions, try generating a new API entrypoint on
* the fly with assembly language.
*/
-_glapi_proc
+_glapi_proc _GLAPI_EXPORT
_glapi_get_proc_address(const char *funcName)
{
_glapi_proc func;
@@ -545,7 +546,7 @@ _glapi_get_proc_address(const char *funcName)
* Return the name of the function at the given dispatch offset.
* This is only intended for debugging.
*/
-const char *
+const char * _GLAPI_EXPORT
_glapi_get_proc_name(GLuint offset)
{
const char * n;
@@ -571,7 +572,7 @@ _glapi_get_proc_name(GLuint offset)
* Return size of dispatch table struct as number of functions (or
* slots).
*/
-GLuint
+GLuint _GLAPI_EXPORT
_glapi_get_dispatch_table_size(void)
{
/*
diff --git a/mesalib/src/mapi/glapi/glapi_mapi_tmp.h b/mesalib/src/mapi/glapi/glapi_mapi_tmp.h
index 43da6c489..333c0ed9a 100644
--- a/mesalib/src/mapi/glapi/glapi_mapi_tmp.h
+++ b/mesalib/src/mapi/glapi/glapi_mapi_tmp.h
@@ -1,13556 +1,13556 @@
-/* This file is automatically generated by mapi_abi.py. Do not modify. */
-
-#ifndef _GLAPI_TMP_H_
-#define _GLAPI_TMP_H_
-#ifdef USE_MGL_NAMESPACE
-#define GLAPI_PREFIX(func) mgl##func
-#define GLAPI_PREFIX_STR(func) "mgl"#func
-#else
-#define GLAPI_PREFIX(func) gl##func
-#define GLAPI_PREFIX_STR(func) "gl"#func
-#endif /* USE_MGL_NAMESPACE */
-
-typedef int GLfixed;
-typedef int GLclampx;
-#endif /* _GLAPI_TMP_H_ */
-
-#ifdef MAPI_TMP_DEFINES
-#define GL_GLEXT_PROTOTYPES
-#include "GL/gl.h"
-#include "GL/glext.h"
-
-GLAPI void APIENTRY GLAPI_PREFIX(NewList)(GLuint list, GLenum mode);
-GLAPI void APIENTRY GLAPI_PREFIX(EndList)(void);
-GLAPI void APIENTRY GLAPI_PREFIX(CallList)(GLuint list);
-GLAPI void APIENTRY GLAPI_PREFIX(CallLists)(GLsizei n, GLenum type, const GLvoid *lists);
-GLAPI void APIENTRY GLAPI_PREFIX(DeleteLists)(GLuint list, GLsizei range);
-GLAPI GLuint APIENTRY GLAPI_PREFIX(GenLists)(GLsizei range);
-GLAPI void APIENTRY GLAPI_PREFIX(ListBase)(GLuint base);
-GLAPI void APIENTRY GLAPI_PREFIX(Begin)(GLenum mode);
-GLAPI void APIENTRY GLAPI_PREFIX(Bitmap)(GLsizei width, GLsizei height, GLfloat xorig, GLfloat yorig, GLfloat xmove, GLfloat ymove, const GLubyte *bitmap);
-GLAPI void APIENTRY GLAPI_PREFIX(Color3b)(GLbyte red, GLbyte green, GLbyte blue);
-GLAPI void APIENTRY GLAPI_PREFIX(Color3bv)(const GLbyte *v);
-GLAPI void APIENTRY GLAPI_PREFIX(Color3d)(GLdouble red, GLdouble green, GLdouble blue);
-GLAPI void APIENTRY GLAPI_PREFIX(Color3dv)(const GLdouble *v);
-GLAPI void APIENTRY GLAPI_PREFIX(Color3f)(GLfloat red, GLfloat green, GLfloat blue);
-GLAPI void APIENTRY GLAPI_PREFIX(Color3fv)(const GLfloat *v);
-GLAPI void APIENTRY GLAPI_PREFIX(Color3i)(GLint red, GLint green, GLint blue);
-GLAPI void APIENTRY GLAPI_PREFIX(Color3iv)(const GLint *v);
-GLAPI void APIENTRY GLAPI_PREFIX(Color3s)(GLshort red, GLshort green, GLshort blue);
-GLAPI void APIENTRY GLAPI_PREFIX(Color3sv)(const GLshort *v);
-GLAPI void APIENTRY GLAPI_PREFIX(Color3ub)(GLubyte red, GLubyte green, GLubyte blue);
-GLAPI void APIENTRY GLAPI_PREFIX(Color3ubv)(const GLubyte *v);
-GLAPI void APIENTRY GLAPI_PREFIX(Color3ui)(GLuint red, GLuint green, GLuint blue);
-GLAPI void APIENTRY GLAPI_PREFIX(Color3uiv)(const GLuint *v);
-GLAPI void APIENTRY GLAPI_PREFIX(Color3us)(GLushort red, GLushort green, GLushort blue);
-GLAPI void APIENTRY GLAPI_PREFIX(Color3usv)(const GLushort *v);
-GLAPI void APIENTRY GLAPI_PREFIX(Color4b)(GLbyte red, GLbyte green, GLbyte blue, GLbyte alpha);
-GLAPI void APIENTRY GLAPI_PREFIX(Color4bv)(const GLbyte *v);
-GLAPI void APIENTRY GLAPI_PREFIX(Color4d)(GLdouble red, GLdouble green, GLdouble blue, GLdouble alpha);
-GLAPI void APIENTRY GLAPI_PREFIX(Color4dv)(const GLdouble *v);
-GLAPI void APIENTRY GLAPI_PREFIX(Color4f)(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
-GLAPI void APIENTRY GLAPI_PREFIX(Color4fv)(const GLfloat *v);
-GLAPI void APIENTRY GLAPI_PREFIX(Color4i)(GLint red, GLint green, GLint blue, GLint alpha);
-GLAPI void APIENTRY GLAPI_PREFIX(Color4iv)(const GLint *v);
-GLAPI void APIENTRY GLAPI_PREFIX(Color4s)(GLshort red, GLshort green, GLshort blue, GLshort alpha);
-GLAPI void APIENTRY GLAPI_PREFIX(Color4sv)(const GLshort *v);
-GLAPI void APIENTRY GLAPI_PREFIX(Color4ub)(GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha);
-GLAPI void APIENTRY GLAPI_PREFIX(Color4ubv)(const GLubyte *v);
-GLAPI void APIENTRY GLAPI_PREFIX(Color4ui)(GLuint red, GLuint green, GLuint blue, GLuint alpha);
-GLAPI void APIENTRY GLAPI_PREFIX(Color4uiv)(const GLuint *v);
-GLAPI void APIENTRY GLAPI_PREFIX(Color4us)(GLushort red, GLushort green, GLushort blue, GLushort alpha);
-GLAPI void APIENTRY GLAPI_PREFIX(Color4usv)(const GLushort *v);
-GLAPI void APIENTRY GLAPI_PREFIX(EdgeFlag)(GLboolean flag);
-GLAPI void APIENTRY GLAPI_PREFIX(EdgeFlagv)(const GLboolean *flag);
-GLAPI void APIENTRY GLAPI_PREFIX(End)(void);
-GLAPI void APIENTRY GLAPI_PREFIX(Indexd)(GLdouble c);
-GLAPI void APIENTRY GLAPI_PREFIX(Indexdv)(const GLdouble *c);
-GLAPI void APIENTRY GLAPI_PREFIX(Indexf)(GLfloat c);
-GLAPI void APIENTRY GLAPI_PREFIX(Indexfv)(const GLfloat *c);
-GLAPI void APIENTRY GLAPI_PREFIX(Indexi)(GLint c);
-GLAPI void APIENTRY GLAPI_PREFIX(Indexiv)(const GLint *c);
-GLAPI void APIENTRY GLAPI_PREFIX(Indexs)(GLshort c);
-GLAPI void APIENTRY GLAPI_PREFIX(Indexsv)(const GLshort *c);
-GLAPI void APIENTRY GLAPI_PREFIX(Normal3b)(GLbyte nx, GLbyte ny, GLbyte nz);
-GLAPI void APIENTRY GLAPI_PREFIX(Normal3bv)(const GLbyte *v);
-GLAPI void APIENTRY GLAPI_PREFIX(Normal3d)(GLdouble nx, GLdouble ny, GLdouble nz);
-GLAPI void APIENTRY GLAPI_PREFIX(Normal3dv)(const GLdouble *v);
-GLAPI void APIENTRY GLAPI_PREFIX(Normal3f)(GLfloat nx, GLfloat ny, GLfloat nz);
-GLAPI void APIENTRY GLAPI_PREFIX(Normal3fv)(const GLfloat *v);
-GLAPI void APIENTRY GLAPI_PREFIX(Normal3i)(GLint nx, GLint ny, GLint nz);
-GLAPI void APIENTRY GLAPI_PREFIX(Normal3iv)(const GLint *v);
-GLAPI void APIENTRY GLAPI_PREFIX(Normal3s)(GLshort nx, GLshort ny, GLshort nz);
-GLAPI void APIENTRY GLAPI_PREFIX(Normal3sv)(const GLshort *v);
-GLAPI void APIENTRY GLAPI_PREFIX(RasterPos2d)(GLdouble x, GLdouble y);
-GLAPI void APIENTRY GLAPI_PREFIX(RasterPos2dv)(const GLdouble *v);
-GLAPI void APIENTRY GLAPI_PREFIX(RasterPos2f)(GLfloat x, GLfloat y);
-GLAPI void APIENTRY GLAPI_PREFIX(RasterPos2fv)(const GLfloat *v);
-GLAPI void APIENTRY GLAPI_PREFIX(RasterPos2i)(GLint x, GLint y);
-GLAPI void APIENTRY GLAPI_PREFIX(RasterPos2iv)(const GLint *v);
-GLAPI void APIENTRY GLAPI_PREFIX(RasterPos2s)(GLshort x, GLshort y);
-GLAPI void APIENTRY GLAPI_PREFIX(RasterPos2sv)(const GLshort *v);
-GLAPI void APIENTRY GLAPI_PREFIX(RasterPos3d)(GLdouble x, GLdouble y, GLdouble z);
-GLAPI void APIENTRY GLAPI_PREFIX(RasterPos3dv)(const GLdouble *v);
-GLAPI void APIENTRY GLAPI_PREFIX(RasterPos3f)(GLfloat x, GLfloat y, GLfloat z);
-GLAPI void APIENTRY GLAPI_PREFIX(RasterPos3fv)(const GLfloat *v);
-GLAPI void APIENTRY GLAPI_PREFIX(RasterPos3i)(GLint x, GLint y, GLint z);
-GLAPI void APIENTRY GLAPI_PREFIX(RasterPos3iv)(const GLint *v);
-GLAPI void APIENTRY GLAPI_PREFIX(RasterPos3s)(GLshort x, GLshort y, GLshort z);
-GLAPI void APIENTRY GLAPI_PREFIX(RasterPos3sv)(const GLshort *v);
-GLAPI void APIENTRY GLAPI_PREFIX(RasterPos4d)(GLdouble x, GLdouble y, GLdouble z, GLdouble w);
-GLAPI void APIENTRY GLAPI_PREFIX(RasterPos4dv)(const GLdouble *v);
-GLAPI void APIENTRY GLAPI_PREFIX(RasterPos4f)(GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-GLAPI void APIENTRY GLAPI_PREFIX(RasterPos4fv)(const GLfloat *v);
-GLAPI void APIENTRY GLAPI_PREFIX(RasterPos4i)(GLint x, GLint y, GLint z, GLint w);
-GLAPI void APIENTRY GLAPI_PREFIX(RasterPos4iv)(const GLint *v);
-GLAPI void APIENTRY GLAPI_PREFIX(RasterPos4s)(GLshort x, GLshort y, GLshort z, GLshort w);
-GLAPI void APIENTRY GLAPI_PREFIX(RasterPos4sv)(const GLshort *v);
-GLAPI void APIENTRY GLAPI_PREFIX(Rectd)(GLdouble x1, GLdouble y1, GLdouble x2, GLdouble y2);
-GLAPI void APIENTRY GLAPI_PREFIX(Rectdv)(const GLdouble *v1, const GLdouble *v2);
-GLAPI void APIENTRY GLAPI_PREFIX(Rectf)(GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2);
-GLAPI void APIENTRY GLAPI_PREFIX(Rectfv)(const GLfloat *v1, const GLfloat *v2);
-GLAPI void APIENTRY GLAPI_PREFIX(Recti)(GLint x1, GLint y1, GLint x2, GLint y2);
-GLAPI void APIENTRY GLAPI_PREFIX(Rectiv)(const GLint *v1, const GLint *v2);
-GLAPI void APIENTRY GLAPI_PREFIX(Rects)(GLshort x1, GLshort y1, GLshort x2, GLshort y2);
-GLAPI void APIENTRY GLAPI_PREFIX(Rectsv)(const GLshort *v1, const GLshort *v2);
-GLAPI void APIENTRY GLAPI_PREFIX(TexCoord1d)(GLdouble s);
-GLAPI void APIENTRY GLAPI_PREFIX(TexCoord1dv)(const GLdouble *v);
-GLAPI void APIENTRY GLAPI_PREFIX(TexCoord1f)(GLfloat s);
-GLAPI void APIENTRY GLAPI_PREFIX(TexCoord1fv)(const GLfloat *v);
-GLAPI void APIENTRY GLAPI_PREFIX(TexCoord1i)(GLint s);
-GLAPI void APIENTRY GLAPI_PREFIX(TexCoord1iv)(const GLint *v);
-GLAPI void APIENTRY GLAPI_PREFIX(TexCoord1s)(GLshort s);
-GLAPI void APIENTRY GLAPI_PREFIX(TexCoord1sv)(const GLshort *v);
-GLAPI void APIENTRY GLAPI_PREFIX(TexCoord2d)(GLdouble s, GLdouble t);
-GLAPI void APIENTRY GLAPI_PREFIX(TexCoord2dv)(const GLdouble *v);
-GLAPI void APIENTRY GLAPI_PREFIX(TexCoord2f)(GLfloat s, GLfloat t);
-GLAPI void APIENTRY GLAPI_PREFIX(TexCoord2fv)(const GLfloat *v);
-GLAPI void APIENTRY GLAPI_PREFIX(TexCoord2i)(GLint s, GLint t);
-GLAPI void APIENTRY GLAPI_PREFIX(TexCoord2iv)(const GLint *v);
-GLAPI void APIENTRY GLAPI_PREFIX(TexCoord2s)(GLshort s, GLshort t);
-GLAPI void APIENTRY GLAPI_PREFIX(TexCoord2sv)(const GLshort *v);
-GLAPI void APIENTRY GLAPI_PREFIX(TexCoord3d)(GLdouble s, GLdouble t, GLdouble r);
-GLAPI void APIENTRY GLAPI_PREFIX(TexCoord3dv)(const GLdouble *v);
-GLAPI void APIENTRY GLAPI_PREFIX(TexCoord3f)(GLfloat s, GLfloat t, GLfloat r);
-GLAPI void APIENTRY GLAPI_PREFIX(TexCoord3fv)(const GLfloat *v);
-GLAPI void APIENTRY GLAPI_PREFIX(TexCoord3i)(GLint s, GLint t, GLint r);
-GLAPI void APIENTRY GLAPI_PREFIX(TexCoord3iv)(const GLint *v);
-GLAPI void APIENTRY GLAPI_PREFIX(TexCoord3s)(GLshort s, GLshort t, GLshort r);
-GLAPI void APIENTRY GLAPI_PREFIX(TexCoord3sv)(const GLshort *v);
-GLAPI void APIENTRY GLAPI_PREFIX(TexCoord4d)(GLdouble s, GLdouble t, GLdouble r, GLdouble q);
-GLAPI void APIENTRY GLAPI_PREFIX(TexCoord4dv)(const GLdouble *v);
-GLAPI void APIENTRY GLAPI_PREFIX(TexCoord4f)(GLfloat s, GLfloat t, GLfloat r, GLfloat q);
-GLAPI void APIENTRY GLAPI_PREFIX(TexCoord4fv)(const GLfloat *v);
-GLAPI void APIENTRY GLAPI_PREFIX(TexCoord4i)(GLint s, GLint t, GLint r, GLint q);
-GLAPI void APIENTRY GLAPI_PREFIX(TexCoord4iv)(const GLint *v);
-GLAPI void APIENTRY GLAPI_PREFIX(TexCoord4s)(GLshort s, GLshort t, GLshort r, GLshort q);
-GLAPI void APIENTRY GLAPI_PREFIX(TexCoord4sv)(const GLshort *v);
-GLAPI void APIENTRY GLAPI_PREFIX(Vertex2d)(GLdouble x, GLdouble y);
-GLAPI void APIENTRY GLAPI_PREFIX(Vertex2dv)(const GLdouble *v);
-GLAPI void APIENTRY GLAPI_PREFIX(Vertex2f)(GLfloat x, GLfloat y);
-GLAPI void APIENTRY GLAPI_PREFIX(Vertex2fv)(const GLfloat *v);
-GLAPI void APIENTRY GLAPI_PREFIX(Vertex2i)(GLint x, GLint y);
-GLAPI void APIENTRY GLAPI_PREFIX(Vertex2iv)(const GLint *v);
-GLAPI void APIENTRY GLAPI_PREFIX(Vertex2s)(GLshort x, GLshort y);
-GLAPI void APIENTRY GLAPI_PREFIX(Vertex2sv)(const GLshort *v);
-GLAPI void APIENTRY GLAPI_PREFIX(Vertex3d)(GLdouble x, GLdouble y, GLdouble z);
-GLAPI void APIENTRY GLAPI_PREFIX(Vertex3dv)(const GLdouble *v);
-GLAPI void APIENTRY GLAPI_PREFIX(Vertex3f)(GLfloat x, GLfloat y, GLfloat z);
-GLAPI void APIENTRY GLAPI_PREFIX(Vertex3fv)(const GLfloat *v);
-GLAPI void APIENTRY GLAPI_PREFIX(Vertex3i)(GLint x, GLint y, GLint z);
-GLAPI void APIENTRY GLAPI_PREFIX(Vertex3iv)(const GLint *v);
-GLAPI void APIENTRY GLAPI_PREFIX(Vertex3s)(GLshort x, GLshort y, GLshort z);
-GLAPI void APIENTRY GLAPI_PREFIX(Vertex3sv)(const GLshort *v);
-GLAPI void APIENTRY GLAPI_PREFIX(Vertex4d)(GLdouble x, GLdouble y, GLdouble z, GLdouble w);
-GLAPI void APIENTRY GLAPI_PREFIX(Vertex4dv)(const GLdouble *v);
-GLAPI void APIENTRY GLAPI_PREFIX(Vertex4f)(GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-GLAPI void APIENTRY GLAPI_PREFIX(Vertex4fv)(const GLfloat *v);
-GLAPI void APIENTRY GLAPI_PREFIX(Vertex4i)(GLint x, GLint y, GLint z, GLint w);
-GLAPI void APIENTRY GLAPI_PREFIX(Vertex4iv)(const GLint *v);
-GLAPI void APIENTRY GLAPI_PREFIX(Vertex4s)(GLshort x, GLshort y, GLshort z, GLshort w);
-GLAPI void APIENTRY GLAPI_PREFIX(Vertex4sv)(const GLshort *v);
-GLAPI void APIENTRY GLAPI_PREFIX(ClipPlane)(GLenum plane, const GLdouble *equation);
-GLAPI void APIENTRY GLAPI_PREFIX(ColorMaterial)(GLenum face, GLenum mode);
-GLAPI void APIENTRY GLAPI_PREFIX(CullFace)(GLenum mode);
-GLAPI void APIENTRY GLAPI_PREFIX(Fogf)(GLenum pname, GLfloat param);
-GLAPI void APIENTRY GLAPI_PREFIX(Fogfv)(GLenum pname, const GLfloat *params);
-GLAPI void APIENTRY GLAPI_PREFIX(Fogi)(GLenum pname, GLint param);
-GLAPI void APIENTRY GLAPI_PREFIX(Fogiv)(GLenum pname, const GLint *params);
-GLAPI void APIENTRY GLAPI_PREFIX(FrontFace)(GLenum mode);
-GLAPI void APIENTRY GLAPI_PREFIX(Hint)(GLenum target, GLenum mode);
-GLAPI void APIENTRY GLAPI_PREFIX(Lightf)(GLenum light, GLenum pname, GLfloat param);
-GLAPI void APIENTRY GLAPI_PREFIX(Lightfv)(GLenum light, GLenum pname, const GLfloat *params);
-GLAPI void APIENTRY GLAPI_PREFIX(Lighti)(GLenum light, GLenum pname, GLint param);
-GLAPI void APIENTRY GLAPI_PREFIX(Lightiv)(GLenum light, GLenum pname, const GLint *params);
-GLAPI void APIENTRY GLAPI_PREFIX(LightModelf)(GLenum pname, GLfloat param);
-GLAPI void APIENTRY GLAPI_PREFIX(LightModelfv)(GLenum pname, const GLfloat *params);
-GLAPI void APIENTRY GLAPI_PREFIX(LightModeli)(GLenum pname, GLint param);
-GLAPI void APIENTRY GLAPI_PREFIX(LightModeliv)(GLenum pname, const GLint *params);
-GLAPI void APIENTRY GLAPI_PREFIX(LineStipple)(GLint factor, GLushort pattern);
-GLAPI void APIENTRY GLAPI_PREFIX(LineWidth)(GLfloat width);
-GLAPI void APIENTRY GLAPI_PREFIX(Materialf)(GLenum face, GLenum pname, GLfloat param);
-GLAPI void APIENTRY GLAPI_PREFIX(Materialfv)(GLenum face, GLenum pname, const GLfloat *params);
-GLAPI void APIENTRY GLAPI_PREFIX(Materiali)(GLenum face, GLenum pname, GLint param);
-GLAPI void APIENTRY GLAPI_PREFIX(Materialiv)(GLenum face, GLenum pname, const GLint *params);
-GLAPI void APIENTRY GLAPI_PREFIX(PointSize)(GLfloat size);
-GLAPI void APIENTRY GLAPI_PREFIX(PolygonMode)(GLenum face, GLenum mode);
-GLAPI void APIENTRY GLAPI_PREFIX(PolygonStipple)(const GLubyte *mask);
-GLAPI void APIENTRY GLAPI_PREFIX(Scissor)(GLint x, GLint y, GLsizei width, GLsizei height);
-GLAPI void APIENTRY GLAPI_PREFIX(ShadeModel)(GLenum mode);
-GLAPI void APIENTRY GLAPI_PREFIX(TexParameterf)(GLenum target, GLenum pname, GLfloat param);
-GLAPI void APIENTRY GLAPI_PREFIX(TexParameterfv)(GLenum target, GLenum pname, const GLfloat *params);
-GLAPI void APIENTRY GLAPI_PREFIX(TexParameteri)(GLenum target, GLenum pname, GLint param);
-GLAPI void APIENTRY GLAPI_PREFIX(TexParameteriv)(GLenum target, GLenum pname, const GLint *params);
-GLAPI void APIENTRY GLAPI_PREFIX(TexImage1D)(GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
-GLAPI void APIENTRY GLAPI_PREFIX(TexImage2D)(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
-GLAPI void APIENTRY GLAPI_PREFIX(TexEnvf)(GLenum target, GLenum pname, GLfloat param);
-GLAPI void APIENTRY GLAPI_PREFIX(TexEnvfv)(GLenum target, GLenum pname, const GLfloat *params);
-GLAPI void APIENTRY GLAPI_PREFIX(TexEnvi)(GLenum target, GLenum pname, GLint param);
-GLAPI void APIENTRY GLAPI_PREFIX(TexEnviv)(GLenum target, GLenum pname, const GLint *params);
-GLAPI void APIENTRY GLAPI_PREFIX(TexGend)(GLenum coord, GLenum pname, GLdouble param);
-GLAPI void APIENTRY GLAPI_PREFIX(TexGendv)(GLenum coord, GLenum pname, const GLdouble *params);
-GLAPI void APIENTRY GLAPI_PREFIX(TexGenf)(GLenum coord, GLenum pname, GLfloat param);
-GLAPI void APIENTRY GLAPI_PREFIX(TexGenfv)(GLenum coord, GLenum pname, const GLfloat *params);
-GLAPI void APIENTRY GLAPI_PREFIX(TexGeni)(GLenum coord, GLenum pname, GLint param);
-GLAPI void APIENTRY GLAPI_PREFIX(TexGeniv)(GLenum coord, GLenum pname, const GLint *params);
-GLAPI void APIENTRY GLAPI_PREFIX(FeedbackBuffer)(GLsizei size, GLenum type, GLfloat *buffer);
-GLAPI void APIENTRY GLAPI_PREFIX(SelectBuffer)(GLsizei size, GLuint *buffer);
-GLAPI GLint APIENTRY GLAPI_PREFIX(RenderMode)(GLenum mode);
-GLAPI void APIENTRY GLAPI_PREFIX(InitNames)(void);
-GLAPI void APIENTRY GLAPI_PREFIX(LoadName)(GLuint name);
-GLAPI void APIENTRY GLAPI_PREFIX(PassThrough)(GLfloat token);
-GLAPI void APIENTRY GLAPI_PREFIX(PopName)(void);
-GLAPI void APIENTRY GLAPI_PREFIX(PushName)(GLuint name);
-GLAPI void APIENTRY GLAPI_PREFIX(DrawBuffer)(GLenum mode);
-GLAPI void APIENTRY GLAPI_PREFIX(Clear)(GLbitfield mask);
-GLAPI void APIENTRY GLAPI_PREFIX(ClearAccum)(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
-GLAPI void APIENTRY GLAPI_PREFIX(ClearIndex)(GLfloat c);
-GLAPI void APIENTRY GLAPI_PREFIX(ClearColor)(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
-GLAPI void APIENTRY GLAPI_PREFIX(ClearStencil)(GLint s);
-GLAPI void APIENTRY GLAPI_PREFIX(ClearDepth)(GLclampd depth);
-GLAPI void APIENTRY GLAPI_PREFIX(StencilMask)(GLuint mask);
-GLAPI void APIENTRY GLAPI_PREFIX(ColorMask)(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha);
-GLAPI void APIENTRY GLAPI_PREFIX(DepthMask)(GLboolean flag);
-GLAPI void APIENTRY GLAPI_PREFIX(IndexMask)(GLuint mask);
-GLAPI void APIENTRY GLAPI_PREFIX(Accum)(GLenum op, GLfloat value);
-GLAPI void APIENTRY GLAPI_PREFIX(Disable)(GLenum cap);
-GLAPI void APIENTRY GLAPI_PREFIX(Enable)(GLenum cap);
-GLAPI void APIENTRY GLAPI_PREFIX(Finish)(void);
-GLAPI void APIENTRY GLAPI_PREFIX(Flush)(void);
-GLAPI void APIENTRY GLAPI_PREFIX(PopAttrib)(void);
-GLAPI void APIENTRY GLAPI_PREFIX(PushAttrib)(GLbitfield mask);
-GLAPI void APIENTRY GLAPI_PREFIX(Map1d)(GLenum target, GLdouble u1, GLdouble u2, GLint stride, GLint order, const GLdouble *points);
-GLAPI void APIENTRY GLAPI_PREFIX(Map1f)(GLenum target, GLfloat u1, GLfloat u2, GLint stride, GLint order, const GLfloat *points);
-GLAPI void APIENTRY GLAPI_PREFIX(Map2d)(GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, const GLdouble *points);
-GLAPI void APIENTRY GLAPI_PREFIX(Map2f)(GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, const GLfloat *points);
-GLAPI void APIENTRY GLAPI_PREFIX(MapGrid1d)(GLint un, GLdouble u1, GLdouble u2);
-GLAPI void APIENTRY GLAPI_PREFIX(MapGrid1f)(GLint un, GLfloat u1, GLfloat u2);
-GLAPI void APIENTRY GLAPI_PREFIX(MapGrid2d)(GLint un, GLdouble u1, GLdouble u2, GLint vn, GLdouble v1, GLdouble v2);
-GLAPI void APIENTRY GLAPI_PREFIX(MapGrid2f)(GLint un, GLfloat u1, GLfloat u2, GLint vn, GLfloat v1, GLfloat v2);
-GLAPI void APIENTRY GLAPI_PREFIX(EvalCoord1d)(GLdouble u);
-GLAPI void APIENTRY GLAPI_PREFIX(EvalCoord1dv)(const GLdouble *u);
-GLAPI void APIENTRY GLAPI_PREFIX(EvalCoord1f)(GLfloat u);
-GLAPI void APIENTRY GLAPI_PREFIX(EvalCoord1fv)(const GLfloat *u);
-GLAPI void APIENTRY GLAPI_PREFIX(EvalCoord2d)(GLdouble u, GLdouble v);
-GLAPI void APIENTRY GLAPI_PREFIX(EvalCoord2dv)(const GLdouble *u);
-GLAPI void APIENTRY GLAPI_PREFIX(EvalCoord2f)(GLfloat u, GLfloat v);
-GLAPI void APIENTRY GLAPI_PREFIX(EvalCoord2fv)(const GLfloat *u);
-GLAPI void APIENTRY GLAPI_PREFIX(EvalMesh1)(GLenum mode, GLint i1, GLint i2);
-GLAPI void APIENTRY GLAPI_PREFIX(EvalPoint1)(GLint i);
-GLAPI void APIENTRY GLAPI_PREFIX(EvalMesh2)(GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2);
-GLAPI void APIENTRY GLAPI_PREFIX(EvalPoint2)(GLint i, GLint j);
-GLAPI void APIENTRY GLAPI_PREFIX(AlphaFunc)(GLenum func, GLclampf ref);
-GLAPI void APIENTRY GLAPI_PREFIX(BlendFunc)(GLenum sfactor, GLenum dfactor);
-GLAPI void APIENTRY GLAPI_PREFIX(LogicOp)(GLenum opcode);
-GLAPI void APIENTRY GLAPI_PREFIX(StencilFunc)(GLenum func, GLint ref, GLuint mask);
-GLAPI void APIENTRY GLAPI_PREFIX(StencilOp)(GLenum fail, GLenum zfail, GLenum zpass);
-GLAPI void APIENTRY GLAPI_PREFIX(DepthFunc)(GLenum func);
-GLAPI void APIENTRY GLAPI_PREFIX(PixelZoom)(GLfloat xfactor, GLfloat yfactor);
-GLAPI void APIENTRY GLAPI_PREFIX(PixelTransferf)(GLenum pname, GLfloat param);
-GLAPI void APIENTRY GLAPI_PREFIX(PixelTransferi)(GLenum pname, GLint param);
-GLAPI void APIENTRY GLAPI_PREFIX(PixelStoref)(GLenum pname, GLfloat param);
-GLAPI void APIENTRY GLAPI_PREFIX(PixelStorei)(GLenum pname, GLint param);
-GLAPI void APIENTRY GLAPI_PREFIX(PixelMapfv)(GLenum map, GLsizei mapsize, const GLfloat *values);
-GLAPI void APIENTRY GLAPI_PREFIX(PixelMapuiv)(GLenum map, GLsizei mapsize, const GLuint *values);
-GLAPI void APIENTRY GLAPI_PREFIX(PixelMapusv)(GLenum map, GLsizei mapsize, const GLushort *values);
-GLAPI void APIENTRY GLAPI_PREFIX(ReadBuffer)(GLenum mode);
-GLAPI void APIENTRY GLAPI_PREFIX(CopyPixels)(GLint x, GLint y, GLsizei width, GLsizei height, GLenum type);
-GLAPI void APIENTRY GLAPI_PREFIX(ReadPixels)(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels);
-GLAPI void APIENTRY GLAPI_PREFIX(DrawPixels)(GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels);
-GLAPI void APIENTRY GLAPI_PREFIX(GetBooleanv)(GLenum pname, GLboolean *params);
-GLAPI void APIENTRY GLAPI_PREFIX(GetClipPlane)(GLenum plane, GLdouble *equation);
-GLAPI void APIENTRY GLAPI_PREFIX(GetDoublev)(GLenum pname, GLdouble *params);
-GLAPI GLenum APIENTRY GLAPI_PREFIX(GetError)(void);
-GLAPI void APIENTRY GLAPI_PREFIX(GetFloatv)(GLenum pname, GLfloat *params);
-GLAPI void APIENTRY GLAPI_PREFIX(GetIntegerv)(GLenum pname, GLint *params);
-GLAPI void APIENTRY GLAPI_PREFIX(GetLightfv)(GLenum light, GLenum pname, GLfloat *params);
-GLAPI void APIENTRY GLAPI_PREFIX(GetLightiv)(GLenum light, GLenum pname, GLint *params);
-GLAPI void APIENTRY GLAPI_PREFIX(GetMapdv)(GLenum target, GLenum query, GLdouble *v);
-GLAPI void APIENTRY GLAPI_PREFIX(GetMapfv)(GLenum target, GLenum query, GLfloat *v);
-GLAPI void APIENTRY GLAPI_PREFIX(GetMapiv)(GLenum target, GLenum query, GLint *v);
-GLAPI void APIENTRY GLAPI_PREFIX(GetMaterialfv)(GLenum face, GLenum pname, GLfloat *params);
-GLAPI void APIENTRY GLAPI_PREFIX(GetMaterialiv)(GLenum face, GLenum pname, GLint *params);
-GLAPI void APIENTRY GLAPI_PREFIX(GetPixelMapfv)(GLenum map, GLfloat *values);
-GLAPI void APIENTRY GLAPI_PREFIX(GetPixelMapuiv)(GLenum map, GLuint *values);
-GLAPI void APIENTRY GLAPI_PREFIX(GetPixelMapusv)(GLenum map, GLushort *values);
-GLAPI void APIENTRY GLAPI_PREFIX(GetPolygonStipple)(GLubyte *mask);
-GLAPI const GLubyte * APIENTRY GLAPI_PREFIX(GetString)(GLenum name);
-GLAPI void APIENTRY GLAPI_PREFIX(GetTexEnvfv)(GLenum target, GLenum pname, GLfloat *params);
-GLAPI void APIENTRY GLAPI_PREFIX(GetTexEnviv)(GLenum target, GLenum pname, GLint *params);
-GLAPI void APIENTRY GLAPI_PREFIX(GetTexGendv)(GLenum coord, GLenum pname, GLdouble *params);
-GLAPI void APIENTRY GLAPI_PREFIX(GetTexGenfv)(GLenum coord, GLenum pname, GLfloat *params);
-GLAPI void APIENTRY GLAPI_PREFIX(GetTexGeniv)(GLenum coord, GLenum pname, GLint *params);
-GLAPI void APIENTRY GLAPI_PREFIX(GetTexImage)(GLenum target, GLint level, GLenum format, GLenum type, GLvoid *pixels);
-GLAPI void APIENTRY GLAPI_PREFIX(GetTexParameterfv)(GLenum target, GLenum pname, GLfloat *params);
-GLAPI void APIENTRY GLAPI_PREFIX(GetTexParameteriv)(GLenum target, GLenum pname, GLint *params);
-GLAPI void APIENTRY GLAPI_PREFIX(GetTexLevelParameterfv)(GLenum target, GLint level, GLenum pname, GLfloat *params);
-GLAPI void APIENTRY GLAPI_PREFIX(GetTexLevelParameteriv)(GLenum target, GLint level, GLenum pname, GLint *params);
-GLAPI GLboolean APIENTRY GLAPI_PREFIX(IsEnabled)(GLenum cap);
-GLAPI GLboolean APIENTRY GLAPI_PREFIX(IsList)(GLuint list);
-GLAPI void APIENTRY GLAPI_PREFIX(DepthRange)(GLclampd zNear, GLclampd zFar);
-GLAPI void APIENTRY GLAPI_PREFIX(Frustum)(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar);
-GLAPI void APIENTRY GLAPI_PREFIX(LoadIdentity)(void);
-GLAPI void APIENTRY GLAPI_PREFIX(LoadMatrixf)(const GLfloat *m);
-GLAPI void APIENTRY GLAPI_PREFIX(LoadMatrixd)(const GLdouble *m);
-GLAPI void APIENTRY GLAPI_PREFIX(MatrixMode)(GLenum mode);
-GLAPI void APIENTRY GLAPI_PREFIX(MultMatrixf)(const GLfloat *m);
-GLAPI void APIENTRY GLAPI_PREFIX(MultMatrixd)(const GLdouble *m);
-GLAPI void APIENTRY GLAPI_PREFIX(Ortho)(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar);
-GLAPI void APIENTRY GLAPI_PREFIX(PopMatrix)(void);
-GLAPI void APIENTRY GLAPI_PREFIX(PushMatrix)(void);
-GLAPI void APIENTRY GLAPI_PREFIX(Rotated)(GLdouble angle, GLdouble x, GLdouble y, GLdouble z);
-GLAPI void APIENTRY GLAPI_PREFIX(Rotatef)(GLfloat angle, GLfloat x, GLfloat y, GLfloat z);
-GLAPI void APIENTRY GLAPI_PREFIX(Scaled)(GLdouble x, GLdouble y, GLdouble z);
-GLAPI void APIENTRY GLAPI_PREFIX(Scalef)(GLfloat x, GLfloat y, GLfloat z);
-GLAPI void APIENTRY GLAPI_PREFIX(Translated)(GLdouble x, GLdouble y, GLdouble z);
-GLAPI void APIENTRY GLAPI_PREFIX(Translatef)(GLfloat x, GLfloat y, GLfloat z);
-GLAPI void APIENTRY GLAPI_PREFIX(Viewport)(GLint x, GLint y, GLsizei width, GLsizei height);
-GLAPI void APIENTRY GLAPI_PREFIX(ArrayElement)(GLint i);
-GLAPI void APIENTRY GLAPI_PREFIX(ArrayElementEXT)(GLint i);
-GLAPI void APIENTRY GLAPI_PREFIX(BindTexture)(GLenum target, GLuint texture);
-GLAPI void APIENTRY GLAPI_PREFIX(BindTextureEXT)(GLenum target, GLuint texture);
-GLAPI void APIENTRY GLAPI_PREFIX(ColorPointer)(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
-GLAPI void APIENTRY GLAPI_PREFIX(DisableClientState)(GLenum array);
-GLAPI void APIENTRY GLAPI_PREFIX(DrawArrays)(GLenum mode, GLint first, GLsizei count);
-GLAPI void APIENTRY GLAPI_PREFIX(DrawArraysEXT)(GLenum mode, GLint first, GLsizei count);
-GLAPI void APIENTRY GLAPI_PREFIX(DrawElements)(GLenum mode, GLsizei count, GLenum type, const GLvoid *indices);
-GLAPI void APIENTRY GLAPI_PREFIX(EdgeFlagPointer)(GLsizei stride, const GLvoid *pointer);
-GLAPI void APIENTRY GLAPI_PREFIX(EnableClientState)(GLenum array);
-GLAPI void APIENTRY GLAPI_PREFIX(IndexPointer)(GLenum type, GLsizei stride, const GLvoid *pointer);
-GLAPI void APIENTRY GLAPI_PREFIX(Indexub)(GLubyte c);
-GLAPI void APIENTRY GLAPI_PREFIX(Indexubv)(const GLubyte *c);
-GLAPI void APIENTRY GLAPI_PREFIX(InterleavedArrays)(GLenum format, GLsizei stride, const GLvoid *pointer);
-GLAPI void APIENTRY GLAPI_PREFIX(NormalPointer)(GLenum type, GLsizei stride, const GLvoid *pointer);
-GLAPI void APIENTRY GLAPI_PREFIX(PolygonOffset)(GLfloat factor, GLfloat units);
-GLAPI void APIENTRY GLAPI_PREFIX(TexCoordPointer)(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
-GLAPI void APIENTRY GLAPI_PREFIX(VertexPointer)(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
-GLAPI GLboolean APIENTRY GLAPI_PREFIX(AreTexturesResident)(GLsizei n, const GLuint *textures, GLboolean *residences);
-GLAPI GLboolean APIENTRY GLAPI_PREFIX(AreTexturesResidentEXT)(GLsizei n, const GLuint *textures, GLboolean *residences);
-GLAPI void APIENTRY GLAPI_PREFIX(CopyTexImage1D)(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border);
-GLAPI void APIENTRY GLAPI_PREFIX(CopyTexImage1DEXT)(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border);
-GLAPI void APIENTRY GLAPI_PREFIX(CopyTexImage2D)(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
-GLAPI void APIENTRY GLAPI_PREFIX(CopyTexImage2DEXT)(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
-GLAPI void APIENTRY GLAPI_PREFIX(CopyTexSubImage1D)(GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width);
-GLAPI void APIENTRY GLAPI_PREFIX(CopyTexSubImage1DEXT)(GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width);
-GLAPI void APIENTRY GLAPI_PREFIX(CopyTexSubImage2D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
-GLAPI void APIENTRY GLAPI_PREFIX(CopyTexSubImage2DEXT)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
-GLAPI void APIENTRY GLAPI_PREFIX(DeleteTextures)(GLsizei n, const GLuint *textures);
-GLAPI void APIENTRY GLAPI_PREFIX(DeleteTexturesEXT)(GLsizei n, const GLuint *textures);
-GLAPI void APIENTRY GLAPI_PREFIX(GenTextures)(GLsizei n, GLuint *textures);
-GLAPI void APIENTRY GLAPI_PREFIX(GenTexturesEXT)(GLsizei n, GLuint *textures);
-GLAPI void APIENTRY GLAPI_PREFIX(GetPointerv)(GLenum pname, GLvoid **params);
-GLAPI void APIENTRY GLAPI_PREFIX(GetPointervEXT)(GLenum pname, GLvoid **params);
-GLAPI GLboolean APIENTRY GLAPI_PREFIX(IsTexture)(GLuint texture);
-GLAPI GLboolean APIENTRY GLAPI_PREFIX(IsTextureEXT)(GLuint texture);
-GLAPI void APIENTRY GLAPI_PREFIX(PrioritizeTextures)(GLsizei n, const GLuint *textures, const GLclampf *priorities);
-GLAPI void APIENTRY GLAPI_PREFIX(PrioritizeTexturesEXT)(GLsizei n, const GLuint *textures, const GLclampf *priorities);
-GLAPI void APIENTRY GLAPI_PREFIX(TexSubImage1D)(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels);
-GLAPI void APIENTRY GLAPI_PREFIX(TexSubImage1DEXT)(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels);
-GLAPI void APIENTRY GLAPI_PREFIX(TexSubImage2D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels);
-GLAPI void APIENTRY GLAPI_PREFIX(TexSubImage2DEXT)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels);
-GLAPI void APIENTRY GLAPI_PREFIX(PopClientAttrib)(void);
-GLAPI void APIENTRY GLAPI_PREFIX(PushClientAttrib)(GLbitfield mask);
-GLAPI void APIENTRY GLAPI_PREFIX(BlendColor)(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
-GLAPI void APIENTRY GLAPI_PREFIX(BlendColorEXT)(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
-GLAPI void APIENTRY GLAPI_PREFIX(BlendEquation)(GLenum mode);
-GLAPI void APIENTRY GLAPI_PREFIX(BlendEquationEXT)(GLenum mode);
-GLAPI void APIENTRY GLAPI_PREFIX(DrawRangeElements)(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices);
-GLAPI void APIENTRY GLAPI_PREFIX(DrawRangeElementsEXT)(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices);
-GLAPI void APIENTRY GLAPI_PREFIX(ColorTable)(GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table);
-GLAPI void APIENTRY GLAPI_PREFIX(ColorTableEXT)(GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table);
-GLAPI void APIENTRY GLAPI_PREFIX(ColorTableParameterfv)(GLenum target, GLenum pname, const GLfloat *params);
-GLAPI void APIENTRY GLAPI_PREFIX(ColorTableParameteriv)(GLenum target, GLenum pname, const GLint *params);
-GLAPI void APIENTRY GLAPI_PREFIX(CopyColorTable)(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width);
-GLAPI void APIENTRY GLAPI_PREFIX(GetColorTable)(GLenum target, GLenum format, GLenum type, GLvoid *table);
-GLAPI void APIENTRY GLAPI_PREFIX(GetColorTableEXT)(GLenum target, GLenum format, GLenum type, GLvoid *table);
-void APIENTRY GLAPI_PREFIX(_dispatch_stub_343)(GLenum target, GLenum format, GLenum type, GLvoid *table);
-GLAPI void APIENTRY GLAPI_PREFIX(GetColorTableParameterfv)(GLenum target, GLenum pname, GLfloat *params);
-GLAPI void APIENTRY GLAPI_PREFIX(GetColorTableParameterfvEXT)(GLenum target, GLenum pname, GLfloat *params);
-void APIENTRY GLAPI_PREFIX(_dispatch_stub_344)(GLenum target, GLenum pname, GLfloat *params);
-GLAPI void APIENTRY GLAPI_PREFIX(GetColorTableParameteriv)(GLenum target, GLenum pname, GLint *params);
-GLAPI void APIENTRY GLAPI_PREFIX(GetColorTableParameterivEXT)(GLenum target, GLenum pname, GLint *params);
-void APIENTRY GLAPI_PREFIX(_dispatch_stub_345)(GLenum target, GLenum pname, GLint *params);
-GLAPI void APIENTRY GLAPI_PREFIX(ColorSubTable)(GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *data);
-GLAPI void APIENTRY GLAPI_PREFIX(CopyColorSubTable)(GLenum target, GLsizei start, GLint x, GLint y, GLsizei width);
-GLAPI void APIENTRY GLAPI_PREFIX(ConvolutionFilter1D)(GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *image);
-GLAPI void APIENTRY GLAPI_PREFIX(ConvolutionFilter2D)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *image);
-GLAPI void APIENTRY GLAPI_PREFIX(ConvolutionParameterf)(GLenum target, GLenum pname, GLfloat params);
-GLAPI void APIENTRY GLAPI_PREFIX(ConvolutionParameterfv)(GLenum target, GLenum pname, const GLfloat *params);
-GLAPI void APIENTRY GLAPI_PREFIX(ConvolutionParameteri)(GLenum target, GLenum pname, GLint params);
-GLAPI void APIENTRY GLAPI_PREFIX(ConvolutionParameteriv)(GLenum target, GLenum pname, const GLint *params);
-GLAPI void APIENTRY GLAPI_PREFIX(CopyConvolutionFilter1D)(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width);
-GLAPI void APIENTRY GLAPI_PREFIX(CopyConvolutionFilter2D)(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height);
-GLAPI void APIENTRY GLAPI_PREFIX(GetConvolutionFilter)(GLenum target, GLenum format, GLenum type, GLvoid *image);
-void APIENTRY GLAPI_PREFIX(_dispatch_stub_356)(GLenum target, GLenum format, GLenum type, GLvoid *image);
-GLAPI void APIENTRY GLAPI_PREFIX(GetConvolutionParameterfv)(GLenum target, GLenum pname, GLfloat *params);
-void APIENTRY GLAPI_PREFIX(_dispatch_stub_357)(GLenum target, GLenum pname, GLfloat *params);
-GLAPI void APIENTRY GLAPI_PREFIX(GetConvolutionParameteriv)(GLenum target, GLenum pname, GLint *params);
-void APIENTRY GLAPI_PREFIX(_dispatch_stub_358)(GLenum target, GLenum pname, GLint *params);
-GLAPI void APIENTRY GLAPI_PREFIX(GetSeparableFilter)(GLenum target, GLenum format, GLenum type, GLvoid *row, GLvoid *column, GLvoid *span);
-void APIENTRY GLAPI_PREFIX(_dispatch_stub_359)(GLenum target, GLenum format, GLenum type, GLvoid *row, GLvoid *column, GLvoid *span);
-GLAPI void APIENTRY GLAPI_PREFIX(SeparableFilter2D)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *row, const GLvoid *column);
-GLAPI void APIENTRY GLAPI_PREFIX(GetHistogram)(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values);
-void APIENTRY GLAPI_PREFIX(_dispatch_stub_361)(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values);
-GLAPI void APIENTRY GLAPI_PREFIX(GetHistogramParameterfv)(GLenum target, GLenum pname, GLfloat *params);
-void APIENTRY GLAPI_PREFIX(_dispatch_stub_362)(GLenum target, GLenum pname, GLfloat *params);
-GLAPI void APIENTRY GLAPI_PREFIX(GetHistogramParameteriv)(GLenum target, GLenum pname, GLint *params);
-void APIENTRY GLAPI_PREFIX(_dispatch_stub_363)(GLenum target, GLenum pname, GLint *params);
-GLAPI void APIENTRY GLAPI_PREFIX(GetMinmax)(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values);
-void APIENTRY GLAPI_PREFIX(_dispatch_stub_364)(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values);
-GLAPI void APIENTRY GLAPI_PREFIX(GetMinmaxParameterfv)(GLenum target, GLenum pname, GLfloat *params);
-void APIENTRY GLAPI_PREFIX(_dispatch_stub_365)(GLenum target, GLenum pname, GLfloat *params);
-GLAPI void APIENTRY GLAPI_PREFIX(GetMinmaxParameteriv)(GLenum target, GLenum pname, GLint *params);
-void APIENTRY GLAPI_PREFIX(_dispatch_stub_366)(GLenum target, GLenum pname, GLint *params);
-GLAPI void APIENTRY GLAPI_PREFIX(Histogram)(GLenum target, GLsizei width, GLenum internalformat, GLboolean sink);
-GLAPI void APIENTRY GLAPI_PREFIX(Minmax)(GLenum target, GLenum internalformat, GLboolean sink);
-GLAPI void APIENTRY GLAPI_PREFIX(ResetHistogram)(GLenum target);
-GLAPI void APIENTRY GLAPI_PREFIX(ResetMinmax)(GLenum target);
-GLAPI void APIENTRY GLAPI_PREFIX(TexImage3D)(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
-GLAPI void APIENTRY GLAPI_PREFIX(TexImage3DEXT)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
-GLAPI void APIENTRY GLAPI_PREFIX(TexSubImage3D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels);
-GLAPI void APIENTRY GLAPI_PREFIX(TexSubImage3DEXT)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels);
-GLAPI void APIENTRY GLAPI_PREFIX(CopyTexSubImage3D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
-GLAPI void APIENTRY GLAPI_PREFIX(CopyTexSubImage3DEXT)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
-GLAPI void APIENTRY GLAPI_PREFIX(ActiveTextureARB)(GLenum texture);
-GLAPI void APIENTRY GLAPI_PREFIX(ActiveTexture)(GLenum texture);
-GLAPI void APIENTRY GLAPI_PREFIX(ClientActiveTextureARB)(GLenum texture);
-GLAPI void APIENTRY GLAPI_PREFIX(ClientActiveTexture)(GLenum texture);
-GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord1dARB)(GLenum target, GLdouble s);
-GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord1d)(GLenum target, GLdouble s);
-GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord1dvARB)(GLenum target, const GLdouble *v);
-GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord1dv)(GLenum target, const GLdouble *v);
-GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord1fARB)(GLenum target, GLfloat s);
-GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord1f)(GLenum target, GLfloat s);
-GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord1fvARB)(GLenum target, const GLfloat *v);
-GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord1fv)(GLenum target, const GLfloat *v);
-GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord1iARB)(GLenum target, GLint s);
-GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord1i)(GLenum target, GLint s);
-GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord1ivARB)(GLenum target, const GLint *v);
-GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord1iv)(GLenum target, const GLint *v);
-GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord1sARB)(GLenum target, GLshort s);
-GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord1s)(GLenum target, GLshort s);
-GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord1svARB)(GLenum target, const GLshort *v);
-GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord1sv)(GLenum target, const GLshort *v);
-GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord2dARB)(GLenum target, GLdouble s, GLdouble t);
-GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord2d)(GLenum target, GLdouble s, GLdouble t);
-GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord2dvARB)(GLenum target, const GLdouble *v);
-GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord2dv)(GLenum target, const GLdouble *v);
-GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord2fARB)(GLenum target, GLfloat s, GLfloat t);
-GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord2f)(GLenum target, GLfloat s, GLfloat t);
-GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord2fvARB)(GLenum target, const GLfloat *v);
-GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord2fv)(GLenum target, const GLfloat *v);
-GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord2iARB)(GLenum target, GLint s, GLint t);
-GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord2i)(GLenum target, GLint s, GLint t);
-GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord2ivARB)(GLenum target, const GLint *v);
-GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord2iv)(GLenum target, const GLint *v);
-GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord2sARB)(GLenum target, GLshort s, GLshort t);
-GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord2s)(GLenum target, GLshort s, GLshort t);
-GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord2svARB)(GLenum target, const GLshort *v);
-GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord2sv)(GLenum target, const GLshort *v);
-GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord3dARB)(GLenum target, GLdouble s, GLdouble t, GLdouble r);
-GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord3d)(GLenum target, GLdouble s, GLdouble t, GLdouble r);
-GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord3dvARB)(GLenum target, const GLdouble *v);
-GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord3dv)(GLenum target, const GLdouble *v);
-GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord3fARB)(GLenum target, GLfloat s, GLfloat t, GLfloat r);
-GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord3f)(GLenum target, GLfloat s, GLfloat t, GLfloat r);
-GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord3fvARB)(GLenum target, const GLfloat *v);
-GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord3fv)(GLenum target, const GLfloat *v);
-GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord3iARB)(GLenum target, GLint s, GLint t, GLint r);
-GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord3i)(GLenum target, GLint s, GLint t, GLint r);
-GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord3ivARB)(GLenum target, const GLint *v);
-GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord3iv)(GLenum target, const GLint *v);
-GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord3sARB)(GLenum target, GLshort s, GLshort t, GLshort r);
-GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord3s)(GLenum target, GLshort s, GLshort t, GLshort r);
-GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord3svARB)(GLenum target, const GLshort *v);
-GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord3sv)(GLenum target, const GLshort *v);
-GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord4dARB)(GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q);
-GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord4d)(GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q);
-GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord4dvARB)(GLenum target, const GLdouble *v);
-GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord4dv)(GLenum target, const GLdouble *v);
-GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord4fARB)(GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q);
-GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord4f)(GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q);
-GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord4fvARB)(GLenum target, const GLfloat *v);
-GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord4fv)(GLenum target, const GLfloat *v);
-GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord4iARB)(GLenum target, GLint s, GLint t, GLint r, GLint q);
-GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord4i)(GLenum target, GLint s, GLint t, GLint r, GLint q);
-GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord4ivARB)(GLenum target, const GLint *v);
-GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord4iv)(GLenum target, const GLint *v);
-GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord4sARB)(GLenum target, GLshort s, GLshort t, GLshort r, GLshort q);
-GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord4s)(GLenum target, GLshort s, GLshort t, GLshort r, GLshort q);
-GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord4svARB)(GLenum target, const GLshort *v);
-GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord4sv)(GLenum target, const GLshort *v);
-GLAPI void APIENTRY GLAPI_PREFIX(AttachShader)(GLuint program, GLuint shader);
-GLAPI GLuint APIENTRY GLAPI_PREFIX(CreateProgram)(void);
-GLAPI GLuint APIENTRY GLAPI_PREFIX(CreateShader)(GLenum type);
-GLAPI void APIENTRY GLAPI_PREFIX(DeleteProgram)(GLuint program);
-GLAPI void APIENTRY GLAPI_PREFIX(DeleteShader)(GLuint program);
-GLAPI void APIENTRY GLAPI_PREFIX(DetachShader)(GLuint program, GLuint shader);
-GLAPI void APIENTRY GLAPI_PREFIX(GetAttachedShaders)(GLuint program, GLsizei maxCount, GLsizei *count, GLuint *obj);
-GLAPI void APIENTRY GLAPI_PREFIX(GetProgramInfoLog)(GLuint program, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
-GLAPI void APIENTRY GLAPI_PREFIX(GetProgramiv)(GLuint program, GLenum pname, GLint *params);
-GLAPI void APIENTRY GLAPI_PREFIX(GetShaderInfoLog)(GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
-GLAPI void APIENTRY GLAPI_PREFIX(GetShaderiv)(GLuint shader, GLenum pname, GLint *params);
-GLAPI GLboolean APIENTRY GLAPI_PREFIX(IsProgram)(GLuint program);
-GLAPI GLboolean APIENTRY GLAPI_PREFIX(IsShader)(GLuint shader);
-GLAPI void APIENTRY GLAPI_PREFIX(StencilFuncSeparate)(GLenum face, GLenum func, GLint ref, GLuint mask);
-GLAPI void APIENTRY GLAPI_PREFIX(StencilMaskSeparate)(GLenum face, GLuint mask);
-GLAPI void APIENTRY GLAPI_PREFIX(StencilOpSeparate)(GLenum face, GLenum sfail, GLenum zfail, GLenum zpass);
-GLAPI void APIENTRY GLAPI_PREFIX(UniformMatrix2x3fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-GLAPI void APIENTRY GLAPI_PREFIX(UniformMatrix2x4fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-GLAPI void APIENTRY GLAPI_PREFIX(UniformMatrix3x2fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-GLAPI void APIENTRY GLAPI_PREFIX(UniformMatrix3x4fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-GLAPI void APIENTRY GLAPI_PREFIX(UniformMatrix4x2fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-GLAPI void APIENTRY GLAPI_PREFIX(UniformMatrix4x3fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-GLAPI void APIENTRY GLAPI_PREFIX(ClampColor)(GLenum target, GLenum clamp);
-GLAPI void APIENTRY GLAPI_PREFIX(ClearBufferfi)(GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil);
-GLAPI void APIENTRY GLAPI_PREFIX(ClearBufferfv)(GLenum buffer, GLint drawbuffer, const GLfloat *value);
-GLAPI void APIENTRY GLAPI_PREFIX(ClearBufferiv)(GLenum buffer, GLint drawbuffer, const GLint *value);
-GLAPI void APIENTRY GLAPI_PREFIX(ClearBufferuiv)(GLenum buffer, GLint drawbuffer, const GLuint *value);
-GLAPI const GLubyte * APIENTRY GLAPI_PREFIX(GetStringi)(GLenum name, GLuint index);
-GLAPI void APIENTRY GLAPI_PREFIX(TexBuffer)(GLenum target, GLenum internalFormat, GLuint buffer);
-GLAPI void APIENTRY GLAPI_PREFIX(FramebufferTexture)(GLenum target, GLenum attachment, GLuint texture, GLint level);
-GLAPI void APIENTRY GLAPI_PREFIX(GetBufferParameteri64v)(GLenum target, GLenum pname, GLint64 *params);
-GLAPI void APIENTRY GLAPI_PREFIX(GetInteger64i_v)(GLenum cap, GLuint index, GLint64 *data);
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribDivisor)(GLuint index, GLuint divisor);
-GLAPI void APIENTRY GLAPI_PREFIX(LoadTransposeMatrixdARB)(const GLdouble *m);
-GLAPI void APIENTRY GLAPI_PREFIX(LoadTransposeMatrixd)(const GLdouble *m);
-GLAPI void APIENTRY GLAPI_PREFIX(LoadTransposeMatrixfARB)(const GLfloat *m);
-GLAPI void APIENTRY GLAPI_PREFIX(LoadTransposeMatrixf)(const GLfloat *m);
-GLAPI void APIENTRY GLAPI_PREFIX(MultTransposeMatrixdARB)(const GLdouble *m);
-GLAPI void APIENTRY GLAPI_PREFIX(MultTransposeMatrixd)(const GLdouble *m);
-GLAPI void APIENTRY GLAPI_PREFIX(MultTransposeMatrixfARB)(const GLfloat *m);
-GLAPI void APIENTRY GLAPI_PREFIX(MultTransposeMatrixf)(const GLfloat *m);
-GLAPI void APIENTRY GLAPI_PREFIX(SampleCoverageARB)(GLclampf value, GLboolean invert);
-GLAPI void APIENTRY GLAPI_PREFIX(SampleCoverage)(GLclampf value, GLboolean invert);
-GLAPI void APIENTRY GLAPI_PREFIX(CompressedTexImage1DARB)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data);
-GLAPI void APIENTRY GLAPI_PREFIX(CompressedTexImage1D)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data);
-GLAPI void APIENTRY GLAPI_PREFIX(CompressedTexImage2DARB)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data);
-GLAPI void APIENTRY GLAPI_PREFIX(CompressedTexImage2D)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data);
-GLAPI void APIENTRY GLAPI_PREFIX(CompressedTexImage3DARB)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data);
-GLAPI void APIENTRY GLAPI_PREFIX(CompressedTexImage3D)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data);
-GLAPI void APIENTRY GLAPI_PREFIX(CompressedTexSubImage1DARB)(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data);
-GLAPI void APIENTRY GLAPI_PREFIX(CompressedTexSubImage1D)(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data);
-GLAPI void APIENTRY GLAPI_PREFIX(CompressedTexSubImage2DARB)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data);
-GLAPI void APIENTRY GLAPI_PREFIX(CompressedTexSubImage2D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data);
-GLAPI void APIENTRY GLAPI_PREFIX(CompressedTexSubImage3DARB)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data);
-GLAPI void APIENTRY GLAPI_PREFIX(CompressedTexSubImage3D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data);
-GLAPI void APIENTRY GLAPI_PREFIX(GetCompressedTexImageARB)(GLenum target, GLint level, GLvoid *img);
-GLAPI void APIENTRY GLAPI_PREFIX(GetCompressedTexImage)(GLenum target, GLint level, GLvoid *img);
-GLAPI void APIENTRY GLAPI_PREFIX(DisableVertexAttribArrayARB)(GLuint index);
-GLAPI void APIENTRY GLAPI_PREFIX(DisableVertexAttribArray)(GLuint index);
-GLAPI void APIENTRY GLAPI_PREFIX(EnableVertexAttribArrayARB)(GLuint index);
-GLAPI void APIENTRY GLAPI_PREFIX(EnableVertexAttribArray)(GLuint index);
-GLAPI void APIENTRY GLAPI_PREFIX(GetProgramEnvParameterdvARB)(GLenum target, GLuint index, GLdouble *params);
-GLAPI void APIENTRY GLAPI_PREFIX(GetProgramEnvParameterfvARB)(GLenum target, GLuint index, GLfloat *params);
-GLAPI void APIENTRY GLAPI_PREFIX(GetProgramLocalParameterdvARB)(GLenum target, GLuint index, GLdouble *params);
-GLAPI void APIENTRY GLAPI_PREFIX(GetProgramLocalParameterfvARB)(GLenum target, GLuint index, GLfloat *params);
-GLAPI void APIENTRY GLAPI_PREFIX(GetProgramStringARB)(GLenum target, GLenum pname, GLvoid *string);
-GLAPI void APIENTRY GLAPI_PREFIX(GetProgramivARB)(GLenum target, GLenum pname, GLint *params);
-GLAPI void APIENTRY GLAPI_PREFIX(GetVertexAttribdvARB)(GLuint index, GLenum pname, GLdouble *params);
-GLAPI void APIENTRY GLAPI_PREFIX(GetVertexAttribdv)(GLuint index, GLenum pname, GLdouble *params);
-GLAPI void APIENTRY GLAPI_PREFIX(GetVertexAttribfvARB)(GLuint index, GLenum pname, GLfloat *params);
-GLAPI void APIENTRY GLAPI_PREFIX(GetVertexAttribfv)(GLuint index, GLenum pname, GLfloat *params);
-GLAPI void APIENTRY GLAPI_PREFIX(GetVertexAttribivARB)(GLuint index, GLenum pname, GLint *params);
-GLAPI void APIENTRY GLAPI_PREFIX(GetVertexAttribiv)(GLuint index, GLenum pname, GLint *params);
-GLAPI void APIENTRY GLAPI_PREFIX(ProgramEnvParameter4dARB)(GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
-GLAPI void APIENTRY GLAPI_PREFIX(ProgramParameter4dNV)(GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
-GLAPI void APIENTRY GLAPI_PREFIX(ProgramEnvParameter4dvARB)(GLenum target, GLuint index, const GLdouble *params);
-GLAPI void APIENTRY GLAPI_PREFIX(ProgramParameter4dvNV)(GLenum target, GLuint index, const GLdouble *params);
-GLAPI void APIENTRY GLAPI_PREFIX(ProgramEnvParameter4fARB)(GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-GLAPI void APIENTRY GLAPI_PREFIX(ProgramParameter4fNV)(GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-GLAPI void APIENTRY GLAPI_PREFIX(ProgramEnvParameter4fvARB)(GLenum target, GLuint index, const GLfloat *params);
-GLAPI void APIENTRY GLAPI_PREFIX(ProgramParameter4fvNV)(GLenum target, GLuint index, const GLfloat *params);
-GLAPI void APIENTRY GLAPI_PREFIX(ProgramLocalParameter4dARB)(GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
-GLAPI void APIENTRY GLAPI_PREFIX(ProgramLocalParameter4dvARB)(GLenum target, GLuint index, const GLdouble *params);
-GLAPI void APIENTRY GLAPI_PREFIX(ProgramLocalParameter4fARB)(GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-GLAPI void APIENTRY GLAPI_PREFIX(ProgramLocalParameter4fvARB)(GLenum target, GLuint index, const GLfloat *params);
-GLAPI void APIENTRY GLAPI_PREFIX(ProgramStringARB)(GLenum target, GLenum format, GLsizei len, const GLvoid *string);
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib1dARB)(GLuint index, GLdouble x);
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib1d)(GLuint index, GLdouble x);
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib1dvARB)(GLuint index, const GLdouble *v);
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib1dv)(GLuint index, const GLdouble *v);
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib1fARB)(GLuint index, GLfloat x);
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib1f)(GLuint index, GLfloat x);
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib1fvARB)(GLuint index, const GLfloat *v);
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib1fv)(GLuint index, const GLfloat *v);
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib1sARB)(GLuint index, GLshort x);
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib1s)(GLuint index, GLshort x);
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib1svARB)(GLuint index, const GLshort *v);
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib1sv)(GLuint index, const GLshort *v);
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib2dARB)(GLuint index, GLdouble x, GLdouble y);
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib2d)(GLuint index, GLdouble x, GLdouble y);
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib2dvARB)(GLuint index, const GLdouble *v);
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib2dv)(GLuint index, const GLdouble *v);
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib2fARB)(GLuint index, GLfloat x, GLfloat y);
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib2f)(GLuint index, GLfloat x, GLfloat y);
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib2fvARB)(GLuint index, const GLfloat *v);
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib2fv)(GLuint index, const GLfloat *v);
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib2sARB)(GLuint index, GLshort x, GLshort y);
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib2s)(GLuint index, GLshort x, GLshort y);
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib2svARB)(GLuint index, const GLshort *v);
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib2sv)(GLuint index, const GLshort *v);
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib3dARB)(GLuint index, GLdouble x, GLdouble y, GLdouble z);
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib3d)(GLuint index, GLdouble x, GLdouble y, GLdouble z);
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib3dvARB)(GLuint index, const GLdouble *v);
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib3dv)(GLuint index, const GLdouble *v);
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib3fARB)(GLuint index, GLfloat x, GLfloat y, GLfloat z);
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib3f)(GLuint index, GLfloat x, GLfloat y, GLfloat z);
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib3fvARB)(GLuint index, const GLfloat *v);
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib3fv)(GLuint index, const GLfloat *v);
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib3sARB)(GLuint index, GLshort x, GLshort y, GLshort z);
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib3s)(GLuint index, GLshort x, GLshort y, GLshort z);
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib3svARB)(GLuint index, const GLshort *v);
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib3sv)(GLuint index, const GLshort *v);
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib4NbvARB)(GLuint index, const GLbyte *v);
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib4Nbv)(GLuint index, const GLbyte *v);
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib4NivARB)(GLuint index, const GLint *v);
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib4Niv)(GLuint index, const GLint *v);
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib4NsvARB)(GLuint index, const GLshort *v);
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib4Nsv)(GLuint index, const GLshort *v);
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib4NubARB)(GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w);
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib4Nub)(GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w);
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib4NubvARB)(GLuint index, const GLubyte *v);
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib4Nubv)(GLuint index, const GLubyte *v);
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib4NuivARB)(GLuint index, const GLuint *v);
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib4Nuiv)(GLuint index, const GLuint *v);
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib4NusvARB)(GLuint index, const GLushort *v);
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib4Nusv)(GLuint index, const GLushort *v);
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib4bvARB)(GLuint index, const GLbyte *v);
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib4bv)(GLuint index, const GLbyte *v);
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib4dARB)(GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib4d)(GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib4dvARB)(GLuint index, const GLdouble *v);
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib4dv)(GLuint index, const GLdouble *v);
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib4fARB)(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib4f)(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib4fvARB)(GLuint index, const GLfloat *v);
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib4fv)(GLuint index, const GLfloat *v);
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib4ivARB)(GLuint index, const GLint *v);
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib4iv)(GLuint index, const GLint *v);
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib4sARB)(GLuint index, GLshort x, GLshort y, GLshort z, GLshort w);
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib4s)(GLuint index, GLshort x, GLshort y, GLshort z, GLshort w);
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib4svARB)(GLuint index, const GLshort *v);
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib4sv)(GLuint index, const GLshort *v);
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib4ubvARB)(GLuint index, const GLubyte *v);
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib4ubv)(GLuint index, const GLubyte *v);
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib4uivARB)(GLuint index, const GLuint *v);
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib4uiv)(GLuint index, const GLuint *v);
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib4usvARB)(GLuint index, const GLushort *v);
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib4usv)(GLuint index, const GLushort *v);
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribPointerARB)(GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *pointer);
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribPointer)(GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *pointer);
-GLAPI void APIENTRY GLAPI_PREFIX(BindBufferARB)(GLenum target, GLuint buffer);
-GLAPI void APIENTRY GLAPI_PREFIX(BindBuffer)(GLenum target, GLuint buffer);
-GLAPI void APIENTRY GLAPI_PREFIX(BufferDataARB)(GLenum target, GLsizeiptrARB size, const GLvoid *data, GLenum usage);
-GLAPI void APIENTRY GLAPI_PREFIX(BufferData)(GLenum target, GLsizeiptr size, const GLvoid *data, GLenum usage);
-GLAPI void APIENTRY GLAPI_PREFIX(BufferSubDataARB)(GLenum target, GLintptrARB offset, GLsizeiptrARB size, const GLvoid *data);
-GLAPI void APIENTRY GLAPI_PREFIX(BufferSubData)(GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid *data);
-GLAPI void APIENTRY GLAPI_PREFIX(DeleteBuffersARB)(GLsizei n, const GLuint *buffer);
-GLAPI void APIENTRY GLAPI_PREFIX(DeleteBuffers)(GLsizei n, const GLuint *buffer);
-GLAPI void APIENTRY GLAPI_PREFIX(GenBuffersARB)(GLsizei n, GLuint *buffer);
-GLAPI void APIENTRY GLAPI_PREFIX(GenBuffers)(GLsizei n, GLuint *buffer);
-GLAPI void APIENTRY GLAPI_PREFIX(GetBufferParameterivARB)(GLenum target, GLenum pname, GLint *params);
-GLAPI void APIENTRY GLAPI_PREFIX(GetBufferParameteriv)(GLenum target, GLenum pname, GLint *params);
-GLAPI void APIENTRY GLAPI_PREFIX(GetBufferPointervARB)(GLenum target, GLenum pname, GLvoid **params);
-GLAPI void APIENTRY GLAPI_PREFIX(GetBufferPointerv)(GLenum target, GLenum pname, GLvoid **params);
-GLAPI void APIENTRY GLAPI_PREFIX(GetBufferSubDataARB)(GLenum target, GLintptrARB offset, GLsizeiptrARB size, GLvoid *data);
-GLAPI void APIENTRY GLAPI_PREFIX(GetBufferSubData)(GLenum target, GLintptr offset, GLsizeiptr size, GLvoid *data);
-GLAPI GLboolean APIENTRY GLAPI_PREFIX(IsBufferARB)(GLuint buffer);
-GLAPI GLboolean APIENTRY GLAPI_PREFIX(IsBuffer)(GLuint buffer);
-GLAPI GLvoid * APIENTRY GLAPI_PREFIX(MapBufferARB)(GLenum target, GLenum access);
-GLAPI GLvoid * APIENTRY GLAPI_PREFIX(MapBuffer)(GLenum target, GLenum access);
-GLAPI GLboolean APIENTRY GLAPI_PREFIX(UnmapBufferARB)(GLenum target);
-GLAPI GLboolean APIENTRY GLAPI_PREFIX(UnmapBuffer)(GLenum target);
-GLAPI void APIENTRY GLAPI_PREFIX(BeginQueryARB)(GLenum target, GLuint id);
-GLAPI void APIENTRY GLAPI_PREFIX(BeginQuery)(GLenum target, GLuint id);
-GLAPI void APIENTRY GLAPI_PREFIX(DeleteQueriesARB)(GLsizei n, const GLuint *ids);
-GLAPI void APIENTRY GLAPI_PREFIX(DeleteQueries)(GLsizei n, const GLuint *ids);
-GLAPI void APIENTRY GLAPI_PREFIX(EndQueryARB)(GLenum target);
-GLAPI void APIENTRY GLAPI_PREFIX(EndQuery)(GLenum target);
-GLAPI void APIENTRY GLAPI_PREFIX(GenQueriesARB)(GLsizei n, GLuint *ids);
-GLAPI void APIENTRY GLAPI_PREFIX(GenQueries)(GLsizei n, GLuint *ids);
-GLAPI void APIENTRY GLAPI_PREFIX(GetQueryObjectivARB)(GLuint id, GLenum pname, GLint *params);
-GLAPI void APIENTRY GLAPI_PREFIX(GetQueryObjectiv)(GLuint id, GLenum pname, GLint *params);
-GLAPI void APIENTRY GLAPI_PREFIX(GetQueryObjectuivARB)(GLuint id, GLenum pname, GLuint *params);
-GLAPI void APIENTRY GLAPI_PREFIX(GetQueryObjectuiv)(GLuint id, GLenum pname, GLuint *params);
-GLAPI void APIENTRY GLAPI_PREFIX(GetQueryivARB)(GLenum target, GLenum pname, GLint *params);
-GLAPI void APIENTRY GLAPI_PREFIX(GetQueryiv)(GLenum target, GLenum pname, GLint *params);
-GLAPI GLboolean APIENTRY GLAPI_PREFIX(IsQueryARB)(GLuint id);
-GLAPI GLboolean APIENTRY GLAPI_PREFIX(IsQuery)(GLuint id);
-GLAPI void APIENTRY GLAPI_PREFIX(AttachObjectARB)(GLhandleARB containerObj, GLhandleARB obj);
-GLAPI void APIENTRY GLAPI_PREFIX(CompileShaderARB)(GLhandleARB shader);
-GLAPI void APIENTRY GLAPI_PREFIX(CompileShader)(GLuint shader);
-GLAPI GLhandleARB APIENTRY GLAPI_PREFIX(CreateProgramObjectARB)(void);
-GLAPI GLhandleARB APIENTRY GLAPI_PREFIX(CreateShaderObjectARB)(GLenum shaderType);
-GLAPI void APIENTRY GLAPI_PREFIX(DeleteObjectARB)(GLhandleARB obj);
-GLAPI void APIENTRY GLAPI_PREFIX(DetachObjectARB)(GLhandleARB containerObj, GLhandleARB attachedObj);
-GLAPI void APIENTRY GLAPI_PREFIX(GetActiveUniformARB)(GLhandleARB program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLcharARB *name);
-GLAPI void APIENTRY GLAPI_PREFIX(GetActiveUniform)(GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name);
-GLAPI void APIENTRY GLAPI_PREFIX(GetAttachedObjectsARB)(GLhandleARB containerObj, GLsizei maxLength, GLsizei *length, GLhandleARB *infoLog);
-GLAPI GLhandleARB APIENTRY GLAPI_PREFIX(GetHandleARB)(GLenum pname);
-GLAPI void APIENTRY GLAPI_PREFIX(GetInfoLogARB)(GLhandleARB obj, GLsizei maxLength, GLsizei *length, GLcharARB *infoLog);
-GLAPI void APIENTRY GLAPI_PREFIX(GetObjectParameterfvARB)(GLhandleARB obj, GLenum pname, GLfloat *params);
-GLAPI void APIENTRY GLAPI_PREFIX(GetObjectParameterivARB)(GLhandleARB obj, GLenum pname, GLint *params);
-GLAPI void APIENTRY GLAPI_PREFIX(GetShaderSourceARB)(GLhandleARB shader, GLsizei bufSize, GLsizei *length, GLcharARB *source);
-GLAPI void APIENTRY GLAPI_PREFIX(GetShaderSource)(GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *source);
-GLAPI GLint APIENTRY GLAPI_PREFIX(GetUniformLocationARB)(GLhandleARB program, const GLcharARB *name);
-GLAPI GLint APIENTRY GLAPI_PREFIX(GetUniformLocation)(GLuint program, const GLchar *name);
-GLAPI void APIENTRY GLAPI_PREFIX(GetUniformfvARB)(GLhandleARB program, GLint location, GLfloat *params);
-GLAPI void APIENTRY GLAPI_PREFIX(GetUniformfv)(GLuint program, GLint location, GLfloat *params);
-GLAPI void APIENTRY GLAPI_PREFIX(GetUniformivARB)(GLhandleARB program, GLint location, GLint *params);
-GLAPI void APIENTRY GLAPI_PREFIX(GetUniformiv)(GLuint program, GLint location, GLint *params);
-GLAPI void APIENTRY GLAPI_PREFIX(LinkProgramARB)(GLhandleARB program);
-GLAPI void APIENTRY GLAPI_PREFIX(LinkProgram)(GLuint program);
-GLAPI void APIENTRY GLAPI_PREFIX(ShaderSourceARB)(GLhandleARB shader, GLsizei count, const GLcharARB **string, const GLint *length);
-GLAPI void APIENTRY GLAPI_PREFIX(ShaderSource)(GLuint shader, GLsizei count, const GLchar **string, const GLint *length);
-GLAPI void APIENTRY GLAPI_PREFIX(Uniform1fARB)(GLint location, GLfloat v0);
-GLAPI void APIENTRY GLAPI_PREFIX(Uniform1f)(GLint location, GLfloat v0);
-GLAPI void APIENTRY GLAPI_PREFIX(Uniform1fvARB)(GLint location, GLsizei count, const GLfloat *value);
-GLAPI void APIENTRY GLAPI_PREFIX(Uniform1fv)(GLint location, GLsizei count, const GLfloat *value);
-GLAPI void APIENTRY GLAPI_PREFIX(Uniform1iARB)(GLint location, GLint v0);
-GLAPI void APIENTRY GLAPI_PREFIX(Uniform1i)(GLint location, GLint v0);
-GLAPI void APIENTRY GLAPI_PREFIX(Uniform1ivARB)(GLint location, GLsizei count, const GLint *value);
-GLAPI void APIENTRY GLAPI_PREFIX(Uniform1iv)(GLint location, GLsizei count, const GLint *value);
-GLAPI void APIENTRY GLAPI_PREFIX(Uniform2fARB)(GLint location, GLfloat v0, GLfloat v1);
-GLAPI void APIENTRY GLAPI_PREFIX(Uniform2f)(GLint location, GLfloat v0, GLfloat v1);
-GLAPI void APIENTRY GLAPI_PREFIX(Uniform2fvARB)(GLint location, GLsizei count, const GLfloat *value);
-GLAPI void APIENTRY GLAPI_PREFIX(Uniform2fv)(GLint location, GLsizei count, const GLfloat *value);
-GLAPI void APIENTRY GLAPI_PREFIX(Uniform2iARB)(GLint location, GLint v0, GLint v1);
-GLAPI void APIENTRY GLAPI_PREFIX(Uniform2i)(GLint location, GLint v0, GLint v1);
-GLAPI void APIENTRY GLAPI_PREFIX(Uniform2ivARB)(GLint location, GLsizei count, const GLint *value);
-GLAPI void APIENTRY GLAPI_PREFIX(Uniform2iv)(GLint location, GLsizei count, const GLint *value);
-GLAPI void APIENTRY GLAPI_PREFIX(Uniform3fARB)(GLint location, GLfloat v0, GLfloat v1, GLfloat v2);
-GLAPI void APIENTRY GLAPI_PREFIX(Uniform3f)(GLint location, GLfloat v0, GLfloat v1, GLfloat v2);
-GLAPI void APIENTRY GLAPI_PREFIX(Uniform3fvARB)(GLint location, GLsizei count, const GLfloat *value);
-GLAPI void APIENTRY GLAPI_PREFIX(Uniform3fv)(GLint location, GLsizei count, const GLfloat *value);
-GLAPI void APIENTRY GLAPI_PREFIX(Uniform3iARB)(GLint location, GLint v0, GLint v1, GLint v2);
-GLAPI void APIENTRY GLAPI_PREFIX(Uniform3i)(GLint location, GLint v0, GLint v1, GLint v2);
-GLAPI void APIENTRY GLAPI_PREFIX(Uniform3ivARB)(GLint location, GLsizei count, const GLint *value);
-GLAPI void APIENTRY GLAPI_PREFIX(Uniform3iv)(GLint location, GLsizei count, const GLint *value);
-GLAPI void APIENTRY GLAPI_PREFIX(Uniform4fARB)(GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);
-GLAPI void APIENTRY GLAPI_PREFIX(Uniform4f)(GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);
-GLAPI void APIENTRY GLAPI_PREFIX(Uniform4fvARB)(GLint location, GLsizei count, const GLfloat *value);
-GLAPI void APIENTRY GLAPI_PREFIX(Uniform4fv)(GLint location, GLsizei count, const GLfloat *value);
-GLAPI void APIENTRY GLAPI_PREFIX(Uniform4iARB)(GLint location, GLint v0, GLint v1, GLint v2, GLint v3);
-GLAPI void APIENTRY GLAPI_PREFIX(Uniform4i)(GLint location, GLint v0, GLint v1, GLint v2, GLint v3);
-GLAPI void APIENTRY GLAPI_PREFIX(Uniform4ivARB)(GLint location, GLsizei count, const GLint *value);
-GLAPI void APIENTRY GLAPI_PREFIX(Uniform4iv)(GLint location, GLsizei count, const GLint *value);
-GLAPI void APIENTRY GLAPI_PREFIX(UniformMatrix2fvARB)(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-GLAPI void APIENTRY GLAPI_PREFIX(UniformMatrix2fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-GLAPI void APIENTRY GLAPI_PREFIX(UniformMatrix3fvARB)(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-GLAPI void APIENTRY GLAPI_PREFIX(UniformMatrix3fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-GLAPI void APIENTRY GLAPI_PREFIX(UniformMatrix4fvARB)(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-GLAPI void APIENTRY GLAPI_PREFIX(UniformMatrix4fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-GLAPI void APIENTRY GLAPI_PREFIX(UseProgramObjectARB)(GLhandleARB program);
-GLAPI void APIENTRY GLAPI_PREFIX(UseProgram)(GLuint program);
-GLAPI void APIENTRY GLAPI_PREFIX(ValidateProgramARB)(GLhandleARB program);
-GLAPI void APIENTRY GLAPI_PREFIX(ValidateProgram)(GLuint program);
-GLAPI void APIENTRY GLAPI_PREFIX(BindAttribLocationARB)(GLhandleARB program, GLuint index, const GLcharARB *name);
-GLAPI void APIENTRY GLAPI_PREFIX(BindAttribLocation)(GLuint program, GLuint index, const GLchar *name);
-GLAPI void APIENTRY GLAPI_PREFIX(GetActiveAttribARB)(GLhandleARB program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLcharARB *name);
-GLAPI void APIENTRY GLAPI_PREFIX(GetActiveAttrib)(GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name);
-GLAPI GLint APIENTRY GLAPI_PREFIX(GetAttribLocationARB)(GLhandleARB program, const GLcharARB *name);
-GLAPI GLint APIENTRY GLAPI_PREFIX(GetAttribLocation)(GLuint program, const GLchar *name);
-GLAPI void APIENTRY GLAPI_PREFIX(DrawBuffersARB)(GLsizei n, const GLenum *bufs);
-GLAPI void APIENTRY GLAPI_PREFIX(DrawBuffers)(GLsizei n, const GLenum *bufs);
-GLAPI void APIENTRY GLAPI_PREFIX(DrawBuffersATI)(GLsizei n, const GLenum *bufs);
-GLAPI void APIENTRY GLAPI_PREFIX(ClampColorARB)(GLenum target, GLenum clamp);
-GLAPI void APIENTRY GLAPI_PREFIX(DrawArraysInstancedARB)(GLenum mode, GLint first, GLsizei count, GLsizei primcount);
-GLAPI void APIENTRY GLAPI_PREFIX(DrawArraysInstanced)(GLenum mode, GLint first, GLsizei count, GLsizei primcount);
-GLAPI void APIENTRY GLAPI_PREFIX(DrawArraysInstancedEXT)(GLenum mode, GLint first, GLsizei count, GLsizei primcount);
-GLAPI void APIENTRY GLAPI_PREFIX(DrawElementsInstancedARB)(GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount);
-GLAPI void APIENTRY GLAPI_PREFIX(DrawElementsInstanced)(GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount);
-GLAPI void APIENTRY GLAPI_PREFIX(DrawElementsInstancedEXT)(GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount);
-GLAPI void APIENTRY GLAPI_PREFIX(RenderbufferStorageMultisample)(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
-GLAPI void APIENTRY GLAPI_PREFIX(RenderbufferStorageMultisampleEXT)(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
-GLAPI void APIENTRY GLAPI_PREFIX(FramebufferTextureARB)(GLenum target, GLenum attachment, GLuint texture, GLint level);
-GLAPI void APIENTRY GLAPI_PREFIX(FramebufferTextureFaceARB)(GLenum target, GLenum attachment, GLuint texture, GLint level, GLenum face);
-GLAPI void APIENTRY GLAPI_PREFIX(ProgramParameteriARB)(GLuint program, GLenum pname, GLint value);
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribDivisorARB)(GLuint index, GLuint divisor);
-GLAPI void APIENTRY GLAPI_PREFIX(FlushMappedBufferRange)(GLenum target, GLintptr offset, GLsizeiptr length);
-GLAPI GLvoid * APIENTRY GLAPI_PREFIX(MapBufferRange)(GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access);
-GLAPI void APIENTRY GLAPI_PREFIX(TexBufferARB)(GLenum target, GLenum internalFormat, GLuint buffer);
-GLAPI void APIENTRY GLAPI_PREFIX(BindVertexArray)(GLuint array);
-GLAPI void APIENTRY GLAPI_PREFIX(GenVertexArrays)(GLsizei n, GLuint *arrays);
-GLAPI void APIENTRY GLAPI_PREFIX(CopyBufferSubData)(GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size);
-GLAPI GLenum APIENTRY GLAPI_PREFIX(ClientWaitSync)(GLsync sync, GLbitfield flags, GLuint64 timeout);
-GLAPI void APIENTRY GLAPI_PREFIX(DeleteSync)(GLsync sync);
-GLAPI GLsync APIENTRY GLAPI_PREFIX(FenceSync)(GLenum condition, GLbitfield flags);
-GLAPI void APIENTRY GLAPI_PREFIX(GetInteger64v)(GLenum pname, GLint64 *params);
-GLAPI void APIENTRY GLAPI_PREFIX(GetSynciv)(GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values);
-GLAPI GLboolean APIENTRY GLAPI_PREFIX(IsSync)(GLsync sync);
-GLAPI void APIENTRY GLAPI_PREFIX(WaitSync)(GLsync sync, GLbitfield flags, GLuint64 timeout);
-GLAPI void APIENTRY GLAPI_PREFIX(DrawElementsBaseVertex)(GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLint basevertex);
-GLAPI void APIENTRY GLAPI_PREFIX(DrawRangeElementsBaseVertex)(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices, GLint basevertex);
-GLAPI void APIENTRY GLAPI_PREFIX(MultiDrawElementsBaseVertex)(GLenum mode, const GLsizei *count, GLenum type, const GLvoid **indices, GLsizei primcount, const GLint *basevertex);
-GLAPI void APIENTRY GLAPI_PREFIX(BlendEquationSeparateiARB)(GLuint buf, GLenum modeRGB, GLenum modeA);
-GLAPI void APIENTRY GLAPI_PREFIX(BlendEquationSeparateIndexedAMD)(GLuint buf, GLenum modeRGB, GLenum modeA);
-GLAPI void APIENTRY GLAPI_PREFIX(BlendEquationiARB)(GLuint buf, GLenum mode);
-GLAPI void APIENTRY GLAPI_PREFIX(BlendEquationIndexedAMD)(GLuint buf, GLenum mode);
-GLAPI void APIENTRY GLAPI_PREFIX(BlendFuncSeparateiARB)(GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcA, GLenum dstA);
-GLAPI void APIENTRY GLAPI_PREFIX(BlendFuncSeparateIndexedAMD)(GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcA, GLenum dstA);
-GLAPI void APIENTRY GLAPI_PREFIX(BlendFunciARB)(GLuint buf, GLenum src, GLenum dst);
-GLAPI void APIENTRY GLAPI_PREFIX(BlendFuncIndexedAMD)(GLuint buf, GLenum src, GLenum dst);
-GLAPI void APIENTRY GLAPI_PREFIX(BindSampler)(GLuint unit, GLuint sampler);
-GLAPI void APIENTRY GLAPI_PREFIX(DeleteSamplers)(GLsizei count, const GLuint *samplers);
-GLAPI void APIENTRY GLAPI_PREFIX(GenSamplers)(GLsizei count, GLuint *samplers);
-GLAPI void APIENTRY GLAPI_PREFIX(GetSamplerParameterIiv)(GLuint sampler, GLenum pname, GLint *params);
-GLAPI void APIENTRY GLAPI_PREFIX(GetSamplerParameterIuiv)(GLuint sampler, GLenum pname, GLuint *params);
-GLAPI void APIENTRY GLAPI_PREFIX(GetSamplerParameterfv)(GLuint sampler, GLenum pname, GLfloat *params);
-GLAPI void APIENTRY GLAPI_PREFIX(GetSamplerParameteriv)(GLuint sampler, GLenum pname, GLint *params);
-GLAPI GLboolean APIENTRY GLAPI_PREFIX(IsSampler)(GLuint sampler);
-GLAPI void APIENTRY GLAPI_PREFIX(SamplerParameterIiv)(GLuint sampler, GLenum pname, const GLint *params);
-GLAPI void APIENTRY GLAPI_PREFIX(SamplerParameterIuiv)(GLuint sampler, GLenum pname, const GLuint *params);
-GLAPI void APIENTRY GLAPI_PREFIX(SamplerParameterf)(GLuint sampler, GLenum pname, GLfloat param);
-GLAPI void APIENTRY GLAPI_PREFIX(SamplerParameterfv)(GLuint sampler, GLenum pname, const GLfloat *params);
-GLAPI void APIENTRY GLAPI_PREFIX(SamplerParameteri)(GLuint sampler, GLenum pname, GLint param);
-GLAPI void APIENTRY GLAPI_PREFIX(SamplerParameteriv)(GLuint sampler, GLenum pname, const GLint *params);
-GLAPI void APIENTRY GLAPI_PREFIX(BindTransformFeedback)(GLenum target, GLuint id);
-GLAPI void APIENTRY GLAPI_PREFIX(DeleteTransformFeedbacks)(GLsizei n, const GLuint *ids);
-GLAPI void APIENTRY GLAPI_PREFIX(DrawTransformFeedback)(GLenum mode, GLuint id);
-GLAPI void APIENTRY GLAPI_PREFIX(GenTransformFeedbacks)(GLsizei n, GLuint *ids);
-GLAPI GLboolean APIENTRY GLAPI_PREFIX(IsTransformFeedback)(GLuint id);
-GLAPI void APIENTRY GLAPI_PREFIX(PauseTransformFeedback)(void);
-GLAPI void APIENTRY GLAPI_PREFIX(ResumeTransformFeedback)(void);
-GLAPI void APIENTRY GLAPI_PREFIX(ClearDepthf)(GLclampf depth);
-GLAPI void APIENTRY GLAPI_PREFIX(DepthRangef)(GLclampf zNear, GLclampf zFar);
-GLAPI void APIENTRY GLAPI_PREFIX(GetShaderPrecisionFormat)(GLenum shadertype, GLenum precisiontype, GLint *range, GLint *precision);
-GLAPI void APIENTRY GLAPI_PREFIX(ReleaseShaderCompiler)(void);
-GLAPI void APIENTRY GLAPI_PREFIX(ShaderBinary)(GLsizei n, const GLuint *shaders, GLenum binaryformat, const GLvoid *binary, GLsizei length);
-void APIENTRY GLAPI_PREFIX(_dispatch_stub_626)(GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, GLvoid *binary);
-void APIENTRY GLAPI_PREFIX(_dispatch_stub_627)(GLuint program, GLenum binaryFormat, const GLvoid *binary, GLsizei length);
-void APIENTRY GLAPI_PREFIX(_dispatch_stub_628)(GLuint program, GLenum pname, GLint value);
-GLAPI GLenum APIENTRY GLAPI_PREFIX(GetGraphicsResetStatusARB)(void);
-GLAPI void APIENTRY GLAPI_PREFIX(GetnColorTableARB)(GLenum target, GLenum format, GLenum type, GLsizei bufSize, GLvoid *table);
-GLAPI void APIENTRY GLAPI_PREFIX(GetnCompressedTexImageARB)(GLenum target, GLint lod, GLsizei bufSize, GLvoid *img);
-GLAPI void APIENTRY GLAPI_PREFIX(GetnConvolutionFilterARB)(GLenum target, GLenum format, GLenum type, GLsizei bufSize, GLvoid *image);
-GLAPI void APIENTRY GLAPI_PREFIX(GetnHistogramARB)(GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, GLvoid *values);
-GLAPI void APIENTRY GLAPI_PREFIX(GetnMapdvARB)(GLenum target, GLenum query, GLsizei bufSize, GLdouble *v);
-GLAPI void APIENTRY GLAPI_PREFIX(GetnMapfvARB)(GLenum target, GLenum query, GLsizei bufSize, GLfloat *v);
-GLAPI void APIENTRY GLAPI_PREFIX(GetnMapivARB)(GLenum target, GLenum query, GLsizei bufSize, GLint *v);
-GLAPI void APIENTRY GLAPI_PREFIX(GetnMinmaxARB)(GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, GLvoid *values);
-GLAPI void APIENTRY GLAPI_PREFIX(GetnPixelMapfvARB)(GLenum map, GLsizei bufSize, GLfloat *values);
-GLAPI void APIENTRY GLAPI_PREFIX(GetnPixelMapuivARB)(GLenum map, GLsizei bufSize, GLuint *values);
-GLAPI void APIENTRY GLAPI_PREFIX(GetnPixelMapusvARB)(GLenum map, GLsizei bufSize, GLushort *values);
-GLAPI void APIENTRY GLAPI_PREFIX(GetnPolygonStippleARB)(GLsizei bufSize, GLubyte *pattern);
-GLAPI void APIENTRY GLAPI_PREFIX(GetnSeparableFilterARB)(GLenum target, GLenum format, GLenum type, GLsizei rowBufSize, GLvoid *row, GLsizei columnBufSize, GLvoid *column, GLvoid *span);
-GLAPI void APIENTRY GLAPI_PREFIX(GetnTexImageARB)(GLenum target, GLint level, GLenum format, GLenum type, GLsizei bufSize, GLvoid *img);
-GLAPI void APIENTRY GLAPI_PREFIX(GetnUniformdvARB)(GLhandleARB program, GLint location, GLsizei bufSize, GLdouble *params);
-GLAPI void APIENTRY GLAPI_PREFIX(GetnUniformfvARB)(GLhandleARB program, GLint location, GLsizei bufSize, GLfloat *params);
-GLAPI void APIENTRY GLAPI_PREFIX(GetnUniformivARB)(GLhandleARB program, GLint location, GLsizei bufSize, GLint *params);
-GLAPI void APIENTRY GLAPI_PREFIX(GetnUniformuivARB)(GLhandleARB program, GLint location, GLsizei bufSize, GLuint *params);
-GLAPI void APIENTRY GLAPI_PREFIX(ReadnPixelsARB)(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, GLvoid *data);
-GLAPI void APIENTRY GLAPI_PREFIX(PolygonOffsetEXT)(GLfloat factor, GLfloat bias);
-void APIENTRY GLAPI_PREFIX(_dispatch_stub_650)(GLfloat x, GLfloat y, GLfloat z, GLfloat width, GLfloat height);
-void APIENTRY GLAPI_PREFIX(_dispatch_stub_651)(const GLfloat *coords);
-void APIENTRY GLAPI_PREFIX(_dispatch_stub_652)(GLint x, GLint y, GLint z, GLint width, GLint height);
-void APIENTRY GLAPI_PREFIX(_dispatch_stub_653)(const GLint *coords);
-void APIENTRY GLAPI_PREFIX(_dispatch_stub_654)(GLshort x, GLshort y, GLshort z, GLshort width, GLshort height);
-void APIENTRY GLAPI_PREFIX(_dispatch_stub_655)(const GLshort *coords);
-void APIENTRY GLAPI_PREFIX(_dispatch_stub_656)(GLfixed x, GLfixed y, GLfixed z, GLfixed width, GLfixed height);
-void APIENTRY GLAPI_PREFIX(_dispatch_stub_657)(const GLfixed *coords);
-void APIENTRY GLAPI_PREFIX(_dispatch_stub_658)(GLenum type, GLsizei stride, const GLvoid *pointer);
-void APIENTRY GLAPI_PREFIX(_dispatch_stub_659)(GLenum pname, GLfloat *params);
-void APIENTRY GLAPI_PREFIX(_dispatch_stub_660)(GLenum pname, GLint *params);
-void APIENTRY GLAPI_PREFIX(_dispatch_stub_661)(GLenum pname, GLfloat param);
-void APIENTRY GLAPI_PREFIX(_dispatch_stub_662)(GLenum pname, const GLfloat *params);
-void APIENTRY GLAPI_PREFIX(_dispatch_stub_663)(GLenum pname, GLint param);
-void APIENTRY GLAPI_PREFIX(_dispatch_stub_664)(GLenum pname, const GLint *params);
-GLbitfield APIENTRY GLAPI_PREFIX(_dispatch_stub_665)(GLfixed *mantissa, GLint *exponent);
-void APIENTRY GLAPI_PREFIX(_dispatch_stub_666)(GLclampf value, GLboolean invert);
-void APIENTRY GLAPI_PREFIX(_dispatch_stub_667)(GLenum pattern);
-GLAPI void APIENTRY GLAPI_PREFIX(ColorPointerEXT)(GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer);
-GLAPI void APIENTRY GLAPI_PREFIX(EdgeFlagPointerEXT)(GLsizei stride, GLsizei count, const GLboolean *pointer);
-GLAPI void APIENTRY GLAPI_PREFIX(IndexPointerEXT)(GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer);
-GLAPI void APIENTRY GLAPI_PREFIX(NormalPointerEXT)(GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer);
-GLAPI void APIENTRY GLAPI_PREFIX(TexCoordPointerEXT)(GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer);
-GLAPI void APIENTRY GLAPI_PREFIX(VertexPointerEXT)(GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer);
-GLAPI void APIENTRY GLAPI_PREFIX(PointParameterfEXT)(GLenum pname, GLfloat param);
-GLAPI void APIENTRY GLAPI_PREFIX(PointParameterf)(GLenum pname, GLfloat param);
-GLAPI void APIENTRY GLAPI_PREFIX(PointParameterfARB)(GLenum pname, GLfloat param);
-GLAPI void APIENTRY GLAPI_PREFIX(PointParameterfvEXT)(GLenum pname, const GLfloat *params);
-GLAPI void APIENTRY GLAPI_PREFIX(PointParameterfv)(GLenum pname, const GLfloat *params);
-GLAPI void APIENTRY GLAPI_PREFIX(PointParameterfvARB)(GLenum pname, const GLfloat *params);
-GLAPI void APIENTRY GLAPI_PREFIX(LockArraysEXT)(GLint first, GLsizei count);
-GLAPI void APIENTRY GLAPI_PREFIX(UnlockArraysEXT)(void);
-GLAPI void APIENTRY GLAPI_PREFIX(SecondaryColor3bEXT)(GLbyte red, GLbyte green, GLbyte blue);
-GLAPI void APIENTRY GLAPI_PREFIX(SecondaryColor3b)(GLbyte red, GLbyte green, GLbyte blue);
-GLAPI void APIENTRY GLAPI_PREFIX(SecondaryColor3bvEXT)(const GLbyte *v);
-GLAPI void APIENTRY GLAPI_PREFIX(SecondaryColor3bv)(const GLbyte *v);
-GLAPI void APIENTRY GLAPI_PREFIX(SecondaryColor3dEXT)(GLdouble red, GLdouble green, GLdouble blue);
-GLAPI void APIENTRY GLAPI_PREFIX(SecondaryColor3d)(GLdouble red, GLdouble green, GLdouble blue);
-GLAPI void APIENTRY GLAPI_PREFIX(SecondaryColor3dvEXT)(const GLdouble *v);
-GLAPI void APIENTRY GLAPI_PREFIX(SecondaryColor3dv)(const GLdouble *v);
-GLAPI void APIENTRY GLAPI_PREFIX(SecondaryColor3fEXT)(GLfloat red, GLfloat green, GLfloat blue);
-GLAPI void APIENTRY GLAPI_PREFIX(SecondaryColor3f)(GLfloat red, GLfloat green, GLfloat blue);
-GLAPI void APIENTRY GLAPI_PREFIX(SecondaryColor3fvEXT)(const GLfloat *v);
-GLAPI void APIENTRY GLAPI_PREFIX(SecondaryColor3fv)(const GLfloat *v);
-GLAPI void APIENTRY GLAPI_PREFIX(SecondaryColor3iEXT)(GLint red, GLint green, GLint blue);
-GLAPI void APIENTRY GLAPI_PREFIX(SecondaryColor3i)(GLint red, GLint green, GLint blue);
-GLAPI void APIENTRY GLAPI_PREFIX(SecondaryColor3ivEXT)(const GLint *v);
-GLAPI void APIENTRY GLAPI_PREFIX(SecondaryColor3iv)(const GLint *v);
-GLAPI void APIENTRY GLAPI_PREFIX(SecondaryColor3sEXT)(GLshort red, GLshort green, GLshort blue);
-GLAPI void APIENTRY GLAPI_PREFIX(SecondaryColor3s)(GLshort red, GLshort green, GLshort blue);
-GLAPI void APIENTRY GLAPI_PREFIX(SecondaryColor3svEXT)(const GLshort *v);
-GLAPI void APIENTRY GLAPI_PREFIX(SecondaryColor3sv)(const GLshort *v);
-GLAPI void APIENTRY GLAPI_PREFIX(SecondaryColor3ubEXT)(GLubyte red, GLubyte green, GLubyte blue);
-GLAPI void APIENTRY GLAPI_PREFIX(SecondaryColor3ub)(GLubyte red, GLubyte green, GLubyte blue);
-GLAPI void APIENTRY GLAPI_PREFIX(SecondaryColor3ubvEXT)(const GLubyte *v);
-GLAPI void APIENTRY GLAPI_PREFIX(SecondaryColor3ubv)(const GLubyte *v);
-GLAPI void APIENTRY GLAPI_PREFIX(SecondaryColor3uiEXT)(GLuint red, GLuint green, GLuint blue);
-GLAPI void APIENTRY GLAPI_PREFIX(SecondaryColor3ui)(GLuint red, GLuint green, GLuint blue);
-GLAPI void APIENTRY GLAPI_PREFIX(SecondaryColor3uivEXT)(const GLuint *v);
-GLAPI void APIENTRY GLAPI_PREFIX(SecondaryColor3uiv)(const GLuint *v);
-GLAPI void APIENTRY GLAPI_PREFIX(SecondaryColor3usEXT)(GLushort red, GLushort green, GLushort blue);
-GLAPI void APIENTRY GLAPI_PREFIX(SecondaryColor3us)(GLushort red, GLushort green, GLushort blue);
-GLAPI void APIENTRY GLAPI_PREFIX(SecondaryColor3usvEXT)(const GLushort *v);
-GLAPI void APIENTRY GLAPI_PREFIX(SecondaryColor3usv)(const GLushort *v);
-GLAPI void APIENTRY GLAPI_PREFIX(SecondaryColorPointerEXT)(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
-GLAPI void APIENTRY GLAPI_PREFIX(SecondaryColorPointer)(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
-GLAPI void APIENTRY GLAPI_PREFIX(MultiDrawArraysEXT)(GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount);
-GLAPI void APIENTRY GLAPI_PREFIX(MultiDrawArrays)(GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount);
-GLAPI void APIENTRY GLAPI_PREFIX(MultiDrawElementsEXT)(GLenum mode, const GLsizei *count, GLenum type, const GLvoid **indices, GLsizei primcount);
-GLAPI void APIENTRY GLAPI_PREFIX(MultiDrawElements)(GLenum mode, const GLsizei *count, GLenum type, const GLvoid **indices, GLsizei primcount);
-GLAPI void APIENTRY GLAPI_PREFIX(FogCoordPointerEXT)(GLenum type, GLsizei stride, const GLvoid *pointer);
-GLAPI void APIENTRY GLAPI_PREFIX(FogCoordPointer)(GLenum type, GLsizei stride, const GLvoid *pointer);
-GLAPI void APIENTRY GLAPI_PREFIX(FogCoorddEXT)(GLdouble coord);
-GLAPI void APIENTRY GLAPI_PREFIX(FogCoordd)(GLdouble coord);
-GLAPI void APIENTRY GLAPI_PREFIX(FogCoorddvEXT)(const GLdouble *coord);
-GLAPI void APIENTRY GLAPI_PREFIX(FogCoorddv)(const GLdouble *coord);
-GLAPI void APIENTRY GLAPI_PREFIX(FogCoordfEXT)(GLfloat coord);
-GLAPI void APIENTRY GLAPI_PREFIX(FogCoordf)(GLfloat coord);
-GLAPI void APIENTRY GLAPI_PREFIX(FogCoordfvEXT)(const GLfloat *coord);
-GLAPI void APIENTRY GLAPI_PREFIX(FogCoordfv)(const GLfloat *coord);
-void APIENTRY GLAPI_PREFIX(_dispatch_stub_702)(GLenum mode);
-GLAPI void APIENTRY GLAPI_PREFIX(BlendFuncSeparateEXT)(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha);
-GLAPI void APIENTRY GLAPI_PREFIX(BlendFuncSeparate)(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha);
-GLAPI void APIENTRY GLAPI_PREFIX(FlushVertexArrayRangeNV)(void);
-GLAPI void APIENTRY GLAPI_PREFIX(VertexArrayRangeNV)(GLsizei length, const GLvoid *pointer);
-GLAPI void APIENTRY GLAPI_PREFIX(CombinerInputNV)(GLenum stage, GLenum portion, GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage);
-GLAPI void APIENTRY GLAPI_PREFIX(CombinerOutputNV)(GLenum stage, GLenum portion, GLenum abOutput, GLenum cdOutput, GLenum sumOutput, GLenum scale, GLenum bias, GLboolean abDotProduct, GLboolean cdDotProduct, GLboolean muxSum);
-GLAPI void APIENTRY GLAPI_PREFIX(CombinerParameterfNV)(GLenum pname, GLfloat param);
-GLAPI void APIENTRY GLAPI_PREFIX(CombinerParameterfvNV)(GLenum pname, const GLfloat *params);
-GLAPI void APIENTRY GLAPI_PREFIX(CombinerParameteriNV)(GLenum pname, GLint param);
-GLAPI void APIENTRY GLAPI_PREFIX(CombinerParameterivNV)(GLenum pname, const GLint *params);
-GLAPI void APIENTRY GLAPI_PREFIX(FinalCombinerInputNV)(GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage);
-GLAPI void APIENTRY GLAPI_PREFIX(GetCombinerInputParameterfvNV)(GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLfloat *params);
-GLAPI void APIENTRY GLAPI_PREFIX(GetCombinerInputParameterivNV)(GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLint *params);
-GLAPI void APIENTRY GLAPI_PREFIX(GetCombinerOutputParameterfvNV)(GLenum stage, GLenum portion, GLenum pname, GLfloat *params);
-GLAPI void APIENTRY GLAPI_PREFIX(GetCombinerOutputParameterivNV)(GLenum stage, GLenum portion, GLenum pname, GLint *params);
-GLAPI void APIENTRY GLAPI_PREFIX(GetFinalCombinerInputParameterfvNV)(GLenum variable, GLenum pname, GLfloat *params);
-GLAPI void APIENTRY GLAPI_PREFIX(GetFinalCombinerInputParameterivNV)(GLenum variable, GLenum pname, GLint *params);
-GLAPI void APIENTRY GLAPI_PREFIX(ResizeBuffersMESA)(void);
-GLAPI void APIENTRY GLAPI_PREFIX(WindowPos2dMESA)(GLdouble x, GLdouble y);
-GLAPI void APIENTRY GLAPI_PREFIX(WindowPos2d)(GLdouble x, GLdouble y);
-GLAPI void APIENTRY GLAPI_PREFIX(WindowPos2dARB)(GLdouble x, GLdouble y);
-GLAPI void APIENTRY GLAPI_PREFIX(WindowPos2dvMESA)(const GLdouble *v);
-GLAPI void APIENTRY GLAPI_PREFIX(WindowPos2dv)(const GLdouble *v);
-GLAPI void APIENTRY GLAPI_PREFIX(WindowPos2dvARB)(const GLdouble *v);
-GLAPI void APIENTRY GLAPI_PREFIX(WindowPos2fMESA)(GLfloat x, GLfloat y);
-GLAPI void APIENTRY GLAPI_PREFIX(WindowPos2f)(GLfloat x, GLfloat y);
-GLAPI void APIENTRY GLAPI_PREFIX(WindowPos2fARB)(GLfloat x, GLfloat y);
-GLAPI void APIENTRY GLAPI_PREFIX(WindowPos2fvMESA)(const GLfloat *v);
-GLAPI void APIENTRY GLAPI_PREFIX(WindowPos2fv)(const GLfloat *v);
-GLAPI void APIENTRY GLAPI_PREFIX(WindowPos2fvARB)(const GLfloat *v);
-GLAPI void APIENTRY GLAPI_PREFIX(WindowPos2iMESA)(GLint x, GLint y);
-GLAPI void APIENTRY GLAPI_PREFIX(WindowPos2i)(GLint x, GLint y);
-GLAPI void APIENTRY GLAPI_PREFIX(WindowPos2iARB)(GLint x, GLint y);
-GLAPI void APIENTRY GLAPI_PREFIX(WindowPos2ivMESA)(const GLint *v);
-GLAPI void APIENTRY GLAPI_PREFIX(WindowPos2iv)(const GLint *v);
-GLAPI void APIENTRY GLAPI_PREFIX(WindowPos2ivARB)(const GLint *v);
-GLAPI void APIENTRY GLAPI_PREFIX(WindowPos2sMESA)(GLshort x, GLshort y);
-GLAPI void APIENTRY GLAPI_PREFIX(WindowPos2s)(GLshort x, GLshort y);
-GLAPI void APIENTRY GLAPI_PREFIX(WindowPos2sARB)(GLshort x, GLshort y);
-GLAPI void APIENTRY GLAPI_PREFIX(WindowPos2svMESA)(const GLshort *v);
-GLAPI void APIENTRY GLAPI_PREFIX(WindowPos2sv)(const GLshort *v);
-GLAPI void APIENTRY GLAPI_PREFIX(WindowPos2svARB)(const GLshort *v);
-GLAPI void APIENTRY GLAPI_PREFIX(WindowPos3dMESA)(GLdouble x, GLdouble y, GLdouble z);
-GLAPI void APIENTRY GLAPI_PREFIX(WindowPos3d)(GLdouble x, GLdouble y, GLdouble z);
-GLAPI void APIENTRY GLAPI_PREFIX(WindowPos3dARB)(GLdouble x, GLdouble y, GLdouble z);
-GLAPI void APIENTRY GLAPI_PREFIX(WindowPos3dvMESA)(const GLdouble *v);
-GLAPI void APIENTRY GLAPI_PREFIX(WindowPos3dv)(const GLdouble *v);
-GLAPI void APIENTRY GLAPI_PREFIX(WindowPos3dvARB)(const GLdouble *v);
-GLAPI void APIENTRY GLAPI_PREFIX(WindowPos3fMESA)(GLfloat x, GLfloat y, GLfloat z);
-GLAPI void APIENTRY GLAPI_PREFIX(WindowPos3f)(GLfloat x, GLfloat y, GLfloat z);
-GLAPI void APIENTRY GLAPI_PREFIX(WindowPos3fARB)(GLfloat x, GLfloat y, GLfloat z);
-GLAPI void APIENTRY GLAPI_PREFIX(WindowPos3fvMESA)(const GLfloat *v);
-GLAPI void APIENTRY GLAPI_PREFIX(WindowPos3fv)(const GLfloat *v);
-GLAPI void APIENTRY GLAPI_PREFIX(WindowPos3fvARB)(const GLfloat *v);
-GLAPI void APIENTRY GLAPI_PREFIX(WindowPos3iMESA)(GLint x, GLint y, GLint z);
-GLAPI void APIENTRY GLAPI_PREFIX(WindowPos3i)(GLint x, GLint y, GLint z);
-GLAPI void APIENTRY GLAPI_PREFIX(WindowPos3iARB)(GLint x, GLint y, GLint z);
-GLAPI void APIENTRY GLAPI_PREFIX(WindowPos3ivMESA)(const GLint *v);
-GLAPI void APIENTRY GLAPI_PREFIX(WindowPos3iv)(const GLint *v);
-GLAPI void APIENTRY GLAPI_PREFIX(WindowPos3ivARB)(const GLint *v);
-GLAPI void APIENTRY GLAPI_PREFIX(WindowPos3sMESA)(GLshort x, GLshort y, GLshort z);
-GLAPI void APIENTRY GLAPI_PREFIX(WindowPos3s)(GLshort x, GLshort y, GLshort z);
-GLAPI void APIENTRY GLAPI_PREFIX(WindowPos3sARB)(GLshort x, GLshort y, GLshort z);
-GLAPI void APIENTRY GLAPI_PREFIX(WindowPos3svMESA)(const GLshort *v);
-GLAPI void APIENTRY GLAPI_PREFIX(WindowPos3sv)(const GLshort *v);
-GLAPI void APIENTRY GLAPI_PREFIX(WindowPos3svARB)(const GLshort *v);
-GLAPI void APIENTRY GLAPI_PREFIX(WindowPos4dMESA)(GLdouble x, GLdouble y, GLdouble z, GLdouble w);
-GLAPI void APIENTRY GLAPI_PREFIX(WindowPos4dvMESA)(const GLdouble *v);
-GLAPI void APIENTRY GLAPI_PREFIX(WindowPos4fMESA)(GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-GLAPI void APIENTRY GLAPI_PREFIX(WindowPos4fvMESA)(const GLfloat *v);
-GLAPI void APIENTRY GLAPI_PREFIX(WindowPos4iMESA)(GLint x, GLint y, GLint z, GLint w);
-GLAPI void APIENTRY GLAPI_PREFIX(WindowPos4ivMESA)(const GLint *v);
-GLAPI void APIENTRY GLAPI_PREFIX(WindowPos4sMESA)(GLshort x, GLshort y, GLshort z, GLshort w);
-GLAPI void APIENTRY GLAPI_PREFIX(WindowPos4svMESA)(const GLshort *v);
-void APIENTRY GLAPI_PREFIX(_dispatch_stub_744)(const GLenum *mode, const GLint *first, const GLsizei *count, GLsizei primcount, GLint modestride);
-void APIENTRY GLAPI_PREFIX(_dispatch_stub_745)(const GLenum *mode, const GLsizei *count, GLenum type, const GLvoid * const *indices, GLsizei primcount, GLint modestride);
-void APIENTRY GLAPI_PREFIX(_dispatch_stub_746)(GLsizei n, const GLuint *fences);
-void APIENTRY GLAPI_PREFIX(_dispatch_stub_747)(GLuint fence);
-void APIENTRY GLAPI_PREFIX(_dispatch_stub_748)(GLsizei n, GLuint *fences);
-void APIENTRY GLAPI_PREFIX(_dispatch_stub_749)(GLuint fence, GLenum pname, GLint *params);
-GLboolean APIENTRY GLAPI_PREFIX(_dispatch_stub_750)(GLuint fence);
-void APIENTRY GLAPI_PREFIX(_dispatch_stub_751)(GLuint fence, GLenum condition);
-GLboolean APIENTRY GLAPI_PREFIX(_dispatch_stub_752)(GLuint fence);
-GLAPI GLboolean APIENTRY GLAPI_PREFIX(AreProgramsResidentNV)(GLsizei n, const GLuint *ids, GLboolean *residences);
-GLAPI void APIENTRY GLAPI_PREFIX(BindProgramNV)(GLenum target, GLuint program);
-GLAPI void APIENTRY GLAPI_PREFIX(BindProgramARB)(GLenum target, GLuint program);
-GLAPI void APIENTRY GLAPI_PREFIX(DeleteProgramsNV)(GLsizei n, const GLuint *programs);
-GLAPI void APIENTRY GLAPI_PREFIX(DeleteProgramsARB)(GLsizei n, const GLuint *programs);
-GLAPI void APIENTRY GLAPI_PREFIX(ExecuteProgramNV)(GLenum target, GLuint id, const GLfloat *params);
-GLAPI void APIENTRY GLAPI_PREFIX(GenProgramsNV)(GLsizei n, GLuint *programs);
-GLAPI void APIENTRY GLAPI_PREFIX(GenProgramsARB)(GLsizei n, GLuint *programs);
-GLAPI void APIENTRY GLAPI_PREFIX(GetProgramParameterdvNV)(GLenum target, GLuint index, GLenum pname, GLdouble *params);
-GLAPI void APIENTRY GLAPI_PREFIX(GetProgramParameterfvNV)(GLenum target, GLuint index, GLenum pname, GLfloat *params);
-GLAPI void APIENTRY GLAPI_PREFIX(GetProgramStringNV)(GLuint id, GLenum pname, GLubyte *program);
-GLAPI void APIENTRY GLAPI_PREFIX(GetProgramivNV)(GLuint id, GLenum pname, GLint *params);
-GLAPI void APIENTRY GLAPI_PREFIX(GetTrackMatrixivNV)(GLenum target, GLuint address, GLenum pname, GLint *params);
-GLAPI void APIENTRY GLAPI_PREFIX(GetVertexAttribPointervNV)(GLuint index, GLenum pname, GLvoid **pointer);
-GLAPI void APIENTRY GLAPI_PREFIX(GetVertexAttribPointerv)(GLuint index, GLenum pname, GLvoid **pointer);
-GLAPI void APIENTRY GLAPI_PREFIX(GetVertexAttribPointervARB)(GLuint index, GLenum pname, GLvoid **pointer);
-GLAPI void APIENTRY GLAPI_PREFIX(GetVertexAttribdvNV)(GLuint index, GLenum pname, GLdouble *params);
-GLAPI void APIENTRY GLAPI_PREFIX(GetVertexAttribfvNV)(GLuint index, GLenum pname, GLfloat *params);
-GLAPI void APIENTRY GLAPI_PREFIX(GetVertexAttribivNV)(GLuint index, GLenum pname, GLint *params);
-GLAPI GLboolean APIENTRY GLAPI_PREFIX(IsProgramNV)(GLuint program);
-GLAPI GLboolean APIENTRY GLAPI_PREFIX(IsProgramARB)(GLuint program);
-GLAPI void APIENTRY GLAPI_PREFIX(LoadProgramNV)(GLenum target, GLuint id, GLsizei len, const GLubyte *program);
-GLAPI void APIENTRY GLAPI_PREFIX(ProgramParameters4dvNV)(GLenum target, GLuint index, GLsizei num, const GLdouble *params);
-GLAPI void APIENTRY GLAPI_PREFIX(ProgramParameters4fvNV)(GLenum target, GLuint index, GLsizei num, const GLfloat *params);
-GLAPI void APIENTRY GLAPI_PREFIX(RequestResidentProgramsNV)(GLsizei n, const GLuint *ids);
-GLAPI void APIENTRY GLAPI_PREFIX(TrackMatrixNV)(GLenum target, GLuint address, GLenum matrix, GLenum transform);
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib1dNV)(GLuint index, GLdouble x);
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib1dvNV)(GLuint index, const GLdouble *v);
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib1fNV)(GLuint index, GLfloat x);
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib1fvNV)(GLuint index, const GLfloat *v);
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib1sNV)(GLuint index, GLshort x);
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib1svNV)(GLuint index, const GLshort *v);
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib2dNV)(GLuint index, GLdouble x, GLdouble y);
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib2dvNV)(GLuint index, const GLdouble *v);
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib2fNV)(GLuint index, GLfloat x, GLfloat y);
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib2fvNV)(GLuint index, const GLfloat *v);
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib2sNV)(GLuint index, GLshort x, GLshort y);
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib2svNV)(GLuint index, const GLshort *v);
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib3dNV)(GLuint index, GLdouble x, GLdouble y, GLdouble z);
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib3dvNV)(GLuint index, const GLdouble *v);
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib3fNV)(GLuint index, GLfloat x, GLfloat y, GLfloat z);
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib3fvNV)(GLuint index, const GLfloat *v);
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib3sNV)(GLuint index, GLshort x, GLshort y, GLshort z);
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib3svNV)(GLuint index, const GLshort *v);
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib4dNV)(GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib4dvNV)(GLuint index, const GLdouble *v);
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib4fNV)(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib4fvNV)(GLuint index, const GLfloat *v);
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib4sNV)(GLuint index, GLshort x, GLshort y, GLshort z, GLshort w);
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib4svNV)(GLuint index, const GLshort *v);
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib4ubNV)(GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w);
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib4ubvNV)(GLuint index, const GLubyte *v);
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribPointerNV)(GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribs1dvNV)(GLuint index, GLsizei n, const GLdouble *v);
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribs1fvNV)(GLuint index, GLsizei n, const GLfloat *v);
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribs1svNV)(GLuint index, GLsizei n, const GLshort *v);
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribs2dvNV)(GLuint index, GLsizei n, const GLdouble *v);
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribs2fvNV)(GLuint index, GLsizei n, const GLfloat *v);
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribs2svNV)(GLuint index, GLsizei n, const GLshort *v);
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribs3dvNV)(GLuint index, GLsizei n, const GLdouble *v);
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribs3fvNV)(GLuint index, GLsizei n, const GLfloat *v);
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribs3svNV)(GLuint index, GLsizei n, const GLshort *v);
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribs4dvNV)(GLuint index, GLsizei n, const GLdouble *v);
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribs4fvNV)(GLuint index, GLsizei n, const GLfloat *v);
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribs4svNV)(GLuint index, GLsizei n, const GLshort *v);
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribs4ubvNV)(GLuint index, GLsizei n, const GLubyte *v);
-GLAPI void APIENTRY GLAPI_PREFIX(GetTexBumpParameterfvATI)(GLenum pname, GLfloat *param);
-GLAPI void APIENTRY GLAPI_PREFIX(GetTexBumpParameterivATI)(GLenum pname, GLint *param);
-GLAPI void APIENTRY GLAPI_PREFIX(TexBumpParameterfvATI)(GLenum pname, const GLfloat *param);
-GLAPI void APIENTRY GLAPI_PREFIX(TexBumpParameterivATI)(GLenum pname, const GLint *param);
-GLAPI void APIENTRY GLAPI_PREFIX(AlphaFragmentOp1ATI)(GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod);
-GLAPI void APIENTRY GLAPI_PREFIX(AlphaFragmentOp2ATI)(GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod);
-GLAPI void APIENTRY GLAPI_PREFIX(AlphaFragmentOp3ATI)(GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod);
-GLAPI void APIENTRY GLAPI_PREFIX(BeginFragmentShaderATI)(void);
-GLAPI void APIENTRY GLAPI_PREFIX(BindFragmentShaderATI)(GLuint id);
-GLAPI void APIENTRY GLAPI_PREFIX(ColorFragmentOp1ATI)(GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod);
-GLAPI void APIENTRY GLAPI_PREFIX(ColorFragmentOp2ATI)(GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod);
-GLAPI void APIENTRY GLAPI_PREFIX(ColorFragmentOp3ATI)(GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod);
-GLAPI void APIENTRY GLAPI_PREFIX(DeleteFragmentShaderATI)(GLuint id);
-GLAPI void APIENTRY GLAPI_PREFIX(EndFragmentShaderATI)(void);
-GLAPI GLuint APIENTRY GLAPI_PREFIX(GenFragmentShadersATI)(GLuint range);
-GLAPI void APIENTRY GLAPI_PREFIX(PassTexCoordATI)(GLuint dst, GLuint coord, GLenum swizzle);
-GLAPI void APIENTRY GLAPI_PREFIX(SampleMapATI)(GLuint dst, GLuint interp, GLenum swizzle);
-GLAPI void APIENTRY GLAPI_PREFIX(SetFragmentShaderConstantATI)(GLuint dst, const GLfloat *value);
-GLAPI void APIENTRY GLAPI_PREFIX(PointParameteriNV)(GLenum pname, GLint param);
-GLAPI void APIENTRY GLAPI_PREFIX(PointParameteri)(GLenum pname, GLint param);
-GLAPI void APIENTRY GLAPI_PREFIX(PointParameterivNV)(GLenum pname, const GLint *params);
-GLAPI void APIENTRY GLAPI_PREFIX(PointParameteriv)(GLenum pname, const GLint *params);
-void APIENTRY GLAPI_PREFIX(_dispatch_stub_833)(GLenum face);
-void APIENTRY GLAPI_PREFIX(_dispatch_stub_834)(GLuint array);
-void APIENTRY GLAPI_PREFIX(_dispatch_stub_835)(GLsizei n, const GLuint *arrays);
-GLAPI void APIENTRY GLAPI_PREFIX(DeleteVertexArrays)(GLsizei n, const GLuint *arrays);
-void APIENTRY GLAPI_PREFIX(_dispatch_stub_836)(GLsizei n, GLuint *arrays);
-GLboolean APIENTRY GLAPI_PREFIX(_dispatch_stub_837)(GLuint array);
-GLAPI GLboolean APIENTRY GLAPI_PREFIX(IsVertexArray)(GLuint array);
-GLAPI void APIENTRY GLAPI_PREFIX(GetProgramNamedParameterdvNV)(GLuint id, GLsizei len, const GLubyte *name, GLdouble *params);
-GLAPI void APIENTRY GLAPI_PREFIX(GetProgramNamedParameterfvNV)(GLuint id, GLsizei len, const GLubyte *name, GLfloat *params);
-GLAPI void APIENTRY GLAPI_PREFIX(ProgramNamedParameter4dNV)(GLuint id, GLsizei len, const GLubyte *name, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
-GLAPI void APIENTRY GLAPI_PREFIX(ProgramNamedParameter4dvNV)(GLuint id, GLsizei len, const GLubyte *name, const GLdouble *v);
-GLAPI void APIENTRY GLAPI_PREFIX(ProgramNamedParameter4fNV)(GLuint id, GLsizei len, const GLubyte *name, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-GLAPI void APIENTRY GLAPI_PREFIX(ProgramNamedParameter4fvNV)(GLuint id, GLsizei len, const GLubyte *name, const GLfloat *v);
-GLAPI void APIENTRY GLAPI_PREFIX(PrimitiveRestartIndexNV)(GLuint index);
-GLAPI void APIENTRY GLAPI_PREFIX(PrimitiveRestartIndex)(GLuint index);
-GLAPI void APIENTRY GLAPI_PREFIX(PrimitiveRestartNV)(void);
-void APIENTRY GLAPI_PREFIX(_dispatch_stub_846)(GLenum func, GLclampx ref);
-void APIENTRY GLAPI_PREFIX(_dispatch_stub_847)(GLclampx red, GLclampx green, GLclampx blue, GLclampx alpha);
-void APIENTRY GLAPI_PREFIX(_dispatch_stub_848)(GLclampx depth);
-void APIENTRY GLAPI_PREFIX(_dispatch_stub_849)(GLenum plane, const GLfixed *equation);
-void APIENTRY GLAPI_PREFIX(_dispatch_stub_850)(GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha);
-void APIENTRY GLAPI_PREFIX(_dispatch_stub_851)(GLclampx zNear, GLclampx zFar);
-void APIENTRY GLAPI_PREFIX(_dispatch_stub_852)(GLenum pname, GLfixed param);
-void APIENTRY GLAPI_PREFIX(_dispatch_stub_853)(GLenum pname, const GLfixed *params);
-void APIENTRY GLAPI_PREFIX(_dispatch_stub_854)(GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar);
-void APIENTRY GLAPI_PREFIX(_dispatch_stub_855)(GLenum plane, GLfixed *equation);
-void APIENTRY GLAPI_PREFIX(_dispatch_stub_856)(GLenum pname, GLfixed *params);
-void APIENTRY GLAPI_PREFIX(_dispatch_stub_857)(GLenum light, GLenum pname, GLfixed *params);
-void APIENTRY GLAPI_PREFIX(_dispatch_stub_858)(GLenum face, GLenum pname, GLfixed *params);
-void APIENTRY GLAPI_PREFIX(_dispatch_stub_859)(GLenum target, GLenum pname, GLfixed *params);
-void APIENTRY GLAPI_PREFIX(_dispatch_stub_860)(GLenum coord, GLenum pname, GLfixed *params);
-void APIENTRY GLAPI_PREFIX(_dispatch_stub_861)(GLenum target, GLenum pname, GLfixed *params);
-void APIENTRY GLAPI_PREFIX(_dispatch_stub_862)(GLenum pname, GLfixed param);
-void APIENTRY GLAPI_PREFIX(_dispatch_stub_863)(GLenum pname, const GLfixed *params);
-void APIENTRY GLAPI_PREFIX(_dispatch_stub_864)(GLenum light, GLenum pname, GLfixed param);
-void APIENTRY GLAPI_PREFIX(_dispatch_stub_865)(GLenum light, GLenum pname, const GLfixed *params);
-void APIENTRY GLAPI_PREFIX(_dispatch_stub_866)(GLfixed width);
-void APIENTRY GLAPI_PREFIX(_dispatch_stub_867)(const GLfixed *m);
-void APIENTRY GLAPI_PREFIX(_dispatch_stub_868)(GLenum face, GLenum pname, GLfixed param);
-void APIENTRY GLAPI_PREFIX(_dispatch_stub_869)(GLenum face, GLenum pname, const GLfixed *params);
-void APIENTRY GLAPI_PREFIX(_dispatch_stub_870)(const GLfixed *m);
-void APIENTRY GLAPI_PREFIX(_dispatch_stub_871)(GLenum target, GLfixed s, GLfixed t, GLfixed r, GLfixed q);
-void APIENTRY GLAPI_PREFIX(_dispatch_stub_872)(GLfixed nx, GLfixed ny, GLfixed nz);
-void APIENTRY GLAPI_PREFIX(_dispatch_stub_873)(GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar);
-void APIENTRY GLAPI_PREFIX(_dispatch_stub_874)(GLenum pname, GLfixed param);
-void APIENTRY GLAPI_PREFIX(_dispatch_stub_875)(GLenum pname, const GLfixed *params);
-void APIENTRY GLAPI_PREFIX(_dispatch_stub_876)(GLfixed size);
-void APIENTRY GLAPI_PREFIX(_dispatch_stub_877)(GLfixed factor, GLfixed units);
-void APIENTRY GLAPI_PREFIX(_dispatch_stub_878)(GLfixed angle, GLfixed x, GLfixed y, GLfixed z);
-void APIENTRY GLAPI_PREFIX(_dispatch_stub_879)(GLclampx value, GLboolean invert);
-void APIENTRY GLAPI_PREFIX(_dispatch_stub_880)(GLfixed x, GLfixed y, GLfixed z);
-void APIENTRY GLAPI_PREFIX(_dispatch_stub_881)(GLenum target, GLenum pname, GLfixed param);
-void APIENTRY GLAPI_PREFIX(_dispatch_stub_882)(GLenum target, GLenum pname, const GLfixed *params);
-void APIENTRY GLAPI_PREFIX(_dispatch_stub_883)(GLenum coord, GLenum pname, GLint param);
-void APIENTRY GLAPI_PREFIX(_dispatch_stub_884)(GLenum coord, GLenum pname, const GLfixed *params);
-void APIENTRY GLAPI_PREFIX(_dispatch_stub_885)(GLenum target, GLenum pname, GLfixed param);
-void APIENTRY GLAPI_PREFIX(_dispatch_stub_886)(GLenum target, GLenum pname, const GLfixed *params);
-void APIENTRY GLAPI_PREFIX(_dispatch_stub_887)(GLfixed x, GLfixed y, GLfixed z);
-void APIENTRY GLAPI_PREFIX(_dispatch_stub_888)(GLenum plane, const GLfloat *equation);
-void APIENTRY GLAPI_PREFIX(_dispatch_stub_889)(GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar);
-void APIENTRY GLAPI_PREFIX(_dispatch_stub_890)(GLenum plane, GLfloat *equation);
-void APIENTRY GLAPI_PREFIX(_dispatch_stub_891)(GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar);
-void APIENTRY GLAPI_PREFIX(_dispatch_stub_892)(GLclampd zmin, GLclampd zmax);
-void APIENTRY GLAPI_PREFIX(_dispatch_stub_893)(GLenum modeRGB, GLenum modeA);
-GLAPI void APIENTRY GLAPI_PREFIX(BlendEquationSeparate)(GLenum modeRGB, GLenum modeA);
-GLAPI void APIENTRY GLAPI_PREFIX(BindFramebufferEXT)(GLenum target, GLuint framebuffer);
-GLAPI void APIENTRY GLAPI_PREFIX(BindFramebuffer)(GLenum target, GLuint framebuffer);
-GLAPI void APIENTRY GLAPI_PREFIX(BindRenderbufferEXT)(GLenum target, GLuint renderbuffer);
-GLAPI void APIENTRY GLAPI_PREFIX(BindRenderbuffer)(GLenum target, GLuint renderbuffer);
-GLAPI GLenum APIENTRY GLAPI_PREFIX(CheckFramebufferStatusEXT)(GLenum target);
-GLAPI GLenum APIENTRY GLAPI_PREFIX(CheckFramebufferStatus)(GLenum target);
-GLAPI void APIENTRY GLAPI_PREFIX(DeleteFramebuffersEXT)(GLsizei n, const GLuint *framebuffers);
-GLAPI void APIENTRY GLAPI_PREFIX(DeleteFramebuffers)(GLsizei n, const GLuint *framebuffers);
-GLAPI void APIENTRY GLAPI_PREFIX(DeleteRenderbuffersEXT)(GLsizei n, const GLuint *renderbuffers);
-GLAPI void APIENTRY GLAPI_PREFIX(DeleteRenderbuffers)(GLsizei n, const GLuint *renderbuffers);
-GLAPI void APIENTRY GLAPI_PREFIX(FramebufferRenderbufferEXT)(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
-GLAPI void APIENTRY GLAPI_PREFIX(FramebufferRenderbuffer)(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
-GLAPI void APIENTRY GLAPI_PREFIX(FramebufferTexture1DEXT)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
-GLAPI void APIENTRY GLAPI_PREFIX(FramebufferTexture1D)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
-GLAPI void APIENTRY GLAPI_PREFIX(FramebufferTexture2DEXT)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
-GLAPI void APIENTRY GLAPI_PREFIX(FramebufferTexture2D)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
-GLAPI void APIENTRY GLAPI_PREFIX(FramebufferTexture3DEXT)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset);
-GLAPI void APIENTRY GLAPI_PREFIX(FramebufferTexture3D)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset);
-GLAPI void APIENTRY GLAPI_PREFIX(GenFramebuffersEXT)(GLsizei n, GLuint *framebuffers);
-GLAPI void APIENTRY GLAPI_PREFIX(GenFramebuffers)(GLsizei n, GLuint *framebuffers);
-GLAPI void APIENTRY GLAPI_PREFIX(GenRenderbuffersEXT)(GLsizei n, GLuint *renderbuffers);
-GLAPI void APIENTRY GLAPI_PREFIX(GenRenderbuffers)(GLsizei n, GLuint *renderbuffers);
-GLAPI void APIENTRY GLAPI_PREFIX(GenerateMipmapEXT)(GLenum target);
-GLAPI void APIENTRY GLAPI_PREFIX(GenerateMipmap)(GLenum target);
-GLAPI void APIENTRY GLAPI_PREFIX(GetFramebufferAttachmentParameterivEXT)(GLenum target, GLenum attachment, GLenum pname, GLint *params);
-GLAPI void APIENTRY GLAPI_PREFIX(GetFramebufferAttachmentParameteriv)(GLenum target, GLenum attachment, GLenum pname, GLint *params);
-GLAPI void APIENTRY GLAPI_PREFIX(GetRenderbufferParameterivEXT)(GLenum target, GLenum pname, GLint *params);
-GLAPI void APIENTRY GLAPI_PREFIX(GetRenderbufferParameteriv)(GLenum target, GLenum pname, GLint *params);
-GLAPI GLboolean APIENTRY GLAPI_PREFIX(IsFramebufferEXT)(GLuint framebuffer);
-GLAPI GLboolean APIENTRY GLAPI_PREFIX(IsFramebuffer)(GLuint framebuffer);
-GLAPI GLboolean APIENTRY GLAPI_PREFIX(IsRenderbufferEXT)(GLuint renderbuffer);
-GLAPI GLboolean APIENTRY GLAPI_PREFIX(IsRenderbuffer)(GLuint renderbuffer);
-GLAPI void APIENTRY GLAPI_PREFIX(RenderbufferStorageEXT)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
-GLAPI void APIENTRY GLAPI_PREFIX(RenderbufferStorage)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
-void APIENTRY GLAPI_PREFIX(_dispatch_stub_911)(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
-GLAPI void APIENTRY GLAPI_PREFIX(BlitFramebuffer)(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
-void APIENTRY GLAPI_PREFIX(_dispatch_stub_912)(GLenum target, GLenum pname, GLint param);
-void APIENTRY GLAPI_PREFIX(_dispatch_stub_913)(GLenum target, GLintptr offset, GLsizeiptr size);
-GLAPI void APIENTRY GLAPI_PREFIX(BindFragDataLocationEXT)(GLuint program, GLuint colorNumber, const GLchar *name);
-GLAPI void APIENTRY GLAPI_PREFIX(BindFragDataLocation)(GLuint program, GLuint colorNumber, const GLchar *name);
-GLAPI GLint APIENTRY GLAPI_PREFIX(GetFragDataLocationEXT)(GLuint program, const GLchar *name);
-GLAPI GLint APIENTRY GLAPI_PREFIX(GetFragDataLocation)(GLuint program, const GLchar *name);
-GLAPI void APIENTRY GLAPI_PREFIX(GetUniformuivEXT)(GLuint program, GLint location, GLuint *params);
-GLAPI void APIENTRY GLAPI_PREFIX(GetUniformuiv)(GLuint program, GLint location, GLuint *params);
-GLAPI void APIENTRY GLAPI_PREFIX(GetVertexAttribIivEXT)(GLuint index, GLenum pname, GLint *params);
-GLAPI void APIENTRY GLAPI_PREFIX(GetVertexAttribIiv)(GLuint index, GLenum pname, GLint *params);
-GLAPI void APIENTRY GLAPI_PREFIX(GetVertexAttribIuivEXT)(GLuint index, GLenum pname, GLuint *params);
-GLAPI void APIENTRY GLAPI_PREFIX(GetVertexAttribIuiv)(GLuint index, GLenum pname, GLuint *params);
-GLAPI void APIENTRY GLAPI_PREFIX(Uniform1uiEXT)(GLint location, GLuint x);
-GLAPI void APIENTRY GLAPI_PREFIX(Uniform1ui)(GLint location, GLuint x);
-GLAPI void APIENTRY GLAPI_PREFIX(Uniform1uivEXT)(GLint location, GLsizei count, const GLuint *value);
-GLAPI void APIENTRY GLAPI_PREFIX(Uniform1uiv)(GLint location, GLsizei count, const GLuint *value);
-GLAPI void APIENTRY GLAPI_PREFIX(Uniform2uiEXT)(GLint location, GLuint x, GLuint y);
-GLAPI void APIENTRY GLAPI_PREFIX(Uniform2ui)(GLint location, GLuint x, GLuint y);
-GLAPI void APIENTRY GLAPI_PREFIX(Uniform2uivEXT)(GLint location, GLsizei count, const GLuint *value);
-GLAPI void APIENTRY GLAPI_PREFIX(Uniform2uiv)(GLint location, GLsizei count, const GLuint *value);
-GLAPI void APIENTRY GLAPI_PREFIX(Uniform3uiEXT)(GLint location, GLuint x, GLuint y, GLuint z);
-GLAPI void APIENTRY GLAPI_PREFIX(Uniform3ui)(GLint location, GLuint x, GLuint y, GLuint z);
-GLAPI void APIENTRY GLAPI_PREFIX(Uniform3uivEXT)(GLint location, GLsizei count, const GLuint *value);
-GLAPI void APIENTRY GLAPI_PREFIX(Uniform3uiv)(GLint location, GLsizei count, const GLuint *value);
-GLAPI void APIENTRY GLAPI_PREFIX(Uniform4uiEXT)(GLint location, GLuint x, GLuint y, GLuint z, GLuint w);
-GLAPI void APIENTRY GLAPI_PREFIX(Uniform4ui)(GLint location, GLuint x, GLuint y, GLuint z, GLuint w);
-GLAPI void APIENTRY GLAPI_PREFIX(Uniform4uivEXT)(GLint location, GLsizei count, const GLuint *value);
-GLAPI void APIENTRY GLAPI_PREFIX(Uniform4uiv)(GLint location, GLsizei count, const GLuint *value);
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribI1iEXT)(GLuint index, GLint x);
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribI1i)(GLuint index, GLint x);
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribI1ivEXT)(GLuint index, const GLint *v);
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribI1iv)(GLuint index, const GLint *v);
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribI1uiEXT)(GLuint index, GLuint x);
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribI1ui)(GLuint index, GLuint x);
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribI1uivEXT)(GLuint index, const GLuint *v);
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribI1uiv)(GLuint index, const GLuint *v);
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribI2iEXT)(GLuint index, GLint x, GLint y);
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribI2i)(GLuint index, GLint x, GLint y);
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribI2ivEXT)(GLuint index, const GLint *v);
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribI2iv)(GLuint index, const GLint *v);
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribI2uiEXT)(GLuint index, GLuint x, GLuint y);
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribI2ui)(GLuint index, GLuint x, GLuint y);
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribI2uivEXT)(GLuint index, const GLuint *v);
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribI2uiv)(GLuint index, const GLuint *v);
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribI3iEXT)(GLuint index, GLint x, GLint y, GLint z);
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribI3i)(GLuint index, GLint x, GLint y, GLint z);
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribI3ivEXT)(GLuint index, const GLint *v);
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribI3iv)(GLuint index, const GLint *v);
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribI3uiEXT)(GLuint index, GLuint x, GLuint y, GLuint z);
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribI3ui)(GLuint index, GLuint x, GLuint y, GLuint z);
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribI3uivEXT)(GLuint index, const GLuint *v);
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribI3uiv)(GLuint index, const GLuint *v);
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribI4bvEXT)(GLuint index, const GLbyte *v);
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribI4bv)(GLuint index, const GLbyte *v);
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribI4iEXT)(GLuint index, GLint x, GLint y, GLint z, GLint w);
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribI4i)(GLuint index, GLint x, GLint y, GLint z, GLint w);
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribI4ivEXT)(GLuint index, const GLint *v);
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribI4iv)(GLuint index, const GLint *v);
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribI4svEXT)(GLuint index, const GLshort *v);
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribI4sv)(GLuint index, const GLshort *v);
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribI4ubvEXT)(GLuint index, const GLubyte *v);
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribI4ubv)(GLuint index, const GLubyte *v);
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribI4uiEXT)(GLuint index, GLuint x, GLuint y, GLuint z, GLuint w);
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribI4ui)(GLuint index, GLuint x, GLuint y, GLuint z, GLuint w);
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribI4uivEXT)(GLuint index, const GLuint *v);
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribI4uiv)(GLuint index, const GLuint *v);
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribI4usvEXT)(GLuint index, const GLushort *v);
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribI4usv)(GLuint index, const GLushort *v);
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribIPointerEXT)(GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribIPointer)(GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
-GLAPI void APIENTRY GLAPI_PREFIX(FramebufferTextureLayerEXT)(GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer);
-GLAPI void APIENTRY GLAPI_PREFIX(FramebufferTextureLayer)(GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer);
-GLAPI void APIENTRY GLAPI_PREFIX(ColorMaskIndexedEXT)(GLuint buf, GLboolean r, GLboolean g, GLboolean b, GLboolean a);
-GLAPI void APIENTRY GLAPI_PREFIX(ColorMaski)(GLuint buf, GLboolean r, GLboolean g, GLboolean b, GLboolean a);
-GLAPI void APIENTRY GLAPI_PREFIX(DisableIndexedEXT)(GLenum target, GLuint index);
-GLAPI void APIENTRY GLAPI_PREFIX(Disablei)(GLenum target, GLuint index);
-GLAPI void APIENTRY GLAPI_PREFIX(EnableIndexedEXT)(GLenum target, GLuint index);
-GLAPI void APIENTRY GLAPI_PREFIX(Enablei)(GLenum target, GLuint index);
-GLAPI void APIENTRY GLAPI_PREFIX(GetBooleanIndexedvEXT)(GLenum value, GLuint index, GLboolean *data);
-GLAPI void APIENTRY GLAPI_PREFIX(GetBooleani_v)(GLenum value, GLuint index, GLboolean *data);
-GLAPI void APIENTRY GLAPI_PREFIX(GetIntegerIndexedvEXT)(GLenum value, GLuint index, GLint *data);
-GLAPI void APIENTRY GLAPI_PREFIX(GetIntegeri_v)(GLenum value, GLuint index, GLint *data);
-GLAPI GLboolean APIENTRY GLAPI_PREFIX(IsEnabledIndexedEXT)(GLenum target, GLuint index);
-GLAPI GLboolean APIENTRY GLAPI_PREFIX(IsEnabledi)(GLenum target, GLuint index);
-GLAPI void APIENTRY GLAPI_PREFIX(ClearColorIiEXT)(GLint r, GLint g, GLint b, GLint a);
-GLAPI void APIENTRY GLAPI_PREFIX(ClearColorIuiEXT)(GLuint r, GLuint g, GLuint b, GLuint a);
-GLAPI void APIENTRY GLAPI_PREFIX(GetTexParameterIivEXT)(GLenum target, GLenum pname, GLint *params);
-GLAPI void APIENTRY GLAPI_PREFIX(GetTexParameterIiv)(GLenum target, GLenum pname, GLint *params);
-GLAPI void APIENTRY GLAPI_PREFIX(GetTexParameterIuivEXT)(GLenum target, GLenum pname, GLuint *params);
-GLAPI void APIENTRY GLAPI_PREFIX(GetTexParameterIuiv)(GLenum target, GLenum pname, GLuint *params);
-GLAPI void APIENTRY GLAPI_PREFIX(TexParameterIivEXT)(GLenum target, GLenum pname, const GLint *params);
-GLAPI void APIENTRY GLAPI_PREFIX(TexParameterIiv)(GLenum target, GLenum pname, const GLint *params);
-GLAPI void APIENTRY GLAPI_PREFIX(TexParameterIuivEXT)(GLenum target, GLenum pname, const GLuint *params);
-GLAPI void APIENTRY GLAPI_PREFIX(TexParameterIuiv)(GLenum target, GLenum pname, const GLuint *params);
-GLAPI void APIENTRY GLAPI_PREFIX(BeginConditionalRenderNV)(GLuint query, GLenum mode);
-GLAPI void APIENTRY GLAPI_PREFIX(BeginConditionalRender)(GLuint query, GLenum mode);
-GLAPI void APIENTRY GLAPI_PREFIX(EndConditionalRenderNV)(void);
-GLAPI void APIENTRY GLAPI_PREFIX(EndConditionalRender)(void);
-GLAPI void APIENTRY GLAPI_PREFIX(BeginTransformFeedbackEXT)(GLenum mode);
-GLAPI void APIENTRY GLAPI_PREFIX(BeginTransformFeedback)(GLenum mode);
-GLAPI void APIENTRY GLAPI_PREFIX(BindBufferBaseEXT)(GLenum target, GLuint index, GLuint buffer);
-GLAPI void APIENTRY GLAPI_PREFIX(BindBufferBase)(GLenum target, GLuint index, GLuint buffer);
-GLAPI void APIENTRY GLAPI_PREFIX(BindBufferOffsetEXT)(GLenum target, GLuint index, GLuint buffer, GLintptr offset);
-GLAPI void APIENTRY GLAPI_PREFIX(BindBufferRangeEXT)(GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size);
-GLAPI void APIENTRY GLAPI_PREFIX(BindBufferRange)(GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size);
-GLAPI void APIENTRY GLAPI_PREFIX(EndTransformFeedbackEXT)(void);
-GLAPI void APIENTRY GLAPI_PREFIX(EndTransformFeedback)(void);
-GLAPI void APIENTRY GLAPI_PREFIX(GetTransformFeedbackVaryingEXT)(GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name);
-GLAPI void APIENTRY GLAPI_PREFIX(GetTransformFeedbackVarying)(GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name);
-GLAPI void APIENTRY GLAPI_PREFIX(TransformFeedbackVaryingsEXT)(GLuint program, GLsizei count, const char **varyings, GLenum bufferMode);
-GLAPI void APIENTRY GLAPI_PREFIX(TransformFeedbackVaryings)(GLuint program, GLsizei count, const GLchar* *varyings, GLenum bufferMode);
-GLAPI void APIENTRY GLAPI_PREFIX(ProvokingVertexEXT)(GLenum mode);
-GLAPI void APIENTRY GLAPI_PREFIX(ProvokingVertex)(GLenum mode);
-void APIENTRY GLAPI_PREFIX(_dispatch_stub_971)(GLenum target, GLenum pname, GLvoid **params);
-void APIENTRY GLAPI_PREFIX(_dispatch_stub_972)(GLenum target, GLsizei length, GLvoid *pointer);
-GLAPI void APIENTRY GLAPI_PREFIX(GetObjectParameterivAPPLE)(GLenum objectType, GLuint name, GLenum pname, GLint *value);
-GLAPI GLenum APIENTRY GLAPI_PREFIX(ObjectPurgeableAPPLE)(GLenum objectType, GLuint name, GLenum option);
-GLAPI GLenum APIENTRY GLAPI_PREFIX(ObjectUnpurgeableAPPLE)(GLenum objectType, GLuint name, GLenum option);
-GLAPI void APIENTRY GLAPI_PREFIX(ActiveProgramEXT)(GLuint program);
-GLAPI GLuint APIENTRY GLAPI_PREFIX(CreateShaderProgramEXT)(GLenum type, const GLchar *string);
-GLAPI void APIENTRY GLAPI_PREFIX(UseShaderProgramEXT)(GLenum type, GLuint program);
-GLAPI void APIENTRY GLAPI_PREFIX(TextureBarrierNV)(void);
-void APIENTRY GLAPI_PREFIX(_dispatch_stub_980)(GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask);
-void APIENTRY GLAPI_PREFIX(_dispatch_stub_981)(GLenum target, GLuint index, GLsizei count, const GLfloat *params);
-void APIENTRY GLAPI_PREFIX(_dispatch_stub_982)(GLenum target, GLuint index, GLsizei count, const GLfloat *params);
-void APIENTRY GLAPI_PREFIX(_dispatch_stub_983)(GLuint id, GLenum pname, GLint64EXT *params);
-void APIENTRY GLAPI_PREFIX(_dispatch_stub_984)(GLuint id, GLenum pname, GLuint64EXT *params);
-GLAPI void APIENTRY GLAPI_PREFIX(EGLImageTargetRenderbufferStorageOES)(GLenum target, GLvoid *writeOffset);
-GLAPI void APIENTRY GLAPI_PREFIX(EGLImageTargetTexture2DOES)(GLenum target, GLvoid *writeOffset);
-#undef MAPI_TMP_DEFINES
-#endif /* MAPI_TMP_DEFINES */
-
-#ifdef MAPI_TMP_PUBLIC_ENTRIES_NO_HIDDEN
-GLAPI void APIENTRY GLAPI_PREFIX(NewList)(GLuint list, GLenum mode)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[0];
- ((void (APIENTRY *)(GLuint list, GLenum mode)) _func)(list, mode);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(EndList)(void)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[1];
- ((void (APIENTRY *)(void)) _func)();
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(CallList)(GLuint list)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[2];
- ((void (APIENTRY *)(GLuint list)) _func)(list);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(CallLists)(GLsizei n, GLenum type, const GLvoid *lists)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[3];
- ((void (APIENTRY *)(GLsizei n, GLenum type, const GLvoid *lists)) _func)(n, type, lists);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(DeleteLists)(GLuint list, GLsizei range)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[4];
- ((void (APIENTRY *)(GLuint list, GLsizei range)) _func)(list, range);
-}
-
-GLAPI GLuint APIENTRY GLAPI_PREFIX(GenLists)(GLsizei range)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[5];
- return ((GLuint (APIENTRY *)(GLsizei range)) _func)(range);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(ListBase)(GLuint base)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[6];
- ((void (APIENTRY *)(GLuint base)) _func)(base);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(Begin)(GLenum mode)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[7];
- ((void (APIENTRY *)(GLenum mode)) _func)(mode);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(Bitmap)(GLsizei width, GLsizei height, GLfloat xorig, GLfloat yorig, GLfloat xmove, GLfloat ymove, const GLubyte *bitmap)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[8];
- ((void (APIENTRY *)(GLsizei width, GLsizei height, GLfloat xorig, GLfloat yorig, GLfloat xmove, GLfloat ymove, const GLubyte *bitmap)) _func)(width, height, xorig, yorig, xmove, ymove, bitmap);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(Color3b)(GLbyte red, GLbyte green, GLbyte blue)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[9];
- ((void (APIENTRY *)(GLbyte red, GLbyte green, GLbyte blue)) _func)(red, green, blue);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(Color3bv)(const GLbyte *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[10];
- ((void (APIENTRY *)(const GLbyte *v)) _func)(v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(Color3d)(GLdouble red, GLdouble green, GLdouble blue)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[11];
- ((void (APIENTRY *)(GLdouble red, GLdouble green, GLdouble blue)) _func)(red, green, blue);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(Color3dv)(const GLdouble *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[12];
- ((void (APIENTRY *)(const GLdouble *v)) _func)(v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(Color3f)(GLfloat red, GLfloat green, GLfloat blue)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[13];
- ((void (APIENTRY *)(GLfloat red, GLfloat green, GLfloat blue)) _func)(red, green, blue);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(Color3fv)(const GLfloat *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[14];
- ((void (APIENTRY *)(const GLfloat *v)) _func)(v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(Color3i)(GLint red, GLint green, GLint blue)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[15];
- ((void (APIENTRY *)(GLint red, GLint green, GLint blue)) _func)(red, green, blue);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(Color3iv)(const GLint *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[16];
- ((void (APIENTRY *)(const GLint *v)) _func)(v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(Color3s)(GLshort red, GLshort green, GLshort blue)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[17];
- ((void (APIENTRY *)(GLshort red, GLshort green, GLshort blue)) _func)(red, green, blue);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(Color3sv)(const GLshort *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[18];
- ((void (APIENTRY *)(const GLshort *v)) _func)(v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(Color3ub)(GLubyte red, GLubyte green, GLubyte blue)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[19];
- ((void (APIENTRY *)(GLubyte red, GLubyte green, GLubyte blue)) _func)(red, green, blue);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(Color3ubv)(const GLubyte *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[20];
- ((void (APIENTRY *)(const GLubyte *v)) _func)(v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(Color3ui)(GLuint red, GLuint green, GLuint blue)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[21];
- ((void (APIENTRY *)(GLuint red, GLuint green, GLuint blue)) _func)(red, green, blue);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(Color3uiv)(const GLuint *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[22];
- ((void (APIENTRY *)(const GLuint *v)) _func)(v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(Color3us)(GLushort red, GLushort green, GLushort blue)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[23];
- ((void (APIENTRY *)(GLushort red, GLushort green, GLushort blue)) _func)(red, green, blue);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(Color3usv)(const GLushort *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[24];
- ((void (APIENTRY *)(const GLushort *v)) _func)(v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(Color4b)(GLbyte red, GLbyte green, GLbyte blue, GLbyte alpha)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[25];
- ((void (APIENTRY *)(GLbyte red, GLbyte green, GLbyte blue, GLbyte alpha)) _func)(red, green, blue, alpha);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(Color4bv)(const GLbyte *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[26];
- ((void (APIENTRY *)(const GLbyte *v)) _func)(v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(Color4d)(GLdouble red, GLdouble green, GLdouble blue, GLdouble alpha)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[27];
- ((void (APIENTRY *)(GLdouble red, GLdouble green, GLdouble blue, GLdouble alpha)) _func)(red, green, blue, alpha);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(Color4dv)(const GLdouble *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[28];
- ((void (APIENTRY *)(const GLdouble *v)) _func)(v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(Color4f)(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[29];
- ((void (APIENTRY *)(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha)) _func)(red, green, blue, alpha);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(Color4fv)(const GLfloat *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[30];
- ((void (APIENTRY *)(const GLfloat *v)) _func)(v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(Color4i)(GLint red, GLint green, GLint blue, GLint alpha)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[31];
- ((void (APIENTRY *)(GLint red, GLint green, GLint blue, GLint alpha)) _func)(red, green, blue, alpha);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(Color4iv)(const GLint *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[32];
- ((void (APIENTRY *)(const GLint *v)) _func)(v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(Color4s)(GLshort red, GLshort green, GLshort blue, GLshort alpha)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[33];
- ((void (APIENTRY *)(GLshort red, GLshort green, GLshort blue, GLshort alpha)) _func)(red, green, blue, alpha);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(Color4sv)(const GLshort *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[34];
- ((void (APIENTRY *)(const GLshort *v)) _func)(v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(Color4ub)(GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[35];
- ((void (APIENTRY *)(GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha)) _func)(red, green, blue, alpha);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(Color4ubv)(const GLubyte *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[36];
- ((void (APIENTRY *)(const GLubyte *v)) _func)(v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(Color4ui)(GLuint red, GLuint green, GLuint blue, GLuint alpha)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[37];
- ((void (APIENTRY *)(GLuint red, GLuint green, GLuint blue, GLuint alpha)) _func)(red, green, blue, alpha);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(Color4uiv)(const GLuint *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[38];
- ((void (APIENTRY *)(const GLuint *v)) _func)(v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(Color4us)(GLushort red, GLushort green, GLushort blue, GLushort alpha)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[39];
- ((void (APIENTRY *)(GLushort red, GLushort green, GLushort blue, GLushort alpha)) _func)(red, green, blue, alpha);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(Color4usv)(const GLushort *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[40];
- ((void (APIENTRY *)(const GLushort *v)) _func)(v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(EdgeFlag)(GLboolean flag)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[41];
- ((void (APIENTRY *)(GLboolean flag)) _func)(flag);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(EdgeFlagv)(const GLboolean *flag)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[42];
- ((void (APIENTRY *)(const GLboolean *flag)) _func)(flag);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(End)(void)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[43];
- ((void (APIENTRY *)(void)) _func)();
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(Indexd)(GLdouble c)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[44];
- ((void (APIENTRY *)(GLdouble c)) _func)(c);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(Indexdv)(const GLdouble *c)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[45];
- ((void (APIENTRY *)(const GLdouble *c)) _func)(c);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(Indexf)(GLfloat c)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[46];
- ((void (APIENTRY *)(GLfloat c)) _func)(c);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(Indexfv)(const GLfloat *c)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[47];
- ((void (APIENTRY *)(const GLfloat *c)) _func)(c);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(Indexi)(GLint c)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[48];
- ((void (APIENTRY *)(GLint c)) _func)(c);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(Indexiv)(const GLint *c)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[49];
- ((void (APIENTRY *)(const GLint *c)) _func)(c);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(Indexs)(GLshort c)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[50];
- ((void (APIENTRY *)(GLshort c)) _func)(c);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(Indexsv)(const GLshort *c)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[51];
- ((void (APIENTRY *)(const GLshort *c)) _func)(c);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(Normal3b)(GLbyte nx, GLbyte ny, GLbyte nz)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[52];
- ((void (APIENTRY *)(GLbyte nx, GLbyte ny, GLbyte nz)) _func)(nx, ny, nz);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(Normal3bv)(const GLbyte *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[53];
- ((void (APIENTRY *)(const GLbyte *v)) _func)(v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(Normal3d)(GLdouble nx, GLdouble ny, GLdouble nz)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[54];
- ((void (APIENTRY *)(GLdouble nx, GLdouble ny, GLdouble nz)) _func)(nx, ny, nz);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(Normal3dv)(const GLdouble *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[55];
- ((void (APIENTRY *)(const GLdouble *v)) _func)(v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(Normal3f)(GLfloat nx, GLfloat ny, GLfloat nz)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[56];
- ((void (APIENTRY *)(GLfloat nx, GLfloat ny, GLfloat nz)) _func)(nx, ny, nz);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(Normal3fv)(const GLfloat *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[57];
- ((void (APIENTRY *)(const GLfloat *v)) _func)(v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(Normal3i)(GLint nx, GLint ny, GLint nz)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[58];
- ((void (APIENTRY *)(GLint nx, GLint ny, GLint nz)) _func)(nx, ny, nz);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(Normal3iv)(const GLint *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[59];
- ((void (APIENTRY *)(const GLint *v)) _func)(v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(Normal3s)(GLshort nx, GLshort ny, GLshort nz)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[60];
- ((void (APIENTRY *)(GLshort nx, GLshort ny, GLshort nz)) _func)(nx, ny, nz);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(Normal3sv)(const GLshort *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[61];
- ((void (APIENTRY *)(const GLshort *v)) _func)(v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(RasterPos2d)(GLdouble x, GLdouble y)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[62];
- ((void (APIENTRY *)(GLdouble x, GLdouble y)) _func)(x, y);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(RasterPos2dv)(const GLdouble *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[63];
- ((void (APIENTRY *)(const GLdouble *v)) _func)(v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(RasterPos2f)(GLfloat x, GLfloat y)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[64];
- ((void (APIENTRY *)(GLfloat x, GLfloat y)) _func)(x, y);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(RasterPos2fv)(const GLfloat *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[65];
- ((void (APIENTRY *)(const GLfloat *v)) _func)(v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(RasterPos2i)(GLint x, GLint y)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[66];
- ((void (APIENTRY *)(GLint x, GLint y)) _func)(x, y);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(RasterPos2iv)(const GLint *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[67];
- ((void (APIENTRY *)(const GLint *v)) _func)(v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(RasterPos2s)(GLshort x, GLshort y)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[68];
- ((void (APIENTRY *)(GLshort x, GLshort y)) _func)(x, y);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(RasterPos2sv)(const GLshort *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[69];
- ((void (APIENTRY *)(const GLshort *v)) _func)(v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(RasterPos3d)(GLdouble x, GLdouble y, GLdouble z)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[70];
- ((void (APIENTRY *)(GLdouble x, GLdouble y, GLdouble z)) _func)(x, y, z);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(RasterPos3dv)(const GLdouble *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[71];
- ((void (APIENTRY *)(const GLdouble *v)) _func)(v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(RasterPos3f)(GLfloat x, GLfloat y, GLfloat z)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[72];
- ((void (APIENTRY *)(GLfloat x, GLfloat y, GLfloat z)) _func)(x, y, z);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(RasterPos3fv)(const GLfloat *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[73];
- ((void (APIENTRY *)(const GLfloat *v)) _func)(v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(RasterPos3i)(GLint x, GLint y, GLint z)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[74];
- ((void (APIENTRY *)(GLint x, GLint y, GLint z)) _func)(x, y, z);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(RasterPos3iv)(const GLint *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[75];
- ((void (APIENTRY *)(const GLint *v)) _func)(v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(RasterPos3s)(GLshort x, GLshort y, GLshort z)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[76];
- ((void (APIENTRY *)(GLshort x, GLshort y, GLshort z)) _func)(x, y, z);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(RasterPos3sv)(const GLshort *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[77];
- ((void (APIENTRY *)(const GLshort *v)) _func)(v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(RasterPos4d)(GLdouble x, GLdouble y, GLdouble z, GLdouble w)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[78];
- ((void (APIENTRY *)(GLdouble x, GLdouble y, GLdouble z, GLdouble w)) _func)(x, y, z, w);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(RasterPos4dv)(const GLdouble *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[79];
- ((void (APIENTRY *)(const GLdouble *v)) _func)(v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(RasterPos4f)(GLfloat x, GLfloat y, GLfloat z, GLfloat w)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[80];
- ((void (APIENTRY *)(GLfloat x, GLfloat y, GLfloat z, GLfloat w)) _func)(x, y, z, w);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(RasterPos4fv)(const GLfloat *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[81];
- ((void (APIENTRY *)(const GLfloat *v)) _func)(v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(RasterPos4i)(GLint x, GLint y, GLint z, GLint w)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[82];
- ((void (APIENTRY *)(GLint x, GLint y, GLint z, GLint w)) _func)(x, y, z, w);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(RasterPos4iv)(const GLint *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[83];
- ((void (APIENTRY *)(const GLint *v)) _func)(v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(RasterPos4s)(GLshort x, GLshort y, GLshort z, GLshort w)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[84];
- ((void (APIENTRY *)(GLshort x, GLshort y, GLshort z, GLshort w)) _func)(x, y, z, w);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(RasterPos4sv)(const GLshort *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[85];
- ((void (APIENTRY *)(const GLshort *v)) _func)(v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(Rectd)(GLdouble x1, GLdouble y1, GLdouble x2, GLdouble y2)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[86];
- ((void (APIENTRY *)(GLdouble x1, GLdouble y1, GLdouble x2, GLdouble y2)) _func)(x1, y1, x2, y2);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(Rectdv)(const GLdouble *v1, const GLdouble *v2)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[87];
- ((void (APIENTRY *)(const GLdouble *v1, const GLdouble *v2)) _func)(v1, v2);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(Rectf)(GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[88];
- ((void (APIENTRY *)(GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2)) _func)(x1, y1, x2, y2);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(Rectfv)(const GLfloat *v1, const GLfloat *v2)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[89];
- ((void (APIENTRY *)(const GLfloat *v1, const GLfloat *v2)) _func)(v1, v2);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(Recti)(GLint x1, GLint y1, GLint x2, GLint y2)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[90];
- ((void (APIENTRY *)(GLint x1, GLint y1, GLint x2, GLint y2)) _func)(x1, y1, x2, y2);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(Rectiv)(const GLint *v1, const GLint *v2)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[91];
- ((void (APIENTRY *)(const GLint *v1, const GLint *v2)) _func)(v1, v2);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(Rects)(GLshort x1, GLshort y1, GLshort x2, GLshort y2)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[92];
- ((void (APIENTRY *)(GLshort x1, GLshort y1, GLshort x2, GLshort y2)) _func)(x1, y1, x2, y2);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(Rectsv)(const GLshort *v1, const GLshort *v2)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[93];
- ((void (APIENTRY *)(const GLshort *v1, const GLshort *v2)) _func)(v1, v2);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(TexCoord1d)(GLdouble s)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[94];
- ((void (APIENTRY *)(GLdouble s)) _func)(s);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(TexCoord1dv)(const GLdouble *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[95];
- ((void (APIENTRY *)(const GLdouble *v)) _func)(v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(TexCoord1f)(GLfloat s)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[96];
- ((void (APIENTRY *)(GLfloat s)) _func)(s);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(TexCoord1fv)(const GLfloat *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[97];
- ((void (APIENTRY *)(const GLfloat *v)) _func)(v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(TexCoord1i)(GLint s)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[98];
- ((void (APIENTRY *)(GLint s)) _func)(s);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(TexCoord1iv)(const GLint *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[99];
- ((void (APIENTRY *)(const GLint *v)) _func)(v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(TexCoord1s)(GLshort s)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[100];
- ((void (APIENTRY *)(GLshort s)) _func)(s);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(TexCoord1sv)(const GLshort *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[101];
- ((void (APIENTRY *)(const GLshort *v)) _func)(v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(TexCoord2d)(GLdouble s, GLdouble t)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[102];
- ((void (APIENTRY *)(GLdouble s, GLdouble t)) _func)(s, t);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(TexCoord2dv)(const GLdouble *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[103];
- ((void (APIENTRY *)(const GLdouble *v)) _func)(v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(TexCoord2f)(GLfloat s, GLfloat t)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[104];
- ((void (APIENTRY *)(GLfloat s, GLfloat t)) _func)(s, t);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(TexCoord2fv)(const GLfloat *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[105];
- ((void (APIENTRY *)(const GLfloat *v)) _func)(v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(TexCoord2i)(GLint s, GLint t)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[106];
- ((void (APIENTRY *)(GLint s, GLint t)) _func)(s, t);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(TexCoord2iv)(const GLint *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[107];
- ((void (APIENTRY *)(const GLint *v)) _func)(v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(TexCoord2s)(GLshort s, GLshort t)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[108];
- ((void (APIENTRY *)(GLshort s, GLshort t)) _func)(s, t);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(TexCoord2sv)(const GLshort *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[109];
- ((void (APIENTRY *)(const GLshort *v)) _func)(v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(TexCoord3d)(GLdouble s, GLdouble t, GLdouble r)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[110];
- ((void (APIENTRY *)(GLdouble s, GLdouble t, GLdouble r)) _func)(s, t, r);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(TexCoord3dv)(const GLdouble *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[111];
- ((void (APIENTRY *)(const GLdouble *v)) _func)(v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(TexCoord3f)(GLfloat s, GLfloat t, GLfloat r)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[112];
- ((void (APIENTRY *)(GLfloat s, GLfloat t, GLfloat r)) _func)(s, t, r);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(TexCoord3fv)(const GLfloat *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[113];
- ((void (APIENTRY *)(const GLfloat *v)) _func)(v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(TexCoord3i)(GLint s, GLint t, GLint r)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[114];
- ((void (APIENTRY *)(GLint s, GLint t, GLint r)) _func)(s, t, r);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(TexCoord3iv)(const GLint *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[115];
- ((void (APIENTRY *)(const GLint *v)) _func)(v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(TexCoord3s)(GLshort s, GLshort t, GLshort r)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[116];
- ((void (APIENTRY *)(GLshort s, GLshort t, GLshort r)) _func)(s, t, r);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(TexCoord3sv)(const GLshort *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[117];
- ((void (APIENTRY *)(const GLshort *v)) _func)(v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(TexCoord4d)(GLdouble s, GLdouble t, GLdouble r, GLdouble q)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[118];
- ((void (APIENTRY *)(GLdouble s, GLdouble t, GLdouble r, GLdouble q)) _func)(s, t, r, q);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(TexCoord4dv)(const GLdouble *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[119];
- ((void (APIENTRY *)(const GLdouble *v)) _func)(v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(TexCoord4f)(GLfloat s, GLfloat t, GLfloat r, GLfloat q)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[120];
- ((void (APIENTRY *)(GLfloat s, GLfloat t, GLfloat r, GLfloat q)) _func)(s, t, r, q);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(TexCoord4fv)(const GLfloat *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[121];
- ((void (APIENTRY *)(const GLfloat *v)) _func)(v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(TexCoord4i)(GLint s, GLint t, GLint r, GLint q)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[122];
- ((void (APIENTRY *)(GLint s, GLint t, GLint r, GLint q)) _func)(s, t, r, q);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(TexCoord4iv)(const GLint *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[123];
- ((void (APIENTRY *)(const GLint *v)) _func)(v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(TexCoord4s)(GLshort s, GLshort t, GLshort r, GLshort q)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[124];
- ((void (APIENTRY *)(GLshort s, GLshort t, GLshort r, GLshort q)) _func)(s, t, r, q);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(TexCoord4sv)(const GLshort *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[125];
- ((void (APIENTRY *)(const GLshort *v)) _func)(v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(Vertex2d)(GLdouble x, GLdouble y)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[126];
- ((void (APIENTRY *)(GLdouble x, GLdouble y)) _func)(x, y);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(Vertex2dv)(const GLdouble *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[127];
- ((void (APIENTRY *)(const GLdouble *v)) _func)(v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(Vertex2f)(GLfloat x, GLfloat y)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[128];
- ((void (APIENTRY *)(GLfloat x, GLfloat y)) _func)(x, y);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(Vertex2fv)(const GLfloat *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[129];
- ((void (APIENTRY *)(const GLfloat *v)) _func)(v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(Vertex2i)(GLint x, GLint y)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[130];
- ((void (APIENTRY *)(GLint x, GLint y)) _func)(x, y);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(Vertex2iv)(const GLint *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[131];
- ((void (APIENTRY *)(const GLint *v)) _func)(v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(Vertex2s)(GLshort x, GLshort y)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[132];
- ((void (APIENTRY *)(GLshort x, GLshort y)) _func)(x, y);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(Vertex2sv)(const GLshort *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[133];
- ((void (APIENTRY *)(const GLshort *v)) _func)(v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(Vertex3d)(GLdouble x, GLdouble y, GLdouble z)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[134];
- ((void (APIENTRY *)(GLdouble x, GLdouble y, GLdouble z)) _func)(x, y, z);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(Vertex3dv)(const GLdouble *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[135];
- ((void (APIENTRY *)(const GLdouble *v)) _func)(v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(Vertex3f)(GLfloat x, GLfloat y, GLfloat z)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[136];
- ((void (APIENTRY *)(GLfloat x, GLfloat y, GLfloat z)) _func)(x, y, z);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(Vertex3fv)(const GLfloat *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[137];
- ((void (APIENTRY *)(const GLfloat *v)) _func)(v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(Vertex3i)(GLint x, GLint y, GLint z)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[138];
- ((void (APIENTRY *)(GLint x, GLint y, GLint z)) _func)(x, y, z);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(Vertex3iv)(const GLint *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[139];
- ((void (APIENTRY *)(const GLint *v)) _func)(v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(Vertex3s)(GLshort x, GLshort y, GLshort z)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[140];
- ((void (APIENTRY *)(GLshort x, GLshort y, GLshort z)) _func)(x, y, z);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(Vertex3sv)(const GLshort *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[141];
- ((void (APIENTRY *)(const GLshort *v)) _func)(v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(Vertex4d)(GLdouble x, GLdouble y, GLdouble z, GLdouble w)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[142];
- ((void (APIENTRY *)(GLdouble x, GLdouble y, GLdouble z, GLdouble w)) _func)(x, y, z, w);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(Vertex4dv)(const GLdouble *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[143];
- ((void (APIENTRY *)(const GLdouble *v)) _func)(v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(Vertex4f)(GLfloat x, GLfloat y, GLfloat z, GLfloat w)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[144];
- ((void (APIENTRY *)(GLfloat x, GLfloat y, GLfloat z, GLfloat w)) _func)(x, y, z, w);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(Vertex4fv)(const GLfloat *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[145];
- ((void (APIENTRY *)(const GLfloat *v)) _func)(v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(Vertex4i)(GLint x, GLint y, GLint z, GLint w)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[146];
- ((void (APIENTRY *)(GLint x, GLint y, GLint z, GLint w)) _func)(x, y, z, w);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(Vertex4iv)(const GLint *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[147];
- ((void (APIENTRY *)(const GLint *v)) _func)(v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(Vertex4s)(GLshort x, GLshort y, GLshort z, GLshort w)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[148];
- ((void (APIENTRY *)(GLshort x, GLshort y, GLshort z, GLshort w)) _func)(x, y, z, w);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(Vertex4sv)(const GLshort *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[149];
- ((void (APIENTRY *)(const GLshort *v)) _func)(v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(ClipPlane)(GLenum plane, const GLdouble *equation)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[150];
- ((void (APIENTRY *)(GLenum plane, const GLdouble *equation)) _func)(plane, equation);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(ColorMaterial)(GLenum face, GLenum mode)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[151];
- ((void (APIENTRY *)(GLenum face, GLenum mode)) _func)(face, mode);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(CullFace)(GLenum mode)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[152];
- ((void (APIENTRY *)(GLenum mode)) _func)(mode);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(Fogf)(GLenum pname, GLfloat param)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[153];
- ((void (APIENTRY *)(GLenum pname, GLfloat param)) _func)(pname, param);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(Fogfv)(GLenum pname, const GLfloat *params)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[154];
- ((void (APIENTRY *)(GLenum pname, const GLfloat *params)) _func)(pname, params);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(Fogi)(GLenum pname, GLint param)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[155];
- ((void (APIENTRY *)(GLenum pname, GLint param)) _func)(pname, param);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(Fogiv)(GLenum pname, const GLint *params)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[156];
- ((void (APIENTRY *)(GLenum pname, const GLint *params)) _func)(pname, params);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(FrontFace)(GLenum mode)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[157];
- ((void (APIENTRY *)(GLenum mode)) _func)(mode);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(Hint)(GLenum target, GLenum mode)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[158];
- ((void (APIENTRY *)(GLenum target, GLenum mode)) _func)(target, mode);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(Lightf)(GLenum light, GLenum pname, GLfloat param)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[159];
- ((void (APIENTRY *)(GLenum light, GLenum pname, GLfloat param)) _func)(light, pname, param);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(Lightfv)(GLenum light, GLenum pname, const GLfloat *params)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[160];
- ((void (APIENTRY *)(GLenum light, GLenum pname, const GLfloat *params)) _func)(light, pname, params);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(Lighti)(GLenum light, GLenum pname, GLint param)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[161];
- ((void (APIENTRY *)(GLenum light, GLenum pname, GLint param)) _func)(light, pname, param);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(Lightiv)(GLenum light, GLenum pname, const GLint *params)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[162];
- ((void (APIENTRY *)(GLenum light, GLenum pname, const GLint *params)) _func)(light, pname, params);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(LightModelf)(GLenum pname, GLfloat param)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[163];
- ((void (APIENTRY *)(GLenum pname, GLfloat param)) _func)(pname, param);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(LightModelfv)(GLenum pname, const GLfloat *params)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[164];
- ((void (APIENTRY *)(GLenum pname, const GLfloat *params)) _func)(pname, params);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(LightModeli)(GLenum pname, GLint param)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[165];
- ((void (APIENTRY *)(GLenum pname, GLint param)) _func)(pname, param);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(LightModeliv)(GLenum pname, const GLint *params)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[166];
- ((void (APIENTRY *)(GLenum pname, const GLint *params)) _func)(pname, params);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(LineStipple)(GLint factor, GLushort pattern)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[167];
- ((void (APIENTRY *)(GLint factor, GLushort pattern)) _func)(factor, pattern);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(LineWidth)(GLfloat width)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[168];
- ((void (APIENTRY *)(GLfloat width)) _func)(width);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(Materialf)(GLenum face, GLenum pname, GLfloat param)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[169];
- ((void (APIENTRY *)(GLenum face, GLenum pname, GLfloat param)) _func)(face, pname, param);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(Materialfv)(GLenum face, GLenum pname, const GLfloat *params)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[170];
- ((void (APIENTRY *)(GLenum face, GLenum pname, const GLfloat *params)) _func)(face, pname, params);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(Materiali)(GLenum face, GLenum pname, GLint param)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[171];
- ((void (APIENTRY *)(GLenum face, GLenum pname, GLint param)) _func)(face, pname, param);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(Materialiv)(GLenum face, GLenum pname, const GLint *params)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[172];
- ((void (APIENTRY *)(GLenum face, GLenum pname, const GLint *params)) _func)(face, pname, params);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(PointSize)(GLfloat size)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[173];
- ((void (APIENTRY *)(GLfloat size)) _func)(size);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(PolygonMode)(GLenum face, GLenum mode)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[174];
- ((void (APIENTRY *)(GLenum face, GLenum mode)) _func)(face, mode);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(PolygonStipple)(const GLubyte *mask)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[175];
- ((void (APIENTRY *)(const GLubyte *mask)) _func)(mask);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(Scissor)(GLint x, GLint y, GLsizei width, GLsizei height)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[176];
- ((void (APIENTRY *)(GLint x, GLint y, GLsizei width, GLsizei height)) _func)(x, y, width, height);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(ShadeModel)(GLenum mode)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[177];
- ((void (APIENTRY *)(GLenum mode)) _func)(mode);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(TexParameterf)(GLenum target, GLenum pname, GLfloat param)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[178];
- ((void (APIENTRY *)(GLenum target, GLenum pname, GLfloat param)) _func)(target, pname, param);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(TexParameterfv)(GLenum target, GLenum pname, const GLfloat *params)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[179];
- ((void (APIENTRY *)(GLenum target, GLenum pname, const GLfloat *params)) _func)(target, pname, params);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(TexParameteri)(GLenum target, GLenum pname, GLint param)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[180];
- ((void (APIENTRY *)(GLenum target, GLenum pname, GLint param)) _func)(target, pname, param);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(TexParameteriv)(GLenum target, GLenum pname, const GLint *params)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[181];
- ((void (APIENTRY *)(GLenum target, GLenum pname, const GLint *params)) _func)(target, pname, params);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(TexImage1D)(GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[182];
- ((void (APIENTRY *)(GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels)) _func)(target, level, internalformat, width, border, format, type, pixels);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(TexImage2D)(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[183];
- ((void (APIENTRY *)(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels)) _func)(target, level, internalformat, width, height, border, format, type, pixels);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(TexEnvf)(GLenum target, GLenum pname, GLfloat param)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[184];
- ((void (APIENTRY *)(GLenum target, GLenum pname, GLfloat param)) _func)(target, pname, param);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(TexEnvfv)(GLenum target, GLenum pname, const GLfloat *params)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[185];
- ((void (APIENTRY *)(GLenum target, GLenum pname, const GLfloat *params)) _func)(target, pname, params);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(TexEnvi)(GLenum target, GLenum pname, GLint param)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[186];
- ((void (APIENTRY *)(GLenum target, GLenum pname, GLint param)) _func)(target, pname, param);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(TexEnviv)(GLenum target, GLenum pname, const GLint *params)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[187];
- ((void (APIENTRY *)(GLenum target, GLenum pname, const GLint *params)) _func)(target, pname, params);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(TexGend)(GLenum coord, GLenum pname, GLdouble param)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[188];
- ((void (APIENTRY *)(GLenum coord, GLenum pname, GLdouble param)) _func)(coord, pname, param);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(TexGendv)(GLenum coord, GLenum pname, const GLdouble *params)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[189];
- ((void (APIENTRY *)(GLenum coord, GLenum pname, const GLdouble *params)) _func)(coord, pname, params);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(TexGenf)(GLenum coord, GLenum pname, GLfloat param)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[190];
- ((void (APIENTRY *)(GLenum coord, GLenum pname, GLfloat param)) _func)(coord, pname, param);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(TexGenfv)(GLenum coord, GLenum pname, const GLfloat *params)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[191];
- ((void (APIENTRY *)(GLenum coord, GLenum pname, const GLfloat *params)) _func)(coord, pname, params);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(TexGeni)(GLenum coord, GLenum pname, GLint param)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[192];
- ((void (APIENTRY *)(GLenum coord, GLenum pname, GLint param)) _func)(coord, pname, param);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(TexGeniv)(GLenum coord, GLenum pname, const GLint *params)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[193];
- ((void (APIENTRY *)(GLenum coord, GLenum pname, const GLint *params)) _func)(coord, pname, params);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(FeedbackBuffer)(GLsizei size, GLenum type, GLfloat *buffer)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[194];
- ((void (APIENTRY *)(GLsizei size, GLenum type, GLfloat *buffer)) _func)(size, type, buffer);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(SelectBuffer)(GLsizei size, GLuint *buffer)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[195];
- ((void (APIENTRY *)(GLsizei size, GLuint *buffer)) _func)(size, buffer);
-}
-
-GLAPI GLint APIENTRY GLAPI_PREFIX(RenderMode)(GLenum mode)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[196];
- return ((GLint (APIENTRY *)(GLenum mode)) _func)(mode);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(InitNames)(void)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[197];
- ((void (APIENTRY *)(void)) _func)();
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(LoadName)(GLuint name)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[198];
- ((void (APIENTRY *)(GLuint name)) _func)(name);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(PassThrough)(GLfloat token)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[199];
- ((void (APIENTRY *)(GLfloat token)) _func)(token);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(PopName)(void)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[200];
- ((void (APIENTRY *)(void)) _func)();
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(PushName)(GLuint name)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[201];
- ((void (APIENTRY *)(GLuint name)) _func)(name);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(DrawBuffer)(GLenum mode)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[202];
- ((void (APIENTRY *)(GLenum mode)) _func)(mode);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(Clear)(GLbitfield mask)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[203];
- ((void (APIENTRY *)(GLbitfield mask)) _func)(mask);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(ClearAccum)(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[204];
- ((void (APIENTRY *)(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha)) _func)(red, green, blue, alpha);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(ClearIndex)(GLfloat c)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[205];
- ((void (APIENTRY *)(GLfloat c)) _func)(c);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(ClearColor)(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[206];
- ((void (APIENTRY *)(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha)) _func)(red, green, blue, alpha);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(ClearStencil)(GLint s)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[207];
- ((void (APIENTRY *)(GLint s)) _func)(s);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(ClearDepth)(GLclampd depth)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[208];
- ((void (APIENTRY *)(GLclampd depth)) _func)(depth);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(StencilMask)(GLuint mask)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[209];
- ((void (APIENTRY *)(GLuint mask)) _func)(mask);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(ColorMask)(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[210];
- ((void (APIENTRY *)(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha)) _func)(red, green, blue, alpha);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(DepthMask)(GLboolean flag)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[211];
- ((void (APIENTRY *)(GLboolean flag)) _func)(flag);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(IndexMask)(GLuint mask)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[212];
- ((void (APIENTRY *)(GLuint mask)) _func)(mask);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(Accum)(GLenum op, GLfloat value)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[213];
- ((void (APIENTRY *)(GLenum op, GLfloat value)) _func)(op, value);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(Disable)(GLenum cap)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[214];
- ((void (APIENTRY *)(GLenum cap)) _func)(cap);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(Enable)(GLenum cap)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[215];
- ((void (APIENTRY *)(GLenum cap)) _func)(cap);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(Finish)(void)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[216];
- ((void (APIENTRY *)(void)) _func)();
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(Flush)(void)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[217];
- ((void (APIENTRY *)(void)) _func)();
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(PopAttrib)(void)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[218];
- ((void (APIENTRY *)(void)) _func)();
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(PushAttrib)(GLbitfield mask)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[219];
- ((void (APIENTRY *)(GLbitfield mask)) _func)(mask);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(Map1d)(GLenum target, GLdouble u1, GLdouble u2, GLint stride, GLint order, const GLdouble *points)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[220];
- ((void (APIENTRY *)(GLenum target, GLdouble u1, GLdouble u2, GLint stride, GLint order, const GLdouble *points)) _func)(target, u1, u2, stride, order, points);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(Map1f)(GLenum target, GLfloat u1, GLfloat u2, GLint stride, GLint order, const GLfloat *points)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[221];
- ((void (APIENTRY *)(GLenum target, GLfloat u1, GLfloat u2, GLint stride, GLint order, const GLfloat *points)) _func)(target, u1, u2, stride, order, points);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(Map2d)(GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, const GLdouble *points)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[222];
- ((void (APIENTRY *)(GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, const GLdouble *points)) _func)(target, u1, u2, ustride, uorder, v1, v2, vstride, vorder, points);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(Map2f)(GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, const GLfloat *points)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[223];
- ((void (APIENTRY *)(GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, const GLfloat *points)) _func)(target, u1, u2, ustride, uorder, v1, v2, vstride, vorder, points);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(MapGrid1d)(GLint un, GLdouble u1, GLdouble u2)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[224];
- ((void (APIENTRY *)(GLint un, GLdouble u1, GLdouble u2)) _func)(un, u1, u2);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(MapGrid1f)(GLint un, GLfloat u1, GLfloat u2)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[225];
- ((void (APIENTRY *)(GLint un, GLfloat u1, GLfloat u2)) _func)(un, u1, u2);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(MapGrid2d)(GLint un, GLdouble u1, GLdouble u2, GLint vn, GLdouble v1, GLdouble v2)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[226];
- ((void (APIENTRY *)(GLint un, GLdouble u1, GLdouble u2, GLint vn, GLdouble v1, GLdouble v2)) _func)(un, u1, u2, vn, v1, v2);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(MapGrid2f)(GLint un, GLfloat u1, GLfloat u2, GLint vn, GLfloat v1, GLfloat v2)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[227];
- ((void (APIENTRY *)(GLint un, GLfloat u1, GLfloat u2, GLint vn, GLfloat v1, GLfloat v2)) _func)(un, u1, u2, vn, v1, v2);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(EvalCoord1d)(GLdouble u)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[228];
- ((void (APIENTRY *)(GLdouble u)) _func)(u);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(EvalCoord1dv)(const GLdouble *u)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[229];
- ((void (APIENTRY *)(const GLdouble *u)) _func)(u);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(EvalCoord1f)(GLfloat u)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[230];
- ((void (APIENTRY *)(GLfloat u)) _func)(u);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(EvalCoord1fv)(const GLfloat *u)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[231];
- ((void (APIENTRY *)(const GLfloat *u)) _func)(u);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(EvalCoord2d)(GLdouble u, GLdouble v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[232];
- ((void (APIENTRY *)(GLdouble u, GLdouble v)) _func)(u, v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(EvalCoord2dv)(const GLdouble *u)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[233];
- ((void (APIENTRY *)(const GLdouble *u)) _func)(u);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(EvalCoord2f)(GLfloat u, GLfloat v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[234];
- ((void (APIENTRY *)(GLfloat u, GLfloat v)) _func)(u, v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(EvalCoord2fv)(const GLfloat *u)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[235];
- ((void (APIENTRY *)(const GLfloat *u)) _func)(u);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(EvalMesh1)(GLenum mode, GLint i1, GLint i2)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[236];
- ((void (APIENTRY *)(GLenum mode, GLint i1, GLint i2)) _func)(mode, i1, i2);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(EvalPoint1)(GLint i)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[237];
- ((void (APIENTRY *)(GLint i)) _func)(i);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(EvalMesh2)(GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[238];
- ((void (APIENTRY *)(GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2)) _func)(mode, i1, i2, j1, j2);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(EvalPoint2)(GLint i, GLint j)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[239];
- ((void (APIENTRY *)(GLint i, GLint j)) _func)(i, j);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(AlphaFunc)(GLenum func, GLclampf ref)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[240];
- ((void (APIENTRY *)(GLenum func, GLclampf ref)) _func)(func, ref);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(BlendFunc)(GLenum sfactor, GLenum dfactor)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[241];
- ((void (APIENTRY *)(GLenum sfactor, GLenum dfactor)) _func)(sfactor, dfactor);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(LogicOp)(GLenum opcode)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[242];
- ((void (APIENTRY *)(GLenum opcode)) _func)(opcode);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(StencilFunc)(GLenum func, GLint ref, GLuint mask)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[243];
- ((void (APIENTRY *)(GLenum func, GLint ref, GLuint mask)) _func)(func, ref, mask);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(StencilOp)(GLenum fail, GLenum zfail, GLenum zpass)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[244];
- ((void (APIENTRY *)(GLenum fail, GLenum zfail, GLenum zpass)) _func)(fail, zfail, zpass);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(DepthFunc)(GLenum func)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[245];
- ((void (APIENTRY *)(GLenum func)) _func)(func);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(PixelZoom)(GLfloat xfactor, GLfloat yfactor)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[246];
- ((void (APIENTRY *)(GLfloat xfactor, GLfloat yfactor)) _func)(xfactor, yfactor);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(PixelTransferf)(GLenum pname, GLfloat param)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[247];
- ((void (APIENTRY *)(GLenum pname, GLfloat param)) _func)(pname, param);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(PixelTransferi)(GLenum pname, GLint param)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[248];
- ((void (APIENTRY *)(GLenum pname, GLint param)) _func)(pname, param);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(PixelStoref)(GLenum pname, GLfloat param)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[249];
- ((void (APIENTRY *)(GLenum pname, GLfloat param)) _func)(pname, param);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(PixelStorei)(GLenum pname, GLint param)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[250];
- ((void (APIENTRY *)(GLenum pname, GLint param)) _func)(pname, param);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(PixelMapfv)(GLenum map, GLsizei mapsize, const GLfloat *values)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[251];
- ((void (APIENTRY *)(GLenum map, GLsizei mapsize, const GLfloat *values)) _func)(map, mapsize, values);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(PixelMapuiv)(GLenum map, GLsizei mapsize, const GLuint *values)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[252];
- ((void (APIENTRY *)(GLenum map, GLsizei mapsize, const GLuint *values)) _func)(map, mapsize, values);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(PixelMapusv)(GLenum map, GLsizei mapsize, const GLushort *values)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[253];
- ((void (APIENTRY *)(GLenum map, GLsizei mapsize, const GLushort *values)) _func)(map, mapsize, values);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(ReadBuffer)(GLenum mode)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[254];
- ((void (APIENTRY *)(GLenum mode)) _func)(mode);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(CopyPixels)(GLint x, GLint y, GLsizei width, GLsizei height, GLenum type)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[255];
- ((void (APIENTRY *)(GLint x, GLint y, GLsizei width, GLsizei height, GLenum type)) _func)(x, y, width, height, type);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(ReadPixels)(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[256];
- ((void (APIENTRY *)(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels)) _func)(x, y, width, height, format, type, pixels);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(DrawPixels)(GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[257];
- ((void (APIENTRY *)(GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels)) _func)(width, height, format, type, pixels);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(GetBooleanv)(GLenum pname, GLboolean *params)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[258];
- ((void (APIENTRY *)(GLenum pname, GLboolean *params)) _func)(pname, params);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(GetClipPlane)(GLenum plane, GLdouble *equation)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[259];
- ((void (APIENTRY *)(GLenum plane, GLdouble *equation)) _func)(plane, equation);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(GetDoublev)(GLenum pname, GLdouble *params)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[260];
- ((void (APIENTRY *)(GLenum pname, GLdouble *params)) _func)(pname, params);
-}
-
-GLAPI GLenum APIENTRY GLAPI_PREFIX(GetError)(void)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[261];
- return ((GLenum (APIENTRY *)(void)) _func)();
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(GetFloatv)(GLenum pname, GLfloat *params)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[262];
- ((void (APIENTRY *)(GLenum pname, GLfloat *params)) _func)(pname, params);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(GetIntegerv)(GLenum pname, GLint *params)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[263];
- ((void (APIENTRY *)(GLenum pname, GLint *params)) _func)(pname, params);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(GetLightfv)(GLenum light, GLenum pname, GLfloat *params)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[264];
- ((void (APIENTRY *)(GLenum light, GLenum pname, GLfloat *params)) _func)(light, pname, params);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(GetLightiv)(GLenum light, GLenum pname, GLint *params)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[265];
- ((void (APIENTRY *)(GLenum light, GLenum pname, GLint *params)) _func)(light, pname, params);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(GetMapdv)(GLenum target, GLenum query, GLdouble *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[266];
- ((void (APIENTRY *)(GLenum target, GLenum query, GLdouble *v)) _func)(target, query, v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(GetMapfv)(GLenum target, GLenum query, GLfloat *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[267];
- ((void (APIENTRY *)(GLenum target, GLenum query, GLfloat *v)) _func)(target, query, v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(GetMapiv)(GLenum target, GLenum query, GLint *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[268];
- ((void (APIENTRY *)(GLenum target, GLenum query, GLint *v)) _func)(target, query, v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(GetMaterialfv)(GLenum face, GLenum pname, GLfloat *params)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[269];
- ((void (APIENTRY *)(GLenum face, GLenum pname, GLfloat *params)) _func)(face, pname, params);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(GetMaterialiv)(GLenum face, GLenum pname, GLint *params)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[270];
- ((void (APIENTRY *)(GLenum face, GLenum pname, GLint *params)) _func)(face, pname, params);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(GetPixelMapfv)(GLenum map, GLfloat *values)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[271];
- ((void (APIENTRY *)(GLenum map, GLfloat *values)) _func)(map, values);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(GetPixelMapuiv)(GLenum map, GLuint *values)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[272];
- ((void (APIENTRY *)(GLenum map, GLuint *values)) _func)(map, values);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(GetPixelMapusv)(GLenum map, GLushort *values)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[273];
- ((void (APIENTRY *)(GLenum map, GLushort *values)) _func)(map, values);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(GetPolygonStipple)(GLubyte *mask)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[274];
- ((void (APIENTRY *)(GLubyte *mask)) _func)(mask);
-}
-
-GLAPI const GLubyte * APIENTRY GLAPI_PREFIX(GetString)(GLenum name)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[275];
- return ((const GLubyte * (APIENTRY *)(GLenum name)) _func)(name);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(GetTexEnvfv)(GLenum target, GLenum pname, GLfloat *params)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[276];
- ((void (APIENTRY *)(GLenum target, GLenum pname, GLfloat *params)) _func)(target, pname, params);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(GetTexEnviv)(GLenum target, GLenum pname, GLint *params)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[277];
- ((void (APIENTRY *)(GLenum target, GLenum pname, GLint *params)) _func)(target, pname, params);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(GetTexGendv)(GLenum coord, GLenum pname, GLdouble *params)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[278];
- ((void (APIENTRY *)(GLenum coord, GLenum pname, GLdouble *params)) _func)(coord, pname, params);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(GetTexGenfv)(GLenum coord, GLenum pname, GLfloat *params)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[279];
- ((void (APIENTRY *)(GLenum coord, GLenum pname, GLfloat *params)) _func)(coord, pname, params);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(GetTexGeniv)(GLenum coord, GLenum pname, GLint *params)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[280];
- ((void (APIENTRY *)(GLenum coord, GLenum pname, GLint *params)) _func)(coord, pname, params);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(GetTexImage)(GLenum target, GLint level, GLenum format, GLenum type, GLvoid *pixels)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[281];
- ((void (APIENTRY *)(GLenum target, GLint level, GLenum format, GLenum type, GLvoid *pixels)) _func)(target, level, format, type, pixels);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(GetTexParameterfv)(GLenum target, GLenum pname, GLfloat *params)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[282];
- ((void (APIENTRY *)(GLenum target, GLenum pname, GLfloat *params)) _func)(target, pname, params);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(GetTexParameteriv)(GLenum target, GLenum pname, GLint *params)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[283];
- ((void (APIENTRY *)(GLenum target, GLenum pname, GLint *params)) _func)(target, pname, params);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(GetTexLevelParameterfv)(GLenum target, GLint level, GLenum pname, GLfloat *params)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[284];
- ((void (APIENTRY *)(GLenum target, GLint level, GLenum pname, GLfloat *params)) _func)(target, level, pname, params);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(GetTexLevelParameteriv)(GLenum target, GLint level, GLenum pname, GLint *params)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[285];
- ((void (APIENTRY *)(GLenum target, GLint level, GLenum pname, GLint *params)) _func)(target, level, pname, params);
-}
-
-GLAPI GLboolean APIENTRY GLAPI_PREFIX(IsEnabled)(GLenum cap)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[286];
- return ((GLboolean (APIENTRY *)(GLenum cap)) _func)(cap);
-}
-
-GLAPI GLboolean APIENTRY GLAPI_PREFIX(IsList)(GLuint list)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[287];
- return ((GLboolean (APIENTRY *)(GLuint list)) _func)(list);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(DepthRange)(GLclampd zNear, GLclampd zFar)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[288];
- ((void (APIENTRY *)(GLclampd zNear, GLclampd zFar)) _func)(zNear, zFar);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(Frustum)(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[289];
- ((void (APIENTRY *)(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar)) _func)(left, right, bottom, top, zNear, zFar);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(LoadIdentity)(void)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[290];
- ((void (APIENTRY *)(void)) _func)();
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(LoadMatrixf)(const GLfloat *m)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[291];
- ((void (APIENTRY *)(const GLfloat *m)) _func)(m);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(LoadMatrixd)(const GLdouble *m)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[292];
- ((void (APIENTRY *)(const GLdouble *m)) _func)(m);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(MatrixMode)(GLenum mode)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[293];
- ((void (APIENTRY *)(GLenum mode)) _func)(mode);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(MultMatrixf)(const GLfloat *m)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[294];
- ((void (APIENTRY *)(const GLfloat *m)) _func)(m);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(MultMatrixd)(const GLdouble *m)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[295];
- ((void (APIENTRY *)(const GLdouble *m)) _func)(m);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(Ortho)(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[296];
- ((void (APIENTRY *)(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar)) _func)(left, right, bottom, top, zNear, zFar);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(PopMatrix)(void)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[297];
- ((void (APIENTRY *)(void)) _func)();
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(PushMatrix)(void)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[298];
- ((void (APIENTRY *)(void)) _func)();
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(Rotated)(GLdouble angle, GLdouble x, GLdouble y, GLdouble z)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[299];
- ((void (APIENTRY *)(GLdouble angle, GLdouble x, GLdouble y, GLdouble z)) _func)(angle, x, y, z);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(Rotatef)(GLfloat angle, GLfloat x, GLfloat y, GLfloat z)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[300];
- ((void (APIENTRY *)(GLfloat angle, GLfloat x, GLfloat y, GLfloat z)) _func)(angle, x, y, z);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(Scaled)(GLdouble x, GLdouble y, GLdouble z)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[301];
- ((void (APIENTRY *)(GLdouble x, GLdouble y, GLdouble z)) _func)(x, y, z);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(Scalef)(GLfloat x, GLfloat y, GLfloat z)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[302];
- ((void (APIENTRY *)(GLfloat x, GLfloat y, GLfloat z)) _func)(x, y, z);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(Translated)(GLdouble x, GLdouble y, GLdouble z)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[303];
- ((void (APIENTRY *)(GLdouble x, GLdouble y, GLdouble z)) _func)(x, y, z);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(Translatef)(GLfloat x, GLfloat y, GLfloat z)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[304];
- ((void (APIENTRY *)(GLfloat x, GLfloat y, GLfloat z)) _func)(x, y, z);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(Viewport)(GLint x, GLint y, GLsizei width, GLsizei height)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[305];
- ((void (APIENTRY *)(GLint x, GLint y, GLsizei width, GLsizei height)) _func)(x, y, width, height);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(ArrayElement)(GLint i)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[306];
- ((void (APIENTRY *)(GLint i)) _func)(i);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(ArrayElementEXT)(GLint i)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[306];
- ((void (APIENTRY *)(GLint i)) _func)(i);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(BindTexture)(GLenum target, GLuint texture)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[307];
- ((void (APIENTRY *)(GLenum target, GLuint texture)) _func)(target, texture);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(BindTextureEXT)(GLenum target, GLuint texture)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[307];
- ((void (APIENTRY *)(GLenum target, GLuint texture)) _func)(target, texture);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(ColorPointer)(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[308];
- ((void (APIENTRY *)(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer)) _func)(size, type, stride, pointer);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(DisableClientState)(GLenum array)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[309];
- ((void (APIENTRY *)(GLenum array)) _func)(array);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(DrawArrays)(GLenum mode, GLint first, GLsizei count)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[310];
- ((void (APIENTRY *)(GLenum mode, GLint first, GLsizei count)) _func)(mode, first, count);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(DrawArraysEXT)(GLenum mode, GLint first, GLsizei count)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[310];
- ((void (APIENTRY *)(GLenum mode, GLint first, GLsizei count)) _func)(mode, first, count);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(DrawElements)(GLenum mode, GLsizei count, GLenum type, const GLvoid *indices)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[311];
- ((void (APIENTRY *)(GLenum mode, GLsizei count, GLenum type, const GLvoid *indices)) _func)(mode, count, type, indices);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(EdgeFlagPointer)(GLsizei stride, const GLvoid *pointer)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[312];
- ((void (APIENTRY *)(GLsizei stride, const GLvoid *pointer)) _func)(stride, pointer);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(EnableClientState)(GLenum array)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[313];
- ((void (APIENTRY *)(GLenum array)) _func)(array);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(IndexPointer)(GLenum type, GLsizei stride, const GLvoid *pointer)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[314];
- ((void (APIENTRY *)(GLenum type, GLsizei stride, const GLvoid *pointer)) _func)(type, stride, pointer);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(Indexub)(GLubyte c)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[315];
- ((void (APIENTRY *)(GLubyte c)) _func)(c);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(Indexubv)(const GLubyte *c)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[316];
- ((void (APIENTRY *)(const GLubyte *c)) _func)(c);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(InterleavedArrays)(GLenum format, GLsizei stride, const GLvoid *pointer)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[317];
- ((void (APIENTRY *)(GLenum format, GLsizei stride, const GLvoid *pointer)) _func)(format, stride, pointer);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(NormalPointer)(GLenum type, GLsizei stride, const GLvoid *pointer)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[318];
- ((void (APIENTRY *)(GLenum type, GLsizei stride, const GLvoid *pointer)) _func)(type, stride, pointer);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(PolygonOffset)(GLfloat factor, GLfloat units)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[319];
- ((void (APIENTRY *)(GLfloat factor, GLfloat units)) _func)(factor, units);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(TexCoordPointer)(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[320];
- ((void (APIENTRY *)(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer)) _func)(size, type, stride, pointer);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(VertexPointer)(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[321];
- ((void (APIENTRY *)(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer)) _func)(size, type, stride, pointer);
-}
-
-GLAPI GLboolean APIENTRY GLAPI_PREFIX(AreTexturesResident)(GLsizei n, const GLuint *textures, GLboolean *residences)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[322];
- return ((GLboolean (APIENTRY *)(GLsizei n, const GLuint *textures, GLboolean *residences)) _func)(n, textures, residences);
-}
-
-#if 0
-GLAPI GLboolean APIENTRY GLAPI_PREFIX(AreTexturesResidentEXT)(GLsizei n, const GLuint *textures, GLboolean *residences)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[322];
- return ((GLboolean (APIENTRY *)(GLsizei n, const GLuint *textures, GLboolean *residences)) _func)(n, textures, residences);
-}
-#endif
-
-GLAPI void APIENTRY GLAPI_PREFIX(CopyTexImage1D)(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[323];
- ((void (APIENTRY *)(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border)) _func)(target, level, internalformat, x, y, width, border);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(CopyTexImage1DEXT)(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[323];
- ((void (APIENTRY *)(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border)) _func)(target, level, internalformat, x, y, width, border);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(CopyTexImage2D)(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[324];
- ((void (APIENTRY *)(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border)) _func)(target, level, internalformat, x, y, width, height, border);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(CopyTexImage2DEXT)(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[324];
- ((void (APIENTRY *)(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border)) _func)(target, level, internalformat, x, y, width, height, border);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(CopyTexSubImage1D)(GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[325];
- ((void (APIENTRY *)(GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width)) _func)(target, level, xoffset, x, y, width);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(CopyTexSubImage1DEXT)(GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[325];
- ((void (APIENTRY *)(GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width)) _func)(target, level, xoffset, x, y, width);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(CopyTexSubImage2D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[326];
- ((void (APIENTRY *)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height)) _func)(target, level, xoffset, yoffset, x, y, width, height);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(CopyTexSubImage2DEXT)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[326];
- ((void (APIENTRY *)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height)) _func)(target, level, xoffset, yoffset, x, y, width, height);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(DeleteTextures)(GLsizei n, const GLuint *textures)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[327];
- ((void (APIENTRY *)(GLsizei n, const GLuint *textures)) _func)(n, textures);
-}
-
-#if 0
-GLAPI void APIENTRY GLAPI_PREFIX(DeleteTexturesEXT)(GLsizei n, const GLuint *textures)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[327];
- ((void (APIENTRY *)(GLsizei n, const GLuint *textures)) _func)(n, textures);
-}
-#endif
-
-GLAPI void APIENTRY GLAPI_PREFIX(GenTextures)(GLsizei n, GLuint *textures)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[328];
- ((void (APIENTRY *)(GLsizei n, GLuint *textures)) _func)(n, textures);
-}
-
-#if 0
-GLAPI void APIENTRY GLAPI_PREFIX(GenTexturesEXT)(GLsizei n, GLuint *textures)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[328];
- ((void (APIENTRY *)(GLsizei n, GLuint *textures)) _func)(n, textures);
-}
-#endif
-
-GLAPI void APIENTRY GLAPI_PREFIX(GetPointerv)(GLenum pname, GLvoid **params)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[329];
- ((void (APIENTRY *)(GLenum pname, GLvoid **params)) _func)(pname, params);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(GetPointervEXT)(GLenum pname, GLvoid **params)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[329];
- ((void (APIENTRY *)(GLenum pname, GLvoid **params)) _func)(pname, params);
-}
-
-GLAPI GLboolean APIENTRY GLAPI_PREFIX(IsTexture)(GLuint texture)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[330];
- return ((GLboolean (APIENTRY *)(GLuint texture)) _func)(texture);
-}
-
-#if 0
-GLAPI GLboolean APIENTRY GLAPI_PREFIX(IsTextureEXT)(GLuint texture)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[330];
- return ((GLboolean (APIENTRY *)(GLuint texture)) _func)(texture);
-}
-#endif
-
-GLAPI void APIENTRY GLAPI_PREFIX(PrioritizeTextures)(GLsizei n, const GLuint *textures, const GLclampf *priorities)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[331];
- ((void (APIENTRY *)(GLsizei n, const GLuint *textures, const GLclampf *priorities)) _func)(n, textures, priorities);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(PrioritizeTexturesEXT)(GLsizei n, const GLuint *textures, const GLclampf *priorities)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[331];
- ((void (APIENTRY *)(GLsizei n, const GLuint *textures, const GLclampf *priorities)) _func)(n, textures, priorities);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(TexSubImage1D)(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[332];
- ((void (APIENTRY *)(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels)) _func)(target, level, xoffset, width, format, type, pixels);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(TexSubImage1DEXT)(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[332];
- ((void (APIENTRY *)(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels)) _func)(target, level, xoffset, width, format, type, pixels);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(TexSubImage2D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[333];
- ((void (APIENTRY *)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels)) _func)(target, level, xoffset, yoffset, width, height, format, type, pixels);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(TexSubImage2DEXT)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[333];
- ((void (APIENTRY *)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels)) _func)(target, level, xoffset, yoffset, width, height, format, type, pixels);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(PopClientAttrib)(void)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[334];
- ((void (APIENTRY *)(void)) _func)();
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(PushClientAttrib)(GLbitfield mask)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[335];
- ((void (APIENTRY *)(GLbitfield mask)) _func)(mask);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(BlendColor)(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[336];
- ((void (APIENTRY *)(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha)) _func)(red, green, blue, alpha);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(BlendColorEXT)(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[336];
- ((void (APIENTRY *)(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha)) _func)(red, green, blue, alpha);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(BlendEquation)(GLenum mode)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[337];
- ((void (APIENTRY *)(GLenum mode)) _func)(mode);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(BlendEquationEXT)(GLenum mode)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[337];
- ((void (APIENTRY *)(GLenum mode)) _func)(mode);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(DrawRangeElements)(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[338];
- ((void (APIENTRY *)(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices)) _func)(mode, start, end, count, type, indices);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(DrawRangeElementsEXT)(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[338];
- ((void (APIENTRY *)(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices)) _func)(mode, start, end, count, type, indices);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(ColorTable)(GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[339];
- ((void (APIENTRY *)(GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table)) _func)(target, internalformat, width, format, type, table);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(ColorTableEXT)(GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[339];
- ((void (APIENTRY *)(GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table)) _func)(target, internalformat, width, format, type, table);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(ColorTableParameterfv)(GLenum target, GLenum pname, const GLfloat *params)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[340];
- ((void (APIENTRY *)(GLenum target, GLenum pname, const GLfloat *params)) _func)(target, pname, params);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(ColorTableParameteriv)(GLenum target, GLenum pname, const GLint *params)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[341];
- ((void (APIENTRY *)(GLenum target, GLenum pname, const GLint *params)) _func)(target, pname, params);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(CopyColorTable)(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[342];
- ((void (APIENTRY *)(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width)) _func)(target, internalformat, x, y, width);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(GetColorTable)(GLenum target, GLenum format, GLenum type, GLvoid *table)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[343];
- ((void (APIENTRY *)(GLenum target, GLenum format, GLenum type, GLvoid *table)) _func)(target, format, type, table);
-}
-
-#if 0
-GLAPI void APIENTRY GLAPI_PREFIX(GetColorTableEXT)(GLenum target, GLenum format, GLenum type, GLvoid *table)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[343];
- ((void (APIENTRY *)(GLenum target, GLenum format, GLenum type, GLvoid *table)) _func)(target, format, type, table);
-}
-#endif
-
-GLAPI void APIENTRY GLAPI_PREFIX(GetColorTableParameterfv)(GLenum target, GLenum pname, GLfloat *params)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[344];
- ((void (APIENTRY *)(GLenum target, GLenum pname, GLfloat *params)) _func)(target, pname, params);
-}
-
-#if 0
-GLAPI void APIENTRY GLAPI_PREFIX(GetColorTableParameterfvEXT)(GLenum target, GLenum pname, GLfloat *params)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[344];
- ((void (APIENTRY *)(GLenum target, GLenum pname, GLfloat *params)) _func)(target, pname, params);
-}
-#endif
-
-GLAPI void APIENTRY GLAPI_PREFIX(GetColorTableParameteriv)(GLenum target, GLenum pname, GLint *params)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[345];
- ((void (APIENTRY *)(GLenum target, GLenum pname, GLint *params)) _func)(target, pname, params);
-}
-
-#if 0
-GLAPI void APIENTRY GLAPI_PREFIX(GetColorTableParameterivEXT)(GLenum target, GLenum pname, GLint *params)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[345];
- ((void (APIENTRY *)(GLenum target, GLenum pname, GLint *params)) _func)(target, pname, params);
-}
-#endif
-
-GLAPI void APIENTRY GLAPI_PREFIX(ColorSubTable)(GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *data)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[346];
- ((void (APIENTRY *)(GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *data)) _func)(target, start, count, format, type, data);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(CopyColorSubTable)(GLenum target, GLsizei start, GLint x, GLint y, GLsizei width)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[347];
- ((void (APIENTRY *)(GLenum target, GLsizei start, GLint x, GLint y, GLsizei width)) _func)(target, start, x, y, width);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(ConvolutionFilter1D)(GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *image)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[348];
- ((void (APIENTRY *)(GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *image)) _func)(target, internalformat, width, format, type, image);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(ConvolutionFilter2D)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *image)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[349];
- ((void (APIENTRY *)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *image)) _func)(target, internalformat, width, height, format, type, image);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(ConvolutionParameterf)(GLenum target, GLenum pname, GLfloat params)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[350];
- ((void (APIENTRY *)(GLenum target, GLenum pname, GLfloat params)) _func)(target, pname, params);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(ConvolutionParameterfv)(GLenum target, GLenum pname, const GLfloat *params)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[351];
- ((void (APIENTRY *)(GLenum target, GLenum pname, const GLfloat *params)) _func)(target, pname, params);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(ConvolutionParameteri)(GLenum target, GLenum pname, GLint params)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[352];
- ((void (APIENTRY *)(GLenum target, GLenum pname, GLint params)) _func)(target, pname, params);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(ConvolutionParameteriv)(GLenum target, GLenum pname, const GLint *params)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[353];
- ((void (APIENTRY *)(GLenum target, GLenum pname, const GLint *params)) _func)(target, pname, params);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(CopyConvolutionFilter1D)(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[354];
- ((void (APIENTRY *)(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width)) _func)(target, internalformat, x, y, width);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(CopyConvolutionFilter2D)(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[355];
- ((void (APIENTRY *)(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height)) _func)(target, internalformat, x, y, width, height);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(GetConvolutionFilter)(GLenum target, GLenum format, GLenum type, GLvoid *image)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[356];
- ((void (APIENTRY *)(GLenum target, GLenum format, GLenum type, GLvoid *image)) _func)(target, format, type, image);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(GetConvolutionParameterfv)(GLenum target, GLenum pname, GLfloat *params)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[357];
- ((void (APIENTRY *)(GLenum target, GLenum pname, GLfloat *params)) _func)(target, pname, params);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(GetConvolutionParameteriv)(GLenum target, GLenum pname, GLint *params)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[358];
- ((void (APIENTRY *)(GLenum target, GLenum pname, GLint *params)) _func)(target, pname, params);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(GetSeparableFilter)(GLenum target, GLenum format, GLenum type, GLvoid *row, GLvoid *column, GLvoid *span)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[359];
- ((void (APIENTRY *)(GLenum target, GLenum format, GLenum type, GLvoid *row, GLvoid *column, GLvoid *span)) _func)(target, format, type, row, column, span);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(SeparableFilter2D)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *row, const GLvoid *column)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[360];
- ((void (APIENTRY *)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *row, const GLvoid *column)) _func)(target, internalformat, width, height, format, type, row, column);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(GetHistogram)(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[361];
- ((void (APIENTRY *)(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values)) _func)(target, reset, format, type, values);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(GetHistogramParameterfv)(GLenum target, GLenum pname, GLfloat *params)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[362];
- ((void (APIENTRY *)(GLenum target, GLenum pname, GLfloat *params)) _func)(target, pname, params);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(GetHistogramParameteriv)(GLenum target, GLenum pname, GLint *params)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[363];
- ((void (APIENTRY *)(GLenum target, GLenum pname, GLint *params)) _func)(target, pname, params);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(GetMinmax)(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[364];
- ((void (APIENTRY *)(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values)) _func)(target, reset, format, type, values);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(GetMinmaxParameterfv)(GLenum target, GLenum pname, GLfloat *params)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[365];
- ((void (APIENTRY *)(GLenum target, GLenum pname, GLfloat *params)) _func)(target, pname, params);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(GetMinmaxParameteriv)(GLenum target, GLenum pname, GLint *params)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[366];
- ((void (APIENTRY *)(GLenum target, GLenum pname, GLint *params)) _func)(target, pname, params);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(Histogram)(GLenum target, GLsizei width, GLenum internalformat, GLboolean sink)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[367];
- ((void (APIENTRY *)(GLenum target, GLsizei width, GLenum internalformat, GLboolean sink)) _func)(target, width, internalformat, sink);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(Minmax)(GLenum target, GLenum internalformat, GLboolean sink)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[368];
- ((void (APIENTRY *)(GLenum target, GLenum internalformat, GLboolean sink)) _func)(target, internalformat, sink);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(ResetHistogram)(GLenum target)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[369];
- ((void (APIENTRY *)(GLenum target)) _func)(target);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(ResetMinmax)(GLenum target)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[370];
- ((void (APIENTRY *)(GLenum target)) _func)(target);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(TexImage3D)(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[371];
- ((void (APIENTRY *)(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels)) _func)(target, level, internalformat, width, height, depth, border, format, type, pixels);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(TexImage3DEXT)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[371];
- ((void (APIENTRY *)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels)) _func)(target, level, internalformat, width, height, depth, border, format, type, pixels);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(TexSubImage3D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[372];
- ((void (APIENTRY *)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels)) _func)(target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(TexSubImage3DEXT)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[372];
- ((void (APIENTRY *)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels)) _func)(target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(CopyTexSubImage3D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[373];
- ((void (APIENTRY *)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height)) _func)(target, level, xoffset, yoffset, zoffset, x, y, width, height);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(CopyTexSubImage3DEXT)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[373];
- ((void (APIENTRY *)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height)) _func)(target, level, xoffset, yoffset, zoffset, x, y, width, height);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(ActiveTextureARB)(GLenum texture)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[374];
- ((void (APIENTRY *)(GLenum texture)) _func)(texture);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(ActiveTexture)(GLenum texture)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[374];
- ((void (APIENTRY *)(GLenum texture)) _func)(texture);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(ClientActiveTextureARB)(GLenum texture)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[375];
- ((void (APIENTRY *)(GLenum texture)) _func)(texture);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(ClientActiveTexture)(GLenum texture)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[375];
- ((void (APIENTRY *)(GLenum texture)) _func)(texture);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord1dARB)(GLenum target, GLdouble s)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[376];
- ((void (APIENTRY *)(GLenum target, GLdouble s)) _func)(target, s);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord1d)(GLenum target, GLdouble s)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[376];
- ((void (APIENTRY *)(GLenum target, GLdouble s)) _func)(target, s);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord1dvARB)(GLenum target, const GLdouble *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[377];
- ((void (APIENTRY *)(GLenum target, const GLdouble *v)) _func)(target, v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord1dv)(GLenum target, const GLdouble *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[377];
- ((void (APIENTRY *)(GLenum target, const GLdouble *v)) _func)(target, v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord1fARB)(GLenum target, GLfloat s)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[378];
- ((void (APIENTRY *)(GLenum target, GLfloat s)) _func)(target, s);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord1f)(GLenum target, GLfloat s)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[378];
- ((void (APIENTRY *)(GLenum target, GLfloat s)) _func)(target, s);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord1fvARB)(GLenum target, const GLfloat *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[379];
- ((void (APIENTRY *)(GLenum target, const GLfloat *v)) _func)(target, v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord1fv)(GLenum target, const GLfloat *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[379];
- ((void (APIENTRY *)(GLenum target, const GLfloat *v)) _func)(target, v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord1iARB)(GLenum target, GLint s)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[380];
- ((void (APIENTRY *)(GLenum target, GLint s)) _func)(target, s);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord1i)(GLenum target, GLint s)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[380];
- ((void (APIENTRY *)(GLenum target, GLint s)) _func)(target, s);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord1ivARB)(GLenum target, const GLint *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[381];
- ((void (APIENTRY *)(GLenum target, const GLint *v)) _func)(target, v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord1iv)(GLenum target, const GLint *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[381];
- ((void (APIENTRY *)(GLenum target, const GLint *v)) _func)(target, v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord1sARB)(GLenum target, GLshort s)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[382];
- ((void (APIENTRY *)(GLenum target, GLshort s)) _func)(target, s);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord1s)(GLenum target, GLshort s)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[382];
- ((void (APIENTRY *)(GLenum target, GLshort s)) _func)(target, s);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord1svARB)(GLenum target, const GLshort *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[383];
- ((void (APIENTRY *)(GLenum target, const GLshort *v)) _func)(target, v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord1sv)(GLenum target, const GLshort *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[383];
- ((void (APIENTRY *)(GLenum target, const GLshort *v)) _func)(target, v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord2dARB)(GLenum target, GLdouble s, GLdouble t)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[384];
- ((void (APIENTRY *)(GLenum target, GLdouble s, GLdouble t)) _func)(target, s, t);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord2d)(GLenum target, GLdouble s, GLdouble t)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[384];
- ((void (APIENTRY *)(GLenum target, GLdouble s, GLdouble t)) _func)(target, s, t);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord2dvARB)(GLenum target, const GLdouble *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[385];
- ((void (APIENTRY *)(GLenum target, const GLdouble *v)) _func)(target, v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord2dv)(GLenum target, const GLdouble *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[385];
- ((void (APIENTRY *)(GLenum target, const GLdouble *v)) _func)(target, v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord2fARB)(GLenum target, GLfloat s, GLfloat t)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[386];
- ((void (APIENTRY *)(GLenum target, GLfloat s, GLfloat t)) _func)(target, s, t);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord2f)(GLenum target, GLfloat s, GLfloat t)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[386];
- ((void (APIENTRY *)(GLenum target, GLfloat s, GLfloat t)) _func)(target, s, t);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord2fvARB)(GLenum target, const GLfloat *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[387];
- ((void (APIENTRY *)(GLenum target, const GLfloat *v)) _func)(target, v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord2fv)(GLenum target, const GLfloat *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[387];
- ((void (APIENTRY *)(GLenum target, const GLfloat *v)) _func)(target, v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord2iARB)(GLenum target, GLint s, GLint t)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[388];
- ((void (APIENTRY *)(GLenum target, GLint s, GLint t)) _func)(target, s, t);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord2i)(GLenum target, GLint s, GLint t)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[388];
- ((void (APIENTRY *)(GLenum target, GLint s, GLint t)) _func)(target, s, t);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord2ivARB)(GLenum target, const GLint *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[389];
- ((void (APIENTRY *)(GLenum target, const GLint *v)) _func)(target, v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord2iv)(GLenum target, const GLint *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[389];
- ((void (APIENTRY *)(GLenum target, const GLint *v)) _func)(target, v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord2sARB)(GLenum target, GLshort s, GLshort t)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[390];
- ((void (APIENTRY *)(GLenum target, GLshort s, GLshort t)) _func)(target, s, t);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord2s)(GLenum target, GLshort s, GLshort t)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[390];
- ((void (APIENTRY *)(GLenum target, GLshort s, GLshort t)) _func)(target, s, t);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord2svARB)(GLenum target, const GLshort *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[391];
- ((void (APIENTRY *)(GLenum target, const GLshort *v)) _func)(target, v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord2sv)(GLenum target, const GLshort *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[391];
- ((void (APIENTRY *)(GLenum target, const GLshort *v)) _func)(target, v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord3dARB)(GLenum target, GLdouble s, GLdouble t, GLdouble r)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[392];
- ((void (APIENTRY *)(GLenum target, GLdouble s, GLdouble t, GLdouble r)) _func)(target, s, t, r);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord3d)(GLenum target, GLdouble s, GLdouble t, GLdouble r)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[392];
- ((void (APIENTRY *)(GLenum target, GLdouble s, GLdouble t, GLdouble r)) _func)(target, s, t, r);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord3dvARB)(GLenum target, const GLdouble *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[393];
- ((void (APIENTRY *)(GLenum target, const GLdouble *v)) _func)(target, v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord3dv)(GLenum target, const GLdouble *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[393];
- ((void (APIENTRY *)(GLenum target, const GLdouble *v)) _func)(target, v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord3fARB)(GLenum target, GLfloat s, GLfloat t, GLfloat r)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[394];
- ((void (APIENTRY *)(GLenum target, GLfloat s, GLfloat t, GLfloat r)) _func)(target, s, t, r);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord3f)(GLenum target, GLfloat s, GLfloat t, GLfloat r)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[394];
- ((void (APIENTRY *)(GLenum target, GLfloat s, GLfloat t, GLfloat r)) _func)(target, s, t, r);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord3fvARB)(GLenum target, const GLfloat *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[395];
- ((void (APIENTRY *)(GLenum target, const GLfloat *v)) _func)(target, v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord3fv)(GLenum target, const GLfloat *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[395];
- ((void (APIENTRY *)(GLenum target, const GLfloat *v)) _func)(target, v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord3iARB)(GLenum target, GLint s, GLint t, GLint r)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[396];
- ((void (APIENTRY *)(GLenum target, GLint s, GLint t, GLint r)) _func)(target, s, t, r);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord3i)(GLenum target, GLint s, GLint t, GLint r)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[396];
- ((void (APIENTRY *)(GLenum target, GLint s, GLint t, GLint r)) _func)(target, s, t, r);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord3ivARB)(GLenum target, const GLint *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[397];
- ((void (APIENTRY *)(GLenum target, const GLint *v)) _func)(target, v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord3iv)(GLenum target, const GLint *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[397];
- ((void (APIENTRY *)(GLenum target, const GLint *v)) _func)(target, v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord3sARB)(GLenum target, GLshort s, GLshort t, GLshort r)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[398];
- ((void (APIENTRY *)(GLenum target, GLshort s, GLshort t, GLshort r)) _func)(target, s, t, r);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord3s)(GLenum target, GLshort s, GLshort t, GLshort r)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[398];
- ((void (APIENTRY *)(GLenum target, GLshort s, GLshort t, GLshort r)) _func)(target, s, t, r);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord3svARB)(GLenum target, const GLshort *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[399];
- ((void (APIENTRY *)(GLenum target, const GLshort *v)) _func)(target, v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord3sv)(GLenum target, const GLshort *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[399];
- ((void (APIENTRY *)(GLenum target, const GLshort *v)) _func)(target, v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord4dARB)(GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[400];
- ((void (APIENTRY *)(GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q)) _func)(target, s, t, r, q);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord4d)(GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[400];
- ((void (APIENTRY *)(GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q)) _func)(target, s, t, r, q);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord4dvARB)(GLenum target, const GLdouble *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[401];
- ((void (APIENTRY *)(GLenum target, const GLdouble *v)) _func)(target, v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord4dv)(GLenum target, const GLdouble *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[401];
- ((void (APIENTRY *)(GLenum target, const GLdouble *v)) _func)(target, v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord4fARB)(GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[402];
- ((void (APIENTRY *)(GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q)) _func)(target, s, t, r, q);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord4f)(GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[402];
- ((void (APIENTRY *)(GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q)) _func)(target, s, t, r, q);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord4fvARB)(GLenum target, const GLfloat *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[403];
- ((void (APIENTRY *)(GLenum target, const GLfloat *v)) _func)(target, v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord4fv)(GLenum target, const GLfloat *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[403];
- ((void (APIENTRY *)(GLenum target, const GLfloat *v)) _func)(target, v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord4iARB)(GLenum target, GLint s, GLint t, GLint r, GLint q)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[404];
- ((void (APIENTRY *)(GLenum target, GLint s, GLint t, GLint r, GLint q)) _func)(target, s, t, r, q);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord4i)(GLenum target, GLint s, GLint t, GLint r, GLint q)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[404];
- ((void (APIENTRY *)(GLenum target, GLint s, GLint t, GLint r, GLint q)) _func)(target, s, t, r, q);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord4ivARB)(GLenum target, const GLint *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[405];
- ((void (APIENTRY *)(GLenum target, const GLint *v)) _func)(target, v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord4iv)(GLenum target, const GLint *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[405];
- ((void (APIENTRY *)(GLenum target, const GLint *v)) _func)(target, v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord4sARB)(GLenum target, GLshort s, GLshort t, GLshort r, GLshort q)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[406];
- ((void (APIENTRY *)(GLenum target, GLshort s, GLshort t, GLshort r, GLshort q)) _func)(target, s, t, r, q);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord4s)(GLenum target, GLshort s, GLshort t, GLshort r, GLshort q)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[406];
- ((void (APIENTRY *)(GLenum target, GLshort s, GLshort t, GLshort r, GLshort q)) _func)(target, s, t, r, q);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord4svARB)(GLenum target, const GLshort *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[407];
- ((void (APIENTRY *)(GLenum target, const GLshort *v)) _func)(target, v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord4sv)(GLenum target, const GLshort *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[407];
- ((void (APIENTRY *)(GLenum target, const GLshort *v)) _func)(target, v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(AttachShader)(GLuint program, GLuint shader)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[408];
- ((void (APIENTRY *)(GLuint program, GLuint shader)) _func)(program, shader);
-}
-
-GLAPI GLuint APIENTRY GLAPI_PREFIX(CreateProgram)(void)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[409];
- return ((GLuint (APIENTRY *)(void)) _func)();
-}
-
-GLAPI GLuint APIENTRY GLAPI_PREFIX(CreateShader)(GLenum type)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[410];
- return ((GLuint (APIENTRY *)(GLenum type)) _func)(type);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(DeleteProgram)(GLuint program)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[411];
- ((void (APIENTRY *)(GLuint program)) _func)(program);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(DeleteShader)(GLuint program)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[412];
- ((void (APIENTRY *)(GLuint program)) _func)(program);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(DetachShader)(GLuint program, GLuint shader)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[413];
- ((void (APIENTRY *)(GLuint program, GLuint shader)) _func)(program, shader);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(GetAttachedShaders)(GLuint program, GLsizei maxCount, GLsizei *count, GLuint *obj)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[414];
- ((void (APIENTRY *)(GLuint program, GLsizei maxCount, GLsizei *count, GLuint *obj)) _func)(program, maxCount, count, obj);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(GetProgramInfoLog)(GLuint program, GLsizei bufSize, GLsizei *length, GLchar *infoLog)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[415];
- ((void (APIENTRY *)(GLuint program, GLsizei bufSize, GLsizei *length, GLchar *infoLog)) _func)(program, bufSize, length, infoLog);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(GetProgramiv)(GLuint program, GLenum pname, GLint *params)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[416];
- ((void (APIENTRY *)(GLuint program, GLenum pname, GLint *params)) _func)(program, pname, params);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(GetShaderInfoLog)(GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *infoLog)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[417];
- ((void (APIENTRY *)(GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *infoLog)) _func)(shader, bufSize, length, infoLog);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(GetShaderiv)(GLuint shader, GLenum pname, GLint *params)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[418];
- ((void (APIENTRY *)(GLuint shader, GLenum pname, GLint *params)) _func)(shader, pname, params);
-}
-
-GLAPI GLboolean APIENTRY GLAPI_PREFIX(IsProgram)(GLuint program)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[419];
- return ((GLboolean (APIENTRY *)(GLuint program)) _func)(program);
-}
-
-GLAPI GLboolean APIENTRY GLAPI_PREFIX(IsShader)(GLuint shader)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[420];
- return ((GLboolean (APIENTRY *)(GLuint shader)) _func)(shader);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(StencilFuncSeparate)(GLenum face, GLenum func, GLint ref, GLuint mask)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[421];
- ((void (APIENTRY *)(GLenum face, GLenum func, GLint ref, GLuint mask)) _func)(face, func, ref, mask);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(StencilMaskSeparate)(GLenum face, GLuint mask)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[422];
- ((void (APIENTRY *)(GLenum face, GLuint mask)) _func)(face, mask);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(StencilOpSeparate)(GLenum face, GLenum sfail, GLenum zfail, GLenum zpass)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[423];
- ((void (APIENTRY *)(GLenum face, GLenum sfail, GLenum zfail, GLenum zpass)) _func)(face, sfail, zfail, zpass);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(UniformMatrix2x3fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[424];
- ((void (APIENTRY *)(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)) _func)(location, count, transpose, value);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(UniformMatrix2x4fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[425];
- ((void (APIENTRY *)(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)) _func)(location, count, transpose, value);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(UniformMatrix3x2fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[426];
- ((void (APIENTRY *)(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)) _func)(location, count, transpose, value);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(UniformMatrix3x4fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[427];
- ((void (APIENTRY *)(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)) _func)(location, count, transpose, value);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(UniformMatrix4x2fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[428];
- ((void (APIENTRY *)(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)) _func)(location, count, transpose, value);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(UniformMatrix4x3fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[429];
- ((void (APIENTRY *)(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)) _func)(location, count, transpose, value);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(ClampColor)(GLenum target, GLenum clamp)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[430];
- ((void (APIENTRY *)(GLenum target, GLenum clamp)) _func)(target, clamp);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(ClearBufferfi)(GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[431];
- ((void (APIENTRY *)(GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil)) _func)(buffer, drawbuffer, depth, stencil);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(ClearBufferfv)(GLenum buffer, GLint drawbuffer, const GLfloat *value)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[432];
- ((void (APIENTRY *)(GLenum buffer, GLint drawbuffer, const GLfloat *value)) _func)(buffer, drawbuffer, value);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(ClearBufferiv)(GLenum buffer, GLint drawbuffer, const GLint *value)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[433];
- ((void (APIENTRY *)(GLenum buffer, GLint drawbuffer, const GLint *value)) _func)(buffer, drawbuffer, value);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(ClearBufferuiv)(GLenum buffer, GLint drawbuffer, const GLuint *value)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[434];
- ((void (APIENTRY *)(GLenum buffer, GLint drawbuffer, const GLuint *value)) _func)(buffer, drawbuffer, value);
-}
-
-GLAPI const GLubyte * APIENTRY GLAPI_PREFIX(GetStringi)(GLenum name, GLuint index)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[435];
- return ((const GLubyte * (APIENTRY *)(GLenum name, GLuint index)) _func)(name, index);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(TexBuffer)(GLenum target, GLenum internalFormat, GLuint buffer)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[436];
- ((void (APIENTRY *)(GLenum target, GLenum internalFormat, GLuint buffer)) _func)(target, internalFormat, buffer);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(FramebufferTexture)(GLenum target, GLenum attachment, GLuint texture, GLint level)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[437];
- ((void (APIENTRY *)(GLenum target, GLenum attachment, GLuint texture, GLint level)) _func)(target, attachment, texture, level);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(GetBufferParameteri64v)(GLenum target, GLenum pname, GLint64 *params)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[438];
- ((void (APIENTRY *)(GLenum target, GLenum pname, GLint64 *params)) _func)(target, pname, params);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(GetInteger64i_v)(GLenum cap, GLuint index, GLint64 *data)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[439];
- ((void (APIENTRY *)(GLenum cap, GLuint index, GLint64 *data)) _func)(cap, index, data);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribDivisor)(GLuint index, GLuint divisor)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[440];
- ((void (APIENTRY *)(GLuint index, GLuint divisor)) _func)(index, divisor);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(LoadTransposeMatrixdARB)(const GLdouble *m)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[441];
- ((void (APIENTRY *)(const GLdouble *m)) _func)(m);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(LoadTransposeMatrixd)(const GLdouble *m)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[441];
- ((void (APIENTRY *)(const GLdouble *m)) _func)(m);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(LoadTransposeMatrixfARB)(const GLfloat *m)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[442];
- ((void (APIENTRY *)(const GLfloat *m)) _func)(m);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(LoadTransposeMatrixf)(const GLfloat *m)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[442];
- ((void (APIENTRY *)(const GLfloat *m)) _func)(m);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(MultTransposeMatrixdARB)(const GLdouble *m)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[443];
- ((void (APIENTRY *)(const GLdouble *m)) _func)(m);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(MultTransposeMatrixd)(const GLdouble *m)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[443];
- ((void (APIENTRY *)(const GLdouble *m)) _func)(m);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(MultTransposeMatrixfARB)(const GLfloat *m)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[444];
- ((void (APIENTRY *)(const GLfloat *m)) _func)(m);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(MultTransposeMatrixf)(const GLfloat *m)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[444];
- ((void (APIENTRY *)(const GLfloat *m)) _func)(m);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(SampleCoverageARB)(GLclampf value, GLboolean invert)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[445];
- ((void (APIENTRY *)(GLclampf value, GLboolean invert)) _func)(value, invert);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(SampleCoverage)(GLclampf value, GLboolean invert)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[445];
- ((void (APIENTRY *)(GLclampf value, GLboolean invert)) _func)(value, invert);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(CompressedTexImage1DARB)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[446];
- ((void (APIENTRY *)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data)) _func)(target, level, internalformat, width, border, imageSize, data);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(CompressedTexImage1D)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[446];
- ((void (APIENTRY *)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data)) _func)(target, level, internalformat, width, border, imageSize, data);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(CompressedTexImage2DARB)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[447];
- ((void (APIENTRY *)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data)) _func)(target, level, internalformat, width, height, border, imageSize, data);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(CompressedTexImage2D)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[447];
- ((void (APIENTRY *)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data)) _func)(target, level, internalformat, width, height, border, imageSize, data);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(CompressedTexImage3DARB)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[448];
- ((void (APIENTRY *)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data)) _func)(target, level, internalformat, width, height, depth, border, imageSize, data);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(CompressedTexImage3D)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[448];
- ((void (APIENTRY *)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data)) _func)(target, level, internalformat, width, height, depth, border, imageSize, data);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(CompressedTexSubImage1DARB)(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[449];
- ((void (APIENTRY *)(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data)) _func)(target, level, xoffset, width, format, imageSize, data);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(CompressedTexSubImage1D)(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[449];
- ((void (APIENTRY *)(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data)) _func)(target, level, xoffset, width, format, imageSize, data);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(CompressedTexSubImage2DARB)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[450];
- ((void (APIENTRY *)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data)) _func)(target, level, xoffset, yoffset, width, height, format, imageSize, data);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(CompressedTexSubImage2D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[450];
- ((void (APIENTRY *)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data)) _func)(target, level, xoffset, yoffset, width, height, format, imageSize, data);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(CompressedTexSubImage3DARB)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[451];
- ((void (APIENTRY *)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data)) _func)(target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, data);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(CompressedTexSubImage3D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[451];
- ((void (APIENTRY *)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data)) _func)(target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, data);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(GetCompressedTexImageARB)(GLenum target, GLint level, GLvoid *img)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[452];
- ((void (APIENTRY *)(GLenum target, GLint level, GLvoid *img)) _func)(target, level, img);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(GetCompressedTexImage)(GLenum target, GLint level, GLvoid *img)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[452];
- ((void (APIENTRY *)(GLenum target, GLint level, GLvoid *img)) _func)(target, level, img);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(DisableVertexAttribArrayARB)(GLuint index)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[453];
- ((void (APIENTRY *)(GLuint index)) _func)(index);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(DisableVertexAttribArray)(GLuint index)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[453];
- ((void (APIENTRY *)(GLuint index)) _func)(index);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(EnableVertexAttribArrayARB)(GLuint index)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[454];
- ((void (APIENTRY *)(GLuint index)) _func)(index);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(EnableVertexAttribArray)(GLuint index)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[454];
- ((void (APIENTRY *)(GLuint index)) _func)(index);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(GetProgramEnvParameterdvARB)(GLenum target, GLuint index, GLdouble *params)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[455];
- ((void (APIENTRY *)(GLenum target, GLuint index, GLdouble *params)) _func)(target, index, params);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(GetProgramEnvParameterfvARB)(GLenum target, GLuint index, GLfloat *params)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[456];
- ((void (APIENTRY *)(GLenum target, GLuint index, GLfloat *params)) _func)(target, index, params);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(GetProgramLocalParameterdvARB)(GLenum target, GLuint index, GLdouble *params)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[457];
- ((void (APIENTRY *)(GLenum target, GLuint index, GLdouble *params)) _func)(target, index, params);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(GetProgramLocalParameterfvARB)(GLenum target, GLuint index, GLfloat *params)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[458];
- ((void (APIENTRY *)(GLenum target, GLuint index, GLfloat *params)) _func)(target, index, params);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(GetProgramStringARB)(GLenum target, GLenum pname, GLvoid *string)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[459];
- ((void (APIENTRY *)(GLenum target, GLenum pname, GLvoid *string)) _func)(target, pname, string);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(GetProgramivARB)(GLenum target, GLenum pname, GLint *params)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[460];
- ((void (APIENTRY *)(GLenum target, GLenum pname, GLint *params)) _func)(target, pname, params);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(GetVertexAttribdvARB)(GLuint index, GLenum pname, GLdouble *params)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[461];
- ((void (APIENTRY *)(GLuint index, GLenum pname, GLdouble *params)) _func)(index, pname, params);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(GetVertexAttribdv)(GLuint index, GLenum pname, GLdouble *params)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[461];
- ((void (APIENTRY *)(GLuint index, GLenum pname, GLdouble *params)) _func)(index, pname, params);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(GetVertexAttribfvARB)(GLuint index, GLenum pname, GLfloat *params)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[462];
- ((void (APIENTRY *)(GLuint index, GLenum pname, GLfloat *params)) _func)(index, pname, params);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(GetVertexAttribfv)(GLuint index, GLenum pname, GLfloat *params)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[462];
- ((void (APIENTRY *)(GLuint index, GLenum pname, GLfloat *params)) _func)(index, pname, params);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(GetVertexAttribivARB)(GLuint index, GLenum pname, GLint *params)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[463];
- ((void (APIENTRY *)(GLuint index, GLenum pname, GLint *params)) _func)(index, pname, params);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(GetVertexAttribiv)(GLuint index, GLenum pname, GLint *params)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[463];
- ((void (APIENTRY *)(GLuint index, GLenum pname, GLint *params)) _func)(index, pname, params);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(ProgramEnvParameter4dARB)(GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[464];
- ((void (APIENTRY *)(GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w)) _func)(target, index, x, y, z, w);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(ProgramParameter4dNV)(GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[464];
- ((void (APIENTRY *)(GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w)) _func)(target, index, x, y, z, w);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(ProgramEnvParameter4dvARB)(GLenum target, GLuint index, const GLdouble *params)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[465];
- ((void (APIENTRY *)(GLenum target, GLuint index, const GLdouble *params)) _func)(target, index, params);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(ProgramParameter4dvNV)(GLenum target, GLuint index, const GLdouble *params)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[465];
- ((void (APIENTRY *)(GLenum target, GLuint index, const GLdouble *params)) _func)(target, index, params);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(ProgramEnvParameter4fARB)(GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[466];
- ((void (APIENTRY *)(GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w)) _func)(target, index, x, y, z, w);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(ProgramParameter4fNV)(GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[466];
- ((void (APIENTRY *)(GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w)) _func)(target, index, x, y, z, w);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(ProgramEnvParameter4fvARB)(GLenum target, GLuint index, const GLfloat *params)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[467];
- ((void (APIENTRY *)(GLenum target, GLuint index, const GLfloat *params)) _func)(target, index, params);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(ProgramParameter4fvNV)(GLenum target, GLuint index, const GLfloat *params)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[467];
- ((void (APIENTRY *)(GLenum target, GLuint index, const GLfloat *params)) _func)(target, index, params);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(ProgramLocalParameter4dARB)(GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[468];
- ((void (APIENTRY *)(GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w)) _func)(target, index, x, y, z, w);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(ProgramLocalParameter4dvARB)(GLenum target, GLuint index, const GLdouble *params)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[469];
- ((void (APIENTRY *)(GLenum target, GLuint index, const GLdouble *params)) _func)(target, index, params);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(ProgramLocalParameter4fARB)(GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[470];
- ((void (APIENTRY *)(GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w)) _func)(target, index, x, y, z, w);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(ProgramLocalParameter4fvARB)(GLenum target, GLuint index, const GLfloat *params)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[471];
- ((void (APIENTRY *)(GLenum target, GLuint index, const GLfloat *params)) _func)(target, index, params);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(ProgramStringARB)(GLenum target, GLenum format, GLsizei len, const GLvoid *string)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[472];
- ((void (APIENTRY *)(GLenum target, GLenum format, GLsizei len, const GLvoid *string)) _func)(target, format, len, string);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib1dARB)(GLuint index, GLdouble x)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[473];
- ((void (APIENTRY *)(GLuint index, GLdouble x)) _func)(index, x);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib1d)(GLuint index, GLdouble x)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[473];
- ((void (APIENTRY *)(GLuint index, GLdouble x)) _func)(index, x);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib1dvARB)(GLuint index, const GLdouble *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[474];
- ((void (APIENTRY *)(GLuint index, const GLdouble *v)) _func)(index, v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib1dv)(GLuint index, const GLdouble *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[474];
- ((void (APIENTRY *)(GLuint index, const GLdouble *v)) _func)(index, v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib1fARB)(GLuint index, GLfloat x)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[475];
- ((void (APIENTRY *)(GLuint index, GLfloat x)) _func)(index, x);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib1f)(GLuint index, GLfloat x)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[475];
- ((void (APIENTRY *)(GLuint index, GLfloat x)) _func)(index, x);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib1fvARB)(GLuint index, const GLfloat *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[476];
- ((void (APIENTRY *)(GLuint index, const GLfloat *v)) _func)(index, v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib1fv)(GLuint index, const GLfloat *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[476];
- ((void (APIENTRY *)(GLuint index, const GLfloat *v)) _func)(index, v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib1sARB)(GLuint index, GLshort x)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[477];
- ((void (APIENTRY *)(GLuint index, GLshort x)) _func)(index, x);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib1s)(GLuint index, GLshort x)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[477];
- ((void (APIENTRY *)(GLuint index, GLshort x)) _func)(index, x);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib1svARB)(GLuint index, const GLshort *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[478];
- ((void (APIENTRY *)(GLuint index, const GLshort *v)) _func)(index, v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib1sv)(GLuint index, const GLshort *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[478];
- ((void (APIENTRY *)(GLuint index, const GLshort *v)) _func)(index, v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib2dARB)(GLuint index, GLdouble x, GLdouble y)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[479];
- ((void (APIENTRY *)(GLuint index, GLdouble x, GLdouble y)) _func)(index, x, y);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib2d)(GLuint index, GLdouble x, GLdouble y)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[479];
- ((void (APIENTRY *)(GLuint index, GLdouble x, GLdouble y)) _func)(index, x, y);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib2dvARB)(GLuint index, const GLdouble *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[480];
- ((void (APIENTRY *)(GLuint index, const GLdouble *v)) _func)(index, v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib2dv)(GLuint index, const GLdouble *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[480];
- ((void (APIENTRY *)(GLuint index, const GLdouble *v)) _func)(index, v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib2fARB)(GLuint index, GLfloat x, GLfloat y)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[481];
- ((void (APIENTRY *)(GLuint index, GLfloat x, GLfloat y)) _func)(index, x, y);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib2f)(GLuint index, GLfloat x, GLfloat y)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[481];
- ((void (APIENTRY *)(GLuint index, GLfloat x, GLfloat y)) _func)(index, x, y);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib2fvARB)(GLuint index, const GLfloat *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[482];
- ((void (APIENTRY *)(GLuint index, const GLfloat *v)) _func)(index, v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib2fv)(GLuint index, const GLfloat *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[482];
- ((void (APIENTRY *)(GLuint index, const GLfloat *v)) _func)(index, v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib2sARB)(GLuint index, GLshort x, GLshort y)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[483];
- ((void (APIENTRY *)(GLuint index, GLshort x, GLshort y)) _func)(index, x, y);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib2s)(GLuint index, GLshort x, GLshort y)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[483];
- ((void (APIENTRY *)(GLuint index, GLshort x, GLshort y)) _func)(index, x, y);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib2svARB)(GLuint index, const GLshort *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[484];
- ((void (APIENTRY *)(GLuint index, const GLshort *v)) _func)(index, v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib2sv)(GLuint index, const GLshort *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[484];
- ((void (APIENTRY *)(GLuint index, const GLshort *v)) _func)(index, v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib3dARB)(GLuint index, GLdouble x, GLdouble y, GLdouble z)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[485];
- ((void (APIENTRY *)(GLuint index, GLdouble x, GLdouble y, GLdouble z)) _func)(index, x, y, z);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib3d)(GLuint index, GLdouble x, GLdouble y, GLdouble z)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[485];
- ((void (APIENTRY *)(GLuint index, GLdouble x, GLdouble y, GLdouble z)) _func)(index, x, y, z);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib3dvARB)(GLuint index, const GLdouble *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[486];
- ((void (APIENTRY *)(GLuint index, const GLdouble *v)) _func)(index, v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib3dv)(GLuint index, const GLdouble *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[486];
- ((void (APIENTRY *)(GLuint index, const GLdouble *v)) _func)(index, v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib3fARB)(GLuint index, GLfloat x, GLfloat y, GLfloat z)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[487];
- ((void (APIENTRY *)(GLuint index, GLfloat x, GLfloat y, GLfloat z)) _func)(index, x, y, z);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib3f)(GLuint index, GLfloat x, GLfloat y, GLfloat z)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[487];
- ((void (APIENTRY *)(GLuint index, GLfloat x, GLfloat y, GLfloat z)) _func)(index, x, y, z);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib3fvARB)(GLuint index, const GLfloat *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[488];
- ((void (APIENTRY *)(GLuint index, const GLfloat *v)) _func)(index, v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib3fv)(GLuint index, const GLfloat *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[488];
- ((void (APIENTRY *)(GLuint index, const GLfloat *v)) _func)(index, v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib3sARB)(GLuint index, GLshort x, GLshort y, GLshort z)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[489];
- ((void (APIENTRY *)(GLuint index, GLshort x, GLshort y, GLshort z)) _func)(index, x, y, z);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib3s)(GLuint index, GLshort x, GLshort y, GLshort z)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[489];
- ((void (APIENTRY *)(GLuint index, GLshort x, GLshort y, GLshort z)) _func)(index, x, y, z);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib3svARB)(GLuint index, const GLshort *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[490];
- ((void (APIENTRY *)(GLuint index, const GLshort *v)) _func)(index, v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib3sv)(GLuint index, const GLshort *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[490];
- ((void (APIENTRY *)(GLuint index, const GLshort *v)) _func)(index, v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib4NbvARB)(GLuint index, const GLbyte *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[491];
- ((void (APIENTRY *)(GLuint index, const GLbyte *v)) _func)(index, v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib4Nbv)(GLuint index, const GLbyte *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[491];
- ((void (APIENTRY *)(GLuint index, const GLbyte *v)) _func)(index, v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib4NivARB)(GLuint index, const GLint *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[492];
- ((void (APIENTRY *)(GLuint index, const GLint *v)) _func)(index, v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib4Niv)(GLuint index, const GLint *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[492];
- ((void (APIENTRY *)(GLuint index, const GLint *v)) _func)(index, v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib4NsvARB)(GLuint index, const GLshort *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[493];
- ((void (APIENTRY *)(GLuint index, const GLshort *v)) _func)(index, v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib4Nsv)(GLuint index, const GLshort *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[493];
- ((void (APIENTRY *)(GLuint index, const GLshort *v)) _func)(index, v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib4NubARB)(GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[494];
- ((void (APIENTRY *)(GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w)) _func)(index, x, y, z, w);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib4Nub)(GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[494];
- ((void (APIENTRY *)(GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w)) _func)(index, x, y, z, w);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib4NubvARB)(GLuint index, const GLubyte *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[495];
- ((void (APIENTRY *)(GLuint index, const GLubyte *v)) _func)(index, v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib4Nubv)(GLuint index, const GLubyte *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[495];
- ((void (APIENTRY *)(GLuint index, const GLubyte *v)) _func)(index, v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib4NuivARB)(GLuint index, const GLuint *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[496];
- ((void (APIENTRY *)(GLuint index, const GLuint *v)) _func)(index, v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib4Nuiv)(GLuint index, const GLuint *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[496];
- ((void (APIENTRY *)(GLuint index, const GLuint *v)) _func)(index, v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib4NusvARB)(GLuint index, const GLushort *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[497];
- ((void (APIENTRY *)(GLuint index, const GLushort *v)) _func)(index, v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib4Nusv)(GLuint index, const GLushort *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[497];
- ((void (APIENTRY *)(GLuint index, const GLushort *v)) _func)(index, v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib4bvARB)(GLuint index, const GLbyte *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[498];
- ((void (APIENTRY *)(GLuint index, const GLbyte *v)) _func)(index, v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib4bv)(GLuint index, const GLbyte *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[498];
- ((void (APIENTRY *)(GLuint index, const GLbyte *v)) _func)(index, v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib4dARB)(GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[499];
- ((void (APIENTRY *)(GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w)) _func)(index, x, y, z, w);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib4d)(GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[499];
- ((void (APIENTRY *)(GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w)) _func)(index, x, y, z, w);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib4dvARB)(GLuint index, const GLdouble *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[500];
- ((void (APIENTRY *)(GLuint index, const GLdouble *v)) _func)(index, v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib4dv)(GLuint index, const GLdouble *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[500];
- ((void (APIENTRY *)(GLuint index, const GLdouble *v)) _func)(index, v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib4fARB)(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[501];
- ((void (APIENTRY *)(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w)) _func)(index, x, y, z, w);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib4f)(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[501];
- ((void (APIENTRY *)(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w)) _func)(index, x, y, z, w);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib4fvARB)(GLuint index, const GLfloat *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[502];
- ((void (APIENTRY *)(GLuint index, const GLfloat *v)) _func)(index, v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib4fv)(GLuint index, const GLfloat *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[502];
- ((void (APIENTRY *)(GLuint index, const GLfloat *v)) _func)(index, v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib4ivARB)(GLuint index, const GLint *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[503];
- ((void (APIENTRY *)(GLuint index, const GLint *v)) _func)(index, v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib4iv)(GLuint index, const GLint *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[503];
- ((void (APIENTRY *)(GLuint index, const GLint *v)) _func)(index, v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib4sARB)(GLuint index, GLshort x, GLshort y, GLshort z, GLshort w)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[504];
- ((void (APIENTRY *)(GLuint index, GLshort x, GLshort y, GLshort z, GLshort w)) _func)(index, x, y, z, w);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib4s)(GLuint index, GLshort x, GLshort y, GLshort z, GLshort w)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[504];
- ((void (APIENTRY *)(GLuint index, GLshort x, GLshort y, GLshort z, GLshort w)) _func)(index, x, y, z, w);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib4svARB)(GLuint index, const GLshort *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[505];
- ((void (APIENTRY *)(GLuint index, const GLshort *v)) _func)(index, v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib4sv)(GLuint index, const GLshort *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[505];
- ((void (APIENTRY *)(GLuint index, const GLshort *v)) _func)(index, v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib4ubvARB)(GLuint index, const GLubyte *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[506];
- ((void (APIENTRY *)(GLuint index, const GLubyte *v)) _func)(index, v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib4ubv)(GLuint index, const GLubyte *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[506];
- ((void (APIENTRY *)(GLuint index, const GLubyte *v)) _func)(index, v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib4uivARB)(GLuint index, const GLuint *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[507];
- ((void (APIENTRY *)(GLuint index, const GLuint *v)) _func)(index, v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib4uiv)(GLuint index, const GLuint *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[507];
- ((void (APIENTRY *)(GLuint index, const GLuint *v)) _func)(index, v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib4usvARB)(GLuint index, const GLushort *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[508];
- ((void (APIENTRY *)(GLuint index, const GLushort *v)) _func)(index, v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib4usv)(GLuint index, const GLushort *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[508];
- ((void (APIENTRY *)(GLuint index, const GLushort *v)) _func)(index, v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribPointerARB)(GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *pointer)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[509];
- ((void (APIENTRY *)(GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *pointer)) _func)(index, size, type, normalized, stride, pointer);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribPointer)(GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *pointer)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[509];
- ((void (APIENTRY *)(GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *pointer)) _func)(index, size, type, normalized, stride, pointer);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(BindBufferARB)(GLenum target, GLuint buffer)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[510];
- ((void (APIENTRY *)(GLenum target, GLuint buffer)) _func)(target, buffer);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(BindBuffer)(GLenum target, GLuint buffer)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[510];
- ((void (APIENTRY *)(GLenum target, GLuint buffer)) _func)(target, buffer);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(BufferDataARB)(GLenum target, GLsizeiptrARB size, const GLvoid *data, GLenum usage)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[511];
- ((void (APIENTRY *)(GLenum target, GLsizeiptrARB size, const GLvoid *data, GLenum usage)) _func)(target, size, data, usage);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(BufferData)(GLenum target, GLsizeiptr size, const GLvoid *data, GLenum usage)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[511];
- ((void (APIENTRY *)(GLenum target, GLsizeiptr size, const GLvoid *data, GLenum usage)) _func)(target, size, data, usage);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(BufferSubDataARB)(GLenum target, GLintptrARB offset, GLsizeiptrARB size, const GLvoid *data)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[512];
- ((void (APIENTRY *)(GLenum target, GLintptrARB offset, GLsizeiptrARB size, const GLvoid *data)) _func)(target, offset, size, data);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(BufferSubData)(GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid *data)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[512];
- ((void (APIENTRY *)(GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid *data)) _func)(target, offset, size, data);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(DeleteBuffersARB)(GLsizei n, const GLuint *buffer)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[513];
- ((void (APIENTRY *)(GLsizei n, const GLuint *buffer)) _func)(n, buffer);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(DeleteBuffers)(GLsizei n, const GLuint *buffer)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[513];
- ((void (APIENTRY *)(GLsizei n, const GLuint *buffer)) _func)(n, buffer);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(GenBuffersARB)(GLsizei n, GLuint *buffer)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[514];
- ((void (APIENTRY *)(GLsizei n, GLuint *buffer)) _func)(n, buffer);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(GenBuffers)(GLsizei n, GLuint *buffer)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[514];
- ((void (APIENTRY *)(GLsizei n, GLuint *buffer)) _func)(n, buffer);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(GetBufferParameterivARB)(GLenum target, GLenum pname, GLint *params)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[515];
- ((void (APIENTRY *)(GLenum target, GLenum pname, GLint *params)) _func)(target, pname, params);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(GetBufferParameteriv)(GLenum target, GLenum pname, GLint *params)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[515];
- ((void (APIENTRY *)(GLenum target, GLenum pname, GLint *params)) _func)(target, pname, params);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(GetBufferPointervARB)(GLenum target, GLenum pname, GLvoid **params)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[516];
- ((void (APIENTRY *)(GLenum target, GLenum pname, GLvoid **params)) _func)(target, pname, params);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(GetBufferPointerv)(GLenum target, GLenum pname, GLvoid **params)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[516];
- ((void (APIENTRY *)(GLenum target, GLenum pname, GLvoid **params)) _func)(target, pname, params);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(GetBufferSubDataARB)(GLenum target, GLintptrARB offset, GLsizeiptrARB size, GLvoid *data)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[517];
- ((void (APIENTRY *)(GLenum target, GLintptrARB offset, GLsizeiptrARB size, GLvoid *data)) _func)(target, offset, size, data);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(GetBufferSubData)(GLenum target, GLintptr offset, GLsizeiptr size, GLvoid *data)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[517];
- ((void (APIENTRY *)(GLenum target, GLintptr offset, GLsizeiptr size, GLvoid *data)) _func)(target, offset, size, data);
-}
-
-GLAPI GLboolean APIENTRY GLAPI_PREFIX(IsBufferARB)(GLuint buffer)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[518];
- return ((GLboolean (APIENTRY *)(GLuint buffer)) _func)(buffer);
-}
-
-GLAPI GLboolean APIENTRY GLAPI_PREFIX(IsBuffer)(GLuint buffer)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[518];
- return ((GLboolean (APIENTRY *)(GLuint buffer)) _func)(buffer);
-}
-
-GLAPI GLvoid * APIENTRY GLAPI_PREFIX(MapBufferARB)(GLenum target, GLenum access)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[519];
- return ((GLvoid * (APIENTRY *)(GLenum target, GLenum access)) _func)(target, access);
-}
-
-GLAPI GLvoid * APIENTRY GLAPI_PREFIX(MapBuffer)(GLenum target, GLenum access)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[519];
- return ((GLvoid * (APIENTRY *)(GLenum target, GLenum access)) _func)(target, access);
-}
-
-GLAPI GLboolean APIENTRY GLAPI_PREFIX(UnmapBufferARB)(GLenum target)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[520];
- return ((GLboolean (APIENTRY *)(GLenum target)) _func)(target);
-}
-
-GLAPI GLboolean APIENTRY GLAPI_PREFIX(UnmapBuffer)(GLenum target)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[520];
- return ((GLboolean (APIENTRY *)(GLenum target)) _func)(target);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(BeginQueryARB)(GLenum target, GLuint id)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[521];
- ((void (APIENTRY *)(GLenum target, GLuint id)) _func)(target, id);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(BeginQuery)(GLenum target, GLuint id)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[521];
- ((void (APIENTRY *)(GLenum target, GLuint id)) _func)(target, id);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(DeleteQueriesARB)(GLsizei n, const GLuint *ids)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[522];
- ((void (APIENTRY *)(GLsizei n, const GLuint *ids)) _func)(n, ids);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(DeleteQueries)(GLsizei n, const GLuint *ids)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[522];
- ((void (APIENTRY *)(GLsizei n, const GLuint *ids)) _func)(n, ids);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(EndQueryARB)(GLenum target)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[523];
- ((void (APIENTRY *)(GLenum target)) _func)(target);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(EndQuery)(GLenum target)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[523];
- ((void (APIENTRY *)(GLenum target)) _func)(target);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(GenQueriesARB)(GLsizei n, GLuint *ids)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[524];
- ((void (APIENTRY *)(GLsizei n, GLuint *ids)) _func)(n, ids);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(GenQueries)(GLsizei n, GLuint *ids)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[524];
- ((void (APIENTRY *)(GLsizei n, GLuint *ids)) _func)(n, ids);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(GetQueryObjectivARB)(GLuint id, GLenum pname, GLint *params)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[525];
- ((void (APIENTRY *)(GLuint id, GLenum pname, GLint *params)) _func)(id, pname, params);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(GetQueryObjectiv)(GLuint id, GLenum pname, GLint *params)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[525];
- ((void (APIENTRY *)(GLuint id, GLenum pname, GLint *params)) _func)(id, pname, params);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(GetQueryObjectuivARB)(GLuint id, GLenum pname, GLuint *params)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[526];
- ((void (APIENTRY *)(GLuint id, GLenum pname, GLuint *params)) _func)(id, pname, params);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(GetQueryObjectuiv)(GLuint id, GLenum pname, GLuint *params)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[526];
- ((void (APIENTRY *)(GLuint id, GLenum pname, GLuint *params)) _func)(id, pname, params);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(GetQueryivARB)(GLenum target, GLenum pname, GLint *params)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[527];
- ((void (APIENTRY *)(GLenum target, GLenum pname, GLint *params)) _func)(target, pname, params);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(GetQueryiv)(GLenum target, GLenum pname, GLint *params)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[527];
- ((void (APIENTRY *)(GLenum target, GLenum pname, GLint *params)) _func)(target, pname, params);
-}
-
-GLAPI GLboolean APIENTRY GLAPI_PREFIX(IsQueryARB)(GLuint id)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[528];
- return ((GLboolean (APIENTRY *)(GLuint id)) _func)(id);
-}
-
-GLAPI GLboolean APIENTRY GLAPI_PREFIX(IsQuery)(GLuint id)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[528];
- return ((GLboolean (APIENTRY *)(GLuint id)) _func)(id);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(AttachObjectARB)(GLhandleARB containerObj, GLhandleARB obj)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[529];
- ((void (APIENTRY *)(GLhandleARB containerObj, GLhandleARB obj)) _func)(containerObj, obj);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(CompileShaderARB)(GLhandleARB shader)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[530];
- ((void (APIENTRY *)(GLhandleARB shader)) _func)(shader);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(CompileShader)(GLuint shader)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[530];
- ((void (APIENTRY *)(GLuint shader)) _func)(shader);
-}
-
-GLAPI GLhandleARB APIENTRY GLAPI_PREFIX(CreateProgramObjectARB)(void)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[531];
- return ((GLhandleARB (APIENTRY *)(void)) _func)();
-}
-
-GLAPI GLhandleARB APIENTRY GLAPI_PREFIX(CreateShaderObjectARB)(GLenum shaderType)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[532];
- return ((GLhandleARB (APIENTRY *)(GLenum shaderType)) _func)(shaderType);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(DeleteObjectARB)(GLhandleARB obj)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[533];
- ((void (APIENTRY *)(GLhandleARB obj)) _func)(obj);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(DetachObjectARB)(GLhandleARB containerObj, GLhandleARB attachedObj)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[534];
- ((void (APIENTRY *)(GLhandleARB containerObj, GLhandleARB attachedObj)) _func)(containerObj, attachedObj);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(GetActiveUniformARB)(GLhandleARB program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLcharARB *name)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[535];
- ((void (APIENTRY *)(GLhandleARB program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLcharARB *name)) _func)(program, index, bufSize, length, size, type, name);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(GetActiveUniform)(GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[535];
- ((void (APIENTRY *)(GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name)) _func)(program, index, bufSize, length, size, type, name);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(GetAttachedObjectsARB)(GLhandleARB containerObj, GLsizei maxLength, GLsizei *length, GLhandleARB *infoLog)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[536];
- ((void (APIENTRY *)(GLhandleARB containerObj, GLsizei maxLength, GLsizei *length, GLhandleARB *infoLog)) _func)(containerObj, maxLength, length, infoLog);
-}
-
-GLAPI GLhandleARB APIENTRY GLAPI_PREFIX(GetHandleARB)(GLenum pname)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[537];
- return ((GLhandleARB (APIENTRY *)(GLenum pname)) _func)(pname);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(GetInfoLogARB)(GLhandleARB obj, GLsizei maxLength, GLsizei *length, GLcharARB *infoLog)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[538];
- ((void (APIENTRY *)(GLhandleARB obj, GLsizei maxLength, GLsizei *length, GLcharARB *infoLog)) _func)(obj, maxLength, length, infoLog);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(GetObjectParameterfvARB)(GLhandleARB obj, GLenum pname, GLfloat *params)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[539];
- ((void (APIENTRY *)(GLhandleARB obj, GLenum pname, GLfloat *params)) _func)(obj, pname, params);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(GetObjectParameterivARB)(GLhandleARB obj, GLenum pname, GLint *params)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[540];
- ((void (APIENTRY *)(GLhandleARB obj, GLenum pname, GLint *params)) _func)(obj, pname, params);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(GetShaderSourceARB)(GLhandleARB shader, GLsizei bufSize, GLsizei *length, GLcharARB *source)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[541];
- ((void (APIENTRY *)(GLhandleARB shader, GLsizei bufSize, GLsizei *length, GLcharARB *source)) _func)(shader, bufSize, length, source);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(GetShaderSource)(GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *source)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[541];
- ((void (APIENTRY *)(GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *source)) _func)(shader, bufSize, length, source);
-}
-
-GLAPI GLint APIENTRY GLAPI_PREFIX(GetUniformLocationARB)(GLhandleARB program, const GLcharARB *name)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[542];
- return ((GLint (APIENTRY *)(GLhandleARB program, const GLcharARB *name)) _func)(program, name);
-}
-
-GLAPI GLint APIENTRY GLAPI_PREFIX(GetUniformLocation)(GLuint program, const GLchar *name)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[542];
- return ((GLint (APIENTRY *)(GLuint program, const GLchar *name)) _func)(program, name);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(GetUniformfvARB)(GLhandleARB program, GLint location, GLfloat *params)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[543];
- ((void (APIENTRY *)(GLhandleARB program, GLint location, GLfloat *params)) _func)(program, location, params);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(GetUniformfv)(GLuint program, GLint location, GLfloat *params)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[543];
- ((void (APIENTRY *)(GLuint program, GLint location, GLfloat *params)) _func)(program, location, params);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(GetUniformivARB)(GLhandleARB program, GLint location, GLint *params)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[544];
- ((void (APIENTRY *)(GLhandleARB program, GLint location, GLint *params)) _func)(program, location, params);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(GetUniformiv)(GLuint program, GLint location, GLint *params)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[544];
- ((void (APIENTRY *)(GLuint program, GLint location, GLint *params)) _func)(program, location, params);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(LinkProgramARB)(GLhandleARB program)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[545];
- ((void (APIENTRY *)(GLhandleARB program)) _func)(program);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(LinkProgram)(GLuint program)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[545];
- ((void (APIENTRY *)(GLuint program)) _func)(program);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(ShaderSourceARB)(GLhandleARB shader, GLsizei count, const GLcharARB **string, const GLint *length)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[546];
- ((void (APIENTRY *)(GLhandleARB shader, GLsizei count, const GLcharARB **string, const GLint *length)) _func)(shader, count, string, length);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(ShaderSource)(GLuint shader, GLsizei count, const GLchar **string, const GLint *length)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[546];
- ((void (APIENTRY *)(GLuint shader, GLsizei count, const GLchar **string, const GLint *length)) _func)(shader, count, string, length);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(Uniform1fARB)(GLint location, GLfloat v0)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[547];
- ((void (APIENTRY *)(GLint location, GLfloat v0)) _func)(location, v0);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(Uniform1f)(GLint location, GLfloat v0)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[547];
- ((void (APIENTRY *)(GLint location, GLfloat v0)) _func)(location, v0);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(Uniform1fvARB)(GLint location, GLsizei count, const GLfloat *value)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[548];
- ((void (APIENTRY *)(GLint location, GLsizei count, const GLfloat *value)) _func)(location, count, value);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(Uniform1fv)(GLint location, GLsizei count, const GLfloat *value)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[548];
- ((void (APIENTRY *)(GLint location, GLsizei count, const GLfloat *value)) _func)(location, count, value);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(Uniform1iARB)(GLint location, GLint v0)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[549];
- ((void (APIENTRY *)(GLint location, GLint v0)) _func)(location, v0);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(Uniform1i)(GLint location, GLint v0)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[549];
- ((void (APIENTRY *)(GLint location, GLint v0)) _func)(location, v0);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(Uniform1ivARB)(GLint location, GLsizei count, const GLint *value)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[550];
- ((void (APIENTRY *)(GLint location, GLsizei count, const GLint *value)) _func)(location, count, value);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(Uniform1iv)(GLint location, GLsizei count, const GLint *value)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[550];
- ((void (APIENTRY *)(GLint location, GLsizei count, const GLint *value)) _func)(location, count, value);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(Uniform2fARB)(GLint location, GLfloat v0, GLfloat v1)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[551];
- ((void (APIENTRY *)(GLint location, GLfloat v0, GLfloat v1)) _func)(location, v0, v1);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(Uniform2f)(GLint location, GLfloat v0, GLfloat v1)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[551];
- ((void (APIENTRY *)(GLint location, GLfloat v0, GLfloat v1)) _func)(location, v0, v1);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(Uniform2fvARB)(GLint location, GLsizei count, const GLfloat *value)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[552];
- ((void (APIENTRY *)(GLint location, GLsizei count, const GLfloat *value)) _func)(location, count, value);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(Uniform2fv)(GLint location, GLsizei count, const GLfloat *value)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[552];
- ((void (APIENTRY *)(GLint location, GLsizei count, const GLfloat *value)) _func)(location, count, value);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(Uniform2iARB)(GLint location, GLint v0, GLint v1)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[553];
- ((void (APIENTRY *)(GLint location, GLint v0, GLint v1)) _func)(location, v0, v1);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(Uniform2i)(GLint location, GLint v0, GLint v1)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[553];
- ((void (APIENTRY *)(GLint location, GLint v0, GLint v1)) _func)(location, v0, v1);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(Uniform2ivARB)(GLint location, GLsizei count, const GLint *value)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[554];
- ((void (APIENTRY *)(GLint location, GLsizei count, const GLint *value)) _func)(location, count, value);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(Uniform2iv)(GLint location, GLsizei count, const GLint *value)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[554];
- ((void (APIENTRY *)(GLint location, GLsizei count, const GLint *value)) _func)(location, count, value);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(Uniform3fARB)(GLint location, GLfloat v0, GLfloat v1, GLfloat v2)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[555];
- ((void (APIENTRY *)(GLint location, GLfloat v0, GLfloat v1, GLfloat v2)) _func)(location, v0, v1, v2);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(Uniform3f)(GLint location, GLfloat v0, GLfloat v1, GLfloat v2)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[555];
- ((void (APIENTRY *)(GLint location, GLfloat v0, GLfloat v1, GLfloat v2)) _func)(location, v0, v1, v2);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(Uniform3fvARB)(GLint location, GLsizei count, const GLfloat *value)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[556];
- ((void (APIENTRY *)(GLint location, GLsizei count, const GLfloat *value)) _func)(location, count, value);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(Uniform3fv)(GLint location, GLsizei count, const GLfloat *value)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[556];
- ((void (APIENTRY *)(GLint location, GLsizei count, const GLfloat *value)) _func)(location, count, value);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(Uniform3iARB)(GLint location, GLint v0, GLint v1, GLint v2)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[557];
- ((void (APIENTRY *)(GLint location, GLint v0, GLint v1, GLint v2)) _func)(location, v0, v1, v2);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(Uniform3i)(GLint location, GLint v0, GLint v1, GLint v2)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[557];
- ((void (APIENTRY *)(GLint location, GLint v0, GLint v1, GLint v2)) _func)(location, v0, v1, v2);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(Uniform3ivARB)(GLint location, GLsizei count, const GLint *value)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[558];
- ((void (APIENTRY *)(GLint location, GLsizei count, const GLint *value)) _func)(location, count, value);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(Uniform3iv)(GLint location, GLsizei count, const GLint *value)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[558];
- ((void (APIENTRY *)(GLint location, GLsizei count, const GLint *value)) _func)(location, count, value);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(Uniform4fARB)(GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[559];
- ((void (APIENTRY *)(GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3)) _func)(location, v0, v1, v2, v3);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(Uniform4f)(GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[559];
- ((void (APIENTRY *)(GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3)) _func)(location, v0, v1, v2, v3);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(Uniform4fvARB)(GLint location, GLsizei count, const GLfloat *value)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[560];
- ((void (APIENTRY *)(GLint location, GLsizei count, const GLfloat *value)) _func)(location, count, value);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(Uniform4fv)(GLint location, GLsizei count, const GLfloat *value)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[560];
- ((void (APIENTRY *)(GLint location, GLsizei count, const GLfloat *value)) _func)(location, count, value);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(Uniform4iARB)(GLint location, GLint v0, GLint v1, GLint v2, GLint v3)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[561];
- ((void (APIENTRY *)(GLint location, GLint v0, GLint v1, GLint v2, GLint v3)) _func)(location, v0, v1, v2, v3);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(Uniform4i)(GLint location, GLint v0, GLint v1, GLint v2, GLint v3)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[561];
- ((void (APIENTRY *)(GLint location, GLint v0, GLint v1, GLint v2, GLint v3)) _func)(location, v0, v1, v2, v3);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(Uniform4ivARB)(GLint location, GLsizei count, const GLint *value)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[562];
- ((void (APIENTRY *)(GLint location, GLsizei count, const GLint *value)) _func)(location, count, value);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(Uniform4iv)(GLint location, GLsizei count, const GLint *value)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[562];
- ((void (APIENTRY *)(GLint location, GLsizei count, const GLint *value)) _func)(location, count, value);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(UniformMatrix2fvARB)(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[563];
- ((void (APIENTRY *)(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)) _func)(location, count, transpose, value);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(UniformMatrix2fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[563];
- ((void (APIENTRY *)(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)) _func)(location, count, transpose, value);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(UniformMatrix3fvARB)(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[564];
- ((void (APIENTRY *)(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)) _func)(location, count, transpose, value);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(UniformMatrix3fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[564];
- ((void (APIENTRY *)(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)) _func)(location, count, transpose, value);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(UniformMatrix4fvARB)(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[565];
- ((void (APIENTRY *)(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)) _func)(location, count, transpose, value);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(UniformMatrix4fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[565];
- ((void (APIENTRY *)(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)) _func)(location, count, transpose, value);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(UseProgramObjectARB)(GLhandleARB program)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[566];
- ((void (APIENTRY *)(GLhandleARB program)) _func)(program);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(UseProgram)(GLuint program)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[566];
- ((void (APIENTRY *)(GLuint program)) _func)(program);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(ValidateProgramARB)(GLhandleARB program)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[567];
- ((void (APIENTRY *)(GLhandleARB program)) _func)(program);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(ValidateProgram)(GLuint program)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[567];
- ((void (APIENTRY *)(GLuint program)) _func)(program);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(BindAttribLocationARB)(GLhandleARB program, GLuint index, const GLcharARB *name)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[568];
- ((void (APIENTRY *)(GLhandleARB program, GLuint index, const GLcharARB *name)) _func)(program, index, name);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(BindAttribLocation)(GLuint program, GLuint index, const GLchar *name)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[568];
- ((void (APIENTRY *)(GLuint program, GLuint index, const GLchar *name)) _func)(program, index, name);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(GetActiveAttribARB)(GLhandleARB program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLcharARB *name)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[569];
- ((void (APIENTRY *)(GLhandleARB program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLcharARB *name)) _func)(program, index, bufSize, length, size, type, name);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(GetActiveAttrib)(GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[569];
- ((void (APIENTRY *)(GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name)) _func)(program, index, bufSize, length, size, type, name);
-}
-
-GLAPI GLint APIENTRY GLAPI_PREFIX(GetAttribLocationARB)(GLhandleARB program, const GLcharARB *name)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[570];
- return ((GLint (APIENTRY *)(GLhandleARB program, const GLcharARB *name)) _func)(program, name);
-}
-
-GLAPI GLint APIENTRY GLAPI_PREFIX(GetAttribLocation)(GLuint program, const GLchar *name)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[570];
- return ((GLint (APIENTRY *)(GLuint program, const GLchar *name)) _func)(program, name);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(DrawBuffersARB)(GLsizei n, const GLenum *bufs)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[571];
- ((void (APIENTRY *)(GLsizei n, const GLenum *bufs)) _func)(n, bufs);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(DrawBuffers)(GLsizei n, const GLenum *bufs)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[571];
- ((void (APIENTRY *)(GLsizei n, const GLenum *bufs)) _func)(n, bufs);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(DrawBuffersATI)(GLsizei n, const GLenum *bufs)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[571];
- ((void (APIENTRY *)(GLsizei n, const GLenum *bufs)) _func)(n, bufs);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(ClampColorARB)(GLenum target, GLenum clamp)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[572];
- ((void (APIENTRY *)(GLenum target, GLenum clamp)) _func)(target, clamp);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(DrawArraysInstancedARB)(GLenum mode, GLint first, GLsizei count, GLsizei primcount)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[573];
- ((void (APIENTRY *)(GLenum mode, GLint first, GLsizei count, GLsizei primcount)) _func)(mode, first, count, primcount);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(DrawArraysInstanced)(GLenum mode, GLint first, GLsizei count, GLsizei primcount)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[573];
- ((void (APIENTRY *)(GLenum mode, GLint first, GLsizei count, GLsizei primcount)) _func)(mode, first, count, primcount);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(DrawArraysInstancedEXT)(GLenum mode, GLint first, GLsizei count, GLsizei primcount)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[573];
- ((void (APIENTRY *)(GLenum mode, GLint first, GLsizei count, GLsizei primcount)) _func)(mode, first, count, primcount);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(DrawElementsInstancedARB)(GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[574];
- ((void (APIENTRY *)(GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount)) _func)(mode, count, type, indices, primcount);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(DrawElementsInstanced)(GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[574];
- ((void (APIENTRY *)(GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount)) _func)(mode, count, type, indices, primcount);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(DrawElementsInstancedEXT)(GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[574];
- ((void (APIENTRY *)(GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount)) _func)(mode, count, type, indices, primcount);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(RenderbufferStorageMultisample)(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[575];
- ((void (APIENTRY *)(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height)) _func)(target, samples, internalformat, width, height);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(RenderbufferStorageMultisampleEXT)(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[575];
- ((void (APIENTRY *)(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height)) _func)(target, samples, internalformat, width, height);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(FramebufferTextureARB)(GLenum target, GLenum attachment, GLuint texture, GLint level)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[576];
- ((void (APIENTRY *)(GLenum target, GLenum attachment, GLuint texture, GLint level)) _func)(target, attachment, texture, level);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(FramebufferTextureFaceARB)(GLenum target, GLenum attachment, GLuint texture, GLint level, GLenum face)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[577];
- ((void (APIENTRY *)(GLenum target, GLenum attachment, GLuint texture, GLint level, GLenum face)) _func)(target, attachment, texture, level, face);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(ProgramParameteriARB)(GLuint program, GLenum pname, GLint value)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[578];
- ((void (APIENTRY *)(GLuint program, GLenum pname, GLint value)) _func)(program, pname, value);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribDivisorARB)(GLuint index, GLuint divisor)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[579];
- ((void (APIENTRY *)(GLuint index, GLuint divisor)) _func)(index, divisor);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(FlushMappedBufferRange)(GLenum target, GLintptr offset, GLsizeiptr length)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[580];
- ((void (APIENTRY *)(GLenum target, GLintptr offset, GLsizeiptr length)) _func)(target, offset, length);
-}
-
-GLAPI GLvoid * APIENTRY GLAPI_PREFIX(MapBufferRange)(GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[581];
- return ((GLvoid * (APIENTRY *)(GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access)) _func)(target, offset, length, access);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(TexBufferARB)(GLenum target, GLenum internalFormat, GLuint buffer)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[582];
- ((void (APIENTRY *)(GLenum target, GLenum internalFormat, GLuint buffer)) _func)(target, internalFormat, buffer);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(BindVertexArray)(GLuint array)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[583];
- ((void (APIENTRY *)(GLuint array)) _func)(array);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(GenVertexArrays)(GLsizei n, GLuint *arrays)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[584];
- ((void (APIENTRY *)(GLsizei n, GLuint *arrays)) _func)(n, arrays);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(CopyBufferSubData)(GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[585];
- ((void (APIENTRY *)(GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size)) _func)(readTarget, writeTarget, readOffset, writeOffset, size);
-}
-
-GLAPI GLenum APIENTRY GLAPI_PREFIX(ClientWaitSync)(GLsync sync, GLbitfield flags, GLuint64 timeout)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[586];
- return ((GLenum (APIENTRY *)(GLsync sync, GLbitfield flags, GLuint64 timeout)) _func)(sync, flags, timeout);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(DeleteSync)(GLsync sync)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[587];
- ((void (APIENTRY *)(GLsync sync)) _func)(sync);
-}
-
-GLAPI GLsync APIENTRY GLAPI_PREFIX(FenceSync)(GLenum condition, GLbitfield flags)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[588];
- return ((GLsync (APIENTRY *)(GLenum condition, GLbitfield flags)) _func)(condition, flags);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(GetInteger64v)(GLenum pname, GLint64 *params)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[589];
- ((void (APIENTRY *)(GLenum pname, GLint64 *params)) _func)(pname, params);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(GetSynciv)(GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[590];
- ((void (APIENTRY *)(GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values)) _func)(sync, pname, bufSize, length, values);
-}
-
-GLAPI GLboolean APIENTRY GLAPI_PREFIX(IsSync)(GLsync sync)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[591];
- return ((GLboolean (APIENTRY *)(GLsync sync)) _func)(sync);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(WaitSync)(GLsync sync, GLbitfield flags, GLuint64 timeout)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[592];
- ((void (APIENTRY *)(GLsync sync, GLbitfield flags, GLuint64 timeout)) _func)(sync, flags, timeout);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(DrawElementsBaseVertex)(GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLint basevertex)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[593];
- ((void (APIENTRY *)(GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLint basevertex)) _func)(mode, count, type, indices, basevertex);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(DrawRangeElementsBaseVertex)(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices, GLint basevertex)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[594];
- ((void (APIENTRY *)(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices, GLint basevertex)) _func)(mode, start, end, count, type, indices, basevertex);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(MultiDrawElementsBaseVertex)(GLenum mode, const GLsizei *count, GLenum type, const GLvoid **indices, GLsizei primcount, const GLint *basevertex)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[595];
- ((void (APIENTRY *)(GLenum mode, const GLsizei *count, GLenum type, const GLvoid **indices, GLsizei primcount, const GLint *basevertex)) _func)(mode, count, type, indices, primcount, basevertex);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(BlendEquationSeparateiARB)(GLuint buf, GLenum modeRGB, GLenum modeA)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[596];
- ((void (APIENTRY *)(GLuint buf, GLenum modeRGB, GLenum modeA)) _func)(buf, modeRGB, modeA);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(BlendEquationSeparateIndexedAMD)(GLuint buf, GLenum modeRGB, GLenum modeA)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[596];
- ((void (APIENTRY *)(GLuint buf, GLenum modeRGB, GLenum modeA)) _func)(buf, modeRGB, modeA);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(BlendEquationiARB)(GLuint buf, GLenum mode)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[597];
- ((void (APIENTRY *)(GLuint buf, GLenum mode)) _func)(buf, mode);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(BlendEquationIndexedAMD)(GLuint buf, GLenum mode)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[597];
- ((void (APIENTRY *)(GLuint buf, GLenum mode)) _func)(buf, mode);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(BlendFuncSeparateiARB)(GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcA, GLenum dstA)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[598];
- ((void (APIENTRY *)(GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcA, GLenum dstA)) _func)(buf, srcRGB, dstRGB, srcA, dstA);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(BlendFuncSeparateIndexedAMD)(GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcA, GLenum dstA)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[598];
- ((void (APIENTRY *)(GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcA, GLenum dstA)) _func)(buf, srcRGB, dstRGB, srcA, dstA);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(BlendFunciARB)(GLuint buf, GLenum src, GLenum dst)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[599];
- ((void (APIENTRY *)(GLuint buf, GLenum src, GLenum dst)) _func)(buf, src, dst);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(BlendFuncIndexedAMD)(GLuint buf, GLenum src, GLenum dst)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[599];
- ((void (APIENTRY *)(GLuint buf, GLenum src, GLenum dst)) _func)(buf, src, dst);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(BindSampler)(GLuint unit, GLuint sampler)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[600];
- ((void (APIENTRY *)(GLuint unit, GLuint sampler)) _func)(unit, sampler);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(DeleteSamplers)(GLsizei count, const GLuint *samplers)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[601];
- ((void (APIENTRY *)(GLsizei count, const GLuint *samplers)) _func)(count, samplers);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(GenSamplers)(GLsizei count, GLuint *samplers)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[602];
- ((void (APIENTRY *)(GLsizei count, GLuint *samplers)) _func)(count, samplers);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(GetSamplerParameterIiv)(GLuint sampler, GLenum pname, GLint *params)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[603];
- ((void (APIENTRY *)(GLuint sampler, GLenum pname, GLint *params)) _func)(sampler, pname, params);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(GetSamplerParameterIuiv)(GLuint sampler, GLenum pname, GLuint *params)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[604];
- ((void (APIENTRY *)(GLuint sampler, GLenum pname, GLuint *params)) _func)(sampler, pname, params);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(GetSamplerParameterfv)(GLuint sampler, GLenum pname, GLfloat *params)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[605];
- ((void (APIENTRY *)(GLuint sampler, GLenum pname, GLfloat *params)) _func)(sampler, pname, params);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(GetSamplerParameteriv)(GLuint sampler, GLenum pname, GLint *params)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[606];
- ((void (APIENTRY *)(GLuint sampler, GLenum pname, GLint *params)) _func)(sampler, pname, params);
-}
-
-GLAPI GLboolean APIENTRY GLAPI_PREFIX(IsSampler)(GLuint sampler)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[607];
- return ((GLboolean (APIENTRY *)(GLuint sampler)) _func)(sampler);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(SamplerParameterIiv)(GLuint sampler, GLenum pname, const GLint *params)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[608];
- ((void (APIENTRY *)(GLuint sampler, GLenum pname, const GLint *params)) _func)(sampler, pname, params);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(SamplerParameterIuiv)(GLuint sampler, GLenum pname, const GLuint *params)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[609];
- ((void (APIENTRY *)(GLuint sampler, GLenum pname, const GLuint *params)) _func)(sampler, pname, params);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(SamplerParameterf)(GLuint sampler, GLenum pname, GLfloat param)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[610];
- ((void (APIENTRY *)(GLuint sampler, GLenum pname, GLfloat param)) _func)(sampler, pname, param);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(SamplerParameterfv)(GLuint sampler, GLenum pname, const GLfloat *params)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[611];
- ((void (APIENTRY *)(GLuint sampler, GLenum pname, const GLfloat *params)) _func)(sampler, pname, params);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(SamplerParameteri)(GLuint sampler, GLenum pname, GLint param)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[612];
- ((void (APIENTRY *)(GLuint sampler, GLenum pname, GLint param)) _func)(sampler, pname, param);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(SamplerParameteriv)(GLuint sampler, GLenum pname, const GLint *params)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[613];
- ((void (APIENTRY *)(GLuint sampler, GLenum pname, const GLint *params)) _func)(sampler, pname, params);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(BindTransformFeedback)(GLenum target, GLuint id)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[614];
- ((void (APIENTRY *)(GLenum target, GLuint id)) _func)(target, id);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(DeleteTransformFeedbacks)(GLsizei n, const GLuint *ids)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[615];
- ((void (APIENTRY *)(GLsizei n, const GLuint *ids)) _func)(n, ids);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(DrawTransformFeedback)(GLenum mode, GLuint id)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[616];
- ((void (APIENTRY *)(GLenum mode, GLuint id)) _func)(mode, id);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(GenTransformFeedbacks)(GLsizei n, GLuint *ids)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[617];
- ((void (APIENTRY *)(GLsizei n, GLuint *ids)) _func)(n, ids);
-}
-
-GLAPI GLboolean APIENTRY GLAPI_PREFIX(IsTransformFeedback)(GLuint id)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[618];
- return ((GLboolean (APIENTRY *)(GLuint id)) _func)(id);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(PauseTransformFeedback)(void)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[619];
- ((void (APIENTRY *)(void)) _func)();
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(ResumeTransformFeedback)(void)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[620];
- ((void (APIENTRY *)(void)) _func)();
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(ClearDepthf)(GLclampf depth)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[621];
- ((void (APIENTRY *)(GLclampf depth)) _func)(depth);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(DepthRangef)(GLclampf zNear, GLclampf zFar)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[622];
- ((void (APIENTRY *)(GLclampf zNear, GLclampf zFar)) _func)(zNear, zFar);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(GetShaderPrecisionFormat)(GLenum shadertype, GLenum precisiontype, GLint *range, GLint *precision)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[623];
- ((void (APIENTRY *)(GLenum shadertype, GLenum precisiontype, GLint *range, GLint *precision)) _func)(shadertype, precisiontype, range, precision);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(ReleaseShaderCompiler)(void)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[624];
- ((void (APIENTRY *)(void)) _func)();
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(ShaderBinary)(GLsizei n, const GLuint *shaders, GLenum binaryformat, const GLvoid *binary, GLsizei length)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[625];
- ((void (APIENTRY *)(GLsizei n, const GLuint *shaders, GLenum binaryformat, const GLvoid *binary, GLsizei length)) _func)(n, shaders, binaryformat, binary, length);
-}
-
-GLAPI GLenum APIENTRY GLAPI_PREFIX(GetGraphicsResetStatusARB)(void)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[629];
- return ((GLenum (APIENTRY *)(void)) _func)();
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(GetnColorTableARB)(GLenum target, GLenum format, GLenum type, GLsizei bufSize, GLvoid *table)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[630];
- ((void (APIENTRY *)(GLenum target, GLenum format, GLenum type, GLsizei bufSize, GLvoid *table)) _func)(target, format, type, bufSize, table);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(GetnCompressedTexImageARB)(GLenum target, GLint lod, GLsizei bufSize, GLvoid *img)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[631];
- ((void (APIENTRY *)(GLenum target, GLint lod, GLsizei bufSize, GLvoid *img)) _func)(target, lod, bufSize, img);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(GetnConvolutionFilterARB)(GLenum target, GLenum format, GLenum type, GLsizei bufSize, GLvoid *image)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[632];
- ((void (APIENTRY *)(GLenum target, GLenum format, GLenum type, GLsizei bufSize, GLvoid *image)) _func)(target, format, type, bufSize, image);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(GetnHistogramARB)(GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, GLvoid *values)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[633];
- ((void (APIENTRY *)(GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, GLvoid *values)) _func)(target, reset, format, type, bufSize, values);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(GetnMapdvARB)(GLenum target, GLenum query, GLsizei bufSize, GLdouble *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[634];
- ((void (APIENTRY *)(GLenum target, GLenum query, GLsizei bufSize, GLdouble *v)) _func)(target, query, bufSize, v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(GetnMapfvARB)(GLenum target, GLenum query, GLsizei bufSize, GLfloat *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[635];
- ((void (APIENTRY *)(GLenum target, GLenum query, GLsizei bufSize, GLfloat *v)) _func)(target, query, bufSize, v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(GetnMapivARB)(GLenum target, GLenum query, GLsizei bufSize, GLint *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[636];
- ((void (APIENTRY *)(GLenum target, GLenum query, GLsizei bufSize, GLint *v)) _func)(target, query, bufSize, v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(GetnMinmaxARB)(GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, GLvoid *values)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[637];
- ((void (APIENTRY *)(GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, GLvoid *values)) _func)(target, reset, format, type, bufSize, values);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(GetnPixelMapfvARB)(GLenum map, GLsizei bufSize, GLfloat *values)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[638];
- ((void (APIENTRY *)(GLenum map, GLsizei bufSize, GLfloat *values)) _func)(map, bufSize, values);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(GetnPixelMapuivARB)(GLenum map, GLsizei bufSize, GLuint *values)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[639];
- ((void (APIENTRY *)(GLenum map, GLsizei bufSize, GLuint *values)) _func)(map, bufSize, values);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(GetnPixelMapusvARB)(GLenum map, GLsizei bufSize, GLushort *values)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[640];
- ((void (APIENTRY *)(GLenum map, GLsizei bufSize, GLushort *values)) _func)(map, bufSize, values);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(GetnPolygonStippleARB)(GLsizei bufSize, GLubyte *pattern)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[641];
- ((void (APIENTRY *)(GLsizei bufSize, GLubyte *pattern)) _func)(bufSize, pattern);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(GetnSeparableFilterARB)(GLenum target, GLenum format, GLenum type, GLsizei rowBufSize, GLvoid *row, GLsizei columnBufSize, GLvoid *column, GLvoid *span)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[642];
- ((void (APIENTRY *)(GLenum target, GLenum format, GLenum type, GLsizei rowBufSize, GLvoid *row, GLsizei columnBufSize, GLvoid *column, GLvoid *span)) _func)(target, format, type, rowBufSize, row, columnBufSize, column, span);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(GetnTexImageARB)(GLenum target, GLint level, GLenum format, GLenum type, GLsizei bufSize, GLvoid *img)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[643];
- ((void (APIENTRY *)(GLenum target, GLint level, GLenum format, GLenum type, GLsizei bufSize, GLvoid *img)) _func)(target, level, format, type, bufSize, img);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(GetnUniformdvARB)(GLhandleARB program, GLint location, GLsizei bufSize, GLdouble *params)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[644];
- ((void (APIENTRY *)(GLhandleARB program, GLint location, GLsizei bufSize, GLdouble *params)) _func)(program, location, bufSize, params);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(GetnUniformfvARB)(GLhandleARB program, GLint location, GLsizei bufSize, GLfloat *params)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[645];
- ((void (APIENTRY *)(GLhandleARB program, GLint location, GLsizei bufSize, GLfloat *params)) _func)(program, location, bufSize, params);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(GetnUniformivARB)(GLhandleARB program, GLint location, GLsizei bufSize, GLint *params)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[646];
- ((void (APIENTRY *)(GLhandleARB program, GLint location, GLsizei bufSize, GLint *params)) _func)(program, location, bufSize, params);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(GetnUniformuivARB)(GLhandleARB program, GLint location, GLsizei bufSize, GLuint *params)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[647];
- ((void (APIENTRY *)(GLhandleARB program, GLint location, GLsizei bufSize, GLuint *params)) _func)(program, location, bufSize, params);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(ReadnPixelsARB)(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, GLvoid *data)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[648];
- ((void (APIENTRY *)(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, GLvoid *data)) _func)(x, y, width, height, format, type, bufSize, data);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(PolygonOffsetEXT)(GLfloat factor, GLfloat bias)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[649];
- ((void (APIENTRY *)(GLfloat factor, GLfloat bias)) _func)(factor, bias);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(ColorPointerEXT)(GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[668];
- ((void (APIENTRY *)(GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer)) _func)(size, type, stride, count, pointer);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(EdgeFlagPointerEXT)(GLsizei stride, GLsizei count, const GLboolean *pointer)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[669];
- ((void (APIENTRY *)(GLsizei stride, GLsizei count, const GLboolean *pointer)) _func)(stride, count, pointer);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(IndexPointerEXT)(GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[670];
- ((void (APIENTRY *)(GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer)) _func)(type, stride, count, pointer);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(NormalPointerEXT)(GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[671];
- ((void (APIENTRY *)(GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer)) _func)(type, stride, count, pointer);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(TexCoordPointerEXT)(GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[672];
- ((void (APIENTRY *)(GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer)) _func)(size, type, stride, count, pointer);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(VertexPointerEXT)(GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[673];
- ((void (APIENTRY *)(GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer)) _func)(size, type, stride, count, pointer);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(PointParameterfEXT)(GLenum pname, GLfloat param)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[674];
- ((void (APIENTRY *)(GLenum pname, GLfloat param)) _func)(pname, param);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(PointParameterf)(GLenum pname, GLfloat param)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[674];
- ((void (APIENTRY *)(GLenum pname, GLfloat param)) _func)(pname, param);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(PointParameterfARB)(GLenum pname, GLfloat param)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[674];
- ((void (APIENTRY *)(GLenum pname, GLfloat param)) _func)(pname, param);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(PointParameterfvEXT)(GLenum pname, const GLfloat *params)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[675];
- ((void (APIENTRY *)(GLenum pname, const GLfloat *params)) _func)(pname, params);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(PointParameterfv)(GLenum pname, const GLfloat *params)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[675];
- ((void (APIENTRY *)(GLenum pname, const GLfloat *params)) _func)(pname, params);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(PointParameterfvARB)(GLenum pname, const GLfloat *params)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[675];
- ((void (APIENTRY *)(GLenum pname, const GLfloat *params)) _func)(pname, params);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(LockArraysEXT)(GLint first, GLsizei count)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[676];
- ((void (APIENTRY *)(GLint first, GLsizei count)) _func)(first, count);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(UnlockArraysEXT)(void)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[677];
- ((void (APIENTRY *)(void)) _func)();
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(SecondaryColor3bEXT)(GLbyte red, GLbyte green, GLbyte blue)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[678];
- ((void (APIENTRY *)(GLbyte red, GLbyte green, GLbyte blue)) _func)(red, green, blue);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(SecondaryColor3b)(GLbyte red, GLbyte green, GLbyte blue)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[678];
- ((void (APIENTRY *)(GLbyte red, GLbyte green, GLbyte blue)) _func)(red, green, blue);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(SecondaryColor3bvEXT)(const GLbyte *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[679];
- ((void (APIENTRY *)(const GLbyte *v)) _func)(v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(SecondaryColor3bv)(const GLbyte *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[679];
- ((void (APIENTRY *)(const GLbyte *v)) _func)(v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(SecondaryColor3dEXT)(GLdouble red, GLdouble green, GLdouble blue)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[680];
- ((void (APIENTRY *)(GLdouble red, GLdouble green, GLdouble blue)) _func)(red, green, blue);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(SecondaryColor3d)(GLdouble red, GLdouble green, GLdouble blue)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[680];
- ((void (APIENTRY *)(GLdouble red, GLdouble green, GLdouble blue)) _func)(red, green, blue);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(SecondaryColor3dvEXT)(const GLdouble *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[681];
- ((void (APIENTRY *)(const GLdouble *v)) _func)(v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(SecondaryColor3dv)(const GLdouble *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[681];
- ((void (APIENTRY *)(const GLdouble *v)) _func)(v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(SecondaryColor3fEXT)(GLfloat red, GLfloat green, GLfloat blue)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[682];
- ((void (APIENTRY *)(GLfloat red, GLfloat green, GLfloat blue)) _func)(red, green, blue);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(SecondaryColor3f)(GLfloat red, GLfloat green, GLfloat blue)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[682];
- ((void (APIENTRY *)(GLfloat red, GLfloat green, GLfloat blue)) _func)(red, green, blue);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(SecondaryColor3fvEXT)(const GLfloat *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[683];
- ((void (APIENTRY *)(const GLfloat *v)) _func)(v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(SecondaryColor3fv)(const GLfloat *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[683];
- ((void (APIENTRY *)(const GLfloat *v)) _func)(v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(SecondaryColor3iEXT)(GLint red, GLint green, GLint blue)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[684];
- ((void (APIENTRY *)(GLint red, GLint green, GLint blue)) _func)(red, green, blue);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(SecondaryColor3i)(GLint red, GLint green, GLint blue)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[684];
- ((void (APIENTRY *)(GLint red, GLint green, GLint blue)) _func)(red, green, blue);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(SecondaryColor3ivEXT)(const GLint *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[685];
- ((void (APIENTRY *)(const GLint *v)) _func)(v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(SecondaryColor3iv)(const GLint *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[685];
- ((void (APIENTRY *)(const GLint *v)) _func)(v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(SecondaryColor3sEXT)(GLshort red, GLshort green, GLshort blue)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[686];
- ((void (APIENTRY *)(GLshort red, GLshort green, GLshort blue)) _func)(red, green, blue);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(SecondaryColor3s)(GLshort red, GLshort green, GLshort blue)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[686];
- ((void (APIENTRY *)(GLshort red, GLshort green, GLshort blue)) _func)(red, green, blue);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(SecondaryColor3svEXT)(const GLshort *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[687];
- ((void (APIENTRY *)(const GLshort *v)) _func)(v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(SecondaryColor3sv)(const GLshort *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[687];
- ((void (APIENTRY *)(const GLshort *v)) _func)(v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(SecondaryColor3ubEXT)(GLubyte red, GLubyte green, GLubyte blue)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[688];
- ((void (APIENTRY *)(GLubyte red, GLubyte green, GLubyte blue)) _func)(red, green, blue);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(SecondaryColor3ub)(GLubyte red, GLubyte green, GLubyte blue)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[688];
- ((void (APIENTRY *)(GLubyte red, GLubyte green, GLubyte blue)) _func)(red, green, blue);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(SecondaryColor3ubvEXT)(const GLubyte *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[689];
- ((void (APIENTRY *)(const GLubyte *v)) _func)(v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(SecondaryColor3ubv)(const GLubyte *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[689];
- ((void (APIENTRY *)(const GLubyte *v)) _func)(v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(SecondaryColor3uiEXT)(GLuint red, GLuint green, GLuint blue)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[690];
- ((void (APIENTRY *)(GLuint red, GLuint green, GLuint blue)) _func)(red, green, blue);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(SecondaryColor3ui)(GLuint red, GLuint green, GLuint blue)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[690];
- ((void (APIENTRY *)(GLuint red, GLuint green, GLuint blue)) _func)(red, green, blue);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(SecondaryColor3uivEXT)(const GLuint *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[691];
- ((void (APIENTRY *)(const GLuint *v)) _func)(v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(SecondaryColor3uiv)(const GLuint *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[691];
- ((void (APIENTRY *)(const GLuint *v)) _func)(v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(SecondaryColor3usEXT)(GLushort red, GLushort green, GLushort blue)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[692];
- ((void (APIENTRY *)(GLushort red, GLushort green, GLushort blue)) _func)(red, green, blue);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(SecondaryColor3us)(GLushort red, GLushort green, GLushort blue)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[692];
- ((void (APIENTRY *)(GLushort red, GLushort green, GLushort blue)) _func)(red, green, blue);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(SecondaryColor3usvEXT)(const GLushort *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[693];
- ((void (APIENTRY *)(const GLushort *v)) _func)(v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(SecondaryColor3usv)(const GLushort *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[693];
- ((void (APIENTRY *)(const GLushort *v)) _func)(v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(SecondaryColorPointerEXT)(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[694];
- ((void (APIENTRY *)(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer)) _func)(size, type, stride, pointer);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(SecondaryColorPointer)(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[694];
- ((void (APIENTRY *)(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer)) _func)(size, type, stride, pointer);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(MultiDrawArraysEXT)(GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[695];
- ((void (APIENTRY *)(GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount)) _func)(mode, first, count, primcount);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(MultiDrawArrays)(GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[695];
- ((void (APIENTRY *)(GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount)) _func)(mode, first, count, primcount);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(MultiDrawElementsEXT)(GLenum mode, const GLsizei *count, GLenum type, const GLvoid **indices, GLsizei primcount)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[696];
- ((void (APIENTRY *)(GLenum mode, const GLsizei *count, GLenum type, const GLvoid **indices, GLsizei primcount)) _func)(mode, count, type, indices, primcount);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(MultiDrawElements)(GLenum mode, const GLsizei *count, GLenum type, const GLvoid **indices, GLsizei primcount)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[696];
- ((void (APIENTRY *)(GLenum mode, const GLsizei *count, GLenum type, const GLvoid **indices, GLsizei primcount)) _func)(mode, count, type, indices, primcount);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(FogCoordPointerEXT)(GLenum type, GLsizei stride, const GLvoid *pointer)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[697];
- ((void (APIENTRY *)(GLenum type, GLsizei stride, const GLvoid *pointer)) _func)(type, stride, pointer);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(FogCoordPointer)(GLenum type, GLsizei stride, const GLvoid *pointer)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[697];
- ((void (APIENTRY *)(GLenum type, GLsizei stride, const GLvoid *pointer)) _func)(type, stride, pointer);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(FogCoorddEXT)(GLdouble coord)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[698];
- ((void (APIENTRY *)(GLdouble coord)) _func)(coord);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(FogCoordd)(GLdouble coord)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[698];
- ((void (APIENTRY *)(GLdouble coord)) _func)(coord);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(FogCoorddvEXT)(const GLdouble *coord)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[699];
- ((void (APIENTRY *)(const GLdouble *coord)) _func)(coord);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(FogCoorddv)(const GLdouble *coord)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[699];
- ((void (APIENTRY *)(const GLdouble *coord)) _func)(coord);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(FogCoordfEXT)(GLfloat coord)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[700];
- ((void (APIENTRY *)(GLfloat coord)) _func)(coord);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(FogCoordf)(GLfloat coord)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[700];
- ((void (APIENTRY *)(GLfloat coord)) _func)(coord);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(FogCoordfvEXT)(const GLfloat *coord)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[701];
- ((void (APIENTRY *)(const GLfloat *coord)) _func)(coord);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(FogCoordfv)(const GLfloat *coord)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[701];
- ((void (APIENTRY *)(const GLfloat *coord)) _func)(coord);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(BlendFuncSeparateEXT)(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[703];
- ((void (APIENTRY *)(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha)) _func)(sfactorRGB, dfactorRGB, sfactorAlpha, dfactorAlpha);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(BlendFuncSeparate)(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[703];
- ((void (APIENTRY *)(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha)) _func)(sfactorRGB, dfactorRGB, sfactorAlpha, dfactorAlpha);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(FlushVertexArrayRangeNV)(void)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[704];
- ((void (APIENTRY *)(void)) _func)();
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(VertexArrayRangeNV)(GLsizei length, const GLvoid *pointer)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[705];
- ((void (APIENTRY *)(GLsizei length, const GLvoid *pointer)) _func)(length, pointer);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(CombinerInputNV)(GLenum stage, GLenum portion, GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[706];
- ((void (APIENTRY *)(GLenum stage, GLenum portion, GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage)) _func)(stage, portion, variable, input, mapping, componentUsage);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(CombinerOutputNV)(GLenum stage, GLenum portion, GLenum abOutput, GLenum cdOutput, GLenum sumOutput, GLenum scale, GLenum bias, GLboolean abDotProduct, GLboolean cdDotProduct, GLboolean muxSum)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[707];
- ((void (APIENTRY *)(GLenum stage, GLenum portion, GLenum abOutput, GLenum cdOutput, GLenum sumOutput, GLenum scale, GLenum bias, GLboolean abDotProduct, GLboolean cdDotProduct, GLboolean muxSum)) _func)(stage, portion, abOutput, cdOutput, sumOutput, scale, bias, abDotProduct, cdDotProduct, muxSum);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(CombinerParameterfNV)(GLenum pname, GLfloat param)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[708];
- ((void (APIENTRY *)(GLenum pname, GLfloat param)) _func)(pname, param);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(CombinerParameterfvNV)(GLenum pname, const GLfloat *params)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[709];
- ((void (APIENTRY *)(GLenum pname, const GLfloat *params)) _func)(pname, params);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(CombinerParameteriNV)(GLenum pname, GLint param)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[710];
- ((void (APIENTRY *)(GLenum pname, GLint param)) _func)(pname, param);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(CombinerParameterivNV)(GLenum pname, const GLint *params)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[711];
- ((void (APIENTRY *)(GLenum pname, const GLint *params)) _func)(pname, params);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(FinalCombinerInputNV)(GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[712];
- ((void (APIENTRY *)(GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage)) _func)(variable, input, mapping, componentUsage);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(GetCombinerInputParameterfvNV)(GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLfloat *params)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[713];
- ((void (APIENTRY *)(GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLfloat *params)) _func)(stage, portion, variable, pname, params);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(GetCombinerInputParameterivNV)(GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLint *params)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[714];
- ((void (APIENTRY *)(GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLint *params)) _func)(stage, portion, variable, pname, params);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(GetCombinerOutputParameterfvNV)(GLenum stage, GLenum portion, GLenum pname, GLfloat *params)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[715];
- ((void (APIENTRY *)(GLenum stage, GLenum portion, GLenum pname, GLfloat *params)) _func)(stage, portion, pname, params);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(GetCombinerOutputParameterivNV)(GLenum stage, GLenum portion, GLenum pname, GLint *params)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[716];
- ((void (APIENTRY *)(GLenum stage, GLenum portion, GLenum pname, GLint *params)) _func)(stage, portion, pname, params);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(GetFinalCombinerInputParameterfvNV)(GLenum variable, GLenum pname, GLfloat *params)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[717];
- ((void (APIENTRY *)(GLenum variable, GLenum pname, GLfloat *params)) _func)(variable, pname, params);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(GetFinalCombinerInputParameterivNV)(GLenum variable, GLenum pname, GLint *params)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[718];
- ((void (APIENTRY *)(GLenum variable, GLenum pname, GLint *params)) _func)(variable, pname, params);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(ResizeBuffersMESA)(void)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[719];
- ((void (APIENTRY *)(void)) _func)();
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(WindowPos2dMESA)(GLdouble x, GLdouble y)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[720];
- ((void (APIENTRY *)(GLdouble x, GLdouble y)) _func)(x, y);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(WindowPos2d)(GLdouble x, GLdouble y)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[720];
- ((void (APIENTRY *)(GLdouble x, GLdouble y)) _func)(x, y);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(WindowPos2dARB)(GLdouble x, GLdouble y)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[720];
- ((void (APIENTRY *)(GLdouble x, GLdouble y)) _func)(x, y);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(WindowPos2dvMESA)(const GLdouble *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[721];
- ((void (APIENTRY *)(const GLdouble *v)) _func)(v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(WindowPos2dv)(const GLdouble *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[721];
- ((void (APIENTRY *)(const GLdouble *v)) _func)(v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(WindowPos2dvARB)(const GLdouble *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[721];
- ((void (APIENTRY *)(const GLdouble *v)) _func)(v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(WindowPos2fMESA)(GLfloat x, GLfloat y)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[722];
- ((void (APIENTRY *)(GLfloat x, GLfloat y)) _func)(x, y);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(WindowPos2f)(GLfloat x, GLfloat y)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[722];
- ((void (APIENTRY *)(GLfloat x, GLfloat y)) _func)(x, y);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(WindowPos2fARB)(GLfloat x, GLfloat y)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[722];
- ((void (APIENTRY *)(GLfloat x, GLfloat y)) _func)(x, y);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(WindowPos2fvMESA)(const GLfloat *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[723];
- ((void (APIENTRY *)(const GLfloat *v)) _func)(v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(WindowPos2fv)(const GLfloat *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[723];
- ((void (APIENTRY *)(const GLfloat *v)) _func)(v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(WindowPos2fvARB)(const GLfloat *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[723];
- ((void (APIENTRY *)(const GLfloat *v)) _func)(v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(WindowPos2iMESA)(GLint x, GLint y)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[724];
- ((void (APIENTRY *)(GLint x, GLint y)) _func)(x, y);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(WindowPos2i)(GLint x, GLint y)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[724];
- ((void (APIENTRY *)(GLint x, GLint y)) _func)(x, y);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(WindowPos2iARB)(GLint x, GLint y)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[724];
- ((void (APIENTRY *)(GLint x, GLint y)) _func)(x, y);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(WindowPos2ivMESA)(const GLint *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[725];
- ((void (APIENTRY *)(const GLint *v)) _func)(v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(WindowPos2iv)(const GLint *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[725];
- ((void (APIENTRY *)(const GLint *v)) _func)(v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(WindowPos2ivARB)(const GLint *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[725];
- ((void (APIENTRY *)(const GLint *v)) _func)(v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(WindowPos2sMESA)(GLshort x, GLshort y)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[726];
- ((void (APIENTRY *)(GLshort x, GLshort y)) _func)(x, y);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(WindowPos2s)(GLshort x, GLshort y)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[726];
- ((void (APIENTRY *)(GLshort x, GLshort y)) _func)(x, y);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(WindowPos2sARB)(GLshort x, GLshort y)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[726];
- ((void (APIENTRY *)(GLshort x, GLshort y)) _func)(x, y);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(WindowPos2svMESA)(const GLshort *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[727];
- ((void (APIENTRY *)(const GLshort *v)) _func)(v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(WindowPos2sv)(const GLshort *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[727];
- ((void (APIENTRY *)(const GLshort *v)) _func)(v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(WindowPos2svARB)(const GLshort *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[727];
- ((void (APIENTRY *)(const GLshort *v)) _func)(v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(WindowPos3dMESA)(GLdouble x, GLdouble y, GLdouble z)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[728];
- ((void (APIENTRY *)(GLdouble x, GLdouble y, GLdouble z)) _func)(x, y, z);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(WindowPos3d)(GLdouble x, GLdouble y, GLdouble z)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[728];
- ((void (APIENTRY *)(GLdouble x, GLdouble y, GLdouble z)) _func)(x, y, z);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(WindowPos3dARB)(GLdouble x, GLdouble y, GLdouble z)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[728];
- ((void (APIENTRY *)(GLdouble x, GLdouble y, GLdouble z)) _func)(x, y, z);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(WindowPos3dvMESA)(const GLdouble *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[729];
- ((void (APIENTRY *)(const GLdouble *v)) _func)(v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(WindowPos3dv)(const GLdouble *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[729];
- ((void (APIENTRY *)(const GLdouble *v)) _func)(v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(WindowPos3dvARB)(const GLdouble *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[729];
- ((void (APIENTRY *)(const GLdouble *v)) _func)(v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(WindowPos3fMESA)(GLfloat x, GLfloat y, GLfloat z)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[730];
- ((void (APIENTRY *)(GLfloat x, GLfloat y, GLfloat z)) _func)(x, y, z);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(WindowPos3f)(GLfloat x, GLfloat y, GLfloat z)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[730];
- ((void (APIENTRY *)(GLfloat x, GLfloat y, GLfloat z)) _func)(x, y, z);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(WindowPos3fARB)(GLfloat x, GLfloat y, GLfloat z)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[730];
- ((void (APIENTRY *)(GLfloat x, GLfloat y, GLfloat z)) _func)(x, y, z);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(WindowPos3fvMESA)(const GLfloat *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[731];
- ((void (APIENTRY *)(const GLfloat *v)) _func)(v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(WindowPos3fv)(const GLfloat *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[731];
- ((void (APIENTRY *)(const GLfloat *v)) _func)(v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(WindowPos3fvARB)(const GLfloat *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[731];
- ((void (APIENTRY *)(const GLfloat *v)) _func)(v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(WindowPos3iMESA)(GLint x, GLint y, GLint z)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[732];
- ((void (APIENTRY *)(GLint x, GLint y, GLint z)) _func)(x, y, z);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(WindowPos3i)(GLint x, GLint y, GLint z)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[732];
- ((void (APIENTRY *)(GLint x, GLint y, GLint z)) _func)(x, y, z);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(WindowPos3iARB)(GLint x, GLint y, GLint z)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[732];
- ((void (APIENTRY *)(GLint x, GLint y, GLint z)) _func)(x, y, z);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(WindowPos3ivMESA)(const GLint *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[733];
- ((void (APIENTRY *)(const GLint *v)) _func)(v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(WindowPos3iv)(const GLint *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[733];
- ((void (APIENTRY *)(const GLint *v)) _func)(v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(WindowPos3ivARB)(const GLint *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[733];
- ((void (APIENTRY *)(const GLint *v)) _func)(v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(WindowPos3sMESA)(GLshort x, GLshort y, GLshort z)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[734];
- ((void (APIENTRY *)(GLshort x, GLshort y, GLshort z)) _func)(x, y, z);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(WindowPos3s)(GLshort x, GLshort y, GLshort z)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[734];
- ((void (APIENTRY *)(GLshort x, GLshort y, GLshort z)) _func)(x, y, z);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(WindowPos3sARB)(GLshort x, GLshort y, GLshort z)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[734];
- ((void (APIENTRY *)(GLshort x, GLshort y, GLshort z)) _func)(x, y, z);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(WindowPos3svMESA)(const GLshort *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[735];
- ((void (APIENTRY *)(const GLshort *v)) _func)(v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(WindowPos3sv)(const GLshort *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[735];
- ((void (APIENTRY *)(const GLshort *v)) _func)(v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(WindowPos3svARB)(const GLshort *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[735];
- ((void (APIENTRY *)(const GLshort *v)) _func)(v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(WindowPos4dMESA)(GLdouble x, GLdouble y, GLdouble z, GLdouble w)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[736];
- ((void (APIENTRY *)(GLdouble x, GLdouble y, GLdouble z, GLdouble w)) _func)(x, y, z, w);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(WindowPos4dvMESA)(const GLdouble *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[737];
- ((void (APIENTRY *)(const GLdouble *v)) _func)(v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(WindowPos4fMESA)(GLfloat x, GLfloat y, GLfloat z, GLfloat w)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[738];
- ((void (APIENTRY *)(GLfloat x, GLfloat y, GLfloat z, GLfloat w)) _func)(x, y, z, w);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(WindowPos4fvMESA)(const GLfloat *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[739];
- ((void (APIENTRY *)(const GLfloat *v)) _func)(v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(WindowPos4iMESA)(GLint x, GLint y, GLint z, GLint w)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[740];
- ((void (APIENTRY *)(GLint x, GLint y, GLint z, GLint w)) _func)(x, y, z, w);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(WindowPos4ivMESA)(const GLint *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[741];
- ((void (APIENTRY *)(const GLint *v)) _func)(v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(WindowPos4sMESA)(GLshort x, GLshort y, GLshort z, GLshort w)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[742];
- ((void (APIENTRY *)(GLshort x, GLshort y, GLshort z, GLshort w)) _func)(x, y, z, w);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(WindowPos4svMESA)(const GLshort *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[743];
- ((void (APIENTRY *)(const GLshort *v)) _func)(v);
-}
-
-GLAPI GLboolean APIENTRY GLAPI_PREFIX(AreProgramsResidentNV)(GLsizei n, const GLuint *ids, GLboolean *residences)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[753];
- return ((GLboolean (APIENTRY *)(GLsizei n, const GLuint *ids, GLboolean *residences)) _func)(n, ids, residences);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(BindProgramNV)(GLenum target, GLuint program)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[754];
- ((void (APIENTRY *)(GLenum target, GLuint program)) _func)(target, program);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(BindProgramARB)(GLenum target, GLuint program)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[754];
- ((void (APIENTRY *)(GLenum target, GLuint program)) _func)(target, program);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(DeleteProgramsNV)(GLsizei n, const GLuint *programs)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[755];
- ((void (APIENTRY *)(GLsizei n, const GLuint *programs)) _func)(n, programs);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(DeleteProgramsARB)(GLsizei n, const GLuint *programs)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[755];
- ((void (APIENTRY *)(GLsizei n, const GLuint *programs)) _func)(n, programs);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(ExecuteProgramNV)(GLenum target, GLuint id, const GLfloat *params)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[756];
- ((void (APIENTRY *)(GLenum target, GLuint id, const GLfloat *params)) _func)(target, id, params);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(GenProgramsNV)(GLsizei n, GLuint *programs)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[757];
- ((void (APIENTRY *)(GLsizei n, GLuint *programs)) _func)(n, programs);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(GenProgramsARB)(GLsizei n, GLuint *programs)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[757];
- ((void (APIENTRY *)(GLsizei n, GLuint *programs)) _func)(n, programs);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(GetProgramParameterdvNV)(GLenum target, GLuint index, GLenum pname, GLdouble *params)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[758];
- ((void (APIENTRY *)(GLenum target, GLuint index, GLenum pname, GLdouble *params)) _func)(target, index, pname, params);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(GetProgramParameterfvNV)(GLenum target, GLuint index, GLenum pname, GLfloat *params)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[759];
- ((void (APIENTRY *)(GLenum target, GLuint index, GLenum pname, GLfloat *params)) _func)(target, index, pname, params);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(GetProgramStringNV)(GLuint id, GLenum pname, GLubyte *program)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[760];
- ((void (APIENTRY *)(GLuint id, GLenum pname, GLubyte *program)) _func)(id, pname, program);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(GetProgramivNV)(GLuint id, GLenum pname, GLint *params)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[761];
- ((void (APIENTRY *)(GLuint id, GLenum pname, GLint *params)) _func)(id, pname, params);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(GetTrackMatrixivNV)(GLenum target, GLuint address, GLenum pname, GLint *params)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[762];
- ((void (APIENTRY *)(GLenum target, GLuint address, GLenum pname, GLint *params)) _func)(target, address, pname, params);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(GetVertexAttribPointervNV)(GLuint index, GLenum pname, GLvoid **pointer)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[763];
- ((void (APIENTRY *)(GLuint index, GLenum pname, GLvoid **pointer)) _func)(index, pname, pointer);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(GetVertexAttribPointerv)(GLuint index, GLenum pname, GLvoid **pointer)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[763];
- ((void (APIENTRY *)(GLuint index, GLenum pname, GLvoid **pointer)) _func)(index, pname, pointer);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(GetVertexAttribPointervARB)(GLuint index, GLenum pname, GLvoid **pointer)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[763];
- ((void (APIENTRY *)(GLuint index, GLenum pname, GLvoid **pointer)) _func)(index, pname, pointer);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(GetVertexAttribdvNV)(GLuint index, GLenum pname, GLdouble *params)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[764];
- ((void (APIENTRY *)(GLuint index, GLenum pname, GLdouble *params)) _func)(index, pname, params);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(GetVertexAttribfvNV)(GLuint index, GLenum pname, GLfloat *params)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[765];
- ((void (APIENTRY *)(GLuint index, GLenum pname, GLfloat *params)) _func)(index, pname, params);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(GetVertexAttribivNV)(GLuint index, GLenum pname, GLint *params)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[766];
- ((void (APIENTRY *)(GLuint index, GLenum pname, GLint *params)) _func)(index, pname, params);
-}
-
-GLAPI GLboolean APIENTRY GLAPI_PREFIX(IsProgramNV)(GLuint program)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[767];
- return ((GLboolean (APIENTRY *)(GLuint program)) _func)(program);
-}
-
-GLAPI GLboolean APIENTRY GLAPI_PREFIX(IsProgramARB)(GLuint program)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[767];
- return ((GLboolean (APIENTRY *)(GLuint program)) _func)(program);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(LoadProgramNV)(GLenum target, GLuint id, GLsizei len, const GLubyte *program)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[768];
- ((void (APIENTRY *)(GLenum target, GLuint id, GLsizei len, const GLubyte *program)) _func)(target, id, len, program);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(ProgramParameters4dvNV)(GLenum target, GLuint index, GLsizei num, const GLdouble *params)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[769];
- ((void (APIENTRY *)(GLenum target, GLuint index, GLsizei num, const GLdouble *params)) _func)(target, index, num, params);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(ProgramParameters4fvNV)(GLenum target, GLuint index, GLsizei num, const GLfloat *params)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[770];
- ((void (APIENTRY *)(GLenum target, GLuint index, GLsizei num, const GLfloat *params)) _func)(target, index, num, params);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(RequestResidentProgramsNV)(GLsizei n, const GLuint *ids)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[771];
- ((void (APIENTRY *)(GLsizei n, const GLuint *ids)) _func)(n, ids);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(TrackMatrixNV)(GLenum target, GLuint address, GLenum matrix, GLenum transform)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[772];
- ((void (APIENTRY *)(GLenum target, GLuint address, GLenum matrix, GLenum transform)) _func)(target, address, matrix, transform);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib1dNV)(GLuint index, GLdouble x)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[773];
- ((void (APIENTRY *)(GLuint index, GLdouble x)) _func)(index, x);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib1dvNV)(GLuint index, const GLdouble *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[774];
- ((void (APIENTRY *)(GLuint index, const GLdouble *v)) _func)(index, v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib1fNV)(GLuint index, GLfloat x)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[775];
- ((void (APIENTRY *)(GLuint index, GLfloat x)) _func)(index, x);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib1fvNV)(GLuint index, const GLfloat *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[776];
- ((void (APIENTRY *)(GLuint index, const GLfloat *v)) _func)(index, v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib1sNV)(GLuint index, GLshort x)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[777];
- ((void (APIENTRY *)(GLuint index, GLshort x)) _func)(index, x);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib1svNV)(GLuint index, const GLshort *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[778];
- ((void (APIENTRY *)(GLuint index, const GLshort *v)) _func)(index, v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib2dNV)(GLuint index, GLdouble x, GLdouble y)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[779];
- ((void (APIENTRY *)(GLuint index, GLdouble x, GLdouble y)) _func)(index, x, y);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib2dvNV)(GLuint index, const GLdouble *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[780];
- ((void (APIENTRY *)(GLuint index, const GLdouble *v)) _func)(index, v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib2fNV)(GLuint index, GLfloat x, GLfloat y)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[781];
- ((void (APIENTRY *)(GLuint index, GLfloat x, GLfloat y)) _func)(index, x, y);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib2fvNV)(GLuint index, const GLfloat *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[782];
- ((void (APIENTRY *)(GLuint index, const GLfloat *v)) _func)(index, v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib2sNV)(GLuint index, GLshort x, GLshort y)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[783];
- ((void (APIENTRY *)(GLuint index, GLshort x, GLshort y)) _func)(index, x, y);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib2svNV)(GLuint index, const GLshort *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[784];
- ((void (APIENTRY *)(GLuint index, const GLshort *v)) _func)(index, v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib3dNV)(GLuint index, GLdouble x, GLdouble y, GLdouble z)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[785];
- ((void (APIENTRY *)(GLuint index, GLdouble x, GLdouble y, GLdouble z)) _func)(index, x, y, z);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib3dvNV)(GLuint index, const GLdouble *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[786];
- ((void (APIENTRY *)(GLuint index, const GLdouble *v)) _func)(index, v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib3fNV)(GLuint index, GLfloat x, GLfloat y, GLfloat z)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[787];
- ((void (APIENTRY *)(GLuint index, GLfloat x, GLfloat y, GLfloat z)) _func)(index, x, y, z);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib3fvNV)(GLuint index, const GLfloat *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[788];
- ((void (APIENTRY *)(GLuint index, const GLfloat *v)) _func)(index, v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib3sNV)(GLuint index, GLshort x, GLshort y, GLshort z)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[789];
- ((void (APIENTRY *)(GLuint index, GLshort x, GLshort y, GLshort z)) _func)(index, x, y, z);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib3svNV)(GLuint index, const GLshort *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[790];
- ((void (APIENTRY *)(GLuint index, const GLshort *v)) _func)(index, v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib4dNV)(GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[791];
- ((void (APIENTRY *)(GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w)) _func)(index, x, y, z, w);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib4dvNV)(GLuint index, const GLdouble *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[792];
- ((void (APIENTRY *)(GLuint index, const GLdouble *v)) _func)(index, v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib4fNV)(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[793];
- ((void (APIENTRY *)(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w)) _func)(index, x, y, z, w);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib4fvNV)(GLuint index, const GLfloat *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[794];
- ((void (APIENTRY *)(GLuint index, const GLfloat *v)) _func)(index, v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib4sNV)(GLuint index, GLshort x, GLshort y, GLshort z, GLshort w)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[795];
- ((void (APIENTRY *)(GLuint index, GLshort x, GLshort y, GLshort z, GLshort w)) _func)(index, x, y, z, w);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib4svNV)(GLuint index, const GLshort *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[796];
- ((void (APIENTRY *)(GLuint index, const GLshort *v)) _func)(index, v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib4ubNV)(GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[797];
- ((void (APIENTRY *)(GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w)) _func)(index, x, y, z, w);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib4ubvNV)(GLuint index, const GLubyte *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[798];
- ((void (APIENTRY *)(GLuint index, const GLubyte *v)) _func)(index, v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribPointerNV)(GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[799];
- ((void (APIENTRY *)(GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer)) _func)(index, size, type, stride, pointer);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribs1dvNV)(GLuint index, GLsizei n, const GLdouble *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[800];
- ((void (APIENTRY *)(GLuint index, GLsizei n, const GLdouble *v)) _func)(index, n, v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribs1fvNV)(GLuint index, GLsizei n, const GLfloat *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[801];
- ((void (APIENTRY *)(GLuint index, GLsizei n, const GLfloat *v)) _func)(index, n, v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribs1svNV)(GLuint index, GLsizei n, const GLshort *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[802];
- ((void (APIENTRY *)(GLuint index, GLsizei n, const GLshort *v)) _func)(index, n, v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribs2dvNV)(GLuint index, GLsizei n, const GLdouble *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[803];
- ((void (APIENTRY *)(GLuint index, GLsizei n, const GLdouble *v)) _func)(index, n, v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribs2fvNV)(GLuint index, GLsizei n, const GLfloat *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[804];
- ((void (APIENTRY *)(GLuint index, GLsizei n, const GLfloat *v)) _func)(index, n, v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribs2svNV)(GLuint index, GLsizei n, const GLshort *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[805];
- ((void (APIENTRY *)(GLuint index, GLsizei n, const GLshort *v)) _func)(index, n, v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribs3dvNV)(GLuint index, GLsizei n, const GLdouble *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[806];
- ((void (APIENTRY *)(GLuint index, GLsizei n, const GLdouble *v)) _func)(index, n, v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribs3fvNV)(GLuint index, GLsizei n, const GLfloat *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[807];
- ((void (APIENTRY *)(GLuint index, GLsizei n, const GLfloat *v)) _func)(index, n, v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribs3svNV)(GLuint index, GLsizei n, const GLshort *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[808];
- ((void (APIENTRY *)(GLuint index, GLsizei n, const GLshort *v)) _func)(index, n, v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribs4dvNV)(GLuint index, GLsizei n, const GLdouble *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[809];
- ((void (APIENTRY *)(GLuint index, GLsizei n, const GLdouble *v)) _func)(index, n, v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribs4fvNV)(GLuint index, GLsizei n, const GLfloat *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[810];
- ((void (APIENTRY *)(GLuint index, GLsizei n, const GLfloat *v)) _func)(index, n, v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribs4svNV)(GLuint index, GLsizei n, const GLshort *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[811];
- ((void (APIENTRY *)(GLuint index, GLsizei n, const GLshort *v)) _func)(index, n, v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribs4ubvNV)(GLuint index, GLsizei n, const GLubyte *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[812];
- ((void (APIENTRY *)(GLuint index, GLsizei n, const GLubyte *v)) _func)(index, n, v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(GetTexBumpParameterfvATI)(GLenum pname, GLfloat *param)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[813];
- ((void (APIENTRY *)(GLenum pname, GLfloat *param)) _func)(pname, param);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(GetTexBumpParameterivATI)(GLenum pname, GLint *param)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[814];
- ((void (APIENTRY *)(GLenum pname, GLint *param)) _func)(pname, param);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(TexBumpParameterfvATI)(GLenum pname, const GLfloat *param)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[815];
- ((void (APIENTRY *)(GLenum pname, const GLfloat *param)) _func)(pname, param);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(TexBumpParameterivATI)(GLenum pname, const GLint *param)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[816];
- ((void (APIENTRY *)(GLenum pname, const GLint *param)) _func)(pname, param);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(AlphaFragmentOp1ATI)(GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[817];
- ((void (APIENTRY *)(GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod)) _func)(op, dst, dstMod, arg1, arg1Rep, arg1Mod);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(AlphaFragmentOp2ATI)(GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[818];
- ((void (APIENTRY *)(GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod)) _func)(op, dst, dstMod, arg1, arg1Rep, arg1Mod, arg2, arg2Rep, arg2Mod);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(AlphaFragmentOp3ATI)(GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[819];
- ((void (APIENTRY *)(GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod)) _func)(op, dst, dstMod, arg1, arg1Rep, arg1Mod, arg2, arg2Rep, arg2Mod, arg3, arg3Rep, arg3Mod);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(BeginFragmentShaderATI)(void)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[820];
- ((void (APIENTRY *)(void)) _func)();
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(BindFragmentShaderATI)(GLuint id)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[821];
- ((void (APIENTRY *)(GLuint id)) _func)(id);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(ColorFragmentOp1ATI)(GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[822];
- ((void (APIENTRY *)(GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod)) _func)(op, dst, dstMask, dstMod, arg1, arg1Rep, arg1Mod);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(ColorFragmentOp2ATI)(GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[823];
- ((void (APIENTRY *)(GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod)) _func)(op, dst, dstMask, dstMod, arg1, arg1Rep, arg1Mod, arg2, arg2Rep, arg2Mod);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(ColorFragmentOp3ATI)(GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[824];
- ((void (APIENTRY *)(GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod)) _func)(op, dst, dstMask, dstMod, arg1, arg1Rep, arg1Mod, arg2, arg2Rep, arg2Mod, arg3, arg3Rep, arg3Mod);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(DeleteFragmentShaderATI)(GLuint id)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[825];
- ((void (APIENTRY *)(GLuint id)) _func)(id);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(EndFragmentShaderATI)(void)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[826];
- ((void (APIENTRY *)(void)) _func)();
-}
-
-GLAPI GLuint APIENTRY GLAPI_PREFIX(GenFragmentShadersATI)(GLuint range)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[827];
- return ((GLuint (APIENTRY *)(GLuint range)) _func)(range);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(PassTexCoordATI)(GLuint dst, GLuint coord, GLenum swizzle)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[828];
- ((void (APIENTRY *)(GLuint dst, GLuint coord, GLenum swizzle)) _func)(dst, coord, swizzle);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(SampleMapATI)(GLuint dst, GLuint interp, GLenum swizzle)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[829];
- ((void (APIENTRY *)(GLuint dst, GLuint interp, GLenum swizzle)) _func)(dst, interp, swizzle);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(SetFragmentShaderConstantATI)(GLuint dst, const GLfloat *value)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[830];
- ((void (APIENTRY *)(GLuint dst, const GLfloat *value)) _func)(dst, value);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(PointParameteriNV)(GLenum pname, GLint param)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[831];
- ((void (APIENTRY *)(GLenum pname, GLint param)) _func)(pname, param);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(PointParameteri)(GLenum pname, GLint param)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[831];
- ((void (APIENTRY *)(GLenum pname, GLint param)) _func)(pname, param);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(PointParameterivNV)(GLenum pname, const GLint *params)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[832];
- ((void (APIENTRY *)(GLenum pname, const GLint *params)) _func)(pname, params);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(PointParameteriv)(GLenum pname, const GLint *params)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[832];
- ((void (APIENTRY *)(GLenum pname, const GLint *params)) _func)(pname, params);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(DeleteVertexArrays)(GLsizei n, const GLuint *arrays)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[835];
- ((void (APIENTRY *)(GLsizei n, const GLuint *arrays)) _func)(n, arrays);
-}
-
-GLAPI GLboolean APIENTRY GLAPI_PREFIX(IsVertexArray)(GLuint array)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[837];
- return ((GLboolean (APIENTRY *)(GLuint array)) _func)(array);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(GetProgramNamedParameterdvNV)(GLuint id, GLsizei len, const GLubyte *name, GLdouble *params)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[838];
- ((void (APIENTRY *)(GLuint id, GLsizei len, const GLubyte *name, GLdouble *params)) _func)(id, len, name, params);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(GetProgramNamedParameterfvNV)(GLuint id, GLsizei len, const GLubyte *name, GLfloat *params)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[839];
- ((void (APIENTRY *)(GLuint id, GLsizei len, const GLubyte *name, GLfloat *params)) _func)(id, len, name, params);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(ProgramNamedParameter4dNV)(GLuint id, GLsizei len, const GLubyte *name, GLdouble x, GLdouble y, GLdouble z, GLdouble w)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[840];
- ((void (APIENTRY *)(GLuint id, GLsizei len, const GLubyte *name, GLdouble x, GLdouble y, GLdouble z, GLdouble w)) _func)(id, len, name, x, y, z, w);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(ProgramNamedParameter4dvNV)(GLuint id, GLsizei len, const GLubyte *name, const GLdouble *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[841];
- ((void (APIENTRY *)(GLuint id, GLsizei len, const GLubyte *name, const GLdouble *v)) _func)(id, len, name, v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(ProgramNamedParameter4fNV)(GLuint id, GLsizei len, const GLubyte *name, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[842];
- ((void (APIENTRY *)(GLuint id, GLsizei len, const GLubyte *name, GLfloat x, GLfloat y, GLfloat z, GLfloat w)) _func)(id, len, name, x, y, z, w);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(ProgramNamedParameter4fvNV)(GLuint id, GLsizei len, const GLubyte *name, const GLfloat *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[843];
- ((void (APIENTRY *)(GLuint id, GLsizei len, const GLubyte *name, const GLfloat *v)) _func)(id, len, name, v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(PrimitiveRestartIndexNV)(GLuint index)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[844];
- ((void (APIENTRY *)(GLuint index)) _func)(index);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(PrimitiveRestartIndex)(GLuint index)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[844];
- ((void (APIENTRY *)(GLuint index)) _func)(index);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(PrimitiveRestartNV)(void)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[845];
- ((void (APIENTRY *)(void)) _func)();
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(BlendEquationSeparate)(GLenum modeRGB, GLenum modeA)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[893];
- ((void (APIENTRY *)(GLenum modeRGB, GLenum modeA)) _func)(modeRGB, modeA);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(BindFramebufferEXT)(GLenum target, GLuint framebuffer)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[894];
- ((void (APIENTRY *)(GLenum target, GLuint framebuffer)) _func)(target, framebuffer);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(BindFramebuffer)(GLenum target, GLuint framebuffer)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[894];
- ((void (APIENTRY *)(GLenum target, GLuint framebuffer)) _func)(target, framebuffer);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(BindRenderbufferEXT)(GLenum target, GLuint renderbuffer)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[895];
- ((void (APIENTRY *)(GLenum target, GLuint renderbuffer)) _func)(target, renderbuffer);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(BindRenderbuffer)(GLenum target, GLuint renderbuffer)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[895];
- ((void (APIENTRY *)(GLenum target, GLuint renderbuffer)) _func)(target, renderbuffer);
-}
-
-GLAPI GLenum APIENTRY GLAPI_PREFIX(CheckFramebufferStatusEXT)(GLenum target)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[896];
- return ((GLenum (APIENTRY *)(GLenum target)) _func)(target);
-}
-
-GLAPI GLenum APIENTRY GLAPI_PREFIX(CheckFramebufferStatus)(GLenum target)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[896];
- return ((GLenum (APIENTRY *)(GLenum target)) _func)(target);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(DeleteFramebuffersEXT)(GLsizei n, const GLuint *framebuffers)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[897];
- ((void (APIENTRY *)(GLsizei n, const GLuint *framebuffers)) _func)(n, framebuffers);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(DeleteFramebuffers)(GLsizei n, const GLuint *framebuffers)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[897];
- ((void (APIENTRY *)(GLsizei n, const GLuint *framebuffers)) _func)(n, framebuffers);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(DeleteRenderbuffersEXT)(GLsizei n, const GLuint *renderbuffers)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[898];
- ((void (APIENTRY *)(GLsizei n, const GLuint *renderbuffers)) _func)(n, renderbuffers);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(DeleteRenderbuffers)(GLsizei n, const GLuint *renderbuffers)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[898];
- ((void (APIENTRY *)(GLsizei n, const GLuint *renderbuffers)) _func)(n, renderbuffers);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(FramebufferRenderbufferEXT)(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[899];
- ((void (APIENTRY *)(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer)) _func)(target, attachment, renderbuffertarget, renderbuffer);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(FramebufferRenderbuffer)(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[899];
- ((void (APIENTRY *)(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer)) _func)(target, attachment, renderbuffertarget, renderbuffer);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(FramebufferTexture1DEXT)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[900];
- ((void (APIENTRY *)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level)) _func)(target, attachment, textarget, texture, level);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(FramebufferTexture1D)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[900];
- ((void (APIENTRY *)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level)) _func)(target, attachment, textarget, texture, level);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(FramebufferTexture2DEXT)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[901];
- ((void (APIENTRY *)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level)) _func)(target, attachment, textarget, texture, level);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(FramebufferTexture2D)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[901];
- ((void (APIENTRY *)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level)) _func)(target, attachment, textarget, texture, level);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(FramebufferTexture3DEXT)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[902];
- ((void (APIENTRY *)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset)) _func)(target, attachment, textarget, texture, level, zoffset);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(FramebufferTexture3D)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[902];
- ((void (APIENTRY *)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset)) _func)(target, attachment, textarget, texture, level, zoffset);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(GenFramebuffersEXT)(GLsizei n, GLuint *framebuffers)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[903];
- ((void (APIENTRY *)(GLsizei n, GLuint *framebuffers)) _func)(n, framebuffers);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(GenFramebuffers)(GLsizei n, GLuint *framebuffers)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[903];
- ((void (APIENTRY *)(GLsizei n, GLuint *framebuffers)) _func)(n, framebuffers);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(GenRenderbuffersEXT)(GLsizei n, GLuint *renderbuffers)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[904];
- ((void (APIENTRY *)(GLsizei n, GLuint *renderbuffers)) _func)(n, renderbuffers);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(GenRenderbuffers)(GLsizei n, GLuint *renderbuffers)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[904];
- ((void (APIENTRY *)(GLsizei n, GLuint *renderbuffers)) _func)(n, renderbuffers);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(GenerateMipmapEXT)(GLenum target)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[905];
- ((void (APIENTRY *)(GLenum target)) _func)(target);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(GenerateMipmap)(GLenum target)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[905];
- ((void (APIENTRY *)(GLenum target)) _func)(target);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(GetFramebufferAttachmentParameterivEXT)(GLenum target, GLenum attachment, GLenum pname, GLint *params)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[906];
- ((void (APIENTRY *)(GLenum target, GLenum attachment, GLenum pname, GLint *params)) _func)(target, attachment, pname, params);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(GetFramebufferAttachmentParameteriv)(GLenum target, GLenum attachment, GLenum pname, GLint *params)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[906];
- ((void (APIENTRY *)(GLenum target, GLenum attachment, GLenum pname, GLint *params)) _func)(target, attachment, pname, params);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(GetRenderbufferParameterivEXT)(GLenum target, GLenum pname, GLint *params)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[907];
- ((void (APIENTRY *)(GLenum target, GLenum pname, GLint *params)) _func)(target, pname, params);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(GetRenderbufferParameteriv)(GLenum target, GLenum pname, GLint *params)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[907];
- ((void (APIENTRY *)(GLenum target, GLenum pname, GLint *params)) _func)(target, pname, params);
-}
-
-GLAPI GLboolean APIENTRY GLAPI_PREFIX(IsFramebufferEXT)(GLuint framebuffer)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[908];
- return ((GLboolean (APIENTRY *)(GLuint framebuffer)) _func)(framebuffer);
-}
-
-GLAPI GLboolean APIENTRY GLAPI_PREFIX(IsFramebuffer)(GLuint framebuffer)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[908];
- return ((GLboolean (APIENTRY *)(GLuint framebuffer)) _func)(framebuffer);
-}
-
-GLAPI GLboolean APIENTRY GLAPI_PREFIX(IsRenderbufferEXT)(GLuint renderbuffer)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[909];
- return ((GLboolean (APIENTRY *)(GLuint renderbuffer)) _func)(renderbuffer);
-}
-
-GLAPI GLboolean APIENTRY GLAPI_PREFIX(IsRenderbuffer)(GLuint renderbuffer)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[909];
- return ((GLboolean (APIENTRY *)(GLuint renderbuffer)) _func)(renderbuffer);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(RenderbufferStorageEXT)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[910];
- ((void (APIENTRY *)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height)) _func)(target, internalformat, width, height);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(RenderbufferStorage)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[910];
- ((void (APIENTRY *)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height)) _func)(target, internalformat, width, height);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(BlitFramebuffer)(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[911];
- ((void (APIENTRY *)(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter)) _func)(srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(BindFragDataLocationEXT)(GLuint program, GLuint colorNumber, const GLchar *name)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[914];
- ((void (APIENTRY *)(GLuint program, GLuint colorNumber, const GLchar *name)) _func)(program, colorNumber, name);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(BindFragDataLocation)(GLuint program, GLuint colorNumber, const GLchar *name)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[914];
- ((void (APIENTRY *)(GLuint program, GLuint colorNumber, const GLchar *name)) _func)(program, colorNumber, name);
-}
-
-GLAPI GLint APIENTRY GLAPI_PREFIX(GetFragDataLocationEXT)(GLuint program, const GLchar *name)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[915];
- return ((GLint (APIENTRY *)(GLuint program, const GLchar *name)) _func)(program, name);
-}
-
-GLAPI GLint APIENTRY GLAPI_PREFIX(GetFragDataLocation)(GLuint program, const GLchar *name)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[915];
- return ((GLint (APIENTRY *)(GLuint program, const GLchar *name)) _func)(program, name);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(GetUniformuivEXT)(GLuint program, GLint location, GLuint *params)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[916];
- ((void (APIENTRY *)(GLuint program, GLint location, GLuint *params)) _func)(program, location, params);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(GetUniformuiv)(GLuint program, GLint location, GLuint *params)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[916];
- ((void (APIENTRY *)(GLuint program, GLint location, GLuint *params)) _func)(program, location, params);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(GetVertexAttribIivEXT)(GLuint index, GLenum pname, GLint *params)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[917];
- ((void (APIENTRY *)(GLuint index, GLenum pname, GLint *params)) _func)(index, pname, params);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(GetVertexAttribIiv)(GLuint index, GLenum pname, GLint *params)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[917];
- ((void (APIENTRY *)(GLuint index, GLenum pname, GLint *params)) _func)(index, pname, params);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(GetVertexAttribIuivEXT)(GLuint index, GLenum pname, GLuint *params)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[918];
- ((void (APIENTRY *)(GLuint index, GLenum pname, GLuint *params)) _func)(index, pname, params);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(GetVertexAttribIuiv)(GLuint index, GLenum pname, GLuint *params)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[918];
- ((void (APIENTRY *)(GLuint index, GLenum pname, GLuint *params)) _func)(index, pname, params);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(Uniform1uiEXT)(GLint location, GLuint x)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[919];
- ((void (APIENTRY *)(GLint location, GLuint x)) _func)(location, x);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(Uniform1ui)(GLint location, GLuint x)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[919];
- ((void (APIENTRY *)(GLint location, GLuint x)) _func)(location, x);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(Uniform1uivEXT)(GLint location, GLsizei count, const GLuint *value)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[920];
- ((void (APIENTRY *)(GLint location, GLsizei count, const GLuint *value)) _func)(location, count, value);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(Uniform1uiv)(GLint location, GLsizei count, const GLuint *value)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[920];
- ((void (APIENTRY *)(GLint location, GLsizei count, const GLuint *value)) _func)(location, count, value);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(Uniform2uiEXT)(GLint location, GLuint x, GLuint y)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[921];
- ((void (APIENTRY *)(GLint location, GLuint x, GLuint y)) _func)(location, x, y);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(Uniform2ui)(GLint location, GLuint x, GLuint y)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[921];
- ((void (APIENTRY *)(GLint location, GLuint x, GLuint y)) _func)(location, x, y);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(Uniform2uivEXT)(GLint location, GLsizei count, const GLuint *value)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[922];
- ((void (APIENTRY *)(GLint location, GLsizei count, const GLuint *value)) _func)(location, count, value);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(Uniform2uiv)(GLint location, GLsizei count, const GLuint *value)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[922];
- ((void (APIENTRY *)(GLint location, GLsizei count, const GLuint *value)) _func)(location, count, value);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(Uniform3uiEXT)(GLint location, GLuint x, GLuint y, GLuint z)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[923];
- ((void (APIENTRY *)(GLint location, GLuint x, GLuint y, GLuint z)) _func)(location, x, y, z);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(Uniform3ui)(GLint location, GLuint x, GLuint y, GLuint z)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[923];
- ((void (APIENTRY *)(GLint location, GLuint x, GLuint y, GLuint z)) _func)(location, x, y, z);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(Uniform3uivEXT)(GLint location, GLsizei count, const GLuint *value)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[924];
- ((void (APIENTRY *)(GLint location, GLsizei count, const GLuint *value)) _func)(location, count, value);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(Uniform3uiv)(GLint location, GLsizei count, const GLuint *value)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[924];
- ((void (APIENTRY *)(GLint location, GLsizei count, const GLuint *value)) _func)(location, count, value);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(Uniform4uiEXT)(GLint location, GLuint x, GLuint y, GLuint z, GLuint w)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[925];
- ((void (APIENTRY *)(GLint location, GLuint x, GLuint y, GLuint z, GLuint w)) _func)(location, x, y, z, w);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(Uniform4ui)(GLint location, GLuint x, GLuint y, GLuint z, GLuint w)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[925];
- ((void (APIENTRY *)(GLint location, GLuint x, GLuint y, GLuint z, GLuint w)) _func)(location, x, y, z, w);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(Uniform4uivEXT)(GLint location, GLsizei count, const GLuint *value)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[926];
- ((void (APIENTRY *)(GLint location, GLsizei count, const GLuint *value)) _func)(location, count, value);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(Uniform4uiv)(GLint location, GLsizei count, const GLuint *value)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[926];
- ((void (APIENTRY *)(GLint location, GLsizei count, const GLuint *value)) _func)(location, count, value);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribI1iEXT)(GLuint index, GLint x)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[927];
- ((void (APIENTRY *)(GLuint index, GLint x)) _func)(index, x);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribI1i)(GLuint index, GLint x)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[927];
- ((void (APIENTRY *)(GLuint index, GLint x)) _func)(index, x);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribI1ivEXT)(GLuint index, const GLint *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[928];
- ((void (APIENTRY *)(GLuint index, const GLint *v)) _func)(index, v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribI1iv)(GLuint index, const GLint *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[928];
- ((void (APIENTRY *)(GLuint index, const GLint *v)) _func)(index, v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribI1uiEXT)(GLuint index, GLuint x)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[929];
- ((void (APIENTRY *)(GLuint index, GLuint x)) _func)(index, x);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribI1ui)(GLuint index, GLuint x)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[929];
- ((void (APIENTRY *)(GLuint index, GLuint x)) _func)(index, x);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribI1uivEXT)(GLuint index, const GLuint *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[930];
- ((void (APIENTRY *)(GLuint index, const GLuint *v)) _func)(index, v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribI1uiv)(GLuint index, const GLuint *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[930];
- ((void (APIENTRY *)(GLuint index, const GLuint *v)) _func)(index, v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribI2iEXT)(GLuint index, GLint x, GLint y)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[931];
- ((void (APIENTRY *)(GLuint index, GLint x, GLint y)) _func)(index, x, y);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribI2i)(GLuint index, GLint x, GLint y)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[931];
- ((void (APIENTRY *)(GLuint index, GLint x, GLint y)) _func)(index, x, y);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribI2ivEXT)(GLuint index, const GLint *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[932];
- ((void (APIENTRY *)(GLuint index, const GLint *v)) _func)(index, v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribI2iv)(GLuint index, const GLint *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[932];
- ((void (APIENTRY *)(GLuint index, const GLint *v)) _func)(index, v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribI2uiEXT)(GLuint index, GLuint x, GLuint y)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[933];
- ((void (APIENTRY *)(GLuint index, GLuint x, GLuint y)) _func)(index, x, y);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribI2ui)(GLuint index, GLuint x, GLuint y)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[933];
- ((void (APIENTRY *)(GLuint index, GLuint x, GLuint y)) _func)(index, x, y);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribI2uivEXT)(GLuint index, const GLuint *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[934];
- ((void (APIENTRY *)(GLuint index, const GLuint *v)) _func)(index, v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribI2uiv)(GLuint index, const GLuint *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[934];
- ((void (APIENTRY *)(GLuint index, const GLuint *v)) _func)(index, v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribI3iEXT)(GLuint index, GLint x, GLint y, GLint z)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[935];
- ((void (APIENTRY *)(GLuint index, GLint x, GLint y, GLint z)) _func)(index, x, y, z);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribI3i)(GLuint index, GLint x, GLint y, GLint z)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[935];
- ((void (APIENTRY *)(GLuint index, GLint x, GLint y, GLint z)) _func)(index, x, y, z);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribI3ivEXT)(GLuint index, const GLint *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[936];
- ((void (APIENTRY *)(GLuint index, const GLint *v)) _func)(index, v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribI3iv)(GLuint index, const GLint *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[936];
- ((void (APIENTRY *)(GLuint index, const GLint *v)) _func)(index, v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribI3uiEXT)(GLuint index, GLuint x, GLuint y, GLuint z)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[937];
- ((void (APIENTRY *)(GLuint index, GLuint x, GLuint y, GLuint z)) _func)(index, x, y, z);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribI3ui)(GLuint index, GLuint x, GLuint y, GLuint z)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[937];
- ((void (APIENTRY *)(GLuint index, GLuint x, GLuint y, GLuint z)) _func)(index, x, y, z);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribI3uivEXT)(GLuint index, const GLuint *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[938];
- ((void (APIENTRY *)(GLuint index, const GLuint *v)) _func)(index, v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribI3uiv)(GLuint index, const GLuint *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[938];
- ((void (APIENTRY *)(GLuint index, const GLuint *v)) _func)(index, v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribI4bvEXT)(GLuint index, const GLbyte *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[939];
- ((void (APIENTRY *)(GLuint index, const GLbyte *v)) _func)(index, v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribI4bv)(GLuint index, const GLbyte *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[939];
- ((void (APIENTRY *)(GLuint index, const GLbyte *v)) _func)(index, v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribI4iEXT)(GLuint index, GLint x, GLint y, GLint z, GLint w)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[940];
- ((void (APIENTRY *)(GLuint index, GLint x, GLint y, GLint z, GLint w)) _func)(index, x, y, z, w);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribI4i)(GLuint index, GLint x, GLint y, GLint z, GLint w)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[940];
- ((void (APIENTRY *)(GLuint index, GLint x, GLint y, GLint z, GLint w)) _func)(index, x, y, z, w);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribI4ivEXT)(GLuint index, const GLint *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[941];
- ((void (APIENTRY *)(GLuint index, const GLint *v)) _func)(index, v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribI4iv)(GLuint index, const GLint *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[941];
- ((void (APIENTRY *)(GLuint index, const GLint *v)) _func)(index, v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribI4svEXT)(GLuint index, const GLshort *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[942];
- ((void (APIENTRY *)(GLuint index, const GLshort *v)) _func)(index, v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribI4sv)(GLuint index, const GLshort *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[942];
- ((void (APIENTRY *)(GLuint index, const GLshort *v)) _func)(index, v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribI4ubvEXT)(GLuint index, const GLubyte *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[943];
- ((void (APIENTRY *)(GLuint index, const GLubyte *v)) _func)(index, v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribI4ubv)(GLuint index, const GLubyte *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[943];
- ((void (APIENTRY *)(GLuint index, const GLubyte *v)) _func)(index, v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribI4uiEXT)(GLuint index, GLuint x, GLuint y, GLuint z, GLuint w)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[944];
- ((void (APIENTRY *)(GLuint index, GLuint x, GLuint y, GLuint z, GLuint w)) _func)(index, x, y, z, w);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribI4ui)(GLuint index, GLuint x, GLuint y, GLuint z, GLuint w)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[944];
- ((void (APIENTRY *)(GLuint index, GLuint x, GLuint y, GLuint z, GLuint w)) _func)(index, x, y, z, w);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribI4uivEXT)(GLuint index, const GLuint *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[945];
- ((void (APIENTRY *)(GLuint index, const GLuint *v)) _func)(index, v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribI4uiv)(GLuint index, const GLuint *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[945];
- ((void (APIENTRY *)(GLuint index, const GLuint *v)) _func)(index, v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribI4usvEXT)(GLuint index, const GLushort *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[946];
- ((void (APIENTRY *)(GLuint index, const GLushort *v)) _func)(index, v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribI4usv)(GLuint index, const GLushort *v)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[946];
- ((void (APIENTRY *)(GLuint index, const GLushort *v)) _func)(index, v);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribIPointerEXT)(GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[947];
- ((void (APIENTRY *)(GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer)) _func)(index, size, type, stride, pointer);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribIPointer)(GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[947];
- ((void (APIENTRY *)(GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer)) _func)(index, size, type, stride, pointer);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(FramebufferTextureLayerEXT)(GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[948];
- ((void (APIENTRY *)(GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer)) _func)(target, attachment, texture, level, layer);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(FramebufferTextureLayer)(GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[948];
- ((void (APIENTRY *)(GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer)) _func)(target, attachment, texture, level, layer);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(ColorMaskIndexedEXT)(GLuint buf, GLboolean r, GLboolean g, GLboolean b, GLboolean a)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[949];
- ((void (APIENTRY *)(GLuint buf, GLboolean r, GLboolean g, GLboolean b, GLboolean a)) _func)(buf, r, g, b, a);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(ColorMaski)(GLuint buf, GLboolean r, GLboolean g, GLboolean b, GLboolean a)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[949];
- ((void (APIENTRY *)(GLuint buf, GLboolean r, GLboolean g, GLboolean b, GLboolean a)) _func)(buf, r, g, b, a);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(DisableIndexedEXT)(GLenum target, GLuint index)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[950];
- ((void (APIENTRY *)(GLenum target, GLuint index)) _func)(target, index);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(Disablei)(GLenum target, GLuint index)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[950];
- ((void (APIENTRY *)(GLenum target, GLuint index)) _func)(target, index);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(EnableIndexedEXT)(GLenum target, GLuint index)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[951];
- ((void (APIENTRY *)(GLenum target, GLuint index)) _func)(target, index);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(Enablei)(GLenum target, GLuint index)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[951];
- ((void (APIENTRY *)(GLenum target, GLuint index)) _func)(target, index);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(GetBooleanIndexedvEXT)(GLenum value, GLuint index, GLboolean *data)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[952];
- ((void (APIENTRY *)(GLenum value, GLuint index, GLboolean *data)) _func)(value, index, data);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(GetBooleani_v)(GLenum value, GLuint index, GLboolean *data)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[952];
- ((void (APIENTRY *)(GLenum value, GLuint index, GLboolean *data)) _func)(value, index, data);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(GetIntegerIndexedvEXT)(GLenum value, GLuint index, GLint *data)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[953];
- ((void (APIENTRY *)(GLenum value, GLuint index, GLint *data)) _func)(value, index, data);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(GetIntegeri_v)(GLenum value, GLuint index, GLint *data)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[953];
- ((void (APIENTRY *)(GLenum value, GLuint index, GLint *data)) _func)(value, index, data);
-}
-
-GLAPI GLboolean APIENTRY GLAPI_PREFIX(IsEnabledIndexedEXT)(GLenum target, GLuint index)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[954];
- return ((GLboolean (APIENTRY *)(GLenum target, GLuint index)) _func)(target, index);
-}
-
-GLAPI GLboolean APIENTRY GLAPI_PREFIX(IsEnabledi)(GLenum target, GLuint index)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[954];
- return ((GLboolean (APIENTRY *)(GLenum target, GLuint index)) _func)(target, index);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(ClearColorIiEXT)(GLint r, GLint g, GLint b, GLint a)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[955];
- ((void (APIENTRY *)(GLint r, GLint g, GLint b, GLint a)) _func)(r, g, b, a);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(ClearColorIuiEXT)(GLuint r, GLuint g, GLuint b, GLuint a)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[956];
- ((void (APIENTRY *)(GLuint r, GLuint g, GLuint b, GLuint a)) _func)(r, g, b, a);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(GetTexParameterIivEXT)(GLenum target, GLenum pname, GLint *params)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[957];
- ((void (APIENTRY *)(GLenum target, GLenum pname, GLint *params)) _func)(target, pname, params);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(GetTexParameterIiv)(GLenum target, GLenum pname, GLint *params)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[957];
- ((void (APIENTRY *)(GLenum target, GLenum pname, GLint *params)) _func)(target, pname, params);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(GetTexParameterIuivEXT)(GLenum target, GLenum pname, GLuint *params)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[958];
- ((void (APIENTRY *)(GLenum target, GLenum pname, GLuint *params)) _func)(target, pname, params);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(GetTexParameterIuiv)(GLenum target, GLenum pname, GLuint *params)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[958];
- ((void (APIENTRY *)(GLenum target, GLenum pname, GLuint *params)) _func)(target, pname, params);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(TexParameterIivEXT)(GLenum target, GLenum pname, const GLint *params)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[959];
- ((void (APIENTRY *)(GLenum target, GLenum pname, const GLint *params)) _func)(target, pname, params);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(TexParameterIiv)(GLenum target, GLenum pname, const GLint *params)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[959];
- ((void (APIENTRY *)(GLenum target, GLenum pname, const GLint *params)) _func)(target, pname, params);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(TexParameterIuivEXT)(GLenum target, GLenum pname, const GLuint *params)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[960];
- ((void (APIENTRY *)(GLenum target, GLenum pname, const GLuint *params)) _func)(target, pname, params);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(TexParameterIuiv)(GLenum target, GLenum pname, const GLuint *params)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[960];
- ((void (APIENTRY *)(GLenum target, GLenum pname, const GLuint *params)) _func)(target, pname, params);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(BeginConditionalRenderNV)(GLuint query, GLenum mode)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[961];
- ((void (APIENTRY *)(GLuint query, GLenum mode)) _func)(query, mode);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(BeginConditionalRender)(GLuint query, GLenum mode)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[961];
- ((void (APIENTRY *)(GLuint query, GLenum mode)) _func)(query, mode);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(EndConditionalRenderNV)(void)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[962];
- ((void (APIENTRY *)(void)) _func)();
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(EndConditionalRender)(void)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[962];
- ((void (APIENTRY *)(void)) _func)();
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(BeginTransformFeedbackEXT)(GLenum mode)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[963];
- ((void (APIENTRY *)(GLenum mode)) _func)(mode);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(BeginTransformFeedback)(GLenum mode)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[963];
- ((void (APIENTRY *)(GLenum mode)) _func)(mode);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(BindBufferBaseEXT)(GLenum target, GLuint index, GLuint buffer)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[964];
- ((void (APIENTRY *)(GLenum target, GLuint index, GLuint buffer)) _func)(target, index, buffer);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(BindBufferBase)(GLenum target, GLuint index, GLuint buffer)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[964];
- ((void (APIENTRY *)(GLenum target, GLuint index, GLuint buffer)) _func)(target, index, buffer);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(BindBufferOffsetEXT)(GLenum target, GLuint index, GLuint buffer, GLintptr offset)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[965];
- ((void (APIENTRY *)(GLenum target, GLuint index, GLuint buffer, GLintptr offset)) _func)(target, index, buffer, offset);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(BindBufferRangeEXT)(GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[966];
- ((void (APIENTRY *)(GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size)) _func)(target, index, buffer, offset, size);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(BindBufferRange)(GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[966];
- ((void (APIENTRY *)(GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size)) _func)(target, index, buffer, offset, size);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(EndTransformFeedbackEXT)(void)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[967];
- ((void (APIENTRY *)(void)) _func)();
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(EndTransformFeedback)(void)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[967];
- ((void (APIENTRY *)(void)) _func)();
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(GetTransformFeedbackVaryingEXT)(GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[968];
- ((void (APIENTRY *)(GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name)) _func)(program, index, bufSize, length, size, type, name);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(GetTransformFeedbackVarying)(GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[968];
- ((void (APIENTRY *)(GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name)) _func)(program, index, bufSize, length, size, type, name);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(TransformFeedbackVaryingsEXT)(GLuint program, GLsizei count, const char **varyings, GLenum bufferMode)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[969];
- ((void (APIENTRY *)(GLuint program, GLsizei count, const char **varyings, GLenum bufferMode)) _func)(program, count, varyings, bufferMode);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(TransformFeedbackVaryings)(GLuint program, GLsizei count, const GLchar* *varyings, GLenum bufferMode)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[969];
- ((void (APIENTRY *)(GLuint program, GLsizei count, const GLchar* *varyings, GLenum bufferMode)) _func)(program, count, varyings, bufferMode);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(ProvokingVertexEXT)(GLenum mode)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[970];
- ((void (APIENTRY *)(GLenum mode)) _func)(mode);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(ProvokingVertex)(GLenum mode)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[970];
- ((void (APIENTRY *)(GLenum mode)) _func)(mode);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(GetObjectParameterivAPPLE)(GLenum objectType, GLuint name, GLenum pname, GLint *value)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[973];
- ((void (APIENTRY *)(GLenum objectType, GLuint name, GLenum pname, GLint *value)) _func)(objectType, name, pname, value);
-}
-
-GLAPI GLenum APIENTRY GLAPI_PREFIX(ObjectPurgeableAPPLE)(GLenum objectType, GLuint name, GLenum option)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[974];
- return ((GLenum (APIENTRY *)(GLenum objectType, GLuint name, GLenum option)) _func)(objectType, name, option);
-}
-
-GLAPI GLenum APIENTRY GLAPI_PREFIX(ObjectUnpurgeableAPPLE)(GLenum objectType, GLuint name, GLenum option)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[975];
- return ((GLenum (APIENTRY *)(GLenum objectType, GLuint name, GLenum option)) _func)(objectType, name, option);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(ActiveProgramEXT)(GLuint program)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[976];
- ((void (APIENTRY *)(GLuint program)) _func)(program);
-}
-
-GLAPI GLuint APIENTRY GLAPI_PREFIX(CreateShaderProgramEXT)(GLenum type, const GLchar *string)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[977];
- return ((GLuint (APIENTRY *)(GLenum type, const GLchar *string)) _func)(type, string);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(UseShaderProgramEXT)(GLenum type, GLuint program)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[978];
- ((void (APIENTRY *)(GLenum type, GLuint program)) _func)(type, program);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(TextureBarrierNV)(void)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[979];
- ((void (APIENTRY *)(void)) _func)();
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(EGLImageTargetRenderbufferStorageOES)(GLenum target, GLvoid *writeOffset)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[985];
- ((void (APIENTRY *)(GLenum target, GLvoid *writeOffset)) _func)(target, writeOffset);
-}
-
-GLAPI void APIENTRY GLAPI_PREFIX(EGLImageTargetTexture2DOES)(GLenum target, GLvoid *writeOffset)
-{
- const struct mapi_table *_tbl = entry_current_get();
- mapi_func _func = ((const mapi_func *) _tbl)[986];
- ((void (APIENTRY *)(GLenum target, GLvoid *writeOffset)) _func)(target, writeOffset);
-}
-
-/* does not need public_entries */
-#undef MAPI_TMP_PUBLIC_ENTRIES_NO_HIDDEN
-#endif /* MAPI_TMP_PUBLIC_ENTRIES_NO_HIDDEN */
-
-#ifdef MAPI_TMP_STUB_ASM_GCC_NO_HIDDEN
-__asm__(
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(NewList))"\n"
-"\t"STUB_ASM_CODE("0")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(EndList))"\n"
-"\t"STUB_ASM_CODE("1")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(CallList))"\n"
-"\t"STUB_ASM_CODE("2")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(CallLists))"\n"
-"\t"STUB_ASM_CODE("3")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(DeleteLists))"\n"
-"\t"STUB_ASM_CODE("4")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GenLists))"\n"
-"\t"STUB_ASM_CODE("5")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(ListBase))"\n"
-"\t"STUB_ASM_CODE("6")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Begin))"\n"
-"\t"STUB_ASM_CODE("7")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Bitmap))"\n"
-"\t"STUB_ASM_CODE("8")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Color3b))"\n"
-"\t"STUB_ASM_CODE("9")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Color3bv))"\n"
-"\t"STUB_ASM_CODE("10")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Color3d))"\n"
-"\t"STUB_ASM_CODE("11")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Color3dv))"\n"
-"\t"STUB_ASM_CODE("12")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Color3f))"\n"
-"\t"STUB_ASM_CODE("13")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Color3fv))"\n"
-"\t"STUB_ASM_CODE("14")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Color3i))"\n"
-"\t"STUB_ASM_CODE("15")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Color3iv))"\n"
-"\t"STUB_ASM_CODE("16")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Color3s))"\n"
-"\t"STUB_ASM_CODE("17")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Color3sv))"\n"
-"\t"STUB_ASM_CODE("18")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Color3ub))"\n"
-"\t"STUB_ASM_CODE("19")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Color3ubv))"\n"
-"\t"STUB_ASM_CODE("20")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Color3ui))"\n"
-"\t"STUB_ASM_CODE("21")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Color3uiv))"\n"
-"\t"STUB_ASM_CODE("22")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Color3us))"\n"
-"\t"STUB_ASM_CODE("23")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Color3usv))"\n"
-"\t"STUB_ASM_CODE("24")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Color4b))"\n"
-"\t"STUB_ASM_CODE("25")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Color4bv))"\n"
-"\t"STUB_ASM_CODE("26")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Color4d))"\n"
-"\t"STUB_ASM_CODE("27")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Color4dv))"\n"
-"\t"STUB_ASM_CODE("28")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Color4f))"\n"
-"\t"STUB_ASM_CODE("29")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Color4fv))"\n"
-"\t"STUB_ASM_CODE("30")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Color4i))"\n"
-"\t"STUB_ASM_CODE("31")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Color4iv))"\n"
-"\t"STUB_ASM_CODE("32")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Color4s))"\n"
-"\t"STUB_ASM_CODE("33")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Color4sv))"\n"
-"\t"STUB_ASM_CODE("34")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Color4ub))"\n"
-"\t"STUB_ASM_CODE("35")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Color4ubv))"\n"
-"\t"STUB_ASM_CODE("36")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Color4ui))"\n"
-"\t"STUB_ASM_CODE("37")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Color4uiv))"\n"
-"\t"STUB_ASM_CODE("38")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Color4us))"\n"
-"\t"STUB_ASM_CODE("39")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Color4usv))"\n"
-"\t"STUB_ASM_CODE("40")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(EdgeFlag))"\n"
-"\t"STUB_ASM_CODE("41")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(EdgeFlagv))"\n"
-"\t"STUB_ASM_CODE("42")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(End))"\n"
-"\t"STUB_ASM_CODE("43")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Indexd))"\n"
-"\t"STUB_ASM_CODE("44")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Indexdv))"\n"
-"\t"STUB_ASM_CODE("45")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Indexf))"\n"
-"\t"STUB_ASM_CODE("46")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Indexfv))"\n"
-"\t"STUB_ASM_CODE("47")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Indexi))"\n"
-"\t"STUB_ASM_CODE("48")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Indexiv))"\n"
-"\t"STUB_ASM_CODE("49")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Indexs))"\n"
-"\t"STUB_ASM_CODE("50")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Indexsv))"\n"
-"\t"STUB_ASM_CODE("51")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Normal3b))"\n"
-"\t"STUB_ASM_CODE("52")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Normal3bv))"\n"
-"\t"STUB_ASM_CODE("53")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Normal3d))"\n"
-"\t"STUB_ASM_CODE("54")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Normal3dv))"\n"
-"\t"STUB_ASM_CODE("55")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Normal3f))"\n"
-"\t"STUB_ASM_CODE("56")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Normal3fv))"\n"
-"\t"STUB_ASM_CODE("57")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Normal3i))"\n"
-"\t"STUB_ASM_CODE("58")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Normal3iv))"\n"
-"\t"STUB_ASM_CODE("59")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Normal3s))"\n"
-"\t"STUB_ASM_CODE("60")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Normal3sv))"\n"
-"\t"STUB_ASM_CODE("61")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(RasterPos2d))"\n"
-"\t"STUB_ASM_CODE("62")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(RasterPos2dv))"\n"
-"\t"STUB_ASM_CODE("63")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(RasterPos2f))"\n"
-"\t"STUB_ASM_CODE("64")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(RasterPos2fv))"\n"
-"\t"STUB_ASM_CODE("65")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(RasterPos2i))"\n"
-"\t"STUB_ASM_CODE("66")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(RasterPos2iv))"\n"
-"\t"STUB_ASM_CODE("67")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(RasterPos2s))"\n"
-"\t"STUB_ASM_CODE("68")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(RasterPos2sv))"\n"
-"\t"STUB_ASM_CODE("69")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(RasterPos3d))"\n"
-"\t"STUB_ASM_CODE("70")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(RasterPos3dv))"\n"
-"\t"STUB_ASM_CODE("71")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(RasterPos3f))"\n"
-"\t"STUB_ASM_CODE("72")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(RasterPos3fv))"\n"
-"\t"STUB_ASM_CODE("73")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(RasterPos3i))"\n"
-"\t"STUB_ASM_CODE("74")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(RasterPos3iv))"\n"
-"\t"STUB_ASM_CODE("75")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(RasterPos3s))"\n"
-"\t"STUB_ASM_CODE("76")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(RasterPos3sv))"\n"
-"\t"STUB_ASM_CODE("77")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(RasterPos4d))"\n"
-"\t"STUB_ASM_CODE("78")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(RasterPos4dv))"\n"
-"\t"STUB_ASM_CODE("79")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(RasterPos4f))"\n"
-"\t"STUB_ASM_CODE("80")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(RasterPos4fv))"\n"
-"\t"STUB_ASM_CODE("81")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(RasterPos4i))"\n"
-"\t"STUB_ASM_CODE("82")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(RasterPos4iv))"\n"
-"\t"STUB_ASM_CODE("83")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(RasterPos4s))"\n"
-"\t"STUB_ASM_CODE("84")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(RasterPos4sv))"\n"
-"\t"STUB_ASM_CODE("85")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Rectd))"\n"
-"\t"STUB_ASM_CODE("86")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Rectdv))"\n"
-"\t"STUB_ASM_CODE("87")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Rectf))"\n"
-"\t"STUB_ASM_CODE("88")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Rectfv))"\n"
-"\t"STUB_ASM_CODE("89")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Recti))"\n"
-"\t"STUB_ASM_CODE("90")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Rectiv))"\n"
-"\t"STUB_ASM_CODE("91")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Rects))"\n"
-"\t"STUB_ASM_CODE("92")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Rectsv))"\n"
-"\t"STUB_ASM_CODE("93")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(TexCoord1d))"\n"
-"\t"STUB_ASM_CODE("94")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(TexCoord1dv))"\n"
-"\t"STUB_ASM_CODE("95")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(TexCoord1f))"\n"
-"\t"STUB_ASM_CODE("96")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(TexCoord1fv))"\n"
-"\t"STUB_ASM_CODE("97")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(TexCoord1i))"\n"
-"\t"STUB_ASM_CODE("98")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(TexCoord1iv))"\n"
-"\t"STUB_ASM_CODE("99")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(TexCoord1s))"\n"
-"\t"STUB_ASM_CODE("100")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(TexCoord1sv))"\n"
-"\t"STUB_ASM_CODE("101")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(TexCoord2d))"\n"
-"\t"STUB_ASM_CODE("102")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(TexCoord2dv))"\n"
-"\t"STUB_ASM_CODE("103")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(TexCoord2f))"\n"
-"\t"STUB_ASM_CODE("104")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(TexCoord2fv))"\n"
-"\t"STUB_ASM_CODE("105")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(TexCoord2i))"\n"
-"\t"STUB_ASM_CODE("106")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(TexCoord2iv))"\n"
-"\t"STUB_ASM_CODE("107")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(TexCoord2s))"\n"
-"\t"STUB_ASM_CODE("108")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(TexCoord2sv))"\n"
-"\t"STUB_ASM_CODE("109")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(TexCoord3d))"\n"
-"\t"STUB_ASM_CODE("110")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(TexCoord3dv))"\n"
-"\t"STUB_ASM_CODE("111")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(TexCoord3f))"\n"
-"\t"STUB_ASM_CODE("112")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(TexCoord3fv))"\n"
-"\t"STUB_ASM_CODE("113")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(TexCoord3i))"\n"
-"\t"STUB_ASM_CODE("114")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(TexCoord3iv))"\n"
-"\t"STUB_ASM_CODE("115")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(TexCoord3s))"\n"
-"\t"STUB_ASM_CODE("116")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(TexCoord3sv))"\n"
-"\t"STUB_ASM_CODE("117")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(TexCoord4d))"\n"
-"\t"STUB_ASM_CODE("118")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(TexCoord4dv))"\n"
-"\t"STUB_ASM_CODE("119")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(TexCoord4f))"\n"
-"\t"STUB_ASM_CODE("120")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(TexCoord4fv))"\n"
-"\t"STUB_ASM_CODE("121")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(TexCoord4i))"\n"
-"\t"STUB_ASM_CODE("122")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(TexCoord4iv))"\n"
-"\t"STUB_ASM_CODE("123")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(TexCoord4s))"\n"
-"\t"STUB_ASM_CODE("124")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(TexCoord4sv))"\n"
-"\t"STUB_ASM_CODE("125")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Vertex2d))"\n"
-"\t"STUB_ASM_CODE("126")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Vertex2dv))"\n"
-"\t"STUB_ASM_CODE("127")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Vertex2f))"\n"
-"\t"STUB_ASM_CODE("128")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Vertex2fv))"\n"
-"\t"STUB_ASM_CODE("129")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Vertex2i))"\n"
-"\t"STUB_ASM_CODE("130")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Vertex2iv))"\n"
-"\t"STUB_ASM_CODE("131")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Vertex2s))"\n"
-"\t"STUB_ASM_CODE("132")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Vertex2sv))"\n"
-"\t"STUB_ASM_CODE("133")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Vertex3d))"\n"
-"\t"STUB_ASM_CODE("134")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Vertex3dv))"\n"
-"\t"STUB_ASM_CODE("135")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Vertex3f))"\n"
-"\t"STUB_ASM_CODE("136")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Vertex3fv))"\n"
-"\t"STUB_ASM_CODE("137")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Vertex3i))"\n"
-"\t"STUB_ASM_CODE("138")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Vertex3iv))"\n"
-"\t"STUB_ASM_CODE("139")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Vertex3s))"\n"
-"\t"STUB_ASM_CODE("140")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Vertex3sv))"\n"
-"\t"STUB_ASM_CODE("141")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Vertex4d))"\n"
-"\t"STUB_ASM_CODE("142")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Vertex4dv))"\n"
-"\t"STUB_ASM_CODE("143")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Vertex4f))"\n"
-"\t"STUB_ASM_CODE("144")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Vertex4fv))"\n"
-"\t"STUB_ASM_CODE("145")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Vertex4i))"\n"
-"\t"STUB_ASM_CODE("146")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Vertex4iv))"\n"
-"\t"STUB_ASM_CODE("147")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Vertex4s))"\n"
-"\t"STUB_ASM_CODE("148")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Vertex4sv))"\n"
-"\t"STUB_ASM_CODE("149")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(ClipPlane))"\n"
-"\t"STUB_ASM_CODE("150")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(ColorMaterial))"\n"
-"\t"STUB_ASM_CODE("151")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(CullFace))"\n"
-"\t"STUB_ASM_CODE("152")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Fogf))"\n"
-"\t"STUB_ASM_CODE("153")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Fogfv))"\n"
-"\t"STUB_ASM_CODE("154")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Fogi))"\n"
-"\t"STUB_ASM_CODE("155")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Fogiv))"\n"
-"\t"STUB_ASM_CODE("156")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(FrontFace))"\n"
-"\t"STUB_ASM_CODE("157")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Hint))"\n"
-"\t"STUB_ASM_CODE("158")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Lightf))"\n"
-"\t"STUB_ASM_CODE("159")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Lightfv))"\n"
-"\t"STUB_ASM_CODE("160")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Lighti))"\n"
-"\t"STUB_ASM_CODE("161")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Lightiv))"\n"
-"\t"STUB_ASM_CODE("162")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(LightModelf))"\n"
-"\t"STUB_ASM_CODE("163")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(LightModelfv))"\n"
-"\t"STUB_ASM_CODE("164")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(LightModeli))"\n"
-"\t"STUB_ASM_CODE("165")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(LightModeliv))"\n"
-"\t"STUB_ASM_CODE("166")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(LineStipple))"\n"
-"\t"STUB_ASM_CODE("167")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(LineWidth))"\n"
-"\t"STUB_ASM_CODE("168")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Materialf))"\n"
-"\t"STUB_ASM_CODE("169")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Materialfv))"\n"
-"\t"STUB_ASM_CODE("170")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Materiali))"\n"
-"\t"STUB_ASM_CODE("171")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Materialiv))"\n"
-"\t"STUB_ASM_CODE("172")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(PointSize))"\n"
-"\t"STUB_ASM_CODE("173")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(PolygonMode))"\n"
-"\t"STUB_ASM_CODE("174")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(PolygonStipple))"\n"
-"\t"STUB_ASM_CODE("175")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Scissor))"\n"
-"\t"STUB_ASM_CODE("176")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(ShadeModel))"\n"
-"\t"STUB_ASM_CODE("177")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(TexParameterf))"\n"
-"\t"STUB_ASM_CODE("178")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(TexParameterfv))"\n"
-"\t"STUB_ASM_CODE("179")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(TexParameteri))"\n"
-"\t"STUB_ASM_CODE("180")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(TexParameteriv))"\n"
-"\t"STUB_ASM_CODE("181")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(TexImage1D))"\n"
-"\t"STUB_ASM_CODE("182")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(TexImage2D))"\n"
-"\t"STUB_ASM_CODE("183")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(TexEnvf))"\n"
-"\t"STUB_ASM_CODE("184")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(TexEnvfv))"\n"
-"\t"STUB_ASM_CODE("185")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(TexEnvi))"\n"
-"\t"STUB_ASM_CODE("186")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(TexEnviv))"\n"
-"\t"STUB_ASM_CODE("187")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(TexGend))"\n"
-"\t"STUB_ASM_CODE("188")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(TexGendv))"\n"
-"\t"STUB_ASM_CODE("189")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(TexGenf))"\n"
-"\t"STUB_ASM_CODE("190")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(TexGenfv))"\n"
-"\t"STUB_ASM_CODE("191")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(TexGeni))"\n"
-"\t"STUB_ASM_CODE("192")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(TexGeniv))"\n"
-"\t"STUB_ASM_CODE("193")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(FeedbackBuffer))"\n"
-"\t"STUB_ASM_CODE("194")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(SelectBuffer))"\n"
-"\t"STUB_ASM_CODE("195")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(RenderMode))"\n"
-"\t"STUB_ASM_CODE("196")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(InitNames))"\n"
-"\t"STUB_ASM_CODE("197")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(LoadName))"\n"
-"\t"STUB_ASM_CODE("198")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(PassThrough))"\n"
-"\t"STUB_ASM_CODE("199")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(PopName))"\n"
-"\t"STUB_ASM_CODE("200")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(PushName))"\n"
-"\t"STUB_ASM_CODE("201")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(DrawBuffer))"\n"
-"\t"STUB_ASM_CODE("202")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Clear))"\n"
-"\t"STUB_ASM_CODE("203")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(ClearAccum))"\n"
-"\t"STUB_ASM_CODE("204")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(ClearIndex))"\n"
-"\t"STUB_ASM_CODE("205")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(ClearColor))"\n"
-"\t"STUB_ASM_CODE("206")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(ClearStencil))"\n"
-"\t"STUB_ASM_CODE("207")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(ClearDepth))"\n"
-"\t"STUB_ASM_CODE("208")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(StencilMask))"\n"
-"\t"STUB_ASM_CODE("209")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(ColorMask))"\n"
-"\t"STUB_ASM_CODE("210")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(DepthMask))"\n"
-"\t"STUB_ASM_CODE("211")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(IndexMask))"\n"
-"\t"STUB_ASM_CODE("212")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Accum))"\n"
-"\t"STUB_ASM_CODE("213")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Disable))"\n"
-"\t"STUB_ASM_CODE("214")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Enable))"\n"
-"\t"STUB_ASM_CODE("215")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Finish))"\n"
-"\t"STUB_ASM_CODE("216")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Flush))"\n"
-"\t"STUB_ASM_CODE("217")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(PopAttrib))"\n"
-"\t"STUB_ASM_CODE("218")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(PushAttrib))"\n"
-"\t"STUB_ASM_CODE("219")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Map1d))"\n"
-"\t"STUB_ASM_CODE("220")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Map1f))"\n"
-"\t"STUB_ASM_CODE("221")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Map2d))"\n"
-"\t"STUB_ASM_CODE("222")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Map2f))"\n"
-"\t"STUB_ASM_CODE("223")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(MapGrid1d))"\n"
-"\t"STUB_ASM_CODE("224")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(MapGrid1f))"\n"
-"\t"STUB_ASM_CODE("225")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(MapGrid2d))"\n"
-"\t"STUB_ASM_CODE("226")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(MapGrid2f))"\n"
-"\t"STUB_ASM_CODE("227")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(EvalCoord1d))"\n"
-"\t"STUB_ASM_CODE("228")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(EvalCoord1dv))"\n"
-"\t"STUB_ASM_CODE("229")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(EvalCoord1f))"\n"
-"\t"STUB_ASM_CODE("230")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(EvalCoord1fv))"\n"
-"\t"STUB_ASM_CODE("231")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(EvalCoord2d))"\n"
-"\t"STUB_ASM_CODE("232")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(EvalCoord2dv))"\n"
-"\t"STUB_ASM_CODE("233")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(EvalCoord2f))"\n"
-"\t"STUB_ASM_CODE("234")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(EvalCoord2fv))"\n"
-"\t"STUB_ASM_CODE("235")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(EvalMesh1))"\n"
-"\t"STUB_ASM_CODE("236")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(EvalPoint1))"\n"
-"\t"STUB_ASM_CODE("237")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(EvalMesh2))"\n"
-"\t"STUB_ASM_CODE("238")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(EvalPoint2))"\n"
-"\t"STUB_ASM_CODE("239")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(AlphaFunc))"\n"
-"\t"STUB_ASM_CODE("240")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(BlendFunc))"\n"
-"\t"STUB_ASM_CODE("241")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(LogicOp))"\n"
-"\t"STUB_ASM_CODE("242")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(StencilFunc))"\n"
-"\t"STUB_ASM_CODE("243")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(StencilOp))"\n"
-"\t"STUB_ASM_CODE("244")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(DepthFunc))"\n"
-"\t"STUB_ASM_CODE("245")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(PixelZoom))"\n"
-"\t"STUB_ASM_CODE("246")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(PixelTransferf))"\n"
-"\t"STUB_ASM_CODE("247")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(PixelTransferi))"\n"
-"\t"STUB_ASM_CODE("248")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(PixelStoref))"\n"
-"\t"STUB_ASM_CODE("249")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(PixelStorei))"\n"
-"\t"STUB_ASM_CODE("250")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(PixelMapfv))"\n"
-"\t"STUB_ASM_CODE("251")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(PixelMapuiv))"\n"
-"\t"STUB_ASM_CODE("252")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(PixelMapusv))"\n"
-"\t"STUB_ASM_CODE("253")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(ReadBuffer))"\n"
-"\t"STUB_ASM_CODE("254")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(CopyPixels))"\n"
-"\t"STUB_ASM_CODE("255")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(ReadPixels))"\n"
-"\t"STUB_ASM_CODE("256")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(DrawPixels))"\n"
-"\t"STUB_ASM_CODE("257")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetBooleanv))"\n"
-"\t"STUB_ASM_CODE("258")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetClipPlane))"\n"
-"\t"STUB_ASM_CODE("259")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetDoublev))"\n"
-"\t"STUB_ASM_CODE("260")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetError))"\n"
-"\t"STUB_ASM_CODE("261")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetFloatv))"\n"
-"\t"STUB_ASM_CODE("262")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetIntegerv))"\n"
-"\t"STUB_ASM_CODE("263")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetLightfv))"\n"
-"\t"STUB_ASM_CODE("264")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetLightiv))"\n"
-"\t"STUB_ASM_CODE("265")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetMapdv))"\n"
-"\t"STUB_ASM_CODE("266")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetMapfv))"\n"
-"\t"STUB_ASM_CODE("267")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetMapiv))"\n"
-"\t"STUB_ASM_CODE("268")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetMaterialfv))"\n"
-"\t"STUB_ASM_CODE("269")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetMaterialiv))"\n"
-"\t"STUB_ASM_CODE("270")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetPixelMapfv))"\n"
-"\t"STUB_ASM_CODE("271")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetPixelMapuiv))"\n"
-"\t"STUB_ASM_CODE("272")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetPixelMapusv))"\n"
-"\t"STUB_ASM_CODE("273")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetPolygonStipple))"\n"
-"\t"STUB_ASM_CODE("274")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetString))"\n"
-"\t"STUB_ASM_CODE("275")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetTexEnvfv))"\n"
-"\t"STUB_ASM_CODE("276")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetTexEnviv))"\n"
-"\t"STUB_ASM_CODE("277")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetTexGendv))"\n"
-"\t"STUB_ASM_CODE("278")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetTexGenfv))"\n"
-"\t"STUB_ASM_CODE("279")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetTexGeniv))"\n"
-"\t"STUB_ASM_CODE("280")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetTexImage))"\n"
-"\t"STUB_ASM_CODE("281")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetTexParameterfv))"\n"
-"\t"STUB_ASM_CODE("282")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetTexParameteriv))"\n"
-"\t"STUB_ASM_CODE("283")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetTexLevelParameterfv))"\n"
-"\t"STUB_ASM_CODE("284")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetTexLevelParameteriv))"\n"
-"\t"STUB_ASM_CODE("285")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(IsEnabled))"\n"
-"\t"STUB_ASM_CODE("286")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(IsList))"\n"
-"\t"STUB_ASM_CODE("287")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(DepthRange))"\n"
-"\t"STUB_ASM_CODE("288")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Frustum))"\n"
-"\t"STUB_ASM_CODE("289")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(LoadIdentity))"\n"
-"\t"STUB_ASM_CODE("290")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(LoadMatrixf))"\n"
-"\t"STUB_ASM_CODE("291")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(LoadMatrixd))"\n"
-"\t"STUB_ASM_CODE("292")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(MatrixMode))"\n"
-"\t"STUB_ASM_CODE("293")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(MultMatrixf))"\n"
-"\t"STUB_ASM_CODE("294")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(MultMatrixd))"\n"
-"\t"STUB_ASM_CODE("295")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Ortho))"\n"
-"\t"STUB_ASM_CODE("296")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(PopMatrix))"\n"
-"\t"STUB_ASM_CODE("297")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(PushMatrix))"\n"
-"\t"STUB_ASM_CODE("298")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Rotated))"\n"
-"\t"STUB_ASM_CODE("299")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Rotatef))"\n"
-"\t"STUB_ASM_CODE("300")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Scaled))"\n"
-"\t"STUB_ASM_CODE("301")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Scalef))"\n"
-"\t"STUB_ASM_CODE("302")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Translated))"\n"
-"\t"STUB_ASM_CODE("303")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Translatef))"\n"
-"\t"STUB_ASM_CODE("304")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Viewport))"\n"
-"\t"STUB_ASM_CODE("305")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(ArrayElement))"\n"
-"\t"STUB_ASM_CODE("306")"\n"
-
-".globl "GLAPI_PREFIX_STR(ArrayElementEXT)"\n"
-".set "GLAPI_PREFIX_STR(ArrayElementEXT)", "GLAPI_PREFIX_STR(ArrayElement)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(BindTexture))"\n"
-"\t"STUB_ASM_CODE("307")"\n"
-
-".globl "GLAPI_PREFIX_STR(BindTextureEXT)"\n"
-".set "GLAPI_PREFIX_STR(BindTextureEXT)", "GLAPI_PREFIX_STR(BindTexture)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(ColorPointer))"\n"
-"\t"STUB_ASM_CODE("308")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(DisableClientState))"\n"
-"\t"STUB_ASM_CODE("309")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(DrawArrays))"\n"
-"\t"STUB_ASM_CODE("310")"\n"
-
-".globl "GLAPI_PREFIX_STR(DrawArraysEXT)"\n"
-".set "GLAPI_PREFIX_STR(DrawArraysEXT)", "GLAPI_PREFIX_STR(DrawArrays)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(DrawElements))"\n"
-"\t"STUB_ASM_CODE("311")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(EdgeFlagPointer))"\n"
-"\t"STUB_ASM_CODE("312")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(EnableClientState))"\n"
-"\t"STUB_ASM_CODE("313")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(IndexPointer))"\n"
-"\t"STUB_ASM_CODE("314")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Indexub))"\n"
-"\t"STUB_ASM_CODE("315")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Indexubv))"\n"
-"\t"STUB_ASM_CODE("316")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(InterleavedArrays))"\n"
-"\t"STUB_ASM_CODE("317")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(NormalPointer))"\n"
-"\t"STUB_ASM_CODE("318")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(PolygonOffset))"\n"
-"\t"STUB_ASM_CODE("319")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(TexCoordPointer))"\n"
-"\t"STUB_ASM_CODE("320")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexPointer))"\n"
-"\t"STUB_ASM_CODE("321")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(AreTexturesResident))"\n"
-"\t"STUB_ASM_CODE("322")"\n"
-
-#if 0
-".globl "GLAPI_PREFIX_STR(AreTexturesResidentEXT)"\n"
-".set "GLAPI_PREFIX_STR(AreTexturesResidentEXT)", "GLAPI_PREFIX_STR(AreTexturesResident)"\n"
-#endif
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(CopyTexImage1D))"\n"
-"\t"STUB_ASM_CODE("323")"\n"
-
-".globl "GLAPI_PREFIX_STR(CopyTexImage1DEXT)"\n"
-".set "GLAPI_PREFIX_STR(CopyTexImage1DEXT)", "GLAPI_PREFIX_STR(CopyTexImage1D)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(CopyTexImage2D))"\n"
-"\t"STUB_ASM_CODE("324")"\n"
-
-".globl "GLAPI_PREFIX_STR(CopyTexImage2DEXT)"\n"
-".set "GLAPI_PREFIX_STR(CopyTexImage2DEXT)", "GLAPI_PREFIX_STR(CopyTexImage2D)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(CopyTexSubImage1D))"\n"
-"\t"STUB_ASM_CODE("325")"\n"
-
-".globl "GLAPI_PREFIX_STR(CopyTexSubImage1DEXT)"\n"
-".set "GLAPI_PREFIX_STR(CopyTexSubImage1DEXT)", "GLAPI_PREFIX_STR(CopyTexSubImage1D)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(CopyTexSubImage2D))"\n"
-"\t"STUB_ASM_CODE("326")"\n"
-
-".globl "GLAPI_PREFIX_STR(CopyTexSubImage2DEXT)"\n"
-".set "GLAPI_PREFIX_STR(CopyTexSubImage2DEXT)", "GLAPI_PREFIX_STR(CopyTexSubImage2D)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(DeleteTextures))"\n"
-"\t"STUB_ASM_CODE("327")"\n"
-
-#if 0
-".globl "GLAPI_PREFIX_STR(DeleteTexturesEXT)"\n"
-".set "GLAPI_PREFIX_STR(DeleteTexturesEXT)", "GLAPI_PREFIX_STR(DeleteTextures)"\n"
-#endif
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GenTextures))"\n"
-"\t"STUB_ASM_CODE("328")"\n"
-
-#if 0
-".globl "GLAPI_PREFIX_STR(GenTexturesEXT)"\n"
-".set "GLAPI_PREFIX_STR(GenTexturesEXT)", "GLAPI_PREFIX_STR(GenTextures)"\n"
-#endif
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetPointerv))"\n"
-"\t"STUB_ASM_CODE("329")"\n"
-
-".globl "GLAPI_PREFIX_STR(GetPointervEXT)"\n"
-".set "GLAPI_PREFIX_STR(GetPointervEXT)", "GLAPI_PREFIX_STR(GetPointerv)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(IsTexture))"\n"
-"\t"STUB_ASM_CODE("330")"\n"
-
-#if 0
-".globl "GLAPI_PREFIX_STR(IsTextureEXT)"\n"
-".set "GLAPI_PREFIX_STR(IsTextureEXT)", "GLAPI_PREFIX_STR(IsTexture)"\n"
-#endif
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(PrioritizeTextures))"\n"
-"\t"STUB_ASM_CODE("331")"\n"
-
-".globl "GLAPI_PREFIX_STR(PrioritizeTexturesEXT)"\n"
-".set "GLAPI_PREFIX_STR(PrioritizeTexturesEXT)", "GLAPI_PREFIX_STR(PrioritizeTextures)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(TexSubImage1D))"\n"
-"\t"STUB_ASM_CODE("332")"\n"
-
-".globl "GLAPI_PREFIX_STR(TexSubImage1DEXT)"\n"
-".set "GLAPI_PREFIX_STR(TexSubImage1DEXT)", "GLAPI_PREFIX_STR(TexSubImage1D)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(TexSubImage2D))"\n"
-"\t"STUB_ASM_CODE("333")"\n"
-
-".globl "GLAPI_PREFIX_STR(TexSubImage2DEXT)"\n"
-".set "GLAPI_PREFIX_STR(TexSubImage2DEXT)", "GLAPI_PREFIX_STR(TexSubImage2D)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(PopClientAttrib))"\n"
-"\t"STUB_ASM_CODE("334")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(PushClientAttrib))"\n"
-"\t"STUB_ASM_CODE("335")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(BlendColor))"\n"
-"\t"STUB_ASM_CODE("336")"\n"
-
-".globl "GLAPI_PREFIX_STR(BlendColorEXT)"\n"
-".set "GLAPI_PREFIX_STR(BlendColorEXT)", "GLAPI_PREFIX_STR(BlendColor)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(BlendEquation))"\n"
-"\t"STUB_ASM_CODE("337")"\n"
-
-".globl "GLAPI_PREFIX_STR(BlendEquationEXT)"\n"
-".set "GLAPI_PREFIX_STR(BlendEquationEXT)", "GLAPI_PREFIX_STR(BlendEquation)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(DrawRangeElements))"\n"
-"\t"STUB_ASM_CODE("338")"\n"
-
-".globl "GLAPI_PREFIX_STR(DrawRangeElementsEXT)"\n"
-".set "GLAPI_PREFIX_STR(DrawRangeElementsEXT)", "GLAPI_PREFIX_STR(DrawRangeElements)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(ColorTable))"\n"
-"\t"STUB_ASM_CODE("339")"\n"
-
-".globl "GLAPI_PREFIX_STR(ColorTableEXT)"\n"
-".set "GLAPI_PREFIX_STR(ColorTableEXT)", "GLAPI_PREFIX_STR(ColorTable)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(ColorTableParameterfv))"\n"
-"\t"STUB_ASM_CODE("340")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(ColorTableParameteriv))"\n"
-"\t"STUB_ASM_CODE("341")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(CopyColorTable))"\n"
-"\t"STUB_ASM_CODE("342")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetColorTable))"\n"
-"\t"STUB_ASM_CODE("343")"\n"
-
-#if 0
-".globl "GLAPI_PREFIX_STR(GetColorTableEXT)"\n"
-".set "GLAPI_PREFIX_STR(GetColorTableEXT)", "GLAPI_PREFIX_STR(GetColorTable)"\n"
-#endif
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetColorTableParameterfv))"\n"
-"\t"STUB_ASM_CODE("344")"\n"
-
-#if 0
-".globl "GLAPI_PREFIX_STR(GetColorTableParameterfvEXT)"\n"
-".set "GLAPI_PREFIX_STR(GetColorTableParameterfvEXT)", "GLAPI_PREFIX_STR(GetColorTableParameterfv)"\n"
-#endif
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetColorTableParameteriv))"\n"
-"\t"STUB_ASM_CODE("345")"\n"
-
-#if 0
-".globl "GLAPI_PREFIX_STR(GetColorTableParameterivEXT)"\n"
-".set "GLAPI_PREFIX_STR(GetColorTableParameterivEXT)", "GLAPI_PREFIX_STR(GetColorTableParameteriv)"\n"
-#endif
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(ColorSubTable))"\n"
-"\t"STUB_ASM_CODE("346")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(CopyColorSubTable))"\n"
-"\t"STUB_ASM_CODE("347")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(ConvolutionFilter1D))"\n"
-"\t"STUB_ASM_CODE("348")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(ConvolutionFilter2D))"\n"
-"\t"STUB_ASM_CODE("349")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(ConvolutionParameterf))"\n"
-"\t"STUB_ASM_CODE("350")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(ConvolutionParameterfv))"\n"
-"\t"STUB_ASM_CODE("351")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(ConvolutionParameteri))"\n"
-"\t"STUB_ASM_CODE("352")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(ConvolutionParameteriv))"\n"
-"\t"STUB_ASM_CODE("353")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(CopyConvolutionFilter1D))"\n"
-"\t"STUB_ASM_CODE("354")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(CopyConvolutionFilter2D))"\n"
-"\t"STUB_ASM_CODE("355")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetConvolutionFilter))"\n"
-"\t"STUB_ASM_CODE("356")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetConvolutionParameterfv))"\n"
-"\t"STUB_ASM_CODE("357")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetConvolutionParameteriv))"\n"
-"\t"STUB_ASM_CODE("358")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetSeparableFilter))"\n"
-"\t"STUB_ASM_CODE("359")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(SeparableFilter2D))"\n"
-"\t"STUB_ASM_CODE("360")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetHistogram))"\n"
-"\t"STUB_ASM_CODE("361")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetHistogramParameterfv))"\n"
-"\t"STUB_ASM_CODE("362")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetHistogramParameteriv))"\n"
-"\t"STUB_ASM_CODE("363")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetMinmax))"\n"
-"\t"STUB_ASM_CODE("364")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetMinmaxParameterfv))"\n"
-"\t"STUB_ASM_CODE("365")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetMinmaxParameteriv))"\n"
-"\t"STUB_ASM_CODE("366")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Histogram))"\n"
-"\t"STUB_ASM_CODE("367")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Minmax))"\n"
-"\t"STUB_ASM_CODE("368")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(ResetHistogram))"\n"
-"\t"STUB_ASM_CODE("369")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(ResetMinmax))"\n"
-"\t"STUB_ASM_CODE("370")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(TexImage3D))"\n"
-"\t"STUB_ASM_CODE("371")"\n"
-
-".globl "GLAPI_PREFIX_STR(TexImage3DEXT)"\n"
-".set "GLAPI_PREFIX_STR(TexImage3DEXT)", "GLAPI_PREFIX_STR(TexImage3D)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(TexSubImage3D))"\n"
-"\t"STUB_ASM_CODE("372")"\n"
-
-".globl "GLAPI_PREFIX_STR(TexSubImage3DEXT)"\n"
-".set "GLAPI_PREFIX_STR(TexSubImage3DEXT)", "GLAPI_PREFIX_STR(TexSubImage3D)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(CopyTexSubImage3D))"\n"
-"\t"STUB_ASM_CODE("373")"\n"
-
-".globl "GLAPI_PREFIX_STR(CopyTexSubImage3DEXT)"\n"
-".set "GLAPI_PREFIX_STR(CopyTexSubImage3DEXT)", "GLAPI_PREFIX_STR(CopyTexSubImage3D)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(ActiveTextureARB))"\n"
-"\t"STUB_ASM_CODE("374")"\n"
-
-".globl "GLAPI_PREFIX_STR(ActiveTexture)"\n"
-".set "GLAPI_PREFIX_STR(ActiveTexture)", "GLAPI_PREFIX_STR(ActiveTextureARB)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(ClientActiveTextureARB))"\n"
-"\t"STUB_ASM_CODE("375")"\n"
-
-".globl "GLAPI_PREFIX_STR(ClientActiveTexture)"\n"
-".set "GLAPI_PREFIX_STR(ClientActiveTexture)", "GLAPI_PREFIX_STR(ClientActiveTextureARB)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(MultiTexCoord1dARB))"\n"
-"\t"STUB_ASM_CODE("376")"\n"
-
-".globl "GLAPI_PREFIX_STR(MultiTexCoord1d)"\n"
-".set "GLAPI_PREFIX_STR(MultiTexCoord1d)", "GLAPI_PREFIX_STR(MultiTexCoord1dARB)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(MultiTexCoord1dvARB))"\n"
-"\t"STUB_ASM_CODE("377")"\n"
-
-".globl "GLAPI_PREFIX_STR(MultiTexCoord1dv)"\n"
-".set "GLAPI_PREFIX_STR(MultiTexCoord1dv)", "GLAPI_PREFIX_STR(MultiTexCoord1dvARB)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(MultiTexCoord1fARB))"\n"
-"\t"STUB_ASM_CODE("378")"\n"
-
-".globl "GLAPI_PREFIX_STR(MultiTexCoord1f)"\n"
-".set "GLAPI_PREFIX_STR(MultiTexCoord1f)", "GLAPI_PREFIX_STR(MultiTexCoord1fARB)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(MultiTexCoord1fvARB))"\n"
-"\t"STUB_ASM_CODE("379")"\n"
-
-".globl "GLAPI_PREFIX_STR(MultiTexCoord1fv)"\n"
-".set "GLAPI_PREFIX_STR(MultiTexCoord1fv)", "GLAPI_PREFIX_STR(MultiTexCoord1fvARB)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(MultiTexCoord1iARB))"\n"
-"\t"STUB_ASM_CODE("380")"\n"
-
-".globl "GLAPI_PREFIX_STR(MultiTexCoord1i)"\n"
-".set "GLAPI_PREFIX_STR(MultiTexCoord1i)", "GLAPI_PREFIX_STR(MultiTexCoord1iARB)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(MultiTexCoord1ivARB))"\n"
-"\t"STUB_ASM_CODE("381")"\n"
-
-".globl "GLAPI_PREFIX_STR(MultiTexCoord1iv)"\n"
-".set "GLAPI_PREFIX_STR(MultiTexCoord1iv)", "GLAPI_PREFIX_STR(MultiTexCoord1ivARB)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(MultiTexCoord1sARB))"\n"
-"\t"STUB_ASM_CODE("382")"\n"
-
-".globl "GLAPI_PREFIX_STR(MultiTexCoord1s)"\n"
-".set "GLAPI_PREFIX_STR(MultiTexCoord1s)", "GLAPI_PREFIX_STR(MultiTexCoord1sARB)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(MultiTexCoord1svARB))"\n"
-"\t"STUB_ASM_CODE("383")"\n"
-
-".globl "GLAPI_PREFIX_STR(MultiTexCoord1sv)"\n"
-".set "GLAPI_PREFIX_STR(MultiTexCoord1sv)", "GLAPI_PREFIX_STR(MultiTexCoord1svARB)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(MultiTexCoord2dARB))"\n"
-"\t"STUB_ASM_CODE("384")"\n"
-
-".globl "GLAPI_PREFIX_STR(MultiTexCoord2d)"\n"
-".set "GLAPI_PREFIX_STR(MultiTexCoord2d)", "GLAPI_PREFIX_STR(MultiTexCoord2dARB)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(MultiTexCoord2dvARB))"\n"
-"\t"STUB_ASM_CODE("385")"\n"
-
-".globl "GLAPI_PREFIX_STR(MultiTexCoord2dv)"\n"
-".set "GLAPI_PREFIX_STR(MultiTexCoord2dv)", "GLAPI_PREFIX_STR(MultiTexCoord2dvARB)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(MultiTexCoord2fARB))"\n"
-"\t"STUB_ASM_CODE("386")"\n"
-
-".globl "GLAPI_PREFIX_STR(MultiTexCoord2f)"\n"
-".set "GLAPI_PREFIX_STR(MultiTexCoord2f)", "GLAPI_PREFIX_STR(MultiTexCoord2fARB)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(MultiTexCoord2fvARB))"\n"
-"\t"STUB_ASM_CODE("387")"\n"
-
-".globl "GLAPI_PREFIX_STR(MultiTexCoord2fv)"\n"
-".set "GLAPI_PREFIX_STR(MultiTexCoord2fv)", "GLAPI_PREFIX_STR(MultiTexCoord2fvARB)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(MultiTexCoord2iARB))"\n"
-"\t"STUB_ASM_CODE("388")"\n"
-
-".globl "GLAPI_PREFIX_STR(MultiTexCoord2i)"\n"
-".set "GLAPI_PREFIX_STR(MultiTexCoord2i)", "GLAPI_PREFIX_STR(MultiTexCoord2iARB)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(MultiTexCoord2ivARB))"\n"
-"\t"STUB_ASM_CODE("389")"\n"
-
-".globl "GLAPI_PREFIX_STR(MultiTexCoord2iv)"\n"
-".set "GLAPI_PREFIX_STR(MultiTexCoord2iv)", "GLAPI_PREFIX_STR(MultiTexCoord2ivARB)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(MultiTexCoord2sARB))"\n"
-"\t"STUB_ASM_CODE("390")"\n"
-
-".globl "GLAPI_PREFIX_STR(MultiTexCoord2s)"\n"
-".set "GLAPI_PREFIX_STR(MultiTexCoord2s)", "GLAPI_PREFIX_STR(MultiTexCoord2sARB)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(MultiTexCoord2svARB))"\n"
-"\t"STUB_ASM_CODE("391")"\n"
-
-".globl "GLAPI_PREFIX_STR(MultiTexCoord2sv)"\n"
-".set "GLAPI_PREFIX_STR(MultiTexCoord2sv)", "GLAPI_PREFIX_STR(MultiTexCoord2svARB)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(MultiTexCoord3dARB))"\n"
-"\t"STUB_ASM_CODE("392")"\n"
-
-".globl "GLAPI_PREFIX_STR(MultiTexCoord3d)"\n"
-".set "GLAPI_PREFIX_STR(MultiTexCoord3d)", "GLAPI_PREFIX_STR(MultiTexCoord3dARB)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(MultiTexCoord3dvARB))"\n"
-"\t"STUB_ASM_CODE("393")"\n"
-
-".globl "GLAPI_PREFIX_STR(MultiTexCoord3dv)"\n"
-".set "GLAPI_PREFIX_STR(MultiTexCoord3dv)", "GLAPI_PREFIX_STR(MultiTexCoord3dvARB)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(MultiTexCoord3fARB))"\n"
-"\t"STUB_ASM_CODE("394")"\n"
-
-".globl "GLAPI_PREFIX_STR(MultiTexCoord3f)"\n"
-".set "GLAPI_PREFIX_STR(MultiTexCoord3f)", "GLAPI_PREFIX_STR(MultiTexCoord3fARB)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(MultiTexCoord3fvARB))"\n"
-"\t"STUB_ASM_CODE("395")"\n"
-
-".globl "GLAPI_PREFIX_STR(MultiTexCoord3fv)"\n"
-".set "GLAPI_PREFIX_STR(MultiTexCoord3fv)", "GLAPI_PREFIX_STR(MultiTexCoord3fvARB)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(MultiTexCoord3iARB))"\n"
-"\t"STUB_ASM_CODE("396")"\n"
-
-".globl "GLAPI_PREFIX_STR(MultiTexCoord3i)"\n"
-".set "GLAPI_PREFIX_STR(MultiTexCoord3i)", "GLAPI_PREFIX_STR(MultiTexCoord3iARB)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(MultiTexCoord3ivARB))"\n"
-"\t"STUB_ASM_CODE("397")"\n"
-
-".globl "GLAPI_PREFIX_STR(MultiTexCoord3iv)"\n"
-".set "GLAPI_PREFIX_STR(MultiTexCoord3iv)", "GLAPI_PREFIX_STR(MultiTexCoord3ivARB)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(MultiTexCoord3sARB))"\n"
-"\t"STUB_ASM_CODE("398")"\n"
-
-".globl "GLAPI_PREFIX_STR(MultiTexCoord3s)"\n"
-".set "GLAPI_PREFIX_STR(MultiTexCoord3s)", "GLAPI_PREFIX_STR(MultiTexCoord3sARB)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(MultiTexCoord3svARB))"\n"
-"\t"STUB_ASM_CODE("399")"\n"
-
-".globl "GLAPI_PREFIX_STR(MultiTexCoord3sv)"\n"
-".set "GLAPI_PREFIX_STR(MultiTexCoord3sv)", "GLAPI_PREFIX_STR(MultiTexCoord3svARB)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(MultiTexCoord4dARB))"\n"
-"\t"STUB_ASM_CODE("400")"\n"
-
-".globl "GLAPI_PREFIX_STR(MultiTexCoord4d)"\n"
-".set "GLAPI_PREFIX_STR(MultiTexCoord4d)", "GLAPI_PREFIX_STR(MultiTexCoord4dARB)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(MultiTexCoord4dvARB))"\n"
-"\t"STUB_ASM_CODE("401")"\n"
-
-".globl "GLAPI_PREFIX_STR(MultiTexCoord4dv)"\n"
-".set "GLAPI_PREFIX_STR(MultiTexCoord4dv)", "GLAPI_PREFIX_STR(MultiTexCoord4dvARB)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(MultiTexCoord4fARB))"\n"
-"\t"STUB_ASM_CODE("402")"\n"
-
-".globl "GLAPI_PREFIX_STR(MultiTexCoord4f)"\n"
-".set "GLAPI_PREFIX_STR(MultiTexCoord4f)", "GLAPI_PREFIX_STR(MultiTexCoord4fARB)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(MultiTexCoord4fvARB))"\n"
-"\t"STUB_ASM_CODE("403")"\n"
-
-".globl "GLAPI_PREFIX_STR(MultiTexCoord4fv)"\n"
-".set "GLAPI_PREFIX_STR(MultiTexCoord4fv)", "GLAPI_PREFIX_STR(MultiTexCoord4fvARB)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(MultiTexCoord4iARB))"\n"
-"\t"STUB_ASM_CODE("404")"\n"
-
-".globl "GLAPI_PREFIX_STR(MultiTexCoord4i)"\n"
-".set "GLAPI_PREFIX_STR(MultiTexCoord4i)", "GLAPI_PREFIX_STR(MultiTexCoord4iARB)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(MultiTexCoord4ivARB))"\n"
-"\t"STUB_ASM_CODE("405")"\n"
-
-".globl "GLAPI_PREFIX_STR(MultiTexCoord4iv)"\n"
-".set "GLAPI_PREFIX_STR(MultiTexCoord4iv)", "GLAPI_PREFIX_STR(MultiTexCoord4ivARB)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(MultiTexCoord4sARB))"\n"
-"\t"STUB_ASM_CODE("406")"\n"
-
-".globl "GLAPI_PREFIX_STR(MultiTexCoord4s)"\n"
-".set "GLAPI_PREFIX_STR(MultiTexCoord4s)", "GLAPI_PREFIX_STR(MultiTexCoord4sARB)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(MultiTexCoord4svARB))"\n"
-"\t"STUB_ASM_CODE("407")"\n"
-
-".globl "GLAPI_PREFIX_STR(MultiTexCoord4sv)"\n"
-".set "GLAPI_PREFIX_STR(MultiTexCoord4sv)", "GLAPI_PREFIX_STR(MultiTexCoord4svARB)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(AttachShader))"\n"
-"\t"STUB_ASM_CODE("408")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(CreateProgram))"\n"
-"\t"STUB_ASM_CODE("409")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(CreateShader))"\n"
-"\t"STUB_ASM_CODE("410")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(DeleteProgram))"\n"
-"\t"STUB_ASM_CODE("411")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(DeleteShader))"\n"
-"\t"STUB_ASM_CODE("412")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(DetachShader))"\n"
-"\t"STUB_ASM_CODE("413")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetAttachedShaders))"\n"
-"\t"STUB_ASM_CODE("414")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetProgramInfoLog))"\n"
-"\t"STUB_ASM_CODE("415")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetProgramiv))"\n"
-"\t"STUB_ASM_CODE("416")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetShaderInfoLog))"\n"
-"\t"STUB_ASM_CODE("417")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetShaderiv))"\n"
-"\t"STUB_ASM_CODE("418")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(IsProgram))"\n"
-"\t"STUB_ASM_CODE("419")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(IsShader))"\n"
-"\t"STUB_ASM_CODE("420")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(StencilFuncSeparate))"\n"
-"\t"STUB_ASM_CODE("421")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(StencilMaskSeparate))"\n"
-"\t"STUB_ASM_CODE("422")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(StencilOpSeparate))"\n"
-"\t"STUB_ASM_CODE("423")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(UniformMatrix2x3fv))"\n"
-"\t"STUB_ASM_CODE("424")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(UniformMatrix2x4fv))"\n"
-"\t"STUB_ASM_CODE("425")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(UniformMatrix3x2fv))"\n"
-"\t"STUB_ASM_CODE("426")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(UniformMatrix3x4fv))"\n"
-"\t"STUB_ASM_CODE("427")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(UniformMatrix4x2fv))"\n"
-"\t"STUB_ASM_CODE("428")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(UniformMatrix4x3fv))"\n"
-"\t"STUB_ASM_CODE("429")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(ClampColor))"\n"
-"\t"STUB_ASM_CODE("430")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(ClearBufferfi))"\n"
-"\t"STUB_ASM_CODE("431")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(ClearBufferfv))"\n"
-"\t"STUB_ASM_CODE("432")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(ClearBufferiv))"\n"
-"\t"STUB_ASM_CODE("433")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(ClearBufferuiv))"\n"
-"\t"STUB_ASM_CODE("434")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetStringi))"\n"
-"\t"STUB_ASM_CODE("435")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(TexBuffer))"\n"
-"\t"STUB_ASM_CODE("436")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(FramebufferTexture))"\n"
-"\t"STUB_ASM_CODE("437")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetBufferParameteri64v))"\n"
-"\t"STUB_ASM_CODE("438")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetInteger64i_v))"\n"
-"\t"STUB_ASM_CODE("439")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttribDivisor))"\n"
-"\t"STUB_ASM_CODE("440")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(LoadTransposeMatrixdARB))"\n"
-"\t"STUB_ASM_CODE("441")"\n"
-
-".globl "GLAPI_PREFIX_STR(LoadTransposeMatrixd)"\n"
-".set "GLAPI_PREFIX_STR(LoadTransposeMatrixd)", "GLAPI_PREFIX_STR(LoadTransposeMatrixdARB)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(LoadTransposeMatrixfARB))"\n"
-"\t"STUB_ASM_CODE("442")"\n"
-
-".globl "GLAPI_PREFIX_STR(LoadTransposeMatrixf)"\n"
-".set "GLAPI_PREFIX_STR(LoadTransposeMatrixf)", "GLAPI_PREFIX_STR(LoadTransposeMatrixfARB)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(MultTransposeMatrixdARB))"\n"
-"\t"STUB_ASM_CODE("443")"\n"
-
-".globl "GLAPI_PREFIX_STR(MultTransposeMatrixd)"\n"
-".set "GLAPI_PREFIX_STR(MultTransposeMatrixd)", "GLAPI_PREFIX_STR(MultTransposeMatrixdARB)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(MultTransposeMatrixfARB))"\n"
-"\t"STUB_ASM_CODE("444")"\n"
-
-".globl "GLAPI_PREFIX_STR(MultTransposeMatrixf)"\n"
-".set "GLAPI_PREFIX_STR(MultTransposeMatrixf)", "GLAPI_PREFIX_STR(MultTransposeMatrixfARB)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(SampleCoverageARB))"\n"
-"\t"STUB_ASM_CODE("445")"\n"
-
-".globl "GLAPI_PREFIX_STR(SampleCoverage)"\n"
-".set "GLAPI_PREFIX_STR(SampleCoverage)", "GLAPI_PREFIX_STR(SampleCoverageARB)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(CompressedTexImage1DARB))"\n"
-"\t"STUB_ASM_CODE("446")"\n"
-
-".globl "GLAPI_PREFIX_STR(CompressedTexImage1D)"\n"
-".set "GLAPI_PREFIX_STR(CompressedTexImage1D)", "GLAPI_PREFIX_STR(CompressedTexImage1DARB)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(CompressedTexImage2DARB))"\n"
-"\t"STUB_ASM_CODE("447")"\n"
-
-".globl "GLAPI_PREFIX_STR(CompressedTexImage2D)"\n"
-".set "GLAPI_PREFIX_STR(CompressedTexImage2D)", "GLAPI_PREFIX_STR(CompressedTexImage2DARB)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(CompressedTexImage3DARB))"\n"
-"\t"STUB_ASM_CODE("448")"\n"
-
-".globl "GLAPI_PREFIX_STR(CompressedTexImage3D)"\n"
-".set "GLAPI_PREFIX_STR(CompressedTexImage3D)", "GLAPI_PREFIX_STR(CompressedTexImage3DARB)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(CompressedTexSubImage1DARB))"\n"
-"\t"STUB_ASM_CODE("449")"\n"
-
-".globl "GLAPI_PREFIX_STR(CompressedTexSubImage1D)"\n"
-".set "GLAPI_PREFIX_STR(CompressedTexSubImage1D)", "GLAPI_PREFIX_STR(CompressedTexSubImage1DARB)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(CompressedTexSubImage2DARB))"\n"
-"\t"STUB_ASM_CODE("450")"\n"
-
-".globl "GLAPI_PREFIX_STR(CompressedTexSubImage2D)"\n"
-".set "GLAPI_PREFIX_STR(CompressedTexSubImage2D)", "GLAPI_PREFIX_STR(CompressedTexSubImage2DARB)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(CompressedTexSubImage3DARB))"\n"
-"\t"STUB_ASM_CODE("451")"\n"
-
-".globl "GLAPI_PREFIX_STR(CompressedTexSubImage3D)"\n"
-".set "GLAPI_PREFIX_STR(CompressedTexSubImage3D)", "GLAPI_PREFIX_STR(CompressedTexSubImage3DARB)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetCompressedTexImageARB))"\n"
-"\t"STUB_ASM_CODE("452")"\n"
-
-".globl "GLAPI_PREFIX_STR(GetCompressedTexImage)"\n"
-".set "GLAPI_PREFIX_STR(GetCompressedTexImage)", "GLAPI_PREFIX_STR(GetCompressedTexImageARB)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(DisableVertexAttribArrayARB))"\n"
-"\t"STUB_ASM_CODE("453")"\n"
-
-".globl "GLAPI_PREFIX_STR(DisableVertexAttribArray)"\n"
-".set "GLAPI_PREFIX_STR(DisableVertexAttribArray)", "GLAPI_PREFIX_STR(DisableVertexAttribArrayARB)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(EnableVertexAttribArrayARB))"\n"
-"\t"STUB_ASM_CODE("454")"\n"
-
-".globl "GLAPI_PREFIX_STR(EnableVertexAttribArray)"\n"
-".set "GLAPI_PREFIX_STR(EnableVertexAttribArray)", "GLAPI_PREFIX_STR(EnableVertexAttribArrayARB)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetProgramEnvParameterdvARB))"\n"
-"\t"STUB_ASM_CODE("455")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetProgramEnvParameterfvARB))"\n"
-"\t"STUB_ASM_CODE("456")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetProgramLocalParameterdvARB))"\n"
-"\t"STUB_ASM_CODE("457")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetProgramLocalParameterfvARB))"\n"
-"\t"STUB_ASM_CODE("458")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetProgramStringARB))"\n"
-"\t"STUB_ASM_CODE("459")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetProgramivARB))"\n"
-"\t"STUB_ASM_CODE("460")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetVertexAttribdvARB))"\n"
-"\t"STUB_ASM_CODE("461")"\n"
-
-".globl "GLAPI_PREFIX_STR(GetVertexAttribdv)"\n"
-".set "GLAPI_PREFIX_STR(GetVertexAttribdv)", "GLAPI_PREFIX_STR(GetVertexAttribdvARB)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetVertexAttribfvARB))"\n"
-"\t"STUB_ASM_CODE("462")"\n"
-
-".globl "GLAPI_PREFIX_STR(GetVertexAttribfv)"\n"
-".set "GLAPI_PREFIX_STR(GetVertexAttribfv)", "GLAPI_PREFIX_STR(GetVertexAttribfvARB)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetVertexAttribivARB))"\n"
-"\t"STUB_ASM_CODE("463")"\n"
-
-".globl "GLAPI_PREFIX_STR(GetVertexAttribiv)"\n"
-".set "GLAPI_PREFIX_STR(GetVertexAttribiv)", "GLAPI_PREFIX_STR(GetVertexAttribivARB)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(ProgramEnvParameter4dARB))"\n"
-"\t"STUB_ASM_CODE("464")"\n"
-
-".globl "GLAPI_PREFIX_STR(ProgramParameter4dNV)"\n"
-".set "GLAPI_PREFIX_STR(ProgramParameter4dNV)", "GLAPI_PREFIX_STR(ProgramEnvParameter4dARB)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(ProgramEnvParameter4dvARB))"\n"
-"\t"STUB_ASM_CODE("465")"\n"
-
-".globl "GLAPI_PREFIX_STR(ProgramParameter4dvNV)"\n"
-".set "GLAPI_PREFIX_STR(ProgramParameter4dvNV)", "GLAPI_PREFIX_STR(ProgramEnvParameter4dvARB)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(ProgramEnvParameter4fARB))"\n"
-"\t"STUB_ASM_CODE("466")"\n"
-
-".globl "GLAPI_PREFIX_STR(ProgramParameter4fNV)"\n"
-".set "GLAPI_PREFIX_STR(ProgramParameter4fNV)", "GLAPI_PREFIX_STR(ProgramEnvParameter4fARB)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(ProgramEnvParameter4fvARB))"\n"
-"\t"STUB_ASM_CODE("467")"\n"
-
-".globl "GLAPI_PREFIX_STR(ProgramParameter4fvNV)"\n"
-".set "GLAPI_PREFIX_STR(ProgramParameter4fvNV)", "GLAPI_PREFIX_STR(ProgramEnvParameter4fvARB)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(ProgramLocalParameter4dARB))"\n"
-"\t"STUB_ASM_CODE("468")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(ProgramLocalParameter4dvARB))"\n"
-"\t"STUB_ASM_CODE("469")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(ProgramLocalParameter4fARB))"\n"
-"\t"STUB_ASM_CODE("470")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(ProgramLocalParameter4fvARB))"\n"
-"\t"STUB_ASM_CODE("471")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(ProgramStringARB))"\n"
-"\t"STUB_ASM_CODE("472")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttrib1dARB))"\n"
-"\t"STUB_ASM_CODE("473")"\n"
-
-".globl "GLAPI_PREFIX_STR(VertexAttrib1d)"\n"
-".set "GLAPI_PREFIX_STR(VertexAttrib1d)", "GLAPI_PREFIX_STR(VertexAttrib1dARB)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttrib1dvARB))"\n"
-"\t"STUB_ASM_CODE("474")"\n"
-
-".globl "GLAPI_PREFIX_STR(VertexAttrib1dv)"\n"
-".set "GLAPI_PREFIX_STR(VertexAttrib1dv)", "GLAPI_PREFIX_STR(VertexAttrib1dvARB)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttrib1fARB))"\n"
-"\t"STUB_ASM_CODE("475")"\n"
-
-".globl "GLAPI_PREFIX_STR(VertexAttrib1f)"\n"
-".set "GLAPI_PREFIX_STR(VertexAttrib1f)", "GLAPI_PREFIX_STR(VertexAttrib1fARB)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttrib1fvARB))"\n"
-"\t"STUB_ASM_CODE("476")"\n"
-
-".globl "GLAPI_PREFIX_STR(VertexAttrib1fv)"\n"
-".set "GLAPI_PREFIX_STR(VertexAttrib1fv)", "GLAPI_PREFIX_STR(VertexAttrib1fvARB)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttrib1sARB))"\n"
-"\t"STUB_ASM_CODE("477")"\n"
-
-".globl "GLAPI_PREFIX_STR(VertexAttrib1s)"\n"
-".set "GLAPI_PREFIX_STR(VertexAttrib1s)", "GLAPI_PREFIX_STR(VertexAttrib1sARB)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttrib1svARB))"\n"
-"\t"STUB_ASM_CODE("478")"\n"
-
-".globl "GLAPI_PREFIX_STR(VertexAttrib1sv)"\n"
-".set "GLAPI_PREFIX_STR(VertexAttrib1sv)", "GLAPI_PREFIX_STR(VertexAttrib1svARB)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttrib2dARB))"\n"
-"\t"STUB_ASM_CODE("479")"\n"
-
-".globl "GLAPI_PREFIX_STR(VertexAttrib2d)"\n"
-".set "GLAPI_PREFIX_STR(VertexAttrib2d)", "GLAPI_PREFIX_STR(VertexAttrib2dARB)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttrib2dvARB))"\n"
-"\t"STUB_ASM_CODE("480")"\n"
-
-".globl "GLAPI_PREFIX_STR(VertexAttrib2dv)"\n"
-".set "GLAPI_PREFIX_STR(VertexAttrib2dv)", "GLAPI_PREFIX_STR(VertexAttrib2dvARB)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttrib2fARB))"\n"
-"\t"STUB_ASM_CODE("481")"\n"
-
-".globl "GLAPI_PREFIX_STR(VertexAttrib2f)"\n"
-".set "GLAPI_PREFIX_STR(VertexAttrib2f)", "GLAPI_PREFIX_STR(VertexAttrib2fARB)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttrib2fvARB))"\n"
-"\t"STUB_ASM_CODE("482")"\n"
-
-".globl "GLAPI_PREFIX_STR(VertexAttrib2fv)"\n"
-".set "GLAPI_PREFIX_STR(VertexAttrib2fv)", "GLAPI_PREFIX_STR(VertexAttrib2fvARB)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttrib2sARB))"\n"
-"\t"STUB_ASM_CODE("483")"\n"
-
-".globl "GLAPI_PREFIX_STR(VertexAttrib2s)"\n"
-".set "GLAPI_PREFIX_STR(VertexAttrib2s)", "GLAPI_PREFIX_STR(VertexAttrib2sARB)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttrib2svARB))"\n"
-"\t"STUB_ASM_CODE("484")"\n"
-
-".globl "GLAPI_PREFIX_STR(VertexAttrib2sv)"\n"
-".set "GLAPI_PREFIX_STR(VertexAttrib2sv)", "GLAPI_PREFIX_STR(VertexAttrib2svARB)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttrib3dARB))"\n"
-"\t"STUB_ASM_CODE("485")"\n"
-
-".globl "GLAPI_PREFIX_STR(VertexAttrib3d)"\n"
-".set "GLAPI_PREFIX_STR(VertexAttrib3d)", "GLAPI_PREFIX_STR(VertexAttrib3dARB)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttrib3dvARB))"\n"
-"\t"STUB_ASM_CODE("486")"\n"
-
-".globl "GLAPI_PREFIX_STR(VertexAttrib3dv)"\n"
-".set "GLAPI_PREFIX_STR(VertexAttrib3dv)", "GLAPI_PREFIX_STR(VertexAttrib3dvARB)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttrib3fARB))"\n"
-"\t"STUB_ASM_CODE("487")"\n"
-
-".globl "GLAPI_PREFIX_STR(VertexAttrib3f)"\n"
-".set "GLAPI_PREFIX_STR(VertexAttrib3f)", "GLAPI_PREFIX_STR(VertexAttrib3fARB)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttrib3fvARB))"\n"
-"\t"STUB_ASM_CODE("488")"\n"
-
-".globl "GLAPI_PREFIX_STR(VertexAttrib3fv)"\n"
-".set "GLAPI_PREFIX_STR(VertexAttrib3fv)", "GLAPI_PREFIX_STR(VertexAttrib3fvARB)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttrib3sARB))"\n"
-"\t"STUB_ASM_CODE("489")"\n"
-
-".globl "GLAPI_PREFIX_STR(VertexAttrib3s)"\n"
-".set "GLAPI_PREFIX_STR(VertexAttrib3s)", "GLAPI_PREFIX_STR(VertexAttrib3sARB)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttrib3svARB))"\n"
-"\t"STUB_ASM_CODE("490")"\n"
-
-".globl "GLAPI_PREFIX_STR(VertexAttrib3sv)"\n"
-".set "GLAPI_PREFIX_STR(VertexAttrib3sv)", "GLAPI_PREFIX_STR(VertexAttrib3svARB)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttrib4NbvARB))"\n"
-"\t"STUB_ASM_CODE("491")"\n"
-
-".globl "GLAPI_PREFIX_STR(VertexAttrib4Nbv)"\n"
-".set "GLAPI_PREFIX_STR(VertexAttrib4Nbv)", "GLAPI_PREFIX_STR(VertexAttrib4NbvARB)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttrib4NivARB))"\n"
-"\t"STUB_ASM_CODE("492")"\n"
-
-".globl "GLAPI_PREFIX_STR(VertexAttrib4Niv)"\n"
-".set "GLAPI_PREFIX_STR(VertexAttrib4Niv)", "GLAPI_PREFIX_STR(VertexAttrib4NivARB)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttrib4NsvARB))"\n"
-"\t"STUB_ASM_CODE("493")"\n"
-
-".globl "GLAPI_PREFIX_STR(VertexAttrib4Nsv)"\n"
-".set "GLAPI_PREFIX_STR(VertexAttrib4Nsv)", "GLAPI_PREFIX_STR(VertexAttrib4NsvARB)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttrib4NubARB))"\n"
-"\t"STUB_ASM_CODE("494")"\n"
-
-".globl "GLAPI_PREFIX_STR(VertexAttrib4Nub)"\n"
-".set "GLAPI_PREFIX_STR(VertexAttrib4Nub)", "GLAPI_PREFIX_STR(VertexAttrib4NubARB)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttrib4NubvARB))"\n"
-"\t"STUB_ASM_CODE("495")"\n"
-
-".globl "GLAPI_PREFIX_STR(VertexAttrib4Nubv)"\n"
-".set "GLAPI_PREFIX_STR(VertexAttrib4Nubv)", "GLAPI_PREFIX_STR(VertexAttrib4NubvARB)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttrib4NuivARB))"\n"
-"\t"STUB_ASM_CODE("496")"\n"
-
-".globl "GLAPI_PREFIX_STR(VertexAttrib4Nuiv)"\n"
-".set "GLAPI_PREFIX_STR(VertexAttrib4Nuiv)", "GLAPI_PREFIX_STR(VertexAttrib4NuivARB)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttrib4NusvARB))"\n"
-"\t"STUB_ASM_CODE("497")"\n"
-
-".globl "GLAPI_PREFIX_STR(VertexAttrib4Nusv)"\n"
-".set "GLAPI_PREFIX_STR(VertexAttrib4Nusv)", "GLAPI_PREFIX_STR(VertexAttrib4NusvARB)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttrib4bvARB))"\n"
-"\t"STUB_ASM_CODE("498")"\n"
-
-".globl "GLAPI_PREFIX_STR(VertexAttrib4bv)"\n"
-".set "GLAPI_PREFIX_STR(VertexAttrib4bv)", "GLAPI_PREFIX_STR(VertexAttrib4bvARB)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttrib4dARB))"\n"
-"\t"STUB_ASM_CODE("499")"\n"
-
-".globl "GLAPI_PREFIX_STR(VertexAttrib4d)"\n"
-".set "GLAPI_PREFIX_STR(VertexAttrib4d)", "GLAPI_PREFIX_STR(VertexAttrib4dARB)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttrib4dvARB))"\n"
-"\t"STUB_ASM_CODE("500")"\n"
-
-".globl "GLAPI_PREFIX_STR(VertexAttrib4dv)"\n"
-".set "GLAPI_PREFIX_STR(VertexAttrib4dv)", "GLAPI_PREFIX_STR(VertexAttrib4dvARB)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttrib4fARB))"\n"
-"\t"STUB_ASM_CODE("501")"\n"
-
-".globl "GLAPI_PREFIX_STR(VertexAttrib4f)"\n"
-".set "GLAPI_PREFIX_STR(VertexAttrib4f)", "GLAPI_PREFIX_STR(VertexAttrib4fARB)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttrib4fvARB))"\n"
-"\t"STUB_ASM_CODE("502")"\n"
-
-".globl "GLAPI_PREFIX_STR(VertexAttrib4fv)"\n"
-".set "GLAPI_PREFIX_STR(VertexAttrib4fv)", "GLAPI_PREFIX_STR(VertexAttrib4fvARB)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttrib4ivARB))"\n"
-"\t"STUB_ASM_CODE("503")"\n"
-
-".globl "GLAPI_PREFIX_STR(VertexAttrib4iv)"\n"
-".set "GLAPI_PREFIX_STR(VertexAttrib4iv)", "GLAPI_PREFIX_STR(VertexAttrib4ivARB)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttrib4sARB))"\n"
-"\t"STUB_ASM_CODE("504")"\n"
-
-".globl "GLAPI_PREFIX_STR(VertexAttrib4s)"\n"
-".set "GLAPI_PREFIX_STR(VertexAttrib4s)", "GLAPI_PREFIX_STR(VertexAttrib4sARB)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttrib4svARB))"\n"
-"\t"STUB_ASM_CODE("505")"\n"
-
-".globl "GLAPI_PREFIX_STR(VertexAttrib4sv)"\n"
-".set "GLAPI_PREFIX_STR(VertexAttrib4sv)", "GLAPI_PREFIX_STR(VertexAttrib4svARB)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttrib4ubvARB))"\n"
-"\t"STUB_ASM_CODE("506")"\n"
-
-".globl "GLAPI_PREFIX_STR(VertexAttrib4ubv)"\n"
-".set "GLAPI_PREFIX_STR(VertexAttrib4ubv)", "GLAPI_PREFIX_STR(VertexAttrib4ubvARB)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttrib4uivARB))"\n"
-"\t"STUB_ASM_CODE("507")"\n"
-
-".globl "GLAPI_PREFIX_STR(VertexAttrib4uiv)"\n"
-".set "GLAPI_PREFIX_STR(VertexAttrib4uiv)", "GLAPI_PREFIX_STR(VertexAttrib4uivARB)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttrib4usvARB))"\n"
-"\t"STUB_ASM_CODE("508")"\n"
-
-".globl "GLAPI_PREFIX_STR(VertexAttrib4usv)"\n"
-".set "GLAPI_PREFIX_STR(VertexAttrib4usv)", "GLAPI_PREFIX_STR(VertexAttrib4usvARB)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttribPointerARB))"\n"
-"\t"STUB_ASM_CODE("509")"\n"
-
-".globl "GLAPI_PREFIX_STR(VertexAttribPointer)"\n"
-".set "GLAPI_PREFIX_STR(VertexAttribPointer)", "GLAPI_PREFIX_STR(VertexAttribPointerARB)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(BindBufferARB))"\n"
-"\t"STUB_ASM_CODE("510")"\n"
-
-".globl "GLAPI_PREFIX_STR(BindBuffer)"\n"
-".set "GLAPI_PREFIX_STR(BindBuffer)", "GLAPI_PREFIX_STR(BindBufferARB)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(BufferDataARB))"\n"
-"\t"STUB_ASM_CODE("511")"\n"
-
-".globl "GLAPI_PREFIX_STR(BufferData)"\n"
-".set "GLAPI_PREFIX_STR(BufferData)", "GLAPI_PREFIX_STR(BufferDataARB)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(BufferSubDataARB))"\n"
-"\t"STUB_ASM_CODE("512")"\n"
-
-".globl "GLAPI_PREFIX_STR(BufferSubData)"\n"
-".set "GLAPI_PREFIX_STR(BufferSubData)", "GLAPI_PREFIX_STR(BufferSubDataARB)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(DeleteBuffersARB))"\n"
-"\t"STUB_ASM_CODE("513")"\n"
-
-".globl "GLAPI_PREFIX_STR(DeleteBuffers)"\n"
-".set "GLAPI_PREFIX_STR(DeleteBuffers)", "GLAPI_PREFIX_STR(DeleteBuffersARB)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GenBuffersARB))"\n"
-"\t"STUB_ASM_CODE("514")"\n"
-
-".globl "GLAPI_PREFIX_STR(GenBuffers)"\n"
-".set "GLAPI_PREFIX_STR(GenBuffers)", "GLAPI_PREFIX_STR(GenBuffersARB)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetBufferParameterivARB))"\n"
-"\t"STUB_ASM_CODE("515")"\n"
-
-".globl "GLAPI_PREFIX_STR(GetBufferParameteriv)"\n"
-".set "GLAPI_PREFIX_STR(GetBufferParameteriv)", "GLAPI_PREFIX_STR(GetBufferParameterivARB)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetBufferPointervARB))"\n"
-"\t"STUB_ASM_CODE("516")"\n"
-
-".globl "GLAPI_PREFIX_STR(GetBufferPointerv)"\n"
-".set "GLAPI_PREFIX_STR(GetBufferPointerv)", "GLAPI_PREFIX_STR(GetBufferPointervARB)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetBufferSubDataARB))"\n"
-"\t"STUB_ASM_CODE("517")"\n"
-
-".globl "GLAPI_PREFIX_STR(GetBufferSubData)"\n"
-".set "GLAPI_PREFIX_STR(GetBufferSubData)", "GLAPI_PREFIX_STR(GetBufferSubDataARB)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(IsBufferARB))"\n"
-"\t"STUB_ASM_CODE("518")"\n"
-
-".globl "GLAPI_PREFIX_STR(IsBuffer)"\n"
-".set "GLAPI_PREFIX_STR(IsBuffer)", "GLAPI_PREFIX_STR(IsBufferARB)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(MapBufferARB))"\n"
-"\t"STUB_ASM_CODE("519")"\n"
-
-".globl "GLAPI_PREFIX_STR(MapBuffer)"\n"
-".set "GLAPI_PREFIX_STR(MapBuffer)", "GLAPI_PREFIX_STR(MapBufferARB)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(UnmapBufferARB))"\n"
-"\t"STUB_ASM_CODE("520")"\n"
-
-".globl "GLAPI_PREFIX_STR(UnmapBuffer)"\n"
-".set "GLAPI_PREFIX_STR(UnmapBuffer)", "GLAPI_PREFIX_STR(UnmapBufferARB)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(BeginQueryARB))"\n"
-"\t"STUB_ASM_CODE("521")"\n"
-
-".globl "GLAPI_PREFIX_STR(BeginQuery)"\n"
-".set "GLAPI_PREFIX_STR(BeginQuery)", "GLAPI_PREFIX_STR(BeginQueryARB)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(DeleteQueriesARB))"\n"
-"\t"STUB_ASM_CODE("522")"\n"
-
-".globl "GLAPI_PREFIX_STR(DeleteQueries)"\n"
-".set "GLAPI_PREFIX_STR(DeleteQueries)", "GLAPI_PREFIX_STR(DeleteQueriesARB)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(EndQueryARB))"\n"
-"\t"STUB_ASM_CODE("523")"\n"
-
-".globl "GLAPI_PREFIX_STR(EndQuery)"\n"
-".set "GLAPI_PREFIX_STR(EndQuery)", "GLAPI_PREFIX_STR(EndQueryARB)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GenQueriesARB))"\n"
-"\t"STUB_ASM_CODE("524")"\n"
-
-".globl "GLAPI_PREFIX_STR(GenQueries)"\n"
-".set "GLAPI_PREFIX_STR(GenQueries)", "GLAPI_PREFIX_STR(GenQueriesARB)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetQueryObjectivARB))"\n"
-"\t"STUB_ASM_CODE("525")"\n"
-
-".globl "GLAPI_PREFIX_STR(GetQueryObjectiv)"\n"
-".set "GLAPI_PREFIX_STR(GetQueryObjectiv)", "GLAPI_PREFIX_STR(GetQueryObjectivARB)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetQueryObjectuivARB))"\n"
-"\t"STUB_ASM_CODE("526")"\n"
-
-".globl "GLAPI_PREFIX_STR(GetQueryObjectuiv)"\n"
-".set "GLAPI_PREFIX_STR(GetQueryObjectuiv)", "GLAPI_PREFIX_STR(GetQueryObjectuivARB)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetQueryivARB))"\n"
-"\t"STUB_ASM_CODE("527")"\n"
-
-".globl "GLAPI_PREFIX_STR(GetQueryiv)"\n"
-".set "GLAPI_PREFIX_STR(GetQueryiv)", "GLAPI_PREFIX_STR(GetQueryivARB)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(IsQueryARB))"\n"
-"\t"STUB_ASM_CODE("528")"\n"
-
-".globl "GLAPI_PREFIX_STR(IsQuery)"\n"
-".set "GLAPI_PREFIX_STR(IsQuery)", "GLAPI_PREFIX_STR(IsQueryARB)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(AttachObjectARB))"\n"
-"\t"STUB_ASM_CODE("529")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(CompileShaderARB))"\n"
-"\t"STUB_ASM_CODE("530")"\n"
-
-".globl "GLAPI_PREFIX_STR(CompileShader)"\n"
-".set "GLAPI_PREFIX_STR(CompileShader)", "GLAPI_PREFIX_STR(CompileShaderARB)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(CreateProgramObjectARB))"\n"
-"\t"STUB_ASM_CODE("531")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(CreateShaderObjectARB))"\n"
-"\t"STUB_ASM_CODE("532")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(DeleteObjectARB))"\n"
-"\t"STUB_ASM_CODE("533")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(DetachObjectARB))"\n"
-"\t"STUB_ASM_CODE("534")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetActiveUniformARB))"\n"
-"\t"STUB_ASM_CODE("535")"\n"
-
-".globl "GLAPI_PREFIX_STR(GetActiveUniform)"\n"
-".set "GLAPI_PREFIX_STR(GetActiveUniform)", "GLAPI_PREFIX_STR(GetActiveUniformARB)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetAttachedObjectsARB))"\n"
-"\t"STUB_ASM_CODE("536")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetHandleARB))"\n"
-"\t"STUB_ASM_CODE("537")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetInfoLogARB))"\n"
-"\t"STUB_ASM_CODE("538")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetObjectParameterfvARB))"\n"
-"\t"STUB_ASM_CODE("539")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetObjectParameterivARB))"\n"
-"\t"STUB_ASM_CODE("540")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetShaderSourceARB))"\n"
-"\t"STUB_ASM_CODE("541")"\n"
-
-".globl "GLAPI_PREFIX_STR(GetShaderSource)"\n"
-".set "GLAPI_PREFIX_STR(GetShaderSource)", "GLAPI_PREFIX_STR(GetShaderSourceARB)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetUniformLocationARB))"\n"
-"\t"STUB_ASM_CODE("542")"\n"
-
-".globl "GLAPI_PREFIX_STR(GetUniformLocation)"\n"
-".set "GLAPI_PREFIX_STR(GetUniformLocation)", "GLAPI_PREFIX_STR(GetUniformLocationARB)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetUniformfvARB))"\n"
-"\t"STUB_ASM_CODE("543")"\n"
-
-".globl "GLAPI_PREFIX_STR(GetUniformfv)"\n"
-".set "GLAPI_PREFIX_STR(GetUniformfv)", "GLAPI_PREFIX_STR(GetUniformfvARB)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetUniformivARB))"\n"
-"\t"STUB_ASM_CODE("544")"\n"
-
-".globl "GLAPI_PREFIX_STR(GetUniformiv)"\n"
-".set "GLAPI_PREFIX_STR(GetUniformiv)", "GLAPI_PREFIX_STR(GetUniformivARB)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(LinkProgramARB))"\n"
-"\t"STUB_ASM_CODE("545")"\n"
-
-".globl "GLAPI_PREFIX_STR(LinkProgram)"\n"
-".set "GLAPI_PREFIX_STR(LinkProgram)", "GLAPI_PREFIX_STR(LinkProgramARB)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(ShaderSourceARB))"\n"
-"\t"STUB_ASM_CODE("546")"\n"
-
-".globl "GLAPI_PREFIX_STR(ShaderSource)"\n"
-".set "GLAPI_PREFIX_STR(ShaderSource)", "GLAPI_PREFIX_STR(ShaderSourceARB)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Uniform1fARB))"\n"
-"\t"STUB_ASM_CODE("547")"\n"
-
-".globl "GLAPI_PREFIX_STR(Uniform1f)"\n"
-".set "GLAPI_PREFIX_STR(Uniform1f)", "GLAPI_PREFIX_STR(Uniform1fARB)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Uniform1fvARB))"\n"
-"\t"STUB_ASM_CODE("548")"\n"
-
-".globl "GLAPI_PREFIX_STR(Uniform1fv)"\n"
-".set "GLAPI_PREFIX_STR(Uniform1fv)", "GLAPI_PREFIX_STR(Uniform1fvARB)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Uniform1iARB))"\n"
-"\t"STUB_ASM_CODE("549")"\n"
-
-".globl "GLAPI_PREFIX_STR(Uniform1i)"\n"
-".set "GLAPI_PREFIX_STR(Uniform1i)", "GLAPI_PREFIX_STR(Uniform1iARB)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Uniform1ivARB))"\n"
-"\t"STUB_ASM_CODE("550")"\n"
-
-".globl "GLAPI_PREFIX_STR(Uniform1iv)"\n"
-".set "GLAPI_PREFIX_STR(Uniform1iv)", "GLAPI_PREFIX_STR(Uniform1ivARB)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Uniform2fARB))"\n"
-"\t"STUB_ASM_CODE("551")"\n"
-
-".globl "GLAPI_PREFIX_STR(Uniform2f)"\n"
-".set "GLAPI_PREFIX_STR(Uniform2f)", "GLAPI_PREFIX_STR(Uniform2fARB)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Uniform2fvARB))"\n"
-"\t"STUB_ASM_CODE("552")"\n"
-
-".globl "GLAPI_PREFIX_STR(Uniform2fv)"\n"
-".set "GLAPI_PREFIX_STR(Uniform2fv)", "GLAPI_PREFIX_STR(Uniform2fvARB)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Uniform2iARB))"\n"
-"\t"STUB_ASM_CODE("553")"\n"
-
-".globl "GLAPI_PREFIX_STR(Uniform2i)"\n"
-".set "GLAPI_PREFIX_STR(Uniform2i)", "GLAPI_PREFIX_STR(Uniform2iARB)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Uniform2ivARB))"\n"
-"\t"STUB_ASM_CODE("554")"\n"
-
-".globl "GLAPI_PREFIX_STR(Uniform2iv)"\n"
-".set "GLAPI_PREFIX_STR(Uniform2iv)", "GLAPI_PREFIX_STR(Uniform2ivARB)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Uniform3fARB))"\n"
-"\t"STUB_ASM_CODE("555")"\n"
-
-".globl "GLAPI_PREFIX_STR(Uniform3f)"\n"
-".set "GLAPI_PREFIX_STR(Uniform3f)", "GLAPI_PREFIX_STR(Uniform3fARB)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Uniform3fvARB))"\n"
-"\t"STUB_ASM_CODE("556")"\n"
-
-".globl "GLAPI_PREFIX_STR(Uniform3fv)"\n"
-".set "GLAPI_PREFIX_STR(Uniform3fv)", "GLAPI_PREFIX_STR(Uniform3fvARB)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Uniform3iARB))"\n"
-"\t"STUB_ASM_CODE("557")"\n"
-
-".globl "GLAPI_PREFIX_STR(Uniform3i)"\n"
-".set "GLAPI_PREFIX_STR(Uniform3i)", "GLAPI_PREFIX_STR(Uniform3iARB)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Uniform3ivARB))"\n"
-"\t"STUB_ASM_CODE("558")"\n"
-
-".globl "GLAPI_PREFIX_STR(Uniform3iv)"\n"
-".set "GLAPI_PREFIX_STR(Uniform3iv)", "GLAPI_PREFIX_STR(Uniform3ivARB)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Uniform4fARB))"\n"
-"\t"STUB_ASM_CODE("559")"\n"
-
-".globl "GLAPI_PREFIX_STR(Uniform4f)"\n"
-".set "GLAPI_PREFIX_STR(Uniform4f)", "GLAPI_PREFIX_STR(Uniform4fARB)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Uniform4fvARB))"\n"
-"\t"STUB_ASM_CODE("560")"\n"
-
-".globl "GLAPI_PREFIX_STR(Uniform4fv)"\n"
-".set "GLAPI_PREFIX_STR(Uniform4fv)", "GLAPI_PREFIX_STR(Uniform4fvARB)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Uniform4iARB))"\n"
-"\t"STUB_ASM_CODE("561")"\n"
-
-".globl "GLAPI_PREFIX_STR(Uniform4i)"\n"
-".set "GLAPI_PREFIX_STR(Uniform4i)", "GLAPI_PREFIX_STR(Uniform4iARB)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Uniform4ivARB))"\n"
-"\t"STUB_ASM_CODE("562")"\n"
-
-".globl "GLAPI_PREFIX_STR(Uniform4iv)"\n"
-".set "GLAPI_PREFIX_STR(Uniform4iv)", "GLAPI_PREFIX_STR(Uniform4ivARB)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(UniformMatrix2fvARB))"\n"
-"\t"STUB_ASM_CODE("563")"\n"
-
-".globl "GLAPI_PREFIX_STR(UniformMatrix2fv)"\n"
-".set "GLAPI_PREFIX_STR(UniformMatrix2fv)", "GLAPI_PREFIX_STR(UniformMatrix2fvARB)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(UniformMatrix3fvARB))"\n"
-"\t"STUB_ASM_CODE("564")"\n"
-
-".globl "GLAPI_PREFIX_STR(UniformMatrix3fv)"\n"
-".set "GLAPI_PREFIX_STR(UniformMatrix3fv)", "GLAPI_PREFIX_STR(UniformMatrix3fvARB)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(UniformMatrix4fvARB))"\n"
-"\t"STUB_ASM_CODE("565")"\n"
-
-".globl "GLAPI_PREFIX_STR(UniformMatrix4fv)"\n"
-".set "GLAPI_PREFIX_STR(UniformMatrix4fv)", "GLAPI_PREFIX_STR(UniformMatrix4fvARB)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(UseProgramObjectARB))"\n"
-"\t"STUB_ASM_CODE("566")"\n"
-
-".globl "GLAPI_PREFIX_STR(UseProgram)"\n"
-".set "GLAPI_PREFIX_STR(UseProgram)", "GLAPI_PREFIX_STR(UseProgramObjectARB)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(ValidateProgramARB))"\n"
-"\t"STUB_ASM_CODE("567")"\n"
-
-".globl "GLAPI_PREFIX_STR(ValidateProgram)"\n"
-".set "GLAPI_PREFIX_STR(ValidateProgram)", "GLAPI_PREFIX_STR(ValidateProgramARB)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(BindAttribLocationARB))"\n"
-"\t"STUB_ASM_CODE("568")"\n"
-
-".globl "GLAPI_PREFIX_STR(BindAttribLocation)"\n"
-".set "GLAPI_PREFIX_STR(BindAttribLocation)", "GLAPI_PREFIX_STR(BindAttribLocationARB)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetActiveAttribARB))"\n"
-"\t"STUB_ASM_CODE("569")"\n"
-
-".globl "GLAPI_PREFIX_STR(GetActiveAttrib)"\n"
-".set "GLAPI_PREFIX_STR(GetActiveAttrib)", "GLAPI_PREFIX_STR(GetActiveAttribARB)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetAttribLocationARB))"\n"
-"\t"STUB_ASM_CODE("570")"\n"
-
-".globl "GLAPI_PREFIX_STR(GetAttribLocation)"\n"
-".set "GLAPI_PREFIX_STR(GetAttribLocation)", "GLAPI_PREFIX_STR(GetAttribLocationARB)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(DrawBuffersARB))"\n"
-"\t"STUB_ASM_CODE("571")"\n"
-
-".globl "GLAPI_PREFIX_STR(DrawBuffers)"\n"
-".set "GLAPI_PREFIX_STR(DrawBuffers)", "GLAPI_PREFIX_STR(DrawBuffersARB)"\n"
-
-".globl "GLAPI_PREFIX_STR(DrawBuffersATI)"\n"
-".set "GLAPI_PREFIX_STR(DrawBuffersATI)", "GLAPI_PREFIX_STR(DrawBuffersARB)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(ClampColorARB))"\n"
-"\t"STUB_ASM_CODE("572")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(DrawArraysInstancedARB))"\n"
-"\t"STUB_ASM_CODE("573")"\n"
-
-".globl "GLAPI_PREFIX_STR(DrawArraysInstanced)"\n"
-".set "GLAPI_PREFIX_STR(DrawArraysInstanced)", "GLAPI_PREFIX_STR(DrawArraysInstancedARB)"\n"
-
-".globl "GLAPI_PREFIX_STR(DrawArraysInstancedEXT)"\n"
-".set "GLAPI_PREFIX_STR(DrawArraysInstancedEXT)", "GLAPI_PREFIX_STR(DrawArraysInstancedARB)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(DrawElementsInstancedARB))"\n"
-"\t"STUB_ASM_CODE("574")"\n"
-
-".globl "GLAPI_PREFIX_STR(DrawElementsInstanced)"\n"
-".set "GLAPI_PREFIX_STR(DrawElementsInstanced)", "GLAPI_PREFIX_STR(DrawElementsInstancedARB)"\n"
-
-".globl "GLAPI_PREFIX_STR(DrawElementsInstancedEXT)"\n"
-".set "GLAPI_PREFIX_STR(DrawElementsInstancedEXT)", "GLAPI_PREFIX_STR(DrawElementsInstancedARB)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(RenderbufferStorageMultisample))"\n"
-"\t"STUB_ASM_CODE("575")"\n"
-
-".globl "GLAPI_PREFIX_STR(RenderbufferStorageMultisampleEXT)"\n"
-".set "GLAPI_PREFIX_STR(RenderbufferStorageMultisampleEXT)", "GLAPI_PREFIX_STR(RenderbufferStorageMultisample)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(FramebufferTextureARB))"\n"
-"\t"STUB_ASM_CODE("576")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(FramebufferTextureFaceARB))"\n"
-"\t"STUB_ASM_CODE("577")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(ProgramParameteriARB))"\n"
-"\t"STUB_ASM_CODE("578")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttribDivisorARB))"\n"
-"\t"STUB_ASM_CODE("579")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(FlushMappedBufferRange))"\n"
-"\t"STUB_ASM_CODE("580")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(MapBufferRange))"\n"
-"\t"STUB_ASM_CODE("581")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(TexBufferARB))"\n"
-"\t"STUB_ASM_CODE("582")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(BindVertexArray))"\n"
-"\t"STUB_ASM_CODE("583")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GenVertexArrays))"\n"
-"\t"STUB_ASM_CODE("584")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(CopyBufferSubData))"\n"
-"\t"STUB_ASM_CODE("585")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(ClientWaitSync))"\n"
-"\t"STUB_ASM_CODE("586")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(DeleteSync))"\n"
-"\t"STUB_ASM_CODE("587")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(FenceSync))"\n"
-"\t"STUB_ASM_CODE("588")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetInteger64v))"\n"
-"\t"STUB_ASM_CODE("589")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetSynciv))"\n"
-"\t"STUB_ASM_CODE("590")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(IsSync))"\n"
-"\t"STUB_ASM_CODE("591")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(WaitSync))"\n"
-"\t"STUB_ASM_CODE("592")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(DrawElementsBaseVertex))"\n"
-"\t"STUB_ASM_CODE("593")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(DrawRangeElementsBaseVertex))"\n"
-"\t"STUB_ASM_CODE("594")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(MultiDrawElementsBaseVertex))"\n"
-"\t"STUB_ASM_CODE("595")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(BlendEquationSeparateiARB))"\n"
-"\t"STUB_ASM_CODE("596")"\n"
-
-".globl "GLAPI_PREFIX_STR(BlendEquationSeparateIndexedAMD)"\n"
-".set "GLAPI_PREFIX_STR(BlendEquationSeparateIndexedAMD)", "GLAPI_PREFIX_STR(BlendEquationSeparateiARB)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(BlendEquationiARB))"\n"
-"\t"STUB_ASM_CODE("597")"\n"
-
-".globl "GLAPI_PREFIX_STR(BlendEquationIndexedAMD)"\n"
-".set "GLAPI_PREFIX_STR(BlendEquationIndexedAMD)", "GLAPI_PREFIX_STR(BlendEquationiARB)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(BlendFuncSeparateiARB))"\n"
-"\t"STUB_ASM_CODE("598")"\n"
-
-".globl "GLAPI_PREFIX_STR(BlendFuncSeparateIndexedAMD)"\n"
-".set "GLAPI_PREFIX_STR(BlendFuncSeparateIndexedAMD)", "GLAPI_PREFIX_STR(BlendFuncSeparateiARB)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(BlendFunciARB))"\n"
-"\t"STUB_ASM_CODE("599")"\n"
-
-".globl "GLAPI_PREFIX_STR(BlendFuncIndexedAMD)"\n"
-".set "GLAPI_PREFIX_STR(BlendFuncIndexedAMD)", "GLAPI_PREFIX_STR(BlendFunciARB)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(BindSampler))"\n"
-"\t"STUB_ASM_CODE("600")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(DeleteSamplers))"\n"
-"\t"STUB_ASM_CODE("601")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GenSamplers))"\n"
-"\t"STUB_ASM_CODE("602")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetSamplerParameterIiv))"\n"
-"\t"STUB_ASM_CODE("603")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetSamplerParameterIuiv))"\n"
-"\t"STUB_ASM_CODE("604")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetSamplerParameterfv))"\n"
-"\t"STUB_ASM_CODE("605")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetSamplerParameteriv))"\n"
-"\t"STUB_ASM_CODE("606")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(IsSampler))"\n"
-"\t"STUB_ASM_CODE("607")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(SamplerParameterIiv))"\n"
-"\t"STUB_ASM_CODE("608")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(SamplerParameterIuiv))"\n"
-"\t"STUB_ASM_CODE("609")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(SamplerParameterf))"\n"
-"\t"STUB_ASM_CODE("610")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(SamplerParameterfv))"\n"
-"\t"STUB_ASM_CODE("611")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(SamplerParameteri))"\n"
-"\t"STUB_ASM_CODE("612")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(SamplerParameteriv))"\n"
-"\t"STUB_ASM_CODE("613")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(BindTransformFeedback))"\n"
-"\t"STUB_ASM_CODE("614")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(DeleteTransformFeedbacks))"\n"
-"\t"STUB_ASM_CODE("615")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(DrawTransformFeedback))"\n"
-"\t"STUB_ASM_CODE("616")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GenTransformFeedbacks))"\n"
-"\t"STUB_ASM_CODE("617")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(IsTransformFeedback))"\n"
-"\t"STUB_ASM_CODE("618")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(PauseTransformFeedback))"\n"
-"\t"STUB_ASM_CODE("619")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(ResumeTransformFeedback))"\n"
-"\t"STUB_ASM_CODE("620")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(ClearDepthf))"\n"
-"\t"STUB_ASM_CODE("621")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(DepthRangef))"\n"
-"\t"STUB_ASM_CODE("622")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetShaderPrecisionFormat))"\n"
-"\t"STUB_ASM_CODE("623")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(ReleaseShaderCompiler))"\n"
-"\t"STUB_ASM_CODE("624")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(ShaderBinary))"\n"
-"\t"STUB_ASM_CODE("625")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetGraphicsResetStatusARB))"\n"
-"\t"STUB_ASM_CODE("629")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetnColorTableARB))"\n"
-"\t"STUB_ASM_CODE("630")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetnCompressedTexImageARB))"\n"
-"\t"STUB_ASM_CODE("631")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetnConvolutionFilterARB))"\n"
-"\t"STUB_ASM_CODE("632")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetnHistogramARB))"\n"
-"\t"STUB_ASM_CODE("633")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetnMapdvARB))"\n"
-"\t"STUB_ASM_CODE("634")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetnMapfvARB))"\n"
-"\t"STUB_ASM_CODE("635")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetnMapivARB))"\n"
-"\t"STUB_ASM_CODE("636")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetnMinmaxARB))"\n"
-"\t"STUB_ASM_CODE("637")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetnPixelMapfvARB))"\n"
-"\t"STUB_ASM_CODE("638")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetnPixelMapuivARB))"\n"
-"\t"STUB_ASM_CODE("639")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetnPixelMapusvARB))"\n"
-"\t"STUB_ASM_CODE("640")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetnPolygonStippleARB))"\n"
-"\t"STUB_ASM_CODE("641")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetnSeparableFilterARB))"\n"
-"\t"STUB_ASM_CODE("642")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetnTexImageARB))"\n"
-"\t"STUB_ASM_CODE("643")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetnUniformdvARB))"\n"
-"\t"STUB_ASM_CODE("644")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetnUniformfvARB))"\n"
-"\t"STUB_ASM_CODE("645")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetnUniformivARB))"\n"
-"\t"STUB_ASM_CODE("646")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetnUniformuivARB))"\n"
-"\t"STUB_ASM_CODE("647")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(ReadnPixelsARB))"\n"
-"\t"STUB_ASM_CODE("648")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(PolygonOffsetEXT))"\n"
-"\t"STUB_ASM_CODE("649")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(ColorPointerEXT))"\n"
-"\t"STUB_ASM_CODE("668")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(EdgeFlagPointerEXT))"\n"
-"\t"STUB_ASM_CODE("669")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(IndexPointerEXT))"\n"
-"\t"STUB_ASM_CODE("670")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(NormalPointerEXT))"\n"
-"\t"STUB_ASM_CODE("671")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(TexCoordPointerEXT))"\n"
-"\t"STUB_ASM_CODE("672")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexPointerEXT))"\n"
-"\t"STUB_ASM_CODE("673")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(PointParameterfEXT))"\n"
-"\t"STUB_ASM_CODE("674")"\n"
-
-".globl "GLAPI_PREFIX_STR(PointParameterf)"\n"
-".set "GLAPI_PREFIX_STR(PointParameterf)", "GLAPI_PREFIX_STR(PointParameterfEXT)"\n"
-
-".globl "GLAPI_PREFIX_STR(PointParameterfARB)"\n"
-".set "GLAPI_PREFIX_STR(PointParameterfARB)", "GLAPI_PREFIX_STR(PointParameterfEXT)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(PointParameterfvEXT))"\n"
-"\t"STUB_ASM_CODE("675")"\n"
-
-".globl "GLAPI_PREFIX_STR(PointParameterfv)"\n"
-".set "GLAPI_PREFIX_STR(PointParameterfv)", "GLAPI_PREFIX_STR(PointParameterfvEXT)"\n"
-
-".globl "GLAPI_PREFIX_STR(PointParameterfvARB)"\n"
-".set "GLAPI_PREFIX_STR(PointParameterfvARB)", "GLAPI_PREFIX_STR(PointParameterfvEXT)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(LockArraysEXT))"\n"
-"\t"STUB_ASM_CODE("676")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(UnlockArraysEXT))"\n"
-"\t"STUB_ASM_CODE("677")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(SecondaryColor3bEXT))"\n"
-"\t"STUB_ASM_CODE("678")"\n"
-
-".globl "GLAPI_PREFIX_STR(SecondaryColor3b)"\n"
-".set "GLAPI_PREFIX_STR(SecondaryColor3b)", "GLAPI_PREFIX_STR(SecondaryColor3bEXT)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(SecondaryColor3bvEXT))"\n"
-"\t"STUB_ASM_CODE("679")"\n"
-
-".globl "GLAPI_PREFIX_STR(SecondaryColor3bv)"\n"
-".set "GLAPI_PREFIX_STR(SecondaryColor3bv)", "GLAPI_PREFIX_STR(SecondaryColor3bvEXT)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(SecondaryColor3dEXT))"\n"
-"\t"STUB_ASM_CODE("680")"\n"
-
-".globl "GLAPI_PREFIX_STR(SecondaryColor3d)"\n"
-".set "GLAPI_PREFIX_STR(SecondaryColor3d)", "GLAPI_PREFIX_STR(SecondaryColor3dEXT)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(SecondaryColor3dvEXT))"\n"
-"\t"STUB_ASM_CODE("681")"\n"
-
-".globl "GLAPI_PREFIX_STR(SecondaryColor3dv)"\n"
-".set "GLAPI_PREFIX_STR(SecondaryColor3dv)", "GLAPI_PREFIX_STR(SecondaryColor3dvEXT)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(SecondaryColor3fEXT))"\n"
-"\t"STUB_ASM_CODE("682")"\n"
-
-".globl "GLAPI_PREFIX_STR(SecondaryColor3f)"\n"
-".set "GLAPI_PREFIX_STR(SecondaryColor3f)", "GLAPI_PREFIX_STR(SecondaryColor3fEXT)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(SecondaryColor3fvEXT))"\n"
-"\t"STUB_ASM_CODE("683")"\n"
-
-".globl "GLAPI_PREFIX_STR(SecondaryColor3fv)"\n"
-".set "GLAPI_PREFIX_STR(SecondaryColor3fv)", "GLAPI_PREFIX_STR(SecondaryColor3fvEXT)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(SecondaryColor3iEXT))"\n"
-"\t"STUB_ASM_CODE("684")"\n"
-
-".globl "GLAPI_PREFIX_STR(SecondaryColor3i)"\n"
-".set "GLAPI_PREFIX_STR(SecondaryColor3i)", "GLAPI_PREFIX_STR(SecondaryColor3iEXT)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(SecondaryColor3ivEXT))"\n"
-"\t"STUB_ASM_CODE("685")"\n"
-
-".globl "GLAPI_PREFIX_STR(SecondaryColor3iv)"\n"
-".set "GLAPI_PREFIX_STR(SecondaryColor3iv)", "GLAPI_PREFIX_STR(SecondaryColor3ivEXT)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(SecondaryColor3sEXT))"\n"
-"\t"STUB_ASM_CODE("686")"\n"
-
-".globl "GLAPI_PREFIX_STR(SecondaryColor3s)"\n"
-".set "GLAPI_PREFIX_STR(SecondaryColor3s)", "GLAPI_PREFIX_STR(SecondaryColor3sEXT)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(SecondaryColor3svEXT))"\n"
-"\t"STUB_ASM_CODE("687")"\n"
-
-".globl "GLAPI_PREFIX_STR(SecondaryColor3sv)"\n"
-".set "GLAPI_PREFIX_STR(SecondaryColor3sv)", "GLAPI_PREFIX_STR(SecondaryColor3svEXT)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(SecondaryColor3ubEXT))"\n"
-"\t"STUB_ASM_CODE("688")"\n"
-
-".globl "GLAPI_PREFIX_STR(SecondaryColor3ub)"\n"
-".set "GLAPI_PREFIX_STR(SecondaryColor3ub)", "GLAPI_PREFIX_STR(SecondaryColor3ubEXT)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(SecondaryColor3ubvEXT))"\n"
-"\t"STUB_ASM_CODE("689")"\n"
-
-".globl "GLAPI_PREFIX_STR(SecondaryColor3ubv)"\n"
-".set "GLAPI_PREFIX_STR(SecondaryColor3ubv)", "GLAPI_PREFIX_STR(SecondaryColor3ubvEXT)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(SecondaryColor3uiEXT))"\n"
-"\t"STUB_ASM_CODE("690")"\n"
-
-".globl "GLAPI_PREFIX_STR(SecondaryColor3ui)"\n"
-".set "GLAPI_PREFIX_STR(SecondaryColor3ui)", "GLAPI_PREFIX_STR(SecondaryColor3uiEXT)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(SecondaryColor3uivEXT))"\n"
-"\t"STUB_ASM_CODE("691")"\n"
-
-".globl "GLAPI_PREFIX_STR(SecondaryColor3uiv)"\n"
-".set "GLAPI_PREFIX_STR(SecondaryColor3uiv)", "GLAPI_PREFIX_STR(SecondaryColor3uivEXT)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(SecondaryColor3usEXT))"\n"
-"\t"STUB_ASM_CODE("692")"\n"
-
-".globl "GLAPI_PREFIX_STR(SecondaryColor3us)"\n"
-".set "GLAPI_PREFIX_STR(SecondaryColor3us)", "GLAPI_PREFIX_STR(SecondaryColor3usEXT)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(SecondaryColor3usvEXT))"\n"
-"\t"STUB_ASM_CODE("693")"\n"
-
-".globl "GLAPI_PREFIX_STR(SecondaryColor3usv)"\n"
-".set "GLAPI_PREFIX_STR(SecondaryColor3usv)", "GLAPI_PREFIX_STR(SecondaryColor3usvEXT)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(SecondaryColorPointerEXT))"\n"
-"\t"STUB_ASM_CODE("694")"\n"
-
-".globl "GLAPI_PREFIX_STR(SecondaryColorPointer)"\n"
-".set "GLAPI_PREFIX_STR(SecondaryColorPointer)", "GLAPI_PREFIX_STR(SecondaryColorPointerEXT)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(MultiDrawArraysEXT))"\n"
-"\t"STUB_ASM_CODE("695")"\n"
-
-".globl "GLAPI_PREFIX_STR(MultiDrawArrays)"\n"
-".set "GLAPI_PREFIX_STR(MultiDrawArrays)", "GLAPI_PREFIX_STR(MultiDrawArraysEXT)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(MultiDrawElementsEXT))"\n"
-"\t"STUB_ASM_CODE("696")"\n"
-
-".globl "GLAPI_PREFIX_STR(MultiDrawElements)"\n"
-".set "GLAPI_PREFIX_STR(MultiDrawElements)", "GLAPI_PREFIX_STR(MultiDrawElementsEXT)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(FogCoordPointerEXT))"\n"
-"\t"STUB_ASM_CODE("697")"\n"
-
-".globl "GLAPI_PREFIX_STR(FogCoordPointer)"\n"
-".set "GLAPI_PREFIX_STR(FogCoordPointer)", "GLAPI_PREFIX_STR(FogCoordPointerEXT)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(FogCoorddEXT))"\n"
-"\t"STUB_ASM_CODE("698")"\n"
-
-".globl "GLAPI_PREFIX_STR(FogCoordd)"\n"
-".set "GLAPI_PREFIX_STR(FogCoordd)", "GLAPI_PREFIX_STR(FogCoorddEXT)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(FogCoorddvEXT))"\n"
-"\t"STUB_ASM_CODE("699")"\n"
-
-".globl "GLAPI_PREFIX_STR(FogCoorddv)"\n"
-".set "GLAPI_PREFIX_STR(FogCoorddv)", "GLAPI_PREFIX_STR(FogCoorddvEXT)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(FogCoordfEXT))"\n"
-"\t"STUB_ASM_CODE("700")"\n"
-
-".globl "GLAPI_PREFIX_STR(FogCoordf)"\n"
-".set "GLAPI_PREFIX_STR(FogCoordf)", "GLAPI_PREFIX_STR(FogCoordfEXT)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(FogCoordfvEXT))"\n"
-"\t"STUB_ASM_CODE("701")"\n"
-
-".globl "GLAPI_PREFIX_STR(FogCoordfv)"\n"
-".set "GLAPI_PREFIX_STR(FogCoordfv)", "GLAPI_PREFIX_STR(FogCoordfvEXT)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(BlendFuncSeparateEXT))"\n"
-"\t"STUB_ASM_CODE("703")"\n"
-
-".globl "GLAPI_PREFIX_STR(BlendFuncSeparate)"\n"
-".set "GLAPI_PREFIX_STR(BlendFuncSeparate)", "GLAPI_PREFIX_STR(BlendFuncSeparateEXT)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(FlushVertexArrayRangeNV))"\n"
-"\t"STUB_ASM_CODE("704")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexArrayRangeNV))"\n"
-"\t"STUB_ASM_CODE("705")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(CombinerInputNV))"\n"
-"\t"STUB_ASM_CODE("706")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(CombinerOutputNV))"\n"
-"\t"STUB_ASM_CODE("707")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(CombinerParameterfNV))"\n"
-"\t"STUB_ASM_CODE("708")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(CombinerParameterfvNV))"\n"
-"\t"STUB_ASM_CODE("709")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(CombinerParameteriNV))"\n"
-"\t"STUB_ASM_CODE("710")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(CombinerParameterivNV))"\n"
-"\t"STUB_ASM_CODE("711")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(FinalCombinerInputNV))"\n"
-"\t"STUB_ASM_CODE("712")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetCombinerInputParameterfvNV))"\n"
-"\t"STUB_ASM_CODE("713")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetCombinerInputParameterivNV))"\n"
-"\t"STUB_ASM_CODE("714")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetCombinerOutputParameterfvNV))"\n"
-"\t"STUB_ASM_CODE("715")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetCombinerOutputParameterivNV))"\n"
-"\t"STUB_ASM_CODE("716")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetFinalCombinerInputParameterfvNV))"\n"
-"\t"STUB_ASM_CODE("717")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetFinalCombinerInputParameterivNV))"\n"
-"\t"STUB_ASM_CODE("718")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(ResizeBuffersMESA))"\n"
-"\t"STUB_ASM_CODE("719")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(WindowPos2dMESA))"\n"
-"\t"STUB_ASM_CODE("720")"\n"
-
-".globl "GLAPI_PREFIX_STR(WindowPos2d)"\n"
-".set "GLAPI_PREFIX_STR(WindowPos2d)", "GLAPI_PREFIX_STR(WindowPos2dMESA)"\n"
-
-".globl "GLAPI_PREFIX_STR(WindowPos2dARB)"\n"
-".set "GLAPI_PREFIX_STR(WindowPos2dARB)", "GLAPI_PREFIX_STR(WindowPos2dMESA)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(WindowPos2dvMESA))"\n"
-"\t"STUB_ASM_CODE("721")"\n"
-
-".globl "GLAPI_PREFIX_STR(WindowPos2dv)"\n"
-".set "GLAPI_PREFIX_STR(WindowPos2dv)", "GLAPI_PREFIX_STR(WindowPos2dvMESA)"\n"
-
-".globl "GLAPI_PREFIX_STR(WindowPos2dvARB)"\n"
-".set "GLAPI_PREFIX_STR(WindowPos2dvARB)", "GLAPI_PREFIX_STR(WindowPos2dvMESA)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(WindowPos2fMESA))"\n"
-"\t"STUB_ASM_CODE("722")"\n"
-
-".globl "GLAPI_PREFIX_STR(WindowPos2f)"\n"
-".set "GLAPI_PREFIX_STR(WindowPos2f)", "GLAPI_PREFIX_STR(WindowPos2fMESA)"\n"
-
-".globl "GLAPI_PREFIX_STR(WindowPos2fARB)"\n"
-".set "GLAPI_PREFIX_STR(WindowPos2fARB)", "GLAPI_PREFIX_STR(WindowPos2fMESA)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(WindowPos2fvMESA))"\n"
-"\t"STUB_ASM_CODE("723")"\n"
-
-".globl "GLAPI_PREFIX_STR(WindowPos2fv)"\n"
-".set "GLAPI_PREFIX_STR(WindowPos2fv)", "GLAPI_PREFIX_STR(WindowPos2fvMESA)"\n"
-
-".globl "GLAPI_PREFIX_STR(WindowPos2fvARB)"\n"
-".set "GLAPI_PREFIX_STR(WindowPos2fvARB)", "GLAPI_PREFIX_STR(WindowPos2fvMESA)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(WindowPos2iMESA))"\n"
-"\t"STUB_ASM_CODE("724")"\n"
-
-".globl "GLAPI_PREFIX_STR(WindowPos2i)"\n"
-".set "GLAPI_PREFIX_STR(WindowPos2i)", "GLAPI_PREFIX_STR(WindowPos2iMESA)"\n"
-
-".globl "GLAPI_PREFIX_STR(WindowPos2iARB)"\n"
-".set "GLAPI_PREFIX_STR(WindowPos2iARB)", "GLAPI_PREFIX_STR(WindowPos2iMESA)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(WindowPos2ivMESA))"\n"
-"\t"STUB_ASM_CODE("725")"\n"
-
-".globl "GLAPI_PREFIX_STR(WindowPos2iv)"\n"
-".set "GLAPI_PREFIX_STR(WindowPos2iv)", "GLAPI_PREFIX_STR(WindowPos2ivMESA)"\n"
-
-".globl "GLAPI_PREFIX_STR(WindowPos2ivARB)"\n"
-".set "GLAPI_PREFIX_STR(WindowPos2ivARB)", "GLAPI_PREFIX_STR(WindowPos2ivMESA)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(WindowPos2sMESA))"\n"
-"\t"STUB_ASM_CODE("726")"\n"
-
-".globl "GLAPI_PREFIX_STR(WindowPos2s)"\n"
-".set "GLAPI_PREFIX_STR(WindowPos2s)", "GLAPI_PREFIX_STR(WindowPos2sMESA)"\n"
-
-".globl "GLAPI_PREFIX_STR(WindowPos2sARB)"\n"
-".set "GLAPI_PREFIX_STR(WindowPos2sARB)", "GLAPI_PREFIX_STR(WindowPos2sMESA)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(WindowPos2svMESA))"\n"
-"\t"STUB_ASM_CODE("727")"\n"
-
-".globl "GLAPI_PREFIX_STR(WindowPos2sv)"\n"
-".set "GLAPI_PREFIX_STR(WindowPos2sv)", "GLAPI_PREFIX_STR(WindowPos2svMESA)"\n"
-
-".globl "GLAPI_PREFIX_STR(WindowPos2svARB)"\n"
-".set "GLAPI_PREFIX_STR(WindowPos2svARB)", "GLAPI_PREFIX_STR(WindowPos2svMESA)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(WindowPos3dMESA))"\n"
-"\t"STUB_ASM_CODE("728")"\n"
-
-".globl "GLAPI_PREFIX_STR(WindowPos3d)"\n"
-".set "GLAPI_PREFIX_STR(WindowPos3d)", "GLAPI_PREFIX_STR(WindowPos3dMESA)"\n"
-
-".globl "GLAPI_PREFIX_STR(WindowPos3dARB)"\n"
-".set "GLAPI_PREFIX_STR(WindowPos3dARB)", "GLAPI_PREFIX_STR(WindowPos3dMESA)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(WindowPos3dvMESA))"\n"
-"\t"STUB_ASM_CODE("729")"\n"
-
-".globl "GLAPI_PREFIX_STR(WindowPos3dv)"\n"
-".set "GLAPI_PREFIX_STR(WindowPos3dv)", "GLAPI_PREFIX_STR(WindowPos3dvMESA)"\n"
-
-".globl "GLAPI_PREFIX_STR(WindowPos3dvARB)"\n"
-".set "GLAPI_PREFIX_STR(WindowPos3dvARB)", "GLAPI_PREFIX_STR(WindowPos3dvMESA)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(WindowPos3fMESA))"\n"
-"\t"STUB_ASM_CODE("730")"\n"
-
-".globl "GLAPI_PREFIX_STR(WindowPos3f)"\n"
-".set "GLAPI_PREFIX_STR(WindowPos3f)", "GLAPI_PREFIX_STR(WindowPos3fMESA)"\n"
-
-".globl "GLAPI_PREFIX_STR(WindowPos3fARB)"\n"
-".set "GLAPI_PREFIX_STR(WindowPos3fARB)", "GLAPI_PREFIX_STR(WindowPos3fMESA)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(WindowPos3fvMESA))"\n"
-"\t"STUB_ASM_CODE("731")"\n"
-
-".globl "GLAPI_PREFIX_STR(WindowPos3fv)"\n"
-".set "GLAPI_PREFIX_STR(WindowPos3fv)", "GLAPI_PREFIX_STR(WindowPos3fvMESA)"\n"
-
-".globl "GLAPI_PREFIX_STR(WindowPos3fvARB)"\n"
-".set "GLAPI_PREFIX_STR(WindowPos3fvARB)", "GLAPI_PREFIX_STR(WindowPos3fvMESA)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(WindowPos3iMESA))"\n"
-"\t"STUB_ASM_CODE("732")"\n"
-
-".globl "GLAPI_PREFIX_STR(WindowPos3i)"\n"
-".set "GLAPI_PREFIX_STR(WindowPos3i)", "GLAPI_PREFIX_STR(WindowPos3iMESA)"\n"
-
-".globl "GLAPI_PREFIX_STR(WindowPos3iARB)"\n"
-".set "GLAPI_PREFIX_STR(WindowPos3iARB)", "GLAPI_PREFIX_STR(WindowPos3iMESA)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(WindowPos3ivMESA))"\n"
-"\t"STUB_ASM_CODE("733")"\n"
-
-".globl "GLAPI_PREFIX_STR(WindowPos3iv)"\n"
-".set "GLAPI_PREFIX_STR(WindowPos3iv)", "GLAPI_PREFIX_STR(WindowPos3ivMESA)"\n"
-
-".globl "GLAPI_PREFIX_STR(WindowPos3ivARB)"\n"
-".set "GLAPI_PREFIX_STR(WindowPos3ivARB)", "GLAPI_PREFIX_STR(WindowPos3ivMESA)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(WindowPos3sMESA))"\n"
-"\t"STUB_ASM_CODE("734")"\n"
-
-".globl "GLAPI_PREFIX_STR(WindowPos3s)"\n"
-".set "GLAPI_PREFIX_STR(WindowPos3s)", "GLAPI_PREFIX_STR(WindowPos3sMESA)"\n"
-
-".globl "GLAPI_PREFIX_STR(WindowPos3sARB)"\n"
-".set "GLAPI_PREFIX_STR(WindowPos3sARB)", "GLAPI_PREFIX_STR(WindowPos3sMESA)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(WindowPos3svMESA))"\n"
-"\t"STUB_ASM_CODE("735")"\n"
-
-".globl "GLAPI_PREFIX_STR(WindowPos3sv)"\n"
-".set "GLAPI_PREFIX_STR(WindowPos3sv)", "GLAPI_PREFIX_STR(WindowPos3svMESA)"\n"
-
-".globl "GLAPI_PREFIX_STR(WindowPos3svARB)"\n"
-".set "GLAPI_PREFIX_STR(WindowPos3svARB)", "GLAPI_PREFIX_STR(WindowPos3svMESA)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(WindowPos4dMESA))"\n"
-"\t"STUB_ASM_CODE("736")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(WindowPos4dvMESA))"\n"
-"\t"STUB_ASM_CODE("737")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(WindowPos4fMESA))"\n"
-"\t"STUB_ASM_CODE("738")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(WindowPos4fvMESA))"\n"
-"\t"STUB_ASM_CODE("739")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(WindowPos4iMESA))"\n"
-"\t"STUB_ASM_CODE("740")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(WindowPos4ivMESA))"\n"
-"\t"STUB_ASM_CODE("741")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(WindowPos4sMESA))"\n"
-"\t"STUB_ASM_CODE("742")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(WindowPos4svMESA))"\n"
-"\t"STUB_ASM_CODE("743")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(AreProgramsResidentNV))"\n"
-"\t"STUB_ASM_CODE("753")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(BindProgramNV))"\n"
-"\t"STUB_ASM_CODE("754")"\n"
-
-".globl "GLAPI_PREFIX_STR(BindProgramARB)"\n"
-".set "GLAPI_PREFIX_STR(BindProgramARB)", "GLAPI_PREFIX_STR(BindProgramNV)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(DeleteProgramsNV))"\n"
-"\t"STUB_ASM_CODE("755")"\n"
-
-".globl "GLAPI_PREFIX_STR(DeleteProgramsARB)"\n"
-".set "GLAPI_PREFIX_STR(DeleteProgramsARB)", "GLAPI_PREFIX_STR(DeleteProgramsNV)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(ExecuteProgramNV))"\n"
-"\t"STUB_ASM_CODE("756")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GenProgramsNV))"\n"
-"\t"STUB_ASM_CODE("757")"\n"
-
-".globl "GLAPI_PREFIX_STR(GenProgramsARB)"\n"
-".set "GLAPI_PREFIX_STR(GenProgramsARB)", "GLAPI_PREFIX_STR(GenProgramsNV)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetProgramParameterdvNV))"\n"
-"\t"STUB_ASM_CODE("758")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetProgramParameterfvNV))"\n"
-"\t"STUB_ASM_CODE("759")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetProgramStringNV))"\n"
-"\t"STUB_ASM_CODE("760")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetProgramivNV))"\n"
-"\t"STUB_ASM_CODE("761")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetTrackMatrixivNV))"\n"
-"\t"STUB_ASM_CODE("762")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetVertexAttribPointervNV))"\n"
-"\t"STUB_ASM_CODE("763")"\n"
-
-".globl "GLAPI_PREFIX_STR(GetVertexAttribPointerv)"\n"
-".set "GLAPI_PREFIX_STR(GetVertexAttribPointerv)", "GLAPI_PREFIX_STR(GetVertexAttribPointervNV)"\n"
-
-".globl "GLAPI_PREFIX_STR(GetVertexAttribPointervARB)"\n"
-".set "GLAPI_PREFIX_STR(GetVertexAttribPointervARB)", "GLAPI_PREFIX_STR(GetVertexAttribPointervNV)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetVertexAttribdvNV))"\n"
-"\t"STUB_ASM_CODE("764")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetVertexAttribfvNV))"\n"
-"\t"STUB_ASM_CODE("765")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetVertexAttribivNV))"\n"
-"\t"STUB_ASM_CODE("766")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(IsProgramNV))"\n"
-"\t"STUB_ASM_CODE("767")"\n"
-
-".globl "GLAPI_PREFIX_STR(IsProgramARB)"\n"
-".set "GLAPI_PREFIX_STR(IsProgramARB)", "GLAPI_PREFIX_STR(IsProgramNV)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(LoadProgramNV))"\n"
-"\t"STUB_ASM_CODE("768")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(ProgramParameters4dvNV))"\n"
-"\t"STUB_ASM_CODE("769")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(ProgramParameters4fvNV))"\n"
-"\t"STUB_ASM_CODE("770")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(RequestResidentProgramsNV))"\n"
-"\t"STUB_ASM_CODE("771")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(TrackMatrixNV))"\n"
-"\t"STUB_ASM_CODE("772")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttrib1dNV))"\n"
-"\t"STUB_ASM_CODE("773")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttrib1dvNV))"\n"
-"\t"STUB_ASM_CODE("774")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttrib1fNV))"\n"
-"\t"STUB_ASM_CODE("775")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttrib1fvNV))"\n"
-"\t"STUB_ASM_CODE("776")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttrib1sNV))"\n"
-"\t"STUB_ASM_CODE("777")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttrib1svNV))"\n"
-"\t"STUB_ASM_CODE("778")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttrib2dNV))"\n"
-"\t"STUB_ASM_CODE("779")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttrib2dvNV))"\n"
-"\t"STUB_ASM_CODE("780")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttrib2fNV))"\n"
-"\t"STUB_ASM_CODE("781")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttrib2fvNV))"\n"
-"\t"STUB_ASM_CODE("782")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttrib2sNV))"\n"
-"\t"STUB_ASM_CODE("783")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttrib2svNV))"\n"
-"\t"STUB_ASM_CODE("784")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttrib3dNV))"\n"
-"\t"STUB_ASM_CODE("785")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttrib3dvNV))"\n"
-"\t"STUB_ASM_CODE("786")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttrib3fNV))"\n"
-"\t"STUB_ASM_CODE("787")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttrib3fvNV))"\n"
-"\t"STUB_ASM_CODE("788")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttrib3sNV))"\n"
-"\t"STUB_ASM_CODE("789")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttrib3svNV))"\n"
-"\t"STUB_ASM_CODE("790")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttrib4dNV))"\n"
-"\t"STUB_ASM_CODE("791")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttrib4dvNV))"\n"
-"\t"STUB_ASM_CODE("792")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttrib4fNV))"\n"
-"\t"STUB_ASM_CODE("793")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttrib4fvNV))"\n"
-"\t"STUB_ASM_CODE("794")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttrib4sNV))"\n"
-"\t"STUB_ASM_CODE("795")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttrib4svNV))"\n"
-"\t"STUB_ASM_CODE("796")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttrib4ubNV))"\n"
-"\t"STUB_ASM_CODE("797")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttrib4ubvNV))"\n"
-"\t"STUB_ASM_CODE("798")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttribPointerNV))"\n"
-"\t"STUB_ASM_CODE("799")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttribs1dvNV))"\n"
-"\t"STUB_ASM_CODE("800")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttribs1fvNV))"\n"
-"\t"STUB_ASM_CODE("801")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttribs1svNV))"\n"
-"\t"STUB_ASM_CODE("802")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttribs2dvNV))"\n"
-"\t"STUB_ASM_CODE("803")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttribs2fvNV))"\n"
-"\t"STUB_ASM_CODE("804")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttribs2svNV))"\n"
-"\t"STUB_ASM_CODE("805")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttribs3dvNV))"\n"
-"\t"STUB_ASM_CODE("806")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttribs3fvNV))"\n"
-"\t"STUB_ASM_CODE("807")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttribs3svNV))"\n"
-"\t"STUB_ASM_CODE("808")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttribs4dvNV))"\n"
-"\t"STUB_ASM_CODE("809")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttribs4fvNV))"\n"
-"\t"STUB_ASM_CODE("810")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttribs4svNV))"\n"
-"\t"STUB_ASM_CODE("811")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttribs4ubvNV))"\n"
-"\t"STUB_ASM_CODE("812")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetTexBumpParameterfvATI))"\n"
-"\t"STUB_ASM_CODE("813")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetTexBumpParameterivATI))"\n"
-"\t"STUB_ASM_CODE("814")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(TexBumpParameterfvATI))"\n"
-"\t"STUB_ASM_CODE("815")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(TexBumpParameterivATI))"\n"
-"\t"STUB_ASM_CODE("816")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(AlphaFragmentOp1ATI))"\n"
-"\t"STUB_ASM_CODE("817")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(AlphaFragmentOp2ATI))"\n"
-"\t"STUB_ASM_CODE("818")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(AlphaFragmentOp3ATI))"\n"
-"\t"STUB_ASM_CODE("819")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(BeginFragmentShaderATI))"\n"
-"\t"STUB_ASM_CODE("820")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(BindFragmentShaderATI))"\n"
-"\t"STUB_ASM_CODE("821")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(ColorFragmentOp1ATI))"\n"
-"\t"STUB_ASM_CODE("822")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(ColorFragmentOp2ATI))"\n"
-"\t"STUB_ASM_CODE("823")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(ColorFragmentOp3ATI))"\n"
-"\t"STUB_ASM_CODE("824")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(DeleteFragmentShaderATI))"\n"
-"\t"STUB_ASM_CODE("825")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(EndFragmentShaderATI))"\n"
-"\t"STUB_ASM_CODE("826")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GenFragmentShadersATI))"\n"
-"\t"STUB_ASM_CODE("827")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(PassTexCoordATI))"\n"
-"\t"STUB_ASM_CODE("828")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(SampleMapATI))"\n"
-"\t"STUB_ASM_CODE("829")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(SetFragmentShaderConstantATI))"\n"
-"\t"STUB_ASM_CODE("830")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(PointParameteriNV))"\n"
-"\t"STUB_ASM_CODE("831")"\n"
-
-".globl "GLAPI_PREFIX_STR(PointParameteri)"\n"
-".set "GLAPI_PREFIX_STR(PointParameteri)", "GLAPI_PREFIX_STR(PointParameteriNV)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(PointParameterivNV))"\n"
-"\t"STUB_ASM_CODE("832")"\n"
-
-".globl "GLAPI_PREFIX_STR(PointParameteriv)"\n"
-".set "GLAPI_PREFIX_STR(PointParameteriv)", "GLAPI_PREFIX_STR(PointParameterivNV)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(DeleteVertexArrays))"\n"
-"\t"STUB_ASM_CODE("835")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(IsVertexArray))"\n"
-"\t"STUB_ASM_CODE("837")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetProgramNamedParameterdvNV))"\n"
-"\t"STUB_ASM_CODE("838")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetProgramNamedParameterfvNV))"\n"
-"\t"STUB_ASM_CODE("839")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(ProgramNamedParameter4dNV))"\n"
-"\t"STUB_ASM_CODE("840")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(ProgramNamedParameter4dvNV))"\n"
-"\t"STUB_ASM_CODE("841")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(ProgramNamedParameter4fNV))"\n"
-"\t"STUB_ASM_CODE("842")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(ProgramNamedParameter4fvNV))"\n"
-"\t"STUB_ASM_CODE("843")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(PrimitiveRestartIndexNV))"\n"
-"\t"STUB_ASM_CODE("844")"\n"
-
-".globl "GLAPI_PREFIX_STR(PrimitiveRestartIndex)"\n"
-".set "GLAPI_PREFIX_STR(PrimitiveRestartIndex)", "GLAPI_PREFIX_STR(PrimitiveRestartIndexNV)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(PrimitiveRestartNV))"\n"
-"\t"STUB_ASM_CODE("845")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(BlendEquationSeparate))"\n"
-"\t"STUB_ASM_CODE("893")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(BindFramebufferEXT))"\n"
-"\t"STUB_ASM_CODE("894")"\n"
-
-".globl "GLAPI_PREFIX_STR(BindFramebuffer)"\n"
-".set "GLAPI_PREFIX_STR(BindFramebuffer)", "GLAPI_PREFIX_STR(BindFramebufferEXT)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(BindRenderbufferEXT))"\n"
-"\t"STUB_ASM_CODE("895")"\n"
-
-".globl "GLAPI_PREFIX_STR(BindRenderbuffer)"\n"
-".set "GLAPI_PREFIX_STR(BindRenderbuffer)", "GLAPI_PREFIX_STR(BindRenderbufferEXT)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(CheckFramebufferStatusEXT))"\n"
-"\t"STUB_ASM_CODE("896")"\n"
-
-".globl "GLAPI_PREFIX_STR(CheckFramebufferStatus)"\n"
-".set "GLAPI_PREFIX_STR(CheckFramebufferStatus)", "GLAPI_PREFIX_STR(CheckFramebufferStatusEXT)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(DeleteFramebuffersEXT))"\n"
-"\t"STUB_ASM_CODE("897")"\n"
-
-".globl "GLAPI_PREFIX_STR(DeleteFramebuffers)"\n"
-".set "GLAPI_PREFIX_STR(DeleteFramebuffers)", "GLAPI_PREFIX_STR(DeleteFramebuffersEXT)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(DeleteRenderbuffersEXT))"\n"
-"\t"STUB_ASM_CODE("898")"\n"
-
-".globl "GLAPI_PREFIX_STR(DeleteRenderbuffers)"\n"
-".set "GLAPI_PREFIX_STR(DeleteRenderbuffers)", "GLAPI_PREFIX_STR(DeleteRenderbuffersEXT)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(FramebufferRenderbufferEXT))"\n"
-"\t"STUB_ASM_CODE("899")"\n"
-
-".globl "GLAPI_PREFIX_STR(FramebufferRenderbuffer)"\n"
-".set "GLAPI_PREFIX_STR(FramebufferRenderbuffer)", "GLAPI_PREFIX_STR(FramebufferRenderbufferEXT)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(FramebufferTexture1DEXT))"\n"
-"\t"STUB_ASM_CODE("900")"\n"
-
-".globl "GLAPI_PREFIX_STR(FramebufferTexture1D)"\n"
-".set "GLAPI_PREFIX_STR(FramebufferTexture1D)", "GLAPI_PREFIX_STR(FramebufferTexture1DEXT)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(FramebufferTexture2DEXT))"\n"
-"\t"STUB_ASM_CODE("901")"\n"
-
-".globl "GLAPI_PREFIX_STR(FramebufferTexture2D)"\n"
-".set "GLAPI_PREFIX_STR(FramebufferTexture2D)", "GLAPI_PREFIX_STR(FramebufferTexture2DEXT)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(FramebufferTexture3DEXT))"\n"
-"\t"STUB_ASM_CODE("902")"\n"
-
-".globl "GLAPI_PREFIX_STR(FramebufferTexture3D)"\n"
-".set "GLAPI_PREFIX_STR(FramebufferTexture3D)", "GLAPI_PREFIX_STR(FramebufferTexture3DEXT)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GenFramebuffersEXT))"\n"
-"\t"STUB_ASM_CODE("903")"\n"
-
-".globl "GLAPI_PREFIX_STR(GenFramebuffers)"\n"
-".set "GLAPI_PREFIX_STR(GenFramebuffers)", "GLAPI_PREFIX_STR(GenFramebuffersEXT)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GenRenderbuffersEXT))"\n"
-"\t"STUB_ASM_CODE("904")"\n"
-
-".globl "GLAPI_PREFIX_STR(GenRenderbuffers)"\n"
-".set "GLAPI_PREFIX_STR(GenRenderbuffers)", "GLAPI_PREFIX_STR(GenRenderbuffersEXT)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GenerateMipmapEXT))"\n"
-"\t"STUB_ASM_CODE("905")"\n"
-
-".globl "GLAPI_PREFIX_STR(GenerateMipmap)"\n"
-".set "GLAPI_PREFIX_STR(GenerateMipmap)", "GLAPI_PREFIX_STR(GenerateMipmapEXT)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetFramebufferAttachmentParameterivEXT))"\n"
-"\t"STUB_ASM_CODE("906")"\n"
-
-".globl "GLAPI_PREFIX_STR(GetFramebufferAttachmentParameteriv)"\n"
-".set "GLAPI_PREFIX_STR(GetFramebufferAttachmentParameteriv)", "GLAPI_PREFIX_STR(GetFramebufferAttachmentParameterivEXT)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetRenderbufferParameterivEXT))"\n"
-"\t"STUB_ASM_CODE("907")"\n"
-
-".globl "GLAPI_PREFIX_STR(GetRenderbufferParameteriv)"\n"
-".set "GLAPI_PREFIX_STR(GetRenderbufferParameteriv)", "GLAPI_PREFIX_STR(GetRenderbufferParameterivEXT)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(IsFramebufferEXT))"\n"
-"\t"STUB_ASM_CODE("908")"\n"
-
-".globl "GLAPI_PREFIX_STR(IsFramebuffer)"\n"
-".set "GLAPI_PREFIX_STR(IsFramebuffer)", "GLAPI_PREFIX_STR(IsFramebufferEXT)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(IsRenderbufferEXT))"\n"
-"\t"STUB_ASM_CODE("909")"\n"
-
-".globl "GLAPI_PREFIX_STR(IsRenderbuffer)"\n"
-".set "GLAPI_PREFIX_STR(IsRenderbuffer)", "GLAPI_PREFIX_STR(IsRenderbufferEXT)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(RenderbufferStorageEXT))"\n"
-"\t"STUB_ASM_CODE("910")"\n"
-
-".globl "GLAPI_PREFIX_STR(RenderbufferStorage)"\n"
-".set "GLAPI_PREFIX_STR(RenderbufferStorage)", "GLAPI_PREFIX_STR(RenderbufferStorageEXT)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(BlitFramebuffer))"\n"
-"\t"STUB_ASM_CODE("911")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(BindFragDataLocationEXT))"\n"
-"\t"STUB_ASM_CODE("914")"\n"
-
-".globl "GLAPI_PREFIX_STR(BindFragDataLocation)"\n"
-".set "GLAPI_PREFIX_STR(BindFragDataLocation)", "GLAPI_PREFIX_STR(BindFragDataLocationEXT)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetFragDataLocationEXT))"\n"
-"\t"STUB_ASM_CODE("915")"\n"
-
-".globl "GLAPI_PREFIX_STR(GetFragDataLocation)"\n"
-".set "GLAPI_PREFIX_STR(GetFragDataLocation)", "GLAPI_PREFIX_STR(GetFragDataLocationEXT)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetUniformuivEXT))"\n"
-"\t"STUB_ASM_CODE("916")"\n"
-
-".globl "GLAPI_PREFIX_STR(GetUniformuiv)"\n"
-".set "GLAPI_PREFIX_STR(GetUniformuiv)", "GLAPI_PREFIX_STR(GetUniformuivEXT)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetVertexAttribIivEXT))"\n"
-"\t"STUB_ASM_CODE("917")"\n"
-
-".globl "GLAPI_PREFIX_STR(GetVertexAttribIiv)"\n"
-".set "GLAPI_PREFIX_STR(GetVertexAttribIiv)", "GLAPI_PREFIX_STR(GetVertexAttribIivEXT)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetVertexAttribIuivEXT))"\n"
-"\t"STUB_ASM_CODE("918")"\n"
-
-".globl "GLAPI_PREFIX_STR(GetVertexAttribIuiv)"\n"
-".set "GLAPI_PREFIX_STR(GetVertexAttribIuiv)", "GLAPI_PREFIX_STR(GetVertexAttribIuivEXT)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Uniform1uiEXT))"\n"
-"\t"STUB_ASM_CODE("919")"\n"
-
-".globl "GLAPI_PREFIX_STR(Uniform1ui)"\n"
-".set "GLAPI_PREFIX_STR(Uniform1ui)", "GLAPI_PREFIX_STR(Uniform1uiEXT)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Uniform1uivEXT))"\n"
-"\t"STUB_ASM_CODE("920")"\n"
-
-".globl "GLAPI_PREFIX_STR(Uniform1uiv)"\n"
-".set "GLAPI_PREFIX_STR(Uniform1uiv)", "GLAPI_PREFIX_STR(Uniform1uivEXT)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Uniform2uiEXT))"\n"
-"\t"STUB_ASM_CODE("921")"\n"
-
-".globl "GLAPI_PREFIX_STR(Uniform2ui)"\n"
-".set "GLAPI_PREFIX_STR(Uniform2ui)", "GLAPI_PREFIX_STR(Uniform2uiEXT)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Uniform2uivEXT))"\n"
-"\t"STUB_ASM_CODE("922")"\n"
-
-".globl "GLAPI_PREFIX_STR(Uniform2uiv)"\n"
-".set "GLAPI_PREFIX_STR(Uniform2uiv)", "GLAPI_PREFIX_STR(Uniform2uivEXT)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Uniform3uiEXT))"\n"
-"\t"STUB_ASM_CODE("923")"\n"
-
-".globl "GLAPI_PREFIX_STR(Uniform3ui)"\n"
-".set "GLAPI_PREFIX_STR(Uniform3ui)", "GLAPI_PREFIX_STR(Uniform3uiEXT)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Uniform3uivEXT))"\n"
-"\t"STUB_ASM_CODE("924")"\n"
-
-".globl "GLAPI_PREFIX_STR(Uniform3uiv)"\n"
-".set "GLAPI_PREFIX_STR(Uniform3uiv)", "GLAPI_PREFIX_STR(Uniform3uivEXT)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Uniform4uiEXT))"\n"
-"\t"STUB_ASM_CODE("925")"\n"
-
-".globl "GLAPI_PREFIX_STR(Uniform4ui)"\n"
-".set "GLAPI_PREFIX_STR(Uniform4ui)", "GLAPI_PREFIX_STR(Uniform4uiEXT)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Uniform4uivEXT))"\n"
-"\t"STUB_ASM_CODE("926")"\n"
-
-".globl "GLAPI_PREFIX_STR(Uniform4uiv)"\n"
-".set "GLAPI_PREFIX_STR(Uniform4uiv)", "GLAPI_PREFIX_STR(Uniform4uivEXT)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttribI1iEXT))"\n"
-"\t"STUB_ASM_CODE("927")"\n"
-
-".globl "GLAPI_PREFIX_STR(VertexAttribI1i)"\n"
-".set "GLAPI_PREFIX_STR(VertexAttribI1i)", "GLAPI_PREFIX_STR(VertexAttribI1iEXT)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttribI1ivEXT))"\n"
-"\t"STUB_ASM_CODE("928")"\n"
-
-".globl "GLAPI_PREFIX_STR(VertexAttribI1iv)"\n"
-".set "GLAPI_PREFIX_STR(VertexAttribI1iv)", "GLAPI_PREFIX_STR(VertexAttribI1ivEXT)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttribI1uiEXT))"\n"
-"\t"STUB_ASM_CODE("929")"\n"
-
-".globl "GLAPI_PREFIX_STR(VertexAttribI1ui)"\n"
-".set "GLAPI_PREFIX_STR(VertexAttribI1ui)", "GLAPI_PREFIX_STR(VertexAttribI1uiEXT)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttribI1uivEXT))"\n"
-"\t"STUB_ASM_CODE("930")"\n"
-
-".globl "GLAPI_PREFIX_STR(VertexAttribI1uiv)"\n"
-".set "GLAPI_PREFIX_STR(VertexAttribI1uiv)", "GLAPI_PREFIX_STR(VertexAttribI1uivEXT)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttribI2iEXT))"\n"
-"\t"STUB_ASM_CODE("931")"\n"
-
-".globl "GLAPI_PREFIX_STR(VertexAttribI2i)"\n"
-".set "GLAPI_PREFIX_STR(VertexAttribI2i)", "GLAPI_PREFIX_STR(VertexAttribI2iEXT)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttribI2ivEXT))"\n"
-"\t"STUB_ASM_CODE("932")"\n"
-
-".globl "GLAPI_PREFIX_STR(VertexAttribI2iv)"\n"
-".set "GLAPI_PREFIX_STR(VertexAttribI2iv)", "GLAPI_PREFIX_STR(VertexAttribI2ivEXT)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttribI2uiEXT))"\n"
-"\t"STUB_ASM_CODE("933")"\n"
-
-".globl "GLAPI_PREFIX_STR(VertexAttribI2ui)"\n"
-".set "GLAPI_PREFIX_STR(VertexAttribI2ui)", "GLAPI_PREFIX_STR(VertexAttribI2uiEXT)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttribI2uivEXT))"\n"
-"\t"STUB_ASM_CODE("934")"\n"
-
-".globl "GLAPI_PREFIX_STR(VertexAttribI2uiv)"\n"
-".set "GLAPI_PREFIX_STR(VertexAttribI2uiv)", "GLAPI_PREFIX_STR(VertexAttribI2uivEXT)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttribI3iEXT))"\n"
-"\t"STUB_ASM_CODE("935")"\n"
-
-".globl "GLAPI_PREFIX_STR(VertexAttribI3i)"\n"
-".set "GLAPI_PREFIX_STR(VertexAttribI3i)", "GLAPI_PREFIX_STR(VertexAttribI3iEXT)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttribI3ivEXT))"\n"
-"\t"STUB_ASM_CODE("936")"\n"
-
-".globl "GLAPI_PREFIX_STR(VertexAttribI3iv)"\n"
-".set "GLAPI_PREFIX_STR(VertexAttribI3iv)", "GLAPI_PREFIX_STR(VertexAttribI3ivEXT)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttribI3uiEXT))"\n"
-"\t"STUB_ASM_CODE("937")"\n"
-
-".globl "GLAPI_PREFIX_STR(VertexAttribI3ui)"\n"
-".set "GLAPI_PREFIX_STR(VertexAttribI3ui)", "GLAPI_PREFIX_STR(VertexAttribI3uiEXT)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttribI3uivEXT))"\n"
-"\t"STUB_ASM_CODE("938")"\n"
-
-".globl "GLAPI_PREFIX_STR(VertexAttribI3uiv)"\n"
-".set "GLAPI_PREFIX_STR(VertexAttribI3uiv)", "GLAPI_PREFIX_STR(VertexAttribI3uivEXT)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttribI4bvEXT))"\n"
-"\t"STUB_ASM_CODE("939")"\n"
-
-".globl "GLAPI_PREFIX_STR(VertexAttribI4bv)"\n"
-".set "GLAPI_PREFIX_STR(VertexAttribI4bv)", "GLAPI_PREFIX_STR(VertexAttribI4bvEXT)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttribI4iEXT))"\n"
-"\t"STUB_ASM_CODE("940")"\n"
-
-".globl "GLAPI_PREFIX_STR(VertexAttribI4i)"\n"
-".set "GLAPI_PREFIX_STR(VertexAttribI4i)", "GLAPI_PREFIX_STR(VertexAttribI4iEXT)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttribI4ivEXT))"\n"
-"\t"STUB_ASM_CODE("941")"\n"
-
-".globl "GLAPI_PREFIX_STR(VertexAttribI4iv)"\n"
-".set "GLAPI_PREFIX_STR(VertexAttribI4iv)", "GLAPI_PREFIX_STR(VertexAttribI4ivEXT)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttribI4svEXT))"\n"
-"\t"STUB_ASM_CODE("942")"\n"
-
-".globl "GLAPI_PREFIX_STR(VertexAttribI4sv)"\n"
-".set "GLAPI_PREFIX_STR(VertexAttribI4sv)", "GLAPI_PREFIX_STR(VertexAttribI4svEXT)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttribI4ubvEXT))"\n"
-"\t"STUB_ASM_CODE("943")"\n"
-
-".globl "GLAPI_PREFIX_STR(VertexAttribI4ubv)"\n"
-".set "GLAPI_PREFIX_STR(VertexAttribI4ubv)", "GLAPI_PREFIX_STR(VertexAttribI4ubvEXT)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttribI4uiEXT))"\n"
-"\t"STUB_ASM_CODE("944")"\n"
-
-".globl "GLAPI_PREFIX_STR(VertexAttribI4ui)"\n"
-".set "GLAPI_PREFIX_STR(VertexAttribI4ui)", "GLAPI_PREFIX_STR(VertexAttribI4uiEXT)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttribI4uivEXT))"\n"
-"\t"STUB_ASM_CODE("945")"\n"
-
-".globl "GLAPI_PREFIX_STR(VertexAttribI4uiv)"\n"
-".set "GLAPI_PREFIX_STR(VertexAttribI4uiv)", "GLAPI_PREFIX_STR(VertexAttribI4uivEXT)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttribI4usvEXT))"\n"
-"\t"STUB_ASM_CODE("946")"\n"
-
-".globl "GLAPI_PREFIX_STR(VertexAttribI4usv)"\n"
-".set "GLAPI_PREFIX_STR(VertexAttribI4usv)", "GLAPI_PREFIX_STR(VertexAttribI4usvEXT)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttribIPointerEXT))"\n"
-"\t"STUB_ASM_CODE("947")"\n"
-
-".globl "GLAPI_PREFIX_STR(VertexAttribIPointer)"\n"
-".set "GLAPI_PREFIX_STR(VertexAttribIPointer)", "GLAPI_PREFIX_STR(VertexAttribIPointerEXT)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(FramebufferTextureLayerEXT))"\n"
-"\t"STUB_ASM_CODE("948")"\n"
-
-".globl "GLAPI_PREFIX_STR(FramebufferTextureLayer)"\n"
-".set "GLAPI_PREFIX_STR(FramebufferTextureLayer)", "GLAPI_PREFIX_STR(FramebufferTextureLayerEXT)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(ColorMaskIndexedEXT))"\n"
-"\t"STUB_ASM_CODE("949")"\n"
-
-".globl "GLAPI_PREFIX_STR(ColorMaski)"\n"
-".set "GLAPI_PREFIX_STR(ColorMaski)", "GLAPI_PREFIX_STR(ColorMaskIndexedEXT)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(DisableIndexedEXT))"\n"
-"\t"STUB_ASM_CODE("950")"\n"
-
-".globl "GLAPI_PREFIX_STR(Disablei)"\n"
-".set "GLAPI_PREFIX_STR(Disablei)", "GLAPI_PREFIX_STR(DisableIndexedEXT)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(EnableIndexedEXT))"\n"
-"\t"STUB_ASM_CODE("951")"\n"
-
-".globl "GLAPI_PREFIX_STR(Enablei)"\n"
-".set "GLAPI_PREFIX_STR(Enablei)", "GLAPI_PREFIX_STR(EnableIndexedEXT)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetBooleanIndexedvEXT))"\n"
-"\t"STUB_ASM_CODE("952")"\n"
-
-".globl "GLAPI_PREFIX_STR(GetBooleani_v)"\n"
-".set "GLAPI_PREFIX_STR(GetBooleani_v)", "GLAPI_PREFIX_STR(GetBooleanIndexedvEXT)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetIntegerIndexedvEXT))"\n"
-"\t"STUB_ASM_CODE("953")"\n"
-
-".globl "GLAPI_PREFIX_STR(GetIntegeri_v)"\n"
-".set "GLAPI_PREFIX_STR(GetIntegeri_v)", "GLAPI_PREFIX_STR(GetIntegerIndexedvEXT)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(IsEnabledIndexedEXT))"\n"
-"\t"STUB_ASM_CODE("954")"\n"
-
-".globl "GLAPI_PREFIX_STR(IsEnabledi)"\n"
-".set "GLAPI_PREFIX_STR(IsEnabledi)", "GLAPI_PREFIX_STR(IsEnabledIndexedEXT)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(ClearColorIiEXT))"\n"
-"\t"STUB_ASM_CODE("955")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(ClearColorIuiEXT))"\n"
-"\t"STUB_ASM_CODE("956")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetTexParameterIivEXT))"\n"
-"\t"STUB_ASM_CODE("957")"\n"
-
-".globl "GLAPI_PREFIX_STR(GetTexParameterIiv)"\n"
-".set "GLAPI_PREFIX_STR(GetTexParameterIiv)", "GLAPI_PREFIX_STR(GetTexParameterIivEXT)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetTexParameterIuivEXT))"\n"
-"\t"STUB_ASM_CODE("958")"\n"
-
-".globl "GLAPI_PREFIX_STR(GetTexParameterIuiv)"\n"
-".set "GLAPI_PREFIX_STR(GetTexParameterIuiv)", "GLAPI_PREFIX_STR(GetTexParameterIuivEXT)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(TexParameterIivEXT))"\n"
-"\t"STUB_ASM_CODE("959")"\n"
-
-".globl "GLAPI_PREFIX_STR(TexParameterIiv)"\n"
-".set "GLAPI_PREFIX_STR(TexParameterIiv)", "GLAPI_PREFIX_STR(TexParameterIivEXT)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(TexParameterIuivEXT))"\n"
-"\t"STUB_ASM_CODE("960")"\n"
-
-".globl "GLAPI_PREFIX_STR(TexParameterIuiv)"\n"
-".set "GLAPI_PREFIX_STR(TexParameterIuiv)", "GLAPI_PREFIX_STR(TexParameterIuivEXT)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(BeginConditionalRenderNV))"\n"
-"\t"STUB_ASM_CODE("961")"\n"
-
-".globl "GLAPI_PREFIX_STR(BeginConditionalRender)"\n"
-".set "GLAPI_PREFIX_STR(BeginConditionalRender)", "GLAPI_PREFIX_STR(BeginConditionalRenderNV)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(EndConditionalRenderNV))"\n"
-"\t"STUB_ASM_CODE("962")"\n"
-
-".globl "GLAPI_PREFIX_STR(EndConditionalRender)"\n"
-".set "GLAPI_PREFIX_STR(EndConditionalRender)", "GLAPI_PREFIX_STR(EndConditionalRenderNV)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(BeginTransformFeedbackEXT))"\n"
-"\t"STUB_ASM_CODE("963")"\n"
-
-".globl "GLAPI_PREFIX_STR(BeginTransformFeedback)"\n"
-".set "GLAPI_PREFIX_STR(BeginTransformFeedback)", "GLAPI_PREFIX_STR(BeginTransformFeedbackEXT)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(BindBufferBaseEXT))"\n"
-"\t"STUB_ASM_CODE("964")"\n"
-
-".globl "GLAPI_PREFIX_STR(BindBufferBase)"\n"
-".set "GLAPI_PREFIX_STR(BindBufferBase)", "GLAPI_PREFIX_STR(BindBufferBaseEXT)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(BindBufferOffsetEXT))"\n"
-"\t"STUB_ASM_CODE("965")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(BindBufferRangeEXT))"\n"
-"\t"STUB_ASM_CODE("966")"\n"
-
-".globl "GLAPI_PREFIX_STR(BindBufferRange)"\n"
-".set "GLAPI_PREFIX_STR(BindBufferRange)", "GLAPI_PREFIX_STR(BindBufferRangeEXT)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(EndTransformFeedbackEXT))"\n"
-"\t"STUB_ASM_CODE("967")"\n"
-
-".globl "GLAPI_PREFIX_STR(EndTransformFeedback)"\n"
-".set "GLAPI_PREFIX_STR(EndTransformFeedback)", "GLAPI_PREFIX_STR(EndTransformFeedbackEXT)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetTransformFeedbackVaryingEXT))"\n"
-"\t"STUB_ASM_CODE("968")"\n"
-
-".globl "GLAPI_PREFIX_STR(GetTransformFeedbackVarying)"\n"
-".set "GLAPI_PREFIX_STR(GetTransformFeedbackVarying)", "GLAPI_PREFIX_STR(GetTransformFeedbackVaryingEXT)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(TransformFeedbackVaryingsEXT))"\n"
-"\t"STUB_ASM_CODE("969")"\n"
-
-".globl "GLAPI_PREFIX_STR(TransformFeedbackVaryings)"\n"
-".set "GLAPI_PREFIX_STR(TransformFeedbackVaryings)", "GLAPI_PREFIX_STR(TransformFeedbackVaryingsEXT)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(ProvokingVertexEXT))"\n"
-"\t"STUB_ASM_CODE("970")"\n"
-
-".globl "GLAPI_PREFIX_STR(ProvokingVertex)"\n"
-".set "GLAPI_PREFIX_STR(ProvokingVertex)", "GLAPI_PREFIX_STR(ProvokingVertexEXT)"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetObjectParameterivAPPLE))"\n"
-"\t"STUB_ASM_CODE("973")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(ObjectPurgeableAPPLE))"\n"
-"\t"STUB_ASM_CODE("974")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(ObjectUnpurgeableAPPLE))"\n"
-"\t"STUB_ASM_CODE("975")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(ActiveProgramEXT))"\n"
-"\t"STUB_ASM_CODE("976")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(CreateShaderProgramEXT))"\n"
-"\t"STUB_ASM_CODE("977")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(UseShaderProgramEXT))"\n"
-"\t"STUB_ASM_CODE("978")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(TextureBarrierNV))"\n"
-"\t"STUB_ASM_CODE("979")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(EGLImageTargetRenderbufferStorageOES))"\n"
-"\t"STUB_ASM_CODE("985")"\n"
-
-STUB_ASM_ENTRY(GLAPI_PREFIX_STR(EGLImageTargetTexture2DOES))"\n"
-"\t"STUB_ASM_CODE("986")"\n"
-
-);
-#undef MAPI_TMP_STUB_ASM_GCC_NO_HIDDEN
-#endif /* MAPI_TMP_STUB_ASM_GCC_NO_HIDDEN */
+/* This file is automatically generated by mapi_abi.py. Do not modify. */
+
+#ifndef _GLAPI_TMP_H_
+#define _GLAPI_TMP_H_
+#ifdef USE_MGL_NAMESPACE
+#define GLAPI_PREFIX(func) mgl##func
+#define GLAPI_PREFIX_STR(func) "mgl"#func
+#else
+#define GLAPI_PREFIX(func) gl##func
+#define GLAPI_PREFIX_STR(func) "gl"#func
+#endif /* USE_MGL_NAMESPACE */
+
+typedef int GLfixed;
+typedef int GLclampx;
+#endif /* _GLAPI_TMP_H_ */
+
+#ifdef MAPI_TMP_DEFINES
+#define GL_GLEXT_PROTOTYPES
+#include "GL/gl.h"
+#include "GL/glext.h"
+
+GLAPI void APIENTRY GLAPI_PREFIX(NewList)(GLuint list, GLenum mode);
+GLAPI void APIENTRY GLAPI_PREFIX(EndList)(void);
+GLAPI void APIENTRY GLAPI_PREFIX(CallList)(GLuint list);
+GLAPI void APIENTRY GLAPI_PREFIX(CallLists)(GLsizei n, GLenum type, const GLvoid *lists);
+GLAPI void APIENTRY GLAPI_PREFIX(DeleteLists)(GLuint list, GLsizei range);
+GLAPI GLuint APIENTRY GLAPI_PREFIX(GenLists)(GLsizei range);
+GLAPI void APIENTRY GLAPI_PREFIX(ListBase)(GLuint base);
+GLAPI void APIENTRY GLAPI_PREFIX(Begin)(GLenum mode);
+GLAPI void APIENTRY GLAPI_PREFIX(Bitmap)(GLsizei width, GLsizei height, GLfloat xorig, GLfloat yorig, GLfloat xmove, GLfloat ymove, const GLubyte *bitmap);
+GLAPI void APIENTRY GLAPI_PREFIX(Color3b)(GLbyte red, GLbyte green, GLbyte blue);
+GLAPI void APIENTRY GLAPI_PREFIX(Color3bv)(const GLbyte *v);
+GLAPI void APIENTRY GLAPI_PREFIX(Color3d)(GLdouble red, GLdouble green, GLdouble blue);
+GLAPI void APIENTRY GLAPI_PREFIX(Color3dv)(const GLdouble *v);
+GLAPI void APIENTRY GLAPI_PREFIX(Color3f)(GLfloat red, GLfloat green, GLfloat blue);
+GLAPI void APIENTRY GLAPI_PREFIX(Color3fv)(const GLfloat *v);
+GLAPI void APIENTRY GLAPI_PREFIX(Color3i)(GLint red, GLint green, GLint blue);
+GLAPI void APIENTRY GLAPI_PREFIX(Color3iv)(const GLint *v);
+GLAPI void APIENTRY GLAPI_PREFIX(Color3s)(GLshort red, GLshort green, GLshort blue);
+GLAPI void APIENTRY GLAPI_PREFIX(Color3sv)(const GLshort *v);
+GLAPI void APIENTRY GLAPI_PREFIX(Color3ub)(GLubyte red, GLubyte green, GLubyte blue);
+GLAPI void APIENTRY GLAPI_PREFIX(Color3ubv)(const GLubyte *v);
+GLAPI void APIENTRY GLAPI_PREFIX(Color3ui)(GLuint red, GLuint green, GLuint blue);
+GLAPI void APIENTRY GLAPI_PREFIX(Color3uiv)(const GLuint *v);
+GLAPI void APIENTRY GLAPI_PREFIX(Color3us)(GLushort red, GLushort green, GLushort blue);
+GLAPI void APIENTRY GLAPI_PREFIX(Color3usv)(const GLushort *v);
+GLAPI void APIENTRY GLAPI_PREFIX(Color4b)(GLbyte red, GLbyte green, GLbyte blue, GLbyte alpha);
+GLAPI void APIENTRY GLAPI_PREFIX(Color4bv)(const GLbyte *v);
+GLAPI void APIENTRY GLAPI_PREFIX(Color4d)(GLdouble red, GLdouble green, GLdouble blue, GLdouble alpha);
+GLAPI void APIENTRY GLAPI_PREFIX(Color4dv)(const GLdouble *v);
+GLAPI void APIENTRY GLAPI_PREFIX(Color4f)(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
+GLAPI void APIENTRY GLAPI_PREFIX(Color4fv)(const GLfloat *v);
+GLAPI void APIENTRY GLAPI_PREFIX(Color4i)(GLint red, GLint green, GLint blue, GLint alpha);
+GLAPI void APIENTRY GLAPI_PREFIX(Color4iv)(const GLint *v);
+GLAPI void APIENTRY GLAPI_PREFIX(Color4s)(GLshort red, GLshort green, GLshort blue, GLshort alpha);
+GLAPI void APIENTRY GLAPI_PREFIX(Color4sv)(const GLshort *v);
+GLAPI void APIENTRY GLAPI_PREFIX(Color4ub)(GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha);
+GLAPI void APIENTRY GLAPI_PREFIX(Color4ubv)(const GLubyte *v);
+GLAPI void APIENTRY GLAPI_PREFIX(Color4ui)(GLuint red, GLuint green, GLuint blue, GLuint alpha);
+GLAPI void APIENTRY GLAPI_PREFIX(Color4uiv)(const GLuint *v);
+GLAPI void APIENTRY GLAPI_PREFIX(Color4us)(GLushort red, GLushort green, GLushort blue, GLushort alpha);
+GLAPI void APIENTRY GLAPI_PREFIX(Color4usv)(const GLushort *v);
+GLAPI void APIENTRY GLAPI_PREFIX(EdgeFlag)(GLboolean flag);
+GLAPI void APIENTRY GLAPI_PREFIX(EdgeFlagv)(const GLboolean *flag);
+GLAPI void APIENTRY GLAPI_PREFIX(End)(void);
+GLAPI void APIENTRY GLAPI_PREFIX(Indexd)(GLdouble c);
+GLAPI void APIENTRY GLAPI_PREFIX(Indexdv)(const GLdouble *c);
+GLAPI void APIENTRY GLAPI_PREFIX(Indexf)(GLfloat c);
+GLAPI void APIENTRY GLAPI_PREFIX(Indexfv)(const GLfloat *c);
+GLAPI void APIENTRY GLAPI_PREFIX(Indexi)(GLint c);
+GLAPI void APIENTRY GLAPI_PREFIX(Indexiv)(const GLint *c);
+GLAPI void APIENTRY GLAPI_PREFIX(Indexs)(GLshort c);
+GLAPI void APIENTRY GLAPI_PREFIX(Indexsv)(const GLshort *c);
+GLAPI void APIENTRY GLAPI_PREFIX(Normal3b)(GLbyte nx, GLbyte ny, GLbyte nz);
+GLAPI void APIENTRY GLAPI_PREFIX(Normal3bv)(const GLbyte *v);
+GLAPI void APIENTRY GLAPI_PREFIX(Normal3d)(GLdouble nx, GLdouble ny, GLdouble nz);
+GLAPI void APIENTRY GLAPI_PREFIX(Normal3dv)(const GLdouble *v);
+GLAPI void APIENTRY GLAPI_PREFIX(Normal3f)(GLfloat nx, GLfloat ny, GLfloat nz);
+GLAPI void APIENTRY GLAPI_PREFIX(Normal3fv)(const GLfloat *v);
+GLAPI void APIENTRY GLAPI_PREFIX(Normal3i)(GLint nx, GLint ny, GLint nz);
+GLAPI void APIENTRY GLAPI_PREFIX(Normal3iv)(const GLint *v);
+GLAPI void APIENTRY GLAPI_PREFIX(Normal3s)(GLshort nx, GLshort ny, GLshort nz);
+GLAPI void APIENTRY GLAPI_PREFIX(Normal3sv)(const GLshort *v);
+GLAPI void APIENTRY GLAPI_PREFIX(RasterPos2d)(GLdouble x, GLdouble y);
+GLAPI void APIENTRY GLAPI_PREFIX(RasterPos2dv)(const GLdouble *v);
+GLAPI void APIENTRY GLAPI_PREFIX(RasterPos2f)(GLfloat x, GLfloat y);
+GLAPI void APIENTRY GLAPI_PREFIX(RasterPos2fv)(const GLfloat *v);
+GLAPI void APIENTRY GLAPI_PREFIX(RasterPos2i)(GLint x, GLint y);
+GLAPI void APIENTRY GLAPI_PREFIX(RasterPos2iv)(const GLint *v);
+GLAPI void APIENTRY GLAPI_PREFIX(RasterPos2s)(GLshort x, GLshort y);
+GLAPI void APIENTRY GLAPI_PREFIX(RasterPos2sv)(const GLshort *v);
+GLAPI void APIENTRY GLAPI_PREFIX(RasterPos3d)(GLdouble x, GLdouble y, GLdouble z);
+GLAPI void APIENTRY GLAPI_PREFIX(RasterPos3dv)(const GLdouble *v);
+GLAPI void APIENTRY GLAPI_PREFIX(RasterPos3f)(GLfloat x, GLfloat y, GLfloat z);
+GLAPI void APIENTRY GLAPI_PREFIX(RasterPos3fv)(const GLfloat *v);
+GLAPI void APIENTRY GLAPI_PREFIX(RasterPos3i)(GLint x, GLint y, GLint z);
+GLAPI void APIENTRY GLAPI_PREFIX(RasterPos3iv)(const GLint *v);
+GLAPI void APIENTRY GLAPI_PREFIX(RasterPos3s)(GLshort x, GLshort y, GLshort z);
+GLAPI void APIENTRY GLAPI_PREFIX(RasterPos3sv)(const GLshort *v);
+GLAPI void APIENTRY GLAPI_PREFIX(RasterPos4d)(GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+GLAPI void APIENTRY GLAPI_PREFIX(RasterPos4dv)(const GLdouble *v);
+GLAPI void APIENTRY GLAPI_PREFIX(RasterPos4f)(GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+GLAPI void APIENTRY GLAPI_PREFIX(RasterPos4fv)(const GLfloat *v);
+GLAPI void APIENTRY GLAPI_PREFIX(RasterPos4i)(GLint x, GLint y, GLint z, GLint w);
+GLAPI void APIENTRY GLAPI_PREFIX(RasterPos4iv)(const GLint *v);
+GLAPI void APIENTRY GLAPI_PREFIX(RasterPos4s)(GLshort x, GLshort y, GLshort z, GLshort w);
+GLAPI void APIENTRY GLAPI_PREFIX(RasterPos4sv)(const GLshort *v);
+GLAPI void APIENTRY GLAPI_PREFIX(Rectd)(GLdouble x1, GLdouble y1, GLdouble x2, GLdouble y2);
+GLAPI void APIENTRY GLAPI_PREFIX(Rectdv)(const GLdouble *v1, const GLdouble *v2);
+GLAPI void APIENTRY GLAPI_PREFIX(Rectf)(GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2);
+GLAPI void APIENTRY GLAPI_PREFIX(Rectfv)(const GLfloat *v1, const GLfloat *v2);
+GLAPI void APIENTRY GLAPI_PREFIX(Recti)(GLint x1, GLint y1, GLint x2, GLint y2);
+GLAPI void APIENTRY GLAPI_PREFIX(Rectiv)(const GLint *v1, const GLint *v2);
+GLAPI void APIENTRY GLAPI_PREFIX(Rects)(GLshort x1, GLshort y1, GLshort x2, GLshort y2);
+GLAPI void APIENTRY GLAPI_PREFIX(Rectsv)(const GLshort *v1, const GLshort *v2);
+GLAPI void APIENTRY GLAPI_PREFIX(TexCoord1d)(GLdouble s);
+GLAPI void APIENTRY GLAPI_PREFIX(TexCoord1dv)(const GLdouble *v);
+GLAPI void APIENTRY GLAPI_PREFIX(TexCoord1f)(GLfloat s);
+GLAPI void APIENTRY GLAPI_PREFIX(TexCoord1fv)(const GLfloat *v);
+GLAPI void APIENTRY GLAPI_PREFIX(TexCoord1i)(GLint s);
+GLAPI void APIENTRY GLAPI_PREFIX(TexCoord1iv)(const GLint *v);
+GLAPI void APIENTRY GLAPI_PREFIX(TexCoord1s)(GLshort s);
+GLAPI void APIENTRY GLAPI_PREFIX(TexCoord1sv)(const GLshort *v);
+GLAPI void APIENTRY GLAPI_PREFIX(TexCoord2d)(GLdouble s, GLdouble t);
+GLAPI void APIENTRY GLAPI_PREFIX(TexCoord2dv)(const GLdouble *v);
+GLAPI void APIENTRY GLAPI_PREFIX(TexCoord2f)(GLfloat s, GLfloat t);
+GLAPI void APIENTRY GLAPI_PREFIX(TexCoord2fv)(const GLfloat *v);
+GLAPI void APIENTRY GLAPI_PREFIX(TexCoord2i)(GLint s, GLint t);
+GLAPI void APIENTRY GLAPI_PREFIX(TexCoord2iv)(const GLint *v);
+GLAPI void APIENTRY GLAPI_PREFIX(TexCoord2s)(GLshort s, GLshort t);
+GLAPI void APIENTRY GLAPI_PREFIX(TexCoord2sv)(const GLshort *v);
+GLAPI void APIENTRY GLAPI_PREFIX(TexCoord3d)(GLdouble s, GLdouble t, GLdouble r);
+GLAPI void APIENTRY GLAPI_PREFIX(TexCoord3dv)(const GLdouble *v);
+GLAPI void APIENTRY GLAPI_PREFIX(TexCoord3f)(GLfloat s, GLfloat t, GLfloat r);
+GLAPI void APIENTRY GLAPI_PREFIX(TexCoord3fv)(const GLfloat *v);
+GLAPI void APIENTRY GLAPI_PREFIX(TexCoord3i)(GLint s, GLint t, GLint r);
+GLAPI void APIENTRY GLAPI_PREFIX(TexCoord3iv)(const GLint *v);
+GLAPI void APIENTRY GLAPI_PREFIX(TexCoord3s)(GLshort s, GLshort t, GLshort r);
+GLAPI void APIENTRY GLAPI_PREFIX(TexCoord3sv)(const GLshort *v);
+GLAPI void APIENTRY GLAPI_PREFIX(TexCoord4d)(GLdouble s, GLdouble t, GLdouble r, GLdouble q);
+GLAPI void APIENTRY GLAPI_PREFIX(TexCoord4dv)(const GLdouble *v);
+GLAPI void APIENTRY GLAPI_PREFIX(TexCoord4f)(GLfloat s, GLfloat t, GLfloat r, GLfloat q);
+GLAPI void APIENTRY GLAPI_PREFIX(TexCoord4fv)(const GLfloat *v);
+GLAPI void APIENTRY GLAPI_PREFIX(TexCoord4i)(GLint s, GLint t, GLint r, GLint q);
+GLAPI void APIENTRY GLAPI_PREFIX(TexCoord4iv)(const GLint *v);
+GLAPI void APIENTRY GLAPI_PREFIX(TexCoord4s)(GLshort s, GLshort t, GLshort r, GLshort q);
+GLAPI void APIENTRY GLAPI_PREFIX(TexCoord4sv)(const GLshort *v);
+GLAPI void APIENTRY GLAPI_PREFIX(Vertex2d)(GLdouble x, GLdouble y);
+GLAPI void APIENTRY GLAPI_PREFIX(Vertex2dv)(const GLdouble *v);
+GLAPI void APIENTRY GLAPI_PREFIX(Vertex2f)(GLfloat x, GLfloat y);
+GLAPI void APIENTRY GLAPI_PREFIX(Vertex2fv)(const GLfloat *v);
+GLAPI void APIENTRY GLAPI_PREFIX(Vertex2i)(GLint x, GLint y);
+GLAPI void APIENTRY GLAPI_PREFIX(Vertex2iv)(const GLint *v);
+GLAPI void APIENTRY GLAPI_PREFIX(Vertex2s)(GLshort x, GLshort y);
+GLAPI void APIENTRY GLAPI_PREFIX(Vertex2sv)(const GLshort *v);
+GLAPI void APIENTRY GLAPI_PREFIX(Vertex3d)(GLdouble x, GLdouble y, GLdouble z);
+GLAPI void APIENTRY GLAPI_PREFIX(Vertex3dv)(const GLdouble *v);
+GLAPI void APIENTRY GLAPI_PREFIX(Vertex3f)(GLfloat x, GLfloat y, GLfloat z);
+GLAPI void APIENTRY GLAPI_PREFIX(Vertex3fv)(const GLfloat *v);
+GLAPI void APIENTRY GLAPI_PREFIX(Vertex3i)(GLint x, GLint y, GLint z);
+GLAPI void APIENTRY GLAPI_PREFIX(Vertex3iv)(const GLint *v);
+GLAPI void APIENTRY GLAPI_PREFIX(Vertex3s)(GLshort x, GLshort y, GLshort z);
+GLAPI void APIENTRY GLAPI_PREFIX(Vertex3sv)(const GLshort *v);
+GLAPI void APIENTRY GLAPI_PREFIX(Vertex4d)(GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+GLAPI void APIENTRY GLAPI_PREFIX(Vertex4dv)(const GLdouble *v);
+GLAPI void APIENTRY GLAPI_PREFIX(Vertex4f)(GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+GLAPI void APIENTRY GLAPI_PREFIX(Vertex4fv)(const GLfloat *v);
+GLAPI void APIENTRY GLAPI_PREFIX(Vertex4i)(GLint x, GLint y, GLint z, GLint w);
+GLAPI void APIENTRY GLAPI_PREFIX(Vertex4iv)(const GLint *v);
+GLAPI void APIENTRY GLAPI_PREFIX(Vertex4s)(GLshort x, GLshort y, GLshort z, GLshort w);
+GLAPI void APIENTRY GLAPI_PREFIX(Vertex4sv)(const GLshort *v);
+GLAPI void APIENTRY GLAPI_PREFIX(ClipPlane)(GLenum plane, const GLdouble *equation);
+GLAPI void APIENTRY GLAPI_PREFIX(ColorMaterial)(GLenum face, GLenum mode);
+GLAPI void APIENTRY GLAPI_PREFIX(CullFace)(GLenum mode);
+GLAPI void APIENTRY GLAPI_PREFIX(Fogf)(GLenum pname, GLfloat param);
+GLAPI void APIENTRY GLAPI_PREFIX(Fogfv)(GLenum pname, const GLfloat *params);
+GLAPI void APIENTRY GLAPI_PREFIX(Fogi)(GLenum pname, GLint param);
+GLAPI void APIENTRY GLAPI_PREFIX(Fogiv)(GLenum pname, const GLint *params);
+GLAPI void APIENTRY GLAPI_PREFIX(FrontFace)(GLenum mode);
+GLAPI void APIENTRY GLAPI_PREFIX(Hint)(GLenum target, GLenum mode);
+GLAPI void APIENTRY GLAPI_PREFIX(Lightf)(GLenum light, GLenum pname, GLfloat param);
+GLAPI void APIENTRY GLAPI_PREFIX(Lightfv)(GLenum light, GLenum pname, const GLfloat *params);
+GLAPI void APIENTRY GLAPI_PREFIX(Lighti)(GLenum light, GLenum pname, GLint param);
+GLAPI void APIENTRY GLAPI_PREFIX(Lightiv)(GLenum light, GLenum pname, const GLint *params);
+GLAPI void APIENTRY GLAPI_PREFIX(LightModelf)(GLenum pname, GLfloat param);
+GLAPI void APIENTRY GLAPI_PREFIX(LightModelfv)(GLenum pname, const GLfloat *params);
+GLAPI void APIENTRY GLAPI_PREFIX(LightModeli)(GLenum pname, GLint param);
+GLAPI void APIENTRY GLAPI_PREFIX(LightModeliv)(GLenum pname, const GLint *params);
+GLAPI void APIENTRY GLAPI_PREFIX(LineStipple)(GLint factor, GLushort pattern);
+GLAPI void APIENTRY GLAPI_PREFIX(LineWidth)(GLfloat width);
+GLAPI void APIENTRY GLAPI_PREFIX(Materialf)(GLenum face, GLenum pname, GLfloat param);
+GLAPI void APIENTRY GLAPI_PREFIX(Materialfv)(GLenum face, GLenum pname, const GLfloat *params);
+GLAPI void APIENTRY GLAPI_PREFIX(Materiali)(GLenum face, GLenum pname, GLint param);
+GLAPI void APIENTRY GLAPI_PREFIX(Materialiv)(GLenum face, GLenum pname, const GLint *params);
+GLAPI void APIENTRY GLAPI_PREFIX(PointSize)(GLfloat size);
+GLAPI void APIENTRY GLAPI_PREFIX(PolygonMode)(GLenum face, GLenum mode);
+GLAPI void APIENTRY GLAPI_PREFIX(PolygonStipple)(const GLubyte *mask);
+GLAPI void APIENTRY GLAPI_PREFIX(Scissor)(GLint x, GLint y, GLsizei width, GLsizei height);
+GLAPI void APIENTRY GLAPI_PREFIX(ShadeModel)(GLenum mode);
+GLAPI void APIENTRY GLAPI_PREFIX(TexParameterf)(GLenum target, GLenum pname, GLfloat param);
+GLAPI void APIENTRY GLAPI_PREFIX(TexParameterfv)(GLenum target, GLenum pname, const GLfloat *params);
+GLAPI void APIENTRY GLAPI_PREFIX(TexParameteri)(GLenum target, GLenum pname, GLint param);
+GLAPI void APIENTRY GLAPI_PREFIX(TexParameteriv)(GLenum target, GLenum pname, const GLint *params);
+GLAPI void APIENTRY GLAPI_PREFIX(TexImage1D)(GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
+GLAPI void APIENTRY GLAPI_PREFIX(TexImage2D)(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
+GLAPI void APIENTRY GLAPI_PREFIX(TexEnvf)(GLenum target, GLenum pname, GLfloat param);
+GLAPI void APIENTRY GLAPI_PREFIX(TexEnvfv)(GLenum target, GLenum pname, const GLfloat *params);
+GLAPI void APIENTRY GLAPI_PREFIX(TexEnvi)(GLenum target, GLenum pname, GLint param);
+GLAPI void APIENTRY GLAPI_PREFIX(TexEnviv)(GLenum target, GLenum pname, const GLint *params);
+GLAPI void APIENTRY GLAPI_PREFIX(TexGend)(GLenum coord, GLenum pname, GLdouble param);
+GLAPI void APIENTRY GLAPI_PREFIX(TexGendv)(GLenum coord, GLenum pname, const GLdouble *params);
+GLAPI void APIENTRY GLAPI_PREFIX(TexGenf)(GLenum coord, GLenum pname, GLfloat param);
+GLAPI void APIENTRY GLAPI_PREFIX(TexGenfv)(GLenum coord, GLenum pname, const GLfloat *params);
+GLAPI void APIENTRY GLAPI_PREFIX(TexGeni)(GLenum coord, GLenum pname, GLint param);
+GLAPI void APIENTRY GLAPI_PREFIX(TexGeniv)(GLenum coord, GLenum pname, const GLint *params);
+GLAPI void APIENTRY GLAPI_PREFIX(FeedbackBuffer)(GLsizei size, GLenum type, GLfloat *buffer);
+GLAPI void APIENTRY GLAPI_PREFIX(SelectBuffer)(GLsizei size, GLuint *buffer);
+GLAPI GLint APIENTRY GLAPI_PREFIX(RenderMode)(GLenum mode);
+GLAPI void APIENTRY GLAPI_PREFIX(InitNames)(void);
+GLAPI void APIENTRY GLAPI_PREFIX(LoadName)(GLuint name);
+GLAPI void APIENTRY GLAPI_PREFIX(PassThrough)(GLfloat token);
+GLAPI void APIENTRY GLAPI_PREFIX(PopName)(void);
+GLAPI void APIENTRY GLAPI_PREFIX(PushName)(GLuint name);
+GLAPI void APIENTRY GLAPI_PREFIX(DrawBuffer)(GLenum mode);
+GLAPI void APIENTRY GLAPI_PREFIX(Clear)(GLbitfield mask);
+GLAPI void APIENTRY GLAPI_PREFIX(ClearAccum)(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
+GLAPI void APIENTRY GLAPI_PREFIX(ClearIndex)(GLfloat c);
+GLAPI void APIENTRY GLAPI_PREFIX(ClearColor)(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
+GLAPI void APIENTRY GLAPI_PREFIX(ClearStencil)(GLint s);
+GLAPI void APIENTRY GLAPI_PREFIX(ClearDepth)(GLclampd depth);
+GLAPI void APIENTRY GLAPI_PREFIX(StencilMask)(GLuint mask);
+GLAPI void APIENTRY GLAPI_PREFIX(ColorMask)(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha);
+GLAPI void APIENTRY GLAPI_PREFIX(DepthMask)(GLboolean flag);
+GLAPI void APIENTRY GLAPI_PREFIX(IndexMask)(GLuint mask);
+GLAPI void APIENTRY GLAPI_PREFIX(Accum)(GLenum op, GLfloat value);
+GLAPI void APIENTRY GLAPI_PREFIX(Disable)(GLenum cap);
+GLAPI void APIENTRY GLAPI_PREFIX(Enable)(GLenum cap);
+GLAPI void APIENTRY GLAPI_PREFIX(Finish)(void);
+GLAPI void APIENTRY GLAPI_PREFIX(Flush)(void);
+GLAPI void APIENTRY GLAPI_PREFIX(PopAttrib)(void);
+GLAPI void APIENTRY GLAPI_PREFIX(PushAttrib)(GLbitfield mask);
+GLAPI void APIENTRY GLAPI_PREFIX(Map1d)(GLenum target, GLdouble u1, GLdouble u2, GLint stride, GLint order, const GLdouble *points);
+GLAPI void APIENTRY GLAPI_PREFIX(Map1f)(GLenum target, GLfloat u1, GLfloat u2, GLint stride, GLint order, const GLfloat *points);
+GLAPI void APIENTRY GLAPI_PREFIX(Map2d)(GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, const GLdouble *points);
+GLAPI void APIENTRY GLAPI_PREFIX(Map2f)(GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, const GLfloat *points);
+GLAPI void APIENTRY GLAPI_PREFIX(MapGrid1d)(GLint un, GLdouble u1, GLdouble u2);
+GLAPI void APIENTRY GLAPI_PREFIX(MapGrid1f)(GLint un, GLfloat u1, GLfloat u2);
+GLAPI void APIENTRY GLAPI_PREFIX(MapGrid2d)(GLint un, GLdouble u1, GLdouble u2, GLint vn, GLdouble v1, GLdouble v2);
+GLAPI void APIENTRY GLAPI_PREFIX(MapGrid2f)(GLint un, GLfloat u1, GLfloat u2, GLint vn, GLfloat v1, GLfloat v2);
+GLAPI void APIENTRY GLAPI_PREFIX(EvalCoord1d)(GLdouble u);
+GLAPI void APIENTRY GLAPI_PREFIX(EvalCoord1dv)(const GLdouble *u);
+GLAPI void APIENTRY GLAPI_PREFIX(EvalCoord1f)(GLfloat u);
+GLAPI void APIENTRY GLAPI_PREFIX(EvalCoord1fv)(const GLfloat *u);
+GLAPI void APIENTRY GLAPI_PREFIX(EvalCoord2d)(GLdouble u, GLdouble v);
+GLAPI void APIENTRY GLAPI_PREFIX(EvalCoord2dv)(const GLdouble *u);
+GLAPI void APIENTRY GLAPI_PREFIX(EvalCoord2f)(GLfloat u, GLfloat v);
+GLAPI void APIENTRY GLAPI_PREFIX(EvalCoord2fv)(const GLfloat *u);
+GLAPI void APIENTRY GLAPI_PREFIX(EvalMesh1)(GLenum mode, GLint i1, GLint i2);
+GLAPI void APIENTRY GLAPI_PREFIX(EvalPoint1)(GLint i);
+GLAPI void APIENTRY GLAPI_PREFIX(EvalMesh2)(GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2);
+GLAPI void APIENTRY GLAPI_PREFIX(EvalPoint2)(GLint i, GLint j);
+GLAPI void APIENTRY GLAPI_PREFIX(AlphaFunc)(GLenum func, GLclampf ref);
+GLAPI void APIENTRY GLAPI_PREFIX(BlendFunc)(GLenum sfactor, GLenum dfactor);
+GLAPI void APIENTRY GLAPI_PREFIX(LogicOp)(GLenum opcode);
+GLAPI void APIENTRY GLAPI_PREFIX(StencilFunc)(GLenum func, GLint ref, GLuint mask);
+GLAPI void APIENTRY GLAPI_PREFIX(StencilOp)(GLenum fail, GLenum zfail, GLenum zpass);
+GLAPI void APIENTRY GLAPI_PREFIX(DepthFunc)(GLenum func);
+GLAPI void APIENTRY GLAPI_PREFIX(PixelZoom)(GLfloat xfactor, GLfloat yfactor);
+GLAPI void APIENTRY GLAPI_PREFIX(PixelTransferf)(GLenum pname, GLfloat param);
+GLAPI void APIENTRY GLAPI_PREFIX(PixelTransferi)(GLenum pname, GLint param);
+GLAPI void APIENTRY GLAPI_PREFIX(PixelStoref)(GLenum pname, GLfloat param);
+GLAPI void APIENTRY GLAPI_PREFIX(PixelStorei)(GLenum pname, GLint param);
+GLAPI void APIENTRY GLAPI_PREFIX(PixelMapfv)(GLenum map, GLsizei mapsize, const GLfloat *values);
+GLAPI void APIENTRY GLAPI_PREFIX(PixelMapuiv)(GLenum map, GLsizei mapsize, const GLuint *values);
+GLAPI void APIENTRY GLAPI_PREFIX(PixelMapusv)(GLenum map, GLsizei mapsize, const GLushort *values);
+GLAPI void APIENTRY GLAPI_PREFIX(ReadBuffer)(GLenum mode);
+GLAPI void APIENTRY GLAPI_PREFIX(CopyPixels)(GLint x, GLint y, GLsizei width, GLsizei height, GLenum type);
+GLAPI void APIENTRY GLAPI_PREFIX(ReadPixels)(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels);
+GLAPI void APIENTRY GLAPI_PREFIX(DrawPixels)(GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels);
+GLAPI void APIENTRY GLAPI_PREFIX(GetBooleanv)(GLenum pname, GLboolean *params);
+GLAPI void APIENTRY GLAPI_PREFIX(GetClipPlane)(GLenum plane, GLdouble *equation);
+GLAPI void APIENTRY GLAPI_PREFIX(GetDoublev)(GLenum pname, GLdouble *params);
+GLAPI GLenum APIENTRY GLAPI_PREFIX(GetError)(void);
+GLAPI void APIENTRY GLAPI_PREFIX(GetFloatv)(GLenum pname, GLfloat *params);
+GLAPI void APIENTRY GLAPI_PREFIX(GetIntegerv)(GLenum pname, GLint *params);
+GLAPI void APIENTRY GLAPI_PREFIX(GetLightfv)(GLenum light, GLenum pname, GLfloat *params);
+GLAPI void APIENTRY GLAPI_PREFIX(GetLightiv)(GLenum light, GLenum pname, GLint *params);
+GLAPI void APIENTRY GLAPI_PREFIX(GetMapdv)(GLenum target, GLenum query, GLdouble *v);
+GLAPI void APIENTRY GLAPI_PREFIX(GetMapfv)(GLenum target, GLenum query, GLfloat *v);
+GLAPI void APIENTRY GLAPI_PREFIX(GetMapiv)(GLenum target, GLenum query, GLint *v);
+GLAPI void APIENTRY GLAPI_PREFIX(GetMaterialfv)(GLenum face, GLenum pname, GLfloat *params);
+GLAPI void APIENTRY GLAPI_PREFIX(GetMaterialiv)(GLenum face, GLenum pname, GLint *params);
+GLAPI void APIENTRY GLAPI_PREFIX(GetPixelMapfv)(GLenum map, GLfloat *values);
+GLAPI void APIENTRY GLAPI_PREFIX(GetPixelMapuiv)(GLenum map, GLuint *values);
+GLAPI void APIENTRY GLAPI_PREFIX(GetPixelMapusv)(GLenum map, GLushort *values);
+GLAPI void APIENTRY GLAPI_PREFIX(GetPolygonStipple)(GLubyte *mask);
+GLAPI const GLubyte * APIENTRY GLAPI_PREFIX(GetString)(GLenum name);
+GLAPI void APIENTRY GLAPI_PREFIX(GetTexEnvfv)(GLenum target, GLenum pname, GLfloat *params);
+GLAPI void APIENTRY GLAPI_PREFIX(GetTexEnviv)(GLenum target, GLenum pname, GLint *params);
+GLAPI void APIENTRY GLAPI_PREFIX(GetTexGendv)(GLenum coord, GLenum pname, GLdouble *params);
+GLAPI void APIENTRY GLAPI_PREFIX(GetTexGenfv)(GLenum coord, GLenum pname, GLfloat *params);
+GLAPI void APIENTRY GLAPI_PREFIX(GetTexGeniv)(GLenum coord, GLenum pname, GLint *params);
+GLAPI void APIENTRY GLAPI_PREFIX(GetTexImage)(GLenum target, GLint level, GLenum format, GLenum type, GLvoid *pixels);
+GLAPI void APIENTRY GLAPI_PREFIX(GetTexParameterfv)(GLenum target, GLenum pname, GLfloat *params);
+GLAPI void APIENTRY GLAPI_PREFIX(GetTexParameteriv)(GLenum target, GLenum pname, GLint *params);
+GLAPI void APIENTRY GLAPI_PREFIX(GetTexLevelParameterfv)(GLenum target, GLint level, GLenum pname, GLfloat *params);
+GLAPI void APIENTRY GLAPI_PREFIX(GetTexLevelParameteriv)(GLenum target, GLint level, GLenum pname, GLint *params);
+GLAPI GLboolean APIENTRY GLAPI_PREFIX(IsEnabled)(GLenum cap);
+GLAPI GLboolean APIENTRY GLAPI_PREFIX(IsList)(GLuint list);
+GLAPI void APIENTRY GLAPI_PREFIX(DepthRange)(GLclampd zNear, GLclampd zFar);
+GLAPI void APIENTRY GLAPI_PREFIX(Frustum)(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar);
+GLAPI void APIENTRY GLAPI_PREFIX(LoadIdentity)(void);
+GLAPI void APIENTRY GLAPI_PREFIX(LoadMatrixf)(const GLfloat *m);
+GLAPI void APIENTRY GLAPI_PREFIX(LoadMatrixd)(const GLdouble *m);
+GLAPI void APIENTRY GLAPI_PREFIX(MatrixMode)(GLenum mode);
+GLAPI void APIENTRY GLAPI_PREFIX(MultMatrixf)(const GLfloat *m);
+GLAPI void APIENTRY GLAPI_PREFIX(MultMatrixd)(const GLdouble *m);
+GLAPI void APIENTRY GLAPI_PREFIX(Ortho)(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar);
+GLAPI void APIENTRY GLAPI_PREFIX(PopMatrix)(void);
+GLAPI void APIENTRY GLAPI_PREFIX(PushMatrix)(void);
+GLAPI void APIENTRY GLAPI_PREFIX(Rotated)(GLdouble angle, GLdouble x, GLdouble y, GLdouble z);
+GLAPI void APIENTRY GLAPI_PREFIX(Rotatef)(GLfloat angle, GLfloat x, GLfloat y, GLfloat z);
+GLAPI void APIENTRY GLAPI_PREFIX(Scaled)(GLdouble x, GLdouble y, GLdouble z);
+GLAPI void APIENTRY GLAPI_PREFIX(Scalef)(GLfloat x, GLfloat y, GLfloat z);
+GLAPI void APIENTRY GLAPI_PREFIX(Translated)(GLdouble x, GLdouble y, GLdouble z);
+GLAPI void APIENTRY GLAPI_PREFIX(Translatef)(GLfloat x, GLfloat y, GLfloat z);
+GLAPI void APIENTRY GLAPI_PREFIX(Viewport)(GLint x, GLint y, GLsizei width, GLsizei height);
+GLAPI void APIENTRY GLAPI_PREFIX(ArrayElement)(GLint i);
+GLAPI void APIENTRY GLAPI_PREFIX(ArrayElementEXT)(GLint i);
+GLAPI void APIENTRY GLAPI_PREFIX(BindTexture)(GLenum target, GLuint texture);
+GLAPI void APIENTRY GLAPI_PREFIX(BindTextureEXT)(GLenum target, GLuint texture);
+GLAPI void APIENTRY GLAPI_PREFIX(ColorPointer)(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
+GLAPI void APIENTRY GLAPI_PREFIX(DisableClientState)(GLenum array);
+GLAPI void APIENTRY GLAPI_PREFIX(DrawArrays)(GLenum mode, GLint first, GLsizei count);
+GLAPI void APIENTRY GLAPI_PREFIX(DrawArraysEXT)(GLenum mode, GLint first, GLsizei count);
+GLAPI void APIENTRY GLAPI_PREFIX(DrawElements)(GLenum mode, GLsizei count, GLenum type, const GLvoid *indices);
+GLAPI void APIENTRY GLAPI_PREFIX(EdgeFlagPointer)(GLsizei stride, const GLvoid *pointer);
+GLAPI void APIENTRY GLAPI_PREFIX(EnableClientState)(GLenum array);
+GLAPI void APIENTRY GLAPI_PREFIX(IndexPointer)(GLenum type, GLsizei stride, const GLvoid *pointer);
+GLAPI void APIENTRY GLAPI_PREFIX(Indexub)(GLubyte c);
+GLAPI void APIENTRY GLAPI_PREFIX(Indexubv)(const GLubyte *c);
+GLAPI void APIENTRY GLAPI_PREFIX(InterleavedArrays)(GLenum format, GLsizei stride, const GLvoid *pointer);
+GLAPI void APIENTRY GLAPI_PREFIX(NormalPointer)(GLenum type, GLsizei stride, const GLvoid *pointer);
+GLAPI void APIENTRY GLAPI_PREFIX(PolygonOffset)(GLfloat factor, GLfloat units);
+GLAPI void APIENTRY GLAPI_PREFIX(TexCoordPointer)(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
+GLAPI void APIENTRY GLAPI_PREFIX(VertexPointer)(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
+GLAPI GLboolean APIENTRY GLAPI_PREFIX(AreTexturesResident)(GLsizei n, const GLuint *textures, GLboolean *residences);
+GLAPI GLboolean APIENTRY GLAPI_PREFIX(AreTexturesResidentEXT)(GLsizei n, const GLuint *textures, GLboolean *residences);
+GLAPI void APIENTRY GLAPI_PREFIX(CopyTexImage1D)(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border);
+GLAPI void APIENTRY GLAPI_PREFIX(CopyTexImage1DEXT)(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border);
+GLAPI void APIENTRY GLAPI_PREFIX(CopyTexImage2D)(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
+GLAPI void APIENTRY GLAPI_PREFIX(CopyTexImage2DEXT)(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
+GLAPI void APIENTRY GLAPI_PREFIX(CopyTexSubImage1D)(GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width);
+GLAPI void APIENTRY GLAPI_PREFIX(CopyTexSubImage1DEXT)(GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width);
+GLAPI void APIENTRY GLAPI_PREFIX(CopyTexSubImage2D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
+GLAPI void APIENTRY GLAPI_PREFIX(CopyTexSubImage2DEXT)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
+GLAPI void APIENTRY GLAPI_PREFIX(DeleteTextures)(GLsizei n, const GLuint *textures);
+GLAPI void APIENTRY GLAPI_PREFIX(DeleteTexturesEXT)(GLsizei n, const GLuint *textures);
+GLAPI void APIENTRY GLAPI_PREFIX(GenTextures)(GLsizei n, GLuint *textures);
+GLAPI void APIENTRY GLAPI_PREFIX(GenTexturesEXT)(GLsizei n, GLuint *textures);
+GLAPI void APIENTRY GLAPI_PREFIX(GetPointerv)(GLenum pname, GLvoid **params);
+GLAPI void APIENTRY GLAPI_PREFIX(GetPointervEXT)(GLenum pname, GLvoid **params);
+GLAPI GLboolean APIENTRY GLAPI_PREFIX(IsTexture)(GLuint texture);
+GLAPI GLboolean APIENTRY GLAPI_PREFIX(IsTextureEXT)(GLuint texture);
+GLAPI void APIENTRY GLAPI_PREFIX(PrioritizeTextures)(GLsizei n, const GLuint *textures, const GLclampf *priorities);
+GLAPI void APIENTRY GLAPI_PREFIX(PrioritizeTexturesEXT)(GLsizei n, const GLuint *textures, const GLclampf *priorities);
+GLAPI void APIENTRY GLAPI_PREFIX(TexSubImage1D)(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels);
+GLAPI void APIENTRY GLAPI_PREFIX(TexSubImage1DEXT)(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels);
+GLAPI void APIENTRY GLAPI_PREFIX(TexSubImage2D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels);
+GLAPI void APIENTRY GLAPI_PREFIX(TexSubImage2DEXT)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels);
+GLAPI void APIENTRY GLAPI_PREFIX(PopClientAttrib)(void);
+GLAPI void APIENTRY GLAPI_PREFIX(PushClientAttrib)(GLbitfield mask);
+GLAPI void APIENTRY GLAPI_PREFIX(BlendColor)(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
+GLAPI void APIENTRY GLAPI_PREFIX(BlendColorEXT)(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
+GLAPI void APIENTRY GLAPI_PREFIX(BlendEquation)(GLenum mode);
+GLAPI void APIENTRY GLAPI_PREFIX(BlendEquationEXT)(GLenum mode);
+GLAPI void APIENTRY GLAPI_PREFIX(DrawRangeElements)(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices);
+GLAPI void APIENTRY GLAPI_PREFIX(DrawRangeElementsEXT)(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices);
+GLAPI void APIENTRY GLAPI_PREFIX(ColorTable)(GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table);
+GLAPI void APIENTRY GLAPI_PREFIX(ColorTableEXT)(GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table);
+GLAPI void APIENTRY GLAPI_PREFIX(ColorTableParameterfv)(GLenum target, GLenum pname, const GLfloat *params);
+GLAPI void APIENTRY GLAPI_PREFIX(ColorTableParameteriv)(GLenum target, GLenum pname, const GLint *params);
+GLAPI void APIENTRY GLAPI_PREFIX(CopyColorTable)(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width);
+GLAPI void APIENTRY GLAPI_PREFIX(GetColorTable)(GLenum target, GLenum format, GLenum type, GLvoid *table);
+GLAPI void APIENTRY GLAPI_PREFIX(GetColorTableEXT)(GLenum target, GLenum format, GLenum type, GLvoid *table);
+void APIENTRY GLAPI_PREFIX(_dispatch_stub_343)(GLenum target, GLenum format, GLenum type, GLvoid *table);
+GLAPI void APIENTRY GLAPI_PREFIX(GetColorTableParameterfv)(GLenum target, GLenum pname, GLfloat *params);
+GLAPI void APIENTRY GLAPI_PREFIX(GetColorTableParameterfvEXT)(GLenum target, GLenum pname, GLfloat *params);
+void APIENTRY GLAPI_PREFIX(_dispatch_stub_344)(GLenum target, GLenum pname, GLfloat *params);
+GLAPI void APIENTRY GLAPI_PREFIX(GetColorTableParameteriv)(GLenum target, GLenum pname, GLint *params);
+GLAPI void APIENTRY GLAPI_PREFIX(GetColorTableParameterivEXT)(GLenum target, GLenum pname, GLint *params);
+void APIENTRY GLAPI_PREFIX(_dispatch_stub_345)(GLenum target, GLenum pname, GLint *params);
+GLAPI void APIENTRY GLAPI_PREFIX(ColorSubTable)(GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *data);
+GLAPI void APIENTRY GLAPI_PREFIX(CopyColorSubTable)(GLenum target, GLsizei start, GLint x, GLint y, GLsizei width);
+GLAPI void APIENTRY GLAPI_PREFIX(ConvolutionFilter1D)(GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *image);
+GLAPI void APIENTRY GLAPI_PREFIX(ConvolutionFilter2D)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *image);
+GLAPI void APIENTRY GLAPI_PREFIX(ConvolutionParameterf)(GLenum target, GLenum pname, GLfloat params);
+GLAPI void APIENTRY GLAPI_PREFIX(ConvolutionParameterfv)(GLenum target, GLenum pname, const GLfloat *params);
+GLAPI void APIENTRY GLAPI_PREFIX(ConvolutionParameteri)(GLenum target, GLenum pname, GLint params);
+GLAPI void APIENTRY GLAPI_PREFIX(ConvolutionParameteriv)(GLenum target, GLenum pname, const GLint *params);
+GLAPI void APIENTRY GLAPI_PREFIX(CopyConvolutionFilter1D)(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width);
+GLAPI void APIENTRY GLAPI_PREFIX(CopyConvolutionFilter2D)(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height);
+GLAPI void APIENTRY GLAPI_PREFIX(GetConvolutionFilter)(GLenum target, GLenum format, GLenum type, GLvoid *image);
+void APIENTRY GLAPI_PREFIX(_dispatch_stub_356)(GLenum target, GLenum format, GLenum type, GLvoid *image);
+GLAPI void APIENTRY GLAPI_PREFIX(GetConvolutionParameterfv)(GLenum target, GLenum pname, GLfloat *params);
+void APIENTRY GLAPI_PREFIX(_dispatch_stub_357)(GLenum target, GLenum pname, GLfloat *params);
+GLAPI void APIENTRY GLAPI_PREFIX(GetConvolutionParameteriv)(GLenum target, GLenum pname, GLint *params);
+void APIENTRY GLAPI_PREFIX(_dispatch_stub_358)(GLenum target, GLenum pname, GLint *params);
+GLAPI void APIENTRY GLAPI_PREFIX(GetSeparableFilter)(GLenum target, GLenum format, GLenum type, GLvoid *row, GLvoid *column, GLvoid *span);
+void APIENTRY GLAPI_PREFIX(_dispatch_stub_359)(GLenum target, GLenum format, GLenum type, GLvoid *row, GLvoid *column, GLvoid *span);
+GLAPI void APIENTRY GLAPI_PREFIX(SeparableFilter2D)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *row, const GLvoid *column);
+GLAPI void APIENTRY GLAPI_PREFIX(GetHistogram)(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values);
+void APIENTRY GLAPI_PREFIX(_dispatch_stub_361)(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values);
+GLAPI void APIENTRY GLAPI_PREFIX(GetHistogramParameterfv)(GLenum target, GLenum pname, GLfloat *params);
+void APIENTRY GLAPI_PREFIX(_dispatch_stub_362)(GLenum target, GLenum pname, GLfloat *params);
+GLAPI void APIENTRY GLAPI_PREFIX(GetHistogramParameteriv)(GLenum target, GLenum pname, GLint *params);
+void APIENTRY GLAPI_PREFIX(_dispatch_stub_363)(GLenum target, GLenum pname, GLint *params);
+GLAPI void APIENTRY GLAPI_PREFIX(GetMinmax)(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values);
+void APIENTRY GLAPI_PREFIX(_dispatch_stub_364)(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values);
+GLAPI void APIENTRY GLAPI_PREFIX(GetMinmaxParameterfv)(GLenum target, GLenum pname, GLfloat *params);
+void APIENTRY GLAPI_PREFIX(_dispatch_stub_365)(GLenum target, GLenum pname, GLfloat *params);
+GLAPI void APIENTRY GLAPI_PREFIX(GetMinmaxParameteriv)(GLenum target, GLenum pname, GLint *params);
+void APIENTRY GLAPI_PREFIX(_dispatch_stub_366)(GLenum target, GLenum pname, GLint *params);
+GLAPI void APIENTRY GLAPI_PREFIX(Histogram)(GLenum target, GLsizei width, GLenum internalformat, GLboolean sink);
+GLAPI void APIENTRY GLAPI_PREFIX(Minmax)(GLenum target, GLenum internalformat, GLboolean sink);
+GLAPI void APIENTRY GLAPI_PREFIX(ResetHistogram)(GLenum target);
+GLAPI void APIENTRY GLAPI_PREFIX(ResetMinmax)(GLenum target);
+GLAPI void APIENTRY GLAPI_PREFIX(TexImage3D)(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
+GLAPI void APIENTRY GLAPI_PREFIX(TexImage3DEXT)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
+GLAPI void APIENTRY GLAPI_PREFIX(TexSubImage3D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels);
+GLAPI void APIENTRY GLAPI_PREFIX(TexSubImage3DEXT)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels);
+GLAPI void APIENTRY GLAPI_PREFIX(CopyTexSubImage3D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
+GLAPI void APIENTRY GLAPI_PREFIX(CopyTexSubImage3DEXT)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
+GLAPI void APIENTRY GLAPI_PREFIX(ActiveTextureARB)(GLenum texture);
+GLAPI void APIENTRY GLAPI_PREFIX(ActiveTexture)(GLenum texture);
+GLAPI void APIENTRY GLAPI_PREFIX(ClientActiveTextureARB)(GLenum texture);
+GLAPI void APIENTRY GLAPI_PREFIX(ClientActiveTexture)(GLenum texture);
+GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord1dARB)(GLenum target, GLdouble s);
+GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord1d)(GLenum target, GLdouble s);
+GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord1dvARB)(GLenum target, const GLdouble *v);
+GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord1dv)(GLenum target, const GLdouble *v);
+GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord1fARB)(GLenum target, GLfloat s);
+GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord1f)(GLenum target, GLfloat s);
+GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord1fvARB)(GLenum target, const GLfloat *v);
+GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord1fv)(GLenum target, const GLfloat *v);
+GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord1iARB)(GLenum target, GLint s);
+GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord1i)(GLenum target, GLint s);
+GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord1ivARB)(GLenum target, const GLint *v);
+GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord1iv)(GLenum target, const GLint *v);
+GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord1sARB)(GLenum target, GLshort s);
+GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord1s)(GLenum target, GLshort s);
+GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord1svARB)(GLenum target, const GLshort *v);
+GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord1sv)(GLenum target, const GLshort *v);
+GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord2dARB)(GLenum target, GLdouble s, GLdouble t);
+GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord2d)(GLenum target, GLdouble s, GLdouble t);
+GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord2dvARB)(GLenum target, const GLdouble *v);
+GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord2dv)(GLenum target, const GLdouble *v);
+GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord2fARB)(GLenum target, GLfloat s, GLfloat t);
+GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord2f)(GLenum target, GLfloat s, GLfloat t);
+GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord2fvARB)(GLenum target, const GLfloat *v);
+GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord2fv)(GLenum target, const GLfloat *v);
+GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord2iARB)(GLenum target, GLint s, GLint t);
+GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord2i)(GLenum target, GLint s, GLint t);
+GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord2ivARB)(GLenum target, const GLint *v);
+GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord2iv)(GLenum target, const GLint *v);
+GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord2sARB)(GLenum target, GLshort s, GLshort t);
+GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord2s)(GLenum target, GLshort s, GLshort t);
+GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord2svARB)(GLenum target, const GLshort *v);
+GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord2sv)(GLenum target, const GLshort *v);
+GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord3dARB)(GLenum target, GLdouble s, GLdouble t, GLdouble r);
+GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord3d)(GLenum target, GLdouble s, GLdouble t, GLdouble r);
+GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord3dvARB)(GLenum target, const GLdouble *v);
+GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord3dv)(GLenum target, const GLdouble *v);
+GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord3fARB)(GLenum target, GLfloat s, GLfloat t, GLfloat r);
+GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord3f)(GLenum target, GLfloat s, GLfloat t, GLfloat r);
+GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord3fvARB)(GLenum target, const GLfloat *v);
+GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord3fv)(GLenum target, const GLfloat *v);
+GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord3iARB)(GLenum target, GLint s, GLint t, GLint r);
+GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord3i)(GLenum target, GLint s, GLint t, GLint r);
+GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord3ivARB)(GLenum target, const GLint *v);
+GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord3iv)(GLenum target, const GLint *v);
+GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord3sARB)(GLenum target, GLshort s, GLshort t, GLshort r);
+GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord3s)(GLenum target, GLshort s, GLshort t, GLshort r);
+GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord3svARB)(GLenum target, const GLshort *v);
+GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord3sv)(GLenum target, const GLshort *v);
+GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord4dARB)(GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q);
+GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord4d)(GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q);
+GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord4dvARB)(GLenum target, const GLdouble *v);
+GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord4dv)(GLenum target, const GLdouble *v);
+GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord4fARB)(GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q);
+GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord4f)(GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q);
+GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord4fvARB)(GLenum target, const GLfloat *v);
+GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord4fv)(GLenum target, const GLfloat *v);
+GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord4iARB)(GLenum target, GLint s, GLint t, GLint r, GLint q);
+GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord4i)(GLenum target, GLint s, GLint t, GLint r, GLint q);
+GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord4ivARB)(GLenum target, const GLint *v);
+GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord4iv)(GLenum target, const GLint *v);
+GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord4sARB)(GLenum target, GLshort s, GLshort t, GLshort r, GLshort q);
+GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord4s)(GLenum target, GLshort s, GLshort t, GLshort r, GLshort q);
+GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord4svARB)(GLenum target, const GLshort *v);
+GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord4sv)(GLenum target, const GLshort *v);
+GLAPI void APIENTRY GLAPI_PREFIX(AttachShader)(GLuint program, GLuint shader);
+GLAPI GLuint APIENTRY GLAPI_PREFIX(CreateProgram)(void);
+GLAPI GLuint APIENTRY GLAPI_PREFIX(CreateShader)(GLenum type);
+GLAPI void APIENTRY GLAPI_PREFIX(DeleteProgram)(GLuint program);
+GLAPI void APIENTRY GLAPI_PREFIX(DeleteShader)(GLuint program);
+GLAPI void APIENTRY GLAPI_PREFIX(DetachShader)(GLuint program, GLuint shader);
+GLAPI void APIENTRY GLAPI_PREFIX(GetAttachedShaders)(GLuint program, GLsizei maxCount, GLsizei *count, GLuint *obj);
+GLAPI void APIENTRY GLAPI_PREFIX(GetProgramInfoLog)(GLuint program, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
+GLAPI void APIENTRY GLAPI_PREFIX(GetProgramiv)(GLuint program, GLenum pname, GLint *params);
+GLAPI void APIENTRY GLAPI_PREFIX(GetShaderInfoLog)(GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
+GLAPI void APIENTRY GLAPI_PREFIX(GetShaderiv)(GLuint shader, GLenum pname, GLint *params);
+GLAPI GLboolean APIENTRY GLAPI_PREFIX(IsProgram)(GLuint program);
+GLAPI GLboolean APIENTRY GLAPI_PREFIX(IsShader)(GLuint shader);
+GLAPI void APIENTRY GLAPI_PREFIX(StencilFuncSeparate)(GLenum face, GLenum func, GLint ref, GLuint mask);
+GLAPI void APIENTRY GLAPI_PREFIX(StencilMaskSeparate)(GLenum face, GLuint mask);
+GLAPI void APIENTRY GLAPI_PREFIX(StencilOpSeparate)(GLenum face, GLenum sfail, GLenum zfail, GLenum zpass);
+GLAPI void APIENTRY GLAPI_PREFIX(UniformMatrix2x3fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GLAPI void APIENTRY GLAPI_PREFIX(UniformMatrix2x4fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GLAPI void APIENTRY GLAPI_PREFIX(UniformMatrix3x2fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GLAPI void APIENTRY GLAPI_PREFIX(UniformMatrix3x4fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GLAPI void APIENTRY GLAPI_PREFIX(UniformMatrix4x2fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GLAPI void APIENTRY GLAPI_PREFIX(UniformMatrix4x3fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GLAPI void APIENTRY GLAPI_PREFIX(ClampColor)(GLenum target, GLenum clamp);
+GLAPI void APIENTRY GLAPI_PREFIX(ClearBufferfi)(GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil);
+GLAPI void APIENTRY GLAPI_PREFIX(ClearBufferfv)(GLenum buffer, GLint drawbuffer, const GLfloat *value);
+GLAPI void APIENTRY GLAPI_PREFIX(ClearBufferiv)(GLenum buffer, GLint drawbuffer, const GLint *value);
+GLAPI void APIENTRY GLAPI_PREFIX(ClearBufferuiv)(GLenum buffer, GLint drawbuffer, const GLuint *value);
+GLAPI const GLubyte * APIENTRY GLAPI_PREFIX(GetStringi)(GLenum name, GLuint index);
+GLAPI void APIENTRY GLAPI_PREFIX(TexBuffer)(GLenum target, GLenum internalFormat, GLuint buffer);
+GLAPI void APIENTRY GLAPI_PREFIX(FramebufferTexture)(GLenum target, GLenum attachment, GLuint texture, GLint level);
+GLAPI void APIENTRY GLAPI_PREFIX(GetBufferParameteri64v)(GLenum target, GLenum pname, GLint64 *params);
+GLAPI void APIENTRY GLAPI_PREFIX(GetInteger64i_v)(GLenum cap, GLuint index, GLint64 *data);
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribDivisor)(GLuint index, GLuint divisor);
+GLAPI void APIENTRY GLAPI_PREFIX(LoadTransposeMatrixdARB)(const GLdouble *m);
+GLAPI void APIENTRY GLAPI_PREFIX(LoadTransposeMatrixd)(const GLdouble *m);
+GLAPI void APIENTRY GLAPI_PREFIX(LoadTransposeMatrixfARB)(const GLfloat *m);
+GLAPI void APIENTRY GLAPI_PREFIX(LoadTransposeMatrixf)(const GLfloat *m);
+GLAPI void APIENTRY GLAPI_PREFIX(MultTransposeMatrixdARB)(const GLdouble *m);
+GLAPI void APIENTRY GLAPI_PREFIX(MultTransposeMatrixd)(const GLdouble *m);
+GLAPI void APIENTRY GLAPI_PREFIX(MultTransposeMatrixfARB)(const GLfloat *m);
+GLAPI void APIENTRY GLAPI_PREFIX(MultTransposeMatrixf)(const GLfloat *m);
+GLAPI void APIENTRY GLAPI_PREFIX(SampleCoverageARB)(GLclampf value, GLboolean invert);
+GLAPI void APIENTRY GLAPI_PREFIX(SampleCoverage)(GLclampf value, GLboolean invert);
+GLAPI void APIENTRY GLAPI_PREFIX(CompressedTexImage1DARB)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data);
+GLAPI void APIENTRY GLAPI_PREFIX(CompressedTexImage1D)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data);
+GLAPI void APIENTRY GLAPI_PREFIX(CompressedTexImage2DARB)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data);
+GLAPI void APIENTRY GLAPI_PREFIX(CompressedTexImage2D)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data);
+GLAPI void APIENTRY GLAPI_PREFIX(CompressedTexImage3DARB)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data);
+GLAPI void APIENTRY GLAPI_PREFIX(CompressedTexImage3D)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data);
+GLAPI void APIENTRY GLAPI_PREFIX(CompressedTexSubImage1DARB)(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data);
+GLAPI void APIENTRY GLAPI_PREFIX(CompressedTexSubImage1D)(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data);
+GLAPI void APIENTRY GLAPI_PREFIX(CompressedTexSubImage2DARB)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data);
+GLAPI void APIENTRY GLAPI_PREFIX(CompressedTexSubImage2D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data);
+GLAPI void APIENTRY GLAPI_PREFIX(CompressedTexSubImage3DARB)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data);
+GLAPI void APIENTRY GLAPI_PREFIX(CompressedTexSubImage3D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data);
+GLAPI void APIENTRY GLAPI_PREFIX(GetCompressedTexImageARB)(GLenum target, GLint level, GLvoid *img);
+GLAPI void APIENTRY GLAPI_PREFIX(GetCompressedTexImage)(GLenum target, GLint level, GLvoid *img);
+GLAPI void APIENTRY GLAPI_PREFIX(DisableVertexAttribArrayARB)(GLuint index);
+GLAPI void APIENTRY GLAPI_PREFIX(DisableVertexAttribArray)(GLuint index);
+GLAPI void APIENTRY GLAPI_PREFIX(EnableVertexAttribArrayARB)(GLuint index);
+GLAPI void APIENTRY GLAPI_PREFIX(EnableVertexAttribArray)(GLuint index);
+GLAPI void APIENTRY GLAPI_PREFIX(GetProgramEnvParameterdvARB)(GLenum target, GLuint index, GLdouble *params);
+GLAPI void APIENTRY GLAPI_PREFIX(GetProgramEnvParameterfvARB)(GLenum target, GLuint index, GLfloat *params);
+GLAPI void APIENTRY GLAPI_PREFIX(GetProgramLocalParameterdvARB)(GLenum target, GLuint index, GLdouble *params);
+GLAPI void APIENTRY GLAPI_PREFIX(GetProgramLocalParameterfvARB)(GLenum target, GLuint index, GLfloat *params);
+GLAPI void APIENTRY GLAPI_PREFIX(GetProgramStringARB)(GLenum target, GLenum pname, GLvoid *string);
+GLAPI void APIENTRY GLAPI_PREFIX(GetProgramivARB)(GLenum target, GLenum pname, GLint *params);
+GLAPI void APIENTRY GLAPI_PREFIX(GetVertexAttribdvARB)(GLuint index, GLenum pname, GLdouble *params);
+GLAPI void APIENTRY GLAPI_PREFIX(GetVertexAttribdv)(GLuint index, GLenum pname, GLdouble *params);
+GLAPI void APIENTRY GLAPI_PREFIX(GetVertexAttribfvARB)(GLuint index, GLenum pname, GLfloat *params);
+GLAPI void APIENTRY GLAPI_PREFIX(GetVertexAttribfv)(GLuint index, GLenum pname, GLfloat *params);
+GLAPI void APIENTRY GLAPI_PREFIX(GetVertexAttribivARB)(GLuint index, GLenum pname, GLint *params);
+GLAPI void APIENTRY GLAPI_PREFIX(GetVertexAttribiv)(GLuint index, GLenum pname, GLint *params);
+GLAPI void APIENTRY GLAPI_PREFIX(ProgramEnvParameter4dARB)(GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+GLAPI void APIENTRY GLAPI_PREFIX(ProgramParameter4dNV)(GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+GLAPI void APIENTRY GLAPI_PREFIX(ProgramEnvParameter4dvARB)(GLenum target, GLuint index, const GLdouble *params);
+GLAPI void APIENTRY GLAPI_PREFIX(ProgramParameter4dvNV)(GLenum target, GLuint index, const GLdouble *params);
+GLAPI void APIENTRY GLAPI_PREFIX(ProgramEnvParameter4fARB)(GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+GLAPI void APIENTRY GLAPI_PREFIX(ProgramParameter4fNV)(GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+GLAPI void APIENTRY GLAPI_PREFIX(ProgramEnvParameter4fvARB)(GLenum target, GLuint index, const GLfloat *params);
+GLAPI void APIENTRY GLAPI_PREFIX(ProgramParameter4fvNV)(GLenum target, GLuint index, const GLfloat *params);
+GLAPI void APIENTRY GLAPI_PREFIX(ProgramLocalParameter4dARB)(GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+GLAPI void APIENTRY GLAPI_PREFIX(ProgramLocalParameter4dvARB)(GLenum target, GLuint index, const GLdouble *params);
+GLAPI void APIENTRY GLAPI_PREFIX(ProgramLocalParameter4fARB)(GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+GLAPI void APIENTRY GLAPI_PREFIX(ProgramLocalParameter4fvARB)(GLenum target, GLuint index, const GLfloat *params);
+GLAPI void APIENTRY GLAPI_PREFIX(ProgramStringARB)(GLenum target, GLenum format, GLsizei len, const GLvoid *string);
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib1dARB)(GLuint index, GLdouble x);
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib1d)(GLuint index, GLdouble x);
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib1dvARB)(GLuint index, const GLdouble *v);
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib1dv)(GLuint index, const GLdouble *v);
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib1fARB)(GLuint index, GLfloat x);
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib1f)(GLuint index, GLfloat x);
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib1fvARB)(GLuint index, const GLfloat *v);
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib1fv)(GLuint index, const GLfloat *v);
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib1sARB)(GLuint index, GLshort x);
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib1s)(GLuint index, GLshort x);
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib1svARB)(GLuint index, const GLshort *v);
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib1sv)(GLuint index, const GLshort *v);
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib2dARB)(GLuint index, GLdouble x, GLdouble y);
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib2d)(GLuint index, GLdouble x, GLdouble y);
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib2dvARB)(GLuint index, const GLdouble *v);
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib2dv)(GLuint index, const GLdouble *v);
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib2fARB)(GLuint index, GLfloat x, GLfloat y);
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib2f)(GLuint index, GLfloat x, GLfloat y);
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib2fvARB)(GLuint index, const GLfloat *v);
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib2fv)(GLuint index, const GLfloat *v);
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib2sARB)(GLuint index, GLshort x, GLshort y);
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib2s)(GLuint index, GLshort x, GLshort y);
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib2svARB)(GLuint index, const GLshort *v);
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib2sv)(GLuint index, const GLshort *v);
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib3dARB)(GLuint index, GLdouble x, GLdouble y, GLdouble z);
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib3d)(GLuint index, GLdouble x, GLdouble y, GLdouble z);
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib3dvARB)(GLuint index, const GLdouble *v);
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib3dv)(GLuint index, const GLdouble *v);
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib3fARB)(GLuint index, GLfloat x, GLfloat y, GLfloat z);
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib3f)(GLuint index, GLfloat x, GLfloat y, GLfloat z);
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib3fvARB)(GLuint index, const GLfloat *v);
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib3fv)(GLuint index, const GLfloat *v);
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib3sARB)(GLuint index, GLshort x, GLshort y, GLshort z);
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib3s)(GLuint index, GLshort x, GLshort y, GLshort z);
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib3svARB)(GLuint index, const GLshort *v);
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib3sv)(GLuint index, const GLshort *v);
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib4NbvARB)(GLuint index, const GLbyte *v);
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib4Nbv)(GLuint index, const GLbyte *v);
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib4NivARB)(GLuint index, const GLint *v);
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib4Niv)(GLuint index, const GLint *v);
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib4NsvARB)(GLuint index, const GLshort *v);
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib4Nsv)(GLuint index, const GLshort *v);
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib4NubARB)(GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w);
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib4Nub)(GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w);
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib4NubvARB)(GLuint index, const GLubyte *v);
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib4Nubv)(GLuint index, const GLubyte *v);
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib4NuivARB)(GLuint index, const GLuint *v);
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib4Nuiv)(GLuint index, const GLuint *v);
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib4NusvARB)(GLuint index, const GLushort *v);
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib4Nusv)(GLuint index, const GLushort *v);
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib4bvARB)(GLuint index, const GLbyte *v);
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib4bv)(GLuint index, const GLbyte *v);
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib4dARB)(GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib4d)(GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib4dvARB)(GLuint index, const GLdouble *v);
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib4dv)(GLuint index, const GLdouble *v);
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib4fARB)(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib4f)(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib4fvARB)(GLuint index, const GLfloat *v);
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib4fv)(GLuint index, const GLfloat *v);
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib4ivARB)(GLuint index, const GLint *v);
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib4iv)(GLuint index, const GLint *v);
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib4sARB)(GLuint index, GLshort x, GLshort y, GLshort z, GLshort w);
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib4s)(GLuint index, GLshort x, GLshort y, GLshort z, GLshort w);
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib4svARB)(GLuint index, const GLshort *v);
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib4sv)(GLuint index, const GLshort *v);
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib4ubvARB)(GLuint index, const GLubyte *v);
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib4ubv)(GLuint index, const GLubyte *v);
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib4uivARB)(GLuint index, const GLuint *v);
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib4uiv)(GLuint index, const GLuint *v);
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib4usvARB)(GLuint index, const GLushort *v);
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib4usv)(GLuint index, const GLushort *v);
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribPointerARB)(GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *pointer);
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribPointer)(GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *pointer);
+GLAPI void APIENTRY GLAPI_PREFIX(BindBufferARB)(GLenum target, GLuint buffer);
+GLAPI void APIENTRY GLAPI_PREFIX(BindBuffer)(GLenum target, GLuint buffer);
+GLAPI void APIENTRY GLAPI_PREFIX(BufferDataARB)(GLenum target, GLsizeiptrARB size, const GLvoid *data, GLenum usage);
+GLAPI void APIENTRY GLAPI_PREFIX(BufferData)(GLenum target, GLsizeiptr size, const GLvoid *data, GLenum usage);
+GLAPI void APIENTRY GLAPI_PREFIX(BufferSubDataARB)(GLenum target, GLintptrARB offset, GLsizeiptrARB size, const GLvoid *data);
+GLAPI void APIENTRY GLAPI_PREFIX(BufferSubData)(GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid *data);
+GLAPI void APIENTRY GLAPI_PREFIX(DeleteBuffersARB)(GLsizei n, const GLuint *buffer);
+GLAPI void APIENTRY GLAPI_PREFIX(DeleteBuffers)(GLsizei n, const GLuint *buffer);
+GLAPI void APIENTRY GLAPI_PREFIX(GenBuffersARB)(GLsizei n, GLuint *buffer);
+GLAPI void APIENTRY GLAPI_PREFIX(GenBuffers)(GLsizei n, GLuint *buffer);
+GLAPI void APIENTRY GLAPI_PREFIX(GetBufferParameterivARB)(GLenum target, GLenum pname, GLint *params);
+GLAPI void APIENTRY GLAPI_PREFIX(GetBufferParameteriv)(GLenum target, GLenum pname, GLint *params);
+GLAPI void APIENTRY GLAPI_PREFIX(GetBufferPointervARB)(GLenum target, GLenum pname, GLvoid **params);
+GLAPI void APIENTRY GLAPI_PREFIX(GetBufferPointerv)(GLenum target, GLenum pname, GLvoid **params);
+GLAPI void APIENTRY GLAPI_PREFIX(GetBufferSubDataARB)(GLenum target, GLintptrARB offset, GLsizeiptrARB size, GLvoid *data);
+GLAPI void APIENTRY GLAPI_PREFIX(GetBufferSubData)(GLenum target, GLintptr offset, GLsizeiptr size, GLvoid *data);
+GLAPI GLboolean APIENTRY GLAPI_PREFIX(IsBufferARB)(GLuint buffer);
+GLAPI GLboolean APIENTRY GLAPI_PREFIX(IsBuffer)(GLuint buffer);
+GLAPI GLvoid * APIENTRY GLAPI_PREFIX(MapBufferARB)(GLenum target, GLenum access);
+GLAPI GLvoid * APIENTRY GLAPI_PREFIX(MapBuffer)(GLenum target, GLenum access);
+GLAPI GLboolean APIENTRY GLAPI_PREFIX(UnmapBufferARB)(GLenum target);
+GLAPI GLboolean APIENTRY GLAPI_PREFIX(UnmapBuffer)(GLenum target);
+GLAPI void APIENTRY GLAPI_PREFIX(BeginQueryARB)(GLenum target, GLuint id);
+GLAPI void APIENTRY GLAPI_PREFIX(BeginQuery)(GLenum target, GLuint id);
+GLAPI void APIENTRY GLAPI_PREFIX(DeleteQueriesARB)(GLsizei n, const GLuint *ids);
+GLAPI void APIENTRY GLAPI_PREFIX(DeleteQueries)(GLsizei n, const GLuint *ids);
+GLAPI void APIENTRY GLAPI_PREFIX(EndQueryARB)(GLenum target);
+GLAPI void APIENTRY GLAPI_PREFIX(EndQuery)(GLenum target);
+GLAPI void APIENTRY GLAPI_PREFIX(GenQueriesARB)(GLsizei n, GLuint *ids);
+GLAPI void APIENTRY GLAPI_PREFIX(GenQueries)(GLsizei n, GLuint *ids);
+GLAPI void APIENTRY GLAPI_PREFIX(GetQueryObjectivARB)(GLuint id, GLenum pname, GLint *params);
+GLAPI void APIENTRY GLAPI_PREFIX(GetQueryObjectiv)(GLuint id, GLenum pname, GLint *params);
+GLAPI void APIENTRY GLAPI_PREFIX(GetQueryObjectuivARB)(GLuint id, GLenum pname, GLuint *params);
+GLAPI void APIENTRY GLAPI_PREFIX(GetQueryObjectuiv)(GLuint id, GLenum pname, GLuint *params);
+GLAPI void APIENTRY GLAPI_PREFIX(GetQueryivARB)(GLenum target, GLenum pname, GLint *params);
+GLAPI void APIENTRY GLAPI_PREFIX(GetQueryiv)(GLenum target, GLenum pname, GLint *params);
+GLAPI GLboolean APIENTRY GLAPI_PREFIX(IsQueryARB)(GLuint id);
+GLAPI GLboolean APIENTRY GLAPI_PREFIX(IsQuery)(GLuint id);
+GLAPI void APIENTRY GLAPI_PREFIX(AttachObjectARB)(GLhandleARB containerObj, GLhandleARB obj);
+GLAPI void APIENTRY GLAPI_PREFIX(CompileShaderARB)(GLhandleARB shader);
+GLAPI void APIENTRY GLAPI_PREFIX(CompileShader)(GLuint shader);
+GLAPI GLhandleARB APIENTRY GLAPI_PREFIX(CreateProgramObjectARB)(void);
+GLAPI GLhandleARB APIENTRY GLAPI_PREFIX(CreateShaderObjectARB)(GLenum shaderType);
+GLAPI void APIENTRY GLAPI_PREFIX(DeleteObjectARB)(GLhandleARB obj);
+GLAPI void APIENTRY GLAPI_PREFIX(DetachObjectARB)(GLhandleARB containerObj, GLhandleARB attachedObj);
+GLAPI void APIENTRY GLAPI_PREFIX(GetActiveUniformARB)(GLhandleARB program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLcharARB *name);
+GLAPI void APIENTRY GLAPI_PREFIX(GetActiveUniform)(GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name);
+GLAPI void APIENTRY GLAPI_PREFIX(GetAttachedObjectsARB)(GLhandleARB containerObj, GLsizei maxLength, GLsizei *length, GLhandleARB *infoLog);
+GLAPI GLhandleARB APIENTRY GLAPI_PREFIX(GetHandleARB)(GLenum pname);
+GLAPI void APIENTRY GLAPI_PREFIX(GetInfoLogARB)(GLhandleARB obj, GLsizei maxLength, GLsizei *length, GLcharARB *infoLog);
+GLAPI void APIENTRY GLAPI_PREFIX(GetObjectParameterfvARB)(GLhandleARB obj, GLenum pname, GLfloat *params);
+GLAPI void APIENTRY GLAPI_PREFIX(GetObjectParameterivARB)(GLhandleARB obj, GLenum pname, GLint *params);
+GLAPI void APIENTRY GLAPI_PREFIX(GetShaderSourceARB)(GLhandleARB shader, GLsizei bufSize, GLsizei *length, GLcharARB *source);
+GLAPI void APIENTRY GLAPI_PREFIX(GetShaderSource)(GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *source);
+GLAPI GLint APIENTRY GLAPI_PREFIX(GetUniformLocationARB)(GLhandleARB program, const GLcharARB *name);
+GLAPI GLint APIENTRY GLAPI_PREFIX(GetUniformLocation)(GLuint program, const GLchar *name);
+GLAPI void APIENTRY GLAPI_PREFIX(GetUniformfvARB)(GLhandleARB program, GLint location, GLfloat *params);
+GLAPI void APIENTRY GLAPI_PREFIX(GetUniformfv)(GLuint program, GLint location, GLfloat *params);
+GLAPI void APIENTRY GLAPI_PREFIX(GetUniformivARB)(GLhandleARB program, GLint location, GLint *params);
+GLAPI void APIENTRY GLAPI_PREFIX(GetUniformiv)(GLuint program, GLint location, GLint *params);
+GLAPI void APIENTRY GLAPI_PREFIX(LinkProgramARB)(GLhandleARB program);
+GLAPI void APIENTRY GLAPI_PREFIX(LinkProgram)(GLuint program);
+GLAPI void APIENTRY GLAPI_PREFIX(ShaderSourceARB)(GLhandleARB shader, GLsizei count, const GLcharARB **string, const GLint *length);
+GLAPI void APIENTRY GLAPI_PREFIX(ShaderSource)(GLuint shader, GLsizei count, const GLchar **string, const GLint *length);
+GLAPI void APIENTRY GLAPI_PREFIX(Uniform1fARB)(GLint location, GLfloat v0);
+GLAPI void APIENTRY GLAPI_PREFIX(Uniform1f)(GLint location, GLfloat v0);
+GLAPI void APIENTRY GLAPI_PREFIX(Uniform1fvARB)(GLint location, GLsizei count, const GLfloat *value);
+GLAPI void APIENTRY GLAPI_PREFIX(Uniform1fv)(GLint location, GLsizei count, const GLfloat *value);
+GLAPI void APIENTRY GLAPI_PREFIX(Uniform1iARB)(GLint location, GLint v0);
+GLAPI void APIENTRY GLAPI_PREFIX(Uniform1i)(GLint location, GLint v0);
+GLAPI void APIENTRY GLAPI_PREFIX(Uniform1ivARB)(GLint location, GLsizei count, const GLint *value);
+GLAPI void APIENTRY GLAPI_PREFIX(Uniform1iv)(GLint location, GLsizei count, const GLint *value);
+GLAPI void APIENTRY GLAPI_PREFIX(Uniform2fARB)(GLint location, GLfloat v0, GLfloat v1);
+GLAPI void APIENTRY GLAPI_PREFIX(Uniform2f)(GLint location, GLfloat v0, GLfloat v1);
+GLAPI void APIENTRY GLAPI_PREFIX(Uniform2fvARB)(GLint location, GLsizei count, const GLfloat *value);
+GLAPI void APIENTRY GLAPI_PREFIX(Uniform2fv)(GLint location, GLsizei count, const GLfloat *value);
+GLAPI void APIENTRY GLAPI_PREFIX(Uniform2iARB)(GLint location, GLint v0, GLint v1);
+GLAPI void APIENTRY GLAPI_PREFIX(Uniform2i)(GLint location, GLint v0, GLint v1);
+GLAPI void APIENTRY GLAPI_PREFIX(Uniform2ivARB)(GLint location, GLsizei count, const GLint *value);
+GLAPI void APIENTRY GLAPI_PREFIX(Uniform2iv)(GLint location, GLsizei count, const GLint *value);
+GLAPI void APIENTRY GLAPI_PREFIX(Uniform3fARB)(GLint location, GLfloat v0, GLfloat v1, GLfloat v2);
+GLAPI void APIENTRY GLAPI_PREFIX(Uniform3f)(GLint location, GLfloat v0, GLfloat v1, GLfloat v2);
+GLAPI void APIENTRY GLAPI_PREFIX(Uniform3fvARB)(GLint location, GLsizei count, const GLfloat *value);
+GLAPI void APIENTRY GLAPI_PREFIX(Uniform3fv)(GLint location, GLsizei count, const GLfloat *value);
+GLAPI void APIENTRY GLAPI_PREFIX(Uniform3iARB)(GLint location, GLint v0, GLint v1, GLint v2);
+GLAPI void APIENTRY GLAPI_PREFIX(Uniform3i)(GLint location, GLint v0, GLint v1, GLint v2);
+GLAPI void APIENTRY GLAPI_PREFIX(Uniform3ivARB)(GLint location, GLsizei count, const GLint *value);
+GLAPI void APIENTRY GLAPI_PREFIX(Uniform3iv)(GLint location, GLsizei count, const GLint *value);
+GLAPI void APIENTRY GLAPI_PREFIX(Uniform4fARB)(GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);
+GLAPI void APIENTRY GLAPI_PREFIX(Uniform4f)(GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);
+GLAPI void APIENTRY GLAPI_PREFIX(Uniform4fvARB)(GLint location, GLsizei count, const GLfloat *value);
+GLAPI void APIENTRY GLAPI_PREFIX(Uniform4fv)(GLint location, GLsizei count, const GLfloat *value);
+GLAPI void APIENTRY GLAPI_PREFIX(Uniform4iARB)(GLint location, GLint v0, GLint v1, GLint v2, GLint v3);
+GLAPI void APIENTRY GLAPI_PREFIX(Uniform4i)(GLint location, GLint v0, GLint v1, GLint v2, GLint v3);
+GLAPI void APIENTRY GLAPI_PREFIX(Uniform4ivARB)(GLint location, GLsizei count, const GLint *value);
+GLAPI void APIENTRY GLAPI_PREFIX(Uniform4iv)(GLint location, GLsizei count, const GLint *value);
+GLAPI void APIENTRY GLAPI_PREFIX(UniformMatrix2fvARB)(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GLAPI void APIENTRY GLAPI_PREFIX(UniformMatrix2fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GLAPI void APIENTRY GLAPI_PREFIX(UniformMatrix3fvARB)(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GLAPI void APIENTRY GLAPI_PREFIX(UniformMatrix3fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GLAPI void APIENTRY GLAPI_PREFIX(UniformMatrix4fvARB)(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GLAPI void APIENTRY GLAPI_PREFIX(UniformMatrix4fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GLAPI void APIENTRY GLAPI_PREFIX(UseProgramObjectARB)(GLhandleARB program);
+GLAPI void APIENTRY GLAPI_PREFIX(UseProgram)(GLuint program);
+GLAPI void APIENTRY GLAPI_PREFIX(ValidateProgramARB)(GLhandleARB program);
+GLAPI void APIENTRY GLAPI_PREFIX(ValidateProgram)(GLuint program);
+GLAPI void APIENTRY GLAPI_PREFIX(BindAttribLocationARB)(GLhandleARB program, GLuint index, const GLcharARB *name);
+GLAPI void APIENTRY GLAPI_PREFIX(BindAttribLocation)(GLuint program, GLuint index, const GLchar *name);
+GLAPI void APIENTRY GLAPI_PREFIX(GetActiveAttribARB)(GLhandleARB program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLcharARB *name);
+GLAPI void APIENTRY GLAPI_PREFIX(GetActiveAttrib)(GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name);
+GLAPI GLint APIENTRY GLAPI_PREFIX(GetAttribLocationARB)(GLhandleARB program, const GLcharARB *name);
+GLAPI GLint APIENTRY GLAPI_PREFIX(GetAttribLocation)(GLuint program, const GLchar *name);
+GLAPI void APIENTRY GLAPI_PREFIX(DrawBuffersARB)(GLsizei n, const GLenum *bufs);
+GLAPI void APIENTRY GLAPI_PREFIX(DrawBuffers)(GLsizei n, const GLenum *bufs);
+GLAPI void APIENTRY GLAPI_PREFIX(DrawBuffersATI)(GLsizei n, const GLenum *bufs);
+GLAPI void APIENTRY GLAPI_PREFIX(ClampColorARB)(GLenum target, GLenum clamp);
+GLAPI void APIENTRY GLAPI_PREFIX(DrawArraysInstancedARB)(GLenum mode, GLint first, GLsizei count, GLsizei primcount);
+GLAPI void APIENTRY GLAPI_PREFIX(DrawArraysInstanced)(GLenum mode, GLint first, GLsizei count, GLsizei primcount);
+GLAPI void APIENTRY GLAPI_PREFIX(DrawArraysInstancedEXT)(GLenum mode, GLint first, GLsizei count, GLsizei primcount);
+GLAPI void APIENTRY GLAPI_PREFIX(DrawElementsInstancedARB)(GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount);
+GLAPI void APIENTRY GLAPI_PREFIX(DrawElementsInstanced)(GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount);
+GLAPI void APIENTRY GLAPI_PREFIX(DrawElementsInstancedEXT)(GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount);
+GLAPI void APIENTRY GLAPI_PREFIX(RenderbufferStorageMultisample)(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
+GLAPI void APIENTRY GLAPI_PREFIX(RenderbufferStorageMultisampleEXT)(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
+GLAPI void APIENTRY GLAPI_PREFIX(FramebufferTextureARB)(GLenum target, GLenum attachment, GLuint texture, GLint level);
+GLAPI void APIENTRY GLAPI_PREFIX(FramebufferTextureFaceARB)(GLenum target, GLenum attachment, GLuint texture, GLint level, GLenum face);
+GLAPI void APIENTRY GLAPI_PREFIX(ProgramParameteriARB)(GLuint program, GLenum pname, GLint value);
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribDivisorARB)(GLuint index, GLuint divisor);
+GLAPI void APIENTRY GLAPI_PREFIX(FlushMappedBufferRange)(GLenum target, GLintptr offset, GLsizeiptr length);
+GLAPI GLvoid * APIENTRY GLAPI_PREFIX(MapBufferRange)(GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access);
+GLAPI void APIENTRY GLAPI_PREFIX(TexBufferARB)(GLenum target, GLenum internalFormat, GLuint buffer);
+GLAPI void APIENTRY GLAPI_PREFIX(BindVertexArray)(GLuint array);
+GLAPI void APIENTRY GLAPI_PREFIX(GenVertexArrays)(GLsizei n, GLuint *arrays);
+GLAPI void APIENTRY GLAPI_PREFIX(CopyBufferSubData)(GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size);
+GLAPI GLenum APIENTRY GLAPI_PREFIX(ClientWaitSync)(GLsync sync, GLbitfield flags, GLuint64 timeout);
+GLAPI void APIENTRY GLAPI_PREFIX(DeleteSync)(GLsync sync);
+GLAPI GLsync APIENTRY GLAPI_PREFIX(FenceSync)(GLenum condition, GLbitfield flags);
+GLAPI void APIENTRY GLAPI_PREFIX(GetInteger64v)(GLenum pname, GLint64 *params);
+GLAPI void APIENTRY GLAPI_PREFIX(GetSynciv)(GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values);
+GLAPI GLboolean APIENTRY GLAPI_PREFIX(IsSync)(GLsync sync);
+GLAPI void APIENTRY GLAPI_PREFIX(WaitSync)(GLsync sync, GLbitfield flags, GLuint64 timeout);
+GLAPI void APIENTRY GLAPI_PREFIX(DrawElementsBaseVertex)(GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLint basevertex);
+GLAPI void APIENTRY GLAPI_PREFIX(DrawRangeElementsBaseVertex)(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices, GLint basevertex);
+GLAPI void APIENTRY GLAPI_PREFIX(MultiDrawElementsBaseVertex)(GLenum mode, const GLsizei *count, GLenum type, const GLvoid **indices, GLsizei primcount, const GLint *basevertex);
+GLAPI void APIENTRY GLAPI_PREFIX(BlendEquationSeparateiARB)(GLuint buf, GLenum modeRGB, GLenum modeA);
+GLAPI void APIENTRY GLAPI_PREFIX(BlendEquationSeparateIndexedAMD)(GLuint buf, GLenum modeRGB, GLenum modeA);
+GLAPI void APIENTRY GLAPI_PREFIX(BlendEquationiARB)(GLuint buf, GLenum mode);
+GLAPI void APIENTRY GLAPI_PREFIX(BlendEquationIndexedAMD)(GLuint buf, GLenum mode);
+GLAPI void APIENTRY GLAPI_PREFIX(BlendFuncSeparateiARB)(GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcA, GLenum dstA);
+GLAPI void APIENTRY GLAPI_PREFIX(BlendFuncSeparateIndexedAMD)(GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcA, GLenum dstA);
+GLAPI void APIENTRY GLAPI_PREFIX(BlendFunciARB)(GLuint buf, GLenum src, GLenum dst);
+GLAPI void APIENTRY GLAPI_PREFIX(BlendFuncIndexedAMD)(GLuint buf, GLenum src, GLenum dst);
+GLAPI void APIENTRY GLAPI_PREFIX(BindSampler)(GLuint unit, GLuint sampler);
+GLAPI void APIENTRY GLAPI_PREFIX(DeleteSamplers)(GLsizei count, const GLuint *samplers);
+GLAPI void APIENTRY GLAPI_PREFIX(GenSamplers)(GLsizei count, GLuint *samplers);
+GLAPI void APIENTRY GLAPI_PREFIX(GetSamplerParameterIiv)(GLuint sampler, GLenum pname, GLint *params);
+GLAPI void APIENTRY GLAPI_PREFIX(GetSamplerParameterIuiv)(GLuint sampler, GLenum pname, GLuint *params);
+GLAPI void APIENTRY GLAPI_PREFIX(GetSamplerParameterfv)(GLuint sampler, GLenum pname, GLfloat *params);
+GLAPI void APIENTRY GLAPI_PREFIX(GetSamplerParameteriv)(GLuint sampler, GLenum pname, GLint *params);
+GLAPI GLboolean APIENTRY GLAPI_PREFIX(IsSampler)(GLuint sampler);
+GLAPI void APIENTRY GLAPI_PREFIX(SamplerParameterIiv)(GLuint sampler, GLenum pname, const GLint *params);
+GLAPI void APIENTRY GLAPI_PREFIX(SamplerParameterIuiv)(GLuint sampler, GLenum pname, const GLuint *params);
+GLAPI void APIENTRY GLAPI_PREFIX(SamplerParameterf)(GLuint sampler, GLenum pname, GLfloat param);
+GLAPI void APIENTRY GLAPI_PREFIX(SamplerParameterfv)(GLuint sampler, GLenum pname, const GLfloat *params);
+GLAPI void APIENTRY GLAPI_PREFIX(SamplerParameteri)(GLuint sampler, GLenum pname, GLint param);
+GLAPI void APIENTRY GLAPI_PREFIX(SamplerParameteriv)(GLuint sampler, GLenum pname, const GLint *params);
+GLAPI void APIENTRY GLAPI_PREFIX(BindTransformFeedback)(GLenum target, GLuint id);
+GLAPI void APIENTRY GLAPI_PREFIX(DeleteTransformFeedbacks)(GLsizei n, const GLuint *ids);
+GLAPI void APIENTRY GLAPI_PREFIX(DrawTransformFeedback)(GLenum mode, GLuint id);
+GLAPI void APIENTRY GLAPI_PREFIX(GenTransformFeedbacks)(GLsizei n, GLuint *ids);
+GLAPI GLboolean APIENTRY GLAPI_PREFIX(IsTransformFeedback)(GLuint id);
+GLAPI void APIENTRY GLAPI_PREFIX(PauseTransformFeedback)(void);
+GLAPI void APIENTRY GLAPI_PREFIX(ResumeTransformFeedback)(void);
+GLAPI void APIENTRY GLAPI_PREFIX(ClearDepthf)(GLclampf depth);
+GLAPI void APIENTRY GLAPI_PREFIX(DepthRangef)(GLclampf zNear, GLclampf zFar);
+GLAPI void APIENTRY GLAPI_PREFIX(GetShaderPrecisionFormat)(GLenum shadertype, GLenum precisiontype, GLint *range, GLint *precision);
+GLAPI void APIENTRY GLAPI_PREFIX(ReleaseShaderCompiler)(void);
+GLAPI void APIENTRY GLAPI_PREFIX(ShaderBinary)(GLsizei n, const GLuint *shaders, GLenum binaryformat, const GLvoid *binary, GLsizei length);
+void APIENTRY GLAPI_PREFIX(_dispatch_stub_626)(GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, GLvoid *binary);
+void APIENTRY GLAPI_PREFIX(_dispatch_stub_627)(GLuint program, GLenum binaryFormat, const GLvoid *binary, GLsizei length);
+void APIENTRY GLAPI_PREFIX(_dispatch_stub_628)(GLuint program, GLenum pname, GLint value);
+GLAPI GLenum APIENTRY GLAPI_PREFIX(GetGraphicsResetStatusARB)(void);
+GLAPI void APIENTRY GLAPI_PREFIX(GetnColorTableARB)(GLenum target, GLenum format, GLenum type, GLsizei bufSize, GLvoid *table);
+GLAPI void APIENTRY GLAPI_PREFIX(GetnCompressedTexImageARB)(GLenum target, GLint lod, GLsizei bufSize, GLvoid *img);
+GLAPI void APIENTRY GLAPI_PREFIX(GetnConvolutionFilterARB)(GLenum target, GLenum format, GLenum type, GLsizei bufSize, GLvoid *image);
+GLAPI void APIENTRY GLAPI_PREFIX(GetnHistogramARB)(GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, GLvoid *values);
+GLAPI void APIENTRY GLAPI_PREFIX(GetnMapdvARB)(GLenum target, GLenum query, GLsizei bufSize, GLdouble *v);
+GLAPI void APIENTRY GLAPI_PREFIX(GetnMapfvARB)(GLenum target, GLenum query, GLsizei bufSize, GLfloat *v);
+GLAPI void APIENTRY GLAPI_PREFIX(GetnMapivARB)(GLenum target, GLenum query, GLsizei bufSize, GLint *v);
+GLAPI void APIENTRY GLAPI_PREFIX(GetnMinmaxARB)(GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, GLvoid *values);
+GLAPI void APIENTRY GLAPI_PREFIX(GetnPixelMapfvARB)(GLenum map, GLsizei bufSize, GLfloat *values);
+GLAPI void APIENTRY GLAPI_PREFIX(GetnPixelMapuivARB)(GLenum map, GLsizei bufSize, GLuint *values);
+GLAPI void APIENTRY GLAPI_PREFIX(GetnPixelMapusvARB)(GLenum map, GLsizei bufSize, GLushort *values);
+GLAPI void APIENTRY GLAPI_PREFIX(GetnPolygonStippleARB)(GLsizei bufSize, GLubyte *pattern);
+GLAPI void APIENTRY GLAPI_PREFIX(GetnSeparableFilterARB)(GLenum target, GLenum format, GLenum type, GLsizei rowBufSize, GLvoid *row, GLsizei columnBufSize, GLvoid *column, GLvoid *span);
+GLAPI void APIENTRY GLAPI_PREFIX(GetnTexImageARB)(GLenum target, GLint level, GLenum format, GLenum type, GLsizei bufSize, GLvoid *img);
+GLAPI void APIENTRY GLAPI_PREFIX(GetnUniformdvARB)(GLhandleARB program, GLint location, GLsizei bufSize, GLdouble *params);
+GLAPI void APIENTRY GLAPI_PREFIX(GetnUniformfvARB)(GLhandleARB program, GLint location, GLsizei bufSize, GLfloat *params);
+GLAPI void APIENTRY GLAPI_PREFIX(GetnUniformivARB)(GLhandleARB program, GLint location, GLsizei bufSize, GLint *params);
+GLAPI void APIENTRY GLAPI_PREFIX(GetnUniformuivARB)(GLhandleARB program, GLint location, GLsizei bufSize, GLuint *params);
+GLAPI void APIENTRY GLAPI_PREFIX(ReadnPixelsARB)(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, GLvoid *data);
+GLAPI void APIENTRY GLAPI_PREFIX(PolygonOffsetEXT)(GLfloat factor, GLfloat bias);
+void APIENTRY GLAPI_PREFIX(_dispatch_stub_650)(GLfloat x, GLfloat y, GLfloat z, GLfloat width, GLfloat height);
+void APIENTRY GLAPI_PREFIX(_dispatch_stub_651)(const GLfloat *coords);
+void APIENTRY GLAPI_PREFIX(_dispatch_stub_652)(GLint x, GLint y, GLint z, GLint width, GLint height);
+void APIENTRY GLAPI_PREFIX(_dispatch_stub_653)(const GLint *coords);
+void APIENTRY GLAPI_PREFIX(_dispatch_stub_654)(GLshort x, GLshort y, GLshort z, GLshort width, GLshort height);
+void APIENTRY GLAPI_PREFIX(_dispatch_stub_655)(const GLshort *coords);
+void APIENTRY GLAPI_PREFIX(_dispatch_stub_656)(GLfixed x, GLfixed y, GLfixed z, GLfixed width, GLfixed height);
+void APIENTRY GLAPI_PREFIX(_dispatch_stub_657)(const GLfixed *coords);
+void APIENTRY GLAPI_PREFIX(_dispatch_stub_658)(GLenum type, GLsizei stride, const GLvoid *pointer);
+void APIENTRY GLAPI_PREFIX(_dispatch_stub_659)(GLenum pname, GLfloat *params);
+void APIENTRY GLAPI_PREFIX(_dispatch_stub_660)(GLenum pname, GLint *params);
+void APIENTRY GLAPI_PREFIX(_dispatch_stub_661)(GLenum pname, GLfloat param);
+void APIENTRY GLAPI_PREFIX(_dispatch_stub_662)(GLenum pname, const GLfloat *params);
+void APIENTRY GLAPI_PREFIX(_dispatch_stub_663)(GLenum pname, GLint param);
+void APIENTRY GLAPI_PREFIX(_dispatch_stub_664)(GLenum pname, const GLint *params);
+GLbitfield APIENTRY GLAPI_PREFIX(_dispatch_stub_665)(GLfixed *mantissa, GLint *exponent);
+void APIENTRY GLAPI_PREFIX(_dispatch_stub_666)(GLclampf value, GLboolean invert);
+void APIENTRY GLAPI_PREFIX(_dispatch_stub_667)(GLenum pattern);
+GLAPI void APIENTRY GLAPI_PREFIX(ColorPointerEXT)(GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer);
+GLAPI void APIENTRY GLAPI_PREFIX(EdgeFlagPointerEXT)(GLsizei stride, GLsizei count, const GLboolean *pointer);
+GLAPI void APIENTRY GLAPI_PREFIX(IndexPointerEXT)(GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer);
+GLAPI void APIENTRY GLAPI_PREFIX(NormalPointerEXT)(GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer);
+GLAPI void APIENTRY GLAPI_PREFIX(TexCoordPointerEXT)(GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer);
+GLAPI void APIENTRY GLAPI_PREFIX(VertexPointerEXT)(GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer);
+GLAPI void APIENTRY GLAPI_PREFIX(PointParameterfEXT)(GLenum pname, GLfloat param);
+GLAPI void APIENTRY GLAPI_PREFIX(PointParameterf)(GLenum pname, GLfloat param);
+GLAPI void APIENTRY GLAPI_PREFIX(PointParameterfARB)(GLenum pname, GLfloat param);
+GLAPI void APIENTRY GLAPI_PREFIX(PointParameterfvEXT)(GLenum pname, const GLfloat *params);
+GLAPI void APIENTRY GLAPI_PREFIX(PointParameterfv)(GLenum pname, const GLfloat *params);
+GLAPI void APIENTRY GLAPI_PREFIX(PointParameterfvARB)(GLenum pname, const GLfloat *params);
+GLAPI void APIENTRY GLAPI_PREFIX(LockArraysEXT)(GLint first, GLsizei count);
+GLAPI void APIENTRY GLAPI_PREFIX(UnlockArraysEXT)(void);
+GLAPI void APIENTRY GLAPI_PREFIX(SecondaryColor3bEXT)(GLbyte red, GLbyte green, GLbyte blue);
+GLAPI void APIENTRY GLAPI_PREFIX(SecondaryColor3b)(GLbyte red, GLbyte green, GLbyte blue);
+GLAPI void APIENTRY GLAPI_PREFIX(SecondaryColor3bvEXT)(const GLbyte *v);
+GLAPI void APIENTRY GLAPI_PREFIX(SecondaryColor3bv)(const GLbyte *v);
+GLAPI void APIENTRY GLAPI_PREFIX(SecondaryColor3dEXT)(GLdouble red, GLdouble green, GLdouble blue);
+GLAPI void APIENTRY GLAPI_PREFIX(SecondaryColor3d)(GLdouble red, GLdouble green, GLdouble blue);
+GLAPI void APIENTRY GLAPI_PREFIX(SecondaryColor3dvEXT)(const GLdouble *v);
+GLAPI void APIENTRY GLAPI_PREFIX(SecondaryColor3dv)(const GLdouble *v);
+GLAPI void APIENTRY GLAPI_PREFIX(SecondaryColor3fEXT)(GLfloat red, GLfloat green, GLfloat blue);
+GLAPI void APIENTRY GLAPI_PREFIX(SecondaryColor3f)(GLfloat red, GLfloat green, GLfloat blue);
+GLAPI void APIENTRY GLAPI_PREFIX(SecondaryColor3fvEXT)(const GLfloat *v);
+GLAPI void APIENTRY GLAPI_PREFIX(SecondaryColor3fv)(const GLfloat *v);
+GLAPI void APIENTRY GLAPI_PREFIX(SecondaryColor3iEXT)(GLint red, GLint green, GLint blue);
+GLAPI void APIENTRY GLAPI_PREFIX(SecondaryColor3i)(GLint red, GLint green, GLint blue);
+GLAPI void APIENTRY GLAPI_PREFIX(SecondaryColor3ivEXT)(const GLint *v);
+GLAPI void APIENTRY GLAPI_PREFIX(SecondaryColor3iv)(const GLint *v);
+GLAPI void APIENTRY GLAPI_PREFIX(SecondaryColor3sEXT)(GLshort red, GLshort green, GLshort blue);
+GLAPI void APIENTRY GLAPI_PREFIX(SecondaryColor3s)(GLshort red, GLshort green, GLshort blue);
+GLAPI void APIENTRY GLAPI_PREFIX(SecondaryColor3svEXT)(const GLshort *v);
+GLAPI void APIENTRY GLAPI_PREFIX(SecondaryColor3sv)(const GLshort *v);
+GLAPI void APIENTRY GLAPI_PREFIX(SecondaryColor3ubEXT)(GLubyte red, GLubyte green, GLubyte blue);
+GLAPI void APIENTRY GLAPI_PREFIX(SecondaryColor3ub)(GLubyte red, GLubyte green, GLubyte blue);
+GLAPI void APIENTRY GLAPI_PREFIX(SecondaryColor3ubvEXT)(const GLubyte *v);
+GLAPI void APIENTRY GLAPI_PREFIX(SecondaryColor3ubv)(const GLubyte *v);
+GLAPI void APIENTRY GLAPI_PREFIX(SecondaryColor3uiEXT)(GLuint red, GLuint green, GLuint blue);
+GLAPI void APIENTRY GLAPI_PREFIX(SecondaryColor3ui)(GLuint red, GLuint green, GLuint blue);
+GLAPI void APIENTRY GLAPI_PREFIX(SecondaryColor3uivEXT)(const GLuint *v);
+GLAPI void APIENTRY GLAPI_PREFIX(SecondaryColor3uiv)(const GLuint *v);
+GLAPI void APIENTRY GLAPI_PREFIX(SecondaryColor3usEXT)(GLushort red, GLushort green, GLushort blue);
+GLAPI void APIENTRY GLAPI_PREFIX(SecondaryColor3us)(GLushort red, GLushort green, GLushort blue);
+GLAPI void APIENTRY GLAPI_PREFIX(SecondaryColor3usvEXT)(const GLushort *v);
+GLAPI void APIENTRY GLAPI_PREFIX(SecondaryColor3usv)(const GLushort *v);
+GLAPI void APIENTRY GLAPI_PREFIX(SecondaryColorPointerEXT)(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
+GLAPI void APIENTRY GLAPI_PREFIX(SecondaryColorPointer)(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
+GLAPI void APIENTRY GLAPI_PREFIX(MultiDrawArraysEXT)(GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount);
+GLAPI void APIENTRY GLAPI_PREFIX(MultiDrawArrays)(GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount);
+GLAPI void APIENTRY GLAPI_PREFIX(MultiDrawElementsEXT)(GLenum mode, const GLsizei *count, GLenum type, const GLvoid **indices, GLsizei primcount);
+GLAPI void APIENTRY GLAPI_PREFIX(MultiDrawElements)(GLenum mode, const GLsizei *count, GLenum type, const GLvoid **indices, GLsizei primcount);
+GLAPI void APIENTRY GLAPI_PREFIX(FogCoordPointerEXT)(GLenum type, GLsizei stride, const GLvoid *pointer);
+GLAPI void APIENTRY GLAPI_PREFIX(FogCoordPointer)(GLenum type, GLsizei stride, const GLvoid *pointer);
+GLAPI void APIENTRY GLAPI_PREFIX(FogCoorddEXT)(GLdouble coord);
+GLAPI void APIENTRY GLAPI_PREFIX(FogCoordd)(GLdouble coord);
+GLAPI void APIENTRY GLAPI_PREFIX(FogCoorddvEXT)(const GLdouble *coord);
+GLAPI void APIENTRY GLAPI_PREFIX(FogCoorddv)(const GLdouble *coord);
+GLAPI void APIENTRY GLAPI_PREFIX(FogCoordfEXT)(GLfloat coord);
+GLAPI void APIENTRY GLAPI_PREFIX(FogCoordf)(GLfloat coord);
+GLAPI void APIENTRY GLAPI_PREFIX(FogCoordfvEXT)(const GLfloat *coord);
+GLAPI void APIENTRY GLAPI_PREFIX(FogCoordfv)(const GLfloat *coord);
+void APIENTRY GLAPI_PREFIX(_dispatch_stub_702)(GLenum mode);
+GLAPI void APIENTRY GLAPI_PREFIX(BlendFuncSeparateEXT)(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha);
+GLAPI void APIENTRY GLAPI_PREFIX(BlendFuncSeparate)(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha);
+GLAPI void APIENTRY GLAPI_PREFIX(FlushVertexArrayRangeNV)(void);
+GLAPI void APIENTRY GLAPI_PREFIX(VertexArrayRangeNV)(GLsizei length, const GLvoid *pointer);
+GLAPI void APIENTRY GLAPI_PREFIX(CombinerInputNV)(GLenum stage, GLenum portion, GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage);
+GLAPI void APIENTRY GLAPI_PREFIX(CombinerOutputNV)(GLenum stage, GLenum portion, GLenum abOutput, GLenum cdOutput, GLenum sumOutput, GLenum scale, GLenum bias, GLboolean abDotProduct, GLboolean cdDotProduct, GLboolean muxSum);
+GLAPI void APIENTRY GLAPI_PREFIX(CombinerParameterfNV)(GLenum pname, GLfloat param);
+GLAPI void APIENTRY GLAPI_PREFIX(CombinerParameterfvNV)(GLenum pname, const GLfloat *params);
+GLAPI void APIENTRY GLAPI_PREFIX(CombinerParameteriNV)(GLenum pname, GLint param);
+GLAPI void APIENTRY GLAPI_PREFIX(CombinerParameterivNV)(GLenum pname, const GLint *params);
+GLAPI void APIENTRY GLAPI_PREFIX(FinalCombinerInputNV)(GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage);
+GLAPI void APIENTRY GLAPI_PREFIX(GetCombinerInputParameterfvNV)(GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLfloat *params);
+GLAPI void APIENTRY GLAPI_PREFIX(GetCombinerInputParameterivNV)(GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLint *params);
+GLAPI void APIENTRY GLAPI_PREFIX(GetCombinerOutputParameterfvNV)(GLenum stage, GLenum portion, GLenum pname, GLfloat *params);
+GLAPI void APIENTRY GLAPI_PREFIX(GetCombinerOutputParameterivNV)(GLenum stage, GLenum portion, GLenum pname, GLint *params);
+GLAPI void APIENTRY GLAPI_PREFIX(GetFinalCombinerInputParameterfvNV)(GLenum variable, GLenum pname, GLfloat *params);
+GLAPI void APIENTRY GLAPI_PREFIX(GetFinalCombinerInputParameterivNV)(GLenum variable, GLenum pname, GLint *params);
+GLAPI void APIENTRY GLAPI_PREFIX(ResizeBuffersMESA)(void);
+GLAPI void APIENTRY GLAPI_PREFIX(WindowPos2dMESA)(GLdouble x, GLdouble y);
+GLAPI void APIENTRY GLAPI_PREFIX(WindowPos2d)(GLdouble x, GLdouble y);
+GLAPI void APIENTRY GLAPI_PREFIX(WindowPos2dARB)(GLdouble x, GLdouble y);
+GLAPI void APIENTRY GLAPI_PREFIX(WindowPos2dvMESA)(const GLdouble *v);
+GLAPI void APIENTRY GLAPI_PREFIX(WindowPos2dv)(const GLdouble *v);
+GLAPI void APIENTRY GLAPI_PREFIX(WindowPos2dvARB)(const GLdouble *v);
+GLAPI void APIENTRY GLAPI_PREFIX(WindowPos2fMESA)(GLfloat x, GLfloat y);
+GLAPI void APIENTRY GLAPI_PREFIX(WindowPos2f)(GLfloat x, GLfloat y);
+GLAPI void APIENTRY GLAPI_PREFIX(WindowPos2fARB)(GLfloat x, GLfloat y);
+GLAPI void APIENTRY GLAPI_PREFIX(WindowPos2fvMESA)(const GLfloat *v);
+GLAPI void APIENTRY GLAPI_PREFIX(WindowPos2fv)(const GLfloat *v);
+GLAPI void APIENTRY GLAPI_PREFIX(WindowPos2fvARB)(const GLfloat *v);
+GLAPI void APIENTRY GLAPI_PREFIX(WindowPos2iMESA)(GLint x, GLint y);
+GLAPI void APIENTRY GLAPI_PREFIX(WindowPos2i)(GLint x, GLint y);
+GLAPI void APIENTRY GLAPI_PREFIX(WindowPos2iARB)(GLint x, GLint y);
+GLAPI void APIENTRY GLAPI_PREFIX(WindowPos2ivMESA)(const GLint *v);
+GLAPI void APIENTRY GLAPI_PREFIX(WindowPos2iv)(const GLint *v);
+GLAPI void APIENTRY GLAPI_PREFIX(WindowPos2ivARB)(const GLint *v);
+GLAPI void APIENTRY GLAPI_PREFIX(WindowPos2sMESA)(GLshort x, GLshort y);
+GLAPI void APIENTRY GLAPI_PREFIX(WindowPos2s)(GLshort x, GLshort y);
+GLAPI void APIENTRY GLAPI_PREFIX(WindowPos2sARB)(GLshort x, GLshort y);
+GLAPI void APIENTRY GLAPI_PREFIX(WindowPos2svMESA)(const GLshort *v);
+GLAPI void APIENTRY GLAPI_PREFIX(WindowPos2sv)(const GLshort *v);
+GLAPI void APIENTRY GLAPI_PREFIX(WindowPos2svARB)(const GLshort *v);
+GLAPI void APIENTRY GLAPI_PREFIX(WindowPos3dMESA)(GLdouble x, GLdouble y, GLdouble z);
+GLAPI void APIENTRY GLAPI_PREFIX(WindowPos3d)(GLdouble x, GLdouble y, GLdouble z);
+GLAPI void APIENTRY GLAPI_PREFIX(WindowPos3dARB)(GLdouble x, GLdouble y, GLdouble z);
+GLAPI void APIENTRY GLAPI_PREFIX(WindowPos3dvMESA)(const GLdouble *v);
+GLAPI void APIENTRY GLAPI_PREFIX(WindowPos3dv)(const GLdouble *v);
+GLAPI void APIENTRY GLAPI_PREFIX(WindowPos3dvARB)(const GLdouble *v);
+GLAPI void APIENTRY GLAPI_PREFIX(WindowPos3fMESA)(GLfloat x, GLfloat y, GLfloat z);
+GLAPI void APIENTRY GLAPI_PREFIX(WindowPos3f)(GLfloat x, GLfloat y, GLfloat z);
+GLAPI void APIENTRY GLAPI_PREFIX(WindowPos3fARB)(GLfloat x, GLfloat y, GLfloat z);
+GLAPI void APIENTRY GLAPI_PREFIX(WindowPos3fvMESA)(const GLfloat *v);
+GLAPI void APIENTRY GLAPI_PREFIX(WindowPos3fv)(const GLfloat *v);
+GLAPI void APIENTRY GLAPI_PREFIX(WindowPos3fvARB)(const GLfloat *v);
+GLAPI void APIENTRY GLAPI_PREFIX(WindowPos3iMESA)(GLint x, GLint y, GLint z);
+GLAPI void APIENTRY GLAPI_PREFIX(WindowPos3i)(GLint x, GLint y, GLint z);
+GLAPI void APIENTRY GLAPI_PREFIX(WindowPos3iARB)(GLint x, GLint y, GLint z);
+GLAPI void APIENTRY GLAPI_PREFIX(WindowPos3ivMESA)(const GLint *v);
+GLAPI void APIENTRY GLAPI_PREFIX(WindowPos3iv)(const GLint *v);
+GLAPI void APIENTRY GLAPI_PREFIX(WindowPos3ivARB)(const GLint *v);
+GLAPI void APIENTRY GLAPI_PREFIX(WindowPos3sMESA)(GLshort x, GLshort y, GLshort z);
+GLAPI void APIENTRY GLAPI_PREFIX(WindowPos3s)(GLshort x, GLshort y, GLshort z);
+GLAPI void APIENTRY GLAPI_PREFIX(WindowPos3sARB)(GLshort x, GLshort y, GLshort z);
+GLAPI void APIENTRY GLAPI_PREFIX(WindowPos3svMESA)(const GLshort *v);
+GLAPI void APIENTRY GLAPI_PREFIX(WindowPos3sv)(const GLshort *v);
+GLAPI void APIENTRY GLAPI_PREFIX(WindowPos3svARB)(const GLshort *v);
+GLAPI void APIENTRY GLAPI_PREFIX(WindowPos4dMESA)(GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+GLAPI void APIENTRY GLAPI_PREFIX(WindowPos4dvMESA)(const GLdouble *v);
+GLAPI void APIENTRY GLAPI_PREFIX(WindowPos4fMESA)(GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+GLAPI void APIENTRY GLAPI_PREFIX(WindowPos4fvMESA)(const GLfloat *v);
+GLAPI void APIENTRY GLAPI_PREFIX(WindowPos4iMESA)(GLint x, GLint y, GLint z, GLint w);
+GLAPI void APIENTRY GLAPI_PREFIX(WindowPos4ivMESA)(const GLint *v);
+GLAPI void APIENTRY GLAPI_PREFIX(WindowPos4sMESA)(GLshort x, GLshort y, GLshort z, GLshort w);
+GLAPI void APIENTRY GLAPI_PREFIX(WindowPos4svMESA)(const GLshort *v);
+void APIENTRY GLAPI_PREFIX(_dispatch_stub_744)(const GLenum *mode, const GLint *first, const GLsizei *count, GLsizei primcount, GLint modestride);
+void APIENTRY GLAPI_PREFIX(_dispatch_stub_745)(const GLenum *mode, const GLsizei *count, GLenum type, const GLvoid * const *indices, GLsizei primcount, GLint modestride);
+void APIENTRY GLAPI_PREFIX(_dispatch_stub_746)(GLsizei n, const GLuint *fences);
+void APIENTRY GLAPI_PREFIX(_dispatch_stub_747)(GLuint fence);
+void APIENTRY GLAPI_PREFIX(_dispatch_stub_748)(GLsizei n, GLuint *fences);
+void APIENTRY GLAPI_PREFIX(_dispatch_stub_749)(GLuint fence, GLenum pname, GLint *params);
+GLboolean APIENTRY GLAPI_PREFIX(_dispatch_stub_750)(GLuint fence);
+void APIENTRY GLAPI_PREFIX(_dispatch_stub_751)(GLuint fence, GLenum condition);
+GLboolean APIENTRY GLAPI_PREFIX(_dispatch_stub_752)(GLuint fence);
+GLAPI GLboolean APIENTRY GLAPI_PREFIX(AreProgramsResidentNV)(GLsizei n, const GLuint *ids, GLboolean *residences);
+GLAPI void APIENTRY GLAPI_PREFIX(BindProgramNV)(GLenum target, GLuint program);
+GLAPI void APIENTRY GLAPI_PREFIX(BindProgramARB)(GLenum target, GLuint program);
+GLAPI void APIENTRY GLAPI_PREFIX(DeleteProgramsNV)(GLsizei n, const GLuint *programs);
+GLAPI void APIENTRY GLAPI_PREFIX(DeleteProgramsARB)(GLsizei n, const GLuint *programs);
+GLAPI void APIENTRY GLAPI_PREFIX(ExecuteProgramNV)(GLenum target, GLuint id, const GLfloat *params);
+GLAPI void APIENTRY GLAPI_PREFIX(GenProgramsNV)(GLsizei n, GLuint *programs);
+GLAPI void APIENTRY GLAPI_PREFIX(GenProgramsARB)(GLsizei n, GLuint *programs);
+GLAPI void APIENTRY GLAPI_PREFIX(GetProgramParameterdvNV)(GLenum target, GLuint index, GLenum pname, GLdouble *params);
+GLAPI void APIENTRY GLAPI_PREFIX(GetProgramParameterfvNV)(GLenum target, GLuint index, GLenum pname, GLfloat *params);
+GLAPI void APIENTRY GLAPI_PREFIX(GetProgramStringNV)(GLuint id, GLenum pname, GLubyte *program);
+GLAPI void APIENTRY GLAPI_PREFIX(GetProgramivNV)(GLuint id, GLenum pname, GLint *params);
+GLAPI void APIENTRY GLAPI_PREFIX(GetTrackMatrixivNV)(GLenum target, GLuint address, GLenum pname, GLint *params);
+GLAPI void APIENTRY GLAPI_PREFIX(GetVertexAttribPointervNV)(GLuint index, GLenum pname, GLvoid **pointer);
+GLAPI void APIENTRY GLAPI_PREFIX(GetVertexAttribPointerv)(GLuint index, GLenum pname, GLvoid **pointer);
+GLAPI void APIENTRY GLAPI_PREFIX(GetVertexAttribPointervARB)(GLuint index, GLenum pname, GLvoid **pointer);
+GLAPI void APIENTRY GLAPI_PREFIX(GetVertexAttribdvNV)(GLuint index, GLenum pname, GLdouble *params);
+GLAPI void APIENTRY GLAPI_PREFIX(GetVertexAttribfvNV)(GLuint index, GLenum pname, GLfloat *params);
+GLAPI void APIENTRY GLAPI_PREFIX(GetVertexAttribivNV)(GLuint index, GLenum pname, GLint *params);
+GLAPI GLboolean APIENTRY GLAPI_PREFIX(IsProgramNV)(GLuint program);
+GLAPI GLboolean APIENTRY GLAPI_PREFIX(IsProgramARB)(GLuint program);
+GLAPI void APIENTRY GLAPI_PREFIX(LoadProgramNV)(GLenum target, GLuint id, GLsizei len, const GLubyte *program);
+GLAPI void APIENTRY GLAPI_PREFIX(ProgramParameters4dvNV)(GLenum target, GLuint index, GLsizei num, const GLdouble *params);
+GLAPI void APIENTRY GLAPI_PREFIX(ProgramParameters4fvNV)(GLenum target, GLuint index, GLsizei num, const GLfloat *params);
+GLAPI void APIENTRY GLAPI_PREFIX(RequestResidentProgramsNV)(GLsizei n, const GLuint *ids);
+GLAPI void APIENTRY GLAPI_PREFIX(TrackMatrixNV)(GLenum target, GLuint address, GLenum matrix, GLenum transform);
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib1dNV)(GLuint index, GLdouble x);
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib1dvNV)(GLuint index, const GLdouble *v);
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib1fNV)(GLuint index, GLfloat x);
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib1fvNV)(GLuint index, const GLfloat *v);
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib1sNV)(GLuint index, GLshort x);
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib1svNV)(GLuint index, const GLshort *v);
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib2dNV)(GLuint index, GLdouble x, GLdouble y);
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib2dvNV)(GLuint index, const GLdouble *v);
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib2fNV)(GLuint index, GLfloat x, GLfloat y);
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib2fvNV)(GLuint index, const GLfloat *v);
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib2sNV)(GLuint index, GLshort x, GLshort y);
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib2svNV)(GLuint index, const GLshort *v);
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib3dNV)(GLuint index, GLdouble x, GLdouble y, GLdouble z);
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib3dvNV)(GLuint index, const GLdouble *v);
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib3fNV)(GLuint index, GLfloat x, GLfloat y, GLfloat z);
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib3fvNV)(GLuint index, const GLfloat *v);
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib3sNV)(GLuint index, GLshort x, GLshort y, GLshort z);
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib3svNV)(GLuint index, const GLshort *v);
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib4dNV)(GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib4dvNV)(GLuint index, const GLdouble *v);
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib4fNV)(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib4fvNV)(GLuint index, const GLfloat *v);
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib4sNV)(GLuint index, GLshort x, GLshort y, GLshort z, GLshort w);
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib4svNV)(GLuint index, const GLshort *v);
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib4ubNV)(GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w);
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib4ubvNV)(GLuint index, const GLubyte *v);
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribPointerNV)(GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribs1dvNV)(GLuint index, GLsizei n, const GLdouble *v);
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribs1fvNV)(GLuint index, GLsizei n, const GLfloat *v);
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribs1svNV)(GLuint index, GLsizei n, const GLshort *v);
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribs2dvNV)(GLuint index, GLsizei n, const GLdouble *v);
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribs2fvNV)(GLuint index, GLsizei n, const GLfloat *v);
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribs2svNV)(GLuint index, GLsizei n, const GLshort *v);
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribs3dvNV)(GLuint index, GLsizei n, const GLdouble *v);
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribs3fvNV)(GLuint index, GLsizei n, const GLfloat *v);
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribs3svNV)(GLuint index, GLsizei n, const GLshort *v);
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribs4dvNV)(GLuint index, GLsizei n, const GLdouble *v);
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribs4fvNV)(GLuint index, GLsizei n, const GLfloat *v);
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribs4svNV)(GLuint index, GLsizei n, const GLshort *v);
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribs4ubvNV)(GLuint index, GLsizei n, const GLubyte *v);
+GLAPI void APIENTRY GLAPI_PREFIX(GetTexBumpParameterfvATI)(GLenum pname, GLfloat *param);
+GLAPI void APIENTRY GLAPI_PREFIX(GetTexBumpParameterivATI)(GLenum pname, GLint *param);
+GLAPI void APIENTRY GLAPI_PREFIX(TexBumpParameterfvATI)(GLenum pname, const GLfloat *param);
+GLAPI void APIENTRY GLAPI_PREFIX(TexBumpParameterivATI)(GLenum pname, const GLint *param);
+GLAPI void APIENTRY GLAPI_PREFIX(AlphaFragmentOp1ATI)(GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod);
+GLAPI void APIENTRY GLAPI_PREFIX(AlphaFragmentOp2ATI)(GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod);
+GLAPI void APIENTRY GLAPI_PREFIX(AlphaFragmentOp3ATI)(GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod);
+GLAPI void APIENTRY GLAPI_PREFIX(BeginFragmentShaderATI)(void);
+GLAPI void APIENTRY GLAPI_PREFIX(BindFragmentShaderATI)(GLuint id);
+GLAPI void APIENTRY GLAPI_PREFIX(ColorFragmentOp1ATI)(GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod);
+GLAPI void APIENTRY GLAPI_PREFIX(ColorFragmentOp2ATI)(GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod);
+GLAPI void APIENTRY GLAPI_PREFIX(ColorFragmentOp3ATI)(GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod);
+GLAPI void APIENTRY GLAPI_PREFIX(DeleteFragmentShaderATI)(GLuint id);
+GLAPI void APIENTRY GLAPI_PREFIX(EndFragmentShaderATI)(void);
+GLAPI GLuint APIENTRY GLAPI_PREFIX(GenFragmentShadersATI)(GLuint range);
+GLAPI void APIENTRY GLAPI_PREFIX(PassTexCoordATI)(GLuint dst, GLuint coord, GLenum swizzle);
+GLAPI void APIENTRY GLAPI_PREFIX(SampleMapATI)(GLuint dst, GLuint interp, GLenum swizzle);
+GLAPI void APIENTRY GLAPI_PREFIX(SetFragmentShaderConstantATI)(GLuint dst, const GLfloat *value);
+GLAPI void APIENTRY GLAPI_PREFIX(PointParameteriNV)(GLenum pname, GLint param);
+GLAPI void APIENTRY GLAPI_PREFIX(PointParameteri)(GLenum pname, GLint param);
+GLAPI void APIENTRY GLAPI_PREFIX(PointParameterivNV)(GLenum pname, const GLint *params);
+GLAPI void APIENTRY GLAPI_PREFIX(PointParameteriv)(GLenum pname, const GLint *params);
+void APIENTRY GLAPI_PREFIX(_dispatch_stub_833)(GLenum face);
+void APIENTRY GLAPI_PREFIX(_dispatch_stub_834)(GLuint array);
+void APIENTRY GLAPI_PREFIX(_dispatch_stub_835)(GLsizei n, const GLuint *arrays);
+GLAPI void APIENTRY GLAPI_PREFIX(DeleteVertexArrays)(GLsizei n, const GLuint *arrays);
+void APIENTRY GLAPI_PREFIX(_dispatch_stub_836)(GLsizei n, GLuint *arrays);
+GLboolean APIENTRY GLAPI_PREFIX(_dispatch_stub_837)(GLuint array);
+GLAPI GLboolean APIENTRY GLAPI_PREFIX(IsVertexArray)(GLuint array);
+GLAPI void APIENTRY GLAPI_PREFIX(GetProgramNamedParameterdvNV)(GLuint id, GLsizei len, const GLubyte *name, GLdouble *params);
+GLAPI void APIENTRY GLAPI_PREFIX(GetProgramNamedParameterfvNV)(GLuint id, GLsizei len, const GLubyte *name, GLfloat *params);
+GLAPI void APIENTRY GLAPI_PREFIX(ProgramNamedParameter4dNV)(GLuint id, GLsizei len, const GLubyte *name, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+GLAPI void APIENTRY GLAPI_PREFIX(ProgramNamedParameter4dvNV)(GLuint id, GLsizei len, const GLubyte *name, const GLdouble *v);
+GLAPI void APIENTRY GLAPI_PREFIX(ProgramNamedParameter4fNV)(GLuint id, GLsizei len, const GLubyte *name, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+GLAPI void APIENTRY GLAPI_PREFIX(ProgramNamedParameter4fvNV)(GLuint id, GLsizei len, const GLubyte *name, const GLfloat *v);
+GLAPI void APIENTRY GLAPI_PREFIX(PrimitiveRestartIndexNV)(GLuint index);
+GLAPI void APIENTRY GLAPI_PREFIX(PrimitiveRestartIndex)(GLuint index);
+GLAPI void APIENTRY GLAPI_PREFIX(PrimitiveRestartNV)(void);
+void APIENTRY GLAPI_PREFIX(_dispatch_stub_846)(GLenum func, GLclampx ref);
+void APIENTRY GLAPI_PREFIX(_dispatch_stub_847)(GLclampx red, GLclampx green, GLclampx blue, GLclampx alpha);
+void APIENTRY GLAPI_PREFIX(_dispatch_stub_848)(GLclampx depth);
+void APIENTRY GLAPI_PREFIX(_dispatch_stub_849)(GLenum plane, const GLfixed *equation);
+void APIENTRY GLAPI_PREFIX(_dispatch_stub_850)(GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha);
+void APIENTRY GLAPI_PREFIX(_dispatch_stub_851)(GLclampx zNear, GLclampx zFar);
+void APIENTRY GLAPI_PREFIX(_dispatch_stub_852)(GLenum pname, GLfixed param);
+void APIENTRY GLAPI_PREFIX(_dispatch_stub_853)(GLenum pname, const GLfixed *params);
+void APIENTRY GLAPI_PREFIX(_dispatch_stub_854)(GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar);
+void APIENTRY GLAPI_PREFIX(_dispatch_stub_855)(GLenum plane, GLfixed *equation);
+void APIENTRY GLAPI_PREFIX(_dispatch_stub_856)(GLenum pname, GLfixed *params);
+void APIENTRY GLAPI_PREFIX(_dispatch_stub_857)(GLenum light, GLenum pname, GLfixed *params);
+void APIENTRY GLAPI_PREFIX(_dispatch_stub_858)(GLenum face, GLenum pname, GLfixed *params);
+void APIENTRY GLAPI_PREFIX(_dispatch_stub_859)(GLenum target, GLenum pname, GLfixed *params);
+void APIENTRY GLAPI_PREFIX(_dispatch_stub_860)(GLenum coord, GLenum pname, GLfixed *params);
+void APIENTRY GLAPI_PREFIX(_dispatch_stub_861)(GLenum target, GLenum pname, GLfixed *params);
+void APIENTRY GLAPI_PREFIX(_dispatch_stub_862)(GLenum pname, GLfixed param);
+void APIENTRY GLAPI_PREFIX(_dispatch_stub_863)(GLenum pname, const GLfixed *params);
+void APIENTRY GLAPI_PREFIX(_dispatch_stub_864)(GLenum light, GLenum pname, GLfixed param);
+void APIENTRY GLAPI_PREFIX(_dispatch_stub_865)(GLenum light, GLenum pname, const GLfixed *params);
+void APIENTRY GLAPI_PREFIX(_dispatch_stub_866)(GLfixed width);
+void APIENTRY GLAPI_PREFIX(_dispatch_stub_867)(const GLfixed *m);
+void APIENTRY GLAPI_PREFIX(_dispatch_stub_868)(GLenum face, GLenum pname, GLfixed param);
+void APIENTRY GLAPI_PREFIX(_dispatch_stub_869)(GLenum face, GLenum pname, const GLfixed *params);
+void APIENTRY GLAPI_PREFIX(_dispatch_stub_870)(const GLfixed *m);
+void APIENTRY GLAPI_PREFIX(_dispatch_stub_871)(GLenum target, GLfixed s, GLfixed t, GLfixed r, GLfixed q);
+void APIENTRY GLAPI_PREFIX(_dispatch_stub_872)(GLfixed nx, GLfixed ny, GLfixed nz);
+void APIENTRY GLAPI_PREFIX(_dispatch_stub_873)(GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar);
+void APIENTRY GLAPI_PREFIX(_dispatch_stub_874)(GLenum pname, GLfixed param);
+void APIENTRY GLAPI_PREFIX(_dispatch_stub_875)(GLenum pname, const GLfixed *params);
+void APIENTRY GLAPI_PREFIX(_dispatch_stub_876)(GLfixed size);
+void APIENTRY GLAPI_PREFIX(_dispatch_stub_877)(GLfixed factor, GLfixed units);
+void APIENTRY GLAPI_PREFIX(_dispatch_stub_878)(GLfixed angle, GLfixed x, GLfixed y, GLfixed z);
+void APIENTRY GLAPI_PREFIX(_dispatch_stub_879)(GLclampx value, GLboolean invert);
+void APIENTRY GLAPI_PREFIX(_dispatch_stub_880)(GLfixed x, GLfixed y, GLfixed z);
+void APIENTRY GLAPI_PREFIX(_dispatch_stub_881)(GLenum target, GLenum pname, GLfixed param);
+void APIENTRY GLAPI_PREFIX(_dispatch_stub_882)(GLenum target, GLenum pname, const GLfixed *params);
+void APIENTRY GLAPI_PREFIX(_dispatch_stub_883)(GLenum coord, GLenum pname, GLint param);
+void APIENTRY GLAPI_PREFIX(_dispatch_stub_884)(GLenum coord, GLenum pname, const GLfixed *params);
+void APIENTRY GLAPI_PREFIX(_dispatch_stub_885)(GLenum target, GLenum pname, GLfixed param);
+void APIENTRY GLAPI_PREFIX(_dispatch_stub_886)(GLenum target, GLenum pname, const GLfixed *params);
+void APIENTRY GLAPI_PREFIX(_dispatch_stub_887)(GLfixed x, GLfixed y, GLfixed z);
+void APIENTRY GLAPI_PREFIX(_dispatch_stub_888)(GLenum plane, const GLfloat *equation);
+void APIENTRY GLAPI_PREFIX(_dispatch_stub_889)(GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar);
+void APIENTRY GLAPI_PREFIX(_dispatch_stub_890)(GLenum plane, GLfloat *equation);
+void APIENTRY GLAPI_PREFIX(_dispatch_stub_891)(GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar);
+void APIENTRY GLAPI_PREFIX(_dispatch_stub_892)(GLclampd zmin, GLclampd zmax);
+void APIENTRY GLAPI_PREFIX(_dispatch_stub_893)(GLenum modeRGB, GLenum modeA);
+GLAPI void APIENTRY GLAPI_PREFIX(BlendEquationSeparate)(GLenum modeRGB, GLenum modeA);
+GLAPI void APIENTRY GLAPI_PREFIX(BindFramebufferEXT)(GLenum target, GLuint framebuffer);
+GLAPI void APIENTRY GLAPI_PREFIX(BindFramebuffer)(GLenum target, GLuint framebuffer);
+GLAPI void APIENTRY GLAPI_PREFIX(BindRenderbufferEXT)(GLenum target, GLuint renderbuffer);
+GLAPI void APIENTRY GLAPI_PREFIX(BindRenderbuffer)(GLenum target, GLuint renderbuffer);
+GLAPI GLenum APIENTRY GLAPI_PREFIX(CheckFramebufferStatusEXT)(GLenum target);
+GLAPI GLenum APIENTRY GLAPI_PREFIX(CheckFramebufferStatus)(GLenum target);
+GLAPI void APIENTRY GLAPI_PREFIX(DeleteFramebuffersEXT)(GLsizei n, const GLuint *framebuffers);
+GLAPI void APIENTRY GLAPI_PREFIX(DeleteFramebuffers)(GLsizei n, const GLuint *framebuffers);
+GLAPI void APIENTRY GLAPI_PREFIX(DeleteRenderbuffersEXT)(GLsizei n, const GLuint *renderbuffers);
+GLAPI void APIENTRY GLAPI_PREFIX(DeleteRenderbuffers)(GLsizei n, const GLuint *renderbuffers);
+GLAPI void APIENTRY GLAPI_PREFIX(FramebufferRenderbufferEXT)(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
+GLAPI void APIENTRY GLAPI_PREFIX(FramebufferRenderbuffer)(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
+GLAPI void APIENTRY GLAPI_PREFIX(FramebufferTexture1DEXT)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
+GLAPI void APIENTRY GLAPI_PREFIX(FramebufferTexture1D)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
+GLAPI void APIENTRY GLAPI_PREFIX(FramebufferTexture2DEXT)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
+GLAPI void APIENTRY GLAPI_PREFIX(FramebufferTexture2D)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
+GLAPI void APIENTRY GLAPI_PREFIX(FramebufferTexture3DEXT)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset);
+GLAPI void APIENTRY GLAPI_PREFIX(FramebufferTexture3D)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset);
+GLAPI void APIENTRY GLAPI_PREFIX(GenFramebuffersEXT)(GLsizei n, GLuint *framebuffers);
+GLAPI void APIENTRY GLAPI_PREFIX(GenFramebuffers)(GLsizei n, GLuint *framebuffers);
+GLAPI void APIENTRY GLAPI_PREFIX(GenRenderbuffersEXT)(GLsizei n, GLuint *renderbuffers);
+GLAPI void APIENTRY GLAPI_PREFIX(GenRenderbuffers)(GLsizei n, GLuint *renderbuffers);
+GLAPI void APIENTRY GLAPI_PREFIX(GenerateMipmapEXT)(GLenum target);
+GLAPI void APIENTRY GLAPI_PREFIX(GenerateMipmap)(GLenum target);
+GLAPI void APIENTRY GLAPI_PREFIX(GetFramebufferAttachmentParameterivEXT)(GLenum target, GLenum attachment, GLenum pname, GLint *params);
+GLAPI void APIENTRY GLAPI_PREFIX(GetFramebufferAttachmentParameteriv)(GLenum target, GLenum attachment, GLenum pname, GLint *params);
+GLAPI void APIENTRY GLAPI_PREFIX(GetRenderbufferParameterivEXT)(GLenum target, GLenum pname, GLint *params);
+GLAPI void APIENTRY GLAPI_PREFIX(GetRenderbufferParameteriv)(GLenum target, GLenum pname, GLint *params);
+GLAPI GLboolean APIENTRY GLAPI_PREFIX(IsFramebufferEXT)(GLuint framebuffer);
+GLAPI GLboolean APIENTRY GLAPI_PREFIX(IsFramebuffer)(GLuint framebuffer);
+GLAPI GLboolean APIENTRY GLAPI_PREFIX(IsRenderbufferEXT)(GLuint renderbuffer);
+GLAPI GLboolean APIENTRY GLAPI_PREFIX(IsRenderbuffer)(GLuint renderbuffer);
+GLAPI void APIENTRY GLAPI_PREFIX(RenderbufferStorageEXT)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
+GLAPI void APIENTRY GLAPI_PREFIX(RenderbufferStorage)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
+void APIENTRY GLAPI_PREFIX(_dispatch_stub_911)(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
+GLAPI void APIENTRY GLAPI_PREFIX(BlitFramebuffer)(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
+void APIENTRY GLAPI_PREFIX(_dispatch_stub_912)(GLenum target, GLenum pname, GLint param);
+void APIENTRY GLAPI_PREFIX(_dispatch_stub_913)(GLenum target, GLintptr offset, GLsizeiptr size);
+GLAPI void APIENTRY GLAPI_PREFIX(BindFragDataLocationEXT)(GLuint program, GLuint colorNumber, const GLchar *name);
+GLAPI void APIENTRY GLAPI_PREFIX(BindFragDataLocation)(GLuint program, GLuint colorNumber, const GLchar *name);
+GLAPI GLint APIENTRY GLAPI_PREFIX(GetFragDataLocationEXT)(GLuint program, const GLchar *name);
+GLAPI GLint APIENTRY GLAPI_PREFIX(GetFragDataLocation)(GLuint program, const GLchar *name);
+GLAPI void APIENTRY GLAPI_PREFIX(GetUniformuivEXT)(GLuint program, GLint location, GLuint *params);
+GLAPI void APIENTRY GLAPI_PREFIX(GetUniformuiv)(GLuint program, GLint location, GLuint *params);
+GLAPI void APIENTRY GLAPI_PREFIX(GetVertexAttribIivEXT)(GLuint index, GLenum pname, GLint *params);
+GLAPI void APIENTRY GLAPI_PREFIX(GetVertexAttribIiv)(GLuint index, GLenum pname, GLint *params);
+GLAPI void APIENTRY GLAPI_PREFIX(GetVertexAttribIuivEXT)(GLuint index, GLenum pname, GLuint *params);
+GLAPI void APIENTRY GLAPI_PREFIX(GetVertexAttribIuiv)(GLuint index, GLenum pname, GLuint *params);
+GLAPI void APIENTRY GLAPI_PREFIX(Uniform1uiEXT)(GLint location, GLuint x);
+GLAPI void APIENTRY GLAPI_PREFIX(Uniform1ui)(GLint location, GLuint x);
+GLAPI void APIENTRY GLAPI_PREFIX(Uniform1uivEXT)(GLint location, GLsizei count, const GLuint *value);
+GLAPI void APIENTRY GLAPI_PREFIX(Uniform1uiv)(GLint location, GLsizei count, const GLuint *value);
+GLAPI void APIENTRY GLAPI_PREFIX(Uniform2uiEXT)(GLint location, GLuint x, GLuint y);
+GLAPI void APIENTRY GLAPI_PREFIX(Uniform2ui)(GLint location, GLuint x, GLuint y);
+GLAPI void APIENTRY GLAPI_PREFIX(Uniform2uivEXT)(GLint location, GLsizei count, const GLuint *value);
+GLAPI void APIENTRY GLAPI_PREFIX(Uniform2uiv)(GLint location, GLsizei count, const GLuint *value);
+GLAPI void APIENTRY GLAPI_PREFIX(Uniform3uiEXT)(GLint location, GLuint x, GLuint y, GLuint z);
+GLAPI void APIENTRY GLAPI_PREFIX(Uniform3ui)(GLint location, GLuint x, GLuint y, GLuint z);
+GLAPI void APIENTRY GLAPI_PREFIX(Uniform3uivEXT)(GLint location, GLsizei count, const GLuint *value);
+GLAPI void APIENTRY GLAPI_PREFIX(Uniform3uiv)(GLint location, GLsizei count, const GLuint *value);
+GLAPI void APIENTRY GLAPI_PREFIX(Uniform4uiEXT)(GLint location, GLuint x, GLuint y, GLuint z, GLuint w);
+GLAPI void APIENTRY GLAPI_PREFIX(Uniform4ui)(GLint location, GLuint x, GLuint y, GLuint z, GLuint w);
+GLAPI void APIENTRY GLAPI_PREFIX(Uniform4uivEXT)(GLint location, GLsizei count, const GLuint *value);
+GLAPI void APIENTRY GLAPI_PREFIX(Uniform4uiv)(GLint location, GLsizei count, const GLuint *value);
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribI1iEXT)(GLuint index, GLint x);
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribI1i)(GLuint index, GLint x);
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribI1ivEXT)(GLuint index, const GLint *v);
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribI1iv)(GLuint index, const GLint *v);
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribI1uiEXT)(GLuint index, GLuint x);
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribI1ui)(GLuint index, GLuint x);
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribI1uivEXT)(GLuint index, const GLuint *v);
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribI1uiv)(GLuint index, const GLuint *v);
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribI2iEXT)(GLuint index, GLint x, GLint y);
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribI2i)(GLuint index, GLint x, GLint y);
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribI2ivEXT)(GLuint index, const GLint *v);
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribI2iv)(GLuint index, const GLint *v);
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribI2uiEXT)(GLuint index, GLuint x, GLuint y);
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribI2ui)(GLuint index, GLuint x, GLuint y);
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribI2uivEXT)(GLuint index, const GLuint *v);
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribI2uiv)(GLuint index, const GLuint *v);
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribI3iEXT)(GLuint index, GLint x, GLint y, GLint z);
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribI3i)(GLuint index, GLint x, GLint y, GLint z);
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribI3ivEXT)(GLuint index, const GLint *v);
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribI3iv)(GLuint index, const GLint *v);
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribI3uiEXT)(GLuint index, GLuint x, GLuint y, GLuint z);
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribI3ui)(GLuint index, GLuint x, GLuint y, GLuint z);
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribI3uivEXT)(GLuint index, const GLuint *v);
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribI3uiv)(GLuint index, const GLuint *v);
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribI4bvEXT)(GLuint index, const GLbyte *v);
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribI4bv)(GLuint index, const GLbyte *v);
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribI4iEXT)(GLuint index, GLint x, GLint y, GLint z, GLint w);
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribI4i)(GLuint index, GLint x, GLint y, GLint z, GLint w);
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribI4ivEXT)(GLuint index, const GLint *v);
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribI4iv)(GLuint index, const GLint *v);
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribI4svEXT)(GLuint index, const GLshort *v);
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribI4sv)(GLuint index, const GLshort *v);
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribI4ubvEXT)(GLuint index, const GLubyte *v);
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribI4ubv)(GLuint index, const GLubyte *v);
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribI4uiEXT)(GLuint index, GLuint x, GLuint y, GLuint z, GLuint w);
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribI4ui)(GLuint index, GLuint x, GLuint y, GLuint z, GLuint w);
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribI4uivEXT)(GLuint index, const GLuint *v);
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribI4uiv)(GLuint index, const GLuint *v);
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribI4usvEXT)(GLuint index, const GLushort *v);
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribI4usv)(GLuint index, const GLushort *v);
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribIPointerEXT)(GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribIPointer)(GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
+GLAPI void APIENTRY GLAPI_PREFIX(FramebufferTextureLayerEXT)(GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer);
+GLAPI void APIENTRY GLAPI_PREFIX(FramebufferTextureLayer)(GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer);
+GLAPI void APIENTRY GLAPI_PREFIX(ColorMaskIndexedEXT)(GLuint buf, GLboolean r, GLboolean g, GLboolean b, GLboolean a);
+GLAPI void APIENTRY GLAPI_PREFIX(ColorMaski)(GLuint buf, GLboolean r, GLboolean g, GLboolean b, GLboolean a);
+GLAPI void APIENTRY GLAPI_PREFIX(DisableIndexedEXT)(GLenum target, GLuint index);
+GLAPI void APIENTRY GLAPI_PREFIX(Disablei)(GLenum target, GLuint index);
+GLAPI void APIENTRY GLAPI_PREFIX(EnableIndexedEXT)(GLenum target, GLuint index);
+GLAPI void APIENTRY GLAPI_PREFIX(Enablei)(GLenum target, GLuint index);
+GLAPI void APIENTRY GLAPI_PREFIX(GetBooleanIndexedvEXT)(GLenum value, GLuint index, GLboolean *data);
+GLAPI void APIENTRY GLAPI_PREFIX(GetBooleani_v)(GLenum value, GLuint index, GLboolean *data);
+GLAPI void APIENTRY GLAPI_PREFIX(GetIntegerIndexedvEXT)(GLenum value, GLuint index, GLint *data);
+GLAPI void APIENTRY GLAPI_PREFIX(GetIntegeri_v)(GLenum value, GLuint index, GLint *data);
+GLAPI GLboolean APIENTRY GLAPI_PREFIX(IsEnabledIndexedEXT)(GLenum target, GLuint index);
+GLAPI GLboolean APIENTRY GLAPI_PREFIX(IsEnabledi)(GLenum target, GLuint index);
+GLAPI void APIENTRY GLAPI_PREFIX(ClearColorIiEXT)(GLint r, GLint g, GLint b, GLint a);
+GLAPI void APIENTRY GLAPI_PREFIX(ClearColorIuiEXT)(GLuint r, GLuint g, GLuint b, GLuint a);
+GLAPI void APIENTRY GLAPI_PREFIX(GetTexParameterIivEXT)(GLenum target, GLenum pname, GLint *params);
+GLAPI void APIENTRY GLAPI_PREFIX(GetTexParameterIiv)(GLenum target, GLenum pname, GLint *params);
+GLAPI void APIENTRY GLAPI_PREFIX(GetTexParameterIuivEXT)(GLenum target, GLenum pname, GLuint *params);
+GLAPI void APIENTRY GLAPI_PREFIX(GetTexParameterIuiv)(GLenum target, GLenum pname, GLuint *params);
+GLAPI void APIENTRY GLAPI_PREFIX(TexParameterIivEXT)(GLenum target, GLenum pname, const GLint *params);
+GLAPI void APIENTRY GLAPI_PREFIX(TexParameterIiv)(GLenum target, GLenum pname, const GLint *params);
+GLAPI void APIENTRY GLAPI_PREFIX(TexParameterIuivEXT)(GLenum target, GLenum pname, const GLuint *params);
+GLAPI void APIENTRY GLAPI_PREFIX(TexParameterIuiv)(GLenum target, GLenum pname, const GLuint *params);
+GLAPI void APIENTRY GLAPI_PREFIX(BeginConditionalRenderNV)(GLuint query, GLenum mode);
+GLAPI void APIENTRY GLAPI_PREFIX(BeginConditionalRender)(GLuint query, GLenum mode);
+GLAPI void APIENTRY GLAPI_PREFIX(EndConditionalRenderNV)(void);
+GLAPI void APIENTRY GLAPI_PREFIX(EndConditionalRender)(void);
+GLAPI void APIENTRY GLAPI_PREFIX(BeginTransformFeedbackEXT)(GLenum mode);
+GLAPI void APIENTRY GLAPI_PREFIX(BeginTransformFeedback)(GLenum mode);
+GLAPI void APIENTRY GLAPI_PREFIX(BindBufferBaseEXT)(GLenum target, GLuint index, GLuint buffer);
+GLAPI void APIENTRY GLAPI_PREFIX(BindBufferBase)(GLenum target, GLuint index, GLuint buffer);
+GLAPI void APIENTRY GLAPI_PREFIX(BindBufferOffsetEXT)(GLenum target, GLuint index, GLuint buffer, GLintptr offset);
+GLAPI void APIENTRY GLAPI_PREFIX(BindBufferRangeEXT)(GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size);
+GLAPI void APIENTRY GLAPI_PREFIX(BindBufferRange)(GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size);
+GLAPI void APIENTRY GLAPI_PREFIX(EndTransformFeedbackEXT)(void);
+GLAPI void APIENTRY GLAPI_PREFIX(EndTransformFeedback)(void);
+GLAPI void APIENTRY GLAPI_PREFIX(GetTransformFeedbackVaryingEXT)(GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name);
+GLAPI void APIENTRY GLAPI_PREFIX(GetTransformFeedbackVarying)(GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name);
+GLAPI void APIENTRY GLAPI_PREFIX(TransformFeedbackVaryingsEXT)(GLuint program, GLsizei count, const char **varyings, GLenum bufferMode);
+GLAPI void APIENTRY GLAPI_PREFIX(TransformFeedbackVaryings)(GLuint program, GLsizei count, const GLchar* *varyings, GLenum bufferMode);
+GLAPI void APIENTRY GLAPI_PREFIX(ProvokingVertexEXT)(GLenum mode);
+GLAPI void APIENTRY GLAPI_PREFIX(ProvokingVertex)(GLenum mode);
+void APIENTRY GLAPI_PREFIX(_dispatch_stub_971)(GLenum target, GLenum pname, GLvoid **params);
+void APIENTRY GLAPI_PREFIX(_dispatch_stub_972)(GLenum target, GLsizei length, GLvoid *pointer);
+GLAPI void APIENTRY GLAPI_PREFIX(GetObjectParameterivAPPLE)(GLenum objectType, GLuint name, GLenum pname, GLint *value);
+GLAPI GLenum APIENTRY GLAPI_PREFIX(ObjectPurgeableAPPLE)(GLenum objectType, GLuint name, GLenum option);
+GLAPI GLenum APIENTRY GLAPI_PREFIX(ObjectUnpurgeableAPPLE)(GLenum objectType, GLuint name, GLenum option);
+GLAPI void APIENTRY GLAPI_PREFIX(ActiveProgramEXT)(GLuint program);
+GLAPI GLuint APIENTRY GLAPI_PREFIX(CreateShaderProgramEXT)(GLenum type, const GLchar *string);
+GLAPI void APIENTRY GLAPI_PREFIX(UseShaderProgramEXT)(GLenum type, GLuint program);
+GLAPI void APIENTRY GLAPI_PREFIX(TextureBarrierNV)(void);
+void APIENTRY GLAPI_PREFIX(_dispatch_stub_980)(GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask);
+void APIENTRY GLAPI_PREFIX(_dispatch_stub_981)(GLenum target, GLuint index, GLsizei count, const GLfloat *params);
+void APIENTRY GLAPI_PREFIX(_dispatch_stub_982)(GLenum target, GLuint index, GLsizei count, const GLfloat *params);
+void APIENTRY GLAPI_PREFIX(_dispatch_stub_983)(GLuint id, GLenum pname, GLint64EXT *params);
+void APIENTRY GLAPI_PREFIX(_dispatch_stub_984)(GLuint id, GLenum pname, GLuint64EXT *params);
+GLAPI void APIENTRY GLAPI_PREFIX(EGLImageTargetRenderbufferStorageOES)(GLenum target, GLvoid *writeOffset);
+GLAPI void APIENTRY GLAPI_PREFIX(EGLImageTargetTexture2DOES)(GLenum target, GLvoid *writeOffset);
+#undef MAPI_TMP_DEFINES
+#endif /* MAPI_TMP_DEFINES */
+
+#ifdef MAPI_TMP_PUBLIC_ENTRIES_NO_HIDDEN
+GLAPI void APIENTRY GLAPI_PREFIX(NewList)(GLuint list, GLenum mode)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[0];
+ ((void (APIENTRY *)(GLuint list, GLenum mode)) _func)(list, mode);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(EndList)(void)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[1];
+ ((void (APIENTRY *)(void)) _func)();
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(CallList)(GLuint list)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[2];
+ ((void (APIENTRY *)(GLuint list)) _func)(list);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(CallLists)(GLsizei n, GLenum type, const GLvoid *lists)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[3];
+ ((void (APIENTRY *)(GLsizei n, GLenum type, const GLvoid *lists)) _func)(n, type, lists);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(DeleteLists)(GLuint list, GLsizei range)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[4];
+ ((void (APIENTRY *)(GLuint list, GLsizei range)) _func)(list, range);
+}
+
+GLAPI GLuint APIENTRY GLAPI_PREFIX(GenLists)(GLsizei range)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[5];
+ return ((GLuint (APIENTRY *)(GLsizei range)) _func)(range);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(ListBase)(GLuint base)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[6];
+ ((void (APIENTRY *)(GLuint base)) _func)(base);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(Begin)(GLenum mode)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[7];
+ ((void (APIENTRY *)(GLenum mode)) _func)(mode);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(Bitmap)(GLsizei width, GLsizei height, GLfloat xorig, GLfloat yorig, GLfloat xmove, GLfloat ymove, const GLubyte *bitmap)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[8];
+ ((void (APIENTRY *)(GLsizei width, GLsizei height, GLfloat xorig, GLfloat yorig, GLfloat xmove, GLfloat ymove, const GLubyte *bitmap)) _func)(width, height, xorig, yorig, xmove, ymove, bitmap);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(Color3b)(GLbyte red, GLbyte green, GLbyte blue)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[9];
+ ((void (APIENTRY *)(GLbyte red, GLbyte green, GLbyte blue)) _func)(red, green, blue);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(Color3bv)(const GLbyte *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[10];
+ ((void (APIENTRY *)(const GLbyte *v)) _func)(v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(Color3d)(GLdouble red, GLdouble green, GLdouble blue)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[11];
+ ((void (APIENTRY *)(GLdouble red, GLdouble green, GLdouble blue)) _func)(red, green, blue);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(Color3dv)(const GLdouble *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[12];
+ ((void (APIENTRY *)(const GLdouble *v)) _func)(v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(Color3f)(GLfloat red, GLfloat green, GLfloat blue)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[13];
+ ((void (APIENTRY *)(GLfloat red, GLfloat green, GLfloat blue)) _func)(red, green, blue);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(Color3fv)(const GLfloat *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[14];
+ ((void (APIENTRY *)(const GLfloat *v)) _func)(v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(Color3i)(GLint red, GLint green, GLint blue)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[15];
+ ((void (APIENTRY *)(GLint red, GLint green, GLint blue)) _func)(red, green, blue);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(Color3iv)(const GLint *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[16];
+ ((void (APIENTRY *)(const GLint *v)) _func)(v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(Color3s)(GLshort red, GLshort green, GLshort blue)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[17];
+ ((void (APIENTRY *)(GLshort red, GLshort green, GLshort blue)) _func)(red, green, blue);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(Color3sv)(const GLshort *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[18];
+ ((void (APIENTRY *)(const GLshort *v)) _func)(v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(Color3ub)(GLubyte red, GLubyte green, GLubyte blue)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[19];
+ ((void (APIENTRY *)(GLubyte red, GLubyte green, GLubyte blue)) _func)(red, green, blue);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(Color3ubv)(const GLubyte *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[20];
+ ((void (APIENTRY *)(const GLubyte *v)) _func)(v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(Color3ui)(GLuint red, GLuint green, GLuint blue)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[21];
+ ((void (APIENTRY *)(GLuint red, GLuint green, GLuint blue)) _func)(red, green, blue);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(Color3uiv)(const GLuint *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[22];
+ ((void (APIENTRY *)(const GLuint *v)) _func)(v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(Color3us)(GLushort red, GLushort green, GLushort blue)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[23];
+ ((void (APIENTRY *)(GLushort red, GLushort green, GLushort blue)) _func)(red, green, blue);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(Color3usv)(const GLushort *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[24];
+ ((void (APIENTRY *)(const GLushort *v)) _func)(v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(Color4b)(GLbyte red, GLbyte green, GLbyte blue, GLbyte alpha)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[25];
+ ((void (APIENTRY *)(GLbyte red, GLbyte green, GLbyte blue, GLbyte alpha)) _func)(red, green, blue, alpha);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(Color4bv)(const GLbyte *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[26];
+ ((void (APIENTRY *)(const GLbyte *v)) _func)(v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(Color4d)(GLdouble red, GLdouble green, GLdouble blue, GLdouble alpha)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[27];
+ ((void (APIENTRY *)(GLdouble red, GLdouble green, GLdouble blue, GLdouble alpha)) _func)(red, green, blue, alpha);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(Color4dv)(const GLdouble *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[28];
+ ((void (APIENTRY *)(const GLdouble *v)) _func)(v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(Color4f)(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[29];
+ ((void (APIENTRY *)(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha)) _func)(red, green, blue, alpha);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(Color4fv)(const GLfloat *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[30];
+ ((void (APIENTRY *)(const GLfloat *v)) _func)(v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(Color4i)(GLint red, GLint green, GLint blue, GLint alpha)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[31];
+ ((void (APIENTRY *)(GLint red, GLint green, GLint blue, GLint alpha)) _func)(red, green, blue, alpha);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(Color4iv)(const GLint *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[32];
+ ((void (APIENTRY *)(const GLint *v)) _func)(v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(Color4s)(GLshort red, GLshort green, GLshort blue, GLshort alpha)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[33];
+ ((void (APIENTRY *)(GLshort red, GLshort green, GLshort blue, GLshort alpha)) _func)(red, green, blue, alpha);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(Color4sv)(const GLshort *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[34];
+ ((void (APIENTRY *)(const GLshort *v)) _func)(v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(Color4ub)(GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[35];
+ ((void (APIENTRY *)(GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha)) _func)(red, green, blue, alpha);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(Color4ubv)(const GLubyte *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[36];
+ ((void (APIENTRY *)(const GLubyte *v)) _func)(v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(Color4ui)(GLuint red, GLuint green, GLuint blue, GLuint alpha)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[37];
+ ((void (APIENTRY *)(GLuint red, GLuint green, GLuint blue, GLuint alpha)) _func)(red, green, blue, alpha);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(Color4uiv)(const GLuint *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[38];
+ ((void (APIENTRY *)(const GLuint *v)) _func)(v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(Color4us)(GLushort red, GLushort green, GLushort blue, GLushort alpha)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[39];
+ ((void (APIENTRY *)(GLushort red, GLushort green, GLushort blue, GLushort alpha)) _func)(red, green, blue, alpha);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(Color4usv)(const GLushort *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[40];
+ ((void (APIENTRY *)(const GLushort *v)) _func)(v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(EdgeFlag)(GLboolean flag)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[41];
+ ((void (APIENTRY *)(GLboolean flag)) _func)(flag);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(EdgeFlagv)(const GLboolean *flag)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[42];
+ ((void (APIENTRY *)(const GLboolean *flag)) _func)(flag);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(End)(void)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[43];
+ ((void (APIENTRY *)(void)) _func)();
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(Indexd)(GLdouble c)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[44];
+ ((void (APIENTRY *)(GLdouble c)) _func)(c);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(Indexdv)(const GLdouble *c)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[45];
+ ((void (APIENTRY *)(const GLdouble *c)) _func)(c);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(Indexf)(GLfloat c)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[46];
+ ((void (APIENTRY *)(GLfloat c)) _func)(c);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(Indexfv)(const GLfloat *c)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[47];
+ ((void (APIENTRY *)(const GLfloat *c)) _func)(c);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(Indexi)(GLint c)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[48];
+ ((void (APIENTRY *)(GLint c)) _func)(c);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(Indexiv)(const GLint *c)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[49];
+ ((void (APIENTRY *)(const GLint *c)) _func)(c);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(Indexs)(GLshort c)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[50];
+ ((void (APIENTRY *)(GLshort c)) _func)(c);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(Indexsv)(const GLshort *c)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[51];
+ ((void (APIENTRY *)(const GLshort *c)) _func)(c);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(Normal3b)(GLbyte nx, GLbyte ny, GLbyte nz)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[52];
+ ((void (APIENTRY *)(GLbyte nx, GLbyte ny, GLbyte nz)) _func)(nx, ny, nz);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(Normal3bv)(const GLbyte *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[53];
+ ((void (APIENTRY *)(const GLbyte *v)) _func)(v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(Normal3d)(GLdouble nx, GLdouble ny, GLdouble nz)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[54];
+ ((void (APIENTRY *)(GLdouble nx, GLdouble ny, GLdouble nz)) _func)(nx, ny, nz);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(Normal3dv)(const GLdouble *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[55];
+ ((void (APIENTRY *)(const GLdouble *v)) _func)(v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(Normal3f)(GLfloat nx, GLfloat ny, GLfloat nz)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[56];
+ ((void (APIENTRY *)(GLfloat nx, GLfloat ny, GLfloat nz)) _func)(nx, ny, nz);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(Normal3fv)(const GLfloat *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[57];
+ ((void (APIENTRY *)(const GLfloat *v)) _func)(v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(Normal3i)(GLint nx, GLint ny, GLint nz)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[58];
+ ((void (APIENTRY *)(GLint nx, GLint ny, GLint nz)) _func)(nx, ny, nz);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(Normal3iv)(const GLint *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[59];
+ ((void (APIENTRY *)(const GLint *v)) _func)(v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(Normal3s)(GLshort nx, GLshort ny, GLshort nz)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[60];
+ ((void (APIENTRY *)(GLshort nx, GLshort ny, GLshort nz)) _func)(nx, ny, nz);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(Normal3sv)(const GLshort *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[61];
+ ((void (APIENTRY *)(const GLshort *v)) _func)(v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(RasterPos2d)(GLdouble x, GLdouble y)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[62];
+ ((void (APIENTRY *)(GLdouble x, GLdouble y)) _func)(x, y);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(RasterPos2dv)(const GLdouble *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[63];
+ ((void (APIENTRY *)(const GLdouble *v)) _func)(v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(RasterPos2f)(GLfloat x, GLfloat y)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[64];
+ ((void (APIENTRY *)(GLfloat x, GLfloat y)) _func)(x, y);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(RasterPos2fv)(const GLfloat *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[65];
+ ((void (APIENTRY *)(const GLfloat *v)) _func)(v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(RasterPos2i)(GLint x, GLint y)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[66];
+ ((void (APIENTRY *)(GLint x, GLint y)) _func)(x, y);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(RasterPos2iv)(const GLint *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[67];
+ ((void (APIENTRY *)(const GLint *v)) _func)(v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(RasterPos2s)(GLshort x, GLshort y)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[68];
+ ((void (APIENTRY *)(GLshort x, GLshort y)) _func)(x, y);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(RasterPos2sv)(const GLshort *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[69];
+ ((void (APIENTRY *)(const GLshort *v)) _func)(v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(RasterPos3d)(GLdouble x, GLdouble y, GLdouble z)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[70];
+ ((void (APIENTRY *)(GLdouble x, GLdouble y, GLdouble z)) _func)(x, y, z);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(RasterPos3dv)(const GLdouble *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[71];
+ ((void (APIENTRY *)(const GLdouble *v)) _func)(v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(RasterPos3f)(GLfloat x, GLfloat y, GLfloat z)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[72];
+ ((void (APIENTRY *)(GLfloat x, GLfloat y, GLfloat z)) _func)(x, y, z);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(RasterPos3fv)(const GLfloat *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[73];
+ ((void (APIENTRY *)(const GLfloat *v)) _func)(v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(RasterPos3i)(GLint x, GLint y, GLint z)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[74];
+ ((void (APIENTRY *)(GLint x, GLint y, GLint z)) _func)(x, y, z);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(RasterPos3iv)(const GLint *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[75];
+ ((void (APIENTRY *)(const GLint *v)) _func)(v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(RasterPos3s)(GLshort x, GLshort y, GLshort z)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[76];
+ ((void (APIENTRY *)(GLshort x, GLshort y, GLshort z)) _func)(x, y, z);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(RasterPos3sv)(const GLshort *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[77];
+ ((void (APIENTRY *)(const GLshort *v)) _func)(v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(RasterPos4d)(GLdouble x, GLdouble y, GLdouble z, GLdouble w)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[78];
+ ((void (APIENTRY *)(GLdouble x, GLdouble y, GLdouble z, GLdouble w)) _func)(x, y, z, w);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(RasterPos4dv)(const GLdouble *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[79];
+ ((void (APIENTRY *)(const GLdouble *v)) _func)(v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(RasterPos4f)(GLfloat x, GLfloat y, GLfloat z, GLfloat w)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[80];
+ ((void (APIENTRY *)(GLfloat x, GLfloat y, GLfloat z, GLfloat w)) _func)(x, y, z, w);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(RasterPos4fv)(const GLfloat *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[81];
+ ((void (APIENTRY *)(const GLfloat *v)) _func)(v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(RasterPos4i)(GLint x, GLint y, GLint z, GLint w)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[82];
+ ((void (APIENTRY *)(GLint x, GLint y, GLint z, GLint w)) _func)(x, y, z, w);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(RasterPos4iv)(const GLint *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[83];
+ ((void (APIENTRY *)(const GLint *v)) _func)(v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(RasterPos4s)(GLshort x, GLshort y, GLshort z, GLshort w)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[84];
+ ((void (APIENTRY *)(GLshort x, GLshort y, GLshort z, GLshort w)) _func)(x, y, z, w);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(RasterPos4sv)(const GLshort *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[85];
+ ((void (APIENTRY *)(const GLshort *v)) _func)(v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(Rectd)(GLdouble x1, GLdouble y1, GLdouble x2, GLdouble y2)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[86];
+ ((void (APIENTRY *)(GLdouble x1, GLdouble y1, GLdouble x2, GLdouble y2)) _func)(x1, y1, x2, y2);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(Rectdv)(const GLdouble *v1, const GLdouble *v2)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[87];
+ ((void (APIENTRY *)(const GLdouble *v1, const GLdouble *v2)) _func)(v1, v2);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(Rectf)(GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[88];
+ ((void (APIENTRY *)(GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2)) _func)(x1, y1, x2, y2);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(Rectfv)(const GLfloat *v1, const GLfloat *v2)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[89];
+ ((void (APIENTRY *)(const GLfloat *v1, const GLfloat *v2)) _func)(v1, v2);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(Recti)(GLint x1, GLint y1, GLint x2, GLint y2)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[90];
+ ((void (APIENTRY *)(GLint x1, GLint y1, GLint x2, GLint y2)) _func)(x1, y1, x2, y2);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(Rectiv)(const GLint *v1, const GLint *v2)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[91];
+ ((void (APIENTRY *)(const GLint *v1, const GLint *v2)) _func)(v1, v2);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(Rects)(GLshort x1, GLshort y1, GLshort x2, GLshort y2)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[92];
+ ((void (APIENTRY *)(GLshort x1, GLshort y1, GLshort x2, GLshort y2)) _func)(x1, y1, x2, y2);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(Rectsv)(const GLshort *v1, const GLshort *v2)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[93];
+ ((void (APIENTRY *)(const GLshort *v1, const GLshort *v2)) _func)(v1, v2);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(TexCoord1d)(GLdouble s)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[94];
+ ((void (APIENTRY *)(GLdouble s)) _func)(s);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(TexCoord1dv)(const GLdouble *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[95];
+ ((void (APIENTRY *)(const GLdouble *v)) _func)(v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(TexCoord1f)(GLfloat s)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[96];
+ ((void (APIENTRY *)(GLfloat s)) _func)(s);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(TexCoord1fv)(const GLfloat *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[97];
+ ((void (APIENTRY *)(const GLfloat *v)) _func)(v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(TexCoord1i)(GLint s)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[98];
+ ((void (APIENTRY *)(GLint s)) _func)(s);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(TexCoord1iv)(const GLint *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[99];
+ ((void (APIENTRY *)(const GLint *v)) _func)(v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(TexCoord1s)(GLshort s)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[100];
+ ((void (APIENTRY *)(GLshort s)) _func)(s);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(TexCoord1sv)(const GLshort *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[101];
+ ((void (APIENTRY *)(const GLshort *v)) _func)(v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(TexCoord2d)(GLdouble s, GLdouble t)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[102];
+ ((void (APIENTRY *)(GLdouble s, GLdouble t)) _func)(s, t);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(TexCoord2dv)(const GLdouble *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[103];
+ ((void (APIENTRY *)(const GLdouble *v)) _func)(v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(TexCoord2f)(GLfloat s, GLfloat t)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[104];
+ ((void (APIENTRY *)(GLfloat s, GLfloat t)) _func)(s, t);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(TexCoord2fv)(const GLfloat *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[105];
+ ((void (APIENTRY *)(const GLfloat *v)) _func)(v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(TexCoord2i)(GLint s, GLint t)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[106];
+ ((void (APIENTRY *)(GLint s, GLint t)) _func)(s, t);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(TexCoord2iv)(const GLint *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[107];
+ ((void (APIENTRY *)(const GLint *v)) _func)(v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(TexCoord2s)(GLshort s, GLshort t)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[108];
+ ((void (APIENTRY *)(GLshort s, GLshort t)) _func)(s, t);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(TexCoord2sv)(const GLshort *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[109];
+ ((void (APIENTRY *)(const GLshort *v)) _func)(v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(TexCoord3d)(GLdouble s, GLdouble t, GLdouble r)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[110];
+ ((void (APIENTRY *)(GLdouble s, GLdouble t, GLdouble r)) _func)(s, t, r);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(TexCoord3dv)(const GLdouble *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[111];
+ ((void (APIENTRY *)(const GLdouble *v)) _func)(v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(TexCoord3f)(GLfloat s, GLfloat t, GLfloat r)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[112];
+ ((void (APIENTRY *)(GLfloat s, GLfloat t, GLfloat r)) _func)(s, t, r);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(TexCoord3fv)(const GLfloat *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[113];
+ ((void (APIENTRY *)(const GLfloat *v)) _func)(v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(TexCoord3i)(GLint s, GLint t, GLint r)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[114];
+ ((void (APIENTRY *)(GLint s, GLint t, GLint r)) _func)(s, t, r);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(TexCoord3iv)(const GLint *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[115];
+ ((void (APIENTRY *)(const GLint *v)) _func)(v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(TexCoord3s)(GLshort s, GLshort t, GLshort r)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[116];
+ ((void (APIENTRY *)(GLshort s, GLshort t, GLshort r)) _func)(s, t, r);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(TexCoord3sv)(const GLshort *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[117];
+ ((void (APIENTRY *)(const GLshort *v)) _func)(v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(TexCoord4d)(GLdouble s, GLdouble t, GLdouble r, GLdouble q)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[118];
+ ((void (APIENTRY *)(GLdouble s, GLdouble t, GLdouble r, GLdouble q)) _func)(s, t, r, q);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(TexCoord4dv)(const GLdouble *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[119];
+ ((void (APIENTRY *)(const GLdouble *v)) _func)(v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(TexCoord4f)(GLfloat s, GLfloat t, GLfloat r, GLfloat q)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[120];
+ ((void (APIENTRY *)(GLfloat s, GLfloat t, GLfloat r, GLfloat q)) _func)(s, t, r, q);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(TexCoord4fv)(const GLfloat *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[121];
+ ((void (APIENTRY *)(const GLfloat *v)) _func)(v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(TexCoord4i)(GLint s, GLint t, GLint r, GLint q)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[122];
+ ((void (APIENTRY *)(GLint s, GLint t, GLint r, GLint q)) _func)(s, t, r, q);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(TexCoord4iv)(const GLint *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[123];
+ ((void (APIENTRY *)(const GLint *v)) _func)(v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(TexCoord4s)(GLshort s, GLshort t, GLshort r, GLshort q)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[124];
+ ((void (APIENTRY *)(GLshort s, GLshort t, GLshort r, GLshort q)) _func)(s, t, r, q);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(TexCoord4sv)(const GLshort *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[125];
+ ((void (APIENTRY *)(const GLshort *v)) _func)(v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(Vertex2d)(GLdouble x, GLdouble y)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[126];
+ ((void (APIENTRY *)(GLdouble x, GLdouble y)) _func)(x, y);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(Vertex2dv)(const GLdouble *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[127];
+ ((void (APIENTRY *)(const GLdouble *v)) _func)(v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(Vertex2f)(GLfloat x, GLfloat y)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[128];
+ ((void (APIENTRY *)(GLfloat x, GLfloat y)) _func)(x, y);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(Vertex2fv)(const GLfloat *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[129];
+ ((void (APIENTRY *)(const GLfloat *v)) _func)(v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(Vertex2i)(GLint x, GLint y)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[130];
+ ((void (APIENTRY *)(GLint x, GLint y)) _func)(x, y);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(Vertex2iv)(const GLint *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[131];
+ ((void (APIENTRY *)(const GLint *v)) _func)(v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(Vertex2s)(GLshort x, GLshort y)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[132];
+ ((void (APIENTRY *)(GLshort x, GLshort y)) _func)(x, y);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(Vertex2sv)(const GLshort *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[133];
+ ((void (APIENTRY *)(const GLshort *v)) _func)(v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(Vertex3d)(GLdouble x, GLdouble y, GLdouble z)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[134];
+ ((void (APIENTRY *)(GLdouble x, GLdouble y, GLdouble z)) _func)(x, y, z);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(Vertex3dv)(const GLdouble *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[135];
+ ((void (APIENTRY *)(const GLdouble *v)) _func)(v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(Vertex3f)(GLfloat x, GLfloat y, GLfloat z)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[136];
+ ((void (APIENTRY *)(GLfloat x, GLfloat y, GLfloat z)) _func)(x, y, z);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(Vertex3fv)(const GLfloat *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[137];
+ ((void (APIENTRY *)(const GLfloat *v)) _func)(v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(Vertex3i)(GLint x, GLint y, GLint z)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[138];
+ ((void (APIENTRY *)(GLint x, GLint y, GLint z)) _func)(x, y, z);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(Vertex3iv)(const GLint *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[139];
+ ((void (APIENTRY *)(const GLint *v)) _func)(v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(Vertex3s)(GLshort x, GLshort y, GLshort z)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[140];
+ ((void (APIENTRY *)(GLshort x, GLshort y, GLshort z)) _func)(x, y, z);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(Vertex3sv)(const GLshort *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[141];
+ ((void (APIENTRY *)(const GLshort *v)) _func)(v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(Vertex4d)(GLdouble x, GLdouble y, GLdouble z, GLdouble w)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[142];
+ ((void (APIENTRY *)(GLdouble x, GLdouble y, GLdouble z, GLdouble w)) _func)(x, y, z, w);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(Vertex4dv)(const GLdouble *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[143];
+ ((void (APIENTRY *)(const GLdouble *v)) _func)(v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(Vertex4f)(GLfloat x, GLfloat y, GLfloat z, GLfloat w)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[144];
+ ((void (APIENTRY *)(GLfloat x, GLfloat y, GLfloat z, GLfloat w)) _func)(x, y, z, w);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(Vertex4fv)(const GLfloat *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[145];
+ ((void (APIENTRY *)(const GLfloat *v)) _func)(v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(Vertex4i)(GLint x, GLint y, GLint z, GLint w)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[146];
+ ((void (APIENTRY *)(GLint x, GLint y, GLint z, GLint w)) _func)(x, y, z, w);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(Vertex4iv)(const GLint *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[147];
+ ((void (APIENTRY *)(const GLint *v)) _func)(v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(Vertex4s)(GLshort x, GLshort y, GLshort z, GLshort w)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[148];
+ ((void (APIENTRY *)(GLshort x, GLshort y, GLshort z, GLshort w)) _func)(x, y, z, w);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(Vertex4sv)(const GLshort *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[149];
+ ((void (APIENTRY *)(const GLshort *v)) _func)(v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(ClipPlane)(GLenum plane, const GLdouble *equation)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[150];
+ ((void (APIENTRY *)(GLenum plane, const GLdouble *equation)) _func)(plane, equation);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(ColorMaterial)(GLenum face, GLenum mode)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[151];
+ ((void (APIENTRY *)(GLenum face, GLenum mode)) _func)(face, mode);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(CullFace)(GLenum mode)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[152];
+ ((void (APIENTRY *)(GLenum mode)) _func)(mode);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(Fogf)(GLenum pname, GLfloat param)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[153];
+ ((void (APIENTRY *)(GLenum pname, GLfloat param)) _func)(pname, param);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(Fogfv)(GLenum pname, const GLfloat *params)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[154];
+ ((void (APIENTRY *)(GLenum pname, const GLfloat *params)) _func)(pname, params);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(Fogi)(GLenum pname, GLint param)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[155];
+ ((void (APIENTRY *)(GLenum pname, GLint param)) _func)(pname, param);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(Fogiv)(GLenum pname, const GLint *params)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[156];
+ ((void (APIENTRY *)(GLenum pname, const GLint *params)) _func)(pname, params);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(FrontFace)(GLenum mode)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[157];
+ ((void (APIENTRY *)(GLenum mode)) _func)(mode);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(Hint)(GLenum target, GLenum mode)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[158];
+ ((void (APIENTRY *)(GLenum target, GLenum mode)) _func)(target, mode);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(Lightf)(GLenum light, GLenum pname, GLfloat param)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[159];
+ ((void (APIENTRY *)(GLenum light, GLenum pname, GLfloat param)) _func)(light, pname, param);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(Lightfv)(GLenum light, GLenum pname, const GLfloat *params)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[160];
+ ((void (APIENTRY *)(GLenum light, GLenum pname, const GLfloat *params)) _func)(light, pname, params);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(Lighti)(GLenum light, GLenum pname, GLint param)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[161];
+ ((void (APIENTRY *)(GLenum light, GLenum pname, GLint param)) _func)(light, pname, param);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(Lightiv)(GLenum light, GLenum pname, const GLint *params)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[162];
+ ((void (APIENTRY *)(GLenum light, GLenum pname, const GLint *params)) _func)(light, pname, params);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(LightModelf)(GLenum pname, GLfloat param)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[163];
+ ((void (APIENTRY *)(GLenum pname, GLfloat param)) _func)(pname, param);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(LightModelfv)(GLenum pname, const GLfloat *params)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[164];
+ ((void (APIENTRY *)(GLenum pname, const GLfloat *params)) _func)(pname, params);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(LightModeli)(GLenum pname, GLint param)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[165];
+ ((void (APIENTRY *)(GLenum pname, GLint param)) _func)(pname, param);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(LightModeliv)(GLenum pname, const GLint *params)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[166];
+ ((void (APIENTRY *)(GLenum pname, const GLint *params)) _func)(pname, params);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(LineStipple)(GLint factor, GLushort pattern)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[167];
+ ((void (APIENTRY *)(GLint factor, GLushort pattern)) _func)(factor, pattern);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(LineWidth)(GLfloat width)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[168];
+ ((void (APIENTRY *)(GLfloat width)) _func)(width);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(Materialf)(GLenum face, GLenum pname, GLfloat param)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[169];
+ ((void (APIENTRY *)(GLenum face, GLenum pname, GLfloat param)) _func)(face, pname, param);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(Materialfv)(GLenum face, GLenum pname, const GLfloat *params)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[170];
+ ((void (APIENTRY *)(GLenum face, GLenum pname, const GLfloat *params)) _func)(face, pname, params);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(Materiali)(GLenum face, GLenum pname, GLint param)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[171];
+ ((void (APIENTRY *)(GLenum face, GLenum pname, GLint param)) _func)(face, pname, param);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(Materialiv)(GLenum face, GLenum pname, const GLint *params)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[172];
+ ((void (APIENTRY *)(GLenum face, GLenum pname, const GLint *params)) _func)(face, pname, params);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(PointSize)(GLfloat size)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[173];
+ ((void (APIENTRY *)(GLfloat size)) _func)(size);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(PolygonMode)(GLenum face, GLenum mode)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[174];
+ ((void (APIENTRY *)(GLenum face, GLenum mode)) _func)(face, mode);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(PolygonStipple)(const GLubyte *mask)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[175];
+ ((void (APIENTRY *)(const GLubyte *mask)) _func)(mask);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(Scissor)(GLint x, GLint y, GLsizei width, GLsizei height)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[176];
+ ((void (APIENTRY *)(GLint x, GLint y, GLsizei width, GLsizei height)) _func)(x, y, width, height);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(ShadeModel)(GLenum mode)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[177];
+ ((void (APIENTRY *)(GLenum mode)) _func)(mode);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(TexParameterf)(GLenum target, GLenum pname, GLfloat param)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[178];
+ ((void (APIENTRY *)(GLenum target, GLenum pname, GLfloat param)) _func)(target, pname, param);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(TexParameterfv)(GLenum target, GLenum pname, const GLfloat *params)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[179];
+ ((void (APIENTRY *)(GLenum target, GLenum pname, const GLfloat *params)) _func)(target, pname, params);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(TexParameteri)(GLenum target, GLenum pname, GLint param)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[180];
+ ((void (APIENTRY *)(GLenum target, GLenum pname, GLint param)) _func)(target, pname, param);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(TexParameteriv)(GLenum target, GLenum pname, const GLint *params)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[181];
+ ((void (APIENTRY *)(GLenum target, GLenum pname, const GLint *params)) _func)(target, pname, params);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(TexImage1D)(GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[182];
+ ((void (APIENTRY *)(GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels)) _func)(target, level, internalformat, width, border, format, type, pixels);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(TexImage2D)(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[183];
+ ((void (APIENTRY *)(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels)) _func)(target, level, internalformat, width, height, border, format, type, pixels);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(TexEnvf)(GLenum target, GLenum pname, GLfloat param)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[184];
+ ((void (APIENTRY *)(GLenum target, GLenum pname, GLfloat param)) _func)(target, pname, param);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(TexEnvfv)(GLenum target, GLenum pname, const GLfloat *params)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[185];
+ ((void (APIENTRY *)(GLenum target, GLenum pname, const GLfloat *params)) _func)(target, pname, params);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(TexEnvi)(GLenum target, GLenum pname, GLint param)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[186];
+ ((void (APIENTRY *)(GLenum target, GLenum pname, GLint param)) _func)(target, pname, param);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(TexEnviv)(GLenum target, GLenum pname, const GLint *params)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[187];
+ ((void (APIENTRY *)(GLenum target, GLenum pname, const GLint *params)) _func)(target, pname, params);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(TexGend)(GLenum coord, GLenum pname, GLdouble param)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[188];
+ ((void (APIENTRY *)(GLenum coord, GLenum pname, GLdouble param)) _func)(coord, pname, param);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(TexGendv)(GLenum coord, GLenum pname, const GLdouble *params)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[189];
+ ((void (APIENTRY *)(GLenum coord, GLenum pname, const GLdouble *params)) _func)(coord, pname, params);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(TexGenf)(GLenum coord, GLenum pname, GLfloat param)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[190];
+ ((void (APIENTRY *)(GLenum coord, GLenum pname, GLfloat param)) _func)(coord, pname, param);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(TexGenfv)(GLenum coord, GLenum pname, const GLfloat *params)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[191];
+ ((void (APIENTRY *)(GLenum coord, GLenum pname, const GLfloat *params)) _func)(coord, pname, params);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(TexGeni)(GLenum coord, GLenum pname, GLint param)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[192];
+ ((void (APIENTRY *)(GLenum coord, GLenum pname, GLint param)) _func)(coord, pname, param);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(TexGeniv)(GLenum coord, GLenum pname, const GLint *params)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[193];
+ ((void (APIENTRY *)(GLenum coord, GLenum pname, const GLint *params)) _func)(coord, pname, params);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(FeedbackBuffer)(GLsizei size, GLenum type, GLfloat *buffer)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[194];
+ ((void (APIENTRY *)(GLsizei size, GLenum type, GLfloat *buffer)) _func)(size, type, buffer);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(SelectBuffer)(GLsizei size, GLuint *buffer)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[195];
+ ((void (APIENTRY *)(GLsizei size, GLuint *buffer)) _func)(size, buffer);
+}
+
+GLAPI GLint APIENTRY GLAPI_PREFIX(RenderMode)(GLenum mode)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[196];
+ return ((GLint (APIENTRY *)(GLenum mode)) _func)(mode);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(InitNames)(void)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[197];
+ ((void (APIENTRY *)(void)) _func)();
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(LoadName)(GLuint name)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[198];
+ ((void (APIENTRY *)(GLuint name)) _func)(name);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(PassThrough)(GLfloat token)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[199];
+ ((void (APIENTRY *)(GLfloat token)) _func)(token);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(PopName)(void)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[200];
+ ((void (APIENTRY *)(void)) _func)();
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(PushName)(GLuint name)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[201];
+ ((void (APIENTRY *)(GLuint name)) _func)(name);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(DrawBuffer)(GLenum mode)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[202];
+ ((void (APIENTRY *)(GLenum mode)) _func)(mode);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(Clear)(GLbitfield mask)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[203];
+ ((void (APIENTRY *)(GLbitfield mask)) _func)(mask);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(ClearAccum)(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[204];
+ ((void (APIENTRY *)(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha)) _func)(red, green, blue, alpha);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(ClearIndex)(GLfloat c)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[205];
+ ((void (APIENTRY *)(GLfloat c)) _func)(c);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(ClearColor)(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[206];
+ ((void (APIENTRY *)(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha)) _func)(red, green, blue, alpha);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(ClearStencil)(GLint s)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[207];
+ ((void (APIENTRY *)(GLint s)) _func)(s);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(ClearDepth)(GLclampd depth)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[208];
+ ((void (APIENTRY *)(GLclampd depth)) _func)(depth);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(StencilMask)(GLuint mask)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[209];
+ ((void (APIENTRY *)(GLuint mask)) _func)(mask);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(ColorMask)(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[210];
+ ((void (APIENTRY *)(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha)) _func)(red, green, blue, alpha);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(DepthMask)(GLboolean flag)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[211];
+ ((void (APIENTRY *)(GLboolean flag)) _func)(flag);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(IndexMask)(GLuint mask)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[212];
+ ((void (APIENTRY *)(GLuint mask)) _func)(mask);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(Accum)(GLenum op, GLfloat value)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[213];
+ ((void (APIENTRY *)(GLenum op, GLfloat value)) _func)(op, value);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(Disable)(GLenum cap)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[214];
+ ((void (APIENTRY *)(GLenum cap)) _func)(cap);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(Enable)(GLenum cap)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[215];
+ ((void (APIENTRY *)(GLenum cap)) _func)(cap);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(Finish)(void)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[216];
+ ((void (APIENTRY *)(void)) _func)();
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(Flush)(void)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[217];
+ ((void (APIENTRY *)(void)) _func)();
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(PopAttrib)(void)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[218];
+ ((void (APIENTRY *)(void)) _func)();
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(PushAttrib)(GLbitfield mask)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[219];
+ ((void (APIENTRY *)(GLbitfield mask)) _func)(mask);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(Map1d)(GLenum target, GLdouble u1, GLdouble u2, GLint stride, GLint order, const GLdouble *points)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[220];
+ ((void (APIENTRY *)(GLenum target, GLdouble u1, GLdouble u2, GLint stride, GLint order, const GLdouble *points)) _func)(target, u1, u2, stride, order, points);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(Map1f)(GLenum target, GLfloat u1, GLfloat u2, GLint stride, GLint order, const GLfloat *points)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[221];
+ ((void (APIENTRY *)(GLenum target, GLfloat u1, GLfloat u2, GLint stride, GLint order, const GLfloat *points)) _func)(target, u1, u2, stride, order, points);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(Map2d)(GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, const GLdouble *points)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[222];
+ ((void (APIENTRY *)(GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, const GLdouble *points)) _func)(target, u1, u2, ustride, uorder, v1, v2, vstride, vorder, points);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(Map2f)(GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, const GLfloat *points)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[223];
+ ((void (APIENTRY *)(GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, const GLfloat *points)) _func)(target, u1, u2, ustride, uorder, v1, v2, vstride, vorder, points);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(MapGrid1d)(GLint un, GLdouble u1, GLdouble u2)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[224];
+ ((void (APIENTRY *)(GLint un, GLdouble u1, GLdouble u2)) _func)(un, u1, u2);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(MapGrid1f)(GLint un, GLfloat u1, GLfloat u2)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[225];
+ ((void (APIENTRY *)(GLint un, GLfloat u1, GLfloat u2)) _func)(un, u1, u2);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(MapGrid2d)(GLint un, GLdouble u1, GLdouble u2, GLint vn, GLdouble v1, GLdouble v2)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[226];
+ ((void (APIENTRY *)(GLint un, GLdouble u1, GLdouble u2, GLint vn, GLdouble v1, GLdouble v2)) _func)(un, u1, u2, vn, v1, v2);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(MapGrid2f)(GLint un, GLfloat u1, GLfloat u2, GLint vn, GLfloat v1, GLfloat v2)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[227];
+ ((void (APIENTRY *)(GLint un, GLfloat u1, GLfloat u2, GLint vn, GLfloat v1, GLfloat v2)) _func)(un, u1, u2, vn, v1, v2);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(EvalCoord1d)(GLdouble u)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[228];
+ ((void (APIENTRY *)(GLdouble u)) _func)(u);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(EvalCoord1dv)(const GLdouble *u)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[229];
+ ((void (APIENTRY *)(const GLdouble *u)) _func)(u);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(EvalCoord1f)(GLfloat u)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[230];
+ ((void (APIENTRY *)(GLfloat u)) _func)(u);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(EvalCoord1fv)(const GLfloat *u)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[231];
+ ((void (APIENTRY *)(const GLfloat *u)) _func)(u);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(EvalCoord2d)(GLdouble u, GLdouble v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[232];
+ ((void (APIENTRY *)(GLdouble u, GLdouble v)) _func)(u, v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(EvalCoord2dv)(const GLdouble *u)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[233];
+ ((void (APIENTRY *)(const GLdouble *u)) _func)(u);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(EvalCoord2f)(GLfloat u, GLfloat v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[234];
+ ((void (APIENTRY *)(GLfloat u, GLfloat v)) _func)(u, v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(EvalCoord2fv)(const GLfloat *u)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[235];
+ ((void (APIENTRY *)(const GLfloat *u)) _func)(u);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(EvalMesh1)(GLenum mode, GLint i1, GLint i2)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[236];
+ ((void (APIENTRY *)(GLenum mode, GLint i1, GLint i2)) _func)(mode, i1, i2);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(EvalPoint1)(GLint i)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[237];
+ ((void (APIENTRY *)(GLint i)) _func)(i);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(EvalMesh2)(GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[238];
+ ((void (APIENTRY *)(GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2)) _func)(mode, i1, i2, j1, j2);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(EvalPoint2)(GLint i, GLint j)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[239];
+ ((void (APIENTRY *)(GLint i, GLint j)) _func)(i, j);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(AlphaFunc)(GLenum func, GLclampf ref)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[240];
+ ((void (APIENTRY *)(GLenum func, GLclampf ref)) _func)(func, ref);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(BlendFunc)(GLenum sfactor, GLenum dfactor)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[241];
+ ((void (APIENTRY *)(GLenum sfactor, GLenum dfactor)) _func)(sfactor, dfactor);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(LogicOp)(GLenum opcode)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[242];
+ ((void (APIENTRY *)(GLenum opcode)) _func)(opcode);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(StencilFunc)(GLenum func, GLint ref, GLuint mask)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[243];
+ ((void (APIENTRY *)(GLenum func, GLint ref, GLuint mask)) _func)(func, ref, mask);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(StencilOp)(GLenum fail, GLenum zfail, GLenum zpass)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[244];
+ ((void (APIENTRY *)(GLenum fail, GLenum zfail, GLenum zpass)) _func)(fail, zfail, zpass);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(DepthFunc)(GLenum func)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[245];
+ ((void (APIENTRY *)(GLenum func)) _func)(func);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(PixelZoom)(GLfloat xfactor, GLfloat yfactor)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[246];
+ ((void (APIENTRY *)(GLfloat xfactor, GLfloat yfactor)) _func)(xfactor, yfactor);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(PixelTransferf)(GLenum pname, GLfloat param)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[247];
+ ((void (APIENTRY *)(GLenum pname, GLfloat param)) _func)(pname, param);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(PixelTransferi)(GLenum pname, GLint param)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[248];
+ ((void (APIENTRY *)(GLenum pname, GLint param)) _func)(pname, param);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(PixelStoref)(GLenum pname, GLfloat param)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[249];
+ ((void (APIENTRY *)(GLenum pname, GLfloat param)) _func)(pname, param);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(PixelStorei)(GLenum pname, GLint param)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[250];
+ ((void (APIENTRY *)(GLenum pname, GLint param)) _func)(pname, param);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(PixelMapfv)(GLenum map, GLsizei mapsize, const GLfloat *values)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[251];
+ ((void (APIENTRY *)(GLenum map, GLsizei mapsize, const GLfloat *values)) _func)(map, mapsize, values);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(PixelMapuiv)(GLenum map, GLsizei mapsize, const GLuint *values)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[252];
+ ((void (APIENTRY *)(GLenum map, GLsizei mapsize, const GLuint *values)) _func)(map, mapsize, values);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(PixelMapusv)(GLenum map, GLsizei mapsize, const GLushort *values)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[253];
+ ((void (APIENTRY *)(GLenum map, GLsizei mapsize, const GLushort *values)) _func)(map, mapsize, values);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(ReadBuffer)(GLenum mode)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[254];
+ ((void (APIENTRY *)(GLenum mode)) _func)(mode);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(CopyPixels)(GLint x, GLint y, GLsizei width, GLsizei height, GLenum type)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[255];
+ ((void (APIENTRY *)(GLint x, GLint y, GLsizei width, GLsizei height, GLenum type)) _func)(x, y, width, height, type);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(ReadPixels)(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[256];
+ ((void (APIENTRY *)(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels)) _func)(x, y, width, height, format, type, pixels);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(DrawPixels)(GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[257];
+ ((void (APIENTRY *)(GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels)) _func)(width, height, format, type, pixels);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(GetBooleanv)(GLenum pname, GLboolean *params)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[258];
+ ((void (APIENTRY *)(GLenum pname, GLboolean *params)) _func)(pname, params);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(GetClipPlane)(GLenum plane, GLdouble *equation)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[259];
+ ((void (APIENTRY *)(GLenum plane, GLdouble *equation)) _func)(plane, equation);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(GetDoublev)(GLenum pname, GLdouble *params)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[260];
+ ((void (APIENTRY *)(GLenum pname, GLdouble *params)) _func)(pname, params);
+}
+
+GLAPI GLenum APIENTRY GLAPI_PREFIX(GetError)(void)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[261];
+ return ((GLenum (APIENTRY *)(void)) _func)();
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(GetFloatv)(GLenum pname, GLfloat *params)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[262];
+ ((void (APIENTRY *)(GLenum pname, GLfloat *params)) _func)(pname, params);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(GetIntegerv)(GLenum pname, GLint *params)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[263];
+ ((void (APIENTRY *)(GLenum pname, GLint *params)) _func)(pname, params);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(GetLightfv)(GLenum light, GLenum pname, GLfloat *params)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[264];
+ ((void (APIENTRY *)(GLenum light, GLenum pname, GLfloat *params)) _func)(light, pname, params);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(GetLightiv)(GLenum light, GLenum pname, GLint *params)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[265];
+ ((void (APIENTRY *)(GLenum light, GLenum pname, GLint *params)) _func)(light, pname, params);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(GetMapdv)(GLenum target, GLenum query, GLdouble *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[266];
+ ((void (APIENTRY *)(GLenum target, GLenum query, GLdouble *v)) _func)(target, query, v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(GetMapfv)(GLenum target, GLenum query, GLfloat *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[267];
+ ((void (APIENTRY *)(GLenum target, GLenum query, GLfloat *v)) _func)(target, query, v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(GetMapiv)(GLenum target, GLenum query, GLint *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[268];
+ ((void (APIENTRY *)(GLenum target, GLenum query, GLint *v)) _func)(target, query, v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(GetMaterialfv)(GLenum face, GLenum pname, GLfloat *params)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[269];
+ ((void (APIENTRY *)(GLenum face, GLenum pname, GLfloat *params)) _func)(face, pname, params);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(GetMaterialiv)(GLenum face, GLenum pname, GLint *params)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[270];
+ ((void (APIENTRY *)(GLenum face, GLenum pname, GLint *params)) _func)(face, pname, params);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(GetPixelMapfv)(GLenum map, GLfloat *values)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[271];
+ ((void (APIENTRY *)(GLenum map, GLfloat *values)) _func)(map, values);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(GetPixelMapuiv)(GLenum map, GLuint *values)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[272];
+ ((void (APIENTRY *)(GLenum map, GLuint *values)) _func)(map, values);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(GetPixelMapusv)(GLenum map, GLushort *values)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[273];
+ ((void (APIENTRY *)(GLenum map, GLushort *values)) _func)(map, values);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(GetPolygonStipple)(GLubyte *mask)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[274];
+ ((void (APIENTRY *)(GLubyte *mask)) _func)(mask);
+}
+
+GLAPI const GLubyte * APIENTRY GLAPI_PREFIX(GetString)(GLenum name)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[275];
+ return ((const GLubyte * (APIENTRY *)(GLenum name)) _func)(name);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(GetTexEnvfv)(GLenum target, GLenum pname, GLfloat *params)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[276];
+ ((void (APIENTRY *)(GLenum target, GLenum pname, GLfloat *params)) _func)(target, pname, params);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(GetTexEnviv)(GLenum target, GLenum pname, GLint *params)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[277];
+ ((void (APIENTRY *)(GLenum target, GLenum pname, GLint *params)) _func)(target, pname, params);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(GetTexGendv)(GLenum coord, GLenum pname, GLdouble *params)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[278];
+ ((void (APIENTRY *)(GLenum coord, GLenum pname, GLdouble *params)) _func)(coord, pname, params);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(GetTexGenfv)(GLenum coord, GLenum pname, GLfloat *params)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[279];
+ ((void (APIENTRY *)(GLenum coord, GLenum pname, GLfloat *params)) _func)(coord, pname, params);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(GetTexGeniv)(GLenum coord, GLenum pname, GLint *params)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[280];
+ ((void (APIENTRY *)(GLenum coord, GLenum pname, GLint *params)) _func)(coord, pname, params);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(GetTexImage)(GLenum target, GLint level, GLenum format, GLenum type, GLvoid *pixels)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[281];
+ ((void (APIENTRY *)(GLenum target, GLint level, GLenum format, GLenum type, GLvoid *pixels)) _func)(target, level, format, type, pixels);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(GetTexParameterfv)(GLenum target, GLenum pname, GLfloat *params)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[282];
+ ((void (APIENTRY *)(GLenum target, GLenum pname, GLfloat *params)) _func)(target, pname, params);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(GetTexParameteriv)(GLenum target, GLenum pname, GLint *params)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[283];
+ ((void (APIENTRY *)(GLenum target, GLenum pname, GLint *params)) _func)(target, pname, params);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(GetTexLevelParameterfv)(GLenum target, GLint level, GLenum pname, GLfloat *params)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[284];
+ ((void (APIENTRY *)(GLenum target, GLint level, GLenum pname, GLfloat *params)) _func)(target, level, pname, params);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(GetTexLevelParameteriv)(GLenum target, GLint level, GLenum pname, GLint *params)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[285];
+ ((void (APIENTRY *)(GLenum target, GLint level, GLenum pname, GLint *params)) _func)(target, level, pname, params);
+}
+
+GLAPI GLboolean APIENTRY GLAPI_PREFIX(IsEnabled)(GLenum cap)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[286];
+ return ((GLboolean (APIENTRY *)(GLenum cap)) _func)(cap);
+}
+
+GLAPI GLboolean APIENTRY GLAPI_PREFIX(IsList)(GLuint list)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[287];
+ return ((GLboolean (APIENTRY *)(GLuint list)) _func)(list);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(DepthRange)(GLclampd zNear, GLclampd zFar)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[288];
+ ((void (APIENTRY *)(GLclampd zNear, GLclampd zFar)) _func)(zNear, zFar);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(Frustum)(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[289];
+ ((void (APIENTRY *)(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar)) _func)(left, right, bottom, top, zNear, zFar);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(LoadIdentity)(void)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[290];
+ ((void (APIENTRY *)(void)) _func)();
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(LoadMatrixf)(const GLfloat *m)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[291];
+ ((void (APIENTRY *)(const GLfloat *m)) _func)(m);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(LoadMatrixd)(const GLdouble *m)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[292];
+ ((void (APIENTRY *)(const GLdouble *m)) _func)(m);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(MatrixMode)(GLenum mode)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[293];
+ ((void (APIENTRY *)(GLenum mode)) _func)(mode);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(MultMatrixf)(const GLfloat *m)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[294];
+ ((void (APIENTRY *)(const GLfloat *m)) _func)(m);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(MultMatrixd)(const GLdouble *m)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[295];
+ ((void (APIENTRY *)(const GLdouble *m)) _func)(m);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(Ortho)(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[296];
+ ((void (APIENTRY *)(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar)) _func)(left, right, bottom, top, zNear, zFar);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(PopMatrix)(void)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[297];
+ ((void (APIENTRY *)(void)) _func)();
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(PushMatrix)(void)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[298];
+ ((void (APIENTRY *)(void)) _func)();
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(Rotated)(GLdouble angle, GLdouble x, GLdouble y, GLdouble z)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[299];
+ ((void (APIENTRY *)(GLdouble angle, GLdouble x, GLdouble y, GLdouble z)) _func)(angle, x, y, z);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(Rotatef)(GLfloat angle, GLfloat x, GLfloat y, GLfloat z)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[300];
+ ((void (APIENTRY *)(GLfloat angle, GLfloat x, GLfloat y, GLfloat z)) _func)(angle, x, y, z);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(Scaled)(GLdouble x, GLdouble y, GLdouble z)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[301];
+ ((void (APIENTRY *)(GLdouble x, GLdouble y, GLdouble z)) _func)(x, y, z);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(Scalef)(GLfloat x, GLfloat y, GLfloat z)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[302];
+ ((void (APIENTRY *)(GLfloat x, GLfloat y, GLfloat z)) _func)(x, y, z);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(Translated)(GLdouble x, GLdouble y, GLdouble z)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[303];
+ ((void (APIENTRY *)(GLdouble x, GLdouble y, GLdouble z)) _func)(x, y, z);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(Translatef)(GLfloat x, GLfloat y, GLfloat z)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[304];
+ ((void (APIENTRY *)(GLfloat x, GLfloat y, GLfloat z)) _func)(x, y, z);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(Viewport)(GLint x, GLint y, GLsizei width, GLsizei height)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[305];
+ ((void (APIENTRY *)(GLint x, GLint y, GLsizei width, GLsizei height)) _func)(x, y, width, height);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(ArrayElement)(GLint i)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[306];
+ ((void (APIENTRY *)(GLint i)) _func)(i);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(ArrayElementEXT)(GLint i)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[306];
+ ((void (APIENTRY *)(GLint i)) _func)(i);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(BindTexture)(GLenum target, GLuint texture)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[307];
+ ((void (APIENTRY *)(GLenum target, GLuint texture)) _func)(target, texture);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(BindTextureEXT)(GLenum target, GLuint texture)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[307];
+ ((void (APIENTRY *)(GLenum target, GLuint texture)) _func)(target, texture);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(ColorPointer)(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[308];
+ ((void (APIENTRY *)(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer)) _func)(size, type, stride, pointer);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(DisableClientState)(GLenum array)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[309];
+ ((void (APIENTRY *)(GLenum array)) _func)(array);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(DrawArrays)(GLenum mode, GLint first, GLsizei count)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[310];
+ ((void (APIENTRY *)(GLenum mode, GLint first, GLsizei count)) _func)(mode, first, count);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(DrawArraysEXT)(GLenum mode, GLint first, GLsizei count)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[310];
+ ((void (APIENTRY *)(GLenum mode, GLint first, GLsizei count)) _func)(mode, first, count);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(DrawElements)(GLenum mode, GLsizei count, GLenum type, const GLvoid *indices)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[311];
+ ((void (APIENTRY *)(GLenum mode, GLsizei count, GLenum type, const GLvoid *indices)) _func)(mode, count, type, indices);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(EdgeFlagPointer)(GLsizei stride, const GLvoid *pointer)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[312];
+ ((void (APIENTRY *)(GLsizei stride, const GLvoid *pointer)) _func)(stride, pointer);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(EnableClientState)(GLenum array)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[313];
+ ((void (APIENTRY *)(GLenum array)) _func)(array);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(IndexPointer)(GLenum type, GLsizei stride, const GLvoid *pointer)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[314];
+ ((void (APIENTRY *)(GLenum type, GLsizei stride, const GLvoid *pointer)) _func)(type, stride, pointer);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(Indexub)(GLubyte c)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[315];
+ ((void (APIENTRY *)(GLubyte c)) _func)(c);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(Indexubv)(const GLubyte *c)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[316];
+ ((void (APIENTRY *)(const GLubyte *c)) _func)(c);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(InterleavedArrays)(GLenum format, GLsizei stride, const GLvoid *pointer)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[317];
+ ((void (APIENTRY *)(GLenum format, GLsizei stride, const GLvoid *pointer)) _func)(format, stride, pointer);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(NormalPointer)(GLenum type, GLsizei stride, const GLvoid *pointer)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[318];
+ ((void (APIENTRY *)(GLenum type, GLsizei stride, const GLvoid *pointer)) _func)(type, stride, pointer);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(PolygonOffset)(GLfloat factor, GLfloat units)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[319];
+ ((void (APIENTRY *)(GLfloat factor, GLfloat units)) _func)(factor, units);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(TexCoordPointer)(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[320];
+ ((void (APIENTRY *)(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer)) _func)(size, type, stride, pointer);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(VertexPointer)(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[321];
+ ((void (APIENTRY *)(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer)) _func)(size, type, stride, pointer);
+}
+
+GLAPI GLboolean APIENTRY GLAPI_PREFIX(AreTexturesResident)(GLsizei n, const GLuint *textures, GLboolean *residences)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[322];
+ return ((GLboolean (APIENTRY *)(GLsizei n, const GLuint *textures, GLboolean *residences)) _func)(n, textures, residences);
+}
+
+#if 0
+GLAPI GLboolean APIENTRY GLAPI_PREFIX(AreTexturesResidentEXT)(GLsizei n, const GLuint *textures, GLboolean *residences)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[322];
+ return ((GLboolean (APIENTRY *)(GLsizei n, const GLuint *textures, GLboolean *residences)) _func)(n, textures, residences);
+}
+#endif
+
+GLAPI void APIENTRY GLAPI_PREFIX(CopyTexImage1D)(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[323];
+ ((void (APIENTRY *)(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border)) _func)(target, level, internalformat, x, y, width, border);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(CopyTexImage1DEXT)(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[323];
+ ((void (APIENTRY *)(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border)) _func)(target, level, internalformat, x, y, width, border);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(CopyTexImage2D)(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[324];
+ ((void (APIENTRY *)(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border)) _func)(target, level, internalformat, x, y, width, height, border);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(CopyTexImage2DEXT)(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[324];
+ ((void (APIENTRY *)(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border)) _func)(target, level, internalformat, x, y, width, height, border);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(CopyTexSubImage1D)(GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[325];
+ ((void (APIENTRY *)(GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width)) _func)(target, level, xoffset, x, y, width);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(CopyTexSubImage1DEXT)(GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[325];
+ ((void (APIENTRY *)(GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width)) _func)(target, level, xoffset, x, y, width);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(CopyTexSubImage2D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[326];
+ ((void (APIENTRY *)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height)) _func)(target, level, xoffset, yoffset, x, y, width, height);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(CopyTexSubImage2DEXT)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[326];
+ ((void (APIENTRY *)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height)) _func)(target, level, xoffset, yoffset, x, y, width, height);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(DeleteTextures)(GLsizei n, const GLuint *textures)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[327];
+ ((void (APIENTRY *)(GLsizei n, const GLuint *textures)) _func)(n, textures);
+}
+
+#if 0
+GLAPI void APIENTRY GLAPI_PREFIX(DeleteTexturesEXT)(GLsizei n, const GLuint *textures)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[327];
+ ((void (APIENTRY *)(GLsizei n, const GLuint *textures)) _func)(n, textures);
+}
+#endif
+
+GLAPI void APIENTRY GLAPI_PREFIX(GenTextures)(GLsizei n, GLuint *textures)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[328];
+ ((void (APIENTRY *)(GLsizei n, GLuint *textures)) _func)(n, textures);
+}
+
+#if 0
+GLAPI void APIENTRY GLAPI_PREFIX(GenTexturesEXT)(GLsizei n, GLuint *textures)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[328];
+ ((void (APIENTRY *)(GLsizei n, GLuint *textures)) _func)(n, textures);
+}
+#endif
+
+GLAPI void APIENTRY GLAPI_PREFIX(GetPointerv)(GLenum pname, GLvoid **params)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[329];
+ ((void (APIENTRY *)(GLenum pname, GLvoid **params)) _func)(pname, params);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(GetPointervEXT)(GLenum pname, GLvoid **params)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[329];
+ ((void (APIENTRY *)(GLenum pname, GLvoid **params)) _func)(pname, params);
+}
+
+GLAPI GLboolean APIENTRY GLAPI_PREFIX(IsTexture)(GLuint texture)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[330];
+ return ((GLboolean (APIENTRY *)(GLuint texture)) _func)(texture);
+}
+
+#if 0
+GLAPI GLboolean APIENTRY GLAPI_PREFIX(IsTextureEXT)(GLuint texture)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[330];
+ return ((GLboolean (APIENTRY *)(GLuint texture)) _func)(texture);
+}
+#endif
+
+GLAPI void APIENTRY GLAPI_PREFIX(PrioritizeTextures)(GLsizei n, const GLuint *textures, const GLclampf *priorities)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[331];
+ ((void (APIENTRY *)(GLsizei n, const GLuint *textures, const GLclampf *priorities)) _func)(n, textures, priorities);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(PrioritizeTexturesEXT)(GLsizei n, const GLuint *textures, const GLclampf *priorities)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[331];
+ ((void (APIENTRY *)(GLsizei n, const GLuint *textures, const GLclampf *priorities)) _func)(n, textures, priorities);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(TexSubImage1D)(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[332];
+ ((void (APIENTRY *)(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels)) _func)(target, level, xoffset, width, format, type, pixels);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(TexSubImage1DEXT)(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[332];
+ ((void (APIENTRY *)(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels)) _func)(target, level, xoffset, width, format, type, pixels);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(TexSubImage2D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[333];
+ ((void (APIENTRY *)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels)) _func)(target, level, xoffset, yoffset, width, height, format, type, pixels);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(TexSubImage2DEXT)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[333];
+ ((void (APIENTRY *)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels)) _func)(target, level, xoffset, yoffset, width, height, format, type, pixels);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(PopClientAttrib)(void)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[334];
+ ((void (APIENTRY *)(void)) _func)();
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(PushClientAttrib)(GLbitfield mask)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[335];
+ ((void (APIENTRY *)(GLbitfield mask)) _func)(mask);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(BlendColor)(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[336];
+ ((void (APIENTRY *)(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha)) _func)(red, green, blue, alpha);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(BlendColorEXT)(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[336];
+ ((void (APIENTRY *)(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha)) _func)(red, green, blue, alpha);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(BlendEquation)(GLenum mode)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[337];
+ ((void (APIENTRY *)(GLenum mode)) _func)(mode);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(BlendEquationEXT)(GLenum mode)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[337];
+ ((void (APIENTRY *)(GLenum mode)) _func)(mode);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(DrawRangeElements)(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[338];
+ ((void (APIENTRY *)(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices)) _func)(mode, start, end, count, type, indices);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(DrawRangeElementsEXT)(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[338];
+ ((void (APIENTRY *)(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices)) _func)(mode, start, end, count, type, indices);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(ColorTable)(GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[339];
+ ((void (APIENTRY *)(GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table)) _func)(target, internalformat, width, format, type, table);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(ColorTableEXT)(GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[339];
+ ((void (APIENTRY *)(GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table)) _func)(target, internalformat, width, format, type, table);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(ColorTableParameterfv)(GLenum target, GLenum pname, const GLfloat *params)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[340];
+ ((void (APIENTRY *)(GLenum target, GLenum pname, const GLfloat *params)) _func)(target, pname, params);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(ColorTableParameteriv)(GLenum target, GLenum pname, const GLint *params)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[341];
+ ((void (APIENTRY *)(GLenum target, GLenum pname, const GLint *params)) _func)(target, pname, params);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(CopyColorTable)(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[342];
+ ((void (APIENTRY *)(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width)) _func)(target, internalformat, x, y, width);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(GetColorTable)(GLenum target, GLenum format, GLenum type, GLvoid *table)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[343];
+ ((void (APIENTRY *)(GLenum target, GLenum format, GLenum type, GLvoid *table)) _func)(target, format, type, table);
+}
+
+#if 0
+GLAPI void APIENTRY GLAPI_PREFIX(GetColorTableEXT)(GLenum target, GLenum format, GLenum type, GLvoid *table)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[343];
+ ((void (APIENTRY *)(GLenum target, GLenum format, GLenum type, GLvoid *table)) _func)(target, format, type, table);
+}
+#endif
+
+GLAPI void APIENTRY GLAPI_PREFIX(GetColorTableParameterfv)(GLenum target, GLenum pname, GLfloat *params)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[344];
+ ((void (APIENTRY *)(GLenum target, GLenum pname, GLfloat *params)) _func)(target, pname, params);
+}
+
+#if 0
+GLAPI void APIENTRY GLAPI_PREFIX(GetColorTableParameterfvEXT)(GLenum target, GLenum pname, GLfloat *params)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[344];
+ ((void (APIENTRY *)(GLenum target, GLenum pname, GLfloat *params)) _func)(target, pname, params);
+}
+#endif
+
+GLAPI void APIENTRY GLAPI_PREFIX(GetColorTableParameteriv)(GLenum target, GLenum pname, GLint *params)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[345];
+ ((void (APIENTRY *)(GLenum target, GLenum pname, GLint *params)) _func)(target, pname, params);
+}
+
+#if 0
+GLAPI void APIENTRY GLAPI_PREFIX(GetColorTableParameterivEXT)(GLenum target, GLenum pname, GLint *params)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[345];
+ ((void (APIENTRY *)(GLenum target, GLenum pname, GLint *params)) _func)(target, pname, params);
+}
+#endif
+
+GLAPI void APIENTRY GLAPI_PREFIX(ColorSubTable)(GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *data)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[346];
+ ((void (APIENTRY *)(GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *data)) _func)(target, start, count, format, type, data);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(CopyColorSubTable)(GLenum target, GLsizei start, GLint x, GLint y, GLsizei width)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[347];
+ ((void (APIENTRY *)(GLenum target, GLsizei start, GLint x, GLint y, GLsizei width)) _func)(target, start, x, y, width);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(ConvolutionFilter1D)(GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *image)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[348];
+ ((void (APIENTRY *)(GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *image)) _func)(target, internalformat, width, format, type, image);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(ConvolutionFilter2D)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *image)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[349];
+ ((void (APIENTRY *)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *image)) _func)(target, internalformat, width, height, format, type, image);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(ConvolutionParameterf)(GLenum target, GLenum pname, GLfloat params)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[350];
+ ((void (APIENTRY *)(GLenum target, GLenum pname, GLfloat params)) _func)(target, pname, params);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(ConvolutionParameterfv)(GLenum target, GLenum pname, const GLfloat *params)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[351];
+ ((void (APIENTRY *)(GLenum target, GLenum pname, const GLfloat *params)) _func)(target, pname, params);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(ConvolutionParameteri)(GLenum target, GLenum pname, GLint params)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[352];
+ ((void (APIENTRY *)(GLenum target, GLenum pname, GLint params)) _func)(target, pname, params);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(ConvolutionParameteriv)(GLenum target, GLenum pname, const GLint *params)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[353];
+ ((void (APIENTRY *)(GLenum target, GLenum pname, const GLint *params)) _func)(target, pname, params);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(CopyConvolutionFilter1D)(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[354];
+ ((void (APIENTRY *)(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width)) _func)(target, internalformat, x, y, width);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(CopyConvolutionFilter2D)(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[355];
+ ((void (APIENTRY *)(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height)) _func)(target, internalformat, x, y, width, height);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(GetConvolutionFilter)(GLenum target, GLenum format, GLenum type, GLvoid *image)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[356];
+ ((void (APIENTRY *)(GLenum target, GLenum format, GLenum type, GLvoid *image)) _func)(target, format, type, image);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(GetConvolutionParameterfv)(GLenum target, GLenum pname, GLfloat *params)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[357];
+ ((void (APIENTRY *)(GLenum target, GLenum pname, GLfloat *params)) _func)(target, pname, params);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(GetConvolutionParameteriv)(GLenum target, GLenum pname, GLint *params)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[358];
+ ((void (APIENTRY *)(GLenum target, GLenum pname, GLint *params)) _func)(target, pname, params);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(GetSeparableFilter)(GLenum target, GLenum format, GLenum type, GLvoid *row, GLvoid *column, GLvoid *span)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[359];
+ ((void (APIENTRY *)(GLenum target, GLenum format, GLenum type, GLvoid *row, GLvoid *column, GLvoid *span)) _func)(target, format, type, row, column, span);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(SeparableFilter2D)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *row, const GLvoid *column)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[360];
+ ((void (APIENTRY *)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *row, const GLvoid *column)) _func)(target, internalformat, width, height, format, type, row, column);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(GetHistogram)(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[361];
+ ((void (APIENTRY *)(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values)) _func)(target, reset, format, type, values);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(GetHistogramParameterfv)(GLenum target, GLenum pname, GLfloat *params)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[362];
+ ((void (APIENTRY *)(GLenum target, GLenum pname, GLfloat *params)) _func)(target, pname, params);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(GetHistogramParameteriv)(GLenum target, GLenum pname, GLint *params)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[363];
+ ((void (APIENTRY *)(GLenum target, GLenum pname, GLint *params)) _func)(target, pname, params);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(GetMinmax)(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[364];
+ ((void (APIENTRY *)(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values)) _func)(target, reset, format, type, values);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(GetMinmaxParameterfv)(GLenum target, GLenum pname, GLfloat *params)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[365];
+ ((void (APIENTRY *)(GLenum target, GLenum pname, GLfloat *params)) _func)(target, pname, params);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(GetMinmaxParameteriv)(GLenum target, GLenum pname, GLint *params)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[366];
+ ((void (APIENTRY *)(GLenum target, GLenum pname, GLint *params)) _func)(target, pname, params);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(Histogram)(GLenum target, GLsizei width, GLenum internalformat, GLboolean sink)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[367];
+ ((void (APIENTRY *)(GLenum target, GLsizei width, GLenum internalformat, GLboolean sink)) _func)(target, width, internalformat, sink);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(Minmax)(GLenum target, GLenum internalformat, GLboolean sink)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[368];
+ ((void (APIENTRY *)(GLenum target, GLenum internalformat, GLboolean sink)) _func)(target, internalformat, sink);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(ResetHistogram)(GLenum target)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[369];
+ ((void (APIENTRY *)(GLenum target)) _func)(target);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(ResetMinmax)(GLenum target)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[370];
+ ((void (APIENTRY *)(GLenum target)) _func)(target);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(TexImage3D)(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[371];
+ ((void (APIENTRY *)(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels)) _func)(target, level, internalformat, width, height, depth, border, format, type, pixels);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(TexImage3DEXT)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[371];
+ ((void (APIENTRY *)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels)) _func)(target, level, internalformat, width, height, depth, border, format, type, pixels);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(TexSubImage3D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[372];
+ ((void (APIENTRY *)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels)) _func)(target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(TexSubImage3DEXT)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[372];
+ ((void (APIENTRY *)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels)) _func)(target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(CopyTexSubImage3D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[373];
+ ((void (APIENTRY *)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height)) _func)(target, level, xoffset, yoffset, zoffset, x, y, width, height);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(CopyTexSubImage3DEXT)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[373];
+ ((void (APIENTRY *)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height)) _func)(target, level, xoffset, yoffset, zoffset, x, y, width, height);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(ActiveTextureARB)(GLenum texture)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[374];
+ ((void (APIENTRY *)(GLenum texture)) _func)(texture);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(ActiveTexture)(GLenum texture)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[374];
+ ((void (APIENTRY *)(GLenum texture)) _func)(texture);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(ClientActiveTextureARB)(GLenum texture)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[375];
+ ((void (APIENTRY *)(GLenum texture)) _func)(texture);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(ClientActiveTexture)(GLenum texture)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[375];
+ ((void (APIENTRY *)(GLenum texture)) _func)(texture);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord1dARB)(GLenum target, GLdouble s)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[376];
+ ((void (APIENTRY *)(GLenum target, GLdouble s)) _func)(target, s);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord1d)(GLenum target, GLdouble s)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[376];
+ ((void (APIENTRY *)(GLenum target, GLdouble s)) _func)(target, s);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord1dvARB)(GLenum target, const GLdouble *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[377];
+ ((void (APIENTRY *)(GLenum target, const GLdouble *v)) _func)(target, v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord1dv)(GLenum target, const GLdouble *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[377];
+ ((void (APIENTRY *)(GLenum target, const GLdouble *v)) _func)(target, v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord1fARB)(GLenum target, GLfloat s)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[378];
+ ((void (APIENTRY *)(GLenum target, GLfloat s)) _func)(target, s);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord1f)(GLenum target, GLfloat s)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[378];
+ ((void (APIENTRY *)(GLenum target, GLfloat s)) _func)(target, s);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord1fvARB)(GLenum target, const GLfloat *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[379];
+ ((void (APIENTRY *)(GLenum target, const GLfloat *v)) _func)(target, v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord1fv)(GLenum target, const GLfloat *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[379];
+ ((void (APIENTRY *)(GLenum target, const GLfloat *v)) _func)(target, v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord1iARB)(GLenum target, GLint s)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[380];
+ ((void (APIENTRY *)(GLenum target, GLint s)) _func)(target, s);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord1i)(GLenum target, GLint s)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[380];
+ ((void (APIENTRY *)(GLenum target, GLint s)) _func)(target, s);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord1ivARB)(GLenum target, const GLint *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[381];
+ ((void (APIENTRY *)(GLenum target, const GLint *v)) _func)(target, v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord1iv)(GLenum target, const GLint *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[381];
+ ((void (APIENTRY *)(GLenum target, const GLint *v)) _func)(target, v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord1sARB)(GLenum target, GLshort s)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[382];
+ ((void (APIENTRY *)(GLenum target, GLshort s)) _func)(target, s);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord1s)(GLenum target, GLshort s)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[382];
+ ((void (APIENTRY *)(GLenum target, GLshort s)) _func)(target, s);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord1svARB)(GLenum target, const GLshort *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[383];
+ ((void (APIENTRY *)(GLenum target, const GLshort *v)) _func)(target, v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord1sv)(GLenum target, const GLshort *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[383];
+ ((void (APIENTRY *)(GLenum target, const GLshort *v)) _func)(target, v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord2dARB)(GLenum target, GLdouble s, GLdouble t)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[384];
+ ((void (APIENTRY *)(GLenum target, GLdouble s, GLdouble t)) _func)(target, s, t);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord2d)(GLenum target, GLdouble s, GLdouble t)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[384];
+ ((void (APIENTRY *)(GLenum target, GLdouble s, GLdouble t)) _func)(target, s, t);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord2dvARB)(GLenum target, const GLdouble *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[385];
+ ((void (APIENTRY *)(GLenum target, const GLdouble *v)) _func)(target, v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord2dv)(GLenum target, const GLdouble *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[385];
+ ((void (APIENTRY *)(GLenum target, const GLdouble *v)) _func)(target, v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord2fARB)(GLenum target, GLfloat s, GLfloat t)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[386];
+ ((void (APIENTRY *)(GLenum target, GLfloat s, GLfloat t)) _func)(target, s, t);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord2f)(GLenum target, GLfloat s, GLfloat t)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[386];
+ ((void (APIENTRY *)(GLenum target, GLfloat s, GLfloat t)) _func)(target, s, t);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord2fvARB)(GLenum target, const GLfloat *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[387];
+ ((void (APIENTRY *)(GLenum target, const GLfloat *v)) _func)(target, v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord2fv)(GLenum target, const GLfloat *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[387];
+ ((void (APIENTRY *)(GLenum target, const GLfloat *v)) _func)(target, v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord2iARB)(GLenum target, GLint s, GLint t)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[388];
+ ((void (APIENTRY *)(GLenum target, GLint s, GLint t)) _func)(target, s, t);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord2i)(GLenum target, GLint s, GLint t)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[388];
+ ((void (APIENTRY *)(GLenum target, GLint s, GLint t)) _func)(target, s, t);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord2ivARB)(GLenum target, const GLint *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[389];
+ ((void (APIENTRY *)(GLenum target, const GLint *v)) _func)(target, v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord2iv)(GLenum target, const GLint *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[389];
+ ((void (APIENTRY *)(GLenum target, const GLint *v)) _func)(target, v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord2sARB)(GLenum target, GLshort s, GLshort t)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[390];
+ ((void (APIENTRY *)(GLenum target, GLshort s, GLshort t)) _func)(target, s, t);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord2s)(GLenum target, GLshort s, GLshort t)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[390];
+ ((void (APIENTRY *)(GLenum target, GLshort s, GLshort t)) _func)(target, s, t);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord2svARB)(GLenum target, const GLshort *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[391];
+ ((void (APIENTRY *)(GLenum target, const GLshort *v)) _func)(target, v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord2sv)(GLenum target, const GLshort *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[391];
+ ((void (APIENTRY *)(GLenum target, const GLshort *v)) _func)(target, v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord3dARB)(GLenum target, GLdouble s, GLdouble t, GLdouble r)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[392];
+ ((void (APIENTRY *)(GLenum target, GLdouble s, GLdouble t, GLdouble r)) _func)(target, s, t, r);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord3d)(GLenum target, GLdouble s, GLdouble t, GLdouble r)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[392];
+ ((void (APIENTRY *)(GLenum target, GLdouble s, GLdouble t, GLdouble r)) _func)(target, s, t, r);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord3dvARB)(GLenum target, const GLdouble *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[393];
+ ((void (APIENTRY *)(GLenum target, const GLdouble *v)) _func)(target, v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord3dv)(GLenum target, const GLdouble *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[393];
+ ((void (APIENTRY *)(GLenum target, const GLdouble *v)) _func)(target, v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord3fARB)(GLenum target, GLfloat s, GLfloat t, GLfloat r)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[394];
+ ((void (APIENTRY *)(GLenum target, GLfloat s, GLfloat t, GLfloat r)) _func)(target, s, t, r);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord3f)(GLenum target, GLfloat s, GLfloat t, GLfloat r)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[394];
+ ((void (APIENTRY *)(GLenum target, GLfloat s, GLfloat t, GLfloat r)) _func)(target, s, t, r);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord3fvARB)(GLenum target, const GLfloat *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[395];
+ ((void (APIENTRY *)(GLenum target, const GLfloat *v)) _func)(target, v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord3fv)(GLenum target, const GLfloat *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[395];
+ ((void (APIENTRY *)(GLenum target, const GLfloat *v)) _func)(target, v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord3iARB)(GLenum target, GLint s, GLint t, GLint r)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[396];
+ ((void (APIENTRY *)(GLenum target, GLint s, GLint t, GLint r)) _func)(target, s, t, r);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord3i)(GLenum target, GLint s, GLint t, GLint r)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[396];
+ ((void (APIENTRY *)(GLenum target, GLint s, GLint t, GLint r)) _func)(target, s, t, r);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord3ivARB)(GLenum target, const GLint *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[397];
+ ((void (APIENTRY *)(GLenum target, const GLint *v)) _func)(target, v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord3iv)(GLenum target, const GLint *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[397];
+ ((void (APIENTRY *)(GLenum target, const GLint *v)) _func)(target, v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord3sARB)(GLenum target, GLshort s, GLshort t, GLshort r)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[398];
+ ((void (APIENTRY *)(GLenum target, GLshort s, GLshort t, GLshort r)) _func)(target, s, t, r);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord3s)(GLenum target, GLshort s, GLshort t, GLshort r)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[398];
+ ((void (APIENTRY *)(GLenum target, GLshort s, GLshort t, GLshort r)) _func)(target, s, t, r);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord3svARB)(GLenum target, const GLshort *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[399];
+ ((void (APIENTRY *)(GLenum target, const GLshort *v)) _func)(target, v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord3sv)(GLenum target, const GLshort *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[399];
+ ((void (APIENTRY *)(GLenum target, const GLshort *v)) _func)(target, v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord4dARB)(GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[400];
+ ((void (APIENTRY *)(GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q)) _func)(target, s, t, r, q);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord4d)(GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[400];
+ ((void (APIENTRY *)(GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q)) _func)(target, s, t, r, q);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord4dvARB)(GLenum target, const GLdouble *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[401];
+ ((void (APIENTRY *)(GLenum target, const GLdouble *v)) _func)(target, v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord4dv)(GLenum target, const GLdouble *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[401];
+ ((void (APIENTRY *)(GLenum target, const GLdouble *v)) _func)(target, v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord4fARB)(GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[402];
+ ((void (APIENTRY *)(GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q)) _func)(target, s, t, r, q);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord4f)(GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[402];
+ ((void (APIENTRY *)(GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q)) _func)(target, s, t, r, q);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord4fvARB)(GLenum target, const GLfloat *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[403];
+ ((void (APIENTRY *)(GLenum target, const GLfloat *v)) _func)(target, v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord4fv)(GLenum target, const GLfloat *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[403];
+ ((void (APIENTRY *)(GLenum target, const GLfloat *v)) _func)(target, v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord4iARB)(GLenum target, GLint s, GLint t, GLint r, GLint q)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[404];
+ ((void (APIENTRY *)(GLenum target, GLint s, GLint t, GLint r, GLint q)) _func)(target, s, t, r, q);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord4i)(GLenum target, GLint s, GLint t, GLint r, GLint q)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[404];
+ ((void (APIENTRY *)(GLenum target, GLint s, GLint t, GLint r, GLint q)) _func)(target, s, t, r, q);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord4ivARB)(GLenum target, const GLint *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[405];
+ ((void (APIENTRY *)(GLenum target, const GLint *v)) _func)(target, v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord4iv)(GLenum target, const GLint *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[405];
+ ((void (APIENTRY *)(GLenum target, const GLint *v)) _func)(target, v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord4sARB)(GLenum target, GLshort s, GLshort t, GLshort r, GLshort q)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[406];
+ ((void (APIENTRY *)(GLenum target, GLshort s, GLshort t, GLshort r, GLshort q)) _func)(target, s, t, r, q);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord4s)(GLenum target, GLshort s, GLshort t, GLshort r, GLshort q)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[406];
+ ((void (APIENTRY *)(GLenum target, GLshort s, GLshort t, GLshort r, GLshort q)) _func)(target, s, t, r, q);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord4svARB)(GLenum target, const GLshort *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[407];
+ ((void (APIENTRY *)(GLenum target, const GLshort *v)) _func)(target, v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(MultiTexCoord4sv)(GLenum target, const GLshort *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[407];
+ ((void (APIENTRY *)(GLenum target, const GLshort *v)) _func)(target, v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(AttachShader)(GLuint program, GLuint shader)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[408];
+ ((void (APIENTRY *)(GLuint program, GLuint shader)) _func)(program, shader);
+}
+
+GLAPI GLuint APIENTRY GLAPI_PREFIX(CreateProgram)(void)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[409];
+ return ((GLuint (APIENTRY *)(void)) _func)();
+}
+
+GLAPI GLuint APIENTRY GLAPI_PREFIX(CreateShader)(GLenum type)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[410];
+ return ((GLuint (APIENTRY *)(GLenum type)) _func)(type);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(DeleteProgram)(GLuint program)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[411];
+ ((void (APIENTRY *)(GLuint program)) _func)(program);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(DeleteShader)(GLuint program)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[412];
+ ((void (APIENTRY *)(GLuint program)) _func)(program);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(DetachShader)(GLuint program, GLuint shader)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[413];
+ ((void (APIENTRY *)(GLuint program, GLuint shader)) _func)(program, shader);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(GetAttachedShaders)(GLuint program, GLsizei maxCount, GLsizei *count, GLuint *obj)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[414];
+ ((void (APIENTRY *)(GLuint program, GLsizei maxCount, GLsizei *count, GLuint *obj)) _func)(program, maxCount, count, obj);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(GetProgramInfoLog)(GLuint program, GLsizei bufSize, GLsizei *length, GLchar *infoLog)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[415];
+ ((void (APIENTRY *)(GLuint program, GLsizei bufSize, GLsizei *length, GLchar *infoLog)) _func)(program, bufSize, length, infoLog);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(GetProgramiv)(GLuint program, GLenum pname, GLint *params)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[416];
+ ((void (APIENTRY *)(GLuint program, GLenum pname, GLint *params)) _func)(program, pname, params);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(GetShaderInfoLog)(GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *infoLog)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[417];
+ ((void (APIENTRY *)(GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *infoLog)) _func)(shader, bufSize, length, infoLog);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(GetShaderiv)(GLuint shader, GLenum pname, GLint *params)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[418];
+ ((void (APIENTRY *)(GLuint shader, GLenum pname, GLint *params)) _func)(shader, pname, params);
+}
+
+GLAPI GLboolean APIENTRY GLAPI_PREFIX(IsProgram)(GLuint program)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[419];
+ return ((GLboolean (APIENTRY *)(GLuint program)) _func)(program);
+}
+
+GLAPI GLboolean APIENTRY GLAPI_PREFIX(IsShader)(GLuint shader)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[420];
+ return ((GLboolean (APIENTRY *)(GLuint shader)) _func)(shader);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(StencilFuncSeparate)(GLenum face, GLenum func, GLint ref, GLuint mask)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[421];
+ ((void (APIENTRY *)(GLenum face, GLenum func, GLint ref, GLuint mask)) _func)(face, func, ref, mask);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(StencilMaskSeparate)(GLenum face, GLuint mask)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[422];
+ ((void (APIENTRY *)(GLenum face, GLuint mask)) _func)(face, mask);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(StencilOpSeparate)(GLenum face, GLenum sfail, GLenum zfail, GLenum zpass)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[423];
+ ((void (APIENTRY *)(GLenum face, GLenum sfail, GLenum zfail, GLenum zpass)) _func)(face, sfail, zfail, zpass);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(UniformMatrix2x3fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[424];
+ ((void (APIENTRY *)(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)) _func)(location, count, transpose, value);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(UniformMatrix2x4fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[425];
+ ((void (APIENTRY *)(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)) _func)(location, count, transpose, value);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(UniformMatrix3x2fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[426];
+ ((void (APIENTRY *)(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)) _func)(location, count, transpose, value);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(UniformMatrix3x4fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[427];
+ ((void (APIENTRY *)(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)) _func)(location, count, transpose, value);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(UniformMatrix4x2fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[428];
+ ((void (APIENTRY *)(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)) _func)(location, count, transpose, value);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(UniformMatrix4x3fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[429];
+ ((void (APIENTRY *)(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)) _func)(location, count, transpose, value);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(ClampColor)(GLenum target, GLenum clamp)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[430];
+ ((void (APIENTRY *)(GLenum target, GLenum clamp)) _func)(target, clamp);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(ClearBufferfi)(GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[431];
+ ((void (APIENTRY *)(GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil)) _func)(buffer, drawbuffer, depth, stencil);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(ClearBufferfv)(GLenum buffer, GLint drawbuffer, const GLfloat *value)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[432];
+ ((void (APIENTRY *)(GLenum buffer, GLint drawbuffer, const GLfloat *value)) _func)(buffer, drawbuffer, value);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(ClearBufferiv)(GLenum buffer, GLint drawbuffer, const GLint *value)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[433];
+ ((void (APIENTRY *)(GLenum buffer, GLint drawbuffer, const GLint *value)) _func)(buffer, drawbuffer, value);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(ClearBufferuiv)(GLenum buffer, GLint drawbuffer, const GLuint *value)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[434];
+ ((void (APIENTRY *)(GLenum buffer, GLint drawbuffer, const GLuint *value)) _func)(buffer, drawbuffer, value);
+}
+
+GLAPI const GLubyte * APIENTRY GLAPI_PREFIX(GetStringi)(GLenum name, GLuint index)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[435];
+ return ((const GLubyte * (APIENTRY *)(GLenum name, GLuint index)) _func)(name, index);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(TexBuffer)(GLenum target, GLenum internalFormat, GLuint buffer)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[436];
+ ((void (APIENTRY *)(GLenum target, GLenum internalFormat, GLuint buffer)) _func)(target, internalFormat, buffer);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(FramebufferTexture)(GLenum target, GLenum attachment, GLuint texture, GLint level)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[437];
+ ((void (APIENTRY *)(GLenum target, GLenum attachment, GLuint texture, GLint level)) _func)(target, attachment, texture, level);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(GetBufferParameteri64v)(GLenum target, GLenum pname, GLint64 *params)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[438];
+ ((void (APIENTRY *)(GLenum target, GLenum pname, GLint64 *params)) _func)(target, pname, params);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(GetInteger64i_v)(GLenum cap, GLuint index, GLint64 *data)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[439];
+ ((void (APIENTRY *)(GLenum cap, GLuint index, GLint64 *data)) _func)(cap, index, data);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribDivisor)(GLuint index, GLuint divisor)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[440];
+ ((void (APIENTRY *)(GLuint index, GLuint divisor)) _func)(index, divisor);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(LoadTransposeMatrixdARB)(const GLdouble *m)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[441];
+ ((void (APIENTRY *)(const GLdouble *m)) _func)(m);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(LoadTransposeMatrixd)(const GLdouble *m)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[441];
+ ((void (APIENTRY *)(const GLdouble *m)) _func)(m);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(LoadTransposeMatrixfARB)(const GLfloat *m)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[442];
+ ((void (APIENTRY *)(const GLfloat *m)) _func)(m);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(LoadTransposeMatrixf)(const GLfloat *m)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[442];
+ ((void (APIENTRY *)(const GLfloat *m)) _func)(m);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(MultTransposeMatrixdARB)(const GLdouble *m)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[443];
+ ((void (APIENTRY *)(const GLdouble *m)) _func)(m);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(MultTransposeMatrixd)(const GLdouble *m)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[443];
+ ((void (APIENTRY *)(const GLdouble *m)) _func)(m);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(MultTransposeMatrixfARB)(const GLfloat *m)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[444];
+ ((void (APIENTRY *)(const GLfloat *m)) _func)(m);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(MultTransposeMatrixf)(const GLfloat *m)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[444];
+ ((void (APIENTRY *)(const GLfloat *m)) _func)(m);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(SampleCoverageARB)(GLclampf value, GLboolean invert)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[445];
+ ((void (APIENTRY *)(GLclampf value, GLboolean invert)) _func)(value, invert);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(SampleCoverage)(GLclampf value, GLboolean invert)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[445];
+ ((void (APIENTRY *)(GLclampf value, GLboolean invert)) _func)(value, invert);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(CompressedTexImage1DARB)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[446];
+ ((void (APIENTRY *)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data)) _func)(target, level, internalformat, width, border, imageSize, data);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(CompressedTexImage1D)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[446];
+ ((void (APIENTRY *)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data)) _func)(target, level, internalformat, width, border, imageSize, data);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(CompressedTexImage2DARB)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[447];
+ ((void (APIENTRY *)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data)) _func)(target, level, internalformat, width, height, border, imageSize, data);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(CompressedTexImage2D)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[447];
+ ((void (APIENTRY *)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data)) _func)(target, level, internalformat, width, height, border, imageSize, data);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(CompressedTexImage3DARB)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[448];
+ ((void (APIENTRY *)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data)) _func)(target, level, internalformat, width, height, depth, border, imageSize, data);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(CompressedTexImage3D)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[448];
+ ((void (APIENTRY *)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data)) _func)(target, level, internalformat, width, height, depth, border, imageSize, data);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(CompressedTexSubImage1DARB)(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[449];
+ ((void (APIENTRY *)(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data)) _func)(target, level, xoffset, width, format, imageSize, data);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(CompressedTexSubImage1D)(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[449];
+ ((void (APIENTRY *)(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data)) _func)(target, level, xoffset, width, format, imageSize, data);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(CompressedTexSubImage2DARB)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[450];
+ ((void (APIENTRY *)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data)) _func)(target, level, xoffset, yoffset, width, height, format, imageSize, data);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(CompressedTexSubImage2D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[450];
+ ((void (APIENTRY *)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data)) _func)(target, level, xoffset, yoffset, width, height, format, imageSize, data);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(CompressedTexSubImage3DARB)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[451];
+ ((void (APIENTRY *)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data)) _func)(target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, data);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(CompressedTexSubImage3D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[451];
+ ((void (APIENTRY *)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data)) _func)(target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, data);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(GetCompressedTexImageARB)(GLenum target, GLint level, GLvoid *img)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[452];
+ ((void (APIENTRY *)(GLenum target, GLint level, GLvoid *img)) _func)(target, level, img);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(GetCompressedTexImage)(GLenum target, GLint level, GLvoid *img)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[452];
+ ((void (APIENTRY *)(GLenum target, GLint level, GLvoid *img)) _func)(target, level, img);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(DisableVertexAttribArrayARB)(GLuint index)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[453];
+ ((void (APIENTRY *)(GLuint index)) _func)(index);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(DisableVertexAttribArray)(GLuint index)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[453];
+ ((void (APIENTRY *)(GLuint index)) _func)(index);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(EnableVertexAttribArrayARB)(GLuint index)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[454];
+ ((void (APIENTRY *)(GLuint index)) _func)(index);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(EnableVertexAttribArray)(GLuint index)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[454];
+ ((void (APIENTRY *)(GLuint index)) _func)(index);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(GetProgramEnvParameterdvARB)(GLenum target, GLuint index, GLdouble *params)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[455];
+ ((void (APIENTRY *)(GLenum target, GLuint index, GLdouble *params)) _func)(target, index, params);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(GetProgramEnvParameterfvARB)(GLenum target, GLuint index, GLfloat *params)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[456];
+ ((void (APIENTRY *)(GLenum target, GLuint index, GLfloat *params)) _func)(target, index, params);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(GetProgramLocalParameterdvARB)(GLenum target, GLuint index, GLdouble *params)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[457];
+ ((void (APIENTRY *)(GLenum target, GLuint index, GLdouble *params)) _func)(target, index, params);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(GetProgramLocalParameterfvARB)(GLenum target, GLuint index, GLfloat *params)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[458];
+ ((void (APIENTRY *)(GLenum target, GLuint index, GLfloat *params)) _func)(target, index, params);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(GetProgramStringARB)(GLenum target, GLenum pname, GLvoid *string)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[459];
+ ((void (APIENTRY *)(GLenum target, GLenum pname, GLvoid *string)) _func)(target, pname, string);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(GetProgramivARB)(GLenum target, GLenum pname, GLint *params)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[460];
+ ((void (APIENTRY *)(GLenum target, GLenum pname, GLint *params)) _func)(target, pname, params);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(GetVertexAttribdvARB)(GLuint index, GLenum pname, GLdouble *params)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[461];
+ ((void (APIENTRY *)(GLuint index, GLenum pname, GLdouble *params)) _func)(index, pname, params);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(GetVertexAttribdv)(GLuint index, GLenum pname, GLdouble *params)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[461];
+ ((void (APIENTRY *)(GLuint index, GLenum pname, GLdouble *params)) _func)(index, pname, params);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(GetVertexAttribfvARB)(GLuint index, GLenum pname, GLfloat *params)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[462];
+ ((void (APIENTRY *)(GLuint index, GLenum pname, GLfloat *params)) _func)(index, pname, params);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(GetVertexAttribfv)(GLuint index, GLenum pname, GLfloat *params)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[462];
+ ((void (APIENTRY *)(GLuint index, GLenum pname, GLfloat *params)) _func)(index, pname, params);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(GetVertexAttribivARB)(GLuint index, GLenum pname, GLint *params)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[463];
+ ((void (APIENTRY *)(GLuint index, GLenum pname, GLint *params)) _func)(index, pname, params);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(GetVertexAttribiv)(GLuint index, GLenum pname, GLint *params)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[463];
+ ((void (APIENTRY *)(GLuint index, GLenum pname, GLint *params)) _func)(index, pname, params);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(ProgramEnvParameter4dARB)(GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[464];
+ ((void (APIENTRY *)(GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w)) _func)(target, index, x, y, z, w);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(ProgramParameter4dNV)(GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[464];
+ ((void (APIENTRY *)(GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w)) _func)(target, index, x, y, z, w);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(ProgramEnvParameter4dvARB)(GLenum target, GLuint index, const GLdouble *params)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[465];
+ ((void (APIENTRY *)(GLenum target, GLuint index, const GLdouble *params)) _func)(target, index, params);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(ProgramParameter4dvNV)(GLenum target, GLuint index, const GLdouble *params)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[465];
+ ((void (APIENTRY *)(GLenum target, GLuint index, const GLdouble *params)) _func)(target, index, params);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(ProgramEnvParameter4fARB)(GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[466];
+ ((void (APIENTRY *)(GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w)) _func)(target, index, x, y, z, w);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(ProgramParameter4fNV)(GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[466];
+ ((void (APIENTRY *)(GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w)) _func)(target, index, x, y, z, w);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(ProgramEnvParameter4fvARB)(GLenum target, GLuint index, const GLfloat *params)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[467];
+ ((void (APIENTRY *)(GLenum target, GLuint index, const GLfloat *params)) _func)(target, index, params);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(ProgramParameter4fvNV)(GLenum target, GLuint index, const GLfloat *params)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[467];
+ ((void (APIENTRY *)(GLenum target, GLuint index, const GLfloat *params)) _func)(target, index, params);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(ProgramLocalParameter4dARB)(GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[468];
+ ((void (APIENTRY *)(GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w)) _func)(target, index, x, y, z, w);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(ProgramLocalParameter4dvARB)(GLenum target, GLuint index, const GLdouble *params)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[469];
+ ((void (APIENTRY *)(GLenum target, GLuint index, const GLdouble *params)) _func)(target, index, params);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(ProgramLocalParameter4fARB)(GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[470];
+ ((void (APIENTRY *)(GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w)) _func)(target, index, x, y, z, w);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(ProgramLocalParameter4fvARB)(GLenum target, GLuint index, const GLfloat *params)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[471];
+ ((void (APIENTRY *)(GLenum target, GLuint index, const GLfloat *params)) _func)(target, index, params);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(ProgramStringARB)(GLenum target, GLenum format, GLsizei len, const GLvoid *string)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[472];
+ ((void (APIENTRY *)(GLenum target, GLenum format, GLsizei len, const GLvoid *string)) _func)(target, format, len, string);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib1dARB)(GLuint index, GLdouble x)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[473];
+ ((void (APIENTRY *)(GLuint index, GLdouble x)) _func)(index, x);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib1d)(GLuint index, GLdouble x)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[473];
+ ((void (APIENTRY *)(GLuint index, GLdouble x)) _func)(index, x);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib1dvARB)(GLuint index, const GLdouble *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[474];
+ ((void (APIENTRY *)(GLuint index, const GLdouble *v)) _func)(index, v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib1dv)(GLuint index, const GLdouble *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[474];
+ ((void (APIENTRY *)(GLuint index, const GLdouble *v)) _func)(index, v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib1fARB)(GLuint index, GLfloat x)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[475];
+ ((void (APIENTRY *)(GLuint index, GLfloat x)) _func)(index, x);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib1f)(GLuint index, GLfloat x)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[475];
+ ((void (APIENTRY *)(GLuint index, GLfloat x)) _func)(index, x);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib1fvARB)(GLuint index, const GLfloat *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[476];
+ ((void (APIENTRY *)(GLuint index, const GLfloat *v)) _func)(index, v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib1fv)(GLuint index, const GLfloat *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[476];
+ ((void (APIENTRY *)(GLuint index, const GLfloat *v)) _func)(index, v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib1sARB)(GLuint index, GLshort x)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[477];
+ ((void (APIENTRY *)(GLuint index, GLshort x)) _func)(index, x);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib1s)(GLuint index, GLshort x)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[477];
+ ((void (APIENTRY *)(GLuint index, GLshort x)) _func)(index, x);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib1svARB)(GLuint index, const GLshort *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[478];
+ ((void (APIENTRY *)(GLuint index, const GLshort *v)) _func)(index, v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib1sv)(GLuint index, const GLshort *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[478];
+ ((void (APIENTRY *)(GLuint index, const GLshort *v)) _func)(index, v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib2dARB)(GLuint index, GLdouble x, GLdouble y)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[479];
+ ((void (APIENTRY *)(GLuint index, GLdouble x, GLdouble y)) _func)(index, x, y);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib2d)(GLuint index, GLdouble x, GLdouble y)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[479];
+ ((void (APIENTRY *)(GLuint index, GLdouble x, GLdouble y)) _func)(index, x, y);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib2dvARB)(GLuint index, const GLdouble *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[480];
+ ((void (APIENTRY *)(GLuint index, const GLdouble *v)) _func)(index, v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib2dv)(GLuint index, const GLdouble *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[480];
+ ((void (APIENTRY *)(GLuint index, const GLdouble *v)) _func)(index, v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib2fARB)(GLuint index, GLfloat x, GLfloat y)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[481];
+ ((void (APIENTRY *)(GLuint index, GLfloat x, GLfloat y)) _func)(index, x, y);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib2f)(GLuint index, GLfloat x, GLfloat y)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[481];
+ ((void (APIENTRY *)(GLuint index, GLfloat x, GLfloat y)) _func)(index, x, y);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib2fvARB)(GLuint index, const GLfloat *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[482];
+ ((void (APIENTRY *)(GLuint index, const GLfloat *v)) _func)(index, v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib2fv)(GLuint index, const GLfloat *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[482];
+ ((void (APIENTRY *)(GLuint index, const GLfloat *v)) _func)(index, v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib2sARB)(GLuint index, GLshort x, GLshort y)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[483];
+ ((void (APIENTRY *)(GLuint index, GLshort x, GLshort y)) _func)(index, x, y);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib2s)(GLuint index, GLshort x, GLshort y)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[483];
+ ((void (APIENTRY *)(GLuint index, GLshort x, GLshort y)) _func)(index, x, y);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib2svARB)(GLuint index, const GLshort *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[484];
+ ((void (APIENTRY *)(GLuint index, const GLshort *v)) _func)(index, v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib2sv)(GLuint index, const GLshort *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[484];
+ ((void (APIENTRY *)(GLuint index, const GLshort *v)) _func)(index, v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib3dARB)(GLuint index, GLdouble x, GLdouble y, GLdouble z)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[485];
+ ((void (APIENTRY *)(GLuint index, GLdouble x, GLdouble y, GLdouble z)) _func)(index, x, y, z);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib3d)(GLuint index, GLdouble x, GLdouble y, GLdouble z)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[485];
+ ((void (APIENTRY *)(GLuint index, GLdouble x, GLdouble y, GLdouble z)) _func)(index, x, y, z);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib3dvARB)(GLuint index, const GLdouble *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[486];
+ ((void (APIENTRY *)(GLuint index, const GLdouble *v)) _func)(index, v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib3dv)(GLuint index, const GLdouble *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[486];
+ ((void (APIENTRY *)(GLuint index, const GLdouble *v)) _func)(index, v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib3fARB)(GLuint index, GLfloat x, GLfloat y, GLfloat z)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[487];
+ ((void (APIENTRY *)(GLuint index, GLfloat x, GLfloat y, GLfloat z)) _func)(index, x, y, z);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib3f)(GLuint index, GLfloat x, GLfloat y, GLfloat z)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[487];
+ ((void (APIENTRY *)(GLuint index, GLfloat x, GLfloat y, GLfloat z)) _func)(index, x, y, z);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib3fvARB)(GLuint index, const GLfloat *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[488];
+ ((void (APIENTRY *)(GLuint index, const GLfloat *v)) _func)(index, v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib3fv)(GLuint index, const GLfloat *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[488];
+ ((void (APIENTRY *)(GLuint index, const GLfloat *v)) _func)(index, v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib3sARB)(GLuint index, GLshort x, GLshort y, GLshort z)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[489];
+ ((void (APIENTRY *)(GLuint index, GLshort x, GLshort y, GLshort z)) _func)(index, x, y, z);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib3s)(GLuint index, GLshort x, GLshort y, GLshort z)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[489];
+ ((void (APIENTRY *)(GLuint index, GLshort x, GLshort y, GLshort z)) _func)(index, x, y, z);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib3svARB)(GLuint index, const GLshort *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[490];
+ ((void (APIENTRY *)(GLuint index, const GLshort *v)) _func)(index, v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib3sv)(GLuint index, const GLshort *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[490];
+ ((void (APIENTRY *)(GLuint index, const GLshort *v)) _func)(index, v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib4NbvARB)(GLuint index, const GLbyte *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[491];
+ ((void (APIENTRY *)(GLuint index, const GLbyte *v)) _func)(index, v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib4Nbv)(GLuint index, const GLbyte *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[491];
+ ((void (APIENTRY *)(GLuint index, const GLbyte *v)) _func)(index, v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib4NivARB)(GLuint index, const GLint *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[492];
+ ((void (APIENTRY *)(GLuint index, const GLint *v)) _func)(index, v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib4Niv)(GLuint index, const GLint *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[492];
+ ((void (APIENTRY *)(GLuint index, const GLint *v)) _func)(index, v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib4NsvARB)(GLuint index, const GLshort *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[493];
+ ((void (APIENTRY *)(GLuint index, const GLshort *v)) _func)(index, v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib4Nsv)(GLuint index, const GLshort *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[493];
+ ((void (APIENTRY *)(GLuint index, const GLshort *v)) _func)(index, v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib4NubARB)(GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[494];
+ ((void (APIENTRY *)(GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w)) _func)(index, x, y, z, w);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib4Nub)(GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[494];
+ ((void (APIENTRY *)(GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w)) _func)(index, x, y, z, w);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib4NubvARB)(GLuint index, const GLubyte *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[495];
+ ((void (APIENTRY *)(GLuint index, const GLubyte *v)) _func)(index, v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib4Nubv)(GLuint index, const GLubyte *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[495];
+ ((void (APIENTRY *)(GLuint index, const GLubyte *v)) _func)(index, v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib4NuivARB)(GLuint index, const GLuint *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[496];
+ ((void (APIENTRY *)(GLuint index, const GLuint *v)) _func)(index, v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib4Nuiv)(GLuint index, const GLuint *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[496];
+ ((void (APIENTRY *)(GLuint index, const GLuint *v)) _func)(index, v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib4NusvARB)(GLuint index, const GLushort *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[497];
+ ((void (APIENTRY *)(GLuint index, const GLushort *v)) _func)(index, v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib4Nusv)(GLuint index, const GLushort *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[497];
+ ((void (APIENTRY *)(GLuint index, const GLushort *v)) _func)(index, v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib4bvARB)(GLuint index, const GLbyte *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[498];
+ ((void (APIENTRY *)(GLuint index, const GLbyte *v)) _func)(index, v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib4bv)(GLuint index, const GLbyte *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[498];
+ ((void (APIENTRY *)(GLuint index, const GLbyte *v)) _func)(index, v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib4dARB)(GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[499];
+ ((void (APIENTRY *)(GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w)) _func)(index, x, y, z, w);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib4d)(GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[499];
+ ((void (APIENTRY *)(GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w)) _func)(index, x, y, z, w);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib4dvARB)(GLuint index, const GLdouble *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[500];
+ ((void (APIENTRY *)(GLuint index, const GLdouble *v)) _func)(index, v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib4dv)(GLuint index, const GLdouble *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[500];
+ ((void (APIENTRY *)(GLuint index, const GLdouble *v)) _func)(index, v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib4fARB)(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[501];
+ ((void (APIENTRY *)(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w)) _func)(index, x, y, z, w);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib4f)(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[501];
+ ((void (APIENTRY *)(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w)) _func)(index, x, y, z, w);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib4fvARB)(GLuint index, const GLfloat *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[502];
+ ((void (APIENTRY *)(GLuint index, const GLfloat *v)) _func)(index, v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib4fv)(GLuint index, const GLfloat *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[502];
+ ((void (APIENTRY *)(GLuint index, const GLfloat *v)) _func)(index, v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib4ivARB)(GLuint index, const GLint *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[503];
+ ((void (APIENTRY *)(GLuint index, const GLint *v)) _func)(index, v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib4iv)(GLuint index, const GLint *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[503];
+ ((void (APIENTRY *)(GLuint index, const GLint *v)) _func)(index, v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib4sARB)(GLuint index, GLshort x, GLshort y, GLshort z, GLshort w)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[504];
+ ((void (APIENTRY *)(GLuint index, GLshort x, GLshort y, GLshort z, GLshort w)) _func)(index, x, y, z, w);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib4s)(GLuint index, GLshort x, GLshort y, GLshort z, GLshort w)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[504];
+ ((void (APIENTRY *)(GLuint index, GLshort x, GLshort y, GLshort z, GLshort w)) _func)(index, x, y, z, w);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib4svARB)(GLuint index, const GLshort *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[505];
+ ((void (APIENTRY *)(GLuint index, const GLshort *v)) _func)(index, v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib4sv)(GLuint index, const GLshort *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[505];
+ ((void (APIENTRY *)(GLuint index, const GLshort *v)) _func)(index, v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib4ubvARB)(GLuint index, const GLubyte *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[506];
+ ((void (APIENTRY *)(GLuint index, const GLubyte *v)) _func)(index, v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib4ubv)(GLuint index, const GLubyte *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[506];
+ ((void (APIENTRY *)(GLuint index, const GLubyte *v)) _func)(index, v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib4uivARB)(GLuint index, const GLuint *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[507];
+ ((void (APIENTRY *)(GLuint index, const GLuint *v)) _func)(index, v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib4uiv)(GLuint index, const GLuint *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[507];
+ ((void (APIENTRY *)(GLuint index, const GLuint *v)) _func)(index, v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib4usvARB)(GLuint index, const GLushort *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[508];
+ ((void (APIENTRY *)(GLuint index, const GLushort *v)) _func)(index, v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib4usv)(GLuint index, const GLushort *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[508];
+ ((void (APIENTRY *)(GLuint index, const GLushort *v)) _func)(index, v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribPointerARB)(GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *pointer)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[509];
+ ((void (APIENTRY *)(GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *pointer)) _func)(index, size, type, normalized, stride, pointer);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribPointer)(GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *pointer)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[509];
+ ((void (APIENTRY *)(GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *pointer)) _func)(index, size, type, normalized, stride, pointer);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(BindBufferARB)(GLenum target, GLuint buffer)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[510];
+ ((void (APIENTRY *)(GLenum target, GLuint buffer)) _func)(target, buffer);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(BindBuffer)(GLenum target, GLuint buffer)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[510];
+ ((void (APIENTRY *)(GLenum target, GLuint buffer)) _func)(target, buffer);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(BufferDataARB)(GLenum target, GLsizeiptrARB size, const GLvoid *data, GLenum usage)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[511];
+ ((void (APIENTRY *)(GLenum target, GLsizeiptrARB size, const GLvoid *data, GLenum usage)) _func)(target, size, data, usage);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(BufferData)(GLenum target, GLsizeiptr size, const GLvoid *data, GLenum usage)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[511];
+ ((void (APIENTRY *)(GLenum target, GLsizeiptr size, const GLvoid *data, GLenum usage)) _func)(target, size, data, usage);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(BufferSubDataARB)(GLenum target, GLintptrARB offset, GLsizeiptrARB size, const GLvoid *data)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[512];
+ ((void (APIENTRY *)(GLenum target, GLintptrARB offset, GLsizeiptrARB size, const GLvoid *data)) _func)(target, offset, size, data);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(BufferSubData)(GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid *data)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[512];
+ ((void (APIENTRY *)(GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid *data)) _func)(target, offset, size, data);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(DeleteBuffersARB)(GLsizei n, const GLuint *buffer)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[513];
+ ((void (APIENTRY *)(GLsizei n, const GLuint *buffer)) _func)(n, buffer);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(DeleteBuffers)(GLsizei n, const GLuint *buffer)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[513];
+ ((void (APIENTRY *)(GLsizei n, const GLuint *buffer)) _func)(n, buffer);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(GenBuffersARB)(GLsizei n, GLuint *buffer)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[514];
+ ((void (APIENTRY *)(GLsizei n, GLuint *buffer)) _func)(n, buffer);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(GenBuffers)(GLsizei n, GLuint *buffer)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[514];
+ ((void (APIENTRY *)(GLsizei n, GLuint *buffer)) _func)(n, buffer);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(GetBufferParameterivARB)(GLenum target, GLenum pname, GLint *params)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[515];
+ ((void (APIENTRY *)(GLenum target, GLenum pname, GLint *params)) _func)(target, pname, params);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(GetBufferParameteriv)(GLenum target, GLenum pname, GLint *params)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[515];
+ ((void (APIENTRY *)(GLenum target, GLenum pname, GLint *params)) _func)(target, pname, params);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(GetBufferPointervARB)(GLenum target, GLenum pname, GLvoid **params)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[516];
+ ((void (APIENTRY *)(GLenum target, GLenum pname, GLvoid **params)) _func)(target, pname, params);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(GetBufferPointerv)(GLenum target, GLenum pname, GLvoid **params)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[516];
+ ((void (APIENTRY *)(GLenum target, GLenum pname, GLvoid **params)) _func)(target, pname, params);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(GetBufferSubDataARB)(GLenum target, GLintptrARB offset, GLsizeiptrARB size, GLvoid *data)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[517];
+ ((void (APIENTRY *)(GLenum target, GLintptrARB offset, GLsizeiptrARB size, GLvoid *data)) _func)(target, offset, size, data);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(GetBufferSubData)(GLenum target, GLintptr offset, GLsizeiptr size, GLvoid *data)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[517];
+ ((void (APIENTRY *)(GLenum target, GLintptr offset, GLsizeiptr size, GLvoid *data)) _func)(target, offset, size, data);
+}
+
+GLAPI GLboolean APIENTRY GLAPI_PREFIX(IsBufferARB)(GLuint buffer)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[518];
+ return ((GLboolean (APIENTRY *)(GLuint buffer)) _func)(buffer);
+}
+
+GLAPI GLboolean APIENTRY GLAPI_PREFIX(IsBuffer)(GLuint buffer)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[518];
+ return ((GLboolean (APIENTRY *)(GLuint buffer)) _func)(buffer);
+}
+
+GLAPI GLvoid * APIENTRY GLAPI_PREFIX(MapBufferARB)(GLenum target, GLenum access)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[519];
+ return ((GLvoid * (APIENTRY *)(GLenum target, GLenum access)) _func)(target, access);
+}
+
+GLAPI GLvoid * APIENTRY GLAPI_PREFIX(MapBuffer)(GLenum target, GLenum access)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[519];
+ return ((GLvoid * (APIENTRY *)(GLenum target, GLenum access)) _func)(target, access);
+}
+
+GLAPI GLboolean APIENTRY GLAPI_PREFIX(UnmapBufferARB)(GLenum target)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[520];
+ return ((GLboolean (APIENTRY *)(GLenum target)) _func)(target);
+}
+
+GLAPI GLboolean APIENTRY GLAPI_PREFIX(UnmapBuffer)(GLenum target)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[520];
+ return ((GLboolean (APIENTRY *)(GLenum target)) _func)(target);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(BeginQueryARB)(GLenum target, GLuint id)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[521];
+ ((void (APIENTRY *)(GLenum target, GLuint id)) _func)(target, id);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(BeginQuery)(GLenum target, GLuint id)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[521];
+ ((void (APIENTRY *)(GLenum target, GLuint id)) _func)(target, id);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(DeleteQueriesARB)(GLsizei n, const GLuint *ids)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[522];
+ ((void (APIENTRY *)(GLsizei n, const GLuint *ids)) _func)(n, ids);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(DeleteQueries)(GLsizei n, const GLuint *ids)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[522];
+ ((void (APIENTRY *)(GLsizei n, const GLuint *ids)) _func)(n, ids);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(EndQueryARB)(GLenum target)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[523];
+ ((void (APIENTRY *)(GLenum target)) _func)(target);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(EndQuery)(GLenum target)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[523];
+ ((void (APIENTRY *)(GLenum target)) _func)(target);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(GenQueriesARB)(GLsizei n, GLuint *ids)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[524];
+ ((void (APIENTRY *)(GLsizei n, GLuint *ids)) _func)(n, ids);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(GenQueries)(GLsizei n, GLuint *ids)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[524];
+ ((void (APIENTRY *)(GLsizei n, GLuint *ids)) _func)(n, ids);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(GetQueryObjectivARB)(GLuint id, GLenum pname, GLint *params)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[525];
+ ((void (APIENTRY *)(GLuint id, GLenum pname, GLint *params)) _func)(id, pname, params);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(GetQueryObjectiv)(GLuint id, GLenum pname, GLint *params)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[525];
+ ((void (APIENTRY *)(GLuint id, GLenum pname, GLint *params)) _func)(id, pname, params);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(GetQueryObjectuivARB)(GLuint id, GLenum pname, GLuint *params)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[526];
+ ((void (APIENTRY *)(GLuint id, GLenum pname, GLuint *params)) _func)(id, pname, params);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(GetQueryObjectuiv)(GLuint id, GLenum pname, GLuint *params)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[526];
+ ((void (APIENTRY *)(GLuint id, GLenum pname, GLuint *params)) _func)(id, pname, params);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(GetQueryivARB)(GLenum target, GLenum pname, GLint *params)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[527];
+ ((void (APIENTRY *)(GLenum target, GLenum pname, GLint *params)) _func)(target, pname, params);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(GetQueryiv)(GLenum target, GLenum pname, GLint *params)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[527];
+ ((void (APIENTRY *)(GLenum target, GLenum pname, GLint *params)) _func)(target, pname, params);
+}
+
+GLAPI GLboolean APIENTRY GLAPI_PREFIX(IsQueryARB)(GLuint id)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[528];
+ return ((GLboolean (APIENTRY *)(GLuint id)) _func)(id);
+}
+
+GLAPI GLboolean APIENTRY GLAPI_PREFIX(IsQuery)(GLuint id)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[528];
+ return ((GLboolean (APIENTRY *)(GLuint id)) _func)(id);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(AttachObjectARB)(GLhandleARB containerObj, GLhandleARB obj)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[529];
+ ((void (APIENTRY *)(GLhandleARB containerObj, GLhandleARB obj)) _func)(containerObj, obj);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(CompileShaderARB)(GLhandleARB shader)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[530];
+ ((void (APIENTRY *)(GLhandleARB shader)) _func)(shader);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(CompileShader)(GLuint shader)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[530];
+ ((void (APIENTRY *)(GLuint shader)) _func)(shader);
+}
+
+GLAPI GLhandleARB APIENTRY GLAPI_PREFIX(CreateProgramObjectARB)(void)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[531];
+ return ((GLhandleARB (APIENTRY *)(void)) _func)();
+}
+
+GLAPI GLhandleARB APIENTRY GLAPI_PREFIX(CreateShaderObjectARB)(GLenum shaderType)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[532];
+ return ((GLhandleARB (APIENTRY *)(GLenum shaderType)) _func)(shaderType);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(DeleteObjectARB)(GLhandleARB obj)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[533];
+ ((void (APIENTRY *)(GLhandleARB obj)) _func)(obj);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(DetachObjectARB)(GLhandleARB containerObj, GLhandleARB attachedObj)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[534];
+ ((void (APIENTRY *)(GLhandleARB containerObj, GLhandleARB attachedObj)) _func)(containerObj, attachedObj);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(GetActiveUniformARB)(GLhandleARB program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLcharARB *name)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[535];
+ ((void (APIENTRY *)(GLhandleARB program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLcharARB *name)) _func)(program, index, bufSize, length, size, type, name);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(GetActiveUniform)(GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[535];
+ ((void (APIENTRY *)(GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name)) _func)(program, index, bufSize, length, size, type, name);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(GetAttachedObjectsARB)(GLhandleARB containerObj, GLsizei maxLength, GLsizei *length, GLhandleARB *infoLog)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[536];
+ ((void (APIENTRY *)(GLhandleARB containerObj, GLsizei maxLength, GLsizei *length, GLhandleARB *infoLog)) _func)(containerObj, maxLength, length, infoLog);
+}
+
+GLAPI GLhandleARB APIENTRY GLAPI_PREFIX(GetHandleARB)(GLenum pname)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[537];
+ return ((GLhandleARB (APIENTRY *)(GLenum pname)) _func)(pname);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(GetInfoLogARB)(GLhandleARB obj, GLsizei maxLength, GLsizei *length, GLcharARB *infoLog)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[538];
+ ((void (APIENTRY *)(GLhandleARB obj, GLsizei maxLength, GLsizei *length, GLcharARB *infoLog)) _func)(obj, maxLength, length, infoLog);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(GetObjectParameterfvARB)(GLhandleARB obj, GLenum pname, GLfloat *params)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[539];
+ ((void (APIENTRY *)(GLhandleARB obj, GLenum pname, GLfloat *params)) _func)(obj, pname, params);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(GetObjectParameterivARB)(GLhandleARB obj, GLenum pname, GLint *params)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[540];
+ ((void (APIENTRY *)(GLhandleARB obj, GLenum pname, GLint *params)) _func)(obj, pname, params);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(GetShaderSourceARB)(GLhandleARB shader, GLsizei bufSize, GLsizei *length, GLcharARB *source)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[541];
+ ((void (APIENTRY *)(GLhandleARB shader, GLsizei bufSize, GLsizei *length, GLcharARB *source)) _func)(shader, bufSize, length, source);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(GetShaderSource)(GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *source)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[541];
+ ((void (APIENTRY *)(GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *source)) _func)(shader, bufSize, length, source);
+}
+
+GLAPI GLint APIENTRY GLAPI_PREFIX(GetUniformLocationARB)(GLhandleARB program, const GLcharARB *name)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[542];
+ return ((GLint (APIENTRY *)(GLhandleARB program, const GLcharARB *name)) _func)(program, name);
+}
+
+GLAPI GLint APIENTRY GLAPI_PREFIX(GetUniformLocation)(GLuint program, const GLchar *name)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[542];
+ return ((GLint (APIENTRY *)(GLuint program, const GLchar *name)) _func)(program, name);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(GetUniformfvARB)(GLhandleARB program, GLint location, GLfloat *params)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[543];
+ ((void (APIENTRY *)(GLhandleARB program, GLint location, GLfloat *params)) _func)(program, location, params);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(GetUniformfv)(GLuint program, GLint location, GLfloat *params)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[543];
+ ((void (APIENTRY *)(GLuint program, GLint location, GLfloat *params)) _func)(program, location, params);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(GetUniformivARB)(GLhandleARB program, GLint location, GLint *params)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[544];
+ ((void (APIENTRY *)(GLhandleARB program, GLint location, GLint *params)) _func)(program, location, params);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(GetUniformiv)(GLuint program, GLint location, GLint *params)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[544];
+ ((void (APIENTRY *)(GLuint program, GLint location, GLint *params)) _func)(program, location, params);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(LinkProgramARB)(GLhandleARB program)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[545];
+ ((void (APIENTRY *)(GLhandleARB program)) _func)(program);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(LinkProgram)(GLuint program)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[545];
+ ((void (APIENTRY *)(GLuint program)) _func)(program);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(ShaderSourceARB)(GLhandleARB shader, GLsizei count, const GLcharARB **string, const GLint *length)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[546];
+ ((void (APIENTRY *)(GLhandleARB shader, GLsizei count, const GLcharARB **string, const GLint *length)) _func)(shader, count, string, length);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(ShaderSource)(GLuint shader, GLsizei count, const GLchar **string, const GLint *length)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[546];
+ ((void (APIENTRY *)(GLuint shader, GLsizei count, const GLchar **string, const GLint *length)) _func)(shader, count, string, length);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(Uniform1fARB)(GLint location, GLfloat v0)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[547];
+ ((void (APIENTRY *)(GLint location, GLfloat v0)) _func)(location, v0);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(Uniform1f)(GLint location, GLfloat v0)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[547];
+ ((void (APIENTRY *)(GLint location, GLfloat v0)) _func)(location, v0);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(Uniform1fvARB)(GLint location, GLsizei count, const GLfloat *value)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[548];
+ ((void (APIENTRY *)(GLint location, GLsizei count, const GLfloat *value)) _func)(location, count, value);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(Uniform1fv)(GLint location, GLsizei count, const GLfloat *value)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[548];
+ ((void (APIENTRY *)(GLint location, GLsizei count, const GLfloat *value)) _func)(location, count, value);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(Uniform1iARB)(GLint location, GLint v0)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[549];
+ ((void (APIENTRY *)(GLint location, GLint v0)) _func)(location, v0);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(Uniform1i)(GLint location, GLint v0)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[549];
+ ((void (APIENTRY *)(GLint location, GLint v0)) _func)(location, v0);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(Uniform1ivARB)(GLint location, GLsizei count, const GLint *value)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[550];
+ ((void (APIENTRY *)(GLint location, GLsizei count, const GLint *value)) _func)(location, count, value);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(Uniform1iv)(GLint location, GLsizei count, const GLint *value)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[550];
+ ((void (APIENTRY *)(GLint location, GLsizei count, const GLint *value)) _func)(location, count, value);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(Uniform2fARB)(GLint location, GLfloat v0, GLfloat v1)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[551];
+ ((void (APIENTRY *)(GLint location, GLfloat v0, GLfloat v1)) _func)(location, v0, v1);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(Uniform2f)(GLint location, GLfloat v0, GLfloat v1)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[551];
+ ((void (APIENTRY *)(GLint location, GLfloat v0, GLfloat v1)) _func)(location, v0, v1);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(Uniform2fvARB)(GLint location, GLsizei count, const GLfloat *value)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[552];
+ ((void (APIENTRY *)(GLint location, GLsizei count, const GLfloat *value)) _func)(location, count, value);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(Uniform2fv)(GLint location, GLsizei count, const GLfloat *value)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[552];
+ ((void (APIENTRY *)(GLint location, GLsizei count, const GLfloat *value)) _func)(location, count, value);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(Uniform2iARB)(GLint location, GLint v0, GLint v1)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[553];
+ ((void (APIENTRY *)(GLint location, GLint v0, GLint v1)) _func)(location, v0, v1);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(Uniform2i)(GLint location, GLint v0, GLint v1)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[553];
+ ((void (APIENTRY *)(GLint location, GLint v0, GLint v1)) _func)(location, v0, v1);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(Uniform2ivARB)(GLint location, GLsizei count, const GLint *value)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[554];
+ ((void (APIENTRY *)(GLint location, GLsizei count, const GLint *value)) _func)(location, count, value);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(Uniform2iv)(GLint location, GLsizei count, const GLint *value)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[554];
+ ((void (APIENTRY *)(GLint location, GLsizei count, const GLint *value)) _func)(location, count, value);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(Uniform3fARB)(GLint location, GLfloat v0, GLfloat v1, GLfloat v2)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[555];
+ ((void (APIENTRY *)(GLint location, GLfloat v0, GLfloat v1, GLfloat v2)) _func)(location, v0, v1, v2);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(Uniform3f)(GLint location, GLfloat v0, GLfloat v1, GLfloat v2)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[555];
+ ((void (APIENTRY *)(GLint location, GLfloat v0, GLfloat v1, GLfloat v2)) _func)(location, v0, v1, v2);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(Uniform3fvARB)(GLint location, GLsizei count, const GLfloat *value)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[556];
+ ((void (APIENTRY *)(GLint location, GLsizei count, const GLfloat *value)) _func)(location, count, value);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(Uniform3fv)(GLint location, GLsizei count, const GLfloat *value)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[556];
+ ((void (APIENTRY *)(GLint location, GLsizei count, const GLfloat *value)) _func)(location, count, value);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(Uniform3iARB)(GLint location, GLint v0, GLint v1, GLint v2)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[557];
+ ((void (APIENTRY *)(GLint location, GLint v0, GLint v1, GLint v2)) _func)(location, v0, v1, v2);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(Uniform3i)(GLint location, GLint v0, GLint v1, GLint v2)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[557];
+ ((void (APIENTRY *)(GLint location, GLint v0, GLint v1, GLint v2)) _func)(location, v0, v1, v2);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(Uniform3ivARB)(GLint location, GLsizei count, const GLint *value)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[558];
+ ((void (APIENTRY *)(GLint location, GLsizei count, const GLint *value)) _func)(location, count, value);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(Uniform3iv)(GLint location, GLsizei count, const GLint *value)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[558];
+ ((void (APIENTRY *)(GLint location, GLsizei count, const GLint *value)) _func)(location, count, value);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(Uniform4fARB)(GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[559];
+ ((void (APIENTRY *)(GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3)) _func)(location, v0, v1, v2, v3);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(Uniform4f)(GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[559];
+ ((void (APIENTRY *)(GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3)) _func)(location, v0, v1, v2, v3);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(Uniform4fvARB)(GLint location, GLsizei count, const GLfloat *value)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[560];
+ ((void (APIENTRY *)(GLint location, GLsizei count, const GLfloat *value)) _func)(location, count, value);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(Uniform4fv)(GLint location, GLsizei count, const GLfloat *value)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[560];
+ ((void (APIENTRY *)(GLint location, GLsizei count, const GLfloat *value)) _func)(location, count, value);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(Uniform4iARB)(GLint location, GLint v0, GLint v1, GLint v2, GLint v3)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[561];
+ ((void (APIENTRY *)(GLint location, GLint v0, GLint v1, GLint v2, GLint v3)) _func)(location, v0, v1, v2, v3);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(Uniform4i)(GLint location, GLint v0, GLint v1, GLint v2, GLint v3)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[561];
+ ((void (APIENTRY *)(GLint location, GLint v0, GLint v1, GLint v2, GLint v3)) _func)(location, v0, v1, v2, v3);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(Uniform4ivARB)(GLint location, GLsizei count, const GLint *value)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[562];
+ ((void (APIENTRY *)(GLint location, GLsizei count, const GLint *value)) _func)(location, count, value);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(Uniform4iv)(GLint location, GLsizei count, const GLint *value)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[562];
+ ((void (APIENTRY *)(GLint location, GLsizei count, const GLint *value)) _func)(location, count, value);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(UniformMatrix2fvARB)(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[563];
+ ((void (APIENTRY *)(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)) _func)(location, count, transpose, value);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(UniformMatrix2fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[563];
+ ((void (APIENTRY *)(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)) _func)(location, count, transpose, value);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(UniformMatrix3fvARB)(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[564];
+ ((void (APIENTRY *)(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)) _func)(location, count, transpose, value);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(UniformMatrix3fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[564];
+ ((void (APIENTRY *)(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)) _func)(location, count, transpose, value);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(UniformMatrix4fvARB)(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[565];
+ ((void (APIENTRY *)(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)) _func)(location, count, transpose, value);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(UniformMatrix4fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[565];
+ ((void (APIENTRY *)(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)) _func)(location, count, transpose, value);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(UseProgramObjectARB)(GLhandleARB program)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[566];
+ ((void (APIENTRY *)(GLhandleARB program)) _func)(program);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(UseProgram)(GLuint program)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[566];
+ ((void (APIENTRY *)(GLuint program)) _func)(program);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(ValidateProgramARB)(GLhandleARB program)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[567];
+ ((void (APIENTRY *)(GLhandleARB program)) _func)(program);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(ValidateProgram)(GLuint program)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[567];
+ ((void (APIENTRY *)(GLuint program)) _func)(program);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(BindAttribLocationARB)(GLhandleARB program, GLuint index, const GLcharARB *name)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[568];
+ ((void (APIENTRY *)(GLhandleARB program, GLuint index, const GLcharARB *name)) _func)(program, index, name);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(BindAttribLocation)(GLuint program, GLuint index, const GLchar *name)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[568];
+ ((void (APIENTRY *)(GLuint program, GLuint index, const GLchar *name)) _func)(program, index, name);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(GetActiveAttribARB)(GLhandleARB program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLcharARB *name)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[569];
+ ((void (APIENTRY *)(GLhandleARB program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLcharARB *name)) _func)(program, index, bufSize, length, size, type, name);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(GetActiveAttrib)(GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[569];
+ ((void (APIENTRY *)(GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name)) _func)(program, index, bufSize, length, size, type, name);
+}
+
+GLAPI GLint APIENTRY GLAPI_PREFIX(GetAttribLocationARB)(GLhandleARB program, const GLcharARB *name)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[570];
+ return ((GLint (APIENTRY *)(GLhandleARB program, const GLcharARB *name)) _func)(program, name);
+}
+
+GLAPI GLint APIENTRY GLAPI_PREFIX(GetAttribLocation)(GLuint program, const GLchar *name)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[570];
+ return ((GLint (APIENTRY *)(GLuint program, const GLchar *name)) _func)(program, name);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(DrawBuffersARB)(GLsizei n, const GLenum *bufs)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[571];
+ ((void (APIENTRY *)(GLsizei n, const GLenum *bufs)) _func)(n, bufs);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(DrawBuffers)(GLsizei n, const GLenum *bufs)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[571];
+ ((void (APIENTRY *)(GLsizei n, const GLenum *bufs)) _func)(n, bufs);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(DrawBuffersATI)(GLsizei n, const GLenum *bufs)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[571];
+ ((void (APIENTRY *)(GLsizei n, const GLenum *bufs)) _func)(n, bufs);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(ClampColorARB)(GLenum target, GLenum clamp)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[572];
+ ((void (APIENTRY *)(GLenum target, GLenum clamp)) _func)(target, clamp);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(DrawArraysInstancedARB)(GLenum mode, GLint first, GLsizei count, GLsizei primcount)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[573];
+ ((void (APIENTRY *)(GLenum mode, GLint first, GLsizei count, GLsizei primcount)) _func)(mode, first, count, primcount);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(DrawArraysInstanced)(GLenum mode, GLint first, GLsizei count, GLsizei primcount)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[573];
+ ((void (APIENTRY *)(GLenum mode, GLint first, GLsizei count, GLsizei primcount)) _func)(mode, first, count, primcount);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(DrawArraysInstancedEXT)(GLenum mode, GLint first, GLsizei count, GLsizei primcount)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[573];
+ ((void (APIENTRY *)(GLenum mode, GLint first, GLsizei count, GLsizei primcount)) _func)(mode, first, count, primcount);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(DrawElementsInstancedARB)(GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[574];
+ ((void (APIENTRY *)(GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount)) _func)(mode, count, type, indices, primcount);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(DrawElementsInstanced)(GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[574];
+ ((void (APIENTRY *)(GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount)) _func)(mode, count, type, indices, primcount);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(DrawElementsInstancedEXT)(GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[574];
+ ((void (APIENTRY *)(GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount)) _func)(mode, count, type, indices, primcount);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(RenderbufferStorageMultisample)(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[575];
+ ((void (APIENTRY *)(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height)) _func)(target, samples, internalformat, width, height);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(RenderbufferStorageMultisampleEXT)(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[575];
+ ((void (APIENTRY *)(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height)) _func)(target, samples, internalformat, width, height);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(FramebufferTextureARB)(GLenum target, GLenum attachment, GLuint texture, GLint level)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[576];
+ ((void (APIENTRY *)(GLenum target, GLenum attachment, GLuint texture, GLint level)) _func)(target, attachment, texture, level);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(FramebufferTextureFaceARB)(GLenum target, GLenum attachment, GLuint texture, GLint level, GLenum face)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[577];
+ ((void (APIENTRY *)(GLenum target, GLenum attachment, GLuint texture, GLint level, GLenum face)) _func)(target, attachment, texture, level, face);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(ProgramParameteriARB)(GLuint program, GLenum pname, GLint value)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[578];
+ ((void (APIENTRY *)(GLuint program, GLenum pname, GLint value)) _func)(program, pname, value);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribDivisorARB)(GLuint index, GLuint divisor)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[579];
+ ((void (APIENTRY *)(GLuint index, GLuint divisor)) _func)(index, divisor);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(FlushMappedBufferRange)(GLenum target, GLintptr offset, GLsizeiptr length)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[580];
+ ((void (APIENTRY *)(GLenum target, GLintptr offset, GLsizeiptr length)) _func)(target, offset, length);
+}
+
+GLAPI GLvoid * APIENTRY GLAPI_PREFIX(MapBufferRange)(GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[581];
+ return ((GLvoid * (APIENTRY *)(GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access)) _func)(target, offset, length, access);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(TexBufferARB)(GLenum target, GLenum internalFormat, GLuint buffer)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[582];
+ ((void (APIENTRY *)(GLenum target, GLenum internalFormat, GLuint buffer)) _func)(target, internalFormat, buffer);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(BindVertexArray)(GLuint array)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[583];
+ ((void (APIENTRY *)(GLuint array)) _func)(array);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(GenVertexArrays)(GLsizei n, GLuint *arrays)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[584];
+ ((void (APIENTRY *)(GLsizei n, GLuint *arrays)) _func)(n, arrays);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(CopyBufferSubData)(GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[585];
+ ((void (APIENTRY *)(GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size)) _func)(readTarget, writeTarget, readOffset, writeOffset, size);
+}
+
+GLAPI GLenum APIENTRY GLAPI_PREFIX(ClientWaitSync)(GLsync sync, GLbitfield flags, GLuint64 timeout)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[586];
+ return ((GLenum (APIENTRY *)(GLsync sync, GLbitfield flags, GLuint64 timeout)) _func)(sync, flags, timeout);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(DeleteSync)(GLsync sync)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[587];
+ ((void (APIENTRY *)(GLsync sync)) _func)(sync);
+}
+
+GLAPI GLsync APIENTRY GLAPI_PREFIX(FenceSync)(GLenum condition, GLbitfield flags)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[588];
+ return ((GLsync (APIENTRY *)(GLenum condition, GLbitfield flags)) _func)(condition, flags);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(GetInteger64v)(GLenum pname, GLint64 *params)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[589];
+ ((void (APIENTRY *)(GLenum pname, GLint64 *params)) _func)(pname, params);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(GetSynciv)(GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[590];
+ ((void (APIENTRY *)(GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values)) _func)(sync, pname, bufSize, length, values);
+}
+
+GLAPI GLboolean APIENTRY GLAPI_PREFIX(IsSync)(GLsync sync)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[591];
+ return ((GLboolean (APIENTRY *)(GLsync sync)) _func)(sync);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(WaitSync)(GLsync sync, GLbitfield flags, GLuint64 timeout)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[592];
+ ((void (APIENTRY *)(GLsync sync, GLbitfield flags, GLuint64 timeout)) _func)(sync, flags, timeout);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(DrawElementsBaseVertex)(GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLint basevertex)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[593];
+ ((void (APIENTRY *)(GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLint basevertex)) _func)(mode, count, type, indices, basevertex);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(DrawRangeElementsBaseVertex)(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices, GLint basevertex)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[594];
+ ((void (APIENTRY *)(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices, GLint basevertex)) _func)(mode, start, end, count, type, indices, basevertex);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(MultiDrawElementsBaseVertex)(GLenum mode, const GLsizei *count, GLenum type, const GLvoid **indices, GLsizei primcount, const GLint *basevertex)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[595];
+ ((void (APIENTRY *)(GLenum mode, const GLsizei *count, GLenum type, const GLvoid **indices, GLsizei primcount, const GLint *basevertex)) _func)(mode, count, type, indices, primcount, basevertex);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(BlendEquationSeparateiARB)(GLuint buf, GLenum modeRGB, GLenum modeA)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[596];
+ ((void (APIENTRY *)(GLuint buf, GLenum modeRGB, GLenum modeA)) _func)(buf, modeRGB, modeA);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(BlendEquationSeparateIndexedAMD)(GLuint buf, GLenum modeRGB, GLenum modeA)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[596];
+ ((void (APIENTRY *)(GLuint buf, GLenum modeRGB, GLenum modeA)) _func)(buf, modeRGB, modeA);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(BlendEquationiARB)(GLuint buf, GLenum mode)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[597];
+ ((void (APIENTRY *)(GLuint buf, GLenum mode)) _func)(buf, mode);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(BlendEquationIndexedAMD)(GLuint buf, GLenum mode)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[597];
+ ((void (APIENTRY *)(GLuint buf, GLenum mode)) _func)(buf, mode);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(BlendFuncSeparateiARB)(GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcA, GLenum dstA)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[598];
+ ((void (APIENTRY *)(GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcA, GLenum dstA)) _func)(buf, srcRGB, dstRGB, srcA, dstA);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(BlendFuncSeparateIndexedAMD)(GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcA, GLenum dstA)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[598];
+ ((void (APIENTRY *)(GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcA, GLenum dstA)) _func)(buf, srcRGB, dstRGB, srcA, dstA);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(BlendFunciARB)(GLuint buf, GLenum src, GLenum dst)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[599];
+ ((void (APIENTRY *)(GLuint buf, GLenum src, GLenum dst)) _func)(buf, src, dst);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(BlendFuncIndexedAMD)(GLuint buf, GLenum src, GLenum dst)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[599];
+ ((void (APIENTRY *)(GLuint buf, GLenum src, GLenum dst)) _func)(buf, src, dst);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(BindSampler)(GLuint unit, GLuint sampler)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[600];
+ ((void (APIENTRY *)(GLuint unit, GLuint sampler)) _func)(unit, sampler);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(DeleteSamplers)(GLsizei count, const GLuint *samplers)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[601];
+ ((void (APIENTRY *)(GLsizei count, const GLuint *samplers)) _func)(count, samplers);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(GenSamplers)(GLsizei count, GLuint *samplers)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[602];
+ ((void (APIENTRY *)(GLsizei count, GLuint *samplers)) _func)(count, samplers);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(GetSamplerParameterIiv)(GLuint sampler, GLenum pname, GLint *params)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[603];
+ ((void (APIENTRY *)(GLuint sampler, GLenum pname, GLint *params)) _func)(sampler, pname, params);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(GetSamplerParameterIuiv)(GLuint sampler, GLenum pname, GLuint *params)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[604];
+ ((void (APIENTRY *)(GLuint sampler, GLenum pname, GLuint *params)) _func)(sampler, pname, params);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(GetSamplerParameterfv)(GLuint sampler, GLenum pname, GLfloat *params)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[605];
+ ((void (APIENTRY *)(GLuint sampler, GLenum pname, GLfloat *params)) _func)(sampler, pname, params);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(GetSamplerParameteriv)(GLuint sampler, GLenum pname, GLint *params)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[606];
+ ((void (APIENTRY *)(GLuint sampler, GLenum pname, GLint *params)) _func)(sampler, pname, params);
+}
+
+GLAPI GLboolean APIENTRY GLAPI_PREFIX(IsSampler)(GLuint sampler)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[607];
+ return ((GLboolean (APIENTRY *)(GLuint sampler)) _func)(sampler);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(SamplerParameterIiv)(GLuint sampler, GLenum pname, const GLint *params)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[608];
+ ((void (APIENTRY *)(GLuint sampler, GLenum pname, const GLint *params)) _func)(sampler, pname, params);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(SamplerParameterIuiv)(GLuint sampler, GLenum pname, const GLuint *params)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[609];
+ ((void (APIENTRY *)(GLuint sampler, GLenum pname, const GLuint *params)) _func)(sampler, pname, params);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(SamplerParameterf)(GLuint sampler, GLenum pname, GLfloat param)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[610];
+ ((void (APIENTRY *)(GLuint sampler, GLenum pname, GLfloat param)) _func)(sampler, pname, param);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(SamplerParameterfv)(GLuint sampler, GLenum pname, const GLfloat *params)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[611];
+ ((void (APIENTRY *)(GLuint sampler, GLenum pname, const GLfloat *params)) _func)(sampler, pname, params);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(SamplerParameteri)(GLuint sampler, GLenum pname, GLint param)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[612];
+ ((void (APIENTRY *)(GLuint sampler, GLenum pname, GLint param)) _func)(sampler, pname, param);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(SamplerParameteriv)(GLuint sampler, GLenum pname, const GLint *params)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[613];
+ ((void (APIENTRY *)(GLuint sampler, GLenum pname, const GLint *params)) _func)(sampler, pname, params);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(BindTransformFeedback)(GLenum target, GLuint id)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[614];
+ ((void (APIENTRY *)(GLenum target, GLuint id)) _func)(target, id);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(DeleteTransformFeedbacks)(GLsizei n, const GLuint *ids)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[615];
+ ((void (APIENTRY *)(GLsizei n, const GLuint *ids)) _func)(n, ids);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(DrawTransformFeedback)(GLenum mode, GLuint id)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[616];
+ ((void (APIENTRY *)(GLenum mode, GLuint id)) _func)(mode, id);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(GenTransformFeedbacks)(GLsizei n, GLuint *ids)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[617];
+ ((void (APIENTRY *)(GLsizei n, GLuint *ids)) _func)(n, ids);
+}
+
+GLAPI GLboolean APIENTRY GLAPI_PREFIX(IsTransformFeedback)(GLuint id)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[618];
+ return ((GLboolean (APIENTRY *)(GLuint id)) _func)(id);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(PauseTransformFeedback)(void)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[619];
+ ((void (APIENTRY *)(void)) _func)();
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(ResumeTransformFeedback)(void)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[620];
+ ((void (APIENTRY *)(void)) _func)();
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(ClearDepthf)(GLclampf depth)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[621];
+ ((void (APIENTRY *)(GLclampf depth)) _func)(depth);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(DepthRangef)(GLclampf zNear, GLclampf zFar)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[622];
+ ((void (APIENTRY *)(GLclampf zNear, GLclampf zFar)) _func)(zNear, zFar);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(GetShaderPrecisionFormat)(GLenum shadertype, GLenum precisiontype, GLint *range, GLint *precision)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[623];
+ ((void (APIENTRY *)(GLenum shadertype, GLenum precisiontype, GLint *range, GLint *precision)) _func)(shadertype, precisiontype, range, precision);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(ReleaseShaderCompiler)(void)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[624];
+ ((void (APIENTRY *)(void)) _func)();
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(ShaderBinary)(GLsizei n, const GLuint *shaders, GLenum binaryformat, const GLvoid *binary, GLsizei length)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[625];
+ ((void (APIENTRY *)(GLsizei n, const GLuint *shaders, GLenum binaryformat, const GLvoid *binary, GLsizei length)) _func)(n, shaders, binaryformat, binary, length);
+}
+
+GLAPI GLenum APIENTRY GLAPI_PREFIX(GetGraphicsResetStatusARB)(void)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[629];
+ return ((GLenum (APIENTRY *)(void)) _func)();
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(GetnColorTableARB)(GLenum target, GLenum format, GLenum type, GLsizei bufSize, GLvoid *table)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[630];
+ ((void (APIENTRY *)(GLenum target, GLenum format, GLenum type, GLsizei bufSize, GLvoid *table)) _func)(target, format, type, bufSize, table);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(GetnCompressedTexImageARB)(GLenum target, GLint lod, GLsizei bufSize, GLvoid *img)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[631];
+ ((void (APIENTRY *)(GLenum target, GLint lod, GLsizei bufSize, GLvoid *img)) _func)(target, lod, bufSize, img);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(GetnConvolutionFilterARB)(GLenum target, GLenum format, GLenum type, GLsizei bufSize, GLvoid *image)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[632];
+ ((void (APIENTRY *)(GLenum target, GLenum format, GLenum type, GLsizei bufSize, GLvoid *image)) _func)(target, format, type, bufSize, image);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(GetnHistogramARB)(GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, GLvoid *values)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[633];
+ ((void (APIENTRY *)(GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, GLvoid *values)) _func)(target, reset, format, type, bufSize, values);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(GetnMapdvARB)(GLenum target, GLenum query, GLsizei bufSize, GLdouble *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[634];
+ ((void (APIENTRY *)(GLenum target, GLenum query, GLsizei bufSize, GLdouble *v)) _func)(target, query, bufSize, v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(GetnMapfvARB)(GLenum target, GLenum query, GLsizei bufSize, GLfloat *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[635];
+ ((void (APIENTRY *)(GLenum target, GLenum query, GLsizei bufSize, GLfloat *v)) _func)(target, query, bufSize, v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(GetnMapivARB)(GLenum target, GLenum query, GLsizei bufSize, GLint *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[636];
+ ((void (APIENTRY *)(GLenum target, GLenum query, GLsizei bufSize, GLint *v)) _func)(target, query, bufSize, v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(GetnMinmaxARB)(GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, GLvoid *values)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[637];
+ ((void (APIENTRY *)(GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, GLvoid *values)) _func)(target, reset, format, type, bufSize, values);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(GetnPixelMapfvARB)(GLenum map, GLsizei bufSize, GLfloat *values)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[638];
+ ((void (APIENTRY *)(GLenum map, GLsizei bufSize, GLfloat *values)) _func)(map, bufSize, values);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(GetnPixelMapuivARB)(GLenum map, GLsizei bufSize, GLuint *values)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[639];
+ ((void (APIENTRY *)(GLenum map, GLsizei bufSize, GLuint *values)) _func)(map, bufSize, values);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(GetnPixelMapusvARB)(GLenum map, GLsizei bufSize, GLushort *values)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[640];
+ ((void (APIENTRY *)(GLenum map, GLsizei bufSize, GLushort *values)) _func)(map, bufSize, values);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(GetnPolygonStippleARB)(GLsizei bufSize, GLubyte *pattern)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[641];
+ ((void (APIENTRY *)(GLsizei bufSize, GLubyte *pattern)) _func)(bufSize, pattern);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(GetnSeparableFilterARB)(GLenum target, GLenum format, GLenum type, GLsizei rowBufSize, GLvoid *row, GLsizei columnBufSize, GLvoid *column, GLvoid *span)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[642];
+ ((void (APIENTRY *)(GLenum target, GLenum format, GLenum type, GLsizei rowBufSize, GLvoid *row, GLsizei columnBufSize, GLvoid *column, GLvoid *span)) _func)(target, format, type, rowBufSize, row, columnBufSize, column, span);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(GetnTexImageARB)(GLenum target, GLint level, GLenum format, GLenum type, GLsizei bufSize, GLvoid *img)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[643];
+ ((void (APIENTRY *)(GLenum target, GLint level, GLenum format, GLenum type, GLsizei bufSize, GLvoid *img)) _func)(target, level, format, type, bufSize, img);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(GetnUniformdvARB)(GLhandleARB program, GLint location, GLsizei bufSize, GLdouble *params)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[644];
+ ((void (APIENTRY *)(GLhandleARB program, GLint location, GLsizei bufSize, GLdouble *params)) _func)(program, location, bufSize, params);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(GetnUniformfvARB)(GLhandleARB program, GLint location, GLsizei bufSize, GLfloat *params)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[645];
+ ((void (APIENTRY *)(GLhandleARB program, GLint location, GLsizei bufSize, GLfloat *params)) _func)(program, location, bufSize, params);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(GetnUniformivARB)(GLhandleARB program, GLint location, GLsizei bufSize, GLint *params)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[646];
+ ((void (APIENTRY *)(GLhandleARB program, GLint location, GLsizei bufSize, GLint *params)) _func)(program, location, bufSize, params);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(GetnUniformuivARB)(GLhandleARB program, GLint location, GLsizei bufSize, GLuint *params)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[647];
+ ((void (APIENTRY *)(GLhandleARB program, GLint location, GLsizei bufSize, GLuint *params)) _func)(program, location, bufSize, params);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(ReadnPixelsARB)(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, GLvoid *data)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[648];
+ ((void (APIENTRY *)(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, GLvoid *data)) _func)(x, y, width, height, format, type, bufSize, data);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(PolygonOffsetEXT)(GLfloat factor, GLfloat bias)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[649];
+ ((void (APIENTRY *)(GLfloat factor, GLfloat bias)) _func)(factor, bias);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(ColorPointerEXT)(GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[668];
+ ((void (APIENTRY *)(GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer)) _func)(size, type, stride, count, pointer);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(EdgeFlagPointerEXT)(GLsizei stride, GLsizei count, const GLboolean *pointer)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[669];
+ ((void (APIENTRY *)(GLsizei stride, GLsizei count, const GLboolean *pointer)) _func)(stride, count, pointer);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(IndexPointerEXT)(GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[670];
+ ((void (APIENTRY *)(GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer)) _func)(type, stride, count, pointer);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(NormalPointerEXT)(GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[671];
+ ((void (APIENTRY *)(GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer)) _func)(type, stride, count, pointer);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(TexCoordPointerEXT)(GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[672];
+ ((void (APIENTRY *)(GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer)) _func)(size, type, stride, count, pointer);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(VertexPointerEXT)(GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[673];
+ ((void (APIENTRY *)(GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer)) _func)(size, type, stride, count, pointer);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(PointParameterfEXT)(GLenum pname, GLfloat param)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[674];
+ ((void (APIENTRY *)(GLenum pname, GLfloat param)) _func)(pname, param);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(PointParameterf)(GLenum pname, GLfloat param)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[674];
+ ((void (APIENTRY *)(GLenum pname, GLfloat param)) _func)(pname, param);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(PointParameterfARB)(GLenum pname, GLfloat param)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[674];
+ ((void (APIENTRY *)(GLenum pname, GLfloat param)) _func)(pname, param);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(PointParameterfvEXT)(GLenum pname, const GLfloat *params)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[675];
+ ((void (APIENTRY *)(GLenum pname, const GLfloat *params)) _func)(pname, params);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(PointParameterfv)(GLenum pname, const GLfloat *params)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[675];
+ ((void (APIENTRY *)(GLenum pname, const GLfloat *params)) _func)(pname, params);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(PointParameterfvARB)(GLenum pname, const GLfloat *params)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[675];
+ ((void (APIENTRY *)(GLenum pname, const GLfloat *params)) _func)(pname, params);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(LockArraysEXT)(GLint first, GLsizei count)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[676];
+ ((void (APIENTRY *)(GLint first, GLsizei count)) _func)(first, count);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(UnlockArraysEXT)(void)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[677];
+ ((void (APIENTRY *)(void)) _func)();
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(SecondaryColor3bEXT)(GLbyte red, GLbyte green, GLbyte blue)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[678];
+ ((void (APIENTRY *)(GLbyte red, GLbyte green, GLbyte blue)) _func)(red, green, blue);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(SecondaryColor3b)(GLbyte red, GLbyte green, GLbyte blue)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[678];
+ ((void (APIENTRY *)(GLbyte red, GLbyte green, GLbyte blue)) _func)(red, green, blue);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(SecondaryColor3bvEXT)(const GLbyte *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[679];
+ ((void (APIENTRY *)(const GLbyte *v)) _func)(v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(SecondaryColor3bv)(const GLbyte *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[679];
+ ((void (APIENTRY *)(const GLbyte *v)) _func)(v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(SecondaryColor3dEXT)(GLdouble red, GLdouble green, GLdouble blue)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[680];
+ ((void (APIENTRY *)(GLdouble red, GLdouble green, GLdouble blue)) _func)(red, green, blue);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(SecondaryColor3d)(GLdouble red, GLdouble green, GLdouble blue)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[680];
+ ((void (APIENTRY *)(GLdouble red, GLdouble green, GLdouble blue)) _func)(red, green, blue);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(SecondaryColor3dvEXT)(const GLdouble *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[681];
+ ((void (APIENTRY *)(const GLdouble *v)) _func)(v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(SecondaryColor3dv)(const GLdouble *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[681];
+ ((void (APIENTRY *)(const GLdouble *v)) _func)(v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(SecondaryColor3fEXT)(GLfloat red, GLfloat green, GLfloat blue)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[682];
+ ((void (APIENTRY *)(GLfloat red, GLfloat green, GLfloat blue)) _func)(red, green, blue);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(SecondaryColor3f)(GLfloat red, GLfloat green, GLfloat blue)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[682];
+ ((void (APIENTRY *)(GLfloat red, GLfloat green, GLfloat blue)) _func)(red, green, blue);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(SecondaryColor3fvEXT)(const GLfloat *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[683];
+ ((void (APIENTRY *)(const GLfloat *v)) _func)(v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(SecondaryColor3fv)(const GLfloat *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[683];
+ ((void (APIENTRY *)(const GLfloat *v)) _func)(v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(SecondaryColor3iEXT)(GLint red, GLint green, GLint blue)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[684];
+ ((void (APIENTRY *)(GLint red, GLint green, GLint blue)) _func)(red, green, blue);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(SecondaryColor3i)(GLint red, GLint green, GLint blue)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[684];
+ ((void (APIENTRY *)(GLint red, GLint green, GLint blue)) _func)(red, green, blue);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(SecondaryColor3ivEXT)(const GLint *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[685];
+ ((void (APIENTRY *)(const GLint *v)) _func)(v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(SecondaryColor3iv)(const GLint *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[685];
+ ((void (APIENTRY *)(const GLint *v)) _func)(v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(SecondaryColor3sEXT)(GLshort red, GLshort green, GLshort blue)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[686];
+ ((void (APIENTRY *)(GLshort red, GLshort green, GLshort blue)) _func)(red, green, blue);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(SecondaryColor3s)(GLshort red, GLshort green, GLshort blue)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[686];
+ ((void (APIENTRY *)(GLshort red, GLshort green, GLshort blue)) _func)(red, green, blue);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(SecondaryColor3svEXT)(const GLshort *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[687];
+ ((void (APIENTRY *)(const GLshort *v)) _func)(v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(SecondaryColor3sv)(const GLshort *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[687];
+ ((void (APIENTRY *)(const GLshort *v)) _func)(v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(SecondaryColor3ubEXT)(GLubyte red, GLubyte green, GLubyte blue)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[688];
+ ((void (APIENTRY *)(GLubyte red, GLubyte green, GLubyte blue)) _func)(red, green, blue);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(SecondaryColor3ub)(GLubyte red, GLubyte green, GLubyte blue)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[688];
+ ((void (APIENTRY *)(GLubyte red, GLubyte green, GLubyte blue)) _func)(red, green, blue);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(SecondaryColor3ubvEXT)(const GLubyte *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[689];
+ ((void (APIENTRY *)(const GLubyte *v)) _func)(v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(SecondaryColor3ubv)(const GLubyte *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[689];
+ ((void (APIENTRY *)(const GLubyte *v)) _func)(v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(SecondaryColor3uiEXT)(GLuint red, GLuint green, GLuint blue)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[690];
+ ((void (APIENTRY *)(GLuint red, GLuint green, GLuint blue)) _func)(red, green, blue);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(SecondaryColor3ui)(GLuint red, GLuint green, GLuint blue)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[690];
+ ((void (APIENTRY *)(GLuint red, GLuint green, GLuint blue)) _func)(red, green, blue);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(SecondaryColor3uivEXT)(const GLuint *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[691];
+ ((void (APIENTRY *)(const GLuint *v)) _func)(v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(SecondaryColor3uiv)(const GLuint *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[691];
+ ((void (APIENTRY *)(const GLuint *v)) _func)(v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(SecondaryColor3usEXT)(GLushort red, GLushort green, GLushort blue)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[692];
+ ((void (APIENTRY *)(GLushort red, GLushort green, GLushort blue)) _func)(red, green, blue);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(SecondaryColor3us)(GLushort red, GLushort green, GLushort blue)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[692];
+ ((void (APIENTRY *)(GLushort red, GLushort green, GLushort blue)) _func)(red, green, blue);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(SecondaryColor3usvEXT)(const GLushort *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[693];
+ ((void (APIENTRY *)(const GLushort *v)) _func)(v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(SecondaryColor3usv)(const GLushort *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[693];
+ ((void (APIENTRY *)(const GLushort *v)) _func)(v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(SecondaryColorPointerEXT)(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[694];
+ ((void (APIENTRY *)(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer)) _func)(size, type, stride, pointer);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(SecondaryColorPointer)(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[694];
+ ((void (APIENTRY *)(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer)) _func)(size, type, stride, pointer);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(MultiDrawArraysEXT)(GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[695];
+ ((void (APIENTRY *)(GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount)) _func)(mode, first, count, primcount);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(MultiDrawArrays)(GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[695];
+ ((void (APIENTRY *)(GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount)) _func)(mode, first, count, primcount);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(MultiDrawElementsEXT)(GLenum mode, const GLsizei *count, GLenum type, const GLvoid **indices, GLsizei primcount)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[696];
+ ((void (APIENTRY *)(GLenum mode, const GLsizei *count, GLenum type, const GLvoid **indices, GLsizei primcount)) _func)(mode, count, type, indices, primcount);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(MultiDrawElements)(GLenum mode, const GLsizei *count, GLenum type, const GLvoid **indices, GLsizei primcount)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[696];
+ ((void (APIENTRY *)(GLenum mode, const GLsizei *count, GLenum type, const GLvoid **indices, GLsizei primcount)) _func)(mode, count, type, indices, primcount);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(FogCoordPointerEXT)(GLenum type, GLsizei stride, const GLvoid *pointer)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[697];
+ ((void (APIENTRY *)(GLenum type, GLsizei stride, const GLvoid *pointer)) _func)(type, stride, pointer);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(FogCoordPointer)(GLenum type, GLsizei stride, const GLvoid *pointer)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[697];
+ ((void (APIENTRY *)(GLenum type, GLsizei stride, const GLvoid *pointer)) _func)(type, stride, pointer);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(FogCoorddEXT)(GLdouble coord)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[698];
+ ((void (APIENTRY *)(GLdouble coord)) _func)(coord);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(FogCoordd)(GLdouble coord)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[698];
+ ((void (APIENTRY *)(GLdouble coord)) _func)(coord);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(FogCoorddvEXT)(const GLdouble *coord)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[699];
+ ((void (APIENTRY *)(const GLdouble *coord)) _func)(coord);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(FogCoorddv)(const GLdouble *coord)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[699];
+ ((void (APIENTRY *)(const GLdouble *coord)) _func)(coord);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(FogCoordfEXT)(GLfloat coord)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[700];
+ ((void (APIENTRY *)(GLfloat coord)) _func)(coord);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(FogCoordf)(GLfloat coord)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[700];
+ ((void (APIENTRY *)(GLfloat coord)) _func)(coord);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(FogCoordfvEXT)(const GLfloat *coord)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[701];
+ ((void (APIENTRY *)(const GLfloat *coord)) _func)(coord);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(FogCoordfv)(const GLfloat *coord)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[701];
+ ((void (APIENTRY *)(const GLfloat *coord)) _func)(coord);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(BlendFuncSeparateEXT)(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[703];
+ ((void (APIENTRY *)(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha)) _func)(sfactorRGB, dfactorRGB, sfactorAlpha, dfactorAlpha);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(BlendFuncSeparate)(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[703];
+ ((void (APIENTRY *)(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha)) _func)(sfactorRGB, dfactorRGB, sfactorAlpha, dfactorAlpha);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(FlushVertexArrayRangeNV)(void)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[704];
+ ((void (APIENTRY *)(void)) _func)();
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(VertexArrayRangeNV)(GLsizei length, const GLvoid *pointer)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[705];
+ ((void (APIENTRY *)(GLsizei length, const GLvoid *pointer)) _func)(length, pointer);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(CombinerInputNV)(GLenum stage, GLenum portion, GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[706];
+ ((void (APIENTRY *)(GLenum stage, GLenum portion, GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage)) _func)(stage, portion, variable, input, mapping, componentUsage);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(CombinerOutputNV)(GLenum stage, GLenum portion, GLenum abOutput, GLenum cdOutput, GLenum sumOutput, GLenum scale, GLenum bias, GLboolean abDotProduct, GLboolean cdDotProduct, GLboolean muxSum)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[707];
+ ((void (APIENTRY *)(GLenum stage, GLenum portion, GLenum abOutput, GLenum cdOutput, GLenum sumOutput, GLenum scale, GLenum bias, GLboolean abDotProduct, GLboolean cdDotProduct, GLboolean muxSum)) _func)(stage, portion, abOutput, cdOutput, sumOutput, scale, bias, abDotProduct, cdDotProduct, muxSum);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(CombinerParameterfNV)(GLenum pname, GLfloat param)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[708];
+ ((void (APIENTRY *)(GLenum pname, GLfloat param)) _func)(pname, param);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(CombinerParameterfvNV)(GLenum pname, const GLfloat *params)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[709];
+ ((void (APIENTRY *)(GLenum pname, const GLfloat *params)) _func)(pname, params);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(CombinerParameteriNV)(GLenum pname, GLint param)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[710];
+ ((void (APIENTRY *)(GLenum pname, GLint param)) _func)(pname, param);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(CombinerParameterivNV)(GLenum pname, const GLint *params)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[711];
+ ((void (APIENTRY *)(GLenum pname, const GLint *params)) _func)(pname, params);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(FinalCombinerInputNV)(GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[712];
+ ((void (APIENTRY *)(GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage)) _func)(variable, input, mapping, componentUsage);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(GetCombinerInputParameterfvNV)(GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLfloat *params)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[713];
+ ((void (APIENTRY *)(GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLfloat *params)) _func)(stage, portion, variable, pname, params);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(GetCombinerInputParameterivNV)(GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLint *params)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[714];
+ ((void (APIENTRY *)(GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLint *params)) _func)(stage, portion, variable, pname, params);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(GetCombinerOutputParameterfvNV)(GLenum stage, GLenum portion, GLenum pname, GLfloat *params)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[715];
+ ((void (APIENTRY *)(GLenum stage, GLenum portion, GLenum pname, GLfloat *params)) _func)(stage, portion, pname, params);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(GetCombinerOutputParameterivNV)(GLenum stage, GLenum portion, GLenum pname, GLint *params)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[716];
+ ((void (APIENTRY *)(GLenum stage, GLenum portion, GLenum pname, GLint *params)) _func)(stage, portion, pname, params);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(GetFinalCombinerInputParameterfvNV)(GLenum variable, GLenum pname, GLfloat *params)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[717];
+ ((void (APIENTRY *)(GLenum variable, GLenum pname, GLfloat *params)) _func)(variable, pname, params);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(GetFinalCombinerInputParameterivNV)(GLenum variable, GLenum pname, GLint *params)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[718];
+ ((void (APIENTRY *)(GLenum variable, GLenum pname, GLint *params)) _func)(variable, pname, params);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(ResizeBuffersMESA)(void)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[719];
+ ((void (APIENTRY *)(void)) _func)();
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(WindowPos2dMESA)(GLdouble x, GLdouble y)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[720];
+ ((void (APIENTRY *)(GLdouble x, GLdouble y)) _func)(x, y);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(WindowPos2d)(GLdouble x, GLdouble y)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[720];
+ ((void (APIENTRY *)(GLdouble x, GLdouble y)) _func)(x, y);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(WindowPos2dARB)(GLdouble x, GLdouble y)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[720];
+ ((void (APIENTRY *)(GLdouble x, GLdouble y)) _func)(x, y);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(WindowPos2dvMESA)(const GLdouble *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[721];
+ ((void (APIENTRY *)(const GLdouble *v)) _func)(v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(WindowPos2dv)(const GLdouble *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[721];
+ ((void (APIENTRY *)(const GLdouble *v)) _func)(v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(WindowPos2dvARB)(const GLdouble *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[721];
+ ((void (APIENTRY *)(const GLdouble *v)) _func)(v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(WindowPos2fMESA)(GLfloat x, GLfloat y)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[722];
+ ((void (APIENTRY *)(GLfloat x, GLfloat y)) _func)(x, y);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(WindowPos2f)(GLfloat x, GLfloat y)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[722];
+ ((void (APIENTRY *)(GLfloat x, GLfloat y)) _func)(x, y);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(WindowPos2fARB)(GLfloat x, GLfloat y)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[722];
+ ((void (APIENTRY *)(GLfloat x, GLfloat y)) _func)(x, y);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(WindowPos2fvMESA)(const GLfloat *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[723];
+ ((void (APIENTRY *)(const GLfloat *v)) _func)(v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(WindowPos2fv)(const GLfloat *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[723];
+ ((void (APIENTRY *)(const GLfloat *v)) _func)(v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(WindowPos2fvARB)(const GLfloat *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[723];
+ ((void (APIENTRY *)(const GLfloat *v)) _func)(v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(WindowPos2iMESA)(GLint x, GLint y)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[724];
+ ((void (APIENTRY *)(GLint x, GLint y)) _func)(x, y);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(WindowPos2i)(GLint x, GLint y)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[724];
+ ((void (APIENTRY *)(GLint x, GLint y)) _func)(x, y);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(WindowPos2iARB)(GLint x, GLint y)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[724];
+ ((void (APIENTRY *)(GLint x, GLint y)) _func)(x, y);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(WindowPos2ivMESA)(const GLint *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[725];
+ ((void (APIENTRY *)(const GLint *v)) _func)(v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(WindowPos2iv)(const GLint *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[725];
+ ((void (APIENTRY *)(const GLint *v)) _func)(v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(WindowPos2ivARB)(const GLint *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[725];
+ ((void (APIENTRY *)(const GLint *v)) _func)(v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(WindowPos2sMESA)(GLshort x, GLshort y)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[726];
+ ((void (APIENTRY *)(GLshort x, GLshort y)) _func)(x, y);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(WindowPos2s)(GLshort x, GLshort y)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[726];
+ ((void (APIENTRY *)(GLshort x, GLshort y)) _func)(x, y);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(WindowPos2sARB)(GLshort x, GLshort y)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[726];
+ ((void (APIENTRY *)(GLshort x, GLshort y)) _func)(x, y);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(WindowPos2svMESA)(const GLshort *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[727];
+ ((void (APIENTRY *)(const GLshort *v)) _func)(v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(WindowPos2sv)(const GLshort *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[727];
+ ((void (APIENTRY *)(const GLshort *v)) _func)(v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(WindowPos2svARB)(const GLshort *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[727];
+ ((void (APIENTRY *)(const GLshort *v)) _func)(v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(WindowPos3dMESA)(GLdouble x, GLdouble y, GLdouble z)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[728];
+ ((void (APIENTRY *)(GLdouble x, GLdouble y, GLdouble z)) _func)(x, y, z);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(WindowPos3d)(GLdouble x, GLdouble y, GLdouble z)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[728];
+ ((void (APIENTRY *)(GLdouble x, GLdouble y, GLdouble z)) _func)(x, y, z);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(WindowPos3dARB)(GLdouble x, GLdouble y, GLdouble z)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[728];
+ ((void (APIENTRY *)(GLdouble x, GLdouble y, GLdouble z)) _func)(x, y, z);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(WindowPos3dvMESA)(const GLdouble *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[729];
+ ((void (APIENTRY *)(const GLdouble *v)) _func)(v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(WindowPos3dv)(const GLdouble *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[729];
+ ((void (APIENTRY *)(const GLdouble *v)) _func)(v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(WindowPos3dvARB)(const GLdouble *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[729];
+ ((void (APIENTRY *)(const GLdouble *v)) _func)(v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(WindowPos3fMESA)(GLfloat x, GLfloat y, GLfloat z)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[730];
+ ((void (APIENTRY *)(GLfloat x, GLfloat y, GLfloat z)) _func)(x, y, z);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(WindowPos3f)(GLfloat x, GLfloat y, GLfloat z)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[730];
+ ((void (APIENTRY *)(GLfloat x, GLfloat y, GLfloat z)) _func)(x, y, z);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(WindowPos3fARB)(GLfloat x, GLfloat y, GLfloat z)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[730];
+ ((void (APIENTRY *)(GLfloat x, GLfloat y, GLfloat z)) _func)(x, y, z);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(WindowPos3fvMESA)(const GLfloat *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[731];
+ ((void (APIENTRY *)(const GLfloat *v)) _func)(v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(WindowPos3fv)(const GLfloat *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[731];
+ ((void (APIENTRY *)(const GLfloat *v)) _func)(v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(WindowPos3fvARB)(const GLfloat *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[731];
+ ((void (APIENTRY *)(const GLfloat *v)) _func)(v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(WindowPos3iMESA)(GLint x, GLint y, GLint z)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[732];
+ ((void (APIENTRY *)(GLint x, GLint y, GLint z)) _func)(x, y, z);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(WindowPos3i)(GLint x, GLint y, GLint z)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[732];
+ ((void (APIENTRY *)(GLint x, GLint y, GLint z)) _func)(x, y, z);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(WindowPos3iARB)(GLint x, GLint y, GLint z)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[732];
+ ((void (APIENTRY *)(GLint x, GLint y, GLint z)) _func)(x, y, z);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(WindowPos3ivMESA)(const GLint *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[733];
+ ((void (APIENTRY *)(const GLint *v)) _func)(v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(WindowPos3iv)(const GLint *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[733];
+ ((void (APIENTRY *)(const GLint *v)) _func)(v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(WindowPos3ivARB)(const GLint *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[733];
+ ((void (APIENTRY *)(const GLint *v)) _func)(v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(WindowPos3sMESA)(GLshort x, GLshort y, GLshort z)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[734];
+ ((void (APIENTRY *)(GLshort x, GLshort y, GLshort z)) _func)(x, y, z);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(WindowPos3s)(GLshort x, GLshort y, GLshort z)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[734];
+ ((void (APIENTRY *)(GLshort x, GLshort y, GLshort z)) _func)(x, y, z);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(WindowPos3sARB)(GLshort x, GLshort y, GLshort z)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[734];
+ ((void (APIENTRY *)(GLshort x, GLshort y, GLshort z)) _func)(x, y, z);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(WindowPos3svMESA)(const GLshort *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[735];
+ ((void (APIENTRY *)(const GLshort *v)) _func)(v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(WindowPos3sv)(const GLshort *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[735];
+ ((void (APIENTRY *)(const GLshort *v)) _func)(v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(WindowPos3svARB)(const GLshort *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[735];
+ ((void (APIENTRY *)(const GLshort *v)) _func)(v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(WindowPos4dMESA)(GLdouble x, GLdouble y, GLdouble z, GLdouble w)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[736];
+ ((void (APIENTRY *)(GLdouble x, GLdouble y, GLdouble z, GLdouble w)) _func)(x, y, z, w);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(WindowPos4dvMESA)(const GLdouble *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[737];
+ ((void (APIENTRY *)(const GLdouble *v)) _func)(v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(WindowPos4fMESA)(GLfloat x, GLfloat y, GLfloat z, GLfloat w)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[738];
+ ((void (APIENTRY *)(GLfloat x, GLfloat y, GLfloat z, GLfloat w)) _func)(x, y, z, w);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(WindowPos4fvMESA)(const GLfloat *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[739];
+ ((void (APIENTRY *)(const GLfloat *v)) _func)(v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(WindowPos4iMESA)(GLint x, GLint y, GLint z, GLint w)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[740];
+ ((void (APIENTRY *)(GLint x, GLint y, GLint z, GLint w)) _func)(x, y, z, w);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(WindowPos4ivMESA)(const GLint *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[741];
+ ((void (APIENTRY *)(const GLint *v)) _func)(v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(WindowPos4sMESA)(GLshort x, GLshort y, GLshort z, GLshort w)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[742];
+ ((void (APIENTRY *)(GLshort x, GLshort y, GLshort z, GLshort w)) _func)(x, y, z, w);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(WindowPos4svMESA)(const GLshort *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[743];
+ ((void (APIENTRY *)(const GLshort *v)) _func)(v);
+}
+
+GLAPI GLboolean APIENTRY GLAPI_PREFIX(AreProgramsResidentNV)(GLsizei n, const GLuint *ids, GLboolean *residences)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[753];
+ return ((GLboolean (APIENTRY *)(GLsizei n, const GLuint *ids, GLboolean *residences)) _func)(n, ids, residences);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(BindProgramNV)(GLenum target, GLuint program)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[754];
+ ((void (APIENTRY *)(GLenum target, GLuint program)) _func)(target, program);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(BindProgramARB)(GLenum target, GLuint program)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[754];
+ ((void (APIENTRY *)(GLenum target, GLuint program)) _func)(target, program);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(DeleteProgramsNV)(GLsizei n, const GLuint *programs)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[755];
+ ((void (APIENTRY *)(GLsizei n, const GLuint *programs)) _func)(n, programs);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(DeleteProgramsARB)(GLsizei n, const GLuint *programs)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[755];
+ ((void (APIENTRY *)(GLsizei n, const GLuint *programs)) _func)(n, programs);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(ExecuteProgramNV)(GLenum target, GLuint id, const GLfloat *params)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[756];
+ ((void (APIENTRY *)(GLenum target, GLuint id, const GLfloat *params)) _func)(target, id, params);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(GenProgramsNV)(GLsizei n, GLuint *programs)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[757];
+ ((void (APIENTRY *)(GLsizei n, GLuint *programs)) _func)(n, programs);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(GenProgramsARB)(GLsizei n, GLuint *programs)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[757];
+ ((void (APIENTRY *)(GLsizei n, GLuint *programs)) _func)(n, programs);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(GetProgramParameterdvNV)(GLenum target, GLuint index, GLenum pname, GLdouble *params)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[758];
+ ((void (APIENTRY *)(GLenum target, GLuint index, GLenum pname, GLdouble *params)) _func)(target, index, pname, params);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(GetProgramParameterfvNV)(GLenum target, GLuint index, GLenum pname, GLfloat *params)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[759];
+ ((void (APIENTRY *)(GLenum target, GLuint index, GLenum pname, GLfloat *params)) _func)(target, index, pname, params);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(GetProgramStringNV)(GLuint id, GLenum pname, GLubyte *program)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[760];
+ ((void (APIENTRY *)(GLuint id, GLenum pname, GLubyte *program)) _func)(id, pname, program);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(GetProgramivNV)(GLuint id, GLenum pname, GLint *params)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[761];
+ ((void (APIENTRY *)(GLuint id, GLenum pname, GLint *params)) _func)(id, pname, params);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(GetTrackMatrixivNV)(GLenum target, GLuint address, GLenum pname, GLint *params)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[762];
+ ((void (APIENTRY *)(GLenum target, GLuint address, GLenum pname, GLint *params)) _func)(target, address, pname, params);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(GetVertexAttribPointervNV)(GLuint index, GLenum pname, GLvoid **pointer)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[763];
+ ((void (APIENTRY *)(GLuint index, GLenum pname, GLvoid **pointer)) _func)(index, pname, pointer);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(GetVertexAttribPointerv)(GLuint index, GLenum pname, GLvoid **pointer)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[763];
+ ((void (APIENTRY *)(GLuint index, GLenum pname, GLvoid **pointer)) _func)(index, pname, pointer);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(GetVertexAttribPointervARB)(GLuint index, GLenum pname, GLvoid **pointer)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[763];
+ ((void (APIENTRY *)(GLuint index, GLenum pname, GLvoid **pointer)) _func)(index, pname, pointer);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(GetVertexAttribdvNV)(GLuint index, GLenum pname, GLdouble *params)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[764];
+ ((void (APIENTRY *)(GLuint index, GLenum pname, GLdouble *params)) _func)(index, pname, params);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(GetVertexAttribfvNV)(GLuint index, GLenum pname, GLfloat *params)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[765];
+ ((void (APIENTRY *)(GLuint index, GLenum pname, GLfloat *params)) _func)(index, pname, params);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(GetVertexAttribivNV)(GLuint index, GLenum pname, GLint *params)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[766];
+ ((void (APIENTRY *)(GLuint index, GLenum pname, GLint *params)) _func)(index, pname, params);
+}
+
+GLAPI GLboolean APIENTRY GLAPI_PREFIX(IsProgramNV)(GLuint program)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[767];
+ return ((GLboolean (APIENTRY *)(GLuint program)) _func)(program);
+}
+
+GLAPI GLboolean APIENTRY GLAPI_PREFIX(IsProgramARB)(GLuint program)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[767];
+ return ((GLboolean (APIENTRY *)(GLuint program)) _func)(program);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(LoadProgramNV)(GLenum target, GLuint id, GLsizei len, const GLubyte *program)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[768];
+ ((void (APIENTRY *)(GLenum target, GLuint id, GLsizei len, const GLubyte *program)) _func)(target, id, len, program);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(ProgramParameters4dvNV)(GLenum target, GLuint index, GLsizei num, const GLdouble *params)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[769];
+ ((void (APIENTRY *)(GLenum target, GLuint index, GLsizei num, const GLdouble *params)) _func)(target, index, num, params);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(ProgramParameters4fvNV)(GLenum target, GLuint index, GLsizei num, const GLfloat *params)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[770];
+ ((void (APIENTRY *)(GLenum target, GLuint index, GLsizei num, const GLfloat *params)) _func)(target, index, num, params);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(RequestResidentProgramsNV)(GLsizei n, const GLuint *ids)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[771];
+ ((void (APIENTRY *)(GLsizei n, const GLuint *ids)) _func)(n, ids);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(TrackMatrixNV)(GLenum target, GLuint address, GLenum matrix, GLenum transform)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[772];
+ ((void (APIENTRY *)(GLenum target, GLuint address, GLenum matrix, GLenum transform)) _func)(target, address, matrix, transform);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib1dNV)(GLuint index, GLdouble x)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[773];
+ ((void (APIENTRY *)(GLuint index, GLdouble x)) _func)(index, x);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib1dvNV)(GLuint index, const GLdouble *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[774];
+ ((void (APIENTRY *)(GLuint index, const GLdouble *v)) _func)(index, v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib1fNV)(GLuint index, GLfloat x)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[775];
+ ((void (APIENTRY *)(GLuint index, GLfloat x)) _func)(index, x);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib1fvNV)(GLuint index, const GLfloat *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[776];
+ ((void (APIENTRY *)(GLuint index, const GLfloat *v)) _func)(index, v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib1sNV)(GLuint index, GLshort x)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[777];
+ ((void (APIENTRY *)(GLuint index, GLshort x)) _func)(index, x);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib1svNV)(GLuint index, const GLshort *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[778];
+ ((void (APIENTRY *)(GLuint index, const GLshort *v)) _func)(index, v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib2dNV)(GLuint index, GLdouble x, GLdouble y)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[779];
+ ((void (APIENTRY *)(GLuint index, GLdouble x, GLdouble y)) _func)(index, x, y);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib2dvNV)(GLuint index, const GLdouble *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[780];
+ ((void (APIENTRY *)(GLuint index, const GLdouble *v)) _func)(index, v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib2fNV)(GLuint index, GLfloat x, GLfloat y)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[781];
+ ((void (APIENTRY *)(GLuint index, GLfloat x, GLfloat y)) _func)(index, x, y);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib2fvNV)(GLuint index, const GLfloat *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[782];
+ ((void (APIENTRY *)(GLuint index, const GLfloat *v)) _func)(index, v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib2sNV)(GLuint index, GLshort x, GLshort y)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[783];
+ ((void (APIENTRY *)(GLuint index, GLshort x, GLshort y)) _func)(index, x, y);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib2svNV)(GLuint index, const GLshort *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[784];
+ ((void (APIENTRY *)(GLuint index, const GLshort *v)) _func)(index, v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib3dNV)(GLuint index, GLdouble x, GLdouble y, GLdouble z)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[785];
+ ((void (APIENTRY *)(GLuint index, GLdouble x, GLdouble y, GLdouble z)) _func)(index, x, y, z);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib3dvNV)(GLuint index, const GLdouble *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[786];
+ ((void (APIENTRY *)(GLuint index, const GLdouble *v)) _func)(index, v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib3fNV)(GLuint index, GLfloat x, GLfloat y, GLfloat z)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[787];
+ ((void (APIENTRY *)(GLuint index, GLfloat x, GLfloat y, GLfloat z)) _func)(index, x, y, z);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib3fvNV)(GLuint index, const GLfloat *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[788];
+ ((void (APIENTRY *)(GLuint index, const GLfloat *v)) _func)(index, v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib3sNV)(GLuint index, GLshort x, GLshort y, GLshort z)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[789];
+ ((void (APIENTRY *)(GLuint index, GLshort x, GLshort y, GLshort z)) _func)(index, x, y, z);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib3svNV)(GLuint index, const GLshort *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[790];
+ ((void (APIENTRY *)(GLuint index, const GLshort *v)) _func)(index, v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib4dNV)(GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[791];
+ ((void (APIENTRY *)(GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w)) _func)(index, x, y, z, w);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib4dvNV)(GLuint index, const GLdouble *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[792];
+ ((void (APIENTRY *)(GLuint index, const GLdouble *v)) _func)(index, v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib4fNV)(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[793];
+ ((void (APIENTRY *)(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w)) _func)(index, x, y, z, w);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib4fvNV)(GLuint index, const GLfloat *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[794];
+ ((void (APIENTRY *)(GLuint index, const GLfloat *v)) _func)(index, v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib4sNV)(GLuint index, GLshort x, GLshort y, GLshort z, GLshort w)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[795];
+ ((void (APIENTRY *)(GLuint index, GLshort x, GLshort y, GLshort z, GLshort w)) _func)(index, x, y, z, w);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib4svNV)(GLuint index, const GLshort *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[796];
+ ((void (APIENTRY *)(GLuint index, const GLshort *v)) _func)(index, v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib4ubNV)(GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[797];
+ ((void (APIENTRY *)(GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w)) _func)(index, x, y, z, w);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttrib4ubvNV)(GLuint index, const GLubyte *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[798];
+ ((void (APIENTRY *)(GLuint index, const GLubyte *v)) _func)(index, v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribPointerNV)(GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[799];
+ ((void (APIENTRY *)(GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer)) _func)(index, size, type, stride, pointer);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribs1dvNV)(GLuint index, GLsizei n, const GLdouble *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[800];
+ ((void (APIENTRY *)(GLuint index, GLsizei n, const GLdouble *v)) _func)(index, n, v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribs1fvNV)(GLuint index, GLsizei n, const GLfloat *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[801];
+ ((void (APIENTRY *)(GLuint index, GLsizei n, const GLfloat *v)) _func)(index, n, v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribs1svNV)(GLuint index, GLsizei n, const GLshort *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[802];
+ ((void (APIENTRY *)(GLuint index, GLsizei n, const GLshort *v)) _func)(index, n, v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribs2dvNV)(GLuint index, GLsizei n, const GLdouble *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[803];
+ ((void (APIENTRY *)(GLuint index, GLsizei n, const GLdouble *v)) _func)(index, n, v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribs2fvNV)(GLuint index, GLsizei n, const GLfloat *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[804];
+ ((void (APIENTRY *)(GLuint index, GLsizei n, const GLfloat *v)) _func)(index, n, v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribs2svNV)(GLuint index, GLsizei n, const GLshort *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[805];
+ ((void (APIENTRY *)(GLuint index, GLsizei n, const GLshort *v)) _func)(index, n, v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribs3dvNV)(GLuint index, GLsizei n, const GLdouble *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[806];
+ ((void (APIENTRY *)(GLuint index, GLsizei n, const GLdouble *v)) _func)(index, n, v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribs3fvNV)(GLuint index, GLsizei n, const GLfloat *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[807];
+ ((void (APIENTRY *)(GLuint index, GLsizei n, const GLfloat *v)) _func)(index, n, v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribs3svNV)(GLuint index, GLsizei n, const GLshort *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[808];
+ ((void (APIENTRY *)(GLuint index, GLsizei n, const GLshort *v)) _func)(index, n, v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribs4dvNV)(GLuint index, GLsizei n, const GLdouble *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[809];
+ ((void (APIENTRY *)(GLuint index, GLsizei n, const GLdouble *v)) _func)(index, n, v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribs4fvNV)(GLuint index, GLsizei n, const GLfloat *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[810];
+ ((void (APIENTRY *)(GLuint index, GLsizei n, const GLfloat *v)) _func)(index, n, v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribs4svNV)(GLuint index, GLsizei n, const GLshort *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[811];
+ ((void (APIENTRY *)(GLuint index, GLsizei n, const GLshort *v)) _func)(index, n, v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribs4ubvNV)(GLuint index, GLsizei n, const GLubyte *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[812];
+ ((void (APIENTRY *)(GLuint index, GLsizei n, const GLubyte *v)) _func)(index, n, v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(GetTexBumpParameterfvATI)(GLenum pname, GLfloat *param)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[813];
+ ((void (APIENTRY *)(GLenum pname, GLfloat *param)) _func)(pname, param);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(GetTexBumpParameterivATI)(GLenum pname, GLint *param)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[814];
+ ((void (APIENTRY *)(GLenum pname, GLint *param)) _func)(pname, param);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(TexBumpParameterfvATI)(GLenum pname, const GLfloat *param)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[815];
+ ((void (APIENTRY *)(GLenum pname, const GLfloat *param)) _func)(pname, param);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(TexBumpParameterivATI)(GLenum pname, const GLint *param)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[816];
+ ((void (APIENTRY *)(GLenum pname, const GLint *param)) _func)(pname, param);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(AlphaFragmentOp1ATI)(GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[817];
+ ((void (APIENTRY *)(GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod)) _func)(op, dst, dstMod, arg1, arg1Rep, arg1Mod);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(AlphaFragmentOp2ATI)(GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[818];
+ ((void (APIENTRY *)(GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod)) _func)(op, dst, dstMod, arg1, arg1Rep, arg1Mod, arg2, arg2Rep, arg2Mod);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(AlphaFragmentOp3ATI)(GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[819];
+ ((void (APIENTRY *)(GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod)) _func)(op, dst, dstMod, arg1, arg1Rep, arg1Mod, arg2, arg2Rep, arg2Mod, arg3, arg3Rep, arg3Mod);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(BeginFragmentShaderATI)(void)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[820];
+ ((void (APIENTRY *)(void)) _func)();
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(BindFragmentShaderATI)(GLuint id)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[821];
+ ((void (APIENTRY *)(GLuint id)) _func)(id);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(ColorFragmentOp1ATI)(GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[822];
+ ((void (APIENTRY *)(GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod)) _func)(op, dst, dstMask, dstMod, arg1, arg1Rep, arg1Mod);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(ColorFragmentOp2ATI)(GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[823];
+ ((void (APIENTRY *)(GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod)) _func)(op, dst, dstMask, dstMod, arg1, arg1Rep, arg1Mod, arg2, arg2Rep, arg2Mod);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(ColorFragmentOp3ATI)(GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[824];
+ ((void (APIENTRY *)(GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod)) _func)(op, dst, dstMask, dstMod, arg1, arg1Rep, arg1Mod, arg2, arg2Rep, arg2Mod, arg3, arg3Rep, arg3Mod);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(DeleteFragmentShaderATI)(GLuint id)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[825];
+ ((void (APIENTRY *)(GLuint id)) _func)(id);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(EndFragmentShaderATI)(void)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[826];
+ ((void (APIENTRY *)(void)) _func)();
+}
+
+GLAPI GLuint APIENTRY GLAPI_PREFIX(GenFragmentShadersATI)(GLuint range)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[827];
+ return ((GLuint (APIENTRY *)(GLuint range)) _func)(range);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(PassTexCoordATI)(GLuint dst, GLuint coord, GLenum swizzle)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[828];
+ ((void (APIENTRY *)(GLuint dst, GLuint coord, GLenum swizzle)) _func)(dst, coord, swizzle);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(SampleMapATI)(GLuint dst, GLuint interp, GLenum swizzle)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[829];
+ ((void (APIENTRY *)(GLuint dst, GLuint interp, GLenum swizzle)) _func)(dst, interp, swizzle);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(SetFragmentShaderConstantATI)(GLuint dst, const GLfloat *value)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[830];
+ ((void (APIENTRY *)(GLuint dst, const GLfloat *value)) _func)(dst, value);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(PointParameteriNV)(GLenum pname, GLint param)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[831];
+ ((void (APIENTRY *)(GLenum pname, GLint param)) _func)(pname, param);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(PointParameteri)(GLenum pname, GLint param)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[831];
+ ((void (APIENTRY *)(GLenum pname, GLint param)) _func)(pname, param);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(PointParameterivNV)(GLenum pname, const GLint *params)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[832];
+ ((void (APIENTRY *)(GLenum pname, const GLint *params)) _func)(pname, params);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(PointParameteriv)(GLenum pname, const GLint *params)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[832];
+ ((void (APIENTRY *)(GLenum pname, const GLint *params)) _func)(pname, params);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(DeleteVertexArrays)(GLsizei n, const GLuint *arrays)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[835];
+ ((void (APIENTRY *)(GLsizei n, const GLuint *arrays)) _func)(n, arrays);
+}
+
+GLAPI GLboolean APIENTRY GLAPI_PREFIX(IsVertexArray)(GLuint array)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[837];
+ return ((GLboolean (APIENTRY *)(GLuint array)) _func)(array);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(GetProgramNamedParameterdvNV)(GLuint id, GLsizei len, const GLubyte *name, GLdouble *params)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[838];
+ ((void (APIENTRY *)(GLuint id, GLsizei len, const GLubyte *name, GLdouble *params)) _func)(id, len, name, params);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(GetProgramNamedParameterfvNV)(GLuint id, GLsizei len, const GLubyte *name, GLfloat *params)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[839];
+ ((void (APIENTRY *)(GLuint id, GLsizei len, const GLubyte *name, GLfloat *params)) _func)(id, len, name, params);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(ProgramNamedParameter4dNV)(GLuint id, GLsizei len, const GLubyte *name, GLdouble x, GLdouble y, GLdouble z, GLdouble w)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[840];
+ ((void (APIENTRY *)(GLuint id, GLsizei len, const GLubyte *name, GLdouble x, GLdouble y, GLdouble z, GLdouble w)) _func)(id, len, name, x, y, z, w);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(ProgramNamedParameter4dvNV)(GLuint id, GLsizei len, const GLubyte *name, const GLdouble *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[841];
+ ((void (APIENTRY *)(GLuint id, GLsizei len, const GLubyte *name, const GLdouble *v)) _func)(id, len, name, v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(ProgramNamedParameter4fNV)(GLuint id, GLsizei len, const GLubyte *name, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[842];
+ ((void (APIENTRY *)(GLuint id, GLsizei len, const GLubyte *name, GLfloat x, GLfloat y, GLfloat z, GLfloat w)) _func)(id, len, name, x, y, z, w);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(ProgramNamedParameter4fvNV)(GLuint id, GLsizei len, const GLubyte *name, const GLfloat *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[843];
+ ((void (APIENTRY *)(GLuint id, GLsizei len, const GLubyte *name, const GLfloat *v)) _func)(id, len, name, v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(PrimitiveRestartIndexNV)(GLuint index)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[844];
+ ((void (APIENTRY *)(GLuint index)) _func)(index);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(PrimitiveRestartIndex)(GLuint index)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[844];
+ ((void (APIENTRY *)(GLuint index)) _func)(index);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(PrimitiveRestartNV)(void)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[845];
+ ((void (APIENTRY *)(void)) _func)();
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(BlendEquationSeparate)(GLenum modeRGB, GLenum modeA)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[893];
+ ((void (APIENTRY *)(GLenum modeRGB, GLenum modeA)) _func)(modeRGB, modeA);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(BindFramebufferEXT)(GLenum target, GLuint framebuffer)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[894];
+ ((void (APIENTRY *)(GLenum target, GLuint framebuffer)) _func)(target, framebuffer);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(BindFramebuffer)(GLenum target, GLuint framebuffer)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[894];
+ ((void (APIENTRY *)(GLenum target, GLuint framebuffer)) _func)(target, framebuffer);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(BindRenderbufferEXT)(GLenum target, GLuint renderbuffer)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[895];
+ ((void (APIENTRY *)(GLenum target, GLuint renderbuffer)) _func)(target, renderbuffer);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(BindRenderbuffer)(GLenum target, GLuint renderbuffer)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[895];
+ ((void (APIENTRY *)(GLenum target, GLuint renderbuffer)) _func)(target, renderbuffer);
+}
+
+GLAPI GLenum APIENTRY GLAPI_PREFIX(CheckFramebufferStatusEXT)(GLenum target)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[896];
+ return ((GLenum (APIENTRY *)(GLenum target)) _func)(target);
+}
+
+GLAPI GLenum APIENTRY GLAPI_PREFIX(CheckFramebufferStatus)(GLenum target)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[896];
+ return ((GLenum (APIENTRY *)(GLenum target)) _func)(target);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(DeleteFramebuffersEXT)(GLsizei n, const GLuint *framebuffers)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[897];
+ ((void (APIENTRY *)(GLsizei n, const GLuint *framebuffers)) _func)(n, framebuffers);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(DeleteFramebuffers)(GLsizei n, const GLuint *framebuffers)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[897];
+ ((void (APIENTRY *)(GLsizei n, const GLuint *framebuffers)) _func)(n, framebuffers);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(DeleteRenderbuffersEXT)(GLsizei n, const GLuint *renderbuffers)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[898];
+ ((void (APIENTRY *)(GLsizei n, const GLuint *renderbuffers)) _func)(n, renderbuffers);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(DeleteRenderbuffers)(GLsizei n, const GLuint *renderbuffers)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[898];
+ ((void (APIENTRY *)(GLsizei n, const GLuint *renderbuffers)) _func)(n, renderbuffers);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(FramebufferRenderbufferEXT)(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[899];
+ ((void (APIENTRY *)(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer)) _func)(target, attachment, renderbuffertarget, renderbuffer);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(FramebufferRenderbuffer)(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[899];
+ ((void (APIENTRY *)(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer)) _func)(target, attachment, renderbuffertarget, renderbuffer);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(FramebufferTexture1DEXT)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[900];
+ ((void (APIENTRY *)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level)) _func)(target, attachment, textarget, texture, level);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(FramebufferTexture1D)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[900];
+ ((void (APIENTRY *)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level)) _func)(target, attachment, textarget, texture, level);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(FramebufferTexture2DEXT)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[901];
+ ((void (APIENTRY *)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level)) _func)(target, attachment, textarget, texture, level);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(FramebufferTexture2D)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[901];
+ ((void (APIENTRY *)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level)) _func)(target, attachment, textarget, texture, level);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(FramebufferTexture3DEXT)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[902];
+ ((void (APIENTRY *)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset)) _func)(target, attachment, textarget, texture, level, zoffset);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(FramebufferTexture3D)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[902];
+ ((void (APIENTRY *)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset)) _func)(target, attachment, textarget, texture, level, zoffset);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(GenFramebuffersEXT)(GLsizei n, GLuint *framebuffers)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[903];
+ ((void (APIENTRY *)(GLsizei n, GLuint *framebuffers)) _func)(n, framebuffers);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(GenFramebuffers)(GLsizei n, GLuint *framebuffers)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[903];
+ ((void (APIENTRY *)(GLsizei n, GLuint *framebuffers)) _func)(n, framebuffers);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(GenRenderbuffersEXT)(GLsizei n, GLuint *renderbuffers)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[904];
+ ((void (APIENTRY *)(GLsizei n, GLuint *renderbuffers)) _func)(n, renderbuffers);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(GenRenderbuffers)(GLsizei n, GLuint *renderbuffers)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[904];
+ ((void (APIENTRY *)(GLsizei n, GLuint *renderbuffers)) _func)(n, renderbuffers);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(GenerateMipmapEXT)(GLenum target)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[905];
+ ((void (APIENTRY *)(GLenum target)) _func)(target);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(GenerateMipmap)(GLenum target)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[905];
+ ((void (APIENTRY *)(GLenum target)) _func)(target);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(GetFramebufferAttachmentParameterivEXT)(GLenum target, GLenum attachment, GLenum pname, GLint *params)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[906];
+ ((void (APIENTRY *)(GLenum target, GLenum attachment, GLenum pname, GLint *params)) _func)(target, attachment, pname, params);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(GetFramebufferAttachmentParameteriv)(GLenum target, GLenum attachment, GLenum pname, GLint *params)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[906];
+ ((void (APIENTRY *)(GLenum target, GLenum attachment, GLenum pname, GLint *params)) _func)(target, attachment, pname, params);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(GetRenderbufferParameterivEXT)(GLenum target, GLenum pname, GLint *params)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[907];
+ ((void (APIENTRY *)(GLenum target, GLenum pname, GLint *params)) _func)(target, pname, params);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(GetRenderbufferParameteriv)(GLenum target, GLenum pname, GLint *params)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[907];
+ ((void (APIENTRY *)(GLenum target, GLenum pname, GLint *params)) _func)(target, pname, params);
+}
+
+GLAPI GLboolean APIENTRY GLAPI_PREFIX(IsFramebufferEXT)(GLuint framebuffer)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[908];
+ return ((GLboolean (APIENTRY *)(GLuint framebuffer)) _func)(framebuffer);
+}
+
+GLAPI GLboolean APIENTRY GLAPI_PREFIX(IsFramebuffer)(GLuint framebuffer)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[908];
+ return ((GLboolean (APIENTRY *)(GLuint framebuffer)) _func)(framebuffer);
+}
+
+GLAPI GLboolean APIENTRY GLAPI_PREFIX(IsRenderbufferEXT)(GLuint renderbuffer)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[909];
+ return ((GLboolean (APIENTRY *)(GLuint renderbuffer)) _func)(renderbuffer);
+}
+
+GLAPI GLboolean APIENTRY GLAPI_PREFIX(IsRenderbuffer)(GLuint renderbuffer)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[909];
+ return ((GLboolean (APIENTRY *)(GLuint renderbuffer)) _func)(renderbuffer);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(RenderbufferStorageEXT)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[910];
+ ((void (APIENTRY *)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height)) _func)(target, internalformat, width, height);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(RenderbufferStorage)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[910];
+ ((void (APIENTRY *)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height)) _func)(target, internalformat, width, height);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(BlitFramebuffer)(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[911];
+ ((void (APIENTRY *)(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter)) _func)(srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(BindFragDataLocationEXT)(GLuint program, GLuint colorNumber, const GLchar *name)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[914];
+ ((void (APIENTRY *)(GLuint program, GLuint colorNumber, const GLchar *name)) _func)(program, colorNumber, name);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(BindFragDataLocation)(GLuint program, GLuint colorNumber, const GLchar *name)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[914];
+ ((void (APIENTRY *)(GLuint program, GLuint colorNumber, const GLchar *name)) _func)(program, colorNumber, name);
+}
+
+GLAPI GLint APIENTRY GLAPI_PREFIX(GetFragDataLocationEXT)(GLuint program, const GLchar *name)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[915];
+ return ((GLint (APIENTRY *)(GLuint program, const GLchar *name)) _func)(program, name);
+}
+
+GLAPI GLint APIENTRY GLAPI_PREFIX(GetFragDataLocation)(GLuint program, const GLchar *name)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[915];
+ return ((GLint (APIENTRY *)(GLuint program, const GLchar *name)) _func)(program, name);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(GetUniformuivEXT)(GLuint program, GLint location, GLuint *params)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[916];
+ ((void (APIENTRY *)(GLuint program, GLint location, GLuint *params)) _func)(program, location, params);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(GetUniformuiv)(GLuint program, GLint location, GLuint *params)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[916];
+ ((void (APIENTRY *)(GLuint program, GLint location, GLuint *params)) _func)(program, location, params);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(GetVertexAttribIivEXT)(GLuint index, GLenum pname, GLint *params)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[917];
+ ((void (APIENTRY *)(GLuint index, GLenum pname, GLint *params)) _func)(index, pname, params);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(GetVertexAttribIiv)(GLuint index, GLenum pname, GLint *params)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[917];
+ ((void (APIENTRY *)(GLuint index, GLenum pname, GLint *params)) _func)(index, pname, params);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(GetVertexAttribIuivEXT)(GLuint index, GLenum pname, GLuint *params)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[918];
+ ((void (APIENTRY *)(GLuint index, GLenum pname, GLuint *params)) _func)(index, pname, params);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(GetVertexAttribIuiv)(GLuint index, GLenum pname, GLuint *params)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[918];
+ ((void (APIENTRY *)(GLuint index, GLenum pname, GLuint *params)) _func)(index, pname, params);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(Uniform1uiEXT)(GLint location, GLuint x)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[919];
+ ((void (APIENTRY *)(GLint location, GLuint x)) _func)(location, x);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(Uniform1ui)(GLint location, GLuint x)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[919];
+ ((void (APIENTRY *)(GLint location, GLuint x)) _func)(location, x);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(Uniform1uivEXT)(GLint location, GLsizei count, const GLuint *value)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[920];
+ ((void (APIENTRY *)(GLint location, GLsizei count, const GLuint *value)) _func)(location, count, value);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(Uniform1uiv)(GLint location, GLsizei count, const GLuint *value)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[920];
+ ((void (APIENTRY *)(GLint location, GLsizei count, const GLuint *value)) _func)(location, count, value);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(Uniform2uiEXT)(GLint location, GLuint x, GLuint y)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[921];
+ ((void (APIENTRY *)(GLint location, GLuint x, GLuint y)) _func)(location, x, y);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(Uniform2ui)(GLint location, GLuint x, GLuint y)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[921];
+ ((void (APIENTRY *)(GLint location, GLuint x, GLuint y)) _func)(location, x, y);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(Uniform2uivEXT)(GLint location, GLsizei count, const GLuint *value)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[922];
+ ((void (APIENTRY *)(GLint location, GLsizei count, const GLuint *value)) _func)(location, count, value);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(Uniform2uiv)(GLint location, GLsizei count, const GLuint *value)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[922];
+ ((void (APIENTRY *)(GLint location, GLsizei count, const GLuint *value)) _func)(location, count, value);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(Uniform3uiEXT)(GLint location, GLuint x, GLuint y, GLuint z)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[923];
+ ((void (APIENTRY *)(GLint location, GLuint x, GLuint y, GLuint z)) _func)(location, x, y, z);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(Uniform3ui)(GLint location, GLuint x, GLuint y, GLuint z)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[923];
+ ((void (APIENTRY *)(GLint location, GLuint x, GLuint y, GLuint z)) _func)(location, x, y, z);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(Uniform3uivEXT)(GLint location, GLsizei count, const GLuint *value)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[924];
+ ((void (APIENTRY *)(GLint location, GLsizei count, const GLuint *value)) _func)(location, count, value);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(Uniform3uiv)(GLint location, GLsizei count, const GLuint *value)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[924];
+ ((void (APIENTRY *)(GLint location, GLsizei count, const GLuint *value)) _func)(location, count, value);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(Uniform4uiEXT)(GLint location, GLuint x, GLuint y, GLuint z, GLuint w)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[925];
+ ((void (APIENTRY *)(GLint location, GLuint x, GLuint y, GLuint z, GLuint w)) _func)(location, x, y, z, w);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(Uniform4ui)(GLint location, GLuint x, GLuint y, GLuint z, GLuint w)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[925];
+ ((void (APIENTRY *)(GLint location, GLuint x, GLuint y, GLuint z, GLuint w)) _func)(location, x, y, z, w);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(Uniform4uivEXT)(GLint location, GLsizei count, const GLuint *value)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[926];
+ ((void (APIENTRY *)(GLint location, GLsizei count, const GLuint *value)) _func)(location, count, value);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(Uniform4uiv)(GLint location, GLsizei count, const GLuint *value)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[926];
+ ((void (APIENTRY *)(GLint location, GLsizei count, const GLuint *value)) _func)(location, count, value);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribI1iEXT)(GLuint index, GLint x)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[927];
+ ((void (APIENTRY *)(GLuint index, GLint x)) _func)(index, x);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribI1i)(GLuint index, GLint x)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[927];
+ ((void (APIENTRY *)(GLuint index, GLint x)) _func)(index, x);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribI1ivEXT)(GLuint index, const GLint *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[928];
+ ((void (APIENTRY *)(GLuint index, const GLint *v)) _func)(index, v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribI1iv)(GLuint index, const GLint *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[928];
+ ((void (APIENTRY *)(GLuint index, const GLint *v)) _func)(index, v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribI1uiEXT)(GLuint index, GLuint x)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[929];
+ ((void (APIENTRY *)(GLuint index, GLuint x)) _func)(index, x);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribI1ui)(GLuint index, GLuint x)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[929];
+ ((void (APIENTRY *)(GLuint index, GLuint x)) _func)(index, x);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribI1uivEXT)(GLuint index, const GLuint *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[930];
+ ((void (APIENTRY *)(GLuint index, const GLuint *v)) _func)(index, v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribI1uiv)(GLuint index, const GLuint *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[930];
+ ((void (APIENTRY *)(GLuint index, const GLuint *v)) _func)(index, v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribI2iEXT)(GLuint index, GLint x, GLint y)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[931];
+ ((void (APIENTRY *)(GLuint index, GLint x, GLint y)) _func)(index, x, y);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribI2i)(GLuint index, GLint x, GLint y)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[931];
+ ((void (APIENTRY *)(GLuint index, GLint x, GLint y)) _func)(index, x, y);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribI2ivEXT)(GLuint index, const GLint *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[932];
+ ((void (APIENTRY *)(GLuint index, const GLint *v)) _func)(index, v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribI2iv)(GLuint index, const GLint *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[932];
+ ((void (APIENTRY *)(GLuint index, const GLint *v)) _func)(index, v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribI2uiEXT)(GLuint index, GLuint x, GLuint y)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[933];
+ ((void (APIENTRY *)(GLuint index, GLuint x, GLuint y)) _func)(index, x, y);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribI2ui)(GLuint index, GLuint x, GLuint y)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[933];
+ ((void (APIENTRY *)(GLuint index, GLuint x, GLuint y)) _func)(index, x, y);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribI2uivEXT)(GLuint index, const GLuint *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[934];
+ ((void (APIENTRY *)(GLuint index, const GLuint *v)) _func)(index, v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribI2uiv)(GLuint index, const GLuint *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[934];
+ ((void (APIENTRY *)(GLuint index, const GLuint *v)) _func)(index, v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribI3iEXT)(GLuint index, GLint x, GLint y, GLint z)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[935];
+ ((void (APIENTRY *)(GLuint index, GLint x, GLint y, GLint z)) _func)(index, x, y, z);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribI3i)(GLuint index, GLint x, GLint y, GLint z)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[935];
+ ((void (APIENTRY *)(GLuint index, GLint x, GLint y, GLint z)) _func)(index, x, y, z);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribI3ivEXT)(GLuint index, const GLint *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[936];
+ ((void (APIENTRY *)(GLuint index, const GLint *v)) _func)(index, v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribI3iv)(GLuint index, const GLint *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[936];
+ ((void (APIENTRY *)(GLuint index, const GLint *v)) _func)(index, v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribI3uiEXT)(GLuint index, GLuint x, GLuint y, GLuint z)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[937];
+ ((void (APIENTRY *)(GLuint index, GLuint x, GLuint y, GLuint z)) _func)(index, x, y, z);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribI3ui)(GLuint index, GLuint x, GLuint y, GLuint z)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[937];
+ ((void (APIENTRY *)(GLuint index, GLuint x, GLuint y, GLuint z)) _func)(index, x, y, z);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribI3uivEXT)(GLuint index, const GLuint *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[938];
+ ((void (APIENTRY *)(GLuint index, const GLuint *v)) _func)(index, v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribI3uiv)(GLuint index, const GLuint *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[938];
+ ((void (APIENTRY *)(GLuint index, const GLuint *v)) _func)(index, v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribI4bvEXT)(GLuint index, const GLbyte *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[939];
+ ((void (APIENTRY *)(GLuint index, const GLbyte *v)) _func)(index, v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribI4bv)(GLuint index, const GLbyte *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[939];
+ ((void (APIENTRY *)(GLuint index, const GLbyte *v)) _func)(index, v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribI4iEXT)(GLuint index, GLint x, GLint y, GLint z, GLint w)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[940];
+ ((void (APIENTRY *)(GLuint index, GLint x, GLint y, GLint z, GLint w)) _func)(index, x, y, z, w);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribI4i)(GLuint index, GLint x, GLint y, GLint z, GLint w)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[940];
+ ((void (APIENTRY *)(GLuint index, GLint x, GLint y, GLint z, GLint w)) _func)(index, x, y, z, w);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribI4ivEXT)(GLuint index, const GLint *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[941];
+ ((void (APIENTRY *)(GLuint index, const GLint *v)) _func)(index, v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribI4iv)(GLuint index, const GLint *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[941];
+ ((void (APIENTRY *)(GLuint index, const GLint *v)) _func)(index, v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribI4svEXT)(GLuint index, const GLshort *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[942];
+ ((void (APIENTRY *)(GLuint index, const GLshort *v)) _func)(index, v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribI4sv)(GLuint index, const GLshort *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[942];
+ ((void (APIENTRY *)(GLuint index, const GLshort *v)) _func)(index, v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribI4ubvEXT)(GLuint index, const GLubyte *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[943];
+ ((void (APIENTRY *)(GLuint index, const GLubyte *v)) _func)(index, v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribI4ubv)(GLuint index, const GLubyte *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[943];
+ ((void (APIENTRY *)(GLuint index, const GLubyte *v)) _func)(index, v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribI4uiEXT)(GLuint index, GLuint x, GLuint y, GLuint z, GLuint w)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[944];
+ ((void (APIENTRY *)(GLuint index, GLuint x, GLuint y, GLuint z, GLuint w)) _func)(index, x, y, z, w);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribI4ui)(GLuint index, GLuint x, GLuint y, GLuint z, GLuint w)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[944];
+ ((void (APIENTRY *)(GLuint index, GLuint x, GLuint y, GLuint z, GLuint w)) _func)(index, x, y, z, w);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribI4uivEXT)(GLuint index, const GLuint *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[945];
+ ((void (APIENTRY *)(GLuint index, const GLuint *v)) _func)(index, v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribI4uiv)(GLuint index, const GLuint *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[945];
+ ((void (APIENTRY *)(GLuint index, const GLuint *v)) _func)(index, v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribI4usvEXT)(GLuint index, const GLushort *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[946];
+ ((void (APIENTRY *)(GLuint index, const GLushort *v)) _func)(index, v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribI4usv)(GLuint index, const GLushort *v)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[946];
+ ((void (APIENTRY *)(GLuint index, const GLushort *v)) _func)(index, v);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribIPointerEXT)(GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[947];
+ ((void (APIENTRY *)(GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer)) _func)(index, size, type, stride, pointer);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(VertexAttribIPointer)(GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[947];
+ ((void (APIENTRY *)(GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer)) _func)(index, size, type, stride, pointer);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(FramebufferTextureLayerEXT)(GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[948];
+ ((void (APIENTRY *)(GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer)) _func)(target, attachment, texture, level, layer);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(FramebufferTextureLayer)(GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[948];
+ ((void (APIENTRY *)(GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer)) _func)(target, attachment, texture, level, layer);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(ColorMaskIndexedEXT)(GLuint buf, GLboolean r, GLboolean g, GLboolean b, GLboolean a)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[949];
+ ((void (APIENTRY *)(GLuint buf, GLboolean r, GLboolean g, GLboolean b, GLboolean a)) _func)(buf, r, g, b, a);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(ColorMaski)(GLuint buf, GLboolean r, GLboolean g, GLboolean b, GLboolean a)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[949];
+ ((void (APIENTRY *)(GLuint buf, GLboolean r, GLboolean g, GLboolean b, GLboolean a)) _func)(buf, r, g, b, a);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(DisableIndexedEXT)(GLenum target, GLuint index)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[950];
+ ((void (APIENTRY *)(GLenum target, GLuint index)) _func)(target, index);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(Disablei)(GLenum target, GLuint index)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[950];
+ ((void (APIENTRY *)(GLenum target, GLuint index)) _func)(target, index);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(EnableIndexedEXT)(GLenum target, GLuint index)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[951];
+ ((void (APIENTRY *)(GLenum target, GLuint index)) _func)(target, index);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(Enablei)(GLenum target, GLuint index)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[951];
+ ((void (APIENTRY *)(GLenum target, GLuint index)) _func)(target, index);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(GetBooleanIndexedvEXT)(GLenum value, GLuint index, GLboolean *data)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[952];
+ ((void (APIENTRY *)(GLenum value, GLuint index, GLboolean *data)) _func)(value, index, data);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(GetBooleani_v)(GLenum value, GLuint index, GLboolean *data)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[952];
+ ((void (APIENTRY *)(GLenum value, GLuint index, GLboolean *data)) _func)(value, index, data);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(GetIntegerIndexedvEXT)(GLenum value, GLuint index, GLint *data)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[953];
+ ((void (APIENTRY *)(GLenum value, GLuint index, GLint *data)) _func)(value, index, data);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(GetIntegeri_v)(GLenum value, GLuint index, GLint *data)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[953];
+ ((void (APIENTRY *)(GLenum value, GLuint index, GLint *data)) _func)(value, index, data);
+}
+
+GLAPI GLboolean APIENTRY GLAPI_PREFIX(IsEnabledIndexedEXT)(GLenum target, GLuint index)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[954];
+ return ((GLboolean (APIENTRY *)(GLenum target, GLuint index)) _func)(target, index);
+}
+
+GLAPI GLboolean APIENTRY GLAPI_PREFIX(IsEnabledi)(GLenum target, GLuint index)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[954];
+ return ((GLboolean (APIENTRY *)(GLenum target, GLuint index)) _func)(target, index);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(ClearColorIiEXT)(GLint r, GLint g, GLint b, GLint a)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[955];
+ ((void (APIENTRY *)(GLint r, GLint g, GLint b, GLint a)) _func)(r, g, b, a);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(ClearColorIuiEXT)(GLuint r, GLuint g, GLuint b, GLuint a)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[956];
+ ((void (APIENTRY *)(GLuint r, GLuint g, GLuint b, GLuint a)) _func)(r, g, b, a);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(GetTexParameterIivEXT)(GLenum target, GLenum pname, GLint *params)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[957];
+ ((void (APIENTRY *)(GLenum target, GLenum pname, GLint *params)) _func)(target, pname, params);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(GetTexParameterIiv)(GLenum target, GLenum pname, GLint *params)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[957];
+ ((void (APIENTRY *)(GLenum target, GLenum pname, GLint *params)) _func)(target, pname, params);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(GetTexParameterIuivEXT)(GLenum target, GLenum pname, GLuint *params)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[958];
+ ((void (APIENTRY *)(GLenum target, GLenum pname, GLuint *params)) _func)(target, pname, params);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(GetTexParameterIuiv)(GLenum target, GLenum pname, GLuint *params)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[958];
+ ((void (APIENTRY *)(GLenum target, GLenum pname, GLuint *params)) _func)(target, pname, params);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(TexParameterIivEXT)(GLenum target, GLenum pname, const GLint *params)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[959];
+ ((void (APIENTRY *)(GLenum target, GLenum pname, const GLint *params)) _func)(target, pname, params);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(TexParameterIiv)(GLenum target, GLenum pname, const GLint *params)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[959];
+ ((void (APIENTRY *)(GLenum target, GLenum pname, const GLint *params)) _func)(target, pname, params);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(TexParameterIuivEXT)(GLenum target, GLenum pname, const GLuint *params)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[960];
+ ((void (APIENTRY *)(GLenum target, GLenum pname, const GLuint *params)) _func)(target, pname, params);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(TexParameterIuiv)(GLenum target, GLenum pname, const GLuint *params)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[960];
+ ((void (APIENTRY *)(GLenum target, GLenum pname, const GLuint *params)) _func)(target, pname, params);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(BeginConditionalRenderNV)(GLuint query, GLenum mode)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[961];
+ ((void (APIENTRY *)(GLuint query, GLenum mode)) _func)(query, mode);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(BeginConditionalRender)(GLuint query, GLenum mode)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[961];
+ ((void (APIENTRY *)(GLuint query, GLenum mode)) _func)(query, mode);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(EndConditionalRenderNV)(void)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[962];
+ ((void (APIENTRY *)(void)) _func)();
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(EndConditionalRender)(void)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[962];
+ ((void (APIENTRY *)(void)) _func)();
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(BeginTransformFeedbackEXT)(GLenum mode)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[963];
+ ((void (APIENTRY *)(GLenum mode)) _func)(mode);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(BeginTransformFeedback)(GLenum mode)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[963];
+ ((void (APIENTRY *)(GLenum mode)) _func)(mode);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(BindBufferBaseEXT)(GLenum target, GLuint index, GLuint buffer)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[964];
+ ((void (APIENTRY *)(GLenum target, GLuint index, GLuint buffer)) _func)(target, index, buffer);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(BindBufferBase)(GLenum target, GLuint index, GLuint buffer)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[964];
+ ((void (APIENTRY *)(GLenum target, GLuint index, GLuint buffer)) _func)(target, index, buffer);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(BindBufferOffsetEXT)(GLenum target, GLuint index, GLuint buffer, GLintptr offset)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[965];
+ ((void (APIENTRY *)(GLenum target, GLuint index, GLuint buffer, GLintptr offset)) _func)(target, index, buffer, offset);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(BindBufferRangeEXT)(GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[966];
+ ((void (APIENTRY *)(GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size)) _func)(target, index, buffer, offset, size);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(BindBufferRange)(GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[966];
+ ((void (APIENTRY *)(GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size)) _func)(target, index, buffer, offset, size);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(EndTransformFeedbackEXT)(void)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[967];
+ ((void (APIENTRY *)(void)) _func)();
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(EndTransformFeedback)(void)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[967];
+ ((void (APIENTRY *)(void)) _func)();
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(GetTransformFeedbackVaryingEXT)(GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[968];
+ ((void (APIENTRY *)(GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name)) _func)(program, index, bufSize, length, size, type, name);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(GetTransformFeedbackVarying)(GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[968];
+ ((void (APIENTRY *)(GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name)) _func)(program, index, bufSize, length, size, type, name);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(TransformFeedbackVaryingsEXT)(GLuint program, GLsizei count, const char **varyings, GLenum bufferMode)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[969];
+ ((void (APIENTRY *)(GLuint program, GLsizei count, const char **varyings, GLenum bufferMode)) _func)(program, count, varyings, bufferMode);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(TransformFeedbackVaryings)(GLuint program, GLsizei count, const GLchar* *varyings, GLenum bufferMode)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[969];
+ ((void (APIENTRY *)(GLuint program, GLsizei count, const GLchar* *varyings, GLenum bufferMode)) _func)(program, count, varyings, bufferMode);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(ProvokingVertexEXT)(GLenum mode)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[970];
+ ((void (APIENTRY *)(GLenum mode)) _func)(mode);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(ProvokingVertex)(GLenum mode)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[970];
+ ((void (APIENTRY *)(GLenum mode)) _func)(mode);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(GetObjectParameterivAPPLE)(GLenum objectType, GLuint name, GLenum pname, GLint *value)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[973];
+ ((void (APIENTRY *)(GLenum objectType, GLuint name, GLenum pname, GLint *value)) _func)(objectType, name, pname, value);
+}
+
+GLAPI GLenum APIENTRY GLAPI_PREFIX(ObjectPurgeableAPPLE)(GLenum objectType, GLuint name, GLenum option)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[974];
+ return ((GLenum (APIENTRY *)(GLenum objectType, GLuint name, GLenum option)) _func)(objectType, name, option);
+}
+
+GLAPI GLenum APIENTRY GLAPI_PREFIX(ObjectUnpurgeableAPPLE)(GLenum objectType, GLuint name, GLenum option)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[975];
+ return ((GLenum (APIENTRY *)(GLenum objectType, GLuint name, GLenum option)) _func)(objectType, name, option);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(ActiveProgramEXT)(GLuint program)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[976];
+ ((void (APIENTRY *)(GLuint program)) _func)(program);
+}
+
+GLAPI GLuint APIENTRY GLAPI_PREFIX(CreateShaderProgramEXT)(GLenum type, const GLchar *string)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[977];
+ return ((GLuint (APIENTRY *)(GLenum type, const GLchar *string)) _func)(type, string);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(UseShaderProgramEXT)(GLenum type, GLuint program)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[978];
+ ((void (APIENTRY *)(GLenum type, GLuint program)) _func)(type, program);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(TextureBarrierNV)(void)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[979];
+ ((void (APIENTRY *)(void)) _func)();
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(EGLImageTargetRenderbufferStorageOES)(GLenum target, GLvoid *writeOffset)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[985];
+ ((void (APIENTRY *)(GLenum target, GLvoid *writeOffset)) _func)(target, writeOffset);
+}
+
+GLAPI void APIENTRY GLAPI_PREFIX(EGLImageTargetTexture2DOES)(GLenum target, GLvoid *writeOffset)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[986];
+ ((void (APIENTRY *)(GLenum target, GLvoid *writeOffset)) _func)(target, writeOffset);
+}
+
+/* does not need public_entries */
+#undef MAPI_TMP_PUBLIC_ENTRIES_NO_HIDDEN
+#endif /* MAPI_TMP_PUBLIC_ENTRIES_NO_HIDDEN */
+
+#ifdef MAPI_TMP_STUB_ASM_GCC_NO_HIDDEN
+__asm__(
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(NewList))"\n"
+"\t"STUB_ASM_CODE("0")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(EndList))"\n"
+"\t"STUB_ASM_CODE("1")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(CallList))"\n"
+"\t"STUB_ASM_CODE("2")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(CallLists))"\n"
+"\t"STUB_ASM_CODE("3")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(DeleteLists))"\n"
+"\t"STUB_ASM_CODE("4")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GenLists))"\n"
+"\t"STUB_ASM_CODE("5")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(ListBase))"\n"
+"\t"STUB_ASM_CODE("6")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Begin))"\n"
+"\t"STUB_ASM_CODE("7")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Bitmap))"\n"
+"\t"STUB_ASM_CODE("8")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Color3b))"\n"
+"\t"STUB_ASM_CODE("9")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Color3bv))"\n"
+"\t"STUB_ASM_CODE("10")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Color3d))"\n"
+"\t"STUB_ASM_CODE("11")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Color3dv))"\n"
+"\t"STUB_ASM_CODE("12")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Color3f))"\n"
+"\t"STUB_ASM_CODE("13")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Color3fv))"\n"
+"\t"STUB_ASM_CODE("14")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Color3i))"\n"
+"\t"STUB_ASM_CODE("15")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Color3iv))"\n"
+"\t"STUB_ASM_CODE("16")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Color3s))"\n"
+"\t"STUB_ASM_CODE("17")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Color3sv))"\n"
+"\t"STUB_ASM_CODE("18")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Color3ub))"\n"
+"\t"STUB_ASM_CODE("19")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Color3ubv))"\n"
+"\t"STUB_ASM_CODE("20")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Color3ui))"\n"
+"\t"STUB_ASM_CODE("21")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Color3uiv))"\n"
+"\t"STUB_ASM_CODE("22")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Color3us))"\n"
+"\t"STUB_ASM_CODE("23")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Color3usv))"\n"
+"\t"STUB_ASM_CODE("24")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Color4b))"\n"
+"\t"STUB_ASM_CODE("25")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Color4bv))"\n"
+"\t"STUB_ASM_CODE("26")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Color4d))"\n"
+"\t"STUB_ASM_CODE("27")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Color4dv))"\n"
+"\t"STUB_ASM_CODE("28")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Color4f))"\n"
+"\t"STUB_ASM_CODE("29")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Color4fv))"\n"
+"\t"STUB_ASM_CODE("30")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Color4i))"\n"
+"\t"STUB_ASM_CODE("31")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Color4iv))"\n"
+"\t"STUB_ASM_CODE("32")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Color4s))"\n"
+"\t"STUB_ASM_CODE("33")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Color4sv))"\n"
+"\t"STUB_ASM_CODE("34")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Color4ub))"\n"
+"\t"STUB_ASM_CODE("35")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Color4ubv))"\n"
+"\t"STUB_ASM_CODE("36")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Color4ui))"\n"
+"\t"STUB_ASM_CODE("37")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Color4uiv))"\n"
+"\t"STUB_ASM_CODE("38")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Color4us))"\n"
+"\t"STUB_ASM_CODE("39")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Color4usv))"\n"
+"\t"STUB_ASM_CODE("40")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(EdgeFlag))"\n"
+"\t"STUB_ASM_CODE("41")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(EdgeFlagv))"\n"
+"\t"STUB_ASM_CODE("42")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(End))"\n"
+"\t"STUB_ASM_CODE("43")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Indexd))"\n"
+"\t"STUB_ASM_CODE("44")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Indexdv))"\n"
+"\t"STUB_ASM_CODE("45")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Indexf))"\n"
+"\t"STUB_ASM_CODE("46")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Indexfv))"\n"
+"\t"STUB_ASM_CODE("47")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Indexi))"\n"
+"\t"STUB_ASM_CODE("48")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Indexiv))"\n"
+"\t"STUB_ASM_CODE("49")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Indexs))"\n"
+"\t"STUB_ASM_CODE("50")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Indexsv))"\n"
+"\t"STUB_ASM_CODE("51")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Normal3b))"\n"
+"\t"STUB_ASM_CODE("52")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Normal3bv))"\n"
+"\t"STUB_ASM_CODE("53")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Normal3d))"\n"
+"\t"STUB_ASM_CODE("54")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Normal3dv))"\n"
+"\t"STUB_ASM_CODE("55")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Normal3f))"\n"
+"\t"STUB_ASM_CODE("56")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Normal3fv))"\n"
+"\t"STUB_ASM_CODE("57")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Normal3i))"\n"
+"\t"STUB_ASM_CODE("58")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Normal3iv))"\n"
+"\t"STUB_ASM_CODE("59")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Normal3s))"\n"
+"\t"STUB_ASM_CODE("60")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Normal3sv))"\n"
+"\t"STUB_ASM_CODE("61")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(RasterPos2d))"\n"
+"\t"STUB_ASM_CODE("62")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(RasterPos2dv))"\n"
+"\t"STUB_ASM_CODE("63")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(RasterPos2f))"\n"
+"\t"STUB_ASM_CODE("64")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(RasterPos2fv))"\n"
+"\t"STUB_ASM_CODE("65")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(RasterPos2i))"\n"
+"\t"STUB_ASM_CODE("66")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(RasterPos2iv))"\n"
+"\t"STUB_ASM_CODE("67")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(RasterPos2s))"\n"
+"\t"STUB_ASM_CODE("68")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(RasterPos2sv))"\n"
+"\t"STUB_ASM_CODE("69")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(RasterPos3d))"\n"
+"\t"STUB_ASM_CODE("70")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(RasterPos3dv))"\n"
+"\t"STUB_ASM_CODE("71")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(RasterPos3f))"\n"
+"\t"STUB_ASM_CODE("72")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(RasterPos3fv))"\n"
+"\t"STUB_ASM_CODE("73")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(RasterPos3i))"\n"
+"\t"STUB_ASM_CODE("74")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(RasterPos3iv))"\n"
+"\t"STUB_ASM_CODE("75")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(RasterPos3s))"\n"
+"\t"STUB_ASM_CODE("76")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(RasterPos3sv))"\n"
+"\t"STUB_ASM_CODE("77")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(RasterPos4d))"\n"
+"\t"STUB_ASM_CODE("78")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(RasterPos4dv))"\n"
+"\t"STUB_ASM_CODE("79")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(RasterPos4f))"\n"
+"\t"STUB_ASM_CODE("80")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(RasterPos4fv))"\n"
+"\t"STUB_ASM_CODE("81")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(RasterPos4i))"\n"
+"\t"STUB_ASM_CODE("82")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(RasterPos4iv))"\n"
+"\t"STUB_ASM_CODE("83")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(RasterPos4s))"\n"
+"\t"STUB_ASM_CODE("84")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(RasterPos4sv))"\n"
+"\t"STUB_ASM_CODE("85")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Rectd))"\n"
+"\t"STUB_ASM_CODE("86")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Rectdv))"\n"
+"\t"STUB_ASM_CODE("87")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Rectf))"\n"
+"\t"STUB_ASM_CODE("88")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Rectfv))"\n"
+"\t"STUB_ASM_CODE("89")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Recti))"\n"
+"\t"STUB_ASM_CODE("90")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Rectiv))"\n"
+"\t"STUB_ASM_CODE("91")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Rects))"\n"
+"\t"STUB_ASM_CODE("92")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Rectsv))"\n"
+"\t"STUB_ASM_CODE("93")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(TexCoord1d))"\n"
+"\t"STUB_ASM_CODE("94")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(TexCoord1dv))"\n"
+"\t"STUB_ASM_CODE("95")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(TexCoord1f))"\n"
+"\t"STUB_ASM_CODE("96")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(TexCoord1fv))"\n"
+"\t"STUB_ASM_CODE("97")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(TexCoord1i))"\n"
+"\t"STUB_ASM_CODE("98")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(TexCoord1iv))"\n"
+"\t"STUB_ASM_CODE("99")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(TexCoord1s))"\n"
+"\t"STUB_ASM_CODE("100")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(TexCoord1sv))"\n"
+"\t"STUB_ASM_CODE("101")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(TexCoord2d))"\n"
+"\t"STUB_ASM_CODE("102")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(TexCoord2dv))"\n"
+"\t"STUB_ASM_CODE("103")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(TexCoord2f))"\n"
+"\t"STUB_ASM_CODE("104")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(TexCoord2fv))"\n"
+"\t"STUB_ASM_CODE("105")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(TexCoord2i))"\n"
+"\t"STUB_ASM_CODE("106")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(TexCoord2iv))"\n"
+"\t"STUB_ASM_CODE("107")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(TexCoord2s))"\n"
+"\t"STUB_ASM_CODE("108")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(TexCoord2sv))"\n"
+"\t"STUB_ASM_CODE("109")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(TexCoord3d))"\n"
+"\t"STUB_ASM_CODE("110")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(TexCoord3dv))"\n"
+"\t"STUB_ASM_CODE("111")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(TexCoord3f))"\n"
+"\t"STUB_ASM_CODE("112")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(TexCoord3fv))"\n"
+"\t"STUB_ASM_CODE("113")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(TexCoord3i))"\n"
+"\t"STUB_ASM_CODE("114")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(TexCoord3iv))"\n"
+"\t"STUB_ASM_CODE("115")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(TexCoord3s))"\n"
+"\t"STUB_ASM_CODE("116")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(TexCoord3sv))"\n"
+"\t"STUB_ASM_CODE("117")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(TexCoord4d))"\n"
+"\t"STUB_ASM_CODE("118")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(TexCoord4dv))"\n"
+"\t"STUB_ASM_CODE("119")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(TexCoord4f))"\n"
+"\t"STUB_ASM_CODE("120")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(TexCoord4fv))"\n"
+"\t"STUB_ASM_CODE("121")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(TexCoord4i))"\n"
+"\t"STUB_ASM_CODE("122")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(TexCoord4iv))"\n"
+"\t"STUB_ASM_CODE("123")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(TexCoord4s))"\n"
+"\t"STUB_ASM_CODE("124")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(TexCoord4sv))"\n"
+"\t"STUB_ASM_CODE("125")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Vertex2d))"\n"
+"\t"STUB_ASM_CODE("126")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Vertex2dv))"\n"
+"\t"STUB_ASM_CODE("127")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Vertex2f))"\n"
+"\t"STUB_ASM_CODE("128")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Vertex2fv))"\n"
+"\t"STUB_ASM_CODE("129")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Vertex2i))"\n"
+"\t"STUB_ASM_CODE("130")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Vertex2iv))"\n"
+"\t"STUB_ASM_CODE("131")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Vertex2s))"\n"
+"\t"STUB_ASM_CODE("132")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Vertex2sv))"\n"
+"\t"STUB_ASM_CODE("133")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Vertex3d))"\n"
+"\t"STUB_ASM_CODE("134")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Vertex3dv))"\n"
+"\t"STUB_ASM_CODE("135")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Vertex3f))"\n"
+"\t"STUB_ASM_CODE("136")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Vertex3fv))"\n"
+"\t"STUB_ASM_CODE("137")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Vertex3i))"\n"
+"\t"STUB_ASM_CODE("138")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Vertex3iv))"\n"
+"\t"STUB_ASM_CODE("139")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Vertex3s))"\n"
+"\t"STUB_ASM_CODE("140")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Vertex3sv))"\n"
+"\t"STUB_ASM_CODE("141")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Vertex4d))"\n"
+"\t"STUB_ASM_CODE("142")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Vertex4dv))"\n"
+"\t"STUB_ASM_CODE("143")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Vertex4f))"\n"
+"\t"STUB_ASM_CODE("144")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Vertex4fv))"\n"
+"\t"STUB_ASM_CODE("145")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Vertex4i))"\n"
+"\t"STUB_ASM_CODE("146")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Vertex4iv))"\n"
+"\t"STUB_ASM_CODE("147")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Vertex4s))"\n"
+"\t"STUB_ASM_CODE("148")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Vertex4sv))"\n"
+"\t"STUB_ASM_CODE("149")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(ClipPlane))"\n"
+"\t"STUB_ASM_CODE("150")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(ColorMaterial))"\n"
+"\t"STUB_ASM_CODE("151")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(CullFace))"\n"
+"\t"STUB_ASM_CODE("152")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Fogf))"\n"
+"\t"STUB_ASM_CODE("153")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Fogfv))"\n"
+"\t"STUB_ASM_CODE("154")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Fogi))"\n"
+"\t"STUB_ASM_CODE("155")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Fogiv))"\n"
+"\t"STUB_ASM_CODE("156")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(FrontFace))"\n"
+"\t"STUB_ASM_CODE("157")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Hint))"\n"
+"\t"STUB_ASM_CODE("158")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Lightf))"\n"
+"\t"STUB_ASM_CODE("159")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Lightfv))"\n"
+"\t"STUB_ASM_CODE("160")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Lighti))"\n"
+"\t"STUB_ASM_CODE("161")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Lightiv))"\n"
+"\t"STUB_ASM_CODE("162")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(LightModelf))"\n"
+"\t"STUB_ASM_CODE("163")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(LightModelfv))"\n"
+"\t"STUB_ASM_CODE("164")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(LightModeli))"\n"
+"\t"STUB_ASM_CODE("165")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(LightModeliv))"\n"
+"\t"STUB_ASM_CODE("166")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(LineStipple))"\n"
+"\t"STUB_ASM_CODE("167")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(LineWidth))"\n"
+"\t"STUB_ASM_CODE("168")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Materialf))"\n"
+"\t"STUB_ASM_CODE("169")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Materialfv))"\n"
+"\t"STUB_ASM_CODE("170")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Materiali))"\n"
+"\t"STUB_ASM_CODE("171")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Materialiv))"\n"
+"\t"STUB_ASM_CODE("172")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(PointSize))"\n"
+"\t"STUB_ASM_CODE("173")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(PolygonMode))"\n"
+"\t"STUB_ASM_CODE("174")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(PolygonStipple))"\n"
+"\t"STUB_ASM_CODE("175")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Scissor))"\n"
+"\t"STUB_ASM_CODE("176")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(ShadeModel))"\n"
+"\t"STUB_ASM_CODE("177")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(TexParameterf))"\n"
+"\t"STUB_ASM_CODE("178")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(TexParameterfv))"\n"
+"\t"STUB_ASM_CODE("179")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(TexParameteri))"\n"
+"\t"STUB_ASM_CODE("180")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(TexParameteriv))"\n"
+"\t"STUB_ASM_CODE("181")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(TexImage1D))"\n"
+"\t"STUB_ASM_CODE("182")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(TexImage2D))"\n"
+"\t"STUB_ASM_CODE("183")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(TexEnvf))"\n"
+"\t"STUB_ASM_CODE("184")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(TexEnvfv))"\n"
+"\t"STUB_ASM_CODE("185")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(TexEnvi))"\n"
+"\t"STUB_ASM_CODE("186")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(TexEnviv))"\n"
+"\t"STUB_ASM_CODE("187")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(TexGend))"\n"
+"\t"STUB_ASM_CODE("188")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(TexGendv))"\n"
+"\t"STUB_ASM_CODE("189")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(TexGenf))"\n"
+"\t"STUB_ASM_CODE("190")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(TexGenfv))"\n"
+"\t"STUB_ASM_CODE("191")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(TexGeni))"\n"
+"\t"STUB_ASM_CODE("192")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(TexGeniv))"\n"
+"\t"STUB_ASM_CODE("193")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(FeedbackBuffer))"\n"
+"\t"STUB_ASM_CODE("194")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(SelectBuffer))"\n"
+"\t"STUB_ASM_CODE("195")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(RenderMode))"\n"
+"\t"STUB_ASM_CODE("196")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(InitNames))"\n"
+"\t"STUB_ASM_CODE("197")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(LoadName))"\n"
+"\t"STUB_ASM_CODE("198")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(PassThrough))"\n"
+"\t"STUB_ASM_CODE("199")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(PopName))"\n"
+"\t"STUB_ASM_CODE("200")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(PushName))"\n"
+"\t"STUB_ASM_CODE("201")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(DrawBuffer))"\n"
+"\t"STUB_ASM_CODE("202")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Clear))"\n"
+"\t"STUB_ASM_CODE("203")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(ClearAccum))"\n"
+"\t"STUB_ASM_CODE("204")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(ClearIndex))"\n"
+"\t"STUB_ASM_CODE("205")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(ClearColor))"\n"
+"\t"STUB_ASM_CODE("206")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(ClearStencil))"\n"
+"\t"STUB_ASM_CODE("207")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(ClearDepth))"\n"
+"\t"STUB_ASM_CODE("208")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(StencilMask))"\n"
+"\t"STUB_ASM_CODE("209")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(ColorMask))"\n"
+"\t"STUB_ASM_CODE("210")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(DepthMask))"\n"
+"\t"STUB_ASM_CODE("211")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(IndexMask))"\n"
+"\t"STUB_ASM_CODE("212")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Accum))"\n"
+"\t"STUB_ASM_CODE("213")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Disable))"\n"
+"\t"STUB_ASM_CODE("214")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Enable))"\n"
+"\t"STUB_ASM_CODE("215")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Finish))"\n"
+"\t"STUB_ASM_CODE("216")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Flush))"\n"
+"\t"STUB_ASM_CODE("217")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(PopAttrib))"\n"
+"\t"STUB_ASM_CODE("218")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(PushAttrib))"\n"
+"\t"STUB_ASM_CODE("219")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Map1d))"\n"
+"\t"STUB_ASM_CODE("220")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Map1f))"\n"
+"\t"STUB_ASM_CODE("221")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Map2d))"\n"
+"\t"STUB_ASM_CODE("222")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Map2f))"\n"
+"\t"STUB_ASM_CODE("223")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(MapGrid1d))"\n"
+"\t"STUB_ASM_CODE("224")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(MapGrid1f))"\n"
+"\t"STUB_ASM_CODE("225")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(MapGrid2d))"\n"
+"\t"STUB_ASM_CODE("226")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(MapGrid2f))"\n"
+"\t"STUB_ASM_CODE("227")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(EvalCoord1d))"\n"
+"\t"STUB_ASM_CODE("228")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(EvalCoord1dv))"\n"
+"\t"STUB_ASM_CODE("229")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(EvalCoord1f))"\n"
+"\t"STUB_ASM_CODE("230")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(EvalCoord1fv))"\n"
+"\t"STUB_ASM_CODE("231")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(EvalCoord2d))"\n"
+"\t"STUB_ASM_CODE("232")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(EvalCoord2dv))"\n"
+"\t"STUB_ASM_CODE("233")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(EvalCoord2f))"\n"
+"\t"STUB_ASM_CODE("234")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(EvalCoord2fv))"\n"
+"\t"STUB_ASM_CODE("235")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(EvalMesh1))"\n"
+"\t"STUB_ASM_CODE("236")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(EvalPoint1))"\n"
+"\t"STUB_ASM_CODE("237")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(EvalMesh2))"\n"
+"\t"STUB_ASM_CODE("238")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(EvalPoint2))"\n"
+"\t"STUB_ASM_CODE("239")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(AlphaFunc))"\n"
+"\t"STUB_ASM_CODE("240")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(BlendFunc))"\n"
+"\t"STUB_ASM_CODE("241")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(LogicOp))"\n"
+"\t"STUB_ASM_CODE("242")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(StencilFunc))"\n"
+"\t"STUB_ASM_CODE("243")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(StencilOp))"\n"
+"\t"STUB_ASM_CODE("244")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(DepthFunc))"\n"
+"\t"STUB_ASM_CODE("245")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(PixelZoom))"\n"
+"\t"STUB_ASM_CODE("246")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(PixelTransferf))"\n"
+"\t"STUB_ASM_CODE("247")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(PixelTransferi))"\n"
+"\t"STUB_ASM_CODE("248")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(PixelStoref))"\n"
+"\t"STUB_ASM_CODE("249")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(PixelStorei))"\n"
+"\t"STUB_ASM_CODE("250")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(PixelMapfv))"\n"
+"\t"STUB_ASM_CODE("251")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(PixelMapuiv))"\n"
+"\t"STUB_ASM_CODE("252")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(PixelMapusv))"\n"
+"\t"STUB_ASM_CODE("253")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(ReadBuffer))"\n"
+"\t"STUB_ASM_CODE("254")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(CopyPixels))"\n"
+"\t"STUB_ASM_CODE("255")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(ReadPixels))"\n"
+"\t"STUB_ASM_CODE("256")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(DrawPixels))"\n"
+"\t"STUB_ASM_CODE("257")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetBooleanv))"\n"
+"\t"STUB_ASM_CODE("258")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetClipPlane))"\n"
+"\t"STUB_ASM_CODE("259")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetDoublev))"\n"
+"\t"STUB_ASM_CODE("260")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetError))"\n"
+"\t"STUB_ASM_CODE("261")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetFloatv))"\n"
+"\t"STUB_ASM_CODE("262")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetIntegerv))"\n"
+"\t"STUB_ASM_CODE("263")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetLightfv))"\n"
+"\t"STUB_ASM_CODE("264")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetLightiv))"\n"
+"\t"STUB_ASM_CODE("265")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetMapdv))"\n"
+"\t"STUB_ASM_CODE("266")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetMapfv))"\n"
+"\t"STUB_ASM_CODE("267")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetMapiv))"\n"
+"\t"STUB_ASM_CODE("268")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetMaterialfv))"\n"
+"\t"STUB_ASM_CODE("269")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetMaterialiv))"\n"
+"\t"STUB_ASM_CODE("270")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetPixelMapfv))"\n"
+"\t"STUB_ASM_CODE("271")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetPixelMapuiv))"\n"
+"\t"STUB_ASM_CODE("272")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetPixelMapusv))"\n"
+"\t"STUB_ASM_CODE("273")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetPolygonStipple))"\n"
+"\t"STUB_ASM_CODE("274")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetString))"\n"
+"\t"STUB_ASM_CODE("275")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetTexEnvfv))"\n"
+"\t"STUB_ASM_CODE("276")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetTexEnviv))"\n"
+"\t"STUB_ASM_CODE("277")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetTexGendv))"\n"
+"\t"STUB_ASM_CODE("278")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetTexGenfv))"\n"
+"\t"STUB_ASM_CODE("279")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetTexGeniv))"\n"
+"\t"STUB_ASM_CODE("280")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetTexImage))"\n"
+"\t"STUB_ASM_CODE("281")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetTexParameterfv))"\n"
+"\t"STUB_ASM_CODE("282")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetTexParameteriv))"\n"
+"\t"STUB_ASM_CODE("283")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetTexLevelParameterfv))"\n"
+"\t"STUB_ASM_CODE("284")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetTexLevelParameteriv))"\n"
+"\t"STUB_ASM_CODE("285")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(IsEnabled))"\n"
+"\t"STUB_ASM_CODE("286")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(IsList))"\n"
+"\t"STUB_ASM_CODE("287")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(DepthRange))"\n"
+"\t"STUB_ASM_CODE("288")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Frustum))"\n"
+"\t"STUB_ASM_CODE("289")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(LoadIdentity))"\n"
+"\t"STUB_ASM_CODE("290")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(LoadMatrixf))"\n"
+"\t"STUB_ASM_CODE("291")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(LoadMatrixd))"\n"
+"\t"STUB_ASM_CODE("292")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(MatrixMode))"\n"
+"\t"STUB_ASM_CODE("293")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(MultMatrixf))"\n"
+"\t"STUB_ASM_CODE("294")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(MultMatrixd))"\n"
+"\t"STUB_ASM_CODE("295")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Ortho))"\n"
+"\t"STUB_ASM_CODE("296")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(PopMatrix))"\n"
+"\t"STUB_ASM_CODE("297")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(PushMatrix))"\n"
+"\t"STUB_ASM_CODE("298")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Rotated))"\n"
+"\t"STUB_ASM_CODE("299")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Rotatef))"\n"
+"\t"STUB_ASM_CODE("300")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Scaled))"\n"
+"\t"STUB_ASM_CODE("301")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Scalef))"\n"
+"\t"STUB_ASM_CODE("302")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Translated))"\n"
+"\t"STUB_ASM_CODE("303")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Translatef))"\n"
+"\t"STUB_ASM_CODE("304")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Viewport))"\n"
+"\t"STUB_ASM_CODE("305")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(ArrayElement))"\n"
+"\t"STUB_ASM_CODE("306")"\n"
+
+".globl "GLAPI_PREFIX_STR(ArrayElementEXT)"\n"
+".set "GLAPI_PREFIX_STR(ArrayElementEXT)", "GLAPI_PREFIX_STR(ArrayElement)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(BindTexture))"\n"
+"\t"STUB_ASM_CODE("307")"\n"
+
+".globl "GLAPI_PREFIX_STR(BindTextureEXT)"\n"
+".set "GLAPI_PREFIX_STR(BindTextureEXT)", "GLAPI_PREFIX_STR(BindTexture)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(ColorPointer))"\n"
+"\t"STUB_ASM_CODE("308")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(DisableClientState))"\n"
+"\t"STUB_ASM_CODE("309")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(DrawArrays))"\n"
+"\t"STUB_ASM_CODE("310")"\n"
+
+".globl "GLAPI_PREFIX_STR(DrawArraysEXT)"\n"
+".set "GLAPI_PREFIX_STR(DrawArraysEXT)", "GLAPI_PREFIX_STR(DrawArrays)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(DrawElements))"\n"
+"\t"STUB_ASM_CODE("311")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(EdgeFlagPointer))"\n"
+"\t"STUB_ASM_CODE("312")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(EnableClientState))"\n"
+"\t"STUB_ASM_CODE("313")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(IndexPointer))"\n"
+"\t"STUB_ASM_CODE("314")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Indexub))"\n"
+"\t"STUB_ASM_CODE("315")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Indexubv))"\n"
+"\t"STUB_ASM_CODE("316")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(InterleavedArrays))"\n"
+"\t"STUB_ASM_CODE("317")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(NormalPointer))"\n"
+"\t"STUB_ASM_CODE("318")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(PolygonOffset))"\n"
+"\t"STUB_ASM_CODE("319")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(TexCoordPointer))"\n"
+"\t"STUB_ASM_CODE("320")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexPointer))"\n"
+"\t"STUB_ASM_CODE("321")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(AreTexturesResident))"\n"
+"\t"STUB_ASM_CODE("322")"\n"
+
+#if 0
+".globl "GLAPI_PREFIX_STR(AreTexturesResidentEXT)"\n"
+".set "GLAPI_PREFIX_STR(AreTexturesResidentEXT)", "GLAPI_PREFIX_STR(AreTexturesResident)"\n"
+#endif
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(CopyTexImage1D))"\n"
+"\t"STUB_ASM_CODE("323")"\n"
+
+".globl "GLAPI_PREFIX_STR(CopyTexImage1DEXT)"\n"
+".set "GLAPI_PREFIX_STR(CopyTexImage1DEXT)", "GLAPI_PREFIX_STR(CopyTexImage1D)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(CopyTexImage2D))"\n"
+"\t"STUB_ASM_CODE("324")"\n"
+
+".globl "GLAPI_PREFIX_STR(CopyTexImage2DEXT)"\n"
+".set "GLAPI_PREFIX_STR(CopyTexImage2DEXT)", "GLAPI_PREFIX_STR(CopyTexImage2D)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(CopyTexSubImage1D))"\n"
+"\t"STUB_ASM_CODE("325")"\n"
+
+".globl "GLAPI_PREFIX_STR(CopyTexSubImage1DEXT)"\n"
+".set "GLAPI_PREFIX_STR(CopyTexSubImage1DEXT)", "GLAPI_PREFIX_STR(CopyTexSubImage1D)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(CopyTexSubImage2D))"\n"
+"\t"STUB_ASM_CODE("326")"\n"
+
+".globl "GLAPI_PREFIX_STR(CopyTexSubImage2DEXT)"\n"
+".set "GLAPI_PREFIX_STR(CopyTexSubImage2DEXT)", "GLAPI_PREFIX_STR(CopyTexSubImage2D)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(DeleteTextures))"\n"
+"\t"STUB_ASM_CODE("327")"\n"
+
+#if 0
+".globl "GLAPI_PREFIX_STR(DeleteTexturesEXT)"\n"
+".set "GLAPI_PREFIX_STR(DeleteTexturesEXT)", "GLAPI_PREFIX_STR(DeleteTextures)"\n"
+#endif
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GenTextures))"\n"
+"\t"STUB_ASM_CODE("328")"\n"
+
+#if 0
+".globl "GLAPI_PREFIX_STR(GenTexturesEXT)"\n"
+".set "GLAPI_PREFIX_STR(GenTexturesEXT)", "GLAPI_PREFIX_STR(GenTextures)"\n"
+#endif
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetPointerv))"\n"
+"\t"STUB_ASM_CODE("329")"\n"
+
+".globl "GLAPI_PREFIX_STR(GetPointervEXT)"\n"
+".set "GLAPI_PREFIX_STR(GetPointervEXT)", "GLAPI_PREFIX_STR(GetPointerv)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(IsTexture))"\n"
+"\t"STUB_ASM_CODE("330")"\n"
+
+#if 0
+".globl "GLAPI_PREFIX_STR(IsTextureEXT)"\n"
+".set "GLAPI_PREFIX_STR(IsTextureEXT)", "GLAPI_PREFIX_STR(IsTexture)"\n"
+#endif
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(PrioritizeTextures))"\n"
+"\t"STUB_ASM_CODE("331")"\n"
+
+".globl "GLAPI_PREFIX_STR(PrioritizeTexturesEXT)"\n"
+".set "GLAPI_PREFIX_STR(PrioritizeTexturesEXT)", "GLAPI_PREFIX_STR(PrioritizeTextures)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(TexSubImage1D))"\n"
+"\t"STUB_ASM_CODE("332")"\n"
+
+".globl "GLAPI_PREFIX_STR(TexSubImage1DEXT)"\n"
+".set "GLAPI_PREFIX_STR(TexSubImage1DEXT)", "GLAPI_PREFIX_STR(TexSubImage1D)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(TexSubImage2D))"\n"
+"\t"STUB_ASM_CODE("333")"\n"
+
+".globl "GLAPI_PREFIX_STR(TexSubImage2DEXT)"\n"
+".set "GLAPI_PREFIX_STR(TexSubImage2DEXT)", "GLAPI_PREFIX_STR(TexSubImage2D)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(PopClientAttrib))"\n"
+"\t"STUB_ASM_CODE("334")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(PushClientAttrib))"\n"
+"\t"STUB_ASM_CODE("335")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(BlendColor))"\n"
+"\t"STUB_ASM_CODE("336")"\n"
+
+".globl "GLAPI_PREFIX_STR(BlendColorEXT)"\n"
+".set "GLAPI_PREFIX_STR(BlendColorEXT)", "GLAPI_PREFIX_STR(BlendColor)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(BlendEquation))"\n"
+"\t"STUB_ASM_CODE("337")"\n"
+
+".globl "GLAPI_PREFIX_STR(BlendEquationEXT)"\n"
+".set "GLAPI_PREFIX_STR(BlendEquationEXT)", "GLAPI_PREFIX_STR(BlendEquation)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(DrawRangeElements))"\n"
+"\t"STUB_ASM_CODE("338")"\n"
+
+".globl "GLAPI_PREFIX_STR(DrawRangeElementsEXT)"\n"
+".set "GLAPI_PREFIX_STR(DrawRangeElementsEXT)", "GLAPI_PREFIX_STR(DrawRangeElements)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(ColorTable))"\n"
+"\t"STUB_ASM_CODE("339")"\n"
+
+".globl "GLAPI_PREFIX_STR(ColorTableEXT)"\n"
+".set "GLAPI_PREFIX_STR(ColorTableEXT)", "GLAPI_PREFIX_STR(ColorTable)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(ColorTableParameterfv))"\n"
+"\t"STUB_ASM_CODE("340")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(ColorTableParameteriv))"\n"
+"\t"STUB_ASM_CODE("341")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(CopyColorTable))"\n"
+"\t"STUB_ASM_CODE("342")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetColorTable))"\n"
+"\t"STUB_ASM_CODE("343")"\n"
+
+#if 0
+".globl "GLAPI_PREFIX_STR(GetColorTableEXT)"\n"
+".set "GLAPI_PREFIX_STR(GetColorTableEXT)", "GLAPI_PREFIX_STR(GetColorTable)"\n"
+#endif
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetColorTableParameterfv))"\n"
+"\t"STUB_ASM_CODE("344")"\n"
+
+#if 0
+".globl "GLAPI_PREFIX_STR(GetColorTableParameterfvEXT)"\n"
+".set "GLAPI_PREFIX_STR(GetColorTableParameterfvEXT)", "GLAPI_PREFIX_STR(GetColorTableParameterfv)"\n"
+#endif
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetColorTableParameteriv))"\n"
+"\t"STUB_ASM_CODE("345")"\n"
+
+#if 0
+".globl "GLAPI_PREFIX_STR(GetColorTableParameterivEXT)"\n"
+".set "GLAPI_PREFIX_STR(GetColorTableParameterivEXT)", "GLAPI_PREFIX_STR(GetColorTableParameteriv)"\n"
+#endif
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(ColorSubTable))"\n"
+"\t"STUB_ASM_CODE("346")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(CopyColorSubTable))"\n"
+"\t"STUB_ASM_CODE("347")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(ConvolutionFilter1D))"\n"
+"\t"STUB_ASM_CODE("348")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(ConvolutionFilter2D))"\n"
+"\t"STUB_ASM_CODE("349")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(ConvolutionParameterf))"\n"
+"\t"STUB_ASM_CODE("350")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(ConvolutionParameterfv))"\n"
+"\t"STUB_ASM_CODE("351")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(ConvolutionParameteri))"\n"
+"\t"STUB_ASM_CODE("352")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(ConvolutionParameteriv))"\n"
+"\t"STUB_ASM_CODE("353")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(CopyConvolutionFilter1D))"\n"
+"\t"STUB_ASM_CODE("354")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(CopyConvolutionFilter2D))"\n"
+"\t"STUB_ASM_CODE("355")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetConvolutionFilter))"\n"
+"\t"STUB_ASM_CODE("356")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetConvolutionParameterfv))"\n"
+"\t"STUB_ASM_CODE("357")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetConvolutionParameteriv))"\n"
+"\t"STUB_ASM_CODE("358")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetSeparableFilter))"\n"
+"\t"STUB_ASM_CODE("359")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(SeparableFilter2D))"\n"
+"\t"STUB_ASM_CODE("360")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetHistogram))"\n"
+"\t"STUB_ASM_CODE("361")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetHistogramParameterfv))"\n"
+"\t"STUB_ASM_CODE("362")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetHistogramParameteriv))"\n"
+"\t"STUB_ASM_CODE("363")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetMinmax))"\n"
+"\t"STUB_ASM_CODE("364")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetMinmaxParameterfv))"\n"
+"\t"STUB_ASM_CODE("365")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetMinmaxParameteriv))"\n"
+"\t"STUB_ASM_CODE("366")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Histogram))"\n"
+"\t"STUB_ASM_CODE("367")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Minmax))"\n"
+"\t"STUB_ASM_CODE("368")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(ResetHistogram))"\n"
+"\t"STUB_ASM_CODE("369")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(ResetMinmax))"\n"
+"\t"STUB_ASM_CODE("370")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(TexImage3D))"\n"
+"\t"STUB_ASM_CODE("371")"\n"
+
+".globl "GLAPI_PREFIX_STR(TexImage3DEXT)"\n"
+".set "GLAPI_PREFIX_STR(TexImage3DEXT)", "GLAPI_PREFIX_STR(TexImage3D)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(TexSubImage3D))"\n"
+"\t"STUB_ASM_CODE("372")"\n"
+
+".globl "GLAPI_PREFIX_STR(TexSubImage3DEXT)"\n"
+".set "GLAPI_PREFIX_STR(TexSubImage3DEXT)", "GLAPI_PREFIX_STR(TexSubImage3D)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(CopyTexSubImage3D))"\n"
+"\t"STUB_ASM_CODE("373")"\n"
+
+".globl "GLAPI_PREFIX_STR(CopyTexSubImage3DEXT)"\n"
+".set "GLAPI_PREFIX_STR(CopyTexSubImage3DEXT)", "GLAPI_PREFIX_STR(CopyTexSubImage3D)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(ActiveTextureARB))"\n"
+"\t"STUB_ASM_CODE("374")"\n"
+
+".globl "GLAPI_PREFIX_STR(ActiveTexture)"\n"
+".set "GLAPI_PREFIX_STR(ActiveTexture)", "GLAPI_PREFIX_STR(ActiveTextureARB)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(ClientActiveTextureARB))"\n"
+"\t"STUB_ASM_CODE("375")"\n"
+
+".globl "GLAPI_PREFIX_STR(ClientActiveTexture)"\n"
+".set "GLAPI_PREFIX_STR(ClientActiveTexture)", "GLAPI_PREFIX_STR(ClientActiveTextureARB)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(MultiTexCoord1dARB))"\n"
+"\t"STUB_ASM_CODE("376")"\n"
+
+".globl "GLAPI_PREFIX_STR(MultiTexCoord1d)"\n"
+".set "GLAPI_PREFIX_STR(MultiTexCoord1d)", "GLAPI_PREFIX_STR(MultiTexCoord1dARB)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(MultiTexCoord1dvARB))"\n"
+"\t"STUB_ASM_CODE("377")"\n"
+
+".globl "GLAPI_PREFIX_STR(MultiTexCoord1dv)"\n"
+".set "GLAPI_PREFIX_STR(MultiTexCoord1dv)", "GLAPI_PREFIX_STR(MultiTexCoord1dvARB)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(MultiTexCoord1fARB))"\n"
+"\t"STUB_ASM_CODE("378")"\n"
+
+".globl "GLAPI_PREFIX_STR(MultiTexCoord1f)"\n"
+".set "GLAPI_PREFIX_STR(MultiTexCoord1f)", "GLAPI_PREFIX_STR(MultiTexCoord1fARB)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(MultiTexCoord1fvARB))"\n"
+"\t"STUB_ASM_CODE("379")"\n"
+
+".globl "GLAPI_PREFIX_STR(MultiTexCoord1fv)"\n"
+".set "GLAPI_PREFIX_STR(MultiTexCoord1fv)", "GLAPI_PREFIX_STR(MultiTexCoord1fvARB)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(MultiTexCoord1iARB))"\n"
+"\t"STUB_ASM_CODE("380")"\n"
+
+".globl "GLAPI_PREFIX_STR(MultiTexCoord1i)"\n"
+".set "GLAPI_PREFIX_STR(MultiTexCoord1i)", "GLAPI_PREFIX_STR(MultiTexCoord1iARB)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(MultiTexCoord1ivARB))"\n"
+"\t"STUB_ASM_CODE("381")"\n"
+
+".globl "GLAPI_PREFIX_STR(MultiTexCoord1iv)"\n"
+".set "GLAPI_PREFIX_STR(MultiTexCoord1iv)", "GLAPI_PREFIX_STR(MultiTexCoord1ivARB)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(MultiTexCoord1sARB))"\n"
+"\t"STUB_ASM_CODE("382")"\n"
+
+".globl "GLAPI_PREFIX_STR(MultiTexCoord1s)"\n"
+".set "GLAPI_PREFIX_STR(MultiTexCoord1s)", "GLAPI_PREFIX_STR(MultiTexCoord1sARB)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(MultiTexCoord1svARB))"\n"
+"\t"STUB_ASM_CODE("383")"\n"
+
+".globl "GLAPI_PREFIX_STR(MultiTexCoord1sv)"\n"
+".set "GLAPI_PREFIX_STR(MultiTexCoord1sv)", "GLAPI_PREFIX_STR(MultiTexCoord1svARB)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(MultiTexCoord2dARB))"\n"
+"\t"STUB_ASM_CODE("384")"\n"
+
+".globl "GLAPI_PREFIX_STR(MultiTexCoord2d)"\n"
+".set "GLAPI_PREFIX_STR(MultiTexCoord2d)", "GLAPI_PREFIX_STR(MultiTexCoord2dARB)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(MultiTexCoord2dvARB))"\n"
+"\t"STUB_ASM_CODE("385")"\n"
+
+".globl "GLAPI_PREFIX_STR(MultiTexCoord2dv)"\n"
+".set "GLAPI_PREFIX_STR(MultiTexCoord2dv)", "GLAPI_PREFIX_STR(MultiTexCoord2dvARB)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(MultiTexCoord2fARB))"\n"
+"\t"STUB_ASM_CODE("386")"\n"
+
+".globl "GLAPI_PREFIX_STR(MultiTexCoord2f)"\n"
+".set "GLAPI_PREFIX_STR(MultiTexCoord2f)", "GLAPI_PREFIX_STR(MultiTexCoord2fARB)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(MultiTexCoord2fvARB))"\n"
+"\t"STUB_ASM_CODE("387")"\n"
+
+".globl "GLAPI_PREFIX_STR(MultiTexCoord2fv)"\n"
+".set "GLAPI_PREFIX_STR(MultiTexCoord2fv)", "GLAPI_PREFIX_STR(MultiTexCoord2fvARB)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(MultiTexCoord2iARB))"\n"
+"\t"STUB_ASM_CODE("388")"\n"
+
+".globl "GLAPI_PREFIX_STR(MultiTexCoord2i)"\n"
+".set "GLAPI_PREFIX_STR(MultiTexCoord2i)", "GLAPI_PREFIX_STR(MultiTexCoord2iARB)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(MultiTexCoord2ivARB))"\n"
+"\t"STUB_ASM_CODE("389")"\n"
+
+".globl "GLAPI_PREFIX_STR(MultiTexCoord2iv)"\n"
+".set "GLAPI_PREFIX_STR(MultiTexCoord2iv)", "GLAPI_PREFIX_STR(MultiTexCoord2ivARB)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(MultiTexCoord2sARB))"\n"
+"\t"STUB_ASM_CODE("390")"\n"
+
+".globl "GLAPI_PREFIX_STR(MultiTexCoord2s)"\n"
+".set "GLAPI_PREFIX_STR(MultiTexCoord2s)", "GLAPI_PREFIX_STR(MultiTexCoord2sARB)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(MultiTexCoord2svARB))"\n"
+"\t"STUB_ASM_CODE("391")"\n"
+
+".globl "GLAPI_PREFIX_STR(MultiTexCoord2sv)"\n"
+".set "GLAPI_PREFIX_STR(MultiTexCoord2sv)", "GLAPI_PREFIX_STR(MultiTexCoord2svARB)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(MultiTexCoord3dARB))"\n"
+"\t"STUB_ASM_CODE("392")"\n"
+
+".globl "GLAPI_PREFIX_STR(MultiTexCoord3d)"\n"
+".set "GLAPI_PREFIX_STR(MultiTexCoord3d)", "GLAPI_PREFIX_STR(MultiTexCoord3dARB)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(MultiTexCoord3dvARB))"\n"
+"\t"STUB_ASM_CODE("393")"\n"
+
+".globl "GLAPI_PREFIX_STR(MultiTexCoord3dv)"\n"
+".set "GLAPI_PREFIX_STR(MultiTexCoord3dv)", "GLAPI_PREFIX_STR(MultiTexCoord3dvARB)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(MultiTexCoord3fARB))"\n"
+"\t"STUB_ASM_CODE("394")"\n"
+
+".globl "GLAPI_PREFIX_STR(MultiTexCoord3f)"\n"
+".set "GLAPI_PREFIX_STR(MultiTexCoord3f)", "GLAPI_PREFIX_STR(MultiTexCoord3fARB)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(MultiTexCoord3fvARB))"\n"
+"\t"STUB_ASM_CODE("395")"\n"
+
+".globl "GLAPI_PREFIX_STR(MultiTexCoord3fv)"\n"
+".set "GLAPI_PREFIX_STR(MultiTexCoord3fv)", "GLAPI_PREFIX_STR(MultiTexCoord3fvARB)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(MultiTexCoord3iARB))"\n"
+"\t"STUB_ASM_CODE("396")"\n"
+
+".globl "GLAPI_PREFIX_STR(MultiTexCoord3i)"\n"
+".set "GLAPI_PREFIX_STR(MultiTexCoord3i)", "GLAPI_PREFIX_STR(MultiTexCoord3iARB)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(MultiTexCoord3ivARB))"\n"
+"\t"STUB_ASM_CODE("397")"\n"
+
+".globl "GLAPI_PREFIX_STR(MultiTexCoord3iv)"\n"
+".set "GLAPI_PREFIX_STR(MultiTexCoord3iv)", "GLAPI_PREFIX_STR(MultiTexCoord3ivARB)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(MultiTexCoord3sARB))"\n"
+"\t"STUB_ASM_CODE("398")"\n"
+
+".globl "GLAPI_PREFIX_STR(MultiTexCoord3s)"\n"
+".set "GLAPI_PREFIX_STR(MultiTexCoord3s)", "GLAPI_PREFIX_STR(MultiTexCoord3sARB)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(MultiTexCoord3svARB))"\n"
+"\t"STUB_ASM_CODE("399")"\n"
+
+".globl "GLAPI_PREFIX_STR(MultiTexCoord3sv)"\n"
+".set "GLAPI_PREFIX_STR(MultiTexCoord3sv)", "GLAPI_PREFIX_STR(MultiTexCoord3svARB)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(MultiTexCoord4dARB))"\n"
+"\t"STUB_ASM_CODE("400")"\n"
+
+".globl "GLAPI_PREFIX_STR(MultiTexCoord4d)"\n"
+".set "GLAPI_PREFIX_STR(MultiTexCoord4d)", "GLAPI_PREFIX_STR(MultiTexCoord4dARB)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(MultiTexCoord4dvARB))"\n"
+"\t"STUB_ASM_CODE("401")"\n"
+
+".globl "GLAPI_PREFIX_STR(MultiTexCoord4dv)"\n"
+".set "GLAPI_PREFIX_STR(MultiTexCoord4dv)", "GLAPI_PREFIX_STR(MultiTexCoord4dvARB)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(MultiTexCoord4fARB))"\n"
+"\t"STUB_ASM_CODE("402")"\n"
+
+".globl "GLAPI_PREFIX_STR(MultiTexCoord4f)"\n"
+".set "GLAPI_PREFIX_STR(MultiTexCoord4f)", "GLAPI_PREFIX_STR(MultiTexCoord4fARB)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(MultiTexCoord4fvARB))"\n"
+"\t"STUB_ASM_CODE("403")"\n"
+
+".globl "GLAPI_PREFIX_STR(MultiTexCoord4fv)"\n"
+".set "GLAPI_PREFIX_STR(MultiTexCoord4fv)", "GLAPI_PREFIX_STR(MultiTexCoord4fvARB)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(MultiTexCoord4iARB))"\n"
+"\t"STUB_ASM_CODE("404")"\n"
+
+".globl "GLAPI_PREFIX_STR(MultiTexCoord4i)"\n"
+".set "GLAPI_PREFIX_STR(MultiTexCoord4i)", "GLAPI_PREFIX_STR(MultiTexCoord4iARB)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(MultiTexCoord4ivARB))"\n"
+"\t"STUB_ASM_CODE("405")"\n"
+
+".globl "GLAPI_PREFIX_STR(MultiTexCoord4iv)"\n"
+".set "GLAPI_PREFIX_STR(MultiTexCoord4iv)", "GLAPI_PREFIX_STR(MultiTexCoord4ivARB)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(MultiTexCoord4sARB))"\n"
+"\t"STUB_ASM_CODE("406")"\n"
+
+".globl "GLAPI_PREFIX_STR(MultiTexCoord4s)"\n"
+".set "GLAPI_PREFIX_STR(MultiTexCoord4s)", "GLAPI_PREFIX_STR(MultiTexCoord4sARB)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(MultiTexCoord4svARB))"\n"
+"\t"STUB_ASM_CODE("407")"\n"
+
+".globl "GLAPI_PREFIX_STR(MultiTexCoord4sv)"\n"
+".set "GLAPI_PREFIX_STR(MultiTexCoord4sv)", "GLAPI_PREFIX_STR(MultiTexCoord4svARB)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(AttachShader))"\n"
+"\t"STUB_ASM_CODE("408")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(CreateProgram))"\n"
+"\t"STUB_ASM_CODE("409")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(CreateShader))"\n"
+"\t"STUB_ASM_CODE("410")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(DeleteProgram))"\n"
+"\t"STUB_ASM_CODE("411")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(DeleteShader))"\n"
+"\t"STUB_ASM_CODE("412")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(DetachShader))"\n"
+"\t"STUB_ASM_CODE("413")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetAttachedShaders))"\n"
+"\t"STUB_ASM_CODE("414")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetProgramInfoLog))"\n"
+"\t"STUB_ASM_CODE("415")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetProgramiv))"\n"
+"\t"STUB_ASM_CODE("416")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetShaderInfoLog))"\n"
+"\t"STUB_ASM_CODE("417")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetShaderiv))"\n"
+"\t"STUB_ASM_CODE("418")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(IsProgram))"\n"
+"\t"STUB_ASM_CODE("419")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(IsShader))"\n"
+"\t"STUB_ASM_CODE("420")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(StencilFuncSeparate))"\n"
+"\t"STUB_ASM_CODE("421")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(StencilMaskSeparate))"\n"
+"\t"STUB_ASM_CODE("422")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(StencilOpSeparate))"\n"
+"\t"STUB_ASM_CODE("423")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(UniformMatrix2x3fv))"\n"
+"\t"STUB_ASM_CODE("424")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(UniformMatrix2x4fv))"\n"
+"\t"STUB_ASM_CODE("425")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(UniformMatrix3x2fv))"\n"
+"\t"STUB_ASM_CODE("426")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(UniformMatrix3x4fv))"\n"
+"\t"STUB_ASM_CODE("427")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(UniformMatrix4x2fv))"\n"
+"\t"STUB_ASM_CODE("428")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(UniformMatrix4x3fv))"\n"
+"\t"STUB_ASM_CODE("429")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(ClampColor))"\n"
+"\t"STUB_ASM_CODE("430")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(ClearBufferfi))"\n"
+"\t"STUB_ASM_CODE("431")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(ClearBufferfv))"\n"
+"\t"STUB_ASM_CODE("432")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(ClearBufferiv))"\n"
+"\t"STUB_ASM_CODE("433")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(ClearBufferuiv))"\n"
+"\t"STUB_ASM_CODE("434")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetStringi))"\n"
+"\t"STUB_ASM_CODE("435")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(TexBuffer))"\n"
+"\t"STUB_ASM_CODE("436")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(FramebufferTexture))"\n"
+"\t"STUB_ASM_CODE("437")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetBufferParameteri64v))"\n"
+"\t"STUB_ASM_CODE("438")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetInteger64i_v))"\n"
+"\t"STUB_ASM_CODE("439")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttribDivisor))"\n"
+"\t"STUB_ASM_CODE("440")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(LoadTransposeMatrixdARB))"\n"
+"\t"STUB_ASM_CODE("441")"\n"
+
+".globl "GLAPI_PREFIX_STR(LoadTransposeMatrixd)"\n"
+".set "GLAPI_PREFIX_STR(LoadTransposeMatrixd)", "GLAPI_PREFIX_STR(LoadTransposeMatrixdARB)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(LoadTransposeMatrixfARB))"\n"
+"\t"STUB_ASM_CODE("442")"\n"
+
+".globl "GLAPI_PREFIX_STR(LoadTransposeMatrixf)"\n"
+".set "GLAPI_PREFIX_STR(LoadTransposeMatrixf)", "GLAPI_PREFIX_STR(LoadTransposeMatrixfARB)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(MultTransposeMatrixdARB))"\n"
+"\t"STUB_ASM_CODE("443")"\n"
+
+".globl "GLAPI_PREFIX_STR(MultTransposeMatrixd)"\n"
+".set "GLAPI_PREFIX_STR(MultTransposeMatrixd)", "GLAPI_PREFIX_STR(MultTransposeMatrixdARB)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(MultTransposeMatrixfARB))"\n"
+"\t"STUB_ASM_CODE("444")"\n"
+
+".globl "GLAPI_PREFIX_STR(MultTransposeMatrixf)"\n"
+".set "GLAPI_PREFIX_STR(MultTransposeMatrixf)", "GLAPI_PREFIX_STR(MultTransposeMatrixfARB)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(SampleCoverageARB))"\n"
+"\t"STUB_ASM_CODE("445")"\n"
+
+".globl "GLAPI_PREFIX_STR(SampleCoverage)"\n"
+".set "GLAPI_PREFIX_STR(SampleCoverage)", "GLAPI_PREFIX_STR(SampleCoverageARB)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(CompressedTexImage1DARB))"\n"
+"\t"STUB_ASM_CODE("446")"\n"
+
+".globl "GLAPI_PREFIX_STR(CompressedTexImage1D)"\n"
+".set "GLAPI_PREFIX_STR(CompressedTexImage1D)", "GLAPI_PREFIX_STR(CompressedTexImage1DARB)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(CompressedTexImage2DARB))"\n"
+"\t"STUB_ASM_CODE("447")"\n"
+
+".globl "GLAPI_PREFIX_STR(CompressedTexImage2D)"\n"
+".set "GLAPI_PREFIX_STR(CompressedTexImage2D)", "GLAPI_PREFIX_STR(CompressedTexImage2DARB)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(CompressedTexImage3DARB))"\n"
+"\t"STUB_ASM_CODE("448")"\n"
+
+".globl "GLAPI_PREFIX_STR(CompressedTexImage3D)"\n"
+".set "GLAPI_PREFIX_STR(CompressedTexImage3D)", "GLAPI_PREFIX_STR(CompressedTexImage3DARB)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(CompressedTexSubImage1DARB))"\n"
+"\t"STUB_ASM_CODE("449")"\n"
+
+".globl "GLAPI_PREFIX_STR(CompressedTexSubImage1D)"\n"
+".set "GLAPI_PREFIX_STR(CompressedTexSubImage1D)", "GLAPI_PREFIX_STR(CompressedTexSubImage1DARB)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(CompressedTexSubImage2DARB))"\n"
+"\t"STUB_ASM_CODE("450")"\n"
+
+".globl "GLAPI_PREFIX_STR(CompressedTexSubImage2D)"\n"
+".set "GLAPI_PREFIX_STR(CompressedTexSubImage2D)", "GLAPI_PREFIX_STR(CompressedTexSubImage2DARB)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(CompressedTexSubImage3DARB))"\n"
+"\t"STUB_ASM_CODE("451")"\n"
+
+".globl "GLAPI_PREFIX_STR(CompressedTexSubImage3D)"\n"
+".set "GLAPI_PREFIX_STR(CompressedTexSubImage3D)", "GLAPI_PREFIX_STR(CompressedTexSubImage3DARB)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetCompressedTexImageARB))"\n"
+"\t"STUB_ASM_CODE("452")"\n"
+
+".globl "GLAPI_PREFIX_STR(GetCompressedTexImage)"\n"
+".set "GLAPI_PREFIX_STR(GetCompressedTexImage)", "GLAPI_PREFIX_STR(GetCompressedTexImageARB)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(DisableVertexAttribArrayARB))"\n"
+"\t"STUB_ASM_CODE("453")"\n"
+
+".globl "GLAPI_PREFIX_STR(DisableVertexAttribArray)"\n"
+".set "GLAPI_PREFIX_STR(DisableVertexAttribArray)", "GLAPI_PREFIX_STR(DisableVertexAttribArrayARB)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(EnableVertexAttribArrayARB))"\n"
+"\t"STUB_ASM_CODE("454")"\n"
+
+".globl "GLAPI_PREFIX_STR(EnableVertexAttribArray)"\n"
+".set "GLAPI_PREFIX_STR(EnableVertexAttribArray)", "GLAPI_PREFIX_STR(EnableVertexAttribArrayARB)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetProgramEnvParameterdvARB))"\n"
+"\t"STUB_ASM_CODE("455")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetProgramEnvParameterfvARB))"\n"
+"\t"STUB_ASM_CODE("456")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetProgramLocalParameterdvARB))"\n"
+"\t"STUB_ASM_CODE("457")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetProgramLocalParameterfvARB))"\n"
+"\t"STUB_ASM_CODE("458")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetProgramStringARB))"\n"
+"\t"STUB_ASM_CODE("459")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetProgramivARB))"\n"
+"\t"STUB_ASM_CODE("460")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetVertexAttribdvARB))"\n"
+"\t"STUB_ASM_CODE("461")"\n"
+
+".globl "GLAPI_PREFIX_STR(GetVertexAttribdv)"\n"
+".set "GLAPI_PREFIX_STR(GetVertexAttribdv)", "GLAPI_PREFIX_STR(GetVertexAttribdvARB)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetVertexAttribfvARB))"\n"
+"\t"STUB_ASM_CODE("462")"\n"
+
+".globl "GLAPI_PREFIX_STR(GetVertexAttribfv)"\n"
+".set "GLAPI_PREFIX_STR(GetVertexAttribfv)", "GLAPI_PREFIX_STR(GetVertexAttribfvARB)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetVertexAttribivARB))"\n"
+"\t"STUB_ASM_CODE("463")"\n"
+
+".globl "GLAPI_PREFIX_STR(GetVertexAttribiv)"\n"
+".set "GLAPI_PREFIX_STR(GetVertexAttribiv)", "GLAPI_PREFIX_STR(GetVertexAttribivARB)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(ProgramEnvParameter4dARB))"\n"
+"\t"STUB_ASM_CODE("464")"\n"
+
+".globl "GLAPI_PREFIX_STR(ProgramParameter4dNV)"\n"
+".set "GLAPI_PREFIX_STR(ProgramParameter4dNV)", "GLAPI_PREFIX_STR(ProgramEnvParameter4dARB)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(ProgramEnvParameter4dvARB))"\n"
+"\t"STUB_ASM_CODE("465")"\n"
+
+".globl "GLAPI_PREFIX_STR(ProgramParameter4dvNV)"\n"
+".set "GLAPI_PREFIX_STR(ProgramParameter4dvNV)", "GLAPI_PREFIX_STR(ProgramEnvParameter4dvARB)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(ProgramEnvParameter4fARB))"\n"
+"\t"STUB_ASM_CODE("466")"\n"
+
+".globl "GLAPI_PREFIX_STR(ProgramParameter4fNV)"\n"
+".set "GLAPI_PREFIX_STR(ProgramParameter4fNV)", "GLAPI_PREFIX_STR(ProgramEnvParameter4fARB)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(ProgramEnvParameter4fvARB))"\n"
+"\t"STUB_ASM_CODE("467")"\n"
+
+".globl "GLAPI_PREFIX_STR(ProgramParameter4fvNV)"\n"
+".set "GLAPI_PREFIX_STR(ProgramParameter4fvNV)", "GLAPI_PREFIX_STR(ProgramEnvParameter4fvARB)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(ProgramLocalParameter4dARB))"\n"
+"\t"STUB_ASM_CODE("468")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(ProgramLocalParameter4dvARB))"\n"
+"\t"STUB_ASM_CODE("469")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(ProgramLocalParameter4fARB))"\n"
+"\t"STUB_ASM_CODE("470")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(ProgramLocalParameter4fvARB))"\n"
+"\t"STUB_ASM_CODE("471")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(ProgramStringARB))"\n"
+"\t"STUB_ASM_CODE("472")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttrib1dARB))"\n"
+"\t"STUB_ASM_CODE("473")"\n"
+
+".globl "GLAPI_PREFIX_STR(VertexAttrib1d)"\n"
+".set "GLAPI_PREFIX_STR(VertexAttrib1d)", "GLAPI_PREFIX_STR(VertexAttrib1dARB)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttrib1dvARB))"\n"
+"\t"STUB_ASM_CODE("474")"\n"
+
+".globl "GLAPI_PREFIX_STR(VertexAttrib1dv)"\n"
+".set "GLAPI_PREFIX_STR(VertexAttrib1dv)", "GLAPI_PREFIX_STR(VertexAttrib1dvARB)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttrib1fARB))"\n"
+"\t"STUB_ASM_CODE("475")"\n"
+
+".globl "GLAPI_PREFIX_STR(VertexAttrib1f)"\n"
+".set "GLAPI_PREFIX_STR(VertexAttrib1f)", "GLAPI_PREFIX_STR(VertexAttrib1fARB)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttrib1fvARB))"\n"
+"\t"STUB_ASM_CODE("476")"\n"
+
+".globl "GLAPI_PREFIX_STR(VertexAttrib1fv)"\n"
+".set "GLAPI_PREFIX_STR(VertexAttrib1fv)", "GLAPI_PREFIX_STR(VertexAttrib1fvARB)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttrib1sARB))"\n"
+"\t"STUB_ASM_CODE("477")"\n"
+
+".globl "GLAPI_PREFIX_STR(VertexAttrib1s)"\n"
+".set "GLAPI_PREFIX_STR(VertexAttrib1s)", "GLAPI_PREFIX_STR(VertexAttrib1sARB)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttrib1svARB))"\n"
+"\t"STUB_ASM_CODE("478")"\n"
+
+".globl "GLAPI_PREFIX_STR(VertexAttrib1sv)"\n"
+".set "GLAPI_PREFIX_STR(VertexAttrib1sv)", "GLAPI_PREFIX_STR(VertexAttrib1svARB)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttrib2dARB))"\n"
+"\t"STUB_ASM_CODE("479")"\n"
+
+".globl "GLAPI_PREFIX_STR(VertexAttrib2d)"\n"
+".set "GLAPI_PREFIX_STR(VertexAttrib2d)", "GLAPI_PREFIX_STR(VertexAttrib2dARB)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttrib2dvARB))"\n"
+"\t"STUB_ASM_CODE("480")"\n"
+
+".globl "GLAPI_PREFIX_STR(VertexAttrib2dv)"\n"
+".set "GLAPI_PREFIX_STR(VertexAttrib2dv)", "GLAPI_PREFIX_STR(VertexAttrib2dvARB)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttrib2fARB))"\n"
+"\t"STUB_ASM_CODE("481")"\n"
+
+".globl "GLAPI_PREFIX_STR(VertexAttrib2f)"\n"
+".set "GLAPI_PREFIX_STR(VertexAttrib2f)", "GLAPI_PREFIX_STR(VertexAttrib2fARB)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttrib2fvARB))"\n"
+"\t"STUB_ASM_CODE("482")"\n"
+
+".globl "GLAPI_PREFIX_STR(VertexAttrib2fv)"\n"
+".set "GLAPI_PREFIX_STR(VertexAttrib2fv)", "GLAPI_PREFIX_STR(VertexAttrib2fvARB)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttrib2sARB))"\n"
+"\t"STUB_ASM_CODE("483")"\n"
+
+".globl "GLAPI_PREFIX_STR(VertexAttrib2s)"\n"
+".set "GLAPI_PREFIX_STR(VertexAttrib2s)", "GLAPI_PREFIX_STR(VertexAttrib2sARB)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttrib2svARB))"\n"
+"\t"STUB_ASM_CODE("484")"\n"
+
+".globl "GLAPI_PREFIX_STR(VertexAttrib2sv)"\n"
+".set "GLAPI_PREFIX_STR(VertexAttrib2sv)", "GLAPI_PREFIX_STR(VertexAttrib2svARB)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttrib3dARB))"\n"
+"\t"STUB_ASM_CODE("485")"\n"
+
+".globl "GLAPI_PREFIX_STR(VertexAttrib3d)"\n"
+".set "GLAPI_PREFIX_STR(VertexAttrib3d)", "GLAPI_PREFIX_STR(VertexAttrib3dARB)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttrib3dvARB))"\n"
+"\t"STUB_ASM_CODE("486")"\n"
+
+".globl "GLAPI_PREFIX_STR(VertexAttrib3dv)"\n"
+".set "GLAPI_PREFIX_STR(VertexAttrib3dv)", "GLAPI_PREFIX_STR(VertexAttrib3dvARB)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttrib3fARB))"\n"
+"\t"STUB_ASM_CODE("487")"\n"
+
+".globl "GLAPI_PREFIX_STR(VertexAttrib3f)"\n"
+".set "GLAPI_PREFIX_STR(VertexAttrib3f)", "GLAPI_PREFIX_STR(VertexAttrib3fARB)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttrib3fvARB))"\n"
+"\t"STUB_ASM_CODE("488")"\n"
+
+".globl "GLAPI_PREFIX_STR(VertexAttrib3fv)"\n"
+".set "GLAPI_PREFIX_STR(VertexAttrib3fv)", "GLAPI_PREFIX_STR(VertexAttrib3fvARB)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttrib3sARB))"\n"
+"\t"STUB_ASM_CODE("489")"\n"
+
+".globl "GLAPI_PREFIX_STR(VertexAttrib3s)"\n"
+".set "GLAPI_PREFIX_STR(VertexAttrib3s)", "GLAPI_PREFIX_STR(VertexAttrib3sARB)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttrib3svARB))"\n"
+"\t"STUB_ASM_CODE("490")"\n"
+
+".globl "GLAPI_PREFIX_STR(VertexAttrib3sv)"\n"
+".set "GLAPI_PREFIX_STR(VertexAttrib3sv)", "GLAPI_PREFIX_STR(VertexAttrib3svARB)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttrib4NbvARB))"\n"
+"\t"STUB_ASM_CODE("491")"\n"
+
+".globl "GLAPI_PREFIX_STR(VertexAttrib4Nbv)"\n"
+".set "GLAPI_PREFIX_STR(VertexAttrib4Nbv)", "GLAPI_PREFIX_STR(VertexAttrib4NbvARB)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttrib4NivARB))"\n"
+"\t"STUB_ASM_CODE("492")"\n"
+
+".globl "GLAPI_PREFIX_STR(VertexAttrib4Niv)"\n"
+".set "GLAPI_PREFIX_STR(VertexAttrib4Niv)", "GLAPI_PREFIX_STR(VertexAttrib4NivARB)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttrib4NsvARB))"\n"
+"\t"STUB_ASM_CODE("493")"\n"
+
+".globl "GLAPI_PREFIX_STR(VertexAttrib4Nsv)"\n"
+".set "GLAPI_PREFIX_STR(VertexAttrib4Nsv)", "GLAPI_PREFIX_STR(VertexAttrib4NsvARB)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttrib4NubARB))"\n"
+"\t"STUB_ASM_CODE("494")"\n"
+
+".globl "GLAPI_PREFIX_STR(VertexAttrib4Nub)"\n"
+".set "GLAPI_PREFIX_STR(VertexAttrib4Nub)", "GLAPI_PREFIX_STR(VertexAttrib4NubARB)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttrib4NubvARB))"\n"
+"\t"STUB_ASM_CODE("495")"\n"
+
+".globl "GLAPI_PREFIX_STR(VertexAttrib4Nubv)"\n"
+".set "GLAPI_PREFIX_STR(VertexAttrib4Nubv)", "GLAPI_PREFIX_STR(VertexAttrib4NubvARB)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttrib4NuivARB))"\n"
+"\t"STUB_ASM_CODE("496")"\n"
+
+".globl "GLAPI_PREFIX_STR(VertexAttrib4Nuiv)"\n"
+".set "GLAPI_PREFIX_STR(VertexAttrib4Nuiv)", "GLAPI_PREFIX_STR(VertexAttrib4NuivARB)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttrib4NusvARB))"\n"
+"\t"STUB_ASM_CODE("497")"\n"
+
+".globl "GLAPI_PREFIX_STR(VertexAttrib4Nusv)"\n"
+".set "GLAPI_PREFIX_STR(VertexAttrib4Nusv)", "GLAPI_PREFIX_STR(VertexAttrib4NusvARB)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttrib4bvARB))"\n"
+"\t"STUB_ASM_CODE("498")"\n"
+
+".globl "GLAPI_PREFIX_STR(VertexAttrib4bv)"\n"
+".set "GLAPI_PREFIX_STR(VertexAttrib4bv)", "GLAPI_PREFIX_STR(VertexAttrib4bvARB)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttrib4dARB))"\n"
+"\t"STUB_ASM_CODE("499")"\n"
+
+".globl "GLAPI_PREFIX_STR(VertexAttrib4d)"\n"
+".set "GLAPI_PREFIX_STR(VertexAttrib4d)", "GLAPI_PREFIX_STR(VertexAttrib4dARB)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttrib4dvARB))"\n"
+"\t"STUB_ASM_CODE("500")"\n"
+
+".globl "GLAPI_PREFIX_STR(VertexAttrib4dv)"\n"
+".set "GLAPI_PREFIX_STR(VertexAttrib4dv)", "GLAPI_PREFIX_STR(VertexAttrib4dvARB)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttrib4fARB))"\n"
+"\t"STUB_ASM_CODE("501")"\n"
+
+".globl "GLAPI_PREFIX_STR(VertexAttrib4f)"\n"
+".set "GLAPI_PREFIX_STR(VertexAttrib4f)", "GLAPI_PREFIX_STR(VertexAttrib4fARB)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttrib4fvARB))"\n"
+"\t"STUB_ASM_CODE("502")"\n"
+
+".globl "GLAPI_PREFIX_STR(VertexAttrib4fv)"\n"
+".set "GLAPI_PREFIX_STR(VertexAttrib4fv)", "GLAPI_PREFIX_STR(VertexAttrib4fvARB)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttrib4ivARB))"\n"
+"\t"STUB_ASM_CODE("503")"\n"
+
+".globl "GLAPI_PREFIX_STR(VertexAttrib4iv)"\n"
+".set "GLAPI_PREFIX_STR(VertexAttrib4iv)", "GLAPI_PREFIX_STR(VertexAttrib4ivARB)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttrib4sARB))"\n"
+"\t"STUB_ASM_CODE("504")"\n"
+
+".globl "GLAPI_PREFIX_STR(VertexAttrib4s)"\n"
+".set "GLAPI_PREFIX_STR(VertexAttrib4s)", "GLAPI_PREFIX_STR(VertexAttrib4sARB)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttrib4svARB))"\n"
+"\t"STUB_ASM_CODE("505")"\n"
+
+".globl "GLAPI_PREFIX_STR(VertexAttrib4sv)"\n"
+".set "GLAPI_PREFIX_STR(VertexAttrib4sv)", "GLAPI_PREFIX_STR(VertexAttrib4svARB)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttrib4ubvARB))"\n"
+"\t"STUB_ASM_CODE("506")"\n"
+
+".globl "GLAPI_PREFIX_STR(VertexAttrib4ubv)"\n"
+".set "GLAPI_PREFIX_STR(VertexAttrib4ubv)", "GLAPI_PREFIX_STR(VertexAttrib4ubvARB)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttrib4uivARB))"\n"
+"\t"STUB_ASM_CODE("507")"\n"
+
+".globl "GLAPI_PREFIX_STR(VertexAttrib4uiv)"\n"
+".set "GLAPI_PREFIX_STR(VertexAttrib4uiv)", "GLAPI_PREFIX_STR(VertexAttrib4uivARB)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttrib4usvARB))"\n"
+"\t"STUB_ASM_CODE("508")"\n"
+
+".globl "GLAPI_PREFIX_STR(VertexAttrib4usv)"\n"
+".set "GLAPI_PREFIX_STR(VertexAttrib4usv)", "GLAPI_PREFIX_STR(VertexAttrib4usvARB)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttribPointerARB))"\n"
+"\t"STUB_ASM_CODE("509")"\n"
+
+".globl "GLAPI_PREFIX_STR(VertexAttribPointer)"\n"
+".set "GLAPI_PREFIX_STR(VertexAttribPointer)", "GLAPI_PREFIX_STR(VertexAttribPointerARB)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(BindBufferARB))"\n"
+"\t"STUB_ASM_CODE("510")"\n"
+
+".globl "GLAPI_PREFIX_STR(BindBuffer)"\n"
+".set "GLAPI_PREFIX_STR(BindBuffer)", "GLAPI_PREFIX_STR(BindBufferARB)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(BufferDataARB))"\n"
+"\t"STUB_ASM_CODE("511")"\n"
+
+".globl "GLAPI_PREFIX_STR(BufferData)"\n"
+".set "GLAPI_PREFIX_STR(BufferData)", "GLAPI_PREFIX_STR(BufferDataARB)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(BufferSubDataARB))"\n"
+"\t"STUB_ASM_CODE("512")"\n"
+
+".globl "GLAPI_PREFIX_STR(BufferSubData)"\n"
+".set "GLAPI_PREFIX_STR(BufferSubData)", "GLAPI_PREFIX_STR(BufferSubDataARB)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(DeleteBuffersARB))"\n"
+"\t"STUB_ASM_CODE("513")"\n"
+
+".globl "GLAPI_PREFIX_STR(DeleteBuffers)"\n"
+".set "GLAPI_PREFIX_STR(DeleteBuffers)", "GLAPI_PREFIX_STR(DeleteBuffersARB)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GenBuffersARB))"\n"
+"\t"STUB_ASM_CODE("514")"\n"
+
+".globl "GLAPI_PREFIX_STR(GenBuffers)"\n"
+".set "GLAPI_PREFIX_STR(GenBuffers)", "GLAPI_PREFIX_STR(GenBuffersARB)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetBufferParameterivARB))"\n"
+"\t"STUB_ASM_CODE("515")"\n"
+
+".globl "GLAPI_PREFIX_STR(GetBufferParameteriv)"\n"
+".set "GLAPI_PREFIX_STR(GetBufferParameteriv)", "GLAPI_PREFIX_STR(GetBufferParameterivARB)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetBufferPointervARB))"\n"
+"\t"STUB_ASM_CODE("516")"\n"
+
+".globl "GLAPI_PREFIX_STR(GetBufferPointerv)"\n"
+".set "GLAPI_PREFIX_STR(GetBufferPointerv)", "GLAPI_PREFIX_STR(GetBufferPointervARB)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetBufferSubDataARB))"\n"
+"\t"STUB_ASM_CODE("517")"\n"
+
+".globl "GLAPI_PREFIX_STR(GetBufferSubData)"\n"
+".set "GLAPI_PREFIX_STR(GetBufferSubData)", "GLAPI_PREFIX_STR(GetBufferSubDataARB)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(IsBufferARB))"\n"
+"\t"STUB_ASM_CODE("518")"\n"
+
+".globl "GLAPI_PREFIX_STR(IsBuffer)"\n"
+".set "GLAPI_PREFIX_STR(IsBuffer)", "GLAPI_PREFIX_STR(IsBufferARB)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(MapBufferARB))"\n"
+"\t"STUB_ASM_CODE("519")"\n"
+
+".globl "GLAPI_PREFIX_STR(MapBuffer)"\n"
+".set "GLAPI_PREFIX_STR(MapBuffer)", "GLAPI_PREFIX_STR(MapBufferARB)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(UnmapBufferARB))"\n"
+"\t"STUB_ASM_CODE("520")"\n"
+
+".globl "GLAPI_PREFIX_STR(UnmapBuffer)"\n"
+".set "GLAPI_PREFIX_STR(UnmapBuffer)", "GLAPI_PREFIX_STR(UnmapBufferARB)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(BeginQueryARB))"\n"
+"\t"STUB_ASM_CODE("521")"\n"
+
+".globl "GLAPI_PREFIX_STR(BeginQuery)"\n"
+".set "GLAPI_PREFIX_STR(BeginQuery)", "GLAPI_PREFIX_STR(BeginQueryARB)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(DeleteQueriesARB))"\n"
+"\t"STUB_ASM_CODE("522")"\n"
+
+".globl "GLAPI_PREFIX_STR(DeleteQueries)"\n"
+".set "GLAPI_PREFIX_STR(DeleteQueries)", "GLAPI_PREFIX_STR(DeleteQueriesARB)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(EndQueryARB))"\n"
+"\t"STUB_ASM_CODE("523")"\n"
+
+".globl "GLAPI_PREFIX_STR(EndQuery)"\n"
+".set "GLAPI_PREFIX_STR(EndQuery)", "GLAPI_PREFIX_STR(EndQueryARB)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GenQueriesARB))"\n"
+"\t"STUB_ASM_CODE("524")"\n"
+
+".globl "GLAPI_PREFIX_STR(GenQueries)"\n"
+".set "GLAPI_PREFIX_STR(GenQueries)", "GLAPI_PREFIX_STR(GenQueriesARB)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetQueryObjectivARB))"\n"
+"\t"STUB_ASM_CODE("525")"\n"
+
+".globl "GLAPI_PREFIX_STR(GetQueryObjectiv)"\n"
+".set "GLAPI_PREFIX_STR(GetQueryObjectiv)", "GLAPI_PREFIX_STR(GetQueryObjectivARB)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetQueryObjectuivARB))"\n"
+"\t"STUB_ASM_CODE("526")"\n"
+
+".globl "GLAPI_PREFIX_STR(GetQueryObjectuiv)"\n"
+".set "GLAPI_PREFIX_STR(GetQueryObjectuiv)", "GLAPI_PREFIX_STR(GetQueryObjectuivARB)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetQueryivARB))"\n"
+"\t"STUB_ASM_CODE("527")"\n"
+
+".globl "GLAPI_PREFIX_STR(GetQueryiv)"\n"
+".set "GLAPI_PREFIX_STR(GetQueryiv)", "GLAPI_PREFIX_STR(GetQueryivARB)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(IsQueryARB))"\n"
+"\t"STUB_ASM_CODE("528")"\n"
+
+".globl "GLAPI_PREFIX_STR(IsQuery)"\n"
+".set "GLAPI_PREFIX_STR(IsQuery)", "GLAPI_PREFIX_STR(IsQueryARB)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(AttachObjectARB))"\n"
+"\t"STUB_ASM_CODE("529")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(CompileShaderARB))"\n"
+"\t"STUB_ASM_CODE("530")"\n"
+
+".globl "GLAPI_PREFIX_STR(CompileShader)"\n"
+".set "GLAPI_PREFIX_STR(CompileShader)", "GLAPI_PREFIX_STR(CompileShaderARB)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(CreateProgramObjectARB))"\n"
+"\t"STUB_ASM_CODE("531")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(CreateShaderObjectARB))"\n"
+"\t"STUB_ASM_CODE("532")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(DeleteObjectARB))"\n"
+"\t"STUB_ASM_CODE("533")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(DetachObjectARB))"\n"
+"\t"STUB_ASM_CODE("534")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetActiveUniformARB))"\n"
+"\t"STUB_ASM_CODE("535")"\n"
+
+".globl "GLAPI_PREFIX_STR(GetActiveUniform)"\n"
+".set "GLAPI_PREFIX_STR(GetActiveUniform)", "GLAPI_PREFIX_STR(GetActiveUniformARB)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetAttachedObjectsARB))"\n"
+"\t"STUB_ASM_CODE("536")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetHandleARB))"\n"
+"\t"STUB_ASM_CODE("537")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetInfoLogARB))"\n"
+"\t"STUB_ASM_CODE("538")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetObjectParameterfvARB))"\n"
+"\t"STUB_ASM_CODE("539")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetObjectParameterivARB))"\n"
+"\t"STUB_ASM_CODE("540")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetShaderSourceARB))"\n"
+"\t"STUB_ASM_CODE("541")"\n"
+
+".globl "GLAPI_PREFIX_STR(GetShaderSource)"\n"
+".set "GLAPI_PREFIX_STR(GetShaderSource)", "GLAPI_PREFIX_STR(GetShaderSourceARB)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetUniformLocationARB))"\n"
+"\t"STUB_ASM_CODE("542")"\n"
+
+".globl "GLAPI_PREFIX_STR(GetUniformLocation)"\n"
+".set "GLAPI_PREFIX_STR(GetUniformLocation)", "GLAPI_PREFIX_STR(GetUniformLocationARB)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetUniformfvARB))"\n"
+"\t"STUB_ASM_CODE("543")"\n"
+
+".globl "GLAPI_PREFIX_STR(GetUniformfv)"\n"
+".set "GLAPI_PREFIX_STR(GetUniformfv)", "GLAPI_PREFIX_STR(GetUniformfvARB)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetUniformivARB))"\n"
+"\t"STUB_ASM_CODE("544")"\n"
+
+".globl "GLAPI_PREFIX_STR(GetUniformiv)"\n"
+".set "GLAPI_PREFIX_STR(GetUniformiv)", "GLAPI_PREFIX_STR(GetUniformivARB)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(LinkProgramARB))"\n"
+"\t"STUB_ASM_CODE("545")"\n"
+
+".globl "GLAPI_PREFIX_STR(LinkProgram)"\n"
+".set "GLAPI_PREFIX_STR(LinkProgram)", "GLAPI_PREFIX_STR(LinkProgramARB)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(ShaderSourceARB))"\n"
+"\t"STUB_ASM_CODE("546")"\n"
+
+".globl "GLAPI_PREFIX_STR(ShaderSource)"\n"
+".set "GLAPI_PREFIX_STR(ShaderSource)", "GLAPI_PREFIX_STR(ShaderSourceARB)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Uniform1fARB))"\n"
+"\t"STUB_ASM_CODE("547")"\n"
+
+".globl "GLAPI_PREFIX_STR(Uniform1f)"\n"
+".set "GLAPI_PREFIX_STR(Uniform1f)", "GLAPI_PREFIX_STR(Uniform1fARB)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Uniform1fvARB))"\n"
+"\t"STUB_ASM_CODE("548")"\n"
+
+".globl "GLAPI_PREFIX_STR(Uniform1fv)"\n"
+".set "GLAPI_PREFIX_STR(Uniform1fv)", "GLAPI_PREFIX_STR(Uniform1fvARB)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Uniform1iARB))"\n"
+"\t"STUB_ASM_CODE("549")"\n"
+
+".globl "GLAPI_PREFIX_STR(Uniform1i)"\n"
+".set "GLAPI_PREFIX_STR(Uniform1i)", "GLAPI_PREFIX_STR(Uniform1iARB)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Uniform1ivARB))"\n"
+"\t"STUB_ASM_CODE("550")"\n"
+
+".globl "GLAPI_PREFIX_STR(Uniform1iv)"\n"
+".set "GLAPI_PREFIX_STR(Uniform1iv)", "GLAPI_PREFIX_STR(Uniform1ivARB)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Uniform2fARB))"\n"
+"\t"STUB_ASM_CODE("551")"\n"
+
+".globl "GLAPI_PREFIX_STR(Uniform2f)"\n"
+".set "GLAPI_PREFIX_STR(Uniform2f)", "GLAPI_PREFIX_STR(Uniform2fARB)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Uniform2fvARB))"\n"
+"\t"STUB_ASM_CODE("552")"\n"
+
+".globl "GLAPI_PREFIX_STR(Uniform2fv)"\n"
+".set "GLAPI_PREFIX_STR(Uniform2fv)", "GLAPI_PREFIX_STR(Uniform2fvARB)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Uniform2iARB))"\n"
+"\t"STUB_ASM_CODE("553")"\n"
+
+".globl "GLAPI_PREFIX_STR(Uniform2i)"\n"
+".set "GLAPI_PREFIX_STR(Uniform2i)", "GLAPI_PREFIX_STR(Uniform2iARB)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Uniform2ivARB))"\n"
+"\t"STUB_ASM_CODE("554")"\n"
+
+".globl "GLAPI_PREFIX_STR(Uniform2iv)"\n"
+".set "GLAPI_PREFIX_STR(Uniform2iv)", "GLAPI_PREFIX_STR(Uniform2ivARB)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Uniform3fARB))"\n"
+"\t"STUB_ASM_CODE("555")"\n"
+
+".globl "GLAPI_PREFIX_STR(Uniform3f)"\n"
+".set "GLAPI_PREFIX_STR(Uniform3f)", "GLAPI_PREFIX_STR(Uniform3fARB)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Uniform3fvARB))"\n"
+"\t"STUB_ASM_CODE("556")"\n"
+
+".globl "GLAPI_PREFIX_STR(Uniform3fv)"\n"
+".set "GLAPI_PREFIX_STR(Uniform3fv)", "GLAPI_PREFIX_STR(Uniform3fvARB)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Uniform3iARB))"\n"
+"\t"STUB_ASM_CODE("557")"\n"
+
+".globl "GLAPI_PREFIX_STR(Uniform3i)"\n"
+".set "GLAPI_PREFIX_STR(Uniform3i)", "GLAPI_PREFIX_STR(Uniform3iARB)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Uniform3ivARB))"\n"
+"\t"STUB_ASM_CODE("558")"\n"
+
+".globl "GLAPI_PREFIX_STR(Uniform3iv)"\n"
+".set "GLAPI_PREFIX_STR(Uniform3iv)", "GLAPI_PREFIX_STR(Uniform3ivARB)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Uniform4fARB))"\n"
+"\t"STUB_ASM_CODE("559")"\n"
+
+".globl "GLAPI_PREFIX_STR(Uniform4f)"\n"
+".set "GLAPI_PREFIX_STR(Uniform4f)", "GLAPI_PREFIX_STR(Uniform4fARB)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Uniform4fvARB))"\n"
+"\t"STUB_ASM_CODE("560")"\n"
+
+".globl "GLAPI_PREFIX_STR(Uniform4fv)"\n"
+".set "GLAPI_PREFIX_STR(Uniform4fv)", "GLAPI_PREFIX_STR(Uniform4fvARB)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Uniform4iARB))"\n"
+"\t"STUB_ASM_CODE("561")"\n"
+
+".globl "GLAPI_PREFIX_STR(Uniform4i)"\n"
+".set "GLAPI_PREFIX_STR(Uniform4i)", "GLAPI_PREFIX_STR(Uniform4iARB)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Uniform4ivARB))"\n"
+"\t"STUB_ASM_CODE("562")"\n"
+
+".globl "GLAPI_PREFIX_STR(Uniform4iv)"\n"
+".set "GLAPI_PREFIX_STR(Uniform4iv)", "GLAPI_PREFIX_STR(Uniform4ivARB)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(UniformMatrix2fvARB))"\n"
+"\t"STUB_ASM_CODE("563")"\n"
+
+".globl "GLAPI_PREFIX_STR(UniformMatrix2fv)"\n"
+".set "GLAPI_PREFIX_STR(UniformMatrix2fv)", "GLAPI_PREFIX_STR(UniformMatrix2fvARB)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(UniformMatrix3fvARB))"\n"
+"\t"STUB_ASM_CODE("564")"\n"
+
+".globl "GLAPI_PREFIX_STR(UniformMatrix3fv)"\n"
+".set "GLAPI_PREFIX_STR(UniformMatrix3fv)", "GLAPI_PREFIX_STR(UniformMatrix3fvARB)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(UniformMatrix4fvARB))"\n"
+"\t"STUB_ASM_CODE("565")"\n"
+
+".globl "GLAPI_PREFIX_STR(UniformMatrix4fv)"\n"
+".set "GLAPI_PREFIX_STR(UniformMatrix4fv)", "GLAPI_PREFIX_STR(UniformMatrix4fvARB)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(UseProgramObjectARB))"\n"
+"\t"STUB_ASM_CODE("566")"\n"
+
+".globl "GLAPI_PREFIX_STR(UseProgram)"\n"
+".set "GLAPI_PREFIX_STR(UseProgram)", "GLAPI_PREFIX_STR(UseProgramObjectARB)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(ValidateProgramARB))"\n"
+"\t"STUB_ASM_CODE("567")"\n"
+
+".globl "GLAPI_PREFIX_STR(ValidateProgram)"\n"
+".set "GLAPI_PREFIX_STR(ValidateProgram)", "GLAPI_PREFIX_STR(ValidateProgramARB)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(BindAttribLocationARB))"\n"
+"\t"STUB_ASM_CODE("568")"\n"
+
+".globl "GLAPI_PREFIX_STR(BindAttribLocation)"\n"
+".set "GLAPI_PREFIX_STR(BindAttribLocation)", "GLAPI_PREFIX_STR(BindAttribLocationARB)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetActiveAttribARB))"\n"
+"\t"STUB_ASM_CODE("569")"\n"
+
+".globl "GLAPI_PREFIX_STR(GetActiveAttrib)"\n"
+".set "GLAPI_PREFIX_STR(GetActiveAttrib)", "GLAPI_PREFIX_STR(GetActiveAttribARB)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetAttribLocationARB))"\n"
+"\t"STUB_ASM_CODE("570")"\n"
+
+".globl "GLAPI_PREFIX_STR(GetAttribLocation)"\n"
+".set "GLAPI_PREFIX_STR(GetAttribLocation)", "GLAPI_PREFIX_STR(GetAttribLocationARB)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(DrawBuffersARB))"\n"
+"\t"STUB_ASM_CODE("571")"\n"
+
+".globl "GLAPI_PREFIX_STR(DrawBuffers)"\n"
+".set "GLAPI_PREFIX_STR(DrawBuffers)", "GLAPI_PREFIX_STR(DrawBuffersARB)"\n"
+
+".globl "GLAPI_PREFIX_STR(DrawBuffersATI)"\n"
+".set "GLAPI_PREFIX_STR(DrawBuffersATI)", "GLAPI_PREFIX_STR(DrawBuffersARB)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(ClampColorARB))"\n"
+"\t"STUB_ASM_CODE("572")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(DrawArraysInstancedARB))"\n"
+"\t"STUB_ASM_CODE("573")"\n"
+
+".globl "GLAPI_PREFIX_STR(DrawArraysInstanced)"\n"
+".set "GLAPI_PREFIX_STR(DrawArraysInstanced)", "GLAPI_PREFIX_STR(DrawArraysInstancedARB)"\n"
+
+".globl "GLAPI_PREFIX_STR(DrawArraysInstancedEXT)"\n"
+".set "GLAPI_PREFIX_STR(DrawArraysInstancedEXT)", "GLAPI_PREFIX_STR(DrawArraysInstancedARB)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(DrawElementsInstancedARB))"\n"
+"\t"STUB_ASM_CODE("574")"\n"
+
+".globl "GLAPI_PREFIX_STR(DrawElementsInstanced)"\n"
+".set "GLAPI_PREFIX_STR(DrawElementsInstanced)", "GLAPI_PREFIX_STR(DrawElementsInstancedARB)"\n"
+
+".globl "GLAPI_PREFIX_STR(DrawElementsInstancedEXT)"\n"
+".set "GLAPI_PREFIX_STR(DrawElementsInstancedEXT)", "GLAPI_PREFIX_STR(DrawElementsInstancedARB)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(RenderbufferStorageMultisample))"\n"
+"\t"STUB_ASM_CODE("575")"\n"
+
+".globl "GLAPI_PREFIX_STR(RenderbufferStorageMultisampleEXT)"\n"
+".set "GLAPI_PREFIX_STR(RenderbufferStorageMultisampleEXT)", "GLAPI_PREFIX_STR(RenderbufferStorageMultisample)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(FramebufferTextureARB))"\n"
+"\t"STUB_ASM_CODE("576")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(FramebufferTextureFaceARB))"\n"
+"\t"STUB_ASM_CODE("577")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(ProgramParameteriARB))"\n"
+"\t"STUB_ASM_CODE("578")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttribDivisorARB))"\n"
+"\t"STUB_ASM_CODE("579")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(FlushMappedBufferRange))"\n"
+"\t"STUB_ASM_CODE("580")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(MapBufferRange))"\n"
+"\t"STUB_ASM_CODE("581")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(TexBufferARB))"\n"
+"\t"STUB_ASM_CODE("582")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(BindVertexArray))"\n"
+"\t"STUB_ASM_CODE("583")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GenVertexArrays))"\n"
+"\t"STUB_ASM_CODE("584")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(CopyBufferSubData))"\n"
+"\t"STUB_ASM_CODE("585")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(ClientWaitSync))"\n"
+"\t"STUB_ASM_CODE("586")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(DeleteSync))"\n"
+"\t"STUB_ASM_CODE("587")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(FenceSync))"\n"
+"\t"STUB_ASM_CODE("588")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetInteger64v))"\n"
+"\t"STUB_ASM_CODE("589")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetSynciv))"\n"
+"\t"STUB_ASM_CODE("590")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(IsSync))"\n"
+"\t"STUB_ASM_CODE("591")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(WaitSync))"\n"
+"\t"STUB_ASM_CODE("592")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(DrawElementsBaseVertex))"\n"
+"\t"STUB_ASM_CODE("593")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(DrawRangeElementsBaseVertex))"\n"
+"\t"STUB_ASM_CODE("594")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(MultiDrawElementsBaseVertex))"\n"
+"\t"STUB_ASM_CODE("595")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(BlendEquationSeparateiARB))"\n"
+"\t"STUB_ASM_CODE("596")"\n"
+
+".globl "GLAPI_PREFIX_STR(BlendEquationSeparateIndexedAMD)"\n"
+".set "GLAPI_PREFIX_STR(BlendEquationSeparateIndexedAMD)", "GLAPI_PREFIX_STR(BlendEquationSeparateiARB)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(BlendEquationiARB))"\n"
+"\t"STUB_ASM_CODE("597")"\n"
+
+".globl "GLAPI_PREFIX_STR(BlendEquationIndexedAMD)"\n"
+".set "GLAPI_PREFIX_STR(BlendEquationIndexedAMD)", "GLAPI_PREFIX_STR(BlendEquationiARB)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(BlendFuncSeparateiARB))"\n"
+"\t"STUB_ASM_CODE("598")"\n"
+
+".globl "GLAPI_PREFIX_STR(BlendFuncSeparateIndexedAMD)"\n"
+".set "GLAPI_PREFIX_STR(BlendFuncSeparateIndexedAMD)", "GLAPI_PREFIX_STR(BlendFuncSeparateiARB)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(BlendFunciARB))"\n"
+"\t"STUB_ASM_CODE("599")"\n"
+
+".globl "GLAPI_PREFIX_STR(BlendFuncIndexedAMD)"\n"
+".set "GLAPI_PREFIX_STR(BlendFuncIndexedAMD)", "GLAPI_PREFIX_STR(BlendFunciARB)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(BindSampler))"\n"
+"\t"STUB_ASM_CODE("600")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(DeleteSamplers))"\n"
+"\t"STUB_ASM_CODE("601")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GenSamplers))"\n"
+"\t"STUB_ASM_CODE("602")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetSamplerParameterIiv))"\n"
+"\t"STUB_ASM_CODE("603")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetSamplerParameterIuiv))"\n"
+"\t"STUB_ASM_CODE("604")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetSamplerParameterfv))"\n"
+"\t"STUB_ASM_CODE("605")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetSamplerParameteriv))"\n"
+"\t"STUB_ASM_CODE("606")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(IsSampler))"\n"
+"\t"STUB_ASM_CODE("607")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(SamplerParameterIiv))"\n"
+"\t"STUB_ASM_CODE("608")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(SamplerParameterIuiv))"\n"
+"\t"STUB_ASM_CODE("609")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(SamplerParameterf))"\n"
+"\t"STUB_ASM_CODE("610")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(SamplerParameterfv))"\n"
+"\t"STUB_ASM_CODE("611")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(SamplerParameteri))"\n"
+"\t"STUB_ASM_CODE("612")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(SamplerParameteriv))"\n"
+"\t"STUB_ASM_CODE("613")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(BindTransformFeedback))"\n"
+"\t"STUB_ASM_CODE("614")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(DeleteTransformFeedbacks))"\n"
+"\t"STUB_ASM_CODE("615")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(DrawTransformFeedback))"\n"
+"\t"STUB_ASM_CODE("616")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GenTransformFeedbacks))"\n"
+"\t"STUB_ASM_CODE("617")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(IsTransformFeedback))"\n"
+"\t"STUB_ASM_CODE("618")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(PauseTransformFeedback))"\n"
+"\t"STUB_ASM_CODE("619")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(ResumeTransformFeedback))"\n"
+"\t"STUB_ASM_CODE("620")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(ClearDepthf))"\n"
+"\t"STUB_ASM_CODE("621")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(DepthRangef))"\n"
+"\t"STUB_ASM_CODE("622")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetShaderPrecisionFormat))"\n"
+"\t"STUB_ASM_CODE("623")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(ReleaseShaderCompiler))"\n"
+"\t"STUB_ASM_CODE("624")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(ShaderBinary))"\n"
+"\t"STUB_ASM_CODE("625")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetGraphicsResetStatusARB))"\n"
+"\t"STUB_ASM_CODE("629")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetnColorTableARB))"\n"
+"\t"STUB_ASM_CODE("630")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetnCompressedTexImageARB))"\n"
+"\t"STUB_ASM_CODE("631")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetnConvolutionFilterARB))"\n"
+"\t"STUB_ASM_CODE("632")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetnHistogramARB))"\n"
+"\t"STUB_ASM_CODE("633")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetnMapdvARB))"\n"
+"\t"STUB_ASM_CODE("634")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetnMapfvARB))"\n"
+"\t"STUB_ASM_CODE("635")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetnMapivARB))"\n"
+"\t"STUB_ASM_CODE("636")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetnMinmaxARB))"\n"
+"\t"STUB_ASM_CODE("637")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetnPixelMapfvARB))"\n"
+"\t"STUB_ASM_CODE("638")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetnPixelMapuivARB))"\n"
+"\t"STUB_ASM_CODE("639")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetnPixelMapusvARB))"\n"
+"\t"STUB_ASM_CODE("640")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetnPolygonStippleARB))"\n"
+"\t"STUB_ASM_CODE("641")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetnSeparableFilterARB))"\n"
+"\t"STUB_ASM_CODE("642")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetnTexImageARB))"\n"
+"\t"STUB_ASM_CODE("643")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetnUniformdvARB))"\n"
+"\t"STUB_ASM_CODE("644")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetnUniformfvARB))"\n"
+"\t"STUB_ASM_CODE("645")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetnUniformivARB))"\n"
+"\t"STUB_ASM_CODE("646")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetnUniformuivARB))"\n"
+"\t"STUB_ASM_CODE("647")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(ReadnPixelsARB))"\n"
+"\t"STUB_ASM_CODE("648")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(PolygonOffsetEXT))"\n"
+"\t"STUB_ASM_CODE("649")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(ColorPointerEXT))"\n"
+"\t"STUB_ASM_CODE("668")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(EdgeFlagPointerEXT))"\n"
+"\t"STUB_ASM_CODE("669")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(IndexPointerEXT))"\n"
+"\t"STUB_ASM_CODE("670")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(NormalPointerEXT))"\n"
+"\t"STUB_ASM_CODE("671")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(TexCoordPointerEXT))"\n"
+"\t"STUB_ASM_CODE("672")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexPointerEXT))"\n"
+"\t"STUB_ASM_CODE("673")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(PointParameterfEXT))"\n"
+"\t"STUB_ASM_CODE("674")"\n"
+
+".globl "GLAPI_PREFIX_STR(PointParameterf)"\n"
+".set "GLAPI_PREFIX_STR(PointParameterf)", "GLAPI_PREFIX_STR(PointParameterfEXT)"\n"
+
+".globl "GLAPI_PREFIX_STR(PointParameterfARB)"\n"
+".set "GLAPI_PREFIX_STR(PointParameterfARB)", "GLAPI_PREFIX_STR(PointParameterfEXT)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(PointParameterfvEXT))"\n"
+"\t"STUB_ASM_CODE("675")"\n"
+
+".globl "GLAPI_PREFIX_STR(PointParameterfv)"\n"
+".set "GLAPI_PREFIX_STR(PointParameterfv)", "GLAPI_PREFIX_STR(PointParameterfvEXT)"\n"
+
+".globl "GLAPI_PREFIX_STR(PointParameterfvARB)"\n"
+".set "GLAPI_PREFIX_STR(PointParameterfvARB)", "GLAPI_PREFIX_STR(PointParameterfvEXT)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(LockArraysEXT))"\n"
+"\t"STUB_ASM_CODE("676")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(UnlockArraysEXT))"\n"
+"\t"STUB_ASM_CODE("677")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(SecondaryColor3bEXT))"\n"
+"\t"STUB_ASM_CODE("678")"\n"
+
+".globl "GLAPI_PREFIX_STR(SecondaryColor3b)"\n"
+".set "GLAPI_PREFIX_STR(SecondaryColor3b)", "GLAPI_PREFIX_STR(SecondaryColor3bEXT)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(SecondaryColor3bvEXT))"\n"
+"\t"STUB_ASM_CODE("679")"\n"
+
+".globl "GLAPI_PREFIX_STR(SecondaryColor3bv)"\n"
+".set "GLAPI_PREFIX_STR(SecondaryColor3bv)", "GLAPI_PREFIX_STR(SecondaryColor3bvEXT)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(SecondaryColor3dEXT))"\n"
+"\t"STUB_ASM_CODE("680")"\n"
+
+".globl "GLAPI_PREFIX_STR(SecondaryColor3d)"\n"
+".set "GLAPI_PREFIX_STR(SecondaryColor3d)", "GLAPI_PREFIX_STR(SecondaryColor3dEXT)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(SecondaryColor3dvEXT))"\n"
+"\t"STUB_ASM_CODE("681")"\n"
+
+".globl "GLAPI_PREFIX_STR(SecondaryColor3dv)"\n"
+".set "GLAPI_PREFIX_STR(SecondaryColor3dv)", "GLAPI_PREFIX_STR(SecondaryColor3dvEXT)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(SecondaryColor3fEXT))"\n"
+"\t"STUB_ASM_CODE("682")"\n"
+
+".globl "GLAPI_PREFIX_STR(SecondaryColor3f)"\n"
+".set "GLAPI_PREFIX_STR(SecondaryColor3f)", "GLAPI_PREFIX_STR(SecondaryColor3fEXT)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(SecondaryColor3fvEXT))"\n"
+"\t"STUB_ASM_CODE("683")"\n"
+
+".globl "GLAPI_PREFIX_STR(SecondaryColor3fv)"\n"
+".set "GLAPI_PREFIX_STR(SecondaryColor3fv)", "GLAPI_PREFIX_STR(SecondaryColor3fvEXT)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(SecondaryColor3iEXT))"\n"
+"\t"STUB_ASM_CODE("684")"\n"
+
+".globl "GLAPI_PREFIX_STR(SecondaryColor3i)"\n"
+".set "GLAPI_PREFIX_STR(SecondaryColor3i)", "GLAPI_PREFIX_STR(SecondaryColor3iEXT)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(SecondaryColor3ivEXT))"\n"
+"\t"STUB_ASM_CODE("685")"\n"
+
+".globl "GLAPI_PREFIX_STR(SecondaryColor3iv)"\n"
+".set "GLAPI_PREFIX_STR(SecondaryColor3iv)", "GLAPI_PREFIX_STR(SecondaryColor3ivEXT)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(SecondaryColor3sEXT))"\n"
+"\t"STUB_ASM_CODE("686")"\n"
+
+".globl "GLAPI_PREFIX_STR(SecondaryColor3s)"\n"
+".set "GLAPI_PREFIX_STR(SecondaryColor3s)", "GLAPI_PREFIX_STR(SecondaryColor3sEXT)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(SecondaryColor3svEXT))"\n"
+"\t"STUB_ASM_CODE("687")"\n"
+
+".globl "GLAPI_PREFIX_STR(SecondaryColor3sv)"\n"
+".set "GLAPI_PREFIX_STR(SecondaryColor3sv)", "GLAPI_PREFIX_STR(SecondaryColor3svEXT)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(SecondaryColor3ubEXT))"\n"
+"\t"STUB_ASM_CODE("688")"\n"
+
+".globl "GLAPI_PREFIX_STR(SecondaryColor3ub)"\n"
+".set "GLAPI_PREFIX_STR(SecondaryColor3ub)", "GLAPI_PREFIX_STR(SecondaryColor3ubEXT)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(SecondaryColor3ubvEXT))"\n"
+"\t"STUB_ASM_CODE("689")"\n"
+
+".globl "GLAPI_PREFIX_STR(SecondaryColor3ubv)"\n"
+".set "GLAPI_PREFIX_STR(SecondaryColor3ubv)", "GLAPI_PREFIX_STR(SecondaryColor3ubvEXT)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(SecondaryColor3uiEXT))"\n"
+"\t"STUB_ASM_CODE("690")"\n"
+
+".globl "GLAPI_PREFIX_STR(SecondaryColor3ui)"\n"
+".set "GLAPI_PREFIX_STR(SecondaryColor3ui)", "GLAPI_PREFIX_STR(SecondaryColor3uiEXT)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(SecondaryColor3uivEXT))"\n"
+"\t"STUB_ASM_CODE("691")"\n"
+
+".globl "GLAPI_PREFIX_STR(SecondaryColor3uiv)"\n"
+".set "GLAPI_PREFIX_STR(SecondaryColor3uiv)", "GLAPI_PREFIX_STR(SecondaryColor3uivEXT)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(SecondaryColor3usEXT))"\n"
+"\t"STUB_ASM_CODE("692")"\n"
+
+".globl "GLAPI_PREFIX_STR(SecondaryColor3us)"\n"
+".set "GLAPI_PREFIX_STR(SecondaryColor3us)", "GLAPI_PREFIX_STR(SecondaryColor3usEXT)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(SecondaryColor3usvEXT))"\n"
+"\t"STUB_ASM_CODE("693")"\n"
+
+".globl "GLAPI_PREFIX_STR(SecondaryColor3usv)"\n"
+".set "GLAPI_PREFIX_STR(SecondaryColor3usv)", "GLAPI_PREFIX_STR(SecondaryColor3usvEXT)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(SecondaryColorPointerEXT))"\n"
+"\t"STUB_ASM_CODE("694")"\n"
+
+".globl "GLAPI_PREFIX_STR(SecondaryColorPointer)"\n"
+".set "GLAPI_PREFIX_STR(SecondaryColorPointer)", "GLAPI_PREFIX_STR(SecondaryColorPointerEXT)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(MultiDrawArraysEXT))"\n"
+"\t"STUB_ASM_CODE("695")"\n"
+
+".globl "GLAPI_PREFIX_STR(MultiDrawArrays)"\n"
+".set "GLAPI_PREFIX_STR(MultiDrawArrays)", "GLAPI_PREFIX_STR(MultiDrawArraysEXT)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(MultiDrawElementsEXT))"\n"
+"\t"STUB_ASM_CODE("696")"\n"
+
+".globl "GLAPI_PREFIX_STR(MultiDrawElements)"\n"
+".set "GLAPI_PREFIX_STR(MultiDrawElements)", "GLAPI_PREFIX_STR(MultiDrawElementsEXT)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(FogCoordPointerEXT))"\n"
+"\t"STUB_ASM_CODE("697")"\n"
+
+".globl "GLAPI_PREFIX_STR(FogCoordPointer)"\n"
+".set "GLAPI_PREFIX_STR(FogCoordPointer)", "GLAPI_PREFIX_STR(FogCoordPointerEXT)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(FogCoorddEXT))"\n"
+"\t"STUB_ASM_CODE("698")"\n"
+
+".globl "GLAPI_PREFIX_STR(FogCoordd)"\n"
+".set "GLAPI_PREFIX_STR(FogCoordd)", "GLAPI_PREFIX_STR(FogCoorddEXT)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(FogCoorddvEXT))"\n"
+"\t"STUB_ASM_CODE("699")"\n"
+
+".globl "GLAPI_PREFIX_STR(FogCoorddv)"\n"
+".set "GLAPI_PREFIX_STR(FogCoorddv)", "GLAPI_PREFIX_STR(FogCoorddvEXT)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(FogCoordfEXT))"\n"
+"\t"STUB_ASM_CODE("700")"\n"
+
+".globl "GLAPI_PREFIX_STR(FogCoordf)"\n"
+".set "GLAPI_PREFIX_STR(FogCoordf)", "GLAPI_PREFIX_STR(FogCoordfEXT)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(FogCoordfvEXT))"\n"
+"\t"STUB_ASM_CODE("701")"\n"
+
+".globl "GLAPI_PREFIX_STR(FogCoordfv)"\n"
+".set "GLAPI_PREFIX_STR(FogCoordfv)", "GLAPI_PREFIX_STR(FogCoordfvEXT)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(BlendFuncSeparateEXT))"\n"
+"\t"STUB_ASM_CODE("703")"\n"
+
+".globl "GLAPI_PREFIX_STR(BlendFuncSeparate)"\n"
+".set "GLAPI_PREFIX_STR(BlendFuncSeparate)", "GLAPI_PREFIX_STR(BlendFuncSeparateEXT)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(FlushVertexArrayRangeNV))"\n"
+"\t"STUB_ASM_CODE("704")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexArrayRangeNV))"\n"
+"\t"STUB_ASM_CODE("705")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(CombinerInputNV))"\n"
+"\t"STUB_ASM_CODE("706")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(CombinerOutputNV))"\n"
+"\t"STUB_ASM_CODE("707")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(CombinerParameterfNV))"\n"
+"\t"STUB_ASM_CODE("708")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(CombinerParameterfvNV))"\n"
+"\t"STUB_ASM_CODE("709")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(CombinerParameteriNV))"\n"
+"\t"STUB_ASM_CODE("710")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(CombinerParameterivNV))"\n"
+"\t"STUB_ASM_CODE("711")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(FinalCombinerInputNV))"\n"
+"\t"STUB_ASM_CODE("712")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetCombinerInputParameterfvNV))"\n"
+"\t"STUB_ASM_CODE("713")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetCombinerInputParameterivNV))"\n"
+"\t"STUB_ASM_CODE("714")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetCombinerOutputParameterfvNV))"\n"
+"\t"STUB_ASM_CODE("715")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetCombinerOutputParameterivNV))"\n"
+"\t"STUB_ASM_CODE("716")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetFinalCombinerInputParameterfvNV))"\n"
+"\t"STUB_ASM_CODE("717")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetFinalCombinerInputParameterivNV))"\n"
+"\t"STUB_ASM_CODE("718")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(ResizeBuffersMESA))"\n"
+"\t"STUB_ASM_CODE("719")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(WindowPos2dMESA))"\n"
+"\t"STUB_ASM_CODE("720")"\n"
+
+".globl "GLAPI_PREFIX_STR(WindowPos2d)"\n"
+".set "GLAPI_PREFIX_STR(WindowPos2d)", "GLAPI_PREFIX_STR(WindowPos2dMESA)"\n"
+
+".globl "GLAPI_PREFIX_STR(WindowPos2dARB)"\n"
+".set "GLAPI_PREFIX_STR(WindowPos2dARB)", "GLAPI_PREFIX_STR(WindowPos2dMESA)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(WindowPos2dvMESA))"\n"
+"\t"STUB_ASM_CODE("721")"\n"
+
+".globl "GLAPI_PREFIX_STR(WindowPos2dv)"\n"
+".set "GLAPI_PREFIX_STR(WindowPos2dv)", "GLAPI_PREFIX_STR(WindowPos2dvMESA)"\n"
+
+".globl "GLAPI_PREFIX_STR(WindowPos2dvARB)"\n"
+".set "GLAPI_PREFIX_STR(WindowPos2dvARB)", "GLAPI_PREFIX_STR(WindowPos2dvMESA)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(WindowPos2fMESA))"\n"
+"\t"STUB_ASM_CODE("722")"\n"
+
+".globl "GLAPI_PREFIX_STR(WindowPos2f)"\n"
+".set "GLAPI_PREFIX_STR(WindowPos2f)", "GLAPI_PREFIX_STR(WindowPos2fMESA)"\n"
+
+".globl "GLAPI_PREFIX_STR(WindowPos2fARB)"\n"
+".set "GLAPI_PREFIX_STR(WindowPos2fARB)", "GLAPI_PREFIX_STR(WindowPos2fMESA)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(WindowPos2fvMESA))"\n"
+"\t"STUB_ASM_CODE("723")"\n"
+
+".globl "GLAPI_PREFIX_STR(WindowPos2fv)"\n"
+".set "GLAPI_PREFIX_STR(WindowPos2fv)", "GLAPI_PREFIX_STR(WindowPos2fvMESA)"\n"
+
+".globl "GLAPI_PREFIX_STR(WindowPos2fvARB)"\n"
+".set "GLAPI_PREFIX_STR(WindowPos2fvARB)", "GLAPI_PREFIX_STR(WindowPos2fvMESA)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(WindowPos2iMESA))"\n"
+"\t"STUB_ASM_CODE("724")"\n"
+
+".globl "GLAPI_PREFIX_STR(WindowPos2i)"\n"
+".set "GLAPI_PREFIX_STR(WindowPos2i)", "GLAPI_PREFIX_STR(WindowPos2iMESA)"\n"
+
+".globl "GLAPI_PREFIX_STR(WindowPos2iARB)"\n"
+".set "GLAPI_PREFIX_STR(WindowPos2iARB)", "GLAPI_PREFIX_STR(WindowPos2iMESA)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(WindowPos2ivMESA))"\n"
+"\t"STUB_ASM_CODE("725")"\n"
+
+".globl "GLAPI_PREFIX_STR(WindowPos2iv)"\n"
+".set "GLAPI_PREFIX_STR(WindowPos2iv)", "GLAPI_PREFIX_STR(WindowPos2ivMESA)"\n"
+
+".globl "GLAPI_PREFIX_STR(WindowPos2ivARB)"\n"
+".set "GLAPI_PREFIX_STR(WindowPos2ivARB)", "GLAPI_PREFIX_STR(WindowPos2ivMESA)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(WindowPos2sMESA))"\n"
+"\t"STUB_ASM_CODE("726")"\n"
+
+".globl "GLAPI_PREFIX_STR(WindowPos2s)"\n"
+".set "GLAPI_PREFIX_STR(WindowPos2s)", "GLAPI_PREFIX_STR(WindowPos2sMESA)"\n"
+
+".globl "GLAPI_PREFIX_STR(WindowPos2sARB)"\n"
+".set "GLAPI_PREFIX_STR(WindowPos2sARB)", "GLAPI_PREFIX_STR(WindowPos2sMESA)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(WindowPos2svMESA))"\n"
+"\t"STUB_ASM_CODE("727")"\n"
+
+".globl "GLAPI_PREFIX_STR(WindowPos2sv)"\n"
+".set "GLAPI_PREFIX_STR(WindowPos2sv)", "GLAPI_PREFIX_STR(WindowPos2svMESA)"\n"
+
+".globl "GLAPI_PREFIX_STR(WindowPos2svARB)"\n"
+".set "GLAPI_PREFIX_STR(WindowPos2svARB)", "GLAPI_PREFIX_STR(WindowPos2svMESA)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(WindowPos3dMESA))"\n"
+"\t"STUB_ASM_CODE("728")"\n"
+
+".globl "GLAPI_PREFIX_STR(WindowPos3d)"\n"
+".set "GLAPI_PREFIX_STR(WindowPos3d)", "GLAPI_PREFIX_STR(WindowPos3dMESA)"\n"
+
+".globl "GLAPI_PREFIX_STR(WindowPos3dARB)"\n"
+".set "GLAPI_PREFIX_STR(WindowPos3dARB)", "GLAPI_PREFIX_STR(WindowPos3dMESA)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(WindowPos3dvMESA))"\n"
+"\t"STUB_ASM_CODE("729")"\n"
+
+".globl "GLAPI_PREFIX_STR(WindowPos3dv)"\n"
+".set "GLAPI_PREFIX_STR(WindowPos3dv)", "GLAPI_PREFIX_STR(WindowPos3dvMESA)"\n"
+
+".globl "GLAPI_PREFIX_STR(WindowPos3dvARB)"\n"
+".set "GLAPI_PREFIX_STR(WindowPos3dvARB)", "GLAPI_PREFIX_STR(WindowPos3dvMESA)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(WindowPos3fMESA))"\n"
+"\t"STUB_ASM_CODE("730")"\n"
+
+".globl "GLAPI_PREFIX_STR(WindowPos3f)"\n"
+".set "GLAPI_PREFIX_STR(WindowPos3f)", "GLAPI_PREFIX_STR(WindowPos3fMESA)"\n"
+
+".globl "GLAPI_PREFIX_STR(WindowPos3fARB)"\n"
+".set "GLAPI_PREFIX_STR(WindowPos3fARB)", "GLAPI_PREFIX_STR(WindowPos3fMESA)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(WindowPos3fvMESA))"\n"
+"\t"STUB_ASM_CODE("731")"\n"
+
+".globl "GLAPI_PREFIX_STR(WindowPos3fv)"\n"
+".set "GLAPI_PREFIX_STR(WindowPos3fv)", "GLAPI_PREFIX_STR(WindowPos3fvMESA)"\n"
+
+".globl "GLAPI_PREFIX_STR(WindowPos3fvARB)"\n"
+".set "GLAPI_PREFIX_STR(WindowPos3fvARB)", "GLAPI_PREFIX_STR(WindowPos3fvMESA)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(WindowPos3iMESA))"\n"
+"\t"STUB_ASM_CODE("732")"\n"
+
+".globl "GLAPI_PREFIX_STR(WindowPos3i)"\n"
+".set "GLAPI_PREFIX_STR(WindowPos3i)", "GLAPI_PREFIX_STR(WindowPos3iMESA)"\n"
+
+".globl "GLAPI_PREFIX_STR(WindowPos3iARB)"\n"
+".set "GLAPI_PREFIX_STR(WindowPos3iARB)", "GLAPI_PREFIX_STR(WindowPos3iMESA)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(WindowPos3ivMESA))"\n"
+"\t"STUB_ASM_CODE("733")"\n"
+
+".globl "GLAPI_PREFIX_STR(WindowPos3iv)"\n"
+".set "GLAPI_PREFIX_STR(WindowPos3iv)", "GLAPI_PREFIX_STR(WindowPos3ivMESA)"\n"
+
+".globl "GLAPI_PREFIX_STR(WindowPos3ivARB)"\n"
+".set "GLAPI_PREFIX_STR(WindowPos3ivARB)", "GLAPI_PREFIX_STR(WindowPos3ivMESA)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(WindowPos3sMESA))"\n"
+"\t"STUB_ASM_CODE("734")"\n"
+
+".globl "GLAPI_PREFIX_STR(WindowPos3s)"\n"
+".set "GLAPI_PREFIX_STR(WindowPos3s)", "GLAPI_PREFIX_STR(WindowPos3sMESA)"\n"
+
+".globl "GLAPI_PREFIX_STR(WindowPos3sARB)"\n"
+".set "GLAPI_PREFIX_STR(WindowPos3sARB)", "GLAPI_PREFIX_STR(WindowPos3sMESA)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(WindowPos3svMESA))"\n"
+"\t"STUB_ASM_CODE("735")"\n"
+
+".globl "GLAPI_PREFIX_STR(WindowPos3sv)"\n"
+".set "GLAPI_PREFIX_STR(WindowPos3sv)", "GLAPI_PREFIX_STR(WindowPos3svMESA)"\n"
+
+".globl "GLAPI_PREFIX_STR(WindowPos3svARB)"\n"
+".set "GLAPI_PREFIX_STR(WindowPos3svARB)", "GLAPI_PREFIX_STR(WindowPos3svMESA)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(WindowPos4dMESA))"\n"
+"\t"STUB_ASM_CODE("736")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(WindowPos4dvMESA))"\n"
+"\t"STUB_ASM_CODE("737")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(WindowPos4fMESA))"\n"
+"\t"STUB_ASM_CODE("738")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(WindowPos4fvMESA))"\n"
+"\t"STUB_ASM_CODE("739")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(WindowPos4iMESA))"\n"
+"\t"STUB_ASM_CODE("740")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(WindowPos4ivMESA))"\n"
+"\t"STUB_ASM_CODE("741")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(WindowPos4sMESA))"\n"
+"\t"STUB_ASM_CODE("742")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(WindowPos4svMESA))"\n"
+"\t"STUB_ASM_CODE("743")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(AreProgramsResidentNV))"\n"
+"\t"STUB_ASM_CODE("753")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(BindProgramNV))"\n"
+"\t"STUB_ASM_CODE("754")"\n"
+
+".globl "GLAPI_PREFIX_STR(BindProgramARB)"\n"
+".set "GLAPI_PREFIX_STR(BindProgramARB)", "GLAPI_PREFIX_STR(BindProgramNV)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(DeleteProgramsNV))"\n"
+"\t"STUB_ASM_CODE("755")"\n"
+
+".globl "GLAPI_PREFIX_STR(DeleteProgramsARB)"\n"
+".set "GLAPI_PREFIX_STR(DeleteProgramsARB)", "GLAPI_PREFIX_STR(DeleteProgramsNV)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(ExecuteProgramNV))"\n"
+"\t"STUB_ASM_CODE("756")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GenProgramsNV))"\n"
+"\t"STUB_ASM_CODE("757")"\n"
+
+".globl "GLAPI_PREFIX_STR(GenProgramsARB)"\n"
+".set "GLAPI_PREFIX_STR(GenProgramsARB)", "GLAPI_PREFIX_STR(GenProgramsNV)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetProgramParameterdvNV))"\n"
+"\t"STUB_ASM_CODE("758")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetProgramParameterfvNV))"\n"
+"\t"STUB_ASM_CODE("759")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetProgramStringNV))"\n"
+"\t"STUB_ASM_CODE("760")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetProgramivNV))"\n"
+"\t"STUB_ASM_CODE("761")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetTrackMatrixivNV))"\n"
+"\t"STUB_ASM_CODE("762")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetVertexAttribPointervNV))"\n"
+"\t"STUB_ASM_CODE("763")"\n"
+
+".globl "GLAPI_PREFIX_STR(GetVertexAttribPointerv)"\n"
+".set "GLAPI_PREFIX_STR(GetVertexAttribPointerv)", "GLAPI_PREFIX_STR(GetVertexAttribPointervNV)"\n"
+
+".globl "GLAPI_PREFIX_STR(GetVertexAttribPointervARB)"\n"
+".set "GLAPI_PREFIX_STR(GetVertexAttribPointervARB)", "GLAPI_PREFIX_STR(GetVertexAttribPointervNV)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetVertexAttribdvNV))"\n"
+"\t"STUB_ASM_CODE("764")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetVertexAttribfvNV))"\n"
+"\t"STUB_ASM_CODE("765")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetVertexAttribivNV))"\n"
+"\t"STUB_ASM_CODE("766")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(IsProgramNV))"\n"
+"\t"STUB_ASM_CODE("767")"\n"
+
+".globl "GLAPI_PREFIX_STR(IsProgramARB)"\n"
+".set "GLAPI_PREFIX_STR(IsProgramARB)", "GLAPI_PREFIX_STR(IsProgramNV)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(LoadProgramNV))"\n"
+"\t"STUB_ASM_CODE("768")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(ProgramParameters4dvNV))"\n"
+"\t"STUB_ASM_CODE("769")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(ProgramParameters4fvNV))"\n"
+"\t"STUB_ASM_CODE("770")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(RequestResidentProgramsNV))"\n"
+"\t"STUB_ASM_CODE("771")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(TrackMatrixNV))"\n"
+"\t"STUB_ASM_CODE("772")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttrib1dNV))"\n"
+"\t"STUB_ASM_CODE("773")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttrib1dvNV))"\n"
+"\t"STUB_ASM_CODE("774")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttrib1fNV))"\n"
+"\t"STUB_ASM_CODE("775")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttrib1fvNV))"\n"
+"\t"STUB_ASM_CODE("776")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttrib1sNV))"\n"
+"\t"STUB_ASM_CODE("777")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttrib1svNV))"\n"
+"\t"STUB_ASM_CODE("778")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttrib2dNV))"\n"
+"\t"STUB_ASM_CODE("779")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttrib2dvNV))"\n"
+"\t"STUB_ASM_CODE("780")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttrib2fNV))"\n"
+"\t"STUB_ASM_CODE("781")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttrib2fvNV))"\n"
+"\t"STUB_ASM_CODE("782")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttrib2sNV))"\n"
+"\t"STUB_ASM_CODE("783")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttrib2svNV))"\n"
+"\t"STUB_ASM_CODE("784")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttrib3dNV))"\n"
+"\t"STUB_ASM_CODE("785")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttrib3dvNV))"\n"
+"\t"STUB_ASM_CODE("786")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttrib3fNV))"\n"
+"\t"STUB_ASM_CODE("787")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttrib3fvNV))"\n"
+"\t"STUB_ASM_CODE("788")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttrib3sNV))"\n"
+"\t"STUB_ASM_CODE("789")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttrib3svNV))"\n"
+"\t"STUB_ASM_CODE("790")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttrib4dNV))"\n"
+"\t"STUB_ASM_CODE("791")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttrib4dvNV))"\n"
+"\t"STUB_ASM_CODE("792")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttrib4fNV))"\n"
+"\t"STUB_ASM_CODE("793")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttrib4fvNV))"\n"
+"\t"STUB_ASM_CODE("794")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttrib4sNV))"\n"
+"\t"STUB_ASM_CODE("795")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttrib4svNV))"\n"
+"\t"STUB_ASM_CODE("796")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttrib4ubNV))"\n"
+"\t"STUB_ASM_CODE("797")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttrib4ubvNV))"\n"
+"\t"STUB_ASM_CODE("798")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttribPointerNV))"\n"
+"\t"STUB_ASM_CODE("799")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttribs1dvNV))"\n"
+"\t"STUB_ASM_CODE("800")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttribs1fvNV))"\n"
+"\t"STUB_ASM_CODE("801")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttribs1svNV))"\n"
+"\t"STUB_ASM_CODE("802")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttribs2dvNV))"\n"
+"\t"STUB_ASM_CODE("803")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttribs2fvNV))"\n"
+"\t"STUB_ASM_CODE("804")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttribs2svNV))"\n"
+"\t"STUB_ASM_CODE("805")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttribs3dvNV))"\n"
+"\t"STUB_ASM_CODE("806")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttribs3fvNV))"\n"
+"\t"STUB_ASM_CODE("807")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttribs3svNV))"\n"
+"\t"STUB_ASM_CODE("808")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttribs4dvNV))"\n"
+"\t"STUB_ASM_CODE("809")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttribs4fvNV))"\n"
+"\t"STUB_ASM_CODE("810")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttribs4svNV))"\n"
+"\t"STUB_ASM_CODE("811")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttribs4ubvNV))"\n"
+"\t"STUB_ASM_CODE("812")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetTexBumpParameterfvATI))"\n"
+"\t"STUB_ASM_CODE("813")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetTexBumpParameterivATI))"\n"
+"\t"STUB_ASM_CODE("814")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(TexBumpParameterfvATI))"\n"
+"\t"STUB_ASM_CODE("815")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(TexBumpParameterivATI))"\n"
+"\t"STUB_ASM_CODE("816")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(AlphaFragmentOp1ATI))"\n"
+"\t"STUB_ASM_CODE("817")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(AlphaFragmentOp2ATI))"\n"
+"\t"STUB_ASM_CODE("818")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(AlphaFragmentOp3ATI))"\n"
+"\t"STUB_ASM_CODE("819")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(BeginFragmentShaderATI))"\n"
+"\t"STUB_ASM_CODE("820")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(BindFragmentShaderATI))"\n"
+"\t"STUB_ASM_CODE("821")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(ColorFragmentOp1ATI))"\n"
+"\t"STUB_ASM_CODE("822")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(ColorFragmentOp2ATI))"\n"
+"\t"STUB_ASM_CODE("823")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(ColorFragmentOp3ATI))"\n"
+"\t"STUB_ASM_CODE("824")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(DeleteFragmentShaderATI))"\n"
+"\t"STUB_ASM_CODE("825")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(EndFragmentShaderATI))"\n"
+"\t"STUB_ASM_CODE("826")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GenFragmentShadersATI))"\n"
+"\t"STUB_ASM_CODE("827")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(PassTexCoordATI))"\n"
+"\t"STUB_ASM_CODE("828")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(SampleMapATI))"\n"
+"\t"STUB_ASM_CODE("829")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(SetFragmentShaderConstantATI))"\n"
+"\t"STUB_ASM_CODE("830")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(PointParameteriNV))"\n"
+"\t"STUB_ASM_CODE("831")"\n"
+
+".globl "GLAPI_PREFIX_STR(PointParameteri)"\n"
+".set "GLAPI_PREFIX_STR(PointParameteri)", "GLAPI_PREFIX_STR(PointParameteriNV)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(PointParameterivNV))"\n"
+"\t"STUB_ASM_CODE("832")"\n"
+
+".globl "GLAPI_PREFIX_STR(PointParameteriv)"\n"
+".set "GLAPI_PREFIX_STR(PointParameteriv)", "GLAPI_PREFIX_STR(PointParameterivNV)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(DeleteVertexArrays))"\n"
+"\t"STUB_ASM_CODE("835")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(IsVertexArray))"\n"
+"\t"STUB_ASM_CODE("837")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetProgramNamedParameterdvNV))"\n"
+"\t"STUB_ASM_CODE("838")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetProgramNamedParameterfvNV))"\n"
+"\t"STUB_ASM_CODE("839")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(ProgramNamedParameter4dNV))"\n"
+"\t"STUB_ASM_CODE("840")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(ProgramNamedParameter4dvNV))"\n"
+"\t"STUB_ASM_CODE("841")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(ProgramNamedParameter4fNV))"\n"
+"\t"STUB_ASM_CODE("842")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(ProgramNamedParameter4fvNV))"\n"
+"\t"STUB_ASM_CODE("843")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(PrimitiveRestartIndexNV))"\n"
+"\t"STUB_ASM_CODE("844")"\n"
+
+".globl "GLAPI_PREFIX_STR(PrimitiveRestartIndex)"\n"
+".set "GLAPI_PREFIX_STR(PrimitiveRestartIndex)", "GLAPI_PREFIX_STR(PrimitiveRestartIndexNV)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(PrimitiveRestartNV))"\n"
+"\t"STUB_ASM_CODE("845")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(BlendEquationSeparate))"\n"
+"\t"STUB_ASM_CODE("893")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(BindFramebufferEXT))"\n"
+"\t"STUB_ASM_CODE("894")"\n"
+
+".globl "GLAPI_PREFIX_STR(BindFramebuffer)"\n"
+".set "GLAPI_PREFIX_STR(BindFramebuffer)", "GLAPI_PREFIX_STR(BindFramebufferEXT)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(BindRenderbufferEXT))"\n"
+"\t"STUB_ASM_CODE("895")"\n"
+
+".globl "GLAPI_PREFIX_STR(BindRenderbuffer)"\n"
+".set "GLAPI_PREFIX_STR(BindRenderbuffer)", "GLAPI_PREFIX_STR(BindRenderbufferEXT)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(CheckFramebufferStatusEXT))"\n"
+"\t"STUB_ASM_CODE("896")"\n"
+
+".globl "GLAPI_PREFIX_STR(CheckFramebufferStatus)"\n"
+".set "GLAPI_PREFIX_STR(CheckFramebufferStatus)", "GLAPI_PREFIX_STR(CheckFramebufferStatusEXT)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(DeleteFramebuffersEXT))"\n"
+"\t"STUB_ASM_CODE("897")"\n"
+
+".globl "GLAPI_PREFIX_STR(DeleteFramebuffers)"\n"
+".set "GLAPI_PREFIX_STR(DeleteFramebuffers)", "GLAPI_PREFIX_STR(DeleteFramebuffersEXT)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(DeleteRenderbuffersEXT))"\n"
+"\t"STUB_ASM_CODE("898")"\n"
+
+".globl "GLAPI_PREFIX_STR(DeleteRenderbuffers)"\n"
+".set "GLAPI_PREFIX_STR(DeleteRenderbuffers)", "GLAPI_PREFIX_STR(DeleteRenderbuffersEXT)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(FramebufferRenderbufferEXT))"\n"
+"\t"STUB_ASM_CODE("899")"\n"
+
+".globl "GLAPI_PREFIX_STR(FramebufferRenderbuffer)"\n"
+".set "GLAPI_PREFIX_STR(FramebufferRenderbuffer)", "GLAPI_PREFIX_STR(FramebufferRenderbufferEXT)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(FramebufferTexture1DEXT))"\n"
+"\t"STUB_ASM_CODE("900")"\n"
+
+".globl "GLAPI_PREFIX_STR(FramebufferTexture1D)"\n"
+".set "GLAPI_PREFIX_STR(FramebufferTexture1D)", "GLAPI_PREFIX_STR(FramebufferTexture1DEXT)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(FramebufferTexture2DEXT))"\n"
+"\t"STUB_ASM_CODE("901")"\n"
+
+".globl "GLAPI_PREFIX_STR(FramebufferTexture2D)"\n"
+".set "GLAPI_PREFIX_STR(FramebufferTexture2D)", "GLAPI_PREFIX_STR(FramebufferTexture2DEXT)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(FramebufferTexture3DEXT))"\n"
+"\t"STUB_ASM_CODE("902")"\n"
+
+".globl "GLAPI_PREFIX_STR(FramebufferTexture3D)"\n"
+".set "GLAPI_PREFIX_STR(FramebufferTexture3D)", "GLAPI_PREFIX_STR(FramebufferTexture3DEXT)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GenFramebuffersEXT))"\n"
+"\t"STUB_ASM_CODE("903")"\n"
+
+".globl "GLAPI_PREFIX_STR(GenFramebuffers)"\n"
+".set "GLAPI_PREFIX_STR(GenFramebuffers)", "GLAPI_PREFIX_STR(GenFramebuffersEXT)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GenRenderbuffersEXT))"\n"
+"\t"STUB_ASM_CODE("904")"\n"
+
+".globl "GLAPI_PREFIX_STR(GenRenderbuffers)"\n"
+".set "GLAPI_PREFIX_STR(GenRenderbuffers)", "GLAPI_PREFIX_STR(GenRenderbuffersEXT)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GenerateMipmapEXT))"\n"
+"\t"STUB_ASM_CODE("905")"\n"
+
+".globl "GLAPI_PREFIX_STR(GenerateMipmap)"\n"
+".set "GLAPI_PREFIX_STR(GenerateMipmap)", "GLAPI_PREFIX_STR(GenerateMipmapEXT)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetFramebufferAttachmentParameterivEXT))"\n"
+"\t"STUB_ASM_CODE("906")"\n"
+
+".globl "GLAPI_PREFIX_STR(GetFramebufferAttachmentParameteriv)"\n"
+".set "GLAPI_PREFIX_STR(GetFramebufferAttachmentParameteriv)", "GLAPI_PREFIX_STR(GetFramebufferAttachmentParameterivEXT)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetRenderbufferParameterivEXT))"\n"
+"\t"STUB_ASM_CODE("907")"\n"
+
+".globl "GLAPI_PREFIX_STR(GetRenderbufferParameteriv)"\n"
+".set "GLAPI_PREFIX_STR(GetRenderbufferParameteriv)", "GLAPI_PREFIX_STR(GetRenderbufferParameterivEXT)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(IsFramebufferEXT))"\n"
+"\t"STUB_ASM_CODE("908")"\n"
+
+".globl "GLAPI_PREFIX_STR(IsFramebuffer)"\n"
+".set "GLAPI_PREFIX_STR(IsFramebuffer)", "GLAPI_PREFIX_STR(IsFramebufferEXT)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(IsRenderbufferEXT))"\n"
+"\t"STUB_ASM_CODE("909")"\n"
+
+".globl "GLAPI_PREFIX_STR(IsRenderbuffer)"\n"
+".set "GLAPI_PREFIX_STR(IsRenderbuffer)", "GLAPI_PREFIX_STR(IsRenderbufferEXT)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(RenderbufferStorageEXT))"\n"
+"\t"STUB_ASM_CODE("910")"\n"
+
+".globl "GLAPI_PREFIX_STR(RenderbufferStorage)"\n"
+".set "GLAPI_PREFIX_STR(RenderbufferStorage)", "GLAPI_PREFIX_STR(RenderbufferStorageEXT)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(BlitFramebuffer))"\n"
+"\t"STUB_ASM_CODE("911")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(BindFragDataLocationEXT))"\n"
+"\t"STUB_ASM_CODE("914")"\n"
+
+".globl "GLAPI_PREFIX_STR(BindFragDataLocation)"\n"
+".set "GLAPI_PREFIX_STR(BindFragDataLocation)", "GLAPI_PREFIX_STR(BindFragDataLocationEXT)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetFragDataLocationEXT))"\n"
+"\t"STUB_ASM_CODE("915")"\n"
+
+".globl "GLAPI_PREFIX_STR(GetFragDataLocation)"\n"
+".set "GLAPI_PREFIX_STR(GetFragDataLocation)", "GLAPI_PREFIX_STR(GetFragDataLocationEXT)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetUniformuivEXT))"\n"
+"\t"STUB_ASM_CODE("916")"\n"
+
+".globl "GLAPI_PREFIX_STR(GetUniformuiv)"\n"
+".set "GLAPI_PREFIX_STR(GetUniformuiv)", "GLAPI_PREFIX_STR(GetUniformuivEXT)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetVertexAttribIivEXT))"\n"
+"\t"STUB_ASM_CODE("917")"\n"
+
+".globl "GLAPI_PREFIX_STR(GetVertexAttribIiv)"\n"
+".set "GLAPI_PREFIX_STR(GetVertexAttribIiv)", "GLAPI_PREFIX_STR(GetVertexAttribIivEXT)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetVertexAttribIuivEXT))"\n"
+"\t"STUB_ASM_CODE("918")"\n"
+
+".globl "GLAPI_PREFIX_STR(GetVertexAttribIuiv)"\n"
+".set "GLAPI_PREFIX_STR(GetVertexAttribIuiv)", "GLAPI_PREFIX_STR(GetVertexAttribIuivEXT)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Uniform1uiEXT))"\n"
+"\t"STUB_ASM_CODE("919")"\n"
+
+".globl "GLAPI_PREFIX_STR(Uniform1ui)"\n"
+".set "GLAPI_PREFIX_STR(Uniform1ui)", "GLAPI_PREFIX_STR(Uniform1uiEXT)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Uniform1uivEXT))"\n"
+"\t"STUB_ASM_CODE("920")"\n"
+
+".globl "GLAPI_PREFIX_STR(Uniform1uiv)"\n"
+".set "GLAPI_PREFIX_STR(Uniform1uiv)", "GLAPI_PREFIX_STR(Uniform1uivEXT)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Uniform2uiEXT))"\n"
+"\t"STUB_ASM_CODE("921")"\n"
+
+".globl "GLAPI_PREFIX_STR(Uniform2ui)"\n"
+".set "GLAPI_PREFIX_STR(Uniform2ui)", "GLAPI_PREFIX_STR(Uniform2uiEXT)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Uniform2uivEXT))"\n"
+"\t"STUB_ASM_CODE("922")"\n"
+
+".globl "GLAPI_PREFIX_STR(Uniform2uiv)"\n"
+".set "GLAPI_PREFIX_STR(Uniform2uiv)", "GLAPI_PREFIX_STR(Uniform2uivEXT)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Uniform3uiEXT))"\n"
+"\t"STUB_ASM_CODE("923")"\n"
+
+".globl "GLAPI_PREFIX_STR(Uniform3ui)"\n"
+".set "GLAPI_PREFIX_STR(Uniform3ui)", "GLAPI_PREFIX_STR(Uniform3uiEXT)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Uniform3uivEXT))"\n"
+"\t"STUB_ASM_CODE("924")"\n"
+
+".globl "GLAPI_PREFIX_STR(Uniform3uiv)"\n"
+".set "GLAPI_PREFIX_STR(Uniform3uiv)", "GLAPI_PREFIX_STR(Uniform3uivEXT)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Uniform4uiEXT))"\n"
+"\t"STUB_ASM_CODE("925")"\n"
+
+".globl "GLAPI_PREFIX_STR(Uniform4ui)"\n"
+".set "GLAPI_PREFIX_STR(Uniform4ui)", "GLAPI_PREFIX_STR(Uniform4uiEXT)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(Uniform4uivEXT))"\n"
+"\t"STUB_ASM_CODE("926")"\n"
+
+".globl "GLAPI_PREFIX_STR(Uniform4uiv)"\n"
+".set "GLAPI_PREFIX_STR(Uniform4uiv)", "GLAPI_PREFIX_STR(Uniform4uivEXT)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttribI1iEXT))"\n"
+"\t"STUB_ASM_CODE("927")"\n"
+
+".globl "GLAPI_PREFIX_STR(VertexAttribI1i)"\n"
+".set "GLAPI_PREFIX_STR(VertexAttribI1i)", "GLAPI_PREFIX_STR(VertexAttribI1iEXT)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttribI1ivEXT))"\n"
+"\t"STUB_ASM_CODE("928")"\n"
+
+".globl "GLAPI_PREFIX_STR(VertexAttribI1iv)"\n"
+".set "GLAPI_PREFIX_STR(VertexAttribI1iv)", "GLAPI_PREFIX_STR(VertexAttribI1ivEXT)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttribI1uiEXT))"\n"
+"\t"STUB_ASM_CODE("929")"\n"
+
+".globl "GLAPI_PREFIX_STR(VertexAttribI1ui)"\n"
+".set "GLAPI_PREFIX_STR(VertexAttribI1ui)", "GLAPI_PREFIX_STR(VertexAttribI1uiEXT)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttribI1uivEXT))"\n"
+"\t"STUB_ASM_CODE("930")"\n"
+
+".globl "GLAPI_PREFIX_STR(VertexAttribI1uiv)"\n"
+".set "GLAPI_PREFIX_STR(VertexAttribI1uiv)", "GLAPI_PREFIX_STR(VertexAttribI1uivEXT)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttribI2iEXT))"\n"
+"\t"STUB_ASM_CODE("931")"\n"
+
+".globl "GLAPI_PREFIX_STR(VertexAttribI2i)"\n"
+".set "GLAPI_PREFIX_STR(VertexAttribI2i)", "GLAPI_PREFIX_STR(VertexAttribI2iEXT)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttribI2ivEXT))"\n"
+"\t"STUB_ASM_CODE("932")"\n"
+
+".globl "GLAPI_PREFIX_STR(VertexAttribI2iv)"\n"
+".set "GLAPI_PREFIX_STR(VertexAttribI2iv)", "GLAPI_PREFIX_STR(VertexAttribI2ivEXT)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttribI2uiEXT))"\n"
+"\t"STUB_ASM_CODE("933")"\n"
+
+".globl "GLAPI_PREFIX_STR(VertexAttribI2ui)"\n"
+".set "GLAPI_PREFIX_STR(VertexAttribI2ui)", "GLAPI_PREFIX_STR(VertexAttribI2uiEXT)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttribI2uivEXT))"\n"
+"\t"STUB_ASM_CODE("934")"\n"
+
+".globl "GLAPI_PREFIX_STR(VertexAttribI2uiv)"\n"
+".set "GLAPI_PREFIX_STR(VertexAttribI2uiv)", "GLAPI_PREFIX_STR(VertexAttribI2uivEXT)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttribI3iEXT))"\n"
+"\t"STUB_ASM_CODE("935")"\n"
+
+".globl "GLAPI_PREFIX_STR(VertexAttribI3i)"\n"
+".set "GLAPI_PREFIX_STR(VertexAttribI3i)", "GLAPI_PREFIX_STR(VertexAttribI3iEXT)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttribI3ivEXT))"\n"
+"\t"STUB_ASM_CODE("936")"\n"
+
+".globl "GLAPI_PREFIX_STR(VertexAttribI3iv)"\n"
+".set "GLAPI_PREFIX_STR(VertexAttribI3iv)", "GLAPI_PREFIX_STR(VertexAttribI3ivEXT)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttribI3uiEXT))"\n"
+"\t"STUB_ASM_CODE("937")"\n"
+
+".globl "GLAPI_PREFIX_STR(VertexAttribI3ui)"\n"
+".set "GLAPI_PREFIX_STR(VertexAttribI3ui)", "GLAPI_PREFIX_STR(VertexAttribI3uiEXT)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttribI3uivEXT))"\n"
+"\t"STUB_ASM_CODE("938")"\n"
+
+".globl "GLAPI_PREFIX_STR(VertexAttribI3uiv)"\n"
+".set "GLAPI_PREFIX_STR(VertexAttribI3uiv)", "GLAPI_PREFIX_STR(VertexAttribI3uivEXT)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttribI4bvEXT))"\n"
+"\t"STUB_ASM_CODE("939")"\n"
+
+".globl "GLAPI_PREFIX_STR(VertexAttribI4bv)"\n"
+".set "GLAPI_PREFIX_STR(VertexAttribI4bv)", "GLAPI_PREFIX_STR(VertexAttribI4bvEXT)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttribI4iEXT))"\n"
+"\t"STUB_ASM_CODE("940")"\n"
+
+".globl "GLAPI_PREFIX_STR(VertexAttribI4i)"\n"
+".set "GLAPI_PREFIX_STR(VertexAttribI4i)", "GLAPI_PREFIX_STR(VertexAttribI4iEXT)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttribI4ivEXT))"\n"
+"\t"STUB_ASM_CODE("941")"\n"
+
+".globl "GLAPI_PREFIX_STR(VertexAttribI4iv)"\n"
+".set "GLAPI_PREFIX_STR(VertexAttribI4iv)", "GLAPI_PREFIX_STR(VertexAttribI4ivEXT)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttribI4svEXT))"\n"
+"\t"STUB_ASM_CODE("942")"\n"
+
+".globl "GLAPI_PREFIX_STR(VertexAttribI4sv)"\n"
+".set "GLAPI_PREFIX_STR(VertexAttribI4sv)", "GLAPI_PREFIX_STR(VertexAttribI4svEXT)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttribI4ubvEXT))"\n"
+"\t"STUB_ASM_CODE("943")"\n"
+
+".globl "GLAPI_PREFIX_STR(VertexAttribI4ubv)"\n"
+".set "GLAPI_PREFIX_STR(VertexAttribI4ubv)", "GLAPI_PREFIX_STR(VertexAttribI4ubvEXT)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttribI4uiEXT))"\n"
+"\t"STUB_ASM_CODE("944")"\n"
+
+".globl "GLAPI_PREFIX_STR(VertexAttribI4ui)"\n"
+".set "GLAPI_PREFIX_STR(VertexAttribI4ui)", "GLAPI_PREFIX_STR(VertexAttribI4uiEXT)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttribI4uivEXT))"\n"
+"\t"STUB_ASM_CODE("945")"\n"
+
+".globl "GLAPI_PREFIX_STR(VertexAttribI4uiv)"\n"
+".set "GLAPI_PREFIX_STR(VertexAttribI4uiv)", "GLAPI_PREFIX_STR(VertexAttribI4uivEXT)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttribI4usvEXT))"\n"
+"\t"STUB_ASM_CODE("946")"\n"
+
+".globl "GLAPI_PREFIX_STR(VertexAttribI4usv)"\n"
+".set "GLAPI_PREFIX_STR(VertexAttribI4usv)", "GLAPI_PREFIX_STR(VertexAttribI4usvEXT)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(VertexAttribIPointerEXT))"\n"
+"\t"STUB_ASM_CODE("947")"\n"
+
+".globl "GLAPI_PREFIX_STR(VertexAttribIPointer)"\n"
+".set "GLAPI_PREFIX_STR(VertexAttribIPointer)", "GLAPI_PREFIX_STR(VertexAttribIPointerEXT)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(FramebufferTextureLayerEXT))"\n"
+"\t"STUB_ASM_CODE("948")"\n"
+
+".globl "GLAPI_PREFIX_STR(FramebufferTextureLayer)"\n"
+".set "GLAPI_PREFIX_STR(FramebufferTextureLayer)", "GLAPI_PREFIX_STR(FramebufferTextureLayerEXT)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(ColorMaskIndexedEXT))"\n"
+"\t"STUB_ASM_CODE("949")"\n"
+
+".globl "GLAPI_PREFIX_STR(ColorMaski)"\n"
+".set "GLAPI_PREFIX_STR(ColorMaski)", "GLAPI_PREFIX_STR(ColorMaskIndexedEXT)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(DisableIndexedEXT))"\n"
+"\t"STUB_ASM_CODE("950")"\n"
+
+".globl "GLAPI_PREFIX_STR(Disablei)"\n"
+".set "GLAPI_PREFIX_STR(Disablei)", "GLAPI_PREFIX_STR(DisableIndexedEXT)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(EnableIndexedEXT))"\n"
+"\t"STUB_ASM_CODE("951")"\n"
+
+".globl "GLAPI_PREFIX_STR(Enablei)"\n"
+".set "GLAPI_PREFIX_STR(Enablei)", "GLAPI_PREFIX_STR(EnableIndexedEXT)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetBooleanIndexedvEXT))"\n"
+"\t"STUB_ASM_CODE("952")"\n"
+
+".globl "GLAPI_PREFIX_STR(GetBooleani_v)"\n"
+".set "GLAPI_PREFIX_STR(GetBooleani_v)", "GLAPI_PREFIX_STR(GetBooleanIndexedvEXT)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetIntegerIndexedvEXT))"\n"
+"\t"STUB_ASM_CODE("953")"\n"
+
+".globl "GLAPI_PREFIX_STR(GetIntegeri_v)"\n"
+".set "GLAPI_PREFIX_STR(GetIntegeri_v)", "GLAPI_PREFIX_STR(GetIntegerIndexedvEXT)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(IsEnabledIndexedEXT))"\n"
+"\t"STUB_ASM_CODE("954")"\n"
+
+".globl "GLAPI_PREFIX_STR(IsEnabledi)"\n"
+".set "GLAPI_PREFIX_STR(IsEnabledi)", "GLAPI_PREFIX_STR(IsEnabledIndexedEXT)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(ClearColorIiEXT))"\n"
+"\t"STUB_ASM_CODE("955")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(ClearColorIuiEXT))"\n"
+"\t"STUB_ASM_CODE("956")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetTexParameterIivEXT))"\n"
+"\t"STUB_ASM_CODE("957")"\n"
+
+".globl "GLAPI_PREFIX_STR(GetTexParameterIiv)"\n"
+".set "GLAPI_PREFIX_STR(GetTexParameterIiv)", "GLAPI_PREFIX_STR(GetTexParameterIivEXT)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetTexParameterIuivEXT))"\n"
+"\t"STUB_ASM_CODE("958")"\n"
+
+".globl "GLAPI_PREFIX_STR(GetTexParameterIuiv)"\n"
+".set "GLAPI_PREFIX_STR(GetTexParameterIuiv)", "GLAPI_PREFIX_STR(GetTexParameterIuivEXT)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(TexParameterIivEXT))"\n"
+"\t"STUB_ASM_CODE("959")"\n"
+
+".globl "GLAPI_PREFIX_STR(TexParameterIiv)"\n"
+".set "GLAPI_PREFIX_STR(TexParameterIiv)", "GLAPI_PREFIX_STR(TexParameterIivEXT)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(TexParameterIuivEXT))"\n"
+"\t"STUB_ASM_CODE("960")"\n"
+
+".globl "GLAPI_PREFIX_STR(TexParameterIuiv)"\n"
+".set "GLAPI_PREFIX_STR(TexParameterIuiv)", "GLAPI_PREFIX_STR(TexParameterIuivEXT)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(BeginConditionalRenderNV))"\n"
+"\t"STUB_ASM_CODE("961")"\n"
+
+".globl "GLAPI_PREFIX_STR(BeginConditionalRender)"\n"
+".set "GLAPI_PREFIX_STR(BeginConditionalRender)", "GLAPI_PREFIX_STR(BeginConditionalRenderNV)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(EndConditionalRenderNV))"\n"
+"\t"STUB_ASM_CODE("962")"\n"
+
+".globl "GLAPI_PREFIX_STR(EndConditionalRender)"\n"
+".set "GLAPI_PREFIX_STR(EndConditionalRender)", "GLAPI_PREFIX_STR(EndConditionalRenderNV)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(BeginTransformFeedbackEXT))"\n"
+"\t"STUB_ASM_CODE("963")"\n"
+
+".globl "GLAPI_PREFIX_STR(BeginTransformFeedback)"\n"
+".set "GLAPI_PREFIX_STR(BeginTransformFeedback)", "GLAPI_PREFIX_STR(BeginTransformFeedbackEXT)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(BindBufferBaseEXT))"\n"
+"\t"STUB_ASM_CODE("964")"\n"
+
+".globl "GLAPI_PREFIX_STR(BindBufferBase)"\n"
+".set "GLAPI_PREFIX_STR(BindBufferBase)", "GLAPI_PREFIX_STR(BindBufferBaseEXT)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(BindBufferOffsetEXT))"\n"
+"\t"STUB_ASM_CODE("965")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(BindBufferRangeEXT))"\n"
+"\t"STUB_ASM_CODE("966")"\n"
+
+".globl "GLAPI_PREFIX_STR(BindBufferRange)"\n"
+".set "GLAPI_PREFIX_STR(BindBufferRange)", "GLAPI_PREFIX_STR(BindBufferRangeEXT)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(EndTransformFeedbackEXT))"\n"
+"\t"STUB_ASM_CODE("967")"\n"
+
+".globl "GLAPI_PREFIX_STR(EndTransformFeedback)"\n"
+".set "GLAPI_PREFIX_STR(EndTransformFeedback)", "GLAPI_PREFIX_STR(EndTransformFeedbackEXT)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetTransformFeedbackVaryingEXT))"\n"
+"\t"STUB_ASM_CODE("968")"\n"
+
+".globl "GLAPI_PREFIX_STR(GetTransformFeedbackVarying)"\n"
+".set "GLAPI_PREFIX_STR(GetTransformFeedbackVarying)", "GLAPI_PREFIX_STR(GetTransformFeedbackVaryingEXT)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(TransformFeedbackVaryingsEXT))"\n"
+"\t"STUB_ASM_CODE("969")"\n"
+
+".globl "GLAPI_PREFIX_STR(TransformFeedbackVaryings)"\n"
+".set "GLAPI_PREFIX_STR(TransformFeedbackVaryings)", "GLAPI_PREFIX_STR(TransformFeedbackVaryingsEXT)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(ProvokingVertexEXT))"\n"
+"\t"STUB_ASM_CODE("970")"\n"
+
+".globl "GLAPI_PREFIX_STR(ProvokingVertex)"\n"
+".set "GLAPI_PREFIX_STR(ProvokingVertex)", "GLAPI_PREFIX_STR(ProvokingVertexEXT)"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(GetObjectParameterivAPPLE))"\n"
+"\t"STUB_ASM_CODE("973")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(ObjectPurgeableAPPLE))"\n"
+"\t"STUB_ASM_CODE("974")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(ObjectUnpurgeableAPPLE))"\n"
+"\t"STUB_ASM_CODE("975")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(ActiveProgramEXT))"\n"
+"\t"STUB_ASM_CODE("976")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(CreateShaderProgramEXT))"\n"
+"\t"STUB_ASM_CODE("977")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(UseShaderProgramEXT))"\n"
+"\t"STUB_ASM_CODE("978")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(TextureBarrierNV))"\n"
+"\t"STUB_ASM_CODE("979")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(EGLImageTargetRenderbufferStorageOES))"\n"
+"\t"STUB_ASM_CODE("985")"\n"
+
+STUB_ASM_ENTRY(GLAPI_PREFIX_STR(EGLImageTargetTexture2DOES))"\n"
+"\t"STUB_ASM_CODE("986")"\n"
+
+);
+#undef MAPI_TMP_STUB_ASM_GCC_NO_HIDDEN
+#endif /* MAPI_TMP_STUB_ASM_GCC_NO_HIDDEN */
diff --git a/mesalib/src/mapi/glapi/glapi_nop.c b/mesalib/src/mapi/glapi/glapi_nop.c
index 9b0929715..365a6e1c8 100644
--- a/mesalib/src/mapi/glapi/glapi_nop.c
+++ b/mesalib/src/mapi/glapi/glapi_nop.c
@@ -41,12 +41,12 @@
#include "glapi/glapi_priv.h"
-void
+void _GLAPI_EXPORT
_glapi_noop_enable_warnings(unsigned char enable)
{
}
-void
+void _GLAPI_EXPORT
_glapi_set_warning_func(_glapi_proc func)
{
}
diff --git a/mesalib/src/mapi/glapi/glapi_sparc.S b/mesalib/src/mapi/glapi/glapi_sparc.S
index cb11a8b23..5d6f92124 100644
--- a/mesalib/src/mapi/glapi/glapi_sparc.S
+++ b/mesalib/src/mapi/glapi/glapi_sparc.S
@@ -1,1560 +1,1560 @@
-/* DO NOT EDIT - This file generated automatically by gl_SPARC_asm.py (from Mesa) script */
-
-/*
- * Copyright (C) 1999-2003 Brian Paul All Rights Reserved.
- * (C) Copyright IBM Corporation 2004
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sub license,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL, IBM,
- * AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
- * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-#ifdef __arch64__
-#define GL_OFF(N) ((N) * 8)
-#define GL_LL ldx
-#define GL_TIE_LD(SYM) %tie_ldx(SYM)
-#define GL_STACK_SIZE 128
-#else
-#define GL_OFF(N) ((N) * 4)
-#define GL_LL ld
-#define GL_TIE_LD(SYM) %tie_ld(SYM)
-#define GL_STACK_SIZE 64
-#endif
-
-#define GLOBL_FN(x) .globl x ; .type x, @function
-#define HIDDEN(x) .hidden x
-
- .register %g2, #scratch
- .register %g3, #scratch
-
- .text
-
- GLOBL_FN(__glapi_sparc_icache_flush)
- HIDDEN(__glapi_sparc_icache_flush)
- .type __glapi_sparc_icache_flush, @function
-__glapi_sparc_icache_flush: /* %o0 = insn_addr */
- flush %o0
- retl
- nop
-
- .align 32
-
- .type __glapi_sparc_get_pc, @function
-__glapi_sparc_get_pc:
- retl
- add %o7, %g2, %g2
- .size __glapi_sparc_get_pc, .-__glapi_sparc_get_pc
-
-#ifdef GLX_USE_TLS
-
- GLOBL_FN(__glapi_sparc_get_dispatch)
- HIDDEN(__glapi_sparc_get_dispatch)
-__glapi_sparc_get_dispatch:
- mov %o7, %g1
- sethi %hi(_GLOBAL_OFFSET_TABLE_-4), %g2
- call __glapi_sparc_get_pc
- add %g2, %lo(_GLOBAL_OFFSET_TABLE_+4), %g2
- mov %g1, %o7
- sethi %tie_hi22(_glapi_tls_Dispatch), %g1
- add %g1, %tie_lo10(_glapi_tls_Dispatch), %g1
- GL_LL [%g2 + %g1], %g2, GL_TIE_LD(_glapi_tls_Dispatch)
- retl
- mov %g2, %o0
-
- .data
- .align 32
-
- /* --> sethi %hi(_glapi_tls_Dispatch), %g1 */
- /* --> or %g1, %lo(_glapi_tls_Dispatch), %g1 */
- GLOBL_FN(__glapi_sparc_tls_stub)
- HIDDEN(__glapi_sparc_tls_stub)
-__glapi_sparc_tls_stub: /* Call offset in %g3 */
- mov %o7, %g1
- sethi %hi(_GLOBAL_OFFSET_TABLE_-4), %g2
- call __glapi_sparc_get_pc
- add %g2, %lo(_GLOBAL_OFFSET_TABLE_+4), %g2
- mov %g1, %o7
- srl %g3, 10, %g3
- sethi %tie_hi22(_glapi_tls_Dispatch), %g1
- add %g1, %tie_lo10(_glapi_tls_Dispatch), %g1
- GL_LL [%g2 + %g1], %g2, GL_TIE_LD(_glapi_tls_Dispatch)
- GL_LL [%g7+%g2], %g1
- GL_LL [%g1 + %g3], %g1
- jmp %g1
- nop
- .size __glapi_sparc_tls_stub, .-__glapi_sparc_tls_stub
-
-#define GL_STUB(fn, off) \
- GLOBL_FN(fn); \
-fn: ba __glapi_sparc_tls_stub; \
- sethi GL_OFF(off), %g3; \
- .size fn,.-fn;
-
-#elif defined(PTHREADS)
-
- /* 64-bit 0x00 --> sethi %hh(_glapi_Dispatch), %g1 */
- /* 64-bit 0x04 --> sethi %lm(_glapi_Dispatch), %g2 */
- /* 64-bit 0x08 --> or %g1, %hm(_glapi_Dispatch), %g1 */
- /* 64-bit 0x0c --> sllx %g1, 32, %g1 */
- /* 64-bit 0x10 --> add %g1, %g2, %g1 */
- /* 64-bit 0x14 --> ldx [%g1 + %lo(_glapi_Dispatch)], %g1 */
-
- /* 32-bit 0x00 --> sethi %hi(_glapi_Dispatch), %g1 */
- /* 32-bit 0x04 --> ld [%g1 + %lo(_glapi_Dispatch)], %g1 */
-
- .data
- .align 32
-
- GLOBL_FN(__glapi_sparc_pthread_stub)
- HIDDEN(__glapi_sparc_pthread_stub)
-__glapi_sparc_pthread_stub: /* Call offset in %g3 */
- mov %o7, %g1
- sethi %hi(_GLOBAL_OFFSET_TABLE_-4), %g2
- call __glapi_sparc_get_pc
- add %g2, %lo(_GLOBAL_OFFSET_TABLE_+4), %g2
- mov %g1, %o7
- sethi %hi(_glapi_Dispatch), %g1
- or %g1, %lo(_glapi_Dispatch), %g1
- srl %g3, 10, %g3
- GL_LL [%g2+%g1], %g2
- GL_LL [%g2], %g1
- cmp %g1, 0
- be 2f
- nop
-1: GL_LL [%g1 + %g3], %g1
- jmp %g1
- nop
-2: save %sp, GL_STACK_SIZE, %sp
- mov %g3, %l0
- call _glapi_get_dispatch
- nop
- mov %o0, %g1
- mov %l0, %g3
- ba 1b
- restore %g0, %g0, %g0
- .size __glapi_sparc_pthread_stub, .-__glapi_sparc_pthread_stub
-
-#define GL_STUB(fn, off) \
- GLOBL_FN(fn); \
-fn: ba __glapi_sparc_pthread_stub; \
- sethi GL_OFF(off), %g3; \
- .size fn,.-fn;
-
-#else /* Non-threaded version. */
-
- .type __glapi_sparc_nothread_stub, @function
-__glapi_sparc_nothread_stub: /* Call offset in %g3 */
- mov %o7, %g1
- sethi %hi(_GLOBAL_OFFSET_TABLE_-4), %g2
- call __glapi_sparc_get_pc
- add %g2, %lo(_GLOBAL_OFFSET_TABLE_+4), %g2
- mov %g1, %o7
- srl %g3, 10, %g3
- sethi %hi(_glapi_Dispatch), %g1
- or %g1, %lo(_glapi_Dispatch), %g1
- GL_LL [%g2+%g1], %g2
- GL_LL [%g2], %g1
- GL_LL [%g1 + %g3], %g1
- jmp %g1
- nop
- .size __glapi_sparc_nothread_stub, .-__glapi_sparc_nothread_stub
-
-#define GL_STUB(fn, off) \
- GLOBL_FN(fn); \
-fn: ba __glapi_sparc_nothread_stub; \
- sethi GL_OFF(off), %g3; \
- .size fn,.-fn;
-
-#endif
-
-#define GL_STUB_ALIAS(fn, alias) \
- .globl fn; \
- .set fn, alias
-
- .text
- .align 32
-
- .globl gl_dispatch_functions_start
- HIDDEN(gl_dispatch_functions_start)
-gl_dispatch_functions_start:
-
- GL_STUB(glNewList, 0)
- GL_STUB(glEndList, 1)
- GL_STUB(glCallList, 2)
- GL_STUB(glCallLists, 3)
- GL_STUB(glDeleteLists, 4)
- GL_STUB(glGenLists, 5)
- GL_STUB(glListBase, 6)
- GL_STUB(glBegin, 7)
- GL_STUB(glBitmap, 8)
- GL_STUB(glColor3b, 9)
- GL_STUB(glColor3bv, 10)
- GL_STUB(glColor3d, 11)
- GL_STUB(glColor3dv, 12)
- GL_STUB(glColor3f, 13)
- GL_STUB(glColor3fv, 14)
- GL_STUB(glColor3i, 15)
- GL_STUB(glColor3iv, 16)
- GL_STUB(glColor3s, 17)
- GL_STUB(glColor3sv, 18)
- GL_STUB(glColor3ub, 19)
- GL_STUB(glColor3ubv, 20)
- GL_STUB(glColor3ui, 21)
- GL_STUB(glColor3uiv, 22)
- GL_STUB(glColor3us, 23)
- GL_STUB(glColor3usv, 24)
- GL_STUB(glColor4b, 25)
- GL_STUB(glColor4bv, 26)
- GL_STUB(glColor4d, 27)
- GL_STUB(glColor4dv, 28)
- GL_STUB(glColor4f, 29)
- GL_STUB(glColor4fv, 30)
- GL_STUB(glColor4i, 31)
- GL_STUB(glColor4iv, 32)
- GL_STUB(glColor4s, 33)
- GL_STUB(glColor4sv, 34)
- GL_STUB(glColor4ub, 35)
- GL_STUB(glColor4ubv, 36)
- GL_STUB(glColor4ui, 37)
- GL_STUB(glColor4uiv, 38)
- GL_STUB(glColor4us, 39)
- GL_STUB(glColor4usv, 40)
- GL_STUB(glEdgeFlag, 41)
- GL_STUB(glEdgeFlagv, 42)
- GL_STUB(glEnd, 43)
- GL_STUB(glIndexd, 44)
- GL_STUB(glIndexdv, 45)
- GL_STUB(glIndexf, 46)
- GL_STUB(glIndexfv, 47)
- GL_STUB(glIndexi, 48)
- GL_STUB(glIndexiv, 49)
- GL_STUB(glIndexs, 50)
- GL_STUB(glIndexsv, 51)
- GL_STUB(glNormal3b, 52)
- GL_STUB(glNormal3bv, 53)
- GL_STUB(glNormal3d, 54)
- GL_STUB(glNormal3dv, 55)
- GL_STUB(glNormal3f, 56)
- GL_STUB(glNormal3fv, 57)
- GL_STUB(glNormal3i, 58)
- GL_STUB(glNormal3iv, 59)
- GL_STUB(glNormal3s, 60)
- GL_STUB(glNormal3sv, 61)
- GL_STUB(glRasterPos2d, 62)
- GL_STUB(glRasterPos2dv, 63)
- GL_STUB(glRasterPos2f, 64)
- GL_STUB(glRasterPos2fv, 65)
- GL_STUB(glRasterPos2i, 66)
- GL_STUB(glRasterPos2iv, 67)
- GL_STUB(glRasterPos2s, 68)
- GL_STUB(glRasterPos2sv, 69)
- GL_STUB(glRasterPos3d, 70)
- GL_STUB(glRasterPos3dv, 71)
- GL_STUB(glRasterPos3f, 72)
- GL_STUB(glRasterPos3fv, 73)
- GL_STUB(glRasterPos3i, 74)
- GL_STUB(glRasterPos3iv, 75)
- GL_STUB(glRasterPos3s, 76)
- GL_STUB(glRasterPos3sv, 77)
- GL_STUB(glRasterPos4d, 78)
- GL_STUB(glRasterPos4dv, 79)
- GL_STUB(glRasterPos4f, 80)
- GL_STUB(glRasterPos4fv, 81)
- GL_STUB(glRasterPos4i, 82)
- GL_STUB(glRasterPos4iv, 83)
- GL_STUB(glRasterPos4s, 84)
- GL_STUB(glRasterPos4sv, 85)
- GL_STUB(glRectd, 86)
- GL_STUB(glRectdv, 87)
- GL_STUB(glRectf, 88)
- GL_STUB(glRectfv, 89)
- GL_STUB(glRecti, 90)
- GL_STUB(glRectiv, 91)
- GL_STUB(glRects, 92)
- GL_STUB(glRectsv, 93)
- GL_STUB(glTexCoord1d, 94)
- GL_STUB(glTexCoord1dv, 95)
- GL_STUB(glTexCoord1f, 96)
- GL_STUB(glTexCoord1fv, 97)
- GL_STUB(glTexCoord1i, 98)
- GL_STUB(glTexCoord1iv, 99)
- GL_STUB(glTexCoord1s, 100)
- GL_STUB(glTexCoord1sv, 101)
- GL_STUB(glTexCoord2d, 102)
- GL_STUB(glTexCoord2dv, 103)
- GL_STUB(glTexCoord2f, 104)
- GL_STUB(glTexCoord2fv, 105)
- GL_STUB(glTexCoord2i, 106)
- GL_STUB(glTexCoord2iv, 107)
- GL_STUB(glTexCoord2s, 108)
- GL_STUB(glTexCoord2sv, 109)
- GL_STUB(glTexCoord3d, 110)
- GL_STUB(glTexCoord3dv, 111)
- GL_STUB(glTexCoord3f, 112)
- GL_STUB(glTexCoord3fv, 113)
- GL_STUB(glTexCoord3i, 114)
- GL_STUB(glTexCoord3iv, 115)
- GL_STUB(glTexCoord3s, 116)
- GL_STUB(glTexCoord3sv, 117)
- GL_STUB(glTexCoord4d, 118)
- GL_STUB(glTexCoord4dv, 119)
- GL_STUB(glTexCoord4f, 120)
- GL_STUB(glTexCoord4fv, 121)
- GL_STUB(glTexCoord4i, 122)
- GL_STUB(glTexCoord4iv, 123)
- GL_STUB(glTexCoord4s, 124)
- GL_STUB(glTexCoord4sv, 125)
- GL_STUB(glVertex2d, 126)
- GL_STUB(glVertex2dv, 127)
- GL_STUB(glVertex2f, 128)
- GL_STUB(glVertex2fv, 129)
- GL_STUB(glVertex2i, 130)
- GL_STUB(glVertex2iv, 131)
- GL_STUB(glVertex2s, 132)
- GL_STUB(glVertex2sv, 133)
- GL_STUB(glVertex3d, 134)
- GL_STUB(glVertex3dv, 135)
- GL_STUB(glVertex3f, 136)
- GL_STUB(glVertex3fv, 137)
- GL_STUB(glVertex3i, 138)
- GL_STUB(glVertex3iv, 139)
- GL_STUB(glVertex3s, 140)
- GL_STUB(glVertex3sv, 141)
- GL_STUB(glVertex4d, 142)
- GL_STUB(glVertex4dv, 143)
- GL_STUB(glVertex4f, 144)
- GL_STUB(glVertex4fv, 145)
- GL_STUB(glVertex4i, 146)
- GL_STUB(glVertex4iv, 147)
- GL_STUB(glVertex4s, 148)
- GL_STUB(glVertex4sv, 149)
- GL_STUB(glClipPlane, 150)
- GL_STUB(glColorMaterial, 151)
- GL_STUB(glCullFace, 152)
- GL_STUB(glFogf, 153)
- GL_STUB(glFogfv, 154)
- GL_STUB(glFogi, 155)
- GL_STUB(glFogiv, 156)
- GL_STUB(glFrontFace, 157)
- GL_STUB(glHint, 158)
- GL_STUB(glLightf, 159)
- GL_STUB(glLightfv, 160)
- GL_STUB(glLighti, 161)
- GL_STUB(glLightiv, 162)
- GL_STUB(glLightModelf, 163)
- GL_STUB(glLightModelfv, 164)
- GL_STUB(glLightModeli, 165)
- GL_STUB(glLightModeliv, 166)
- GL_STUB(glLineStipple, 167)
- GL_STUB(glLineWidth, 168)
- GL_STUB(glMaterialf, 169)
- GL_STUB(glMaterialfv, 170)
- GL_STUB(glMateriali, 171)
- GL_STUB(glMaterialiv, 172)
- GL_STUB(glPointSize, 173)
- GL_STUB(glPolygonMode, 174)
- GL_STUB(glPolygonStipple, 175)
- GL_STUB(glScissor, 176)
- GL_STUB(glShadeModel, 177)
- GL_STUB(glTexParameterf, 178)
- GL_STUB(glTexParameterfv, 179)
- GL_STUB(glTexParameteri, 180)
- GL_STUB(glTexParameteriv, 181)
- GL_STUB(glTexImage1D, 182)
- GL_STUB(glTexImage2D, 183)
- GL_STUB(glTexEnvf, 184)
- GL_STUB(glTexEnvfv, 185)
- GL_STUB(glTexEnvi, 186)
- GL_STUB(glTexEnviv, 187)
- GL_STUB(glTexGend, 188)
- GL_STUB(glTexGendv, 189)
- GL_STUB(glTexGenf, 190)
- GL_STUB(glTexGenfv, 191)
- GL_STUB(glTexGeni, 192)
- GL_STUB(glTexGeniv, 193)
- GL_STUB(glFeedbackBuffer, 194)
- GL_STUB(glSelectBuffer, 195)
- GL_STUB(glRenderMode, 196)
- GL_STUB(glInitNames, 197)
- GL_STUB(glLoadName, 198)
- GL_STUB(glPassThrough, 199)
- GL_STUB(glPopName, 200)
- GL_STUB(glPushName, 201)
- GL_STUB(glDrawBuffer, 202)
- GL_STUB(glClear, 203)
- GL_STUB(glClearAccum, 204)
- GL_STUB(glClearIndex, 205)
- GL_STUB(glClearColor, 206)
- GL_STUB(glClearStencil, 207)
- GL_STUB(glClearDepth, 208)
- GL_STUB(glStencilMask, 209)
- GL_STUB(glColorMask, 210)
- GL_STUB(glDepthMask, 211)
- GL_STUB(glIndexMask, 212)
- GL_STUB(glAccum, 213)
- GL_STUB(glDisable, 214)
- GL_STUB(glEnable, 215)
- GL_STUB(glFinish, 216)
- GL_STUB(glFlush, 217)
- GL_STUB(glPopAttrib, 218)
- GL_STUB(glPushAttrib, 219)
- GL_STUB(glMap1d, 220)
- GL_STUB(glMap1f, 221)
- GL_STUB(glMap2d, 222)
- GL_STUB(glMap2f, 223)
- GL_STUB(glMapGrid1d, 224)
- GL_STUB(glMapGrid1f, 225)
- GL_STUB(glMapGrid2d, 226)
- GL_STUB(glMapGrid2f, 227)
- GL_STUB(glEvalCoord1d, 228)
- GL_STUB(glEvalCoord1dv, 229)
- GL_STUB(glEvalCoord1f, 230)
- GL_STUB(glEvalCoord1fv, 231)
- GL_STUB(glEvalCoord2d, 232)
- GL_STUB(glEvalCoord2dv, 233)
- GL_STUB(glEvalCoord2f, 234)
- GL_STUB(glEvalCoord2fv, 235)
- GL_STUB(glEvalMesh1, 236)
- GL_STUB(glEvalPoint1, 237)
- GL_STUB(glEvalMesh2, 238)
- GL_STUB(glEvalPoint2, 239)
- GL_STUB(glAlphaFunc, 240)
- GL_STUB(glBlendFunc, 241)
- GL_STUB(glLogicOp, 242)
- GL_STUB(glStencilFunc, 243)
- GL_STUB(glStencilOp, 244)
- GL_STUB(glDepthFunc, 245)
- GL_STUB(glPixelZoom, 246)
- GL_STUB(glPixelTransferf, 247)
- GL_STUB(glPixelTransferi, 248)
- GL_STUB(glPixelStoref, 249)
- GL_STUB(glPixelStorei, 250)
- GL_STUB(glPixelMapfv, 251)
- GL_STUB(glPixelMapuiv, 252)
- GL_STUB(glPixelMapusv, 253)
- GL_STUB(glReadBuffer, 254)
- GL_STUB(glCopyPixels, 255)
- GL_STUB(glReadPixels, 256)
- GL_STUB(glDrawPixels, 257)
- GL_STUB(glGetBooleanv, 258)
- GL_STUB(glGetClipPlane, 259)
- GL_STUB(glGetDoublev, 260)
- GL_STUB(glGetError, 261)
- GL_STUB(glGetFloatv, 262)
- GL_STUB(glGetIntegerv, 263)
- GL_STUB(glGetLightfv, 264)
- GL_STUB(glGetLightiv, 265)
- GL_STUB(glGetMapdv, 266)
- GL_STUB(glGetMapfv, 267)
- GL_STUB(glGetMapiv, 268)
- GL_STUB(glGetMaterialfv, 269)
- GL_STUB(glGetMaterialiv, 270)
- GL_STUB(glGetPixelMapfv, 271)
- GL_STUB(glGetPixelMapuiv, 272)
- GL_STUB(glGetPixelMapusv, 273)
- GL_STUB(glGetPolygonStipple, 274)
- GL_STUB(glGetString, 275)
- GL_STUB(glGetTexEnvfv, 276)
- GL_STUB(glGetTexEnviv, 277)
- GL_STUB(glGetTexGendv, 278)
- GL_STUB(glGetTexGenfv, 279)
- GL_STUB(glGetTexGeniv, 280)
- GL_STUB(glGetTexImage, 281)
- GL_STUB(glGetTexParameterfv, 282)
- GL_STUB(glGetTexParameteriv, 283)
- GL_STUB(glGetTexLevelParameterfv, 284)
- GL_STUB(glGetTexLevelParameteriv, 285)
- GL_STUB(glIsEnabled, 286)
- GL_STUB(glIsList, 287)
- GL_STUB(glDepthRange, 288)
- GL_STUB(glFrustum, 289)
- GL_STUB(glLoadIdentity, 290)
- GL_STUB(glLoadMatrixf, 291)
- GL_STUB(glLoadMatrixd, 292)
- GL_STUB(glMatrixMode, 293)
- GL_STUB(glMultMatrixf, 294)
- GL_STUB(glMultMatrixd, 295)
- GL_STUB(glOrtho, 296)
- GL_STUB(glPopMatrix, 297)
- GL_STUB(glPushMatrix, 298)
- GL_STUB(glRotated, 299)
- GL_STUB(glRotatef, 300)
- GL_STUB(glScaled, 301)
- GL_STUB(glScalef, 302)
- GL_STUB(glTranslated, 303)
- GL_STUB(glTranslatef, 304)
- GL_STUB(glViewport, 305)
- GL_STUB(glArrayElement, 306)
- GL_STUB(glBindTexture, 307)
- GL_STUB(glColorPointer, 308)
- GL_STUB(glDisableClientState, 309)
- GL_STUB(glDrawArrays, 310)
- GL_STUB(glDrawElements, 311)
- GL_STUB(glEdgeFlagPointer, 312)
- GL_STUB(glEnableClientState, 313)
- GL_STUB(glIndexPointer, 314)
- GL_STUB(glIndexub, 315)
- GL_STUB(glIndexubv, 316)
- GL_STUB(glInterleavedArrays, 317)
- GL_STUB(glNormalPointer, 318)
- GL_STUB(glPolygonOffset, 319)
- GL_STUB(glTexCoordPointer, 320)
- GL_STUB(glVertexPointer, 321)
- GL_STUB(glAreTexturesResident, 322)
- GL_STUB(glCopyTexImage1D, 323)
- GL_STUB(glCopyTexImage2D, 324)
- GL_STUB(glCopyTexSubImage1D, 325)
- GL_STUB(glCopyTexSubImage2D, 326)
- GL_STUB(glDeleteTextures, 327)
- GL_STUB(glGenTextures, 328)
- GL_STUB(glGetPointerv, 329)
- GL_STUB(glIsTexture, 330)
- GL_STUB(glPrioritizeTextures, 331)
- GL_STUB(glTexSubImage1D, 332)
- GL_STUB(glTexSubImage2D, 333)
- GL_STUB(glPopClientAttrib, 334)
- GL_STUB(glPushClientAttrib, 335)
- GL_STUB(glBlendColor, 336)
- GL_STUB(glBlendEquation, 337)
- GL_STUB(glDrawRangeElements, 338)
- GL_STUB(glColorTable, 339)
- GL_STUB(glColorTableParameterfv, 340)
- GL_STUB(glColorTableParameteriv, 341)
- GL_STUB(glCopyColorTable, 342)
- GL_STUB(glGetColorTable, 343)
- GL_STUB(glGetColorTableParameterfv, 344)
- GL_STUB(glGetColorTableParameteriv, 345)
- GL_STUB(glColorSubTable, 346)
- GL_STUB(glCopyColorSubTable, 347)
- GL_STUB(glConvolutionFilter1D, 348)
- GL_STUB(glConvolutionFilter2D, 349)
- GL_STUB(glConvolutionParameterf, 350)
- GL_STUB(glConvolutionParameterfv, 351)
- GL_STUB(glConvolutionParameteri, 352)
- GL_STUB(glConvolutionParameteriv, 353)
- GL_STUB(glCopyConvolutionFilter1D, 354)
- GL_STUB(glCopyConvolutionFilter2D, 355)
- GL_STUB(glGetConvolutionFilter, 356)
- GL_STUB(glGetConvolutionParameterfv, 357)
- GL_STUB(glGetConvolutionParameteriv, 358)
- GL_STUB(glGetSeparableFilter, 359)
- GL_STUB(glSeparableFilter2D, 360)
- GL_STUB(glGetHistogram, 361)
- GL_STUB(glGetHistogramParameterfv, 362)
- GL_STUB(glGetHistogramParameteriv, 363)
- GL_STUB(glGetMinmax, 364)
- GL_STUB(glGetMinmaxParameterfv, 365)
- GL_STUB(glGetMinmaxParameteriv, 366)
- GL_STUB(glHistogram, 367)
- GL_STUB(glMinmax, 368)
- GL_STUB(glResetHistogram, 369)
- GL_STUB(glResetMinmax, 370)
- GL_STUB(glTexImage3D, 371)
- GL_STUB(glTexSubImage3D, 372)
- GL_STUB(glCopyTexSubImage3D, 373)
- GL_STUB(glActiveTextureARB, 374)
- GL_STUB(glClientActiveTextureARB, 375)
- GL_STUB(glMultiTexCoord1dARB, 376)
- GL_STUB(glMultiTexCoord1dvARB, 377)
- GL_STUB(glMultiTexCoord1fARB, 378)
- GL_STUB(glMultiTexCoord1fvARB, 379)
- GL_STUB(glMultiTexCoord1iARB, 380)
- GL_STUB(glMultiTexCoord1ivARB, 381)
- GL_STUB(glMultiTexCoord1sARB, 382)
- GL_STUB(glMultiTexCoord1svARB, 383)
- GL_STUB(glMultiTexCoord2dARB, 384)
- GL_STUB(glMultiTexCoord2dvARB, 385)
- GL_STUB(glMultiTexCoord2fARB, 386)
- GL_STUB(glMultiTexCoord2fvARB, 387)
- GL_STUB(glMultiTexCoord2iARB, 388)
- GL_STUB(glMultiTexCoord2ivARB, 389)
- GL_STUB(glMultiTexCoord2sARB, 390)
- GL_STUB(glMultiTexCoord2svARB, 391)
- GL_STUB(glMultiTexCoord3dARB, 392)
- GL_STUB(glMultiTexCoord3dvARB, 393)
- GL_STUB(glMultiTexCoord3fARB, 394)
- GL_STUB(glMultiTexCoord3fvARB, 395)
- GL_STUB(glMultiTexCoord3iARB, 396)
- GL_STUB(glMultiTexCoord3ivARB, 397)
- GL_STUB(glMultiTexCoord3sARB, 398)
- GL_STUB(glMultiTexCoord3svARB, 399)
- GL_STUB(glMultiTexCoord4dARB, 400)
- GL_STUB(glMultiTexCoord4dvARB, 401)
- GL_STUB(glMultiTexCoord4fARB, 402)
- GL_STUB(glMultiTexCoord4fvARB, 403)
- GL_STUB(glMultiTexCoord4iARB, 404)
- GL_STUB(glMultiTexCoord4ivARB, 405)
- GL_STUB(glMultiTexCoord4sARB, 406)
- GL_STUB(glMultiTexCoord4svARB, 407)
- GL_STUB(glAttachShader, 408)
- GL_STUB(glCreateProgram, 409)
- GL_STUB(glCreateShader, 410)
- GL_STUB(glDeleteProgram, 411)
- GL_STUB(glDeleteShader, 412)
- GL_STUB(glDetachShader, 413)
- GL_STUB(glGetAttachedShaders, 414)
- GL_STUB(glGetProgramInfoLog, 415)
- GL_STUB(glGetProgramiv, 416)
- GL_STUB(glGetShaderInfoLog, 417)
- GL_STUB(glGetShaderiv, 418)
- GL_STUB(glIsProgram, 419)
- GL_STUB(glIsShader, 420)
- GL_STUB(glStencilFuncSeparate, 421)
- GL_STUB(glStencilMaskSeparate, 422)
- GL_STUB(glStencilOpSeparate, 423)
- GL_STUB(glUniformMatrix2x3fv, 424)
- GL_STUB(glUniformMatrix2x4fv, 425)
- GL_STUB(glUniformMatrix3x2fv, 426)
- GL_STUB(glUniformMatrix3x4fv, 427)
- GL_STUB(glUniformMatrix4x2fv, 428)
- GL_STUB(glUniformMatrix4x3fv, 429)
- GL_STUB(glClampColor, 430)
- GL_STUB(glClearBufferfi, 431)
- GL_STUB(glClearBufferfv, 432)
- GL_STUB(glClearBufferiv, 433)
- GL_STUB(glClearBufferuiv, 434)
- GL_STUB(glGetStringi, 435)
- GL_STUB(glTexBuffer, 436)
- GL_STUB(glFramebufferTexture, 437)
- GL_STUB(glGetBufferParameteri64v, 438)
- GL_STUB(glGetInteger64i_v, 439)
- GL_STUB(glVertexAttribDivisor, 440)
- GL_STUB(glLoadTransposeMatrixdARB, 441)
- GL_STUB(glLoadTransposeMatrixfARB, 442)
- GL_STUB(glMultTransposeMatrixdARB, 443)
- GL_STUB(glMultTransposeMatrixfARB, 444)
- GL_STUB(glSampleCoverageARB, 445)
- GL_STUB(glCompressedTexImage1DARB, 446)
- GL_STUB(glCompressedTexImage2DARB, 447)
- GL_STUB(glCompressedTexImage3DARB, 448)
- GL_STUB(glCompressedTexSubImage1DARB, 449)
- GL_STUB(glCompressedTexSubImage2DARB, 450)
- GL_STUB(glCompressedTexSubImage3DARB, 451)
- GL_STUB(glGetCompressedTexImageARB, 452)
- GL_STUB(glDisableVertexAttribArrayARB, 453)
- GL_STUB(glEnableVertexAttribArrayARB, 454)
- GL_STUB(glGetProgramEnvParameterdvARB, 455)
- GL_STUB(glGetProgramEnvParameterfvARB, 456)
- GL_STUB(glGetProgramLocalParameterdvARB, 457)
- GL_STUB(glGetProgramLocalParameterfvARB, 458)
- GL_STUB(glGetProgramStringARB, 459)
- GL_STUB(glGetProgramivARB, 460)
- GL_STUB(glGetVertexAttribdvARB, 461)
- GL_STUB(glGetVertexAttribfvARB, 462)
- GL_STUB(glGetVertexAttribivARB, 463)
- GL_STUB(glProgramEnvParameter4dARB, 464)
- GL_STUB(glProgramEnvParameter4dvARB, 465)
- GL_STUB(glProgramEnvParameter4fARB, 466)
- GL_STUB(glProgramEnvParameter4fvARB, 467)
- GL_STUB(glProgramLocalParameter4dARB, 468)
- GL_STUB(glProgramLocalParameter4dvARB, 469)
- GL_STUB(glProgramLocalParameter4fARB, 470)
- GL_STUB(glProgramLocalParameter4fvARB, 471)
- GL_STUB(glProgramStringARB, 472)
- GL_STUB(glVertexAttrib1dARB, 473)
- GL_STUB(glVertexAttrib1dvARB, 474)
- GL_STUB(glVertexAttrib1fARB, 475)
- GL_STUB(glVertexAttrib1fvARB, 476)
- GL_STUB(glVertexAttrib1sARB, 477)
- GL_STUB(glVertexAttrib1svARB, 478)
- GL_STUB(glVertexAttrib2dARB, 479)
- GL_STUB(glVertexAttrib2dvARB, 480)
- GL_STUB(glVertexAttrib2fARB, 481)
- GL_STUB(glVertexAttrib2fvARB, 482)
- GL_STUB(glVertexAttrib2sARB, 483)
- GL_STUB(glVertexAttrib2svARB, 484)
- GL_STUB(glVertexAttrib3dARB, 485)
- GL_STUB(glVertexAttrib3dvARB, 486)
- GL_STUB(glVertexAttrib3fARB, 487)
- GL_STUB(glVertexAttrib3fvARB, 488)
- GL_STUB(glVertexAttrib3sARB, 489)
- GL_STUB(glVertexAttrib3svARB, 490)
- GL_STUB(glVertexAttrib4NbvARB, 491)
- GL_STUB(glVertexAttrib4NivARB, 492)
- GL_STUB(glVertexAttrib4NsvARB, 493)
- GL_STUB(glVertexAttrib4NubARB, 494)
- GL_STUB(glVertexAttrib4NubvARB, 495)
- GL_STUB(glVertexAttrib4NuivARB, 496)
- GL_STUB(glVertexAttrib4NusvARB, 497)
- GL_STUB(glVertexAttrib4bvARB, 498)
- GL_STUB(glVertexAttrib4dARB, 499)
- GL_STUB(glVertexAttrib4dvARB, 500)
- GL_STUB(glVertexAttrib4fARB, 501)
- GL_STUB(glVertexAttrib4fvARB, 502)
- GL_STUB(glVertexAttrib4ivARB, 503)
- GL_STUB(glVertexAttrib4sARB, 504)
- GL_STUB(glVertexAttrib4svARB, 505)
- GL_STUB(glVertexAttrib4ubvARB, 506)
- GL_STUB(glVertexAttrib4uivARB, 507)
- GL_STUB(glVertexAttrib4usvARB, 508)
- GL_STUB(glVertexAttribPointerARB, 509)
- GL_STUB(glBindBufferARB, 510)
- GL_STUB(glBufferDataARB, 511)
- GL_STUB(glBufferSubDataARB, 512)
- GL_STUB(glDeleteBuffersARB, 513)
- GL_STUB(glGenBuffersARB, 514)
- GL_STUB(glGetBufferParameterivARB, 515)
- GL_STUB(glGetBufferPointervARB, 516)
- GL_STUB(glGetBufferSubDataARB, 517)
- GL_STUB(glIsBufferARB, 518)
- GL_STUB(glMapBufferARB, 519)
- GL_STUB(glUnmapBufferARB, 520)
- GL_STUB(glBeginQueryARB, 521)
- GL_STUB(glDeleteQueriesARB, 522)
- GL_STUB(glEndQueryARB, 523)
- GL_STUB(glGenQueriesARB, 524)
- GL_STUB(glGetQueryObjectivARB, 525)
- GL_STUB(glGetQueryObjectuivARB, 526)
- GL_STUB(glGetQueryivARB, 527)
- GL_STUB(glIsQueryARB, 528)
- GL_STUB(glAttachObjectARB, 529)
- GL_STUB(glCompileShaderARB, 530)
- GL_STUB(glCreateProgramObjectARB, 531)
- GL_STUB(glCreateShaderObjectARB, 532)
- GL_STUB(glDeleteObjectARB, 533)
- GL_STUB(glDetachObjectARB, 534)
- GL_STUB(glGetActiveUniformARB, 535)
- GL_STUB(glGetAttachedObjectsARB, 536)
- GL_STUB(glGetHandleARB, 537)
- GL_STUB(glGetInfoLogARB, 538)
- GL_STUB(glGetObjectParameterfvARB, 539)
- GL_STUB(glGetObjectParameterivARB, 540)
- GL_STUB(glGetShaderSourceARB, 541)
- GL_STUB(glGetUniformLocationARB, 542)
- GL_STUB(glGetUniformfvARB, 543)
- GL_STUB(glGetUniformivARB, 544)
- GL_STUB(glLinkProgramARB, 545)
- GL_STUB(glShaderSourceARB, 546)
- GL_STUB(glUniform1fARB, 547)
- GL_STUB(glUniform1fvARB, 548)
- GL_STUB(glUniform1iARB, 549)
- GL_STUB(glUniform1ivARB, 550)
- GL_STUB(glUniform2fARB, 551)
- GL_STUB(glUniform2fvARB, 552)
- GL_STUB(glUniform2iARB, 553)
- GL_STUB(glUniform2ivARB, 554)
- GL_STUB(glUniform3fARB, 555)
- GL_STUB(glUniform3fvARB, 556)
- GL_STUB(glUniform3iARB, 557)
- GL_STUB(glUniform3ivARB, 558)
- GL_STUB(glUniform4fARB, 559)
- GL_STUB(glUniform4fvARB, 560)
- GL_STUB(glUniform4iARB, 561)
- GL_STUB(glUniform4ivARB, 562)
- GL_STUB(glUniformMatrix2fvARB, 563)
- GL_STUB(glUniformMatrix3fvARB, 564)
- GL_STUB(glUniformMatrix4fvARB, 565)
- GL_STUB(glUseProgramObjectARB, 566)
- GL_STUB(glValidateProgramARB, 567)
- GL_STUB(glBindAttribLocationARB, 568)
- GL_STUB(glGetActiveAttribARB, 569)
- GL_STUB(glGetAttribLocationARB, 570)
- GL_STUB(glDrawBuffersARB, 571)
- GL_STUB(glClampColorARB, 572)
- GL_STUB(glDrawArraysInstancedARB, 573)
- GL_STUB(glDrawElementsInstancedARB, 574)
- GL_STUB(glRenderbufferStorageMultisample, 575)
- GL_STUB(glFramebufferTextureARB, 576)
- GL_STUB(glFramebufferTextureFaceARB, 577)
- GL_STUB(glProgramParameteriARB, 578)
- GL_STUB(glVertexAttribDivisorARB, 579)
- GL_STUB(glFlushMappedBufferRange, 580)
- GL_STUB(glMapBufferRange, 581)
- GL_STUB(glTexBufferARB, 582)
- GL_STUB(glBindVertexArray, 583)
- GL_STUB(glGenVertexArrays, 584)
- GL_STUB(glCopyBufferSubData, 585)
- GL_STUB(glClientWaitSync, 586)
- GL_STUB(glDeleteSync, 587)
- GL_STUB(glFenceSync, 588)
- GL_STUB(glGetInteger64v, 589)
- GL_STUB(glGetSynciv, 590)
- GL_STUB(glIsSync, 591)
- GL_STUB(glWaitSync, 592)
- GL_STUB(glDrawElementsBaseVertex, 593)
- GL_STUB(glDrawRangeElementsBaseVertex, 594)
- GL_STUB(glMultiDrawElementsBaseVertex, 595)
- GL_STUB(glBlendEquationSeparateiARB, 596)
- GL_STUB(glBlendEquationiARB, 597)
- GL_STUB(glBlendFuncSeparateiARB, 598)
- GL_STUB(glBlendFunciARB, 599)
- GL_STUB(glBindSampler, 600)
- GL_STUB(glDeleteSamplers, 601)
- GL_STUB(glGenSamplers, 602)
- GL_STUB(glGetSamplerParameterIiv, 603)
- GL_STUB(glGetSamplerParameterIuiv, 604)
- GL_STUB(glGetSamplerParameterfv, 605)
- GL_STUB(glGetSamplerParameteriv, 606)
- GL_STUB(glIsSampler, 607)
- GL_STUB(glSamplerParameterIiv, 608)
- GL_STUB(glSamplerParameterIuiv, 609)
- GL_STUB(glSamplerParameterf, 610)
- GL_STUB(glSamplerParameterfv, 611)
- GL_STUB(glSamplerParameteri, 612)
- GL_STUB(glSamplerParameteriv, 613)
- GL_STUB(glBindTransformFeedback, 614)
- GL_STUB(glDeleteTransformFeedbacks, 615)
- GL_STUB(glDrawTransformFeedback, 616)
- GL_STUB(glGenTransformFeedbacks, 617)
- GL_STUB(glIsTransformFeedback, 618)
- GL_STUB(glPauseTransformFeedback, 619)
- GL_STUB(glResumeTransformFeedback, 620)
- GL_STUB(glClearDepthf, 621)
- GL_STUB(glDepthRangef, 622)
- GL_STUB(glGetShaderPrecisionFormat, 623)
- GL_STUB(glReleaseShaderCompiler, 624)
- GL_STUB(glShaderBinary, 625)
- GL_STUB(glGetGraphicsResetStatusARB, 626)
- GL_STUB(glGetnColorTableARB, 627)
- GL_STUB(glGetnCompressedTexImageARB, 628)
- GL_STUB(glGetnConvolutionFilterARB, 629)
- GL_STUB(glGetnHistogramARB, 630)
- GL_STUB(glGetnMapdvARB, 631)
- GL_STUB(glGetnMapfvARB, 632)
- GL_STUB(glGetnMapivARB, 633)
- GL_STUB(glGetnMinmaxARB, 634)
- GL_STUB(glGetnPixelMapfvARB, 635)
- GL_STUB(glGetnPixelMapuivARB, 636)
- GL_STUB(glGetnPixelMapusvARB, 637)
- GL_STUB(glGetnPolygonStippleARB, 638)
- GL_STUB(glGetnSeparableFilterARB, 639)
- GL_STUB(glGetnTexImageARB, 640)
- GL_STUB(glGetnUniformdvARB, 641)
- GL_STUB(glGetnUniformfvARB, 642)
- GL_STUB(glGetnUniformivARB, 643)
- GL_STUB(glGetnUniformuivARB, 644)
- GL_STUB(glReadnPixelsARB, 645)
- GL_STUB(glPolygonOffsetEXT, 646)
- GL_STUB(gl_dispatch_stub_647, 647)
- HIDDEN(gl_dispatch_stub_647)
- GL_STUB(gl_dispatch_stub_648, 648)
- HIDDEN(gl_dispatch_stub_648)
- GL_STUB(gl_dispatch_stub_649, 649)
- HIDDEN(gl_dispatch_stub_649)
- GL_STUB(gl_dispatch_stub_650, 650)
- HIDDEN(gl_dispatch_stub_650)
- GL_STUB(gl_dispatch_stub_651, 651)
- HIDDEN(gl_dispatch_stub_651)
- GL_STUB(gl_dispatch_stub_652, 652)
- HIDDEN(gl_dispatch_stub_652)
- GL_STUB(gl_dispatch_stub_653, 653)
- HIDDEN(gl_dispatch_stub_653)
- GL_STUB(gl_dispatch_stub_654, 654)
- HIDDEN(gl_dispatch_stub_654)
- GL_STUB(glColorPointerEXT, 655)
- GL_STUB(glEdgeFlagPointerEXT, 656)
- GL_STUB(glIndexPointerEXT, 657)
- GL_STUB(glNormalPointerEXT, 658)
- GL_STUB(glTexCoordPointerEXT, 659)
- GL_STUB(glVertexPointerEXT, 660)
- GL_STUB(glPointParameterfEXT, 661)
- GL_STUB(glPointParameterfvEXT, 662)
- GL_STUB(glLockArraysEXT, 663)
- GL_STUB(glUnlockArraysEXT, 664)
- GL_STUB(glSecondaryColor3bEXT, 665)
- GL_STUB(glSecondaryColor3bvEXT, 666)
- GL_STUB(glSecondaryColor3dEXT, 667)
- GL_STUB(glSecondaryColor3dvEXT, 668)
- GL_STUB(glSecondaryColor3fEXT, 669)
- GL_STUB(glSecondaryColor3fvEXT, 670)
- GL_STUB(glSecondaryColor3iEXT, 671)
- GL_STUB(glSecondaryColor3ivEXT, 672)
- GL_STUB(glSecondaryColor3sEXT, 673)
- GL_STUB(glSecondaryColor3svEXT, 674)
- GL_STUB(glSecondaryColor3ubEXT, 675)
- GL_STUB(glSecondaryColor3ubvEXT, 676)
- GL_STUB(glSecondaryColor3uiEXT, 677)
- GL_STUB(glSecondaryColor3uivEXT, 678)
- GL_STUB(glSecondaryColor3usEXT, 679)
- GL_STUB(glSecondaryColor3usvEXT, 680)
- GL_STUB(glSecondaryColorPointerEXT, 681)
- GL_STUB(glMultiDrawArraysEXT, 682)
- GL_STUB(glMultiDrawElementsEXT, 683)
- GL_STUB(glFogCoordPointerEXT, 684)
- GL_STUB(glFogCoorddEXT, 685)
- GL_STUB(glFogCoorddvEXT, 686)
- GL_STUB(glFogCoordfEXT, 687)
- GL_STUB(glFogCoordfvEXT, 688)
- GL_STUB(gl_dispatch_stub_689, 689)
- HIDDEN(gl_dispatch_stub_689)
- GL_STUB(glBlendFuncSeparateEXT, 690)
- GL_STUB(glFlushVertexArrayRangeNV, 691)
- GL_STUB(glVertexArrayRangeNV, 692)
- GL_STUB(glCombinerInputNV, 693)
- GL_STUB(glCombinerOutputNV, 694)
- GL_STUB(glCombinerParameterfNV, 695)
- GL_STUB(glCombinerParameterfvNV, 696)
- GL_STUB(glCombinerParameteriNV, 697)
- GL_STUB(glCombinerParameterivNV, 698)
- GL_STUB(glFinalCombinerInputNV, 699)
- GL_STUB(glGetCombinerInputParameterfvNV, 700)
- GL_STUB(glGetCombinerInputParameterivNV, 701)
- GL_STUB(glGetCombinerOutputParameterfvNV, 702)
- GL_STUB(glGetCombinerOutputParameterivNV, 703)
- GL_STUB(glGetFinalCombinerInputParameterfvNV, 704)
- GL_STUB(glGetFinalCombinerInputParameterivNV, 705)
- GL_STUB(glResizeBuffersMESA, 706)
- GL_STUB(glWindowPos2dMESA, 707)
- GL_STUB(glWindowPos2dvMESA, 708)
- GL_STUB(glWindowPos2fMESA, 709)
- GL_STUB(glWindowPos2fvMESA, 710)
- GL_STUB(glWindowPos2iMESA, 711)
- GL_STUB(glWindowPos2ivMESA, 712)
- GL_STUB(glWindowPos2sMESA, 713)
- GL_STUB(glWindowPos2svMESA, 714)
- GL_STUB(glWindowPos3dMESA, 715)
- GL_STUB(glWindowPos3dvMESA, 716)
- GL_STUB(glWindowPos3fMESA, 717)
- GL_STUB(glWindowPos3fvMESA, 718)
- GL_STUB(glWindowPos3iMESA, 719)
- GL_STUB(glWindowPos3ivMESA, 720)
- GL_STUB(glWindowPos3sMESA, 721)
- GL_STUB(glWindowPos3svMESA, 722)
- GL_STUB(glWindowPos4dMESA, 723)
- GL_STUB(glWindowPos4dvMESA, 724)
- GL_STUB(glWindowPos4fMESA, 725)
- GL_STUB(glWindowPos4fvMESA, 726)
- GL_STUB(glWindowPos4iMESA, 727)
- GL_STUB(glWindowPos4ivMESA, 728)
- GL_STUB(glWindowPos4sMESA, 729)
- GL_STUB(glWindowPos4svMESA, 730)
- GL_STUB(gl_dispatch_stub_731, 731)
- HIDDEN(gl_dispatch_stub_731)
- GL_STUB(gl_dispatch_stub_732, 732)
- HIDDEN(gl_dispatch_stub_732)
- GL_STUB(gl_dispatch_stub_733, 733)
- HIDDEN(gl_dispatch_stub_733)
- GL_STUB(gl_dispatch_stub_734, 734)
- HIDDEN(gl_dispatch_stub_734)
- GL_STUB(gl_dispatch_stub_735, 735)
- HIDDEN(gl_dispatch_stub_735)
- GL_STUB(gl_dispatch_stub_736, 736)
- HIDDEN(gl_dispatch_stub_736)
- GL_STUB(gl_dispatch_stub_737, 737)
- HIDDEN(gl_dispatch_stub_737)
- GL_STUB(gl_dispatch_stub_738, 738)
- HIDDEN(gl_dispatch_stub_738)
- GL_STUB(gl_dispatch_stub_739, 739)
- HIDDEN(gl_dispatch_stub_739)
- GL_STUB(glAreProgramsResidentNV, 740)
- GL_STUB(glBindProgramNV, 741)
- GL_STUB(glDeleteProgramsNV, 742)
- GL_STUB(glExecuteProgramNV, 743)
- GL_STUB(glGenProgramsNV, 744)
- GL_STUB(glGetProgramParameterdvNV, 745)
- GL_STUB(glGetProgramParameterfvNV, 746)
- GL_STUB(glGetProgramStringNV, 747)
- GL_STUB(glGetProgramivNV, 748)
- GL_STUB(glGetTrackMatrixivNV, 749)
- GL_STUB(glGetVertexAttribPointervNV, 750)
- GL_STUB(glGetVertexAttribdvNV, 751)
- GL_STUB(glGetVertexAttribfvNV, 752)
- GL_STUB(glGetVertexAttribivNV, 753)
- GL_STUB(glIsProgramNV, 754)
- GL_STUB(glLoadProgramNV, 755)
- GL_STUB(glProgramParameters4dvNV, 756)
- GL_STUB(glProgramParameters4fvNV, 757)
- GL_STUB(glRequestResidentProgramsNV, 758)
- GL_STUB(glTrackMatrixNV, 759)
- GL_STUB(glVertexAttrib1dNV, 760)
- GL_STUB(glVertexAttrib1dvNV, 761)
- GL_STUB(glVertexAttrib1fNV, 762)
- GL_STUB(glVertexAttrib1fvNV, 763)
- GL_STUB(glVertexAttrib1sNV, 764)
- GL_STUB(glVertexAttrib1svNV, 765)
- GL_STUB(glVertexAttrib2dNV, 766)
- GL_STUB(glVertexAttrib2dvNV, 767)
- GL_STUB(glVertexAttrib2fNV, 768)
- GL_STUB(glVertexAttrib2fvNV, 769)
- GL_STUB(glVertexAttrib2sNV, 770)
- GL_STUB(glVertexAttrib2svNV, 771)
- GL_STUB(glVertexAttrib3dNV, 772)
- GL_STUB(glVertexAttrib3dvNV, 773)
- GL_STUB(glVertexAttrib3fNV, 774)
- GL_STUB(glVertexAttrib3fvNV, 775)
- GL_STUB(glVertexAttrib3sNV, 776)
- GL_STUB(glVertexAttrib3svNV, 777)
- GL_STUB(glVertexAttrib4dNV, 778)
- GL_STUB(glVertexAttrib4dvNV, 779)
- GL_STUB(glVertexAttrib4fNV, 780)
- GL_STUB(glVertexAttrib4fvNV, 781)
- GL_STUB(glVertexAttrib4sNV, 782)
- GL_STUB(glVertexAttrib4svNV, 783)
- GL_STUB(glVertexAttrib4ubNV, 784)
- GL_STUB(glVertexAttrib4ubvNV, 785)
- GL_STUB(glVertexAttribPointerNV, 786)
- GL_STUB(glVertexAttribs1dvNV, 787)
- GL_STUB(glVertexAttribs1fvNV, 788)
- GL_STUB(glVertexAttribs1svNV, 789)
- GL_STUB(glVertexAttribs2dvNV, 790)
- GL_STUB(glVertexAttribs2fvNV, 791)
- GL_STUB(glVertexAttribs2svNV, 792)
- GL_STUB(glVertexAttribs3dvNV, 793)
- GL_STUB(glVertexAttribs3fvNV, 794)
- GL_STUB(glVertexAttribs3svNV, 795)
- GL_STUB(glVertexAttribs4dvNV, 796)
- GL_STUB(glVertexAttribs4fvNV, 797)
- GL_STUB(glVertexAttribs4svNV, 798)
- GL_STUB(glVertexAttribs4ubvNV, 799)
- GL_STUB(glGetTexBumpParameterfvATI, 800)
- GL_STUB(glGetTexBumpParameterivATI, 801)
- GL_STUB(glTexBumpParameterfvATI, 802)
- GL_STUB(glTexBumpParameterivATI, 803)
- GL_STUB(glAlphaFragmentOp1ATI, 804)
- GL_STUB(glAlphaFragmentOp2ATI, 805)
- GL_STUB(glAlphaFragmentOp3ATI, 806)
- GL_STUB(glBeginFragmentShaderATI, 807)
- GL_STUB(glBindFragmentShaderATI, 808)
- GL_STUB(glColorFragmentOp1ATI, 809)
- GL_STUB(glColorFragmentOp2ATI, 810)
- GL_STUB(glColorFragmentOp3ATI, 811)
- GL_STUB(glDeleteFragmentShaderATI, 812)
- GL_STUB(glEndFragmentShaderATI, 813)
- GL_STUB(glGenFragmentShadersATI, 814)
- GL_STUB(glPassTexCoordATI, 815)
- GL_STUB(glSampleMapATI, 816)
- GL_STUB(glSetFragmentShaderConstantATI, 817)
- GL_STUB(glPointParameteriNV, 818)
- GL_STUB(glPointParameterivNV, 819)
- GL_STUB(gl_dispatch_stub_820, 820)
- HIDDEN(gl_dispatch_stub_820)
- GL_STUB(gl_dispatch_stub_821, 821)
- HIDDEN(gl_dispatch_stub_821)
- GL_STUB(gl_dispatch_stub_822, 822)
- HIDDEN(gl_dispatch_stub_822)
- GL_STUB(gl_dispatch_stub_823, 823)
- HIDDEN(gl_dispatch_stub_823)
- GL_STUB(gl_dispatch_stub_824, 824)
- HIDDEN(gl_dispatch_stub_824)
- GL_STUB(glGetProgramNamedParameterdvNV, 825)
- GL_STUB(glGetProgramNamedParameterfvNV, 826)
- GL_STUB(glProgramNamedParameter4dNV, 827)
- GL_STUB(glProgramNamedParameter4dvNV, 828)
- GL_STUB(glProgramNamedParameter4fNV, 829)
- GL_STUB(glProgramNamedParameter4fvNV, 830)
- GL_STUB(glPrimitiveRestartIndexNV, 831)
- GL_STUB(glPrimitiveRestartNV, 832)
- GL_STUB(gl_dispatch_stub_833, 833)
- HIDDEN(gl_dispatch_stub_833)
- GL_STUB(gl_dispatch_stub_834, 834)
- HIDDEN(gl_dispatch_stub_834)
- GL_STUB(glBindFramebufferEXT, 835)
- GL_STUB(glBindRenderbufferEXT, 836)
- GL_STUB(glCheckFramebufferStatusEXT, 837)
- GL_STUB(glDeleteFramebuffersEXT, 838)
- GL_STUB(glDeleteRenderbuffersEXT, 839)
- GL_STUB(glFramebufferRenderbufferEXT, 840)
- GL_STUB(glFramebufferTexture1DEXT, 841)
- GL_STUB(glFramebufferTexture2DEXT, 842)
- GL_STUB(glFramebufferTexture3DEXT, 843)
- GL_STUB(glGenFramebuffersEXT, 844)
- GL_STUB(glGenRenderbuffersEXT, 845)
- GL_STUB(glGenerateMipmapEXT, 846)
- GL_STUB(glGetFramebufferAttachmentParameterivEXT, 847)
- GL_STUB(glGetRenderbufferParameterivEXT, 848)
- GL_STUB(glIsFramebufferEXT, 849)
- GL_STUB(glIsRenderbufferEXT, 850)
- GL_STUB(glRenderbufferStorageEXT, 851)
- GL_STUB(gl_dispatch_stub_852, 852)
- HIDDEN(gl_dispatch_stub_852)
- GL_STUB(gl_dispatch_stub_853, 853)
- HIDDEN(gl_dispatch_stub_853)
- GL_STUB(gl_dispatch_stub_854, 854)
- HIDDEN(gl_dispatch_stub_854)
- GL_STUB(glBindFragDataLocationEXT, 855)
- GL_STUB(glGetFragDataLocationEXT, 856)
- GL_STUB(glGetUniformuivEXT, 857)
- GL_STUB(glGetVertexAttribIivEXT, 858)
- GL_STUB(glGetVertexAttribIuivEXT, 859)
- GL_STUB(glUniform1uiEXT, 860)
- GL_STUB(glUniform1uivEXT, 861)
- GL_STUB(glUniform2uiEXT, 862)
- GL_STUB(glUniform2uivEXT, 863)
- GL_STUB(glUniform3uiEXT, 864)
- GL_STUB(glUniform3uivEXT, 865)
- GL_STUB(glUniform4uiEXT, 866)
- GL_STUB(glUniform4uivEXT, 867)
- GL_STUB(glVertexAttribI1iEXT, 868)
- GL_STUB(glVertexAttribI1ivEXT, 869)
- GL_STUB(glVertexAttribI1uiEXT, 870)
- GL_STUB(glVertexAttribI1uivEXT, 871)
- GL_STUB(glVertexAttribI2iEXT, 872)
- GL_STUB(glVertexAttribI2ivEXT, 873)
- GL_STUB(glVertexAttribI2uiEXT, 874)
- GL_STUB(glVertexAttribI2uivEXT, 875)
- GL_STUB(glVertexAttribI3iEXT, 876)
- GL_STUB(glVertexAttribI3ivEXT, 877)
- GL_STUB(glVertexAttribI3uiEXT, 878)
- GL_STUB(glVertexAttribI3uivEXT, 879)
- GL_STUB(glVertexAttribI4bvEXT, 880)
- GL_STUB(glVertexAttribI4iEXT, 881)
- GL_STUB(glVertexAttribI4ivEXT, 882)
- GL_STUB(glVertexAttribI4svEXT, 883)
- GL_STUB(glVertexAttribI4ubvEXT, 884)
- GL_STUB(glVertexAttribI4uiEXT, 885)
- GL_STUB(glVertexAttribI4uivEXT, 886)
- GL_STUB(glVertexAttribI4usvEXT, 887)
- GL_STUB(glVertexAttribIPointerEXT, 888)
- GL_STUB(glFramebufferTextureLayerEXT, 889)
- GL_STUB(glColorMaskIndexedEXT, 890)
- GL_STUB(glDisableIndexedEXT, 891)
- GL_STUB(glEnableIndexedEXT, 892)
- GL_STUB(glGetBooleanIndexedvEXT, 893)
- GL_STUB(glGetIntegerIndexedvEXT, 894)
- GL_STUB(glIsEnabledIndexedEXT, 895)
- GL_STUB(glClearColorIiEXT, 896)
- GL_STUB(glClearColorIuiEXT, 897)
- GL_STUB(glGetTexParameterIivEXT, 898)
- GL_STUB(glGetTexParameterIuivEXT, 899)
- GL_STUB(glTexParameterIivEXT, 900)
- GL_STUB(glTexParameterIuivEXT, 901)
- GL_STUB(glBeginConditionalRenderNV, 902)
- GL_STUB(glEndConditionalRenderNV, 903)
- GL_STUB(glBeginTransformFeedbackEXT, 904)
- GL_STUB(glBindBufferBaseEXT, 905)
- GL_STUB(glBindBufferOffsetEXT, 906)
- GL_STUB(glBindBufferRangeEXT, 907)
- GL_STUB(glEndTransformFeedbackEXT, 908)
- GL_STUB(glGetTransformFeedbackVaryingEXT, 909)
- GL_STUB(glTransformFeedbackVaryingsEXT, 910)
- GL_STUB(glProvokingVertexEXT, 911)
- GL_STUB(gl_dispatch_stub_912, 912)
- HIDDEN(gl_dispatch_stub_912)
- GL_STUB(gl_dispatch_stub_913, 913)
- HIDDEN(gl_dispatch_stub_913)
- GL_STUB(glGetObjectParameterivAPPLE, 914)
- GL_STUB(glObjectPurgeableAPPLE, 915)
- GL_STUB(glObjectUnpurgeableAPPLE, 916)
- GL_STUB(glActiveProgramEXT, 917)
- GL_STUB(glCreateShaderProgramEXT, 918)
- GL_STUB(glUseShaderProgramEXT, 919)
- GL_STUB(glTextureBarrierNV, 920)
- GL_STUB(gl_dispatch_stub_921, 921)
- HIDDEN(gl_dispatch_stub_921)
- GL_STUB(gl_dispatch_stub_922, 922)
- HIDDEN(gl_dispatch_stub_922)
- GL_STUB(gl_dispatch_stub_923, 923)
- HIDDEN(gl_dispatch_stub_923)
- GL_STUB(gl_dispatch_stub_924, 924)
- HIDDEN(gl_dispatch_stub_924)
- GL_STUB(gl_dispatch_stub_925, 925)
- HIDDEN(gl_dispatch_stub_925)
- GL_STUB(glEGLImageTargetRenderbufferStorageOES, 926)
- GL_STUB(glEGLImageTargetTexture2DOES, 927)
- GL_STUB_ALIAS(glArrayElementEXT, glArrayElement)
- GL_STUB_ALIAS(glBindTextureEXT, glBindTexture)
- GL_STUB_ALIAS(glDrawArraysEXT, glDrawArrays)
-#ifndef GLX_INDIRECT_RENDERING
- GL_STUB_ALIAS(glAreTexturesResidentEXT, glAreTexturesResident)
-#endif
- GL_STUB_ALIAS(glCopyTexImage1DEXT, glCopyTexImage1D)
- GL_STUB_ALIAS(glCopyTexImage2DEXT, glCopyTexImage2D)
- GL_STUB_ALIAS(glCopyTexSubImage1DEXT, glCopyTexSubImage1D)
- GL_STUB_ALIAS(glCopyTexSubImage2DEXT, glCopyTexSubImage2D)
-#ifndef GLX_INDIRECT_RENDERING
- GL_STUB_ALIAS(glDeleteTexturesEXT, glDeleteTextures)
-#endif
-#ifndef GLX_INDIRECT_RENDERING
- GL_STUB_ALIAS(glGenTexturesEXT, glGenTextures)
-#endif
- GL_STUB_ALIAS(glGetPointervEXT, glGetPointerv)
-#ifndef GLX_INDIRECT_RENDERING
- GL_STUB_ALIAS(glIsTextureEXT, glIsTexture)
-#endif
- GL_STUB_ALIAS(glPrioritizeTexturesEXT, glPrioritizeTextures)
- GL_STUB_ALIAS(glTexSubImage1DEXT, glTexSubImage1D)
- GL_STUB_ALIAS(glTexSubImage2DEXT, glTexSubImage2D)
- GL_STUB_ALIAS(glBlendColorEXT, glBlendColor)
- GL_STUB_ALIAS(glBlendEquationEXT, glBlendEquation)
- GL_STUB_ALIAS(glDrawRangeElementsEXT, glDrawRangeElements)
- GL_STUB_ALIAS(glColorTableSGI, glColorTable)
- GL_STUB_ALIAS(glColorTableEXT, glColorTable)
- GL_STUB_ALIAS(glColorTableParameterfvSGI, glColorTableParameterfv)
- GL_STUB_ALIAS(glColorTableParameterivSGI, glColorTableParameteriv)
- GL_STUB_ALIAS(glCopyColorTableSGI, glCopyColorTable)
-#ifndef GLX_INDIRECT_RENDERING
- GL_STUB_ALIAS(glGetColorTableSGI, glGetColorTable)
-#endif
-#ifndef GLX_INDIRECT_RENDERING
- GL_STUB_ALIAS(glGetColorTableEXT, glGetColorTable)
-#endif
-#ifndef GLX_INDIRECT_RENDERING
- GL_STUB_ALIAS(glGetColorTableParameterfvSGI, glGetColorTableParameterfv)
-#endif
-#ifndef GLX_INDIRECT_RENDERING
- GL_STUB_ALIAS(glGetColorTableParameterfvEXT, glGetColorTableParameterfv)
-#endif
-#ifndef GLX_INDIRECT_RENDERING
- GL_STUB_ALIAS(glGetColorTableParameterivSGI, glGetColorTableParameteriv)
-#endif
-#ifndef GLX_INDIRECT_RENDERING
- GL_STUB_ALIAS(glGetColorTableParameterivEXT, glGetColorTableParameteriv)
-#endif
- GL_STUB_ALIAS(glColorSubTableEXT, glColorSubTable)
- GL_STUB_ALIAS(glCopyColorSubTableEXT, glCopyColorSubTable)
- GL_STUB_ALIAS(glConvolutionFilter1DEXT, glConvolutionFilter1D)
- GL_STUB_ALIAS(glConvolutionFilter2DEXT, glConvolutionFilter2D)
- GL_STUB_ALIAS(glConvolutionParameterfEXT, glConvolutionParameterf)
- GL_STUB_ALIAS(glConvolutionParameterfvEXT, glConvolutionParameterfv)
- GL_STUB_ALIAS(glConvolutionParameteriEXT, glConvolutionParameteri)
- GL_STUB_ALIAS(glConvolutionParameterivEXT, glConvolutionParameteriv)
- GL_STUB_ALIAS(glCopyConvolutionFilter1DEXT, glCopyConvolutionFilter1D)
- GL_STUB_ALIAS(glCopyConvolutionFilter2DEXT, glCopyConvolutionFilter2D)
-#ifndef GLX_INDIRECT_RENDERING
- GL_STUB_ALIAS(glGetConvolutionFilterEXT, glGetConvolutionFilter)
-#endif
-#ifndef GLX_INDIRECT_RENDERING
- GL_STUB_ALIAS(glGetConvolutionParameterfvEXT, glGetConvolutionParameterfv)
-#endif
-#ifndef GLX_INDIRECT_RENDERING
- GL_STUB_ALIAS(glGetConvolutionParameterivEXT, glGetConvolutionParameteriv)
-#endif
-#ifndef GLX_INDIRECT_RENDERING
- GL_STUB_ALIAS(glGetSeparableFilterEXT, glGetSeparableFilter)
-#endif
- GL_STUB_ALIAS(glSeparableFilter2DEXT, glSeparableFilter2D)
-#ifndef GLX_INDIRECT_RENDERING
- GL_STUB_ALIAS(glGetHistogramEXT, glGetHistogram)
-#endif
-#ifndef GLX_INDIRECT_RENDERING
- GL_STUB_ALIAS(glGetHistogramParameterfvEXT, glGetHistogramParameterfv)
-#endif
-#ifndef GLX_INDIRECT_RENDERING
- GL_STUB_ALIAS(glGetHistogramParameterivEXT, glGetHistogramParameteriv)
-#endif
-#ifndef GLX_INDIRECT_RENDERING
- GL_STUB_ALIAS(glGetMinmaxEXT, glGetMinmax)
-#endif
-#ifndef GLX_INDIRECT_RENDERING
- GL_STUB_ALIAS(glGetMinmaxParameterfvEXT, glGetMinmaxParameterfv)
-#endif
-#ifndef GLX_INDIRECT_RENDERING
- GL_STUB_ALIAS(glGetMinmaxParameterivEXT, glGetMinmaxParameteriv)
-#endif
- GL_STUB_ALIAS(glHistogramEXT, glHistogram)
- GL_STUB_ALIAS(glMinmaxEXT, glMinmax)
- GL_STUB_ALIAS(glResetHistogramEXT, glResetHistogram)
- GL_STUB_ALIAS(glResetMinmaxEXT, glResetMinmax)
- GL_STUB_ALIAS(glTexImage3DEXT, glTexImage3D)
- GL_STUB_ALIAS(glTexSubImage3DEXT, glTexSubImage3D)
- GL_STUB_ALIAS(glCopyTexSubImage3DEXT, glCopyTexSubImage3D)
- GL_STUB_ALIAS(glActiveTexture, glActiveTextureARB)
- GL_STUB_ALIAS(glClientActiveTexture, glClientActiveTextureARB)
- GL_STUB_ALIAS(glMultiTexCoord1d, glMultiTexCoord1dARB)
- GL_STUB_ALIAS(glMultiTexCoord1dv, glMultiTexCoord1dvARB)
- GL_STUB_ALIAS(glMultiTexCoord1f, glMultiTexCoord1fARB)
- GL_STUB_ALIAS(glMultiTexCoord1fv, glMultiTexCoord1fvARB)
- GL_STUB_ALIAS(glMultiTexCoord1i, glMultiTexCoord1iARB)
- GL_STUB_ALIAS(glMultiTexCoord1iv, glMultiTexCoord1ivARB)
- GL_STUB_ALIAS(glMultiTexCoord1s, glMultiTexCoord1sARB)
- GL_STUB_ALIAS(glMultiTexCoord1sv, glMultiTexCoord1svARB)
- GL_STUB_ALIAS(glMultiTexCoord2d, glMultiTexCoord2dARB)
- GL_STUB_ALIAS(glMultiTexCoord2dv, glMultiTexCoord2dvARB)
- GL_STUB_ALIAS(glMultiTexCoord2f, glMultiTexCoord2fARB)
- GL_STUB_ALIAS(glMultiTexCoord2fv, glMultiTexCoord2fvARB)
- GL_STUB_ALIAS(glMultiTexCoord2i, glMultiTexCoord2iARB)
- GL_STUB_ALIAS(glMultiTexCoord2iv, glMultiTexCoord2ivARB)
- GL_STUB_ALIAS(glMultiTexCoord2s, glMultiTexCoord2sARB)
- GL_STUB_ALIAS(glMultiTexCoord2sv, glMultiTexCoord2svARB)
- GL_STUB_ALIAS(glMultiTexCoord3d, glMultiTexCoord3dARB)
- GL_STUB_ALIAS(glMultiTexCoord3dv, glMultiTexCoord3dvARB)
- GL_STUB_ALIAS(glMultiTexCoord3f, glMultiTexCoord3fARB)
- GL_STUB_ALIAS(glMultiTexCoord3fv, glMultiTexCoord3fvARB)
- GL_STUB_ALIAS(glMultiTexCoord3i, glMultiTexCoord3iARB)
- GL_STUB_ALIAS(glMultiTexCoord3iv, glMultiTexCoord3ivARB)
- GL_STUB_ALIAS(glMultiTexCoord3s, glMultiTexCoord3sARB)
- GL_STUB_ALIAS(glMultiTexCoord3sv, glMultiTexCoord3svARB)
- GL_STUB_ALIAS(glMultiTexCoord4d, glMultiTexCoord4dARB)
- GL_STUB_ALIAS(glMultiTexCoord4dv, glMultiTexCoord4dvARB)
- GL_STUB_ALIAS(glMultiTexCoord4f, glMultiTexCoord4fARB)
- GL_STUB_ALIAS(glMultiTexCoord4fv, glMultiTexCoord4fvARB)
- GL_STUB_ALIAS(glMultiTexCoord4i, glMultiTexCoord4iARB)
- GL_STUB_ALIAS(glMultiTexCoord4iv, glMultiTexCoord4ivARB)
- GL_STUB_ALIAS(glMultiTexCoord4s, glMultiTexCoord4sARB)
- GL_STUB_ALIAS(glMultiTexCoord4sv, glMultiTexCoord4svARB)
- GL_STUB_ALIAS(glStencilOpSeparateATI, glStencilOpSeparate)
- GL_STUB_ALIAS(glLoadTransposeMatrixd, glLoadTransposeMatrixdARB)
- GL_STUB_ALIAS(glLoadTransposeMatrixf, glLoadTransposeMatrixfARB)
- GL_STUB_ALIAS(glMultTransposeMatrixd, glMultTransposeMatrixdARB)
- GL_STUB_ALIAS(glMultTransposeMatrixf, glMultTransposeMatrixfARB)
- GL_STUB_ALIAS(glSampleCoverage, glSampleCoverageARB)
- GL_STUB_ALIAS(glCompressedTexImage1D, glCompressedTexImage1DARB)
- GL_STUB_ALIAS(glCompressedTexImage2D, glCompressedTexImage2DARB)
- GL_STUB_ALIAS(glCompressedTexImage3D, glCompressedTexImage3DARB)
- GL_STUB_ALIAS(glCompressedTexSubImage1D, glCompressedTexSubImage1DARB)
- GL_STUB_ALIAS(glCompressedTexSubImage2D, glCompressedTexSubImage2DARB)
- GL_STUB_ALIAS(glCompressedTexSubImage3D, glCompressedTexSubImage3DARB)
- GL_STUB_ALIAS(glGetCompressedTexImage, glGetCompressedTexImageARB)
- GL_STUB_ALIAS(glDisableVertexAttribArray, glDisableVertexAttribArrayARB)
- GL_STUB_ALIAS(glEnableVertexAttribArray, glEnableVertexAttribArrayARB)
- GL_STUB_ALIAS(glGetVertexAttribdv, glGetVertexAttribdvARB)
- GL_STUB_ALIAS(glGetVertexAttribfv, glGetVertexAttribfvARB)
- GL_STUB_ALIAS(glGetVertexAttribiv, glGetVertexAttribivARB)
- GL_STUB_ALIAS(glProgramParameter4dNV, glProgramEnvParameter4dARB)
- GL_STUB_ALIAS(glProgramParameter4dvNV, glProgramEnvParameter4dvARB)
- GL_STUB_ALIAS(glProgramParameter4fNV, glProgramEnvParameter4fARB)
- GL_STUB_ALIAS(glProgramParameter4fvNV, glProgramEnvParameter4fvARB)
- GL_STUB_ALIAS(glVertexAttrib1d, glVertexAttrib1dARB)
- GL_STUB_ALIAS(glVertexAttrib1dv, glVertexAttrib1dvARB)
- GL_STUB_ALIAS(glVertexAttrib1f, glVertexAttrib1fARB)
- GL_STUB_ALIAS(glVertexAttrib1fv, glVertexAttrib1fvARB)
- GL_STUB_ALIAS(glVertexAttrib1s, glVertexAttrib1sARB)
- GL_STUB_ALIAS(glVertexAttrib1sv, glVertexAttrib1svARB)
- GL_STUB_ALIAS(glVertexAttrib2d, glVertexAttrib2dARB)
- GL_STUB_ALIAS(glVertexAttrib2dv, glVertexAttrib2dvARB)
- GL_STUB_ALIAS(glVertexAttrib2f, glVertexAttrib2fARB)
- GL_STUB_ALIAS(glVertexAttrib2fv, glVertexAttrib2fvARB)
- GL_STUB_ALIAS(glVertexAttrib2s, glVertexAttrib2sARB)
- GL_STUB_ALIAS(glVertexAttrib2sv, glVertexAttrib2svARB)
- GL_STUB_ALIAS(glVertexAttrib3d, glVertexAttrib3dARB)
- GL_STUB_ALIAS(glVertexAttrib3dv, glVertexAttrib3dvARB)
- GL_STUB_ALIAS(glVertexAttrib3f, glVertexAttrib3fARB)
- GL_STUB_ALIAS(glVertexAttrib3fv, glVertexAttrib3fvARB)
- GL_STUB_ALIAS(glVertexAttrib3s, glVertexAttrib3sARB)
- GL_STUB_ALIAS(glVertexAttrib3sv, glVertexAttrib3svARB)
- GL_STUB_ALIAS(glVertexAttrib4Nbv, glVertexAttrib4NbvARB)
- GL_STUB_ALIAS(glVertexAttrib4Niv, glVertexAttrib4NivARB)
- GL_STUB_ALIAS(glVertexAttrib4Nsv, glVertexAttrib4NsvARB)
- GL_STUB_ALIAS(glVertexAttrib4Nub, glVertexAttrib4NubARB)
- GL_STUB_ALIAS(glVertexAttrib4Nubv, glVertexAttrib4NubvARB)
- GL_STUB_ALIAS(glVertexAttrib4Nuiv, glVertexAttrib4NuivARB)
- GL_STUB_ALIAS(glVertexAttrib4Nusv, glVertexAttrib4NusvARB)
- GL_STUB_ALIAS(glVertexAttrib4bv, glVertexAttrib4bvARB)
- GL_STUB_ALIAS(glVertexAttrib4d, glVertexAttrib4dARB)
- GL_STUB_ALIAS(glVertexAttrib4dv, glVertexAttrib4dvARB)
- GL_STUB_ALIAS(glVertexAttrib4f, glVertexAttrib4fARB)
- GL_STUB_ALIAS(glVertexAttrib4fv, glVertexAttrib4fvARB)
- GL_STUB_ALIAS(glVertexAttrib4iv, glVertexAttrib4ivARB)
- GL_STUB_ALIAS(glVertexAttrib4s, glVertexAttrib4sARB)
- GL_STUB_ALIAS(glVertexAttrib4sv, glVertexAttrib4svARB)
- GL_STUB_ALIAS(glVertexAttrib4ubv, glVertexAttrib4ubvARB)
- GL_STUB_ALIAS(glVertexAttrib4uiv, glVertexAttrib4uivARB)
- GL_STUB_ALIAS(glVertexAttrib4usv, glVertexAttrib4usvARB)
- GL_STUB_ALIAS(glVertexAttribPointer, glVertexAttribPointerARB)
- GL_STUB_ALIAS(glBindBuffer, glBindBufferARB)
- GL_STUB_ALIAS(glBufferData, glBufferDataARB)
- GL_STUB_ALIAS(glBufferSubData, glBufferSubDataARB)
- GL_STUB_ALIAS(glDeleteBuffers, glDeleteBuffersARB)
- GL_STUB_ALIAS(glGenBuffers, glGenBuffersARB)
- GL_STUB_ALIAS(glGetBufferParameteriv, glGetBufferParameterivARB)
- GL_STUB_ALIAS(glGetBufferPointerv, glGetBufferPointervARB)
- GL_STUB_ALIAS(glGetBufferSubData, glGetBufferSubDataARB)
- GL_STUB_ALIAS(glIsBuffer, glIsBufferARB)
- GL_STUB_ALIAS(glMapBuffer, glMapBufferARB)
- GL_STUB_ALIAS(glUnmapBuffer, glUnmapBufferARB)
- GL_STUB_ALIAS(glBeginQuery, glBeginQueryARB)
- GL_STUB_ALIAS(glDeleteQueries, glDeleteQueriesARB)
- GL_STUB_ALIAS(glEndQuery, glEndQueryARB)
- GL_STUB_ALIAS(glGenQueries, glGenQueriesARB)
- GL_STUB_ALIAS(glGetQueryObjectiv, glGetQueryObjectivARB)
- GL_STUB_ALIAS(glGetQueryObjectuiv, glGetQueryObjectuivARB)
- GL_STUB_ALIAS(glGetQueryiv, glGetQueryivARB)
- GL_STUB_ALIAS(glIsQuery, glIsQueryARB)
- GL_STUB_ALIAS(glCompileShader, glCompileShaderARB)
- GL_STUB_ALIAS(glGetActiveUniform, glGetActiveUniformARB)
- GL_STUB_ALIAS(glGetShaderSource, glGetShaderSourceARB)
- GL_STUB_ALIAS(glGetUniformLocation, glGetUniformLocationARB)
- GL_STUB_ALIAS(glGetUniformfv, glGetUniformfvARB)
- GL_STUB_ALIAS(glGetUniformiv, glGetUniformivARB)
- GL_STUB_ALIAS(glLinkProgram, glLinkProgramARB)
- GL_STUB_ALIAS(glShaderSource, glShaderSourceARB)
- GL_STUB_ALIAS(glUniform1f, glUniform1fARB)
- GL_STUB_ALIAS(glUniform1fv, glUniform1fvARB)
- GL_STUB_ALIAS(glUniform1i, glUniform1iARB)
- GL_STUB_ALIAS(glUniform1iv, glUniform1ivARB)
- GL_STUB_ALIAS(glUniform2f, glUniform2fARB)
- GL_STUB_ALIAS(glUniform2fv, glUniform2fvARB)
- GL_STUB_ALIAS(glUniform2i, glUniform2iARB)
- GL_STUB_ALIAS(glUniform2iv, glUniform2ivARB)
- GL_STUB_ALIAS(glUniform3f, glUniform3fARB)
- GL_STUB_ALIAS(glUniform3fv, glUniform3fvARB)
- GL_STUB_ALIAS(glUniform3i, glUniform3iARB)
- GL_STUB_ALIAS(glUniform3iv, glUniform3ivARB)
- GL_STUB_ALIAS(glUniform4f, glUniform4fARB)
- GL_STUB_ALIAS(glUniform4fv, glUniform4fvARB)
- GL_STUB_ALIAS(glUniform4i, glUniform4iARB)
- GL_STUB_ALIAS(glUniform4iv, glUniform4ivARB)
- GL_STUB_ALIAS(glUniformMatrix2fv, glUniformMatrix2fvARB)
- GL_STUB_ALIAS(glUniformMatrix3fv, glUniformMatrix3fvARB)
- GL_STUB_ALIAS(glUniformMatrix4fv, glUniformMatrix4fvARB)
- GL_STUB_ALIAS(glUseProgram, glUseProgramObjectARB)
- GL_STUB_ALIAS(glValidateProgram, glValidateProgramARB)
- GL_STUB_ALIAS(glBindAttribLocation, glBindAttribLocationARB)
- GL_STUB_ALIAS(glGetActiveAttrib, glGetActiveAttribARB)
- GL_STUB_ALIAS(glGetAttribLocation, glGetAttribLocationARB)
- GL_STUB_ALIAS(glDrawBuffers, glDrawBuffersARB)
- GL_STUB_ALIAS(glDrawBuffersATI, glDrawBuffersARB)
- GL_STUB_ALIAS(glDrawArraysInstancedEXT, glDrawArraysInstancedARB)
- GL_STUB_ALIAS(glDrawArraysInstanced, glDrawArraysInstancedARB)
- GL_STUB_ALIAS(glDrawElementsInstancedEXT, glDrawElementsInstancedARB)
- GL_STUB_ALIAS(glDrawElementsInstanced, glDrawElementsInstancedARB)
- GL_STUB_ALIAS(glRenderbufferStorageMultisampleEXT, glRenderbufferStorageMultisample)
- GL_STUB_ALIAS(glBlendEquationSeparateIndexedAMD, glBlendEquationSeparateiARB)
- GL_STUB_ALIAS(glBlendEquationIndexedAMD, glBlendEquationiARB)
- GL_STUB_ALIAS(glBlendFuncSeparateIndexedAMD, glBlendFuncSeparateiARB)
- GL_STUB_ALIAS(glBlendFuncIndexedAMD, glBlendFunciARB)
- GL_STUB_ALIAS(glPointParameterf, glPointParameterfEXT)
- GL_STUB_ALIAS(glPointParameterfARB, glPointParameterfEXT)
- GL_STUB_ALIAS(glPointParameterfSGIS, glPointParameterfEXT)
- GL_STUB_ALIAS(glPointParameterfv, glPointParameterfvEXT)
- GL_STUB_ALIAS(glPointParameterfvARB, glPointParameterfvEXT)
- GL_STUB_ALIAS(glPointParameterfvSGIS, glPointParameterfvEXT)
- GL_STUB_ALIAS(glSecondaryColor3b, glSecondaryColor3bEXT)
- GL_STUB_ALIAS(glSecondaryColor3bv, glSecondaryColor3bvEXT)
- GL_STUB_ALIAS(glSecondaryColor3d, glSecondaryColor3dEXT)
- GL_STUB_ALIAS(glSecondaryColor3dv, glSecondaryColor3dvEXT)
- GL_STUB_ALIAS(glSecondaryColor3f, glSecondaryColor3fEXT)
- GL_STUB_ALIAS(glSecondaryColor3fv, glSecondaryColor3fvEXT)
- GL_STUB_ALIAS(glSecondaryColor3i, glSecondaryColor3iEXT)
- GL_STUB_ALIAS(glSecondaryColor3iv, glSecondaryColor3ivEXT)
- GL_STUB_ALIAS(glSecondaryColor3s, glSecondaryColor3sEXT)
- GL_STUB_ALIAS(glSecondaryColor3sv, glSecondaryColor3svEXT)
- GL_STUB_ALIAS(glSecondaryColor3ub, glSecondaryColor3ubEXT)
- GL_STUB_ALIAS(glSecondaryColor3ubv, glSecondaryColor3ubvEXT)
- GL_STUB_ALIAS(glSecondaryColor3ui, glSecondaryColor3uiEXT)
- GL_STUB_ALIAS(glSecondaryColor3uiv, glSecondaryColor3uivEXT)
- GL_STUB_ALIAS(glSecondaryColor3us, glSecondaryColor3usEXT)
- GL_STUB_ALIAS(glSecondaryColor3usv, glSecondaryColor3usvEXT)
- GL_STUB_ALIAS(glSecondaryColorPointer, glSecondaryColorPointerEXT)
- GL_STUB_ALIAS(glMultiDrawArrays, glMultiDrawArraysEXT)
- GL_STUB_ALIAS(glMultiDrawElements, glMultiDrawElementsEXT)
- GL_STUB_ALIAS(glFogCoordPointer, glFogCoordPointerEXT)
- GL_STUB_ALIAS(glFogCoordd, glFogCoorddEXT)
- GL_STUB_ALIAS(glFogCoorddv, glFogCoorddvEXT)
- GL_STUB_ALIAS(glFogCoordf, glFogCoordfEXT)
- GL_STUB_ALIAS(glFogCoordfv, glFogCoordfvEXT)
- GL_STUB_ALIAS(glBlendFuncSeparate, glBlendFuncSeparateEXT)
- GL_STUB_ALIAS(glBlendFuncSeparateINGR, glBlendFuncSeparateEXT)
- GL_STUB_ALIAS(glWindowPos2d, glWindowPos2dMESA)
- GL_STUB_ALIAS(glWindowPos2dARB, glWindowPos2dMESA)
- GL_STUB_ALIAS(glWindowPos2dv, glWindowPos2dvMESA)
- GL_STUB_ALIAS(glWindowPos2dvARB, glWindowPos2dvMESA)
- GL_STUB_ALIAS(glWindowPos2f, glWindowPos2fMESA)
- GL_STUB_ALIAS(glWindowPos2fARB, glWindowPos2fMESA)
- GL_STUB_ALIAS(glWindowPos2fv, glWindowPos2fvMESA)
- GL_STUB_ALIAS(glWindowPos2fvARB, glWindowPos2fvMESA)
- GL_STUB_ALIAS(glWindowPos2i, glWindowPos2iMESA)
- GL_STUB_ALIAS(glWindowPos2iARB, glWindowPos2iMESA)
- GL_STUB_ALIAS(glWindowPos2iv, glWindowPos2ivMESA)
- GL_STUB_ALIAS(glWindowPos2ivARB, glWindowPos2ivMESA)
- GL_STUB_ALIAS(glWindowPos2s, glWindowPos2sMESA)
- GL_STUB_ALIAS(glWindowPos2sARB, glWindowPos2sMESA)
- GL_STUB_ALIAS(glWindowPos2sv, glWindowPos2svMESA)
- GL_STUB_ALIAS(glWindowPos2svARB, glWindowPos2svMESA)
- GL_STUB_ALIAS(glWindowPos3d, glWindowPos3dMESA)
- GL_STUB_ALIAS(glWindowPos3dARB, glWindowPos3dMESA)
- GL_STUB_ALIAS(glWindowPos3dv, glWindowPos3dvMESA)
- GL_STUB_ALIAS(glWindowPos3dvARB, glWindowPos3dvMESA)
- GL_STUB_ALIAS(glWindowPos3f, glWindowPos3fMESA)
- GL_STUB_ALIAS(glWindowPos3fARB, glWindowPos3fMESA)
- GL_STUB_ALIAS(glWindowPos3fv, glWindowPos3fvMESA)
- GL_STUB_ALIAS(glWindowPos3fvARB, glWindowPos3fvMESA)
- GL_STUB_ALIAS(glWindowPos3i, glWindowPos3iMESA)
- GL_STUB_ALIAS(glWindowPos3iARB, glWindowPos3iMESA)
- GL_STUB_ALIAS(glWindowPos3iv, glWindowPos3ivMESA)
- GL_STUB_ALIAS(glWindowPos3ivARB, glWindowPos3ivMESA)
- GL_STUB_ALIAS(glWindowPos3s, glWindowPos3sMESA)
- GL_STUB_ALIAS(glWindowPos3sARB, glWindowPos3sMESA)
- GL_STUB_ALIAS(glWindowPos3sv, glWindowPos3svMESA)
- GL_STUB_ALIAS(glWindowPos3svARB, glWindowPos3svMESA)
- GL_STUB_ALIAS(glBindProgramARB, glBindProgramNV)
- GL_STUB_ALIAS(glDeleteProgramsARB, glDeleteProgramsNV)
- GL_STUB_ALIAS(glGenProgramsARB, glGenProgramsNV)
- GL_STUB_ALIAS(glGetVertexAttribPointerv, glGetVertexAttribPointervNV)
- GL_STUB_ALIAS(glGetVertexAttribPointervARB, glGetVertexAttribPointervNV)
- GL_STUB_ALIAS(glIsProgramARB, glIsProgramNV)
- GL_STUB_ALIAS(glPointParameteri, glPointParameteriNV)
- GL_STUB_ALIAS(glPointParameteriv, glPointParameterivNV)
- GL_STUB_ALIAS(glPrimitiveRestartIndex, glPrimitiveRestartIndexNV)
- GL_STUB_ALIAS(glBindFramebuffer, glBindFramebufferEXT)
- GL_STUB_ALIAS(glBindRenderbuffer, glBindRenderbufferEXT)
- GL_STUB_ALIAS(glCheckFramebufferStatus, glCheckFramebufferStatusEXT)
- GL_STUB_ALIAS(glDeleteFramebuffers, glDeleteFramebuffersEXT)
- GL_STUB_ALIAS(glDeleteRenderbuffers, glDeleteRenderbuffersEXT)
- GL_STUB_ALIAS(glFramebufferRenderbuffer, glFramebufferRenderbufferEXT)
- GL_STUB_ALIAS(glFramebufferTexture1D, glFramebufferTexture1DEXT)
- GL_STUB_ALIAS(glFramebufferTexture2D, glFramebufferTexture2DEXT)
- GL_STUB_ALIAS(glFramebufferTexture3D, glFramebufferTexture3DEXT)
- GL_STUB_ALIAS(glGenFramebuffers, glGenFramebuffersEXT)
- GL_STUB_ALIAS(glGenRenderbuffers, glGenRenderbuffersEXT)
- GL_STUB_ALIAS(glGenerateMipmap, glGenerateMipmapEXT)
- GL_STUB_ALIAS(glGetFramebufferAttachmentParameteriv, glGetFramebufferAttachmentParameterivEXT)
- GL_STUB_ALIAS(glGetRenderbufferParameteriv, glGetRenderbufferParameterivEXT)
- GL_STUB_ALIAS(glIsFramebuffer, glIsFramebufferEXT)
- GL_STUB_ALIAS(glIsRenderbuffer, glIsRenderbufferEXT)
- GL_STUB_ALIAS(glRenderbufferStorage, glRenderbufferStorageEXT)
- GL_STUB_ALIAS(glBindFragDataLocation, glBindFragDataLocationEXT)
- GL_STUB_ALIAS(glGetFragDataLocation, glGetFragDataLocationEXT)
- GL_STUB_ALIAS(glGetUniformuiv, glGetUniformuivEXT)
- GL_STUB_ALIAS(glGetVertexAttribIiv, glGetVertexAttribIivEXT)
- GL_STUB_ALIAS(glGetVertexAttribIuiv, glGetVertexAttribIuivEXT)
- GL_STUB_ALIAS(glUniform1ui, glUniform1uiEXT)
- GL_STUB_ALIAS(glUniform1uiv, glUniform1uivEXT)
- GL_STUB_ALIAS(glUniform2ui, glUniform2uiEXT)
- GL_STUB_ALIAS(glUniform2uiv, glUniform2uivEXT)
- GL_STUB_ALIAS(glUniform3ui, glUniform3uiEXT)
- GL_STUB_ALIAS(glUniform3uiv, glUniform3uivEXT)
- GL_STUB_ALIAS(glUniform4ui, glUniform4uiEXT)
- GL_STUB_ALIAS(glUniform4uiv, glUniform4uivEXT)
- GL_STUB_ALIAS(glVertexAttribI1i, glVertexAttribI1iEXT)
- GL_STUB_ALIAS(glVertexAttribI1iv, glVertexAttribI1ivEXT)
- GL_STUB_ALIAS(glVertexAttribI1ui, glVertexAttribI1uiEXT)
- GL_STUB_ALIAS(glVertexAttribI1uiv, glVertexAttribI1uivEXT)
- GL_STUB_ALIAS(glVertexAttribI2i, glVertexAttribI2iEXT)
- GL_STUB_ALIAS(glVertexAttribI2iv, glVertexAttribI2ivEXT)
- GL_STUB_ALIAS(glVertexAttribI2ui, glVertexAttribI2uiEXT)
- GL_STUB_ALIAS(glVertexAttribI2uiv, glVertexAttribI2uivEXT)
- GL_STUB_ALIAS(glVertexAttribI3i, glVertexAttribI3iEXT)
- GL_STUB_ALIAS(glVertexAttribI3iv, glVertexAttribI3ivEXT)
- GL_STUB_ALIAS(glVertexAttribI3ui, glVertexAttribI3uiEXT)
- GL_STUB_ALIAS(glVertexAttribI3uiv, glVertexAttribI3uivEXT)
- GL_STUB_ALIAS(glVertexAttribI4bv, glVertexAttribI4bvEXT)
- GL_STUB_ALIAS(glVertexAttribI4i, glVertexAttribI4iEXT)
- GL_STUB_ALIAS(glVertexAttribI4iv, glVertexAttribI4ivEXT)
- GL_STUB_ALIAS(glVertexAttribI4sv, glVertexAttribI4svEXT)
- GL_STUB_ALIAS(glVertexAttribI4ubv, glVertexAttribI4ubvEXT)
- GL_STUB_ALIAS(glVertexAttribI4ui, glVertexAttribI4uiEXT)
- GL_STUB_ALIAS(glVertexAttribI4uiv, glVertexAttribI4uivEXT)
- GL_STUB_ALIAS(glVertexAttribI4usv, glVertexAttribI4usvEXT)
- GL_STUB_ALIAS(glVertexAttribIPointer, glVertexAttribIPointerEXT)
- GL_STUB_ALIAS(glFramebufferTextureLayer, glFramebufferTextureLayerEXT)
- GL_STUB_ALIAS(glColorMaski, glColorMaskIndexedEXT)
- GL_STUB_ALIAS(glDisablei, glDisableIndexedEXT)
- GL_STUB_ALIAS(glEnablei, glEnableIndexedEXT)
- GL_STUB_ALIAS(glGetBooleani_v, glGetBooleanIndexedvEXT)
- GL_STUB_ALIAS(glGetIntegeri_v, glGetIntegerIndexedvEXT)
- GL_STUB_ALIAS(glIsEnabledi, glIsEnabledIndexedEXT)
- GL_STUB_ALIAS(glGetTexParameterIiv, glGetTexParameterIivEXT)
- GL_STUB_ALIAS(glGetTexParameterIuiv, glGetTexParameterIuivEXT)
- GL_STUB_ALIAS(glTexParameterIiv, glTexParameterIivEXT)
- GL_STUB_ALIAS(glTexParameterIuiv, glTexParameterIuivEXT)
- GL_STUB_ALIAS(glBeginConditionalRender, glBeginConditionalRenderNV)
- GL_STUB_ALIAS(glEndConditionalRender, glEndConditionalRenderNV)
- GL_STUB_ALIAS(glBeginTransformFeedback, glBeginTransformFeedbackEXT)
- GL_STUB_ALIAS(glBindBufferBase, glBindBufferBaseEXT)
- GL_STUB_ALIAS(glBindBufferRange, glBindBufferRangeEXT)
- GL_STUB_ALIAS(glEndTransformFeedback, glEndTransformFeedbackEXT)
- GL_STUB_ALIAS(glGetTransformFeedbackVarying, glGetTransformFeedbackVaryingEXT)
- GL_STUB_ALIAS(glTransformFeedbackVaryings, glTransformFeedbackVaryingsEXT)
- GL_STUB_ALIAS(glProvokingVertex, glProvokingVertexEXT)
-
- .globl gl_dispatch_functions_end
- HIDDEN(gl_dispatch_functions_end)
-gl_dispatch_functions_end:
+/* DO NOT EDIT - This file generated automatically by gl_SPARC_asm.py (from Mesa) script */
+
+/*
+ * Copyright (C) 1999-2003 Brian Paul All Rights Reserved.
+ * (C) Copyright IBM Corporation 2004
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sub license,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL, IBM,
+ * AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
+ * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+#ifdef __arch64__
+#define GL_OFF(N) ((N) * 8)
+#define GL_LL ldx
+#define GL_TIE_LD(SYM) %tie_ldx(SYM)
+#define GL_STACK_SIZE 128
+#else
+#define GL_OFF(N) ((N) * 4)
+#define GL_LL ld
+#define GL_TIE_LD(SYM) %tie_ld(SYM)
+#define GL_STACK_SIZE 64
+#endif
+
+#define GLOBL_FN(x) .globl x ; .type x, @function
+#define HIDDEN(x) .hidden x
+
+ .register %g2, #scratch
+ .register %g3, #scratch
+
+ .text
+
+ GLOBL_FN(__glapi_sparc_icache_flush)
+ HIDDEN(__glapi_sparc_icache_flush)
+ .type __glapi_sparc_icache_flush, @function
+__glapi_sparc_icache_flush: /* %o0 = insn_addr */
+ flush %o0
+ retl
+ nop
+
+ .align 32
+
+ .type __glapi_sparc_get_pc, @function
+__glapi_sparc_get_pc:
+ retl
+ add %o7, %g2, %g2
+ .size __glapi_sparc_get_pc, .-__glapi_sparc_get_pc
+
+#ifdef GLX_USE_TLS
+
+ GLOBL_FN(__glapi_sparc_get_dispatch)
+ HIDDEN(__glapi_sparc_get_dispatch)
+__glapi_sparc_get_dispatch:
+ mov %o7, %g1
+ sethi %hi(_GLOBAL_OFFSET_TABLE_-4), %g2
+ call __glapi_sparc_get_pc
+ add %g2, %lo(_GLOBAL_OFFSET_TABLE_+4), %g2
+ mov %g1, %o7
+ sethi %tie_hi22(_glapi_tls_Dispatch), %g1
+ add %g1, %tie_lo10(_glapi_tls_Dispatch), %g1
+ GL_LL [%g2 + %g1], %g2, GL_TIE_LD(_glapi_tls_Dispatch)
+ retl
+ mov %g2, %o0
+
+ .data
+ .align 32
+
+ /* --> sethi %hi(_glapi_tls_Dispatch), %g1 */
+ /* --> or %g1, %lo(_glapi_tls_Dispatch), %g1 */
+ GLOBL_FN(__glapi_sparc_tls_stub)
+ HIDDEN(__glapi_sparc_tls_stub)
+__glapi_sparc_tls_stub: /* Call offset in %g3 */
+ mov %o7, %g1
+ sethi %hi(_GLOBAL_OFFSET_TABLE_-4), %g2
+ call __glapi_sparc_get_pc
+ add %g2, %lo(_GLOBAL_OFFSET_TABLE_+4), %g2
+ mov %g1, %o7
+ srl %g3, 10, %g3
+ sethi %tie_hi22(_glapi_tls_Dispatch), %g1
+ add %g1, %tie_lo10(_glapi_tls_Dispatch), %g1
+ GL_LL [%g2 + %g1], %g2, GL_TIE_LD(_glapi_tls_Dispatch)
+ GL_LL [%g7+%g2], %g1
+ GL_LL [%g1 + %g3], %g1
+ jmp %g1
+ nop
+ .size __glapi_sparc_tls_stub, .-__glapi_sparc_tls_stub
+
+#define GL_STUB(fn, off) \
+ GLOBL_FN(fn); \
+fn: ba __glapi_sparc_tls_stub; \
+ sethi GL_OFF(off), %g3; \
+ .size fn,.-fn;
+
+#elif defined(PTHREADS)
+
+ /* 64-bit 0x00 --> sethi %hh(_glapi_Dispatch), %g1 */
+ /* 64-bit 0x04 --> sethi %lm(_glapi_Dispatch), %g2 */
+ /* 64-bit 0x08 --> or %g1, %hm(_glapi_Dispatch), %g1 */
+ /* 64-bit 0x0c --> sllx %g1, 32, %g1 */
+ /* 64-bit 0x10 --> add %g1, %g2, %g1 */
+ /* 64-bit 0x14 --> ldx [%g1 + %lo(_glapi_Dispatch)], %g1 */
+
+ /* 32-bit 0x00 --> sethi %hi(_glapi_Dispatch), %g1 */
+ /* 32-bit 0x04 --> ld [%g1 + %lo(_glapi_Dispatch)], %g1 */
+
+ .data
+ .align 32
+
+ GLOBL_FN(__glapi_sparc_pthread_stub)
+ HIDDEN(__glapi_sparc_pthread_stub)
+__glapi_sparc_pthread_stub: /* Call offset in %g3 */
+ mov %o7, %g1
+ sethi %hi(_GLOBAL_OFFSET_TABLE_-4), %g2
+ call __glapi_sparc_get_pc
+ add %g2, %lo(_GLOBAL_OFFSET_TABLE_+4), %g2
+ mov %g1, %o7
+ sethi %hi(_glapi_Dispatch), %g1
+ or %g1, %lo(_glapi_Dispatch), %g1
+ srl %g3, 10, %g3
+ GL_LL [%g2+%g1], %g2
+ GL_LL [%g2], %g1
+ cmp %g1, 0
+ be 2f
+ nop
+1: GL_LL [%g1 + %g3], %g1
+ jmp %g1
+ nop
+2: save %sp, GL_STACK_SIZE, %sp
+ mov %g3, %l0
+ call _glapi_get_dispatch
+ nop
+ mov %o0, %g1
+ mov %l0, %g3
+ ba 1b
+ restore %g0, %g0, %g0
+ .size __glapi_sparc_pthread_stub, .-__glapi_sparc_pthread_stub
+
+#define GL_STUB(fn, off) \
+ GLOBL_FN(fn); \
+fn: ba __glapi_sparc_pthread_stub; \
+ sethi GL_OFF(off), %g3; \
+ .size fn,.-fn;
+
+#else /* Non-threaded version. */
+
+ .type __glapi_sparc_nothread_stub, @function
+__glapi_sparc_nothread_stub: /* Call offset in %g3 */
+ mov %o7, %g1
+ sethi %hi(_GLOBAL_OFFSET_TABLE_-4), %g2
+ call __glapi_sparc_get_pc
+ add %g2, %lo(_GLOBAL_OFFSET_TABLE_+4), %g2
+ mov %g1, %o7
+ srl %g3, 10, %g3
+ sethi %hi(_glapi_Dispatch), %g1
+ or %g1, %lo(_glapi_Dispatch), %g1
+ GL_LL [%g2+%g1], %g2
+ GL_LL [%g2], %g1
+ GL_LL [%g1 + %g3], %g1
+ jmp %g1
+ nop
+ .size __glapi_sparc_nothread_stub, .-__glapi_sparc_nothread_stub
+
+#define GL_STUB(fn, off) \
+ GLOBL_FN(fn); \
+fn: ba __glapi_sparc_nothread_stub; \
+ sethi GL_OFF(off), %g3; \
+ .size fn,.-fn;
+
+#endif
+
+#define GL_STUB_ALIAS(fn, alias) \
+ .globl fn; \
+ .set fn, alias
+
+ .text
+ .align 32
+
+ .globl gl_dispatch_functions_start
+ HIDDEN(gl_dispatch_functions_start)
+gl_dispatch_functions_start:
+
+ GL_STUB(glNewList, 0)
+ GL_STUB(glEndList, 1)
+ GL_STUB(glCallList, 2)
+ GL_STUB(glCallLists, 3)
+ GL_STUB(glDeleteLists, 4)
+ GL_STUB(glGenLists, 5)
+ GL_STUB(glListBase, 6)
+ GL_STUB(glBegin, 7)
+ GL_STUB(glBitmap, 8)
+ GL_STUB(glColor3b, 9)
+ GL_STUB(glColor3bv, 10)
+ GL_STUB(glColor3d, 11)
+ GL_STUB(glColor3dv, 12)
+ GL_STUB(glColor3f, 13)
+ GL_STUB(glColor3fv, 14)
+ GL_STUB(glColor3i, 15)
+ GL_STUB(glColor3iv, 16)
+ GL_STUB(glColor3s, 17)
+ GL_STUB(glColor3sv, 18)
+ GL_STUB(glColor3ub, 19)
+ GL_STUB(glColor3ubv, 20)
+ GL_STUB(glColor3ui, 21)
+ GL_STUB(glColor3uiv, 22)
+ GL_STUB(glColor3us, 23)
+ GL_STUB(glColor3usv, 24)
+ GL_STUB(glColor4b, 25)
+ GL_STUB(glColor4bv, 26)
+ GL_STUB(glColor4d, 27)
+ GL_STUB(glColor4dv, 28)
+ GL_STUB(glColor4f, 29)
+ GL_STUB(glColor4fv, 30)
+ GL_STUB(glColor4i, 31)
+ GL_STUB(glColor4iv, 32)
+ GL_STUB(glColor4s, 33)
+ GL_STUB(glColor4sv, 34)
+ GL_STUB(glColor4ub, 35)
+ GL_STUB(glColor4ubv, 36)
+ GL_STUB(glColor4ui, 37)
+ GL_STUB(glColor4uiv, 38)
+ GL_STUB(glColor4us, 39)
+ GL_STUB(glColor4usv, 40)
+ GL_STUB(glEdgeFlag, 41)
+ GL_STUB(glEdgeFlagv, 42)
+ GL_STUB(glEnd, 43)
+ GL_STUB(glIndexd, 44)
+ GL_STUB(glIndexdv, 45)
+ GL_STUB(glIndexf, 46)
+ GL_STUB(glIndexfv, 47)
+ GL_STUB(glIndexi, 48)
+ GL_STUB(glIndexiv, 49)
+ GL_STUB(glIndexs, 50)
+ GL_STUB(glIndexsv, 51)
+ GL_STUB(glNormal3b, 52)
+ GL_STUB(glNormal3bv, 53)
+ GL_STUB(glNormal3d, 54)
+ GL_STUB(glNormal3dv, 55)
+ GL_STUB(glNormal3f, 56)
+ GL_STUB(glNormal3fv, 57)
+ GL_STUB(glNormal3i, 58)
+ GL_STUB(glNormal3iv, 59)
+ GL_STUB(glNormal3s, 60)
+ GL_STUB(glNormal3sv, 61)
+ GL_STUB(glRasterPos2d, 62)
+ GL_STUB(glRasterPos2dv, 63)
+ GL_STUB(glRasterPos2f, 64)
+ GL_STUB(glRasterPos2fv, 65)
+ GL_STUB(glRasterPos2i, 66)
+ GL_STUB(glRasterPos2iv, 67)
+ GL_STUB(glRasterPos2s, 68)
+ GL_STUB(glRasterPos2sv, 69)
+ GL_STUB(glRasterPos3d, 70)
+ GL_STUB(glRasterPos3dv, 71)
+ GL_STUB(glRasterPos3f, 72)
+ GL_STUB(glRasterPos3fv, 73)
+ GL_STUB(glRasterPos3i, 74)
+ GL_STUB(glRasterPos3iv, 75)
+ GL_STUB(glRasterPos3s, 76)
+ GL_STUB(glRasterPos3sv, 77)
+ GL_STUB(glRasterPos4d, 78)
+ GL_STUB(glRasterPos4dv, 79)
+ GL_STUB(glRasterPos4f, 80)
+ GL_STUB(glRasterPos4fv, 81)
+ GL_STUB(glRasterPos4i, 82)
+ GL_STUB(glRasterPos4iv, 83)
+ GL_STUB(glRasterPos4s, 84)
+ GL_STUB(glRasterPos4sv, 85)
+ GL_STUB(glRectd, 86)
+ GL_STUB(glRectdv, 87)
+ GL_STUB(glRectf, 88)
+ GL_STUB(glRectfv, 89)
+ GL_STUB(glRecti, 90)
+ GL_STUB(glRectiv, 91)
+ GL_STUB(glRects, 92)
+ GL_STUB(glRectsv, 93)
+ GL_STUB(glTexCoord1d, 94)
+ GL_STUB(glTexCoord1dv, 95)
+ GL_STUB(glTexCoord1f, 96)
+ GL_STUB(glTexCoord1fv, 97)
+ GL_STUB(glTexCoord1i, 98)
+ GL_STUB(glTexCoord1iv, 99)
+ GL_STUB(glTexCoord1s, 100)
+ GL_STUB(glTexCoord1sv, 101)
+ GL_STUB(glTexCoord2d, 102)
+ GL_STUB(glTexCoord2dv, 103)
+ GL_STUB(glTexCoord2f, 104)
+ GL_STUB(glTexCoord2fv, 105)
+ GL_STUB(glTexCoord2i, 106)
+ GL_STUB(glTexCoord2iv, 107)
+ GL_STUB(glTexCoord2s, 108)
+ GL_STUB(glTexCoord2sv, 109)
+ GL_STUB(glTexCoord3d, 110)
+ GL_STUB(glTexCoord3dv, 111)
+ GL_STUB(glTexCoord3f, 112)
+ GL_STUB(glTexCoord3fv, 113)
+ GL_STUB(glTexCoord3i, 114)
+ GL_STUB(glTexCoord3iv, 115)
+ GL_STUB(glTexCoord3s, 116)
+ GL_STUB(glTexCoord3sv, 117)
+ GL_STUB(glTexCoord4d, 118)
+ GL_STUB(glTexCoord4dv, 119)
+ GL_STUB(glTexCoord4f, 120)
+ GL_STUB(glTexCoord4fv, 121)
+ GL_STUB(glTexCoord4i, 122)
+ GL_STUB(glTexCoord4iv, 123)
+ GL_STUB(glTexCoord4s, 124)
+ GL_STUB(glTexCoord4sv, 125)
+ GL_STUB(glVertex2d, 126)
+ GL_STUB(glVertex2dv, 127)
+ GL_STUB(glVertex2f, 128)
+ GL_STUB(glVertex2fv, 129)
+ GL_STUB(glVertex2i, 130)
+ GL_STUB(glVertex2iv, 131)
+ GL_STUB(glVertex2s, 132)
+ GL_STUB(glVertex2sv, 133)
+ GL_STUB(glVertex3d, 134)
+ GL_STUB(glVertex3dv, 135)
+ GL_STUB(glVertex3f, 136)
+ GL_STUB(glVertex3fv, 137)
+ GL_STUB(glVertex3i, 138)
+ GL_STUB(glVertex3iv, 139)
+ GL_STUB(glVertex3s, 140)
+ GL_STUB(glVertex3sv, 141)
+ GL_STUB(glVertex4d, 142)
+ GL_STUB(glVertex4dv, 143)
+ GL_STUB(glVertex4f, 144)
+ GL_STUB(glVertex4fv, 145)
+ GL_STUB(glVertex4i, 146)
+ GL_STUB(glVertex4iv, 147)
+ GL_STUB(glVertex4s, 148)
+ GL_STUB(glVertex4sv, 149)
+ GL_STUB(glClipPlane, 150)
+ GL_STUB(glColorMaterial, 151)
+ GL_STUB(glCullFace, 152)
+ GL_STUB(glFogf, 153)
+ GL_STUB(glFogfv, 154)
+ GL_STUB(glFogi, 155)
+ GL_STUB(glFogiv, 156)
+ GL_STUB(glFrontFace, 157)
+ GL_STUB(glHint, 158)
+ GL_STUB(glLightf, 159)
+ GL_STUB(glLightfv, 160)
+ GL_STUB(glLighti, 161)
+ GL_STUB(glLightiv, 162)
+ GL_STUB(glLightModelf, 163)
+ GL_STUB(glLightModelfv, 164)
+ GL_STUB(glLightModeli, 165)
+ GL_STUB(glLightModeliv, 166)
+ GL_STUB(glLineStipple, 167)
+ GL_STUB(glLineWidth, 168)
+ GL_STUB(glMaterialf, 169)
+ GL_STUB(glMaterialfv, 170)
+ GL_STUB(glMateriali, 171)
+ GL_STUB(glMaterialiv, 172)
+ GL_STUB(glPointSize, 173)
+ GL_STUB(glPolygonMode, 174)
+ GL_STUB(glPolygonStipple, 175)
+ GL_STUB(glScissor, 176)
+ GL_STUB(glShadeModel, 177)
+ GL_STUB(glTexParameterf, 178)
+ GL_STUB(glTexParameterfv, 179)
+ GL_STUB(glTexParameteri, 180)
+ GL_STUB(glTexParameteriv, 181)
+ GL_STUB(glTexImage1D, 182)
+ GL_STUB(glTexImage2D, 183)
+ GL_STUB(glTexEnvf, 184)
+ GL_STUB(glTexEnvfv, 185)
+ GL_STUB(glTexEnvi, 186)
+ GL_STUB(glTexEnviv, 187)
+ GL_STUB(glTexGend, 188)
+ GL_STUB(glTexGendv, 189)
+ GL_STUB(glTexGenf, 190)
+ GL_STUB(glTexGenfv, 191)
+ GL_STUB(glTexGeni, 192)
+ GL_STUB(glTexGeniv, 193)
+ GL_STUB(glFeedbackBuffer, 194)
+ GL_STUB(glSelectBuffer, 195)
+ GL_STUB(glRenderMode, 196)
+ GL_STUB(glInitNames, 197)
+ GL_STUB(glLoadName, 198)
+ GL_STUB(glPassThrough, 199)
+ GL_STUB(glPopName, 200)
+ GL_STUB(glPushName, 201)
+ GL_STUB(glDrawBuffer, 202)
+ GL_STUB(glClear, 203)
+ GL_STUB(glClearAccum, 204)
+ GL_STUB(glClearIndex, 205)
+ GL_STUB(glClearColor, 206)
+ GL_STUB(glClearStencil, 207)
+ GL_STUB(glClearDepth, 208)
+ GL_STUB(glStencilMask, 209)
+ GL_STUB(glColorMask, 210)
+ GL_STUB(glDepthMask, 211)
+ GL_STUB(glIndexMask, 212)
+ GL_STUB(glAccum, 213)
+ GL_STUB(glDisable, 214)
+ GL_STUB(glEnable, 215)
+ GL_STUB(glFinish, 216)
+ GL_STUB(glFlush, 217)
+ GL_STUB(glPopAttrib, 218)
+ GL_STUB(glPushAttrib, 219)
+ GL_STUB(glMap1d, 220)
+ GL_STUB(glMap1f, 221)
+ GL_STUB(glMap2d, 222)
+ GL_STUB(glMap2f, 223)
+ GL_STUB(glMapGrid1d, 224)
+ GL_STUB(glMapGrid1f, 225)
+ GL_STUB(glMapGrid2d, 226)
+ GL_STUB(glMapGrid2f, 227)
+ GL_STUB(glEvalCoord1d, 228)
+ GL_STUB(glEvalCoord1dv, 229)
+ GL_STUB(glEvalCoord1f, 230)
+ GL_STUB(glEvalCoord1fv, 231)
+ GL_STUB(glEvalCoord2d, 232)
+ GL_STUB(glEvalCoord2dv, 233)
+ GL_STUB(glEvalCoord2f, 234)
+ GL_STUB(glEvalCoord2fv, 235)
+ GL_STUB(glEvalMesh1, 236)
+ GL_STUB(glEvalPoint1, 237)
+ GL_STUB(glEvalMesh2, 238)
+ GL_STUB(glEvalPoint2, 239)
+ GL_STUB(glAlphaFunc, 240)
+ GL_STUB(glBlendFunc, 241)
+ GL_STUB(glLogicOp, 242)
+ GL_STUB(glStencilFunc, 243)
+ GL_STUB(glStencilOp, 244)
+ GL_STUB(glDepthFunc, 245)
+ GL_STUB(glPixelZoom, 246)
+ GL_STUB(glPixelTransferf, 247)
+ GL_STUB(glPixelTransferi, 248)
+ GL_STUB(glPixelStoref, 249)
+ GL_STUB(glPixelStorei, 250)
+ GL_STUB(glPixelMapfv, 251)
+ GL_STUB(glPixelMapuiv, 252)
+ GL_STUB(glPixelMapusv, 253)
+ GL_STUB(glReadBuffer, 254)
+ GL_STUB(glCopyPixels, 255)
+ GL_STUB(glReadPixels, 256)
+ GL_STUB(glDrawPixels, 257)
+ GL_STUB(glGetBooleanv, 258)
+ GL_STUB(glGetClipPlane, 259)
+ GL_STUB(glGetDoublev, 260)
+ GL_STUB(glGetError, 261)
+ GL_STUB(glGetFloatv, 262)
+ GL_STUB(glGetIntegerv, 263)
+ GL_STUB(glGetLightfv, 264)
+ GL_STUB(glGetLightiv, 265)
+ GL_STUB(glGetMapdv, 266)
+ GL_STUB(glGetMapfv, 267)
+ GL_STUB(glGetMapiv, 268)
+ GL_STUB(glGetMaterialfv, 269)
+ GL_STUB(glGetMaterialiv, 270)
+ GL_STUB(glGetPixelMapfv, 271)
+ GL_STUB(glGetPixelMapuiv, 272)
+ GL_STUB(glGetPixelMapusv, 273)
+ GL_STUB(glGetPolygonStipple, 274)
+ GL_STUB(glGetString, 275)
+ GL_STUB(glGetTexEnvfv, 276)
+ GL_STUB(glGetTexEnviv, 277)
+ GL_STUB(glGetTexGendv, 278)
+ GL_STUB(glGetTexGenfv, 279)
+ GL_STUB(glGetTexGeniv, 280)
+ GL_STUB(glGetTexImage, 281)
+ GL_STUB(glGetTexParameterfv, 282)
+ GL_STUB(glGetTexParameteriv, 283)
+ GL_STUB(glGetTexLevelParameterfv, 284)
+ GL_STUB(glGetTexLevelParameteriv, 285)
+ GL_STUB(glIsEnabled, 286)
+ GL_STUB(glIsList, 287)
+ GL_STUB(glDepthRange, 288)
+ GL_STUB(glFrustum, 289)
+ GL_STUB(glLoadIdentity, 290)
+ GL_STUB(glLoadMatrixf, 291)
+ GL_STUB(glLoadMatrixd, 292)
+ GL_STUB(glMatrixMode, 293)
+ GL_STUB(glMultMatrixf, 294)
+ GL_STUB(glMultMatrixd, 295)
+ GL_STUB(glOrtho, 296)
+ GL_STUB(glPopMatrix, 297)
+ GL_STUB(glPushMatrix, 298)
+ GL_STUB(glRotated, 299)
+ GL_STUB(glRotatef, 300)
+ GL_STUB(glScaled, 301)
+ GL_STUB(glScalef, 302)
+ GL_STUB(glTranslated, 303)
+ GL_STUB(glTranslatef, 304)
+ GL_STUB(glViewport, 305)
+ GL_STUB(glArrayElement, 306)
+ GL_STUB(glBindTexture, 307)
+ GL_STUB(glColorPointer, 308)
+ GL_STUB(glDisableClientState, 309)
+ GL_STUB(glDrawArrays, 310)
+ GL_STUB(glDrawElements, 311)
+ GL_STUB(glEdgeFlagPointer, 312)
+ GL_STUB(glEnableClientState, 313)
+ GL_STUB(glIndexPointer, 314)
+ GL_STUB(glIndexub, 315)
+ GL_STUB(glIndexubv, 316)
+ GL_STUB(glInterleavedArrays, 317)
+ GL_STUB(glNormalPointer, 318)
+ GL_STUB(glPolygonOffset, 319)
+ GL_STUB(glTexCoordPointer, 320)
+ GL_STUB(glVertexPointer, 321)
+ GL_STUB(glAreTexturesResident, 322)
+ GL_STUB(glCopyTexImage1D, 323)
+ GL_STUB(glCopyTexImage2D, 324)
+ GL_STUB(glCopyTexSubImage1D, 325)
+ GL_STUB(glCopyTexSubImage2D, 326)
+ GL_STUB(glDeleteTextures, 327)
+ GL_STUB(glGenTextures, 328)
+ GL_STUB(glGetPointerv, 329)
+ GL_STUB(glIsTexture, 330)
+ GL_STUB(glPrioritizeTextures, 331)
+ GL_STUB(glTexSubImage1D, 332)
+ GL_STUB(glTexSubImage2D, 333)
+ GL_STUB(glPopClientAttrib, 334)
+ GL_STUB(glPushClientAttrib, 335)
+ GL_STUB(glBlendColor, 336)
+ GL_STUB(glBlendEquation, 337)
+ GL_STUB(glDrawRangeElements, 338)
+ GL_STUB(glColorTable, 339)
+ GL_STUB(glColorTableParameterfv, 340)
+ GL_STUB(glColorTableParameteriv, 341)
+ GL_STUB(glCopyColorTable, 342)
+ GL_STUB(glGetColorTable, 343)
+ GL_STUB(glGetColorTableParameterfv, 344)
+ GL_STUB(glGetColorTableParameteriv, 345)
+ GL_STUB(glColorSubTable, 346)
+ GL_STUB(glCopyColorSubTable, 347)
+ GL_STUB(glConvolutionFilter1D, 348)
+ GL_STUB(glConvolutionFilter2D, 349)
+ GL_STUB(glConvolutionParameterf, 350)
+ GL_STUB(glConvolutionParameterfv, 351)
+ GL_STUB(glConvolutionParameteri, 352)
+ GL_STUB(glConvolutionParameteriv, 353)
+ GL_STUB(glCopyConvolutionFilter1D, 354)
+ GL_STUB(glCopyConvolutionFilter2D, 355)
+ GL_STUB(glGetConvolutionFilter, 356)
+ GL_STUB(glGetConvolutionParameterfv, 357)
+ GL_STUB(glGetConvolutionParameteriv, 358)
+ GL_STUB(glGetSeparableFilter, 359)
+ GL_STUB(glSeparableFilter2D, 360)
+ GL_STUB(glGetHistogram, 361)
+ GL_STUB(glGetHistogramParameterfv, 362)
+ GL_STUB(glGetHistogramParameteriv, 363)
+ GL_STUB(glGetMinmax, 364)
+ GL_STUB(glGetMinmaxParameterfv, 365)
+ GL_STUB(glGetMinmaxParameteriv, 366)
+ GL_STUB(glHistogram, 367)
+ GL_STUB(glMinmax, 368)
+ GL_STUB(glResetHistogram, 369)
+ GL_STUB(glResetMinmax, 370)
+ GL_STUB(glTexImage3D, 371)
+ GL_STUB(glTexSubImage3D, 372)
+ GL_STUB(glCopyTexSubImage3D, 373)
+ GL_STUB(glActiveTextureARB, 374)
+ GL_STUB(glClientActiveTextureARB, 375)
+ GL_STUB(glMultiTexCoord1dARB, 376)
+ GL_STUB(glMultiTexCoord1dvARB, 377)
+ GL_STUB(glMultiTexCoord1fARB, 378)
+ GL_STUB(glMultiTexCoord1fvARB, 379)
+ GL_STUB(glMultiTexCoord1iARB, 380)
+ GL_STUB(glMultiTexCoord1ivARB, 381)
+ GL_STUB(glMultiTexCoord1sARB, 382)
+ GL_STUB(glMultiTexCoord1svARB, 383)
+ GL_STUB(glMultiTexCoord2dARB, 384)
+ GL_STUB(glMultiTexCoord2dvARB, 385)
+ GL_STUB(glMultiTexCoord2fARB, 386)
+ GL_STUB(glMultiTexCoord2fvARB, 387)
+ GL_STUB(glMultiTexCoord2iARB, 388)
+ GL_STUB(glMultiTexCoord2ivARB, 389)
+ GL_STUB(glMultiTexCoord2sARB, 390)
+ GL_STUB(glMultiTexCoord2svARB, 391)
+ GL_STUB(glMultiTexCoord3dARB, 392)
+ GL_STUB(glMultiTexCoord3dvARB, 393)
+ GL_STUB(glMultiTexCoord3fARB, 394)
+ GL_STUB(glMultiTexCoord3fvARB, 395)
+ GL_STUB(glMultiTexCoord3iARB, 396)
+ GL_STUB(glMultiTexCoord3ivARB, 397)
+ GL_STUB(glMultiTexCoord3sARB, 398)
+ GL_STUB(glMultiTexCoord3svARB, 399)
+ GL_STUB(glMultiTexCoord4dARB, 400)
+ GL_STUB(glMultiTexCoord4dvARB, 401)
+ GL_STUB(glMultiTexCoord4fARB, 402)
+ GL_STUB(glMultiTexCoord4fvARB, 403)
+ GL_STUB(glMultiTexCoord4iARB, 404)
+ GL_STUB(glMultiTexCoord4ivARB, 405)
+ GL_STUB(glMultiTexCoord4sARB, 406)
+ GL_STUB(glMultiTexCoord4svARB, 407)
+ GL_STUB(glAttachShader, 408)
+ GL_STUB(glCreateProgram, 409)
+ GL_STUB(glCreateShader, 410)
+ GL_STUB(glDeleteProgram, 411)
+ GL_STUB(glDeleteShader, 412)
+ GL_STUB(glDetachShader, 413)
+ GL_STUB(glGetAttachedShaders, 414)
+ GL_STUB(glGetProgramInfoLog, 415)
+ GL_STUB(glGetProgramiv, 416)
+ GL_STUB(glGetShaderInfoLog, 417)
+ GL_STUB(glGetShaderiv, 418)
+ GL_STUB(glIsProgram, 419)
+ GL_STUB(glIsShader, 420)
+ GL_STUB(glStencilFuncSeparate, 421)
+ GL_STUB(glStencilMaskSeparate, 422)
+ GL_STUB(glStencilOpSeparate, 423)
+ GL_STUB(glUniformMatrix2x3fv, 424)
+ GL_STUB(glUniformMatrix2x4fv, 425)
+ GL_STUB(glUniformMatrix3x2fv, 426)
+ GL_STUB(glUniformMatrix3x4fv, 427)
+ GL_STUB(glUniformMatrix4x2fv, 428)
+ GL_STUB(glUniformMatrix4x3fv, 429)
+ GL_STUB(glClampColor, 430)
+ GL_STUB(glClearBufferfi, 431)
+ GL_STUB(glClearBufferfv, 432)
+ GL_STUB(glClearBufferiv, 433)
+ GL_STUB(glClearBufferuiv, 434)
+ GL_STUB(glGetStringi, 435)
+ GL_STUB(glTexBuffer, 436)
+ GL_STUB(glFramebufferTexture, 437)
+ GL_STUB(glGetBufferParameteri64v, 438)
+ GL_STUB(glGetInteger64i_v, 439)
+ GL_STUB(glVertexAttribDivisor, 440)
+ GL_STUB(glLoadTransposeMatrixdARB, 441)
+ GL_STUB(glLoadTransposeMatrixfARB, 442)
+ GL_STUB(glMultTransposeMatrixdARB, 443)
+ GL_STUB(glMultTransposeMatrixfARB, 444)
+ GL_STUB(glSampleCoverageARB, 445)
+ GL_STUB(glCompressedTexImage1DARB, 446)
+ GL_STUB(glCompressedTexImage2DARB, 447)
+ GL_STUB(glCompressedTexImage3DARB, 448)
+ GL_STUB(glCompressedTexSubImage1DARB, 449)
+ GL_STUB(glCompressedTexSubImage2DARB, 450)
+ GL_STUB(glCompressedTexSubImage3DARB, 451)
+ GL_STUB(glGetCompressedTexImageARB, 452)
+ GL_STUB(glDisableVertexAttribArrayARB, 453)
+ GL_STUB(glEnableVertexAttribArrayARB, 454)
+ GL_STUB(glGetProgramEnvParameterdvARB, 455)
+ GL_STUB(glGetProgramEnvParameterfvARB, 456)
+ GL_STUB(glGetProgramLocalParameterdvARB, 457)
+ GL_STUB(glGetProgramLocalParameterfvARB, 458)
+ GL_STUB(glGetProgramStringARB, 459)
+ GL_STUB(glGetProgramivARB, 460)
+ GL_STUB(glGetVertexAttribdvARB, 461)
+ GL_STUB(glGetVertexAttribfvARB, 462)
+ GL_STUB(glGetVertexAttribivARB, 463)
+ GL_STUB(glProgramEnvParameter4dARB, 464)
+ GL_STUB(glProgramEnvParameter4dvARB, 465)
+ GL_STUB(glProgramEnvParameter4fARB, 466)
+ GL_STUB(glProgramEnvParameter4fvARB, 467)
+ GL_STUB(glProgramLocalParameter4dARB, 468)
+ GL_STUB(glProgramLocalParameter4dvARB, 469)
+ GL_STUB(glProgramLocalParameter4fARB, 470)
+ GL_STUB(glProgramLocalParameter4fvARB, 471)
+ GL_STUB(glProgramStringARB, 472)
+ GL_STUB(glVertexAttrib1dARB, 473)
+ GL_STUB(glVertexAttrib1dvARB, 474)
+ GL_STUB(glVertexAttrib1fARB, 475)
+ GL_STUB(glVertexAttrib1fvARB, 476)
+ GL_STUB(glVertexAttrib1sARB, 477)
+ GL_STUB(glVertexAttrib1svARB, 478)
+ GL_STUB(glVertexAttrib2dARB, 479)
+ GL_STUB(glVertexAttrib2dvARB, 480)
+ GL_STUB(glVertexAttrib2fARB, 481)
+ GL_STUB(glVertexAttrib2fvARB, 482)
+ GL_STUB(glVertexAttrib2sARB, 483)
+ GL_STUB(glVertexAttrib2svARB, 484)
+ GL_STUB(glVertexAttrib3dARB, 485)
+ GL_STUB(glVertexAttrib3dvARB, 486)
+ GL_STUB(glVertexAttrib3fARB, 487)
+ GL_STUB(glVertexAttrib3fvARB, 488)
+ GL_STUB(glVertexAttrib3sARB, 489)
+ GL_STUB(glVertexAttrib3svARB, 490)
+ GL_STUB(glVertexAttrib4NbvARB, 491)
+ GL_STUB(glVertexAttrib4NivARB, 492)
+ GL_STUB(glVertexAttrib4NsvARB, 493)
+ GL_STUB(glVertexAttrib4NubARB, 494)
+ GL_STUB(glVertexAttrib4NubvARB, 495)
+ GL_STUB(glVertexAttrib4NuivARB, 496)
+ GL_STUB(glVertexAttrib4NusvARB, 497)
+ GL_STUB(glVertexAttrib4bvARB, 498)
+ GL_STUB(glVertexAttrib4dARB, 499)
+ GL_STUB(glVertexAttrib4dvARB, 500)
+ GL_STUB(glVertexAttrib4fARB, 501)
+ GL_STUB(glVertexAttrib4fvARB, 502)
+ GL_STUB(glVertexAttrib4ivARB, 503)
+ GL_STUB(glVertexAttrib4sARB, 504)
+ GL_STUB(glVertexAttrib4svARB, 505)
+ GL_STUB(glVertexAttrib4ubvARB, 506)
+ GL_STUB(glVertexAttrib4uivARB, 507)
+ GL_STUB(glVertexAttrib4usvARB, 508)
+ GL_STUB(glVertexAttribPointerARB, 509)
+ GL_STUB(glBindBufferARB, 510)
+ GL_STUB(glBufferDataARB, 511)
+ GL_STUB(glBufferSubDataARB, 512)
+ GL_STUB(glDeleteBuffersARB, 513)
+ GL_STUB(glGenBuffersARB, 514)
+ GL_STUB(glGetBufferParameterivARB, 515)
+ GL_STUB(glGetBufferPointervARB, 516)
+ GL_STUB(glGetBufferSubDataARB, 517)
+ GL_STUB(glIsBufferARB, 518)
+ GL_STUB(glMapBufferARB, 519)
+ GL_STUB(glUnmapBufferARB, 520)
+ GL_STUB(glBeginQueryARB, 521)
+ GL_STUB(glDeleteQueriesARB, 522)
+ GL_STUB(glEndQueryARB, 523)
+ GL_STUB(glGenQueriesARB, 524)
+ GL_STUB(glGetQueryObjectivARB, 525)
+ GL_STUB(glGetQueryObjectuivARB, 526)
+ GL_STUB(glGetQueryivARB, 527)
+ GL_STUB(glIsQueryARB, 528)
+ GL_STUB(glAttachObjectARB, 529)
+ GL_STUB(glCompileShaderARB, 530)
+ GL_STUB(glCreateProgramObjectARB, 531)
+ GL_STUB(glCreateShaderObjectARB, 532)
+ GL_STUB(glDeleteObjectARB, 533)
+ GL_STUB(glDetachObjectARB, 534)
+ GL_STUB(glGetActiveUniformARB, 535)
+ GL_STUB(glGetAttachedObjectsARB, 536)
+ GL_STUB(glGetHandleARB, 537)
+ GL_STUB(glGetInfoLogARB, 538)
+ GL_STUB(glGetObjectParameterfvARB, 539)
+ GL_STUB(glGetObjectParameterivARB, 540)
+ GL_STUB(glGetShaderSourceARB, 541)
+ GL_STUB(glGetUniformLocationARB, 542)
+ GL_STUB(glGetUniformfvARB, 543)
+ GL_STUB(glGetUniformivARB, 544)
+ GL_STUB(glLinkProgramARB, 545)
+ GL_STUB(glShaderSourceARB, 546)
+ GL_STUB(glUniform1fARB, 547)
+ GL_STUB(glUniform1fvARB, 548)
+ GL_STUB(glUniform1iARB, 549)
+ GL_STUB(glUniform1ivARB, 550)
+ GL_STUB(glUniform2fARB, 551)
+ GL_STUB(glUniform2fvARB, 552)
+ GL_STUB(glUniform2iARB, 553)
+ GL_STUB(glUniform2ivARB, 554)
+ GL_STUB(glUniform3fARB, 555)
+ GL_STUB(glUniform3fvARB, 556)
+ GL_STUB(glUniform3iARB, 557)
+ GL_STUB(glUniform3ivARB, 558)
+ GL_STUB(glUniform4fARB, 559)
+ GL_STUB(glUniform4fvARB, 560)
+ GL_STUB(glUniform4iARB, 561)
+ GL_STUB(glUniform4ivARB, 562)
+ GL_STUB(glUniformMatrix2fvARB, 563)
+ GL_STUB(glUniformMatrix3fvARB, 564)
+ GL_STUB(glUniformMatrix4fvARB, 565)
+ GL_STUB(glUseProgramObjectARB, 566)
+ GL_STUB(glValidateProgramARB, 567)
+ GL_STUB(glBindAttribLocationARB, 568)
+ GL_STUB(glGetActiveAttribARB, 569)
+ GL_STUB(glGetAttribLocationARB, 570)
+ GL_STUB(glDrawBuffersARB, 571)
+ GL_STUB(glClampColorARB, 572)
+ GL_STUB(glDrawArraysInstancedARB, 573)
+ GL_STUB(glDrawElementsInstancedARB, 574)
+ GL_STUB(glRenderbufferStorageMultisample, 575)
+ GL_STUB(glFramebufferTextureARB, 576)
+ GL_STUB(glFramebufferTextureFaceARB, 577)
+ GL_STUB(glProgramParameteriARB, 578)
+ GL_STUB(glVertexAttribDivisorARB, 579)
+ GL_STUB(glFlushMappedBufferRange, 580)
+ GL_STUB(glMapBufferRange, 581)
+ GL_STUB(glTexBufferARB, 582)
+ GL_STUB(glBindVertexArray, 583)
+ GL_STUB(glGenVertexArrays, 584)
+ GL_STUB(glCopyBufferSubData, 585)
+ GL_STUB(glClientWaitSync, 586)
+ GL_STUB(glDeleteSync, 587)
+ GL_STUB(glFenceSync, 588)
+ GL_STUB(glGetInteger64v, 589)
+ GL_STUB(glGetSynciv, 590)
+ GL_STUB(glIsSync, 591)
+ GL_STUB(glWaitSync, 592)
+ GL_STUB(glDrawElementsBaseVertex, 593)
+ GL_STUB(glDrawRangeElementsBaseVertex, 594)
+ GL_STUB(glMultiDrawElementsBaseVertex, 595)
+ GL_STUB(glBlendEquationSeparateiARB, 596)
+ GL_STUB(glBlendEquationiARB, 597)
+ GL_STUB(glBlendFuncSeparateiARB, 598)
+ GL_STUB(glBlendFunciARB, 599)
+ GL_STUB(glBindSampler, 600)
+ GL_STUB(glDeleteSamplers, 601)
+ GL_STUB(glGenSamplers, 602)
+ GL_STUB(glGetSamplerParameterIiv, 603)
+ GL_STUB(glGetSamplerParameterIuiv, 604)
+ GL_STUB(glGetSamplerParameterfv, 605)
+ GL_STUB(glGetSamplerParameteriv, 606)
+ GL_STUB(glIsSampler, 607)
+ GL_STUB(glSamplerParameterIiv, 608)
+ GL_STUB(glSamplerParameterIuiv, 609)
+ GL_STUB(glSamplerParameterf, 610)
+ GL_STUB(glSamplerParameterfv, 611)
+ GL_STUB(glSamplerParameteri, 612)
+ GL_STUB(glSamplerParameteriv, 613)
+ GL_STUB(glBindTransformFeedback, 614)
+ GL_STUB(glDeleteTransformFeedbacks, 615)
+ GL_STUB(glDrawTransformFeedback, 616)
+ GL_STUB(glGenTransformFeedbacks, 617)
+ GL_STUB(glIsTransformFeedback, 618)
+ GL_STUB(glPauseTransformFeedback, 619)
+ GL_STUB(glResumeTransformFeedback, 620)
+ GL_STUB(glClearDepthf, 621)
+ GL_STUB(glDepthRangef, 622)
+ GL_STUB(glGetShaderPrecisionFormat, 623)
+ GL_STUB(glReleaseShaderCompiler, 624)
+ GL_STUB(glShaderBinary, 625)
+ GL_STUB(glGetGraphicsResetStatusARB, 626)
+ GL_STUB(glGetnColorTableARB, 627)
+ GL_STUB(glGetnCompressedTexImageARB, 628)
+ GL_STUB(glGetnConvolutionFilterARB, 629)
+ GL_STUB(glGetnHistogramARB, 630)
+ GL_STUB(glGetnMapdvARB, 631)
+ GL_STUB(glGetnMapfvARB, 632)
+ GL_STUB(glGetnMapivARB, 633)
+ GL_STUB(glGetnMinmaxARB, 634)
+ GL_STUB(glGetnPixelMapfvARB, 635)
+ GL_STUB(glGetnPixelMapuivARB, 636)
+ GL_STUB(glGetnPixelMapusvARB, 637)
+ GL_STUB(glGetnPolygonStippleARB, 638)
+ GL_STUB(glGetnSeparableFilterARB, 639)
+ GL_STUB(glGetnTexImageARB, 640)
+ GL_STUB(glGetnUniformdvARB, 641)
+ GL_STUB(glGetnUniformfvARB, 642)
+ GL_STUB(glGetnUniformivARB, 643)
+ GL_STUB(glGetnUniformuivARB, 644)
+ GL_STUB(glReadnPixelsARB, 645)
+ GL_STUB(glPolygonOffsetEXT, 646)
+ GL_STUB(gl_dispatch_stub_647, 647)
+ HIDDEN(gl_dispatch_stub_647)
+ GL_STUB(gl_dispatch_stub_648, 648)
+ HIDDEN(gl_dispatch_stub_648)
+ GL_STUB(gl_dispatch_stub_649, 649)
+ HIDDEN(gl_dispatch_stub_649)
+ GL_STUB(gl_dispatch_stub_650, 650)
+ HIDDEN(gl_dispatch_stub_650)
+ GL_STUB(gl_dispatch_stub_651, 651)
+ HIDDEN(gl_dispatch_stub_651)
+ GL_STUB(gl_dispatch_stub_652, 652)
+ HIDDEN(gl_dispatch_stub_652)
+ GL_STUB(gl_dispatch_stub_653, 653)
+ HIDDEN(gl_dispatch_stub_653)
+ GL_STUB(gl_dispatch_stub_654, 654)
+ HIDDEN(gl_dispatch_stub_654)
+ GL_STUB(glColorPointerEXT, 655)
+ GL_STUB(glEdgeFlagPointerEXT, 656)
+ GL_STUB(glIndexPointerEXT, 657)
+ GL_STUB(glNormalPointerEXT, 658)
+ GL_STUB(glTexCoordPointerEXT, 659)
+ GL_STUB(glVertexPointerEXT, 660)
+ GL_STUB(glPointParameterfEXT, 661)
+ GL_STUB(glPointParameterfvEXT, 662)
+ GL_STUB(glLockArraysEXT, 663)
+ GL_STUB(glUnlockArraysEXT, 664)
+ GL_STUB(glSecondaryColor3bEXT, 665)
+ GL_STUB(glSecondaryColor3bvEXT, 666)
+ GL_STUB(glSecondaryColor3dEXT, 667)
+ GL_STUB(glSecondaryColor3dvEXT, 668)
+ GL_STUB(glSecondaryColor3fEXT, 669)
+ GL_STUB(glSecondaryColor3fvEXT, 670)
+ GL_STUB(glSecondaryColor3iEXT, 671)
+ GL_STUB(glSecondaryColor3ivEXT, 672)
+ GL_STUB(glSecondaryColor3sEXT, 673)
+ GL_STUB(glSecondaryColor3svEXT, 674)
+ GL_STUB(glSecondaryColor3ubEXT, 675)
+ GL_STUB(glSecondaryColor3ubvEXT, 676)
+ GL_STUB(glSecondaryColor3uiEXT, 677)
+ GL_STUB(glSecondaryColor3uivEXT, 678)
+ GL_STUB(glSecondaryColor3usEXT, 679)
+ GL_STUB(glSecondaryColor3usvEXT, 680)
+ GL_STUB(glSecondaryColorPointerEXT, 681)
+ GL_STUB(glMultiDrawArraysEXT, 682)
+ GL_STUB(glMultiDrawElementsEXT, 683)
+ GL_STUB(glFogCoordPointerEXT, 684)
+ GL_STUB(glFogCoorddEXT, 685)
+ GL_STUB(glFogCoorddvEXT, 686)
+ GL_STUB(glFogCoordfEXT, 687)
+ GL_STUB(glFogCoordfvEXT, 688)
+ GL_STUB(gl_dispatch_stub_689, 689)
+ HIDDEN(gl_dispatch_stub_689)
+ GL_STUB(glBlendFuncSeparateEXT, 690)
+ GL_STUB(glFlushVertexArrayRangeNV, 691)
+ GL_STUB(glVertexArrayRangeNV, 692)
+ GL_STUB(glCombinerInputNV, 693)
+ GL_STUB(glCombinerOutputNV, 694)
+ GL_STUB(glCombinerParameterfNV, 695)
+ GL_STUB(glCombinerParameterfvNV, 696)
+ GL_STUB(glCombinerParameteriNV, 697)
+ GL_STUB(glCombinerParameterivNV, 698)
+ GL_STUB(glFinalCombinerInputNV, 699)
+ GL_STUB(glGetCombinerInputParameterfvNV, 700)
+ GL_STUB(glGetCombinerInputParameterivNV, 701)
+ GL_STUB(glGetCombinerOutputParameterfvNV, 702)
+ GL_STUB(glGetCombinerOutputParameterivNV, 703)
+ GL_STUB(glGetFinalCombinerInputParameterfvNV, 704)
+ GL_STUB(glGetFinalCombinerInputParameterivNV, 705)
+ GL_STUB(glResizeBuffersMESA, 706)
+ GL_STUB(glWindowPos2dMESA, 707)
+ GL_STUB(glWindowPos2dvMESA, 708)
+ GL_STUB(glWindowPos2fMESA, 709)
+ GL_STUB(glWindowPos2fvMESA, 710)
+ GL_STUB(glWindowPos2iMESA, 711)
+ GL_STUB(glWindowPos2ivMESA, 712)
+ GL_STUB(glWindowPos2sMESA, 713)
+ GL_STUB(glWindowPos2svMESA, 714)
+ GL_STUB(glWindowPos3dMESA, 715)
+ GL_STUB(glWindowPos3dvMESA, 716)
+ GL_STUB(glWindowPos3fMESA, 717)
+ GL_STUB(glWindowPos3fvMESA, 718)
+ GL_STUB(glWindowPos3iMESA, 719)
+ GL_STUB(glWindowPos3ivMESA, 720)
+ GL_STUB(glWindowPos3sMESA, 721)
+ GL_STUB(glWindowPos3svMESA, 722)
+ GL_STUB(glWindowPos4dMESA, 723)
+ GL_STUB(glWindowPos4dvMESA, 724)
+ GL_STUB(glWindowPos4fMESA, 725)
+ GL_STUB(glWindowPos4fvMESA, 726)
+ GL_STUB(glWindowPos4iMESA, 727)
+ GL_STUB(glWindowPos4ivMESA, 728)
+ GL_STUB(glWindowPos4sMESA, 729)
+ GL_STUB(glWindowPos4svMESA, 730)
+ GL_STUB(gl_dispatch_stub_731, 731)
+ HIDDEN(gl_dispatch_stub_731)
+ GL_STUB(gl_dispatch_stub_732, 732)
+ HIDDEN(gl_dispatch_stub_732)
+ GL_STUB(gl_dispatch_stub_733, 733)
+ HIDDEN(gl_dispatch_stub_733)
+ GL_STUB(gl_dispatch_stub_734, 734)
+ HIDDEN(gl_dispatch_stub_734)
+ GL_STUB(gl_dispatch_stub_735, 735)
+ HIDDEN(gl_dispatch_stub_735)
+ GL_STUB(gl_dispatch_stub_736, 736)
+ HIDDEN(gl_dispatch_stub_736)
+ GL_STUB(gl_dispatch_stub_737, 737)
+ HIDDEN(gl_dispatch_stub_737)
+ GL_STUB(gl_dispatch_stub_738, 738)
+ HIDDEN(gl_dispatch_stub_738)
+ GL_STUB(gl_dispatch_stub_739, 739)
+ HIDDEN(gl_dispatch_stub_739)
+ GL_STUB(glAreProgramsResidentNV, 740)
+ GL_STUB(glBindProgramNV, 741)
+ GL_STUB(glDeleteProgramsNV, 742)
+ GL_STUB(glExecuteProgramNV, 743)
+ GL_STUB(glGenProgramsNV, 744)
+ GL_STUB(glGetProgramParameterdvNV, 745)
+ GL_STUB(glGetProgramParameterfvNV, 746)
+ GL_STUB(glGetProgramStringNV, 747)
+ GL_STUB(glGetProgramivNV, 748)
+ GL_STUB(glGetTrackMatrixivNV, 749)
+ GL_STUB(glGetVertexAttribPointervNV, 750)
+ GL_STUB(glGetVertexAttribdvNV, 751)
+ GL_STUB(glGetVertexAttribfvNV, 752)
+ GL_STUB(glGetVertexAttribivNV, 753)
+ GL_STUB(glIsProgramNV, 754)
+ GL_STUB(glLoadProgramNV, 755)
+ GL_STUB(glProgramParameters4dvNV, 756)
+ GL_STUB(glProgramParameters4fvNV, 757)
+ GL_STUB(glRequestResidentProgramsNV, 758)
+ GL_STUB(glTrackMatrixNV, 759)
+ GL_STUB(glVertexAttrib1dNV, 760)
+ GL_STUB(glVertexAttrib1dvNV, 761)
+ GL_STUB(glVertexAttrib1fNV, 762)
+ GL_STUB(glVertexAttrib1fvNV, 763)
+ GL_STUB(glVertexAttrib1sNV, 764)
+ GL_STUB(glVertexAttrib1svNV, 765)
+ GL_STUB(glVertexAttrib2dNV, 766)
+ GL_STUB(glVertexAttrib2dvNV, 767)
+ GL_STUB(glVertexAttrib2fNV, 768)
+ GL_STUB(glVertexAttrib2fvNV, 769)
+ GL_STUB(glVertexAttrib2sNV, 770)
+ GL_STUB(glVertexAttrib2svNV, 771)
+ GL_STUB(glVertexAttrib3dNV, 772)
+ GL_STUB(glVertexAttrib3dvNV, 773)
+ GL_STUB(glVertexAttrib3fNV, 774)
+ GL_STUB(glVertexAttrib3fvNV, 775)
+ GL_STUB(glVertexAttrib3sNV, 776)
+ GL_STUB(glVertexAttrib3svNV, 777)
+ GL_STUB(glVertexAttrib4dNV, 778)
+ GL_STUB(glVertexAttrib4dvNV, 779)
+ GL_STUB(glVertexAttrib4fNV, 780)
+ GL_STUB(glVertexAttrib4fvNV, 781)
+ GL_STUB(glVertexAttrib4sNV, 782)
+ GL_STUB(glVertexAttrib4svNV, 783)
+ GL_STUB(glVertexAttrib4ubNV, 784)
+ GL_STUB(glVertexAttrib4ubvNV, 785)
+ GL_STUB(glVertexAttribPointerNV, 786)
+ GL_STUB(glVertexAttribs1dvNV, 787)
+ GL_STUB(glVertexAttribs1fvNV, 788)
+ GL_STUB(glVertexAttribs1svNV, 789)
+ GL_STUB(glVertexAttribs2dvNV, 790)
+ GL_STUB(glVertexAttribs2fvNV, 791)
+ GL_STUB(glVertexAttribs2svNV, 792)
+ GL_STUB(glVertexAttribs3dvNV, 793)
+ GL_STUB(glVertexAttribs3fvNV, 794)
+ GL_STUB(glVertexAttribs3svNV, 795)
+ GL_STUB(glVertexAttribs4dvNV, 796)
+ GL_STUB(glVertexAttribs4fvNV, 797)
+ GL_STUB(glVertexAttribs4svNV, 798)
+ GL_STUB(glVertexAttribs4ubvNV, 799)
+ GL_STUB(glGetTexBumpParameterfvATI, 800)
+ GL_STUB(glGetTexBumpParameterivATI, 801)
+ GL_STUB(glTexBumpParameterfvATI, 802)
+ GL_STUB(glTexBumpParameterivATI, 803)
+ GL_STUB(glAlphaFragmentOp1ATI, 804)
+ GL_STUB(glAlphaFragmentOp2ATI, 805)
+ GL_STUB(glAlphaFragmentOp3ATI, 806)
+ GL_STUB(glBeginFragmentShaderATI, 807)
+ GL_STUB(glBindFragmentShaderATI, 808)
+ GL_STUB(glColorFragmentOp1ATI, 809)
+ GL_STUB(glColorFragmentOp2ATI, 810)
+ GL_STUB(glColorFragmentOp3ATI, 811)
+ GL_STUB(glDeleteFragmentShaderATI, 812)
+ GL_STUB(glEndFragmentShaderATI, 813)
+ GL_STUB(glGenFragmentShadersATI, 814)
+ GL_STUB(glPassTexCoordATI, 815)
+ GL_STUB(glSampleMapATI, 816)
+ GL_STUB(glSetFragmentShaderConstantATI, 817)
+ GL_STUB(glPointParameteriNV, 818)
+ GL_STUB(glPointParameterivNV, 819)
+ GL_STUB(gl_dispatch_stub_820, 820)
+ HIDDEN(gl_dispatch_stub_820)
+ GL_STUB(gl_dispatch_stub_821, 821)
+ HIDDEN(gl_dispatch_stub_821)
+ GL_STUB(gl_dispatch_stub_822, 822)
+ HIDDEN(gl_dispatch_stub_822)
+ GL_STUB(gl_dispatch_stub_823, 823)
+ HIDDEN(gl_dispatch_stub_823)
+ GL_STUB(gl_dispatch_stub_824, 824)
+ HIDDEN(gl_dispatch_stub_824)
+ GL_STUB(glGetProgramNamedParameterdvNV, 825)
+ GL_STUB(glGetProgramNamedParameterfvNV, 826)
+ GL_STUB(glProgramNamedParameter4dNV, 827)
+ GL_STUB(glProgramNamedParameter4dvNV, 828)
+ GL_STUB(glProgramNamedParameter4fNV, 829)
+ GL_STUB(glProgramNamedParameter4fvNV, 830)
+ GL_STUB(glPrimitiveRestartIndexNV, 831)
+ GL_STUB(glPrimitiveRestartNV, 832)
+ GL_STUB(gl_dispatch_stub_833, 833)
+ HIDDEN(gl_dispatch_stub_833)
+ GL_STUB(gl_dispatch_stub_834, 834)
+ HIDDEN(gl_dispatch_stub_834)
+ GL_STUB(glBindFramebufferEXT, 835)
+ GL_STUB(glBindRenderbufferEXT, 836)
+ GL_STUB(glCheckFramebufferStatusEXT, 837)
+ GL_STUB(glDeleteFramebuffersEXT, 838)
+ GL_STUB(glDeleteRenderbuffersEXT, 839)
+ GL_STUB(glFramebufferRenderbufferEXT, 840)
+ GL_STUB(glFramebufferTexture1DEXT, 841)
+ GL_STUB(glFramebufferTexture2DEXT, 842)
+ GL_STUB(glFramebufferTexture3DEXT, 843)
+ GL_STUB(glGenFramebuffersEXT, 844)
+ GL_STUB(glGenRenderbuffersEXT, 845)
+ GL_STUB(glGenerateMipmapEXT, 846)
+ GL_STUB(glGetFramebufferAttachmentParameterivEXT, 847)
+ GL_STUB(glGetRenderbufferParameterivEXT, 848)
+ GL_STUB(glIsFramebufferEXT, 849)
+ GL_STUB(glIsRenderbufferEXT, 850)
+ GL_STUB(glRenderbufferStorageEXT, 851)
+ GL_STUB(gl_dispatch_stub_852, 852)
+ HIDDEN(gl_dispatch_stub_852)
+ GL_STUB(gl_dispatch_stub_853, 853)
+ HIDDEN(gl_dispatch_stub_853)
+ GL_STUB(gl_dispatch_stub_854, 854)
+ HIDDEN(gl_dispatch_stub_854)
+ GL_STUB(glBindFragDataLocationEXT, 855)
+ GL_STUB(glGetFragDataLocationEXT, 856)
+ GL_STUB(glGetUniformuivEXT, 857)
+ GL_STUB(glGetVertexAttribIivEXT, 858)
+ GL_STUB(glGetVertexAttribIuivEXT, 859)
+ GL_STUB(glUniform1uiEXT, 860)
+ GL_STUB(glUniform1uivEXT, 861)
+ GL_STUB(glUniform2uiEXT, 862)
+ GL_STUB(glUniform2uivEXT, 863)
+ GL_STUB(glUniform3uiEXT, 864)
+ GL_STUB(glUniform3uivEXT, 865)
+ GL_STUB(glUniform4uiEXT, 866)
+ GL_STUB(glUniform4uivEXT, 867)
+ GL_STUB(glVertexAttribI1iEXT, 868)
+ GL_STUB(glVertexAttribI1ivEXT, 869)
+ GL_STUB(glVertexAttribI1uiEXT, 870)
+ GL_STUB(glVertexAttribI1uivEXT, 871)
+ GL_STUB(glVertexAttribI2iEXT, 872)
+ GL_STUB(glVertexAttribI2ivEXT, 873)
+ GL_STUB(glVertexAttribI2uiEXT, 874)
+ GL_STUB(glVertexAttribI2uivEXT, 875)
+ GL_STUB(glVertexAttribI3iEXT, 876)
+ GL_STUB(glVertexAttribI3ivEXT, 877)
+ GL_STUB(glVertexAttribI3uiEXT, 878)
+ GL_STUB(glVertexAttribI3uivEXT, 879)
+ GL_STUB(glVertexAttribI4bvEXT, 880)
+ GL_STUB(glVertexAttribI4iEXT, 881)
+ GL_STUB(glVertexAttribI4ivEXT, 882)
+ GL_STUB(glVertexAttribI4svEXT, 883)
+ GL_STUB(glVertexAttribI4ubvEXT, 884)
+ GL_STUB(glVertexAttribI4uiEXT, 885)
+ GL_STUB(glVertexAttribI4uivEXT, 886)
+ GL_STUB(glVertexAttribI4usvEXT, 887)
+ GL_STUB(glVertexAttribIPointerEXT, 888)
+ GL_STUB(glFramebufferTextureLayerEXT, 889)
+ GL_STUB(glColorMaskIndexedEXT, 890)
+ GL_STUB(glDisableIndexedEXT, 891)
+ GL_STUB(glEnableIndexedEXT, 892)
+ GL_STUB(glGetBooleanIndexedvEXT, 893)
+ GL_STUB(glGetIntegerIndexedvEXT, 894)
+ GL_STUB(glIsEnabledIndexedEXT, 895)
+ GL_STUB(glClearColorIiEXT, 896)
+ GL_STUB(glClearColorIuiEXT, 897)
+ GL_STUB(glGetTexParameterIivEXT, 898)
+ GL_STUB(glGetTexParameterIuivEXT, 899)
+ GL_STUB(glTexParameterIivEXT, 900)
+ GL_STUB(glTexParameterIuivEXT, 901)
+ GL_STUB(glBeginConditionalRenderNV, 902)
+ GL_STUB(glEndConditionalRenderNV, 903)
+ GL_STUB(glBeginTransformFeedbackEXT, 904)
+ GL_STUB(glBindBufferBaseEXT, 905)
+ GL_STUB(glBindBufferOffsetEXT, 906)
+ GL_STUB(glBindBufferRangeEXT, 907)
+ GL_STUB(glEndTransformFeedbackEXT, 908)
+ GL_STUB(glGetTransformFeedbackVaryingEXT, 909)
+ GL_STUB(glTransformFeedbackVaryingsEXT, 910)
+ GL_STUB(glProvokingVertexEXT, 911)
+ GL_STUB(gl_dispatch_stub_912, 912)
+ HIDDEN(gl_dispatch_stub_912)
+ GL_STUB(gl_dispatch_stub_913, 913)
+ HIDDEN(gl_dispatch_stub_913)
+ GL_STUB(glGetObjectParameterivAPPLE, 914)
+ GL_STUB(glObjectPurgeableAPPLE, 915)
+ GL_STUB(glObjectUnpurgeableAPPLE, 916)
+ GL_STUB(glActiveProgramEXT, 917)
+ GL_STUB(glCreateShaderProgramEXT, 918)
+ GL_STUB(glUseShaderProgramEXT, 919)
+ GL_STUB(glTextureBarrierNV, 920)
+ GL_STUB(gl_dispatch_stub_921, 921)
+ HIDDEN(gl_dispatch_stub_921)
+ GL_STUB(gl_dispatch_stub_922, 922)
+ HIDDEN(gl_dispatch_stub_922)
+ GL_STUB(gl_dispatch_stub_923, 923)
+ HIDDEN(gl_dispatch_stub_923)
+ GL_STUB(gl_dispatch_stub_924, 924)
+ HIDDEN(gl_dispatch_stub_924)
+ GL_STUB(gl_dispatch_stub_925, 925)
+ HIDDEN(gl_dispatch_stub_925)
+ GL_STUB(glEGLImageTargetRenderbufferStorageOES, 926)
+ GL_STUB(glEGLImageTargetTexture2DOES, 927)
+ GL_STUB_ALIAS(glArrayElementEXT, glArrayElement)
+ GL_STUB_ALIAS(glBindTextureEXT, glBindTexture)
+ GL_STUB_ALIAS(glDrawArraysEXT, glDrawArrays)
+#ifndef GLX_INDIRECT_RENDERING
+ GL_STUB_ALIAS(glAreTexturesResidentEXT, glAreTexturesResident)
+#endif
+ GL_STUB_ALIAS(glCopyTexImage1DEXT, glCopyTexImage1D)
+ GL_STUB_ALIAS(glCopyTexImage2DEXT, glCopyTexImage2D)
+ GL_STUB_ALIAS(glCopyTexSubImage1DEXT, glCopyTexSubImage1D)
+ GL_STUB_ALIAS(glCopyTexSubImage2DEXT, glCopyTexSubImage2D)
+#ifndef GLX_INDIRECT_RENDERING
+ GL_STUB_ALIAS(glDeleteTexturesEXT, glDeleteTextures)
+#endif
+#ifndef GLX_INDIRECT_RENDERING
+ GL_STUB_ALIAS(glGenTexturesEXT, glGenTextures)
+#endif
+ GL_STUB_ALIAS(glGetPointervEXT, glGetPointerv)
+#ifndef GLX_INDIRECT_RENDERING
+ GL_STUB_ALIAS(glIsTextureEXT, glIsTexture)
+#endif
+ GL_STUB_ALIAS(glPrioritizeTexturesEXT, glPrioritizeTextures)
+ GL_STUB_ALIAS(glTexSubImage1DEXT, glTexSubImage1D)
+ GL_STUB_ALIAS(glTexSubImage2DEXT, glTexSubImage2D)
+ GL_STUB_ALIAS(glBlendColorEXT, glBlendColor)
+ GL_STUB_ALIAS(glBlendEquationEXT, glBlendEquation)
+ GL_STUB_ALIAS(glDrawRangeElementsEXT, glDrawRangeElements)
+ GL_STUB_ALIAS(glColorTableSGI, glColorTable)
+ GL_STUB_ALIAS(glColorTableEXT, glColorTable)
+ GL_STUB_ALIAS(glColorTableParameterfvSGI, glColorTableParameterfv)
+ GL_STUB_ALIAS(glColorTableParameterivSGI, glColorTableParameteriv)
+ GL_STUB_ALIAS(glCopyColorTableSGI, glCopyColorTable)
+#ifndef GLX_INDIRECT_RENDERING
+ GL_STUB_ALIAS(glGetColorTableSGI, glGetColorTable)
+#endif
+#ifndef GLX_INDIRECT_RENDERING
+ GL_STUB_ALIAS(glGetColorTableEXT, glGetColorTable)
+#endif
+#ifndef GLX_INDIRECT_RENDERING
+ GL_STUB_ALIAS(glGetColorTableParameterfvSGI, glGetColorTableParameterfv)
+#endif
+#ifndef GLX_INDIRECT_RENDERING
+ GL_STUB_ALIAS(glGetColorTableParameterfvEXT, glGetColorTableParameterfv)
+#endif
+#ifndef GLX_INDIRECT_RENDERING
+ GL_STUB_ALIAS(glGetColorTableParameterivSGI, glGetColorTableParameteriv)
+#endif
+#ifndef GLX_INDIRECT_RENDERING
+ GL_STUB_ALIAS(glGetColorTableParameterivEXT, glGetColorTableParameteriv)
+#endif
+ GL_STUB_ALIAS(glColorSubTableEXT, glColorSubTable)
+ GL_STUB_ALIAS(glCopyColorSubTableEXT, glCopyColorSubTable)
+ GL_STUB_ALIAS(glConvolutionFilter1DEXT, glConvolutionFilter1D)
+ GL_STUB_ALIAS(glConvolutionFilter2DEXT, glConvolutionFilter2D)
+ GL_STUB_ALIAS(glConvolutionParameterfEXT, glConvolutionParameterf)
+ GL_STUB_ALIAS(glConvolutionParameterfvEXT, glConvolutionParameterfv)
+ GL_STUB_ALIAS(glConvolutionParameteriEXT, glConvolutionParameteri)
+ GL_STUB_ALIAS(glConvolutionParameterivEXT, glConvolutionParameteriv)
+ GL_STUB_ALIAS(glCopyConvolutionFilter1DEXT, glCopyConvolutionFilter1D)
+ GL_STUB_ALIAS(glCopyConvolutionFilter2DEXT, glCopyConvolutionFilter2D)
+#ifndef GLX_INDIRECT_RENDERING
+ GL_STUB_ALIAS(glGetConvolutionFilterEXT, glGetConvolutionFilter)
+#endif
+#ifndef GLX_INDIRECT_RENDERING
+ GL_STUB_ALIAS(glGetConvolutionParameterfvEXT, glGetConvolutionParameterfv)
+#endif
+#ifndef GLX_INDIRECT_RENDERING
+ GL_STUB_ALIAS(glGetConvolutionParameterivEXT, glGetConvolutionParameteriv)
+#endif
+#ifndef GLX_INDIRECT_RENDERING
+ GL_STUB_ALIAS(glGetSeparableFilterEXT, glGetSeparableFilter)
+#endif
+ GL_STUB_ALIAS(glSeparableFilter2DEXT, glSeparableFilter2D)
+#ifndef GLX_INDIRECT_RENDERING
+ GL_STUB_ALIAS(glGetHistogramEXT, glGetHistogram)
+#endif
+#ifndef GLX_INDIRECT_RENDERING
+ GL_STUB_ALIAS(glGetHistogramParameterfvEXT, glGetHistogramParameterfv)
+#endif
+#ifndef GLX_INDIRECT_RENDERING
+ GL_STUB_ALIAS(glGetHistogramParameterivEXT, glGetHistogramParameteriv)
+#endif
+#ifndef GLX_INDIRECT_RENDERING
+ GL_STUB_ALIAS(glGetMinmaxEXT, glGetMinmax)
+#endif
+#ifndef GLX_INDIRECT_RENDERING
+ GL_STUB_ALIAS(glGetMinmaxParameterfvEXT, glGetMinmaxParameterfv)
+#endif
+#ifndef GLX_INDIRECT_RENDERING
+ GL_STUB_ALIAS(glGetMinmaxParameterivEXT, glGetMinmaxParameteriv)
+#endif
+ GL_STUB_ALIAS(glHistogramEXT, glHistogram)
+ GL_STUB_ALIAS(glMinmaxEXT, glMinmax)
+ GL_STUB_ALIAS(glResetHistogramEXT, glResetHistogram)
+ GL_STUB_ALIAS(glResetMinmaxEXT, glResetMinmax)
+ GL_STUB_ALIAS(glTexImage3DEXT, glTexImage3D)
+ GL_STUB_ALIAS(glTexSubImage3DEXT, glTexSubImage3D)
+ GL_STUB_ALIAS(glCopyTexSubImage3DEXT, glCopyTexSubImage3D)
+ GL_STUB_ALIAS(glActiveTexture, glActiveTextureARB)
+ GL_STUB_ALIAS(glClientActiveTexture, glClientActiveTextureARB)
+ GL_STUB_ALIAS(glMultiTexCoord1d, glMultiTexCoord1dARB)
+ GL_STUB_ALIAS(glMultiTexCoord1dv, glMultiTexCoord1dvARB)
+ GL_STUB_ALIAS(glMultiTexCoord1f, glMultiTexCoord1fARB)
+ GL_STUB_ALIAS(glMultiTexCoord1fv, glMultiTexCoord1fvARB)
+ GL_STUB_ALIAS(glMultiTexCoord1i, glMultiTexCoord1iARB)
+ GL_STUB_ALIAS(glMultiTexCoord1iv, glMultiTexCoord1ivARB)
+ GL_STUB_ALIAS(glMultiTexCoord1s, glMultiTexCoord1sARB)
+ GL_STUB_ALIAS(glMultiTexCoord1sv, glMultiTexCoord1svARB)
+ GL_STUB_ALIAS(glMultiTexCoord2d, glMultiTexCoord2dARB)
+ GL_STUB_ALIAS(glMultiTexCoord2dv, glMultiTexCoord2dvARB)
+ GL_STUB_ALIAS(glMultiTexCoord2f, glMultiTexCoord2fARB)
+ GL_STUB_ALIAS(glMultiTexCoord2fv, glMultiTexCoord2fvARB)
+ GL_STUB_ALIAS(glMultiTexCoord2i, glMultiTexCoord2iARB)
+ GL_STUB_ALIAS(glMultiTexCoord2iv, glMultiTexCoord2ivARB)
+ GL_STUB_ALIAS(glMultiTexCoord2s, glMultiTexCoord2sARB)
+ GL_STUB_ALIAS(glMultiTexCoord2sv, glMultiTexCoord2svARB)
+ GL_STUB_ALIAS(glMultiTexCoord3d, glMultiTexCoord3dARB)
+ GL_STUB_ALIAS(glMultiTexCoord3dv, glMultiTexCoord3dvARB)
+ GL_STUB_ALIAS(glMultiTexCoord3f, glMultiTexCoord3fARB)
+ GL_STUB_ALIAS(glMultiTexCoord3fv, glMultiTexCoord3fvARB)
+ GL_STUB_ALIAS(glMultiTexCoord3i, glMultiTexCoord3iARB)
+ GL_STUB_ALIAS(glMultiTexCoord3iv, glMultiTexCoord3ivARB)
+ GL_STUB_ALIAS(glMultiTexCoord3s, glMultiTexCoord3sARB)
+ GL_STUB_ALIAS(glMultiTexCoord3sv, glMultiTexCoord3svARB)
+ GL_STUB_ALIAS(glMultiTexCoord4d, glMultiTexCoord4dARB)
+ GL_STUB_ALIAS(glMultiTexCoord4dv, glMultiTexCoord4dvARB)
+ GL_STUB_ALIAS(glMultiTexCoord4f, glMultiTexCoord4fARB)
+ GL_STUB_ALIAS(glMultiTexCoord4fv, glMultiTexCoord4fvARB)
+ GL_STUB_ALIAS(glMultiTexCoord4i, glMultiTexCoord4iARB)
+ GL_STUB_ALIAS(glMultiTexCoord4iv, glMultiTexCoord4ivARB)
+ GL_STUB_ALIAS(glMultiTexCoord4s, glMultiTexCoord4sARB)
+ GL_STUB_ALIAS(glMultiTexCoord4sv, glMultiTexCoord4svARB)
+ GL_STUB_ALIAS(glStencilOpSeparateATI, glStencilOpSeparate)
+ GL_STUB_ALIAS(glLoadTransposeMatrixd, glLoadTransposeMatrixdARB)
+ GL_STUB_ALIAS(glLoadTransposeMatrixf, glLoadTransposeMatrixfARB)
+ GL_STUB_ALIAS(glMultTransposeMatrixd, glMultTransposeMatrixdARB)
+ GL_STUB_ALIAS(glMultTransposeMatrixf, glMultTransposeMatrixfARB)
+ GL_STUB_ALIAS(glSampleCoverage, glSampleCoverageARB)
+ GL_STUB_ALIAS(glCompressedTexImage1D, glCompressedTexImage1DARB)
+ GL_STUB_ALIAS(glCompressedTexImage2D, glCompressedTexImage2DARB)
+ GL_STUB_ALIAS(glCompressedTexImage3D, glCompressedTexImage3DARB)
+ GL_STUB_ALIAS(glCompressedTexSubImage1D, glCompressedTexSubImage1DARB)
+ GL_STUB_ALIAS(glCompressedTexSubImage2D, glCompressedTexSubImage2DARB)
+ GL_STUB_ALIAS(glCompressedTexSubImage3D, glCompressedTexSubImage3DARB)
+ GL_STUB_ALIAS(glGetCompressedTexImage, glGetCompressedTexImageARB)
+ GL_STUB_ALIAS(glDisableVertexAttribArray, glDisableVertexAttribArrayARB)
+ GL_STUB_ALIAS(glEnableVertexAttribArray, glEnableVertexAttribArrayARB)
+ GL_STUB_ALIAS(glGetVertexAttribdv, glGetVertexAttribdvARB)
+ GL_STUB_ALIAS(glGetVertexAttribfv, glGetVertexAttribfvARB)
+ GL_STUB_ALIAS(glGetVertexAttribiv, glGetVertexAttribivARB)
+ GL_STUB_ALIAS(glProgramParameter4dNV, glProgramEnvParameter4dARB)
+ GL_STUB_ALIAS(glProgramParameter4dvNV, glProgramEnvParameter4dvARB)
+ GL_STUB_ALIAS(glProgramParameter4fNV, glProgramEnvParameter4fARB)
+ GL_STUB_ALIAS(glProgramParameter4fvNV, glProgramEnvParameter4fvARB)
+ GL_STUB_ALIAS(glVertexAttrib1d, glVertexAttrib1dARB)
+ GL_STUB_ALIAS(glVertexAttrib1dv, glVertexAttrib1dvARB)
+ GL_STUB_ALIAS(glVertexAttrib1f, glVertexAttrib1fARB)
+ GL_STUB_ALIAS(glVertexAttrib1fv, glVertexAttrib1fvARB)
+ GL_STUB_ALIAS(glVertexAttrib1s, glVertexAttrib1sARB)
+ GL_STUB_ALIAS(glVertexAttrib1sv, glVertexAttrib1svARB)
+ GL_STUB_ALIAS(glVertexAttrib2d, glVertexAttrib2dARB)
+ GL_STUB_ALIAS(glVertexAttrib2dv, glVertexAttrib2dvARB)
+ GL_STUB_ALIAS(glVertexAttrib2f, glVertexAttrib2fARB)
+ GL_STUB_ALIAS(glVertexAttrib2fv, glVertexAttrib2fvARB)
+ GL_STUB_ALIAS(glVertexAttrib2s, glVertexAttrib2sARB)
+ GL_STUB_ALIAS(glVertexAttrib2sv, glVertexAttrib2svARB)
+ GL_STUB_ALIAS(glVertexAttrib3d, glVertexAttrib3dARB)
+ GL_STUB_ALIAS(glVertexAttrib3dv, glVertexAttrib3dvARB)
+ GL_STUB_ALIAS(glVertexAttrib3f, glVertexAttrib3fARB)
+ GL_STUB_ALIAS(glVertexAttrib3fv, glVertexAttrib3fvARB)
+ GL_STUB_ALIAS(glVertexAttrib3s, glVertexAttrib3sARB)
+ GL_STUB_ALIAS(glVertexAttrib3sv, glVertexAttrib3svARB)
+ GL_STUB_ALIAS(glVertexAttrib4Nbv, glVertexAttrib4NbvARB)
+ GL_STUB_ALIAS(glVertexAttrib4Niv, glVertexAttrib4NivARB)
+ GL_STUB_ALIAS(glVertexAttrib4Nsv, glVertexAttrib4NsvARB)
+ GL_STUB_ALIAS(glVertexAttrib4Nub, glVertexAttrib4NubARB)
+ GL_STUB_ALIAS(glVertexAttrib4Nubv, glVertexAttrib4NubvARB)
+ GL_STUB_ALIAS(glVertexAttrib4Nuiv, glVertexAttrib4NuivARB)
+ GL_STUB_ALIAS(glVertexAttrib4Nusv, glVertexAttrib4NusvARB)
+ GL_STUB_ALIAS(glVertexAttrib4bv, glVertexAttrib4bvARB)
+ GL_STUB_ALIAS(glVertexAttrib4d, glVertexAttrib4dARB)
+ GL_STUB_ALIAS(glVertexAttrib4dv, glVertexAttrib4dvARB)
+ GL_STUB_ALIAS(glVertexAttrib4f, glVertexAttrib4fARB)
+ GL_STUB_ALIAS(glVertexAttrib4fv, glVertexAttrib4fvARB)
+ GL_STUB_ALIAS(glVertexAttrib4iv, glVertexAttrib4ivARB)
+ GL_STUB_ALIAS(glVertexAttrib4s, glVertexAttrib4sARB)
+ GL_STUB_ALIAS(glVertexAttrib4sv, glVertexAttrib4svARB)
+ GL_STUB_ALIAS(glVertexAttrib4ubv, glVertexAttrib4ubvARB)
+ GL_STUB_ALIAS(glVertexAttrib4uiv, glVertexAttrib4uivARB)
+ GL_STUB_ALIAS(glVertexAttrib4usv, glVertexAttrib4usvARB)
+ GL_STUB_ALIAS(glVertexAttribPointer, glVertexAttribPointerARB)
+ GL_STUB_ALIAS(glBindBuffer, glBindBufferARB)
+ GL_STUB_ALIAS(glBufferData, glBufferDataARB)
+ GL_STUB_ALIAS(glBufferSubData, glBufferSubDataARB)
+ GL_STUB_ALIAS(glDeleteBuffers, glDeleteBuffersARB)
+ GL_STUB_ALIAS(glGenBuffers, glGenBuffersARB)
+ GL_STUB_ALIAS(glGetBufferParameteriv, glGetBufferParameterivARB)
+ GL_STUB_ALIAS(glGetBufferPointerv, glGetBufferPointervARB)
+ GL_STUB_ALIAS(glGetBufferSubData, glGetBufferSubDataARB)
+ GL_STUB_ALIAS(glIsBuffer, glIsBufferARB)
+ GL_STUB_ALIAS(glMapBuffer, glMapBufferARB)
+ GL_STUB_ALIAS(glUnmapBuffer, glUnmapBufferARB)
+ GL_STUB_ALIAS(glBeginQuery, glBeginQueryARB)
+ GL_STUB_ALIAS(glDeleteQueries, glDeleteQueriesARB)
+ GL_STUB_ALIAS(glEndQuery, glEndQueryARB)
+ GL_STUB_ALIAS(glGenQueries, glGenQueriesARB)
+ GL_STUB_ALIAS(glGetQueryObjectiv, glGetQueryObjectivARB)
+ GL_STUB_ALIAS(glGetQueryObjectuiv, glGetQueryObjectuivARB)
+ GL_STUB_ALIAS(glGetQueryiv, glGetQueryivARB)
+ GL_STUB_ALIAS(glIsQuery, glIsQueryARB)
+ GL_STUB_ALIAS(glCompileShader, glCompileShaderARB)
+ GL_STUB_ALIAS(glGetActiveUniform, glGetActiveUniformARB)
+ GL_STUB_ALIAS(glGetShaderSource, glGetShaderSourceARB)
+ GL_STUB_ALIAS(glGetUniformLocation, glGetUniformLocationARB)
+ GL_STUB_ALIAS(glGetUniformfv, glGetUniformfvARB)
+ GL_STUB_ALIAS(glGetUniformiv, glGetUniformivARB)
+ GL_STUB_ALIAS(glLinkProgram, glLinkProgramARB)
+ GL_STUB_ALIAS(glShaderSource, glShaderSourceARB)
+ GL_STUB_ALIAS(glUniform1f, glUniform1fARB)
+ GL_STUB_ALIAS(glUniform1fv, glUniform1fvARB)
+ GL_STUB_ALIAS(glUniform1i, glUniform1iARB)
+ GL_STUB_ALIAS(glUniform1iv, glUniform1ivARB)
+ GL_STUB_ALIAS(glUniform2f, glUniform2fARB)
+ GL_STUB_ALIAS(glUniform2fv, glUniform2fvARB)
+ GL_STUB_ALIAS(glUniform2i, glUniform2iARB)
+ GL_STUB_ALIAS(glUniform2iv, glUniform2ivARB)
+ GL_STUB_ALIAS(glUniform3f, glUniform3fARB)
+ GL_STUB_ALIAS(glUniform3fv, glUniform3fvARB)
+ GL_STUB_ALIAS(glUniform3i, glUniform3iARB)
+ GL_STUB_ALIAS(glUniform3iv, glUniform3ivARB)
+ GL_STUB_ALIAS(glUniform4f, glUniform4fARB)
+ GL_STUB_ALIAS(glUniform4fv, glUniform4fvARB)
+ GL_STUB_ALIAS(glUniform4i, glUniform4iARB)
+ GL_STUB_ALIAS(glUniform4iv, glUniform4ivARB)
+ GL_STUB_ALIAS(glUniformMatrix2fv, glUniformMatrix2fvARB)
+ GL_STUB_ALIAS(glUniformMatrix3fv, glUniformMatrix3fvARB)
+ GL_STUB_ALIAS(glUniformMatrix4fv, glUniformMatrix4fvARB)
+ GL_STUB_ALIAS(glUseProgram, glUseProgramObjectARB)
+ GL_STUB_ALIAS(glValidateProgram, glValidateProgramARB)
+ GL_STUB_ALIAS(glBindAttribLocation, glBindAttribLocationARB)
+ GL_STUB_ALIAS(glGetActiveAttrib, glGetActiveAttribARB)
+ GL_STUB_ALIAS(glGetAttribLocation, glGetAttribLocationARB)
+ GL_STUB_ALIAS(glDrawBuffers, glDrawBuffersARB)
+ GL_STUB_ALIAS(glDrawBuffersATI, glDrawBuffersARB)
+ GL_STUB_ALIAS(glDrawArraysInstancedEXT, glDrawArraysInstancedARB)
+ GL_STUB_ALIAS(glDrawArraysInstanced, glDrawArraysInstancedARB)
+ GL_STUB_ALIAS(glDrawElementsInstancedEXT, glDrawElementsInstancedARB)
+ GL_STUB_ALIAS(glDrawElementsInstanced, glDrawElementsInstancedARB)
+ GL_STUB_ALIAS(glRenderbufferStorageMultisampleEXT, glRenderbufferStorageMultisample)
+ GL_STUB_ALIAS(glBlendEquationSeparateIndexedAMD, glBlendEquationSeparateiARB)
+ GL_STUB_ALIAS(glBlendEquationIndexedAMD, glBlendEquationiARB)
+ GL_STUB_ALIAS(glBlendFuncSeparateIndexedAMD, glBlendFuncSeparateiARB)
+ GL_STUB_ALIAS(glBlendFuncIndexedAMD, glBlendFunciARB)
+ GL_STUB_ALIAS(glPointParameterf, glPointParameterfEXT)
+ GL_STUB_ALIAS(glPointParameterfARB, glPointParameterfEXT)
+ GL_STUB_ALIAS(glPointParameterfSGIS, glPointParameterfEXT)
+ GL_STUB_ALIAS(glPointParameterfv, glPointParameterfvEXT)
+ GL_STUB_ALIAS(glPointParameterfvARB, glPointParameterfvEXT)
+ GL_STUB_ALIAS(glPointParameterfvSGIS, glPointParameterfvEXT)
+ GL_STUB_ALIAS(glSecondaryColor3b, glSecondaryColor3bEXT)
+ GL_STUB_ALIAS(glSecondaryColor3bv, glSecondaryColor3bvEXT)
+ GL_STUB_ALIAS(glSecondaryColor3d, glSecondaryColor3dEXT)
+ GL_STUB_ALIAS(glSecondaryColor3dv, glSecondaryColor3dvEXT)
+ GL_STUB_ALIAS(glSecondaryColor3f, glSecondaryColor3fEXT)
+ GL_STUB_ALIAS(glSecondaryColor3fv, glSecondaryColor3fvEXT)
+ GL_STUB_ALIAS(glSecondaryColor3i, glSecondaryColor3iEXT)
+ GL_STUB_ALIAS(glSecondaryColor3iv, glSecondaryColor3ivEXT)
+ GL_STUB_ALIAS(glSecondaryColor3s, glSecondaryColor3sEXT)
+ GL_STUB_ALIAS(glSecondaryColor3sv, glSecondaryColor3svEXT)
+ GL_STUB_ALIAS(glSecondaryColor3ub, glSecondaryColor3ubEXT)
+ GL_STUB_ALIAS(glSecondaryColor3ubv, glSecondaryColor3ubvEXT)
+ GL_STUB_ALIAS(glSecondaryColor3ui, glSecondaryColor3uiEXT)
+ GL_STUB_ALIAS(glSecondaryColor3uiv, glSecondaryColor3uivEXT)
+ GL_STUB_ALIAS(glSecondaryColor3us, glSecondaryColor3usEXT)
+ GL_STUB_ALIAS(glSecondaryColor3usv, glSecondaryColor3usvEXT)
+ GL_STUB_ALIAS(glSecondaryColorPointer, glSecondaryColorPointerEXT)
+ GL_STUB_ALIAS(glMultiDrawArrays, glMultiDrawArraysEXT)
+ GL_STUB_ALIAS(glMultiDrawElements, glMultiDrawElementsEXT)
+ GL_STUB_ALIAS(glFogCoordPointer, glFogCoordPointerEXT)
+ GL_STUB_ALIAS(glFogCoordd, glFogCoorddEXT)
+ GL_STUB_ALIAS(glFogCoorddv, glFogCoorddvEXT)
+ GL_STUB_ALIAS(glFogCoordf, glFogCoordfEXT)
+ GL_STUB_ALIAS(glFogCoordfv, glFogCoordfvEXT)
+ GL_STUB_ALIAS(glBlendFuncSeparate, glBlendFuncSeparateEXT)
+ GL_STUB_ALIAS(glBlendFuncSeparateINGR, glBlendFuncSeparateEXT)
+ GL_STUB_ALIAS(glWindowPos2d, glWindowPos2dMESA)
+ GL_STUB_ALIAS(glWindowPos2dARB, glWindowPos2dMESA)
+ GL_STUB_ALIAS(glWindowPos2dv, glWindowPos2dvMESA)
+ GL_STUB_ALIAS(glWindowPos2dvARB, glWindowPos2dvMESA)
+ GL_STUB_ALIAS(glWindowPos2f, glWindowPos2fMESA)
+ GL_STUB_ALIAS(glWindowPos2fARB, glWindowPos2fMESA)
+ GL_STUB_ALIAS(glWindowPos2fv, glWindowPos2fvMESA)
+ GL_STUB_ALIAS(glWindowPos2fvARB, glWindowPos2fvMESA)
+ GL_STUB_ALIAS(glWindowPos2i, glWindowPos2iMESA)
+ GL_STUB_ALIAS(glWindowPos2iARB, glWindowPos2iMESA)
+ GL_STUB_ALIAS(glWindowPos2iv, glWindowPos2ivMESA)
+ GL_STUB_ALIAS(glWindowPos2ivARB, glWindowPos2ivMESA)
+ GL_STUB_ALIAS(glWindowPos2s, glWindowPos2sMESA)
+ GL_STUB_ALIAS(glWindowPos2sARB, glWindowPos2sMESA)
+ GL_STUB_ALIAS(glWindowPos2sv, glWindowPos2svMESA)
+ GL_STUB_ALIAS(glWindowPos2svARB, glWindowPos2svMESA)
+ GL_STUB_ALIAS(glWindowPos3d, glWindowPos3dMESA)
+ GL_STUB_ALIAS(glWindowPos3dARB, glWindowPos3dMESA)
+ GL_STUB_ALIAS(glWindowPos3dv, glWindowPos3dvMESA)
+ GL_STUB_ALIAS(glWindowPos3dvARB, glWindowPos3dvMESA)
+ GL_STUB_ALIAS(glWindowPos3f, glWindowPos3fMESA)
+ GL_STUB_ALIAS(glWindowPos3fARB, glWindowPos3fMESA)
+ GL_STUB_ALIAS(glWindowPos3fv, glWindowPos3fvMESA)
+ GL_STUB_ALIAS(glWindowPos3fvARB, glWindowPos3fvMESA)
+ GL_STUB_ALIAS(glWindowPos3i, glWindowPos3iMESA)
+ GL_STUB_ALIAS(glWindowPos3iARB, glWindowPos3iMESA)
+ GL_STUB_ALIAS(glWindowPos3iv, glWindowPos3ivMESA)
+ GL_STUB_ALIAS(glWindowPos3ivARB, glWindowPos3ivMESA)
+ GL_STUB_ALIAS(glWindowPos3s, glWindowPos3sMESA)
+ GL_STUB_ALIAS(glWindowPos3sARB, glWindowPos3sMESA)
+ GL_STUB_ALIAS(glWindowPos3sv, glWindowPos3svMESA)
+ GL_STUB_ALIAS(glWindowPos3svARB, glWindowPos3svMESA)
+ GL_STUB_ALIAS(glBindProgramARB, glBindProgramNV)
+ GL_STUB_ALIAS(glDeleteProgramsARB, glDeleteProgramsNV)
+ GL_STUB_ALIAS(glGenProgramsARB, glGenProgramsNV)
+ GL_STUB_ALIAS(glGetVertexAttribPointerv, glGetVertexAttribPointervNV)
+ GL_STUB_ALIAS(glGetVertexAttribPointervARB, glGetVertexAttribPointervNV)
+ GL_STUB_ALIAS(glIsProgramARB, glIsProgramNV)
+ GL_STUB_ALIAS(glPointParameteri, glPointParameteriNV)
+ GL_STUB_ALIAS(glPointParameteriv, glPointParameterivNV)
+ GL_STUB_ALIAS(glPrimitiveRestartIndex, glPrimitiveRestartIndexNV)
+ GL_STUB_ALIAS(glBindFramebuffer, glBindFramebufferEXT)
+ GL_STUB_ALIAS(glBindRenderbuffer, glBindRenderbufferEXT)
+ GL_STUB_ALIAS(glCheckFramebufferStatus, glCheckFramebufferStatusEXT)
+ GL_STUB_ALIAS(glDeleteFramebuffers, glDeleteFramebuffersEXT)
+ GL_STUB_ALIAS(glDeleteRenderbuffers, glDeleteRenderbuffersEXT)
+ GL_STUB_ALIAS(glFramebufferRenderbuffer, glFramebufferRenderbufferEXT)
+ GL_STUB_ALIAS(glFramebufferTexture1D, glFramebufferTexture1DEXT)
+ GL_STUB_ALIAS(glFramebufferTexture2D, glFramebufferTexture2DEXT)
+ GL_STUB_ALIAS(glFramebufferTexture3D, glFramebufferTexture3DEXT)
+ GL_STUB_ALIAS(glGenFramebuffers, glGenFramebuffersEXT)
+ GL_STUB_ALIAS(glGenRenderbuffers, glGenRenderbuffersEXT)
+ GL_STUB_ALIAS(glGenerateMipmap, glGenerateMipmapEXT)
+ GL_STUB_ALIAS(glGetFramebufferAttachmentParameteriv, glGetFramebufferAttachmentParameterivEXT)
+ GL_STUB_ALIAS(glGetRenderbufferParameteriv, glGetRenderbufferParameterivEXT)
+ GL_STUB_ALIAS(glIsFramebuffer, glIsFramebufferEXT)
+ GL_STUB_ALIAS(glIsRenderbuffer, glIsRenderbufferEXT)
+ GL_STUB_ALIAS(glRenderbufferStorage, glRenderbufferStorageEXT)
+ GL_STUB_ALIAS(glBindFragDataLocation, glBindFragDataLocationEXT)
+ GL_STUB_ALIAS(glGetFragDataLocation, glGetFragDataLocationEXT)
+ GL_STUB_ALIAS(glGetUniformuiv, glGetUniformuivEXT)
+ GL_STUB_ALIAS(glGetVertexAttribIiv, glGetVertexAttribIivEXT)
+ GL_STUB_ALIAS(glGetVertexAttribIuiv, glGetVertexAttribIuivEXT)
+ GL_STUB_ALIAS(glUniform1ui, glUniform1uiEXT)
+ GL_STUB_ALIAS(glUniform1uiv, glUniform1uivEXT)
+ GL_STUB_ALIAS(glUniform2ui, glUniform2uiEXT)
+ GL_STUB_ALIAS(glUniform2uiv, glUniform2uivEXT)
+ GL_STUB_ALIAS(glUniform3ui, glUniform3uiEXT)
+ GL_STUB_ALIAS(glUniform3uiv, glUniform3uivEXT)
+ GL_STUB_ALIAS(glUniform4ui, glUniform4uiEXT)
+ GL_STUB_ALIAS(glUniform4uiv, glUniform4uivEXT)
+ GL_STUB_ALIAS(glVertexAttribI1i, glVertexAttribI1iEXT)
+ GL_STUB_ALIAS(glVertexAttribI1iv, glVertexAttribI1ivEXT)
+ GL_STUB_ALIAS(glVertexAttribI1ui, glVertexAttribI1uiEXT)
+ GL_STUB_ALIAS(glVertexAttribI1uiv, glVertexAttribI1uivEXT)
+ GL_STUB_ALIAS(glVertexAttribI2i, glVertexAttribI2iEXT)
+ GL_STUB_ALIAS(glVertexAttribI2iv, glVertexAttribI2ivEXT)
+ GL_STUB_ALIAS(glVertexAttribI2ui, glVertexAttribI2uiEXT)
+ GL_STUB_ALIAS(glVertexAttribI2uiv, glVertexAttribI2uivEXT)
+ GL_STUB_ALIAS(glVertexAttribI3i, glVertexAttribI3iEXT)
+ GL_STUB_ALIAS(glVertexAttribI3iv, glVertexAttribI3ivEXT)
+ GL_STUB_ALIAS(glVertexAttribI3ui, glVertexAttribI3uiEXT)
+ GL_STUB_ALIAS(glVertexAttribI3uiv, glVertexAttribI3uivEXT)
+ GL_STUB_ALIAS(glVertexAttribI4bv, glVertexAttribI4bvEXT)
+ GL_STUB_ALIAS(glVertexAttribI4i, glVertexAttribI4iEXT)
+ GL_STUB_ALIAS(glVertexAttribI4iv, glVertexAttribI4ivEXT)
+ GL_STUB_ALIAS(glVertexAttribI4sv, glVertexAttribI4svEXT)
+ GL_STUB_ALIAS(glVertexAttribI4ubv, glVertexAttribI4ubvEXT)
+ GL_STUB_ALIAS(glVertexAttribI4ui, glVertexAttribI4uiEXT)
+ GL_STUB_ALIAS(glVertexAttribI4uiv, glVertexAttribI4uivEXT)
+ GL_STUB_ALIAS(glVertexAttribI4usv, glVertexAttribI4usvEXT)
+ GL_STUB_ALIAS(glVertexAttribIPointer, glVertexAttribIPointerEXT)
+ GL_STUB_ALIAS(glFramebufferTextureLayer, glFramebufferTextureLayerEXT)
+ GL_STUB_ALIAS(glColorMaski, glColorMaskIndexedEXT)
+ GL_STUB_ALIAS(glDisablei, glDisableIndexedEXT)
+ GL_STUB_ALIAS(glEnablei, glEnableIndexedEXT)
+ GL_STUB_ALIAS(glGetBooleani_v, glGetBooleanIndexedvEXT)
+ GL_STUB_ALIAS(glGetIntegeri_v, glGetIntegerIndexedvEXT)
+ GL_STUB_ALIAS(glIsEnabledi, glIsEnabledIndexedEXT)
+ GL_STUB_ALIAS(glGetTexParameterIiv, glGetTexParameterIivEXT)
+ GL_STUB_ALIAS(glGetTexParameterIuiv, glGetTexParameterIuivEXT)
+ GL_STUB_ALIAS(glTexParameterIiv, glTexParameterIivEXT)
+ GL_STUB_ALIAS(glTexParameterIuiv, glTexParameterIuivEXT)
+ GL_STUB_ALIAS(glBeginConditionalRender, glBeginConditionalRenderNV)
+ GL_STUB_ALIAS(glEndConditionalRender, glEndConditionalRenderNV)
+ GL_STUB_ALIAS(glBeginTransformFeedback, glBeginTransformFeedbackEXT)
+ GL_STUB_ALIAS(glBindBufferBase, glBindBufferBaseEXT)
+ GL_STUB_ALIAS(glBindBufferRange, glBindBufferRangeEXT)
+ GL_STUB_ALIAS(glEndTransformFeedback, glEndTransformFeedbackEXT)
+ GL_STUB_ALIAS(glGetTransformFeedbackVarying, glGetTransformFeedbackVaryingEXT)
+ GL_STUB_ALIAS(glTransformFeedbackVaryings, glTransformFeedbackVaryingsEXT)
+ GL_STUB_ALIAS(glProvokingVertex, glProvokingVertexEXT)
+
+ .globl gl_dispatch_functions_end
+ HIDDEN(gl_dispatch_functions_end)
+gl_dispatch_functions_end:
diff --git a/mesalib/src/mapi/glapi/glapi_x86-64.S b/mesalib/src/mapi/glapi/glapi_x86-64.S
index ec7a2c5cc..c1473c789 100644
--- a/mesalib/src/mapi/glapi/glapi_x86-64.S
+++ b/mesalib/src/mapi/glapi/glapi_x86-64.S
@@ -1,35647 +1,35647 @@
-/* DO NOT EDIT - This file generated automatically by gl_x86-64_asm.py (from Mesa) script */
-
-/*
- * (C) Copyright IBM Corporation 2005
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sub license,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
- * IBM,
- * AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
- * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-/* If we build with gcc's -fvisibility=hidden flag, we'll need to change
- * the symbol visibility mode to 'default'.
- */
-
-#include "x86/assyntax.h"
-
-#ifdef __GNUC__
-# pragma GCC visibility push(default)
-# define HIDDEN(x) .hidden x
-#else
-# define HIDDEN(x)
-#endif
-
-# if defined(USE_MGL_NAMESPACE)
-# define GL_PREFIX(n) GLNAME(CONCAT(mgl,n))
-# define _glapi_Dispatch _mglapi_Dispatch
-# else
-# define GL_PREFIX(n) GLNAME(CONCAT(gl,n))
-# endif
-
-#if defined(PTHREADS) || defined(WIN32) || defined(BEOS_THREADS)
-# define THREADS
-#endif
-
- .text
-
-#ifdef GLX_USE_TLS
-
- .globl _x86_64_get_get_dispatch; HIDDEN(_x86_64_get_get_dispatch)
-_x86_64_get_get_dispatch:
- lea _x86_64_get_dispatch(%rip), %rax
- ret
-
- .p2align 4,,15
-_x86_64_get_dispatch:
- movq _glapi_tls_Dispatch@GOTTPOFF(%rip), %rax
- movq %fs:(%rax), %rax
- ret
- .size _x86_64_get_dispatch, .-_x86_64_get_dispatch
-
-#elif defined(PTHREADS)
-
- .extern _glapi_Dispatch
- .extern _gl_DispatchTSD
- .extern pthread_getspecific
-
- .p2align 4,,15
-_x86_64_get_dispatch:
- movq _gl_DispatchTSD@GOTPCREL(%rip), %rax
- movl (%rax), %edi
- jmp pthread_getspecific@PLT
-
-#elif defined(THREADS)
-
- .extern _glapi_get_dispatch
-
-#endif
-
- .p2align 4,,15
- .globl GL_PREFIX(NewList)
- .type GL_PREFIX(NewList), @function
-GL_PREFIX(NewList):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 0(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq (%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 0(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 0(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(NewList), .-GL_PREFIX(NewList)
-
- .p2align 4,,15
- .globl GL_PREFIX(EndList)
- .type GL_PREFIX(EndList), @function
-GL_PREFIX(EndList):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 8(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- movq 8(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 8(%rax), %r11
- jmp *%r11
-1:
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- movq 8(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(EndList), .-GL_PREFIX(EndList)
-
- .p2align 4,,15
- .globl GL_PREFIX(CallList)
- .type GL_PREFIX(CallList), @function
-GL_PREFIX(CallList):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 16(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 16(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 16(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 16(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(CallList), .-GL_PREFIX(CallList)
-
- .p2align 4,,15
- .globl GL_PREFIX(CallLists)
- .type GL_PREFIX(CallLists), @function
-GL_PREFIX(CallLists):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 24(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 24(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 24(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 24(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(CallLists), .-GL_PREFIX(CallLists)
-
- .p2align 4,,15
- .globl GL_PREFIX(DeleteLists)
- .type GL_PREFIX(DeleteLists), @function
-GL_PREFIX(DeleteLists):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 32(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 32(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 32(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 32(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(DeleteLists), .-GL_PREFIX(DeleteLists)
-
- .p2align 4,,15
- .globl GL_PREFIX(GenLists)
- .type GL_PREFIX(GenLists), @function
-GL_PREFIX(GenLists):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 40(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 40(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 40(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 40(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GenLists), .-GL_PREFIX(GenLists)
-
- .p2align 4,,15
- .globl GL_PREFIX(ListBase)
- .type GL_PREFIX(ListBase), @function
-GL_PREFIX(ListBase):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 48(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 48(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 48(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 48(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(ListBase), .-GL_PREFIX(ListBase)
-
- .p2align 4,,15
- .globl GL_PREFIX(Begin)
- .type GL_PREFIX(Begin), @function
-GL_PREFIX(Begin):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 56(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 56(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 56(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 56(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Begin), .-GL_PREFIX(Begin)
-
- .p2align 4,,15
- .globl GL_PREFIX(Bitmap)
- .type GL_PREFIX(Bitmap), @function
-GL_PREFIX(Bitmap):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 64(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $56, %rsp
- movq %rdi, (%rsp)
- movq %rsi, 8(%rsp)
- movq %xmm0, 16(%rsp)
- movq %xmm1, 24(%rsp)
- movq %xmm2, 32(%rsp)
- movq %xmm3, 40(%rsp)
- movq %rdx, 48(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 48(%rsp), %rdx
- movq 40(%rsp), %xmm3
- movq 32(%rsp), %xmm2
- movq 24(%rsp), %xmm1
- movq 16(%rsp), %xmm0
- movq 8(%rsp), %rsi
- movq (%rsp), %rdi
- addq $56, %rsp
- movq 64(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 64(%rax), %r11
- jmp *%r11
-1:
- subq $56, %rsp
- movq %rdi, (%rsp)
- movq %rsi, 8(%rsp)
- movq %xmm0, 16(%rsp)
- movq %xmm1, 24(%rsp)
- movq %xmm2, 32(%rsp)
- movq %xmm3, 40(%rsp)
- movq %rdx, 48(%rsp)
- call _glapi_get_dispatch
- movq 48(%rsp), %rdx
- movq 40(%rsp), %xmm3
- movq 32(%rsp), %xmm2
- movq 24(%rsp), %xmm1
- movq 16(%rsp), %xmm0
- movq 8(%rsp), %rsi
- movq (%rsp), %rdi
- addq $56, %rsp
- movq 64(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Bitmap), .-GL_PREFIX(Bitmap)
-
- .p2align 4,,15
- .globl GL_PREFIX(Color3b)
- .type GL_PREFIX(Color3b), @function
-GL_PREFIX(Color3b):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 72(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 72(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 72(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 72(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Color3b), .-GL_PREFIX(Color3b)
-
- .p2align 4,,15
- .globl GL_PREFIX(Color3bv)
- .type GL_PREFIX(Color3bv), @function
-GL_PREFIX(Color3bv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 80(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 80(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 80(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 80(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Color3bv), .-GL_PREFIX(Color3bv)
-
- .p2align 4,,15
- .globl GL_PREFIX(Color3d)
- .type GL_PREFIX(Color3d), @function
-GL_PREFIX(Color3d):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 88(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $24, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- movq %xmm2, 16(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 16(%rsp), %xmm2
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $24, %rsp
- movq 88(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 88(%rax), %r11
- jmp *%r11
-1:
- subq $24, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- movq %xmm2, 16(%rsp)
- call _glapi_get_dispatch
- movq 16(%rsp), %xmm2
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $24, %rsp
- movq 88(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Color3d), .-GL_PREFIX(Color3d)
-
- .p2align 4,,15
- .globl GL_PREFIX(Color3dv)
- .type GL_PREFIX(Color3dv), @function
-GL_PREFIX(Color3dv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 96(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 96(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 96(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 96(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Color3dv), .-GL_PREFIX(Color3dv)
-
- .p2align 4,,15
- .globl GL_PREFIX(Color3f)
- .type GL_PREFIX(Color3f), @function
-GL_PREFIX(Color3f):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 104(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $24, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- movq %xmm2, 16(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 16(%rsp), %xmm2
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $24, %rsp
- movq 104(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 104(%rax), %r11
- jmp *%r11
-1:
- subq $24, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- movq %xmm2, 16(%rsp)
- call _glapi_get_dispatch
- movq 16(%rsp), %xmm2
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $24, %rsp
- movq 104(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Color3f), .-GL_PREFIX(Color3f)
-
- .p2align 4,,15
- .globl GL_PREFIX(Color3fv)
- .type GL_PREFIX(Color3fv), @function
-GL_PREFIX(Color3fv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 112(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 112(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 112(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 112(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Color3fv), .-GL_PREFIX(Color3fv)
-
- .p2align 4,,15
- .globl GL_PREFIX(Color3i)
- .type GL_PREFIX(Color3i), @function
-GL_PREFIX(Color3i):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 120(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 120(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 120(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 120(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Color3i), .-GL_PREFIX(Color3i)
-
- .p2align 4,,15
- .globl GL_PREFIX(Color3iv)
- .type GL_PREFIX(Color3iv), @function
-GL_PREFIX(Color3iv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 128(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 128(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 128(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 128(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Color3iv), .-GL_PREFIX(Color3iv)
-
- .p2align 4,,15
- .globl GL_PREFIX(Color3s)
- .type GL_PREFIX(Color3s), @function
-GL_PREFIX(Color3s):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 136(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 136(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 136(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 136(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Color3s), .-GL_PREFIX(Color3s)
-
- .p2align 4,,15
- .globl GL_PREFIX(Color3sv)
- .type GL_PREFIX(Color3sv), @function
-GL_PREFIX(Color3sv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 144(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 144(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 144(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 144(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Color3sv), .-GL_PREFIX(Color3sv)
-
- .p2align 4,,15
- .globl GL_PREFIX(Color3ub)
- .type GL_PREFIX(Color3ub), @function
-GL_PREFIX(Color3ub):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 152(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 152(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 152(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 152(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Color3ub), .-GL_PREFIX(Color3ub)
-
- .p2align 4,,15
- .globl GL_PREFIX(Color3ubv)
- .type GL_PREFIX(Color3ubv), @function
-GL_PREFIX(Color3ubv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 160(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 160(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 160(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 160(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Color3ubv), .-GL_PREFIX(Color3ubv)
-
- .p2align 4,,15
- .globl GL_PREFIX(Color3ui)
- .type GL_PREFIX(Color3ui), @function
-GL_PREFIX(Color3ui):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 168(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 168(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 168(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 168(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Color3ui), .-GL_PREFIX(Color3ui)
-
- .p2align 4,,15
- .globl GL_PREFIX(Color3uiv)
- .type GL_PREFIX(Color3uiv), @function
-GL_PREFIX(Color3uiv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 176(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 176(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 176(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 176(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Color3uiv), .-GL_PREFIX(Color3uiv)
-
- .p2align 4,,15
- .globl GL_PREFIX(Color3us)
- .type GL_PREFIX(Color3us), @function
-GL_PREFIX(Color3us):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 184(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 184(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 184(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 184(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Color3us), .-GL_PREFIX(Color3us)
-
- .p2align 4,,15
- .globl GL_PREFIX(Color3usv)
- .type GL_PREFIX(Color3usv), @function
-GL_PREFIX(Color3usv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 192(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 192(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 192(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 192(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Color3usv), .-GL_PREFIX(Color3usv)
-
- .p2align 4,,15
- .globl GL_PREFIX(Color4b)
- .type GL_PREFIX(Color4b), @function
-GL_PREFIX(Color4b):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 200(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 200(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 200(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 200(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Color4b), .-GL_PREFIX(Color4b)
-
- .p2align 4,,15
- .globl GL_PREFIX(Color4bv)
- .type GL_PREFIX(Color4bv), @function
-GL_PREFIX(Color4bv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 208(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 208(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 208(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 208(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Color4bv), .-GL_PREFIX(Color4bv)
-
- .p2align 4,,15
- .globl GL_PREFIX(Color4d)
- .type GL_PREFIX(Color4d), @function
-GL_PREFIX(Color4d):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 216(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $40, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- movq %xmm2, 16(%rsp)
- movq %xmm3, 24(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 24(%rsp), %xmm3
- movq 16(%rsp), %xmm2
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $40, %rsp
- movq 216(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 216(%rax), %r11
- jmp *%r11
-1:
- subq $40, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- movq %xmm2, 16(%rsp)
- movq %xmm3, 24(%rsp)
- call _glapi_get_dispatch
- movq 24(%rsp), %xmm3
- movq 16(%rsp), %xmm2
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $40, %rsp
- movq 216(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Color4d), .-GL_PREFIX(Color4d)
-
- .p2align 4,,15
- .globl GL_PREFIX(Color4dv)
- .type GL_PREFIX(Color4dv), @function
-GL_PREFIX(Color4dv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 224(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 224(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 224(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 224(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Color4dv), .-GL_PREFIX(Color4dv)
-
- .p2align 4,,15
- .globl GL_PREFIX(Color4f)
- .type GL_PREFIX(Color4f), @function
-GL_PREFIX(Color4f):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 232(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $40, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- movq %xmm2, 16(%rsp)
- movq %xmm3, 24(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 24(%rsp), %xmm3
- movq 16(%rsp), %xmm2
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $40, %rsp
- movq 232(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 232(%rax), %r11
- jmp *%r11
-1:
- subq $40, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- movq %xmm2, 16(%rsp)
- movq %xmm3, 24(%rsp)
- call _glapi_get_dispatch
- movq 24(%rsp), %xmm3
- movq 16(%rsp), %xmm2
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $40, %rsp
- movq 232(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Color4f), .-GL_PREFIX(Color4f)
-
- .p2align 4,,15
- .globl GL_PREFIX(Color4fv)
- .type GL_PREFIX(Color4fv), @function
-GL_PREFIX(Color4fv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 240(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 240(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 240(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 240(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Color4fv), .-GL_PREFIX(Color4fv)
-
- .p2align 4,,15
- .globl GL_PREFIX(Color4i)
- .type GL_PREFIX(Color4i), @function
-GL_PREFIX(Color4i):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 248(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 248(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 248(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 248(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Color4i), .-GL_PREFIX(Color4i)
-
- .p2align 4,,15
- .globl GL_PREFIX(Color4iv)
- .type GL_PREFIX(Color4iv), @function
-GL_PREFIX(Color4iv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 256(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 256(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 256(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 256(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Color4iv), .-GL_PREFIX(Color4iv)
-
- .p2align 4,,15
- .globl GL_PREFIX(Color4s)
- .type GL_PREFIX(Color4s), @function
-GL_PREFIX(Color4s):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 264(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 264(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 264(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 264(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Color4s), .-GL_PREFIX(Color4s)
-
- .p2align 4,,15
- .globl GL_PREFIX(Color4sv)
- .type GL_PREFIX(Color4sv), @function
-GL_PREFIX(Color4sv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 272(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 272(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 272(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 272(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Color4sv), .-GL_PREFIX(Color4sv)
-
- .p2align 4,,15
- .globl GL_PREFIX(Color4ub)
- .type GL_PREFIX(Color4ub), @function
-GL_PREFIX(Color4ub):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 280(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 280(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 280(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 280(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Color4ub), .-GL_PREFIX(Color4ub)
-
- .p2align 4,,15
- .globl GL_PREFIX(Color4ubv)
- .type GL_PREFIX(Color4ubv), @function
-GL_PREFIX(Color4ubv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 288(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 288(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 288(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 288(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Color4ubv), .-GL_PREFIX(Color4ubv)
-
- .p2align 4,,15
- .globl GL_PREFIX(Color4ui)
- .type GL_PREFIX(Color4ui), @function
-GL_PREFIX(Color4ui):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 296(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 296(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 296(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 296(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Color4ui), .-GL_PREFIX(Color4ui)
-
- .p2align 4,,15
- .globl GL_PREFIX(Color4uiv)
- .type GL_PREFIX(Color4uiv), @function
-GL_PREFIX(Color4uiv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 304(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 304(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 304(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 304(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Color4uiv), .-GL_PREFIX(Color4uiv)
-
- .p2align 4,,15
- .globl GL_PREFIX(Color4us)
- .type GL_PREFIX(Color4us), @function
-GL_PREFIX(Color4us):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 312(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 312(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 312(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 312(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Color4us), .-GL_PREFIX(Color4us)
-
- .p2align 4,,15
- .globl GL_PREFIX(Color4usv)
- .type GL_PREFIX(Color4usv), @function
-GL_PREFIX(Color4usv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 320(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 320(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 320(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 320(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Color4usv), .-GL_PREFIX(Color4usv)
-
- .p2align 4,,15
- .globl GL_PREFIX(EdgeFlag)
- .type GL_PREFIX(EdgeFlag), @function
-GL_PREFIX(EdgeFlag):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 328(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 328(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 328(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 328(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(EdgeFlag), .-GL_PREFIX(EdgeFlag)
-
- .p2align 4,,15
- .globl GL_PREFIX(EdgeFlagv)
- .type GL_PREFIX(EdgeFlagv), @function
-GL_PREFIX(EdgeFlagv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 336(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 336(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 336(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 336(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(EdgeFlagv), .-GL_PREFIX(EdgeFlagv)
-
- .p2align 4,,15
- .globl GL_PREFIX(End)
- .type GL_PREFIX(End), @function
-GL_PREFIX(End):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 344(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- movq 344(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 344(%rax), %r11
- jmp *%r11
-1:
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- movq 344(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(End), .-GL_PREFIX(End)
-
- .p2align 4,,15
- .globl GL_PREFIX(Indexd)
- .type GL_PREFIX(Indexd), @function
-GL_PREFIX(Indexd):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 352(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $8, %rsp
- movq %xmm0, (%rsp)
- call _x86_64_get_dispatch@PLT
- movq (%rsp), %xmm0
- addq $8, %rsp
- movq 352(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 352(%rax), %r11
- jmp *%r11
-1:
- subq $8, %rsp
- movq %xmm0, (%rsp)
- call _glapi_get_dispatch
- movq (%rsp), %xmm0
- addq $8, %rsp
- movq 352(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Indexd), .-GL_PREFIX(Indexd)
-
- .p2align 4,,15
- .globl GL_PREFIX(Indexdv)
- .type GL_PREFIX(Indexdv), @function
-GL_PREFIX(Indexdv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 360(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 360(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 360(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 360(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Indexdv), .-GL_PREFIX(Indexdv)
-
- .p2align 4,,15
- .globl GL_PREFIX(Indexf)
- .type GL_PREFIX(Indexf), @function
-GL_PREFIX(Indexf):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 368(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $8, %rsp
- movq %xmm0, (%rsp)
- call _x86_64_get_dispatch@PLT
- movq (%rsp), %xmm0
- addq $8, %rsp
- movq 368(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 368(%rax), %r11
- jmp *%r11
-1:
- subq $8, %rsp
- movq %xmm0, (%rsp)
- call _glapi_get_dispatch
- movq (%rsp), %xmm0
- addq $8, %rsp
- movq 368(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Indexf), .-GL_PREFIX(Indexf)
-
- .p2align 4,,15
- .globl GL_PREFIX(Indexfv)
- .type GL_PREFIX(Indexfv), @function
-GL_PREFIX(Indexfv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 376(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 376(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 376(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 376(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Indexfv), .-GL_PREFIX(Indexfv)
-
- .p2align 4,,15
- .globl GL_PREFIX(Indexi)
- .type GL_PREFIX(Indexi), @function
-GL_PREFIX(Indexi):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 384(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 384(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 384(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 384(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Indexi), .-GL_PREFIX(Indexi)
-
- .p2align 4,,15
- .globl GL_PREFIX(Indexiv)
- .type GL_PREFIX(Indexiv), @function
-GL_PREFIX(Indexiv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 392(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 392(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 392(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 392(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Indexiv), .-GL_PREFIX(Indexiv)
-
- .p2align 4,,15
- .globl GL_PREFIX(Indexs)
- .type GL_PREFIX(Indexs), @function
-GL_PREFIX(Indexs):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 400(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 400(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 400(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 400(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Indexs), .-GL_PREFIX(Indexs)
-
- .p2align 4,,15
- .globl GL_PREFIX(Indexsv)
- .type GL_PREFIX(Indexsv), @function
-GL_PREFIX(Indexsv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 408(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 408(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 408(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 408(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Indexsv), .-GL_PREFIX(Indexsv)
-
- .p2align 4,,15
- .globl GL_PREFIX(Normal3b)
- .type GL_PREFIX(Normal3b), @function
-GL_PREFIX(Normal3b):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 416(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 416(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 416(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 416(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Normal3b), .-GL_PREFIX(Normal3b)
-
- .p2align 4,,15
- .globl GL_PREFIX(Normal3bv)
- .type GL_PREFIX(Normal3bv), @function
-GL_PREFIX(Normal3bv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 424(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 424(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 424(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 424(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Normal3bv), .-GL_PREFIX(Normal3bv)
-
- .p2align 4,,15
- .globl GL_PREFIX(Normal3d)
- .type GL_PREFIX(Normal3d), @function
-GL_PREFIX(Normal3d):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 432(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $24, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- movq %xmm2, 16(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 16(%rsp), %xmm2
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $24, %rsp
- movq 432(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 432(%rax), %r11
- jmp *%r11
-1:
- subq $24, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- movq %xmm2, 16(%rsp)
- call _glapi_get_dispatch
- movq 16(%rsp), %xmm2
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $24, %rsp
- movq 432(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Normal3d), .-GL_PREFIX(Normal3d)
-
- .p2align 4,,15
- .globl GL_PREFIX(Normal3dv)
- .type GL_PREFIX(Normal3dv), @function
-GL_PREFIX(Normal3dv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 440(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 440(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 440(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 440(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Normal3dv), .-GL_PREFIX(Normal3dv)
-
- .p2align 4,,15
- .globl GL_PREFIX(Normal3f)
- .type GL_PREFIX(Normal3f), @function
-GL_PREFIX(Normal3f):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 448(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $24, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- movq %xmm2, 16(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 16(%rsp), %xmm2
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $24, %rsp
- movq 448(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 448(%rax), %r11
- jmp *%r11
-1:
- subq $24, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- movq %xmm2, 16(%rsp)
- call _glapi_get_dispatch
- movq 16(%rsp), %xmm2
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $24, %rsp
- movq 448(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Normal3f), .-GL_PREFIX(Normal3f)
-
- .p2align 4,,15
- .globl GL_PREFIX(Normal3fv)
- .type GL_PREFIX(Normal3fv), @function
-GL_PREFIX(Normal3fv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 456(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 456(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 456(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 456(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Normal3fv), .-GL_PREFIX(Normal3fv)
-
- .p2align 4,,15
- .globl GL_PREFIX(Normal3i)
- .type GL_PREFIX(Normal3i), @function
-GL_PREFIX(Normal3i):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 464(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 464(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 464(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 464(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Normal3i), .-GL_PREFIX(Normal3i)
-
- .p2align 4,,15
- .globl GL_PREFIX(Normal3iv)
- .type GL_PREFIX(Normal3iv), @function
-GL_PREFIX(Normal3iv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 472(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 472(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 472(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 472(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Normal3iv), .-GL_PREFIX(Normal3iv)
-
- .p2align 4,,15
- .globl GL_PREFIX(Normal3s)
- .type GL_PREFIX(Normal3s), @function
-GL_PREFIX(Normal3s):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 480(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 480(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 480(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 480(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Normal3s), .-GL_PREFIX(Normal3s)
-
- .p2align 4,,15
- .globl GL_PREFIX(Normal3sv)
- .type GL_PREFIX(Normal3sv), @function
-GL_PREFIX(Normal3sv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 488(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 488(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 488(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 488(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Normal3sv), .-GL_PREFIX(Normal3sv)
-
- .p2align 4,,15
- .globl GL_PREFIX(RasterPos2d)
- .type GL_PREFIX(RasterPos2d), @function
-GL_PREFIX(RasterPos2d):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 496(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $24, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $24, %rsp
- movq 496(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 496(%rax), %r11
- jmp *%r11
-1:
- subq $24, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- call _glapi_get_dispatch
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $24, %rsp
- movq 496(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(RasterPos2d), .-GL_PREFIX(RasterPos2d)
-
- .p2align 4,,15
- .globl GL_PREFIX(RasterPos2dv)
- .type GL_PREFIX(RasterPos2dv), @function
-GL_PREFIX(RasterPos2dv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 504(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 504(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 504(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 504(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(RasterPos2dv), .-GL_PREFIX(RasterPos2dv)
-
- .p2align 4,,15
- .globl GL_PREFIX(RasterPos2f)
- .type GL_PREFIX(RasterPos2f), @function
-GL_PREFIX(RasterPos2f):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 512(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $24, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $24, %rsp
- movq 512(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 512(%rax), %r11
- jmp *%r11
-1:
- subq $24, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- call _glapi_get_dispatch
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $24, %rsp
- movq 512(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(RasterPos2f), .-GL_PREFIX(RasterPos2f)
-
- .p2align 4,,15
- .globl GL_PREFIX(RasterPos2fv)
- .type GL_PREFIX(RasterPos2fv), @function
-GL_PREFIX(RasterPos2fv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 520(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 520(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 520(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 520(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(RasterPos2fv), .-GL_PREFIX(RasterPos2fv)
-
- .p2align 4,,15
- .globl GL_PREFIX(RasterPos2i)
- .type GL_PREFIX(RasterPos2i), @function
-GL_PREFIX(RasterPos2i):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 528(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 528(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 528(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 528(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(RasterPos2i), .-GL_PREFIX(RasterPos2i)
-
- .p2align 4,,15
- .globl GL_PREFIX(RasterPos2iv)
- .type GL_PREFIX(RasterPos2iv), @function
-GL_PREFIX(RasterPos2iv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 536(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 536(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 536(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 536(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(RasterPos2iv), .-GL_PREFIX(RasterPos2iv)
-
- .p2align 4,,15
- .globl GL_PREFIX(RasterPos2s)
- .type GL_PREFIX(RasterPos2s), @function
-GL_PREFIX(RasterPos2s):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 544(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 544(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 544(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 544(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(RasterPos2s), .-GL_PREFIX(RasterPos2s)
-
- .p2align 4,,15
- .globl GL_PREFIX(RasterPos2sv)
- .type GL_PREFIX(RasterPos2sv), @function
-GL_PREFIX(RasterPos2sv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 552(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 552(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 552(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 552(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(RasterPos2sv), .-GL_PREFIX(RasterPos2sv)
-
- .p2align 4,,15
- .globl GL_PREFIX(RasterPos3d)
- .type GL_PREFIX(RasterPos3d), @function
-GL_PREFIX(RasterPos3d):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 560(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $24, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- movq %xmm2, 16(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 16(%rsp), %xmm2
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $24, %rsp
- movq 560(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 560(%rax), %r11
- jmp *%r11
-1:
- subq $24, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- movq %xmm2, 16(%rsp)
- call _glapi_get_dispatch
- movq 16(%rsp), %xmm2
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $24, %rsp
- movq 560(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(RasterPos3d), .-GL_PREFIX(RasterPos3d)
-
- .p2align 4,,15
- .globl GL_PREFIX(RasterPos3dv)
- .type GL_PREFIX(RasterPos3dv), @function
-GL_PREFIX(RasterPos3dv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 568(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 568(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 568(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 568(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(RasterPos3dv), .-GL_PREFIX(RasterPos3dv)
-
- .p2align 4,,15
- .globl GL_PREFIX(RasterPos3f)
- .type GL_PREFIX(RasterPos3f), @function
-GL_PREFIX(RasterPos3f):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 576(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $24, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- movq %xmm2, 16(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 16(%rsp), %xmm2
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $24, %rsp
- movq 576(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 576(%rax), %r11
- jmp *%r11
-1:
- subq $24, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- movq %xmm2, 16(%rsp)
- call _glapi_get_dispatch
- movq 16(%rsp), %xmm2
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $24, %rsp
- movq 576(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(RasterPos3f), .-GL_PREFIX(RasterPos3f)
-
- .p2align 4,,15
- .globl GL_PREFIX(RasterPos3fv)
- .type GL_PREFIX(RasterPos3fv), @function
-GL_PREFIX(RasterPos3fv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 584(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 584(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 584(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 584(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(RasterPos3fv), .-GL_PREFIX(RasterPos3fv)
-
- .p2align 4,,15
- .globl GL_PREFIX(RasterPos3i)
- .type GL_PREFIX(RasterPos3i), @function
-GL_PREFIX(RasterPos3i):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 592(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 592(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 592(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 592(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(RasterPos3i), .-GL_PREFIX(RasterPos3i)
-
- .p2align 4,,15
- .globl GL_PREFIX(RasterPos3iv)
- .type GL_PREFIX(RasterPos3iv), @function
-GL_PREFIX(RasterPos3iv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 600(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 600(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 600(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 600(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(RasterPos3iv), .-GL_PREFIX(RasterPos3iv)
-
- .p2align 4,,15
- .globl GL_PREFIX(RasterPos3s)
- .type GL_PREFIX(RasterPos3s), @function
-GL_PREFIX(RasterPos3s):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 608(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 608(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 608(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 608(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(RasterPos3s), .-GL_PREFIX(RasterPos3s)
-
- .p2align 4,,15
- .globl GL_PREFIX(RasterPos3sv)
- .type GL_PREFIX(RasterPos3sv), @function
-GL_PREFIX(RasterPos3sv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 616(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 616(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 616(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 616(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(RasterPos3sv), .-GL_PREFIX(RasterPos3sv)
-
- .p2align 4,,15
- .globl GL_PREFIX(RasterPos4d)
- .type GL_PREFIX(RasterPos4d), @function
-GL_PREFIX(RasterPos4d):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 624(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $40, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- movq %xmm2, 16(%rsp)
- movq %xmm3, 24(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 24(%rsp), %xmm3
- movq 16(%rsp), %xmm2
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $40, %rsp
- movq 624(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 624(%rax), %r11
- jmp *%r11
-1:
- subq $40, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- movq %xmm2, 16(%rsp)
- movq %xmm3, 24(%rsp)
- call _glapi_get_dispatch
- movq 24(%rsp), %xmm3
- movq 16(%rsp), %xmm2
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $40, %rsp
- movq 624(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(RasterPos4d), .-GL_PREFIX(RasterPos4d)
-
- .p2align 4,,15
- .globl GL_PREFIX(RasterPos4dv)
- .type GL_PREFIX(RasterPos4dv), @function
-GL_PREFIX(RasterPos4dv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 632(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 632(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 632(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 632(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(RasterPos4dv), .-GL_PREFIX(RasterPos4dv)
-
- .p2align 4,,15
- .globl GL_PREFIX(RasterPos4f)
- .type GL_PREFIX(RasterPos4f), @function
-GL_PREFIX(RasterPos4f):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 640(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $40, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- movq %xmm2, 16(%rsp)
- movq %xmm3, 24(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 24(%rsp), %xmm3
- movq 16(%rsp), %xmm2
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $40, %rsp
- movq 640(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 640(%rax), %r11
- jmp *%r11
-1:
- subq $40, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- movq %xmm2, 16(%rsp)
- movq %xmm3, 24(%rsp)
- call _glapi_get_dispatch
- movq 24(%rsp), %xmm3
- movq 16(%rsp), %xmm2
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $40, %rsp
- movq 640(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(RasterPos4f), .-GL_PREFIX(RasterPos4f)
-
- .p2align 4,,15
- .globl GL_PREFIX(RasterPos4fv)
- .type GL_PREFIX(RasterPos4fv), @function
-GL_PREFIX(RasterPos4fv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 648(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 648(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 648(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 648(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(RasterPos4fv), .-GL_PREFIX(RasterPos4fv)
-
- .p2align 4,,15
- .globl GL_PREFIX(RasterPos4i)
- .type GL_PREFIX(RasterPos4i), @function
-GL_PREFIX(RasterPos4i):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 656(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 656(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 656(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 656(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(RasterPos4i), .-GL_PREFIX(RasterPos4i)
-
- .p2align 4,,15
- .globl GL_PREFIX(RasterPos4iv)
- .type GL_PREFIX(RasterPos4iv), @function
-GL_PREFIX(RasterPos4iv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 664(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 664(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 664(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 664(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(RasterPos4iv), .-GL_PREFIX(RasterPos4iv)
-
- .p2align 4,,15
- .globl GL_PREFIX(RasterPos4s)
- .type GL_PREFIX(RasterPos4s), @function
-GL_PREFIX(RasterPos4s):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 672(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 672(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 672(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 672(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(RasterPos4s), .-GL_PREFIX(RasterPos4s)
-
- .p2align 4,,15
- .globl GL_PREFIX(RasterPos4sv)
- .type GL_PREFIX(RasterPos4sv), @function
-GL_PREFIX(RasterPos4sv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 680(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 680(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 680(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 680(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(RasterPos4sv), .-GL_PREFIX(RasterPos4sv)
-
- .p2align 4,,15
- .globl GL_PREFIX(Rectd)
- .type GL_PREFIX(Rectd), @function
-GL_PREFIX(Rectd):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 688(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $40, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- movq %xmm2, 16(%rsp)
- movq %xmm3, 24(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 24(%rsp), %xmm3
- movq 16(%rsp), %xmm2
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $40, %rsp
- movq 688(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 688(%rax), %r11
- jmp *%r11
-1:
- subq $40, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- movq %xmm2, 16(%rsp)
- movq %xmm3, 24(%rsp)
- call _glapi_get_dispatch
- movq 24(%rsp), %xmm3
- movq 16(%rsp), %xmm2
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $40, %rsp
- movq 688(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Rectd), .-GL_PREFIX(Rectd)
-
- .p2align 4,,15
- .globl GL_PREFIX(Rectdv)
- .type GL_PREFIX(Rectdv), @function
-GL_PREFIX(Rectdv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 696(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 696(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 696(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 696(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Rectdv), .-GL_PREFIX(Rectdv)
-
- .p2align 4,,15
- .globl GL_PREFIX(Rectf)
- .type GL_PREFIX(Rectf), @function
-GL_PREFIX(Rectf):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 704(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $40, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- movq %xmm2, 16(%rsp)
- movq %xmm3, 24(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 24(%rsp), %xmm3
- movq 16(%rsp), %xmm2
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $40, %rsp
- movq 704(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 704(%rax), %r11
- jmp *%r11
-1:
- subq $40, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- movq %xmm2, 16(%rsp)
- movq %xmm3, 24(%rsp)
- call _glapi_get_dispatch
- movq 24(%rsp), %xmm3
- movq 16(%rsp), %xmm2
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $40, %rsp
- movq 704(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Rectf), .-GL_PREFIX(Rectf)
-
- .p2align 4,,15
- .globl GL_PREFIX(Rectfv)
- .type GL_PREFIX(Rectfv), @function
-GL_PREFIX(Rectfv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 712(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 712(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 712(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 712(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Rectfv), .-GL_PREFIX(Rectfv)
-
- .p2align 4,,15
- .globl GL_PREFIX(Recti)
- .type GL_PREFIX(Recti), @function
-GL_PREFIX(Recti):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 720(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 720(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 720(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 720(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Recti), .-GL_PREFIX(Recti)
-
- .p2align 4,,15
- .globl GL_PREFIX(Rectiv)
- .type GL_PREFIX(Rectiv), @function
-GL_PREFIX(Rectiv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 728(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 728(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 728(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 728(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Rectiv), .-GL_PREFIX(Rectiv)
-
- .p2align 4,,15
- .globl GL_PREFIX(Rects)
- .type GL_PREFIX(Rects), @function
-GL_PREFIX(Rects):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 736(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 736(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 736(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 736(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Rects), .-GL_PREFIX(Rects)
-
- .p2align 4,,15
- .globl GL_PREFIX(Rectsv)
- .type GL_PREFIX(Rectsv), @function
-GL_PREFIX(Rectsv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 744(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 744(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 744(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 744(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Rectsv), .-GL_PREFIX(Rectsv)
-
- .p2align 4,,15
- .globl GL_PREFIX(TexCoord1d)
- .type GL_PREFIX(TexCoord1d), @function
-GL_PREFIX(TexCoord1d):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 752(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $8, %rsp
- movq %xmm0, (%rsp)
- call _x86_64_get_dispatch@PLT
- movq (%rsp), %xmm0
- addq $8, %rsp
- movq 752(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 752(%rax), %r11
- jmp *%r11
-1:
- subq $8, %rsp
- movq %xmm0, (%rsp)
- call _glapi_get_dispatch
- movq (%rsp), %xmm0
- addq $8, %rsp
- movq 752(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(TexCoord1d), .-GL_PREFIX(TexCoord1d)
-
- .p2align 4,,15
- .globl GL_PREFIX(TexCoord1dv)
- .type GL_PREFIX(TexCoord1dv), @function
-GL_PREFIX(TexCoord1dv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 760(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 760(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 760(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 760(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(TexCoord1dv), .-GL_PREFIX(TexCoord1dv)
-
- .p2align 4,,15
- .globl GL_PREFIX(TexCoord1f)
- .type GL_PREFIX(TexCoord1f), @function
-GL_PREFIX(TexCoord1f):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 768(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $8, %rsp
- movq %xmm0, (%rsp)
- call _x86_64_get_dispatch@PLT
- movq (%rsp), %xmm0
- addq $8, %rsp
- movq 768(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 768(%rax), %r11
- jmp *%r11
-1:
- subq $8, %rsp
- movq %xmm0, (%rsp)
- call _glapi_get_dispatch
- movq (%rsp), %xmm0
- addq $8, %rsp
- movq 768(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(TexCoord1f), .-GL_PREFIX(TexCoord1f)
-
- .p2align 4,,15
- .globl GL_PREFIX(TexCoord1fv)
- .type GL_PREFIX(TexCoord1fv), @function
-GL_PREFIX(TexCoord1fv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 776(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 776(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 776(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 776(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(TexCoord1fv), .-GL_PREFIX(TexCoord1fv)
-
- .p2align 4,,15
- .globl GL_PREFIX(TexCoord1i)
- .type GL_PREFIX(TexCoord1i), @function
-GL_PREFIX(TexCoord1i):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 784(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 784(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 784(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 784(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(TexCoord1i), .-GL_PREFIX(TexCoord1i)
-
- .p2align 4,,15
- .globl GL_PREFIX(TexCoord1iv)
- .type GL_PREFIX(TexCoord1iv), @function
-GL_PREFIX(TexCoord1iv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 792(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 792(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 792(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 792(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(TexCoord1iv), .-GL_PREFIX(TexCoord1iv)
-
- .p2align 4,,15
- .globl GL_PREFIX(TexCoord1s)
- .type GL_PREFIX(TexCoord1s), @function
-GL_PREFIX(TexCoord1s):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 800(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 800(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 800(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 800(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(TexCoord1s), .-GL_PREFIX(TexCoord1s)
-
- .p2align 4,,15
- .globl GL_PREFIX(TexCoord1sv)
- .type GL_PREFIX(TexCoord1sv), @function
-GL_PREFIX(TexCoord1sv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 808(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 808(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 808(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 808(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(TexCoord1sv), .-GL_PREFIX(TexCoord1sv)
-
- .p2align 4,,15
- .globl GL_PREFIX(TexCoord2d)
- .type GL_PREFIX(TexCoord2d), @function
-GL_PREFIX(TexCoord2d):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 816(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $24, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $24, %rsp
- movq 816(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 816(%rax), %r11
- jmp *%r11
-1:
- subq $24, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- call _glapi_get_dispatch
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $24, %rsp
- movq 816(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(TexCoord2d), .-GL_PREFIX(TexCoord2d)
-
- .p2align 4,,15
- .globl GL_PREFIX(TexCoord2dv)
- .type GL_PREFIX(TexCoord2dv), @function
-GL_PREFIX(TexCoord2dv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 824(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 824(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 824(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 824(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(TexCoord2dv), .-GL_PREFIX(TexCoord2dv)
-
- .p2align 4,,15
- .globl GL_PREFIX(TexCoord2f)
- .type GL_PREFIX(TexCoord2f), @function
-GL_PREFIX(TexCoord2f):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 832(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $24, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $24, %rsp
- movq 832(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 832(%rax), %r11
- jmp *%r11
-1:
- subq $24, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- call _glapi_get_dispatch
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $24, %rsp
- movq 832(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(TexCoord2f), .-GL_PREFIX(TexCoord2f)
-
- .p2align 4,,15
- .globl GL_PREFIX(TexCoord2fv)
- .type GL_PREFIX(TexCoord2fv), @function
-GL_PREFIX(TexCoord2fv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 840(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 840(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 840(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 840(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(TexCoord2fv), .-GL_PREFIX(TexCoord2fv)
-
- .p2align 4,,15
- .globl GL_PREFIX(TexCoord2i)
- .type GL_PREFIX(TexCoord2i), @function
-GL_PREFIX(TexCoord2i):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 848(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 848(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 848(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 848(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(TexCoord2i), .-GL_PREFIX(TexCoord2i)
-
- .p2align 4,,15
- .globl GL_PREFIX(TexCoord2iv)
- .type GL_PREFIX(TexCoord2iv), @function
-GL_PREFIX(TexCoord2iv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 856(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 856(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 856(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 856(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(TexCoord2iv), .-GL_PREFIX(TexCoord2iv)
-
- .p2align 4,,15
- .globl GL_PREFIX(TexCoord2s)
- .type GL_PREFIX(TexCoord2s), @function
-GL_PREFIX(TexCoord2s):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 864(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 864(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 864(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 864(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(TexCoord2s), .-GL_PREFIX(TexCoord2s)
-
- .p2align 4,,15
- .globl GL_PREFIX(TexCoord2sv)
- .type GL_PREFIX(TexCoord2sv), @function
-GL_PREFIX(TexCoord2sv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 872(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 872(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 872(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 872(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(TexCoord2sv), .-GL_PREFIX(TexCoord2sv)
-
- .p2align 4,,15
- .globl GL_PREFIX(TexCoord3d)
- .type GL_PREFIX(TexCoord3d), @function
-GL_PREFIX(TexCoord3d):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 880(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $24, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- movq %xmm2, 16(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 16(%rsp), %xmm2
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $24, %rsp
- movq 880(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 880(%rax), %r11
- jmp *%r11
-1:
- subq $24, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- movq %xmm2, 16(%rsp)
- call _glapi_get_dispatch
- movq 16(%rsp), %xmm2
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $24, %rsp
- movq 880(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(TexCoord3d), .-GL_PREFIX(TexCoord3d)
-
- .p2align 4,,15
- .globl GL_PREFIX(TexCoord3dv)
- .type GL_PREFIX(TexCoord3dv), @function
-GL_PREFIX(TexCoord3dv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 888(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 888(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 888(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 888(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(TexCoord3dv), .-GL_PREFIX(TexCoord3dv)
-
- .p2align 4,,15
- .globl GL_PREFIX(TexCoord3f)
- .type GL_PREFIX(TexCoord3f), @function
-GL_PREFIX(TexCoord3f):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 896(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $24, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- movq %xmm2, 16(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 16(%rsp), %xmm2
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $24, %rsp
- movq 896(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 896(%rax), %r11
- jmp *%r11
-1:
- subq $24, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- movq %xmm2, 16(%rsp)
- call _glapi_get_dispatch
- movq 16(%rsp), %xmm2
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $24, %rsp
- movq 896(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(TexCoord3f), .-GL_PREFIX(TexCoord3f)
-
- .p2align 4,,15
- .globl GL_PREFIX(TexCoord3fv)
- .type GL_PREFIX(TexCoord3fv), @function
-GL_PREFIX(TexCoord3fv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 904(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 904(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 904(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 904(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(TexCoord3fv), .-GL_PREFIX(TexCoord3fv)
-
- .p2align 4,,15
- .globl GL_PREFIX(TexCoord3i)
- .type GL_PREFIX(TexCoord3i), @function
-GL_PREFIX(TexCoord3i):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 912(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 912(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 912(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 912(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(TexCoord3i), .-GL_PREFIX(TexCoord3i)
-
- .p2align 4,,15
- .globl GL_PREFIX(TexCoord3iv)
- .type GL_PREFIX(TexCoord3iv), @function
-GL_PREFIX(TexCoord3iv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 920(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 920(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 920(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 920(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(TexCoord3iv), .-GL_PREFIX(TexCoord3iv)
-
- .p2align 4,,15
- .globl GL_PREFIX(TexCoord3s)
- .type GL_PREFIX(TexCoord3s), @function
-GL_PREFIX(TexCoord3s):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 928(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 928(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 928(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 928(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(TexCoord3s), .-GL_PREFIX(TexCoord3s)
-
- .p2align 4,,15
- .globl GL_PREFIX(TexCoord3sv)
- .type GL_PREFIX(TexCoord3sv), @function
-GL_PREFIX(TexCoord3sv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 936(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 936(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 936(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 936(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(TexCoord3sv), .-GL_PREFIX(TexCoord3sv)
-
- .p2align 4,,15
- .globl GL_PREFIX(TexCoord4d)
- .type GL_PREFIX(TexCoord4d), @function
-GL_PREFIX(TexCoord4d):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 944(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $40, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- movq %xmm2, 16(%rsp)
- movq %xmm3, 24(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 24(%rsp), %xmm3
- movq 16(%rsp), %xmm2
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $40, %rsp
- movq 944(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 944(%rax), %r11
- jmp *%r11
-1:
- subq $40, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- movq %xmm2, 16(%rsp)
- movq %xmm3, 24(%rsp)
- call _glapi_get_dispatch
- movq 24(%rsp), %xmm3
- movq 16(%rsp), %xmm2
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $40, %rsp
- movq 944(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(TexCoord4d), .-GL_PREFIX(TexCoord4d)
-
- .p2align 4,,15
- .globl GL_PREFIX(TexCoord4dv)
- .type GL_PREFIX(TexCoord4dv), @function
-GL_PREFIX(TexCoord4dv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 952(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 952(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 952(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 952(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(TexCoord4dv), .-GL_PREFIX(TexCoord4dv)
-
- .p2align 4,,15
- .globl GL_PREFIX(TexCoord4f)
- .type GL_PREFIX(TexCoord4f), @function
-GL_PREFIX(TexCoord4f):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 960(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $40, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- movq %xmm2, 16(%rsp)
- movq %xmm3, 24(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 24(%rsp), %xmm3
- movq 16(%rsp), %xmm2
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $40, %rsp
- movq 960(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 960(%rax), %r11
- jmp *%r11
-1:
- subq $40, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- movq %xmm2, 16(%rsp)
- movq %xmm3, 24(%rsp)
- call _glapi_get_dispatch
- movq 24(%rsp), %xmm3
- movq 16(%rsp), %xmm2
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $40, %rsp
- movq 960(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(TexCoord4f), .-GL_PREFIX(TexCoord4f)
-
- .p2align 4,,15
- .globl GL_PREFIX(TexCoord4fv)
- .type GL_PREFIX(TexCoord4fv), @function
-GL_PREFIX(TexCoord4fv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 968(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 968(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 968(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 968(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(TexCoord4fv), .-GL_PREFIX(TexCoord4fv)
-
- .p2align 4,,15
- .globl GL_PREFIX(TexCoord4i)
- .type GL_PREFIX(TexCoord4i), @function
-GL_PREFIX(TexCoord4i):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 976(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 976(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 976(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 976(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(TexCoord4i), .-GL_PREFIX(TexCoord4i)
-
- .p2align 4,,15
- .globl GL_PREFIX(TexCoord4iv)
- .type GL_PREFIX(TexCoord4iv), @function
-GL_PREFIX(TexCoord4iv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 984(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 984(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 984(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 984(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(TexCoord4iv), .-GL_PREFIX(TexCoord4iv)
-
- .p2align 4,,15
- .globl GL_PREFIX(TexCoord4s)
- .type GL_PREFIX(TexCoord4s), @function
-GL_PREFIX(TexCoord4s):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 992(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 992(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 992(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 992(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(TexCoord4s), .-GL_PREFIX(TexCoord4s)
-
- .p2align 4,,15
- .globl GL_PREFIX(TexCoord4sv)
- .type GL_PREFIX(TexCoord4sv), @function
-GL_PREFIX(TexCoord4sv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1000(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 1000(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1000(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 1000(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(TexCoord4sv), .-GL_PREFIX(TexCoord4sv)
-
- .p2align 4,,15
- .globl GL_PREFIX(Vertex2d)
- .type GL_PREFIX(Vertex2d), @function
-GL_PREFIX(Vertex2d):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1008(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $24, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $24, %rsp
- movq 1008(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1008(%rax), %r11
- jmp *%r11
-1:
- subq $24, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- call _glapi_get_dispatch
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $24, %rsp
- movq 1008(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Vertex2d), .-GL_PREFIX(Vertex2d)
-
- .p2align 4,,15
- .globl GL_PREFIX(Vertex2dv)
- .type GL_PREFIX(Vertex2dv), @function
-GL_PREFIX(Vertex2dv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1016(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 1016(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1016(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 1016(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Vertex2dv), .-GL_PREFIX(Vertex2dv)
-
- .p2align 4,,15
- .globl GL_PREFIX(Vertex2f)
- .type GL_PREFIX(Vertex2f), @function
-GL_PREFIX(Vertex2f):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1024(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $24, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $24, %rsp
- movq 1024(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1024(%rax), %r11
- jmp *%r11
-1:
- subq $24, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- call _glapi_get_dispatch
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $24, %rsp
- movq 1024(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Vertex2f), .-GL_PREFIX(Vertex2f)
-
- .p2align 4,,15
- .globl GL_PREFIX(Vertex2fv)
- .type GL_PREFIX(Vertex2fv), @function
-GL_PREFIX(Vertex2fv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1032(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 1032(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1032(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 1032(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Vertex2fv), .-GL_PREFIX(Vertex2fv)
-
- .p2align 4,,15
- .globl GL_PREFIX(Vertex2i)
- .type GL_PREFIX(Vertex2i), @function
-GL_PREFIX(Vertex2i):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1040(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 1040(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1040(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 1040(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Vertex2i), .-GL_PREFIX(Vertex2i)
-
- .p2align 4,,15
- .globl GL_PREFIX(Vertex2iv)
- .type GL_PREFIX(Vertex2iv), @function
-GL_PREFIX(Vertex2iv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1048(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 1048(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1048(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 1048(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Vertex2iv), .-GL_PREFIX(Vertex2iv)
-
- .p2align 4,,15
- .globl GL_PREFIX(Vertex2s)
- .type GL_PREFIX(Vertex2s), @function
-GL_PREFIX(Vertex2s):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1056(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 1056(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1056(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 1056(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Vertex2s), .-GL_PREFIX(Vertex2s)
-
- .p2align 4,,15
- .globl GL_PREFIX(Vertex2sv)
- .type GL_PREFIX(Vertex2sv), @function
-GL_PREFIX(Vertex2sv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1064(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 1064(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1064(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 1064(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Vertex2sv), .-GL_PREFIX(Vertex2sv)
-
- .p2align 4,,15
- .globl GL_PREFIX(Vertex3d)
- .type GL_PREFIX(Vertex3d), @function
-GL_PREFIX(Vertex3d):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1072(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $24, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- movq %xmm2, 16(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 16(%rsp), %xmm2
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $24, %rsp
- movq 1072(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1072(%rax), %r11
- jmp *%r11
-1:
- subq $24, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- movq %xmm2, 16(%rsp)
- call _glapi_get_dispatch
- movq 16(%rsp), %xmm2
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $24, %rsp
- movq 1072(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Vertex3d), .-GL_PREFIX(Vertex3d)
-
- .p2align 4,,15
- .globl GL_PREFIX(Vertex3dv)
- .type GL_PREFIX(Vertex3dv), @function
-GL_PREFIX(Vertex3dv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1080(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 1080(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1080(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 1080(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Vertex3dv), .-GL_PREFIX(Vertex3dv)
-
- .p2align 4,,15
- .globl GL_PREFIX(Vertex3f)
- .type GL_PREFIX(Vertex3f), @function
-GL_PREFIX(Vertex3f):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1088(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $24, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- movq %xmm2, 16(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 16(%rsp), %xmm2
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $24, %rsp
- movq 1088(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1088(%rax), %r11
- jmp *%r11
-1:
- subq $24, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- movq %xmm2, 16(%rsp)
- call _glapi_get_dispatch
- movq 16(%rsp), %xmm2
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $24, %rsp
- movq 1088(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Vertex3f), .-GL_PREFIX(Vertex3f)
-
- .p2align 4,,15
- .globl GL_PREFIX(Vertex3fv)
- .type GL_PREFIX(Vertex3fv), @function
-GL_PREFIX(Vertex3fv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1096(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 1096(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1096(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 1096(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Vertex3fv), .-GL_PREFIX(Vertex3fv)
-
- .p2align 4,,15
- .globl GL_PREFIX(Vertex3i)
- .type GL_PREFIX(Vertex3i), @function
-GL_PREFIX(Vertex3i):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1104(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 1104(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1104(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 1104(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Vertex3i), .-GL_PREFIX(Vertex3i)
-
- .p2align 4,,15
- .globl GL_PREFIX(Vertex3iv)
- .type GL_PREFIX(Vertex3iv), @function
-GL_PREFIX(Vertex3iv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1112(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 1112(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1112(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 1112(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Vertex3iv), .-GL_PREFIX(Vertex3iv)
-
- .p2align 4,,15
- .globl GL_PREFIX(Vertex3s)
- .type GL_PREFIX(Vertex3s), @function
-GL_PREFIX(Vertex3s):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1120(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 1120(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1120(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 1120(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Vertex3s), .-GL_PREFIX(Vertex3s)
-
- .p2align 4,,15
- .globl GL_PREFIX(Vertex3sv)
- .type GL_PREFIX(Vertex3sv), @function
-GL_PREFIX(Vertex3sv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1128(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 1128(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1128(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 1128(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Vertex3sv), .-GL_PREFIX(Vertex3sv)
-
- .p2align 4,,15
- .globl GL_PREFIX(Vertex4d)
- .type GL_PREFIX(Vertex4d), @function
-GL_PREFIX(Vertex4d):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1136(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $40, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- movq %xmm2, 16(%rsp)
- movq %xmm3, 24(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 24(%rsp), %xmm3
- movq 16(%rsp), %xmm2
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $40, %rsp
- movq 1136(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1136(%rax), %r11
- jmp *%r11
-1:
- subq $40, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- movq %xmm2, 16(%rsp)
- movq %xmm3, 24(%rsp)
- call _glapi_get_dispatch
- movq 24(%rsp), %xmm3
- movq 16(%rsp), %xmm2
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $40, %rsp
- movq 1136(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Vertex4d), .-GL_PREFIX(Vertex4d)
-
- .p2align 4,,15
- .globl GL_PREFIX(Vertex4dv)
- .type GL_PREFIX(Vertex4dv), @function
-GL_PREFIX(Vertex4dv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1144(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 1144(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1144(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 1144(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Vertex4dv), .-GL_PREFIX(Vertex4dv)
-
- .p2align 4,,15
- .globl GL_PREFIX(Vertex4f)
- .type GL_PREFIX(Vertex4f), @function
-GL_PREFIX(Vertex4f):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1152(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $40, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- movq %xmm2, 16(%rsp)
- movq %xmm3, 24(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 24(%rsp), %xmm3
- movq 16(%rsp), %xmm2
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $40, %rsp
- movq 1152(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1152(%rax), %r11
- jmp *%r11
-1:
- subq $40, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- movq %xmm2, 16(%rsp)
- movq %xmm3, 24(%rsp)
- call _glapi_get_dispatch
- movq 24(%rsp), %xmm3
- movq 16(%rsp), %xmm2
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $40, %rsp
- movq 1152(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Vertex4f), .-GL_PREFIX(Vertex4f)
-
- .p2align 4,,15
- .globl GL_PREFIX(Vertex4fv)
- .type GL_PREFIX(Vertex4fv), @function
-GL_PREFIX(Vertex4fv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1160(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 1160(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1160(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 1160(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Vertex4fv), .-GL_PREFIX(Vertex4fv)
-
- .p2align 4,,15
- .globl GL_PREFIX(Vertex4i)
- .type GL_PREFIX(Vertex4i), @function
-GL_PREFIX(Vertex4i):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1168(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 1168(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1168(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 1168(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Vertex4i), .-GL_PREFIX(Vertex4i)
-
- .p2align 4,,15
- .globl GL_PREFIX(Vertex4iv)
- .type GL_PREFIX(Vertex4iv), @function
-GL_PREFIX(Vertex4iv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1176(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 1176(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1176(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 1176(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Vertex4iv), .-GL_PREFIX(Vertex4iv)
-
- .p2align 4,,15
- .globl GL_PREFIX(Vertex4s)
- .type GL_PREFIX(Vertex4s), @function
-GL_PREFIX(Vertex4s):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1184(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 1184(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1184(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 1184(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Vertex4s), .-GL_PREFIX(Vertex4s)
-
- .p2align 4,,15
- .globl GL_PREFIX(Vertex4sv)
- .type GL_PREFIX(Vertex4sv), @function
-GL_PREFIX(Vertex4sv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1192(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 1192(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1192(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 1192(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Vertex4sv), .-GL_PREFIX(Vertex4sv)
-
- .p2align 4,,15
- .globl GL_PREFIX(ClipPlane)
- .type GL_PREFIX(ClipPlane), @function
-GL_PREFIX(ClipPlane):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1200(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 1200(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1200(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 1200(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(ClipPlane), .-GL_PREFIX(ClipPlane)
-
- .p2align 4,,15
- .globl GL_PREFIX(ColorMaterial)
- .type GL_PREFIX(ColorMaterial), @function
-GL_PREFIX(ColorMaterial):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1208(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 1208(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1208(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 1208(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(ColorMaterial), .-GL_PREFIX(ColorMaterial)
-
- .p2align 4,,15
- .globl GL_PREFIX(CullFace)
- .type GL_PREFIX(CullFace), @function
-GL_PREFIX(CullFace):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1216(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 1216(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1216(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 1216(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(CullFace), .-GL_PREFIX(CullFace)
-
- .p2align 4,,15
- .globl GL_PREFIX(Fogf)
- .type GL_PREFIX(Fogf), @function
-GL_PREFIX(Fogf):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1224(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $24, %rsp
- movq %rdi, (%rsp)
- movq %xmm0, 8(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 8(%rsp), %xmm0
- movq (%rsp), %rdi
- addq $24, %rsp
- movq 1224(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1224(%rax), %r11
- jmp *%r11
-1:
- subq $24, %rsp
- movq %rdi, (%rsp)
- movq %xmm0, 8(%rsp)
- call _glapi_get_dispatch
- movq 8(%rsp), %xmm0
- movq (%rsp), %rdi
- addq $24, %rsp
- movq 1224(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Fogf), .-GL_PREFIX(Fogf)
-
- .p2align 4,,15
- .globl GL_PREFIX(Fogfv)
- .type GL_PREFIX(Fogfv), @function
-GL_PREFIX(Fogfv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1232(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 1232(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1232(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 1232(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Fogfv), .-GL_PREFIX(Fogfv)
-
- .p2align 4,,15
- .globl GL_PREFIX(Fogi)
- .type GL_PREFIX(Fogi), @function
-GL_PREFIX(Fogi):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1240(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 1240(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1240(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 1240(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Fogi), .-GL_PREFIX(Fogi)
-
- .p2align 4,,15
- .globl GL_PREFIX(Fogiv)
- .type GL_PREFIX(Fogiv), @function
-GL_PREFIX(Fogiv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1248(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 1248(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1248(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 1248(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Fogiv), .-GL_PREFIX(Fogiv)
-
- .p2align 4,,15
- .globl GL_PREFIX(FrontFace)
- .type GL_PREFIX(FrontFace), @function
-GL_PREFIX(FrontFace):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1256(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 1256(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1256(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 1256(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(FrontFace), .-GL_PREFIX(FrontFace)
-
- .p2align 4,,15
- .globl GL_PREFIX(Hint)
- .type GL_PREFIX(Hint), @function
-GL_PREFIX(Hint):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1264(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 1264(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1264(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 1264(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Hint), .-GL_PREFIX(Hint)
-
- .p2align 4,,15
- .globl GL_PREFIX(Lightf)
- .type GL_PREFIX(Lightf), @function
-GL_PREFIX(Lightf):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1272(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $24, %rsp
- movq %rdi, (%rsp)
- movq %rsi, 8(%rsp)
- movq %xmm0, 16(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 16(%rsp), %xmm0
- movq 8(%rsp), %rsi
- movq (%rsp), %rdi
- addq $24, %rsp
- movq 1272(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1272(%rax), %r11
- jmp *%r11
-1:
- subq $24, %rsp
- movq %rdi, (%rsp)
- movq %rsi, 8(%rsp)
- movq %xmm0, 16(%rsp)
- call _glapi_get_dispatch
- movq 16(%rsp), %xmm0
- movq 8(%rsp), %rsi
- movq (%rsp), %rdi
- addq $24, %rsp
- movq 1272(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Lightf), .-GL_PREFIX(Lightf)
-
- .p2align 4,,15
- .globl GL_PREFIX(Lightfv)
- .type GL_PREFIX(Lightfv), @function
-GL_PREFIX(Lightfv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1280(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 1280(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1280(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 1280(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Lightfv), .-GL_PREFIX(Lightfv)
-
- .p2align 4,,15
- .globl GL_PREFIX(Lighti)
- .type GL_PREFIX(Lighti), @function
-GL_PREFIX(Lighti):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1288(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 1288(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1288(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 1288(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Lighti), .-GL_PREFIX(Lighti)
-
- .p2align 4,,15
- .globl GL_PREFIX(Lightiv)
- .type GL_PREFIX(Lightiv), @function
-GL_PREFIX(Lightiv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1296(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 1296(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1296(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 1296(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Lightiv), .-GL_PREFIX(Lightiv)
-
- .p2align 4,,15
- .globl GL_PREFIX(LightModelf)
- .type GL_PREFIX(LightModelf), @function
-GL_PREFIX(LightModelf):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1304(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $24, %rsp
- movq %rdi, (%rsp)
- movq %xmm0, 8(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 8(%rsp), %xmm0
- movq (%rsp), %rdi
- addq $24, %rsp
- movq 1304(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1304(%rax), %r11
- jmp *%r11
-1:
- subq $24, %rsp
- movq %rdi, (%rsp)
- movq %xmm0, 8(%rsp)
- call _glapi_get_dispatch
- movq 8(%rsp), %xmm0
- movq (%rsp), %rdi
- addq $24, %rsp
- movq 1304(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(LightModelf), .-GL_PREFIX(LightModelf)
-
- .p2align 4,,15
- .globl GL_PREFIX(LightModelfv)
- .type GL_PREFIX(LightModelfv), @function
-GL_PREFIX(LightModelfv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1312(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 1312(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1312(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 1312(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(LightModelfv), .-GL_PREFIX(LightModelfv)
-
- .p2align 4,,15
- .globl GL_PREFIX(LightModeli)
- .type GL_PREFIX(LightModeli), @function
-GL_PREFIX(LightModeli):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1320(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 1320(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1320(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 1320(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(LightModeli), .-GL_PREFIX(LightModeli)
-
- .p2align 4,,15
- .globl GL_PREFIX(LightModeliv)
- .type GL_PREFIX(LightModeliv), @function
-GL_PREFIX(LightModeliv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1328(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 1328(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1328(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 1328(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(LightModeliv), .-GL_PREFIX(LightModeliv)
-
- .p2align 4,,15
- .globl GL_PREFIX(LineStipple)
- .type GL_PREFIX(LineStipple), @function
-GL_PREFIX(LineStipple):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1336(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 1336(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1336(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 1336(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(LineStipple), .-GL_PREFIX(LineStipple)
-
- .p2align 4,,15
- .globl GL_PREFIX(LineWidth)
- .type GL_PREFIX(LineWidth), @function
-GL_PREFIX(LineWidth):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1344(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $8, %rsp
- movq %xmm0, (%rsp)
- call _x86_64_get_dispatch@PLT
- movq (%rsp), %xmm0
- addq $8, %rsp
- movq 1344(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1344(%rax), %r11
- jmp *%r11
-1:
- subq $8, %rsp
- movq %xmm0, (%rsp)
- call _glapi_get_dispatch
- movq (%rsp), %xmm0
- addq $8, %rsp
- movq 1344(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(LineWidth), .-GL_PREFIX(LineWidth)
-
- .p2align 4,,15
- .globl GL_PREFIX(Materialf)
- .type GL_PREFIX(Materialf), @function
-GL_PREFIX(Materialf):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1352(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $24, %rsp
- movq %rdi, (%rsp)
- movq %rsi, 8(%rsp)
- movq %xmm0, 16(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 16(%rsp), %xmm0
- movq 8(%rsp), %rsi
- movq (%rsp), %rdi
- addq $24, %rsp
- movq 1352(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1352(%rax), %r11
- jmp *%r11
-1:
- subq $24, %rsp
- movq %rdi, (%rsp)
- movq %rsi, 8(%rsp)
- movq %xmm0, 16(%rsp)
- call _glapi_get_dispatch
- movq 16(%rsp), %xmm0
- movq 8(%rsp), %rsi
- movq (%rsp), %rdi
- addq $24, %rsp
- movq 1352(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Materialf), .-GL_PREFIX(Materialf)
-
- .p2align 4,,15
- .globl GL_PREFIX(Materialfv)
- .type GL_PREFIX(Materialfv), @function
-GL_PREFIX(Materialfv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1360(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 1360(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1360(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 1360(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Materialfv), .-GL_PREFIX(Materialfv)
-
- .p2align 4,,15
- .globl GL_PREFIX(Materiali)
- .type GL_PREFIX(Materiali), @function
-GL_PREFIX(Materiali):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1368(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 1368(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1368(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 1368(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Materiali), .-GL_PREFIX(Materiali)
-
- .p2align 4,,15
- .globl GL_PREFIX(Materialiv)
- .type GL_PREFIX(Materialiv), @function
-GL_PREFIX(Materialiv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1376(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 1376(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1376(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 1376(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Materialiv), .-GL_PREFIX(Materialiv)
-
- .p2align 4,,15
- .globl GL_PREFIX(PointSize)
- .type GL_PREFIX(PointSize), @function
-GL_PREFIX(PointSize):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1384(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $8, %rsp
- movq %xmm0, (%rsp)
- call _x86_64_get_dispatch@PLT
- movq (%rsp), %xmm0
- addq $8, %rsp
- movq 1384(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1384(%rax), %r11
- jmp *%r11
-1:
- subq $8, %rsp
- movq %xmm0, (%rsp)
- call _glapi_get_dispatch
- movq (%rsp), %xmm0
- addq $8, %rsp
- movq 1384(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(PointSize), .-GL_PREFIX(PointSize)
-
- .p2align 4,,15
- .globl GL_PREFIX(PolygonMode)
- .type GL_PREFIX(PolygonMode), @function
-GL_PREFIX(PolygonMode):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1392(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 1392(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1392(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 1392(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(PolygonMode), .-GL_PREFIX(PolygonMode)
-
- .p2align 4,,15
- .globl GL_PREFIX(PolygonStipple)
- .type GL_PREFIX(PolygonStipple), @function
-GL_PREFIX(PolygonStipple):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1400(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 1400(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1400(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 1400(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(PolygonStipple), .-GL_PREFIX(PolygonStipple)
-
- .p2align 4,,15
- .globl GL_PREFIX(Scissor)
- .type GL_PREFIX(Scissor), @function
-GL_PREFIX(Scissor):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1408(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 1408(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1408(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 1408(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Scissor), .-GL_PREFIX(Scissor)
-
- .p2align 4,,15
- .globl GL_PREFIX(ShadeModel)
- .type GL_PREFIX(ShadeModel), @function
-GL_PREFIX(ShadeModel):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1416(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 1416(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1416(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 1416(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(ShadeModel), .-GL_PREFIX(ShadeModel)
-
- .p2align 4,,15
- .globl GL_PREFIX(TexParameterf)
- .type GL_PREFIX(TexParameterf), @function
-GL_PREFIX(TexParameterf):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1424(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $24, %rsp
- movq %rdi, (%rsp)
- movq %rsi, 8(%rsp)
- movq %xmm0, 16(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 16(%rsp), %xmm0
- movq 8(%rsp), %rsi
- movq (%rsp), %rdi
- addq $24, %rsp
- movq 1424(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1424(%rax), %r11
- jmp *%r11
-1:
- subq $24, %rsp
- movq %rdi, (%rsp)
- movq %rsi, 8(%rsp)
- movq %xmm0, 16(%rsp)
- call _glapi_get_dispatch
- movq 16(%rsp), %xmm0
- movq 8(%rsp), %rsi
- movq (%rsp), %rdi
- addq $24, %rsp
- movq 1424(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(TexParameterf), .-GL_PREFIX(TexParameterf)
-
- .p2align 4,,15
- .globl GL_PREFIX(TexParameterfv)
- .type GL_PREFIX(TexParameterfv), @function
-GL_PREFIX(TexParameterfv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1432(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 1432(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1432(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 1432(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(TexParameterfv), .-GL_PREFIX(TexParameterfv)
-
- .p2align 4,,15
- .globl GL_PREFIX(TexParameteri)
- .type GL_PREFIX(TexParameteri), @function
-GL_PREFIX(TexParameteri):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1440(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 1440(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1440(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 1440(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(TexParameteri), .-GL_PREFIX(TexParameteri)
-
- .p2align 4,,15
- .globl GL_PREFIX(TexParameteriv)
- .type GL_PREFIX(TexParameteriv), @function
-GL_PREFIX(TexParameteriv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1448(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 1448(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1448(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 1448(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(TexParameteriv), .-GL_PREFIX(TexParameteriv)
-
- .p2align 4,,15
- .globl GL_PREFIX(TexImage1D)
- .type GL_PREFIX(TexImage1D), @function
-GL_PREFIX(TexImage1D):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1456(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- pushq %r9
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %r9
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 1456(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1456(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- pushq %r9
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %r9
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 1456(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(TexImage1D), .-GL_PREFIX(TexImage1D)
-
- .p2align 4,,15
- .globl GL_PREFIX(TexImage2D)
- .type GL_PREFIX(TexImage2D), @function
-GL_PREFIX(TexImage2D):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1464(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- pushq %r9
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %r9
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 1464(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1464(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- pushq %r9
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %r9
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 1464(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(TexImage2D), .-GL_PREFIX(TexImage2D)
-
- .p2align 4,,15
- .globl GL_PREFIX(TexEnvf)
- .type GL_PREFIX(TexEnvf), @function
-GL_PREFIX(TexEnvf):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1472(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $24, %rsp
- movq %rdi, (%rsp)
- movq %rsi, 8(%rsp)
- movq %xmm0, 16(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 16(%rsp), %xmm0
- movq 8(%rsp), %rsi
- movq (%rsp), %rdi
- addq $24, %rsp
- movq 1472(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1472(%rax), %r11
- jmp *%r11
-1:
- subq $24, %rsp
- movq %rdi, (%rsp)
- movq %rsi, 8(%rsp)
- movq %xmm0, 16(%rsp)
- call _glapi_get_dispatch
- movq 16(%rsp), %xmm0
- movq 8(%rsp), %rsi
- movq (%rsp), %rdi
- addq $24, %rsp
- movq 1472(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(TexEnvf), .-GL_PREFIX(TexEnvf)
-
- .p2align 4,,15
- .globl GL_PREFIX(TexEnvfv)
- .type GL_PREFIX(TexEnvfv), @function
-GL_PREFIX(TexEnvfv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1480(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 1480(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1480(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 1480(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(TexEnvfv), .-GL_PREFIX(TexEnvfv)
-
- .p2align 4,,15
- .globl GL_PREFIX(TexEnvi)
- .type GL_PREFIX(TexEnvi), @function
-GL_PREFIX(TexEnvi):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1488(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 1488(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1488(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 1488(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(TexEnvi), .-GL_PREFIX(TexEnvi)
-
- .p2align 4,,15
- .globl GL_PREFIX(TexEnviv)
- .type GL_PREFIX(TexEnviv), @function
-GL_PREFIX(TexEnviv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1496(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 1496(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1496(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 1496(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(TexEnviv), .-GL_PREFIX(TexEnviv)
-
- .p2align 4,,15
- .globl GL_PREFIX(TexGend)
- .type GL_PREFIX(TexGend), @function
-GL_PREFIX(TexGend):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1504(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $24, %rsp
- movq %rdi, (%rsp)
- movq %rsi, 8(%rsp)
- movq %xmm0, 16(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 16(%rsp), %xmm0
- movq 8(%rsp), %rsi
- movq (%rsp), %rdi
- addq $24, %rsp
- movq 1504(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1504(%rax), %r11
- jmp *%r11
-1:
- subq $24, %rsp
- movq %rdi, (%rsp)
- movq %rsi, 8(%rsp)
- movq %xmm0, 16(%rsp)
- call _glapi_get_dispatch
- movq 16(%rsp), %xmm0
- movq 8(%rsp), %rsi
- movq (%rsp), %rdi
- addq $24, %rsp
- movq 1504(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(TexGend), .-GL_PREFIX(TexGend)
-
- .p2align 4,,15
- .globl GL_PREFIX(TexGendv)
- .type GL_PREFIX(TexGendv), @function
-GL_PREFIX(TexGendv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1512(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 1512(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1512(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 1512(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(TexGendv), .-GL_PREFIX(TexGendv)
-
- .p2align 4,,15
- .globl GL_PREFIX(TexGenf)
- .type GL_PREFIX(TexGenf), @function
-GL_PREFIX(TexGenf):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1520(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $24, %rsp
- movq %rdi, (%rsp)
- movq %rsi, 8(%rsp)
- movq %xmm0, 16(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 16(%rsp), %xmm0
- movq 8(%rsp), %rsi
- movq (%rsp), %rdi
- addq $24, %rsp
- movq 1520(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1520(%rax), %r11
- jmp *%r11
-1:
- subq $24, %rsp
- movq %rdi, (%rsp)
- movq %rsi, 8(%rsp)
- movq %xmm0, 16(%rsp)
- call _glapi_get_dispatch
- movq 16(%rsp), %xmm0
- movq 8(%rsp), %rsi
- movq (%rsp), %rdi
- addq $24, %rsp
- movq 1520(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(TexGenf), .-GL_PREFIX(TexGenf)
-
- .p2align 4,,15
- .globl GL_PREFIX(TexGenfv)
- .type GL_PREFIX(TexGenfv), @function
-GL_PREFIX(TexGenfv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1528(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 1528(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1528(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 1528(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(TexGenfv), .-GL_PREFIX(TexGenfv)
-
- .p2align 4,,15
- .globl GL_PREFIX(TexGeni)
- .type GL_PREFIX(TexGeni), @function
-GL_PREFIX(TexGeni):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1536(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 1536(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1536(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 1536(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(TexGeni), .-GL_PREFIX(TexGeni)
-
- .p2align 4,,15
- .globl GL_PREFIX(TexGeniv)
- .type GL_PREFIX(TexGeniv), @function
-GL_PREFIX(TexGeniv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1544(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 1544(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1544(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 1544(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(TexGeniv), .-GL_PREFIX(TexGeniv)
-
- .p2align 4,,15
- .globl GL_PREFIX(FeedbackBuffer)
- .type GL_PREFIX(FeedbackBuffer), @function
-GL_PREFIX(FeedbackBuffer):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1552(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 1552(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1552(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 1552(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(FeedbackBuffer), .-GL_PREFIX(FeedbackBuffer)
-
- .p2align 4,,15
- .globl GL_PREFIX(SelectBuffer)
- .type GL_PREFIX(SelectBuffer), @function
-GL_PREFIX(SelectBuffer):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1560(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 1560(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1560(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 1560(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(SelectBuffer), .-GL_PREFIX(SelectBuffer)
-
- .p2align 4,,15
- .globl GL_PREFIX(RenderMode)
- .type GL_PREFIX(RenderMode), @function
-GL_PREFIX(RenderMode):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1568(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 1568(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1568(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 1568(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(RenderMode), .-GL_PREFIX(RenderMode)
-
- .p2align 4,,15
- .globl GL_PREFIX(InitNames)
- .type GL_PREFIX(InitNames), @function
-GL_PREFIX(InitNames):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1576(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- movq 1576(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1576(%rax), %r11
- jmp *%r11
-1:
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- movq 1576(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(InitNames), .-GL_PREFIX(InitNames)
-
- .p2align 4,,15
- .globl GL_PREFIX(LoadName)
- .type GL_PREFIX(LoadName), @function
-GL_PREFIX(LoadName):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1584(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 1584(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1584(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 1584(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(LoadName), .-GL_PREFIX(LoadName)
-
- .p2align 4,,15
- .globl GL_PREFIX(PassThrough)
- .type GL_PREFIX(PassThrough), @function
-GL_PREFIX(PassThrough):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1592(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $8, %rsp
- movq %xmm0, (%rsp)
- call _x86_64_get_dispatch@PLT
- movq (%rsp), %xmm0
- addq $8, %rsp
- movq 1592(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1592(%rax), %r11
- jmp *%r11
-1:
- subq $8, %rsp
- movq %xmm0, (%rsp)
- call _glapi_get_dispatch
- movq (%rsp), %xmm0
- addq $8, %rsp
- movq 1592(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(PassThrough), .-GL_PREFIX(PassThrough)
-
- .p2align 4,,15
- .globl GL_PREFIX(PopName)
- .type GL_PREFIX(PopName), @function
-GL_PREFIX(PopName):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1600(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- movq 1600(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1600(%rax), %r11
- jmp *%r11
-1:
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- movq 1600(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(PopName), .-GL_PREFIX(PopName)
-
- .p2align 4,,15
- .globl GL_PREFIX(PushName)
- .type GL_PREFIX(PushName), @function
-GL_PREFIX(PushName):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1608(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 1608(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1608(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 1608(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(PushName), .-GL_PREFIX(PushName)
-
- .p2align 4,,15
- .globl GL_PREFIX(DrawBuffer)
- .type GL_PREFIX(DrawBuffer), @function
-GL_PREFIX(DrawBuffer):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1616(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 1616(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1616(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 1616(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(DrawBuffer), .-GL_PREFIX(DrawBuffer)
-
- .p2align 4,,15
- .globl GL_PREFIX(Clear)
- .type GL_PREFIX(Clear), @function
-GL_PREFIX(Clear):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1624(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 1624(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1624(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 1624(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Clear), .-GL_PREFIX(Clear)
-
- .p2align 4,,15
- .globl GL_PREFIX(ClearAccum)
- .type GL_PREFIX(ClearAccum), @function
-GL_PREFIX(ClearAccum):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1632(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $40, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- movq %xmm2, 16(%rsp)
- movq %xmm3, 24(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 24(%rsp), %xmm3
- movq 16(%rsp), %xmm2
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $40, %rsp
- movq 1632(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1632(%rax), %r11
- jmp *%r11
-1:
- subq $40, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- movq %xmm2, 16(%rsp)
- movq %xmm3, 24(%rsp)
- call _glapi_get_dispatch
- movq 24(%rsp), %xmm3
- movq 16(%rsp), %xmm2
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $40, %rsp
- movq 1632(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(ClearAccum), .-GL_PREFIX(ClearAccum)
-
- .p2align 4,,15
- .globl GL_PREFIX(ClearIndex)
- .type GL_PREFIX(ClearIndex), @function
-GL_PREFIX(ClearIndex):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1640(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $8, %rsp
- movq %xmm0, (%rsp)
- call _x86_64_get_dispatch@PLT
- movq (%rsp), %xmm0
- addq $8, %rsp
- movq 1640(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1640(%rax), %r11
- jmp *%r11
-1:
- subq $8, %rsp
- movq %xmm0, (%rsp)
- call _glapi_get_dispatch
- movq (%rsp), %xmm0
- addq $8, %rsp
- movq 1640(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(ClearIndex), .-GL_PREFIX(ClearIndex)
-
- .p2align 4,,15
- .globl GL_PREFIX(ClearColor)
- .type GL_PREFIX(ClearColor), @function
-GL_PREFIX(ClearColor):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1648(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 1648(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1648(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 1648(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(ClearColor), .-GL_PREFIX(ClearColor)
-
- .p2align 4,,15
- .globl GL_PREFIX(ClearStencil)
- .type GL_PREFIX(ClearStencil), @function
-GL_PREFIX(ClearStencil):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1656(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 1656(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1656(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 1656(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(ClearStencil), .-GL_PREFIX(ClearStencil)
-
- .p2align 4,,15
- .globl GL_PREFIX(ClearDepth)
- .type GL_PREFIX(ClearDepth), @function
-GL_PREFIX(ClearDepth):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1664(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 1664(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1664(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 1664(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(ClearDepth), .-GL_PREFIX(ClearDepth)
-
- .p2align 4,,15
- .globl GL_PREFIX(StencilMask)
- .type GL_PREFIX(StencilMask), @function
-GL_PREFIX(StencilMask):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1672(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 1672(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1672(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 1672(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(StencilMask), .-GL_PREFIX(StencilMask)
-
- .p2align 4,,15
- .globl GL_PREFIX(ColorMask)
- .type GL_PREFIX(ColorMask), @function
-GL_PREFIX(ColorMask):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1680(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 1680(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1680(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 1680(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(ColorMask), .-GL_PREFIX(ColorMask)
-
- .p2align 4,,15
- .globl GL_PREFIX(DepthMask)
- .type GL_PREFIX(DepthMask), @function
-GL_PREFIX(DepthMask):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1688(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 1688(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1688(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 1688(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(DepthMask), .-GL_PREFIX(DepthMask)
-
- .p2align 4,,15
- .globl GL_PREFIX(IndexMask)
- .type GL_PREFIX(IndexMask), @function
-GL_PREFIX(IndexMask):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1696(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 1696(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1696(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 1696(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(IndexMask), .-GL_PREFIX(IndexMask)
-
- .p2align 4,,15
- .globl GL_PREFIX(Accum)
- .type GL_PREFIX(Accum), @function
-GL_PREFIX(Accum):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1704(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $24, %rsp
- movq %rdi, (%rsp)
- movq %xmm0, 8(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 8(%rsp), %xmm0
- movq (%rsp), %rdi
- addq $24, %rsp
- movq 1704(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1704(%rax), %r11
- jmp *%r11
-1:
- subq $24, %rsp
- movq %rdi, (%rsp)
- movq %xmm0, 8(%rsp)
- call _glapi_get_dispatch
- movq 8(%rsp), %xmm0
- movq (%rsp), %rdi
- addq $24, %rsp
- movq 1704(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Accum), .-GL_PREFIX(Accum)
-
- .p2align 4,,15
- .globl GL_PREFIX(Disable)
- .type GL_PREFIX(Disable), @function
-GL_PREFIX(Disable):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1712(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 1712(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1712(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 1712(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Disable), .-GL_PREFIX(Disable)
-
- .p2align 4,,15
- .globl GL_PREFIX(Enable)
- .type GL_PREFIX(Enable), @function
-GL_PREFIX(Enable):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1720(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 1720(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1720(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 1720(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Enable), .-GL_PREFIX(Enable)
-
- .p2align 4,,15
- .globl GL_PREFIX(Finish)
- .type GL_PREFIX(Finish), @function
-GL_PREFIX(Finish):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1728(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- movq 1728(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1728(%rax), %r11
- jmp *%r11
-1:
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- movq 1728(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Finish), .-GL_PREFIX(Finish)
-
- .p2align 4,,15
- .globl GL_PREFIX(Flush)
- .type GL_PREFIX(Flush), @function
-GL_PREFIX(Flush):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1736(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- movq 1736(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1736(%rax), %r11
- jmp *%r11
-1:
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- movq 1736(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Flush), .-GL_PREFIX(Flush)
-
- .p2align 4,,15
- .globl GL_PREFIX(PopAttrib)
- .type GL_PREFIX(PopAttrib), @function
-GL_PREFIX(PopAttrib):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1744(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- movq 1744(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1744(%rax), %r11
- jmp *%r11
-1:
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- movq 1744(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(PopAttrib), .-GL_PREFIX(PopAttrib)
-
- .p2align 4,,15
- .globl GL_PREFIX(PushAttrib)
- .type GL_PREFIX(PushAttrib), @function
-GL_PREFIX(PushAttrib):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1752(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 1752(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1752(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 1752(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(PushAttrib), .-GL_PREFIX(PushAttrib)
-
- .p2align 4,,15
- .globl GL_PREFIX(Map1d)
- .type GL_PREFIX(Map1d), @function
-GL_PREFIX(Map1d):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1760(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $56, %rsp
- movq %rdi, (%rsp)
- movq %xmm0, 8(%rsp)
- movq %xmm1, 16(%rsp)
- movq %rsi, 24(%rsp)
- movq %rdx, 32(%rsp)
- movq %rcx, 40(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 40(%rsp), %rcx
- movq 32(%rsp), %rdx
- movq 24(%rsp), %rsi
- movq 16(%rsp), %xmm1
- movq 8(%rsp), %xmm0
- movq (%rsp), %rdi
- addq $56, %rsp
- movq 1760(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1760(%rax), %r11
- jmp *%r11
-1:
- subq $56, %rsp
- movq %rdi, (%rsp)
- movq %xmm0, 8(%rsp)
- movq %xmm1, 16(%rsp)
- movq %rsi, 24(%rsp)
- movq %rdx, 32(%rsp)
- movq %rcx, 40(%rsp)
- call _glapi_get_dispatch
- movq 40(%rsp), %rcx
- movq 32(%rsp), %rdx
- movq 24(%rsp), %rsi
- movq 16(%rsp), %xmm1
- movq 8(%rsp), %xmm0
- movq (%rsp), %rdi
- addq $56, %rsp
- movq 1760(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Map1d), .-GL_PREFIX(Map1d)
-
- .p2align 4,,15
- .globl GL_PREFIX(Map1f)
- .type GL_PREFIX(Map1f), @function
-GL_PREFIX(Map1f):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1768(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $56, %rsp
- movq %rdi, (%rsp)
- movq %xmm0, 8(%rsp)
- movq %xmm1, 16(%rsp)
- movq %rsi, 24(%rsp)
- movq %rdx, 32(%rsp)
- movq %rcx, 40(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 40(%rsp), %rcx
- movq 32(%rsp), %rdx
- movq 24(%rsp), %rsi
- movq 16(%rsp), %xmm1
- movq 8(%rsp), %xmm0
- movq (%rsp), %rdi
- addq $56, %rsp
- movq 1768(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1768(%rax), %r11
- jmp *%r11
-1:
- subq $56, %rsp
- movq %rdi, (%rsp)
- movq %xmm0, 8(%rsp)
- movq %xmm1, 16(%rsp)
- movq %rsi, 24(%rsp)
- movq %rdx, 32(%rsp)
- movq %rcx, 40(%rsp)
- call _glapi_get_dispatch
- movq 40(%rsp), %rcx
- movq 32(%rsp), %rdx
- movq 24(%rsp), %rsi
- movq 16(%rsp), %xmm1
- movq 8(%rsp), %xmm0
- movq (%rsp), %rdi
- addq $56, %rsp
- movq 1768(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Map1f), .-GL_PREFIX(Map1f)
-
- .p2align 4,,15
- .globl GL_PREFIX(Map2d)
- .type GL_PREFIX(Map2d), @function
-GL_PREFIX(Map2d):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1776(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $88, %rsp
- movq %rdi, (%rsp)
- movq %xmm0, 8(%rsp)
- movq %xmm1, 16(%rsp)
- movq %rsi, 24(%rsp)
- movq %rdx, 32(%rsp)
- movq %xmm2, 40(%rsp)
- movq %xmm3, 48(%rsp)
- movq %rcx, 56(%rsp)
- movq %r8, 64(%rsp)
- movq %r9, 72(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 72(%rsp), %r9
- movq 64(%rsp), %r8
- movq 56(%rsp), %rcx
- movq 48(%rsp), %xmm3
- movq 40(%rsp), %xmm2
- movq 32(%rsp), %rdx
- movq 24(%rsp), %rsi
- movq 16(%rsp), %xmm1
- movq 8(%rsp), %xmm0
- movq (%rsp), %rdi
- addq $88, %rsp
- movq 1776(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1776(%rax), %r11
- jmp *%r11
-1:
- subq $88, %rsp
- movq %rdi, (%rsp)
- movq %xmm0, 8(%rsp)
- movq %xmm1, 16(%rsp)
- movq %rsi, 24(%rsp)
- movq %rdx, 32(%rsp)
- movq %xmm2, 40(%rsp)
- movq %xmm3, 48(%rsp)
- movq %rcx, 56(%rsp)
- movq %r8, 64(%rsp)
- movq %r9, 72(%rsp)
- call _glapi_get_dispatch
- movq 72(%rsp), %r9
- movq 64(%rsp), %r8
- movq 56(%rsp), %rcx
- movq 48(%rsp), %xmm3
- movq 40(%rsp), %xmm2
- movq 32(%rsp), %rdx
- movq 24(%rsp), %rsi
- movq 16(%rsp), %xmm1
- movq 8(%rsp), %xmm0
- movq (%rsp), %rdi
- addq $88, %rsp
- movq 1776(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Map2d), .-GL_PREFIX(Map2d)
-
- .p2align 4,,15
- .globl GL_PREFIX(Map2f)
- .type GL_PREFIX(Map2f), @function
-GL_PREFIX(Map2f):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1784(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $88, %rsp
- movq %rdi, (%rsp)
- movq %xmm0, 8(%rsp)
- movq %xmm1, 16(%rsp)
- movq %rsi, 24(%rsp)
- movq %rdx, 32(%rsp)
- movq %xmm2, 40(%rsp)
- movq %xmm3, 48(%rsp)
- movq %rcx, 56(%rsp)
- movq %r8, 64(%rsp)
- movq %r9, 72(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 72(%rsp), %r9
- movq 64(%rsp), %r8
- movq 56(%rsp), %rcx
- movq 48(%rsp), %xmm3
- movq 40(%rsp), %xmm2
- movq 32(%rsp), %rdx
- movq 24(%rsp), %rsi
- movq 16(%rsp), %xmm1
- movq 8(%rsp), %xmm0
- movq (%rsp), %rdi
- addq $88, %rsp
- movq 1784(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1784(%rax), %r11
- jmp *%r11
-1:
- subq $88, %rsp
- movq %rdi, (%rsp)
- movq %xmm0, 8(%rsp)
- movq %xmm1, 16(%rsp)
- movq %rsi, 24(%rsp)
- movq %rdx, 32(%rsp)
- movq %xmm2, 40(%rsp)
- movq %xmm3, 48(%rsp)
- movq %rcx, 56(%rsp)
- movq %r8, 64(%rsp)
- movq %r9, 72(%rsp)
- call _glapi_get_dispatch
- movq 72(%rsp), %r9
- movq 64(%rsp), %r8
- movq 56(%rsp), %rcx
- movq 48(%rsp), %xmm3
- movq 40(%rsp), %xmm2
- movq 32(%rsp), %rdx
- movq 24(%rsp), %rsi
- movq 16(%rsp), %xmm1
- movq 8(%rsp), %xmm0
- movq (%rsp), %rdi
- addq $88, %rsp
- movq 1784(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Map2f), .-GL_PREFIX(Map2f)
-
- .p2align 4,,15
- .globl GL_PREFIX(MapGrid1d)
- .type GL_PREFIX(MapGrid1d), @function
-GL_PREFIX(MapGrid1d):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1792(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $24, %rsp
- movq %rdi, (%rsp)
- movq %xmm0, 8(%rsp)
- movq %xmm1, 16(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 16(%rsp), %xmm1
- movq 8(%rsp), %xmm0
- movq (%rsp), %rdi
- addq $24, %rsp
- movq 1792(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1792(%rax), %r11
- jmp *%r11
-1:
- subq $24, %rsp
- movq %rdi, (%rsp)
- movq %xmm0, 8(%rsp)
- movq %xmm1, 16(%rsp)
- call _glapi_get_dispatch
- movq 16(%rsp), %xmm1
- movq 8(%rsp), %xmm0
- movq (%rsp), %rdi
- addq $24, %rsp
- movq 1792(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(MapGrid1d), .-GL_PREFIX(MapGrid1d)
-
- .p2align 4,,15
- .globl GL_PREFIX(MapGrid1f)
- .type GL_PREFIX(MapGrid1f), @function
-GL_PREFIX(MapGrid1f):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1800(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $24, %rsp
- movq %rdi, (%rsp)
- movq %xmm0, 8(%rsp)
- movq %xmm1, 16(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 16(%rsp), %xmm1
- movq 8(%rsp), %xmm0
- movq (%rsp), %rdi
- addq $24, %rsp
- movq 1800(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1800(%rax), %r11
- jmp *%r11
-1:
- subq $24, %rsp
- movq %rdi, (%rsp)
- movq %xmm0, 8(%rsp)
- movq %xmm1, 16(%rsp)
- call _glapi_get_dispatch
- movq 16(%rsp), %xmm1
- movq 8(%rsp), %xmm0
- movq (%rsp), %rdi
- addq $24, %rsp
- movq 1800(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(MapGrid1f), .-GL_PREFIX(MapGrid1f)
-
- .p2align 4,,15
- .globl GL_PREFIX(MapGrid2d)
- .type GL_PREFIX(MapGrid2d), @function
-GL_PREFIX(MapGrid2d):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1808(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $56, %rsp
- movq %rdi, (%rsp)
- movq %xmm0, 8(%rsp)
- movq %xmm1, 16(%rsp)
- movq %rsi, 24(%rsp)
- movq %xmm2, 32(%rsp)
- movq %xmm3, 40(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 40(%rsp), %xmm3
- movq 32(%rsp), %xmm2
- movq 24(%rsp), %rsi
- movq 16(%rsp), %xmm1
- movq 8(%rsp), %xmm0
- movq (%rsp), %rdi
- addq $56, %rsp
- movq 1808(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1808(%rax), %r11
- jmp *%r11
-1:
- subq $56, %rsp
- movq %rdi, (%rsp)
- movq %xmm0, 8(%rsp)
- movq %xmm1, 16(%rsp)
- movq %rsi, 24(%rsp)
- movq %xmm2, 32(%rsp)
- movq %xmm3, 40(%rsp)
- call _glapi_get_dispatch
- movq 40(%rsp), %xmm3
- movq 32(%rsp), %xmm2
- movq 24(%rsp), %rsi
- movq 16(%rsp), %xmm1
- movq 8(%rsp), %xmm0
- movq (%rsp), %rdi
- addq $56, %rsp
- movq 1808(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(MapGrid2d), .-GL_PREFIX(MapGrid2d)
-
- .p2align 4,,15
- .globl GL_PREFIX(MapGrid2f)
- .type GL_PREFIX(MapGrid2f), @function
-GL_PREFIX(MapGrid2f):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1816(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $56, %rsp
- movq %rdi, (%rsp)
- movq %xmm0, 8(%rsp)
- movq %xmm1, 16(%rsp)
- movq %rsi, 24(%rsp)
- movq %xmm2, 32(%rsp)
- movq %xmm3, 40(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 40(%rsp), %xmm3
- movq 32(%rsp), %xmm2
- movq 24(%rsp), %rsi
- movq 16(%rsp), %xmm1
- movq 8(%rsp), %xmm0
- movq (%rsp), %rdi
- addq $56, %rsp
- movq 1816(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1816(%rax), %r11
- jmp *%r11
-1:
- subq $56, %rsp
- movq %rdi, (%rsp)
- movq %xmm0, 8(%rsp)
- movq %xmm1, 16(%rsp)
- movq %rsi, 24(%rsp)
- movq %xmm2, 32(%rsp)
- movq %xmm3, 40(%rsp)
- call _glapi_get_dispatch
- movq 40(%rsp), %xmm3
- movq 32(%rsp), %xmm2
- movq 24(%rsp), %rsi
- movq 16(%rsp), %xmm1
- movq 8(%rsp), %xmm0
- movq (%rsp), %rdi
- addq $56, %rsp
- movq 1816(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(MapGrid2f), .-GL_PREFIX(MapGrid2f)
-
- .p2align 4,,15
- .globl GL_PREFIX(EvalCoord1d)
- .type GL_PREFIX(EvalCoord1d), @function
-GL_PREFIX(EvalCoord1d):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1824(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $8, %rsp
- movq %xmm0, (%rsp)
- call _x86_64_get_dispatch@PLT
- movq (%rsp), %xmm0
- addq $8, %rsp
- movq 1824(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1824(%rax), %r11
- jmp *%r11
-1:
- subq $8, %rsp
- movq %xmm0, (%rsp)
- call _glapi_get_dispatch
- movq (%rsp), %xmm0
- addq $8, %rsp
- movq 1824(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(EvalCoord1d), .-GL_PREFIX(EvalCoord1d)
-
- .p2align 4,,15
- .globl GL_PREFIX(EvalCoord1dv)
- .type GL_PREFIX(EvalCoord1dv), @function
-GL_PREFIX(EvalCoord1dv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1832(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 1832(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1832(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 1832(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(EvalCoord1dv), .-GL_PREFIX(EvalCoord1dv)
-
- .p2align 4,,15
- .globl GL_PREFIX(EvalCoord1f)
- .type GL_PREFIX(EvalCoord1f), @function
-GL_PREFIX(EvalCoord1f):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1840(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $8, %rsp
- movq %xmm0, (%rsp)
- call _x86_64_get_dispatch@PLT
- movq (%rsp), %xmm0
- addq $8, %rsp
- movq 1840(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1840(%rax), %r11
- jmp *%r11
-1:
- subq $8, %rsp
- movq %xmm0, (%rsp)
- call _glapi_get_dispatch
- movq (%rsp), %xmm0
- addq $8, %rsp
- movq 1840(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(EvalCoord1f), .-GL_PREFIX(EvalCoord1f)
-
- .p2align 4,,15
- .globl GL_PREFIX(EvalCoord1fv)
- .type GL_PREFIX(EvalCoord1fv), @function
-GL_PREFIX(EvalCoord1fv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1848(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 1848(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1848(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 1848(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(EvalCoord1fv), .-GL_PREFIX(EvalCoord1fv)
-
- .p2align 4,,15
- .globl GL_PREFIX(EvalCoord2d)
- .type GL_PREFIX(EvalCoord2d), @function
-GL_PREFIX(EvalCoord2d):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1856(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $24, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $24, %rsp
- movq 1856(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1856(%rax), %r11
- jmp *%r11
-1:
- subq $24, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- call _glapi_get_dispatch
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $24, %rsp
- movq 1856(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(EvalCoord2d), .-GL_PREFIX(EvalCoord2d)
-
- .p2align 4,,15
- .globl GL_PREFIX(EvalCoord2dv)
- .type GL_PREFIX(EvalCoord2dv), @function
-GL_PREFIX(EvalCoord2dv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1864(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 1864(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1864(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 1864(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(EvalCoord2dv), .-GL_PREFIX(EvalCoord2dv)
-
- .p2align 4,,15
- .globl GL_PREFIX(EvalCoord2f)
- .type GL_PREFIX(EvalCoord2f), @function
-GL_PREFIX(EvalCoord2f):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1872(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $24, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $24, %rsp
- movq 1872(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1872(%rax), %r11
- jmp *%r11
-1:
- subq $24, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- call _glapi_get_dispatch
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $24, %rsp
- movq 1872(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(EvalCoord2f), .-GL_PREFIX(EvalCoord2f)
-
- .p2align 4,,15
- .globl GL_PREFIX(EvalCoord2fv)
- .type GL_PREFIX(EvalCoord2fv), @function
-GL_PREFIX(EvalCoord2fv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1880(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 1880(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1880(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 1880(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(EvalCoord2fv), .-GL_PREFIX(EvalCoord2fv)
-
- .p2align 4,,15
- .globl GL_PREFIX(EvalMesh1)
- .type GL_PREFIX(EvalMesh1), @function
-GL_PREFIX(EvalMesh1):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1888(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 1888(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1888(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 1888(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(EvalMesh1), .-GL_PREFIX(EvalMesh1)
-
- .p2align 4,,15
- .globl GL_PREFIX(EvalPoint1)
- .type GL_PREFIX(EvalPoint1), @function
-GL_PREFIX(EvalPoint1):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1896(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 1896(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1896(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 1896(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(EvalPoint1), .-GL_PREFIX(EvalPoint1)
-
- .p2align 4,,15
- .globl GL_PREFIX(EvalMesh2)
- .type GL_PREFIX(EvalMesh2), @function
-GL_PREFIX(EvalMesh2):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1904(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- call _x86_64_get_dispatch@PLT
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 1904(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1904(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- call _glapi_get_dispatch
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 1904(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(EvalMesh2), .-GL_PREFIX(EvalMesh2)
-
- .p2align 4,,15
- .globl GL_PREFIX(EvalPoint2)
- .type GL_PREFIX(EvalPoint2), @function
-GL_PREFIX(EvalPoint2):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1912(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 1912(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1912(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 1912(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(EvalPoint2), .-GL_PREFIX(EvalPoint2)
-
- .p2align 4,,15
- .globl GL_PREFIX(AlphaFunc)
- .type GL_PREFIX(AlphaFunc), @function
-GL_PREFIX(AlphaFunc):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1920(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 1920(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1920(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 1920(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(AlphaFunc), .-GL_PREFIX(AlphaFunc)
-
- .p2align 4,,15
- .globl GL_PREFIX(BlendFunc)
- .type GL_PREFIX(BlendFunc), @function
-GL_PREFIX(BlendFunc):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1928(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 1928(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1928(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 1928(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(BlendFunc), .-GL_PREFIX(BlendFunc)
-
- .p2align 4,,15
- .globl GL_PREFIX(LogicOp)
- .type GL_PREFIX(LogicOp), @function
-GL_PREFIX(LogicOp):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1936(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 1936(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1936(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 1936(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(LogicOp), .-GL_PREFIX(LogicOp)
-
- .p2align 4,,15
- .globl GL_PREFIX(StencilFunc)
- .type GL_PREFIX(StencilFunc), @function
-GL_PREFIX(StencilFunc):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1944(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 1944(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1944(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 1944(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(StencilFunc), .-GL_PREFIX(StencilFunc)
-
- .p2align 4,,15
- .globl GL_PREFIX(StencilOp)
- .type GL_PREFIX(StencilOp), @function
-GL_PREFIX(StencilOp):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1952(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 1952(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1952(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 1952(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(StencilOp), .-GL_PREFIX(StencilOp)
-
- .p2align 4,,15
- .globl GL_PREFIX(DepthFunc)
- .type GL_PREFIX(DepthFunc), @function
-GL_PREFIX(DepthFunc):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1960(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 1960(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1960(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 1960(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(DepthFunc), .-GL_PREFIX(DepthFunc)
-
- .p2align 4,,15
- .globl GL_PREFIX(PixelZoom)
- .type GL_PREFIX(PixelZoom), @function
-GL_PREFIX(PixelZoom):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1968(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $24, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $24, %rsp
- movq 1968(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1968(%rax), %r11
- jmp *%r11
-1:
- subq $24, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- call _glapi_get_dispatch
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $24, %rsp
- movq 1968(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(PixelZoom), .-GL_PREFIX(PixelZoom)
-
- .p2align 4,,15
- .globl GL_PREFIX(PixelTransferf)
- .type GL_PREFIX(PixelTransferf), @function
-GL_PREFIX(PixelTransferf):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1976(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $24, %rsp
- movq %rdi, (%rsp)
- movq %xmm0, 8(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 8(%rsp), %xmm0
- movq (%rsp), %rdi
- addq $24, %rsp
- movq 1976(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1976(%rax), %r11
- jmp *%r11
-1:
- subq $24, %rsp
- movq %rdi, (%rsp)
- movq %xmm0, 8(%rsp)
- call _glapi_get_dispatch
- movq 8(%rsp), %xmm0
- movq (%rsp), %rdi
- addq $24, %rsp
- movq 1976(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(PixelTransferf), .-GL_PREFIX(PixelTransferf)
-
- .p2align 4,,15
- .globl GL_PREFIX(PixelTransferi)
- .type GL_PREFIX(PixelTransferi), @function
-GL_PREFIX(PixelTransferi):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1984(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 1984(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1984(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 1984(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(PixelTransferi), .-GL_PREFIX(PixelTransferi)
-
- .p2align 4,,15
- .globl GL_PREFIX(PixelStoref)
- .type GL_PREFIX(PixelStoref), @function
-GL_PREFIX(PixelStoref):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 1992(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $24, %rsp
- movq %rdi, (%rsp)
- movq %xmm0, 8(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 8(%rsp), %xmm0
- movq (%rsp), %rdi
- addq $24, %rsp
- movq 1992(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 1992(%rax), %r11
- jmp *%r11
-1:
- subq $24, %rsp
- movq %rdi, (%rsp)
- movq %xmm0, 8(%rsp)
- call _glapi_get_dispatch
- movq 8(%rsp), %xmm0
- movq (%rsp), %rdi
- addq $24, %rsp
- movq 1992(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(PixelStoref), .-GL_PREFIX(PixelStoref)
-
- .p2align 4,,15
- .globl GL_PREFIX(PixelStorei)
- .type GL_PREFIX(PixelStorei), @function
-GL_PREFIX(PixelStorei):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2000(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 2000(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2000(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 2000(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(PixelStorei), .-GL_PREFIX(PixelStorei)
-
- .p2align 4,,15
- .globl GL_PREFIX(PixelMapfv)
- .type GL_PREFIX(PixelMapfv), @function
-GL_PREFIX(PixelMapfv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2008(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2008(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2008(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2008(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(PixelMapfv), .-GL_PREFIX(PixelMapfv)
-
- .p2align 4,,15
- .globl GL_PREFIX(PixelMapuiv)
- .type GL_PREFIX(PixelMapuiv), @function
-GL_PREFIX(PixelMapuiv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2016(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2016(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2016(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2016(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(PixelMapuiv), .-GL_PREFIX(PixelMapuiv)
-
- .p2align 4,,15
- .globl GL_PREFIX(PixelMapusv)
- .type GL_PREFIX(PixelMapusv), @function
-GL_PREFIX(PixelMapusv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2024(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2024(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2024(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2024(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(PixelMapusv), .-GL_PREFIX(PixelMapusv)
-
- .p2align 4,,15
- .globl GL_PREFIX(ReadBuffer)
- .type GL_PREFIX(ReadBuffer), @function
-GL_PREFIX(ReadBuffer):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2032(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 2032(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2032(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 2032(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(ReadBuffer), .-GL_PREFIX(ReadBuffer)
-
- .p2align 4,,15
- .globl GL_PREFIX(CopyPixels)
- .type GL_PREFIX(CopyPixels), @function
-GL_PREFIX(CopyPixels):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2040(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- call _x86_64_get_dispatch@PLT
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2040(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2040(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- call _glapi_get_dispatch
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2040(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(CopyPixels), .-GL_PREFIX(CopyPixels)
-
- .p2align 4,,15
- .globl GL_PREFIX(ReadPixels)
- .type GL_PREFIX(ReadPixels), @function
-GL_PREFIX(ReadPixels):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2048(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- pushq %r9
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %r9
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2048(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2048(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- pushq %r9
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %r9
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2048(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(ReadPixels), .-GL_PREFIX(ReadPixels)
-
- .p2align 4,,15
- .globl GL_PREFIX(DrawPixels)
- .type GL_PREFIX(DrawPixels), @function
-GL_PREFIX(DrawPixels):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2056(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- call _x86_64_get_dispatch@PLT
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2056(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2056(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- call _glapi_get_dispatch
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2056(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(DrawPixels), .-GL_PREFIX(DrawPixels)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetBooleanv)
- .type GL_PREFIX(GetBooleanv), @function
-GL_PREFIX(GetBooleanv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2064(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 2064(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2064(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 2064(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetBooleanv), .-GL_PREFIX(GetBooleanv)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetClipPlane)
- .type GL_PREFIX(GetClipPlane), @function
-GL_PREFIX(GetClipPlane):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2072(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 2072(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2072(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 2072(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetClipPlane), .-GL_PREFIX(GetClipPlane)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetDoublev)
- .type GL_PREFIX(GetDoublev), @function
-GL_PREFIX(GetDoublev):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2080(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 2080(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2080(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 2080(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetDoublev), .-GL_PREFIX(GetDoublev)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetError)
- .type GL_PREFIX(GetError), @function
-GL_PREFIX(GetError):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2088(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- movq 2088(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2088(%rax), %r11
- jmp *%r11
-1:
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- movq 2088(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetError), .-GL_PREFIX(GetError)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetFloatv)
- .type GL_PREFIX(GetFloatv), @function
-GL_PREFIX(GetFloatv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2096(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 2096(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2096(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 2096(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetFloatv), .-GL_PREFIX(GetFloatv)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetIntegerv)
- .type GL_PREFIX(GetIntegerv), @function
-GL_PREFIX(GetIntegerv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2104(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 2104(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2104(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 2104(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetIntegerv), .-GL_PREFIX(GetIntegerv)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetLightfv)
- .type GL_PREFIX(GetLightfv), @function
-GL_PREFIX(GetLightfv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2112(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2112(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2112(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2112(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetLightfv), .-GL_PREFIX(GetLightfv)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetLightiv)
- .type GL_PREFIX(GetLightiv), @function
-GL_PREFIX(GetLightiv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2120(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2120(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2120(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2120(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetLightiv), .-GL_PREFIX(GetLightiv)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetMapdv)
- .type GL_PREFIX(GetMapdv), @function
-GL_PREFIX(GetMapdv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2128(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2128(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2128(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2128(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetMapdv), .-GL_PREFIX(GetMapdv)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetMapfv)
- .type GL_PREFIX(GetMapfv), @function
-GL_PREFIX(GetMapfv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2136(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2136(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2136(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2136(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetMapfv), .-GL_PREFIX(GetMapfv)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetMapiv)
- .type GL_PREFIX(GetMapiv), @function
-GL_PREFIX(GetMapiv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2144(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2144(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2144(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2144(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetMapiv), .-GL_PREFIX(GetMapiv)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetMaterialfv)
- .type GL_PREFIX(GetMaterialfv), @function
-GL_PREFIX(GetMaterialfv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2152(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2152(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2152(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2152(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetMaterialfv), .-GL_PREFIX(GetMaterialfv)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetMaterialiv)
- .type GL_PREFIX(GetMaterialiv), @function
-GL_PREFIX(GetMaterialiv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2160(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2160(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2160(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2160(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetMaterialiv), .-GL_PREFIX(GetMaterialiv)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetPixelMapfv)
- .type GL_PREFIX(GetPixelMapfv), @function
-GL_PREFIX(GetPixelMapfv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2168(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 2168(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2168(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 2168(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetPixelMapfv), .-GL_PREFIX(GetPixelMapfv)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetPixelMapuiv)
- .type GL_PREFIX(GetPixelMapuiv), @function
-GL_PREFIX(GetPixelMapuiv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2176(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 2176(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2176(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 2176(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetPixelMapuiv), .-GL_PREFIX(GetPixelMapuiv)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetPixelMapusv)
- .type GL_PREFIX(GetPixelMapusv), @function
-GL_PREFIX(GetPixelMapusv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2184(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 2184(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2184(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 2184(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetPixelMapusv), .-GL_PREFIX(GetPixelMapusv)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetPolygonStipple)
- .type GL_PREFIX(GetPolygonStipple), @function
-GL_PREFIX(GetPolygonStipple):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2192(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 2192(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2192(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 2192(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetPolygonStipple), .-GL_PREFIX(GetPolygonStipple)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetString)
- .type GL_PREFIX(GetString), @function
-GL_PREFIX(GetString):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2200(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 2200(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2200(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 2200(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetString), .-GL_PREFIX(GetString)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetTexEnvfv)
- .type GL_PREFIX(GetTexEnvfv), @function
-GL_PREFIX(GetTexEnvfv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2208(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2208(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2208(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2208(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetTexEnvfv), .-GL_PREFIX(GetTexEnvfv)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetTexEnviv)
- .type GL_PREFIX(GetTexEnviv), @function
-GL_PREFIX(GetTexEnviv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2216(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2216(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2216(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2216(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetTexEnviv), .-GL_PREFIX(GetTexEnviv)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetTexGendv)
- .type GL_PREFIX(GetTexGendv), @function
-GL_PREFIX(GetTexGendv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2224(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2224(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2224(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2224(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetTexGendv), .-GL_PREFIX(GetTexGendv)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetTexGenfv)
- .type GL_PREFIX(GetTexGenfv), @function
-GL_PREFIX(GetTexGenfv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2232(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2232(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2232(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2232(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetTexGenfv), .-GL_PREFIX(GetTexGenfv)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetTexGeniv)
- .type GL_PREFIX(GetTexGeniv), @function
-GL_PREFIX(GetTexGeniv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2240(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2240(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2240(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2240(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetTexGeniv), .-GL_PREFIX(GetTexGeniv)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetTexImage)
- .type GL_PREFIX(GetTexImage), @function
-GL_PREFIX(GetTexImage):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2248(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- call _x86_64_get_dispatch@PLT
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2248(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2248(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- call _glapi_get_dispatch
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2248(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetTexImage), .-GL_PREFIX(GetTexImage)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetTexParameterfv)
- .type GL_PREFIX(GetTexParameterfv), @function
-GL_PREFIX(GetTexParameterfv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2256(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2256(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2256(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2256(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetTexParameterfv), .-GL_PREFIX(GetTexParameterfv)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetTexParameteriv)
- .type GL_PREFIX(GetTexParameteriv), @function
-GL_PREFIX(GetTexParameteriv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2264(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2264(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2264(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2264(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetTexParameteriv), .-GL_PREFIX(GetTexParameteriv)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetTexLevelParameterfv)
- .type GL_PREFIX(GetTexLevelParameterfv), @function
-GL_PREFIX(GetTexLevelParameterfv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2272(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2272(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2272(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2272(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetTexLevelParameterfv), .-GL_PREFIX(GetTexLevelParameterfv)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetTexLevelParameteriv)
- .type GL_PREFIX(GetTexLevelParameteriv), @function
-GL_PREFIX(GetTexLevelParameteriv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2280(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2280(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2280(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2280(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetTexLevelParameteriv), .-GL_PREFIX(GetTexLevelParameteriv)
-
- .p2align 4,,15
- .globl GL_PREFIX(IsEnabled)
- .type GL_PREFIX(IsEnabled), @function
-GL_PREFIX(IsEnabled):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2288(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 2288(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2288(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 2288(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(IsEnabled), .-GL_PREFIX(IsEnabled)
-
- .p2align 4,,15
- .globl GL_PREFIX(IsList)
- .type GL_PREFIX(IsList), @function
-GL_PREFIX(IsList):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2296(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 2296(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2296(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 2296(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(IsList), .-GL_PREFIX(IsList)
-
- .p2align 4,,15
- .globl GL_PREFIX(DepthRange)
- .type GL_PREFIX(DepthRange), @function
-GL_PREFIX(DepthRange):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2304(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 2304(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2304(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 2304(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(DepthRange), .-GL_PREFIX(DepthRange)
-
- .p2align 4,,15
- .globl GL_PREFIX(Frustum)
- .type GL_PREFIX(Frustum), @function
-GL_PREFIX(Frustum):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2312(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $56, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- movq %xmm2, 16(%rsp)
- movq %xmm3, 24(%rsp)
- movq %xmm4, 32(%rsp)
- movq %xmm5, 40(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 40(%rsp), %xmm5
- movq 32(%rsp), %xmm4
- movq 24(%rsp), %xmm3
- movq 16(%rsp), %xmm2
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $56, %rsp
- movq 2312(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2312(%rax), %r11
- jmp *%r11
-1:
- subq $56, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- movq %xmm2, 16(%rsp)
- movq %xmm3, 24(%rsp)
- movq %xmm4, 32(%rsp)
- movq %xmm5, 40(%rsp)
- call _glapi_get_dispatch
- movq 40(%rsp), %xmm5
- movq 32(%rsp), %xmm4
- movq 24(%rsp), %xmm3
- movq 16(%rsp), %xmm2
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $56, %rsp
- movq 2312(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Frustum), .-GL_PREFIX(Frustum)
-
- .p2align 4,,15
- .globl GL_PREFIX(LoadIdentity)
- .type GL_PREFIX(LoadIdentity), @function
-GL_PREFIX(LoadIdentity):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2320(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- movq 2320(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2320(%rax), %r11
- jmp *%r11
-1:
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- movq 2320(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(LoadIdentity), .-GL_PREFIX(LoadIdentity)
-
- .p2align 4,,15
- .globl GL_PREFIX(LoadMatrixf)
- .type GL_PREFIX(LoadMatrixf), @function
-GL_PREFIX(LoadMatrixf):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2328(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 2328(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2328(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 2328(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(LoadMatrixf), .-GL_PREFIX(LoadMatrixf)
-
- .p2align 4,,15
- .globl GL_PREFIX(LoadMatrixd)
- .type GL_PREFIX(LoadMatrixd), @function
-GL_PREFIX(LoadMatrixd):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2336(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 2336(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2336(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 2336(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(LoadMatrixd), .-GL_PREFIX(LoadMatrixd)
-
- .p2align 4,,15
- .globl GL_PREFIX(MatrixMode)
- .type GL_PREFIX(MatrixMode), @function
-GL_PREFIX(MatrixMode):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2344(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 2344(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2344(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 2344(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(MatrixMode), .-GL_PREFIX(MatrixMode)
-
- .p2align 4,,15
- .globl GL_PREFIX(MultMatrixf)
- .type GL_PREFIX(MultMatrixf), @function
-GL_PREFIX(MultMatrixf):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2352(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 2352(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2352(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 2352(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(MultMatrixf), .-GL_PREFIX(MultMatrixf)
-
- .p2align 4,,15
- .globl GL_PREFIX(MultMatrixd)
- .type GL_PREFIX(MultMatrixd), @function
-GL_PREFIX(MultMatrixd):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2360(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 2360(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2360(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 2360(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(MultMatrixd), .-GL_PREFIX(MultMatrixd)
-
- .p2align 4,,15
- .globl GL_PREFIX(Ortho)
- .type GL_PREFIX(Ortho), @function
-GL_PREFIX(Ortho):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2368(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $56, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- movq %xmm2, 16(%rsp)
- movq %xmm3, 24(%rsp)
- movq %xmm4, 32(%rsp)
- movq %xmm5, 40(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 40(%rsp), %xmm5
- movq 32(%rsp), %xmm4
- movq 24(%rsp), %xmm3
- movq 16(%rsp), %xmm2
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $56, %rsp
- movq 2368(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2368(%rax), %r11
- jmp *%r11
-1:
- subq $56, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- movq %xmm2, 16(%rsp)
- movq %xmm3, 24(%rsp)
- movq %xmm4, 32(%rsp)
- movq %xmm5, 40(%rsp)
- call _glapi_get_dispatch
- movq 40(%rsp), %xmm5
- movq 32(%rsp), %xmm4
- movq 24(%rsp), %xmm3
- movq 16(%rsp), %xmm2
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $56, %rsp
- movq 2368(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Ortho), .-GL_PREFIX(Ortho)
-
- .p2align 4,,15
- .globl GL_PREFIX(PopMatrix)
- .type GL_PREFIX(PopMatrix), @function
-GL_PREFIX(PopMatrix):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2376(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- movq 2376(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2376(%rax), %r11
- jmp *%r11
-1:
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- movq 2376(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(PopMatrix), .-GL_PREFIX(PopMatrix)
-
- .p2align 4,,15
- .globl GL_PREFIX(PushMatrix)
- .type GL_PREFIX(PushMatrix), @function
-GL_PREFIX(PushMatrix):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2384(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- movq 2384(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2384(%rax), %r11
- jmp *%r11
-1:
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- movq 2384(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(PushMatrix), .-GL_PREFIX(PushMatrix)
-
- .p2align 4,,15
- .globl GL_PREFIX(Rotated)
- .type GL_PREFIX(Rotated), @function
-GL_PREFIX(Rotated):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2392(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $40, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- movq %xmm2, 16(%rsp)
- movq %xmm3, 24(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 24(%rsp), %xmm3
- movq 16(%rsp), %xmm2
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $40, %rsp
- movq 2392(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2392(%rax), %r11
- jmp *%r11
-1:
- subq $40, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- movq %xmm2, 16(%rsp)
- movq %xmm3, 24(%rsp)
- call _glapi_get_dispatch
- movq 24(%rsp), %xmm3
- movq 16(%rsp), %xmm2
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $40, %rsp
- movq 2392(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Rotated), .-GL_PREFIX(Rotated)
-
- .p2align 4,,15
- .globl GL_PREFIX(Rotatef)
- .type GL_PREFIX(Rotatef), @function
-GL_PREFIX(Rotatef):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2400(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $40, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- movq %xmm2, 16(%rsp)
- movq %xmm3, 24(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 24(%rsp), %xmm3
- movq 16(%rsp), %xmm2
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $40, %rsp
- movq 2400(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2400(%rax), %r11
- jmp *%r11
-1:
- subq $40, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- movq %xmm2, 16(%rsp)
- movq %xmm3, 24(%rsp)
- call _glapi_get_dispatch
- movq 24(%rsp), %xmm3
- movq 16(%rsp), %xmm2
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $40, %rsp
- movq 2400(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Rotatef), .-GL_PREFIX(Rotatef)
-
- .p2align 4,,15
- .globl GL_PREFIX(Scaled)
- .type GL_PREFIX(Scaled), @function
-GL_PREFIX(Scaled):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2408(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $24, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- movq %xmm2, 16(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 16(%rsp), %xmm2
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $24, %rsp
- movq 2408(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2408(%rax), %r11
- jmp *%r11
-1:
- subq $24, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- movq %xmm2, 16(%rsp)
- call _glapi_get_dispatch
- movq 16(%rsp), %xmm2
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $24, %rsp
- movq 2408(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Scaled), .-GL_PREFIX(Scaled)
-
- .p2align 4,,15
- .globl GL_PREFIX(Scalef)
- .type GL_PREFIX(Scalef), @function
-GL_PREFIX(Scalef):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2416(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $24, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- movq %xmm2, 16(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 16(%rsp), %xmm2
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $24, %rsp
- movq 2416(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2416(%rax), %r11
- jmp *%r11
-1:
- subq $24, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- movq %xmm2, 16(%rsp)
- call _glapi_get_dispatch
- movq 16(%rsp), %xmm2
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $24, %rsp
- movq 2416(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Scalef), .-GL_PREFIX(Scalef)
-
- .p2align 4,,15
- .globl GL_PREFIX(Translated)
- .type GL_PREFIX(Translated), @function
-GL_PREFIX(Translated):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2424(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $24, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- movq %xmm2, 16(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 16(%rsp), %xmm2
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $24, %rsp
- movq 2424(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2424(%rax), %r11
- jmp *%r11
-1:
- subq $24, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- movq %xmm2, 16(%rsp)
- call _glapi_get_dispatch
- movq 16(%rsp), %xmm2
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $24, %rsp
- movq 2424(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Translated), .-GL_PREFIX(Translated)
-
- .p2align 4,,15
- .globl GL_PREFIX(Translatef)
- .type GL_PREFIX(Translatef), @function
-GL_PREFIX(Translatef):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2432(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $24, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- movq %xmm2, 16(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 16(%rsp), %xmm2
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $24, %rsp
- movq 2432(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2432(%rax), %r11
- jmp *%r11
-1:
- subq $24, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- movq %xmm2, 16(%rsp)
- call _glapi_get_dispatch
- movq 16(%rsp), %xmm2
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $24, %rsp
- movq 2432(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Translatef), .-GL_PREFIX(Translatef)
-
- .p2align 4,,15
- .globl GL_PREFIX(Viewport)
- .type GL_PREFIX(Viewport), @function
-GL_PREFIX(Viewport):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2440(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2440(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2440(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2440(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Viewport), .-GL_PREFIX(Viewport)
-
- .p2align 4,,15
- .globl GL_PREFIX(ArrayElement)
- .type GL_PREFIX(ArrayElement), @function
-GL_PREFIX(ArrayElement):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2448(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 2448(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2448(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 2448(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(ArrayElement), .-GL_PREFIX(ArrayElement)
-
- .p2align 4,,15
- .globl GL_PREFIX(BindTexture)
- .type GL_PREFIX(BindTexture), @function
-GL_PREFIX(BindTexture):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2456(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 2456(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2456(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 2456(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(BindTexture), .-GL_PREFIX(BindTexture)
-
- .p2align 4,,15
- .globl GL_PREFIX(ColorPointer)
- .type GL_PREFIX(ColorPointer), @function
-GL_PREFIX(ColorPointer):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2464(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2464(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2464(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2464(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(ColorPointer), .-GL_PREFIX(ColorPointer)
-
- .p2align 4,,15
- .globl GL_PREFIX(DisableClientState)
- .type GL_PREFIX(DisableClientState), @function
-GL_PREFIX(DisableClientState):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2472(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 2472(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2472(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 2472(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(DisableClientState), .-GL_PREFIX(DisableClientState)
-
- .p2align 4,,15
- .globl GL_PREFIX(DrawArrays)
- .type GL_PREFIX(DrawArrays), @function
-GL_PREFIX(DrawArrays):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2480(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2480(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2480(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2480(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(DrawArrays), .-GL_PREFIX(DrawArrays)
-
- .p2align 4,,15
- .globl GL_PREFIX(DrawElements)
- .type GL_PREFIX(DrawElements), @function
-GL_PREFIX(DrawElements):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2488(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2488(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2488(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2488(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(DrawElements), .-GL_PREFIX(DrawElements)
-
- .p2align 4,,15
- .globl GL_PREFIX(EdgeFlagPointer)
- .type GL_PREFIX(EdgeFlagPointer), @function
-GL_PREFIX(EdgeFlagPointer):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2496(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 2496(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2496(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 2496(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(EdgeFlagPointer), .-GL_PREFIX(EdgeFlagPointer)
-
- .p2align 4,,15
- .globl GL_PREFIX(EnableClientState)
- .type GL_PREFIX(EnableClientState), @function
-GL_PREFIX(EnableClientState):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2504(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 2504(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2504(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 2504(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(EnableClientState), .-GL_PREFIX(EnableClientState)
-
- .p2align 4,,15
- .globl GL_PREFIX(IndexPointer)
- .type GL_PREFIX(IndexPointer), @function
-GL_PREFIX(IndexPointer):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2512(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2512(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2512(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2512(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(IndexPointer), .-GL_PREFIX(IndexPointer)
-
- .p2align 4,,15
- .globl GL_PREFIX(Indexub)
- .type GL_PREFIX(Indexub), @function
-GL_PREFIX(Indexub):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2520(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 2520(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2520(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 2520(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Indexub), .-GL_PREFIX(Indexub)
-
- .p2align 4,,15
- .globl GL_PREFIX(Indexubv)
- .type GL_PREFIX(Indexubv), @function
-GL_PREFIX(Indexubv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2528(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 2528(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2528(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 2528(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Indexubv), .-GL_PREFIX(Indexubv)
-
- .p2align 4,,15
- .globl GL_PREFIX(InterleavedArrays)
- .type GL_PREFIX(InterleavedArrays), @function
-GL_PREFIX(InterleavedArrays):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2536(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2536(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2536(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2536(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(InterleavedArrays), .-GL_PREFIX(InterleavedArrays)
-
- .p2align 4,,15
- .globl GL_PREFIX(NormalPointer)
- .type GL_PREFIX(NormalPointer), @function
-GL_PREFIX(NormalPointer):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2544(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2544(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2544(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2544(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(NormalPointer), .-GL_PREFIX(NormalPointer)
-
- .p2align 4,,15
- .globl GL_PREFIX(PolygonOffset)
- .type GL_PREFIX(PolygonOffset), @function
-GL_PREFIX(PolygonOffset):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2552(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $24, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $24, %rsp
- movq 2552(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2552(%rax), %r11
- jmp *%r11
-1:
- subq $24, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- call _glapi_get_dispatch
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $24, %rsp
- movq 2552(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(PolygonOffset), .-GL_PREFIX(PolygonOffset)
-
- .p2align 4,,15
- .globl GL_PREFIX(TexCoordPointer)
- .type GL_PREFIX(TexCoordPointer), @function
-GL_PREFIX(TexCoordPointer):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2560(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2560(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2560(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2560(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(TexCoordPointer), .-GL_PREFIX(TexCoordPointer)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexPointer)
- .type GL_PREFIX(VertexPointer), @function
-GL_PREFIX(VertexPointer):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2568(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2568(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2568(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2568(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexPointer), .-GL_PREFIX(VertexPointer)
-
- .p2align 4,,15
- .globl GL_PREFIX(AreTexturesResident)
- .type GL_PREFIX(AreTexturesResident), @function
-GL_PREFIX(AreTexturesResident):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2576(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2576(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2576(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2576(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(AreTexturesResident), .-GL_PREFIX(AreTexturesResident)
-
- .p2align 4,,15
- .globl GL_PREFIX(CopyTexImage1D)
- .type GL_PREFIX(CopyTexImage1D), @function
-GL_PREFIX(CopyTexImage1D):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2584(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- pushq %r9
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %r9
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2584(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2584(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- pushq %r9
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %r9
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2584(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(CopyTexImage1D), .-GL_PREFIX(CopyTexImage1D)
-
- .p2align 4,,15
- .globl GL_PREFIX(CopyTexImage2D)
- .type GL_PREFIX(CopyTexImage2D), @function
-GL_PREFIX(CopyTexImage2D):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2592(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- pushq %r9
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %r9
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2592(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2592(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- pushq %r9
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %r9
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2592(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(CopyTexImage2D), .-GL_PREFIX(CopyTexImage2D)
-
- .p2align 4,,15
- .globl GL_PREFIX(CopyTexSubImage1D)
- .type GL_PREFIX(CopyTexSubImage1D), @function
-GL_PREFIX(CopyTexSubImage1D):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2600(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- pushq %r9
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %r9
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2600(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2600(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- pushq %r9
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %r9
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2600(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(CopyTexSubImage1D), .-GL_PREFIX(CopyTexSubImage1D)
-
- .p2align 4,,15
- .globl GL_PREFIX(CopyTexSubImage2D)
- .type GL_PREFIX(CopyTexSubImage2D), @function
-GL_PREFIX(CopyTexSubImage2D):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2608(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- pushq %r9
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %r9
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2608(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2608(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- pushq %r9
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %r9
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2608(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(CopyTexSubImage2D), .-GL_PREFIX(CopyTexSubImage2D)
-
- .p2align 4,,15
- .globl GL_PREFIX(DeleteTextures)
- .type GL_PREFIX(DeleteTextures), @function
-GL_PREFIX(DeleteTextures):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2616(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 2616(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2616(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 2616(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(DeleteTextures), .-GL_PREFIX(DeleteTextures)
-
- .p2align 4,,15
- .globl GL_PREFIX(GenTextures)
- .type GL_PREFIX(GenTextures), @function
-GL_PREFIX(GenTextures):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2624(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 2624(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2624(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 2624(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GenTextures), .-GL_PREFIX(GenTextures)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetPointerv)
- .type GL_PREFIX(GetPointerv), @function
-GL_PREFIX(GetPointerv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2632(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 2632(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2632(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 2632(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetPointerv), .-GL_PREFIX(GetPointerv)
-
- .p2align 4,,15
- .globl GL_PREFIX(IsTexture)
- .type GL_PREFIX(IsTexture), @function
-GL_PREFIX(IsTexture):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2640(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 2640(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2640(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 2640(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(IsTexture), .-GL_PREFIX(IsTexture)
-
- .p2align 4,,15
- .globl GL_PREFIX(PrioritizeTextures)
- .type GL_PREFIX(PrioritizeTextures), @function
-GL_PREFIX(PrioritizeTextures):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2648(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2648(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2648(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2648(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(PrioritizeTextures), .-GL_PREFIX(PrioritizeTextures)
-
- .p2align 4,,15
- .globl GL_PREFIX(TexSubImage1D)
- .type GL_PREFIX(TexSubImage1D), @function
-GL_PREFIX(TexSubImage1D):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2656(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- pushq %r9
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %r9
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2656(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2656(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- pushq %r9
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %r9
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2656(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(TexSubImage1D), .-GL_PREFIX(TexSubImage1D)
-
- .p2align 4,,15
- .globl GL_PREFIX(TexSubImage2D)
- .type GL_PREFIX(TexSubImage2D), @function
-GL_PREFIX(TexSubImage2D):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2664(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- pushq %r9
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %r9
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2664(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2664(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- pushq %r9
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %r9
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2664(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(TexSubImage2D), .-GL_PREFIX(TexSubImage2D)
-
- .p2align 4,,15
- .globl GL_PREFIX(PopClientAttrib)
- .type GL_PREFIX(PopClientAttrib), @function
-GL_PREFIX(PopClientAttrib):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2672(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- movq 2672(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2672(%rax), %r11
- jmp *%r11
-1:
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- movq 2672(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(PopClientAttrib), .-GL_PREFIX(PopClientAttrib)
-
- .p2align 4,,15
- .globl GL_PREFIX(PushClientAttrib)
- .type GL_PREFIX(PushClientAttrib), @function
-GL_PREFIX(PushClientAttrib):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2680(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 2680(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2680(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 2680(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(PushClientAttrib), .-GL_PREFIX(PushClientAttrib)
-
- .p2align 4,,15
- .globl GL_PREFIX(BlendColor)
- .type GL_PREFIX(BlendColor), @function
-GL_PREFIX(BlendColor):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2688(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2688(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2688(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2688(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(BlendColor), .-GL_PREFIX(BlendColor)
-
- .p2align 4,,15
- .globl GL_PREFIX(BlendEquation)
- .type GL_PREFIX(BlendEquation), @function
-GL_PREFIX(BlendEquation):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2696(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 2696(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2696(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 2696(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(BlendEquation), .-GL_PREFIX(BlendEquation)
-
- .p2align 4,,15
- .globl GL_PREFIX(DrawRangeElements)
- .type GL_PREFIX(DrawRangeElements), @function
-GL_PREFIX(DrawRangeElements):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2704(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- pushq %r9
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %r9
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2704(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2704(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- pushq %r9
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %r9
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2704(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(DrawRangeElements), .-GL_PREFIX(DrawRangeElements)
-
- .p2align 4,,15
- .globl GL_PREFIX(ColorTable)
- .type GL_PREFIX(ColorTable), @function
-GL_PREFIX(ColorTable):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2712(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- pushq %r9
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %r9
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2712(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2712(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- pushq %r9
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %r9
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2712(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(ColorTable), .-GL_PREFIX(ColorTable)
-
- .p2align 4,,15
- .globl GL_PREFIX(ColorTableParameterfv)
- .type GL_PREFIX(ColorTableParameterfv), @function
-GL_PREFIX(ColorTableParameterfv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2720(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2720(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2720(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2720(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(ColorTableParameterfv), .-GL_PREFIX(ColorTableParameterfv)
-
- .p2align 4,,15
- .globl GL_PREFIX(ColorTableParameteriv)
- .type GL_PREFIX(ColorTableParameteriv), @function
-GL_PREFIX(ColorTableParameteriv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2728(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2728(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2728(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2728(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(ColorTableParameteriv), .-GL_PREFIX(ColorTableParameteriv)
-
- .p2align 4,,15
- .globl GL_PREFIX(CopyColorTable)
- .type GL_PREFIX(CopyColorTable), @function
-GL_PREFIX(CopyColorTable):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2736(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- call _x86_64_get_dispatch@PLT
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2736(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2736(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- call _glapi_get_dispatch
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2736(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(CopyColorTable), .-GL_PREFIX(CopyColorTable)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetColorTable)
- .type GL_PREFIX(GetColorTable), @function
-GL_PREFIX(GetColorTable):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2744(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2744(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2744(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2744(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetColorTable), .-GL_PREFIX(GetColorTable)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetColorTableParameterfv)
- .type GL_PREFIX(GetColorTableParameterfv), @function
-GL_PREFIX(GetColorTableParameterfv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2752(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2752(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2752(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2752(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetColorTableParameterfv), .-GL_PREFIX(GetColorTableParameterfv)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetColorTableParameteriv)
- .type GL_PREFIX(GetColorTableParameteriv), @function
-GL_PREFIX(GetColorTableParameteriv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2760(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2760(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2760(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2760(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetColorTableParameteriv), .-GL_PREFIX(GetColorTableParameteriv)
-
- .p2align 4,,15
- .globl GL_PREFIX(ColorSubTable)
- .type GL_PREFIX(ColorSubTable), @function
-GL_PREFIX(ColorSubTable):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2768(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- pushq %r9
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %r9
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2768(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2768(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- pushq %r9
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %r9
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2768(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(ColorSubTable), .-GL_PREFIX(ColorSubTable)
-
- .p2align 4,,15
- .globl GL_PREFIX(CopyColorSubTable)
- .type GL_PREFIX(CopyColorSubTable), @function
-GL_PREFIX(CopyColorSubTable):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2776(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- call _x86_64_get_dispatch@PLT
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2776(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2776(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- call _glapi_get_dispatch
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2776(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(CopyColorSubTable), .-GL_PREFIX(CopyColorSubTable)
-
- .p2align 4,,15
- .globl GL_PREFIX(ConvolutionFilter1D)
- .type GL_PREFIX(ConvolutionFilter1D), @function
-GL_PREFIX(ConvolutionFilter1D):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2784(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- pushq %r9
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %r9
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2784(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2784(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- pushq %r9
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %r9
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2784(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(ConvolutionFilter1D), .-GL_PREFIX(ConvolutionFilter1D)
-
- .p2align 4,,15
- .globl GL_PREFIX(ConvolutionFilter2D)
- .type GL_PREFIX(ConvolutionFilter2D), @function
-GL_PREFIX(ConvolutionFilter2D):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2792(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- pushq %r9
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %r9
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2792(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2792(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- pushq %r9
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %r9
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2792(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(ConvolutionFilter2D), .-GL_PREFIX(ConvolutionFilter2D)
-
- .p2align 4,,15
- .globl GL_PREFIX(ConvolutionParameterf)
- .type GL_PREFIX(ConvolutionParameterf), @function
-GL_PREFIX(ConvolutionParameterf):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2800(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $24, %rsp
- movq %rdi, (%rsp)
- movq %rsi, 8(%rsp)
- movq %xmm0, 16(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 16(%rsp), %xmm0
- movq 8(%rsp), %rsi
- movq (%rsp), %rdi
- addq $24, %rsp
- movq 2800(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2800(%rax), %r11
- jmp *%r11
-1:
- subq $24, %rsp
- movq %rdi, (%rsp)
- movq %rsi, 8(%rsp)
- movq %xmm0, 16(%rsp)
- call _glapi_get_dispatch
- movq 16(%rsp), %xmm0
- movq 8(%rsp), %rsi
- movq (%rsp), %rdi
- addq $24, %rsp
- movq 2800(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(ConvolutionParameterf), .-GL_PREFIX(ConvolutionParameterf)
-
- .p2align 4,,15
- .globl GL_PREFIX(ConvolutionParameterfv)
- .type GL_PREFIX(ConvolutionParameterfv), @function
-GL_PREFIX(ConvolutionParameterfv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2808(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2808(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2808(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2808(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(ConvolutionParameterfv), .-GL_PREFIX(ConvolutionParameterfv)
-
- .p2align 4,,15
- .globl GL_PREFIX(ConvolutionParameteri)
- .type GL_PREFIX(ConvolutionParameteri), @function
-GL_PREFIX(ConvolutionParameteri):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2816(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2816(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2816(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2816(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(ConvolutionParameteri), .-GL_PREFIX(ConvolutionParameteri)
-
- .p2align 4,,15
- .globl GL_PREFIX(ConvolutionParameteriv)
- .type GL_PREFIX(ConvolutionParameteriv), @function
-GL_PREFIX(ConvolutionParameteriv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2824(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2824(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2824(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2824(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(ConvolutionParameteriv), .-GL_PREFIX(ConvolutionParameteriv)
-
- .p2align 4,,15
- .globl GL_PREFIX(CopyConvolutionFilter1D)
- .type GL_PREFIX(CopyConvolutionFilter1D), @function
-GL_PREFIX(CopyConvolutionFilter1D):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2832(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- call _x86_64_get_dispatch@PLT
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2832(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2832(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- call _glapi_get_dispatch
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2832(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(CopyConvolutionFilter1D), .-GL_PREFIX(CopyConvolutionFilter1D)
-
- .p2align 4,,15
- .globl GL_PREFIX(CopyConvolutionFilter2D)
- .type GL_PREFIX(CopyConvolutionFilter2D), @function
-GL_PREFIX(CopyConvolutionFilter2D):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2840(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- pushq %r9
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %r9
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2840(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2840(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- pushq %r9
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %r9
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2840(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(CopyConvolutionFilter2D), .-GL_PREFIX(CopyConvolutionFilter2D)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetConvolutionFilter)
- .type GL_PREFIX(GetConvolutionFilter), @function
-GL_PREFIX(GetConvolutionFilter):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2848(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2848(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2848(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2848(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetConvolutionFilter), .-GL_PREFIX(GetConvolutionFilter)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetConvolutionParameterfv)
- .type GL_PREFIX(GetConvolutionParameterfv), @function
-GL_PREFIX(GetConvolutionParameterfv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2856(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2856(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2856(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2856(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetConvolutionParameterfv), .-GL_PREFIX(GetConvolutionParameterfv)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetConvolutionParameteriv)
- .type GL_PREFIX(GetConvolutionParameteriv), @function
-GL_PREFIX(GetConvolutionParameteriv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2864(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2864(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2864(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2864(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetConvolutionParameteriv), .-GL_PREFIX(GetConvolutionParameteriv)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetSeparableFilter)
- .type GL_PREFIX(GetSeparableFilter), @function
-GL_PREFIX(GetSeparableFilter):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2872(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- pushq %r9
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %r9
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2872(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2872(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- pushq %r9
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %r9
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2872(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetSeparableFilter), .-GL_PREFIX(GetSeparableFilter)
-
- .p2align 4,,15
- .globl GL_PREFIX(SeparableFilter2D)
- .type GL_PREFIX(SeparableFilter2D), @function
-GL_PREFIX(SeparableFilter2D):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2880(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- pushq %r9
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %r9
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2880(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2880(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- pushq %r9
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %r9
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2880(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(SeparableFilter2D), .-GL_PREFIX(SeparableFilter2D)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetHistogram)
- .type GL_PREFIX(GetHistogram), @function
-GL_PREFIX(GetHistogram):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2888(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- call _x86_64_get_dispatch@PLT
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2888(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2888(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- call _glapi_get_dispatch
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2888(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetHistogram), .-GL_PREFIX(GetHistogram)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetHistogramParameterfv)
- .type GL_PREFIX(GetHistogramParameterfv), @function
-GL_PREFIX(GetHistogramParameterfv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2896(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2896(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2896(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2896(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetHistogramParameterfv), .-GL_PREFIX(GetHistogramParameterfv)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetHistogramParameteriv)
- .type GL_PREFIX(GetHistogramParameteriv), @function
-GL_PREFIX(GetHistogramParameteriv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2904(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2904(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2904(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2904(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetHistogramParameteriv), .-GL_PREFIX(GetHistogramParameteriv)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetMinmax)
- .type GL_PREFIX(GetMinmax), @function
-GL_PREFIX(GetMinmax):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2912(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- call _x86_64_get_dispatch@PLT
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2912(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2912(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- call _glapi_get_dispatch
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2912(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetMinmax), .-GL_PREFIX(GetMinmax)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetMinmaxParameterfv)
- .type GL_PREFIX(GetMinmaxParameterfv), @function
-GL_PREFIX(GetMinmaxParameterfv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2920(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2920(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2920(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2920(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetMinmaxParameterfv), .-GL_PREFIX(GetMinmaxParameterfv)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetMinmaxParameteriv)
- .type GL_PREFIX(GetMinmaxParameteriv), @function
-GL_PREFIX(GetMinmaxParameteriv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2928(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2928(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2928(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2928(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetMinmaxParameteriv), .-GL_PREFIX(GetMinmaxParameteriv)
-
- .p2align 4,,15
- .globl GL_PREFIX(Histogram)
- .type GL_PREFIX(Histogram), @function
-GL_PREFIX(Histogram):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2936(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2936(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2936(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2936(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Histogram), .-GL_PREFIX(Histogram)
-
- .p2align 4,,15
- .globl GL_PREFIX(Minmax)
- .type GL_PREFIX(Minmax), @function
-GL_PREFIX(Minmax):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2944(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2944(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2944(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2944(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Minmax), .-GL_PREFIX(Minmax)
-
- .p2align 4,,15
- .globl GL_PREFIX(ResetHistogram)
- .type GL_PREFIX(ResetHistogram), @function
-GL_PREFIX(ResetHistogram):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2952(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 2952(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2952(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 2952(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(ResetHistogram), .-GL_PREFIX(ResetHistogram)
-
- .p2align 4,,15
- .globl GL_PREFIX(ResetMinmax)
- .type GL_PREFIX(ResetMinmax), @function
-GL_PREFIX(ResetMinmax):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2960(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 2960(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2960(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 2960(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(ResetMinmax), .-GL_PREFIX(ResetMinmax)
-
- .p2align 4,,15
- .globl GL_PREFIX(TexImage3D)
- .type GL_PREFIX(TexImage3D), @function
-GL_PREFIX(TexImage3D):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2968(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- pushq %r9
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %r9
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2968(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2968(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- pushq %r9
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %r9
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2968(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(TexImage3D), .-GL_PREFIX(TexImage3D)
-
- .p2align 4,,15
- .globl GL_PREFIX(TexSubImage3D)
- .type GL_PREFIX(TexSubImage3D), @function
-GL_PREFIX(TexSubImage3D):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2976(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- pushq %r9
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %r9
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2976(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2976(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- pushq %r9
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %r9
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2976(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(TexSubImage3D), .-GL_PREFIX(TexSubImage3D)
-
- .p2align 4,,15
- .globl GL_PREFIX(CopyTexSubImage3D)
- .type GL_PREFIX(CopyTexSubImage3D), @function
-GL_PREFIX(CopyTexSubImage3D):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2984(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- pushq %r9
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %r9
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2984(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2984(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- pushq %r9
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %r9
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 2984(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(CopyTexSubImage3D), .-GL_PREFIX(CopyTexSubImage3D)
-
- .p2align 4,,15
- .globl GL_PREFIX(ActiveTextureARB)
- .type GL_PREFIX(ActiveTextureARB), @function
-GL_PREFIX(ActiveTextureARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 2992(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 2992(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 2992(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 2992(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(ActiveTextureARB), .-GL_PREFIX(ActiveTextureARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(ClientActiveTextureARB)
- .type GL_PREFIX(ClientActiveTextureARB), @function
-GL_PREFIX(ClientActiveTextureARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3000(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 3000(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3000(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 3000(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(ClientActiveTextureARB), .-GL_PREFIX(ClientActiveTextureARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(MultiTexCoord1dARB)
- .type GL_PREFIX(MultiTexCoord1dARB), @function
-GL_PREFIX(MultiTexCoord1dARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3008(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $24, %rsp
- movq %rdi, (%rsp)
- movq %xmm0, 8(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 8(%rsp), %xmm0
- movq (%rsp), %rdi
- addq $24, %rsp
- movq 3008(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3008(%rax), %r11
- jmp *%r11
-1:
- subq $24, %rsp
- movq %rdi, (%rsp)
- movq %xmm0, 8(%rsp)
- call _glapi_get_dispatch
- movq 8(%rsp), %xmm0
- movq (%rsp), %rdi
- addq $24, %rsp
- movq 3008(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(MultiTexCoord1dARB), .-GL_PREFIX(MultiTexCoord1dARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(MultiTexCoord1dvARB)
- .type GL_PREFIX(MultiTexCoord1dvARB), @function
-GL_PREFIX(MultiTexCoord1dvARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3016(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 3016(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3016(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 3016(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(MultiTexCoord1dvARB), .-GL_PREFIX(MultiTexCoord1dvARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(MultiTexCoord1fARB)
- .type GL_PREFIX(MultiTexCoord1fARB), @function
-GL_PREFIX(MultiTexCoord1fARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3024(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $24, %rsp
- movq %rdi, (%rsp)
- movq %xmm0, 8(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 8(%rsp), %xmm0
- movq (%rsp), %rdi
- addq $24, %rsp
- movq 3024(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3024(%rax), %r11
- jmp *%r11
-1:
- subq $24, %rsp
- movq %rdi, (%rsp)
- movq %xmm0, 8(%rsp)
- call _glapi_get_dispatch
- movq 8(%rsp), %xmm0
- movq (%rsp), %rdi
- addq $24, %rsp
- movq 3024(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(MultiTexCoord1fARB), .-GL_PREFIX(MultiTexCoord1fARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(MultiTexCoord1fvARB)
- .type GL_PREFIX(MultiTexCoord1fvARB), @function
-GL_PREFIX(MultiTexCoord1fvARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3032(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 3032(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3032(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 3032(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(MultiTexCoord1fvARB), .-GL_PREFIX(MultiTexCoord1fvARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(MultiTexCoord1iARB)
- .type GL_PREFIX(MultiTexCoord1iARB), @function
-GL_PREFIX(MultiTexCoord1iARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3040(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 3040(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3040(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 3040(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(MultiTexCoord1iARB), .-GL_PREFIX(MultiTexCoord1iARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(MultiTexCoord1ivARB)
- .type GL_PREFIX(MultiTexCoord1ivARB), @function
-GL_PREFIX(MultiTexCoord1ivARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3048(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 3048(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3048(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 3048(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(MultiTexCoord1ivARB), .-GL_PREFIX(MultiTexCoord1ivARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(MultiTexCoord1sARB)
- .type GL_PREFIX(MultiTexCoord1sARB), @function
-GL_PREFIX(MultiTexCoord1sARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3056(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 3056(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3056(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 3056(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(MultiTexCoord1sARB), .-GL_PREFIX(MultiTexCoord1sARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(MultiTexCoord1svARB)
- .type GL_PREFIX(MultiTexCoord1svARB), @function
-GL_PREFIX(MultiTexCoord1svARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3064(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 3064(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3064(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 3064(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(MultiTexCoord1svARB), .-GL_PREFIX(MultiTexCoord1svARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(MultiTexCoord2dARB)
- .type GL_PREFIX(MultiTexCoord2dARB), @function
-GL_PREFIX(MultiTexCoord2dARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3072(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $24, %rsp
- movq %rdi, (%rsp)
- movq %xmm0, 8(%rsp)
- movq %xmm1, 16(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 16(%rsp), %xmm1
- movq 8(%rsp), %xmm0
- movq (%rsp), %rdi
- addq $24, %rsp
- movq 3072(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3072(%rax), %r11
- jmp *%r11
-1:
- subq $24, %rsp
- movq %rdi, (%rsp)
- movq %xmm0, 8(%rsp)
- movq %xmm1, 16(%rsp)
- call _glapi_get_dispatch
- movq 16(%rsp), %xmm1
- movq 8(%rsp), %xmm0
- movq (%rsp), %rdi
- addq $24, %rsp
- movq 3072(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(MultiTexCoord2dARB), .-GL_PREFIX(MultiTexCoord2dARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(MultiTexCoord2dvARB)
- .type GL_PREFIX(MultiTexCoord2dvARB), @function
-GL_PREFIX(MultiTexCoord2dvARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3080(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 3080(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3080(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 3080(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(MultiTexCoord2dvARB), .-GL_PREFIX(MultiTexCoord2dvARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(MultiTexCoord2fARB)
- .type GL_PREFIX(MultiTexCoord2fARB), @function
-GL_PREFIX(MultiTexCoord2fARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3088(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $24, %rsp
- movq %rdi, (%rsp)
- movq %xmm0, 8(%rsp)
- movq %xmm1, 16(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 16(%rsp), %xmm1
- movq 8(%rsp), %xmm0
- movq (%rsp), %rdi
- addq $24, %rsp
- movq 3088(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3088(%rax), %r11
- jmp *%r11
-1:
- subq $24, %rsp
- movq %rdi, (%rsp)
- movq %xmm0, 8(%rsp)
- movq %xmm1, 16(%rsp)
- call _glapi_get_dispatch
- movq 16(%rsp), %xmm1
- movq 8(%rsp), %xmm0
- movq (%rsp), %rdi
- addq $24, %rsp
- movq 3088(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(MultiTexCoord2fARB), .-GL_PREFIX(MultiTexCoord2fARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(MultiTexCoord2fvARB)
- .type GL_PREFIX(MultiTexCoord2fvARB), @function
-GL_PREFIX(MultiTexCoord2fvARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3096(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 3096(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3096(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 3096(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(MultiTexCoord2fvARB), .-GL_PREFIX(MultiTexCoord2fvARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(MultiTexCoord2iARB)
- .type GL_PREFIX(MultiTexCoord2iARB), @function
-GL_PREFIX(MultiTexCoord2iARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3104(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3104(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3104(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3104(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(MultiTexCoord2iARB), .-GL_PREFIX(MultiTexCoord2iARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(MultiTexCoord2ivARB)
- .type GL_PREFIX(MultiTexCoord2ivARB), @function
-GL_PREFIX(MultiTexCoord2ivARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3112(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 3112(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3112(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 3112(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(MultiTexCoord2ivARB), .-GL_PREFIX(MultiTexCoord2ivARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(MultiTexCoord2sARB)
- .type GL_PREFIX(MultiTexCoord2sARB), @function
-GL_PREFIX(MultiTexCoord2sARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3120(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3120(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3120(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3120(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(MultiTexCoord2sARB), .-GL_PREFIX(MultiTexCoord2sARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(MultiTexCoord2svARB)
- .type GL_PREFIX(MultiTexCoord2svARB), @function
-GL_PREFIX(MultiTexCoord2svARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3128(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 3128(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3128(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 3128(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(MultiTexCoord2svARB), .-GL_PREFIX(MultiTexCoord2svARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(MultiTexCoord3dARB)
- .type GL_PREFIX(MultiTexCoord3dARB), @function
-GL_PREFIX(MultiTexCoord3dARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3136(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $40, %rsp
- movq %rdi, (%rsp)
- movq %xmm0, 8(%rsp)
- movq %xmm1, 16(%rsp)
- movq %xmm2, 24(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 24(%rsp), %xmm2
- movq 16(%rsp), %xmm1
- movq 8(%rsp), %xmm0
- movq (%rsp), %rdi
- addq $40, %rsp
- movq 3136(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3136(%rax), %r11
- jmp *%r11
-1:
- subq $40, %rsp
- movq %rdi, (%rsp)
- movq %xmm0, 8(%rsp)
- movq %xmm1, 16(%rsp)
- movq %xmm2, 24(%rsp)
- call _glapi_get_dispatch
- movq 24(%rsp), %xmm2
- movq 16(%rsp), %xmm1
- movq 8(%rsp), %xmm0
- movq (%rsp), %rdi
- addq $40, %rsp
- movq 3136(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(MultiTexCoord3dARB), .-GL_PREFIX(MultiTexCoord3dARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(MultiTexCoord3dvARB)
- .type GL_PREFIX(MultiTexCoord3dvARB), @function
-GL_PREFIX(MultiTexCoord3dvARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3144(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 3144(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3144(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 3144(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(MultiTexCoord3dvARB), .-GL_PREFIX(MultiTexCoord3dvARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(MultiTexCoord3fARB)
- .type GL_PREFIX(MultiTexCoord3fARB), @function
-GL_PREFIX(MultiTexCoord3fARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3152(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $40, %rsp
- movq %rdi, (%rsp)
- movq %xmm0, 8(%rsp)
- movq %xmm1, 16(%rsp)
- movq %xmm2, 24(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 24(%rsp), %xmm2
- movq 16(%rsp), %xmm1
- movq 8(%rsp), %xmm0
- movq (%rsp), %rdi
- addq $40, %rsp
- movq 3152(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3152(%rax), %r11
- jmp *%r11
-1:
- subq $40, %rsp
- movq %rdi, (%rsp)
- movq %xmm0, 8(%rsp)
- movq %xmm1, 16(%rsp)
- movq %xmm2, 24(%rsp)
- call _glapi_get_dispatch
- movq 24(%rsp), %xmm2
- movq 16(%rsp), %xmm1
- movq 8(%rsp), %xmm0
- movq (%rsp), %rdi
- addq $40, %rsp
- movq 3152(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(MultiTexCoord3fARB), .-GL_PREFIX(MultiTexCoord3fARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(MultiTexCoord3fvARB)
- .type GL_PREFIX(MultiTexCoord3fvARB), @function
-GL_PREFIX(MultiTexCoord3fvARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3160(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 3160(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3160(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 3160(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(MultiTexCoord3fvARB), .-GL_PREFIX(MultiTexCoord3fvARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(MultiTexCoord3iARB)
- .type GL_PREFIX(MultiTexCoord3iARB), @function
-GL_PREFIX(MultiTexCoord3iARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3168(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3168(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3168(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3168(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(MultiTexCoord3iARB), .-GL_PREFIX(MultiTexCoord3iARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(MultiTexCoord3ivARB)
- .type GL_PREFIX(MultiTexCoord3ivARB), @function
-GL_PREFIX(MultiTexCoord3ivARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3176(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 3176(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3176(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 3176(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(MultiTexCoord3ivARB), .-GL_PREFIX(MultiTexCoord3ivARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(MultiTexCoord3sARB)
- .type GL_PREFIX(MultiTexCoord3sARB), @function
-GL_PREFIX(MultiTexCoord3sARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3184(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3184(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3184(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3184(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(MultiTexCoord3sARB), .-GL_PREFIX(MultiTexCoord3sARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(MultiTexCoord3svARB)
- .type GL_PREFIX(MultiTexCoord3svARB), @function
-GL_PREFIX(MultiTexCoord3svARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3192(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 3192(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3192(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 3192(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(MultiTexCoord3svARB), .-GL_PREFIX(MultiTexCoord3svARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(MultiTexCoord4dARB)
- .type GL_PREFIX(MultiTexCoord4dARB), @function
-GL_PREFIX(MultiTexCoord4dARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3200(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $40, %rsp
- movq %rdi, (%rsp)
- movq %xmm0, 8(%rsp)
- movq %xmm1, 16(%rsp)
- movq %xmm2, 24(%rsp)
- movq %xmm3, 32(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 32(%rsp), %xmm3
- movq 24(%rsp), %xmm2
- movq 16(%rsp), %xmm1
- movq 8(%rsp), %xmm0
- movq (%rsp), %rdi
- addq $40, %rsp
- movq 3200(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3200(%rax), %r11
- jmp *%r11
-1:
- subq $40, %rsp
- movq %rdi, (%rsp)
- movq %xmm0, 8(%rsp)
- movq %xmm1, 16(%rsp)
- movq %xmm2, 24(%rsp)
- movq %xmm3, 32(%rsp)
- call _glapi_get_dispatch
- movq 32(%rsp), %xmm3
- movq 24(%rsp), %xmm2
- movq 16(%rsp), %xmm1
- movq 8(%rsp), %xmm0
- movq (%rsp), %rdi
- addq $40, %rsp
- movq 3200(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(MultiTexCoord4dARB), .-GL_PREFIX(MultiTexCoord4dARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(MultiTexCoord4dvARB)
- .type GL_PREFIX(MultiTexCoord4dvARB), @function
-GL_PREFIX(MultiTexCoord4dvARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3208(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 3208(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3208(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 3208(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(MultiTexCoord4dvARB), .-GL_PREFIX(MultiTexCoord4dvARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(MultiTexCoord4fARB)
- .type GL_PREFIX(MultiTexCoord4fARB), @function
-GL_PREFIX(MultiTexCoord4fARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3216(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $40, %rsp
- movq %rdi, (%rsp)
- movq %xmm0, 8(%rsp)
- movq %xmm1, 16(%rsp)
- movq %xmm2, 24(%rsp)
- movq %xmm3, 32(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 32(%rsp), %xmm3
- movq 24(%rsp), %xmm2
- movq 16(%rsp), %xmm1
- movq 8(%rsp), %xmm0
- movq (%rsp), %rdi
- addq $40, %rsp
- movq 3216(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3216(%rax), %r11
- jmp *%r11
-1:
- subq $40, %rsp
- movq %rdi, (%rsp)
- movq %xmm0, 8(%rsp)
- movq %xmm1, 16(%rsp)
- movq %xmm2, 24(%rsp)
- movq %xmm3, 32(%rsp)
- call _glapi_get_dispatch
- movq 32(%rsp), %xmm3
- movq 24(%rsp), %xmm2
- movq 16(%rsp), %xmm1
- movq 8(%rsp), %xmm0
- movq (%rsp), %rdi
- addq $40, %rsp
- movq 3216(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(MultiTexCoord4fARB), .-GL_PREFIX(MultiTexCoord4fARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(MultiTexCoord4fvARB)
- .type GL_PREFIX(MultiTexCoord4fvARB), @function
-GL_PREFIX(MultiTexCoord4fvARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3224(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 3224(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3224(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 3224(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(MultiTexCoord4fvARB), .-GL_PREFIX(MultiTexCoord4fvARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(MultiTexCoord4iARB)
- .type GL_PREFIX(MultiTexCoord4iARB), @function
-GL_PREFIX(MultiTexCoord4iARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3232(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- call _x86_64_get_dispatch@PLT
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3232(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3232(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- call _glapi_get_dispatch
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3232(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(MultiTexCoord4iARB), .-GL_PREFIX(MultiTexCoord4iARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(MultiTexCoord4ivARB)
- .type GL_PREFIX(MultiTexCoord4ivARB), @function
-GL_PREFIX(MultiTexCoord4ivARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3240(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 3240(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3240(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 3240(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(MultiTexCoord4ivARB), .-GL_PREFIX(MultiTexCoord4ivARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(MultiTexCoord4sARB)
- .type GL_PREFIX(MultiTexCoord4sARB), @function
-GL_PREFIX(MultiTexCoord4sARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3248(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- call _x86_64_get_dispatch@PLT
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3248(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3248(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- call _glapi_get_dispatch
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3248(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(MultiTexCoord4sARB), .-GL_PREFIX(MultiTexCoord4sARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(MultiTexCoord4svARB)
- .type GL_PREFIX(MultiTexCoord4svARB), @function
-GL_PREFIX(MultiTexCoord4svARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3256(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 3256(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3256(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 3256(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(MultiTexCoord4svARB), .-GL_PREFIX(MultiTexCoord4svARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(AttachShader)
- .type GL_PREFIX(AttachShader), @function
-GL_PREFIX(AttachShader):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3264(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 3264(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3264(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 3264(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(AttachShader), .-GL_PREFIX(AttachShader)
-
- .p2align 4,,15
- .globl GL_PREFIX(CreateProgram)
- .type GL_PREFIX(CreateProgram), @function
-GL_PREFIX(CreateProgram):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3272(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- movq 3272(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3272(%rax), %r11
- jmp *%r11
-1:
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- movq 3272(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(CreateProgram), .-GL_PREFIX(CreateProgram)
-
- .p2align 4,,15
- .globl GL_PREFIX(CreateShader)
- .type GL_PREFIX(CreateShader), @function
-GL_PREFIX(CreateShader):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3280(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 3280(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3280(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 3280(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(CreateShader), .-GL_PREFIX(CreateShader)
-
- .p2align 4,,15
- .globl GL_PREFIX(DeleteProgram)
- .type GL_PREFIX(DeleteProgram), @function
-GL_PREFIX(DeleteProgram):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3288(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 3288(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3288(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 3288(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(DeleteProgram), .-GL_PREFIX(DeleteProgram)
-
- .p2align 4,,15
- .globl GL_PREFIX(DeleteShader)
- .type GL_PREFIX(DeleteShader), @function
-GL_PREFIX(DeleteShader):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3296(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 3296(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3296(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 3296(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(DeleteShader), .-GL_PREFIX(DeleteShader)
-
- .p2align 4,,15
- .globl GL_PREFIX(DetachShader)
- .type GL_PREFIX(DetachShader), @function
-GL_PREFIX(DetachShader):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3304(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 3304(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3304(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 3304(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(DetachShader), .-GL_PREFIX(DetachShader)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetAttachedShaders)
- .type GL_PREFIX(GetAttachedShaders), @function
-GL_PREFIX(GetAttachedShaders):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3312(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3312(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3312(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3312(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetAttachedShaders), .-GL_PREFIX(GetAttachedShaders)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetProgramInfoLog)
- .type GL_PREFIX(GetProgramInfoLog), @function
-GL_PREFIX(GetProgramInfoLog):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3320(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3320(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3320(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3320(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetProgramInfoLog), .-GL_PREFIX(GetProgramInfoLog)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetProgramiv)
- .type GL_PREFIX(GetProgramiv), @function
-GL_PREFIX(GetProgramiv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3328(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3328(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3328(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3328(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetProgramiv), .-GL_PREFIX(GetProgramiv)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetShaderInfoLog)
- .type GL_PREFIX(GetShaderInfoLog), @function
-GL_PREFIX(GetShaderInfoLog):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3336(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3336(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3336(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3336(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetShaderInfoLog), .-GL_PREFIX(GetShaderInfoLog)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetShaderiv)
- .type GL_PREFIX(GetShaderiv), @function
-GL_PREFIX(GetShaderiv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3344(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3344(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3344(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3344(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetShaderiv), .-GL_PREFIX(GetShaderiv)
-
- .p2align 4,,15
- .globl GL_PREFIX(IsProgram)
- .type GL_PREFIX(IsProgram), @function
-GL_PREFIX(IsProgram):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3352(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 3352(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3352(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 3352(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(IsProgram), .-GL_PREFIX(IsProgram)
-
- .p2align 4,,15
- .globl GL_PREFIX(IsShader)
- .type GL_PREFIX(IsShader), @function
-GL_PREFIX(IsShader):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3360(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 3360(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3360(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 3360(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(IsShader), .-GL_PREFIX(IsShader)
-
- .p2align 4,,15
- .globl GL_PREFIX(StencilFuncSeparate)
- .type GL_PREFIX(StencilFuncSeparate), @function
-GL_PREFIX(StencilFuncSeparate):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3368(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3368(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3368(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3368(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(StencilFuncSeparate), .-GL_PREFIX(StencilFuncSeparate)
-
- .p2align 4,,15
- .globl GL_PREFIX(StencilMaskSeparate)
- .type GL_PREFIX(StencilMaskSeparate), @function
-GL_PREFIX(StencilMaskSeparate):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3376(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 3376(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3376(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 3376(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(StencilMaskSeparate), .-GL_PREFIX(StencilMaskSeparate)
-
- .p2align 4,,15
- .globl GL_PREFIX(StencilOpSeparate)
- .type GL_PREFIX(StencilOpSeparate), @function
-GL_PREFIX(StencilOpSeparate):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3384(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3384(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3384(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3384(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(StencilOpSeparate), .-GL_PREFIX(StencilOpSeparate)
-
- .p2align 4,,15
- .globl GL_PREFIX(UniformMatrix2x3fv)
- .type GL_PREFIX(UniformMatrix2x3fv), @function
-GL_PREFIX(UniformMatrix2x3fv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3392(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3392(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3392(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3392(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(UniformMatrix2x3fv), .-GL_PREFIX(UniformMatrix2x3fv)
-
- .p2align 4,,15
- .globl GL_PREFIX(UniformMatrix2x4fv)
- .type GL_PREFIX(UniformMatrix2x4fv), @function
-GL_PREFIX(UniformMatrix2x4fv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3400(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3400(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3400(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3400(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(UniformMatrix2x4fv), .-GL_PREFIX(UniformMatrix2x4fv)
-
- .p2align 4,,15
- .globl GL_PREFIX(UniformMatrix3x2fv)
- .type GL_PREFIX(UniformMatrix3x2fv), @function
-GL_PREFIX(UniformMatrix3x2fv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3408(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3408(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3408(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3408(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(UniformMatrix3x2fv), .-GL_PREFIX(UniformMatrix3x2fv)
-
- .p2align 4,,15
- .globl GL_PREFIX(UniformMatrix3x4fv)
- .type GL_PREFIX(UniformMatrix3x4fv), @function
-GL_PREFIX(UniformMatrix3x4fv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3416(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3416(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3416(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3416(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(UniformMatrix3x4fv), .-GL_PREFIX(UniformMatrix3x4fv)
-
- .p2align 4,,15
- .globl GL_PREFIX(UniformMatrix4x2fv)
- .type GL_PREFIX(UniformMatrix4x2fv), @function
-GL_PREFIX(UniformMatrix4x2fv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3424(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3424(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3424(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3424(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(UniformMatrix4x2fv), .-GL_PREFIX(UniformMatrix4x2fv)
-
- .p2align 4,,15
- .globl GL_PREFIX(UniformMatrix4x3fv)
- .type GL_PREFIX(UniformMatrix4x3fv), @function
-GL_PREFIX(UniformMatrix4x3fv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3432(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3432(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3432(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3432(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(UniformMatrix4x3fv), .-GL_PREFIX(UniformMatrix4x3fv)
-
- .p2align 4,,15
- .globl GL_PREFIX(ClampColor)
- .type GL_PREFIX(ClampColor), @function
-GL_PREFIX(ClampColor):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3440(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 3440(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3440(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 3440(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(ClampColor), .-GL_PREFIX(ClampColor)
-
- .p2align 4,,15
- .globl GL_PREFIX(ClearBufferfi)
- .type GL_PREFIX(ClearBufferfi), @function
-GL_PREFIX(ClearBufferfi):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3448(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $40, %rsp
- movq %rdi, (%rsp)
- movq %rsi, 8(%rsp)
- movq %xmm0, 16(%rsp)
- movq %rdx, 24(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 24(%rsp), %rdx
- movq 16(%rsp), %xmm0
- movq 8(%rsp), %rsi
- movq (%rsp), %rdi
- addq $40, %rsp
- movq 3448(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3448(%rax), %r11
- jmp *%r11
-1:
- subq $40, %rsp
- movq %rdi, (%rsp)
- movq %rsi, 8(%rsp)
- movq %xmm0, 16(%rsp)
- movq %rdx, 24(%rsp)
- call _glapi_get_dispatch
- movq 24(%rsp), %rdx
- movq 16(%rsp), %xmm0
- movq 8(%rsp), %rsi
- movq (%rsp), %rdi
- addq $40, %rsp
- movq 3448(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(ClearBufferfi), .-GL_PREFIX(ClearBufferfi)
-
- .p2align 4,,15
- .globl GL_PREFIX(ClearBufferfv)
- .type GL_PREFIX(ClearBufferfv), @function
-GL_PREFIX(ClearBufferfv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3456(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3456(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3456(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3456(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(ClearBufferfv), .-GL_PREFIX(ClearBufferfv)
-
- .p2align 4,,15
- .globl GL_PREFIX(ClearBufferiv)
- .type GL_PREFIX(ClearBufferiv), @function
-GL_PREFIX(ClearBufferiv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3464(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3464(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3464(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3464(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(ClearBufferiv), .-GL_PREFIX(ClearBufferiv)
-
- .p2align 4,,15
- .globl GL_PREFIX(ClearBufferuiv)
- .type GL_PREFIX(ClearBufferuiv), @function
-GL_PREFIX(ClearBufferuiv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3472(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3472(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3472(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3472(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(ClearBufferuiv), .-GL_PREFIX(ClearBufferuiv)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetStringi)
- .type GL_PREFIX(GetStringi), @function
-GL_PREFIX(GetStringi):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3480(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 3480(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3480(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 3480(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetStringi), .-GL_PREFIX(GetStringi)
-
- .p2align 4,,15
- .globl GL_PREFIX(TexBuffer)
- .type GL_PREFIX(TexBuffer), @function
-GL_PREFIX(TexBuffer):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3488(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3488(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3488(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3488(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(TexBuffer), .-GL_PREFIX(TexBuffer)
-
- .p2align 4,,15
- .globl GL_PREFIX(FramebufferTexture)
- .type GL_PREFIX(FramebufferTexture), @function
-GL_PREFIX(FramebufferTexture):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3496(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3496(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3496(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3496(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(FramebufferTexture), .-GL_PREFIX(FramebufferTexture)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetBufferParameteri64v)
- .type GL_PREFIX(GetBufferParameteri64v), @function
-GL_PREFIX(GetBufferParameteri64v):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3504(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3504(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3504(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3504(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetBufferParameteri64v), .-GL_PREFIX(GetBufferParameteri64v)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetInteger64i_v)
- .type GL_PREFIX(GetInteger64i_v), @function
-GL_PREFIX(GetInteger64i_v):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3512(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3512(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3512(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3512(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetInteger64i_v), .-GL_PREFIX(GetInteger64i_v)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexAttribDivisor)
- .type GL_PREFIX(VertexAttribDivisor), @function
-GL_PREFIX(VertexAttribDivisor):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3520(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 3520(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3520(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 3520(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexAttribDivisor), .-GL_PREFIX(VertexAttribDivisor)
-
- .p2align 4,,15
- .globl GL_PREFIX(LoadTransposeMatrixdARB)
- .type GL_PREFIX(LoadTransposeMatrixdARB), @function
-GL_PREFIX(LoadTransposeMatrixdARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3528(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 3528(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3528(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 3528(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(LoadTransposeMatrixdARB), .-GL_PREFIX(LoadTransposeMatrixdARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(LoadTransposeMatrixfARB)
- .type GL_PREFIX(LoadTransposeMatrixfARB), @function
-GL_PREFIX(LoadTransposeMatrixfARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3536(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 3536(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3536(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 3536(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(LoadTransposeMatrixfARB), .-GL_PREFIX(LoadTransposeMatrixfARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(MultTransposeMatrixdARB)
- .type GL_PREFIX(MultTransposeMatrixdARB), @function
-GL_PREFIX(MultTransposeMatrixdARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3544(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 3544(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3544(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 3544(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(MultTransposeMatrixdARB), .-GL_PREFIX(MultTransposeMatrixdARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(MultTransposeMatrixfARB)
- .type GL_PREFIX(MultTransposeMatrixfARB), @function
-GL_PREFIX(MultTransposeMatrixfARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3552(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 3552(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3552(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 3552(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(MultTransposeMatrixfARB), .-GL_PREFIX(MultTransposeMatrixfARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(SampleCoverageARB)
- .type GL_PREFIX(SampleCoverageARB), @function
-GL_PREFIX(SampleCoverageARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3560(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 3560(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3560(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 3560(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(SampleCoverageARB), .-GL_PREFIX(SampleCoverageARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(CompressedTexImage1DARB)
- .type GL_PREFIX(CompressedTexImage1DARB), @function
-GL_PREFIX(CompressedTexImage1DARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3568(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- pushq %r9
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %r9
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3568(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3568(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- pushq %r9
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %r9
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3568(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(CompressedTexImage1DARB), .-GL_PREFIX(CompressedTexImage1DARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(CompressedTexImage2DARB)
- .type GL_PREFIX(CompressedTexImage2DARB), @function
-GL_PREFIX(CompressedTexImage2DARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3576(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- pushq %r9
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %r9
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3576(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3576(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- pushq %r9
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %r9
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3576(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(CompressedTexImage2DARB), .-GL_PREFIX(CompressedTexImage2DARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(CompressedTexImage3DARB)
- .type GL_PREFIX(CompressedTexImage3DARB), @function
-GL_PREFIX(CompressedTexImage3DARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3584(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- pushq %r9
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %r9
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3584(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3584(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- pushq %r9
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %r9
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3584(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(CompressedTexImage3DARB), .-GL_PREFIX(CompressedTexImage3DARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(CompressedTexSubImage1DARB)
- .type GL_PREFIX(CompressedTexSubImage1DARB), @function
-GL_PREFIX(CompressedTexSubImage1DARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3592(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- pushq %r9
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %r9
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3592(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3592(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- pushq %r9
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %r9
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3592(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(CompressedTexSubImage1DARB), .-GL_PREFIX(CompressedTexSubImage1DARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(CompressedTexSubImage2DARB)
- .type GL_PREFIX(CompressedTexSubImage2DARB), @function
-GL_PREFIX(CompressedTexSubImage2DARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3600(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- pushq %r9
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %r9
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3600(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3600(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- pushq %r9
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %r9
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3600(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(CompressedTexSubImage2DARB), .-GL_PREFIX(CompressedTexSubImage2DARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(CompressedTexSubImage3DARB)
- .type GL_PREFIX(CompressedTexSubImage3DARB), @function
-GL_PREFIX(CompressedTexSubImage3DARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3608(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- pushq %r9
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %r9
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3608(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3608(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- pushq %r9
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %r9
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3608(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(CompressedTexSubImage3DARB), .-GL_PREFIX(CompressedTexSubImage3DARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetCompressedTexImageARB)
- .type GL_PREFIX(GetCompressedTexImageARB), @function
-GL_PREFIX(GetCompressedTexImageARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3616(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3616(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3616(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3616(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetCompressedTexImageARB), .-GL_PREFIX(GetCompressedTexImageARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(DisableVertexAttribArrayARB)
- .type GL_PREFIX(DisableVertexAttribArrayARB), @function
-GL_PREFIX(DisableVertexAttribArrayARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3624(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 3624(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3624(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 3624(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(DisableVertexAttribArrayARB), .-GL_PREFIX(DisableVertexAttribArrayARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(EnableVertexAttribArrayARB)
- .type GL_PREFIX(EnableVertexAttribArrayARB), @function
-GL_PREFIX(EnableVertexAttribArrayARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3632(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 3632(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3632(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 3632(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(EnableVertexAttribArrayARB), .-GL_PREFIX(EnableVertexAttribArrayARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetProgramEnvParameterdvARB)
- .type GL_PREFIX(GetProgramEnvParameterdvARB), @function
-GL_PREFIX(GetProgramEnvParameterdvARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3640(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3640(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3640(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3640(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetProgramEnvParameterdvARB), .-GL_PREFIX(GetProgramEnvParameterdvARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetProgramEnvParameterfvARB)
- .type GL_PREFIX(GetProgramEnvParameterfvARB), @function
-GL_PREFIX(GetProgramEnvParameterfvARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3648(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3648(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3648(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3648(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetProgramEnvParameterfvARB), .-GL_PREFIX(GetProgramEnvParameterfvARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetProgramLocalParameterdvARB)
- .type GL_PREFIX(GetProgramLocalParameterdvARB), @function
-GL_PREFIX(GetProgramLocalParameterdvARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3656(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3656(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3656(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3656(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetProgramLocalParameterdvARB), .-GL_PREFIX(GetProgramLocalParameterdvARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetProgramLocalParameterfvARB)
- .type GL_PREFIX(GetProgramLocalParameterfvARB), @function
-GL_PREFIX(GetProgramLocalParameterfvARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3664(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3664(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3664(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3664(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetProgramLocalParameterfvARB), .-GL_PREFIX(GetProgramLocalParameterfvARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetProgramStringARB)
- .type GL_PREFIX(GetProgramStringARB), @function
-GL_PREFIX(GetProgramStringARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3672(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3672(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3672(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3672(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetProgramStringARB), .-GL_PREFIX(GetProgramStringARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetProgramivARB)
- .type GL_PREFIX(GetProgramivARB), @function
-GL_PREFIX(GetProgramivARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3680(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3680(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3680(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3680(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetProgramivARB), .-GL_PREFIX(GetProgramivARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetVertexAttribdvARB)
- .type GL_PREFIX(GetVertexAttribdvARB), @function
-GL_PREFIX(GetVertexAttribdvARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3688(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3688(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3688(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3688(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetVertexAttribdvARB), .-GL_PREFIX(GetVertexAttribdvARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetVertexAttribfvARB)
- .type GL_PREFIX(GetVertexAttribfvARB), @function
-GL_PREFIX(GetVertexAttribfvARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3696(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3696(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3696(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3696(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetVertexAttribfvARB), .-GL_PREFIX(GetVertexAttribfvARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetVertexAttribivARB)
- .type GL_PREFIX(GetVertexAttribivARB), @function
-GL_PREFIX(GetVertexAttribivARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3704(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3704(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3704(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3704(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetVertexAttribivARB), .-GL_PREFIX(GetVertexAttribivARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(ProgramEnvParameter4dARB)
- .type GL_PREFIX(ProgramEnvParameter4dARB), @function
-GL_PREFIX(ProgramEnvParameter4dARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3712(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $56, %rsp
- movq %rdi, (%rsp)
- movq %rsi, 8(%rsp)
- movq %xmm0, 16(%rsp)
- movq %xmm1, 24(%rsp)
- movq %xmm2, 32(%rsp)
- movq %xmm3, 40(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 40(%rsp), %xmm3
- movq 32(%rsp), %xmm2
- movq 24(%rsp), %xmm1
- movq 16(%rsp), %xmm0
- movq 8(%rsp), %rsi
- movq (%rsp), %rdi
- addq $56, %rsp
- movq 3712(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3712(%rax), %r11
- jmp *%r11
-1:
- subq $56, %rsp
- movq %rdi, (%rsp)
- movq %rsi, 8(%rsp)
- movq %xmm0, 16(%rsp)
- movq %xmm1, 24(%rsp)
- movq %xmm2, 32(%rsp)
- movq %xmm3, 40(%rsp)
- call _glapi_get_dispatch
- movq 40(%rsp), %xmm3
- movq 32(%rsp), %xmm2
- movq 24(%rsp), %xmm1
- movq 16(%rsp), %xmm0
- movq 8(%rsp), %rsi
- movq (%rsp), %rdi
- addq $56, %rsp
- movq 3712(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(ProgramEnvParameter4dARB), .-GL_PREFIX(ProgramEnvParameter4dARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(ProgramEnvParameter4dvARB)
- .type GL_PREFIX(ProgramEnvParameter4dvARB), @function
-GL_PREFIX(ProgramEnvParameter4dvARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3720(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3720(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3720(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3720(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(ProgramEnvParameter4dvARB), .-GL_PREFIX(ProgramEnvParameter4dvARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(ProgramEnvParameter4fARB)
- .type GL_PREFIX(ProgramEnvParameter4fARB), @function
-GL_PREFIX(ProgramEnvParameter4fARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3728(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $56, %rsp
- movq %rdi, (%rsp)
- movq %rsi, 8(%rsp)
- movq %xmm0, 16(%rsp)
- movq %xmm1, 24(%rsp)
- movq %xmm2, 32(%rsp)
- movq %xmm3, 40(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 40(%rsp), %xmm3
- movq 32(%rsp), %xmm2
- movq 24(%rsp), %xmm1
- movq 16(%rsp), %xmm0
- movq 8(%rsp), %rsi
- movq (%rsp), %rdi
- addq $56, %rsp
- movq 3728(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3728(%rax), %r11
- jmp *%r11
-1:
- subq $56, %rsp
- movq %rdi, (%rsp)
- movq %rsi, 8(%rsp)
- movq %xmm0, 16(%rsp)
- movq %xmm1, 24(%rsp)
- movq %xmm2, 32(%rsp)
- movq %xmm3, 40(%rsp)
- call _glapi_get_dispatch
- movq 40(%rsp), %xmm3
- movq 32(%rsp), %xmm2
- movq 24(%rsp), %xmm1
- movq 16(%rsp), %xmm0
- movq 8(%rsp), %rsi
- movq (%rsp), %rdi
- addq $56, %rsp
- movq 3728(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(ProgramEnvParameter4fARB), .-GL_PREFIX(ProgramEnvParameter4fARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(ProgramEnvParameter4fvARB)
- .type GL_PREFIX(ProgramEnvParameter4fvARB), @function
-GL_PREFIX(ProgramEnvParameter4fvARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3736(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3736(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3736(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3736(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(ProgramEnvParameter4fvARB), .-GL_PREFIX(ProgramEnvParameter4fvARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(ProgramLocalParameter4dARB)
- .type GL_PREFIX(ProgramLocalParameter4dARB), @function
-GL_PREFIX(ProgramLocalParameter4dARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3744(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $56, %rsp
- movq %rdi, (%rsp)
- movq %rsi, 8(%rsp)
- movq %xmm0, 16(%rsp)
- movq %xmm1, 24(%rsp)
- movq %xmm2, 32(%rsp)
- movq %xmm3, 40(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 40(%rsp), %xmm3
- movq 32(%rsp), %xmm2
- movq 24(%rsp), %xmm1
- movq 16(%rsp), %xmm0
- movq 8(%rsp), %rsi
- movq (%rsp), %rdi
- addq $56, %rsp
- movq 3744(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3744(%rax), %r11
- jmp *%r11
-1:
- subq $56, %rsp
- movq %rdi, (%rsp)
- movq %rsi, 8(%rsp)
- movq %xmm0, 16(%rsp)
- movq %xmm1, 24(%rsp)
- movq %xmm2, 32(%rsp)
- movq %xmm3, 40(%rsp)
- call _glapi_get_dispatch
- movq 40(%rsp), %xmm3
- movq 32(%rsp), %xmm2
- movq 24(%rsp), %xmm1
- movq 16(%rsp), %xmm0
- movq 8(%rsp), %rsi
- movq (%rsp), %rdi
- addq $56, %rsp
- movq 3744(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(ProgramLocalParameter4dARB), .-GL_PREFIX(ProgramLocalParameter4dARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(ProgramLocalParameter4dvARB)
- .type GL_PREFIX(ProgramLocalParameter4dvARB), @function
-GL_PREFIX(ProgramLocalParameter4dvARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3752(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3752(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3752(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3752(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(ProgramLocalParameter4dvARB), .-GL_PREFIX(ProgramLocalParameter4dvARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(ProgramLocalParameter4fARB)
- .type GL_PREFIX(ProgramLocalParameter4fARB), @function
-GL_PREFIX(ProgramLocalParameter4fARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3760(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $56, %rsp
- movq %rdi, (%rsp)
- movq %rsi, 8(%rsp)
- movq %xmm0, 16(%rsp)
- movq %xmm1, 24(%rsp)
- movq %xmm2, 32(%rsp)
- movq %xmm3, 40(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 40(%rsp), %xmm3
- movq 32(%rsp), %xmm2
- movq 24(%rsp), %xmm1
- movq 16(%rsp), %xmm0
- movq 8(%rsp), %rsi
- movq (%rsp), %rdi
- addq $56, %rsp
- movq 3760(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3760(%rax), %r11
- jmp *%r11
-1:
- subq $56, %rsp
- movq %rdi, (%rsp)
- movq %rsi, 8(%rsp)
- movq %xmm0, 16(%rsp)
- movq %xmm1, 24(%rsp)
- movq %xmm2, 32(%rsp)
- movq %xmm3, 40(%rsp)
- call _glapi_get_dispatch
- movq 40(%rsp), %xmm3
- movq 32(%rsp), %xmm2
- movq 24(%rsp), %xmm1
- movq 16(%rsp), %xmm0
- movq 8(%rsp), %rsi
- movq (%rsp), %rdi
- addq $56, %rsp
- movq 3760(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(ProgramLocalParameter4fARB), .-GL_PREFIX(ProgramLocalParameter4fARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(ProgramLocalParameter4fvARB)
- .type GL_PREFIX(ProgramLocalParameter4fvARB), @function
-GL_PREFIX(ProgramLocalParameter4fvARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3768(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3768(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3768(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3768(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(ProgramLocalParameter4fvARB), .-GL_PREFIX(ProgramLocalParameter4fvARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(ProgramStringARB)
- .type GL_PREFIX(ProgramStringARB), @function
-GL_PREFIX(ProgramStringARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3776(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3776(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3776(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3776(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(ProgramStringARB), .-GL_PREFIX(ProgramStringARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexAttrib1dARB)
- .type GL_PREFIX(VertexAttrib1dARB), @function
-GL_PREFIX(VertexAttrib1dARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3784(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $24, %rsp
- movq %rdi, (%rsp)
- movq %xmm0, 8(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 8(%rsp), %xmm0
- movq (%rsp), %rdi
- addq $24, %rsp
- movq 3784(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3784(%rax), %r11
- jmp *%r11
-1:
- subq $24, %rsp
- movq %rdi, (%rsp)
- movq %xmm0, 8(%rsp)
- call _glapi_get_dispatch
- movq 8(%rsp), %xmm0
- movq (%rsp), %rdi
- addq $24, %rsp
- movq 3784(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexAttrib1dARB), .-GL_PREFIX(VertexAttrib1dARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexAttrib1dvARB)
- .type GL_PREFIX(VertexAttrib1dvARB), @function
-GL_PREFIX(VertexAttrib1dvARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3792(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 3792(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3792(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 3792(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexAttrib1dvARB), .-GL_PREFIX(VertexAttrib1dvARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexAttrib1fARB)
- .type GL_PREFIX(VertexAttrib1fARB), @function
-GL_PREFIX(VertexAttrib1fARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3800(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $24, %rsp
- movq %rdi, (%rsp)
- movq %xmm0, 8(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 8(%rsp), %xmm0
- movq (%rsp), %rdi
- addq $24, %rsp
- movq 3800(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3800(%rax), %r11
- jmp *%r11
-1:
- subq $24, %rsp
- movq %rdi, (%rsp)
- movq %xmm0, 8(%rsp)
- call _glapi_get_dispatch
- movq 8(%rsp), %xmm0
- movq (%rsp), %rdi
- addq $24, %rsp
- movq 3800(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexAttrib1fARB), .-GL_PREFIX(VertexAttrib1fARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexAttrib1fvARB)
- .type GL_PREFIX(VertexAttrib1fvARB), @function
-GL_PREFIX(VertexAttrib1fvARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3808(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 3808(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3808(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 3808(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexAttrib1fvARB), .-GL_PREFIX(VertexAttrib1fvARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexAttrib1sARB)
- .type GL_PREFIX(VertexAttrib1sARB), @function
-GL_PREFIX(VertexAttrib1sARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3816(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 3816(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3816(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 3816(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexAttrib1sARB), .-GL_PREFIX(VertexAttrib1sARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexAttrib1svARB)
- .type GL_PREFIX(VertexAttrib1svARB), @function
-GL_PREFIX(VertexAttrib1svARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3824(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 3824(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3824(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 3824(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexAttrib1svARB), .-GL_PREFIX(VertexAttrib1svARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexAttrib2dARB)
- .type GL_PREFIX(VertexAttrib2dARB), @function
-GL_PREFIX(VertexAttrib2dARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3832(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $24, %rsp
- movq %rdi, (%rsp)
- movq %xmm0, 8(%rsp)
- movq %xmm1, 16(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 16(%rsp), %xmm1
- movq 8(%rsp), %xmm0
- movq (%rsp), %rdi
- addq $24, %rsp
- movq 3832(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3832(%rax), %r11
- jmp *%r11
-1:
- subq $24, %rsp
- movq %rdi, (%rsp)
- movq %xmm0, 8(%rsp)
- movq %xmm1, 16(%rsp)
- call _glapi_get_dispatch
- movq 16(%rsp), %xmm1
- movq 8(%rsp), %xmm0
- movq (%rsp), %rdi
- addq $24, %rsp
- movq 3832(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexAttrib2dARB), .-GL_PREFIX(VertexAttrib2dARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexAttrib2dvARB)
- .type GL_PREFIX(VertexAttrib2dvARB), @function
-GL_PREFIX(VertexAttrib2dvARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3840(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 3840(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3840(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 3840(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexAttrib2dvARB), .-GL_PREFIX(VertexAttrib2dvARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexAttrib2fARB)
- .type GL_PREFIX(VertexAttrib2fARB), @function
-GL_PREFIX(VertexAttrib2fARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3848(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $24, %rsp
- movq %rdi, (%rsp)
- movq %xmm0, 8(%rsp)
- movq %xmm1, 16(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 16(%rsp), %xmm1
- movq 8(%rsp), %xmm0
- movq (%rsp), %rdi
- addq $24, %rsp
- movq 3848(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3848(%rax), %r11
- jmp *%r11
-1:
- subq $24, %rsp
- movq %rdi, (%rsp)
- movq %xmm0, 8(%rsp)
- movq %xmm1, 16(%rsp)
- call _glapi_get_dispatch
- movq 16(%rsp), %xmm1
- movq 8(%rsp), %xmm0
- movq (%rsp), %rdi
- addq $24, %rsp
- movq 3848(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexAttrib2fARB), .-GL_PREFIX(VertexAttrib2fARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexAttrib2fvARB)
- .type GL_PREFIX(VertexAttrib2fvARB), @function
-GL_PREFIX(VertexAttrib2fvARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3856(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 3856(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3856(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 3856(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexAttrib2fvARB), .-GL_PREFIX(VertexAttrib2fvARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexAttrib2sARB)
- .type GL_PREFIX(VertexAttrib2sARB), @function
-GL_PREFIX(VertexAttrib2sARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3864(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3864(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3864(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3864(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexAttrib2sARB), .-GL_PREFIX(VertexAttrib2sARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexAttrib2svARB)
- .type GL_PREFIX(VertexAttrib2svARB), @function
-GL_PREFIX(VertexAttrib2svARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3872(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 3872(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3872(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 3872(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexAttrib2svARB), .-GL_PREFIX(VertexAttrib2svARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexAttrib3dARB)
- .type GL_PREFIX(VertexAttrib3dARB), @function
-GL_PREFIX(VertexAttrib3dARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3880(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $40, %rsp
- movq %rdi, (%rsp)
- movq %xmm0, 8(%rsp)
- movq %xmm1, 16(%rsp)
- movq %xmm2, 24(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 24(%rsp), %xmm2
- movq 16(%rsp), %xmm1
- movq 8(%rsp), %xmm0
- movq (%rsp), %rdi
- addq $40, %rsp
- movq 3880(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3880(%rax), %r11
- jmp *%r11
-1:
- subq $40, %rsp
- movq %rdi, (%rsp)
- movq %xmm0, 8(%rsp)
- movq %xmm1, 16(%rsp)
- movq %xmm2, 24(%rsp)
- call _glapi_get_dispatch
- movq 24(%rsp), %xmm2
- movq 16(%rsp), %xmm1
- movq 8(%rsp), %xmm0
- movq (%rsp), %rdi
- addq $40, %rsp
- movq 3880(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexAttrib3dARB), .-GL_PREFIX(VertexAttrib3dARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexAttrib3dvARB)
- .type GL_PREFIX(VertexAttrib3dvARB), @function
-GL_PREFIX(VertexAttrib3dvARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3888(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 3888(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3888(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 3888(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexAttrib3dvARB), .-GL_PREFIX(VertexAttrib3dvARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexAttrib3fARB)
- .type GL_PREFIX(VertexAttrib3fARB), @function
-GL_PREFIX(VertexAttrib3fARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3896(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $40, %rsp
- movq %rdi, (%rsp)
- movq %xmm0, 8(%rsp)
- movq %xmm1, 16(%rsp)
- movq %xmm2, 24(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 24(%rsp), %xmm2
- movq 16(%rsp), %xmm1
- movq 8(%rsp), %xmm0
- movq (%rsp), %rdi
- addq $40, %rsp
- movq 3896(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3896(%rax), %r11
- jmp *%r11
-1:
- subq $40, %rsp
- movq %rdi, (%rsp)
- movq %xmm0, 8(%rsp)
- movq %xmm1, 16(%rsp)
- movq %xmm2, 24(%rsp)
- call _glapi_get_dispatch
- movq 24(%rsp), %xmm2
- movq 16(%rsp), %xmm1
- movq 8(%rsp), %xmm0
- movq (%rsp), %rdi
- addq $40, %rsp
- movq 3896(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexAttrib3fARB), .-GL_PREFIX(VertexAttrib3fARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexAttrib3fvARB)
- .type GL_PREFIX(VertexAttrib3fvARB), @function
-GL_PREFIX(VertexAttrib3fvARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3904(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 3904(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3904(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 3904(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexAttrib3fvARB), .-GL_PREFIX(VertexAttrib3fvARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexAttrib3sARB)
- .type GL_PREFIX(VertexAttrib3sARB), @function
-GL_PREFIX(VertexAttrib3sARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3912(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3912(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3912(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3912(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexAttrib3sARB), .-GL_PREFIX(VertexAttrib3sARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexAttrib3svARB)
- .type GL_PREFIX(VertexAttrib3svARB), @function
-GL_PREFIX(VertexAttrib3svARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3920(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 3920(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3920(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 3920(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexAttrib3svARB), .-GL_PREFIX(VertexAttrib3svARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexAttrib4NbvARB)
- .type GL_PREFIX(VertexAttrib4NbvARB), @function
-GL_PREFIX(VertexAttrib4NbvARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3928(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 3928(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3928(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 3928(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexAttrib4NbvARB), .-GL_PREFIX(VertexAttrib4NbvARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexAttrib4NivARB)
- .type GL_PREFIX(VertexAttrib4NivARB), @function
-GL_PREFIX(VertexAttrib4NivARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3936(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 3936(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3936(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 3936(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexAttrib4NivARB), .-GL_PREFIX(VertexAttrib4NivARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexAttrib4NsvARB)
- .type GL_PREFIX(VertexAttrib4NsvARB), @function
-GL_PREFIX(VertexAttrib4NsvARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3944(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 3944(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3944(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 3944(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexAttrib4NsvARB), .-GL_PREFIX(VertexAttrib4NsvARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexAttrib4NubARB)
- .type GL_PREFIX(VertexAttrib4NubARB), @function
-GL_PREFIX(VertexAttrib4NubARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3952(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- call _x86_64_get_dispatch@PLT
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3952(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3952(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- call _glapi_get_dispatch
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 3952(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexAttrib4NubARB), .-GL_PREFIX(VertexAttrib4NubARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexAttrib4NubvARB)
- .type GL_PREFIX(VertexAttrib4NubvARB), @function
-GL_PREFIX(VertexAttrib4NubvARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3960(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 3960(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3960(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 3960(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexAttrib4NubvARB), .-GL_PREFIX(VertexAttrib4NubvARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexAttrib4NuivARB)
- .type GL_PREFIX(VertexAttrib4NuivARB), @function
-GL_PREFIX(VertexAttrib4NuivARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3968(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 3968(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3968(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 3968(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexAttrib4NuivARB), .-GL_PREFIX(VertexAttrib4NuivARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexAttrib4NusvARB)
- .type GL_PREFIX(VertexAttrib4NusvARB), @function
-GL_PREFIX(VertexAttrib4NusvARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3976(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 3976(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3976(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 3976(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexAttrib4NusvARB), .-GL_PREFIX(VertexAttrib4NusvARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexAttrib4bvARB)
- .type GL_PREFIX(VertexAttrib4bvARB), @function
-GL_PREFIX(VertexAttrib4bvARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3984(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 3984(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3984(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 3984(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexAttrib4bvARB), .-GL_PREFIX(VertexAttrib4bvARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexAttrib4dARB)
- .type GL_PREFIX(VertexAttrib4dARB), @function
-GL_PREFIX(VertexAttrib4dARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 3992(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $40, %rsp
- movq %rdi, (%rsp)
- movq %xmm0, 8(%rsp)
- movq %xmm1, 16(%rsp)
- movq %xmm2, 24(%rsp)
- movq %xmm3, 32(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 32(%rsp), %xmm3
- movq 24(%rsp), %xmm2
- movq 16(%rsp), %xmm1
- movq 8(%rsp), %xmm0
- movq (%rsp), %rdi
- addq $40, %rsp
- movq 3992(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 3992(%rax), %r11
- jmp *%r11
-1:
- subq $40, %rsp
- movq %rdi, (%rsp)
- movq %xmm0, 8(%rsp)
- movq %xmm1, 16(%rsp)
- movq %xmm2, 24(%rsp)
- movq %xmm3, 32(%rsp)
- call _glapi_get_dispatch
- movq 32(%rsp), %xmm3
- movq 24(%rsp), %xmm2
- movq 16(%rsp), %xmm1
- movq 8(%rsp), %xmm0
- movq (%rsp), %rdi
- addq $40, %rsp
- movq 3992(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexAttrib4dARB), .-GL_PREFIX(VertexAttrib4dARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexAttrib4dvARB)
- .type GL_PREFIX(VertexAttrib4dvARB), @function
-GL_PREFIX(VertexAttrib4dvARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4000(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 4000(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4000(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 4000(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexAttrib4dvARB), .-GL_PREFIX(VertexAttrib4dvARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexAttrib4fARB)
- .type GL_PREFIX(VertexAttrib4fARB), @function
-GL_PREFIX(VertexAttrib4fARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4008(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $40, %rsp
- movq %rdi, (%rsp)
- movq %xmm0, 8(%rsp)
- movq %xmm1, 16(%rsp)
- movq %xmm2, 24(%rsp)
- movq %xmm3, 32(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 32(%rsp), %xmm3
- movq 24(%rsp), %xmm2
- movq 16(%rsp), %xmm1
- movq 8(%rsp), %xmm0
- movq (%rsp), %rdi
- addq $40, %rsp
- movq 4008(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4008(%rax), %r11
- jmp *%r11
-1:
- subq $40, %rsp
- movq %rdi, (%rsp)
- movq %xmm0, 8(%rsp)
- movq %xmm1, 16(%rsp)
- movq %xmm2, 24(%rsp)
- movq %xmm3, 32(%rsp)
- call _glapi_get_dispatch
- movq 32(%rsp), %xmm3
- movq 24(%rsp), %xmm2
- movq 16(%rsp), %xmm1
- movq 8(%rsp), %xmm0
- movq (%rsp), %rdi
- addq $40, %rsp
- movq 4008(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexAttrib4fARB), .-GL_PREFIX(VertexAttrib4fARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexAttrib4fvARB)
- .type GL_PREFIX(VertexAttrib4fvARB), @function
-GL_PREFIX(VertexAttrib4fvARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4016(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 4016(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4016(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 4016(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexAttrib4fvARB), .-GL_PREFIX(VertexAttrib4fvARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexAttrib4ivARB)
- .type GL_PREFIX(VertexAttrib4ivARB), @function
-GL_PREFIX(VertexAttrib4ivARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4024(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 4024(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4024(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 4024(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexAttrib4ivARB), .-GL_PREFIX(VertexAttrib4ivARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexAttrib4sARB)
- .type GL_PREFIX(VertexAttrib4sARB), @function
-GL_PREFIX(VertexAttrib4sARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4032(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- call _x86_64_get_dispatch@PLT
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4032(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4032(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- call _glapi_get_dispatch
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4032(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexAttrib4sARB), .-GL_PREFIX(VertexAttrib4sARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexAttrib4svARB)
- .type GL_PREFIX(VertexAttrib4svARB), @function
-GL_PREFIX(VertexAttrib4svARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4040(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 4040(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4040(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 4040(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexAttrib4svARB), .-GL_PREFIX(VertexAttrib4svARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexAttrib4ubvARB)
- .type GL_PREFIX(VertexAttrib4ubvARB), @function
-GL_PREFIX(VertexAttrib4ubvARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4048(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 4048(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4048(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 4048(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexAttrib4ubvARB), .-GL_PREFIX(VertexAttrib4ubvARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexAttrib4uivARB)
- .type GL_PREFIX(VertexAttrib4uivARB), @function
-GL_PREFIX(VertexAttrib4uivARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4056(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 4056(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4056(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 4056(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexAttrib4uivARB), .-GL_PREFIX(VertexAttrib4uivARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexAttrib4usvARB)
- .type GL_PREFIX(VertexAttrib4usvARB), @function
-GL_PREFIX(VertexAttrib4usvARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4064(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 4064(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4064(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 4064(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexAttrib4usvARB), .-GL_PREFIX(VertexAttrib4usvARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexAttribPointerARB)
- .type GL_PREFIX(VertexAttribPointerARB), @function
-GL_PREFIX(VertexAttribPointerARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4072(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- pushq %r9
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %r9
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4072(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4072(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- pushq %r9
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %r9
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4072(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexAttribPointerARB), .-GL_PREFIX(VertexAttribPointerARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(BindBufferARB)
- .type GL_PREFIX(BindBufferARB), @function
-GL_PREFIX(BindBufferARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4080(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 4080(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4080(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 4080(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(BindBufferARB), .-GL_PREFIX(BindBufferARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(BufferDataARB)
- .type GL_PREFIX(BufferDataARB), @function
-GL_PREFIX(BufferDataARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4088(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4088(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4088(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4088(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(BufferDataARB), .-GL_PREFIX(BufferDataARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(BufferSubDataARB)
- .type GL_PREFIX(BufferSubDataARB), @function
-GL_PREFIX(BufferSubDataARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4096(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4096(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4096(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4096(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(BufferSubDataARB), .-GL_PREFIX(BufferSubDataARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(DeleteBuffersARB)
- .type GL_PREFIX(DeleteBuffersARB), @function
-GL_PREFIX(DeleteBuffersARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4104(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 4104(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4104(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 4104(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(DeleteBuffersARB), .-GL_PREFIX(DeleteBuffersARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(GenBuffersARB)
- .type GL_PREFIX(GenBuffersARB), @function
-GL_PREFIX(GenBuffersARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4112(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 4112(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4112(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 4112(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GenBuffersARB), .-GL_PREFIX(GenBuffersARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetBufferParameterivARB)
- .type GL_PREFIX(GetBufferParameterivARB), @function
-GL_PREFIX(GetBufferParameterivARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4120(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4120(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4120(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4120(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetBufferParameterivARB), .-GL_PREFIX(GetBufferParameterivARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetBufferPointervARB)
- .type GL_PREFIX(GetBufferPointervARB), @function
-GL_PREFIX(GetBufferPointervARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4128(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4128(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4128(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4128(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetBufferPointervARB), .-GL_PREFIX(GetBufferPointervARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetBufferSubDataARB)
- .type GL_PREFIX(GetBufferSubDataARB), @function
-GL_PREFIX(GetBufferSubDataARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4136(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4136(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4136(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4136(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetBufferSubDataARB), .-GL_PREFIX(GetBufferSubDataARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(IsBufferARB)
- .type GL_PREFIX(IsBufferARB), @function
-GL_PREFIX(IsBufferARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4144(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 4144(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4144(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 4144(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(IsBufferARB), .-GL_PREFIX(IsBufferARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(MapBufferARB)
- .type GL_PREFIX(MapBufferARB), @function
-GL_PREFIX(MapBufferARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4152(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 4152(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4152(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 4152(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(MapBufferARB), .-GL_PREFIX(MapBufferARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(UnmapBufferARB)
- .type GL_PREFIX(UnmapBufferARB), @function
-GL_PREFIX(UnmapBufferARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4160(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 4160(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4160(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 4160(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(UnmapBufferARB), .-GL_PREFIX(UnmapBufferARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(BeginQueryARB)
- .type GL_PREFIX(BeginQueryARB), @function
-GL_PREFIX(BeginQueryARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4168(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 4168(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4168(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 4168(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(BeginQueryARB), .-GL_PREFIX(BeginQueryARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(DeleteQueriesARB)
- .type GL_PREFIX(DeleteQueriesARB), @function
-GL_PREFIX(DeleteQueriesARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4176(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 4176(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4176(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 4176(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(DeleteQueriesARB), .-GL_PREFIX(DeleteQueriesARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(EndQueryARB)
- .type GL_PREFIX(EndQueryARB), @function
-GL_PREFIX(EndQueryARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4184(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 4184(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4184(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 4184(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(EndQueryARB), .-GL_PREFIX(EndQueryARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(GenQueriesARB)
- .type GL_PREFIX(GenQueriesARB), @function
-GL_PREFIX(GenQueriesARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4192(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 4192(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4192(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 4192(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GenQueriesARB), .-GL_PREFIX(GenQueriesARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetQueryObjectivARB)
- .type GL_PREFIX(GetQueryObjectivARB), @function
-GL_PREFIX(GetQueryObjectivARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4200(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4200(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4200(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4200(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetQueryObjectivARB), .-GL_PREFIX(GetQueryObjectivARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetQueryObjectuivARB)
- .type GL_PREFIX(GetQueryObjectuivARB), @function
-GL_PREFIX(GetQueryObjectuivARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4208(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4208(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4208(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4208(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetQueryObjectuivARB), .-GL_PREFIX(GetQueryObjectuivARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetQueryivARB)
- .type GL_PREFIX(GetQueryivARB), @function
-GL_PREFIX(GetQueryivARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4216(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4216(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4216(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4216(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetQueryivARB), .-GL_PREFIX(GetQueryivARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(IsQueryARB)
- .type GL_PREFIX(IsQueryARB), @function
-GL_PREFIX(IsQueryARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4224(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 4224(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4224(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 4224(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(IsQueryARB), .-GL_PREFIX(IsQueryARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(AttachObjectARB)
- .type GL_PREFIX(AttachObjectARB), @function
-GL_PREFIX(AttachObjectARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4232(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 4232(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4232(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 4232(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(AttachObjectARB), .-GL_PREFIX(AttachObjectARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(CompileShaderARB)
- .type GL_PREFIX(CompileShaderARB), @function
-GL_PREFIX(CompileShaderARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4240(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 4240(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4240(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 4240(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(CompileShaderARB), .-GL_PREFIX(CompileShaderARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(CreateProgramObjectARB)
- .type GL_PREFIX(CreateProgramObjectARB), @function
-GL_PREFIX(CreateProgramObjectARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4248(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- movq 4248(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4248(%rax), %r11
- jmp *%r11
-1:
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- movq 4248(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(CreateProgramObjectARB), .-GL_PREFIX(CreateProgramObjectARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(CreateShaderObjectARB)
- .type GL_PREFIX(CreateShaderObjectARB), @function
-GL_PREFIX(CreateShaderObjectARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4256(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 4256(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4256(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 4256(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(CreateShaderObjectARB), .-GL_PREFIX(CreateShaderObjectARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(DeleteObjectARB)
- .type GL_PREFIX(DeleteObjectARB), @function
-GL_PREFIX(DeleteObjectARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4264(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 4264(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4264(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 4264(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(DeleteObjectARB), .-GL_PREFIX(DeleteObjectARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(DetachObjectARB)
- .type GL_PREFIX(DetachObjectARB), @function
-GL_PREFIX(DetachObjectARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4272(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 4272(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4272(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 4272(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(DetachObjectARB), .-GL_PREFIX(DetachObjectARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetActiveUniformARB)
- .type GL_PREFIX(GetActiveUniformARB), @function
-GL_PREFIX(GetActiveUniformARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4280(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- pushq %r9
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %r9
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4280(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4280(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- pushq %r9
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %r9
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4280(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetActiveUniformARB), .-GL_PREFIX(GetActiveUniformARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetAttachedObjectsARB)
- .type GL_PREFIX(GetAttachedObjectsARB), @function
-GL_PREFIX(GetAttachedObjectsARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4288(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4288(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4288(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4288(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetAttachedObjectsARB), .-GL_PREFIX(GetAttachedObjectsARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetHandleARB)
- .type GL_PREFIX(GetHandleARB), @function
-GL_PREFIX(GetHandleARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4296(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 4296(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4296(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 4296(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetHandleARB), .-GL_PREFIX(GetHandleARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetInfoLogARB)
- .type GL_PREFIX(GetInfoLogARB), @function
-GL_PREFIX(GetInfoLogARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4304(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4304(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4304(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4304(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetInfoLogARB), .-GL_PREFIX(GetInfoLogARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetObjectParameterfvARB)
- .type GL_PREFIX(GetObjectParameterfvARB), @function
-GL_PREFIX(GetObjectParameterfvARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4312(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4312(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4312(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4312(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetObjectParameterfvARB), .-GL_PREFIX(GetObjectParameterfvARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetObjectParameterivARB)
- .type GL_PREFIX(GetObjectParameterivARB), @function
-GL_PREFIX(GetObjectParameterivARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4320(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4320(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4320(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4320(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetObjectParameterivARB), .-GL_PREFIX(GetObjectParameterivARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetShaderSourceARB)
- .type GL_PREFIX(GetShaderSourceARB), @function
-GL_PREFIX(GetShaderSourceARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4328(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4328(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4328(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4328(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetShaderSourceARB), .-GL_PREFIX(GetShaderSourceARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetUniformLocationARB)
- .type GL_PREFIX(GetUniformLocationARB), @function
-GL_PREFIX(GetUniformLocationARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4336(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 4336(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4336(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 4336(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetUniformLocationARB), .-GL_PREFIX(GetUniformLocationARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetUniformfvARB)
- .type GL_PREFIX(GetUniformfvARB), @function
-GL_PREFIX(GetUniformfvARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4344(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4344(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4344(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4344(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetUniformfvARB), .-GL_PREFIX(GetUniformfvARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetUniformivARB)
- .type GL_PREFIX(GetUniformivARB), @function
-GL_PREFIX(GetUniformivARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4352(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4352(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4352(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4352(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetUniformivARB), .-GL_PREFIX(GetUniformivARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(LinkProgramARB)
- .type GL_PREFIX(LinkProgramARB), @function
-GL_PREFIX(LinkProgramARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4360(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 4360(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4360(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 4360(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(LinkProgramARB), .-GL_PREFIX(LinkProgramARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(ShaderSourceARB)
- .type GL_PREFIX(ShaderSourceARB), @function
-GL_PREFIX(ShaderSourceARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4368(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4368(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4368(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4368(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(ShaderSourceARB), .-GL_PREFIX(ShaderSourceARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(Uniform1fARB)
- .type GL_PREFIX(Uniform1fARB), @function
-GL_PREFIX(Uniform1fARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4376(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $24, %rsp
- movq %rdi, (%rsp)
- movq %xmm0, 8(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 8(%rsp), %xmm0
- movq (%rsp), %rdi
- addq $24, %rsp
- movq 4376(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4376(%rax), %r11
- jmp *%r11
-1:
- subq $24, %rsp
- movq %rdi, (%rsp)
- movq %xmm0, 8(%rsp)
- call _glapi_get_dispatch
- movq 8(%rsp), %xmm0
- movq (%rsp), %rdi
- addq $24, %rsp
- movq 4376(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Uniform1fARB), .-GL_PREFIX(Uniform1fARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(Uniform1fvARB)
- .type GL_PREFIX(Uniform1fvARB), @function
-GL_PREFIX(Uniform1fvARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4384(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4384(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4384(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4384(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Uniform1fvARB), .-GL_PREFIX(Uniform1fvARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(Uniform1iARB)
- .type GL_PREFIX(Uniform1iARB), @function
-GL_PREFIX(Uniform1iARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4392(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 4392(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4392(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 4392(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Uniform1iARB), .-GL_PREFIX(Uniform1iARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(Uniform1ivARB)
- .type GL_PREFIX(Uniform1ivARB), @function
-GL_PREFIX(Uniform1ivARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4400(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4400(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4400(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4400(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Uniform1ivARB), .-GL_PREFIX(Uniform1ivARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(Uniform2fARB)
- .type GL_PREFIX(Uniform2fARB), @function
-GL_PREFIX(Uniform2fARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4408(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $24, %rsp
- movq %rdi, (%rsp)
- movq %xmm0, 8(%rsp)
- movq %xmm1, 16(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 16(%rsp), %xmm1
- movq 8(%rsp), %xmm0
- movq (%rsp), %rdi
- addq $24, %rsp
- movq 4408(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4408(%rax), %r11
- jmp *%r11
-1:
- subq $24, %rsp
- movq %rdi, (%rsp)
- movq %xmm0, 8(%rsp)
- movq %xmm1, 16(%rsp)
- call _glapi_get_dispatch
- movq 16(%rsp), %xmm1
- movq 8(%rsp), %xmm0
- movq (%rsp), %rdi
- addq $24, %rsp
- movq 4408(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Uniform2fARB), .-GL_PREFIX(Uniform2fARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(Uniform2fvARB)
- .type GL_PREFIX(Uniform2fvARB), @function
-GL_PREFIX(Uniform2fvARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4416(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4416(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4416(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4416(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Uniform2fvARB), .-GL_PREFIX(Uniform2fvARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(Uniform2iARB)
- .type GL_PREFIX(Uniform2iARB), @function
-GL_PREFIX(Uniform2iARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4424(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4424(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4424(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4424(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Uniform2iARB), .-GL_PREFIX(Uniform2iARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(Uniform2ivARB)
- .type GL_PREFIX(Uniform2ivARB), @function
-GL_PREFIX(Uniform2ivARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4432(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4432(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4432(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4432(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Uniform2ivARB), .-GL_PREFIX(Uniform2ivARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(Uniform3fARB)
- .type GL_PREFIX(Uniform3fARB), @function
-GL_PREFIX(Uniform3fARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4440(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $40, %rsp
- movq %rdi, (%rsp)
- movq %xmm0, 8(%rsp)
- movq %xmm1, 16(%rsp)
- movq %xmm2, 24(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 24(%rsp), %xmm2
- movq 16(%rsp), %xmm1
- movq 8(%rsp), %xmm0
- movq (%rsp), %rdi
- addq $40, %rsp
- movq 4440(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4440(%rax), %r11
- jmp *%r11
-1:
- subq $40, %rsp
- movq %rdi, (%rsp)
- movq %xmm0, 8(%rsp)
- movq %xmm1, 16(%rsp)
- movq %xmm2, 24(%rsp)
- call _glapi_get_dispatch
- movq 24(%rsp), %xmm2
- movq 16(%rsp), %xmm1
- movq 8(%rsp), %xmm0
- movq (%rsp), %rdi
- addq $40, %rsp
- movq 4440(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Uniform3fARB), .-GL_PREFIX(Uniform3fARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(Uniform3fvARB)
- .type GL_PREFIX(Uniform3fvARB), @function
-GL_PREFIX(Uniform3fvARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4448(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4448(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4448(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4448(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Uniform3fvARB), .-GL_PREFIX(Uniform3fvARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(Uniform3iARB)
- .type GL_PREFIX(Uniform3iARB), @function
-GL_PREFIX(Uniform3iARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4456(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4456(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4456(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4456(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Uniform3iARB), .-GL_PREFIX(Uniform3iARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(Uniform3ivARB)
- .type GL_PREFIX(Uniform3ivARB), @function
-GL_PREFIX(Uniform3ivARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4464(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4464(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4464(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4464(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Uniform3ivARB), .-GL_PREFIX(Uniform3ivARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(Uniform4fARB)
- .type GL_PREFIX(Uniform4fARB), @function
-GL_PREFIX(Uniform4fARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4472(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $40, %rsp
- movq %rdi, (%rsp)
- movq %xmm0, 8(%rsp)
- movq %xmm1, 16(%rsp)
- movq %xmm2, 24(%rsp)
- movq %xmm3, 32(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 32(%rsp), %xmm3
- movq 24(%rsp), %xmm2
- movq 16(%rsp), %xmm1
- movq 8(%rsp), %xmm0
- movq (%rsp), %rdi
- addq $40, %rsp
- movq 4472(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4472(%rax), %r11
- jmp *%r11
-1:
- subq $40, %rsp
- movq %rdi, (%rsp)
- movq %xmm0, 8(%rsp)
- movq %xmm1, 16(%rsp)
- movq %xmm2, 24(%rsp)
- movq %xmm3, 32(%rsp)
- call _glapi_get_dispatch
- movq 32(%rsp), %xmm3
- movq 24(%rsp), %xmm2
- movq 16(%rsp), %xmm1
- movq 8(%rsp), %xmm0
- movq (%rsp), %rdi
- addq $40, %rsp
- movq 4472(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Uniform4fARB), .-GL_PREFIX(Uniform4fARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(Uniform4fvARB)
- .type GL_PREFIX(Uniform4fvARB), @function
-GL_PREFIX(Uniform4fvARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4480(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4480(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4480(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4480(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Uniform4fvARB), .-GL_PREFIX(Uniform4fvARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(Uniform4iARB)
- .type GL_PREFIX(Uniform4iARB), @function
-GL_PREFIX(Uniform4iARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4488(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- call _x86_64_get_dispatch@PLT
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4488(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4488(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- call _glapi_get_dispatch
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4488(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Uniform4iARB), .-GL_PREFIX(Uniform4iARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(Uniform4ivARB)
- .type GL_PREFIX(Uniform4ivARB), @function
-GL_PREFIX(Uniform4ivARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4496(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4496(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4496(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4496(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Uniform4ivARB), .-GL_PREFIX(Uniform4ivARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(UniformMatrix2fvARB)
- .type GL_PREFIX(UniformMatrix2fvARB), @function
-GL_PREFIX(UniformMatrix2fvARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4504(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4504(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4504(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4504(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(UniformMatrix2fvARB), .-GL_PREFIX(UniformMatrix2fvARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(UniformMatrix3fvARB)
- .type GL_PREFIX(UniformMatrix3fvARB), @function
-GL_PREFIX(UniformMatrix3fvARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4512(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4512(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4512(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4512(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(UniformMatrix3fvARB), .-GL_PREFIX(UniformMatrix3fvARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(UniformMatrix4fvARB)
- .type GL_PREFIX(UniformMatrix4fvARB), @function
-GL_PREFIX(UniformMatrix4fvARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4520(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4520(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4520(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4520(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(UniformMatrix4fvARB), .-GL_PREFIX(UniformMatrix4fvARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(UseProgramObjectARB)
- .type GL_PREFIX(UseProgramObjectARB), @function
-GL_PREFIX(UseProgramObjectARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4528(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 4528(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4528(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 4528(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(UseProgramObjectARB), .-GL_PREFIX(UseProgramObjectARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(ValidateProgramARB)
- .type GL_PREFIX(ValidateProgramARB), @function
-GL_PREFIX(ValidateProgramARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4536(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 4536(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4536(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 4536(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(ValidateProgramARB), .-GL_PREFIX(ValidateProgramARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(BindAttribLocationARB)
- .type GL_PREFIX(BindAttribLocationARB), @function
-GL_PREFIX(BindAttribLocationARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4544(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4544(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4544(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4544(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(BindAttribLocationARB), .-GL_PREFIX(BindAttribLocationARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetActiveAttribARB)
- .type GL_PREFIX(GetActiveAttribARB), @function
-GL_PREFIX(GetActiveAttribARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4552(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- pushq %r9
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %r9
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4552(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4552(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- pushq %r9
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %r9
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4552(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetActiveAttribARB), .-GL_PREFIX(GetActiveAttribARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetAttribLocationARB)
- .type GL_PREFIX(GetAttribLocationARB), @function
-GL_PREFIX(GetAttribLocationARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4560(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 4560(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4560(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 4560(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetAttribLocationARB), .-GL_PREFIX(GetAttribLocationARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(DrawBuffersARB)
- .type GL_PREFIX(DrawBuffersARB), @function
-GL_PREFIX(DrawBuffersARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4568(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 4568(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4568(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 4568(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(DrawBuffersARB), .-GL_PREFIX(DrawBuffersARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(ClampColorARB)
- .type GL_PREFIX(ClampColorARB), @function
-GL_PREFIX(ClampColorARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4576(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 4576(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4576(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 4576(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(ClampColorARB), .-GL_PREFIX(ClampColorARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(DrawArraysInstancedARB)
- .type GL_PREFIX(DrawArraysInstancedARB), @function
-GL_PREFIX(DrawArraysInstancedARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4584(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4584(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4584(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4584(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(DrawArraysInstancedARB), .-GL_PREFIX(DrawArraysInstancedARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(DrawElementsInstancedARB)
- .type GL_PREFIX(DrawElementsInstancedARB), @function
-GL_PREFIX(DrawElementsInstancedARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4592(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- call _x86_64_get_dispatch@PLT
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4592(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4592(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- call _glapi_get_dispatch
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4592(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(DrawElementsInstancedARB), .-GL_PREFIX(DrawElementsInstancedARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(RenderbufferStorageMultisample)
- .type GL_PREFIX(RenderbufferStorageMultisample), @function
-GL_PREFIX(RenderbufferStorageMultisample):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4600(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- call _x86_64_get_dispatch@PLT
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4600(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4600(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- call _glapi_get_dispatch
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4600(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(RenderbufferStorageMultisample), .-GL_PREFIX(RenderbufferStorageMultisample)
-
- .p2align 4,,15
- .globl GL_PREFIX(FramebufferTextureARB)
- .type GL_PREFIX(FramebufferTextureARB), @function
-GL_PREFIX(FramebufferTextureARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4608(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4608(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4608(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4608(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(FramebufferTextureARB), .-GL_PREFIX(FramebufferTextureARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(FramebufferTextureFaceARB)
- .type GL_PREFIX(FramebufferTextureFaceARB), @function
-GL_PREFIX(FramebufferTextureFaceARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4616(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- call _x86_64_get_dispatch@PLT
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4616(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4616(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- call _glapi_get_dispatch
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4616(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(FramebufferTextureFaceARB), .-GL_PREFIX(FramebufferTextureFaceARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(ProgramParameteriARB)
- .type GL_PREFIX(ProgramParameteriARB), @function
-GL_PREFIX(ProgramParameteriARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4624(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4624(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4624(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4624(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(ProgramParameteriARB), .-GL_PREFIX(ProgramParameteriARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexAttribDivisorARB)
- .type GL_PREFIX(VertexAttribDivisorARB), @function
-GL_PREFIX(VertexAttribDivisorARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4632(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 4632(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4632(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 4632(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexAttribDivisorARB), .-GL_PREFIX(VertexAttribDivisorARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(FlushMappedBufferRange)
- .type GL_PREFIX(FlushMappedBufferRange), @function
-GL_PREFIX(FlushMappedBufferRange):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4640(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4640(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4640(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4640(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(FlushMappedBufferRange), .-GL_PREFIX(FlushMappedBufferRange)
-
- .p2align 4,,15
- .globl GL_PREFIX(MapBufferRange)
- .type GL_PREFIX(MapBufferRange), @function
-GL_PREFIX(MapBufferRange):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4648(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4648(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4648(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4648(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(MapBufferRange), .-GL_PREFIX(MapBufferRange)
-
- .p2align 4,,15
- .globl GL_PREFIX(TexBufferARB)
- .type GL_PREFIX(TexBufferARB), @function
-GL_PREFIX(TexBufferARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4656(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4656(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4656(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4656(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(TexBufferARB), .-GL_PREFIX(TexBufferARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(BindVertexArray)
- .type GL_PREFIX(BindVertexArray), @function
-GL_PREFIX(BindVertexArray):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4664(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 4664(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4664(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 4664(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(BindVertexArray), .-GL_PREFIX(BindVertexArray)
-
- .p2align 4,,15
- .globl GL_PREFIX(GenVertexArrays)
- .type GL_PREFIX(GenVertexArrays), @function
-GL_PREFIX(GenVertexArrays):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4672(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 4672(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4672(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 4672(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GenVertexArrays), .-GL_PREFIX(GenVertexArrays)
-
- .p2align 4,,15
- .globl GL_PREFIX(CopyBufferSubData)
- .type GL_PREFIX(CopyBufferSubData), @function
-GL_PREFIX(CopyBufferSubData):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4680(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- call _x86_64_get_dispatch@PLT
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4680(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4680(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- call _glapi_get_dispatch
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4680(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(CopyBufferSubData), .-GL_PREFIX(CopyBufferSubData)
-
- .p2align 4,,15
- .globl GL_PREFIX(ClientWaitSync)
- .type GL_PREFIX(ClientWaitSync), @function
-GL_PREFIX(ClientWaitSync):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4688(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4688(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4688(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4688(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(ClientWaitSync), .-GL_PREFIX(ClientWaitSync)
-
- .p2align 4,,15
- .globl GL_PREFIX(DeleteSync)
- .type GL_PREFIX(DeleteSync), @function
-GL_PREFIX(DeleteSync):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4696(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 4696(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4696(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 4696(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(DeleteSync), .-GL_PREFIX(DeleteSync)
-
- .p2align 4,,15
- .globl GL_PREFIX(FenceSync)
- .type GL_PREFIX(FenceSync), @function
-GL_PREFIX(FenceSync):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4704(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 4704(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4704(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 4704(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(FenceSync), .-GL_PREFIX(FenceSync)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetInteger64v)
- .type GL_PREFIX(GetInteger64v), @function
-GL_PREFIX(GetInteger64v):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4712(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 4712(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4712(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 4712(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetInteger64v), .-GL_PREFIX(GetInteger64v)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetSynciv)
- .type GL_PREFIX(GetSynciv), @function
-GL_PREFIX(GetSynciv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4720(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- call _x86_64_get_dispatch@PLT
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4720(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4720(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- call _glapi_get_dispatch
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4720(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetSynciv), .-GL_PREFIX(GetSynciv)
-
- .p2align 4,,15
- .globl GL_PREFIX(IsSync)
- .type GL_PREFIX(IsSync), @function
-GL_PREFIX(IsSync):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4728(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 4728(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4728(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 4728(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(IsSync), .-GL_PREFIX(IsSync)
-
- .p2align 4,,15
- .globl GL_PREFIX(WaitSync)
- .type GL_PREFIX(WaitSync), @function
-GL_PREFIX(WaitSync):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4736(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4736(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4736(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4736(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(WaitSync), .-GL_PREFIX(WaitSync)
-
- .p2align 4,,15
- .globl GL_PREFIX(DrawElementsBaseVertex)
- .type GL_PREFIX(DrawElementsBaseVertex), @function
-GL_PREFIX(DrawElementsBaseVertex):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4744(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- call _x86_64_get_dispatch@PLT
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4744(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4744(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- call _glapi_get_dispatch
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4744(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(DrawElementsBaseVertex), .-GL_PREFIX(DrawElementsBaseVertex)
-
- .p2align 4,,15
- .globl GL_PREFIX(DrawRangeElementsBaseVertex)
- .type GL_PREFIX(DrawRangeElementsBaseVertex), @function
-GL_PREFIX(DrawRangeElementsBaseVertex):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4752(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- pushq %r9
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %r9
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4752(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4752(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- pushq %r9
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %r9
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4752(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(DrawRangeElementsBaseVertex), .-GL_PREFIX(DrawRangeElementsBaseVertex)
-
- .p2align 4,,15
- .globl GL_PREFIX(MultiDrawElementsBaseVertex)
- .type GL_PREFIX(MultiDrawElementsBaseVertex), @function
-GL_PREFIX(MultiDrawElementsBaseVertex):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4760(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- pushq %r9
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %r9
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4760(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4760(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- pushq %r9
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %r9
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4760(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(MultiDrawElementsBaseVertex), .-GL_PREFIX(MultiDrawElementsBaseVertex)
-
- .p2align 4,,15
- .globl GL_PREFIX(BlendEquationSeparateiARB)
- .type GL_PREFIX(BlendEquationSeparateiARB), @function
-GL_PREFIX(BlendEquationSeparateiARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4768(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4768(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4768(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4768(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(BlendEquationSeparateiARB), .-GL_PREFIX(BlendEquationSeparateiARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(BlendEquationiARB)
- .type GL_PREFIX(BlendEquationiARB), @function
-GL_PREFIX(BlendEquationiARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4776(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 4776(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4776(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 4776(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(BlendEquationiARB), .-GL_PREFIX(BlendEquationiARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(BlendFuncSeparateiARB)
- .type GL_PREFIX(BlendFuncSeparateiARB), @function
-GL_PREFIX(BlendFuncSeparateiARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4784(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- call _x86_64_get_dispatch@PLT
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4784(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4784(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- call _glapi_get_dispatch
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4784(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(BlendFuncSeparateiARB), .-GL_PREFIX(BlendFuncSeparateiARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(BlendFunciARB)
- .type GL_PREFIX(BlendFunciARB), @function
-GL_PREFIX(BlendFunciARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4792(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4792(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4792(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4792(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(BlendFunciARB), .-GL_PREFIX(BlendFunciARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(BindSampler)
- .type GL_PREFIX(BindSampler), @function
-GL_PREFIX(BindSampler):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4800(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 4800(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4800(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 4800(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(BindSampler), .-GL_PREFIX(BindSampler)
-
- .p2align 4,,15
- .globl GL_PREFIX(DeleteSamplers)
- .type GL_PREFIX(DeleteSamplers), @function
-GL_PREFIX(DeleteSamplers):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4808(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 4808(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4808(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 4808(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(DeleteSamplers), .-GL_PREFIX(DeleteSamplers)
-
- .p2align 4,,15
- .globl GL_PREFIX(GenSamplers)
- .type GL_PREFIX(GenSamplers), @function
-GL_PREFIX(GenSamplers):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4816(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 4816(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4816(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 4816(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GenSamplers), .-GL_PREFIX(GenSamplers)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetSamplerParameterIiv)
- .type GL_PREFIX(GetSamplerParameterIiv), @function
-GL_PREFIX(GetSamplerParameterIiv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4824(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4824(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4824(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4824(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetSamplerParameterIiv), .-GL_PREFIX(GetSamplerParameterIiv)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetSamplerParameterIuiv)
- .type GL_PREFIX(GetSamplerParameterIuiv), @function
-GL_PREFIX(GetSamplerParameterIuiv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4832(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4832(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4832(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4832(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetSamplerParameterIuiv), .-GL_PREFIX(GetSamplerParameterIuiv)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetSamplerParameterfv)
- .type GL_PREFIX(GetSamplerParameterfv), @function
-GL_PREFIX(GetSamplerParameterfv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4840(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4840(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4840(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4840(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetSamplerParameterfv), .-GL_PREFIX(GetSamplerParameterfv)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetSamplerParameteriv)
- .type GL_PREFIX(GetSamplerParameteriv), @function
-GL_PREFIX(GetSamplerParameteriv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4848(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4848(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4848(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4848(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetSamplerParameteriv), .-GL_PREFIX(GetSamplerParameteriv)
-
- .p2align 4,,15
- .globl GL_PREFIX(IsSampler)
- .type GL_PREFIX(IsSampler), @function
-GL_PREFIX(IsSampler):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4856(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 4856(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4856(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 4856(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(IsSampler), .-GL_PREFIX(IsSampler)
-
- .p2align 4,,15
- .globl GL_PREFIX(SamplerParameterIiv)
- .type GL_PREFIX(SamplerParameterIiv), @function
-GL_PREFIX(SamplerParameterIiv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4864(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4864(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4864(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4864(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(SamplerParameterIiv), .-GL_PREFIX(SamplerParameterIiv)
-
- .p2align 4,,15
- .globl GL_PREFIX(SamplerParameterIuiv)
- .type GL_PREFIX(SamplerParameterIuiv), @function
-GL_PREFIX(SamplerParameterIuiv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4872(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4872(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4872(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4872(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(SamplerParameterIuiv), .-GL_PREFIX(SamplerParameterIuiv)
-
- .p2align 4,,15
- .globl GL_PREFIX(SamplerParameterf)
- .type GL_PREFIX(SamplerParameterf), @function
-GL_PREFIX(SamplerParameterf):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4880(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $24, %rsp
- movq %rdi, (%rsp)
- movq %rsi, 8(%rsp)
- movq %xmm0, 16(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 16(%rsp), %xmm0
- movq 8(%rsp), %rsi
- movq (%rsp), %rdi
- addq $24, %rsp
- movq 4880(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4880(%rax), %r11
- jmp *%r11
-1:
- subq $24, %rsp
- movq %rdi, (%rsp)
- movq %rsi, 8(%rsp)
- movq %xmm0, 16(%rsp)
- call _glapi_get_dispatch
- movq 16(%rsp), %xmm0
- movq 8(%rsp), %rsi
- movq (%rsp), %rdi
- addq $24, %rsp
- movq 4880(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(SamplerParameterf), .-GL_PREFIX(SamplerParameterf)
-
- .p2align 4,,15
- .globl GL_PREFIX(SamplerParameterfv)
- .type GL_PREFIX(SamplerParameterfv), @function
-GL_PREFIX(SamplerParameterfv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4888(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4888(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4888(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4888(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(SamplerParameterfv), .-GL_PREFIX(SamplerParameterfv)
-
- .p2align 4,,15
- .globl GL_PREFIX(SamplerParameteri)
- .type GL_PREFIX(SamplerParameteri), @function
-GL_PREFIX(SamplerParameteri):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4896(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4896(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4896(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4896(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(SamplerParameteri), .-GL_PREFIX(SamplerParameteri)
-
- .p2align 4,,15
- .globl GL_PREFIX(SamplerParameteriv)
- .type GL_PREFIX(SamplerParameteriv), @function
-GL_PREFIX(SamplerParameteriv):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4904(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4904(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4904(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4904(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(SamplerParameteriv), .-GL_PREFIX(SamplerParameteriv)
-
- .p2align 4,,15
- .globl GL_PREFIX(BindTransformFeedback)
- .type GL_PREFIX(BindTransformFeedback), @function
-GL_PREFIX(BindTransformFeedback):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4912(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 4912(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4912(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 4912(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(BindTransformFeedback), .-GL_PREFIX(BindTransformFeedback)
-
- .p2align 4,,15
- .globl GL_PREFIX(DeleteTransformFeedbacks)
- .type GL_PREFIX(DeleteTransformFeedbacks), @function
-GL_PREFIX(DeleteTransformFeedbacks):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4920(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 4920(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4920(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 4920(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(DeleteTransformFeedbacks), .-GL_PREFIX(DeleteTransformFeedbacks)
-
- .p2align 4,,15
- .globl GL_PREFIX(DrawTransformFeedback)
- .type GL_PREFIX(DrawTransformFeedback), @function
-GL_PREFIX(DrawTransformFeedback):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4928(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 4928(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4928(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 4928(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(DrawTransformFeedback), .-GL_PREFIX(DrawTransformFeedback)
-
- .p2align 4,,15
- .globl GL_PREFIX(GenTransformFeedbacks)
- .type GL_PREFIX(GenTransformFeedbacks), @function
-GL_PREFIX(GenTransformFeedbacks):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4936(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 4936(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4936(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 4936(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GenTransformFeedbacks), .-GL_PREFIX(GenTransformFeedbacks)
-
- .p2align 4,,15
- .globl GL_PREFIX(IsTransformFeedback)
- .type GL_PREFIX(IsTransformFeedback), @function
-GL_PREFIX(IsTransformFeedback):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4944(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 4944(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4944(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 4944(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(IsTransformFeedback), .-GL_PREFIX(IsTransformFeedback)
-
- .p2align 4,,15
- .globl GL_PREFIX(PauseTransformFeedback)
- .type GL_PREFIX(PauseTransformFeedback), @function
-GL_PREFIX(PauseTransformFeedback):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4952(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- movq 4952(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4952(%rax), %r11
- jmp *%r11
-1:
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- movq 4952(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(PauseTransformFeedback), .-GL_PREFIX(PauseTransformFeedback)
-
- .p2align 4,,15
- .globl GL_PREFIX(ResumeTransformFeedback)
- .type GL_PREFIX(ResumeTransformFeedback), @function
-GL_PREFIX(ResumeTransformFeedback):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4960(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- movq 4960(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4960(%rax), %r11
- jmp *%r11
-1:
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- movq 4960(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(ResumeTransformFeedback), .-GL_PREFIX(ResumeTransformFeedback)
-
- .p2align 4,,15
- .globl GL_PREFIX(ClearDepthf)
- .type GL_PREFIX(ClearDepthf), @function
-GL_PREFIX(ClearDepthf):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4968(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 4968(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4968(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 4968(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(ClearDepthf), .-GL_PREFIX(ClearDepthf)
-
- .p2align 4,,15
- .globl GL_PREFIX(DepthRangef)
- .type GL_PREFIX(DepthRangef), @function
-GL_PREFIX(DepthRangef):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4976(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 4976(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4976(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 4976(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(DepthRangef), .-GL_PREFIX(DepthRangef)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetShaderPrecisionFormat)
- .type GL_PREFIX(GetShaderPrecisionFormat), @function
-GL_PREFIX(GetShaderPrecisionFormat):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4984(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4984(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4984(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 4984(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetShaderPrecisionFormat), .-GL_PREFIX(GetShaderPrecisionFormat)
-
- .p2align 4,,15
- .globl GL_PREFIX(ReleaseShaderCompiler)
- .type GL_PREFIX(ReleaseShaderCompiler), @function
-GL_PREFIX(ReleaseShaderCompiler):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 4992(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- movq 4992(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 4992(%rax), %r11
- jmp *%r11
-1:
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- movq 4992(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(ReleaseShaderCompiler), .-GL_PREFIX(ReleaseShaderCompiler)
-
- .p2align 4,,15
- .globl GL_PREFIX(ShaderBinary)
- .type GL_PREFIX(ShaderBinary), @function
-GL_PREFIX(ShaderBinary):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5000(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- call _x86_64_get_dispatch@PLT
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5000(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5000(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- call _glapi_get_dispatch
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5000(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(ShaderBinary), .-GL_PREFIX(ShaderBinary)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetGraphicsResetStatusARB)
- .type GL_PREFIX(GetGraphicsResetStatusARB), @function
-GL_PREFIX(GetGraphicsResetStatusARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5008(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- movq 5008(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5008(%rax), %r11
- jmp *%r11
-1:
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- movq 5008(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetGraphicsResetStatusARB), .-GL_PREFIX(GetGraphicsResetStatusARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetnColorTableARB)
- .type GL_PREFIX(GetnColorTableARB), @function
-GL_PREFIX(GetnColorTableARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5016(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- call _x86_64_get_dispatch@PLT
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5016(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5016(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- call _glapi_get_dispatch
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5016(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetnColorTableARB), .-GL_PREFIX(GetnColorTableARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetnCompressedTexImageARB)
- .type GL_PREFIX(GetnCompressedTexImageARB), @function
-GL_PREFIX(GetnCompressedTexImageARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5024(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5024(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5024(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5024(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetnCompressedTexImageARB), .-GL_PREFIX(GetnCompressedTexImageARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetnConvolutionFilterARB)
- .type GL_PREFIX(GetnConvolutionFilterARB), @function
-GL_PREFIX(GetnConvolutionFilterARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5032(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- call _x86_64_get_dispatch@PLT
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5032(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5032(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- call _glapi_get_dispatch
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5032(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetnConvolutionFilterARB), .-GL_PREFIX(GetnConvolutionFilterARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetnHistogramARB)
- .type GL_PREFIX(GetnHistogramARB), @function
-GL_PREFIX(GetnHistogramARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5040(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- pushq %r9
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %r9
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5040(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5040(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- pushq %r9
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %r9
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5040(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetnHistogramARB), .-GL_PREFIX(GetnHistogramARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetnMapdvARB)
- .type GL_PREFIX(GetnMapdvARB), @function
-GL_PREFIX(GetnMapdvARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5048(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5048(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5048(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5048(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetnMapdvARB), .-GL_PREFIX(GetnMapdvARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetnMapfvARB)
- .type GL_PREFIX(GetnMapfvARB), @function
-GL_PREFIX(GetnMapfvARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5056(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5056(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5056(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5056(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetnMapfvARB), .-GL_PREFIX(GetnMapfvARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetnMapivARB)
- .type GL_PREFIX(GetnMapivARB), @function
-GL_PREFIX(GetnMapivARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5064(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5064(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5064(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5064(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetnMapivARB), .-GL_PREFIX(GetnMapivARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetnMinmaxARB)
- .type GL_PREFIX(GetnMinmaxARB), @function
-GL_PREFIX(GetnMinmaxARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5072(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- pushq %r9
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %r9
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5072(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5072(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- pushq %r9
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %r9
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5072(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetnMinmaxARB), .-GL_PREFIX(GetnMinmaxARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetnPixelMapfvARB)
- .type GL_PREFIX(GetnPixelMapfvARB), @function
-GL_PREFIX(GetnPixelMapfvARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5080(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5080(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5080(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5080(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetnPixelMapfvARB), .-GL_PREFIX(GetnPixelMapfvARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetnPixelMapuivARB)
- .type GL_PREFIX(GetnPixelMapuivARB), @function
-GL_PREFIX(GetnPixelMapuivARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5088(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5088(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5088(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5088(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetnPixelMapuivARB), .-GL_PREFIX(GetnPixelMapuivARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetnPixelMapusvARB)
- .type GL_PREFIX(GetnPixelMapusvARB), @function
-GL_PREFIX(GetnPixelMapusvARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5096(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5096(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5096(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5096(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetnPixelMapusvARB), .-GL_PREFIX(GetnPixelMapusvARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetnPolygonStippleARB)
- .type GL_PREFIX(GetnPolygonStippleARB), @function
-GL_PREFIX(GetnPolygonStippleARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5104(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 5104(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5104(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 5104(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetnPolygonStippleARB), .-GL_PREFIX(GetnPolygonStippleARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetnSeparableFilterARB)
- .type GL_PREFIX(GetnSeparableFilterARB), @function
-GL_PREFIX(GetnSeparableFilterARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5112(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- pushq %r9
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %r9
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5112(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5112(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- pushq %r9
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %r9
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5112(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetnSeparableFilterARB), .-GL_PREFIX(GetnSeparableFilterARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetnTexImageARB)
- .type GL_PREFIX(GetnTexImageARB), @function
-GL_PREFIX(GetnTexImageARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5120(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- pushq %r9
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %r9
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5120(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5120(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- pushq %r9
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %r9
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5120(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetnTexImageARB), .-GL_PREFIX(GetnTexImageARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetnUniformdvARB)
- .type GL_PREFIX(GetnUniformdvARB), @function
-GL_PREFIX(GetnUniformdvARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5128(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5128(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5128(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5128(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetnUniformdvARB), .-GL_PREFIX(GetnUniformdvARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetnUniformfvARB)
- .type GL_PREFIX(GetnUniformfvARB), @function
-GL_PREFIX(GetnUniformfvARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5136(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5136(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5136(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5136(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetnUniformfvARB), .-GL_PREFIX(GetnUniformfvARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetnUniformivARB)
- .type GL_PREFIX(GetnUniformivARB), @function
-GL_PREFIX(GetnUniformivARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5144(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5144(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5144(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5144(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetnUniformivARB), .-GL_PREFIX(GetnUniformivARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetnUniformuivARB)
- .type GL_PREFIX(GetnUniformuivARB), @function
-GL_PREFIX(GetnUniformuivARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5152(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5152(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5152(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5152(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetnUniformuivARB), .-GL_PREFIX(GetnUniformuivARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(ReadnPixelsARB)
- .type GL_PREFIX(ReadnPixelsARB), @function
-GL_PREFIX(ReadnPixelsARB):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5160(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- pushq %r9
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %r9
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5160(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5160(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- pushq %r9
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %r9
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5160(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(ReadnPixelsARB), .-GL_PREFIX(ReadnPixelsARB)
-
- .p2align 4,,15
- .globl GL_PREFIX(PolygonOffsetEXT)
- .type GL_PREFIX(PolygonOffsetEXT), @function
-GL_PREFIX(PolygonOffsetEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5168(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $24, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $24, %rsp
- movq 5168(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5168(%rax), %r11
- jmp *%r11
-1:
- subq $24, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- call _glapi_get_dispatch
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $24, %rsp
- movq 5168(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(PolygonOffsetEXT), .-GL_PREFIX(PolygonOffsetEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(_dispatch_stub_647)
- .type GL_PREFIX(_dispatch_stub_647), @function
- HIDDEN(GL_PREFIX(_dispatch_stub_647))
-GL_PREFIX(_dispatch_stub_647):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5176(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 5176(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5176(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 5176(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(_dispatch_stub_647), .-GL_PREFIX(_dispatch_stub_647)
-
- .p2align 4,,15
- .globl GL_PREFIX(_dispatch_stub_648)
- .type GL_PREFIX(_dispatch_stub_648), @function
- HIDDEN(GL_PREFIX(_dispatch_stub_648))
-GL_PREFIX(_dispatch_stub_648):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5184(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 5184(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5184(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 5184(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(_dispatch_stub_648), .-GL_PREFIX(_dispatch_stub_648)
-
- .p2align 4,,15
- .globl GL_PREFIX(_dispatch_stub_649)
- .type GL_PREFIX(_dispatch_stub_649), @function
- HIDDEN(GL_PREFIX(_dispatch_stub_649))
-GL_PREFIX(_dispatch_stub_649):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5192(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $24, %rsp
- movq %rdi, (%rsp)
- movq %xmm0, 8(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 8(%rsp), %xmm0
- movq (%rsp), %rdi
- addq $24, %rsp
- movq 5192(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5192(%rax), %r11
- jmp *%r11
-1:
- subq $24, %rsp
- movq %rdi, (%rsp)
- movq %xmm0, 8(%rsp)
- call _glapi_get_dispatch
- movq 8(%rsp), %xmm0
- movq (%rsp), %rdi
- addq $24, %rsp
- movq 5192(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(_dispatch_stub_649), .-GL_PREFIX(_dispatch_stub_649)
-
- .p2align 4,,15
- .globl GL_PREFIX(_dispatch_stub_650)
- .type GL_PREFIX(_dispatch_stub_650), @function
- HIDDEN(GL_PREFIX(_dispatch_stub_650))
-GL_PREFIX(_dispatch_stub_650):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5200(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 5200(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5200(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 5200(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(_dispatch_stub_650), .-GL_PREFIX(_dispatch_stub_650)
-
- .p2align 4,,15
- .globl GL_PREFIX(_dispatch_stub_651)
- .type GL_PREFIX(_dispatch_stub_651), @function
- HIDDEN(GL_PREFIX(_dispatch_stub_651))
-GL_PREFIX(_dispatch_stub_651):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5208(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 5208(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5208(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 5208(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(_dispatch_stub_651), .-GL_PREFIX(_dispatch_stub_651)
-
- .p2align 4,,15
- .globl GL_PREFIX(_dispatch_stub_652)
- .type GL_PREFIX(_dispatch_stub_652), @function
- HIDDEN(GL_PREFIX(_dispatch_stub_652))
-GL_PREFIX(_dispatch_stub_652):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5216(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 5216(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5216(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 5216(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(_dispatch_stub_652), .-GL_PREFIX(_dispatch_stub_652)
-
- .p2align 4,,15
- .globl GL_PREFIX(_dispatch_stub_653)
- .type GL_PREFIX(_dispatch_stub_653), @function
- HIDDEN(GL_PREFIX(_dispatch_stub_653))
-GL_PREFIX(_dispatch_stub_653):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5224(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 5224(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5224(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 5224(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(_dispatch_stub_653), .-GL_PREFIX(_dispatch_stub_653)
-
- .p2align 4,,15
- .globl GL_PREFIX(_dispatch_stub_654)
- .type GL_PREFIX(_dispatch_stub_654), @function
- HIDDEN(GL_PREFIX(_dispatch_stub_654))
-GL_PREFIX(_dispatch_stub_654):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5232(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 5232(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5232(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 5232(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(_dispatch_stub_654), .-GL_PREFIX(_dispatch_stub_654)
-
- .p2align 4,,15
- .globl GL_PREFIX(ColorPointerEXT)
- .type GL_PREFIX(ColorPointerEXT), @function
-GL_PREFIX(ColorPointerEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5240(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- call _x86_64_get_dispatch@PLT
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5240(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5240(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- call _glapi_get_dispatch
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5240(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(ColorPointerEXT), .-GL_PREFIX(ColorPointerEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(EdgeFlagPointerEXT)
- .type GL_PREFIX(EdgeFlagPointerEXT), @function
-GL_PREFIX(EdgeFlagPointerEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5248(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5248(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5248(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5248(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(EdgeFlagPointerEXT), .-GL_PREFIX(EdgeFlagPointerEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(IndexPointerEXT)
- .type GL_PREFIX(IndexPointerEXT), @function
-GL_PREFIX(IndexPointerEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5256(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5256(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5256(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5256(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(IndexPointerEXT), .-GL_PREFIX(IndexPointerEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(NormalPointerEXT)
- .type GL_PREFIX(NormalPointerEXT), @function
-GL_PREFIX(NormalPointerEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5264(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5264(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5264(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5264(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(NormalPointerEXT), .-GL_PREFIX(NormalPointerEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(TexCoordPointerEXT)
- .type GL_PREFIX(TexCoordPointerEXT), @function
-GL_PREFIX(TexCoordPointerEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5272(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- call _x86_64_get_dispatch@PLT
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5272(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5272(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- call _glapi_get_dispatch
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5272(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(TexCoordPointerEXT), .-GL_PREFIX(TexCoordPointerEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexPointerEXT)
- .type GL_PREFIX(VertexPointerEXT), @function
-GL_PREFIX(VertexPointerEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5280(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- call _x86_64_get_dispatch@PLT
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5280(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5280(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- call _glapi_get_dispatch
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5280(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexPointerEXT), .-GL_PREFIX(VertexPointerEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(PointParameterfEXT)
- .type GL_PREFIX(PointParameterfEXT), @function
-GL_PREFIX(PointParameterfEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5288(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $24, %rsp
- movq %rdi, (%rsp)
- movq %xmm0, 8(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 8(%rsp), %xmm0
- movq (%rsp), %rdi
- addq $24, %rsp
- movq 5288(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5288(%rax), %r11
- jmp *%r11
-1:
- subq $24, %rsp
- movq %rdi, (%rsp)
- movq %xmm0, 8(%rsp)
- call _glapi_get_dispatch
- movq 8(%rsp), %xmm0
- movq (%rsp), %rdi
- addq $24, %rsp
- movq 5288(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(PointParameterfEXT), .-GL_PREFIX(PointParameterfEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(PointParameterfvEXT)
- .type GL_PREFIX(PointParameterfvEXT), @function
-GL_PREFIX(PointParameterfvEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5296(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 5296(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5296(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 5296(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(PointParameterfvEXT), .-GL_PREFIX(PointParameterfvEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(LockArraysEXT)
- .type GL_PREFIX(LockArraysEXT), @function
-GL_PREFIX(LockArraysEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5304(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 5304(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5304(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 5304(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(LockArraysEXT), .-GL_PREFIX(LockArraysEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(UnlockArraysEXT)
- .type GL_PREFIX(UnlockArraysEXT), @function
-GL_PREFIX(UnlockArraysEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5312(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- movq 5312(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5312(%rax), %r11
- jmp *%r11
-1:
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- movq 5312(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(UnlockArraysEXT), .-GL_PREFIX(UnlockArraysEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(SecondaryColor3bEXT)
- .type GL_PREFIX(SecondaryColor3bEXT), @function
-GL_PREFIX(SecondaryColor3bEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5320(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5320(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5320(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5320(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(SecondaryColor3bEXT), .-GL_PREFIX(SecondaryColor3bEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(SecondaryColor3bvEXT)
- .type GL_PREFIX(SecondaryColor3bvEXT), @function
-GL_PREFIX(SecondaryColor3bvEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5328(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 5328(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5328(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 5328(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(SecondaryColor3bvEXT), .-GL_PREFIX(SecondaryColor3bvEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(SecondaryColor3dEXT)
- .type GL_PREFIX(SecondaryColor3dEXT), @function
-GL_PREFIX(SecondaryColor3dEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5336(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $24, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- movq %xmm2, 16(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 16(%rsp), %xmm2
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $24, %rsp
- movq 5336(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5336(%rax), %r11
- jmp *%r11
-1:
- subq $24, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- movq %xmm2, 16(%rsp)
- call _glapi_get_dispatch
- movq 16(%rsp), %xmm2
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $24, %rsp
- movq 5336(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(SecondaryColor3dEXT), .-GL_PREFIX(SecondaryColor3dEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(SecondaryColor3dvEXT)
- .type GL_PREFIX(SecondaryColor3dvEXT), @function
-GL_PREFIX(SecondaryColor3dvEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5344(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 5344(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5344(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 5344(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(SecondaryColor3dvEXT), .-GL_PREFIX(SecondaryColor3dvEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(SecondaryColor3fEXT)
- .type GL_PREFIX(SecondaryColor3fEXT), @function
-GL_PREFIX(SecondaryColor3fEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5352(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $24, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- movq %xmm2, 16(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 16(%rsp), %xmm2
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $24, %rsp
- movq 5352(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5352(%rax), %r11
- jmp *%r11
-1:
- subq $24, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- movq %xmm2, 16(%rsp)
- call _glapi_get_dispatch
- movq 16(%rsp), %xmm2
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $24, %rsp
- movq 5352(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(SecondaryColor3fEXT), .-GL_PREFIX(SecondaryColor3fEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(SecondaryColor3fvEXT)
- .type GL_PREFIX(SecondaryColor3fvEXT), @function
-GL_PREFIX(SecondaryColor3fvEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5360(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 5360(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5360(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 5360(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(SecondaryColor3fvEXT), .-GL_PREFIX(SecondaryColor3fvEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(SecondaryColor3iEXT)
- .type GL_PREFIX(SecondaryColor3iEXT), @function
-GL_PREFIX(SecondaryColor3iEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5368(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5368(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5368(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5368(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(SecondaryColor3iEXT), .-GL_PREFIX(SecondaryColor3iEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(SecondaryColor3ivEXT)
- .type GL_PREFIX(SecondaryColor3ivEXT), @function
-GL_PREFIX(SecondaryColor3ivEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5376(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 5376(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5376(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 5376(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(SecondaryColor3ivEXT), .-GL_PREFIX(SecondaryColor3ivEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(SecondaryColor3sEXT)
- .type GL_PREFIX(SecondaryColor3sEXT), @function
-GL_PREFIX(SecondaryColor3sEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5384(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5384(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5384(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5384(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(SecondaryColor3sEXT), .-GL_PREFIX(SecondaryColor3sEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(SecondaryColor3svEXT)
- .type GL_PREFIX(SecondaryColor3svEXT), @function
-GL_PREFIX(SecondaryColor3svEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5392(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 5392(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5392(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 5392(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(SecondaryColor3svEXT), .-GL_PREFIX(SecondaryColor3svEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(SecondaryColor3ubEXT)
- .type GL_PREFIX(SecondaryColor3ubEXT), @function
-GL_PREFIX(SecondaryColor3ubEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5400(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5400(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5400(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5400(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(SecondaryColor3ubEXT), .-GL_PREFIX(SecondaryColor3ubEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(SecondaryColor3ubvEXT)
- .type GL_PREFIX(SecondaryColor3ubvEXT), @function
-GL_PREFIX(SecondaryColor3ubvEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5408(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 5408(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5408(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 5408(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(SecondaryColor3ubvEXT), .-GL_PREFIX(SecondaryColor3ubvEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(SecondaryColor3uiEXT)
- .type GL_PREFIX(SecondaryColor3uiEXT), @function
-GL_PREFIX(SecondaryColor3uiEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5416(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5416(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5416(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5416(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(SecondaryColor3uiEXT), .-GL_PREFIX(SecondaryColor3uiEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(SecondaryColor3uivEXT)
- .type GL_PREFIX(SecondaryColor3uivEXT), @function
-GL_PREFIX(SecondaryColor3uivEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5424(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 5424(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5424(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 5424(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(SecondaryColor3uivEXT), .-GL_PREFIX(SecondaryColor3uivEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(SecondaryColor3usEXT)
- .type GL_PREFIX(SecondaryColor3usEXT), @function
-GL_PREFIX(SecondaryColor3usEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5432(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5432(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5432(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5432(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(SecondaryColor3usEXT), .-GL_PREFIX(SecondaryColor3usEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(SecondaryColor3usvEXT)
- .type GL_PREFIX(SecondaryColor3usvEXT), @function
-GL_PREFIX(SecondaryColor3usvEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5440(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 5440(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5440(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 5440(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(SecondaryColor3usvEXT), .-GL_PREFIX(SecondaryColor3usvEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(SecondaryColorPointerEXT)
- .type GL_PREFIX(SecondaryColorPointerEXT), @function
-GL_PREFIX(SecondaryColorPointerEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5448(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5448(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5448(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5448(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(SecondaryColorPointerEXT), .-GL_PREFIX(SecondaryColorPointerEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(MultiDrawArraysEXT)
- .type GL_PREFIX(MultiDrawArraysEXT), @function
-GL_PREFIX(MultiDrawArraysEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5456(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5456(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5456(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5456(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(MultiDrawArraysEXT), .-GL_PREFIX(MultiDrawArraysEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(MultiDrawElementsEXT)
- .type GL_PREFIX(MultiDrawElementsEXT), @function
-GL_PREFIX(MultiDrawElementsEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5464(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- call _x86_64_get_dispatch@PLT
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5464(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5464(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- call _glapi_get_dispatch
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5464(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(MultiDrawElementsEXT), .-GL_PREFIX(MultiDrawElementsEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(FogCoordPointerEXT)
- .type GL_PREFIX(FogCoordPointerEXT), @function
-GL_PREFIX(FogCoordPointerEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5472(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5472(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5472(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5472(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(FogCoordPointerEXT), .-GL_PREFIX(FogCoordPointerEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(FogCoorddEXT)
- .type GL_PREFIX(FogCoorddEXT), @function
-GL_PREFIX(FogCoorddEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5480(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $8, %rsp
- movq %xmm0, (%rsp)
- call _x86_64_get_dispatch@PLT
- movq (%rsp), %xmm0
- addq $8, %rsp
- movq 5480(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5480(%rax), %r11
- jmp *%r11
-1:
- subq $8, %rsp
- movq %xmm0, (%rsp)
- call _glapi_get_dispatch
- movq (%rsp), %xmm0
- addq $8, %rsp
- movq 5480(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(FogCoorddEXT), .-GL_PREFIX(FogCoorddEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(FogCoorddvEXT)
- .type GL_PREFIX(FogCoorddvEXT), @function
-GL_PREFIX(FogCoorddvEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5488(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 5488(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5488(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 5488(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(FogCoorddvEXT), .-GL_PREFIX(FogCoorddvEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(FogCoordfEXT)
- .type GL_PREFIX(FogCoordfEXT), @function
-GL_PREFIX(FogCoordfEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5496(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $8, %rsp
- movq %xmm0, (%rsp)
- call _x86_64_get_dispatch@PLT
- movq (%rsp), %xmm0
- addq $8, %rsp
- movq 5496(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5496(%rax), %r11
- jmp *%r11
-1:
- subq $8, %rsp
- movq %xmm0, (%rsp)
- call _glapi_get_dispatch
- movq (%rsp), %xmm0
- addq $8, %rsp
- movq 5496(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(FogCoordfEXT), .-GL_PREFIX(FogCoordfEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(FogCoordfvEXT)
- .type GL_PREFIX(FogCoordfvEXT), @function
-GL_PREFIX(FogCoordfvEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5504(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 5504(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5504(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 5504(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(FogCoordfvEXT), .-GL_PREFIX(FogCoordfvEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(_dispatch_stub_689)
- .type GL_PREFIX(_dispatch_stub_689), @function
- HIDDEN(GL_PREFIX(_dispatch_stub_689))
-GL_PREFIX(_dispatch_stub_689):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5512(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 5512(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5512(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 5512(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(_dispatch_stub_689), .-GL_PREFIX(_dispatch_stub_689)
-
- .p2align 4,,15
- .globl GL_PREFIX(BlendFuncSeparateEXT)
- .type GL_PREFIX(BlendFuncSeparateEXT), @function
-GL_PREFIX(BlendFuncSeparateEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5520(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5520(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5520(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5520(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(BlendFuncSeparateEXT), .-GL_PREFIX(BlendFuncSeparateEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(FlushVertexArrayRangeNV)
- .type GL_PREFIX(FlushVertexArrayRangeNV), @function
-GL_PREFIX(FlushVertexArrayRangeNV):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5528(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- movq 5528(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5528(%rax), %r11
- jmp *%r11
-1:
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- movq 5528(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(FlushVertexArrayRangeNV), .-GL_PREFIX(FlushVertexArrayRangeNV)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexArrayRangeNV)
- .type GL_PREFIX(VertexArrayRangeNV), @function
-GL_PREFIX(VertexArrayRangeNV):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5536(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 5536(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5536(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 5536(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexArrayRangeNV), .-GL_PREFIX(VertexArrayRangeNV)
-
- .p2align 4,,15
- .globl GL_PREFIX(CombinerInputNV)
- .type GL_PREFIX(CombinerInputNV), @function
-GL_PREFIX(CombinerInputNV):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5544(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- pushq %r9
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %r9
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5544(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5544(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- pushq %r9
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %r9
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5544(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(CombinerInputNV), .-GL_PREFIX(CombinerInputNV)
-
- .p2align 4,,15
- .globl GL_PREFIX(CombinerOutputNV)
- .type GL_PREFIX(CombinerOutputNV), @function
-GL_PREFIX(CombinerOutputNV):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5552(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- pushq %r9
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %r9
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5552(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5552(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- pushq %r9
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %r9
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5552(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(CombinerOutputNV), .-GL_PREFIX(CombinerOutputNV)
-
- .p2align 4,,15
- .globl GL_PREFIX(CombinerParameterfNV)
- .type GL_PREFIX(CombinerParameterfNV), @function
-GL_PREFIX(CombinerParameterfNV):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5560(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $24, %rsp
- movq %rdi, (%rsp)
- movq %xmm0, 8(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 8(%rsp), %xmm0
- movq (%rsp), %rdi
- addq $24, %rsp
- movq 5560(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5560(%rax), %r11
- jmp *%r11
-1:
- subq $24, %rsp
- movq %rdi, (%rsp)
- movq %xmm0, 8(%rsp)
- call _glapi_get_dispatch
- movq 8(%rsp), %xmm0
- movq (%rsp), %rdi
- addq $24, %rsp
- movq 5560(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(CombinerParameterfNV), .-GL_PREFIX(CombinerParameterfNV)
-
- .p2align 4,,15
- .globl GL_PREFIX(CombinerParameterfvNV)
- .type GL_PREFIX(CombinerParameterfvNV), @function
-GL_PREFIX(CombinerParameterfvNV):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5568(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 5568(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5568(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 5568(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(CombinerParameterfvNV), .-GL_PREFIX(CombinerParameterfvNV)
-
- .p2align 4,,15
- .globl GL_PREFIX(CombinerParameteriNV)
- .type GL_PREFIX(CombinerParameteriNV), @function
-GL_PREFIX(CombinerParameteriNV):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5576(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 5576(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5576(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 5576(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(CombinerParameteriNV), .-GL_PREFIX(CombinerParameteriNV)
-
- .p2align 4,,15
- .globl GL_PREFIX(CombinerParameterivNV)
- .type GL_PREFIX(CombinerParameterivNV), @function
-GL_PREFIX(CombinerParameterivNV):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5584(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 5584(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5584(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 5584(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(CombinerParameterivNV), .-GL_PREFIX(CombinerParameterivNV)
-
- .p2align 4,,15
- .globl GL_PREFIX(FinalCombinerInputNV)
- .type GL_PREFIX(FinalCombinerInputNV), @function
-GL_PREFIX(FinalCombinerInputNV):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5592(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5592(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5592(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5592(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(FinalCombinerInputNV), .-GL_PREFIX(FinalCombinerInputNV)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetCombinerInputParameterfvNV)
- .type GL_PREFIX(GetCombinerInputParameterfvNV), @function
-GL_PREFIX(GetCombinerInputParameterfvNV):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5600(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- call _x86_64_get_dispatch@PLT
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5600(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5600(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- call _glapi_get_dispatch
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5600(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetCombinerInputParameterfvNV), .-GL_PREFIX(GetCombinerInputParameterfvNV)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetCombinerInputParameterivNV)
- .type GL_PREFIX(GetCombinerInputParameterivNV), @function
-GL_PREFIX(GetCombinerInputParameterivNV):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5608(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- call _x86_64_get_dispatch@PLT
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5608(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5608(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- call _glapi_get_dispatch
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5608(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetCombinerInputParameterivNV), .-GL_PREFIX(GetCombinerInputParameterivNV)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetCombinerOutputParameterfvNV)
- .type GL_PREFIX(GetCombinerOutputParameterfvNV), @function
-GL_PREFIX(GetCombinerOutputParameterfvNV):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5616(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5616(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5616(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5616(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetCombinerOutputParameterfvNV), .-GL_PREFIX(GetCombinerOutputParameterfvNV)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetCombinerOutputParameterivNV)
- .type GL_PREFIX(GetCombinerOutputParameterivNV), @function
-GL_PREFIX(GetCombinerOutputParameterivNV):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5624(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5624(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5624(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5624(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetCombinerOutputParameterivNV), .-GL_PREFIX(GetCombinerOutputParameterivNV)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetFinalCombinerInputParameterfvNV)
- .type GL_PREFIX(GetFinalCombinerInputParameterfvNV), @function
-GL_PREFIX(GetFinalCombinerInputParameterfvNV):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5632(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5632(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5632(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5632(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetFinalCombinerInputParameterfvNV), .-GL_PREFIX(GetFinalCombinerInputParameterfvNV)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetFinalCombinerInputParameterivNV)
- .type GL_PREFIX(GetFinalCombinerInputParameterivNV), @function
-GL_PREFIX(GetFinalCombinerInputParameterivNV):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5640(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5640(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5640(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5640(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetFinalCombinerInputParameterivNV), .-GL_PREFIX(GetFinalCombinerInputParameterivNV)
-
- .p2align 4,,15
- .globl GL_PREFIX(ResizeBuffersMESA)
- .type GL_PREFIX(ResizeBuffersMESA), @function
-GL_PREFIX(ResizeBuffersMESA):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5648(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- movq 5648(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5648(%rax), %r11
- jmp *%r11
-1:
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- movq 5648(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(ResizeBuffersMESA), .-GL_PREFIX(ResizeBuffersMESA)
-
- .p2align 4,,15
- .globl GL_PREFIX(WindowPos2dMESA)
- .type GL_PREFIX(WindowPos2dMESA), @function
-GL_PREFIX(WindowPos2dMESA):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5656(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $24, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $24, %rsp
- movq 5656(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5656(%rax), %r11
- jmp *%r11
-1:
- subq $24, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- call _glapi_get_dispatch
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $24, %rsp
- movq 5656(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(WindowPos2dMESA), .-GL_PREFIX(WindowPos2dMESA)
-
- .p2align 4,,15
- .globl GL_PREFIX(WindowPos2dvMESA)
- .type GL_PREFIX(WindowPos2dvMESA), @function
-GL_PREFIX(WindowPos2dvMESA):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5664(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 5664(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5664(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 5664(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(WindowPos2dvMESA), .-GL_PREFIX(WindowPos2dvMESA)
-
- .p2align 4,,15
- .globl GL_PREFIX(WindowPos2fMESA)
- .type GL_PREFIX(WindowPos2fMESA), @function
-GL_PREFIX(WindowPos2fMESA):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5672(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $24, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $24, %rsp
- movq 5672(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5672(%rax), %r11
- jmp *%r11
-1:
- subq $24, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- call _glapi_get_dispatch
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $24, %rsp
- movq 5672(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(WindowPos2fMESA), .-GL_PREFIX(WindowPos2fMESA)
-
- .p2align 4,,15
- .globl GL_PREFIX(WindowPos2fvMESA)
- .type GL_PREFIX(WindowPos2fvMESA), @function
-GL_PREFIX(WindowPos2fvMESA):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5680(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 5680(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5680(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 5680(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(WindowPos2fvMESA), .-GL_PREFIX(WindowPos2fvMESA)
-
- .p2align 4,,15
- .globl GL_PREFIX(WindowPos2iMESA)
- .type GL_PREFIX(WindowPos2iMESA), @function
-GL_PREFIX(WindowPos2iMESA):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5688(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 5688(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5688(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 5688(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(WindowPos2iMESA), .-GL_PREFIX(WindowPos2iMESA)
-
- .p2align 4,,15
- .globl GL_PREFIX(WindowPos2ivMESA)
- .type GL_PREFIX(WindowPos2ivMESA), @function
-GL_PREFIX(WindowPos2ivMESA):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5696(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 5696(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5696(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 5696(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(WindowPos2ivMESA), .-GL_PREFIX(WindowPos2ivMESA)
-
- .p2align 4,,15
- .globl GL_PREFIX(WindowPos2sMESA)
- .type GL_PREFIX(WindowPos2sMESA), @function
-GL_PREFIX(WindowPos2sMESA):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5704(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 5704(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5704(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 5704(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(WindowPos2sMESA), .-GL_PREFIX(WindowPos2sMESA)
-
- .p2align 4,,15
- .globl GL_PREFIX(WindowPos2svMESA)
- .type GL_PREFIX(WindowPos2svMESA), @function
-GL_PREFIX(WindowPos2svMESA):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5712(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 5712(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5712(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 5712(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(WindowPos2svMESA), .-GL_PREFIX(WindowPos2svMESA)
-
- .p2align 4,,15
- .globl GL_PREFIX(WindowPos3dMESA)
- .type GL_PREFIX(WindowPos3dMESA), @function
-GL_PREFIX(WindowPos3dMESA):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5720(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $24, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- movq %xmm2, 16(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 16(%rsp), %xmm2
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $24, %rsp
- movq 5720(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5720(%rax), %r11
- jmp *%r11
-1:
- subq $24, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- movq %xmm2, 16(%rsp)
- call _glapi_get_dispatch
- movq 16(%rsp), %xmm2
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $24, %rsp
- movq 5720(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(WindowPos3dMESA), .-GL_PREFIX(WindowPos3dMESA)
-
- .p2align 4,,15
- .globl GL_PREFIX(WindowPos3dvMESA)
- .type GL_PREFIX(WindowPos3dvMESA), @function
-GL_PREFIX(WindowPos3dvMESA):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5728(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 5728(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5728(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 5728(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(WindowPos3dvMESA), .-GL_PREFIX(WindowPos3dvMESA)
-
- .p2align 4,,15
- .globl GL_PREFIX(WindowPos3fMESA)
- .type GL_PREFIX(WindowPos3fMESA), @function
-GL_PREFIX(WindowPos3fMESA):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5736(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $24, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- movq %xmm2, 16(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 16(%rsp), %xmm2
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $24, %rsp
- movq 5736(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5736(%rax), %r11
- jmp *%r11
-1:
- subq $24, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- movq %xmm2, 16(%rsp)
- call _glapi_get_dispatch
- movq 16(%rsp), %xmm2
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $24, %rsp
- movq 5736(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(WindowPos3fMESA), .-GL_PREFIX(WindowPos3fMESA)
-
- .p2align 4,,15
- .globl GL_PREFIX(WindowPos3fvMESA)
- .type GL_PREFIX(WindowPos3fvMESA), @function
-GL_PREFIX(WindowPos3fvMESA):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5744(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 5744(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5744(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 5744(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(WindowPos3fvMESA), .-GL_PREFIX(WindowPos3fvMESA)
-
- .p2align 4,,15
- .globl GL_PREFIX(WindowPos3iMESA)
- .type GL_PREFIX(WindowPos3iMESA), @function
-GL_PREFIX(WindowPos3iMESA):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5752(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5752(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5752(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5752(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(WindowPos3iMESA), .-GL_PREFIX(WindowPos3iMESA)
-
- .p2align 4,,15
- .globl GL_PREFIX(WindowPos3ivMESA)
- .type GL_PREFIX(WindowPos3ivMESA), @function
-GL_PREFIX(WindowPos3ivMESA):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5760(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 5760(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5760(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 5760(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(WindowPos3ivMESA), .-GL_PREFIX(WindowPos3ivMESA)
-
- .p2align 4,,15
- .globl GL_PREFIX(WindowPos3sMESA)
- .type GL_PREFIX(WindowPos3sMESA), @function
-GL_PREFIX(WindowPos3sMESA):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5768(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5768(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5768(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5768(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(WindowPos3sMESA), .-GL_PREFIX(WindowPos3sMESA)
-
- .p2align 4,,15
- .globl GL_PREFIX(WindowPos3svMESA)
- .type GL_PREFIX(WindowPos3svMESA), @function
-GL_PREFIX(WindowPos3svMESA):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5776(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 5776(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5776(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 5776(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(WindowPos3svMESA), .-GL_PREFIX(WindowPos3svMESA)
-
- .p2align 4,,15
- .globl GL_PREFIX(WindowPos4dMESA)
- .type GL_PREFIX(WindowPos4dMESA), @function
-GL_PREFIX(WindowPos4dMESA):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5784(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $40, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- movq %xmm2, 16(%rsp)
- movq %xmm3, 24(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 24(%rsp), %xmm3
- movq 16(%rsp), %xmm2
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $40, %rsp
- movq 5784(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5784(%rax), %r11
- jmp *%r11
-1:
- subq $40, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- movq %xmm2, 16(%rsp)
- movq %xmm3, 24(%rsp)
- call _glapi_get_dispatch
- movq 24(%rsp), %xmm3
- movq 16(%rsp), %xmm2
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $40, %rsp
- movq 5784(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(WindowPos4dMESA), .-GL_PREFIX(WindowPos4dMESA)
-
- .p2align 4,,15
- .globl GL_PREFIX(WindowPos4dvMESA)
- .type GL_PREFIX(WindowPos4dvMESA), @function
-GL_PREFIX(WindowPos4dvMESA):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5792(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 5792(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5792(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 5792(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(WindowPos4dvMESA), .-GL_PREFIX(WindowPos4dvMESA)
-
- .p2align 4,,15
- .globl GL_PREFIX(WindowPos4fMESA)
- .type GL_PREFIX(WindowPos4fMESA), @function
-GL_PREFIX(WindowPos4fMESA):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5800(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $40, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- movq %xmm2, 16(%rsp)
- movq %xmm3, 24(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 24(%rsp), %xmm3
- movq 16(%rsp), %xmm2
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $40, %rsp
- movq 5800(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5800(%rax), %r11
- jmp *%r11
-1:
- subq $40, %rsp
- movq %xmm0, (%rsp)
- movq %xmm1, 8(%rsp)
- movq %xmm2, 16(%rsp)
- movq %xmm3, 24(%rsp)
- call _glapi_get_dispatch
- movq 24(%rsp), %xmm3
- movq 16(%rsp), %xmm2
- movq 8(%rsp), %xmm1
- movq (%rsp), %xmm0
- addq $40, %rsp
- movq 5800(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(WindowPos4fMESA), .-GL_PREFIX(WindowPos4fMESA)
-
- .p2align 4,,15
- .globl GL_PREFIX(WindowPos4fvMESA)
- .type GL_PREFIX(WindowPos4fvMESA), @function
-GL_PREFIX(WindowPos4fvMESA):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5808(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 5808(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5808(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 5808(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(WindowPos4fvMESA), .-GL_PREFIX(WindowPos4fvMESA)
-
- .p2align 4,,15
- .globl GL_PREFIX(WindowPos4iMESA)
- .type GL_PREFIX(WindowPos4iMESA), @function
-GL_PREFIX(WindowPos4iMESA):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5816(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5816(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5816(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5816(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(WindowPos4iMESA), .-GL_PREFIX(WindowPos4iMESA)
-
- .p2align 4,,15
- .globl GL_PREFIX(WindowPos4ivMESA)
- .type GL_PREFIX(WindowPos4ivMESA), @function
-GL_PREFIX(WindowPos4ivMESA):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5824(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 5824(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5824(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 5824(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(WindowPos4ivMESA), .-GL_PREFIX(WindowPos4ivMESA)
-
- .p2align 4,,15
- .globl GL_PREFIX(WindowPos4sMESA)
- .type GL_PREFIX(WindowPos4sMESA), @function
-GL_PREFIX(WindowPos4sMESA):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5832(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5832(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5832(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5832(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(WindowPos4sMESA), .-GL_PREFIX(WindowPos4sMESA)
-
- .p2align 4,,15
- .globl GL_PREFIX(WindowPos4svMESA)
- .type GL_PREFIX(WindowPos4svMESA), @function
-GL_PREFIX(WindowPos4svMESA):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5840(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 5840(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5840(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 5840(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(WindowPos4svMESA), .-GL_PREFIX(WindowPos4svMESA)
-
- .p2align 4,,15
- .globl GL_PREFIX(_dispatch_stub_731)
- .type GL_PREFIX(_dispatch_stub_731), @function
- HIDDEN(GL_PREFIX(_dispatch_stub_731))
-GL_PREFIX(_dispatch_stub_731):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5848(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- call _x86_64_get_dispatch@PLT
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5848(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5848(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- call _glapi_get_dispatch
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5848(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(_dispatch_stub_731), .-GL_PREFIX(_dispatch_stub_731)
-
- .p2align 4,,15
- .globl GL_PREFIX(_dispatch_stub_732)
- .type GL_PREFIX(_dispatch_stub_732), @function
- HIDDEN(GL_PREFIX(_dispatch_stub_732))
-GL_PREFIX(_dispatch_stub_732):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5856(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- pushq %r9
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %r9
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5856(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5856(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- pushq %r9
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %r9
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5856(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(_dispatch_stub_732), .-GL_PREFIX(_dispatch_stub_732)
-
- .p2align 4,,15
- .globl GL_PREFIX(_dispatch_stub_733)
- .type GL_PREFIX(_dispatch_stub_733), @function
- HIDDEN(GL_PREFIX(_dispatch_stub_733))
-GL_PREFIX(_dispatch_stub_733):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5864(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 5864(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5864(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 5864(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(_dispatch_stub_733), .-GL_PREFIX(_dispatch_stub_733)
-
- .p2align 4,,15
- .globl GL_PREFIX(_dispatch_stub_734)
- .type GL_PREFIX(_dispatch_stub_734), @function
- HIDDEN(GL_PREFIX(_dispatch_stub_734))
-GL_PREFIX(_dispatch_stub_734):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5872(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 5872(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5872(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 5872(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(_dispatch_stub_734), .-GL_PREFIX(_dispatch_stub_734)
-
- .p2align 4,,15
- .globl GL_PREFIX(_dispatch_stub_735)
- .type GL_PREFIX(_dispatch_stub_735), @function
- HIDDEN(GL_PREFIX(_dispatch_stub_735))
-GL_PREFIX(_dispatch_stub_735):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5880(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 5880(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5880(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 5880(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(_dispatch_stub_735), .-GL_PREFIX(_dispatch_stub_735)
-
- .p2align 4,,15
- .globl GL_PREFIX(_dispatch_stub_736)
- .type GL_PREFIX(_dispatch_stub_736), @function
- HIDDEN(GL_PREFIX(_dispatch_stub_736))
-GL_PREFIX(_dispatch_stub_736):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5888(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5888(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5888(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5888(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(_dispatch_stub_736), .-GL_PREFIX(_dispatch_stub_736)
-
- .p2align 4,,15
- .globl GL_PREFIX(_dispatch_stub_737)
- .type GL_PREFIX(_dispatch_stub_737), @function
- HIDDEN(GL_PREFIX(_dispatch_stub_737))
-GL_PREFIX(_dispatch_stub_737):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5896(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 5896(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5896(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 5896(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(_dispatch_stub_737), .-GL_PREFIX(_dispatch_stub_737)
-
- .p2align 4,,15
- .globl GL_PREFIX(_dispatch_stub_738)
- .type GL_PREFIX(_dispatch_stub_738), @function
- HIDDEN(GL_PREFIX(_dispatch_stub_738))
-GL_PREFIX(_dispatch_stub_738):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5904(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 5904(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5904(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 5904(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(_dispatch_stub_738), .-GL_PREFIX(_dispatch_stub_738)
-
- .p2align 4,,15
- .globl GL_PREFIX(_dispatch_stub_739)
- .type GL_PREFIX(_dispatch_stub_739), @function
- HIDDEN(GL_PREFIX(_dispatch_stub_739))
-GL_PREFIX(_dispatch_stub_739):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5912(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 5912(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5912(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 5912(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(_dispatch_stub_739), .-GL_PREFIX(_dispatch_stub_739)
-
- .p2align 4,,15
- .globl GL_PREFIX(AreProgramsResidentNV)
- .type GL_PREFIX(AreProgramsResidentNV), @function
-GL_PREFIX(AreProgramsResidentNV):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5920(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5920(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5920(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5920(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(AreProgramsResidentNV), .-GL_PREFIX(AreProgramsResidentNV)
-
- .p2align 4,,15
- .globl GL_PREFIX(BindProgramNV)
- .type GL_PREFIX(BindProgramNV), @function
-GL_PREFIX(BindProgramNV):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5928(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 5928(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5928(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 5928(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(BindProgramNV), .-GL_PREFIX(BindProgramNV)
-
- .p2align 4,,15
- .globl GL_PREFIX(DeleteProgramsNV)
- .type GL_PREFIX(DeleteProgramsNV), @function
-GL_PREFIX(DeleteProgramsNV):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5936(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 5936(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5936(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 5936(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(DeleteProgramsNV), .-GL_PREFIX(DeleteProgramsNV)
-
- .p2align 4,,15
- .globl GL_PREFIX(ExecuteProgramNV)
- .type GL_PREFIX(ExecuteProgramNV), @function
-GL_PREFIX(ExecuteProgramNV):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5944(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5944(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5944(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5944(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(ExecuteProgramNV), .-GL_PREFIX(ExecuteProgramNV)
-
- .p2align 4,,15
- .globl GL_PREFIX(GenProgramsNV)
- .type GL_PREFIX(GenProgramsNV), @function
-GL_PREFIX(GenProgramsNV):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5952(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 5952(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5952(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 5952(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GenProgramsNV), .-GL_PREFIX(GenProgramsNV)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetProgramParameterdvNV)
- .type GL_PREFIX(GetProgramParameterdvNV), @function
-GL_PREFIX(GetProgramParameterdvNV):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5960(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5960(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5960(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5960(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetProgramParameterdvNV), .-GL_PREFIX(GetProgramParameterdvNV)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetProgramParameterfvNV)
- .type GL_PREFIX(GetProgramParameterfvNV), @function
-GL_PREFIX(GetProgramParameterfvNV):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5968(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5968(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5968(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5968(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetProgramParameterfvNV), .-GL_PREFIX(GetProgramParameterfvNV)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetProgramStringNV)
- .type GL_PREFIX(GetProgramStringNV), @function
-GL_PREFIX(GetProgramStringNV):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5976(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5976(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5976(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5976(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetProgramStringNV), .-GL_PREFIX(GetProgramStringNV)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetProgramivNV)
- .type GL_PREFIX(GetProgramivNV), @function
-GL_PREFIX(GetProgramivNV):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5984(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5984(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5984(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5984(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetProgramivNV), .-GL_PREFIX(GetProgramivNV)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetTrackMatrixivNV)
- .type GL_PREFIX(GetTrackMatrixivNV), @function
-GL_PREFIX(GetTrackMatrixivNV):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 5992(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5992(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 5992(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 5992(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetTrackMatrixivNV), .-GL_PREFIX(GetTrackMatrixivNV)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetVertexAttribPointervNV)
- .type GL_PREFIX(GetVertexAttribPointervNV), @function
-GL_PREFIX(GetVertexAttribPointervNV):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6000(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 6000(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6000(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 6000(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetVertexAttribPointervNV), .-GL_PREFIX(GetVertexAttribPointervNV)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetVertexAttribdvNV)
- .type GL_PREFIX(GetVertexAttribdvNV), @function
-GL_PREFIX(GetVertexAttribdvNV):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6008(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 6008(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6008(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 6008(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetVertexAttribdvNV), .-GL_PREFIX(GetVertexAttribdvNV)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetVertexAttribfvNV)
- .type GL_PREFIX(GetVertexAttribfvNV), @function
-GL_PREFIX(GetVertexAttribfvNV):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6016(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 6016(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6016(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 6016(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetVertexAttribfvNV), .-GL_PREFIX(GetVertexAttribfvNV)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetVertexAttribivNV)
- .type GL_PREFIX(GetVertexAttribivNV), @function
-GL_PREFIX(GetVertexAttribivNV):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6024(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 6024(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6024(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 6024(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetVertexAttribivNV), .-GL_PREFIX(GetVertexAttribivNV)
-
- .p2align 4,,15
- .globl GL_PREFIX(IsProgramNV)
- .type GL_PREFIX(IsProgramNV), @function
-GL_PREFIX(IsProgramNV):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6032(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 6032(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6032(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 6032(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(IsProgramNV), .-GL_PREFIX(IsProgramNV)
-
- .p2align 4,,15
- .globl GL_PREFIX(LoadProgramNV)
- .type GL_PREFIX(LoadProgramNV), @function
-GL_PREFIX(LoadProgramNV):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6040(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 6040(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6040(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 6040(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(LoadProgramNV), .-GL_PREFIX(LoadProgramNV)
-
- .p2align 4,,15
- .globl GL_PREFIX(ProgramParameters4dvNV)
- .type GL_PREFIX(ProgramParameters4dvNV), @function
-GL_PREFIX(ProgramParameters4dvNV):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6048(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 6048(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6048(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 6048(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(ProgramParameters4dvNV), .-GL_PREFIX(ProgramParameters4dvNV)
-
- .p2align 4,,15
- .globl GL_PREFIX(ProgramParameters4fvNV)
- .type GL_PREFIX(ProgramParameters4fvNV), @function
-GL_PREFIX(ProgramParameters4fvNV):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6056(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 6056(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6056(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 6056(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(ProgramParameters4fvNV), .-GL_PREFIX(ProgramParameters4fvNV)
-
- .p2align 4,,15
- .globl GL_PREFIX(RequestResidentProgramsNV)
- .type GL_PREFIX(RequestResidentProgramsNV), @function
-GL_PREFIX(RequestResidentProgramsNV):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6064(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 6064(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6064(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 6064(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(RequestResidentProgramsNV), .-GL_PREFIX(RequestResidentProgramsNV)
-
- .p2align 4,,15
- .globl GL_PREFIX(TrackMatrixNV)
- .type GL_PREFIX(TrackMatrixNV), @function
-GL_PREFIX(TrackMatrixNV):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6072(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 6072(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6072(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 6072(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(TrackMatrixNV), .-GL_PREFIX(TrackMatrixNV)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexAttrib1dNV)
- .type GL_PREFIX(VertexAttrib1dNV), @function
-GL_PREFIX(VertexAttrib1dNV):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6080(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $24, %rsp
- movq %rdi, (%rsp)
- movq %xmm0, 8(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 8(%rsp), %xmm0
- movq (%rsp), %rdi
- addq $24, %rsp
- movq 6080(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6080(%rax), %r11
- jmp *%r11
-1:
- subq $24, %rsp
- movq %rdi, (%rsp)
- movq %xmm0, 8(%rsp)
- call _glapi_get_dispatch
- movq 8(%rsp), %xmm0
- movq (%rsp), %rdi
- addq $24, %rsp
- movq 6080(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexAttrib1dNV), .-GL_PREFIX(VertexAttrib1dNV)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexAttrib1dvNV)
- .type GL_PREFIX(VertexAttrib1dvNV), @function
-GL_PREFIX(VertexAttrib1dvNV):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6088(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 6088(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6088(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 6088(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexAttrib1dvNV), .-GL_PREFIX(VertexAttrib1dvNV)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexAttrib1fNV)
- .type GL_PREFIX(VertexAttrib1fNV), @function
-GL_PREFIX(VertexAttrib1fNV):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6096(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $24, %rsp
- movq %rdi, (%rsp)
- movq %xmm0, 8(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 8(%rsp), %xmm0
- movq (%rsp), %rdi
- addq $24, %rsp
- movq 6096(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6096(%rax), %r11
- jmp *%r11
-1:
- subq $24, %rsp
- movq %rdi, (%rsp)
- movq %xmm0, 8(%rsp)
- call _glapi_get_dispatch
- movq 8(%rsp), %xmm0
- movq (%rsp), %rdi
- addq $24, %rsp
- movq 6096(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexAttrib1fNV), .-GL_PREFIX(VertexAttrib1fNV)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexAttrib1fvNV)
- .type GL_PREFIX(VertexAttrib1fvNV), @function
-GL_PREFIX(VertexAttrib1fvNV):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6104(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 6104(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6104(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 6104(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexAttrib1fvNV), .-GL_PREFIX(VertexAttrib1fvNV)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexAttrib1sNV)
- .type GL_PREFIX(VertexAttrib1sNV), @function
-GL_PREFIX(VertexAttrib1sNV):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6112(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 6112(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6112(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 6112(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexAttrib1sNV), .-GL_PREFIX(VertexAttrib1sNV)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexAttrib1svNV)
- .type GL_PREFIX(VertexAttrib1svNV), @function
-GL_PREFIX(VertexAttrib1svNV):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6120(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 6120(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6120(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 6120(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexAttrib1svNV), .-GL_PREFIX(VertexAttrib1svNV)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexAttrib2dNV)
- .type GL_PREFIX(VertexAttrib2dNV), @function
-GL_PREFIX(VertexAttrib2dNV):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6128(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $24, %rsp
- movq %rdi, (%rsp)
- movq %xmm0, 8(%rsp)
- movq %xmm1, 16(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 16(%rsp), %xmm1
- movq 8(%rsp), %xmm0
- movq (%rsp), %rdi
- addq $24, %rsp
- movq 6128(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6128(%rax), %r11
- jmp *%r11
-1:
- subq $24, %rsp
- movq %rdi, (%rsp)
- movq %xmm0, 8(%rsp)
- movq %xmm1, 16(%rsp)
- call _glapi_get_dispatch
- movq 16(%rsp), %xmm1
- movq 8(%rsp), %xmm0
- movq (%rsp), %rdi
- addq $24, %rsp
- movq 6128(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexAttrib2dNV), .-GL_PREFIX(VertexAttrib2dNV)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexAttrib2dvNV)
- .type GL_PREFIX(VertexAttrib2dvNV), @function
-GL_PREFIX(VertexAttrib2dvNV):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6136(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 6136(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6136(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 6136(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexAttrib2dvNV), .-GL_PREFIX(VertexAttrib2dvNV)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexAttrib2fNV)
- .type GL_PREFIX(VertexAttrib2fNV), @function
-GL_PREFIX(VertexAttrib2fNV):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6144(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $24, %rsp
- movq %rdi, (%rsp)
- movq %xmm0, 8(%rsp)
- movq %xmm1, 16(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 16(%rsp), %xmm1
- movq 8(%rsp), %xmm0
- movq (%rsp), %rdi
- addq $24, %rsp
- movq 6144(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6144(%rax), %r11
- jmp *%r11
-1:
- subq $24, %rsp
- movq %rdi, (%rsp)
- movq %xmm0, 8(%rsp)
- movq %xmm1, 16(%rsp)
- call _glapi_get_dispatch
- movq 16(%rsp), %xmm1
- movq 8(%rsp), %xmm0
- movq (%rsp), %rdi
- addq $24, %rsp
- movq 6144(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexAttrib2fNV), .-GL_PREFIX(VertexAttrib2fNV)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexAttrib2fvNV)
- .type GL_PREFIX(VertexAttrib2fvNV), @function
-GL_PREFIX(VertexAttrib2fvNV):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6152(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 6152(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6152(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 6152(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexAttrib2fvNV), .-GL_PREFIX(VertexAttrib2fvNV)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexAttrib2sNV)
- .type GL_PREFIX(VertexAttrib2sNV), @function
-GL_PREFIX(VertexAttrib2sNV):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6160(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 6160(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6160(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 6160(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexAttrib2sNV), .-GL_PREFIX(VertexAttrib2sNV)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexAttrib2svNV)
- .type GL_PREFIX(VertexAttrib2svNV), @function
-GL_PREFIX(VertexAttrib2svNV):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6168(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 6168(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6168(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 6168(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexAttrib2svNV), .-GL_PREFIX(VertexAttrib2svNV)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexAttrib3dNV)
- .type GL_PREFIX(VertexAttrib3dNV), @function
-GL_PREFIX(VertexAttrib3dNV):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6176(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $40, %rsp
- movq %rdi, (%rsp)
- movq %xmm0, 8(%rsp)
- movq %xmm1, 16(%rsp)
- movq %xmm2, 24(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 24(%rsp), %xmm2
- movq 16(%rsp), %xmm1
- movq 8(%rsp), %xmm0
- movq (%rsp), %rdi
- addq $40, %rsp
- movq 6176(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6176(%rax), %r11
- jmp *%r11
-1:
- subq $40, %rsp
- movq %rdi, (%rsp)
- movq %xmm0, 8(%rsp)
- movq %xmm1, 16(%rsp)
- movq %xmm2, 24(%rsp)
- call _glapi_get_dispatch
- movq 24(%rsp), %xmm2
- movq 16(%rsp), %xmm1
- movq 8(%rsp), %xmm0
- movq (%rsp), %rdi
- addq $40, %rsp
- movq 6176(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexAttrib3dNV), .-GL_PREFIX(VertexAttrib3dNV)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexAttrib3dvNV)
- .type GL_PREFIX(VertexAttrib3dvNV), @function
-GL_PREFIX(VertexAttrib3dvNV):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6184(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 6184(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6184(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 6184(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexAttrib3dvNV), .-GL_PREFIX(VertexAttrib3dvNV)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexAttrib3fNV)
- .type GL_PREFIX(VertexAttrib3fNV), @function
-GL_PREFIX(VertexAttrib3fNV):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6192(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $40, %rsp
- movq %rdi, (%rsp)
- movq %xmm0, 8(%rsp)
- movq %xmm1, 16(%rsp)
- movq %xmm2, 24(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 24(%rsp), %xmm2
- movq 16(%rsp), %xmm1
- movq 8(%rsp), %xmm0
- movq (%rsp), %rdi
- addq $40, %rsp
- movq 6192(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6192(%rax), %r11
- jmp *%r11
-1:
- subq $40, %rsp
- movq %rdi, (%rsp)
- movq %xmm0, 8(%rsp)
- movq %xmm1, 16(%rsp)
- movq %xmm2, 24(%rsp)
- call _glapi_get_dispatch
- movq 24(%rsp), %xmm2
- movq 16(%rsp), %xmm1
- movq 8(%rsp), %xmm0
- movq (%rsp), %rdi
- addq $40, %rsp
- movq 6192(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexAttrib3fNV), .-GL_PREFIX(VertexAttrib3fNV)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexAttrib3fvNV)
- .type GL_PREFIX(VertexAttrib3fvNV), @function
-GL_PREFIX(VertexAttrib3fvNV):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6200(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 6200(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6200(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 6200(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexAttrib3fvNV), .-GL_PREFIX(VertexAttrib3fvNV)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexAttrib3sNV)
- .type GL_PREFIX(VertexAttrib3sNV), @function
-GL_PREFIX(VertexAttrib3sNV):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6208(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 6208(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6208(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 6208(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexAttrib3sNV), .-GL_PREFIX(VertexAttrib3sNV)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexAttrib3svNV)
- .type GL_PREFIX(VertexAttrib3svNV), @function
-GL_PREFIX(VertexAttrib3svNV):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6216(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 6216(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6216(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 6216(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexAttrib3svNV), .-GL_PREFIX(VertexAttrib3svNV)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexAttrib4dNV)
- .type GL_PREFIX(VertexAttrib4dNV), @function
-GL_PREFIX(VertexAttrib4dNV):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6224(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $40, %rsp
- movq %rdi, (%rsp)
- movq %xmm0, 8(%rsp)
- movq %xmm1, 16(%rsp)
- movq %xmm2, 24(%rsp)
- movq %xmm3, 32(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 32(%rsp), %xmm3
- movq 24(%rsp), %xmm2
- movq 16(%rsp), %xmm1
- movq 8(%rsp), %xmm0
- movq (%rsp), %rdi
- addq $40, %rsp
- movq 6224(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6224(%rax), %r11
- jmp *%r11
-1:
- subq $40, %rsp
- movq %rdi, (%rsp)
- movq %xmm0, 8(%rsp)
- movq %xmm1, 16(%rsp)
- movq %xmm2, 24(%rsp)
- movq %xmm3, 32(%rsp)
- call _glapi_get_dispatch
- movq 32(%rsp), %xmm3
- movq 24(%rsp), %xmm2
- movq 16(%rsp), %xmm1
- movq 8(%rsp), %xmm0
- movq (%rsp), %rdi
- addq $40, %rsp
- movq 6224(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexAttrib4dNV), .-GL_PREFIX(VertexAttrib4dNV)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexAttrib4dvNV)
- .type GL_PREFIX(VertexAttrib4dvNV), @function
-GL_PREFIX(VertexAttrib4dvNV):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6232(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 6232(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6232(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 6232(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexAttrib4dvNV), .-GL_PREFIX(VertexAttrib4dvNV)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexAttrib4fNV)
- .type GL_PREFIX(VertexAttrib4fNV), @function
-GL_PREFIX(VertexAttrib4fNV):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6240(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $40, %rsp
- movq %rdi, (%rsp)
- movq %xmm0, 8(%rsp)
- movq %xmm1, 16(%rsp)
- movq %xmm2, 24(%rsp)
- movq %xmm3, 32(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 32(%rsp), %xmm3
- movq 24(%rsp), %xmm2
- movq 16(%rsp), %xmm1
- movq 8(%rsp), %xmm0
- movq (%rsp), %rdi
- addq $40, %rsp
- movq 6240(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6240(%rax), %r11
- jmp *%r11
-1:
- subq $40, %rsp
- movq %rdi, (%rsp)
- movq %xmm0, 8(%rsp)
- movq %xmm1, 16(%rsp)
- movq %xmm2, 24(%rsp)
- movq %xmm3, 32(%rsp)
- call _glapi_get_dispatch
- movq 32(%rsp), %xmm3
- movq 24(%rsp), %xmm2
- movq 16(%rsp), %xmm1
- movq 8(%rsp), %xmm0
- movq (%rsp), %rdi
- addq $40, %rsp
- movq 6240(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexAttrib4fNV), .-GL_PREFIX(VertexAttrib4fNV)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexAttrib4fvNV)
- .type GL_PREFIX(VertexAttrib4fvNV), @function
-GL_PREFIX(VertexAttrib4fvNV):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6248(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 6248(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6248(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 6248(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexAttrib4fvNV), .-GL_PREFIX(VertexAttrib4fvNV)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexAttrib4sNV)
- .type GL_PREFIX(VertexAttrib4sNV), @function
-GL_PREFIX(VertexAttrib4sNV):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6256(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- call _x86_64_get_dispatch@PLT
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 6256(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6256(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- call _glapi_get_dispatch
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 6256(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexAttrib4sNV), .-GL_PREFIX(VertexAttrib4sNV)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexAttrib4svNV)
- .type GL_PREFIX(VertexAttrib4svNV), @function
-GL_PREFIX(VertexAttrib4svNV):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6264(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 6264(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6264(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 6264(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexAttrib4svNV), .-GL_PREFIX(VertexAttrib4svNV)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexAttrib4ubNV)
- .type GL_PREFIX(VertexAttrib4ubNV), @function
-GL_PREFIX(VertexAttrib4ubNV):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6272(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- call _x86_64_get_dispatch@PLT
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 6272(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6272(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- call _glapi_get_dispatch
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 6272(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexAttrib4ubNV), .-GL_PREFIX(VertexAttrib4ubNV)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexAttrib4ubvNV)
- .type GL_PREFIX(VertexAttrib4ubvNV), @function
-GL_PREFIX(VertexAttrib4ubvNV):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6280(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 6280(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6280(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 6280(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexAttrib4ubvNV), .-GL_PREFIX(VertexAttrib4ubvNV)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexAttribPointerNV)
- .type GL_PREFIX(VertexAttribPointerNV), @function
-GL_PREFIX(VertexAttribPointerNV):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6288(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- call _x86_64_get_dispatch@PLT
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 6288(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6288(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- call _glapi_get_dispatch
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 6288(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexAttribPointerNV), .-GL_PREFIX(VertexAttribPointerNV)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexAttribs1dvNV)
- .type GL_PREFIX(VertexAttribs1dvNV), @function
-GL_PREFIX(VertexAttribs1dvNV):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6296(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 6296(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6296(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 6296(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexAttribs1dvNV), .-GL_PREFIX(VertexAttribs1dvNV)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexAttribs1fvNV)
- .type GL_PREFIX(VertexAttribs1fvNV), @function
-GL_PREFIX(VertexAttribs1fvNV):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6304(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 6304(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6304(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 6304(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexAttribs1fvNV), .-GL_PREFIX(VertexAttribs1fvNV)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexAttribs1svNV)
- .type GL_PREFIX(VertexAttribs1svNV), @function
-GL_PREFIX(VertexAttribs1svNV):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6312(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 6312(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6312(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 6312(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexAttribs1svNV), .-GL_PREFIX(VertexAttribs1svNV)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexAttribs2dvNV)
- .type GL_PREFIX(VertexAttribs2dvNV), @function
-GL_PREFIX(VertexAttribs2dvNV):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6320(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 6320(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6320(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 6320(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexAttribs2dvNV), .-GL_PREFIX(VertexAttribs2dvNV)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexAttribs2fvNV)
- .type GL_PREFIX(VertexAttribs2fvNV), @function
-GL_PREFIX(VertexAttribs2fvNV):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6328(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 6328(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6328(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 6328(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexAttribs2fvNV), .-GL_PREFIX(VertexAttribs2fvNV)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexAttribs2svNV)
- .type GL_PREFIX(VertexAttribs2svNV), @function
-GL_PREFIX(VertexAttribs2svNV):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6336(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 6336(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6336(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 6336(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexAttribs2svNV), .-GL_PREFIX(VertexAttribs2svNV)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexAttribs3dvNV)
- .type GL_PREFIX(VertexAttribs3dvNV), @function
-GL_PREFIX(VertexAttribs3dvNV):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6344(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 6344(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6344(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 6344(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexAttribs3dvNV), .-GL_PREFIX(VertexAttribs3dvNV)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexAttribs3fvNV)
- .type GL_PREFIX(VertexAttribs3fvNV), @function
-GL_PREFIX(VertexAttribs3fvNV):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6352(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 6352(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6352(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 6352(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexAttribs3fvNV), .-GL_PREFIX(VertexAttribs3fvNV)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexAttribs3svNV)
- .type GL_PREFIX(VertexAttribs3svNV), @function
-GL_PREFIX(VertexAttribs3svNV):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6360(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 6360(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6360(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 6360(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexAttribs3svNV), .-GL_PREFIX(VertexAttribs3svNV)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexAttribs4dvNV)
- .type GL_PREFIX(VertexAttribs4dvNV), @function
-GL_PREFIX(VertexAttribs4dvNV):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6368(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 6368(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6368(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 6368(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexAttribs4dvNV), .-GL_PREFIX(VertexAttribs4dvNV)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexAttribs4fvNV)
- .type GL_PREFIX(VertexAttribs4fvNV), @function
-GL_PREFIX(VertexAttribs4fvNV):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6376(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 6376(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6376(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 6376(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexAttribs4fvNV), .-GL_PREFIX(VertexAttribs4fvNV)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexAttribs4svNV)
- .type GL_PREFIX(VertexAttribs4svNV), @function
-GL_PREFIX(VertexAttribs4svNV):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6384(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 6384(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6384(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 6384(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexAttribs4svNV), .-GL_PREFIX(VertexAttribs4svNV)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexAttribs4ubvNV)
- .type GL_PREFIX(VertexAttribs4ubvNV), @function
-GL_PREFIX(VertexAttribs4ubvNV):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6392(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 6392(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6392(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 6392(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexAttribs4ubvNV), .-GL_PREFIX(VertexAttribs4ubvNV)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetTexBumpParameterfvATI)
- .type GL_PREFIX(GetTexBumpParameterfvATI), @function
-GL_PREFIX(GetTexBumpParameterfvATI):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6400(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 6400(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6400(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 6400(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetTexBumpParameterfvATI), .-GL_PREFIX(GetTexBumpParameterfvATI)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetTexBumpParameterivATI)
- .type GL_PREFIX(GetTexBumpParameterivATI), @function
-GL_PREFIX(GetTexBumpParameterivATI):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6408(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 6408(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6408(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 6408(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetTexBumpParameterivATI), .-GL_PREFIX(GetTexBumpParameterivATI)
-
- .p2align 4,,15
- .globl GL_PREFIX(TexBumpParameterfvATI)
- .type GL_PREFIX(TexBumpParameterfvATI), @function
-GL_PREFIX(TexBumpParameterfvATI):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6416(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 6416(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6416(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 6416(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(TexBumpParameterfvATI), .-GL_PREFIX(TexBumpParameterfvATI)
-
- .p2align 4,,15
- .globl GL_PREFIX(TexBumpParameterivATI)
- .type GL_PREFIX(TexBumpParameterivATI), @function
-GL_PREFIX(TexBumpParameterivATI):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6424(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 6424(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6424(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 6424(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(TexBumpParameterivATI), .-GL_PREFIX(TexBumpParameterivATI)
-
- .p2align 4,,15
- .globl GL_PREFIX(AlphaFragmentOp1ATI)
- .type GL_PREFIX(AlphaFragmentOp1ATI), @function
-GL_PREFIX(AlphaFragmentOp1ATI):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6432(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- pushq %r9
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %r9
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 6432(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6432(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- pushq %r9
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %r9
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 6432(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(AlphaFragmentOp1ATI), .-GL_PREFIX(AlphaFragmentOp1ATI)
-
- .p2align 4,,15
- .globl GL_PREFIX(AlphaFragmentOp2ATI)
- .type GL_PREFIX(AlphaFragmentOp2ATI), @function
-GL_PREFIX(AlphaFragmentOp2ATI):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6440(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- pushq %r9
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %r9
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 6440(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6440(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- pushq %r9
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %r9
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 6440(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(AlphaFragmentOp2ATI), .-GL_PREFIX(AlphaFragmentOp2ATI)
-
- .p2align 4,,15
- .globl GL_PREFIX(AlphaFragmentOp3ATI)
- .type GL_PREFIX(AlphaFragmentOp3ATI), @function
-GL_PREFIX(AlphaFragmentOp3ATI):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6448(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- pushq %r9
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %r9
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 6448(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6448(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- pushq %r9
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %r9
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 6448(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(AlphaFragmentOp3ATI), .-GL_PREFIX(AlphaFragmentOp3ATI)
-
- .p2align 4,,15
- .globl GL_PREFIX(BeginFragmentShaderATI)
- .type GL_PREFIX(BeginFragmentShaderATI), @function
-GL_PREFIX(BeginFragmentShaderATI):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6456(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- movq 6456(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6456(%rax), %r11
- jmp *%r11
-1:
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- movq 6456(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(BeginFragmentShaderATI), .-GL_PREFIX(BeginFragmentShaderATI)
-
- .p2align 4,,15
- .globl GL_PREFIX(BindFragmentShaderATI)
- .type GL_PREFIX(BindFragmentShaderATI), @function
-GL_PREFIX(BindFragmentShaderATI):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6464(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 6464(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6464(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 6464(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(BindFragmentShaderATI), .-GL_PREFIX(BindFragmentShaderATI)
-
- .p2align 4,,15
- .globl GL_PREFIX(ColorFragmentOp1ATI)
- .type GL_PREFIX(ColorFragmentOp1ATI), @function
-GL_PREFIX(ColorFragmentOp1ATI):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6472(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- pushq %r9
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %r9
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 6472(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6472(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- pushq %r9
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %r9
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 6472(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(ColorFragmentOp1ATI), .-GL_PREFIX(ColorFragmentOp1ATI)
-
- .p2align 4,,15
- .globl GL_PREFIX(ColorFragmentOp2ATI)
- .type GL_PREFIX(ColorFragmentOp2ATI), @function
-GL_PREFIX(ColorFragmentOp2ATI):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6480(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- pushq %r9
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %r9
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 6480(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6480(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- pushq %r9
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %r9
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 6480(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(ColorFragmentOp2ATI), .-GL_PREFIX(ColorFragmentOp2ATI)
-
- .p2align 4,,15
- .globl GL_PREFIX(ColorFragmentOp3ATI)
- .type GL_PREFIX(ColorFragmentOp3ATI), @function
-GL_PREFIX(ColorFragmentOp3ATI):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6488(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- pushq %r9
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %r9
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 6488(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6488(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- pushq %r9
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %r9
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 6488(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(ColorFragmentOp3ATI), .-GL_PREFIX(ColorFragmentOp3ATI)
-
- .p2align 4,,15
- .globl GL_PREFIX(DeleteFragmentShaderATI)
- .type GL_PREFIX(DeleteFragmentShaderATI), @function
-GL_PREFIX(DeleteFragmentShaderATI):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6496(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 6496(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6496(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 6496(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(DeleteFragmentShaderATI), .-GL_PREFIX(DeleteFragmentShaderATI)
-
- .p2align 4,,15
- .globl GL_PREFIX(EndFragmentShaderATI)
- .type GL_PREFIX(EndFragmentShaderATI), @function
-GL_PREFIX(EndFragmentShaderATI):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6504(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- movq 6504(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6504(%rax), %r11
- jmp *%r11
-1:
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- movq 6504(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(EndFragmentShaderATI), .-GL_PREFIX(EndFragmentShaderATI)
-
- .p2align 4,,15
- .globl GL_PREFIX(GenFragmentShadersATI)
- .type GL_PREFIX(GenFragmentShadersATI), @function
-GL_PREFIX(GenFragmentShadersATI):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6512(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 6512(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6512(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 6512(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GenFragmentShadersATI), .-GL_PREFIX(GenFragmentShadersATI)
-
- .p2align 4,,15
- .globl GL_PREFIX(PassTexCoordATI)
- .type GL_PREFIX(PassTexCoordATI), @function
-GL_PREFIX(PassTexCoordATI):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6520(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 6520(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6520(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 6520(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(PassTexCoordATI), .-GL_PREFIX(PassTexCoordATI)
-
- .p2align 4,,15
- .globl GL_PREFIX(SampleMapATI)
- .type GL_PREFIX(SampleMapATI), @function
-GL_PREFIX(SampleMapATI):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6528(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 6528(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6528(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 6528(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(SampleMapATI), .-GL_PREFIX(SampleMapATI)
-
- .p2align 4,,15
- .globl GL_PREFIX(SetFragmentShaderConstantATI)
- .type GL_PREFIX(SetFragmentShaderConstantATI), @function
-GL_PREFIX(SetFragmentShaderConstantATI):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6536(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 6536(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6536(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 6536(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(SetFragmentShaderConstantATI), .-GL_PREFIX(SetFragmentShaderConstantATI)
-
- .p2align 4,,15
- .globl GL_PREFIX(PointParameteriNV)
- .type GL_PREFIX(PointParameteriNV), @function
-GL_PREFIX(PointParameteriNV):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6544(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 6544(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6544(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 6544(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(PointParameteriNV), .-GL_PREFIX(PointParameteriNV)
-
- .p2align 4,,15
- .globl GL_PREFIX(PointParameterivNV)
- .type GL_PREFIX(PointParameterivNV), @function
-GL_PREFIX(PointParameterivNV):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6552(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 6552(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6552(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 6552(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(PointParameterivNV), .-GL_PREFIX(PointParameterivNV)
-
- .p2align 4,,15
- .globl GL_PREFIX(_dispatch_stub_820)
- .type GL_PREFIX(_dispatch_stub_820), @function
- HIDDEN(GL_PREFIX(_dispatch_stub_820))
-GL_PREFIX(_dispatch_stub_820):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6560(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 6560(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6560(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 6560(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(_dispatch_stub_820), .-GL_PREFIX(_dispatch_stub_820)
-
- .p2align 4,,15
- .globl GL_PREFIX(_dispatch_stub_821)
- .type GL_PREFIX(_dispatch_stub_821), @function
- HIDDEN(GL_PREFIX(_dispatch_stub_821))
-GL_PREFIX(_dispatch_stub_821):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6568(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 6568(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6568(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 6568(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(_dispatch_stub_821), .-GL_PREFIX(_dispatch_stub_821)
-
- .p2align 4,,15
- .globl GL_PREFIX(_dispatch_stub_822)
- .type GL_PREFIX(_dispatch_stub_822), @function
- HIDDEN(GL_PREFIX(_dispatch_stub_822))
-GL_PREFIX(_dispatch_stub_822):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6576(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 6576(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6576(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 6576(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(_dispatch_stub_822), .-GL_PREFIX(_dispatch_stub_822)
-
- .p2align 4,,15
- .globl GL_PREFIX(_dispatch_stub_823)
- .type GL_PREFIX(_dispatch_stub_823), @function
- HIDDEN(GL_PREFIX(_dispatch_stub_823))
-GL_PREFIX(_dispatch_stub_823):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6584(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 6584(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6584(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 6584(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(_dispatch_stub_823), .-GL_PREFIX(_dispatch_stub_823)
-
- .p2align 4,,15
- .globl GL_PREFIX(_dispatch_stub_824)
- .type GL_PREFIX(_dispatch_stub_824), @function
- HIDDEN(GL_PREFIX(_dispatch_stub_824))
-GL_PREFIX(_dispatch_stub_824):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6592(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 6592(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6592(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 6592(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(_dispatch_stub_824), .-GL_PREFIX(_dispatch_stub_824)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetProgramNamedParameterdvNV)
- .type GL_PREFIX(GetProgramNamedParameterdvNV), @function
-GL_PREFIX(GetProgramNamedParameterdvNV):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6600(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 6600(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6600(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 6600(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetProgramNamedParameterdvNV), .-GL_PREFIX(GetProgramNamedParameterdvNV)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetProgramNamedParameterfvNV)
- .type GL_PREFIX(GetProgramNamedParameterfvNV), @function
-GL_PREFIX(GetProgramNamedParameterfvNV):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6608(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 6608(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6608(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 6608(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetProgramNamedParameterfvNV), .-GL_PREFIX(GetProgramNamedParameterfvNV)
-
- .p2align 4,,15
- .globl GL_PREFIX(ProgramNamedParameter4dNV)
- .type GL_PREFIX(ProgramNamedParameter4dNV), @function
-GL_PREFIX(ProgramNamedParameter4dNV):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6616(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $56, %rsp
- movq %rdi, (%rsp)
- movq %rsi, 8(%rsp)
- movq %rdx, 16(%rsp)
- movq %xmm0, 24(%rsp)
- movq %xmm1, 32(%rsp)
- movq %xmm2, 40(%rsp)
- movq %xmm3, 48(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 48(%rsp), %xmm3
- movq 40(%rsp), %xmm2
- movq 32(%rsp), %xmm1
- movq 24(%rsp), %xmm0
- movq 16(%rsp), %rdx
- movq 8(%rsp), %rsi
- movq (%rsp), %rdi
- addq $56, %rsp
- movq 6616(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6616(%rax), %r11
- jmp *%r11
-1:
- subq $56, %rsp
- movq %rdi, (%rsp)
- movq %rsi, 8(%rsp)
- movq %rdx, 16(%rsp)
- movq %xmm0, 24(%rsp)
- movq %xmm1, 32(%rsp)
- movq %xmm2, 40(%rsp)
- movq %xmm3, 48(%rsp)
- call _glapi_get_dispatch
- movq 48(%rsp), %xmm3
- movq 40(%rsp), %xmm2
- movq 32(%rsp), %xmm1
- movq 24(%rsp), %xmm0
- movq 16(%rsp), %rdx
- movq 8(%rsp), %rsi
- movq (%rsp), %rdi
- addq $56, %rsp
- movq 6616(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(ProgramNamedParameter4dNV), .-GL_PREFIX(ProgramNamedParameter4dNV)
-
- .p2align 4,,15
- .globl GL_PREFIX(ProgramNamedParameter4dvNV)
- .type GL_PREFIX(ProgramNamedParameter4dvNV), @function
-GL_PREFIX(ProgramNamedParameter4dvNV):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6624(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 6624(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6624(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 6624(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(ProgramNamedParameter4dvNV), .-GL_PREFIX(ProgramNamedParameter4dvNV)
-
- .p2align 4,,15
- .globl GL_PREFIX(ProgramNamedParameter4fNV)
- .type GL_PREFIX(ProgramNamedParameter4fNV), @function
-GL_PREFIX(ProgramNamedParameter4fNV):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6632(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- subq $56, %rsp
- movq %rdi, (%rsp)
- movq %rsi, 8(%rsp)
- movq %rdx, 16(%rsp)
- movq %xmm0, 24(%rsp)
- movq %xmm1, 32(%rsp)
- movq %xmm2, 40(%rsp)
- movq %xmm3, 48(%rsp)
- call _x86_64_get_dispatch@PLT
- movq 48(%rsp), %xmm3
- movq 40(%rsp), %xmm2
- movq 32(%rsp), %xmm1
- movq 24(%rsp), %xmm0
- movq 16(%rsp), %rdx
- movq 8(%rsp), %rsi
- movq (%rsp), %rdi
- addq $56, %rsp
- movq 6632(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6632(%rax), %r11
- jmp *%r11
-1:
- subq $56, %rsp
- movq %rdi, (%rsp)
- movq %rsi, 8(%rsp)
- movq %rdx, 16(%rsp)
- movq %xmm0, 24(%rsp)
- movq %xmm1, 32(%rsp)
- movq %xmm2, 40(%rsp)
- movq %xmm3, 48(%rsp)
- call _glapi_get_dispatch
- movq 48(%rsp), %xmm3
- movq 40(%rsp), %xmm2
- movq 32(%rsp), %xmm1
- movq 24(%rsp), %xmm0
- movq 16(%rsp), %rdx
- movq 8(%rsp), %rsi
- movq (%rsp), %rdi
- addq $56, %rsp
- movq 6632(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(ProgramNamedParameter4fNV), .-GL_PREFIX(ProgramNamedParameter4fNV)
-
- .p2align 4,,15
- .globl GL_PREFIX(ProgramNamedParameter4fvNV)
- .type GL_PREFIX(ProgramNamedParameter4fvNV), @function
-GL_PREFIX(ProgramNamedParameter4fvNV):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6640(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 6640(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6640(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 6640(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(ProgramNamedParameter4fvNV), .-GL_PREFIX(ProgramNamedParameter4fvNV)
-
- .p2align 4,,15
- .globl GL_PREFIX(PrimitiveRestartIndexNV)
- .type GL_PREFIX(PrimitiveRestartIndexNV), @function
-GL_PREFIX(PrimitiveRestartIndexNV):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6648(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 6648(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6648(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 6648(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(PrimitiveRestartIndexNV), .-GL_PREFIX(PrimitiveRestartIndexNV)
-
- .p2align 4,,15
- .globl GL_PREFIX(PrimitiveRestartNV)
- .type GL_PREFIX(PrimitiveRestartNV), @function
-GL_PREFIX(PrimitiveRestartNV):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6656(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- movq 6656(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6656(%rax), %r11
- jmp *%r11
-1:
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- movq 6656(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(PrimitiveRestartNV), .-GL_PREFIX(PrimitiveRestartNV)
-
- .p2align 4,,15
- .globl GL_PREFIX(_dispatch_stub_833)
- .type GL_PREFIX(_dispatch_stub_833), @function
- HIDDEN(GL_PREFIX(_dispatch_stub_833))
-GL_PREFIX(_dispatch_stub_833):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6664(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 6664(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6664(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 6664(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(_dispatch_stub_833), .-GL_PREFIX(_dispatch_stub_833)
-
- .p2align 4,,15
- .globl GL_PREFIX(_dispatch_stub_834)
- .type GL_PREFIX(_dispatch_stub_834), @function
- HIDDEN(GL_PREFIX(_dispatch_stub_834))
-GL_PREFIX(_dispatch_stub_834):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6672(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 6672(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6672(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 6672(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(_dispatch_stub_834), .-GL_PREFIX(_dispatch_stub_834)
-
- .p2align 4,,15
- .globl GL_PREFIX(BindFramebufferEXT)
- .type GL_PREFIX(BindFramebufferEXT), @function
-GL_PREFIX(BindFramebufferEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6680(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 6680(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6680(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 6680(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(BindFramebufferEXT), .-GL_PREFIX(BindFramebufferEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(BindRenderbufferEXT)
- .type GL_PREFIX(BindRenderbufferEXT), @function
-GL_PREFIX(BindRenderbufferEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6688(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 6688(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6688(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 6688(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(BindRenderbufferEXT), .-GL_PREFIX(BindRenderbufferEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(CheckFramebufferStatusEXT)
- .type GL_PREFIX(CheckFramebufferStatusEXT), @function
-GL_PREFIX(CheckFramebufferStatusEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6696(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 6696(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6696(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 6696(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(CheckFramebufferStatusEXT), .-GL_PREFIX(CheckFramebufferStatusEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(DeleteFramebuffersEXT)
- .type GL_PREFIX(DeleteFramebuffersEXT), @function
-GL_PREFIX(DeleteFramebuffersEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6704(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 6704(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6704(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 6704(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(DeleteFramebuffersEXT), .-GL_PREFIX(DeleteFramebuffersEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(DeleteRenderbuffersEXT)
- .type GL_PREFIX(DeleteRenderbuffersEXT), @function
-GL_PREFIX(DeleteRenderbuffersEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6712(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 6712(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6712(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 6712(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(DeleteRenderbuffersEXT), .-GL_PREFIX(DeleteRenderbuffersEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(FramebufferRenderbufferEXT)
- .type GL_PREFIX(FramebufferRenderbufferEXT), @function
-GL_PREFIX(FramebufferRenderbufferEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6720(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 6720(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6720(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 6720(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(FramebufferRenderbufferEXT), .-GL_PREFIX(FramebufferRenderbufferEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(FramebufferTexture1DEXT)
- .type GL_PREFIX(FramebufferTexture1DEXT), @function
-GL_PREFIX(FramebufferTexture1DEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6728(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- call _x86_64_get_dispatch@PLT
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 6728(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6728(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- call _glapi_get_dispatch
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 6728(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(FramebufferTexture1DEXT), .-GL_PREFIX(FramebufferTexture1DEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(FramebufferTexture2DEXT)
- .type GL_PREFIX(FramebufferTexture2DEXT), @function
-GL_PREFIX(FramebufferTexture2DEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6736(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- call _x86_64_get_dispatch@PLT
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 6736(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6736(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- call _glapi_get_dispatch
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 6736(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(FramebufferTexture2DEXT), .-GL_PREFIX(FramebufferTexture2DEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(FramebufferTexture3DEXT)
- .type GL_PREFIX(FramebufferTexture3DEXT), @function
-GL_PREFIX(FramebufferTexture3DEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6744(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- pushq %r9
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %r9
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 6744(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6744(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- pushq %r9
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %r9
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 6744(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(FramebufferTexture3DEXT), .-GL_PREFIX(FramebufferTexture3DEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(GenFramebuffersEXT)
- .type GL_PREFIX(GenFramebuffersEXT), @function
-GL_PREFIX(GenFramebuffersEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6752(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 6752(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6752(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 6752(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GenFramebuffersEXT), .-GL_PREFIX(GenFramebuffersEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(GenRenderbuffersEXT)
- .type GL_PREFIX(GenRenderbuffersEXT), @function
-GL_PREFIX(GenRenderbuffersEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6760(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 6760(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6760(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 6760(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GenRenderbuffersEXT), .-GL_PREFIX(GenRenderbuffersEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(GenerateMipmapEXT)
- .type GL_PREFIX(GenerateMipmapEXT), @function
-GL_PREFIX(GenerateMipmapEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6768(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 6768(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6768(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 6768(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GenerateMipmapEXT), .-GL_PREFIX(GenerateMipmapEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetFramebufferAttachmentParameterivEXT)
- .type GL_PREFIX(GetFramebufferAttachmentParameterivEXT), @function
-GL_PREFIX(GetFramebufferAttachmentParameterivEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6776(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 6776(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6776(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 6776(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetFramebufferAttachmentParameterivEXT), .-GL_PREFIX(GetFramebufferAttachmentParameterivEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetRenderbufferParameterivEXT)
- .type GL_PREFIX(GetRenderbufferParameterivEXT), @function
-GL_PREFIX(GetRenderbufferParameterivEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6784(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 6784(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6784(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 6784(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetRenderbufferParameterivEXT), .-GL_PREFIX(GetRenderbufferParameterivEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(IsFramebufferEXT)
- .type GL_PREFIX(IsFramebufferEXT), @function
-GL_PREFIX(IsFramebufferEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6792(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 6792(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6792(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 6792(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(IsFramebufferEXT), .-GL_PREFIX(IsFramebufferEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(IsRenderbufferEXT)
- .type GL_PREFIX(IsRenderbufferEXT), @function
-GL_PREFIX(IsRenderbufferEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6800(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 6800(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6800(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 6800(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(IsRenderbufferEXT), .-GL_PREFIX(IsRenderbufferEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(RenderbufferStorageEXT)
- .type GL_PREFIX(RenderbufferStorageEXT), @function
-GL_PREFIX(RenderbufferStorageEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6808(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 6808(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6808(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 6808(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(RenderbufferStorageEXT), .-GL_PREFIX(RenderbufferStorageEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(_dispatch_stub_852)
- .type GL_PREFIX(_dispatch_stub_852), @function
- HIDDEN(GL_PREFIX(_dispatch_stub_852))
-GL_PREFIX(_dispatch_stub_852):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6816(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- pushq %r9
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %r9
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 6816(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6816(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- pushq %r9
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %r9
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 6816(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(_dispatch_stub_852), .-GL_PREFIX(_dispatch_stub_852)
-
- .p2align 4,,15
- .globl GL_PREFIX(_dispatch_stub_853)
- .type GL_PREFIX(_dispatch_stub_853), @function
- HIDDEN(GL_PREFIX(_dispatch_stub_853))
-GL_PREFIX(_dispatch_stub_853):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6824(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 6824(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6824(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 6824(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(_dispatch_stub_853), .-GL_PREFIX(_dispatch_stub_853)
-
- .p2align 4,,15
- .globl GL_PREFIX(_dispatch_stub_854)
- .type GL_PREFIX(_dispatch_stub_854), @function
- HIDDEN(GL_PREFIX(_dispatch_stub_854))
-GL_PREFIX(_dispatch_stub_854):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6832(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 6832(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6832(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 6832(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(_dispatch_stub_854), .-GL_PREFIX(_dispatch_stub_854)
-
- .p2align 4,,15
- .globl GL_PREFIX(BindFragDataLocationEXT)
- .type GL_PREFIX(BindFragDataLocationEXT), @function
-GL_PREFIX(BindFragDataLocationEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6840(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 6840(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6840(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 6840(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(BindFragDataLocationEXT), .-GL_PREFIX(BindFragDataLocationEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetFragDataLocationEXT)
- .type GL_PREFIX(GetFragDataLocationEXT), @function
-GL_PREFIX(GetFragDataLocationEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6848(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 6848(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6848(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 6848(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetFragDataLocationEXT), .-GL_PREFIX(GetFragDataLocationEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetUniformuivEXT)
- .type GL_PREFIX(GetUniformuivEXT), @function
-GL_PREFIX(GetUniformuivEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6856(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 6856(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6856(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 6856(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetUniformuivEXT), .-GL_PREFIX(GetUniformuivEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetVertexAttribIivEXT)
- .type GL_PREFIX(GetVertexAttribIivEXT), @function
-GL_PREFIX(GetVertexAttribIivEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6864(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 6864(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6864(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 6864(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetVertexAttribIivEXT), .-GL_PREFIX(GetVertexAttribIivEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetVertexAttribIuivEXT)
- .type GL_PREFIX(GetVertexAttribIuivEXT), @function
-GL_PREFIX(GetVertexAttribIuivEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6872(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 6872(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6872(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 6872(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetVertexAttribIuivEXT), .-GL_PREFIX(GetVertexAttribIuivEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(Uniform1uiEXT)
- .type GL_PREFIX(Uniform1uiEXT), @function
-GL_PREFIX(Uniform1uiEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6880(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 6880(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6880(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 6880(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Uniform1uiEXT), .-GL_PREFIX(Uniform1uiEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(Uniform1uivEXT)
- .type GL_PREFIX(Uniform1uivEXT), @function
-GL_PREFIX(Uniform1uivEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6888(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 6888(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6888(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 6888(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Uniform1uivEXT), .-GL_PREFIX(Uniform1uivEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(Uniform2uiEXT)
- .type GL_PREFIX(Uniform2uiEXT), @function
-GL_PREFIX(Uniform2uiEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6896(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 6896(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6896(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 6896(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Uniform2uiEXT), .-GL_PREFIX(Uniform2uiEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(Uniform2uivEXT)
- .type GL_PREFIX(Uniform2uivEXT), @function
-GL_PREFIX(Uniform2uivEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6904(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 6904(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6904(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 6904(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Uniform2uivEXT), .-GL_PREFIX(Uniform2uivEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(Uniform3uiEXT)
- .type GL_PREFIX(Uniform3uiEXT), @function
-GL_PREFIX(Uniform3uiEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6912(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 6912(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6912(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 6912(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Uniform3uiEXT), .-GL_PREFIX(Uniform3uiEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(Uniform3uivEXT)
- .type GL_PREFIX(Uniform3uivEXT), @function
-GL_PREFIX(Uniform3uivEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6920(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 6920(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6920(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 6920(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Uniform3uivEXT), .-GL_PREFIX(Uniform3uivEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(Uniform4uiEXT)
- .type GL_PREFIX(Uniform4uiEXT), @function
-GL_PREFIX(Uniform4uiEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6928(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- call _x86_64_get_dispatch@PLT
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 6928(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6928(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- call _glapi_get_dispatch
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 6928(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Uniform4uiEXT), .-GL_PREFIX(Uniform4uiEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(Uniform4uivEXT)
- .type GL_PREFIX(Uniform4uivEXT), @function
-GL_PREFIX(Uniform4uivEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6936(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 6936(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6936(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 6936(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(Uniform4uivEXT), .-GL_PREFIX(Uniform4uivEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexAttribI1iEXT)
- .type GL_PREFIX(VertexAttribI1iEXT), @function
-GL_PREFIX(VertexAttribI1iEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6944(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 6944(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6944(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 6944(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexAttribI1iEXT), .-GL_PREFIX(VertexAttribI1iEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexAttribI1ivEXT)
- .type GL_PREFIX(VertexAttribI1ivEXT), @function
-GL_PREFIX(VertexAttribI1ivEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6952(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 6952(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6952(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 6952(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexAttribI1ivEXT), .-GL_PREFIX(VertexAttribI1ivEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexAttribI1uiEXT)
- .type GL_PREFIX(VertexAttribI1uiEXT), @function
-GL_PREFIX(VertexAttribI1uiEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6960(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 6960(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6960(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 6960(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexAttribI1uiEXT), .-GL_PREFIX(VertexAttribI1uiEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexAttribI1uivEXT)
- .type GL_PREFIX(VertexAttribI1uivEXT), @function
-GL_PREFIX(VertexAttribI1uivEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6968(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 6968(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6968(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 6968(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexAttribI1uivEXT), .-GL_PREFIX(VertexAttribI1uivEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexAttribI2iEXT)
- .type GL_PREFIX(VertexAttribI2iEXT), @function
-GL_PREFIX(VertexAttribI2iEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6976(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 6976(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6976(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 6976(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexAttribI2iEXT), .-GL_PREFIX(VertexAttribI2iEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexAttribI2ivEXT)
- .type GL_PREFIX(VertexAttribI2ivEXT), @function
-GL_PREFIX(VertexAttribI2ivEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6984(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 6984(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6984(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 6984(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexAttribI2ivEXT), .-GL_PREFIX(VertexAttribI2ivEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexAttribI2uiEXT)
- .type GL_PREFIX(VertexAttribI2uiEXT), @function
-GL_PREFIX(VertexAttribI2uiEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 6992(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 6992(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 6992(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 6992(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexAttribI2uiEXT), .-GL_PREFIX(VertexAttribI2uiEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexAttribI2uivEXT)
- .type GL_PREFIX(VertexAttribI2uivEXT), @function
-GL_PREFIX(VertexAttribI2uivEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 7000(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 7000(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 7000(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 7000(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexAttribI2uivEXT), .-GL_PREFIX(VertexAttribI2uivEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexAttribI3iEXT)
- .type GL_PREFIX(VertexAttribI3iEXT), @function
-GL_PREFIX(VertexAttribI3iEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 7008(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 7008(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 7008(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 7008(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexAttribI3iEXT), .-GL_PREFIX(VertexAttribI3iEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexAttribI3ivEXT)
- .type GL_PREFIX(VertexAttribI3ivEXT), @function
-GL_PREFIX(VertexAttribI3ivEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 7016(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 7016(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 7016(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 7016(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexAttribI3ivEXT), .-GL_PREFIX(VertexAttribI3ivEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexAttribI3uiEXT)
- .type GL_PREFIX(VertexAttribI3uiEXT), @function
-GL_PREFIX(VertexAttribI3uiEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 7024(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 7024(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 7024(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 7024(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexAttribI3uiEXT), .-GL_PREFIX(VertexAttribI3uiEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexAttribI3uivEXT)
- .type GL_PREFIX(VertexAttribI3uivEXT), @function
-GL_PREFIX(VertexAttribI3uivEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 7032(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 7032(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 7032(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 7032(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexAttribI3uivEXT), .-GL_PREFIX(VertexAttribI3uivEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexAttribI4bvEXT)
- .type GL_PREFIX(VertexAttribI4bvEXT), @function
-GL_PREFIX(VertexAttribI4bvEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 7040(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 7040(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 7040(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 7040(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexAttribI4bvEXT), .-GL_PREFIX(VertexAttribI4bvEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexAttribI4iEXT)
- .type GL_PREFIX(VertexAttribI4iEXT), @function
-GL_PREFIX(VertexAttribI4iEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 7048(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- call _x86_64_get_dispatch@PLT
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 7048(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 7048(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- call _glapi_get_dispatch
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 7048(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexAttribI4iEXT), .-GL_PREFIX(VertexAttribI4iEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexAttribI4ivEXT)
- .type GL_PREFIX(VertexAttribI4ivEXT), @function
-GL_PREFIX(VertexAttribI4ivEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 7056(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 7056(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 7056(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 7056(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexAttribI4ivEXT), .-GL_PREFIX(VertexAttribI4ivEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexAttribI4svEXT)
- .type GL_PREFIX(VertexAttribI4svEXT), @function
-GL_PREFIX(VertexAttribI4svEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 7064(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 7064(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 7064(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 7064(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexAttribI4svEXT), .-GL_PREFIX(VertexAttribI4svEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexAttribI4ubvEXT)
- .type GL_PREFIX(VertexAttribI4ubvEXT), @function
-GL_PREFIX(VertexAttribI4ubvEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 7072(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 7072(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 7072(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 7072(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexAttribI4ubvEXT), .-GL_PREFIX(VertexAttribI4ubvEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexAttribI4uiEXT)
- .type GL_PREFIX(VertexAttribI4uiEXT), @function
-GL_PREFIX(VertexAttribI4uiEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 7080(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- call _x86_64_get_dispatch@PLT
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 7080(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 7080(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- call _glapi_get_dispatch
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 7080(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexAttribI4uiEXT), .-GL_PREFIX(VertexAttribI4uiEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexAttribI4uivEXT)
- .type GL_PREFIX(VertexAttribI4uivEXT), @function
-GL_PREFIX(VertexAttribI4uivEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 7088(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 7088(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 7088(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 7088(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexAttribI4uivEXT), .-GL_PREFIX(VertexAttribI4uivEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexAttribI4usvEXT)
- .type GL_PREFIX(VertexAttribI4usvEXT), @function
-GL_PREFIX(VertexAttribI4usvEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 7096(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 7096(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 7096(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 7096(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexAttribI4usvEXT), .-GL_PREFIX(VertexAttribI4usvEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(VertexAttribIPointerEXT)
- .type GL_PREFIX(VertexAttribIPointerEXT), @function
-GL_PREFIX(VertexAttribIPointerEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 7104(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- call _x86_64_get_dispatch@PLT
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 7104(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 7104(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- call _glapi_get_dispatch
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 7104(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(VertexAttribIPointerEXT), .-GL_PREFIX(VertexAttribIPointerEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(FramebufferTextureLayerEXT)
- .type GL_PREFIX(FramebufferTextureLayerEXT), @function
-GL_PREFIX(FramebufferTextureLayerEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 7112(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- call _x86_64_get_dispatch@PLT
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 7112(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 7112(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- call _glapi_get_dispatch
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 7112(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(FramebufferTextureLayerEXT), .-GL_PREFIX(FramebufferTextureLayerEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(ColorMaskIndexedEXT)
- .type GL_PREFIX(ColorMaskIndexedEXT), @function
-GL_PREFIX(ColorMaskIndexedEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 7120(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- call _x86_64_get_dispatch@PLT
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 7120(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 7120(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- call _glapi_get_dispatch
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 7120(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(ColorMaskIndexedEXT), .-GL_PREFIX(ColorMaskIndexedEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(DisableIndexedEXT)
- .type GL_PREFIX(DisableIndexedEXT), @function
-GL_PREFIX(DisableIndexedEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 7128(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 7128(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 7128(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 7128(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(DisableIndexedEXT), .-GL_PREFIX(DisableIndexedEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(EnableIndexedEXT)
- .type GL_PREFIX(EnableIndexedEXT), @function
-GL_PREFIX(EnableIndexedEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 7136(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 7136(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 7136(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 7136(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(EnableIndexedEXT), .-GL_PREFIX(EnableIndexedEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetBooleanIndexedvEXT)
- .type GL_PREFIX(GetBooleanIndexedvEXT), @function
-GL_PREFIX(GetBooleanIndexedvEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 7144(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 7144(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 7144(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 7144(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetBooleanIndexedvEXT), .-GL_PREFIX(GetBooleanIndexedvEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetIntegerIndexedvEXT)
- .type GL_PREFIX(GetIntegerIndexedvEXT), @function
-GL_PREFIX(GetIntegerIndexedvEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 7152(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 7152(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 7152(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 7152(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetIntegerIndexedvEXT), .-GL_PREFIX(GetIntegerIndexedvEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(IsEnabledIndexedEXT)
- .type GL_PREFIX(IsEnabledIndexedEXT), @function
-GL_PREFIX(IsEnabledIndexedEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 7160(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 7160(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 7160(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 7160(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(IsEnabledIndexedEXT), .-GL_PREFIX(IsEnabledIndexedEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(ClearColorIiEXT)
- .type GL_PREFIX(ClearColorIiEXT), @function
-GL_PREFIX(ClearColorIiEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 7168(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 7168(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 7168(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 7168(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(ClearColorIiEXT), .-GL_PREFIX(ClearColorIiEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(ClearColorIuiEXT)
- .type GL_PREFIX(ClearColorIuiEXT), @function
-GL_PREFIX(ClearColorIuiEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 7176(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 7176(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 7176(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 7176(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(ClearColorIuiEXT), .-GL_PREFIX(ClearColorIuiEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetTexParameterIivEXT)
- .type GL_PREFIX(GetTexParameterIivEXT), @function
-GL_PREFIX(GetTexParameterIivEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 7184(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 7184(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 7184(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 7184(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetTexParameterIivEXT), .-GL_PREFIX(GetTexParameterIivEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetTexParameterIuivEXT)
- .type GL_PREFIX(GetTexParameterIuivEXT), @function
-GL_PREFIX(GetTexParameterIuivEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 7192(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 7192(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 7192(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 7192(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetTexParameterIuivEXT), .-GL_PREFIX(GetTexParameterIuivEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(TexParameterIivEXT)
- .type GL_PREFIX(TexParameterIivEXT), @function
-GL_PREFIX(TexParameterIivEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 7200(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 7200(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 7200(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 7200(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(TexParameterIivEXT), .-GL_PREFIX(TexParameterIivEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(TexParameterIuivEXT)
- .type GL_PREFIX(TexParameterIuivEXT), @function
-GL_PREFIX(TexParameterIuivEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 7208(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 7208(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 7208(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 7208(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(TexParameterIuivEXT), .-GL_PREFIX(TexParameterIuivEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(BeginConditionalRenderNV)
- .type GL_PREFIX(BeginConditionalRenderNV), @function
-GL_PREFIX(BeginConditionalRenderNV):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 7216(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 7216(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 7216(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 7216(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(BeginConditionalRenderNV), .-GL_PREFIX(BeginConditionalRenderNV)
-
- .p2align 4,,15
- .globl GL_PREFIX(EndConditionalRenderNV)
- .type GL_PREFIX(EndConditionalRenderNV), @function
-GL_PREFIX(EndConditionalRenderNV):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 7224(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- movq 7224(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 7224(%rax), %r11
- jmp *%r11
-1:
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- movq 7224(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(EndConditionalRenderNV), .-GL_PREFIX(EndConditionalRenderNV)
-
- .p2align 4,,15
- .globl GL_PREFIX(BeginTransformFeedbackEXT)
- .type GL_PREFIX(BeginTransformFeedbackEXT), @function
-GL_PREFIX(BeginTransformFeedbackEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 7232(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 7232(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 7232(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 7232(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(BeginTransformFeedbackEXT), .-GL_PREFIX(BeginTransformFeedbackEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(BindBufferBaseEXT)
- .type GL_PREFIX(BindBufferBaseEXT), @function
-GL_PREFIX(BindBufferBaseEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 7240(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 7240(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 7240(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 7240(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(BindBufferBaseEXT), .-GL_PREFIX(BindBufferBaseEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(BindBufferOffsetEXT)
- .type GL_PREFIX(BindBufferOffsetEXT), @function
-GL_PREFIX(BindBufferOffsetEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 7248(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 7248(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 7248(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 7248(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(BindBufferOffsetEXT), .-GL_PREFIX(BindBufferOffsetEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(BindBufferRangeEXT)
- .type GL_PREFIX(BindBufferRangeEXT), @function
-GL_PREFIX(BindBufferRangeEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 7256(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- call _x86_64_get_dispatch@PLT
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 7256(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 7256(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- call _glapi_get_dispatch
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 7256(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(BindBufferRangeEXT), .-GL_PREFIX(BindBufferRangeEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(EndTransformFeedbackEXT)
- .type GL_PREFIX(EndTransformFeedbackEXT), @function
-GL_PREFIX(EndTransformFeedbackEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 7264(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- movq 7264(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 7264(%rax), %r11
- jmp *%r11
-1:
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- movq 7264(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(EndTransformFeedbackEXT), .-GL_PREFIX(EndTransformFeedbackEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetTransformFeedbackVaryingEXT)
- .type GL_PREFIX(GetTransformFeedbackVaryingEXT), @function
-GL_PREFIX(GetTransformFeedbackVaryingEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 7272(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- pushq %r9
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %r9
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 7272(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 7272(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %r8
- pushq %r9
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %r9
- popq %r8
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 7272(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetTransformFeedbackVaryingEXT), .-GL_PREFIX(GetTransformFeedbackVaryingEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(TransformFeedbackVaryingsEXT)
- .type GL_PREFIX(TransformFeedbackVaryingsEXT), @function
-GL_PREFIX(TransformFeedbackVaryingsEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 7280(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 7280(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 7280(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 7280(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(TransformFeedbackVaryingsEXT), .-GL_PREFIX(TransformFeedbackVaryingsEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(ProvokingVertexEXT)
- .type GL_PREFIX(ProvokingVertexEXT), @function
-GL_PREFIX(ProvokingVertexEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 7288(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 7288(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 7288(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 7288(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(ProvokingVertexEXT), .-GL_PREFIX(ProvokingVertexEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(_dispatch_stub_912)
- .type GL_PREFIX(_dispatch_stub_912), @function
- HIDDEN(GL_PREFIX(_dispatch_stub_912))
-GL_PREFIX(_dispatch_stub_912):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 7296(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 7296(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 7296(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 7296(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(_dispatch_stub_912), .-GL_PREFIX(_dispatch_stub_912)
-
- .p2align 4,,15
- .globl GL_PREFIX(_dispatch_stub_913)
- .type GL_PREFIX(_dispatch_stub_913), @function
- HIDDEN(GL_PREFIX(_dispatch_stub_913))
-GL_PREFIX(_dispatch_stub_913):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 7304(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 7304(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 7304(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 7304(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(_dispatch_stub_913), .-GL_PREFIX(_dispatch_stub_913)
-
- .p2align 4,,15
- .globl GL_PREFIX(GetObjectParameterivAPPLE)
- .type GL_PREFIX(GetObjectParameterivAPPLE), @function
-GL_PREFIX(GetObjectParameterivAPPLE):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 7312(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 7312(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 7312(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 7312(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(GetObjectParameterivAPPLE), .-GL_PREFIX(GetObjectParameterivAPPLE)
-
- .p2align 4,,15
- .globl GL_PREFIX(ObjectPurgeableAPPLE)
- .type GL_PREFIX(ObjectPurgeableAPPLE), @function
-GL_PREFIX(ObjectPurgeableAPPLE):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 7320(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 7320(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 7320(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 7320(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(ObjectPurgeableAPPLE), .-GL_PREFIX(ObjectPurgeableAPPLE)
-
- .p2align 4,,15
- .globl GL_PREFIX(ObjectUnpurgeableAPPLE)
- .type GL_PREFIX(ObjectUnpurgeableAPPLE), @function
-GL_PREFIX(ObjectUnpurgeableAPPLE):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 7328(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 7328(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 7328(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 7328(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(ObjectUnpurgeableAPPLE), .-GL_PREFIX(ObjectUnpurgeableAPPLE)
-
- .p2align 4,,15
- .globl GL_PREFIX(ActiveProgramEXT)
- .type GL_PREFIX(ActiveProgramEXT), @function
-GL_PREFIX(ActiveProgramEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 7336(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- call _x86_64_get_dispatch@PLT
- popq %rdi
- movq 7336(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 7336(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- call _glapi_get_dispatch
- popq %rdi
- movq 7336(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(ActiveProgramEXT), .-GL_PREFIX(ActiveProgramEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(CreateShaderProgramEXT)
- .type GL_PREFIX(CreateShaderProgramEXT), @function
-GL_PREFIX(CreateShaderProgramEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 7344(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 7344(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 7344(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 7344(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(CreateShaderProgramEXT), .-GL_PREFIX(CreateShaderProgramEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(UseShaderProgramEXT)
- .type GL_PREFIX(UseShaderProgramEXT), @function
-GL_PREFIX(UseShaderProgramEXT):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 7352(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 7352(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 7352(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 7352(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(UseShaderProgramEXT), .-GL_PREFIX(UseShaderProgramEXT)
-
- .p2align 4,,15
- .globl GL_PREFIX(TextureBarrierNV)
- .type GL_PREFIX(TextureBarrierNV), @function
-GL_PREFIX(TextureBarrierNV):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 7360(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- movq 7360(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 7360(%rax), %r11
- jmp *%r11
-1:
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- movq 7360(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(TextureBarrierNV), .-GL_PREFIX(TextureBarrierNV)
-
- .p2align 4,,15
- .globl GL_PREFIX(_dispatch_stub_921)
- .type GL_PREFIX(_dispatch_stub_921), @function
- HIDDEN(GL_PREFIX(_dispatch_stub_921))
-GL_PREFIX(_dispatch_stub_921):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 7368(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 7368(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 7368(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 7368(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(_dispatch_stub_921), .-GL_PREFIX(_dispatch_stub_921)
-
- .p2align 4,,15
- .globl GL_PREFIX(_dispatch_stub_922)
- .type GL_PREFIX(_dispatch_stub_922), @function
- HIDDEN(GL_PREFIX(_dispatch_stub_922))
-GL_PREFIX(_dispatch_stub_922):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 7376(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 7376(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 7376(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 7376(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(_dispatch_stub_922), .-GL_PREFIX(_dispatch_stub_922)
-
- .p2align 4,,15
- .globl GL_PREFIX(_dispatch_stub_923)
- .type GL_PREFIX(_dispatch_stub_923), @function
- HIDDEN(GL_PREFIX(_dispatch_stub_923))
-GL_PREFIX(_dispatch_stub_923):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 7384(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 7384(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 7384(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- pushq %rcx
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rcx
- popq %rdx
- popq %rsi
- popq %rdi
- movq 7384(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(_dispatch_stub_923), .-GL_PREFIX(_dispatch_stub_923)
-
- .p2align 4,,15
- .globl GL_PREFIX(_dispatch_stub_924)
- .type GL_PREFIX(_dispatch_stub_924), @function
- HIDDEN(GL_PREFIX(_dispatch_stub_924))
-GL_PREFIX(_dispatch_stub_924):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 7392(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 7392(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 7392(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 7392(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(_dispatch_stub_924), .-GL_PREFIX(_dispatch_stub_924)
-
- .p2align 4,,15
- .globl GL_PREFIX(_dispatch_stub_925)
- .type GL_PREFIX(_dispatch_stub_925), @function
- HIDDEN(GL_PREFIX(_dispatch_stub_925))
-GL_PREFIX(_dispatch_stub_925):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 7400(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _x86_64_get_dispatch@PLT
- popq %rdx
- popq %rsi
- popq %rdi
- movq 7400(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 7400(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rdx
- call _glapi_get_dispatch
- popq %rdx
- popq %rsi
- popq %rdi
- movq 7400(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(_dispatch_stub_925), .-GL_PREFIX(_dispatch_stub_925)
-
- .p2align 4,,15
- .globl GL_PREFIX(EGLImageTargetRenderbufferStorageOES)
- .type GL_PREFIX(EGLImageTargetRenderbufferStorageOES), @function
-GL_PREFIX(EGLImageTargetRenderbufferStorageOES):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 7408(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 7408(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 7408(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 7408(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(EGLImageTargetRenderbufferStorageOES), .-GL_PREFIX(EGLImageTargetRenderbufferStorageOES)
-
- .p2align 4,,15
- .globl GL_PREFIX(EGLImageTargetTexture2DOES)
- .type GL_PREFIX(EGLImageTargetTexture2DOES), @function
-GL_PREFIX(EGLImageTargetTexture2DOES):
-#if defined(GLX_USE_TLS)
- call _x86_64_get_dispatch@PLT
- movq 7416(%rax), %r11
- jmp *%r11
-#elif defined(PTHREADS)
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _x86_64_get_dispatch@PLT
- popq %rbp
- popq %rsi
- popq %rdi
- movq 7416(%rax), %r11
- jmp *%r11
-#else
- movq _glapi_Dispatch(%rip), %rax
- testq %rax, %rax
- je 1f
- movq 7416(%rax), %r11
- jmp *%r11
-1:
- pushq %rdi
- pushq %rsi
- pushq %rbp
- call _glapi_get_dispatch
- popq %rbp
- popq %rsi
- popq %rdi
- movq 7416(%rax), %r11
- jmp *%r11
-#endif /* defined(GLX_USE_TLS) */
- .size GL_PREFIX(EGLImageTargetTexture2DOES), .-GL_PREFIX(EGLImageTargetTexture2DOES)
-
- .globl GL_PREFIX(ArrayElementEXT) ; .set GL_PREFIX(ArrayElementEXT), GL_PREFIX(ArrayElement)
- .globl GL_PREFIX(BindTextureEXT) ; .set GL_PREFIX(BindTextureEXT), GL_PREFIX(BindTexture)
- .globl GL_PREFIX(DrawArraysEXT) ; .set GL_PREFIX(DrawArraysEXT), GL_PREFIX(DrawArrays)
-#ifndef GLX_INDIRECT_RENDERING
- .globl GL_PREFIX(AreTexturesResidentEXT) ; .set GL_PREFIX(AreTexturesResidentEXT), GL_PREFIX(AreTexturesResident)
-#endif
- .globl GL_PREFIX(CopyTexImage1DEXT) ; .set GL_PREFIX(CopyTexImage1DEXT), GL_PREFIX(CopyTexImage1D)
- .globl GL_PREFIX(CopyTexImage2DEXT) ; .set GL_PREFIX(CopyTexImage2DEXT), GL_PREFIX(CopyTexImage2D)
- .globl GL_PREFIX(CopyTexSubImage1DEXT) ; .set GL_PREFIX(CopyTexSubImage1DEXT), GL_PREFIX(CopyTexSubImage1D)
- .globl GL_PREFIX(CopyTexSubImage2DEXT) ; .set GL_PREFIX(CopyTexSubImage2DEXT), GL_PREFIX(CopyTexSubImage2D)
-#ifndef GLX_INDIRECT_RENDERING
- .globl GL_PREFIX(DeleteTexturesEXT) ; .set GL_PREFIX(DeleteTexturesEXT), GL_PREFIX(DeleteTextures)
-#endif
-#ifndef GLX_INDIRECT_RENDERING
- .globl GL_PREFIX(GenTexturesEXT) ; .set GL_PREFIX(GenTexturesEXT), GL_PREFIX(GenTextures)
-#endif
- .globl GL_PREFIX(GetPointervEXT) ; .set GL_PREFIX(GetPointervEXT), GL_PREFIX(GetPointerv)
-#ifndef GLX_INDIRECT_RENDERING
- .globl GL_PREFIX(IsTextureEXT) ; .set GL_PREFIX(IsTextureEXT), GL_PREFIX(IsTexture)
-#endif
- .globl GL_PREFIX(PrioritizeTexturesEXT) ; .set GL_PREFIX(PrioritizeTexturesEXT), GL_PREFIX(PrioritizeTextures)
- .globl GL_PREFIX(TexSubImage1DEXT) ; .set GL_PREFIX(TexSubImage1DEXT), GL_PREFIX(TexSubImage1D)
- .globl GL_PREFIX(TexSubImage2DEXT) ; .set GL_PREFIX(TexSubImage2DEXT), GL_PREFIX(TexSubImage2D)
- .globl GL_PREFIX(BlendColorEXT) ; .set GL_PREFIX(BlendColorEXT), GL_PREFIX(BlendColor)
- .globl GL_PREFIX(BlendEquationEXT) ; .set GL_PREFIX(BlendEquationEXT), GL_PREFIX(BlendEquation)
- .globl GL_PREFIX(DrawRangeElementsEXT) ; .set GL_PREFIX(DrawRangeElementsEXT), GL_PREFIX(DrawRangeElements)
- .globl GL_PREFIX(ColorTableEXT) ; .set GL_PREFIX(ColorTableEXT), GL_PREFIX(ColorTable)
-#ifndef GLX_INDIRECT_RENDERING
- .globl GL_PREFIX(GetColorTableEXT) ; .set GL_PREFIX(GetColorTableEXT), GL_PREFIX(GetColorTable)
-#endif
-#ifndef GLX_INDIRECT_RENDERING
- .globl GL_PREFIX(GetColorTableParameterfvEXT) ; .set GL_PREFIX(GetColorTableParameterfvEXT), GL_PREFIX(GetColorTableParameterfv)
-#endif
-#ifndef GLX_INDIRECT_RENDERING
- .globl GL_PREFIX(GetColorTableParameterivEXT) ; .set GL_PREFIX(GetColorTableParameterivEXT), GL_PREFIX(GetColorTableParameteriv)
-#endif
- .globl GL_PREFIX(TexImage3DEXT) ; .set GL_PREFIX(TexImage3DEXT), GL_PREFIX(TexImage3D)
- .globl GL_PREFIX(TexSubImage3DEXT) ; .set GL_PREFIX(TexSubImage3DEXT), GL_PREFIX(TexSubImage3D)
- .globl GL_PREFIX(CopyTexSubImage3DEXT) ; .set GL_PREFIX(CopyTexSubImage3DEXT), GL_PREFIX(CopyTexSubImage3D)
- .globl GL_PREFIX(ActiveTexture) ; .set GL_PREFIX(ActiveTexture), GL_PREFIX(ActiveTextureARB)
- .globl GL_PREFIX(ClientActiveTexture) ; .set GL_PREFIX(ClientActiveTexture), GL_PREFIX(ClientActiveTextureARB)
- .globl GL_PREFIX(MultiTexCoord1d) ; .set GL_PREFIX(MultiTexCoord1d), GL_PREFIX(MultiTexCoord1dARB)
- .globl GL_PREFIX(MultiTexCoord1dv) ; .set GL_PREFIX(MultiTexCoord1dv), GL_PREFIX(MultiTexCoord1dvARB)
- .globl GL_PREFIX(MultiTexCoord1f) ; .set GL_PREFIX(MultiTexCoord1f), GL_PREFIX(MultiTexCoord1fARB)
- .globl GL_PREFIX(MultiTexCoord1fv) ; .set GL_PREFIX(MultiTexCoord1fv), GL_PREFIX(MultiTexCoord1fvARB)
- .globl GL_PREFIX(MultiTexCoord1i) ; .set GL_PREFIX(MultiTexCoord1i), GL_PREFIX(MultiTexCoord1iARB)
- .globl GL_PREFIX(MultiTexCoord1iv) ; .set GL_PREFIX(MultiTexCoord1iv), GL_PREFIX(MultiTexCoord1ivARB)
- .globl GL_PREFIX(MultiTexCoord1s) ; .set GL_PREFIX(MultiTexCoord1s), GL_PREFIX(MultiTexCoord1sARB)
- .globl GL_PREFIX(MultiTexCoord1sv) ; .set GL_PREFIX(MultiTexCoord1sv), GL_PREFIX(MultiTexCoord1svARB)
- .globl GL_PREFIX(MultiTexCoord2d) ; .set GL_PREFIX(MultiTexCoord2d), GL_PREFIX(MultiTexCoord2dARB)
- .globl GL_PREFIX(MultiTexCoord2dv) ; .set GL_PREFIX(MultiTexCoord2dv), GL_PREFIX(MultiTexCoord2dvARB)
- .globl GL_PREFIX(MultiTexCoord2f) ; .set GL_PREFIX(MultiTexCoord2f), GL_PREFIX(MultiTexCoord2fARB)
- .globl GL_PREFIX(MultiTexCoord2fv) ; .set GL_PREFIX(MultiTexCoord2fv), GL_PREFIX(MultiTexCoord2fvARB)
- .globl GL_PREFIX(MultiTexCoord2i) ; .set GL_PREFIX(MultiTexCoord2i), GL_PREFIX(MultiTexCoord2iARB)
- .globl GL_PREFIX(MultiTexCoord2iv) ; .set GL_PREFIX(MultiTexCoord2iv), GL_PREFIX(MultiTexCoord2ivARB)
- .globl GL_PREFIX(MultiTexCoord2s) ; .set GL_PREFIX(MultiTexCoord2s), GL_PREFIX(MultiTexCoord2sARB)
- .globl GL_PREFIX(MultiTexCoord2sv) ; .set GL_PREFIX(MultiTexCoord2sv), GL_PREFIX(MultiTexCoord2svARB)
- .globl GL_PREFIX(MultiTexCoord3d) ; .set GL_PREFIX(MultiTexCoord3d), GL_PREFIX(MultiTexCoord3dARB)
- .globl GL_PREFIX(MultiTexCoord3dv) ; .set GL_PREFIX(MultiTexCoord3dv), GL_PREFIX(MultiTexCoord3dvARB)
- .globl GL_PREFIX(MultiTexCoord3f) ; .set GL_PREFIX(MultiTexCoord3f), GL_PREFIX(MultiTexCoord3fARB)
- .globl GL_PREFIX(MultiTexCoord3fv) ; .set GL_PREFIX(MultiTexCoord3fv), GL_PREFIX(MultiTexCoord3fvARB)
- .globl GL_PREFIX(MultiTexCoord3i) ; .set GL_PREFIX(MultiTexCoord3i), GL_PREFIX(MultiTexCoord3iARB)
- .globl GL_PREFIX(MultiTexCoord3iv) ; .set GL_PREFIX(MultiTexCoord3iv), GL_PREFIX(MultiTexCoord3ivARB)
- .globl GL_PREFIX(MultiTexCoord3s) ; .set GL_PREFIX(MultiTexCoord3s), GL_PREFIX(MultiTexCoord3sARB)
- .globl GL_PREFIX(MultiTexCoord3sv) ; .set GL_PREFIX(MultiTexCoord3sv), GL_PREFIX(MultiTexCoord3svARB)
- .globl GL_PREFIX(MultiTexCoord4d) ; .set GL_PREFIX(MultiTexCoord4d), GL_PREFIX(MultiTexCoord4dARB)
- .globl GL_PREFIX(MultiTexCoord4dv) ; .set GL_PREFIX(MultiTexCoord4dv), GL_PREFIX(MultiTexCoord4dvARB)
- .globl GL_PREFIX(MultiTexCoord4f) ; .set GL_PREFIX(MultiTexCoord4f), GL_PREFIX(MultiTexCoord4fARB)
- .globl GL_PREFIX(MultiTexCoord4fv) ; .set GL_PREFIX(MultiTexCoord4fv), GL_PREFIX(MultiTexCoord4fvARB)
- .globl GL_PREFIX(MultiTexCoord4i) ; .set GL_PREFIX(MultiTexCoord4i), GL_PREFIX(MultiTexCoord4iARB)
- .globl GL_PREFIX(MultiTexCoord4iv) ; .set GL_PREFIX(MultiTexCoord4iv), GL_PREFIX(MultiTexCoord4ivARB)
- .globl GL_PREFIX(MultiTexCoord4s) ; .set GL_PREFIX(MultiTexCoord4s), GL_PREFIX(MultiTexCoord4sARB)
- .globl GL_PREFIX(MultiTexCoord4sv) ; .set GL_PREFIX(MultiTexCoord4sv), GL_PREFIX(MultiTexCoord4svARB)
- .globl GL_PREFIX(LoadTransposeMatrixd) ; .set GL_PREFIX(LoadTransposeMatrixd), GL_PREFIX(LoadTransposeMatrixdARB)
- .globl GL_PREFIX(LoadTransposeMatrixf) ; .set GL_PREFIX(LoadTransposeMatrixf), GL_PREFIX(LoadTransposeMatrixfARB)
- .globl GL_PREFIX(MultTransposeMatrixd) ; .set GL_PREFIX(MultTransposeMatrixd), GL_PREFIX(MultTransposeMatrixdARB)
- .globl GL_PREFIX(MultTransposeMatrixf) ; .set GL_PREFIX(MultTransposeMatrixf), GL_PREFIX(MultTransposeMatrixfARB)
- .globl GL_PREFIX(SampleCoverage) ; .set GL_PREFIX(SampleCoverage), GL_PREFIX(SampleCoverageARB)
- .globl GL_PREFIX(CompressedTexImage1D) ; .set GL_PREFIX(CompressedTexImage1D), GL_PREFIX(CompressedTexImage1DARB)
- .globl GL_PREFIX(CompressedTexImage2D) ; .set GL_PREFIX(CompressedTexImage2D), GL_PREFIX(CompressedTexImage2DARB)
- .globl GL_PREFIX(CompressedTexImage3D) ; .set GL_PREFIX(CompressedTexImage3D), GL_PREFIX(CompressedTexImage3DARB)
- .globl GL_PREFIX(CompressedTexSubImage1D) ; .set GL_PREFIX(CompressedTexSubImage1D), GL_PREFIX(CompressedTexSubImage1DARB)
- .globl GL_PREFIX(CompressedTexSubImage2D) ; .set GL_PREFIX(CompressedTexSubImage2D), GL_PREFIX(CompressedTexSubImage2DARB)
- .globl GL_PREFIX(CompressedTexSubImage3D) ; .set GL_PREFIX(CompressedTexSubImage3D), GL_PREFIX(CompressedTexSubImage3DARB)
- .globl GL_PREFIX(GetCompressedTexImage) ; .set GL_PREFIX(GetCompressedTexImage), GL_PREFIX(GetCompressedTexImageARB)
- .globl GL_PREFIX(DisableVertexAttribArray) ; .set GL_PREFIX(DisableVertexAttribArray), GL_PREFIX(DisableVertexAttribArrayARB)
- .globl GL_PREFIX(EnableVertexAttribArray) ; .set GL_PREFIX(EnableVertexAttribArray), GL_PREFIX(EnableVertexAttribArrayARB)
- .globl GL_PREFIX(GetVertexAttribdv) ; .set GL_PREFIX(GetVertexAttribdv), GL_PREFIX(GetVertexAttribdvARB)
- .globl GL_PREFIX(GetVertexAttribfv) ; .set GL_PREFIX(GetVertexAttribfv), GL_PREFIX(GetVertexAttribfvARB)
- .globl GL_PREFIX(GetVertexAttribiv) ; .set GL_PREFIX(GetVertexAttribiv), GL_PREFIX(GetVertexAttribivARB)
- .globl GL_PREFIX(ProgramParameter4dNV) ; .set GL_PREFIX(ProgramParameter4dNV), GL_PREFIX(ProgramEnvParameter4dARB)
- .globl GL_PREFIX(ProgramParameter4dvNV) ; .set GL_PREFIX(ProgramParameter4dvNV), GL_PREFIX(ProgramEnvParameter4dvARB)
- .globl GL_PREFIX(ProgramParameter4fNV) ; .set GL_PREFIX(ProgramParameter4fNV), GL_PREFIX(ProgramEnvParameter4fARB)
- .globl GL_PREFIX(ProgramParameter4fvNV) ; .set GL_PREFIX(ProgramParameter4fvNV), GL_PREFIX(ProgramEnvParameter4fvARB)
- .globl GL_PREFIX(VertexAttrib1d) ; .set GL_PREFIX(VertexAttrib1d), GL_PREFIX(VertexAttrib1dARB)
- .globl GL_PREFIX(VertexAttrib1dv) ; .set GL_PREFIX(VertexAttrib1dv), GL_PREFIX(VertexAttrib1dvARB)
- .globl GL_PREFIX(VertexAttrib1f) ; .set GL_PREFIX(VertexAttrib1f), GL_PREFIX(VertexAttrib1fARB)
- .globl GL_PREFIX(VertexAttrib1fv) ; .set GL_PREFIX(VertexAttrib1fv), GL_PREFIX(VertexAttrib1fvARB)
- .globl GL_PREFIX(VertexAttrib1s) ; .set GL_PREFIX(VertexAttrib1s), GL_PREFIX(VertexAttrib1sARB)
- .globl GL_PREFIX(VertexAttrib1sv) ; .set GL_PREFIX(VertexAttrib1sv), GL_PREFIX(VertexAttrib1svARB)
- .globl GL_PREFIX(VertexAttrib2d) ; .set GL_PREFIX(VertexAttrib2d), GL_PREFIX(VertexAttrib2dARB)
- .globl GL_PREFIX(VertexAttrib2dv) ; .set GL_PREFIX(VertexAttrib2dv), GL_PREFIX(VertexAttrib2dvARB)
- .globl GL_PREFIX(VertexAttrib2f) ; .set GL_PREFIX(VertexAttrib2f), GL_PREFIX(VertexAttrib2fARB)
- .globl GL_PREFIX(VertexAttrib2fv) ; .set GL_PREFIX(VertexAttrib2fv), GL_PREFIX(VertexAttrib2fvARB)
- .globl GL_PREFIX(VertexAttrib2s) ; .set GL_PREFIX(VertexAttrib2s), GL_PREFIX(VertexAttrib2sARB)
- .globl GL_PREFIX(VertexAttrib2sv) ; .set GL_PREFIX(VertexAttrib2sv), GL_PREFIX(VertexAttrib2svARB)
- .globl GL_PREFIX(VertexAttrib3d) ; .set GL_PREFIX(VertexAttrib3d), GL_PREFIX(VertexAttrib3dARB)
- .globl GL_PREFIX(VertexAttrib3dv) ; .set GL_PREFIX(VertexAttrib3dv), GL_PREFIX(VertexAttrib3dvARB)
- .globl GL_PREFIX(VertexAttrib3f) ; .set GL_PREFIX(VertexAttrib3f), GL_PREFIX(VertexAttrib3fARB)
- .globl GL_PREFIX(VertexAttrib3fv) ; .set GL_PREFIX(VertexAttrib3fv), GL_PREFIX(VertexAttrib3fvARB)
- .globl GL_PREFIX(VertexAttrib3s) ; .set GL_PREFIX(VertexAttrib3s), GL_PREFIX(VertexAttrib3sARB)
- .globl GL_PREFIX(VertexAttrib3sv) ; .set GL_PREFIX(VertexAttrib3sv), GL_PREFIX(VertexAttrib3svARB)
- .globl GL_PREFIX(VertexAttrib4Nbv) ; .set GL_PREFIX(VertexAttrib4Nbv), GL_PREFIX(VertexAttrib4NbvARB)
- .globl GL_PREFIX(VertexAttrib4Niv) ; .set GL_PREFIX(VertexAttrib4Niv), GL_PREFIX(VertexAttrib4NivARB)
- .globl GL_PREFIX(VertexAttrib4Nsv) ; .set GL_PREFIX(VertexAttrib4Nsv), GL_PREFIX(VertexAttrib4NsvARB)
- .globl GL_PREFIX(VertexAttrib4Nub) ; .set GL_PREFIX(VertexAttrib4Nub), GL_PREFIX(VertexAttrib4NubARB)
- .globl GL_PREFIX(VertexAttrib4Nubv) ; .set GL_PREFIX(VertexAttrib4Nubv), GL_PREFIX(VertexAttrib4NubvARB)
- .globl GL_PREFIX(VertexAttrib4Nuiv) ; .set GL_PREFIX(VertexAttrib4Nuiv), GL_PREFIX(VertexAttrib4NuivARB)
- .globl GL_PREFIX(VertexAttrib4Nusv) ; .set GL_PREFIX(VertexAttrib4Nusv), GL_PREFIX(VertexAttrib4NusvARB)
- .globl GL_PREFIX(VertexAttrib4bv) ; .set GL_PREFIX(VertexAttrib4bv), GL_PREFIX(VertexAttrib4bvARB)
- .globl GL_PREFIX(VertexAttrib4d) ; .set GL_PREFIX(VertexAttrib4d), GL_PREFIX(VertexAttrib4dARB)
- .globl GL_PREFIX(VertexAttrib4dv) ; .set GL_PREFIX(VertexAttrib4dv), GL_PREFIX(VertexAttrib4dvARB)
- .globl GL_PREFIX(VertexAttrib4f) ; .set GL_PREFIX(VertexAttrib4f), GL_PREFIX(VertexAttrib4fARB)
- .globl GL_PREFIX(VertexAttrib4fv) ; .set GL_PREFIX(VertexAttrib4fv), GL_PREFIX(VertexAttrib4fvARB)
- .globl GL_PREFIX(VertexAttrib4iv) ; .set GL_PREFIX(VertexAttrib4iv), GL_PREFIX(VertexAttrib4ivARB)
- .globl GL_PREFIX(VertexAttrib4s) ; .set GL_PREFIX(VertexAttrib4s), GL_PREFIX(VertexAttrib4sARB)
- .globl GL_PREFIX(VertexAttrib4sv) ; .set GL_PREFIX(VertexAttrib4sv), GL_PREFIX(VertexAttrib4svARB)
- .globl GL_PREFIX(VertexAttrib4ubv) ; .set GL_PREFIX(VertexAttrib4ubv), GL_PREFIX(VertexAttrib4ubvARB)
- .globl GL_PREFIX(VertexAttrib4uiv) ; .set GL_PREFIX(VertexAttrib4uiv), GL_PREFIX(VertexAttrib4uivARB)
- .globl GL_PREFIX(VertexAttrib4usv) ; .set GL_PREFIX(VertexAttrib4usv), GL_PREFIX(VertexAttrib4usvARB)
- .globl GL_PREFIX(VertexAttribPointer) ; .set GL_PREFIX(VertexAttribPointer), GL_PREFIX(VertexAttribPointerARB)
- .globl GL_PREFIX(BindBuffer) ; .set GL_PREFIX(BindBuffer), GL_PREFIX(BindBufferARB)
- .globl GL_PREFIX(BufferData) ; .set GL_PREFIX(BufferData), GL_PREFIX(BufferDataARB)
- .globl GL_PREFIX(BufferSubData) ; .set GL_PREFIX(BufferSubData), GL_PREFIX(BufferSubDataARB)
- .globl GL_PREFIX(DeleteBuffers) ; .set GL_PREFIX(DeleteBuffers), GL_PREFIX(DeleteBuffersARB)
- .globl GL_PREFIX(GenBuffers) ; .set GL_PREFIX(GenBuffers), GL_PREFIX(GenBuffersARB)
- .globl GL_PREFIX(GetBufferParameteriv) ; .set GL_PREFIX(GetBufferParameteriv), GL_PREFIX(GetBufferParameterivARB)
- .globl GL_PREFIX(GetBufferPointerv) ; .set GL_PREFIX(GetBufferPointerv), GL_PREFIX(GetBufferPointervARB)
- .globl GL_PREFIX(GetBufferSubData) ; .set GL_PREFIX(GetBufferSubData), GL_PREFIX(GetBufferSubDataARB)
- .globl GL_PREFIX(IsBuffer) ; .set GL_PREFIX(IsBuffer), GL_PREFIX(IsBufferARB)
- .globl GL_PREFIX(MapBuffer) ; .set GL_PREFIX(MapBuffer), GL_PREFIX(MapBufferARB)
- .globl GL_PREFIX(UnmapBuffer) ; .set GL_PREFIX(UnmapBuffer), GL_PREFIX(UnmapBufferARB)
- .globl GL_PREFIX(BeginQuery) ; .set GL_PREFIX(BeginQuery), GL_PREFIX(BeginQueryARB)
- .globl GL_PREFIX(DeleteQueries) ; .set GL_PREFIX(DeleteQueries), GL_PREFIX(DeleteQueriesARB)
- .globl GL_PREFIX(EndQuery) ; .set GL_PREFIX(EndQuery), GL_PREFIX(EndQueryARB)
- .globl GL_PREFIX(GenQueries) ; .set GL_PREFIX(GenQueries), GL_PREFIX(GenQueriesARB)
- .globl GL_PREFIX(GetQueryObjectiv) ; .set GL_PREFIX(GetQueryObjectiv), GL_PREFIX(GetQueryObjectivARB)
- .globl GL_PREFIX(GetQueryObjectuiv) ; .set GL_PREFIX(GetQueryObjectuiv), GL_PREFIX(GetQueryObjectuivARB)
- .globl GL_PREFIX(GetQueryiv) ; .set GL_PREFIX(GetQueryiv), GL_PREFIX(GetQueryivARB)
- .globl GL_PREFIX(IsQuery) ; .set GL_PREFIX(IsQuery), GL_PREFIX(IsQueryARB)
- .globl GL_PREFIX(CompileShader) ; .set GL_PREFIX(CompileShader), GL_PREFIX(CompileShaderARB)
- .globl GL_PREFIX(GetActiveUniform) ; .set GL_PREFIX(GetActiveUniform), GL_PREFIX(GetActiveUniformARB)
- .globl GL_PREFIX(GetShaderSource) ; .set GL_PREFIX(GetShaderSource), GL_PREFIX(GetShaderSourceARB)
- .globl GL_PREFIX(GetUniformLocation) ; .set GL_PREFIX(GetUniformLocation), GL_PREFIX(GetUniformLocationARB)
- .globl GL_PREFIX(GetUniformfv) ; .set GL_PREFIX(GetUniformfv), GL_PREFIX(GetUniformfvARB)
- .globl GL_PREFIX(GetUniformiv) ; .set GL_PREFIX(GetUniformiv), GL_PREFIX(GetUniformivARB)
- .globl GL_PREFIX(LinkProgram) ; .set GL_PREFIX(LinkProgram), GL_PREFIX(LinkProgramARB)
- .globl GL_PREFIX(ShaderSource) ; .set GL_PREFIX(ShaderSource), GL_PREFIX(ShaderSourceARB)
- .globl GL_PREFIX(Uniform1f) ; .set GL_PREFIX(Uniform1f), GL_PREFIX(Uniform1fARB)
- .globl GL_PREFIX(Uniform1fv) ; .set GL_PREFIX(Uniform1fv), GL_PREFIX(Uniform1fvARB)
- .globl GL_PREFIX(Uniform1i) ; .set GL_PREFIX(Uniform1i), GL_PREFIX(Uniform1iARB)
- .globl GL_PREFIX(Uniform1iv) ; .set GL_PREFIX(Uniform1iv), GL_PREFIX(Uniform1ivARB)
- .globl GL_PREFIX(Uniform2f) ; .set GL_PREFIX(Uniform2f), GL_PREFIX(Uniform2fARB)
- .globl GL_PREFIX(Uniform2fv) ; .set GL_PREFIX(Uniform2fv), GL_PREFIX(Uniform2fvARB)
- .globl GL_PREFIX(Uniform2i) ; .set GL_PREFIX(Uniform2i), GL_PREFIX(Uniform2iARB)
- .globl GL_PREFIX(Uniform2iv) ; .set GL_PREFIX(Uniform2iv), GL_PREFIX(Uniform2ivARB)
- .globl GL_PREFIX(Uniform3f) ; .set GL_PREFIX(Uniform3f), GL_PREFIX(Uniform3fARB)
- .globl GL_PREFIX(Uniform3fv) ; .set GL_PREFIX(Uniform3fv), GL_PREFIX(Uniform3fvARB)
- .globl GL_PREFIX(Uniform3i) ; .set GL_PREFIX(Uniform3i), GL_PREFIX(Uniform3iARB)
- .globl GL_PREFIX(Uniform3iv) ; .set GL_PREFIX(Uniform3iv), GL_PREFIX(Uniform3ivARB)
- .globl GL_PREFIX(Uniform4f) ; .set GL_PREFIX(Uniform4f), GL_PREFIX(Uniform4fARB)
- .globl GL_PREFIX(Uniform4fv) ; .set GL_PREFIX(Uniform4fv), GL_PREFIX(Uniform4fvARB)
- .globl GL_PREFIX(Uniform4i) ; .set GL_PREFIX(Uniform4i), GL_PREFIX(Uniform4iARB)
- .globl GL_PREFIX(Uniform4iv) ; .set GL_PREFIX(Uniform4iv), GL_PREFIX(Uniform4ivARB)
- .globl GL_PREFIX(UniformMatrix2fv) ; .set GL_PREFIX(UniformMatrix2fv), GL_PREFIX(UniformMatrix2fvARB)
- .globl GL_PREFIX(UniformMatrix3fv) ; .set GL_PREFIX(UniformMatrix3fv), GL_PREFIX(UniformMatrix3fvARB)
- .globl GL_PREFIX(UniformMatrix4fv) ; .set GL_PREFIX(UniformMatrix4fv), GL_PREFIX(UniformMatrix4fvARB)
- .globl GL_PREFIX(UseProgram) ; .set GL_PREFIX(UseProgram), GL_PREFIX(UseProgramObjectARB)
- .globl GL_PREFIX(ValidateProgram) ; .set GL_PREFIX(ValidateProgram), GL_PREFIX(ValidateProgramARB)
- .globl GL_PREFIX(BindAttribLocation) ; .set GL_PREFIX(BindAttribLocation), GL_PREFIX(BindAttribLocationARB)
- .globl GL_PREFIX(GetActiveAttrib) ; .set GL_PREFIX(GetActiveAttrib), GL_PREFIX(GetActiveAttribARB)
- .globl GL_PREFIX(GetAttribLocation) ; .set GL_PREFIX(GetAttribLocation), GL_PREFIX(GetAttribLocationARB)
- .globl GL_PREFIX(DrawBuffers) ; .set GL_PREFIX(DrawBuffers), GL_PREFIX(DrawBuffersARB)
- .globl GL_PREFIX(DrawBuffersATI) ; .set GL_PREFIX(DrawBuffersATI), GL_PREFIX(DrawBuffersARB)
- .globl GL_PREFIX(DrawArraysInstancedEXT) ; .set GL_PREFIX(DrawArraysInstancedEXT), GL_PREFIX(DrawArraysInstancedARB)
- .globl GL_PREFIX(DrawArraysInstanced) ; .set GL_PREFIX(DrawArraysInstanced), GL_PREFIX(DrawArraysInstancedARB)
- .globl GL_PREFIX(DrawElementsInstancedEXT) ; .set GL_PREFIX(DrawElementsInstancedEXT), GL_PREFIX(DrawElementsInstancedARB)
- .globl GL_PREFIX(DrawElementsInstanced) ; .set GL_PREFIX(DrawElementsInstanced), GL_PREFIX(DrawElementsInstancedARB)
- .globl GL_PREFIX(RenderbufferStorageMultisampleEXT) ; .set GL_PREFIX(RenderbufferStorageMultisampleEXT), GL_PREFIX(RenderbufferStorageMultisample)
- .globl GL_PREFIX(BlendEquationSeparateIndexedAMD) ; .set GL_PREFIX(BlendEquationSeparateIndexedAMD), GL_PREFIX(BlendEquationSeparateiARB)
- .globl GL_PREFIX(BlendEquationIndexedAMD) ; .set GL_PREFIX(BlendEquationIndexedAMD), GL_PREFIX(BlendEquationiARB)
- .globl GL_PREFIX(BlendFuncSeparateIndexedAMD) ; .set GL_PREFIX(BlendFuncSeparateIndexedAMD), GL_PREFIX(BlendFuncSeparateiARB)
- .globl GL_PREFIX(BlendFuncIndexedAMD) ; .set GL_PREFIX(BlendFuncIndexedAMD), GL_PREFIX(BlendFunciARB)
- .globl GL_PREFIX(PointParameterf) ; .set GL_PREFIX(PointParameterf), GL_PREFIX(PointParameterfEXT)
- .globl GL_PREFIX(PointParameterfARB) ; .set GL_PREFIX(PointParameterfARB), GL_PREFIX(PointParameterfEXT)
- .globl GL_PREFIX(PointParameterfv) ; .set GL_PREFIX(PointParameterfv), GL_PREFIX(PointParameterfvEXT)
- .globl GL_PREFIX(PointParameterfvARB) ; .set GL_PREFIX(PointParameterfvARB), GL_PREFIX(PointParameterfvEXT)
- .globl GL_PREFIX(SecondaryColor3b) ; .set GL_PREFIX(SecondaryColor3b), GL_PREFIX(SecondaryColor3bEXT)
- .globl GL_PREFIX(SecondaryColor3bv) ; .set GL_PREFIX(SecondaryColor3bv), GL_PREFIX(SecondaryColor3bvEXT)
- .globl GL_PREFIX(SecondaryColor3d) ; .set GL_PREFIX(SecondaryColor3d), GL_PREFIX(SecondaryColor3dEXT)
- .globl GL_PREFIX(SecondaryColor3dv) ; .set GL_PREFIX(SecondaryColor3dv), GL_PREFIX(SecondaryColor3dvEXT)
- .globl GL_PREFIX(SecondaryColor3f) ; .set GL_PREFIX(SecondaryColor3f), GL_PREFIX(SecondaryColor3fEXT)
- .globl GL_PREFIX(SecondaryColor3fv) ; .set GL_PREFIX(SecondaryColor3fv), GL_PREFIX(SecondaryColor3fvEXT)
- .globl GL_PREFIX(SecondaryColor3i) ; .set GL_PREFIX(SecondaryColor3i), GL_PREFIX(SecondaryColor3iEXT)
- .globl GL_PREFIX(SecondaryColor3iv) ; .set GL_PREFIX(SecondaryColor3iv), GL_PREFIX(SecondaryColor3ivEXT)
- .globl GL_PREFIX(SecondaryColor3s) ; .set GL_PREFIX(SecondaryColor3s), GL_PREFIX(SecondaryColor3sEXT)
- .globl GL_PREFIX(SecondaryColor3sv) ; .set GL_PREFIX(SecondaryColor3sv), GL_PREFIX(SecondaryColor3svEXT)
- .globl GL_PREFIX(SecondaryColor3ub) ; .set GL_PREFIX(SecondaryColor3ub), GL_PREFIX(SecondaryColor3ubEXT)
- .globl GL_PREFIX(SecondaryColor3ubv) ; .set GL_PREFIX(SecondaryColor3ubv), GL_PREFIX(SecondaryColor3ubvEXT)
- .globl GL_PREFIX(SecondaryColor3ui) ; .set GL_PREFIX(SecondaryColor3ui), GL_PREFIX(SecondaryColor3uiEXT)
- .globl GL_PREFIX(SecondaryColor3uiv) ; .set GL_PREFIX(SecondaryColor3uiv), GL_PREFIX(SecondaryColor3uivEXT)
- .globl GL_PREFIX(SecondaryColor3us) ; .set GL_PREFIX(SecondaryColor3us), GL_PREFIX(SecondaryColor3usEXT)
- .globl GL_PREFIX(SecondaryColor3usv) ; .set GL_PREFIX(SecondaryColor3usv), GL_PREFIX(SecondaryColor3usvEXT)
- .globl GL_PREFIX(SecondaryColorPointer) ; .set GL_PREFIX(SecondaryColorPointer), GL_PREFIX(SecondaryColorPointerEXT)
- .globl GL_PREFIX(MultiDrawArrays) ; .set GL_PREFIX(MultiDrawArrays), GL_PREFIX(MultiDrawArraysEXT)
- .globl GL_PREFIX(MultiDrawElements) ; .set GL_PREFIX(MultiDrawElements), GL_PREFIX(MultiDrawElementsEXT)
- .globl GL_PREFIX(FogCoordPointer) ; .set GL_PREFIX(FogCoordPointer), GL_PREFIX(FogCoordPointerEXT)
- .globl GL_PREFIX(FogCoordd) ; .set GL_PREFIX(FogCoordd), GL_PREFIX(FogCoorddEXT)
- .globl GL_PREFIX(FogCoorddv) ; .set GL_PREFIX(FogCoorddv), GL_PREFIX(FogCoorddvEXT)
- .globl GL_PREFIX(FogCoordf) ; .set GL_PREFIX(FogCoordf), GL_PREFIX(FogCoordfEXT)
- .globl GL_PREFIX(FogCoordfv) ; .set GL_PREFIX(FogCoordfv), GL_PREFIX(FogCoordfvEXT)
- .globl GL_PREFIX(BlendFuncSeparate) ; .set GL_PREFIX(BlendFuncSeparate), GL_PREFIX(BlendFuncSeparateEXT)
- .globl GL_PREFIX(WindowPos2d) ; .set GL_PREFIX(WindowPos2d), GL_PREFIX(WindowPos2dMESA)
- .globl GL_PREFIX(WindowPos2dARB) ; .set GL_PREFIX(WindowPos2dARB), GL_PREFIX(WindowPos2dMESA)
- .globl GL_PREFIX(WindowPos2dv) ; .set GL_PREFIX(WindowPos2dv), GL_PREFIX(WindowPos2dvMESA)
- .globl GL_PREFIX(WindowPos2dvARB) ; .set GL_PREFIX(WindowPos2dvARB), GL_PREFIX(WindowPos2dvMESA)
- .globl GL_PREFIX(WindowPos2f) ; .set GL_PREFIX(WindowPos2f), GL_PREFIX(WindowPos2fMESA)
- .globl GL_PREFIX(WindowPos2fARB) ; .set GL_PREFIX(WindowPos2fARB), GL_PREFIX(WindowPos2fMESA)
- .globl GL_PREFIX(WindowPos2fv) ; .set GL_PREFIX(WindowPos2fv), GL_PREFIX(WindowPos2fvMESA)
- .globl GL_PREFIX(WindowPos2fvARB) ; .set GL_PREFIX(WindowPos2fvARB), GL_PREFIX(WindowPos2fvMESA)
- .globl GL_PREFIX(WindowPos2i) ; .set GL_PREFIX(WindowPos2i), GL_PREFIX(WindowPos2iMESA)
- .globl GL_PREFIX(WindowPos2iARB) ; .set GL_PREFIX(WindowPos2iARB), GL_PREFIX(WindowPos2iMESA)
- .globl GL_PREFIX(WindowPos2iv) ; .set GL_PREFIX(WindowPos2iv), GL_PREFIX(WindowPos2ivMESA)
- .globl GL_PREFIX(WindowPos2ivARB) ; .set GL_PREFIX(WindowPos2ivARB), GL_PREFIX(WindowPos2ivMESA)
- .globl GL_PREFIX(WindowPos2s) ; .set GL_PREFIX(WindowPos2s), GL_PREFIX(WindowPos2sMESA)
- .globl GL_PREFIX(WindowPos2sARB) ; .set GL_PREFIX(WindowPos2sARB), GL_PREFIX(WindowPos2sMESA)
- .globl GL_PREFIX(WindowPos2sv) ; .set GL_PREFIX(WindowPos2sv), GL_PREFIX(WindowPos2svMESA)
- .globl GL_PREFIX(WindowPos2svARB) ; .set GL_PREFIX(WindowPos2svARB), GL_PREFIX(WindowPos2svMESA)
- .globl GL_PREFIX(WindowPos3d) ; .set GL_PREFIX(WindowPos3d), GL_PREFIX(WindowPos3dMESA)
- .globl GL_PREFIX(WindowPos3dARB) ; .set GL_PREFIX(WindowPos3dARB), GL_PREFIX(WindowPos3dMESA)
- .globl GL_PREFIX(WindowPos3dv) ; .set GL_PREFIX(WindowPos3dv), GL_PREFIX(WindowPos3dvMESA)
- .globl GL_PREFIX(WindowPos3dvARB) ; .set GL_PREFIX(WindowPos3dvARB), GL_PREFIX(WindowPos3dvMESA)
- .globl GL_PREFIX(WindowPos3f) ; .set GL_PREFIX(WindowPos3f), GL_PREFIX(WindowPos3fMESA)
- .globl GL_PREFIX(WindowPos3fARB) ; .set GL_PREFIX(WindowPos3fARB), GL_PREFIX(WindowPos3fMESA)
- .globl GL_PREFIX(WindowPos3fv) ; .set GL_PREFIX(WindowPos3fv), GL_PREFIX(WindowPos3fvMESA)
- .globl GL_PREFIX(WindowPos3fvARB) ; .set GL_PREFIX(WindowPos3fvARB), GL_PREFIX(WindowPos3fvMESA)
- .globl GL_PREFIX(WindowPos3i) ; .set GL_PREFIX(WindowPos3i), GL_PREFIX(WindowPos3iMESA)
- .globl GL_PREFIX(WindowPos3iARB) ; .set GL_PREFIX(WindowPos3iARB), GL_PREFIX(WindowPos3iMESA)
- .globl GL_PREFIX(WindowPos3iv) ; .set GL_PREFIX(WindowPos3iv), GL_PREFIX(WindowPos3ivMESA)
- .globl GL_PREFIX(WindowPos3ivARB) ; .set GL_PREFIX(WindowPos3ivARB), GL_PREFIX(WindowPos3ivMESA)
- .globl GL_PREFIX(WindowPos3s) ; .set GL_PREFIX(WindowPos3s), GL_PREFIX(WindowPos3sMESA)
- .globl GL_PREFIX(WindowPos3sARB) ; .set GL_PREFIX(WindowPos3sARB), GL_PREFIX(WindowPos3sMESA)
- .globl GL_PREFIX(WindowPos3sv) ; .set GL_PREFIX(WindowPos3sv), GL_PREFIX(WindowPos3svMESA)
- .globl GL_PREFIX(WindowPos3svARB) ; .set GL_PREFIX(WindowPos3svARB), GL_PREFIX(WindowPos3svMESA)
- .globl GL_PREFIX(BindProgramARB) ; .set GL_PREFIX(BindProgramARB), GL_PREFIX(BindProgramNV)
- .globl GL_PREFIX(DeleteProgramsARB) ; .set GL_PREFIX(DeleteProgramsARB), GL_PREFIX(DeleteProgramsNV)
- .globl GL_PREFIX(GenProgramsARB) ; .set GL_PREFIX(GenProgramsARB), GL_PREFIX(GenProgramsNV)
- .globl GL_PREFIX(GetVertexAttribPointerv) ; .set GL_PREFIX(GetVertexAttribPointerv), GL_PREFIX(GetVertexAttribPointervNV)
- .globl GL_PREFIX(GetVertexAttribPointervARB) ; .set GL_PREFIX(GetVertexAttribPointervARB), GL_PREFIX(GetVertexAttribPointervNV)
- .globl GL_PREFIX(IsProgramARB) ; .set GL_PREFIX(IsProgramARB), GL_PREFIX(IsProgramNV)
- .globl GL_PREFIX(PointParameteri) ; .set GL_PREFIX(PointParameteri), GL_PREFIX(PointParameteriNV)
- .globl GL_PREFIX(PointParameteriv) ; .set GL_PREFIX(PointParameteriv), GL_PREFIX(PointParameterivNV)
- .globl GL_PREFIX(DeleteVertexArrays) ; .set GL_PREFIX(DeleteVertexArrays), GL_PREFIX(_dispatch_stub_822)
- .globl GL_PREFIX(IsVertexArray) ; .set GL_PREFIX(IsVertexArray), GL_PREFIX(_dispatch_stub_824)
- .globl GL_PREFIX(PrimitiveRestartIndex) ; .set GL_PREFIX(PrimitiveRestartIndex), GL_PREFIX(PrimitiveRestartIndexNV)
- .globl GL_PREFIX(BlendEquationSeparate) ; .set GL_PREFIX(BlendEquationSeparate), GL_PREFIX(_dispatch_stub_834)
- .globl GL_PREFIX(BindFramebuffer) ; .set GL_PREFIX(BindFramebuffer), GL_PREFIX(BindFramebufferEXT)
- .globl GL_PREFIX(BindRenderbuffer) ; .set GL_PREFIX(BindRenderbuffer), GL_PREFIX(BindRenderbufferEXT)
- .globl GL_PREFIX(CheckFramebufferStatus) ; .set GL_PREFIX(CheckFramebufferStatus), GL_PREFIX(CheckFramebufferStatusEXT)
- .globl GL_PREFIX(DeleteFramebuffers) ; .set GL_PREFIX(DeleteFramebuffers), GL_PREFIX(DeleteFramebuffersEXT)
- .globl GL_PREFIX(DeleteRenderbuffers) ; .set GL_PREFIX(DeleteRenderbuffers), GL_PREFIX(DeleteRenderbuffersEXT)
- .globl GL_PREFIX(FramebufferRenderbuffer) ; .set GL_PREFIX(FramebufferRenderbuffer), GL_PREFIX(FramebufferRenderbufferEXT)
- .globl GL_PREFIX(FramebufferTexture1D) ; .set GL_PREFIX(FramebufferTexture1D), GL_PREFIX(FramebufferTexture1DEXT)
- .globl GL_PREFIX(FramebufferTexture2D) ; .set GL_PREFIX(FramebufferTexture2D), GL_PREFIX(FramebufferTexture2DEXT)
- .globl GL_PREFIX(FramebufferTexture3D) ; .set GL_PREFIX(FramebufferTexture3D), GL_PREFIX(FramebufferTexture3DEXT)
- .globl GL_PREFIX(GenFramebuffers) ; .set GL_PREFIX(GenFramebuffers), GL_PREFIX(GenFramebuffersEXT)
- .globl GL_PREFIX(GenRenderbuffers) ; .set GL_PREFIX(GenRenderbuffers), GL_PREFIX(GenRenderbuffersEXT)
- .globl GL_PREFIX(GenerateMipmap) ; .set GL_PREFIX(GenerateMipmap), GL_PREFIX(GenerateMipmapEXT)
- .globl GL_PREFIX(GetFramebufferAttachmentParameteriv) ; .set GL_PREFIX(GetFramebufferAttachmentParameteriv), GL_PREFIX(GetFramebufferAttachmentParameterivEXT)
- .globl GL_PREFIX(GetRenderbufferParameteriv) ; .set GL_PREFIX(GetRenderbufferParameteriv), GL_PREFIX(GetRenderbufferParameterivEXT)
- .globl GL_PREFIX(IsFramebuffer) ; .set GL_PREFIX(IsFramebuffer), GL_PREFIX(IsFramebufferEXT)
- .globl GL_PREFIX(IsRenderbuffer) ; .set GL_PREFIX(IsRenderbuffer), GL_PREFIX(IsRenderbufferEXT)
- .globl GL_PREFIX(RenderbufferStorage) ; .set GL_PREFIX(RenderbufferStorage), GL_PREFIX(RenderbufferStorageEXT)
- .globl GL_PREFIX(BlitFramebuffer) ; .set GL_PREFIX(BlitFramebuffer), GL_PREFIX(_dispatch_stub_852)
- .globl GL_PREFIX(BindFragDataLocation) ; .set GL_PREFIX(BindFragDataLocation), GL_PREFIX(BindFragDataLocationEXT)
- .globl GL_PREFIX(GetFragDataLocation) ; .set GL_PREFIX(GetFragDataLocation), GL_PREFIX(GetFragDataLocationEXT)
- .globl GL_PREFIX(GetUniformuiv) ; .set GL_PREFIX(GetUniformuiv), GL_PREFIX(GetUniformuivEXT)
- .globl GL_PREFIX(GetVertexAttribIiv) ; .set GL_PREFIX(GetVertexAttribIiv), GL_PREFIX(GetVertexAttribIivEXT)
- .globl GL_PREFIX(GetVertexAttribIuiv) ; .set GL_PREFIX(GetVertexAttribIuiv), GL_PREFIX(GetVertexAttribIuivEXT)
- .globl GL_PREFIX(Uniform1ui) ; .set GL_PREFIX(Uniform1ui), GL_PREFIX(Uniform1uiEXT)
- .globl GL_PREFIX(Uniform1uiv) ; .set GL_PREFIX(Uniform1uiv), GL_PREFIX(Uniform1uivEXT)
- .globl GL_PREFIX(Uniform2ui) ; .set GL_PREFIX(Uniform2ui), GL_PREFIX(Uniform2uiEXT)
- .globl GL_PREFIX(Uniform2uiv) ; .set GL_PREFIX(Uniform2uiv), GL_PREFIX(Uniform2uivEXT)
- .globl GL_PREFIX(Uniform3ui) ; .set GL_PREFIX(Uniform3ui), GL_PREFIX(Uniform3uiEXT)
- .globl GL_PREFIX(Uniform3uiv) ; .set GL_PREFIX(Uniform3uiv), GL_PREFIX(Uniform3uivEXT)
- .globl GL_PREFIX(Uniform4ui) ; .set GL_PREFIX(Uniform4ui), GL_PREFIX(Uniform4uiEXT)
- .globl GL_PREFIX(Uniform4uiv) ; .set GL_PREFIX(Uniform4uiv), GL_PREFIX(Uniform4uivEXT)
- .globl GL_PREFIX(VertexAttribI1i) ; .set GL_PREFIX(VertexAttribI1i), GL_PREFIX(VertexAttribI1iEXT)
- .globl GL_PREFIX(VertexAttribI1iv) ; .set GL_PREFIX(VertexAttribI1iv), GL_PREFIX(VertexAttribI1ivEXT)
- .globl GL_PREFIX(VertexAttribI1ui) ; .set GL_PREFIX(VertexAttribI1ui), GL_PREFIX(VertexAttribI1uiEXT)
- .globl GL_PREFIX(VertexAttribI1uiv) ; .set GL_PREFIX(VertexAttribI1uiv), GL_PREFIX(VertexAttribI1uivEXT)
- .globl GL_PREFIX(VertexAttribI2i) ; .set GL_PREFIX(VertexAttribI2i), GL_PREFIX(VertexAttribI2iEXT)
- .globl GL_PREFIX(VertexAttribI2iv) ; .set GL_PREFIX(VertexAttribI2iv), GL_PREFIX(VertexAttribI2ivEXT)
- .globl GL_PREFIX(VertexAttribI2ui) ; .set GL_PREFIX(VertexAttribI2ui), GL_PREFIX(VertexAttribI2uiEXT)
- .globl GL_PREFIX(VertexAttribI2uiv) ; .set GL_PREFIX(VertexAttribI2uiv), GL_PREFIX(VertexAttribI2uivEXT)
- .globl GL_PREFIX(VertexAttribI3i) ; .set GL_PREFIX(VertexAttribI3i), GL_PREFIX(VertexAttribI3iEXT)
- .globl GL_PREFIX(VertexAttribI3iv) ; .set GL_PREFIX(VertexAttribI3iv), GL_PREFIX(VertexAttribI3ivEXT)
- .globl GL_PREFIX(VertexAttribI3ui) ; .set GL_PREFIX(VertexAttribI3ui), GL_PREFIX(VertexAttribI3uiEXT)
- .globl GL_PREFIX(VertexAttribI3uiv) ; .set GL_PREFIX(VertexAttribI3uiv), GL_PREFIX(VertexAttribI3uivEXT)
- .globl GL_PREFIX(VertexAttribI4bv) ; .set GL_PREFIX(VertexAttribI4bv), GL_PREFIX(VertexAttribI4bvEXT)
- .globl GL_PREFIX(VertexAttribI4i) ; .set GL_PREFIX(VertexAttribI4i), GL_PREFIX(VertexAttribI4iEXT)
- .globl GL_PREFIX(VertexAttribI4iv) ; .set GL_PREFIX(VertexAttribI4iv), GL_PREFIX(VertexAttribI4ivEXT)
- .globl GL_PREFIX(VertexAttribI4sv) ; .set GL_PREFIX(VertexAttribI4sv), GL_PREFIX(VertexAttribI4svEXT)
- .globl GL_PREFIX(VertexAttribI4ubv) ; .set GL_PREFIX(VertexAttribI4ubv), GL_PREFIX(VertexAttribI4ubvEXT)
- .globl GL_PREFIX(VertexAttribI4ui) ; .set GL_PREFIX(VertexAttribI4ui), GL_PREFIX(VertexAttribI4uiEXT)
- .globl GL_PREFIX(VertexAttribI4uiv) ; .set GL_PREFIX(VertexAttribI4uiv), GL_PREFIX(VertexAttribI4uivEXT)
- .globl GL_PREFIX(VertexAttribI4usv) ; .set GL_PREFIX(VertexAttribI4usv), GL_PREFIX(VertexAttribI4usvEXT)
- .globl GL_PREFIX(VertexAttribIPointer) ; .set GL_PREFIX(VertexAttribIPointer), GL_PREFIX(VertexAttribIPointerEXT)
- .globl GL_PREFIX(FramebufferTextureLayer) ; .set GL_PREFIX(FramebufferTextureLayer), GL_PREFIX(FramebufferTextureLayerEXT)
- .globl GL_PREFIX(ColorMaski) ; .set GL_PREFIX(ColorMaski), GL_PREFIX(ColorMaskIndexedEXT)
- .globl GL_PREFIX(Disablei) ; .set GL_PREFIX(Disablei), GL_PREFIX(DisableIndexedEXT)
- .globl GL_PREFIX(Enablei) ; .set GL_PREFIX(Enablei), GL_PREFIX(EnableIndexedEXT)
- .globl GL_PREFIX(GetBooleani_v) ; .set GL_PREFIX(GetBooleani_v), GL_PREFIX(GetBooleanIndexedvEXT)
- .globl GL_PREFIX(GetIntegeri_v) ; .set GL_PREFIX(GetIntegeri_v), GL_PREFIX(GetIntegerIndexedvEXT)
- .globl GL_PREFIX(IsEnabledi) ; .set GL_PREFIX(IsEnabledi), GL_PREFIX(IsEnabledIndexedEXT)
- .globl GL_PREFIX(GetTexParameterIiv) ; .set GL_PREFIX(GetTexParameterIiv), GL_PREFIX(GetTexParameterIivEXT)
- .globl GL_PREFIX(GetTexParameterIuiv) ; .set GL_PREFIX(GetTexParameterIuiv), GL_PREFIX(GetTexParameterIuivEXT)
- .globl GL_PREFIX(TexParameterIiv) ; .set GL_PREFIX(TexParameterIiv), GL_PREFIX(TexParameterIivEXT)
- .globl GL_PREFIX(TexParameterIuiv) ; .set GL_PREFIX(TexParameterIuiv), GL_PREFIX(TexParameterIuivEXT)
- .globl GL_PREFIX(BeginConditionalRender) ; .set GL_PREFIX(BeginConditionalRender), GL_PREFIX(BeginConditionalRenderNV)
- .globl GL_PREFIX(EndConditionalRender) ; .set GL_PREFIX(EndConditionalRender), GL_PREFIX(EndConditionalRenderNV)
- .globl GL_PREFIX(BeginTransformFeedback) ; .set GL_PREFIX(BeginTransformFeedback), GL_PREFIX(BeginTransformFeedbackEXT)
- .globl GL_PREFIX(BindBufferBase) ; .set GL_PREFIX(BindBufferBase), GL_PREFIX(BindBufferBaseEXT)
- .globl GL_PREFIX(BindBufferRange) ; .set GL_PREFIX(BindBufferRange), GL_PREFIX(BindBufferRangeEXT)
- .globl GL_PREFIX(EndTransformFeedback) ; .set GL_PREFIX(EndTransformFeedback), GL_PREFIX(EndTransformFeedbackEXT)
- .globl GL_PREFIX(GetTransformFeedbackVarying) ; .set GL_PREFIX(GetTransformFeedbackVarying), GL_PREFIX(GetTransformFeedbackVaryingEXT)
- .globl GL_PREFIX(TransformFeedbackVaryings) ; .set GL_PREFIX(TransformFeedbackVaryings), GL_PREFIX(TransformFeedbackVaryingsEXT)
- .globl GL_PREFIX(ProvokingVertex) ; .set GL_PREFIX(ProvokingVertex), GL_PREFIX(ProvokingVertexEXT)
-
-#if defined(GLX_USE_TLS) && defined(__linux__)
- .section ".note.ABI-tag", "a"
- .p2align 2
- .long 1f - 0f /* name length */
- .long 3f - 2f /* data length */
- .long 1 /* note length */
-0: .asciz "GNU" /* vendor name */
-1: .p2align 2
-2: .long 0 /* note data: the ABI tag */
- .long 2,4,20 /* Minimum kernel version w/TLS */
-3: .p2align 2 /* pad out section */
-#endif /* GLX_USE_TLS */
-
-#if defined (__ELF__) && defined (__linux__)
- .section .note.GNU-stack,"",%progbits
-#endif
+/* DO NOT EDIT - This file generated automatically by gl_x86-64_asm.py (from Mesa) script */
+
+/*
+ * (C) Copyright IBM Corporation 2005
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sub license,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
+ * IBM,
+ * AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
+ * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+/* If we build with gcc's -fvisibility=hidden flag, we'll need to change
+ * the symbol visibility mode to 'default'.
+ */
+
+#include "x86/assyntax.h"
+
+#ifdef __GNUC__
+# pragma GCC visibility push(default)
+# define HIDDEN(x) .hidden x
+#else
+# define HIDDEN(x)
+#endif
+
+# if defined(USE_MGL_NAMESPACE)
+# define GL_PREFIX(n) GLNAME(CONCAT(mgl,n))
+# define _glapi_Dispatch _mglapi_Dispatch
+# else
+# define GL_PREFIX(n) GLNAME(CONCAT(gl,n))
+# endif
+
+#if defined(PTHREADS) || defined(WIN32) || defined(BEOS_THREADS)
+# define THREADS
+#endif
+
+ .text
+
+#ifdef GLX_USE_TLS
+
+ .globl _x86_64_get_get_dispatch; HIDDEN(_x86_64_get_get_dispatch)
+_x86_64_get_get_dispatch:
+ lea _x86_64_get_dispatch(%rip), %rax
+ ret
+
+ .p2align 4,,15
+_x86_64_get_dispatch:
+ movq _glapi_tls_Dispatch@GOTTPOFF(%rip), %rax
+ movq %fs:(%rax), %rax
+ ret
+ .size _x86_64_get_dispatch, .-_x86_64_get_dispatch
+
+#elif defined(PTHREADS)
+
+ .extern _glapi_Dispatch
+ .extern _gl_DispatchTSD
+ .extern pthread_getspecific
+
+ .p2align 4,,15
+_x86_64_get_dispatch:
+ movq _gl_DispatchTSD@GOTPCREL(%rip), %rax
+ movl (%rax), %edi
+ jmp pthread_getspecific@PLT
+
+#elif defined(THREADS)
+
+ .extern _glapi_get_dispatch
+
+#endif
+
+ .p2align 4,,15
+ .globl GL_PREFIX(NewList)
+ .type GL_PREFIX(NewList), @function
+GL_PREFIX(NewList):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 0(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq (%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 0(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 0(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(NewList), .-GL_PREFIX(NewList)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(EndList)
+ .type GL_PREFIX(EndList), @function
+GL_PREFIX(EndList):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 8(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ movq 8(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 8(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ movq 8(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(EndList), .-GL_PREFIX(EndList)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(CallList)
+ .type GL_PREFIX(CallList), @function
+GL_PREFIX(CallList):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 16(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 16(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 16(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 16(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(CallList), .-GL_PREFIX(CallList)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(CallLists)
+ .type GL_PREFIX(CallLists), @function
+GL_PREFIX(CallLists):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 24(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 24(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 24(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 24(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(CallLists), .-GL_PREFIX(CallLists)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(DeleteLists)
+ .type GL_PREFIX(DeleteLists), @function
+GL_PREFIX(DeleteLists):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 32(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 32(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 32(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 32(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(DeleteLists), .-GL_PREFIX(DeleteLists)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(GenLists)
+ .type GL_PREFIX(GenLists), @function
+GL_PREFIX(GenLists):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 40(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 40(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 40(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 40(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(GenLists), .-GL_PREFIX(GenLists)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(ListBase)
+ .type GL_PREFIX(ListBase), @function
+GL_PREFIX(ListBase):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 48(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 48(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 48(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 48(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(ListBase), .-GL_PREFIX(ListBase)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(Begin)
+ .type GL_PREFIX(Begin), @function
+GL_PREFIX(Begin):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 56(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 56(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 56(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 56(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(Begin), .-GL_PREFIX(Begin)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(Bitmap)
+ .type GL_PREFIX(Bitmap), @function
+GL_PREFIX(Bitmap):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 64(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ subq $56, %rsp
+ movq %rdi, (%rsp)
+ movq %rsi, 8(%rsp)
+ movq %xmm0, 16(%rsp)
+ movq %xmm1, 24(%rsp)
+ movq %xmm2, 32(%rsp)
+ movq %xmm3, 40(%rsp)
+ movq %rdx, 48(%rsp)
+ call _x86_64_get_dispatch@PLT
+ movq 48(%rsp), %rdx
+ movq 40(%rsp), %xmm3
+ movq 32(%rsp), %xmm2
+ movq 24(%rsp), %xmm1
+ movq 16(%rsp), %xmm0
+ movq 8(%rsp), %rsi
+ movq (%rsp), %rdi
+ addq $56, %rsp
+ movq 64(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 64(%rax), %r11
+ jmp *%r11
+1:
+ subq $56, %rsp
+ movq %rdi, (%rsp)
+ movq %rsi, 8(%rsp)
+ movq %xmm0, 16(%rsp)
+ movq %xmm1, 24(%rsp)
+ movq %xmm2, 32(%rsp)
+ movq %xmm3, 40(%rsp)
+ movq %rdx, 48(%rsp)
+ call _glapi_get_dispatch
+ movq 48(%rsp), %rdx
+ movq 40(%rsp), %xmm3
+ movq 32(%rsp), %xmm2
+ movq 24(%rsp), %xmm1
+ movq 16(%rsp), %xmm0
+ movq 8(%rsp), %rsi
+ movq (%rsp), %rdi
+ addq $56, %rsp
+ movq 64(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(Bitmap), .-GL_PREFIX(Bitmap)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(Color3b)
+ .type GL_PREFIX(Color3b), @function
+GL_PREFIX(Color3b):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 72(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 72(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 72(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 72(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(Color3b), .-GL_PREFIX(Color3b)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(Color3bv)
+ .type GL_PREFIX(Color3bv), @function
+GL_PREFIX(Color3bv):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 80(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 80(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 80(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 80(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(Color3bv), .-GL_PREFIX(Color3bv)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(Color3d)
+ .type GL_PREFIX(Color3d), @function
+GL_PREFIX(Color3d):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 88(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ subq $24, %rsp
+ movq %xmm0, (%rsp)
+ movq %xmm1, 8(%rsp)
+ movq %xmm2, 16(%rsp)
+ call _x86_64_get_dispatch@PLT
+ movq 16(%rsp), %xmm2
+ movq 8(%rsp), %xmm1
+ movq (%rsp), %xmm0
+ addq $24, %rsp
+ movq 88(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 88(%rax), %r11
+ jmp *%r11
+1:
+ subq $24, %rsp
+ movq %xmm0, (%rsp)
+ movq %xmm1, 8(%rsp)
+ movq %xmm2, 16(%rsp)
+ call _glapi_get_dispatch
+ movq 16(%rsp), %xmm2
+ movq 8(%rsp), %xmm1
+ movq (%rsp), %xmm0
+ addq $24, %rsp
+ movq 88(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(Color3d), .-GL_PREFIX(Color3d)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(Color3dv)
+ .type GL_PREFIX(Color3dv), @function
+GL_PREFIX(Color3dv):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 96(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 96(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 96(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 96(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(Color3dv), .-GL_PREFIX(Color3dv)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(Color3f)
+ .type GL_PREFIX(Color3f), @function
+GL_PREFIX(Color3f):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 104(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ subq $24, %rsp
+ movq %xmm0, (%rsp)
+ movq %xmm1, 8(%rsp)
+ movq %xmm2, 16(%rsp)
+ call _x86_64_get_dispatch@PLT
+ movq 16(%rsp), %xmm2
+ movq 8(%rsp), %xmm1
+ movq (%rsp), %xmm0
+ addq $24, %rsp
+ movq 104(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 104(%rax), %r11
+ jmp *%r11
+1:
+ subq $24, %rsp
+ movq %xmm0, (%rsp)
+ movq %xmm1, 8(%rsp)
+ movq %xmm2, 16(%rsp)
+ call _glapi_get_dispatch
+ movq 16(%rsp), %xmm2
+ movq 8(%rsp), %xmm1
+ movq (%rsp), %xmm0
+ addq $24, %rsp
+ movq 104(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(Color3f), .-GL_PREFIX(Color3f)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(Color3fv)
+ .type GL_PREFIX(Color3fv), @function
+GL_PREFIX(Color3fv):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 112(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 112(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 112(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 112(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(Color3fv), .-GL_PREFIX(Color3fv)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(Color3i)
+ .type GL_PREFIX(Color3i), @function
+GL_PREFIX(Color3i):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 120(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 120(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 120(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 120(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(Color3i), .-GL_PREFIX(Color3i)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(Color3iv)
+ .type GL_PREFIX(Color3iv), @function
+GL_PREFIX(Color3iv):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 128(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 128(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 128(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 128(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(Color3iv), .-GL_PREFIX(Color3iv)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(Color3s)
+ .type GL_PREFIX(Color3s), @function
+GL_PREFIX(Color3s):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 136(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 136(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 136(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 136(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(Color3s), .-GL_PREFIX(Color3s)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(Color3sv)
+ .type GL_PREFIX(Color3sv), @function
+GL_PREFIX(Color3sv):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 144(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 144(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 144(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 144(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(Color3sv), .-GL_PREFIX(Color3sv)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(Color3ub)
+ .type GL_PREFIX(Color3ub), @function
+GL_PREFIX(Color3ub):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 152(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 152(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 152(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 152(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(Color3ub), .-GL_PREFIX(Color3ub)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(Color3ubv)
+ .type GL_PREFIX(Color3ubv), @function
+GL_PREFIX(Color3ubv):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 160(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 160(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 160(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 160(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(Color3ubv), .-GL_PREFIX(Color3ubv)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(Color3ui)
+ .type GL_PREFIX(Color3ui), @function
+GL_PREFIX(Color3ui):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 168(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 168(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 168(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 168(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(Color3ui), .-GL_PREFIX(Color3ui)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(Color3uiv)
+ .type GL_PREFIX(Color3uiv), @function
+GL_PREFIX(Color3uiv):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 176(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 176(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 176(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 176(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(Color3uiv), .-GL_PREFIX(Color3uiv)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(Color3us)
+ .type GL_PREFIX(Color3us), @function
+GL_PREFIX(Color3us):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 184(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 184(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 184(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 184(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(Color3us), .-GL_PREFIX(Color3us)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(Color3usv)
+ .type GL_PREFIX(Color3usv), @function
+GL_PREFIX(Color3usv):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 192(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 192(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 192(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 192(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(Color3usv), .-GL_PREFIX(Color3usv)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(Color4b)
+ .type GL_PREFIX(Color4b), @function
+GL_PREFIX(Color4b):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 200(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 200(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 200(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 200(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(Color4b), .-GL_PREFIX(Color4b)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(Color4bv)
+ .type GL_PREFIX(Color4bv), @function
+GL_PREFIX(Color4bv):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 208(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 208(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 208(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 208(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(Color4bv), .-GL_PREFIX(Color4bv)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(Color4d)
+ .type GL_PREFIX(Color4d), @function
+GL_PREFIX(Color4d):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 216(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ subq $40, %rsp
+ movq %xmm0, (%rsp)
+ movq %xmm1, 8(%rsp)
+ movq %xmm2, 16(%rsp)
+ movq %xmm3, 24(%rsp)
+ call _x86_64_get_dispatch@PLT
+ movq 24(%rsp), %xmm3
+ movq 16(%rsp), %xmm2
+ movq 8(%rsp), %xmm1
+ movq (%rsp), %xmm0
+ addq $40, %rsp
+ movq 216(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 216(%rax), %r11
+ jmp *%r11
+1:
+ subq $40, %rsp
+ movq %xmm0, (%rsp)
+ movq %xmm1, 8(%rsp)
+ movq %xmm2, 16(%rsp)
+ movq %xmm3, 24(%rsp)
+ call _glapi_get_dispatch
+ movq 24(%rsp), %xmm3
+ movq 16(%rsp), %xmm2
+ movq 8(%rsp), %xmm1
+ movq (%rsp), %xmm0
+ addq $40, %rsp
+ movq 216(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(Color4d), .-GL_PREFIX(Color4d)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(Color4dv)
+ .type GL_PREFIX(Color4dv), @function
+GL_PREFIX(Color4dv):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 224(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 224(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 224(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 224(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(Color4dv), .-GL_PREFIX(Color4dv)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(Color4f)
+ .type GL_PREFIX(Color4f), @function
+GL_PREFIX(Color4f):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 232(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ subq $40, %rsp
+ movq %xmm0, (%rsp)
+ movq %xmm1, 8(%rsp)
+ movq %xmm2, 16(%rsp)
+ movq %xmm3, 24(%rsp)
+ call _x86_64_get_dispatch@PLT
+ movq 24(%rsp), %xmm3
+ movq 16(%rsp), %xmm2
+ movq 8(%rsp), %xmm1
+ movq (%rsp), %xmm0
+ addq $40, %rsp
+ movq 232(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 232(%rax), %r11
+ jmp *%r11
+1:
+ subq $40, %rsp
+ movq %xmm0, (%rsp)
+ movq %xmm1, 8(%rsp)
+ movq %xmm2, 16(%rsp)
+ movq %xmm3, 24(%rsp)
+ call _glapi_get_dispatch
+ movq 24(%rsp), %xmm3
+ movq 16(%rsp), %xmm2
+ movq 8(%rsp), %xmm1
+ movq (%rsp), %xmm0
+ addq $40, %rsp
+ movq 232(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(Color4f), .-GL_PREFIX(Color4f)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(Color4fv)
+ .type GL_PREFIX(Color4fv), @function
+GL_PREFIX(Color4fv):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 240(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 240(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 240(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 240(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(Color4fv), .-GL_PREFIX(Color4fv)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(Color4i)
+ .type GL_PREFIX(Color4i), @function
+GL_PREFIX(Color4i):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 248(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 248(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 248(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 248(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(Color4i), .-GL_PREFIX(Color4i)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(Color4iv)
+ .type GL_PREFIX(Color4iv), @function
+GL_PREFIX(Color4iv):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 256(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 256(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 256(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 256(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(Color4iv), .-GL_PREFIX(Color4iv)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(Color4s)
+ .type GL_PREFIX(Color4s), @function
+GL_PREFIX(Color4s):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 264(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 264(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 264(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 264(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(Color4s), .-GL_PREFIX(Color4s)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(Color4sv)
+ .type GL_PREFIX(Color4sv), @function
+GL_PREFIX(Color4sv):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 272(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 272(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 272(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 272(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(Color4sv), .-GL_PREFIX(Color4sv)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(Color4ub)
+ .type GL_PREFIX(Color4ub), @function
+GL_PREFIX(Color4ub):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 280(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 280(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 280(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 280(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(Color4ub), .-GL_PREFIX(Color4ub)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(Color4ubv)
+ .type GL_PREFIX(Color4ubv), @function
+GL_PREFIX(Color4ubv):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 288(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 288(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 288(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 288(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(Color4ubv), .-GL_PREFIX(Color4ubv)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(Color4ui)
+ .type GL_PREFIX(Color4ui), @function
+GL_PREFIX(Color4ui):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 296(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 296(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 296(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 296(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(Color4ui), .-GL_PREFIX(Color4ui)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(Color4uiv)
+ .type GL_PREFIX(Color4uiv), @function
+GL_PREFIX(Color4uiv):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 304(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 304(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 304(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 304(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(Color4uiv), .-GL_PREFIX(Color4uiv)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(Color4us)
+ .type GL_PREFIX(Color4us), @function
+GL_PREFIX(Color4us):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 312(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 312(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 312(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 312(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(Color4us), .-GL_PREFIX(Color4us)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(Color4usv)
+ .type GL_PREFIX(Color4usv), @function
+GL_PREFIX(Color4usv):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 320(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 320(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 320(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 320(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(Color4usv), .-GL_PREFIX(Color4usv)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(EdgeFlag)
+ .type GL_PREFIX(EdgeFlag), @function
+GL_PREFIX(EdgeFlag):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 328(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 328(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 328(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 328(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(EdgeFlag), .-GL_PREFIX(EdgeFlag)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(EdgeFlagv)
+ .type GL_PREFIX(EdgeFlagv), @function
+GL_PREFIX(EdgeFlagv):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 336(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 336(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 336(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 336(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(EdgeFlagv), .-GL_PREFIX(EdgeFlagv)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(End)
+ .type GL_PREFIX(End), @function
+GL_PREFIX(End):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 344(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ movq 344(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 344(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ movq 344(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(End), .-GL_PREFIX(End)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(Indexd)
+ .type GL_PREFIX(Indexd), @function
+GL_PREFIX(Indexd):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 352(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ subq $8, %rsp
+ movq %xmm0, (%rsp)
+ call _x86_64_get_dispatch@PLT
+ movq (%rsp), %xmm0
+ addq $8, %rsp
+ movq 352(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 352(%rax), %r11
+ jmp *%r11
+1:
+ subq $8, %rsp
+ movq %xmm0, (%rsp)
+ call _glapi_get_dispatch
+ movq (%rsp), %xmm0
+ addq $8, %rsp
+ movq 352(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(Indexd), .-GL_PREFIX(Indexd)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(Indexdv)
+ .type GL_PREFIX(Indexdv), @function
+GL_PREFIX(Indexdv):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 360(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 360(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 360(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 360(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(Indexdv), .-GL_PREFIX(Indexdv)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(Indexf)
+ .type GL_PREFIX(Indexf), @function
+GL_PREFIX(Indexf):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 368(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ subq $8, %rsp
+ movq %xmm0, (%rsp)
+ call _x86_64_get_dispatch@PLT
+ movq (%rsp), %xmm0
+ addq $8, %rsp
+ movq 368(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 368(%rax), %r11
+ jmp *%r11
+1:
+ subq $8, %rsp
+ movq %xmm0, (%rsp)
+ call _glapi_get_dispatch
+ movq (%rsp), %xmm0
+ addq $8, %rsp
+ movq 368(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(Indexf), .-GL_PREFIX(Indexf)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(Indexfv)
+ .type GL_PREFIX(Indexfv), @function
+GL_PREFIX(Indexfv):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 376(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 376(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 376(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 376(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(Indexfv), .-GL_PREFIX(Indexfv)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(Indexi)
+ .type GL_PREFIX(Indexi), @function
+GL_PREFIX(Indexi):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 384(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 384(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 384(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 384(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(Indexi), .-GL_PREFIX(Indexi)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(Indexiv)
+ .type GL_PREFIX(Indexiv), @function
+GL_PREFIX(Indexiv):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 392(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 392(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 392(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 392(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(Indexiv), .-GL_PREFIX(Indexiv)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(Indexs)
+ .type GL_PREFIX(Indexs), @function
+GL_PREFIX(Indexs):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 400(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 400(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 400(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 400(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(Indexs), .-GL_PREFIX(Indexs)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(Indexsv)
+ .type GL_PREFIX(Indexsv), @function
+GL_PREFIX(Indexsv):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 408(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 408(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 408(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 408(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(Indexsv), .-GL_PREFIX(Indexsv)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(Normal3b)
+ .type GL_PREFIX(Normal3b), @function
+GL_PREFIX(Normal3b):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 416(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 416(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 416(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 416(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(Normal3b), .-GL_PREFIX(Normal3b)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(Normal3bv)
+ .type GL_PREFIX(Normal3bv), @function
+GL_PREFIX(Normal3bv):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 424(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 424(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 424(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 424(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(Normal3bv), .-GL_PREFIX(Normal3bv)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(Normal3d)
+ .type GL_PREFIX(Normal3d), @function
+GL_PREFIX(Normal3d):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 432(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ subq $24, %rsp
+ movq %xmm0, (%rsp)
+ movq %xmm1, 8(%rsp)
+ movq %xmm2, 16(%rsp)
+ call _x86_64_get_dispatch@PLT
+ movq 16(%rsp), %xmm2
+ movq 8(%rsp), %xmm1
+ movq (%rsp), %xmm0
+ addq $24, %rsp
+ movq 432(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 432(%rax), %r11
+ jmp *%r11
+1:
+ subq $24, %rsp
+ movq %xmm0, (%rsp)
+ movq %xmm1, 8(%rsp)
+ movq %xmm2, 16(%rsp)
+ call _glapi_get_dispatch
+ movq 16(%rsp), %xmm2
+ movq 8(%rsp), %xmm1
+ movq (%rsp), %xmm0
+ addq $24, %rsp
+ movq 432(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(Normal3d), .-GL_PREFIX(Normal3d)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(Normal3dv)
+ .type GL_PREFIX(Normal3dv), @function
+GL_PREFIX(Normal3dv):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 440(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 440(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 440(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 440(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(Normal3dv), .-GL_PREFIX(Normal3dv)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(Normal3f)
+ .type GL_PREFIX(Normal3f), @function
+GL_PREFIX(Normal3f):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 448(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ subq $24, %rsp
+ movq %xmm0, (%rsp)
+ movq %xmm1, 8(%rsp)
+ movq %xmm2, 16(%rsp)
+ call _x86_64_get_dispatch@PLT
+ movq 16(%rsp), %xmm2
+ movq 8(%rsp), %xmm1
+ movq (%rsp), %xmm0
+ addq $24, %rsp
+ movq 448(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 448(%rax), %r11
+ jmp *%r11
+1:
+ subq $24, %rsp
+ movq %xmm0, (%rsp)
+ movq %xmm1, 8(%rsp)
+ movq %xmm2, 16(%rsp)
+ call _glapi_get_dispatch
+ movq 16(%rsp), %xmm2
+ movq 8(%rsp), %xmm1
+ movq (%rsp), %xmm0
+ addq $24, %rsp
+ movq 448(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(Normal3f), .-GL_PREFIX(Normal3f)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(Normal3fv)
+ .type GL_PREFIX(Normal3fv), @function
+GL_PREFIX(Normal3fv):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 456(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 456(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 456(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 456(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(Normal3fv), .-GL_PREFIX(Normal3fv)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(Normal3i)
+ .type GL_PREFIX(Normal3i), @function
+GL_PREFIX(Normal3i):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 464(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 464(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 464(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 464(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(Normal3i), .-GL_PREFIX(Normal3i)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(Normal3iv)
+ .type GL_PREFIX(Normal3iv), @function
+GL_PREFIX(Normal3iv):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 472(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 472(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 472(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 472(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(Normal3iv), .-GL_PREFIX(Normal3iv)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(Normal3s)
+ .type GL_PREFIX(Normal3s), @function
+GL_PREFIX(Normal3s):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 480(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 480(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 480(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 480(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(Normal3s), .-GL_PREFIX(Normal3s)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(Normal3sv)
+ .type GL_PREFIX(Normal3sv), @function
+GL_PREFIX(Normal3sv):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 488(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 488(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 488(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 488(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(Normal3sv), .-GL_PREFIX(Normal3sv)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(RasterPos2d)
+ .type GL_PREFIX(RasterPos2d), @function
+GL_PREFIX(RasterPos2d):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 496(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ subq $24, %rsp
+ movq %xmm0, (%rsp)
+ movq %xmm1, 8(%rsp)
+ call _x86_64_get_dispatch@PLT
+ movq 8(%rsp), %xmm1
+ movq (%rsp), %xmm0
+ addq $24, %rsp
+ movq 496(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 496(%rax), %r11
+ jmp *%r11
+1:
+ subq $24, %rsp
+ movq %xmm0, (%rsp)
+ movq %xmm1, 8(%rsp)
+ call _glapi_get_dispatch
+ movq 8(%rsp), %xmm1
+ movq (%rsp), %xmm0
+ addq $24, %rsp
+ movq 496(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(RasterPos2d), .-GL_PREFIX(RasterPos2d)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(RasterPos2dv)
+ .type GL_PREFIX(RasterPos2dv), @function
+GL_PREFIX(RasterPos2dv):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 504(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 504(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 504(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 504(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(RasterPos2dv), .-GL_PREFIX(RasterPos2dv)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(RasterPos2f)
+ .type GL_PREFIX(RasterPos2f), @function
+GL_PREFIX(RasterPos2f):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 512(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ subq $24, %rsp
+ movq %xmm0, (%rsp)
+ movq %xmm1, 8(%rsp)
+ call _x86_64_get_dispatch@PLT
+ movq 8(%rsp), %xmm1
+ movq (%rsp), %xmm0
+ addq $24, %rsp
+ movq 512(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 512(%rax), %r11
+ jmp *%r11
+1:
+ subq $24, %rsp
+ movq %xmm0, (%rsp)
+ movq %xmm1, 8(%rsp)
+ call _glapi_get_dispatch
+ movq 8(%rsp), %xmm1
+ movq (%rsp), %xmm0
+ addq $24, %rsp
+ movq 512(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(RasterPos2f), .-GL_PREFIX(RasterPos2f)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(RasterPos2fv)
+ .type GL_PREFIX(RasterPos2fv), @function
+GL_PREFIX(RasterPos2fv):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 520(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 520(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 520(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 520(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(RasterPos2fv), .-GL_PREFIX(RasterPos2fv)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(RasterPos2i)
+ .type GL_PREFIX(RasterPos2i), @function
+GL_PREFIX(RasterPos2i):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 528(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 528(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 528(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 528(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(RasterPos2i), .-GL_PREFIX(RasterPos2i)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(RasterPos2iv)
+ .type GL_PREFIX(RasterPos2iv), @function
+GL_PREFIX(RasterPos2iv):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 536(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 536(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 536(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 536(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(RasterPos2iv), .-GL_PREFIX(RasterPos2iv)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(RasterPos2s)
+ .type GL_PREFIX(RasterPos2s), @function
+GL_PREFIX(RasterPos2s):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 544(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 544(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 544(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 544(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(RasterPos2s), .-GL_PREFIX(RasterPos2s)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(RasterPos2sv)
+ .type GL_PREFIX(RasterPos2sv), @function
+GL_PREFIX(RasterPos2sv):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 552(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 552(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 552(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 552(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(RasterPos2sv), .-GL_PREFIX(RasterPos2sv)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(RasterPos3d)
+ .type GL_PREFIX(RasterPos3d), @function
+GL_PREFIX(RasterPos3d):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 560(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ subq $24, %rsp
+ movq %xmm0, (%rsp)
+ movq %xmm1, 8(%rsp)
+ movq %xmm2, 16(%rsp)
+ call _x86_64_get_dispatch@PLT
+ movq 16(%rsp), %xmm2
+ movq 8(%rsp), %xmm1
+ movq (%rsp), %xmm0
+ addq $24, %rsp
+ movq 560(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 560(%rax), %r11
+ jmp *%r11
+1:
+ subq $24, %rsp
+ movq %xmm0, (%rsp)
+ movq %xmm1, 8(%rsp)
+ movq %xmm2, 16(%rsp)
+ call _glapi_get_dispatch
+ movq 16(%rsp), %xmm2
+ movq 8(%rsp), %xmm1
+ movq (%rsp), %xmm0
+ addq $24, %rsp
+ movq 560(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(RasterPos3d), .-GL_PREFIX(RasterPos3d)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(RasterPos3dv)
+ .type GL_PREFIX(RasterPos3dv), @function
+GL_PREFIX(RasterPos3dv):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 568(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 568(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 568(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 568(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(RasterPos3dv), .-GL_PREFIX(RasterPos3dv)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(RasterPos3f)
+ .type GL_PREFIX(RasterPos3f), @function
+GL_PREFIX(RasterPos3f):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 576(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ subq $24, %rsp
+ movq %xmm0, (%rsp)
+ movq %xmm1, 8(%rsp)
+ movq %xmm2, 16(%rsp)
+ call _x86_64_get_dispatch@PLT
+ movq 16(%rsp), %xmm2
+ movq 8(%rsp), %xmm1
+ movq (%rsp), %xmm0
+ addq $24, %rsp
+ movq 576(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 576(%rax), %r11
+ jmp *%r11
+1:
+ subq $24, %rsp
+ movq %xmm0, (%rsp)
+ movq %xmm1, 8(%rsp)
+ movq %xmm2, 16(%rsp)
+ call _glapi_get_dispatch
+ movq 16(%rsp), %xmm2
+ movq 8(%rsp), %xmm1
+ movq (%rsp), %xmm0
+ addq $24, %rsp
+ movq 576(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(RasterPos3f), .-GL_PREFIX(RasterPos3f)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(RasterPos3fv)
+ .type GL_PREFIX(RasterPos3fv), @function
+GL_PREFIX(RasterPos3fv):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 584(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 584(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 584(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 584(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(RasterPos3fv), .-GL_PREFIX(RasterPos3fv)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(RasterPos3i)
+ .type GL_PREFIX(RasterPos3i), @function
+GL_PREFIX(RasterPos3i):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 592(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 592(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 592(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 592(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(RasterPos3i), .-GL_PREFIX(RasterPos3i)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(RasterPos3iv)
+ .type GL_PREFIX(RasterPos3iv), @function
+GL_PREFIX(RasterPos3iv):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 600(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 600(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 600(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 600(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(RasterPos3iv), .-GL_PREFIX(RasterPos3iv)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(RasterPos3s)
+ .type GL_PREFIX(RasterPos3s), @function
+GL_PREFIX(RasterPos3s):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 608(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 608(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 608(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 608(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(RasterPos3s), .-GL_PREFIX(RasterPos3s)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(RasterPos3sv)
+ .type GL_PREFIX(RasterPos3sv), @function
+GL_PREFIX(RasterPos3sv):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 616(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 616(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 616(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 616(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(RasterPos3sv), .-GL_PREFIX(RasterPos3sv)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(RasterPos4d)
+ .type GL_PREFIX(RasterPos4d), @function
+GL_PREFIX(RasterPos4d):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 624(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ subq $40, %rsp
+ movq %xmm0, (%rsp)
+ movq %xmm1, 8(%rsp)
+ movq %xmm2, 16(%rsp)
+ movq %xmm3, 24(%rsp)
+ call _x86_64_get_dispatch@PLT
+ movq 24(%rsp), %xmm3
+ movq 16(%rsp), %xmm2
+ movq 8(%rsp), %xmm1
+ movq (%rsp), %xmm0
+ addq $40, %rsp
+ movq 624(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 624(%rax), %r11
+ jmp *%r11
+1:
+ subq $40, %rsp
+ movq %xmm0, (%rsp)
+ movq %xmm1, 8(%rsp)
+ movq %xmm2, 16(%rsp)
+ movq %xmm3, 24(%rsp)
+ call _glapi_get_dispatch
+ movq 24(%rsp), %xmm3
+ movq 16(%rsp), %xmm2
+ movq 8(%rsp), %xmm1
+ movq (%rsp), %xmm0
+ addq $40, %rsp
+ movq 624(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(RasterPos4d), .-GL_PREFIX(RasterPos4d)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(RasterPos4dv)
+ .type GL_PREFIX(RasterPos4dv), @function
+GL_PREFIX(RasterPos4dv):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 632(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 632(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 632(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 632(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(RasterPos4dv), .-GL_PREFIX(RasterPos4dv)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(RasterPos4f)
+ .type GL_PREFIX(RasterPos4f), @function
+GL_PREFIX(RasterPos4f):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 640(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ subq $40, %rsp
+ movq %xmm0, (%rsp)
+ movq %xmm1, 8(%rsp)
+ movq %xmm2, 16(%rsp)
+ movq %xmm3, 24(%rsp)
+ call _x86_64_get_dispatch@PLT
+ movq 24(%rsp), %xmm3
+ movq 16(%rsp), %xmm2
+ movq 8(%rsp), %xmm1
+ movq (%rsp), %xmm0
+ addq $40, %rsp
+ movq 640(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 640(%rax), %r11
+ jmp *%r11
+1:
+ subq $40, %rsp
+ movq %xmm0, (%rsp)
+ movq %xmm1, 8(%rsp)
+ movq %xmm2, 16(%rsp)
+ movq %xmm3, 24(%rsp)
+ call _glapi_get_dispatch
+ movq 24(%rsp), %xmm3
+ movq 16(%rsp), %xmm2
+ movq 8(%rsp), %xmm1
+ movq (%rsp), %xmm0
+ addq $40, %rsp
+ movq 640(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(RasterPos4f), .-GL_PREFIX(RasterPos4f)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(RasterPos4fv)
+ .type GL_PREFIX(RasterPos4fv), @function
+GL_PREFIX(RasterPos4fv):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 648(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 648(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 648(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 648(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(RasterPos4fv), .-GL_PREFIX(RasterPos4fv)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(RasterPos4i)
+ .type GL_PREFIX(RasterPos4i), @function
+GL_PREFIX(RasterPos4i):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 656(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 656(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 656(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 656(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(RasterPos4i), .-GL_PREFIX(RasterPos4i)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(RasterPos4iv)
+ .type GL_PREFIX(RasterPos4iv), @function
+GL_PREFIX(RasterPos4iv):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 664(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 664(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 664(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 664(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(RasterPos4iv), .-GL_PREFIX(RasterPos4iv)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(RasterPos4s)
+ .type GL_PREFIX(RasterPos4s), @function
+GL_PREFIX(RasterPos4s):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 672(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 672(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 672(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 672(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(RasterPos4s), .-GL_PREFIX(RasterPos4s)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(RasterPos4sv)
+ .type GL_PREFIX(RasterPos4sv), @function
+GL_PREFIX(RasterPos4sv):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 680(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 680(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 680(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 680(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(RasterPos4sv), .-GL_PREFIX(RasterPos4sv)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(Rectd)
+ .type GL_PREFIX(Rectd), @function
+GL_PREFIX(Rectd):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 688(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ subq $40, %rsp
+ movq %xmm0, (%rsp)
+ movq %xmm1, 8(%rsp)
+ movq %xmm2, 16(%rsp)
+ movq %xmm3, 24(%rsp)
+ call _x86_64_get_dispatch@PLT
+ movq 24(%rsp), %xmm3
+ movq 16(%rsp), %xmm2
+ movq 8(%rsp), %xmm1
+ movq (%rsp), %xmm0
+ addq $40, %rsp
+ movq 688(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 688(%rax), %r11
+ jmp *%r11
+1:
+ subq $40, %rsp
+ movq %xmm0, (%rsp)
+ movq %xmm1, 8(%rsp)
+ movq %xmm2, 16(%rsp)
+ movq %xmm3, 24(%rsp)
+ call _glapi_get_dispatch
+ movq 24(%rsp), %xmm3
+ movq 16(%rsp), %xmm2
+ movq 8(%rsp), %xmm1
+ movq (%rsp), %xmm0
+ addq $40, %rsp
+ movq 688(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(Rectd), .-GL_PREFIX(Rectd)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(Rectdv)
+ .type GL_PREFIX(Rectdv), @function
+GL_PREFIX(Rectdv):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 696(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 696(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 696(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 696(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(Rectdv), .-GL_PREFIX(Rectdv)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(Rectf)
+ .type GL_PREFIX(Rectf), @function
+GL_PREFIX(Rectf):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 704(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ subq $40, %rsp
+ movq %xmm0, (%rsp)
+ movq %xmm1, 8(%rsp)
+ movq %xmm2, 16(%rsp)
+ movq %xmm3, 24(%rsp)
+ call _x86_64_get_dispatch@PLT
+ movq 24(%rsp), %xmm3
+ movq 16(%rsp), %xmm2
+ movq 8(%rsp), %xmm1
+ movq (%rsp), %xmm0
+ addq $40, %rsp
+ movq 704(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 704(%rax), %r11
+ jmp *%r11
+1:
+ subq $40, %rsp
+ movq %xmm0, (%rsp)
+ movq %xmm1, 8(%rsp)
+ movq %xmm2, 16(%rsp)
+ movq %xmm3, 24(%rsp)
+ call _glapi_get_dispatch
+ movq 24(%rsp), %xmm3
+ movq 16(%rsp), %xmm2
+ movq 8(%rsp), %xmm1
+ movq (%rsp), %xmm0
+ addq $40, %rsp
+ movq 704(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(Rectf), .-GL_PREFIX(Rectf)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(Rectfv)
+ .type GL_PREFIX(Rectfv), @function
+GL_PREFIX(Rectfv):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 712(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 712(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 712(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 712(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(Rectfv), .-GL_PREFIX(Rectfv)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(Recti)
+ .type GL_PREFIX(Recti), @function
+GL_PREFIX(Recti):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 720(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 720(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 720(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 720(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(Recti), .-GL_PREFIX(Recti)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(Rectiv)
+ .type GL_PREFIX(Rectiv), @function
+GL_PREFIX(Rectiv):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 728(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 728(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 728(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 728(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(Rectiv), .-GL_PREFIX(Rectiv)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(Rects)
+ .type GL_PREFIX(Rects), @function
+GL_PREFIX(Rects):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 736(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 736(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 736(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 736(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(Rects), .-GL_PREFIX(Rects)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(Rectsv)
+ .type GL_PREFIX(Rectsv), @function
+GL_PREFIX(Rectsv):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 744(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 744(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 744(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 744(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(Rectsv), .-GL_PREFIX(Rectsv)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(TexCoord1d)
+ .type GL_PREFIX(TexCoord1d), @function
+GL_PREFIX(TexCoord1d):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 752(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ subq $8, %rsp
+ movq %xmm0, (%rsp)
+ call _x86_64_get_dispatch@PLT
+ movq (%rsp), %xmm0
+ addq $8, %rsp
+ movq 752(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 752(%rax), %r11
+ jmp *%r11
+1:
+ subq $8, %rsp
+ movq %xmm0, (%rsp)
+ call _glapi_get_dispatch
+ movq (%rsp), %xmm0
+ addq $8, %rsp
+ movq 752(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(TexCoord1d), .-GL_PREFIX(TexCoord1d)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(TexCoord1dv)
+ .type GL_PREFIX(TexCoord1dv), @function
+GL_PREFIX(TexCoord1dv):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 760(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 760(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 760(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 760(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(TexCoord1dv), .-GL_PREFIX(TexCoord1dv)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(TexCoord1f)
+ .type GL_PREFIX(TexCoord1f), @function
+GL_PREFIX(TexCoord1f):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 768(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ subq $8, %rsp
+ movq %xmm0, (%rsp)
+ call _x86_64_get_dispatch@PLT
+ movq (%rsp), %xmm0
+ addq $8, %rsp
+ movq 768(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 768(%rax), %r11
+ jmp *%r11
+1:
+ subq $8, %rsp
+ movq %xmm0, (%rsp)
+ call _glapi_get_dispatch
+ movq (%rsp), %xmm0
+ addq $8, %rsp
+ movq 768(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(TexCoord1f), .-GL_PREFIX(TexCoord1f)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(TexCoord1fv)
+ .type GL_PREFIX(TexCoord1fv), @function
+GL_PREFIX(TexCoord1fv):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 776(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 776(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 776(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 776(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(TexCoord1fv), .-GL_PREFIX(TexCoord1fv)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(TexCoord1i)
+ .type GL_PREFIX(TexCoord1i), @function
+GL_PREFIX(TexCoord1i):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 784(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 784(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 784(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 784(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(TexCoord1i), .-GL_PREFIX(TexCoord1i)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(TexCoord1iv)
+ .type GL_PREFIX(TexCoord1iv), @function
+GL_PREFIX(TexCoord1iv):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 792(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 792(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 792(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 792(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(TexCoord1iv), .-GL_PREFIX(TexCoord1iv)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(TexCoord1s)
+ .type GL_PREFIX(TexCoord1s), @function
+GL_PREFIX(TexCoord1s):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 800(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 800(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 800(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 800(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(TexCoord1s), .-GL_PREFIX(TexCoord1s)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(TexCoord1sv)
+ .type GL_PREFIX(TexCoord1sv), @function
+GL_PREFIX(TexCoord1sv):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 808(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 808(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 808(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 808(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(TexCoord1sv), .-GL_PREFIX(TexCoord1sv)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(TexCoord2d)
+ .type GL_PREFIX(TexCoord2d), @function
+GL_PREFIX(TexCoord2d):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 816(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ subq $24, %rsp
+ movq %xmm0, (%rsp)
+ movq %xmm1, 8(%rsp)
+ call _x86_64_get_dispatch@PLT
+ movq 8(%rsp), %xmm1
+ movq (%rsp), %xmm0
+ addq $24, %rsp
+ movq 816(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 816(%rax), %r11
+ jmp *%r11
+1:
+ subq $24, %rsp
+ movq %xmm0, (%rsp)
+ movq %xmm1, 8(%rsp)
+ call _glapi_get_dispatch
+ movq 8(%rsp), %xmm1
+ movq (%rsp), %xmm0
+ addq $24, %rsp
+ movq 816(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(TexCoord2d), .-GL_PREFIX(TexCoord2d)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(TexCoord2dv)
+ .type GL_PREFIX(TexCoord2dv), @function
+GL_PREFIX(TexCoord2dv):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 824(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 824(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 824(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 824(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(TexCoord2dv), .-GL_PREFIX(TexCoord2dv)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(TexCoord2f)
+ .type GL_PREFIX(TexCoord2f), @function
+GL_PREFIX(TexCoord2f):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 832(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ subq $24, %rsp
+ movq %xmm0, (%rsp)
+ movq %xmm1, 8(%rsp)
+ call _x86_64_get_dispatch@PLT
+ movq 8(%rsp), %xmm1
+ movq (%rsp), %xmm0
+ addq $24, %rsp
+ movq 832(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 832(%rax), %r11
+ jmp *%r11
+1:
+ subq $24, %rsp
+ movq %xmm0, (%rsp)
+ movq %xmm1, 8(%rsp)
+ call _glapi_get_dispatch
+ movq 8(%rsp), %xmm1
+ movq (%rsp), %xmm0
+ addq $24, %rsp
+ movq 832(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(TexCoord2f), .-GL_PREFIX(TexCoord2f)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(TexCoord2fv)
+ .type GL_PREFIX(TexCoord2fv), @function
+GL_PREFIX(TexCoord2fv):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 840(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 840(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 840(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 840(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(TexCoord2fv), .-GL_PREFIX(TexCoord2fv)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(TexCoord2i)
+ .type GL_PREFIX(TexCoord2i), @function
+GL_PREFIX(TexCoord2i):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 848(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 848(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 848(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 848(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(TexCoord2i), .-GL_PREFIX(TexCoord2i)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(TexCoord2iv)
+ .type GL_PREFIX(TexCoord2iv), @function
+GL_PREFIX(TexCoord2iv):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 856(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 856(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 856(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 856(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(TexCoord2iv), .-GL_PREFIX(TexCoord2iv)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(TexCoord2s)
+ .type GL_PREFIX(TexCoord2s), @function
+GL_PREFIX(TexCoord2s):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 864(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 864(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 864(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 864(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(TexCoord2s), .-GL_PREFIX(TexCoord2s)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(TexCoord2sv)
+ .type GL_PREFIX(TexCoord2sv), @function
+GL_PREFIX(TexCoord2sv):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 872(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 872(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 872(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 872(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(TexCoord2sv), .-GL_PREFIX(TexCoord2sv)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(TexCoord3d)
+ .type GL_PREFIX(TexCoord3d), @function
+GL_PREFIX(TexCoord3d):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 880(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ subq $24, %rsp
+ movq %xmm0, (%rsp)
+ movq %xmm1, 8(%rsp)
+ movq %xmm2, 16(%rsp)
+ call _x86_64_get_dispatch@PLT
+ movq 16(%rsp), %xmm2
+ movq 8(%rsp), %xmm1
+ movq (%rsp), %xmm0
+ addq $24, %rsp
+ movq 880(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 880(%rax), %r11
+ jmp *%r11
+1:
+ subq $24, %rsp
+ movq %xmm0, (%rsp)
+ movq %xmm1, 8(%rsp)
+ movq %xmm2, 16(%rsp)
+ call _glapi_get_dispatch
+ movq 16(%rsp), %xmm2
+ movq 8(%rsp), %xmm1
+ movq (%rsp), %xmm0
+ addq $24, %rsp
+ movq 880(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(TexCoord3d), .-GL_PREFIX(TexCoord3d)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(TexCoord3dv)
+ .type GL_PREFIX(TexCoord3dv), @function
+GL_PREFIX(TexCoord3dv):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 888(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 888(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 888(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 888(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(TexCoord3dv), .-GL_PREFIX(TexCoord3dv)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(TexCoord3f)
+ .type GL_PREFIX(TexCoord3f), @function
+GL_PREFIX(TexCoord3f):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 896(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ subq $24, %rsp
+ movq %xmm0, (%rsp)
+ movq %xmm1, 8(%rsp)
+ movq %xmm2, 16(%rsp)
+ call _x86_64_get_dispatch@PLT
+ movq 16(%rsp), %xmm2
+ movq 8(%rsp), %xmm1
+ movq (%rsp), %xmm0
+ addq $24, %rsp
+ movq 896(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 896(%rax), %r11
+ jmp *%r11
+1:
+ subq $24, %rsp
+ movq %xmm0, (%rsp)
+ movq %xmm1, 8(%rsp)
+ movq %xmm2, 16(%rsp)
+ call _glapi_get_dispatch
+ movq 16(%rsp), %xmm2
+ movq 8(%rsp), %xmm1
+ movq (%rsp), %xmm0
+ addq $24, %rsp
+ movq 896(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(TexCoord3f), .-GL_PREFIX(TexCoord3f)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(TexCoord3fv)
+ .type GL_PREFIX(TexCoord3fv), @function
+GL_PREFIX(TexCoord3fv):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 904(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 904(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 904(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 904(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(TexCoord3fv), .-GL_PREFIX(TexCoord3fv)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(TexCoord3i)
+ .type GL_PREFIX(TexCoord3i), @function
+GL_PREFIX(TexCoord3i):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 912(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 912(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 912(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 912(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(TexCoord3i), .-GL_PREFIX(TexCoord3i)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(TexCoord3iv)
+ .type GL_PREFIX(TexCoord3iv), @function
+GL_PREFIX(TexCoord3iv):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 920(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 920(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 920(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 920(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(TexCoord3iv), .-GL_PREFIX(TexCoord3iv)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(TexCoord3s)
+ .type GL_PREFIX(TexCoord3s), @function
+GL_PREFIX(TexCoord3s):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 928(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 928(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 928(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 928(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(TexCoord3s), .-GL_PREFIX(TexCoord3s)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(TexCoord3sv)
+ .type GL_PREFIX(TexCoord3sv), @function
+GL_PREFIX(TexCoord3sv):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 936(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 936(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 936(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 936(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(TexCoord3sv), .-GL_PREFIX(TexCoord3sv)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(TexCoord4d)
+ .type GL_PREFIX(TexCoord4d), @function
+GL_PREFIX(TexCoord4d):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 944(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ subq $40, %rsp
+ movq %xmm0, (%rsp)
+ movq %xmm1, 8(%rsp)
+ movq %xmm2, 16(%rsp)
+ movq %xmm3, 24(%rsp)
+ call _x86_64_get_dispatch@PLT
+ movq 24(%rsp), %xmm3
+ movq 16(%rsp), %xmm2
+ movq 8(%rsp), %xmm1
+ movq (%rsp), %xmm0
+ addq $40, %rsp
+ movq 944(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 944(%rax), %r11
+ jmp *%r11
+1:
+ subq $40, %rsp
+ movq %xmm0, (%rsp)
+ movq %xmm1, 8(%rsp)
+ movq %xmm2, 16(%rsp)
+ movq %xmm3, 24(%rsp)
+ call _glapi_get_dispatch
+ movq 24(%rsp), %xmm3
+ movq 16(%rsp), %xmm2
+ movq 8(%rsp), %xmm1
+ movq (%rsp), %xmm0
+ addq $40, %rsp
+ movq 944(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(TexCoord4d), .-GL_PREFIX(TexCoord4d)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(TexCoord4dv)
+ .type GL_PREFIX(TexCoord4dv), @function
+GL_PREFIX(TexCoord4dv):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 952(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 952(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 952(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 952(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(TexCoord4dv), .-GL_PREFIX(TexCoord4dv)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(TexCoord4f)
+ .type GL_PREFIX(TexCoord4f), @function
+GL_PREFIX(TexCoord4f):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 960(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ subq $40, %rsp
+ movq %xmm0, (%rsp)
+ movq %xmm1, 8(%rsp)
+ movq %xmm2, 16(%rsp)
+ movq %xmm3, 24(%rsp)
+ call _x86_64_get_dispatch@PLT
+ movq 24(%rsp), %xmm3
+ movq 16(%rsp), %xmm2
+ movq 8(%rsp), %xmm1
+ movq (%rsp), %xmm0
+ addq $40, %rsp
+ movq 960(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 960(%rax), %r11
+ jmp *%r11
+1:
+ subq $40, %rsp
+ movq %xmm0, (%rsp)
+ movq %xmm1, 8(%rsp)
+ movq %xmm2, 16(%rsp)
+ movq %xmm3, 24(%rsp)
+ call _glapi_get_dispatch
+ movq 24(%rsp), %xmm3
+ movq 16(%rsp), %xmm2
+ movq 8(%rsp), %xmm1
+ movq (%rsp), %xmm0
+ addq $40, %rsp
+ movq 960(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(TexCoord4f), .-GL_PREFIX(TexCoord4f)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(TexCoord4fv)
+ .type GL_PREFIX(TexCoord4fv), @function
+GL_PREFIX(TexCoord4fv):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 968(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 968(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 968(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 968(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(TexCoord4fv), .-GL_PREFIX(TexCoord4fv)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(TexCoord4i)
+ .type GL_PREFIX(TexCoord4i), @function
+GL_PREFIX(TexCoord4i):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 976(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 976(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 976(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 976(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(TexCoord4i), .-GL_PREFIX(TexCoord4i)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(TexCoord4iv)
+ .type GL_PREFIX(TexCoord4iv), @function
+GL_PREFIX(TexCoord4iv):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 984(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 984(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 984(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 984(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(TexCoord4iv), .-GL_PREFIX(TexCoord4iv)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(TexCoord4s)
+ .type GL_PREFIX(TexCoord4s), @function
+GL_PREFIX(TexCoord4s):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 992(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 992(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 992(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 992(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(TexCoord4s), .-GL_PREFIX(TexCoord4s)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(TexCoord4sv)
+ .type GL_PREFIX(TexCoord4sv), @function
+GL_PREFIX(TexCoord4sv):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 1000(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 1000(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 1000(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 1000(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(TexCoord4sv), .-GL_PREFIX(TexCoord4sv)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(Vertex2d)
+ .type GL_PREFIX(Vertex2d), @function
+GL_PREFIX(Vertex2d):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 1008(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ subq $24, %rsp
+ movq %xmm0, (%rsp)
+ movq %xmm1, 8(%rsp)
+ call _x86_64_get_dispatch@PLT
+ movq 8(%rsp), %xmm1
+ movq (%rsp), %xmm0
+ addq $24, %rsp
+ movq 1008(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 1008(%rax), %r11
+ jmp *%r11
+1:
+ subq $24, %rsp
+ movq %xmm0, (%rsp)
+ movq %xmm1, 8(%rsp)
+ call _glapi_get_dispatch
+ movq 8(%rsp), %xmm1
+ movq (%rsp), %xmm0
+ addq $24, %rsp
+ movq 1008(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(Vertex2d), .-GL_PREFIX(Vertex2d)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(Vertex2dv)
+ .type GL_PREFIX(Vertex2dv), @function
+GL_PREFIX(Vertex2dv):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 1016(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 1016(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 1016(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 1016(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(Vertex2dv), .-GL_PREFIX(Vertex2dv)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(Vertex2f)
+ .type GL_PREFIX(Vertex2f), @function
+GL_PREFIX(Vertex2f):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 1024(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ subq $24, %rsp
+ movq %xmm0, (%rsp)
+ movq %xmm1, 8(%rsp)
+ call _x86_64_get_dispatch@PLT
+ movq 8(%rsp), %xmm1
+ movq (%rsp), %xmm0
+ addq $24, %rsp
+ movq 1024(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 1024(%rax), %r11
+ jmp *%r11
+1:
+ subq $24, %rsp
+ movq %xmm0, (%rsp)
+ movq %xmm1, 8(%rsp)
+ call _glapi_get_dispatch
+ movq 8(%rsp), %xmm1
+ movq (%rsp), %xmm0
+ addq $24, %rsp
+ movq 1024(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(Vertex2f), .-GL_PREFIX(Vertex2f)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(Vertex2fv)
+ .type GL_PREFIX(Vertex2fv), @function
+GL_PREFIX(Vertex2fv):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 1032(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 1032(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 1032(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 1032(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(Vertex2fv), .-GL_PREFIX(Vertex2fv)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(Vertex2i)
+ .type GL_PREFIX(Vertex2i), @function
+GL_PREFIX(Vertex2i):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 1040(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 1040(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 1040(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 1040(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(Vertex2i), .-GL_PREFIX(Vertex2i)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(Vertex2iv)
+ .type GL_PREFIX(Vertex2iv), @function
+GL_PREFIX(Vertex2iv):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 1048(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 1048(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 1048(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 1048(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(Vertex2iv), .-GL_PREFIX(Vertex2iv)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(Vertex2s)
+ .type GL_PREFIX(Vertex2s), @function
+GL_PREFIX(Vertex2s):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 1056(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 1056(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 1056(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 1056(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(Vertex2s), .-GL_PREFIX(Vertex2s)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(Vertex2sv)
+ .type GL_PREFIX(Vertex2sv), @function
+GL_PREFIX(Vertex2sv):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 1064(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 1064(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 1064(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 1064(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(Vertex2sv), .-GL_PREFIX(Vertex2sv)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(Vertex3d)
+ .type GL_PREFIX(Vertex3d), @function
+GL_PREFIX(Vertex3d):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 1072(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ subq $24, %rsp
+ movq %xmm0, (%rsp)
+ movq %xmm1, 8(%rsp)
+ movq %xmm2, 16(%rsp)
+ call _x86_64_get_dispatch@PLT
+ movq 16(%rsp), %xmm2
+ movq 8(%rsp), %xmm1
+ movq (%rsp), %xmm0
+ addq $24, %rsp
+ movq 1072(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 1072(%rax), %r11
+ jmp *%r11
+1:
+ subq $24, %rsp
+ movq %xmm0, (%rsp)
+ movq %xmm1, 8(%rsp)
+ movq %xmm2, 16(%rsp)
+ call _glapi_get_dispatch
+ movq 16(%rsp), %xmm2
+ movq 8(%rsp), %xmm1
+ movq (%rsp), %xmm0
+ addq $24, %rsp
+ movq 1072(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(Vertex3d), .-GL_PREFIX(Vertex3d)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(Vertex3dv)
+ .type GL_PREFIX(Vertex3dv), @function
+GL_PREFIX(Vertex3dv):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 1080(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 1080(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 1080(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 1080(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(Vertex3dv), .-GL_PREFIX(Vertex3dv)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(Vertex3f)
+ .type GL_PREFIX(Vertex3f), @function
+GL_PREFIX(Vertex3f):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 1088(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ subq $24, %rsp
+ movq %xmm0, (%rsp)
+ movq %xmm1, 8(%rsp)
+ movq %xmm2, 16(%rsp)
+ call _x86_64_get_dispatch@PLT
+ movq 16(%rsp), %xmm2
+ movq 8(%rsp), %xmm1
+ movq (%rsp), %xmm0
+ addq $24, %rsp
+ movq 1088(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 1088(%rax), %r11
+ jmp *%r11
+1:
+ subq $24, %rsp
+ movq %xmm0, (%rsp)
+ movq %xmm1, 8(%rsp)
+ movq %xmm2, 16(%rsp)
+ call _glapi_get_dispatch
+ movq 16(%rsp), %xmm2
+ movq 8(%rsp), %xmm1
+ movq (%rsp), %xmm0
+ addq $24, %rsp
+ movq 1088(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(Vertex3f), .-GL_PREFIX(Vertex3f)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(Vertex3fv)
+ .type GL_PREFIX(Vertex3fv), @function
+GL_PREFIX(Vertex3fv):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 1096(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 1096(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 1096(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 1096(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(Vertex3fv), .-GL_PREFIX(Vertex3fv)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(Vertex3i)
+ .type GL_PREFIX(Vertex3i), @function
+GL_PREFIX(Vertex3i):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 1104(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 1104(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 1104(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 1104(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(Vertex3i), .-GL_PREFIX(Vertex3i)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(Vertex3iv)
+ .type GL_PREFIX(Vertex3iv), @function
+GL_PREFIX(Vertex3iv):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 1112(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 1112(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 1112(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 1112(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(Vertex3iv), .-GL_PREFIX(Vertex3iv)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(Vertex3s)
+ .type GL_PREFIX(Vertex3s), @function
+GL_PREFIX(Vertex3s):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 1120(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 1120(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 1120(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 1120(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(Vertex3s), .-GL_PREFIX(Vertex3s)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(Vertex3sv)
+ .type GL_PREFIX(Vertex3sv), @function
+GL_PREFIX(Vertex3sv):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 1128(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 1128(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 1128(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 1128(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(Vertex3sv), .-GL_PREFIX(Vertex3sv)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(Vertex4d)
+ .type GL_PREFIX(Vertex4d), @function
+GL_PREFIX(Vertex4d):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 1136(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ subq $40, %rsp
+ movq %xmm0, (%rsp)
+ movq %xmm1, 8(%rsp)
+ movq %xmm2, 16(%rsp)
+ movq %xmm3, 24(%rsp)
+ call _x86_64_get_dispatch@PLT
+ movq 24(%rsp), %xmm3
+ movq 16(%rsp), %xmm2
+ movq 8(%rsp), %xmm1
+ movq (%rsp), %xmm0
+ addq $40, %rsp
+ movq 1136(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 1136(%rax), %r11
+ jmp *%r11
+1:
+ subq $40, %rsp
+ movq %xmm0, (%rsp)
+ movq %xmm1, 8(%rsp)
+ movq %xmm2, 16(%rsp)
+ movq %xmm3, 24(%rsp)
+ call _glapi_get_dispatch
+ movq 24(%rsp), %xmm3
+ movq 16(%rsp), %xmm2
+ movq 8(%rsp), %xmm1
+ movq (%rsp), %xmm0
+ addq $40, %rsp
+ movq 1136(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(Vertex4d), .-GL_PREFIX(Vertex4d)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(Vertex4dv)
+ .type GL_PREFIX(Vertex4dv), @function
+GL_PREFIX(Vertex4dv):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 1144(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 1144(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 1144(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 1144(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(Vertex4dv), .-GL_PREFIX(Vertex4dv)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(Vertex4f)
+ .type GL_PREFIX(Vertex4f), @function
+GL_PREFIX(Vertex4f):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 1152(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ subq $40, %rsp
+ movq %xmm0, (%rsp)
+ movq %xmm1, 8(%rsp)
+ movq %xmm2, 16(%rsp)
+ movq %xmm3, 24(%rsp)
+ call _x86_64_get_dispatch@PLT
+ movq 24(%rsp), %xmm3
+ movq 16(%rsp), %xmm2
+ movq 8(%rsp), %xmm1
+ movq (%rsp), %xmm0
+ addq $40, %rsp
+ movq 1152(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 1152(%rax), %r11
+ jmp *%r11
+1:
+ subq $40, %rsp
+ movq %xmm0, (%rsp)
+ movq %xmm1, 8(%rsp)
+ movq %xmm2, 16(%rsp)
+ movq %xmm3, 24(%rsp)
+ call _glapi_get_dispatch
+ movq 24(%rsp), %xmm3
+ movq 16(%rsp), %xmm2
+ movq 8(%rsp), %xmm1
+ movq (%rsp), %xmm0
+ addq $40, %rsp
+ movq 1152(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(Vertex4f), .-GL_PREFIX(Vertex4f)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(Vertex4fv)
+ .type GL_PREFIX(Vertex4fv), @function
+GL_PREFIX(Vertex4fv):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 1160(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 1160(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 1160(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 1160(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(Vertex4fv), .-GL_PREFIX(Vertex4fv)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(Vertex4i)
+ .type GL_PREFIX(Vertex4i), @function
+GL_PREFIX(Vertex4i):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 1168(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 1168(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 1168(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 1168(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(Vertex4i), .-GL_PREFIX(Vertex4i)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(Vertex4iv)
+ .type GL_PREFIX(Vertex4iv), @function
+GL_PREFIX(Vertex4iv):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 1176(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 1176(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 1176(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 1176(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(Vertex4iv), .-GL_PREFIX(Vertex4iv)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(Vertex4s)
+ .type GL_PREFIX(Vertex4s), @function
+GL_PREFIX(Vertex4s):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 1184(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 1184(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 1184(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 1184(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(Vertex4s), .-GL_PREFIX(Vertex4s)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(Vertex4sv)
+ .type GL_PREFIX(Vertex4sv), @function
+GL_PREFIX(Vertex4sv):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 1192(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 1192(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 1192(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 1192(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(Vertex4sv), .-GL_PREFIX(Vertex4sv)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(ClipPlane)
+ .type GL_PREFIX(ClipPlane), @function
+GL_PREFIX(ClipPlane):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 1200(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 1200(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 1200(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 1200(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(ClipPlane), .-GL_PREFIX(ClipPlane)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(ColorMaterial)
+ .type GL_PREFIX(ColorMaterial), @function
+GL_PREFIX(ColorMaterial):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 1208(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 1208(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 1208(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 1208(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(ColorMaterial), .-GL_PREFIX(ColorMaterial)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(CullFace)
+ .type GL_PREFIX(CullFace), @function
+GL_PREFIX(CullFace):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 1216(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 1216(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 1216(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 1216(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(CullFace), .-GL_PREFIX(CullFace)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(Fogf)
+ .type GL_PREFIX(Fogf), @function
+GL_PREFIX(Fogf):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 1224(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ subq $24, %rsp
+ movq %rdi, (%rsp)
+ movq %xmm0, 8(%rsp)
+ call _x86_64_get_dispatch@PLT
+ movq 8(%rsp), %xmm0
+ movq (%rsp), %rdi
+ addq $24, %rsp
+ movq 1224(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 1224(%rax), %r11
+ jmp *%r11
+1:
+ subq $24, %rsp
+ movq %rdi, (%rsp)
+ movq %xmm0, 8(%rsp)
+ call _glapi_get_dispatch
+ movq 8(%rsp), %xmm0
+ movq (%rsp), %rdi
+ addq $24, %rsp
+ movq 1224(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(Fogf), .-GL_PREFIX(Fogf)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(Fogfv)
+ .type GL_PREFIX(Fogfv), @function
+GL_PREFIX(Fogfv):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 1232(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 1232(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 1232(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 1232(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(Fogfv), .-GL_PREFIX(Fogfv)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(Fogi)
+ .type GL_PREFIX(Fogi), @function
+GL_PREFIX(Fogi):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 1240(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 1240(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 1240(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 1240(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(Fogi), .-GL_PREFIX(Fogi)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(Fogiv)
+ .type GL_PREFIX(Fogiv), @function
+GL_PREFIX(Fogiv):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 1248(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 1248(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 1248(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 1248(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(Fogiv), .-GL_PREFIX(Fogiv)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(FrontFace)
+ .type GL_PREFIX(FrontFace), @function
+GL_PREFIX(FrontFace):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 1256(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 1256(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 1256(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 1256(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(FrontFace), .-GL_PREFIX(FrontFace)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(Hint)
+ .type GL_PREFIX(Hint), @function
+GL_PREFIX(Hint):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 1264(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 1264(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 1264(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 1264(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(Hint), .-GL_PREFIX(Hint)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(Lightf)
+ .type GL_PREFIX(Lightf), @function
+GL_PREFIX(Lightf):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 1272(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ subq $24, %rsp
+ movq %rdi, (%rsp)
+ movq %rsi, 8(%rsp)
+ movq %xmm0, 16(%rsp)
+ call _x86_64_get_dispatch@PLT
+ movq 16(%rsp), %xmm0
+ movq 8(%rsp), %rsi
+ movq (%rsp), %rdi
+ addq $24, %rsp
+ movq 1272(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 1272(%rax), %r11
+ jmp *%r11
+1:
+ subq $24, %rsp
+ movq %rdi, (%rsp)
+ movq %rsi, 8(%rsp)
+ movq %xmm0, 16(%rsp)
+ call _glapi_get_dispatch
+ movq 16(%rsp), %xmm0
+ movq 8(%rsp), %rsi
+ movq (%rsp), %rdi
+ addq $24, %rsp
+ movq 1272(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(Lightf), .-GL_PREFIX(Lightf)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(Lightfv)
+ .type GL_PREFIX(Lightfv), @function
+GL_PREFIX(Lightfv):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 1280(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 1280(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 1280(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 1280(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(Lightfv), .-GL_PREFIX(Lightfv)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(Lighti)
+ .type GL_PREFIX(Lighti), @function
+GL_PREFIX(Lighti):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 1288(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 1288(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 1288(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 1288(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(Lighti), .-GL_PREFIX(Lighti)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(Lightiv)
+ .type GL_PREFIX(Lightiv), @function
+GL_PREFIX(Lightiv):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 1296(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 1296(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 1296(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 1296(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(Lightiv), .-GL_PREFIX(Lightiv)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(LightModelf)
+ .type GL_PREFIX(LightModelf), @function
+GL_PREFIX(LightModelf):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 1304(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ subq $24, %rsp
+ movq %rdi, (%rsp)
+ movq %xmm0, 8(%rsp)
+ call _x86_64_get_dispatch@PLT
+ movq 8(%rsp), %xmm0
+ movq (%rsp), %rdi
+ addq $24, %rsp
+ movq 1304(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 1304(%rax), %r11
+ jmp *%r11
+1:
+ subq $24, %rsp
+ movq %rdi, (%rsp)
+ movq %xmm0, 8(%rsp)
+ call _glapi_get_dispatch
+ movq 8(%rsp), %xmm0
+ movq (%rsp), %rdi
+ addq $24, %rsp
+ movq 1304(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(LightModelf), .-GL_PREFIX(LightModelf)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(LightModelfv)
+ .type GL_PREFIX(LightModelfv), @function
+GL_PREFIX(LightModelfv):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 1312(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 1312(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 1312(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 1312(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(LightModelfv), .-GL_PREFIX(LightModelfv)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(LightModeli)
+ .type GL_PREFIX(LightModeli), @function
+GL_PREFIX(LightModeli):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 1320(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 1320(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 1320(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 1320(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(LightModeli), .-GL_PREFIX(LightModeli)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(LightModeliv)
+ .type GL_PREFIX(LightModeliv), @function
+GL_PREFIX(LightModeliv):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 1328(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 1328(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 1328(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 1328(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(LightModeliv), .-GL_PREFIX(LightModeliv)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(LineStipple)
+ .type GL_PREFIX(LineStipple), @function
+GL_PREFIX(LineStipple):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 1336(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 1336(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 1336(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 1336(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(LineStipple), .-GL_PREFIX(LineStipple)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(LineWidth)
+ .type GL_PREFIX(LineWidth), @function
+GL_PREFIX(LineWidth):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 1344(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ subq $8, %rsp
+ movq %xmm0, (%rsp)
+ call _x86_64_get_dispatch@PLT
+ movq (%rsp), %xmm0
+ addq $8, %rsp
+ movq 1344(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 1344(%rax), %r11
+ jmp *%r11
+1:
+ subq $8, %rsp
+ movq %xmm0, (%rsp)
+ call _glapi_get_dispatch
+ movq (%rsp), %xmm0
+ addq $8, %rsp
+ movq 1344(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(LineWidth), .-GL_PREFIX(LineWidth)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(Materialf)
+ .type GL_PREFIX(Materialf), @function
+GL_PREFIX(Materialf):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 1352(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ subq $24, %rsp
+ movq %rdi, (%rsp)
+ movq %rsi, 8(%rsp)
+ movq %xmm0, 16(%rsp)
+ call _x86_64_get_dispatch@PLT
+ movq 16(%rsp), %xmm0
+ movq 8(%rsp), %rsi
+ movq (%rsp), %rdi
+ addq $24, %rsp
+ movq 1352(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 1352(%rax), %r11
+ jmp *%r11
+1:
+ subq $24, %rsp
+ movq %rdi, (%rsp)
+ movq %rsi, 8(%rsp)
+ movq %xmm0, 16(%rsp)
+ call _glapi_get_dispatch
+ movq 16(%rsp), %xmm0
+ movq 8(%rsp), %rsi
+ movq (%rsp), %rdi
+ addq $24, %rsp
+ movq 1352(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(Materialf), .-GL_PREFIX(Materialf)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(Materialfv)
+ .type GL_PREFIX(Materialfv), @function
+GL_PREFIX(Materialfv):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 1360(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 1360(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 1360(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 1360(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(Materialfv), .-GL_PREFIX(Materialfv)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(Materiali)
+ .type GL_PREFIX(Materiali), @function
+GL_PREFIX(Materiali):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 1368(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 1368(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 1368(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 1368(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(Materiali), .-GL_PREFIX(Materiali)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(Materialiv)
+ .type GL_PREFIX(Materialiv), @function
+GL_PREFIX(Materialiv):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 1376(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 1376(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 1376(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 1376(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(Materialiv), .-GL_PREFIX(Materialiv)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(PointSize)
+ .type GL_PREFIX(PointSize), @function
+GL_PREFIX(PointSize):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 1384(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ subq $8, %rsp
+ movq %xmm0, (%rsp)
+ call _x86_64_get_dispatch@PLT
+ movq (%rsp), %xmm0
+ addq $8, %rsp
+ movq 1384(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 1384(%rax), %r11
+ jmp *%r11
+1:
+ subq $8, %rsp
+ movq %xmm0, (%rsp)
+ call _glapi_get_dispatch
+ movq (%rsp), %xmm0
+ addq $8, %rsp
+ movq 1384(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(PointSize), .-GL_PREFIX(PointSize)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(PolygonMode)
+ .type GL_PREFIX(PolygonMode), @function
+GL_PREFIX(PolygonMode):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 1392(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 1392(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 1392(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 1392(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(PolygonMode), .-GL_PREFIX(PolygonMode)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(PolygonStipple)
+ .type GL_PREFIX(PolygonStipple), @function
+GL_PREFIX(PolygonStipple):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 1400(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 1400(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 1400(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 1400(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(PolygonStipple), .-GL_PREFIX(PolygonStipple)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(Scissor)
+ .type GL_PREFIX(Scissor), @function
+GL_PREFIX(Scissor):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 1408(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 1408(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 1408(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 1408(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(Scissor), .-GL_PREFIX(Scissor)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(ShadeModel)
+ .type GL_PREFIX(ShadeModel), @function
+GL_PREFIX(ShadeModel):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 1416(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 1416(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 1416(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 1416(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(ShadeModel), .-GL_PREFIX(ShadeModel)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(TexParameterf)
+ .type GL_PREFIX(TexParameterf), @function
+GL_PREFIX(TexParameterf):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 1424(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ subq $24, %rsp
+ movq %rdi, (%rsp)
+ movq %rsi, 8(%rsp)
+ movq %xmm0, 16(%rsp)
+ call _x86_64_get_dispatch@PLT
+ movq 16(%rsp), %xmm0
+ movq 8(%rsp), %rsi
+ movq (%rsp), %rdi
+ addq $24, %rsp
+ movq 1424(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 1424(%rax), %r11
+ jmp *%r11
+1:
+ subq $24, %rsp
+ movq %rdi, (%rsp)
+ movq %rsi, 8(%rsp)
+ movq %xmm0, 16(%rsp)
+ call _glapi_get_dispatch
+ movq 16(%rsp), %xmm0
+ movq 8(%rsp), %rsi
+ movq (%rsp), %rdi
+ addq $24, %rsp
+ movq 1424(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(TexParameterf), .-GL_PREFIX(TexParameterf)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(TexParameterfv)
+ .type GL_PREFIX(TexParameterfv), @function
+GL_PREFIX(TexParameterfv):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 1432(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 1432(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 1432(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 1432(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(TexParameterfv), .-GL_PREFIX(TexParameterfv)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(TexParameteri)
+ .type GL_PREFIX(TexParameteri), @function
+GL_PREFIX(TexParameteri):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 1440(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 1440(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 1440(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 1440(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(TexParameteri), .-GL_PREFIX(TexParameteri)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(TexParameteriv)
+ .type GL_PREFIX(TexParameteriv), @function
+GL_PREFIX(TexParameteriv):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 1448(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 1448(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 1448(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 1448(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(TexParameteriv), .-GL_PREFIX(TexParameteriv)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(TexImage1D)
+ .type GL_PREFIX(TexImage1D), @function
+GL_PREFIX(TexImage1D):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 1456(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ pushq %r9
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %r9
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 1456(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 1456(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ pushq %r9
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %r9
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 1456(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(TexImage1D), .-GL_PREFIX(TexImage1D)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(TexImage2D)
+ .type GL_PREFIX(TexImage2D), @function
+GL_PREFIX(TexImage2D):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 1464(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ pushq %r9
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %r9
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 1464(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 1464(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ pushq %r9
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %r9
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 1464(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(TexImage2D), .-GL_PREFIX(TexImage2D)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(TexEnvf)
+ .type GL_PREFIX(TexEnvf), @function
+GL_PREFIX(TexEnvf):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 1472(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ subq $24, %rsp
+ movq %rdi, (%rsp)
+ movq %rsi, 8(%rsp)
+ movq %xmm0, 16(%rsp)
+ call _x86_64_get_dispatch@PLT
+ movq 16(%rsp), %xmm0
+ movq 8(%rsp), %rsi
+ movq (%rsp), %rdi
+ addq $24, %rsp
+ movq 1472(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 1472(%rax), %r11
+ jmp *%r11
+1:
+ subq $24, %rsp
+ movq %rdi, (%rsp)
+ movq %rsi, 8(%rsp)
+ movq %xmm0, 16(%rsp)
+ call _glapi_get_dispatch
+ movq 16(%rsp), %xmm0
+ movq 8(%rsp), %rsi
+ movq (%rsp), %rdi
+ addq $24, %rsp
+ movq 1472(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(TexEnvf), .-GL_PREFIX(TexEnvf)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(TexEnvfv)
+ .type GL_PREFIX(TexEnvfv), @function
+GL_PREFIX(TexEnvfv):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 1480(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 1480(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 1480(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 1480(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(TexEnvfv), .-GL_PREFIX(TexEnvfv)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(TexEnvi)
+ .type GL_PREFIX(TexEnvi), @function
+GL_PREFIX(TexEnvi):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 1488(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 1488(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 1488(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 1488(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(TexEnvi), .-GL_PREFIX(TexEnvi)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(TexEnviv)
+ .type GL_PREFIX(TexEnviv), @function
+GL_PREFIX(TexEnviv):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 1496(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 1496(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 1496(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 1496(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(TexEnviv), .-GL_PREFIX(TexEnviv)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(TexGend)
+ .type GL_PREFIX(TexGend), @function
+GL_PREFIX(TexGend):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 1504(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ subq $24, %rsp
+ movq %rdi, (%rsp)
+ movq %rsi, 8(%rsp)
+ movq %xmm0, 16(%rsp)
+ call _x86_64_get_dispatch@PLT
+ movq 16(%rsp), %xmm0
+ movq 8(%rsp), %rsi
+ movq (%rsp), %rdi
+ addq $24, %rsp
+ movq 1504(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 1504(%rax), %r11
+ jmp *%r11
+1:
+ subq $24, %rsp
+ movq %rdi, (%rsp)
+ movq %rsi, 8(%rsp)
+ movq %xmm0, 16(%rsp)
+ call _glapi_get_dispatch
+ movq 16(%rsp), %xmm0
+ movq 8(%rsp), %rsi
+ movq (%rsp), %rdi
+ addq $24, %rsp
+ movq 1504(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(TexGend), .-GL_PREFIX(TexGend)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(TexGendv)
+ .type GL_PREFIX(TexGendv), @function
+GL_PREFIX(TexGendv):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 1512(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 1512(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 1512(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 1512(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(TexGendv), .-GL_PREFIX(TexGendv)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(TexGenf)
+ .type GL_PREFIX(TexGenf), @function
+GL_PREFIX(TexGenf):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 1520(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ subq $24, %rsp
+ movq %rdi, (%rsp)
+ movq %rsi, 8(%rsp)
+ movq %xmm0, 16(%rsp)
+ call _x86_64_get_dispatch@PLT
+ movq 16(%rsp), %xmm0
+ movq 8(%rsp), %rsi
+ movq (%rsp), %rdi
+ addq $24, %rsp
+ movq 1520(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 1520(%rax), %r11
+ jmp *%r11
+1:
+ subq $24, %rsp
+ movq %rdi, (%rsp)
+ movq %rsi, 8(%rsp)
+ movq %xmm0, 16(%rsp)
+ call _glapi_get_dispatch
+ movq 16(%rsp), %xmm0
+ movq 8(%rsp), %rsi
+ movq (%rsp), %rdi
+ addq $24, %rsp
+ movq 1520(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(TexGenf), .-GL_PREFIX(TexGenf)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(TexGenfv)
+ .type GL_PREFIX(TexGenfv), @function
+GL_PREFIX(TexGenfv):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 1528(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 1528(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 1528(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 1528(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(TexGenfv), .-GL_PREFIX(TexGenfv)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(TexGeni)
+ .type GL_PREFIX(TexGeni), @function
+GL_PREFIX(TexGeni):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 1536(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 1536(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 1536(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 1536(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(TexGeni), .-GL_PREFIX(TexGeni)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(TexGeniv)
+ .type GL_PREFIX(TexGeniv), @function
+GL_PREFIX(TexGeniv):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 1544(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 1544(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 1544(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 1544(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(TexGeniv), .-GL_PREFIX(TexGeniv)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(FeedbackBuffer)
+ .type GL_PREFIX(FeedbackBuffer), @function
+GL_PREFIX(FeedbackBuffer):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 1552(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 1552(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 1552(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 1552(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(FeedbackBuffer), .-GL_PREFIX(FeedbackBuffer)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(SelectBuffer)
+ .type GL_PREFIX(SelectBuffer), @function
+GL_PREFIX(SelectBuffer):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 1560(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 1560(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 1560(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 1560(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(SelectBuffer), .-GL_PREFIX(SelectBuffer)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(RenderMode)
+ .type GL_PREFIX(RenderMode), @function
+GL_PREFIX(RenderMode):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 1568(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 1568(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 1568(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 1568(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(RenderMode), .-GL_PREFIX(RenderMode)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(InitNames)
+ .type GL_PREFIX(InitNames), @function
+GL_PREFIX(InitNames):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 1576(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ movq 1576(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 1576(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ movq 1576(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(InitNames), .-GL_PREFIX(InitNames)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(LoadName)
+ .type GL_PREFIX(LoadName), @function
+GL_PREFIX(LoadName):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 1584(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 1584(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 1584(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 1584(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(LoadName), .-GL_PREFIX(LoadName)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(PassThrough)
+ .type GL_PREFIX(PassThrough), @function
+GL_PREFIX(PassThrough):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 1592(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ subq $8, %rsp
+ movq %xmm0, (%rsp)
+ call _x86_64_get_dispatch@PLT
+ movq (%rsp), %xmm0
+ addq $8, %rsp
+ movq 1592(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 1592(%rax), %r11
+ jmp *%r11
+1:
+ subq $8, %rsp
+ movq %xmm0, (%rsp)
+ call _glapi_get_dispatch
+ movq (%rsp), %xmm0
+ addq $8, %rsp
+ movq 1592(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(PassThrough), .-GL_PREFIX(PassThrough)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(PopName)
+ .type GL_PREFIX(PopName), @function
+GL_PREFIX(PopName):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 1600(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ movq 1600(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 1600(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ movq 1600(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(PopName), .-GL_PREFIX(PopName)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(PushName)
+ .type GL_PREFIX(PushName), @function
+GL_PREFIX(PushName):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 1608(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 1608(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 1608(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 1608(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(PushName), .-GL_PREFIX(PushName)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(DrawBuffer)
+ .type GL_PREFIX(DrawBuffer), @function
+GL_PREFIX(DrawBuffer):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 1616(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 1616(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 1616(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 1616(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(DrawBuffer), .-GL_PREFIX(DrawBuffer)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(Clear)
+ .type GL_PREFIX(Clear), @function
+GL_PREFIX(Clear):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 1624(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 1624(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 1624(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 1624(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(Clear), .-GL_PREFIX(Clear)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(ClearAccum)
+ .type GL_PREFIX(ClearAccum), @function
+GL_PREFIX(ClearAccum):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 1632(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ subq $40, %rsp
+ movq %xmm0, (%rsp)
+ movq %xmm1, 8(%rsp)
+ movq %xmm2, 16(%rsp)
+ movq %xmm3, 24(%rsp)
+ call _x86_64_get_dispatch@PLT
+ movq 24(%rsp), %xmm3
+ movq 16(%rsp), %xmm2
+ movq 8(%rsp), %xmm1
+ movq (%rsp), %xmm0
+ addq $40, %rsp
+ movq 1632(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 1632(%rax), %r11
+ jmp *%r11
+1:
+ subq $40, %rsp
+ movq %xmm0, (%rsp)
+ movq %xmm1, 8(%rsp)
+ movq %xmm2, 16(%rsp)
+ movq %xmm3, 24(%rsp)
+ call _glapi_get_dispatch
+ movq 24(%rsp), %xmm3
+ movq 16(%rsp), %xmm2
+ movq 8(%rsp), %xmm1
+ movq (%rsp), %xmm0
+ addq $40, %rsp
+ movq 1632(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(ClearAccum), .-GL_PREFIX(ClearAccum)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(ClearIndex)
+ .type GL_PREFIX(ClearIndex), @function
+GL_PREFIX(ClearIndex):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 1640(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ subq $8, %rsp
+ movq %xmm0, (%rsp)
+ call _x86_64_get_dispatch@PLT
+ movq (%rsp), %xmm0
+ addq $8, %rsp
+ movq 1640(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 1640(%rax), %r11
+ jmp *%r11
+1:
+ subq $8, %rsp
+ movq %xmm0, (%rsp)
+ call _glapi_get_dispatch
+ movq (%rsp), %xmm0
+ addq $8, %rsp
+ movq 1640(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(ClearIndex), .-GL_PREFIX(ClearIndex)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(ClearColor)
+ .type GL_PREFIX(ClearColor), @function
+GL_PREFIX(ClearColor):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 1648(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 1648(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 1648(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 1648(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(ClearColor), .-GL_PREFIX(ClearColor)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(ClearStencil)
+ .type GL_PREFIX(ClearStencil), @function
+GL_PREFIX(ClearStencil):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 1656(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 1656(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 1656(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 1656(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(ClearStencil), .-GL_PREFIX(ClearStencil)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(ClearDepth)
+ .type GL_PREFIX(ClearDepth), @function
+GL_PREFIX(ClearDepth):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 1664(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 1664(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 1664(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 1664(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(ClearDepth), .-GL_PREFIX(ClearDepth)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(StencilMask)
+ .type GL_PREFIX(StencilMask), @function
+GL_PREFIX(StencilMask):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 1672(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 1672(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 1672(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 1672(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(StencilMask), .-GL_PREFIX(StencilMask)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(ColorMask)
+ .type GL_PREFIX(ColorMask), @function
+GL_PREFIX(ColorMask):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 1680(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 1680(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 1680(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 1680(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(ColorMask), .-GL_PREFIX(ColorMask)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(DepthMask)
+ .type GL_PREFIX(DepthMask), @function
+GL_PREFIX(DepthMask):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 1688(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 1688(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 1688(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 1688(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(DepthMask), .-GL_PREFIX(DepthMask)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(IndexMask)
+ .type GL_PREFIX(IndexMask), @function
+GL_PREFIX(IndexMask):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 1696(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 1696(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 1696(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 1696(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(IndexMask), .-GL_PREFIX(IndexMask)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(Accum)
+ .type GL_PREFIX(Accum), @function
+GL_PREFIX(Accum):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 1704(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ subq $24, %rsp
+ movq %rdi, (%rsp)
+ movq %xmm0, 8(%rsp)
+ call _x86_64_get_dispatch@PLT
+ movq 8(%rsp), %xmm0
+ movq (%rsp), %rdi
+ addq $24, %rsp
+ movq 1704(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 1704(%rax), %r11
+ jmp *%r11
+1:
+ subq $24, %rsp
+ movq %rdi, (%rsp)
+ movq %xmm0, 8(%rsp)
+ call _glapi_get_dispatch
+ movq 8(%rsp), %xmm0
+ movq (%rsp), %rdi
+ addq $24, %rsp
+ movq 1704(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(Accum), .-GL_PREFIX(Accum)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(Disable)
+ .type GL_PREFIX(Disable), @function
+GL_PREFIX(Disable):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 1712(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 1712(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 1712(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 1712(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(Disable), .-GL_PREFIX(Disable)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(Enable)
+ .type GL_PREFIX(Enable), @function
+GL_PREFIX(Enable):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 1720(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 1720(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 1720(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 1720(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(Enable), .-GL_PREFIX(Enable)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(Finish)
+ .type GL_PREFIX(Finish), @function
+GL_PREFIX(Finish):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 1728(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ movq 1728(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 1728(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ movq 1728(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(Finish), .-GL_PREFIX(Finish)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(Flush)
+ .type GL_PREFIX(Flush), @function
+GL_PREFIX(Flush):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 1736(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ movq 1736(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 1736(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ movq 1736(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(Flush), .-GL_PREFIX(Flush)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(PopAttrib)
+ .type GL_PREFIX(PopAttrib), @function
+GL_PREFIX(PopAttrib):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 1744(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ movq 1744(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 1744(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ movq 1744(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(PopAttrib), .-GL_PREFIX(PopAttrib)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(PushAttrib)
+ .type GL_PREFIX(PushAttrib), @function
+GL_PREFIX(PushAttrib):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 1752(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 1752(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 1752(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 1752(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(PushAttrib), .-GL_PREFIX(PushAttrib)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(Map1d)
+ .type GL_PREFIX(Map1d), @function
+GL_PREFIX(Map1d):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 1760(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ subq $56, %rsp
+ movq %rdi, (%rsp)
+ movq %xmm0, 8(%rsp)
+ movq %xmm1, 16(%rsp)
+ movq %rsi, 24(%rsp)
+ movq %rdx, 32(%rsp)
+ movq %rcx, 40(%rsp)
+ call _x86_64_get_dispatch@PLT
+ movq 40(%rsp), %rcx
+ movq 32(%rsp), %rdx
+ movq 24(%rsp), %rsi
+ movq 16(%rsp), %xmm1
+ movq 8(%rsp), %xmm0
+ movq (%rsp), %rdi
+ addq $56, %rsp
+ movq 1760(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 1760(%rax), %r11
+ jmp *%r11
+1:
+ subq $56, %rsp
+ movq %rdi, (%rsp)
+ movq %xmm0, 8(%rsp)
+ movq %xmm1, 16(%rsp)
+ movq %rsi, 24(%rsp)
+ movq %rdx, 32(%rsp)
+ movq %rcx, 40(%rsp)
+ call _glapi_get_dispatch
+ movq 40(%rsp), %rcx
+ movq 32(%rsp), %rdx
+ movq 24(%rsp), %rsi
+ movq 16(%rsp), %xmm1
+ movq 8(%rsp), %xmm0
+ movq (%rsp), %rdi
+ addq $56, %rsp
+ movq 1760(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(Map1d), .-GL_PREFIX(Map1d)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(Map1f)
+ .type GL_PREFIX(Map1f), @function
+GL_PREFIX(Map1f):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 1768(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ subq $56, %rsp
+ movq %rdi, (%rsp)
+ movq %xmm0, 8(%rsp)
+ movq %xmm1, 16(%rsp)
+ movq %rsi, 24(%rsp)
+ movq %rdx, 32(%rsp)
+ movq %rcx, 40(%rsp)
+ call _x86_64_get_dispatch@PLT
+ movq 40(%rsp), %rcx
+ movq 32(%rsp), %rdx
+ movq 24(%rsp), %rsi
+ movq 16(%rsp), %xmm1
+ movq 8(%rsp), %xmm0
+ movq (%rsp), %rdi
+ addq $56, %rsp
+ movq 1768(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 1768(%rax), %r11
+ jmp *%r11
+1:
+ subq $56, %rsp
+ movq %rdi, (%rsp)
+ movq %xmm0, 8(%rsp)
+ movq %xmm1, 16(%rsp)
+ movq %rsi, 24(%rsp)
+ movq %rdx, 32(%rsp)
+ movq %rcx, 40(%rsp)
+ call _glapi_get_dispatch
+ movq 40(%rsp), %rcx
+ movq 32(%rsp), %rdx
+ movq 24(%rsp), %rsi
+ movq 16(%rsp), %xmm1
+ movq 8(%rsp), %xmm0
+ movq (%rsp), %rdi
+ addq $56, %rsp
+ movq 1768(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(Map1f), .-GL_PREFIX(Map1f)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(Map2d)
+ .type GL_PREFIX(Map2d), @function
+GL_PREFIX(Map2d):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 1776(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ subq $88, %rsp
+ movq %rdi, (%rsp)
+ movq %xmm0, 8(%rsp)
+ movq %xmm1, 16(%rsp)
+ movq %rsi, 24(%rsp)
+ movq %rdx, 32(%rsp)
+ movq %xmm2, 40(%rsp)
+ movq %xmm3, 48(%rsp)
+ movq %rcx, 56(%rsp)
+ movq %r8, 64(%rsp)
+ movq %r9, 72(%rsp)
+ call _x86_64_get_dispatch@PLT
+ movq 72(%rsp), %r9
+ movq 64(%rsp), %r8
+ movq 56(%rsp), %rcx
+ movq 48(%rsp), %xmm3
+ movq 40(%rsp), %xmm2
+ movq 32(%rsp), %rdx
+ movq 24(%rsp), %rsi
+ movq 16(%rsp), %xmm1
+ movq 8(%rsp), %xmm0
+ movq (%rsp), %rdi
+ addq $88, %rsp
+ movq 1776(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 1776(%rax), %r11
+ jmp *%r11
+1:
+ subq $88, %rsp
+ movq %rdi, (%rsp)
+ movq %xmm0, 8(%rsp)
+ movq %xmm1, 16(%rsp)
+ movq %rsi, 24(%rsp)
+ movq %rdx, 32(%rsp)
+ movq %xmm2, 40(%rsp)
+ movq %xmm3, 48(%rsp)
+ movq %rcx, 56(%rsp)
+ movq %r8, 64(%rsp)
+ movq %r9, 72(%rsp)
+ call _glapi_get_dispatch
+ movq 72(%rsp), %r9
+ movq 64(%rsp), %r8
+ movq 56(%rsp), %rcx
+ movq 48(%rsp), %xmm3
+ movq 40(%rsp), %xmm2
+ movq 32(%rsp), %rdx
+ movq 24(%rsp), %rsi
+ movq 16(%rsp), %xmm1
+ movq 8(%rsp), %xmm0
+ movq (%rsp), %rdi
+ addq $88, %rsp
+ movq 1776(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(Map2d), .-GL_PREFIX(Map2d)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(Map2f)
+ .type GL_PREFIX(Map2f), @function
+GL_PREFIX(Map2f):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 1784(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ subq $88, %rsp
+ movq %rdi, (%rsp)
+ movq %xmm0, 8(%rsp)
+ movq %xmm1, 16(%rsp)
+ movq %rsi, 24(%rsp)
+ movq %rdx, 32(%rsp)
+ movq %xmm2, 40(%rsp)
+ movq %xmm3, 48(%rsp)
+ movq %rcx, 56(%rsp)
+ movq %r8, 64(%rsp)
+ movq %r9, 72(%rsp)
+ call _x86_64_get_dispatch@PLT
+ movq 72(%rsp), %r9
+ movq 64(%rsp), %r8
+ movq 56(%rsp), %rcx
+ movq 48(%rsp), %xmm3
+ movq 40(%rsp), %xmm2
+ movq 32(%rsp), %rdx
+ movq 24(%rsp), %rsi
+ movq 16(%rsp), %xmm1
+ movq 8(%rsp), %xmm0
+ movq (%rsp), %rdi
+ addq $88, %rsp
+ movq 1784(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 1784(%rax), %r11
+ jmp *%r11
+1:
+ subq $88, %rsp
+ movq %rdi, (%rsp)
+ movq %xmm0, 8(%rsp)
+ movq %xmm1, 16(%rsp)
+ movq %rsi, 24(%rsp)
+ movq %rdx, 32(%rsp)
+ movq %xmm2, 40(%rsp)
+ movq %xmm3, 48(%rsp)
+ movq %rcx, 56(%rsp)
+ movq %r8, 64(%rsp)
+ movq %r9, 72(%rsp)
+ call _glapi_get_dispatch
+ movq 72(%rsp), %r9
+ movq 64(%rsp), %r8
+ movq 56(%rsp), %rcx
+ movq 48(%rsp), %xmm3
+ movq 40(%rsp), %xmm2
+ movq 32(%rsp), %rdx
+ movq 24(%rsp), %rsi
+ movq 16(%rsp), %xmm1
+ movq 8(%rsp), %xmm0
+ movq (%rsp), %rdi
+ addq $88, %rsp
+ movq 1784(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(Map2f), .-GL_PREFIX(Map2f)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(MapGrid1d)
+ .type GL_PREFIX(MapGrid1d), @function
+GL_PREFIX(MapGrid1d):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 1792(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ subq $24, %rsp
+ movq %rdi, (%rsp)
+ movq %xmm0, 8(%rsp)
+ movq %xmm1, 16(%rsp)
+ call _x86_64_get_dispatch@PLT
+ movq 16(%rsp), %xmm1
+ movq 8(%rsp), %xmm0
+ movq (%rsp), %rdi
+ addq $24, %rsp
+ movq 1792(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 1792(%rax), %r11
+ jmp *%r11
+1:
+ subq $24, %rsp
+ movq %rdi, (%rsp)
+ movq %xmm0, 8(%rsp)
+ movq %xmm1, 16(%rsp)
+ call _glapi_get_dispatch
+ movq 16(%rsp), %xmm1
+ movq 8(%rsp), %xmm0
+ movq (%rsp), %rdi
+ addq $24, %rsp
+ movq 1792(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(MapGrid1d), .-GL_PREFIX(MapGrid1d)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(MapGrid1f)
+ .type GL_PREFIX(MapGrid1f), @function
+GL_PREFIX(MapGrid1f):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 1800(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ subq $24, %rsp
+ movq %rdi, (%rsp)
+ movq %xmm0, 8(%rsp)
+ movq %xmm1, 16(%rsp)
+ call _x86_64_get_dispatch@PLT
+ movq 16(%rsp), %xmm1
+ movq 8(%rsp), %xmm0
+ movq (%rsp), %rdi
+ addq $24, %rsp
+ movq 1800(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 1800(%rax), %r11
+ jmp *%r11
+1:
+ subq $24, %rsp
+ movq %rdi, (%rsp)
+ movq %xmm0, 8(%rsp)
+ movq %xmm1, 16(%rsp)
+ call _glapi_get_dispatch
+ movq 16(%rsp), %xmm1
+ movq 8(%rsp), %xmm0
+ movq (%rsp), %rdi
+ addq $24, %rsp
+ movq 1800(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(MapGrid1f), .-GL_PREFIX(MapGrid1f)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(MapGrid2d)
+ .type GL_PREFIX(MapGrid2d), @function
+GL_PREFIX(MapGrid2d):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 1808(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ subq $56, %rsp
+ movq %rdi, (%rsp)
+ movq %xmm0, 8(%rsp)
+ movq %xmm1, 16(%rsp)
+ movq %rsi, 24(%rsp)
+ movq %xmm2, 32(%rsp)
+ movq %xmm3, 40(%rsp)
+ call _x86_64_get_dispatch@PLT
+ movq 40(%rsp), %xmm3
+ movq 32(%rsp), %xmm2
+ movq 24(%rsp), %rsi
+ movq 16(%rsp), %xmm1
+ movq 8(%rsp), %xmm0
+ movq (%rsp), %rdi
+ addq $56, %rsp
+ movq 1808(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 1808(%rax), %r11
+ jmp *%r11
+1:
+ subq $56, %rsp
+ movq %rdi, (%rsp)
+ movq %xmm0, 8(%rsp)
+ movq %xmm1, 16(%rsp)
+ movq %rsi, 24(%rsp)
+ movq %xmm2, 32(%rsp)
+ movq %xmm3, 40(%rsp)
+ call _glapi_get_dispatch
+ movq 40(%rsp), %xmm3
+ movq 32(%rsp), %xmm2
+ movq 24(%rsp), %rsi
+ movq 16(%rsp), %xmm1
+ movq 8(%rsp), %xmm0
+ movq (%rsp), %rdi
+ addq $56, %rsp
+ movq 1808(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(MapGrid2d), .-GL_PREFIX(MapGrid2d)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(MapGrid2f)
+ .type GL_PREFIX(MapGrid2f), @function
+GL_PREFIX(MapGrid2f):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 1816(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ subq $56, %rsp
+ movq %rdi, (%rsp)
+ movq %xmm0, 8(%rsp)
+ movq %xmm1, 16(%rsp)
+ movq %rsi, 24(%rsp)
+ movq %xmm2, 32(%rsp)
+ movq %xmm3, 40(%rsp)
+ call _x86_64_get_dispatch@PLT
+ movq 40(%rsp), %xmm3
+ movq 32(%rsp), %xmm2
+ movq 24(%rsp), %rsi
+ movq 16(%rsp), %xmm1
+ movq 8(%rsp), %xmm0
+ movq (%rsp), %rdi
+ addq $56, %rsp
+ movq 1816(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 1816(%rax), %r11
+ jmp *%r11
+1:
+ subq $56, %rsp
+ movq %rdi, (%rsp)
+ movq %xmm0, 8(%rsp)
+ movq %xmm1, 16(%rsp)
+ movq %rsi, 24(%rsp)
+ movq %xmm2, 32(%rsp)
+ movq %xmm3, 40(%rsp)
+ call _glapi_get_dispatch
+ movq 40(%rsp), %xmm3
+ movq 32(%rsp), %xmm2
+ movq 24(%rsp), %rsi
+ movq 16(%rsp), %xmm1
+ movq 8(%rsp), %xmm0
+ movq (%rsp), %rdi
+ addq $56, %rsp
+ movq 1816(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(MapGrid2f), .-GL_PREFIX(MapGrid2f)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(EvalCoord1d)
+ .type GL_PREFIX(EvalCoord1d), @function
+GL_PREFIX(EvalCoord1d):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 1824(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ subq $8, %rsp
+ movq %xmm0, (%rsp)
+ call _x86_64_get_dispatch@PLT
+ movq (%rsp), %xmm0
+ addq $8, %rsp
+ movq 1824(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 1824(%rax), %r11
+ jmp *%r11
+1:
+ subq $8, %rsp
+ movq %xmm0, (%rsp)
+ call _glapi_get_dispatch
+ movq (%rsp), %xmm0
+ addq $8, %rsp
+ movq 1824(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(EvalCoord1d), .-GL_PREFIX(EvalCoord1d)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(EvalCoord1dv)
+ .type GL_PREFIX(EvalCoord1dv), @function
+GL_PREFIX(EvalCoord1dv):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 1832(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 1832(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 1832(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 1832(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(EvalCoord1dv), .-GL_PREFIX(EvalCoord1dv)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(EvalCoord1f)
+ .type GL_PREFIX(EvalCoord1f), @function
+GL_PREFIX(EvalCoord1f):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 1840(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ subq $8, %rsp
+ movq %xmm0, (%rsp)
+ call _x86_64_get_dispatch@PLT
+ movq (%rsp), %xmm0
+ addq $8, %rsp
+ movq 1840(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 1840(%rax), %r11
+ jmp *%r11
+1:
+ subq $8, %rsp
+ movq %xmm0, (%rsp)
+ call _glapi_get_dispatch
+ movq (%rsp), %xmm0
+ addq $8, %rsp
+ movq 1840(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(EvalCoord1f), .-GL_PREFIX(EvalCoord1f)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(EvalCoord1fv)
+ .type GL_PREFIX(EvalCoord1fv), @function
+GL_PREFIX(EvalCoord1fv):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 1848(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 1848(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 1848(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 1848(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(EvalCoord1fv), .-GL_PREFIX(EvalCoord1fv)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(EvalCoord2d)
+ .type GL_PREFIX(EvalCoord2d), @function
+GL_PREFIX(EvalCoord2d):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 1856(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ subq $24, %rsp
+ movq %xmm0, (%rsp)
+ movq %xmm1, 8(%rsp)
+ call _x86_64_get_dispatch@PLT
+ movq 8(%rsp), %xmm1
+ movq (%rsp), %xmm0
+ addq $24, %rsp
+ movq 1856(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 1856(%rax), %r11
+ jmp *%r11
+1:
+ subq $24, %rsp
+ movq %xmm0, (%rsp)
+ movq %xmm1, 8(%rsp)
+ call _glapi_get_dispatch
+ movq 8(%rsp), %xmm1
+ movq (%rsp), %xmm0
+ addq $24, %rsp
+ movq 1856(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(EvalCoord2d), .-GL_PREFIX(EvalCoord2d)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(EvalCoord2dv)
+ .type GL_PREFIX(EvalCoord2dv), @function
+GL_PREFIX(EvalCoord2dv):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 1864(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 1864(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 1864(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 1864(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(EvalCoord2dv), .-GL_PREFIX(EvalCoord2dv)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(EvalCoord2f)
+ .type GL_PREFIX(EvalCoord2f), @function
+GL_PREFIX(EvalCoord2f):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 1872(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ subq $24, %rsp
+ movq %xmm0, (%rsp)
+ movq %xmm1, 8(%rsp)
+ call _x86_64_get_dispatch@PLT
+ movq 8(%rsp), %xmm1
+ movq (%rsp), %xmm0
+ addq $24, %rsp
+ movq 1872(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 1872(%rax), %r11
+ jmp *%r11
+1:
+ subq $24, %rsp
+ movq %xmm0, (%rsp)
+ movq %xmm1, 8(%rsp)
+ call _glapi_get_dispatch
+ movq 8(%rsp), %xmm1
+ movq (%rsp), %xmm0
+ addq $24, %rsp
+ movq 1872(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(EvalCoord2f), .-GL_PREFIX(EvalCoord2f)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(EvalCoord2fv)
+ .type GL_PREFIX(EvalCoord2fv), @function
+GL_PREFIX(EvalCoord2fv):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 1880(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 1880(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 1880(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 1880(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(EvalCoord2fv), .-GL_PREFIX(EvalCoord2fv)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(EvalMesh1)
+ .type GL_PREFIX(EvalMesh1), @function
+GL_PREFIX(EvalMesh1):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 1888(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 1888(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 1888(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 1888(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(EvalMesh1), .-GL_PREFIX(EvalMesh1)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(EvalPoint1)
+ .type GL_PREFIX(EvalPoint1), @function
+GL_PREFIX(EvalPoint1):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 1896(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 1896(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 1896(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 1896(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(EvalPoint1), .-GL_PREFIX(EvalPoint1)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(EvalMesh2)
+ .type GL_PREFIX(EvalMesh2), @function
+GL_PREFIX(EvalMesh2):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 1904(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ call _x86_64_get_dispatch@PLT
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 1904(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 1904(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ call _glapi_get_dispatch
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 1904(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(EvalMesh2), .-GL_PREFIX(EvalMesh2)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(EvalPoint2)
+ .type GL_PREFIX(EvalPoint2), @function
+GL_PREFIX(EvalPoint2):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 1912(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 1912(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 1912(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 1912(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(EvalPoint2), .-GL_PREFIX(EvalPoint2)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(AlphaFunc)
+ .type GL_PREFIX(AlphaFunc), @function
+GL_PREFIX(AlphaFunc):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 1920(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 1920(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 1920(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 1920(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(AlphaFunc), .-GL_PREFIX(AlphaFunc)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(BlendFunc)
+ .type GL_PREFIX(BlendFunc), @function
+GL_PREFIX(BlendFunc):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 1928(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 1928(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 1928(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 1928(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(BlendFunc), .-GL_PREFIX(BlendFunc)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(LogicOp)
+ .type GL_PREFIX(LogicOp), @function
+GL_PREFIX(LogicOp):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 1936(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 1936(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 1936(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 1936(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(LogicOp), .-GL_PREFIX(LogicOp)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(StencilFunc)
+ .type GL_PREFIX(StencilFunc), @function
+GL_PREFIX(StencilFunc):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 1944(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 1944(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 1944(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 1944(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(StencilFunc), .-GL_PREFIX(StencilFunc)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(StencilOp)
+ .type GL_PREFIX(StencilOp), @function
+GL_PREFIX(StencilOp):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 1952(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 1952(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 1952(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 1952(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(StencilOp), .-GL_PREFIX(StencilOp)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(DepthFunc)
+ .type GL_PREFIX(DepthFunc), @function
+GL_PREFIX(DepthFunc):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 1960(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 1960(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 1960(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 1960(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(DepthFunc), .-GL_PREFIX(DepthFunc)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(PixelZoom)
+ .type GL_PREFIX(PixelZoom), @function
+GL_PREFIX(PixelZoom):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 1968(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ subq $24, %rsp
+ movq %xmm0, (%rsp)
+ movq %xmm1, 8(%rsp)
+ call _x86_64_get_dispatch@PLT
+ movq 8(%rsp), %xmm1
+ movq (%rsp), %xmm0
+ addq $24, %rsp
+ movq 1968(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 1968(%rax), %r11
+ jmp *%r11
+1:
+ subq $24, %rsp
+ movq %xmm0, (%rsp)
+ movq %xmm1, 8(%rsp)
+ call _glapi_get_dispatch
+ movq 8(%rsp), %xmm1
+ movq (%rsp), %xmm0
+ addq $24, %rsp
+ movq 1968(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(PixelZoom), .-GL_PREFIX(PixelZoom)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(PixelTransferf)
+ .type GL_PREFIX(PixelTransferf), @function
+GL_PREFIX(PixelTransferf):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 1976(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ subq $24, %rsp
+ movq %rdi, (%rsp)
+ movq %xmm0, 8(%rsp)
+ call _x86_64_get_dispatch@PLT
+ movq 8(%rsp), %xmm0
+ movq (%rsp), %rdi
+ addq $24, %rsp
+ movq 1976(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 1976(%rax), %r11
+ jmp *%r11
+1:
+ subq $24, %rsp
+ movq %rdi, (%rsp)
+ movq %xmm0, 8(%rsp)
+ call _glapi_get_dispatch
+ movq 8(%rsp), %xmm0
+ movq (%rsp), %rdi
+ addq $24, %rsp
+ movq 1976(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(PixelTransferf), .-GL_PREFIX(PixelTransferf)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(PixelTransferi)
+ .type GL_PREFIX(PixelTransferi), @function
+GL_PREFIX(PixelTransferi):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 1984(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 1984(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 1984(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 1984(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(PixelTransferi), .-GL_PREFIX(PixelTransferi)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(PixelStoref)
+ .type GL_PREFIX(PixelStoref), @function
+GL_PREFIX(PixelStoref):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 1992(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ subq $24, %rsp
+ movq %rdi, (%rsp)
+ movq %xmm0, 8(%rsp)
+ call _x86_64_get_dispatch@PLT
+ movq 8(%rsp), %xmm0
+ movq (%rsp), %rdi
+ addq $24, %rsp
+ movq 1992(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 1992(%rax), %r11
+ jmp *%r11
+1:
+ subq $24, %rsp
+ movq %rdi, (%rsp)
+ movq %xmm0, 8(%rsp)
+ call _glapi_get_dispatch
+ movq 8(%rsp), %xmm0
+ movq (%rsp), %rdi
+ addq $24, %rsp
+ movq 1992(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(PixelStoref), .-GL_PREFIX(PixelStoref)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(PixelStorei)
+ .type GL_PREFIX(PixelStorei), @function
+GL_PREFIX(PixelStorei):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 2000(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 2000(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 2000(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 2000(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(PixelStorei), .-GL_PREFIX(PixelStorei)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(PixelMapfv)
+ .type GL_PREFIX(PixelMapfv), @function
+GL_PREFIX(PixelMapfv):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 2008(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 2008(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 2008(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 2008(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(PixelMapfv), .-GL_PREFIX(PixelMapfv)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(PixelMapuiv)
+ .type GL_PREFIX(PixelMapuiv), @function
+GL_PREFIX(PixelMapuiv):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 2016(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 2016(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 2016(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 2016(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(PixelMapuiv), .-GL_PREFIX(PixelMapuiv)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(PixelMapusv)
+ .type GL_PREFIX(PixelMapusv), @function
+GL_PREFIX(PixelMapusv):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 2024(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 2024(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 2024(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 2024(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(PixelMapusv), .-GL_PREFIX(PixelMapusv)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(ReadBuffer)
+ .type GL_PREFIX(ReadBuffer), @function
+GL_PREFIX(ReadBuffer):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 2032(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 2032(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 2032(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 2032(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(ReadBuffer), .-GL_PREFIX(ReadBuffer)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(CopyPixels)
+ .type GL_PREFIX(CopyPixels), @function
+GL_PREFIX(CopyPixels):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 2040(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ call _x86_64_get_dispatch@PLT
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 2040(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 2040(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ call _glapi_get_dispatch
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 2040(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(CopyPixels), .-GL_PREFIX(CopyPixels)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(ReadPixels)
+ .type GL_PREFIX(ReadPixels), @function
+GL_PREFIX(ReadPixels):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 2048(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ pushq %r9
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %r9
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 2048(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 2048(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ pushq %r9
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %r9
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 2048(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(ReadPixels), .-GL_PREFIX(ReadPixels)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(DrawPixels)
+ .type GL_PREFIX(DrawPixels), @function
+GL_PREFIX(DrawPixels):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 2056(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ call _x86_64_get_dispatch@PLT
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 2056(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 2056(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ call _glapi_get_dispatch
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 2056(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(DrawPixels), .-GL_PREFIX(DrawPixels)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(GetBooleanv)
+ .type GL_PREFIX(GetBooleanv), @function
+GL_PREFIX(GetBooleanv):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 2064(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 2064(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 2064(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 2064(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(GetBooleanv), .-GL_PREFIX(GetBooleanv)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(GetClipPlane)
+ .type GL_PREFIX(GetClipPlane), @function
+GL_PREFIX(GetClipPlane):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 2072(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 2072(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 2072(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 2072(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(GetClipPlane), .-GL_PREFIX(GetClipPlane)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(GetDoublev)
+ .type GL_PREFIX(GetDoublev), @function
+GL_PREFIX(GetDoublev):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 2080(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 2080(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 2080(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 2080(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(GetDoublev), .-GL_PREFIX(GetDoublev)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(GetError)
+ .type GL_PREFIX(GetError), @function
+GL_PREFIX(GetError):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 2088(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ movq 2088(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 2088(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ movq 2088(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(GetError), .-GL_PREFIX(GetError)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(GetFloatv)
+ .type GL_PREFIX(GetFloatv), @function
+GL_PREFIX(GetFloatv):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 2096(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 2096(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 2096(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 2096(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(GetFloatv), .-GL_PREFIX(GetFloatv)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(GetIntegerv)
+ .type GL_PREFIX(GetIntegerv), @function
+GL_PREFIX(GetIntegerv):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 2104(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 2104(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 2104(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 2104(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(GetIntegerv), .-GL_PREFIX(GetIntegerv)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(GetLightfv)
+ .type GL_PREFIX(GetLightfv), @function
+GL_PREFIX(GetLightfv):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 2112(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 2112(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 2112(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 2112(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(GetLightfv), .-GL_PREFIX(GetLightfv)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(GetLightiv)
+ .type GL_PREFIX(GetLightiv), @function
+GL_PREFIX(GetLightiv):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 2120(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 2120(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 2120(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 2120(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(GetLightiv), .-GL_PREFIX(GetLightiv)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(GetMapdv)
+ .type GL_PREFIX(GetMapdv), @function
+GL_PREFIX(GetMapdv):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 2128(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 2128(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 2128(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 2128(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(GetMapdv), .-GL_PREFIX(GetMapdv)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(GetMapfv)
+ .type GL_PREFIX(GetMapfv), @function
+GL_PREFIX(GetMapfv):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 2136(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 2136(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 2136(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 2136(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(GetMapfv), .-GL_PREFIX(GetMapfv)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(GetMapiv)
+ .type GL_PREFIX(GetMapiv), @function
+GL_PREFIX(GetMapiv):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 2144(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 2144(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 2144(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 2144(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(GetMapiv), .-GL_PREFIX(GetMapiv)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(GetMaterialfv)
+ .type GL_PREFIX(GetMaterialfv), @function
+GL_PREFIX(GetMaterialfv):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 2152(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 2152(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 2152(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 2152(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(GetMaterialfv), .-GL_PREFIX(GetMaterialfv)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(GetMaterialiv)
+ .type GL_PREFIX(GetMaterialiv), @function
+GL_PREFIX(GetMaterialiv):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 2160(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 2160(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 2160(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 2160(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(GetMaterialiv), .-GL_PREFIX(GetMaterialiv)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(GetPixelMapfv)
+ .type GL_PREFIX(GetPixelMapfv), @function
+GL_PREFIX(GetPixelMapfv):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 2168(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 2168(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 2168(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 2168(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(GetPixelMapfv), .-GL_PREFIX(GetPixelMapfv)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(GetPixelMapuiv)
+ .type GL_PREFIX(GetPixelMapuiv), @function
+GL_PREFIX(GetPixelMapuiv):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 2176(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 2176(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 2176(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 2176(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(GetPixelMapuiv), .-GL_PREFIX(GetPixelMapuiv)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(GetPixelMapusv)
+ .type GL_PREFIX(GetPixelMapusv), @function
+GL_PREFIX(GetPixelMapusv):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 2184(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 2184(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 2184(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 2184(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(GetPixelMapusv), .-GL_PREFIX(GetPixelMapusv)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(GetPolygonStipple)
+ .type GL_PREFIX(GetPolygonStipple), @function
+GL_PREFIX(GetPolygonStipple):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 2192(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 2192(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 2192(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 2192(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(GetPolygonStipple), .-GL_PREFIX(GetPolygonStipple)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(GetString)
+ .type GL_PREFIX(GetString), @function
+GL_PREFIX(GetString):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 2200(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 2200(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 2200(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 2200(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(GetString), .-GL_PREFIX(GetString)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(GetTexEnvfv)
+ .type GL_PREFIX(GetTexEnvfv), @function
+GL_PREFIX(GetTexEnvfv):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 2208(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 2208(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 2208(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 2208(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(GetTexEnvfv), .-GL_PREFIX(GetTexEnvfv)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(GetTexEnviv)
+ .type GL_PREFIX(GetTexEnviv), @function
+GL_PREFIX(GetTexEnviv):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 2216(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 2216(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 2216(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 2216(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(GetTexEnviv), .-GL_PREFIX(GetTexEnviv)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(GetTexGendv)
+ .type GL_PREFIX(GetTexGendv), @function
+GL_PREFIX(GetTexGendv):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 2224(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 2224(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 2224(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 2224(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(GetTexGendv), .-GL_PREFIX(GetTexGendv)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(GetTexGenfv)
+ .type GL_PREFIX(GetTexGenfv), @function
+GL_PREFIX(GetTexGenfv):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 2232(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 2232(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 2232(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 2232(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(GetTexGenfv), .-GL_PREFIX(GetTexGenfv)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(GetTexGeniv)
+ .type GL_PREFIX(GetTexGeniv), @function
+GL_PREFIX(GetTexGeniv):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 2240(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 2240(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 2240(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 2240(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(GetTexGeniv), .-GL_PREFIX(GetTexGeniv)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(GetTexImage)
+ .type GL_PREFIX(GetTexImage), @function
+GL_PREFIX(GetTexImage):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 2248(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ call _x86_64_get_dispatch@PLT
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 2248(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 2248(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ call _glapi_get_dispatch
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 2248(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(GetTexImage), .-GL_PREFIX(GetTexImage)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(GetTexParameterfv)
+ .type GL_PREFIX(GetTexParameterfv), @function
+GL_PREFIX(GetTexParameterfv):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 2256(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 2256(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 2256(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 2256(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(GetTexParameterfv), .-GL_PREFIX(GetTexParameterfv)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(GetTexParameteriv)
+ .type GL_PREFIX(GetTexParameteriv), @function
+GL_PREFIX(GetTexParameteriv):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 2264(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 2264(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 2264(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 2264(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(GetTexParameteriv), .-GL_PREFIX(GetTexParameteriv)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(GetTexLevelParameterfv)
+ .type GL_PREFIX(GetTexLevelParameterfv), @function
+GL_PREFIX(GetTexLevelParameterfv):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 2272(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 2272(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 2272(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 2272(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(GetTexLevelParameterfv), .-GL_PREFIX(GetTexLevelParameterfv)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(GetTexLevelParameteriv)
+ .type GL_PREFIX(GetTexLevelParameteriv), @function
+GL_PREFIX(GetTexLevelParameteriv):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 2280(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 2280(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 2280(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 2280(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(GetTexLevelParameteriv), .-GL_PREFIX(GetTexLevelParameteriv)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(IsEnabled)
+ .type GL_PREFIX(IsEnabled), @function
+GL_PREFIX(IsEnabled):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 2288(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 2288(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 2288(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 2288(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(IsEnabled), .-GL_PREFIX(IsEnabled)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(IsList)
+ .type GL_PREFIX(IsList), @function
+GL_PREFIX(IsList):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 2296(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 2296(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 2296(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 2296(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(IsList), .-GL_PREFIX(IsList)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(DepthRange)
+ .type GL_PREFIX(DepthRange), @function
+GL_PREFIX(DepthRange):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 2304(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 2304(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 2304(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 2304(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(DepthRange), .-GL_PREFIX(DepthRange)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(Frustum)
+ .type GL_PREFIX(Frustum), @function
+GL_PREFIX(Frustum):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 2312(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ subq $56, %rsp
+ movq %xmm0, (%rsp)
+ movq %xmm1, 8(%rsp)
+ movq %xmm2, 16(%rsp)
+ movq %xmm3, 24(%rsp)
+ movq %xmm4, 32(%rsp)
+ movq %xmm5, 40(%rsp)
+ call _x86_64_get_dispatch@PLT
+ movq 40(%rsp), %xmm5
+ movq 32(%rsp), %xmm4
+ movq 24(%rsp), %xmm3
+ movq 16(%rsp), %xmm2
+ movq 8(%rsp), %xmm1
+ movq (%rsp), %xmm0
+ addq $56, %rsp
+ movq 2312(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 2312(%rax), %r11
+ jmp *%r11
+1:
+ subq $56, %rsp
+ movq %xmm0, (%rsp)
+ movq %xmm1, 8(%rsp)
+ movq %xmm2, 16(%rsp)
+ movq %xmm3, 24(%rsp)
+ movq %xmm4, 32(%rsp)
+ movq %xmm5, 40(%rsp)
+ call _glapi_get_dispatch
+ movq 40(%rsp), %xmm5
+ movq 32(%rsp), %xmm4
+ movq 24(%rsp), %xmm3
+ movq 16(%rsp), %xmm2
+ movq 8(%rsp), %xmm1
+ movq (%rsp), %xmm0
+ addq $56, %rsp
+ movq 2312(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(Frustum), .-GL_PREFIX(Frustum)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(LoadIdentity)
+ .type GL_PREFIX(LoadIdentity), @function
+GL_PREFIX(LoadIdentity):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 2320(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ movq 2320(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 2320(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ movq 2320(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(LoadIdentity), .-GL_PREFIX(LoadIdentity)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(LoadMatrixf)
+ .type GL_PREFIX(LoadMatrixf), @function
+GL_PREFIX(LoadMatrixf):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 2328(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 2328(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 2328(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 2328(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(LoadMatrixf), .-GL_PREFIX(LoadMatrixf)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(LoadMatrixd)
+ .type GL_PREFIX(LoadMatrixd), @function
+GL_PREFIX(LoadMatrixd):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 2336(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 2336(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 2336(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 2336(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(LoadMatrixd), .-GL_PREFIX(LoadMatrixd)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(MatrixMode)
+ .type GL_PREFIX(MatrixMode), @function
+GL_PREFIX(MatrixMode):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 2344(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 2344(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 2344(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 2344(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(MatrixMode), .-GL_PREFIX(MatrixMode)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(MultMatrixf)
+ .type GL_PREFIX(MultMatrixf), @function
+GL_PREFIX(MultMatrixf):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 2352(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 2352(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 2352(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 2352(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(MultMatrixf), .-GL_PREFIX(MultMatrixf)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(MultMatrixd)
+ .type GL_PREFIX(MultMatrixd), @function
+GL_PREFIX(MultMatrixd):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 2360(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 2360(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 2360(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 2360(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(MultMatrixd), .-GL_PREFIX(MultMatrixd)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(Ortho)
+ .type GL_PREFIX(Ortho), @function
+GL_PREFIX(Ortho):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 2368(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ subq $56, %rsp
+ movq %xmm0, (%rsp)
+ movq %xmm1, 8(%rsp)
+ movq %xmm2, 16(%rsp)
+ movq %xmm3, 24(%rsp)
+ movq %xmm4, 32(%rsp)
+ movq %xmm5, 40(%rsp)
+ call _x86_64_get_dispatch@PLT
+ movq 40(%rsp), %xmm5
+ movq 32(%rsp), %xmm4
+ movq 24(%rsp), %xmm3
+ movq 16(%rsp), %xmm2
+ movq 8(%rsp), %xmm1
+ movq (%rsp), %xmm0
+ addq $56, %rsp
+ movq 2368(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 2368(%rax), %r11
+ jmp *%r11
+1:
+ subq $56, %rsp
+ movq %xmm0, (%rsp)
+ movq %xmm1, 8(%rsp)
+ movq %xmm2, 16(%rsp)
+ movq %xmm3, 24(%rsp)
+ movq %xmm4, 32(%rsp)
+ movq %xmm5, 40(%rsp)
+ call _glapi_get_dispatch
+ movq 40(%rsp), %xmm5
+ movq 32(%rsp), %xmm4
+ movq 24(%rsp), %xmm3
+ movq 16(%rsp), %xmm2
+ movq 8(%rsp), %xmm1
+ movq (%rsp), %xmm0
+ addq $56, %rsp
+ movq 2368(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(Ortho), .-GL_PREFIX(Ortho)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(PopMatrix)
+ .type GL_PREFIX(PopMatrix), @function
+GL_PREFIX(PopMatrix):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 2376(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ movq 2376(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 2376(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ movq 2376(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(PopMatrix), .-GL_PREFIX(PopMatrix)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(PushMatrix)
+ .type GL_PREFIX(PushMatrix), @function
+GL_PREFIX(PushMatrix):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 2384(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ movq 2384(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 2384(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ movq 2384(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(PushMatrix), .-GL_PREFIX(PushMatrix)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(Rotated)
+ .type GL_PREFIX(Rotated), @function
+GL_PREFIX(Rotated):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 2392(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ subq $40, %rsp
+ movq %xmm0, (%rsp)
+ movq %xmm1, 8(%rsp)
+ movq %xmm2, 16(%rsp)
+ movq %xmm3, 24(%rsp)
+ call _x86_64_get_dispatch@PLT
+ movq 24(%rsp), %xmm3
+ movq 16(%rsp), %xmm2
+ movq 8(%rsp), %xmm1
+ movq (%rsp), %xmm0
+ addq $40, %rsp
+ movq 2392(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 2392(%rax), %r11
+ jmp *%r11
+1:
+ subq $40, %rsp
+ movq %xmm0, (%rsp)
+ movq %xmm1, 8(%rsp)
+ movq %xmm2, 16(%rsp)
+ movq %xmm3, 24(%rsp)
+ call _glapi_get_dispatch
+ movq 24(%rsp), %xmm3
+ movq 16(%rsp), %xmm2
+ movq 8(%rsp), %xmm1
+ movq (%rsp), %xmm0
+ addq $40, %rsp
+ movq 2392(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(Rotated), .-GL_PREFIX(Rotated)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(Rotatef)
+ .type GL_PREFIX(Rotatef), @function
+GL_PREFIX(Rotatef):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 2400(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ subq $40, %rsp
+ movq %xmm0, (%rsp)
+ movq %xmm1, 8(%rsp)
+ movq %xmm2, 16(%rsp)
+ movq %xmm3, 24(%rsp)
+ call _x86_64_get_dispatch@PLT
+ movq 24(%rsp), %xmm3
+ movq 16(%rsp), %xmm2
+ movq 8(%rsp), %xmm1
+ movq (%rsp), %xmm0
+ addq $40, %rsp
+ movq 2400(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 2400(%rax), %r11
+ jmp *%r11
+1:
+ subq $40, %rsp
+ movq %xmm0, (%rsp)
+ movq %xmm1, 8(%rsp)
+ movq %xmm2, 16(%rsp)
+ movq %xmm3, 24(%rsp)
+ call _glapi_get_dispatch
+ movq 24(%rsp), %xmm3
+ movq 16(%rsp), %xmm2
+ movq 8(%rsp), %xmm1
+ movq (%rsp), %xmm0
+ addq $40, %rsp
+ movq 2400(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(Rotatef), .-GL_PREFIX(Rotatef)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(Scaled)
+ .type GL_PREFIX(Scaled), @function
+GL_PREFIX(Scaled):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 2408(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ subq $24, %rsp
+ movq %xmm0, (%rsp)
+ movq %xmm1, 8(%rsp)
+ movq %xmm2, 16(%rsp)
+ call _x86_64_get_dispatch@PLT
+ movq 16(%rsp), %xmm2
+ movq 8(%rsp), %xmm1
+ movq (%rsp), %xmm0
+ addq $24, %rsp
+ movq 2408(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 2408(%rax), %r11
+ jmp *%r11
+1:
+ subq $24, %rsp
+ movq %xmm0, (%rsp)
+ movq %xmm1, 8(%rsp)
+ movq %xmm2, 16(%rsp)
+ call _glapi_get_dispatch
+ movq 16(%rsp), %xmm2
+ movq 8(%rsp), %xmm1
+ movq (%rsp), %xmm0
+ addq $24, %rsp
+ movq 2408(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(Scaled), .-GL_PREFIX(Scaled)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(Scalef)
+ .type GL_PREFIX(Scalef), @function
+GL_PREFIX(Scalef):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 2416(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ subq $24, %rsp
+ movq %xmm0, (%rsp)
+ movq %xmm1, 8(%rsp)
+ movq %xmm2, 16(%rsp)
+ call _x86_64_get_dispatch@PLT
+ movq 16(%rsp), %xmm2
+ movq 8(%rsp), %xmm1
+ movq (%rsp), %xmm0
+ addq $24, %rsp
+ movq 2416(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 2416(%rax), %r11
+ jmp *%r11
+1:
+ subq $24, %rsp
+ movq %xmm0, (%rsp)
+ movq %xmm1, 8(%rsp)
+ movq %xmm2, 16(%rsp)
+ call _glapi_get_dispatch
+ movq 16(%rsp), %xmm2
+ movq 8(%rsp), %xmm1
+ movq (%rsp), %xmm0
+ addq $24, %rsp
+ movq 2416(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(Scalef), .-GL_PREFIX(Scalef)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(Translated)
+ .type GL_PREFIX(Translated), @function
+GL_PREFIX(Translated):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 2424(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ subq $24, %rsp
+ movq %xmm0, (%rsp)
+ movq %xmm1, 8(%rsp)
+ movq %xmm2, 16(%rsp)
+ call _x86_64_get_dispatch@PLT
+ movq 16(%rsp), %xmm2
+ movq 8(%rsp), %xmm1
+ movq (%rsp), %xmm0
+ addq $24, %rsp
+ movq 2424(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 2424(%rax), %r11
+ jmp *%r11
+1:
+ subq $24, %rsp
+ movq %xmm0, (%rsp)
+ movq %xmm1, 8(%rsp)
+ movq %xmm2, 16(%rsp)
+ call _glapi_get_dispatch
+ movq 16(%rsp), %xmm2
+ movq 8(%rsp), %xmm1
+ movq (%rsp), %xmm0
+ addq $24, %rsp
+ movq 2424(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(Translated), .-GL_PREFIX(Translated)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(Translatef)
+ .type GL_PREFIX(Translatef), @function
+GL_PREFIX(Translatef):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 2432(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ subq $24, %rsp
+ movq %xmm0, (%rsp)
+ movq %xmm1, 8(%rsp)
+ movq %xmm2, 16(%rsp)
+ call _x86_64_get_dispatch@PLT
+ movq 16(%rsp), %xmm2
+ movq 8(%rsp), %xmm1
+ movq (%rsp), %xmm0
+ addq $24, %rsp
+ movq 2432(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 2432(%rax), %r11
+ jmp *%r11
+1:
+ subq $24, %rsp
+ movq %xmm0, (%rsp)
+ movq %xmm1, 8(%rsp)
+ movq %xmm2, 16(%rsp)
+ call _glapi_get_dispatch
+ movq 16(%rsp), %xmm2
+ movq 8(%rsp), %xmm1
+ movq (%rsp), %xmm0
+ addq $24, %rsp
+ movq 2432(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(Translatef), .-GL_PREFIX(Translatef)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(Viewport)
+ .type GL_PREFIX(Viewport), @function
+GL_PREFIX(Viewport):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 2440(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 2440(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 2440(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 2440(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(Viewport), .-GL_PREFIX(Viewport)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(ArrayElement)
+ .type GL_PREFIX(ArrayElement), @function
+GL_PREFIX(ArrayElement):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 2448(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 2448(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 2448(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 2448(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(ArrayElement), .-GL_PREFIX(ArrayElement)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(BindTexture)
+ .type GL_PREFIX(BindTexture), @function
+GL_PREFIX(BindTexture):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 2456(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 2456(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 2456(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 2456(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(BindTexture), .-GL_PREFIX(BindTexture)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(ColorPointer)
+ .type GL_PREFIX(ColorPointer), @function
+GL_PREFIX(ColorPointer):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 2464(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 2464(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 2464(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 2464(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(ColorPointer), .-GL_PREFIX(ColorPointer)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(DisableClientState)
+ .type GL_PREFIX(DisableClientState), @function
+GL_PREFIX(DisableClientState):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 2472(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 2472(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 2472(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 2472(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(DisableClientState), .-GL_PREFIX(DisableClientState)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(DrawArrays)
+ .type GL_PREFIX(DrawArrays), @function
+GL_PREFIX(DrawArrays):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 2480(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 2480(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 2480(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 2480(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(DrawArrays), .-GL_PREFIX(DrawArrays)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(DrawElements)
+ .type GL_PREFIX(DrawElements), @function
+GL_PREFIX(DrawElements):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 2488(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 2488(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 2488(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 2488(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(DrawElements), .-GL_PREFIX(DrawElements)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(EdgeFlagPointer)
+ .type GL_PREFIX(EdgeFlagPointer), @function
+GL_PREFIX(EdgeFlagPointer):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 2496(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 2496(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 2496(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 2496(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(EdgeFlagPointer), .-GL_PREFIX(EdgeFlagPointer)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(EnableClientState)
+ .type GL_PREFIX(EnableClientState), @function
+GL_PREFIX(EnableClientState):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 2504(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 2504(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 2504(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 2504(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(EnableClientState), .-GL_PREFIX(EnableClientState)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(IndexPointer)
+ .type GL_PREFIX(IndexPointer), @function
+GL_PREFIX(IndexPointer):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 2512(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 2512(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 2512(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 2512(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(IndexPointer), .-GL_PREFIX(IndexPointer)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(Indexub)
+ .type GL_PREFIX(Indexub), @function
+GL_PREFIX(Indexub):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 2520(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 2520(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 2520(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 2520(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(Indexub), .-GL_PREFIX(Indexub)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(Indexubv)
+ .type GL_PREFIX(Indexubv), @function
+GL_PREFIX(Indexubv):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 2528(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 2528(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 2528(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 2528(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(Indexubv), .-GL_PREFIX(Indexubv)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(InterleavedArrays)
+ .type GL_PREFIX(InterleavedArrays), @function
+GL_PREFIX(InterleavedArrays):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 2536(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 2536(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 2536(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 2536(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(InterleavedArrays), .-GL_PREFIX(InterleavedArrays)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(NormalPointer)
+ .type GL_PREFIX(NormalPointer), @function
+GL_PREFIX(NormalPointer):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 2544(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 2544(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 2544(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 2544(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(NormalPointer), .-GL_PREFIX(NormalPointer)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(PolygonOffset)
+ .type GL_PREFIX(PolygonOffset), @function
+GL_PREFIX(PolygonOffset):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 2552(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ subq $24, %rsp
+ movq %xmm0, (%rsp)
+ movq %xmm1, 8(%rsp)
+ call _x86_64_get_dispatch@PLT
+ movq 8(%rsp), %xmm1
+ movq (%rsp), %xmm0
+ addq $24, %rsp
+ movq 2552(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 2552(%rax), %r11
+ jmp *%r11
+1:
+ subq $24, %rsp
+ movq %xmm0, (%rsp)
+ movq %xmm1, 8(%rsp)
+ call _glapi_get_dispatch
+ movq 8(%rsp), %xmm1
+ movq (%rsp), %xmm0
+ addq $24, %rsp
+ movq 2552(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(PolygonOffset), .-GL_PREFIX(PolygonOffset)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(TexCoordPointer)
+ .type GL_PREFIX(TexCoordPointer), @function
+GL_PREFIX(TexCoordPointer):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 2560(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 2560(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 2560(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 2560(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(TexCoordPointer), .-GL_PREFIX(TexCoordPointer)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(VertexPointer)
+ .type GL_PREFIX(VertexPointer), @function
+GL_PREFIX(VertexPointer):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 2568(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 2568(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 2568(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 2568(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(VertexPointer), .-GL_PREFIX(VertexPointer)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(AreTexturesResident)
+ .type GL_PREFIX(AreTexturesResident), @function
+GL_PREFIX(AreTexturesResident):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 2576(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 2576(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 2576(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 2576(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(AreTexturesResident), .-GL_PREFIX(AreTexturesResident)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(CopyTexImage1D)
+ .type GL_PREFIX(CopyTexImage1D), @function
+GL_PREFIX(CopyTexImage1D):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 2584(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ pushq %r9
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %r9
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 2584(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 2584(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ pushq %r9
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %r9
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 2584(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(CopyTexImage1D), .-GL_PREFIX(CopyTexImage1D)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(CopyTexImage2D)
+ .type GL_PREFIX(CopyTexImage2D), @function
+GL_PREFIX(CopyTexImage2D):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 2592(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ pushq %r9
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %r9
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 2592(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 2592(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ pushq %r9
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %r9
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 2592(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(CopyTexImage2D), .-GL_PREFIX(CopyTexImage2D)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(CopyTexSubImage1D)
+ .type GL_PREFIX(CopyTexSubImage1D), @function
+GL_PREFIX(CopyTexSubImage1D):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 2600(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ pushq %r9
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %r9
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 2600(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 2600(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ pushq %r9
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %r9
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 2600(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(CopyTexSubImage1D), .-GL_PREFIX(CopyTexSubImage1D)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(CopyTexSubImage2D)
+ .type GL_PREFIX(CopyTexSubImage2D), @function
+GL_PREFIX(CopyTexSubImage2D):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 2608(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ pushq %r9
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %r9
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 2608(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 2608(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ pushq %r9
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %r9
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 2608(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(CopyTexSubImage2D), .-GL_PREFIX(CopyTexSubImage2D)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(DeleteTextures)
+ .type GL_PREFIX(DeleteTextures), @function
+GL_PREFIX(DeleteTextures):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 2616(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 2616(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 2616(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 2616(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(DeleteTextures), .-GL_PREFIX(DeleteTextures)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(GenTextures)
+ .type GL_PREFIX(GenTextures), @function
+GL_PREFIX(GenTextures):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 2624(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 2624(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 2624(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 2624(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(GenTextures), .-GL_PREFIX(GenTextures)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(GetPointerv)
+ .type GL_PREFIX(GetPointerv), @function
+GL_PREFIX(GetPointerv):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 2632(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 2632(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 2632(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 2632(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(GetPointerv), .-GL_PREFIX(GetPointerv)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(IsTexture)
+ .type GL_PREFIX(IsTexture), @function
+GL_PREFIX(IsTexture):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 2640(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 2640(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 2640(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 2640(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(IsTexture), .-GL_PREFIX(IsTexture)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(PrioritizeTextures)
+ .type GL_PREFIX(PrioritizeTextures), @function
+GL_PREFIX(PrioritizeTextures):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 2648(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 2648(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 2648(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 2648(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(PrioritizeTextures), .-GL_PREFIX(PrioritizeTextures)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(TexSubImage1D)
+ .type GL_PREFIX(TexSubImage1D), @function
+GL_PREFIX(TexSubImage1D):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 2656(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ pushq %r9
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %r9
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 2656(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 2656(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ pushq %r9
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %r9
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 2656(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(TexSubImage1D), .-GL_PREFIX(TexSubImage1D)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(TexSubImage2D)
+ .type GL_PREFIX(TexSubImage2D), @function
+GL_PREFIX(TexSubImage2D):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 2664(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ pushq %r9
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %r9
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 2664(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 2664(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ pushq %r9
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %r9
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 2664(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(TexSubImage2D), .-GL_PREFIX(TexSubImage2D)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(PopClientAttrib)
+ .type GL_PREFIX(PopClientAttrib), @function
+GL_PREFIX(PopClientAttrib):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 2672(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ movq 2672(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 2672(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ movq 2672(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(PopClientAttrib), .-GL_PREFIX(PopClientAttrib)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(PushClientAttrib)
+ .type GL_PREFIX(PushClientAttrib), @function
+GL_PREFIX(PushClientAttrib):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 2680(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 2680(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 2680(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 2680(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(PushClientAttrib), .-GL_PREFIX(PushClientAttrib)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(BlendColor)
+ .type GL_PREFIX(BlendColor), @function
+GL_PREFIX(BlendColor):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 2688(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 2688(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 2688(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 2688(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(BlendColor), .-GL_PREFIX(BlendColor)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(BlendEquation)
+ .type GL_PREFIX(BlendEquation), @function
+GL_PREFIX(BlendEquation):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 2696(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 2696(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 2696(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 2696(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(BlendEquation), .-GL_PREFIX(BlendEquation)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(DrawRangeElements)
+ .type GL_PREFIX(DrawRangeElements), @function
+GL_PREFIX(DrawRangeElements):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 2704(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ pushq %r9
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %r9
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 2704(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 2704(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ pushq %r9
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %r9
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 2704(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(DrawRangeElements), .-GL_PREFIX(DrawRangeElements)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(ColorTable)
+ .type GL_PREFIX(ColorTable), @function
+GL_PREFIX(ColorTable):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 2712(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ pushq %r9
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %r9
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 2712(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 2712(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ pushq %r9
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %r9
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 2712(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(ColorTable), .-GL_PREFIX(ColorTable)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(ColorTableParameterfv)
+ .type GL_PREFIX(ColorTableParameterfv), @function
+GL_PREFIX(ColorTableParameterfv):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 2720(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 2720(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 2720(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 2720(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(ColorTableParameterfv), .-GL_PREFIX(ColorTableParameterfv)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(ColorTableParameteriv)
+ .type GL_PREFIX(ColorTableParameteriv), @function
+GL_PREFIX(ColorTableParameteriv):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 2728(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 2728(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 2728(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 2728(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(ColorTableParameteriv), .-GL_PREFIX(ColorTableParameteriv)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(CopyColorTable)
+ .type GL_PREFIX(CopyColorTable), @function
+GL_PREFIX(CopyColorTable):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 2736(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ call _x86_64_get_dispatch@PLT
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 2736(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 2736(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ call _glapi_get_dispatch
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 2736(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(CopyColorTable), .-GL_PREFIX(CopyColorTable)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(GetColorTable)
+ .type GL_PREFIX(GetColorTable), @function
+GL_PREFIX(GetColorTable):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 2744(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 2744(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 2744(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 2744(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(GetColorTable), .-GL_PREFIX(GetColorTable)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(GetColorTableParameterfv)
+ .type GL_PREFIX(GetColorTableParameterfv), @function
+GL_PREFIX(GetColorTableParameterfv):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 2752(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 2752(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 2752(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 2752(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(GetColorTableParameterfv), .-GL_PREFIX(GetColorTableParameterfv)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(GetColorTableParameteriv)
+ .type GL_PREFIX(GetColorTableParameteriv), @function
+GL_PREFIX(GetColorTableParameteriv):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 2760(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 2760(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 2760(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 2760(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(GetColorTableParameteriv), .-GL_PREFIX(GetColorTableParameteriv)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(ColorSubTable)
+ .type GL_PREFIX(ColorSubTable), @function
+GL_PREFIX(ColorSubTable):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 2768(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ pushq %r9
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %r9
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 2768(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 2768(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ pushq %r9
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %r9
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 2768(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(ColorSubTable), .-GL_PREFIX(ColorSubTable)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(CopyColorSubTable)
+ .type GL_PREFIX(CopyColorSubTable), @function
+GL_PREFIX(CopyColorSubTable):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 2776(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ call _x86_64_get_dispatch@PLT
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 2776(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 2776(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ call _glapi_get_dispatch
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 2776(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(CopyColorSubTable), .-GL_PREFIX(CopyColorSubTable)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(ConvolutionFilter1D)
+ .type GL_PREFIX(ConvolutionFilter1D), @function
+GL_PREFIX(ConvolutionFilter1D):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 2784(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ pushq %r9
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %r9
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 2784(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 2784(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ pushq %r9
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %r9
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 2784(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(ConvolutionFilter1D), .-GL_PREFIX(ConvolutionFilter1D)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(ConvolutionFilter2D)
+ .type GL_PREFIX(ConvolutionFilter2D), @function
+GL_PREFIX(ConvolutionFilter2D):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 2792(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ pushq %r9
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %r9
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 2792(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 2792(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ pushq %r9
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %r9
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 2792(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(ConvolutionFilter2D), .-GL_PREFIX(ConvolutionFilter2D)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(ConvolutionParameterf)
+ .type GL_PREFIX(ConvolutionParameterf), @function
+GL_PREFIX(ConvolutionParameterf):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 2800(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ subq $24, %rsp
+ movq %rdi, (%rsp)
+ movq %rsi, 8(%rsp)
+ movq %xmm0, 16(%rsp)
+ call _x86_64_get_dispatch@PLT
+ movq 16(%rsp), %xmm0
+ movq 8(%rsp), %rsi
+ movq (%rsp), %rdi
+ addq $24, %rsp
+ movq 2800(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 2800(%rax), %r11
+ jmp *%r11
+1:
+ subq $24, %rsp
+ movq %rdi, (%rsp)
+ movq %rsi, 8(%rsp)
+ movq %xmm0, 16(%rsp)
+ call _glapi_get_dispatch
+ movq 16(%rsp), %xmm0
+ movq 8(%rsp), %rsi
+ movq (%rsp), %rdi
+ addq $24, %rsp
+ movq 2800(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(ConvolutionParameterf), .-GL_PREFIX(ConvolutionParameterf)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(ConvolutionParameterfv)
+ .type GL_PREFIX(ConvolutionParameterfv), @function
+GL_PREFIX(ConvolutionParameterfv):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 2808(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 2808(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 2808(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 2808(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(ConvolutionParameterfv), .-GL_PREFIX(ConvolutionParameterfv)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(ConvolutionParameteri)
+ .type GL_PREFIX(ConvolutionParameteri), @function
+GL_PREFIX(ConvolutionParameteri):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 2816(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 2816(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 2816(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 2816(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(ConvolutionParameteri), .-GL_PREFIX(ConvolutionParameteri)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(ConvolutionParameteriv)
+ .type GL_PREFIX(ConvolutionParameteriv), @function
+GL_PREFIX(ConvolutionParameteriv):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 2824(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 2824(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 2824(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 2824(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(ConvolutionParameteriv), .-GL_PREFIX(ConvolutionParameteriv)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(CopyConvolutionFilter1D)
+ .type GL_PREFIX(CopyConvolutionFilter1D), @function
+GL_PREFIX(CopyConvolutionFilter1D):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 2832(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ call _x86_64_get_dispatch@PLT
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 2832(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 2832(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ call _glapi_get_dispatch
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 2832(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(CopyConvolutionFilter1D), .-GL_PREFIX(CopyConvolutionFilter1D)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(CopyConvolutionFilter2D)
+ .type GL_PREFIX(CopyConvolutionFilter2D), @function
+GL_PREFIX(CopyConvolutionFilter2D):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 2840(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ pushq %r9
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %r9
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 2840(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 2840(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ pushq %r9
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %r9
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 2840(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(CopyConvolutionFilter2D), .-GL_PREFIX(CopyConvolutionFilter2D)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(GetConvolutionFilter)
+ .type GL_PREFIX(GetConvolutionFilter), @function
+GL_PREFIX(GetConvolutionFilter):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 2848(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 2848(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 2848(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 2848(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(GetConvolutionFilter), .-GL_PREFIX(GetConvolutionFilter)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(GetConvolutionParameterfv)
+ .type GL_PREFIX(GetConvolutionParameterfv), @function
+GL_PREFIX(GetConvolutionParameterfv):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 2856(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 2856(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 2856(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 2856(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(GetConvolutionParameterfv), .-GL_PREFIX(GetConvolutionParameterfv)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(GetConvolutionParameteriv)
+ .type GL_PREFIX(GetConvolutionParameteriv), @function
+GL_PREFIX(GetConvolutionParameteriv):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 2864(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 2864(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 2864(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 2864(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(GetConvolutionParameteriv), .-GL_PREFIX(GetConvolutionParameteriv)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(GetSeparableFilter)
+ .type GL_PREFIX(GetSeparableFilter), @function
+GL_PREFIX(GetSeparableFilter):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 2872(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ pushq %r9
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %r9
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 2872(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 2872(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ pushq %r9
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %r9
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 2872(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(GetSeparableFilter), .-GL_PREFIX(GetSeparableFilter)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(SeparableFilter2D)
+ .type GL_PREFIX(SeparableFilter2D), @function
+GL_PREFIX(SeparableFilter2D):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 2880(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ pushq %r9
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %r9
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 2880(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 2880(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ pushq %r9
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %r9
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 2880(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(SeparableFilter2D), .-GL_PREFIX(SeparableFilter2D)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(GetHistogram)
+ .type GL_PREFIX(GetHistogram), @function
+GL_PREFIX(GetHistogram):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 2888(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ call _x86_64_get_dispatch@PLT
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 2888(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 2888(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ call _glapi_get_dispatch
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 2888(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(GetHistogram), .-GL_PREFIX(GetHistogram)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(GetHistogramParameterfv)
+ .type GL_PREFIX(GetHistogramParameterfv), @function
+GL_PREFIX(GetHistogramParameterfv):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 2896(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 2896(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 2896(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 2896(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(GetHistogramParameterfv), .-GL_PREFIX(GetHistogramParameterfv)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(GetHistogramParameteriv)
+ .type GL_PREFIX(GetHistogramParameteriv), @function
+GL_PREFIX(GetHistogramParameteriv):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 2904(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 2904(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 2904(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 2904(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(GetHistogramParameteriv), .-GL_PREFIX(GetHistogramParameteriv)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(GetMinmax)
+ .type GL_PREFIX(GetMinmax), @function
+GL_PREFIX(GetMinmax):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 2912(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ call _x86_64_get_dispatch@PLT
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 2912(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 2912(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ call _glapi_get_dispatch
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 2912(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(GetMinmax), .-GL_PREFIX(GetMinmax)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(GetMinmaxParameterfv)
+ .type GL_PREFIX(GetMinmaxParameterfv), @function
+GL_PREFIX(GetMinmaxParameterfv):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 2920(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 2920(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 2920(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 2920(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(GetMinmaxParameterfv), .-GL_PREFIX(GetMinmaxParameterfv)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(GetMinmaxParameteriv)
+ .type GL_PREFIX(GetMinmaxParameteriv), @function
+GL_PREFIX(GetMinmaxParameteriv):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 2928(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 2928(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 2928(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 2928(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(GetMinmaxParameteriv), .-GL_PREFIX(GetMinmaxParameteriv)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(Histogram)
+ .type GL_PREFIX(Histogram), @function
+GL_PREFIX(Histogram):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 2936(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 2936(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 2936(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 2936(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(Histogram), .-GL_PREFIX(Histogram)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(Minmax)
+ .type GL_PREFIX(Minmax), @function
+GL_PREFIX(Minmax):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 2944(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 2944(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 2944(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 2944(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(Minmax), .-GL_PREFIX(Minmax)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(ResetHistogram)
+ .type GL_PREFIX(ResetHistogram), @function
+GL_PREFIX(ResetHistogram):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 2952(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 2952(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 2952(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 2952(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(ResetHistogram), .-GL_PREFIX(ResetHistogram)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(ResetMinmax)
+ .type GL_PREFIX(ResetMinmax), @function
+GL_PREFIX(ResetMinmax):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 2960(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 2960(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 2960(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 2960(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(ResetMinmax), .-GL_PREFIX(ResetMinmax)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(TexImage3D)
+ .type GL_PREFIX(TexImage3D), @function
+GL_PREFIX(TexImage3D):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 2968(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ pushq %r9
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %r9
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 2968(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 2968(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ pushq %r9
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %r9
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 2968(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(TexImage3D), .-GL_PREFIX(TexImage3D)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(TexSubImage3D)
+ .type GL_PREFIX(TexSubImage3D), @function
+GL_PREFIX(TexSubImage3D):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 2976(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ pushq %r9
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %r9
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 2976(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 2976(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ pushq %r9
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %r9
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 2976(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(TexSubImage3D), .-GL_PREFIX(TexSubImage3D)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(CopyTexSubImage3D)
+ .type GL_PREFIX(CopyTexSubImage3D), @function
+GL_PREFIX(CopyTexSubImage3D):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 2984(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ pushq %r9
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %r9
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 2984(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 2984(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ pushq %r9
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %r9
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 2984(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(CopyTexSubImage3D), .-GL_PREFIX(CopyTexSubImage3D)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(ActiveTextureARB)
+ .type GL_PREFIX(ActiveTextureARB), @function
+GL_PREFIX(ActiveTextureARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 2992(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 2992(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 2992(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 2992(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(ActiveTextureARB), .-GL_PREFIX(ActiveTextureARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(ClientActiveTextureARB)
+ .type GL_PREFIX(ClientActiveTextureARB), @function
+GL_PREFIX(ClientActiveTextureARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 3000(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 3000(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 3000(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 3000(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(ClientActiveTextureARB), .-GL_PREFIX(ClientActiveTextureARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(MultiTexCoord1dARB)
+ .type GL_PREFIX(MultiTexCoord1dARB), @function
+GL_PREFIX(MultiTexCoord1dARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 3008(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ subq $24, %rsp
+ movq %rdi, (%rsp)
+ movq %xmm0, 8(%rsp)
+ call _x86_64_get_dispatch@PLT
+ movq 8(%rsp), %xmm0
+ movq (%rsp), %rdi
+ addq $24, %rsp
+ movq 3008(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 3008(%rax), %r11
+ jmp *%r11
+1:
+ subq $24, %rsp
+ movq %rdi, (%rsp)
+ movq %xmm0, 8(%rsp)
+ call _glapi_get_dispatch
+ movq 8(%rsp), %xmm0
+ movq (%rsp), %rdi
+ addq $24, %rsp
+ movq 3008(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(MultiTexCoord1dARB), .-GL_PREFIX(MultiTexCoord1dARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(MultiTexCoord1dvARB)
+ .type GL_PREFIX(MultiTexCoord1dvARB), @function
+GL_PREFIX(MultiTexCoord1dvARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 3016(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 3016(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 3016(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 3016(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(MultiTexCoord1dvARB), .-GL_PREFIX(MultiTexCoord1dvARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(MultiTexCoord1fARB)
+ .type GL_PREFIX(MultiTexCoord1fARB), @function
+GL_PREFIX(MultiTexCoord1fARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 3024(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ subq $24, %rsp
+ movq %rdi, (%rsp)
+ movq %xmm0, 8(%rsp)
+ call _x86_64_get_dispatch@PLT
+ movq 8(%rsp), %xmm0
+ movq (%rsp), %rdi
+ addq $24, %rsp
+ movq 3024(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 3024(%rax), %r11
+ jmp *%r11
+1:
+ subq $24, %rsp
+ movq %rdi, (%rsp)
+ movq %xmm0, 8(%rsp)
+ call _glapi_get_dispatch
+ movq 8(%rsp), %xmm0
+ movq (%rsp), %rdi
+ addq $24, %rsp
+ movq 3024(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(MultiTexCoord1fARB), .-GL_PREFIX(MultiTexCoord1fARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(MultiTexCoord1fvARB)
+ .type GL_PREFIX(MultiTexCoord1fvARB), @function
+GL_PREFIX(MultiTexCoord1fvARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 3032(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 3032(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 3032(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 3032(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(MultiTexCoord1fvARB), .-GL_PREFIX(MultiTexCoord1fvARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(MultiTexCoord1iARB)
+ .type GL_PREFIX(MultiTexCoord1iARB), @function
+GL_PREFIX(MultiTexCoord1iARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 3040(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 3040(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 3040(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 3040(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(MultiTexCoord1iARB), .-GL_PREFIX(MultiTexCoord1iARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(MultiTexCoord1ivARB)
+ .type GL_PREFIX(MultiTexCoord1ivARB), @function
+GL_PREFIX(MultiTexCoord1ivARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 3048(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 3048(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 3048(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 3048(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(MultiTexCoord1ivARB), .-GL_PREFIX(MultiTexCoord1ivARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(MultiTexCoord1sARB)
+ .type GL_PREFIX(MultiTexCoord1sARB), @function
+GL_PREFIX(MultiTexCoord1sARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 3056(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 3056(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 3056(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 3056(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(MultiTexCoord1sARB), .-GL_PREFIX(MultiTexCoord1sARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(MultiTexCoord1svARB)
+ .type GL_PREFIX(MultiTexCoord1svARB), @function
+GL_PREFIX(MultiTexCoord1svARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 3064(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 3064(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 3064(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 3064(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(MultiTexCoord1svARB), .-GL_PREFIX(MultiTexCoord1svARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(MultiTexCoord2dARB)
+ .type GL_PREFIX(MultiTexCoord2dARB), @function
+GL_PREFIX(MultiTexCoord2dARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 3072(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ subq $24, %rsp
+ movq %rdi, (%rsp)
+ movq %xmm0, 8(%rsp)
+ movq %xmm1, 16(%rsp)
+ call _x86_64_get_dispatch@PLT
+ movq 16(%rsp), %xmm1
+ movq 8(%rsp), %xmm0
+ movq (%rsp), %rdi
+ addq $24, %rsp
+ movq 3072(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 3072(%rax), %r11
+ jmp *%r11
+1:
+ subq $24, %rsp
+ movq %rdi, (%rsp)
+ movq %xmm0, 8(%rsp)
+ movq %xmm1, 16(%rsp)
+ call _glapi_get_dispatch
+ movq 16(%rsp), %xmm1
+ movq 8(%rsp), %xmm0
+ movq (%rsp), %rdi
+ addq $24, %rsp
+ movq 3072(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(MultiTexCoord2dARB), .-GL_PREFIX(MultiTexCoord2dARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(MultiTexCoord2dvARB)
+ .type GL_PREFIX(MultiTexCoord2dvARB), @function
+GL_PREFIX(MultiTexCoord2dvARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 3080(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 3080(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 3080(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 3080(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(MultiTexCoord2dvARB), .-GL_PREFIX(MultiTexCoord2dvARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(MultiTexCoord2fARB)
+ .type GL_PREFIX(MultiTexCoord2fARB), @function
+GL_PREFIX(MultiTexCoord2fARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 3088(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ subq $24, %rsp
+ movq %rdi, (%rsp)
+ movq %xmm0, 8(%rsp)
+ movq %xmm1, 16(%rsp)
+ call _x86_64_get_dispatch@PLT
+ movq 16(%rsp), %xmm1
+ movq 8(%rsp), %xmm0
+ movq (%rsp), %rdi
+ addq $24, %rsp
+ movq 3088(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 3088(%rax), %r11
+ jmp *%r11
+1:
+ subq $24, %rsp
+ movq %rdi, (%rsp)
+ movq %xmm0, 8(%rsp)
+ movq %xmm1, 16(%rsp)
+ call _glapi_get_dispatch
+ movq 16(%rsp), %xmm1
+ movq 8(%rsp), %xmm0
+ movq (%rsp), %rdi
+ addq $24, %rsp
+ movq 3088(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(MultiTexCoord2fARB), .-GL_PREFIX(MultiTexCoord2fARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(MultiTexCoord2fvARB)
+ .type GL_PREFIX(MultiTexCoord2fvARB), @function
+GL_PREFIX(MultiTexCoord2fvARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 3096(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 3096(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 3096(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 3096(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(MultiTexCoord2fvARB), .-GL_PREFIX(MultiTexCoord2fvARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(MultiTexCoord2iARB)
+ .type GL_PREFIX(MultiTexCoord2iARB), @function
+GL_PREFIX(MultiTexCoord2iARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 3104(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 3104(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 3104(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 3104(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(MultiTexCoord2iARB), .-GL_PREFIX(MultiTexCoord2iARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(MultiTexCoord2ivARB)
+ .type GL_PREFIX(MultiTexCoord2ivARB), @function
+GL_PREFIX(MultiTexCoord2ivARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 3112(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 3112(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 3112(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 3112(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(MultiTexCoord2ivARB), .-GL_PREFIX(MultiTexCoord2ivARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(MultiTexCoord2sARB)
+ .type GL_PREFIX(MultiTexCoord2sARB), @function
+GL_PREFIX(MultiTexCoord2sARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 3120(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 3120(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 3120(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 3120(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(MultiTexCoord2sARB), .-GL_PREFIX(MultiTexCoord2sARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(MultiTexCoord2svARB)
+ .type GL_PREFIX(MultiTexCoord2svARB), @function
+GL_PREFIX(MultiTexCoord2svARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 3128(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 3128(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 3128(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 3128(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(MultiTexCoord2svARB), .-GL_PREFIX(MultiTexCoord2svARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(MultiTexCoord3dARB)
+ .type GL_PREFIX(MultiTexCoord3dARB), @function
+GL_PREFIX(MultiTexCoord3dARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 3136(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ subq $40, %rsp
+ movq %rdi, (%rsp)
+ movq %xmm0, 8(%rsp)
+ movq %xmm1, 16(%rsp)
+ movq %xmm2, 24(%rsp)
+ call _x86_64_get_dispatch@PLT
+ movq 24(%rsp), %xmm2
+ movq 16(%rsp), %xmm1
+ movq 8(%rsp), %xmm0
+ movq (%rsp), %rdi
+ addq $40, %rsp
+ movq 3136(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 3136(%rax), %r11
+ jmp *%r11
+1:
+ subq $40, %rsp
+ movq %rdi, (%rsp)
+ movq %xmm0, 8(%rsp)
+ movq %xmm1, 16(%rsp)
+ movq %xmm2, 24(%rsp)
+ call _glapi_get_dispatch
+ movq 24(%rsp), %xmm2
+ movq 16(%rsp), %xmm1
+ movq 8(%rsp), %xmm0
+ movq (%rsp), %rdi
+ addq $40, %rsp
+ movq 3136(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(MultiTexCoord3dARB), .-GL_PREFIX(MultiTexCoord3dARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(MultiTexCoord3dvARB)
+ .type GL_PREFIX(MultiTexCoord3dvARB), @function
+GL_PREFIX(MultiTexCoord3dvARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 3144(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 3144(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 3144(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 3144(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(MultiTexCoord3dvARB), .-GL_PREFIX(MultiTexCoord3dvARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(MultiTexCoord3fARB)
+ .type GL_PREFIX(MultiTexCoord3fARB), @function
+GL_PREFIX(MultiTexCoord3fARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 3152(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ subq $40, %rsp
+ movq %rdi, (%rsp)
+ movq %xmm0, 8(%rsp)
+ movq %xmm1, 16(%rsp)
+ movq %xmm2, 24(%rsp)
+ call _x86_64_get_dispatch@PLT
+ movq 24(%rsp), %xmm2
+ movq 16(%rsp), %xmm1
+ movq 8(%rsp), %xmm0
+ movq (%rsp), %rdi
+ addq $40, %rsp
+ movq 3152(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 3152(%rax), %r11
+ jmp *%r11
+1:
+ subq $40, %rsp
+ movq %rdi, (%rsp)
+ movq %xmm0, 8(%rsp)
+ movq %xmm1, 16(%rsp)
+ movq %xmm2, 24(%rsp)
+ call _glapi_get_dispatch
+ movq 24(%rsp), %xmm2
+ movq 16(%rsp), %xmm1
+ movq 8(%rsp), %xmm0
+ movq (%rsp), %rdi
+ addq $40, %rsp
+ movq 3152(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(MultiTexCoord3fARB), .-GL_PREFIX(MultiTexCoord3fARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(MultiTexCoord3fvARB)
+ .type GL_PREFIX(MultiTexCoord3fvARB), @function
+GL_PREFIX(MultiTexCoord3fvARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 3160(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 3160(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 3160(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 3160(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(MultiTexCoord3fvARB), .-GL_PREFIX(MultiTexCoord3fvARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(MultiTexCoord3iARB)
+ .type GL_PREFIX(MultiTexCoord3iARB), @function
+GL_PREFIX(MultiTexCoord3iARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 3168(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 3168(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 3168(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 3168(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(MultiTexCoord3iARB), .-GL_PREFIX(MultiTexCoord3iARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(MultiTexCoord3ivARB)
+ .type GL_PREFIX(MultiTexCoord3ivARB), @function
+GL_PREFIX(MultiTexCoord3ivARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 3176(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 3176(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 3176(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 3176(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(MultiTexCoord3ivARB), .-GL_PREFIX(MultiTexCoord3ivARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(MultiTexCoord3sARB)
+ .type GL_PREFIX(MultiTexCoord3sARB), @function
+GL_PREFIX(MultiTexCoord3sARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 3184(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 3184(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 3184(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 3184(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(MultiTexCoord3sARB), .-GL_PREFIX(MultiTexCoord3sARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(MultiTexCoord3svARB)
+ .type GL_PREFIX(MultiTexCoord3svARB), @function
+GL_PREFIX(MultiTexCoord3svARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 3192(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 3192(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 3192(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 3192(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(MultiTexCoord3svARB), .-GL_PREFIX(MultiTexCoord3svARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(MultiTexCoord4dARB)
+ .type GL_PREFIX(MultiTexCoord4dARB), @function
+GL_PREFIX(MultiTexCoord4dARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 3200(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ subq $40, %rsp
+ movq %rdi, (%rsp)
+ movq %xmm0, 8(%rsp)
+ movq %xmm1, 16(%rsp)
+ movq %xmm2, 24(%rsp)
+ movq %xmm3, 32(%rsp)
+ call _x86_64_get_dispatch@PLT
+ movq 32(%rsp), %xmm3
+ movq 24(%rsp), %xmm2
+ movq 16(%rsp), %xmm1
+ movq 8(%rsp), %xmm0
+ movq (%rsp), %rdi
+ addq $40, %rsp
+ movq 3200(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 3200(%rax), %r11
+ jmp *%r11
+1:
+ subq $40, %rsp
+ movq %rdi, (%rsp)
+ movq %xmm0, 8(%rsp)
+ movq %xmm1, 16(%rsp)
+ movq %xmm2, 24(%rsp)
+ movq %xmm3, 32(%rsp)
+ call _glapi_get_dispatch
+ movq 32(%rsp), %xmm3
+ movq 24(%rsp), %xmm2
+ movq 16(%rsp), %xmm1
+ movq 8(%rsp), %xmm0
+ movq (%rsp), %rdi
+ addq $40, %rsp
+ movq 3200(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(MultiTexCoord4dARB), .-GL_PREFIX(MultiTexCoord4dARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(MultiTexCoord4dvARB)
+ .type GL_PREFIX(MultiTexCoord4dvARB), @function
+GL_PREFIX(MultiTexCoord4dvARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 3208(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 3208(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 3208(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 3208(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(MultiTexCoord4dvARB), .-GL_PREFIX(MultiTexCoord4dvARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(MultiTexCoord4fARB)
+ .type GL_PREFIX(MultiTexCoord4fARB), @function
+GL_PREFIX(MultiTexCoord4fARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 3216(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ subq $40, %rsp
+ movq %rdi, (%rsp)
+ movq %xmm0, 8(%rsp)
+ movq %xmm1, 16(%rsp)
+ movq %xmm2, 24(%rsp)
+ movq %xmm3, 32(%rsp)
+ call _x86_64_get_dispatch@PLT
+ movq 32(%rsp), %xmm3
+ movq 24(%rsp), %xmm2
+ movq 16(%rsp), %xmm1
+ movq 8(%rsp), %xmm0
+ movq (%rsp), %rdi
+ addq $40, %rsp
+ movq 3216(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 3216(%rax), %r11
+ jmp *%r11
+1:
+ subq $40, %rsp
+ movq %rdi, (%rsp)
+ movq %xmm0, 8(%rsp)
+ movq %xmm1, 16(%rsp)
+ movq %xmm2, 24(%rsp)
+ movq %xmm3, 32(%rsp)
+ call _glapi_get_dispatch
+ movq 32(%rsp), %xmm3
+ movq 24(%rsp), %xmm2
+ movq 16(%rsp), %xmm1
+ movq 8(%rsp), %xmm0
+ movq (%rsp), %rdi
+ addq $40, %rsp
+ movq 3216(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(MultiTexCoord4fARB), .-GL_PREFIX(MultiTexCoord4fARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(MultiTexCoord4fvARB)
+ .type GL_PREFIX(MultiTexCoord4fvARB), @function
+GL_PREFIX(MultiTexCoord4fvARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 3224(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 3224(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 3224(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 3224(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(MultiTexCoord4fvARB), .-GL_PREFIX(MultiTexCoord4fvARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(MultiTexCoord4iARB)
+ .type GL_PREFIX(MultiTexCoord4iARB), @function
+GL_PREFIX(MultiTexCoord4iARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 3232(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ call _x86_64_get_dispatch@PLT
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 3232(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 3232(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ call _glapi_get_dispatch
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 3232(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(MultiTexCoord4iARB), .-GL_PREFIX(MultiTexCoord4iARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(MultiTexCoord4ivARB)
+ .type GL_PREFIX(MultiTexCoord4ivARB), @function
+GL_PREFIX(MultiTexCoord4ivARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 3240(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 3240(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 3240(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 3240(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(MultiTexCoord4ivARB), .-GL_PREFIX(MultiTexCoord4ivARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(MultiTexCoord4sARB)
+ .type GL_PREFIX(MultiTexCoord4sARB), @function
+GL_PREFIX(MultiTexCoord4sARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 3248(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ call _x86_64_get_dispatch@PLT
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 3248(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 3248(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ call _glapi_get_dispatch
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 3248(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(MultiTexCoord4sARB), .-GL_PREFIX(MultiTexCoord4sARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(MultiTexCoord4svARB)
+ .type GL_PREFIX(MultiTexCoord4svARB), @function
+GL_PREFIX(MultiTexCoord4svARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 3256(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 3256(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 3256(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 3256(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(MultiTexCoord4svARB), .-GL_PREFIX(MultiTexCoord4svARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(AttachShader)
+ .type GL_PREFIX(AttachShader), @function
+GL_PREFIX(AttachShader):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 3264(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 3264(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 3264(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 3264(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(AttachShader), .-GL_PREFIX(AttachShader)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(CreateProgram)
+ .type GL_PREFIX(CreateProgram), @function
+GL_PREFIX(CreateProgram):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 3272(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ movq 3272(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 3272(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ movq 3272(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(CreateProgram), .-GL_PREFIX(CreateProgram)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(CreateShader)
+ .type GL_PREFIX(CreateShader), @function
+GL_PREFIX(CreateShader):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 3280(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 3280(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 3280(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 3280(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(CreateShader), .-GL_PREFIX(CreateShader)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(DeleteProgram)
+ .type GL_PREFIX(DeleteProgram), @function
+GL_PREFIX(DeleteProgram):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 3288(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 3288(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 3288(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 3288(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(DeleteProgram), .-GL_PREFIX(DeleteProgram)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(DeleteShader)
+ .type GL_PREFIX(DeleteShader), @function
+GL_PREFIX(DeleteShader):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 3296(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 3296(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 3296(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 3296(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(DeleteShader), .-GL_PREFIX(DeleteShader)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(DetachShader)
+ .type GL_PREFIX(DetachShader), @function
+GL_PREFIX(DetachShader):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 3304(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 3304(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 3304(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 3304(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(DetachShader), .-GL_PREFIX(DetachShader)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(GetAttachedShaders)
+ .type GL_PREFIX(GetAttachedShaders), @function
+GL_PREFIX(GetAttachedShaders):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 3312(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 3312(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 3312(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 3312(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(GetAttachedShaders), .-GL_PREFIX(GetAttachedShaders)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(GetProgramInfoLog)
+ .type GL_PREFIX(GetProgramInfoLog), @function
+GL_PREFIX(GetProgramInfoLog):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 3320(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 3320(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 3320(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 3320(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(GetProgramInfoLog), .-GL_PREFIX(GetProgramInfoLog)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(GetProgramiv)
+ .type GL_PREFIX(GetProgramiv), @function
+GL_PREFIX(GetProgramiv):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 3328(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 3328(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 3328(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 3328(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(GetProgramiv), .-GL_PREFIX(GetProgramiv)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(GetShaderInfoLog)
+ .type GL_PREFIX(GetShaderInfoLog), @function
+GL_PREFIX(GetShaderInfoLog):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 3336(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 3336(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 3336(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 3336(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(GetShaderInfoLog), .-GL_PREFIX(GetShaderInfoLog)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(GetShaderiv)
+ .type GL_PREFIX(GetShaderiv), @function
+GL_PREFIX(GetShaderiv):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 3344(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 3344(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 3344(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 3344(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(GetShaderiv), .-GL_PREFIX(GetShaderiv)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(IsProgram)
+ .type GL_PREFIX(IsProgram), @function
+GL_PREFIX(IsProgram):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 3352(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 3352(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 3352(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 3352(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(IsProgram), .-GL_PREFIX(IsProgram)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(IsShader)
+ .type GL_PREFIX(IsShader), @function
+GL_PREFIX(IsShader):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 3360(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 3360(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 3360(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 3360(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(IsShader), .-GL_PREFIX(IsShader)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(StencilFuncSeparate)
+ .type GL_PREFIX(StencilFuncSeparate), @function
+GL_PREFIX(StencilFuncSeparate):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 3368(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 3368(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 3368(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 3368(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(StencilFuncSeparate), .-GL_PREFIX(StencilFuncSeparate)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(StencilMaskSeparate)
+ .type GL_PREFIX(StencilMaskSeparate), @function
+GL_PREFIX(StencilMaskSeparate):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 3376(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 3376(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 3376(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 3376(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(StencilMaskSeparate), .-GL_PREFIX(StencilMaskSeparate)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(StencilOpSeparate)
+ .type GL_PREFIX(StencilOpSeparate), @function
+GL_PREFIX(StencilOpSeparate):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 3384(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 3384(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 3384(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 3384(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(StencilOpSeparate), .-GL_PREFIX(StencilOpSeparate)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(UniformMatrix2x3fv)
+ .type GL_PREFIX(UniformMatrix2x3fv), @function
+GL_PREFIX(UniformMatrix2x3fv):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 3392(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 3392(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 3392(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 3392(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(UniformMatrix2x3fv), .-GL_PREFIX(UniformMatrix2x3fv)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(UniformMatrix2x4fv)
+ .type GL_PREFIX(UniformMatrix2x4fv), @function
+GL_PREFIX(UniformMatrix2x4fv):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 3400(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 3400(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 3400(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 3400(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(UniformMatrix2x4fv), .-GL_PREFIX(UniformMatrix2x4fv)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(UniformMatrix3x2fv)
+ .type GL_PREFIX(UniformMatrix3x2fv), @function
+GL_PREFIX(UniformMatrix3x2fv):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 3408(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 3408(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 3408(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 3408(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(UniformMatrix3x2fv), .-GL_PREFIX(UniformMatrix3x2fv)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(UniformMatrix3x4fv)
+ .type GL_PREFIX(UniformMatrix3x4fv), @function
+GL_PREFIX(UniformMatrix3x4fv):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 3416(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 3416(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 3416(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 3416(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(UniformMatrix3x4fv), .-GL_PREFIX(UniformMatrix3x4fv)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(UniformMatrix4x2fv)
+ .type GL_PREFIX(UniformMatrix4x2fv), @function
+GL_PREFIX(UniformMatrix4x2fv):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 3424(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 3424(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 3424(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 3424(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(UniformMatrix4x2fv), .-GL_PREFIX(UniformMatrix4x2fv)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(UniformMatrix4x3fv)
+ .type GL_PREFIX(UniformMatrix4x3fv), @function
+GL_PREFIX(UniformMatrix4x3fv):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 3432(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 3432(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 3432(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 3432(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(UniformMatrix4x3fv), .-GL_PREFIX(UniformMatrix4x3fv)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(ClampColor)
+ .type GL_PREFIX(ClampColor), @function
+GL_PREFIX(ClampColor):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 3440(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 3440(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 3440(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 3440(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(ClampColor), .-GL_PREFIX(ClampColor)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(ClearBufferfi)
+ .type GL_PREFIX(ClearBufferfi), @function
+GL_PREFIX(ClearBufferfi):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 3448(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ subq $40, %rsp
+ movq %rdi, (%rsp)
+ movq %rsi, 8(%rsp)
+ movq %xmm0, 16(%rsp)
+ movq %rdx, 24(%rsp)
+ call _x86_64_get_dispatch@PLT
+ movq 24(%rsp), %rdx
+ movq 16(%rsp), %xmm0
+ movq 8(%rsp), %rsi
+ movq (%rsp), %rdi
+ addq $40, %rsp
+ movq 3448(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 3448(%rax), %r11
+ jmp *%r11
+1:
+ subq $40, %rsp
+ movq %rdi, (%rsp)
+ movq %rsi, 8(%rsp)
+ movq %xmm0, 16(%rsp)
+ movq %rdx, 24(%rsp)
+ call _glapi_get_dispatch
+ movq 24(%rsp), %rdx
+ movq 16(%rsp), %xmm0
+ movq 8(%rsp), %rsi
+ movq (%rsp), %rdi
+ addq $40, %rsp
+ movq 3448(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(ClearBufferfi), .-GL_PREFIX(ClearBufferfi)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(ClearBufferfv)
+ .type GL_PREFIX(ClearBufferfv), @function
+GL_PREFIX(ClearBufferfv):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 3456(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 3456(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 3456(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 3456(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(ClearBufferfv), .-GL_PREFIX(ClearBufferfv)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(ClearBufferiv)
+ .type GL_PREFIX(ClearBufferiv), @function
+GL_PREFIX(ClearBufferiv):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 3464(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 3464(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 3464(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 3464(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(ClearBufferiv), .-GL_PREFIX(ClearBufferiv)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(ClearBufferuiv)
+ .type GL_PREFIX(ClearBufferuiv), @function
+GL_PREFIX(ClearBufferuiv):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 3472(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 3472(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 3472(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 3472(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(ClearBufferuiv), .-GL_PREFIX(ClearBufferuiv)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(GetStringi)
+ .type GL_PREFIX(GetStringi), @function
+GL_PREFIX(GetStringi):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 3480(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 3480(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 3480(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 3480(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(GetStringi), .-GL_PREFIX(GetStringi)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(TexBuffer)
+ .type GL_PREFIX(TexBuffer), @function
+GL_PREFIX(TexBuffer):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 3488(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 3488(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 3488(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 3488(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(TexBuffer), .-GL_PREFIX(TexBuffer)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(FramebufferTexture)
+ .type GL_PREFIX(FramebufferTexture), @function
+GL_PREFIX(FramebufferTexture):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 3496(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 3496(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 3496(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 3496(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(FramebufferTexture), .-GL_PREFIX(FramebufferTexture)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(GetBufferParameteri64v)
+ .type GL_PREFIX(GetBufferParameteri64v), @function
+GL_PREFIX(GetBufferParameteri64v):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 3504(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 3504(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 3504(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 3504(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(GetBufferParameteri64v), .-GL_PREFIX(GetBufferParameteri64v)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(GetInteger64i_v)
+ .type GL_PREFIX(GetInteger64i_v), @function
+GL_PREFIX(GetInteger64i_v):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 3512(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 3512(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 3512(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 3512(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(GetInteger64i_v), .-GL_PREFIX(GetInteger64i_v)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(VertexAttribDivisor)
+ .type GL_PREFIX(VertexAttribDivisor), @function
+GL_PREFIX(VertexAttribDivisor):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 3520(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 3520(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 3520(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 3520(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(VertexAttribDivisor), .-GL_PREFIX(VertexAttribDivisor)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(LoadTransposeMatrixdARB)
+ .type GL_PREFIX(LoadTransposeMatrixdARB), @function
+GL_PREFIX(LoadTransposeMatrixdARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 3528(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 3528(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 3528(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 3528(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(LoadTransposeMatrixdARB), .-GL_PREFIX(LoadTransposeMatrixdARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(LoadTransposeMatrixfARB)
+ .type GL_PREFIX(LoadTransposeMatrixfARB), @function
+GL_PREFIX(LoadTransposeMatrixfARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 3536(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 3536(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 3536(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 3536(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(LoadTransposeMatrixfARB), .-GL_PREFIX(LoadTransposeMatrixfARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(MultTransposeMatrixdARB)
+ .type GL_PREFIX(MultTransposeMatrixdARB), @function
+GL_PREFIX(MultTransposeMatrixdARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 3544(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 3544(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 3544(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 3544(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(MultTransposeMatrixdARB), .-GL_PREFIX(MultTransposeMatrixdARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(MultTransposeMatrixfARB)
+ .type GL_PREFIX(MultTransposeMatrixfARB), @function
+GL_PREFIX(MultTransposeMatrixfARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 3552(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 3552(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 3552(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 3552(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(MultTransposeMatrixfARB), .-GL_PREFIX(MultTransposeMatrixfARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(SampleCoverageARB)
+ .type GL_PREFIX(SampleCoverageARB), @function
+GL_PREFIX(SampleCoverageARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 3560(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 3560(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 3560(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 3560(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(SampleCoverageARB), .-GL_PREFIX(SampleCoverageARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(CompressedTexImage1DARB)
+ .type GL_PREFIX(CompressedTexImage1DARB), @function
+GL_PREFIX(CompressedTexImage1DARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 3568(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ pushq %r9
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %r9
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 3568(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 3568(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ pushq %r9
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %r9
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 3568(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(CompressedTexImage1DARB), .-GL_PREFIX(CompressedTexImage1DARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(CompressedTexImage2DARB)
+ .type GL_PREFIX(CompressedTexImage2DARB), @function
+GL_PREFIX(CompressedTexImage2DARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 3576(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ pushq %r9
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %r9
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 3576(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 3576(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ pushq %r9
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %r9
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 3576(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(CompressedTexImage2DARB), .-GL_PREFIX(CompressedTexImage2DARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(CompressedTexImage3DARB)
+ .type GL_PREFIX(CompressedTexImage3DARB), @function
+GL_PREFIX(CompressedTexImage3DARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 3584(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ pushq %r9
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %r9
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 3584(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 3584(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ pushq %r9
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %r9
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 3584(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(CompressedTexImage3DARB), .-GL_PREFIX(CompressedTexImage3DARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(CompressedTexSubImage1DARB)
+ .type GL_PREFIX(CompressedTexSubImage1DARB), @function
+GL_PREFIX(CompressedTexSubImage1DARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 3592(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ pushq %r9
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %r9
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 3592(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 3592(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ pushq %r9
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %r9
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 3592(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(CompressedTexSubImage1DARB), .-GL_PREFIX(CompressedTexSubImage1DARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(CompressedTexSubImage2DARB)
+ .type GL_PREFIX(CompressedTexSubImage2DARB), @function
+GL_PREFIX(CompressedTexSubImage2DARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 3600(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ pushq %r9
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %r9
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 3600(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 3600(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ pushq %r9
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %r9
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 3600(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(CompressedTexSubImage2DARB), .-GL_PREFIX(CompressedTexSubImage2DARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(CompressedTexSubImage3DARB)
+ .type GL_PREFIX(CompressedTexSubImage3DARB), @function
+GL_PREFIX(CompressedTexSubImage3DARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 3608(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ pushq %r9
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %r9
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 3608(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 3608(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ pushq %r9
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %r9
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 3608(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(CompressedTexSubImage3DARB), .-GL_PREFIX(CompressedTexSubImage3DARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(GetCompressedTexImageARB)
+ .type GL_PREFIX(GetCompressedTexImageARB), @function
+GL_PREFIX(GetCompressedTexImageARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 3616(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 3616(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 3616(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 3616(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(GetCompressedTexImageARB), .-GL_PREFIX(GetCompressedTexImageARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(DisableVertexAttribArrayARB)
+ .type GL_PREFIX(DisableVertexAttribArrayARB), @function
+GL_PREFIX(DisableVertexAttribArrayARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 3624(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 3624(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 3624(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 3624(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(DisableVertexAttribArrayARB), .-GL_PREFIX(DisableVertexAttribArrayARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(EnableVertexAttribArrayARB)
+ .type GL_PREFIX(EnableVertexAttribArrayARB), @function
+GL_PREFIX(EnableVertexAttribArrayARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 3632(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 3632(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 3632(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 3632(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(EnableVertexAttribArrayARB), .-GL_PREFIX(EnableVertexAttribArrayARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(GetProgramEnvParameterdvARB)
+ .type GL_PREFIX(GetProgramEnvParameterdvARB), @function
+GL_PREFIX(GetProgramEnvParameterdvARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 3640(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 3640(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 3640(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 3640(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(GetProgramEnvParameterdvARB), .-GL_PREFIX(GetProgramEnvParameterdvARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(GetProgramEnvParameterfvARB)
+ .type GL_PREFIX(GetProgramEnvParameterfvARB), @function
+GL_PREFIX(GetProgramEnvParameterfvARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 3648(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 3648(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 3648(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 3648(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(GetProgramEnvParameterfvARB), .-GL_PREFIX(GetProgramEnvParameterfvARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(GetProgramLocalParameterdvARB)
+ .type GL_PREFIX(GetProgramLocalParameterdvARB), @function
+GL_PREFIX(GetProgramLocalParameterdvARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 3656(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 3656(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 3656(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 3656(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(GetProgramLocalParameterdvARB), .-GL_PREFIX(GetProgramLocalParameterdvARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(GetProgramLocalParameterfvARB)
+ .type GL_PREFIX(GetProgramLocalParameterfvARB), @function
+GL_PREFIX(GetProgramLocalParameterfvARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 3664(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 3664(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 3664(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 3664(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(GetProgramLocalParameterfvARB), .-GL_PREFIX(GetProgramLocalParameterfvARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(GetProgramStringARB)
+ .type GL_PREFIX(GetProgramStringARB), @function
+GL_PREFIX(GetProgramStringARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 3672(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 3672(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 3672(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 3672(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(GetProgramStringARB), .-GL_PREFIX(GetProgramStringARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(GetProgramivARB)
+ .type GL_PREFIX(GetProgramivARB), @function
+GL_PREFIX(GetProgramivARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 3680(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 3680(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 3680(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 3680(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(GetProgramivARB), .-GL_PREFIX(GetProgramivARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(GetVertexAttribdvARB)
+ .type GL_PREFIX(GetVertexAttribdvARB), @function
+GL_PREFIX(GetVertexAttribdvARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 3688(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 3688(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 3688(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 3688(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(GetVertexAttribdvARB), .-GL_PREFIX(GetVertexAttribdvARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(GetVertexAttribfvARB)
+ .type GL_PREFIX(GetVertexAttribfvARB), @function
+GL_PREFIX(GetVertexAttribfvARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 3696(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 3696(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 3696(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 3696(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(GetVertexAttribfvARB), .-GL_PREFIX(GetVertexAttribfvARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(GetVertexAttribivARB)
+ .type GL_PREFIX(GetVertexAttribivARB), @function
+GL_PREFIX(GetVertexAttribivARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 3704(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 3704(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 3704(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 3704(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(GetVertexAttribivARB), .-GL_PREFIX(GetVertexAttribivARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(ProgramEnvParameter4dARB)
+ .type GL_PREFIX(ProgramEnvParameter4dARB), @function
+GL_PREFIX(ProgramEnvParameter4dARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 3712(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ subq $56, %rsp
+ movq %rdi, (%rsp)
+ movq %rsi, 8(%rsp)
+ movq %xmm0, 16(%rsp)
+ movq %xmm1, 24(%rsp)
+ movq %xmm2, 32(%rsp)
+ movq %xmm3, 40(%rsp)
+ call _x86_64_get_dispatch@PLT
+ movq 40(%rsp), %xmm3
+ movq 32(%rsp), %xmm2
+ movq 24(%rsp), %xmm1
+ movq 16(%rsp), %xmm0
+ movq 8(%rsp), %rsi
+ movq (%rsp), %rdi
+ addq $56, %rsp
+ movq 3712(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 3712(%rax), %r11
+ jmp *%r11
+1:
+ subq $56, %rsp
+ movq %rdi, (%rsp)
+ movq %rsi, 8(%rsp)
+ movq %xmm0, 16(%rsp)
+ movq %xmm1, 24(%rsp)
+ movq %xmm2, 32(%rsp)
+ movq %xmm3, 40(%rsp)
+ call _glapi_get_dispatch
+ movq 40(%rsp), %xmm3
+ movq 32(%rsp), %xmm2
+ movq 24(%rsp), %xmm1
+ movq 16(%rsp), %xmm0
+ movq 8(%rsp), %rsi
+ movq (%rsp), %rdi
+ addq $56, %rsp
+ movq 3712(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(ProgramEnvParameter4dARB), .-GL_PREFIX(ProgramEnvParameter4dARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(ProgramEnvParameter4dvARB)
+ .type GL_PREFIX(ProgramEnvParameter4dvARB), @function
+GL_PREFIX(ProgramEnvParameter4dvARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 3720(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 3720(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 3720(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 3720(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(ProgramEnvParameter4dvARB), .-GL_PREFIX(ProgramEnvParameter4dvARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(ProgramEnvParameter4fARB)
+ .type GL_PREFIX(ProgramEnvParameter4fARB), @function
+GL_PREFIX(ProgramEnvParameter4fARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 3728(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ subq $56, %rsp
+ movq %rdi, (%rsp)
+ movq %rsi, 8(%rsp)
+ movq %xmm0, 16(%rsp)
+ movq %xmm1, 24(%rsp)
+ movq %xmm2, 32(%rsp)
+ movq %xmm3, 40(%rsp)
+ call _x86_64_get_dispatch@PLT
+ movq 40(%rsp), %xmm3
+ movq 32(%rsp), %xmm2
+ movq 24(%rsp), %xmm1
+ movq 16(%rsp), %xmm0
+ movq 8(%rsp), %rsi
+ movq (%rsp), %rdi
+ addq $56, %rsp
+ movq 3728(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 3728(%rax), %r11
+ jmp *%r11
+1:
+ subq $56, %rsp
+ movq %rdi, (%rsp)
+ movq %rsi, 8(%rsp)
+ movq %xmm0, 16(%rsp)
+ movq %xmm1, 24(%rsp)
+ movq %xmm2, 32(%rsp)
+ movq %xmm3, 40(%rsp)
+ call _glapi_get_dispatch
+ movq 40(%rsp), %xmm3
+ movq 32(%rsp), %xmm2
+ movq 24(%rsp), %xmm1
+ movq 16(%rsp), %xmm0
+ movq 8(%rsp), %rsi
+ movq (%rsp), %rdi
+ addq $56, %rsp
+ movq 3728(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(ProgramEnvParameter4fARB), .-GL_PREFIX(ProgramEnvParameter4fARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(ProgramEnvParameter4fvARB)
+ .type GL_PREFIX(ProgramEnvParameter4fvARB), @function
+GL_PREFIX(ProgramEnvParameter4fvARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 3736(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 3736(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 3736(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 3736(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(ProgramEnvParameter4fvARB), .-GL_PREFIX(ProgramEnvParameter4fvARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(ProgramLocalParameter4dARB)
+ .type GL_PREFIX(ProgramLocalParameter4dARB), @function
+GL_PREFIX(ProgramLocalParameter4dARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 3744(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ subq $56, %rsp
+ movq %rdi, (%rsp)
+ movq %rsi, 8(%rsp)
+ movq %xmm0, 16(%rsp)
+ movq %xmm1, 24(%rsp)
+ movq %xmm2, 32(%rsp)
+ movq %xmm3, 40(%rsp)
+ call _x86_64_get_dispatch@PLT
+ movq 40(%rsp), %xmm3
+ movq 32(%rsp), %xmm2
+ movq 24(%rsp), %xmm1
+ movq 16(%rsp), %xmm0
+ movq 8(%rsp), %rsi
+ movq (%rsp), %rdi
+ addq $56, %rsp
+ movq 3744(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 3744(%rax), %r11
+ jmp *%r11
+1:
+ subq $56, %rsp
+ movq %rdi, (%rsp)
+ movq %rsi, 8(%rsp)
+ movq %xmm0, 16(%rsp)
+ movq %xmm1, 24(%rsp)
+ movq %xmm2, 32(%rsp)
+ movq %xmm3, 40(%rsp)
+ call _glapi_get_dispatch
+ movq 40(%rsp), %xmm3
+ movq 32(%rsp), %xmm2
+ movq 24(%rsp), %xmm1
+ movq 16(%rsp), %xmm0
+ movq 8(%rsp), %rsi
+ movq (%rsp), %rdi
+ addq $56, %rsp
+ movq 3744(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(ProgramLocalParameter4dARB), .-GL_PREFIX(ProgramLocalParameter4dARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(ProgramLocalParameter4dvARB)
+ .type GL_PREFIX(ProgramLocalParameter4dvARB), @function
+GL_PREFIX(ProgramLocalParameter4dvARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 3752(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 3752(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 3752(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 3752(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(ProgramLocalParameter4dvARB), .-GL_PREFIX(ProgramLocalParameter4dvARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(ProgramLocalParameter4fARB)
+ .type GL_PREFIX(ProgramLocalParameter4fARB), @function
+GL_PREFIX(ProgramLocalParameter4fARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 3760(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ subq $56, %rsp
+ movq %rdi, (%rsp)
+ movq %rsi, 8(%rsp)
+ movq %xmm0, 16(%rsp)
+ movq %xmm1, 24(%rsp)
+ movq %xmm2, 32(%rsp)
+ movq %xmm3, 40(%rsp)
+ call _x86_64_get_dispatch@PLT
+ movq 40(%rsp), %xmm3
+ movq 32(%rsp), %xmm2
+ movq 24(%rsp), %xmm1
+ movq 16(%rsp), %xmm0
+ movq 8(%rsp), %rsi
+ movq (%rsp), %rdi
+ addq $56, %rsp
+ movq 3760(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 3760(%rax), %r11
+ jmp *%r11
+1:
+ subq $56, %rsp
+ movq %rdi, (%rsp)
+ movq %rsi, 8(%rsp)
+ movq %xmm0, 16(%rsp)
+ movq %xmm1, 24(%rsp)
+ movq %xmm2, 32(%rsp)
+ movq %xmm3, 40(%rsp)
+ call _glapi_get_dispatch
+ movq 40(%rsp), %xmm3
+ movq 32(%rsp), %xmm2
+ movq 24(%rsp), %xmm1
+ movq 16(%rsp), %xmm0
+ movq 8(%rsp), %rsi
+ movq (%rsp), %rdi
+ addq $56, %rsp
+ movq 3760(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(ProgramLocalParameter4fARB), .-GL_PREFIX(ProgramLocalParameter4fARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(ProgramLocalParameter4fvARB)
+ .type GL_PREFIX(ProgramLocalParameter4fvARB), @function
+GL_PREFIX(ProgramLocalParameter4fvARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 3768(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 3768(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 3768(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 3768(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(ProgramLocalParameter4fvARB), .-GL_PREFIX(ProgramLocalParameter4fvARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(ProgramStringARB)
+ .type GL_PREFIX(ProgramStringARB), @function
+GL_PREFIX(ProgramStringARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 3776(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 3776(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 3776(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 3776(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(ProgramStringARB), .-GL_PREFIX(ProgramStringARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(VertexAttrib1dARB)
+ .type GL_PREFIX(VertexAttrib1dARB), @function
+GL_PREFIX(VertexAttrib1dARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 3784(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ subq $24, %rsp
+ movq %rdi, (%rsp)
+ movq %xmm0, 8(%rsp)
+ call _x86_64_get_dispatch@PLT
+ movq 8(%rsp), %xmm0
+ movq (%rsp), %rdi
+ addq $24, %rsp
+ movq 3784(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 3784(%rax), %r11
+ jmp *%r11
+1:
+ subq $24, %rsp
+ movq %rdi, (%rsp)
+ movq %xmm0, 8(%rsp)
+ call _glapi_get_dispatch
+ movq 8(%rsp), %xmm0
+ movq (%rsp), %rdi
+ addq $24, %rsp
+ movq 3784(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(VertexAttrib1dARB), .-GL_PREFIX(VertexAttrib1dARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(VertexAttrib1dvARB)
+ .type GL_PREFIX(VertexAttrib1dvARB), @function
+GL_PREFIX(VertexAttrib1dvARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 3792(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 3792(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 3792(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 3792(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(VertexAttrib1dvARB), .-GL_PREFIX(VertexAttrib1dvARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(VertexAttrib1fARB)
+ .type GL_PREFIX(VertexAttrib1fARB), @function
+GL_PREFIX(VertexAttrib1fARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 3800(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ subq $24, %rsp
+ movq %rdi, (%rsp)
+ movq %xmm0, 8(%rsp)
+ call _x86_64_get_dispatch@PLT
+ movq 8(%rsp), %xmm0
+ movq (%rsp), %rdi
+ addq $24, %rsp
+ movq 3800(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 3800(%rax), %r11
+ jmp *%r11
+1:
+ subq $24, %rsp
+ movq %rdi, (%rsp)
+ movq %xmm0, 8(%rsp)
+ call _glapi_get_dispatch
+ movq 8(%rsp), %xmm0
+ movq (%rsp), %rdi
+ addq $24, %rsp
+ movq 3800(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(VertexAttrib1fARB), .-GL_PREFIX(VertexAttrib1fARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(VertexAttrib1fvARB)
+ .type GL_PREFIX(VertexAttrib1fvARB), @function
+GL_PREFIX(VertexAttrib1fvARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 3808(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 3808(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 3808(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 3808(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(VertexAttrib1fvARB), .-GL_PREFIX(VertexAttrib1fvARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(VertexAttrib1sARB)
+ .type GL_PREFIX(VertexAttrib1sARB), @function
+GL_PREFIX(VertexAttrib1sARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 3816(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 3816(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 3816(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 3816(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(VertexAttrib1sARB), .-GL_PREFIX(VertexAttrib1sARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(VertexAttrib1svARB)
+ .type GL_PREFIX(VertexAttrib1svARB), @function
+GL_PREFIX(VertexAttrib1svARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 3824(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 3824(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 3824(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 3824(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(VertexAttrib1svARB), .-GL_PREFIX(VertexAttrib1svARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(VertexAttrib2dARB)
+ .type GL_PREFIX(VertexAttrib2dARB), @function
+GL_PREFIX(VertexAttrib2dARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 3832(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ subq $24, %rsp
+ movq %rdi, (%rsp)
+ movq %xmm0, 8(%rsp)
+ movq %xmm1, 16(%rsp)
+ call _x86_64_get_dispatch@PLT
+ movq 16(%rsp), %xmm1
+ movq 8(%rsp), %xmm0
+ movq (%rsp), %rdi
+ addq $24, %rsp
+ movq 3832(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 3832(%rax), %r11
+ jmp *%r11
+1:
+ subq $24, %rsp
+ movq %rdi, (%rsp)
+ movq %xmm0, 8(%rsp)
+ movq %xmm1, 16(%rsp)
+ call _glapi_get_dispatch
+ movq 16(%rsp), %xmm1
+ movq 8(%rsp), %xmm0
+ movq (%rsp), %rdi
+ addq $24, %rsp
+ movq 3832(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(VertexAttrib2dARB), .-GL_PREFIX(VertexAttrib2dARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(VertexAttrib2dvARB)
+ .type GL_PREFIX(VertexAttrib2dvARB), @function
+GL_PREFIX(VertexAttrib2dvARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 3840(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 3840(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 3840(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 3840(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(VertexAttrib2dvARB), .-GL_PREFIX(VertexAttrib2dvARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(VertexAttrib2fARB)
+ .type GL_PREFIX(VertexAttrib2fARB), @function
+GL_PREFIX(VertexAttrib2fARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 3848(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ subq $24, %rsp
+ movq %rdi, (%rsp)
+ movq %xmm0, 8(%rsp)
+ movq %xmm1, 16(%rsp)
+ call _x86_64_get_dispatch@PLT
+ movq 16(%rsp), %xmm1
+ movq 8(%rsp), %xmm0
+ movq (%rsp), %rdi
+ addq $24, %rsp
+ movq 3848(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 3848(%rax), %r11
+ jmp *%r11
+1:
+ subq $24, %rsp
+ movq %rdi, (%rsp)
+ movq %xmm0, 8(%rsp)
+ movq %xmm1, 16(%rsp)
+ call _glapi_get_dispatch
+ movq 16(%rsp), %xmm1
+ movq 8(%rsp), %xmm0
+ movq (%rsp), %rdi
+ addq $24, %rsp
+ movq 3848(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(VertexAttrib2fARB), .-GL_PREFIX(VertexAttrib2fARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(VertexAttrib2fvARB)
+ .type GL_PREFIX(VertexAttrib2fvARB), @function
+GL_PREFIX(VertexAttrib2fvARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 3856(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 3856(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 3856(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 3856(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(VertexAttrib2fvARB), .-GL_PREFIX(VertexAttrib2fvARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(VertexAttrib2sARB)
+ .type GL_PREFIX(VertexAttrib2sARB), @function
+GL_PREFIX(VertexAttrib2sARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 3864(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 3864(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 3864(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 3864(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(VertexAttrib2sARB), .-GL_PREFIX(VertexAttrib2sARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(VertexAttrib2svARB)
+ .type GL_PREFIX(VertexAttrib2svARB), @function
+GL_PREFIX(VertexAttrib2svARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 3872(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 3872(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 3872(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 3872(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(VertexAttrib2svARB), .-GL_PREFIX(VertexAttrib2svARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(VertexAttrib3dARB)
+ .type GL_PREFIX(VertexAttrib3dARB), @function
+GL_PREFIX(VertexAttrib3dARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 3880(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ subq $40, %rsp
+ movq %rdi, (%rsp)
+ movq %xmm0, 8(%rsp)
+ movq %xmm1, 16(%rsp)
+ movq %xmm2, 24(%rsp)
+ call _x86_64_get_dispatch@PLT
+ movq 24(%rsp), %xmm2
+ movq 16(%rsp), %xmm1
+ movq 8(%rsp), %xmm0
+ movq (%rsp), %rdi
+ addq $40, %rsp
+ movq 3880(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 3880(%rax), %r11
+ jmp *%r11
+1:
+ subq $40, %rsp
+ movq %rdi, (%rsp)
+ movq %xmm0, 8(%rsp)
+ movq %xmm1, 16(%rsp)
+ movq %xmm2, 24(%rsp)
+ call _glapi_get_dispatch
+ movq 24(%rsp), %xmm2
+ movq 16(%rsp), %xmm1
+ movq 8(%rsp), %xmm0
+ movq (%rsp), %rdi
+ addq $40, %rsp
+ movq 3880(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(VertexAttrib3dARB), .-GL_PREFIX(VertexAttrib3dARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(VertexAttrib3dvARB)
+ .type GL_PREFIX(VertexAttrib3dvARB), @function
+GL_PREFIX(VertexAttrib3dvARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 3888(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 3888(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 3888(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 3888(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(VertexAttrib3dvARB), .-GL_PREFIX(VertexAttrib3dvARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(VertexAttrib3fARB)
+ .type GL_PREFIX(VertexAttrib3fARB), @function
+GL_PREFIX(VertexAttrib3fARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 3896(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ subq $40, %rsp
+ movq %rdi, (%rsp)
+ movq %xmm0, 8(%rsp)
+ movq %xmm1, 16(%rsp)
+ movq %xmm2, 24(%rsp)
+ call _x86_64_get_dispatch@PLT
+ movq 24(%rsp), %xmm2
+ movq 16(%rsp), %xmm1
+ movq 8(%rsp), %xmm0
+ movq (%rsp), %rdi
+ addq $40, %rsp
+ movq 3896(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 3896(%rax), %r11
+ jmp *%r11
+1:
+ subq $40, %rsp
+ movq %rdi, (%rsp)
+ movq %xmm0, 8(%rsp)
+ movq %xmm1, 16(%rsp)
+ movq %xmm2, 24(%rsp)
+ call _glapi_get_dispatch
+ movq 24(%rsp), %xmm2
+ movq 16(%rsp), %xmm1
+ movq 8(%rsp), %xmm0
+ movq (%rsp), %rdi
+ addq $40, %rsp
+ movq 3896(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(VertexAttrib3fARB), .-GL_PREFIX(VertexAttrib3fARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(VertexAttrib3fvARB)
+ .type GL_PREFIX(VertexAttrib3fvARB), @function
+GL_PREFIX(VertexAttrib3fvARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 3904(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 3904(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 3904(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 3904(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(VertexAttrib3fvARB), .-GL_PREFIX(VertexAttrib3fvARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(VertexAttrib3sARB)
+ .type GL_PREFIX(VertexAttrib3sARB), @function
+GL_PREFIX(VertexAttrib3sARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 3912(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 3912(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 3912(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 3912(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(VertexAttrib3sARB), .-GL_PREFIX(VertexAttrib3sARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(VertexAttrib3svARB)
+ .type GL_PREFIX(VertexAttrib3svARB), @function
+GL_PREFIX(VertexAttrib3svARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 3920(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 3920(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 3920(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 3920(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(VertexAttrib3svARB), .-GL_PREFIX(VertexAttrib3svARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(VertexAttrib4NbvARB)
+ .type GL_PREFIX(VertexAttrib4NbvARB), @function
+GL_PREFIX(VertexAttrib4NbvARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 3928(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 3928(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 3928(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 3928(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(VertexAttrib4NbvARB), .-GL_PREFIX(VertexAttrib4NbvARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(VertexAttrib4NivARB)
+ .type GL_PREFIX(VertexAttrib4NivARB), @function
+GL_PREFIX(VertexAttrib4NivARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 3936(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 3936(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 3936(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 3936(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(VertexAttrib4NivARB), .-GL_PREFIX(VertexAttrib4NivARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(VertexAttrib4NsvARB)
+ .type GL_PREFIX(VertexAttrib4NsvARB), @function
+GL_PREFIX(VertexAttrib4NsvARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 3944(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 3944(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 3944(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 3944(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(VertexAttrib4NsvARB), .-GL_PREFIX(VertexAttrib4NsvARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(VertexAttrib4NubARB)
+ .type GL_PREFIX(VertexAttrib4NubARB), @function
+GL_PREFIX(VertexAttrib4NubARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 3952(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ call _x86_64_get_dispatch@PLT
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 3952(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 3952(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ call _glapi_get_dispatch
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 3952(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(VertexAttrib4NubARB), .-GL_PREFIX(VertexAttrib4NubARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(VertexAttrib4NubvARB)
+ .type GL_PREFIX(VertexAttrib4NubvARB), @function
+GL_PREFIX(VertexAttrib4NubvARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 3960(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 3960(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 3960(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 3960(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(VertexAttrib4NubvARB), .-GL_PREFIX(VertexAttrib4NubvARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(VertexAttrib4NuivARB)
+ .type GL_PREFIX(VertexAttrib4NuivARB), @function
+GL_PREFIX(VertexAttrib4NuivARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 3968(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 3968(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 3968(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 3968(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(VertexAttrib4NuivARB), .-GL_PREFIX(VertexAttrib4NuivARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(VertexAttrib4NusvARB)
+ .type GL_PREFIX(VertexAttrib4NusvARB), @function
+GL_PREFIX(VertexAttrib4NusvARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 3976(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 3976(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 3976(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 3976(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(VertexAttrib4NusvARB), .-GL_PREFIX(VertexAttrib4NusvARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(VertexAttrib4bvARB)
+ .type GL_PREFIX(VertexAttrib4bvARB), @function
+GL_PREFIX(VertexAttrib4bvARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 3984(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 3984(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 3984(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 3984(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(VertexAttrib4bvARB), .-GL_PREFIX(VertexAttrib4bvARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(VertexAttrib4dARB)
+ .type GL_PREFIX(VertexAttrib4dARB), @function
+GL_PREFIX(VertexAttrib4dARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 3992(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ subq $40, %rsp
+ movq %rdi, (%rsp)
+ movq %xmm0, 8(%rsp)
+ movq %xmm1, 16(%rsp)
+ movq %xmm2, 24(%rsp)
+ movq %xmm3, 32(%rsp)
+ call _x86_64_get_dispatch@PLT
+ movq 32(%rsp), %xmm3
+ movq 24(%rsp), %xmm2
+ movq 16(%rsp), %xmm1
+ movq 8(%rsp), %xmm0
+ movq (%rsp), %rdi
+ addq $40, %rsp
+ movq 3992(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 3992(%rax), %r11
+ jmp *%r11
+1:
+ subq $40, %rsp
+ movq %rdi, (%rsp)
+ movq %xmm0, 8(%rsp)
+ movq %xmm1, 16(%rsp)
+ movq %xmm2, 24(%rsp)
+ movq %xmm3, 32(%rsp)
+ call _glapi_get_dispatch
+ movq 32(%rsp), %xmm3
+ movq 24(%rsp), %xmm2
+ movq 16(%rsp), %xmm1
+ movq 8(%rsp), %xmm0
+ movq (%rsp), %rdi
+ addq $40, %rsp
+ movq 3992(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(VertexAttrib4dARB), .-GL_PREFIX(VertexAttrib4dARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(VertexAttrib4dvARB)
+ .type GL_PREFIX(VertexAttrib4dvARB), @function
+GL_PREFIX(VertexAttrib4dvARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 4000(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 4000(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 4000(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 4000(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(VertexAttrib4dvARB), .-GL_PREFIX(VertexAttrib4dvARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(VertexAttrib4fARB)
+ .type GL_PREFIX(VertexAttrib4fARB), @function
+GL_PREFIX(VertexAttrib4fARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 4008(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ subq $40, %rsp
+ movq %rdi, (%rsp)
+ movq %xmm0, 8(%rsp)
+ movq %xmm1, 16(%rsp)
+ movq %xmm2, 24(%rsp)
+ movq %xmm3, 32(%rsp)
+ call _x86_64_get_dispatch@PLT
+ movq 32(%rsp), %xmm3
+ movq 24(%rsp), %xmm2
+ movq 16(%rsp), %xmm1
+ movq 8(%rsp), %xmm0
+ movq (%rsp), %rdi
+ addq $40, %rsp
+ movq 4008(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 4008(%rax), %r11
+ jmp *%r11
+1:
+ subq $40, %rsp
+ movq %rdi, (%rsp)
+ movq %xmm0, 8(%rsp)
+ movq %xmm1, 16(%rsp)
+ movq %xmm2, 24(%rsp)
+ movq %xmm3, 32(%rsp)
+ call _glapi_get_dispatch
+ movq 32(%rsp), %xmm3
+ movq 24(%rsp), %xmm2
+ movq 16(%rsp), %xmm1
+ movq 8(%rsp), %xmm0
+ movq (%rsp), %rdi
+ addq $40, %rsp
+ movq 4008(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(VertexAttrib4fARB), .-GL_PREFIX(VertexAttrib4fARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(VertexAttrib4fvARB)
+ .type GL_PREFIX(VertexAttrib4fvARB), @function
+GL_PREFIX(VertexAttrib4fvARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 4016(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 4016(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 4016(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 4016(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(VertexAttrib4fvARB), .-GL_PREFIX(VertexAttrib4fvARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(VertexAttrib4ivARB)
+ .type GL_PREFIX(VertexAttrib4ivARB), @function
+GL_PREFIX(VertexAttrib4ivARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 4024(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 4024(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 4024(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 4024(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(VertexAttrib4ivARB), .-GL_PREFIX(VertexAttrib4ivARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(VertexAttrib4sARB)
+ .type GL_PREFIX(VertexAttrib4sARB), @function
+GL_PREFIX(VertexAttrib4sARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 4032(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ call _x86_64_get_dispatch@PLT
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 4032(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 4032(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ call _glapi_get_dispatch
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 4032(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(VertexAttrib4sARB), .-GL_PREFIX(VertexAttrib4sARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(VertexAttrib4svARB)
+ .type GL_PREFIX(VertexAttrib4svARB), @function
+GL_PREFIX(VertexAttrib4svARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 4040(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 4040(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 4040(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 4040(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(VertexAttrib4svARB), .-GL_PREFIX(VertexAttrib4svARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(VertexAttrib4ubvARB)
+ .type GL_PREFIX(VertexAttrib4ubvARB), @function
+GL_PREFIX(VertexAttrib4ubvARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 4048(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 4048(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 4048(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 4048(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(VertexAttrib4ubvARB), .-GL_PREFIX(VertexAttrib4ubvARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(VertexAttrib4uivARB)
+ .type GL_PREFIX(VertexAttrib4uivARB), @function
+GL_PREFIX(VertexAttrib4uivARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 4056(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 4056(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 4056(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 4056(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(VertexAttrib4uivARB), .-GL_PREFIX(VertexAttrib4uivARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(VertexAttrib4usvARB)
+ .type GL_PREFIX(VertexAttrib4usvARB), @function
+GL_PREFIX(VertexAttrib4usvARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 4064(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 4064(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 4064(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 4064(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(VertexAttrib4usvARB), .-GL_PREFIX(VertexAttrib4usvARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(VertexAttribPointerARB)
+ .type GL_PREFIX(VertexAttribPointerARB), @function
+GL_PREFIX(VertexAttribPointerARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 4072(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ pushq %r9
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %r9
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 4072(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 4072(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ pushq %r9
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %r9
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 4072(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(VertexAttribPointerARB), .-GL_PREFIX(VertexAttribPointerARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(BindBufferARB)
+ .type GL_PREFIX(BindBufferARB), @function
+GL_PREFIX(BindBufferARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 4080(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 4080(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 4080(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 4080(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(BindBufferARB), .-GL_PREFIX(BindBufferARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(BufferDataARB)
+ .type GL_PREFIX(BufferDataARB), @function
+GL_PREFIX(BufferDataARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 4088(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 4088(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 4088(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 4088(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(BufferDataARB), .-GL_PREFIX(BufferDataARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(BufferSubDataARB)
+ .type GL_PREFIX(BufferSubDataARB), @function
+GL_PREFIX(BufferSubDataARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 4096(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 4096(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 4096(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 4096(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(BufferSubDataARB), .-GL_PREFIX(BufferSubDataARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(DeleteBuffersARB)
+ .type GL_PREFIX(DeleteBuffersARB), @function
+GL_PREFIX(DeleteBuffersARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 4104(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 4104(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 4104(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 4104(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(DeleteBuffersARB), .-GL_PREFIX(DeleteBuffersARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(GenBuffersARB)
+ .type GL_PREFIX(GenBuffersARB), @function
+GL_PREFIX(GenBuffersARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 4112(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 4112(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 4112(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 4112(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(GenBuffersARB), .-GL_PREFIX(GenBuffersARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(GetBufferParameterivARB)
+ .type GL_PREFIX(GetBufferParameterivARB), @function
+GL_PREFIX(GetBufferParameterivARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 4120(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 4120(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 4120(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 4120(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(GetBufferParameterivARB), .-GL_PREFIX(GetBufferParameterivARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(GetBufferPointervARB)
+ .type GL_PREFIX(GetBufferPointervARB), @function
+GL_PREFIX(GetBufferPointervARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 4128(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 4128(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 4128(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 4128(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(GetBufferPointervARB), .-GL_PREFIX(GetBufferPointervARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(GetBufferSubDataARB)
+ .type GL_PREFIX(GetBufferSubDataARB), @function
+GL_PREFIX(GetBufferSubDataARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 4136(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 4136(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 4136(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 4136(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(GetBufferSubDataARB), .-GL_PREFIX(GetBufferSubDataARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(IsBufferARB)
+ .type GL_PREFIX(IsBufferARB), @function
+GL_PREFIX(IsBufferARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 4144(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 4144(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 4144(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 4144(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(IsBufferARB), .-GL_PREFIX(IsBufferARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(MapBufferARB)
+ .type GL_PREFIX(MapBufferARB), @function
+GL_PREFIX(MapBufferARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 4152(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 4152(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 4152(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 4152(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(MapBufferARB), .-GL_PREFIX(MapBufferARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(UnmapBufferARB)
+ .type GL_PREFIX(UnmapBufferARB), @function
+GL_PREFIX(UnmapBufferARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 4160(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 4160(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 4160(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 4160(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(UnmapBufferARB), .-GL_PREFIX(UnmapBufferARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(BeginQueryARB)
+ .type GL_PREFIX(BeginQueryARB), @function
+GL_PREFIX(BeginQueryARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 4168(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 4168(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 4168(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 4168(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(BeginQueryARB), .-GL_PREFIX(BeginQueryARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(DeleteQueriesARB)
+ .type GL_PREFIX(DeleteQueriesARB), @function
+GL_PREFIX(DeleteQueriesARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 4176(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 4176(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 4176(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 4176(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(DeleteQueriesARB), .-GL_PREFIX(DeleteQueriesARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(EndQueryARB)
+ .type GL_PREFIX(EndQueryARB), @function
+GL_PREFIX(EndQueryARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 4184(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 4184(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 4184(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 4184(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(EndQueryARB), .-GL_PREFIX(EndQueryARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(GenQueriesARB)
+ .type GL_PREFIX(GenQueriesARB), @function
+GL_PREFIX(GenQueriesARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 4192(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 4192(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 4192(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 4192(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(GenQueriesARB), .-GL_PREFIX(GenQueriesARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(GetQueryObjectivARB)
+ .type GL_PREFIX(GetQueryObjectivARB), @function
+GL_PREFIX(GetQueryObjectivARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 4200(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 4200(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 4200(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 4200(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(GetQueryObjectivARB), .-GL_PREFIX(GetQueryObjectivARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(GetQueryObjectuivARB)
+ .type GL_PREFIX(GetQueryObjectuivARB), @function
+GL_PREFIX(GetQueryObjectuivARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 4208(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 4208(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 4208(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 4208(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(GetQueryObjectuivARB), .-GL_PREFIX(GetQueryObjectuivARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(GetQueryivARB)
+ .type GL_PREFIX(GetQueryivARB), @function
+GL_PREFIX(GetQueryivARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 4216(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 4216(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 4216(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 4216(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(GetQueryivARB), .-GL_PREFIX(GetQueryivARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(IsQueryARB)
+ .type GL_PREFIX(IsQueryARB), @function
+GL_PREFIX(IsQueryARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 4224(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 4224(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 4224(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 4224(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(IsQueryARB), .-GL_PREFIX(IsQueryARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(AttachObjectARB)
+ .type GL_PREFIX(AttachObjectARB), @function
+GL_PREFIX(AttachObjectARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 4232(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 4232(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 4232(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 4232(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(AttachObjectARB), .-GL_PREFIX(AttachObjectARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(CompileShaderARB)
+ .type GL_PREFIX(CompileShaderARB), @function
+GL_PREFIX(CompileShaderARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 4240(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 4240(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 4240(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 4240(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(CompileShaderARB), .-GL_PREFIX(CompileShaderARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(CreateProgramObjectARB)
+ .type GL_PREFIX(CreateProgramObjectARB), @function
+GL_PREFIX(CreateProgramObjectARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 4248(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ movq 4248(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 4248(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ movq 4248(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(CreateProgramObjectARB), .-GL_PREFIX(CreateProgramObjectARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(CreateShaderObjectARB)
+ .type GL_PREFIX(CreateShaderObjectARB), @function
+GL_PREFIX(CreateShaderObjectARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 4256(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 4256(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 4256(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 4256(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(CreateShaderObjectARB), .-GL_PREFIX(CreateShaderObjectARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(DeleteObjectARB)
+ .type GL_PREFIX(DeleteObjectARB), @function
+GL_PREFIX(DeleteObjectARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 4264(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 4264(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 4264(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 4264(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(DeleteObjectARB), .-GL_PREFIX(DeleteObjectARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(DetachObjectARB)
+ .type GL_PREFIX(DetachObjectARB), @function
+GL_PREFIX(DetachObjectARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 4272(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 4272(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 4272(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 4272(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(DetachObjectARB), .-GL_PREFIX(DetachObjectARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(GetActiveUniformARB)
+ .type GL_PREFIX(GetActiveUniformARB), @function
+GL_PREFIX(GetActiveUniformARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 4280(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ pushq %r9
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %r9
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 4280(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 4280(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ pushq %r9
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %r9
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 4280(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(GetActiveUniformARB), .-GL_PREFIX(GetActiveUniformARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(GetAttachedObjectsARB)
+ .type GL_PREFIX(GetAttachedObjectsARB), @function
+GL_PREFIX(GetAttachedObjectsARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 4288(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 4288(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 4288(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 4288(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(GetAttachedObjectsARB), .-GL_PREFIX(GetAttachedObjectsARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(GetHandleARB)
+ .type GL_PREFIX(GetHandleARB), @function
+GL_PREFIX(GetHandleARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 4296(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 4296(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 4296(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 4296(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(GetHandleARB), .-GL_PREFIX(GetHandleARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(GetInfoLogARB)
+ .type GL_PREFIX(GetInfoLogARB), @function
+GL_PREFIX(GetInfoLogARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 4304(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 4304(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 4304(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 4304(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(GetInfoLogARB), .-GL_PREFIX(GetInfoLogARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(GetObjectParameterfvARB)
+ .type GL_PREFIX(GetObjectParameterfvARB), @function
+GL_PREFIX(GetObjectParameterfvARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 4312(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 4312(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 4312(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 4312(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(GetObjectParameterfvARB), .-GL_PREFIX(GetObjectParameterfvARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(GetObjectParameterivARB)
+ .type GL_PREFIX(GetObjectParameterivARB), @function
+GL_PREFIX(GetObjectParameterivARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 4320(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 4320(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 4320(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 4320(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(GetObjectParameterivARB), .-GL_PREFIX(GetObjectParameterivARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(GetShaderSourceARB)
+ .type GL_PREFIX(GetShaderSourceARB), @function
+GL_PREFIX(GetShaderSourceARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 4328(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 4328(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 4328(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 4328(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(GetShaderSourceARB), .-GL_PREFIX(GetShaderSourceARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(GetUniformLocationARB)
+ .type GL_PREFIX(GetUniformLocationARB), @function
+GL_PREFIX(GetUniformLocationARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 4336(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 4336(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 4336(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 4336(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(GetUniformLocationARB), .-GL_PREFIX(GetUniformLocationARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(GetUniformfvARB)
+ .type GL_PREFIX(GetUniformfvARB), @function
+GL_PREFIX(GetUniformfvARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 4344(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 4344(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 4344(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 4344(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(GetUniformfvARB), .-GL_PREFIX(GetUniformfvARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(GetUniformivARB)
+ .type GL_PREFIX(GetUniformivARB), @function
+GL_PREFIX(GetUniformivARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 4352(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 4352(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 4352(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 4352(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(GetUniformivARB), .-GL_PREFIX(GetUniformivARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(LinkProgramARB)
+ .type GL_PREFIX(LinkProgramARB), @function
+GL_PREFIX(LinkProgramARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 4360(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 4360(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 4360(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 4360(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(LinkProgramARB), .-GL_PREFIX(LinkProgramARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(ShaderSourceARB)
+ .type GL_PREFIX(ShaderSourceARB), @function
+GL_PREFIX(ShaderSourceARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 4368(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 4368(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 4368(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 4368(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(ShaderSourceARB), .-GL_PREFIX(ShaderSourceARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(Uniform1fARB)
+ .type GL_PREFIX(Uniform1fARB), @function
+GL_PREFIX(Uniform1fARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 4376(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ subq $24, %rsp
+ movq %rdi, (%rsp)
+ movq %xmm0, 8(%rsp)
+ call _x86_64_get_dispatch@PLT
+ movq 8(%rsp), %xmm0
+ movq (%rsp), %rdi
+ addq $24, %rsp
+ movq 4376(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 4376(%rax), %r11
+ jmp *%r11
+1:
+ subq $24, %rsp
+ movq %rdi, (%rsp)
+ movq %xmm0, 8(%rsp)
+ call _glapi_get_dispatch
+ movq 8(%rsp), %xmm0
+ movq (%rsp), %rdi
+ addq $24, %rsp
+ movq 4376(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(Uniform1fARB), .-GL_PREFIX(Uniform1fARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(Uniform1fvARB)
+ .type GL_PREFIX(Uniform1fvARB), @function
+GL_PREFIX(Uniform1fvARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 4384(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 4384(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 4384(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 4384(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(Uniform1fvARB), .-GL_PREFIX(Uniform1fvARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(Uniform1iARB)
+ .type GL_PREFIX(Uniform1iARB), @function
+GL_PREFIX(Uniform1iARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 4392(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 4392(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 4392(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 4392(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(Uniform1iARB), .-GL_PREFIX(Uniform1iARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(Uniform1ivARB)
+ .type GL_PREFIX(Uniform1ivARB), @function
+GL_PREFIX(Uniform1ivARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 4400(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 4400(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 4400(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 4400(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(Uniform1ivARB), .-GL_PREFIX(Uniform1ivARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(Uniform2fARB)
+ .type GL_PREFIX(Uniform2fARB), @function
+GL_PREFIX(Uniform2fARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 4408(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ subq $24, %rsp
+ movq %rdi, (%rsp)
+ movq %xmm0, 8(%rsp)
+ movq %xmm1, 16(%rsp)
+ call _x86_64_get_dispatch@PLT
+ movq 16(%rsp), %xmm1
+ movq 8(%rsp), %xmm0
+ movq (%rsp), %rdi
+ addq $24, %rsp
+ movq 4408(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 4408(%rax), %r11
+ jmp *%r11
+1:
+ subq $24, %rsp
+ movq %rdi, (%rsp)
+ movq %xmm0, 8(%rsp)
+ movq %xmm1, 16(%rsp)
+ call _glapi_get_dispatch
+ movq 16(%rsp), %xmm1
+ movq 8(%rsp), %xmm0
+ movq (%rsp), %rdi
+ addq $24, %rsp
+ movq 4408(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(Uniform2fARB), .-GL_PREFIX(Uniform2fARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(Uniform2fvARB)
+ .type GL_PREFIX(Uniform2fvARB), @function
+GL_PREFIX(Uniform2fvARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 4416(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 4416(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 4416(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 4416(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(Uniform2fvARB), .-GL_PREFIX(Uniform2fvARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(Uniform2iARB)
+ .type GL_PREFIX(Uniform2iARB), @function
+GL_PREFIX(Uniform2iARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 4424(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 4424(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 4424(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 4424(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(Uniform2iARB), .-GL_PREFIX(Uniform2iARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(Uniform2ivARB)
+ .type GL_PREFIX(Uniform2ivARB), @function
+GL_PREFIX(Uniform2ivARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 4432(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 4432(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 4432(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 4432(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(Uniform2ivARB), .-GL_PREFIX(Uniform2ivARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(Uniform3fARB)
+ .type GL_PREFIX(Uniform3fARB), @function
+GL_PREFIX(Uniform3fARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 4440(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ subq $40, %rsp
+ movq %rdi, (%rsp)
+ movq %xmm0, 8(%rsp)
+ movq %xmm1, 16(%rsp)
+ movq %xmm2, 24(%rsp)
+ call _x86_64_get_dispatch@PLT
+ movq 24(%rsp), %xmm2
+ movq 16(%rsp), %xmm1
+ movq 8(%rsp), %xmm0
+ movq (%rsp), %rdi
+ addq $40, %rsp
+ movq 4440(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 4440(%rax), %r11
+ jmp *%r11
+1:
+ subq $40, %rsp
+ movq %rdi, (%rsp)
+ movq %xmm0, 8(%rsp)
+ movq %xmm1, 16(%rsp)
+ movq %xmm2, 24(%rsp)
+ call _glapi_get_dispatch
+ movq 24(%rsp), %xmm2
+ movq 16(%rsp), %xmm1
+ movq 8(%rsp), %xmm0
+ movq (%rsp), %rdi
+ addq $40, %rsp
+ movq 4440(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(Uniform3fARB), .-GL_PREFIX(Uniform3fARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(Uniform3fvARB)
+ .type GL_PREFIX(Uniform3fvARB), @function
+GL_PREFIX(Uniform3fvARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 4448(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 4448(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 4448(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 4448(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(Uniform3fvARB), .-GL_PREFIX(Uniform3fvARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(Uniform3iARB)
+ .type GL_PREFIX(Uniform3iARB), @function
+GL_PREFIX(Uniform3iARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 4456(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 4456(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 4456(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 4456(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(Uniform3iARB), .-GL_PREFIX(Uniform3iARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(Uniform3ivARB)
+ .type GL_PREFIX(Uniform3ivARB), @function
+GL_PREFIX(Uniform3ivARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 4464(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 4464(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 4464(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 4464(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(Uniform3ivARB), .-GL_PREFIX(Uniform3ivARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(Uniform4fARB)
+ .type GL_PREFIX(Uniform4fARB), @function
+GL_PREFIX(Uniform4fARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 4472(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ subq $40, %rsp
+ movq %rdi, (%rsp)
+ movq %xmm0, 8(%rsp)
+ movq %xmm1, 16(%rsp)
+ movq %xmm2, 24(%rsp)
+ movq %xmm3, 32(%rsp)
+ call _x86_64_get_dispatch@PLT
+ movq 32(%rsp), %xmm3
+ movq 24(%rsp), %xmm2
+ movq 16(%rsp), %xmm1
+ movq 8(%rsp), %xmm0
+ movq (%rsp), %rdi
+ addq $40, %rsp
+ movq 4472(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 4472(%rax), %r11
+ jmp *%r11
+1:
+ subq $40, %rsp
+ movq %rdi, (%rsp)
+ movq %xmm0, 8(%rsp)
+ movq %xmm1, 16(%rsp)
+ movq %xmm2, 24(%rsp)
+ movq %xmm3, 32(%rsp)
+ call _glapi_get_dispatch
+ movq 32(%rsp), %xmm3
+ movq 24(%rsp), %xmm2
+ movq 16(%rsp), %xmm1
+ movq 8(%rsp), %xmm0
+ movq (%rsp), %rdi
+ addq $40, %rsp
+ movq 4472(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(Uniform4fARB), .-GL_PREFIX(Uniform4fARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(Uniform4fvARB)
+ .type GL_PREFIX(Uniform4fvARB), @function
+GL_PREFIX(Uniform4fvARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 4480(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 4480(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 4480(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 4480(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(Uniform4fvARB), .-GL_PREFIX(Uniform4fvARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(Uniform4iARB)
+ .type GL_PREFIX(Uniform4iARB), @function
+GL_PREFIX(Uniform4iARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 4488(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ call _x86_64_get_dispatch@PLT
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 4488(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 4488(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ call _glapi_get_dispatch
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 4488(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(Uniform4iARB), .-GL_PREFIX(Uniform4iARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(Uniform4ivARB)
+ .type GL_PREFIX(Uniform4ivARB), @function
+GL_PREFIX(Uniform4ivARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 4496(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 4496(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 4496(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 4496(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(Uniform4ivARB), .-GL_PREFIX(Uniform4ivARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(UniformMatrix2fvARB)
+ .type GL_PREFIX(UniformMatrix2fvARB), @function
+GL_PREFIX(UniformMatrix2fvARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 4504(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 4504(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 4504(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 4504(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(UniformMatrix2fvARB), .-GL_PREFIX(UniformMatrix2fvARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(UniformMatrix3fvARB)
+ .type GL_PREFIX(UniformMatrix3fvARB), @function
+GL_PREFIX(UniformMatrix3fvARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 4512(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 4512(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 4512(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 4512(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(UniformMatrix3fvARB), .-GL_PREFIX(UniformMatrix3fvARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(UniformMatrix4fvARB)
+ .type GL_PREFIX(UniformMatrix4fvARB), @function
+GL_PREFIX(UniformMatrix4fvARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 4520(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 4520(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 4520(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 4520(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(UniformMatrix4fvARB), .-GL_PREFIX(UniformMatrix4fvARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(UseProgramObjectARB)
+ .type GL_PREFIX(UseProgramObjectARB), @function
+GL_PREFIX(UseProgramObjectARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 4528(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 4528(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 4528(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 4528(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(UseProgramObjectARB), .-GL_PREFIX(UseProgramObjectARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(ValidateProgramARB)
+ .type GL_PREFIX(ValidateProgramARB), @function
+GL_PREFIX(ValidateProgramARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 4536(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 4536(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 4536(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 4536(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(ValidateProgramARB), .-GL_PREFIX(ValidateProgramARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(BindAttribLocationARB)
+ .type GL_PREFIX(BindAttribLocationARB), @function
+GL_PREFIX(BindAttribLocationARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 4544(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 4544(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 4544(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 4544(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(BindAttribLocationARB), .-GL_PREFIX(BindAttribLocationARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(GetActiveAttribARB)
+ .type GL_PREFIX(GetActiveAttribARB), @function
+GL_PREFIX(GetActiveAttribARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 4552(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ pushq %r9
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %r9
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 4552(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 4552(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ pushq %r9
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %r9
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 4552(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(GetActiveAttribARB), .-GL_PREFIX(GetActiveAttribARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(GetAttribLocationARB)
+ .type GL_PREFIX(GetAttribLocationARB), @function
+GL_PREFIX(GetAttribLocationARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 4560(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 4560(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 4560(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 4560(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(GetAttribLocationARB), .-GL_PREFIX(GetAttribLocationARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(DrawBuffersARB)
+ .type GL_PREFIX(DrawBuffersARB), @function
+GL_PREFIX(DrawBuffersARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 4568(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 4568(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 4568(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 4568(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(DrawBuffersARB), .-GL_PREFIX(DrawBuffersARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(ClampColorARB)
+ .type GL_PREFIX(ClampColorARB), @function
+GL_PREFIX(ClampColorARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 4576(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 4576(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 4576(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 4576(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(ClampColorARB), .-GL_PREFIX(ClampColorARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(DrawArraysInstancedARB)
+ .type GL_PREFIX(DrawArraysInstancedARB), @function
+GL_PREFIX(DrawArraysInstancedARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 4584(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 4584(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 4584(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 4584(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(DrawArraysInstancedARB), .-GL_PREFIX(DrawArraysInstancedARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(DrawElementsInstancedARB)
+ .type GL_PREFIX(DrawElementsInstancedARB), @function
+GL_PREFIX(DrawElementsInstancedARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 4592(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ call _x86_64_get_dispatch@PLT
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 4592(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 4592(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ call _glapi_get_dispatch
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 4592(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(DrawElementsInstancedARB), .-GL_PREFIX(DrawElementsInstancedARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(RenderbufferStorageMultisample)
+ .type GL_PREFIX(RenderbufferStorageMultisample), @function
+GL_PREFIX(RenderbufferStorageMultisample):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 4600(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ call _x86_64_get_dispatch@PLT
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 4600(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 4600(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ call _glapi_get_dispatch
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 4600(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(RenderbufferStorageMultisample), .-GL_PREFIX(RenderbufferStorageMultisample)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(FramebufferTextureARB)
+ .type GL_PREFIX(FramebufferTextureARB), @function
+GL_PREFIX(FramebufferTextureARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 4608(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 4608(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 4608(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 4608(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(FramebufferTextureARB), .-GL_PREFIX(FramebufferTextureARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(FramebufferTextureFaceARB)
+ .type GL_PREFIX(FramebufferTextureFaceARB), @function
+GL_PREFIX(FramebufferTextureFaceARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 4616(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ call _x86_64_get_dispatch@PLT
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 4616(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 4616(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ call _glapi_get_dispatch
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 4616(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(FramebufferTextureFaceARB), .-GL_PREFIX(FramebufferTextureFaceARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(ProgramParameteriARB)
+ .type GL_PREFIX(ProgramParameteriARB), @function
+GL_PREFIX(ProgramParameteriARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 4624(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 4624(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 4624(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 4624(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(ProgramParameteriARB), .-GL_PREFIX(ProgramParameteriARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(VertexAttribDivisorARB)
+ .type GL_PREFIX(VertexAttribDivisorARB), @function
+GL_PREFIX(VertexAttribDivisorARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 4632(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 4632(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 4632(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 4632(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(VertexAttribDivisorARB), .-GL_PREFIX(VertexAttribDivisorARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(FlushMappedBufferRange)
+ .type GL_PREFIX(FlushMappedBufferRange), @function
+GL_PREFIX(FlushMappedBufferRange):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 4640(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 4640(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 4640(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 4640(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(FlushMappedBufferRange), .-GL_PREFIX(FlushMappedBufferRange)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(MapBufferRange)
+ .type GL_PREFIX(MapBufferRange), @function
+GL_PREFIX(MapBufferRange):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 4648(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 4648(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 4648(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 4648(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(MapBufferRange), .-GL_PREFIX(MapBufferRange)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(TexBufferARB)
+ .type GL_PREFIX(TexBufferARB), @function
+GL_PREFIX(TexBufferARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 4656(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 4656(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 4656(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 4656(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(TexBufferARB), .-GL_PREFIX(TexBufferARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(BindVertexArray)
+ .type GL_PREFIX(BindVertexArray), @function
+GL_PREFIX(BindVertexArray):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 4664(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 4664(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 4664(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 4664(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(BindVertexArray), .-GL_PREFIX(BindVertexArray)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(GenVertexArrays)
+ .type GL_PREFIX(GenVertexArrays), @function
+GL_PREFIX(GenVertexArrays):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 4672(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 4672(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 4672(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 4672(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(GenVertexArrays), .-GL_PREFIX(GenVertexArrays)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(CopyBufferSubData)
+ .type GL_PREFIX(CopyBufferSubData), @function
+GL_PREFIX(CopyBufferSubData):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 4680(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ call _x86_64_get_dispatch@PLT
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 4680(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 4680(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ call _glapi_get_dispatch
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 4680(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(CopyBufferSubData), .-GL_PREFIX(CopyBufferSubData)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(ClientWaitSync)
+ .type GL_PREFIX(ClientWaitSync), @function
+GL_PREFIX(ClientWaitSync):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 4688(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 4688(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 4688(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 4688(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(ClientWaitSync), .-GL_PREFIX(ClientWaitSync)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(DeleteSync)
+ .type GL_PREFIX(DeleteSync), @function
+GL_PREFIX(DeleteSync):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 4696(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 4696(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 4696(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 4696(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(DeleteSync), .-GL_PREFIX(DeleteSync)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(FenceSync)
+ .type GL_PREFIX(FenceSync), @function
+GL_PREFIX(FenceSync):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 4704(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 4704(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 4704(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 4704(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(FenceSync), .-GL_PREFIX(FenceSync)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(GetInteger64v)
+ .type GL_PREFIX(GetInteger64v), @function
+GL_PREFIX(GetInteger64v):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 4712(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 4712(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 4712(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 4712(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(GetInteger64v), .-GL_PREFIX(GetInteger64v)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(GetSynciv)
+ .type GL_PREFIX(GetSynciv), @function
+GL_PREFIX(GetSynciv):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 4720(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ call _x86_64_get_dispatch@PLT
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 4720(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 4720(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ call _glapi_get_dispatch
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 4720(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(GetSynciv), .-GL_PREFIX(GetSynciv)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(IsSync)
+ .type GL_PREFIX(IsSync), @function
+GL_PREFIX(IsSync):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 4728(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 4728(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 4728(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 4728(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(IsSync), .-GL_PREFIX(IsSync)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(WaitSync)
+ .type GL_PREFIX(WaitSync), @function
+GL_PREFIX(WaitSync):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 4736(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 4736(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 4736(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 4736(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(WaitSync), .-GL_PREFIX(WaitSync)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(DrawElementsBaseVertex)
+ .type GL_PREFIX(DrawElementsBaseVertex), @function
+GL_PREFIX(DrawElementsBaseVertex):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 4744(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ call _x86_64_get_dispatch@PLT
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 4744(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 4744(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ call _glapi_get_dispatch
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 4744(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(DrawElementsBaseVertex), .-GL_PREFIX(DrawElementsBaseVertex)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(DrawRangeElementsBaseVertex)
+ .type GL_PREFIX(DrawRangeElementsBaseVertex), @function
+GL_PREFIX(DrawRangeElementsBaseVertex):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 4752(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ pushq %r9
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %r9
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 4752(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 4752(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ pushq %r9
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %r9
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 4752(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(DrawRangeElementsBaseVertex), .-GL_PREFIX(DrawRangeElementsBaseVertex)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(MultiDrawElementsBaseVertex)
+ .type GL_PREFIX(MultiDrawElementsBaseVertex), @function
+GL_PREFIX(MultiDrawElementsBaseVertex):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 4760(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ pushq %r9
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %r9
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 4760(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 4760(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ pushq %r9
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %r9
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 4760(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(MultiDrawElementsBaseVertex), .-GL_PREFIX(MultiDrawElementsBaseVertex)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(BlendEquationSeparateiARB)
+ .type GL_PREFIX(BlendEquationSeparateiARB), @function
+GL_PREFIX(BlendEquationSeparateiARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 4768(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 4768(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 4768(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 4768(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(BlendEquationSeparateiARB), .-GL_PREFIX(BlendEquationSeparateiARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(BlendEquationiARB)
+ .type GL_PREFIX(BlendEquationiARB), @function
+GL_PREFIX(BlendEquationiARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 4776(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 4776(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 4776(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 4776(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(BlendEquationiARB), .-GL_PREFIX(BlendEquationiARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(BlendFuncSeparateiARB)
+ .type GL_PREFIX(BlendFuncSeparateiARB), @function
+GL_PREFIX(BlendFuncSeparateiARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 4784(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ call _x86_64_get_dispatch@PLT
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 4784(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 4784(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ call _glapi_get_dispatch
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 4784(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(BlendFuncSeparateiARB), .-GL_PREFIX(BlendFuncSeparateiARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(BlendFunciARB)
+ .type GL_PREFIX(BlendFunciARB), @function
+GL_PREFIX(BlendFunciARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 4792(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 4792(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 4792(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 4792(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(BlendFunciARB), .-GL_PREFIX(BlendFunciARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(BindSampler)
+ .type GL_PREFIX(BindSampler), @function
+GL_PREFIX(BindSampler):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 4800(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 4800(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 4800(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 4800(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(BindSampler), .-GL_PREFIX(BindSampler)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(DeleteSamplers)
+ .type GL_PREFIX(DeleteSamplers), @function
+GL_PREFIX(DeleteSamplers):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 4808(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 4808(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 4808(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 4808(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(DeleteSamplers), .-GL_PREFIX(DeleteSamplers)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(GenSamplers)
+ .type GL_PREFIX(GenSamplers), @function
+GL_PREFIX(GenSamplers):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 4816(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 4816(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 4816(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 4816(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(GenSamplers), .-GL_PREFIX(GenSamplers)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(GetSamplerParameterIiv)
+ .type GL_PREFIX(GetSamplerParameterIiv), @function
+GL_PREFIX(GetSamplerParameterIiv):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 4824(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 4824(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 4824(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 4824(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(GetSamplerParameterIiv), .-GL_PREFIX(GetSamplerParameterIiv)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(GetSamplerParameterIuiv)
+ .type GL_PREFIX(GetSamplerParameterIuiv), @function
+GL_PREFIX(GetSamplerParameterIuiv):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 4832(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 4832(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 4832(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 4832(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(GetSamplerParameterIuiv), .-GL_PREFIX(GetSamplerParameterIuiv)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(GetSamplerParameterfv)
+ .type GL_PREFIX(GetSamplerParameterfv), @function
+GL_PREFIX(GetSamplerParameterfv):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 4840(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 4840(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 4840(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 4840(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(GetSamplerParameterfv), .-GL_PREFIX(GetSamplerParameterfv)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(GetSamplerParameteriv)
+ .type GL_PREFIX(GetSamplerParameteriv), @function
+GL_PREFIX(GetSamplerParameteriv):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 4848(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 4848(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 4848(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 4848(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(GetSamplerParameteriv), .-GL_PREFIX(GetSamplerParameteriv)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(IsSampler)
+ .type GL_PREFIX(IsSampler), @function
+GL_PREFIX(IsSampler):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 4856(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 4856(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 4856(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 4856(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(IsSampler), .-GL_PREFIX(IsSampler)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(SamplerParameterIiv)
+ .type GL_PREFIX(SamplerParameterIiv), @function
+GL_PREFIX(SamplerParameterIiv):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 4864(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 4864(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 4864(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 4864(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(SamplerParameterIiv), .-GL_PREFIX(SamplerParameterIiv)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(SamplerParameterIuiv)
+ .type GL_PREFIX(SamplerParameterIuiv), @function
+GL_PREFIX(SamplerParameterIuiv):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 4872(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 4872(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 4872(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 4872(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(SamplerParameterIuiv), .-GL_PREFIX(SamplerParameterIuiv)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(SamplerParameterf)
+ .type GL_PREFIX(SamplerParameterf), @function
+GL_PREFIX(SamplerParameterf):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 4880(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ subq $24, %rsp
+ movq %rdi, (%rsp)
+ movq %rsi, 8(%rsp)
+ movq %xmm0, 16(%rsp)
+ call _x86_64_get_dispatch@PLT
+ movq 16(%rsp), %xmm0
+ movq 8(%rsp), %rsi
+ movq (%rsp), %rdi
+ addq $24, %rsp
+ movq 4880(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 4880(%rax), %r11
+ jmp *%r11
+1:
+ subq $24, %rsp
+ movq %rdi, (%rsp)
+ movq %rsi, 8(%rsp)
+ movq %xmm0, 16(%rsp)
+ call _glapi_get_dispatch
+ movq 16(%rsp), %xmm0
+ movq 8(%rsp), %rsi
+ movq (%rsp), %rdi
+ addq $24, %rsp
+ movq 4880(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(SamplerParameterf), .-GL_PREFIX(SamplerParameterf)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(SamplerParameterfv)
+ .type GL_PREFIX(SamplerParameterfv), @function
+GL_PREFIX(SamplerParameterfv):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 4888(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 4888(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 4888(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 4888(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(SamplerParameterfv), .-GL_PREFIX(SamplerParameterfv)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(SamplerParameteri)
+ .type GL_PREFIX(SamplerParameteri), @function
+GL_PREFIX(SamplerParameteri):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 4896(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 4896(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 4896(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 4896(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(SamplerParameteri), .-GL_PREFIX(SamplerParameteri)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(SamplerParameteriv)
+ .type GL_PREFIX(SamplerParameteriv), @function
+GL_PREFIX(SamplerParameteriv):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 4904(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 4904(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 4904(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 4904(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(SamplerParameteriv), .-GL_PREFIX(SamplerParameteriv)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(BindTransformFeedback)
+ .type GL_PREFIX(BindTransformFeedback), @function
+GL_PREFIX(BindTransformFeedback):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 4912(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 4912(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 4912(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 4912(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(BindTransformFeedback), .-GL_PREFIX(BindTransformFeedback)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(DeleteTransformFeedbacks)
+ .type GL_PREFIX(DeleteTransformFeedbacks), @function
+GL_PREFIX(DeleteTransformFeedbacks):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 4920(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 4920(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 4920(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 4920(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(DeleteTransformFeedbacks), .-GL_PREFIX(DeleteTransformFeedbacks)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(DrawTransformFeedback)
+ .type GL_PREFIX(DrawTransformFeedback), @function
+GL_PREFIX(DrawTransformFeedback):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 4928(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 4928(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 4928(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 4928(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(DrawTransformFeedback), .-GL_PREFIX(DrawTransformFeedback)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(GenTransformFeedbacks)
+ .type GL_PREFIX(GenTransformFeedbacks), @function
+GL_PREFIX(GenTransformFeedbacks):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 4936(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 4936(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 4936(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 4936(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(GenTransformFeedbacks), .-GL_PREFIX(GenTransformFeedbacks)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(IsTransformFeedback)
+ .type GL_PREFIX(IsTransformFeedback), @function
+GL_PREFIX(IsTransformFeedback):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 4944(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 4944(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 4944(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 4944(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(IsTransformFeedback), .-GL_PREFIX(IsTransformFeedback)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(PauseTransformFeedback)
+ .type GL_PREFIX(PauseTransformFeedback), @function
+GL_PREFIX(PauseTransformFeedback):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 4952(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ movq 4952(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 4952(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ movq 4952(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(PauseTransformFeedback), .-GL_PREFIX(PauseTransformFeedback)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(ResumeTransformFeedback)
+ .type GL_PREFIX(ResumeTransformFeedback), @function
+GL_PREFIX(ResumeTransformFeedback):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 4960(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ movq 4960(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 4960(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ movq 4960(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(ResumeTransformFeedback), .-GL_PREFIX(ResumeTransformFeedback)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(ClearDepthf)
+ .type GL_PREFIX(ClearDepthf), @function
+GL_PREFIX(ClearDepthf):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 4968(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 4968(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 4968(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 4968(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(ClearDepthf), .-GL_PREFIX(ClearDepthf)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(DepthRangef)
+ .type GL_PREFIX(DepthRangef), @function
+GL_PREFIX(DepthRangef):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 4976(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 4976(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 4976(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 4976(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(DepthRangef), .-GL_PREFIX(DepthRangef)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(GetShaderPrecisionFormat)
+ .type GL_PREFIX(GetShaderPrecisionFormat), @function
+GL_PREFIX(GetShaderPrecisionFormat):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 4984(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 4984(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 4984(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 4984(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(GetShaderPrecisionFormat), .-GL_PREFIX(GetShaderPrecisionFormat)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(ReleaseShaderCompiler)
+ .type GL_PREFIX(ReleaseShaderCompiler), @function
+GL_PREFIX(ReleaseShaderCompiler):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 4992(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ movq 4992(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 4992(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ movq 4992(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(ReleaseShaderCompiler), .-GL_PREFIX(ReleaseShaderCompiler)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(ShaderBinary)
+ .type GL_PREFIX(ShaderBinary), @function
+GL_PREFIX(ShaderBinary):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 5000(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ call _x86_64_get_dispatch@PLT
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 5000(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 5000(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ call _glapi_get_dispatch
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 5000(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(ShaderBinary), .-GL_PREFIX(ShaderBinary)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(GetGraphicsResetStatusARB)
+ .type GL_PREFIX(GetGraphicsResetStatusARB), @function
+GL_PREFIX(GetGraphicsResetStatusARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 5008(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ movq 5008(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 5008(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ movq 5008(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(GetGraphicsResetStatusARB), .-GL_PREFIX(GetGraphicsResetStatusARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(GetnColorTableARB)
+ .type GL_PREFIX(GetnColorTableARB), @function
+GL_PREFIX(GetnColorTableARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 5016(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ call _x86_64_get_dispatch@PLT
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 5016(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 5016(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ call _glapi_get_dispatch
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 5016(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(GetnColorTableARB), .-GL_PREFIX(GetnColorTableARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(GetnCompressedTexImageARB)
+ .type GL_PREFIX(GetnCompressedTexImageARB), @function
+GL_PREFIX(GetnCompressedTexImageARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 5024(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 5024(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 5024(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 5024(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(GetnCompressedTexImageARB), .-GL_PREFIX(GetnCompressedTexImageARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(GetnConvolutionFilterARB)
+ .type GL_PREFIX(GetnConvolutionFilterARB), @function
+GL_PREFIX(GetnConvolutionFilterARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 5032(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ call _x86_64_get_dispatch@PLT
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 5032(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 5032(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ call _glapi_get_dispatch
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 5032(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(GetnConvolutionFilterARB), .-GL_PREFIX(GetnConvolutionFilterARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(GetnHistogramARB)
+ .type GL_PREFIX(GetnHistogramARB), @function
+GL_PREFIX(GetnHistogramARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 5040(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ pushq %r9
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %r9
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 5040(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 5040(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ pushq %r9
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %r9
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 5040(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(GetnHistogramARB), .-GL_PREFIX(GetnHistogramARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(GetnMapdvARB)
+ .type GL_PREFIX(GetnMapdvARB), @function
+GL_PREFIX(GetnMapdvARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 5048(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 5048(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 5048(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 5048(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(GetnMapdvARB), .-GL_PREFIX(GetnMapdvARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(GetnMapfvARB)
+ .type GL_PREFIX(GetnMapfvARB), @function
+GL_PREFIX(GetnMapfvARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 5056(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 5056(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 5056(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 5056(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(GetnMapfvARB), .-GL_PREFIX(GetnMapfvARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(GetnMapivARB)
+ .type GL_PREFIX(GetnMapivARB), @function
+GL_PREFIX(GetnMapivARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 5064(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 5064(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 5064(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 5064(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(GetnMapivARB), .-GL_PREFIX(GetnMapivARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(GetnMinmaxARB)
+ .type GL_PREFIX(GetnMinmaxARB), @function
+GL_PREFIX(GetnMinmaxARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 5072(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ pushq %r9
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %r9
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 5072(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 5072(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ pushq %r9
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %r9
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 5072(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(GetnMinmaxARB), .-GL_PREFIX(GetnMinmaxARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(GetnPixelMapfvARB)
+ .type GL_PREFIX(GetnPixelMapfvARB), @function
+GL_PREFIX(GetnPixelMapfvARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 5080(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 5080(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 5080(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 5080(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(GetnPixelMapfvARB), .-GL_PREFIX(GetnPixelMapfvARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(GetnPixelMapuivARB)
+ .type GL_PREFIX(GetnPixelMapuivARB), @function
+GL_PREFIX(GetnPixelMapuivARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 5088(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 5088(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 5088(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 5088(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(GetnPixelMapuivARB), .-GL_PREFIX(GetnPixelMapuivARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(GetnPixelMapusvARB)
+ .type GL_PREFIX(GetnPixelMapusvARB), @function
+GL_PREFIX(GetnPixelMapusvARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 5096(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 5096(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 5096(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 5096(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(GetnPixelMapusvARB), .-GL_PREFIX(GetnPixelMapusvARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(GetnPolygonStippleARB)
+ .type GL_PREFIX(GetnPolygonStippleARB), @function
+GL_PREFIX(GetnPolygonStippleARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 5104(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 5104(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 5104(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 5104(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(GetnPolygonStippleARB), .-GL_PREFIX(GetnPolygonStippleARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(GetnSeparableFilterARB)
+ .type GL_PREFIX(GetnSeparableFilterARB), @function
+GL_PREFIX(GetnSeparableFilterARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 5112(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ pushq %r9
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %r9
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 5112(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 5112(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ pushq %r9
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %r9
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 5112(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(GetnSeparableFilterARB), .-GL_PREFIX(GetnSeparableFilterARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(GetnTexImageARB)
+ .type GL_PREFIX(GetnTexImageARB), @function
+GL_PREFIX(GetnTexImageARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 5120(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ pushq %r9
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %r9
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 5120(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 5120(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ pushq %r9
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %r9
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 5120(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(GetnTexImageARB), .-GL_PREFIX(GetnTexImageARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(GetnUniformdvARB)
+ .type GL_PREFIX(GetnUniformdvARB), @function
+GL_PREFIX(GetnUniformdvARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 5128(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 5128(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 5128(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 5128(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(GetnUniformdvARB), .-GL_PREFIX(GetnUniformdvARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(GetnUniformfvARB)
+ .type GL_PREFIX(GetnUniformfvARB), @function
+GL_PREFIX(GetnUniformfvARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 5136(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 5136(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 5136(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 5136(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(GetnUniformfvARB), .-GL_PREFIX(GetnUniformfvARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(GetnUniformivARB)
+ .type GL_PREFIX(GetnUniformivARB), @function
+GL_PREFIX(GetnUniformivARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 5144(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 5144(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 5144(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 5144(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(GetnUniformivARB), .-GL_PREFIX(GetnUniformivARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(GetnUniformuivARB)
+ .type GL_PREFIX(GetnUniformuivARB), @function
+GL_PREFIX(GetnUniformuivARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 5152(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 5152(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 5152(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 5152(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(GetnUniformuivARB), .-GL_PREFIX(GetnUniformuivARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(ReadnPixelsARB)
+ .type GL_PREFIX(ReadnPixelsARB), @function
+GL_PREFIX(ReadnPixelsARB):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 5160(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ pushq %r9
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %r9
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 5160(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 5160(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ pushq %r9
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %r9
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 5160(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(ReadnPixelsARB), .-GL_PREFIX(ReadnPixelsARB)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(PolygonOffsetEXT)
+ .type GL_PREFIX(PolygonOffsetEXT), @function
+GL_PREFIX(PolygonOffsetEXT):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 5168(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ subq $24, %rsp
+ movq %xmm0, (%rsp)
+ movq %xmm1, 8(%rsp)
+ call _x86_64_get_dispatch@PLT
+ movq 8(%rsp), %xmm1
+ movq (%rsp), %xmm0
+ addq $24, %rsp
+ movq 5168(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 5168(%rax), %r11
+ jmp *%r11
+1:
+ subq $24, %rsp
+ movq %xmm0, (%rsp)
+ movq %xmm1, 8(%rsp)
+ call _glapi_get_dispatch
+ movq 8(%rsp), %xmm1
+ movq (%rsp), %xmm0
+ addq $24, %rsp
+ movq 5168(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(PolygonOffsetEXT), .-GL_PREFIX(PolygonOffsetEXT)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(_dispatch_stub_647)
+ .type GL_PREFIX(_dispatch_stub_647), @function
+ HIDDEN(GL_PREFIX(_dispatch_stub_647))
+GL_PREFIX(_dispatch_stub_647):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 5176(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 5176(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 5176(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 5176(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(_dispatch_stub_647), .-GL_PREFIX(_dispatch_stub_647)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(_dispatch_stub_648)
+ .type GL_PREFIX(_dispatch_stub_648), @function
+ HIDDEN(GL_PREFIX(_dispatch_stub_648))
+GL_PREFIX(_dispatch_stub_648):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 5184(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 5184(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 5184(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 5184(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(_dispatch_stub_648), .-GL_PREFIX(_dispatch_stub_648)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(_dispatch_stub_649)
+ .type GL_PREFIX(_dispatch_stub_649), @function
+ HIDDEN(GL_PREFIX(_dispatch_stub_649))
+GL_PREFIX(_dispatch_stub_649):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 5192(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ subq $24, %rsp
+ movq %rdi, (%rsp)
+ movq %xmm0, 8(%rsp)
+ call _x86_64_get_dispatch@PLT
+ movq 8(%rsp), %xmm0
+ movq (%rsp), %rdi
+ addq $24, %rsp
+ movq 5192(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 5192(%rax), %r11
+ jmp *%r11
+1:
+ subq $24, %rsp
+ movq %rdi, (%rsp)
+ movq %xmm0, 8(%rsp)
+ call _glapi_get_dispatch
+ movq 8(%rsp), %xmm0
+ movq (%rsp), %rdi
+ addq $24, %rsp
+ movq 5192(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(_dispatch_stub_649), .-GL_PREFIX(_dispatch_stub_649)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(_dispatch_stub_650)
+ .type GL_PREFIX(_dispatch_stub_650), @function
+ HIDDEN(GL_PREFIX(_dispatch_stub_650))
+GL_PREFIX(_dispatch_stub_650):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 5200(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 5200(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 5200(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 5200(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(_dispatch_stub_650), .-GL_PREFIX(_dispatch_stub_650)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(_dispatch_stub_651)
+ .type GL_PREFIX(_dispatch_stub_651), @function
+ HIDDEN(GL_PREFIX(_dispatch_stub_651))
+GL_PREFIX(_dispatch_stub_651):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 5208(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 5208(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 5208(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 5208(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(_dispatch_stub_651), .-GL_PREFIX(_dispatch_stub_651)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(_dispatch_stub_652)
+ .type GL_PREFIX(_dispatch_stub_652), @function
+ HIDDEN(GL_PREFIX(_dispatch_stub_652))
+GL_PREFIX(_dispatch_stub_652):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 5216(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 5216(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 5216(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 5216(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(_dispatch_stub_652), .-GL_PREFIX(_dispatch_stub_652)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(_dispatch_stub_653)
+ .type GL_PREFIX(_dispatch_stub_653), @function
+ HIDDEN(GL_PREFIX(_dispatch_stub_653))
+GL_PREFIX(_dispatch_stub_653):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 5224(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 5224(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 5224(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 5224(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(_dispatch_stub_653), .-GL_PREFIX(_dispatch_stub_653)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(_dispatch_stub_654)
+ .type GL_PREFIX(_dispatch_stub_654), @function
+ HIDDEN(GL_PREFIX(_dispatch_stub_654))
+GL_PREFIX(_dispatch_stub_654):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 5232(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 5232(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 5232(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 5232(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(_dispatch_stub_654), .-GL_PREFIX(_dispatch_stub_654)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(ColorPointerEXT)
+ .type GL_PREFIX(ColorPointerEXT), @function
+GL_PREFIX(ColorPointerEXT):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 5240(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ call _x86_64_get_dispatch@PLT
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 5240(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 5240(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ call _glapi_get_dispatch
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 5240(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(ColorPointerEXT), .-GL_PREFIX(ColorPointerEXT)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(EdgeFlagPointerEXT)
+ .type GL_PREFIX(EdgeFlagPointerEXT), @function
+GL_PREFIX(EdgeFlagPointerEXT):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 5248(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 5248(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 5248(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 5248(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(EdgeFlagPointerEXT), .-GL_PREFIX(EdgeFlagPointerEXT)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(IndexPointerEXT)
+ .type GL_PREFIX(IndexPointerEXT), @function
+GL_PREFIX(IndexPointerEXT):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 5256(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 5256(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 5256(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 5256(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(IndexPointerEXT), .-GL_PREFIX(IndexPointerEXT)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(NormalPointerEXT)
+ .type GL_PREFIX(NormalPointerEXT), @function
+GL_PREFIX(NormalPointerEXT):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 5264(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 5264(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 5264(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 5264(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(NormalPointerEXT), .-GL_PREFIX(NormalPointerEXT)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(TexCoordPointerEXT)
+ .type GL_PREFIX(TexCoordPointerEXT), @function
+GL_PREFIX(TexCoordPointerEXT):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 5272(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ call _x86_64_get_dispatch@PLT
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 5272(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 5272(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ call _glapi_get_dispatch
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 5272(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(TexCoordPointerEXT), .-GL_PREFIX(TexCoordPointerEXT)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(VertexPointerEXT)
+ .type GL_PREFIX(VertexPointerEXT), @function
+GL_PREFIX(VertexPointerEXT):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 5280(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ call _x86_64_get_dispatch@PLT
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 5280(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 5280(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ call _glapi_get_dispatch
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 5280(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(VertexPointerEXT), .-GL_PREFIX(VertexPointerEXT)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(PointParameterfEXT)
+ .type GL_PREFIX(PointParameterfEXT), @function
+GL_PREFIX(PointParameterfEXT):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 5288(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ subq $24, %rsp
+ movq %rdi, (%rsp)
+ movq %xmm0, 8(%rsp)
+ call _x86_64_get_dispatch@PLT
+ movq 8(%rsp), %xmm0
+ movq (%rsp), %rdi
+ addq $24, %rsp
+ movq 5288(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 5288(%rax), %r11
+ jmp *%r11
+1:
+ subq $24, %rsp
+ movq %rdi, (%rsp)
+ movq %xmm0, 8(%rsp)
+ call _glapi_get_dispatch
+ movq 8(%rsp), %xmm0
+ movq (%rsp), %rdi
+ addq $24, %rsp
+ movq 5288(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(PointParameterfEXT), .-GL_PREFIX(PointParameterfEXT)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(PointParameterfvEXT)
+ .type GL_PREFIX(PointParameterfvEXT), @function
+GL_PREFIX(PointParameterfvEXT):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 5296(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 5296(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 5296(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 5296(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(PointParameterfvEXT), .-GL_PREFIX(PointParameterfvEXT)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(LockArraysEXT)
+ .type GL_PREFIX(LockArraysEXT), @function
+GL_PREFIX(LockArraysEXT):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 5304(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 5304(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 5304(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 5304(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(LockArraysEXT), .-GL_PREFIX(LockArraysEXT)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(UnlockArraysEXT)
+ .type GL_PREFIX(UnlockArraysEXT), @function
+GL_PREFIX(UnlockArraysEXT):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 5312(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ movq 5312(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 5312(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ movq 5312(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(UnlockArraysEXT), .-GL_PREFIX(UnlockArraysEXT)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(SecondaryColor3bEXT)
+ .type GL_PREFIX(SecondaryColor3bEXT), @function
+GL_PREFIX(SecondaryColor3bEXT):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 5320(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 5320(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 5320(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 5320(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(SecondaryColor3bEXT), .-GL_PREFIX(SecondaryColor3bEXT)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(SecondaryColor3bvEXT)
+ .type GL_PREFIX(SecondaryColor3bvEXT), @function
+GL_PREFIX(SecondaryColor3bvEXT):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 5328(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 5328(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 5328(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 5328(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(SecondaryColor3bvEXT), .-GL_PREFIX(SecondaryColor3bvEXT)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(SecondaryColor3dEXT)
+ .type GL_PREFIX(SecondaryColor3dEXT), @function
+GL_PREFIX(SecondaryColor3dEXT):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 5336(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ subq $24, %rsp
+ movq %xmm0, (%rsp)
+ movq %xmm1, 8(%rsp)
+ movq %xmm2, 16(%rsp)
+ call _x86_64_get_dispatch@PLT
+ movq 16(%rsp), %xmm2
+ movq 8(%rsp), %xmm1
+ movq (%rsp), %xmm0
+ addq $24, %rsp
+ movq 5336(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 5336(%rax), %r11
+ jmp *%r11
+1:
+ subq $24, %rsp
+ movq %xmm0, (%rsp)
+ movq %xmm1, 8(%rsp)
+ movq %xmm2, 16(%rsp)
+ call _glapi_get_dispatch
+ movq 16(%rsp), %xmm2
+ movq 8(%rsp), %xmm1
+ movq (%rsp), %xmm0
+ addq $24, %rsp
+ movq 5336(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(SecondaryColor3dEXT), .-GL_PREFIX(SecondaryColor3dEXT)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(SecondaryColor3dvEXT)
+ .type GL_PREFIX(SecondaryColor3dvEXT), @function
+GL_PREFIX(SecondaryColor3dvEXT):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 5344(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 5344(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 5344(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 5344(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(SecondaryColor3dvEXT), .-GL_PREFIX(SecondaryColor3dvEXT)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(SecondaryColor3fEXT)
+ .type GL_PREFIX(SecondaryColor3fEXT), @function
+GL_PREFIX(SecondaryColor3fEXT):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 5352(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ subq $24, %rsp
+ movq %xmm0, (%rsp)
+ movq %xmm1, 8(%rsp)
+ movq %xmm2, 16(%rsp)
+ call _x86_64_get_dispatch@PLT
+ movq 16(%rsp), %xmm2
+ movq 8(%rsp), %xmm1
+ movq (%rsp), %xmm0
+ addq $24, %rsp
+ movq 5352(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 5352(%rax), %r11
+ jmp *%r11
+1:
+ subq $24, %rsp
+ movq %xmm0, (%rsp)
+ movq %xmm1, 8(%rsp)
+ movq %xmm2, 16(%rsp)
+ call _glapi_get_dispatch
+ movq 16(%rsp), %xmm2
+ movq 8(%rsp), %xmm1
+ movq (%rsp), %xmm0
+ addq $24, %rsp
+ movq 5352(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(SecondaryColor3fEXT), .-GL_PREFIX(SecondaryColor3fEXT)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(SecondaryColor3fvEXT)
+ .type GL_PREFIX(SecondaryColor3fvEXT), @function
+GL_PREFIX(SecondaryColor3fvEXT):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 5360(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 5360(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 5360(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 5360(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(SecondaryColor3fvEXT), .-GL_PREFIX(SecondaryColor3fvEXT)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(SecondaryColor3iEXT)
+ .type GL_PREFIX(SecondaryColor3iEXT), @function
+GL_PREFIX(SecondaryColor3iEXT):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 5368(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 5368(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 5368(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 5368(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(SecondaryColor3iEXT), .-GL_PREFIX(SecondaryColor3iEXT)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(SecondaryColor3ivEXT)
+ .type GL_PREFIX(SecondaryColor3ivEXT), @function
+GL_PREFIX(SecondaryColor3ivEXT):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 5376(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 5376(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 5376(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 5376(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(SecondaryColor3ivEXT), .-GL_PREFIX(SecondaryColor3ivEXT)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(SecondaryColor3sEXT)
+ .type GL_PREFIX(SecondaryColor3sEXT), @function
+GL_PREFIX(SecondaryColor3sEXT):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 5384(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 5384(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 5384(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 5384(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(SecondaryColor3sEXT), .-GL_PREFIX(SecondaryColor3sEXT)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(SecondaryColor3svEXT)
+ .type GL_PREFIX(SecondaryColor3svEXT), @function
+GL_PREFIX(SecondaryColor3svEXT):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 5392(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 5392(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 5392(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 5392(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(SecondaryColor3svEXT), .-GL_PREFIX(SecondaryColor3svEXT)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(SecondaryColor3ubEXT)
+ .type GL_PREFIX(SecondaryColor3ubEXT), @function
+GL_PREFIX(SecondaryColor3ubEXT):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 5400(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 5400(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 5400(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 5400(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(SecondaryColor3ubEXT), .-GL_PREFIX(SecondaryColor3ubEXT)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(SecondaryColor3ubvEXT)
+ .type GL_PREFIX(SecondaryColor3ubvEXT), @function
+GL_PREFIX(SecondaryColor3ubvEXT):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 5408(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 5408(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 5408(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 5408(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(SecondaryColor3ubvEXT), .-GL_PREFIX(SecondaryColor3ubvEXT)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(SecondaryColor3uiEXT)
+ .type GL_PREFIX(SecondaryColor3uiEXT), @function
+GL_PREFIX(SecondaryColor3uiEXT):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 5416(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 5416(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 5416(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 5416(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(SecondaryColor3uiEXT), .-GL_PREFIX(SecondaryColor3uiEXT)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(SecondaryColor3uivEXT)
+ .type GL_PREFIX(SecondaryColor3uivEXT), @function
+GL_PREFIX(SecondaryColor3uivEXT):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 5424(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 5424(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 5424(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 5424(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(SecondaryColor3uivEXT), .-GL_PREFIX(SecondaryColor3uivEXT)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(SecondaryColor3usEXT)
+ .type GL_PREFIX(SecondaryColor3usEXT), @function
+GL_PREFIX(SecondaryColor3usEXT):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 5432(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 5432(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 5432(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 5432(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(SecondaryColor3usEXT), .-GL_PREFIX(SecondaryColor3usEXT)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(SecondaryColor3usvEXT)
+ .type GL_PREFIX(SecondaryColor3usvEXT), @function
+GL_PREFIX(SecondaryColor3usvEXT):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 5440(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 5440(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 5440(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 5440(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(SecondaryColor3usvEXT), .-GL_PREFIX(SecondaryColor3usvEXT)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(SecondaryColorPointerEXT)
+ .type GL_PREFIX(SecondaryColorPointerEXT), @function
+GL_PREFIX(SecondaryColorPointerEXT):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 5448(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 5448(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 5448(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 5448(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(SecondaryColorPointerEXT), .-GL_PREFIX(SecondaryColorPointerEXT)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(MultiDrawArraysEXT)
+ .type GL_PREFIX(MultiDrawArraysEXT), @function
+GL_PREFIX(MultiDrawArraysEXT):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 5456(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 5456(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 5456(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 5456(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(MultiDrawArraysEXT), .-GL_PREFIX(MultiDrawArraysEXT)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(MultiDrawElementsEXT)
+ .type GL_PREFIX(MultiDrawElementsEXT), @function
+GL_PREFIX(MultiDrawElementsEXT):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 5464(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ call _x86_64_get_dispatch@PLT
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 5464(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 5464(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ call _glapi_get_dispatch
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 5464(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(MultiDrawElementsEXT), .-GL_PREFIX(MultiDrawElementsEXT)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(FogCoordPointerEXT)
+ .type GL_PREFIX(FogCoordPointerEXT), @function
+GL_PREFIX(FogCoordPointerEXT):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 5472(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 5472(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 5472(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 5472(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(FogCoordPointerEXT), .-GL_PREFIX(FogCoordPointerEXT)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(FogCoorddEXT)
+ .type GL_PREFIX(FogCoorddEXT), @function
+GL_PREFIX(FogCoorddEXT):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 5480(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ subq $8, %rsp
+ movq %xmm0, (%rsp)
+ call _x86_64_get_dispatch@PLT
+ movq (%rsp), %xmm0
+ addq $8, %rsp
+ movq 5480(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 5480(%rax), %r11
+ jmp *%r11
+1:
+ subq $8, %rsp
+ movq %xmm0, (%rsp)
+ call _glapi_get_dispatch
+ movq (%rsp), %xmm0
+ addq $8, %rsp
+ movq 5480(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(FogCoorddEXT), .-GL_PREFIX(FogCoorddEXT)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(FogCoorddvEXT)
+ .type GL_PREFIX(FogCoorddvEXT), @function
+GL_PREFIX(FogCoorddvEXT):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 5488(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 5488(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 5488(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 5488(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(FogCoorddvEXT), .-GL_PREFIX(FogCoorddvEXT)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(FogCoordfEXT)
+ .type GL_PREFIX(FogCoordfEXT), @function
+GL_PREFIX(FogCoordfEXT):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 5496(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ subq $8, %rsp
+ movq %xmm0, (%rsp)
+ call _x86_64_get_dispatch@PLT
+ movq (%rsp), %xmm0
+ addq $8, %rsp
+ movq 5496(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 5496(%rax), %r11
+ jmp *%r11
+1:
+ subq $8, %rsp
+ movq %xmm0, (%rsp)
+ call _glapi_get_dispatch
+ movq (%rsp), %xmm0
+ addq $8, %rsp
+ movq 5496(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(FogCoordfEXT), .-GL_PREFIX(FogCoordfEXT)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(FogCoordfvEXT)
+ .type GL_PREFIX(FogCoordfvEXT), @function
+GL_PREFIX(FogCoordfvEXT):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 5504(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 5504(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 5504(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 5504(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(FogCoordfvEXT), .-GL_PREFIX(FogCoordfvEXT)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(_dispatch_stub_689)
+ .type GL_PREFIX(_dispatch_stub_689), @function
+ HIDDEN(GL_PREFIX(_dispatch_stub_689))
+GL_PREFIX(_dispatch_stub_689):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 5512(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 5512(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 5512(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 5512(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(_dispatch_stub_689), .-GL_PREFIX(_dispatch_stub_689)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(BlendFuncSeparateEXT)
+ .type GL_PREFIX(BlendFuncSeparateEXT), @function
+GL_PREFIX(BlendFuncSeparateEXT):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 5520(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 5520(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 5520(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 5520(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(BlendFuncSeparateEXT), .-GL_PREFIX(BlendFuncSeparateEXT)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(FlushVertexArrayRangeNV)
+ .type GL_PREFIX(FlushVertexArrayRangeNV), @function
+GL_PREFIX(FlushVertexArrayRangeNV):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 5528(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ movq 5528(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 5528(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ movq 5528(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(FlushVertexArrayRangeNV), .-GL_PREFIX(FlushVertexArrayRangeNV)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(VertexArrayRangeNV)
+ .type GL_PREFIX(VertexArrayRangeNV), @function
+GL_PREFIX(VertexArrayRangeNV):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 5536(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 5536(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 5536(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 5536(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(VertexArrayRangeNV), .-GL_PREFIX(VertexArrayRangeNV)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(CombinerInputNV)
+ .type GL_PREFIX(CombinerInputNV), @function
+GL_PREFIX(CombinerInputNV):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 5544(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ pushq %r9
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %r9
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 5544(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 5544(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ pushq %r9
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %r9
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 5544(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(CombinerInputNV), .-GL_PREFIX(CombinerInputNV)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(CombinerOutputNV)
+ .type GL_PREFIX(CombinerOutputNV), @function
+GL_PREFIX(CombinerOutputNV):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 5552(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ pushq %r9
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %r9
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 5552(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 5552(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ pushq %r9
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %r9
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 5552(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(CombinerOutputNV), .-GL_PREFIX(CombinerOutputNV)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(CombinerParameterfNV)
+ .type GL_PREFIX(CombinerParameterfNV), @function
+GL_PREFIX(CombinerParameterfNV):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 5560(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ subq $24, %rsp
+ movq %rdi, (%rsp)
+ movq %xmm0, 8(%rsp)
+ call _x86_64_get_dispatch@PLT
+ movq 8(%rsp), %xmm0
+ movq (%rsp), %rdi
+ addq $24, %rsp
+ movq 5560(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 5560(%rax), %r11
+ jmp *%r11
+1:
+ subq $24, %rsp
+ movq %rdi, (%rsp)
+ movq %xmm0, 8(%rsp)
+ call _glapi_get_dispatch
+ movq 8(%rsp), %xmm0
+ movq (%rsp), %rdi
+ addq $24, %rsp
+ movq 5560(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(CombinerParameterfNV), .-GL_PREFIX(CombinerParameterfNV)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(CombinerParameterfvNV)
+ .type GL_PREFIX(CombinerParameterfvNV), @function
+GL_PREFIX(CombinerParameterfvNV):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 5568(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 5568(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 5568(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 5568(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(CombinerParameterfvNV), .-GL_PREFIX(CombinerParameterfvNV)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(CombinerParameteriNV)
+ .type GL_PREFIX(CombinerParameteriNV), @function
+GL_PREFIX(CombinerParameteriNV):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 5576(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 5576(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 5576(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 5576(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(CombinerParameteriNV), .-GL_PREFIX(CombinerParameteriNV)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(CombinerParameterivNV)
+ .type GL_PREFIX(CombinerParameterivNV), @function
+GL_PREFIX(CombinerParameterivNV):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 5584(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 5584(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 5584(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 5584(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(CombinerParameterivNV), .-GL_PREFIX(CombinerParameterivNV)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(FinalCombinerInputNV)
+ .type GL_PREFIX(FinalCombinerInputNV), @function
+GL_PREFIX(FinalCombinerInputNV):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 5592(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 5592(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 5592(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 5592(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(FinalCombinerInputNV), .-GL_PREFIX(FinalCombinerInputNV)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(GetCombinerInputParameterfvNV)
+ .type GL_PREFIX(GetCombinerInputParameterfvNV), @function
+GL_PREFIX(GetCombinerInputParameterfvNV):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 5600(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ call _x86_64_get_dispatch@PLT
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 5600(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 5600(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ call _glapi_get_dispatch
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 5600(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(GetCombinerInputParameterfvNV), .-GL_PREFIX(GetCombinerInputParameterfvNV)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(GetCombinerInputParameterivNV)
+ .type GL_PREFIX(GetCombinerInputParameterivNV), @function
+GL_PREFIX(GetCombinerInputParameterivNV):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 5608(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ call _x86_64_get_dispatch@PLT
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 5608(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 5608(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ call _glapi_get_dispatch
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 5608(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(GetCombinerInputParameterivNV), .-GL_PREFIX(GetCombinerInputParameterivNV)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(GetCombinerOutputParameterfvNV)
+ .type GL_PREFIX(GetCombinerOutputParameterfvNV), @function
+GL_PREFIX(GetCombinerOutputParameterfvNV):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 5616(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 5616(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 5616(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 5616(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(GetCombinerOutputParameterfvNV), .-GL_PREFIX(GetCombinerOutputParameterfvNV)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(GetCombinerOutputParameterivNV)
+ .type GL_PREFIX(GetCombinerOutputParameterivNV), @function
+GL_PREFIX(GetCombinerOutputParameterivNV):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 5624(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 5624(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 5624(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 5624(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(GetCombinerOutputParameterivNV), .-GL_PREFIX(GetCombinerOutputParameterivNV)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(GetFinalCombinerInputParameterfvNV)
+ .type GL_PREFIX(GetFinalCombinerInputParameterfvNV), @function
+GL_PREFIX(GetFinalCombinerInputParameterfvNV):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 5632(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 5632(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 5632(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 5632(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(GetFinalCombinerInputParameterfvNV), .-GL_PREFIX(GetFinalCombinerInputParameterfvNV)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(GetFinalCombinerInputParameterivNV)
+ .type GL_PREFIX(GetFinalCombinerInputParameterivNV), @function
+GL_PREFIX(GetFinalCombinerInputParameterivNV):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 5640(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 5640(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 5640(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 5640(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(GetFinalCombinerInputParameterivNV), .-GL_PREFIX(GetFinalCombinerInputParameterivNV)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(ResizeBuffersMESA)
+ .type GL_PREFIX(ResizeBuffersMESA), @function
+GL_PREFIX(ResizeBuffersMESA):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 5648(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ movq 5648(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 5648(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ movq 5648(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(ResizeBuffersMESA), .-GL_PREFIX(ResizeBuffersMESA)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(WindowPos2dMESA)
+ .type GL_PREFIX(WindowPos2dMESA), @function
+GL_PREFIX(WindowPos2dMESA):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 5656(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ subq $24, %rsp
+ movq %xmm0, (%rsp)
+ movq %xmm1, 8(%rsp)
+ call _x86_64_get_dispatch@PLT
+ movq 8(%rsp), %xmm1
+ movq (%rsp), %xmm0
+ addq $24, %rsp
+ movq 5656(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 5656(%rax), %r11
+ jmp *%r11
+1:
+ subq $24, %rsp
+ movq %xmm0, (%rsp)
+ movq %xmm1, 8(%rsp)
+ call _glapi_get_dispatch
+ movq 8(%rsp), %xmm1
+ movq (%rsp), %xmm0
+ addq $24, %rsp
+ movq 5656(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(WindowPos2dMESA), .-GL_PREFIX(WindowPos2dMESA)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(WindowPos2dvMESA)
+ .type GL_PREFIX(WindowPos2dvMESA), @function
+GL_PREFIX(WindowPos2dvMESA):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 5664(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 5664(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 5664(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 5664(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(WindowPos2dvMESA), .-GL_PREFIX(WindowPos2dvMESA)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(WindowPos2fMESA)
+ .type GL_PREFIX(WindowPos2fMESA), @function
+GL_PREFIX(WindowPos2fMESA):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 5672(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ subq $24, %rsp
+ movq %xmm0, (%rsp)
+ movq %xmm1, 8(%rsp)
+ call _x86_64_get_dispatch@PLT
+ movq 8(%rsp), %xmm1
+ movq (%rsp), %xmm0
+ addq $24, %rsp
+ movq 5672(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 5672(%rax), %r11
+ jmp *%r11
+1:
+ subq $24, %rsp
+ movq %xmm0, (%rsp)
+ movq %xmm1, 8(%rsp)
+ call _glapi_get_dispatch
+ movq 8(%rsp), %xmm1
+ movq (%rsp), %xmm0
+ addq $24, %rsp
+ movq 5672(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(WindowPos2fMESA), .-GL_PREFIX(WindowPos2fMESA)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(WindowPos2fvMESA)
+ .type GL_PREFIX(WindowPos2fvMESA), @function
+GL_PREFIX(WindowPos2fvMESA):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 5680(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 5680(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 5680(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 5680(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(WindowPos2fvMESA), .-GL_PREFIX(WindowPos2fvMESA)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(WindowPos2iMESA)
+ .type GL_PREFIX(WindowPos2iMESA), @function
+GL_PREFIX(WindowPos2iMESA):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 5688(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 5688(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 5688(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 5688(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(WindowPos2iMESA), .-GL_PREFIX(WindowPos2iMESA)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(WindowPos2ivMESA)
+ .type GL_PREFIX(WindowPos2ivMESA), @function
+GL_PREFIX(WindowPos2ivMESA):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 5696(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 5696(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 5696(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 5696(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(WindowPos2ivMESA), .-GL_PREFIX(WindowPos2ivMESA)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(WindowPos2sMESA)
+ .type GL_PREFIX(WindowPos2sMESA), @function
+GL_PREFIX(WindowPos2sMESA):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 5704(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 5704(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 5704(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 5704(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(WindowPos2sMESA), .-GL_PREFIX(WindowPos2sMESA)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(WindowPos2svMESA)
+ .type GL_PREFIX(WindowPos2svMESA), @function
+GL_PREFIX(WindowPos2svMESA):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 5712(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 5712(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 5712(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 5712(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(WindowPos2svMESA), .-GL_PREFIX(WindowPos2svMESA)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(WindowPos3dMESA)
+ .type GL_PREFIX(WindowPos3dMESA), @function
+GL_PREFIX(WindowPos3dMESA):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 5720(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ subq $24, %rsp
+ movq %xmm0, (%rsp)
+ movq %xmm1, 8(%rsp)
+ movq %xmm2, 16(%rsp)
+ call _x86_64_get_dispatch@PLT
+ movq 16(%rsp), %xmm2
+ movq 8(%rsp), %xmm1
+ movq (%rsp), %xmm0
+ addq $24, %rsp
+ movq 5720(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 5720(%rax), %r11
+ jmp *%r11
+1:
+ subq $24, %rsp
+ movq %xmm0, (%rsp)
+ movq %xmm1, 8(%rsp)
+ movq %xmm2, 16(%rsp)
+ call _glapi_get_dispatch
+ movq 16(%rsp), %xmm2
+ movq 8(%rsp), %xmm1
+ movq (%rsp), %xmm0
+ addq $24, %rsp
+ movq 5720(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(WindowPos3dMESA), .-GL_PREFIX(WindowPos3dMESA)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(WindowPos3dvMESA)
+ .type GL_PREFIX(WindowPos3dvMESA), @function
+GL_PREFIX(WindowPos3dvMESA):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 5728(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 5728(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 5728(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 5728(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(WindowPos3dvMESA), .-GL_PREFIX(WindowPos3dvMESA)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(WindowPos3fMESA)
+ .type GL_PREFIX(WindowPos3fMESA), @function
+GL_PREFIX(WindowPos3fMESA):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 5736(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ subq $24, %rsp
+ movq %xmm0, (%rsp)
+ movq %xmm1, 8(%rsp)
+ movq %xmm2, 16(%rsp)
+ call _x86_64_get_dispatch@PLT
+ movq 16(%rsp), %xmm2
+ movq 8(%rsp), %xmm1
+ movq (%rsp), %xmm0
+ addq $24, %rsp
+ movq 5736(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 5736(%rax), %r11
+ jmp *%r11
+1:
+ subq $24, %rsp
+ movq %xmm0, (%rsp)
+ movq %xmm1, 8(%rsp)
+ movq %xmm2, 16(%rsp)
+ call _glapi_get_dispatch
+ movq 16(%rsp), %xmm2
+ movq 8(%rsp), %xmm1
+ movq (%rsp), %xmm0
+ addq $24, %rsp
+ movq 5736(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(WindowPos3fMESA), .-GL_PREFIX(WindowPos3fMESA)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(WindowPos3fvMESA)
+ .type GL_PREFIX(WindowPos3fvMESA), @function
+GL_PREFIX(WindowPos3fvMESA):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 5744(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 5744(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 5744(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 5744(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(WindowPos3fvMESA), .-GL_PREFIX(WindowPos3fvMESA)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(WindowPos3iMESA)
+ .type GL_PREFIX(WindowPos3iMESA), @function
+GL_PREFIX(WindowPos3iMESA):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 5752(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 5752(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 5752(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 5752(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(WindowPos3iMESA), .-GL_PREFIX(WindowPos3iMESA)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(WindowPos3ivMESA)
+ .type GL_PREFIX(WindowPos3ivMESA), @function
+GL_PREFIX(WindowPos3ivMESA):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 5760(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 5760(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 5760(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 5760(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(WindowPos3ivMESA), .-GL_PREFIX(WindowPos3ivMESA)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(WindowPos3sMESA)
+ .type GL_PREFIX(WindowPos3sMESA), @function
+GL_PREFIX(WindowPos3sMESA):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 5768(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 5768(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 5768(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 5768(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(WindowPos3sMESA), .-GL_PREFIX(WindowPos3sMESA)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(WindowPos3svMESA)
+ .type GL_PREFIX(WindowPos3svMESA), @function
+GL_PREFIX(WindowPos3svMESA):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 5776(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 5776(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 5776(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 5776(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(WindowPos3svMESA), .-GL_PREFIX(WindowPos3svMESA)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(WindowPos4dMESA)
+ .type GL_PREFIX(WindowPos4dMESA), @function
+GL_PREFIX(WindowPos4dMESA):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 5784(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ subq $40, %rsp
+ movq %xmm0, (%rsp)
+ movq %xmm1, 8(%rsp)
+ movq %xmm2, 16(%rsp)
+ movq %xmm3, 24(%rsp)
+ call _x86_64_get_dispatch@PLT
+ movq 24(%rsp), %xmm3
+ movq 16(%rsp), %xmm2
+ movq 8(%rsp), %xmm1
+ movq (%rsp), %xmm0
+ addq $40, %rsp
+ movq 5784(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 5784(%rax), %r11
+ jmp *%r11
+1:
+ subq $40, %rsp
+ movq %xmm0, (%rsp)
+ movq %xmm1, 8(%rsp)
+ movq %xmm2, 16(%rsp)
+ movq %xmm3, 24(%rsp)
+ call _glapi_get_dispatch
+ movq 24(%rsp), %xmm3
+ movq 16(%rsp), %xmm2
+ movq 8(%rsp), %xmm1
+ movq (%rsp), %xmm0
+ addq $40, %rsp
+ movq 5784(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(WindowPos4dMESA), .-GL_PREFIX(WindowPos4dMESA)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(WindowPos4dvMESA)
+ .type GL_PREFIX(WindowPos4dvMESA), @function
+GL_PREFIX(WindowPos4dvMESA):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 5792(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 5792(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 5792(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 5792(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(WindowPos4dvMESA), .-GL_PREFIX(WindowPos4dvMESA)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(WindowPos4fMESA)
+ .type GL_PREFIX(WindowPos4fMESA), @function
+GL_PREFIX(WindowPos4fMESA):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 5800(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ subq $40, %rsp
+ movq %xmm0, (%rsp)
+ movq %xmm1, 8(%rsp)
+ movq %xmm2, 16(%rsp)
+ movq %xmm3, 24(%rsp)
+ call _x86_64_get_dispatch@PLT
+ movq 24(%rsp), %xmm3
+ movq 16(%rsp), %xmm2
+ movq 8(%rsp), %xmm1
+ movq (%rsp), %xmm0
+ addq $40, %rsp
+ movq 5800(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 5800(%rax), %r11
+ jmp *%r11
+1:
+ subq $40, %rsp
+ movq %xmm0, (%rsp)
+ movq %xmm1, 8(%rsp)
+ movq %xmm2, 16(%rsp)
+ movq %xmm3, 24(%rsp)
+ call _glapi_get_dispatch
+ movq 24(%rsp), %xmm3
+ movq 16(%rsp), %xmm2
+ movq 8(%rsp), %xmm1
+ movq (%rsp), %xmm0
+ addq $40, %rsp
+ movq 5800(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(WindowPos4fMESA), .-GL_PREFIX(WindowPos4fMESA)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(WindowPos4fvMESA)
+ .type GL_PREFIX(WindowPos4fvMESA), @function
+GL_PREFIX(WindowPos4fvMESA):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 5808(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 5808(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 5808(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 5808(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(WindowPos4fvMESA), .-GL_PREFIX(WindowPos4fvMESA)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(WindowPos4iMESA)
+ .type GL_PREFIX(WindowPos4iMESA), @function
+GL_PREFIX(WindowPos4iMESA):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 5816(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 5816(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 5816(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 5816(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(WindowPos4iMESA), .-GL_PREFIX(WindowPos4iMESA)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(WindowPos4ivMESA)
+ .type GL_PREFIX(WindowPos4ivMESA), @function
+GL_PREFIX(WindowPos4ivMESA):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 5824(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 5824(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 5824(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 5824(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(WindowPos4ivMESA), .-GL_PREFIX(WindowPos4ivMESA)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(WindowPos4sMESA)
+ .type GL_PREFIX(WindowPos4sMESA), @function
+GL_PREFIX(WindowPos4sMESA):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 5832(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 5832(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 5832(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 5832(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(WindowPos4sMESA), .-GL_PREFIX(WindowPos4sMESA)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(WindowPos4svMESA)
+ .type GL_PREFIX(WindowPos4svMESA), @function
+GL_PREFIX(WindowPos4svMESA):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 5840(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 5840(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 5840(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 5840(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(WindowPos4svMESA), .-GL_PREFIX(WindowPos4svMESA)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(_dispatch_stub_731)
+ .type GL_PREFIX(_dispatch_stub_731), @function
+ HIDDEN(GL_PREFIX(_dispatch_stub_731))
+GL_PREFIX(_dispatch_stub_731):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 5848(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ call _x86_64_get_dispatch@PLT
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 5848(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 5848(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ call _glapi_get_dispatch
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 5848(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(_dispatch_stub_731), .-GL_PREFIX(_dispatch_stub_731)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(_dispatch_stub_732)
+ .type GL_PREFIX(_dispatch_stub_732), @function
+ HIDDEN(GL_PREFIX(_dispatch_stub_732))
+GL_PREFIX(_dispatch_stub_732):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 5856(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ pushq %r9
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %r9
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 5856(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 5856(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ pushq %r9
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %r9
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 5856(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(_dispatch_stub_732), .-GL_PREFIX(_dispatch_stub_732)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(_dispatch_stub_733)
+ .type GL_PREFIX(_dispatch_stub_733), @function
+ HIDDEN(GL_PREFIX(_dispatch_stub_733))
+GL_PREFIX(_dispatch_stub_733):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 5864(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 5864(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 5864(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 5864(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(_dispatch_stub_733), .-GL_PREFIX(_dispatch_stub_733)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(_dispatch_stub_734)
+ .type GL_PREFIX(_dispatch_stub_734), @function
+ HIDDEN(GL_PREFIX(_dispatch_stub_734))
+GL_PREFIX(_dispatch_stub_734):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 5872(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 5872(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 5872(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 5872(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(_dispatch_stub_734), .-GL_PREFIX(_dispatch_stub_734)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(_dispatch_stub_735)
+ .type GL_PREFIX(_dispatch_stub_735), @function
+ HIDDEN(GL_PREFIX(_dispatch_stub_735))
+GL_PREFIX(_dispatch_stub_735):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 5880(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 5880(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 5880(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 5880(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(_dispatch_stub_735), .-GL_PREFIX(_dispatch_stub_735)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(_dispatch_stub_736)
+ .type GL_PREFIX(_dispatch_stub_736), @function
+ HIDDEN(GL_PREFIX(_dispatch_stub_736))
+GL_PREFIX(_dispatch_stub_736):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 5888(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 5888(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 5888(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 5888(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(_dispatch_stub_736), .-GL_PREFIX(_dispatch_stub_736)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(_dispatch_stub_737)
+ .type GL_PREFIX(_dispatch_stub_737), @function
+ HIDDEN(GL_PREFIX(_dispatch_stub_737))
+GL_PREFIX(_dispatch_stub_737):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 5896(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 5896(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 5896(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 5896(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(_dispatch_stub_737), .-GL_PREFIX(_dispatch_stub_737)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(_dispatch_stub_738)
+ .type GL_PREFIX(_dispatch_stub_738), @function
+ HIDDEN(GL_PREFIX(_dispatch_stub_738))
+GL_PREFIX(_dispatch_stub_738):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 5904(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 5904(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 5904(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 5904(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(_dispatch_stub_738), .-GL_PREFIX(_dispatch_stub_738)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(_dispatch_stub_739)
+ .type GL_PREFIX(_dispatch_stub_739), @function
+ HIDDEN(GL_PREFIX(_dispatch_stub_739))
+GL_PREFIX(_dispatch_stub_739):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 5912(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 5912(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 5912(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 5912(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(_dispatch_stub_739), .-GL_PREFIX(_dispatch_stub_739)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(AreProgramsResidentNV)
+ .type GL_PREFIX(AreProgramsResidentNV), @function
+GL_PREFIX(AreProgramsResidentNV):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 5920(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 5920(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 5920(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 5920(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(AreProgramsResidentNV), .-GL_PREFIX(AreProgramsResidentNV)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(BindProgramNV)
+ .type GL_PREFIX(BindProgramNV), @function
+GL_PREFIX(BindProgramNV):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 5928(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 5928(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 5928(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 5928(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(BindProgramNV), .-GL_PREFIX(BindProgramNV)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(DeleteProgramsNV)
+ .type GL_PREFIX(DeleteProgramsNV), @function
+GL_PREFIX(DeleteProgramsNV):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 5936(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 5936(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 5936(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 5936(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(DeleteProgramsNV), .-GL_PREFIX(DeleteProgramsNV)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(ExecuteProgramNV)
+ .type GL_PREFIX(ExecuteProgramNV), @function
+GL_PREFIX(ExecuteProgramNV):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 5944(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 5944(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 5944(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 5944(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(ExecuteProgramNV), .-GL_PREFIX(ExecuteProgramNV)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(GenProgramsNV)
+ .type GL_PREFIX(GenProgramsNV), @function
+GL_PREFIX(GenProgramsNV):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 5952(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 5952(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 5952(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 5952(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(GenProgramsNV), .-GL_PREFIX(GenProgramsNV)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(GetProgramParameterdvNV)
+ .type GL_PREFIX(GetProgramParameterdvNV), @function
+GL_PREFIX(GetProgramParameterdvNV):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 5960(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 5960(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 5960(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 5960(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(GetProgramParameterdvNV), .-GL_PREFIX(GetProgramParameterdvNV)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(GetProgramParameterfvNV)
+ .type GL_PREFIX(GetProgramParameterfvNV), @function
+GL_PREFIX(GetProgramParameterfvNV):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 5968(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 5968(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 5968(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 5968(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(GetProgramParameterfvNV), .-GL_PREFIX(GetProgramParameterfvNV)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(GetProgramStringNV)
+ .type GL_PREFIX(GetProgramStringNV), @function
+GL_PREFIX(GetProgramStringNV):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 5976(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 5976(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 5976(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 5976(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(GetProgramStringNV), .-GL_PREFIX(GetProgramStringNV)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(GetProgramivNV)
+ .type GL_PREFIX(GetProgramivNV), @function
+GL_PREFIX(GetProgramivNV):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 5984(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 5984(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 5984(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 5984(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(GetProgramivNV), .-GL_PREFIX(GetProgramivNV)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(GetTrackMatrixivNV)
+ .type GL_PREFIX(GetTrackMatrixivNV), @function
+GL_PREFIX(GetTrackMatrixivNV):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 5992(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 5992(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 5992(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 5992(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(GetTrackMatrixivNV), .-GL_PREFIX(GetTrackMatrixivNV)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(GetVertexAttribPointervNV)
+ .type GL_PREFIX(GetVertexAttribPointervNV), @function
+GL_PREFIX(GetVertexAttribPointervNV):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 6000(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 6000(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 6000(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 6000(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(GetVertexAttribPointervNV), .-GL_PREFIX(GetVertexAttribPointervNV)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(GetVertexAttribdvNV)
+ .type GL_PREFIX(GetVertexAttribdvNV), @function
+GL_PREFIX(GetVertexAttribdvNV):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 6008(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 6008(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 6008(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 6008(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(GetVertexAttribdvNV), .-GL_PREFIX(GetVertexAttribdvNV)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(GetVertexAttribfvNV)
+ .type GL_PREFIX(GetVertexAttribfvNV), @function
+GL_PREFIX(GetVertexAttribfvNV):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 6016(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 6016(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 6016(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 6016(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(GetVertexAttribfvNV), .-GL_PREFIX(GetVertexAttribfvNV)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(GetVertexAttribivNV)
+ .type GL_PREFIX(GetVertexAttribivNV), @function
+GL_PREFIX(GetVertexAttribivNV):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 6024(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 6024(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 6024(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 6024(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(GetVertexAttribivNV), .-GL_PREFIX(GetVertexAttribivNV)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(IsProgramNV)
+ .type GL_PREFIX(IsProgramNV), @function
+GL_PREFIX(IsProgramNV):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 6032(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 6032(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 6032(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 6032(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(IsProgramNV), .-GL_PREFIX(IsProgramNV)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(LoadProgramNV)
+ .type GL_PREFIX(LoadProgramNV), @function
+GL_PREFIX(LoadProgramNV):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 6040(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 6040(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 6040(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 6040(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(LoadProgramNV), .-GL_PREFIX(LoadProgramNV)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(ProgramParameters4dvNV)
+ .type GL_PREFIX(ProgramParameters4dvNV), @function
+GL_PREFIX(ProgramParameters4dvNV):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 6048(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 6048(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 6048(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 6048(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(ProgramParameters4dvNV), .-GL_PREFIX(ProgramParameters4dvNV)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(ProgramParameters4fvNV)
+ .type GL_PREFIX(ProgramParameters4fvNV), @function
+GL_PREFIX(ProgramParameters4fvNV):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 6056(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 6056(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 6056(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 6056(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(ProgramParameters4fvNV), .-GL_PREFIX(ProgramParameters4fvNV)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(RequestResidentProgramsNV)
+ .type GL_PREFIX(RequestResidentProgramsNV), @function
+GL_PREFIX(RequestResidentProgramsNV):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 6064(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 6064(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 6064(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 6064(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(RequestResidentProgramsNV), .-GL_PREFIX(RequestResidentProgramsNV)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(TrackMatrixNV)
+ .type GL_PREFIX(TrackMatrixNV), @function
+GL_PREFIX(TrackMatrixNV):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 6072(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 6072(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 6072(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 6072(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(TrackMatrixNV), .-GL_PREFIX(TrackMatrixNV)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(VertexAttrib1dNV)
+ .type GL_PREFIX(VertexAttrib1dNV), @function
+GL_PREFIX(VertexAttrib1dNV):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 6080(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ subq $24, %rsp
+ movq %rdi, (%rsp)
+ movq %xmm0, 8(%rsp)
+ call _x86_64_get_dispatch@PLT
+ movq 8(%rsp), %xmm0
+ movq (%rsp), %rdi
+ addq $24, %rsp
+ movq 6080(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 6080(%rax), %r11
+ jmp *%r11
+1:
+ subq $24, %rsp
+ movq %rdi, (%rsp)
+ movq %xmm0, 8(%rsp)
+ call _glapi_get_dispatch
+ movq 8(%rsp), %xmm0
+ movq (%rsp), %rdi
+ addq $24, %rsp
+ movq 6080(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(VertexAttrib1dNV), .-GL_PREFIX(VertexAttrib1dNV)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(VertexAttrib1dvNV)
+ .type GL_PREFIX(VertexAttrib1dvNV), @function
+GL_PREFIX(VertexAttrib1dvNV):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 6088(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 6088(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 6088(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 6088(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(VertexAttrib1dvNV), .-GL_PREFIX(VertexAttrib1dvNV)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(VertexAttrib1fNV)
+ .type GL_PREFIX(VertexAttrib1fNV), @function
+GL_PREFIX(VertexAttrib1fNV):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 6096(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ subq $24, %rsp
+ movq %rdi, (%rsp)
+ movq %xmm0, 8(%rsp)
+ call _x86_64_get_dispatch@PLT
+ movq 8(%rsp), %xmm0
+ movq (%rsp), %rdi
+ addq $24, %rsp
+ movq 6096(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 6096(%rax), %r11
+ jmp *%r11
+1:
+ subq $24, %rsp
+ movq %rdi, (%rsp)
+ movq %xmm0, 8(%rsp)
+ call _glapi_get_dispatch
+ movq 8(%rsp), %xmm0
+ movq (%rsp), %rdi
+ addq $24, %rsp
+ movq 6096(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(VertexAttrib1fNV), .-GL_PREFIX(VertexAttrib1fNV)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(VertexAttrib1fvNV)
+ .type GL_PREFIX(VertexAttrib1fvNV), @function
+GL_PREFIX(VertexAttrib1fvNV):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 6104(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 6104(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 6104(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 6104(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(VertexAttrib1fvNV), .-GL_PREFIX(VertexAttrib1fvNV)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(VertexAttrib1sNV)
+ .type GL_PREFIX(VertexAttrib1sNV), @function
+GL_PREFIX(VertexAttrib1sNV):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 6112(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 6112(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 6112(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 6112(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(VertexAttrib1sNV), .-GL_PREFIX(VertexAttrib1sNV)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(VertexAttrib1svNV)
+ .type GL_PREFIX(VertexAttrib1svNV), @function
+GL_PREFIX(VertexAttrib1svNV):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 6120(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 6120(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 6120(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 6120(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(VertexAttrib1svNV), .-GL_PREFIX(VertexAttrib1svNV)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(VertexAttrib2dNV)
+ .type GL_PREFIX(VertexAttrib2dNV), @function
+GL_PREFIX(VertexAttrib2dNV):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 6128(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ subq $24, %rsp
+ movq %rdi, (%rsp)
+ movq %xmm0, 8(%rsp)
+ movq %xmm1, 16(%rsp)
+ call _x86_64_get_dispatch@PLT
+ movq 16(%rsp), %xmm1
+ movq 8(%rsp), %xmm0
+ movq (%rsp), %rdi
+ addq $24, %rsp
+ movq 6128(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 6128(%rax), %r11
+ jmp *%r11
+1:
+ subq $24, %rsp
+ movq %rdi, (%rsp)
+ movq %xmm0, 8(%rsp)
+ movq %xmm1, 16(%rsp)
+ call _glapi_get_dispatch
+ movq 16(%rsp), %xmm1
+ movq 8(%rsp), %xmm0
+ movq (%rsp), %rdi
+ addq $24, %rsp
+ movq 6128(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(VertexAttrib2dNV), .-GL_PREFIX(VertexAttrib2dNV)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(VertexAttrib2dvNV)
+ .type GL_PREFIX(VertexAttrib2dvNV), @function
+GL_PREFIX(VertexAttrib2dvNV):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 6136(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 6136(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 6136(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 6136(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(VertexAttrib2dvNV), .-GL_PREFIX(VertexAttrib2dvNV)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(VertexAttrib2fNV)
+ .type GL_PREFIX(VertexAttrib2fNV), @function
+GL_PREFIX(VertexAttrib2fNV):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 6144(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ subq $24, %rsp
+ movq %rdi, (%rsp)
+ movq %xmm0, 8(%rsp)
+ movq %xmm1, 16(%rsp)
+ call _x86_64_get_dispatch@PLT
+ movq 16(%rsp), %xmm1
+ movq 8(%rsp), %xmm0
+ movq (%rsp), %rdi
+ addq $24, %rsp
+ movq 6144(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 6144(%rax), %r11
+ jmp *%r11
+1:
+ subq $24, %rsp
+ movq %rdi, (%rsp)
+ movq %xmm0, 8(%rsp)
+ movq %xmm1, 16(%rsp)
+ call _glapi_get_dispatch
+ movq 16(%rsp), %xmm1
+ movq 8(%rsp), %xmm0
+ movq (%rsp), %rdi
+ addq $24, %rsp
+ movq 6144(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(VertexAttrib2fNV), .-GL_PREFIX(VertexAttrib2fNV)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(VertexAttrib2fvNV)
+ .type GL_PREFIX(VertexAttrib2fvNV), @function
+GL_PREFIX(VertexAttrib2fvNV):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 6152(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 6152(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 6152(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 6152(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(VertexAttrib2fvNV), .-GL_PREFIX(VertexAttrib2fvNV)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(VertexAttrib2sNV)
+ .type GL_PREFIX(VertexAttrib2sNV), @function
+GL_PREFIX(VertexAttrib2sNV):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 6160(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 6160(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 6160(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 6160(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(VertexAttrib2sNV), .-GL_PREFIX(VertexAttrib2sNV)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(VertexAttrib2svNV)
+ .type GL_PREFIX(VertexAttrib2svNV), @function
+GL_PREFIX(VertexAttrib2svNV):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 6168(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 6168(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 6168(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 6168(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(VertexAttrib2svNV), .-GL_PREFIX(VertexAttrib2svNV)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(VertexAttrib3dNV)
+ .type GL_PREFIX(VertexAttrib3dNV), @function
+GL_PREFIX(VertexAttrib3dNV):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 6176(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ subq $40, %rsp
+ movq %rdi, (%rsp)
+ movq %xmm0, 8(%rsp)
+ movq %xmm1, 16(%rsp)
+ movq %xmm2, 24(%rsp)
+ call _x86_64_get_dispatch@PLT
+ movq 24(%rsp), %xmm2
+ movq 16(%rsp), %xmm1
+ movq 8(%rsp), %xmm0
+ movq (%rsp), %rdi
+ addq $40, %rsp
+ movq 6176(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 6176(%rax), %r11
+ jmp *%r11
+1:
+ subq $40, %rsp
+ movq %rdi, (%rsp)
+ movq %xmm0, 8(%rsp)
+ movq %xmm1, 16(%rsp)
+ movq %xmm2, 24(%rsp)
+ call _glapi_get_dispatch
+ movq 24(%rsp), %xmm2
+ movq 16(%rsp), %xmm1
+ movq 8(%rsp), %xmm0
+ movq (%rsp), %rdi
+ addq $40, %rsp
+ movq 6176(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(VertexAttrib3dNV), .-GL_PREFIX(VertexAttrib3dNV)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(VertexAttrib3dvNV)
+ .type GL_PREFIX(VertexAttrib3dvNV), @function
+GL_PREFIX(VertexAttrib3dvNV):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 6184(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 6184(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 6184(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 6184(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(VertexAttrib3dvNV), .-GL_PREFIX(VertexAttrib3dvNV)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(VertexAttrib3fNV)
+ .type GL_PREFIX(VertexAttrib3fNV), @function
+GL_PREFIX(VertexAttrib3fNV):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 6192(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ subq $40, %rsp
+ movq %rdi, (%rsp)
+ movq %xmm0, 8(%rsp)
+ movq %xmm1, 16(%rsp)
+ movq %xmm2, 24(%rsp)
+ call _x86_64_get_dispatch@PLT
+ movq 24(%rsp), %xmm2
+ movq 16(%rsp), %xmm1
+ movq 8(%rsp), %xmm0
+ movq (%rsp), %rdi
+ addq $40, %rsp
+ movq 6192(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 6192(%rax), %r11
+ jmp *%r11
+1:
+ subq $40, %rsp
+ movq %rdi, (%rsp)
+ movq %xmm0, 8(%rsp)
+ movq %xmm1, 16(%rsp)
+ movq %xmm2, 24(%rsp)
+ call _glapi_get_dispatch
+ movq 24(%rsp), %xmm2
+ movq 16(%rsp), %xmm1
+ movq 8(%rsp), %xmm0
+ movq (%rsp), %rdi
+ addq $40, %rsp
+ movq 6192(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(VertexAttrib3fNV), .-GL_PREFIX(VertexAttrib3fNV)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(VertexAttrib3fvNV)
+ .type GL_PREFIX(VertexAttrib3fvNV), @function
+GL_PREFIX(VertexAttrib3fvNV):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 6200(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 6200(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 6200(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 6200(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(VertexAttrib3fvNV), .-GL_PREFIX(VertexAttrib3fvNV)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(VertexAttrib3sNV)
+ .type GL_PREFIX(VertexAttrib3sNV), @function
+GL_PREFIX(VertexAttrib3sNV):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 6208(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 6208(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 6208(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 6208(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(VertexAttrib3sNV), .-GL_PREFIX(VertexAttrib3sNV)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(VertexAttrib3svNV)
+ .type GL_PREFIX(VertexAttrib3svNV), @function
+GL_PREFIX(VertexAttrib3svNV):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 6216(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 6216(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 6216(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 6216(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(VertexAttrib3svNV), .-GL_PREFIX(VertexAttrib3svNV)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(VertexAttrib4dNV)
+ .type GL_PREFIX(VertexAttrib4dNV), @function
+GL_PREFIX(VertexAttrib4dNV):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 6224(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ subq $40, %rsp
+ movq %rdi, (%rsp)
+ movq %xmm0, 8(%rsp)
+ movq %xmm1, 16(%rsp)
+ movq %xmm2, 24(%rsp)
+ movq %xmm3, 32(%rsp)
+ call _x86_64_get_dispatch@PLT
+ movq 32(%rsp), %xmm3
+ movq 24(%rsp), %xmm2
+ movq 16(%rsp), %xmm1
+ movq 8(%rsp), %xmm0
+ movq (%rsp), %rdi
+ addq $40, %rsp
+ movq 6224(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 6224(%rax), %r11
+ jmp *%r11
+1:
+ subq $40, %rsp
+ movq %rdi, (%rsp)
+ movq %xmm0, 8(%rsp)
+ movq %xmm1, 16(%rsp)
+ movq %xmm2, 24(%rsp)
+ movq %xmm3, 32(%rsp)
+ call _glapi_get_dispatch
+ movq 32(%rsp), %xmm3
+ movq 24(%rsp), %xmm2
+ movq 16(%rsp), %xmm1
+ movq 8(%rsp), %xmm0
+ movq (%rsp), %rdi
+ addq $40, %rsp
+ movq 6224(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(VertexAttrib4dNV), .-GL_PREFIX(VertexAttrib4dNV)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(VertexAttrib4dvNV)
+ .type GL_PREFIX(VertexAttrib4dvNV), @function
+GL_PREFIX(VertexAttrib4dvNV):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 6232(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 6232(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 6232(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 6232(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(VertexAttrib4dvNV), .-GL_PREFIX(VertexAttrib4dvNV)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(VertexAttrib4fNV)
+ .type GL_PREFIX(VertexAttrib4fNV), @function
+GL_PREFIX(VertexAttrib4fNV):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 6240(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ subq $40, %rsp
+ movq %rdi, (%rsp)
+ movq %xmm0, 8(%rsp)
+ movq %xmm1, 16(%rsp)
+ movq %xmm2, 24(%rsp)
+ movq %xmm3, 32(%rsp)
+ call _x86_64_get_dispatch@PLT
+ movq 32(%rsp), %xmm3
+ movq 24(%rsp), %xmm2
+ movq 16(%rsp), %xmm1
+ movq 8(%rsp), %xmm0
+ movq (%rsp), %rdi
+ addq $40, %rsp
+ movq 6240(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 6240(%rax), %r11
+ jmp *%r11
+1:
+ subq $40, %rsp
+ movq %rdi, (%rsp)
+ movq %xmm0, 8(%rsp)
+ movq %xmm1, 16(%rsp)
+ movq %xmm2, 24(%rsp)
+ movq %xmm3, 32(%rsp)
+ call _glapi_get_dispatch
+ movq 32(%rsp), %xmm3
+ movq 24(%rsp), %xmm2
+ movq 16(%rsp), %xmm1
+ movq 8(%rsp), %xmm0
+ movq (%rsp), %rdi
+ addq $40, %rsp
+ movq 6240(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(VertexAttrib4fNV), .-GL_PREFIX(VertexAttrib4fNV)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(VertexAttrib4fvNV)
+ .type GL_PREFIX(VertexAttrib4fvNV), @function
+GL_PREFIX(VertexAttrib4fvNV):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 6248(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 6248(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 6248(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 6248(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(VertexAttrib4fvNV), .-GL_PREFIX(VertexAttrib4fvNV)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(VertexAttrib4sNV)
+ .type GL_PREFIX(VertexAttrib4sNV), @function
+GL_PREFIX(VertexAttrib4sNV):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 6256(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ call _x86_64_get_dispatch@PLT
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 6256(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 6256(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ call _glapi_get_dispatch
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 6256(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(VertexAttrib4sNV), .-GL_PREFIX(VertexAttrib4sNV)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(VertexAttrib4svNV)
+ .type GL_PREFIX(VertexAttrib4svNV), @function
+GL_PREFIX(VertexAttrib4svNV):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 6264(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 6264(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 6264(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 6264(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(VertexAttrib4svNV), .-GL_PREFIX(VertexAttrib4svNV)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(VertexAttrib4ubNV)
+ .type GL_PREFIX(VertexAttrib4ubNV), @function
+GL_PREFIX(VertexAttrib4ubNV):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 6272(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ call _x86_64_get_dispatch@PLT
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 6272(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 6272(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ call _glapi_get_dispatch
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 6272(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(VertexAttrib4ubNV), .-GL_PREFIX(VertexAttrib4ubNV)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(VertexAttrib4ubvNV)
+ .type GL_PREFIX(VertexAttrib4ubvNV), @function
+GL_PREFIX(VertexAttrib4ubvNV):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 6280(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 6280(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 6280(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 6280(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(VertexAttrib4ubvNV), .-GL_PREFIX(VertexAttrib4ubvNV)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(VertexAttribPointerNV)
+ .type GL_PREFIX(VertexAttribPointerNV), @function
+GL_PREFIX(VertexAttribPointerNV):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 6288(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ call _x86_64_get_dispatch@PLT
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 6288(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 6288(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ call _glapi_get_dispatch
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 6288(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(VertexAttribPointerNV), .-GL_PREFIX(VertexAttribPointerNV)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(VertexAttribs1dvNV)
+ .type GL_PREFIX(VertexAttribs1dvNV), @function
+GL_PREFIX(VertexAttribs1dvNV):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 6296(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 6296(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 6296(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 6296(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(VertexAttribs1dvNV), .-GL_PREFIX(VertexAttribs1dvNV)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(VertexAttribs1fvNV)
+ .type GL_PREFIX(VertexAttribs1fvNV), @function
+GL_PREFIX(VertexAttribs1fvNV):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 6304(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 6304(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 6304(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 6304(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(VertexAttribs1fvNV), .-GL_PREFIX(VertexAttribs1fvNV)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(VertexAttribs1svNV)
+ .type GL_PREFIX(VertexAttribs1svNV), @function
+GL_PREFIX(VertexAttribs1svNV):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 6312(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 6312(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 6312(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 6312(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(VertexAttribs1svNV), .-GL_PREFIX(VertexAttribs1svNV)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(VertexAttribs2dvNV)
+ .type GL_PREFIX(VertexAttribs2dvNV), @function
+GL_PREFIX(VertexAttribs2dvNV):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 6320(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 6320(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 6320(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 6320(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(VertexAttribs2dvNV), .-GL_PREFIX(VertexAttribs2dvNV)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(VertexAttribs2fvNV)
+ .type GL_PREFIX(VertexAttribs2fvNV), @function
+GL_PREFIX(VertexAttribs2fvNV):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 6328(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 6328(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 6328(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 6328(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(VertexAttribs2fvNV), .-GL_PREFIX(VertexAttribs2fvNV)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(VertexAttribs2svNV)
+ .type GL_PREFIX(VertexAttribs2svNV), @function
+GL_PREFIX(VertexAttribs2svNV):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 6336(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 6336(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 6336(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 6336(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(VertexAttribs2svNV), .-GL_PREFIX(VertexAttribs2svNV)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(VertexAttribs3dvNV)
+ .type GL_PREFIX(VertexAttribs3dvNV), @function
+GL_PREFIX(VertexAttribs3dvNV):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 6344(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 6344(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 6344(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 6344(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(VertexAttribs3dvNV), .-GL_PREFIX(VertexAttribs3dvNV)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(VertexAttribs3fvNV)
+ .type GL_PREFIX(VertexAttribs3fvNV), @function
+GL_PREFIX(VertexAttribs3fvNV):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 6352(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 6352(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 6352(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 6352(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(VertexAttribs3fvNV), .-GL_PREFIX(VertexAttribs3fvNV)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(VertexAttribs3svNV)
+ .type GL_PREFIX(VertexAttribs3svNV), @function
+GL_PREFIX(VertexAttribs3svNV):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 6360(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 6360(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 6360(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 6360(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(VertexAttribs3svNV), .-GL_PREFIX(VertexAttribs3svNV)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(VertexAttribs4dvNV)
+ .type GL_PREFIX(VertexAttribs4dvNV), @function
+GL_PREFIX(VertexAttribs4dvNV):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 6368(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 6368(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 6368(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 6368(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(VertexAttribs4dvNV), .-GL_PREFIX(VertexAttribs4dvNV)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(VertexAttribs4fvNV)
+ .type GL_PREFIX(VertexAttribs4fvNV), @function
+GL_PREFIX(VertexAttribs4fvNV):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 6376(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 6376(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 6376(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 6376(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(VertexAttribs4fvNV), .-GL_PREFIX(VertexAttribs4fvNV)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(VertexAttribs4svNV)
+ .type GL_PREFIX(VertexAttribs4svNV), @function
+GL_PREFIX(VertexAttribs4svNV):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 6384(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 6384(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 6384(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 6384(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(VertexAttribs4svNV), .-GL_PREFIX(VertexAttribs4svNV)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(VertexAttribs4ubvNV)
+ .type GL_PREFIX(VertexAttribs4ubvNV), @function
+GL_PREFIX(VertexAttribs4ubvNV):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 6392(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 6392(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 6392(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 6392(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(VertexAttribs4ubvNV), .-GL_PREFIX(VertexAttribs4ubvNV)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(GetTexBumpParameterfvATI)
+ .type GL_PREFIX(GetTexBumpParameterfvATI), @function
+GL_PREFIX(GetTexBumpParameterfvATI):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 6400(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 6400(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 6400(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 6400(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(GetTexBumpParameterfvATI), .-GL_PREFIX(GetTexBumpParameterfvATI)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(GetTexBumpParameterivATI)
+ .type GL_PREFIX(GetTexBumpParameterivATI), @function
+GL_PREFIX(GetTexBumpParameterivATI):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 6408(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 6408(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 6408(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 6408(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(GetTexBumpParameterivATI), .-GL_PREFIX(GetTexBumpParameterivATI)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(TexBumpParameterfvATI)
+ .type GL_PREFIX(TexBumpParameterfvATI), @function
+GL_PREFIX(TexBumpParameterfvATI):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 6416(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 6416(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 6416(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 6416(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(TexBumpParameterfvATI), .-GL_PREFIX(TexBumpParameterfvATI)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(TexBumpParameterivATI)
+ .type GL_PREFIX(TexBumpParameterivATI), @function
+GL_PREFIX(TexBumpParameterivATI):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 6424(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 6424(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 6424(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 6424(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(TexBumpParameterivATI), .-GL_PREFIX(TexBumpParameterivATI)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(AlphaFragmentOp1ATI)
+ .type GL_PREFIX(AlphaFragmentOp1ATI), @function
+GL_PREFIX(AlphaFragmentOp1ATI):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 6432(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ pushq %r9
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %r9
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 6432(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 6432(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ pushq %r9
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %r9
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 6432(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(AlphaFragmentOp1ATI), .-GL_PREFIX(AlphaFragmentOp1ATI)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(AlphaFragmentOp2ATI)
+ .type GL_PREFIX(AlphaFragmentOp2ATI), @function
+GL_PREFIX(AlphaFragmentOp2ATI):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 6440(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ pushq %r9
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %r9
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 6440(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 6440(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ pushq %r9
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %r9
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 6440(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(AlphaFragmentOp2ATI), .-GL_PREFIX(AlphaFragmentOp2ATI)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(AlphaFragmentOp3ATI)
+ .type GL_PREFIX(AlphaFragmentOp3ATI), @function
+GL_PREFIX(AlphaFragmentOp3ATI):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 6448(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ pushq %r9
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %r9
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 6448(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 6448(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ pushq %r9
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %r9
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 6448(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(AlphaFragmentOp3ATI), .-GL_PREFIX(AlphaFragmentOp3ATI)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(BeginFragmentShaderATI)
+ .type GL_PREFIX(BeginFragmentShaderATI), @function
+GL_PREFIX(BeginFragmentShaderATI):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 6456(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ movq 6456(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 6456(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ movq 6456(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(BeginFragmentShaderATI), .-GL_PREFIX(BeginFragmentShaderATI)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(BindFragmentShaderATI)
+ .type GL_PREFIX(BindFragmentShaderATI), @function
+GL_PREFIX(BindFragmentShaderATI):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 6464(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 6464(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 6464(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 6464(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(BindFragmentShaderATI), .-GL_PREFIX(BindFragmentShaderATI)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(ColorFragmentOp1ATI)
+ .type GL_PREFIX(ColorFragmentOp1ATI), @function
+GL_PREFIX(ColorFragmentOp1ATI):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 6472(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ pushq %r9
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %r9
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 6472(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 6472(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ pushq %r9
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %r9
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 6472(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(ColorFragmentOp1ATI), .-GL_PREFIX(ColorFragmentOp1ATI)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(ColorFragmentOp2ATI)
+ .type GL_PREFIX(ColorFragmentOp2ATI), @function
+GL_PREFIX(ColorFragmentOp2ATI):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 6480(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ pushq %r9
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %r9
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 6480(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 6480(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ pushq %r9
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %r9
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 6480(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(ColorFragmentOp2ATI), .-GL_PREFIX(ColorFragmentOp2ATI)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(ColorFragmentOp3ATI)
+ .type GL_PREFIX(ColorFragmentOp3ATI), @function
+GL_PREFIX(ColorFragmentOp3ATI):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 6488(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ pushq %r9
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %r9
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 6488(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 6488(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ pushq %r9
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %r9
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 6488(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(ColorFragmentOp3ATI), .-GL_PREFIX(ColorFragmentOp3ATI)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(DeleteFragmentShaderATI)
+ .type GL_PREFIX(DeleteFragmentShaderATI), @function
+GL_PREFIX(DeleteFragmentShaderATI):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 6496(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 6496(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 6496(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 6496(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(DeleteFragmentShaderATI), .-GL_PREFIX(DeleteFragmentShaderATI)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(EndFragmentShaderATI)
+ .type GL_PREFIX(EndFragmentShaderATI), @function
+GL_PREFIX(EndFragmentShaderATI):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 6504(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ movq 6504(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 6504(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ movq 6504(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(EndFragmentShaderATI), .-GL_PREFIX(EndFragmentShaderATI)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(GenFragmentShadersATI)
+ .type GL_PREFIX(GenFragmentShadersATI), @function
+GL_PREFIX(GenFragmentShadersATI):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 6512(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 6512(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 6512(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 6512(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(GenFragmentShadersATI), .-GL_PREFIX(GenFragmentShadersATI)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(PassTexCoordATI)
+ .type GL_PREFIX(PassTexCoordATI), @function
+GL_PREFIX(PassTexCoordATI):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 6520(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 6520(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 6520(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 6520(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(PassTexCoordATI), .-GL_PREFIX(PassTexCoordATI)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(SampleMapATI)
+ .type GL_PREFIX(SampleMapATI), @function
+GL_PREFIX(SampleMapATI):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 6528(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 6528(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 6528(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 6528(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(SampleMapATI), .-GL_PREFIX(SampleMapATI)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(SetFragmentShaderConstantATI)
+ .type GL_PREFIX(SetFragmentShaderConstantATI), @function
+GL_PREFIX(SetFragmentShaderConstantATI):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 6536(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 6536(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 6536(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 6536(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(SetFragmentShaderConstantATI), .-GL_PREFIX(SetFragmentShaderConstantATI)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(PointParameteriNV)
+ .type GL_PREFIX(PointParameteriNV), @function
+GL_PREFIX(PointParameteriNV):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 6544(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 6544(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 6544(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 6544(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(PointParameteriNV), .-GL_PREFIX(PointParameteriNV)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(PointParameterivNV)
+ .type GL_PREFIX(PointParameterivNV), @function
+GL_PREFIX(PointParameterivNV):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 6552(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 6552(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 6552(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 6552(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(PointParameterivNV), .-GL_PREFIX(PointParameterivNV)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(_dispatch_stub_820)
+ .type GL_PREFIX(_dispatch_stub_820), @function
+ HIDDEN(GL_PREFIX(_dispatch_stub_820))
+GL_PREFIX(_dispatch_stub_820):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 6560(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 6560(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 6560(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 6560(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(_dispatch_stub_820), .-GL_PREFIX(_dispatch_stub_820)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(_dispatch_stub_821)
+ .type GL_PREFIX(_dispatch_stub_821), @function
+ HIDDEN(GL_PREFIX(_dispatch_stub_821))
+GL_PREFIX(_dispatch_stub_821):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 6568(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 6568(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 6568(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 6568(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(_dispatch_stub_821), .-GL_PREFIX(_dispatch_stub_821)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(_dispatch_stub_822)
+ .type GL_PREFIX(_dispatch_stub_822), @function
+ HIDDEN(GL_PREFIX(_dispatch_stub_822))
+GL_PREFIX(_dispatch_stub_822):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 6576(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 6576(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 6576(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 6576(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(_dispatch_stub_822), .-GL_PREFIX(_dispatch_stub_822)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(_dispatch_stub_823)
+ .type GL_PREFIX(_dispatch_stub_823), @function
+ HIDDEN(GL_PREFIX(_dispatch_stub_823))
+GL_PREFIX(_dispatch_stub_823):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 6584(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 6584(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 6584(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 6584(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(_dispatch_stub_823), .-GL_PREFIX(_dispatch_stub_823)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(_dispatch_stub_824)
+ .type GL_PREFIX(_dispatch_stub_824), @function
+ HIDDEN(GL_PREFIX(_dispatch_stub_824))
+GL_PREFIX(_dispatch_stub_824):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 6592(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 6592(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 6592(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 6592(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(_dispatch_stub_824), .-GL_PREFIX(_dispatch_stub_824)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(GetProgramNamedParameterdvNV)
+ .type GL_PREFIX(GetProgramNamedParameterdvNV), @function
+GL_PREFIX(GetProgramNamedParameterdvNV):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 6600(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 6600(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 6600(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 6600(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(GetProgramNamedParameterdvNV), .-GL_PREFIX(GetProgramNamedParameterdvNV)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(GetProgramNamedParameterfvNV)
+ .type GL_PREFIX(GetProgramNamedParameterfvNV), @function
+GL_PREFIX(GetProgramNamedParameterfvNV):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 6608(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 6608(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 6608(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 6608(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(GetProgramNamedParameterfvNV), .-GL_PREFIX(GetProgramNamedParameterfvNV)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(ProgramNamedParameter4dNV)
+ .type GL_PREFIX(ProgramNamedParameter4dNV), @function
+GL_PREFIX(ProgramNamedParameter4dNV):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 6616(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ subq $56, %rsp
+ movq %rdi, (%rsp)
+ movq %rsi, 8(%rsp)
+ movq %rdx, 16(%rsp)
+ movq %xmm0, 24(%rsp)
+ movq %xmm1, 32(%rsp)
+ movq %xmm2, 40(%rsp)
+ movq %xmm3, 48(%rsp)
+ call _x86_64_get_dispatch@PLT
+ movq 48(%rsp), %xmm3
+ movq 40(%rsp), %xmm2
+ movq 32(%rsp), %xmm1
+ movq 24(%rsp), %xmm0
+ movq 16(%rsp), %rdx
+ movq 8(%rsp), %rsi
+ movq (%rsp), %rdi
+ addq $56, %rsp
+ movq 6616(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 6616(%rax), %r11
+ jmp *%r11
+1:
+ subq $56, %rsp
+ movq %rdi, (%rsp)
+ movq %rsi, 8(%rsp)
+ movq %rdx, 16(%rsp)
+ movq %xmm0, 24(%rsp)
+ movq %xmm1, 32(%rsp)
+ movq %xmm2, 40(%rsp)
+ movq %xmm3, 48(%rsp)
+ call _glapi_get_dispatch
+ movq 48(%rsp), %xmm3
+ movq 40(%rsp), %xmm2
+ movq 32(%rsp), %xmm1
+ movq 24(%rsp), %xmm0
+ movq 16(%rsp), %rdx
+ movq 8(%rsp), %rsi
+ movq (%rsp), %rdi
+ addq $56, %rsp
+ movq 6616(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(ProgramNamedParameter4dNV), .-GL_PREFIX(ProgramNamedParameter4dNV)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(ProgramNamedParameter4dvNV)
+ .type GL_PREFIX(ProgramNamedParameter4dvNV), @function
+GL_PREFIX(ProgramNamedParameter4dvNV):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 6624(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 6624(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 6624(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 6624(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(ProgramNamedParameter4dvNV), .-GL_PREFIX(ProgramNamedParameter4dvNV)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(ProgramNamedParameter4fNV)
+ .type GL_PREFIX(ProgramNamedParameter4fNV), @function
+GL_PREFIX(ProgramNamedParameter4fNV):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 6632(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ subq $56, %rsp
+ movq %rdi, (%rsp)
+ movq %rsi, 8(%rsp)
+ movq %rdx, 16(%rsp)
+ movq %xmm0, 24(%rsp)
+ movq %xmm1, 32(%rsp)
+ movq %xmm2, 40(%rsp)
+ movq %xmm3, 48(%rsp)
+ call _x86_64_get_dispatch@PLT
+ movq 48(%rsp), %xmm3
+ movq 40(%rsp), %xmm2
+ movq 32(%rsp), %xmm1
+ movq 24(%rsp), %xmm0
+ movq 16(%rsp), %rdx
+ movq 8(%rsp), %rsi
+ movq (%rsp), %rdi
+ addq $56, %rsp
+ movq 6632(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 6632(%rax), %r11
+ jmp *%r11
+1:
+ subq $56, %rsp
+ movq %rdi, (%rsp)
+ movq %rsi, 8(%rsp)
+ movq %rdx, 16(%rsp)
+ movq %xmm0, 24(%rsp)
+ movq %xmm1, 32(%rsp)
+ movq %xmm2, 40(%rsp)
+ movq %xmm3, 48(%rsp)
+ call _glapi_get_dispatch
+ movq 48(%rsp), %xmm3
+ movq 40(%rsp), %xmm2
+ movq 32(%rsp), %xmm1
+ movq 24(%rsp), %xmm0
+ movq 16(%rsp), %rdx
+ movq 8(%rsp), %rsi
+ movq (%rsp), %rdi
+ addq $56, %rsp
+ movq 6632(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(ProgramNamedParameter4fNV), .-GL_PREFIX(ProgramNamedParameter4fNV)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(ProgramNamedParameter4fvNV)
+ .type GL_PREFIX(ProgramNamedParameter4fvNV), @function
+GL_PREFIX(ProgramNamedParameter4fvNV):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 6640(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 6640(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 6640(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 6640(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(ProgramNamedParameter4fvNV), .-GL_PREFIX(ProgramNamedParameter4fvNV)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(PrimitiveRestartIndexNV)
+ .type GL_PREFIX(PrimitiveRestartIndexNV), @function
+GL_PREFIX(PrimitiveRestartIndexNV):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 6648(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 6648(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 6648(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 6648(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(PrimitiveRestartIndexNV), .-GL_PREFIX(PrimitiveRestartIndexNV)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(PrimitiveRestartNV)
+ .type GL_PREFIX(PrimitiveRestartNV), @function
+GL_PREFIX(PrimitiveRestartNV):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 6656(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ movq 6656(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 6656(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ movq 6656(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(PrimitiveRestartNV), .-GL_PREFIX(PrimitiveRestartNV)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(_dispatch_stub_833)
+ .type GL_PREFIX(_dispatch_stub_833), @function
+ HIDDEN(GL_PREFIX(_dispatch_stub_833))
+GL_PREFIX(_dispatch_stub_833):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 6664(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 6664(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 6664(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 6664(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(_dispatch_stub_833), .-GL_PREFIX(_dispatch_stub_833)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(_dispatch_stub_834)
+ .type GL_PREFIX(_dispatch_stub_834), @function
+ HIDDEN(GL_PREFIX(_dispatch_stub_834))
+GL_PREFIX(_dispatch_stub_834):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 6672(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 6672(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 6672(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 6672(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(_dispatch_stub_834), .-GL_PREFIX(_dispatch_stub_834)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(BindFramebufferEXT)
+ .type GL_PREFIX(BindFramebufferEXT), @function
+GL_PREFIX(BindFramebufferEXT):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 6680(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 6680(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 6680(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 6680(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(BindFramebufferEXT), .-GL_PREFIX(BindFramebufferEXT)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(BindRenderbufferEXT)
+ .type GL_PREFIX(BindRenderbufferEXT), @function
+GL_PREFIX(BindRenderbufferEXT):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 6688(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 6688(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 6688(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 6688(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(BindRenderbufferEXT), .-GL_PREFIX(BindRenderbufferEXT)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(CheckFramebufferStatusEXT)
+ .type GL_PREFIX(CheckFramebufferStatusEXT), @function
+GL_PREFIX(CheckFramebufferStatusEXT):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 6696(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 6696(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 6696(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 6696(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(CheckFramebufferStatusEXT), .-GL_PREFIX(CheckFramebufferStatusEXT)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(DeleteFramebuffersEXT)
+ .type GL_PREFIX(DeleteFramebuffersEXT), @function
+GL_PREFIX(DeleteFramebuffersEXT):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 6704(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 6704(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 6704(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 6704(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(DeleteFramebuffersEXT), .-GL_PREFIX(DeleteFramebuffersEXT)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(DeleteRenderbuffersEXT)
+ .type GL_PREFIX(DeleteRenderbuffersEXT), @function
+GL_PREFIX(DeleteRenderbuffersEXT):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 6712(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 6712(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 6712(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 6712(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(DeleteRenderbuffersEXT), .-GL_PREFIX(DeleteRenderbuffersEXT)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(FramebufferRenderbufferEXT)
+ .type GL_PREFIX(FramebufferRenderbufferEXT), @function
+GL_PREFIX(FramebufferRenderbufferEXT):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 6720(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 6720(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 6720(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 6720(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(FramebufferRenderbufferEXT), .-GL_PREFIX(FramebufferRenderbufferEXT)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(FramebufferTexture1DEXT)
+ .type GL_PREFIX(FramebufferTexture1DEXT), @function
+GL_PREFIX(FramebufferTexture1DEXT):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 6728(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ call _x86_64_get_dispatch@PLT
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 6728(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 6728(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ call _glapi_get_dispatch
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 6728(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(FramebufferTexture1DEXT), .-GL_PREFIX(FramebufferTexture1DEXT)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(FramebufferTexture2DEXT)
+ .type GL_PREFIX(FramebufferTexture2DEXT), @function
+GL_PREFIX(FramebufferTexture2DEXT):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 6736(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ call _x86_64_get_dispatch@PLT
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 6736(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 6736(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ call _glapi_get_dispatch
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 6736(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(FramebufferTexture2DEXT), .-GL_PREFIX(FramebufferTexture2DEXT)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(FramebufferTexture3DEXT)
+ .type GL_PREFIX(FramebufferTexture3DEXT), @function
+GL_PREFIX(FramebufferTexture3DEXT):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 6744(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ pushq %r9
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %r9
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 6744(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 6744(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ pushq %r9
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %r9
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 6744(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(FramebufferTexture3DEXT), .-GL_PREFIX(FramebufferTexture3DEXT)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(GenFramebuffersEXT)
+ .type GL_PREFIX(GenFramebuffersEXT), @function
+GL_PREFIX(GenFramebuffersEXT):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 6752(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 6752(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 6752(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 6752(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(GenFramebuffersEXT), .-GL_PREFIX(GenFramebuffersEXT)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(GenRenderbuffersEXT)
+ .type GL_PREFIX(GenRenderbuffersEXT), @function
+GL_PREFIX(GenRenderbuffersEXT):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 6760(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 6760(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 6760(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 6760(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(GenRenderbuffersEXT), .-GL_PREFIX(GenRenderbuffersEXT)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(GenerateMipmapEXT)
+ .type GL_PREFIX(GenerateMipmapEXT), @function
+GL_PREFIX(GenerateMipmapEXT):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 6768(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 6768(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 6768(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 6768(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(GenerateMipmapEXT), .-GL_PREFIX(GenerateMipmapEXT)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(GetFramebufferAttachmentParameterivEXT)
+ .type GL_PREFIX(GetFramebufferAttachmentParameterivEXT), @function
+GL_PREFIX(GetFramebufferAttachmentParameterivEXT):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 6776(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 6776(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 6776(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 6776(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(GetFramebufferAttachmentParameterivEXT), .-GL_PREFIX(GetFramebufferAttachmentParameterivEXT)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(GetRenderbufferParameterivEXT)
+ .type GL_PREFIX(GetRenderbufferParameterivEXT), @function
+GL_PREFIX(GetRenderbufferParameterivEXT):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 6784(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 6784(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 6784(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 6784(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(GetRenderbufferParameterivEXT), .-GL_PREFIX(GetRenderbufferParameterivEXT)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(IsFramebufferEXT)
+ .type GL_PREFIX(IsFramebufferEXT), @function
+GL_PREFIX(IsFramebufferEXT):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 6792(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 6792(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 6792(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 6792(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(IsFramebufferEXT), .-GL_PREFIX(IsFramebufferEXT)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(IsRenderbufferEXT)
+ .type GL_PREFIX(IsRenderbufferEXT), @function
+GL_PREFIX(IsRenderbufferEXT):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 6800(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 6800(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 6800(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 6800(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(IsRenderbufferEXT), .-GL_PREFIX(IsRenderbufferEXT)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(RenderbufferStorageEXT)
+ .type GL_PREFIX(RenderbufferStorageEXT), @function
+GL_PREFIX(RenderbufferStorageEXT):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 6808(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 6808(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 6808(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 6808(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(RenderbufferStorageEXT), .-GL_PREFIX(RenderbufferStorageEXT)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(_dispatch_stub_852)
+ .type GL_PREFIX(_dispatch_stub_852), @function
+ HIDDEN(GL_PREFIX(_dispatch_stub_852))
+GL_PREFIX(_dispatch_stub_852):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 6816(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ pushq %r9
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %r9
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 6816(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 6816(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ pushq %r9
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %r9
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 6816(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(_dispatch_stub_852), .-GL_PREFIX(_dispatch_stub_852)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(_dispatch_stub_853)
+ .type GL_PREFIX(_dispatch_stub_853), @function
+ HIDDEN(GL_PREFIX(_dispatch_stub_853))
+GL_PREFIX(_dispatch_stub_853):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 6824(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 6824(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 6824(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 6824(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(_dispatch_stub_853), .-GL_PREFIX(_dispatch_stub_853)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(_dispatch_stub_854)
+ .type GL_PREFIX(_dispatch_stub_854), @function
+ HIDDEN(GL_PREFIX(_dispatch_stub_854))
+GL_PREFIX(_dispatch_stub_854):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 6832(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 6832(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 6832(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 6832(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(_dispatch_stub_854), .-GL_PREFIX(_dispatch_stub_854)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(BindFragDataLocationEXT)
+ .type GL_PREFIX(BindFragDataLocationEXT), @function
+GL_PREFIX(BindFragDataLocationEXT):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 6840(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 6840(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 6840(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 6840(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(BindFragDataLocationEXT), .-GL_PREFIX(BindFragDataLocationEXT)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(GetFragDataLocationEXT)
+ .type GL_PREFIX(GetFragDataLocationEXT), @function
+GL_PREFIX(GetFragDataLocationEXT):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 6848(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 6848(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 6848(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 6848(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(GetFragDataLocationEXT), .-GL_PREFIX(GetFragDataLocationEXT)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(GetUniformuivEXT)
+ .type GL_PREFIX(GetUniformuivEXT), @function
+GL_PREFIX(GetUniformuivEXT):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 6856(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 6856(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 6856(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 6856(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(GetUniformuivEXT), .-GL_PREFIX(GetUniformuivEXT)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(GetVertexAttribIivEXT)
+ .type GL_PREFIX(GetVertexAttribIivEXT), @function
+GL_PREFIX(GetVertexAttribIivEXT):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 6864(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 6864(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 6864(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 6864(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(GetVertexAttribIivEXT), .-GL_PREFIX(GetVertexAttribIivEXT)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(GetVertexAttribIuivEXT)
+ .type GL_PREFIX(GetVertexAttribIuivEXT), @function
+GL_PREFIX(GetVertexAttribIuivEXT):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 6872(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 6872(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 6872(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 6872(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(GetVertexAttribIuivEXT), .-GL_PREFIX(GetVertexAttribIuivEXT)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(Uniform1uiEXT)
+ .type GL_PREFIX(Uniform1uiEXT), @function
+GL_PREFIX(Uniform1uiEXT):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 6880(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 6880(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 6880(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 6880(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(Uniform1uiEXT), .-GL_PREFIX(Uniform1uiEXT)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(Uniform1uivEXT)
+ .type GL_PREFIX(Uniform1uivEXT), @function
+GL_PREFIX(Uniform1uivEXT):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 6888(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 6888(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 6888(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 6888(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(Uniform1uivEXT), .-GL_PREFIX(Uniform1uivEXT)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(Uniform2uiEXT)
+ .type GL_PREFIX(Uniform2uiEXT), @function
+GL_PREFIX(Uniform2uiEXT):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 6896(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 6896(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 6896(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 6896(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(Uniform2uiEXT), .-GL_PREFIX(Uniform2uiEXT)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(Uniform2uivEXT)
+ .type GL_PREFIX(Uniform2uivEXT), @function
+GL_PREFIX(Uniform2uivEXT):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 6904(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 6904(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 6904(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 6904(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(Uniform2uivEXT), .-GL_PREFIX(Uniform2uivEXT)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(Uniform3uiEXT)
+ .type GL_PREFIX(Uniform3uiEXT), @function
+GL_PREFIX(Uniform3uiEXT):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 6912(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 6912(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 6912(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 6912(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(Uniform3uiEXT), .-GL_PREFIX(Uniform3uiEXT)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(Uniform3uivEXT)
+ .type GL_PREFIX(Uniform3uivEXT), @function
+GL_PREFIX(Uniform3uivEXT):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 6920(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 6920(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 6920(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 6920(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(Uniform3uivEXT), .-GL_PREFIX(Uniform3uivEXT)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(Uniform4uiEXT)
+ .type GL_PREFIX(Uniform4uiEXT), @function
+GL_PREFIX(Uniform4uiEXT):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 6928(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ call _x86_64_get_dispatch@PLT
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 6928(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 6928(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ call _glapi_get_dispatch
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 6928(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(Uniform4uiEXT), .-GL_PREFIX(Uniform4uiEXT)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(Uniform4uivEXT)
+ .type GL_PREFIX(Uniform4uivEXT), @function
+GL_PREFIX(Uniform4uivEXT):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 6936(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 6936(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 6936(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 6936(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(Uniform4uivEXT), .-GL_PREFIX(Uniform4uivEXT)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(VertexAttribI1iEXT)
+ .type GL_PREFIX(VertexAttribI1iEXT), @function
+GL_PREFIX(VertexAttribI1iEXT):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 6944(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 6944(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 6944(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 6944(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(VertexAttribI1iEXT), .-GL_PREFIX(VertexAttribI1iEXT)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(VertexAttribI1ivEXT)
+ .type GL_PREFIX(VertexAttribI1ivEXT), @function
+GL_PREFIX(VertexAttribI1ivEXT):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 6952(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 6952(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 6952(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 6952(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(VertexAttribI1ivEXT), .-GL_PREFIX(VertexAttribI1ivEXT)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(VertexAttribI1uiEXT)
+ .type GL_PREFIX(VertexAttribI1uiEXT), @function
+GL_PREFIX(VertexAttribI1uiEXT):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 6960(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 6960(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 6960(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 6960(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(VertexAttribI1uiEXT), .-GL_PREFIX(VertexAttribI1uiEXT)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(VertexAttribI1uivEXT)
+ .type GL_PREFIX(VertexAttribI1uivEXT), @function
+GL_PREFIX(VertexAttribI1uivEXT):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 6968(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 6968(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 6968(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 6968(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(VertexAttribI1uivEXT), .-GL_PREFIX(VertexAttribI1uivEXT)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(VertexAttribI2iEXT)
+ .type GL_PREFIX(VertexAttribI2iEXT), @function
+GL_PREFIX(VertexAttribI2iEXT):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 6976(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 6976(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 6976(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 6976(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(VertexAttribI2iEXT), .-GL_PREFIX(VertexAttribI2iEXT)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(VertexAttribI2ivEXT)
+ .type GL_PREFIX(VertexAttribI2ivEXT), @function
+GL_PREFIX(VertexAttribI2ivEXT):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 6984(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 6984(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 6984(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 6984(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(VertexAttribI2ivEXT), .-GL_PREFIX(VertexAttribI2ivEXT)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(VertexAttribI2uiEXT)
+ .type GL_PREFIX(VertexAttribI2uiEXT), @function
+GL_PREFIX(VertexAttribI2uiEXT):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 6992(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 6992(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 6992(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 6992(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(VertexAttribI2uiEXT), .-GL_PREFIX(VertexAttribI2uiEXT)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(VertexAttribI2uivEXT)
+ .type GL_PREFIX(VertexAttribI2uivEXT), @function
+GL_PREFIX(VertexAttribI2uivEXT):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 7000(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 7000(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 7000(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 7000(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(VertexAttribI2uivEXT), .-GL_PREFIX(VertexAttribI2uivEXT)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(VertexAttribI3iEXT)
+ .type GL_PREFIX(VertexAttribI3iEXT), @function
+GL_PREFIX(VertexAttribI3iEXT):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 7008(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 7008(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 7008(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 7008(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(VertexAttribI3iEXT), .-GL_PREFIX(VertexAttribI3iEXT)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(VertexAttribI3ivEXT)
+ .type GL_PREFIX(VertexAttribI3ivEXT), @function
+GL_PREFIX(VertexAttribI3ivEXT):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 7016(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 7016(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 7016(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 7016(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(VertexAttribI3ivEXT), .-GL_PREFIX(VertexAttribI3ivEXT)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(VertexAttribI3uiEXT)
+ .type GL_PREFIX(VertexAttribI3uiEXT), @function
+GL_PREFIX(VertexAttribI3uiEXT):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 7024(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 7024(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 7024(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 7024(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(VertexAttribI3uiEXT), .-GL_PREFIX(VertexAttribI3uiEXT)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(VertexAttribI3uivEXT)
+ .type GL_PREFIX(VertexAttribI3uivEXT), @function
+GL_PREFIX(VertexAttribI3uivEXT):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 7032(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 7032(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 7032(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 7032(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(VertexAttribI3uivEXT), .-GL_PREFIX(VertexAttribI3uivEXT)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(VertexAttribI4bvEXT)
+ .type GL_PREFIX(VertexAttribI4bvEXT), @function
+GL_PREFIX(VertexAttribI4bvEXT):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 7040(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 7040(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 7040(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 7040(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(VertexAttribI4bvEXT), .-GL_PREFIX(VertexAttribI4bvEXT)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(VertexAttribI4iEXT)
+ .type GL_PREFIX(VertexAttribI4iEXT), @function
+GL_PREFIX(VertexAttribI4iEXT):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 7048(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ call _x86_64_get_dispatch@PLT
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 7048(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 7048(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ call _glapi_get_dispatch
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 7048(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(VertexAttribI4iEXT), .-GL_PREFIX(VertexAttribI4iEXT)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(VertexAttribI4ivEXT)
+ .type GL_PREFIX(VertexAttribI4ivEXT), @function
+GL_PREFIX(VertexAttribI4ivEXT):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 7056(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 7056(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 7056(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 7056(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(VertexAttribI4ivEXT), .-GL_PREFIX(VertexAttribI4ivEXT)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(VertexAttribI4svEXT)
+ .type GL_PREFIX(VertexAttribI4svEXT), @function
+GL_PREFIX(VertexAttribI4svEXT):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 7064(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 7064(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 7064(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 7064(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(VertexAttribI4svEXT), .-GL_PREFIX(VertexAttribI4svEXT)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(VertexAttribI4ubvEXT)
+ .type GL_PREFIX(VertexAttribI4ubvEXT), @function
+GL_PREFIX(VertexAttribI4ubvEXT):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 7072(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 7072(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 7072(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 7072(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(VertexAttribI4ubvEXT), .-GL_PREFIX(VertexAttribI4ubvEXT)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(VertexAttribI4uiEXT)
+ .type GL_PREFIX(VertexAttribI4uiEXT), @function
+GL_PREFIX(VertexAttribI4uiEXT):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 7080(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ call _x86_64_get_dispatch@PLT
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 7080(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 7080(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ call _glapi_get_dispatch
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 7080(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(VertexAttribI4uiEXT), .-GL_PREFIX(VertexAttribI4uiEXT)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(VertexAttribI4uivEXT)
+ .type GL_PREFIX(VertexAttribI4uivEXT), @function
+GL_PREFIX(VertexAttribI4uivEXT):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 7088(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 7088(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 7088(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 7088(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(VertexAttribI4uivEXT), .-GL_PREFIX(VertexAttribI4uivEXT)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(VertexAttribI4usvEXT)
+ .type GL_PREFIX(VertexAttribI4usvEXT), @function
+GL_PREFIX(VertexAttribI4usvEXT):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 7096(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 7096(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 7096(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 7096(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(VertexAttribI4usvEXT), .-GL_PREFIX(VertexAttribI4usvEXT)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(VertexAttribIPointerEXT)
+ .type GL_PREFIX(VertexAttribIPointerEXT), @function
+GL_PREFIX(VertexAttribIPointerEXT):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 7104(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ call _x86_64_get_dispatch@PLT
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 7104(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 7104(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ call _glapi_get_dispatch
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 7104(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(VertexAttribIPointerEXT), .-GL_PREFIX(VertexAttribIPointerEXT)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(FramebufferTextureLayerEXT)
+ .type GL_PREFIX(FramebufferTextureLayerEXT), @function
+GL_PREFIX(FramebufferTextureLayerEXT):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 7112(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ call _x86_64_get_dispatch@PLT
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 7112(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 7112(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ call _glapi_get_dispatch
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 7112(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(FramebufferTextureLayerEXT), .-GL_PREFIX(FramebufferTextureLayerEXT)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(ColorMaskIndexedEXT)
+ .type GL_PREFIX(ColorMaskIndexedEXT), @function
+GL_PREFIX(ColorMaskIndexedEXT):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 7120(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ call _x86_64_get_dispatch@PLT
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 7120(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 7120(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ call _glapi_get_dispatch
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 7120(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(ColorMaskIndexedEXT), .-GL_PREFIX(ColorMaskIndexedEXT)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(DisableIndexedEXT)
+ .type GL_PREFIX(DisableIndexedEXT), @function
+GL_PREFIX(DisableIndexedEXT):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 7128(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 7128(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 7128(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 7128(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(DisableIndexedEXT), .-GL_PREFIX(DisableIndexedEXT)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(EnableIndexedEXT)
+ .type GL_PREFIX(EnableIndexedEXT), @function
+GL_PREFIX(EnableIndexedEXT):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 7136(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 7136(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 7136(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 7136(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(EnableIndexedEXT), .-GL_PREFIX(EnableIndexedEXT)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(GetBooleanIndexedvEXT)
+ .type GL_PREFIX(GetBooleanIndexedvEXT), @function
+GL_PREFIX(GetBooleanIndexedvEXT):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 7144(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 7144(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 7144(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 7144(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(GetBooleanIndexedvEXT), .-GL_PREFIX(GetBooleanIndexedvEXT)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(GetIntegerIndexedvEXT)
+ .type GL_PREFIX(GetIntegerIndexedvEXT), @function
+GL_PREFIX(GetIntegerIndexedvEXT):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 7152(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 7152(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 7152(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 7152(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(GetIntegerIndexedvEXT), .-GL_PREFIX(GetIntegerIndexedvEXT)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(IsEnabledIndexedEXT)
+ .type GL_PREFIX(IsEnabledIndexedEXT), @function
+GL_PREFIX(IsEnabledIndexedEXT):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 7160(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 7160(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 7160(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 7160(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(IsEnabledIndexedEXT), .-GL_PREFIX(IsEnabledIndexedEXT)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(ClearColorIiEXT)
+ .type GL_PREFIX(ClearColorIiEXT), @function
+GL_PREFIX(ClearColorIiEXT):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 7168(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 7168(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 7168(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 7168(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(ClearColorIiEXT), .-GL_PREFIX(ClearColorIiEXT)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(ClearColorIuiEXT)
+ .type GL_PREFIX(ClearColorIuiEXT), @function
+GL_PREFIX(ClearColorIuiEXT):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 7176(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 7176(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 7176(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 7176(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(ClearColorIuiEXT), .-GL_PREFIX(ClearColorIuiEXT)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(GetTexParameterIivEXT)
+ .type GL_PREFIX(GetTexParameterIivEXT), @function
+GL_PREFIX(GetTexParameterIivEXT):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 7184(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 7184(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 7184(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 7184(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(GetTexParameterIivEXT), .-GL_PREFIX(GetTexParameterIivEXT)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(GetTexParameterIuivEXT)
+ .type GL_PREFIX(GetTexParameterIuivEXT), @function
+GL_PREFIX(GetTexParameterIuivEXT):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 7192(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 7192(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 7192(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 7192(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(GetTexParameterIuivEXT), .-GL_PREFIX(GetTexParameterIuivEXT)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(TexParameterIivEXT)
+ .type GL_PREFIX(TexParameterIivEXT), @function
+GL_PREFIX(TexParameterIivEXT):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 7200(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 7200(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 7200(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 7200(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(TexParameterIivEXT), .-GL_PREFIX(TexParameterIivEXT)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(TexParameterIuivEXT)
+ .type GL_PREFIX(TexParameterIuivEXT), @function
+GL_PREFIX(TexParameterIuivEXT):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 7208(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 7208(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 7208(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 7208(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(TexParameterIuivEXT), .-GL_PREFIX(TexParameterIuivEXT)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(BeginConditionalRenderNV)
+ .type GL_PREFIX(BeginConditionalRenderNV), @function
+GL_PREFIX(BeginConditionalRenderNV):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 7216(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 7216(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 7216(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 7216(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(BeginConditionalRenderNV), .-GL_PREFIX(BeginConditionalRenderNV)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(EndConditionalRenderNV)
+ .type GL_PREFIX(EndConditionalRenderNV), @function
+GL_PREFIX(EndConditionalRenderNV):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 7224(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ movq 7224(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 7224(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ movq 7224(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(EndConditionalRenderNV), .-GL_PREFIX(EndConditionalRenderNV)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(BeginTransformFeedbackEXT)
+ .type GL_PREFIX(BeginTransformFeedbackEXT), @function
+GL_PREFIX(BeginTransformFeedbackEXT):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 7232(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 7232(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 7232(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 7232(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(BeginTransformFeedbackEXT), .-GL_PREFIX(BeginTransformFeedbackEXT)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(BindBufferBaseEXT)
+ .type GL_PREFIX(BindBufferBaseEXT), @function
+GL_PREFIX(BindBufferBaseEXT):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 7240(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 7240(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 7240(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 7240(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(BindBufferBaseEXT), .-GL_PREFIX(BindBufferBaseEXT)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(BindBufferOffsetEXT)
+ .type GL_PREFIX(BindBufferOffsetEXT), @function
+GL_PREFIX(BindBufferOffsetEXT):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 7248(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 7248(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 7248(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 7248(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(BindBufferOffsetEXT), .-GL_PREFIX(BindBufferOffsetEXT)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(BindBufferRangeEXT)
+ .type GL_PREFIX(BindBufferRangeEXT), @function
+GL_PREFIX(BindBufferRangeEXT):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 7256(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ call _x86_64_get_dispatch@PLT
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 7256(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 7256(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ call _glapi_get_dispatch
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 7256(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(BindBufferRangeEXT), .-GL_PREFIX(BindBufferRangeEXT)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(EndTransformFeedbackEXT)
+ .type GL_PREFIX(EndTransformFeedbackEXT), @function
+GL_PREFIX(EndTransformFeedbackEXT):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 7264(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ movq 7264(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 7264(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ movq 7264(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(EndTransformFeedbackEXT), .-GL_PREFIX(EndTransformFeedbackEXT)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(GetTransformFeedbackVaryingEXT)
+ .type GL_PREFIX(GetTransformFeedbackVaryingEXT), @function
+GL_PREFIX(GetTransformFeedbackVaryingEXT):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 7272(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ pushq %r9
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %r9
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 7272(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 7272(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %r8
+ pushq %r9
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %r9
+ popq %r8
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 7272(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(GetTransformFeedbackVaryingEXT), .-GL_PREFIX(GetTransformFeedbackVaryingEXT)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(TransformFeedbackVaryingsEXT)
+ .type GL_PREFIX(TransformFeedbackVaryingsEXT), @function
+GL_PREFIX(TransformFeedbackVaryingsEXT):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 7280(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 7280(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 7280(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 7280(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(TransformFeedbackVaryingsEXT), .-GL_PREFIX(TransformFeedbackVaryingsEXT)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(ProvokingVertexEXT)
+ .type GL_PREFIX(ProvokingVertexEXT), @function
+GL_PREFIX(ProvokingVertexEXT):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 7288(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 7288(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 7288(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 7288(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(ProvokingVertexEXT), .-GL_PREFIX(ProvokingVertexEXT)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(_dispatch_stub_912)
+ .type GL_PREFIX(_dispatch_stub_912), @function
+ HIDDEN(GL_PREFIX(_dispatch_stub_912))
+GL_PREFIX(_dispatch_stub_912):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 7296(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 7296(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 7296(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 7296(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(_dispatch_stub_912), .-GL_PREFIX(_dispatch_stub_912)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(_dispatch_stub_913)
+ .type GL_PREFIX(_dispatch_stub_913), @function
+ HIDDEN(GL_PREFIX(_dispatch_stub_913))
+GL_PREFIX(_dispatch_stub_913):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 7304(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 7304(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 7304(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 7304(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(_dispatch_stub_913), .-GL_PREFIX(_dispatch_stub_913)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(GetObjectParameterivAPPLE)
+ .type GL_PREFIX(GetObjectParameterivAPPLE), @function
+GL_PREFIX(GetObjectParameterivAPPLE):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 7312(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 7312(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 7312(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 7312(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(GetObjectParameterivAPPLE), .-GL_PREFIX(GetObjectParameterivAPPLE)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(ObjectPurgeableAPPLE)
+ .type GL_PREFIX(ObjectPurgeableAPPLE), @function
+GL_PREFIX(ObjectPurgeableAPPLE):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 7320(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 7320(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 7320(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 7320(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(ObjectPurgeableAPPLE), .-GL_PREFIX(ObjectPurgeableAPPLE)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(ObjectUnpurgeableAPPLE)
+ .type GL_PREFIX(ObjectUnpurgeableAPPLE), @function
+GL_PREFIX(ObjectUnpurgeableAPPLE):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 7328(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 7328(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 7328(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 7328(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(ObjectUnpurgeableAPPLE), .-GL_PREFIX(ObjectUnpurgeableAPPLE)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(ActiveProgramEXT)
+ .type GL_PREFIX(ActiveProgramEXT), @function
+GL_PREFIX(ActiveProgramEXT):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 7336(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ call _x86_64_get_dispatch@PLT
+ popq %rdi
+ movq 7336(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 7336(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ call _glapi_get_dispatch
+ popq %rdi
+ movq 7336(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(ActiveProgramEXT), .-GL_PREFIX(ActiveProgramEXT)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(CreateShaderProgramEXT)
+ .type GL_PREFIX(CreateShaderProgramEXT), @function
+GL_PREFIX(CreateShaderProgramEXT):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 7344(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 7344(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 7344(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 7344(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(CreateShaderProgramEXT), .-GL_PREFIX(CreateShaderProgramEXT)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(UseShaderProgramEXT)
+ .type GL_PREFIX(UseShaderProgramEXT), @function
+GL_PREFIX(UseShaderProgramEXT):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 7352(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 7352(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 7352(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 7352(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(UseShaderProgramEXT), .-GL_PREFIX(UseShaderProgramEXT)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(TextureBarrierNV)
+ .type GL_PREFIX(TextureBarrierNV), @function
+GL_PREFIX(TextureBarrierNV):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 7360(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ movq 7360(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 7360(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ movq 7360(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(TextureBarrierNV), .-GL_PREFIX(TextureBarrierNV)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(_dispatch_stub_921)
+ .type GL_PREFIX(_dispatch_stub_921), @function
+ HIDDEN(GL_PREFIX(_dispatch_stub_921))
+GL_PREFIX(_dispatch_stub_921):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 7368(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 7368(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 7368(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 7368(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(_dispatch_stub_921), .-GL_PREFIX(_dispatch_stub_921)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(_dispatch_stub_922)
+ .type GL_PREFIX(_dispatch_stub_922), @function
+ HIDDEN(GL_PREFIX(_dispatch_stub_922))
+GL_PREFIX(_dispatch_stub_922):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 7376(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 7376(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 7376(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 7376(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(_dispatch_stub_922), .-GL_PREFIX(_dispatch_stub_922)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(_dispatch_stub_923)
+ .type GL_PREFIX(_dispatch_stub_923), @function
+ HIDDEN(GL_PREFIX(_dispatch_stub_923))
+GL_PREFIX(_dispatch_stub_923):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 7384(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 7384(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 7384(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rcx
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 7384(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(_dispatch_stub_923), .-GL_PREFIX(_dispatch_stub_923)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(_dispatch_stub_924)
+ .type GL_PREFIX(_dispatch_stub_924), @function
+ HIDDEN(GL_PREFIX(_dispatch_stub_924))
+GL_PREFIX(_dispatch_stub_924):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 7392(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 7392(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 7392(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 7392(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(_dispatch_stub_924), .-GL_PREFIX(_dispatch_stub_924)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(_dispatch_stub_925)
+ .type GL_PREFIX(_dispatch_stub_925), @function
+ HIDDEN(GL_PREFIX(_dispatch_stub_925))
+GL_PREFIX(_dispatch_stub_925):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 7400(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _x86_64_get_dispatch@PLT
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 7400(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 7400(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ call _glapi_get_dispatch
+ popq %rdx
+ popq %rsi
+ popq %rdi
+ movq 7400(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(_dispatch_stub_925), .-GL_PREFIX(_dispatch_stub_925)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(EGLImageTargetRenderbufferStorageOES)
+ .type GL_PREFIX(EGLImageTargetRenderbufferStorageOES), @function
+GL_PREFIX(EGLImageTargetRenderbufferStorageOES):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 7408(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 7408(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 7408(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 7408(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(EGLImageTargetRenderbufferStorageOES), .-GL_PREFIX(EGLImageTargetRenderbufferStorageOES)
+
+ .p2align 4,,15
+ .globl GL_PREFIX(EGLImageTargetTexture2DOES)
+ .type GL_PREFIX(EGLImageTargetTexture2DOES), @function
+GL_PREFIX(EGLImageTargetTexture2DOES):
+#if defined(GLX_USE_TLS)
+ call _x86_64_get_dispatch@PLT
+ movq 7416(%rax), %r11
+ jmp *%r11
+#elif defined(PTHREADS)
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _x86_64_get_dispatch@PLT
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 7416(%rax), %r11
+ jmp *%r11
+#else
+ movq _glapi_Dispatch(%rip), %rax
+ testq %rax, %rax
+ je 1f
+ movq 7416(%rax), %r11
+ jmp *%r11
+1:
+ pushq %rdi
+ pushq %rsi
+ pushq %rbp
+ call _glapi_get_dispatch
+ popq %rbp
+ popq %rsi
+ popq %rdi
+ movq 7416(%rax), %r11
+ jmp *%r11
+#endif /* defined(GLX_USE_TLS) */
+ .size GL_PREFIX(EGLImageTargetTexture2DOES), .-GL_PREFIX(EGLImageTargetTexture2DOES)
+
+ .globl GL_PREFIX(ArrayElementEXT) ; .set GL_PREFIX(ArrayElementEXT), GL_PREFIX(ArrayElement)
+ .globl GL_PREFIX(BindTextureEXT) ; .set GL_PREFIX(BindTextureEXT), GL_PREFIX(BindTexture)
+ .globl GL_PREFIX(DrawArraysEXT) ; .set GL_PREFIX(DrawArraysEXT), GL_PREFIX(DrawArrays)
+#ifndef GLX_INDIRECT_RENDERING
+ .globl GL_PREFIX(AreTexturesResidentEXT) ; .set GL_PREFIX(AreTexturesResidentEXT), GL_PREFIX(AreTexturesResident)
+#endif
+ .globl GL_PREFIX(CopyTexImage1DEXT) ; .set GL_PREFIX(CopyTexImage1DEXT), GL_PREFIX(CopyTexImage1D)
+ .globl GL_PREFIX(CopyTexImage2DEXT) ; .set GL_PREFIX(CopyTexImage2DEXT), GL_PREFIX(CopyTexImage2D)
+ .globl GL_PREFIX(CopyTexSubImage1DEXT) ; .set GL_PREFIX(CopyTexSubImage1DEXT), GL_PREFIX(CopyTexSubImage1D)
+ .globl GL_PREFIX(CopyTexSubImage2DEXT) ; .set GL_PREFIX(CopyTexSubImage2DEXT), GL_PREFIX(CopyTexSubImage2D)
+#ifndef GLX_INDIRECT_RENDERING
+ .globl GL_PREFIX(DeleteTexturesEXT) ; .set GL_PREFIX(DeleteTexturesEXT), GL_PREFIX(DeleteTextures)
+#endif
+#ifndef GLX_INDIRECT_RENDERING
+ .globl GL_PREFIX(GenTexturesEXT) ; .set GL_PREFIX(GenTexturesEXT), GL_PREFIX(GenTextures)
+#endif
+ .globl GL_PREFIX(GetPointervEXT) ; .set GL_PREFIX(GetPointervEXT), GL_PREFIX(GetPointerv)
+#ifndef GLX_INDIRECT_RENDERING
+ .globl GL_PREFIX(IsTextureEXT) ; .set GL_PREFIX(IsTextureEXT), GL_PREFIX(IsTexture)
+#endif
+ .globl GL_PREFIX(PrioritizeTexturesEXT) ; .set GL_PREFIX(PrioritizeTexturesEXT), GL_PREFIX(PrioritizeTextures)
+ .globl GL_PREFIX(TexSubImage1DEXT) ; .set GL_PREFIX(TexSubImage1DEXT), GL_PREFIX(TexSubImage1D)
+ .globl GL_PREFIX(TexSubImage2DEXT) ; .set GL_PREFIX(TexSubImage2DEXT), GL_PREFIX(TexSubImage2D)
+ .globl GL_PREFIX(BlendColorEXT) ; .set GL_PREFIX(BlendColorEXT), GL_PREFIX(BlendColor)
+ .globl GL_PREFIX(BlendEquationEXT) ; .set GL_PREFIX(BlendEquationEXT), GL_PREFIX(BlendEquation)
+ .globl GL_PREFIX(DrawRangeElementsEXT) ; .set GL_PREFIX(DrawRangeElementsEXT), GL_PREFIX(DrawRangeElements)
+ .globl GL_PREFIX(ColorTableEXT) ; .set GL_PREFIX(ColorTableEXT), GL_PREFIX(ColorTable)
+#ifndef GLX_INDIRECT_RENDERING
+ .globl GL_PREFIX(GetColorTableEXT) ; .set GL_PREFIX(GetColorTableEXT), GL_PREFIX(GetColorTable)
+#endif
+#ifndef GLX_INDIRECT_RENDERING
+ .globl GL_PREFIX(GetColorTableParameterfvEXT) ; .set GL_PREFIX(GetColorTableParameterfvEXT), GL_PREFIX(GetColorTableParameterfv)
+#endif
+#ifndef GLX_INDIRECT_RENDERING
+ .globl GL_PREFIX(GetColorTableParameterivEXT) ; .set GL_PREFIX(GetColorTableParameterivEXT), GL_PREFIX(GetColorTableParameteriv)
+#endif
+ .globl GL_PREFIX(TexImage3DEXT) ; .set GL_PREFIX(TexImage3DEXT), GL_PREFIX(TexImage3D)
+ .globl GL_PREFIX(TexSubImage3DEXT) ; .set GL_PREFIX(TexSubImage3DEXT), GL_PREFIX(TexSubImage3D)
+ .globl GL_PREFIX(CopyTexSubImage3DEXT) ; .set GL_PREFIX(CopyTexSubImage3DEXT), GL_PREFIX(CopyTexSubImage3D)
+ .globl GL_PREFIX(ActiveTexture) ; .set GL_PREFIX(ActiveTexture), GL_PREFIX(ActiveTextureARB)
+ .globl GL_PREFIX(ClientActiveTexture) ; .set GL_PREFIX(ClientActiveTexture), GL_PREFIX(ClientActiveTextureARB)
+ .globl GL_PREFIX(MultiTexCoord1d) ; .set GL_PREFIX(MultiTexCoord1d), GL_PREFIX(MultiTexCoord1dARB)
+ .globl GL_PREFIX(MultiTexCoord1dv) ; .set GL_PREFIX(MultiTexCoord1dv), GL_PREFIX(MultiTexCoord1dvARB)
+ .globl GL_PREFIX(MultiTexCoord1f) ; .set GL_PREFIX(MultiTexCoord1f), GL_PREFIX(MultiTexCoord1fARB)
+ .globl GL_PREFIX(MultiTexCoord1fv) ; .set GL_PREFIX(MultiTexCoord1fv), GL_PREFIX(MultiTexCoord1fvARB)
+ .globl GL_PREFIX(MultiTexCoord1i) ; .set GL_PREFIX(MultiTexCoord1i), GL_PREFIX(MultiTexCoord1iARB)
+ .globl GL_PREFIX(MultiTexCoord1iv) ; .set GL_PREFIX(MultiTexCoord1iv), GL_PREFIX(MultiTexCoord1ivARB)
+ .globl GL_PREFIX(MultiTexCoord1s) ; .set GL_PREFIX(MultiTexCoord1s), GL_PREFIX(MultiTexCoord1sARB)
+ .globl GL_PREFIX(MultiTexCoord1sv) ; .set GL_PREFIX(MultiTexCoord1sv), GL_PREFIX(MultiTexCoord1svARB)
+ .globl GL_PREFIX(MultiTexCoord2d) ; .set GL_PREFIX(MultiTexCoord2d), GL_PREFIX(MultiTexCoord2dARB)
+ .globl GL_PREFIX(MultiTexCoord2dv) ; .set GL_PREFIX(MultiTexCoord2dv), GL_PREFIX(MultiTexCoord2dvARB)
+ .globl GL_PREFIX(MultiTexCoord2f) ; .set GL_PREFIX(MultiTexCoord2f), GL_PREFIX(MultiTexCoord2fARB)
+ .globl GL_PREFIX(MultiTexCoord2fv) ; .set GL_PREFIX(MultiTexCoord2fv), GL_PREFIX(MultiTexCoord2fvARB)
+ .globl GL_PREFIX(MultiTexCoord2i) ; .set GL_PREFIX(MultiTexCoord2i), GL_PREFIX(MultiTexCoord2iARB)
+ .globl GL_PREFIX(MultiTexCoord2iv) ; .set GL_PREFIX(MultiTexCoord2iv), GL_PREFIX(MultiTexCoord2ivARB)
+ .globl GL_PREFIX(MultiTexCoord2s) ; .set GL_PREFIX(MultiTexCoord2s), GL_PREFIX(MultiTexCoord2sARB)
+ .globl GL_PREFIX(MultiTexCoord2sv) ; .set GL_PREFIX(MultiTexCoord2sv), GL_PREFIX(MultiTexCoord2svARB)
+ .globl GL_PREFIX(MultiTexCoord3d) ; .set GL_PREFIX(MultiTexCoord3d), GL_PREFIX(MultiTexCoord3dARB)
+ .globl GL_PREFIX(MultiTexCoord3dv) ; .set GL_PREFIX(MultiTexCoord3dv), GL_PREFIX(MultiTexCoord3dvARB)
+ .globl GL_PREFIX(MultiTexCoord3f) ; .set GL_PREFIX(MultiTexCoord3f), GL_PREFIX(MultiTexCoord3fARB)
+ .globl GL_PREFIX(MultiTexCoord3fv) ; .set GL_PREFIX(MultiTexCoord3fv), GL_PREFIX(MultiTexCoord3fvARB)
+ .globl GL_PREFIX(MultiTexCoord3i) ; .set GL_PREFIX(MultiTexCoord3i), GL_PREFIX(MultiTexCoord3iARB)
+ .globl GL_PREFIX(MultiTexCoord3iv) ; .set GL_PREFIX(MultiTexCoord3iv), GL_PREFIX(MultiTexCoord3ivARB)
+ .globl GL_PREFIX(MultiTexCoord3s) ; .set GL_PREFIX(MultiTexCoord3s), GL_PREFIX(MultiTexCoord3sARB)
+ .globl GL_PREFIX(MultiTexCoord3sv) ; .set GL_PREFIX(MultiTexCoord3sv), GL_PREFIX(MultiTexCoord3svARB)
+ .globl GL_PREFIX(MultiTexCoord4d) ; .set GL_PREFIX(MultiTexCoord4d), GL_PREFIX(MultiTexCoord4dARB)
+ .globl GL_PREFIX(MultiTexCoord4dv) ; .set GL_PREFIX(MultiTexCoord4dv), GL_PREFIX(MultiTexCoord4dvARB)
+ .globl GL_PREFIX(MultiTexCoord4f) ; .set GL_PREFIX(MultiTexCoord4f), GL_PREFIX(MultiTexCoord4fARB)
+ .globl GL_PREFIX(MultiTexCoord4fv) ; .set GL_PREFIX(MultiTexCoord4fv), GL_PREFIX(MultiTexCoord4fvARB)
+ .globl GL_PREFIX(MultiTexCoord4i) ; .set GL_PREFIX(MultiTexCoord4i), GL_PREFIX(MultiTexCoord4iARB)
+ .globl GL_PREFIX(MultiTexCoord4iv) ; .set GL_PREFIX(MultiTexCoord4iv), GL_PREFIX(MultiTexCoord4ivARB)
+ .globl GL_PREFIX(MultiTexCoord4s) ; .set GL_PREFIX(MultiTexCoord4s), GL_PREFIX(MultiTexCoord4sARB)
+ .globl GL_PREFIX(MultiTexCoord4sv) ; .set GL_PREFIX(MultiTexCoord4sv), GL_PREFIX(MultiTexCoord4svARB)
+ .globl GL_PREFIX(LoadTransposeMatrixd) ; .set GL_PREFIX(LoadTransposeMatrixd), GL_PREFIX(LoadTransposeMatrixdARB)
+ .globl GL_PREFIX(LoadTransposeMatrixf) ; .set GL_PREFIX(LoadTransposeMatrixf), GL_PREFIX(LoadTransposeMatrixfARB)
+ .globl GL_PREFIX(MultTransposeMatrixd) ; .set GL_PREFIX(MultTransposeMatrixd), GL_PREFIX(MultTransposeMatrixdARB)
+ .globl GL_PREFIX(MultTransposeMatrixf) ; .set GL_PREFIX(MultTransposeMatrixf), GL_PREFIX(MultTransposeMatrixfARB)
+ .globl GL_PREFIX(SampleCoverage) ; .set GL_PREFIX(SampleCoverage), GL_PREFIX(SampleCoverageARB)
+ .globl GL_PREFIX(CompressedTexImage1D) ; .set GL_PREFIX(CompressedTexImage1D), GL_PREFIX(CompressedTexImage1DARB)
+ .globl GL_PREFIX(CompressedTexImage2D) ; .set GL_PREFIX(CompressedTexImage2D), GL_PREFIX(CompressedTexImage2DARB)
+ .globl GL_PREFIX(CompressedTexImage3D) ; .set GL_PREFIX(CompressedTexImage3D), GL_PREFIX(CompressedTexImage3DARB)
+ .globl GL_PREFIX(CompressedTexSubImage1D) ; .set GL_PREFIX(CompressedTexSubImage1D), GL_PREFIX(CompressedTexSubImage1DARB)
+ .globl GL_PREFIX(CompressedTexSubImage2D) ; .set GL_PREFIX(CompressedTexSubImage2D), GL_PREFIX(CompressedTexSubImage2DARB)
+ .globl GL_PREFIX(CompressedTexSubImage3D) ; .set GL_PREFIX(CompressedTexSubImage3D), GL_PREFIX(CompressedTexSubImage3DARB)
+ .globl GL_PREFIX(GetCompressedTexImage) ; .set GL_PREFIX(GetCompressedTexImage), GL_PREFIX(GetCompressedTexImageARB)
+ .globl GL_PREFIX(DisableVertexAttribArray) ; .set GL_PREFIX(DisableVertexAttribArray), GL_PREFIX(DisableVertexAttribArrayARB)
+ .globl GL_PREFIX(EnableVertexAttribArray) ; .set GL_PREFIX(EnableVertexAttribArray), GL_PREFIX(EnableVertexAttribArrayARB)
+ .globl GL_PREFIX(GetVertexAttribdv) ; .set GL_PREFIX(GetVertexAttribdv), GL_PREFIX(GetVertexAttribdvARB)
+ .globl GL_PREFIX(GetVertexAttribfv) ; .set GL_PREFIX(GetVertexAttribfv), GL_PREFIX(GetVertexAttribfvARB)
+ .globl GL_PREFIX(GetVertexAttribiv) ; .set GL_PREFIX(GetVertexAttribiv), GL_PREFIX(GetVertexAttribivARB)
+ .globl GL_PREFIX(ProgramParameter4dNV) ; .set GL_PREFIX(ProgramParameter4dNV), GL_PREFIX(ProgramEnvParameter4dARB)
+ .globl GL_PREFIX(ProgramParameter4dvNV) ; .set GL_PREFIX(ProgramParameter4dvNV), GL_PREFIX(ProgramEnvParameter4dvARB)
+ .globl GL_PREFIX(ProgramParameter4fNV) ; .set GL_PREFIX(ProgramParameter4fNV), GL_PREFIX(ProgramEnvParameter4fARB)
+ .globl GL_PREFIX(ProgramParameter4fvNV) ; .set GL_PREFIX(ProgramParameter4fvNV), GL_PREFIX(ProgramEnvParameter4fvARB)
+ .globl GL_PREFIX(VertexAttrib1d) ; .set GL_PREFIX(VertexAttrib1d), GL_PREFIX(VertexAttrib1dARB)
+ .globl GL_PREFIX(VertexAttrib1dv) ; .set GL_PREFIX(VertexAttrib1dv), GL_PREFIX(VertexAttrib1dvARB)
+ .globl GL_PREFIX(VertexAttrib1f) ; .set GL_PREFIX(VertexAttrib1f), GL_PREFIX(VertexAttrib1fARB)
+ .globl GL_PREFIX(VertexAttrib1fv) ; .set GL_PREFIX(VertexAttrib1fv), GL_PREFIX(VertexAttrib1fvARB)
+ .globl GL_PREFIX(VertexAttrib1s) ; .set GL_PREFIX(VertexAttrib1s), GL_PREFIX(VertexAttrib1sARB)
+ .globl GL_PREFIX(VertexAttrib1sv) ; .set GL_PREFIX(VertexAttrib1sv), GL_PREFIX(VertexAttrib1svARB)
+ .globl GL_PREFIX(VertexAttrib2d) ; .set GL_PREFIX(VertexAttrib2d), GL_PREFIX(VertexAttrib2dARB)
+ .globl GL_PREFIX(VertexAttrib2dv) ; .set GL_PREFIX(VertexAttrib2dv), GL_PREFIX(VertexAttrib2dvARB)
+ .globl GL_PREFIX(VertexAttrib2f) ; .set GL_PREFIX(VertexAttrib2f), GL_PREFIX(VertexAttrib2fARB)
+ .globl GL_PREFIX(VertexAttrib2fv) ; .set GL_PREFIX(VertexAttrib2fv), GL_PREFIX(VertexAttrib2fvARB)
+ .globl GL_PREFIX(VertexAttrib2s) ; .set GL_PREFIX(VertexAttrib2s), GL_PREFIX(VertexAttrib2sARB)
+ .globl GL_PREFIX(VertexAttrib2sv) ; .set GL_PREFIX(VertexAttrib2sv), GL_PREFIX(VertexAttrib2svARB)
+ .globl GL_PREFIX(VertexAttrib3d) ; .set GL_PREFIX(VertexAttrib3d), GL_PREFIX(VertexAttrib3dARB)
+ .globl GL_PREFIX(VertexAttrib3dv) ; .set GL_PREFIX(VertexAttrib3dv), GL_PREFIX(VertexAttrib3dvARB)
+ .globl GL_PREFIX(VertexAttrib3f) ; .set GL_PREFIX(VertexAttrib3f), GL_PREFIX(VertexAttrib3fARB)
+ .globl GL_PREFIX(VertexAttrib3fv) ; .set GL_PREFIX(VertexAttrib3fv), GL_PREFIX(VertexAttrib3fvARB)
+ .globl GL_PREFIX(VertexAttrib3s) ; .set GL_PREFIX(VertexAttrib3s), GL_PREFIX(VertexAttrib3sARB)
+ .globl GL_PREFIX(VertexAttrib3sv) ; .set GL_PREFIX(VertexAttrib3sv), GL_PREFIX(VertexAttrib3svARB)
+ .globl GL_PREFIX(VertexAttrib4Nbv) ; .set GL_PREFIX(VertexAttrib4Nbv), GL_PREFIX(VertexAttrib4NbvARB)
+ .globl GL_PREFIX(VertexAttrib4Niv) ; .set GL_PREFIX(VertexAttrib4Niv), GL_PREFIX(VertexAttrib4NivARB)
+ .globl GL_PREFIX(VertexAttrib4Nsv) ; .set GL_PREFIX(VertexAttrib4Nsv), GL_PREFIX(VertexAttrib4NsvARB)
+ .globl GL_PREFIX(VertexAttrib4Nub) ; .set GL_PREFIX(VertexAttrib4Nub), GL_PREFIX(VertexAttrib4NubARB)
+ .globl GL_PREFIX(VertexAttrib4Nubv) ; .set GL_PREFIX(VertexAttrib4Nubv), GL_PREFIX(VertexAttrib4NubvARB)
+ .globl GL_PREFIX(VertexAttrib4Nuiv) ; .set GL_PREFIX(VertexAttrib4Nuiv), GL_PREFIX(VertexAttrib4NuivARB)
+ .globl GL_PREFIX(VertexAttrib4Nusv) ; .set GL_PREFIX(VertexAttrib4Nusv), GL_PREFIX(VertexAttrib4NusvARB)
+ .globl GL_PREFIX(VertexAttrib4bv) ; .set GL_PREFIX(VertexAttrib4bv), GL_PREFIX(VertexAttrib4bvARB)
+ .globl GL_PREFIX(VertexAttrib4d) ; .set GL_PREFIX(VertexAttrib4d), GL_PREFIX(VertexAttrib4dARB)
+ .globl GL_PREFIX(VertexAttrib4dv) ; .set GL_PREFIX(VertexAttrib4dv), GL_PREFIX(VertexAttrib4dvARB)
+ .globl GL_PREFIX(VertexAttrib4f) ; .set GL_PREFIX(VertexAttrib4f), GL_PREFIX(VertexAttrib4fARB)
+ .globl GL_PREFIX(VertexAttrib4fv) ; .set GL_PREFIX(VertexAttrib4fv), GL_PREFIX(VertexAttrib4fvARB)
+ .globl GL_PREFIX(VertexAttrib4iv) ; .set GL_PREFIX(VertexAttrib4iv), GL_PREFIX(VertexAttrib4ivARB)
+ .globl GL_PREFIX(VertexAttrib4s) ; .set GL_PREFIX(VertexAttrib4s), GL_PREFIX(VertexAttrib4sARB)
+ .globl GL_PREFIX(VertexAttrib4sv) ; .set GL_PREFIX(VertexAttrib4sv), GL_PREFIX(VertexAttrib4svARB)
+ .globl GL_PREFIX(VertexAttrib4ubv) ; .set GL_PREFIX(VertexAttrib4ubv), GL_PREFIX(VertexAttrib4ubvARB)
+ .globl GL_PREFIX(VertexAttrib4uiv) ; .set GL_PREFIX(VertexAttrib4uiv), GL_PREFIX(VertexAttrib4uivARB)
+ .globl GL_PREFIX(VertexAttrib4usv) ; .set GL_PREFIX(VertexAttrib4usv), GL_PREFIX(VertexAttrib4usvARB)
+ .globl GL_PREFIX(VertexAttribPointer) ; .set GL_PREFIX(VertexAttribPointer), GL_PREFIX(VertexAttribPointerARB)
+ .globl GL_PREFIX(BindBuffer) ; .set GL_PREFIX(BindBuffer), GL_PREFIX(BindBufferARB)
+ .globl GL_PREFIX(BufferData) ; .set GL_PREFIX(BufferData), GL_PREFIX(BufferDataARB)
+ .globl GL_PREFIX(BufferSubData) ; .set GL_PREFIX(BufferSubData), GL_PREFIX(BufferSubDataARB)
+ .globl GL_PREFIX(DeleteBuffers) ; .set GL_PREFIX(DeleteBuffers), GL_PREFIX(DeleteBuffersARB)
+ .globl GL_PREFIX(GenBuffers) ; .set GL_PREFIX(GenBuffers), GL_PREFIX(GenBuffersARB)
+ .globl GL_PREFIX(GetBufferParameteriv) ; .set GL_PREFIX(GetBufferParameteriv), GL_PREFIX(GetBufferParameterivARB)
+ .globl GL_PREFIX(GetBufferPointerv) ; .set GL_PREFIX(GetBufferPointerv), GL_PREFIX(GetBufferPointervARB)
+ .globl GL_PREFIX(GetBufferSubData) ; .set GL_PREFIX(GetBufferSubData), GL_PREFIX(GetBufferSubDataARB)
+ .globl GL_PREFIX(IsBuffer) ; .set GL_PREFIX(IsBuffer), GL_PREFIX(IsBufferARB)
+ .globl GL_PREFIX(MapBuffer) ; .set GL_PREFIX(MapBuffer), GL_PREFIX(MapBufferARB)
+ .globl GL_PREFIX(UnmapBuffer) ; .set GL_PREFIX(UnmapBuffer), GL_PREFIX(UnmapBufferARB)
+ .globl GL_PREFIX(BeginQuery) ; .set GL_PREFIX(BeginQuery), GL_PREFIX(BeginQueryARB)
+ .globl GL_PREFIX(DeleteQueries) ; .set GL_PREFIX(DeleteQueries), GL_PREFIX(DeleteQueriesARB)
+ .globl GL_PREFIX(EndQuery) ; .set GL_PREFIX(EndQuery), GL_PREFIX(EndQueryARB)
+ .globl GL_PREFIX(GenQueries) ; .set GL_PREFIX(GenQueries), GL_PREFIX(GenQueriesARB)
+ .globl GL_PREFIX(GetQueryObjectiv) ; .set GL_PREFIX(GetQueryObjectiv), GL_PREFIX(GetQueryObjectivARB)
+ .globl GL_PREFIX(GetQueryObjectuiv) ; .set GL_PREFIX(GetQueryObjectuiv), GL_PREFIX(GetQueryObjectuivARB)
+ .globl GL_PREFIX(GetQueryiv) ; .set GL_PREFIX(GetQueryiv), GL_PREFIX(GetQueryivARB)
+ .globl GL_PREFIX(IsQuery) ; .set GL_PREFIX(IsQuery), GL_PREFIX(IsQueryARB)
+ .globl GL_PREFIX(CompileShader) ; .set GL_PREFIX(CompileShader), GL_PREFIX(CompileShaderARB)
+ .globl GL_PREFIX(GetActiveUniform) ; .set GL_PREFIX(GetActiveUniform), GL_PREFIX(GetActiveUniformARB)
+ .globl GL_PREFIX(GetShaderSource) ; .set GL_PREFIX(GetShaderSource), GL_PREFIX(GetShaderSourceARB)
+ .globl GL_PREFIX(GetUniformLocation) ; .set GL_PREFIX(GetUniformLocation), GL_PREFIX(GetUniformLocationARB)
+ .globl GL_PREFIX(GetUniformfv) ; .set GL_PREFIX(GetUniformfv), GL_PREFIX(GetUniformfvARB)
+ .globl GL_PREFIX(GetUniformiv) ; .set GL_PREFIX(GetUniformiv), GL_PREFIX(GetUniformivARB)
+ .globl GL_PREFIX(LinkProgram) ; .set GL_PREFIX(LinkProgram), GL_PREFIX(LinkProgramARB)
+ .globl GL_PREFIX(ShaderSource) ; .set GL_PREFIX(ShaderSource), GL_PREFIX(ShaderSourceARB)
+ .globl GL_PREFIX(Uniform1f) ; .set GL_PREFIX(Uniform1f), GL_PREFIX(Uniform1fARB)
+ .globl GL_PREFIX(Uniform1fv) ; .set GL_PREFIX(Uniform1fv), GL_PREFIX(Uniform1fvARB)
+ .globl GL_PREFIX(Uniform1i) ; .set GL_PREFIX(Uniform1i), GL_PREFIX(Uniform1iARB)
+ .globl GL_PREFIX(Uniform1iv) ; .set GL_PREFIX(Uniform1iv), GL_PREFIX(Uniform1ivARB)
+ .globl GL_PREFIX(Uniform2f) ; .set GL_PREFIX(Uniform2f), GL_PREFIX(Uniform2fARB)
+ .globl GL_PREFIX(Uniform2fv) ; .set GL_PREFIX(Uniform2fv), GL_PREFIX(Uniform2fvARB)
+ .globl GL_PREFIX(Uniform2i) ; .set GL_PREFIX(Uniform2i), GL_PREFIX(Uniform2iARB)
+ .globl GL_PREFIX(Uniform2iv) ; .set GL_PREFIX(Uniform2iv), GL_PREFIX(Uniform2ivARB)
+ .globl GL_PREFIX(Uniform3f) ; .set GL_PREFIX(Uniform3f), GL_PREFIX(Uniform3fARB)
+ .globl GL_PREFIX(Uniform3fv) ; .set GL_PREFIX(Uniform3fv), GL_PREFIX(Uniform3fvARB)
+ .globl GL_PREFIX(Uniform3i) ; .set GL_PREFIX(Uniform3i), GL_PREFIX(Uniform3iARB)
+ .globl GL_PREFIX(Uniform3iv) ; .set GL_PREFIX(Uniform3iv), GL_PREFIX(Uniform3ivARB)
+ .globl GL_PREFIX(Uniform4f) ; .set GL_PREFIX(Uniform4f), GL_PREFIX(Uniform4fARB)
+ .globl GL_PREFIX(Uniform4fv) ; .set GL_PREFIX(Uniform4fv), GL_PREFIX(Uniform4fvARB)
+ .globl GL_PREFIX(Uniform4i) ; .set GL_PREFIX(Uniform4i), GL_PREFIX(Uniform4iARB)
+ .globl GL_PREFIX(Uniform4iv) ; .set GL_PREFIX(Uniform4iv), GL_PREFIX(Uniform4ivARB)
+ .globl GL_PREFIX(UniformMatrix2fv) ; .set GL_PREFIX(UniformMatrix2fv), GL_PREFIX(UniformMatrix2fvARB)
+ .globl GL_PREFIX(UniformMatrix3fv) ; .set GL_PREFIX(UniformMatrix3fv), GL_PREFIX(UniformMatrix3fvARB)
+ .globl GL_PREFIX(UniformMatrix4fv) ; .set GL_PREFIX(UniformMatrix4fv), GL_PREFIX(UniformMatrix4fvARB)
+ .globl GL_PREFIX(UseProgram) ; .set GL_PREFIX(UseProgram), GL_PREFIX(UseProgramObjectARB)
+ .globl GL_PREFIX(ValidateProgram) ; .set GL_PREFIX(ValidateProgram), GL_PREFIX(ValidateProgramARB)
+ .globl GL_PREFIX(BindAttribLocation) ; .set GL_PREFIX(BindAttribLocation), GL_PREFIX(BindAttribLocationARB)
+ .globl GL_PREFIX(GetActiveAttrib) ; .set GL_PREFIX(GetActiveAttrib), GL_PREFIX(GetActiveAttribARB)
+ .globl GL_PREFIX(GetAttribLocation) ; .set GL_PREFIX(GetAttribLocation), GL_PREFIX(GetAttribLocationARB)
+ .globl GL_PREFIX(DrawBuffers) ; .set GL_PREFIX(DrawBuffers), GL_PREFIX(DrawBuffersARB)
+ .globl GL_PREFIX(DrawBuffersATI) ; .set GL_PREFIX(DrawBuffersATI), GL_PREFIX(DrawBuffersARB)
+ .globl GL_PREFIX(DrawArraysInstancedEXT) ; .set GL_PREFIX(DrawArraysInstancedEXT), GL_PREFIX(DrawArraysInstancedARB)
+ .globl GL_PREFIX(DrawArraysInstanced) ; .set GL_PREFIX(DrawArraysInstanced), GL_PREFIX(DrawArraysInstancedARB)
+ .globl GL_PREFIX(DrawElementsInstancedEXT) ; .set GL_PREFIX(DrawElementsInstancedEXT), GL_PREFIX(DrawElementsInstancedARB)
+ .globl GL_PREFIX(DrawElementsInstanced) ; .set GL_PREFIX(DrawElementsInstanced), GL_PREFIX(DrawElementsInstancedARB)
+ .globl GL_PREFIX(RenderbufferStorageMultisampleEXT) ; .set GL_PREFIX(RenderbufferStorageMultisampleEXT), GL_PREFIX(RenderbufferStorageMultisample)
+ .globl GL_PREFIX(BlendEquationSeparateIndexedAMD) ; .set GL_PREFIX(BlendEquationSeparateIndexedAMD), GL_PREFIX(BlendEquationSeparateiARB)
+ .globl GL_PREFIX(BlendEquationIndexedAMD) ; .set GL_PREFIX(BlendEquationIndexedAMD), GL_PREFIX(BlendEquationiARB)
+ .globl GL_PREFIX(BlendFuncSeparateIndexedAMD) ; .set GL_PREFIX(BlendFuncSeparateIndexedAMD), GL_PREFIX(BlendFuncSeparateiARB)
+ .globl GL_PREFIX(BlendFuncIndexedAMD) ; .set GL_PREFIX(BlendFuncIndexedAMD), GL_PREFIX(BlendFunciARB)
+ .globl GL_PREFIX(PointParameterf) ; .set GL_PREFIX(PointParameterf), GL_PREFIX(PointParameterfEXT)
+ .globl GL_PREFIX(PointParameterfARB) ; .set GL_PREFIX(PointParameterfARB), GL_PREFIX(PointParameterfEXT)
+ .globl GL_PREFIX(PointParameterfv) ; .set GL_PREFIX(PointParameterfv), GL_PREFIX(PointParameterfvEXT)
+ .globl GL_PREFIX(PointParameterfvARB) ; .set GL_PREFIX(PointParameterfvARB), GL_PREFIX(PointParameterfvEXT)
+ .globl GL_PREFIX(SecondaryColor3b) ; .set GL_PREFIX(SecondaryColor3b), GL_PREFIX(SecondaryColor3bEXT)
+ .globl GL_PREFIX(SecondaryColor3bv) ; .set GL_PREFIX(SecondaryColor3bv), GL_PREFIX(SecondaryColor3bvEXT)
+ .globl GL_PREFIX(SecondaryColor3d) ; .set GL_PREFIX(SecondaryColor3d), GL_PREFIX(SecondaryColor3dEXT)
+ .globl GL_PREFIX(SecondaryColor3dv) ; .set GL_PREFIX(SecondaryColor3dv), GL_PREFIX(SecondaryColor3dvEXT)
+ .globl GL_PREFIX(SecondaryColor3f) ; .set GL_PREFIX(SecondaryColor3f), GL_PREFIX(SecondaryColor3fEXT)
+ .globl GL_PREFIX(SecondaryColor3fv) ; .set GL_PREFIX(SecondaryColor3fv), GL_PREFIX(SecondaryColor3fvEXT)
+ .globl GL_PREFIX(SecondaryColor3i) ; .set GL_PREFIX(SecondaryColor3i), GL_PREFIX(SecondaryColor3iEXT)
+ .globl GL_PREFIX(SecondaryColor3iv) ; .set GL_PREFIX(SecondaryColor3iv), GL_PREFIX(SecondaryColor3ivEXT)
+ .globl GL_PREFIX(SecondaryColor3s) ; .set GL_PREFIX(SecondaryColor3s), GL_PREFIX(SecondaryColor3sEXT)
+ .globl GL_PREFIX(SecondaryColor3sv) ; .set GL_PREFIX(SecondaryColor3sv), GL_PREFIX(SecondaryColor3svEXT)
+ .globl GL_PREFIX(SecondaryColor3ub) ; .set GL_PREFIX(SecondaryColor3ub), GL_PREFIX(SecondaryColor3ubEXT)
+ .globl GL_PREFIX(SecondaryColor3ubv) ; .set GL_PREFIX(SecondaryColor3ubv), GL_PREFIX(SecondaryColor3ubvEXT)
+ .globl GL_PREFIX(SecondaryColor3ui) ; .set GL_PREFIX(SecondaryColor3ui), GL_PREFIX(SecondaryColor3uiEXT)
+ .globl GL_PREFIX(SecondaryColor3uiv) ; .set GL_PREFIX(SecondaryColor3uiv), GL_PREFIX(SecondaryColor3uivEXT)
+ .globl GL_PREFIX(SecondaryColor3us) ; .set GL_PREFIX(SecondaryColor3us), GL_PREFIX(SecondaryColor3usEXT)
+ .globl GL_PREFIX(SecondaryColor3usv) ; .set GL_PREFIX(SecondaryColor3usv), GL_PREFIX(SecondaryColor3usvEXT)
+ .globl GL_PREFIX(SecondaryColorPointer) ; .set GL_PREFIX(SecondaryColorPointer), GL_PREFIX(SecondaryColorPointerEXT)
+ .globl GL_PREFIX(MultiDrawArrays) ; .set GL_PREFIX(MultiDrawArrays), GL_PREFIX(MultiDrawArraysEXT)
+ .globl GL_PREFIX(MultiDrawElements) ; .set GL_PREFIX(MultiDrawElements), GL_PREFIX(MultiDrawElementsEXT)
+ .globl GL_PREFIX(FogCoordPointer) ; .set GL_PREFIX(FogCoordPointer), GL_PREFIX(FogCoordPointerEXT)
+ .globl GL_PREFIX(FogCoordd) ; .set GL_PREFIX(FogCoordd), GL_PREFIX(FogCoorddEXT)
+ .globl GL_PREFIX(FogCoorddv) ; .set GL_PREFIX(FogCoorddv), GL_PREFIX(FogCoorddvEXT)
+ .globl GL_PREFIX(FogCoordf) ; .set GL_PREFIX(FogCoordf), GL_PREFIX(FogCoordfEXT)
+ .globl GL_PREFIX(FogCoordfv) ; .set GL_PREFIX(FogCoordfv), GL_PREFIX(FogCoordfvEXT)
+ .globl GL_PREFIX(BlendFuncSeparate) ; .set GL_PREFIX(BlendFuncSeparate), GL_PREFIX(BlendFuncSeparateEXT)
+ .globl GL_PREFIX(WindowPos2d) ; .set GL_PREFIX(WindowPos2d), GL_PREFIX(WindowPos2dMESA)
+ .globl GL_PREFIX(WindowPos2dARB) ; .set GL_PREFIX(WindowPos2dARB), GL_PREFIX(WindowPos2dMESA)
+ .globl GL_PREFIX(WindowPos2dv) ; .set GL_PREFIX(WindowPos2dv), GL_PREFIX(WindowPos2dvMESA)
+ .globl GL_PREFIX(WindowPos2dvARB) ; .set GL_PREFIX(WindowPos2dvARB), GL_PREFIX(WindowPos2dvMESA)
+ .globl GL_PREFIX(WindowPos2f) ; .set GL_PREFIX(WindowPos2f), GL_PREFIX(WindowPos2fMESA)
+ .globl GL_PREFIX(WindowPos2fARB) ; .set GL_PREFIX(WindowPos2fARB), GL_PREFIX(WindowPos2fMESA)
+ .globl GL_PREFIX(WindowPos2fv) ; .set GL_PREFIX(WindowPos2fv), GL_PREFIX(WindowPos2fvMESA)
+ .globl GL_PREFIX(WindowPos2fvARB) ; .set GL_PREFIX(WindowPos2fvARB), GL_PREFIX(WindowPos2fvMESA)
+ .globl GL_PREFIX(WindowPos2i) ; .set GL_PREFIX(WindowPos2i), GL_PREFIX(WindowPos2iMESA)
+ .globl GL_PREFIX(WindowPos2iARB) ; .set GL_PREFIX(WindowPos2iARB), GL_PREFIX(WindowPos2iMESA)
+ .globl GL_PREFIX(WindowPos2iv) ; .set GL_PREFIX(WindowPos2iv), GL_PREFIX(WindowPos2ivMESA)
+ .globl GL_PREFIX(WindowPos2ivARB) ; .set GL_PREFIX(WindowPos2ivARB), GL_PREFIX(WindowPos2ivMESA)
+ .globl GL_PREFIX(WindowPos2s) ; .set GL_PREFIX(WindowPos2s), GL_PREFIX(WindowPos2sMESA)
+ .globl GL_PREFIX(WindowPos2sARB) ; .set GL_PREFIX(WindowPos2sARB), GL_PREFIX(WindowPos2sMESA)
+ .globl GL_PREFIX(WindowPos2sv) ; .set GL_PREFIX(WindowPos2sv), GL_PREFIX(WindowPos2svMESA)
+ .globl GL_PREFIX(WindowPos2svARB) ; .set GL_PREFIX(WindowPos2svARB), GL_PREFIX(WindowPos2svMESA)
+ .globl GL_PREFIX(WindowPos3d) ; .set GL_PREFIX(WindowPos3d), GL_PREFIX(WindowPos3dMESA)
+ .globl GL_PREFIX(WindowPos3dARB) ; .set GL_PREFIX(WindowPos3dARB), GL_PREFIX(WindowPos3dMESA)
+ .globl GL_PREFIX(WindowPos3dv) ; .set GL_PREFIX(WindowPos3dv), GL_PREFIX(WindowPos3dvMESA)
+ .globl GL_PREFIX(WindowPos3dvARB) ; .set GL_PREFIX(WindowPos3dvARB), GL_PREFIX(WindowPos3dvMESA)
+ .globl GL_PREFIX(WindowPos3f) ; .set GL_PREFIX(WindowPos3f), GL_PREFIX(WindowPos3fMESA)
+ .globl GL_PREFIX(WindowPos3fARB) ; .set GL_PREFIX(WindowPos3fARB), GL_PREFIX(WindowPos3fMESA)
+ .globl GL_PREFIX(WindowPos3fv) ; .set GL_PREFIX(WindowPos3fv), GL_PREFIX(WindowPos3fvMESA)
+ .globl GL_PREFIX(WindowPos3fvARB) ; .set GL_PREFIX(WindowPos3fvARB), GL_PREFIX(WindowPos3fvMESA)
+ .globl GL_PREFIX(WindowPos3i) ; .set GL_PREFIX(WindowPos3i), GL_PREFIX(WindowPos3iMESA)
+ .globl GL_PREFIX(WindowPos3iARB) ; .set GL_PREFIX(WindowPos3iARB), GL_PREFIX(WindowPos3iMESA)
+ .globl GL_PREFIX(WindowPos3iv) ; .set GL_PREFIX(WindowPos3iv), GL_PREFIX(WindowPos3ivMESA)
+ .globl GL_PREFIX(WindowPos3ivARB) ; .set GL_PREFIX(WindowPos3ivARB), GL_PREFIX(WindowPos3ivMESA)
+ .globl GL_PREFIX(WindowPos3s) ; .set GL_PREFIX(WindowPos3s), GL_PREFIX(WindowPos3sMESA)
+ .globl GL_PREFIX(WindowPos3sARB) ; .set GL_PREFIX(WindowPos3sARB), GL_PREFIX(WindowPos3sMESA)
+ .globl GL_PREFIX(WindowPos3sv) ; .set GL_PREFIX(WindowPos3sv), GL_PREFIX(WindowPos3svMESA)
+ .globl GL_PREFIX(WindowPos3svARB) ; .set GL_PREFIX(WindowPos3svARB), GL_PREFIX(WindowPos3svMESA)
+ .globl GL_PREFIX(BindProgramARB) ; .set GL_PREFIX(BindProgramARB), GL_PREFIX(BindProgramNV)
+ .globl GL_PREFIX(DeleteProgramsARB) ; .set GL_PREFIX(DeleteProgramsARB), GL_PREFIX(DeleteProgramsNV)
+ .globl GL_PREFIX(GenProgramsARB) ; .set GL_PREFIX(GenProgramsARB), GL_PREFIX(GenProgramsNV)
+ .globl GL_PREFIX(GetVertexAttribPointerv) ; .set GL_PREFIX(GetVertexAttribPointerv), GL_PREFIX(GetVertexAttribPointervNV)
+ .globl GL_PREFIX(GetVertexAttribPointervARB) ; .set GL_PREFIX(GetVertexAttribPointervARB), GL_PREFIX(GetVertexAttribPointervNV)
+ .globl GL_PREFIX(IsProgramARB) ; .set GL_PREFIX(IsProgramARB), GL_PREFIX(IsProgramNV)
+ .globl GL_PREFIX(PointParameteri) ; .set GL_PREFIX(PointParameteri), GL_PREFIX(PointParameteriNV)
+ .globl GL_PREFIX(PointParameteriv) ; .set GL_PREFIX(PointParameteriv), GL_PREFIX(PointParameterivNV)
+ .globl GL_PREFIX(DeleteVertexArrays) ; .set GL_PREFIX(DeleteVertexArrays), GL_PREFIX(_dispatch_stub_822)
+ .globl GL_PREFIX(IsVertexArray) ; .set GL_PREFIX(IsVertexArray), GL_PREFIX(_dispatch_stub_824)
+ .globl GL_PREFIX(PrimitiveRestartIndex) ; .set GL_PREFIX(PrimitiveRestartIndex), GL_PREFIX(PrimitiveRestartIndexNV)
+ .globl GL_PREFIX(BlendEquationSeparate) ; .set GL_PREFIX(BlendEquationSeparate), GL_PREFIX(_dispatch_stub_834)
+ .globl GL_PREFIX(BindFramebuffer) ; .set GL_PREFIX(BindFramebuffer), GL_PREFIX(BindFramebufferEXT)
+ .globl GL_PREFIX(BindRenderbuffer) ; .set GL_PREFIX(BindRenderbuffer), GL_PREFIX(BindRenderbufferEXT)
+ .globl GL_PREFIX(CheckFramebufferStatus) ; .set GL_PREFIX(CheckFramebufferStatus), GL_PREFIX(CheckFramebufferStatusEXT)
+ .globl GL_PREFIX(DeleteFramebuffers) ; .set GL_PREFIX(DeleteFramebuffers), GL_PREFIX(DeleteFramebuffersEXT)
+ .globl GL_PREFIX(DeleteRenderbuffers) ; .set GL_PREFIX(DeleteRenderbuffers), GL_PREFIX(DeleteRenderbuffersEXT)
+ .globl GL_PREFIX(FramebufferRenderbuffer) ; .set GL_PREFIX(FramebufferRenderbuffer), GL_PREFIX(FramebufferRenderbufferEXT)
+ .globl GL_PREFIX(FramebufferTexture1D) ; .set GL_PREFIX(FramebufferTexture1D), GL_PREFIX(FramebufferTexture1DEXT)
+ .globl GL_PREFIX(FramebufferTexture2D) ; .set GL_PREFIX(FramebufferTexture2D), GL_PREFIX(FramebufferTexture2DEXT)
+ .globl GL_PREFIX(FramebufferTexture3D) ; .set GL_PREFIX(FramebufferTexture3D), GL_PREFIX(FramebufferTexture3DEXT)
+ .globl GL_PREFIX(GenFramebuffers) ; .set GL_PREFIX(GenFramebuffers), GL_PREFIX(GenFramebuffersEXT)
+ .globl GL_PREFIX(GenRenderbuffers) ; .set GL_PREFIX(GenRenderbuffers), GL_PREFIX(GenRenderbuffersEXT)
+ .globl GL_PREFIX(GenerateMipmap) ; .set GL_PREFIX(GenerateMipmap), GL_PREFIX(GenerateMipmapEXT)
+ .globl GL_PREFIX(GetFramebufferAttachmentParameteriv) ; .set GL_PREFIX(GetFramebufferAttachmentParameteriv), GL_PREFIX(GetFramebufferAttachmentParameterivEXT)
+ .globl GL_PREFIX(GetRenderbufferParameteriv) ; .set GL_PREFIX(GetRenderbufferParameteriv), GL_PREFIX(GetRenderbufferParameterivEXT)
+ .globl GL_PREFIX(IsFramebuffer) ; .set GL_PREFIX(IsFramebuffer), GL_PREFIX(IsFramebufferEXT)
+ .globl GL_PREFIX(IsRenderbuffer) ; .set GL_PREFIX(IsRenderbuffer), GL_PREFIX(IsRenderbufferEXT)
+ .globl GL_PREFIX(RenderbufferStorage) ; .set GL_PREFIX(RenderbufferStorage), GL_PREFIX(RenderbufferStorageEXT)
+ .globl GL_PREFIX(BlitFramebuffer) ; .set GL_PREFIX(BlitFramebuffer), GL_PREFIX(_dispatch_stub_852)
+ .globl GL_PREFIX(BindFragDataLocation) ; .set GL_PREFIX(BindFragDataLocation), GL_PREFIX(BindFragDataLocationEXT)
+ .globl GL_PREFIX(GetFragDataLocation) ; .set GL_PREFIX(GetFragDataLocation), GL_PREFIX(GetFragDataLocationEXT)
+ .globl GL_PREFIX(GetUniformuiv) ; .set GL_PREFIX(GetUniformuiv), GL_PREFIX(GetUniformuivEXT)
+ .globl GL_PREFIX(GetVertexAttribIiv) ; .set GL_PREFIX(GetVertexAttribIiv), GL_PREFIX(GetVertexAttribIivEXT)
+ .globl GL_PREFIX(GetVertexAttribIuiv) ; .set GL_PREFIX(GetVertexAttribIuiv), GL_PREFIX(GetVertexAttribIuivEXT)
+ .globl GL_PREFIX(Uniform1ui) ; .set GL_PREFIX(Uniform1ui), GL_PREFIX(Uniform1uiEXT)
+ .globl GL_PREFIX(Uniform1uiv) ; .set GL_PREFIX(Uniform1uiv), GL_PREFIX(Uniform1uivEXT)
+ .globl GL_PREFIX(Uniform2ui) ; .set GL_PREFIX(Uniform2ui), GL_PREFIX(Uniform2uiEXT)
+ .globl GL_PREFIX(Uniform2uiv) ; .set GL_PREFIX(Uniform2uiv), GL_PREFIX(Uniform2uivEXT)
+ .globl GL_PREFIX(Uniform3ui) ; .set GL_PREFIX(Uniform3ui), GL_PREFIX(Uniform3uiEXT)
+ .globl GL_PREFIX(Uniform3uiv) ; .set GL_PREFIX(Uniform3uiv), GL_PREFIX(Uniform3uivEXT)
+ .globl GL_PREFIX(Uniform4ui) ; .set GL_PREFIX(Uniform4ui), GL_PREFIX(Uniform4uiEXT)
+ .globl GL_PREFIX(Uniform4uiv) ; .set GL_PREFIX(Uniform4uiv), GL_PREFIX(Uniform4uivEXT)
+ .globl GL_PREFIX(VertexAttribI1i) ; .set GL_PREFIX(VertexAttribI1i), GL_PREFIX(VertexAttribI1iEXT)
+ .globl GL_PREFIX(VertexAttribI1iv) ; .set GL_PREFIX(VertexAttribI1iv), GL_PREFIX(VertexAttribI1ivEXT)
+ .globl GL_PREFIX(VertexAttribI1ui) ; .set GL_PREFIX(VertexAttribI1ui), GL_PREFIX(VertexAttribI1uiEXT)
+ .globl GL_PREFIX(VertexAttribI1uiv) ; .set GL_PREFIX(VertexAttribI1uiv), GL_PREFIX(VertexAttribI1uivEXT)
+ .globl GL_PREFIX(VertexAttribI2i) ; .set GL_PREFIX(VertexAttribI2i), GL_PREFIX(VertexAttribI2iEXT)
+ .globl GL_PREFIX(VertexAttribI2iv) ; .set GL_PREFIX(VertexAttribI2iv), GL_PREFIX(VertexAttribI2ivEXT)
+ .globl GL_PREFIX(VertexAttribI2ui) ; .set GL_PREFIX(VertexAttribI2ui), GL_PREFIX(VertexAttribI2uiEXT)
+ .globl GL_PREFIX(VertexAttribI2uiv) ; .set GL_PREFIX(VertexAttribI2uiv), GL_PREFIX(VertexAttribI2uivEXT)
+ .globl GL_PREFIX(VertexAttribI3i) ; .set GL_PREFIX(VertexAttribI3i), GL_PREFIX(VertexAttribI3iEXT)
+ .globl GL_PREFIX(VertexAttribI3iv) ; .set GL_PREFIX(VertexAttribI3iv), GL_PREFIX(VertexAttribI3ivEXT)
+ .globl GL_PREFIX(VertexAttribI3ui) ; .set GL_PREFIX(VertexAttribI3ui), GL_PREFIX(VertexAttribI3uiEXT)
+ .globl GL_PREFIX(VertexAttribI3uiv) ; .set GL_PREFIX(VertexAttribI3uiv), GL_PREFIX(VertexAttribI3uivEXT)
+ .globl GL_PREFIX(VertexAttribI4bv) ; .set GL_PREFIX(VertexAttribI4bv), GL_PREFIX(VertexAttribI4bvEXT)
+ .globl GL_PREFIX(VertexAttribI4i) ; .set GL_PREFIX(VertexAttribI4i), GL_PREFIX(VertexAttribI4iEXT)
+ .globl GL_PREFIX(VertexAttribI4iv) ; .set GL_PREFIX(VertexAttribI4iv), GL_PREFIX(VertexAttribI4ivEXT)
+ .globl GL_PREFIX(VertexAttribI4sv) ; .set GL_PREFIX(VertexAttribI4sv), GL_PREFIX(VertexAttribI4svEXT)
+ .globl GL_PREFIX(VertexAttribI4ubv) ; .set GL_PREFIX(VertexAttribI4ubv), GL_PREFIX(VertexAttribI4ubvEXT)
+ .globl GL_PREFIX(VertexAttribI4ui) ; .set GL_PREFIX(VertexAttribI4ui), GL_PREFIX(VertexAttribI4uiEXT)
+ .globl GL_PREFIX(VertexAttribI4uiv) ; .set GL_PREFIX(VertexAttribI4uiv), GL_PREFIX(VertexAttribI4uivEXT)
+ .globl GL_PREFIX(VertexAttribI4usv) ; .set GL_PREFIX(VertexAttribI4usv), GL_PREFIX(VertexAttribI4usvEXT)
+ .globl GL_PREFIX(VertexAttribIPointer) ; .set GL_PREFIX(VertexAttribIPointer), GL_PREFIX(VertexAttribIPointerEXT)
+ .globl GL_PREFIX(FramebufferTextureLayer) ; .set GL_PREFIX(FramebufferTextureLayer), GL_PREFIX(FramebufferTextureLayerEXT)
+ .globl GL_PREFIX(ColorMaski) ; .set GL_PREFIX(ColorMaski), GL_PREFIX(ColorMaskIndexedEXT)
+ .globl GL_PREFIX(Disablei) ; .set GL_PREFIX(Disablei), GL_PREFIX(DisableIndexedEXT)
+ .globl GL_PREFIX(Enablei) ; .set GL_PREFIX(Enablei), GL_PREFIX(EnableIndexedEXT)
+ .globl GL_PREFIX(GetBooleani_v) ; .set GL_PREFIX(GetBooleani_v), GL_PREFIX(GetBooleanIndexedvEXT)
+ .globl GL_PREFIX(GetIntegeri_v) ; .set GL_PREFIX(GetIntegeri_v), GL_PREFIX(GetIntegerIndexedvEXT)
+ .globl GL_PREFIX(IsEnabledi) ; .set GL_PREFIX(IsEnabledi), GL_PREFIX(IsEnabledIndexedEXT)
+ .globl GL_PREFIX(GetTexParameterIiv) ; .set GL_PREFIX(GetTexParameterIiv), GL_PREFIX(GetTexParameterIivEXT)
+ .globl GL_PREFIX(GetTexParameterIuiv) ; .set GL_PREFIX(GetTexParameterIuiv), GL_PREFIX(GetTexParameterIuivEXT)
+ .globl GL_PREFIX(TexParameterIiv) ; .set GL_PREFIX(TexParameterIiv), GL_PREFIX(TexParameterIivEXT)
+ .globl GL_PREFIX(TexParameterIuiv) ; .set GL_PREFIX(TexParameterIuiv), GL_PREFIX(TexParameterIuivEXT)
+ .globl GL_PREFIX(BeginConditionalRender) ; .set GL_PREFIX(BeginConditionalRender), GL_PREFIX(BeginConditionalRenderNV)
+ .globl GL_PREFIX(EndConditionalRender) ; .set GL_PREFIX(EndConditionalRender), GL_PREFIX(EndConditionalRenderNV)
+ .globl GL_PREFIX(BeginTransformFeedback) ; .set GL_PREFIX(BeginTransformFeedback), GL_PREFIX(BeginTransformFeedbackEXT)
+ .globl GL_PREFIX(BindBufferBase) ; .set GL_PREFIX(BindBufferBase), GL_PREFIX(BindBufferBaseEXT)
+ .globl GL_PREFIX(BindBufferRange) ; .set GL_PREFIX(BindBufferRange), GL_PREFIX(BindBufferRangeEXT)
+ .globl GL_PREFIX(EndTransformFeedback) ; .set GL_PREFIX(EndTransformFeedback), GL_PREFIX(EndTransformFeedbackEXT)
+ .globl GL_PREFIX(GetTransformFeedbackVarying) ; .set GL_PREFIX(GetTransformFeedbackVarying), GL_PREFIX(GetTransformFeedbackVaryingEXT)
+ .globl GL_PREFIX(TransformFeedbackVaryings) ; .set GL_PREFIX(TransformFeedbackVaryings), GL_PREFIX(TransformFeedbackVaryingsEXT)
+ .globl GL_PREFIX(ProvokingVertex) ; .set GL_PREFIX(ProvokingVertex), GL_PREFIX(ProvokingVertexEXT)
+
+#if defined(GLX_USE_TLS) && defined(__linux__)
+ .section ".note.ABI-tag", "a"
+ .p2align 2
+ .long 1f - 0f /* name length */
+ .long 3f - 2f /* data length */
+ .long 1 /* note length */
+0: .asciz "GNU" /* vendor name */
+1: .p2align 2
+2: .long 0 /* note data: the ABI tag */
+ .long 2,4,20 /* Minimum kernel version w/TLS */
+3: .p2align 2 /* pad out section */
+#endif /* GLX_USE_TLS */
+
+#if defined (__ELF__) && defined (__linux__)
+ .section .note.GNU-stack,"",%progbits
+#endif
diff --git a/mesalib/src/mapi/glapi/glapi_x86.S b/mesalib/src/mapi/glapi/glapi_x86.S
index 61d7ff802..cae486ae2 100644
--- a/mesalib/src/mapi/glapi/glapi_x86.S
+++ b/mesalib/src/mapi/glapi/glapi_x86.S
@@ -1,1475 +1,1475 @@
-/* DO NOT EDIT - This file generated automatically by gl_x86_asm.py (from Mesa) script */
-
-/*
- * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
- * (C) Copyright IBM Corporation 2004, 2005
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sub license,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL, IBM,
- * AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
- * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-#include "x86/assyntax.h"
-
-#if defined(STDCALL_API)
-# if defined(USE_MGL_NAMESPACE)
-# define GL_PREFIX(n,n2) GLNAME(CONCAT(mgl,n2))
-# else
-# define GL_PREFIX(n,n2) GLNAME(CONCAT(gl,n2))
-# endif
-#else
-# if defined(USE_MGL_NAMESPACE)
-# define GL_PREFIX(n,n2) GLNAME(CONCAT(mgl,n))
-# define _glapi_Dispatch _mglapi_Dispatch
-# else
-# define GL_PREFIX(n,n2) GLNAME(CONCAT(gl,n))
-# endif
-#endif
-
-#define GL_OFFSET(x) CODEPTR(REGOFF(4 * x, EAX))
-
-#if defined(GNU_ASSEMBLER) && !defined(__DJGPP__) && !defined(__MINGW32__) && !defined(__APPLE__)
-#define GLOBL_FN(x) GLOBL x ; .type x, @function
-#else
-#define GLOBL_FN(x) GLOBL x
-#endif
-
-#if defined(PTHREADS) || defined(WIN32) || defined(BEOS_THREADS)
-# define THREADS
-#endif
-
-#ifdef GLX_USE_TLS
-
-#ifdef GLX_X86_READONLY_TEXT
-# define CTX_INSNS MOV_L(GS:(EAX), EAX)
-#else
-# define CTX_INSNS NOP /* Pad for init_glapi_relocs() */
-#endif
-
-# define GL_STUB(fn,off,fn_alt) \
-ALIGNTEXT16; \
-GLOBL_FN(GL_PREFIX(fn, fn_alt)); \
-GL_PREFIX(fn, fn_alt): \
- CALL(_x86_get_dispatch) ; \
- CTX_INSNS ; \
- JMP(GL_OFFSET(off))
-
-#elif defined(PTHREADS)
-# define GL_STUB(fn,off,fn_alt) \
-ALIGNTEXT16; \
-GLOBL_FN(GL_PREFIX(fn, fn_alt)); \
-GL_PREFIX(fn, fn_alt): \
- MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX) ; \
- TEST_L(EAX, EAX) ; \
- JE(1f) ; \
- JMP(GL_OFFSET(off)) ; \
-1: CALL(_x86_get_dispatch) ; \
- JMP(GL_OFFSET(off))
-#elif defined(THREADS)
-# define GL_STUB(fn,off,fn_alt) \
-ALIGNTEXT16; \
-GLOBL_FN(GL_PREFIX(fn, fn_alt)); \
-GL_PREFIX(fn, fn_alt): \
- MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX) ; \
- TEST_L(EAX, EAX) ; \
- JE(1f) ; \
- JMP(GL_OFFSET(off)) ; \
-1: CALL(_glapi_get_dispatch) ; \
- JMP(GL_OFFSET(off))
-#else /* Non-threaded version. */
-# define GL_STUB(fn,off,fn_alt) \
-ALIGNTEXT16; \
-GLOBL_FN(GL_PREFIX(fn, fn_alt)); \
-GL_PREFIX(fn, fn_alt): \
- MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX) ; \
- JMP(GL_OFFSET(off))
-#endif
-
-#ifdef HAVE_ALIAS
-# define GL_STUB_ALIAS(fn,off,fn_alt,alias,alias_alt) \
- .globl GL_PREFIX(fn, fn_alt) ; \
- .set GL_PREFIX(fn, fn_alt), GL_PREFIX(alias, alias_alt)
-#else
-# define GL_STUB_ALIAS(fn,off,fn_alt,alias,alias_alt) \
- GL_STUB(fn, off, fn_alt)
-#endif
-
-SEG_TEXT
-
-#ifdef GLX_USE_TLS
-
- GLOBL GLNAME(_x86_get_dispatch)
- HIDDEN(GLNAME(_x86_get_dispatch))
-ALIGNTEXT16
-GLNAME(_x86_get_dispatch):
- call 1f
-1: popl %eax
- addl $_GLOBAL_OFFSET_TABLE_+[.-1b], %eax
- movl _glapi_tls_Dispatch@GOTNTPOFF(%eax), %eax
- ret
-
-#elif defined(PTHREADS)
-EXTERN GLNAME(_glapi_Dispatch)
-EXTERN GLNAME(_gl_DispatchTSD)
-EXTERN GLNAME(pthread_getspecific)
-
-ALIGNTEXT16
-GLNAME(_x86_get_dispatch):
- SUB_L(CONST(24), ESP)
- PUSH_L(GLNAME(_gl_DispatchTSD))
- CALL(GLNAME(pthread_getspecific))
- ADD_L(CONST(28), ESP)
- RET
-#elif defined(THREADS)
-EXTERN GLNAME(_glapi_get_dispatch)
-#endif
-
-#if defined( GLX_USE_TLS ) && !defined( GLX_X86_READONLY_TEXT )
- .section wtext, "awx", @progbits
-#endif /* defined( GLX_USE_TLS ) */
-
- ALIGNTEXT16
- GLOBL GLNAME(gl_dispatch_functions_start)
- HIDDEN(GLNAME(gl_dispatch_functions_start))
-GLNAME(gl_dispatch_functions_start):
-
- GL_STUB(NewList, 0, NewList@8)
- GL_STUB(EndList, 1, EndList@0)
- GL_STUB(CallList, 2, CallList@4)
- GL_STUB(CallLists, 3, CallLists@12)
- GL_STUB(DeleteLists, 4, DeleteLists@8)
- GL_STUB(GenLists, 5, GenLists@4)
- GL_STUB(ListBase, 6, ListBase@4)
- GL_STUB(Begin, 7, Begin@4)
- GL_STUB(Bitmap, 8, Bitmap@28)
- GL_STUB(Color3b, 9, Color3b@12)
- GL_STUB(Color3bv, 10, Color3bv@4)
- GL_STUB(Color3d, 11, Color3d@24)
- GL_STUB(Color3dv, 12, Color3dv@4)
- GL_STUB(Color3f, 13, Color3f@12)
- GL_STUB(Color3fv, 14, Color3fv@4)
- GL_STUB(Color3i, 15, Color3i@12)
- GL_STUB(Color3iv, 16, Color3iv@4)
- GL_STUB(Color3s, 17, Color3s@12)
- GL_STUB(Color3sv, 18, Color3sv@4)
- GL_STUB(Color3ub, 19, Color3ub@12)
- GL_STUB(Color3ubv, 20, Color3ubv@4)
- GL_STUB(Color3ui, 21, Color3ui@12)
- GL_STUB(Color3uiv, 22, Color3uiv@4)
- GL_STUB(Color3us, 23, Color3us@12)
- GL_STUB(Color3usv, 24, Color3usv@4)
- GL_STUB(Color4b, 25, Color4b@16)
- GL_STUB(Color4bv, 26, Color4bv@4)
- GL_STUB(Color4d, 27, Color4d@32)
- GL_STUB(Color4dv, 28, Color4dv@4)
- GL_STUB(Color4f, 29, Color4f@16)
- GL_STUB(Color4fv, 30, Color4fv@4)
- GL_STUB(Color4i, 31, Color4i@16)
- GL_STUB(Color4iv, 32, Color4iv@4)
- GL_STUB(Color4s, 33, Color4s@16)
- GL_STUB(Color4sv, 34, Color4sv@4)
- GL_STUB(Color4ub, 35, Color4ub@16)
- GL_STUB(Color4ubv, 36, Color4ubv@4)
- GL_STUB(Color4ui, 37, Color4ui@16)
- GL_STUB(Color4uiv, 38, Color4uiv@4)
- GL_STUB(Color4us, 39, Color4us@16)
- GL_STUB(Color4usv, 40, Color4usv@4)
- GL_STUB(EdgeFlag, 41, EdgeFlag@4)
- GL_STUB(EdgeFlagv, 42, EdgeFlagv@4)
- GL_STUB(End, 43, End@0)
- GL_STUB(Indexd, 44, Indexd@8)
- GL_STUB(Indexdv, 45, Indexdv@4)
- GL_STUB(Indexf, 46, Indexf@4)
- GL_STUB(Indexfv, 47, Indexfv@4)
- GL_STUB(Indexi, 48, Indexi@4)
- GL_STUB(Indexiv, 49, Indexiv@4)
- GL_STUB(Indexs, 50, Indexs@4)
- GL_STUB(Indexsv, 51, Indexsv@4)
- GL_STUB(Normal3b, 52, Normal3b@12)
- GL_STUB(Normal3bv, 53, Normal3bv@4)
- GL_STUB(Normal3d, 54, Normal3d@24)
- GL_STUB(Normal3dv, 55, Normal3dv@4)
- GL_STUB(Normal3f, 56, Normal3f@12)
- GL_STUB(Normal3fv, 57, Normal3fv@4)
- GL_STUB(Normal3i, 58, Normal3i@12)
- GL_STUB(Normal3iv, 59, Normal3iv@4)
- GL_STUB(Normal3s, 60, Normal3s@12)
- GL_STUB(Normal3sv, 61, Normal3sv@4)
- GL_STUB(RasterPos2d, 62, RasterPos2d@16)
- GL_STUB(RasterPos2dv, 63, RasterPos2dv@4)
- GL_STUB(RasterPos2f, 64, RasterPos2f@8)
- GL_STUB(RasterPos2fv, 65, RasterPos2fv@4)
- GL_STUB(RasterPos2i, 66, RasterPos2i@8)
- GL_STUB(RasterPos2iv, 67, RasterPos2iv@4)
- GL_STUB(RasterPos2s, 68, RasterPos2s@8)
- GL_STUB(RasterPos2sv, 69, RasterPos2sv@4)
- GL_STUB(RasterPos3d, 70, RasterPos3d@24)
- GL_STUB(RasterPos3dv, 71, RasterPos3dv@4)
- GL_STUB(RasterPos3f, 72, RasterPos3f@12)
- GL_STUB(RasterPos3fv, 73, RasterPos3fv@4)
- GL_STUB(RasterPos3i, 74, RasterPos3i@12)
- GL_STUB(RasterPos3iv, 75, RasterPos3iv@4)
- GL_STUB(RasterPos3s, 76, RasterPos3s@12)
- GL_STUB(RasterPos3sv, 77, RasterPos3sv@4)
- GL_STUB(RasterPos4d, 78, RasterPos4d@32)
- GL_STUB(RasterPos4dv, 79, RasterPos4dv@4)
- GL_STUB(RasterPos4f, 80, RasterPos4f@16)
- GL_STUB(RasterPos4fv, 81, RasterPos4fv@4)
- GL_STUB(RasterPos4i, 82, RasterPos4i@16)
- GL_STUB(RasterPos4iv, 83, RasterPos4iv@4)
- GL_STUB(RasterPos4s, 84, RasterPos4s@16)
- GL_STUB(RasterPos4sv, 85, RasterPos4sv@4)
- GL_STUB(Rectd, 86, Rectd@32)
- GL_STUB(Rectdv, 87, Rectdv@8)
- GL_STUB(Rectf, 88, Rectf@16)
- GL_STUB(Rectfv, 89, Rectfv@8)
- GL_STUB(Recti, 90, Recti@16)
- GL_STUB(Rectiv, 91, Rectiv@8)
- GL_STUB(Rects, 92, Rects@16)
- GL_STUB(Rectsv, 93, Rectsv@8)
- GL_STUB(TexCoord1d, 94, TexCoord1d@8)
- GL_STUB(TexCoord1dv, 95, TexCoord1dv@4)
- GL_STUB(TexCoord1f, 96, TexCoord1f@4)
- GL_STUB(TexCoord1fv, 97, TexCoord1fv@4)
- GL_STUB(TexCoord1i, 98, TexCoord1i@4)
- GL_STUB(TexCoord1iv, 99, TexCoord1iv@4)
- GL_STUB(TexCoord1s, 100, TexCoord1s@4)
- GL_STUB(TexCoord1sv, 101, TexCoord1sv@4)
- GL_STUB(TexCoord2d, 102, TexCoord2d@16)
- GL_STUB(TexCoord2dv, 103, TexCoord2dv@4)
- GL_STUB(TexCoord2f, 104, TexCoord2f@8)
- GL_STUB(TexCoord2fv, 105, TexCoord2fv@4)
- GL_STUB(TexCoord2i, 106, TexCoord2i@8)
- GL_STUB(TexCoord2iv, 107, TexCoord2iv@4)
- GL_STUB(TexCoord2s, 108, TexCoord2s@8)
- GL_STUB(TexCoord2sv, 109, TexCoord2sv@4)
- GL_STUB(TexCoord3d, 110, TexCoord3d@24)
- GL_STUB(TexCoord3dv, 111, TexCoord3dv@4)
- GL_STUB(TexCoord3f, 112, TexCoord3f@12)
- GL_STUB(TexCoord3fv, 113, TexCoord3fv@4)
- GL_STUB(TexCoord3i, 114, TexCoord3i@12)
- GL_STUB(TexCoord3iv, 115, TexCoord3iv@4)
- GL_STUB(TexCoord3s, 116, TexCoord3s@12)
- GL_STUB(TexCoord3sv, 117, TexCoord3sv@4)
- GL_STUB(TexCoord4d, 118, TexCoord4d@32)
- GL_STUB(TexCoord4dv, 119, TexCoord4dv@4)
- GL_STUB(TexCoord4f, 120, TexCoord4f@16)
- GL_STUB(TexCoord4fv, 121, TexCoord4fv@4)
- GL_STUB(TexCoord4i, 122, TexCoord4i@16)
- GL_STUB(TexCoord4iv, 123, TexCoord4iv@4)
- GL_STUB(TexCoord4s, 124, TexCoord4s@16)
- GL_STUB(TexCoord4sv, 125, TexCoord4sv@4)
- GL_STUB(Vertex2d, 126, Vertex2d@16)
- GL_STUB(Vertex2dv, 127, Vertex2dv@4)
- GL_STUB(Vertex2f, 128, Vertex2f@8)
- GL_STUB(Vertex2fv, 129, Vertex2fv@4)
- GL_STUB(Vertex2i, 130, Vertex2i@8)
- GL_STUB(Vertex2iv, 131, Vertex2iv@4)
- GL_STUB(Vertex2s, 132, Vertex2s@8)
- GL_STUB(Vertex2sv, 133, Vertex2sv@4)
- GL_STUB(Vertex3d, 134, Vertex3d@24)
- GL_STUB(Vertex3dv, 135, Vertex3dv@4)
- GL_STUB(Vertex3f, 136, Vertex3f@12)
- GL_STUB(Vertex3fv, 137, Vertex3fv@4)
- GL_STUB(Vertex3i, 138, Vertex3i@12)
- GL_STUB(Vertex3iv, 139, Vertex3iv@4)
- GL_STUB(Vertex3s, 140, Vertex3s@12)
- GL_STUB(Vertex3sv, 141, Vertex3sv@4)
- GL_STUB(Vertex4d, 142, Vertex4d@32)
- GL_STUB(Vertex4dv, 143, Vertex4dv@4)
- GL_STUB(Vertex4f, 144, Vertex4f@16)
- GL_STUB(Vertex4fv, 145, Vertex4fv@4)
- GL_STUB(Vertex4i, 146, Vertex4i@16)
- GL_STUB(Vertex4iv, 147, Vertex4iv@4)
- GL_STUB(Vertex4s, 148, Vertex4s@16)
- GL_STUB(Vertex4sv, 149, Vertex4sv@4)
- GL_STUB(ClipPlane, 150, ClipPlane@8)
- GL_STUB(ColorMaterial, 151, ColorMaterial@8)
- GL_STUB(CullFace, 152, CullFace@4)
- GL_STUB(Fogf, 153, Fogf@8)
- GL_STUB(Fogfv, 154, Fogfv@8)
- GL_STUB(Fogi, 155, Fogi@8)
- GL_STUB(Fogiv, 156, Fogiv@8)
- GL_STUB(FrontFace, 157, FrontFace@4)
- GL_STUB(Hint, 158, Hint@8)
- GL_STUB(Lightf, 159, Lightf@12)
- GL_STUB(Lightfv, 160, Lightfv@12)
- GL_STUB(Lighti, 161, Lighti@12)
- GL_STUB(Lightiv, 162, Lightiv@12)
- GL_STUB(LightModelf, 163, LightModelf@8)
- GL_STUB(LightModelfv, 164, LightModelfv@8)
- GL_STUB(LightModeli, 165, LightModeli@8)
- GL_STUB(LightModeliv, 166, LightModeliv@8)
- GL_STUB(LineStipple, 167, LineStipple@8)
- GL_STUB(LineWidth, 168, LineWidth@4)
- GL_STUB(Materialf, 169, Materialf@12)
- GL_STUB(Materialfv, 170, Materialfv@12)
- GL_STUB(Materiali, 171, Materiali@12)
- GL_STUB(Materialiv, 172, Materialiv@12)
- GL_STUB(PointSize, 173, PointSize@4)
- GL_STUB(PolygonMode, 174, PolygonMode@8)
- GL_STUB(PolygonStipple, 175, PolygonStipple@4)
- GL_STUB(Scissor, 176, Scissor@16)
- GL_STUB(ShadeModel, 177, ShadeModel@4)
- GL_STUB(TexParameterf, 178, TexParameterf@12)
- GL_STUB(TexParameterfv, 179, TexParameterfv@12)
- GL_STUB(TexParameteri, 180, TexParameteri@12)
- GL_STUB(TexParameteriv, 181, TexParameteriv@12)
- GL_STUB(TexImage1D, 182, TexImage1D@32)
- GL_STUB(TexImage2D, 183, TexImage2D@36)
- GL_STUB(TexEnvf, 184, TexEnvf@12)
- GL_STUB(TexEnvfv, 185, TexEnvfv@12)
- GL_STUB(TexEnvi, 186, TexEnvi@12)
- GL_STUB(TexEnviv, 187, TexEnviv@12)
- GL_STUB(TexGend, 188, TexGend@16)
- GL_STUB(TexGendv, 189, TexGendv@12)
- GL_STUB(TexGenf, 190, TexGenf@12)
- GL_STUB(TexGenfv, 191, TexGenfv@12)
- GL_STUB(TexGeni, 192, TexGeni@12)
- GL_STUB(TexGeniv, 193, TexGeniv@12)
- GL_STUB(FeedbackBuffer, 194, FeedbackBuffer@12)
- GL_STUB(SelectBuffer, 195, SelectBuffer@8)
- GL_STUB(RenderMode, 196, RenderMode@4)
- GL_STUB(InitNames, 197, InitNames@0)
- GL_STUB(LoadName, 198, LoadName@4)
- GL_STUB(PassThrough, 199, PassThrough@4)
- GL_STUB(PopName, 200, PopName@0)
- GL_STUB(PushName, 201, PushName@4)
- GL_STUB(DrawBuffer, 202, DrawBuffer@4)
- GL_STUB(Clear, 203, Clear@4)
- GL_STUB(ClearAccum, 204, ClearAccum@16)
- GL_STUB(ClearIndex, 205, ClearIndex@4)
- GL_STUB(ClearColor, 206, ClearColor@16)
- GL_STUB(ClearStencil, 207, ClearStencil@4)
- GL_STUB(ClearDepth, 208, ClearDepth@8)
- GL_STUB(StencilMask, 209, StencilMask@4)
- GL_STUB(ColorMask, 210, ColorMask@16)
- GL_STUB(DepthMask, 211, DepthMask@4)
- GL_STUB(IndexMask, 212, IndexMask@4)
- GL_STUB(Accum, 213, Accum@8)
- GL_STUB(Disable, 214, Disable@4)
- GL_STUB(Enable, 215, Enable@4)
- GL_STUB(Finish, 216, Finish@0)
- GL_STUB(Flush, 217, Flush@0)
- GL_STUB(PopAttrib, 218, PopAttrib@0)
- GL_STUB(PushAttrib, 219, PushAttrib@4)
- GL_STUB(Map1d, 220, Map1d@32)
- GL_STUB(Map1f, 221, Map1f@24)
- GL_STUB(Map2d, 222, Map2d@56)
- GL_STUB(Map2f, 223, Map2f@40)
- GL_STUB(MapGrid1d, 224, MapGrid1d@20)
- GL_STUB(MapGrid1f, 225, MapGrid1f@12)
- GL_STUB(MapGrid2d, 226, MapGrid2d@40)
- GL_STUB(MapGrid2f, 227, MapGrid2f@24)
- GL_STUB(EvalCoord1d, 228, EvalCoord1d@8)
- GL_STUB(EvalCoord1dv, 229, EvalCoord1dv@4)
- GL_STUB(EvalCoord1f, 230, EvalCoord1f@4)
- GL_STUB(EvalCoord1fv, 231, EvalCoord1fv@4)
- GL_STUB(EvalCoord2d, 232, EvalCoord2d@16)
- GL_STUB(EvalCoord2dv, 233, EvalCoord2dv@4)
- GL_STUB(EvalCoord2f, 234, EvalCoord2f@8)
- GL_STUB(EvalCoord2fv, 235, EvalCoord2fv@4)
- GL_STUB(EvalMesh1, 236, EvalMesh1@12)
- GL_STUB(EvalPoint1, 237, EvalPoint1@4)
- GL_STUB(EvalMesh2, 238, EvalMesh2@20)
- GL_STUB(EvalPoint2, 239, EvalPoint2@8)
- GL_STUB(AlphaFunc, 240, AlphaFunc@8)
- GL_STUB(BlendFunc, 241, BlendFunc@8)
- GL_STUB(LogicOp, 242, LogicOp@4)
- GL_STUB(StencilFunc, 243, StencilFunc@12)
- GL_STUB(StencilOp, 244, StencilOp@12)
- GL_STUB(DepthFunc, 245, DepthFunc@4)
- GL_STUB(PixelZoom, 246, PixelZoom@8)
- GL_STUB(PixelTransferf, 247, PixelTransferf@8)
- GL_STUB(PixelTransferi, 248, PixelTransferi@8)
- GL_STUB(PixelStoref, 249, PixelStoref@8)
- GL_STUB(PixelStorei, 250, PixelStorei@8)
- GL_STUB(PixelMapfv, 251, PixelMapfv@12)
- GL_STUB(PixelMapuiv, 252, PixelMapuiv@12)
- GL_STUB(PixelMapusv, 253, PixelMapusv@12)
- GL_STUB(ReadBuffer, 254, ReadBuffer@4)
- GL_STUB(CopyPixels, 255, CopyPixels@20)
- GL_STUB(ReadPixels, 256, ReadPixels@28)
- GL_STUB(DrawPixels, 257, DrawPixels@20)
- GL_STUB(GetBooleanv, 258, GetBooleanv@8)
- GL_STUB(GetClipPlane, 259, GetClipPlane@8)
- GL_STUB(GetDoublev, 260, GetDoublev@8)
- GL_STUB(GetError, 261, GetError@0)
- GL_STUB(GetFloatv, 262, GetFloatv@8)
- GL_STUB(GetIntegerv, 263, GetIntegerv@8)
- GL_STUB(GetLightfv, 264, GetLightfv@12)
- GL_STUB(GetLightiv, 265, GetLightiv@12)
- GL_STUB(GetMapdv, 266, GetMapdv@12)
- GL_STUB(GetMapfv, 267, GetMapfv@12)
- GL_STUB(GetMapiv, 268, GetMapiv@12)
- GL_STUB(GetMaterialfv, 269, GetMaterialfv@12)
- GL_STUB(GetMaterialiv, 270, GetMaterialiv@12)
- GL_STUB(GetPixelMapfv, 271, GetPixelMapfv@8)
- GL_STUB(GetPixelMapuiv, 272, GetPixelMapuiv@8)
- GL_STUB(GetPixelMapusv, 273, GetPixelMapusv@8)
- GL_STUB(GetPolygonStipple, 274, GetPolygonStipple@4)
- GL_STUB(GetString, 275, GetString@4)
- GL_STUB(GetTexEnvfv, 276, GetTexEnvfv@12)
- GL_STUB(GetTexEnviv, 277, GetTexEnviv@12)
- GL_STUB(GetTexGendv, 278, GetTexGendv@12)
- GL_STUB(GetTexGenfv, 279, GetTexGenfv@12)
- GL_STUB(GetTexGeniv, 280, GetTexGeniv@12)
- GL_STUB(GetTexImage, 281, GetTexImage@20)
- GL_STUB(GetTexParameterfv, 282, GetTexParameterfv@12)
- GL_STUB(GetTexParameteriv, 283, GetTexParameteriv@12)
- GL_STUB(GetTexLevelParameterfv, 284, GetTexLevelParameterfv@16)
- GL_STUB(GetTexLevelParameteriv, 285, GetTexLevelParameteriv@16)
- GL_STUB(IsEnabled, 286, IsEnabled@4)
- GL_STUB(IsList, 287, IsList@4)
- GL_STUB(DepthRange, 288, DepthRange@16)
- GL_STUB(Frustum, 289, Frustum@48)
- GL_STUB(LoadIdentity, 290, LoadIdentity@0)
- GL_STUB(LoadMatrixf, 291, LoadMatrixf@4)
- GL_STUB(LoadMatrixd, 292, LoadMatrixd@4)
- GL_STUB(MatrixMode, 293, MatrixMode@4)
- GL_STUB(MultMatrixf, 294, MultMatrixf@4)
- GL_STUB(MultMatrixd, 295, MultMatrixd@4)
- GL_STUB(Ortho, 296, Ortho@48)
- GL_STUB(PopMatrix, 297, PopMatrix@0)
- GL_STUB(PushMatrix, 298, PushMatrix@0)
- GL_STUB(Rotated, 299, Rotated@32)
- GL_STUB(Rotatef, 300, Rotatef@16)
- GL_STUB(Scaled, 301, Scaled@24)
- GL_STUB(Scalef, 302, Scalef@12)
- GL_STUB(Translated, 303, Translated@24)
- GL_STUB(Translatef, 304, Translatef@12)
- GL_STUB(Viewport, 305, Viewport@16)
- GL_STUB(ArrayElement, 306, ArrayElement@4)
- GL_STUB(BindTexture, 307, BindTexture@8)
- GL_STUB(ColorPointer, 308, ColorPointer@16)
- GL_STUB(DisableClientState, 309, DisableClientState@4)
- GL_STUB(DrawArrays, 310, DrawArrays@12)
- GL_STUB(DrawElements, 311, DrawElements@16)
- GL_STUB(EdgeFlagPointer, 312, EdgeFlagPointer@8)
- GL_STUB(EnableClientState, 313, EnableClientState@4)
- GL_STUB(IndexPointer, 314, IndexPointer@12)
- GL_STUB(Indexub, 315, Indexub@4)
- GL_STUB(Indexubv, 316, Indexubv@4)
- GL_STUB(InterleavedArrays, 317, InterleavedArrays@12)
- GL_STUB(NormalPointer, 318, NormalPointer@12)
- GL_STUB(PolygonOffset, 319, PolygonOffset@8)
- GL_STUB(TexCoordPointer, 320, TexCoordPointer@16)
- GL_STUB(VertexPointer, 321, VertexPointer@16)
- GL_STUB(AreTexturesResident, 322, AreTexturesResident@12)
- GL_STUB(CopyTexImage1D, 323, CopyTexImage1D@28)
- GL_STUB(CopyTexImage2D, 324, CopyTexImage2D@32)
- GL_STUB(CopyTexSubImage1D, 325, CopyTexSubImage1D@24)
- GL_STUB(CopyTexSubImage2D, 326, CopyTexSubImage2D@32)
- GL_STUB(DeleteTextures, 327, DeleteTextures@8)
- GL_STUB(GenTextures, 328, GenTextures@8)
- GL_STUB(GetPointerv, 329, GetPointerv@8)
- GL_STUB(IsTexture, 330, IsTexture@4)
- GL_STUB(PrioritizeTextures, 331, PrioritizeTextures@12)
- GL_STUB(TexSubImage1D, 332, TexSubImage1D@28)
- GL_STUB(TexSubImage2D, 333, TexSubImage2D@36)
- GL_STUB(PopClientAttrib, 334, PopClientAttrib@0)
- GL_STUB(PushClientAttrib, 335, PushClientAttrib@4)
- GL_STUB(BlendColor, 336, BlendColor@16)
- GL_STUB(BlendEquation, 337, BlendEquation@4)
- GL_STUB(DrawRangeElements, 338, DrawRangeElements@24)
- GL_STUB(ColorTable, 339, ColorTable@24)
- GL_STUB(ColorTableParameterfv, 340, ColorTableParameterfv@12)
- GL_STUB(ColorTableParameteriv, 341, ColorTableParameteriv@12)
- GL_STUB(CopyColorTable, 342, CopyColorTable@20)
- GL_STUB(GetColorTable, 343, GetColorTable@16)
- GL_STUB(GetColorTableParameterfv, 344, GetColorTableParameterfv@12)
- GL_STUB(GetColorTableParameteriv, 345, GetColorTableParameteriv@12)
- GL_STUB(ColorSubTable, 346, ColorSubTable@24)
- GL_STUB(CopyColorSubTable, 347, CopyColorSubTable@20)
- GL_STUB(ConvolutionFilter1D, 348, ConvolutionFilter1D@24)
- GL_STUB(ConvolutionFilter2D, 349, ConvolutionFilter2D@28)
- GL_STUB(ConvolutionParameterf, 350, ConvolutionParameterf@12)
- GL_STUB(ConvolutionParameterfv, 351, ConvolutionParameterfv@12)
- GL_STUB(ConvolutionParameteri, 352, ConvolutionParameteri@12)
- GL_STUB(ConvolutionParameteriv, 353, ConvolutionParameteriv@12)
- GL_STUB(CopyConvolutionFilter1D, 354, CopyConvolutionFilter1D@20)
- GL_STUB(CopyConvolutionFilter2D, 355, CopyConvolutionFilter2D@24)
- GL_STUB(GetConvolutionFilter, 356, GetConvolutionFilter@16)
- GL_STUB(GetConvolutionParameterfv, 357, GetConvolutionParameterfv@12)
- GL_STUB(GetConvolutionParameteriv, 358, GetConvolutionParameteriv@12)
- GL_STUB(GetSeparableFilter, 359, GetSeparableFilter@24)
- GL_STUB(SeparableFilter2D, 360, SeparableFilter2D@32)
- GL_STUB(GetHistogram, 361, GetHistogram@20)
- GL_STUB(GetHistogramParameterfv, 362, GetHistogramParameterfv@12)
- GL_STUB(GetHistogramParameteriv, 363, GetHistogramParameteriv@12)
- GL_STUB(GetMinmax, 364, GetMinmax@20)
- GL_STUB(GetMinmaxParameterfv, 365, GetMinmaxParameterfv@12)
- GL_STUB(GetMinmaxParameteriv, 366, GetMinmaxParameteriv@12)
- GL_STUB(Histogram, 367, Histogram@16)
- GL_STUB(Minmax, 368, Minmax@12)
- GL_STUB(ResetHistogram, 369, ResetHistogram@4)
- GL_STUB(ResetMinmax, 370, ResetMinmax@4)
- GL_STUB(TexImage3D, 371, TexImage3D@40)
- GL_STUB(TexSubImage3D, 372, TexSubImage3D@44)
- GL_STUB(CopyTexSubImage3D, 373, CopyTexSubImage3D@36)
- GL_STUB(ActiveTextureARB, 374, ActiveTextureARB@4)
- GL_STUB(ClientActiveTextureARB, 375, ClientActiveTextureARB@4)
- GL_STUB(MultiTexCoord1dARB, 376, MultiTexCoord1dARB@12)
- GL_STUB(MultiTexCoord1dvARB, 377, MultiTexCoord1dvARB@8)
- GL_STUB(MultiTexCoord1fARB, 378, MultiTexCoord1fARB@8)
- GL_STUB(MultiTexCoord1fvARB, 379, MultiTexCoord1fvARB@8)
- GL_STUB(MultiTexCoord1iARB, 380, MultiTexCoord1iARB@8)
- GL_STUB(MultiTexCoord1ivARB, 381, MultiTexCoord1ivARB@8)
- GL_STUB(MultiTexCoord1sARB, 382, MultiTexCoord1sARB@8)
- GL_STUB(MultiTexCoord1svARB, 383, MultiTexCoord1svARB@8)
- GL_STUB(MultiTexCoord2dARB, 384, MultiTexCoord2dARB@20)
- GL_STUB(MultiTexCoord2dvARB, 385, MultiTexCoord2dvARB@8)
- GL_STUB(MultiTexCoord2fARB, 386, MultiTexCoord2fARB@12)
- GL_STUB(MultiTexCoord2fvARB, 387, MultiTexCoord2fvARB@8)
- GL_STUB(MultiTexCoord2iARB, 388, MultiTexCoord2iARB@12)
- GL_STUB(MultiTexCoord2ivARB, 389, MultiTexCoord2ivARB@8)
- GL_STUB(MultiTexCoord2sARB, 390, MultiTexCoord2sARB@12)
- GL_STUB(MultiTexCoord2svARB, 391, MultiTexCoord2svARB@8)
- GL_STUB(MultiTexCoord3dARB, 392, MultiTexCoord3dARB@28)
- GL_STUB(MultiTexCoord3dvARB, 393, MultiTexCoord3dvARB@8)
- GL_STUB(MultiTexCoord3fARB, 394, MultiTexCoord3fARB@16)
- GL_STUB(MultiTexCoord3fvARB, 395, MultiTexCoord3fvARB@8)
- GL_STUB(MultiTexCoord3iARB, 396, MultiTexCoord3iARB@16)
- GL_STUB(MultiTexCoord3ivARB, 397, MultiTexCoord3ivARB@8)
- GL_STUB(MultiTexCoord3sARB, 398, MultiTexCoord3sARB@16)
- GL_STUB(MultiTexCoord3svARB, 399, MultiTexCoord3svARB@8)
- GL_STUB(MultiTexCoord4dARB, 400, MultiTexCoord4dARB@36)
- GL_STUB(MultiTexCoord4dvARB, 401, MultiTexCoord4dvARB@8)
- GL_STUB(MultiTexCoord4fARB, 402, MultiTexCoord4fARB@20)
- GL_STUB(MultiTexCoord4fvARB, 403, MultiTexCoord4fvARB@8)
- GL_STUB(MultiTexCoord4iARB, 404, MultiTexCoord4iARB@20)
- GL_STUB(MultiTexCoord4ivARB, 405, MultiTexCoord4ivARB@8)
- GL_STUB(MultiTexCoord4sARB, 406, MultiTexCoord4sARB@20)
- GL_STUB(MultiTexCoord4svARB, 407, MultiTexCoord4svARB@8)
- GL_STUB(AttachShader, 408, AttachShader@8)
- GL_STUB(CreateProgram, 409, CreateProgram@0)
- GL_STUB(CreateShader, 410, CreateShader@4)
- GL_STUB(DeleteProgram, 411, DeleteProgram@4)
- GL_STUB(DeleteShader, 412, DeleteShader@4)
- GL_STUB(DetachShader, 413, DetachShader@8)
- GL_STUB(GetAttachedShaders, 414, GetAttachedShaders@16)
- GL_STUB(GetProgramInfoLog, 415, GetProgramInfoLog@16)
- GL_STUB(GetProgramiv, 416, GetProgramiv@12)
- GL_STUB(GetShaderInfoLog, 417, GetShaderInfoLog@16)
- GL_STUB(GetShaderiv, 418, GetShaderiv@12)
- GL_STUB(IsProgram, 419, IsProgram@4)
- GL_STUB(IsShader, 420, IsShader@4)
- GL_STUB(StencilFuncSeparate, 421, StencilFuncSeparate@16)
- GL_STUB(StencilMaskSeparate, 422, StencilMaskSeparate@8)
- GL_STUB(StencilOpSeparate, 423, StencilOpSeparate@16)
- GL_STUB(UniformMatrix2x3fv, 424, UniformMatrix2x3fv@16)
- GL_STUB(UniformMatrix2x4fv, 425, UniformMatrix2x4fv@16)
- GL_STUB(UniformMatrix3x2fv, 426, UniformMatrix3x2fv@16)
- GL_STUB(UniformMatrix3x4fv, 427, UniformMatrix3x4fv@16)
- GL_STUB(UniformMatrix4x2fv, 428, UniformMatrix4x2fv@16)
- GL_STUB(UniformMatrix4x3fv, 429, UniformMatrix4x3fv@16)
- GL_STUB(ClampColor, 430, ClampColor@8)
- GL_STUB(ClearBufferfi, 431, ClearBufferfi@16)
- GL_STUB(ClearBufferfv, 432, ClearBufferfv@12)
- GL_STUB(ClearBufferiv, 433, ClearBufferiv@12)
- GL_STUB(ClearBufferuiv, 434, ClearBufferuiv@12)
- GL_STUB(GetStringi, 435, GetStringi@8)
- GL_STUB(TexBuffer, 436, TexBuffer@12)
- GL_STUB(FramebufferTexture, 437, FramebufferTexture@16)
- GL_STUB(GetBufferParameteri64v, 438, GetBufferParameteri64v@12)
- GL_STUB(GetInteger64i_v, 439, GetInteger64i_v@12)
- GL_STUB(VertexAttribDivisor, 440, VertexAttribDivisor@8)
- GL_STUB(LoadTransposeMatrixdARB, 441, LoadTransposeMatrixdARB@4)
- GL_STUB(LoadTransposeMatrixfARB, 442, LoadTransposeMatrixfARB@4)
- GL_STUB(MultTransposeMatrixdARB, 443, MultTransposeMatrixdARB@4)
- GL_STUB(MultTransposeMatrixfARB, 444, MultTransposeMatrixfARB@4)
- GL_STUB(SampleCoverageARB, 445, SampleCoverageARB@8)
- GL_STUB(CompressedTexImage1DARB, 446, CompressedTexImage1DARB@28)
- GL_STUB(CompressedTexImage2DARB, 447, CompressedTexImage2DARB@32)
- GL_STUB(CompressedTexImage3DARB, 448, CompressedTexImage3DARB@36)
- GL_STUB(CompressedTexSubImage1DARB, 449, CompressedTexSubImage1DARB@28)
- GL_STUB(CompressedTexSubImage2DARB, 450, CompressedTexSubImage2DARB@36)
- GL_STUB(CompressedTexSubImage3DARB, 451, CompressedTexSubImage3DARB@44)
- GL_STUB(GetCompressedTexImageARB, 452, GetCompressedTexImageARB@12)
- GL_STUB(DisableVertexAttribArrayARB, 453, DisableVertexAttribArrayARB@4)
- GL_STUB(EnableVertexAttribArrayARB, 454, EnableVertexAttribArrayARB@4)
- GL_STUB(GetProgramEnvParameterdvARB, 455, GetProgramEnvParameterdvARB@12)
- GL_STUB(GetProgramEnvParameterfvARB, 456, GetProgramEnvParameterfvARB@12)
- GL_STUB(GetProgramLocalParameterdvARB, 457, GetProgramLocalParameterdvARB@12)
- GL_STUB(GetProgramLocalParameterfvARB, 458, GetProgramLocalParameterfvARB@12)
- GL_STUB(GetProgramStringARB, 459, GetProgramStringARB@12)
- GL_STUB(GetProgramivARB, 460, GetProgramivARB@12)
- GL_STUB(GetVertexAttribdvARB, 461, GetVertexAttribdvARB@12)
- GL_STUB(GetVertexAttribfvARB, 462, GetVertexAttribfvARB@12)
- GL_STUB(GetVertexAttribivARB, 463, GetVertexAttribivARB@12)
- GL_STUB(ProgramEnvParameter4dARB, 464, ProgramEnvParameter4dARB@40)
- GL_STUB(ProgramEnvParameter4dvARB, 465, ProgramEnvParameter4dvARB@12)
- GL_STUB(ProgramEnvParameter4fARB, 466, ProgramEnvParameter4fARB@24)
- GL_STUB(ProgramEnvParameter4fvARB, 467, ProgramEnvParameter4fvARB@12)
- GL_STUB(ProgramLocalParameter4dARB, 468, ProgramLocalParameter4dARB@40)
- GL_STUB(ProgramLocalParameter4dvARB, 469, ProgramLocalParameter4dvARB@12)
- GL_STUB(ProgramLocalParameter4fARB, 470, ProgramLocalParameter4fARB@24)
- GL_STUB(ProgramLocalParameter4fvARB, 471, ProgramLocalParameter4fvARB@12)
- GL_STUB(ProgramStringARB, 472, ProgramStringARB@16)
- GL_STUB(VertexAttrib1dARB, 473, VertexAttrib1dARB@12)
- GL_STUB(VertexAttrib1dvARB, 474, VertexAttrib1dvARB@8)
- GL_STUB(VertexAttrib1fARB, 475, VertexAttrib1fARB@8)
- GL_STUB(VertexAttrib1fvARB, 476, VertexAttrib1fvARB@8)
- GL_STUB(VertexAttrib1sARB, 477, VertexAttrib1sARB@8)
- GL_STUB(VertexAttrib1svARB, 478, VertexAttrib1svARB@8)
- GL_STUB(VertexAttrib2dARB, 479, VertexAttrib2dARB@20)
- GL_STUB(VertexAttrib2dvARB, 480, VertexAttrib2dvARB@8)
- GL_STUB(VertexAttrib2fARB, 481, VertexAttrib2fARB@12)
- GL_STUB(VertexAttrib2fvARB, 482, VertexAttrib2fvARB@8)
- GL_STUB(VertexAttrib2sARB, 483, VertexAttrib2sARB@12)
- GL_STUB(VertexAttrib2svARB, 484, VertexAttrib2svARB@8)
- GL_STUB(VertexAttrib3dARB, 485, VertexAttrib3dARB@28)
- GL_STUB(VertexAttrib3dvARB, 486, VertexAttrib3dvARB@8)
- GL_STUB(VertexAttrib3fARB, 487, VertexAttrib3fARB@16)
- GL_STUB(VertexAttrib3fvARB, 488, VertexAttrib3fvARB@8)
- GL_STUB(VertexAttrib3sARB, 489, VertexAttrib3sARB@16)
- GL_STUB(VertexAttrib3svARB, 490, VertexAttrib3svARB@8)
- GL_STUB(VertexAttrib4NbvARB, 491, VertexAttrib4NbvARB@8)
- GL_STUB(VertexAttrib4NivARB, 492, VertexAttrib4NivARB@8)
- GL_STUB(VertexAttrib4NsvARB, 493, VertexAttrib4NsvARB@8)
- GL_STUB(VertexAttrib4NubARB, 494, VertexAttrib4NubARB@20)
- GL_STUB(VertexAttrib4NubvARB, 495, VertexAttrib4NubvARB@8)
- GL_STUB(VertexAttrib4NuivARB, 496, VertexAttrib4NuivARB@8)
- GL_STUB(VertexAttrib4NusvARB, 497, VertexAttrib4NusvARB@8)
- GL_STUB(VertexAttrib4bvARB, 498, VertexAttrib4bvARB@8)
- GL_STUB(VertexAttrib4dARB, 499, VertexAttrib4dARB@36)
- GL_STUB(VertexAttrib4dvARB, 500, VertexAttrib4dvARB@8)
- GL_STUB(VertexAttrib4fARB, 501, VertexAttrib4fARB@20)
- GL_STUB(VertexAttrib4fvARB, 502, VertexAttrib4fvARB@8)
- GL_STUB(VertexAttrib4ivARB, 503, VertexAttrib4ivARB@8)
- GL_STUB(VertexAttrib4sARB, 504, VertexAttrib4sARB@20)
- GL_STUB(VertexAttrib4svARB, 505, VertexAttrib4svARB@8)
- GL_STUB(VertexAttrib4ubvARB, 506, VertexAttrib4ubvARB@8)
- GL_STUB(VertexAttrib4uivARB, 507, VertexAttrib4uivARB@8)
- GL_STUB(VertexAttrib4usvARB, 508, VertexAttrib4usvARB@8)
- GL_STUB(VertexAttribPointerARB, 509, VertexAttribPointerARB@24)
- GL_STUB(BindBufferARB, 510, BindBufferARB@8)
- GL_STUB(BufferDataARB, 511, BufferDataARB@16)
- GL_STUB(BufferSubDataARB, 512, BufferSubDataARB@16)
- GL_STUB(DeleteBuffersARB, 513, DeleteBuffersARB@8)
- GL_STUB(GenBuffersARB, 514, GenBuffersARB@8)
- GL_STUB(GetBufferParameterivARB, 515, GetBufferParameterivARB@12)
- GL_STUB(GetBufferPointervARB, 516, GetBufferPointervARB@12)
- GL_STUB(GetBufferSubDataARB, 517, GetBufferSubDataARB@16)
- GL_STUB(IsBufferARB, 518, IsBufferARB@4)
- GL_STUB(MapBufferARB, 519, MapBufferARB@8)
- GL_STUB(UnmapBufferARB, 520, UnmapBufferARB@4)
- GL_STUB(BeginQueryARB, 521, BeginQueryARB@8)
- GL_STUB(DeleteQueriesARB, 522, DeleteQueriesARB@8)
- GL_STUB(EndQueryARB, 523, EndQueryARB@4)
- GL_STUB(GenQueriesARB, 524, GenQueriesARB@8)
- GL_STUB(GetQueryObjectivARB, 525, GetQueryObjectivARB@12)
- GL_STUB(GetQueryObjectuivARB, 526, GetQueryObjectuivARB@12)
- GL_STUB(GetQueryivARB, 527, GetQueryivARB@12)
- GL_STUB(IsQueryARB, 528, IsQueryARB@4)
- GL_STUB(AttachObjectARB, 529, AttachObjectARB@8)
- GL_STUB(CompileShaderARB, 530, CompileShaderARB@4)
- GL_STUB(CreateProgramObjectARB, 531, CreateProgramObjectARB@0)
- GL_STUB(CreateShaderObjectARB, 532, CreateShaderObjectARB@4)
- GL_STUB(DeleteObjectARB, 533, DeleteObjectARB@4)
- GL_STUB(DetachObjectARB, 534, DetachObjectARB@8)
- GL_STUB(GetActiveUniformARB, 535, GetActiveUniformARB@28)
- GL_STUB(GetAttachedObjectsARB, 536, GetAttachedObjectsARB@16)
- GL_STUB(GetHandleARB, 537, GetHandleARB@4)
- GL_STUB(GetInfoLogARB, 538, GetInfoLogARB@16)
- GL_STUB(GetObjectParameterfvARB, 539, GetObjectParameterfvARB@12)
- GL_STUB(GetObjectParameterivARB, 540, GetObjectParameterivARB@12)
- GL_STUB(GetShaderSourceARB, 541, GetShaderSourceARB@16)
- GL_STUB(GetUniformLocationARB, 542, GetUniformLocationARB@8)
- GL_STUB(GetUniformfvARB, 543, GetUniformfvARB@12)
- GL_STUB(GetUniformivARB, 544, GetUniformivARB@12)
- GL_STUB(LinkProgramARB, 545, LinkProgramARB@4)
- GL_STUB(ShaderSourceARB, 546, ShaderSourceARB@16)
- GL_STUB(Uniform1fARB, 547, Uniform1fARB@8)
- GL_STUB(Uniform1fvARB, 548, Uniform1fvARB@12)
- GL_STUB(Uniform1iARB, 549, Uniform1iARB@8)
- GL_STUB(Uniform1ivARB, 550, Uniform1ivARB@12)
- GL_STUB(Uniform2fARB, 551, Uniform2fARB@12)
- GL_STUB(Uniform2fvARB, 552, Uniform2fvARB@12)
- GL_STUB(Uniform2iARB, 553, Uniform2iARB@12)
- GL_STUB(Uniform2ivARB, 554, Uniform2ivARB@12)
- GL_STUB(Uniform3fARB, 555, Uniform3fARB@16)
- GL_STUB(Uniform3fvARB, 556, Uniform3fvARB@12)
- GL_STUB(Uniform3iARB, 557, Uniform3iARB@16)
- GL_STUB(Uniform3ivARB, 558, Uniform3ivARB@12)
- GL_STUB(Uniform4fARB, 559, Uniform4fARB@20)
- GL_STUB(Uniform4fvARB, 560, Uniform4fvARB@12)
- GL_STUB(Uniform4iARB, 561, Uniform4iARB@20)
- GL_STUB(Uniform4ivARB, 562, Uniform4ivARB@12)
- GL_STUB(UniformMatrix2fvARB, 563, UniformMatrix2fvARB@16)
- GL_STUB(UniformMatrix3fvARB, 564, UniformMatrix3fvARB@16)
- GL_STUB(UniformMatrix4fvARB, 565, UniformMatrix4fvARB@16)
- GL_STUB(UseProgramObjectARB, 566, UseProgramObjectARB@4)
- GL_STUB(ValidateProgramARB, 567, ValidateProgramARB@4)
- GL_STUB(BindAttribLocationARB, 568, BindAttribLocationARB@12)
- GL_STUB(GetActiveAttribARB, 569, GetActiveAttribARB@28)
- GL_STUB(GetAttribLocationARB, 570, GetAttribLocationARB@8)
- GL_STUB(DrawBuffersARB, 571, DrawBuffersARB@8)
- GL_STUB(ClampColorARB, 572, ClampColorARB@8)
- GL_STUB(DrawArraysInstancedARB, 573, DrawArraysInstancedARB@16)
- GL_STUB(DrawElementsInstancedARB, 574, DrawElementsInstancedARB@20)
- GL_STUB(RenderbufferStorageMultisample, 575, RenderbufferStorageMultisample@20)
- GL_STUB(FramebufferTextureARB, 576, FramebufferTextureARB@16)
- GL_STUB(FramebufferTextureFaceARB, 577, FramebufferTextureFaceARB@20)
- GL_STUB(ProgramParameteriARB, 578, ProgramParameteriARB@12)
- GL_STUB(VertexAttribDivisorARB, 579, VertexAttribDivisorARB@8)
- GL_STUB(FlushMappedBufferRange, 580, FlushMappedBufferRange@12)
- GL_STUB(MapBufferRange, 581, MapBufferRange@16)
- GL_STUB(TexBufferARB, 582, TexBufferARB@12)
- GL_STUB(BindVertexArray, 583, BindVertexArray@4)
- GL_STUB(GenVertexArrays, 584, GenVertexArrays@8)
- GL_STUB(CopyBufferSubData, 585, CopyBufferSubData@20)
- GL_STUB(ClientWaitSync, 586, ClientWaitSync@12)
- GL_STUB(DeleteSync, 587, DeleteSync@4)
- GL_STUB(FenceSync, 588, FenceSync@8)
- GL_STUB(GetInteger64v, 589, GetInteger64v@8)
- GL_STUB(GetSynciv, 590, GetSynciv@20)
- GL_STUB(IsSync, 591, IsSync@4)
- GL_STUB(WaitSync, 592, WaitSync@12)
- GL_STUB(DrawElementsBaseVertex, 593, DrawElementsBaseVertex@20)
- GL_STUB(DrawRangeElementsBaseVertex, 594, DrawRangeElementsBaseVertex@28)
- GL_STUB(MultiDrawElementsBaseVertex, 595, MultiDrawElementsBaseVertex@24)
- GL_STUB(BlendEquationSeparateiARB, 596, BlendEquationSeparateiARB@12)
- GL_STUB(BlendEquationiARB, 597, BlendEquationiARB@8)
- GL_STUB(BlendFuncSeparateiARB, 598, BlendFuncSeparateiARB@20)
- GL_STUB(BlendFunciARB, 599, BlendFunciARB@12)
- GL_STUB(BindSampler, 600, BindSampler@8)
- GL_STUB(DeleteSamplers, 601, DeleteSamplers@8)
- GL_STUB(GenSamplers, 602, GenSamplers@8)
- GL_STUB(GetSamplerParameterIiv, 603, GetSamplerParameterIiv@12)
- GL_STUB(GetSamplerParameterIuiv, 604, GetSamplerParameterIuiv@12)
- GL_STUB(GetSamplerParameterfv, 605, GetSamplerParameterfv@12)
- GL_STUB(GetSamplerParameteriv, 606, GetSamplerParameteriv@12)
- GL_STUB(IsSampler, 607, IsSampler@4)
- GL_STUB(SamplerParameterIiv, 608, SamplerParameterIiv@12)
- GL_STUB(SamplerParameterIuiv, 609, SamplerParameterIuiv@12)
- GL_STUB(SamplerParameterf, 610, SamplerParameterf@12)
- GL_STUB(SamplerParameterfv, 611, SamplerParameterfv@12)
- GL_STUB(SamplerParameteri, 612, SamplerParameteri@12)
- GL_STUB(SamplerParameteriv, 613, SamplerParameteriv@12)
- GL_STUB(BindTransformFeedback, 614, BindTransformFeedback@8)
- GL_STUB(DeleteTransformFeedbacks, 615, DeleteTransformFeedbacks@8)
- GL_STUB(DrawTransformFeedback, 616, DrawTransformFeedback@8)
- GL_STUB(GenTransformFeedbacks, 617, GenTransformFeedbacks@8)
- GL_STUB(IsTransformFeedback, 618, IsTransformFeedback@4)
- GL_STUB(PauseTransformFeedback, 619, PauseTransformFeedback@0)
- GL_STUB(ResumeTransformFeedback, 620, ResumeTransformFeedback@0)
- GL_STUB(ClearDepthf, 621, ClearDepthf@4)
- GL_STUB(DepthRangef, 622, DepthRangef@8)
- GL_STUB(GetShaderPrecisionFormat, 623, GetShaderPrecisionFormat@16)
- GL_STUB(ReleaseShaderCompiler, 624, ReleaseShaderCompiler@0)
- GL_STUB(ShaderBinary, 625, ShaderBinary@20)
- GL_STUB(GetGraphicsResetStatusARB, 626, GetGraphicsResetStatusARB@0)
- GL_STUB(GetnColorTableARB, 627, GetnColorTableARB@20)
- GL_STUB(GetnCompressedTexImageARB, 628, GetnCompressedTexImageARB@16)
- GL_STUB(GetnConvolutionFilterARB, 629, GetnConvolutionFilterARB@20)
- GL_STUB(GetnHistogramARB, 630, GetnHistogramARB@24)
- GL_STUB(GetnMapdvARB, 631, GetnMapdvARB@16)
- GL_STUB(GetnMapfvARB, 632, GetnMapfvARB@16)
- GL_STUB(GetnMapivARB, 633, GetnMapivARB@16)
- GL_STUB(GetnMinmaxARB, 634, GetnMinmaxARB@24)
- GL_STUB(GetnPixelMapfvARB, 635, GetnPixelMapfvARB@12)
- GL_STUB(GetnPixelMapuivARB, 636, GetnPixelMapuivARB@12)
- GL_STUB(GetnPixelMapusvARB, 637, GetnPixelMapusvARB@12)
- GL_STUB(GetnPolygonStippleARB, 638, GetnPolygonStippleARB@8)
- GL_STUB(GetnSeparableFilterARB, 639, GetnSeparableFilterARB@32)
- GL_STUB(GetnTexImageARB, 640, GetnTexImageARB@24)
- GL_STUB(GetnUniformdvARB, 641, GetnUniformdvARB@16)
- GL_STUB(GetnUniformfvARB, 642, GetnUniformfvARB@16)
- GL_STUB(GetnUniformivARB, 643, GetnUniformivARB@16)
- GL_STUB(GetnUniformuivARB, 644, GetnUniformuivARB@16)
- GL_STUB(ReadnPixelsARB, 645, ReadnPixelsARB@32)
- GL_STUB(PolygonOffsetEXT, 646, PolygonOffsetEXT@8)
- GL_STUB(_dispatch_stub_647, 647, _dispatch_stub_647@8)
- HIDDEN(GL_PREFIX(_dispatch_stub_647, _dispatch_stub_647@8))
- GL_STUB(_dispatch_stub_648, 648, _dispatch_stub_648@8)
- HIDDEN(GL_PREFIX(_dispatch_stub_648, _dispatch_stub_648@8))
- GL_STUB(_dispatch_stub_649, 649, _dispatch_stub_649@8)
- HIDDEN(GL_PREFIX(_dispatch_stub_649, _dispatch_stub_649@8))
- GL_STUB(_dispatch_stub_650, 650, _dispatch_stub_650@8)
- HIDDEN(GL_PREFIX(_dispatch_stub_650, _dispatch_stub_650@8))
- GL_STUB(_dispatch_stub_651, 651, _dispatch_stub_651@8)
- HIDDEN(GL_PREFIX(_dispatch_stub_651, _dispatch_stub_651@8))
- GL_STUB(_dispatch_stub_652, 652, _dispatch_stub_652@8)
- HIDDEN(GL_PREFIX(_dispatch_stub_652, _dispatch_stub_652@8))
- GL_STUB(_dispatch_stub_653, 653, _dispatch_stub_653@8)
- HIDDEN(GL_PREFIX(_dispatch_stub_653, _dispatch_stub_653@8))
- GL_STUB(_dispatch_stub_654, 654, _dispatch_stub_654@4)
- HIDDEN(GL_PREFIX(_dispatch_stub_654, _dispatch_stub_654@4))
- GL_STUB(ColorPointerEXT, 655, ColorPointerEXT@20)
- GL_STUB(EdgeFlagPointerEXT, 656, EdgeFlagPointerEXT@12)
- GL_STUB(IndexPointerEXT, 657, IndexPointerEXT@16)
- GL_STUB(NormalPointerEXT, 658, NormalPointerEXT@16)
- GL_STUB(TexCoordPointerEXT, 659, TexCoordPointerEXT@20)
- GL_STUB(VertexPointerEXT, 660, VertexPointerEXT@20)
- GL_STUB(PointParameterfEXT, 661, PointParameterfEXT@8)
- GL_STUB(PointParameterfvEXT, 662, PointParameterfvEXT@8)
- GL_STUB(LockArraysEXT, 663, LockArraysEXT@8)
- GL_STUB(UnlockArraysEXT, 664, UnlockArraysEXT@0)
- GL_STUB(SecondaryColor3bEXT, 665, SecondaryColor3bEXT@12)
- GL_STUB(SecondaryColor3bvEXT, 666, SecondaryColor3bvEXT@4)
- GL_STUB(SecondaryColor3dEXT, 667, SecondaryColor3dEXT@24)
- GL_STUB(SecondaryColor3dvEXT, 668, SecondaryColor3dvEXT@4)
- GL_STUB(SecondaryColor3fEXT, 669, SecondaryColor3fEXT@12)
- GL_STUB(SecondaryColor3fvEXT, 670, SecondaryColor3fvEXT@4)
- GL_STUB(SecondaryColor3iEXT, 671, SecondaryColor3iEXT@12)
- GL_STUB(SecondaryColor3ivEXT, 672, SecondaryColor3ivEXT@4)
- GL_STUB(SecondaryColor3sEXT, 673, SecondaryColor3sEXT@12)
- GL_STUB(SecondaryColor3svEXT, 674, SecondaryColor3svEXT@4)
- GL_STUB(SecondaryColor3ubEXT, 675, SecondaryColor3ubEXT@12)
- GL_STUB(SecondaryColor3ubvEXT, 676, SecondaryColor3ubvEXT@4)
- GL_STUB(SecondaryColor3uiEXT, 677, SecondaryColor3uiEXT@12)
- GL_STUB(SecondaryColor3uivEXT, 678, SecondaryColor3uivEXT@4)
- GL_STUB(SecondaryColor3usEXT, 679, SecondaryColor3usEXT@12)
- GL_STUB(SecondaryColor3usvEXT, 680, SecondaryColor3usvEXT@4)
- GL_STUB(SecondaryColorPointerEXT, 681, SecondaryColorPointerEXT@16)
- GL_STUB(MultiDrawArraysEXT, 682, MultiDrawArraysEXT@16)
- GL_STUB(MultiDrawElementsEXT, 683, MultiDrawElementsEXT@20)
- GL_STUB(FogCoordPointerEXT, 684, FogCoordPointerEXT@12)
- GL_STUB(FogCoorddEXT, 685, FogCoorddEXT@8)
- GL_STUB(FogCoorddvEXT, 686, FogCoorddvEXT@4)
- GL_STUB(FogCoordfEXT, 687, FogCoordfEXT@4)
- GL_STUB(FogCoordfvEXT, 688, FogCoordfvEXT@4)
- GL_STUB(_dispatch_stub_689, 689, _dispatch_stub_689@4)
- HIDDEN(GL_PREFIX(_dispatch_stub_689, _dispatch_stub_689@4))
- GL_STUB(BlendFuncSeparateEXT, 690, BlendFuncSeparateEXT@16)
- GL_STUB(FlushVertexArrayRangeNV, 691, FlushVertexArrayRangeNV@0)
- GL_STUB(VertexArrayRangeNV, 692, VertexArrayRangeNV@8)
- GL_STUB(CombinerInputNV, 693, CombinerInputNV@24)
- GL_STUB(CombinerOutputNV, 694, CombinerOutputNV@40)
- GL_STUB(CombinerParameterfNV, 695, CombinerParameterfNV@8)
- GL_STUB(CombinerParameterfvNV, 696, CombinerParameterfvNV@8)
- GL_STUB(CombinerParameteriNV, 697, CombinerParameteriNV@8)
- GL_STUB(CombinerParameterivNV, 698, CombinerParameterivNV@8)
- GL_STUB(FinalCombinerInputNV, 699, FinalCombinerInputNV@16)
- GL_STUB(GetCombinerInputParameterfvNV, 700, GetCombinerInputParameterfvNV@20)
- GL_STUB(GetCombinerInputParameterivNV, 701, GetCombinerInputParameterivNV@20)
- GL_STUB(GetCombinerOutputParameterfvNV, 702, GetCombinerOutputParameterfvNV@16)
- GL_STUB(GetCombinerOutputParameterivNV, 703, GetCombinerOutputParameterivNV@16)
- GL_STUB(GetFinalCombinerInputParameterfvNV, 704, GetFinalCombinerInputParameterfvNV@12)
- GL_STUB(GetFinalCombinerInputParameterivNV, 705, GetFinalCombinerInputParameterivNV@12)
- GL_STUB(ResizeBuffersMESA, 706, ResizeBuffersMESA@0)
- GL_STUB(WindowPos2dMESA, 707, WindowPos2dMESA@16)
- GL_STUB(WindowPos2dvMESA, 708, WindowPos2dvMESA@4)
- GL_STUB(WindowPos2fMESA, 709, WindowPos2fMESA@8)
- GL_STUB(WindowPos2fvMESA, 710, WindowPos2fvMESA@4)
- GL_STUB(WindowPos2iMESA, 711, WindowPos2iMESA@8)
- GL_STUB(WindowPos2ivMESA, 712, WindowPos2ivMESA@4)
- GL_STUB(WindowPos2sMESA, 713, WindowPos2sMESA@8)
- GL_STUB(WindowPos2svMESA, 714, WindowPos2svMESA@4)
- GL_STUB(WindowPos3dMESA, 715, WindowPos3dMESA@24)
- GL_STUB(WindowPos3dvMESA, 716, WindowPos3dvMESA@4)
- GL_STUB(WindowPos3fMESA, 717, WindowPos3fMESA@12)
- GL_STUB(WindowPos3fvMESA, 718, WindowPos3fvMESA@4)
- GL_STUB(WindowPos3iMESA, 719, WindowPos3iMESA@12)
- GL_STUB(WindowPos3ivMESA, 720, WindowPos3ivMESA@4)
- GL_STUB(WindowPos3sMESA, 721, WindowPos3sMESA@12)
- GL_STUB(WindowPos3svMESA, 722, WindowPos3svMESA@4)
- GL_STUB(WindowPos4dMESA, 723, WindowPos4dMESA@32)
- GL_STUB(WindowPos4dvMESA, 724, WindowPos4dvMESA@4)
- GL_STUB(WindowPos4fMESA, 725, WindowPos4fMESA@16)
- GL_STUB(WindowPos4fvMESA, 726, WindowPos4fvMESA@4)
- GL_STUB(WindowPos4iMESA, 727, WindowPos4iMESA@16)
- GL_STUB(WindowPos4ivMESA, 728, WindowPos4ivMESA@4)
- GL_STUB(WindowPos4sMESA, 729, WindowPos4sMESA@16)
- GL_STUB(WindowPos4svMESA, 730, WindowPos4svMESA@4)
- GL_STUB(_dispatch_stub_731, 731, _dispatch_stub_731@20)
- HIDDEN(GL_PREFIX(_dispatch_stub_731, _dispatch_stub_731@20))
- GL_STUB(_dispatch_stub_732, 732, _dispatch_stub_732@24)
- HIDDEN(GL_PREFIX(_dispatch_stub_732, _dispatch_stub_732@24))
- GL_STUB(_dispatch_stub_733, 733, _dispatch_stub_733@8)
- HIDDEN(GL_PREFIX(_dispatch_stub_733, _dispatch_stub_733@8))
- GL_STUB(_dispatch_stub_734, 734, _dispatch_stub_734@4)
- HIDDEN(GL_PREFIX(_dispatch_stub_734, _dispatch_stub_734@4))
- GL_STUB(_dispatch_stub_735, 735, _dispatch_stub_735@8)
- HIDDEN(GL_PREFIX(_dispatch_stub_735, _dispatch_stub_735@8))
- GL_STUB(_dispatch_stub_736, 736, _dispatch_stub_736@12)
- HIDDEN(GL_PREFIX(_dispatch_stub_736, _dispatch_stub_736@12))
- GL_STUB(_dispatch_stub_737, 737, _dispatch_stub_737@4)
- HIDDEN(GL_PREFIX(_dispatch_stub_737, _dispatch_stub_737@4))
- GL_STUB(_dispatch_stub_738, 738, _dispatch_stub_738@8)
- HIDDEN(GL_PREFIX(_dispatch_stub_738, _dispatch_stub_738@8))
- GL_STUB(_dispatch_stub_739, 739, _dispatch_stub_739@4)
- HIDDEN(GL_PREFIX(_dispatch_stub_739, _dispatch_stub_739@4))
- GL_STUB(AreProgramsResidentNV, 740, AreProgramsResidentNV@12)
- GL_STUB(BindProgramNV, 741, BindProgramNV@8)
- GL_STUB(DeleteProgramsNV, 742, DeleteProgramsNV@8)
- GL_STUB(ExecuteProgramNV, 743, ExecuteProgramNV@12)
- GL_STUB(GenProgramsNV, 744, GenProgramsNV@8)
- GL_STUB(GetProgramParameterdvNV, 745, GetProgramParameterdvNV@16)
- GL_STUB(GetProgramParameterfvNV, 746, GetProgramParameterfvNV@16)
- GL_STUB(GetProgramStringNV, 747, GetProgramStringNV@12)
- GL_STUB(GetProgramivNV, 748, GetProgramivNV@12)
- GL_STUB(GetTrackMatrixivNV, 749, GetTrackMatrixivNV@16)
- GL_STUB(GetVertexAttribPointervNV, 750, GetVertexAttribPointervNV@12)
- GL_STUB(GetVertexAttribdvNV, 751, GetVertexAttribdvNV@12)
- GL_STUB(GetVertexAttribfvNV, 752, GetVertexAttribfvNV@12)
- GL_STUB(GetVertexAttribivNV, 753, GetVertexAttribivNV@12)
- GL_STUB(IsProgramNV, 754, IsProgramNV@4)
- GL_STUB(LoadProgramNV, 755, LoadProgramNV@16)
- GL_STUB(ProgramParameters4dvNV, 756, ProgramParameters4dvNV@16)
- GL_STUB(ProgramParameters4fvNV, 757, ProgramParameters4fvNV@16)
- GL_STUB(RequestResidentProgramsNV, 758, RequestResidentProgramsNV@8)
- GL_STUB(TrackMatrixNV, 759, TrackMatrixNV@16)
- GL_STUB(VertexAttrib1dNV, 760, VertexAttrib1dNV@12)
- GL_STUB(VertexAttrib1dvNV, 761, VertexAttrib1dvNV@8)
- GL_STUB(VertexAttrib1fNV, 762, VertexAttrib1fNV@8)
- GL_STUB(VertexAttrib1fvNV, 763, VertexAttrib1fvNV@8)
- GL_STUB(VertexAttrib1sNV, 764, VertexAttrib1sNV@8)
- GL_STUB(VertexAttrib1svNV, 765, VertexAttrib1svNV@8)
- GL_STUB(VertexAttrib2dNV, 766, VertexAttrib2dNV@20)
- GL_STUB(VertexAttrib2dvNV, 767, VertexAttrib2dvNV@8)
- GL_STUB(VertexAttrib2fNV, 768, VertexAttrib2fNV@12)
- GL_STUB(VertexAttrib2fvNV, 769, VertexAttrib2fvNV@8)
- GL_STUB(VertexAttrib2sNV, 770, VertexAttrib2sNV@12)
- GL_STUB(VertexAttrib2svNV, 771, VertexAttrib2svNV@8)
- GL_STUB(VertexAttrib3dNV, 772, VertexAttrib3dNV@28)
- GL_STUB(VertexAttrib3dvNV, 773, VertexAttrib3dvNV@8)
- GL_STUB(VertexAttrib3fNV, 774, VertexAttrib3fNV@16)
- GL_STUB(VertexAttrib3fvNV, 775, VertexAttrib3fvNV@8)
- GL_STUB(VertexAttrib3sNV, 776, VertexAttrib3sNV@16)
- GL_STUB(VertexAttrib3svNV, 777, VertexAttrib3svNV@8)
- GL_STUB(VertexAttrib4dNV, 778, VertexAttrib4dNV@36)
- GL_STUB(VertexAttrib4dvNV, 779, VertexAttrib4dvNV@8)
- GL_STUB(VertexAttrib4fNV, 780, VertexAttrib4fNV@20)
- GL_STUB(VertexAttrib4fvNV, 781, VertexAttrib4fvNV@8)
- GL_STUB(VertexAttrib4sNV, 782, VertexAttrib4sNV@20)
- GL_STUB(VertexAttrib4svNV, 783, VertexAttrib4svNV@8)
- GL_STUB(VertexAttrib4ubNV, 784, VertexAttrib4ubNV@20)
- GL_STUB(VertexAttrib4ubvNV, 785, VertexAttrib4ubvNV@8)
- GL_STUB(VertexAttribPointerNV, 786, VertexAttribPointerNV@20)
- GL_STUB(VertexAttribs1dvNV, 787, VertexAttribs1dvNV@12)
- GL_STUB(VertexAttribs1fvNV, 788, VertexAttribs1fvNV@12)
- GL_STUB(VertexAttribs1svNV, 789, VertexAttribs1svNV@12)
- GL_STUB(VertexAttribs2dvNV, 790, VertexAttribs2dvNV@12)
- GL_STUB(VertexAttribs2fvNV, 791, VertexAttribs2fvNV@12)
- GL_STUB(VertexAttribs2svNV, 792, VertexAttribs2svNV@12)
- GL_STUB(VertexAttribs3dvNV, 793, VertexAttribs3dvNV@12)
- GL_STUB(VertexAttribs3fvNV, 794, VertexAttribs3fvNV@12)
- GL_STUB(VertexAttribs3svNV, 795, VertexAttribs3svNV@12)
- GL_STUB(VertexAttribs4dvNV, 796, VertexAttribs4dvNV@12)
- GL_STUB(VertexAttribs4fvNV, 797, VertexAttribs4fvNV@12)
- GL_STUB(VertexAttribs4svNV, 798, VertexAttribs4svNV@12)
- GL_STUB(VertexAttribs4ubvNV, 799, VertexAttribs4ubvNV@12)
- GL_STUB(GetTexBumpParameterfvATI, 800, GetTexBumpParameterfvATI@8)
- GL_STUB(GetTexBumpParameterivATI, 801, GetTexBumpParameterivATI@8)
- GL_STUB(TexBumpParameterfvATI, 802, TexBumpParameterfvATI@8)
- GL_STUB(TexBumpParameterivATI, 803, TexBumpParameterivATI@8)
- GL_STUB(AlphaFragmentOp1ATI, 804, AlphaFragmentOp1ATI@24)
- GL_STUB(AlphaFragmentOp2ATI, 805, AlphaFragmentOp2ATI@36)
- GL_STUB(AlphaFragmentOp3ATI, 806, AlphaFragmentOp3ATI@48)
- GL_STUB(BeginFragmentShaderATI, 807, BeginFragmentShaderATI@0)
- GL_STUB(BindFragmentShaderATI, 808, BindFragmentShaderATI@4)
- GL_STUB(ColorFragmentOp1ATI, 809, ColorFragmentOp1ATI@28)
- GL_STUB(ColorFragmentOp2ATI, 810, ColorFragmentOp2ATI@40)
- GL_STUB(ColorFragmentOp3ATI, 811, ColorFragmentOp3ATI@52)
- GL_STUB(DeleteFragmentShaderATI, 812, DeleteFragmentShaderATI@4)
- GL_STUB(EndFragmentShaderATI, 813, EndFragmentShaderATI@0)
- GL_STUB(GenFragmentShadersATI, 814, GenFragmentShadersATI@4)
- GL_STUB(PassTexCoordATI, 815, PassTexCoordATI@12)
- GL_STUB(SampleMapATI, 816, SampleMapATI@12)
- GL_STUB(SetFragmentShaderConstantATI, 817, SetFragmentShaderConstantATI@8)
- GL_STUB(PointParameteriNV, 818, PointParameteriNV@8)
- GL_STUB(PointParameterivNV, 819, PointParameterivNV@8)
- GL_STUB(_dispatch_stub_820, 820, _dispatch_stub_820@4)
- HIDDEN(GL_PREFIX(_dispatch_stub_820, _dispatch_stub_820@4))
- GL_STUB(_dispatch_stub_821, 821, _dispatch_stub_821@4)
- HIDDEN(GL_PREFIX(_dispatch_stub_821, _dispatch_stub_821@4))
- GL_STUB(_dispatch_stub_822, 822, _dispatch_stub_822@8)
- HIDDEN(GL_PREFIX(_dispatch_stub_822, _dispatch_stub_822@8))
- GL_STUB(_dispatch_stub_823, 823, _dispatch_stub_823@8)
- HIDDEN(GL_PREFIX(_dispatch_stub_823, _dispatch_stub_823@8))
- GL_STUB(_dispatch_stub_824, 824, _dispatch_stub_824@4)
- HIDDEN(GL_PREFIX(_dispatch_stub_824, _dispatch_stub_824@4))
- GL_STUB(GetProgramNamedParameterdvNV, 825, GetProgramNamedParameterdvNV@16)
- GL_STUB(GetProgramNamedParameterfvNV, 826, GetProgramNamedParameterfvNV@16)
- GL_STUB(ProgramNamedParameter4dNV, 827, ProgramNamedParameter4dNV@44)
- GL_STUB(ProgramNamedParameter4dvNV, 828, ProgramNamedParameter4dvNV@16)
- GL_STUB(ProgramNamedParameter4fNV, 829, ProgramNamedParameter4fNV@28)
- GL_STUB(ProgramNamedParameter4fvNV, 830, ProgramNamedParameter4fvNV@16)
- GL_STUB(PrimitiveRestartIndexNV, 831, PrimitiveRestartIndexNV@4)
- GL_STUB(PrimitiveRestartNV, 832, PrimitiveRestartNV@0)
- GL_STUB(_dispatch_stub_833, 833, _dispatch_stub_833@16)
- HIDDEN(GL_PREFIX(_dispatch_stub_833, _dispatch_stub_833@16))
- GL_STUB(_dispatch_stub_834, 834, _dispatch_stub_834@8)
- HIDDEN(GL_PREFIX(_dispatch_stub_834, _dispatch_stub_834@8))
- GL_STUB(BindFramebufferEXT, 835, BindFramebufferEXT@8)
- GL_STUB(BindRenderbufferEXT, 836, BindRenderbufferEXT@8)
- GL_STUB(CheckFramebufferStatusEXT, 837, CheckFramebufferStatusEXT@4)
- GL_STUB(DeleteFramebuffersEXT, 838, DeleteFramebuffersEXT@8)
- GL_STUB(DeleteRenderbuffersEXT, 839, DeleteRenderbuffersEXT@8)
- GL_STUB(FramebufferRenderbufferEXT, 840, FramebufferRenderbufferEXT@16)
- GL_STUB(FramebufferTexture1DEXT, 841, FramebufferTexture1DEXT@20)
- GL_STUB(FramebufferTexture2DEXT, 842, FramebufferTexture2DEXT@20)
- GL_STUB(FramebufferTexture3DEXT, 843, FramebufferTexture3DEXT@24)
- GL_STUB(GenFramebuffersEXT, 844, GenFramebuffersEXT@8)
- GL_STUB(GenRenderbuffersEXT, 845, GenRenderbuffersEXT@8)
- GL_STUB(GenerateMipmapEXT, 846, GenerateMipmapEXT@4)
- GL_STUB(GetFramebufferAttachmentParameterivEXT, 847, GetFramebufferAttachmentParameterivEXT@16)
- GL_STUB(GetRenderbufferParameterivEXT, 848, GetRenderbufferParameterivEXT@12)
- GL_STUB(IsFramebufferEXT, 849, IsFramebufferEXT@4)
- GL_STUB(IsRenderbufferEXT, 850, IsRenderbufferEXT@4)
- GL_STUB(RenderbufferStorageEXT, 851, RenderbufferStorageEXT@16)
- GL_STUB(_dispatch_stub_852, 852, _dispatch_stub_852@40)
- HIDDEN(GL_PREFIX(_dispatch_stub_852, _dispatch_stub_852@40))
- GL_STUB(_dispatch_stub_853, 853, _dispatch_stub_853@12)
- HIDDEN(GL_PREFIX(_dispatch_stub_853, _dispatch_stub_853@12))
- GL_STUB(_dispatch_stub_854, 854, _dispatch_stub_854@12)
- HIDDEN(GL_PREFIX(_dispatch_stub_854, _dispatch_stub_854@12))
- GL_STUB(BindFragDataLocationEXT, 855, BindFragDataLocationEXT@12)
- GL_STUB(GetFragDataLocationEXT, 856, GetFragDataLocationEXT@8)
- GL_STUB(GetUniformuivEXT, 857, GetUniformuivEXT@12)
- GL_STUB(GetVertexAttribIivEXT, 858, GetVertexAttribIivEXT@12)
- GL_STUB(GetVertexAttribIuivEXT, 859, GetVertexAttribIuivEXT@12)
- GL_STUB(Uniform1uiEXT, 860, Uniform1uiEXT@8)
- GL_STUB(Uniform1uivEXT, 861, Uniform1uivEXT@12)
- GL_STUB(Uniform2uiEXT, 862, Uniform2uiEXT@12)
- GL_STUB(Uniform2uivEXT, 863, Uniform2uivEXT@12)
- GL_STUB(Uniform3uiEXT, 864, Uniform3uiEXT@16)
- GL_STUB(Uniform3uivEXT, 865, Uniform3uivEXT@12)
- GL_STUB(Uniform4uiEXT, 866, Uniform4uiEXT@20)
- GL_STUB(Uniform4uivEXT, 867, Uniform4uivEXT@12)
- GL_STUB(VertexAttribI1iEXT, 868, VertexAttribI1iEXT@8)
- GL_STUB(VertexAttribI1ivEXT, 869, VertexAttribI1ivEXT@8)
- GL_STUB(VertexAttribI1uiEXT, 870, VertexAttribI1uiEXT@8)
- GL_STUB(VertexAttribI1uivEXT, 871, VertexAttribI1uivEXT@8)
- GL_STUB(VertexAttribI2iEXT, 872, VertexAttribI2iEXT@12)
- GL_STUB(VertexAttribI2ivEXT, 873, VertexAttribI2ivEXT@8)
- GL_STUB(VertexAttribI2uiEXT, 874, VertexAttribI2uiEXT@12)
- GL_STUB(VertexAttribI2uivEXT, 875, VertexAttribI2uivEXT@8)
- GL_STUB(VertexAttribI3iEXT, 876, VertexAttribI3iEXT@16)
- GL_STUB(VertexAttribI3ivEXT, 877, VertexAttribI3ivEXT@8)
- GL_STUB(VertexAttribI3uiEXT, 878, VertexAttribI3uiEXT@16)
- GL_STUB(VertexAttribI3uivEXT, 879, VertexAttribI3uivEXT@8)
- GL_STUB(VertexAttribI4bvEXT, 880, VertexAttribI4bvEXT@8)
- GL_STUB(VertexAttribI4iEXT, 881, VertexAttribI4iEXT@20)
- GL_STUB(VertexAttribI4ivEXT, 882, VertexAttribI4ivEXT@8)
- GL_STUB(VertexAttribI4svEXT, 883, VertexAttribI4svEXT@8)
- GL_STUB(VertexAttribI4ubvEXT, 884, VertexAttribI4ubvEXT@8)
- GL_STUB(VertexAttribI4uiEXT, 885, VertexAttribI4uiEXT@20)
- GL_STUB(VertexAttribI4uivEXT, 886, VertexAttribI4uivEXT@8)
- GL_STUB(VertexAttribI4usvEXT, 887, VertexAttribI4usvEXT@8)
- GL_STUB(VertexAttribIPointerEXT, 888, VertexAttribIPointerEXT@20)
- GL_STUB(FramebufferTextureLayerEXT, 889, FramebufferTextureLayerEXT@20)
- GL_STUB(ColorMaskIndexedEXT, 890, ColorMaskIndexedEXT@20)
- GL_STUB(DisableIndexedEXT, 891, DisableIndexedEXT@8)
- GL_STUB(EnableIndexedEXT, 892, EnableIndexedEXT@8)
- GL_STUB(GetBooleanIndexedvEXT, 893, GetBooleanIndexedvEXT@12)
- GL_STUB(GetIntegerIndexedvEXT, 894, GetIntegerIndexedvEXT@12)
- GL_STUB(IsEnabledIndexedEXT, 895, IsEnabledIndexedEXT@8)
- GL_STUB(ClearColorIiEXT, 896, ClearColorIiEXT@16)
- GL_STUB(ClearColorIuiEXT, 897, ClearColorIuiEXT@16)
- GL_STUB(GetTexParameterIivEXT, 898, GetTexParameterIivEXT@12)
- GL_STUB(GetTexParameterIuivEXT, 899, GetTexParameterIuivEXT@12)
- GL_STUB(TexParameterIivEXT, 900, TexParameterIivEXT@12)
- GL_STUB(TexParameterIuivEXT, 901, TexParameterIuivEXT@12)
- GL_STUB(BeginConditionalRenderNV, 902, BeginConditionalRenderNV@8)
- GL_STUB(EndConditionalRenderNV, 903, EndConditionalRenderNV@0)
- GL_STUB(BeginTransformFeedbackEXT, 904, BeginTransformFeedbackEXT@4)
- GL_STUB(BindBufferBaseEXT, 905, BindBufferBaseEXT@12)
- GL_STUB(BindBufferOffsetEXT, 906, BindBufferOffsetEXT@16)
- GL_STUB(BindBufferRangeEXT, 907, BindBufferRangeEXT@20)
- GL_STUB(EndTransformFeedbackEXT, 908, EndTransformFeedbackEXT@0)
- GL_STUB(GetTransformFeedbackVaryingEXT, 909, GetTransformFeedbackVaryingEXT@28)
- GL_STUB(TransformFeedbackVaryingsEXT, 910, TransformFeedbackVaryingsEXT@16)
- GL_STUB(ProvokingVertexEXT, 911, ProvokingVertexEXT@4)
- GL_STUB(_dispatch_stub_912, 912, _dispatch_stub_912@12)
- HIDDEN(GL_PREFIX(_dispatch_stub_912, _dispatch_stub_912@12))
- GL_STUB(_dispatch_stub_913, 913, _dispatch_stub_913@12)
- HIDDEN(GL_PREFIX(_dispatch_stub_913, _dispatch_stub_913@12))
- GL_STUB(GetObjectParameterivAPPLE, 914, GetObjectParameterivAPPLE@16)
- GL_STUB(ObjectPurgeableAPPLE, 915, ObjectPurgeableAPPLE@12)
- GL_STUB(ObjectUnpurgeableAPPLE, 916, ObjectUnpurgeableAPPLE@12)
- GL_STUB(ActiveProgramEXT, 917, ActiveProgramEXT@4)
- GL_STUB(CreateShaderProgramEXT, 918, CreateShaderProgramEXT@8)
- GL_STUB(UseShaderProgramEXT, 919, UseShaderProgramEXT@8)
- GL_STUB(TextureBarrierNV, 920, TextureBarrierNV@0)
- GL_STUB(_dispatch_stub_921, 921, _dispatch_stub_921@16)
- HIDDEN(GL_PREFIX(_dispatch_stub_921, _dispatch_stub_921@16))
- GL_STUB(_dispatch_stub_922, 922, _dispatch_stub_922@16)
- HIDDEN(GL_PREFIX(_dispatch_stub_922, _dispatch_stub_922@16))
- GL_STUB(_dispatch_stub_923, 923, _dispatch_stub_923@16)
- HIDDEN(GL_PREFIX(_dispatch_stub_923, _dispatch_stub_923@16))
- GL_STUB(_dispatch_stub_924, 924, _dispatch_stub_924@12)
- HIDDEN(GL_PREFIX(_dispatch_stub_924, _dispatch_stub_924@12))
- GL_STUB(_dispatch_stub_925, 925, _dispatch_stub_925@12)
- HIDDEN(GL_PREFIX(_dispatch_stub_925, _dispatch_stub_925@12))
- GL_STUB(EGLImageTargetRenderbufferStorageOES, 926, EGLImageTargetRenderbufferStorageOES@8)
- GL_STUB(EGLImageTargetTexture2DOES, 927, EGLImageTargetTexture2DOES@8)
- GL_STUB_ALIAS(ArrayElementEXT, 306, ArrayElementEXT@4, ArrayElement, ArrayElement@4)
- GL_STUB_ALIAS(BindTextureEXT, 307, BindTextureEXT@8, BindTexture, BindTexture@8)
- GL_STUB_ALIAS(DrawArraysEXT, 310, DrawArraysEXT@12, DrawArrays, DrawArrays@12)
-#ifndef GLX_INDIRECT_RENDERING
- GL_STUB_ALIAS(AreTexturesResidentEXT, 322, AreTexturesResidentEXT@12, AreTexturesResident, AreTexturesResident@12)
-#endif
- GL_STUB_ALIAS(CopyTexImage1DEXT, 323, CopyTexImage1DEXT@28, CopyTexImage1D, CopyTexImage1D@28)
- GL_STUB_ALIAS(CopyTexImage2DEXT, 324, CopyTexImage2DEXT@32, CopyTexImage2D, CopyTexImage2D@32)
- GL_STUB_ALIAS(CopyTexSubImage1DEXT, 325, CopyTexSubImage1DEXT@24, CopyTexSubImage1D, CopyTexSubImage1D@24)
- GL_STUB_ALIAS(CopyTexSubImage2DEXT, 326, CopyTexSubImage2DEXT@32, CopyTexSubImage2D, CopyTexSubImage2D@32)
-#ifndef GLX_INDIRECT_RENDERING
- GL_STUB_ALIAS(DeleteTexturesEXT, 327, DeleteTexturesEXT@8, DeleteTextures, DeleteTextures@8)
-#endif
-#ifndef GLX_INDIRECT_RENDERING
- GL_STUB_ALIAS(GenTexturesEXT, 328, GenTexturesEXT@8, GenTextures, GenTextures@8)
-#endif
- GL_STUB_ALIAS(GetPointervEXT, 329, GetPointervEXT@8, GetPointerv, GetPointerv@8)
-#ifndef GLX_INDIRECT_RENDERING
- GL_STUB_ALIAS(IsTextureEXT, 330, IsTextureEXT@4, IsTexture, IsTexture@4)
-#endif
- GL_STUB_ALIAS(PrioritizeTexturesEXT, 331, PrioritizeTexturesEXT@12, PrioritizeTextures, PrioritizeTextures@12)
- GL_STUB_ALIAS(TexSubImage1DEXT, 332, TexSubImage1DEXT@28, TexSubImage1D, TexSubImage1D@28)
- GL_STUB_ALIAS(TexSubImage2DEXT, 333, TexSubImage2DEXT@36, TexSubImage2D, TexSubImage2D@36)
- GL_STUB_ALIAS(BlendColorEXT, 336, BlendColorEXT@16, BlendColor, BlendColor@16)
- GL_STUB_ALIAS(BlendEquationEXT, 337, BlendEquationEXT@4, BlendEquation, BlendEquation@4)
- GL_STUB_ALIAS(DrawRangeElementsEXT, 338, DrawRangeElementsEXT@24, DrawRangeElements, DrawRangeElements@24)
- GL_STUB_ALIAS(ColorTableEXT, 339, ColorTableEXT@24, ColorTable, ColorTable@24)
-#ifndef GLX_INDIRECT_RENDERING
- GL_STUB_ALIAS(GetColorTableEXT, 343, GetColorTableEXT@16, GetColorTable, GetColorTable@16)
-#endif
-#ifndef GLX_INDIRECT_RENDERING
- GL_STUB_ALIAS(GetColorTableParameterfvEXT, 344, GetColorTableParameterfvEXT@12, GetColorTableParameterfv, GetColorTableParameterfv@12)
-#endif
-#ifndef GLX_INDIRECT_RENDERING
- GL_STUB_ALIAS(GetColorTableParameterivEXT, 345, GetColorTableParameterivEXT@12, GetColorTableParameteriv, GetColorTableParameteriv@12)
-#endif
- GL_STUB_ALIAS(TexImage3DEXT, 371, TexImage3DEXT@40, TexImage3D, TexImage3D@40)
- GL_STUB_ALIAS(TexSubImage3DEXT, 372, TexSubImage3DEXT@44, TexSubImage3D, TexSubImage3D@44)
- GL_STUB_ALIAS(CopyTexSubImage3DEXT, 373, CopyTexSubImage3DEXT@36, CopyTexSubImage3D, CopyTexSubImage3D@36)
- GL_STUB_ALIAS(ActiveTexture, 374, ActiveTexture@4, ActiveTextureARB, ActiveTextureARB@4)
- GL_STUB_ALIAS(ClientActiveTexture, 375, ClientActiveTexture@4, ClientActiveTextureARB, ClientActiveTextureARB@4)
- GL_STUB_ALIAS(MultiTexCoord1d, 376, MultiTexCoord1d@12, MultiTexCoord1dARB, MultiTexCoord1dARB@12)
- GL_STUB_ALIAS(MultiTexCoord1dv, 377, MultiTexCoord1dv@8, MultiTexCoord1dvARB, MultiTexCoord1dvARB@8)
- GL_STUB_ALIAS(MultiTexCoord1f, 378, MultiTexCoord1f@8, MultiTexCoord1fARB, MultiTexCoord1fARB@8)
- GL_STUB_ALIAS(MultiTexCoord1fv, 379, MultiTexCoord1fv@8, MultiTexCoord1fvARB, MultiTexCoord1fvARB@8)
- GL_STUB_ALIAS(MultiTexCoord1i, 380, MultiTexCoord1i@8, MultiTexCoord1iARB, MultiTexCoord1iARB@8)
- GL_STUB_ALIAS(MultiTexCoord1iv, 381, MultiTexCoord1iv@8, MultiTexCoord1ivARB, MultiTexCoord1ivARB@8)
- GL_STUB_ALIAS(MultiTexCoord1s, 382, MultiTexCoord1s@8, MultiTexCoord1sARB, MultiTexCoord1sARB@8)
- GL_STUB_ALIAS(MultiTexCoord1sv, 383, MultiTexCoord1sv@8, MultiTexCoord1svARB, MultiTexCoord1svARB@8)
- GL_STUB_ALIAS(MultiTexCoord2d, 384, MultiTexCoord2d@20, MultiTexCoord2dARB, MultiTexCoord2dARB@20)
- GL_STUB_ALIAS(MultiTexCoord2dv, 385, MultiTexCoord2dv@8, MultiTexCoord2dvARB, MultiTexCoord2dvARB@8)
- GL_STUB_ALIAS(MultiTexCoord2f, 386, MultiTexCoord2f@12, MultiTexCoord2fARB, MultiTexCoord2fARB@12)
- GL_STUB_ALIAS(MultiTexCoord2fv, 387, MultiTexCoord2fv@8, MultiTexCoord2fvARB, MultiTexCoord2fvARB@8)
- GL_STUB_ALIAS(MultiTexCoord2i, 388, MultiTexCoord2i@12, MultiTexCoord2iARB, MultiTexCoord2iARB@12)
- GL_STUB_ALIAS(MultiTexCoord2iv, 389, MultiTexCoord2iv@8, MultiTexCoord2ivARB, MultiTexCoord2ivARB@8)
- GL_STUB_ALIAS(MultiTexCoord2s, 390, MultiTexCoord2s@12, MultiTexCoord2sARB, MultiTexCoord2sARB@12)
- GL_STUB_ALIAS(MultiTexCoord2sv, 391, MultiTexCoord2sv@8, MultiTexCoord2svARB, MultiTexCoord2svARB@8)
- GL_STUB_ALIAS(MultiTexCoord3d, 392, MultiTexCoord3d@28, MultiTexCoord3dARB, MultiTexCoord3dARB@28)
- GL_STUB_ALIAS(MultiTexCoord3dv, 393, MultiTexCoord3dv@8, MultiTexCoord3dvARB, MultiTexCoord3dvARB@8)
- GL_STUB_ALIAS(MultiTexCoord3f, 394, MultiTexCoord3f@16, MultiTexCoord3fARB, MultiTexCoord3fARB@16)
- GL_STUB_ALIAS(MultiTexCoord3fv, 395, MultiTexCoord3fv@8, MultiTexCoord3fvARB, MultiTexCoord3fvARB@8)
- GL_STUB_ALIAS(MultiTexCoord3i, 396, MultiTexCoord3i@16, MultiTexCoord3iARB, MultiTexCoord3iARB@16)
- GL_STUB_ALIAS(MultiTexCoord3iv, 397, MultiTexCoord3iv@8, MultiTexCoord3ivARB, MultiTexCoord3ivARB@8)
- GL_STUB_ALIAS(MultiTexCoord3s, 398, MultiTexCoord3s@16, MultiTexCoord3sARB, MultiTexCoord3sARB@16)
- GL_STUB_ALIAS(MultiTexCoord3sv, 399, MultiTexCoord3sv@8, MultiTexCoord3svARB, MultiTexCoord3svARB@8)
- GL_STUB_ALIAS(MultiTexCoord4d, 400, MultiTexCoord4d@36, MultiTexCoord4dARB, MultiTexCoord4dARB@36)
- GL_STUB_ALIAS(MultiTexCoord4dv, 401, MultiTexCoord4dv@8, MultiTexCoord4dvARB, MultiTexCoord4dvARB@8)
- GL_STUB_ALIAS(MultiTexCoord4f, 402, MultiTexCoord4f@20, MultiTexCoord4fARB, MultiTexCoord4fARB@20)
- GL_STUB_ALIAS(MultiTexCoord4fv, 403, MultiTexCoord4fv@8, MultiTexCoord4fvARB, MultiTexCoord4fvARB@8)
- GL_STUB_ALIAS(MultiTexCoord4i, 404, MultiTexCoord4i@20, MultiTexCoord4iARB, MultiTexCoord4iARB@20)
- GL_STUB_ALIAS(MultiTexCoord4iv, 405, MultiTexCoord4iv@8, MultiTexCoord4ivARB, MultiTexCoord4ivARB@8)
- GL_STUB_ALIAS(MultiTexCoord4s, 406, MultiTexCoord4s@20, MultiTexCoord4sARB, MultiTexCoord4sARB@20)
- GL_STUB_ALIAS(MultiTexCoord4sv, 407, MultiTexCoord4sv@8, MultiTexCoord4svARB, MultiTexCoord4svARB@8)
- GL_STUB_ALIAS(LoadTransposeMatrixd, 441, LoadTransposeMatrixd@4, LoadTransposeMatrixdARB, LoadTransposeMatrixdARB@4)
- GL_STUB_ALIAS(LoadTransposeMatrixf, 442, LoadTransposeMatrixf@4, LoadTransposeMatrixfARB, LoadTransposeMatrixfARB@4)
- GL_STUB_ALIAS(MultTransposeMatrixd, 443, MultTransposeMatrixd@4, MultTransposeMatrixdARB, MultTransposeMatrixdARB@4)
- GL_STUB_ALIAS(MultTransposeMatrixf, 444, MultTransposeMatrixf@4, MultTransposeMatrixfARB, MultTransposeMatrixfARB@4)
- GL_STUB_ALIAS(SampleCoverage, 445, SampleCoverage@8, SampleCoverageARB, SampleCoverageARB@8)
- GL_STUB_ALIAS(CompressedTexImage1D, 446, CompressedTexImage1D@28, CompressedTexImage1DARB, CompressedTexImage1DARB@28)
- GL_STUB_ALIAS(CompressedTexImage2D, 447, CompressedTexImage2D@32, CompressedTexImage2DARB, CompressedTexImage2DARB@32)
- GL_STUB_ALIAS(CompressedTexImage3D, 448, CompressedTexImage3D@36, CompressedTexImage3DARB, CompressedTexImage3DARB@36)
- GL_STUB_ALIAS(CompressedTexSubImage1D, 449, CompressedTexSubImage1D@28, CompressedTexSubImage1DARB, CompressedTexSubImage1DARB@28)
- GL_STUB_ALIAS(CompressedTexSubImage2D, 450, CompressedTexSubImage2D@36, CompressedTexSubImage2DARB, CompressedTexSubImage2DARB@36)
- GL_STUB_ALIAS(CompressedTexSubImage3D, 451, CompressedTexSubImage3D@44, CompressedTexSubImage3DARB, CompressedTexSubImage3DARB@44)
- GL_STUB_ALIAS(GetCompressedTexImage, 452, GetCompressedTexImage@12, GetCompressedTexImageARB, GetCompressedTexImageARB@12)
- GL_STUB_ALIAS(DisableVertexAttribArray, 453, DisableVertexAttribArray@4, DisableVertexAttribArrayARB, DisableVertexAttribArrayARB@4)
- GL_STUB_ALIAS(EnableVertexAttribArray, 454, EnableVertexAttribArray@4, EnableVertexAttribArrayARB, EnableVertexAttribArrayARB@4)
- GL_STUB_ALIAS(GetVertexAttribdv, 461, GetVertexAttribdv@12, GetVertexAttribdvARB, GetVertexAttribdvARB@12)
- GL_STUB_ALIAS(GetVertexAttribfv, 462, GetVertexAttribfv@12, GetVertexAttribfvARB, GetVertexAttribfvARB@12)
- GL_STUB_ALIAS(GetVertexAttribiv, 463, GetVertexAttribiv@12, GetVertexAttribivARB, GetVertexAttribivARB@12)
- GL_STUB_ALIAS(ProgramParameter4dNV, 464, ProgramParameter4dNV@40, ProgramEnvParameter4dARB, ProgramEnvParameter4dARB@40)
- GL_STUB_ALIAS(ProgramParameter4dvNV, 465, ProgramParameter4dvNV@12, ProgramEnvParameter4dvARB, ProgramEnvParameter4dvARB@12)
- GL_STUB_ALIAS(ProgramParameter4fNV, 466, ProgramParameter4fNV@24, ProgramEnvParameter4fARB, ProgramEnvParameter4fARB@24)
- GL_STUB_ALIAS(ProgramParameter4fvNV, 467, ProgramParameter4fvNV@12, ProgramEnvParameter4fvARB, ProgramEnvParameter4fvARB@12)
- GL_STUB_ALIAS(VertexAttrib1d, 473, VertexAttrib1d@12, VertexAttrib1dARB, VertexAttrib1dARB@12)
- GL_STUB_ALIAS(VertexAttrib1dv, 474, VertexAttrib1dv@8, VertexAttrib1dvARB, VertexAttrib1dvARB@8)
- GL_STUB_ALIAS(VertexAttrib1f, 475, VertexAttrib1f@8, VertexAttrib1fARB, VertexAttrib1fARB@8)
- GL_STUB_ALIAS(VertexAttrib1fv, 476, VertexAttrib1fv@8, VertexAttrib1fvARB, VertexAttrib1fvARB@8)
- GL_STUB_ALIAS(VertexAttrib1s, 477, VertexAttrib1s@8, VertexAttrib1sARB, VertexAttrib1sARB@8)
- GL_STUB_ALIAS(VertexAttrib1sv, 478, VertexAttrib1sv@8, VertexAttrib1svARB, VertexAttrib1svARB@8)
- GL_STUB_ALIAS(VertexAttrib2d, 479, VertexAttrib2d@20, VertexAttrib2dARB, VertexAttrib2dARB@20)
- GL_STUB_ALIAS(VertexAttrib2dv, 480, VertexAttrib2dv@8, VertexAttrib2dvARB, VertexAttrib2dvARB@8)
- GL_STUB_ALIAS(VertexAttrib2f, 481, VertexAttrib2f@12, VertexAttrib2fARB, VertexAttrib2fARB@12)
- GL_STUB_ALIAS(VertexAttrib2fv, 482, VertexAttrib2fv@8, VertexAttrib2fvARB, VertexAttrib2fvARB@8)
- GL_STUB_ALIAS(VertexAttrib2s, 483, VertexAttrib2s@12, VertexAttrib2sARB, VertexAttrib2sARB@12)
- GL_STUB_ALIAS(VertexAttrib2sv, 484, VertexAttrib2sv@8, VertexAttrib2svARB, VertexAttrib2svARB@8)
- GL_STUB_ALIAS(VertexAttrib3d, 485, VertexAttrib3d@28, VertexAttrib3dARB, VertexAttrib3dARB@28)
- GL_STUB_ALIAS(VertexAttrib3dv, 486, VertexAttrib3dv@8, VertexAttrib3dvARB, VertexAttrib3dvARB@8)
- GL_STUB_ALIAS(VertexAttrib3f, 487, VertexAttrib3f@16, VertexAttrib3fARB, VertexAttrib3fARB@16)
- GL_STUB_ALIAS(VertexAttrib3fv, 488, VertexAttrib3fv@8, VertexAttrib3fvARB, VertexAttrib3fvARB@8)
- GL_STUB_ALIAS(VertexAttrib3s, 489, VertexAttrib3s@16, VertexAttrib3sARB, VertexAttrib3sARB@16)
- GL_STUB_ALIAS(VertexAttrib3sv, 490, VertexAttrib3sv@8, VertexAttrib3svARB, VertexAttrib3svARB@8)
- GL_STUB_ALIAS(VertexAttrib4Nbv, 491, VertexAttrib4Nbv@8, VertexAttrib4NbvARB, VertexAttrib4NbvARB@8)
- GL_STUB_ALIAS(VertexAttrib4Niv, 492, VertexAttrib4Niv@8, VertexAttrib4NivARB, VertexAttrib4NivARB@8)
- GL_STUB_ALIAS(VertexAttrib4Nsv, 493, VertexAttrib4Nsv@8, VertexAttrib4NsvARB, VertexAttrib4NsvARB@8)
- GL_STUB_ALIAS(VertexAttrib4Nub, 494, VertexAttrib4Nub@20, VertexAttrib4NubARB, VertexAttrib4NubARB@20)
- GL_STUB_ALIAS(VertexAttrib4Nubv, 495, VertexAttrib4Nubv@8, VertexAttrib4NubvARB, VertexAttrib4NubvARB@8)
- GL_STUB_ALIAS(VertexAttrib4Nuiv, 496, VertexAttrib4Nuiv@8, VertexAttrib4NuivARB, VertexAttrib4NuivARB@8)
- GL_STUB_ALIAS(VertexAttrib4Nusv, 497, VertexAttrib4Nusv@8, VertexAttrib4NusvARB, VertexAttrib4NusvARB@8)
- GL_STUB_ALIAS(VertexAttrib4bv, 498, VertexAttrib4bv@8, VertexAttrib4bvARB, VertexAttrib4bvARB@8)
- GL_STUB_ALIAS(VertexAttrib4d, 499, VertexAttrib4d@36, VertexAttrib4dARB, VertexAttrib4dARB@36)
- GL_STUB_ALIAS(VertexAttrib4dv, 500, VertexAttrib4dv@8, VertexAttrib4dvARB, VertexAttrib4dvARB@8)
- GL_STUB_ALIAS(VertexAttrib4f, 501, VertexAttrib4f@20, VertexAttrib4fARB, VertexAttrib4fARB@20)
- GL_STUB_ALIAS(VertexAttrib4fv, 502, VertexAttrib4fv@8, VertexAttrib4fvARB, VertexAttrib4fvARB@8)
- GL_STUB_ALIAS(VertexAttrib4iv, 503, VertexAttrib4iv@8, VertexAttrib4ivARB, VertexAttrib4ivARB@8)
- GL_STUB_ALIAS(VertexAttrib4s, 504, VertexAttrib4s@20, VertexAttrib4sARB, VertexAttrib4sARB@20)
- GL_STUB_ALIAS(VertexAttrib4sv, 505, VertexAttrib4sv@8, VertexAttrib4svARB, VertexAttrib4svARB@8)
- GL_STUB_ALIAS(VertexAttrib4ubv, 506, VertexAttrib4ubv@8, VertexAttrib4ubvARB, VertexAttrib4ubvARB@8)
- GL_STUB_ALIAS(VertexAttrib4uiv, 507, VertexAttrib4uiv@8, VertexAttrib4uivARB, VertexAttrib4uivARB@8)
- GL_STUB_ALIAS(VertexAttrib4usv, 508, VertexAttrib4usv@8, VertexAttrib4usvARB, VertexAttrib4usvARB@8)
- GL_STUB_ALIAS(VertexAttribPointer, 509, VertexAttribPointer@24, VertexAttribPointerARB, VertexAttribPointerARB@24)
- GL_STUB_ALIAS(BindBuffer, 510, BindBuffer@8, BindBufferARB, BindBufferARB@8)
- GL_STUB_ALIAS(BufferData, 511, BufferData@16, BufferDataARB, BufferDataARB@16)
- GL_STUB_ALIAS(BufferSubData, 512, BufferSubData@16, BufferSubDataARB, BufferSubDataARB@16)
- GL_STUB_ALIAS(DeleteBuffers, 513, DeleteBuffers@8, DeleteBuffersARB, DeleteBuffersARB@8)
- GL_STUB_ALIAS(GenBuffers, 514, GenBuffers@8, GenBuffersARB, GenBuffersARB@8)
- GL_STUB_ALIAS(GetBufferParameteriv, 515, GetBufferParameteriv@12, GetBufferParameterivARB, GetBufferParameterivARB@12)
- GL_STUB_ALIAS(GetBufferPointerv, 516, GetBufferPointerv@12, GetBufferPointervARB, GetBufferPointervARB@12)
- GL_STUB_ALIAS(GetBufferSubData, 517, GetBufferSubData@16, GetBufferSubDataARB, GetBufferSubDataARB@16)
- GL_STUB_ALIAS(IsBuffer, 518, IsBuffer@4, IsBufferARB, IsBufferARB@4)
- GL_STUB_ALIAS(MapBuffer, 519, MapBuffer@8, MapBufferARB, MapBufferARB@8)
- GL_STUB_ALIAS(UnmapBuffer, 520, UnmapBuffer@4, UnmapBufferARB, UnmapBufferARB@4)
- GL_STUB_ALIAS(BeginQuery, 521, BeginQuery@8, BeginQueryARB, BeginQueryARB@8)
- GL_STUB_ALIAS(DeleteQueries, 522, DeleteQueries@8, DeleteQueriesARB, DeleteQueriesARB@8)
- GL_STUB_ALIAS(EndQuery, 523, EndQuery@4, EndQueryARB, EndQueryARB@4)
- GL_STUB_ALIAS(GenQueries, 524, GenQueries@8, GenQueriesARB, GenQueriesARB@8)
- GL_STUB_ALIAS(GetQueryObjectiv, 525, GetQueryObjectiv@12, GetQueryObjectivARB, GetQueryObjectivARB@12)
- GL_STUB_ALIAS(GetQueryObjectuiv, 526, GetQueryObjectuiv@12, GetQueryObjectuivARB, GetQueryObjectuivARB@12)
- GL_STUB_ALIAS(GetQueryiv, 527, GetQueryiv@12, GetQueryivARB, GetQueryivARB@12)
- GL_STUB_ALIAS(IsQuery, 528, IsQuery@4, IsQueryARB, IsQueryARB@4)
- GL_STUB_ALIAS(CompileShader, 530, CompileShader@4, CompileShaderARB, CompileShaderARB@4)
- GL_STUB_ALIAS(GetActiveUniform, 535, GetActiveUniform@28, GetActiveUniformARB, GetActiveUniformARB@28)
- GL_STUB_ALIAS(GetShaderSource, 541, GetShaderSource@16, GetShaderSourceARB, GetShaderSourceARB@16)
- GL_STUB_ALIAS(GetUniformLocation, 542, GetUniformLocation@8, GetUniformLocationARB, GetUniformLocationARB@8)
- GL_STUB_ALIAS(GetUniformfv, 543, GetUniformfv@12, GetUniformfvARB, GetUniformfvARB@12)
- GL_STUB_ALIAS(GetUniformiv, 544, GetUniformiv@12, GetUniformivARB, GetUniformivARB@12)
- GL_STUB_ALIAS(LinkProgram, 545, LinkProgram@4, LinkProgramARB, LinkProgramARB@4)
- GL_STUB_ALIAS(ShaderSource, 546, ShaderSource@16, ShaderSourceARB, ShaderSourceARB@16)
- GL_STUB_ALIAS(Uniform1f, 547, Uniform1f@8, Uniform1fARB, Uniform1fARB@8)
- GL_STUB_ALIAS(Uniform1fv, 548, Uniform1fv@12, Uniform1fvARB, Uniform1fvARB@12)
- GL_STUB_ALIAS(Uniform1i, 549, Uniform1i@8, Uniform1iARB, Uniform1iARB@8)
- GL_STUB_ALIAS(Uniform1iv, 550, Uniform1iv@12, Uniform1ivARB, Uniform1ivARB@12)
- GL_STUB_ALIAS(Uniform2f, 551, Uniform2f@12, Uniform2fARB, Uniform2fARB@12)
- GL_STUB_ALIAS(Uniform2fv, 552, Uniform2fv@12, Uniform2fvARB, Uniform2fvARB@12)
- GL_STUB_ALIAS(Uniform2i, 553, Uniform2i@12, Uniform2iARB, Uniform2iARB@12)
- GL_STUB_ALIAS(Uniform2iv, 554, Uniform2iv@12, Uniform2ivARB, Uniform2ivARB@12)
- GL_STUB_ALIAS(Uniform3f, 555, Uniform3f@16, Uniform3fARB, Uniform3fARB@16)
- GL_STUB_ALIAS(Uniform3fv, 556, Uniform3fv@12, Uniform3fvARB, Uniform3fvARB@12)
- GL_STUB_ALIAS(Uniform3i, 557, Uniform3i@16, Uniform3iARB, Uniform3iARB@16)
- GL_STUB_ALIAS(Uniform3iv, 558, Uniform3iv@12, Uniform3ivARB, Uniform3ivARB@12)
- GL_STUB_ALIAS(Uniform4f, 559, Uniform4f@20, Uniform4fARB, Uniform4fARB@20)
- GL_STUB_ALIAS(Uniform4fv, 560, Uniform4fv@12, Uniform4fvARB, Uniform4fvARB@12)
- GL_STUB_ALIAS(Uniform4i, 561, Uniform4i@20, Uniform4iARB, Uniform4iARB@20)
- GL_STUB_ALIAS(Uniform4iv, 562, Uniform4iv@12, Uniform4ivARB, Uniform4ivARB@12)
- GL_STUB_ALIAS(UniformMatrix2fv, 563, UniformMatrix2fv@16, UniformMatrix2fvARB, UniformMatrix2fvARB@16)
- GL_STUB_ALIAS(UniformMatrix3fv, 564, UniformMatrix3fv@16, UniformMatrix3fvARB, UniformMatrix3fvARB@16)
- GL_STUB_ALIAS(UniformMatrix4fv, 565, UniformMatrix4fv@16, UniformMatrix4fvARB, UniformMatrix4fvARB@16)
- GL_STUB_ALIAS(UseProgram, 566, UseProgram@4, UseProgramObjectARB, UseProgramObjectARB@4)
- GL_STUB_ALIAS(ValidateProgram, 567, ValidateProgram@4, ValidateProgramARB, ValidateProgramARB@4)
- GL_STUB_ALIAS(BindAttribLocation, 568, BindAttribLocation@12, BindAttribLocationARB, BindAttribLocationARB@12)
- GL_STUB_ALIAS(GetActiveAttrib, 569, GetActiveAttrib@28, GetActiveAttribARB, GetActiveAttribARB@28)
- GL_STUB_ALIAS(GetAttribLocation, 570, GetAttribLocation@8, GetAttribLocationARB, GetAttribLocationARB@8)
- GL_STUB_ALIAS(DrawBuffers, 571, DrawBuffers@8, DrawBuffersARB, DrawBuffersARB@8)
- GL_STUB_ALIAS(DrawBuffersATI, 571, DrawBuffersATI@8, DrawBuffersARB, DrawBuffersARB@8)
- GL_STUB_ALIAS(DrawArraysInstancedEXT, 573, DrawArraysInstancedEXT@16, DrawArraysInstancedARB, DrawArraysInstancedARB@16)
- GL_STUB_ALIAS(DrawArraysInstanced, 573, DrawArraysInstanced@16, DrawArraysInstancedARB, DrawArraysInstancedARB@16)
- GL_STUB_ALIAS(DrawElementsInstancedEXT, 574, DrawElementsInstancedEXT@20, DrawElementsInstancedARB, DrawElementsInstancedARB@20)
- GL_STUB_ALIAS(DrawElementsInstanced, 574, DrawElementsInstanced@20, DrawElementsInstancedARB, DrawElementsInstancedARB@20)
- GL_STUB_ALIAS(RenderbufferStorageMultisampleEXT, 575, RenderbufferStorageMultisampleEXT@20, RenderbufferStorageMultisample, RenderbufferStorageMultisample@20)
- GL_STUB_ALIAS(BlendEquationSeparateIndexedAMD, 596, BlendEquationSeparateIndexedAMD@12, BlendEquationSeparateiARB, BlendEquationSeparateiARB@12)
- GL_STUB_ALIAS(BlendEquationIndexedAMD, 597, BlendEquationIndexedAMD@8, BlendEquationiARB, BlendEquationiARB@8)
- GL_STUB_ALIAS(BlendFuncSeparateIndexedAMD, 598, BlendFuncSeparateIndexedAMD@20, BlendFuncSeparateiARB, BlendFuncSeparateiARB@20)
- GL_STUB_ALIAS(BlendFuncIndexedAMD, 599, BlendFuncIndexedAMD@12, BlendFunciARB, BlendFunciARB@12)
- GL_STUB_ALIAS(PointParameterf, 661, PointParameterf@8, PointParameterfEXT, PointParameterfEXT@8)
- GL_STUB_ALIAS(PointParameterfARB, 661, PointParameterfARB@8, PointParameterfEXT, PointParameterfEXT@8)
- GL_STUB_ALIAS(PointParameterfv, 662, PointParameterfv@8, PointParameterfvEXT, PointParameterfvEXT@8)
- GL_STUB_ALIAS(PointParameterfvARB, 662, PointParameterfvARB@8, PointParameterfvEXT, PointParameterfvEXT@8)
- GL_STUB_ALIAS(SecondaryColor3b, 665, SecondaryColor3b@12, SecondaryColor3bEXT, SecondaryColor3bEXT@12)
- GL_STUB_ALIAS(SecondaryColor3bv, 666, SecondaryColor3bv@4, SecondaryColor3bvEXT, SecondaryColor3bvEXT@4)
- GL_STUB_ALIAS(SecondaryColor3d, 667, SecondaryColor3d@24, SecondaryColor3dEXT, SecondaryColor3dEXT@24)
- GL_STUB_ALIAS(SecondaryColor3dv, 668, SecondaryColor3dv@4, SecondaryColor3dvEXT, SecondaryColor3dvEXT@4)
- GL_STUB_ALIAS(SecondaryColor3f, 669, SecondaryColor3f@12, SecondaryColor3fEXT, SecondaryColor3fEXT@12)
- GL_STUB_ALIAS(SecondaryColor3fv, 670, SecondaryColor3fv@4, SecondaryColor3fvEXT, SecondaryColor3fvEXT@4)
- GL_STUB_ALIAS(SecondaryColor3i, 671, SecondaryColor3i@12, SecondaryColor3iEXT, SecondaryColor3iEXT@12)
- GL_STUB_ALIAS(SecondaryColor3iv, 672, SecondaryColor3iv@4, SecondaryColor3ivEXT, SecondaryColor3ivEXT@4)
- GL_STUB_ALIAS(SecondaryColor3s, 673, SecondaryColor3s@12, SecondaryColor3sEXT, SecondaryColor3sEXT@12)
- GL_STUB_ALIAS(SecondaryColor3sv, 674, SecondaryColor3sv@4, SecondaryColor3svEXT, SecondaryColor3svEXT@4)
- GL_STUB_ALIAS(SecondaryColor3ub, 675, SecondaryColor3ub@12, SecondaryColor3ubEXT, SecondaryColor3ubEXT@12)
- GL_STUB_ALIAS(SecondaryColor3ubv, 676, SecondaryColor3ubv@4, SecondaryColor3ubvEXT, SecondaryColor3ubvEXT@4)
- GL_STUB_ALIAS(SecondaryColor3ui, 677, SecondaryColor3ui@12, SecondaryColor3uiEXT, SecondaryColor3uiEXT@12)
- GL_STUB_ALIAS(SecondaryColor3uiv, 678, SecondaryColor3uiv@4, SecondaryColor3uivEXT, SecondaryColor3uivEXT@4)
- GL_STUB_ALIAS(SecondaryColor3us, 679, SecondaryColor3us@12, SecondaryColor3usEXT, SecondaryColor3usEXT@12)
- GL_STUB_ALIAS(SecondaryColor3usv, 680, SecondaryColor3usv@4, SecondaryColor3usvEXT, SecondaryColor3usvEXT@4)
- GL_STUB_ALIAS(SecondaryColorPointer, 681, SecondaryColorPointer@16, SecondaryColorPointerEXT, SecondaryColorPointerEXT@16)
- GL_STUB_ALIAS(MultiDrawArrays, 682, MultiDrawArrays@16, MultiDrawArraysEXT, MultiDrawArraysEXT@16)
- GL_STUB_ALIAS(MultiDrawElements, 683, MultiDrawElements@20, MultiDrawElementsEXT, MultiDrawElementsEXT@20)
- GL_STUB_ALIAS(FogCoordPointer, 684, FogCoordPointer@12, FogCoordPointerEXT, FogCoordPointerEXT@12)
- GL_STUB_ALIAS(FogCoordd, 685, FogCoordd@8, FogCoorddEXT, FogCoorddEXT@8)
- GL_STUB_ALIAS(FogCoorddv, 686, FogCoorddv@4, FogCoorddvEXT, FogCoorddvEXT@4)
- GL_STUB_ALIAS(FogCoordf, 687, FogCoordf@4, FogCoordfEXT, FogCoordfEXT@4)
- GL_STUB_ALIAS(FogCoordfv, 688, FogCoordfv@4, FogCoordfvEXT, FogCoordfvEXT@4)
- GL_STUB_ALIAS(BlendFuncSeparate, 690, BlendFuncSeparate@16, BlendFuncSeparateEXT, BlendFuncSeparateEXT@16)
- GL_STUB_ALIAS(WindowPos2d, 707, WindowPos2d@16, WindowPos2dMESA, WindowPos2dMESA@16)
- GL_STUB_ALIAS(WindowPos2dARB, 707, WindowPos2dARB@16, WindowPos2dMESA, WindowPos2dMESA@16)
- GL_STUB_ALIAS(WindowPos2dv, 708, WindowPos2dv@4, WindowPos2dvMESA, WindowPos2dvMESA@4)
- GL_STUB_ALIAS(WindowPos2dvARB, 708, WindowPos2dvARB@4, WindowPos2dvMESA, WindowPos2dvMESA@4)
- GL_STUB_ALIAS(WindowPos2f, 709, WindowPos2f@8, WindowPos2fMESA, WindowPos2fMESA@8)
- GL_STUB_ALIAS(WindowPos2fARB, 709, WindowPos2fARB@8, WindowPos2fMESA, WindowPos2fMESA@8)
- GL_STUB_ALIAS(WindowPos2fv, 710, WindowPos2fv@4, WindowPos2fvMESA, WindowPos2fvMESA@4)
- GL_STUB_ALIAS(WindowPos2fvARB, 710, WindowPos2fvARB@4, WindowPos2fvMESA, WindowPos2fvMESA@4)
- GL_STUB_ALIAS(WindowPos2i, 711, WindowPos2i@8, WindowPos2iMESA, WindowPos2iMESA@8)
- GL_STUB_ALIAS(WindowPos2iARB, 711, WindowPos2iARB@8, WindowPos2iMESA, WindowPos2iMESA@8)
- GL_STUB_ALIAS(WindowPos2iv, 712, WindowPos2iv@4, WindowPos2ivMESA, WindowPos2ivMESA@4)
- GL_STUB_ALIAS(WindowPos2ivARB, 712, WindowPos2ivARB@4, WindowPos2ivMESA, WindowPos2ivMESA@4)
- GL_STUB_ALIAS(WindowPos2s, 713, WindowPos2s@8, WindowPos2sMESA, WindowPos2sMESA@8)
- GL_STUB_ALIAS(WindowPos2sARB, 713, WindowPos2sARB@8, WindowPos2sMESA, WindowPos2sMESA@8)
- GL_STUB_ALIAS(WindowPos2sv, 714, WindowPos2sv@4, WindowPos2svMESA, WindowPos2svMESA@4)
- GL_STUB_ALIAS(WindowPos2svARB, 714, WindowPos2svARB@4, WindowPos2svMESA, WindowPos2svMESA@4)
- GL_STUB_ALIAS(WindowPos3d, 715, WindowPos3d@24, WindowPos3dMESA, WindowPos3dMESA@24)
- GL_STUB_ALIAS(WindowPos3dARB, 715, WindowPos3dARB@24, WindowPos3dMESA, WindowPos3dMESA@24)
- GL_STUB_ALIAS(WindowPos3dv, 716, WindowPos3dv@4, WindowPos3dvMESA, WindowPos3dvMESA@4)
- GL_STUB_ALIAS(WindowPos3dvARB, 716, WindowPos3dvARB@4, WindowPos3dvMESA, WindowPos3dvMESA@4)
- GL_STUB_ALIAS(WindowPos3f, 717, WindowPos3f@12, WindowPos3fMESA, WindowPos3fMESA@12)
- GL_STUB_ALIAS(WindowPos3fARB, 717, WindowPos3fARB@12, WindowPos3fMESA, WindowPos3fMESA@12)
- GL_STUB_ALIAS(WindowPos3fv, 718, WindowPos3fv@4, WindowPos3fvMESA, WindowPos3fvMESA@4)
- GL_STUB_ALIAS(WindowPos3fvARB, 718, WindowPos3fvARB@4, WindowPos3fvMESA, WindowPos3fvMESA@4)
- GL_STUB_ALIAS(WindowPos3i, 719, WindowPos3i@12, WindowPos3iMESA, WindowPos3iMESA@12)
- GL_STUB_ALIAS(WindowPos3iARB, 719, WindowPos3iARB@12, WindowPos3iMESA, WindowPos3iMESA@12)
- GL_STUB_ALIAS(WindowPos3iv, 720, WindowPos3iv@4, WindowPos3ivMESA, WindowPos3ivMESA@4)
- GL_STUB_ALIAS(WindowPos3ivARB, 720, WindowPos3ivARB@4, WindowPos3ivMESA, WindowPos3ivMESA@4)
- GL_STUB_ALIAS(WindowPos3s, 721, WindowPos3s@12, WindowPos3sMESA, WindowPos3sMESA@12)
- GL_STUB_ALIAS(WindowPos3sARB, 721, WindowPos3sARB@12, WindowPos3sMESA, WindowPos3sMESA@12)
- GL_STUB_ALIAS(WindowPos3sv, 722, WindowPos3sv@4, WindowPos3svMESA, WindowPos3svMESA@4)
- GL_STUB_ALIAS(WindowPos3svARB, 722, WindowPos3svARB@4, WindowPos3svMESA, WindowPos3svMESA@4)
- GL_STUB_ALIAS(BindProgramARB, 741, BindProgramARB@8, BindProgramNV, BindProgramNV@8)
- GL_STUB_ALIAS(DeleteProgramsARB, 742, DeleteProgramsARB@8, DeleteProgramsNV, DeleteProgramsNV@8)
- GL_STUB_ALIAS(GenProgramsARB, 744, GenProgramsARB@8, GenProgramsNV, GenProgramsNV@8)
- GL_STUB_ALIAS(GetVertexAttribPointerv, 750, GetVertexAttribPointerv@12, GetVertexAttribPointervNV, GetVertexAttribPointervNV@12)
- GL_STUB_ALIAS(GetVertexAttribPointervARB, 750, GetVertexAttribPointervARB@12, GetVertexAttribPointervNV, GetVertexAttribPointervNV@12)
- GL_STUB_ALIAS(IsProgramARB, 754, IsProgramARB@4, IsProgramNV, IsProgramNV@4)
- GL_STUB_ALIAS(PointParameteri, 818, PointParameteri@8, PointParameteriNV, PointParameteriNV@8)
- GL_STUB_ALIAS(PointParameteriv, 819, PointParameteriv@8, PointParameterivNV, PointParameterivNV@8)
- GL_STUB_ALIAS(DeleteVertexArrays, 822, DeleteVertexArrays@8, _dispatch_stub_822, _dispatch_stub_822@8)
- GL_STUB_ALIAS(IsVertexArray, 824, IsVertexArray@4, _dispatch_stub_824, _dispatch_stub_824@4)
- GL_STUB_ALIAS(PrimitiveRestartIndex, 831, PrimitiveRestartIndex@4, PrimitiveRestartIndexNV, PrimitiveRestartIndexNV@4)
- GL_STUB_ALIAS(BlendEquationSeparate, 834, BlendEquationSeparate@8, _dispatch_stub_834, _dispatch_stub_834@8)
- GL_STUB_ALIAS(BindFramebuffer, 835, BindFramebuffer@8, BindFramebufferEXT, BindFramebufferEXT@8)
- GL_STUB_ALIAS(BindRenderbuffer, 836, BindRenderbuffer@8, BindRenderbufferEXT, BindRenderbufferEXT@8)
- GL_STUB_ALIAS(CheckFramebufferStatus, 837, CheckFramebufferStatus@4, CheckFramebufferStatusEXT, CheckFramebufferStatusEXT@4)
- GL_STUB_ALIAS(DeleteFramebuffers, 838, DeleteFramebuffers@8, DeleteFramebuffersEXT, DeleteFramebuffersEXT@8)
- GL_STUB_ALIAS(DeleteRenderbuffers, 839, DeleteRenderbuffers@8, DeleteRenderbuffersEXT, DeleteRenderbuffersEXT@8)
- GL_STUB_ALIAS(FramebufferRenderbuffer, 840, FramebufferRenderbuffer@16, FramebufferRenderbufferEXT, FramebufferRenderbufferEXT@16)
- GL_STUB_ALIAS(FramebufferTexture1D, 841, FramebufferTexture1D@20, FramebufferTexture1DEXT, FramebufferTexture1DEXT@20)
- GL_STUB_ALIAS(FramebufferTexture2D, 842, FramebufferTexture2D@20, FramebufferTexture2DEXT, FramebufferTexture2DEXT@20)
- GL_STUB_ALIAS(FramebufferTexture3D, 843, FramebufferTexture3D@24, FramebufferTexture3DEXT, FramebufferTexture3DEXT@24)
- GL_STUB_ALIAS(GenFramebuffers, 844, GenFramebuffers@8, GenFramebuffersEXT, GenFramebuffersEXT@8)
- GL_STUB_ALIAS(GenRenderbuffers, 845, GenRenderbuffers@8, GenRenderbuffersEXT, GenRenderbuffersEXT@8)
- GL_STUB_ALIAS(GenerateMipmap, 846, GenerateMipmap@4, GenerateMipmapEXT, GenerateMipmapEXT@4)
- GL_STUB_ALIAS(GetFramebufferAttachmentParameteriv, 847, GetFramebufferAttachmentParameteriv@16, GetFramebufferAttachmentParameterivEXT, GetFramebufferAttachmentParameterivEXT@16)
- GL_STUB_ALIAS(GetRenderbufferParameteriv, 848, GetRenderbufferParameteriv@12, GetRenderbufferParameterivEXT, GetRenderbufferParameterivEXT@12)
- GL_STUB_ALIAS(IsFramebuffer, 849, IsFramebuffer@4, IsFramebufferEXT, IsFramebufferEXT@4)
- GL_STUB_ALIAS(IsRenderbuffer, 850, IsRenderbuffer@4, IsRenderbufferEXT, IsRenderbufferEXT@4)
- GL_STUB_ALIAS(RenderbufferStorage, 851, RenderbufferStorage@16, RenderbufferStorageEXT, RenderbufferStorageEXT@16)
- GL_STUB_ALIAS(BlitFramebuffer, 852, BlitFramebuffer@40, _dispatch_stub_852, _dispatch_stub_852@40)
- GL_STUB_ALIAS(BindFragDataLocation, 855, BindFragDataLocation@12, BindFragDataLocationEXT, BindFragDataLocationEXT@12)
- GL_STUB_ALIAS(GetFragDataLocation, 856, GetFragDataLocation@8, GetFragDataLocationEXT, GetFragDataLocationEXT@8)
- GL_STUB_ALIAS(GetUniformuiv, 857, GetUniformuiv@12, GetUniformuivEXT, GetUniformuivEXT@12)
- GL_STUB_ALIAS(GetVertexAttribIiv, 858, GetVertexAttribIiv@12, GetVertexAttribIivEXT, GetVertexAttribIivEXT@12)
- GL_STUB_ALIAS(GetVertexAttribIuiv, 859, GetVertexAttribIuiv@12, GetVertexAttribIuivEXT, GetVertexAttribIuivEXT@12)
- GL_STUB_ALIAS(Uniform1ui, 860, Uniform1ui@8, Uniform1uiEXT, Uniform1uiEXT@8)
- GL_STUB_ALIAS(Uniform1uiv, 861, Uniform1uiv@12, Uniform1uivEXT, Uniform1uivEXT@12)
- GL_STUB_ALIAS(Uniform2ui, 862, Uniform2ui@12, Uniform2uiEXT, Uniform2uiEXT@12)
- GL_STUB_ALIAS(Uniform2uiv, 863, Uniform2uiv@12, Uniform2uivEXT, Uniform2uivEXT@12)
- GL_STUB_ALIAS(Uniform3ui, 864, Uniform3ui@16, Uniform3uiEXT, Uniform3uiEXT@16)
- GL_STUB_ALIAS(Uniform3uiv, 865, Uniform3uiv@12, Uniform3uivEXT, Uniform3uivEXT@12)
- GL_STUB_ALIAS(Uniform4ui, 866, Uniform4ui@20, Uniform4uiEXT, Uniform4uiEXT@20)
- GL_STUB_ALIAS(Uniform4uiv, 867, Uniform4uiv@12, Uniform4uivEXT, Uniform4uivEXT@12)
- GL_STUB_ALIAS(VertexAttribI1i, 868, VertexAttribI1i@8, VertexAttribI1iEXT, VertexAttribI1iEXT@8)
- GL_STUB_ALIAS(VertexAttribI1iv, 869, VertexAttribI1iv@8, VertexAttribI1ivEXT, VertexAttribI1ivEXT@8)
- GL_STUB_ALIAS(VertexAttribI1ui, 870, VertexAttribI1ui@8, VertexAttribI1uiEXT, VertexAttribI1uiEXT@8)
- GL_STUB_ALIAS(VertexAttribI1uiv, 871, VertexAttribI1uiv@8, VertexAttribI1uivEXT, VertexAttribI1uivEXT@8)
- GL_STUB_ALIAS(VertexAttribI2i, 872, VertexAttribI2i@12, VertexAttribI2iEXT, VertexAttribI2iEXT@12)
- GL_STUB_ALIAS(VertexAttribI2iv, 873, VertexAttribI2iv@8, VertexAttribI2ivEXT, VertexAttribI2ivEXT@8)
- GL_STUB_ALIAS(VertexAttribI2ui, 874, VertexAttribI2ui@12, VertexAttribI2uiEXT, VertexAttribI2uiEXT@12)
- GL_STUB_ALIAS(VertexAttribI2uiv, 875, VertexAttribI2uiv@8, VertexAttribI2uivEXT, VertexAttribI2uivEXT@8)
- GL_STUB_ALIAS(VertexAttribI3i, 876, VertexAttribI3i@16, VertexAttribI3iEXT, VertexAttribI3iEXT@16)
- GL_STUB_ALIAS(VertexAttribI3iv, 877, VertexAttribI3iv@8, VertexAttribI3ivEXT, VertexAttribI3ivEXT@8)
- GL_STUB_ALIAS(VertexAttribI3ui, 878, VertexAttribI3ui@16, VertexAttribI3uiEXT, VertexAttribI3uiEXT@16)
- GL_STUB_ALIAS(VertexAttribI3uiv, 879, VertexAttribI3uiv@8, VertexAttribI3uivEXT, VertexAttribI3uivEXT@8)
- GL_STUB_ALIAS(VertexAttribI4bv, 880, VertexAttribI4bv@8, VertexAttribI4bvEXT, VertexAttribI4bvEXT@8)
- GL_STUB_ALIAS(VertexAttribI4i, 881, VertexAttribI4i@20, VertexAttribI4iEXT, VertexAttribI4iEXT@20)
- GL_STUB_ALIAS(VertexAttribI4iv, 882, VertexAttribI4iv@8, VertexAttribI4ivEXT, VertexAttribI4ivEXT@8)
- GL_STUB_ALIAS(VertexAttribI4sv, 883, VertexAttribI4sv@8, VertexAttribI4svEXT, VertexAttribI4svEXT@8)
- GL_STUB_ALIAS(VertexAttribI4ubv, 884, VertexAttribI4ubv@8, VertexAttribI4ubvEXT, VertexAttribI4ubvEXT@8)
- GL_STUB_ALIAS(VertexAttribI4ui, 885, VertexAttribI4ui@20, VertexAttribI4uiEXT, VertexAttribI4uiEXT@20)
- GL_STUB_ALIAS(VertexAttribI4uiv, 886, VertexAttribI4uiv@8, VertexAttribI4uivEXT, VertexAttribI4uivEXT@8)
- GL_STUB_ALIAS(VertexAttribI4usv, 887, VertexAttribI4usv@8, VertexAttribI4usvEXT, VertexAttribI4usvEXT@8)
- GL_STUB_ALIAS(VertexAttribIPointer, 888, VertexAttribIPointer@20, VertexAttribIPointerEXT, VertexAttribIPointerEXT@20)
- GL_STUB_ALIAS(FramebufferTextureLayer, 889, FramebufferTextureLayer@20, FramebufferTextureLayerEXT, FramebufferTextureLayerEXT@20)
- GL_STUB_ALIAS(ColorMaski, 890, ColorMaski@20, ColorMaskIndexedEXT, ColorMaskIndexedEXT@20)
- GL_STUB_ALIAS(Disablei, 891, Disablei@8, DisableIndexedEXT, DisableIndexedEXT@8)
- GL_STUB_ALIAS(Enablei, 892, Enablei@8, EnableIndexedEXT, EnableIndexedEXT@8)
- GL_STUB_ALIAS(GetBooleani_v, 893, GetBooleani_v@12, GetBooleanIndexedvEXT, GetBooleanIndexedvEXT@12)
- GL_STUB_ALIAS(GetIntegeri_v, 894, GetIntegeri_v@12, GetIntegerIndexedvEXT, GetIntegerIndexedvEXT@12)
- GL_STUB_ALIAS(IsEnabledi, 895, IsEnabledi@8, IsEnabledIndexedEXT, IsEnabledIndexedEXT@8)
- GL_STUB_ALIAS(GetTexParameterIiv, 898, GetTexParameterIiv@12, GetTexParameterIivEXT, GetTexParameterIivEXT@12)
- GL_STUB_ALIAS(GetTexParameterIuiv, 899, GetTexParameterIuiv@12, GetTexParameterIuivEXT, GetTexParameterIuivEXT@12)
- GL_STUB_ALIAS(TexParameterIiv, 900, TexParameterIiv@12, TexParameterIivEXT, TexParameterIivEXT@12)
- GL_STUB_ALIAS(TexParameterIuiv, 901, TexParameterIuiv@12, TexParameterIuivEXT, TexParameterIuivEXT@12)
- GL_STUB_ALIAS(BeginConditionalRender, 902, BeginConditionalRender@8, BeginConditionalRenderNV, BeginConditionalRenderNV@8)
- GL_STUB_ALIAS(EndConditionalRender, 903, EndConditionalRender@0, EndConditionalRenderNV, EndConditionalRenderNV@0)
- GL_STUB_ALIAS(BeginTransformFeedback, 904, BeginTransformFeedback@4, BeginTransformFeedbackEXT, BeginTransformFeedbackEXT@4)
- GL_STUB_ALIAS(BindBufferBase, 905, BindBufferBase@12, BindBufferBaseEXT, BindBufferBaseEXT@12)
- GL_STUB_ALIAS(BindBufferRange, 907, BindBufferRange@20, BindBufferRangeEXT, BindBufferRangeEXT@20)
- GL_STUB_ALIAS(EndTransformFeedback, 908, EndTransformFeedback@0, EndTransformFeedbackEXT, EndTransformFeedbackEXT@0)
- GL_STUB_ALIAS(GetTransformFeedbackVarying, 909, GetTransformFeedbackVarying@28, GetTransformFeedbackVaryingEXT, GetTransformFeedbackVaryingEXT@28)
- GL_STUB_ALIAS(TransformFeedbackVaryings, 910, TransformFeedbackVaryings@16, TransformFeedbackVaryingsEXT, TransformFeedbackVaryingsEXT@16)
- GL_STUB_ALIAS(ProvokingVertex, 911, ProvokingVertex@4, ProvokingVertexEXT, ProvokingVertexEXT@4)
-
- GLOBL GLNAME(gl_dispatch_functions_end)
- HIDDEN(GLNAME(gl_dispatch_functions_end))
- ALIGNTEXT16
-GLNAME(gl_dispatch_functions_end):
-
-#if defined(GLX_USE_TLS) && defined(__linux__)
- .section ".note.ABI-tag", "a"
- .p2align 2
- .long 1f - 0f /* name length */
- .long 3f - 2f /* data length */
- .long 1 /* note length */
-0: .asciz "GNU" /* vendor name */
-1: .p2align 2
-2: .long 0 /* note data: the ABI tag */
- .long 2,4,20 /* Minimum kernel version w/TLS */
-3: .p2align 2 /* pad out section */
-#endif /* GLX_USE_TLS */
-
-#if defined (__ELF__) && defined (__linux__)
- .section .note.GNU-stack,"",%progbits
-#endif
+/* DO NOT EDIT - This file generated automatically by gl_x86_asm.py (from Mesa) script */
+
+/*
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
+ * (C) Copyright IBM Corporation 2004, 2005
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sub license,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL, IBM,
+ * AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
+ * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+#include "x86/assyntax.h"
+
+#if defined(STDCALL_API)
+# if defined(USE_MGL_NAMESPACE)
+# define GL_PREFIX(n,n2) GLNAME(CONCAT(mgl,n2))
+# else
+# define GL_PREFIX(n,n2) GLNAME(CONCAT(gl,n2))
+# endif
+#else
+# if defined(USE_MGL_NAMESPACE)
+# define GL_PREFIX(n,n2) GLNAME(CONCAT(mgl,n))
+# define _glapi_Dispatch _mglapi_Dispatch
+# else
+# define GL_PREFIX(n,n2) GLNAME(CONCAT(gl,n))
+# endif
+#endif
+
+#define GL_OFFSET(x) CODEPTR(REGOFF(4 * x, EAX))
+
+#if defined(GNU_ASSEMBLER) && !defined(__DJGPP__) && !defined(__MINGW32__) && !defined(__APPLE__)
+#define GLOBL_FN(x) GLOBL x ; .type x, @function
+#else
+#define GLOBL_FN(x) GLOBL x
+#endif
+
+#if defined(PTHREADS) || defined(WIN32) || defined(BEOS_THREADS)
+# define THREADS
+#endif
+
+#ifdef GLX_USE_TLS
+
+#ifdef GLX_X86_READONLY_TEXT
+# define CTX_INSNS MOV_L(GS:(EAX), EAX)
+#else
+# define CTX_INSNS NOP /* Pad for init_glapi_relocs() */
+#endif
+
+# define GL_STUB(fn,off,fn_alt) \
+ALIGNTEXT16; \
+GLOBL_FN(GL_PREFIX(fn, fn_alt)); \
+GL_PREFIX(fn, fn_alt): \
+ CALL(_x86_get_dispatch) ; \
+ CTX_INSNS ; \
+ JMP(GL_OFFSET(off))
+
+#elif defined(PTHREADS)
+# define GL_STUB(fn,off,fn_alt) \
+ALIGNTEXT16; \
+GLOBL_FN(GL_PREFIX(fn, fn_alt)); \
+GL_PREFIX(fn, fn_alt): \
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX) ; \
+ TEST_L(EAX, EAX) ; \
+ JE(1f) ; \
+ JMP(GL_OFFSET(off)) ; \
+1: CALL(_x86_get_dispatch) ; \
+ JMP(GL_OFFSET(off))
+#elif defined(THREADS)
+# define GL_STUB(fn,off,fn_alt) \
+ALIGNTEXT16; \
+GLOBL_FN(GL_PREFIX(fn, fn_alt)); \
+GL_PREFIX(fn, fn_alt): \
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX) ; \
+ TEST_L(EAX, EAX) ; \
+ JE(1f) ; \
+ JMP(GL_OFFSET(off)) ; \
+1: CALL(_glapi_get_dispatch) ; \
+ JMP(GL_OFFSET(off))
+#else /* Non-threaded version. */
+# define GL_STUB(fn,off,fn_alt) \
+ALIGNTEXT16; \
+GLOBL_FN(GL_PREFIX(fn, fn_alt)); \
+GL_PREFIX(fn, fn_alt): \
+ MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX) ; \
+ JMP(GL_OFFSET(off))
+#endif
+
+#ifdef HAVE_ALIAS
+# define GL_STUB_ALIAS(fn,off,fn_alt,alias,alias_alt) \
+ .globl GL_PREFIX(fn, fn_alt) ; \
+ .set GL_PREFIX(fn, fn_alt), GL_PREFIX(alias, alias_alt)
+#else
+# define GL_STUB_ALIAS(fn,off,fn_alt,alias,alias_alt) \
+ GL_STUB(fn, off, fn_alt)
+#endif
+
+SEG_TEXT
+
+#ifdef GLX_USE_TLS
+
+ GLOBL GLNAME(_x86_get_dispatch)
+ HIDDEN(GLNAME(_x86_get_dispatch))
+ALIGNTEXT16
+GLNAME(_x86_get_dispatch):
+ call 1f
+1: popl %eax
+ addl $_GLOBAL_OFFSET_TABLE_+[.-1b], %eax
+ movl _glapi_tls_Dispatch@GOTNTPOFF(%eax), %eax
+ ret
+
+#elif defined(PTHREADS)
+EXTERN GLNAME(_glapi_Dispatch)
+EXTERN GLNAME(_gl_DispatchTSD)
+EXTERN GLNAME(pthread_getspecific)
+
+ALIGNTEXT16
+GLNAME(_x86_get_dispatch):
+ SUB_L(CONST(24), ESP)
+ PUSH_L(GLNAME(_gl_DispatchTSD))
+ CALL(GLNAME(pthread_getspecific))
+ ADD_L(CONST(28), ESP)
+ RET
+#elif defined(THREADS)
+EXTERN GLNAME(_glapi_get_dispatch)
+#endif
+
+#if defined( GLX_USE_TLS ) && !defined( GLX_X86_READONLY_TEXT )
+ .section wtext, "awx", @progbits
+#endif /* defined( GLX_USE_TLS ) */
+
+ ALIGNTEXT16
+ GLOBL GLNAME(gl_dispatch_functions_start)
+ HIDDEN(GLNAME(gl_dispatch_functions_start))
+GLNAME(gl_dispatch_functions_start):
+
+ GL_STUB(NewList, 0, NewList@8)
+ GL_STUB(EndList, 1, EndList@0)
+ GL_STUB(CallList, 2, CallList@4)
+ GL_STUB(CallLists, 3, CallLists@12)
+ GL_STUB(DeleteLists, 4, DeleteLists@8)
+ GL_STUB(GenLists, 5, GenLists@4)
+ GL_STUB(ListBase, 6, ListBase@4)
+ GL_STUB(Begin, 7, Begin@4)
+ GL_STUB(Bitmap, 8, Bitmap@28)
+ GL_STUB(Color3b, 9, Color3b@12)
+ GL_STUB(Color3bv, 10, Color3bv@4)
+ GL_STUB(Color3d, 11, Color3d@24)
+ GL_STUB(Color3dv, 12, Color3dv@4)
+ GL_STUB(Color3f, 13, Color3f@12)
+ GL_STUB(Color3fv, 14, Color3fv@4)
+ GL_STUB(Color3i, 15, Color3i@12)
+ GL_STUB(Color3iv, 16, Color3iv@4)
+ GL_STUB(Color3s, 17, Color3s@12)
+ GL_STUB(Color3sv, 18, Color3sv@4)
+ GL_STUB(Color3ub, 19, Color3ub@12)
+ GL_STUB(Color3ubv, 20, Color3ubv@4)
+ GL_STUB(Color3ui, 21, Color3ui@12)
+ GL_STUB(Color3uiv, 22, Color3uiv@4)
+ GL_STUB(Color3us, 23, Color3us@12)
+ GL_STUB(Color3usv, 24, Color3usv@4)
+ GL_STUB(Color4b, 25, Color4b@16)
+ GL_STUB(Color4bv, 26, Color4bv@4)
+ GL_STUB(Color4d, 27, Color4d@32)
+ GL_STUB(Color4dv, 28, Color4dv@4)
+ GL_STUB(Color4f, 29, Color4f@16)
+ GL_STUB(Color4fv, 30, Color4fv@4)
+ GL_STUB(Color4i, 31, Color4i@16)
+ GL_STUB(Color4iv, 32, Color4iv@4)
+ GL_STUB(Color4s, 33, Color4s@16)
+ GL_STUB(Color4sv, 34, Color4sv@4)
+ GL_STUB(Color4ub, 35, Color4ub@16)
+ GL_STUB(Color4ubv, 36, Color4ubv@4)
+ GL_STUB(Color4ui, 37, Color4ui@16)
+ GL_STUB(Color4uiv, 38, Color4uiv@4)
+ GL_STUB(Color4us, 39, Color4us@16)
+ GL_STUB(Color4usv, 40, Color4usv@4)
+ GL_STUB(EdgeFlag, 41, EdgeFlag@4)
+ GL_STUB(EdgeFlagv, 42, EdgeFlagv@4)
+ GL_STUB(End, 43, End@0)
+ GL_STUB(Indexd, 44, Indexd@8)
+ GL_STUB(Indexdv, 45, Indexdv@4)
+ GL_STUB(Indexf, 46, Indexf@4)
+ GL_STUB(Indexfv, 47, Indexfv@4)
+ GL_STUB(Indexi, 48, Indexi@4)
+ GL_STUB(Indexiv, 49, Indexiv@4)
+ GL_STUB(Indexs, 50, Indexs@4)
+ GL_STUB(Indexsv, 51, Indexsv@4)
+ GL_STUB(Normal3b, 52, Normal3b@12)
+ GL_STUB(Normal3bv, 53, Normal3bv@4)
+ GL_STUB(Normal3d, 54, Normal3d@24)
+ GL_STUB(Normal3dv, 55, Normal3dv@4)
+ GL_STUB(Normal3f, 56, Normal3f@12)
+ GL_STUB(Normal3fv, 57, Normal3fv@4)
+ GL_STUB(Normal3i, 58, Normal3i@12)
+ GL_STUB(Normal3iv, 59, Normal3iv@4)
+ GL_STUB(Normal3s, 60, Normal3s@12)
+ GL_STUB(Normal3sv, 61, Normal3sv@4)
+ GL_STUB(RasterPos2d, 62, RasterPos2d@16)
+ GL_STUB(RasterPos2dv, 63, RasterPos2dv@4)
+ GL_STUB(RasterPos2f, 64, RasterPos2f@8)
+ GL_STUB(RasterPos2fv, 65, RasterPos2fv@4)
+ GL_STUB(RasterPos2i, 66, RasterPos2i@8)
+ GL_STUB(RasterPos2iv, 67, RasterPos2iv@4)
+ GL_STUB(RasterPos2s, 68, RasterPos2s@8)
+ GL_STUB(RasterPos2sv, 69, RasterPos2sv@4)
+ GL_STUB(RasterPos3d, 70, RasterPos3d@24)
+ GL_STUB(RasterPos3dv, 71, RasterPos3dv@4)
+ GL_STUB(RasterPos3f, 72, RasterPos3f@12)
+ GL_STUB(RasterPos3fv, 73, RasterPos3fv@4)
+ GL_STUB(RasterPos3i, 74, RasterPos3i@12)
+ GL_STUB(RasterPos3iv, 75, RasterPos3iv@4)
+ GL_STUB(RasterPos3s, 76, RasterPos3s@12)
+ GL_STUB(RasterPos3sv, 77, RasterPos3sv@4)
+ GL_STUB(RasterPos4d, 78, RasterPos4d@32)
+ GL_STUB(RasterPos4dv, 79, RasterPos4dv@4)
+ GL_STUB(RasterPos4f, 80, RasterPos4f@16)
+ GL_STUB(RasterPos4fv, 81, RasterPos4fv@4)
+ GL_STUB(RasterPos4i, 82, RasterPos4i@16)
+ GL_STUB(RasterPos4iv, 83, RasterPos4iv@4)
+ GL_STUB(RasterPos4s, 84, RasterPos4s@16)
+ GL_STUB(RasterPos4sv, 85, RasterPos4sv@4)
+ GL_STUB(Rectd, 86, Rectd@32)
+ GL_STUB(Rectdv, 87, Rectdv@8)
+ GL_STUB(Rectf, 88, Rectf@16)
+ GL_STUB(Rectfv, 89, Rectfv@8)
+ GL_STUB(Recti, 90, Recti@16)
+ GL_STUB(Rectiv, 91, Rectiv@8)
+ GL_STUB(Rects, 92, Rects@16)
+ GL_STUB(Rectsv, 93, Rectsv@8)
+ GL_STUB(TexCoord1d, 94, TexCoord1d@8)
+ GL_STUB(TexCoord1dv, 95, TexCoord1dv@4)
+ GL_STUB(TexCoord1f, 96, TexCoord1f@4)
+ GL_STUB(TexCoord1fv, 97, TexCoord1fv@4)
+ GL_STUB(TexCoord1i, 98, TexCoord1i@4)
+ GL_STUB(TexCoord1iv, 99, TexCoord1iv@4)
+ GL_STUB(TexCoord1s, 100, TexCoord1s@4)
+ GL_STUB(TexCoord1sv, 101, TexCoord1sv@4)
+ GL_STUB(TexCoord2d, 102, TexCoord2d@16)
+ GL_STUB(TexCoord2dv, 103, TexCoord2dv@4)
+ GL_STUB(TexCoord2f, 104, TexCoord2f@8)
+ GL_STUB(TexCoord2fv, 105, TexCoord2fv@4)
+ GL_STUB(TexCoord2i, 106, TexCoord2i@8)
+ GL_STUB(TexCoord2iv, 107, TexCoord2iv@4)
+ GL_STUB(TexCoord2s, 108, TexCoord2s@8)
+ GL_STUB(TexCoord2sv, 109, TexCoord2sv@4)
+ GL_STUB(TexCoord3d, 110, TexCoord3d@24)
+ GL_STUB(TexCoord3dv, 111, TexCoord3dv@4)
+ GL_STUB(TexCoord3f, 112, TexCoord3f@12)
+ GL_STUB(TexCoord3fv, 113, TexCoord3fv@4)
+ GL_STUB(TexCoord3i, 114, TexCoord3i@12)
+ GL_STUB(TexCoord3iv, 115, TexCoord3iv@4)
+ GL_STUB(TexCoord3s, 116, TexCoord3s@12)
+ GL_STUB(TexCoord3sv, 117, TexCoord3sv@4)
+ GL_STUB(TexCoord4d, 118, TexCoord4d@32)
+ GL_STUB(TexCoord4dv, 119, TexCoord4dv@4)
+ GL_STUB(TexCoord4f, 120, TexCoord4f@16)
+ GL_STUB(TexCoord4fv, 121, TexCoord4fv@4)
+ GL_STUB(TexCoord4i, 122, TexCoord4i@16)
+ GL_STUB(TexCoord4iv, 123, TexCoord4iv@4)
+ GL_STUB(TexCoord4s, 124, TexCoord4s@16)
+ GL_STUB(TexCoord4sv, 125, TexCoord4sv@4)
+ GL_STUB(Vertex2d, 126, Vertex2d@16)
+ GL_STUB(Vertex2dv, 127, Vertex2dv@4)
+ GL_STUB(Vertex2f, 128, Vertex2f@8)
+ GL_STUB(Vertex2fv, 129, Vertex2fv@4)
+ GL_STUB(Vertex2i, 130, Vertex2i@8)
+ GL_STUB(Vertex2iv, 131, Vertex2iv@4)
+ GL_STUB(Vertex2s, 132, Vertex2s@8)
+ GL_STUB(Vertex2sv, 133, Vertex2sv@4)
+ GL_STUB(Vertex3d, 134, Vertex3d@24)
+ GL_STUB(Vertex3dv, 135, Vertex3dv@4)
+ GL_STUB(Vertex3f, 136, Vertex3f@12)
+ GL_STUB(Vertex3fv, 137, Vertex3fv@4)
+ GL_STUB(Vertex3i, 138, Vertex3i@12)
+ GL_STUB(Vertex3iv, 139, Vertex3iv@4)
+ GL_STUB(Vertex3s, 140, Vertex3s@12)
+ GL_STUB(Vertex3sv, 141, Vertex3sv@4)
+ GL_STUB(Vertex4d, 142, Vertex4d@32)
+ GL_STUB(Vertex4dv, 143, Vertex4dv@4)
+ GL_STUB(Vertex4f, 144, Vertex4f@16)
+ GL_STUB(Vertex4fv, 145, Vertex4fv@4)
+ GL_STUB(Vertex4i, 146, Vertex4i@16)
+ GL_STUB(Vertex4iv, 147, Vertex4iv@4)
+ GL_STUB(Vertex4s, 148, Vertex4s@16)
+ GL_STUB(Vertex4sv, 149, Vertex4sv@4)
+ GL_STUB(ClipPlane, 150, ClipPlane@8)
+ GL_STUB(ColorMaterial, 151, ColorMaterial@8)
+ GL_STUB(CullFace, 152, CullFace@4)
+ GL_STUB(Fogf, 153, Fogf@8)
+ GL_STUB(Fogfv, 154, Fogfv@8)
+ GL_STUB(Fogi, 155, Fogi@8)
+ GL_STUB(Fogiv, 156, Fogiv@8)
+ GL_STUB(FrontFace, 157, FrontFace@4)
+ GL_STUB(Hint, 158, Hint@8)
+ GL_STUB(Lightf, 159, Lightf@12)
+ GL_STUB(Lightfv, 160, Lightfv@12)
+ GL_STUB(Lighti, 161, Lighti@12)
+ GL_STUB(Lightiv, 162, Lightiv@12)
+ GL_STUB(LightModelf, 163, LightModelf@8)
+ GL_STUB(LightModelfv, 164, LightModelfv@8)
+ GL_STUB(LightModeli, 165, LightModeli@8)
+ GL_STUB(LightModeliv, 166, LightModeliv@8)
+ GL_STUB(LineStipple, 167, LineStipple@8)
+ GL_STUB(LineWidth, 168, LineWidth@4)
+ GL_STUB(Materialf, 169, Materialf@12)
+ GL_STUB(Materialfv, 170, Materialfv@12)
+ GL_STUB(Materiali, 171, Materiali@12)
+ GL_STUB(Materialiv, 172, Materialiv@12)
+ GL_STUB(PointSize, 173, PointSize@4)
+ GL_STUB(PolygonMode, 174, PolygonMode@8)
+ GL_STUB(PolygonStipple, 175, PolygonStipple@4)
+ GL_STUB(Scissor, 176, Scissor@16)
+ GL_STUB(ShadeModel, 177, ShadeModel@4)
+ GL_STUB(TexParameterf, 178, TexParameterf@12)
+ GL_STUB(TexParameterfv, 179, TexParameterfv@12)
+ GL_STUB(TexParameteri, 180, TexParameteri@12)
+ GL_STUB(TexParameteriv, 181, TexParameteriv@12)
+ GL_STUB(TexImage1D, 182, TexImage1D@32)
+ GL_STUB(TexImage2D, 183, TexImage2D@36)
+ GL_STUB(TexEnvf, 184, TexEnvf@12)
+ GL_STUB(TexEnvfv, 185, TexEnvfv@12)
+ GL_STUB(TexEnvi, 186, TexEnvi@12)
+ GL_STUB(TexEnviv, 187, TexEnviv@12)
+ GL_STUB(TexGend, 188, TexGend@16)
+ GL_STUB(TexGendv, 189, TexGendv@12)
+ GL_STUB(TexGenf, 190, TexGenf@12)
+ GL_STUB(TexGenfv, 191, TexGenfv@12)
+ GL_STUB(TexGeni, 192, TexGeni@12)
+ GL_STUB(TexGeniv, 193, TexGeniv@12)
+ GL_STUB(FeedbackBuffer, 194, FeedbackBuffer@12)
+ GL_STUB(SelectBuffer, 195, SelectBuffer@8)
+ GL_STUB(RenderMode, 196, RenderMode@4)
+ GL_STUB(InitNames, 197, InitNames@0)
+ GL_STUB(LoadName, 198, LoadName@4)
+ GL_STUB(PassThrough, 199, PassThrough@4)
+ GL_STUB(PopName, 200, PopName@0)
+ GL_STUB(PushName, 201, PushName@4)
+ GL_STUB(DrawBuffer, 202, DrawBuffer@4)
+ GL_STUB(Clear, 203, Clear@4)
+ GL_STUB(ClearAccum, 204, ClearAccum@16)
+ GL_STUB(ClearIndex, 205, ClearIndex@4)
+ GL_STUB(ClearColor, 206, ClearColor@16)
+ GL_STUB(ClearStencil, 207, ClearStencil@4)
+ GL_STUB(ClearDepth, 208, ClearDepth@8)
+ GL_STUB(StencilMask, 209, StencilMask@4)
+ GL_STUB(ColorMask, 210, ColorMask@16)
+ GL_STUB(DepthMask, 211, DepthMask@4)
+ GL_STUB(IndexMask, 212, IndexMask@4)
+ GL_STUB(Accum, 213, Accum@8)
+ GL_STUB(Disable, 214, Disable@4)
+ GL_STUB(Enable, 215, Enable@4)
+ GL_STUB(Finish, 216, Finish@0)
+ GL_STUB(Flush, 217, Flush@0)
+ GL_STUB(PopAttrib, 218, PopAttrib@0)
+ GL_STUB(PushAttrib, 219, PushAttrib@4)
+ GL_STUB(Map1d, 220, Map1d@32)
+ GL_STUB(Map1f, 221, Map1f@24)
+ GL_STUB(Map2d, 222, Map2d@56)
+ GL_STUB(Map2f, 223, Map2f@40)
+ GL_STUB(MapGrid1d, 224, MapGrid1d@20)
+ GL_STUB(MapGrid1f, 225, MapGrid1f@12)
+ GL_STUB(MapGrid2d, 226, MapGrid2d@40)
+ GL_STUB(MapGrid2f, 227, MapGrid2f@24)
+ GL_STUB(EvalCoord1d, 228, EvalCoord1d@8)
+ GL_STUB(EvalCoord1dv, 229, EvalCoord1dv@4)
+ GL_STUB(EvalCoord1f, 230, EvalCoord1f@4)
+ GL_STUB(EvalCoord1fv, 231, EvalCoord1fv@4)
+ GL_STUB(EvalCoord2d, 232, EvalCoord2d@16)
+ GL_STUB(EvalCoord2dv, 233, EvalCoord2dv@4)
+ GL_STUB(EvalCoord2f, 234, EvalCoord2f@8)
+ GL_STUB(EvalCoord2fv, 235, EvalCoord2fv@4)
+ GL_STUB(EvalMesh1, 236, EvalMesh1@12)
+ GL_STUB(EvalPoint1, 237, EvalPoint1@4)
+ GL_STUB(EvalMesh2, 238, EvalMesh2@20)
+ GL_STUB(EvalPoint2, 239, EvalPoint2@8)
+ GL_STUB(AlphaFunc, 240, AlphaFunc@8)
+ GL_STUB(BlendFunc, 241, BlendFunc@8)
+ GL_STUB(LogicOp, 242, LogicOp@4)
+ GL_STUB(StencilFunc, 243, StencilFunc@12)
+ GL_STUB(StencilOp, 244, StencilOp@12)
+ GL_STUB(DepthFunc, 245, DepthFunc@4)
+ GL_STUB(PixelZoom, 246, PixelZoom@8)
+ GL_STUB(PixelTransferf, 247, PixelTransferf@8)
+ GL_STUB(PixelTransferi, 248, PixelTransferi@8)
+ GL_STUB(PixelStoref, 249, PixelStoref@8)
+ GL_STUB(PixelStorei, 250, PixelStorei@8)
+ GL_STUB(PixelMapfv, 251, PixelMapfv@12)
+ GL_STUB(PixelMapuiv, 252, PixelMapuiv@12)
+ GL_STUB(PixelMapusv, 253, PixelMapusv@12)
+ GL_STUB(ReadBuffer, 254, ReadBuffer@4)
+ GL_STUB(CopyPixels, 255, CopyPixels@20)
+ GL_STUB(ReadPixels, 256, ReadPixels@28)
+ GL_STUB(DrawPixels, 257, DrawPixels@20)
+ GL_STUB(GetBooleanv, 258, GetBooleanv@8)
+ GL_STUB(GetClipPlane, 259, GetClipPlane@8)
+ GL_STUB(GetDoublev, 260, GetDoublev@8)
+ GL_STUB(GetError, 261, GetError@0)
+ GL_STUB(GetFloatv, 262, GetFloatv@8)
+ GL_STUB(GetIntegerv, 263, GetIntegerv@8)
+ GL_STUB(GetLightfv, 264, GetLightfv@12)
+ GL_STUB(GetLightiv, 265, GetLightiv@12)
+ GL_STUB(GetMapdv, 266, GetMapdv@12)
+ GL_STUB(GetMapfv, 267, GetMapfv@12)
+ GL_STUB(GetMapiv, 268, GetMapiv@12)
+ GL_STUB(GetMaterialfv, 269, GetMaterialfv@12)
+ GL_STUB(GetMaterialiv, 270, GetMaterialiv@12)
+ GL_STUB(GetPixelMapfv, 271, GetPixelMapfv@8)
+ GL_STUB(GetPixelMapuiv, 272, GetPixelMapuiv@8)
+ GL_STUB(GetPixelMapusv, 273, GetPixelMapusv@8)
+ GL_STUB(GetPolygonStipple, 274, GetPolygonStipple@4)
+ GL_STUB(GetString, 275, GetString@4)
+ GL_STUB(GetTexEnvfv, 276, GetTexEnvfv@12)
+ GL_STUB(GetTexEnviv, 277, GetTexEnviv@12)
+ GL_STUB(GetTexGendv, 278, GetTexGendv@12)
+ GL_STUB(GetTexGenfv, 279, GetTexGenfv@12)
+ GL_STUB(GetTexGeniv, 280, GetTexGeniv@12)
+ GL_STUB(GetTexImage, 281, GetTexImage@20)
+ GL_STUB(GetTexParameterfv, 282, GetTexParameterfv@12)
+ GL_STUB(GetTexParameteriv, 283, GetTexParameteriv@12)
+ GL_STUB(GetTexLevelParameterfv, 284, GetTexLevelParameterfv@16)
+ GL_STUB(GetTexLevelParameteriv, 285, GetTexLevelParameteriv@16)
+ GL_STUB(IsEnabled, 286, IsEnabled@4)
+ GL_STUB(IsList, 287, IsList@4)
+ GL_STUB(DepthRange, 288, DepthRange@16)
+ GL_STUB(Frustum, 289, Frustum@48)
+ GL_STUB(LoadIdentity, 290, LoadIdentity@0)
+ GL_STUB(LoadMatrixf, 291, LoadMatrixf@4)
+ GL_STUB(LoadMatrixd, 292, LoadMatrixd@4)
+ GL_STUB(MatrixMode, 293, MatrixMode@4)
+ GL_STUB(MultMatrixf, 294, MultMatrixf@4)
+ GL_STUB(MultMatrixd, 295, MultMatrixd@4)
+ GL_STUB(Ortho, 296, Ortho@48)
+ GL_STUB(PopMatrix, 297, PopMatrix@0)
+ GL_STUB(PushMatrix, 298, PushMatrix@0)
+ GL_STUB(Rotated, 299, Rotated@32)
+ GL_STUB(Rotatef, 300, Rotatef@16)
+ GL_STUB(Scaled, 301, Scaled@24)
+ GL_STUB(Scalef, 302, Scalef@12)
+ GL_STUB(Translated, 303, Translated@24)
+ GL_STUB(Translatef, 304, Translatef@12)
+ GL_STUB(Viewport, 305, Viewport@16)
+ GL_STUB(ArrayElement, 306, ArrayElement@4)
+ GL_STUB(BindTexture, 307, BindTexture@8)
+ GL_STUB(ColorPointer, 308, ColorPointer@16)
+ GL_STUB(DisableClientState, 309, DisableClientState@4)
+ GL_STUB(DrawArrays, 310, DrawArrays@12)
+ GL_STUB(DrawElements, 311, DrawElements@16)
+ GL_STUB(EdgeFlagPointer, 312, EdgeFlagPointer@8)
+ GL_STUB(EnableClientState, 313, EnableClientState@4)
+ GL_STUB(IndexPointer, 314, IndexPointer@12)
+ GL_STUB(Indexub, 315, Indexub@4)
+ GL_STUB(Indexubv, 316, Indexubv@4)
+ GL_STUB(InterleavedArrays, 317, InterleavedArrays@12)
+ GL_STUB(NormalPointer, 318, NormalPointer@12)
+ GL_STUB(PolygonOffset, 319, PolygonOffset@8)
+ GL_STUB(TexCoordPointer, 320, TexCoordPointer@16)
+ GL_STUB(VertexPointer, 321, VertexPointer@16)
+ GL_STUB(AreTexturesResident, 322, AreTexturesResident@12)
+ GL_STUB(CopyTexImage1D, 323, CopyTexImage1D@28)
+ GL_STUB(CopyTexImage2D, 324, CopyTexImage2D@32)
+ GL_STUB(CopyTexSubImage1D, 325, CopyTexSubImage1D@24)
+ GL_STUB(CopyTexSubImage2D, 326, CopyTexSubImage2D@32)
+ GL_STUB(DeleteTextures, 327, DeleteTextures@8)
+ GL_STUB(GenTextures, 328, GenTextures@8)
+ GL_STUB(GetPointerv, 329, GetPointerv@8)
+ GL_STUB(IsTexture, 330, IsTexture@4)
+ GL_STUB(PrioritizeTextures, 331, PrioritizeTextures@12)
+ GL_STUB(TexSubImage1D, 332, TexSubImage1D@28)
+ GL_STUB(TexSubImage2D, 333, TexSubImage2D@36)
+ GL_STUB(PopClientAttrib, 334, PopClientAttrib@0)
+ GL_STUB(PushClientAttrib, 335, PushClientAttrib@4)
+ GL_STUB(BlendColor, 336, BlendColor@16)
+ GL_STUB(BlendEquation, 337, BlendEquation@4)
+ GL_STUB(DrawRangeElements, 338, DrawRangeElements@24)
+ GL_STUB(ColorTable, 339, ColorTable@24)
+ GL_STUB(ColorTableParameterfv, 340, ColorTableParameterfv@12)
+ GL_STUB(ColorTableParameteriv, 341, ColorTableParameteriv@12)
+ GL_STUB(CopyColorTable, 342, CopyColorTable@20)
+ GL_STUB(GetColorTable, 343, GetColorTable@16)
+ GL_STUB(GetColorTableParameterfv, 344, GetColorTableParameterfv@12)
+ GL_STUB(GetColorTableParameteriv, 345, GetColorTableParameteriv@12)
+ GL_STUB(ColorSubTable, 346, ColorSubTable@24)
+ GL_STUB(CopyColorSubTable, 347, CopyColorSubTable@20)
+ GL_STUB(ConvolutionFilter1D, 348, ConvolutionFilter1D@24)
+ GL_STUB(ConvolutionFilter2D, 349, ConvolutionFilter2D@28)
+ GL_STUB(ConvolutionParameterf, 350, ConvolutionParameterf@12)
+ GL_STUB(ConvolutionParameterfv, 351, ConvolutionParameterfv@12)
+ GL_STUB(ConvolutionParameteri, 352, ConvolutionParameteri@12)
+ GL_STUB(ConvolutionParameteriv, 353, ConvolutionParameteriv@12)
+ GL_STUB(CopyConvolutionFilter1D, 354, CopyConvolutionFilter1D@20)
+ GL_STUB(CopyConvolutionFilter2D, 355, CopyConvolutionFilter2D@24)
+ GL_STUB(GetConvolutionFilter, 356, GetConvolutionFilter@16)
+ GL_STUB(GetConvolutionParameterfv, 357, GetConvolutionParameterfv@12)
+ GL_STUB(GetConvolutionParameteriv, 358, GetConvolutionParameteriv@12)
+ GL_STUB(GetSeparableFilter, 359, GetSeparableFilter@24)
+ GL_STUB(SeparableFilter2D, 360, SeparableFilter2D@32)
+ GL_STUB(GetHistogram, 361, GetHistogram@20)
+ GL_STUB(GetHistogramParameterfv, 362, GetHistogramParameterfv@12)
+ GL_STUB(GetHistogramParameteriv, 363, GetHistogramParameteriv@12)
+ GL_STUB(GetMinmax, 364, GetMinmax@20)
+ GL_STUB(GetMinmaxParameterfv, 365, GetMinmaxParameterfv@12)
+ GL_STUB(GetMinmaxParameteriv, 366, GetMinmaxParameteriv@12)
+ GL_STUB(Histogram, 367, Histogram@16)
+ GL_STUB(Minmax, 368, Minmax@12)
+ GL_STUB(ResetHistogram, 369, ResetHistogram@4)
+ GL_STUB(ResetMinmax, 370, ResetMinmax@4)
+ GL_STUB(TexImage3D, 371, TexImage3D@40)
+ GL_STUB(TexSubImage3D, 372, TexSubImage3D@44)
+ GL_STUB(CopyTexSubImage3D, 373, CopyTexSubImage3D@36)
+ GL_STUB(ActiveTextureARB, 374, ActiveTextureARB@4)
+ GL_STUB(ClientActiveTextureARB, 375, ClientActiveTextureARB@4)
+ GL_STUB(MultiTexCoord1dARB, 376, MultiTexCoord1dARB@12)
+ GL_STUB(MultiTexCoord1dvARB, 377, MultiTexCoord1dvARB@8)
+ GL_STUB(MultiTexCoord1fARB, 378, MultiTexCoord1fARB@8)
+ GL_STUB(MultiTexCoord1fvARB, 379, MultiTexCoord1fvARB@8)
+ GL_STUB(MultiTexCoord1iARB, 380, MultiTexCoord1iARB@8)
+ GL_STUB(MultiTexCoord1ivARB, 381, MultiTexCoord1ivARB@8)
+ GL_STUB(MultiTexCoord1sARB, 382, MultiTexCoord1sARB@8)
+ GL_STUB(MultiTexCoord1svARB, 383, MultiTexCoord1svARB@8)
+ GL_STUB(MultiTexCoord2dARB, 384, MultiTexCoord2dARB@20)
+ GL_STUB(MultiTexCoord2dvARB, 385, MultiTexCoord2dvARB@8)
+ GL_STUB(MultiTexCoord2fARB, 386, MultiTexCoord2fARB@12)
+ GL_STUB(MultiTexCoord2fvARB, 387, MultiTexCoord2fvARB@8)
+ GL_STUB(MultiTexCoord2iARB, 388, MultiTexCoord2iARB@12)
+ GL_STUB(MultiTexCoord2ivARB, 389, MultiTexCoord2ivARB@8)
+ GL_STUB(MultiTexCoord2sARB, 390, MultiTexCoord2sARB@12)
+ GL_STUB(MultiTexCoord2svARB, 391, MultiTexCoord2svARB@8)
+ GL_STUB(MultiTexCoord3dARB, 392, MultiTexCoord3dARB@28)
+ GL_STUB(MultiTexCoord3dvARB, 393, MultiTexCoord3dvARB@8)
+ GL_STUB(MultiTexCoord3fARB, 394, MultiTexCoord3fARB@16)
+ GL_STUB(MultiTexCoord3fvARB, 395, MultiTexCoord3fvARB@8)
+ GL_STUB(MultiTexCoord3iARB, 396, MultiTexCoord3iARB@16)
+ GL_STUB(MultiTexCoord3ivARB, 397, MultiTexCoord3ivARB@8)
+ GL_STUB(MultiTexCoord3sARB, 398, MultiTexCoord3sARB@16)
+ GL_STUB(MultiTexCoord3svARB, 399, MultiTexCoord3svARB@8)
+ GL_STUB(MultiTexCoord4dARB, 400, MultiTexCoord4dARB@36)
+ GL_STUB(MultiTexCoord4dvARB, 401, MultiTexCoord4dvARB@8)
+ GL_STUB(MultiTexCoord4fARB, 402, MultiTexCoord4fARB@20)
+ GL_STUB(MultiTexCoord4fvARB, 403, MultiTexCoord4fvARB@8)
+ GL_STUB(MultiTexCoord4iARB, 404, MultiTexCoord4iARB@20)
+ GL_STUB(MultiTexCoord4ivARB, 405, MultiTexCoord4ivARB@8)
+ GL_STUB(MultiTexCoord4sARB, 406, MultiTexCoord4sARB@20)
+ GL_STUB(MultiTexCoord4svARB, 407, MultiTexCoord4svARB@8)
+ GL_STUB(AttachShader, 408, AttachShader@8)
+ GL_STUB(CreateProgram, 409, CreateProgram@0)
+ GL_STUB(CreateShader, 410, CreateShader@4)
+ GL_STUB(DeleteProgram, 411, DeleteProgram@4)
+ GL_STUB(DeleteShader, 412, DeleteShader@4)
+ GL_STUB(DetachShader, 413, DetachShader@8)
+ GL_STUB(GetAttachedShaders, 414, GetAttachedShaders@16)
+ GL_STUB(GetProgramInfoLog, 415, GetProgramInfoLog@16)
+ GL_STUB(GetProgramiv, 416, GetProgramiv@12)
+ GL_STUB(GetShaderInfoLog, 417, GetShaderInfoLog@16)
+ GL_STUB(GetShaderiv, 418, GetShaderiv@12)
+ GL_STUB(IsProgram, 419, IsProgram@4)
+ GL_STUB(IsShader, 420, IsShader@4)
+ GL_STUB(StencilFuncSeparate, 421, StencilFuncSeparate@16)
+ GL_STUB(StencilMaskSeparate, 422, StencilMaskSeparate@8)
+ GL_STUB(StencilOpSeparate, 423, StencilOpSeparate@16)
+ GL_STUB(UniformMatrix2x3fv, 424, UniformMatrix2x3fv@16)
+ GL_STUB(UniformMatrix2x4fv, 425, UniformMatrix2x4fv@16)
+ GL_STUB(UniformMatrix3x2fv, 426, UniformMatrix3x2fv@16)
+ GL_STUB(UniformMatrix3x4fv, 427, UniformMatrix3x4fv@16)
+ GL_STUB(UniformMatrix4x2fv, 428, UniformMatrix4x2fv@16)
+ GL_STUB(UniformMatrix4x3fv, 429, UniformMatrix4x3fv@16)
+ GL_STUB(ClampColor, 430, ClampColor@8)
+ GL_STUB(ClearBufferfi, 431, ClearBufferfi@16)
+ GL_STUB(ClearBufferfv, 432, ClearBufferfv@12)
+ GL_STUB(ClearBufferiv, 433, ClearBufferiv@12)
+ GL_STUB(ClearBufferuiv, 434, ClearBufferuiv@12)
+ GL_STUB(GetStringi, 435, GetStringi@8)
+ GL_STUB(TexBuffer, 436, TexBuffer@12)
+ GL_STUB(FramebufferTexture, 437, FramebufferTexture@16)
+ GL_STUB(GetBufferParameteri64v, 438, GetBufferParameteri64v@12)
+ GL_STUB(GetInteger64i_v, 439, GetInteger64i_v@12)
+ GL_STUB(VertexAttribDivisor, 440, VertexAttribDivisor@8)
+ GL_STUB(LoadTransposeMatrixdARB, 441, LoadTransposeMatrixdARB@4)
+ GL_STUB(LoadTransposeMatrixfARB, 442, LoadTransposeMatrixfARB@4)
+ GL_STUB(MultTransposeMatrixdARB, 443, MultTransposeMatrixdARB@4)
+ GL_STUB(MultTransposeMatrixfARB, 444, MultTransposeMatrixfARB@4)
+ GL_STUB(SampleCoverageARB, 445, SampleCoverageARB@8)
+ GL_STUB(CompressedTexImage1DARB, 446, CompressedTexImage1DARB@28)
+ GL_STUB(CompressedTexImage2DARB, 447, CompressedTexImage2DARB@32)
+ GL_STUB(CompressedTexImage3DARB, 448, CompressedTexImage3DARB@36)
+ GL_STUB(CompressedTexSubImage1DARB, 449, CompressedTexSubImage1DARB@28)
+ GL_STUB(CompressedTexSubImage2DARB, 450, CompressedTexSubImage2DARB@36)
+ GL_STUB(CompressedTexSubImage3DARB, 451, CompressedTexSubImage3DARB@44)
+ GL_STUB(GetCompressedTexImageARB, 452, GetCompressedTexImageARB@12)
+ GL_STUB(DisableVertexAttribArrayARB, 453, DisableVertexAttribArrayARB@4)
+ GL_STUB(EnableVertexAttribArrayARB, 454, EnableVertexAttribArrayARB@4)
+ GL_STUB(GetProgramEnvParameterdvARB, 455, GetProgramEnvParameterdvARB@12)
+ GL_STUB(GetProgramEnvParameterfvARB, 456, GetProgramEnvParameterfvARB@12)
+ GL_STUB(GetProgramLocalParameterdvARB, 457, GetProgramLocalParameterdvARB@12)
+ GL_STUB(GetProgramLocalParameterfvARB, 458, GetProgramLocalParameterfvARB@12)
+ GL_STUB(GetProgramStringARB, 459, GetProgramStringARB@12)
+ GL_STUB(GetProgramivARB, 460, GetProgramivARB@12)
+ GL_STUB(GetVertexAttribdvARB, 461, GetVertexAttribdvARB@12)
+ GL_STUB(GetVertexAttribfvARB, 462, GetVertexAttribfvARB@12)
+ GL_STUB(GetVertexAttribivARB, 463, GetVertexAttribivARB@12)
+ GL_STUB(ProgramEnvParameter4dARB, 464, ProgramEnvParameter4dARB@40)
+ GL_STUB(ProgramEnvParameter4dvARB, 465, ProgramEnvParameter4dvARB@12)
+ GL_STUB(ProgramEnvParameter4fARB, 466, ProgramEnvParameter4fARB@24)
+ GL_STUB(ProgramEnvParameter4fvARB, 467, ProgramEnvParameter4fvARB@12)
+ GL_STUB(ProgramLocalParameter4dARB, 468, ProgramLocalParameter4dARB@40)
+ GL_STUB(ProgramLocalParameter4dvARB, 469, ProgramLocalParameter4dvARB@12)
+ GL_STUB(ProgramLocalParameter4fARB, 470, ProgramLocalParameter4fARB@24)
+ GL_STUB(ProgramLocalParameter4fvARB, 471, ProgramLocalParameter4fvARB@12)
+ GL_STUB(ProgramStringARB, 472, ProgramStringARB@16)
+ GL_STUB(VertexAttrib1dARB, 473, VertexAttrib1dARB@12)
+ GL_STUB(VertexAttrib1dvARB, 474, VertexAttrib1dvARB@8)
+ GL_STUB(VertexAttrib1fARB, 475, VertexAttrib1fARB@8)
+ GL_STUB(VertexAttrib1fvARB, 476, VertexAttrib1fvARB@8)
+ GL_STUB(VertexAttrib1sARB, 477, VertexAttrib1sARB@8)
+ GL_STUB(VertexAttrib1svARB, 478, VertexAttrib1svARB@8)
+ GL_STUB(VertexAttrib2dARB, 479, VertexAttrib2dARB@20)
+ GL_STUB(VertexAttrib2dvARB, 480, VertexAttrib2dvARB@8)
+ GL_STUB(VertexAttrib2fARB, 481, VertexAttrib2fARB@12)
+ GL_STUB(VertexAttrib2fvARB, 482, VertexAttrib2fvARB@8)
+ GL_STUB(VertexAttrib2sARB, 483, VertexAttrib2sARB@12)
+ GL_STUB(VertexAttrib2svARB, 484, VertexAttrib2svARB@8)
+ GL_STUB(VertexAttrib3dARB, 485, VertexAttrib3dARB@28)
+ GL_STUB(VertexAttrib3dvARB, 486, VertexAttrib3dvARB@8)
+ GL_STUB(VertexAttrib3fARB, 487, VertexAttrib3fARB@16)
+ GL_STUB(VertexAttrib3fvARB, 488, VertexAttrib3fvARB@8)
+ GL_STUB(VertexAttrib3sARB, 489, VertexAttrib3sARB@16)
+ GL_STUB(VertexAttrib3svARB, 490, VertexAttrib3svARB@8)
+ GL_STUB(VertexAttrib4NbvARB, 491, VertexAttrib4NbvARB@8)
+ GL_STUB(VertexAttrib4NivARB, 492, VertexAttrib4NivARB@8)
+ GL_STUB(VertexAttrib4NsvARB, 493, VertexAttrib4NsvARB@8)
+ GL_STUB(VertexAttrib4NubARB, 494, VertexAttrib4NubARB@20)
+ GL_STUB(VertexAttrib4NubvARB, 495, VertexAttrib4NubvARB@8)
+ GL_STUB(VertexAttrib4NuivARB, 496, VertexAttrib4NuivARB@8)
+ GL_STUB(VertexAttrib4NusvARB, 497, VertexAttrib4NusvARB@8)
+ GL_STUB(VertexAttrib4bvARB, 498, VertexAttrib4bvARB@8)
+ GL_STUB(VertexAttrib4dARB, 499, VertexAttrib4dARB@36)
+ GL_STUB(VertexAttrib4dvARB, 500, VertexAttrib4dvARB@8)
+ GL_STUB(VertexAttrib4fARB, 501, VertexAttrib4fARB@20)
+ GL_STUB(VertexAttrib4fvARB, 502, VertexAttrib4fvARB@8)
+ GL_STUB(VertexAttrib4ivARB, 503, VertexAttrib4ivARB@8)
+ GL_STUB(VertexAttrib4sARB, 504, VertexAttrib4sARB@20)
+ GL_STUB(VertexAttrib4svARB, 505, VertexAttrib4svARB@8)
+ GL_STUB(VertexAttrib4ubvARB, 506, VertexAttrib4ubvARB@8)
+ GL_STUB(VertexAttrib4uivARB, 507, VertexAttrib4uivARB@8)
+ GL_STUB(VertexAttrib4usvARB, 508, VertexAttrib4usvARB@8)
+ GL_STUB(VertexAttribPointerARB, 509, VertexAttribPointerARB@24)
+ GL_STUB(BindBufferARB, 510, BindBufferARB@8)
+ GL_STUB(BufferDataARB, 511, BufferDataARB@16)
+ GL_STUB(BufferSubDataARB, 512, BufferSubDataARB@16)
+ GL_STUB(DeleteBuffersARB, 513, DeleteBuffersARB@8)
+ GL_STUB(GenBuffersARB, 514, GenBuffersARB@8)
+ GL_STUB(GetBufferParameterivARB, 515, GetBufferParameterivARB@12)
+ GL_STUB(GetBufferPointervARB, 516, GetBufferPointervARB@12)
+ GL_STUB(GetBufferSubDataARB, 517, GetBufferSubDataARB@16)
+ GL_STUB(IsBufferARB, 518, IsBufferARB@4)
+ GL_STUB(MapBufferARB, 519, MapBufferARB@8)
+ GL_STUB(UnmapBufferARB, 520, UnmapBufferARB@4)
+ GL_STUB(BeginQueryARB, 521, BeginQueryARB@8)
+ GL_STUB(DeleteQueriesARB, 522, DeleteQueriesARB@8)
+ GL_STUB(EndQueryARB, 523, EndQueryARB@4)
+ GL_STUB(GenQueriesARB, 524, GenQueriesARB@8)
+ GL_STUB(GetQueryObjectivARB, 525, GetQueryObjectivARB@12)
+ GL_STUB(GetQueryObjectuivARB, 526, GetQueryObjectuivARB@12)
+ GL_STUB(GetQueryivARB, 527, GetQueryivARB@12)
+ GL_STUB(IsQueryARB, 528, IsQueryARB@4)
+ GL_STUB(AttachObjectARB, 529, AttachObjectARB@8)
+ GL_STUB(CompileShaderARB, 530, CompileShaderARB@4)
+ GL_STUB(CreateProgramObjectARB, 531, CreateProgramObjectARB@0)
+ GL_STUB(CreateShaderObjectARB, 532, CreateShaderObjectARB@4)
+ GL_STUB(DeleteObjectARB, 533, DeleteObjectARB@4)
+ GL_STUB(DetachObjectARB, 534, DetachObjectARB@8)
+ GL_STUB(GetActiveUniformARB, 535, GetActiveUniformARB@28)
+ GL_STUB(GetAttachedObjectsARB, 536, GetAttachedObjectsARB@16)
+ GL_STUB(GetHandleARB, 537, GetHandleARB@4)
+ GL_STUB(GetInfoLogARB, 538, GetInfoLogARB@16)
+ GL_STUB(GetObjectParameterfvARB, 539, GetObjectParameterfvARB@12)
+ GL_STUB(GetObjectParameterivARB, 540, GetObjectParameterivARB@12)
+ GL_STUB(GetShaderSourceARB, 541, GetShaderSourceARB@16)
+ GL_STUB(GetUniformLocationARB, 542, GetUniformLocationARB@8)
+ GL_STUB(GetUniformfvARB, 543, GetUniformfvARB@12)
+ GL_STUB(GetUniformivARB, 544, GetUniformivARB@12)
+ GL_STUB(LinkProgramARB, 545, LinkProgramARB@4)
+ GL_STUB(ShaderSourceARB, 546, ShaderSourceARB@16)
+ GL_STUB(Uniform1fARB, 547, Uniform1fARB@8)
+ GL_STUB(Uniform1fvARB, 548, Uniform1fvARB@12)
+ GL_STUB(Uniform1iARB, 549, Uniform1iARB@8)
+ GL_STUB(Uniform1ivARB, 550, Uniform1ivARB@12)
+ GL_STUB(Uniform2fARB, 551, Uniform2fARB@12)
+ GL_STUB(Uniform2fvARB, 552, Uniform2fvARB@12)
+ GL_STUB(Uniform2iARB, 553, Uniform2iARB@12)
+ GL_STUB(Uniform2ivARB, 554, Uniform2ivARB@12)
+ GL_STUB(Uniform3fARB, 555, Uniform3fARB@16)
+ GL_STUB(Uniform3fvARB, 556, Uniform3fvARB@12)
+ GL_STUB(Uniform3iARB, 557, Uniform3iARB@16)
+ GL_STUB(Uniform3ivARB, 558, Uniform3ivARB@12)
+ GL_STUB(Uniform4fARB, 559, Uniform4fARB@20)
+ GL_STUB(Uniform4fvARB, 560, Uniform4fvARB@12)
+ GL_STUB(Uniform4iARB, 561, Uniform4iARB@20)
+ GL_STUB(Uniform4ivARB, 562, Uniform4ivARB@12)
+ GL_STUB(UniformMatrix2fvARB, 563, UniformMatrix2fvARB@16)
+ GL_STUB(UniformMatrix3fvARB, 564, UniformMatrix3fvARB@16)
+ GL_STUB(UniformMatrix4fvARB, 565, UniformMatrix4fvARB@16)
+ GL_STUB(UseProgramObjectARB, 566, UseProgramObjectARB@4)
+ GL_STUB(ValidateProgramARB, 567, ValidateProgramARB@4)
+ GL_STUB(BindAttribLocationARB, 568, BindAttribLocationARB@12)
+ GL_STUB(GetActiveAttribARB, 569, GetActiveAttribARB@28)
+ GL_STUB(GetAttribLocationARB, 570, GetAttribLocationARB@8)
+ GL_STUB(DrawBuffersARB, 571, DrawBuffersARB@8)
+ GL_STUB(ClampColorARB, 572, ClampColorARB@8)
+ GL_STUB(DrawArraysInstancedARB, 573, DrawArraysInstancedARB@16)
+ GL_STUB(DrawElementsInstancedARB, 574, DrawElementsInstancedARB@20)
+ GL_STUB(RenderbufferStorageMultisample, 575, RenderbufferStorageMultisample@20)
+ GL_STUB(FramebufferTextureARB, 576, FramebufferTextureARB@16)
+ GL_STUB(FramebufferTextureFaceARB, 577, FramebufferTextureFaceARB@20)
+ GL_STUB(ProgramParameteriARB, 578, ProgramParameteriARB@12)
+ GL_STUB(VertexAttribDivisorARB, 579, VertexAttribDivisorARB@8)
+ GL_STUB(FlushMappedBufferRange, 580, FlushMappedBufferRange@12)
+ GL_STUB(MapBufferRange, 581, MapBufferRange@16)
+ GL_STUB(TexBufferARB, 582, TexBufferARB@12)
+ GL_STUB(BindVertexArray, 583, BindVertexArray@4)
+ GL_STUB(GenVertexArrays, 584, GenVertexArrays@8)
+ GL_STUB(CopyBufferSubData, 585, CopyBufferSubData@20)
+ GL_STUB(ClientWaitSync, 586, ClientWaitSync@12)
+ GL_STUB(DeleteSync, 587, DeleteSync@4)
+ GL_STUB(FenceSync, 588, FenceSync@8)
+ GL_STUB(GetInteger64v, 589, GetInteger64v@8)
+ GL_STUB(GetSynciv, 590, GetSynciv@20)
+ GL_STUB(IsSync, 591, IsSync@4)
+ GL_STUB(WaitSync, 592, WaitSync@12)
+ GL_STUB(DrawElementsBaseVertex, 593, DrawElementsBaseVertex@20)
+ GL_STUB(DrawRangeElementsBaseVertex, 594, DrawRangeElementsBaseVertex@28)
+ GL_STUB(MultiDrawElementsBaseVertex, 595, MultiDrawElementsBaseVertex@24)
+ GL_STUB(BlendEquationSeparateiARB, 596, BlendEquationSeparateiARB@12)
+ GL_STUB(BlendEquationiARB, 597, BlendEquationiARB@8)
+ GL_STUB(BlendFuncSeparateiARB, 598, BlendFuncSeparateiARB@20)
+ GL_STUB(BlendFunciARB, 599, BlendFunciARB@12)
+ GL_STUB(BindSampler, 600, BindSampler@8)
+ GL_STUB(DeleteSamplers, 601, DeleteSamplers@8)
+ GL_STUB(GenSamplers, 602, GenSamplers@8)
+ GL_STUB(GetSamplerParameterIiv, 603, GetSamplerParameterIiv@12)
+ GL_STUB(GetSamplerParameterIuiv, 604, GetSamplerParameterIuiv@12)
+ GL_STUB(GetSamplerParameterfv, 605, GetSamplerParameterfv@12)
+ GL_STUB(GetSamplerParameteriv, 606, GetSamplerParameteriv@12)
+ GL_STUB(IsSampler, 607, IsSampler@4)
+ GL_STUB(SamplerParameterIiv, 608, SamplerParameterIiv@12)
+ GL_STUB(SamplerParameterIuiv, 609, SamplerParameterIuiv@12)
+ GL_STUB(SamplerParameterf, 610, SamplerParameterf@12)
+ GL_STUB(SamplerParameterfv, 611, SamplerParameterfv@12)
+ GL_STUB(SamplerParameteri, 612, SamplerParameteri@12)
+ GL_STUB(SamplerParameteriv, 613, SamplerParameteriv@12)
+ GL_STUB(BindTransformFeedback, 614, BindTransformFeedback@8)
+ GL_STUB(DeleteTransformFeedbacks, 615, DeleteTransformFeedbacks@8)
+ GL_STUB(DrawTransformFeedback, 616, DrawTransformFeedback@8)
+ GL_STUB(GenTransformFeedbacks, 617, GenTransformFeedbacks@8)
+ GL_STUB(IsTransformFeedback, 618, IsTransformFeedback@4)
+ GL_STUB(PauseTransformFeedback, 619, PauseTransformFeedback@0)
+ GL_STUB(ResumeTransformFeedback, 620, ResumeTransformFeedback@0)
+ GL_STUB(ClearDepthf, 621, ClearDepthf@4)
+ GL_STUB(DepthRangef, 622, DepthRangef@8)
+ GL_STUB(GetShaderPrecisionFormat, 623, GetShaderPrecisionFormat@16)
+ GL_STUB(ReleaseShaderCompiler, 624, ReleaseShaderCompiler@0)
+ GL_STUB(ShaderBinary, 625, ShaderBinary@20)
+ GL_STUB(GetGraphicsResetStatusARB, 626, GetGraphicsResetStatusARB@0)
+ GL_STUB(GetnColorTableARB, 627, GetnColorTableARB@20)
+ GL_STUB(GetnCompressedTexImageARB, 628, GetnCompressedTexImageARB@16)
+ GL_STUB(GetnConvolutionFilterARB, 629, GetnConvolutionFilterARB@20)
+ GL_STUB(GetnHistogramARB, 630, GetnHistogramARB@24)
+ GL_STUB(GetnMapdvARB, 631, GetnMapdvARB@16)
+ GL_STUB(GetnMapfvARB, 632, GetnMapfvARB@16)
+ GL_STUB(GetnMapivARB, 633, GetnMapivARB@16)
+ GL_STUB(GetnMinmaxARB, 634, GetnMinmaxARB@24)
+ GL_STUB(GetnPixelMapfvARB, 635, GetnPixelMapfvARB@12)
+ GL_STUB(GetnPixelMapuivARB, 636, GetnPixelMapuivARB@12)
+ GL_STUB(GetnPixelMapusvARB, 637, GetnPixelMapusvARB@12)
+ GL_STUB(GetnPolygonStippleARB, 638, GetnPolygonStippleARB@8)
+ GL_STUB(GetnSeparableFilterARB, 639, GetnSeparableFilterARB@32)
+ GL_STUB(GetnTexImageARB, 640, GetnTexImageARB@24)
+ GL_STUB(GetnUniformdvARB, 641, GetnUniformdvARB@16)
+ GL_STUB(GetnUniformfvARB, 642, GetnUniformfvARB@16)
+ GL_STUB(GetnUniformivARB, 643, GetnUniformivARB@16)
+ GL_STUB(GetnUniformuivARB, 644, GetnUniformuivARB@16)
+ GL_STUB(ReadnPixelsARB, 645, ReadnPixelsARB@32)
+ GL_STUB(PolygonOffsetEXT, 646, PolygonOffsetEXT@8)
+ GL_STUB(_dispatch_stub_647, 647, _dispatch_stub_647@8)
+ HIDDEN(GL_PREFIX(_dispatch_stub_647, _dispatch_stub_647@8))
+ GL_STUB(_dispatch_stub_648, 648, _dispatch_stub_648@8)
+ HIDDEN(GL_PREFIX(_dispatch_stub_648, _dispatch_stub_648@8))
+ GL_STUB(_dispatch_stub_649, 649, _dispatch_stub_649@8)
+ HIDDEN(GL_PREFIX(_dispatch_stub_649, _dispatch_stub_649@8))
+ GL_STUB(_dispatch_stub_650, 650, _dispatch_stub_650@8)
+ HIDDEN(GL_PREFIX(_dispatch_stub_650, _dispatch_stub_650@8))
+ GL_STUB(_dispatch_stub_651, 651, _dispatch_stub_651@8)
+ HIDDEN(GL_PREFIX(_dispatch_stub_651, _dispatch_stub_651@8))
+ GL_STUB(_dispatch_stub_652, 652, _dispatch_stub_652@8)
+ HIDDEN(GL_PREFIX(_dispatch_stub_652, _dispatch_stub_652@8))
+ GL_STUB(_dispatch_stub_653, 653, _dispatch_stub_653@8)
+ HIDDEN(GL_PREFIX(_dispatch_stub_653, _dispatch_stub_653@8))
+ GL_STUB(_dispatch_stub_654, 654, _dispatch_stub_654@4)
+ HIDDEN(GL_PREFIX(_dispatch_stub_654, _dispatch_stub_654@4))
+ GL_STUB(ColorPointerEXT, 655, ColorPointerEXT@20)
+ GL_STUB(EdgeFlagPointerEXT, 656, EdgeFlagPointerEXT@12)
+ GL_STUB(IndexPointerEXT, 657, IndexPointerEXT@16)
+ GL_STUB(NormalPointerEXT, 658, NormalPointerEXT@16)
+ GL_STUB(TexCoordPointerEXT, 659, TexCoordPointerEXT@20)
+ GL_STUB(VertexPointerEXT, 660, VertexPointerEXT@20)
+ GL_STUB(PointParameterfEXT, 661, PointParameterfEXT@8)
+ GL_STUB(PointParameterfvEXT, 662, PointParameterfvEXT@8)
+ GL_STUB(LockArraysEXT, 663, LockArraysEXT@8)
+ GL_STUB(UnlockArraysEXT, 664, UnlockArraysEXT@0)
+ GL_STUB(SecondaryColor3bEXT, 665, SecondaryColor3bEXT@12)
+ GL_STUB(SecondaryColor3bvEXT, 666, SecondaryColor3bvEXT@4)
+ GL_STUB(SecondaryColor3dEXT, 667, SecondaryColor3dEXT@24)
+ GL_STUB(SecondaryColor3dvEXT, 668, SecondaryColor3dvEXT@4)
+ GL_STUB(SecondaryColor3fEXT, 669, SecondaryColor3fEXT@12)
+ GL_STUB(SecondaryColor3fvEXT, 670, SecondaryColor3fvEXT@4)
+ GL_STUB(SecondaryColor3iEXT, 671, SecondaryColor3iEXT@12)
+ GL_STUB(SecondaryColor3ivEXT, 672, SecondaryColor3ivEXT@4)
+ GL_STUB(SecondaryColor3sEXT, 673, SecondaryColor3sEXT@12)
+ GL_STUB(SecondaryColor3svEXT, 674, SecondaryColor3svEXT@4)
+ GL_STUB(SecondaryColor3ubEXT, 675, SecondaryColor3ubEXT@12)
+ GL_STUB(SecondaryColor3ubvEXT, 676, SecondaryColor3ubvEXT@4)
+ GL_STUB(SecondaryColor3uiEXT, 677, SecondaryColor3uiEXT@12)
+ GL_STUB(SecondaryColor3uivEXT, 678, SecondaryColor3uivEXT@4)
+ GL_STUB(SecondaryColor3usEXT, 679, SecondaryColor3usEXT@12)
+ GL_STUB(SecondaryColor3usvEXT, 680, SecondaryColor3usvEXT@4)
+ GL_STUB(SecondaryColorPointerEXT, 681, SecondaryColorPointerEXT@16)
+ GL_STUB(MultiDrawArraysEXT, 682, MultiDrawArraysEXT@16)
+ GL_STUB(MultiDrawElementsEXT, 683, MultiDrawElementsEXT@20)
+ GL_STUB(FogCoordPointerEXT, 684, FogCoordPointerEXT@12)
+ GL_STUB(FogCoorddEXT, 685, FogCoorddEXT@8)
+ GL_STUB(FogCoorddvEXT, 686, FogCoorddvEXT@4)
+ GL_STUB(FogCoordfEXT, 687, FogCoordfEXT@4)
+ GL_STUB(FogCoordfvEXT, 688, FogCoordfvEXT@4)
+ GL_STUB(_dispatch_stub_689, 689, _dispatch_stub_689@4)
+ HIDDEN(GL_PREFIX(_dispatch_stub_689, _dispatch_stub_689@4))
+ GL_STUB(BlendFuncSeparateEXT, 690, BlendFuncSeparateEXT@16)
+ GL_STUB(FlushVertexArrayRangeNV, 691, FlushVertexArrayRangeNV@0)
+ GL_STUB(VertexArrayRangeNV, 692, VertexArrayRangeNV@8)
+ GL_STUB(CombinerInputNV, 693, CombinerInputNV@24)
+ GL_STUB(CombinerOutputNV, 694, CombinerOutputNV@40)
+ GL_STUB(CombinerParameterfNV, 695, CombinerParameterfNV@8)
+ GL_STUB(CombinerParameterfvNV, 696, CombinerParameterfvNV@8)
+ GL_STUB(CombinerParameteriNV, 697, CombinerParameteriNV@8)
+ GL_STUB(CombinerParameterivNV, 698, CombinerParameterivNV@8)
+ GL_STUB(FinalCombinerInputNV, 699, FinalCombinerInputNV@16)
+ GL_STUB(GetCombinerInputParameterfvNV, 700, GetCombinerInputParameterfvNV@20)
+ GL_STUB(GetCombinerInputParameterivNV, 701, GetCombinerInputParameterivNV@20)
+ GL_STUB(GetCombinerOutputParameterfvNV, 702, GetCombinerOutputParameterfvNV@16)
+ GL_STUB(GetCombinerOutputParameterivNV, 703, GetCombinerOutputParameterivNV@16)
+ GL_STUB(GetFinalCombinerInputParameterfvNV, 704, GetFinalCombinerInputParameterfvNV@12)
+ GL_STUB(GetFinalCombinerInputParameterivNV, 705, GetFinalCombinerInputParameterivNV@12)
+ GL_STUB(ResizeBuffersMESA, 706, ResizeBuffersMESA@0)
+ GL_STUB(WindowPos2dMESA, 707, WindowPos2dMESA@16)
+ GL_STUB(WindowPos2dvMESA, 708, WindowPos2dvMESA@4)
+ GL_STUB(WindowPos2fMESA, 709, WindowPos2fMESA@8)
+ GL_STUB(WindowPos2fvMESA, 710, WindowPos2fvMESA@4)
+ GL_STUB(WindowPos2iMESA, 711, WindowPos2iMESA@8)
+ GL_STUB(WindowPos2ivMESA, 712, WindowPos2ivMESA@4)
+ GL_STUB(WindowPos2sMESA, 713, WindowPos2sMESA@8)
+ GL_STUB(WindowPos2svMESA, 714, WindowPos2svMESA@4)
+ GL_STUB(WindowPos3dMESA, 715, WindowPos3dMESA@24)
+ GL_STUB(WindowPos3dvMESA, 716, WindowPos3dvMESA@4)
+ GL_STUB(WindowPos3fMESA, 717, WindowPos3fMESA@12)
+ GL_STUB(WindowPos3fvMESA, 718, WindowPos3fvMESA@4)
+ GL_STUB(WindowPos3iMESA, 719, WindowPos3iMESA@12)
+ GL_STUB(WindowPos3ivMESA, 720, WindowPos3ivMESA@4)
+ GL_STUB(WindowPos3sMESA, 721, WindowPos3sMESA@12)
+ GL_STUB(WindowPos3svMESA, 722, WindowPos3svMESA@4)
+ GL_STUB(WindowPos4dMESA, 723, WindowPos4dMESA@32)
+ GL_STUB(WindowPos4dvMESA, 724, WindowPos4dvMESA@4)
+ GL_STUB(WindowPos4fMESA, 725, WindowPos4fMESA@16)
+ GL_STUB(WindowPos4fvMESA, 726, WindowPos4fvMESA@4)
+ GL_STUB(WindowPos4iMESA, 727, WindowPos4iMESA@16)
+ GL_STUB(WindowPos4ivMESA, 728, WindowPos4ivMESA@4)
+ GL_STUB(WindowPos4sMESA, 729, WindowPos4sMESA@16)
+ GL_STUB(WindowPos4svMESA, 730, WindowPos4svMESA@4)
+ GL_STUB(_dispatch_stub_731, 731, _dispatch_stub_731@20)
+ HIDDEN(GL_PREFIX(_dispatch_stub_731, _dispatch_stub_731@20))
+ GL_STUB(_dispatch_stub_732, 732, _dispatch_stub_732@24)
+ HIDDEN(GL_PREFIX(_dispatch_stub_732, _dispatch_stub_732@24))
+ GL_STUB(_dispatch_stub_733, 733, _dispatch_stub_733@8)
+ HIDDEN(GL_PREFIX(_dispatch_stub_733, _dispatch_stub_733@8))
+ GL_STUB(_dispatch_stub_734, 734, _dispatch_stub_734@4)
+ HIDDEN(GL_PREFIX(_dispatch_stub_734, _dispatch_stub_734@4))
+ GL_STUB(_dispatch_stub_735, 735, _dispatch_stub_735@8)
+ HIDDEN(GL_PREFIX(_dispatch_stub_735, _dispatch_stub_735@8))
+ GL_STUB(_dispatch_stub_736, 736, _dispatch_stub_736@12)
+ HIDDEN(GL_PREFIX(_dispatch_stub_736, _dispatch_stub_736@12))
+ GL_STUB(_dispatch_stub_737, 737, _dispatch_stub_737@4)
+ HIDDEN(GL_PREFIX(_dispatch_stub_737, _dispatch_stub_737@4))
+ GL_STUB(_dispatch_stub_738, 738, _dispatch_stub_738@8)
+ HIDDEN(GL_PREFIX(_dispatch_stub_738, _dispatch_stub_738@8))
+ GL_STUB(_dispatch_stub_739, 739, _dispatch_stub_739@4)
+ HIDDEN(GL_PREFIX(_dispatch_stub_739, _dispatch_stub_739@4))
+ GL_STUB(AreProgramsResidentNV, 740, AreProgramsResidentNV@12)
+ GL_STUB(BindProgramNV, 741, BindProgramNV@8)
+ GL_STUB(DeleteProgramsNV, 742, DeleteProgramsNV@8)
+ GL_STUB(ExecuteProgramNV, 743, ExecuteProgramNV@12)
+ GL_STUB(GenProgramsNV, 744, GenProgramsNV@8)
+ GL_STUB(GetProgramParameterdvNV, 745, GetProgramParameterdvNV@16)
+ GL_STUB(GetProgramParameterfvNV, 746, GetProgramParameterfvNV@16)
+ GL_STUB(GetProgramStringNV, 747, GetProgramStringNV@12)
+ GL_STUB(GetProgramivNV, 748, GetProgramivNV@12)
+ GL_STUB(GetTrackMatrixivNV, 749, GetTrackMatrixivNV@16)
+ GL_STUB(GetVertexAttribPointervNV, 750, GetVertexAttribPointervNV@12)
+ GL_STUB(GetVertexAttribdvNV, 751, GetVertexAttribdvNV@12)
+ GL_STUB(GetVertexAttribfvNV, 752, GetVertexAttribfvNV@12)
+ GL_STUB(GetVertexAttribivNV, 753, GetVertexAttribivNV@12)
+ GL_STUB(IsProgramNV, 754, IsProgramNV@4)
+ GL_STUB(LoadProgramNV, 755, LoadProgramNV@16)
+ GL_STUB(ProgramParameters4dvNV, 756, ProgramParameters4dvNV@16)
+ GL_STUB(ProgramParameters4fvNV, 757, ProgramParameters4fvNV@16)
+ GL_STUB(RequestResidentProgramsNV, 758, RequestResidentProgramsNV@8)
+ GL_STUB(TrackMatrixNV, 759, TrackMatrixNV@16)
+ GL_STUB(VertexAttrib1dNV, 760, VertexAttrib1dNV@12)
+ GL_STUB(VertexAttrib1dvNV, 761, VertexAttrib1dvNV@8)
+ GL_STUB(VertexAttrib1fNV, 762, VertexAttrib1fNV@8)
+ GL_STUB(VertexAttrib1fvNV, 763, VertexAttrib1fvNV@8)
+ GL_STUB(VertexAttrib1sNV, 764, VertexAttrib1sNV@8)
+ GL_STUB(VertexAttrib1svNV, 765, VertexAttrib1svNV@8)
+ GL_STUB(VertexAttrib2dNV, 766, VertexAttrib2dNV@20)
+ GL_STUB(VertexAttrib2dvNV, 767, VertexAttrib2dvNV@8)
+ GL_STUB(VertexAttrib2fNV, 768, VertexAttrib2fNV@12)
+ GL_STUB(VertexAttrib2fvNV, 769, VertexAttrib2fvNV@8)
+ GL_STUB(VertexAttrib2sNV, 770, VertexAttrib2sNV@12)
+ GL_STUB(VertexAttrib2svNV, 771, VertexAttrib2svNV@8)
+ GL_STUB(VertexAttrib3dNV, 772, VertexAttrib3dNV@28)
+ GL_STUB(VertexAttrib3dvNV, 773, VertexAttrib3dvNV@8)
+ GL_STUB(VertexAttrib3fNV, 774, VertexAttrib3fNV@16)
+ GL_STUB(VertexAttrib3fvNV, 775, VertexAttrib3fvNV@8)
+ GL_STUB(VertexAttrib3sNV, 776, VertexAttrib3sNV@16)
+ GL_STUB(VertexAttrib3svNV, 777, VertexAttrib3svNV@8)
+ GL_STUB(VertexAttrib4dNV, 778, VertexAttrib4dNV@36)
+ GL_STUB(VertexAttrib4dvNV, 779, VertexAttrib4dvNV@8)
+ GL_STUB(VertexAttrib4fNV, 780, VertexAttrib4fNV@20)
+ GL_STUB(VertexAttrib4fvNV, 781, VertexAttrib4fvNV@8)
+ GL_STUB(VertexAttrib4sNV, 782, VertexAttrib4sNV@20)
+ GL_STUB(VertexAttrib4svNV, 783, VertexAttrib4svNV@8)
+ GL_STUB(VertexAttrib4ubNV, 784, VertexAttrib4ubNV@20)
+ GL_STUB(VertexAttrib4ubvNV, 785, VertexAttrib4ubvNV@8)
+ GL_STUB(VertexAttribPointerNV, 786, VertexAttribPointerNV@20)
+ GL_STUB(VertexAttribs1dvNV, 787, VertexAttribs1dvNV@12)
+ GL_STUB(VertexAttribs1fvNV, 788, VertexAttribs1fvNV@12)
+ GL_STUB(VertexAttribs1svNV, 789, VertexAttribs1svNV@12)
+ GL_STUB(VertexAttribs2dvNV, 790, VertexAttribs2dvNV@12)
+ GL_STUB(VertexAttribs2fvNV, 791, VertexAttribs2fvNV@12)
+ GL_STUB(VertexAttribs2svNV, 792, VertexAttribs2svNV@12)
+ GL_STUB(VertexAttribs3dvNV, 793, VertexAttribs3dvNV@12)
+ GL_STUB(VertexAttribs3fvNV, 794, VertexAttribs3fvNV@12)
+ GL_STUB(VertexAttribs3svNV, 795, VertexAttribs3svNV@12)
+ GL_STUB(VertexAttribs4dvNV, 796, VertexAttribs4dvNV@12)
+ GL_STUB(VertexAttribs4fvNV, 797, VertexAttribs4fvNV@12)
+ GL_STUB(VertexAttribs4svNV, 798, VertexAttribs4svNV@12)
+ GL_STUB(VertexAttribs4ubvNV, 799, VertexAttribs4ubvNV@12)
+ GL_STUB(GetTexBumpParameterfvATI, 800, GetTexBumpParameterfvATI@8)
+ GL_STUB(GetTexBumpParameterivATI, 801, GetTexBumpParameterivATI@8)
+ GL_STUB(TexBumpParameterfvATI, 802, TexBumpParameterfvATI@8)
+ GL_STUB(TexBumpParameterivATI, 803, TexBumpParameterivATI@8)
+ GL_STUB(AlphaFragmentOp1ATI, 804, AlphaFragmentOp1ATI@24)
+ GL_STUB(AlphaFragmentOp2ATI, 805, AlphaFragmentOp2ATI@36)
+ GL_STUB(AlphaFragmentOp3ATI, 806, AlphaFragmentOp3ATI@48)
+ GL_STUB(BeginFragmentShaderATI, 807, BeginFragmentShaderATI@0)
+ GL_STUB(BindFragmentShaderATI, 808, BindFragmentShaderATI@4)
+ GL_STUB(ColorFragmentOp1ATI, 809, ColorFragmentOp1ATI@28)
+ GL_STUB(ColorFragmentOp2ATI, 810, ColorFragmentOp2ATI@40)
+ GL_STUB(ColorFragmentOp3ATI, 811, ColorFragmentOp3ATI@52)
+ GL_STUB(DeleteFragmentShaderATI, 812, DeleteFragmentShaderATI@4)
+ GL_STUB(EndFragmentShaderATI, 813, EndFragmentShaderATI@0)
+ GL_STUB(GenFragmentShadersATI, 814, GenFragmentShadersATI@4)
+ GL_STUB(PassTexCoordATI, 815, PassTexCoordATI@12)
+ GL_STUB(SampleMapATI, 816, SampleMapATI@12)
+ GL_STUB(SetFragmentShaderConstantATI, 817, SetFragmentShaderConstantATI@8)
+ GL_STUB(PointParameteriNV, 818, PointParameteriNV@8)
+ GL_STUB(PointParameterivNV, 819, PointParameterivNV@8)
+ GL_STUB(_dispatch_stub_820, 820, _dispatch_stub_820@4)
+ HIDDEN(GL_PREFIX(_dispatch_stub_820, _dispatch_stub_820@4))
+ GL_STUB(_dispatch_stub_821, 821, _dispatch_stub_821@4)
+ HIDDEN(GL_PREFIX(_dispatch_stub_821, _dispatch_stub_821@4))
+ GL_STUB(_dispatch_stub_822, 822, _dispatch_stub_822@8)
+ HIDDEN(GL_PREFIX(_dispatch_stub_822, _dispatch_stub_822@8))
+ GL_STUB(_dispatch_stub_823, 823, _dispatch_stub_823@8)
+ HIDDEN(GL_PREFIX(_dispatch_stub_823, _dispatch_stub_823@8))
+ GL_STUB(_dispatch_stub_824, 824, _dispatch_stub_824@4)
+ HIDDEN(GL_PREFIX(_dispatch_stub_824, _dispatch_stub_824@4))
+ GL_STUB(GetProgramNamedParameterdvNV, 825, GetProgramNamedParameterdvNV@16)
+ GL_STUB(GetProgramNamedParameterfvNV, 826, GetProgramNamedParameterfvNV@16)
+ GL_STUB(ProgramNamedParameter4dNV, 827, ProgramNamedParameter4dNV@44)
+ GL_STUB(ProgramNamedParameter4dvNV, 828, ProgramNamedParameter4dvNV@16)
+ GL_STUB(ProgramNamedParameter4fNV, 829, ProgramNamedParameter4fNV@28)
+ GL_STUB(ProgramNamedParameter4fvNV, 830, ProgramNamedParameter4fvNV@16)
+ GL_STUB(PrimitiveRestartIndexNV, 831, PrimitiveRestartIndexNV@4)
+ GL_STUB(PrimitiveRestartNV, 832, PrimitiveRestartNV@0)
+ GL_STUB(_dispatch_stub_833, 833, _dispatch_stub_833@16)
+ HIDDEN(GL_PREFIX(_dispatch_stub_833, _dispatch_stub_833@16))
+ GL_STUB(_dispatch_stub_834, 834, _dispatch_stub_834@8)
+ HIDDEN(GL_PREFIX(_dispatch_stub_834, _dispatch_stub_834@8))
+ GL_STUB(BindFramebufferEXT, 835, BindFramebufferEXT@8)
+ GL_STUB(BindRenderbufferEXT, 836, BindRenderbufferEXT@8)
+ GL_STUB(CheckFramebufferStatusEXT, 837, CheckFramebufferStatusEXT@4)
+ GL_STUB(DeleteFramebuffersEXT, 838, DeleteFramebuffersEXT@8)
+ GL_STUB(DeleteRenderbuffersEXT, 839, DeleteRenderbuffersEXT@8)
+ GL_STUB(FramebufferRenderbufferEXT, 840, FramebufferRenderbufferEXT@16)
+ GL_STUB(FramebufferTexture1DEXT, 841, FramebufferTexture1DEXT@20)
+ GL_STUB(FramebufferTexture2DEXT, 842, FramebufferTexture2DEXT@20)
+ GL_STUB(FramebufferTexture3DEXT, 843, FramebufferTexture3DEXT@24)
+ GL_STUB(GenFramebuffersEXT, 844, GenFramebuffersEXT@8)
+ GL_STUB(GenRenderbuffersEXT, 845, GenRenderbuffersEXT@8)
+ GL_STUB(GenerateMipmapEXT, 846, GenerateMipmapEXT@4)
+ GL_STUB(GetFramebufferAttachmentParameterivEXT, 847, GetFramebufferAttachmentParameterivEXT@16)
+ GL_STUB(GetRenderbufferParameterivEXT, 848, GetRenderbufferParameterivEXT@12)
+ GL_STUB(IsFramebufferEXT, 849, IsFramebufferEXT@4)
+ GL_STUB(IsRenderbufferEXT, 850, IsRenderbufferEXT@4)
+ GL_STUB(RenderbufferStorageEXT, 851, RenderbufferStorageEXT@16)
+ GL_STUB(_dispatch_stub_852, 852, _dispatch_stub_852@40)
+ HIDDEN(GL_PREFIX(_dispatch_stub_852, _dispatch_stub_852@40))
+ GL_STUB(_dispatch_stub_853, 853, _dispatch_stub_853@12)
+ HIDDEN(GL_PREFIX(_dispatch_stub_853, _dispatch_stub_853@12))
+ GL_STUB(_dispatch_stub_854, 854, _dispatch_stub_854@12)
+ HIDDEN(GL_PREFIX(_dispatch_stub_854, _dispatch_stub_854@12))
+ GL_STUB(BindFragDataLocationEXT, 855, BindFragDataLocationEXT@12)
+ GL_STUB(GetFragDataLocationEXT, 856, GetFragDataLocationEXT@8)
+ GL_STUB(GetUniformuivEXT, 857, GetUniformuivEXT@12)
+ GL_STUB(GetVertexAttribIivEXT, 858, GetVertexAttribIivEXT@12)
+ GL_STUB(GetVertexAttribIuivEXT, 859, GetVertexAttribIuivEXT@12)
+ GL_STUB(Uniform1uiEXT, 860, Uniform1uiEXT@8)
+ GL_STUB(Uniform1uivEXT, 861, Uniform1uivEXT@12)
+ GL_STUB(Uniform2uiEXT, 862, Uniform2uiEXT@12)
+ GL_STUB(Uniform2uivEXT, 863, Uniform2uivEXT@12)
+ GL_STUB(Uniform3uiEXT, 864, Uniform3uiEXT@16)
+ GL_STUB(Uniform3uivEXT, 865, Uniform3uivEXT@12)
+ GL_STUB(Uniform4uiEXT, 866, Uniform4uiEXT@20)
+ GL_STUB(Uniform4uivEXT, 867, Uniform4uivEXT@12)
+ GL_STUB(VertexAttribI1iEXT, 868, VertexAttribI1iEXT@8)
+ GL_STUB(VertexAttribI1ivEXT, 869, VertexAttribI1ivEXT@8)
+ GL_STUB(VertexAttribI1uiEXT, 870, VertexAttribI1uiEXT@8)
+ GL_STUB(VertexAttribI1uivEXT, 871, VertexAttribI1uivEXT@8)
+ GL_STUB(VertexAttribI2iEXT, 872, VertexAttribI2iEXT@12)
+ GL_STUB(VertexAttribI2ivEXT, 873, VertexAttribI2ivEXT@8)
+ GL_STUB(VertexAttribI2uiEXT, 874, VertexAttribI2uiEXT@12)
+ GL_STUB(VertexAttribI2uivEXT, 875, VertexAttribI2uivEXT@8)
+ GL_STUB(VertexAttribI3iEXT, 876, VertexAttribI3iEXT@16)
+ GL_STUB(VertexAttribI3ivEXT, 877, VertexAttribI3ivEXT@8)
+ GL_STUB(VertexAttribI3uiEXT, 878, VertexAttribI3uiEXT@16)
+ GL_STUB(VertexAttribI3uivEXT, 879, VertexAttribI3uivEXT@8)
+ GL_STUB(VertexAttribI4bvEXT, 880, VertexAttribI4bvEXT@8)
+ GL_STUB(VertexAttribI4iEXT, 881, VertexAttribI4iEXT@20)
+ GL_STUB(VertexAttribI4ivEXT, 882, VertexAttribI4ivEXT@8)
+ GL_STUB(VertexAttribI4svEXT, 883, VertexAttribI4svEXT@8)
+ GL_STUB(VertexAttribI4ubvEXT, 884, VertexAttribI4ubvEXT@8)
+ GL_STUB(VertexAttribI4uiEXT, 885, VertexAttribI4uiEXT@20)
+ GL_STUB(VertexAttribI4uivEXT, 886, VertexAttribI4uivEXT@8)
+ GL_STUB(VertexAttribI4usvEXT, 887, VertexAttribI4usvEXT@8)
+ GL_STUB(VertexAttribIPointerEXT, 888, VertexAttribIPointerEXT@20)
+ GL_STUB(FramebufferTextureLayerEXT, 889, FramebufferTextureLayerEXT@20)
+ GL_STUB(ColorMaskIndexedEXT, 890, ColorMaskIndexedEXT@20)
+ GL_STUB(DisableIndexedEXT, 891, DisableIndexedEXT@8)
+ GL_STUB(EnableIndexedEXT, 892, EnableIndexedEXT@8)
+ GL_STUB(GetBooleanIndexedvEXT, 893, GetBooleanIndexedvEXT@12)
+ GL_STUB(GetIntegerIndexedvEXT, 894, GetIntegerIndexedvEXT@12)
+ GL_STUB(IsEnabledIndexedEXT, 895, IsEnabledIndexedEXT@8)
+ GL_STUB(ClearColorIiEXT, 896, ClearColorIiEXT@16)
+ GL_STUB(ClearColorIuiEXT, 897, ClearColorIuiEXT@16)
+ GL_STUB(GetTexParameterIivEXT, 898, GetTexParameterIivEXT@12)
+ GL_STUB(GetTexParameterIuivEXT, 899, GetTexParameterIuivEXT@12)
+ GL_STUB(TexParameterIivEXT, 900, TexParameterIivEXT@12)
+ GL_STUB(TexParameterIuivEXT, 901, TexParameterIuivEXT@12)
+ GL_STUB(BeginConditionalRenderNV, 902, BeginConditionalRenderNV@8)
+ GL_STUB(EndConditionalRenderNV, 903, EndConditionalRenderNV@0)
+ GL_STUB(BeginTransformFeedbackEXT, 904, BeginTransformFeedbackEXT@4)
+ GL_STUB(BindBufferBaseEXT, 905, BindBufferBaseEXT@12)
+ GL_STUB(BindBufferOffsetEXT, 906, BindBufferOffsetEXT@16)
+ GL_STUB(BindBufferRangeEXT, 907, BindBufferRangeEXT@20)
+ GL_STUB(EndTransformFeedbackEXT, 908, EndTransformFeedbackEXT@0)
+ GL_STUB(GetTransformFeedbackVaryingEXT, 909, GetTransformFeedbackVaryingEXT@28)
+ GL_STUB(TransformFeedbackVaryingsEXT, 910, TransformFeedbackVaryingsEXT@16)
+ GL_STUB(ProvokingVertexEXT, 911, ProvokingVertexEXT@4)
+ GL_STUB(_dispatch_stub_912, 912, _dispatch_stub_912@12)
+ HIDDEN(GL_PREFIX(_dispatch_stub_912, _dispatch_stub_912@12))
+ GL_STUB(_dispatch_stub_913, 913, _dispatch_stub_913@12)
+ HIDDEN(GL_PREFIX(_dispatch_stub_913, _dispatch_stub_913@12))
+ GL_STUB(GetObjectParameterivAPPLE, 914, GetObjectParameterivAPPLE@16)
+ GL_STUB(ObjectPurgeableAPPLE, 915, ObjectPurgeableAPPLE@12)
+ GL_STUB(ObjectUnpurgeableAPPLE, 916, ObjectUnpurgeableAPPLE@12)
+ GL_STUB(ActiveProgramEXT, 917, ActiveProgramEXT@4)
+ GL_STUB(CreateShaderProgramEXT, 918, CreateShaderProgramEXT@8)
+ GL_STUB(UseShaderProgramEXT, 919, UseShaderProgramEXT@8)
+ GL_STUB(TextureBarrierNV, 920, TextureBarrierNV@0)
+ GL_STUB(_dispatch_stub_921, 921, _dispatch_stub_921@16)
+ HIDDEN(GL_PREFIX(_dispatch_stub_921, _dispatch_stub_921@16))
+ GL_STUB(_dispatch_stub_922, 922, _dispatch_stub_922@16)
+ HIDDEN(GL_PREFIX(_dispatch_stub_922, _dispatch_stub_922@16))
+ GL_STUB(_dispatch_stub_923, 923, _dispatch_stub_923@16)
+ HIDDEN(GL_PREFIX(_dispatch_stub_923, _dispatch_stub_923@16))
+ GL_STUB(_dispatch_stub_924, 924, _dispatch_stub_924@12)
+ HIDDEN(GL_PREFIX(_dispatch_stub_924, _dispatch_stub_924@12))
+ GL_STUB(_dispatch_stub_925, 925, _dispatch_stub_925@12)
+ HIDDEN(GL_PREFIX(_dispatch_stub_925, _dispatch_stub_925@12))
+ GL_STUB(EGLImageTargetRenderbufferStorageOES, 926, EGLImageTargetRenderbufferStorageOES@8)
+ GL_STUB(EGLImageTargetTexture2DOES, 927, EGLImageTargetTexture2DOES@8)
+ GL_STUB_ALIAS(ArrayElementEXT, 306, ArrayElementEXT@4, ArrayElement, ArrayElement@4)
+ GL_STUB_ALIAS(BindTextureEXT, 307, BindTextureEXT@8, BindTexture, BindTexture@8)
+ GL_STUB_ALIAS(DrawArraysEXT, 310, DrawArraysEXT@12, DrawArrays, DrawArrays@12)
+#ifndef GLX_INDIRECT_RENDERING
+ GL_STUB_ALIAS(AreTexturesResidentEXT, 322, AreTexturesResidentEXT@12, AreTexturesResident, AreTexturesResident@12)
+#endif
+ GL_STUB_ALIAS(CopyTexImage1DEXT, 323, CopyTexImage1DEXT@28, CopyTexImage1D, CopyTexImage1D@28)
+ GL_STUB_ALIAS(CopyTexImage2DEXT, 324, CopyTexImage2DEXT@32, CopyTexImage2D, CopyTexImage2D@32)
+ GL_STUB_ALIAS(CopyTexSubImage1DEXT, 325, CopyTexSubImage1DEXT@24, CopyTexSubImage1D, CopyTexSubImage1D@24)
+ GL_STUB_ALIAS(CopyTexSubImage2DEXT, 326, CopyTexSubImage2DEXT@32, CopyTexSubImage2D, CopyTexSubImage2D@32)
+#ifndef GLX_INDIRECT_RENDERING
+ GL_STUB_ALIAS(DeleteTexturesEXT, 327, DeleteTexturesEXT@8, DeleteTextures, DeleteTextures@8)
+#endif
+#ifndef GLX_INDIRECT_RENDERING
+ GL_STUB_ALIAS(GenTexturesEXT, 328, GenTexturesEXT@8, GenTextures, GenTextures@8)
+#endif
+ GL_STUB_ALIAS(GetPointervEXT, 329, GetPointervEXT@8, GetPointerv, GetPointerv@8)
+#ifndef GLX_INDIRECT_RENDERING
+ GL_STUB_ALIAS(IsTextureEXT, 330, IsTextureEXT@4, IsTexture, IsTexture@4)
+#endif
+ GL_STUB_ALIAS(PrioritizeTexturesEXT, 331, PrioritizeTexturesEXT@12, PrioritizeTextures, PrioritizeTextures@12)
+ GL_STUB_ALIAS(TexSubImage1DEXT, 332, TexSubImage1DEXT@28, TexSubImage1D, TexSubImage1D@28)
+ GL_STUB_ALIAS(TexSubImage2DEXT, 333, TexSubImage2DEXT@36, TexSubImage2D, TexSubImage2D@36)
+ GL_STUB_ALIAS(BlendColorEXT, 336, BlendColorEXT@16, BlendColor, BlendColor@16)
+ GL_STUB_ALIAS(BlendEquationEXT, 337, BlendEquationEXT@4, BlendEquation, BlendEquation@4)
+ GL_STUB_ALIAS(DrawRangeElementsEXT, 338, DrawRangeElementsEXT@24, DrawRangeElements, DrawRangeElements@24)
+ GL_STUB_ALIAS(ColorTableEXT, 339, ColorTableEXT@24, ColorTable, ColorTable@24)
+#ifndef GLX_INDIRECT_RENDERING
+ GL_STUB_ALIAS(GetColorTableEXT, 343, GetColorTableEXT@16, GetColorTable, GetColorTable@16)
+#endif
+#ifndef GLX_INDIRECT_RENDERING
+ GL_STUB_ALIAS(GetColorTableParameterfvEXT, 344, GetColorTableParameterfvEXT@12, GetColorTableParameterfv, GetColorTableParameterfv@12)
+#endif
+#ifndef GLX_INDIRECT_RENDERING
+ GL_STUB_ALIAS(GetColorTableParameterivEXT, 345, GetColorTableParameterivEXT@12, GetColorTableParameteriv, GetColorTableParameteriv@12)
+#endif
+ GL_STUB_ALIAS(TexImage3DEXT, 371, TexImage3DEXT@40, TexImage3D, TexImage3D@40)
+ GL_STUB_ALIAS(TexSubImage3DEXT, 372, TexSubImage3DEXT@44, TexSubImage3D, TexSubImage3D@44)
+ GL_STUB_ALIAS(CopyTexSubImage3DEXT, 373, CopyTexSubImage3DEXT@36, CopyTexSubImage3D, CopyTexSubImage3D@36)
+ GL_STUB_ALIAS(ActiveTexture, 374, ActiveTexture@4, ActiveTextureARB, ActiveTextureARB@4)
+ GL_STUB_ALIAS(ClientActiveTexture, 375, ClientActiveTexture@4, ClientActiveTextureARB, ClientActiveTextureARB@4)
+ GL_STUB_ALIAS(MultiTexCoord1d, 376, MultiTexCoord1d@12, MultiTexCoord1dARB, MultiTexCoord1dARB@12)
+ GL_STUB_ALIAS(MultiTexCoord1dv, 377, MultiTexCoord1dv@8, MultiTexCoord1dvARB, MultiTexCoord1dvARB@8)
+ GL_STUB_ALIAS(MultiTexCoord1f, 378, MultiTexCoord1f@8, MultiTexCoord1fARB, MultiTexCoord1fARB@8)
+ GL_STUB_ALIAS(MultiTexCoord1fv, 379, MultiTexCoord1fv@8, MultiTexCoord1fvARB, MultiTexCoord1fvARB@8)
+ GL_STUB_ALIAS(MultiTexCoord1i, 380, MultiTexCoord1i@8, MultiTexCoord1iARB, MultiTexCoord1iARB@8)
+ GL_STUB_ALIAS(MultiTexCoord1iv, 381, MultiTexCoord1iv@8, MultiTexCoord1ivARB, MultiTexCoord1ivARB@8)
+ GL_STUB_ALIAS(MultiTexCoord1s, 382, MultiTexCoord1s@8, MultiTexCoord1sARB, MultiTexCoord1sARB@8)
+ GL_STUB_ALIAS(MultiTexCoord1sv, 383, MultiTexCoord1sv@8, MultiTexCoord1svARB, MultiTexCoord1svARB@8)
+ GL_STUB_ALIAS(MultiTexCoord2d, 384, MultiTexCoord2d@20, MultiTexCoord2dARB, MultiTexCoord2dARB@20)
+ GL_STUB_ALIAS(MultiTexCoord2dv, 385, MultiTexCoord2dv@8, MultiTexCoord2dvARB, MultiTexCoord2dvARB@8)
+ GL_STUB_ALIAS(MultiTexCoord2f, 386, MultiTexCoord2f@12, MultiTexCoord2fARB, MultiTexCoord2fARB@12)
+ GL_STUB_ALIAS(MultiTexCoord2fv, 387, MultiTexCoord2fv@8, MultiTexCoord2fvARB, MultiTexCoord2fvARB@8)
+ GL_STUB_ALIAS(MultiTexCoord2i, 388, MultiTexCoord2i@12, MultiTexCoord2iARB, MultiTexCoord2iARB@12)
+ GL_STUB_ALIAS(MultiTexCoord2iv, 389, MultiTexCoord2iv@8, MultiTexCoord2ivARB, MultiTexCoord2ivARB@8)
+ GL_STUB_ALIAS(MultiTexCoord2s, 390, MultiTexCoord2s@12, MultiTexCoord2sARB, MultiTexCoord2sARB@12)
+ GL_STUB_ALIAS(MultiTexCoord2sv, 391, MultiTexCoord2sv@8, MultiTexCoord2svARB, MultiTexCoord2svARB@8)
+ GL_STUB_ALIAS(MultiTexCoord3d, 392, MultiTexCoord3d@28, MultiTexCoord3dARB, MultiTexCoord3dARB@28)
+ GL_STUB_ALIAS(MultiTexCoord3dv, 393, MultiTexCoord3dv@8, MultiTexCoord3dvARB, MultiTexCoord3dvARB@8)
+ GL_STUB_ALIAS(MultiTexCoord3f, 394, MultiTexCoord3f@16, MultiTexCoord3fARB, MultiTexCoord3fARB@16)
+ GL_STUB_ALIAS(MultiTexCoord3fv, 395, MultiTexCoord3fv@8, MultiTexCoord3fvARB, MultiTexCoord3fvARB@8)
+ GL_STUB_ALIAS(MultiTexCoord3i, 396, MultiTexCoord3i@16, MultiTexCoord3iARB, MultiTexCoord3iARB@16)
+ GL_STUB_ALIAS(MultiTexCoord3iv, 397, MultiTexCoord3iv@8, MultiTexCoord3ivARB, MultiTexCoord3ivARB@8)
+ GL_STUB_ALIAS(MultiTexCoord3s, 398, MultiTexCoord3s@16, MultiTexCoord3sARB, MultiTexCoord3sARB@16)
+ GL_STUB_ALIAS(MultiTexCoord3sv, 399, MultiTexCoord3sv@8, MultiTexCoord3svARB, MultiTexCoord3svARB@8)
+ GL_STUB_ALIAS(MultiTexCoord4d, 400, MultiTexCoord4d@36, MultiTexCoord4dARB, MultiTexCoord4dARB@36)
+ GL_STUB_ALIAS(MultiTexCoord4dv, 401, MultiTexCoord4dv@8, MultiTexCoord4dvARB, MultiTexCoord4dvARB@8)
+ GL_STUB_ALIAS(MultiTexCoord4f, 402, MultiTexCoord4f@20, MultiTexCoord4fARB, MultiTexCoord4fARB@20)
+ GL_STUB_ALIAS(MultiTexCoord4fv, 403, MultiTexCoord4fv@8, MultiTexCoord4fvARB, MultiTexCoord4fvARB@8)
+ GL_STUB_ALIAS(MultiTexCoord4i, 404, MultiTexCoord4i@20, MultiTexCoord4iARB, MultiTexCoord4iARB@20)
+ GL_STUB_ALIAS(MultiTexCoord4iv, 405, MultiTexCoord4iv@8, MultiTexCoord4ivARB, MultiTexCoord4ivARB@8)
+ GL_STUB_ALIAS(MultiTexCoord4s, 406, MultiTexCoord4s@20, MultiTexCoord4sARB, MultiTexCoord4sARB@20)
+ GL_STUB_ALIAS(MultiTexCoord4sv, 407, MultiTexCoord4sv@8, MultiTexCoord4svARB, MultiTexCoord4svARB@8)
+ GL_STUB_ALIAS(LoadTransposeMatrixd, 441, LoadTransposeMatrixd@4, LoadTransposeMatrixdARB, LoadTransposeMatrixdARB@4)
+ GL_STUB_ALIAS(LoadTransposeMatrixf, 442, LoadTransposeMatrixf@4, LoadTransposeMatrixfARB, LoadTransposeMatrixfARB@4)
+ GL_STUB_ALIAS(MultTransposeMatrixd, 443, MultTransposeMatrixd@4, MultTransposeMatrixdARB, MultTransposeMatrixdARB@4)
+ GL_STUB_ALIAS(MultTransposeMatrixf, 444, MultTransposeMatrixf@4, MultTransposeMatrixfARB, MultTransposeMatrixfARB@4)
+ GL_STUB_ALIAS(SampleCoverage, 445, SampleCoverage@8, SampleCoverageARB, SampleCoverageARB@8)
+ GL_STUB_ALIAS(CompressedTexImage1D, 446, CompressedTexImage1D@28, CompressedTexImage1DARB, CompressedTexImage1DARB@28)
+ GL_STUB_ALIAS(CompressedTexImage2D, 447, CompressedTexImage2D@32, CompressedTexImage2DARB, CompressedTexImage2DARB@32)
+ GL_STUB_ALIAS(CompressedTexImage3D, 448, CompressedTexImage3D@36, CompressedTexImage3DARB, CompressedTexImage3DARB@36)
+ GL_STUB_ALIAS(CompressedTexSubImage1D, 449, CompressedTexSubImage1D@28, CompressedTexSubImage1DARB, CompressedTexSubImage1DARB@28)
+ GL_STUB_ALIAS(CompressedTexSubImage2D, 450, CompressedTexSubImage2D@36, CompressedTexSubImage2DARB, CompressedTexSubImage2DARB@36)
+ GL_STUB_ALIAS(CompressedTexSubImage3D, 451, CompressedTexSubImage3D@44, CompressedTexSubImage3DARB, CompressedTexSubImage3DARB@44)
+ GL_STUB_ALIAS(GetCompressedTexImage, 452, GetCompressedTexImage@12, GetCompressedTexImageARB, GetCompressedTexImageARB@12)
+ GL_STUB_ALIAS(DisableVertexAttribArray, 453, DisableVertexAttribArray@4, DisableVertexAttribArrayARB, DisableVertexAttribArrayARB@4)
+ GL_STUB_ALIAS(EnableVertexAttribArray, 454, EnableVertexAttribArray@4, EnableVertexAttribArrayARB, EnableVertexAttribArrayARB@4)
+ GL_STUB_ALIAS(GetVertexAttribdv, 461, GetVertexAttribdv@12, GetVertexAttribdvARB, GetVertexAttribdvARB@12)
+ GL_STUB_ALIAS(GetVertexAttribfv, 462, GetVertexAttribfv@12, GetVertexAttribfvARB, GetVertexAttribfvARB@12)
+ GL_STUB_ALIAS(GetVertexAttribiv, 463, GetVertexAttribiv@12, GetVertexAttribivARB, GetVertexAttribivARB@12)
+ GL_STUB_ALIAS(ProgramParameter4dNV, 464, ProgramParameter4dNV@40, ProgramEnvParameter4dARB, ProgramEnvParameter4dARB@40)
+ GL_STUB_ALIAS(ProgramParameter4dvNV, 465, ProgramParameter4dvNV@12, ProgramEnvParameter4dvARB, ProgramEnvParameter4dvARB@12)
+ GL_STUB_ALIAS(ProgramParameter4fNV, 466, ProgramParameter4fNV@24, ProgramEnvParameter4fARB, ProgramEnvParameter4fARB@24)
+ GL_STUB_ALIAS(ProgramParameter4fvNV, 467, ProgramParameter4fvNV@12, ProgramEnvParameter4fvARB, ProgramEnvParameter4fvARB@12)
+ GL_STUB_ALIAS(VertexAttrib1d, 473, VertexAttrib1d@12, VertexAttrib1dARB, VertexAttrib1dARB@12)
+ GL_STUB_ALIAS(VertexAttrib1dv, 474, VertexAttrib1dv@8, VertexAttrib1dvARB, VertexAttrib1dvARB@8)
+ GL_STUB_ALIAS(VertexAttrib1f, 475, VertexAttrib1f@8, VertexAttrib1fARB, VertexAttrib1fARB@8)
+ GL_STUB_ALIAS(VertexAttrib1fv, 476, VertexAttrib1fv@8, VertexAttrib1fvARB, VertexAttrib1fvARB@8)
+ GL_STUB_ALIAS(VertexAttrib1s, 477, VertexAttrib1s@8, VertexAttrib1sARB, VertexAttrib1sARB@8)
+ GL_STUB_ALIAS(VertexAttrib1sv, 478, VertexAttrib1sv@8, VertexAttrib1svARB, VertexAttrib1svARB@8)
+ GL_STUB_ALIAS(VertexAttrib2d, 479, VertexAttrib2d@20, VertexAttrib2dARB, VertexAttrib2dARB@20)
+ GL_STUB_ALIAS(VertexAttrib2dv, 480, VertexAttrib2dv@8, VertexAttrib2dvARB, VertexAttrib2dvARB@8)
+ GL_STUB_ALIAS(VertexAttrib2f, 481, VertexAttrib2f@12, VertexAttrib2fARB, VertexAttrib2fARB@12)
+ GL_STUB_ALIAS(VertexAttrib2fv, 482, VertexAttrib2fv@8, VertexAttrib2fvARB, VertexAttrib2fvARB@8)
+ GL_STUB_ALIAS(VertexAttrib2s, 483, VertexAttrib2s@12, VertexAttrib2sARB, VertexAttrib2sARB@12)
+ GL_STUB_ALIAS(VertexAttrib2sv, 484, VertexAttrib2sv@8, VertexAttrib2svARB, VertexAttrib2svARB@8)
+ GL_STUB_ALIAS(VertexAttrib3d, 485, VertexAttrib3d@28, VertexAttrib3dARB, VertexAttrib3dARB@28)
+ GL_STUB_ALIAS(VertexAttrib3dv, 486, VertexAttrib3dv@8, VertexAttrib3dvARB, VertexAttrib3dvARB@8)
+ GL_STUB_ALIAS(VertexAttrib3f, 487, VertexAttrib3f@16, VertexAttrib3fARB, VertexAttrib3fARB@16)
+ GL_STUB_ALIAS(VertexAttrib3fv, 488, VertexAttrib3fv@8, VertexAttrib3fvARB, VertexAttrib3fvARB@8)
+ GL_STUB_ALIAS(VertexAttrib3s, 489, VertexAttrib3s@16, VertexAttrib3sARB, VertexAttrib3sARB@16)
+ GL_STUB_ALIAS(VertexAttrib3sv, 490, VertexAttrib3sv@8, VertexAttrib3svARB, VertexAttrib3svARB@8)
+ GL_STUB_ALIAS(VertexAttrib4Nbv, 491, VertexAttrib4Nbv@8, VertexAttrib4NbvARB, VertexAttrib4NbvARB@8)
+ GL_STUB_ALIAS(VertexAttrib4Niv, 492, VertexAttrib4Niv@8, VertexAttrib4NivARB, VertexAttrib4NivARB@8)
+ GL_STUB_ALIAS(VertexAttrib4Nsv, 493, VertexAttrib4Nsv@8, VertexAttrib4NsvARB, VertexAttrib4NsvARB@8)
+ GL_STUB_ALIAS(VertexAttrib4Nub, 494, VertexAttrib4Nub@20, VertexAttrib4NubARB, VertexAttrib4NubARB@20)
+ GL_STUB_ALIAS(VertexAttrib4Nubv, 495, VertexAttrib4Nubv@8, VertexAttrib4NubvARB, VertexAttrib4NubvARB@8)
+ GL_STUB_ALIAS(VertexAttrib4Nuiv, 496, VertexAttrib4Nuiv@8, VertexAttrib4NuivARB, VertexAttrib4NuivARB@8)
+ GL_STUB_ALIAS(VertexAttrib4Nusv, 497, VertexAttrib4Nusv@8, VertexAttrib4NusvARB, VertexAttrib4NusvARB@8)
+ GL_STUB_ALIAS(VertexAttrib4bv, 498, VertexAttrib4bv@8, VertexAttrib4bvARB, VertexAttrib4bvARB@8)
+ GL_STUB_ALIAS(VertexAttrib4d, 499, VertexAttrib4d@36, VertexAttrib4dARB, VertexAttrib4dARB@36)
+ GL_STUB_ALIAS(VertexAttrib4dv, 500, VertexAttrib4dv@8, VertexAttrib4dvARB, VertexAttrib4dvARB@8)
+ GL_STUB_ALIAS(VertexAttrib4f, 501, VertexAttrib4f@20, VertexAttrib4fARB, VertexAttrib4fARB@20)
+ GL_STUB_ALIAS(VertexAttrib4fv, 502, VertexAttrib4fv@8, VertexAttrib4fvARB, VertexAttrib4fvARB@8)
+ GL_STUB_ALIAS(VertexAttrib4iv, 503, VertexAttrib4iv@8, VertexAttrib4ivARB, VertexAttrib4ivARB@8)
+ GL_STUB_ALIAS(VertexAttrib4s, 504, VertexAttrib4s@20, VertexAttrib4sARB, VertexAttrib4sARB@20)
+ GL_STUB_ALIAS(VertexAttrib4sv, 505, VertexAttrib4sv@8, VertexAttrib4svARB, VertexAttrib4svARB@8)
+ GL_STUB_ALIAS(VertexAttrib4ubv, 506, VertexAttrib4ubv@8, VertexAttrib4ubvARB, VertexAttrib4ubvARB@8)
+ GL_STUB_ALIAS(VertexAttrib4uiv, 507, VertexAttrib4uiv@8, VertexAttrib4uivARB, VertexAttrib4uivARB@8)
+ GL_STUB_ALIAS(VertexAttrib4usv, 508, VertexAttrib4usv@8, VertexAttrib4usvARB, VertexAttrib4usvARB@8)
+ GL_STUB_ALIAS(VertexAttribPointer, 509, VertexAttribPointer@24, VertexAttribPointerARB, VertexAttribPointerARB@24)
+ GL_STUB_ALIAS(BindBuffer, 510, BindBuffer@8, BindBufferARB, BindBufferARB@8)
+ GL_STUB_ALIAS(BufferData, 511, BufferData@16, BufferDataARB, BufferDataARB@16)
+ GL_STUB_ALIAS(BufferSubData, 512, BufferSubData@16, BufferSubDataARB, BufferSubDataARB@16)
+ GL_STUB_ALIAS(DeleteBuffers, 513, DeleteBuffers@8, DeleteBuffersARB, DeleteBuffersARB@8)
+ GL_STUB_ALIAS(GenBuffers, 514, GenBuffers@8, GenBuffersARB, GenBuffersARB@8)
+ GL_STUB_ALIAS(GetBufferParameteriv, 515, GetBufferParameteriv@12, GetBufferParameterivARB, GetBufferParameterivARB@12)
+ GL_STUB_ALIAS(GetBufferPointerv, 516, GetBufferPointerv@12, GetBufferPointervARB, GetBufferPointervARB@12)
+ GL_STUB_ALIAS(GetBufferSubData, 517, GetBufferSubData@16, GetBufferSubDataARB, GetBufferSubDataARB@16)
+ GL_STUB_ALIAS(IsBuffer, 518, IsBuffer@4, IsBufferARB, IsBufferARB@4)
+ GL_STUB_ALIAS(MapBuffer, 519, MapBuffer@8, MapBufferARB, MapBufferARB@8)
+ GL_STUB_ALIAS(UnmapBuffer, 520, UnmapBuffer@4, UnmapBufferARB, UnmapBufferARB@4)
+ GL_STUB_ALIAS(BeginQuery, 521, BeginQuery@8, BeginQueryARB, BeginQueryARB@8)
+ GL_STUB_ALIAS(DeleteQueries, 522, DeleteQueries@8, DeleteQueriesARB, DeleteQueriesARB@8)
+ GL_STUB_ALIAS(EndQuery, 523, EndQuery@4, EndQueryARB, EndQueryARB@4)
+ GL_STUB_ALIAS(GenQueries, 524, GenQueries@8, GenQueriesARB, GenQueriesARB@8)
+ GL_STUB_ALIAS(GetQueryObjectiv, 525, GetQueryObjectiv@12, GetQueryObjectivARB, GetQueryObjectivARB@12)
+ GL_STUB_ALIAS(GetQueryObjectuiv, 526, GetQueryObjectuiv@12, GetQueryObjectuivARB, GetQueryObjectuivARB@12)
+ GL_STUB_ALIAS(GetQueryiv, 527, GetQueryiv@12, GetQueryivARB, GetQueryivARB@12)
+ GL_STUB_ALIAS(IsQuery, 528, IsQuery@4, IsQueryARB, IsQueryARB@4)
+ GL_STUB_ALIAS(CompileShader, 530, CompileShader@4, CompileShaderARB, CompileShaderARB@4)
+ GL_STUB_ALIAS(GetActiveUniform, 535, GetActiveUniform@28, GetActiveUniformARB, GetActiveUniformARB@28)
+ GL_STUB_ALIAS(GetShaderSource, 541, GetShaderSource@16, GetShaderSourceARB, GetShaderSourceARB@16)
+ GL_STUB_ALIAS(GetUniformLocation, 542, GetUniformLocation@8, GetUniformLocationARB, GetUniformLocationARB@8)
+ GL_STUB_ALIAS(GetUniformfv, 543, GetUniformfv@12, GetUniformfvARB, GetUniformfvARB@12)
+ GL_STUB_ALIAS(GetUniformiv, 544, GetUniformiv@12, GetUniformivARB, GetUniformivARB@12)
+ GL_STUB_ALIAS(LinkProgram, 545, LinkProgram@4, LinkProgramARB, LinkProgramARB@4)
+ GL_STUB_ALIAS(ShaderSource, 546, ShaderSource@16, ShaderSourceARB, ShaderSourceARB@16)
+ GL_STUB_ALIAS(Uniform1f, 547, Uniform1f@8, Uniform1fARB, Uniform1fARB@8)
+ GL_STUB_ALIAS(Uniform1fv, 548, Uniform1fv@12, Uniform1fvARB, Uniform1fvARB@12)
+ GL_STUB_ALIAS(Uniform1i, 549, Uniform1i@8, Uniform1iARB, Uniform1iARB@8)
+ GL_STUB_ALIAS(Uniform1iv, 550, Uniform1iv@12, Uniform1ivARB, Uniform1ivARB@12)
+ GL_STUB_ALIAS(Uniform2f, 551, Uniform2f@12, Uniform2fARB, Uniform2fARB@12)
+ GL_STUB_ALIAS(Uniform2fv, 552, Uniform2fv@12, Uniform2fvARB, Uniform2fvARB@12)
+ GL_STUB_ALIAS(Uniform2i, 553, Uniform2i@12, Uniform2iARB, Uniform2iARB@12)
+ GL_STUB_ALIAS(Uniform2iv, 554, Uniform2iv@12, Uniform2ivARB, Uniform2ivARB@12)
+ GL_STUB_ALIAS(Uniform3f, 555, Uniform3f@16, Uniform3fARB, Uniform3fARB@16)
+ GL_STUB_ALIAS(Uniform3fv, 556, Uniform3fv@12, Uniform3fvARB, Uniform3fvARB@12)
+ GL_STUB_ALIAS(Uniform3i, 557, Uniform3i@16, Uniform3iARB, Uniform3iARB@16)
+ GL_STUB_ALIAS(Uniform3iv, 558, Uniform3iv@12, Uniform3ivARB, Uniform3ivARB@12)
+ GL_STUB_ALIAS(Uniform4f, 559, Uniform4f@20, Uniform4fARB, Uniform4fARB@20)
+ GL_STUB_ALIAS(Uniform4fv, 560, Uniform4fv@12, Uniform4fvARB, Uniform4fvARB@12)
+ GL_STUB_ALIAS(Uniform4i, 561, Uniform4i@20, Uniform4iARB, Uniform4iARB@20)
+ GL_STUB_ALIAS(Uniform4iv, 562, Uniform4iv@12, Uniform4ivARB, Uniform4ivARB@12)
+ GL_STUB_ALIAS(UniformMatrix2fv, 563, UniformMatrix2fv@16, UniformMatrix2fvARB, UniformMatrix2fvARB@16)
+ GL_STUB_ALIAS(UniformMatrix3fv, 564, UniformMatrix3fv@16, UniformMatrix3fvARB, UniformMatrix3fvARB@16)
+ GL_STUB_ALIAS(UniformMatrix4fv, 565, UniformMatrix4fv@16, UniformMatrix4fvARB, UniformMatrix4fvARB@16)
+ GL_STUB_ALIAS(UseProgram, 566, UseProgram@4, UseProgramObjectARB, UseProgramObjectARB@4)
+ GL_STUB_ALIAS(ValidateProgram, 567, ValidateProgram@4, ValidateProgramARB, ValidateProgramARB@4)
+ GL_STUB_ALIAS(BindAttribLocation, 568, BindAttribLocation@12, BindAttribLocationARB, BindAttribLocationARB@12)
+ GL_STUB_ALIAS(GetActiveAttrib, 569, GetActiveAttrib@28, GetActiveAttribARB, GetActiveAttribARB@28)
+ GL_STUB_ALIAS(GetAttribLocation, 570, GetAttribLocation@8, GetAttribLocationARB, GetAttribLocationARB@8)
+ GL_STUB_ALIAS(DrawBuffers, 571, DrawBuffers@8, DrawBuffersARB, DrawBuffersARB@8)
+ GL_STUB_ALIAS(DrawBuffersATI, 571, DrawBuffersATI@8, DrawBuffersARB, DrawBuffersARB@8)
+ GL_STUB_ALIAS(DrawArraysInstancedEXT, 573, DrawArraysInstancedEXT@16, DrawArraysInstancedARB, DrawArraysInstancedARB@16)
+ GL_STUB_ALIAS(DrawArraysInstanced, 573, DrawArraysInstanced@16, DrawArraysInstancedARB, DrawArraysInstancedARB@16)
+ GL_STUB_ALIAS(DrawElementsInstancedEXT, 574, DrawElementsInstancedEXT@20, DrawElementsInstancedARB, DrawElementsInstancedARB@20)
+ GL_STUB_ALIAS(DrawElementsInstanced, 574, DrawElementsInstanced@20, DrawElementsInstancedARB, DrawElementsInstancedARB@20)
+ GL_STUB_ALIAS(RenderbufferStorageMultisampleEXT, 575, RenderbufferStorageMultisampleEXT@20, RenderbufferStorageMultisample, RenderbufferStorageMultisample@20)
+ GL_STUB_ALIAS(BlendEquationSeparateIndexedAMD, 596, BlendEquationSeparateIndexedAMD@12, BlendEquationSeparateiARB, BlendEquationSeparateiARB@12)
+ GL_STUB_ALIAS(BlendEquationIndexedAMD, 597, BlendEquationIndexedAMD@8, BlendEquationiARB, BlendEquationiARB@8)
+ GL_STUB_ALIAS(BlendFuncSeparateIndexedAMD, 598, BlendFuncSeparateIndexedAMD@20, BlendFuncSeparateiARB, BlendFuncSeparateiARB@20)
+ GL_STUB_ALIAS(BlendFuncIndexedAMD, 599, BlendFuncIndexedAMD@12, BlendFunciARB, BlendFunciARB@12)
+ GL_STUB_ALIAS(PointParameterf, 661, PointParameterf@8, PointParameterfEXT, PointParameterfEXT@8)
+ GL_STUB_ALIAS(PointParameterfARB, 661, PointParameterfARB@8, PointParameterfEXT, PointParameterfEXT@8)
+ GL_STUB_ALIAS(PointParameterfv, 662, PointParameterfv@8, PointParameterfvEXT, PointParameterfvEXT@8)
+ GL_STUB_ALIAS(PointParameterfvARB, 662, PointParameterfvARB@8, PointParameterfvEXT, PointParameterfvEXT@8)
+ GL_STUB_ALIAS(SecondaryColor3b, 665, SecondaryColor3b@12, SecondaryColor3bEXT, SecondaryColor3bEXT@12)
+ GL_STUB_ALIAS(SecondaryColor3bv, 666, SecondaryColor3bv@4, SecondaryColor3bvEXT, SecondaryColor3bvEXT@4)
+ GL_STUB_ALIAS(SecondaryColor3d, 667, SecondaryColor3d@24, SecondaryColor3dEXT, SecondaryColor3dEXT@24)
+ GL_STUB_ALIAS(SecondaryColor3dv, 668, SecondaryColor3dv@4, SecondaryColor3dvEXT, SecondaryColor3dvEXT@4)
+ GL_STUB_ALIAS(SecondaryColor3f, 669, SecondaryColor3f@12, SecondaryColor3fEXT, SecondaryColor3fEXT@12)
+ GL_STUB_ALIAS(SecondaryColor3fv, 670, SecondaryColor3fv@4, SecondaryColor3fvEXT, SecondaryColor3fvEXT@4)
+ GL_STUB_ALIAS(SecondaryColor3i, 671, SecondaryColor3i@12, SecondaryColor3iEXT, SecondaryColor3iEXT@12)
+ GL_STUB_ALIAS(SecondaryColor3iv, 672, SecondaryColor3iv@4, SecondaryColor3ivEXT, SecondaryColor3ivEXT@4)
+ GL_STUB_ALIAS(SecondaryColor3s, 673, SecondaryColor3s@12, SecondaryColor3sEXT, SecondaryColor3sEXT@12)
+ GL_STUB_ALIAS(SecondaryColor3sv, 674, SecondaryColor3sv@4, SecondaryColor3svEXT, SecondaryColor3svEXT@4)
+ GL_STUB_ALIAS(SecondaryColor3ub, 675, SecondaryColor3ub@12, SecondaryColor3ubEXT, SecondaryColor3ubEXT@12)
+ GL_STUB_ALIAS(SecondaryColor3ubv, 676, SecondaryColor3ubv@4, SecondaryColor3ubvEXT, SecondaryColor3ubvEXT@4)
+ GL_STUB_ALIAS(SecondaryColor3ui, 677, SecondaryColor3ui@12, SecondaryColor3uiEXT, SecondaryColor3uiEXT@12)
+ GL_STUB_ALIAS(SecondaryColor3uiv, 678, SecondaryColor3uiv@4, SecondaryColor3uivEXT, SecondaryColor3uivEXT@4)
+ GL_STUB_ALIAS(SecondaryColor3us, 679, SecondaryColor3us@12, SecondaryColor3usEXT, SecondaryColor3usEXT@12)
+ GL_STUB_ALIAS(SecondaryColor3usv, 680, SecondaryColor3usv@4, SecondaryColor3usvEXT, SecondaryColor3usvEXT@4)
+ GL_STUB_ALIAS(SecondaryColorPointer, 681, SecondaryColorPointer@16, SecondaryColorPointerEXT, SecondaryColorPointerEXT@16)
+ GL_STUB_ALIAS(MultiDrawArrays, 682, MultiDrawArrays@16, MultiDrawArraysEXT, MultiDrawArraysEXT@16)
+ GL_STUB_ALIAS(MultiDrawElements, 683, MultiDrawElements@20, MultiDrawElementsEXT, MultiDrawElementsEXT@20)
+ GL_STUB_ALIAS(FogCoordPointer, 684, FogCoordPointer@12, FogCoordPointerEXT, FogCoordPointerEXT@12)
+ GL_STUB_ALIAS(FogCoordd, 685, FogCoordd@8, FogCoorddEXT, FogCoorddEXT@8)
+ GL_STUB_ALIAS(FogCoorddv, 686, FogCoorddv@4, FogCoorddvEXT, FogCoorddvEXT@4)
+ GL_STUB_ALIAS(FogCoordf, 687, FogCoordf@4, FogCoordfEXT, FogCoordfEXT@4)
+ GL_STUB_ALIAS(FogCoordfv, 688, FogCoordfv@4, FogCoordfvEXT, FogCoordfvEXT@4)
+ GL_STUB_ALIAS(BlendFuncSeparate, 690, BlendFuncSeparate@16, BlendFuncSeparateEXT, BlendFuncSeparateEXT@16)
+ GL_STUB_ALIAS(WindowPos2d, 707, WindowPos2d@16, WindowPos2dMESA, WindowPos2dMESA@16)
+ GL_STUB_ALIAS(WindowPos2dARB, 707, WindowPos2dARB@16, WindowPos2dMESA, WindowPos2dMESA@16)
+ GL_STUB_ALIAS(WindowPos2dv, 708, WindowPos2dv@4, WindowPos2dvMESA, WindowPos2dvMESA@4)
+ GL_STUB_ALIAS(WindowPos2dvARB, 708, WindowPos2dvARB@4, WindowPos2dvMESA, WindowPos2dvMESA@4)
+ GL_STUB_ALIAS(WindowPos2f, 709, WindowPos2f@8, WindowPos2fMESA, WindowPos2fMESA@8)
+ GL_STUB_ALIAS(WindowPos2fARB, 709, WindowPos2fARB@8, WindowPos2fMESA, WindowPos2fMESA@8)
+ GL_STUB_ALIAS(WindowPos2fv, 710, WindowPos2fv@4, WindowPos2fvMESA, WindowPos2fvMESA@4)
+ GL_STUB_ALIAS(WindowPos2fvARB, 710, WindowPos2fvARB@4, WindowPos2fvMESA, WindowPos2fvMESA@4)
+ GL_STUB_ALIAS(WindowPos2i, 711, WindowPos2i@8, WindowPos2iMESA, WindowPos2iMESA@8)
+ GL_STUB_ALIAS(WindowPos2iARB, 711, WindowPos2iARB@8, WindowPos2iMESA, WindowPos2iMESA@8)
+ GL_STUB_ALIAS(WindowPos2iv, 712, WindowPos2iv@4, WindowPos2ivMESA, WindowPos2ivMESA@4)
+ GL_STUB_ALIAS(WindowPos2ivARB, 712, WindowPos2ivARB@4, WindowPos2ivMESA, WindowPos2ivMESA@4)
+ GL_STUB_ALIAS(WindowPos2s, 713, WindowPos2s@8, WindowPos2sMESA, WindowPos2sMESA@8)
+ GL_STUB_ALIAS(WindowPos2sARB, 713, WindowPos2sARB@8, WindowPos2sMESA, WindowPos2sMESA@8)
+ GL_STUB_ALIAS(WindowPos2sv, 714, WindowPos2sv@4, WindowPos2svMESA, WindowPos2svMESA@4)
+ GL_STUB_ALIAS(WindowPos2svARB, 714, WindowPos2svARB@4, WindowPos2svMESA, WindowPos2svMESA@4)
+ GL_STUB_ALIAS(WindowPos3d, 715, WindowPos3d@24, WindowPos3dMESA, WindowPos3dMESA@24)
+ GL_STUB_ALIAS(WindowPos3dARB, 715, WindowPos3dARB@24, WindowPos3dMESA, WindowPos3dMESA@24)
+ GL_STUB_ALIAS(WindowPos3dv, 716, WindowPos3dv@4, WindowPos3dvMESA, WindowPos3dvMESA@4)
+ GL_STUB_ALIAS(WindowPos3dvARB, 716, WindowPos3dvARB@4, WindowPos3dvMESA, WindowPos3dvMESA@4)
+ GL_STUB_ALIAS(WindowPos3f, 717, WindowPos3f@12, WindowPos3fMESA, WindowPos3fMESA@12)
+ GL_STUB_ALIAS(WindowPos3fARB, 717, WindowPos3fARB@12, WindowPos3fMESA, WindowPos3fMESA@12)
+ GL_STUB_ALIAS(WindowPos3fv, 718, WindowPos3fv@4, WindowPos3fvMESA, WindowPos3fvMESA@4)
+ GL_STUB_ALIAS(WindowPos3fvARB, 718, WindowPos3fvARB@4, WindowPos3fvMESA, WindowPos3fvMESA@4)
+ GL_STUB_ALIAS(WindowPos3i, 719, WindowPos3i@12, WindowPos3iMESA, WindowPos3iMESA@12)
+ GL_STUB_ALIAS(WindowPos3iARB, 719, WindowPos3iARB@12, WindowPos3iMESA, WindowPos3iMESA@12)
+ GL_STUB_ALIAS(WindowPos3iv, 720, WindowPos3iv@4, WindowPos3ivMESA, WindowPos3ivMESA@4)
+ GL_STUB_ALIAS(WindowPos3ivARB, 720, WindowPos3ivARB@4, WindowPos3ivMESA, WindowPos3ivMESA@4)
+ GL_STUB_ALIAS(WindowPos3s, 721, WindowPos3s@12, WindowPos3sMESA, WindowPos3sMESA@12)
+ GL_STUB_ALIAS(WindowPos3sARB, 721, WindowPos3sARB@12, WindowPos3sMESA, WindowPos3sMESA@12)
+ GL_STUB_ALIAS(WindowPos3sv, 722, WindowPos3sv@4, WindowPos3svMESA, WindowPos3svMESA@4)
+ GL_STUB_ALIAS(WindowPos3svARB, 722, WindowPos3svARB@4, WindowPos3svMESA, WindowPos3svMESA@4)
+ GL_STUB_ALIAS(BindProgramARB, 741, BindProgramARB@8, BindProgramNV, BindProgramNV@8)
+ GL_STUB_ALIAS(DeleteProgramsARB, 742, DeleteProgramsARB@8, DeleteProgramsNV, DeleteProgramsNV@8)
+ GL_STUB_ALIAS(GenProgramsARB, 744, GenProgramsARB@8, GenProgramsNV, GenProgramsNV@8)
+ GL_STUB_ALIAS(GetVertexAttribPointerv, 750, GetVertexAttribPointerv@12, GetVertexAttribPointervNV, GetVertexAttribPointervNV@12)
+ GL_STUB_ALIAS(GetVertexAttribPointervARB, 750, GetVertexAttribPointervARB@12, GetVertexAttribPointervNV, GetVertexAttribPointervNV@12)
+ GL_STUB_ALIAS(IsProgramARB, 754, IsProgramARB@4, IsProgramNV, IsProgramNV@4)
+ GL_STUB_ALIAS(PointParameteri, 818, PointParameteri@8, PointParameteriNV, PointParameteriNV@8)
+ GL_STUB_ALIAS(PointParameteriv, 819, PointParameteriv@8, PointParameterivNV, PointParameterivNV@8)
+ GL_STUB_ALIAS(DeleteVertexArrays, 822, DeleteVertexArrays@8, _dispatch_stub_822, _dispatch_stub_822@8)
+ GL_STUB_ALIAS(IsVertexArray, 824, IsVertexArray@4, _dispatch_stub_824, _dispatch_stub_824@4)
+ GL_STUB_ALIAS(PrimitiveRestartIndex, 831, PrimitiveRestartIndex@4, PrimitiveRestartIndexNV, PrimitiveRestartIndexNV@4)
+ GL_STUB_ALIAS(BlendEquationSeparate, 834, BlendEquationSeparate@8, _dispatch_stub_834, _dispatch_stub_834@8)
+ GL_STUB_ALIAS(BindFramebuffer, 835, BindFramebuffer@8, BindFramebufferEXT, BindFramebufferEXT@8)
+ GL_STUB_ALIAS(BindRenderbuffer, 836, BindRenderbuffer@8, BindRenderbufferEXT, BindRenderbufferEXT@8)
+ GL_STUB_ALIAS(CheckFramebufferStatus, 837, CheckFramebufferStatus@4, CheckFramebufferStatusEXT, CheckFramebufferStatusEXT@4)
+ GL_STUB_ALIAS(DeleteFramebuffers, 838, DeleteFramebuffers@8, DeleteFramebuffersEXT, DeleteFramebuffersEXT@8)
+ GL_STUB_ALIAS(DeleteRenderbuffers, 839, DeleteRenderbuffers@8, DeleteRenderbuffersEXT, DeleteRenderbuffersEXT@8)
+ GL_STUB_ALIAS(FramebufferRenderbuffer, 840, FramebufferRenderbuffer@16, FramebufferRenderbufferEXT, FramebufferRenderbufferEXT@16)
+ GL_STUB_ALIAS(FramebufferTexture1D, 841, FramebufferTexture1D@20, FramebufferTexture1DEXT, FramebufferTexture1DEXT@20)
+ GL_STUB_ALIAS(FramebufferTexture2D, 842, FramebufferTexture2D@20, FramebufferTexture2DEXT, FramebufferTexture2DEXT@20)
+ GL_STUB_ALIAS(FramebufferTexture3D, 843, FramebufferTexture3D@24, FramebufferTexture3DEXT, FramebufferTexture3DEXT@24)
+ GL_STUB_ALIAS(GenFramebuffers, 844, GenFramebuffers@8, GenFramebuffersEXT, GenFramebuffersEXT@8)
+ GL_STUB_ALIAS(GenRenderbuffers, 845, GenRenderbuffers@8, GenRenderbuffersEXT, GenRenderbuffersEXT@8)
+ GL_STUB_ALIAS(GenerateMipmap, 846, GenerateMipmap@4, GenerateMipmapEXT, GenerateMipmapEXT@4)
+ GL_STUB_ALIAS(GetFramebufferAttachmentParameteriv, 847, GetFramebufferAttachmentParameteriv@16, GetFramebufferAttachmentParameterivEXT, GetFramebufferAttachmentParameterivEXT@16)
+ GL_STUB_ALIAS(GetRenderbufferParameteriv, 848, GetRenderbufferParameteriv@12, GetRenderbufferParameterivEXT, GetRenderbufferParameterivEXT@12)
+ GL_STUB_ALIAS(IsFramebuffer, 849, IsFramebuffer@4, IsFramebufferEXT, IsFramebufferEXT@4)
+ GL_STUB_ALIAS(IsRenderbuffer, 850, IsRenderbuffer@4, IsRenderbufferEXT, IsRenderbufferEXT@4)
+ GL_STUB_ALIAS(RenderbufferStorage, 851, RenderbufferStorage@16, RenderbufferStorageEXT, RenderbufferStorageEXT@16)
+ GL_STUB_ALIAS(BlitFramebuffer, 852, BlitFramebuffer@40, _dispatch_stub_852, _dispatch_stub_852@40)
+ GL_STUB_ALIAS(BindFragDataLocation, 855, BindFragDataLocation@12, BindFragDataLocationEXT, BindFragDataLocationEXT@12)
+ GL_STUB_ALIAS(GetFragDataLocation, 856, GetFragDataLocation@8, GetFragDataLocationEXT, GetFragDataLocationEXT@8)
+ GL_STUB_ALIAS(GetUniformuiv, 857, GetUniformuiv@12, GetUniformuivEXT, GetUniformuivEXT@12)
+ GL_STUB_ALIAS(GetVertexAttribIiv, 858, GetVertexAttribIiv@12, GetVertexAttribIivEXT, GetVertexAttribIivEXT@12)
+ GL_STUB_ALIAS(GetVertexAttribIuiv, 859, GetVertexAttribIuiv@12, GetVertexAttribIuivEXT, GetVertexAttribIuivEXT@12)
+ GL_STUB_ALIAS(Uniform1ui, 860, Uniform1ui@8, Uniform1uiEXT, Uniform1uiEXT@8)
+ GL_STUB_ALIAS(Uniform1uiv, 861, Uniform1uiv@12, Uniform1uivEXT, Uniform1uivEXT@12)
+ GL_STUB_ALIAS(Uniform2ui, 862, Uniform2ui@12, Uniform2uiEXT, Uniform2uiEXT@12)
+ GL_STUB_ALIAS(Uniform2uiv, 863, Uniform2uiv@12, Uniform2uivEXT, Uniform2uivEXT@12)
+ GL_STUB_ALIAS(Uniform3ui, 864, Uniform3ui@16, Uniform3uiEXT, Uniform3uiEXT@16)
+ GL_STUB_ALIAS(Uniform3uiv, 865, Uniform3uiv@12, Uniform3uivEXT, Uniform3uivEXT@12)
+ GL_STUB_ALIAS(Uniform4ui, 866, Uniform4ui@20, Uniform4uiEXT, Uniform4uiEXT@20)
+ GL_STUB_ALIAS(Uniform4uiv, 867, Uniform4uiv@12, Uniform4uivEXT, Uniform4uivEXT@12)
+ GL_STUB_ALIAS(VertexAttribI1i, 868, VertexAttribI1i@8, VertexAttribI1iEXT, VertexAttribI1iEXT@8)
+ GL_STUB_ALIAS(VertexAttribI1iv, 869, VertexAttribI1iv@8, VertexAttribI1ivEXT, VertexAttribI1ivEXT@8)
+ GL_STUB_ALIAS(VertexAttribI1ui, 870, VertexAttribI1ui@8, VertexAttribI1uiEXT, VertexAttribI1uiEXT@8)
+ GL_STUB_ALIAS(VertexAttribI1uiv, 871, VertexAttribI1uiv@8, VertexAttribI1uivEXT, VertexAttribI1uivEXT@8)
+ GL_STUB_ALIAS(VertexAttribI2i, 872, VertexAttribI2i@12, VertexAttribI2iEXT, VertexAttribI2iEXT@12)
+ GL_STUB_ALIAS(VertexAttribI2iv, 873, VertexAttribI2iv@8, VertexAttribI2ivEXT, VertexAttribI2ivEXT@8)
+ GL_STUB_ALIAS(VertexAttribI2ui, 874, VertexAttribI2ui@12, VertexAttribI2uiEXT, VertexAttribI2uiEXT@12)
+ GL_STUB_ALIAS(VertexAttribI2uiv, 875, VertexAttribI2uiv@8, VertexAttribI2uivEXT, VertexAttribI2uivEXT@8)
+ GL_STUB_ALIAS(VertexAttribI3i, 876, VertexAttribI3i@16, VertexAttribI3iEXT, VertexAttribI3iEXT@16)
+ GL_STUB_ALIAS(VertexAttribI3iv, 877, VertexAttribI3iv@8, VertexAttribI3ivEXT, VertexAttribI3ivEXT@8)
+ GL_STUB_ALIAS(VertexAttribI3ui, 878, VertexAttribI3ui@16, VertexAttribI3uiEXT, VertexAttribI3uiEXT@16)
+ GL_STUB_ALIAS(VertexAttribI3uiv, 879, VertexAttribI3uiv@8, VertexAttribI3uivEXT, VertexAttribI3uivEXT@8)
+ GL_STUB_ALIAS(VertexAttribI4bv, 880, VertexAttribI4bv@8, VertexAttribI4bvEXT, VertexAttribI4bvEXT@8)
+ GL_STUB_ALIAS(VertexAttribI4i, 881, VertexAttribI4i@20, VertexAttribI4iEXT, VertexAttribI4iEXT@20)
+ GL_STUB_ALIAS(VertexAttribI4iv, 882, VertexAttribI4iv@8, VertexAttribI4ivEXT, VertexAttribI4ivEXT@8)
+ GL_STUB_ALIAS(VertexAttribI4sv, 883, VertexAttribI4sv@8, VertexAttribI4svEXT, VertexAttribI4svEXT@8)
+ GL_STUB_ALIAS(VertexAttribI4ubv, 884, VertexAttribI4ubv@8, VertexAttribI4ubvEXT, VertexAttribI4ubvEXT@8)
+ GL_STUB_ALIAS(VertexAttribI4ui, 885, VertexAttribI4ui@20, VertexAttribI4uiEXT, VertexAttribI4uiEXT@20)
+ GL_STUB_ALIAS(VertexAttribI4uiv, 886, VertexAttribI4uiv@8, VertexAttribI4uivEXT, VertexAttribI4uivEXT@8)
+ GL_STUB_ALIAS(VertexAttribI4usv, 887, VertexAttribI4usv@8, VertexAttribI4usvEXT, VertexAttribI4usvEXT@8)
+ GL_STUB_ALIAS(VertexAttribIPointer, 888, VertexAttribIPointer@20, VertexAttribIPointerEXT, VertexAttribIPointerEXT@20)
+ GL_STUB_ALIAS(FramebufferTextureLayer, 889, FramebufferTextureLayer@20, FramebufferTextureLayerEXT, FramebufferTextureLayerEXT@20)
+ GL_STUB_ALIAS(ColorMaski, 890, ColorMaski@20, ColorMaskIndexedEXT, ColorMaskIndexedEXT@20)
+ GL_STUB_ALIAS(Disablei, 891, Disablei@8, DisableIndexedEXT, DisableIndexedEXT@8)
+ GL_STUB_ALIAS(Enablei, 892, Enablei@8, EnableIndexedEXT, EnableIndexedEXT@8)
+ GL_STUB_ALIAS(GetBooleani_v, 893, GetBooleani_v@12, GetBooleanIndexedvEXT, GetBooleanIndexedvEXT@12)
+ GL_STUB_ALIAS(GetIntegeri_v, 894, GetIntegeri_v@12, GetIntegerIndexedvEXT, GetIntegerIndexedvEXT@12)
+ GL_STUB_ALIAS(IsEnabledi, 895, IsEnabledi@8, IsEnabledIndexedEXT, IsEnabledIndexedEXT@8)
+ GL_STUB_ALIAS(GetTexParameterIiv, 898, GetTexParameterIiv@12, GetTexParameterIivEXT, GetTexParameterIivEXT@12)
+ GL_STUB_ALIAS(GetTexParameterIuiv, 899, GetTexParameterIuiv@12, GetTexParameterIuivEXT, GetTexParameterIuivEXT@12)
+ GL_STUB_ALIAS(TexParameterIiv, 900, TexParameterIiv@12, TexParameterIivEXT, TexParameterIivEXT@12)
+ GL_STUB_ALIAS(TexParameterIuiv, 901, TexParameterIuiv@12, TexParameterIuivEXT, TexParameterIuivEXT@12)
+ GL_STUB_ALIAS(BeginConditionalRender, 902, BeginConditionalRender@8, BeginConditionalRenderNV, BeginConditionalRenderNV@8)
+ GL_STUB_ALIAS(EndConditionalRender, 903, EndConditionalRender@0, EndConditionalRenderNV, EndConditionalRenderNV@0)
+ GL_STUB_ALIAS(BeginTransformFeedback, 904, BeginTransformFeedback@4, BeginTransformFeedbackEXT, BeginTransformFeedbackEXT@4)
+ GL_STUB_ALIAS(BindBufferBase, 905, BindBufferBase@12, BindBufferBaseEXT, BindBufferBaseEXT@12)
+ GL_STUB_ALIAS(BindBufferRange, 907, BindBufferRange@20, BindBufferRangeEXT, BindBufferRangeEXT@20)
+ GL_STUB_ALIAS(EndTransformFeedback, 908, EndTransformFeedback@0, EndTransformFeedbackEXT, EndTransformFeedbackEXT@0)
+ GL_STUB_ALIAS(GetTransformFeedbackVarying, 909, GetTransformFeedbackVarying@28, GetTransformFeedbackVaryingEXT, GetTransformFeedbackVaryingEXT@28)
+ GL_STUB_ALIAS(TransformFeedbackVaryings, 910, TransformFeedbackVaryings@16, TransformFeedbackVaryingsEXT, TransformFeedbackVaryingsEXT@16)
+ GL_STUB_ALIAS(ProvokingVertex, 911, ProvokingVertex@4, ProvokingVertexEXT, ProvokingVertexEXT@4)
+
+ GLOBL GLNAME(gl_dispatch_functions_end)
+ HIDDEN(GLNAME(gl_dispatch_functions_end))
+ ALIGNTEXT16
+GLNAME(gl_dispatch_functions_end):
+
+#if defined(GLX_USE_TLS) && defined(__linux__)
+ .section ".note.ABI-tag", "a"
+ .p2align 2
+ .long 1f - 0f /* name length */
+ .long 3f - 2f /* data length */
+ .long 1 /* note length */
+0: .asciz "GNU" /* vendor name */
+1: .p2align 2
+2: .long 0 /* note data: the ABI tag */
+ .long 2,4,20 /* Minimum kernel version w/TLS */
+3: .p2align 2 /* pad out section */
+#endif /* GLX_USE_TLS */
+
+#if defined (__ELF__) && defined (__linux__)
+ .section .note.GNU-stack,"",%progbits
+#endif
diff --git a/mesalib/src/mapi/glapi/glapitable.h b/mesalib/src/mapi/glapi/glapitable.h
index da278c559..16f072fb6 100644
--- a/mesalib/src/mapi/glapi/glapitable.h
+++ b/mesalib/src/mapi/glapi/glapitable.h
@@ -1,973 +1,973 @@
-/* DO NOT EDIT - This file generated automatically by gl_table.py (from Mesa) script */
-
-/*
- * Copyright (C) 1999-2003 Brian Paul All Rights Reserved.
- * (C) Copyright IBM Corporation 2004
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sub license,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL, IBM,
- * AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
- * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-#if !defined( _GLAPI_TABLE_H_ )
-# define _GLAPI_TABLE_H_
-
-#ifndef GLAPIENTRYP
-# ifndef GLAPIENTRY
-# define GLAPIENTRY
-# endif
-
-# define GLAPIENTRYP GLAPIENTRY *
-#endif
-
-
-struct _glapi_table
-{
- void (GLAPIENTRYP NewList)(GLuint list, GLenum mode); /* 0 */
- void (GLAPIENTRYP EndList)(void); /* 1 */
- void (GLAPIENTRYP CallList)(GLuint list); /* 2 */
- void (GLAPIENTRYP CallLists)(GLsizei n, GLenum type, const GLvoid * lists); /* 3 */
- void (GLAPIENTRYP DeleteLists)(GLuint list, GLsizei range); /* 4 */
- GLuint (GLAPIENTRYP GenLists)(GLsizei range); /* 5 */
- void (GLAPIENTRYP ListBase)(GLuint base); /* 6 */
- void (GLAPIENTRYP Begin)(GLenum mode); /* 7 */
- void (GLAPIENTRYP Bitmap)(GLsizei width, GLsizei height, GLfloat xorig, GLfloat yorig, GLfloat xmove, GLfloat ymove, const GLubyte * bitmap); /* 8 */
- void (GLAPIENTRYP Color3b)(GLbyte red, GLbyte green, GLbyte blue); /* 9 */
- void (GLAPIENTRYP Color3bv)(const GLbyte * v); /* 10 */
- void (GLAPIENTRYP Color3d)(GLdouble red, GLdouble green, GLdouble blue); /* 11 */
- void (GLAPIENTRYP Color3dv)(const GLdouble * v); /* 12 */
- void (GLAPIENTRYP Color3f)(GLfloat red, GLfloat green, GLfloat blue); /* 13 */
- void (GLAPIENTRYP Color3fv)(const GLfloat * v); /* 14 */
- void (GLAPIENTRYP Color3i)(GLint red, GLint green, GLint blue); /* 15 */
- void (GLAPIENTRYP Color3iv)(const GLint * v); /* 16 */
- void (GLAPIENTRYP Color3s)(GLshort red, GLshort green, GLshort blue); /* 17 */
- void (GLAPIENTRYP Color3sv)(const GLshort * v); /* 18 */
- void (GLAPIENTRYP Color3ub)(GLubyte red, GLubyte green, GLubyte blue); /* 19 */
- void (GLAPIENTRYP Color3ubv)(const GLubyte * v); /* 20 */
- void (GLAPIENTRYP Color3ui)(GLuint red, GLuint green, GLuint blue); /* 21 */
- void (GLAPIENTRYP Color3uiv)(const GLuint * v); /* 22 */
- void (GLAPIENTRYP Color3us)(GLushort red, GLushort green, GLushort blue); /* 23 */
- void (GLAPIENTRYP Color3usv)(const GLushort * v); /* 24 */
- void (GLAPIENTRYP Color4b)(GLbyte red, GLbyte green, GLbyte blue, GLbyte alpha); /* 25 */
- void (GLAPIENTRYP Color4bv)(const GLbyte * v); /* 26 */
- void (GLAPIENTRYP Color4d)(GLdouble red, GLdouble green, GLdouble blue, GLdouble alpha); /* 27 */
- void (GLAPIENTRYP Color4dv)(const GLdouble * v); /* 28 */
- void (GLAPIENTRYP Color4f)(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); /* 29 */
- void (GLAPIENTRYP Color4fv)(const GLfloat * v); /* 30 */
- void (GLAPIENTRYP Color4i)(GLint red, GLint green, GLint blue, GLint alpha); /* 31 */
- void (GLAPIENTRYP Color4iv)(const GLint * v); /* 32 */
- void (GLAPIENTRYP Color4s)(GLshort red, GLshort green, GLshort blue, GLshort alpha); /* 33 */
- void (GLAPIENTRYP Color4sv)(const GLshort * v); /* 34 */
- void (GLAPIENTRYP Color4ub)(GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha); /* 35 */
- void (GLAPIENTRYP Color4ubv)(const GLubyte * v); /* 36 */
- void (GLAPIENTRYP Color4ui)(GLuint red, GLuint green, GLuint blue, GLuint alpha); /* 37 */
- void (GLAPIENTRYP Color4uiv)(const GLuint * v); /* 38 */
- void (GLAPIENTRYP Color4us)(GLushort red, GLushort green, GLushort blue, GLushort alpha); /* 39 */
- void (GLAPIENTRYP Color4usv)(const GLushort * v); /* 40 */
- void (GLAPIENTRYP EdgeFlag)(GLboolean flag); /* 41 */
- void (GLAPIENTRYP EdgeFlagv)(const GLboolean * flag); /* 42 */
- void (GLAPIENTRYP End)(void); /* 43 */
- void (GLAPIENTRYP Indexd)(GLdouble c); /* 44 */
- void (GLAPIENTRYP Indexdv)(const GLdouble * c); /* 45 */
- void (GLAPIENTRYP Indexf)(GLfloat c); /* 46 */
- void (GLAPIENTRYP Indexfv)(const GLfloat * c); /* 47 */
- void (GLAPIENTRYP Indexi)(GLint c); /* 48 */
- void (GLAPIENTRYP Indexiv)(const GLint * c); /* 49 */
- void (GLAPIENTRYP Indexs)(GLshort c); /* 50 */
- void (GLAPIENTRYP Indexsv)(const GLshort * c); /* 51 */
- void (GLAPIENTRYP Normal3b)(GLbyte nx, GLbyte ny, GLbyte nz); /* 52 */
- void (GLAPIENTRYP Normal3bv)(const GLbyte * v); /* 53 */
- void (GLAPIENTRYP Normal3d)(GLdouble nx, GLdouble ny, GLdouble nz); /* 54 */
- void (GLAPIENTRYP Normal3dv)(const GLdouble * v); /* 55 */
- void (GLAPIENTRYP Normal3f)(GLfloat nx, GLfloat ny, GLfloat nz); /* 56 */
- void (GLAPIENTRYP Normal3fv)(const GLfloat * v); /* 57 */
- void (GLAPIENTRYP Normal3i)(GLint nx, GLint ny, GLint nz); /* 58 */
- void (GLAPIENTRYP Normal3iv)(const GLint * v); /* 59 */
- void (GLAPIENTRYP Normal3s)(GLshort nx, GLshort ny, GLshort nz); /* 60 */
- void (GLAPIENTRYP Normal3sv)(const GLshort * v); /* 61 */
- void (GLAPIENTRYP RasterPos2d)(GLdouble x, GLdouble y); /* 62 */
- void (GLAPIENTRYP RasterPos2dv)(const GLdouble * v); /* 63 */
- void (GLAPIENTRYP RasterPos2f)(GLfloat x, GLfloat y); /* 64 */
- void (GLAPIENTRYP RasterPos2fv)(const GLfloat * v); /* 65 */
- void (GLAPIENTRYP RasterPos2i)(GLint x, GLint y); /* 66 */
- void (GLAPIENTRYP RasterPos2iv)(const GLint * v); /* 67 */
- void (GLAPIENTRYP RasterPos2s)(GLshort x, GLshort y); /* 68 */
- void (GLAPIENTRYP RasterPos2sv)(const GLshort * v); /* 69 */
- void (GLAPIENTRYP RasterPos3d)(GLdouble x, GLdouble y, GLdouble z); /* 70 */
- void (GLAPIENTRYP RasterPos3dv)(const GLdouble * v); /* 71 */
- void (GLAPIENTRYP RasterPos3f)(GLfloat x, GLfloat y, GLfloat z); /* 72 */
- void (GLAPIENTRYP RasterPos3fv)(const GLfloat * v); /* 73 */
- void (GLAPIENTRYP RasterPos3i)(GLint x, GLint y, GLint z); /* 74 */
- void (GLAPIENTRYP RasterPos3iv)(const GLint * v); /* 75 */
- void (GLAPIENTRYP RasterPos3s)(GLshort x, GLshort y, GLshort z); /* 76 */
- void (GLAPIENTRYP RasterPos3sv)(const GLshort * v); /* 77 */
- void (GLAPIENTRYP RasterPos4d)(GLdouble x, GLdouble y, GLdouble z, GLdouble w); /* 78 */
- void (GLAPIENTRYP RasterPos4dv)(const GLdouble * v); /* 79 */
- void (GLAPIENTRYP RasterPos4f)(GLfloat x, GLfloat y, GLfloat z, GLfloat w); /* 80 */
- void (GLAPIENTRYP RasterPos4fv)(const GLfloat * v); /* 81 */
- void (GLAPIENTRYP RasterPos4i)(GLint x, GLint y, GLint z, GLint w); /* 82 */
- void (GLAPIENTRYP RasterPos4iv)(const GLint * v); /* 83 */
- void (GLAPIENTRYP RasterPos4s)(GLshort x, GLshort y, GLshort z, GLshort w); /* 84 */
- void (GLAPIENTRYP RasterPos4sv)(const GLshort * v); /* 85 */
- void (GLAPIENTRYP Rectd)(GLdouble x1, GLdouble y1, GLdouble x2, GLdouble y2); /* 86 */
- void (GLAPIENTRYP Rectdv)(const GLdouble * v1, const GLdouble * v2); /* 87 */
- void (GLAPIENTRYP Rectf)(GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2); /* 88 */
- void (GLAPIENTRYP Rectfv)(const GLfloat * v1, const GLfloat * v2); /* 89 */
- void (GLAPIENTRYP Recti)(GLint x1, GLint y1, GLint x2, GLint y2); /* 90 */
- void (GLAPIENTRYP Rectiv)(const GLint * v1, const GLint * v2); /* 91 */
- void (GLAPIENTRYP Rects)(GLshort x1, GLshort y1, GLshort x2, GLshort y2); /* 92 */
- void (GLAPIENTRYP Rectsv)(const GLshort * v1, const GLshort * v2); /* 93 */
- void (GLAPIENTRYP TexCoord1d)(GLdouble s); /* 94 */
- void (GLAPIENTRYP TexCoord1dv)(const GLdouble * v); /* 95 */
- void (GLAPIENTRYP TexCoord1f)(GLfloat s); /* 96 */
- void (GLAPIENTRYP TexCoord1fv)(const GLfloat * v); /* 97 */
- void (GLAPIENTRYP TexCoord1i)(GLint s); /* 98 */
- void (GLAPIENTRYP TexCoord1iv)(const GLint * v); /* 99 */
- void (GLAPIENTRYP TexCoord1s)(GLshort s); /* 100 */
- void (GLAPIENTRYP TexCoord1sv)(const GLshort * v); /* 101 */
- void (GLAPIENTRYP TexCoord2d)(GLdouble s, GLdouble t); /* 102 */
- void (GLAPIENTRYP TexCoord2dv)(const GLdouble * v); /* 103 */
- void (GLAPIENTRYP TexCoord2f)(GLfloat s, GLfloat t); /* 104 */
- void (GLAPIENTRYP TexCoord2fv)(const GLfloat * v); /* 105 */
- void (GLAPIENTRYP TexCoord2i)(GLint s, GLint t); /* 106 */
- void (GLAPIENTRYP TexCoord2iv)(const GLint * v); /* 107 */
- void (GLAPIENTRYP TexCoord2s)(GLshort s, GLshort t); /* 108 */
- void (GLAPIENTRYP TexCoord2sv)(const GLshort * v); /* 109 */
- void (GLAPIENTRYP TexCoord3d)(GLdouble s, GLdouble t, GLdouble r); /* 110 */
- void (GLAPIENTRYP TexCoord3dv)(const GLdouble * v); /* 111 */
- void (GLAPIENTRYP TexCoord3f)(GLfloat s, GLfloat t, GLfloat r); /* 112 */
- void (GLAPIENTRYP TexCoord3fv)(const GLfloat * v); /* 113 */
- void (GLAPIENTRYP TexCoord3i)(GLint s, GLint t, GLint r); /* 114 */
- void (GLAPIENTRYP TexCoord3iv)(const GLint * v); /* 115 */
- void (GLAPIENTRYP TexCoord3s)(GLshort s, GLshort t, GLshort r); /* 116 */
- void (GLAPIENTRYP TexCoord3sv)(const GLshort * v); /* 117 */
- void (GLAPIENTRYP TexCoord4d)(GLdouble s, GLdouble t, GLdouble r, GLdouble q); /* 118 */
- void (GLAPIENTRYP TexCoord4dv)(const GLdouble * v); /* 119 */
- void (GLAPIENTRYP TexCoord4f)(GLfloat s, GLfloat t, GLfloat r, GLfloat q); /* 120 */
- void (GLAPIENTRYP TexCoord4fv)(const GLfloat * v); /* 121 */
- void (GLAPIENTRYP TexCoord4i)(GLint s, GLint t, GLint r, GLint q); /* 122 */
- void (GLAPIENTRYP TexCoord4iv)(const GLint * v); /* 123 */
- void (GLAPIENTRYP TexCoord4s)(GLshort s, GLshort t, GLshort r, GLshort q); /* 124 */
- void (GLAPIENTRYP TexCoord4sv)(const GLshort * v); /* 125 */
- void (GLAPIENTRYP Vertex2d)(GLdouble x, GLdouble y); /* 126 */
- void (GLAPIENTRYP Vertex2dv)(const GLdouble * v); /* 127 */
- void (GLAPIENTRYP Vertex2f)(GLfloat x, GLfloat y); /* 128 */
- void (GLAPIENTRYP Vertex2fv)(const GLfloat * v); /* 129 */
- void (GLAPIENTRYP Vertex2i)(GLint x, GLint y); /* 130 */
- void (GLAPIENTRYP Vertex2iv)(const GLint * v); /* 131 */
- void (GLAPIENTRYP Vertex2s)(GLshort x, GLshort y); /* 132 */
- void (GLAPIENTRYP Vertex2sv)(const GLshort * v); /* 133 */
- void (GLAPIENTRYP Vertex3d)(GLdouble x, GLdouble y, GLdouble z); /* 134 */
- void (GLAPIENTRYP Vertex3dv)(const GLdouble * v); /* 135 */
- void (GLAPIENTRYP Vertex3f)(GLfloat x, GLfloat y, GLfloat z); /* 136 */
- void (GLAPIENTRYP Vertex3fv)(const GLfloat * v); /* 137 */
- void (GLAPIENTRYP Vertex3i)(GLint x, GLint y, GLint z); /* 138 */
- void (GLAPIENTRYP Vertex3iv)(const GLint * v); /* 139 */
- void (GLAPIENTRYP Vertex3s)(GLshort x, GLshort y, GLshort z); /* 140 */
- void (GLAPIENTRYP Vertex3sv)(const GLshort * v); /* 141 */
- void (GLAPIENTRYP Vertex4d)(GLdouble x, GLdouble y, GLdouble z, GLdouble w); /* 142 */
- void (GLAPIENTRYP Vertex4dv)(const GLdouble * v); /* 143 */
- void (GLAPIENTRYP Vertex4f)(GLfloat x, GLfloat y, GLfloat z, GLfloat w); /* 144 */
- void (GLAPIENTRYP Vertex4fv)(const GLfloat * v); /* 145 */
- void (GLAPIENTRYP Vertex4i)(GLint x, GLint y, GLint z, GLint w); /* 146 */
- void (GLAPIENTRYP Vertex4iv)(const GLint * v); /* 147 */
- void (GLAPIENTRYP Vertex4s)(GLshort x, GLshort y, GLshort z, GLshort w); /* 148 */
- void (GLAPIENTRYP Vertex4sv)(const GLshort * v); /* 149 */
- void (GLAPIENTRYP ClipPlane)(GLenum plane, const GLdouble * equation); /* 150 */
- void (GLAPIENTRYP ColorMaterial)(GLenum face, GLenum mode); /* 151 */
- void (GLAPIENTRYP CullFace)(GLenum mode); /* 152 */
- void (GLAPIENTRYP Fogf)(GLenum pname, GLfloat param); /* 153 */
- void (GLAPIENTRYP Fogfv)(GLenum pname, const GLfloat * params); /* 154 */
- void (GLAPIENTRYP Fogi)(GLenum pname, GLint param); /* 155 */
- void (GLAPIENTRYP Fogiv)(GLenum pname, const GLint * params); /* 156 */
- void (GLAPIENTRYP FrontFace)(GLenum mode); /* 157 */
- void (GLAPIENTRYP Hint)(GLenum target, GLenum mode); /* 158 */
- void (GLAPIENTRYP Lightf)(GLenum light, GLenum pname, GLfloat param); /* 159 */
- void (GLAPIENTRYP Lightfv)(GLenum light, GLenum pname, const GLfloat * params); /* 160 */
- void (GLAPIENTRYP Lighti)(GLenum light, GLenum pname, GLint param); /* 161 */
- void (GLAPIENTRYP Lightiv)(GLenum light, GLenum pname, const GLint * params); /* 162 */
- void (GLAPIENTRYP LightModelf)(GLenum pname, GLfloat param); /* 163 */
- void (GLAPIENTRYP LightModelfv)(GLenum pname, const GLfloat * params); /* 164 */
- void (GLAPIENTRYP LightModeli)(GLenum pname, GLint param); /* 165 */
- void (GLAPIENTRYP LightModeliv)(GLenum pname, const GLint * params); /* 166 */
- void (GLAPIENTRYP LineStipple)(GLint factor, GLushort pattern); /* 167 */
- void (GLAPIENTRYP LineWidth)(GLfloat width); /* 168 */
- void (GLAPIENTRYP Materialf)(GLenum face, GLenum pname, GLfloat param); /* 169 */
- void (GLAPIENTRYP Materialfv)(GLenum face, GLenum pname, const GLfloat * params); /* 170 */
- void (GLAPIENTRYP Materiali)(GLenum face, GLenum pname, GLint param); /* 171 */
- void (GLAPIENTRYP Materialiv)(GLenum face, GLenum pname, const GLint * params); /* 172 */
- void (GLAPIENTRYP PointSize)(GLfloat size); /* 173 */
- void (GLAPIENTRYP PolygonMode)(GLenum face, GLenum mode); /* 174 */
- void (GLAPIENTRYP PolygonStipple)(const GLubyte * mask); /* 175 */
- void (GLAPIENTRYP Scissor)(GLint x, GLint y, GLsizei width, GLsizei height); /* 176 */
- void (GLAPIENTRYP ShadeModel)(GLenum mode); /* 177 */
- void (GLAPIENTRYP TexParameterf)(GLenum target, GLenum pname, GLfloat param); /* 178 */
- void (GLAPIENTRYP TexParameterfv)(GLenum target, GLenum pname, const GLfloat * params); /* 179 */
- void (GLAPIENTRYP TexParameteri)(GLenum target, GLenum pname, GLint param); /* 180 */
- void (GLAPIENTRYP TexParameteriv)(GLenum target, GLenum pname, const GLint * params); /* 181 */
- void (GLAPIENTRYP TexImage1D)(GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid * pixels); /* 182 */
- void (GLAPIENTRYP TexImage2D)(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid * pixels); /* 183 */
- void (GLAPIENTRYP TexEnvf)(GLenum target, GLenum pname, GLfloat param); /* 184 */
- void (GLAPIENTRYP TexEnvfv)(GLenum target, GLenum pname, const GLfloat * params); /* 185 */
- void (GLAPIENTRYP TexEnvi)(GLenum target, GLenum pname, GLint param); /* 186 */
- void (GLAPIENTRYP TexEnviv)(GLenum target, GLenum pname, const GLint * params); /* 187 */
- void (GLAPIENTRYP TexGend)(GLenum coord, GLenum pname, GLdouble param); /* 188 */
- void (GLAPIENTRYP TexGendv)(GLenum coord, GLenum pname, const GLdouble * params); /* 189 */
- void (GLAPIENTRYP TexGenf)(GLenum coord, GLenum pname, GLfloat param); /* 190 */
- void (GLAPIENTRYP TexGenfv)(GLenum coord, GLenum pname, const GLfloat * params); /* 191 */
- void (GLAPIENTRYP TexGeni)(GLenum coord, GLenum pname, GLint param); /* 192 */
- void (GLAPIENTRYP TexGeniv)(GLenum coord, GLenum pname, const GLint * params); /* 193 */
- void (GLAPIENTRYP FeedbackBuffer)(GLsizei size, GLenum type, GLfloat * buffer); /* 194 */
- void (GLAPIENTRYP SelectBuffer)(GLsizei size, GLuint * buffer); /* 195 */
- GLint (GLAPIENTRYP RenderMode)(GLenum mode); /* 196 */
- void (GLAPIENTRYP InitNames)(void); /* 197 */
- void (GLAPIENTRYP LoadName)(GLuint name); /* 198 */
- void (GLAPIENTRYP PassThrough)(GLfloat token); /* 199 */
- void (GLAPIENTRYP PopName)(void); /* 200 */
- void (GLAPIENTRYP PushName)(GLuint name); /* 201 */
- void (GLAPIENTRYP DrawBuffer)(GLenum mode); /* 202 */
- void (GLAPIENTRYP Clear)(GLbitfield mask); /* 203 */
- void (GLAPIENTRYP ClearAccum)(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); /* 204 */
- void (GLAPIENTRYP ClearIndex)(GLfloat c); /* 205 */
- void (GLAPIENTRYP ClearColor)(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); /* 206 */
- void (GLAPIENTRYP ClearStencil)(GLint s); /* 207 */
- void (GLAPIENTRYP ClearDepth)(GLclampd depth); /* 208 */
- void (GLAPIENTRYP StencilMask)(GLuint mask); /* 209 */
- void (GLAPIENTRYP ColorMask)(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha); /* 210 */
- void (GLAPIENTRYP DepthMask)(GLboolean flag); /* 211 */
- void (GLAPIENTRYP IndexMask)(GLuint mask); /* 212 */
- void (GLAPIENTRYP Accum)(GLenum op, GLfloat value); /* 213 */
- void (GLAPIENTRYP Disable)(GLenum cap); /* 214 */
- void (GLAPIENTRYP Enable)(GLenum cap); /* 215 */
- void (GLAPIENTRYP Finish)(void); /* 216 */
- void (GLAPIENTRYP Flush)(void); /* 217 */
- void (GLAPIENTRYP PopAttrib)(void); /* 218 */
- void (GLAPIENTRYP PushAttrib)(GLbitfield mask); /* 219 */
- void (GLAPIENTRYP Map1d)(GLenum target, GLdouble u1, GLdouble u2, GLint stride, GLint order, const GLdouble * points); /* 220 */
- void (GLAPIENTRYP Map1f)(GLenum target, GLfloat u1, GLfloat u2, GLint stride, GLint order, const GLfloat * points); /* 221 */
- void (GLAPIENTRYP Map2d)(GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, const GLdouble * points); /* 222 */
- void (GLAPIENTRYP Map2f)(GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, const GLfloat * points); /* 223 */
- void (GLAPIENTRYP MapGrid1d)(GLint un, GLdouble u1, GLdouble u2); /* 224 */
- void (GLAPIENTRYP MapGrid1f)(GLint un, GLfloat u1, GLfloat u2); /* 225 */
- void (GLAPIENTRYP MapGrid2d)(GLint un, GLdouble u1, GLdouble u2, GLint vn, GLdouble v1, GLdouble v2); /* 226 */
- void (GLAPIENTRYP MapGrid2f)(GLint un, GLfloat u1, GLfloat u2, GLint vn, GLfloat v1, GLfloat v2); /* 227 */
- void (GLAPIENTRYP EvalCoord1d)(GLdouble u); /* 228 */
- void (GLAPIENTRYP EvalCoord1dv)(const GLdouble * u); /* 229 */
- void (GLAPIENTRYP EvalCoord1f)(GLfloat u); /* 230 */
- void (GLAPIENTRYP EvalCoord1fv)(const GLfloat * u); /* 231 */
- void (GLAPIENTRYP EvalCoord2d)(GLdouble u, GLdouble v); /* 232 */
- void (GLAPIENTRYP EvalCoord2dv)(const GLdouble * u); /* 233 */
- void (GLAPIENTRYP EvalCoord2f)(GLfloat u, GLfloat v); /* 234 */
- void (GLAPIENTRYP EvalCoord2fv)(const GLfloat * u); /* 235 */
- void (GLAPIENTRYP EvalMesh1)(GLenum mode, GLint i1, GLint i2); /* 236 */
- void (GLAPIENTRYP EvalPoint1)(GLint i); /* 237 */
- void (GLAPIENTRYP EvalMesh2)(GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2); /* 238 */
- void (GLAPIENTRYP EvalPoint2)(GLint i, GLint j); /* 239 */
- void (GLAPIENTRYP AlphaFunc)(GLenum func, GLclampf ref); /* 240 */
- void (GLAPIENTRYP BlendFunc)(GLenum sfactor, GLenum dfactor); /* 241 */
- void (GLAPIENTRYP LogicOp)(GLenum opcode); /* 242 */
- void (GLAPIENTRYP StencilFunc)(GLenum func, GLint ref, GLuint mask); /* 243 */
- void (GLAPIENTRYP StencilOp)(GLenum fail, GLenum zfail, GLenum zpass); /* 244 */
- void (GLAPIENTRYP DepthFunc)(GLenum func); /* 245 */
- void (GLAPIENTRYP PixelZoom)(GLfloat xfactor, GLfloat yfactor); /* 246 */
- void (GLAPIENTRYP PixelTransferf)(GLenum pname, GLfloat param); /* 247 */
- void (GLAPIENTRYP PixelTransferi)(GLenum pname, GLint param); /* 248 */
- void (GLAPIENTRYP PixelStoref)(GLenum pname, GLfloat param); /* 249 */
- void (GLAPIENTRYP PixelStorei)(GLenum pname, GLint param); /* 250 */
- void (GLAPIENTRYP PixelMapfv)(GLenum map, GLsizei mapsize, const GLfloat * values); /* 251 */
- void (GLAPIENTRYP PixelMapuiv)(GLenum map, GLsizei mapsize, const GLuint * values); /* 252 */
- void (GLAPIENTRYP PixelMapusv)(GLenum map, GLsizei mapsize, const GLushort * values); /* 253 */
- void (GLAPIENTRYP ReadBuffer)(GLenum mode); /* 254 */
- void (GLAPIENTRYP CopyPixels)(GLint x, GLint y, GLsizei width, GLsizei height, GLenum type); /* 255 */
- void (GLAPIENTRYP ReadPixels)(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid * pixels); /* 256 */
- void (GLAPIENTRYP DrawPixels)(GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * pixels); /* 257 */
- void (GLAPIENTRYP GetBooleanv)(GLenum pname, GLboolean * params); /* 258 */
- void (GLAPIENTRYP GetClipPlane)(GLenum plane, GLdouble * equation); /* 259 */
- void (GLAPIENTRYP GetDoublev)(GLenum pname, GLdouble * params); /* 260 */
- GLenum (GLAPIENTRYP GetError)(void); /* 261 */
- void (GLAPIENTRYP GetFloatv)(GLenum pname, GLfloat * params); /* 262 */
- void (GLAPIENTRYP GetIntegerv)(GLenum pname, GLint * params); /* 263 */
- void (GLAPIENTRYP GetLightfv)(GLenum light, GLenum pname, GLfloat * params); /* 264 */
- void (GLAPIENTRYP GetLightiv)(GLenum light, GLenum pname, GLint * params); /* 265 */
- void (GLAPIENTRYP GetMapdv)(GLenum target, GLenum query, GLdouble * v); /* 266 */
- void (GLAPIENTRYP GetMapfv)(GLenum target, GLenum query, GLfloat * v); /* 267 */
- void (GLAPIENTRYP GetMapiv)(GLenum target, GLenum query, GLint * v); /* 268 */
- void (GLAPIENTRYP GetMaterialfv)(GLenum face, GLenum pname, GLfloat * params); /* 269 */
- void (GLAPIENTRYP GetMaterialiv)(GLenum face, GLenum pname, GLint * params); /* 270 */
- void (GLAPIENTRYP GetPixelMapfv)(GLenum map, GLfloat * values); /* 271 */
- void (GLAPIENTRYP GetPixelMapuiv)(GLenum map, GLuint * values); /* 272 */
- void (GLAPIENTRYP GetPixelMapusv)(GLenum map, GLushort * values); /* 273 */
- void (GLAPIENTRYP GetPolygonStipple)(GLubyte * mask); /* 274 */
- const GLubyte * (GLAPIENTRYP GetString)(GLenum name); /* 275 */
- void (GLAPIENTRYP GetTexEnvfv)(GLenum target, GLenum pname, GLfloat * params); /* 276 */
- void (GLAPIENTRYP GetTexEnviv)(GLenum target, GLenum pname, GLint * params); /* 277 */
- void (GLAPIENTRYP GetTexGendv)(GLenum coord, GLenum pname, GLdouble * params); /* 278 */
- void (GLAPIENTRYP GetTexGenfv)(GLenum coord, GLenum pname, GLfloat * params); /* 279 */
- void (GLAPIENTRYP GetTexGeniv)(GLenum coord, GLenum pname, GLint * params); /* 280 */
- void (GLAPIENTRYP GetTexImage)(GLenum target, GLint level, GLenum format, GLenum type, GLvoid * pixels); /* 281 */
- void (GLAPIENTRYP GetTexParameterfv)(GLenum target, GLenum pname, GLfloat * params); /* 282 */
- void (GLAPIENTRYP GetTexParameteriv)(GLenum target, GLenum pname, GLint * params); /* 283 */
- void (GLAPIENTRYP GetTexLevelParameterfv)(GLenum target, GLint level, GLenum pname, GLfloat * params); /* 284 */
- void (GLAPIENTRYP GetTexLevelParameteriv)(GLenum target, GLint level, GLenum pname, GLint * params); /* 285 */
- GLboolean (GLAPIENTRYP IsEnabled)(GLenum cap); /* 286 */
- GLboolean (GLAPIENTRYP IsList)(GLuint list); /* 287 */
- void (GLAPIENTRYP DepthRange)(GLclampd zNear, GLclampd zFar); /* 288 */
- void (GLAPIENTRYP Frustum)(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar); /* 289 */
- void (GLAPIENTRYP LoadIdentity)(void); /* 290 */
- void (GLAPIENTRYP LoadMatrixf)(const GLfloat * m); /* 291 */
- void (GLAPIENTRYP LoadMatrixd)(const GLdouble * m); /* 292 */
- void (GLAPIENTRYP MatrixMode)(GLenum mode); /* 293 */
- void (GLAPIENTRYP MultMatrixf)(const GLfloat * m); /* 294 */
- void (GLAPIENTRYP MultMatrixd)(const GLdouble * m); /* 295 */
- void (GLAPIENTRYP Ortho)(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar); /* 296 */
- void (GLAPIENTRYP PopMatrix)(void); /* 297 */
- void (GLAPIENTRYP PushMatrix)(void); /* 298 */
- void (GLAPIENTRYP Rotated)(GLdouble angle, GLdouble x, GLdouble y, GLdouble z); /* 299 */
- void (GLAPIENTRYP Rotatef)(GLfloat angle, GLfloat x, GLfloat y, GLfloat z); /* 300 */
- void (GLAPIENTRYP Scaled)(GLdouble x, GLdouble y, GLdouble z); /* 301 */
- void (GLAPIENTRYP Scalef)(GLfloat x, GLfloat y, GLfloat z); /* 302 */
- void (GLAPIENTRYP Translated)(GLdouble x, GLdouble y, GLdouble z); /* 303 */
- void (GLAPIENTRYP Translatef)(GLfloat x, GLfloat y, GLfloat z); /* 304 */
- void (GLAPIENTRYP Viewport)(GLint x, GLint y, GLsizei width, GLsizei height); /* 305 */
- void (GLAPIENTRYP ArrayElement)(GLint i); /* 306 */
- void (GLAPIENTRYP BindTexture)(GLenum target, GLuint texture); /* 307 */
- void (GLAPIENTRYP ColorPointer)(GLint size, GLenum type, GLsizei stride, const GLvoid * pointer); /* 308 */
- void (GLAPIENTRYP DisableClientState)(GLenum array); /* 309 */
- void (GLAPIENTRYP DrawArrays)(GLenum mode, GLint first, GLsizei count); /* 310 */
- void (GLAPIENTRYP DrawElements)(GLenum mode, GLsizei count, GLenum type, const GLvoid * indices); /* 311 */
- void (GLAPIENTRYP EdgeFlagPointer)(GLsizei stride, const GLvoid * pointer); /* 312 */
- void (GLAPIENTRYP EnableClientState)(GLenum array); /* 313 */
- void (GLAPIENTRYP IndexPointer)(GLenum type, GLsizei stride, const GLvoid * pointer); /* 314 */
- void (GLAPIENTRYP Indexub)(GLubyte c); /* 315 */
- void (GLAPIENTRYP Indexubv)(const GLubyte * c); /* 316 */
- void (GLAPIENTRYP InterleavedArrays)(GLenum format, GLsizei stride, const GLvoid * pointer); /* 317 */
- void (GLAPIENTRYP NormalPointer)(GLenum type, GLsizei stride, const GLvoid * pointer); /* 318 */
- void (GLAPIENTRYP PolygonOffset)(GLfloat factor, GLfloat units); /* 319 */
- void (GLAPIENTRYP TexCoordPointer)(GLint size, GLenum type, GLsizei stride, const GLvoid * pointer); /* 320 */
- void (GLAPIENTRYP VertexPointer)(GLint size, GLenum type, GLsizei stride, const GLvoid * pointer); /* 321 */
- GLboolean (GLAPIENTRYP AreTexturesResident)(GLsizei n, const GLuint * textures, GLboolean * residences); /* 322 */
- void (GLAPIENTRYP CopyTexImage1D)(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border); /* 323 */
- void (GLAPIENTRYP CopyTexImage2D)(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); /* 324 */
- void (GLAPIENTRYP CopyTexSubImage1D)(GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); /* 325 */
- void (GLAPIENTRYP CopyTexSubImage2D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); /* 326 */
- void (GLAPIENTRYP DeleteTextures)(GLsizei n, const GLuint * textures); /* 327 */
- void (GLAPIENTRYP GenTextures)(GLsizei n, GLuint * textures); /* 328 */
- void (GLAPIENTRYP GetPointerv)(GLenum pname, GLvoid ** params); /* 329 */
- GLboolean (GLAPIENTRYP IsTexture)(GLuint texture); /* 330 */
- void (GLAPIENTRYP PrioritizeTextures)(GLsizei n, const GLuint * textures, const GLclampf * priorities); /* 331 */
- void (GLAPIENTRYP TexSubImage1D)(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid * pixels); /* 332 */
- void (GLAPIENTRYP TexSubImage2D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * pixels); /* 333 */
- void (GLAPIENTRYP PopClientAttrib)(void); /* 334 */
- void (GLAPIENTRYP PushClientAttrib)(GLbitfield mask); /* 335 */
- void (GLAPIENTRYP BlendColor)(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); /* 336 */
- void (GLAPIENTRYP BlendEquation)(GLenum mode); /* 337 */
- void (GLAPIENTRYP DrawRangeElements)(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid * indices); /* 338 */
- void (GLAPIENTRYP ColorTable)(GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid * table); /* 339 */
- void (GLAPIENTRYP ColorTableParameterfv)(GLenum target, GLenum pname, const GLfloat * params); /* 340 */
- void (GLAPIENTRYP ColorTableParameteriv)(GLenum target, GLenum pname, const GLint * params); /* 341 */
- void (GLAPIENTRYP CopyColorTable)(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); /* 342 */
- void (GLAPIENTRYP GetColorTable)(GLenum target, GLenum format, GLenum type, GLvoid * table); /* 343 */
- void (GLAPIENTRYP GetColorTableParameterfv)(GLenum target, GLenum pname, GLfloat * params); /* 344 */
- void (GLAPIENTRYP GetColorTableParameteriv)(GLenum target, GLenum pname, GLint * params); /* 345 */
- void (GLAPIENTRYP ColorSubTable)(GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid * data); /* 346 */
- void (GLAPIENTRYP CopyColorSubTable)(GLenum target, GLsizei start, GLint x, GLint y, GLsizei width); /* 347 */
- void (GLAPIENTRYP ConvolutionFilter1D)(GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid * image); /* 348 */
- void (GLAPIENTRYP ConvolutionFilter2D)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * image); /* 349 */
- void (GLAPIENTRYP ConvolutionParameterf)(GLenum target, GLenum pname, GLfloat params); /* 350 */
- void (GLAPIENTRYP ConvolutionParameterfv)(GLenum target, GLenum pname, const GLfloat * params); /* 351 */
- void (GLAPIENTRYP ConvolutionParameteri)(GLenum target, GLenum pname, GLint params); /* 352 */
- void (GLAPIENTRYP ConvolutionParameteriv)(GLenum target, GLenum pname, const GLint * params); /* 353 */
- void (GLAPIENTRYP CopyConvolutionFilter1D)(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); /* 354 */
- void (GLAPIENTRYP CopyConvolutionFilter2D)(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height); /* 355 */
- void (GLAPIENTRYP GetConvolutionFilter)(GLenum target, GLenum format, GLenum type, GLvoid * image); /* 356 */
- void (GLAPIENTRYP GetConvolutionParameterfv)(GLenum target, GLenum pname, GLfloat * params); /* 357 */
- void (GLAPIENTRYP GetConvolutionParameteriv)(GLenum target, GLenum pname, GLint * params); /* 358 */
- void (GLAPIENTRYP GetSeparableFilter)(GLenum target, GLenum format, GLenum type, GLvoid * row, GLvoid * column, GLvoid * span); /* 359 */
- void (GLAPIENTRYP SeparableFilter2D)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * row, const GLvoid * column); /* 360 */
- void (GLAPIENTRYP GetHistogram)(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid * values); /* 361 */
- void (GLAPIENTRYP GetHistogramParameterfv)(GLenum target, GLenum pname, GLfloat * params); /* 362 */
- void (GLAPIENTRYP GetHistogramParameteriv)(GLenum target, GLenum pname, GLint * params); /* 363 */
- void (GLAPIENTRYP GetMinmax)(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid * values); /* 364 */
- void (GLAPIENTRYP GetMinmaxParameterfv)(GLenum target, GLenum pname, GLfloat * params); /* 365 */
- void (GLAPIENTRYP GetMinmaxParameteriv)(GLenum target, GLenum pname, GLint * params); /* 366 */
- void (GLAPIENTRYP Histogram)(GLenum target, GLsizei width, GLenum internalformat, GLboolean sink); /* 367 */
- void (GLAPIENTRYP Minmax)(GLenum target, GLenum internalformat, GLboolean sink); /* 368 */
- void (GLAPIENTRYP ResetHistogram)(GLenum target); /* 369 */
- void (GLAPIENTRYP ResetMinmax)(GLenum target); /* 370 */
- void (GLAPIENTRYP TexImage3D)(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid * pixels); /* 371 */
- void (GLAPIENTRYP TexSubImage3D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid * pixels); /* 372 */
- void (GLAPIENTRYP CopyTexSubImage3D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); /* 373 */
- void (GLAPIENTRYP ActiveTextureARB)(GLenum texture); /* 374 */
- void (GLAPIENTRYP ClientActiveTextureARB)(GLenum texture); /* 375 */
- void (GLAPIENTRYP MultiTexCoord1dARB)(GLenum target, GLdouble s); /* 376 */
- void (GLAPIENTRYP MultiTexCoord1dvARB)(GLenum target, const GLdouble * v); /* 377 */
- void (GLAPIENTRYP MultiTexCoord1fARB)(GLenum target, GLfloat s); /* 378 */
- void (GLAPIENTRYP MultiTexCoord1fvARB)(GLenum target, const GLfloat * v); /* 379 */
- void (GLAPIENTRYP MultiTexCoord1iARB)(GLenum target, GLint s); /* 380 */
- void (GLAPIENTRYP MultiTexCoord1ivARB)(GLenum target, const GLint * v); /* 381 */
- void (GLAPIENTRYP MultiTexCoord1sARB)(GLenum target, GLshort s); /* 382 */
- void (GLAPIENTRYP MultiTexCoord1svARB)(GLenum target, const GLshort * v); /* 383 */
- void (GLAPIENTRYP MultiTexCoord2dARB)(GLenum target, GLdouble s, GLdouble t); /* 384 */
- void (GLAPIENTRYP MultiTexCoord2dvARB)(GLenum target, const GLdouble * v); /* 385 */
- void (GLAPIENTRYP MultiTexCoord2fARB)(GLenum target, GLfloat s, GLfloat t); /* 386 */
- void (GLAPIENTRYP MultiTexCoord2fvARB)(GLenum target, const GLfloat * v); /* 387 */
- void (GLAPIENTRYP MultiTexCoord2iARB)(GLenum target, GLint s, GLint t); /* 388 */
- void (GLAPIENTRYP MultiTexCoord2ivARB)(GLenum target, const GLint * v); /* 389 */
- void (GLAPIENTRYP MultiTexCoord2sARB)(GLenum target, GLshort s, GLshort t); /* 390 */
- void (GLAPIENTRYP MultiTexCoord2svARB)(GLenum target, const GLshort * v); /* 391 */
- void (GLAPIENTRYP MultiTexCoord3dARB)(GLenum target, GLdouble s, GLdouble t, GLdouble r); /* 392 */
- void (GLAPIENTRYP MultiTexCoord3dvARB)(GLenum target, const GLdouble * v); /* 393 */
- void (GLAPIENTRYP MultiTexCoord3fARB)(GLenum target, GLfloat s, GLfloat t, GLfloat r); /* 394 */
- void (GLAPIENTRYP MultiTexCoord3fvARB)(GLenum target, const GLfloat * v); /* 395 */
- void (GLAPIENTRYP MultiTexCoord3iARB)(GLenum target, GLint s, GLint t, GLint r); /* 396 */
- void (GLAPIENTRYP MultiTexCoord3ivARB)(GLenum target, const GLint * v); /* 397 */
- void (GLAPIENTRYP MultiTexCoord3sARB)(GLenum target, GLshort s, GLshort t, GLshort r); /* 398 */
- void (GLAPIENTRYP MultiTexCoord3svARB)(GLenum target, const GLshort * v); /* 399 */
- void (GLAPIENTRYP MultiTexCoord4dARB)(GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q); /* 400 */
- void (GLAPIENTRYP MultiTexCoord4dvARB)(GLenum target, const GLdouble * v); /* 401 */
- void (GLAPIENTRYP MultiTexCoord4fARB)(GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q); /* 402 */
- void (GLAPIENTRYP MultiTexCoord4fvARB)(GLenum target, const GLfloat * v); /* 403 */
- void (GLAPIENTRYP MultiTexCoord4iARB)(GLenum target, GLint s, GLint t, GLint r, GLint q); /* 404 */
- void (GLAPIENTRYP MultiTexCoord4ivARB)(GLenum target, const GLint * v); /* 405 */
- void (GLAPIENTRYP MultiTexCoord4sARB)(GLenum target, GLshort s, GLshort t, GLshort r, GLshort q); /* 406 */
- void (GLAPIENTRYP MultiTexCoord4svARB)(GLenum target, const GLshort * v); /* 407 */
- void (GLAPIENTRYP AttachShader)(GLuint program, GLuint shader); /* 408 */
- GLuint (GLAPIENTRYP CreateProgram)(void); /* 409 */
- GLuint (GLAPIENTRYP CreateShader)(GLenum type); /* 410 */
- void (GLAPIENTRYP DeleteProgram)(GLuint program); /* 411 */
- void (GLAPIENTRYP DeleteShader)(GLuint program); /* 412 */
- void (GLAPIENTRYP DetachShader)(GLuint program, GLuint shader); /* 413 */
- void (GLAPIENTRYP GetAttachedShaders)(GLuint program, GLsizei maxCount, GLsizei * count, GLuint * obj); /* 414 */
- void (GLAPIENTRYP GetProgramInfoLog)(GLuint program, GLsizei bufSize, GLsizei * length, GLchar * infoLog); /* 415 */
- void (GLAPIENTRYP GetProgramiv)(GLuint program, GLenum pname, GLint * params); /* 416 */
- void (GLAPIENTRYP GetShaderInfoLog)(GLuint shader, GLsizei bufSize, GLsizei * length, GLchar * infoLog); /* 417 */
- void (GLAPIENTRYP GetShaderiv)(GLuint shader, GLenum pname, GLint * params); /* 418 */
- GLboolean (GLAPIENTRYP IsProgram)(GLuint program); /* 419 */
- GLboolean (GLAPIENTRYP IsShader)(GLuint shader); /* 420 */
- void (GLAPIENTRYP StencilFuncSeparate)(GLenum face, GLenum func, GLint ref, GLuint mask); /* 421 */
- void (GLAPIENTRYP StencilMaskSeparate)(GLenum face, GLuint mask); /* 422 */
- void (GLAPIENTRYP StencilOpSeparate)(GLenum face, GLenum sfail, GLenum zfail, GLenum zpass); /* 423 */
- void (GLAPIENTRYP UniformMatrix2x3fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); /* 424 */
- void (GLAPIENTRYP UniformMatrix2x4fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); /* 425 */
- void (GLAPIENTRYP UniformMatrix3x2fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); /* 426 */
- void (GLAPIENTRYP UniformMatrix3x4fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); /* 427 */
- void (GLAPIENTRYP UniformMatrix4x2fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); /* 428 */
- void (GLAPIENTRYP UniformMatrix4x3fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); /* 429 */
- void (GLAPIENTRYP ClampColor)(GLenum target, GLenum clamp); /* 430 */
- void (GLAPIENTRYP ClearBufferfi)(GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil); /* 431 */
- void (GLAPIENTRYP ClearBufferfv)(GLenum buffer, GLint drawbuffer, const GLfloat * value); /* 432 */
- void (GLAPIENTRYP ClearBufferiv)(GLenum buffer, GLint drawbuffer, const GLint * value); /* 433 */
- void (GLAPIENTRYP ClearBufferuiv)(GLenum buffer, GLint drawbuffer, const GLuint * value); /* 434 */
- const GLubyte * (GLAPIENTRYP GetStringi)(GLenum name, GLuint index); /* 435 */
- void (GLAPIENTRYP TexBuffer)(GLenum target, GLenum internalFormat, GLuint buffer); /* 436 */
- void (GLAPIENTRYP FramebufferTexture)(GLenum target, GLenum attachment, GLuint texture, GLint level); /* 437 */
- void (GLAPIENTRYP GetBufferParameteri64v)(GLenum target, GLenum pname, GLint64 * params); /* 438 */
- void (GLAPIENTRYP GetInteger64i_v)(GLenum cap, GLuint index, GLint64 * data); /* 439 */
- void (GLAPIENTRYP VertexAttribDivisor)(GLuint index, GLuint divisor); /* 440 */
- void (GLAPIENTRYP LoadTransposeMatrixdARB)(const GLdouble * m); /* 441 */
- void (GLAPIENTRYP LoadTransposeMatrixfARB)(const GLfloat * m); /* 442 */
- void (GLAPIENTRYP MultTransposeMatrixdARB)(const GLdouble * m); /* 443 */
- void (GLAPIENTRYP MultTransposeMatrixfARB)(const GLfloat * m); /* 444 */
- void (GLAPIENTRYP SampleCoverageARB)(GLclampf value, GLboolean invert); /* 445 */
- void (GLAPIENTRYP CompressedTexImage1DARB)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid * data); /* 446 */
- void (GLAPIENTRYP CompressedTexImage2DARB)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid * data); /* 447 */
- void (GLAPIENTRYP CompressedTexImage3DARB)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid * data); /* 448 */
- void (GLAPIENTRYP CompressedTexSubImage1DARB)(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid * data); /* 449 */
- void (GLAPIENTRYP CompressedTexSubImage2DARB)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid * data); /* 450 */
- void (GLAPIENTRYP CompressedTexSubImage3DARB)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid * data); /* 451 */
- void (GLAPIENTRYP GetCompressedTexImageARB)(GLenum target, GLint level, GLvoid * img); /* 452 */
- void (GLAPIENTRYP DisableVertexAttribArrayARB)(GLuint index); /* 453 */
- void (GLAPIENTRYP EnableVertexAttribArrayARB)(GLuint index); /* 454 */
- void (GLAPIENTRYP GetProgramEnvParameterdvARB)(GLenum target, GLuint index, GLdouble * params); /* 455 */
- void (GLAPIENTRYP GetProgramEnvParameterfvARB)(GLenum target, GLuint index, GLfloat * params); /* 456 */
- void (GLAPIENTRYP GetProgramLocalParameterdvARB)(GLenum target, GLuint index, GLdouble * params); /* 457 */
- void (GLAPIENTRYP GetProgramLocalParameterfvARB)(GLenum target, GLuint index, GLfloat * params); /* 458 */
- void (GLAPIENTRYP GetProgramStringARB)(GLenum target, GLenum pname, GLvoid * string); /* 459 */
- void (GLAPIENTRYP GetProgramivARB)(GLenum target, GLenum pname, GLint * params); /* 460 */
- void (GLAPIENTRYP GetVertexAttribdvARB)(GLuint index, GLenum pname, GLdouble * params); /* 461 */
- void (GLAPIENTRYP GetVertexAttribfvARB)(GLuint index, GLenum pname, GLfloat * params); /* 462 */
- void (GLAPIENTRYP GetVertexAttribivARB)(GLuint index, GLenum pname, GLint * params); /* 463 */
- void (GLAPIENTRYP ProgramEnvParameter4dARB)(GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); /* 464 */
- void (GLAPIENTRYP ProgramEnvParameter4dvARB)(GLenum target, GLuint index, const GLdouble * params); /* 465 */
- void (GLAPIENTRYP ProgramEnvParameter4fARB)(GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); /* 466 */
- void (GLAPIENTRYP ProgramEnvParameter4fvARB)(GLenum target, GLuint index, const GLfloat * params); /* 467 */
- void (GLAPIENTRYP ProgramLocalParameter4dARB)(GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); /* 468 */
- void (GLAPIENTRYP ProgramLocalParameter4dvARB)(GLenum target, GLuint index, const GLdouble * params); /* 469 */
- void (GLAPIENTRYP ProgramLocalParameter4fARB)(GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); /* 470 */
- void (GLAPIENTRYP ProgramLocalParameter4fvARB)(GLenum target, GLuint index, const GLfloat * params); /* 471 */
- void (GLAPIENTRYP ProgramStringARB)(GLenum target, GLenum format, GLsizei len, const GLvoid * string); /* 472 */
- void (GLAPIENTRYP VertexAttrib1dARB)(GLuint index, GLdouble x); /* 473 */
- void (GLAPIENTRYP VertexAttrib1dvARB)(GLuint index, const GLdouble * v); /* 474 */
- void (GLAPIENTRYP VertexAttrib1fARB)(GLuint index, GLfloat x); /* 475 */
- void (GLAPIENTRYP VertexAttrib1fvARB)(GLuint index, const GLfloat * v); /* 476 */
- void (GLAPIENTRYP VertexAttrib1sARB)(GLuint index, GLshort x); /* 477 */
- void (GLAPIENTRYP VertexAttrib1svARB)(GLuint index, const GLshort * v); /* 478 */
- void (GLAPIENTRYP VertexAttrib2dARB)(GLuint index, GLdouble x, GLdouble y); /* 479 */
- void (GLAPIENTRYP VertexAttrib2dvARB)(GLuint index, const GLdouble * v); /* 480 */
- void (GLAPIENTRYP VertexAttrib2fARB)(GLuint index, GLfloat x, GLfloat y); /* 481 */
- void (GLAPIENTRYP VertexAttrib2fvARB)(GLuint index, const GLfloat * v); /* 482 */
- void (GLAPIENTRYP VertexAttrib2sARB)(GLuint index, GLshort x, GLshort y); /* 483 */
- void (GLAPIENTRYP VertexAttrib2svARB)(GLuint index, const GLshort * v); /* 484 */
- void (GLAPIENTRYP VertexAttrib3dARB)(GLuint index, GLdouble x, GLdouble y, GLdouble z); /* 485 */
- void (GLAPIENTRYP VertexAttrib3dvARB)(GLuint index, const GLdouble * v); /* 486 */
- void (GLAPIENTRYP VertexAttrib3fARB)(GLuint index, GLfloat x, GLfloat y, GLfloat z); /* 487 */
- void (GLAPIENTRYP VertexAttrib3fvARB)(GLuint index, const GLfloat * v); /* 488 */
- void (GLAPIENTRYP VertexAttrib3sARB)(GLuint index, GLshort x, GLshort y, GLshort z); /* 489 */
- void (GLAPIENTRYP VertexAttrib3svARB)(GLuint index, const GLshort * v); /* 490 */
- void (GLAPIENTRYP VertexAttrib4NbvARB)(GLuint index, const GLbyte * v); /* 491 */
- void (GLAPIENTRYP VertexAttrib4NivARB)(GLuint index, const GLint * v); /* 492 */
- void (GLAPIENTRYP VertexAttrib4NsvARB)(GLuint index, const GLshort * v); /* 493 */
- void (GLAPIENTRYP VertexAttrib4NubARB)(GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); /* 494 */
- void (GLAPIENTRYP VertexAttrib4NubvARB)(GLuint index, const GLubyte * v); /* 495 */
- void (GLAPIENTRYP VertexAttrib4NuivARB)(GLuint index, const GLuint * v); /* 496 */
- void (GLAPIENTRYP VertexAttrib4NusvARB)(GLuint index, const GLushort * v); /* 497 */
- void (GLAPIENTRYP VertexAttrib4bvARB)(GLuint index, const GLbyte * v); /* 498 */
- void (GLAPIENTRYP VertexAttrib4dARB)(GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); /* 499 */
- void (GLAPIENTRYP VertexAttrib4dvARB)(GLuint index, const GLdouble * v); /* 500 */
- void (GLAPIENTRYP VertexAttrib4fARB)(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); /* 501 */
- void (GLAPIENTRYP VertexAttrib4fvARB)(GLuint index, const GLfloat * v); /* 502 */
- void (GLAPIENTRYP VertexAttrib4ivARB)(GLuint index, const GLint * v); /* 503 */
- void (GLAPIENTRYP VertexAttrib4sARB)(GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); /* 504 */
- void (GLAPIENTRYP VertexAttrib4svARB)(GLuint index, const GLshort * v); /* 505 */
- void (GLAPIENTRYP VertexAttrib4ubvARB)(GLuint index, const GLubyte * v); /* 506 */
- void (GLAPIENTRYP VertexAttrib4uivARB)(GLuint index, const GLuint * v); /* 507 */
- void (GLAPIENTRYP VertexAttrib4usvARB)(GLuint index, const GLushort * v); /* 508 */
- void (GLAPIENTRYP VertexAttribPointerARB)(GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid * pointer); /* 509 */
- void (GLAPIENTRYP BindBufferARB)(GLenum target, GLuint buffer); /* 510 */
- void (GLAPIENTRYP BufferDataARB)(GLenum target, GLsizeiptrARB size, const GLvoid * data, GLenum usage); /* 511 */
- void (GLAPIENTRYP BufferSubDataARB)(GLenum target, GLintptrARB offset, GLsizeiptrARB size, const GLvoid * data); /* 512 */
- void (GLAPIENTRYP DeleteBuffersARB)(GLsizei n, const GLuint * buffer); /* 513 */
- void (GLAPIENTRYP GenBuffersARB)(GLsizei n, GLuint * buffer); /* 514 */
- void (GLAPIENTRYP GetBufferParameterivARB)(GLenum target, GLenum pname, GLint * params); /* 515 */
- void (GLAPIENTRYP GetBufferPointervARB)(GLenum target, GLenum pname, GLvoid ** params); /* 516 */
- void (GLAPIENTRYP GetBufferSubDataARB)(GLenum target, GLintptrARB offset, GLsizeiptrARB size, GLvoid * data); /* 517 */
- GLboolean (GLAPIENTRYP IsBufferARB)(GLuint buffer); /* 518 */
- GLvoid * (GLAPIENTRYP MapBufferARB)(GLenum target, GLenum access); /* 519 */
- GLboolean (GLAPIENTRYP UnmapBufferARB)(GLenum target); /* 520 */
- void (GLAPIENTRYP BeginQueryARB)(GLenum target, GLuint id); /* 521 */
- void (GLAPIENTRYP DeleteQueriesARB)(GLsizei n, const GLuint * ids); /* 522 */
- void (GLAPIENTRYP EndQueryARB)(GLenum target); /* 523 */
- void (GLAPIENTRYP GenQueriesARB)(GLsizei n, GLuint * ids); /* 524 */
- void (GLAPIENTRYP GetQueryObjectivARB)(GLuint id, GLenum pname, GLint * params); /* 525 */
- void (GLAPIENTRYP GetQueryObjectuivARB)(GLuint id, GLenum pname, GLuint * params); /* 526 */
- void (GLAPIENTRYP GetQueryivARB)(GLenum target, GLenum pname, GLint * params); /* 527 */
- GLboolean (GLAPIENTRYP IsQueryARB)(GLuint id); /* 528 */
- void (GLAPIENTRYP AttachObjectARB)(GLhandleARB containerObj, GLhandleARB obj); /* 529 */
- void (GLAPIENTRYP CompileShaderARB)(GLhandleARB shader); /* 530 */
- GLhandleARB (GLAPIENTRYP CreateProgramObjectARB)(void); /* 531 */
- GLhandleARB (GLAPIENTRYP CreateShaderObjectARB)(GLenum shaderType); /* 532 */
- void (GLAPIENTRYP DeleteObjectARB)(GLhandleARB obj); /* 533 */
- void (GLAPIENTRYP DetachObjectARB)(GLhandleARB containerObj, GLhandleARB attachedObj); /* 534 */
- void (GLAPIENTRYP GetActiveUniformARB)(GLhandleARB program, GLuint index, GLsizei bufSize, GLsizei * length, GLint * size, GLenum * type, GLcharARB * name); /* 535 */
- void (GLAPIENTRYP GetAttachedObjectsARB)(GLhandleARB containerObj, GLsizei maxLength, GLsizei * length, GLhandleARB * infoLog); /* 536 */
- GLhandleARB (GLAPIENTRYP GetHandleARB)(GLenum pname); /* 537 */
- void (GLAPIENTRYP GetInfoLogARB)(GLhandleARB obj, GLsizei maxLength, GLsizei * length, GLcharARB * infoLog); /* 538 */
- void (GLAPIENTRYP GetObjectParameterfvARB)(GLhandleARB obj, GLenum pname, GLfloat * params); /* 539 */
- void (GLAPIENTRYP GetObjectParameterivARB)(GLhandleARB obj, GLenum pname, GLint * params); /* 540 */
- void (GLAPIENTRYP GetShaderSourceARB)(GLhandleARB shader, GLsizei bufSize, GLsizei * length, GLcharARB * source); /* 541 */
- GLint (GLAPIENTRYP GetUniformLocationARB)(GLhandleARB program, const GLcharARB * name); /* 542 */
- void (GLAPIENTRYP GetUniformfvARB)(GLhandleARB program, GLint location, GLfloat * params); /* 543 */
- void (GLAPIENTRYP GetUniformivARB)(GLhandleARB program, GLint location, GLint * params); /* 544 */
- void (GLAPIENTRYP LinkProgramARB)(GLhandleARB program); /* 545 */
- void (GLAPIENTRYP ShaderSourceARB)(GLhandleARB shader, GLsizei count, const GLcharARB ** string, const GLint * length); /* 546 */
- void (GLAPIENTRYP Uniform1fARB)(GLint location, GLfloat v0); /* 547 */
- void (GLAPIENTRYP Uniform1fvARB)(GLint location, GLsizei count, const GLfloat * value); /* 548 */
- void (GLAPIENTRYP Uniform1iARB)(GLint location, GLint v0); /* 549 */
- void (GLAPIENTRYP Uniform1ivARB)(GLint location, GLsizei count, const GLint * value); /* 550 */
- void (GLAPIENTRYP Uniform2fARB)(GLint location, GLfloat v0, GLfloat v1); /* 551 */
- void (GLAPIENTRYP Uniform2fvARB)(GLint location, GLsizei count, const GLfloat * value); /* 552 */
- void (GLAPIENTRYP Uniform2iARB)(GLint location, GLint v0, GLint v1); /* 553 */
- void (GLAPIENTRYP Uniform2ivARB)(GLint location, GLsizei count, const GLint * value); /* 554 */
- void (GLAPIENTRYP Uniform3fARB)(GLint location, GLfloat v0, GLfloat v1, GLfloat v2); /* 555 */
- void (GLAPIENTRYP Uniform3fvARB)(GLint location, GLsizei count, const GLfloat * value); /* 556 */
- void (GLAPIENTRYP Uniform3iARB)(GLint location, GLint v0, GLint v1, GLint v2); /* 557 */
- void (GLAPIENTRYP Uniform3ivARB)(GLint location, GLsizei count, const GLint * value); /* 558 */
- void (GLAPIENTRYP Uniform4fARB)(GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); /* 559 */
- void (GLAPIENTRYP Uniform4fvARB)(GLint location, GLsizei count, const GLfloat * value); /* 560 */
- void (GLAPIENTRYP Uniform4iARB)(GLint location, GLint v0, GLint v1, GLint v2, GLint v3); /* 561 */
- void (GLAPIENTRYP Uniform4ivARB)(GLint location, GLsizei count, const GLint * value); /* 562 */
- void (GLAPIENTRYP UniformMatrix2fvARB)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); /* 563 */
- void (GLAPIENTRYP UniformMatrix3fvARB)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); /* 564 */
- void (GLAPIENTRYP UniformMatrix4fvARB)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); /* 565 */
- void (GLAPIENTRYP UseProgramObjectARB)(GLhandleARB program); /* 566 */
- void (GLAPIENTRYP ValidateProgramARB)(GLhandleARB program); /* 567 */
- void (GLAPIENTRYP BindAttribLocationARB)(GLhandleARB program, GLuint index, const GLcharARB * name); /* 568 */
- void (GLAPIENTRYP GetActiveAttribARB)(GLhandleARB program, GLuint index, GLsizei bufSize, GLsizei * length, GLint * size, GLenum * type, GLcharARB * name); /* 569 */
- GLint (GLAPIENTRYP GetAttribLocationARB)(GLhandleARB program, const GLcharARB * name); /* 570 */
- void (GLAPIENTRYP DrawBuffersARB)(GLsizei n, const GLenum * bufs); /* 571 */
- void (GLAPIENTRYP ClampColorARB)(GLenum target, GLenum clamp); /* 572 */
- void (GLAPIENTRYP DrawArraysInstancedARB)(GLenum mode, GLint first, GLsizei count, GLsizei primcount); /* 573 */
- void (GLAPIENTRYP DrawElementsInstancedARB)(GLenum mode, GLsizei count, GLenum type, const GLvoid * indices, GLsizei primcount); /* 574 */
- void (GLAPIENTRYP RenderbufferStorageMultisample)(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); /* 575 */
- void (GLAPIENTRYP FramebufferTextureARB)(GLenum target, GLenum attachment, GLuint texture, GLint level); /* 576 */
- void (GLAPIENTRYP FramebufferTextureFaceARB)(GLenum target, GLenum attachment, GLuint texture, GLint level, GLenum face); /* 577 */
- void (GLAPIENTRYP ProgramParameteriARB)(GLuint program, GLenum pname, GLint value); /* 578 */
- void (GLAPIENTRYP VertexAttribDivisorARB)(GLuint index, GLuint divisor); /* 579 */
- void (GLAPIENTRYP FlushMappedBufferRange)(GLenum target, GLintptr offset, GLsizeiptr length); /* 580 */
- GLvoid * (GLAPIENTRYP MapBufferRange)(GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access); /* 581 */
- void (GLAPIENTRYP TexBufferARB)(GLenum target, GLenum internalFormat, GLuint buffer); /* 582 */
- void (GLAPIENTRYP BindVertexArray)(GLuint array); /* 583 */
- void (GLAPIENTRYP GenVertexArrays)(GLsizei n, GLuint * arrays); /* 584 */
- void (GLAPIENTRYP CopyBufferSubData)(GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size); /* 585 */
- GLenum (GLAPIENTRYP ClientWaitSync)(GLsync sync, GLbitfield flags, GLuint64 timeout); /* 586 */
- void (GLAPIENTRYP DeleteSync)(GLsync sync); /* 587 */
- GLsync (GLAPIENTRYP FenceSync)(GLenum condition, GLbitfield flags); /* 588 */
- void (GLAPIENTRYP GetInteger64v)(GLenum pname, GLint64 * params); /* 589 */
- void (GLAPIENTRYP GetSynciv)(GLsync sync, GLenum pname, GLsizei bufSize, GLsizei * length, GLint * values); /* 590 */
- GLboolean (GLAPIENTRYP IsSync)(GLsync sync); /* 591 */
- void (GLAPIENTRYP WaitSync)(GLsync sync, GLbitfield flags, GLuint64 timeout); /* 592 */
- void (GLAPIENTRYP DrawElementsBaseVertex)(GLenum mode, GLsizei count, GLenum type, const GLvoid * indices, GLint basevertex); /* 593 */
- void (GLAPIENTRYP DrawRangeElementsBaseVertex)(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid * indices, GLint basevertex); /* 594 */
- void (GLAPIENTRYP MultiDrawElementsBaseVertex)(GLenum mode, const GLsizei * count, GLenum type, const GLvoid ** indices, GLsizei primcount, const GLint * basevertex); /* 595 */
- void (GLAPIENTRYP BlendEquationSeparateiARB)(GLuint buf, GLenum modeRGB, GLenum modeA); /* 596 */
- void (GLAPIENTRYP BlendEquationiARB)(GLuint buf, GLenum mode); /* 597 */
- void (GLAPIENTRYP BlendFuncSeparateiARB)(GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcA, GLenum dstA); /* 598 */
- void (GLAPIENTRYP BlendFunciARB)(GLuint buf, GLenum src, GLenum dst); /* 599 */
- void (GLAPIENTRYP BindSampler)(GLuint unit, GLuint sampler); /* 600 */
- void (GLAPIENTRYP DeleteSamplers)(GLsizei count, const GLuint * samplers); /* 601 */
- void (GLAPIENTRYP GenSamplers)(GLsizei count, GLuint * samplers); /* 602 */
- void (GLAPIENTRYP GetSamplerParameterIiv)(GLuint sampler, GLenum pname, GLint * params); /* 603 */
- void (GLAPIENTRYP GetSamplerParameterIuiv)(GLuint sampler, GLenum pname, GLuint * params); /* 604 */
- void (GLAPIENTRYP GetSamplerParameterfv)(GLuint sampler, GLenum pname, GLfloat * params); /* 605 */
- void (GLAPIENTRYP GetSamplerParameteriv)(GLuint sampler, GLenum pname, GLint * params); /* 606 */
- GLboolean (GLAPIENTRYP IsSampler)(GLuint sampler); /* 607 */
- void (GLAPIENTRYP SamplerParameterIiv)(GLuint sampler, GLenum pname, const GLint * params); /* 608 */
- void (GLAPIENTRYP SamplerParameterIuiv)(GLuint sampler, GLenum pname, const GLuint * params); /* 609 */
- void (GLAPIENTRYP SamplerParameterf)(GLuint sampler, GLenum pname, GLfloat param); /* 610 */
- void (GLAPIENTRYP SamplerParameterfv)(GLuint sampler, GLenum pname, const GLfloat * params); /* 611 */
- void (GLAPIENTRYP SamplerParameteri)(GLuint sampler, GLenum pname, GLint param); /* 612 */
- void (GLAPIENTRYP SamplerParameteriv)(GLuint sampler, GLenum pname, const GLint * params); /* 613 */
- void (GLAPIENTRYP BindTransformFeedback)(GLenum target, GLuint id); /* 614 */
- void (GLAPIENTRYP DeleteTransformFeedbacks)(GLsizei n, const GLuint * ids); /* 615 */
- void (GLAPIENTRYP DrawTransformFeedback)(GLenum mode, GLuint id); /* 616 */
- void (GLAPIENTRYP GenTransformFeedbacks)(GLsizei n, GLuint * ids); /* 617 */
- GLboolean (GLAPIENTRYP IsTransformFeedback)(GLuint id); /* 618 */
- void (GLAPIENTRYP PauseTransformFeedback)(void); /* 619 */
- void (GLAPIENTRYP ResumeTransformFeedback)(void); /* 620 */
- void (GLAPIENTRYP ClearDepthf)(GLclampf depth); /* 621 */
- void (GLAPIENTRYP DepthRangef)(GLclampf zNear, GLclampf zFar); /* 622 */
- void (GLAPIENTRYP GetShaderPrecisionFormat)(GLenum shadertype, GLenum precisiontype, GLint * range, GLint * precision); /* 623 */
- void (GLAPIENTRYP ReleaseShaderCompiler)(void); /* 624 */
- void (GLAPIENTRYP ShaderBinary)(GLsizei n, const GLuint * shaders, GLenum binaryformat, const GLvoid * binary, GLsizei length); /* 625 */
- GLenum (GLAPIENTRYP GetGraphicsResetStatusARB)(void); /* 626 */
- void (GLAPIENTRYP GetnColorTableARB)(GLenum target, GLenum format, GLenum type, GLsizei bufSize, GLvoid * table); /* 627 */
- void (GLAPIENTRYP GetnCompressedTexImageARB)(GLenum target, GLint lod, GLsizei bufSize, GLvoid * img); /* 628 */
- void (GLAPIENTRYP GetnConvolutionFilterARB)(GLenum target, GLenum format, GLenum type, GLsizei bufSize, GLvoid * image); /* 629 */
- void (GLAPIENTRYP GetnHistogramARB)(GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, GLvoid * values); /* 630 */
- void (GLAPIENTRYP GetnMapdvARB)(GLenum target, GLenum query, GLsizei bufSize, GLdouble * v); /* 631 */
- void (GLAPIENTRYP GetnMapfvARB)(GLenum target, GLenum query, GLsizei bufSize, GLfloat * v); /* 632 */
- void (GLAPIENTRYP GetnMapivARB)(GLenum target, GLenum query, GLsizei bufSize, GLint * v); /* 633 */
- void (GLAPIENTRYP GetnMinmaxARB)(GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, GLvoid * values); /* 634 */
- void (GLAPIENTRYP GetnPixelMapfvARB)(GLenum map, GLsizei bufSize, GLfloat * values); /* 635 */
- void (GLAPIENTRYP GetnPixelMapuivARB)(GLenum map, GLsizei bufSize, GLuint * values); /* 636 */
- void (GLAPIENTRYP GetnPixelMapusvARB)(GLenum map, GLsizei bufSize, GLushort * values); /* 637 */
- void (GLAPIENTRYP GetnPolygonStippleARB)(GLsizei bufSize, GLubyte * pattern); /* 638 */
- void (GLAPIENTRYP GetnSeparableFilterARB)(GLenum target, GLenum format, GLenum type, GLsizei rowBufSize, GLvoid * row, GLsizei columnBufSize, GLvoid * column, GLvoid * span); /* 639 */
- void (GLAPIENTRYP GetnTexImageARB)(GLenum target, GLint level, GLenum format, GLenum type, GLsizei bufSize, GLvoid * img); /* 640 */
- void (GLAPIENTRYP GetnUniformdvARB)(GLhandleARB program, GLint location, GLsizei bufSize, GLdouble * params); /* 641 */
- void (GLAPIENTRYP GetnUniformfvARB)(GLhandleARB program, GLint location, GLsizei bufSize, GLfloat * params); /* 642 */
- void (GLAPIENTRYP GetnUniformivARB)(GLhandleARB program, GLint location, GLsizei bufSize, GLint * params); /* 643 */
- void (GLAPIENTRYP GetnUniformuivARB)(GLhandleARB program, GLint location, GLsizei bufSize, GLuint * params); /* 644 */
- void (GLAPIENTRYP ReadnPixelsARB)(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, GLvoid * data); /* 645 */
- void (GLAPIENTRYP PolygonOffsetEXT)(GLfloat factor, GLfloat bias); /* 646 */
- void (GLAPIENTRYP GetPixelTexGenParameterfvSGIS)(GLenum pname, GLfloat * params); /* 647 */
- void (GLAPIENTRYP GetPixelTexGenParameterivSGIS)(GLenum pname, GLint * params); /* 648 */
- void (GLAPIENTRYP PixelTexGenParameterfSGIS)(GLenum pname, GLfloat param); /* 649 */
- void (GLAPIENTRYP PixelTexGenParameterfvSGIS)(GLenum pname, const GLfloat * params); /* 650 */
- void (GLAPIENTRYP PixelTexGenParameteriSGIS)(GLenum pname, GLint param); /* 651 */
- void (GLAPIENTRYP PixelTexGenParameterivSGIS)(GLenum pname, const GLint * params); /* 652 */
- void (GLAPIENTRYP SampleMaskSGIS)(GLclampf value, GLboolean invert); /* 653 */
- void (GLAPIENTRYP SamplePatternSGIS)(GLenum pattern); /* 654 */
- void (GLAPIENTRYP ColorPointerEXT)(GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer); /* 655 */
- void (GLAPIENTRYP EdgeFlagPointerEXT)(GLsizei stride, GLsizei count, const GLboolean * pointer); /* 656 */
- void (GLAPIENTRYP IndexPointerEXT)(GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer); /* 657 */
- void (GLAPIENTRYP NormalPointerEXT)(GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer); /* 658 */
- void (GLAPIENTRYP TexCoordPointerEXT)(GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer); /* 659 */
- void (GLAPIENTRYP VertexPointerEXT)(GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer); /* 660 */
- void (GLAPIENTRYP PointParameterfEXT)(GLenum pname, GLfloat param); /* 661 */
- void (GLAPIENTRYP PointParameterfvEXT)(GLenum pname, const GLfloat * params); /* 662 */
- void (GLAPIENTRYP LockArraysEXT)(GLint first, GLsizei count); /* 663 */
- void (GLAPIENTRYP UnlockArraysEXT)(void); /* 664 */
- void (GLAPIENTRYP SecondaryColor3bEXT)(GLbyte red, GLbyte green, GLbyte blue); /* 665 */
- void (GLAPIENTRYP SecondaryColor3bvEXT)(const GLbyte * v); /* 666 */
- void (GLAPIENTRYP SecondaryColor3dEXT)(GLdouble red, GLdouble green, GLdouble blue); /* 667 */
- void (GLAPIENTRYP SecondaryColor3dvEXT)(const GLdouble * v); /* 668 */
- void (GLAPIENTRYP SecondaryColor3fEXT)(GLfloat red, GLfloat green, GLfloat blue); /* 669 */
- void (GLAPIENTRYP SecondaryColor3fvEXT)(const GLfloat * v); /* 670 */
- void (GLAPIENTRYP SecondaryColor3iEXT)(GLint red, GLint green, GLint blue); /* 671 */
- void (GLAPIENTRYP SecondaryColor3ivEXT)(const GLint * v); /* 672 */
- void (GLAPIENTRYP SecondaryColor3sEXT)(GLshort red, GLshort green, GLshort blue); /* 673 */
- void (GLAPIENTRYP SecondaryColor3svEXT)(const GLshort * v); /* 674 */
- void (GLAPIENTRYP SecondaryColor3ubEXT)(GLubyte red, GLubyte green, GLubyte blue); /* 675 */
- void (GLAPIENTRYP SecondaryColor3ubvEXT)(const GLubyte * v); /* 676 */
- void (GLAPIENTRYP SecondaryColor3uiEXT)(GLuint red, GLuint green, GLuint blue); /* 677 */
- void (GLAPIENTRYP SecondaryColor3uivEXT)(const GLuint * v); /* 678 */
- void (GLAPIENTRYP SecondaryColor3usEXT)(GLushort red, GLushort green, GLushort blue); /* 679 */
- void (GLAPIENTRYP SecondaryColor3usvEXT)(const GLushort * v); /* 680 */
- void (GLAPIENTRYP SecondaryColorPointerEXT)(GLint size, GLenum type, GLsizei stride, const GLvoid * pointer); /* 681 */
- void (GLAPIENTRYP MultiDrawArraysEXT)(GLenum mode, const GLint * first, const GLsizei * count, GLsizei primcount); /* 682 */
- void (GLAPIENTRYP MultiDrawElementsEXT)(GLenum mode, const GLsizei * count, GLenum type, const GLvoid ** indices, GLsizei primcount); /* 683 */
- void (GLAPIENTRYP FogCoordPointerEXT)(GLenum type, GLsizei stride, const GLvoid * pointer); /* 684 */
- void (GLAPIENTRYP FogCoorddEXT)(GLdouble coord); /* 685 */
- void (GLAPIENTRYP FogCoorddvEXT)(const GLdouble * coord); /* 686 */
- void (GLAPIENTRYP FogCoordfEXT)(GLfloat coord); /* 687 */
- void (GLAPIENTRYP FogCoordfvEXT)(const GLfloat * coord); /* 688 */
- void (GLAPIENTRYP PixelTexGenSGIX)(GLenum mode); /* 689 */
- void (GLAPIENTRYP BlendFuncSeparateEXT)(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); /* 690 */
- void (GLAPIENTRYP FlushVertexArrayRangeNV)(void); /* 691 */
- void (GLAPIENTRYP VertexArrayRangeNV)(GLsizei length, const GLvoid * pointer); /* 692 */
- void (GLAPIENTRYP CombinerInputNV)(GLenum stage, GLenum portion, GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage); /* 693 */
- void (GLAPIENTRYP CombinerOutputNV)(GLenum stage, GLenum portion, GLenum abOutput, GLenum cdOutput, GLenum sumOutput, GLenum scale, GLenum bias, GLboolean abDotProduct, GLboolean cdDotProduct, GLboolean muxSum); /* 694 */
- void (GLAPIENTRYP CombinerParameterfNV)(GLenum pname, GLfloat param); /* 695 */
- void (GLAPIENTRYP CombinerParameterfvNV)(GLenum pname, const GLfloat * params); /* 696 */
- void (GLAPIENTRYP CombinerParameteriNV)(GLenum pname, GLint param); /* 697 */
- void (GLAPIENTRYP CombinerParameterivNV)(GLenum pname, const GLint * params); /* 698 */
- void (GLAPIENTRYP FinalCombinerInputNV)(GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage); /* 699 */
- void (GLAPIENTRYP GetCombinerInputParameterfvNV)(GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLfloat * params); /* 700 */
- void (GLAPIENTRYP GetCombinerInputParameterivNV)(GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLint * params); /* 701 */
- void (GLAPIENTRYP GetCombinerOutputParameterfvNV)(GLenum stage, GLenum portion, GLenum pname, GLfloat * params); /* 702 */
- void (GLAPIENTRYP GetCombinerOutputParameterivNV)(GLenum stage, GLenum portion, GLenum pname, GLint * params); /* 703 */
- void (GLAPIENTRYP GetFinalCombinerInputParameterfvNV)(GLenum variable, GLenum pname, GLfloat * params); /* 704 */
- void (GLAPIENTRYP GetFinalCombinerInputParameterivNV)(GLenum variable, GLenum pname, GLint * params); /* 705 */
- void (GLAPIENTRYP ResizeBuffersMESA)(void); /* 706 */
- void (GLAPIENTRYP WindowPos2dMESA)(GLdouble x, GLdouble y); /* 707 */
- void (GLAPIENTRYP WindowPos2dvMESA)(const GLdouble * v); /* 708 */
- void (GLAPIENTRYP WindowPos2fMESA)(GLfloat x, GLfloat y); /* 709 */
- void (GLAPIENTRYP WindowPos2fvMESA)(const GLfloat * v); /* 710 */
- void (GLAPIENTRYP WindowPos2iMESA)(GLint x, GLint y); /* 711 */
- void (GLAPIENTRYP WindowPos2ivMESA)(const GLint * v); /* 712 */
- void (GLAPIENTRYP WindowPos2sMESA)(GLshort x, GLshort y); /* 713 */
- void (GLAPIENTRYP WindowPos2svMESA)(const GLshort * v); /* 714 */
- void (GLAPIENTRYP WindowPos3dMESA)(GLdouble x, GLdouble y, GLdouble z); /* 715 */
- void (GLAPIENTRYP WindowPos3dvMESA)(const GLdouble * v); /* 716 */
- void (GLAPIENTRYP WindowPos3fMESA)(GLfloat x, GLfloat y, GLfloat z); /* 717 */
- void (GLAPIENTRYP WindowPos3fvMESA)(const GLfloat * v); /* 718 */
- void (GLAPIENTRYP WindowPos3iMESA)(GLint x, GLint y, GLint z); /* 719 */
- void (GLAPIENTRYP WindowPos3ivMESA)(const GLint * v); /* 720 */
- void (GLAPIENTRYP WindowPos3sMESA)(GLshort x, GLshort y, GLshort z); /* 721 */
- void (GLAPIENTRYP WindowPos3svMESA)(const GLshort * v); /* 722 */
- void (GLAPIENTRYP WindowPos4dMESA)(GLdouble x, GLdouble y, GLdouble z, GLdouble w); /* 723 */
- void (GLAPIENTRYP WindowPos4dvMESA)(const GLdouble * v); /* 724 */
- void (GLAPIENTRYP WindowPos4fMESA)(GLfloat x, GLfloat y, GLfloat z, GLfloat w); /* 725 */
- void (GLAPIENTRYP WindowPos4fvMESA)(const GLfloat * v); /* 726 */
- void (GLAPIENTRYP WindowPos4iMESA)(GLint x, GLint y, GLint z, GLint w); /* 727 */
- void (GLAPIENTRYP WindowPos4ivMESA)(const GLint * v); /* 728 */
- void (GLAPIENTRYP WindowPos4sMESA)(GLshort x, GLshort y, GLshort z, GLshort w); /* 729 */
- void (GLAPIENTRYP WindowPos4svMESA)(const GLshort * v); /* 730 */
- void (GLAPIENTRYP MultiModeDrawArraysIBM)(const GLenum * mode, const GLint * first, const GLsizei * count, GLsizei primcount, GLint modestride); /* 731 */
- void (GLAPIENTRYP MultiModeDrawElementsIBM)(const GLenum * mode, const GLsizei * count, GLenum type, const GLvoid * const * indices, GLsizei primcount, GLint modestride); /* 732 */
- void (GLAPIENTRYP DeleteFencesNV)(GLsizei n, const GLuint * fences); /* 733 */
- void (GLAPIENTRYP FinishFenceNV)(GLuint fence); /* 734 */
- void (GLAPIENTRYP GenFencesNV)(GLsizei n, GLuint * fences); /* 735 */
- void (GLAPIENTRYP GetFenceivNV)(GLuint fence, GLenum pname, GLint * params); /* 736 */
- GLboolean (GLAPIENTRYP IsFenceNV)(GLuint fence); /* 737 */
- void (GLAPIENTRYP SetFenceNV)(GLuint fence, GLenum condition); /* 738 */
- GLboolean (GLAPIENTRYP TestFenceNV)(GLuint fence); /* 739 */
- GLboolean (GLAPIENTRYP AreProgramsResidentNV)(GLsizei n, const GLuint * ids, GLboolean * residences); /* 740 */
- void (GLAPIENTRYP BindProgramNV)(GLenum target, GLuint program); /* 741 */
- void (GLAPIENTRYP DeleteProgramsNV)(GLsizei n, const GLuint * programs); /* 742 */
- void (GLAPIENTRYP ExecuteProgramNV)(GLenum target, GLuint id, const GLfloat * params); /* 743 */
- void (GLAPIENTRYP GenProgramsNV)(GLsizei n, GLuint * programs); /* 744 */
- void (GLAPIENTRYP GetProgramParameterdvNV)(GLenum target, GLuint index, GLenum pname, GLdouble * params); /* 745 */
- void (GLAPIENTRYP GetProgramParameterfvNV)(GLenum target, GLuint index, GLenum pname, GLfloat * params); /* 746 */
- void (GLAPIENTRYP GetProgramStringNV)(GLuint id, GLenum pname, GLubyte * program); /* 747 */
- void (GLAPIENTRYP GetProgramivNV)(GLuint id, GLenum pname, GLint * params); /* 748 */
- void (GLAPIENTRYP GetTrackMatrixivNV)(GLenum target, GLuint address, GLenum pname, GLint * params); /* 749 */
- void (GLAPIENTRYP GetVertexAttribPointervNV)(GLuint index, GLenum pname, GLvoid ** pointer); /* 750 */
- void (GLAPIENTRYP GetVertexAttribdvNV)(GLuint index, GLenum pname, GLdouble * params); /* 751 */
- void (GLAPIENTRYP GetVertexAttribfvNV)(GLuint index, GLenum pname, GLfloat * params); /* 752 */
- void (GLAPIENTRYP GetVertexAttribivNV)(GLuint index, GLenum pname, GLint * params); /* 753 */
- GLboolean (GLAPIENTRYP IsProgramNV)(GLuint program); /* 754 */
- void (GLAPIENTRYP LoadProgramNV)(GLenum target, GLuint id, GLsizei len, const GLubyte * program); /* 755 */
- void (GLAPIENTRYP ProgramParameters4dvNV)(GLenum target, GLuint index, GLsizei num, const GLdouble * params); /* 756 */
- void (GLAPIENTRYP ProgramParameters4fvNV)(GLenum target, GLuint index, GLsizei num, const GLfloat * params); /* 757 */
- void (GLAPIENTRYP RequestResidentProgramsNV)(GLsizei n, const GLuint * ids); /* 758 */
- void (GLAPIENTRYP TrackMatrixNV)(GLenum target, GLuint address, GLenum matrix, GLenum transform); /* 759 */
- void (GLAPIENTRYP VertexAttrib1dNV)(GLuint index, GLdouble x); /* 760 */
- void (GLAPIENTRYP VertexAttrib1dvNV)(GLuint index, const GLdouble * v); /* 761 */
- void (GLAPIENTRYP VertexAttrib1fNV)(GLuint index, GLfloat x); /* 762 */
- void (GLAPIENTRYP VertexAttrib1fvNV)(GLuint index, const GLfloat * v); /* 763 */
- void (GLAPIENTRYP VertexAttrib1sNV)(GLuint index, GLshort x); /* 764 */
- void (GLAPIENTRYP VertexAttrib1svNV)(GLuint index, const GLshort * v); /* 765 */
- void (GLAPIENTRYP VertexAttrib2dNV)(GLuint index, GLdouble x, GLdouble y); /* 766 */
- void (GLAPIENTRYP VertexAttrib2dvNV)(GLuint index, const GLdouble * v); /* 767 */
- void (GLAPIENTRYP VertexAttrib2fNV)(GLuint index, GLfloat x, GLfloat y); /* 768 */
- void (GLAPIENTRYP VertexAttrib2fvNV)(GLuint index, const GLfloat * v); /* 769 */
- void (GLAPIENTRYP VertexAttrib2sNV)(GLuint index, GLshort x, GLshort y); /* 770 */
- void (GLAPIENTRYP VertexAttrib2svNV)(GLuint index, const GLshort * v); /* 771 */
- void (GLAPIENTRYP VertexAttrib3dNV)(GLuint index, GLdouble x, GLdouble y, GLdouble z); /* 772 */
- void (GLAPIENTRYP VertexAttrib3dvNV)(GLuint index, const GLdouble * v); /* 773 */
- void (GLAPIENTRYP VertexAttrib3fNV)(GLuint index, GLfloat x, GLfloat y, GLfloat z); /* 774 */
- void (GLAPIENTRYP VertexAttrib3fvNV)(GLuint index, const GLfloat * v); /* 775 */
- void (GLAPIENTRYP VertexAttrib3sNV)(GLuint index, GLshort x, GLshort y, GLshort z); /* 776 */
- void (GLAPIENTRYP VertexAttrib3svNV)(GLuint index, const GLshort * v); /* 777 */
- void (GLAPIENTRYP VertexAttrib4dNV)(GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); /* 778 */
- void (GLAPIENTRYP VertexAttrib4dvNV)(GLuint index, const GLdouble * v); /* 779 */
- void (GLAPIENTRYP VertexAttrib4fNV)(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); /* 780 */
- void (GLAPIENTRYP VertexAttrib4fvNV)(GLuint index, const GLfloat * v); /* 781 */
- void (GLAPIENTRYP VertexAttrib4sNV)(GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); /* 782 */
- void (GLAPIENTRYP VertexAttrib4svNV)(GLuint index, const GLshort * v); /* 783 */
- void (GLAPIENTRYP VertexAttrib4ubNV)(GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); /* 784 */
- void (GLAPIENTRYP VertexAttrib4ubvNV)(GLuint index, const GLubyte * v); /* 785 */
- void (GLAPIENTRYP VertexAttribPointerNV)(GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid * pointer); /* 786 */
- void (GLAPIENTRYP VertexAttribs1dvNV)(GLuint index, GLsizei n, const GLdouble * v); /* 787 */
- void (GLAPIENTRYP VertexAttribs1fvNV)(GLuint index, GLsizei n, const GLfloat * v); /* 788 */
- void (GLAPIENTRYP VertexAttribs1svNV)(GLuint index, GLsizei n, const GLshort * v); /* 789 */
- void (GLAPIENTRYP VertexAttribs2dvNV)(GLuint index, GLsizei n, const GLdouble * v); /* 790 */
- void (GLAPIENTRYP VertexAttribs2fvNV)(GLuint index, GLsizei n, const GLfloat * v); /* 791 */
- void (GLAPIENTRYP VertexAttribs2svNV)(GLuint index, GLsizei n, const GLshort * v); /* 792 */
- void (GLAPIENTRYP VertexAttribs3dvNV)(GLuint index, GLsizei n, const GLdouble * v); /* 793 */
- void (GLAPIENTRYP VertexAttribs3fvNV)(GLuint index, GLsizei n, const GLfloat * v); /* 794 */
- void (GLAPIENTRYP VertexAttribs3svNV)(GLuint index, GLsizei n, const GLshort * v); /* 795 */
- void (GLAPIENTRYP VertexAttribs4dvNV)(GLuint index, GLsizei n, const GLdouble * v); /* 796 */
- void (GLAPIENTRYP VertexAttribs4fvNV)(GLuint index, GLsizei n, const GLfloat * v); /* 797 */
- void (GLAPIENTRYP VertexAttribs4svNV)(GLuint index, GLsizei n, const GLshort * v); /* 798 */
- void (GLAPIENTRYP VertexAttribs4ubvNV)(GLuint index, GLsizei n, const GLubyte * v); /* 799 */
- void (GLAPIENTRYP GetTexBumpParameterfvATI)(GLenum pname, GLfloat * param); /* 800 */
- void (GLAPIENTRYP GetTexBumpParameterivATI)(GLenum pname, GLint * param); /* 801 */
- void (GLAPIENTRYP TexBumpParameterfvATI)(GLenum pname, const GLfloat * param); /* 802 */
- void (GLAPIENTRYP TexBumpParameterivATI)(GLenum pname, const GLint * param); /* 803 */
- void (GLAPIENTRYP AlphaFragmentOp1ATI)(GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod); /* 804 */
- void (GLAPIENTRYP AlphaFragmentOp2ATI)(GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod); /* 805 */
- void (GLAPIENTRYP AlphaFragmentOp3ATI)(GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod); /* 806 */
- void (GLAPIENTRYP BeginFragmentShaderATI)(void); /* 807 */
- void (GLAPIENTRYP BindFragmentShaderATI)(GLuint id); /* 808 */
- void (GLAPIENTRYP ColorFragmentOp1ATI)(GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod); /* 809 */
- void (GLAPIENTRYP ColorFragmentOp2ATI)(GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod); /* 810 */
- void (GLAPIENTRYP ColorFragmentOp3ATI)(GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod); /* 811 */
- void (GLAPIENTRYP DeleteFragmentShaderATI)(GLuint id); /* 812 */
- void (GLAPIENTRYP EndFragmentShaderATI)(void); /* 813 */
- GLuint (GLAPIENTRYP GenFragmentShadersATI)(GLuint range); /* 814 */
- void (GLAPIENTRYP PassTexCoordATI)(GLuint dst, GLuint coord, GLenum swizzle); /* 815 */
- void (GLAPIENTRYP SampleMapATI)(GLuint dst, GLuint interp, GLenum swizzle); /* 816 */
- void (GLAPIENTRYP SetFragmentShaderConstantATI)(GLuint dst, const GLfloat * value); /* 817 */
- void (GLAPIENTRYP PointParameteriNV)(GLenum pname, GLint param); /* 818 */
- void (GLAPIENTRYP PointParameterivNV)(GLenum pname, const GLint * params); /* 819 */
- void (GLAPIENTRYP ActiveStencilFaceEXT)(GLenum face); /* 820 */
- void (GLAPIENTRYP BindVertexArrayAPPLE)(GLuint array); /* 821 */
- void (GLAPIENTRYP DeleteVertexArraysAPPLE)(GLsizei n, const GLuint * arrays); /* 822 */
- void (GLAPIENTRYP GenVertexArraysAPPLE)(GLsizei n, GLuint * arrays); /* 823 */
- GLboolean (GLAPIENTRYP IsVertexArrayAPPLE)(GLuint array); /* 824 */
- void (GLAPIENTRYP GetProgramNamedParameterdvNV)(GLuint id, GLsizei len, const GLubyte * name, GLdouble * params); /* 825 */
- void (GLAPIENTRYP GetProgramNamedParameterfvNV)(GLuint id, GLsizei len, const GLubyte * name, GLfloat * params); /* 826 */
- void (GLAPIENTRYP ProgramNamedParameter4dNV)(GLuint id, GLsizei len, const GLubyte * name, GLdouble x, GLdouble y, GLdouble z, GLdouble w); /* 827 */
- void (GLAPIENTRYP ProgramNamedParameter4dvNV)(GLuint id, GLsizei len, const GLubyte * name, const GLdouble * v); /* 828 */
- void (GLAPIENTRYP ProgramNamedParameter4fNV)(GLuint id, GLsizei len, const GLubyte * name, GLfloat x, GLfloat y, GLfloat z, GLfloat w); /* 829 */
- void (GLAPIENTRYP ProgramNamedParameter4fvNV)(GLuint id, GLsizei len, const GLubyte * name, const GLfloat * v); /* 830 */
- void (GLAPIENTRYP PrimitiveRestartIndexNV)(GLuint index); /* 831 */
- void (GLAPIENTRYP PrimitiveRestartNV)(void); /* 832 */
- void (GLAPIENTRYP DepthBoundsEXT)(GLclampd zmin, GLclampd zmax); /* 833 */
- void (GLAPIENTRYP BlendEquationSeparateEXT)(GLenum modeRGB, GLenum modeA); /* 834 */
- void (GLAPIENTRYP BindFramebufferEXT)(GLenum target, GLuint framebuffer); /* 835 */
- void (GLAPIENTRYP BindRenderbufferEXT)(GLenum target, GLuint renderbuffer); /* 836 */
- GLenum (GLAPIENTRYP CheckFramebufferStatusEXT)(GLenum target); /* 837 */
- void (GLAPIENTRYP DeleteFramebuffersEXT)(GLsizei n, const GLuint * framebuffers); /* 838 */
- void (GLAPIENTRYP DeleteRenderbuffersEXT)(GLsizei n, const GLuint * renderbuffers); /* 839 */
- void (GLAPIENTRYP FramebufferRenderbufferEXT)(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); /* 840 */
- void (GLAPIENTRYP FramebufferTexture1DEXT)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); /* 841 */
- void (GLAPIENTRYP FramebufferTexture2DEXT)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); /* 842 */
- void (GLAPIENTRYP FramebufferTexture3DEXT)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); /* 843 */
- void (GLAPIENTRYP GenFramebuffersEXT)(GLsizei n, GLuint * framebuffers); /* 844 */
- void (GLAPIENTRYP GenRenderbuffersEXT)(GLsizei n, GLuint * renderbuffers); /* 845 */
- void (GLAPIENTRYP GenerateMipmapEXT)(GLenum target); /* 846 */
- void (GLAPIENTRYP GetFramebufferAttachmentParameterivEXT)(GLenum target, GLenum attachment, GLenum pname, GLint * params); /* 847 */
- void (GLAPIENTRYP GetRenderbufferParameterivEXT)(GLenum target, GLenum pname, GLint * params); /* 848 */
- GLboolean (GLAPIENTRYP IsFramebufferEXT)(GLuint framebuffer); /* 849 */
- GLboolean (GLAPIENTRYP IsRenderbufferEXT)(GLuint renderbuffer); /* 850 */
- void (GLAPIENTRYP RenderbufferStorageEXT)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height); /* 851 */
- void (GLAPIENTRYP BlitFramebufferEXT)(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); /* 852 */
- void (GLAPIENTRYP BufferParameteriAPPLE)(GLenum target, GLenum pname, GLint param); /* 853 */
- void (GLAPIENTRYP FlushMappedBufferRangeAPPLE)(GLenum target, GLintptr offset, GLsizeiptr size); /* 854 */
- void (GLAPIENTRYP BindFragDataLocationEXT)(GLuint program, GLuint colorNumber, const GLchar * name); /* 855 */
- GLint (GLAPIENTRYP GetFragDataLocationEXT)(GLuint program, const GLchar * name); /* 856 */
- void (GLAPIENTRYP GetUniformuivEXT)(GLuint program, GLint location, GLuint * params); /* 857 */
- void (GLAPIENTRYP GetVertexAttribIivEXT)(GLuint index, GLenum pname, GLint * params); /* 858 */
- void (GLAPIENTRYP GetVertexAttribIuivEXT)(GLuint index, GLenum pname, GLuint * params); /* 859 */
- void (GLAPIENTRYP Uniform1uiEXT)(GLint location, GLuint x); /* 860 */
- void (GLAPIENTRYP Uniform1uivEXT)(GLint location, GLsizei count, const GLuint * value); /* 861 */
- void (GLAPIENTRYP Uniform2uiEXT)(GLint location, GLuint x, GLuint y); /* 862 */
- void (GLAPIENTRYP Uniform2uivEXT)(GLint location, GLsizei count, const GLuint * value); /* 863 */
- void (GLAPIENTRYP Uniform3uiEXT)(GLint location, GLuint x, GLuint y, GLuint z); /* 864 */
- void (GLAPIENTRYP Uniform3uivEXT)(GLint location, GLsizei count, const GLuint * value); /* 865 */
- void (GLAPIENTRYP Uniform4uiEXT)(GLint location, GLuint x, GLuint y, GLuint z, GLuint w); /* 866 */
- void (GLAPIENTRYP Uniform4uivEXT)(GLint location, GLsizei count, const GLuint * value); /* 867 */
- void (GLAPIENTRYP VertexAttribI1iEXT)(GLuint index, GLint x); /* 868 */
- void (GLAPIENTRYP VertexAttribI1ivEXT)(GLuint index, const GLint * v); /* 869 */
- void (GLAPIENTRYP VertexAttribI1uiEXT)(GLuint index, GLuint x); /* 870 */
- void (GLAPIENTRYP VertexAttribI1uivEXT)(GLuint index, const GLuint * v); /* 871 */
- void (GLAPIENTRYP VertexAttribI2iEXT)(GLuint index, GLint x, GLint y); /* 872 */
- void (GLAPIENTRYP VertexAttribI2ivEXT)(GLuint index, const GLint * v); /* 873 */
- void (GLAPIENTRYP VertexAttribI2uiEXT)(GLuint index, GLuint x, GLuint y); /* 874 */
- void (GLAPIENTRYP VertexAttribI2uivEXT)(GLuint index, const GLuint * v); /* 875 */
- void (GLAPIENTRYP VertexAttribI3iEXT)(GLuint index, GLint x, GLint y, GLint z); /* 876 */
- void (GLAPIENTRYP VertexAttribI3ivEXT)(GLuint index, const GLint * v); /* 877 */
- void (GLAPIENTRYP VertexAttribI3uiEXT)(GLuint index, GLuint x, GLuint y, GLuint z); /* 878 */
- void (GLAPIENTRYP VertexAttribI3uivEXT)(GLuint index, const GLuint * v); /* 879 */
- void (GLAPIENTRYP VertexAttribI4bvEXT)(GLuint index, const GLbyte * v); /* 880 */
- void (GLAPIENTRYP VertexAttribI4iEXT)(GLuint index, GLint x, GLint y, GLint z, GLint w); /* 881 */
- void (GLAPIENTRYP VertexAttribI4ivEXT)(GLuint index, const GLint * v); /* 882 */
- void (GLAPIENTRYP VertexAttribI4svEXT)(GLuint index, const GLshort * v); /* 883 */
- void (GLAPIENTRYP VertexAttribI4ubvEXT)(GLuint index, const GLubyte * v); /* 884 */
- void (GLAPIENTRYP VertexAttribI4uiEXT)(GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); /* 885 */
- void (GLAPIENTRYP VertexAttribI4uivEXT)(GLuint index, const GLuint * v); /* 886 */
- void (GLAPIENTRYP VertexAttribI4usvEXT)(GLuint index, const GLushort * v); /* 887 */
- void (GLAPIENTRYP VertexAttribIPointerEXT)(GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid * pointer); /* 888 */
- void (GLAPIENTRYP FramebufferTextureLayerEXT)(GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer); /* 889 */
- void (GLAPIENTRYP ColorMaskIndexedEXT)(GLuint buf, GLboolean r, GLboolean g, GLboolean b, GLboolean a); /* 890 */
- void (GLAPIENTRYP DisableIndexedEXT)(GLenum target, GLuint index); /* 891 */
- void (GLAPIENTRYP EnableIndexedEXT)(GLenum target, GLuint index); /* 892 */
- void (GLAPIENTRYP GetBooleanIndexedvEXT)(GLenum value, GLuint index, GLboolean * data); /* 893 */
- void (GLAPIENTRYP GetIntegerIndexedvEXT)(GLenum value, GLuint index, GLint * data); /* 894 */
- GLboolean (GLAPIENTRYP IsEnabledIndexedEXT)(GLenum target, GLuint index); /* 895 */
- void (GLAPIENTRYP ClearColorIiEXT)(GLint r, GLint g, GLint b, GLint a); /* 896 */
- void (GLAPIENTRYP ClearColorIuiEXT)(GLuint r, GLuint g, GLuint b, GLuint a); /* 897 */
- void (GLAPIENTRYP GetTexParameterIivEXT)(GLenum target, GLenum pname, GLint * params); /* 898 */
- void (GLAPIENTRYP GetTexParameterIuivEXT)(GLenum target, GLenum pname, GLuint * params); /* 899 */
- void (GLAPIENTRYP TexParameterIivEXT)(GLenum target, GLenum pname, const GLint * params); /* 900 */
- void (GLAPIENTRYP TexParameterIuivEXT)(GLenum target, GLenum pname, const GLuint * params); /* 901 */
- void (GLAPIENTRYP BeginConditionalRenderNV)(GLuint query, GLenum mode); /* 902 */
- void (GLAPIENTRYP EndConditionalRenderNV)(void); /* 903 */
- void (GLAPIENTRYP BeginTransformFeedbackEXT)(GLenum mode); /* 904 */
- void (GLAPIENTRYP BindBufferBaseEXT)(GLenum target, GLuint index, GLuint buffer); /* 905 */
- void (GLAPIENTRYP BindBufferOffsetEXT)(GLenum target, GLuint index, GLuint buffer, GLintptr offset); /* 906 */
- void (GLAPIENTRYP BindBufferRangeEXT)(GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); /* 907 */
- void (GLAPIENTRYP EndTransformFeedbackEXT)(void); /* 908 */
- void (GLAPIENTRYP GetTransformFeedbackVaryingEXT)(GLuint program, GLuint index, GLsizei bufSize, GLsizei * length, GLsizei * size, GLenum * type, GLchar * name); /* 909 */
- void (GLAPIENTRYP TransformFeedbackVaryingsEXT)(GLuint program, GLsizei count, const char ** varyings, GLenum bufferMode); /* 910 */
- void (GLAPIENTRYP ProvokingVertexEXT)(GLenum mode); /* 911 */
- void (GLAPIENTRYP GetTexParameterPointervAPPLE)(GLenum target, GLenum pname, GLvoid ** params); /* 912 */
- void (GLAPIENTRYP TextureRangeAPPLE)(GLenum target, GLsizei length, GLvoid * pointer); /* 913 */
- void (GLAPIENTRYP GetObjectParameterivAPPLE)(GLenum objectType, GLuint name, GLenum pname, GLint * value); /* 914 */
- GLenum (GLAPIENTRYP ObjectPurgeableAPPLE)(GLenum objectType, GLuint name, GLenum option); /* 915 */
- GLenum (GLAPIENTRYP ObjectUnpurgeableAPPLE)(GLenum objectType, GLuint name, GLenum option); /* 916 */
- void (GLAPIENTRYP ActiveProgramEXT)(GLuint program); /* 917 */
- GLuint (GLAPIENTRYP CreateShaderProgramEXT)(GLenum type, const GLchar * string); /* 918 */
- void (GLAPIENTRYP UseShaderProgramEXT)(GLenum type, GLuint program); /* 919 */
- void (GLAPIENTRYP TextureBarrierNV)(void); /* 920 */
- void (GLAPIENTRYP StencilFuncSeparateATI)(GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask); /* 921 */
- void (GLAPIENTRYP ProgramEnvParameters4fvEXT)(GLenum target, GLuint index, GLsizei count, const GLfloat * params); /* 922 */
- void (GLAPIENTRYP ProgramLocalParameters4fvEXT)(GLenum target, GLuint index, GLsizei count, const GLfloat * params); /* 923 */
- void (GLAPIENTRYP GetQueryObjecti64vEXT)(GLuint id, GLenum pname, GLint64EXT * params); /* 924 */
- void (GLAPIENTRYP GetQueryObjectui64vEXT)(GLuint id, GLenum pname, GLuint64EXT * params); /* 925 */
- void (GLAPIENTRYP EGLImageTargetRenderbufferStorageOES)(GLenum target, GLvoid * writeOffset); /* 926 */
- void (GLAPIENTRYP EGLImageTargetTexture2DOES)(GLenum target, GLvoid * writeOffset); /* 927 */
-};
-
-#endif /* !defined( _GLAPI_TABLE_H_ ) */
+/* DO NOT EDIT - This file generated automatically by gl_table.py (from Mesa) script */
+
+/*
+ * Copyright (C) 1999-2003 Brian Paul All Rights Reserved.
+ * (C) Copyright IBM Corporation 2004
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sub license,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL, IBM,
+ * AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
+ * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+#if !defined( _GLAPI_TABLE_H_ )
+# define _GLAPI_TABLE_H_
+
+#ifndef GLAPIENTRYP
+# ifndef GLAPIENTRY
+# define GLAPIENTRY
+# endif
+
+# define GLAPIENTRYP GLAPIENTRY *
+#endif
+
+
+struct _glapi_table
+{
+ void (GLAPIENTRYP NewList)(GLuint list, GLenum mode); /* 0 */
+ void (GLAPIENTRYP EndList)(void); /* 1 */
+ void (GLAPIENTRYP CallList)(GLuint list); /* 2 */
+ void (GLAPIENTRYP CallLists)(GLsizei n, GLenum type, const GLvoid * lists); /* 3 */
+ void (GLAPIENTRYP DeleteLists)(GLuint list, GLsizei range); /* 4 */
+ GLuint (GLAPIENTRYP GenLists)(GLsizei range); /* 5 */
+ void (GLAPIENTRYP ListBase)(GLuint base); /* 6 */
+ void (GLAPIENTRYP Begin)(GLenum mode); /* 7 */
+ void (GLAPIENTRYP Bitmap)(GLsizei width, GLsizei height, GLfloat xorig, GLfloat yorig, GLfloat xmove, GLfloat ymove, const GLubyte * bitmap); /* 8 */
+ void (GLAPIENTRYP Color3b)(GLbyte red, GLbyte green, GLbyte blue); /* 9 */
+ void (GLAPIENTRYP Color3bv)(const GLbyte * v); /* 10 */
+ void (GLAPIENTRYP Color3d)(GLdouble red, GLdouble green, GLdouble blue); /* 11 */
+ void (GLAPIENTRYP Color3dv)(const GLdouble * v); /* 12 */
+ void (GLAPIENTRYP Color3f)(GLfloat red, GLfloat green, GLfloat blue); /* 13 */
+ void (GLAPIENTRYP Color3fv)(const GLfloat * v); /* 14 */
+ void (GLAPIENTRYP Color3i)(GLint red, GLint green, GLint blue); /* 15 */
+ void (GLAPIENTRYP Color3iv)(const GLint * v); /* 16 */
+ void (GLAPIENTRYP Color3s)(GLshort red, GLshort green, GLshort blue); /* 17 */
+ void (GLAPIENTRYP Color3sv)(const GLshort * v); /* 18 */
+ void (GLAPIENTRYP Color3ub)(GLubyte red, GLubyte green, GLubyte blue); /* 19 */
+ void (GLAPIENTRYP Color3ubv)(const GLubyte * v); /* 20 */
+ void (GLAPIENTRYP Color3ui)(GLuint red, GLuint green, GLuint blue); /* 21 */
+ void (GLAPIENTRYP Color3uiv)(const GLuint * v); /* 22 */
+ void (GLAPIENTRYP Color3us)(GLushort red, GLushort green, GLushort blue); /* 23 */
+ void (GLAPIENTRYP Color3usv)(const GLushort * v); /* 24 */
+ void (GLAPIENTRYP Color4b)(GLbyte red, GLbyte green, GLbyte blue, GLbyte alpha); /* 25 */
+ void (GLAPIENTRYP Color4bv)(const GLbyte * v); /* 26 */
+ void (GLAPIENTRYP Color4d)(GLdouble red, GLdouble green, GLdouble blue, GLdouble alpha); /* 27 */
+ void (GLAPIENTRYP Color4dv)(const GLdouble * v); /* 28 */
+ void (GLAPIENTRYP Color4f)(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); /* 29 */
+ void (GLAPIENTRYP Color4fv)(const GLfloat * v); /* 30 */
+ void (GLAPIENTRYP Color4i)(GLint red, GLint green, GLint blue, GLint alpha); /* 31 */
+ void (GLAPIENTRYP Color4iv)(const GLint * v); /* 32 */
+ void (GLAPIENTRYP Color4s)(GLshort red, GLshort green, GLshort blue, GLshort alpha); /* 33 */
+ void (GLAPIENTRYP Color4sv)(const GLshort * v); /* 34 */
+ void (GLAPIENTRYP Color4ub)(GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha); /* 35 */
+ void (GLAPIENTRYP Color4ubv)(const GLubyte * v); /* 36 */
+ void (GLAPIENTRYP Color4ui)(GLuint red, GLuint green, GLuint blue, GLuint alpha); /* 37 */
+ void (GLAPIENTRYP Color4uiv)(const GLuint * v); /* 38 */
+ void (GLAPIENTRYP Color4us)(GLushort red, GLushort green, GLushort blue, GLushort alpha); /* 39 */
+ void (GLAPIENTRYP Color4usv)(const GLushort * v); /* 40 */
+ void (GLAPIENTRYP EdgeFlag)(GLboolean flag); /* 41 */
+ void (GLAPIENTRYP EdgeFlagv)(const GLboolean * flag); /* 42 */
+ void (GLAPIENTRYP End)(void); /* 43 */
+ void (GLAPIENTRYP Indexd)(GLdouble c); /* 44 */
+ void (GLAPIENTRYP Indexdv)(const GLdouble * c); /* 45 */
+ void (GLAPIENTRYP Indexf)(GLfloat c); /* 46 */
+ void (GLAPIENTRYP Indexfv)(const GLfloat * c); /* 47 */
+ void (GLAPIENTRYP Indexi)(GLint c); /* 48 */
+ void (GLAPIENTRYP Indexiv)(const GLint * c); /* 49 */
+ void (GLAPIENTRYP Indexs)(GLshort c); /* 50 */
+ void (GLAPIENTRYP Indexsv)(const GLshort * c); /* 51 */
+ void (GLAPIENTRYP Normal3b)(GLbyte nx, GLbyte ny, GLbyte nz); /* 52 */
+ void (GLAPIENTRYP Normal3bv)(const GLbyte * v); /* 53 */
+ void (GLAPIENTRYP Normal3d)(GLdouble nx, GLdouble ny, GLdouble nz); /* 54 */
+ void (GLAPIENTRYP Normal3dv)(const GLdouble * v); /* 55 */
+ void (GLAPIENTRYP Normal3f)(GLfloat nx, GLfloat ny, GLfloat nz); /* 56 */
+ void (GLAPIENTRYP Normal3fv)(const GLfloat * v); /* 57 */
+ void (GLAPIENTRYP Normal3i)(GLint nx, GLint ny, GLint nz); /* 58 */
+ void (GLAPIENTRYP Normal3iv)(const GLint * v); /* 59 */
+ void (GLAPIENTRYP Normal3s)(GLshort nx, GLshort ny, GLshort nz); /* 60 */
+ void (GLAPIENTRYP Normal3sv)(const GLshort * v); /* 61 */
+ void (GLAPIENTRYP RasterPos2d)(GLdouble x, GLdouble y); /* 62 */
+ void (GLAPIENTRYP RasterPos2dv)(const GLdouble * v); /* 63 */
+ void (GLAPIENTRYP RasterPos2f)(GLfloat x, GLfloat y); /* 64 */
+ void (GLAPIENTRYP RasterPos2fv)(const GLfloat * v); /* 65 */
+ void (GLAPIENTRYP RasterPos2i)(GLint x, GLint y); /* 66 */
+ void (GLAPIENTRYP RasterPos2iv)(const GLint * v); /* 67 */
+ void (GLAPIENTRYP RasterPos2s)(GLshort x, GLshort y); /* 68 */
+ void (GLAPIENTRYP RasterPos2sv)(const GLshort * v); /* 69 */
+ void (GLAPIENTRYP RasterPos3d)(GLdouble x, GLdouble y, GLdouble z); /* 70 */
+ void (GLAPIENTRYP RasterPos3dv)(const GLdouble * v); /* 71 */
+ void (GLAPIENTRYP RasterPos3f)(GLfloat x, GLfloat y, GLfloat z); /* 72 */
+ void (GLAPIENTRYP RasterPos3fv)(const GLfloat * v); /* 73 */
+ void (GLAPIENTRYP RasterPos3i)(GLint x, GLint y, GLint z); /* 74 */
+ void (GLAPIENTRYP RasterPos3iv)(const GLint * v); /* 75 */
+ void (GLAPIENTRYP RasterPos3s)(GLshort x, GLshort y, GLshort z); /* 76 */
+ void (GLAPIENTRYP RasterPos3sv)(const GLshort * v); /* 77 */
+ void (GLAPIENTRYP RasterPos4d)(GLdouble x, GLdouble y, GLdouble z, GLdouble w); /* 78 */
+ void (GLAPIENTRYP RasterPos4dv)(const GLdouble * v); /* 79 */
+ void (GLAPIENTRYP RasterPos4f)(GLfloat x, GLfloat y, GLfloat z, GLfloat w); /* 80 */
+ void (GLAPIENTRYP RasterPos4fv)(const GLfloat * v); /* 81 */
+ void (GLAPIENTRYP RasterPos4i)(GLint x, GLint y, GLint z, GLint w); /* 82 */
+ void (GLAPIENTRYP RasterPos4iv)(const GLint * v); /* 83 */
+ void (GLAPIENTRYP RasterPos4s)(GLshort x, GLshort y, GLshort z, GLshort w); /* 84 */
+ void (GLAPIENTRYP RasterPos4sv)(const GLshort * v); /* 85 */
+ void (GLAPIENTRYP Rectd)(GLdouble x1, GLdouble y1, GLdouble x2, GLdouble y2); /* 86 */
+ void (GLAPIENTRYP Rectdv)(const GLdouble * v1, const GLdouble * v2); /* 87 */
+ void (GLAPIENTRYP Rectf)(GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2); /* 88 */
+ void (GLAPIENTRYP Rectfv)(const GLfloat * v1, const GLfloat * v2); /* 89 */
+ void (GLAPIENTRYP Recti)(GLint x1, GLint y1, GLint x2, GLint y2); /* 90 */
+ void (GLAPIENTRYP Rectiv)(const GLint * v1, const GLint * v2); /* 91 */
+ void (GLAPIENTRYP Rects)(GLshort x1, GLshort y1, GLshort x2, GLshort y2); /* 92 */
+ void (GLAPIENTRYP Rectsv)(const GLshort * v1, const GLshort * v2); /* 93 */
+ void (GLAPIENTRYP TexCoord1d)(GLdouble s); /* 94 */
+ void (GLAPIENTRYP TexCoord1dv)(const GLdouble * v); /* 95 */
+ void (GLAPIENTRYP TexCoord1f)(GLfloat s); /* 96 */
+ void (GLAPIENTRYP TexCoord1fv)(const GLfloat * v); /* 97 */
+ void (GLAPIENTRYP TexCoord1i)(GLint s); /* 98 */
+ void (GLAPIENTRYP TexCoord1iv)(const GLint * v); /* 99 */
+ void (GLAPIENTRYP TexCoord1s)(GLshort s); /* 100 */
+ void (GLAPIENTRYP TexCoord1sv)(const GLshort * v); /* 101 */
+ void (GLAPIENTRYP TexCoord2d)(GLdouble s, GLdouble t); /* 102 */
+ void (GLAPIENTRYP TexCoord2dv)(const GLdouble * v); /* 103 */
+ void (GLAPIENTRYP TexCoord2f)(GLfloat s, GLfloat t); /* 104 */
+ void (GLAPIENTRYP TexCoord2fv)(const GLfloat * v); /* 105 */
+ void (GLAPIENTRYP TexCoord2i)(GLint s, GLint t); /* 106 */
+ void (GLAPIENTRYP TexCoord2iv)(const GLint * v); /* 107 */
+ void (GLAPIENTRYP TexCoord2s)(GLshort s, GLshort t); /* 108 */
+ void (GLAPIENTRYP TexCoord2sv)(const GLshort * v); /* 109 */
+ void (GLAPIENTRYP TexCoord3d)(GLdouble s, GLdouble t, GLdouble r); /* 110 */
+ void (GLAPIENTRYP TexCoord3dv)(const GLdouble * v); /* 111 */
+ void (GLAPIENTRYP TexCoord3f)(GLfloat s, GLfloat t, GLfloat r); /* 112 */
+ void (GLAPIENTRYP TexCoord3fv)(const GLfloat * v); /* 113 */
+ void (GLAPIENTRYP TexCoord3i)(GLint s, GLint t, GLint r); /* 114 */
+ void (GLAPIENTRYP TexCoord3iv)(const GLint * v); /* 115 */
+ void (GLAPIENTRYP TexCoord3s)(GLshort s, GLshort t, GLshort r); /* 116 */
+ void (GLAPIENTRYP TexCoord3sv)(const GLshort * v); /* 117 */
+ void (GLAPIENTRYP TexCoord4d)(GLdouble s, GLdouble t, GLdouble r, GLdouble q); /* 118 */
+ void (GLAPIENTRYP TexCoord4dv)(const GLdouble * v); /* 119 */
+ void (GLAPIENTRYP TexCoord4f)(GLfloat s, GLfloat t, GLfloat r, GLfloat q); /* 120 */
+ void (GLAPIENTRYP TexCoord4fv)(const GLfloat * v); /* 121 */
+ void (GLAPIENTRYP TexCoord4i)(GLint s, GLint t, GLint r, GLint q); /* 122 */
+ void (GLAPIENTRYP TexCoord4iv)(const GLint * v); /* 123 */
+ void (GLAPIENTRYP TexCoord4s)(GLshort s, GLshort t, GLshort r, GLshort q); /* 124 */
+ void (GLAPIENTRYP TexCoord4sv)(const GLshort * v); /* 125 */
+ void (GLAPIENTRYP Vertex2d)(GLdouble x, GLdouble y); /* 126 */
+ void (GLAPIENTRYP Vertex2dv)(const GLdouble * v); /* 127 */
+ void (GLAPIENTRYP Vertex2f)(GLfloat x, GLfloat y); /* 128 */
+ void (GLAPIENTRYP Vertex2fv)(const GLfloat * v); /* 129 */
+ void (GLAPIENTRYP Vertex2i)(GLint x, GLint y); /* 130 */
+ void (GLAPIENTRYP Vertex2iv)(const GLint * v); /* 131 */
+ void (GLAPIENTRYP Vertex2s)(GLshort x, GLshort y); /* 132 */
+ void (GLAPIENTRYP Vertex2sv)(const GLshort * v); /* 133 */
+ void (GLAPIENTRYP Vertex3d)(GLdouble x, GLdouble y, GLdouble z); /* 134 */
+ void (GLAPIENTRYP Vertex3dv)(const GLdouble * v); /* 135 */
+ void (GLAPIENTRYP Vertex3f)(GLfloat x, GLfloat y, GLfloat z); /* 136 */
+ void (GLAPIENTRYP Vertex3fv)(const GLfloat * v); /* 137 */
+ void (GLAPIENTRYP Vertex3i)(GLint x, GLint y, GLint z); /* 138 */
+ void (GLAPIENTRYP Vertex3iv)(const GLint * v); /* 139 */
+ void (GLAPIENTRYP Vertex3s)(GLshort x, GLshort y, GLshort z); /* 140 */
+ void (GLAPIENTRYP Vertex3sv)(const GLshort * v); /* 141 */
+ void (GLAPIENTRYP Vertex4d)(GLdouble x, GLdouble y, GLdouble z, GLdouble w); /* 142 */
+ void (GLAPIENTRYP Vertex4dv)(const GLdouble * v); /* 143 */
+ void (GLAPIENTRYP Vertex4f)(GLfloat x, GLfloat y, GLfloat z, GLfloat w); /* 144 */
+ void (GLAPIENTRYP Vertex4fv)(const GLfloat * v); /* 145 */
+ void (GLAPIENTRYP Vertex4i)(GLint x, GLint y, GLint z, GLint w); /* 146 */
+ void (GLAPIENTRYP Vertex4iv)(const GLint * v); /* 147 */
+ void (GLAPIENTRYP Vertex4s)(GLshort x, GLshort y, GLshort z, GLshort w); /* 148 */
+ void (GLAPIENTRYP Vertex4sv)(const GLshort * v); /* 149 */
+ void (GLAPIENTRYP ClipPlane)(GLenum plane, const GLdouble * equation); /* 150 */
+ void (GLAPIENTRYP ColorMaterial)(GLenum face, GLenum mode); /* 151 */
+ void (GLAPIENTRYP CullFace)(GLenum mode); /* 152 */
+ void (GLAPIENTRYP Fogf)(GLenum pname, GLfloat param); /* 153 */
+ void (GLAPIENTRYP Fogfv)(GLenum pname, const GLfloat * params); /* 154 */
+ void (GLAPIENTRYP Fogi)(GLenum pname, GLint param); /* 155 */
+ void (GLAPIENTRYP Fogiv)(GLenum pname, const GLint * params); /* 156 */
+ void (GLAPIENTRYP FrontFace)(GLenum mode); /* 157 */
+ void (GLAPIENTRYP Hint)(GLenum target, GLenum mode); /* 158 */
+ void (GLAPIENTRYP Lightf)(GLenum light, GLenum pname, GLfloat param); /* 159 */
+ void (GLAPIENTRYP Lightfv)(GLenum light, GLenum pname, const GLfloat * params); /* 160 */
+ void (GLAPIENTRYP Lighti)(GLenum light, GLenum pname, GLint param); /* 161 */
+ void (GLAPIENTRYP Lightiv)(GLenum light, GLenum pname, const GLint * params); /* 162 */
+ void (GLAPIENTRYP LightModelf)(GLenum pname, GLfloat param); /* 163 */
+ void (GLAPIENTRYP LightModelfv)(GLenum pname, const GLfloat * params); /* 164 */
+ void (GLAPIENTRYP LightModeli)(GLenum pname, GLint param); /* 165 */
+ void (GLAPIENTRYP LightModeliv)(GLenum pname, const GLint * params); /* 166 */
+ void (GLAPIENTRYP LineStipple)(GLint factor, GLushort pattern); /* 167 */
+ void (GLAPIENTRYP LineWidth)(GLfloat width); /* 168 */
+ void (GLAPIENTRYP Materialf)(GLenum face, GLenum pname, GLfloat param); /* 169 */
+ void (GLAPIENTRYP Materialfv)(GLenum face, GLenum pname, const GLfloat * params); /* 170 */
+ void (GLAPIENTRYP Materiali)(GLenum face, GLenum pname, GLint param); /* 171 */
+ void (GLAPIENTRYP Materialiv)(GLenum face, GLenum pname, const GLint * params); /* 172 */
+ void (GLAPIENTRYP PointSize)(GLfloat size); /* 173 */
+ void (GLAPIENTRYP PolygonMode)(GLenum face, GLenum mode); /* 174 */
+ void (GLAPIENTRYP PolygonStipple)(const GLubyte * mask); /* 175 */
+ void (GLAPIENTRYP Scissor)(GLint x, GLint y, GLsizei width, GLsizei height); /* 176 */
+ void (GLAPIENTRYP ShadeModel)(GLenum mode); /* 177 */
+ void (GLAPIENTRYP TexParameterf)(GLenum target, GLenum pname, GLfloat param); /* 178 */
+ void (GLAPIENTRYP TexParameterfv)(GLenum target, GLenum pname, const GLfloat * params); /* 179 */
+ void (GLAPIENTRYP TexParameteri)(GLenum target, GLenum pname, GLint param); /* 180 */
+ void (GLAPIENTRYP TexParameteriv)(GLenum target, GLenum pname, const GLint * params); /* 181 */
+ void (GLAPIENTRYP TexImage1D)(GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid * pixels); /* 182 */
+ void (GLAPIENTRYP TexImage2D)(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid * pixels); /* 183 */
+ void (GLAPIENTRYP TexEnvf)(GLenum target, GLenum pname, GLfloat param); /* 184 */
+ void (GLAPIENTRYP TexEnvfv)(GLenum target, GLenum pname, const GLfloat * params); /* 185 */
+ void (GLAPIENTRYP TexEnvi)(GLenum target, GLenum pname, GLint param); /* 186 */
+ void (GLAPIENTRYP TexEnviv)(GLenum target, GLenum pname, const GLint * params); /* 187 */
+ void (GLAPIENTRYP TexGend)(GLenum coord, GLenum pname, GLdouble param); /* 188 */
+ void (GLAPIENTRYP TexGendv)(GLenum coord, GLenum pname, const GLdouble * params); /* 189 */
+ void (GLAPIENTRYP TexGenf)(GLenum coord, GLenum pname, GLfloat param); /* 190 */
+ void (GLAPIENTRYP TexGenfv)(GLenum coord, GLenum pname, const GLfloat * params); /* 191 */
+ void (GLAPIENTRYP TexGeni)(GLenum coord, GLenum pname, GLint param); /* 192 */
+ void (GLAPIENTRYP TexGeniv)(GLenum coord, GLenum pname, const GLint * params); /* 193 */
+ void (GLAPIENTRYP FeedbackBuffer)(GLsizei size, GLenum type, GLfloat * buffer); /* 194 */
+ void (GLAPIENTRYP SelectBuffer)(GLsizei size, GLuint * buffer); /* 195 */
+ GLint (GLAPIENTRYP RenderMode)(GLenum mode); /* 196 */
+ void (GLAPIENTRYP InitNames)(void); /* 197 */
+ void (GLAPIENTRYP LoadName)(GLuint name); /* 198 */
+ void (GLAPIENTRYP PassThrough)(GLfloat token); /* 199 */
+ void (GLAPIENTRYP PopName)(void); /* 200 */
+ void (GLAPIENTRYP PushName)(GLuint name); /* 201 */
+ void (GLAPIENTRYP DrawBuffer)(GLenum mode); /* 202 */
+ void (GLAPIENTRYP Clear)(GLbitfield mask); /* 203 */
+ void (GLAPIENTRYP ClearAccum)(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); /* 204 */
+ void (GLAPIENTRYP ClearIndex)(GLfloat c); /* 205 */
+ void (GLAPIENTRYP ClearColor)(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); /* 206 */
+ void (GLAPIENTRYP ClearStencil)(GLint s); /* 207 */
+ void (GLAPIENTRYP ClearDepth)(GLclampd depth); /* 208 */
+ void (GLAPIENTRYP StencilMask)(GLuint mask); /* 209 */
+ void (GLAPIENTRYP ColorMask)(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha); /* 210 */
+ void (GLAPIENTRYP DepthMask)(GLboolean flag); /* 211 */
+ void (GLAPIENTRYP IndexMask)(GLuint mask); /* 212 */
+ void (GLAPIENTRYP Accum)(GLenum op, GLfloat value); /* 213 */
+ void (GLAPIENTRYP Disable)(GLenum cap); /* 214 */
+ void (GLAPIENTRYP Enable)(GLenum cap); /* 215 */
+ void (GLAPIENTRYP Finish)(void); /* 216 */
+ void (GLAPIENTRYP Flush)(void); /* 217 */
+ void (GLAPIENTRYP PopAttrib)(void); /* 218 */
+ void (GLAPIENTRYP PushAttrib)(GLbitfield mask); /* 219 */
+ void (GLAPIENTRYP Map1d)(GLenum target, GLdouble u1, GLdouble u2, GLint stride, GLint order, const GLdouble * points); /* 220 */
+ void (GLAPIENTRYP Map1f)(GLenum target, GLfloat u1, GLfloat u2, GLint stride, GLint order, const GLfloat * points); /* 221 */
+ void (GLAPIENTRYP Map2d)(GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, const GLdouble * points); /* 222 */
+ void (GLAPIENTRYP Map2f)(GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, const GLfloat * points); /* 223 */
+ void (GLAPIENTRYP MapGrid1d)(GLint un, GLdouble u1, GLdouble u2); /* 224 */
+ void (GLAPIENTRYP MapGrid1f)(GLint un, GLfloat u1, GLfloat u2); /* 225 */
+ void (GLAPIENTRYP MapGrid2d)(GLint un, GLdouble u1, GLdouble u2, GLint vn, GLdouble v1, GLdouble v2); /* 226 */
+ void (GLAPIENTRYP MapGrid2f)(GLint un, GLfloat u1, GLfloat u2, GLint vn, GLfloat v1, GLfloat v2); /* 227 */
+ void (GLAPIENTRYP EvalCoord1d)(GLdouble u); /* 228 */
+ void (GLAPIENTRYP EvalCoord1dv)(const GLdouble * u); /* 229 */
+ void (GLAPIENTRYP EvalCoord1f)(GLfloat u); /* 230 */
+ void (GLAPIENTRYP EvalCoord1fv)(const GLfloat * u); /* 231 */
+ void (GLAPIENTRYP EvalCoord2d)(GLdouble u, GLdouble v); /* 232 */
+ void (GLAPIENTRYP EvalCoord2dv)(const GLdouble * u); /* 233 */
+ void (GLAPIENTRYP EvalCoord2f)(GLfloat u, GLfloat v); /* 234 */
+ void (GLAPIENTRYP EvalCoord2fv)(const GLfloat * u); /* 235 */
+ void (GLAPIENTRYP EvalMesh1)(GLenum mode, GLint i1, GLint i2); /* 236 */
+ void (GLAPIENTRYP EvalPoint1)(GLint i); /* 237 */
+ void (GLAPIENTRYP EvalMesh2)(GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2); /* 238 */
+ void (GLAPIENTRYP EvalPoint2)(GLint i, GLint j); /* 239 */
+ void (GLAPIENTRYP AlphaFunc)(GLenum func, GLclampf ref); /* 240 */
+ void (GLAPIENTRYP BlendFunc)(GLenum sfactor, GLenum dfactor); /* 241 */
+ void (GLAPIENTRYP LogicOp)(GLenum opcode); /* 242 */
+ void (GLAPIENTRYP StencilFunc)(GLenum func, GLint ref, GLuint mask); /* 243 */
+ void (GLAPIENTRYP StencilOp)(GLenum fail, GLenum zfail, GLenum zpass); /* 244 */
+ void (GLAPIENTRYP DepthFunc)(GLenum func); /* 245 */
+ void (GLAPIENTRYP PixelZoom)(GLfloat xfactor, GLfloat yfactor); /* 246 */
+ void (GLAPIENTRYP PixelTransferf)(GLenum pname, GLfloat param); /* 247 */
+ void (GLAPIENTRYP PixelTransferi)(GLenum pname, GLint param); /* 248 */
+ void (GLAPIENTRYP PixelStoref)(GLenum pname, GLfloat param); /* 249 */
+ void (GLAPIENTRYP PixelStorei)(GLenum pname, GLint param); /* 250 */
+ void (GLAPIENTRYP PixelMapfv)(GLenum map, GLsizei mapsize, const GLfloat * values); /* 251 */
+ void (GLAPIENTRYP PixelMapuiv)(GLenum map, GLsizei mapsize, const GLuint * values); /* 252 */
+ void (GLAPIENTRYP PixelMapusv)(GLenum map, GLsizei mapsize, const GLushort * values); /* 253 */
+ void (GLAPIENTRYP ReadBuffer)(GLenum mode); /* 254 */
+ void (GLAPIENTRYP CopyPixels)(GLint x, GLint y, GLsizei width, GLsizei height, GLenum type); /* 255 */
+ void (GLAPIENTRYP ReadPixels)(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid * pixels); /* 256 */
+ void (GLAPIENTRYP DrawPixels)(GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * pixels); /* 257 */
+ void (GLAPIENTRYP GetBooleanv)(GLenum pname, GLboolean * params); /* 258 */
+ void (GLAPIENTRYP GetClipPlane)(GLenum plane, GLdouble * equation); /* 259 */
+ void (GLAPIENTRYP GetDoublev)(GLenum pname, GLdouble * params); /* 260 */
+ GLenum (GLAPIENTRYP GetError)(void); /* 261 */
+ void (GLAPIENTRYP GetFloatv)(GLenum pname, GLfloat * params); /* 262 */
+ void (GLAPIENTRYP GetIntegerv)(GLenum pname, GLint * params); /* 263 */
+ void (GLAPIENTRYP GetLightfv)(GLenum light, GLenum pname, GLfloat * params); /* 264 */
+ void (GLAPIENTRYP GetLightiv)(GLenum light, GLenum pname, GLint * params); /* 265 */
+ void (GLAPIENTRYP GetMapdv)(GLenum target, GLenum query, GLdouble * v); /* 266 */
+ void (GLAPIENTRYP GetMapfv)(GLenum target, GLenum query, GLfloat * v); /* 267 */
+ void (GLAPIENTRYP GetMapiv)(GLenum target, GLenum query, GLint * v); /* 268 */
+ void (GLAPIENTRYP GetMaterialfv)(GLenum face, GLenum pname, GLfloat * params); /* 269 */
+ void (GLAPIENTRYP GetMaterialiv)(GLenum face, GLenum pname, GLint * params); /* 270 */
+ void (GLAPIENTRYP GetPixelMapfv)(GLenum map, GLfloat * values); /* 271 */
+ void (GLAPIENTRYP GetPixelMapuiv)(GLenum map, GLuint * values); /* 272 */
+ void (GLAPIENTRYP GetPixelMapusv)(GLenum map, GLushort * values); /* 273 */
+ void (GLAPIENTRYP GetPolygonStipple)(GLubyte * mask); /* 274 */
+ const GLubyte * (GLAPIENTRYP GetString)(GLenum name); /* 275 */
+ void (GLAPIENTRYP GetTexEnvfv)(GLenum target, GLenum pname, GLfloat * params); /* 276 */
+ void (GLAPIENTRYP GetTexEnviv)(GLenum target, GLenum pname, GLint * params); /* 277 */
+ void (GLAPIENTRYP GetTexGendv)(GLenum coord, GLenum pname, GLdouble * params); /* 278 */
+ void (GLAPIENTRYP GetTexGenfv)(GLenum coord, GLenum pname, GLfloat * params); /* 279 */
+ void (GLAPIENTRYP GetTexGeniv)(GLenum coord, GLenum pname, GLint * params); /* 280 */
+ void (GLAPIENTRYP GetTexImage)(GLenum target, GLint level, GLenum format, GLenum type, GLvoid * pixels); /* 281 */
+ void (GLAPIENTRYP GetTexParameterfv)(GLenum target, GLenum pname, GLfloat * params); /* 282 */
+ void (GLAPIENTRYP GetTexParameteriv)(GLenum target, GLenum pname, GLint * params); /* 283 */
+ void (GLAPIENTRYP GetTexLevelParameterfv)(GLenum target, GLint level, GLenum pname, GLfloat * params); /* 284 */
+ void (GLAPIENTRYP GetTexLevelParameteriv)(GLenum target, GLint level, GLenum pname, GLint * params); /* 285 */
+ GLboolean (GLAPIENTRYP IsEnabled)(GLenum cap); /* 286 */
+ GLboolean (GLAPIENTRYP IsList)(GLuint list); /* 287 */
+ void (GLAPIENTRYP DepthRange)(GLclampd zNear, GLclampd zFar); /* 288 */
+ void (GLAPIENTRYP Frustum)(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar); /* 289 */
+ void (GLAPIENTRYP LoadIdentity)(void); /* 290 */
+ void (GLAPIENTRYP LoadMatrixf)(const GLfloat * m); /* 291 */
+ void (GLAPIENTRYP LoadMatrixd)(const GLdouble * m); /* 292 */
+ void (GLAPIENTRYP MatrixMode)(GLenum mode); /* 293 */
+ void (GLAPIENTRYP MultMatrixf)(const GLfloat * m); /* 294 */
+ void (GLAPIENTRYP MultMatrixd)(const GLdouble * m); /* 295 */
+ void (GLAPIENTRYP Ortho)(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar); /* 296 */
+ void (GLAPIENTRYP PopMatrix)(void); /* 297 */
+ void (GLAPIENTRYP PushMatrix)(void); /* 298 */
+ void (GLAPIENTRYP Rotated)(GLdouble angle, GLdouble x, GLdouble y, GLdouble z); /* 299 */
+ void (GLAPIENTRYP Rotatef)(GLfloat angle, GLfloat x, GLfloat y, GLfloat z); /* 300 */
+ void (GLAPIENTRYP Scaled)(GLdouble x, GLdouble y, GLdouble z); /* 301 */
+ void (GLAPIENTRYP Scalef)(GLfloat x, GLfloat y, GLfloat z); /* 302 */
+ void (GLAPIENTRYP Translated)(GLdouble x, GLdouble y, GLdouble z); /* 303 */
+ void (GLAPIENTRYP Translatef)(GLfloat x, GLfloat y, GLfloat z); /* 304 */
+ void (GLAPIENTRYP Viewport)(GLint x, GLint y, GLsizei width, GLsizei height); /* 305 */
+ void (GLAPIENTRYP ArrayElement)(GLint i); /* 306 */
+ void (GLAPIENTRYP BindTexture)(GLenum target, GLuint texture); /* 307 */
+ void (GLAPIENTRYP ColorPointer)(GLint size, GLenum type, GLsizei stride, const GLvoid * pointer); /* 308 */
+ void (GLAPIENTRYP DisableClientState)(GLenum array); /* 309 */
+ void (GLAPIENTRYP DrawArrays)(GLenum mode, GLint first, GLsizei count); /* 310 */
+ void (GLAPIENTRYP DrawElements)(GLenum mode, GLsizei count, GLenum type, const GLvoid * indices); /* 311 */
+ void (GLAPIENTRYP EdgeFlagPointer)(GLsizei stride, const GLvoid * pointer); /* 312 */
+ void (GLAPIENTRYP EnableClientState)(GLenum array); /* 313 */
+ void (GLAPIENTRYP IndexPointer)(GLenum type, GLsizei stride, const GLvoid * pointer); /* 314 */
+ void (GLAPIENTRYP Indexub)(GLubyte c); /* 315 */
+ void (GLAPIENTRYP Indexubv)(const GLubyte * c); /* 316 */
+ void (GLAPIENTRYP InterleavedArrays)(GLenum format, GLsizei stride, const GLvoid * pointer); /* 317 */
+ void (GLAPIENTRYP NormalPointer)(GLenum type, GLsizei stride, const GLvoid * pointer); /* 318 */
+ void (GLAPIENTRYP PolygonOffset)(GLfloat factor, GLfloat units); /* 319 */
+ void (GLAPIENTRYP TexCoordPointer)(GLint size, GLenum type, GLsizei stride, const GLvoid * pointer); /* 320 */
+ void (GLAPIENTRYP VertexPointer)(GLint size, GLenum type, GLsizei stride, const GLvoid * pointer); /* 321 */
+ GLboolean (GLAPIENTRYP AreTexturesResident)(GLsizei n, const GLuint * textures, GLboolean * residences); /* 322 */
+ void (GLAPIENTRYP CopyTexImage1D)(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border); /* 323 */
+ void (GLAPIENTRYP CopyTexImage2D)(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); /* 324 */
+ void (GLAPIENTRYP CopyTexSubImage1D)(GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); /* 325 */
+ void (GLAPIENTRYP CopyTexSubImage2D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); /* 326 */
+ void (GLAPIENTRYP DeleteTextures)(GLsizei n, const GLuint * textures); /* 327 */
+ void (GLAPIENTRYP GenTextures)(GLsizei n, GLuint * textures); /* 328 */
+ void (GLAPIENTRYP GetPointerv)(GLenum pname, GLvoid ** params); /* 329 */
+ GLboolean (GLAPIENTRYP IsTexture)(GLuint texture); /* 330 */
+ void (GLAPIENTRYP PrioritizeTextures)(GLsizei n, const GLuint * textures, const GLclampf * priorities); /* 331 */
+ void (GLAPIENTRYP TexSubImage1D)(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid * pixels); /* 332 */
+ void (GLAPIENTRYP TexSubImage2D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * pixels); /* 333 */
+ void (GLAPIENTRYP PopClientAttrib)(void); /* 334 */
+ void (GLAPIENTRYP PushClientAttrib)(GLbitfield mask); /* 335 */
+ void (GLAPIENTRYP BlendColor)(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); /* 336 */
+ void (GLAPIENTRYP BlendEquation)(GLenum mode); /* 337 */
+ void (GLAPIENTRYP DrawRangeElements)(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid * indices); /* 338 */
+ void (GLAPIENTRYP ColorTable)(GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid * table); /* 339 */
+ void (GLAPIENTRYP ColorTableParameterfv)(GLenum target, GLenum pname, const GLfloat * params); /* 340 */
+ void (GLAPIENTRYP ColorTableParameteriv)(GLenum target, GLenum pname, const GLint * params); /* 341 */
+ void (GLAPIENTRYP CopyColorTable)(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); /* 342 */
+ void (GLAPIENTRYP GetColorTable)(GLenum target, GLenum format, GLenum type, GLvoid * table); /* 343 */
+ void (GLAPIENTRYP GetColorTableParameterfv)(GLenum target, GLenum pname, GLfloat * params); /* 344 */
+ void (GLAPIENTRYP GetColorTableParameteriv)(GLenum target, GLenum pname, GLint * params); /* 345 */
+ void (GLAPIENTRYP ColorSubTable)(GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid * data); /* 346 */
+ void (GLAPIENTRYP CopyColorSubTable)(GLenum target, GLsizei start, GLint x, GLint y, GLsizei width); /* 347 */
+ void (GLAPIENTRYP ConvolutionFilter1D)(GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid * image); /* 348 */
+ void (GLAPIENTRYP ConvolutionFilter2D)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * image); /* 349 */
+ void (GLAPIENTRYP ConvolutionParameterf)(GLenum target, GLenum pname, GLfloat params); /* 350 */
+ void (GLAPIENTRYP ConvolutionParameterfv)(GLenum target, GLenum pname, const GLfloat * params); /* 351 */
+ void (GLAPIENTRYP ConvolutionParameteri)(GLenum target, GLenum pname, GLint params); /* 352 */
+ void (GLAPIENTRYP ConvolutionParameteriv)(GLenum target, GLenum pname, const GLint * params); /* 353 */
+ void (GLAPIENTRYP CopyConvolutionFilter1D)(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); /* 354 */
+ void (GLAPIENTRYP CopyConvolutionFilter2D)(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height); /* 355 */
+ void (GLAPIENTRYP GetConvolutionFilter)(GLenum target, GLenum format, GLenum type, GLvoid * image); /* 356 */
+ void (GLAPIENTRYP GetConvolutionParameterfv)(GLenum target, GLenum pname, GLfloat * params); /* 357 */
+ void (GLAPIENTRYP GetConvolutionParameteriv)(GLenum target, GLenum pname, GLint * params); /* 358 */
+ void (GLAPIENTRYP GetSeparableFilter)(GLenum target, GLenum format, GLenum type, GLvoid * row, GLvoid * column, GLvoid * span); /* 359 */
+ void (GLAPIENTRYP SeparableFilter2D)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * row, const GLvoid * column); /* 360 */
+ void (GLAPIENTRYP GetHistogram)(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid * values); /* 361 */
+ void (GLAPIENTRYP GetHistogramParameterfv)(GLenum target, GLenum pname, GLfloat * params); /* 362 */
+ void (GLAPIENTRYP GetHistogramParameteriv)(GLenum target, GLenum pname, GLint * params); /* 363 */
+ void (GLAPIENTRYP GetMinmax)(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid * values); /* 364 */
+ void (GLAPIENTRYP GetMinmaxParameterfv)(GLenum target, GLenum pname, GLfloat * params); /* 365 */
+ void (GLAPIENTRYP GetMinmaxParameteriv)(GLenum target, GLenum pname, GLint * params); /* 366 */
+ void (GLAPIENTRYP Histogram)(GLenum target, GLsizei width, GLenum internalformat, GLboolean sink); /* 367 */
+ void (GLAPIENTRYP Minmax)(GLenum target, GLenum internalformat, GLboolean sink); /* 368 */
+ void (GLAPIENTRYP ResetHistogram)(GLenum target); /* 369 */
+ void (GLAPIENTRYP ResetMinmax)(GLenum target); /* 370 */
+ void (GLAPIENTRYP TexImage3D)(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid * pixels); /* 371 */
+ void (GLAPIENTRYP TexSubImage3D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid * pixels); /* 372 */
+ void (GLAPIENTRYP CopyTexSubImage3D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); /* 373 */
+ void (GLAPIENTRYP ActiveTextureARB)(GLenum texture); /* 374 */
+ void (GLAPIENTRYP ClientActiveTextureARB)(GLenum texture); /* 375 */
+ void (GLAPIENTRYP MultiTexCoord1dARB)(GLenum target, GLdouble s); /* 376 */
+ void (GLAPIENTRYP MultiTexCoord1dvARB)(GLenum target, const GLdouble * v); /* 377 */
+ void (GLAPIENTRYP MultiTexCoord1fARB)(GLenum target, GLfloat s); /* 378 */
+ void (GLAPIENTRYP MultiTexCoord1fvARB)(GLenum target, const GLfloat * v); /* 379 */
+ void (GLAPIENTRYP MultiTexCoord1iARB)(GLenum target, GLint s); /* 380 */
+ void (GLAPIENTRYP MultiTexCoord1ivARB)(GLenum target, const GLint * v); /* 381 */
+ void (GLAPIENTRYP MultiTexCoord1sARB)(GLenum target, GLshort s); /* 382 */
+ void (GLAPIENTRYP MultiTexCoord1svARB)(GLenum target, const GLshort * v); /* 383 */
+ void (GLAPIENTRYP MultiTexCoord2dARB)(GLenum target, GLdouble s, GLdouble t); /* 384 */
+ void (GLAPIENTRYP MultiTexCoord2dvARB)(GLenum target, const GLdouble * v); /* 385 */
+ void (GLAPIENTRYP MultiTexCoord2fARB)(GLenum target, GLfloat s, GLfloat t); /* 386 */
+ void (GLAPIENTRYP MultiTexCoord2fvARB)(GLenum target, const GLfloat * v); /* 387 */
+ void (GLAPIENTRYP MultiTexCoord2iARB)(GLenum target, GLint s, GLint t); /* 388 */
+ void (GLAPIENTRYP MultiTexCoord2ivARB)(GLenum target, const GLint * v); /* 389 */
+ void (GLAPIENTRYP MultiTexCoord2sARB)(GLenum target, GLshort s, GLshort t); /* 390 */
+ void (GLAPIENTRYP MultiTexCoord2svARB)(GLenum target, const GLshort * v); /* 391 */
+ void (GLAPIENTRYP MultiTexCoord3dARB)(GLenum target, GLdouble s, GLdouble t, GLdouble r); /* 392 */
+ void (GLAPIENTRYP MultiTexCoord3dvARB)(GLenum target, const GLdouble * v); /* 393 */
+ void (GLAPIENTRYP MultiTexCoord3fARB)(GLenum target, GLfloat s, GLfloat t, GLfloat r); /* 394 */
+ void (GLAPIENTRYP MultiTexCoord3fvARB)(GLenum target, const GLfloat * v); /* 395 */
+ void (GLAPIENTRYP MultiTexCoord3iARB)(GLenum target, GLint s, GLint t, GLint r); /* 396 */
+ void (GLAPIENTRYP MultiTexCoord3ivARB)(GLenum target, const GLint * v); /* 397 */
+ void (GLAPIENTRYP MultiTexCoord3sARB)(GLenum target, GLshort s, GLshort t, GLshort r); /* 398 */
+ void (GLAPIENTRYP MultiTexCoord3svARB)(GLenum target, const GLshort * v); /* 399 */
+ void (GLAPIENTRYP MultiTexCoord4dARB)(GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q); /* 400 */
+ void (GLAPIENTRYP MultiTexCoord4dvARB)(GLenum target, const GLdouble * v); /* 401 */
+ void (GLAPIENTRYP MultiTexCoord4fARB)(GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q); /* 402 */
+ void (GLAPIENTRYP MultiTexCoord4fvARB)(GLenum target, const GLfloat * v); /* 403 */
+ void (GLAPIENTRYP MultiTexCoord4iARB)(GLenum target, GLint s, GLint t, GLint r, GLint q); /* 404 */
+ void (GLAPIENTRYP MultiTexCoord4ivARB)(GLenum target, const GLint * v); /* 405 */
+ void (GLAPIENTRYP MultiTexCoord4sARB)(GLenum target, GLshort s, GLshort t, GLshort r, GLshort q); /* 406 */
+ void (GLAPIENTRYP MultiTexCoord4svARB)(GLenum target, const GLshort * v); /* 407 */
+ void (GLAPIENTRYP AttachShader)(GLuint program, GLuint shader); /* 408 */
+ GLuint (GLAPIENTRYP CreateProgram)(void); /* 409 */
+ GLuint (GLAPIENTRYP CreateShader)(GLenum type); /* 410 */
+ void (GLAPIENTRYP DeleteProgram)(GLuint program); /* 411 */
+ void (GLAPIENTRYP DeleteShader)(GLuint program); /* 412 */
+ void (GLAPIENTRYP DetachShader)(GLuint program, GLuint shader); /* 413 */
+ void (GLAPIENTRYP GetAttachedShaders)(GLuint program, GLsizei maxCount, GLsizei * count, GLuint * obj); /* 414 */
+ void (GLAPIENTRYP GetProgramInfoLog)(GLuint program, GLsizei bufSize, GLsizei * length, GLchar * infoLog); /* 415 */
+ void (GLAPIENTRYP GetProgramiv)(GLuint program, GLenum pname, GLint * params); /* 416 */
+ void (GLAPIENTRYP GetShaderInfoLog)(GLuint shader, GLsizei bufSize, GLsizei * length, GLchar * infoLog); /* 417 */
+ void (GLAPIENTRYP GetShaderiv)(GLuint shader, GLenum pname, GLint * params); /* 418 */
+ GLboolean (GLAPIENTRYP IsProgram)(GLuint program); /* 419 */
+ GLboolean (GLAPIENTRYP IsShader)(GLuint shader); /* 420 */
+ void (GLAPIENTRYP StencilFuncSeparate)(GLenum face, GLenum func, GLint ref, GLuint mask); /* 421 */
+ void (GLAPIENTRYP StencilMaskSeparate)(GLenum face, GLuint mask); /* 422 */
+ void (GLAPIENTRYP StencilOpSeparate)(GLenum face, GLenum sfail, GLenum zfail, GLenum zpass); /* 423 */
+ void (GLAPIENTRYP UniformMatrix2x3fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); /* 424 */
+ void (GLAPIENTRYP UniformMatrix2x4fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); /* 425 */
+ void (GLAPIENTRYP UniformMatrix3x2fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); /* 426 */
+ void (GLAPIENTRYP UniformMatrix3x4fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); /* 427 */
+ void (GLAPIENTRYP UniformMatrix4x2fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); /* 428 */
+ void (GLAPIENTRYP UniformMatrix4x3fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); /* 429 */
+ void (GLAPIENTRYP ClampColor)(GLenum target, GLenum clamp); /* 430 */
+ void (GLAPIENTRYP ClearBufferfi)(GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil); /* 431 */
+ void (GLAPIENTRYP ClearBufferfv)(GLenum buffer, GLint drawbuffer, const GLfloat * value); /* 432 */
+ void (GLAPIENTRYP ClearBufferiv)(GLenum buffer, GLint drawbuffer, const GLint * value); /* 433 */
+ void (GLAPIENTRYP ClearBufferuiv)(GLenum buffer, GLint drawbuffer, const GLuint * value); /* 434 */
+ const GLubyte * (GLAPIENTRYP GetStringi)(GLenum name, GLuint index); /* 435 */
+ void (GLAPIENTRYP TexBuffer)(GLenum target, GLenum internalFormat, GLuint buffer); /* 436 */
+ void (GLAPIENTRYP FramebufferTexture)(GLenum target, GLenum attachment, GLuint texture, GLint level); /* 437 */
+ void (GLAPIENTRYP GetBufferParameteri64v)(GLenum target, GLenum pname, GLint64 * params); /* 438 */
+ void (GLAPIENTRYP GetInteger64i_v)(GLenum cap, GLuint index, GLint64 * data); /* 439 */
+ void (GLAPIENTRYP VertexAttribDivisor)(GLuint index, GLuint divisor); /* 440 */
+ void (GLAPIENTRYP LoadTransposeMatrixdARB)(const GLdouble * m); /* 441 */
+ void (GLAPIENTRYP LoadTransposeMatrixfARB)(const GLfloat * m); /* 442 */
+ void (GLAPIENTRYP MultTransposeMatrixdARB)(const GLdouble * m); /* 443 */
+ void (GLAPIENTRYP MultTransposeMatrixfARB)(const GLfloat * m); /* 444 */
+ void (GLAPIENTRYP SampleCoverageARB)(GLclampf value, GLboolean invert); /* 445 */
+ void (GLAPIENTRYP CompressedTexImage1DARB)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid * data); /* 446 */
+ void (GLAPIENTRYP CompressedTexImage2DARB)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid * data); /* 447 */
+ void (GLAPIENTRYP CompressedTexImage3DARB)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid * data); /* 448 */
+ void (GLAPIENTRYP CompressedTexSubImage1DARB)(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid * data); /* 449 */
+ void (GLAPIENTRYP CompressedTexSubImage2DARB)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid * data); /* 450 */
+ void (GLAPIENTRYP CompressedTexSubImage3DARB)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid * data); /* 451 */
+ void (GLAPIENTRYP GetCompressedTexImageARB)(GLenum target, GLint level, GLvoid * img); /* 452 */
+ void (GLAPIENTRYP DisableVertexAttribArrayARB)(GLuint index); /* 453 */
+ void (GLAPIENTRYP EnableVertexAttribArrayARB)(GLuint index); /* 454 */
+ void (GLAPIENTRYP GetProgramEnvParameterdvARB)(GLenum target, GLuint index, GLdouble * params); /* 455 */
+ void (GLAPIENTRYP GetProgramEnvParameterfvARB)(GLenum target, GLuint index, GLfloat * params); /* 456 */
+ void (GLAPIENTRYP GetProgramLocalParameterdvARB)(GLenum target, GLuint index, GLdouble * params); /* 457 */
+ void (GLAPIENTRYP GetProgramLocalParameterfvARB)(GLenum target, GLuint index, GLfloat * params); /* 458 */
+ void (GLAPIENTRYP GetProgramStringARB)(GLenum target, GLenum pname, GLvoid * string); /* 459 */
+ void (GLAPIENTRYP GetProgramivARB)(GLenum target, GLenum pname, GLint * params); /* 460 */
+ void (GLAPIENTRYP GetVertexAttribdvARB)(GLuint index, GLenum pname, GLdouble * params); /* 461 */
+ void (GLAPIENTRYP GetVertexAttribfvARB)(GLuint index, GLenum pname, GLfloat * params); /* 462 */
+ void (GLAPIENTRYP GetVertexAttribivARB)(GLuint index, GLenum pname, GLint * params); /* 463 */
+ void (GLAPIENTRYP ProgramEnvParameter4dARB)(GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); /* 464 */
+ void (GLAPIENTRYP ProgramEnvParameter4dvARB)(GLenum target, GLuint index, const GLdouble * params); /* 465 */
+ void (GLAPIENTRYP ProgramEnvParameter4fARB)(GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); /* 466 */
+ void (GLAPIENTRYP ProgramEnvParameter4fvARB)(GLenum target, GLuint index, const GLfloat * params); /* 467 */
+ void (GLAPIENTRYP ProgramLocalParameter4dARB)(GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); /* 468 */
+ void (GLAPIENTRYP ProgramLocalParameter4dvARB)(GLenum target, GLuint index, const GLdouble * params); /* 469 */
+ void (GLAPIENTRYP ProgramLocalParameter4fARB)(GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); /* 470 */
+ void (GLAPIENTRYP ProgramLocalParameter4fvARB)(GLenum target, GLuint index, const GLfloat * params); /* 471 */
+ void (GLAPIENTRYP ProgramStringARB)(GLenum target, GLenum format, GLsizei len, const GLvoid * string); /* 472 */
+ void (GLAPIENTRYP VertexAttrib1dARB)(GLuint index, GLdouble x); /* 473 */
+ void (GLAPIENTRYP VertexAttrib1dvARB)(GLuint index, const GLdouble * v); /* 474 */
+ void (GLAPIENTRYP VertexAttrib1fARB)(GLuint index, GLfloat x); /* 475 */
+ void (GLAPIENTRYP VertexAttrib1fvARB)(GLuint index, const GLfloat * v); /* 476 */
+ void (GLAPIENTRYP VertexAttrib1sARB)(GLuint index, GLshort x); /* 477 */
+ void (GLAPIENTRYP VertexAttrib1svARB)(GLuint index, const GLshort * v); /* 478 */
+ void (GLAPIENTRYP VertexAttrib2dARB)(GLuint index, GLdouble x, GLdouble y); /* 479 */
+ void (GLAPIENTRYP VertexAttrib2dvARB)(GLuint index, const GLdouble * v); /* 480 */
+ void (GLAPIENTRYP VertexAttrib2fARB)(GLuint index, GLfloat x, GLfloat y); /* 481 */
+ void (GLAPIENTRYP VertexAttrib2fvARB)(GLuint index, const GLfloat * v); /* 482 */
+ void (GLAPIENTRYP VertexAttrib2sARB)(GLuint index, GLshort x, GLshort y); /* 483 */
+ void (GLAPIENTRYP VertexAttrib2svARB)(GLuint index, const GLshort * v); /* 484 */
+ void (GLAPIENTRYP VertexAttrib3dARB)(GLuint index, GLdouble x, GLdouble y, GLdouble z); /* 485 */
+ void (GLAPIENTRYP VertexAttrib3dvARB)(GLuint index, const GLdouble * v); /* 486 */
+ void (GLAPIENTRYP VertexAttrib3fARB)(GLuint index, GLfloat x, GLfloat y, GLfloat z); /* 487 */
+ void (GLAPIENTRYP VertexAttrib3fvARB)(GLuint index, const GLfloat * v); /* 488 */
+ void (GLAPIENTRYP VertexAttrib3sARB)(GLuint index, GLshort x, GLshort y, GLshort z); /* 489 */
+ void (GLAPIENTRYP VertexAttrib3svARB)(GLuint index, const GLshort * v); /* 490 */
+ void (GLAPIENTRYP VertexAttrib4NbvARB)(GLuint index, const GLbyte * v); /* 491 */
+ void (GLAPIENTRYP VertexAttrib4NivARB)(GLuint index, const GLint * v); /* 492 */
+ void (GLAPIENTRYP VertexAttrib4NsvARB)(GLuint index, const GLshort * v); /* 493 */
+ void (GLAPIENTRYP VertexAttrib4NubARB)(GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); /* 494 */
+ void (GLAPIENTRYP VertexAttrib4NubvARB)(GLuint index, const GLubyte * v); /* 495 */
+ void (GLAPIENTRYP VertexAttrib4NuivARB)(GLuint index, const GLuint * v); /* 496 */
+ void (GLAPIENTRYP VertexAttrib4NusvARB)(GLuint index, const GLushort * v); /* 497 */
+ void (GLAPIENTRYP VertexAttrib4bvARB)(GLuint index, const GLbyte * v); /* 498 */
+ void (GLAPIENTRYP VertexAttrib4dARB)(GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); /* 499 */
+ void (GLAPIENTRYP VertexAttrib4dvARB)(GLuint index, const GLdouble * v); /* 500 */
+ void (GLAPIENTRYP VertexAttrib4fARB)(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); /* 501 */
+ void (GLAPIENTRYP VertexAttrib4fvARB)(GLuint index, const GLfloat * v); /* 502 */
+ void (GLAPIENTRYP VertexAttrib4ivARB)(GLuint index, const GLint * v); /* 503 */
+ void (GLAPIENTRYP VertexAttrib4sARB)(GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); /* 504 */
+ void (GLAPIENTRYP VertexAttrib4svARB)(GLuint index, const GLshort * v); /* 505 */
+ void (GLAPIENTRYP VertexAttrib4ubvARB)(GLuint index, const GLubyte * v); /* 506 */
+ void (GLAPIENTRYP VertexAttrib4uivARB)(GLuint index, const GLuint * v); /* 507 */
+ void (GLAPIENTRYP VertexAttrib4usvARB)(GLuint index, const GLushort * v); /* 508 */
+ void (GLAPIENTRYP VertexAttribPointerARB)(GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid * pointer); /* 509 */
+ void (GLAPIENTRYP BindBufferARB)(GLenum target, GLuint buffer); /* 510 */
+ void (GLAPIENTRYP BufferDataARB)(GLenum target, GLsizeiptrARB size, const GLvoid * data, GLenum usage); /* 511 */
+ void (GLAPIENTRYP BufferSubDataARB)(GLenum target, GLintptrARB offset, GLsizeiptrARB size, const GLvoid * data); /* 512 */
+ void (GLAPIENTRYP DeleteBuffersARB)(GLsizei n, const GLuint * buffer); /* 513 */
+ void (GLAPIENTRYP GenBuffersARB)(GLsizei n, GLuint * buffer); /* 514 */
+ void (GLAPIENTRYP GetBufferParameterivARB)(GLenum target, GLenum pname, GLint * params); /* 515 */
+ void (GLAPIENTRYP GetBufferPointervARB)(GLenum target, GLenum pname, GLvoid ** params); /* 516 */
+ void (GLAPIENTRYP GetBufferSubDataARB)(GLenum target, GLintptrARB offset, GLsizeiptrARB size, GLvoid * data); /* 517 */
+ GLboolean (GLAPIENTRYP IsBufferARB)(GLuint buffer); /* 518 */
+ GLvoid * (GLAPIENTRYP MapBufferARB)(GLenum target, GLenum access); /* 519 */
+ GLboolean (GLAPIENTRYP UnmapBufferARB)(GLenum target); /* 520 */
+ void (GLAPIENTRYP BeginQueryARB)(GLenum target, GLuint id); /* 521 */
+ void (GLAPIENTRYP DeleteQueriesARB)(GLsizei n, const GLuint * ids); /* 522 */
+ void (GLAPIENTRYP EndQueryARB)(GLenum target); /* 523 */
+ void (GLAPIENTRYP GenQueriesARB)(GLsizei n, GLuint * ids); /* 524 */
+ void (GLAPIENTRYP GetQueryObjectivARB)(GLuint id, GLenum pname, GLint * params); /* 525 */
+ void (GLAPIENTRYP GetQueryObjectuivARB)(GLuint id, GLenum pname, GLuint * params); /* 526 */
+ void (GLAPIENTRYP GetQueryivARB)(GLenum target, GLenum pname, GLint * params); /* 527 */
+ GLboolean (GLAPIENTRYP IsQueryARB)(GLuint id); /* 528 */
+ void (GLAPIENTRYP AttachObjectARB)(GLhandleARB containerObj, GLhandleARB obj); /* 529 */
+ void (GLAPIENTRYP CompileShaderARB)(GLhandleARB shader); /* 530 */
+ GLhandleARB (GLAPIENTRYP CreateProgramObjectARB)(void); /* 531 */
+ GLhandleARB (GLAPIENTRYP CreateShaderObjectARB)(GLenum shaderType); /* 532 */
+ void (GLAPIENTRYP DeleteObjectARB)(GLhandleARB obj); /* 533 */
+ void (GLAPIENTRYP DetachObjectARB)(GLhandleARB containerObj, GLhandleARB attachedObj); /* 534 */
+ void (GLAPIENTRYP GetActiveUniformARB)(GLhandleARB program, GLuint index, GLsizei bufSize, GLsizei * length, GLint * size, GLenum * type, GLcharARB * name); /* 535 */
+ void (GLAPIENTRYP GetAttachedObjectsARB)(GLhandleARB containerObj, GLsizei maxLength, GLsizei * length, GLhandleARB * infoLog); /* 536 */
+ GLhandleARB (GLAPIENTRYP GetHandleARB)(GLenum pname); /* 537 */
+ void (GLAPIENTRYP GetInfoLogARB)(GLhandleARB obj, GLsizei maxLength, GLsizei * length, GLcharARB * infoLog); /* 538 */
+ void (GLAPIENTRYP GetObjectParameterfvARB)(GLhandleARB obj, GLenum pname, GLfloat * params); /* 539 */
+ void (GLAPIENTRYP GetObjectParameterivARB)(GLhandleARB obj, GLenum pname, GLint * params); /* 540 */
+ void (GLAPIENTRYP GetShaderSourceARB)(GLhandleARB shader, GLsizei bufSize, GLsizei * length, GLcharARB * source); /* 541 */
+ GLint (GLAPIENTRYP GetUniformLocationARB)(GLhandleARB program, const GLcharARB * name); /* 542 */
+ void (GLAPIENTRYP GetUniformfvARB)(GLhandleARB program, GLint location, GLfloat * params); /* 543 */
+ void (GLAPIENTRYP GetUniformivARB)(GLhandleARB program, GLint location, GLint * params); /* 544 */
+ void (GLAPIENTRYP LinkProgramARB)(GLhandleARB program); /* 545 */
+ void (GLAPIENTRYP ShaderSourceARB)(GLhandleARB shader, GLsizei count, const GLcharARB ** string, const GLint * length); /* 546 */
+ void (GLAPIENTRYP Uniform1fARB)(GLint location, GLfloat v0); /* 547 */
+ void (GLAPIENTRYP Uniform1fvARB)(GLint location, GLsizei count, const GLfloat * value); /* 548 */
+ void (GLAPIENTRYP Uniform1iARB)(GLint location, GLint v0); /* 549 */
+ void (GLAPIENTRYP Uniform1ivARB)(GLint location, GLsizei count, const GLint * value); /* 550 */
+ void (GLAPIENTRYP Uniform2fARB)(GLint location, GLfloat v0, GLfloat v1); /* 551 */
+ void (GLAPIENTRYP Uniform2fvARB)(GLint location, GLsizei count, const GLfloat * value); /* 552 */
+ void (GLAPIENTRYP Uniform2iARB)(GLint location, GLint v0, GLint v1); /* 553 */
+ void (GLAPIENTRYP Uniform2ivARB)(GLint location, GLsizei count, const GLint * value); /* 554 */
+ void (GLAPIENTRYP Uniform3fARB)(GLint location, GLfloat v0, GLfloat v1, GLfloat v2); /* 555 */
+ void (GLAPIENTRYP Uniform3fvARB)(GLint location, GLsizei count, const GLfloat * value); /* 556 */
+ void (GLAPIENTRYP Uniform3iARB)(GLint location, GLint v0, GLint v1, GLint v2); /* 557 */
+ void (GLAPIENTRYP Uniform3ivARB)(GLint location, GLsizei count, const GLint * value); /* 558 */
+ void (GLAPIENTRYP Uniform4fARB)(GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); /* 559 */
+ void (GLAPIENTRYP Uniform4fvARB)(GLint location, GLsizei count, const GLfloat * value); /* 560 */
+ void (GLAPIENTRYP Uniform4iARB)(GLint location, GLint v0, GLint v1, GLint v2, GLint v3); /* 561 */
+ void (GLAPIENTRYP Uniform4ivARB)(GLint location, GLsizei count, const GLint * value); /* 562 */
+ void (GLAPIENTRYP UniformMatrix2fvARB)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); /* 563 */
+ void (GLAPIENTRYP UniformMatrix3fvARB)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); /* 564 */
+ void (GLAPIENTRYP UniformMatrix4fvARB)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); /* 565 */
+ void (GLAPIENTRYP UseProgramObjectARB)(GLhandleARB program); /* 566 */
+ void (GLAPIENTRYP ValidateProgramARB)(GLhandleARB program); /* 567 */
+ void (GLAPIENTRYP BindAttribLocationARB)(GLhandleARB program, GLuint index, const GLcharARB * name); /* 568 */
+ void (GLAPIENTRYP GetActiveAttribARB)(GLhandleARB program, GLuint index, GLsizei bufSize, GLsizei * length, GLint * size, GLenum * type, GLcharARB * name); /* 569 */
+ GLint (GLAPIENTRYP GetAttribLocationARB)(GLhandleARB program, const GLcharARB * name); /* 570 */
+ void (GLAPIENTRYP DrawBuffersARB)(GLsizei n, const GLenum * bufs); /* 571 */
+ void (GLAPIENTRYP ClampColorARB)(GLenum target, GLenum clamp); /* 572 */
+ void (GLAPIENTRYP DrawArraysInstancedARB)(GLenum mode, GLint first, GLsizei count, GLsizei primcount); /* 573 */
+ void (GLAPIENTRYP DrawElementsInstancedARB)(GLenum mode, GLsizei count, GLenum type, const GLvoid * indices, GLsizei primcount); /* 574 */
+ void (GLAPIENTRYP RenderbufferStorageMultisample)(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); /* 575 */
+ void (GLAPIENTRYP FramebufferTextureARB)(GLenum target, GLenum attachment, GLuint texture, GLint level); /* 576 */
+ void (GLAPIENTRYP FramebufferTextureFaceARB)(GLenum target, GLenum attachment, GLuint texture, GLint level, GLenum face); /* 577 */
+ void (GLAPIENTRYP ProgramParameteriARB)(GLuint program, GLenum pname, GLint value); /* 578 */
+ void (GLAPIENTRYP VertexAttribDivisorARB)(GLuint index, GLuint divisor); /* 579 */
+ void (GLAPIENTRYP FlushMappedBufferRange)(GLenum target, GLintptr offset, GLsizeiptr length); /* 580 */
+ GLvoid * (GLAPIENTRYP MapBufferRange)(GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access); /* 581 */
+ void (GLAPIENTRYP TexBufferARB)(GLenum target, GLenum internalFormat, GLuint buffer); /* 582 */
+ void (GLAPIENTRYP BindVertexArray)(GLuint array); /* 583 */
+ void (GLAPIENTRYP GenVertexArrays)(GLsizei n, GLuint * arrays); /* 584 */
+ void (GLAPIENTRYP CopyBufferSubData)(GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size); /* 585 */
+ GLenum (GLAPIENTRYP ClientWaitSync)(GLsync sync, GLbitfield flags, GLuint64 timeout); /* 586 */
+ void (GLAPIENTRYP DeleteSync)(GLsync sync); /* 587 */
+ GLsync (GLAPIENTRYP FenceSync)(GLenum condition, GLbitfield flags); /* 588 */
+ void (GLAPIENTRYP GetInteger64v)(GLenum pname, GLint64 * params); /* 589 */
+ void (GLAPIENTRYP GetSynciv)(GLsync sync, GLenum pname, GLsizei bufSize, GLsizei * length, GLint * values); /* 590 */
+ GLboolean (GLAPIENTRYP IsSync)(GLsync sync); /* 591 */
+ void (GLAPIENTRYP WaitSync)(GLsync sync, GLbitfield flags, GLuint64 timeout); /* 592 */
+ void (GLAPIENTRYP DrawElementsBaseVertex)(GLenum mode, GLsizei count, GLenum type, const GLvoid * indices, GLint basevertex); /* 593 */
+ void (GLAPIENTRYP DrawRangeElementsBaseVertex)(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid * indices, GLint basevertex); /* 594 */
+ void (GLAPIENTRYP MultiDrawElementsBaseVertex)(GLenum mode, const GLsizei * count, GLenum type, const GLvoid ** indices, GLsizei primcount, const GLint * basevertex); /* 595 */
+ void (GLAPIENTRYP BlendEquationSeparateiARB)(GLuint buf, GLenum modeRGB, GLenum modeA); /* 596 */
+ void (GLAPIENTRYP BlendEquationiARB)(GLuint buf, GLenum mode); /* 597 */
+ void (GLAPIENTRYP BlendFuncSeparateiARB)(GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcA, GLenum dstA); /* 598 */
+ void (GLAPIENTRYP BlendFunciARB)(GLuint buf, GLenum src, GLenum dst); /* 599 */
+ void (GLAPIENTRYP BindSampler)(GLuint unit, GLuint sampler); /* 600 */
+ void (GLAPIENTRYP DeleteSamplers)(GLsizei count, const GLuint * samplers); /* 601 */
+ void (GLAPIENTRYP GenSamplers)(GLsizei count, GLuint * samplers); /* 602 */
+ void (GLAPIENTRYP GetSamplerParameterIiv)(GLuint sampler, GLenum pname, GLint * params); /* 603 */
+ void (GLAPIENTRYP GetSamplerParameterIuiv)(GLuint sampler, GLenum pname, GLuint * params); /* 604 */
+ void (GLAPIENTRYP GetSamplerParameterfv)(GLuint sampler, GLenum pname, GLfloat * params); /* 605 */
+ void (GLAPIENTRYP GetSamplerParameteriv)(GLuint sampler, GLenum pname, GLint * params); /* 606 */
+ GLboolean (GLAPIENTRYP IsSampler)(GLuint sampler); /* 607 */
+ void (GLAPIENTRYP SamplerParameterIiv)(GLuint sampler, GLenum pname, const GLint * params); /* 608 */
+ void (GLAPIENTRYP SamplerParameterIuiv)(GLuint sampler, GLenum pname, const GLuint * params); /* 609 */
+ void (GLAPIENTRYP SamplerParameterf)(GLuint sampler, GLenum pname, GLfloat param); /* 610 */
+ void (GLAPIENTRYP SamplerParameterfv)(GLuint sampler, GLenum pname, const GLfloat * params); /* 611 */
+ void (GLAPIENTRYP SamplerParameteri)(GLuint sampler, GLenum pname, GLint param); /* 612 */
+ void (GLAPIENTRYP SamplerParameteriv)(GLuint sampler, GLenum pname, const GLint * params); /* 613 */
+ void (GLAPIENTRYP BindTransformFeedback)(GLenum target, GLuint id); /* 614 */
+ void (GLAPIENTRYP DeleteTransformFeedbacks)(GLsizei n, const GLuint * ids); /* 615 */
+ void (GLAPIENTRYP DrawTransformFeedback)(GLenum mode, GLuint id); /* 616 */
+ void (GLAPIENTRYP GenTransformFeedbacks)(GLsizei n, GLuint * ids); /* 617 */
+ GLboolean (GLAPIENTRYP IsTransformFeedback)(GLuint id); /* 618 */
+ void (GLAPIENTRYP PauseTransformFeedback)(void); /* 619 */
+ void (GLAPIENTRYP ResumeTransformFeedback)(void); /* 620 */
+ void (GLAPIENTRYP ClearDepthf)(GLclampf depth); /* 621 */
+ void (GLAPIENTRYP DepthRangef)(GLclampf zNear, GLclampf zFar); /* 622 */
+ void (GLAPIENTRYP GetShaderPrecisionFormat)(GLenum shadertype, GLenum precisiontype, GLint * range, GLint * precision); /* 623 */
+ void (GLAPIENTRYP ReleaseShaderCompiler)(void); /* 624 */
+ void (GLAPIENTRYP ShaderBinary)(GLsizei n, const GLuint * shaders, GLenum binaryformat, const GLvoid * binary, GLsizei length); /* 625 */
+ GLenum (GLAPIENTRYP GetGraphicsResetStatusARB)(void); /* 626 */
+ void (GLAPIENTRYP GetnColorTableARB)(GLenum target, GLenum format, GLenum type, GLsizei bufSize, GLvoid * table); /* 627 */
+ void (GLAPIENTRYP GetnCompressedTexImageARB)(GLenum target, GLint lod, GLsizei bufSize, GLvoid * img); /* 628 */
+ void (GLAPIENTRYP GetnConvolutionFilterARB)(GLenum target, GLenum format, GLenum type, GLsizei bufSize, GLvoid * image); /* 629 */
+ void (GLAPIENTRYP GetnHistogramARB)(GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, GLvoid * values); /* 630 */
+ void (GLAPIENTRYP GetnMapdvARB)(GLenum target, GLenum query, GLsizei bufSize, GLdouble * v); /* 631 */
+ void (GLAPIENTRYP GetnMapfvARB)(GLenum target, GLenum query, GLsizei bufSize, GLfloat * v); /* 632 */
+ void (GLAPIENTRYP GetnMapivARB)(GLenum target, GLenum query, GLsizei bufSize, GLint * v); /* 633 */
+ void (GLAPIENTRYP GetnMinmaxARB)(GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, GLvoid * values); /* 634 */
+ void (GLAPIENTRYP GetnPixelMapfvARB)(GLenum map, GLsizei bufSize, GLfloat * values); /* 635 */
+ void (GLAPIENTRYP GetnPixelMapuivARB)(GLenum map, GLsizei bufSize, GLuint * values); /* 636 */
+ void (GLAPIENTRYP GetnPixelMapusvARB)(GLenum map, GLsizei bufSize, GLushort * values); /* 637 */
+ void (GLAPIENTRYP GetnPolygonStippleARB)(GLsizei bufSize, GLubyte * pattern); /* 638 */
+ void (GLAPIENTRYP GetnSeparableFilterARB)(GLenum target, GLenum format, GLenum type, GLsizei rowBufSize, GLvoid * row, GLsizei columnBufSize, GLvoid * column, GLvoid * span); /* 639 */
+ void (GLAPIENTRYP GetnTexImageARB)(GLenum target, GLint level, GLenum format, GLenum type, GLsizei bufSize, GLvoid * img); /* 640 */
+ void (GLAPIENTRYP GetnUniformdvARB)(GLhandleARB program, GLint location, GLsizei bufSize, GLdouble * params); /* 641 */
+ void (GLAPIENTRYP GetnUniformfvARB)(GLhandleARB program, GLint location, GLsizei bufSize, GLfloat * params); /* 642 */
+ void (GLAPIENTRYP GetnUniformivARB)(GLhandleARB program, GLint location, GLsizei bufSize, GLint * params); /* 643 */
+ void (GLAPIENTRYP GetnUniformuivARB)(GLhandleARB program, GLint location, GLsizei bufSize, GLuint * params); /* 644 */
+ void (GLAPIENTRYP ReadnPixelsARB)(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, GLvoid * data); /* 645 */
+ void (GLAPIENTRYP PolygonOffsetEXT)(GLfloat factor, GLfloat bias); /* 646 */
+ void (GLAPIENTRYP GetPixelTexGenParameterfvSGIS)(GLenum pname, GLfloat * params); /* 647 */
+ void (GLAPIENTRYP GetPixelTexGenParameterivSGIS)(GLenum pname, GLint * params); /* 648 */
+ void (GLAPIENTRYP PixelTexGenParameterfSGIS)(GLenum pname, GLfloat param); /* 649 */
+ void (GLAPIENTRYP PixelTexGenParameterfvSGIS)(GLenum pname, const GLfloat * params); /* 650 */
+ void (GLAPIENTRYP PixelTexGenParameteriSGIS)(GLenum pname, GLint param); /* 651 */
+ void (GLAPIENTRYP PixelTexGenParameterivSGIS)(GLenum pname, const GLint * params); /* 652 */
+ void (GLAPIENTRYP SampleMaskSGIS)(GLclampf value, GLboolean invert); /* 653 */
+ void (GLAPIENTRYP SamplePatternSGIS)(GLenum pattern); /* 654 */
+ void (GLAPIENTRYP ColorPointerEXT)(GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer); /* 655 */
+ void (GLAPIENTRYP EdgeFlagPointerEXT)(GLsizei stride, GLsizei count, const GLboolean * pointer); /* 656 */
+ void (GLAPIENTRYP IndexPointerEXT)(GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer); /* 657 */
+ void (GLAPIENTRYP NormalPointerEXT)(GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer); /* 658 */
+ void (GLAPIENTRYP TexCoordPointerEXT)(GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer); /* 659 */
+ void (GLAPIENTRYP VertexPointerEXT)(GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer); /* 660 */
+ void (GLAPIENTRYP PointParameterfEXT)(GLenum pname, GLfloat param); /* 661 */
+ void (GLAPIENTRYP PointParameterfvEXT)(GLenum pname, const GLfloat * params); /* 662 */
+ void (GLAPIENTRYP LockArraysEXT)(GLint first, GLsizei count); /* 663 */
+ void (GLAPIENTRYP UnlockArraysEXT)(void); /* 664 */
+ void (GLAPIENTRYP SecondaryColor3bEXT)(GLbyte red, GLbyte green, GLbyte blue); /* 665 */
+ void (GLAPIENTRYP SecondaryColor3bvEXT)(const GLbyte * v); /* 666 */
+ void (GLAPIENTRYP SecondaryColor3dEXT)(GLdouble red, GLdouble green, GLdouble blue); /* 667 */
+ void (GLAPIENTRYP SecondaryColor3dvEXT)(const GLdouble * v); /* 668 */
+ void (GLAPIENTRYP SecondaryColor3fEXT)(GLfloat red, GLfloat green, GLfloat blue); /* 669 */
+ void (GLAPIENTRYP SecondaryColor3fvEXT)(const GLfloat * v); /* 670 */
+ void (GLAPIENTRYP SecondaryColor3iEXT)(GLint red, GLint green, GLint blue); /* 671 */
+ void (GLAPIENTRYP SecondaryColor3ivEXT)(const GLint * v); /* 672 */
+ void (GLAPIENTRYP SecondaryColor3sEXT)(GLshort red, GLshort green, GLshort blue); /* 673 */
+ void (GLAPIENTRYP SecondaryColor3svEXT)(const GLshort * v); /* 674 */
+ void (GLAPIENTRYP SecondaryColor3ubEXT)(GLubyte red, GLubyte green, GLubyte blue); /* 675 */
+ void (GLAPIENTRYP SecondaryColor3ubvEXT)(const GLubyte * v); /* 676 */
+ void (GLAPIENTRYP SecondaryColor3uiEXT)(GLuint red, GLuint green, GLuint blue); /* 677 */
+ void (GLAPIENTRYP SecondaryColor3uivEXT)(const GLuint * v); /* 678 */
+ void (GLAPIENTRYP SecondaryColor3usEXT)(GLushort red, GLushort green, GLushort blue); /* 679 */
+ void (GLAPIENTRYP SecondaryColor3usvEXT)(const GLushort * v); /* 680 */
+ void (GLAPIENTRYP SecondaryColorPointerEXT)(GLint size, GLenum type, GLsizei stride, const GLvoid * pointer); /* 681 */
+ void (GLAPIENTRYP MultiDrawArraysEXT)(GLenum mode, const GLint * first, const GLsizei * count, GLsizei primcount); /* 682 */
+ void (GLAPIENTRYP MultiDrawElementsEXT)(GLenum mode, const GLsizei * count, GLenum type, const GLvoid ** indices, GLsizei primcount); /* 683 */
+ void (GLAPIENTRYP FogCoordPointerEXT)(GLenum type, GLsizei stride, const GLvoid * pointer); /* 684 */
+ void (GLAPIENTRYP FogCoorddEXT)(GLdouble coord); /* 685 */
+ void (GLAPIENTRYP FogCoorddvEXT)(const GLdouble * coord); /* 686 */
+ void (GLAPIENTRYP FogCoordfEXT)(GLfloat coord); /* 687 */
+ void (GLAPIENTRYP FogCoordfvEXT)(const GLfloat * coord); /* 688 */
+ void (GLAPIENTRYP PixelTexGenSGIX)(GLenum mode); /* 689 */
+ void (GLAPIENTRYP BlendFuncSeparateEXT)(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); /* 690 */
+ void (GLAPIENTRYP FlushVertexArrayRangeNV)(void); /* 691 */
+ void (GLAPIENTRYP VertexArrayRangeNV)(GLsizei length, const GLvoid * pointer); /* 692 */
+ void (GLAPIENTRYP CombinerInputNV)(GLenum stage, GLenum portion, GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage); /* 693 */
+ void (GLAPIENTRYP CombinerOutputNV)(GLenum stage, GLenum portion, GLenum abOutput, GLenum cdOutput, GLenum sumOutput, GLenum scale, GLenum bias, GLboolean abDotProduct, GLboolean cdDotProduct, GLboolean muxSum); /* 694 */
+ void (GLAPIENTRYP CombinerParameterfNV)(GLenum pname, GLfloat param); /* 695 */
+ void (GLAPIENTRYP CombinerParameterfvNV)(GLenum pname, const GLfloat * params); /* 696 */
+ void (GLAPIENTRYP CombinerParameteriNV)(GLenum pname, GLint param); /* 697 */
+ void (GLAPIENTRYP CombinerParameterivNV)(GLenum pname, const GLint * params); /* 698 */
+ void (GLAPIENTRYP FinalCombinerInputNV)(GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage); /* 699 */
+ void (GLAPIENTRYP GetCombinerInputParameterfvNV)(GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLfloat * params); /* 700 */
+ void (GLAPIENTRYP GetCombinerInputParameterivNV)(GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLint * params); /* 701 */
+ void (GLAPIENTRYP GetCombinerOutputParameterfvNV)(GLenum stage, GLenum portion, GLenum pname, GLfloat * params); /* 702 */
+ void (GLAPIENTRYP GetCombinerOutputParameterivNV)(GLenum stage, GLenum portion, GLenum pname, GLint * params); /* 703 */
+ void (GLAPIENTRYP GetFinalCombinerInputParameterfvNV)(GLenum variable, GLenum pname, GLfloat * params); /* 704 */
+ void (GLAPIENTRYP GetFinalCombinerInputParameterivNV)(GLenum variable, GLenum pname, GLint * params); /* 705 */
+ void (GLAPIENTRYP ResizeBuffersMESA)(void); /* 706 */
+ void (GLAPIENTRYP WindowPos2dMESA)(GLdouble x, GLdouble y); /* 707 */
+ void (GLAPIENTRYP WindowPos2dvMESA)(const GLdouble * v); /* 708 */
+ void (GLAPIENTRYP WindowPos2fMESA)(GLfloat x, GLfloat y); /* 709 */
+ void (GLAPIENTRYP WindowPos2fvMESA)(const GLfloat * v); /* 710 */
+ void (GLAPIENTRYP WindowPos2iMESA)(GLint x, GLint y); /* 711 */
+ void (GLAPIENTRYP WindowPos2ivMESA)(const GLint * v); /* 712 */
+ void (GLAPIENTRYP WindowPos2sMESA)(GLshort x, GLshort y); /* 713 */
+ void (GLAPIENTRYP WindowPos2svMESA)(const GLshort * v); /* 714 */
+ void (GLAPIENTRYP WindowPos3dMESA)(GLdouble x, GLdouble y, GLdouble z); /* 715 */
+ void (GLAPIENTRYP WindowPos3dvMESA)(const GLdouble * v); /* 716 */
+ void (GLAPIENTRYP WindowPos3fMESA)(GLfloat x, GLfloat y, GLfloat z); /* 717 */
+ void (GLAPIENTRYP WindowPos3fvMESA)(const GLfloat * v); /* 718 */
+ void (GLAPIENTRYP WindowPos3iMESA)(GLint x, GLint y, GLint z); /* 719 */
+ void (GLAPIENTRYP WindowPos3ivMESA)(const GLint * v); /* 720 */
+ void (GLAPIENTRYP WindowPos3sMESA)(GLshort x, GLshort y, GLshort z); /* 721 */
+ void (GLAPIENTRYP WindowPos3svMESA)(const GLshort * v); /* 722 */
+ void (GLAPIENTRYP WindowPos4dMESA)(GLdouble x, GLdouble y, GLdouble z, GLdouble w); /* 723 */
+ void (GLAPIENTRYP WindowPos4dvMESA)(const GLdouble * v); /* 724 */
+ void (GLAPIENTRYP WindowPos4fMESA)(GLfloat x, GLfloat y, GLfloat z, GLfloat w); /* 725 */
+ void (GLAPIENTRYP WindowPos4fvMESA)(const GLfloat * v); /* 726 */
+ void (GLAPIENTRYP WindowPos4iMESA)(GLint x, GLint y, GLint z, GLint w); /* 727 */
+ void (GLAPIENTRYP WindowPos4ivMESA)(const GLint * v); /* 728 */
+ void (GLAPIENTRYP WindowPos4sMESA)(GLshort x, GLshort y, GLshort z, GLshort w); /* 729 */
+ void (GLAPIENTRYP WindowPos4svMESA)(const GLshort * v); /* 730 */
+ void (GLAPIENTRYP MultiModeDrawArraysIBM)(const GLenum * mode, const GLint * first, const GLsizei * count, GLsizei primcount, GLint modestride); /* 731 */
+ void (GLAPIENTRYP MultiModeDrawElementsIBM)(const GLenum * mode, const GLsizei * count, GLenum type, const GLvoid * const * indices, GLsizei primcount, GLint modestride); /* 732 */
+ void (GLAPIENTRYP DeleteFencesNV)(GLsizei n, const GLuint * fences); /* 733 */
+ void (GLAPIENTRYP FinishFenceNV)(GLuint fence); /* 734 */
+ void (GLAPIENTRYP GenFencesNV)(GLsizei n, GLuint * fences); /* 735 */
+ void (GLAPIENTRYP GetFenceivNV)(GLuint fence, GLenum pname, GLint * params); /* 736 */
+ GLboolean (GLAPIENTRYP IsFenceNV)(GLuint fence); /* 737 */
+ void (GLAPIENTRYP SetFenceNV)(GLuint fence, GLenum condition); /* 738 */
+ GLboolean (GLAPIENTRYP TestFenceNV)(GLuint fence); /* 739 */
+ GLboolean (GLAPIENTRYP AreProgramsResidentNV)(GLsizei n, const GLuint * ids, GLboolean * residences); /* 740 */
+ void (GLAPIENTRYP BindProgramNV)(GLenum target, GLuint program); /* 741 */
+ void (GLAPIENTRYP DeleteProgramsNV)(GLsizei n, const GLuint * programs); /* 742 */
+ void (GLAPIENTRYP ExecuteProgramNV)(GLenum target, GLuint id, const GLfloat * params); /* 743 */
+ void (GLAPIENTRYP GenProgramsNV)(GLsizei n, GLuint * programs); /* 744 */
+ void (GLAPIENTRYP GetProgramParameterdvNV)(GLenum target, GLuint index, GLenum pname, GLdouble * params); /* 745 */
+ void (GLAPIENTRYP GetProgramParameterfvNV)(GLenum target, GLuint index, GLenum pname, GLfloat * params); /* 746 */
+ void (GLAPIENTRYP GetProgramStringNV)(GLuint id, GLenum pname, GLubyte * program); /* 747 */
+ void (GLAPIENTRYP GetProgramivNV)(GLuint id, GLenum pname, GLint * params); /* 748 */
+ void (GLAPIENTRYP GetTrackMatrixivNV)(GLenum target, GLuint address, GLenum pname, GLint * params); /* 749 */
+ void (GLAPIENTRYP GetVertexAttribPointervNV)(GLuint index, GLenum pname, GLvoid ** pointer); /* 750 */
+ void (GLAPIENTRYP GetVertexAttribdvNV)(GLuint index, GLenum pname, GLdouble * params); /* 751 */
+ void (GLAPIENTRYP GetVertexAttribfvNV)(GLuint index, GLenum pname, GLfloat * params); /* 752 */
+ void (GLAPIENTRYP GetVertexAttribivNV)(GLuint index, GLenum pname, GLint * params); /* 753 */
+ GLboolean (GLAPIENTRYP IsProgramNV)(GLuint program); /* 754 */
+ void (GLAPIENTRYP LoadProgramNV)(GLenum target, GLuint id, GLsizei len, const GLubyte * program); /* 755 */
+ void (GLAPIENTRYP ProgramParameters4dvNV)(GLenum target, GLuint index, GLsizei num, const GLdouble * params); /* 756 */
+ void (GLAPIENTRYP ProgramParameters4fvNV)(GLenum target, GLuint index, GLsizei num, const GLfloat * params); /* 757 */
+ void (GLAPIENTRYP RequestResidentProgramsNV)(GLsizei n, const GLuint * ids); /* 758 */
+ void (GLAPIENTRYP TrackMatrixNV)(GLenum target, GLuint address, GLenum matrix, GLenum transform); /* 759 */
+ void (GLAPIENTRYP VertexAttrib1dNV)(GLuint index, GLdouble x); /* 760 */
+ void (GLAPIENTRYP VertexAttrib1dvNV)(GLuint index, const GLdouble * v); /* 761 */
+ void (GLAPIENTRYP VertexAttrib1fNV)(GLuint index, GLfloat x); /* 762 */
+ void (GLAPIENTRYP VertexAttrib1fvNV)(GLuint index, const GLfloat * v); /* 763 */
+ void (GLAPIENTRYP VertexAttrib1sNV)(GLuint index, GLshort x); /* 764 */
+ void (GLAPIENTRYP VertexAttrib1svNV)(GLuint index, const GLshort * v); /* 765 */
+ void (GLAPIENTRYP VertexAttrib2dNV)(GLuint index, GLdouble x, GLdouble y); /* 766 */
+ void (GLAPIENTRYP VertexAttrib2dvNV)(GLuint index, const GLdouble * v); /* 767 */
+ void (GLAPIENTRYP VertexAttrib2fNV)(GLuint index, GLfloat x, GLfloat y); /* 768 */
+ void (GLAPIENTRYP VertexAttrib2fvNV)(GLuint index, const GLfloat * v); /* 769 */
+ void (GLAPIENTRYP VertexAttrib2sNV)(GLuint index, GLshort x, GLshort y); /* 770 */
+ void (GLAPIENTRYP VertexAttrib2svNV)(GLuint index, const GLshort * v); /* 771 */
+ void (GLAPIENTRYP VertexAttrib3dNV)(GLuint index, GLdouble x, GLdouble y, GLdouble z); /* 772 */
+ void (GLAPIENTRYP VertexAttrib3dvNV)(GLuint index, const GLdouble * v); /* 773 */
+ void (GLAPIENTRYP VertexAttrib3fNV)(GLuint index, GLfloat x, GLfloat y, GLfloat z); /* 774 */
+ void (GLAPIENTRYP VertexAttrib3fvNV)(GLuint index, const GLfloat * v); /* 775 */
+ void (GLAPIENTRYP VertexAttrib3sNV)(GLuint index, GLshort x, GLshort y, GLshort z); /* 776 */
+ void (GLAPIENTRYP VertexAttrib3svNV)(GLuint index, const GLshort * v); /* 777 */
+ void (GLAPIENTRYP VertexAttrib4dNV)(GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); /* 778 */
+ void (GLAPIENTRYP VertexAttrib4dvNV)(GLuint index, const GLdouble * v); /* 779 */
+ void (GLAPIENTRYP VertexAttrib4fNV)(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); /* 780 */
+ void (GLAPIENTRYP VertexAttrib4fvNV)(GLuint index, const GLfloat * v); /* 781 */
+ void (GLAPIENTRYP VertexAttrib4sNV)(GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); /* 782 */
+ void (GLAPIENTRYP VertexAttrib4svNV)(GLuint index, const GLshort * v); /* 783 */
+ void (GLAPIENTRYP VertexAttrib4ubNV)(GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); /* 784 */
+ void (GLAPIENTRYP VertexAttrib4ubvNV)(GLuint index, const GLubyte * v); /* 785 */
+ void (GLAPIENTRYP VertexAttribPointerNV)(GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid * pointer); /* 786 */
+ void (GLAPIENTRYP VertexAttribs1dvNV)(GLuint index, GLsizei n, const GLdouble * v); /* 787 */
+ void (GLAPIENTRYP VertexAttribs1fvNV)(GLuint index, GLsizei n, const GLfloat * v); /* 788 */
+ void (GLAPIENTRYP VertexAttribs1svNV)(GLuint index, GLsizei n, const GLshort * v); /* 789 */
+ void (GLAPIENTRYP VertexAttribs2dvNV)(GLuint index, GLsizei n, const GLdouble * v); /* 790 */
+ void (GLAPIENTRYP VertexAttribs2fvNV)(GLuint index, GLsizei n, const GLfloat * v); /* 791 */
+ void (GLAPIENTRYP VertexAttribs2svNV)(GLuint index, GLsizei n, const GLshort * v); /* 792 */
+ void (GLAPIENTRYP VertexAttribs3dvNV)(GLuint index, GLsizei n, const GLdouble * v); /* 793 */
+ void (GLAPIENTRYP VertexAttribs3fvNV)(GLuint index, GLsizei n, const GLfloat * v); /* 794 */
+ void (GLAPIENTRYP VertexAttribs3svNV)(GLuint index, GLsizei n, const GLshort * v); /* 795 */
+ void (GLAPIENTRYP VertexAttribs4dvNV)(GLuint index, GLsizei n, const GLdouble * v); /* 796 */
+ void (GLAPIENTRYP VertexAttribs4fvNV)(GLuint index, GLsizei n, const GLfloat * v); /* 797 */
+ void (GLAPIENTRYP VertexAttribs4svNV)(GLuint index, GLsizei n, const GLshort * v); /* 798 */
+ void (GLAPIENTRYP VertexAttribs4ubvNV)(GLuint index, GLsizei n, const GLubyte * v); /* 799 */
+ void (GLAPIENTRYP GetTexBumpParameterfvATI)(GLenum pname, GLfloat * param); /* 800 */
+ void (GLAPIENTRYP GetTexBumpParameterivATI)(GLenum pname, GLint * param); /* 801 */
+ void (GLAPIENTRYP TexBumpParameterfvATI)(GLenum pname, const GLfloat * param); /* 802 */
+ void (GLAPIENTRYP TexBumpParameterivATI)(GLenum pname, const GLint * param); /* 803 */
+ void (GLAPIENTRYP AlphaFragmentOp1ATI)(GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod); /* 804 */
+ void (GLAPIENTRYP AlphaFragmentOp2ATI)(GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod); /* 805 */
+ void (GLAPIENTRYP AlphaFragmentOp3ATI)(GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod); /* 806 */
+ void (GLAPIENTRYP BeginFragmentShaderATI)(void); /* 807 */
+ void (GLAPIENTRYP BindFragmentShaderATI)(GLuint id); /* 808 */
+ void (GLAPIENTRYP ColorFragmentOp1ATI)(GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod); /* 809 */
+ void (GLAPIENTRYP ColorFragmentOp2ATI)(GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod); /* 810 */
+ void (GLAPIENTRYP ColorFragmentOp3ATI)(GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod); /* 811 */
+ void (GLAPIENTRYP DeleteFragmentShaderATI)(GLuint id); /* 812 */
+ void (GLAPIENTRYP EndFragmentShaderATI)(void); /* 813 */
+ GLuint (GLAPIENTRYP GenFragmentShadersATI)(GLuint range); /* 814 */
+ void (GLAPIENTRYP PassTexCoordATI)(GLuint dst, GLuint coord, GLenum swizzle); /* 815 */
+ void (GLAPIENTRYP SampleMapATI)(GLuint dst, GLuint interp, GLenum swizzle); /* 816 */
+ void (GLAPIENTRYP SetFragmentShaderConstantATI)(GLuint dst, const GLfloat * value); /* 817 */
+ void (GLAPIENTRYP PointParameteriNV)(GLenum pname, GLint param); /* 818 */
+ void (GLAPIENTRYP PointParameterivNV)(GLenum pname, const GLint * params); /* 819 */
+ void (GLAPIENTRYP ActiveStencilFaceEXT)(GLenum face); /* 820 */
+ void (GLAPIENTRYP BindVertexArrayAPPLE)(GLuint array); /* 821 */
+ void (GLAPIENTRYP DeleteVertexArraysAPPLE)(GLsizei n, const GLuint * arrays); /* 822 */
+ void (GLAPIENTRYP GenVertexArraysAPPLE)(GLsizei n, GLuint * arrays); /* 823 */
+ GLboolean (GLAPIENTRYP IsVertexArrayAPPLE)(GLuint array); /* 824 */
+ void (GLAPIENTRYP GetProgramNamedParameterdvNV)(GLuint id, GLsizei len, const GLubyte * name, GLdouble * params); /* 825 */
+ void (GLAPIENTRYP GetProgramNamedParameterfvNV)(GLuint id, GLsizei len, const GLubyte * name, GLfloat * params); /* 826 */
+ void (GLAPIENTRYP ProgramNamedParameter4dNV)(GLuint id, GLsizei len, const GLubyte * name, GLdouble x, GLdouble y, GLdouble z, GLdouble w); /* 827 */
+ void (GLAPIENTRYP ProgramNamedParameter4dvNV)(GLuint id, GLsizei len, const GLubyte * name, const GLdouble * v); /* 828 */
+ void (GLAPIENTRYP ProgramNamedParameter4fNV)(GLuint id, GLsizei len, const GLubyte * name, GLfloat x, GLfloat y, GLfloat z, GLfloat w); /* 829 */
+ void (GLAPIENTRYP ProgramNamedParameter4fvNV)(GLuint id, GLsizei len, const GLubyte * name, const GLfloat * v); /* 830 */
+ void (GLAPIENTRYP PrimitiveRestartIndexNV)(GLuint index); /* 831 */
+ void (GLAPIENTRYP PrimitiveRestartNV)(void); /* 832 */
+ void (GLAPIENTRYP DepthBoundsEXT)(GLclampd zmin, GLclampd zmax); /* 833 */
+ void (GLAPIENTRYP BlendEquationSeparateEXT)(GLenum modeRGB, GLenum modeA); /* 834 */
+ void (GLAPIENTRYP BindFramebufferEXT)(GLenum target, GLuint framebuffer); /* 835 */
+ void (GLAPIENTRYP BindRenderbufferEXT)(GLenum target, GLuint renderbuffer); /* 836 */
+ GLenum (GLAPIENTRYP CheckFramebufferStatusEXT)(GLenum target); /* 837 */
+ void (GLAPIENTRYP DeleteFramebuffersEXT)(GLsizei n, const GLuint * framebuffers); /* 838 */
+ void (GLAPIENTRYP DeleteRenderbuffersEXT)(GLsizei n, const GLuint * renderbuffers); /* 839 */
+ void (GLAPIENTRYP FramebufferRenderbufferEXT)(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); /* 840 */
+ void (GLAPIENTRYP FramebufferTexture1DEXT)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); /* 841 */
+ void (GLAPIENTRYP FramebufferTexture2DEXT)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); /* 842 */
+ void (GLAPIENTRYP FramebufferTexture3DEXT)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); /* 843 */
+ void (GLAPIENTRYP GenFramebuffersEXT)(GLsizei n, GLuint * framebuffers); /* 844 */
+ void (GLAPIENTRYP GenRenderbuffersEXT)(GLsizei n, GLuint * renderbuffers); /* 845 */
+ void (GLAPIENTRYP GenerateMipmapEXT)(GLenum target); /* 846 */
+ void (GLAPIENTRYP GetFramebufferAttachmentParameterivEXT)(GLenum target, GLenum attachment, GLenum pname, GLint * params); /* 847 */
+ void (GLAPIENTRYP GetRenderbufferParameterivEXT)(GLenum target, GLenum pname, GLint * params); /* 848 */
+ GLboolean (GLAPIENTRYP IsFramebufferEXT)(GLuint framebuffer); /* 849 */
+ GLboolean (GLAPIENTRYP IsRenderbufferEXT)(GLuint renderbuffer); /* 850 */
+ void (GLAPIENTRYP RenderbufferStorageEXT)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height); /* 851 */
+ void (GLAPIENTRYP BlitFramebufferEXT)(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); /* 852 */
+ void (GLAPIENTRYP BufferParameteriAPPLE)(GLenum target, GLenum pname, GLint param); /* 853 */
+ void (GLAPIENTRYP FlushMappedBufferRangeAPPLE)(GLenum target, GLintptr offset, GLsizeiptr size); /* 854 */
+ void (GLAPIENTRYP BindFragDataLocationEXT)(GLuint program, GLuint colorNumber, const GLchar * name); /* 855 */
+ GLint (GLAPIENTRYP GetFragDataLocationEXT)(GLuint program, const GLchar * name); /* 856 */
+ void (GLAPIENTRYP GetUniformuivEXT)(GLuint program, GLint location, GLuint * params); /* 857 */
+ void (GLAPIENTRYP GetVertexAttribIivEXT)(GLuint index, GLenum pname, GLint * params); /* 858 */
+ void (GLAPIENTRYP GetVertexAttribIuivEXT)(GLuint index, GLenum pname, GLuint * params); /* 859 */
+ void (GLAPIENTRYP Uniform1uiEXT)(GLint location, GLuint x); /* 860 */
+ void (GLAPIENTRYP Uniform1uivEXT)(GLint location, GLsizei count, const GLuint * value); /* 861 */
+ void (GLAPIENTRYP Uniform2uiEXT)(GLint location, GLuint x, GLuint y); /* 862 */
+ void (GLAPIENTRYP Uniform2uivEXT)(GLint location, GLsizei count, const GLuint * value); /* 863 */
+ void (GLAPIENTRYP Uniform3uiEXT)(GLint location, GLuint x, GLuint y, GLuint z); /* 864 */
+ void (GLAPIENTRYP Uniform3uivEXT)(GLint location, GLsizei count, const GLuint * value); /* 865 */
+ void (GLAPIENTRYP Uniform4uiEXT)(GLint location, GLuint x, GLuint y, GLuint z, GLuint w); /* 866 */
+ void (GLAPIENTRYP Uniform4uivEXT)(GLint location, GLsizei count, const GLuint * value); /* 867 */
+ void (GLAPIENTRYP VertexAttribI1iEXT)(GLuint index, GLint x); /* 868 */
+ void (GLAPIENTRYP VertexAttribI1ivEXT)(GLuint index, const GLint * v); /* 869 */
+ void (GLAPIENTRYP VertexAttribI1uiEXT)(GLuint index, GLuint x); /* 870 */
+ void (GLAPIENTRYP VertexAttribI1uivEXT)(GLuint index, const GLuint * v); /* 871 */
+ void (GLAPIENTRYP VertexAttribI2iEXT)(GLuint index, GLint x, GLint y); /* 872 */
+ void (GLAPIENTRYP VertexAttribI2ivEXT)(GLuint index, const GLint * v); /* 873 */
+ void (GLAPIENTRYP VertexAttribI2uiEXT)(GLuint index, GLuint x, GLuint y); /* 874 */
+ void (GLAPIENTRYP VertexAttribI2uivEXT)(GLuint index, const GLuint * v); /* 875 */
+ void (GLAPIENTRYP VertexAttribI3iEXT)(GLuint index, GLint x, GLint y, GLint z); /* 876 */
+ void (GLAPIENTRYP VertexAttribI3ivEXT)(GLuint index, const GLint * v); /* 877 */
+ void (GLAPIENTRYP VertexAttribI3uiEXT)(GLuint index, GLuint x, GLuint y, GLuint z); /* 878 */
+ void (GLAPIENTRYP VertexAttribI3uivEXT)(GLuint index, const GLuint * v); /* 879 */
+ void (GLAPIENTRYP VertexAttribI4bvEXT)(GLuint index, const GLbyte * v); /* 880 */
+ void (GLAPIENTRYP VertexAttribI4iEXT)(GLuint index, GLint x, GLint y, GLint z, GLint w); /* 881 */
+ void (GLAPIENTRYP VertexAttribI4ivEXT)(GLuint index, const GLint * v); /* 882 */
+ void (GLAPIENTRYP VertexAttribI4svEXT)(GLuint index, const GLshort * v); /* 883 */
+ void (GLAPIENTRYP VertexAttribI4ubvEXT)(GLuint index, const GLubyte * v); /* 884 */
+ void (GLAPIENTRYP VertexAttribI4uiEXT)(GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); /* 885 */
+ void (GLAPIENTRYP VertexAttribI4uivEXT)(GLuint index, const GLuint * v); /* 886 */
+ void (GLAPIENTRYP VertexAttribI4usvEXT)(GLuint index, const GLushort * v); /* 887 */
+ void (GLAPIENTRYP VertexAttribIPointerEXT)(GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid * pointer); /* 888 */
+ void (GLAPIENTRYP FramebufferTextureLayerEXT)(GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer); /* 889 */
+ void (GLAPIENTRYP ColorMaskIndexedEXT)(GLuint buf, GLboolean r, GLboolean g, GLboolean b, GLboolean a); /* 890 */
+ void (GLAPIENTRYP DisableIndexedEXT)(GLenum target, GLuint index); /* 891 */
+ void (GLAPIENTRYP EnableIndexedEXT)(GLenum target, GLuint index); /* 892 */
+ void (GLAPIENTRYP GetBooleanIndexedvEXT)(GLenum value, GLuint index, GLboolean * data); /* 893 */
+ void (GLAPIENTRYP GetIntegerIndexedvEXT)(GLenum value, GLuint index, GLint * data); /* 894 */
+ GLboolean (GLAPIENTRYP IsEnabledIndexedEXT)(GLenum target, GLuint index); /* 895 */
+ void (GLAPIENTRYP ClearColorIiEXT)(GLint r, GLint g, GLint b, GLint a); /* 896 */
+ void (GLAPIENTRYP ClearColorIuiEXT)(GLuint r, GLuint g, GLuint b, GLuint a); /* 897 */
+ void (GLAPIENTRYP GetTexParameterIivEXT)(GLenum target, GLenum pname, GLint * params); /* 898 */
+ void (GLAPIENTRYP GetTexParameterIuivEXT)(GLenum target, GLenum pname, GLuint * params); /* 899 */
+ void (GLAPIENTRYP TexParameterIivEXT)(GLenum target, GLenum pname, const GLint * params); /* 900 */
+ void (GLAPIENTRYP TexParameterIuivEXT)(GLenum target, GLenum pname, const GLuint * params); /* 901 */
+ void (GLAPIENTRYP BeginConditionalRenderNV)(GLuint query, GLenum mode); /* 902 */
+ void (GLAPIENTRYP EndConditionalRenderNV)(void); /* 903 */
+ void (GLAPIENTRYP BeginTransformFeedbackEXT)(GLenum mode); /* 904 */
+ void (GLAPIENTRYP BindBufferBaseEXT)(GLenum target, GLuint index, GLuint buffer); /* 905 */
+ void (GLAPIENTRYP BindBufferOffsetEXT)(GLenum target, GLuint index, GLuint buffer, GLintptr offset); /* 906 */
+ void (GLAPIENTRYP BindBufferRangeEXT)(GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); /* 907 */
+ void (GLAPIENTRYP EndTransformFeedbackEXT)(void); /* 908 */
+ void (GLAPIENTRYP GetTransformFeedbackVaryingEXT)(GLuint program, GLuint index, GLsizei bufSize, GLsizei * length, GLsizei * size, GLenum * type, GLchar * name); /* 909 */
+ void (GLAPIENTRYP TransformFeedbackVaryingsEXT)(GLuint program, GLsizei count, const char ** varyings, GLenum bufferMode); /* 910 */
+ void (GLAPIENTRYP ProvokingVertexEXT)(GLenum mode); /* 911 */
+ void (GLAPIENTRYP GetTexParameterPointervAPPLE)(GLenum target, GLenum pname, GLvoid ** params); /* 912 */
+ void (GLAPIENTRYP TextureRangeAPPLE)(GLenum target, GLsizei length, GLvoid * pointer); /* 913 */
+ void (GLAPIENTRYP GetObjectParameterivAPPLE)(GLenum objectType, GLuint name, GLenum pname, GLint * value); /* 914 */
+ GLenum (GLAPIENTRYP ObjectPurgeableAPPLE)(GLenum objectType, GLuint name, GLenum option); /* 915 */
+ GLenum (GLAPIENTRYP ObjectUnpurgeableAPPLE)(GLenum objectType, GLuint name, GLenum option); /* 916 */
+ void (GLAPIENTRYP ActiveProgramEXT)(GLuint program); /* 917 */
+ GLuint (GLAPIENTRYP CreateShaderProgramEXT)(GLenum type, const GLchar * string); /* 918 */
+ void (GLAPIENTRYP UseShaderProgramEXT)(GLenum type, GLuint program); /* 919 */
+ void (GLAPIENTRYP TextureBarrierNV)(void); /* 920 */
+ void (GLAPIENTRYP StencilFuncSeparateATI)(GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask); /* 921 */
+ void (GLAPIENTRYP ProgramEnvParameters4fvEXT)(GLenum target, GLuint index, GLsizei count, const GLfloat * params); /* 922 */
+ void (GLAPIENTRYP ProgramLocalParameters4fvEXT)(GLenum target, GLuint index, GLsizei count, const GLfloat * params); /* 923 */
+ void (GLAPIENTRYP GetQueryObjecti64vEXT)(GLuint id, GLenum pname, GLint64EXT * params); /* 924 */
+ void (GLAPIENTRYP GetQueryObjectui64vEXT)(GLuint id, GLenum pname, GLuint64EXT * params); /* 925 */
+ void (GLAPIENTRYP EGLImageTargetRenderbufferStorageOES)(GLenum target, GLvoid * writeOffset); /* 926 */
+ void (GLAPIENTRYP EGLImageTargetTexture2DOES)(GLenum target, GLvoid * writeOffset); /* 927 */
+};
+
+#endif /* !defined( _GLAPI_TABLE_H_ ) */
diff --git a/mesalib/src/mapi/glapi/glapitemp.h b/mesalib/src/mapi/glapi/glapitemp.h
index c0ed1731c..5c1024fa7 100644
--- a/mesalib/src/mapi/glapi/glapitemp.h
+++ b/mesalib/src/mapi/glapi/glapitemp.h
@@ -1,8112 +1,8112 @@
-/* DO NOT EDIT - This file generated automatically by gl_apitemp.py (from Mesa) script */
-
-/*
- * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
- * (C) Copyright IBM Corporation 2004
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sub license,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL, IBM,
- * AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
- * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-
-# if (defined(__GNUC__) && !defined(__CYGWIN__) && !defined(__MINGW32__)) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590) && defined(__ELF__))
-# define HIDDEN __attribute__((visibility("hidden")))
-# else
-# define HIDDEN
-# endif
-
-/*
- * This file is a template which generates the OpenGL API entry point
- * functions. It should be included by a .c file which first defines
- * the following macros:
- * KEYWORD1 - usually nothing, but might be __declspec(dllexport) on Win32
- * KEYWORD2 - usually nothing, but might be __stdcall on Win32
- * NAME(n) - builds the final function name (usually add "gl" prefix)
- * DISPATCH(func, args, msg) - code to do dispatch of named function.
- * msg is a printf-style debug message.
- * RETURN_DISPATCH(func, args, msg) - code to do dispatch with a return value
- *
- * Here is an example which generates the usual OpenGL functions:
- * #define KEYWORD1
- * #define KEYWORD2
- * #define NAME(func) gl##func
- * #define DISPATCH(func, args, msg) \
- * struct _glapi_table *dispatch = CurrentDispatch; \
- * (*dispatch->func) args
- * #define RETURN DISPATCH(func, args, msg) \
- * struct _glapi_table *dispatch = CurrentDispatch; \
- * return (*dispatch->func) args
- *
- */
-
-
-#if defined( NAME )
-#ifndef KEYWORD1
-#define KEYWORD1
-#endif
-
-#ifndef KEYWORD1_ALT
-#define KEYWORD1_ALT HIDDEN
-#endif
-
-#ifndef KEYWORD2
-#define KEYWORD2
-#endif
-
-#ifndef DISPATCH
-#error DISPATCH must be defined
-#endif
-
-#ifndef RETURN_DISPATCH
-#error RETURN_DISPATCH must be defined
-#endif
-
-
-#ifndef _GLAPI_SKIP_NORMAL_ENTRY_POINTS
-
-KEYWORD1 void KEYWORD2 NAME(NewList)(GLuint list, GLenum mode)
-{
- DISPATCH(NewList, (list, mode), (F, "glNewList(%d, 0x%x);\n", list, mode));
-}
-
-KEYWORD1 void KEYWORD2 NAME(EndList)(void)
-{
- DISPATCH(EndList, (), (F, "glEndList();\n"));
-}
-
-KEYWORD1 void KEYWORD2 NAME(CallList)(GLuint list)
-{
- DISPATCH(CallList, (list), (F, "glCallList(%d);\n", list));
-}
-
-KEYWORD1 void KEYWORD2 NAME(CallLists)(GLsizei n, GLenum type, const GLvoid * lists)
-{
- DISPATCH(CallLists, (n, type, lists), (F, "glCallLists(%d, 0x%x, %p);\n", n, type, (const void *) lists));
-}
-
-KEYWORD1 void KEYWORD2 NAME(DeleteLists)(GLuint list, GLsizei range)
-{
- DISPATCH(DeleteLists, (list, range), (F, "glDeleteLists(%d, %d);\n", list, range));
-}
-
-KEYWORD1 GLuint KEYWORD2 NAME(GenLists)(GLsizei range)
-{
- RETURN_DISPATCH(GenLists, (range), (F, "glGenLists(%d);\n", range));
-}
-
-KEYWORD1 void KEYWORD2 NAME(ListBase)(GLuint base)
-{
- DISPATCH(ListBase, (base), (F, "glListBase(%d);\n", base));
-}
-
-KEYWORD1 void KEYWORD2 NAME(Begin)(GLenum mode)
-{
- DISPATCH(Begin, (mode), (F, "glBegin(0x%x);\n", mode));
-}
-
-KEYWORD1 void KEYWORD2 NAME(Bitmap)(GLsizei width, GLsizei height, GLfloat xorig, GLfloat yorig, GLfloat xmove, GLfloat ymove, const GLubyte * bitmap)
-{
- DISPATCH(Bitmap, (width, height, xorig, yorig, xmove, ymove, bitmap), (F, "glBitmap(%d, %d, %f, %f, %f, %f, %p);\n", width, height, xorig, yorig, xmove, ymove, (const void *) bitmap));
-}
-
-KEYWORD1 void KEYWORD2 NAME(Color3b)(GLbyte red, GLbyte green, GLbyte blue)
-{
- DISPATCH(Color3b, (red, green, blue), (F, "glColor3b(%d, %d, %d);\n", red, green, blue));
-}
-
-KEYWORD1 void KEYWORD2 NAME(Color3bv)(const GLbyte * v)
-{
- DISPATCH(Color3bv, (v), (F, "glColor3bv(%p);\n", (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(Color3d)(GLdouble red, GLdouble green, GLdouble blue)
-{
- DISPATCH(Color3d, (red, green, blue), (F, "glColor3d(%f, %f, %f);\n", red, green, blue));
-}
-
-KEYWORD1 void KEYWORD2 NAME(Color3dv)(const GLdouble * v)
-{
- DISPATCH(Color3dv, (v), (F, "glColor3dv(%p);\n", (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(Color3f)(GLfloat red, GLfloat green, GLfloat blue)
-{
- DISPATCH(Color3f, (red, green, blue), (F, "glColor3f(%f, %f, %f);\n", red, green, blue));
-}
-
-KEYWORD1 void KEYWORD2 NAME(Color3fv)(const GLfloat * v)
-{
- DISPATCH(Color3fv, (v), (F, "glColor3fv(%p);\n", (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(Color3i)(GLint red, GLint green, GLint blue)
-{
- DISPATCH(Color3i, (red, green, blue), (F, "glColor3i(%d, %d, %d);\n", red, green, blue));
-}
-
-KEYWORD1 void KEYWORD2 NAME(Color3iv)(const GLint * v)
-{
- DISPATCH(Color3iv, (v), (F, "glColor3iv(%p);\n", (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(Color3s)(GLshort red, GLshort green, GLshort blue)
-{
- DISPATCH(Color3s, (red, green, blue), (F, "glColor3s(%d, %d, %d);\n", red, green, blue));
-}
-
-KEYWORD1 void KEYWORD2 NAME(Color3sv)(const GLshort * v)
-{
- DISPATCH(Color3sv, (v), (F, "glColor3sv(%p);\n", (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(Color3ub)(GLubyte red, GLubyte green, GLubyte blue)
-{
- DISPATCH(Color3ub, (red, green, blue), (F, "glColor3ub(%d, %d, %d);\n", red, green, blue));
-}
-
-KEYWORD1 void KEYWORD2 NAME(Color3ubv)(const GLubyte * v)
-{
- DISPATCH(Color3ubv, (v), (F, "glColor3ubv(%p);\n", (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(Color3ui)(GLuint red, GLuint green, GLuint blue)
-{
- DISPATCH(Color3ui, (red, green, blue), (F, "glColor3ui(%d, %d, %d);\n", red, green, blue));
-}
-
-KEYWORD1 void KEYWORD2 NAME(Color3uiv)(const GLuint * v)
-{
- DISPATCH(Color3uiv, (v), (F, "glColor3uiv(%p);\n", (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(Color3us)(GLushort red, GLushort green, GLushort blue)
-{
- DISPATCH(Color3us, (red, green, blue), (F, "glColor3us(%d, %d, %d);\n", red, green, blue));
-}
-
-KEYWORD1 void KEYWORD2 NAME(Color3usv)(const GLushort * v)
-{
- DISPATCH(Color3usv, (v), (F, "glColor3usv(%p);\n", (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(Color4b)(GLbyte red, GLbyte green, GLbyte blue, GLbyte alpha)
-{
- DISPATCH(Color4b, (red, green, blue, alpha), (F, "glColor4b(%d, %d, %d, %d);\n", red, green, blue, alpha));
-}
-
-KEYWORD1 void KEYWORD2 NAME(Color4bv)(const GLbyte * v)
-{
- DISPATCH(Color4bv, (v), (F, "glColor4bv(%p);\n", (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(Color4d)(GLdouble red, GLdouble green, GLdouble blue, GLdouble alpha)
-{
- DISPATCH(Color4d, (red, green, blue, alpha), (F, "glColor4d(%f, %f, %f, %f);\n", red, green, blue, alpha));
-}
-
-KEYWORD1 void KEYWORD2 NAME(Color4dv)(const GLdouble * v)
-{
- DISPATCH(Color4dv, (v), (F, "glColor4dv(%p);\n", (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(Color4f)(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha)
-{
- DISPATCH(Color4f, (red, green, blue, alpha), (F, "glColor4f(%f, %f, %f, %f);\n", red, green, blue, alpha));
-}
-
-KEYWORD1 void KEYWORD2 NAME(Color4fv)(const GLfloat * v)
-{
- DISPATCH(Color4fv, (v), (F, "glColor4fv(%p);\n", (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(Color4i)(GLint red, GLint green, GLint blue, GLint alpha)
-{
- DISPATCH(Color4i, (red, green, blue, alpha), (F, "glColor4i(%d, %d, %d, %d);\n", red, green, blue, alpha));
-}
-
-KEYWORD1 void KEYWORD2 NAME(Color4iv)(const GLint * v)
-{
- DISPATCH(Color4iv, (v), (F, "glColor4iv(%p);\n", (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(Color4s)(GLshort red, GLshort green, GLshort blue, GLshort alpha)
-{
- DISPATCH(Color4s, (red, green, blue, alpha), (F, "glColor4s(%d, %d, %d, %d);\n", red, green, blue, alpha));
-}
-
-KEYWORD1 void KEYWORD2 NAME(Color4sv)(const GLshort * v)
-{
- DISPATCH(Color4sv, (v), (F, "glColor4sv(%p);\n", (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(Color4ub)(GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha)
-{
- DISPATCH(Color4ub, (red, green, blue, alpha), (F, "glColor4ub(%d, %d, %d, %d);\n", red, green, blue, alpha));
-}
-
-KEYWORD1 void KEYWORD2 NAME(Color4ubv)(const GLubyte * v)
-{
- DISPATCH(Color4ubv, (v), (F, "glColor4ubv(%p);\n", (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(Color4ui)(GLuint red, GLuint green, GLuint blue, GLuint alpha)
-{
- DISPATCH(Color4ui, (red, green, blue, alpha), (F, "glColor4ui(%d, %d, %d, %d);\n", red, green, blue, alpha));
-}
-
-KEYWORD1 void KEYWORD2 NAME(Color4uiv)(const GLuint * v)
-{
- DISPATCH(Color4uiv, (v), (F, "glColor4uiv(%p);\n", (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(Color4us)(GLushort red, GLushort green, GLushort blue, GLushort alpha)
-{
- DISPATCH(Color4us, (red, green, blue, alpha), (F, "glColor4us(%d, %d, %d, %d);\n", red, green, blue, alpha));
-}
-
-KEYWORD1 void KEYWORD2 NAME(Color4usv)(const GLushort * v)
-{
- DISPATCH(Color4usv, (v), (F, "glColor4usv(%p);\n", (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(EdgeFlag)(GLboolean flag)
-{
- DISPATCH(EdgeFlag, (flag), (F, "glEdgeFlag(%d);\n", flag));
-}
-
-KEYWORD1 void KEYWORD2 NAME(EdgeFlagv)(const GLboolean * flag)
-{
- DISPATCH(EdgeFlagv, (flag), (F, "glEdgeFlagv(%p);\n", (const void *) flag));
-}
-
-KEYWORD1 void KEYWORD2 NAME(End)(void)
-{
- DISPATCH(End, (), (F, "glEnd();\n"));
-}
-
-KEYWORD1 void KEYWORD2 NAME(Indexd)(GLdouble c)
-{
- DISPATCH(Indexd, (c), (F, "glIndexd(%f);\n", c));
-}
-
-KEYWORD1 void KEYWORD2 NAME(Indexdv)(const GLdouble * c)
-{
- DISPATCH(Indexdv, (c), (F, "glIndexdv(%p);\n", (const void *) c));
-}
-
-KEYWORD1 void KEYWORD2 NAME(Indexf)(GLfloat c)
-{
- DISPATCH(Indexf, (c), (F, "glIndexf(%f);\n", c));
-}
-
-KEYWORD1 void KEYWORD2 NAME(Indexfv)(const GLfloat * c)
-{
- DISPATCH(Indexfv, (c), (F, "glIndexfv(%p);\n", (const void *) c));
-}
-
-KEYWORD1 void KEYWORD2 NAME(Indexi)(GLint c)
-{
- DISPATCH(Indexi, (c), (F, "glIndexi(%d);\n", c));
-}
-
-KEYWORD1 void KEYWORD2 NAME(Indexiv)(const GLint * c)
-{
- DISPATCH(Indexiv, (c), (F, "glIndexiv(%p);\n", (const void *) c));
-}
-
-KEYWORD1 void KEYWORD2 NAME(Indexs)(GLshort c)
-{
- DISPATCH(Indexs, (c), (F, "glIndexs(%d);\n", c));
-}
-
-KEYWORD1 void KEYWORD2 NAME(Indexsv)(const GLshort * c)
-{
- DISPATCH(Indexsv, (c), (F, "glIndexsv(%p);\n", (const void *) c));
-}
-
-KEYWORD1 void KEYWORD2 NAME(Normal3b)(GLbyte nx, GLbyte ny, GLbyte nz)
-{
- DISPATCH(Normal3b, (nx, ny, nz), (F, "glNormal3b(%d, %d, %d);\n", nx, ny, nz));
-}
-
-KEYWORD1 void KEYWORD2 NAME(Normal3bv)(const GLbyte * v)
-{
- DISPATCH(Normal3bv, (v), (F, "glNormal3bv(%p);\n", (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(Normal3d)(GLdouble nx, GLdouble ny, GLdouble nz)
-{
- DISPATCH(Normal3d, (nx, ny, nz), (F, "glNormal3d(%f, %f, %f);\n", nx, ny, nz));
-}
-
-KEYWORD1 void KEYWORD2 NAME(Normal3dv)(const GLdouble * v)
-{
- DISPATCH(Normal3dv, (v), (F, "glNormal3dv(%p);\n", (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(Normal3f)(GLfloat nx, GLfloat ny, GLfloat nz)
-{
- DISPATCH(Normal3f, (nx, ny, nz), (F, "glNormal3f(%f, %f, %f);\n", nx, ny, nz));
-}
-
-KEYWORD1 void KEYWORD2 NAME(Normal3fv)(const GLfloat * v)
-{
- DISPATCH(Normal3fv, (v), (F, "glNormal3fv(%p);\n", (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(Normal3i)(GLint nx, GLint ny, GLint nz)
-{
- DISPATCH(Normal3i, (nx, ny, nz), (F, "glNormal3i(%d, %d, %d);\n", nx, ny, nz));
-}
-
-KEYWORD1 void KEYWORD2 NAME(Normal3iv)(const GLint * v)
-{
- DISPATCH(Normal3iv, (v), (F, "glNormal3iv(%p);\n", (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(Normal3s)(GLshort nx, GLshort ny, GLshort nz)
-{
- DISPATCH(Normal3s, (nx, ny, nz), (F, "glNormal3s(%d, %d, %d);\n", nx, ny, nz));
-}
-
-KEYWORD1 void KEYWORD2 NAME(Normal3sv)(const GLshort * v)
-{
- DISPATCH(Normal3sv, (v), (F, "glNormal3sv(%p);\n", (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(RasterPos2d)(GLdouble x, GLdouble y)
-{
- DISPATCH(RasterPos2d, (x, y), (F, "glRasterPos2d(%f, %f);\n", x, y));
-}
-
-KEYWORD1 void KEYWORD2 NAME(RasterPos2dv)(const GLdouble * v)
-{
- DISPATCH(RasterPos2dv, (v), (F, "glRasterPos2dv(%p);\n", (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(RasterPos2f)(GLfloat x, GLfloat y)
-{
- DISPATCH(RasterPos2f, (x, y), (F, "glRasterPos2f(%f, %f);\n", x, y));
-}
-
-KEYWORD1 void KEYWORD2 NAME(RasterPos2fv)(const GLfloat * v)
-{
- DISPATCH(RasterPos2fv, (v), (F, "glRasterPos2fv(%p);\n", (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(RasterPos2i)(GLint x, GLint y)
-{
- DISPATCH(RasterPos2i, (x, y), (F, "glRasterPos2i(%d, %d);\n", x, y));
-}
-
-KEYWORD1 void KEYWORD2 NAME(RasterPos2iv)(const GLint * v)
-{
- DISPATCH(RasterPos2iv, (v), (F, "glRasterPos2iv(%p);\n", (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(RasterPos2s)(GLshort x, GLshort y)
-{
- DISPATCH(RasterPos2s, (x, y), (F, "glRasterPos2s(%d, %d);\n", x, y));
-}
-
-KEYWORD1 void KEYWORD2 NAME(RasterPos2sv)(const GLshort * v)
-{
- DISPATCH(RasterPos2sv, (v), (F, "glRasterPos2sv(%p);\n", (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(RasterPos3d)(GLdouble x, GLdouble y, GLdouble z)
-{
- DISPATCH(RasterPos3d, (x, y, z), (F, "glRasterPos3d(%f, %f, %f);\n", x, y, z));
-}
-
-KEYWORD1 void KEYWORD2 NAME(RasterPos3dv)(const GLdouble * v)
-{
- DISPATCH(RasterPos3dv, (v), (F, "glRasterPos3dv(%p);\n", (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(RasterPos3f)(GLfloat x, GLfloat y, GLfloat z)
-{
- DISPATCH(RasterPos3f, (x, y, z), (F, "glRasterPos3f(%f, %f, %f);\n", x, y, z));
-}
-
-KEYWORD1 void KEYWORD2 NAME(RasterPos3fv)(const GLfloat * v)
-{
- DISPATCH(RasterPos3fv, (v), (F, "glRasterPos3fv(%p);\n", (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(RasterPos3i)(GLint x, GLint y, GLint z)
-{
- DISPATCH(RasterPos3i, (x, y, z), (F, "glRasterPos3i(%d, %d, %d);\n", x, y, z));
-}
-
-KEYWORD1 void KEYWORD2 NAME(RasterPos3iv)(const GLint * v)
-{
- DISPATCH(RasterPos3iv, (v), (F, "glRasterPos3iv(%p);\n", (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(RasterPos3s)(GLshort x, GLshort y, GLshort z)
-{
- DISPATCH(RasterPos3s, (x, y, z), (F, "glRasterPos3s(%d, %d, %d);\n", x, y, z));
-}
-
-KEYWORD1 void KEYWORD2 NAME(RasterPos3sv)(const GLshort * v)
-{
- DISPATCH(RasterPos3sv, (v), (F, "glRasterPos3sv(%p);\n", (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(RasterPos4d)(GLdouble x, GLdouble y, GLdouble z, GLdouble w)
-{
- DISPATCH(RasterPos4d, (x, y, z, w), (F, "glRasterPos4d(%f, %f, %f, %f);\n", x, y, z, w));
-}
-
-KEYWORD1 void KEYWORD2 NAME(RasterPos4dv)(const GLdouble * v)
-{
- DISPATCH(RasterPos4dv, (v), (F, "glRasterPos4dv(%p);\n", (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(RasterPos4f)(GLfloat x, GLfloat y, GLfloat z, GLfloat w)
-{
- DISPATCH(RasterPos4f, (x, y, z, w), (F, "glRasterPos4f(%f, %f, %f, %f);\n", x, y, z, w));
-}
-
-KEYWORD1 void KEYWORD2 NAME(RasterPos4fv)(const GLfloat * v)
-{
- DISPATCH(RasterPos4fv, (v), (F, "glRasterPos4fv(%p);\n", (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(RasterPos4i)(GLint x, GLint y, GLint z, GLint w)
-{
- DISPATCH(RasterPos4i, (x, y, z, w), (F, "glRasterPos4i(%d, %d, %d, %d);\n", x, y, z, w));
-}
-
-KEYWORD1 void KEYWORD2 NAME(RasterPos4iv)(const GLint * v)
-{
- DISPATCH(RasterPos4iv, (v), (F, "glRasterPos4iv(%p);\n", (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(RasterPos4s)(GLshort x, GLshort y, GLshort z, GLshort w)
-{
- DISPATCH(RasterPos4s, (x, y, z, w), (F, "glRasterPos4s(%d, %d, %d, %d);\n", x, y, z, w));
-}
-
-KEYWORD1 void KEYWORD2 NAME(RasterPos4sv)(const GLshort * v)
-{
- DISPATCH(RasterPos4sv, (v), (F, "glRasterPos4sv(%p);\n", (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(Rectd)(GLdouble x1, GLdouble y1, GLdouble x2, GLdouble y2)
-{
- DISPATCH(Rectd, (x1, y1, x2, y2), (F, "glRectd(%f, %f, %f, %f);\n", x1, y1, x2, y2));
-}
-
-KEYWORD1 void KEYWORD2 NAME(Rectdv)(const GLdouble * v1, const GLdouble * v2)
-{
- DISPATCH(Rectdv, (v1, v2), (F, "glRectdv(%p, %p);\n", (const void *) v1, (const void *) v2));
-}
-
-KEYWORD1 void KEYWORD2 NAME(Rectf)(GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2)
-{
- DISPATCH(Rectf, (x1, y1, x2, y2), (F, "glRectf(%f, %f, %f, %f);\n", x1, y1, x2, y2));
-}
-
-KEYWORD1 void KEYWORD2 NAME(Rectfv)(const GLfloat * v1, const GLfloat * v2)
-{
- DISPATCH(Rectfv, (v1, v2), (F, "glRectfv(%p, %p);\n", (const void *) v1, (const void *) v2));
-}
-
-KEYWORD1 void KEYWORD2 NAME(Recti)(GLint x1, GLint y1, GLint x2, GLint y2)
-{
- DISPATCH(Recti, (x1, y1, x2, y2), (F, "glRecti(%d, %d, %d, %d);\n", x1, y1, x2, y2));
-}
-
-KEYWORD1 void KEYWORD2 NAME(Rectiv)(const GLint * v1, const GLint * v2)
-{
- DISPATCH(Rectiv, (v1, v2), (F, "glRectiv(%p, %p);\n", (const void *) v1, (const void *) v2));
-}
-
-KEYWORD1 void KEYWORD2 NAME(Rects)(GLshort x1, GLshort y1, GLshort x2, GLshort y2)
-{
- DISPATCH(Rects, (x1, y1, x2, y2), (F, "glRects(%d, %d, %d, %d);\n", x1, y1, x2, y2));
-}
-
-KEYWORD1 void KEYWORD2 NAME(Rectsv)(const GLshort * v1, const GLshort * v2)
-{
- DISPATCH(Rectsv, (v1, v2), (F, "glRectsv(%p, %p);\n", (const void *) v1, (const void *) v2));
-}
-
-KEYWORD1 void KEYWORD2 NAME(TexCoord1d)(GLdouble s)
-{
- DISPATCH(TexCoord1d, (s), (F, "glTexCoord1d(%f);\n", s));
-}
-
-KEYWORD1 void KEYWORD2 NAME(TexCoord1dv)(const GLdouble * v)
-{
- DISPATCH(TexCoord1dv, (v), (F, "glTexCoord1dv(%p);\n", (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(TexCoord1f)(GLfloat s)
-{
- DISPATCH(TexCoord1f, (s), (F, "glTexCoord1f(%f);\n", s));
-}
-
-KEYWORD1 void KEYWORD2 NAME(TexCoord1fv)(const GLfloat * v)
-{
- DISPATCH(TexCoord1fv, (v), (F, "glTexCoord1fv(%p);\n", (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(TexCoord1i)(GLint s)
-{
- DISPATCH(TexCoord1i, (s), (F, "glTexCoord1i(%d);\n", s));
-}
-
-KEYWORD1 void KEYWORD2 NAME(TexCoord1iv)(const GLint * v)
-{
- DISPATCH(TexCoord1iv, (v), (F, "glTexCoord1iv(%p);\n", (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(TexCoord1s)(GLshort s)
-{
- DISPATCH(TexCoord1s, (s), (F, "glTexCoord1s(%d);\n", s));
-}
-
-KEYWORD1 void KEYWORD2 NAME(TexCoord1sv)(const GLshort * v)
-{
- DISPATCH(TexCoord1sv, (v), (F, "glTexCoord1sv(%p);\n", (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(TexCoord2d)(GLdouble s, GLdouble t)
-{
- DISPATCH(TexCoord2d, (s, t), (F, "glTexCoord2d(%f, %f);\n", s, t));
-}
-
-KEYWORD1 void KEYWORD2 NAME(TexCoord2dv)(const GLdouble * v)
-{
- DISPATCH(TexCoord2dv, (v), (F, "glTexCoord2dv(%p);\n", (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(TexCoord2f)(GLfloat s, GLfloat t)
-{
- DISPATCH(TexCoord2f, (s, t), (F, "glTexCoord2f(%f, %f);\n", s, t));
-}
-
-KEYWORD1 void KEYWORD2 NAME(TexCoord2fv)(const GLfloat * v)
-{
- DISPATCH(TexCoord2fv, (v), (F, "glTexCoord2fv(%p);\n", (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(TexCoord2i)(GLint s, GLint t)
-{
- DISPATCH(TexCoord2i, (s, t), (F, "glTexCoord2i(%d, %d);\n", s, t));
-}
-
-KEYWORD1 void KEYWORD2 NAME(TexCoord2iv)(const GLint * v)
-{
- DISPATCH(TexCoord2iv, (v), (F, "glTexCoord2iv(%p);\n", (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(TexCoord2s)(GLshort s, GLshort t)
-{
- DISPATCH(TexCoord2s, (s, t), (F, "glTexCoord2s(%d, %d);\n", s, t));
-}
-
-KEYWORD1 void KEYWORD2 NAME(TexCoord2sv)(const GLshort * v)
-{
- DISPATCH(TexCoord2sv, (v), (F, "glTexCoord2sv(%p);\n", (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(TexCoord3d)(GLdouble s, GLdouble t, GLdouble r)
-{
- DISPATCH(TexCoord3d, (s, t, r), (F, "glTexCoord3d(%f, %f, %f);\n", s, t, r));
-}
-
-KEYWORD1 void KEYWORD2 NAME(TexCoord3dv)(const GLdouble * v)
-{
- DISPATCH(TexCoord3dv, (v), (F, "glTexCoord3dv(%p);\n", (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(TexCoord3f)(GLfloat s, GLfloat t, GLfloat r)
-{
- DISPATCH(TexCoord3f, (s, t, r), (F, "glTexCoord3f(%f, %f, %f);\n", s, t, r));
-}
-
-KEYWORD1 void KEYWORD2 NAME(TexCoord3fv)(const GLfloat * v)
-{
- DISPATCH(TexCoord3fv, (v), (F, "glTexCoord3fv(%p);\n", (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(TexCoord3i)(GLint s, GLint t, GLint r)
-{
- DISPATCH(TexCoord3i, (s, t, r), (F, "glTexCoord3i(%d, %d, %d);\n", s, t, r));
-}
-
-KEYWORD1 void KEYWORD2 NAME(TexCoord3iv)(const GLint * v)
-{
- DISPATCH(TexCoord3iv, (v), (F, "glTexCoord3iv(%p);\n", (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(TexCoord3s)(GLshort s, GLshort t, GLshort r)
-{
- DISPATCH(TexCoord3s, (s, t, r), (F, "glTexCoord3s(%d, %d, %d);\n", s, t, r));
-}
-
-KEYWORD1 void KEYWORD2 NAME(TexCoord3sv)(const GLshort * v)
-{
- DISPATCH(TexCoord3sv, (v), (F, "glTexCoord3sv(%p);\n", (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(TexCoord4d)(GLdouble s, GLdouble t, GLdouble r, GLdouble q)
-{
- DISPATCH(TexCoord4d, (s, t, r, q), (F, "glTexCoord4d(%f, %f, %f, %f);\n", s, t, r, q));
-}
-
-KEYWORD1 void KEYWORD2 NAME(TexCoord4dv)(const GLdouble * v)
-{
- DISPATCH(TexCoord4dv, (v), (F, "glTexCoord4dv(%p);\n", (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(TexCoord4f)(GLfloat s, GLfloat t, GLfloat r, GLfloat q)
-{
- DISPATCH(TexCoord4f, (s, t, r, q), (F, "glTexCoord4f(%f, %f, %f, %f);\n", s, t, r, q));
-}
-
-KEYWORD1 void KEYWORD2 NAME(TexCoord4fv)(const GLfloat * v)
-{
- DISPATCH(TexCoord4fv, (v), (F, "glTexCoord4fv(%p);\n", (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(TexCoord4i)(GLint s, GLint t, GLint r, GLint q)
-{
- DISPATCH(TexCoord4i, (s, t, r, q), (F, "glTexCoord4i(%d, %d, %d, %d);\n", s, t, r, q));
-}
-
-KEYWORD1 void KEYWORD2 NAME(TexCoord4iv)(const GLint * v)
-{
- DISPATCH(TexCoord4iv, (v), (F, "glTexCoord4iv(%p);\n", (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(TexCoord4s)(GLshort s, GLshort t, GLshort r, GLshort q)
-{
- DISPATCH(TexCoord4s, (s, t, r, q), (F, "glTexCoord4s(%d, %d, %d, %d);\n", s, t, r, q));
-}
-
-KEYWORD1 void KEYWORD2 NAME(TexCoord4sv)(const GLshort * v)
-{
- DISPATCH(TexCoord4sv, (v), (F, "glTexCoord4sv(%p);\n", (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(Vertex2d)(GLdouble x, GLdouble y)
-{
- DISPATCH(Vertex2d, (x, y), (F, "glVertex2d(%f, %f);\n", x, y));
-}
-
-KEYWORD1 void KEYWORD2 NAME(Vertex2dv)(const GLdouble * v)
-{
- DISPATCH(Vertex2dv, (v), (F, "glVertex2dv(%p);\n", (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(Vertex2f)(GLfloat x, GLfloat y)
-{
- DISPATCH(Vertex2f, (x, y), (F, "glVertex2f(%f, %f);\n", x, y));
-}
-
-KEYWORD1 void KEYWORD2 NAME(Vertex2fv)(const GLfloat * v)
-{
- DISPATCH(Vertex2fv, (v), (F, "glVertex2fv(%p);\n", (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(Vertex2i)(GLint x, GLint y)
-{
- DISPATCH(Vertex2i, (x, y), (F, "glVertex2i(%d, %d);\n", x, y));
-}
-
-KEYWORD1 void KEYWORD2 NAME(Vertex2iv)(const GLint * v)
-{
- DISPATCH(Vertex2iv, (v), (F, "glVertex2iv(%p);\n", (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(Vertex2s)(GLshort x, GLshort y)
-{
- DISPATCH(Vertex2s, (x, y), (F, "glVertex2s(%d, %d);\n", x, y));
-}
-
-KEYWORD1 void KEYWORD2 NAME(Vertex2sv)(const GLshort * v)
-{
- DISPATCH(Vertex2sv, (v), (F, "glVertex2sv(%p);\n", (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(Vertex3d)(GLdouble x, GLdouble y, GLdouble z)
-{
- DISPATCH(Vertex3d, (x, y, z), (F, "glVertex3d(%f, %f, %f);\n", x, y, z));
-}
-
-KEYWORD1 void KEYWORD2 NAME(Vertex3dv)(const GLdouble * v)
-{
- DISPATCH(Vertex3dv, (v), (F, "glVertex3dv(%p);\n", (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(Vertex3f)(GLfloat x, GLfloat y, GLfloat z)
-{
- DISPATCH(Vertex3f, (x, y, z), (F, "glVertex3f(%f, %f, %f);\n", x, y, z));
-}
-
-KEYWORD1 void KEYWORD2 NAME(Vertex3fv)(const GLfloat * v)
-{
- DISPATCH(Vertex3fv, (v), (F, "glVertex3fv(%p);\n", (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(Vertex3i)(GLint x, GLint y, GLint z)
-{
- DISPATCH(Vertex3i, (x, y, z), (F, "glVertex3i(%d, %d, %d);\n", x, y, z));
-}
-
-KEYWORD1 void KEYWORD2 NAME(Vertex3iv)(const GLint * v)
-{
- DISPATCH(Vertex3iv, (v), (F, "glVertex3iv(%p);\n", (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(Vertex3s)(GLshort x, GLshort y, GLshort z)
-{
- DISPATCH(Vertex3s, (x, y, z), (F, "glVertex3s(%d, %d, %d);\n", x, y, z));
-}
-
-KEYWORD1 void KEYWORD2 NAME(Vertex3sv)(const GLshort * v)
-{
- DISPATCH(Vertex3sv, (v), (F, "glVertex3sv(%p);\n", (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(Vertex4d)(GLdouble x, GLdouble y, GLdouble z, GLdouble w)
-{
- DISPATCH(Vertex4d, (x, y, z, w), (F, "glVertex4d(%f, %f, %f, %f);\n", x, y, z, w));
-}
-
-KEYWORD1 void KEYWORD2 NAME(Vertex4dv)(const GLdouble * v)
-{
- DISPATCH(Vertex4dv, (v), (F, "glVertex4dv(%p);\n", (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(Vertex4f)(GLfloat x, GLfloat y, GLfloat z, GLfloat w)
-{
- DISPATCH(Vertex4f, (x, y, z, w), (F, "glVertex4f(%f, %f, %f, %f);\n", x, y, z, w));
-}
-
-KEYWORD1 void KEYWORD2 NAME(Vertex4fv)(const GLfloat * v)
-{
- DISPATCH(Vertex4fv, (v), (F, "glVertex4fv(%p);\n", (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(Vertex4i)(GLint x, GLint y, GLint z, GLint w)
-{
- DISPATCH(Vertex4i, (x, y, z, w), (F, "glVertex4i(%d, %d, %d, %d);\n", x, y, z, w));
-}
-
-KEYWORD1 void KEYWORD2 NAME(Vertex4iv)(const GLint * v)
-{
- DISPATCH(Vertex4iv, (v), (F, "glVertex4iv(%p);\n", (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(Vertex4s)(GLshort x, GLshort y, GLshort z, GLshort w)
-{
- DISPATCH(Vertex4s, (x, y, z, w), (F, "glVertex4s(%d, %d, %d, %d);\n", x, y, z, w));
-}
-
-KEYWORD1 void KEYWORD2 NAME(Vertex4sv)(const GLshort * v)
-{
- DISPATCH(Vertex4sv, (v), (F, "glVertex4sv(%p);\n", (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(ClipPlane)(GLenum plane, const GLdouble * equation)
-{
- DISPATCH(ClipPlane, (plane, equation), (F, "glClipPlane(0x%x, %p);\n", plane, (const void *) equation));
-}
-
-KEYWORD1 void KEYWORD2 NAME(ColorMaterial)(GLenum face, GLenum mode)
-{
- DISPATCH(ColorMaterial, (face, mode), (F, "glColorMaterial(0x%x, 0x%x);\n", face, mode));
-}
-
-KEYWORD1 void KEYWORD2 NAME(CullFace)(GLenum mode)
-{
- DISPATCH(CullFace, (mode), (F, "glCullFace(0x%x);\n", mode));
-}
-
-KEYWORD1 void KEYWORD2 NAME(Fogf)(GLenum pname, GLfloat param)
-{
- DISPATCH(Fogf, (pname, param), (F, "glFogf(0x%x, %f);\n", pname, param));
-}
-
-KEYWORD1 void KEYWORD2 NAME(Fogfv)(GLenum pname, const GLfloat * params)
-{
- DISPATCH(Fogfv, (pname, params), (F, "glFogfv(0x%x, %p);\n", pname, (const void *) params));
-}
-
-KEYWORD1 void KEYWORD2 NAME(Fogi)(GLenum pname, GLint param)
-{
- DISPATCH(Fogi, (pname, param), (F, "glFogi(0x%x, %d);\n", pname, param));
-}
-
-KEYWORD1 void KEYWORD2 NAME(Fogiv)(GLenum pname, const GLint * params)
-{
- DISPATCH(Fogiv, (pname, params), (F, "glFogiv(0x%x, %p);\n", pname, (const void *) params));
-}
-
-KEYWORD1 void KEYWORD2 NAME(FrontFace)(GLenum mode)
-{
- DISPATCH(FrontFace, (mode), (F, "glFrontFace(0x%x);\n", mode));
-}
-
-KEYWORD1 void KEYWORD2 NAME(Hint)(GLenum target, GLenum mode)
-{
- DISPATCH(Hint, (target, mode), (F, "glHint(0x%x, 0x%x);\n", target, mode));
-}
-
-KEYWORD1 void KEYWORD2 NAME(Lightf)(GLenum light, GLenum pname, GLfloat param)
-{
- DISPATCH(Lightf, (light, pname, param), (F, "glLightf(0x%x, 0x%x, %f);\n", light, pname, param));
-}
-
-KEYWORD1 void KEYWORD2 NAME(Lightfv)(GLenum light, GLenum pname, const GLfloat * params)
-{
- DISPATCH(Lightfv, (light, pname, params), (F, "glLightfv(0x%x, 0x%x, %p);\n", light, pname, (const void *) params));
-}
-
-KEYWORD1 void KEYWORD2 NAME(Lighti)(GLenum light, GLenum pname, GLint param)
-{
- DISPATCH(Lighti, (light, pname, param), (F, "glLighti(0x%x, 0x%x, %d);\n", light, pname, param));
-}
-
-KEYWORD1 void KEYWORD2 NAME(Lightiv)(GLenum light, GLenum pname, const GLint * params)
-{
- DISPATCH(Lightiv, (light, pname, params), (F, "glLightiv(0x%x, 0x%x, %p);\n", light, pname, (const void *) params));
-}
-
-KEYWORD1 void KEYWORD2 NAME(LightModelf)(GLenum pname, GLfloat param)
-{
- DISPATCH(LightModelf, (pname, param), (F, "glLightModelf(0x%x, %f);\n", pname, param));
-}
-
-KEYWORD1 void KEYWORD2 NAME(LightModelfv)(GLenum pname, const GLfloat * params)
-{
- DISPATCH(LightModelfv, (pname, params), (F, "glLightModelfv(0x%x, %p);\n", pname, (const void *) params));
-}
-
-KEYWORD1 void KEYWORD2 NAME(LightModeli)(GLenum pname, GLint param)
-{
- DISPATCH(LightModeli, (pname, param), (F, "glLightModeli(0x%x, %d);\n", pname, param));
-}
-
-KEYWORD1 void KEYWORD2 NAME(LightModeliv)(GLenum pname, const GLint * params)
-{
- DISPATCH(LightModeliv, (pname, params), (F, "glLightModeliv(0x%x, %p);\n", pname, (const void *) params));
-}
-
-KEYWORD1 void KEYWORD2 NAME(LineStipple)(GLint factor, GLushort pattern)
-{
- DISPATCH(LineStipple, (factor, pattern), (F, "glLineStipple(%d, %d);\n", factor, pattern));
-}
-
-KEYWORD1 void KEYWORD2 NAME(LineWidth)(GLfloat width)
-{
- DISPATCH(LineWidth, (width), (F, "glLineWidth(%f);\n", width));
-}
-
-KEYWORD1 void KEYWORD2 NAME(Materialf)(GLenum face, GLenum pname, GLfloat param)
-{
- DISPATCH(Materialf, (face, pname, param), (F, "glMaterialf(0x%x, 0x%x, %f);\n", face, pname, param));
-}
-
-KEYWORD1 void KEYWORD2 NAME(Materialfv)(GLenum face, GLenum pname, const GLfloat * params)
-{
- DISPATCH(Materialfv, (face, pname, params), (F, "glMaterialfv(0x%x, 0x%x, %p);\n", face, pname, (const void *) params));
-}
-
-KEYWORD1 void KEYWORD2 NAME(Materiali)(GLenum face, GLenum pname, GLint param)
-{
- DISPATCH(Materiali, (face, pname, param), (F, "glMateriali(0x%x, 0x%x, %d);\n", face, pname, param));
-}
-
-KEYWORD1 void KEYWORD2 NAME(Materialiv)(GLenum face, GLenum pname, const GLint * params)
-{
- DISPATCH(Materialiv, (face, pname, params), (F, "glMaterialiv(0x%x, 0x%x, %p);\n", face, pname, (const void *) params));
-}
-
-KEYWORD1 void KEYWORD2 NAME(PointSize)(GLfloat size)
-{
- DISPATCH(PointSize, (size), (F, "glPointSize(%f);\n", size));
-}
-
-KEYWORD1 void KEYWORD2 NAME(PolygonMode)(GLenum face, GLenum mode)
-{
- DISPATCH(PolygonMode, (face, mode), (F, "glPolygonMode(0x%x, 0x%x);\n", face, mode));
-}
-
-KEYWORD1 void KEYWORD2 NAME(PolygonStipple)(const GLubyte * mask)
-{
- DISPATCH(PolygonStipple, (mask), (F, "glPolygonStipple(%p);\n", (const void *) mask));
-}
-
-KEYWORD1 void KEYWORD2 NAME(Scissor)(GLint x, GLint y, GLsizei width, GLsizei height)
-{
- DISPATCH(Scissor, (x, y, width, height), (F, "glScissor(%d, %d, %d, %d);\n", x, y, width, height));
-}
-
-KEYWORD1 void KEYWORD2 NAME(ShadeModel)(GLenum mode)
-{
- DISPATCH(ShadeModel, (mode), (F, "glShadeModel(0x%x);\n", mode));
-}
-
-KEYWORD1 void KEYWORD2 NAME(TexParameterf)(GLenum target, GLenum pname, GLfloat param)
-{
- DISPATCH(TexParameterf, (target, pname, param), (F, "glTexParameterf(0x%x, 0x%x, %f);\n", target, pname, param));
-}
-
-KEYWORD1 void KEYWORD2 NAME(TexParameterfv)(GLenum target, GLenum pname, const GLfloat * params)
-{
- DISPATCH(TexParameterfv, (target, pname, params), (F, "glTexParameterfv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
-}
-
-KEYWORD1 void KEYWORD2 NAME(TexParameteri)(GLenum target, GLenum pname, GLint param)
-{
- DISPATCH(TexParameteri, (target, pname, param), (F, "glTexParameteri(0x%x, 0x%x, %d);\n", target, pname, param));
-}
-
-KEYWORD1 void KEYWORD2 NAME(TexParameteriv)(GLenum target, GLenum pname, const GLint * params)
-{
- DISPATCH(TexParameteriv, (target, pname, params), (F, "glTexParameteriv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
-}
-
-KEYWORD1 void KEYWORD2 NAME(TexImage1D)(GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid * pixels)
-{
- DISPATCH(TexImage1D, (target, level, internalformat, width, border, format, type, pixels), (F, "glTexImage1D(0x%x, %d, %d, %d, %d, 0x%x, 0x%x, %p);\n", target, level, internalformat, width, border, format, type, (const void *) pixels));
-}
-
-KEYWORD1 void KEYWORD2 NAME(TexImage2D)(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid * pixels)
-{
- DISPATCH(TexImage2D, (target, level, internalformat, width, height, border, format, type, pixels), (F, "glTexImage2D(0x%x, %d, %d, %d, %d, %d, 0x%x, 0x%x, %p);\n", target, level, internalformat, width, height, border, format, type, (const void *) pixels));
-}
-
-KEYWORD1 void KEYWORD2 NAME(TexEnvf)(GLenum target, GLenum pname, GLfloat param)
-{
- DISPATCH(TexEnvf, (target, pname, param), (F, "glTexEnvf(0x%x, 0x%x, %f);\n", target, pname, param));
-}
-
-KEYWORD1 void KEYWORD2 NAME(TexEnvfv)(GLenum target, GLenum pname, const GLfloat * params)
-{
- DISPATCH(TexEnvfv, (target, pname, params), (F, "glTexEnvfv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
-}
-
-KEYWORD1 void KEYWORD2 NAME(TexEnvi)(GLenum target, GLenum pname, GLint param)
-{
- DISPATCH(TexEnvi, (target, pname, param), (F, "glTexEnvi(0x%x, 0x%x, %d);\n", target, pname, param));
-}
-
-KEYWORD1 void KEYWORD2 NAME(TexEnviv)(GLenum target, GLenum pname, const GLint * params)
-{
- DISPATCH(TexEnviv, (target, pname, params), (F, "glTexEnviv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
-}
-
-KEYWORD1 void KEYWORD2 NAME(TexGend)(GLenum coord, GLenum pname, GLdouble param)
-{
- DISPATCH(TexGend, (coord, pname, param), (F, "glTexGend(0x%x, 0x%x, %f);\n", coord, pname, param));
-}
-
-KEYWORD1 void KEYWORD2 NAME(TexGendv)(GLenum coord, GLenum pname, const GLdouble * params)
-{
- DISPATCH(TexGendv, (coord, pname, params), (F, "glTexGendv(0x%x, 0x%x, %p);\n", coord, pname, (const void *) params));
-}
-
-KEYWORD1 void KEYWORD2 NAME(TexGenf)(GLenum coord, GLenum pname, GLfloat param)
-{
- DISPATCH(TexGenf, (coord, pname, param), (F, "glTexGenf(0x%x, 0x%x, %f);\n", coord, pname, param));
-}
-
-KEYWORD1 void KEYWORD2 NAME(TexGenfv)(GLenum coord, GLenum pname, const GLfloat * params)
-{
- DISPATCH(TexGenfv, (coord, pname, params), (F, "glTexGenfv(0x%x, 0x%x, %p);\n", coord, pname, (const void *) params));
-}
-
-KEYWORD1 void KEYWORD2 NAME(TexGeni)(GLenum coord, GLenum pname, GLint param)
-{
- DISPATCH(TexGeni, (coord, pname, param), (F, "glTexGeni(0x%x, 0x%x, %d);\n", coord, pname, param));
-}
-
-KEYWORD1 void KEYWORD2 NAME(TexGeniv)(GLenum coord, GLenum pname, const GLint * params)
-{
- DISPATCH(TexGeniv, (coord, pname, params), (F, "glTexGeniv(0x%x, 0x%x, %p);\n", coord, pname, (const void *) params));
-}
-
-KEYWORD1 void KEYWORD2 NAME(FeedbackBuffer)(GLsizei size, GLenum type, GLfloat * buffer)
-{
- DISPATCH(FeedbackBuffer, (size, type, buffer), (F, "glFeedbackBuffer(%d, 0x%x, %p);\n", size, type, (const void *) buffer));
-}
-
-KEYWORD1 void KEYWORD2 NAME(SelectBuffer)(GLsizei size, GLuint * buffer)
-{
- DISPATCH(SelectBuffer, (size, buffer), (F, "glSelectBuffer(%d, %p);\n", size, (const void *) buffer));
-}
-
-KEYWORD1 GLint KEYWORD2 NAME(RenderMode)(GLenum mode)
-{
- RETURN_DISPATCH(RenderMode, (mode), (F, "glRenderMode(0x%x);\n", mode));
-}
-
-KEYWORD1 void KEYWORD2 NAME(InitNames)(void)
-{
- DISPATCH(InitNames, (), (F, "glInitNames();\n"));
-}
-
-KEYWORD1 void KEYWORD2 NAME(LoadName)(GLuint name)
-{
- DISPATCH(LoadName, (name), (F, "glLoadName(%d);\n", name));
-}
-
-KEYWORD1 void KEYWORD2 NAME(PassThrough)(GLfloat token)
-{
- DISPATCH(PassThrough, (token), (F, "glPassThrough(%f);\n", token));
-}
-
-KEYWORD1 void KEYWORD2 NAME(PopName)(void)
-{
- DISPATCH(PopName, (), (F, "glPopName();\n"));
-}
-
-KEYWORD1 void KEYWORD2 NAME(PushName)(GLuint name)
-{
- DISPATCH(PushName, (name), (F, "glPushName(%d);\n", name));
-}
-
-KEYWORD1 void KEYWORD2 NAME(DrawBuffer)(GLenum mode)
-{
- DISPATCH(DrawBuffer, (mode), (F, "glDrawBuffer(0x%x);\n", mode));
-}
-
-KEYWORD1 void KEYWORD2 NAME(Clear)(GLbitfield mask)
-{
- DISPATCH(Clear, (mask), (F, "glClear(%d);\n", mask));
-}
-
-KEYWORD1 void KEYWORD2 NAME(ClearAccum)(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha)
-{
- DISPATCH(ClearAccum, (red, green, blue, alpha), (F, "glClearAccum(%f, %f, %f, %f);\n", red, green, blue, alpha));
-}
-
-KEYWORD1 void KEYWORD2 NAME(ClearIndex)(GLfloat c)
-{
- DISPATCH(ClearIndex, (c), (F, "glClearIndex(%f);\n", c));
-}
-
-KEYWORD1 void KEYWORD2 NAME(ClearColor)(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha)
-{
- DISPATCH(ClearColor, (red, green, blue, alpha), (F, "glClearColor(%f, %f, %f, %f);\n", red, green, blue, alpha));
-}
-
-KEYWORD1 void KEYWORD2 NAME(ClearStencil)(GLint s)
-{
- DISPATCH(ClearStencil, (s), (F, "glClearStencil(%d);\n", s));
-}
-
-KEYWORD1 void KEYWORD2 NAME(ClearDepth)(GLclampd depth)
-{
- DISPATCH(ClearDepth, (depth), (F, "glClearDepth(%f);\n", depth));
-}
-
-KEYWORD1 void KEYWORD2 NAME(StencilMask)(GLuint mask)
-{
- DISPATCH(StencilMask, (mask), (F, "glStencilMask(%d);\n", mask));
-}
-
-KEYWORD1 void KEYWORD2 NAME(ColorMask)(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha)
-{
- DISPATCH(ColorMask, (red, green, blue, alpha), (F, "glColorMask(%d, %d, %d, %d);\n", red, green, blue, alpha));
-}
-
-KEYWORD1 void KEYWORD2 NAME(DepthMask)(GLboolean flag)
-{
- DISPATCH(DepthMask, (flag), (F, "glDepthMask(%d);\n", flag));
-}
-
-KEYWORD1 void KEYWORD2 NAME(IndexMask)(GLuint mask)
-{
- DISPATCH(IndexMask, (mask), (F, "glIndexMask(%d);\n", mask));
-}
-
-KEYWORD1 void KEYWORD2 NAME(Accum)(GLenum op, GLfloat value)
-{
- DISPATCH(Accum, (op, value), (F, "glAccum(0x%x, %f);\n", op, value));
-}
-
-KEYWORD1 void KEYWORD2 NAME(Disable)(GLenum cap)
-{
- DISPATCH(Disable, (cap), (F, "glDisable(0x%x);\n", cap));
-}
-
-KEYWORD1 void KEYWORD2 NAME(Enable)(GLenum cap)
-{
- DISPATCH(Enable, (cap), (F, "glEnable(0x%x);\n", cap));
-}
-
-KEYWORD1 void KEYWORD2 NAME(Finish)(void)
-{
- DISPATCH(Finish, (), (F, "glFinish();\n"));
-}
-
-KEYWORD1 void KEYWORD2 NAME(Flush)(void)
-{
- DISPATCH(Flush, (), (F, "glFlush();\n"));
-}
-
-KEYWORD1 void KEYWORD2 NAME(PopAttrib)(void)
-{
- DISPATCH(PopAttrib, (), (F, "glPopAttrib();\n"));
-}
-
-KEYWORD1 void KEYWORD2 NAME(PushAttrib)(GLbitfield mask)
-{
- DISPATCH(PushAttrib, (mask), (F, "glPushAttrib(%d);\n", mask));
-}
-
-KEYWORD1 void KEYWORD2 NAME(Map1d)(GLenum target, GLdouble u1, GLdouble u2, GLint stride, GLint order, const GLdouble * points)
-{
- DISPATCH(Map1d, (target, u1, u2, stride, order, points), (F, "glMap1d(0x%x, %f, %f, %d, %d, %p);\n", target, u1, u2, stride, order, (const void *) points));
-}
-
-KEYWORD1 void KEYWORD2 NAME(Map1f)(GLenum target, GLfloat u1, GLfloat u2, GLint stride, GLint order, const GLfloat * points)
-{
- DISPATCH(Map1f, (target, u1, u2, stride, order, points), (F, "glMap1f(0x%x, %f, %f, %d, %d, %p);\n", target, u1, u2, stride, order, (const void *) points));
-}
-
-KEYWORD1 void KEYWORD2 NAME(Map2d)(GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, const GLdouble * points)
-{
- DISPATCH(Map2d, (target, u1, u2, ustride, uorder, v1, v2, vstride, vorder, points), (F, "glMap2d(0x%x, %f, %f, %d, %d, %f, %f, %d, %d, %p);\n", target, u1, u2, ustride, uorder, v1, v2, vstride, vorder, (const void *) points));
-}
-
-KEYWORD1 void KEYWORD2 NAME(Map2f)(GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, const GLfloat * points)
-{
- DISPATCH(Map2f, (target, u1, u2, ustride, uorder, v1, v2, vstride, vorder, points), (F, "glMap2f(0x%x, %f, %f, %d, %d, %f, %f, %d, %d, %p);\n", target, u1, u2, ustride, uorder, v1, v2, vstride, vorder, (const void *) points));
-}
-
-KEYWORD1 void KEYWORD2 NAME(MapGrid1d)(GLint un, GLdouble u1, GLdouble u2)
-{
- DISPATCH(MapGrid1d, (un, u1, u2), (F, "glMapGrid1d(%d, %f, %f);\n", un, u1, u2));
-}
-
-KEYWORD1 void KEYWORD2 NAME(MapGrid1f)(GLint un, GLfloat u1, GLfloat u2)
-{
- DISPATCH(MapGrid1f, (un, u1, u2), (F, "glMapGrid1f(%d, %f, %f);\n", un, u1, u2));
-}
-
-KEYWORD1 void KEYWORD2 NAME(MapGrid2d)(GLint un, GLdouble u1, GLdouble u2, GLint vn, GLdouble v1, GLdouble v2)
-{
- DISPATCH(MapGrid2d, (un, u1, u2, vn, v1, v2), (F, "glMapGrid2d(%d, %f, %f, %d, %f, %f);\n", un, u1, u2, vn, v1, v2));
-}
-
-KEYWORD1 void KEYWORD2 NAME(MapGrid2f)(GLint un, GLfloat u1, GLfloat u2, GLint vn, GLfloat v1, GLfloat v2)
-{
- DISPATCH(MapGrid2f, (un, u1, u2, vn, v1, v2), (F, "glMapGrid2f(%d, %f, %f, %d, %f, %f);\n", un, u1, u2, vn, v1, v2));
-}
-
-KEYWORD1 void KEYWORD2 NAME(EvalCoord1d)(GLdouble u)
-{
- DISPATCH(EvalCoord1d, (u), (F, "glEvalCoord1d(%f);\n", u));
-}
-
-KEYWORD1 void KEYWORD2 NAME(EvalCoord1dv)(const GLdouble * u)
-{
- DISPATCH(EvalCoord1dv, (u), (F, "glEvalCoord1dv(%p);\n", (const void *) u));
-}
-
-KEYWORD1 void KEYWORD2 NAME(EvalCoord1f)(GLfloat u)
-{
- DISPATCH(EvalCoord1f, (u), (F, "glEvalCoord1f(%f);\n", u));
-}
-
-KEYWORD1 void KEYWORD2 NAME(EvalCoord1fv)(const GLfloat * u)
-{
- DISPATCH(EvalCoord1fv, (u), (F, "glEvalCoord1fv(%p);\n", (const void *) u));
-}
-
-KEYWORD1 void KEYWORD2 NAME(EvalCoord2d)(GLdouble u, GLdouble v)
-{
- DISPATCH(EvalCoord2d, (u, v), (F, "glEvalCoord2d(%f, %f);\n", u, v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(EvalCoord2dv)(const GLdouble * u)
-{
- DISPATCH(EvalCoord2dv, (u), (F, "glEvalCoord2dv(%p);\n", (const void *) u));
-}
-
-KEYWORD1 void KEYWORD2 NAME(EvalCoord2f)(GLfloat u, GLfloat v)
-{
- DISPATCH(EvalCoord2f, (u, v), (F, "glEvalCoord2f(%f, %f);\n", u, v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(EvalCoord2fv)(const GLfloat * u)
-{
- DISPATCH(EvalCoord2fv, (u), (F, "glEvalCoord2fv(%p);\n", (const void *) u));
-}
-
-KEYWORD1 void KEYWORD2 NAME(EvalMesh1)(GLenum mode, GLint i1, GLint i2)
-{
- DISPATCH(EvalMesh1, (mode, i1, i2), (F, "glEvalMesh1(0x%x, %d, %d);\n", mode, i1, i2));
-}
-
-KEYWORD1 void KEYWORD2 NAME(EvalPoint1)(GLint i)
-{
- DISPATCH(EvalPoint1, (i), (F, "glEvalPoint1(%d);\n", i));
-}
-
-KEYWORD1 void KEYWORD2 NAME(EvalMesh2)(GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2)
-{
- DISPATCH(EvalMesh2, (mode, i1, i2, j1, j2), (F, "glEvalMesh2(0x%x, %d, %d, %d, %d);\n", mode, i1, i2, j1, j2));
-}
-
-KEYWORD1 void KEYWORD2 NAME(EvalPoint2)(GLint i, GLint j)
-{
- DISPATCH(EvalPoint2, (i, j), (F, "glEvalPoint2(%d, %d);\n", i, j));
-}
-
-KEYWORD1 void KEYWORD2 NAME(AlphaFunc)(GLenum func, GLclampf ref)
-{
- DISPATCH(AlphaFunc, (func, ref), (F, "glAlphaFunc(0x%x, %f);\n", func, ref));
-}
-
-KEYWORD1 void KEYWORD2 NAME(BlendFunc)(GLenum sfactor, GLenum dfactor)
-{
- DISPATCH(BlendFunc, (sfactor, dfactor), (F, "glBlendFunc(0x%x, 0x%x);\n", sfactor, dfactor));
-}
-
-KEYWORD1 void KEYWORD2 NAME(LogicOp)(GLenum opcode)
-{
- DISPATCH(LogicOp, (opcode), (F, "glLogicOp(0x%x);\n", opcode));
-}
-
-KEYWORD1 void KEYWORD2 NAME(StencilFunc)(GLenum func, GLint ref, GLuint mask)
-{
- DISPATCH(StencilFunc, (func, ref, mask), (F, "glStencilFunc(0x%x, %d, %d);\n", func, ref, mask));
-}
-
-KEYWORD1 void KEYWORD2 NAME(StencilOp)(GLenum fail, GLenum zfail, GLenum zpass)
-{
- DISPATCH(StencilOp, (fail, zfail, zpass), (F, "glStencilOp(0x%x, 0x%x, 0x%x);\n", fail, zfail, zpass));
-}
-
-KEYWORD1 void KEYWORD2 NAME(DepthFunc)(GLenum func)
-{
- DISPATCH(DepthFunc, (func), (F, "glDepthFunc(0x%x);\n", func));
-}
-
-KEYWORD1 void KEYWORD2 NAME(PixelZoom)(GLfloat xfactor, GLfloat yfactor)
-{
- DISPATCH(PixelZoom, (xfactor, yfactor), (F, "glPixelZoom(%f, %f);\n", xfactor, yfactor));
-}
-
-KEYWORD1 void KEYWORD2 NAME(PixelTransferf)(GLenum pname, GLfloat param)
-{
- DISPATCH(PixelTransferf, (pname, param), (F, "glPixelTransferf(0x%x, %f);\n", pname, param));
-}
-
-KEYWORD1 void KEYWORD2 NAME(PixelTransferi)(GLenum pname, GLint param)
-{
- DISPATCH(PixelTransferi, (pname, param), (F, "glPixelTransferi(0x%x, %d);\n", pname, param));
-}
-
-KEYWORD1 void KEYWORD2 NAME(PixelStoref)(GLenum pname, GLfloat param)
-{
- DISPATCH(PixelStoref, (pname, param), (F, "glPixelStoref(0x%x, %f);\n", pname, param));
-}
-
-KEYWORD1 void KEYWORD2 NAME(PixelStorei)(GLenum pname, GLint param)
-{
- DISPATCH(PixelStorei, (pname, param), (F, "glPixelStorei(0x%x, %d);\n", pname, param));
-}
-
-KEYWORD1 void KEYWORD2 NAME(PixelMapfv)(GLenum map, GLsizei mapsize, const GLfloat * values)
-{
- DISPATCH(PixelMapfv, (map, mapsize, values), (F, "glPixelMapfv(0x%x, %d, %p);\n", map, mapsize, (const void *) values));
-}
-
-KEYWORD1 void KEYWORD2 NAME(PixelMapuiv)(GLenum map, GLsizei mapsize, const GLuint * values)
-{
- DISPATCH(PixelMapuiv, (map, mapsize, values), (F, "glPixelMapuiv(0x%x, %d, %p);\n", map, mapsize, (const void *) values));
-}
-
-KEYWORD1 void KEYWORD2 NAME(PixelMapusv)(GLenum map, GLsizei mapsize, const GLushort * values)
-{
- DISPATCH(PixelMapusv, (map, mapsize, values), (F, "glPixelMapusv(0x%x, %d, %p);\n", map, mapsize, (const void *) values));
-}
-
-KEYWORD1 void KEYWORD2 NAME(ReadBuffer)(GLenum mode)
-{
- DISPATCH(ReadBuffer, (mode), (F, "glReadBuffer(0x%x);\n", mode));
-}
-
-KEYWORD1 void KEYWORD2 NAME(CopyPixels)(GLint x, GLint y, GLsizei width, GLsizei height, GLenum type)
-{
- DISPATCH(CopyPixels, (x, y, width, height, type), (F, "glCopyPixels(%d, %d, %d, %d, 0x%x);\n", x, y, width, height, type));
-}
-
-KEYWORD1 void KEYWORD2 NAME(ReadPixels)(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid * pixels)
-{
- DISPATCH(ReadPixels, (x, y, width, height, format, type, pixels), (F, "glReadPixels(%d, %d, %d, %d, 0x%x, 0x%x, %p);\n", x, y, width, height, format, type, (const void *) pixels));
-}
-
-KEYWORD1 void KEYWORD2 NAME(DrawPixels)(GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * pixels)
-{
- DISPATCH(DrawPixels, (width, height, format, type, pixels), (F, "glDrawPixels(%d, %d, 0x%x, 0x%x, %p);\n", width, height, format, type, (const void *) pixels));
-}
-
-KEYWORD1 void KEYWORD2 NAME(GetBooleanv)(GLenum pname, GLboolean * params)
-{
- DISPATCH(GetBooleanv, (pname, params), (F, "glGetBooleanv(0x%x, %p);\n", pname, (const void *) params));
-}
-
-KEYWORD1 void KEYWORD2 NAME(GetClipPlane)(GLenum plane, GLdouble * equation)
-{
- DISPATCH(GetClipPlane, (plane, equation), (F, "glGetClipPlane(0x%x, %p);\n", plane, (const void *) equation));
-}
-
-KEYWORD1 void KEYWORD2 NAME(GetDoublev)(GLenum pname, GLdouble * params)
-{
- DISPATCH(GetDoublev, (pname, params), (F, "glGetDoublev(0x%x, %p);\n", pname, (const void *) params));
-}
-
-KEYWORD1 GLenum KEYWORD2 NAME(GetError)(void)
-{
- RETURN_DISPATCH(GetError, (), (F, "glGetError();\n"));
-}
-
-KEYWORD1 void KEYWORD2 NAME(GetFloatv)(GLenum pname, GLfloat * params)
-{
- DISPATCH(GetFloatv, (pname, params), (F, "glGetFloatv(0x%x, %p);\n", pname, (const void *) params));
-}
-
-KEYWORD1 void KEYWORD2 NAME(GetIntegerv)(GLenum pname, GLint * params)
-{
- DISPATCH(GetIntegerv, (pname, params), (F, "glGetIntegerv(0x%x, %p);\n", pname, (const void *) params));
-}
-
-KEYWORD1 void KEYWORD2 NAME(GetLightfv)(GLenum light, GLenum pname, GLfloat * params)
-{
- DISPATCH(GetLightfv, (light, pname, params), (F, "glGetLightfv(0x%x, 0x%x, %p);\n", light, pname, (const void *) params));
-}
-
-KEYWORD1 void KEYWORD2 NAME(GetLightiv)(GLenum light, GLenum pname, GLint * params)
-{
- DISPATCH(GetLightiv, (light, pname, params), (F, "glGetLightiv(0x%x, 0x%x, %p);\n", light, pname, (const void *) params));
-}
-
-KEYWORD1 void KEYWORD2 NAME(GetMapdv)(GLenum target, GLenum query, GLdouble * v)
-{
- DISPATCH(GetMapdv, (target, query, v), (F, "glGetMapdv(0x%x, 0x%x, %p);\n", target, query, (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(GetMapfv)(GLenum target, GLenum query, GLfloat * v)
-{
- DISPATCH(GetMapfv, (target, query, v), (F, "glGetMapfv(0x%x, 0x%x, %p);\n", target, query, (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(GetMapiv)(GLenum target, GLenum query, GLint * v)
-{
- DISPATCH(GetMapiv, (target, query, v), (F, "glGetMapiv(0x%x, 0x%x, %p);\n", target, query, (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(GetMaterialfv)(GLenum face, GLenum pname, GLfloat * params)
-{
- DISPATCH(GetMaterialfv, (face, pname, params), (F, "glGetMaterialfv(0x%x, 0x%x, %p);\n", face, pname, (const void *) params));
-}
-
-KEYWORD1 void KEYWORD2 NAME(GetMaterialiv)(GLenum face, GLenum pname, GLint * params)
-{
- DISPATCH(GetMaterialiv, (face, pname, params), (F, "glGetMaterialiv(0x%x, 0x%x, %p);\n", face, pname, (const void *) params));
-}
-
-KEYWORD1 void KEYWORD2 NAME(GetPixelMapfv)(GLenum map, GLfloat * values)
-{
- DISPATCH(GetPixelMapfv, (map, values), (F, "glGetPixelMapfv(0x%x, %p);\n", map, (const void *) values));
-}
-
-KEYWORD1 void KEYWORD2 NAME(GetPixelMapuiv)(GLenum map, GLuint * values)
-{
- DISPATCH(GetPixelMapuiv, (map, values), (F, "glGetPixelMapuiv(0x%x, %p);\n", map, (const void *) values));
-}
-
-KEYWORD1 void KEYWORD2 NAME(GetPixelMapusv)(GLenum map, GLushort * values)
-{
- DISPATCH(GetPixelMapusv, (map, values), (F, "glGetPixelMapusv(0x%x, %p);\n", map, (const void *) values));
-}
-
-KEYWORD1 void KEYWORD2 NAME(GetPolygonStipple)(GLubyte * mask)
-{
- DISPATCH(GetPolygonStipple, (mask), (F, "glGetPolygonStipple(%p);\n", (const void *) mask));
-}
-
-KEYWORD1 const GLubyte * KEYWORD2 NAME(GetString)(GLenum name)
-{
- RETURN_DISPATCH(GetString, (name), (F, "glGetString(0x%x);\n", name));
-}
-
-KEYWORD1 void KEYWORD2 NAME(GetTexEnvfv)(GLenum target, GLenum pname, GLfloat * params)
-{
- DISPATCH(GetTexEnvfv, (target, pname, params), (F, "glGetTexEnvfv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
-}
-
-KEYWORD1 void KEYWORD2 NAME(GetTexEnviv)(GLenum target, GLenum pname, GLint * params)
-{
- DISPATCH(GetTexEnviv, (target, pname, params), (F, "glGetTexEnviv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
-}
-
-KEYWORD1 void KEYWORD2 NAME(GetTexGendv)(GLenum coord, GLenum pname, GLdouble * params)
-{
- DISPATCH(GetTexGendv, (coord, pname, params), (F, "glGetTexGendv(0x%x, 0x%x, %p);\n", coord, pname, (const void *) params));
-}
-
-KEYWORD1 void KEYWORD2 NAME(GetTexGenfv)(GLenum coord, GLenum pname, GLfloat * params)
-{
- DISPATCH(GetTexGenfv, (coord, pname, params), (F, "glGetTexGenfv(0x%x, 0x%x, %p);\n", coord, pname, (const void *) params));
-}
-
-KEYWORD1 void KEYWORD2 NAME(GetTexGeniv)(GLenum coord, GLenum pname, GLint * params)
-{
- DISPATCH(GetTexGeniv, (coord, pname, params), (F, "glGetTexGeniv(0x%x, 0x%x, %p);\n", coord, pname, (const void *) params));
-}
-
-KEYWORD1 void KEYWORD2 NAME(GetTexImage)(GLenum target, GLint level, GLenum format, GLenum type, GLvoid * pixels)
-{
- DISPATCH(GetTexImage, (target, level, format, type, pixels), (F, "glGetTexImage(0x%x, %d, 0x%x, 0x%x, %p);\n", target, level, format, type, (const void *) pixels));
-}
-
-KEYWORD1 void KEYWORD2 NAME(GetTexParameterfv)(GLenum target, GLenum pname, GLfloat * params)
-{
- DISPATCH(GetTexParameterfv, (target, pname, params), (F, "glGetTexParameterfv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
-}
-
-KEYWORD1 void KEYWORD2 NAME(GetTexParameteriv)(GLenum target, GLenum pname, GLint * params)
-{
- DISPATCH(GetTexParameteriv, (target, pname, params), (F, "glGetTexParameteriv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
-}
-
-KEYWORD1 void KEYWORD2 NAME(GetTexLevelParameterfv)(GLenum target, GLint level, GLenum pname, GLfloat * params)
-{
- DISPATCH(GetTexLevelParameterfv, (target, level, pname, params), (F, "glGetTexLevelParameterfv(0x%x, %d, 0x%x, %p);\n", target, level, pname, (const void *) params));
-}
-
-KEYWORD1 void KEYWORD2 NAME(GetTexLevelParameteriv)(GLenum target, GLint level, GLenum pname, GLint * params)
-{
- DISPATCH(GetTexLevelParameteriv, (target, level, pname, params), (F, "glGetTexLevelParameteriv(0x%x, %d, 0x%x, %p);\n", target, level, pname, (const void *) params));
-}
-
-KEYWORD1 GLboolean KEYWORD2 NAME(IsEnabled)(GLenum cap)
-{
- RETURN_DISPATCH(IsEnabled, (cap), (F, "glIsEnabled(0x%x);\n", cap));
-}
-
-KEYWORD1 GLboolean KEYWORD2 NAME(IsList)(GLuint list)
-{
- RETURN_DISPATCH(IsList, (list), (F, "glIsList(%d);\n", list));
-}
-
-KEYWORD1 void KEYWORD2 NAME(DepthRange)(GLclampd zNear, GLclampd zFar)
-{
- DISPATCH(DepthRange, (zNear, zFar), (F, "glDepthRange(%f, %f);\n", zNear, zFar));
-}
-
-KEYWORD1 void KEYWORD2 NAME(Frustum)(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar)
-{
- DISPATCH(Frustum, (left, right, bottom, top, zNear, zFar), (F, "glFrustum(%f, %f, %f, %f, %f, %f);\n", left, right, bottom, top, zNear, zFar));
-}
-
-KEYWORD1 void KEYWORD2 NAME(LoadIdentity)(void)
-{
- DISPATCH(LoadIdentity, (), (F, "glLoadIdentity();\n"));
-}
-
-KEYWORD1 void KEYWORD2 NAME(LoadMatrixf)(const GLfloat * m)
-{
- DISPATCH(LoadMatrixf, (m), (F, "glLoadMatrixf(%p);\n", (const void *) m));
-}
-
-KEYWORD1 void KEYWORD2 NAME(LoadMatrixd)(const GLdouble * m)
-{
- DISPATCH(LoadMatrixd, (m), (F, "glLoadMatrixd(%p);\n", (const void *) m));
-}
-
-KEYWORD1 void KEYWORD2 NAME(MatrixMode)(GLenum mode)
-{
- DISPATCH(MatrixMode, (mode), (F, "glMatrixMode(0x%x);\n", mode));
-}
-
-KEYWORD1 void KEYWORD2 NAME(MultMatrixf)(const GLfloat * m)
-{
- DISPATCH(MultMatrixf, (m), (F, "glMultMatrixf(%p);\n", (const void *) m));
-}
-
-KEYWORD1 void KEYWORD2 NAME(MultMatrixd)(const GLdouble * m)
-{
- DISPATCH(MultMatrixd, (m), (F, "glMultMatrixd(%p);\n", (const void *) m));
-}
-
-KEYWORD1 void KEYWORD2 NAME(Ortho)(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar)
-{
- DISPATCH(Ortho, (left, right, bottom, top, zNear, zFar), (F, "glOrtho(%f, %f, %f, %f, %f, %f);\n", left, right, bottom, top, zNear, zFar));
-}
-
-KEYWORD1 void KEYWORD2 NAME(PopMatrix)(void)
-{
- DISPATCH(PopMatrix, (), (F, "glPopMatrix();\n"));
-}
-
-KEYWORD1 void KEYWORD2 NAME(PushMatrix)(void)
-{
- DISPATCH(PushMatrix, (), (F, "glPushMatrix();\n"));
-}
-
-KEYWORD1 void KEYWORD2 NAME(Rotated)(GLdouble angle, GLdouble x, GLdouble y, GLdouble z)
-{
- DISPATCH(Rotated, (angle, x, y, z), (F, "glRotated(%f, %f, %f, %f);\n", angle, x, y, z));
-}
-
-KEYWORD1 void KEYWORD2 NAME(Rotatef)(GLfloat angle, GLfloat x, GLfloat y, GLfloat z)
-{
- DISPATCH(Rotatef, (angle, x, y, z), (F, "glRotatef(%f, %f, %f, %f);\n", angle, x, y, z));
-}
-
-KEYWORD1 void KEYWORD2 NAME(Scaled)(GLdouble x, GLdouble y, GLdouble z)
-{
- DISPATCH(Scaled, (x, y, z), (F, "glScaled(%f, %f, %f);\n", x, y, z));
-}
-
-KEYWORD1 void KEYWORD2 NAME(Scalef)(GLfloat x, GLfloat y, GLfloat z)
-{
- DISPATCH(Scalef, (x, y, z), (F, "glScalef(%f, %f, %f);\n", x, y, z));
-}
-
-KEYWORD1 void KEYWORD2 NAME(Translated)(GLdouble x, GLdouble y, GLdouble z)
-{
- DISPATCH(Translated, (x, y, z), (F, "glTranslated(%f, %f, %f);\n", x, y, z));
-}
-
-KEYWORD1 void KEYWORD2 NAME(Translatef)(GLfloat x, GLfloat y, GLfloat z)
-{
- DISPATCH(Translatef, (x, y, z), (F, "glTranslatef(%f, %f, %f);\n", x, y, z));
-}
-
-KEYWORD1 void KEYWORD2 NAME(Viewport)(GLint x, GLint y, GLsizei width, GLsizei height)
-{
- DISPATCH(Viewport, (x, y, width, height), (F, "glViewport(%d, %d, %d, %d);\n", x, y, width, height));
-}
-
-KEYWORD1 void KEYWORD2 NAME(ArrayElement)(GLint i)
-{
- DISPATCH(ArrayElement, (i), (F, "glArrayElement(%d);\n", i));
-}
-
-KEYWORD1 void KEYWORD2 NAME(ArrayElementEXT)(GLint i)
-{
- DISPATCH(ArrayElement, (i), (F, "glArrayElementEXT(%d);\n", i));
-}
-
-KEYWORD1 void KEYWORD2 NAME(BindTexture)(GLenum target, GLuint texture)
-{
- DISPATCH(BindTexture, (target, texture), (F, "glBindTexture(0x%x, %d);\n", target, texture));
-}
-
-KEYWORD1 void KEYWORD2 NAME(BindTextureEXT)(GLenum target, GLuint texture)
-{
- DISPATCH(BindTexture, (target, texture), (F, "glBindTextureEXT(0x%x, %d);\n", target, texture));
-}
-
-KEYWORD1 void KEYWORD2 NAME(ColorPointer)(GLint size, GLenum type, GLsizei stride, const GLvoid * pointer)
-{
- DISPATCH(ColorPointer, (size, type, stride, pointer), (F, "glColorPointer(%d, 0x%x, %d, %p);\n", size, type, stride, (const void *) pointer));
-}
-
-KEYWORD1 void KEYWORD2 NAME(DisableClientState)(GLenum array)
-{
- DISPATCH(DisableClientState, (array), (F, "glDisableClientState(0x%x);\n", array));
-}
-
-KEYWORD1 void KEYWORD2 NAME(DrawArrays)(GLenum mode, GLint first, GLsizei count)
-{
- DISPATCH(DrawArrays, (mode, first, count), (F, "glDrawArrays(0x%x, %d, %d);\n", mode, first, count));
-}
-
-KEYWORD1 void KEYWORD2 NAME(DrawArraysEXT)(GLenum mode, GLint first, GLsizei count)
-{
- DISPATCH(DrawArrays, (mode, first, count), (F, "glDrawArraysEXT(0x%x, %d, %d);\n", mode, first, count));
-}
-
-KEYWORD1 void KEYWORD2 NAME(DrawElements)(GLenum mode, GLsizei count, GLenum type, const GLvoid * indices)
-{
- DISPATCH(DrawElements, (mode, count, type, indices), (F, "glDrawElements(0x%x, %d, 0x%x, %p);\n", mode, count, type, (const void *) indices));
-}
-
-KEYWORD1 void KEYWORD2 NAME(EdgeFlagPointer)(GLsizei stride, const GLvoid * pointer)
-{
- DISPATCH(EdgeFlagPointer, (stride, pointer), (F, "glEdgeFlagPointer(%d, %p);\n", stride, (const void *) pointer));
-}
-
-KEYWORD1 void KEYWORD2 NAME(EnableClientState)(GLenum array)
-{
- DISPATCH(EnableClientState, (array), (F, "glEnableClientState(0x%x);\n", array));
-}
-
-KEYWORD1 void KEYWORD2 NAME(IndexPointer)(GLenum type, GLsizei stride, const GLvoid * pointer)
-{
- DISPATCH(IndexPointer, (type, stride, pointer), (F, "glIndexPointer(0x%x, %d, %p);\n", type, stride, (const void *) pointer));
-}
-
-KEYWORD1 void KEYWORD2 NAME(Indexub)(GLubyte c)
-{
- DISPATCH(Indexub, (c), (F, "glIndexub(%d);\n", c));
-}
-
-KEYWORD1 void KEYWORD2 NAME(Indexubv)(const GLubyte * c)
-{
- DISPATCH(Indexubv, (c), (F, "glIndexubv(%p);\n", (const void *) c));
-}
-
-KEYWORD1 void KEYWORD2 NAME(InterleavedArrays)(GLenum format, GLsizei stride, const GLvoid * pointer)
-{
- DISPATCH(InterleavedArrays, (format, stride, pointer), (F, "glInterleavedArrays(0x%x, %d, %p);\n", format, stride, (const void *) pointer));
-}
-
-KEYWORD1 void KEYWORD2 NAME(NormalPointer)(GLenum type, GLsizei stride, const GLvoid * pointer)
-{
- DISPATCH(NormalPointer, (type, stride, pointer), (F, "glNormalPointer(0x%x, %d, %p);\n", type, stride, (const void *) pointer));
-}
-
-KEYWORD1 void KEYWORD2 NAME(PolygonOffset)(GLfloat factor, GLfloat units)
-{
- DISPATCH(PolygonOffset, (factor, units), (F, "glPolygonOffset(%f, %f);\n", factor, units));
-}
-
-KEYWORD1 void KEYWORD2 NAME(TexCoordPointer)(GLint size, GLenum type, GLsizei stride, const GLvoid * pointer)
-{
- DISPATCH(TexCoordPointer, (size, type, stride, pointer), (F, "glTexCoordPointer(%d, 0x%x, %d, %p);\n", size, type, stride, (const void *) pointer));
-}
-
-KEYWORD1 void KEYWORD2 NAME(VertexPointer)(GLint size, GLenum type, GLsizei stride, const GLvoid * pointer)
-{
- DISPATCH(VertexPointer, (size, type, stride, pointer), (F, "glVertexPointer(%d, 0x%x, %d, %p);\n", size, type, stride, (const void *) pointer));
-}
-
-KEYWORD1 GLboolean KEYWORD2 NAME(AreTexturesResident)(GLsizei n, const GLuint * textures, GLboolean * residences)
-{
- RETURN_DISPATCH(AreTexturesResident, (n, textures, residences), (F, "glAreTexturesResident(%d, %p, %p);\n", n, (const void *) textures, (const void *) residences));
-}
-
-KEYWORD1 void KEYWORD2 NAME(CopyTexImage1D)(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border)
-{
- DISPATCH(CopyTexImage1D, (target, level, internalformat, x, y, width, border), (F, "glCopyTexImage1D(0x%x, %d, 0x%x, %d, %d, %d, %d);\n", target, level, internalformat, x, y, width, border));
-}
-
-KEYWORD1 void KEYWORD2 NAME(CopyTexImage1DEXT)(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border)
-{
- DISPATCH(CopyTexImage1D, (target, level, internalformat, x, y, width, border), (F, "glCopyTexImage1DEXT(0x%x, %d, 0x%x, %d, %d, %d, %d);\n", target, level, internalformat, x, y, width, border));
-}
-
-KEYWORD1 void KEYWORD2 NAME(CopyTexImage2D)(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border)
-{
- DISPATCH(CopyTexImage2D, (target, level, internalformat, x, y, width, height, border), (F, "glCopyTexImage2D(0x%x, %d, 0x%x, %d, %d, %d, %d, %d);\n", target, level, internalformat, x, y, width, height, border));
-}
-
-KEYWORD1 void KEYWORD2 NAME(CopyTexImage2DEXT)(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border)
-{
- DISPATCH(CopyTexImage2D, (target, level, internalformat, x, y, width, height, border), (F, "glCopyTexImage2DEXT(0x%x, %d, 0x%x, %d, %d, %d, %d, %d);\n", target, level, internalformat, x, y, width, height, border));
-}
-
-KEYWORD1 void KEYWORD2 NAME(CopyTexSubImage1D)(GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width)
-{
- DISPATCH(CopyTexSubImage1D, (target, level, xoffset, x, y, width), (F, "glCopyTexSubImage1D(0x%x, %d, %d, %d, %d, %d);\n", target, level, xoffset, x, y, width));
-}
-
-KEYWORD1 void KEYWORD2 NAME(CopyTexSubImage1DEXT)(GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width)
-{
- DISPATCH(CopyTexSubImage1D, (target, level, xoffset, x, y, width), (F, "glCopyTexSubImage1DEXT(0x%x, %d, %d, %d, %d, %d);\n", target, level, xoffset, x, y, width));
-}
-
-KEYWORD1 void KEYWORD2 NAME(CopyTexSubImage2D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height)
-{
- DISPATCH(CopyTexSubImage2D, (target, level, xoffset, yoffset, x, y, width, height), (F, "glCopyTexSubImage2D(0x%x, %d, %d, %d, %d, %d, %d, %d);\n", target, level, xoffset, yoffset, x, y, width, height));
-}
-
-KEYWORD1 void KEYWORD2 NAME(CopyTexSubImage2DEXT)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height)
-{
- DISPATCH(CopyTexSubImage2D, (target, level, xoffset, yoffset, x, y, width, height), (F, "glCopyTexSubImage2DEXT(0x%x, %d, %d, %d, %d, %d, %d, %d);\n", target, level, xoffset, yoffset, x, y, width, height));
-}
-
-KEYWORD1 void KEYWORD2 NAME(DeleteTextures)(GLsizei n, const GLuint * textures)
-{
- DISPATCH(DeleteTextures, (n, textures), (F, "glDeleteTextures(%d, %p);\n", n, (const void *) textures));
-}
-
-KEYWORD1 void KEYWORD2 NAME(GenTextures)(GLsizei n, GLuint * textures)
-{
- DISPATCH(GenTextures, (n, textures), (F, "glGenTextures(%d, %p);\n", n, (const void *) textures));
-}
-
-KEYWORD1 void KEYWORD2 NAME(GetPointerv)(GLenum pname, GLvoid ** params)
-{
- DISPATCH(GetPointerv, (pname, params), (F, "glGetPointerv(0x%x, %p);\n", pname, (const void *) params));
-}
-
-KEYWORD1 void KEYWORD2 NAME(GetPointervEXT)(GLenum pname, GLvoid ** params)
-{
- DISPATCH(GetPointerv, (pname, params), (F, "glGetPointervEXT(0x%x, %p);\n", pname, (const void *) params));
-}
-
-KEYWORD1 GLboolean KEYWORD2 NAME(IsTexture)(GLuint texture)
-{
- RETURN_DISPATCH(IsTexture, (texture), (F, "glIsTexture(%d);\n", texture));
-}
-
-KEYWORD1 void KEYWORD2 NAME(PrioritizeTextures)(GLsizei n, const GLuint * textures, const GLclampf * priorities)
-{
- DISPATCH(PrioritizeTextures, (n, textures, priorities), (F, "glPrioritizeTextures(%d, %p, %p);\n", n, (const void *) textures, (const void *) priorities));
-}
-
-KEYWORD1 void KEYWORD2 NAME(PrioritizeTexturesEXT)(GLsizei n, const GLuint * textures, const GLclampf * priorities)
-{
- DISPATCH(PrioritizeTextures, (n, textures, priorities), (F, "glPrioritizeTexturesEXT(%d, %p, %p);\n", n, (const void *) textures, (const void *) priorities));
-}
-
-KEYWORD1 void KEYWORD2 NAME(TexSubImage1D)(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid * pixels)
-{
- DISPATCH(TexSubImage1D, (target, level, xoffset, width, format, type, pixels), (F, "glTexSubImage1D(0x%x, %d, %d, %d, 0x%x, 0x%x, %p);\n", target, level, xoffset, width, format, type, (const void *) pixels));
-}
-
-KEYWORD1 void KEYWORD2 NAME(TexSubImage1DEXT)(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid * pixels)
-{
- DISPATCH(TexSubImage1D, (target, level, xoffset, width, format, type, pixels), (F, "glTexSubImage1DEXT(0x%x, %d, %d, %d, 0x%x, 0x%x, %p);\n", target, level, xoffset, width, format, type, (const void *) pixels));
-}
-
-KEYWORD1 void KEYWORD2 NAME(TexSubImage2D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * pixels)
-{
- DISPATCH(TexSubImage2D, (target, level, xoffset, yoffset, width, height, format, type, pixels), (F, "glTexSubImage2D(0x%x, %d, %d, %d, %d, %d, 0x%x, 0x%x, %p);\n", target, level, xoffset, yoffset, width, height, format, type, (const void *) pixels));
-}
-
-KEYWORD1 void KEYWORD2 NAME(TexSubImage2DEXT)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * pixels)
-{
- DISPATCH(TexSubImage2D, (target, level, xoffset, yoffset, width, height, format, type, pixels), (F, "glTexSubImage2DEXT(0x%x, %d, %d, %d, %d, %d, 0x%x, 0x%x, %p);\n", target, level, xoffset, yoffset, width, height, format, type, (const void *) pixels));
-}
-
-KEYWORD1 void KEYWORD2 NAME(PopClientAttrib)(void)
-{
- DISPATCH(PopClientAttrib, (), (F, "glPopClientAttrib();\n"));
-}
-
-KEYWORD1 void KEYWORD2 NAME(PushClientAttrib)(GLbitfield mask)
-{
- DISPATCH(PushClientAttrib, (mask), (F, "glPushClientAttrib(%d);\n", mask));
-}
-
-KEYWORD1 void KEYWORD2 NAME(BlendColor)(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha)
-{
- DISPATCH(BlendColor, (red, green, blue, alpha), (F, "glBlendColor(%f, %f, %f, %f);\n", red, green, blue, alpha));
-}
-
-KEYWORD1 void KEYWORD2 NAME(BlendColorEXT)(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha)
-{
- DISPATCH(BlendColor, (red, green, blue, alpha), (F, "glBlendColorEXT(%f, %f, %f, %f);\n", red, green, blue, alpha));
-}
-
-KEYWORD1 void KEYWORD2 NAME(BlendEquation)(GLenum mode)
-{
- DISPATCH(BlendEquation, (mode), (F, "glBlendEquation(0x%x);\n", mode));
-}
-
-KEYWORD1 void KEYWORD2 NAME(BlendEquationEXT)(GLenum mode)
-{
- DISPATCH(BlendEquation, (mode), (F, "glBlendEquationEXT(0x%x);\n", mode));
-}
-
-KEYWORD1 void KEYWORD2 NAME(DrawRangeElements)(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid * indices)
-{
- DISPATCH(DrawRangeElements, (mode, start, end, count, type, indices), (F, "glDrawRangeElements(0x%x, %d, %d, %d, 0x%x, %p);\n", mode, start, end, count, type, (const void *) indices));
-}
-
-KEYWORD1 void KEYWORD2 NAME(DrawRangeElementsEXT)(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid * indices)
-{
- DISPATCH(DrawRangeElements, (mode, start, end, count, type, indices), (F, "glDrawRangeElementsEXT(0x%x, %d, %d, %d, 0x%x, %p);\n", mode, start, end, count, type, (const void *) indices));
-}
-
-KEYWORD1 void KEYWORD2 NAME(ColorTable)(GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid * table)
-{
- DISPATCH(ColorTable, (target, internalformat, width, format, type, table), (F, "glColorTable(0x%x, 0x%x, %d, 0x%x, 0x%x, %p);\n", target, internalformat, width, format, type, (const void *) table));
-}
-
-KEYWORD1 void KEYWORD2 NAME(ColorTableEXT)(GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid * table)
-{
- DISPATCH(ColorTable, (target, internalformat, width, format, type, table), (F, "glColorTableEXT(0x%x, 0x%x, %d, 0x%x, 0x%x, %p);\n", target, internalformat, width, format, type, (const void *) table));
-}
-
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_339)(GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid * table);
-
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_339)(GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid * table)
-{
- DISPATCH(ColorTable, (target, internalformat, width, format, type, table), (F, "glColorTableSGI(0x%x, 0x%x, %d, 0x%x, 0x%x, %p);\n", target, internalformat, width, format, type, (const void *) table));
-}
-
-KEYWORD1 void KEYWORD2 NAME(ColorTableParameterfv)(GLenum target, GLenum pname, const GLfloat * params)
-{
- DISPATCH(ColorTableParameterfv, (target, pname, params), (F, "glColorTableParameterfv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
-}
-
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_340)(GLenum target, GLenum pname, const GLfloat * params);
-
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_340)(GLenum target, GLenum pname, const GLfloat * params)
-{
- DISPATCH(ColorTableParameterfv, (target, pname, params), (F, "glColorTableParameterfvSGI(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
-}
-
-KEYWORD1 void KEYWORD2 NAME(ColorTableParameteriv)(GLenum target, GLenum pname, const GLint * params)
-{
- DISPATCH(ColorTableParameteriv, (target, pname, params), (F, "glColorTableParameteriv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
-}
-
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_341)(GLenum target, GLenum pname, const GLint * params);
-
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_341)(GLenum target, GLenum pname, const GLint * params)
-{
- DISPATCH(ColorTableParameteriv, (target, pname, params), (F, "glColorTableParameterivSGI(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
-}
-
-KEYWORD1 void KEYWORD2 NAME(CopyColorTable)(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width)
-{
- DISPATCH(CopyColorTable, (target, internalformat, x, y, width), (F, "glCopyColorTable(0x%x, 0x%x, %d, %d, %d);\n", target, internalformat, x, y, width));
-}
-
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_342)(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width);
-
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_342)(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width)
-{
- DISPATCH(CopyColorTable, (target, internalformat, x, y, width), (F, "glCopyColorTableSGI(0x%x, 0x%x, %d, %d, %d);\n", target, internalformat, x, y, width));
-}
-
-KEYWORD1 void KEYWORD2 NAME(GetColorTable)(GLenum target, GLenum format, GLenum type, GLvoid * table)
-{
- DISPATCH(GetColorTable, (target, format, type, table), (F, "glGetColorTable(0x%x, 0x%x, 0x%x, %p);\n", target, format, type, (const void *) table));
-}
-
-KEYWORD1 void KEYWORD2 NAME(GetColorTableParameterfv)(GLenum target, GLenum pname, GLfloat * params)
-{
- DISPATCH(GetColorTableParameterfv, (target, pname, params), (F, "glGetColorTableParameterfv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
-}
-
-KEYWORD1 void KEYWORD2 NAME(GetColorTableParameteriv)(GLenum target, GLenum pname, GLint * params)
-{
- DISPATCH(GetColorTableParameteriv, (target, pname, params), (F, "glGetColorTableParameteriv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
-}
-
-KEYWORD1 void KEYWORD2 NAME(ColorSubTable)(GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid * data)
-{
- DISPATCH(ColorSubTable, (target, start, count, format, type, data), (F, "glColorSubTable(0x%x, %d, %d, 0x%x, 0x%x, %p);\n", target, start, count, format, type, (const void *) data));
-}
-
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_346)(GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid * data);
-
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_346)(GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid * data)
-{
- DISPATCH(ColorSubTable, (target, start, count, format, type, data), (F, "glColorSubTableEXT(0x%x, %d, %d, 0x%x, 0x%x, %p);\n", target, start, count, format, type, (const void *) data));
-}
-
-KEYWORD1 void KEYWORD2 NAME(CopyColorSubTable)(GLenum target, GLsizei start, GLint x, GLint y, GLsizei width)
-{
- DISPATCH(CopyColorSubTable, (target, start, x, y, width), (F, "glCopyColorSubTable(0x%x, %d, %d, %d, %d);\n", target, start, x, y, width));
-}
-
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_347)(GLenum target, GLsizei start, GLint x, GLint y, GLsizei width);
-
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_347)(GLenum target, GLsizei start, GLint x, GLint y, GLsizei width)
-{
- DISPATCH(CopyColorSubTable, (target, start, x, y, width), (F, "glCopyColorSubTableEXT(0x%x, %d, %d, %d, %d);\n", target, start, x, y, width));
-}
-
-KEYWORD1 void KEYWORD2 NAME(ConvolutionFilter1D)(GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid * image)
-{
- DISPATCH(ConvolutionFilter1D, (target, internalformat, width, format, type, image), (F, "glConvolutionFilter1D(0x%x, 0x%x, %d, 0x%x, 0x%x, %p);\n", target, internalformat, width, format, type, (const void *) image));
-}
-
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_348)(GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid * image);
-
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_348)(GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid * image)
-{
- DISPATCH(ConvolutionFilter1D, (target, internalformat, width, format, type, image), (F, "glConvolutionFilter1DEXT(0x%x, 0x%x, %d, 0x%x, 0x%x, %p);\n", target, internalformat, width, format, type, (const void *) image));
-}
-
-KEYWORD1 void KEYWORD2 NAME(ConvolutionFilter2D)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * image)
-{
- DISPATCH(ConvolutionFilter2D, (target, internalformat, width, height, format, type, image), (F, "glConvolutionFilter2D(0x%x, 0x%x, %d, %d, 0x%x, 0x%x, %p);\n", target, internalformat, width, height, format, type, (const void *) image));
-}
-
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_349)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * image);
-
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_349)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * image)
-{
- DISPATCH(ConvolutionFilter2D, (target, internalformat, width, height, format, type, image), (F, "glConvolutionFilter2DEXT(0x%x, 0x%x, %d, %d, 0x%x, 0x%x, %p);\n", target, internalformat, width, height, format, type, (const void *) image));
-}
-
-KEYWORD1 void KEYWORD2 NAME(ConvolutionParameterf)(GLenum target, GLenum pname, GLfloat params)
-{
- DISPATCH(ConvolutionParameterf, (target, pname, params), (F, "glConvolutionParameterf(0x%x, 0x%x, %f);\n", target, pname, params));
-}
-
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_350)(GLenum target, GLenum pname, GLfloat params);
-
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_350)(GLenum target, GLenum pname, GLfloat params)
-{
- DISPATCH(ConvolutionParameterf, (target, pname, params), (F, "glConvolutionParameterfEXT(0x%x, 0x%x, %f);\n", target, pname, params));
-}
-
-KEYWORD1 void KEYWORD2 NAME(ConvolutionParameterfv)(GLenum target, GLenum pname, const GLfloat * params)
-{
- DISPATCH(ConvolutionParameterfv, (target, pname, params), (F, "glConvolutionParameterfv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
-}
-
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_351)(GLenum target, GLenum pname, const GLfloat * params);
-
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_351)(GLenum target, GLenum pname, const GLfloat * params)
-{
- DISPATCH(ConvolutionParameterfv, (target, pname, params), (F, "glConvolutionParameterfvEXT(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
-}
-
-KEYWORD1 void KEYWORD2 NAME(ConvolutionParameteri)(GLenum target, GLenum pname, GLint params)
-{
- DISPATCH(ConvolutionParameteri, (target, pname, params), (F, "glConvolutionParameteri(0x%x, 0x%x, %d);\n", target, pname, params));
-}
-
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_352)(GLenum target, GLenum pname, GLint params);
-
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_352)(GLenum target, GLenum pname, GLint params)
-{
- DISPATCH(ConvolutionParameteri, (target, pname, params), (F, "glConvolutionParameteriEXT(0x%x, 0x%x, %d);\n", target, pname, params));
-}
-
-KEYWORD1 void KEYWORD2 NAME(ConvolutionParameteriv)(GLenum target, GLenum pname, const GLint * params)
-{
- DISPATCH(ConvolutionParameteriv, (target, pname, params), (F, "glConvolutionParameteriv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
-}
-
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_353)(GLenum target, GLenum pname, const GLint * params);
-
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_353)(GLenum target, GLenum pname, const GLint * params)
-{
- DISPATCH(ConvolutionParameteriv, (target, pname, params), (F, "glConvolutionParameterivEXT(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
-}
-
-KEYWORD1 void KEYWORD2 NAME(CopyConvolutionFilter1D)(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width)
-{
- DISPATCH(CopyConvolutionFilter1D, (target, internalformat, x, y, width), (F, "glCopyConvolutionFilter1D(0x%x, 0x%x, %d, %d, %d);\n", target, internalformat, x, y, width));
-}
-
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_354)(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width);
-
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_354)(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width)
-{
- DISPATCH(CopyConvolutionFilter1D, (target, internalformat, x, y, width), (F, "glCopyConvolutionFilter1DEXT(0x%x, 0x%x, %d, %d, %d);\n", target, internalformat, x, y, width));
-}
-
-KEYWORD1 void KEYWORD2 NAME(CopyConvolutionFilter2D)(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height)
-{
- DISPATCH(CopyConvolutionFilter2D, (target, internalformat, x, y, width, height), (F, "glCopyConvolutionFilter2D(0x%x, 0x%x, %d, %d, %d, %d);\n", target, internalformat, x, y, width, height));
-}
-
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_355)(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height);
-
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_355)(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height)
-{
- DISPATCH(CopyConvolutionFilter2D, (target, internalformat, x, y, width, height), (F, "glCopyConvolutionFilter2DEXT(0x%x, 0x%x, %d, %d, %d, %d);\n", target, internalformat, x, y, width, height));
-}
-
-KEYWORD1 void KEYWORD2 NAME(GetConvolutionFilter)(GLenum target, GLenum format, GLenum type, GLvoid * image)
-{
- DISPATCH(GetConvolutionFilter, (target, format, type, image), (F, "glGetConvolutionFilter(0x%x, 0x%x, 0x%x, %p);\n", target, format, type, (const void *) image));
-}
-
-KEYWORD1 void KEYWORD2 NAME(GetConvolutionParameterfv)(GLenum target, GLenum pname, GLfloat * params)
-{
- DISPATCH(GetConvolutionParameterfv, (target, pname, params), (F, "glGetConvolutionParameterfv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
-}
-
-KEYWORD1 void KEYWORD2 NAME(GetConvolutionParameteriv)(GLenum target, GLenum pname, GLint * params)
-{
- DISPATCH(GetConvolutionParameteriv, (target, pname, params), (F, "glGetConvolutionParameteriv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
-}
-
-KEYWORD1 void KEYWORD2 NAME(GetSeparableFilter)(GLenum target, GLenum format, GLenum type, GLvoid * row, GLvoid * column, GLvoid * span)
-{
- DISPATCH(GetSeparableFilter, (target, format, type, row, column, span), (F, "glGetSeparableFilter(0x%x, 0x%x, 0x%x, %p, %p, %p);\n", target, format, type, (const void *) row, (const void *) column, (const void *) span));
-}
-
-KEYWORD1 void KEYWORD2 NAME(SeparableFilter2D)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * row, const GLvoid * column)
-{
- DISPATCH(SeparableFilter2D, (target, internalformat, width, height, format, type, row, column), (F, "glSeparableFilter2D(0x%x, 0x%x, %d, %d, 0x%x, 0x%x, %p, %p);\n", target, internalformat, width, height, format, type, (const void *) row, (const void *) column));
-}
-
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_360)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * row, const GLvoid * column);
-
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_360)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * row, const GLvoid * column)
-{
- DISPATCH(SeparableFilter2D, (target, internalformat, width, height, format, type, row, column), (F, "glSeparableFilter2DEXT(0x%x, 0x%x, %d, %d, 0x%x, 0x%x, %p, %p);\n", target, internalformat, width, height, format, type, (const void *) row, (const void *) column));
-}
-
-KEYWORD1 void KEYWORD2 NAME(GetHistogram)(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid * values)
-{
- DISPATCH(GetHistogram, (target, reset, format, type, values), (F, "glGetHistogram(0x%x, %d, 0x%x, 0x%x, %p);\n", target, reset, format, type, (const void *) values));
-}
-
-KEYWORD1 void KEYWORD2 NAME(GetHistogramParameterfv)(GLenum target, GLenum pname, GLfloat * params)
-{
- DISPATCH(GetHistogramParameterfv, (target, pname, params), (F, "glGetHistogramParameterfv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
-}
-
-KEYWORD1 void KEYWORD2 NAME(GetHistogramParameteriv)(GLenum target, GLenum pname, GLint * params)
-{
- DISPATCH(GetHistogramParameteriv, (target, pname, params), (F, "glGetHistogramParameteriv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
-}
-
-KEYWORD1 void KEYWORD2 NAME(GetMinmax)(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid * values)
-{
- DISPATCH(GetMinmax, (target, reset, format, type, values), (F, "glGetMinmax(0x%x, %d, 0x%x, 0x%x, %p);\n", target, reset, format, type, (const void *) values));
-}
-
-KEYWORD1 void KEYWORD2 NAME(GetMinmaxParameterfv)(GLenum target, GLenum pname, GLfloat * params)
-{
- DISPATCH(GetMinmaxParameterfv, (target, pname, params), (F, "glGetMinmaxParameterfv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
-}
-
-KEYWORD1 void KEYWORD2 NAME(GetMinmaxParameteriv)(GLenum target, GLenum pname, GLint * params)
-{
- DISPATCH(GetMinmaxParameteriv, (target, pname, params), (F, "glGetMinmaxParameteriv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
-}
-
-KEYWORD1 void KEYWORD2 NAME(Histogram)(GLenum target, GLsizei width, GLenum internalformat, GLboolean sink)
-{
- DISPATCH(Histogram, (target, width, internalformat, sink), (F, "glHistogram(0x%x, %d, 0x%x, %d);\n", target, width, internalformat, sink));
-}
-
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_367)(GLenum target, GLsizei width, GLenum internalformat, GLboolean sink);
-
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_367)(GLenum target, GLsizei width, GLenum internalformat, GLboolean sink)
-{
- DISPATCH(Histogram, (target, width, internalformat, sink), (F, "glHistogramEXT(0x%x, %d, 0x%x, %d);\n", target, width, internalformat, sink));
-}
-
-KEYWORD1 void KEYWORD2 NAME(Minmax)(GLenum target, GLenum internalformat, GLboolean sink)
-{
- DISPATCH(Minmax, (target, internalformat, sink), (F, "glMinmax(0x%x, 0x%x, %d);\n", target, internalformat, sink));
-}
-
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_368)(GLenum target, GLenum internalformat, GLboolean sink);
-
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_368)(GLenum target, GLenum internalformat, GLboolean sink)
-{
- DISPATCH(Minmax, (target, internalformat, sink), (F, "glMinmaxEXT(0x%x, 0x%x, %d);\n", target, internalformat, sink));
-}
-
-KEYWORD1 void KEYWORD2 NAME(ResetHistogram)(GLenum target)
-{
- DISPATCH(ResetHistogram, (target), (F, "glResetHistogram(0x%x);\n", target));
-}
-
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_369)(GLenum target);
-
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_369)(GLenum target)
-{
- DISPATCH(ResetHistogram, (target), (F, "glResetHistogramEXT(0x%x);\n", target));
-}
-
-KEYWORD1 void KEYWORD2 NAME(ResetMinmax)(GLenum target)
-{
- DISPATCH(ResetMinmax, (target), (F, "glResetMinmax(0x%x);\n", target));
-}
-
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_370)(GLenum target);
-
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_370)(GLenum target)
-{
- DISPATCH(ResetMinmax, (target), (F, "glResetMinmaxEXT(0x%x);\n", target));
-}
-
-KEYWORD1 void KEYWORD2 NAME(TexImage3D)(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid * pixels)
-{
- DISPATCH(TexImage3D, (target, level, internalformat, width, height, depth, border, format, type, pixels), (F, "glTexImage3D(0x%x, %d, %d, %d, %d, %d, %d, 0x%x, 0x%x, %p);\n", target, level, internalformat, width, height, depth, border, format, type, (const void *) pixels));
-}
-
-KEYWORD1 void KEYWORD2 NAME(TexImage3DEXT)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid * pixels)
-{
- DISPATCH(TexImage3D, (target, level, internalformat, width, height, depth, border, format, type, pixels), (F, "glTexImage3DEXT(0x%x, %d, %d, %d, %d, %d, %d, 0x%x, 0x%x, %p);\n", target, level, internalformat, width, height, depth, border, format, type, (const void *) pixels));
-}
-
-KEYWORD1 void KEYWORD2 NAME(TexSubImage3D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid * pixels)
-{
- DISPATCH(TexSubImage3D, (target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels), (F, "glTexSubImage3D(0x%x, %d, %d, %d, %d, %d, %d, %d, 0x%x, 0x%x, %p);\n", target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, (const void *) pixels));
-}
-
-KEYWORD1 void KEYWORD2 NAME(TexSubImage3DEXT)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid * pixels)
-{
- DISPATCH(TexSubImage3D, (target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels), (F, "glTexSubImage3DEXT(0x%x, %d, %d, %d, %d, %d, %d, %d, 0x%x, 0x%x, %p);\n", target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, (const void *) pixels));
-}
-
-KEYWORD1 void KEYWORD2 NAME(CopyTexSubImage3D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height)
-{
- DISPATCH(CopyTexSubImage3D, (target, level, xoffset, yoffset, zoffset, x, y, width, height), (F, "glCopyTexSubImage3D(0x%x, %d, %d, %d, %d, %d, %d, %d, %d);\n", target, level, xoffset, yoffset, zoffset, x, y, width, height));
-}
-
-KEYWORD1 void KEYWORD2 NAME(CopyTexSubImage3DEXT)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height)
-{
- DISPATCH(CopyTexSubImage3D, (target, level, xoffset, yoffset, zoffset, x, y, width, height), (F, "glCopyTexSubImage3DEXT(0x%x, %d, %d, %d, %d, %d, %d, %d, %d);\n", target, level, xoffset, yoffset, zoffset, x, y, width, height));
-}
-
-KEYWORD1 void KEYWORD2 NAME(ActiveTexture)(GLenum texture)
-{
- DISPATCH(ActiveTextureARB, (texture), (F, "glActiveTexture(0x%x);\n", texture));
-}
-
-KEYWORD1 void KEYWORD2 NAME(ActiveTextureARB)(GLenum texture)
-{
- DISPATCH(ActiveTextureARB, (texture), (F, "glActiveTextureARB(0x%x);\n", texture));
-}
-
-KEYWORD1 void KEYWORD2 NAME(ClientActiveTexture)(GLenum texture)
-{
- DISPATCH(ClientActiveTextureARB, (texture), (F, "glClientActiveTexture(0x%x);\n", texture));
-}
-
-KEYWORD1 void KEYWORD2 NAME(ClientActiveTextureARB)(GLenum texture)
-{
- DISPATCH(ClientActiveTextureARB, (texture), (F, "glClientActiveTextureARB(0x%x);\n", texture));
-}
-
-KEYWORD1 void KEYWORD2 NAME(MultiTexCoord1d)(GLenum target, GLdouble s)
-{
- DISPATCH(MultiTexCoord1dARB, (target, s), (F, "glMultiTexCoord1d(0x%x, %f);\n", target, s));
-}
-
-KEYWORD1 void KEYWORD2 NAME(MultiTexCoord1dARB)(GLenum target, GLdouble s)
-{
- DISPATCH(MultiTexCoord1dARB, (target, s), (F, "glMultiTexCoord1dARB(0x%x, %f);\n", target, s));
-}
-
-KEYWORD1 void KEYWORD2 NAME(MultiTexCoord1dv)(GLenum target, const GLdouble * v)
-{
- DISPATCH(MultiTexCoord1dvARB, (target, v), (F, "glMultiTexCoord1dv(0x%x, %p);\n", target, (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(MultiTexCoord1dvARB)(GLenum target, const GLdouble * v)
-{
- DISPATCH(MultiTexCoord1dvARB, (target, v), (F, "glMultiTexCoord1dvARB(0x%x, %p);\n", target, (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(MultiTexCoord1f)(GLenum target, GLfloat s)
-{
- DISPATCH(MultiTexCoord1fARB, (target, s), (F, "glMultiTexCoord1f(0x%x, %f);\n", target, s));
-}
-
-KEYWORD1 void KEYWORD2 NAME(MultiTexCoord1fARB)(GLenum target, GLfloat s)
-{
- DISPATCH(MultiTexCoord1fARB, (target, s), (F, "glMultiTexCoord1fARB(0x%x, %f);\n", target, s));
-}
-
-KEYWORD1 void KEYWORD2 NAME(MultiTexCoord1fv)(GLenum target, const GLfloat * v)
-{
- DISPATCH(MultiTexCoord1fvARB, (target, v), (F, "glMultiTexCoord1fv(0x%x, %p);\n", target, (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(MultiTexCoord1fvARB)(GLenum target, const GLfloat * v)
-{
- DISPATCH(MultiTexCoord1fvARB, (target, v), (F, "glMultiTexCoord1fvARB(0x%x, %p);\n", target, (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(MultiTexCoord1i)(GLenum target, GLint s)
-{
- DISPATCH(MultiTexCoord1iARB, (target, s), (F, "glMultiTexCoord1i(0x%x, %d);\n", target, s));
-}
-
-KEYWORD1 void KEYWORD2 NAME(MultiTexCoord1iARB)(GLenum target, GLint s)
-{
- DISPATCH(MultiTexCoord1iARB, (target, s), (F, "glMultiTexCoord1iARB(0x%x, %d);\n", target, s));
-}
-
-KEYWORD1 void KEYWORD2 NAME(MultiTexCoord1iv)(GLenum target, const GLint * v)
-{
- DISPATCH(MultiTexCoord1ivARB, (target, v), (F, "glMultiTexCoord1iv(0x%x, %p);\n", target, (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(MultiTexCoord1ivARB)(GLenum target, const GLint * v)
-{
- DISPATCH(MultiTexCoord1ivARB, (target, v), (F, "glMultiTexCoord1ivARB(0x%x, %p);\n", target, (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(MultiTexCoord1s)(GLenum target, GLshort s)
-{
- DISPATCH(MultiTexCoord1sARB, (target, s), (F, "glMultiTexCoord1s(0x%x, %d);\n", target, s));
-}
-
-KEYWORD1 void KEYWORD2 NAME(MultiTexCoord1sARB)(GLenum target, GLshort s)
-{
- DISPATCH(MultiTexCoord1sARB, (target, s), (F, "glMultiTexCoord1sARB(0x%x, %d);\n", target, s));
-}
-
-KEYWORD1 void KEYWORD2 NAME(MultiTexCoord1sv)(GLenum target, const GLshort * v)
-{
- DISPATCH(MultiTexCoord1svARB, (target, v), (F, "glMultiTexCoord1sv(0x%x, %p);\n", target, (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(MultiTexCoord1svARB)(GLenum target, const GLshort * v)
-{
- DISPATCH(MultiTexCoord1svARB, (target, v), (F, "glMultiTexCoord1svARB(0x%x, %p);\n", target, (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(MultiTexCoord2d)(GLenum target, GLdouble s, GLdouble t)
-{
- DISPATCH(MultiTexCoord2dARB, (target, s, t), (F, "glMultiTexCoord2d(0x%x, %f, %f);\n", target, s, t));
-}
-
-KEYWORD1 void KEYWORD2 NAME(MultiTexCoord2dARB)(GLenum target, GLdouble s, GLdouble t)
-{
- DISPATCH(MultiTexCoord2dARB, (target, s, t), (F, "glMultiTexCoord2dARB(0x%x, %f, %f);\n", target, s, t));
-}
-
-KEYWORD1 void KEYWORD2 NAME(MultiTexCoord2dv)(GLenum target, const GLdouble * v)
-{
- DISPATCH(MultiTexCoord2dvARB, (target, v), (F, "glMultiTexCoord2dv(0x%x, %p);\n", target, (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(MultiTexCoord2dvARB)(GLenum target, const GLdouble * v)
-{
- DISPATCH(MultiTexCoord2dvARB, (target, v), (F, "glMultiTexCoord2dvARB(0x%x, %p);\n", target, (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(MultiTexCoord2f)(GLenum target, GLfloat s, GLfloat t)
-{
- DISPATCH(MultiTexCoord2fARB, (target, s, t), (F, "glMultiTexCoord2f(0x%x, %f, %f);\n", target, s, t));
-}
-
-KEYWORD1 void KEYWORD2 NAME(MultiTexCoord2fARB)(GLenum target, GLfloat s, GLfloat t)
-{
- DISPATCH(MultiTexCoord2fARB, (target, s, t), (F, "glMultiTexCoord2fARB(0x%x, %f, %f);\n", target, s, t));
-}
-
-KEYWORD1 void KEYWORD2 NAME(MultiTexCoord2fv)(GLenum target, const GLfloat * v)
-{
- DISPATCH(MultiTexCoord2fvARB, (target, v), (F, "glMultiTexCoord2fv(0x%x, %p);\n", target, (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(MultiTexCoord2fvARB)(GLenum target, const GLfloat * v)
-{
- DISPATCH(MultiTexCoord2fvARB, (target, v), (F, "glMultiTexCoord2fvARB(0x%x, %p);\n", target, (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(MultiTexCoord2i)(GLenum target, GLint s, GLint t)
-{
- DISPATCH(MultiTexCoord2iARB, (target, s, t), (F, "glMultiTexCoord2i(0x%x, %d, %d);\n", target, s, t));
-}
-
-KEYWORD1 void KEYWORD2 NAME(MultiTexCoord2iARB)(GLenum target, GLint s, GLint t)
-{
- DISPATCH(MultiTexCoord2iARB, (target, s, t), (F, "glMultiTexCoord2iARB(0x%x, %d, %d);\n", target, s, t));
-}
-
-KEYWORD1 void KEYWORD2 NAME(MultiTexCoord2iv)(GLenum target, const GLint * v)
-{
- DISPATCH(MultiTexCoord2ivARB, (target, v), (F, "glMultiTexCoord2iv(0x%x, %p);\n", target, (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(MultiTexCoord2ivARB)(GLenum target, const GLint * v)
-{
- DISPATCH(MultiTexCoord2ivARB, (target, v), (F, "glMultiTexCoord2ivARB(0x%x, %p);\n", target, (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(MultiTexCoord2s)(GLenum target, GLshort s, GLshort t)
-{
- DISPATCH(MultiTexCoord2sARB, (target, s, t), (F, "glMultiTexCoord2s(0x%x, %d, %d);\n", target, s, t));
-}
-
-KEYWORD1 void KEYWORD2 NAME(MultiTexCoord2sARB)(GLenum target, GLshort s, GLshort t)
-{
- DISPATCH(MultiTexCoord2sARB, (target, s, t), (F, "glMultiTexCoord2sARB(0x%x, %d, %d);\n", target, s, t));
-}
-
-KEYWORD1 void KEYWORD2 NAME(MultiTexCoord2sv)(GLenum target, const GLshort * v)
-{
- DISPATCH(MultiTexCoord2svARB, (target, v), (F, "glMultiTexCoord2sv(0x%x, %p);\n", target, (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(MultiTexCoord2svARB)(GLenum target, const GLshort * v)
-{
- DISPATCH(MultiTexCoord2svARB, (target, v), (F, "glMultiTexCoord2svARB(0x%x, %p);\n", target, (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(MultiTexCoord3d)(GLenum target, GLdouble s, GLdouble t, GLdouble r)
-{
- DISPATCH(MultiTexCoord3dARB, (target, s, t, r), (F, "glMultiTexCoord3d(0x%x, %f, %f, %f);\n", target, s, t, r));
-}
-
-KEYWORD1 void KEYWORD2 NAME(MultiTexCoord3dARB)(GLenum target, GLdouble s, GLdouble t, GLdouble r)
-{
- DISPATCH(MultiTexCoord3dARB, (target, s, t, r), (F, "glMultiTexCoord3dARB(0x%x, %f, %f, %f);\n", target, s, t, r));
-}
-
-KEYWORD1 void KEYWORD2 NAME(MultiTexCoord3dv)(GLenum target, const GLdouble * v)
-{
- DISPATCH(MultiTexCoord3dvARB, (target, v), (F, "glMultiTexCoord3dv(0x%x, %p);\n", target, (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(MultiTexCoord3dvARB)(GLenum target, const GLdouble * v)
-{
- DISPATCH(MultiTexCoord3dvARB, (target, v), (F, "glMultiTexCoord3dvARB(0x%x, %p);\n", target, (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(MultiTexCoord3f)(GLenum target, GLfloat s, GLfloat t, GLfloat r)
-{
- DISPATCH(MultiTexCoord3fARB, (target, s, t, r), (F, "glMultiTexCoord3f(0x%x, %f, %f, %f);\n", target, s, t, r));
-}
-
-KEYWORD1 void KEYWORD2 NAME(MultiTexCoord3fARB)(GLenum target, GLfloat s, GLfloat t, GLfloat r)
-{
- DISPATCH(MultiTexCoord3fARB, (target, s, t, r), (F, "glMultiTexCoord3fARB(0x%x, %f, %f, %f);\n", target, s, t, r));
-}
-
-KEYWORD1 void KEYWORD2 NAME(MultiTexCoord3fv)(GLenum target, const GLfloat * v)
-{
- DISPATCH(MultiTexCoord3fvARB, (target, v), (F, "glMultiTexCoord3fv(0x%x, %p);\n", target, (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(MultiTexCoord3fvARB)(GLenum target, const GLfloat * v)
-{
- DISPATCH(MultiTexCoord3fvARB, (target, v), (F, "glMultiTexCoord3fvARB(0x%x, %p);\n", target, (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(MultiTexCoord3i)(GLenum target, GLint s, GLint t, GLint r)
-{
- DISPATCH(MultiTexCoord3iARB, (target, s, t, r), (F, "glMultiTexCoord3i(0x%x, %d, %d, %d);\n", target, s, t, r));
-}
-
-KEYWORD1 void KEYWORD2 NAME(MultiTexCoord3iARB)(GLenum target, GLint s, GLint t, GLint r)
-{
- DISPATCH(MultiTexCoord3iARB, (target, s, t, r), (F, "glMultiTexCoord3iARB(0x%x, %d, %d, %d);\n", target, s, t, r));
-}
-
-KEYWORD1 void KEYWORD2 NAME(MultiTexCoord3iv)(GLenum target, const GLint * v)
-{
- DISPATCH(MultiTexCoord3ivARB, (target, v), (F, "glMultiTexCoord3iv(0x%x, %p);\n", target, (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(MultiTexCoord3ivARB)(GLenum target, const GLint * v)
-{
- DISPATCH(MultiTexCoord3ivARB, (target, v), (F, "glMultiTexCoord3ivARB(0x%x, %p);\n", target, (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(MultiTexCoord3s)(GLenum target, GLshort s, GLshort t, GLshort r)
-{
- DISPATCH(MultiTexCoord3sARB, (target, s, t, r), (F, "glMultiTexCoord3s(0x%x, %d, %d, %d);\n", target, s, t, r));
-}
-
-KEYWORD1 void KEYWORD2 NAME(MultiTexCoord3sARB)(GLenum target, GLshort s, GLshort t, GLshort r)
-{
- DISPATCH(MultiTexCoord3sARB, (target, s, t, r), (F, "glMultiTexCoord3sARB(0x%x, %d, %d, %d);\n", target, s, t, r));
-}
-
-KEYWORD1 void KEYWORD2 NAME(MultiTexCoord3sv)(GLenum target, const GLshort * v)
-{
- DISPATCH(MultiTexCoord3svARB, (target, v), (F, "glMultiTexCoord3sv(0x%x, %p);\n", target, (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(MultiTexCoord3svARB)(GLenum target, const GLshort * v)
-{
- DISPATCH(MultiTexCoord3svARB, (target, v), (F, "glMultiTexCoord3svARB(0x%x, %p);\n", target, (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(MultiTexCoord4d)(GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q)
-{
- DISPATCH(MultiTexCoord4dARB, (target, s, t, r, q), (F, "glMultiTexCoord4d(0x%x, %f, %f, %f, %f);\n", target, s, t, r, q));
-}
-
-KEYWORD1 void KEYWORD2 NAME(MultiTexCoord4dARB)(GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q)
-{
- DISPATCH(MultiTexCoord4dARB, (target, s, t, r, q), (F, "glMultiTexCoord4dARB(0x%x, %f, %f, %f, %f);\n", target, s, t, r, q));
-}
-
-KEYWORD1 void KEYWORD2 NAME(MultiTexCoord4dv)(GLenum target, const GLdouble * v)
-{
- DISPATCH(MultiTexCoord4dvARB, (target, v), (F, "glMultiTexCoord4dv(0x%x, %p);\n", target, (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(MultiTexCoord4dvARB)(GLenum target, const GLdouble * v)
-{
- DISPATCH(MultiTexCoord4dvARB, (target, v), (F, "glMultiTexCoord4dvARB(0x%x, %p);\n", target, (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(MultiTexCoord4f)(GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q)
-{
- DISPATCH(MultiTexCoord4fARB, (target, s, t, r, q), (F, "glMultiTexCoord4f(0x%x, %f, %f, %f, %f);\n", target, s, t, r, q));
-}
-
-KEYWORD1 void KEYWORD2 NAME(MultiTexCoord4fARB)(GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q)
-{
- DISPATCH(MultiTexCoord4fARB, (target, s, t, r, q), (F, "glMultiTexCoord4fARB(0x%x, %f, %f, %f, %f);\n", target, s, t, r, q));
-}
-
-KEYWORD1 void KEYWORD2 NAME(MultiTexCoord4fv)(GLenum target, const GLfloat * v)
-{
- DISPATCH(MultiTexCoord4fvARB, (target, v), (F, "glMultiTexCoord4fv(0x%x, %p);\n", target, (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(MultiTexCoord4fvARB)(GLenum target, const GLfloat * v)
-{
- DISPATCH(MultiTexCoord4fvARB, (target, v), (F, "glMultiTexCoord4fvARB(0x%x, %p);\n", target, (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(MultiTexCoord4i)(GLenum target, GLint s, GLint t, GLint r, GLint q)
-{
- DISPATCH(MultiTexCoord4iARB, (target, s, t, r, q), (F, "glMultiTexCoord4i(0x%x, %d, %d, %d, %d);\n", target, s, t, r, q));
-}
-
-KEYWORD1 void KEYWORD2 NAME(MultiTexCoord4iARB)(GLenum target, GLint s, GLint t, GLint r, GLint q)
-{
- DISPATCH(MultiTexCoord4iARB, (target, s, t, r, q), (F, "glMultiTexCoord4iARB(0x%x, %d, %d, %d, %d);\n", target, s, t, r, q));
-}
-
-KEYWORD1 void KEYWORD2 NAME(MultiTexCoord4iv)(GLenum target, const GLint * v)
-{
- DISPATCH(MultiTexCoord4ivARB, (target, v), (F, "glMultiTexCoord4iv(0x%x, %p);\n", target, (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(MultiTexCoord4ivARB)(GLenum target, const GLint * v)
-{
- DISPATCH(MultiTexCoord4ivARB, (target, v), (F, "glMultiTexCoord4ivARB(0x%x, %p);\n", target, (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(MultiTexCoord4s)(GLenum target, GLshort s, GLshort t, GLshort r, GLshort q)
-{
- DISPATCH(MultiTexCoord4sARB, (target, s, t, r, q), (F, "glMultiTexCoord4s(0x%x, %d, %d, %d, %d);\n", target, s, t, r, q));
-}
-
-KEYWORD1 void KEYWORD2 NAME(MultiTexCoord4sARB)(GLenum target, GLshort s, GLshort t, GLshort r, GLshort q)
-{
- DISPATCH(MultiTexCoord4sARB, (target, s, t, r, q), (F, "glMultiTexCoord4sARB(0x%x, %d, %d, %d, %d);\n", target, s, t, r, q));
-}
-
-KEYWORD1 void KEYWORD2 NAME(MultiTexCoord4sv)(GLenum target, const GLshort * v)
-{
- DISPATCH(MultiTexCoord4svARB, (target, v), (F, "glMultiTexCoord4sv(0x%x, %p);\n", target, (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(MultiTexCoord4svARB)(GLenum target, const GLshort * v)
-{
- DISPATCH(MultiTexCoord4svARB, (target, v), (F, "glMultiTexCoord4svARB(0x%x, %p);\n", target, (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(AttachShader)(GLuint program, GLuint shader)
-{
- DISPATCH(AttachShader, (program, shader), (F, "glAttachShader(%d, %d);\n", program, shader));
-}
-
-KEYWORD1 GLuint KEYWORD2 NAME(CreateProgram)(void)
-{
- RETURN_DISPATCH(CreateProgram, (), (F, "glCreateProgram();\n"));
-}
-
-KEYWORD1 GLuint KEYWORD2 NAME(CreateShader)(GLenum type)
-{
- RETURN_DISPATCH(CreateShader, (type), (F, "glCreateShader(0x%x);\n", type));
-}
-
-KEYWORD1 void KEYWORD2 NAME(DeleteProgram)(GLuint program)
-{
- DISPATCH(DeleteProgram, (program), (F, "glDeleteProgram(%d);\n", program));
-}
-
-KEYWORD1 void KEYWORD2 NAME(DeleteShader)(GLuint program)
-{
- DISPATCH(DeleteShader, (program), (F, "glDeleteShader(%d);\n", program));
-}
-
-KEYWORD1 void KEYWORD2 NAME(DetachShader)(GLuint program, GLuint shader)
-{
- DISPATCH(DetachShader, (program, shader), (F, "glDetachShader(%d, %d);\n", program, shader));
-}
-
-KEYWORD1 void KEYWORD2 NAME(GetAttachedShaders)(GLuint program, GLsizei maxCount, GLsizei * count, GLuint * obj)
-{
- DISPATCH(GetAttachedShaders, (program, maxCount, count, obj), (F, "glGetAttachedShaders(%d, %d, %p, %p);\n", program, maxCount, (const void *) count, (const void *) obj));
-}
-
-KEYWORD1 void KEYWORD2 NAME(GetProgramInfoLog)(GLuint program, GLsizei bufSize, GLsizei * length, GLchar * infoLog)
-{
- DISPATCH(GetProgramInfoLog, (program, bufSize, length, infoLog), (F, "glGetProgramInfoLog(%d, %d, %p, %p);\n", program, bufSize, (const void *) length, (const void *) infoLog));
-}
-
-KEYWORD1 void KEYWORD2 NAME(GetProgramiv)(GLuint program, GLenum pname, GLint * params)
-{
- DISPATCH(GetProgramiv, (program, pname, params), (F, "glGetProgramiv(%d, 0x%x, %p);\n", program, pname, (const void *) params));
-}
-
-KEYWORD1 void KEYWORD2 NAME(GetShaderInfoLog)(GLuint shader, GLsizei bufSize, GLsizei * length, GLchar * infoLog)
-{
- DISPATCH(GetShaderInfoLog, (shader, bufSize, length, infoLog), (F, "glGetShaderInfoLog(%d, %d, %p, %p);\n", shader, bufSize, (const void *) length, (const void *) infoLog));
-}
-
-KEYWORD1 void KEYWORD2 NAME(GetShaderiv)(GLuint shader, GLenum pname, GLint * params)
-{
- DISPATCH(GetShaderiv, (shader, pname, params), (F, "glGetShaderiv(%d, 0x%x, %p);\n", shader, pname, (const void *) params));
-}
-
-KEYWORD1 GLboolean KEYWORD2 NAME(IsProgram)(GLuint program)
-{
- RETURN_DISPATCH(IsProgram, (program), (F, "glIsProgram(%d);\n", program));
-}
-
-KEYWORD1 GLboolean KEYWORD2 NAME(IsShader)(GLuint shader)
-{
- RETURN_DISPATCH(IsShader, (shader), (F, "glIsShader(%d);\n", shader));
-}
-
-KEYWORD1 void KEYWORD2 NAME(StencilFuncSeparate)(GLenum face, GLenum func, GLint ref, GLuint mask)
-{
- DISPATCH(StencilFuncSeparate, (face, func, ref, mask), (F, "glStencilFuncSeparate(0x%x, 0x%x, %d, %d);\n", face, func, ref, mask));
-}
-
-KEYWORD1 void KEYWORD2 NAME(StencilMaskSeparate)(GLenum face, GLuint mask)
-{
- DISPATCH(StencilMaskSeparate, (face, mask), (F, "glStencilMaskSeparate(0x%x, %d);\n", face, mask));
-}
-
-KEYWORD1 void KEYWORD2 NAME(StencilOpSeparate)(GLenum face, GLenum sfail, GLenum zfail, GLenum zpass)
-{
- DISPATCH(StencilOpSeparate, (face, sfail, zfail, zpass), (F, "glStencilOpSeparate(0x%x, 0x%x, 0x%x, 0x%x);\n", face, sfail, zfail, zpass));
-}
-
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_423)(GLenum face, GLenum sfail, GLenum zfail, GLenum zpass);
-
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_423)(GLenum face, GLenum sfail, GLenum zfail, GLenum zpass)
-{
- DISPATCH(StencilOpSeparate, (face, sfail, zfail, zpass), (F, "glStencilOpSeparateATI(0x%x, 0x%x, 0x%x, 0x%x);\n", face, sfail, zfail, zpass));
-}
-
-KEYWORD1 void KEYWORD2 NAME(UniformMatrix2x3fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value)
-{
- DISPATCH(UniformMatrix2x3fv, (location, count, transpose, value), (F, "glUniformMatrix2x3fv(%d, %d, %d, %p);\n", location, count, transpose, (const void *) value));
-}
-
-KEYWORD1 void KEYWORD2 NAME(UniformMatrix2x4fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value)
-{
- DISPATCH(UniformMatrix2x4fv, (location, count, transpose, value), (F, "glUniformMatrix2x4fv(%d, %d, %d, %p);\n", location, count, transpose, (const void *) value));
-}
-
-KEYWORD1 void KEYWORD2 NAME(UniformMatrix3x2fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value)
-{
- DISPATCH(UniformMatrix3x2fv, (location, count, transpose, value), (F, "glUniformMatrix3x2fv(%d, %d, %d, %p);\n", location, count, transpose, (const void *) value));
-}
-
-KEYWORD1 void KEYWORD2 NAME(UniformMatrix3x4fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value)
-{
- DISPATCH(UniformMatrix3x4fv, (location, count, transpose, value), (F, "glUniformMatrix3x4fv(%d, %d, %d, %p);\n", location, count, transpose, (const void *) value));
-}
-
-KEYWORD1 void KEYWORD2 NAME(UniformMatrix4x2fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value)
-{
- DISPATCH(UniformMatrix4x2fv, (location, count, transpose, value), (F, "glUniformMatrix4x2fv(%d, %d, %d, %p);\n", location, count, transpose, (const void *) value));
-}
-
-KEYWORD1 void KEYWORD2 NAME(UniformMatrix4x3fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value)
-{
- DISPATCH(UniformMatrix4x3fv, (location, count, transpose, value), (F, "glUniformMatrix4x3fv(%d, %d, %d, %p);\n", location, count, transpose, (const void *) value));
-}
-
-KEYWORD1 void KEYWORD2 NAME(ClampColor)(GLenum target, GLenum clamp)
-{
- DISPATCH(ClampColor, (target, clamp), (F, "glClampColor(0x%x, 0x%x);\n", target, clamp));
-}
-
-KEYWORD1 void KEYWORD2 NAME(ClearBufferfi)(GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil)
-{
- DISPATCH(ClearBufferfi, (buffer, drawbuffer, depth, stencil), (F, "glClearBufferfi(0x%x, %d, %f, %d);\n", buffer, drawbuffer, depth, stencil));
-}
-
-KEYWORD1 void KEYWORD2 NAME(ClearBufferfv)(GLenum buffer, GLint drawbuffer, const GLfloat * value)
-{
- DISPATCH(ClearBufferfv, (buffer, drawbuffer, value), (F, "glClearBufferfv(0x%x, %d, %p);\n", buffer, drawbuffer, (const void *) value));
-}
-
-KEYWORD1 void KEYWORD2 NAME(ClearBufferiv)(GLenum buffer, GLint drawbuffer, const GLint * value)
-{
- DISPATCH(ClearBufferiv, (buffer, drawbuffer, value), (F, "glClearBufferiv(0x%x, %d, %p);\n", buffer, drawbuffer, (const void *) value));
-}
-
-KEYWORD1 void KEYWORD2 NAME(ClearBufferuiv)(GLenum buffer, GLint drawbuffer, const GLuint * value)
-{
- DISPATCH(ClearBufferuiv, (buffer, drawbuffer, value), (F, "glClearBufferuiv(0x%x, %d, %p);\n", buffer, drawbuffer, (const void *) value));
-}
-
-KEYWORD1 const GLubyte * KEYWORD2 NAME(GetStringi)(GLenum name, GLuint index)
-{
- RETURN_DISPATCH(GetStringi, (name, index), (F, "glGetStringi(0x%x, %d);\n", name, index));
-}
-
-KEYWORD1 void KEYWORD2 NAME(TexBuffer)(GLenum target, GLenum internalFormat, GLuint buffer)
-{
- DISPATCH(TexBuffer, (target, internalFormat, buffer), (F, "glTexBuffer(0x%x, 0x%x, %d);\n", target, internalFormat, buffer));
-}
-
-KEYWORD1 void KEYWORD2 NAME(FramebufferTexture)(GLenum target, GLenum attachment, GLuint texture, GLint level)
-{
- DISPATCH(FramebufferTexture, (target, attachment, texture, level), (F, "glFramebufferTexture(0x%x, 0x%x, %d, %d);\n", target, attachment, texture, level));
-}
-
-KEYWORD1 void KEYWORD2 NAME(GetBufferParameteri64v)(GLenum target, GLenum pname, GLint64 * params)
-{
- DISPATCH(GetBufferParameteri64v, (target, pname, params), (F, "glGetBufferParameteri64v(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
-}
-
-KEYWORD1 void KEYWORD2 NAME(GetInteger64i_v)(GLenum cap, GLuint index, GLint64 * data)
-{
- DISPATCH(GetInteger64i_v, (cap, index, data), (F, "glGetInteger64i_v(0x%x, %d, %p);\n", cap, index, (const void *) data));
-}
-
-KEYWORD1 void KEYWORD2 NAME(VertexAttribDivisor)(GLuint index, GLuint divisor)
-{
- DISPATCH(VertexAttribDivisor, (index, divisor), (F, "glVertexAttribDivisor(%d, %d);\n", index, divisor));
-}
-
-KEYWORD1 void KEYWORD2 NAME(LoadTransposeMatrixd)(const GLdouble * m)
-{
- DISPATCH(LoadTransposeMatrixdARB, (m), (F, "glLoadTransposeMatrixd(%p);\n", (const void *) m));
-}
-
-KEYWORD1 void KEYWORD2 NAME(LoadTransposeMatrixdARB)(const GLdouble * m)
-{
- DISPATCH(LoadTransposeMatrixdARB, (m), (F, "glLoadTransposeMatrixdARB(%p);\n", (const void *) m));
-}
-
-KEYWORD1 void KEYWORD2 NAME(LoadTransposeMatrixf)(const GLfloat * m)
-{
- DISPATCH(LoadTransposeMatrixfARB, (m), (F, "glLoadTransposeMatrixf(%p);\n", (const void *) m));
-}
-
-KEYWORD1 void KEYWORD2 NAME(LoadTransposeMatrixfARB)(const GLfloat * m)
-{
- DISPATCH(LoadTransposeMatrixfARB, (m), (F, "glLoadTransposeMatrixfARB(%p);\n", (const void *) m));
-}
-
-KEYWORD1 void KEYWORD2 NAME(MultTransposeMatrixd)(const GLdouble * m)
-{
- DISPATCH(MultTransposeMatrixdARB, (m), (F, "glMultTransposeMatrixd(%p);\n", (const void *) m));
-}
-
-KEYWORD1 void KEYWORD2 NAME(MultTransposeMatrixdARB)(const GLdouble * m)
-{
- DISPATCH(MultTransposeMatrixdARB, (m), (F, "glMultTransposeMatrixdARB(%p);\n", (const void *) m));
-}
-
-KEYWORD1 void KEYWORD2 NAME(MultTransposeMatrixf)(const GLfloat * m)
-{
- DISPATCH(MultTransposeMatrixfARB, (m), (F, "glMultTransposeMatrixf(%p);\n", (const void *) m));
-}
-
-KEYWORD1 void KEYWORD2 NAME(MultTransposeMatrixfARB)(const GLfloat * m)
-{
- DISPATCH(MultTransposeMatrixfARB, (m), (F, "glMultTransposeMatrixfARB(%p);\n", (const void *) m));
-}
-
-KEYWORD1 void KEYWORD2 NAME(SampleCoverage)(GLclampf value, GLboolean invert)
-{
- DISPATCH(SampleCoverageARB, (value, invert), (F, "glSampleCoverage(%f, %d);\n", value, invert));
-}
-
-KEYWORD1 void KEYWORD2 NAME(SampleCoverageARB)(GLclampf value, GLboolean invert)
-{
- DISPATCH(SampleCoverageARB, (value, invert), (F, "glSampleCoverageARB(%f, %d);\n", value, invert));
-}
-
-KEYWORD1 void KEYWORD2 NAME(CompressedTexImage1D)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid * data)
-{
- DISPATCH(CompressedTexImage1DARB, (target, level, internalformat, width, border, imageSize, data), (F, "glCompressedTexImage1D(0x%x, %d, 0x%x, %d, %d, %d, %p);\n", target, level, internalformat, width, border, imageSize, (const void *) data));
-}
-
-KEYWORD1 void KEYWORD2 NAME(CompressedTexImage1DARB)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid * data)
-{
- DISPATCH(CompressedTexImage1DARB, (target, level, internalformat, width, border, imageSize, data), (F, "glCompressedTexImage1DARB(0x%x, %d, 0x%x, %d, %d, %d, %p);\n", target, level, internalformat, width, border, imageSize, (const void *) data));
-}
-
-KEYWORD1 void KEYWORD2 NAME(CompressedTexImage2D)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid * data)
-{
- DISPATCH(CompressedTexImage2DARB, (target, level, internalformat, width, height, border, imageSize, data), (F, "glCompressedTexImage2D(0x%x, %d, 0x%x, %d, %d, %d, %d, %p);\n", target, level, internalformat, width, height, border, imageSize, (const void *) data));
-}
-
-KEYWORD1 void KEYWORD2 NAME(CompressedTexImage2DARB)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid * data)
-{
- DISPATCH(CompressedTexImage2DARB, (target, level, internalformat, width, height, border, imageSize, data), (F, "glCompressedTexImage2DARB(0x%x, %d, 0x%x, %d, %d, %d, %d, %p);\n", target, level, internalformat, width, height, border, imageSize, (const void *) data));
-}
-
-KEYWORD1 void KEYWORD2 NAME(CompressedTexImage3D)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid * data)
-{
- DISPATCH(CompressedTexImage3DARB, (target, level, internalformat, width, height, depth, border, imageSize, data), (F, "glCompressedTexImage3D(0x%x, %d, 0x%x, %d, %d, %d, %d, %d, %p);\n", target, level, internalformat, width, height, depth, border, imageSize, (const void *) data));
-}
-
-KEYWORD1 void KEYWORD2 NAME(CompressedTexImage3DARB)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid * data)
-{
- DISPATCH(CompressedTexImage3DARB, (target, level, internalformat, width, height, depth, border, imageSize, data), (F, "glCompressedTexImage3DARB(0x%x, %d, 0x%x, %d, %d, %d, %d, %d, %p);\n", target, level, internalformat, width, height, depth, border, imageSize, (const void *) data));
-}
-
-KEYWORD1 void KEYWORD2 NAME(CompressedTexSubImage1D)(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid * data)
-{
- DISPATCH(CompressedTexSubImage1DARB, (target, level, xoffset, width, format, imageSize, data), (F, "glCompressedTexSubImage1D(0x%x, %d, %d, %d, 0x%x, %d, %p);\n", target, level, xoffset, width, format, imageSize, (const void *) data));
-}
-
-KEYWORD1 void KEYWORD2 NAME(CompressedTexSubImage1DARB)(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid * data)
-{
- DISPATCH(CompressedTexSubImage1DARB, (target, level, xoffset, width, format, imageSize, data), (F, "glCompressedTexSubImage1DARB(0x%x, %d, %d, %d, 0x%x, %d, %p);\n", target, level, xoffset, width, format, imageSize, (const void *) data));
-}
-
-KEYWORD1 void KEYWORD2 NAME(CompressedTexSubImage2D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid * data)
-{
- DISPATCH(CompressedTexSubImage2DARB, (target, level, xoffset, yoffset, width, height, format, imageSize, data), (F, "glCompressedTexSubImage2D(0x%x, %d, %d, %d, %d, %d, 0x%x, %d, %p);\n", target, level, xoffset, yoffset, width, height, format, imageSize, (const void *) data));
-}
-
-KEYWORD1 void KEYWORD2 NAME(CompressedTexSubImage2DARB)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid * data)
-{
- DISPATCH(CompressedTexSubImage2DARB, (target, level, xoffset, yoffset, width, height, format, imageSize, data), (F, "glCompressedTexSubImage2DARB(0x%x, %d, %d, %d, %d, %d, 0x%x, %d, %p);\n", target, level, xoffset, yoffset, width, height, format, imageSize, (const void *) data));
-}
-
-KEYWORD1 void KEYWORD2 NAME(CompressedTexSubImage3D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid * data)
-{
- DISPATCH(CompressedTexSubImage3DARB, (target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, data), (F, "glCompressedTexSubImage3D(0x%x, %d, %d, %d, %d, %d, %d, %d, 0x%x, %d, %p);\n", target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, (const void *) data));
-}
-
-KEYWORD1 void KEYWORD2 NAME(CompressedTexSubImage3DARB)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid * data)
-{
- DISPATCH(CompressedTexSubImage3DARB, (target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, data), (F, "glCompressedTexSubImage3DARB(0x%x, %d, %d, %d, %d, %d, %d, %d, 0x%x, %d, %p);\n", target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, (const void *) data));
-}
-
-KEYWORD1 void KEYWORD2 NAME(GetCompressedTexImage)(GLenum target, GLint level, GLvoid * img)
-{
- DISPATCH(GetCompressedTexImageARB, (target, level, img), (F, "glGetCompressedTexImage(0x%x, %d, %p);\n", target, level, (const void *) img));
-}
-
-KEYWORD1 void KEYWORD2 NAME(GetCompressedTexImageARB)(GLenum target, GLint level, GLvoid * img)
-{
- DISPATCH(GetCompressedTexImageARB, (target, level, img), (F, "glGetCompressedTexImageARB(0x%x, %d, %p);\n", target, level, (const void *) img));
-}
-
-KEYWORD1 void KEYWORD2 NAME(DisableVertexAttribArray)(GLuint index)
-{
- DISPATCH(DisableVertexAttribArrayARB, (index), (F, "glDisableVertexAttribArray(%d);\n", index));
-}
-
-KEYWORD1 void KEYWORD2 NAME(DisableVertexAttribArrayARB)(GLuint index)
-{
- DISPATCH(DisableVertexAttribArrayARB, (index), (F, "glDisableVertexAttribArrayARB(%d);\n", index));
-}
-
-KEYWORD1 void KEYWORD2 NAME(EnableVertexAttribArray)(GLuint index)
-{
- DISPATCH(EnableVertexAttribArrayARB, (index), (F, "glEnableVertexAttribArray(%d);\n", index));
-}
-
-KEYWORD1 void KEYWORD2 NAME(EnableVertexAttribArrayARB)(GLuint index)
-{
- DISPATCH(EnableVertexAttribArrayARB, (index), (F, "glEnableVertexAttribArrayARB(%d);\n", index));
-}
-
-KEYWORD1 void KEYWORD2 NAME(GetProgramEnvParameterdvARB)(GLenum target, GLuint index, GLdouble * params)
-{
- DISPATCH(GetProgramEnvParameterdvARB, (target, index, params), (F, "glGetProgramEnvParameterdvARB(0x%x, %d, %p);\n", target, index, (const void *) params));
-}
-
-KEYWORD1 void KEYWORD2 NAME(GetProgramEnvParameterfvARB)(GLenum target, GLuint index, GLfloat * params)
-{
- DISPATCH(GetProgramEnvParameterfvARB, (target, index, params), (F, "glGetProgramEnvParameterfvARB(0x%x, %d, %p);\n", target, index, (const void *) params));
-}
-
-KEYWORD1 void KEYWORD2 NAME(GetProgramLocalParameterdvARB)(GLenum target, GLuint index, GLdouble * params)
-{
- DISPATCH(GetProgramLocalParameterdvARB, (target, index, params), (F, "glGetProgramLocalParameterdvARB(0x%x, %d, %p);\n", target, index, (const void *) params));
-}
-
-KEYWORD1 void KEYWORD2 NAME(GetProgramLocalParameterfvARB)(GLenum target, GLuint index, GLfloat * params)
-{
- DISPATCH(GetProgramLocalParameterfvARB, (target, index, params), (F, "glGetProgramLocalParameterfvARB(0x%x, %d, %p);\n", target, index, (const void *) params));
-}
-
-KEYWORD1 void KEYWORD2 NAME(GetProgramStringARB)(GLenum target, GLenum pname, GLvoid * string)
-{
- DISPATCH(GetProgramStringARB, (target, pname, string), (F, "glGetProgramStringARB(0x%x, 0x%x, %p);\n", target, pname, (const void *) string));
-}
-
-KEYWORD1 void KEYWORD2 NAME(GetProgramivARB)(GLenum target, GLenum pname, GLint * params)
-{
- DISPATCH(GetProgramivARB, (target, pname, params), (F, "glGetProgramivARB(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
-}
-
-KEYWORD1 void KEYWORD2 NAME(GetVertexAttribdv)(GLuint index, GLenum pname, GLdouble * params)
-{
- DISPATCH(GetVertexAttribdvARB, (index, pname, params), (F, "glGetVertexAttribdv(%d, 0x%x, %p);\n", index, pname, (const void *) params));
-}
-
-KEYWORD1 void KEYWORD2 NAME(GetVertexAttribdvARB)(GLuint index, GLenum pname, GLdouble * params)
-{
- DISPATCH(GetVertexAttribdvARB, (index, pname, params), (F, "glGetVertexAttribdvARB(%d, 0x%x, %p);\n", index, pname, (const void *) params));
-}
-
-KEYWORD1 void KEYWORD2 NAME(GetVertexAttribfv)(GLuint index, GLenum pname, GLfloat * params)
-{
- DISPATCH(GetVertexAttribfvARB, (index, pname, params), (F, "glGetVertexAttribfv(%d, 0x%x, %p);\n", index, pname, (const void *) params));
-}
-
-KEYWORD1 void KEYWORD2 NAME(GetVertexAttribfvARB)(GLuint index, GLenum pname, GLfloat * params)
-{
- DISPATCH(GetVertexAttribfvARB, (index, pname, params), (F, "glGetVertexAttribfvARB(%d, 0x%x, %p);\n", index, pname, (const void *) params));
-}
-
-KEYWORD1 void KEYWORD2 NAME(GetVertexAttribiv)(GLuint index, GLenum pname, GLint * params)
-{
- DISPATCH(GetVertexAttribivARB, (index, pname, params), (F, "glGetVertexAttribiv(%d, 0x%x, %p);\n", index, pname, (const void *) params));
-}
-
-KEYWORD1 void KEYWORD2 NAME(GetVertexAttribivARB)(GLuint index, GLenum pname, GLint * params)
-{
- DISPATCH(GetVertexAttribivARB, (index, pname, params), (F, "glGetVertexAttribivARB(%d, 0x%x, %p);\n", index, pname, (const void *) params));
-}
-
-KEYWORD1 void KEYWORD2 NAME(ProgramEnvParameter4dARB)(GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w)
-{
- DISPATCH(ProgramEnvParameter4dARB, (target, index, x, y, z, w), (F, "glProgramEnvParameter4dARB(0x%x, %d, %f, %f, %f, %f);\n", target, index, x, y, z, w));
-}
-
-KEYWORD1 void KEYWORD2 NAME(ProgramParameter4dNV)(GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w)
-{
- DISPATCH(ProgramEnvParameter4dARB, (target, index, x, y, z, w), (F, "glProgramParameter4dNV(0x%x, %d, %f, %f, %f, %f);\n", target, index, x, y, z, w));
-}
-
-KEYWORD1 void KEYWORD2 NAME(ProgramEnvParameter4dvARB)(GLenum target, GLuint index, const GLdouble * params)
-{
- DISPATCH(ProgramEnvParameter4dvARB, (target, index, params), (F, "glProgramEnvParameter4dvARB(0x%x, %d, %p);\n", target, index, (const void *) params));
-}
-
-KEYWORD1 void KEYWORD2 NAME(ProgramParameter4dvNV)(GLenum target, GLuint index, const GLdouble * params)
-{
- DISPATCH(ProgramEnvParameter4dvARB, (target, index, params), (F, "glProgramParameter4dvNV(0x%x, %d, %p);\n", target, index, (const void *) params));
-}
-
-KEYWORD1 void KEYWORD2 NAME(ProgramEnvParameter4fARB)(GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
-{
- DISPATCH(ProgramEnvParameter4fARB, (target, index, x, y, z, w), (F, "glProgramEnvParameter4fARB(0x%x, %d, %f, %f, %f, %f);\n", target, index, x, y, z, w));
-}
-
-KEYWORD1 void KEYWORD2 NAME(ProgramParameter4fNV)(GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
-{
- DISPATCH(ProgramEnvParameter4fARB, (target, index, x, y, z, w), (F, "glProgramParameter4fNV(0x%x, %d, %f, %f, %f, %f);\n", target, index, x, y, z, w));
-}
-
-KEYWORD1 void KEYWORD2 NAME(ProgramEnvParameter4fvARB)(GLenum target, GLuint index, const GLfloat * params)
-{
- DISPATCH(ProgramEnvParameter4fvARB, (target, index, params), (F, "glProgramEnvParameter4fvARB(0x%x, %d, %p);\n", target, index, (const void *) params));
-}
-
-KEYWORD1 void KEYWORD2 NAME(ProgramParameter4fvNV)(GLenum target, GLuint index, const GLfloat * params)
-{
- DISPATCH(ProgramEnvParameter4fvARB, (target, index, params), (F, "glProgramParameter4fvNV(0x%x, %d, %p);\n", target, index, (const void *) params));
-}
-
-KEYWORD1 void KEYWORD2 NAME(ProgramLocalParameter4dARB)(GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w)
-{
- DISPATCH(ProgramLocalParameter4dARB, (target, index, x, y, z, w), (F, "glProgramLocalParameter4dARB(0x%x, %d, %f, %f, %f, %f);\n", target, index, x, y, z, w));
-}
-
-KEYWORD1 void KEYWORD2 NAME(ProgramLocalParameter4dvARB)(GLenum target, GLuint index, const GLdouble * params)
-{
- DISPATCH(ProgramLocalParameter4dvARB, (target, index, params), (F, "glProgramLocalParameter4dvARB(0x%x, %d, %p);\n", target, index, (const void *) params));
-}
-
-KEYWORD1 void KEYWORD2 NAME(ProgramLocalParameter4fARB)(GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
-{
- DISPATCH(ProgramLocalParameter4fARB, (target, index, x, y, z, w), (F, "glProgramLocalParameter4fARB(0x%x, %d, %f, %f, %f, %f);\n", target, index, x, y, z, w));
-}
-
-KEYWORD1 void KEYWORD2 NAME(ProgramLocalParameter4fvARB)(GLenum target, GLuint index, const GLfloat * params)
-{
- DISPATCH(ProgramLocalParameter4fvARB, (target, index, params), (F, "glProgramLocalParameter4fvARB(0x%x, %d, %p);\n", target, index, (const void *) params));
-}
-
-KEYWORD1 void KEYWORD2 NAME(ProgramStringARB)(GLenum target, GLenum format, GLsizei len, const GLvoid * string)
-{
- DISPATCH(ProgramStringARB, (target, format, len, string), (F, "glProgramStringARB(0x%x, 0x%x, %d, %p);\n", target, format, len, (const void *) string));
-}
-
-KEYWORD1 void KEYWORD2 NAME(VertexAttrib1d)(GLuint index, GLdouble x)
-{
- DISPATCH(VertexAttrib1dARB, (index, x), (F, "glVertexAttrib1d(%d, %f);\n", index, x));
-}
-
-KEYWORD1 void KEYWORD2 NAME(VertexAttrib1dARB)(GLuint index, GLdouble x)
-{
- DISPATCH(VertexAttrib1dARB, (index, x), (F, "glVertexAttrib1dARB(%d, %f);\n", index, x));
-}
-
-KEYWORD1 void KEYWORD2 NAME(VertexAttrib1dv)(GLuint index, const GLdouble * v)
-{
- DISPATCH(VertexAttrib1dvARB, (index, v), (F, "glVertexAttrib1dv(%d, %p);\n", index, (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(VertexAttrib1dvARB)(GLuint index, const GLdouble * v)
-{
- DISPATCH(VertexAttrib1dvARB, (index, v), (F, "glVertexAttrib1dvARB(%d, %p);\n", index, (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(VertexAttrib1f)(GLuint index, GLfloat x)
-{
- DISPATCH(VertexAttrib1fARB, (index, x), (F, "glVertexAttrib1f(%d, %f);\n", index, x));
-}
-
-KEYWORD1 void KEYWORD2 NAME(VertexAttrib1fARB)(GLuint index, GLfloat x)
-{
- DISPATCH(VertexAttrib1fARB, (index, x), (F, "glVertexAttrib1fARB(%d, %f);\n", index, x));
-}
-
-KEYWORD1 void KEYWORD2 NAME(VertexAttrib1fv)(GLuint index, const GLfloat * v)
-{
- DISPATCH(VertexAttrib1fvARB, (index, v), (F, "glVertexAttrib1fv(%d, %p);\n", index, (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(VertexAttrib1fvARB)(GLuint index, const GLfloat * v)
-{
- DISPATCH(VertexAttrib1fvARB, (index, v), (F, "glVertexAttrib1fvARB(%d, %p);\n", index, (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(VertexAttrib1s)(GLuint index, GLshort x)
-{
- DISPATCH(VertexAttrib1sARB, (index, x), (F, "glVertexAttrib1s(%d, %d);\n", index, x));
-}
-
-KEYWORD1 void KEYWORD2 NAME(VertexAttrib1sARB)(GLuint index, GLshort x)
-{
- DISPATCH(VertexAttrib1sARB, (index, x), (F, "glVertexAttrib1sARB(%d, %d);\n", index, x));
-}
-
-KEYWORD1 void KEYWORD2 NAME(VertexAttrib1sv)(GLuint index, const GLshort * v)
-{
- DISPATCH(VertexAttrib1svARB, (index, v), (F, "glVertexAttrib1sv(%d, %p);\n", index, (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(VertexAttrib1svARB)(GLuint index, const GLshort * v)
-{
- DISPATCH(VertexAttrib1svARB, (index, v), (F, "glVertexAttrib1svARB(%d, %p);\n", index, (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(VertexAttrib2d)(GLuint index, GLdouble x, GLdouble y)
-{
- DISPATCH(VertexAttrib2dARB, (index, x, y), (F, "glVertexAttrib2d(%d, %f, %f);\n", index, x, y));
-}
-
-KEYWORD1 void KEYWORD2 NAME(VertexAttrib2dARB)(GLuint index, GLdouble x, GLdouble y)
-{
- DISPATCH(VertexAttrib2dARB, (index, x, y), (F, "glVertexAttrib2dARB(%d, %f, %f);\n", index, x, y));
-}
-
-KEYWORD1 void KEYWORD2 NAME(VertexAttrib2dv)(GLuint index, const GLdouble * v)
-{
- DISPATCH(VertexAttrib2dvARB, (index, v), (F, "glVertexAttrib2dv(%d, %p);\n", index, (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(VertexAttrib2dvARB)(GLuint index, const GLdouble * v)
-{
- DISPATCH(VertexAttrib2dvARB, (index, v), (F, "glVertexAttrib2dvARB(%d, %p);\n", index, (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(VertexAttrib2f)(GLuint index, GLfloat x, GLfloat y)
-{
- DISPATCH(VertexAttrib2fARB, (index, x, y), (F, "glVertexAttrib2f(%d, %f, %f);\n", index, x, y));
-}
-
-KEYWORD1 void KEYWORD2 NAME(VertexAttrib2fARB)(GLuint index, GLfloat x, GLfloat y)
-{
- DISPATCH(VertexAttrib2fARB, (index, x, y), (F, "glVertexAttrib2fARB(%d, %f, %f);\n", index, x, y));
-}
-
-KEYWORD1 void KEYWORD2 NAME(VertexAttrib2fv)(GLuint index, const GLfloat * v)
-{
- DISPATCH(VertexAttrib2fvARB, (index, v), (F, "glVertexAttrib2fv(%d, %p);\n", index, (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(VertexAttrib2fvARB)(GLuint index, const GLfloat * v)
-{
- DISPATCH(VertexAttrib2fvARB, (index, v), (F, "glVertexAttrib2fvARB(%d, %p);\n", index, (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(VertexAttrib2s)(GLuint index, GLshort x, GLshort y)
-{
- DISPATCH(VertexAttrib2sARB, (index, x, y), (F, "glVertexAttrib2s(%d, %d, %d);\n", index, x, y));
-}
-
-KEYWORD1 void KEYWORD2 NAME(VertexAttrib2sARB)(GLuint index, GLshort x, GLshort y)
-{
- DISPATCH(VertexAttrib2sARB, (index, x, y), (F, "glVertexAttrib2sARB(%d, %d, %d);\n", index, x, y));
-}
-
-KEYWORD1 void KEYWORD2 NAME(VertexAttrib2sv)(GLuint index, const GLshort * v)
-{
- DISPATCH(VertexAttrib2svARB, (index, v), (F, "glVertexAttrib2sv(%d, %p);\n", index, (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(VertexAttrib2svARB)(GLuint index, const GLshort * v)
-{
- DISPATCH(VertexAttrib2svARB, (index, v), (F, "glVertexAttrib2svARB(%d, %p);\n", index, (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(VertexAttrib3d)(GLuint index, GLdouble x, GLdouble y, GLdouble z)
-{
- DISPATCH(VertexAttrib3dARB, (index, x, y, z), (F, "glVertexAttrib3d(%d, %f, %f, %f);\n", index, x, y, z));
-}
-
-KEYWORD1 void KEYWORD2 NAME(VertexAttrib3dARB)(GLuint index, GLdouble x, GLdouble y, GLdouble z)
-{
- DISPATCH(VertexAttrib3dARB, (index, x, y, z), (F, "glVertexAttrib3dARB(%d, %f, %f, %f);\n", index, x, y, z));
-}
-
-KEYWORD1 void KEYWORD2 NAME(VertexAttrib3dv)(GLuint index, const GLdouble * v)
-{
- DISPATCH(VertexAttrib3dvARB, (index, v), (F, "glVertexAttrib3dv(%d, %p);\n", index, (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(VertexAttrib3dvARB)(GLuint index, const GLdouble * v)
-{
- DISPATCH(VertexAttrib3dvARB, (index, v), (F, "glVertexAttrib3dvARB(%d, %p);\n", index, (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(VertexAttrib3f)(GLuint index, GLfloat x, GLfloat y, GLfloat z)
-{
- DISPATCH(VertexAttrib3fARB, (index, x, y, z), (F, "glVertexAttrib3f(%d, %f, %f, %f);\n", index, x, y, z));
-}
-
-KEYWORD1 void KEYWORD2 NAME(VertexAttrib3fARB)(GLuint index, GLfloat x, GLfloat y, GLfloat z)
-{
- DISPATCH(VertexAttrib3fARB, (index, x, y, z), (F, "glVertexAttrib3fARB(%d, %f, %f, %f);\n", index, x, y, z));
-}
-
-KEYWORD1 void KEYWORD2 NAME(VertexAttrib3fv)(GLuint index, const GLfloat * v)
-{
- DISPATCH(VertexAttrib3fvARB, (index, v), (F, "glVertexAttrib3fv(%d, %p);\n", index, (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(VertexAttrib3fvARB)(GLuint index, const GLfloat * v)
-{
- DISPATCH(VertexAttrib3fvARB, (index, v), (F, "glVertexAttrib3fvARB(%d, %p);\n", index, (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(VertexAttrib3s)(GLuint index, GLshort x, GLshort y, GLshort z)
-{
- DISPATCH(VertexAttrib3sARB, (index, x, y, z), (F, "glVertexAttrib3s(%d, %d, %d, %d);\n", index, x, y, z));
-}
-
-KEYWORD1 void KEYWORD2 NAME(VertexAttrib3sARB)(GLuint index, GLshort x, GLshort y, GLshort z)
-{
- DISPATCH(VertexAttrib3sARB, (index, x, y, z), (F, "glVertexAttrib3sARB(%d, %d, %d, %d);\n", index, x, y, z));
-}
-
-KEYWORD1 void KEYWORD2 NAME(VertexAttrib3sv)(GLuint index, const GLshort * v)
-{
- DISPATCH(VertexAttrib3svARB, (index, v), (F, "glVertexAttrib3sv(%d, %p);\n", index, (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(VertexAttrib3svARB)(GLuint index, const GLshort * v)
-{
- DISPATCH(VertexAttrib3svARB, (index, v), (F, "glVertexAttrib3svARB(%d, %p);\n", index, (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(VertexAttrib4Nbv)(GLuint index, const GLbyte * v)
-{
- DISPATCH(VertexAttrib4NbvARB, (index, v), (F, "glVertexAttrib4Nbv(%d, %p);\n", index, (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(VertexAttrib4NbvARB)(GLuint index, const GLbyte * v)
-{
- DISPATCH(VertexAttrib4NbvARB, (index, v), (F, "glVertexAttrib4NbvARB(%d, %p);\n", index, (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(VertexAttrib4Niv)(GLuint index, const GLint * v)
-{
- DISPATCH(VertexAttrib4NivARB, (index, v), (F, "glVertexAttrib4Niv(%d, %p);\n", index, (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(VertexAttrib4NivARB)(GLuint index, const GLint * v)
-{
- DISPATCH(VertexAttrib4NivARB, (index, v), (F, "glVertexAttrib4NivARB(%d, %p);\n", index, (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(VertexAttrib4Nsv)(GLuint index, const GLshort * v)
-{
- DISPATCH(VertexAttrib4NsvARB, (index, v), (F, "glVertexAttrib4Nsv(%d, %p);\n", index, (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(VertexAttrib4NsvARB)(GLuint index, const GLshort * v)
-{
- DISPATCH(VertexAttrib4NsvARB, (index, v), (F, "glVertexAttrib4NsvARB(%d, %p);\n", index, (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(VertexAttrib4Nub)(GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w)
-{
- DISPATCH(VertexAttrib4NubARB, (index, x, y, z, w), (F, "glVertexAttrib4Nub(%d, %d, %d, %d, %d);\n", index, x, y, z, w));
-}
-
-KEYWORD1 void KEYWORD2 NAME(VertexAttrib4NubARB)(GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w)
-{
- DISPATCH(VertexAttrib4NubARB, (index, x, y, z, w), (F, "glVertexAttrib4NubARB(%d, %d, %d, %d, %d);\n", index, x, y, z, w));
-}
-
-KEYWORD1 void KEYWORD2 NAME(VertexAttrib4Nubv)(GLuint index, const GLubyte * v)
-{
- DISPATCH(VertexAttrib4NubvARB, (index, v), (F, "glVertexAttrib4Nubv(%d, %p);\n", index, (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(VertexAttrib4NubvARB)(GLuint index, const GLubyte * v)
-{
- DISPATCH(VertexAttrib4NubvARB, (index, v), (F, "glVertexAttrib4NubvARB(%d, %p);\n", index, (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(VertexAttrib4Nuiv)(GLuint index, const GLuint * v)
-{
- DISPATCH(VertexAttrib4NuivARB, (index, v), (F, "glVertexAttrib4Nuiv(%d, %p);\n", index, (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(VertexAttrib4NuivARB)(GLuint index, const GLuint * v)
-{
- DISPATCH(VertexAttrib4NuivARB, (index, v), (F, "glVertexAttrib4NuivARB(%d, %p);\n", index, (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(VertexAttrib4Nusv)(GLuint index, const GLushort * v)
-{
- DISPATCH(VertexAttrib4NusvARB, (index, v), (F, "glVertexAttrib4Nusv(%d, %p);\n", index, (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(VertexAttrib4NusvARB)(GLuint index, const GLushort * v)
-{
- DISPATCH(VertexAttrib4NusvARB, (index, v), (F, "glVertexAttrib4NusvARB(%d, %p);\n", index, (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(VertexAttrib4bv)(GLuint index, const GLbyte * v)
-{
- DISPATCH(VertexAttrib4bvARB, (index, v), (F, "glVertexAttrib4bv(%d, %p);\n", index, (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(VertexAttrib4bvARB)(GLuint index, const GLbyte * v)
-{
- DISPATCH(VertexAttrib4bvARB, (index, v), (F, "glVertexAttrib4bvARB(%d, %p);\n", index, (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(VertexAttrib4d)(GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w)
-{
- DISPATCH(VertexAttrib4dARB, (index, x, y, z, w), (F, "glVertexAttrib4d(%d, %f, %f, %f, %f);\n", index, x, y, z, w));
-}
-
-KEYWORD1 void KEYWORD2 NAME(VertexAttrib4dARB)(GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w)
-{
- DISPATCH(VertexAttrib4dARB, (index, x, y, z, w), (F, "glVertexAttrib4dARB(%d, %f, %f, %f, %f);\n", index, x, y, z, w));
-}
-
-KEYWORD1 void KEYWORD2 NAME(VertexAttrib4dv)(GLuint index, const GLdouble * v)
-{
- DISPATCH(VertexAttrib4dvARB, (index, v), (F, "glVertexAttrib4dv(%d, %p);\n", index, (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(VertexAttrib4dvARB)(GLuint index, const GLdouble * v)
-{
- DISPATCH(VertexAttrib4dvARB, (index, v), (F, "glVertexAttrib4dvARB(%d, %p);\n", index, (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(VertexAttrib4f)(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
-{
- DISPATCH(VertexAttrib4fARB, (index, x, y, z, w), (F, "glVertexAttrib4f(%d, %f, %f, %f, %f);\n", index, x, y, z, w));
-}
-
-KEYWORD1 void KEYWORD2 NAME(VertexAttrib4fARB)(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
-{
- DISPATCH(VertexAttrib4fARB, (index, x, y, z, w), (F, "glVertexAttrib4fARB(%d, %f, %f, %f, %f);\n", index, x, y, z, w));
-}
-
-KEYWORD1 void KEYWORD2 NAME(VertexAttrib4fv)(GLuint index, const GLfloat * v)
-{
- DISPATCH(VertexAttrib4fvARB, (index, v), (F, "glVertexAttrib4fv(%d, %p);\n", index, (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(VertexAttrib4fvARB)(GLuint index, const GLfloat * v)
-{
- DISPATCH(VertexAttrib4fvARB, (index, v), (F, "glVertexAttrib4fvARB(%d, %p);\n", index, (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(VertexAttrib4iv)(GLuint index, const GLint * v)
-{
- DISPATCH(VertexAttrib4ivARB, (index, v), (F, "glVertexAttrib4iv(%d, %p);\n", index, (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(VertexAttrib4ivARB)(GLuint index, const GLint * v)
-{
- DISPATCH(VertexAttrib4ivARB, (index, v), (F, "glVertexAttrib4ivARB(%d, %p);\n", index, (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(VertexAttrib4s)(GLuint index, GLshort x, GLshort y, GLshort z, GLshort w)
-{
- DISPATCH(VertexAttrib4sARB, (index, x, y, z, w), (F, "glVertexAttrib4s(%d, %d, %d, %d, %d);\n", index, x, y, z, w));
-}
-
-KEYWORD1 void KEYWORD2 NAME(VertexAttrib4sARB)(GLuint index, GLshort x, GLshort y, GLshort z, GLshort w)
-{
- DISPATCH(VertexAttrib4sARB, (index, x, y, z, w), (F, "glVertexAttrib4sARB(%d, %d, %d, %d, %d);\n", index, x, y, z, w));
-}
-
-KEYWORD1 void KEYWORD2 NAME(VertexAttrib4sv)(GLuint index, const GLshort * v)
-{
- DISPATCH(VertexAttrib4svARB, (index, v), (F, "glVertexAttrib4sv(%d, %p);\n", index, (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(VertexAttrib4svARB)(GLuint index, const GLshort * v)
-{
- DISPATCH(VertexAttrib4svARB, (index, v), (F, "glVertexAttrib4svARB(%d, %p);\n", index, (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(VertexAttrib4ubv)(GLuint index, const GLubyte * v)
-{
- DISPATCH(VertexAttrib4ubvARB, (index, v), (F, "glVertexAttrib4ubv(%d, %p);\n", index, (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(VertexAttrib4ubvARB)(GLuint index, const GLubyte * v)
-{
- DISPATCH(VertexAttrib4ubvARB, (index, v), (F, "glVertexAttrib4ubvARB(%d, %p);\n", index, (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(VertexAttrib4uiv)(GLuint index, const GLuint * v)
-{
- DISPATCH(VertexAttrib4uivARB, (index, v), (F, "glVertexAttrib4uiv(%d, %p);\n", index, (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(VertexAttrib4uivARB)(GLuint index, const GLuint * v)
-{
- DISPATCH(VertexAttrib4uivARB, (index, v), (F, "glVertexAttrib4uivARB(%d, %p);\n", index, (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(VertexAttrib4usv)(GLuint index, const GLushort * v)
-{
- DISPATCH(VertexAttrib4usvARB, (index, v), (F, "glVertexAttrib4usv(%d, %p);\n", index, (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(VertexAttrib4usvARB)(GLuint index, const GLushort * v)
-{
- DISPATCH(VertexAttrib4usvARB, (index, v), (F, "glVertexAttrib4usvARB(%d, %p);\n", index, (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(VertexAttribPointer)(GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid * pointer)
-{
- DISPATCH(VertexAttribPointerARB, (index, size, type, normalized, stride, pointer), (F, "glVertexAttribPointer(%d, %d, 0x%x, %d, %d, %p);\n", index, size, type, normalized, stride, (const void *) pointer));
-}
-
-KEYWORD1 void KEYWORD2 NAME(VertexAttribPointerARB)(GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid * pointer)
-{
- DISPATCH(VertexAttribPointerARB, (index, size, type, normalized, stride, pointer), (F, "glVertexAttribPointerARB(%d, %d, 0x%x, %d, %d, %p);\n", index, size, type, normalized, stride, (const void *) pointer));
-}
-
-KEYWORD1 void KEYWORD2 NAME(BindBuffer)(GLenum target, GLuint buffer)
-{
- DISPATCH(BindBufferARB, (target, buffer), (F, "glBindBuffer(0x%x, %d);\n", target, buffer));
-}
-
-KEYWORD1 void KEYWORD2 NAME(BindBufferARB)(GLenum target, GLuint buffer)
-{
- DISPATCH(BindBufferARB, (target, buffer), (F, "glBindBufferARB(0x%x, %d);\n", target, buffer));
-}
-
-KEYWORD1 void KEYWORD2 NAME(BufferData)(GLenum target, GLsizeiptr size, const GLvoid * data, GLenum usage)
-{
- DISPATCH(BufferDataARB, (target, size, data, usage), (F, "glBufferData(0x%x, %d, %p, 0x%x);\n", target, size, (const void *) data, usage));
-}
-
-KEYWORD1 void KEYWORD2 NAME(BufferDataARB)(GLenum target, GLsizeiptrARB size, const GLvoid * data, GLenum usage)
-{
- DISPATCH(BufferDataARB, (target, size, data, usage), (F, "glBufferDataARB(0x%x, %d, %p, 0x%x);\n", target, size, (const void *) data, usage));
-}
-
-KEYWORD1 void KEYWORD2 NAME(BufferSubData)(GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid * data)
-{
- DISPATCH(BufferSubDataARB, (target, offset, size, data), (F, "glBufferSubData(0x%x, %d, %d, %p);\n", target, offset, size, (const void *) data));
-}
-
-KEYWORD1 void KEYWORD2 NAME(BufferSubDataARB)(GLenum target, GLintptrARB offset, GLsizeiptrARB size, const GLvoid * data)
-{
- DISPATCH(BufferSubDataARB, (target, offset, size, data), (F, "glBufferSubDataARB(0x%x, %d, %d, %p);\n", target, offset, size, (const void *) data));
-}
-
-KEYWORD1 void KEYWORD2 NAME(DeleteBuffers)(GLsizei n, const GLuint * buffer)
-{
- DISPATCH(DeleteBuffersARB, (n, buffer), (F, "glDeleteBuffers(%d, %p);\n", n, (const void *) buffer));
-}
-
-KEYWORD1 void KEYWORD2 NAME(DeleteBuffersARB)(GLsizei n, const GLuint * buffer)
-{
- DISPATCH(DeleteBuffersARB, (n, buffer), (F, "glDeleteBuffersARB(%d, %p);\n", n, (const void *) buffer));
-}
-
-KEYWORD1 void KEYWORD2 NAME(GenBuffers)(GLsizei n, GLuint * buffer)
-{
- DISPATCH(GenBuffersARB, (n, buffer), (F, "glGenBuffers(%d, %p);\n", n, (const void *) buffer));
-}
-
-KEYWORD1 void KEYWORD2 NAME(GenBuffersARB)(GLsizei n, GLuint * buffer)
-{
- DISPATCH(GenBuffersARB, (n, buffer), (F, "glGenBuffersARB(%d, %p);\n", n, (const void *) buffer));
-}
-
-KEYWORD1 void KEYWORD2 NAME(GetBufferParameteriv)(GLenum target, GLenum pname, GLint * params)
-{
- DISPATCH(GetBufferParameterivARB, (target, pname, params), (F, "glGetBufferParameteriv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
-}
-
-KEYWORD1 void KEYWORD2 NAME(GetBufferParameterivARB)(GLenum target, GLenum pname, GLint * params)
-{
- DISPATCH(GetBufferParameterivARB, (target, pname, params), (F, "glGetBufferParameterivARB(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
-}
-
-KEYWORD1 void KEYWORD2 NAME(GetBufferPointerv)(GLenum target, GLenum pname, GLvoid ** params)
-{
- DISPATCH(GetBufferPointervARB, (target, pname, params), (F, "glGetBufferPointerv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
-}
-
-KEYWORD1 void KEYWORD2 NAME(GetBufferPointervARB)(GLenum target, GLenum pname, GLvoid ** params)
-{
- DISPATCH(GetBufferPointervARB, (target, pname, params), (F, "glGetBufferPointervARB(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
-}
-
-KEYWORD1 void KEYWORD2 NAME(GetBufferSubData)(GLenum target, GLintptr offset, GLsizeiptr size, GLvoid * data)
-{
- DISPATCH(GetBufferSubDataARB, (target, offset, size, data), (F, "glGetBufferSubData(0x%x, %d, %d, %p);\n", target, offset, size, (const void *) data));
-}
-
-KEYWORD1 void KEYWORD2 NAME(GetBufferSubDataARB)(GLenum target, GLintptrARB offset, GLsizeiptrARB size, GLvoid * data)
-{
- DISPATCH(GetBufferSubDataARB, (target, offset, size, data), (F, "glGetBufferSubDataARB(0x%x, %d, %d, %p);\n", target, offset, size, (const void *) data));
-}
-
-KEYWORD1 GLboolean KEYWORD2 NAME(IsBuffer)(GLuint buffer)
-{
- RETURN_DISPATCH(IsBufferARB, (buffer), (F, "glIsBuffer(%d);\n", buffer));
-}
-
-KEYWORD1 GLboolean KEYWORD2 NAME(IsBufferARB)(GLuint buffer)
-{
- RETURN_DISPATCH(IsBufferARB, (buffer), (F, "glIsBufferARB(%d);\n", buffer));
-}
-
-KEYWORD1 GLvoid * KEYWORD2 NAME(MapBuffer)(GLenum target, GLenum access)
-{
- RETURN_DISPATCH(MapBufferARB, (target, access), (F, "glMapBuffer(0x%x, 0x%x);\n", target, access));
-}
-
-KEYWORD1 GLvoid * KEYWORD2 NAME(MapBufferARB)(GLenum target, GLenum access)
-{
- RETURN_DISPATCH(MapBufferARB, (target, access), (F, "glMapBufferARB(0x%x, 0x%x);\n", target, access));
-}
-
-KEYWORD1 GLboolean KEYWORD2 NAME(UnmapBuffer)(GLenum target)
-{
- RETURN_DISPATCH(UnmapBufferARB, (target), (F, "glUnmapBuffer(0x%x);\n", target));
-}
-
-KEYWORD1 GLboolean KEYWORD2 NAME(UnmapBufferARB)(GLenum target)
-{
- RETURN_DISPATCH(UnmapBufferARB, (target), (F, "glUnmapBufferARB(0x%x);\n", target));
-}
-
-KEYWORD1 void KEYWORD2 NAME(BeginQuery)(GLenum target, GLuint id)
-{
- DISPATCH(BeginQueryARB, (target, id), (F, "glBeginQuery(0x%x, %d);\n", target, id));
-}
-
-KEYWORD1 void KEYWORD2 NAME(BeginQueryARB)(GLenum target, GLuint id)
-{
- DISPATCH(BeginQueryARB, (target, id), (F, "glBeginQueryARB(0x%x, %d);\n", target, id));
-}
-
-KEYWORD1 void KEYWORD2 NAME(DeleteQueries)(GLsizei n, const GLuint * ids)
-{
- DISPATCH(DeleteQueriesARB, (n, ids), (F, "glDeleteQueries(%d, %p);\n", n, (const void *) ids));
-}
-
-KEYWORD1 void KEYWORD2 NAME(DeleteQueriesARB)(GLsizei n, const GLuint * ids)
-{
- DISPATCH(DeleteQueriesARB, (n, ids), (F, "glDeleteQueriesARB(%d, %p);\n", n, (const void *) ids));
-}
-
-KEYWORD1 void KEYWORD2 NAME(EndQuery)(GLenum target)
-{
- DISPATCH(EndQueryARB, (target), (F, "glEndQuery(0x%x);\n", target));
-}
-
-KEYWORD1 void KEYWORD2 NAME(EndQueryARB)(GLenum target)
-{
- DISPATCH(EndQueryARB, (target), (F, "glEndQueryARB(0x%x);\n", target));
-}
-
-KEYWORD1 void KEYWORD2 NAME(GenQueries)(GLsizei n, GLuint * ids)
-{
- DISPATCH(GenQueriesARB, (n, ids), (F, "glGenQueries(%d, %p);\n", n, (const void *) ids));
-}
-
-KEYWORD1 void KEYWORD2 NAME(GenQueriesARB)(GLsizei n, GLuint * ids)
-{
- DISPATCH(GenQueriesARB, (n, ids), (F, "glGenQueriesARB(%d, %p);\n", n, (const void *) ids));
-}
-
-KEYWORD1 void KEYWORD2 NAME(GetQueryObjectiv)(GLuint id, GLenum pname, GLint * params)
-{
- DISPATCH(GetQueryObjectivARB, (id, pname, params), (F, "glGetQueryObjectiv(%d, 0x%x, %p);\n", id, pname, (const void *) params));
-}
-
-KEYWORD1 void KEYWORD2 NAME(GetQueryObjectivARB)(GLuint id, GLenum pname, GLint * params)
-{
- DISPATCH(GetQueryObjectivARB, (id, pname, params), (F, "glGetQueryObjectivARB(%d, 0x%x, %p);\n", id, pname, (const void *) params));
-}
-
-KEYWORD1 void KEYWORD2 NAME(GetQueryObjectuiv)(GLuint id, GLenum pname, GLuint * params)
-{
- DISPATCH(GetQueryObjectuivARB, (id, pname, params), (F, "glGetQueryObjectuiv(%d, 0x%x, %p);\n", id, pname, (const void *) params));
-}
-
-KEYWORD1 void KEYWORD2 NAME(GetQueryObjectuivARB)(GLuint id, GLenum pname, GLuint * params)
-{
- DISPATCH(GetQueryObjectuivARB, (id, pname, params), (F, "glGetQueryObjectuivARB(%d, 0x%x, %p);\n", id, pname, (const void *) params));
-}
-
-KEYWORD1 void KEYWORD2 NAME(GetQueryiv)(GLenum target, GLenum pname, GLint * params)
-{
- DISPATCH(GetQueryivARB, (target, pname, params), (F, "glGetQueryiv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
-}
-
-KEYWORD1 void KEYWORD2 NAME(GetQueryivARB)(GLenum target, GLenum pname, GLint * params)
-{
- DISPATCH(GetQueryivARB, (target, pname, params), (F, "glGetQueryivARB(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
-}
-
-KEYWORD1 GLboolean KEYWORD2 NAME(IsQuery)(GLuint id)
-{
- RETURN_DISPATCH(IsQueryARB, (id), (F, "glIsQuery(%d);\n", id));
-}
-
-KEYWORD1 GLboolean KEYWORD2 NAME(IsQueryARB)(GLuint id)
-{
- RETURN_DISPATCH(IsQueryARB, (id), (F, "glIsQueryARB(%d);\n", id));
-}
-
-KEYWORD1 void KEYWORD2 NAME(AttachObjectARB)(GLhandleARB containerObj, GLhandleARB obj)
-{
- DISPATCH(AttachObjectARB, (containerObj, obj), (F, "glAttachObjectARB(%d, %d);\n", containerObj, obj));
-}
-
-KEYWORD1 void KEYWORD2 NAME(CompileShader)(GLuint shader)
-{
- DISPATCH(CompileShaderARB, (shader), (F, "glCompileShader(%d);\n", shader));
-}
-
-KEYWORD1 void KEYWORD2 NAME(CompileShaderARB)(GLhandleARB shader)
-{
- DISPATCH(CompileShaderARB, (shader), (F, "glCompileShaderARB(%d);\n", shader));
-}
-
-KEYWORD1 GLhandleARB KEYWORD2 NAME(CreateProgramObjectARB)(void)
-{
- RETURN_DISPATCH(CreateProgramObjectARB, (), (F, "glCreateProgramObjectARB();\n"));
-}
-
-KEYWORD1 GLhandleARB KEYWORD2 NAME(CreateShaderObjectARB)(GLenum shaderType)
-{
- RETURN_DISPATCH(CreateShaderObjectARB, (shaderType), (F, "glCreateShaderObjectARB(0x%x);\n", shaderType));
-}
-
-KEYWORD1 void KEYWORD2 NAME(DeleteObjectARB)(GLhandleARB obj)
-{
- DISPATCH(DeleteObjectARB, (obj), (F, "glDeleteObjectARB(%d);\n", obj));
-}
-
-KEYWORD1 void KEYWORD2 NAME(DetachObjectARB)(GLhandleARB containerObj, GLhandleARB attachedObj)
-{
- DISPATCH(DetachObjectARB, (containerObj, attachedObj), (F, "glDetachObjectARB(%d, %d);\n", containerObj, attachedObj));
-}
-
-KEYWORD1 void KEYWORD2 NAME(GetActiveUniform)(GLuint program, GLuint index, GLsizei bufSize, GLsizei * length, GLint * size, GLenum * type, GLchar * name)
-{
- DISPATCH(GetActiveUniformARB, (program, index, bufSize, length, size, type, name), (F, "glGetActiveUniform(%d, %d, %d, %p, %p, %p, %p);\n", program, index, bufSize, (const void *) length, (const void *) size, (const void *) type, (const void *) name));
-}
-
-KEYWORD1 void KEYWORD2 NAME(GetActiveUniformARB)(GLhandleARB program, GLuint index, GLsizei bufSize, GLsizei * length, GLint * size, GLenum * type, GLcharARB * name)
-{
- DISPATCH(GetActiveUniformARB, (program, index, bufSize, length, size, type, name), (F, "glGetActiveUniformARB(%d, %d, %d, %p, %p, %p, %p);\n", program, index, bufSize, (const void *) length, (const void *) size, (const void *) type, (const void *) name));
-}
-
-KEYWORD1 void KEYWORD2 NAME(GetAttachedObjectsARB)(GLhandleARB containerObj, GLsizei maxLength, GLsizei * length, GLhandleARB * infoLog)
-{
- DISPATCH(GetAttachedObjectsARB, (containerObj, maxLength, length, infoLog), (F, "glGetAttachedObjectsARB(%d, %d, %p, %p);\n", containerObj, maxLength, (const void *) length, (const void *) infoLog));
-}
-
-KEYWORD1 GLhandleARB KEYWORD2 NAME(GetHandleARB)(GLenum pname)
-{
- RETURN_DISPATCH(GetHandleARB, (pname), (F, "glGetHandleARB(0x%x);\n", pname));
-}
-
-KEYWORD1 void KEYWORD2 NAME(GetInfoLogARB)(GLhandleARB obj, GLsizei maxLength, GLsizei * length, GLcharARB * infoLog)
-{
- DISPATCH(GetInfoLogARB, (obj, maxLength, length, infoLog), (F, "glGetInfoLogARB(%d, %d, %p, %p);\n", obj, maxLength, (const void *) length, (const void *) infoLog));
-}
-
-KEYWORD1 void KEYWORD2 NAME(GetObjectParameterfvARB)(GLhandleARB obj, GLenum pname, GLfloat * params)
-{
- DISPATCH(GetObjectParameterfvARB, (obj, pname, params), (F, "glGetObjectParameterfvARB(%d, 0x%x, %p);\n", obj, pname, (const void *) params));
-}
-
-KEYWORD1 void KEYWORD2 NAME(GetObjectParameterivARB)(GLhandleARB obj, GLenum pname, GLint * params)
-{
- DISPATCH(GetObjectParameterivARB, (obj, pname, params), (F, "glGetObjectParameterivARB(%d, 0x%x, %p);\n", obj, pname, (const void *) params));
-}
-
-KEYWORD1 void KEYWORD2 NAME(GetShaderSource)(GLuint shader, GLsizei bufSize, GLsizei * length, GLchar * source)
-{
- DISPATCH(GetShaderSourceARB, (shader, bufSize, length, source), (F, "glGetShaderSource(%d, %d, %p, %p);\n", shader, bufSize, (const void *) length, (const void *) source));
-}
-
-KEYWORD1 void KEYWORD2 NAME(GetShaderSourceARB)(GLhandleARB shader, GLsizei bufSize, GLsizei * length, GLcharARB * source)
-{
- DISPATCH(GetShaderSourceARB, (shader, bufSize, length, source), (F, "glGetShaderSourceARB(%d, %d, %p, %p);\n", shader, bufSize, (const void *) length, (const void *) source));
-}
-
-KEYWORD1 GLint KEYWORD2 NAME(GetUniformLocation)(GLuint program, const GLchar * name)
-{
- RETURN_DISPATCH(GetUniformLocationARB, (program, name), (F, "glGetUniformLocation(%d, %p);\n", program, (const void *) name));
-}
-
-KEYWORD1 GLint KEYWORD2 NAME(GetUniformLocationARB)(GLhandleARB program, const GLcharARB * name)
-{
- RETURN_DISPATCH(GetUniformLocationARB, (program, name), (F, "glGetUniformLocationARB(%d, %p);\n", program, (const void *) name));
-}
-
-KEYWORD1 void KEYWORD2 NAME(GetUniformfv)(GLuint program, GLint location, GLfloat * params)
-{
- DISPATCH(GetUniformfvARB, (program, location, params), (F, "glGetUniformfv(%d, %d, %p);\n", program, location, (const void *) params));
-}
-
-KEYWORD1 void KEYWORD2 NAME(GetUniformfvARB)(GLhandleARB program, GLint location, GLfloat * params)
-{
- DISPATCH(GetUniformfvARB, (program, location, params), (F, "glGetUniformfvARB(%d, %d, %p);\n", program, location, (const void *) params));
-}
-
-KEYWORD1 void KEYWORD2 NAME(GetUniformiv)(GLuint program, GLint location, GLint * params)
-{
- DISPATCH(GetUniformivARB, (program, location, params), (F, "glGetUniformiv(%d, %d, %p);\n", program, location, (const void *) params));
-}
-
-KEYWORD1 void KEYWORD2 NAME(GetUniformivARB)(GLhandleARB program, GLint location, GLint * params)
-{
- DISPATCH(GetUniformivARB, (program, location, params), (F, "glGetUniformivARB(%d, %d, %p);\n", program, location, (const void *) params));
-}
-
-KEYWORD1 void KEYWORD2 NAME(LinkProgram)(GLuint program)
-{
- DISPATCH(LinkProgramARB, (program), (F, "glLinkProgram(%d);\n", program));
-}
-
-KEYWORD1 void KEYWORD2 NAME(LinkProgramARB)(GLhandleARB program)
-{
- DISPATCH(LinkProgramARB, (program), (F, "glLinkProgramARB(%d);\n", program));
-}
-
-KEYWORD1 void KEYWORD2 NAME(ShaderSource)(GLuint shader, GLsizei count, const GLchar ** string, const GLint * length)
-{
- DISPATCH(ShaderSourceARB, (shader, count, string, length), (F, "glShaderSource(%d, %d, %p, %p);\n", shader, count, (const void *) string, (const void *) length));
-}
-
-KEYWORD1 void KEYWORD2 NAME(ShaderSourceARB)(GLhandleARB shader, GLsizei count, const GLcharARB ** string, const GLint * length)
-{
- DISPATCH(ShaderSourceARB, (shader, count, string, length), (F, "glShaderSourceARB(%d, %d, %p, %p);\n", shader, count, (const void *) string, (const void *) length));
-}
-
-KEYWORD1 void KEYWORD2 NAME(Uniform1f)(GLint location, GLfloat v0)
-{
- DISPATCH(Uniform1fARB, (location, v0), (F, "glUniform1f(%d, %f);\n", location, v0));
-}
-
-KEYWORD1 void KEYWORD2 NAME(Uniform1fARB)(GLint location, GLfloat v0)
-{
- DISPATCH(Uniform1fARB, (location, v0), (F, "glUniform1fARB(%d, %f);\n", location, v0));
-}
-
-KEYWORD1 void KEYWORD2 NAME(Uniform1fv)(GLint location, GLsizei count, const GLfloat * value)
-{
- DISPATCH(Uniform1fvARB, (location, count, value), (F, "glUniform1fv(%d, %d, %p);\n", location, count, (const void *) value));
-}
-
-KEYWORD1 void KEYWORD2 NAME(Uniform1fvARB)(GLint location, GLsizei count, const GLfloat * value)
-{
- DISPATCH(Uniform1fvARB, (location, count, value), (F, "glUniform1fvARB(%d, %d, %p);\n", location, count, (const void *) value));
-}
-
-KEYWORD1 void KEYWORD2 NAME(Uniform1i)(GLint location, GLint v0)
-{
- DISPATCH(Uniform1iARB, (location, v0), (F, "glUniform1i(%d, %d);\n", location, v0));
-}
-
-KEYWORD1 void KEYWORD2 NAME(Uniform1iARB)(GLint location, GLint v0)
-{
- DISPATCH(Uniform1iARB, (location, v0), (F, "glUniform1iARB(%d, %d);\n", location, v0));
-}
-
-KEYWORD1 void KEYWORD2 NAME(Uniform1iv)(GLint location, GLsizei count, const GLint * value)
-{
- DISPATCH(Uniform1ivARB, (location, count, value), (F, "glUniform1iv(%d, %d, %p);\n", location, count, (const void *) value));
-}
-
-KEYWORD1 void KEYWORD2 NAME(Uniform1ivARB)(GLint location, GLsizei count, const GLint * value)
-{
- DISPATCH(Uniform1ivARB, (location, count, value), (F, "glUniform1ivARB(%d, %d, %p);\n", location, count, (const void *) value));
-}
-
-KEYWORD1 void KEYWORD2 NAME(Uniform2f)(GLint location, GLfloat v0, GLfloat v1)
-{
- DISPATCH(Uniform2fARB, (location, v0, v1), (F, "glUniform2f(%d, %f, %f);\n", location, v0, v1));
-}
-
-KEYWORD1 void KEYWORD2 NAME(Uniform2fARB)(GLint location, GLfloat v0, GLfloat v1)
-{
- DISPATCH(Uniform2fARB, (location, v0, v1), (F, "glUniform2fARB(%d, %f, %f);\n", location, v0, v1));
-}
-
-KEYWORD1 void KEYWORD2 NAME(Uniform2fv)(GLint location, GLsizei count, const GLfloat * value)
-{
- DISPATCH(Uniform2fvARB, (location, count, value), (F, "glUniform2fv(%d, %d, %p);\n", location, count, (const void *) value));
-}
-
-KEYWORD1 void KEYWORD2 NAME(Uniform2fvARB)(GLint location, GLsizei count, const GLfloat * value)
-{
- DISPATCH(Uniform2fvARB, (location, count, value), (F, "glUniform2fvARB(%d, %d, %p);\n", location, count, (const void *) value));
-}
-
-KEYWORD1 void KEYWORD2 NAME(Uniform2i)(GLint location, GLint v0, GLint v1)
-{
- DISPATCH(Uniform2iARB, (location, v0, v1), (F, "glUniform2i(%d, %d, %d);\n", location, v0, v1));
-}
-
-KEYWORD1 void KEYWORD2 NAME(Uniform2iARB)(GLint location, GLint v0, GLint v1)
-{
- DISPATCH(Uniform2iARB, (location, v0, v1), (F, "glUniform2iARB(%d, %d, %d);\n", location, v0, v1));
-}
-
-KEYWORD1 void KEYWORD2 NAME(Uniform2iv)(GLint location, GLsizei count, const GLint * value)
-{
- DISPATCH(Uniform2ivARB, (location, count, value), (F, "glUniform2iv(%d, %d, %p);\n", location, count, (const void *) value));
-}
-
-KEYWORD1 void KEYWORD2 NAME(Uniform2ivARB)(GLint location, GLsizei count, const GLint * value)
-{
- DISPATCH(Uniform2ivARB, (location, count, value), (F, "glUniform2ivARB(%d, %d, %p);\n", location, count, (const void *) value));
-}
-
-KEYWORD1 void KEYWORD2 NAME(Uniform3f)(GLint location, GLfloat v0, GLfloat v1, GLfloat v2)
-{
- DISPATCH(Uniform3fARB, (location, v0, v1, v2), (F, "glUniform3f(%d, %f, %f, %f);\n", location, v0, v1, v2));
-}
-
-KEYWORD1 void KEYWORD2 NAME(Uniform3fARB)(GLint location, GLfloat v0, GLfloat v1, GLfloat v2)
-{
- DISPATCH(Uniform3fARB, (location, v0, v1, v2), (F, "glUniform3fARB(%d, %f, %f, %f);\n", location, v0, v1, v2));
-}
-
-KEYWORD1 void KEYWORD2 NAME(Uniform3fv)(GLint location, GLsizei count, const GLfloat * value)
-{
- DISPATCH(Uniform3fvARB, (location, count, value), (F, "glUniform3fv(%d, %d, %p);\n", location, count, (const void *) value));
-}
-
-KEYWORD1 void KEYWORD2 NAME(Uniform3fvARB)(GLint location, GLsizei count, const GLfloat * value)
-{
- DISPATCH(Uniform3fvARB, (location, count, value), (F, "glUniform3fvARB(%d, %d, %p);\n", location, count, (const void *) value));
-}
-
-KEYWORD1 void KEYWORD2 NAME(Uniform3i)(GLint location, GLint v0, GLint v1, GLint v2)
-{
- DISPATCH(Uniform3iARB, (location, v0, v1, v2), (F, "glUniform3i(%d, %d, %d, %d);\n", location, v0, v1, v2));
-}
-
-KEYWORD1 void KEYWORD2 NAME(Uniform3iARB)(GLint location, GLint v0, GLint v1, GLint v2)
-{
- DISPATCH(Uniform3iARB, (location, v0, v1, v2), (F, "glUniform3iARB(%d, %d, %d, %d);\n", location, v0, v1, v2));
-}
-
-KEYWORD1 void KEYWORD2 NAME(Uniform3iv)(GLint location, GLsizei count, const GLint * value)
-{
- DISPATCH(Uniform3ivARB, (location, count, value), (F, "glUniform3iv(%d, %d, %p);\n", location, count, (const void *) value));
-}
-
-KEYWORD1 void KEYWORD2 NAME(Uniform3ivARB)(GLint location, GLsizei count, const GLint * value)
-{
- DISPATCH(Uniform3ivARB, (location, count, value), (F, "glUniform3ivARB(%d, %d, %p);\n", location, count, (const void *) value));
-}
-
-KEYWORD1 void KEYWORD2 NAME(Uniform4f)(GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3)
-{
- DISPATCH(Uniform4fARB, (location, v0, v1, v2, v3), (F, "glUniform4f(%d, %f, %f, %f, %f);\n", location, v0, v1, v2, v3));
-}
-
-KEYWORD1 void KEYWORD2 NAME(Uniform4fARB)(GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3)
-{
- DISPATCH(Uniform4fARB, (location, v0, v1, v2, v3), (F, "glUniform4fARB(%d, %f, %f, %f, %f);\n", location, v0, v1, v2, v3));
-}
-
-KEYWORD1 void KEYWORD2 NAME(Uniform4fv)(GLint location, GLsizei count, const GLfloat * value)
-{
- DISPATCH(Uniform4fvARB, (location, count, value), (F, "glUniform4fv(%d, %d, %p);\n", location, count, (const void *) value));
-}
-
-KEYWORD1 void KEYWORD2 NAME(Uniform4fvARB)(GLint location, GLsizei count, const GLfloat * value)
-{
- DISPATCH(Uniform4fvARB, (location, count, value), (F, "glUniform4fvARB(%d, %d, %p);\n", location, count, (const void *) value));
-}
-
-KEYWORD1 void KEYWORD2 NAME(Uniform4i)(GLint location, GLint v0, GLint v1, GLint v2, GLint v3)
-{
- DISPATCH(Uniform4iARB, (location, v0, v1, v2, v3), (F, "glUniform4i(%d, %d, %d, %d, %d);\n", location, v0, v1, v2, v3));
-}
-
-KEYWORD1 void KEYWORD2 NAME(Uniform4iARB)(GLint location, GLint v0, GLint v1, GLint v2, GLint v3)
-{
- DISPATCH(Uniform4iARB, (location, v0, v1, v2, v3), (F, "glUniform4iARB(%d, %d, %d, %d, %d);\n", location, v0, v1, v2, v3));
-}
-
-KEYWORD1 void KEYWORD2 NAME(Uniform4iv)(GLint location, GLsizei count, const GLint * value)
-{
- DISPATCH(Uniform4ivARB, (location, count, value), (F, "glUniform4iv(%d, %d, %p);\n", location, count, (const void *) value));
-}
-
-KEYWORD1 void KEYWORD2 NAME(Uniform4ivARB)(GLint location, GLsizei count, const GLint * value)
-{
- DISPATCH(Uniform4ivARB, (location, count, value), (F, "glUniform4ivARB(%d, %d, %p);\n", location, count, (const void *) value));
-}
-
-KEYWORD1 void KEYWORD2 NAME(UniformMatrix2fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value)
-{
- DISPATCH(UniformMatrix2fvARB, (location, count, transpose, value), (F, "glUniformMatrix2fv(%d, %d, %d, %p);\n", location, count, transpose, (const void *) value));
-}
-
-KEYWORD1 void KEYWORD2 NAME(UniformMatrix2fvARB)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value)
-{
- DISPATCH(UniformMatrix2fvARB, (location, count, transpose, value), (F, "glUniformMatrix2fvARB(%d, %d, %d, %p);\n", location, count, transpose, (const void *) value));
-}
-
-KEYWORD1 void KEYWORD2 NAME(UniformMatrix3fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value)
-{
- DISPATCH(UniformMatrix3fvARB, (location, count, transpose, value), (F, "glUniformMatrix3fv(%d, %d, %d, %p);\n", location, count, transpose, (const void *) value));
-}
-
-KEYWORD1 void KEYWORD2 NAME(UniformMatrix3fvARB)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value)
-{
- DISPATCH(UniformMatrix3fvARB, (location, count, transpose, value), (F, "glUniformMatrix3fvARB(%d, %d, %d, %p);\n", location, count, transpose, (const void *) value));
-}
-
-KEYWORD1 void KEYWORD2 NAME(UniformMatrix4fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value)
-{
- DISPATCH(UniformMatrix4fvARB, (location, count, transpose, value), (F, "glUniformMatrix4fv(%d, %d, %d, %p);\n", location, count, transpose, (const void *) value));
-}
-
-KEYWORD1 void KEYWORD2 NAME(UniformMatrix4fvARB)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value)
-{
- DISPATCH(UniformMatrix4fvARB, (location, count, transpose, value), (F, "glUniformMatrix4fvARB(%d, %d, %d, %p);\n", location, count, transpose, (const void *) value));
-}
-
-KEYWORD1 void KEYWORD2 NAME(UseProgram)(GLuint program)
-{
- DISPATCH(UseProgramObjectARB, (program), (F, "glUseProgram(%d);\n", program));
-}
-
-KEYWORD1 void KEYWORD2 NAME(UseProgramObjectARB)(GLhandleARB program)
-{
- DISPATCH(UseProgramObjectARB, (program), (F, "glUseProgramObjectARB(%d);\n", program));
-}
-
-KEYWORD1 void KEYWORD2 NAME(ValidateProgram)(GLuint program)
-{
- DISPATCH(ValidateProgramARB, (program), (F, "glValidateProgram(%d);\n", program));
-}
-
-KEYWORD1 void KEYWORD2 NAME(ValidateProgramARB)(GLhandleARB program)
-{
- DISPATCH(ValidateProgramARB, (program), (F, "glValidateProgramARB(%d);\n", program));
-}
-
-KEYWORD1 void KEYWORD2 NAME(BindAttribLocation)(GLuint program, GLuint index, const GLchar * name)
-{
- DISPATCH(BindAttribLocationARB, (program, index, name), (F, "glBindAttribLocation(%d, %d, %p);\n", program, index, (const void *) name));
-}
-
-KEYWORD1 void KEYWORD2 NAME(BindAttribLocationARB)(GLhandleARB program, GLuint index, const GLcharARB * name)
-{
- DISPATCH(BindAttribLocationARB, (program, index, name), (F, "glBindAttribLocationARB(%d, %d, %p);\n", program, index, (const void *) name));
-}
-
-KEYWORD1 void KEYWORD2 NAME(GetActiveAttrib)(GLuint program, GLuint index, GLsizei bufSize, GLsizei * length, GLint * size, GLenum * type, GLchar * name)
-{
- DISPATCH(GetActiveAttribARB, (program, index, bufSize, length, size, type, name), (F, "glGetActiveAttrib(%d, %d, %d, %p, %p, %p, %p);\n", program, index, bufSize, (const void *) length, (const void *) size, (const void *) type, (const void *) name));
-}
-
-KEYWORD1 void KEYWORD2 NAME(GetActiveAttribARB)(GLhandleARB program, GLuint index, GLsizei bufSize, GLsizei * length, GLint * size, GLenum * type, GLcharARB * name)
-{
- DISPATCH(GetActiveAttribARB, (program, index, bufSize, length, size, type, name), (F, "glGetActiveAttribARB(%d, %d, %d, %p, %p, %p, %p);\n", program, index, bufSize, (const void *) length, (const void *) size, (const void *) type, (const void *) name));
-}
-
-KEYWORD1 GLint KEYWORD2 NAME(GetAttribLocation)(GLuint program, const GLchar * name)
-{
- RETURN_DISPATCH(GetAttribLocationARB, (program, name), (F, "glGetAttribLocation(%d, %p);\n", program, (const void *) name));
-}
-
-KEYWORD1 GLint KEYWORD2 NAME(GetAttribLocationARB)(GLhandleARB program, const GLcharARB * name)
-{
- RETURN_DISPATCH(GetAttribLocationARB, (program, name), (F, "glGetAttribLocationARB(%d, %p);\n", program, (const void *) name));
-}
-
-KEYWORD1 void KEYWORD2 NAME(DrawBuffers)(GLsizei n, const GLenum * bufs)
-{
- DISPATCH(DrawBuffersARB, (n, bufs), (F, "glDrawBuffers(%d, %p);\n", n, (const void *) bufs));
-}
-
-KEYWORD1 void KEYWORD2 NAME(DrawBuffersARB)(GLsizei n, const GLenum * bufs)
-{
- DISPATCH(DrawBuffersARB, (n, bufs), (F, "glDrawBuffersARB(%d, %p);\n", n, (const void *) bufs));
-}
-
-KEYWORD1 void KEYWORD2 NAME(DrawBuffersATI)(GLsizei n, const GLenum * bufs)
-{
- DISPATCH(DrawBuffersARB, (n, bufs), (F, "glDrawBuffersATI(%d, %p);\n", n, (const void *) bufs));
-}
-
-KEYWORD1 void KEYWORD2 NAME(ClampColorARB)(GLenum target, GLenum clamp)
-{
- DISPATCH(ClampColorARB, (target, clamp), (F, "glClampColorARB(0x%x, 0x%x);\n", target, clamp));
-}
-
-KEYWORD1 void KEYWORD2 NAME(DrawArraysInstancedARB)(GLenum mode, GLint first, GLsizei count, GLsizei primcount)
-{
- DISPATCH(DrawArraysInstancedARB, (mode, first, count, primcount), (F, "glDrawArraysInstancedARB(0x%x, %d, %d, %d);\n", mode, first, count, primcount));
-}
-
-KEYWORD1 void KEYWORD2 NAME(DrawArraysInstancedEXT)(GLenum mode, GLint first, GLsizei count, GLsizei primcount)
-{
- DISPATCH(DrawArraysInstancedARB, (mode, first, count, primcount), (F, "glDrawArraysInstancedEXT(0x%x, %d, %d, %d);\n", mode, first, count, primcount));
-}
-
-KEYWORD1 void KEYWORD2 NAME(DrawArraysInstanced)(GLenum mode, GLint first, GLsizei count, GLsizei primcount)
-{
- DISPATCH(DrawArraysInstancedARB, (mode, first, count, primcount), (F, "glDrawArraysInstanced(0x%x, %d, %d, %d);\n", mode, first, count, primcount));
-}
-
-KEYWORD1 void KEYWORD2 NAME(DrawElementsInstancedARB)(GLenum mode, GLsizei count, GLenum type, const GLvoid * indices, GLsizei primcount)
-{
- DISPATCH(DrawElementsInstancedARB, (mode, count, type, indices, primcount), (F, "glDrawElementsInstancedARB(0x%x, %d, 0x%x, %p, %d);\n", mode, count, type, (const void *) indices, primcount));
-}
-
-KEYWORD1 void KEYWORD2 NAME(DrawElementsInstancedEXT)(GLenum mode, GLsizei count, GLenum type, const GLvoid * indices, GLsizei primcount)
-{
- DISPATCH(DrawElementsInstancedARB, (mode, count, type, indices, primcount), (F, "glDrawElementsInstancedEXT(0x%x, %d, 0x%x, %p, %d);\n", mode, count, type, (const void *) indices, primcount));
-}
-
-KEYWORD1 void KEYWORD2 NAME(DrawElementsInstanced)(GLenum mode, GLsizei count, GLenum type, const GLvoid * indices, GLsizei primcount)
-{
- DISPATCH(DrawElementsInstancedARB, (mode, count, type, indices, primcount), (F, "glDrawElementsInstanced(0x%x, %d, 0x%x, %p, %d);\n", mode, count, type, (const void *) indices, primcount));
-}
-
-KEYWORD1 void KEYWORD2 NAME(RenderbufferStorageMultisample)(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height)
-{
- DISPATCH(RenderbufferStorageMultisample, (target, samples, internalformat, width, height), (F, "glRenderbufferStorageMultisample(0x%x, %d, 0x%x, %d, %d);\n", target, samples, internalformat, width, height));
-}
-
-KEYWORD1 void KEYWORD2 NAME(RenderbufferStorageMultisampleEXT)(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height)
-{
- DISPATCH(RenderbufferStorageMultisample, (target, samples, internalformat, width, height), (F, "glRenderbufferStorageMultisampleEXT(0x%x, %d, 0x%x, %d, %d);\n", target, samples, internalformat, width, height));
-}
-
-KEYWORD1 void KEYWORD2 NAME(FramebufferTextureARB)(GLenum target, GLenum attachment, GLuint texture, GLint level)
-{
- DISPATCH(FramebufferTextureARB, (target, attachment, texture, level), (F, "glFramebufferTextureARB(0x%x, 0x%x, %d, %d);\n", target, attachment, texture, level));
-}
-
-KEYWORD1 void KEYWORD2 NAME(FramebufferTextureFaceARB)(GLenum target, GLenum attachment, GLuint texture, GLint level, GLenum face)
-{
- DISPATCH(FramebufferTextureFaceARB, (target, attachment, texture, level, face), (F, "glFramebufferTextureFaceARB(0x%x, 0x%x, %d, %d, 0x%x);\n", target, attachment, texture, level, face));
-}
-
-KEYWORD1 void KEYWORD2 NAME(ProgramParameteriARB)(GLuint program, GLenum pname, GLint value)
-{
- DISPATCH(ProgramParameteriARB, (program, pname, value), (F, "glProgramParameteriARB(%d, 0x%x, %d);\n", program, pname, value));
-}
-
-KEYWORD1 void KEYWORD2 NAME(VertexAttribDivisorARB)(GLuint index, GLuint divisor)
-{
- DISPATCH(VertexAttribDivisorARB, (index, divisor), (F, "glVertexAttribDivisorARB(%d, %d);\n", index, divisor));
-}
-
-KEYWORD1 void KEYWORD2 NAME(FlushMappedBufferRange)(GLenum target, GLintptr offset, GLsizeiptr length)
-{
- DISPATCH(FlushMappedBufferRange, (target, offset, length), (F, "glFlushMappedBufferRange(0x%x, %d, %d);\n", target, offset, length));
-}
-
-KEYWORD1 GLvoid * KEYWORD2 NAME(MapBufferRange)(GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access)
-{
- RETURN_DISPATCH(MapBufferRange, (target, offset, length, access), (F, "glMapBufferRange(0x%x, %d, %d, %d);\n", target, offset, length, access));
-}
-
-KEYWORD1 void KEYWORD2 NAME(TexBufferARB)(GLenum target, GLenum internalFormat, GLuint buffer)
-{
- DISPATCH(TexBufferARB, (target, internalFormat, buffer), (F, "glTexBufferARB(0x%x, 0x%x, %d);\n", target, internalFormat, buffer));
-}
-
-KEYWORD1 void KEYWORD2 NAME(BindVertexArray)(GLuint array)
-{
- DISPATCH(BindVertexArray, (array), (F, "glBindVertexArray(%d);\n", array));
-}
-
-KEYWORD1 void KEYWORD2 NAME(GenVertexArrays)(GLsizei n, GLuint * arrays)
-{
- DISPATCH(GenVertexArrays, (n, arrays), (F, "glGenVertexArrays(%d, %p);\n", n, (const void *) arrays));
-}
-
-KEYWORD1 void KEYWORD2 NAME(CopyBufferSubData)(GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size)
-{
- DISPATCH(CopyBufferSubData, (readTarget, writeTarget, readOffset, writeOffset, size), (F, "glCopyBufferSubData(0x%x, 0x%x, %d, %d, %d);\n", readTarget, writeTarget, readOffset, writeOffset, size));
-}
-
-KEYWORD1 GLenum KEYWORD2 NAME(ClientWaitSync)(GLsync sync, GLbitfield flags, GLuint64 timeout)
-{
- RETURN_DISPATCH(ClientWaitSync, (sync, flags, timeout), (F, "glClientWaitSync(%d, %d, %d);\n", sync, flags, timeout));
-}
-
-KEYWORD1 void KEYWORD2 NAME(DeleteSync)(GLsync sync)
-{
- DISPATCH(DeleteSync, (sync), (F, "glDeleteSync(%d);\n", sync));
-}
-
-KEYWORD1 GLsync KEYWORD2 NAME(FenceSync)(GLenum condition, GLbitfield flags)
-{
- RETURN_DISPATCH(FenceSync, (condition, flags), (F, "glFenceSync(0x%x, %d);\n", condition, flags));
-}
-
-KEYWORD1 void KEYWORD2 NAME(GetInteger64v)(GLenum pname, GLint64 * params)
-{
- DISPATCH(GetInteger64v, (pname, params), (F, "glGetInteger64v(0x%x, %p);\n", pname, (const void *) params));
-}
-
-KEYWORD1 void KEYWORD2 NAME(GetSynciv)(GLsync sync, GLenum pname, GLsizei bufSize, GLsizei * length, GLint * values)
-{
- DISPATCH(GetSynciv, (sync, pname, bufSize, length, values), (F, "glGetSynciv(%d, 0x%x, %d, %p, %p);\n", sync, pname, bufSize, (const void *) length, (const void *) values));
-}
-
-KEYWORD1 GLboolean KEYWORD2 NAME(IsSync)(GLsync sync)
-{
- RETURN_DISPATCH(IsSync, (sync), (F, "glIsSync(%d);\n", sync));
-}
-
-KEYWORD1 void KEYWORD2 NAME(WaitSync)(GLsync sync, GLbitfield flags, GLuint64 timeout)
-{
- DISPATCH(WaitSync, (sync, flags, timeout), (F, "glWaitSync(%d, %d, %d);\n", sync, flags, timeout));
-}
-
-KEYWORD1 void KEYWORD2 NAME(DrawElementsBaseVertex)(GLenum mode, GLsizei count, GLenum type, const GLvoid * indices, GLint basevertex)
-{
- DISPATCH(DrawElementsBaseVertex, (mode, count, type, indices, basevertex), (F, "glDrawElementsBaseVertex(0x%x, %d, 0x%x, %p, %d);\n", mode, count, type, (const void *) indices, basevertex));
-}
-
-KEYWORD1 void KEYWORD2 NAME(DrawRangeElementsBaseVertex)(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid * indices, GLint basevertex)
-{
- DISPATCH(DrawRangeElementsBaseVertex, (mode, start, end, count, type, indices, basevertex), (F, "glDrawRangeElementsBaseVertex(0x%x, %d, %d, %d, 0x%x, %p, %d);\n", mode, start, end, count, type, (const void *) indices, basevertex));
-}
-
-KEYWORD1 void KEYWORD2 NAME(MultiDrawElementsBaseVertex)(GLenum mode, const GLsizei * count, GLenum type, const GLvoid ** indices, GLsizei primcount, const GLint * basevertex)
-{
- DISPATCH(MultiDrawElementsBaseVertex, (mode, count, type, indices, primcount, basevertex), (F, "glMultiDrawElementsBaseVertex(0x%x, %p, 0x%x, %p, %d, %p);\n", mode, (const void *) count, type, (const void *) indices, primcount, (const void *) basevertex));
-}
-
-KEYWORD1 void KEYWORD2 NAME(BlendEquationSeparateiARB)(GLuint buf, GLenum modeRGB, GLenum modeA)
-{
- DISPATCH(BlendEquationSeparateiARB, (buf, modeRGB, modeA), (F, "glBlendEquationSeparateiARB(%d, 0x%x, 0x%x);\n", buf, modeRGB, modeA));
-}
-
-KEYWORD1 void KEYWORD2 NAME(BlendEquationSeparateIndexedAMD)(GLuint buf, GLenum modeRGB, GLenum modeA)
-{
- DISPATCH(BlendEquationSeparateiARB, (buf, modeRGB, modeA), (F, "glBlendEquationSeparateIndexedAMD(%d, 0x%x, 0x%x);\n", buf, modeRGB, modeA));
-}
-
-KEYWORD1 void KEYWORD2 NAME(BlendEquationiARB)(GLuint buf, GLenum mode)
-{
- DISPATCH(BlendEquationiARB, (buf, mode), (F, "glBlendEquationiARB(%d, 0x%x);\n", buf, mode));
-}
-
-KEYWORD1 void KEYWORD2 NAME(BlendEquationIndexedAMD)(GLuint buf, GLenum mode)
-{
- DISPATCH(BlendEquationiARB, (buf, mode), (F, "glBlendEquationIndexedAMD(%d, 0x%x);\n", buf, mode));
-}
-
-KEYWORD1 void KEYWORD2 NAME(BlendFuncSeparateiARB)(GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcA, GLenum dstA)
-{
- DISPATCH(BlendFuncSeparateiARB, (buf, srcRGB, dstRGB, srcA, dstA), (F, "glBlendFuncSeparateiARB(%d, 0x%x, 0x%x, 0x%x, 0x%x);\n", buf, srcRGB, dstRGB, srcA, dstA));
-}
-
-KEYWORD1 void KEYWORD2 NAME(BlendFuncSeparateIndexedAMD)(GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcA, GLenum dstA)
-{
- DISPATCH(BlendFuncSeparateiARB, (buf, srcRGB, dstRGB, srcA, dstA), (F, "glBlendFuncSeparateIndexedAMD(%d, 0x%x, 0x%x, 0x%x, 0x%x);\n", buf, srcRGB, dstRGB, srcA, dstA));
-}
-
-KEYWORD1 void KEYWORD2 NAME(BlendFunciARB)(GLuint buf, GLenum src, GLenum dst)
-{
- DISPATCH(BlendFunciARB, (buf, src, dst), (F, "glBlendFunciARB(%d, 0x%x, 0x%x);\n", buf, src, dst));
-}
-
-KEYWORD1 void KEYWORD2 NAME(BlendFuncIndexedAMD)(GLuint buf, GLenum src, GLenum dst)
-{
- DISPATCH(BlendFunciARB, (buf, src, dst), (F, "glBlendFuncIndexedAMD(%d, 0x%x, 0x%x);\n", buf, src, dst));
-}
-
-KEYWORD1 void KEYWORD2 NAME(BindSampler)(GLuint unit, GLuint sampler)
-{
- DISPATCH(BindSampler, (unit, sampler), (F, "glBindSampler(%d, %d);\n", unit, sampler));
-}
-
-KEYWORD1 void KEYWORD2 NAME(DeleteSamplers)(GLsizei count, const GLuint * samplers)
-{
- DISPATCH(DeleteSamplers, (count, samplers), (F, "glDeleteSamplers(%d, %p);\n", count, (const void *) samplers));
-}
-
-KEYWORD1 void KEYWORD2 NAME(GenSamplers)(GLsizei count, GLuint * samplers)
-{
- DISPATCH(GenSamplers, (count, samplers), (F, "glGenSamplers(%d, %p);\n", count, (const void *) samplers));
-}
-
-KEYWORD1 void KEYWORD2 NAME(GetSamplerParameterIiv)(GLuint sampler, GLenum pname, GLint * params)
-{
- DISPATCH(GetSamplerParameterIiv, (sampler, pname, params), (F, "glGetSamplerParameterIiv(%d, 0x%x, %p);\n", sampler, pname, (const void *) params));
-}
-
-KEYWORD1 void KEYWORD2 NAME(GetSamplerParameterIuiv)(GLuint sampler, GLenum pname, GLuint * params)
-{
- DISPATCH(GetSamplerParameterIuiv, (sampler, pname, params), (F, "glGetSamplerParameterIuiv(%d, 0x%x, %p);\n", sampler, pname, (const void *) params));
-}
-
-KEYWORD1 void KEYWORD2 NAME(GetSamplerParameterfv)(GLuint sampler, GLenum pname, GLfloat * params)
-{
- DISPATCH(GetSamplerParameterfv, (sampler, pname, params), (F, "glGetSamplerParameterfv(%d, 0x%x, %p);\n", sampler, pname, (const void *) params));
-}
-
-KEYWORD1 void KEYWORD2 NAME(GetSamplerParameteriv)(GLuint sampler, GLenum pname, GLint * params)
-{
- DISPATCH(GetSamplerParameteriv, (sampler, pname, params), (F, "glGetSamplerParameteriv(%d, 0x%x, %p);\n", sampler, pname, (const void *) params));
-}
-
-KEYWORD1 GLboolean KEYWORD2 NAME(IsSampler)(GLuint sampler)
-{
- RETURN_DISPATCH(IsSampler, (sampler), (F, "glIsSampler(%d);\n", sampler));
-}
-
-KEYWORD1 void KEYWORD2 NAME(SamplerParameterIiv)(GLuint sampler, GLenum pname, const GLint * params)
-{
- DISPATCH(SamplerParameterIiv, (sampler, pname, params), (F, "glSamplerParameterIiv(%d, 0x%x, %p);\n", sampler, pname, (const void *) params));
-}
-
-KEYWORD1 void KEYWORD2 NAME(SamplerParameterIuiv)(GLuint sampler, GLenum pname, const GLuint * params)
-{
- DISPATCH(SamplerParameterIuiv, (sampler, pname, params), (F, "glSamplerParameterIuiv(%d, 0x%x, %p);\n", sampler, pname, (const void *) params));
-}
-
-KEYWORD1 void KEYWORD2 NAME(SamplerParameterf)(GLuint sampler, GLenum pname, GLfloat param)
-{
- DISPATCH(SamplerParameterf, (sampler, pname, param), (F, "glSamplerParameterf(%d, 0x%x, %f);\n", sampler, pname, param));
-}
-
-KEYWORD1 void KEYWORD2 NAME(SamplerParameterfv)(GLuint sampler, GLenum pname, const GLfloat * params)
-{
- DISPATCH(SamplerParameterfv, (sampler, pname, params), (F, "glSamplerParameterfv(%d, 0x%x, %p);\n", sampler, pname, (const void *) params));
-}
-
-KEYWORD1 void KEYWORD2 NAME(SamplerParameteri)(GLuint sampler, GLenum pname, GLint param)
-{
- DISPATCH(SamplerParameteri, (sampler, pname, param), (F, "glSamplerParameteri(%d, 0x%x, %d);\n", sampler, pname, param));
-}
-
-KEYWORD1 void KEYWORD2 NAME(SamplerParameteriv)(GLuint sampler, GLenum pname, const GLint * params)
-{
- DISPATCH(SamplerParameteriv, (sampler, pname, params), (F, "glSamplerParameteriv(%d, 0x%x, %p);\n", sampler, pname, (const void *) params));
-}
-
-KEYWORD1 void KEYWORD2 NAME(BindTransformFeedback)(GLenum target, GLuint id)
-{
- DISPATCH(BindTransformFeedback, (target, id), (F, "glBindTransformFeedback(0x%x, %d);\n", target, id));
-}
-
-KEYWORD1 void KEYWORD2 NAME(DeleteTransformFeedbacks)(GLsizei n, const GLuint * ids)
-{
- DISPATCH(DeleteTransformFeedbacks, (n, ids), (F, "glDeleteTransformFeedbacks(%d, %p);\n", n, (const void *) ids));
-}
-
-KEYWORD1 void KEYWORD2 NAME(DrawTransformFeedback)(GLenum mode, GLuint id)
-{
- DISPATCH(DrawTransformFeedback, (mode, id), (F, "glDrawTransformFeedback(0x%x, %d);\n", mode, id));
-}
-
-KEYWORD1 void KEYWORD2 NAME(GenTransformFeedbacks)(GLsizei n, GLuint * ids)
-{
- DISPATCH(GenTransformFeedbacks, (n, ids), (F, "glGenTransformFeedbacks(%d, %p);\n", n, (const void *) ids));
-}
-
-KEYWORD1 GLboolean KEYWORD2 NAME(IsTransformFeedback)(GLuint id)
-{
- RETURN_DISPATCH(IsTransformFeedback, (id), (F, "glIsTransformFeedback(%d);\n", id));
-}
-
-KEYWORD1 void KEYWORD2 NAME(PauseTransformFeedback)(void)
-{
- DISPATCH(PauseTransformFeedback, (), (F, "glPauseTransformFeedback();\n"));
-}
-
-KEYWORD1 void KEYWORD2 NAME(ResumeTransformFeedback)(void)
-{
- DISPATCH(ResumeTransformFeedback, (), (F, "glResumeTransformFeedback();\n"));
-}
-
-KEYWORD1 void KEYWORD2 NAME(ClearDepthf)(GLclampf depth)
-{
- DISPATCH(ClearDepthf, (depth), (F, "glClearDepthf(%f);\n", depth));
-}
-
-KEYWORD1 void KEYWORD2 NAME(DepthRangef)(GLclampf zNear, GLclampf zFar)
-{
- DISPATCH(DepthRangef, (zNear, zFar), (F, "glDepthRangef(%f, %f);\n", zNear, zFar));
-}
-
-KEYWORD1 void KEYWORD2 NAME(GetShaderPrecisionFormat)(GLenum shadertype, GLenum precisiontype, GLint * range, GLint * precision)
-{
- DISPATCH(GetShaderPrecisionFormat, (shadertype, precisiontype, range, precision), (F, "glGetShaderPrecisionFormat(0x%x, 0x%x, %p, %p);\n", shadertype, precisiontype, (const void *) range, (const void *) precision));
-}
-
-KEYWORD1 void KEYWORD2 NAME(ReleaseShaderCompiler)(void)
-{
- DISPATCH(ReleaseShaderCompiler, (), (F, "glReleaseShaderCompiler();\n"));
-}
-
-KEYWORD1 void KEYWORD2 NAME(ShaderBinary)(GLsizei n, const GLuint * shaders, GLenum binaryformat, const GLvoid * binary, GLsizei length)
-{
- DISPATCH(ShaderBinary, (n, shaders, binaryformat, binary, length), (F, "glShaderBinary(%d, %p, 0x%x, %p, %d);\n", n, (const void *) shaders, binaryformat, (const void *) binary, length));
-}
-
-KEYWORD1 GLenum KEYWORD2 NAME(GetGraphicsResetStatusARB)(void)
-{
- RETURN_DISPATCH(GetGraphicsResetStatusARB, (), (F, "glGetGraphicsResetStatusARB();\n"));
-}
-
-KEYWORD1 void KEYWORD2 NAME(GetnColorTableARB)(GLenum target, GLenum format, GLenum type, GLsizei bufSize, GLvoid * table)
-{
- DISPATCH(GetnColorTableARB, (target, format, type, bufSize, table), (F, "glGetnColorTableARB(0x%x, 0x%x, 0x%x, %d, %p);\n", target, format, type, bufSize, (const void *) table));
-}
-
-KEYWORD1 void KEYWORD2 NAME(GetnCompressedTexImageARB)(GLenum target, GLint lod, GLsizei bufSize, GLvoid * img)
-{
- DISPATCH(GetnCompressedTexImageARB, (target, lod, bufSize, img), (F, "glGetnCompressedTexImageARB(0x%x, %d, %d, %p);\n", target, lod, bufSize, (const void *) img));
-}
-
-KEYWORD1 void KEYWORD2 NAME(GetnConvolutionFilterARB)(GLenum target, GLenum format, GLenum type, GLsizei bufSize, GLvoid * image)
-{
- DISPATCH(GetnConvolutionFilterARB, (target, format, type, bufSize, image), (F, "glGetnConvolutionFilterARB(0x%x, 0x%x, 0x%x, %d, %p);\n", target, format, type, bufSize, (const void *) image));
-}
-
-KEYWORD1 void KEYWORD2 NAME(GetnHistogramARB)(GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, GLvoid * values)
-{
- DISPATCH(GetnHistogramARB, (target, reset, format, type, bufSize, values), (F, "glGetnHistogramARB(0x%x, %d, 0x%x, 0x%x, %d, %p);\n", target, reset, format, type, bufSize, (const void *) values));
-}
-
-KEYWORD1 void KEYWORD2 NAME(GetnMapdvARB)(GLenum target, GLenum query, GLsizei bufSize, GLdouble * v)
-{
- DISPATCH(GetnMapdvARB, (target, query, bufSize, v), (F, "glGetnMapdvARB(0x%x, 0x%x, %d, %p);\n", target, query, bufSize, (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(GetnMapfvARB)(GLenum target, GLenum query, GLsizei bufSize, GLfloat * v)
-{
- DISPATCH(GetnMapfvARB, (target, query, bufSize, v), (F, "glGetnMapfvARB(0x%x, 0x%x, %d, %p);\n", target, query, bufSize, (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(GetnMapivARB)(GLenum target, GLenum query, GLsizei bufSize, GLint * v)
-{
- DISPATCH(GetnMapivARB, (target, query, bufSize, v), (F, "glGetnMapivARB(0x%x, 0x%x, %d, %p);\n", target, query, bufSize, (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(GetnMinmaxARB)(GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, GLvoid * values)
-{
- DISPATCH(GetnMinmaxARB, (target, reset, format, type, bufSize, values), (F, "glGetnMinmaxARB(0x%x, %d, 0x%x, 0x%x, %d, %p);\n", target, reset, format, type, bufSize, (const void *) values));
-}
-
-KEYWORD1 void KEYWORD2 NAME(GetnPixelMapfvARB)(GLenum map, GLsizei bufSize, GLfloat * values)
-{
- DISPATCH(GetnPixelMapfvARB, (map, bufSize, values), (F, "glGetnPixelMapfvARB(0x%x, %d, %p);\n", map, bufSize, (const void *) values));
-}
-
-KEYWORD1 void KEYWORD2 NAME(GetnPixelMapuivARB)(GLenum map, GLsizei bufSize, GLuint * values)
-{
- DISPATCH(GetnPixelMapuivARB, (map, bufSize, values), (F, "glGetnPixelMapuivARB(0x%x, %d, %p);\n", map, bufSize, (const void *) values));
-}
-
-KEYWORD1 void KEYWORD2 NAME(GetnPixelMapusvARB)(GLenum map, GLsizei bufSize, GLushort * values)
-{
- DISPATCH(GetnPixelMapusvARB, (map, bufSize, values), (F, "glGetnPixelMapusvARB(0x%x, %d, %p);\n", map, bufSize, (const void *) values));
-}
-
-KEYWORD1 void KEYWORD2 NAME(GetnPolygonStippleARB)(GLsizei bufSize, GLubyte * pattern)
-{
- DISPATCH(GetnPolygonStippleARB, (bufSize, pattern), (F, "glGetnPolygonStippleARB(%d, %p);\n", bufSize, (const void *) pattern));
-}
-
-KEYWORD1 void KEYWORD2 NAME(GetnSeparableFilterARB)(GLenum target, GLenum format, GLenum type, GLsizei rowBufSize, GLvoid * row, GLsizei columnBufSize, GLvoid * column, GLvoid * span)
-{
- DISPATCH(GetnSeparableFilterARB, (target, format, type, rowBufSize, row, columnBufSize, column, span), (F, "glGetnSeparableFilterARB(0x%x, 0x%x, 0x%x, %d, %p, %d, %p, %p);\n", target, format, type, rowBufSize, (const void *) row, columnBufSize, (const void *) column, (const void *) span));
-}
-
-KEYWORD1 void KEYWORD2 NAME(GetnTexImageARB)(GLenum target, GLint level, GLenum format, GLenum type, GLsizei bufSize, GLvoid * img)
-{
- DISPATCH(GetnTexImageARB, (target, level, format, type, bufSize, img), (F, "glGetnTexImageARB(0x%x, %d, 0x%x, 0x%x, %d, %p);\n", target, level, format, type, bufSize, (const void *) img));
-}
-
-KEYWORD1 void KEYWORD2 NAME(GetnUniformdvARB)(GLhandleARB program, GLint location, GLsizei bufSize, GLdouble * params)
-{
- DISPATCH(GetnUniformdvARB, (program, location, bufSize, params), (F, "glGetnUniformdvARB(%d, %d, %d, %p);\n", program, location, bufSize, (const void *) params));
-}
-
-KEYWORD1 void KEYWORD2 NAME(GetnUniformfvARB)(GLhandleARB program, GLint location, GLsizei bufSize, GLfloat * params)
-{
- DISPATCH(GetnUniformfvARB, (program, location, bufSize, params), (F, "glGetnUniformfvARB(%d, %d, %d, %p);\n", program, location, bufSize, (const void *) params));
-}
-
-KEYWORD1 void KEYWORD2 NAME(GetnUniformivARB)(GLhandleARB program, GLint location, GLsizei bufSize, GLint * params)
-{
- DISPATCH(GetnUniformivARB, (program, location, bufSize, params), (F, "glGetnUniformivARB(%d, %d, %d, %p);\n", program, location, bufSize, (const void *) params));
-}
-
-KEYWORD1 void KEYWORD2 NAME(GetnUniformuivARB)(GLhandleARB program, GLint location, GLsizei bufSize, GLuint * params)
-{
- DISPATCH(GetnUniformuivARB, (program, location, bufSize, params), (F, "glGetnUniformuivARB(%d, %d, %d, %p);\n", program, location, bufSize, (const void *) params));
-}
-
-KEYWORD1 void KEYWORD2 NAME(ReadnPixelsARB)(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, GLvoid * data)
-{
- DISPATCH(ReadnPixelsARB, (x, y, width, height, format, type, bufSize, data), (F, "glReadnPixelsARB(%d, %d, %d, %d, 0x%x, 0x%x, %d, %p);\n", x, y, width, height, format, type, bufSize, (const void *) data));
-}
-
-KEYWORD1 void KEYWORD2 NAME(PolygonOffsetEXT)(GLfloat factor, GLfloat bias)
-{
- DISPATCH(PolygonOffsetEXT, (factor, bias), (F, "glPolygonOffsetEXT(%f, %f);\n", factor, bias));
-}
-
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_647)(GLenum pname, GLfloat * params);
-
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_647)(GLenum pname, GLfloat * params)
-{
- DISPATCH(GetPixelTexGenParameterfvSGIS, (pname, params), (F, "glGetPixelTexGenParameterfvSGIS(0x%x, %p);\n", pname, (const void *) params));
-}
-
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_648)(GLenum pname, GLint * params);
-
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_648)(GLenum pname, GLint * params)
-{
- DISPATCH(GetPixelTexGenParameterivSGIS, (pname, params), (F, "glGetPixelTexGenParameterivSGIS(0x%x, %p);\n", pname, (const void *) params));
-}
-
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_649)(GLenum pname, GLfloat param);
-
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_649)(GLenum pname, GLfloat param)
-{
- DISPATCH(PixelTexGenParameterfSGIS, (pname, param), (F, "glPixelTexGenParameterfSGIS(0x%x, %f);\n", pname, param));
-}
-
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_650)(GLenum pname, const GLfloat * params);
-
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_650)(GLenum pname, const GLfloat * params)
-{
- DISPATCH(PixelTexGenParameterfvSGIS, (pname, params), (F, "glPixelTexGenParameterfvSGIS(0x%x, %p);\n", pname, (const void *) params));
-}
-
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_651)(GLenum pname, GLint param);
-
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_651)(GLenum pname, GLint param)
-{
- DISPATCH(PixelTexGenParameteriSGIS, (pname, param), (F, "glPixelTexGenParameteriSGIS(0x%x, %d);\n", pname, param));
-}
-
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_652)(GLenum pname, const GLint * params);
-
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_652)(GLenum pname, const GLint * params)
-{
- DISPATCH(PixelTexGenParameterivSGIS, (pname, params), (F, "glPixelTexGenParameterivSGIS(0x%x, %p);\n", pname, (const void *) params));
-}
-
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_653)(GLclampf value, GLboolean invert);
-
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_653)(GLclampf value, GLboolean invert)
-{
- DISPATCH(SampleMaskSGIS, (value, invert), (F, "glSampleMaskSGIS(%f, %d);\n", value, invert));
-}
-
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_654)(GLenum pattern);
-
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_654)(GLenum pattern)
-{
- DISPATCH(SamplePatternSGIS, (pattern), (F, "glSamplePatternSGIS(0x%x);\n", pattern));
-}
-
-KEYWORD1 void KEYWORD2 NAME(ColorPointerEXT)(GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer)
-{
- DISPATCH(ColorPointerEXT, (size, type, stride, count, pointer), (F, "glColorPointerEXT(%d, 0x%x, %d, %d, %p);\n", size, type, stride, count, (const void *) pointer));
-}
-
-KEYWORD1 void KEYWORD2 NAME(EdgeFlagPointerEXT)(GLsizei stride, GLsizei count, const GLboolean * pointer)
-{
- DISPATCH(EdgeFlagPointerEXT, (stride, count, pointer), (F, "glEdgeFlagPointerEXT(%d, %d, %p);\n", stride, count, (const void *) pointer));
-}
-
-KEYWORD1 void KEYWORD2 NAME(IndexPointerEXT)(GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer)
-{
- DISPATCH(IndexPointerEXT, (type, stride, count, pointer), (F, "glIndexPointerEXT(0x%x, %d, %d, %p);\n", type, stride, count, (const void *) pointer));
-}
-
-KEYWORD1 void KEYWORD2 NAME(NormalPointerEXT)(GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer)
-{
- DISPATCH(NormalPointerEXT, (type, stride, count, pointer), (F, "glNormalPointerEXT(0x%x, %d, %d, %p);\n", type, stride, count, (const void *) pointer));
-}
-
-KEYWORD1 void KEYWORD2 NAME(TexCoordPointerEXT)(GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer)
-{
- DISPATCH(TexCoordPointerEXT, (size, type, stride, count, pointer), (F, "glTexCoordPointerEXT(%d, 0x%x, %d, %d, %p);\n", size, type, stride, count, (const void *) pointer));
-}
-
-KEYWORD1 void KEYWORD2 NAME(VertexPointerEXT)(GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer)
-{
- DISPATCH(VertexPointerEXT, (size, type, stride, count, pointer), (F, "glVertexPointerEXT(%d, 0x%x, %d, %d, %p);\n", size, type, stride, count, (const void *) pointer));
-}
-
-KEYWORD1 void KEYWORD2 NAME(PointParameterf)(GLenum pname, GLfloat param)
-{
- DISPATCH(PointParameterfEXT, (pname, param), (F, "glPointParameterf(0x%x, %f);\n", pname, param));
-}
-
-KEYWORD1 void KEYWORD2 NAME(PointParameterfARB)(GLenum pname, GLfloat param)
-{
- DISPATCH(PointParameterfEXT, (pname, param), (F, "glPointParameterfARB(0x%x, %f);\n", pname, param));
-}
-
-KEYWORD1 void KEYWORD2 NAME(PointParameterfEXT)(GLenum pname, GLfloat param)
-{
- DISPATCH(PointParameterfEXT, (pname, param), (F, "glPointParameterfEXT(0x%x, %f);\n", pname, param));
-}
-
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_661)(GLenum pname, GLfloat param);
-
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_661)(GLenum pname, GLfloat param)
-{
- DISPATCH(PointParameterfEXT, (pname, param), (F, "glPointParameterfSGIS(0x%x, %f);\n", pname, param));
-}
-
-KEYWORD1 void KEYWORD2 NAME(PointParameterfv)(GLenum pname, const GLfloat * params)
-{
- DISPATCH(PointParameterfvEXT, (pname, params), (F, "glPointParameterfv(0x%x, %p);\n", pname, (const void *) params));
-}
-
-KEYWORD1 void KEYWORD2 NAME(PointParameterfvARB)(GLenum pname, const GLfloat * params)
-{
- DISPATCH(PointParameterfvEXT, (pname, params), (F, "glPointParameterfvARB(0x%x, %p);\n", pname, (const void *) params));
-}
-
-KEYWORD1 void KEYWORD2 NAME(PointParameterfvEXT)(GLenum pname, const GLfloat * params)
-{
- DISPATCH(PointParameterfvEXT, (pname, params), (F, "glPointParameterfvEXT(0x%x, %p);\n", pname, (const void *) params));
-}
-
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_662)(GLenum pname, const GLfloat * params);
-
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_662)(GLenum pname, const GLfloat * params)
-{
- DISPATCH(PointParameterfvEXT, (pname, params), (F, "glPointParameterfvSGIS(0x%x, %p);\n", pname, (const void *) params));
-}
-
-KEYWORD1 void KEYWORD2 NAME(LockArraysEXT)(GLint first, GLsizei count)
-{
- DISPATCH(LockArraysEXT, (first, count), (F, "glLockArraysEXT(%d, %d);\n", first, count));
-}
-
-KEYWORD1 void KEYWORD2 NAME(UnlockArraysEXT)(void)
-{
- DISPATCH(UnlockArraysEXT, (), (F, "glUnlockArraysEXT();\n"));
-}
-
-KEYWORD1 void KEYWORD2 NAME(SecondaryColor3b)(GLbyte red, GLbyte green, GLbyte blue)
-{
- DISPATCH(SecondaryColor3bEXT, (red, green, blue), (F, "glSecondaryColor3b(%d, %d, %d);\n", red, green, blue));
-}
-
-KEYWORD1 void KEYWORD2 NAME(SecondaryColor3bEXT)(GLbyte red, GLbyte green, GLbyte blue)
-{
- DISPATCH(SecondaryColor3bEXT, (red, green, blue), (F, "glSecondaryColor3bEXT(%d, %d, %d);\n", red, green, blue));
-}
-
-KEYWORD1 void KEYWORD2 NAME(SecondaryColor3bv)(const GLbyte * v)
-{
- DISPATCH(SecondaryColor3bvEXT, (v), (F, "glSecondaryColor3bv(%p);\n", (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(SecondaryColor3bvEXT)(const GLbyte * v)
-{
- DISPATCH(SecondaryColor3bvEXT, (v), (F, "glSecondaryColor3bvEXT(%p);\n", (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(SecondaryColor3d)(GLdouble red, GLdouble green, GLdouble blue)
-{
- DISPATCH(SecondaryColor3dEXT, (red, green, blue), (F, "glSecondaryColor3d(%f, %f, %f);\n", red, green, blue));
-}
-
-KEYWORD1 void KEYWORD2 NAME(SecondaryColor3dEXT)(GLdouble red, GLdouble green, GLdouble blue)
-{
- DISPATCH(SecondaryColor3dEXT, (red, green, blue), (F, "glSecondaryColor3dEXT(%f, %f, %f);\n", red, green, blue));
-}
-
-KEYWORD1 void KEYWORD2 NAME(SecondaryColor3dv)(const GLdouble * v)
-{
- DISPATCH(SecondaryColor3dvEXT, (v), (F, "glSecondaryColor3dv(%p);\n", (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(SecondaryColor3dvEXT)(const GLdouble * v)
-{
- DISPATCH(SecondaryColor3dvEXT, (v), (F, "glSecondaryColor3dvEXT(%p);\n", (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(SecondaryColor3f)(GLfloat red, GLfloat green, GLfloat blue)
-{
- DISPATCH(SecondaryColor3fEXT, (red, green, blue), (F, "glSecondaryColor3f(%f, %f, %f);\n", red, green, blue));
-}
-
-KEYWORD1 void KEYWORD2 NAME(SecondaryColor3fEXT)(GLfloat red, GLfloat green, GLfloat blue)
-{
- DISPATCH(SecondaryColor3fEXT, (red, green, blue), (F, "glSecondaryColor3fEXT(%f, %f, %f);\n", red, green, blue));
-}
-
-KEYWORD1 void KEYWORD2 NAME(SecondaryColor3fv)(const GLfloat * v)
-{
- DISPATCH(SecondaryColor3fvEXT, (v), (F, "glSecondaryColor3fv(%p);\n", (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(SecondaryColor3fvEXT)(const GLfloat * v)
-{
- DISPATCH(SecondaryColor3fvEXT, (v), (F, "glSecondaryColor3fvEXT(%p);\n", (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(SecondaryColor3i)(GLint red, GLint green, GLint blue)
-{
- DISPATCH(SecondaryColor3iEXT, (red, green, blue), (F, "glSecondaryColor3i(%d, %d, %d);\n", red, green, blue));
-}
-
-KEYWORD1 void KEYWORD2 NAME(SecondaryColor3iEXT)(GLint red, GLint green, GLint blue)
-{
- DISPATCH(SecondaryColor3iEXT, (red, green, blue), (F, "glSecondaryColor3iEXT(%d, %d, %d);\n", red, green, blue));
-}
-
-KEYWORD1 void KEYWORD2 NAME(SecondaryColor3iv)(const GLint * v)
-{
- DISPATCH(SecondaryColor3ivEXT, (v), (F, "glSecondaryColor3iv(%p);\n", (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(SecondaryColor3ivEXT)(const GLint * v)
-{
- DISPATCH(SecondaryColor3ivEXT, (v), (F, "glSecondaryColor3ivEXT(%p);\n", (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(SecondaryColor3s)(GLshort red, GLshort green, GLshort blue)
-{
- DISPATCH(SecondaryColor3sEXT, (red, green, blue), (F, "glSecondaryColor3s(%d, %d, %d);\n", red, green, blue));
-}
-
-KEYWORD1 void KEYWORD2 NAME(SecondaryColor3sEXT)(GLshort red, GLshort green, GLshort blue)
-{
- DISPATCH(SecondaryColor3sEXT, (red, green, blue), (F, "glSecondaryColor3sEXT(%d, %d, %d);\n", red, green, blue));
-}
-
-KEYWORD1 void KEYWORD2 NAME(SecondaryColor3sv)(const GLshort * v)
-{
- DISPATCH(SecondaryColor3svEXT, (v), (F, "glSecondaryColor3sv(%p);\n", (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(SecondaryColor3svEXT)(const GLshort * v)
-{
- DISPATCH(SecondaryColor3svEXT, (v), (F, "glSecondaryColor3svEXT(%p);\n", (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(SecondaryColor3ub)(GLubyte red, GLubyte green, GLubyte blue)
-{
- DISPATCH(SecondaryColor3ubEXT, (red, green, blue), (F, "glSecondaryColor3ub(%d, %d, %d);\n", red, green, blue));
-}
-
-KEYWORD1 void KEYWORD2 NAME(SecondaryColor3ubEXT)(GLubyte red, GLubyte green, GLubyte blue)
-{
- DISPATCH(SecondaryColor3ubEXT, (red, green, blue), (F, "glSecondaryColor3ubEXT(%d, %d, %d);\n", red, green, blue));
-}
-
-KEYWORD1 void KEYWORD2 NAME(SecondaryColor3ubv)(const GLubyte * v)
-{
- DISPATCH(SecondaryColor3ubvEXT, (v), (F, "glSecondaryColor3ubv(%p);\n", (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(SecondaryColor3ubvEXT)(const GLubyte * v)
-{
- DISPATCH(SecondaryColor3ubvEXT, (v), (F, "glSecondaryColor3ubvEXT(%p);\n", (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(SecondaryColor3ui)(GLuint red, GLuint green, GLuint blue)
-{
- DISPATCH(SecondaryColor3uiEXT, (red, green, blue), (F, "glSecondaryColor3ui(%d, %d, %d);\n", red, green, blue));
-}
-
-KEYWORD1 void KEYWORD2 NAME(SecondaryColor3uiEXT)(GLuint red, GLuint green, GLuint blue)
-{
- DISPATCH(SecondaryColor3uiEXT, (red, green, blue), (F, "glSecondaryColor3uiEXT(%d, %d, %d);\n", red, green, blue));
-}
-
-KEYWORD1 void KEYWORD2 NAME(SecondaryColor3uiv)(const GLuint * v)
-{
- DISPATCH(SecondaryColor3uivEXT, (v), (F, "glSecondaryColor3uiv(%p);\n", (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(SecondaryColor3uivEXT)(const GLuint * v)
-{
- DISPATCH(SecondaryColor3uivEXT, (v), (F, "glSecondaryColor3uivEXT(%p);\n", (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(SecondaryColor3us)(GLushort red, GLushort green, GLushort blue)
-{
- DISPATCH(SecondaryColor3usEXT, (red, green, blue), (F, "glSecondaryColor3us(%d, %d, %d);\n", red, green, blue));
-}
-
-KEYWORD1 void KEYWORD2 NAME(SecondaryColor3usEXT)(GLushort red, GLushort green, GLushort blue)
-{
- DISPATCH(SecondaryColor3usEXT, (red, green, blue), (F, "glSecondaryColor3usEXT(%d, %d, %d);\n", red, green, blue));
-}
-
-KEYWORD1 void KEYWORD2 NAME(SecondaryColor3usv)(const GLushort * v)
-{
- DISPATCH(SecondaryColor3usvEXT, (v), (F, "glSecondaryColor3usv(%p);\n", (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(SecondaryColor3usvEXT)(const GLushort * v)
-{
- DISPATCH(SecondaryColor3usvEXT, (v), (F, "glSecondaryColor3usvEXT(%p);\n", (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(SecondaryColorPointer)(GLint size, GLenum type, GLsizei stride, const GLvoid * pointer)
-{
- DISPATCH(SecondaryColorPointerEXT, (size, type, stride, pointer), (F, "glSecondaryColorPointer(%d, 0x%x, %d, %p);\n", size, type, stride, (const void *) pointer));
-}
-
-KEYWORD1 void KEYWORD2 NAME(SecondaryColorPointerEXT)(GLint size, GLenum type, GLsizei stride, const GLvoid * pointer)
-{
- DISPATCH(SecondaryColorPointerEXT, (size, type, stride, pointer), (F, "glSecondaryColorPointerEXT(%d, 0x%x, %d, %p);\n", size, type, stride, (const void *) pointer));
-}
-
-KEYWORD1 void KEYWORD2 NAME(MultiDrawArrays)(GLenum mode, const GLint * first, const GLsizei * count, GLsizei primcount)
-{
- DISPATCH(MultiDrawArraysEXT, (mode, first, count, primcount), (F, "glMultiDrawArrays(0x%x, %p, %p, %d);\n", mode, (const void *) first, (const void *) count, primcount));
-}
-
-KEYWORD1 void KEYWORD2 NAME(MultiDrawArraysEXT)(GLenum mode, const GLint * first, const GLsizei * count, GLsizei primcount)
-{
- DISPATCH(MultiDrawArraysEXT, (mode, first, count, primcount), (F, "glMultiDrawArraysEXT(0x%x, %p, %p, %d);\n", mode, (const void *) first, (const void *) count, primcount));
-}
-
-KEYWORD1 void KEYWORD2 NAME(MultiDrawElements)(GLenum mode, const GLsizei * count, GLenum type, const GLvoid ** indices, GLsizei primcount)
-{
- DISPATCH(MultiDrawElementsEXT, (mode, count, type, indices, primcount), (F, "glMultiDrawElements(0x%x, %p, 0x%x, %p, %d);\n", mode, (const void *) count, type, (const void *) indices, primcount));
-}
-
-KEYWORD1 void KEYWORD2 NAME(MultiDrawElementsEXT)(GLenum mode, const GLsizei * count, GLenum type, const GLvoid ** indices, GLsizei primcount)
-{
- DISPATCH(MultiDrawElementsEXT, (mode, count, type, indices, primcount), (F, "glMultiDrawElementsEXT(0x%x, %p, 0x%x, %p, %d);\n", mode, (const void *) count, type, (const void *) indices, primcount));
-}
-
-KEYWORD1 void KEYWORD2 NAME(FogCoordPointer)(GLenum type, GLsizei stride, const GLvoid * pointer)
-{
- DISPATCH(FogCoordPointerEXT, (type, stride, pointer), (F, "glFogCoordPointer(0x%x, %d, %p);\n", type, stride, (const void *) pointer));
-}
-
-KEYWORD1 void KEYWORD2 NAME(FogCoordPointerEXT)(GLenum type, GLsizei stride, const GLvoid * pointer)
-{
- DISPATCH(FogCoordPointerEXT, (type, stride, pointer), (F, "glFogCoordPointerEXT(0x%x, %d, %p);\n", type, stride, (const void *) pointer));
-}
-
-KEYWORD1 void KEYWORD2 NAME(FogCoordd)(GLdouble coord)
-{
- DISPATCH(FogCoorddEXT, (coord), (F, "glFogCoordd(%f);\n", coord));
-}
-
-KEYWORD1 void KEYWORD2 NAME(FogCoorddEXT)(GLdouble coord)
-{
- DISPATCH(FogCoorddEXT, (coord), (F, "glFogCoorddEXT(%f);\n", coord));
-}
-
-KEYWORD1 void KEYWORD2 NAME(FogCoorddv)(const GLdouble * coord)
-{
- DISPATCH(FogCoorddvEXT, (coord), (F, "glFogCoorddv(%p);\n", (const void *) coord));
-}
-
-KEYWORD1 void KEYWORD2 NAME(FogCoorddvEXT)(const GLdouble * coord)
-{
- DISPATCH(FogCoorddvEXT, (coord), (F, "glFogCoorddvEXT(%p);\n", (const void *) coord));
-}
-
-KEYWORD1 void KEYWORD2 NAME(FogCoordf)(GLfloat coord)
-{
- DISPATCH(FogCoordfEXT, (coord), (F, "glFogCoordf(%f);\n", coord));
-}
-
-KEYWORD1 void KEYWORD2 NAME(FogCoordfEXT)(GLfloat coord)
-{
- DISPATCH(FogCoordfEXT, (coord), (F, "glFogCoordfEXT(%f);\n", coord));
-}
-
-KEYWORD1 void KEYWORD2 NAME(FogCoordfv)(const GLfloat * coord)
-{
- DISPATCH(FogCoordfvEXT, (coord), (F, "glFogCoordfv(%p);\n", (const void *) coord));
-}
-
-KEYWORD1 void KEYWORD2 NAME(FogCoordfvEXT)(const GLfloat * coord)
-{
- DISPATCH(FogCoordfvEXT, (coord), (F, "glFogCoordfvEXT(%p);\n", (const void *) coord));
-}
-
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_689)(GLenum mode);
-
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_689)(GLenum mode)
-{
- DISPATCH(PixelTexGenSGIX, (mode), (F, "glPixelTexGenSGIX(0x%x);\n", mode));
-}
-
-KEYWORD1 void KEYWORD2 NAME(BlendFuncSeparate)(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha)
-{
- DISPATCH(BlendFuncSeparateEXT, (sfactorRGB, dfactorRGB, sfactorAlpha, dfactorAlpha), (F, "glBlendFuncSeparate(0x%x, 0x%x, 0x%x, 0x%x);\n", sfactorRGB, dfactorRGB, sfactorAlpha, dfactorAlpha));
-}
-
-KEYWORD1 void KEYWORD2 NAME(BlendFuncSeparateEXT)(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha)
-{
- DISPATCH(BlendFuncSeparateEXT, (sfactorRGB, dfactorRGB, sfactorAlpha, dfactorAlpha), (F, "glBlendFuncSeparateEXT(0x%x, 0x%x, 0x%x, 0x%x);\n", sfactorRGB, dfactorRGB, sfactorAlpha, dfactorAlpha));
-}
-
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_690)(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha);
-
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_690)(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha)
-{
- DISPATCH(BlendFuncSeparateEXT, (sfactorRGB, dfactorRGB, sfactorAlpha, dfactorAlpha), (F, "glBlendFuncSeparateINGR(0x%x, 0x%x, 0x%x, 0x%x);\n", sfactorRGB, dfactorRGB, sfactorAlpha, dfactorAlpha));
-}
-
-KEYWORD1 void KEYWORD2 NAME(FlushVertexArrayRangeNV)(void)
-{
- DISPATCH(FlushVertexArrayRangeNV, (), (F, "glFlushVertexArrayRangeNV();\n"));
-}
-
-KEYWORD1 void KEYWORD2 NAME(VertexArrayRangeNV)(GLsizei length, const GLvoid * pointer)
-{
- DISPATCH(VertexArrayRangeNV, (length, pointer), (F, "glVertexArrayRangeNV(%d, %p);\n", length, (const void *) pointer));
-}
-
-KEYWORD1 void KEYWORD2 NAME(CombinerInputNV)(GLenum stage, GLenum portion, GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage)
-{
- DISPATCH(CombinerInputNV, (stage, portion, variable, input, mapping, componentUsage), (F, "glCombinerInputNV(0x%x, 0x%x, 0x%x, 0x%x, 0x%x, 0x%x);\n", stage, portion, variable, input, mapping, componentUsage));
-}
-
-KEYWORD1 void KEYWORD2 NAME(CombinerOutputNV)(GLenum stage, GLenum portion, GLenum abOutput, GLenum cdOutput, GLenum sumOutput, GLenum scale, GLenum bias, GLboolean abDotProduct, GLboolean cdDotProduct, GLboolean muxSum)
-{
- DISPATCH(CombinerOutputNV, (stage, portion, abOutput, cdOutput, sumOutput, scale, bias, abDotProduct, cdDotProduct, muxSum), (F, "glCombinerOutputNV(0x%x, 0x%x, 0x%x, 0x%x, 0x%x, 0x%x, 0x%x, %d, %d, %d);\n", stage, portion, abOutput, cdOutput, sumOutput, scale, bias, abDotProduct, cdDotProduct, muxSum));
-}
-
-KEYWORD1 void KEYWORD2 NAME(CombinerParameterfNV)(GLenum pname, GLfloat param)
-{
- DISPATCH(CombinerParameterfNV, (pname, param), (F, "glCombinerParameterfNV(0x%x, %f);\n", pname, param));
-}
-
-KEYWORD1 void KEYWORD2 NAME(CombinerParameterfvNV)(GLenum pname, const GLfloat * params)
-{
- DISPATCH(CombinerParameterfvNV, (pname, params), (F, "glCombinerParameterfvNV(0x%x, %p);\n", pname, (const void *) params));
-}
-
-KEYWORD1 void KEYWORD2 NAME(CombinerParameteriNV)(GLenum pname, GLint param)
-{
- DISPATCH(CombinerParameteriNV, (pname, param), (F, "glCombinerParameteriNV(0x%x, %d);\n", pname, param));
-}
-
-KEYWORD1 void KEYWORD2 NAME(CombinerParameterivNV)(GLenum pname, const GLint * params)
-{
- DISPATCH(CombinerParameterivNV, (pname, params), (F, "glCombinerParameterivNV(0x%x, %p);\n", pname, (const void *) params));
-}
-
-KEYWORD1 void KEYWORD2 NAME(FinalCombinerInputNV)(GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage)
-{
- DISPATCH(FinalCombinerInputNV, (variable, input, mapping, componentUsage), (F, "glFinalCombinerInputNV(0x%x, 0x%x, 0x%x, 0x%x);\n", variable, input, mapping, componentUsage));
-}
-
-KEYWORD1 void KEYWORD2 NAME(GetCombinerInputParameterfvNV)(GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLfloat * params)
-{
- DISPATCH(GetCombinerInputParameterfvNV, (stage, portion, variable, pname, params), (F, "glGetCombinerInputParameterfvNV(0x%x, 0x%x, 0x%x, 0x%x, %p);\n", stage, portion, variable, pname, (const void *) params));
-}
-
-KEYWORD1 void KEYWORD2 NAME(GetCombinerInputParameterivNV)(GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLint * params)
-{
- DISPATCH(GetCombinerInputParameterivNV, (stage, portion, variable, pname, params), (F, "glGetCombinerInputParameterivNV(0x%x, 0x%x, 0x%x, 0x%x, %p);\n", stage, portion, variable, pname, (const void *) params));
-}
-
-KEYWORD1 void KEYWORD2 NAME(GetCombinerOutputParameterfvNV)(GLenum stage, GLenum portion, GLenum pname, GLfloat * params)
-{
- DISPATCH(GetCombinerOutputParameterfvNV, (stage, portion, pname, params), (F, "glGetCombinerOutputParameterfvNV(0x%x, 0x%x, 0x%x, %p);\n", stage, portion, pname, (const void *) params));
-}
-
-KEYWORD1 void KEYWORD2 NAME(GetCombinerOutputParameterivNV)(GLenum stage, GLenum portion, GLenum pname, GLint * params)
-{
- DISPATCH(GetCombinerOutputParameterivNV, (stage, portion, pname, params), (F, "glGetCombinerOutputParameterivNV(0x%x, 0x%x, 0x%x, %p);\n", stage, portion, pname, (const void *) params));
-}
-
-KEYWORD1 void KEYWORD2 NAME(GetFinalCombinerInputParameterfvNV)(GLenum variable, GLenum pname, GLfloat * params)
-{
- DISPATCH(GetFinalCombinerInputParameterfvNV, (variable, pname, params), (F, "glGetFinalCombinerInputParameterfvNV(0x%x, 0x%x, %p);\n", variable, pname, (const void *) params));
-}
-
-KEYWORD1 void KEYWORD2 NAME(GetFinalCombinerInputParameterivNV)(GLenum variable, GLenum pname, GLint * params)
-{
- DISPATCH(GetFinalCombinerInputParameterivNV, (variable, pname, params), (F, "glGetFinalCombinerInputParameterivNV(0x%x, 0x%x, %p);\n", variable, pname, (const void *) params));
-}
-
-KEYWORD1 void KEYWORD2 NAME(ResizeBuffersMESA)(void)
-{
- DISPATCH(ResizeBuffersMESA, (), (F, "glResizeBuffersMESA();\n"));
-}
-
-KEYWORD1 void KEYWORD2 NAME(WindowPos2d)(GLdouble x, GLdouble y)
-{
- DISPATCH(WindowPos2dMESA, (x, y), (F, "glWindowPos2d(%f, %f);\n", x, y));
-}
-
-KEYWORD1 void KEYWORD2 NAME(WindowPos2dARB)(GLdouble x, GLdouble y)
-{
- DISPATCH(WindowPos2dMESA, (x, y), (F, "glWindowPos2dARB(%f, %f);\n", x, y));
-}
-
-KEYWORD1 void KEYWORD2 NAME(WindowPos2dMESA)(GLdouble x, GLdouble y)
-{
- DISPATCH(WindowPos2dMESA, (x, y), (F, "glWindowPos2dMESA(%f, %f);\n", x, y));
-}
-
-KEYWORD1 void KEYWORD2 NAME(WindowPos2dv)(const GLdouble * v)
-{
- DISPATCH(WindowPos2dvMESA, (v), (F, "glWindowPos2dv(%p);\n", (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(WindowPos2dvARB)(const GLdouble * v)
-{
- DISPATCH(WindowPos2dvMESA, (v), (F, "glWindowPos2dvARB(%p);\n", (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(WindowPos2dvMESA)(const GLdouble * v)
-{
- DISPATCH(WindowPos2dvMESA, (v), (F, "glWindowPos2dvMESA(%p);\n", (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(WindowPos2f)(GLfloat x, GLfloat y)
-{
- DISPATCH(WindowPos2fMESA, (x, y), (F, "glWindowPos2f(%f, %f);\n", x, y));
-}
-
-KEYWORD1 void KEYWORD2 NAME(WindowPos2fARB)(GLfloat x, GLfloat y)
-{
- DISPATCH(WindowPos2fMESA, (x, y), (F, "glWindowPos2fARB(%f, %f);\n", x, y));
-}
-
-KEYWORD1 void KEYWORD2 NAME(WindowPos2fMESA)(GLfloat x, GLfloat y)
-{
- DISPATCH(WindowPos2fMESA, (x, y), (F, "glWindowPos2fMESA(%f, %f);\n", x, y));
-}
-
-KEYWORD1 void KEYWORD2 NAME(WindowPos2fv)(const GLfloat * v)
-{
- DISPATCH(WindowPos2fvMESA, (v), (F, "glWindowPos2fv(%p);\n", (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(WindowPos2fvARB)(const GLfloat * v)
-{
- DISPATCH(WindowPos2fvMESA, (v), (F, "glWindowPos2fvARB(%p);\n", (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(WindowPos2fvMESA)(const GLfloat * v)
-{
- DISPATCH(WindowPos2fvMESA, (v), (F, "glWindowPos2fvMESA(%p);\n", (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(WindowPos2i)(GLint x, GLint y)
-{
- DISPATCH(WindowPos2iMESA, (x, y), (F, "glWindowPos2i(%d, %d);\n", x, y));
-}
-
-KEYWORD1 void KEYWORD2 NAME(WindowPos2iARB)(GLint x, GLint y)
-{
- DISPATCH(WindowPos2iMESA, (x, y), (F, "glWindowPos2iARB(%d, %d);\n", x, y));
-}
-
-KEYWORD1 void KEYWORD2 NAME(WindowPos2iMESA)(GLint x, GLint y)
-{
- DISPATCH(WindowPos2iMESA, (x, y), (F, "glWindowPos2iMESA(%d, %d);\n", x, y));
-}
-
-KEYWORD1 void KEYWORD2 NAME(WindowPos2iv)(const GLint * v)
-{
- DISPATCH(WindowPos2ivMESA, (v), (F, "glWindowPos2iv(%p);\n", (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(WindowPos2ivARB)(const GLint * v)
-{
- DISPATCH(WindowPos2ivMESA, (v), (F, "glWindowPos2ivARB(%p);\n", (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(WindowPos2ivMESA)(const GLint * v)
-{
- DISPATCH(WindowPos2ivMESA, (v), (F, "glWindowPos2ivMESA(%p);\n", (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(WindowPos2s)(GLshort x, GLshort y)
-{
- DISPATCH(WindowPos2sMESA, (x, y), (F, "glWindowPos2s(%d, %d);\n", x, y));
-}
-
-KEYWORD1 void KEYWORD2 NAME(WindowPos2sARB)(GLshort x, GLshort y)
-{
- DISPATCH(WindowPos2sMESA, (x, y), (F, "glWindowPos2sARB(%d, %d);\n", x, y));
-}
-
-KEYWORD1 void KEYWORD2 NAME(WindowPos2sMESA)(GLshort x, GLshort y)
-{
- DISPATCH(WindowPos2sMESA, (x, y), (F, "glWindowPos2sMESA(%d, %d);\n", x, y));
-}
-
-KEYWORD1 void KEYWORD2 NAME(WindowPos2sv)(const GLshort * v)
-{
- DISPATCH(WindowPos2svMESA, (v), (F, "glWindowPos2sv(%p);\n", (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(WindowPos2svARB)(const GLshort * v)
-{
- DISPATCH(WindowPos2svMESA, (v), (F, "glWindowPos2svARB(%p);\n", (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(WindowPos2svMESA)(const GLshort * v)
-{
- DISPATCH(WindowPos2svMESA, (v), (F, "glWindowPos2svMESA(%p);\n", (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(WindowPos3d)(GLdouble x, GLdouble y, GLdouble z)
-{
- DISPATCH(WindowPos3dMESA, (x, y, z), (F, "glWindowPos3d(%f, %f, %f);\n", x, y, z));
-}
-
-KEYWORD1 void KEYWORD2 NAME(WindowPos3dARB)(GLdouble x, GLdouble y, GLdouble z)
-{
- DISPATCH(WindowPos3dMESA, (x, y, z), (F, "glWindowPos3dARB(%f, %f, %f);\n", x, y, z));
-}
-
-KEYWORD1 void KEYWORD2 NAME(WindowPos3dMESA)(GLdouble x, GLdouble y, GLdouble z)
-{
- DISPATCH(WindowPos3dMESA, (x, y, z), (F, "glWindowPos3dMESA(%f, %f, %f);\n", x, y, z));
-}
-
-KEYWORD1 void KEYWORD2 NAME(WindowPos3dv)(const GLdouble * v)
-{
- DISPATCH(WindowPos3dvMESA, (v), (F, "glWindowPos3dv(%p);\n", (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(WindowPos3dvARB)(const GLdouble * v)
-{
- DISPATCH(WindowPos3dvMESA, (v), (F, "glWindowPos3dvARB(%p);\n", (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(WindowPos3dvMESA)(const GLdouble * v)
-{
- DISPATCH(WindowPos3dvMESA, (v), (F, "glWindowPos3dvMESA(%p);\n", (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(WindowPos3f)(GLfloat x, GLfloat y, GLfloat z)
-{
- DISPATCH(WindowPos3fMESA, (x, y, z), (F, "glWindowPos3f(%f, %f, %f);\n", x, y, z));
-}
-
-KEYWORD1 void KEYWORD2 NAME(WindowPos3fARB)(GLfloat x, GLfloat y, GLfloat z)
-{
- DISPATCH(WindowPos3fMESA, (x, y, z), (F, "glWindowPos3fARB(%f, %f, %f);\n", x, y, z));
-}
-
-KEYWORD1 void KEYWORD2 NAME(WindowPos3fMESA)(GLfloat x, GLfloat y, GLfloat z)
-{
- DISPATCH(WindowPos3fMESA, (x, y, z), (F, "glWindowPos3fMESA(%f, %f, %f);\n", x, y, z));
-}
-
-KEYWORD1 void KEYWORD2 NAME(WindowPos3fv)(const GLfloat * v)
-{
- DISPATCH(WindowPos3fvMESA, (v), (F, "glWindowPos3fv(%p);\n", (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(WindowPos3fvARB)(const GLfloat * v)
-{
- DISPATCH(WindowPos3fvMESA, (v), (F, "glWindowPos3fvARB(%p);\n", (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(WindowPos3fvMESA)(const GLfloat * v)
-{
- DISPATCH(WindowPos3fvMESA, (v), (F, "glWindowPos3fvMESA(%p);\n", (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(WindowPos3i)(GLint x, GLint y, GLint z)
-{
- DISPATCH(WindowPos3iMESA, (x, y, z), (F, "glWindowPos3i(%d, %d, %d);\n", x, y, z));
-}
-
-KEYWORD1 void KEYWORD2 NAME(WindowPos3iARB)(GLint x, GLint y, GLint z)
-{
- DISPATCH(WindowPos3iMESA, (x, y, z), (F, "glWindowPos3iARB(%d, %d, %d);\n", x, y, z));
-}
-
-KEYWORD1 void KEYWORD2 NAME(WindowPos3iMESA)(GLint x, GLint y, GLint z)
-{
- DISPATCH(WindowPos3iMESA, (x, y, z), (F, "glWindowPos3iMESA(%d, %d, %d);\n", x, y, z));
-}
-
-KEYWORD1 void KEYWORD2 NAME(WindowPos3iv)(const GLint * v)
-{
- DISPATCH(WindowPos3ivMESA, (v), (F, "glWindowPos3iv(%p);\n", (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(WindowPos3ivARB)(const GLint * v)
-{
- DISPATCH(WindowPos3ivMESA, (v), (F, "glWindowPos3ivARB(%p);\n", (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(WindowPos3ivMESA)(const GLint * v)
-{
- DISPATCH(WindowPos3ivMESA, (v), (F, "glWindowPos3ivMESA(%p);\n", (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(WindowPos3s)(GLshort x, GLshort y, GLshort z)
-{
- DISPATCH(WindowPos3sMESA, (x, y, z), (F, "glWindowPos3s(%d, %d, %d);\n", x, y, z));
-}
-
-KEYWORD1 void KEYWORD2 NAME(WindowPos3sARB)(GLshort x, GLshort y, GLshort z)
-{
- DISPATCH(WindowPos3sMESA, (x, y, z), (F, "glWindowPos3sARB(%d, %d, %d);\n", x, y, z));
-}
-
-KEYWORD1 void KEYWORD2 NAME(WindowPos3sMESA)(GLshort x, GLshort y, GLshort z)
-{
- DISPATCH(WindowPos3sMESA, (x, y, z), (F, "glWindowPos3sMESA(%d, %d, %d);\n", x, y, z));
-}
-
-KEYWORD1 void KEYWORD2 NAME(WindowPos3sv)(const GLshort * v)
-{
- DISPATCH(WindowPos3svMESA, (v), (F, "glWindowPos3sv(%p);\n", (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(WindowPos3svARB)(const GLshort * v)
-{
- DISPATCH(WindowPos3svMESA, (v), (F, "glWindowPos3svARB(%p);\n", (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(WindowPos3svMESA)(const GLshort * v)
-{
- DISPATCH(WindowPos3svMESA, (v), (F, "glWindowPos3svMESA(%p);\n", (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(WindowPos4dMESA)(GLdouble x, GLdouble y, GLdouble z, GLdouble w)
-{
- DISPATCH(WindowPos4dMESA, (x, y, z, w), (F, "glWindowPos4dMESA(%f, %f, %f, %f);\n", x, y, z, w));
-}
-
-KEYWORD1 void KEYWORD2 NAME(WindowPos4dvMESA)(const GLdouble * v)
-{
- DISPATCH(WindowPos4dvMESA, (v), (F, "glWindowPos4dvMESA(%p);\n", (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(WindowPos4fMESA)(GLfloat x, GLfloat y, GLfloat z, GLfloat w)
-{
- DISPATCH(WindowPos4fMESA, (x, y, z, w), (F, "glWindowPos4fMESA(%f, %f, %f, %f);\n", x, y, z, w));
-}
-
-KEYWORD1 void KEYWORD2 NAME(WindowPos4fvMESA)(const GLfloat * v)
-{
- DISPATCH(WindowPos4fvMESA, (v), (F, "glWindowPos4fvMESA(%p);\n", (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(WindowPos4iMESA)(GLint x, GLint y, GLint z, GLint w)
-{
- DISPATCH(WindowPos4iMESA, (x, y, z, w), (F, "glWindowPos4iMESA(%d, %d, %d, %d);\n", x, y, z, w));
-}
-
-KEYWORD1 void KEYWORD2 NAME(WindowPos4ivMESA)(const GLint * v)
-{
- DISPATCH(WindowPos4ivMESA, (v), (F, "glWindowPos4ivMESA(%p);\n", (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(WindowPos4sMESA)(GLshort x, GLshort y, GLshort z, GLshort w)
-{
- DISPATCH(WindowPos4sMESA, (x, y, z, w), (F, "glWindowPos4sMESA(%d, %d, %d, %d);\n", x, y, z, w));
-}
-
-KEYWORD1 void KEYWORD2 NAME(WindowPos4svMESA)(const GLshort * v)
-{
- DISPATCH(WindowPos4svMESA, (v), (F, "glWindowPos4svMESA(%p);\n", (const void *) v));
-}
-
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_731)(const GLenum * mode, const GLint * first, const GLsizei * count, GLsizei primcount, GLint modestride);
-
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_731)(const GLenum * mode, const GLint * first, const GLsizei * count, GLsizei primcount, GLint modestride)
-{
- DISPATCH(MultiModeDrawArraysIBM, (mode, first, count, primcount, modestride), (F, "glMultiModeDrawArraysIBM(%p, %p, %p, %d, %d);\n", (const void *) mode, (const void *) first, (const void *) count, primcount, modestride));
-}
-
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_732)(const GLenum * mode, const GLsizei * count, GLenum type, const GLvoid * const * indices, GLsizei primcount, GLint modestride);
-
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_732)(const GLenum * mode, const GLsizei * count, GLenum type, const GLvoid * const * indices, GLsizei primcount, GLint modestride)
-{
- DISPATCH(MultiModeDrawElementsIBM, (mode, count, type, indices, primcount, modestride), (F, "glMultiModeDrawElementsIBM(%p, %p, 0x%x, %p, %d, %d);\n", (const void *) mode, (const void *) count, type, (const void *) indices, primcount, modestride));
-}
-
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_733)(GLsizei n, const GLuint * fences);
-
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_733)(GLsizei n, const GLuint * fences)
-{
- DISPATCH(DeleteFencesNV, (n, fences), (F, "glDeleteFencesNV(%d, %p);\n", n, (const void *) fences));
-}
-
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_734)(GLuint fence);
-
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_734)(GLuint fence)
-{
- DISPATCH(FinishFenceNV, (fence), (F, "glFinishFenceNV(%d);\n", fence));
-}
-
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_735)(GLsizei n, GLuint * fences);
-
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_735)(GLsizei n, GLuint * fences)
-{
- DISPATCH(GenFencesNV, (n, fences), (F, "glGenFencesNV(%d, %p);\n", n, (const void *) fences));
-}
-
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_736)(GLuint fence, GLenum pname, GLint * params);
-
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_736)(GLuint fence, GLenum pname, GLint * params)
-{
- DISPATCH(GetFenceivNV, (fence, pname, params), (F, "glGetFenceivNV(%d, 0x%x, %p);\n", fence, pname, (const void *) params));
-}
-
-KEYWORD1_ALT GLboolean KEYWORD2 NAME(_dispatch_stub_737)(GLuint fence);
-
-KEYWORD1_ALT GLboolean KEYWORD2 NAME(_dispatch_stub_737)(GLuint fence)
-{
- RETURN_DISPATCH(IsFenceNV, (fence), (F, "glIsFenceNV(%d);\n", fence));
-}
-
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_738)(GLuint fence, GLenum condition);
-
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_738)(GLuint fence, GLenum condition)
-{
- DISPATCH(SetFenceNV, (fence, condition), (F, "glSetFenceNV(%d, 0x%x);\n", fence, condition));
-}
-
-KEYWORD1_ALT GLboolean KEYWORD2 NAME(_dispatch_stub_739)(GLuint fence);
-
-KEYWORD1_ALT GLboolean KEYWORD2 NAME(_dispatch_stub_739)(GLuint fence)
-{
- RETURN_DISPATCH(TestFenceNV, (fence), (F, "glTestFenceNV(%d);\n", fence));
-}
-
-KEYWORD1 GLboolean KEYWORD2 NAME(AreProgramsResidentNV)(GLsizei n, const GLuint * ids, GLboolean * residences)
-{
- RETURN_DISPATCH(AreProgramsResidentNV, (n, ids, residences), (F, "glAreProgramsResidentNV(%d, %p, %p);\n", n, (const void *) ids, (const void *) residences));
-}
-
-KEYWORD1 void KEYWORD2 NAME(BindProgramARB)(GLenum target, GLuint program)
-{
- DISPATCH(BindProgramNV, (target, program), (F, "glBindProgramARB(0x%x, %d);\n", target, program));
-}
-
-KEYWORD1 void KEYWORD2 NAME(BindProgramNV)(GLenum target, GLuint program)
-{
- DISPATCH(BindProgramNV, (target, program), (F, "glBindProgramNV(0x%x, %d);\n", target, program));
-}
-
-KEYWORD1 void KEYWORD2 NAME(DeleteProgramsARB)(GLsizei n, const GLuint * programs)
-{
- DISPATCH(DeleteProgramsNV, (n, programs), (F, "glDeleteProgramsARB(%d, %p);\n", n, (const void *) programs));
-}
-
-KEYWORD1 void KEYWORD2 NAME(DeleteProgramsNV)(GLsizei n, const GLuint * programs)
-{
- DISPATCH(DeleteProgramsNV, (n, programs), (F, "glDeleteProgramsNV(%d, %p);\n", n, (const void *) programs));
-}
-
-KEYWORD1 void KEYWORD2 NAME(ExecuteProgramNV)(GLenum target, GLuint id, const GLfloat * params)
-{
- DISPATCH(ExecuteProgramNV, (target, id, params), (F, "glExecuteProgramNV(0x%x, %d, %p);\n", target, id, (const void *) params));
-}
-
-KEYWORD1 void KEYWORD2 NAME(GenProgramsARB)(GLsizei n, GLuint * programs)
-{
- DISPATCH(GenProgramsNV, (n, programs), (F, "glGenProgramsARB(%d, %p);\n", n, (const void *) programs));
-}
-
-KEYWORD1 void KEYWORD2 NAME(GenProgramsNV)(GLsizei n, GLuint * programs)
-{
- DISPATCH(GenProgramsNV, (n, programs), (F, "glGenProgramsNV(%d, %p);\n", n, (const void *) programs));
-}
-
-KEYWORD1 void KEYWORD2 NAME(GetProgramParameterdvNV)(GLenum target, GLuint index, GLenum pname, GLdouble * params)
-{
- DISPATCH(GetProgramParameterdvNV, (target, index, pname, params), (F, "glGetProgramParameterdvNV(0x%x, %d, 0x%x, %p);\n", target, index, pname, (const void *) params));
-}
-
-KEYWORD1 void KEYWORD2 NAME(GetProgramParameterfvNV)(GLenum target, GLuint index, GLenum pname, GLfloat * params)
-{
- DISPATCH(GetProgramParameterfvNV, (target, index, pname, params), (F, "glGetProgramParameterfvNV(0x%x, %d, 0x%x, %p);\n", target, index, pname, (const void *) params));
-}
-
-KEYWORD1 void KEYWORD2 NAME(GetProgramStringNV)(GLuint id, GLenum pname, GLubyte * program)
-{
- DISPATCH(GetProgramStringNV, (id, pname, program), (F, "glGetProgramStringNV(%d, 0x%x, %p);\n", id, pname, (const void *) program));
-}
-
-KEYWORD1 void KEYWORD2 NAME(GetProgramivNV)(GLuint id, GLenum pname, GLint * params)
-{
- DISPATCH(GetProgramivNV, (id, pname, params), (F, "glGetProgramivNV(%d, 0x%x, %p);\n", id, pname, (const void *) params));
-}
-
-KEYWORD1 void KEYWORD2 NAME(GetTrackMatrixivNV)(GLenum target, GLuint address, GLenum pname, GLint * params)
-{
- DISPATCH(GetTrackMatrixivNV, (target, address, pname, params), (F, "glGetTrackMatrixivNV(0x%x, %d, 0x%x, %p);\n", target, address, pname, (const void *) params));
-}
-
-KEYWORD1 void KEYWORD2 NAME(GetVertexAttribPointerv)(GLuint index, GLenum pname, GLvoid ** pointer)
-{
- DISPATCH(GetVertexAttribPointervNV, (index, pname, pointer), (F, "glGetVertexAttribPointerv(%d, 0x%x, %p);\n", index, pname, (const void *) pointer));
-}
-
-KEYWORD1 void KEYWORD2 NAME(GetVertexAttribPointervARB)(GLuint index, GLenum pname, GLvoid ** pointer)
-{
- DISPATCH(GetVertexAttribPointervNV, (index, pname, pointer), (F, "glGetVertexAttribPointervARB(%d, 0x%x, %p);\n", index, pname, (const void *) pointer));
-}
-
-KEYWORD1 void KEYWORD2 NAME(GetVertexAttribPointervNV)(GLuint index, GLenum pname, GLvoid ** pointer)
-{
- DISPATCH(GetVertexAttribPointervNV, (index, pname, pointer), (F, "glGetVertexAttribPointervNV(%d, 0x%x, %p);\n", index, pname, (const void *) pointer));
-}
-
-KEYWORD1 void KEYWORD2 NAME(GetVertexAttribdvNV)(GLuint index, GLenum pname, GLdouble * params)
-{
- DISPATCH(GetVertexAttribdvNV, (index, pname, params), (F, "glGetVertexAttribdvNV(%d, 0x%x, %p);\n", index, pname, (const void *) params));
-}
-
-KEYWORD1 void KEYWORD2 NAME(GetVertexAttribfvNV)(GLuint index, GLenum pname, GLfloat * params)
-{
- DISPATCH(GetVertexAttribfvNV, (index, pname, params), (F, "glGetVertexAttribfvNV(%d, 0x%x, %p);\n", index, pname, (const void *) params));
-}
-
-KEYWORD1 void KEYWORD2 NAME(GetVertexAttribivNV)(GLuint index, GLenum pname, GLint * params)
-{
- DISPATCH(GetVertexAttribivNV, (index, pname, params), (F, "glGetVertexAttribivNV(%d, 0x%x, %p);\n", index, pname, (const void *) params));
-}
-
-KEYWORD1 GLboolean KEYWORD2 NAME(IsProgramARB)(GLuint program)
-{
- RETURN_DISPATCH(IsProgramNV, (program), (F, "glIsProgramARB(%d);\n", program));
-}
-
-KEYWORD1 GLboolean KEYWORD2 NAME(IsProgramNV)(GLuint program)
-{
- RETURN_DISPATCH(IsProgramNV, (program), (F, "glIsProgramNV(%d);\n", program));
-}
-
-KEYWORD1 void KEYWORD2 NAME(LoadProgramNV)(GLenum target, GLuint id, GLsizei len, const GLubyte * program)
-{
- DISPATCH(LoadProgramNV, (target, id, len, program), (F, "glLoadProgramNV(0x%x, %d, %d, %p);\n", target, id, len, (const void *) program));
-}
-
-KEYWORD1 void KEYWORD2 NAME(ProgramParameters4dvNV)(GLenum target, GLuint index, GLsizei num, const GLdouble * params)
-{
- DISPATCH(ProgramParameters4dvNV, (target, index, num, params), (F, "glProgramParameters4dvNV(0x%x, %d, %d, %p);\n", target, index, num, (const void *) params));
-}
-
-KEYWORD1 void KEYWORD2 NAME(ProgramParameters4fvNV)(GLenum target, GLuint index, GLsizei num, const GLfloat * params)
-{
- DISPATCH(ProgramParameters4fvNV, (target, index, num, params), (F, "glProgramParameters4fvNV(0x%x, %d, %d, %p);\n", target, index, num, (const void *) params));
-}
-
-KEYWORD1 void KEYWORD2 NAME(RequestResidentProgramsNV)(GLsizei n, const GLuint * ids)
-{
- DISPATCH(RequestResidentProgramsNV, (n, ids), (F, "glRequestResidentProgramsNV(%d, %p);\n", n, (const void *) ids));
-}
-
-KEYWORD1 void KEYWORD2 NAME(TrackMatrixNV)(GLenum target, GLuint address, GLenum matrix, GLenum transform)
-{
- DISPATCH(TrackMatrixNV, (target, address, matrix, transform), (F, "glTrackMatrixNV(0x%x, %d, 0x%x, 0x%x);\n", target, address, matrix, transform));
-}
-
-KEYWORD1 void KEYWORD2 NAME(VertexAttrib1dNV)(GLuint index, GLdouble x)
-{
- DISPATCH(VertexAttrib1dNV, (index, x), (F, "glVertexAttrib1dNV(%d, %f);\n", index, x));
-}
-
-KEYWORD1 void KEYWORD2 NAME(VertexAttrib1dvNV)(GLuint index, const GLdouble * v)
-{
- DISPATCH(VertexAttrib1dvNV, (index, v), (F, "glVertexAttrib1dvNV(%d, %p);\n", index, (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(VertexAttrib1fNV)(GLuint index, GLfloat x)
-{
- DISPATCH(VertexAttrib1fNV, (index, x), (F, "glVertexAttrib1fNV(%d, %f);\n", index, x));
-}
-
-KEYWORD1 void KEYWORD2 NAME(VertexAttrib1fvNV)(GLuint index, const GLfloat * v)
-{
- DISPATCH(VertexAttrib1fvNV, (index, v), (F, "glVertexAttrib1fvNV(%d, %p);\n", index, (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(VertexAttrib1sNV)(GLuint index, GLshort x)
-{
- DISPATCH(VertexAttrib1sNV, (index, x), (F, "glVertexAttrib1sNV(%d, %d);\n", index, x));
-}
-
-KEYWORD1 void KEYWORD2 NAME(VertexAttrib1svNV)(GLuint index, const GLshort * v)
-{
- DISPATCH(VertexAttrib1svNV, (index, v), (F, "glVertexAttrib1svNV(%d, %p);\n", index, (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(VertexAttrib2dNV)(GLuint index, GLdouble x, GLdouble y)
-{
- DISPATCH(VertexAttrib2dNV, (index, x, y), (F, "glVertexAttrib2dNV(%d, %f, %f);\n", index, x, y));
-}
-
-KEYWORD1 void KEYWORD2 NAME(VertexAttrib2dvNV)(GLuint index, const GLdouble * v)
-{
- DISPATCH(VertexAttrib2dvNV, (index, v), (F, "glVertexAttrib2dvNV(%d, %p);\n", index, (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(VertexAttrib2fNV)(GLuint index, GLfloat x, GLfloat y)
-{
- DISPATCH(VertexAttrib2fNV, (index, x, y), (F, "glVertexAttrib2fNV(%d, %f, %f);\n", index, x, y));
-}
-
-KEYWORD1 void KEYWORD2 NAME(VertexAttrib2fvNV)(GLuint index, const GLfloat * v)
-{
- DISPATCH(VertexAttrib2fvNV, (index, v), (F, "glVertexAttrib2fvNV(%d, %p);\n", index, (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(VertexAttrib2sNV)(GLuint index, GLshort x, GLshort y)
-{
- DISPATCH(VertexAttrib2sNV, (index, x, y), (F, "glVertexAttrib2sNV(%d, %d, %d);\n", index, x, y));
-}
-
-KEYWORD1 void KEYWORD2 NAME(VertexAttrib2svNV)(GLuint index, const GLshort * v)
-{
- DISPATCH(VertexAttrib2svNV, (index, v), (F, "glVertexAttrib2svNV(%d, %p);\n", index, (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(VertexAttrib3dNV)(GLuint index, GLdouble x, GLdouble y, GLdouble z)
-{
- DISPATCH(VertexAttrib3dNV, (index, x, y, z), (F, "glVertexAttrib3dNV(%d, %f, %f, %f);\n", index, x, y, z));
-}
-
-KEYWORD1 void KEYWORD2 NAME(VertexAttrib3dvNV)(GLuint index, const GLdouble * v)
-{
- DISPATCH(VertexAttrib3dvNV, (index, v), (F, "glVertexAttrib3dvNV(%d, %p);\n", index, (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(VertexAttrib3fNV)(GLuint index, GLfloat x, GLfloat y, GLfloat z)
-{
- DISPATCH(VertexAttrib3fNV, (index, x, y, z), (F, "glVertexAttrib3fNV(%d, %f, %f, %f);\n", index, x, y, z));
-}
-
-KEYWORD1 void KEYWORD2 NAME(VertexAttrib3fvNV)(GLuint index, const GLfloat * v)
-{
- DISPATCH(VertexAttrib3fvNV, (index, v), (F, "glVertexAttrib3fvNV(%d, %p);\n", index, (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(VertexAttrib3sNV)(GLuint index, GLshort x, GLshort y, GLshort z)
-{
- DISPATCH(VertexAttrib3sNV, (index, x, y, z), (F, "glVertexAttrib3sNV(%d, %d, %d, %d);\n", index, x, y, z));
-}
-
-KEYWORD1 void KEYWORD2 NAME(VertexAttrib3svNV)(GLuint index, const GLshort * v)
-{
- DISPATCH(VertexAttrib3svNV, (index, v), (F, "glVertexAttrib3svNV(%d, %p);\n", index, (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(VertexAttrib4dNV)(GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w)
-{
- DISPATCH(VertexAttrib4dNV, (index, x, y, z, w), (F, "glVertexAttrib4dNV(%d, %f, %f, %f, %f);\n", index, x, y, z, w));
-}
-
-KEYWORD1 void KEYWORD2 NAME(VertexAttrib4dvNV)(GLuint index, const GLdouble * v)
-{
- DISPATCH(VertexAttrib4dvNV, (index, v), (F, "glVertexAttrib4dvNV(%d, %p);\n", index, (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(VertexAttrib4fNV)(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
-{
- DISPATCH(VertexAttrib4fNV, (index, x, y, z, w), (F, "glVertexAttrib4fNV(%d, %f, %f, %f, %f);\n", index, x, y, z, w));
-}
-
-KEYWORD1 void KEYWORD2 NAME(VertexAttrib4fvNV)(GLuint index, const GLfloat * v)
-{
- DISPATCH(VertexAttrib4fvNV, (index, v), (F, "glVertexAttrib4fvNV(%d, %p);\n", index, (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(VertexAttrib4sNV)(GLuint index, GLshort x, GLshort y, GLshort z, GLshort w)
-{
- DISPATCH(VertexAttrib4sNV, (index, x, y, z, w), (F, "glVertexAttrib4sNV(%d, %d, %d, %d, %d);\n", index, x, y, z, w));
-}
-
-KEYWORD1 void KEYWORD2 NAME(VertexAttrib4svNV)(GLuint index, const GLshort * v)
-{
- DISPATCH(VertexAttrib4svNV, (index, v), (F, "glVertexAttrib4svNV(%d, %p);\n", index, (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(VertexAttrib4ubNV)(GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w)
-{
- DISPATCH(VertexAttrib4ubNV, (index, x, y, z, w), (F, "glVertexAttrib4ubNV(%d, %d, %d, %d, %d);\n", index, x, y, z, w));
-}
-
-KEYWORD1 void KEYWORD2 NAME(VertexAttrib4ubvNV)(GLuint index, const GLubyte * v)
-{
- DISPATCH(VertexAttrib4ubvNV, (index, v), (F, "glVertexAttrib4ubvNV(%d, %p);\n", index, (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(VertexAttribPointerNV)(GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid * pointer)
-{
- DISPATCH(VertexAttribPointerNV, (index, size, type, stride, pointer), (F, "glVertexAttribPointerNV(%d, %d, 0x%x, %d, %p);\n", index, size, type, stride, (const void *) pointer));
-}
-
-KEYWORD1 void KEYWORD2 NAME(VertexAttribs1dvNV)(GLuint index, GLsizei n, const GLdouble * v)
-{
- DISPATCH(VertexAttribs1dvNV, (index, n, v), (F, "glVertexAttribs1dvNV(%d, %d, %p);\n", index, n, (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(VertexAttribs1fvNV)(GLuint index, GLsizei n, const GLfloat * v)
-{
- DISPATCH(VertexAttribs1fvNV, (index, n, v), (F, "glVertexAttribs1fvNV(%d, %d, %p);\n", index, n, (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(VertexAttribs1svNV)(GLuint index, GLsizei n, const GLshort * v)
-{
- DISPATCH(VertexAttribs1svNV, (index, n, v), (F, "glVertexAttribs1svNV(%d, %d, %p);\n", index, n, (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(VertexAttribs2dvNV)(GLuint index, GLsizei n, const GLdouble * v)
-{
- DISPATCH(VertexAttribs2dvNV, (index, n, v), (F, "glVertexAttribs2dvNV(%d, %d, %p);\n", index, n, (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(VertexAttribs2fvNV)(GLuint index, GLsizei n, const GLfloat * v)
-{
- DISPATCH(VertexAttribs2fvNV, (index, n, v), (F, "glVertexAttribs2fvNV(%d, %d, %p);\n", index, n, (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(VertexAttribs2svNV)(GLuint index, GLsizei n, const GLshort * v)
-{
- DISPATCH(VertexAttribs2svNV, (index, n, v), (F, "glVertexAttribs2svNV(%d, %d, %p);\n", index, n, (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(VertexAttribs3dvNV)(GLuint index, GLsizei n, const GLdouble * v)
-{
- DISPATCH(VertexAttribs3dvNV, (index, n, v), (F, "glVertexAttribs3dvNV(%d, %d, %p);\n", index, n, (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(VertexAttribs3fvNV)(GLuint index, GLsizei n, const GLfloat * v)
-{
- DISPATCH(VertexAttribs3fvNV, (index, n, v), (F, "glVertexAttribs3fvNV(%d, %d, %p);\n", index, n, (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(VertexAttribs3svNV)(GLuint index, GLsizei n, const GLshort * v)
-{
- DISPATCH(VertexAttribs3svNV, (index, n, v), (F, "glVertexAttribs3svNV(%d, %d, %p);\n", index, n, (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(VertexAttribs4dvNV)(GLuint index, GLsizei n, const GLdouble * v)
-{
- DISPATCH(VertexAttribs4dvNV, (index, n, v), (F, "glVertexAttribs4dvNV(%d, %d, %p);\n", index, n, (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(VertexAttribs4fvNV)(GLuint index, GLsizei n, const GLfloat * v)
-{
- DISPATCH(VertexAttribs4fvNV, (index, n, v), (F, "glVertexAttribs4fvNV(%d, %d, %p);\n", index, n, (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(VertexAttribs4svNV)(GLuint index, GLsizei n, const GLshort * v)
-{
- DISPATCH(VertexAttribs4svNV, (index, n, v), (F, "glVertexAttribs4svNV(%d, %d, %p);\n", index, n, (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(VertexAttribs4ubvNV)(GLuint index, GLsizei n, const GLubyte * v)
-{
- DISPATCH(VertexAttribs4ubvNV, (index, n, v), (F, "glVertexAttribs4ubvNV(%d, %d, %p);\n", index, n, (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(GetTexBumpParameterfvATI)(GLenum pname, GLfloat * param)
-{
- DISPATCH(GetTexBumpParameterfvATI, (pname, param), (F, "glGetTexBumpParameterfvATI(0x%x, %p);\n", pname, (const void *) param));
-}
-
-KEYWORD1 void KEYWORD2 NAME(GetTexBumpParameterivATI)(GLenum pname, GLint * param)
-{
- DISPATCH(GetTexBumpParameterivATI, (pname, param), (F, "glGetTexBumpParameterivATI(0x%x, %p);\n", pname, (const void *) param));
-}
-
-KEYWORD1 void KEYWORD2 NAME(TexBumpParameterfvATI)(GLenum pname, const GLfloat * param)
-{
- DISPATCH(TexBumpParameterfvATI, (pname, param), (F, "glTexBumpParameterfvATI(0x%x, %p);\n", pname, (const void *) param));
-}
-
-KEYWORD1 void KEYWORD2 NAME(TexBumpParameterivATI)(GLenum pname, const GLint * param)
-{
- DISPATCH(TexBumpParameterivATI, (pname, param), (F, "glTexBumpParameterivATI(0x%x, %p);\n", pname, (const void *) param));
-}
-
-KEYWORD1 void KEYWORD2 NAME(AlphaFragmentOp1ATI)(GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod)
-{
- DISPATCH(AlphaFragmentOp1ATI, (op, dst, dstMod, arg1, arg1Rep, arg1Mod), (F, "glAlphaFragmentOp1ATI(0x%x, %d, %d, %d, %d, %d);\n", op, dst, dstMod, arg1, arg1Rep, arg1Mod));
-}
-
-KEYWORD1 void KEYWORD2 NAME(AlphaFragmentOp2ATI)(GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod)
-{
- DISPATCH(AlphaFragmentOp2ATI, (op, dst, dstMod, arg1, arg1Rep, arg1Mod, arg2, arg2Rep, arg2Mod), (F, "glAlphaFragmentOp2ATI(0x%x, %d, %d, %d, %d, %d, %d, %d, %d);\n", op, dst, dstMod, arg1, arg1Rep, arg1Mod, arg2, arg2Rep, arg2Mod));
-}
-
-KEYWORD1 void KEYWORD2 NAME(AlphaFragmentOp3ATI)(GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod)
-{
- DISPATCH(AlphaFragmentOp3ATI, (op, dst, dstMod, arg1, arg1Rep, arg1Mod, arg2, arg2Rep, arg2Mod, arg3, arg3Rep, arg3Mod), (F, "glAlphaFragmentOp3ATI(0x%x, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d);\n", op, dst, dstMod, arg1, arg1Rep, arg1Mod, arg2, arg2Rep, arg2Mod, arg3, arg3Rep, arg3Mod));
-}
-
-KEYWORD1 void KEYWORD2 NAME(BeginFragmentShaderATI)(void)
-{
- DISPATCH(BeginFragmentShaderATI, (), (F, "glBeginFragmentShaderATI();\n"));
-}
-
-KEYWORD1 void KEYWORD2 NAME(BindFragmentShaderATI)(GLuint id)
-{
- DISPATCH(BindFragmentShaderATI, (id), (F, "glBindFragmentShaderATI(%d);\n", id));
-}
-
-KEYWORD1 void KEYWORD2 NAME(ColorFragmentOp1ATI)(GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod)
-{
- DISPATCH(ColorFragmentOp1ATI, (op, dst, dstMask, dstMod, arg1, arg1Rep, arg1Mod), (F, "glColorFragmentOp1ATI(0x%x, %d, %d, %d, %d, %d, %d);\n", op, dst, dstMask, dstMod, arg1, arg1Rep, arg1Mod));
-}
-
-KEYWORD1 void KEYWORD2 NAME(ColorFragmentOp2ATI)(GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod)
-{
- DISPATCH(ColorFragmentOp2ATI, (op, dst, dstMask, dstMod, arg1, arg1Rep, arg1Mod, arg2, arg2Rep, arg2Mod), (F, "glColorFragmentOp2ATI(0x%x, %d, %d, %d, %d, %d, %d, %d, %d, %d);\n", op, dst, dstMask, dstMod, arg1, arg1Rep, arg1Mod, arg2, arg2Rep, arg2Mod));
-}
-
-KEYWORD1 void KEYWORD2 NAME(ColorFragmentOp3ATI)(GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod)
-{
- DISPATCH(ColorFragmentOp3ATI, (op, dst, dstMask, dstMod, arg1, arg1Rep, arg1Mod, arg2, arg2Rep, arg2Mod, arg3, arg3Rep, arg3Mod), (F, "glColorFragmentOp3ATI(0x%x, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d);\n", op, dst, dstMask, dstMod, arg1, arg1Rep, arg1Mod, arg2, arg2Rep, arg2Mod, arg3, arg3Rep, arg3Mod));
-}
-
-KEYWORD1 void KEYWORD2 NAME(DeleteFragmentShaderATI)(GLuint id)
-{
- DISPATCH(DeleteFragmentShaderATI, (id), (F, "glDeleteFragmentShaderATI(%d);\n", id));
-}
-
-KEYWORD1 void KEYWORD2 NAME(EndFragmentShaderATI)(void)
-{
- DISPATCH(EndFragmentShaderATI, (), (F, "glEndFragmentShaderATI();\n"));
-}
-
-KEYWORD1 GLuint KEYWORD2 NAME(GenFragmentShadersATI)(GLuint range)
-{
- RETURN_DISPATCH(GenFragmentShadersATI, (range), (F, "glGenFragmentShadersATI(%d);\n", range));
-}
-
-KEYWORD1 void KEYWORD2 NAME(PassTexCoordATI)(GLuint dst, GLuint coord, GLenum swizzle)
-{
- DISPATCH(PassTexCoordATI, (dst, coord, swizzle), (F, "glPassTexCoordATI(%d, %d, 0x%x);\n", dst, coord, swizzle));
-}
-
-KEYWORD1 void KEYWORD2 NAME(SampleMapATI)(GLuint dst, GLuint interp, GLenum swizzle)
-{
- DISPATCH(SampleMapATI, (dst, interp, swizzle), (F, "glSampleMapATI(%d, %d, 0x%x);\n", dst, interp, swizzle));
-}
-
-KEYWORD1 void KEYWORD2 NAME(SetFragmentShaderConstantATI)(GLuint dst, const GLfloat * value)
-{
- DISPATCH(SetFragmentShaderConstantATI, (dst, value), (F, "glSetFragmentShaderConstantATI(%d, %p);\n", dst, (const void *) value));
-}
-
-KEYWORD1 void KEYWORD2 NAME(PointParameteri)(GLenum pname, GLint param)
-{
- DISPATCH(PointParameteriNV, (pname, param), (F, "glPointParameteri(0x%x, %d);\n", pname, param));
-}
-
-KEYWORD1 void KEYWORD2 NAME(PointParameteriNV)(GLenum pname, GLint param)
-{
- DISPATCH(PointParameteriNV, (pname, param), (F, "glPointParameteriNV(0x%x, %d);\n", pname, param));
-}
-
-KEYWORD1 void KEYWORD2 NAME(PointParameteriv)(GLenum pname, const GLint * params)
-{
- DISPATCH(PointParameterivNV, (pname, params), (F, "glPointParameteriv(0x%x, %p);\n", pname, (const void *) params));
-}
-
-KEYWORD1 void KEYWORD2 NAME(PointParameterivNV)(GLenum pname, const GLint * params)
-{
- DISPATCH(PointParameterivNV, (pname, params), (F, "glPointParameterivNV(0x%x, %p);\n", pname, (const void *) params));
-}
-
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_820)(GLenum face);
-
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_820)(GLenum face)
-{
- DISPATCH(ActiveStencilFaceEXT, (face), (F, "glActiveStencilFaceEXT(0x%x);\n", face));
-}
-
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_821)(GLuint array);
-
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_821)(GLuint array)
-{
- DISPATCH(BindVertexArrayAPPLE, (array), (F, "glBindVertexArrayAPPLE(%d);\n", array));
-}
-
-KEYWORD1 void KEYWORD2 NAME(DeleteVertexArrays)(GLsizei n, const GLuint * arrays)
-{
- DISPATCH(DeleteVertexArraysAPPLE, (n, arrays), (F, "glDeleteVertexArrays(%d, %p);\n", n, (const void *) arrays));
-}
-
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_822)(GLsizei n, const GLuint * arrays);
-
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_822)(GLsizei n, const GLuint * arrays)
-{
- DISPATCH(DeleteVertexArraysAPPLE, (n, arrays), (F, "glDeleteVertexArraysAPPLE(%d, %p);\n", n, (const void *) arrays));
-}
-
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_823)(GLsizei n, GLuint * arrays);
-
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_823)(GLsizei n, GLuint * arrays)
-{
- DISPATCH(GenVertexArraysAPPLE, (n, arrays), (F, "glGenVertexArraysAPPLE(%d, %p);\n", n, (const void *) arrays));
-}
-
-KEYWORD1 GLboolean KEYWORD2 NAME(IsVertexArray)(GLuint array)
-{
- RETURN_DISPATCH(IsVertexArrayAPPLE, (array), (F, "glIsVertexArray(%d);\n", array));
-}
-
-KEYWORD1_ALT GLboolean KEYWORD2 NAME(_dispatch_stub_824)(GLuint array);
-
-KEYWORD1_ALT GLboolean KEYWORD2 NAME(_dispatch_stub_824)(GLuint array)
-{
- RETURN_DISPATCH(IsVertexArrayAPPLE, (array), (F, "glIsVertexArrayAPPLE(%d);\n", array));
-}
-
-KEYWORD1 void KEYWORD2 NAME(GetProgramNamedParameterdvNV)(GLuint id, GLsizei len, const GLubyte * name, GLdouble * params)
-{
- DISPATCH(GetProgramNamedParameterdvNV, (id, len, name, params), (F, "glGetProgramNamedParameterdvNV(%d, %d, %p, %p);\n", id, len, (const void *) name, (const void *) params));
-}
-
-KEYWORD1 void KEYWORD2 NAME(GetProgramNamedParameterfvNV)(GLuint id, GLsizei len, const GLubyte * name, GLfloat * params)
-{
- DISPATCH(GetProgramNamedParameterfvNV, (id, len, name, params), (F, "glGetProgramNamedParameterfvNV(%d, %d, %p, %p);\n", id, len, (const void *) name, (const void *) params));
-}
-
-KEYWORD1 void KEYWORD2 NAME(ProgramNamedParameter4dNV)(GLuint id, GLsizei len, const GLubyte * name, GLdouble x, GLdouble y, GLdouble z, GLdouble w)
-{
- DISPATCH(ProgramNamedParameter4dNV, (id, len, name, x, y, z, w), (F, "glProgramNamedParameter4dNV(%d, %d, %p, %f, %f, %f, %f);\n", id, len, (const void *) name, x, y, z, w));
-}
-
-KEYWORD1 void KEYWORD2 NAME(ProgramNamedParameter4dvNV)(GLuint id, GLsizei len, const GLubyte * name, const GLdouble * v)
-{
- DISPATCH(ProgramNamedParameter4dvNV, (id, len, name, v), (F, "glProgramNamedParameter4dvNV(%d, %d, %p, %p);\n", id, len, (const void *) name, (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(ProgramNamedParameter4fNV)(GLuint id, GLsizei len, const GLubyte * name, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
-{
- DISPATCH(ProgramNamedParameter4fNV, (id, len, name, x, y, z, w), (F, "glProgramNamedParameter4fNV(%d, %d, %p, %f, %f, %f, %f);\n", id, len, (const void *) name, x, y, z, w));
-}
-
-KEYWORD1 void KEYWORD2 NAME(ProgramNamedParameter4fvNV)(GLuint id, GLsizei len, const GLubyte * name, const GLfloat * v)
-{
- DISPATCH(ProgramNamedParameter4fvNV, (id, len, name, v), (F, "glProgramNamedParameter4fvNV(%d, %d, %p, %p);\n", id, len, (const void *) name, (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(PrimitiveRestartIndexNV)(GLuint index)
-{
- DISPATCH(PrimitiveRestartIndexNV, (index), (F, "glPrimitiveRestartIndexNV(%d);\n", index));
-}
-
-KEYWORD1 void KEYWORD2 NAME(PrimitiveRestartIndex)(GLuint index)
-{
- DISPATCH(PrimitiveRestartIndexNV, (index), (F, "glPrimitiveRestartIndex(%d);\n", index));
-}
-
-KEYWORD1 void KEYWORD2 NAME(PrimitiveRestartNV)(void)
-{
- DISPATCH(PrimitiveRestartNV, (), (F, "glPrimitiveRestartNV();\n"));
-}
-
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_833)(GLclampd zmin, GLclampd zmax);
-
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_833)(GLclampd zmin, GLclampd zmax)
-{
- DISPATCH(DepthBoundsEXT, (zmin, zmax), (F, "glDepthBoundsEXT(%f, %f);\n", zmin, zmax));
-}
-
-KEYWORD1 void KEYWORD2 NAME(BlendEquationSeparate)(GLenum modeRGB, GLenum modeA)
-{
- DISPATCH(BlendEquationSeparateEXT, (modeRGB, modeA), (F, "glBlendEquationSeparate(0x%x, 0x%x);\n", modeRGB, modeA));
-}
-
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_834)(GLenum modeRGB, GLenum modeA);
-
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_834)(GLenum modeRGB, GLenum modeA)
-{
- DISPATCH(BlendEquationSeparateEXT, (modeRGB, modeA), (F, "glBlendEquationSeparateEXT(0x%x, 0x%x);\n", modeRGB, modeA));
-}
-
-KEYWORD1 void KEYWORD2 NAME(BindFramebuffer)(GLenum target, GLuint framebuffer)
-{
- DISPATCH(BindFramebufferEXT, (target, framebuffer), (F, "glBindFramebuffer(0x%x, %d);\n", target, framebuffer));
-}
-
-KEYWORD1 void KEYWORD2 NAME(BindFramebufferEXT)(GLenum target, GLuint framebuffer)
-{
- DISPATCH(BindFramebufferEXT, (target, framebuffer), (F, "glBindFramebufferEXT(0x%x, %d);\n", target, framebuffer));
-}
-
-KEYWORD1 void KEYWORD2 NAME(BindRenderbuffer)(GLenum target, GLuint renderbuffer)
-{
- DISPATCH(BindRenderbufferEXT, (target, renderbuffer), (F, "glBindRenderbuffer(0x%x, %d);\n", target, renderbuffer));
-}
-
-KEYWORD1 void KEYWORD2 NAME(BindRenderbufferEXT)(GLenum target, GLuint renderbuffer)
-{
- DISPATCH(BindRenderbufferEXT, (target, renderbuffer), (F, "glBindRenderbufferEXT(0x%x, %d);\n", target, renderbuffer));
-}
-
-KEYWORD1 GLenum KEYWORD2 NAME(CheckFramebufferStatus)(GLenum target)
-{
- RETURN_DISPATCH(CheckFramebufferStatusEXT, (target), (F, "glCheckFramebufferStatus(0x%x);\n", target));
-}
-
-KEYWORD1 GLenum KEYWORD2 NAME(CheckFramebufferStatusEXT)(GLenum target)
-{
- RETURN_DISPATCH(CheckFramebufferStatusEXT, (target), (F, "glCheckFramebufferStatusEXT(0x%x);\n", target));
-}
-
-KEYWORD1 void KEYWORD2 NAME(DeleteFramebuffers)(GLsizei n, const GLuint * framebuffers)
-{
- DISPATCH(DeleteFramebuffersEXT, (n, framebuffers), (F, "glDeleteFramebuffers(%d, %p);\n", n, (const void *) framebuffers));
-}
-
-KEYWORD1 void KEYWORD2 NAME(DeleteFramebuffersEXT)(GLsizei n, const GLuint * framebuffers)
-{
- DISPATCH(DeleteFramebuffersEXT, (n, framebuffers), (F, "glDeleteFramebuffersEXT(%d, %p);\n", n, (const void *) framebuffers));
-}
-
-KEYWORD1 void KEYWORD2 NAME(DeleteRenderbuffers)(GLsizei n, const GLuint * renderbuffers)
-{
- DISPATCH(DeleteRenderbuffersEXT, (n, renderbuffers), (F, "glDeleteRenderbuffers(%d, %p);\n", n, (const void *) renderbuffers));
-}
-
-KEYWORD1 void KEYWORD2 NAME(DeleteRenderbuffersEXT)(GLsizei n, const GLuint * renderbuffers)
-{
- DISPATCH(DeleteRenderbuffersEXT, (n, renderbuffers), (F, "glDeleteRenderbuffersEXT(%d, %p);\n", n, (const void *) renderbuffers));
-}
-
-KEYWORD1 void KEYWORD2 NAME(FramebufferRenderbuffer)(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer)
-{
- DISPATCH(FramebufferRenderbufferEXT, (target, attachment, renderbuffertarget, renderbuffer), (F, "glFramebufferRenderbuffer(0x%x, 0x%x, 0x%x, %d);\n", target, attachment, renderbuffertarget, renderbuffer));
-}
-
-KEYWORD1 void KEYWORD2 NAME(FramebufferRenderbufferEXT)(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer)
-{
- DISPATCH(FramebufferRenderbufferEXT, (target, attachment, renderbuffertarget, renderbuffer), (F, "glFramebufferRenderbufferEXT(0x%x, 0x%x, 0x%x, %d);\n", target, attachment, renderbuffertarget, renderbuffer));
-}
-
-KEYWORD1 void KEYWORD2 NAME(FramebufferTexture1D)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level)
-{
- DISPATCH(FramebufferTexture1DEXT, (target, attachment, textarget, texture, level), (F, "glFramebufferTexture1D(0x%x, 0x%x, 0x%x, %d, %d);\n", target, attachment, textarget, texture, level));
-}
-
-KEYWORD1 void KEYWORD2 NAME(FramebufferTexture1DEXT)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level)
-{
- DISPATCH(FramebufferTexture1DEXT, (target, attachment, textarget, texture, level), (F, "glFramebufferTexture1DEXT(0x%x, 0x%x, 0x%x, %d, %d);\n", target, attachment, textarget, texture, level));
-}
-
-KEYWORD1 void KEYWORD2 NAME(FramebufferTexture2D)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level)
-{
- DISPATCH(FramebufferTexture2DEXT, (target, attachment, textarget, texture, level), (F, "glFramebufferTexture2D(0x%x, 0x%x, 0x%x, %d, %d);\n", target, attachment, textarget, texture, level));
-}
-
-KEYWORD1 void KEYWORD2 NAME(FramebufferTexture2DEXT)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level)
-{
- DISPATCH(FramebufferTexture2DEXT, (target, attachment, textarget, texture, level), (F, "glFramebufferTexture2DEXT(0x%x, 0x%x, 0x%x, %d, %d);\n", target, attachment, textarget, texture, level));
-}
-
-KEYWORD1 void KEYWORD2 NAME(FramebufferTexture3D)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset)
-{
- DISPATCH(FramebufferTexture3DEXT, (target, attachment, textarget, texture, level, zoffset), (F, "glFramebufferTexture3D(0x%x, 0x%x, 0x%x, %d, %d, %d);\n", target, attachment, textarget, texture, level, zoffset));
-}
-
-KEYWORD1 void KEYWORD2 NAME(FramebufferTexture3DEXT)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset)
-{
- DISPATCH(FramebufferTexture3DEXT, (target, attachment, textarget, texture, level, zoffset), (F, "glFramebufferTexture3DEXT(0x%x, 0x%x, 0x%x, %d, %d, %d);\n", target, attachment, textarget, texture, level, zoffset));
-}
-
-KEYWORD1 void KEYWORD2 NAME(GenFramebuffers)(GLsizei n, GLuint * framebuffers)
-{
- DISPATCH(GenFramebuffersEXT, (n, framebuffers), (F, "glGenFramebuffers(%d, %p);\n", n, (const void *) framebuffers));
-}
-
-KEYWORD1 void KEYWORD2 NAME(GenFramebuffersEXT)(GLsizei n, GLuint * framebuffers)
-{
- DISPATCH(GenFramebuffersEXT, (n, framebuffers), (F, "glGenFramebuffersEXT(%d, %p);\n", n, (const void *) framebuffers));
-}
-
-KEYWORD1 void KEYWORD2 NAME(GenRenderbuffers)(GLsizei n, GLuint * renderbuffers)
-{
- DISPATCH(GenRenderbuffersEXT, (n, renderbuffers), (F, "glGenRenderbuffers(%d, %p);\n", n, (const void *) renderbuffers));
-}
-
-KEYWORD1 void KEYWORD2 NAME(GenRenderbuffersEXT)(GLsizei n, GLuint * renderbuffers)
-{
- DISPATCH(GenRenderbuffersEXT, (n, renderbuffers), (F, "glGenRenderbuffersEXT(%d, %p);\n", n, (const void *) renderbuffers));
-}
-
-KEYWORD1 void KEYWORD2 NAME(GenerateMipmap)(GLenum target)
-{
- DISPATCH(GenerateMipmapEXT, (target), (F, "glGenerateMipmap(0x%x);\n", target));
-}
-
-KEYWORD1 void KEYWORD2 NAME(GenerateMipmapEXT)(GLenum target)
-{
- DISPATCH(GenerateMipmapEXT, (target), (F, "glGenerateMipmapEXT(0x%x);\n", target));
-}
-
-KEYWORD1 void KEYWORD2 NAME(GetFramebufferAttachmentParameteriv)(GLenum target, GLenum attachment, GLenum pname, GLint * params)
-{
- DISPATCH(GetFramebufferAttachmentParameterivEXT, (target, attachment, pname, params), (F, "glGetFramebufferAttachmentParameteriv(0x%x, 0x%x, 0x%x, %p);\n", target, attachment, pname, (const void *) params));
-}
-
-KEYWORD1 void KEYWORD2 NAME(GetFramebufferAttachmentParameterivEXT)(GLenum target, GLenum attachment, GLenum pname, GLint * params)
-{
- DISPATCH(GetFramebufferAttachmentParameterivEXT, (target, attachment, pname, params), (F, "glGetFramebufferAttachmentParameterivEXT(0x%x, 0x%x, 0x%x, %p);\n", target, attachment, pname, (const void *) params));
-}
-
-KEYWORD1 void KEYWORD2 NAME(GetRenderbufferParameteriv)(GLenum target, GLenum pname, GLint * params)
-{
- DISPATCH(GetRenderbufferParameterivEXT, (target, pname, params), (F, "glGetRenderbufferParameteriv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
-}
-
-KEYWORD1 void KEYWORD2 NAME(GetRenderbufferParameterivEXT)(GLenum target, GLenum pname, GLint * params)
-{
- DISPATCH(GetRenderbufferParameterivEXT, (target, pname, params), (F, "glGetRenderbufferParameterivEXT(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
-}
-
-KEYWORD1 GLboolean KEYWORD2 NAME(IsFramebuffer)(GLuint framebuffer)
-{
- RETURN_DISPATCH(IsFramebufferEXT, (framebuffer), (F, "glIsFramebuffer(%d);\n", framebuffer));
-}
-
-KEYWORD1 GLboolean KEYWORD2 NAME(IsFramebufferEXT)(GLuint framebuffer)
-{
- RETURN_DISPATCH(IsFramebufferEXT, (framebuffer), (F, "glIsFramebufferEXT(%d);\n", framebuffer));
-}
-
-KEYWORD1 GLboolean KEYWORD2 NAME(IsRenderbuffer)(GLuint renderbuffer)
-{
- RETURN_DISPATCH(IsRenderbufferEXT, (renderbuffer), (F, "glIsRenderbuffer(%d);\n", renderbuffer));
-}
-
-KEYWORD1 GLboolean KEYWORD2 NAME(IsRenderbufferEXT)(GLuint renderbuffer)
-{
- RETURN_DISPATCH(IsRenderbufferEXT, (renderbuffer), (F, "glIsRenderbufferEXT(%d);\n", renderbuffer));
-}
-
-KEYWORD1 void KEYWORD2 NAME(RenderbufferStorage)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height)
-{
- DISPATCH(RenderbufferStorageEXT, (target, internalformat, width, height), (F, "glRenderbufferStorage(0x%x, 0x%x, %d, %d);\n", target, internalformat, width, height));
-}
-
-KEYWORD1 void KEYWORD2 NAME(RenderbufferStorageEXT)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height)
-{
- DISPATCH(RenderbufferStorageEXT, (target, internalformat, width, height), (F, "glRenderbufferStorageEXT(0x%x, 0x%x, %d, %d);\n", target, internalformat, width, height));
-}
-
-KEYWORD1 void KEYWORD2 NAME(BlitFramebuffer)(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter)
-{
- DISPATCH(BlitFramebufferEXT, (srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter), (F, "glBlitFramebuffer(%d, %d, %d, %d, %d, %d, %d, %d, %d, 0x%x);\n", srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter));
-}
-
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_852)(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
-
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_852)(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter)
-{
- DISPATCH(BlitFramebufferEXT, (srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter), (F, "glBlitFramebufferEXT(%d, %d, %d, %d, %d, %d, %d, %d, %d, 0x%x);\n", srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter));
-}
-
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_853)(GLenum target, GLenum pname, GLint param);
-
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_853)(GLenum target, GLenum pname, GLint param)
-{
- DISPATCH(BufferParameteriAPPLE, (target, pname, param), (F, "glBufferParameteriAPPLE(0x%x, 0x%x, %d);\n", target, pname, param));
-}
-
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_854)(GLenum target, GLintptr offset, GLsizeiptr size);
-
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_854)(GLenum target, GLintptr offset, GLsizeiptr size)
-{
- DISPATCH(FlushMappedBufferRangeAPPLE, (target, offset, size), (F, "glFlushMappedBufferRangeAPPLE(0x%x, %d, %d);\n", target, offset, size));
-}
-
-KEYWORD1 void KEYWORD2 NAME(BindFragDataLocationEXT)(GLuint program, GLuint colorNumber, const GLchar * name)
-{
- DISPATCH(BindFragDataLocationEXT, (program, colorNumber, name), (F, "glBindFragDataLocationEXT(%d, %d, %p);\n", program, colorNumber, (const void *) name));
-}
-
-KEYWORD1 void KEYWORD2 NAME(BindFragDataLocation)(GLuint program, GLuint colorNumber, const GLchar * name)
-{
- DISPATCH(BindFragDataLocationEXT, (program, colorNumber, name), (F, "glBindFragDataLocation(%d, %d, %p);\n", program, colorNumber, (const void *) name));
-}
-
-KEYWORD1 GLint KEYWORD2 NAME(GetFragDataLocationEXT)(GLuint program, const GLchar * name)
-{
- RETURN_DISPATCH(GetFragDataLocationEXT, (program, name), (F, "glGetFragDataLocationEXT(%d, %p);\n", program, (const void *) name));
-}
-
-KEYWORD1 GLint KEYWORD2 NAME(GetFragDataLocation)(GLuint program, const GLchar * name)
-{
- RETURN_DISPATCH(GetFragDataLocationEXT, (program, name), (F, "glGetFragDataLocation(%d, %p);\n", program, (const void *) name));
-}
-
-KEYWORD1 void KEYWORD2 NAME(GetUniformuivEXT)(GLuint program, GLint location, GLuint * params)
-{
- DISPATCH(GetUniformuivEXT, (program, location, params), (F, "glGetUniformuivEXT(%d, %d, %p);\n", program, location, (const void *) params));
-}
-
-KEYWORD1 void KEYWORD2 NAME(GetUniformuiv)(GLuint program, GLint location, GLuint * params)
-{
- DISPATCH(GetUniformuivEXT, (program, location, params), (F, "glGetUniformuiv(%d, %d, %p);\n", program, location, (const void *) params));
-}
-
-KEYWORD1 void KEYWORD2 NAME(GetVertexAttribIivEXT)(GLuint index, GLenum pname, GLint * params)
-{
- DISPATCH(GetVertexAttribIivEXT, (index, pname, params), (F, "glGetVertexAttribIivEXT(%d, 0x%x, %p);\n", index, pname, (const void *) params));
-}
-
-KEYWORD1 void KEYWORD2 NAME(GetVertexAttribIiv)(GLuint index, GLenum pname, GLint * params)
-{
- DISPATCH(GetVertexAttribIivEXT, (index, pname, params), (F, "glGetVertexAttribIiv(%d, 0x%x, %p);\n", index, pname, (const void *) params));
-}
-
-KEYWORD1 void KEYWORD2 NAME(GetVertexAttribIuivEXT)(GLuint index, GLenum pname, GLuint * params)
-{
- DISPATCH(GetVertexAttribIuivEXT, (index, pname, params), (F, "glGetVertexAttribIuivEXT(%d, 0x%x, %p);\n", index, pname, (const void *) params));
-}
-
-KEYWORD1 void KEYWORD2 NAME(GetVertexAttribIuiv)(GLuint index, GLenum pname, GLuint * params)
-{
- DISPATCH(GetVertexAttribIuivEXT, (index, pname, params), (F, "glGetVertexAttribIuiv(%d, 0x%x, %p);\n", index, pname, (const void *) params));
-}
-
-KEYWORD1 void KEYWORD2 NAME(Uniform1uiEXT)(GLint location, GLuint x)
-{
- DISPATCH(Uniform1uiEXT, (location, x), (F, "glUniform1uiEXT(%d, %d);\n", location, x));
-}
-
-KEYWORD1 void KEYWORD2 NAME(Uniform1ui)(GLint location, GLuint x)
-{
- DISPATCH(Uniform1uiEXT, (location, x), (F, "glUniform1ui(%d, %d);\n", location, x));
-}
-
-KEYWORD1 void KEYWORD2 NAME(Uniform1uivEXT)(GLint location, GLsizei count, const GLuint * value)
-{
- DISPATCH(Uniform1uivEXT, (location, count, value), (F, "glUniform1uivEXT(%d, %d, %p);\n", location, count, (const void *) value));
-}
-
-KEYWORD1 void KEYWORD2 NAME(Uniform1uiv)(GLint location, GLsizei count, const GLuint * value)
-{
- DISPATCH(Uniform1uivEXT, (location, count, value), (F, "glUniform1uiv(%d, %d, %p);\n", location, count, (const void *) value));
-}
-
-KEYWORD1 void KEYWORD2 NAME(Uniform2uiEXT)(GLint location, GLuint x, GLuint y)
-{
- DISPATCH(Uniform2uiEXT, (location, x, y), (F, "glUniform2uiEXT(%d, %d, %d);\n", location, x, y));
-}
-
-KEYWORD1 void KEYWORD2 NAME(Uniform2ui)(GLint location, GLuint x, GLuint y)
-{
- DISPATCH(Uniform2uiEXT, (location, x, y), (F, "glUniform2ui(%d, %d, %d);\n", location, x, y));
-}
-
-KEYWORD1 void KEYWORD2 NAME(Uniform2uivEXT)(GLint location, GLsizei count, const GLuint * value)
-{
- DISPATCH(Uniform2uivEXT, (location, count, value), (F, "glUniform2uivEXT(%d, %d, %p);\n", location, count, (const void *) value));
-}
-
-KEYWORD1 void KEYWORD2 NAME(Uniform2uiv)(GLint location, GLsizei count, const GLuint * value)
-{
- DISPATCH(Uniform2uivEXT, (location, count, value), (F, "glUniform2uiv(%d, %d, %p);\n", location, count, (const void *) value));
-}
-
-KEYWORD1 void KEYWORD2 NAME(Uniform3uiEXT)(GLint location, GLuint x, GLuint y, GLuint z)
-{
- DISPATCH(Uniform3uiEXT, (location, x, y, z), (F, "glUniform3uiEXT(%d, %d, %d, %d);\n", location, x, y, z));
-}
-
-KEYWORD1 void KEYWORD2 NAME(Uniform3ui)(GLint location, GLuint x, GLuint y, GLuint z)
-{
- DISPATCH(Uniform3uiEXT, (location, x, y, z), (F, "glUniform3ui(%d, %d, %d, %d);\n", location, x, y, z));
-}
-
-KEYWORD1 void KEYWORD2 NAME(Uniform3uivEXT)(GLint location, GLsizei count, const GLuint * value)
-{
- DISPATCH(Uniform3uivEXT, (location, count, value), (F, "glUniform3uivEXT(%d, %d, %p);\n", location, count, (const void *) value));
-}
-
-KEYWORD1 void KEYWORD2 NAME(Uniform3uiv)(GLint location, GLsizei count, const GLuint * value)
-{
- DISPATCH(Uniform3uivEXT, (location, count, value), (F, "glUniform3uiv(%d, %d, %p);\n", location, count, (const void *) value));
-}
-
-KEYWORD1 void KEYWORD2 NAME(Uniform4uiEXT)(GLint location, GLuint x, GLuint y, GLuint z, GLuint w)
-{
- DISPATCH(Uniform4uiEXT, (location, x, y, z, w), (F, "glUniform4uiEXT(%d, %d, %d, %d, %d);\n", location, x, y, z, w));
-}
-
-KEYWORD1 void KEYWORD2 NAME(Uniform4ui)(GLint location, GLuint x, GLuint y, GLuint z, GLuint w)
-{
- DISPATCH(Uniform4uiEXT, (location, x, y, z, w), (F, "glUniform4ui(%d, %d, %d, %d, %d);\n", location, x, y, z, w));
-}
-
-KEYWORD1 void KEYWORD2 NAME(Uniform4uivEXT)(GLint location, GLsizei count, const GLuint * value)
-{
- DISPATCH(Uniform4uivEXT, (location, count, value), (F, "glUniform4uivEXT(%d, %d, %p);\n", location, count, (const void *) value));
-}
-
-KEYWORD1 void KEYWORD2 NAME(Uniform4uiv)(GLint location, GLsizei count, const GLuint * value)
-{
- DISPATCH(Uniform4uivEXT, (location, count, value), (F, "glUniform4uiv(%d, %d, %p);\n", location, count, (const void *) value));
-}
-
-KEYWORD1 void KEYWORD2 NAME(VertexAttribI1iEXT)(GLuint index, GLint x)
-{
- DISPATCH(VertexAttribI1iEXT, (index, x), (F, "glVertexAttribI1iEXT(%d, %d);\n", index, x));
-}
-
-KEYWORD1 void KEYWORD2 NAME(VertexAttribI1i)(GLuint index, GLint x)
-{
- DISPATCH(VertexAttribI1iEXT, (index, x), (F, "glVertexAttribI1i(%d, %d);\n", index, x));
-}
-
-KEYWORD1 void KEYWORD2 NAME(VertexAttribI1ivEXT)(GLuint index, const GLint * v)
-{
- DISPATCH(VertexAttribI1ivEXT, (index, v), (F, "glVertexAttribI1ivEXT(%d, %p);\n", index, (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(VertexAttribI1iv)(GLuint index, const GLint * v)
-{
- DISPATCH(VertexAttribI1ivEXT, (index, v), (F, "glVertexAttribI1iv(%d, %p);\n", index, (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(VertexAttribI1uiEXT)(GLuint index, GLuint x)
-{
- DISPATCH(VertexAttribI1uiEXT, (index, x), (F, "glVertexAttribI1uiEXT(%d, %d);\n", index, x));
-}
-
-KEYWORD1 void KEYWORD2 NAME(VertexAttribI1ui)(GLuint index, GLuint x)
-{
- DISPATCH(VertexAttribI1uiEXT, (index, x), (F, "glVertexAttribI1ui(%d, %d);\n", index, x));
-}
-
-KEYWORD1 void KEYWORD2 NAME(VertexAttribI1uivEXT)(GLuint index, const GLuint * v)
-{
- DISPATCH(VertexAttribI1uivEXT, (index, v), (F, "glVertexAttribI1uivEXT(%d, %p);\n", index, (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(VertexAttribI1uiv)(GLuint index, const GLuint * v)
-{
- DISPATCH(VertexAttribI1uivEXT, (index, v), (F, "glVertexAttribI1uiv(%d, %p);\n", index, (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(VertexAttribI2iEXT)(GLuint index, GLint x, GLint y)
-{
- DISPATCH(VertexAttribI2iEXT, (index, x, y), (F, "glVertexAttribI2iEXT(%d, %d, %d);\n", index, x, y));
-}
-
-KEYWORD1 void KEYWORD2 NAME(VertexAttribI2i)(GLuint index, GLint x, GLint y)
-{
- DISPATCH(VertexAttribI2iEXT, (index, x, y), (F, "glVertexAttribI2i(%d, %d, %d);\n", index, x, y));
-}
-
-KEYWORD1 void KEYWORD2 NAME(VertexAttribI2ivEXT)(GLuint index, const GLint * v)
-{
- DISPATCH(VertexAttribI2ivEXT, (index, v), (F, "glVertexAttribI2ivEXT(%d, %p);\n", index, (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(VertexAttribI2iv)(GLuint index, const GLint * v)
-{
- DISPATCH(VertexAttribI2ivEXT, (index, v), (F, "glVertexAttribI2iv(%d, %p);\n", index, (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(VertexAttribI2uiEXT)(GLuint index, GLuint x, GLuint y)
-{
- DISPATCH(VertexAttribI2uiEXT, (index, x, y), (F, "glVertexAttribI2uiEXT(%d, %d, %d);\n", index, x, y));
-}
-
-KEYWORD1 void KEYWORD2 NAME(VertexAttribI2ui)(GLuint index, GLuint x, GLuint y)
-{
- DISPATCH(VertexAttribI2uiEXT, (index, x, y), (F, "glVertexAttribI2ui(%d, %d, %d);\n", index, x, y));
-}
-
-KEYWORD1 void KEYWORD2 NAME(VertexAttribI2uivEXT)(GLuint index, const GLuint * v)
-{
- DISPATCH(VertexAttribI2uivEXT, (index, v), (F, "glVertexAttribI2uivEXT(%d, %p);\n", index, (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(VertexAttribI2uiv)(GLuint index, const GLuint * v)
-{
- DISPATCH(VertexAttribI2uivEXT, (index, v), (F, "glVertexAttribI2uiv(%d, %p);\n", index, (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(VertexAttribI3iEXT)(GLuint index, GLint x, GLint y, GLint z)
-{
- DISPATCH(VertexAttribI3iEXT, (index, x, y, z), (F, "glVertexAttribI3iEXT(%d, %d, %d, %d);\n", index, x, y, z));
-}
-
-KEYWORD1 void KEYWORD2 NAME(VertexAttribI3i)(GLuint index, GLint x, GLint y, GLint z)
-{
- DISPATCH(VertexAttribI3iEXT, (index, x, y, z), (F, "glVertexAttribI3i(%d, %d, %d, %d);\n", index, x, y, z));
-}
-
-KEYWORD1 void KEYWORD2 NAME(VertexAttribI3ivEXT)(GLuint index, const GLint * v)
-{
- DISPATCH(VertexAttribI3ivEXT, (index, v), (F, "glVertexAttribI3ivEXT(%d, %p);\n", index, (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(VertexAttribI3iv)(GLuint index, const GLint * v)
-{
- DISPATCH(VertexAttribI3ivEXT, (index, v), (F, "glVertexAttribI3iv(%d, %p);\n", index, (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(VertexAttribI3uiEXT)(GLuint index, GLuint x, GLuint y, GLuint z)
-{
- DISPATCH(VertexAttribI3uiEXT, (index, x, y, z), (F, "glVertexAttribI3uiEXT(%d, %d, %d, %d);\n", index, x, y, z));
-}
-
-KEYWORD1 void KEYWORD2 NAME(VertexAttribI3ui)(GLuint index, GLuint x, GLuint y, GLuint z)
-{
- DISPATCH(VertexAttribI3uiEXT, (index, x, y, z), (F, "glVertexAttribI3ui(%d, %d, %d, %d);\n", index, x, y, z));
-}
-
-KEYWORD1 void KEYWORD2 NAME(VertexAttribI3uivEXT)(GLuint index, const GLuint * v)
-{
- DISPATCH(VertexAttribI3uivEXT, (index, v), (F, "glVertexAttribI3uivEXT(%d, %p);\n", index, (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(VertexAttribI3uiv)(GLuint index, const GLuint * v)
-{
- DISPATCH(VertexAttribI3uivEXT, (index, v), (F, "glVertexAttribI3uiv(%d, %p);\n", index, (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(VertexAttribI4bvEXT)(GLuint index, const GLbyte * v)
-{
- DISPATCH(VertexAttribI4bvEXT, (index, v), (F, "glVertexAttribI4bvEXT(%d, %p);\n", index, (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(VertexAttribI4bv)(GLuint index, const GLbyte * v)
-{
- DISPATCH(VertexAttribI4bvEXT, (index, v), (F, "glVertexAttribI4bv(%d, %p);\n", index, (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(VertexAttribI4iEXT)(GLuint index, GLint x, GLint y, GLint z, GLint w)
-{
- DISPATCH(VertexAttribI4iEXT, (index, x, y, z, w), (F, "glVertexAttribI4iEXT(%d, %d, %d, %d, %d);\n", index, x, y, z, w));
-}
-
-KEYWORD1 void KEYWORD2 NAME(VertexAttribI4i)(GLuint index, GLint x, GLint y, GLint z, GLint w)
-{
- DISPATCH(VertexAttribI4iEXT, (index, x, y, z, w), (F, "glVertexAttribI4i(%d, %d, %d, %d, %d);\n", index, x, y, z, w));
-}
-
-KEYWORD1 void KEYWORD2 NAME(VertexAttribI4ivEXT)(GLuint index, const GLint * v)
-{
- DISPATCH(VertexAttribI4ivEXT, (index, v), (F, "glVertexAttribI4ivEXT(%d, %p);\n", index, (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(VertexAttribI4iv)(GLuint index, const GLint * v)
-{
- DISPATCH(VertexAttribI4ivEXT, (index, v), (F, "glVertexAttribI4iv(%d, %p);\n", index, (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(VertexAttribI4svEXT)(GLuint index, const GLshort * v)
-{
- DISPATCH(VertexAttribI4svEXT, (index, v), (F, "glVertexAttribI4svEXT(%d, %p);\n", index, (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(VertexAttribI4sv)(GLuint index, const GLshort * v)
-{
- DISPATCH(VertexAttribI4svEXT, (index, v), (F, "glVertexAttribI4sv(%d, %p);\n", index, (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(VertexAttribI4ubvEXT)(GLuint index, const GLubyte * v)
-{
- DISPATCH(VertexAttribI4ubvEXT, (index, v), (F, "glVertexAttribI4ubvEXT(%d, %p);\n", index, (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(VertexAttribI4ubv)(GLuint index, const GLubyte * v)
-{
- DISPATCH(VertexAttribI4ubvEXT, (index, v), (F, "glVertexAttribI4ubv(%d, %p);\n", index, (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(VertexAttribI4uiEXT)(GLuint index, GLuint x, GLuint y, GLuint z, GLuint w)
-{
- DISPATCH(VertexAttribI4uiEXT, (index, x, y, z, w), (F, "glVertexAttribI4uiEXT(%d, %d, %d, %d, %d);\n", index, x, y, z, w));
-}
-
-KEYWORD1 void KEYWORD2 NAME(VertexAttribI4ui)(GLuint index, GLuint x, GLuint y, GLuint z, GLuint w)
-{
- DISPATCH(VertexAttribI4uiEXT, (index, x, y, z, w), (F, "glVertexAttribI4ui(%d, %d, %d, %d, %d);\n", index, x, y, z, w));
-}
-
-KEYWORD1 void KEYWORD2 NAME(VertexAttribI4uivEXT)(GLuint index, const GLuint * v)
-{
- DISPATCH(VertexAttribI4uivEXT, (index, v), (F, "glVertexAttribI4uivEXT(%d, %p);\n", index, (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(VertexAttribI4uiv)(GLuint index, const GLuint * v)
-{
- DISPATCH(VertexAttribI4uivEXT, (index, v), (F, "glVertexAttribI4uiv(%d, %p);\n", index, (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(VertexAttribI4usvEXT)(GLuint index, const GLushort * v)
-{
- DISPATCH(VertexAttribI4usvEXT, (index, v), (F, "glVertexAttribI4usvEXT(%d, %p);\n", index, (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(VertexAttribI4usv)(GLuint index, const GLushort * v)
-{
- DISPATCH(VertexAttribI4usvEXT, (index, v), (F, "glVertexAttribI4usv(%d, %p);\n", index, (const void *) v));
-}
-
-KEYWORD1 void KEYWORD2 NAME(VertexAttribIPointerEXT)(GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid * pointer)
-{
- DISPATCH(VertexAttribIPointerEXT, (index, size, type, stride, pointer), (F, "glVertexAttribIPointerEXT(%d, %d, 0x%x, %d, %p);\n", index, size, type, stride, (const void *) pointer));
-}
-
-KEYWORD1 void KEYWORD2 NAME(VertexAttribIPointer)(GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid * pointer)
-{
- DISPATCH(VertexAttribIPointerEXT, (index, size, type, stride, pointer), (F, "glVertexAttribIPointer(%d, %d, 0x%x, %d, %p);\n", index, size, type, stride, (const void *) pointer));
-}
-
-KEYWORD1 void KEYWORD2 NAME(FramebufferTextureLayer)(GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer)
-{
- DISPATCH(FramebufferTextureLayerEXT, (target, attachment, texture, level, layer), (F, "glFramebufferTextureLayer(0x%x, 0x%x, %d, %d, %d);\n", target, attachment, texture, level, layer));
-}
-
-KEYWORD1 void KEYWORD2 NAME(FramebufferTextureLayerEXT)(GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer)
-{
- DISPATCH(FramebufferTextureLayerEXT, (target, attachment, texture, level, layer), (F, "glFramebufferTextureLayerEXT(0x%x, 0x%x, %d, %d, %d);\n", target, attachment, texture, level, layer));
-}
-
-KEYWORD1 void KEYWORD2 NAME(ColorMaskIndexedEXT)(GLuint buf, GLboolean r, GLboolean g, GLboolean b, GLboolean a)
-{
- DISPATCH(ColorMaskIndexedEXT, (buf, r, g, b, a), (F, "glColorMaskIndexedEXT(%d, %d, %d, %d, %d);\n", buf, r, g, b, a));
-}
-
-KEYWORD1 void KEYWORD2 NAME(ColorMaski)(GLuint buf, GLboolean r, GLboolean g, GLboolean b, GLboolean a)
-{
- DISPATCH(ColorMaskIndexedEXT, (buf, r, g, b, a), (F, "glColorMaski(%d, %d, %d, %d, %d);\n", buf, r, g, b, a));
-}
-
-KEYWORD1 void KEYWORD2 NAME(DisableIndexedEXT)(GLenum target, GLuint index)
-{
- DISPATCH(DisableIndexedEXT, (target, index), (F, "glDisableIndexedEXT(0x%x, %d);\n", target, index));
-}
-
-KEYWORD1 void KEYWORD2 NAME(Disablei)(GLenum target, GLuint index)
-{
- DISPATCH(DisableIndexedEXT, (target, index), (F, "glDisablei(0x%x, %d);\n", target, index));
-}
-
-KEYWORD1 void KEYWORD2 NAME(EnableIndexedEXT)(GLenum target, GLuint index)
-{
- DISPATCH(EnableIndexedEXT, (target, index), (F, "glEnableIndexedEXT(0x%x, %d);\n", target, index));
-}
-
-KEYWORD1 void KEYWORD2 NAME(Enablei)(GLenum target, GLuint index)
-{
- DISPATCH(EnableIndexedEXT, (target, index), (F, "glEnablei(0x%x, %d);\n", target, index));
-}
-
-KEYWORD1 void KEYWORD2 NAME(GetBooleanIndexedvEXT)(GLenum value, GLuint index, GLboolean * data)
-{
- DISPATCH(GetBooleanIndexedvEXT, (value, index, data), (F, "glGetBooleanIndexedvEXT(0x%x, %d, %p);\n", value, index, (const void *) data));
-}
-
-KEYWORD1 void KEYWORD2 NAME(GetBooleani_v)(GLenum value, GLuint index, GLboolean * data)
-{
- DISPATCH(GetBooleanIndexedvEXT, (value, index, data), (F, "glGetBooleani_v(0x%x, %d, %p);\n", value, index, (const void *) data));
-}
-
-KEYWORD1 void KEYWORD2 NAME(GetIntegerIndexedvEXT)(GLenum value, GLuint index, GLint * data)
-{
- DISPATCH(GetIntegerIndexedvEXT, (value, index, data), (F, "glGetIntegerIndexedvEXT(0x%x, %d, %p);\n", value, index, (const void *) data));
-}
-
-KEYWORD1 void KEYWORD2 NAME(GetIntegeri_v)(GLenum value, GLuint index, GLint * data)
-{
- DISPATCH(GetIntegerIndexedvEXT, (value, index, data), (F, "glGetIntegeri_v(0x%x, %d, %p);\n", value, index, (const void *) data));
-}
-
-KEYWORD1 GLboolean KEYWORD2 NAME(IsEnabledIndexedEXT)(GLenum target, GLuint index)
-{
- RETURN_DISPATCH(IsEnabledIndexedEXT, (target, index), (F, "glIsEnabledIndexedEXT(0x%x, %d);\n", target, index));
-}
-
-KEYWORD1 GLboolean KEYWORD2 NAME(IsEnabledi)(GLenum target, GLuint index)
-{
- RETURN_DISPATCH(IsEnabledIndexedEXT, (target, index), (F, "glIsEnabledi(0x%x, %d);\n", target, index));
-}
-
-KEYWORD1 void KEYWORD2 NAME(ClearColorIiEXT)(GLint r, GLint g, GLint b, GLint a)
-{
- DISPATCH(ClearColorIiEXT, (r, g, b, a), (F, "glClearColorIiEXT(%d, %d, %d, %d);\n", r, g, b, a));
-}
-
-KEYWORD1 void KEYWORD2 NAME(ClearColorIuiEXT)(GLuint r, GLuint g, GLuint b, GLuint a)
-{
- DISPATCH(ClearColorIuiEXT, (r, g, b, a), (F, "glClearColorIuiEXT(%d, %d, %d, %d);\n", r, g, b, a));
-}
-
-KEYWORD1 void KEYWORD2 NAME(GetTexParameterIivEXT)(GLenum target, GLenum pname, GLint * params)
-{
- DISPATCH(GetTexParameterIivEXT, (target, pname, params), (F, "glGetTexParameterIivEXT(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
-}
-
-KEYWORD1 void KEYWORD2 NAME(GetTexParameterIiv)(GLenum target, GLenum pname, GLint * params)
-{
- DISPATCH(GetTexParameterIivEXT, (target, pname, params), (F, "glGetTexParameterIiv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
-}
-
-KEYWORD1 void KEYWORD2 NAME(GetTexParameterIuivEXT)(GLenum target, GLenum pname, GLuint * params)
-{
- DISPATCH(GetTexParameterIuivEXT, (target, pname, params), (F, "glGetTexParameterIuivEXT(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
-}
-
-KEYWORD1 void KEYWORD2 NAME(GetTexParameterIuiv)(GLenum target, GLenum pname, GLuint * params)
-{
- DISPATCH(GetTexParameterIuivEXT, (target, pname, params), (F, "glGetTexParameterIuiv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
-}
-
-KEYWORD1 void KEYWORD2 NAME(TexParameterIivEXT)(GLenum target, GLenum pname, const GLint * params)
-{
- DISPATCH(TexParameterIivEXT, (target, pname, params), (F, "glTexParameterIivEXT(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
-}
-
-KEYWORD1 void KEYWORD2 NAME(TexParameterIiv)(GLenum target, GLenum pname, const GLint * params)
-{
- DISPATCH(TexParameterIivEXT, (target, pname, params), (F, "glTexParameterIiv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
-}
-
-KEYWORD1 void KEYWORD2 NAME(TexParameterIuivEXT)(GLenum target, GLenum pname, const GLuint * params)
-{
- DISPATCH(TexParameterIuivEXT, (target, pname, params), (F, "glTexParameterIuivEXT(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
-}
-
-KEYWORD1 void KEYWORD2 NAME(TexParameterIuiv)(GLenum target, GLenum pname, const GLuint * params)
-{
- DISPATCH(TexParameterIuivEXT, (target, pname, params), (F, "glTexParameterIuiv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
-}
-
-KEYWORD1 void KEYWORD2 NAME(BeginConditionalRenderNV)(GLuint query, GLenum mode)
-{
- DISPATCH(BeginConditionalRenderNV, (query, mode), (F, "glBeginConditionalRenderNV(%d, 0x%x);\n", query, mode));
-}
-
-KEYWORD1 void KEYWORD2 NAME(BeginConditionalRender)(GLuint query, GLenum mode)
-{
- DISPATCH(BeginConditionalRenderNV, (query, mode), (F, "glBeginConditionalRender(%d, 0x%x);\n", query, mode));
-}
-
-KEYWORD1 void KEYWORD2 NAME(EndConditionalRenderNV)(void)
-{
- DISPATCH(EndConditionalRenderNV, (), (F, "glEndConditionalRenderNV();\n"));
-}
-
-KEYWORD1 void KEYWORD2 NAME(EndConditionalRender)(void)
-{
- DISPATCH(EndConditionalRenderNV, (), (F, "glEndConditionalRender();\n"));
-}
-
-KEYWORD1 void KEYWORD2 NAME(BeginTransformFeedbackEXT)(GLenum mode)
-{
- DISPATCH(BeginTransformFeedbackEXT, (mode), (F, "glBeginTransformFeedbackEXT(0x%x);\n", mode));
-}
-
-KEYWORD1 void KEYWORD2 NAME(BeginTransformFeedback)(GLenum mode)
-{
- DISPATCH(BeginTransformFeedbackEXT, (mode), (F, "glBeginTransformFeedback(0x%x);\n", mode));
-}
-
-KEYWORD1 void KEYWORD2 NAME(BindBufferBaseEXT)(GLenum target, GLuint index, GLuint buffer)
-{
- DISPATCH(BindBufferBaseEXT, (target, index, buffer), (F, "glBindBufferBaseEXT(0x%x, %d, %d);\n", target, index, buffer));
-}
-
-KEYWORD1 void KEYWORD2 NAME(BindBufferBase)(GLenum target, GLuint index, GLuint buffer)
-{
- DISPATCH(BindBufferBaseEXT, (target, index, buffer), (F, "glBindBufferBase(0x%x, %d, %d);\n", target, index, buffer));
-}
-
-KEYWORD1 void KEYWORD2 NAME(BindBufferOffsetEXT)(GLenum target, GLuint index, GLuint buffer, GLintptr offset)
-{
- DISPATCH(BindBufferOffsetEXT, (target, index, buffer, offset), (F, "glBindBufferOffsetEXT(0x%x, %d, %d, %d);\n", target, index, buffer, offset));
-}
-
-KEYWORD1 void KEYWORD2 NAME(BindBufferRangeEXT)(GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size)
-{
- DISPATCH(BindBufferRangeEXT, (target, index, buffer, offset, size), (F, "glBindBufferRangeEXT(0x%x, %d, %d, %d, %d);\n", target, index, buffer, offset, size));
-}
-
-KEYWORD1 void KEYWORD2 NAME(BindBufferRange)(GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size)
-{
- DISPATCH(BindBufferRangeEXT, (target, index, buffer, offset, size), (F, "glBindBufferRange(0x%x, %d, %d, %d, %d);\n", target, index, buffer, offset, size));
-}
-
-KEYWORD1 void KEYWORD2 NAME(EndTransformFeedbackEXT)(void)
-{
- DISPATCH(EndTransformFeedbackEXT, (), (F, "glEndTransformFeedbackEXT();\n"));
-}
-
-KEYWORD1 void KEYWORD2 NAME(EndTransformFeedback)(void)
-{
- DISPATCH(EndTransformFeedbackEXT, (), (F, "glEndTransformFeedback();\n"));
-}
-
-KEYWORD1 void KEYWORD2 NAME(GetTransformFeedbackVaryingEXT)(GLuint program, GLuint index, GLsizei bufSize, GLsizei * length, GLsizei * size, GLenum * type, GLchar * name)
-{
- DISPATCH(GetTransformFeedbackVaryingEXT, (program, index, bufSize, length, size, type, name), (F, "glGetTransformFeedbackVaryingEXT(%d, %d, %d, %p, %p, %p, %p);\n", program, index, bufSize, (const void *) length, (const void *) size, (const void *) type, (const void *) name));
-}
-
-KEYWORD1 void KEYWORD2 NAME(GetTransformFeedbackVarying)(GLuint program, GLuint index, GLsizei bufSize, GLsizei * length, GLsizei * size, GLenum * type, GLchar * name)
-{
- DISPATCH(GetTransformFeedbackVaryingEXT, (program, index, bufSize, length, size, type, name), (F, "glGetTransformFeedbackVarying(%d, %d, %d, %p, %p, %p, %p);\n", program, index, bufSize, (const void *) length, (const void *) size, (const void *) type, (const void *) name));
-}
-
-KEYWORD1 void KEYWORD2 NAME(TransformFeedbackVaryingsEXT)(GLuint program, GLsizei count, const char ** varyings, GLenum bufferMode)
-{
- DISPATCH(TransformFeedbackVaryingsEXT, (program, count, varyings, bufferMode), (F, "glTransformFeedbackVaryingsEXT(%d, %d, %p, 0x%x);\n", program, count, (const void *) varyings, bufferMode));
-}
-
-KEYWORD1 void KEYWORD2 NAME(TransformFeedbackVaryings)(GLuint program, GLsizei count, const GLchar* * varyings, GLenum bufferMode)
-{
- DISPATCH(TransformFeedbackVaryingsEXT, (program, count, varyings, bufferMode), (F, "glTransformFeedbackVaryings(%d, %d, %p, 0x%x);\n", program, count, (const void *) varyings, bufferMode));
-}
-
-KEYWORD1 void KEYWORD2 NAME(ProvokingVertexEXT)(GLenum mode)
-{
- DISPATCH(ProvokingVertexEXT, (mode), (F, "glProvokingVertexEXT(0x%x);\n", mode));
-}
-
-KEYWORD1 void KEYWORD2 NAME(ProvokingVertex)(GLenum mode)
-{
- DISPATCH(ProvokingVertexEXT, (mode), (F, "glProvokingVertex(0x%x);\n", mode));
-}
-
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_912)(GLenum target, GLenum pname, GLvoid ** params);
-
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_912)(GLenum target, GLenum pname, GLvoid ** params)
-{
- DISPATCH(GetTexParameterPointervAPPLE, (target, pname, params), (F, "glGetTexParameterPointervAPPLE(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
-}
-
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_913)(GLenum target, GLsizei length, GLvoid * pointer);
-
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_913)(GLenum target, GLsizei length, GLvoid * pointer)
-{
- DISPATCH(TextureRangeAPPLE, (target, length, pointer), (F, "glTextureRangeAPPLE(0x%x, %d, %p);\n", target, length, (const void *) pointer));
-}
-
-KEYWORD1 void KEYWORD2 NAME(GetObjectParameterivAPPLE)(GLenum objectType, GLuint name, GLenum pname, GLint * value)
-{
- DISPATCH(GetObjectParameterivAPPLE, (objectType, name, pname, value), (F, "glGetObjectParameterivAPPLE(0x%x, %d, 0x%x, %p);\n", objectType, name, pname, (const void *) value));
-}
-
-KEYWORD1 GLenum KEYWORD2 NAME(ObjectPurgeableAPPLE)(GLenum objectType, GLuint name, GLenum option)
-{
- RETURN_DISPATCH(ObjectPurgeableAPPLE, (objectType, name, option), (F, "glObjectPurgeableAPPLE(0x%x, %d, 0x%x);\n", objectType, name, option));
-}
-
-KEYWORD1 GLenum KEYWORD2 NAME(ObjectUnpurgeableAPPLE)(GLenum objectType, GLuint name, GLenum option)
-{
- RETURN_DISPATCH(ObjectUnpurgeableAPPLE, (objectType, name, option), (F, "glObjectUnpurgeableAPPLE(0x%x, %d, 0x%x);\n", objectType, name, option));
-}
-
-KEYWORD1 void KEYWORD2 NAME(ActiveProgramEXT)(GLuint program)
-{
- DISPATCH(ActiveProgramEXT, (program), (F, "glActiveProgramEXT(%d);\n", program));
-}
-
-KEYWORD1 GLuint KEYWORD2 NAME(CreateShaderProgramEXT)(GLenum type, const GLchar * string)
-{
- RETURN_DISPATCH(CreateShaderProgramEXT, (type, string), (F, "glCreateShaderProgramEXT(0x%x, %p);\n", type, (const void *) string));
-}
-
-KEYWORD1 void KEYWORD2 NAME(UseShaderProgramEXT)(GLenum type, GLuint program)
-{
- DISPATCH(UseShaderProgramEXT, (type, program), (F, "glUseShaderProgramEXT(0x%x, %d);\n", type, program));
-}
-
-KEYWORD1 void KEYWORD2 NAME(TextureBarrierNV)(void)
-{
- DISPATCH(TextureBarrierNV, (), (F, "glTextureBarrierNV();\n"));
-}
-
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_921)(GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask);
-
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_921)(GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask)
-{
- DISPATCH(StencilFuncSeparateATI, (frontfunc, backfunc, ref, mask), (F, "glStencilFuncSeparateATI(0x%x, 0x%x, %d, %d);\n", frontfunc, backfunc, ref, mask));
-}
-
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_922)(GLenum target, GLuint index, GLsizei count, const GLfloat * params);
-
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_922)(GLenum target, GLuint index, GLsizei count, const GLfloat * params)
-{
- DISPATCH(ProgramEnvParameters4fvEXT, (target, index, count, params), (F, "glProgramEnvParameters4fvEXT(0x%x, %d, %d, %p);\n", target, index, count, (const void *) params));
-}
-
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_923)(GLenum target, GLuint index, GLsizei count, const GLfloat * params);
-
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_923)(GLenum target, GLuint index, GLsizei count, const GLfloat * params)
-{
- DISPATCH(ProgramLocalParameters4fvEXT, (target, index, count, params), (F, "glProgramLocalParameters4fvEXT(0x%x, %d, %d, %p);\n", target, index, count, (const void *) params));
-}
-
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_924)(GLuint id, GLenum pname, GLint64EXT * params);
-
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_924)(GLuint id, GLenum pname, GLint64EXT * params)
-{
- DISPATCH(GetQueryObjecti64vEXT, (id, pname, params), (F, "glGetQueryObjecti64vEXT(%d, 0x%x, %p);\n", id, pname, (const void *) params));
-}
-
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_925)(GLuint id, GLenum pname, GLuint64EXT * params);
-
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_925)(GLuint id, GLenum pname, GLuint64EXT * params)
-{
- DISPATCH(GetQueryObjectui64vEXT, (id, pname, params), (F, "glGetQueryObjectui64vEXT(%d, 0x%x, %p);\n", id, pname, (const void *) params));
-}
-
-KEYWORD1 void KEYWORD2 NAME(EGLImageTargetRenderbufferStorageOES)(GLenum target, GLvoid * writeOffset)
-{
- DISPATCH(EGLImageTargetRenderbufferStorageOES, (target, writeOffset), (F, "glEGLImageTargetRenderbufferStorageOES(0x%x, %p);\n", target, (const void *) writeOffset));
-}
-
-KEYWORD1 void KEYWORD2 NAME(EGLImageTargetTexture2DOES)(GLenum target, GLvoid * writeOffset)
-{
- DISPATCH(EGLImageTargetTexture2DOES, (target, writeOffset), (F, "glEGLImageTargetTexture2DOES(0x%x, %p);\n", target, (const void *) writeOffset));
-}
-
-
-#endif /* _GLAPI_SKIP_NORMAL_ENTRY_POINTS */
-
-/* these entry points might require different protocols */
-#ifndef _GLAPI_SKIP_PROTO_ENTRY_POINTS
-
-KEYWORD1 GLboolean KEYWORD2 NAME(AreTexturesResidentEXT)(GLsizei n, const GLuint * textures, GLboolean * residences)
-{
- RETURN_DISPATCH(AreTexturesResident, (n, textures, residences), (F, "glAreTexturesResidentEXT(%d, %p, %p);\n", n, (const void *) textures, (const void *) residences));
-}
-
-KEYWORD1 void KEYWORD2 NAME(DeleteTexturesEXT)(GLsizei n, const GLuint * textures)
-{
- DISPATCH(DeleteTextures, (n, textures), (F, "glDeleteTexturesEXT(%d, %p);\n", n, (const void *) textures));
-}
-
-KEYWORD1 void KEYWORD2 NAME(GenTexturesEXT)(GLsizei n, GLuint * textures)
-{
- DISPATCH(GenTextures, (n, textures), (F, "glGenTexturesEXT(%d, %p);\n", n, (const void *) textures));
-}
-
-KEYWORD1 GLboolean KEYWORD2 NAME(IsTextureEXT)(GLuint texture)
-{
- RETURN_DISPATCH(IsTexture, (texture), (F, "glIsTextureEXT(%d);\n", texture));
-}
-
-KEYWORD1 void KEYWORD2 NAME(GetColorTableEXT)(GLenum target, GLenum format, GLenum type, GLvoid * table)
-{
- DISPATCH(GetColorTable, (target, format, type, table), (F, "glGetColorTableEXT(0x%x, 0x%x, 0x%x, %p);\n", target, format, type, (const void *) table));
-}
-
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_343)(GLenum target, GLenum format, GLenum type, GLvoid * table);
-
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_343)(GLenum target, GLenum format, GLenum type, GLvoid * table)
-{
- DISPATCH(GetColorTable, (target, format, type, table), (F, "glGetColorTableSGI(0x%x, 0x%x, 0x%x, %p);\n", target, format, type, (const void *) table));
-}
-
-KEYWORD1 void KEYWORD2 NAME(GetColorTableParameterfvEXT)(GLenum target, GLenum pname, GLfloat * params)
-{
- DISPATCH(GetColorTableParameterfv, (target, pname, params), (F, "glGetColorTableParameterfvEXT(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
-}
-
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_344)(GLenum target, GLenum pname, GLfloat * params);
-
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_344)(GLenum target, GLenum pname, GLfloat * params)
-{
- DISPATCH(GetColorTableParameterfv, (target, pname, params), (F, "glGetColorTableParameterfvSGI(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
-}
-
-KEYWORD1 void KEYWORD2 NAME(GetColorTableParameterivEXT)(GLenum target, GLenum pname, GLint * params)
-{
- DISPATCH(GetColorTableParameteriv, (target, pname, params), (F, "glGetColorTableParameterivEXT(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
-}
-
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_345)(GLenum target, GLenum pname, GLint * params);
-
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_345)(GLenum target, GLenum pname, GLint * params)
-{
- DISPATCH(GetColorTableParameteriv, (target, pname, params), (F, "glGetColorTableParameterivSGI(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
-}
-
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_356)(GLenum target, GLenum format, GLenum type, GLvoid * image);
-
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_356)(GLenum target, GLenum format, GLenum type, GLvoid * image)
-{
- DISPATCH(GetConvolutionFilter, (target, format, type, image), (F, "glGetConvolutionFilterEXT(0x%x, 0x%x, 0x%x, %p);\n", target, format, type, (const void *) image));
-}
-
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_357)(GLenum target, GLenum pname, GLfloat * params);
-
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_357)(GLenum target, GLenum pname, GLfloat * params)
-{
- DISPATCH(GetConvolutionParameterfv, (target, pname, params), (F, "glGetConvolutionParameterfvEXT(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
-}
-
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_358)(GLenum target, GLenum pname, GLint * params);
-
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_358)(GLenum target, GLenum pname, GLint * params)
-{
- DISPATCH(GetConvolutionParameteriv, (target, pname, params), (F, "glGetConvolutionParameterivEXT(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
-}
-
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_359)(GLenum target, GLenum format, GLenum type, GLvoid * row, GLvoid * column, GLvoid * span);
-
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_359)(GLenum target, GLenum format, GLenum type, GLvoid * row, GLvoid * column, GLvoid * span)
-{
- DISPATCH(GetSeparableFilter, (target, format, type, row, column, span), (F, "glGetSeparableFilterEXT(0x%x, 0x%x, 0x%x, %p, %p, %p);\n", target, format, type, (const void *) row, (const void *) column, (const void *) span));
-}
-
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_361)(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid * values);
-
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_361)(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid * values)
-{
- DISPATCH(GetHistogram, (target, reset, format, type, values), (F, "glGetHistogramEXT(0x%x, %d, 0x%x, 0x%x, %p);\n", target, reset, format, type, (const void *) values));
-}
-
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_362)(GLenum target, GLenum pname, GLfloat * params);
-
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_362)(GLenum target, GLenum pname, GLfloat * params)
-{
- DISPATCH(GetHistogramParameterfv, (target, pname, params), (F, "glGetHistogramParameterfvEXT(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
-}
-
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_363)(GLenum target, GLenum pname, GLint * params);
-
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_363)(GLenum target, GLenum pname, GLint * params)
-{
- DISPATCH(GetHistogramParameteriv, (target, pname, params), (F, "glGetHistogramParameterivEXT(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
-}
-
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_364)(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid * values);
-
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_364)(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid * values)
-{
- DISPATCH(GetMinmax, (target, reset, format, type, values), (F, "glGetMinmaxEXT(0x%x, %d, 0x%x, 0x%x, %p);\n", target, reset, format, type, (const void *) values));
-}
-
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_365)(GLenum target, GLenum pname, GLfloat * params);
-
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_365)(GLenum target, GLenum pname, GLfloat * params)
-{
- DISPATCH(GetMinmaxParameterfv, (target, pname, params), (F, "glGetMinmaxParameterfvEXT(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
-}
-
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_366)(GLenum target, GLenum pname, GLint * params);
-
-KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_366)(GLenum target, GLenum pname, GLint * params)
-{
- DISPATCH(GetMinmaxParameteriv, (target, pname, params), (F, "glGetMinmaxParameterivEXT(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
-}
-
-
-#endif /* _GLAPI_SKIP_PROTO_ENTRY_POINTS */
-
-
-#endif /* defined( NAME ) */
-
-/*
- * This is how a dispatch table can be initialized with all the functions
- * we generated above.
- */
-#ifdef DISPATCH_TABLE_NAME
-
-#ifndef TABLE_ENTRY
-#error TABLE_ENTRY must be defined
-#endif
-
-#ifdef _GLAPI_SKIP_NORMAL_ENTRY_POINTS
-#error _GLAPI_SKIP_NORMAL_ENTRY_POINTS must not be defined
-#endif
-
-_glapi_proc DISPATCH_TABLE_NAME[] = {
- TABLE_ENTRY(NewList),
- TABLE_ENTRY(EndList),
- TABLE_ENTRY(CallList),
- TABLE_ENTRY(CallLists),
- TABLE_ENTRY(DeleteLists),
- TABLE_ENTRY(GenLists),
- TABLE_ENTRY(ListBase),
- TABLE_ENTRY(Begin),
- TABLE_ENTRY(Bitmap),
- TABLE_ENTRY(Color3b),
- TABLE_ENTRY(Color3bv),
- TABLE_ENTRY(Color3d),
- TABLE_ENTRY(Color3dv),
- TABLE_ENTRY(Color3f),
- TABLE_ENTRY(Color3fv),
- TABLE_ENTRY(Color3i),
- TABLE_ENTRY(Color3iv),
- TABLE_ENTRY(Color3s),
- TABLE_ENTRY(Color3sv),
- TABLE_ENTRY(Color3ub),
- TABLE_ENTRY(Color3ubv),
- TABLE_ENTRY(Color3ui),
- TABLE_ENTRY(Color3uiv),
- TABLE_ENTRY(Color3us),
- TABLE_ENTRY(Color3usv),
- TABLE_ENTRY(Color4b),
- TABLE_ENTRY(Color4bv),
- TABLE_ENTRY(Color4d),
- TABLE_ENTRY(Color4dv),
- TABLE_ENTRY(Color4f),
- TABLE_ENTRY(Color4fv),
- TABLE_ENTRY(Color4i),
- TABLE_ENTRY(Color4iv),
- TABLE_ENTRY(Color4s),
- TABLE_ENTRY(Color4sv),
- TABLE_ENTRY(Color4ub),
- TABLE_ENTRY(Color4ubv),
- TABLE_ENTRY(Color4ui),
- TABLE_ENTRY(Color4uiv),
- TABLE_ENTRY(Color4us),
- TABLE_ENTRY(Color4usv),
- TABLE_ENTRY(EdgeFlag),
- TABLE_ENTRY(EdgeFlagv),
- TABLE_ENTRY(End),
- TABLE_ENTRY(Indexd),
- TABLE_ENTRY(Indexdv),
- TABLE_ENTRY(Indexf),
- TABLE_ENTRY(Indexfv),
- TABLE_ENTRY(Indexi),
- TABLE_ENTRY(Indexiv),
- TABLE_ENTRY(Indexs),
- TABLE_ENTRY(Indexsv),
- TABLE_ENTRY(Normal3b),
- TABLE_ENTRY(Normal3bv),
- TABLE_ENTRY(Normal3d),
- TABLE_ENTRY(Normal3dv),
- TABLE_ENTRY(Normal3f),
- TABLE_ENTRY(Normal3fv),
- TABLE_ENTRY(Normal3i),
- TABLE_ENTRY(Normal3iv),
- TABLE_ENTRY(Normal3s),
- TABLE_ENTRY(Normal3sv),
- TABLE_ENTRY(RasterPos2d),
- TABLE_ENTRY(RasterPos2dv),
- TABLE_ENTRY(RasterPos2f),
- TABLE_ENTRY(RasterPos2fv),
- TABLE_ENTRY(RasterPos2i),
- TABLE_ENTRY(RasterPos2iv),
- TABLE_ENTRY(RasterPos2s),
- TABLE_ENTRY(RasterPos2sv),
- TABLE_ENTRY(RasterPos3d),
- TABLE_ENTRY(RasterPos3dv),
- TABLE_ENTRY(RasterPos3f),
- TABLE_ENTRY(RasterPos3fv),
- TABLE_ENTRY(RasterPos3i),
- TABLE_ENTRY(RasterPos3iv),
- TABLE_ENTRY(RasterPos3s),
- TABLE_ENTRY(RasterPos3sv),
- TABLE_ENTRY(RasterPos4d),
- TABLE_ENTRY(RasterPos4dv),
- TABLE_ENTRY(RasterPos4f),
- TABLE_ENTRY(RasterPos4fv),
- TABLE_ENTRY(RasterPos4i),
- TABLE_ENTRY(RasterPos4iv),
- TABLE_ENTRY(RasterPos4s),
- TABLE_ENTRY(RasterPos4sv),
- TABLE_ENTRY(Rectd),
- TABLE_ENTRY(Rectdv),
- TABLE_ENTRY(Rectf),
- TABLE_ENTRY(Rectfv),
- TABLE_ENTRY(Recti),
- TABLE_ENTRY(Rectiv),
- TABLE_ENTRY(Rects),
- TABLE_ENTRY(Rectsv),
- TABLE_ENTRY(TexCoord1d),
- TABLE_ENTRY(TexCoord1dv),
- TABLE_ENTRY(TexCoord1f),
- TABLE_ENTRY(TexCoord1fv),
- TABLE_ENTRY(TexCoord1i),
- TABLE_ENTRY(TexCoord1iv),
- TABLE_ENTRY(TexCoord1s),
- TABLE_ENTRY(TexCoord1sv),
- TABLE_ENTRY(TexCoord2d),
- TABLE_ENTRY(TexCoord2dv),
- TABLE_ENTRY(TexCoord2f),
- TABLE_ENTRY(TexCoord2fv),
- TABLE_ENTRY(TexCoord2i),
- TABLE_ENTRY(TexCoord2iv),
- TABLE_ENTRY(TexCoord2s),
- TABLE_ENTRY(TexCoord2sv),
- TABLE_ENTRY(TexCoord3d),
- TABLE_ENTRY(TexCoord3dv),
- TABLE_ENTRY(TexCoord3f),
- TABLE_ENTRY(TexCoord3fv),
- TABLE_ENTRY(TexCoord3i),
- TABLE_ENTRY(TexCoord3iv),
- TABLE_ENTRY(TexCoord3s),
- TABLE_ENTRY(TexCoord3sv),
- TABLE_ENTRY(TexCoord4d),
- TABLE_ENTRY(TexCoord4dv),
- TABLE_ENTRY(TexCoord4f),
- TABLE_ENTRY(TexCoord4fv),
- TABLE_ENTRY(TexCoord4i),
- TABLE_ENTRY(TexCoord4iv),
- TABLE_ENTRY(TexCoord4s),
- TABLE_ENTRY(TexCoord4sv),
- TABLE_ENTRY(Vertex2d),
- TABLE_ENTRY(Vertex2dv),
- TABLE_ENTRY(Vertex2f),
- TABLE_ENTRY(Vertex2fv),
- TABLE_ENTRY(Vertex2i),
- TABLE_ENTRY(Vertex2iv),
- TABLE_ENTRY(Vertex2s),
- TABLE_ENTRY(Vertex2sv),
- TABLE_ENTRY(Vertex3d),
- TABLE_ENTRY(Vertex3dv),
- TABLE_ENTRY(Vertex3f),
- TABLE_ENTRY(Vertex3fv),
- TABLE_ENTRY(Vertex3i),
- TABLE_ENTRY(Vertex3iv),
- TABLE_ENTRY(Vertex3s),
- TABLE_ENTRY(Vertex3sv),
- TABLE_ENTRY(Vertex4d),
- TABLE_ENTRY(Vertex4dv),
- TABLE_ENTRY(Vertex4f),
- TABLE_ENTRY(Vertex4fv),
- TABLE_ENTRY(Vertex4i),
- TABLE_ENTRY(Vertex4iv),
- TABLE_ENTRY(Vertex4s),
- TABLE_ENTRY(Vertex4sv),
- TABLE_ENTRY(ClipPlane),
- TABLE_ENTRY(ColorMaterial),
- TABLE_ENTRY(CullFace),
- TABLE_ENTRY(Fogf),
- TABLE_ENTRY(Fogfv),
- TABLE_ENTRY(Fogi),
- TABLE_ENTRY(Fogiv),
- TABLE_ENTRY(FrontFace),
- TABLE_ENTRY(Hint),
- TABLE_ENTRY(Lightf),
- TABLE_ENTRY(Lightfv),
- TABLE_ENTRY(Lighti),
- TABLE_ENTRY(Lightiv),
- TABLE_ENTRY(LightModelf),
- TABLE_ENTRY(LightModelfv),
- TABLE_ENTRY(LightModeli),
- TABLE_ENTRY(LightModeliv),
- TABLE_ENTRY(LineStipple),
- TABLE_ENTRY(LineWidth),
- TABLE_ENTRY(Materialf),
- TABLE_ENTRY(Materialfv),
- TABLE_ENTRY(Materiali),
- TABLE_ENTRY(Materialiv),
- TABLE_ENTRY(PointSize),
- TABLE_ENTRY(PolygonMode),
- TABLE_ENTRY(PolygonStipple),
- TABLE_ENTRY(Scissor),
- TABLE_ENTRY(ShadeModel),
- TABLE_ENTRY(TexParameterf),
- TABLE_ENTRY(TexParameterfv),
- TABLE_ENTRY(TexParameteri),
- TABLE_ENTRY(TexParameteriv),
- TABLE_ENTRY(TexImage1D),
- TABLE_ENTRY(TexImage2D),
- TABLE_ENTRY(TexEnvf),
- TABLE_ENTRY(TexEnvfv),
- TABLE_ENTRY(TexEnvi),
- TABLE_ENTRY(TexEnviv),
- TABLE_ENTRY(TexGend),
- TABLE_ENTRY(TexGendv),
- TABLE_ENTRY(TexGenf),
- TABLE_ENTRY(TexGenfv),
- TABLE_ENTRY(TexGeni),
- TABLE_ENTRY(TexGeniv),
- TABLE_ENTRY(FeedbackBuffer),
- TABLE_ENTRY(SelectBuffer),
- TABLE_ENTRY(RenderMode),
- TABLE_ENTRY(InitNames),
- TABLE_ENTRY(LoadName),
- TABLE_ENTRY(PassThrough),
- TABLE_ENTRY(PopName),
- TABLE_ENTRY(PushName),
- TABLE_ENTRY(DrawBuffer),
- TABLE_ENTRY(Clear),
- TABLE_ENTRY(ClearAccum),
- TABLE_ENTRY(ClearIndex),
- TABLE_ENTRY(ClearColor),
- TABLE_ENTRY(ClearStencil),
- TABLE_ENTRY(ClearDepth),
- TABLE_ENTRY(StencilMask),
- TABLE_ENTRY(ColorMask),
- TABLE_ENTRY(DepthMask),
- TABLE_ENTRY(IndexMask),
- TABLE_ENTRY(Accum),
- TABLE_ENTRY(Disable),
- TABLE_ENTRY(Enable),
- TABLE_ENTRY(Finish),
- TABLE_ENTRY(Flush),
- TABLE_ENTRY(PopAttrib),
- TABLE_ENTRY(PushAttrib),
- TABLE_ENTRY(Map1d),
- TABLE_ENTRY(Map1f),
- TABLE_ENTRY(Map2d),
- TABLE_ENTRY(Map2f),
- TABLE_ENTRY(MapGrid1d),
- TABLE_ENTRY(MapGrid1f),
- TABLE_ENTRY(MapGrid2d),
- TABLE_ENTRY(MapGrid2f),
- TABLE_ENTRY(EvalCoord1d),
- TABLE_ENTRY(EvalCoord1dv),
- TABLE_ENTRY(EvalCoord1f),
- TABLE_ENTRY(EvalCoord1fv),
- TABLE_ENTRY(EvalCoord2d),
- TABLE_ENTRY(EvalCoord2dv),
- TABLE_ENTRY(EvalCoord2f),
- TABLE_ENTRY(EvalCoord2fv),
- TABLE_ENTRY(EvalMesh1),
- TABLE_ENTRY(EvalPoint1),
- TABLE_ENTRY(EvalMesh2),
- TABLE_ENTRY(EvalPoint2),
- TABLE_ENTRY(AlphaFunc),
- TABLE_ENTRY(BlendFunc),
- TABLE_ENTRY(LogicOp),
- TABLE_ENTRY(StencilFunc),
- TABLE_ENTRY(StencilOp),
- TABLE_ENTRY(DepthFunc),
- TABLE_ENTRY(PixelZoom),
- TABLE_ENTRY(PixelTransferf),
- TABLE_ENTRY(PixelTransferi),
- TABLE_ENTRY(PixelStoref),
- TABLE_ENTRY(PixelStorei),
- TABLE_ENTRY(PixelMapfv),
- TABLE_ENTRY(PixelMapuiv),
- TABLE_ENTRY(PixelMapusv),
- TABLE_ENTRY(ReadBuffer),
- TABLE_ENTRY(CopyPixels),
- TABLE_ENTRY(ReadPixels),
- TABLE_ENTRY(DrawPixels),
- TABLE_ENTRY(GetBooleanv),
- TABLE_ENTRY(GetClipPlane),
- TABLE_ENTRY(GetDoublev),
- TABLE_ENTRY(GetError),
- TABLE_ENTRY(GetFloatv),
- TABLE_ENTRY(GetIntegerv),
- TABLE_ENTRY(GetLightfv),
- TABLE_ENTRY(GetLightiv),
- TABLE_ENTRY(GetMapdv),
- TABLE_ENTRY(GetMapfv),
- TABLE_ENTRY(GetMapiv),
- TABLE_ENTRY(GetMaterialfv),
- TABLE_ENTRY(GetMaterialiv),
- TABLE_ENTRY(GetPixelMapfv),
- TABLE_ENTRY(GetPixelMapuiv),
- TABLE_ENTRY(GetPixelMapusv),
- TABLE_ENTRY(GetPolygonStipple),
- TABLE_ENTRY(GetString),
- TABLE_ENTRY(GetTexEnvfv),
- TABLE_ENTRY(GetTexEnviv),
- TABLE_ENTRY(GetTexGendv),
- TABLE_ENTRY(GetTexGenfv),
- TABLE_ENTRY(GetTexGeniv),
- TABLE_ENTRY(GetTexImage),
- TABLE_ENTRY(GetTexParameterfv),
- TABLE_ENTRY(GetTexParameteriv),
- TABLE_ENTRY(GetTexLevelParameterfv),
- TABLE_ENTRY(GetTexLevelParameteriv),
- TABLE_ENTRY(IsEnabled),
- TABLE_ENTRY(IsList),
- TABLE_ENTRY(DepthRange),
- TABLE_ENTRY(Frustum),
- TABLE_ENTRY(LoadIdentity),
- TABLE_ENTRY(LoadMatrixf),
- TABLE_ENTRY(LoadMatrixd),
- TABLE_ENTRY(MatrixMode),
- TABLE_ENTRY(MultMatrixf),
- TABLE_ENTRY(MultMatrixd),
- TABLE_ENTRY(Ortho),
- TABLE_ENTRY(PopMatrix),
- TABLE_ENTRY(PushMatrix),
- TABLE_ENTRY(Rotated),
- TABLE_ENTRY(Rotatef),
- TABLE_ENTRY(Scaled),
- TABLE_ENTRY(Scalef),
- TABLE_ENTRY(Translated),
- TABLE_ENTRY(Translatef),
- TABLE_ENTRY(Viewport),
- TABLE_ENTRY(ArrayElement),
- TABLE_ENTRY(BindTexture),
- TABLE_ENTRY(ColorPointer),
- TABLE_ENTRY(DisableClientState),
- TABLE_ENTRY(DrawArrays),
- TABLE_ENTRY(DrawElements),
- TABLE_ENTRY(EdgeFlagPointer),
- TABLE_ENTRY(EnableClientState),
- TABLE_ENTRY(IndexPointer),
- TABLE_ENTRY(Indexub),
- TABLE_ENTRY(Indexubv),
- TABLE_ENTRY(InterleavedArrays),
- TABLE_ENTRY(NormalPointer),
- TABLE_ENTRY(PolygonOffset),
- TABLE_ENTRY(TexCoordPointer),
- TABLE_ENTRY(VertexPointer),
- TABLE_ENTRY(AreTexturesResident),
- TABLE_ENTRY(CopyTexImage1D),
- TABLE_ENTRY(CopyTexImage2D),
- TABLE_ENTRY(CopyTexSubImage1D),
- TABLE_ENTRY(CopyTexSubImage2D),
- TABLE_ENTRY(DeleteTextures),
- TABLE_ENTRY(GenTextures),
- TABLE_ENTRY(GetPointerv),
- TABLE_ENTRY(IsTexture),
- TABLE_ENTRY(PrioritizeTextures),
- TABLE_ENTRY(TexSubImage1D),
- TABLE_ENTRY(TexSubImage2D),
- TABLE_ENTRY(PopClientAttrib),
- TABLE_ENTRY(PushClientAttrib),
- TABLE_ENTRY(BlendColor),
- TABLE_ENTRY(BlendEquation),
- TABLE_ENTRY(DrawRangeElements),
- TABLE_ENTRY(ColorTable),
- TABLE_ENTRY(ColorTableParameterfv),
- TABLE_ENTRY(ColorTableParameteriv),
- TABLE_ENTRY(CopyColorTable),
- TABLE_ENTRY(GetColorTable),
- TABLE_ENTRY(GetColorTableParameterfv),
- TABLE_ENTRY(GetColorTableParameteriv),
- TABLE_ENTRY(ColorSubTable),
- TABLE_ENTRY(CopyColorSubTable),
- TABLE_ENTRY(ConvolutionFilter1D),
- TABLE_ENTRY(ConvolutionFilter2D),
- TABLE_ENTRY(ConvolutionParameterf),
- TABLE_ENTRY(ConvolutionParameterfv),
- TABLE_ENTRY(ConvolutionParameteri),
- TABLE_ENTRY(ConvolutionParameteriv),
- TABLE_ENTRY(CopyConvolutionFilter1D),
- TABLE_ENTRY(CopyConvolutionFilter2D),
- TABLE_ENTRY(GetConvolutionFilter),
- TABLE_ENTRY(GetConvolutionParameterfv),
- TABLE_ENTRY(GetConvolutionParameteriv),
- TABLE_ENTRY(GetSeparableFilter),
- TABLE_ENTRY(SeparableFilter2D),
- TABLE_ENTRY(GetHistogram),
- TABLE_ENTRY(GetHistogramParameterfv),
- TABLE_ENTRY(GetHistogramParameteriv),
- TABLE_ENTRY(GetMinmax),
- TABLE_ENTRY(GetMinmaxParameterfv),
- TABLE_ENTRY(GetMinmaxParameteriv),
- TABLE_ENTRY(Histogram),
- TABLE_ENTRY(Minmax),
- TABLE_ENTRY(ResetHistogram),
- TABLE_ENTRY(ResetMinmax),
- TABLE_ENTRY(TexImage3D),
- TABLE_ENTRY(TexSubImage3D),
- TABLE_ENTRY(CopyTexSubImage3D),
- TABLE_ENTRY(ActiveTextureARB),
- TABLE_ENTRY(ClientActiveTextureARB),
- TABLE_ENTRY(MultiTexCoord1dARB),
- TABLE_ENTRY(MultiTexCoord1dvARB),
- TABLE_ENTRY(MultiTexCoord1fARB),
- TABLE_ENTRY(MultiTexCoord1fvARB),
- TABLE_ENTRY(MultiTexCoord1iARB),
- TABLE_ENTRY(MultiTexCoord1ivARB),
- TABLE_ENTRY(MultiTexCoord1sARB),
- TABLE_ENTRY(MultiTexCoord1svARB),
- TABLE_ENTRY(MultiTexCoord2dARB),
- TABLE_ENTRY(MultiTexCoord2dvARB),
- TABLE_ENTRY(MultiTexCoord2fARB),
- TABLE_ENTRY(MultiTexCoord2fvARB),
- TABLE_ENTRY(MultiTexCoord2iARB),
- TABLE_ENTRY(MultiTexCoord2ivARB),
- TABLE_ENTRY(MultiTexCoord2sARB),
- TABLE_ENTRY(MultiTexCoord2svARB),
- TABLE_ENTRY(MultiTexCoord3dARB),
- TABLE_ENTRY(MultiTexCoord3dvARB),
- TABLE_ENTRY(MultiTexCoord3fARB),
- TABLE_ENTRY(MultiTexCoord3fvARB),
- TABLE_ENTRY(MultiTexCoord3iARB),
- TABLE_ENTRY(MultiTexCoord3ivARB),
- TABLE_ENTRY(MultiTexCoord3sARB),
- TABLE_ENTRY(MultiTexCoord3svARB),
- TABLE_ENTRY(MultiTexCoord4dARB),
- TABLE_ENTRY(MultiTexCoord4dvARB),
- TABLE_ENTRY(MultiTexCoord4fARB),
- TABLE_ENTRY(MultiTexCoord4fvARB),
- TABLE_ENTRY(MultiTexCoord4iARB),
- TABLE_ENTRY(MultiTexCoord4ivARB),
- TABLE_ENTRY(MultiTexCoord4sARB),
- TABLE_ENTRY(MultiTexCoord4svARB),
- TABLE_ENTRY(AttachShader),
- TABLE_ENTRY(CreateProgram),
- TABLE_ENTRY(CreateShader),
- TABLE_ENTRY(DeleteProgram),
- TABLE_ENTRY(DeleteShader),
- TABLE_ENTRY(DetachShader),
- TABLE_ENTRY(GetAttachedShaders),
- TABLE_ENTRY(GetProgramInfoLog),
- TABLE_ENTRY(GetProgramiv),
- TABLE_ENTRY(GetShaderInfoLog),
- TABLE_ENTRY(GetShaderiv),
- TABLE_ENTRY(IsProgram),
- TABLE_ENTRY(IsShader),
- TABLE_ENTRY(StencilFuncSeparate),
- TABLE_ENTRY(StencilMaskSeparate),
- TABLE_ENTRY(StencilOpSeparate),
- TABLE_ENTRY(UniformMatrix2x3fv),
- TABLE_ENTRY(UniformMatrix2x4fv),
- TABLE_ENTRY(UniformMatrix3x2fv),
- TABLE_ENTRY(UniformMatrix3x4fv),
- TABLE_ENTRY(UniformMatrix4x2fv),
- TABLE_ENTRY(UniformMatrix4x3fv),
- TABLE_ENTRY(ClampColor),
- TABLE_ENTRY(ClearBufferfi),
- TABLE_ENTRY(ClearBufferfv),
- TABLE_ENTRY(ClearBufferiv),
- TABLE_ENTRY(ClearBufferuiv),
- TABLE_ENTRY(GetStringi),
- TABLE_ENTRY(TexBuffer),
- TABLE_ENTRY(FramebufferTexture),
- TABLE_ENTRY(GetBufferParameteri64v),
- TABLE_ENTRY(GetInteger64i_v),
- TABLE_ENTRY(VertexAttribDivisor),
- TABLE_ENTRY(LoadTransposeMatrixdARB),
- TABLE_ENTRY(LoadTransposeMatrixfARB),
- TABLE_ENTRY(MultTransposeMatrixdARB),
- TABLE_ENTRY(MultTransposeMatrixfARB),
- TABLE_ENTRY(SampleCoverageARB),
- TABLE_ENTRY(CompressedTexImage1DARB),
- TABLE_ENTRY(CompressedTexImage2DARB),
- TABLE_ENTRY(CompressedTexImage3DARB),
- TABLE_ENTRY(CompressedTexSubImage1DARB),
- TABLE_ENTRY(CompressedTexSubImage2DARB),
- TABLE_ENTRY(CompressedTexSubImage3DARB),
- TABLE_ENTRY(GetCompressedTexImageARB),
- TABLE_ENTRY(DisableVertexAttribArrayARB),
- TABLE_ENTRY(EnableVertexAttribArrayARB),
- TABLE_ENTRY(GetProgramEnvParameterdvARB),
- TABLE_ENTRY(GetProgramEnvParameterfvARB),
- TABLE_ENTRY(GetProgramLocalParameterdvARB),
- TABLE_ENTRY(GetProgramLocalParameterfvARB),
- TABLE_ENTRY(GetProgramStringARB),
- TABLE_ENTRY(GetProgramivARB),
- TABLE_ENTRY(GetVertexAttribdvARB),
- TABLE_ENTRY(GetVertexAttribfvARB),
- TABLE_ENTRY(GetVertexAttribivARB),
- TABLE_ENTRY(ProgramEnvParameter4dARB),
- TABLE_ENTRY(ProgramEnvParameter4dvARB),
- TABLE_ENTRY(ProgramEnvParameter4fARB),
- TABLE_ENTRY(ProgramEnvParameter4fvARB),
- TABLE_ENTRY(ProgramLocalParameter4dARB),
- TABLE_ENTRY(ProgramLocalParameter4dvARB),
- TABLE_ENTRY(ProgramLocalParameter4fARB),
- TABLE_ENTRY(ProgramLocalParameter4fvARB),
- TABLE_ENTRY(ProgramStringARB),
- TABLE_ENTRY(VertexAttrib1dARB),
- TABLE_ENTRY(VertexAttrib1dvARB),
- TABLE_ENTRY(VertexAttrib1fARB),
- TABLE_ENTRY(VertexAttrib1fvARB),
- TABLE_ENTRY(VertexAttrib1sARB),
- TABLE_ENTRY(VertexAttrib1svARB),
- TABLE_ENTRY(VertexAttrib2dARB),
- TABLE_ENTRY(VertexAttrib2dvARB),
- TABLE_ENTRY(VertexAttrib2fARB),
- TABLE_ENTRY(VertexAttrib2fvARB),
- TABLE_ENTRY(VertexAttrib2sARB),
- TABLE_ENTRY(VertexAttrib2svARB),
- TABLE_ENTRY(VertexAttrib3dARB),
- TABLE_ENTRY(VertexAttrib3dvARB),
- TABLE_ENTRY(VertexAttrib3fARB),
- TABLE_ENTRY(VertexAttrib3fvARB),
- TABLE_ENTRY(VertexAttrib3sARB),
- TABLE_ENTRY(VertexAttrib3svARB),
- TABLE_ENTRY(VertexAttrib4NbvARB),
- TABLE_ENTRY(VertexAttrib4NivARB),
- TABLE_ENTRY(VertexAttrib4NsvARB),
- TABLE_ENTRY(VertexAttrib4NubARB),
- TABLE_ENTRY(VertexAttrib4NubvARB),
- TABLE_ENTRY(VertexAttrib4NuivARB),
- TABLE_ENTRY(VertexAttrib4NusvARB),
- TABLE_ENTRY(VertexAttrib4bvARB),
- TABLE_ENTRY(VertexAttrib4dARB),
- TABLE_ENTRY(VertexAttrib4dvARB),
- TABLE_ENTRY(VertexAttrib4fARB),
- TABLE_ENTRY(VertexAttrib4fvARB),
- TABLE_ENTRY(VertexAttrib4ivARB),
- TABLE_ENTRY(VertexAttrib4sARB),
- TABLE_ENTRY(VertexAttrib4svARB),
- TABLE_ENTRY(VertexAttrib4ubvARB),
- TABLE_ENTRY(VertexAttrib4uivARB),
- TABLE_ENTRY(VertexAttrib4usvARB),
- TABLE_ENTRY(VertexAttribPointerARB),
- TABLE_ENTRY(BindBufferARB),
- TABLE_ENTRY(BufferDataARB),
- TABLE_ENTRY(BufferSubDataARB),
- TABLE_ENTRY(DeleteBuffersARB),
- TABLE_ENTRY(GenBuffersARB),
- TABLE_ENTRY(GetBufferParameterivARB),
- TABLE_ENTRY(GetBufferPointervARB),
- TABLE_ENTRY(GetBufferSubDataARB),
- TABLE_ENTRY(IsBufferARB),
- TABLE_ENTRY(MapBufferARB),
- TABLE_ENTRY(UnmapBufferARB),
- TABLE_ENTRY(BeginQueryARB),
- TABLE_ENTRY(DeleteQueriesARB),
- TABLE_ENTRY(EndQueryARB),
- TABLE_ENTRY(GenQueriesARB),
- TABLE_ENTRY(GetQueryObjectivARB),
- TABLE_ENTRY(GetQueryObjectuivARB),
- TABLE_ENTRY(GetQueryivARB),
- TABLE_ENTRY(IsQueryARB),
- TABLE_ENTRY(AttachObjectARB),
- TABLE_ENTRY(CompileShaderARB),
- TABLE_ENTRY(CreateProgramObjectARB),
- TABLE_ENTRY(CreateShaderObjectARB),
- TABLE_ENTRY(DeleteObjectARB),
- TABLE_ENTRY(DetachObjectARB),
- TABLE_ENTRY(GetActiveUniformARB),
- TABLE_ENTRY(GetAttachedObjectsARB),
- TABLE_ENTRY(GetHandleARB),
- TABLE_ENTRY(GetInfoLogARB),
- TABLE_ENTRY(GetObjectParameterfvARB),
- TABLE_ENTRY(GetObjectParameterivARB),
- TABLE_ENTRY(GetShaderSourceARB),
- TABLE_ENTRY(GetUniformLocationARB),
- TABLE_ENTRY(GetUniformfvARB),
- TABLE_ENTRY(GetUniformivARB),
- TABLE_ENTRY(LinkProgramARB),
- TABLE_ENTRY(ShaderSourceARB),
- TABLE_ENTRY(Uniform1fARB),
- TABLE_ENTRY(Uniform1fvARB),
- TABLE_ENTRY(Uniform1iARB),
- TABLE_ENTRY(Uniform1ivARB),
- TABLE_ENTRY(Uniform2fARB),
- TABLE_ENTRY(Uniform2fvARB),
- TABLE_ENTRY(Uniform2iARB),
- TABLE_ENTRY(Uniform2ivARB),
- TABLE_ENTRY(Uniform3fARB),
- TABLE_ENTRY(Uniform3fvARB),
- TABLE_ENTRY(Uniform3iARB),
- TABLE_ENTRY(Uniform3ivARB),
- TABLE_ENTRY(Uniform4fARB),
- TABLE_ENTRY(Uniform4fvARB),
- TABLE_ENTRY(Uniform4iARB),
- TABLE_ENTRY(Uniform4ivARB),
- TABLE_ENTRY(UniformMatrix2fvARB),
- TABLE_ENTRY(UniformMatrix3fvARB),
- TABLE_ENTRY(UniformMatrix4fvARB),
- TABLE_ENTRY(UseProgramObjectARB),
- TABLE_ENTRY(ValidateProgramARB),
- TABLE_ENTRY(BindAttribLocationARB),
- TABLE_ENTRY(GetActiveAttribARB),
- TABLE_ENTRY(GetAttribLocationARB),
- TABLE_ENTRY(DrawBuffersARB),
- TABLE_ENTRY(ClampColorARB),
- TABLE_ENTRY(DrawArraysInstancedARB),
- TABLE_ENTRY(DrawElementsInstancedARB),
- TABLE_ENTRY(RenderbufferStorageMultisample),
- TABLE_ENTRY(FramebufferTextureARB),
- TABLE_ENTRY(FramebufferTextureFaceARB),
- TABLE_ENTRY(ProgramParameteriARB),
- TABLE_ENTRY(VertexAttribDivisorARB),
- TABLE_ENTRY(FlushMappedBufferRange),
- TABLE_ENTRY(MapBufferRange),
- TABLE_ENTRY(TexBufferARB),
- TABLE_ENTRY(BindVertexArray),
- TABLE_ENTRY(GenVertexArrays),
- TABLE_ENTRY(CopyBufferSubData),
- TABLE_ENTRY(ClientWaitSync),
- TABLE_ENTRY(DeleteSync),
- TABLE_ENTRY(FenceSync),
- TABLE_ENTRY(GetInteger64v),
- TABLE_ENTRY(GetSynciv),
- TABLE_ENTRY(IsSync),
- TABLE_ENTRY(WaitSync),
- TABLE_ENTRY(DrawElementsBaseVertex),
- TABLE_ENTRY(DrawRangeElementsBaseVertex),
- TABLE_ENTRY(MultiDrawElementsBaseVertex),
- TABLE_ENTRY(BlendEquationSeparateiARB),
- TABLE_ENTRY(BlendEquationiARB),
- TABLE_ENTRY(BlendFuncSeparateiARB),
- TABLE_ENTRY(BlendFunciARB),
- TABLE_ENTRY(BindSampler),
- TABLE_ENTRY(DeleteSamplers),
- TABLE_ENTRY(GenSamplers),
- TABLE_ENTRY(GetSamplerParameterIiv),
- TABLE_ENTRY(GetSamplerParameterIuiv),
- TABLE_ENTRY(GetSamplerParameterfv),
- TABLE_ENTRY(GetSamplerParameteriv),
- TABLE_ENTRY(IsSampler),
- TABLE_ENTRY(SamplerParameterIiv),
- TABLE_ENTRY(SamplerParameterIuiv),
- TABLE_ENTRY(SamplerParameterf),
- TABLE_ENTRY(SamplerParameterfv),
- TABLE_ENTRY(SamplerParameteri),
- TABLE_ENTRY(SamplerParameteriv),
- TABLE_ENTRY(BindTransformFeedback),
- TABLE_ENTRY(DeleteTransformFeedbacks),
- TABLE_ENTRY(DrawTransformFeedback),
- TABLE_ENTRY(GenTransformFeedbacks),
- TABLE_ENTRY(IsTransformFeedback),
- TABLE_ENTRY(PauseTransformFeedback),
- TABLE_ENTRY(ResumeTransformFeedback),
- TABLE_ENTRY(ClearDepthf),
- TABLE_ENTRY(DepthRangef),
- TABLE_ENTRY(GetShaderPrecisionFormat),
- TABLE_ENTRY(ReleaseShaderCompiler),
- TABLE_ENTRY(ShaderBinary),
- TABLE_ENTRY(GetGraphicsResetStatusARB),
- TABLE_ENTRY(GetnColorTableARB),
- TABLE_ENTRY(GetnCompressedTexImageARB),
- TABLE_ENTRY(GetnConvolutionFilterARB),
- TABLE_ENTRY(GetnHistogramARB),
- TABLE_ENTRY(GetnMapdvARB),
- TABLE_ENTRY(GetnMapfvARB),
- TABLE_ENTRY(GetnMapivARB),
- TABLE_ENTRY(GetnMinmaxARB),
- TABLE_ENTRY(GetnPixelMapfvARB),
- TABLE_ENTRY(GetnPixelMapuivARB),
- TABLE_ENTRY(GetnPixelMapusvARB),
- TABLE_ENTRY(GetnPolygonStippleARB),
- TABLE_ENTRY(GetnSeparableFilterARB),
- TABLE_ENTRY(GetnTexImageARB),
- TABLE_ENTRY(GetnUniformdvARB),
- TABLE_ENTRY(GetnUniformfvARB),
- TABLE_ENTRY(GetnUniformivARB),
- TABLE_ENTRY(GetnUniformuivARB),
- TABLE_ENTRY(ReadnPixelsARB),
- TABLE_ENTRY(PolygonOffsetEXT),
- TABLE_ENTRY(_dispatch_stub_647),
- TABLE_ENTRY(_dispatch_stub_648),
- TABLE_ENTRY(_dispatch_stub_649),
- TABLE_ENTRY(_dispatch_stub_650),
- TABLE_ENTRY(_dispatch_stub_651),
- TABLE_ENTRY(_dispatch_stub_652),
- TABLE_ENTRY(_dispatch_stub_653),
- TABLE_ENTRY(_dispatch_stub_654),
- TABLE_ENTRY(ColorPointerEXT),
- TABLE_ENTRY(EdgeFlagPointerEXT),
- TABLE_ENTRY(IndexPointerEXT),
- TABLE_ENTRY(NormalPointerEXT),
- TABLE_ENTRY(TexCoordPointerEXT),
- TABLE_ENTRY(VertexPointerEXT),
- TABLE_ENTRY(PointParameterfEXT),
- TABLE_ENTRY(PointParameterfvEXT),
- TABLE_ENTRY(LockArraysEXT),
- TABLE_ENTRY(UnlockArraysEXT),
- TABLE_ENTRY(SecondaryColor3bEXT),
- TABLE_ENTRY(SecondaryColor3bvEXT),
- TABLE_ENTRY(SecondaryColor3dEXT),
- TABLE_ENTRY(SecondaryColor3dvEXT),
- TABLE_ENTRY(SecondaryColor3fEXT),
- TABLE_ENTRY(SecondaryColor3fvEXT),
- TABLE_ENTRY(SecondaryColor3iEXT),
- TABLE_ENTRY(SecondaryColor3ivEXT),
- TABLE_ENTRY(SecondaryColor3sEXT),
- TABLE_ENTRY(SecondaryColor3svEXT),
- TABLE_ENTRY(SecondaryColor3ubEXT),
- TABLE_ENTRY(SecondaryColor3ubvEXT),
- TABLE_ENTRY(SecondaryColor3uiEXT),
- TABLE_ENTRY(SecondaryColor3uivEXT),
- TABLE_ENTRY(SecondaryColor3usEXT),
- TABLE_ENTRY(SecondaryColor3usvEXT),
- TABLE_ENTRY(SecondaryColorPointerEXT),
- TABLE_ENTRY(MultiDrawArraysEXT),
- TABLE_ENTRY(MultiDrawElementsEXT),
- TABLE_ENTRY(FogCoordPointerEXT),
- TABLE_ENTRY(FogCoorddEXT),
- TABLE_ENTRY(FogCoorddvEXT),
- TABLE_ENTRY(FogCoordfEXT),
- TABLE_ENTRY(FogCoordfvEXT),
- TABLE_ENTRY(_dispatch_stub_689),
- TABLE_ENTRY(BlendFuncSeparateEXT),
- TABLE_ENTRY(FlushVertexArrayRangeNV),
- TABLE_ENTRY(VertexArrayRangeNV),
- TABLE_ENTRY(CombinerInputNV),
- TABLE_ENTRY(CombinerOutputNV),
- TABLE_ENTRY(CombinerParameterfNV),
- TABLE_ENTRY(CombinerParameterfvNV),
- TABLE_ENTRY(CombinerParameteriNV),
- TABLE_ENTRY(CombinerParameterivNV),
- TABLE_ENTRY(FinalCombinerInputNV),
- TABLE_ENTRY(GetCombinerInputParameterfvNV),
- TABLE_ENTRY(GetCombinerInputParameterivNV),
- TABLE_ENTRY(GetCombinerOutputParameterfvNV),
- TABLE_ENTRY(GetCombinerOutputParameterivNV),
- TABLE_ENTRY(GetFinalCombinerInputParameterfvNV),
- TABLE_ENTRY(GetFinalCombinerInputParameterivNV),
- TABLE_ENTRY(ResizeBuffersMESA),
- TABLE_ENTRY(WindowPos2dMESA),
- TABLE_ENTRY(WindowPos2dvMESA),
- TABLE_ENTRY(WindowPos2fMESA),
- TABLE_ENTRY(WindowPos2fvMESA),
- TABLE_ENTRY(WindowPos2iMESA),
- TABLE_ENTRY(WindowPos2ivMESA),
- TABLE_ENTRY(WindowPos2sMESA),
- TABLE_ENTRY(WindowPos2svMESA),
- TABLE_ENTRY(WindowPos3dMESA),
- TABLE_ENTRY(WindowPos3dvMESA),
- TABLE_ENTRY(WindowPos3fMESA),
- TABLE_ENTRY(WindowPos3fvMESA),
- TABLE_ENTRY(WindowPos3iMESA),
- TABLE_ENTRY(WindowPos3ivMESA),
- TABLE_ENTRY(WindowPos3sMESA),
- TABLE_ENTRY(WindowPos3svMESA),
- TABLE_ENTRY(WindowPos4dMESA),
- TABLE_ENTRY(WindowPos4dvMESA),
- TABLE_ENTRY(WindowPos4fMESA),
- TABLE_ENTRY(WindowPos4fvMESA),
- TABLE_ENTRY(WindowPos4iMESA),
- TABLE_ENTRY(WindowPos4ivMESA),
- TABLE_ENTRY(WindowPos4sMESA),
- TABLE_ENTRY(WindowPos4svMESA),
- TABLE_ENTRY(_dispatch_stub_731),
- TABLE_ENTRY(_dispatch_stub_732),
- TABLE_ENTRY(_dispatch_stub_733),
- TABLE_ENTRY(_dispatch_stub_734),
- TABLE_ENTRY(_dispatch_stub_735),
- TABLE_ENTRY(_dispatch_stub_736),
- TABLE_ENTRY(_dispatch_stub_737),
- TABLE_ENTRY(_dispatch_stub_738),
- TABLE_ENTRY(_dispatch_stub_739),
- TABLE_ENTRY(AreProgramsResidentNV),
- TABLE_ENTRY(BindProgramNV),
- TABLE_ENTRY(DeleteProgramsNV),
- TABLE_ENTRY(ExecuteProgramNV),
- TABLE_ENTRY(GenProgramsNV),
- TABLE_ENTRY(GetProgramParameterdvNV),
- TABLE_ENTRY(GetProgramParameterfvNV),
- TABLE_ENTRY(GetProgramStringNV),
- TABLE_ENTRY(GetProgramivNV),
- TABLE_ENTRY(GetTrackMatrixivNV),
- TABLE_ENTRY(GetVertexAttribPointervNV),
- TABLE_ENTRY(GetVertexAttribdvNV),
- TABLE_ENTRY(GetVertexAttribfvNV),
- TABLE_ENTRY(GetVertexAttribivNV),
- TABLE_ENTRY(IsProgramNV),
- TABLE_ENTRY(LoadProgramNV),
- TABLE_ENTRY(ProgramParameters4dvNV),
- TABLE_ENTRY(ProgramParameters4fvNV),
- TABLE_ENTRY(RequestResidentProgramsNV),
- TABLE_ENTRY(TrackMatrixNV),
- TABLE_ENTRY(VertexAttrib1dNV),
- TABLE_ENTRY(VertexAttrib1dvNV),
- TABLE_ENTRY(VertexAttrib1fNV),
- TABLE_ENTRY(VertexAttrib1fvNV),
- TABLE_ENTRY(VertexAttrib1sNV),
- TABLE_ENTRY(VertexAttrib1svNV),
- TABLE_ENTRY(VertexAttrib2dNV),
- TABLE_ENTRY(VertexAttrib2dvNV),
- TABLE_ENTRY(VertexAttrib2fNV),
- TABLE_ENTRY(VertexAttrib2fvNV),
- TABLE_ENTRY(VertexAttrib2sNV),
- TABLE_ENTRY(VertexAttrib2svNV),
- TABLE_ENTRY(VertexAttrib3dNV),
- TABLE_ENTRY(VertexAttrib3dvNV),
- TABLE_ENTRY(VertexAttrib3fNV),
- TABLE_ENTRY(VertexAttrib3fvNV),
- TABLE_ENTRY(VertexAttrib3sNV),
- TABLE_ENTRY(VertexAttrib3svNV),
- TABLE_ENTRY(VertexAttrib4dNV),
- TABLE_ENTRY(VertexAttrib4dvNV),
- TABLE_ENTRY(VertexAttrib4fNV),
- TABLE_ENTRY(VertexAttrib4fvNV),
- TABLE_ENTRY(VertexAttrib4sNV),
- TABLE_ENTRY(VertexAttrib4svNV),
- TABLE_ENTRY(VertexAttrib4ubNV),
- TABLE_ENTRY(VertexAttrib4ubvNV),
- TABLE_ENTRY(VertexAttribPointerNV),
- TABLE_ENTRY(VertexAttribs1dvNV),
- TABLE_ENTRY(VertexAttribs1fvNV),
- TABLE_ENTRY(VertexAttribs1svNV),
- TABLE_ENTRY(VertexAttribs2dvNV),
- TABLE_ENTRY(VertexAttribs2fvNV),
- TABLE_ENTRY(VertexAttribs2svNV),
- TABLE_ENTRY(VertexAttribs3dvNV),
- TABLE_ENTRY(VertexAttribs3fvNV),
- TABLE_ENTRY(VertexAttribs3svNV),
- TABLE_ENTRY(VertexAttribs4dvNV),
- TABLE_ENTRY(VertexAttribs4fvNV),
- TABLE_ENTRY(VertexAttribs4svNV),
- TABLE_ENTRY(VertexAttribs4ubvNV),
- TABLE_ENTRY(GetTexBumpParameterfvATI),
- TABLE_ENTRY(GetTexBumpParameterivATI),
- TABLE_ENTRY(TexBumpParameterfvATI),
- TABLE_ENTRY(TexBumpParameterivATI),
- TABLE_ENTRY(AlphaFragmentOp1ATI),
- TABLE_ENTRY(AlphaFragmentOp2ATI),
- TABLE_ENTRY(AlphaFragmentOp3ATI),
- TABLE_ENTRY(BeginFragmentShaderATI),
- TABLE_ENTRY(BindFragmentShaderATI),
- TABLE_ENTRY(ColorFragmentOp1ATI),
- TABLE_ENTRY(ColorFragmentOp2ATI),
- TABLE_ENTRY(ColorFragmentOp3ATI),
- TABLE_ENTRY(DeleteFragmentShaderATI),
- TABLE_ENTRY(EndFragmentShaderATI),
- TABLE_ENTRY(GenFragmentShadersATI),
- TABLE_ENTRY(PassTexCoordATI),
- TABLE_ENTRY(SampleMapATI),
- TABLE_ENTRY(SetFragmentShaderConstantATI),
- TABLE_ENTRY(PointParameteriNV),
- TABLE_ENTRY(PointParameterivNV),
- TABLE_ENTRY(_dispatch_stub_820),
- TABLE_ENTRY(_dispatch_stub_821),
- TABLE_ENTRY(_dispatch_stub_822),
- TABLE_ENTRY(_dispatch_stub_823),
- TABLE_ENTRY(_dispatch_stub_824),
- TABLE_ENTRY(GetProgramNamedParameterdvNV),
- TABLE_ENTRY(GetProgramNamedParameterfvNV),
- TABLE_ENTRY(ProgramNamedParameter4dNV),
- TABLE_ENTRY(ProgramNamedParameter4dvNV),
- TABLE_ENTRY(ProgramNamedParameter4fNV),
- TABLE_ENTRY(ProgramNamedParameter4fvNV),
- TABLE_ENTRY(PrimitiveRestartIndexNV),
- TABLE_ENTRY(PrimitiveRestartNV),
- TABLE_ENTRY(_dispatch_stub_833),
- TABLE_ENTRY(_dispatch_stub_834),
- TABLE_ENTRY(BindFramebufferEXT),
- TABLE_ENTRY(BindRenderbufferEXT),
- TABLE_ENTRY(CheckFramebufferStatusEXT),
- TABLE_ENTRY(DeleteFramebuffersEXT),
- TABLE_ENTRY(DeleteRenderbuffersEXT),
- TABLE_ENTRY(FramebufferRenderbufferEXT),
- TABLE_ENTRY(FramebufferTexture1DEXT),
- TABLE_ENTRY(FramebufferTexture2DEXT),
- TABLE_ENTRY(FramebufferTexture3DEXT),
- TABLE_ENTRY(GenFramebuffersEXT),
- TABLE_ENTRY(GenRenderbuffersEXT),
- TABLE_ENTRY(GenerateMipmapEXT),
- TABLE_ENTRY(GetFramebufferAttachmentParameterivEXT),
- TABLE_ENTRY(GetRenderbufferParameterivEXT),
- TABLE_ENTRY(IsFramebufferEXT),
- TABLE_ENTRY(IsRenderbufferEXT),
- TABLE_ENTRY(RenderbufferStorageEXT),
- TABLE_ENTRY(_dispatch_stub_852),
- TABLE_ENTRY(_dispatch_stub_853),
- TABLE_ENTRY(_dispatch_stub_854),
- TABLE_ENTRY(BindFragDataLocationEXT),
- TABLE_ENTRY(GetFragDataLocationEXT),
- TABLE_ENTRY(GetUniformuivEXT),
- TABLE_ENTRY(GetVertexAttribIivEXT),
- TABLE_ENTRY(GetVertexAttribIuivEXT),
- TABLE_ENTRY(Uniform1uiEXT),
- TABLE_ENTRY(Uniform1uivEXT),
- TABLE_ENTRY(Uniform2uiEXT),
- TABLE_ENTRY(Uniform2uivEXT),
- TABLE_ENTRY(Uniform3uiEXT),
- TABLE_ENTRY(Uniform3uivEXT),
- TABLE_ENTRY(Uniform4uiEXT),
- TABLE_ENTRY(Uniform4uivEXT),
- TABLE_ENTRY(VertexAttribI1iEXT),
- TABLE_ENTRY(VertexAttribI1ivEXT),
- TABLE_ENTRY(VertexAttribI1uiEXT),
- TABLE_ENTRY(VertexAttribI1uivEXT),
- TABLE_ENTRY(VertexAttribI2iEXT),
- TABLE_ENTRY(VertexAttribI2ivEXT),
- TABLE_ENTRY(VertexAttribI2uiEXT),
- TABLE_ENTRY(VertexAttribI2uivEXT),
- TABLE_ENTRY(VertexAttribI3iEXT),
- TABLE_ENTRY(VertexAttribI3ivEXT),
- TABLE_ENTRY(VertexAttribI3uiEXT),
- TABLE_ENTRY(VertexAttribI3uivEXT),
- TABLE_ENTRY(VertexAttribI4bvEXT),
- TABLE_ENTRY(VertexAttribI4iEXT),
- TABLE_ENTRY(VertexAttribI4ivEXT),
- TABLE_ENTRY(VertexAttribI4svEXT),
- TABLE_ENTRY(VertexAttribI4ubvEXT),
- TABLE_ENTRY(VertexAttribI4uiEXT),
- TABLE_ENTRY(VertexAttribI4uivEXT),
- TABLE_ENTRY(VertexAttribI4usvEXT),
- TABLE_ENTRY(VertexAttribIPointerEXT),
- TABLE_ENTRY(FramebufferTextureLayerEXT),
- TABLE_ENTRY(ColorMaskIndexedEXT),
- TABLE_ENTRY(DisableIndexedEXT),
- TABLE_ENTRY(EnableIndexedEXT),
- TABLE_ENTRY(GetBooleanIndexedvEXT),
- TABLE_ENTRY(GetIntegerIndexedvEXT),
- TABLE_ENTRY(IsEnabledIndexedEXT),
- TABLE_ENTRY(ClearColorIiEXT),
- TABLE_ENTRY(ClearColorIuiEXT),
- TABLE_ENTRY(GetTexParameterIivEXT),
- TABLE_ENTRY(GetTexParameterIuivEXT),
- TABLE_ENTRY(TexParameterIivEXT),
- TABLE_ENTRY(TexParameterIuivEXT),
- TABLE_ENTRY(BeginConditionalRenderNV),
- TABLE_ENTRY(EndConditionalRenderNV),
- TABLE_ENTRY(BeginTransformFeedbackEXT),
- TABLE_ENTRY(BindBufferBaseEXT),
- TABLE_ENTRY(BindBufferOffsetEXT),
- TABLE_ENTRY(BindBufferRangeEXT),
- TABLE_ENTRY(EndTransformFeedbackEXT),
- TABLE_ENTRY(GetTransformFeedbackVaryingEXT),
- TABLE_ENTRY(TransformFeedbackVaryingsEXT),
- TABLE_ENTRY(ProvokingVertexEXT),
- TABLE_ENTRY(_dispatch_stub_912),
- TABLE_ENTRY(_dispatch_stub_913),
- TABLE_ENTRY(GetObjectParameterivAPPLE),
- TABLE_ENTRY(ObjectPurgeableAPPLE),
- TABLE_ENTRY(ObjectUnpurgeableAPPLE),
- TABLE_ENTRY(ActiveProgramEXT),
- TABLE_ENTRY(CreateShaderProgramEXT),
- TABLE_ENTRY(UseShaderProgramEXT),
- TABLE_ENTRY(TextureBarrierNV),
- TABLE_ENTRY(_dispatch_stub_921),
- TABLE_ENTRY(_dispatch_stub_922),
- TABLE_ENTRY(_dispatch_stub_923),
- TABLE_ENTRY(_dispatch_stub_924),
- TABLE_ENTRY(_dispatch_stub_925),
- TABLE_ENTRY(EGLImageTargetRenderbufferStorageOES),
- TABLE_ENTRY(EGLImageTargetTexture2DOES),
- /* A whole bunch of no-op functions. These might be called
- * when someone tries to call a dynamically-registered
- * extension function without a current rendering context.
- */
- TABLE_ENTRY(Unused),
- TABLE_ENTRY(Unused),
- TABLE_ENTRY(Unused),
- TABLE_ENTRY(Unused),
- TABLE_ENTRY(Unused),
- TABLE_ENTRY(Unused),
- TABLE_ENTRY(Unused),
- TABLE_ENTRY(Unused),
- TABLE_ENTRY(Unused),
- TABLE_ENTRY(Unused),
- TABLE_ENTRY(Unused),
- TABLE_ENTRY(Unused),
- TABLE_ENTRY(Unused),
- TABLE_ENTRY(Unused),
- TABLE_ENTRY(Unused),
- TABLE_ENTRY(Unused),
- TABLE_ENTRY(Unused),
- TABLE_ENTRY(Unused),
- TABLE_ENTRY(Unused),
- TABLE_ENTRY(Unused),
- TABLE_ENTRY(Unused),
- TABLE_ENTRY(Unused),
- TABLE_ENTRY(Unused),
- TABLE_ENTRY(Unused),
- TABLE_ENTRY(Unused),
- TABLE_ENTRY(Unused),
- TABLE_ENTRY(Unused),
- TABLE_ENTRY(Unused),
- TABLE_ENTRY(Unused),
- TABLE_ENTRY(Unused),
- TABLE_ENTRY(Unused),
- TABLE_ENTRY(Unused),
- TABLE_ENTRY(Unused),
- TABLE_ENTRY(Unused),
- TABLE_ENTRY(Unused),
- TABLE_ENTRY(Unused),
- TABLE_ENTRY(Unused),
- TABLE_ENTRY(Unused),
- TABLE_ENTRY(Unused),
- TABLE_ENTRY(Unused),
- TABLE_ENTRY(Unused),
- TABLE_ENTRY(Unused),
- TABLE_ENTRY(Unused),
- TABLE_ENTRY(Unused),
- TABLE_ENTRY(Unused),
- TABLE_ENTRY(Unused),
- TABLE_ENTRY(Unused),
- TABLE_ENTRY(Unused),
- TABLE_ENTRY(Unused),
- TABLE_ENTRY(Unused),
- TABLE_ENTRY(Unused),
- TABLE_ENTRY(Unused),
- TABLE_ENTRY(Unused),
- TABLE_ENTRY(Unused),
- TABLE_ENTRY(Unused),
- TABLE_ENTRY(Unused),
- TABLE_ENTRY(Unused),
- TABLE_ENTRY(Unused),
- TABLE_ENTRY(Unused),
- TABLE_ENTRY(Unused),
- TABLE_ENTRY(Unused),
- TABLE_ENTRY(Unused),
- TABLE_ENTRY(Unused),
- TABLE_ENTRY(Unused),
- TABLE_ENTRY(Unused),
- TABLE_ENTRY(Unused),
- TABLE_ENTRY(Unused),
- TABLE_ENTRY(Unused),
- TABLE_ENTRY(Unused),
- TABLE_ENTRY(Unused),
- TABLE_ENTRY(Unused),
- TABLE_ENTRY(Unused),
- TABLE_ENTRY(Unused),
- TABLE_ENTRY(Unused),
- TABLE_ENTRY(Unused),
- TABLE_ENTRY(Unused),
- TABLE_ENTRY(Unused),
- TABLE_ENTRY(Unused),
- TABLE_ENTRY(Unused),
- TABLE_ENTRY(Unused),
- TABLE_ENTRY(Unused),
- TABLE_ENTRY(Unused),
- TABLE_ENTRY(Unused),
- TABLE_ENTRY(Unused),
- TABLE_ENTRY(Unused),
- TABLE_ENTRY(Unused),
- TABLE_ENTRY(Unused),
- TABLE_ENTRY(Unused),
- TABLE_ENTRY(Unused),
- TABLE_ENTRY(Unused),
- TABLE_ENTRY(Unused),
- TABLE_ENTRY(Unused),
- TABLE_ENTRY(Unused),
- TABLE_ENTRY(Unused),
- TABLE_ENTRY(Unused),
- TABLE_ENTRY(Unused),
- TABLE_ENTRY(Unused),
- TABLE_ENTRY(Unused),
- TABLE_ENTRY(Unused),
-};
-#endif /* DISPATCH_TABLE_NAME */
-
-
-/*
- * This is just used to silence compiler warnings.
- * We list the functions which are not otherwise used.
- */
-#ifdef UNUSED_TABLE_NAME
-_glapi_proc UNUSED_TABLE_NAME[] = {
-#ifndef _GLAPI_SKIP_NORMAL_ENTRY_POINTS
- TABLE_ENTRY(ArrayElementEXT),
- TABLE_ENTRY(BindTextureEXT),
- TABLE_ENTRY(DrawArraysEXT),
- TABLE_ENTRY(CopyTexImage1DEXT),
- TABLE_ENTRY(CopyTexImage2DEXT),
- TABLE_ENTRY(CopyTexSubImage1DEXT),
- TABLE_ENTRY(CopyTexSubImage2DEXT),
- TABLE_ENTRY(GetPointervEXT),
- TABLE_ENTRY(PrioritizeTexturesEXT),
- TABLE_ENTRY(TexSubImage1DEXT),
- TABLE_ENTRY(TexSubImage2DEXT),
- TABLE_ENTRY(BlendColorEXT),
- TABLE_ENTRY(BlendEquationEXT),
- TABLE_ENTRY(DrawRangeElementsEXT),
- TABLE_ENTRY(ColorTableEXT),
- TABLE_ENTRY(_dispatch_stub_339),
- TABLE_ENTRY(_dispatch_stub_340),
- TABLE_ENTRY(_dispatch_stub_341),
- TABLE_ENTRY(_dispatch_stub_342),
- TABLE_ENTRY(_dispatch_stub_346),
- TABLE_ENTRY(_dispatch_stub_347),
- TABLE_ENTRY(_dispatch_stub_348),
- TABLE_ENTRY(_dispatch_stub_349),
- TABLE_ENTRY(_dispatch_stub_350),
- TABLE_ENTRY(_dispatch_stub_351),
- TABLE_ENTRY(_dispatch_stub_352),
- TABLE_ENTRY(_dispatch_stub_353),
- TABLE_ENTRY(_dispatch_stub_354),
- TABLE_ENTRY(_dispatch_stub_355),
- TABLE_ENTRY(_dispatch_stub_360),
- TABLE_ENTRY(_dispatch_stub_367),
- TABLE_ENTRY(_dispatch_stub_368),
- TABLE_ENTRY(_dispatch_stub_369),
- TABLE_ENTRY(_dispatch_stub_370),
- TABLE_ENTRY(TexImage3DEXT),
- TABLE_ENTRY(TexSubImage3DEXT),
- TABLE_ENTRY(CopyTexSubImage3DEXT),
- TABLE_ENTRY(ActiveTexture),
- TABLE_ENTRY(ClientActiveTexture),
- TABLE_ENTRY(MultiTexCoord1d),
- TABLE_ENTRY(MultiTexCoord1dv),
- TABLE_ENTRY(MultiTexCoord1f),
- TABLE_ENTRY(MultiTexCoord1fv),
- TABLE_ENTRY(MultiTexCoord1i),
- TABLE_ENTRY(MultiTexCoord1iv),
- TABLE_ENTRY(MultiTexCoord1s),
- TABLE_ENTRY(MultiTexCoord1sv),
- TABLE_ENTRY(MultiTexCoord2d),
- TABLE_ENTRY(MultiTexCoord2dv),
- TABLE_ENTRY(MultiTexCoord2f),
- TABLE_ENTRY(MultiTexCoord2fv),
- TABLE_ENTRY(MultiTexCoord2i),
- TABLE_ENTRY(MultiTexCoord2iv),
- TABLE_ENTRY(MultiTexCoord2s),
- TABLE_ENTRY(MultiTexCoord2sv),
- TABLE_ENTRY(MultiTexCoord3d),
- TABLE_ENTRY(MultiTexCoord3dv),
- TABLE_ENTRY(MultiTexCoord3f),
- TABLE_ENTRY(MultiTexCoord3fv),
- TABLE_ENTRY(MultiTexCoord3i),
- TABLE_ENTRY(MultiTexCoord3iv),
- TABLE_ENTRY(MultiTexCoord3s),
- TABLE_ENTRY(MultiTexCoord3sv),
- TABLE_ENTRY(MultiTexCoord4d),
- TABLE_ENTRY(MultiTexCoord4dv),
- TABLE_ENTRY(MultiTexCoord4f),
- TABLE_ENTRY(MultiTexCoord4fv),
- TABLE_ENTRY(MultiTexCoord4i),
- TABLE_ENTRY(MultiTexCoord4iv),
- TABLE_ENTRY(MultiTexCoord4s),
- TABLE_ENTRY(MultiTexCoord4sv),
- TABLE_ENTRY(_dispatch_stub_423),
- TABLE_ENTRY(LoadTransposeMatrixd),
- TABLE_ENTRY(LoadTransposeMatrixf),
- TABLE_ENTRY(MultTransposeMatrixd),
- TABLE_ENTRY(MultTransposeMatrixf),
- TABLE_ENTRY(SampleCoverage),
- TABLE_ENTRY(CompressedTexImage1D),
- TABLE_ENTRY(CompressedTexImage2D),
- TABLE_ENTRY(CompressedTexImage3D),
- TABLE_ENTRY(CompressedTexSubImage1D),
- TABLE_ENTRY(CompressedTexSubImage2D),
- TABLE_ENTRY(CompressedTexSubImage3D),
- TABLE_ENTRY(GetCompressedTexImage),
- TABLE_ENTRY(DisableVertexAttribArray),
- TABLE_ENTRY(EnableVertexAttribArray),
- TABLE_ENTRY(GetVertexAttribdv),
- TABLE_ENTRY(GetVertexAttribfv),
- TABLE_ENTRY(GetVertexAttribiv),
- TABLE_ENTRY(ProgramParameter4dNV),
- TABLE_ENTRY(ProgramParameter4dvNV),
- TABLE_ENTRY(ProgramParameter4fNV),
- TABLE_ENTRY(ProgramParameter4fvNV),
- TABLE_ENTRY(VertexAttrib1d),
- TABLE_ENTRY(VertexAttrib1dv),
- TABLE_ENTRY(VertexAttrib1f),
- TABLE_ENTRY(VertexAttrib1fv),
- TABLE_ENTRY(VertexAttrib1s),
- TABLE_ENTRY(VertexAttrib1sv),
- TABLE_ENTRY(VertexAttrib2d),
- TABLE_ENTRY(VertexAttrib2dv),
- TABLE_ENTRY(VertexAttrib2f),
- TABLE_ENTRY(VertexAttrib2fv),
- TABLE_ENTRY(VertexAttrib2s),
- TABLE_ENTRY(VertexAttrib2sv),
- TABLE_ENTRY(VertexAttrib3d),
- TABLE_ENTRY(VertexAttrib3dv),
- TABLE_ENTRY(VertexAttrib3f),
- TABLE_ENTRY(VertexAttrib3fv),
- TABLE_ENTRY(VertexAttrib3s),
- TABLE_ENTRY(VertexAttrib3sv),
- TABLE_ENTRY(VertexAttrib4Nbv),
- TABLE_ENTRY(VertexAttrib4Niv),
- TABLE_ENTRY(VertexAttrib4Nsv),
- TABLE_ENTRY(VertexAttrib4Nub),
- TABLE_ENTRY(VertexAttrib4Nubv),
- TABLE_ENTRY(VertexAttrib4Nuiv),
- TABLE_ENTRY(VertexAttrib4Nusv),
- TABLE_ENTRY(VertexAttrib4bv),
- TABLE_ENTRY(VertexAttrib4d),
- TABLE_ENTRY(VertexAttrib4dv),
- TABLE_ENTRY(VertexAttrib4f),
- TABLE_ENTRY(VertexAttrib4fv),
- TABLE_ENTRY(VertexAttrib4iv),
- TABLE_ENTRY(VertexAttrib4s),
- TABLE_ENTRY(VertexAttrib4sv),
- TABLE_ENTRY(VertexAttrib4ubv),
- TABLE_ENTRY(VertexAttrib4uiv),
- TABLE_ENTRY(VertexAttrib4usv),
- TABLE_ENTRY(VertexAttribPointer),
- TABLE_ENTRY(BindBuffer),
- TABLE_ENTRY(BufferData),
- TABLE_ENTRY(BufferSubData),
- TABLE_ENTRY(DeleteBuffers),
- TABLE_ENTRY(GenBuffers),
- TABLE_ENTRY(GetBufferParameteriv),
- TABLE_ENTRY(GetBufferPointerv),
- TABLE_ENTRY(GetBufferSubData),
- TABLE_ENTRY(IsBuffer),
- TABLE_ENTRY(MapBuffer),
- TABLE_ENTRY(UnmapBuffer),
- TABLE_ENTRY(BeginQuery),
- TABLE_ENTRY(DeleteQueries),
- TABLE_ENTRY(EndQuery),
- TABLE_ENTRY(GenQueries),
- TABLE_ENTRY(GetQueryObjectiv),
- TABLE_ENTRY(GetQueryObjectuiv),
- TABLE_ENTRY(GetQueryiv),
- TABLE_ENTRY(IsQuery),
- TABLE_ENTRY(CompileShader),
- TABLE_ENTRY(GetActiveUniform),
- TABLE_ENTRY(GetShaderSource),
- TABLE_ENTRY(GetUniformLocation),
- TABLE_ENTRY(GetUniformfv),
- TABLE_ENTRY(GetUniformiv),
- TABLE_ENTRY(LinkProgram),
- TABLE_ENTRY(ShaderSource),
- TABLE_ENTRY(Uniform1f),
- TABLE_ENTRY(Uniform1fv),
- TABLE_ENTRY(Uniform1i),
- TABLE_ENTRY(Uniform1iv),
- TABLE_ENTRY(Uniform2f),
- TABLE_ENTRY(Uniform2fv),
- TABLE_ENTRY(Uniform2i),
- TABLE_ENTRY(Uniform2iv),
- TABLE_ENTRY(Uniform3f),
- TABLE_ENTRY(Uniform3fv),
- TABLE_ENTRY(Uniform3i),
- TABLE_ENTRY(Uniform3iv),
- TABLE_ENTRY(Uniform4f),
- TABLE_ENTRY(Uniform4fv),
- TABLE_ENTRY(Uniform4i),
- TABLE_ENTRY(Uniform4iv),
- TABLE_ENTRY(UniformMatrix2fv),
- TABLE_ENTRY(UniformMatrix3fv),
- TABLE_ENTRY(UniformMatrix4fv),
- TABLE_ENTRY(UseProgram),
- TABLE_ENTRY(ValidateProgram),
- TABLE_ENTRY(BindAttribLocation),
- TABLE_ENTRY(GetActiveAttrib),
- TABLE_ENTRY(GetAttribLocation),
- TABLE_ENTRY(DrawBuffers),
- TABLE_ENTRY(DrawBuffersATI),
- TABLE_ENTRY(DrawArraysInstancedEXT),
- TABLE_ENTRY(DrawArraysInstanced),
- TABLE_ENTRY(DrawElementsInstancedEXT),
- TABLE_ENTRY(DrawElementsInstanced),
- TABLE_ENTRY(RenderbufferStorageMultisampleEXT),
- TABLE_ENTRY(BlendEquationSeparateIndexedAMD),
- TABLE_ENTRY(BlendEquationIndexedAMD),
- TABLE_ENTRY(BlendFuncSeparateIndexedAMD),
- TABLE_ENTRY(BlendFuncIndexedAMD),
- TABLE_ENTRY(PointParameterf),
- TABLE_ENTRY(PointParameterfARB),
- TABLE_ENTRY(_dispatch_stub_661),
- TABLE_ENTRY(PointParameterfv),
- TABLE_ENTRY(PointParameterfvARB),
- TABLE_ENTRY(_dispatch_stub_662),
- TABLE_ENTRY(SecondaryColor3b),
- TABLE_ENTRY(SecondaryColor3bv),
- TABLE_ENTRY(SecondaryColor3d),
- TABLE_ENTRY(SecondaryColor3dv),
- TABLE_ENTRY(SecondaryColor3f),
- TABLE_ENTRY(SecondaryColor3fv),
- TABLE_ENTRY(SecondaryColor3i),
- TABLE_ENTRY(SecondaryColor3iv),
- TABLE_ENTRY(SecondaryColor3s),
- TABLE_ENTRY(SecondaryColor3sv),
- TABLE_ENTRY(SecondaryColor3ub),
- TABLE_ENTRY(SecondaryColor3ubv),
- TABLE_ENTRY(SecondaryColor3ui),
- TABLE_ENTRY(SecondaryColor3uiv),
- TABLE_ENTRY(SecondaryColor3us),
- TABLE_ENTRY(SecondaryColor3usv),
- TABLE_ENTRY(SecondaryColorPointer),
- TABLE_ENTRY(MultiDrawArrays),
- TABLE_ENTRY(MultiDrawElements),
- TABLE_ENTRY(FogCoordPointer),
- TABLE_ENTRY(FogCoordd),
- TABLE_ENTRY(FogCoorddv),
- TABLE_ENTRY(FogCoordf),
- TABLE_ENTRY(FogCoordfv),
- TABLE_ENTRY(BlendFuncSeparate),
- TABLE_ENTRY(_dispatch_stub_690),
- TABLE_ENTRY(WindowPos2d),
- TABLE_ENTRY(WindowPos2dARB),
- TABLE_ENTRY(WindowPos2dv),
- TABLE_ENTRY(WindowPos2dvARB),
- TABLE_ENTRY(WindowPos2f),
- TABLE_ENTRY(WindowPos2fARB),
- TABLE_ENTRY(WindowPos2fv),
- TABLE_ENTRY(WindowPos2fvARB),
- TABLE_ENTRY(WindowPos2i),
- TABLE_ENTRY(WindowPos2iARB),
- TABLE_ENTRY(WindowPos2iv),
- TABLE_ENTRY(WindowPos2ivARB),
- TABLE_ENTRY(WindowPos2s),
- TABLE_ENTRY(WindowPos2sARB),
- TABLE_ENTRY(WindowPos2sv),
- TABLE_ENTRY(WindowPos2svARB),
- TABLE_ENTRY(WindowPos3d),
- TABLE_ENTRY(WindowPos3dARB),
- TABLE_ENTRY(WindowPos3dv),
- TABLE_ENTRY(WindowPos3dvARB),
- TABLE_ENTRY(WindowPos3f),
- TABLE_ENTRY(WindowPos3fARB),
- TABLE_ENTRY(WindowPos3fv),
- TABLE_ENTRY(WindowPos3fvARB),
- TABLE_ENTRY(WindowPos3i),
- TABLE_ENTRY(WindowPos3iARB),
- TABLE_ENTRY(WindowPos3iv),
- TABLE_ENTRY(WindowPos3ivARB),
- TABLE_ENTRY(WindowPos3s),
- TABLE_ENTRY(WindowPos3sARB),
- TABLE_ENTRY(WindowPos3sv),
- TABLE_ENTRY(WindowPos3svARB),
- TABLE_ENTRY(BindProgramARB),
- TABLE_ENTRY(DeleteProgramsARB),
- TABLE_ENTRY(GenProgramsARB),
- TABLE_ENTRY(GetVertexAttribPointerv),
- TABLE_ENTRY(GetVertexAttribPointervARB),
- TABLE_ENTRY(IsProgramARB),
- TABLE_ENTRY(PointParameteri),
- TABLE_ENTRY(PointParameteriv),
- TABLE_ENTRY(DeleteVertexArrays),
- TABLE_ENTRY(IsVertexArray),
- TABLE_ENTRY(PrimitiveRestartIndex),
- TABLE_ENTRY(BlendEquationSeparate),
- TABLE_ENTRY(BindFramebuffer),
- TABLE_ENTRY(BindRenderbuffer),
- TABLE_ENTRY(CheckFramebufferStatus),
- TABLE_ENTRY(DeleteFramebuffers),
- TABLE_ENTRY(DeleteRenderbuffers),
- TABLE_ENTRY(FramebufferRenderbuffer),
- TABLE_ENTRY(FramebufferTexture1D),
- TABLE_ENTRY(FramebufferTexture2D),
- TABLE_ENTRY(FramebufferTexture3D),
- TABLE_ENTRY(GenFramebuffers),
- TABLE_ENTRY(GenRenderbuffers),
- TABLE_ENTRY(GenerateMipmap),
- TABLE_ENTRY(GetFramebufferAttachmentParameteriv),
- TABLE_ENTRY(GetRenderbufferParameteriv),
- TABLE_ENTRY(IsFramebuffer),
- TABLE_ENTRY(IsRenderbuffer),
- TABLE_ENTRY(RenderbufferStorage),
- TABLE_ENTRY(BlitFramebuffer),
- TABLE_ENTRY(BindFragDataLocation),
- TABLE_ENTRY(GetFragDataLocation),
- TABLE_ENTRY(GetUniformuiv),
- TABLE_ENTRY(GetVertexAttribIiv),
- TABLE_ENTRY(GetVertexAttribIuiv),
- TABLE_ENTRY(Uniform1ui),
- TABLE_ENTRY(Uniform1uiv),
- TABLE_ENTRY(Uniform2ui),
- TABLE_ENTRY(Uniform2uiv),
- TABLE_ENTRY(Uniform3ui),
- TABLE_ENTRY(Uniform3uiv),
- TABLE_ENTRY(Uniform4ui),
- TABLE_ENTRY(Uniform4uiv),
- TABLE_ENTRY(VertexAttribI1i),
- TABLE_ENTRY(VertexAttribI1iv),
- TABLE_ENTRY(VertexAttribI1ui),
- TABLE_ENTRY(VertexAttribI1uiv),
- TABLE_ENTRY(VertexAttribI2i),
- TABLE_ENTRY(VertexAttribI2iv),
- TABLE_ENTRY(VertexAttribI2ui),
- TABLE_ENTRY(VertexAttribI2uiv),
- TABLE_ENTRY(VertexAttribI3i),
- TABLE_ENTRY(VertexAttribI3iv),
- TABLE_ENTRY(VertexAttribI3ui),
- TABLE_ENTRY(VertexAttribI3uiv),
- TABLE_ENTRY(VertexAttribI4bv),
- TABLE_ENTRY(VertexAttribI4i),
- TABLE_ENTRY(VertexAttribI4iv),
- TABLE_ENTRY(VertexAttribI4sv),
- TABLE_ENTRY(VertexAttribI4ubv),
- TABLE_ENTRY(VertexAttribI4ui),
- TABLE_ENTRY(VertexAttribI4uiv),
- TABLE_ENTRY(VertexAttribI4usv),
- TABLE_ENTRY(VertexAttribIPointer),
- TABLE_ENTRY(FramebufferTextureLayer),
- TABLE_ENTRY(ColorMaski),
- TABLE_ENTRY(Disablei),
- TABLE_ENTRY(Enablei),
- TABLE_ENTRY(GetBooleani_v),
- TABLE_ENTRY(GetIntegeri_v),
- TABLE_ENTRY(IsEnabledi),
- TABLE_ENTRY(GetTexParameterIiv),
- TABLE_ENTRY(GetTexParameterIuiv),
- TABLE_ENTRY(TexParameterIiv),
- TABLE_ENTRY(TexParameterIuiv),
- TABLE_ENTRY(BeginConditionalRender),
- TABLE_ENTRY(EndConditionalRender),
- TABLE_ENTRY(BeginTransformFeedback),
- TABLE_ENTRY(BindBufferBase),
- TABLE_ENTRY(BindBufferRange),
- TABLE_ENTRY(EndTransformFeedback),
- TABLE_ENTRY(GetTransformFeedbackVarying),
- TABLE_ENTRY(TransformFeedbackVaryings),
- TABLE_ENTRY(ProvokingVertex),
-#endif /* _GLAPI_SKIP_NORMAL_ENTRY_POINTS */
-#ifndef _GLAPI_SKIP_PROTO_ENTRY_POINTS
- TABLE_ENTRY(AreTexturesResidentEXT),
- TABLE_ENTRY(DeleteTexturesEXT),
- TABLE_ENTRY(GenTexturesEXT),
- TABLE_ENTRY(IsTextureEXT),
- TABLE_ENTRY(GetColorTableEXT),
- TABLE_ENTRY(_dispatch_stub_343),
- TABLE_ENTRY(GetColorTableParameterfvEXT),
- TABLE_ENTRY(_dispatch_stub_344),
- TABLE_ENTRY(GetColorTableParameterivEXT),
- TABLE_ENTRY(_dispatch_stub_345),
- TABLE_ENTRY(_dispatch_stub_356),
- TABLE_ENTRY(_dispatch_stub_357),
- TABLE_ENTRY(_dispatch_stub_358),
- TABLE_ENTRY(_dispatch_stub_359),
- TABLE_ENTRY(_dispatch_stub_361),
- TABLE_ENTRY(_dispatch_stub_362),
- TABLE_ENTRY(_dispatch_stub_363),
- TABLE_ENTRY(_dispatch_stub_364),
- TABLE_ENTRY(_dispatch_stub_365),
- TABLE_ENTRY(_dispatch_stub_366),
-#endif /* _GLAPI_SKIP_PROTO_ENTRY_POINTS */
-};
-#endif /*UNUSED_TABLE_NAME*/
-
-
-# undef KEYWORD1
-# undef KEYWORD1_ALT
-# undef KEYWORD2
-# undef NAME
-# undef DISPATCH
-# undef RETURN_DISPATCH
-# undef DISPATCH_TABLE_NAME
-# undef UNUSED_TABLE_NAME
-# undef TABLE_ENTRY
-# undef HIDDEN
+/* DO NOT EDIT - This file generated automatically by gl_apitemp.py (from Mesa) script */
+
+/*
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
+ * (C) Copyright IBM Corporation 2004
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sub license,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL, IBM,
+ * AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
+ * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+
+# if (defined(__GNUC__) && !defined(__CYGWIN__) && !defined(__MINGW32__)) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590) && defined(__ELF__))
+# define HIDDEN __attribute__((visibility("hidden")))
+# else
+# define HIDDEN
+# endif
+
+/*
+ * This file is a template which generates the OpenGL API entry point
+ * functions. It should be included by a .c file which first defines
+ * the following macros:
+ * KEYWORD1 - usually nothing, but might be __declspec(dllexport) on Win32
+ * KEYWORD2 - usually nothing, but might be __stdcall on Win32
+ * NAME(n) - builds the final function name (usually add "gl" prefix)
+ * DISPATCH(func, args, msg) - code to do dispatch of named function.
+ * msg is a printf-style debug message.
+ * RETURN_DISPATCH(func, args, msg) - code to do dispatch with a return value
+ *
+ * Here is an example which generates the usual OpenGL functions:
+ * #define KEYWORD1
+ * #define KEYWORD2
+ * #define NAME(func) gl##func
+ * #define DISPATCH(func, args, msg) \
+ * struct _glapi_table *dispatch = CurrentDispatch; \
+ * (*dispatch->func) args
+ * #define RETURN DISPATCH(func, args, msg) \
+ * struct _glapi_table *dispatch = CurrentDispatch; \
+ * return (*dispatch->func) args
+ *
+ */
+
+
+#if defined( NAME )
+#ifndef KEYWORD1
+#define KEYWORD1
+#endif
+
+#ifndef KEYWORD1_ALT
+#define KEYWORD1_ALT HIDDEN
+#endif
+
+#ifndef KEYWORD2
+#define KEYWORD2
+#endif
+
+#ifndef DISPATCH
+#error DISPATCH must be defined
+#endif
+
+#ifndef RETURN_DISPATCH
+#error RETURN_DISPATCH must be defined
+#endif
+
+
+#ifndef _GLAPI_SKIP_NORMAL_ENTRY_POINTS
+
+KEYWORD1 void KEYWORD2 NAME(NewList)(GLuint list, GLenum mode)
+{
+ DISPATCH(NewList, (list, mode), (F, "glNewList(%d, 0x%x);\n", list, mode));
+}
+
+KEYWORD1 void KEYWORD2 NAME(EndList)(void)
+{
+ DISPATCH(EndList, (), (F, "glEndList();\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(CallList)(GLuint list)
+{
+ DISPATCH(CallList, (list), (F, "glCallList(%d);\n", list));
+}
+
+KEYWORD1 void KEYWORD2 NAME(CallLists)(GLsizei n, GLenum type, const GLvoid * lists)
+{
+ DISPATCH(CallLists, (n, type, lists), (F, "glCallLists(%d, 0x%x, %p);\n", n, type, (const void *) lists));
+}
+
+KEYWORD1 void KEYWORD2 NAME(DeleteLists)(GLuint list, GLsizei range)
+{
+ DISPATCH(DeleteLists, (list, range), (F, "glDeleteLists(%d, %d);\n", list, range));
+}
+
+KEYWORD1 GLuint KEYWORD2 NAME(GenLists)(GLsizei range)
+{
+ RETURN_DISPATCH(GenLists, (range), (F, "glGenLists(%d);\n", range));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ListBase)(GLuint base)
+{
+ DISPATCH(ListBase, (base), (F, "glListBase(%d);\n", base));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Begin)(GLenum mode)
+{
+ DISPATCH(Begin, (mode), (F, "glBegin(0x%x);\n", mode));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Bitmap)(GLsizei width, GLsizei height, GLfloat xorig, GLfloat yorig, GLfloat xmove, GLfloat ymove, const GLubyte * bitmap)
+{
+ DISPATCH(Bitmap, (width, height, xorig, yorig, xmove, ymove, bitmap), (F, "glBitmap(%d, %d, %f, %f, %f, %f, %p);\n", width, height, xorig, yorig, xmove, ymove, (const void *) bitmap));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Color3b)(GLbyte red, GLbyte green, GLbyte blue)
+{
+ DISPATCH(Color3b, (red, green, blue), (F, "glColor3b(%d, %d, %d);\n", red, green, blue));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Color3bv)(const GLbyte * v)
+{
+ DISPATCH(Color3bv, (v), (F, "glColor3bv(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Color3d)(GLdouble red, GLdouble green, GLdouble blue)
+{
+ DISPATCH(Color3d, (red, green, blue), (F, "glColor3d(%f, %f, %f);\n", red, green, blue));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Color3dv)(const GLdouble * v)
+{
+ DISPATCH(Color3dv, (v), (F, "glColor3dv(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Color3f)(GLfloat red, GLfloat green, GLfloat blue)
+{
+ DISPATCH(Color3f, (red, green, blue), (F, "glColor3f(%f, %f, %f);\n", red, green, blue));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Color3fv)(const GLfloat * v)
+{
+ DISPATCH(Color3fv, (v), (F, "glColor3fv(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Color3i)(GLint red, GLint green, GLint blue)
+{
+ DISPATCH(Color3i, (red, green, blue), (F, "glColor3i(%d, %d, %d);\n", red, green, blue));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Color3iv)(const GLint * v)
+{
+ DISPATCH(Color3iv, (v), (F, "glColor3iv(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Color3s)(GLshort red, GLshort green, GLshort blue)
+{
+ DISPATCH(Color3s, (red, green, blue), (F, "glColor3s(%d, %d, %d);\n", red, green, blue));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Color3sv)(const GLshort * v)
+{
+ DISPATCH(Color3sv, (v), (F, "glColor3sv(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Color3ub)(GLubyte red, GLubyte green, GLubyte blue)
+{
+ DISPATCH(Color3ub, (red, green, blue), (F, "glColor3ub(%d, %d, %d);\n", red, green, blue));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Color3ubv)(const GLubyte * v)
+{
+ DISPATCH(Color3ubv, (v), (F, "glColor3ubv(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Color3ui)(GLuint red, GLuint green, GLuint blue)
+{
+ DISPATCH(Color3ui, (red, green, blue), (F, "glColor3ui(%d, %d, %d);\n", red, green, blue));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Color3uiv)(const GLuint * v)
+{
+ DISPATCH(Color3uiv, (v), (F, "glColor3uiv(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Color3us)(GLushort red, GLushort green, GLushort blue)
+{
+ DISPATCH(Color3us, (red, green, blue), (F, "glColor3us(%d, %d, %d);\n", red, green, blue));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Color3usv)(const GLushort * v)
+{
+ DISPATCH(Color3usv, (v), (F, "glColor3usv(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Color4b)(GLbyte red, GLbyte green, GLbyte blue, GLbyte alpha)
+{
+ DISPATCH(Color4b, (red, green, blue, alpha), (F, "glColor4b(%d, %d, %d, %d);\n", red, green, blue, alpha));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Color4bv)(const GLbyte * v)
+{
+ DISPATCH(Color4bv, (v), (F, "glColor4bv(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Color4d)(GLdouble red, GLdouble green, GLdouble blue, GLdouble alpha)
+{
+ DISPATCH(Color4d, (red, green, blue, alpha), (F, "glColor4d(%f, %f, %f, %f);\n", red, green, blue, alpha));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Color4dv)(const GLdouble * v)
+{
+ DISPATCH(Color4dv, (v), (F, "glColor4dv(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Color4f)(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha)
+{
+ DISPATCH(Color4f, (red, green, blue, alpha), (F, "glColor4f(%f, %f, %f, %f);\n", red, green, blue, alpha));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Color4fv)(const GLfloat * v)
+{
+ DISPATCH(Color4fv, (v), (F, "glColor4fv(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Color4i)(GLint red, GLint green, GLint blue, GLint alpha)
+{
+ DISPATCH(Color4i, (red, green, blue, alpha), (F, "glColor4i(%d, %d, %d, %d);\n", red, green, blue, alpha));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Color4iv)(const GLint * v)
+{
+ DISPATCH(Color4iv, (v), (F, "glColor4iv(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Color4s)(GLshort red, GLshort green, GLshort blue, GLshort alpha)
+{
+ DISPATCH(Color4s, (red, green, blue, alpha), (F, "glColor4s(%d, %d, %d, %d);\n", red, green, blue, alpha));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Color4sv)(const GLshort * v)
+{
+ DISPATCH(Color4sv, (v), (F, "glColor4sv(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Color4ub)(GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha)
+{
+ DISPATCH(Color4ub, (red, green, blue, alpha), (F, "glColor4ub(%d, %d, %d, %d);\n", red, green, blue, alpha));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Color4ubv)(const GLubyte * v)
+{
+ DISPATCH(Color4ubv, (v), (F, "glColor4ubv(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Color4ui)(GLuint red, GLuint green, GLuint blue, GLuint alpha)
+{
+ DISPATCH(Color4ui, (red, green, blue, alpha), (F, "glColor4ui(%d, %d, %d, %d);\n", red, green, blue, alpha));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Color4uiv)(const GLuint * v)
+{
+ DISPATCH(Color4uiv, (v), (F, "glColor4uiv(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Color4us)(GLushort red, GLushort green, GLushort blue, GLushort alpha)
+{
+ DISPATCH(Color4us, (red, green, blue, alpha), (F, "glColor4us(%d, %d, %d, %d);\n", red, green, blue, alpha));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Color4usv)(const GLushort * v)
+{
+ DISPATCH(Color4usv, (v), (F, "glColor4usv(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(EdgeFlag)(GLboolean flag)
+{
+ DISPATCH(EdgeFlag, (flag), (F, "glEdgeFlag(%d);\n", flag));
+}
+
+KEYWORD1 void KEYWORD2 NAME(EdgeFlagv)(const GLboolean * flag)
+{
+ DISPATCH(EdgeFlagv, (flag), (F, "glEdgeFlagv(%p);\n", (const void *) flag));
+}
+
+KEYWORD1 void KEYWORD2 NAME(End)(void)
+{
+ DISPATCH(End, (), (F, "glEnd();\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Indexd)(GLdouble c)
+{
+ DISPATCH(Indexd, (c), (F, "glIndexd(%f);\n", c));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Indexdv)(const GLdouble * c)
+{
+ DISPATCH(Indexdv, (c), (F, "glIndexdv(%p);\n", (const void *) c));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Indexf)(GLfloat c)
+{
+ DISPATCH(Indexf, (c), (F, "glIndexf(%f);\n", c));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Indexfv)(const GLfloat * c)
+{
+ DISPATCH(Indexfv, (c), (F, "glIndexfv(%p);\n", (const void *) c));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Indexi)(GLint c)
+{
+ DISPATCH(Indexi, (c), (F, "glIndexi(%d);\n", c));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Indexiv)(const GLint * c)
+{
+ DISPATCH(Indexiv, (c), (F, "glIndexiv(%p);\n", (const void *) c));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Indexs)(GLshort c)
+{
+ DISPATCH(Indexs, (c), (F, "glIndexs(%d);\n", c));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Indexsv)(const GLshort * c)
+{
+ DISPATCH(Indexsv, (c), (F, "glIndexsv(%p);\n", (const void *) c));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Normal3b)(GLbyte nx, GLbyte ny, GLbyte nz)
+{
+ DISPATCH(Normal3b, (nx, ny, nz), (F, "glNormal3b(%d, %d, %d);\n", nx, ny, nz));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Normal3bv)(const GLbyte * v)
+{
+ DISPATCH(Normal3bv, (v), (F, "glNormal3bv(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Normal3d)(GLdouble nx, GLdouble ny, GLdouble nz)
+{
+ DISPATCH(Normal3d, (nx, ny, nz), (F, "glNormal3d(%f, %f, %f);\n", nx, ny, nz));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Normal3dv)(const GLdouble * v)
+{
+ DISPATCH(Normal3dv, (v), (F, "glNormal3dv(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Normal3f)(GLfloat nx, GLfloat ny, GLfloat nz)
+{
+ DISPATCH(Normal3f, (nx, ny, nz), (F, "glNormal3f(%f, %f, %f);\n", nx, ny, nz));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Normal3fv)(const GLfloat * v)
+{
+ DISPATCH(Normal3fv, (v), (F, "glNormal3fv(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Normal3i)(GLint nx, GLint ny, GLint nz)
+{
+ DISPATCH(Normal3i, (nx, ny, nz), (F, "glNormal3i(%d, %d, %d);\n", nx, ny, nz));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Normal3iv)(const GLint * v)
+{
+ DISPATCH(Normal3iv, (v), (F, "glNormal3iv(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Normal3s)(GLshort nx, GLshort ny, GLshort nz)
+{
+ DISPATCH(Normal3s, (nx, ny, nz), (F, "glNormal3s(%d, %d, %d);\n", nx, ny, nz));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Normal3sv)(const GLshort * v)
+{
+ DISPATCH(Normal3sv, (v), (F, "glNormal3sv(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(RasterPos2d)(GLdouble x, GLdouble y)
+{
+ DISPATCH(RasterPos2d, (x, y), (F, "glRasterPos2d(%f, %f);\n", x, y));
+}
+
+KEYWORD1 void KEYWORD2 NAME(RasterPos2dv)(const GLdouble * v)
+{
+ DISPATCH(RasterPos2dv, (v), (F, "glRasterPos2dv(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(RasterPos2f)(GLfloat x, GLfloat y)
+{
+ DISPATCH(RasterPos2f, (x, y), (F, "glRasterPos2f(%f, %f);\n", x, y));
+}
+
+KEYWORD1 void KEYWORD2 NAME(RasterPos2fv)(const GLfloat * v)
+{
+ DISPATCH(RasterPos2fv, (v), (F, "glRasterPos2fv(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(RasterPos2i)(GLint x, GLint y)
+{
+ DISPATCH(RasterPos2i, (x, y), (F, "glRasterPos2i(%d, %d);\n", x, y));
+}
+
+KEYWORD1 void KEYWORD2 NAME(RasterPos2iv)(const GLint * v)
+{
+ DISPATCH(RasterPos2iv, (v), (F, "glRasterPos2iv(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(RasterPos2s)(GLshort x, GLshort y)
+{
+ DISPATCH(RasterPos2s, (x, y), (F, "glRasterPos2s(%d, %d);\n", x, y));
+}
+
+KEYWORD1 void KEYWORD2 NAME(RasterPos2sv)(const GLshort * v)
+{
+ DISPATCH(RasterPos2sv, (v), (F, "glRasterPos2sv(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(RasterPos3d)(GLdouble x, GLdouble y, GLdouble z)
+{
+ DISPATCH(RasterPos3d, (x, y, z), (F, "glRasterPos3d(%f, %f, %f);\n", x, y, z));
+}
+
+KEYWORD1 void KEYWORD2 NAME(RasterPos3dv)(const GLdouble * v)
+{
+ DISPATCH(RasterPos3dv, (v), (F, "glRasterPos3dv(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(RasterPos3f)(GLfloat x, GLfloat y, GLfloat z)
+{
+ DISPATCH(RasterPos3f, (x, y, z), (F, "glRasterPos3f(%f, %f, %f);\n", x, y, z));
+}
+
+KEYWORD1 void KEYWORD2 NAME(RasterPos3fv)(const GLfloat * v)
+{
+ DISPATCH(RasterPos3fv, (v), (F, "glRasterPos3fv(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(RasterPos3i)(GLint x, GLint y, GLint z)
+{
+ DISPATCH(RasterPos3i, (x, y, z), (F, "glRasterPos3i(%d, %d, %d);\n", x, y, z));
+}
+
+KEYWORD1 void KEYWORD2 NAME(RasterPos3iv)(const GLint * v)
+{
+ DISPATCH(RasterPos3iv, (v), (F, "glRasterPos3iv(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(RasterPos3s)(GLshort x, GLshort y, GLshort z)
+{
+ DISPATCH(RasterPos3s, (x, y, z), (F, "glRasterPos3s(%d, %d, %d);\n", x, y, z));
+}
+
+KEYWORD1 void KEYWORD2 NAME(RasterPos3sv)(const GLshort * v)
+{
+ DISPATCH(RasterPos3sv, (v), (F, "glRasterPos3sv(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(RasterPos4d)(GLdouble x, GLdouble y, GLdouble z, GLdouble w)
+{
+ DISPATCH(RasterPos4d, (x, y, z, w), (F, "glRasterPos4d(%f, %f, %f, %f);\n", x, y, z, w));
+}
+
+KEYWORD1 void KEYWORD2 NAME(RasterPos4dv)(const GLdouble * v)
+{
+ DISPATCH(RasterPos4dv, (v), (F, "glRasterPos4dv(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(RasterPos4f)(GLfloat x, GLfloat y, GLfloat z, GLfloat w)
+{
+ DISPATCH(RasterPos4f, (x, y, z, w), (F, "glRasterPos4f(%f, %f, %f, %f);\n", x, y, z, w));
+}
+
+KEYWORD1 void KEYWORD2 NAME(RasterPos4fv)(const GLfloat * v)
+{
+ DISPATCH(RasterPos4fv, (v), (F, "glRasterPos4fv(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(RasterPos4i)(GLint x, GLint y, GLint z, GLint w)
+{
+ DISPATCH(RasterPos4i, (x, y, z, w), (F, "glRasterPos4i(%d, %d, %d, %d);\n", x, y, z, w));
+}
+
+KEYWORD1 void KEYWORD2 NAME(RasterPos4iv)(const GLint * v)
+{
+ DISPATCH(RasterPos4iv, (v), (F, "glRasterPos4iv(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(RasterPos4s)(GLshort x, GLshort y, GLshort z, GLshort w)
+{
+ DISPATCH(RasterPos4s, (x, y, z, w), (F, "glRasterPos4s(%d, %d, %d, %d);\n", x, y, z, w));
+}
+
+KEYWORD1 void KEYWORD2 NAME(RasterPos4sv)(const GLshort * v)
+{
+ DISPATCH(RasterPos4sv, (v), (F, "glRasterPos4sv(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Rectd)(GLdouble x1, GLdouble y1, GLdouble x2, GLdouble y2)
+{
+ DISPATCH(Rectd, (x1, y1, x2, y2), (F, "glRectd(%f, %f, %f, %f);\n", x1, y1, x2, y2));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Rectdv)(const GLdouble * v1, const GLdouble * v2)
+{
+ DISPATCH(Rectdv, (v1, v2), (F, "glRectdv(%p, %p);\n", (const void *) v1, (const void *) v2));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Rectf)(GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2)
+{
+ DISPATCH(Rectf, (x1, y1, x2, y2), (F, "glRectf(%f, %f, %f, %f);\n", x1, y1, x2, y2));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Rectfv)(const GLfloat * v1, const GLfloat * v2)
+{
+ DISPATCH(Rectfv, (v1, v2), (F, "glRectfv(%p, %p);\n", (const void *) v1, (const void *) v2));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Recti)(GLint x1, GLint y1, GLint x2, GLint y2)
+{
+ DISPATCH(Recti, (x1, y1, x2, y2), (F, "glRecti(%d, %d, %d, %d);\n", x1, y1, x2, y2));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Rectiv)(const GLint * v1, const GLint * v2)
+{
+ DISPATCH(Rectiv, (v1, v2), (F, "glRectiv(%p, %p);\n", (const void *) v1, (const void *) v2));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Rects)(GLshort x1, GLshort y1, GLshort x2, GLshort y2)
+{
+ DISPATCH(Rects, (x1, y1, x2, y2), (F, "glRects(%d, %d, %d, %d);\n", x1, y1, x2, y2));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Rectsv)(const GLshort * v1, const GLshort * v2)
+{
+ DISPATCH(Rectsv, (v1, v2), (F, "glRectsv(%p, %p);\n", (const void *) v1, (const void *) v2));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TexCoord1d)(GLdouble s)
+{
+ DISPATCH(TexCoord1d, (s), (F, "glTexCoord1d(%f);\n", s));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TexCoord1dv)(const GLdouble * v)
+{
+ DISPATCH(TexCoord1dv, (v), (F, "glTexCoord1dv(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TexCoord1f)(GLfloat s)
+{
+ DISPATCH(TexCoord1f, (s), (F, "glTexCoord1f(%f);\n", s));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TexCoord1fv)(const GLfloat * v)
+{
+ DISPATCH(TexCoord1fv, (v), (F, "glTexCoord1fv(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TexCoord1i)(GLint s)
+{
+ DISPATCH(TexCoord1i, (s), (F, "glTexCoord1i(%d);\n", s));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TexCoord1iv)(const GLint * v)
+{
+ DISPATCH(TexCoord1iv, (v), (F, "glTexCoord1iv(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TexCoord1s)(GLshort s)
+{
+ DISPATCH(TexCoord1s, (s), (F, "glTexCoord1s(%d);\n", s));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TexCoord1sv)(const GLshort * v)
+{
+ DISPATCH(TexCoord1sv, (v), (F, "glTexCoord1sv(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TexCoord2d)(GLdouble s, GLdouble t)
+{
+ DISPATCH(TexCoord2d, (s, t), (F, "glTexCoord2d(%f, %f);\n", s, t));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TexCoord2dv)(const GLdouble * v)
+{
+ DISPATCH(TexCoord2dv, (v), (F, "glTexCoord2dv(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TexCoord2f)(GLfloat s, GLfloat t)
+{
+ DISPATCH(TexCoord2f, (s, t), (F, "glTexCoord2f(%f, %f);\n", s, t));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TexCoord2fv)(const GLfloat * v)
+{
+ DISPATCH(TexCoord2fv, (v), (F, "glTexCoord2fv(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TexCoord2i)(GLint s, GLint t)
+{
+ DISPATCH(TexCoord2i, (s, t), (F, "glTexCoord2i(%d, %d);\n", s, t));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TexCoord2iv)(const GLint * v)
+{
+ DISPATCH(TexCoord2iv, (v), (F, "glTexCoord2iv(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TexCoord2s)(GLshort s, GLshort t)
+{
+ DISPATCH(TexCoord2s, (s, t), (F, "glTexCoord2s(%d, %d);\n", s, t));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TexCoord2sv)(const GLshort * v)
+{
+ DISPATCH(TexCoord2sv, (v), (F, "glTexCoord2sv(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TexCoord3d)(GLdouble s, GLdouble t, GLdouble r)
+{
+ DISPATCH(TexCoord3d, (s, t, r), (F, "glTexCoord3d(%f, %f, %f);\n", s, t, r));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TexCoord3dv)(const GLdouble * v)
+{
+ DISPATCH(TexCoord3dv, (v), (F, "glTexCoord3dv(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TexCoord3f)(GLfloat s, GLfloat t, GLfloat r)
+{
+ DISPATCH(TexCoord3f, (s, t, r), (F, "glTexCoord3f(%f, %f, %f);\n", s, t, r));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TexCoord3fv)(const GLfloat * v)
+{
+ DISPATCH(TexCoord3fv, (v), (F, "glTexCoord3fv(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TexCoord3i)(GLint s, GLint t, GLint r)
+{
+ DISPATCH(TexCoord3i, (s, t, r), (F, "glTexCoord3i(%d, %d, %d);\n", s, t, r));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TexCoord3iv)(const GLint * v)
+{
+ DISPATCH(TexCoord3iv, (v), (F, "glTexCoord3iv(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TexCoord3s)(GLshort s, GLshort t, GLshort r)
+{
+ DISPATCH(TexCoord3s, (s, t, r), (F, "glTexCoord3s(%d, %d, %d);\n", s, t, r));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TexCoord3sv)(const GLshort * v)
+{
+ DISPATCH(TexCoord3sv, (v), (F, "glTexCoord3sv(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TexCoord4d)(GLdouble s, GLdouble t, GLdouble r, GLdouble q)
+{
+ DISPATCH(TexCoord4d, (s, t, r, q), (F, "glTexCoord4d(%f, %f, %f, %f);\n", s, t, r, q));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TexCoord4dv)(const GLdouble * v)
+{
+ DISPATCH(TexCoord4dv, (v), (F, "glTexCoord4dv(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TexCoord4f)(GLfloat s, GLfloat t, GLfloat r, GLfloat q)
+{
+ DISPATCH(TexCoord4f, (s, t, r, q), (F, "glTexCoord4f(%f, %f, %f, %f);\n", s, t, r, q));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TexCoord4fv)(const GLfloat * v)
+{
+ DISPATCH(TexCoord4fv, (v), (F, "glTexCoord4fv(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TexCoord4i)(GLint s, GLint t, GLint r, GLint q)
+{
+ DISPATCH(TexCoord4i, (s, t, r, q), (F, "glTexCoord4i(%d, %d, %d, %d);\n", s, t, r, q));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TexCoord4iv)(const GLint * v)
+{
+ DISPATCH(TexCoord4iv, (v), (F, "glTexCoord4iv(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TexCoord4s)(GLshort s, GLshort t, GLshort r, GLshort q)
+{
+ DISPATCH(TexCoord4s, (s, t, r, q), (F, "glTexCoord4s(%d, %d, %d, %d);\n", s, t, r, q));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TexCoord4sv)(const GLshort * v)
+{
+ DISPATCH(TexCoord4sv, (v), (F, "glTexCoord4sv(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Vertex2d)(GLdouble x, GLdouble y)
+{
+ DISPATCH(Vertex2d, (x, y), (F, "glVertex2d(%f, %f);\n", x, y));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Vertex2dv)(const GLdouble * v)
+{
+ DISPATCH(Vertex2dv, (v), (F, "glVertex2dv(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Vertex2f)(GLfloat x, GLfloat y)
+{
+ DISPATCH(Vertex2f, (x, y), (F, "glVertex2f(%f, %f);\n", x, y));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Vertex2fv)(const GLfloat * v)
+{
+ DISPATCH(Vertex2fv, (v), (F, "glVertex2fv(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Vertex2i)(GLint x, GLint y)
+{
+ DISPATCH(Vertex2i, (x, y), (F, "glVertex2i(%d, %d);\n", x, y));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Vertex2iv)(const GLint * v)
+{
+ DISPATCH(Vertex2iv, (v), (F, "glVertex2iv(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Vertex2s)(GLshort x, GLshort y)
+{
+ DISPATCH(Vertex2s, (x, y), (F, "glVertex2s(%d, %d);\n", x, y));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Vertex2sv)(const GLshort * v)
+{
+ DISPATCH(Vertex2sv, (v), (F, "glVertex2sv(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Vertex3d)(GLdouble x, GLdouble y, GLdouble z)
+{
+ DISPATCH(Vertex3d, (x, y, z), (F, "glVertex3d(%f, %f, %f);\n", x, y, z));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Vertex3dv)(const GLdouble * v)
+{
+ DISPATCH(Vertex3dv, (v), (F, "glVertex3dv(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Vertex3f)(GLfloat x, GLfloat y, GLfloat z)
+{
+ DISPATCH(Vertex3f, (x, y, z), (F, "glVertex3f(%f, %f, %f);\n", x, y, z));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Vertex3fv)(const GLfloat * v)
+{
+ DISPATCH(Vertex3fv, (v), (F, "glVertex3fv(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Vertex3i)(GLint x, GLint y, GLint z)
+{
+ DISPATCH(Vertex3i, (x, y, z), (F, "glVertex3i(%d, %d, %d);\n", x, y, z));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Vertex3iv)(const GLint * v)
+{
+ DISPATCH(Vertex3iv, (v), (F, "glVertex3iv(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Vertex3s)(GLshort x, GLshort y, GLshort z)
+{
+ DISPATCH(Vertex3s, (x, y, z), (F, "glVertex3s(%d, %d, %d);\n", x, y, z));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Vertex3sv)(const GLshort * v)
+{
+ DISPATCH(Vertex3sv, (v), (F, "glVertex3sv(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Vertex4d)(GLdouble x, GLdouble y, GLdouble z, GLdouble w)
+{
+ DISPATCH(Vertex4d, (x, y, z, w), (F, "glVertex4d(%f, %f, %f, %f);\n", x, y, z, w));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Vertex4dv)(const GLdouble * v)
+{
+ DISPATCH(Vertex4dv, (v), (F, "glVertex4dv(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Vertex4f)(GLfloat x, GLfloat y, GLfloat z, GLfloat w)
+{
+ DISPATCH(Vertex4f, (x, y, z, w), (F, "glVertex4f(%f, %f, %f, %f);\n", x, y, z, w));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Vertex4fv)(const GLfloat * v)
+{
+ DISPATCH(Vertex4fv, (v), (F, "glVertex4fv(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Vertex4i)(GLint x, GLint y, GLint z, GLint w)
+{
+ DISPATCH(Vertex4i, (x, y, z, w), (F, "glVertex4i(%d, %d, %d, %d);\n", x, y, z, w));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Vertex4iv)(const GLint * v)
+{
+ DISPATCH(Vertex4iv, (v), (F, "glVertex4iv(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Vertex4s)(GLshort x, GLshort y, GLshort z, GLshort w)
+{
+ DISPATCH(Vertex4s, (x, y, z, w), (F, "glVertex4s(%d, %d, %d, %d);\n", x, y, z, w));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Vertex4sv)(const GLshort * v)
+{
+ DISPATCH(Vertex4sv, (v), (F, "glVertex4sv(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ClipPlane)(GLenum plane, const GLdouble * equation)
+{
+ DISPATCH(ClipPlane, (plane, equation), (F, "glClipPlane(0x%x, %p);\n", plane, (const void *) equation));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ColorMaterial)(GLenum face, GLenum mode)
+{
+ DISPATCH(ColorMaterial, (face, mode), (F, "glColorMaterial(0x%x, 0x%x);\n", face, mode));
+}
+
+KEYWORD1 void KEYWORD2 NAME(CullFace)(GLenum mode)
+{
+ DISPATCH(CullFace, (mode), (F, "glCullFace(0x%x);\n", mode));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Fogf)(GLenum pname, GLfloat param)
+{
+ DISPATCH(Fogf, (pname, param), (F, "glFogf(0x%x, %f);\n", pname, param));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Fogfv)(GLenum pname, const GLfloat * params)
+{
+ DISPATCH(Fogfv, (pname, params), (F, "glFogfv(0x%x, %p);\n", pname, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Fogi)(GLenum pname, GLint param)
+{
+ DISPATCH(Fogi, (pname, param), (F, "glFogi(0x%x, %d);\n", pname, param));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Fogiv)(GLenum pname, const GLint * params)
+{
+ DISPATCH(Fogiv, (pname, params), (F, "glFogiv(0x%x, %p);\n", pname, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(FrontFace)(GLenum mode)
+{
+ DISPATCH(FrontFace, (mode), (F, "glFrontFace(0x%x);\n", mode));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Hint)(GLenum target, GLenum mode)
+{
+ DISPATCH(Hint, (target, mode), (F, "glHint(0x%x, 0x%x);\n", target, mode));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Lightf)(GLenum light, GLenum pname, GLfloat param)
+{
+ DISPATCH(Lightf, (light, pname, param), (F, "glLightf(0x%x, 0x%x, %f);\n", light, pname, param));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Lightfv)(GLenum light, GLenum pname, const GLfloat * params)
+{
+ DISPATCH(Lightfv, (light, pname, params), (F, "glLightfv(0x%x, 0x%x, %p);\n", light, pname, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Lighti)(GLenum light, GLenum pname, GLint param)
+{
+ DISPATCH(Lighti, (light, pname, param), (F, "glLighti(0x%x, 0x%x, %d);\n", light, pname, param));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Lightiv)(GLenum light, GLenum pname, const GLint * params)
+{
+ DISPATCH(Lightiv, (light, pname, params), (F, "glLightiv(0x%x, 0x%x, %p);\n", light, pname, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(LightModelf)(GLenum pname, GLfloat param)
+{
+ DISPATCH(LightModelf, (pname, param), (F, "glLightModelf(0x%x, %f);\n", pname, param));
+}
+
+KEYWORD1 void KEYWORD2 NAME(LightModelfv)(GLenum pname, const GLfloat * params)
+{
+ DISPATCH(LightModelfv, (pname, params), (F, "glLightModelfv(0x%x, %p);\n", pname, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(LightModeli)(GLenum pname, GLint param)
+{
+ DISPATCH(LightModeli, (pname, param), (F, "glLightModeli(0x%x, %d);\n", pname, param));
+}
+
+KEYWORD1 void KEYWORD2 NAME(LightModeliv)(GLenum pname, const GLint * params)
+{
+ DISPATCH(LightModeliv, (pname, params), (F, "glLightModeliv(0x%x, %p);\n", pname, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(LineStipple)(GLint factor, GLushort pattern)
+{
+ DISPATCH(LineStipple, (factor, pattern), (F, "glLineStipple(%d, %d);\n", factor, pattern));
+}
+
+KEYWORD1 void KEYWORD2 NAME(LineWidth)(GLfloat width)
+{
+ DISPATCH(LineWidth, (width), (F, "glLineWidth(%f);\n", width));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Materialf)(GLenum face, GLenum pname, GLfloat param)
+{
+ DISPATCH(Materialf, (face, pname, param), (F, "glMaterialf(0x%x, 0x%x, %f);\n", face, pname, param));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Materialfv)(GLenum face, GLenum pname, const GLfloat * params)
+{
+ DISPATCH(Materialfv, (face, pname, params), (F, "glMaterialfv(0x%x, 0x%x, %p);\n", face, pname, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Materiali)(GLenum face, GLenum pname, GLint param)
+{
+ DISPATCH(Materiali, (face, pname, param), (F, "glMateriali(0x%x, 0x%x, %d);\n", face, pname, param));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Materialiv)(GLenum face, GLenum pname, const GLint * params)
+{
+ DISPATCH(Materialiv, (face, pname, params), (F, "glMaterialiv(0x%x, 0x%x, %p);\n", face, pname, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(PointSize)(GLfloat size)
+{
+ DISPATCH(PointSize, (size), (F, "glPointSize(%f);\n", size));
+}
+
+KEYWORD1 void KEYWORD2 NAME(PolygonMode)(GLenum face, GLenum mode)
+{
+ DISPATCH(PolygonMode, (face, mode), (F, "glPolygonMode(0x%x, 0x%x);\n", face, mode));
+}
+
+KEYWORD1 void KEYWORD2 NAME(PolygonStipple)(const GLubyte * mask)
+{
+ DISPATCH(PolygonStipple, (mask), (F, "glPolygonStipple(%p);\n", (const void *) mask));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Scissor)(GLint x, GLint y, GLsizei width, GLsizei height)
+{
+ DISPATCH(Scissor, (x, y, width, height), (F, "glScissor(%d, %d, %d, %d);\n", x, y, width, height));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ShadeModel)(GLenum mode)
+{
+ DISPATCH(ShadeModel, (mode), (F, "glShadeModel(0x%x);\n", mode));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TexParameterf)(GLenum target, GLenum pname, GLfloat param)
+{
+ DISPATCH(TexParameterf, (target, pname, param), (F, "glTexParameterf(0x%x, 0x%x, %f);\n", target, pname, param));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TexParameterfv)(GLenum target, GLenum pname, const GLfloat * params)
+{
+ DISPATCH(TexParameterfv, (target, pname, params), (F, "glTexParameterfv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TexParameteri)(GLenum target, GLenum pname, GLint param)
+{
+ DISPATCH(TexParameteri, (target, pname, param), (F, "glTexParameteri(0x%x, 0x%x, %d);\n", target, pname, param));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TexParameteriv)(GLenum target, GLenum pname, const GLint * params)
+{
+ DISPATCH(TexParameteriv, (target, pname, params), (F, "glTexParameteriv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TexImage1D)(GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid * pixels)
+{
+ DISPATCH(TexImage1D, (target, level, internalformat, width, border, format, type, pixels), (F, "glTexImage1D(0x%x, %d, %d, %d, %d, 0x%x, 0x%x, %p);\n", target, level, internalformat, width, border, format, type, (const void *) pixels));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TexImage2D)(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid * pixels)
+{
+ DISPATCH(TexImage2D, (target, level, internalformat, width, height, border, format, type, pixels), (F, "glTexImage2D(0x%x, %d, %d, %d, %d, %d, 0x%x, 0x%x, %p);\n", target, level, internalformat, width, height, border, format, type, (const void *) pixels));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TexEnvf)(GLenum target, GLenum pname, GLfloat param)
+{
+ DISPATCH(TexEnvf, (target, pname, param), (F, "glTexEnvf(0x%x, 0x%x, %f);\n", target, pname, param));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TexEnvfv)(GLenum target, GLenum pname, const GLfloat * params)
+{
+ DISPATCH(TexEnvfv, (target, pname, params), (F, "glTexEnvfv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TexEnvi)(GLenum target, GLenum pname, GLint param)
+{
+ DISPATCH(TexEnvi, (target, pname, param), (F, "glTexEnvi(0x%x, 0x%x, %d);\n", target, pname, param));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TexEnviv)(GLenum target, GLenum pname, const GLint * params)
+{
+ DISPATCH(TexEnviv, (target, pname, params), (F, "glTexEnviv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TexGend)(GLenum coord, GLenum pname, GLdouble param)
+{
+ DISPATCH(TexGend, (coord, pname, param), (F, "glTexGend(0x%x, 0x%x, %f);\n", coord, pname, param));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TexGendv)(GLenum coord, GLenum pname, const GLdouble * params)
+{
+ DISPATCH(TexGendv, (coord, pname, params), (F, "glTexGendv(0x%x, 0x%x, %p);\n", coord, pname, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TexGenf)(GLenum coord, GLenum pname, GLfloat param)
+{
+ DISPATCH(TexGenf, (coord, pname, param), (F, "glTexGenf(0x%x, 0x%x, %f);\n", coord, pname, param));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TexGenfv)(GLenum coord, GLenum pname, const GLfloat * params)
+{
+ DISPATCH(TexGenfv, (coord, pname, params), (F, "glTexGenfv(0x%x, 0x%x, %p);\n", coord, pname, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TexGeni)(GLenum coord, GLenum pname, GLint param)
+{
+ DISPATCH(TexGeni, (coord, pname, param), (F, "glTexGeni(0x%x, 0x%x, %d);\n", coord, pname, param));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TexGeniv)(GLenum coord, GLenum pname, const GLint * params)
+{
+ DISPATCH(TexGeniv, (coord, pname, params), (F, "glTexGeniv(0x%x, 0x%x, %p);\n", coord, pname, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(FeedbackBuffer)(GLsizei size, GLenum type, GLfloat * buffer)
+{
+ DISPATCH(FeedbackBuffer, (size, type, buffer), (F, "glFeedbackBuffer(%d, 0x%x, %p);\n", size, type, (const void *) buffer));
+}
+
+KEYWORD1 void KEYWORD2 NAME(SelectBuffer)(GLsizei size, GLuint * buffer)
+{
+ DISPATCH(SelectBuffer, (size, buffer), (F, "glSelectBuffer(%d, %p);\n", size, (const void *) buffer));
+}
+
+KEYWORD1 GLint KEYWORD2 NAME(RenderMode)(GLenum mode)
+{
+ RETURN_DISPATCH(RenderMode, (mode), (F, "glRenderMode(0x%x);\n", mode));
+}
+
+KEYWORD1 void KEYWORD2 NAME(InitNames)(void)
+{
+ DISPATCH(InitNames, (), (F, "glInitNames();\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(LoadName)(GLuint name)
+{
+ DISPATCH(LoadName, (name), (F, "glLoadName(%d);\n", name));
+}
+
+KEYWORD1 void KEYWORD2 NAME(PassThrough)(GLfloat token)
+{
+ DISPATCH(PassThrough, (token), (F, "glPassThrough(%f);\n", token));
+}
+
+KEYWORD1 void KEYWORD2 NAME(PopName)(void)
+{
+ DISPATCH(PopName, (), (F, "glPopName();\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(PushName)(GLuint name)
+{
+ DISPATCH(PushName, (name), (F, "glPushName(%d);\n", name));
+}
+
+KEYWORD1 void KEYWORD2 NAME(DrawBuffer)(GLenum mode)
+{
+ DISPATCH(DrawBuffer, (mode), (F, "glDrawBuffer(0x%x);\n", mode));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Clear)(GLbitfield mask)
+{
+ DISPATCH(Clear, (mask), (F, "glClear(%d);\n", mask));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ClearAccum)(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha)
+{
+ DISPATCH(ClearAccum, (red, green, blue, alpha), (F, "glClearAccum(%f, %f, %f, %f);\n", red, green, blue, alpha));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ClearIndex)(GLfloat c)
+{
+ DISPATCH(ClearIndex, (c), (F, "glClearIndex(%f);\n", c));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ClearColor)(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha)
+{
+ DISPATCH(ClearColor, (red, green, blue, alpha), (F, "glClearColor(%f, %f, %f, %f);\n", red, green, blue, alpha));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ClearStencil)(GLint s)
+{
+ DISPATCH(ClearStencil, (s), (F, "glClearStencil(%d);\n", s));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ClearDepth)(GLclampd depth)
+{
+ DISPATCH(ClearDepth, (depth), (F, "glClearDepth(%f);\n", depth));
+}
+
+KEYWORD1 void KEYWORD2 NAME(StencilMask)(GLuint mask)
+{
+ DISPATCH(StencilMask, (mask), (F, "glStencilMask(%d);\n", mask));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ColorMask)(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha)
+{
+ DISPATCH(ColorMask, (red, green, blue, alpha), (F, "glColorMask(%d, %d, %d, %d);\n", red, green, blue, alpha));
+}
+
+KEYWORD1 void KEYWORD2 NAME(DepthMask)(GLboolean flag)
+{
+ DISPATCH(DepthMask, (flag), (F, "glDepthMask(%d);\n", flag));
+}
+
+KEYWORD1 void KEYWORD2 NAME(IndexMask)(GLuint mask)
+{
+ DISPATCH(IndexMask, (mask), (F, "glIndexMask(%d);\n", mask));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Accum)(GLenum op, GLfloat value)
+{
+ DISPATCH(Accum, (op, value), (F, "glAccum(0x%x, %f);\n", op, value));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Disable)(GLenum cap)
+{
+ DISPATCH(Disable, (cap), (F, "glDisable(0x%x);\n", cap));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Enable)(GLenum cap)
+{
+ DISPATCH(Enable, (cap), (F, "glEnable(0x%x);\n", cap));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Finish)(void)
+{
+ DISPATCH(Finish, (), (F, "glFinish();\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Flush)(void)
+{
+ DISPATCH(Flush, (), (F, "glFlush();\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(PopAttrib)(void)
+{
+ DISPATCH(PopAttrib, (), (F, "glPopAttrib();\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(PushAttrib)(GLbitfield mask)
+{
+ DISPATCH(PushAttrib, (mask), (F, "glPushAttrib(%d);\n", mask));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Map1d)(GLenum target, GLdouble u1, GLdouble u2, GLint stride, GLint order, const GLdouble * points)
+{
+ DISPATCH(Map1d, (target, u1, u2, stride, order, points), (F, "glMap1d(0x%x, %f, %f, %d, %d, %p);\n", target, u1, u2, stride, order, (const void *) points));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Map1f)(GLenum target, GLfloat u1, GLfloat u2, GLint stride, GLint order, const GLfloat * points)
+{
+ DISPATCH(Map1f, (target, u1, u2, stride, order, points), (F, "glMap1f(0x%x, %f, %f, %d, %d, %p);\n", target, u1, u2, stride, order, (const void *) points));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Map2d)(GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, const GLdouble * points)
+{
+ DISPATCH(Map2d, (target, u1, u2, ustride, uorder, v1, v2, vstride, vorder, points), (F, "glMap2d(0x%x, %f, %f, %d, %d, %f, %f, %d, %d, %p);\n", target, u1, u2, ustride, uorder, v1, v2, vstride, vorder, (const void *) points));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Map2f)(GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, const GLfloat * points)
+{
+ DISPATCH(Map2f, (target, u1, u2, ustride, uorder, v1, v2, vstride, vorder, points), (F, "glMap2f(0x%x, %f, %f, %d, %d, %f, %f, %d, %d, %p);\n", target, u1, u2, ustride, uorder, v1, v2, vstride, vorder, (const void *) points));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MapGrid1d)(GLint un, GLdouble u1, GLdouble u2)
+{
+ DISPATCH(MapGrid1d, (un, u1, u2), (F, "glMapGrid1d(%d, %f, %f);\n", un, u1, u2));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MapGrid1f)(GLint un, GLfloat u1, GLfloat u2)
+{
+ DISPATCH(MapGrid1f, (un, u1, u2), (F, "glMapGrid1f(%d, %f, %f);\n", un, u1, u2));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MapGrid2d)(GLint un, GLdouble u1, GLdouble u2, GLint vn, GLdouble v1, GLdouble v2)
+{
+ DISPATCH(MapGrid2d, (un, u1, u2, vn, v1, v2), (F, "glMapGrid2d(%d, %f, %f, %d, %f, %f);\n", un, u1, u2, vn, v1, v2));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MapGrid2f)(GLint un, GLfloat u1, GLfloat u2, GLint vn, GLfloat v1, GLfloat v2)
+{
+ DISPATCH(MapGrid2f, (un, u1, u2, vn, v1, v2), (F, "glMapGrid2f(%d, %f, %f, %d, %f, %f);\n", un, u1, u2, vn, v1, v2));
+}
+
+KEYWORD1 void KEYWORD2 NAME(EvalCoord1d)(GLdouble u)
+{
+ DISPATCH(EvalCoord1d, (u), (F, "glEvalCoord1d(%f);\n", u));
+}
+
+KEYWORD1 void KEYWORD2 NAME(EvalCoord1dv)(const GLdouble * u)
+{
+ DISPATCH(EvalCoord1dv, (u), (F, "glEvalCoord1dv(%p);\n", (const void *) u));
+}
+
+KEYWORD1 void KEYWORD2 NAME(EvalCoord1f)(GLfloat u)
+{
+ DISPATCH(EvalCoord1f, (u), (F, "glEvalCoord1f(%f);\n", u));
+}
+
+KEYWORD1 void KEYWORD2 NAME(EvalCoord1fv)(const GLfloat * u)
+{
+ DISPATCH(EvalCoord1fv, (u), (F, "glEvalCoord1fv(%p);\n", (const void *) u));
+}
+
+KEYWORD1 void KEYWORD2 NAME(EvalCoord2d)(GLdouble u, GLdouble v)
+{
+ DISPATCH(EvalCoord2d, (u, v), (F, "glEvalCoord2d(%f, %f);\n", u, v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(EvalCoord2dv)(const GLdouble * u)
+{
+ DISPATCH(EvalCoord2dv, (u), (F, "glEvalCoord2dv(%p);\n", (const void *) u));
+}
+
+KEYWORD1 void KEYWORD2 NAME(EvalCoord2f)(GLfloat u, GLfloat v)
+{
+ DISPATCH(EvalCoord2f, (u, v), (F, "glEvalCoord2f(%f, %f);\n", u, v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(EvalCoord2fv)(const GLfloat * u)
+{
+ DISPATCH(EvalCoord2fv, (u), (F, "glEvalCoord2fv(%p);\n", (const void *) u));
+}
+
+KEYWORD1 void KEYWORD2 NAME(EvalMesh1)(GLenum mode, GLint i1, GLint i2)
+{
+ DISPATCH(EvalMesh1, (mode, i1, i2), (F, "glEvalMesh1(0x%x, %d, %d);\n", mode, i1, i2));
+}
+
+KEYWORD1 void KEYWORD2 NAME(EvalPoint1)(GLint i)
+{
+ DISPATCH(EvalPoint1, (i), (F, "glEvalPoint1(%d);\n", i));
+}
+
+KEYWORD1 void KEYWORD2 NAME(EvalMesh2)(GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2)
+{
+ DISPATCH(EvalMesh2, (mode, i1, i2, j1, j2), (F, "glEvalMesh2(0x%x, %d, %d, %d, %d);\n", mode, i1, i2, j1, j2));
+}
+
+KEYWORD1 void KEYWORD2 NAME(EvalPoint2)(GLint i, GLint j)
+{
+ DISPATCH(EvalPoint2, (i, j), (F, "glEvalPoint2(%d, %d);\n", i, j));
+}
+
+KEYWORD1 void KEYWORD2 NAME(AlphaFunc)(GLenum func, GLclampf ref)
+{
+ DISPATCH(AlphaFunc, (func, ref), (F, "glAlphaFunc(0x%x, %f);\n", func, ref));
+}
+
+KEYWORD1 void KEYWORD2 NAME(BlendFunc)(GLenum sfactor, GLenum dfactor)
+{
+ DISPATCH(BlendFunc, (sfactor, dfactor), (F, "glBlendFunc(0x%x, 0x%x);\n", sfactor, dfactor));
+}
+
+KEYWORD1 void KEYWORD2 NAME(LogicOp)(GLenum opcode)
+{
+ DISPATCH(LogicOp, (opcode), (F, "glLogicOp(0x%x);\n", opcode));
+}
+
+KEYWORD1 void KEYWORD2 NAME(StencilFunc)(GLenum func, GLint ref, GLuint mask)
+{
+ DISPATCH(StencilFunc, (func, ref, mask), (F, "glStencilFunc(0x%x, %d, %d);\n", func, ref, mask));
+}
+
+KEYWORD1 void KEYWORD2 NAME(StencilOp)(GLenum fail, GLenum zfail, GLenum zpass)
+{
+ DISPATCH(StencilOp, (fail, zfail, zpass), (F, "glStencilOp(0x%x, 0x%x, 0x%x);\n", fail, zfail, zpass));
+}
+
+KEYWORD1 void KEYWORD2 NAME(DepthFunc)(GLenum func)
+{
+ DISPATCH(DepthFunc, (func), (F, "glDepthFunc(0x%x);\n", func));
+}
+
+KEYWORD1 void KEYWORD2 NAME(PixelZoom)(GLfloat xfactor, GLfloat yfactor)
+{
+ DISPATCH(PixelZoom, (xfactor, yfactor), (F, "glPixelZoom(%f, %f);\n", xfactor, yfactor));
+}
+
+KEYWORD1 void KEYWORD2 NAME(PixelTransferf)(GLenum pname, GLfloat param)
+{
+ DISPATCH(PixelTransferf, (pname, param), (F, "glPixelTransferf(0x%x, %f);\n", pname, param));
+}
+
+KEYWORD1 void KEYWORD2 NAME(PixelTransferi)(GLenum pname, GLint param)
+{
+ DISPATCH(PixelTransferi, (pname, param), (F, "glPixelTransferi(0x%x, %d);\n", pname, param));
+}
+
+KEYWORD1 void KEYWORD2 NAME(PixelStoref)(GLenum pname, GLfloat param)
+{
+ DISPATCH(PixelStoref, (pname, param), (F, "glPixelStoref(0x%x, %f);\n", pname, param));
+}
+
+KEYWORD1 void KEYWORD2 NAME(PixelStorei)(GLenum pname, GLint param)
+{
+ DISPATCH(PixelStorei, (pname, param), (F, "glPixelStorei(0x%x, %d);\n", pname, param));
+}
+
+KEYWORD1 void KEYWORD2 NAME(PixelMapfv)(GLenum map, GLsizei mapsize, const GLfloat * values)
+{
+ DISPATCH(PixelMapfv, (map, mapsize, values), (F, "glPixelMapfv(0x%x, %d, %p);\n", map, mapsize, (const void *) values));
+}
+
+KEYWORD1 void KEYWORD2 NAME(PixelMapuiv)(GLenum map, GLsizei mapsize, const GLuint * values)
+{
+ DISPATCH(PixelMapuiv, (map, mapsize, values), (F, "glPixelMapuiv(0x%x, %d, %p);\n", map, mapsize, (const void *) values));
+}
+
+KEYWORD1 void KEYWORD2 NAME(PixelMapusv)(GLenum map, GLsizei mapsize, const GLushort * values)
+{
+ DISPATCH(PixelMapusv, (map, mapsize, values), (F, "glPixelMapusv(0x%x, %d, %p);\n", map, mapsize, (const void *) values));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ReadBuffer)(GLenum mode)
+{
+ DISPATCH(ReadBuffer, (mode), (F, "glReadBuffer(0x%x);\n", mode));
+}
+
+KEYWORD1 void KEYWORD2 NAME(CopyPixels)(GLint x, GLint y, GLsizei width, GLsizei height, GLenum type)
+{
+ DISPATCH(CopyPixels, (x, y, width, height, type), (F, "glCopyPixels(%d, %d, %d, %d, 0x%x);\n", x, y, width, height, type));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ReadPixels)(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid * pixels)
+{
+ DISPATCH(ReadPixels, (x, y, width, height, format, type, pixels), (F, "glReadPixels(%d, %d, %d, %d, 0x%x, 0x%x, %p);\n", x, y, width, height, format, type, (const void *) pixels));
+}
+
+KEYWORD1 void KEYWORD2 NAME(DrawPixels)(GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * pixels)
+{
+ DISPATCH(DrawPixels, (width, height, format, type, pixels), (F, "glDrawPixels(%d, %d, 0x%x, 0x%x, %p);\n", width, height, format, type, (const void *) pixels));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetBooleanv)(GLenum pname, GLboolean * params)
+{
+ DISPATCH(GetBooleanv, (pname, params), (F, "glGetBooleanv(0x%x, %p);\n", pname, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetClipPlane)(GLenum plane, GLdouble * equation)
+{
+ DISPATCH(GetClipPlane, (plane, equation), (F, "glGetClipPlane(0x%x, %p);\n", plane, (const void *) equation));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetDoublev)(GLenum pname, GLdouble * params)
+{
+ DISPATCH(GetDoublev, (pname, params), (F, "glGetDoublev(0x%x, %p);\n", pname, (const void *) params));
+}
+
+KEYWORD1 GLenum KEYWORD2 NAME(GetError)(void)
+{
+ RETURN_DISPATCH(GetError, (), (F, "glGetError();\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetFloatv)(GLenum pname, GLfloat * params)
+{
+ DISPATCH(GetFloatv, (pname, params), (F, "glGetFloatv(0x%x, %p);\n", pname, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetIntegerv)(GLenum pname, GLint * params)
+{
+ DISPATCH(GetIntegerv, (pname, params), (F, "glGetIntegerv(0x%x, %p);\n", pname, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetLightfv)(GLenum light, GLenum pname, GLfloat * params)
+{
+ DISPATCH(GetLightfv, (light, pname, params), (F, "glGetLightfv(0x%x, 0x%x, %p);\n", light, pname, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetLightiv)(GLenum light, GLenum pname, GLint * params)
+{
+ DISPATCH(GetLightiv, (light, pname, params), (F, "glGetLightiv(0x%x, 0x%x, %p);\n", light, pname, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetMapdv)(GLenum target, GLenum query, GLdouble * v)
+{
+ DISPATCH(GetMapdv, (target, query, v), (F, "glGetMapdv(0x%x, 0x%x, %p);\n", target, query, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetMapfv)(GLenum target, GLenum query, GLfloat * v)
+{
+ DISPATCH(GetMapfv, (target, query, v), (F, "glGetMapfv(0x%x, 0x%x, %p);\n", target, query, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetMapiv)(GLenum target, GLenum query, GLint * v)
+{
+ DISPATCH(GetMapiv, (target, query, v), (F, "glGetMapiv(0x%x, 0x%x, %p);\n", target, query, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetMaterialfv)(GLenum face, GLenum pname, GLfloat * params)
+{
+ DISPATCH(GetMaterialfv, (face, pname, params), (F, "glGetMaterialfv(0x%x, 0x%x, %p);\n", face, pname, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetMaterialiv)(GLenum face, GLenum pname, GLint * params)
+{
+ DISPATCH(GetMaterialiv, (face, pname, params), (F, "glGetMaterialiv(0x%x, 0x%x, %p);\n", face, pname, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetPixelMapfv)(GLenum map, GLfloat * values)
+{
+ DISPATCH(GetPixelMapfv, (map, values), (F, "glGetPixelMapfv(0x%x, %p);\n", map, (const void *) values));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetPixelMapuiv)(GLenum map, GLuint * values)
+{
+ DISPATCH(GetPixelMapuiv, (map, values), (F, "glGetPixelMapuiv(0x%x, %p);\n", map, (const void *) values));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetPixelMapusv)(GLenum map, GLushort * values)
+{
+ DISPATCH(GetPixelMapusv, (map, values), (F, "glGetPixelMapusv(0x%x, %p);\n", map, (const void *) values));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetPolygonStipple)(GLubyte * mask)
+{
+ DISPATCH(GetPolygonStipple, (mask), (F, "glGetPolygonStipple(%p);\n", (const void *) mask));
+}
+
+KEYWORD1 const GLubyte * KEYWORD2 NAME(GetString)(GLenum name)
+{
+ RETURN_DISPATCH(GetString, (name), (F, "glGetString(0x%x);\n", name));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetTexEnvfv)(GLenum target, GLenum pname, GLfloat * params)
+{
+ DISPATCH(GetTexEnvfv, (target, pname, params), (F, "glGetTexEnvfv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetTexEnviv)(GLenum target, GLenum pname, GLint * params)
+{
+ DISPATCH(GetTexEnviv, (target, pname, params), (F, "glGetTexEnviv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetTexGendv)(GLenum coord, GLenum pname, GLdouble * params)
+{
+ DISPATCH(GetTexGendv, (coord, pname, params), (F, "glGetTexGendv(0x%x, 0x%x, %p);\n", coord, pname, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetTexGenfv)(GLenum coord, GLenum pname, GLfloat * params)
+{
+ DISPATCH(GetTexGenfv, (coord, pname, params), (F, "glGetTexGenfv(0x%x, 0x%x, %p);\n", coord, pname, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetTexGeniv)(GLenum coord, GLenum pname, GLint * params)
+{
+ DISPATCH(GetTexGeniv, (coord, pname, params), (F, "glGetTexGeniv(0x%x, 0x%x, %p);\n", coord, pname, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetTexImage)(GLenum target, GLint level, GLenum format, GLenum type, GLvoid * pixels)
+{
+ DISPATCH(GetTexImage, (target, level, format, type, pixels), (F, "glGetTexImage(0x%x, %d, 0x%x, 0x%x, %p);\n", target, level, format, type, (const void *) pixels));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetTexParameterfv)(GLenum target, GLenum pname, GLfloat * params)
+{
+ DISPATCH(GetTexParameterfv, (target, pname, params), (F, "glGetTexParameterfv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetTexParameteriv)(GLenum target, GLenum pname, GLint * params)
+{
+ DISPATCH(GetTexParameteriv, (target, pname, params), (F, "glGetTexParameteriv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetTexLevelParameterfv)(GLenum target, GLint level, GLenum pname, GLfloat * params)
+{
+ DISPATCH(GetTexLevelParameterfv, (target, level, pname, params), (F, "glGetTexLevelParameterfv(0x%x, %d, 0x%x, %p);\n", target, level, pname, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetTexLevelParameteriv)(GLenum target, GLint level, GLenum pname, GLint * params)
+{
+ DISPATCH(GetTexLevelParameteriv, (target, level, pname, params), (F, "glGetTexLevelParameteriv(0x%x, %d, 0x%x, %p);\n", target, level, pname, (const void *) params));
+}
+
+KEYWORD1 GLboolean KEYWORD2 NAME(IsEnabled)(GLenum cap)
+{
+ RETURN_DISPATCH(IsEnabled, (cap), (F, "glIsEnabled(0x%x);\n", cap));
+}
+
+KEYWORD1 GLboolean KEYWORD2 NAME(IsList)(GLuint list)
+{
+ RETURN_DISPATCH(IsList, (list), (F, "glIsList(%d);\n", list));
+}
+
+KEYWORD1 void KEYWORD2 NAME(DepthRange)(GLclampd zNear, GLclampd zFar)
+{
+ DISPATCH(DepthRange, (zNear, zFar), (F, "glDepthRange(%f, %f);\n", zNear, zFar));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Frustum)(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar)
+{
+ DISPATCH(Frustum, (left, right, bottom, top, zNear, zFar), (F, "glFrustum(%f, %f, %f, %f, %f, %f);\n", left, right, bottom, top, zNear, zFar));
+}
+
+KEYWORD1 void KEYWORD2 NAME(LoadIdentity)(void)
+{
+ DISPATCH(LoadIdentity, (), (F, "glLoadIdentity();\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(LoadMatrixf)(const GLfloat * m)
+{
+ DISPATCH(LoadMatrixf, (m), (F, "glLoadMatrixf(%p);\n", (const void *) m));
+}
+
+KEYWORD1 void KEYWORD2 NAME(LoadMatrixd)(const GLdouble * m)
+{
+ DISPATCH(LoadMatrixd, (m), (F, "glLoadMatrixd(%p);\n", (const void *) m));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MatrixMode)(GLenum mode)
+{
+ DISPATCH(MatrixMode, (mode), (F, "glMatrixMode(0x%x);\n", mode));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultMatrixf)(const GLfloat * m)
+{
+ DISPATCH(MultMatrixf, (m), (F, "glMultMatrixf(%p);\n", (const void *) m));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultMatrixd)(const GLdouble * m)
+{
+ DISPATCH(MultMatrixd, (m), (F, "glMultMatrixd(%p);\n", (const void *) m));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Ortho)(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar)
+{
+ DISPATCH(Ortho, (left, right, bottom, top, zNear, zFar), (F, "glOrtho(%f, %f, %f, %f, %f, %f);\n", left, right, bottom, top, zNear, zFar));
+}
+
+KEYWORD1 void KEYWORD2 NAME(PopMatrix)(void)
+{
+ DISPATCH(PopMatrix, (), (F, "glPopMatrix();\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(PushMatrix)(void)
+{
+ DISPATCH(PushMatrix, (), (F, "glPushMatrix();\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Rotated)(GLdouble angle, GLdouble x, GLdouble y, GLdouble z)
+{
+ DISPATCH(Rotated, (angle, x, y, z), (F, "glRotated(%f, %f, %f, %f);\n", angle, x, y, z));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Rotatef)(GLfloat angle, GLfloat x, GLfloat y, GLfloat z)
+{
+ DISPATCH(Rotatef, (angle, x, y, z), (F, "glRotatef(%f, %f, %f, %f);\n", angle, x, y, z));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Scaled)(GLdouble x, GLdouble y, GLdouble z)
+{
+ DISPATCH(Scaled, (x, y, z), (F, "glScaled(%f, %f, %f);\n", x, y, z));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Scalef)(GLfloat x, GLfloat y, GLfloat z)
+{
+ DISPATCH(Scalef, (x, y, z), (F, "glScalef(%f, %f, %f);\n", x, y, z));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Translated)(GLdouble x, GLdouble y, GLdouble z)
+{
+ DISPATCH(Translated, (x, y, z), (F, "glTranslated(%f, %f, %f);\n", x, y, z));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Translatef)(GLfloat x, GLfloat y, GLfloat z)
+{
+ DISPATCH(Translatef, (x, y, z), (F, "glTranslatef(%f, %f, %f);\n", x, y, z));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Viewport)(GLint x, GLint y, GLsizei width, GLsizei height)
+{
+ DISPATCH(Viewport, (x, y, width, height), (F, "glViewport(%d, %d, %d, %d);\n", x, y, width, height));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ArrayElement)(GLint i)
+{
+ DISPATCH(ArrayElement, (i), (F, "glArrayElement(%d);\n", i));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ArrayElementEXT)(GLint i)
+{
+ DISPATCH(ArrayElement, (i), (F, "glArrayElementEXT(%d);\n", i));
+}
+
+KEYWORD1 void KEYWORD2 NAME(BindTexture)(GLenum target, GLuint texture)
+{
+ DISPATCH(BindTexture, (target, texture), (F, "glBindTexture(0x%x, %d);\n", target, texture));
+}
+
+KEYWORD1 void KEYWORD2 NAME(BindTextureEXT)(GLenum target, GLuint texture)
+{
+ DISPATCH(BindTexture, (target, texture), (F, "glBindTextureEXT(0x%x, %d);\n", target, texture));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ColorPointer)(GLint size, GLenum type, GLsizei stride, const GLvoid * pointer)
+{
+ DISPATCH(ColorPointer, (size, type, stride, pointer), (F, "glColorPointer(%d, 0x%x, %d, %p);\n", size, type, stride, (const void *) pointer));
+}
+
+KEYWORD1 void KEYWORD2 NAME(DisableClientState)(GLenum array)
+{
+ DISPATCH(DisableClientState, (array), (F, "glDisableClientState(0x%x);\n", array));
+}
+
+KEYWORD1 void KEYWORD2 NAME(DrawArrays)(GLenum mode, GLint first, GLsizei count)
+{
+ DISPATCH(DrawArrays, (mode, first, count), (F, "glDrawArrays(0x%x, %d, %d);\n", mode, first, count));
+}
+
+KEYWORD1 void KEYWORD2 NAME(DrawArraysEXT)(GLenum mode, GLint first, GLsizei count)
+{
+ DISPATCH(DrawArrays, (mode, first, count), (F, "glDrawArraysEXT(0x%x, %d, %d);\n", mode, first, count));
+}
+
+KEYWORD1 void KEYWORD2 NAME(DrawElements)(GLenum mode, GLsizei count, GLenum type, const GLvoid * indices)
+{
+ DISPATCH(DrawElements, (mode, count, type, indices), (F, "glDrawElements(0x%x, %d, 0x%x, %p);\n", mode, count, type, (const void *) indices));
+}
+
+KEYWORD1 void KEYWORD2 NAME(EdgeFlagPointer)(GLsizei stride, const GLvoid * pointer)
+{
+ DISPATCH(EdgeFlagPointer, (stride, pointer), (F, "glEdgeFlagPointer(%d, %p);\n", stride, (const void *) pointer));
+}
+
+KEYWORD1 void KEYWORD2 NAME(EnableClientState)(GLenum array)
+{
+ DISPATCH(EnableClientState, (array), (F, "glEnableClientState(0x%x);\n", array));
+}
+
+KEYWORD1 void KEYWORD2 NAME(IndexPointer)(GLenum type, GLsizei stride, const GLvoid * pointer)
+{
+ DISPATCH(IndexPointer, (type, stride, pointer), (F, "glIndexPointer(0x%x, %d, %p);\n", type, stride, (const void *) pointer));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Indexub)(GLubyte c)
+{
+ DISPATCH(Indexub, (c), (F, "glIndexub(%d);\n", c));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Indexubv)(const GLubyte * c)
+{
+ DISPATCH(Indexubv, (c), (F, "glIndexubv(%p);\n", (const void *) c));
+}
+
+KEYWORD1 void KEYWORD2 NAME(InterleavedArrays)(GLenum format, GLsizei stride, const GLvoid * pointer)
+{
+ DISPATCH(InterleavedArrays, (format, stride, pointer), (F, "glInterleavedArrays(0x%x, %d, %p);\n", format, stride, (const void *) pointer));
+}
+
+KEYWORD1 void KEYWORD2 NAME(NormalPointer)(GLenum type, GLsizei stride, const GLvoid * pointer)
+{
+ DISPATCH(NormalPointer, (type, stride, pointer), (F, "glNormalPointer(0x%x, %d, %p);\n", type, stride, (const void *) pointer));
+}
+
+KEYWORD1 void KEYWORD2 NAME(PolygonOffset)(GLfloat factor, GLfloat units)
+{
+ DISPATCH(PolygonOffset, (factor, units), (F, "glPolygonOffset(%f, %f);\n", factor, units));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TexCoordPointer)(GLint size, GLenum type, GLsizei stride, const GLvoid * pointer)
+{
+ DISPATCH(TexCoordPointer, (size, type, stride, pointer), (F, "glTexCoordPointer(%d, 0x%x, %d, %p);\n", size, type, stride, (const void *) pointer));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexPointer)(GLint size, GLenum type, GLsizei stride, const GLvoid * pointer)
+{
+ DISPATCH(VertexPointer, (size, type, stride, pointer), (F, "glVertexPointer(%d, 0x%x, %d, %p);\n", size, type, stride, (const void *) pointer));
+}
+
+KEYWORD1 GLboolean KEYWORD2 NAME(AreTexturesResident)(GLsizei n, const GLuint * textures, GLboolean * residences)
+{
+ RETURN_DISPATCH(AreTexturesResident, (n, textures, residences), (F, "glAreTexturesResident(%d, %p, %p);\n", n, (const void *) textures, (const void *) residences));
+}
+
+KEYWORD1 void KEYWORD2 NAME(CopyTexImage1D)(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border)
+{
+ DISPATCH(CopyTexImage1D, (target, level, internalformat, x, y, width, border), (F, "glCopyTexImage1D(0x%x, %d, 0x%x, %d, %d, %d, %d);\n", target, level, internalformat, x, y, width, border));
+}
+
+KEYWORD1 void KEYWORD2 NAME(CopyTexImage1DEXT)(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border)
+{
+ DISPATCH(CopyTexImage1D, (target, level, internalformat, x, y, width, border), (F, "glCopyTexImage1DEXT(0x%x, %d, 0x%x, %d, %d, %d, %d);\n", target, level, internalformat, x, y, width, border));
+}
+
+KEYWORD1 void KEYWORD2 NAME(CopyTexImage2D)(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border)
+{
+ DISPATCH(CopyTexImage2D, (target, level, internalformat, x, y, width, height, border), (F, "glCopyTexImage2D(0x%x, %d, 0x%x, %d, %d, %d, %d, %d);\n", target, level, internalformat, x, y, width, height, border));
+}
+
+KEYWORD1 void KEYWORD2 NAME(CopyTexImage2DEXT)(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border)
+{
+ DISPATCH(CopyTexImage2D, (target, level, internalformat, x, y, width, height, border), (F, "glCopyTexImage2DEXT(0x%x, %d, 0x%x, %d, %d, %d, %d, %d);\n", target, level, internalformat, x, y, width, height, border));
+}
+
+KEYWORD1 void KEYWORD2 NAME(CopyTexSubImage1D)(GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width)
+{
+ DISPATCH(CopyTexSubImage1D, (target, level, xoffset, x, y, width), (F, "glCopyTexSubImage1D(0x%x, %d, %d, %d, %d, %d);\n", target, level, xoffset, x, y, width));
+}
+
+KEYWORD1 void KEYWORD2 NAME(CopyTexSubImage1DEXT)(GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width)
+{
+ DISPATCH(CopyTexSubImage1D, (target, level, xoffset, x, y, width), (F, "glCopyTexSubImage1DEXT(0x%x, %d, %d, %d, %d, %d);\n", target, level, xoffset, x, y, width));
+}
+
+KEYWORD1 void KEYWORD2 NAME(CopyTexSubImage2D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height)
+{
+ DISPATCH(CopyTexSubImage2D, (target, level, xoffset, yoffset, x, y, width, height), (F, "glCopyTexSubImage2D(0x%x, %d, %d, %d, %d, %d, %d, %d);\n", target, level, xoffset, yoffset, x, y, width, height));
+}
+
+KEYWORD1 void KEYWORD2 NAME(CopyTexSubImage2DEXT)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height)
+{
+ DISPATCH(CopyTexSubImage2D, (target, level, xoffset, yoffset, x, y, width, height), (F, "glCopyTexSubImage2DEXT(0x%x, %d, %d, %d, %d, %d, %d, %d);\n", target, level, xoffset, yoffset, x, y, width, height));
+}
+
+KEYWORD1 void KEYWORD2 NAME(DeleteTextures)(GLsizei n, const GLuint * textures)
+{
+ DISPATCH(DeleteTextures, (n, textures), (F, "glDeleteTextures(%d, %p);\n", n, (const void *) textures));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GenTextures)(GLsizei n, GLuint * textures)
+{
+ DISPATCH(GenTextures, (n, textures), (F, "glGenTextures(%d, %p);\n", n, (const void *) textures));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetPointerv)(GLenum pname, GLvoid ** params)
+{
+ DISPATCH(GetPointerv, (pname, params), (F, "glGetPointerv(0x%x, %p);\n", pname, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetPointervEXT)(GLenum pname, GLvoid ** params)
+{
+ DISPATCH(GetPointerv, (pname, params), (F, "glGetPointervEXT(0x%x, %p);\n", pname, (const void *) params));
+}
+
+KEYWORD1 GLboolean KEYWORD2 NAME(IsTexture)(GLuint texture)
+{
+ RETURN_DISPATCH(IsTexture, (texture), (F, "glIsTexture(%d);\n", texture));
+}
+
+KEYWORD1 void KEYWORD2 NAME(PrioritizeTextures)(GLsizei n, const GLuint * textures, const GLclampf * priorities)
+{
+ DISPATCH(PrioritizeTextures, (n, textures, priorities), (F, "glPrioritizeTextures(%d, %p, %p);\n", n, (const void *) textures, (const void *) priorities));
+}
+
+KEYWORD1 void KEYWORD2 NAME(PrioritizeTexturesEXT)(GLsizei n, const GLuint * textures, const GLclampf * priorities)
+{
+ DISPATCH(PrioritizeTextures, (n, textures, priorities), (F, "glPrioritizeTexturesEXT(%d, %p, %p);\n", n, (const void *) textures, (const void *) priorities));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TexSubImage1D)(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid * pixels)
+{
+ DISPATCH(TexSubImage1D, (target, level, xoffset, width, format, type, pixels), (F, "glTexSubImage1D(0x%x, %d, %d, %d, 0x%x, 0x%x, %p);\n", target, level, xoffset, width, format, type, (const void *) pixels));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TexSubImage1DEXT)(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid * pixels)
+{
+ DISPATCH(TexSubImage1D, (target, level, xoffset, width, format, type, pixels), (F, "glTexSubImage1DEXT(0x%x, %d, %d, %d, 0x%x, 0x%x, %p);\n", target, level, xoffset, width, format, type, (const void *) pixels));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TexSubImage2D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * pixels)
+{
+ DISPATCH(TexSubImage2D, (target, level, xoffset, yoffset, width, height, format, type, pixels), (F, "glTexSubImage2D(0x%x, %d, %d, %d, %d, %d, 0x%x, 0x%x, %p);\n", target, level, xoffset, yoffset, width, height, format, type, (const void *) pixels));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TexSubImage2DEXT)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * pixels)
+{
+ DISPATCH(TexSubImage2D, (target, level, xoffset, yoffset, width, height, format, type, pixels), (F, "glTexSubImage2DEXT(0x%x, %d, %d, %d, %d, %d, 0x%x, 0x%x, %p);\n", target, level, xoffset, yoffset, width, height, format, type, (const void *) pixels));
+}
+
+KEYWORD1 void KEYWORD2 NAME(PopClientAttrib)(void)
+{
+ DISPATCH(PopClientAttrib, (), (F, "glPopClientAttrib();\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(PushClientAttrib)(GLbitfield mask)
+{
+ DISPATCH(PushClientAttrib, (mask), (F, "glPushClientAttrib(%d);\n", mask));
+}
+
+KEYWORD1 void KEYWORD2 NAME(BlendColor)(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha)
+{
+ DISPATCH(BlendColor, (red, green, blue, alpha), (F, "glBlendColor(%f, %f, %f, %f);\n", red, green, blue, alpha));
+}
+
+KEYWORD1 void KEYWORD2 NAME(BlendColorEXT)(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha)
+{
+ DISPATCH(BlendColor, (red, green, blue, alpha), (F, "glBlendColorEXT(%f, %f, %f, %f);\n", red, green, blue, alpha));
+}
+
+KEYWORD1 void KEYWORD2 NAME(BlendEquation)(GLenum mode)
+{
+ DISPATCH(BlendEquation, (mode), (F, "glBlendEquation(0x%x);\n", mode));
+}
+
+KEYWORD1 void KEYWORD2 NAME(BlendEquationEXT)(GLenum mode)
+{
+ DISPATCH(BlendEquation, (mode), (F, "glBlendEquationEXT(0x%x);\n", mode));
+}
+
+KEYWORD1 void KEYWORD2 NAME(DrawRangeElements)(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid * indices)
+{
+ DISPATCH(DrawRangeElements, (mode, start, end, count, type, indices), (F, "glDrawRangeElements(0x%x, %d, %d, %d, 0x%x, %p);\n", mode, start, end, count, type, (const void *) indices));
+}
+
+KEYWORD1 void KEYWORD2 NAME(DrawRangeElementsEXT)(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid * indices)
+{
+ DISPATCH(DrawRangeElements, (mode, start, end, count, type, indices), (F, "glDrawRangeElementsEXT(0x%x, %d, %d, %d, 0x%x, %p);\n", mode, start, end, count, type, (const void *) indices));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ColorTable)(GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid * table)
+{
+ DISPATCH(ColorTable, (target, internalformat, width, format, type, table), (F, "glColorTable(0x%x, 0x%x, %d, 0x%x, 0x%x, %p);\n", target, internalformat, width, format, type, (const void *) table));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ColorTableEXT)(GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid * table)
+{
+ DISPATCH(ColorTable, (target, internalformat, width, format, type, table), (F, "glColorTableEXT(0x%x, 0x%x, %d, 0x%x, 0x%x, %p);\n", target, internalformat, width, format, type, (const void *) table));
+}
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_339)(GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid * table);
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_339)(GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid * table)
+{
+ DISPATCH(ColorTable, (target, internalformat, width, format, type, table), (F, "glColorTableSGI(0x%x, 0x%x, %d, 0x%x, 0x%x, %p);\n", target, internalformat, width, format, type, (const void *) table));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ColorTableParameterfv)(GLenum target, GLenum pname, const GLfloat * params)
+{
+ DISPATCH(ColorTableParameterfv, (target, pname, params), (F, "glColorTableParameterfv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
+}
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_340)(GLenum target, GLenum pname, const GLfloat * params);
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_340)(GLenum target, GLenum pname, const GLfloat * params)
+{
+ DISPATCH(ColorTableParameterfv, (target, pname, params), (F, "glColorTableParameterfvSGI(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ColorTableParameteriv)(GLenum target, GLenum pname, const GLint * params)
+{
+ DISPATCH(ColorTableParameteriv, (target, pname, params), (F, "glColorTableParameteriv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
+}
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_341)(GLenum target, GLenum pname, const GLint * params);
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_341)(GLenum target, GLenum pname, const GLint * params)
+{
+ DISPATCH(ColorTableParameteriv, (target, pname, params), (F, "glColorTableParameterivSGI(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(CopyColorTable)(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width)
+{
+ DISPATCH(CopyColorTable, (target, internalformat, x, y, width), (F, "glCopyColorTable(0x%x, 0x%x, %d, %d, %d);\n", target, internalformat, x, y, width));
+}
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_342)(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width);
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_342)(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width)
+{
+ DISPATCH(CopyColorTable, (target, internalformat, x, y, width), (F, "glCopyColorTableSGI(0x%x, 0x%x, %d, %d, %d);\n", target, internalformat, x, y, width));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetColorTable)(GLenum target, GLenum format, GLenum type, GLvoid * table)
+{
+ DISPATCH(GetColorTable, (target, format, type, table), (F, "glGetColorTable(0x%x, 0x%x, 0x%x, %p);\n", target, format, type, (const void *) table));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetColorTableParameterfv)(GLenum target, GLenum pname, GLfloat * params)
+{
+ DISPATCH(GetColorTableParameterfv, (target, pname, params), (F, "glGetColorTableParameterfv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetColorTableParameteriv)(GLenum target, GLenum pname, GLint * params)
+{
+ DISPATCH(GetColorTableParameteriv, (target, pname, params), (F, "glGetColorTableParameteriv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ColorSubTable)(GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid * data)
+{
+ DISPATCH(ColorSubTable, (target, start, count, format, type, data), (F, "glColorSubTable(0x%x, %d, %d, 0x%x, 0x%x, %p);\n", target, start, count, format, type, (const void *) data));
+}
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_346)(GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid * data);
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_346)(GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid * data)
+{
+ DISPATCH(ColorSubTable, (target, start, count, format, type, data), (F, "glColorSubTableEXT(0x%x, %d, %d, 0x%x, 0x%x, %p);\n", target, start, count, format, type, (const void *) data));
+}
+
+KEYWORD1 void KEYWORD2 NAME(CopyColorSubTable)(GLenum target, GLsizei start, GLint x, GLint y, GLsizei width)
+{
+ DISPATCH(CopyColorSubTable, (target, start, x, y, width), (F, "glCopyColorSubTable(0x%x, %d, %d, %d, %d);\n", target, start, x, y, width));
+}
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_347)(GLenum target, GLsizei start, GLint x, GLint y, GLsizei width);
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_347)(GLenum target, GLsizei start, GLint x, GLint y, GLsizei width)
+{
+ DISPATCH(CopyColorSubTable, (target, start, x, y, width), (F, "glCopyColorSubTableEXT(0x%x, %d, %d, %d, %d);\n", target, start, x, y, width));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ConvolutionFilter1D)(GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid * image)
+{
+ DISPATCH(ConvolutionFilter1D, (target, internalformat, width, format, type, image), (F, "glConvolutionFilter1D(0x%x, 0x%x, %d, 0x%x, 0x%x, %p);\n", target, internalformat, width, format, type, (const void *) image));
+}
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_348)(GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid * image);
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_348)(GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid * image)
+{
+ DISPATCH(ConvolutionFilter1D, (target, internalformat, width, format, type, image), (F, "glConvolutionFilter1DEXT(0x%x, 0x%x, %d, 0x%x, 0x%x, %p);\n", target, internalformat, width, format, type, (const void *) image));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ConvolutionFilter2D)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * image)
+{
+ DISPATCH(ConvolutionFilter2D, (target, internalformat, width, height, format, type, image), (F, "glConvolutionFilter2D(0x%x, 0x%x, %d, %d, 0x%x, 0x%x, %p);\n", target, internalformat, width, height, format, type, (const void *) image));
+}
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_349)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * image);
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_349)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * image)
+{
+ DISPATCH(ConvolutionFilter2D, (target, internalformat, width, height, format, type, image), (F, "glConvolutionFilter2DEXT(0x%x, 0x%x, %d, %d, 0x%x, 0x%x, %p);\n", target, internalformat, width, height, format, type, (const void *) image));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ConvolutionParameterf)(GLenum target, GLenum pname, GLfloat params)
+{
+ DISPATCH(ConvolutionParameterf, (target, pname, params), (F, "glConvolutionParameterf(0x%x, 0x%x, %f);\n", target, pname, params));
+}
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_350)(GLenum target, GLenum pname, GLfloat params);
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_350)(GLenum target, GLenum pname, GLfloat params)
+{
+ DISPATCH(ConvolutionParameterf, (target, pname, params), (F, "glConvolutionParameterfEXT(0x%x, 0x%x, %f);\n", target, pname, params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ConvolutionParameterfv)(GLenum target, GLenum pname, const GLfloat * params)
+{
+ DISPATCH(ConvolutionParameterfv, (target, pname, params), (F, "glConvolutionParameterfv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
+}
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_351)(GLenum target, GLenum pname, const GLfloat * params);
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_351)(GLenum target, GLenum pname, const GLfloat * params)
+{
+ DISPATCH(ConvolutionParameterfv, (target, pname, params), (F, "glConvolutionParameterfvEXT(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ConvolutionParameteri)(GLenum target, GLenum pname, GLint params)
+{
+ DISPATCH(ConvolutionParameteri, (target, pname, params), (F, "glConvolutionParameteri(0x%x, 0x%x, %d);\n", target, pname, params));
+}
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_352)(GLenum target, GLenum pname, GLint params);
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_352)(GLenum target, GLenum pname, GLint params)
+{
+ DISPATCH(ConvolutionParameteri, (target, pname, params), (F, "glConvolutionParameteriEXT(0x%x, 0x%x, %d);\n", target, pname, params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ConvolutionParameteriv)(GLenum target, GLenum pname, const GLint * params)
+{
+ DISPATCH(ConvolutionParameteriv, (target, pname, params), (F, "glConvolutionParameteriv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
+}
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_353)(GLenum target, GLenum pname, const GLint * params);
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_353)(GLenum target, GLenum pname, const GLint * params)
+{
+ DISPATCH(ConvolutionParameteriv, (target, pname, params), (F, "glConvolutionParameterivEXT(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(CopyConvolutionFilter1D)(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width)
+{
+ DISPATCH(CopyConvolutionFilter1D, (target, internalformat, x, y, width), (F, "glCopyConvolutionFilter1D(0x%x, 0x%x, %d, %d, %d);\n", target, internalformat, x, y, width));
+}
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_354)(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width);
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_354)(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width)
+{
+ DISPATCH(CopyConvolutionFilter1D, (target, internalformat, x, y, width), (F, "glCopyConvolutionFilter1DEXT(0x%x, 0x%x, %d, %d, %d);\n", target, internalformat, x, y, width));
+}
+
+KEYWORD1 void KEYWORD2 NAME(CopyConvolutionFilter2D)(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height)
+{
+ DISPATCH(CopyConvolutionFilter2D, (target, internalformat, x, y, width, height), (F, "glCopyConvolutionFilter2D(0x%x, 0x%x, %d, %d, %d, %d);\n", target, internalformat, x, y, width, height));
+}
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_355)(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height);
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_355)(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height)
+{
+ DISPATCH(CopyConvolutionFilter2D, (target, internalformat, x, y, width, height), (F, "glCopyConvolutionFilter2DEXT(0x%x, 0x%x, %d, %d, %d, %d);\n", target, internalformat, x, y, width, height));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetConvolutionFilter)(GLenum target, GLenum format, GLenum type, GLvoid * image)
+{
+ DISPATCH(GetConvolutionFilter, (target, format, type, image), (F, "glGetConvolutionFilter(0x%x, 0x%x, 0x%x, %p);\n", target, format, type, (const void *) image));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetConvolutionParameterfv)(GLenum target, GLenum pname, GLfloat * params)
+{
+ DISPATCH(GetConvolutionParameterfv, (target, pname, params), (F, "glGetConvolutionParameterfv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetConvolutionParameteriv)(GLenum target, GLenum pname, GLint * params)
+{
+ DISPATCH(GetConvolutionParameteriv, (target, pname, params), (F, "glGetConvolutionParameteriv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetSeparableFilter)(GLenum target, GLenum format, GLenum type, GLvoid * row, GLvoid * column, GLvoid * span)
+{
+ DISPATCH(GetSeparableFilter, (target, format, type, row, column, span), (F, "glGetSeparableFilter(0x%x, 0x%x, 0x%x, %p, %p, %p);\n", target, format, type, (const void *) row, (const void *) column, (const void *) span));
+}
+
+KEYWORD1 void KEYWORD2 NAME(SeparableFilter2D)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * row, const GLvoid * column)
+{
+ DISPATCH(SeparableFilter2D, (target, internalformat, width, height, format, type, row, column), (F, "glSeparableFilter2D(0x%x, 0x%x, %d, %d, 0x%x, 0x%x, %p, %p);\n", target, internalformat, width, height, format, type, (const void *) row, (const void *) column));
+}
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_360)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * row, const GLvoid * column);
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_360)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * row, const GLvoid * column)
+{
+ DISPATCH(SeparableFilter2D, (target, internalformat, width, height, format, type, row, column), (F, "glSeparableFilter2DEXT(0x%x, 0x%x, %d, %d, 0x%x, 0x%x, %p, %p);\n", target, internalformat, width, height, format, type, (const void *) row, (const void *) column));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetHistogram)(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid * values)
+{
+ DISPATCH(GetHistogram, (target, reset, format, type, values), (F, "glGetHistogram(0x%x, %d, 0x%x, 0x%x, %p);\n", target, reset, format, type, (const void *) values));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetHistogramParameterfv)(GLenum target, GLenum pname, GLfloat * params)
+{
+ DISPATCH(GetHistogramParameterfv, (target, pname, params), (F, "glGetHistogramParameterfv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetHistogramParameteriv)(GLenum target, GLenum pname, GLint * params)
+{
+ DISPATCH(GetHistogramParameteriv, (target, pname, params), (F, "glGetHistogramParameteriv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetMinmax)(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid * values)
+{
+ DISPATCH(GetMinmax, (target, reset, format, type, values), (F, "glGetMinmax(0x%x, %d, 0x%x, 0x%x, %p);\n", target, reset, format, type, (const void *) values));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetMinmaxParameterfv)(GLenum target, GLenum pname, GLfloat * params)
+{
+ DISPATCH(GetMinmaxParameterfv, (target, pname, params), (F, "glGetMinmaxParameterfv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetMinmaxParameteriv)(GLenum target, GLenum pname, GLint * params)
+{
+ DISPATCH(GetMinmaxParameteriv, (target, pname, params), (F, "glGetMinmaxParameteriv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Histogram)(GLenum target, GLsizei width, GLenum internalformat, GLboolean sink)
+{
+ DISPATCH(Histogram, (target, width, internalformat, sink), (F, "glHistogram(0x%x, %d, 0x%x, %d);\n", target, width, internalformat, sink));
+}
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_367)(GLenum target, GLsizei width, GLenum internalformat, GLboolean sink);
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_367)(GLenum target, GLsizei width, GLenum internalformat, GLboolean sink)
+{
+ DISPATCH(Histogram, (target, width, internalformat, sink), (F, "glHistogramEXT(0x%x, %d, 0x%x, %d);\n", target, width, internalformat, sink));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Minmax)(GLenum target, GLenum internalformat, GLboolean sink)
+{
+ DISPATCH(Minmax, (target, internalformat, sink), (F, "glMinmax(0x%x, 0x%x, %d);\n", target, internalformat, sink));
+}
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_368)(GLenum target, GLenum internalformat, GLboolean sink);
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_368)(GLenum target, GLenum internalformat, GLboolean sink)
+{
+ DISPATCH(Minmax, (target, internalformat, sink), (F, "glMinmaxEXT(0x%x, 0x%x, %d);\n", target, internalformat, sink));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ResetHistogram)(GLenum target)
+{
+ DISPATCH(ResetHistogram, (target), (F, "glResetHistogram(0x%x);\n", target));
+}
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_369)(GLenum target);
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_369)(GLenum target)
+{
+ DISPATCH(ResetHistogram, (target), (F, "glResetHistogramEXT(0x%x);\n", target));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ResetMinmax)(GLenum target)
+{
+ DISPATCH(ResetMinmax, (target), (F, "glResetMinmax(0x%x);\n", target));
+}
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_370)(GLenum target);
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_370)(GLenum target)
+{
+ DISPATCH(ResetMinmax, (target), (F, "glResetMinmaxEXT(0x%x);\n", target));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TexImage3D)(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid * pixels)
+{
+ DISPATCH(TexImage3D, (target, level, internalformat, width, height, depth, border, format, type, pixels), (F, "glTexImage3D(0x%x, %d, %d, %d, %d, %d, %d, 0x%x, 0x%x, %p);\n", target, level, internalformat, width, height, depth, border, format, type, (const void *) pixels));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TexImage3DEXT)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid * pixels)
+{
+ DISPATCH(TexImage3D, (target, level, internalformat, width, height, depth, border, format, type, pixels), (F, "glTexImage3DEXT(0x%x, %d, %d, %d, %d, %d, %d, 0x%x, 0x%x, %p);\n", target, level, internalformat, width, height, depth, border, format, type, (const void *) pixels));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TexSubImage3D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid * pixels)
+{
+ DISPATCH(TexSubImage3D, (target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels), (F, "glTexSubImage3D(0x%x, %d, %d, %d, %d, %d, %d, %d, 0x%x, 0x%x, %p);\n", target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, (const void *) pixels));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TexSubImage3DEXT)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid * pixels)
+{
+ DISPATCH(TexSubImage3D, (target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels), (F, "glTexSubImage3DEXT(0x%x, %d, %d, %d, %d, %d, %d, %d, 0x%x, 0x%x, %p);\n", target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, (const void *) pixels));
+}
+
+KEYWORD1 void KEYWORD2 NAME(CopyTexSubImage3D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height)
+{
+ DISPATCH(CopyTexSubImage3D, (target, level, xoffset, yoffset, zoffset, x, y, width, height), (F, "glCopyTexSubImage3D(0x%x, %d, %d, %d, %d, %d, %d, %d, %d);\n", target, level, xoffset, yoffset, zoffset, x, y, width, height));
+}
+
+KEYWORD1 void KEYWORD2 NAME(CopyTexSubImage3DEXT)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height)
+{
+ DISPATCH(CopyTexSubImage3D, (target, level, xoffset, yoffset, zoffset, x, y, width, height), (F, "glCopyTexSubImage3DEXT(0x%x, %d, %d, %d, %d, %d, %d, %d, %d);\n", target, level, xoffset, yoffset, zoffset, x, y, width, height));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ActiveTexture)(GLenum texture)
+{
+ DISPATCH(ActiveTextureARB, (texture), (F, "glActiveTexture(0x%x);\n", texture));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ActiveTextureARB)(GLenum texture)
+{
+ DISPATCH(ActiveTextureARB, (texture), (F, "glActiveTextureARB(0x%x);\n", texture));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ClientActiveTexture)(GLenum texture)
+{
+ DISPATCH(ClientActiveTextureARB, (texture), (F, "glClientActiveTexture(0x%x);\n", texture));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ClientActiveTextureARB)(GLenum texture)
+{
+ DISPATCH(ClientActiveTextureARB, (texture), (F, "glClientActiveTextureARB(0x%x);\n", texture));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord1d)(GLenum target, GLdouble s)
+{
+ DISPATCH(MultiTexCoord1dARB, (target, s), (F, "glMultiTexCoord1d(0x%x, %f);\n", target, s));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord1dARB)(GLenum target, GLdouble s)
+{
+ DISPATCH(MultiTexCoord1dARB, (target, s), (F, "glMultiTexCoord1dARB(0x%x, %f);\n", target, s));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord1dv)(GLenum target, const GLdouble * v)
+{
+ DISPATCH(MultiTexCoord1dvARB, (target, v), (F, "glMultiTexCoord1dv(0x%x, %p);\n", target, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord1dvARB)(GLenum target, const GLdouble * v)
+{
+ DISPATCH(MultiTexCoord1dvARB, (target, v), (F, "glMultiTexCoord1dvARB(0x%x, %p);\n", target, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord1f)(GLenum target, GLfloat s)
+{
+ DISPATCH(MultiTexCoord1fARB, (target, s), (F, "glMultiTexCoord1f(0x%x, %f);\n", target, s));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord1fARB)(GLenum target, GLfloat s)
+{
+ DISPATCH(MultiTexCoord1fARB, (target, s), (F, "glMultiTexCoord1fARB(0x%x, %f);\n", target, s));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord1fv)(GLenum target, const GLfloat * v)
+{
+ DISPATCH(MultiTexCoord1fvARB, (target, v), (F, "glMultiTexCoord1fv(0x%x, %p);\n", target, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord1fvARB)(GLenum target, const GLfloat * v)
+{
+ DISPATCH(MultiTexCoord1fvARB, (target, v), (F, "glMultiTexCoord1fvARB(0x%x, %p);\n", target, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord1i)(GLenum target, GLint s)
+{
+ DISPATCH(MultiTexCoord1iARB, (target, s), (F, "glMultiTexCoord1i(0x%x, %d);\n", target, s));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord1iARB)(GLenum target, GLint s)
+{
+ DISPATCH(MultiTexCoord1iARB, (target, s), (F, "glMultiTexCoord1iARB(0x%x, %d);\n", target, s));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord1iv)(GLenum target, const GLint * v)
+{
+ DISPATCH(MultiTexCoord1ivARB, (target, v), (F, "glMultiTexCoord1iv(0x%x, %p);\n", target, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord1ivARB)(GLenum target, const GLint * v)
+{
+ DISPATCH(MultiTexCoord1ivARB, (target, v), (F, "glMultiTexCoord1ivARB(0x%x, %p);\n", target, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord1s)(GLenum target, GLshort s)
+{
+ DISPATCH(MultiTexCoord1sARB, (target, s), (F, "glMultiTexCoord1s(0x%x, %d);\n", target, s));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord1sARB)(GLenum target, GLshort s)
+{
+ DISPATCH(MultiTexCoord1sARB, (target, s), (F, "glMultiTexCoord1sARB(0x%x, %d);\n", target, s));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord1sv)(GLenum target, const GLshort * v)
+{
+ DISPATCH(MultiTexCoord1svARB, (target, v), (F, "glMultiTexCoord1sv(0x%x, %p);\n", target, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord1svARB)(GLenum target, const GLshort * v)
+{
+ DISPATCH(MultiTexCoord1svARB, (target, v), (F, "glMultiTexCoord1svARB(0x%x, %p);\n", target, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord2d)(GLenum target, GLdouble s, GLdouble t)
+{
+ DISPATCH(MultiTexCoord2dARB, (target, s, t), (F, "glMultiTexCoord2d(0x%x, %f, %f);\n", target, s, t));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord2dARB)(GLenum target, GLdouble s, GLdouble t)
+{
+ DISPATCH(MultiTexCoord2dARB, (target, s, t), (F, "glMultiTexCoord2dARB(0x%x, %f, %f);\n", target, s, t));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord2dv)(GLenum target, const GLdouble * v)
+{
+ DISPATCH(MultiTexCoord2dvARB, (target, v), (F, "glMultiTexCoord2dv(0x%x, %p);\n", target, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord2dvARB)(GLenum target, const GLdouble * v)
+{
+ DISPATCH(MultiTexCoord2dvARB, (target, v), (F, "glMultiTexCoord2dvARB(0x%x, %p);\n", target, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord2f)(GLenum target, GLfloat s, GLfloat t)
+{
+ DISPATCH(MultiTexCoord2fARB, (target, s, t), (F, "glMultiTexCoord2f(0x%x, %f, %f);\n", target, s, t));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord2fARB)(GLenum target, GLfloat s, GLfloat t)
+{
+ DISPATCH(MultiTexCoord2fARB, (target, s, t), (F, "glMultiTexCoord2fARB(0x%x, %f, %f);\n", target, s, t));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord2fv)(GLenum target, const GLfloat * v)
+{
+ DISPATCH(MultiTexCoord2fvARB, (target, v), (F, "glMultiTexCoord2fv(0x%x, %p);\n", target, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord2fvARB)(GLenum target, const GLfloat * v)
+{
+ DISPATCH(MultiTexCoord2fvARB, (target, v), (F, "glMultiTexCoord2fvARB(0x%x, %p);\n", target, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord2i)(GLenum target, GLint s, GLint t)
+{
+ DISPATCH(MultiTexCoord2iARB, (target, s, t), (F, "glMultiTexCoord2i(0x%x, %d, %d);\n", target, s, t));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord2iARB)(GLenum target, GLint s, GLint t)
+{
+ DISPATCH(MultiTexCoord2iARB, (target, s, t), (F, "glMultiTexCoord2iARB(0x%x, %d, %d);\n", target, s, t));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord2iv)(GLenum target, const GLint * v)
+{
+ DISPATCH(MultiTexCoord2ivARB, (target, v), (F, "glMultiTexCoord2iv(0x%x, %p);\n", target, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord2ivARB)(GLenum target, const GLint * v)
+{
+ DISPATCH(MultiTexCoord2ivARB, (target, v), (F, "glMultiTexCoord2ivARB(0x%x, %p);\n", target, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord2s)(GLenum target, GLshort s, GLshort t)
+{
+ DISPATCH(MultiTexCoord2sARB, (target, s, t), (F, "glMultiTexCoord2s(0x%x, %d, %d);\n", target, s, t));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord2sARB)(GLenum target, GLshort s, GLshort t)
+{
+ DISPATCH(MultiTexCoord2sARB, (target, s, t), (F, "glMultiTexCoord2sARB(0x%x, %d, %d);\n", target, s, t));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord2sv)(GLenum target, const GLshort * v)
+{
+ DISPATCH(MultiTexCoord2svARB, (target, v), (F, "glMultiTexCoord2sv(0x%x, %p);\n", target, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord2svARB)(GLenum target, const GLshort * v)
+{
+ DISPATCH(MultiTexCoord2svARB, (target, v), (F, "glMultiTexCoord2svARB(0x%x, %p);\n", target, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord3d)(GLenum target, GLdouble s, GLdouble t, GLdouble r)
+{
+ DISPATCH(MultiTexCoord3dARB, (target, s, t, r), (F, "glMultiTexCoord3d(0x%x, %f, %f, %f);\n", target, s, t, r));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord3dARB)(GLenum target, GLdouble s, GLdouble t, GLdouble r)
+{
+ DISPATCH(MultiTexCoord3dARB, (target, s, t, r), (F, "glMultiTexCoord3dARB(0x%x, %f, %f, %f);\n", target, s, t, r));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord3dv)(GLenum target, const GLdouble * v)
+{
+ DISPATCH(MultiTexCoord3dvARB, (target, v), (F, "glMultiTexCoord3dv(0x%x, %p);\n", target, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord3dvARB)(GLenum target, const GLdouble * v)
+{
+ DISPATCH(MultiTexCoord3dvARB, (target, v), (F, "glMultiTexCoord3dvARB(0x%x, %p);\n", target, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord3f)(GLenum target, GLfloat s, GLfloat t, GLfloat r)
+{
+ DISPATCH(MultiTexCoord3fARB, (target, s, t, r), (F, "glMultiTexCoord3f(0x%x, %f, %f, %f);\n", target, s, t, r));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord3fARB)(GLenum target, GLfloat s, GLfloat t, GLfloat r)
+{
+ DISPATCH(MultiTexCoord3fARB, (target, s, t, r), (F, "glMultiTexCoord3fARB(0x%x, %f, %f, %f);\n", target, s, t, r));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord3fv)(GLenum target, const GLfloat * v)
+{
+ DISPATCH(MultiTexCoord3fvARB, (target, v), (F, "glMultiTexCoord3fv(0x%x, %p);\n", target, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord3fvARB)(GLenum target, const GLfloat * v)
+{
+ DISPATCH(MultiTexCoord3fvARB, (target, v), (F, "glMultiTexCoord3fvARB(0x%x, %p);\n", target, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord3i)(GLenum target, GLint s, GLint t, GLint r)
+{
+ DISPATCH(MultiTexCoord3iARB, (target, s, t, r), (F, "glMultiTexCoord3i(0x%x, %d, %d, %d);\n", target, s, t, r));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord3iARB)(GLenum target, GLint s, GLint t, GLint r)
+{
+ DISPATCH(MultiTexCoord3iARB, (target, s, t, r), (F, "glMultiTexCoord3iARB(0x%x, %d, %d, %d);\n", target, s, t, r));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord3iv)(GLenum target, const GLint * v)
+{
+ DISPATCH(MultiTexCoord3ivARB, (target, v), (F, "glMultiTexCoord3iv(0x%x, %p);\n", target, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord3ivARB)(GLenum target, const GLint * v)
+{
+ DISPATCH(MultiTexCoord3ivARB, (target, v), (F, "glMultiTexCoord3ivARB(0x%x, %p);\n", target, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord3s)(GLenum target, GLshort s, GLshort t, GLshort r)
+{
+ DISPATCH(MultiTexCoord3sARB, (target, s, t, r), (F, "glMultiTexCoord3s(0x%x, %d, %d, %d);\n", target, s, t, r));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord3sARB)(GLenum target, GLshort s, GLshort t, GLshort r)
+{
+ DISPATCH(MultiTexCoord3sARB, (target, s, t, r), (F, "glMultiTexCoord3sARB(0x%x, %d, %d, %d);\n", target, s, t, r));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord3sv)(GLenum target, const GLshort * v)
+{
+ DISPATCH(MultiTexCoord3svARB, (target, v), (F, "glMultiTexCoord3sv(0x%x, %p);\n", target, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord3svARB)(GLenum target, const GLshort * v)
+{
+ DISPATCH(MultiTexCoord3svARB, (target, v), (F, "glMultiTexCoord3svARB(0x%x, %p);\n", target, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord4d)(GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q)
+{
+ DISPATCH(MultiTexCoord4dARB, (target, s, t, r, q), (F, "glMultiTexCoord4d(0x%x, %f, %f, %f, %f);\n", target, s, t, r, q));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord4dARB)(GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q)
+{
+ DISPATCH(MultiTexCoord4dARB, (target, s, t, r, q), (F, "glMultiTexCoord4dARB(0x%x, %f, %f, %f, %f);\n", target, s, t, r, q));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord4dv)(GLenum target, const GLdouble * v)
+{
+ DISPATCH(MultiTexCoord4dvARB, (target, v), (F, "glMultiTexCoord4dv(0x%x, %p);\n", target, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord4dvARB)(GLenum target, const GLdouble * v)
+{
+ DISPATCH(MultiTexCoord4dvARB, (target, v), (F, "glMultiTexCoord4dvARB(0x%x, %p);\n", target, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord4f)(GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q)
+{
+ DISPATCH(MultiTexCoord4fARB, (target, s, t, r, q), (F, "glMultiTexCoord4f(0x%x, %f, %f, %f, %f);\n", target, s, t, r, q));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord4fARB)(GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q)
+{
+ DISPATCH(MultiTexCoord4fARB, (target, s, t, r, q), (F, "glMultiTexCoord4fARB(0x%x, %f, %f, %f, %f);\n", target, s, t, r, q));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord4fv)(GLenum target, const GLfloat * v)
+{
+ DISPATCH(MultiTexCoord4fvARB, (target, v), (F, "glMultiTexCoord4fv(0x%x, %p);\n", target, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord4fvARB)(GLenum target, const GLfloat * v)
+{
+ DISPATCH(MultiTexCoord4fvARB, (target, v), (F, "glMultiTexCoord4fvARB(0x%x, %p);\n", target, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord4i)(GLenum target, GLint s, GLint t, GLint r, GLint q)
+{
+ DISPATCH(MultiTexCoord4iARB, (target, s, t, r, q), (F, "glMultiTexCoord4i(0x%x, %d, %d, %d, %d);\n", target, s, t, r, q));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord4iARB)(GLenum target, GLint s, GLint t, GLint r, GLint q)
+{
+ DISPATCH(MultiTexCoord4iARB, (target, s, t, r, q), (F, "glMultiTexCoord4iARB(0x%x, %d, %d, %d, %d);\n", target, s, t, r, q));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord4iv)(GLenum target, const GLint * v)
+{
+ DISPATCH(MultiTexCoord4ivARB, (target, v), (F, "glMultiTexCoord4iv(0x%x, %p);\n", target, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord4ivARB)(GLenum target, const GLint * v)
+{
+ DISPATCH(MultiTexCoord4ivARB, (target, v), (F, "glMultiTexCoord4ivARB(0x%x, %p);\n", target, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord4s)(GLenum target, GLshort s, GLshort t, GLshort r, GLshort q)
+{
+ DISPATCH(MultiTexCoord4sARB, (target, s, t, r, q), (F, "glMultiTexCoord4s(0x%x, %d, %d, %d, %d);\n", target, s, t, r, q));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord4sARB)(GLenum target, GLshort s, GLshort t, GLshort r, GLshort q)
+{
+ DISPATCH(MultiTexCoord4sARB, (target, s, t, r, q), (F, "glMultiTexCoord4sARB(0x%x, %d, %d, %d, %d);\n", target, s, t, r, q));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord4sv)(GLenum target, const GLshort * v)
+{
+ DISPATCH(MultiTexCoord4svARB, (target, v), (F, "glMultiTexCoord4sv(0x%x, %p);\n", target, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultiTexCoord4svARB)(GLenum target, const GLshort * v)
+{
+ DISPATCH(MultiTexCoord4svARB, (target, v), (F, "glMultiTexCoord4svARB(0x%x, %p);\n", target, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(AttachShader)(GLuint program, GLuint shader)
+{
+ DISPATCH(AttachShader, (program, shader), (F, "glAttachShader(%d, %d);\n", program, shader));
+}
+
+KEYWORD1 GLuint KEYWORD2 NAME(CreateProgram)(void)
+{
+ RETURN_DISPATCH(CreateProgram, (), (F, "glCreateProgram();\n"));
+}
+
+KEYWORD1 GLuint KEYWORD2 NAME(CreateShader)(GLenum type)
+{
+ RETURN_DISPATCH(CreateShader, (type), (F, "glCreateShader(0x%x);\n", type));
+}
+
+KEYWORD1 void KEYWORD2 NAME(DeleteProgram)(GLuint program)
+{
+ DISPATCH(DeleteProgram, (program), (F, "glDeleteProgram(%d);\n", program));
+}
+
+KEYWORD1 void KEYWORD2 NAME(DeleteShader)(GLuint program)
+{
+ DISPATCH(DeleteShader, (program), (F, "glDeleteShader(%d);\n", program));
+}
+
+KEYWORD1 void KEYWORD2 NAME(DetachShader)(GLuint program, GLuint shader)
+{
+ DISPATCH(DetachShader, (program, shader), (F, "glDetachShader(%d, %d);\n", program, shader));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetAttachedShaders)(GLuint program, GLsizei maxCount, GLsizei * count, GLuint * obj)
+{
+ DISPATCH(GetAttachedShaders, (program, maxCount, count, obj), (F, "glGetAttachedShaders(%d, %d, %p, %p);\n", program, maxCount, (const void *) count, (const void *) obj));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetProgramInfoLog)(GLuint program, GLsizei bufSize, GLsizei * length, GLchar * infoLog)
+{
+ DISPATCH(GetProgramInfoLog, (program, bufSize, length, infoLog), (F, "glGetProgramInfoLog(%d, %d, %p, %p);\n", program, bufSize, (const void *) length, (const void *) infoLog));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetProgramiv)(GLuint program, GLenum pname, GLint * params)
+{
+ DISPATCH(GetProgramiv, (program, pname, params), (F, "glGetProgramiv(%d, 0x%x, %p);\n", program, pname, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetShaderInfoLog)(GLuint shader, GLsizei bufSize, GLsizei * length, GLchar * infoLog)
+{
+ DISPATCH(GetShaderInfoLog, (shader, bufSize, length, infoLog), (F, "glGetShaderInfoLog(%d, %d, %p, %p);\n", shader, bufSize, (const void *) length, (const void *) infoLog));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetShaderiv)(GLuint shader, GLenum pname, GLint * params)
+{
+ DISPATCH(GetShaderiv, (shader, pname, params), (F, "glGetShaderiv(%d, 0x%x, %p);\n", shader, pname, (const void *) params));
+}
+
+KEYWORD1 GLboolean KEYWORD2 NAME(IsProgram)(GLuint program)
+{
+ RETURN_DISPATCH(IsProgram, (program), (F, "glIsProgram(%d);\n", program));
+}
+
+KEYWORD1 GLboolean KEYWORD2 NAME(IsShader)(GLuint shader)
+{
+ RETURN_DISPATCH(IsShader, (shader), (F, "glIsShader(%d);\n", shader));
+}
+
+KEYWORD1 void KEYWORD2 NAME(StencilFuncSeparate)(GLenum face, GLenum func, GLint ref, GLuint mask)
+{
+ DISPATCH(StencilFuncSeparate, (face, func, ref, mask), (F, "glStencilFuncSeparate(0x%x, 0x%x, %d, %d);\n", face, func, ref, mask));
+}
+
+KEYWORD1 void KEYWORD2 NAME(StencilMaskSeparate)(GLenum face, GLuint mask)
+{
+ DISPATCH(StencilMaskSeparate, (face, mask), (F, "glStencilMaskSeparate(0x%x, %d);\n", face, mask));
+}
+
+KEYWORD1 void KEYWORD2 NAME(StencilOpSeparate)(GLenum face, GLenum sfail, GLenum zfail, GLenum zpass)
+{
+ DISPATCH(StencilOpSeparate, (face, sfail, zfail, zpass), (F, "glStencilOpSeparate(0x%x, 0x%x, 0x%x, 0x%x);\n", face, sfail, zfail, zpass));
+}
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_423)(GLenum face, GLenum sfail, GLenum zfail, GLenum zpass);
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_423)(GLenum face, GLenum sfail, GLenum zfail, GLenum zpass)
+{
+ DISPATCH(StencilOpSeparate, (face, sfail, zfail, zpass), (F, "glStencilOpSeparateATI(0x%x, 0x%x, 0x%x, 0x%x);\n", face, sfail, zfail, zpass));
+}
+
+KEYWORD1 void KEYWORD2 NAME(UniformMatrix2x3fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value)
+{
+ DISPATCH(UniformMatrix2x3fv, (location, count, transpose, value), (F, "glUniformMatrix2x3fv(%d, %d, %d, %p);\n", location, count, transpose, (const void *) value));
+}
+
+KEYWORD1 void KEYWORD2 NAME(UniformMatrix2x4fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value)
+{
+ DISPATCH(UniformMatrix2x4fv, (location, count, transpose, value), (F, "glUniformMatrix2x4fv(%d, %d, %d, %p);\n", location, count, transpose, (const void *) value));
+}
+
+KEYWORD1 void KEYWORD2 NAME(UniformMatrix3x2fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value)
+{
+ DISPATCH(UniformMatrix3x2fv, (location, count, transpose, value), (F, "glUniformMatrix3x2fv(%d, %d, %d, %p);\n", location, count, transpose, (const void *) value));
+}
+
+KEYWORD1 void KEYWORD2 NAME(UniformMatrix3x4fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value)
+{
+ DISPATCH(UniformMatrix3x4fv, (location, count, transpose, value), (F, "glUniformMatrix3x4fv(%d, %d, %d, %p);\n", location, count, transpose, (const void *) value));
+}
+
+KEYWORD1 void KEYWORD2 NAME(UniformMatrix4x2fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value)
+{
+ DISPATCH(UniformMatrix4x2fv, (location, count, transpose, value), (F, "glUniformMatrix4x2fv(%d, %d, %d, %p);\n", location, count, transpose, (const void *) value));
+}
+
+KEYWORD1 void KEYWORD2 NAME(UniformMatrix4x3fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value)
+{
+ DISPATCH(UniformMatrix4x3fv, (location, count, transpose, value), (F, "glUniformMatrix4x3fv(%d, %d, %d, %p);\n", location, count, transpose, (const void *) value));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ClampColor)(GLenum target, GLenum clamp)
+{
+ DISPATCH(ClampColor, (target, clamp), (F, "glClampColor(0x%x, 0x%x);\n", target, clamp));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ClearBufferfi)(GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil)
+{
+ DISPATCH(ClearBufferfi, (buffer, drawbuffer, depth, stencil), (F, "glClearBufferfi(0x%x, %d, %f, %d);\n", buffer, drawbuffer, depth, stencil));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ClearBufferfv)(GLenum buffer, GLint drawbuffer, const GLfloat * value)
+{
+ DISPATCH(ClearBufferfv, (buffer, drawbuffer, value), (F, "glClearBufferfv(0x%x, %d, %p);\n", buffer, drawbuffer, (const void *) value));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ClearBufferiv)(GLenum buffer, GLint drawbuffer, const GLint * value)
+{
+ DISPATCH(ClearBufferiv, (buffer, drawbuffer, value), (F, "glClearBufferiv(0x%x, %d, %p);\n", buffer, drawbuffer, (const void *) value));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ClearBufferuiv)(GLenum buffer, GLint drawbuffer, const GLuint * value)
+{
+ DISPATCH(ClearBufferuiv, (buffer, drawbuffer, value), (F, "glClearBufferuiv(0x%x, %d, %p);\n", buffer, drawbuffer, (const void *) value));
+}
+
+KEYWORD1 const GLubyte * KEYWORD2 NAME(GetStringi)(GLenum name, GLuint index)
+{
+ RETURN_DISPATCH(GetStringi, (name, index), (F, "glGetStringi(0x%x, %d);\n", name, index));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TexBuffer)(GLenum target, GLenum internalFormat, GLuint buffer)
+{
+ DISPATCH(TexBuffer, (target, internalFormat, buffer), (F, "glTexBuffer(0x%x, 0x%x, %d);\n", target, internalFormat, buffer));
+}
+
+KEYWORD1 void KEYWORD2 NAME(FramebufferTexture)(GLenum target, GLenum attachment, GLuint texture, GLint level)
+{
+ DISPATCH(FramebufferTexture, (target, attachment, texture, level), (F, "glFramebufferTexture(0x%x, 0x%x, %d, %d);\n", target, attachment, texture, level));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetBufferParameteri64v)(GLenum target, GLenum pname, GLint64 * params)
+{
+ DISPATCH(GetBufferParameteri64v, (target, pname, params), (F, "glGetBufferParameteri64v(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetInteger64i_v)(GLenum cap, GLuint index, GLint64 * data)
+{
+ DISPATCH(GetInteger64i_v, (cap, index, data), (F, "glGetInteger64i_v(0x%x, %d, %p);\n", cap, index, (const void *) data));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttribDivisor)(GLuint index, GLuint divisor)
+{
+ DISPATCH(VertexAttribDivisor, (index, divisor), (F, "glVertexAttribDivisor(%d, %d);\n", index, divisor));
+}
+
+KEYWORD1 void KEYWORD2 NAME(LoadTransposeMatrixd)(const GLdouble * m)
+{
+ DISPATCH(LoadTransposeMatrixdARB, (m), (F, "glLoadTransposeMatrixd(%p);\n", (const void *) m));
+}
+
+KEYWORD1 void KEYWORD2 NAME(LoadTransposeMatrixdARB)(const GLdouble * m)
+{
+ DISPATCH(LoadTransposeMatrixdARB, (m), (F, "glLoadTransposeMatrixdARB(%p);\n", (const void *) m));
+}
+
+KEYWORD1 void KEYWORD2 NAME(LoadTransposeMatrixf)(const GLfloat * m)
+{
+ DISPATCH(LoadTransposeMatrixfARB, (m), (F, "glLoadTransposeMatrixf(%p);\n", (const void *) m));
+}
+
+KEYWORD1 void KEYWORD2 NAME(LoadTransposeMatrixfARB)(const GLfloat * m)
+{
+ DISPATCH(LoadTransposeMatrixfARB, (m), (F, "glLoadTransposeMatrixfARB(%p);\n", (const void *) m));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultTransposeMatrixd)(const GLdouble * m)
+{
+ DISPATCH(MultTransposeMatrixdARB, (m), (F, "glMultTransposeMatrixd(%p);\n", (const void *) m));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultTransposeMatrixdARB)(const GLdouble * m)
+{
+ DISPATCH(MultTransposeMatrixdARB, (m), (F, "glMultTransposeMatrixdARB(%p);\n", (const void *) m));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultTransposeMatrixf)(const GLfloat * m)
+{
+ DISPATCH(MultTransposeMatrixfARB, (m), (F, "glMultTransposeMatrixf(%p);\n", (const void *) m));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultTransposeMatrixfARB)(const GLfloat * m)
+{
+ DISPATCH(MultTransposeMatrixfARB, (m), (F, "glMultTransposeMatrixfARB(%p);\n", (const void *) m));
+}
+
+KEYWORD1 void KEYWORD2 NAME(SampleCoverage)(GLclampf value, GLboolean invert)
+{
+ DISPATCH(SampleCoverageARB, (value, invert), (F, "glSampleCoverage(%f, %d);\n", value, invert));
+}
+
+KEYWORD1 void KEYWORD2 NAME(SampleCoverageARB)(GLclampf value, GLboolean invert)
+{
+ DISPATCH(SampleCoverageARB, (value, invert), (F, "glSampleCoverageARB(%f, %d);\n", value, invert));
+}
+
+KEYWORD1 void KEYWORD2 NAME(CompressedTexImage1D)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid * data)
+{
+ DISPATCH(CompressedTexImage1DARB, (target, level, internalformat, width, border, imageSize, data), (F, "glCompressedTexImage1D(0x%x, %d, 0x%x, %d, %d, %d, %p);\n", target, level, internalformat, width, border, imageSize, (const void *) data));
+}
+
+KEYWORD1 void KEYWORD2 NAME(CompressedTexImage1DARB)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid * data)
+{
+ DISPATCH(CompressedTexImage1DARB, (target, level, internalformat, width, border, imageSize, data), (F, "glCompressedTexImage1DARB(0x%x, %d, 0x%x, %d, %d, %d, %p);\n", target, level, internalformat, width, border, imageSize, (const void *) data));
+}
+
+KEYWORD1 void KEYWORD2 NAME(CompressedTexImage2D)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid * data)
+{
+ DISPATCH(CompressedTexImage2DARB, (target, level, internalformat, width, height, border, imageSize, data), (F, "glCompressedTexImage2D(0x%x, %d, 0x%x, %d, %d, %d, %d, %p);\n", target, level, internalformat, width, height, border, imageSize, (const void *) data));
+}
+
+KEYWORD1 void KEYWORD2 NAME(CompressedTexImage2DARB)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid * data)
+{
+ DISPATCH(CompressedTexImage2DARB, (target, level, internalformat, width, height, border, imageSize, data), (F, "glCompressedTexImage2DARB(0x%x, %d, 0x%x, %d, %d, %d, %d, %p);\n", target, level, internalformat, width, height, border, imageSize, (const void *) data));
+}
+
+KEYWORD1 void KEYWORD2 NAME(CompressedTexImage3D)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid * data)
+{
+ DISPATCH(CompressedTexImage3DARB, (target, level, internalformat, width, height, depth, border, imageSize, data), (F, "glCompressedTexImage3D(0x%x, %d, 0x%x, %d, %d, %d, %d, %d, %p);\n", target, level, internalformat, width, height, depth, border, imageSize, (const void *) data));
+}
+
+KEYWORD1 void KEYWORD2 NAME(CompressedTexImage3DARB)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid * data)
+{
+ DISPATCH(CompressedTexImage3DARB, (target, level, internalformat, width, height, depth, border, imageSize, data), (F, "glCompressedTexImage3DARB(0x%x, %d, 0x%x, %d, %d, %d, %d, %d, %p);\n", target, level, internalformat, width, height, depth, border, imageSize, (const void *) data));
+}
+
+KEYWORD1 void KEYWORD2 NAME(CompressedTexSubImage1D)(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid * data)
+{
+ DISPATCH(CompressedTexSubImage1DARB, (target, level, xoffset, width, format, imageSize, data), (F, "glCompressedTexSubImage1D(0x%x, %d, %d, %d, 0x%x, %d, %p);\n", target, level, xoffset, width, format, imageSize, (const void *) data));
+}
+
+KEYWORD1 void KEYWORD2 NAME(CompressedTexSubImage1DARB)(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid * data)
+{
+ DISPATCH(CompressedTexSubImage1DARB, (target, level, xoffset, width, format, imageSize, data), (F, "glCompressedTexSubImage1DARB(0x%x, %d, %d, %d, 0x%x, %d, %p);\n", target, level, xoffset, width, format, imageSize, (const void *) data));
+}
+
+KEYWORD1 void KEYWORD2 NAME(CompressedTexSubImage2D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid * data)
+{
+ DISPATCH(CompressedTexSubImage2DARB, (target, level, xoffset, yoffset, width, height, format, imageSize, data), (F, "glCompressedTexSubImage2D(0x%x, %d, %d, %d, %d, %d, 0x%x, %d, %p);\n", target, level, xoffset, yoffset, width, height, format, imageSize, (const void *) data));
+}
+
+KEYWORD1 void KEYWORD2 NAME(CompressedTexSubImage2DARB)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid * data)
+{
+ DISPATCH(CompressedTexSubImage2DARB, (target, level, xoffset, yoffset, width, height, format, imageSize, data), (F, "glCompressedTexSubImage2DARB(0x%x, %d, %d, %d, %d, %d, 0x%x, %d, %p);\n", target, level, xoffset, yoffset, width, height, format, imageSize, (const void *) data));
+}
+
+KEYWORD1 void KEYWORD2 NAME(CompressedTexSubImage3D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid * data)
+{
+ DISPATCH(CompressedTexSubImage3DARB, (target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, data), (F, "glCompressedTexSubImage3D(0x%x, %d, %d, %d, %d, %d, %d, %d, 0x%x, %d, %p);\n", target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, (const void *) data));
+}
+
+KEYWORD1 void KEYWORD2 NAME(CompressedTexSubImage3DARB)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid * data)
+{
+ DISPATCH(CompressedTexSubImage3DARB, (target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, data), (F, "glCompressedTexSubImage3DARB(0x%x, %d, %d, %d, %d, %d, %d, %d, 0x%x, %d, %p);\n", target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, (const void *) data));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetCompressedTexImage)(GLenum target, GLint level, GLvoid * img)
+{
+ DISPATCH(GetCompressedTexImageARB, (target, level, img), (F, "glGetCompressedTexImage(0x%x, %d, %p);\n", target, level, (const void *) img));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetCompressedTexImageARB)(GLenum target, GLint level, GLvoid * img)
+{
+ DISPATCH(GetCompressedTexImageARB, (target, level, img), (F, "glGetCompressedTexImageARB(0x%x, %d, %p);\n", target, level, (const void *) img));
+}
+
+KEYWORD1 void KEYWORD2 NAME(DisableVertexAttribArray)(GLuint index)
+{
+ DISPATCH(DisableVertexAttribArrayARB, (index), (F, "glDisableVertexAttribArray(%d);\n", index));
+}
+
+KEYWORD1 void KEYWORD2 NAME(DisableVertexAttribArrayARB)(GLuint index)
+{
+ DISPATCH(DisableVertexAttribArrayARB, (index), (F, "glDisableVertexAttribArrayARB(%d);\n", index));
+}
+
+KEYWORD1 void KEYWORD2 NAME(EnableVertexAttribArray)(GLuint index)
+{
+ DISPATCH(EnableVertexAttribArrayARB, (index), (F, "glEnableVertexAttribArray(%d);\n", index));
+}
+
+KEYWORD1 void KEYWORD2 NAME(EnableVertexAttribArrayARB)(GLuint index)
+{
+ DISPATCH(EnableVertexAttribArrayARB, (index), (F, "glEnableVertexAttribArrayARB(%d);\n", index));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetProgramEnvParameterdvARB)(GLenum target, GLuint index, GLdouble * params)
+{
+ DISPATCH(GetProgramEnvParameterdvARB, (target, index, params), (F, "glGetProgramEnvParameterdvARB(0x%x, %d, %p);\n", target, index, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetProgramEnvParameterfvARB)(GLenum target, GLuint index, GLfloat * params)
+{
+ DISPATCH(GetProgramEnvParameterfvARB, (target, index, params), (F, "glGetProgramEnvParameterfvARB(0x%x, %d, %p);\n", target, index, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetProgramLocalParameterdvARB)(GLenum target, GLuint index, GLdouble * params)
+{
+ DISPATCH(GetProgramLocalParameterdvARB, (target, index, params), (F, "glGetProgramLocalParameterdvARB(0x%x, %d, %p);\n", target, index, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetProgramLocalParameterfvARB)(GLenum target, GLuint index, GLfloat * params)
+{
+ DISPATCH(GetProgramLocalParameterfvARB, (target, index, params), (F, "glGetProgramLocalParameterfvARB(0x%x, %d, %p);\n", target, index, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetProgramStringARB)(GLenum target, GLenum pname, GLvoid * string)
+{
+ DISPATCH(GetProgramStringARB, (target, pname, string), (F, "glGetProgramStringARB(0x%x, 0x%x, %p);\n", target, pname, (const void *) string));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetProgramivARB)(GLenum target, GLenum pname, GLint * params)
+{
+ DISPATCH(GetProgramivARB, (target, pname, params), (F, "glGetProgramivARB(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetVertexAttribdv)(GLuint index, GLenum pname, GLdouble * params)
+{
+ DISPATCH(GetVertexAttribdvARB, (index, pname, params), (F, "glGetVertexAttribdv(%d, 0x%x, %p);\n", index, pname, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetVertexAttribdvARB)(GLuint index, GLenum pname, GLdouble * params)
+{
+ DISPATCH(GetVertexAttribdvARB, (index, pname, params), (F, "glGetVertexAttribdvARB(%d, 0x%x, %p);\n", index, pname, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetVertexAttribfv)(GLuint index, GLenum pname, GLfloat * params)
+{
+ DISPATCH(GetVertexAttribfvARB, (index, pname, params), (F, "glGetVertexAttribfv(%d, 0x%x, %p);\n", index, pname, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetVertexAttribfvARB)(GLuint index, GLenum pname, GLfloat * params)
+{
+ DISPATCH(GetVertexAttribfvARB, (index, pname, params), (F, "glGetVertexAttribfvARB(%d, 0x%x, %p);\n", index, pname, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetVertexAttribiv)(GLuint index, GLenum pname, GLint * params)
+{
+ DISPATCH(GetVertexAttribivARB, (index, pname, params), (F, "glGetVertexAttribiv(%d, 0x%x, %p);\n", index, pname, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetVertexAttribivARB)(GLuint index, GLenum pname, GLint * params)
+{
+ DISPATCH(GetVertexAttribivARB, (index, pname, params), (F, "glGetVertexAttribivARB(%d, 0x%x, %p);\n", index, pname, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ProgramEnvParameter4dARB)(GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w)
+{
+ DISPATCH(ProgramEnvParameter4dARB, (target, index, x, y, z, w), (F, "glProgramEnvParameter4dARB(0x%x, %d, %f, %f, %f, %f);\n", target, index, x, y, z, w));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ProgramParameter4dNV)(GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w)
+{
+ DISPATCH(ProgramEnvParameter4dARB, (target, index, x, y, z, w), (F, "glProgramParameter4dNV(0x%x, %d, %f, %f, %f, %f);\n", target, index, x, y, z, w));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ProgramEnvParameter4dvARB)(GLenum target, GLuint index, const GLdouble * params)
+{
+ DISPATCH(ProgramEnvParameter4dvARB, (target, index, params), (F, "glProgramEnvParameter4dvARB(0x%x, %d, %p);\n", target, index, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ProgramParameter4dvNV)(GLenum target, GLuint index, const GLdouble * params)
+{
+ DISPATCH(ProgramEnvParameter4dvARB, (target, index, params), (F, "glProgramParameter4dvNV(0x%x, %d, %p);\n", target, index, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ProgramEnvParameter4fARB)(GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
+{
+ DISPATCH(ProgramEnvParameter4fARB, (target, index, x, y, z, w), (F, "glProgramEnvParameter4fARB(0x%x, %d, %f, %f, %f, %f);\n", target, index, x, y, z, w));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ProgramParameter4fNV)(GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
+{
+ DISPATCH(ProgramEnvParameter4fARB, (target, index, x, y, z, w), (F, "glProgramParameter4fNV(0x%x, %d, %f, %f, %f, %f);\n", target, index, x, y, z, w));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ProgramEnvParameter4fvARB)(GLenum target, GLuint index, const GLfloat * params)
+{
+ DISPATCH(ProgramEnvParameter4fvARB, (target, index, params), (F, "glProgramEnvParameter4fvARB(0x%x, %d, %p);\n", target, index, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ProgramParameter4fvNV)(GLenum target, GLuint index, const GLfloat * params)
+{
+ DISPATCH(ProgramEnvParameter4fvARB, (target, index, params), (F, "glProgramParameter4fvNV(0x%x, %d, %p);\n", target, index, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ProgramLocalParameter4dARB)(GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w)
+{
+ DISPATCH(ProgramLocalParameter4dARB, (target, index, x, y, z, w), (F, "glProgramLocalParameter4dARB(0x%x, %d, %f, %f, %f, %f);\n", target, index, x, y, z, w));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ProgramLocalParameter4dvARB)(GLenum target, GLuint index, const GLdouble * params)
+{
+ DISPATCH(ProgramLocalParameter4dvARB, (target, index, params), (F, "glProgramLocalParameter4dvARB(0x%x, %d, %p);\n", target, index, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ProgramLocalParameter4fARB)(GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
+{
+ DISPATCH(ProgramLocalParameter4fARB, (target, index, x, y, z, w), (F, "glProgramLocalParameter4fARB(0x%x, %d, %f, %f, %f, %f);\n", target, index, x, y, z, w));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ProgramLocalParameter4fvARB)(GLenum target, GLuint index, const GLfloat * params)
+{
+ DISPATCH(ProgramLocalParameter4fvARB, (target, index, params), (F, "glProgramLocalParameter4fvARB(0x%x, %d, %p);\n", target, index, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ProgramStringARB)(GLenum target, GLenum format, GLsizei len, const GLvoid * string)
+{
+ DISPATCH(ProgramStringARB, (target, format, len, string), (F, "glProgramStringARB(0x%x, 0x%x, %d, %p);\n", target, format, len, (const void *) string));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib1d)(GLuint index, GLdouble x)
+{
+ DISPATCH(VertexAttrib1dARB, (index, x), (F, "glVertexAttrib1d(%d, %f);\n", index, x));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib1dARB)(GLuint index, GLdouble x)
+{
+ DISPATCH(VertexAttrib1dARB, (index, x), (F, "glVertexAttrib1dARB(%d, %f);\n", index, x));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib1dv)(GLuint index, const GLdouble * v)
+{
+ DISPATCH(VertexAttrib1dvARB, (index, v), (F, "glVertexAttrib1dv(%d, %p);\n", index, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib1dvARB)(GLuint index, const GLdouble * v)
+{
+ DISPATCH(VertexAttrib1dvARB, (index, v), (F, "glVertexAttrib1dvARB(%d, %p);\n", index, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib1f)(GLuint index, GLfloat x)
+{
+ DISPATCH(VertexAttrib1fARB, (index, x), (F, "glVertexAttrib1f(%d, %f);\n", index, x));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib1fARB)(GLuint index, GLfloat x)
+{
+ DISPATCH(VertexAttrib1fARB, (index, x), (F, "glVertexAttrib1fARB(%d, %f);\n", index, x));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib1fv)(GLuint index, const GLfloat * v)
+{
+ DISPATCH(VertexAttrib1fvARB, (index, v), (F, "glVertexAttrib1fv(%d, %p);\n", index, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib1fvARB)(GLuint index, const GLfloat * v)
+{
+ DISPATCH(VertexAttrib1fvARB, (index, v), (F, "glVertexAttrib1fvARB(%d, %p);\n", index, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib1s)(GLuint index, GLshort x)
+{
+ DISPATCH(VertexAttrib1sARB, (index, x), (F, "glVertexAttrib1s(%d, %d);\n", index, x));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib1sARB)(GLuint index, GLshort x)
+{
+ DISPATCH(VertexAttrib1sARB, (index, x), (F, "glVertexAttrib1sARB(%d, %d);\n", index, x));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib1sv)(GLuint index, const GLshort * v)
+{
+ DISPATCH(VertexAttrib1svARB, (index, v), (F, "glVertexAttrib1sv(%d, %p);\n", index, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib1svARB)(GLuint index, const GLshort * v)
+{
+ DISPATCH(VertexAttrib1svARB, (index, v), (F, "glVertexAttrib1svARB(%d, %p);\n", index, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib2d)(GLuint index, GLdouble x, GLdouble y)
+{
+ DISPATCH(VertexAttrib2dARB, (index, x, y), (F, "glVertexAttrib2d(%d, %f, %f);\n", index, x, y));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib2dARB)(GLuint index, GLdouble x, GLdouble y)
+{
+ DISPATCH(VertexAttrib2dARB, (index, x, y), (F, "glVertexAttrib2dARB(%d, %f, %f);\n", index, x, y));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib2dv)(GLuint index, const GLdouble * v)
+{
+ DISPATCH(VertexAttrib2dvARB, (index, v), (F, "glVertexAttrib2dv(%d, %p);\n", index, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib2dvARB)(GLuint index, const GLdouble * v)
+{
+ DISPATCH(VertexAttrib2dvARB, (index, v), (F, "glVertexAttrib2dvARB(%d, %p);\n", index, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib2f)(GLuint index, GLfloat x, GLfloat y)
+{
+ DISPATCH(VertexAttrib2fARB, (index, x, y), (F, "glVertexAttrib2f(%d, %f, %f);\n", index, x, y));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib2fARB)(GLuint index, GLfloat x, GLfloat y)
+{
+ DISPATCH(VertexAttrib2fARB, (index, x, y), (F, "glVertexAttrib2fARB(%d, %f, %f);\n", index, x, y));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib2fv)(GLuint index, const GLfloat * v)
+{
+ DISPATCH(VertexAttrib2fvARB, (index, v), (F, "glVertexAttrib2fv(%d, %p);\n", index, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib2fvARB)(GLuint index, const GLfloat * v)
+{
+ DISPATCH(VertexAttrib2fvARB, (index, v), (F, "glVertexAttrib2fvARB(%d, %p);\n", index, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib2s)(GLuint index, GLshort x, GLshort y)
+{
+ DISPATCH(VertexAttrib2sARB, (index, x, y), (F, "glVertexAttrib2s(%d, %d, %d);\n", index, x, y));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib2sARB)(GLuint index, GLshort x, GLshort y)
+{
+ DISPATCH(VertexAttrib2sARB, (index, x, y), (F, "glVertexAttrib2sARB(%d, %d, %d);\n", index, x, y));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib2sv)(GLuint index, const GLshort * v)
+{
+ DISPATCH(VertexAttrib2svARB, (index, v), (F, "glVertexAttrib2sv(%d, %p);\n", index, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib2svARB)(GLuint index, const GLshort * v)
+{
+ DISPATCH(VertexAttrib2svARB, (index, v), (F, "glVertexAttrib2svARB(%d, %p);\n", index, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib3d)(GLuint index, GLdouble x, GLdouble y, GLdouble z)
+{
+ DISPATCH(VertexAttrib3dARB, (index, x, y, z), (F, "glVertexAttrib3d(%d, %f, %f, %f);\n", index, x, y, z));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib3dARB)(GLuint index, GLdouble x, GLdouble y, GLdouble z)
+{
+ DISPATCH(VertexAttrib3dARB, (index, x, y, z), (F, "glVertexAttrib3dARB(%d, %f, %f, %f);\n", index, x, y, z));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib3dv)(GLuint index, const GLdouble * v)
+{
+ DISPATCH(VertexAttrib3dvARB, (index, v), (F, "glVertexAttrib3dv(%d, %p);\n", index, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib3dvARB)(GLuint index, const GLdouble * v)
+{
+ DISPATCH(VertexAttrib3dvARB, (index, v), (F, "glVertexAttrib3dvARB(%d, %p);\n", index, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib3f)(GLuint index, GLfloat x, GLfloat y, GLfloat z)
+{
+ DISPATCH(VertexAttrib3fARB, (index, x, y, z), (F, "glVertexAttrib3f(%d, %f, %f, %f);\n", index, x, y, z));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib3fARB)(GLuint index, GLfloat x, GLfloat y, GLfloat z)
+{
+ DISPATCH(VertexAttrib3fARB, (index, x, y, z), (F, "glVertexAttrib3fARB(%d, %f, %f, %f);\n", index, x, y, z));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib3fv)(GLuint index, const GLfloat * v)
+{
+ DISPATCH(VertexAttrib3fvARB, (index, v), (F, "glVertexAttrib3fv(%d, %p);\n", index, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib3fvARB)(GLuint index, const GLfloat * v)
+{
+ DISPATCH(VertexAttrib3fvARB, (index, v), (F, "glVertexAttrib3fvARB(%d, %p);\n", index, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib3s)(GLuint index, GLshort x, GLshort y, GLshort z)
+{
+ DISPATCH(VertexAttrib3sARB, (index, x, y, z), (F, "glVertexAttrib3s(%d, %d, %d, %d);\n", index, x, y, z));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib3sARB)(GLuint index, GLshort x, GLshort y, GLshort z)
+{
+ DISPATCH(VertexAttrib3sARB, (index, x, y, z), (F, "glVertexAttrib3sARB(%d, %d, %d, %d);\n", index, x, y, z));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib3sv)(GLuint index, const GLshort * v)
+{
+ DISPATCH(VertexAttrib3svARB, (index, v), (F, "glVertexAttrib3sv(%d, %p);\n", index, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib3svARB)(GLuint index, const GLshort * v)
+{
+ DISPATCH(VertexAttrib3svARB, (index, v), (F, "glVertexAttrib3svARB(%d, %p);\n", index, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib4Nbv)(GLuint index, const GLbyte * v)
+{
+ DISPATCH(VertexAttrib4NbvARB, (index, v), (F, "glVertexAttrib4Nbv(%d, %p);\n", index, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib4NbvARB)(GLuint index, const GLbyte * v)
+{
+ DISPATCH(VertexAttrib4NbvARB, (index, v), (F, "glVertexAttrib4NbvARB(%d, %p);\n", index, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib4Niv)(GLuint index, const GLint * v)
+{
+ DISPATCH(VertexAttrib4NivARB, (index, v), (F, "glVertexAttrib4Niv(%d, %p);\n", index, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib4NivARB)(GLuint index, const GLint * v)
+{
+ DISPATCH(VertexAttrib4NivARB, (index, v), (F, "glVertexAttrib4NivARB(%d, %p);\n", index, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib4Nsv)(GLuint index, const GLshort * v)
+{
+ DISPATCH(VertexAttrib4NsvARB, (index, v), (F, "glVertexAttrib4Nsv(%d, %p);\n", index, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib4NsvARB)(GLuint index, const GLshort * v)
+{
+ DISPATCH(VertexAttrib4NsvARB, (index, v), (F, "glVertexAttrib4NsvARB(%d, %p);\n", index, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib4Nub)(GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w)
+{
+ DISPATCH(VertexAttrib4NubARB, (index, x, y, z, w), (F, "glVertexAttrib4Nub(%d, %d, %d, %d, %d);\n", index, x, y, z, w));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib4NubARB)(GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w)
+{
+ DISPATCH(VertexAttrib4NubARB, (index, x, y, z, w), (F, "glVertexAttrib4NubARB(%d, %d, %d, %d, %d);\n", index, x, y, z, w));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib4Nubv)(GLuint index, const GLubyte * v)
+{
+ DISPATCH(VertexAttrib4NubvARB, (index, v), (F, "glVertexAttrib4Nubv(%d, %p);\n", index, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib4NubvARB)(GLuint index, const GLubyte * v)
+{
+ DISPATCH(VertexAttrib4NubvARB, (index, v), (F, "glVertexAttrib4NubvARB(%d, %p);\n", index, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib4Nuiv)(GLuint index, const GLuint * v)
+{
+ DISPATCH(VertexAttrib4NuivARB, (index, v), (F, "glVertexAttrib4Nuiv(%d, %p);\n", index, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib4NuivARB)(GLuint index, const GLuint * v)
+{
+ DISPATCH(VertexAttrib4NuivARB, (index, v), (F, "glVertexAttrib4NuivARB(%d, %p);\n", index, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib4Nusv)(GLuint index, const GLushort * v)
+{
+ DISPATCH(VertexAttrib4NusvARB, (index, v), (F, "glVertexAttrib4Nusv(%d, %p);\n", index, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib4NusvARB)(GLuint index, const GLushort * v)
+{
+ DISPATCH(VertexAttrib4NusvARB, (index, v), (F, "glVertexAttrib4NusvARB(%d, %p);\n", index, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib4bv)(GLuint index, const GLbyte * v)
+{
+ DISPATCH(VertexAttrib4bvARB, (index, v), (F, "glVertexAttrib4bv(%d, %p);\n", index, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib4bvARB)(GLuint index, const GLbyte * v)
+{
+ DISPATCH(VertexAttrib4bvARB, (index, v), (F, "glVertexAttrib4bvARB(%d, %p);\n", index, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib4d)(GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w)
+{
+ DISPATCH(VertexAttrib4dARB, (index, x, y, z, w), (F, "glVertexAttrib4d(%d, %f, %f, %f, %f);\n", index, x, y, z, w));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib4dARB)(GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w)
+{
+ DISPATCH(VertexAttrib4dARB, (index, x, y, z, w), (F, "glVertexAttrib4dARB(%d, %f, %f, %f, %f);\n", index, x, y, z, w));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib4dv)(GLuint index, const GLdouble * v)
+{
+ DISPATCH(VertexAttrib4dvARB, (index, v), (F, "glVertexAttrib4dv(%d, %p);\n", index, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib4dvARB)(GLuint index, const GLdouble * v)
+{
+ DISPATCH(VertexAttrib4dvARB, (index, v), (F, "glVertexAttrib4dvARB(%d, %p);\n", index, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib4f)(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
+{
+ DISPATCH(VertexAttrib4fARB, (index, x, y, z, w), (F, "glVertexAttrib4f(%d, %f, %f, %f, %f);\n", index, x, y, z, w));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib4fARB)(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
+{
+ DISPATCH(VertexAttrib4fARB, (index, x, y, z, w), (F, "glVertexAttrib4fARB(%d, %f, %f, %f, %f);\n", index, x, y, z, w));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib4fv)(GLuint index, const GLfloat * v)
+{
+ DISPATCH(VertexAttrib4fvARB, (index, v), (F, "glVertexAttrib4fv(%d, %p);\n", index, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib4fvARB)(GLuint index, const GLfloat * v)
+{
+ DISPATCH(VertexAttrib4fvARB, (index, v), (F, "glVertexAttrib4fvARB(%d, %p);\n", index, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib4iv)(GLuint index, const GLint * v)
+{
+ DISPATCH(VertexAttrib4ivARB, (index, v), (F, "glVertexAttrib4iv(%d, %p);\n", index, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib4ivARB)(GLuint index, const GLint * v)
+{
+ DISPATCH(VertexAttrib4ivARB, (index, v), (F, "glVertexAttrib4ivARB(%d, %p);\n", index, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib4s)(GLuint index, GLshort x, GLshort y, GLshort z, GLshort w)
+{
+ DISPATCH(VertexAttrib4sARB, (index, x, y, z, w), (F, "glVertexAttrib4s(%d, %d, %d, %d, %d);\n", index, x, y, z, w));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib4sARB)(GLuint index, GLshort x, GLshort y, GLshort z, GLshort w)
+{
+ DISPATCH(VertexAttrib4sARB, (index, x, y, z, w), (F, "glVertexAttrib4sARB(%d, %d, %d, %d, %d);\n", index, x, y, z, w));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib4sv)(GLuint index, const GLshort * v)
+{
+ DISPATCH(VertexAttrib4svARB, (index, v), (F, "glVertexAttrib4sv(%d, %p);\n", index, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib4svARB)(GLuint index, const GLshort * v)
+{
+ DISPATCH(VertexAttrib4svARB, (index, v), (F, "glVertexAttrib4svARB(%d, %p);\n", index, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib4ubv)(GLuint index, const GLubyte * v)
+{
+ DISPATCH(VertexAttrib4ubvARB, (index, v), (F, "glVertexAttrib4ubv(%d, %p);\n", index, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib4ubvARB)(GLuint index, const GLubyte * v)
+{
+ DISPATCH(VertexAttrib4ubvARB, (index, v), (F, "glVertexAttrib4ubvARB(%d, %p);\n", index, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib4uiv)(GLuint index, const GLuint * v)
+{
+ DISPATCH(VertexAttrib4uivARB, (index, v), (F, "glVertexAttrib4uiv(%d, %p);\n", index, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib4uivARB)(GLuint index, const GLuint * v)
+{
+ DISPATCH(VertexAttrib4uivARB, (index, v), (F, "glVertexAttrib4uivARB(%d, %p);\n", index, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib4usv)(GLuint index, const GLushort * v)
+{
+ DISPATCH(VertexAttrib4usvARB, (index, v), (F, "glVertexAttrib4usv(%d, %p);\n", index, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib4usvARB)(GLuint index, const GLushort * v)
+{
+ DISPATCH(VertexAttrib4usvARB, (index, v), (F, "glVertexAttrib4usvARB(%d, %p);\n", index, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttribPointer)(GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid * pointer)
+{
+ DISPATCH(VertexAttribPointerARB, (index, size, type, normalized, stride, pointer), (F, "glVertexAttribPointer(%d, %d, 0x%x, %d, %d, %p);\n", index, size, type, normalized, stride, (const void *) pointer));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttribPointerARB)(GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid * pointer)
+{
+ DISPATCH(VertexAttribPointerARB, (index, size, type, normalized, stride, pointer), (F, "glVertexAttribPointerARB(%d, %d, 0x%x, %d, %d, %p);\n", index, size, type, normalized, stride, (const void *) pointer));
+}
+
+KEYWORD1 void KEYWORD2 NAME(BindBuffer)(GLenum target, GLuint buffer)
+{
+ DISPATCH(BindBufferARB, (target, buffer), (F, "glBindBuffer(0x%x, %d);\n", target, buffer));
+}
+
+KEYWORD1 void KEYWORD2 NAME(BindBufferARB)(GLenum target, GLuint buffer)
+{
+ DISPATCH(BindBufferARB, (target, buffer), (F, "glBindBufferARB(0x%x, %d);\n", target, buffer));
+}
+
+KEYWORD1 void KEYWORD2 NAME(BufferData)(GLenum target, GLsizeiptr size, const GLvoid * data, GLenum usage)
+{
+ DISPATCH(BufferDataARB, (target, size, data, usage), (F, "glBufferData(0x%x, %d, %p, 0x%x);\n", target, size, (const void *) data, usage));
+}
+
+KEYWORD1 void KEYWORD2 NAME(BufferDataARB)(GLenum target, GLsizeiptrARB size, const GLvoid * data, GLenum usage)
+{
+ DISPATCH(BufferDataARB, (target, size, data, usage), (F, "glBufferDataARB(0x%x, %d, %p, 0x%x);\n", target, size, (const void *) data, usage));
+}
+
+KEYWORD1 void KEYWORD2 NAME(BufferSubData)(GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid * data)
+{
+ DISPATCH(BufferSubDataARB, (target, offset, size, data), (F, "glBufferSubData(0x%x, %d, %d, %p);\n", target, offset, size, (const void *) data));
+}
+
+KEYWORD1 void KEYWORD2 NAME(BufferSubDataARB)(GLenum target, GLintptrARB offset, GLsizeiptrARB size, const GLvoid * data)
+{
+ DISPATCH(BufferSubDataARB, (target, offset, size, data), (F, "glBufferSubDataARB(0x%x, %d, %d, %p);\n", target, offset, size, (const void *) data));
+}
+
+KEYWORD1 void KEYWORD2 NAME(DeleteBuffers)(GLsizei n, const GLuint * buffer)
+{
+ DISPATCH(DeleteBuffersARB, (n, buffer), (F, "glDeleteBuffers(%d, %p);\n", n, (const void *) buffer));
+}
+
+KEYWORD1 void KEYWORD2 NAME(DeleteBuffersARB)(GLsizei n, const GLuint * buffer)
+{
+ DISPATCH(DeleteBuffersARB, (n, buffer), (F, "glDeleteBuffersARB(%d, %p);\n", n, (const void *) buffer));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GenBuffers)(GLsizei n, GLuint * buffer)
+{
+ DISPATCH(GenBuffersARB, (n, buffer), (F, "glGenBuffers(%d, %p);\n", n, (const void *) buffer));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GenBuffersARB)(GLsizei n, GLuint * buffer)
+{
+ DISPATCH(GenBuffersARB, (n, buffer), (F, "glGenBuffersARB(%d, %p);\n", n, (const void *) buffer));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetBufferParameteriv)(GLenum target, GLenum pname, GLint * params)
+{
+ DISPATCH(GetBufferParameterivARB, (target, pname, params), (F, "glGetBufferParameteriv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetBufferParameterivARB)(GLenum target, GLenum pname, GLint * params)
+{
+ DISPATCH(GetBufferParameterivARB, (target, pname, params), (F, "glGetBufferParameterivARB(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetBufferPointerv)(GLenum target, GLenum pname, GLvoid ** params)
+{
+ DISPATCH(GetBufferPointervARB, (target, pname, params), (F, "glGetBufferPointerv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetBufferPointervARB)(GLenum target, GLenum pname, GLvoid ** params)
+{
+ DISPATCH(GetBufferPointervARB, (target, pname, params), (F, "glGetBufferPointervARB(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetBufferSubData)(GLenum target, GLintptr offset, GLsizeiptr size, GLvoid * data)
+{
+ DISPATCH(GetBufferSubDataARB, (target, offset, size, data), (F, "glGetBufferSubData(0x%x, %d, %d, %p);\n", target, offset, size, (const void *) data));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetBufferSubDataARB)(GLenum target, GLintptrARB offset, GLsizeiptrARB size, GLvoid * data)
+{
+ DISPATCH(GetBufferSubDataARB, (target, offset, size, data), (F, "glGetBufferSubDataARB(0x%x, %d, %d, %p);\n", target, offset, size, (const void *) data));
+}
+
+KEYWORD1 GLboolean KEYWORD2 NAME(IsBuffer)(GLuint buffer)
+{
+ RETURN_DISPATCH(IsBufferARB, (buffer), (F, "glIsBuffer(%d);\n", buffer));
+}
+
+KEYWORD1 GLboolean KEYWORD2 NAME(IsBufferARB)(GLuint buffer)
+{
+ RETURN_DISPATCH(IsBufferARB, (buffer), (F, "glIsBufferARB(%d);\n", buffer));
+}
+
+KEYWORD1 GLvoid * KEYWORD2 NAME(MapBuffer)(GLenum target, GLenum access)
+{
+ RETURN_DISPATCH(MapBufferARB, (target, access), (F, "glMapBuffer(0x%x, 0x%x);\n", target, access));
+}
+
+KEYWORD1 GLvoid * KEYWORD2 NAME(MapBufferARB)(GLenum target, GLenum access)
+{
+ RETURN_DISPATCH(MapBufferARB, (target, access), (F, "glMapBufferARB(0x%x, 0x%x);\n", target, access));
+}
+
+KEYWORD1 GLboolean KEYWORD2 NAME(UnmapBuffer)(GLenum target)
+{
+ RETURN_DISPATCH(UnmapBufferARB, (target), (F, "glUnmapBuffer(0x%x);\n", target));
+}
+
+KEYWORD1 GLboolean KEYWORD2 NAME(UnmapBufferARB)(GLenum target)
+{
+ RETURN_DISPATCH(UnmapBufferARB, (target), (F, "glUnmapBufferARB(0x%x);\n", target));
+}
+
+KEYWORD1 void KEYWORD2 NAME(BeginQuery)(GLenum target, GLuint id)
+{
+ DISPATCH(BeginQueryARB, (target, id), (F, "glBeginQuery(0x%x, %d);\n", target, id));
+}
+
+KEYWORD1 void KEYWORD2 NAME(BeginQueryARB)(GLenum target, GLuint id)
+{
+ DISPATCH(BeginQueryARB, (target, id), (F, "glBeginQueryARB(0x%x, %d);\n", target, id));
+}
+
+KEYWORD1 void KEYWORD2 NAME(DeleteQueries)(GLsizei n, const GLuint * ids)
+{
+ DISPATCH(DeleteQueriesARB, (n, ids), (F, "glDeleteQueries(%d, %p);\n", n, (const void *) ids));
+}
+
+KEYWORD1 void KEYWORD2 NAME(DeleteQueriesARB)(GLsizei n, const GLuint * ids)
+{
+ DISPATCH(DeleteQueriesARB, (n, ids), (F, "glDeleteQueriesARB(%d, %p);\n", n, (const void *) ids));
+}
+
+KEYWORD1 void KEYWORD2 NAME(EndQuery)(GLenum target)
+{
+ DISPATCH(EndQueryARB, (target), (F, "glEndQuery(0x%x);\n", target));
+}
+
+KEYWORD1 void KEYWORD2 NAME(EndQueryARB)(GLenum target)
+{
+ DISPATCH(EndQueryARB, (target), (F, "glEndQueryARB(0x%x);\n", target));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GenQueries)(GLsizei n, GLuint * ids)
+{
+ DISPATCH(GenQueriesARB, (n, ids), (F, "glGenQueries(%d, %p);\n", n, (const void *) ids));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GenQueriesARB)(GLsizei n, GLuint * ids)
+{
+ DISPATCH(GenQueriesARB, (n, ids), (F, "glGenQueriesARB(%d, %p);\n", n, (const void *) ids));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetQueryObjectiv)(GLuint id, GLenum pname, GLint * params)
+{
+ DISPATCH(GetQueryObjectivARB, (id, pname, params), (F, "glGetQueryObjectiv(%d, 0x%x, %p);\n", id, pname, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetQueryObjectivARB)(GLuint id, GLenum pname, GLint * params)
+{
+ DISPATCH(GetQueryObjectivARB, (id, pname, params), (F, "glGetQueryObjectivARB(%d, 0x%x, %p);\n", id, pname, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetQueryObjectuiv)(GLuint id, GLenum pname, GLuint * params)
+{
+ DISPATCH(GetQueryObjectuivARB, (id, pname, params), (F, "glGetQueryObjectuiv(%d, 0x%x, %p);\n", id, pname, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetQueryObjectuivARB)(GLuint id, GLenum pname, GLuint * params)
+{
+ DISPATCH(GetQueryObjectuivARB, (id, pname, params), (F, "glGetQueryObjectuivARB(%d, 0x%x, %p);\n", id, pname, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetQueryiv)(GLenum target, GLenum pname, GLint * params)
+{
+ DISPATCH(GetQueryivARB, (target, pname, params), (F, "glGetQueryiv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetQueryivARB)(GLenum target, GLenum pname, GLint * params)
+{
+ DISPATCH(GetQueryivARB, (target, pname, params), (F, "glGetQueryivARB(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
+}
+
+KEYWORD1 GLboolean KEYWORD2 NAME(IsQuery)(GLuint id)
+{
+ RETURN_DISPATCH(IsQueryARB, (id), (F, "glIsQuery(%d);\n", id));
+}
+
+KEYWORD1 GLboolean KEYWORD2 NAME(IsQueryARB)(GLuint id)
+{
+ RETURN_DISPATCH(IsQueryARB, (id), (F, "glIsQueryARB(%d);\n", id));
+}
+
+KEYWORD1 void KEYWORD2 NAME(AttachObjectARB)(GLhandleARB containerObj, GLhandleARB obj)
+{
+ DISPATCH(AttachObjectARB, (containerObj, obj), (F, "glAttachObjectARB(%d, %d);\n", containerObj, obj));
+}
+
+KEYWORD1 void KEYWORD2 NAME(CompileShader)(GLuint shader)
+{
+ DISPATCH(CompileShaderARB, (shader), (F, "glCompileShader(%d);\n", shader));
+}
+
+KEYWORD1 void KEYWORD2 NAME(CompileShaderARB)(GLhandleARB shader)
+{
+ DISPATCH(CompileShaderARB, (shader), (F, "glCompileShaderARB(%d);\n", shader));
+}
+
+KEYWORD1 GLhandleARB KEYWORD2 NAME(CreateProgramObjectARB)(void)
+{
+ RETURN_DISPATCH(CreateProgramObjectARB, (), (F, "glCreateProgramObjectARB();\n"));
+}
+
+KEYWORD1 GLhandleARB KEYWORD2 NAME(CreateShaderObjectARB)(GLenum shaderType)
+{
+ RETURN_DISPATCH(CreateShaderObjectARB, (shaderType), (F, "glCreateShaderObjectARB(0x%x);\n", shaderType));
+}
+
+KEYWORD1 void KEYWORD2 NAME(DeleteObjectARB)(GLhandleARB obj)
+{
+ DISPATCH(DeleteObjectARB, (obj), (F, "glDeleteObjectARB(%d);\n", obj));
+}
+
+KEYWORD1 void KEYWORD2 NAME(DetachObjectARB)(GLhandleARB containerObj, GLhandleARB attachedObj)
+{
+ DISPATCH(DetachObjectARB, (containerObj, attachedObj), (F, "glDetachObjectARB(%d, %d);\n", containerObj, attachedObj));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetActiveUniform)(GLuint program, GLuint index, GLsizei bufSize, GLsizei * length, GLint * size, GLenum * type, GLchar * name)
+{
+ DISPATCH(GetActiveUniformARB, (program, index, bufSize, length, size, type, name), (F, "glGetActiveUniform(%d, %d, %d, %p, %p, %p, %p);\n", program, index, bufSize, (const void *) length, (const void *) size, (const void *) type, (const void *) name));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetActiveUniformARB)(GLhandleARB program, GLuint index, GLsizei bufSize, GLsizei * length, GLint * size, GLenum * type, GLcharARB * name)
+{
+ DISPATCH(GetActiveUniformARB, (program, index, bufSize, length, size, type, name), (F, "glGetActiveUniformARB(%d, %d, %d, %p, %p, %p, %p);\n", program, index, bufSize, (const void *) length, (const void *) size, (const void *) type, (const void *) name));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetAttachedObjectsARB)(GLhandleARB containerObj, GLsizei maxLength, GLsizei * length, GLhandleARB * infoLog)
+{
+ DISPATCH(GetAttachedObjectsARB, (containerObj, maxLength, length, infoLog), (F, "glGetAttachedObjectsARB(%d, %d, %p, %p);\n", containerObj, maxLength, (const void *) length, (const void *) infoLog));
+}
+
+KEYWORD1 GLhandleARB KEYWORD2 NAME(GetHandleARB)(GLenum pname)
+{
+ RETURN_DISPATCH(GetHandleARB, (pname), (F, "glGetHandleARB(0x%x);\n", pname));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetInfoLogARB)(GLhandleARB obj, GLsizei maxLength, GLsizei * length, GLcharARB * infoLog)
+{
+ DISPATCH(GetInfoLogARB, (obj, maxLength, length, infoLog), (F, "glGetInfoLogARB(%d, %d, %p, %p);\n", obj, maxLength, (const void *) length, (const void *) infoLog));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetObjectParameterfvARB)(GLhandleARB obj, GLenum pname, GLfloat * params)
+{
+ DISPATCH(GetObjectParameterfvARB, (obj, pname, params), (F, "glGetObjectParameterfvARB(%d, 0x%x, %p);\n", obj, pname, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetObjectParameterivARB)(GLhandleARB obj, GLenum pname, GLint * params)
+{
+ DISPATCH(GetObjectParameterivARB, (obj, pname, params), (F, "glGetObjectParameterivARB(%d, 0x%x, %p);\n", obj, pname, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetShaderSource)(GLuint shader, GLsizei bufSize, GLsizei * length, GLchar * source)
+{
+ DISPATCH(GetShaderSourceARB, (shader, bufSize, length, source), (F, "glGetShaderSource(%d, %d, %p, %p);\n", shader, bufSize, (const void *) length, (const void *) source));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetShaderSourceARB)(GLhandleARB shader, GLsizei bufSize, GLsizei * length, GLcharARB * source)
+{
+ DISPATCH(GetShaderSourceARB, (shader, bufSize, length, source), (F, "glGetShaderSourceARB(%d, %d, %p, %p);\n", shader, bufSize, (const void *) length, (const void *) source));
+}
+
+KEYWORD1 GLint KEYWORD2 NAME(GetUniformLocation)(GLuint program, const GLchar * name)
+{
+ RETURN_DISPATCH(GetUniformLocationARB, (program, name), (F, "glGetUniformLocation(%d, %p);\n", program, (const void *) name));
+}
+
+KEYWORD1 GLint KEYWORD2 NAME(GetUniformLocationARB)(GLhandleARB program, const GLcharARB * name)
+{
+ RETURN_DISPATCH(GetUniformLocationARB, (program, name), (F, "glGetUniformLocationARB(%d, %p);\n", program, (const void *) name));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetUniformfv)(GLuint program, GLint location, GLfloat * params)
+{
+ DISPATCH(GetUniformfvARB, (program, location, params), (F, "glGetUniformfv(%d, %d, %p);\n", program, location, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetUniformfvARB)(GLhandleARB program, GLint location, GLfloat * params)
+{
+ DISPATCH(GetUniformfvARB, (program, location, params), (F, "glGetUniformfvARB(%d, %d, %p);\n", program, location, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetUniformiv)(GLuint program, GLint location, GLint * params)
+{
+ DISPATCH(GetUniformivARB, (program, location, params), (F, "glGetUniformiv(%d, %d, %p);\n", program, location, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetUniformivARB)(GLhandleARB program, GLint location, GLint * params)
+{
+ DISPATCH(GetUniformivARB, (program, location, params), (F, "glGetUniformivARB(%d, %d, %p);\n", program, location, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(LinkProgram)(GLuint program)
+{
+ DISPATCH(LinkProgramARB, (program), (F, "glLinkProgram(%d);\n", program));
+}
+
+KEYWORD1 void KEYWORD2 NAME(LinkProgramARB)(GLhandleARB program)
+{
+ DISPATCH(LinkProgramARB, (program), (F, "glLinkProgramARB(%d);\n", program));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ShaderSource)(GLuint shader, GLsizei count, const GLchar ** string, const GLint * length)
+{
+ DISPATCH(ShaderSourceARB, (shader, count, string, length), (F, "glShaderSource(%d, %d, %p, %p);\n", shader, count, (const void *) string, (const void *) length));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ShaderSourceARB)(GLhandleARB shader, GLsizei count, const GLcharARB ** string, const GLint * length)
+{
+ DISPATCH(ShaderSourceARB, (shader, count, string, length), (F, "glShaderSourceARB(%d, %d, %p, %p);\n", shader, count, (const void *) string, (const void *) length));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Uniform1f)(GLint location, GLfloat v0)
+{
+ DISPATCH(Uniform1fARB, (location, v0), (F, "glUniform1f(%d, %f);\n", location, v0));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Uniform1fARB)(GLint location, GLfloat v0)
+{
+ DISPATCH(Uniform1fARB, (location, v0), (F, "glUniform1fARB(%d, %f);\n", location, v0));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Uniform1fv)(GLint location, GLsizei count, const GLfloat * value)
+{
+ DISPATCH(Uniform1fvARB, (location, count, value), (F, "glUniform1fv(%d, %d, %p);\n", location, count, (const void *) value));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Uniform1fvARB)(GLint location, GLsizei count, const GLfloat * value)
+{
+ DISPATCH(Uniform1fvARB, (location, count, value), (F, "glUniform1fvARB(%d, %d, %p);\n", location, count, (const void *) value));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Uniform1i)(GLint location, GLint v0)
+{
+ DISPATCH(Uniform1iARB, (location, v0), (F, "glUniform1i(%d, %d);\n", location, v0));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Uniform1iARB)(GLint location, GLint v0)
+{
+ DISPATCH(Uniform1iARB, (location, v0), (F, "glUniform1iARB(%d, %d);\n", location, v0));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Uniform1iv)(GLint location, GLsizei count, const GLint * value)
+{
+ DISPATCH(Uniform1ivARB, (location, count, value), (F, "glUniform1iv(%d, %d, %p);\n", location, count, (const void *) value));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Uniform1ivARB)(GLint location, GLsizei count, const GLint * value)
+{
+ DISPATCH(Uniform1ivARB, (location, count, value), (F, "glUniform1ivARB(%d, %d, %p);\n", location, count, (const void *) value));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Uniform2f)(GLint location, GLfloat v0, GLfloat v1)
+{
+ DISPATCH(Uniform2fARB, (location, v0, v1), (F, "glUniform2f(%d, %f, %f);\n", location, v0, v1));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Uniform2fARB)(GLint location, GLfloat v0, GLfloat v1)
+{
+ DISPATCH(Uniform2fARB, (location, v0, v1), (F, "glUniform2fARB(%d, %f, %f);\n", location, v0, v1));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Uniform2fv)(GLint location, GLsizei count, const GLfloat * value)
+{
+ DISPATCH(Uniform2fvARB, (location, count, value), (F, "glUniform2fv(%d, %d, %p);\n", location, count, (const void *) value));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Uniform2fvARB)(GLint location, GLsizei count, const GLfloat * value)
+{
+ DISPATCH(Uniform2fvARB, (location, count, value), (F, "glUniform2fvARB(%d, %d, %p);\n", location, count, (const void *) value));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Uniform2i)(GLint location, GLint v0, GLint v1)
+{
+ DISPATCH(Uniform2iARB, (location, v0, v1), (F, "glUniform2i(%d, %d, %d);\n", location, v0, v1));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Uniform2iARB)(GLint location, GLint v0, GLint v1)
+{
+ DISPATCH(Uniform2iARB, (location, v0, v1), (F, "glUniform2iARB(%d, %d, %d);\n", location, v0, v1));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Uniform2iv)(GLint location, GLsizei count, const GLint * value)
+{
+ DISPATCH(Uniform2ivARB, (location, count, value), (F, "glUniform2iv(%d, %d, %p);\n", location, count, (const void *) value));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Uniform2ivARB)(GLint location, GLsizei count, const GLint * value)
+{
+ DISPATCH(Uniform2ivARB, (location, count, value), (F, "glUniform2ivARB(%d, %d, %p);\n", location, count, (const void *) value));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Uniform3f)(GLint location, GLfloat v0, GLfloat v1, GLfloat v2)
+{
+ DISPATCH(Uniform3fARB, (location, v0, v1, v2), (F, "glUniform3f(%d, %f, %f, %f);\n", location, v0, v1, v2));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Uniform3fARB)(GLint location, GLfloat v0, GLfloat v1, GLfloat v2)
+{
+ DISPATCH(Uniform3fARB, (location, v0, v1, v2), (F, "glUniform3fARB(%d, %f, %f, %f);\n", location, v0, v1, v2));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Uniform3fv)(GLint location, GLsizei count, const GLfloat * value)
+{
+ DISPATCH(Uniform3fvARB, (location, count, value), (F, "glUniform3fv(%d, %d, %p);\n", location, count, (const void *) value));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Uniform3fvARB)(GLint location, GLsizei count, const GLfloat * value)
+{
+ DISPATCH(Uniform3fvARB, (location, count, value), (F, "glUniform3fvARB(%d, %d, %p);\n", location, count, (const void *) value));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Uniform3i)(GLint location, GLint v0, GLint v1, GLint v2)
+{
+ DISPATCH(Uniform3iARB, (location, v0, v1, v2), (F, "glUniform3i(%d, %d, %d, %d);\n", location, v0, v1, v2));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Uniform3iARB)(GLint location, GLint v0, GLint v1, GLint v2)
+{
+ DISPATCH(Uniform3iARB, (location, v0, v1, v2), (F, "glUniform3iARB(%d, %d, %d, %d);\n", location, v0, v1, v2));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Uniform3iv)(GLint location, GLsizei count, const GLint * value)
+{
+ DISPATCH(Uniform3ivARB, (location, count, value), (F, "glUniform3iv(%d, %d, %p);\n", location, count, (const void *) value));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Uniform3ivARB)(GLint location, GLsizei count, const GLint * value)
+{
+ DISPATCH(Uniform3ivARB, (location, count, value), (F, "glUniform3ivARB(%d, %d, %p);\n", location, count, (const void *) value));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Uniform4f)(GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3)
+{
+ DISPATCH(Uniform4fARB, (location, v0, v1, v2, v3), (F, "glUniform4f(%d, %f, %f, %f, %f);\n", location, v0, v1, v2, v3));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Uniform4fARB)(GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3)
+{
+ DISPATCH(Uniform4fARB, (location, v0, v1, v2, v3), (F, "glUniform4fARB(%d, %f, %f, %f, %f);\n", location, v0, v1, v2, v3));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Uniform4fv)(GLint location, GLsizei count, const GLfloat * value)
+{
+ DISPATCH(Uniform4fvARB, (location, count, value), (F, "glUniform4fv(%d, %d, %p);\n", location, count, (const void *) value));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Uniform4fvARB)(GLint location, GLsizei count, const GLfloat * value)
+{
+ DISPATCH(Uniform4fvARB, (location, count, value), (F, "glUniform4fvARB(%d, %d, %p);\n", location, count, (const void *) value));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Uniform4i)(GLint location, GLint v0, GLint v1, GLint v2, GLint v3)
+{
+ DISPATCH(Uniform4iARB, (location, v0, v1, v2, v3), (F, "glUniform4i(%d, %d, %d, %d, %d);\n", location, v0, v1, v2, v3));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Uniform4iARB)(GLint location, GLint v0, GLint v1, GLint v2, GLint v3)
+{
+ DISPATCH(Uniform4iARB, (location, v0, v1, v2, v3), (F, "glUniform4iARB(%d, %d, %d, %d, %d);\n", location, v0, v1, v2, v3));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Uniform4iv)(GLint location, GLsizei count, const GLint * value)
+{
+ DISPATCH(Uniform4ivARB, (location, count, value), (F, "glUniform4iv(%d, %d, %p);\n", location, count, (const void *) value));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Uniform4ivARB)(GLint location, GLsizei count, const GLint * value)
+{
+ DISPATCH(Uniform4ivARB, (location, count, value), (F, "glUniform4ivARB(%d, %d, %p);\n", location, count, (const void *) value));
+}
+
+KEYWORD1 void KEYWORD2 NAME(UniformMatrix2fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value)
+{
+ DISPATCH(UniformMatrix2fvARB, (location, count, transpose, value), (F, "glUniformMatrix2fv(%d, %d, %d, %p);\n", location, count, transpose, (const void *) value));
+}
+
+KEYWORD1 void KEYWORD2 NAME(UniformMatrix2fvARB)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value)
+{
+ DISPATCH(UniformMatrix2fvARB, (location, count, transpose, value), (F, "glUniformMatrix2fvARB(%d, %d, %d, %p);\n", location, count, transpose, (const void *) value));
+}
+
+KEYWORD1 void KEYWORD2 NAME(UniformMatrix3fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value)
+{
+ DISPATCH(UniformMatrix3fvARB, (location, count, transpose, value), (F, "glUniformMatrix3fv(%d, %d, %d, %p);\n", location, count, transpose, (const void *) value));
+}
+
+KEYWORD1 void KEYWORD2 NAME(UniformMatrix3fvARB)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value)
+{
+ DISPATCH(UniformMatrix3fvARB, (location, count, transpose, value), (F, "glUniformMatrix3fvARB(%d, %d, %d, %p);\n", location, count, transpose, (const void *) value));
+}
+
+KEYWORD1 void KEYWORD2 NAME(UniformMatrix4fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value)
+{
+ DISPATCH(UniformMatrix4fvARB, (location, count, transpose, value), (F, "glUniformMatrix4fv(%d, %d, %d, %p);\n", location, count, transpose, (const void *) value));
+}
+
+KEYWORD1 void KEYWORD2 NAME(UniformMatrix4fvARB)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value)
+{
+ DISPATCH(UniformMatrix4fvARB, (location, count, transpose, value), (F, "glUniformMatrix4fvARB(%d, %d, %d, %p);\n", location, count, transpose, (const void *) value));
+}
+
+KEYWORD1 void KEYWORD2 NAME(UseProgram)(GLuint program)
+{
+ DISPATCH(UseProgramObjectARB, (program), (F, "glUseProgram(%d);\n", program));
+}
+
+KEYWORD1 void KEYWORD2 NAME(UseProgramObjectARB)(GLhandleARB program)
+{
+ DISPATCH(UseProgramObjectARB, (program), (F, "glUseProgramObjectARB(%d);\n", program));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ValidateProgram)(GLuint program)
+{
+ DISPATCH(ValidateProgramARB, (program), (F, "glValidateProgram(%d);\n", program));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ValidateProgramARB)(GLhandleARB program)
+{
+ DISPATCH(ValidateProgramARB, (program), (F, "glValidateProgramARB(%d);\n", program));
+}
+
+KEYWORD1 void KEYWORD2 NAME(BindAttribLocation)(GLuint program, GLuint index, const GLchar * name)
+{
+ DISPATCH(BindAttribLocationARB, (program, index, name), (F, "glBindAttribLocation(%d, %d, %p);\n", program, index, (const void *) name));
+}
+
+KEYWORD1 void KEYWORD2 NAME(BindAttribLocationARB)(GLhandleARB program, GLuint index, const GLcharARB * name)
+{
+ DISPATCH(BindAttribLocationARB, (program, index, name), (F, "glBindAttribLocationARB(%d, %d, %p);\n", program, index, (const void *) name));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetActiveAttrib)(GLuint program, GLuint index, GLsizei bufSize, GLsizei * length, GLint * size, GLenum * type, GLchar * name)
+{
+ DISPATCH(GetActiveAttribARB, (program, index, bufSize, length, size, type, name), (F, "glGetActiveAttrib(%d, %d, %d, %p, %p, %p, %p);\n", program, index, bufSize, (const void *) length, (const void *) size, (const void *) type, (const void *) name));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetActiveAttribARB)(GLhandleARB program, GLuint index, GLsizei bufSize, GLsizei * length, GLint * size, GLenum * type, GLcharARB * name)
+{
+ DISPATCH(GetActiveAttribARB, (program, index, bufSize, length, size, type, name), (F, "glGetActiveAttribARB(%d, %d, %d, %p, %p, %p, %p);\n", program, index, bufSize, (const void *) length, (const void *) size, (const void *) type, (const void *) name));
+}
+
+KEYWORD1 GLint KEYWORD2 NAME(GetAttribLocation)(GLuint program, const GLchar * name)
+{
+ RETURN_DISPATCH(GetAttribLocationARB, (program, name), (F, "glGetAttribLocation(%d, %p);\n", program, (const void *) name));
+}
+
+KEYWORD1 GLint KEYWORD2 NAME(GetAttribLocationARB)(GLhandleARB program, const GLcharARB * name)
+{
+ RETURN_DISPATCH(GetAttribLocationARB, (program, name), (F, "glGetAttribLocationARB(%d, %p);\n", program, (const void *) name));
+}
+
+KEYWORD1 void KEYWORD2 NAME(DrawBuffers)(GLsizei n, const GLenum * bufs)
+{
+ DISPATCH(DrawBuffersARB, (n, bufs), (F, "glDrawBuffers(%d, %p);\n", n, (const void *) bufs));
+}
+
+KEYWORD1 void KEYWORD2 NAME(DrawBuffersARB)(GLsizei n, const GLenum * bufs)
+{
+ DISPATCH(DrawBuffersARB, (n, bufs), (F, "glDrawBuffersARB(%d, %p);\n", n, (const void *) bufs));
+}
+
+KEYWORD1 void KEYWORD2 NAME(DrawBuffersATI)(GLsizei n, const GLenum * bufs)
+{
+ DISPATCH(DrawBuffersARB, (n, bufs), (F, "glDrawBuffersATI(%d, %p);\n", n, (const void *) bufs));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ClampColorARB)(GLenum target, GLenum clamp)
+{
+ DISPATCH(ClampColorARB, (target, clamp), (F, "glClampColorARB(0x%x, 0x%x);\n", target, clamp));
+}
+
+KEYWORD1 void KEYWORD2 NAME(DrawArraysInstancedARB)(GLenum mode, GLint first, GLsizei count, GLsizei primcount)
+{
+ DISPATCH(DrawArraysInstancedARB, (mode, first, count, primcount), (F, "glDrawArraysInstancedARB(0x%x, %d, %d, %d);\n", mode, first, count, primcount));
+}
+
+KEYWORD1 void KEYWORD2 NAME(DrawArraysInstancedEXT)(GLenum mode, GLint first, GLsizei count, GLsizei primcount)
+{
+ DISPATCH(DrawArraysInstancedARB, (mode, first, count, primcount), (F, "glDrawArraysInstancedEXT(0x%x, %d, %d, %d);\n", mode, first, count, primcount));
+}
+
+KEYWORD1 void KEYWORD2 NAME(DrawArraysInstanced)(GLenum mode, GLint first, GLsizei count, GLsizei primcount)
+{
+ DISPATCH(DrawArraysInstancedARB, (mode, first, count, primcount), (F, "glDrawArraysInstanced(0x%x, %d, %d, %d);\n", mode, first, count, primcount));
+}
+
+KEYWORD1 void KEYWORD2 NAME(DrawElementsInstancedARB)(GLenum mode, GLsizei count, GLenum type, const GLvoid * indices, GLsizei primcount)
+{
+ DISPATCH(DrawElementsInstancedARB, (mode, count, type, indices, primcount), (F, "glDrawElementsInstancedARB(0x%x, %d, 0x%x, %p, %d);\n", mode, count, type, (const void *) indices, primcount));
+}
+
+KEYWORD1 void KEYWORD2 NAME(DrawElementsInstancedEXT)(GLenum mode, GLsizei count, GLenum type, const GLvoid * indices, GLsizei primcount)
+{
+ DISPATCH(DrawElementsInstancedARB, (mode, count, type, indices, primcount), (F, "glDrawElementsInstancedEXT(0x%x, %d, 0x%x, %p, %d);\n", mode, count, type, (const void *) indices, primcount));
+}
+
+KEYWORD1 void KEYWORD2 NAME(DrawElementsInstanced)(GLenum mode, GLsizei count, GLenum type, const GLvoid * indices, GLsizei primcount)
+{
+ DISPATCH(DrawElementsInstancedARB, (mode, count, type, indices, primcount), (F, "glDrawElementsInstanced(0x%x, %d, 0x%x, %p, %d);\n", mode, count, type, (const void *) indices, primcount));
+}
+
+KEYWORD1 void KEYWORD2 NAME(RenderbufferStorageMultisample)(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height)
+{
+ DISPATCH(RenderbufferStorageMultisample, (target, samples, internalformat, width, height), (F, "glRenderbufferStorageMultisample(0x%x, %d, 0x%x, %d, %d);\n", target, samples, internalformat, width, height));
+}
+
+KEYWORD1 void KEYWORD2 NAME(RenderbufferStorageMultisampleEXT)(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height)
+{
+ DISPATCH(RenderbufferStorageMultisample, (target, samples, internalformat, width, height), (F, "glRenderbufferStorageMultisampleEXT(0x%x, %d, 0x%x, %d, %d);\n", target, samples, internalformat, width, height));
+}
+
+KEYWORD1 void KEYWORD2 NAME(FramebufferTextureARB)(GLenum target, GLenum attachment, GLuint texture, GLint level)
+{
+ DISPATCH(FramebufferTextureARB, (target, attachment, texture, level), (F, "glFramebufferTextureARB(0x%x, 0x%x, %d, %d);\n", target, attachment, texture, level));
+}
+
+KEYWORD1 void KEYWORD2 NAME(FramebufferTextureFaceARB)(GLenum target, GLenum attachment, GLuint texture, GLint level, GLenum face)
+{
+ DISPATCH(FramebufferTextureFaceARB, (target, attachment, texture, level, face), (F, "glFramebufferTextureFaceARB(0x%x, 0x%x, %d, %d, 0x%x);\n", target, attachment, texture, level, face));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ProgramParameteriARB)(GLuint program, GLenum pname, GLint value)
+{
+ DISPATCH(ProgramParameteriARB, (program, pname, value), (F, "glProgramParameteriARB(%d, 0x%x, %d);\n", program, pname, value));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttribDivisorARB)(GLuint index, GLuint divisor)
+{
+ DISPATCH(VertexAttribDivisorARB, (index, divisor), (F, "glVertexAttribDivisorARB(%d, %d);\n", index, divisor));
+}
+
+KEYWORD1 void KEYWORD2 NAME(FlushMappedBufferRange)(GLenum target, GLintptr offset, GLsizeiptr length)
+{
+ DISPATCH(FlushMappedBufferRange, (target, offset, length), (F, "glFlushMappedBufferRange(0x%x, %d, %d);\n", target, offset, length));
+}
+
+KEYWORD1 GLvoid * KEYWORD2 NAME(MapBufferRange)(GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access)
+{
+ RETURN_DISPATCH(MapBufferRange, (target, offset, length, access), (F, "glMapBufferRange(0x%x, %d, %d, %d);\n", target, offset, length, access));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TexBufferARB)(GLenum target, GLenum internalFormat, GLuint buffer)
+{
+ DISPATCH(TexBufferARB, (target, internalFormat, buffer), (F, "glTexBufferARB(0x%x, 0x%x, %d);\n", target, internalFormat, buffer));
+}
+
+KEYWORD1 void KEYWORD2 NAME(BindVertexArray)(GLuint array)
+{
+ DISPATCH(BindVertexArray, (array), (F, "glBindVertexArray(%d);\n", array));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GenVertexArrays)(GLsizei n, GLuint * arrays)
+{
+ DISPATCH(GenVertexArrays, (n, arrays), (F, "glGenVertexArrays(%d, %p);\n", n, (const void *) arrays));
+}
+
+KEYWORD1 void KEYWORD2 NAME(CopyBufferSubData)(GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size)
+{
+ DISPATCH(CopyBufferSubData, (readTarget, writeTarget, readOffset, writeOffset, size), (F, "glCopyBufferSubData(0x%x, 0x%x, %d, %d, %d);\n", readTarget, writeTarget, readOffset, writeOffset, size));
+}
+
+KEYWORD1 GLenum KEYWORD2 NAME(ClientWaitSync)(GLsync sync, GLbitfield flags, GLuint64 timeout)
+{
+ RETURN_DISPATCH(ClientWaitSync, (sync, flags, timeout), (F, "glClientWaitSync(%d, %d, %d);\n", sync, flags, timeout));
+}
+
+KEYWORD1 void KEYWORD2 NAME(DeleteSync)(GLsync sync)
+{
+ DISPATCH(DeleteSync, (sync), (F, "glDeleteSync(%d);\n", sync));
+}
+
+KEYWORD1 GLsync KEYWORD2 NAME(FenceSync)(GLenum condition, GLbitfield flags)
+{
+ RETURN_DISPATCH(FenceSync, (condition, flags), (F, "glFenceSync(0x%x, %d);\n", condition, flags));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetInteger64v)(GLenum pname, GLint64 * params)
+{
+ DISPATCH(GetInteger64v, (pname, params), (F, "glGetInteger64v(0x%x, %p);\n", pname, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetSynciv)(GLsync sync, GLenum pname, GLsizei bufSize, GLsizei * length, GLint * values)
+{
+ DISPATCH(GetSynciv, (sync, pname, bufSize, length, values), (F, "glGetSynciv(%d, 0x%x, %d, %p, %p);\n", sync, pname, bufSize, (const void *) length, (const void *) values));
+}
+
+KEYWORD1 GLboolean KEYWORD2 NAME(IsSync)(GLsync sync)
+{
+ RETURN_DISPATCH(IsSync, (sync), (F, "glIsSync(%d);\n", sync));
+}
+
+KEYWORD1 void KEYWORD2 NAME(WaitSync)(GLsync sync, GLbitfield flags, GLuint64 timeout)
+{
+ DISPATCH(WaitSync, (sync, flags, timeout), (F, "glWaitSync(%d, %d, %d);\n", sync, flags, timeout));
+}
+
+KEYWORD1 void KEYWORD2 NAME(DrawElementsBaseVertex)(GLenum mode, GLsizei count, GLenum type, const GLvoid * indices, GLint basevertex)
+{
+ DISPATCH(DrawElementsBaseVertex, (mode, count, type, indices, basevertex), (F, "glDrawElementsBaseVertex(0x%x, %d, 0x%x, %p, %d);\n", mode, count, type, (const void *) indices, basevertex));
+}
+
+KEYWORD1 void KEYWORD2 NAME(DrawRangeElementsBaseVertex)(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid * indices, GLint basevertex)
+{
+ DISPATCH(DrawRangeElementsBaseVertex, (mode, start, end, count, type, indices, basevertex), (F, "glDrawRangeElementsBaseVertex(0x%x, %d, %d, %d, 0x%x, %p, %d);\n", mode, start, end, count, type, (const void *) indices, basevertex));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultiDrawElementsBaseVertex)(GLenum mode, const GLsizei * count, GLenum type, const GLvoid ** indices, GLsizei primcount, const GLint * basevertex)
+{
+ DISPATCH(MultiDrawElementsBaseVertex, (mode, count, type, indices, primcount, basevertex), (F, "glMultiDrawElementsBaseVertex(0x%x, %p, 0x%x, %p, %d, %p);\n", mode, (const void *) count, type, (const void *) indices, primcount, (const void *) basevertex));
+}
+
+KEYWORD1 void KEYWORD2 NAME(BlendEquationSeparateiARB)(GLuint buf, GLenum modeRGB, GLenum modeA)
+{
+ DISPATCH(BlendEquationSeparateiARB, (buf, modeRGB, modeA), (F, "glBlendEquationSeparateiARB(%d, 0x%x, 0x%x);\n", buf, modeRGB, modeA));
+}
+
+KEYWORD1 void KEYWORD2 NAME(BlendEquationSeparateIndexedAMD)(GLuint buf, GLenum modeRGB, GLenum modeA)
+{
+ DISPATCH(BlendEquationSeparateiARB, (buf, modeRGB, modeA), (F, "glBlendEquationSeparateIndexedAMD(%d, 0x%x, 0x%x);\n", buf, modeRGB, modeA));
+}
+
+KEYWORD1 void KEYWORD2 NAME(BlendEquationiARB)(GLuint buf, GLenum mode)
+{
+ DISPATCH(BlendEquationiARB, (buf, mode), (F, "glBlendEquationiARB(%d, 0x%x);\n", buf, mode));
+}
+
+KEYWORD1 void KEYWORD2 NAME(BlendEquationIndexedAMD)(GLuint buf, GLenum mode)
+{
+ DISPATCH(BlendEquationiARB, (buf, mode), (F, "glBlendEquationIndexedAMD(%d, 0x%x);\n", buf, mode));
+}
+
+KEYWORD1 void KEYWORD2 NAME(BlendFuncSeparateiARB)(GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcA, GLenum dstA)
+{
+ DISPATCH(BlendFuncSeparateiARB, (buf, srcRGB, dstRGB, srcA, dstA), (F, "glBlendFuncSeparateiARB(%d, 0x%x, 0x%x, 0x%x, 0x%x);\n", buf, srcRGB, dstRGB, srcA, dstA));
+}
+
+KEYWORD1 void KEYWORD2 NAME(BlendFuncSeparateIndexedAMD)(GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcA, GLenum dstA)
+{
+ DISPATCH(BlendFuncSeparateiARB, (buf, srcRGB, dstRGB, srcA, dstA), (F, "glBlendFuncSeparateIndexedAMD(%d, 0x%x, 0x%x, 0x%x, 0x%x);\n", buf, srcRGB, dstRGB, srcA, dstA));
+}
+
+KEYWORD1 void KEYWORD2 NAME(BlendFunciARB)(GLuint buf, GLenum src, GLenum dst)
+{
+ DISPATCH(BlendFunciARB, (buf, src, dst), (F, "glBlendFunciARB(%d, 0x%x, 0x%x);\n", buf, src, dst));
+}
+
+KEYWORD1 void KEYWORD2 NAME(BlendFuncIndexedAMD)(GLuint buf, GLenum src, GLenum dst)
+{
+ DISPATCH(BlendFunciARB, (buf, src, dst), (F, "glBlendFuncIndexedAMD(%d, 0x%x, 0x%x);\n", buf, src, dst));
+}
+
+KEYWORD1 void KEYWORD2 NAME(BindSampler)(GLuint unit, GLuint sampler)
+{
+ DISPATCH(BindSampler, (unit, sampler), (F, "glBindSampler(%d, %d);\n", unit, sampler));
+}
+
+KEYWORD1 void KEYWORD2 NAME(DeleteSamplers)(GLsizei count, const GLuint * samplers)
+{
+ DISPATCH(DeleteSamplers, (count, samplers), (F, "glDeleteSamplers(%d, %p);\n", count, (const void *) samplers));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GenSamplers)(GLsizei count, GLuint * samplers)
+{
+ DISPATCH(GenSamplers, (count, samplers), (F, "glGenSamplers(%d, %p);\n", count, (const void *) samplers));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetSamplerParameterIiv)(GLuint sampler, GLenum pname, GLint * params)
+{
+ DISPATCH(GetSamplerParameterIiv, (sampler, pname, params), (F, "glGetSamplerParameterIiv(%d, 0x%x, %p);\n", sampler, pname, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetSamplerParameterIuiv)(GLuint sampler, GLenum pname, GLuint * params)
+{
+ DISPATCH(GetSamplerParameterIuiv, (sampler, pname, params), (F, "glGetSamplerParameterIuiv(%d, 0x%x, %p);\n", sampler, pname, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetSamplerParameterfv)(GLuint sampler, GLenum pname, GLfloat * params)
+{
+ DISPATCH(GetSamplerParameterfv, (sampler, pname, params), (F, "glGetSamplerParameterfv(%d, 0x%x, %p);\n", sampler, pname, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetSamplerParameteriv)(GLuint sampler, GLenum pname, GLint * params)
+{
+ DISPATCH(GetSamplerParameteriv, (sampler, pname, params), (F, "glGetSamplerParameteriv(%d, 0x%x, %p);\n", sampler, pname, (const void *) params));
+}
+
+KEYWORD1 GLboolean KEYWORD2 NAME(IsSampler)(GLuint sampler)
+{
+ RETURN_DISPATCH(IsSampler, (sampler), (F, "glIsSampler(%d);\n", sampler));
+}
+
+KEYWORD1 void KEYWORD2 NAME(SamplerParameterIiv)(GLuint sampler, GLenum pname, const GLint * params)
+{
+ DISPATCH(SamplerParameterIiv, (sampler, pname, params), (F, "glSamplerParameterIiv(%d, 0x%x, %p);\n", sampler, pname, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(SamplerParameterIuiv)(GLuint sampler, GLenum pname, const GLuint * params)
+{
+ DISPATCH(SamplerParameterIuiv, (sampler, pname, params), (F, "glSamplerParameterIuiv(%d, 0x%x, %p);\n", sampler, pname, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(SamplerParameterf)(GLuint sampler, GLenum pname, GLfloat param)
+{
+ DISPATCH(SamplerParameterf, (sampler, pname, param), (F, "glSamplerParameterf(%d, 0x%x, %f);\n", sampler, pname, param));
+}
+
+KEYWORD1 void KEYWORD2 NAME(SamplerParameterfv)(GLuint sampler, GLenum pname, const GLfloat * params)
+{
+ DISPATCH(SamplerParameterfv, (sampler, pname, params), (F, "glSamplerParameterfv(%d, 0x%x, %p);\n", sampler, pname, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(SamplerParameteri)(GLuint sampler, GLenum pname, GLint param)
+{
+ DISPATCH(SamplerParameteri, (sampler, pname, param), (F, "glSamplerParameteri(%d, 0x%x, %d);\n", sampler, pname, param));
+}
+
+KEYWORD1 void KEYWORD2 NAME(SamplerParameteriv)(GLuint sampler, GLenum pname, const GLint * params)
+{
+ DISPATCH(SamplerParameteriv, (sampler, pname, params), (F, "glSamplerParameteriv(%d, 0x%x, %p);\n", sampler, pname, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(BindTransformFeedback)(GLenum target, GLuint id)
+{
+ DISPATCH(BindTransformFeedback, (target, id), (F, "glBindTransformFeedback(0x%x, %d);\n", target, id));
+}
+
+KEYWORD1 void KEYWORD2 NAME(DeleteTransformFeedbacks)(GLsizei n, const GLuint * ids)
+{
+ DISPATCH(DeleteTransformFeedbacks, (n, ids), (F, "glDeleteTransformFeedbacks(%d, %p);\n", n, (const void *) ids));
+}
+
+KEYWORD1 void KEYWORD2 NAME(DrawTransformFeedback)(GLenum mode, GLuint id)
+{
+ DISPATCH(DrawTransformFeedback, (mode, id), (F, "glDrawTransformFeedback(0x%x, %d);\n", mode, id));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GenTransformFeedbacks)(GLsizei n, GLuint * ids)
+{
+ DISPATCH(GenTransformFeedbacks, (n, ids), (F, "glGenTransformFeedbacks(%d, %p);\n", n, (const void *) ids));
+}
+
+KEYWORD1 GLboolean KEYWORD2 NAME(IsTransformFeedback)(GLuint id)
+{
+ RETURN_DISPATCH(IsTransformFeedback, (id), (F, "glIsTransformFeedback(%d);\n", id));
+}
+
+KEYWORD1 void KEYWORD2 NAME(PauseTransformFeedback)(void)
+{
+ DISPATCH(PauseTransformFeedback, (), (F, "glPauseTransformFeedback();\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ResumeTransformFeedback)(void)
+{
+ DISPATCH(ResumeTransformFeedback, (), (F, "glResumeTransformFeedback();\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ClearDepthf)(GLclampf depth)
+{
+ DISPATCH(ClearDepthf, (depth), (F, "glClearDepthf(%f);\n", depth));
+}
+
+KEYWORD1 void KEYWORD2 NAME(DepthRangef)(GLclampf zNear, GLclampf zFar)
+{
+ DISPATCH(DepthRangef, (zNear, zFar), (F, "glDepthRangef(%f, %f);\n", zNear, zFar));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetShaderPrecisionFormat)(GLenum shadertype, GLenum precisiontype, GLint * range, GLint * precision)
+{
+ DISPATCH(GetShaderPrecisionFormat, (shadertype, precisiontype, range, precision), (F, "glGetShaderPrecisionFormat(0x%x, 0x%x, %p, %p);\n", shadertype, precisiontype, (const void *) range, (const void *) precision));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ReleaseShaderCompiler)(void)
+{
+ DISPATCH(ReleaseShaderCompiler, (), (F, "glReleaseShaderCompiler();\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ShaderBinary)(GLsizei n, const GLuint * shaders, GLenum binaryformat, const GLvoid * binary, GLsizei length)
+{
+ DISPATCH(ShaderBinary, (n, shaders, binaryformat, binary, length), (F, "glShaderBinary(%d, %p, 0x%x, %p, %d);\n", n, (const void *) shaders, binaryformat, (const void *) binary, length));
+}
+
+KEYWORD1 GLenum KEYWORD2 NAME(GetGraphicsResetStatusARB)(void)
+{
+ RETURN_DISPATCH(GetGraphicsResetStatusARB, (), (F, "glGetGraphicsResetStatusARB();\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetnColorTableARB)(GLenum target, GLenum format, GLenum type, GLsizei bufSize, GLvoid * table)
+{
+ DISPATCH(GetnColorTableARB, (target, format, type, bufSize, table), (F, "glGetnColorTableARB(0x%x, 0x%x, 0x%x, %d, %p);\n", target, format, type, bufSize, (const void *) table));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetnCompressedTexImageARB)(GLenum target, GLint lod, GLsizei bufSize, GLvoid * img)
+{
+ DISPATCH(GetnCompressedTexImageARB, (target, lod, bufSize, img), (F, "glGetnCompressedTexImageARB(0x%x, %d, %d, %p);\n", target, lod, bufSize, (const void *) img));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetnConvolutionFilterARB)(GLenum target, GLenum format, GLenum type, GLsizei bufSize, GLvoid * image)
+{
+ DISPATCH(GetnConvolutionFilterARB, (target, format, type, bufSize, image), (F, "glGetnConvolutionFilterARB(0x%x, 0x%x, 0x%x, %d, %p);\n", target, format, type, bufSize, (const void *) image));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetnHistogramARB)(GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, GLvoid * values)
+{
+ DISPATCH(GetnHistogramARB, (target, reset, format, type, bufSize, values), (F, "glGetnHistogramARB(0x%x, %d, 0x%x, 0x%x, %d, %p);\n", target, reset, format, type, bufSize, (const void *) values));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetnMapdvARB)(GLenum target, GLenum query, GLsizei bufSize, GLdouble * v)
+{
+ DISPATCH(GetnMapdvARB, (target, query, bufSize, v), (F, "glGetnMapdvARB(0x%x, 0x%x, %d, %p);\n", target, query, bufSize, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetnMapfvARB)(GLenum target, GLenum query, GLsizei bufSize, GLfloat * v)
+{
+ DISPATCH(GetnMapfvARB, (target, query, bufSize, v), (F, "glGetnMapfvARB(0x%x, 0x%x, %d, %p);\n", target, query, bufSize, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetnMapivARB)(GLenum target, GLenum query, GLsizei bufSize, GLint * v)
+{
+ DISPATCH(GetnMapivARB, (target, query, bufSize, v), (F, "glGetnMapivARB(0x%x, 0x%x, %d, %p);\n", target, query, bufSize, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetnMinmaxARB)(GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, GLvoid * values)
+{
+ DISPATCH(GetnMinmaxARB, (target, reset, format, type, bufSize, values), (F, "glGetnMinmaxARB(0x%x, %d, 0x%x, 0x%x, %d, %p);\n", target, reset, format, type, bufSize, (const void *) values));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetnPixelMapfvARB)(GLenum map, GLsizei bufSize, GLfloat * values)
+{
+ DISPATCH(GetnPixelMapfvARB, (map, bufSize, values), (F, "glGetnPixelMapfvARB(0x%x, %d, %p);\n", map, bufSize, (const void *) values));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetnPixelMapuivARB)(GLenum map, GLsizei bufSize, GLuint * values)
+{
+ DISPATCH(GetnPixelMapuivARB, (map, bufSize, values), (F, "glGetnPixelMapuivARB(0x%x, %d, %p);\n", map, bufSize, (const void *) values));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetnPixelMapusvARB)(GLenum map, GLsizei bufSize, GLushort * values)
+{
+ DISPATCH(GetnPixelMapusvARB, (map, bufSize, values), (F, "glGetnPixelMapusvARB(0x%x, %d, %p);\n", map, bufSize, (const void *) values));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetnPolygonStippleARB)(GLsizei bufSize, GLubyte * pattern)
+{
+ DISPATCH(GetnPolygonStippleARB, (bufSize, pattern), (F, "glGetnPolygonStippleARB(%d, %p);\n", bufSize, (const void *) pattern));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetnSeparableFilterARB)(GLenum target, GLenum format, GLenum type, GLsizei rowBufSize, GLvoid * row, GLsizei columnBufSize, GLvoid * column, GLvoid * span)
+{
+ DISPATCH(GetnSeparableFilterARB, (target, format, type, rowBufSize, row, columnBufSize, column, span), (F, "glGetnSeparableFilterARB(0x%x, 0x%x, 0x%x, %d, %p, %d, %p, %p);\n", target, format, type, rowBufSize, (const void *) row, columnBufSize, (const void *) column, (const void *) span));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetnTexImageARB)(GLenum target, GLint level, GLenum format, GLenum type, GLsizei bufSize, GLvoid * img)
+{
+ DISPATCH(GetnTexImageARB, (target, level, format, type, bufSize, img), (F, "glGetnTexImageARB(0x%x, %d, 0x%x, 0x%x, %d, %p);\n", target, level, format, type, bufSize, (const void *) img));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetnUniformdvARB)(GLhandleARB program, GLint location, GLsizei bufSize, GLdouble * params)
+{
+ DISPATCH(GetnUniformdvARB, (program, location, bufSize, params), (F, "glGetnUniformdvARB(%d, %d, %d, %p);\n", program, location, bufSize, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetnUniformfvARB)(GLhandleARB program, GLint location, GLsizei bufSize, GLfloat * params)
+{
+ DISPATCH(GetnUniformfvARB, (program, location, bufSize, params), (F, "glGetnUniformfvARB(%d, %d, %d, %p);\n", program, location, bufSize, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetnUniformivARB)(GLhandleARB program, GLint location, GLsizei bufSize, GLint * params)
+{
+ DISPATCH(GetnUniformivARB, (program, location, bufSize, params), (F, "glGetnUniformivARB(%d, %d, %d, %p);\n", program, location, bufSize, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetnUniformuivARB)(GLhandleARB program, GLint location, GLsizei bufSize, GLuint * params)
+{
+ DISPATCH(GetnUniformuivARB, (program, location, bufSize, params), (F, "glGetnUniformuivARB(%d, %d, %d, %p);\n", program, location, bufSize, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ReadnPixelsARB)(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, GLvoid * data)
+{
+ DISPATCH(ReadnPixelsARB, (x, y, width, height, format, type, bufSize, data), (F, "glReadnPixelsARB(%d, %d, %d, %d, 0x%x, 0x%x, %d, %p);\n", x, y, width, height, format, type, bufSize, (const void *) data));
+}
+
+KEYWORD1 void KEYWORD2 NAME(PolygonOffsetEXT)(GLfloat factor, GLfloat bias)
+{
+ DISPATCH(PolygonOffsetEXT, (factor, bias), (F, "glPolygonOffsetEXT(%f, %f);\n", factor, bias));
+}
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_647)(GLenum pname, GLfloat * params);
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_647)(GLenum pname, GLfloat * params)
+{
+ DISPATCH(GetPixelTexGenParameterfvSGIS, (pname, params), (F, "glGetPixelTexGenParameterfvSGIS(0x%x, %p);\n", pname, (const void *) params));
+}
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_648)(GLenum pname, GLint * params);
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_648)(GLenum pname, GLint * params)
+{
+ DISPATCH(GetPixelTexGenParameterivSGIS, (pname, params), (F, "glGetPixelTexGenParameterivSGIS(0x%x, %p);\n", pname, (const void *) params));
+}
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_649)(GLenum pname, GLfloat param);
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_649)(GLenum pname, GLfloat param)
+{
+ DISPATCH(PixelTexGenParameterfSGIS, (pname, param), (F, "glPixelTexGenParameterfSGIS(0x%x, %f);\n", pname, param));
+}
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_650)(GLenum pname, const GLfloat * params);
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_650)(GLenum pname, const GLfloat * params)
+{
+ DISPATCH(PixelTexGenParameterfvSGIS, (pname, params), (F, "glPixelTexGenParameterfvSGIS(0x%x, %p);\n", pname, (const void *) params));
+}
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_651)(GLenum pname, GLint param);
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_651)(GLenum pname, GLint param)
+{
+ DISPATCH(PixelTexGenParameteriSGIS, (pname, param), (F, "glPixelTexGenParameteriSGIS(0x%x, %d);\n", pname, param));
+}
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_652)(GLenum pname, const GLint * params);
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_652)(GLenum pname, const GLint * params)
+{
+ DISPATCH(PixelTexGenParameterivSGIS, (pname, params), (F, "glPixelTexGenParameterivSGIS(0x%x, %p);\n", pname, (const void *) params));
+}
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_653)(GLclampf value, GLboolean invert);
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_653)(GLclampf value, GLboolean invert)
+{
+ DISPATCH(SampleMaskSGIS, (value, invert), (F, "glSampleMaskSGIS(%f, %d);\n", value, invert));
+}
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_654)(GLenum pattern);
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_654)(GLenum pattern)
+{
+ DISPATCH(SamplePatternSGIS, (pattern), (F, "glSamplePatternSGIS(0x%x);\n", pattern));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ColorPointerEXT)(GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer)
+{
+ DISPATCH(ColorPointerEXT, (size, type, stride, count, pointer), (F, "glColorPointerEXT(%d, 0x%x, %d, %d, %p);\n", size, type, stride, count, (const void *) pointer));
+}
+
+KEYWORD1 void KEYWORD2 NAME(EdgeFlagPointerEXT)(GLsizei stride, GLsizei count, const GLboolean * pointer)
+{
+ DISPATCH(EdgeFlagPointerEXT, (stride, count, pointer), (F, "glEdgeFlagPointerEXT(%d, %d, %p);\n", stride, count, (const void *) pointer));
+}
+
+KEYWORD1 void KEYWORD2 NAME(IndexPointerEXT)(GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer)
+{
+ DISPATCH(IndexPointerEXT, (type, stride, count, pointer), (F, "glIndexPointerEXT(0x%x, %d, %d, %p);\n", type, stride, count, (const void *) pointer));
+}
+
+KEYWORD1 void KEYWORD2 NAME(NormalPointerEXT)(GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer)
+{
+ DISPATCH(NormalPointerEXT, (type, stride, count, pointer), (F, "glNormalPointerEXT(0x%x, %d, %d, %p);\n", type, stride, count, (const void *) pointer));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TexCoordPointerEXT)(GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer)
+{
+ DISPATCH(TexCoordPointerEXT, (size, type, stride, count, pointer), (F, "glTexCoordPointerEXT(%d, 0x%x, %d, %d, %p);\n", size, type, stride, count, (const void *) pointer));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexPointerEXT)(GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer)
+{
+ DISPATCH(VertexPointerEXT, (size, type, stride, count, pointer), (F, "glVertexPointerEXT(%d, 0x%x, %d, %d, %p);\n", size, type, stride, count, (const void *) pointer));
+}
+
+KEYWORD1 void KEYWORD2 NAME(PointParameterf)(GLenum pname, GLfloat param)
+{
+ DISPATCH(PointParameterfEXT, (pname, param), (F, "glPointParameterf(0x%x, %f);\n", pname, param));
+}
+
+KEYWORD1 void KEYWORD2 NAME(PointParameterfARB)(GLenum pname, GLfloat param)
+{
+ DISPATCH(PointParameterfEXT, (pname, param), (F, "glPointParameterfARB(0x%x, %f);\n", pname, param));
+}
+
+KEYWORD1 void KEYWORD2 NAME(PointParameterfEXT)(GLenum pname, GLfloat param)
+{
+ DISPATCH(PointParameterfEXT, (pname, param), (F, "glPointParameterfEXT(0x%x, %f);\n", pname, param));
+}
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_661)(GLenum pname, GLfloat param);
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_661)(GLenum pname, GLfloat param)
+{
+ DISPATCH(PointParameterfEXT, (pname, param), (F, "glPointParameterfSGIS(0x%x, %f);\n", pname, param));
+}
+
+KEYWORD1 void KEYWORD2 NAME(PointParameterfv)(GLenum pname, const GLfloat * params)
+{
+ DISPATCH(PointParameterfvEXT, (pname, params), (F, "glPointParameterfv(0x%x, %p);\n", pname, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(PointParameterfvARB)(GLenum pname, const GLfloat * params)
+{
+ DISPATCH(PointParameterfvEXT, (pname, params), (F, "glPointParameterfvARB(0x%x, %p);\n", pname, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(PointParameterfvEXT)(GLenum pname, const GLfloat * params)
+{
+ DISPATCH(PointParameterfvEXT, (pname, params), (F, "glPointParameterfvEXT(0x%x, %p);\n", pname, (const void *) params));
+}
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_662)(GLenum pname, const GLfloat * params);
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_662)(GLenum pname, const GLfloat * params)
+{
+ DISPATCH(PointParameterfvEXT, (pname, params), (F, "glPointParameterfvSGIS(0x%x, %p);\n", pname, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(LockArraysEXT)(GLint first, GLsizei count)
+{
+ DISPATCH(LockArraysEXT, (first, count), (F, "glLockArraysEXT(%d, %d);\n", first, count));
+}
+
+KEYWORD1 void KEYWORD2 NAME(UnlockArraysEXT)(void)
+{
+ DISPATCH(UnlockArraysEXT, (), (F, "glUnlockArraysEXT();\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(SecondaryColor3b)(GLbyte red, GLbyte green, GLbyte blue)
+{
+ DISPATCH(SecondaryColor3bEXT, (red, green, blue), (F, "glSecondaryColor3b(%d, %d, %d);\n", red, green, blue));
+}
+
+KEYWORD1 void KEYWORD2 NAME(SecondaryColor3bEXT)(GLbyte red, GLbyte green, GLbyte blue)
+{
+ DISPATCH(SecondaryColor3bEXT, (red, green, blue), (F, "glSecondaryColor3bEXT(%d, %d, %d);\n", red, green, blue));
+}
+
+KEYWORD1 void KEYWORD2 NAME(SecondaryColor3bv)(const GLbyte * v)
+{
+ DISPATCH(SecondaryColor3bvEXT, (v), (F, "glSecondaryColor3bv(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(SecondaryColor3bvEXT)(const GLbyte * v)
+{
+ DISPATCH(SecondaryColor3bvEXT, (v), (F, "glSecondaryColor3bvEXT(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(SecondaryColor3d)(GLdouble red, GLdouble green, GLdouble blue)
+{
+ DISPATCH(SecondaryColor3dEXT, (red, green, blue), (F, "glSecondaryColor3d(%f, %f, %f);\n", red, green, blue));
+}
+
+KEYWORD1 void KEYWORD2 NAME(SecondaryColor3dEXT)(GLdouble red, GLdouble green, GLdouble blue)
+{
+ DISPATCH(SecondaryColor3dEXT, (red, green, blue), (F, "glSecondaryColor3dEXT(%f, %f, %f);\n", red, green, blue));
+}
+
+KEYWORD1 void KEYWORD2 NAME(SecondaryColor3dv)(const GLdouble * v)
+{
+ DISPATCH(SecondaryColor3dvEXT, (v), (F, "glSecondaryColor3dv(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(SecondaryColor3dvEXT)(const GLdouble * v)
+{
+ DISPATCH(SecondaryColor3dvEXT, (v), (F, "glSecondaryColor3dvEXT(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(SecondaryColor3f)(GLfloat red, GLfloat green, GLfloat blue)
+{
+ DISPATCH(SecondaryColor3fEXT, (red, green, blue), (F, "glSecondaryColor3f(%f, %f, %f);\n", red, green, blue));
+}
+
+KEYWORD1 void KEYWORD2 NAME(SecondaryColor3fEXT)(GLfloat red, GLfloat green, GLfloat blue)
+{
+ DISPATCH(SecondaryColor3fEXT, (red, green, blue), (F, "glSecondaryColor3fEXT(%f, %f, %f);\n", red, green, blue));
+}
+
+KEYWORD1 void KEYWORD2 NAME(SecondaryColor3fv)(const GLfloat * v)
+{
+ DISPATCH(SecondaryColor3fvEXT, (v), (F, "glSecondaryColor3fv(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(SecondaryColor3fvEXT)(const GLfloat * v)
+{
+ DISPATCH(SecondaryColor3fvEXT, (v), (F, "glSecondaryColor3fvEXT(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(SecondaryColor3i)(GLint red, GLint green, GLint blue)
+{
+ DISPATCH(SecondaryColor3iEXT, (red, green, blue), (F, "glSecondaryColor3i(%d, %d, %d);\n", red, green, blue));
+}
+
+KEYWORD1 void KEYWORD2 NAME(SecondaryColor3iEXT)(GLint red, GLint green, GLint blue)
+{
+ DISPATCH(SecondaryColor3iEXT, (red, green, blue), (F, "glSecondaryColor3iEXT(%d, %d, %d);\n", red, green, blue));
+}
+
+KEYWORD1 void KEYWORD2 NAME(SecondaryColor3iv)(const GLint * v)
+{
+ DISPATCH(SecondaryColor3ivEXT, (v), (F, "glSecondaryColor3iv(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(SecondaryColor3ivEXT)(const GLint * v)
+{
+ DISPATCH(SecondaryColor3ivEXT, (v), (F, "glSecondaryColor3ivEXT(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(SecondaryColor3s)(GLshort red, GLshort green, GLshort blue)
+{
+ DISPATCH(SecondaryColor3sEXT, (red, green, blue), (F, "glSecondaryColor3s(%d, %d, %d);\n", red, green, blue));
+}
+
+KEYWORD1 void KEYWORD2 NAME(SecondaryColor3sEXT)(GLshort red, GLshort green, GLshort blue)
+{
+ DISPATCH(SecondaryColor3sEXT, (red, green, blue), (F, "glSecondaryColor3sEXT(%d, %d, %d);\n", red, green, blue));
+}
+
+KEYWORD1 void KEYWORD2 NAME(SecondaryColor3sv)(const GLshort * v)
+{
+ DISPATCH(SecondaryColor3svEXT, (v), (F, "glSecondaryColor3sv(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(SecondaryColor3svEXT)(const GLshort * v)
+{
+ DISPATCH(SecondaryColor3svEXT, (v), (F, "glSecondaryColor3svEXT(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(SecondaryColor3ub)(GLubyte red, GLubyte green, GLubyte blue)
+{
+ DISPATCH(SecondaryColor3ubEXT, (red, green, blue), (F, "glSecondaryColor3ub(%d, %d, %d);\n", red, green, blue));
+}
+
+KEYWORD1 void KEYWORD2 NAME(SecondaryColor3ubEXT)(GLubyte red, GLubyte green, GLubyte blue)
+{
+ DISPATCH(SecondaryColor3ubEXT, (red, green, blue), (F, "glSecondaryColor3ubEXT(%d, %d, %d);\n", red, green, blue));
+}
+
+KEYWORD1 void KEYWORD2 NAME(SecondaryColor3ubv)(const GLubyte * v)
+{
+ DISPATCH(SecondaryColor3ubvEXT, (v), (F, "glSecondaryColor3ubv(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(SecondaryColor3ubvEXT)(const GLubyte * v)
+{
+ DISPATCH(SecondaryColor3ubvEXT, (v), (F, "glSecondaryColor3ubvEXT(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(SecondaryColor3ui)(GLuint red, GLuint green, GLuint blue)
+{
+ DISPATCH(SecondaryColor3uiEXT, (red, green, blue), (F, "glSecondaryColor3ui(%d, %d, %d);\n", red, green, blue));
+}
+
+KEYWORD1 void KEYWORD2 NAME(SecondaryColor3uiEXT)(GLuint red, GLuint green, GLuint blue)
+{
+ DISPATCH(SecondaryColor3uiEXT, (red, green, blue), (F, "glSecondaryColor3uiEXT(%d, %d, %d);\n", red, green, blue));
+}
+
+KEYWORD1 void KEYWORD2 NAME(SecondaryColor3uiv)(const GLuint * v)
+{
+ DISPATCH(SecondaryColor3uivEXT, (v), (F, "glSecondaryColor3uiv(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(SecondaryColor3uivEXT)(const GLuint * v)
+{
+ DISPATCH(SecondaryColor3uivEXT, (v), (F, "glSecondaryColor3uivEXT(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(SecondaryColor3us)(GLushort red, GLushort green, GLushort blue)
+{
+ DISPATCH(SecondaryColor3usEXT, (red, green, blue), (F, "glSecondaryColor3us(%d, %d, %d);\n", red, green, blue));
+}
+
+KEYWORD1 void KEYWORD2 NAME(SecondaryColor3usEXT)(GLushort red, GLushort green, GLushort blue)
+{
+ DISPATCH(SecondaryColor3usEXT, (red, green, blue), (F, "glSecondaryColor3usEXT(%d, %d, %d);\n", red, green, blue));
+}
+
+KEYWORD1 void KEYWORD2 NAME(SecondaryColor3usv)(const GLushort * v)
+{
+ DISPATCH(SecondaryColor3usvEXT, (v), (F, "glSecondaryColor3usv(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(SecondaryColor3usvEXT)(const GLushort * v)
+{
+ DISPATCH(SecondaryColor3usvEXT, (v), (F, "glSecondaryColor3usvEXT(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(SecondaryColorPointer)(GLint size, GLenum type, GLsizei stride, const GLvoid * pointer)
+{
+ DISPATCH(SecondaryColorPointerEXT, (size, type, stride, pointer), (F, "glSecondaryColorPointer(%d, 0x%x, %d, %p);\n", size, type, stride, (const void *) pointer));
+}
+
+KEYWORD1 void KEYWORD2 NAME(SecondaryColorPointerEXT)(GLint size, GLenum type, GLsizei stride, const GLvoid * pointer)
+{
+ DISPATCH(SecondaryColorPointerEXT, (size, type, stride, pointer), (F, "glSecondaryColorPointerEXT(%d, 0x%x, %d, %p);\n", size, type, stride, (const void *) pointer));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultiDrawArrays)(GLenum mode, const GLint * first, const GLsizei * count, GLsizei primcount)
+{
+ DISPATCH(MultiDrawArraysEXT, (mode, first, count, primcount), (F, "glMultiDrawArrays(0x%x, %p, %p, %d);\n", mode, (const void *) first, (const void *) count, primcount));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultiDrawArraysEXT)(GLenum mode, const GLint * first, const GLsizei * count, GLsizei primcount)
+{
+ DISPATCH(MultiDrawArraysEXT, (mode, first, count, primcount), (F, "glMultiDrawArraysEXT(0x%x, %p, %p, %d);\n", mode, (const void *) first, (const void *) count, primcount));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultiDrawElements)(GLenum mode, const GLsizei * count, GLenum type, const GLvoid ** indices, GLsizei primcount)
+{
+ DISPATCH(MultiDrawElementsEXT, (mode, count, type, indices, primcount), (F, "glMultiDrawElements(0x%x, %p, 0x%x, %p, %d);\n", mode, (const void *) count, type, (const void *) indices, primcount));
+}
+
+KEYWORD1 void KEYWORD2 NAME(MultiDrawElementsEXT)(GLenum mode, const GLsizei * count, GLenum type, const GLvoid ** indices, GLsizei primcount)
+{
+ DISPATCH(MultiDrawElementsEXT, (mode, count, type, indices, primcount), (F, "glMultiDrawElementsEXT(0x%x, %p, 0x%x, %p, %d);\n", mode, (const void *) count, type, (const void *) indices, primcount));
+}
+
+KEYWORD1 void KEYWORD2 NAME(FogCoordPointer)(GLenum type, GLsizei stride, const GLvoid * pointer)
+{
+ DISPATCH(FogCoordPointerEXT, (type, stride, pointer), (F, "glFogCoordPointer(0x%x, %d, %p);\n", type, stride, (const void *) pointer));
+}
+
+KEYWORD1 void KEYWORD2 NAME(FogCoordPointerEXT)(GLenum type, GLsizei stride, const GLvoid * pointer)
+{
+ DISPATCH(FogCoordPointerEXT, (type, stride, pointer), (F, "glFogCoordPointerEXT(0x%x, %d, %p);\n", type, stride, (const void *) pointer));
+}
+
+KEYWORD1 void KEYWORD2 NAME(FogCoordd)(GLdouble coord)
+{
+ DISPATCH(FogCoorddEXT, (coord), (F, "glFogCoordd(%f);\n", coord));
+}
+
+KEYWORD1 void KEYWORD2 NAME(FogCoorddEXT)(GLdouble coord)
+{
+ DISPATCH(FogCoorddEXT, (coord), (F, "glFogCoorddEXT(%f);\n", coord));
+}
+
+KEYWORD1 void KEYWORD2 NAME(FogCoorddv)(const GLdouble * coord)
+{
+ DISPATCH(FogCoorddvEXT, (coord), (F, "glFogCoorddv(%p);\n", (const void *) coord));
+}
+
+KEYWORD1 void KEYWORD2 NAME(FogCoorddvEXT)(const GLdouble * coord)
+{
+ DISPATCH(FogCoorddvEXT, (coord), (F, "glFogCoorddvEXT(%p);\n", (const void *) coord));
+}
+
+KEYWORD1 void KEYWORD2 NAME(FogCoordf)(GLfloat coord)
+{
+ DISPATCH(FogCoordfEXT, (coord), (F, "glFogCoordf(%f);\n", coord));
+}
+
+KEYWORD1 void KEYWORD2 NAME(FogCoordfEXT)(GLfloat coord)
+{
+ DISPATCH(FogCoordfEXT, (coord), (F, "glFogCoordfEXT(%f);\n", coord));
+}
+
+KEYWORD1 void KEYWORD2 NAME(FogCoordfv)(const GLfloat * coord)
+{
+ DISPATCH(FogCoordfvEXT, (coord), (F, "glFogCoordfv(%p);\n", (const void *) coord));
+}
+
+KEYWORD1 void KEYWORD2 NAME(FogCoordfvEXT)(const GLfloat * coord)
+{
+ DISPATCH(FogCoordfvEXT, (coord), (F, "glFogCoordfvEXT(%p);\n", (const void *) coord));
+}
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_689)(GLenum mode);
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_689)(GLenum mode)
+{
+ DISPATCH(PixelTexGenSGIX, (mode), (F, "glPixelTexGenSGIX(0x%x);\n", mode));
+}
+
+KEYWORD1 void KEYWORD2 NAME(BlendFuncSeparate)(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha)
+{
+ DISPATCH(BlendFuncSeparateEXT, (sfactorRGB, dfactorRGB, sfactorAlpha, dfactorAlpha), (F, "glBlendFuncSeparate(0x%x, 0x%x, 0x%x, 0x%x);\n", sfactorRGB, dfactorRGB, sfactorAlpha, dfactorAlpha));
+}
+
+KEYWORD1 void KEYWORD2 NAME(BlendFuncSeparateEXT)(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha)
+{
+ DISPATCH(BlendFuncSeparateEXT, (sfactorRGB, dfactorRGB, sfactorAlpha, dfactorAlpha), (F, "glBlendFuncSeparateEXT(0x%x, 0x%x, 0x%x, 0x%x);\n", sfactorRGB, dfactorRGB, sfactorAlpha, dfactorAlpha));
+}
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_690)(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha);
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_690)(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha)
+{
+ DISPATCH(BlendFuncSeparateEXT, (sfactorRGB, dfactorRGB, sfactorAlpha, dfactorAlpha), (F, "glBlendFuncSeparateINGR(0x%x, 0x%x, 0x%x, 0x%x);\n", sfactorRGB, dfactorRGB, sfactorAlpha, dfactorAlpha));
+}
+
+KEYWORD1 void KEYWORD2 NAME(FlushVertexArrayRangeNV)(void)
+{
+ DISPATCH(FlushVertexArrayRangeNV, (), (F, "glFlushVertexArrayRangeNV();\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexArrayRangeNV)(GLsizei length, const GLvoid * pointer)
+{
+ DISPATCH(VertexArrayRangeNV, (length, pointer), (F, "glVertexArrayRangeNV(%d, %p);\n", length, (const void *) pointer));
+}
+
+KEYWORD1 void KEYWORD2 NAME(CombinerInputNV)(GLenum stage, GLenum portion, GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage)
+{
+ DISPATCH(CombinerInputNV, (stage, portion, variable, input, mapping, componentUsage), (F, "glCombinerInputNV(0x%x, 0x%x, 0x%x, 0x%x, 0x%x, 0x%x);\n", stage, portion, variable, input, mapping, componentUsage));
+}
+
+KEYWORD1 void KEYWORD2 NAME(CombinerOutputNV)(GLenum stage, GLenum portion, GLenum abOutput, GLenum cdOutput, GLenum sumOutput, GLenum scale, GLenum bias, GLboolean abDotProduct, GLboolean cdDotProduct, GLboolean muxSum)
+{
+ DISPATCH(CombinerOutputNV, (stage, portion, abOutput, cdOutput, sumOutput, scale, bias, abDotProduct, cdDotProduct, muxSum), (F, "glCombinerOutputNV(0x%x, 0x%x, 0x%x, 0x%x, 0x%x, 0x%x, 0x%x, %d, %d, %d);\n", stage, portion, abOutput, cdOutput, sumOutput, scale, bias, abDotProduct, cdDotProduct, muxSum));
+}
+
+KEYWORD1 void KEYWORD2 NAME(CombinerParameterfNV)(GLenum pname, GLfloat param)
+{
+ DISPATCH(CombinerParameterfNV, (pname, param), (F, "glCombinerParameterfNV(0x%x, %f);\n", pname, param));
+}
+
+KEYWORD1 void KEYWORD2 NAME(CombinerParameterfvNV)(GLenum pname, const GLfloat * params)
+{
+ DISPATCH(CombinerParameterfvNV, (pname, params), (F, "glCombinerParameterfvNV(0x%x, %p);\n", pname, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(CombinerParameteriNV)(GLenum pname, GLint param)
+{
+ DISPATCH(CombinerParameteriNV, (pname, param), (F, "glCombinerParameteriNV(0x%x, %d);\n", pname, param));
+}
+
+KEYWORD1 void KEYWORD2 NAME(CombinerParameterivNV)(GLenum pname, const GLint * params)
+{
+ DISPATCH(CombinerParameterivNV, (pname, params), (F, "glCombinerParameterivNV(0x%x, %p);\n", pname, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(FinalCombinerInputNV)(GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage)
+{
+ DISPATCH(FinalCombinerInputNV, (variable, input, mapping, componentUsage), (F, "glFinalCombinerInputNV(0x%x, 0x%x, 0x%x, 0x%x);\n", variable, input, mapping, componentUsage));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetCombinerInputParameterfvNV)(GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLfloat * params)
+{
+ DISPATCH(GetCombinerInputParameterfvNV, (stage, portion, variable, pname, params), (F, "glGetCombinerInputParameterfvNV(0x%x, 0x%x, 0x%x, 0x%x, %p);\n", stage, portion, variable, pname, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetCombinerInputParameterivNV)(GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLint * params)
+{
+ DISPATCH(GetCombinerInputParameterivNV, (stage, portion, variable, pname, params), (F, "glGetCombinerInputParameterivNV(0x%x, 0x%x, 0x%x, 0x%x, %p);\n", stage, portion, variable, pname, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetCombinerOutputParameterfvNV)(GLenum stage, GLenum portion, GLenum pname, GLfloat * params)
+{
+ DISPATCH(GetCombinerOutputParameterfvNV, (stage, portion, pname, params), (F, "glGetCombinerOutputParameterfvNV(0x%x, 0x%x, 0x%x, %p);\n", stage, portion, pname, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetCombinerOutputParameterivNV)(GLenum stage, GLenum portion, GLenum pname, GLint * params)
+{
+ DISPATCH(GetCombinerOutputParameterivNV, (stage, portion, pname, params), (F, "glGetCombinerOutputParameterivNV(0x%x, 0x%x, 0x%x, %p);\n", stage, portion, pname, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetFinalCombinerInputParameterfvNV)(GLenum variable, GLenum pname, GLfloat * params)
+{
+ DISPATCH(GetFinalCombinerInputParameterfvNV, (variable, pname, params), (F, "glGetFinalCombinerInputParameterfvNV(0x%x, 0x%x, %p);\n", variable, pname, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetFinalCombinerInputParameterivNV)(GLenum variable, GLenum pname, GLint * params)
+{
+ DISPATCH(GetFinalCombinerInputParameterivNV, (variable, pname, params), (F, "glGetFinalCombinerInputParameterivNV(0x%x, 0x%x, %p);\n", variable, pname, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ResizeBuffersMESA)(void)
+{
+ DISPATCH(ResizeBuffersMESA, (), (F, "glResizeBuffersMESA();\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(WindowPos2d)(GLdouble x, GLdouble y)
+{
+ DISPATCH(WindowPos2dMESA, (x, y), (F, "glWindowPos2d(%f, %f);\n", x, y));
+}
+
+KEYWORD1 void KEYWORD2 NAME(WindowPos2dARB)(GLdouble x, GLdouble y)
+{
+ DISPATCH(WindowPos2dMESA, (x, y), (F, "glWindowPos2dARB(%f, %f);\n", x, y));
+}
+
+KEYWORD1 void KEYWORD2 NAME(WindowPos2dMESA)(GLdouble x, GLdouble y)
+{
+ DISPATCH(WindowPos2dMESA, (x, y), (F, "glWindowPos2dMESA(%f, %f);\n", x, y));
+}
+
+KEYWORD1 void KEYWORD2 NAME(WindowPos2dv)(const GLdouble * v)
+{
+ DISPATCH(WindowPos2dvMESA, (v), (F, "glWindowPos2dv(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(WindowPos2dvARB)(const GLdouble * v)
+{
+ DISPATCH(WindowPos2dvMESA, (v), (F, "glWindowPos2dvARB(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(WindowPos2dvMESA)(const GLdouble * v)
+{
+ DISPATCH(WindowPos2dvMESA, (v), (F, "glWindowPos2dvMESA(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(WindowPos2f)(GLfloat x, GLfloat y)
+{
+ DISPATCH(WindowPos2fMESA, (x, y), (F, "glWindowPos2f(%f, %f);\n", x, y));
+}
+
+KEYWORD1 void KEYWORD2 NAME(WindowPos2fARB)(GLfloat x, GLfloat y)
+{
+ DISPATCH(WindowPos2fMESA, (x, y), (F, "glWindowPos2fARB(%f, %f);\n", x, y));
+}
+
+KEYWORD1 void KEYWORD2 NAME(WindowPos2fMESA)(GLfloat x, GLfloat y)
+{
+ DISPATCH(WindowPos2fMESA, (x, y), (F, "glWindowPos2fMESA(%f, %f);\n", x, y));
+}
+
+KEYWORD1 void KEYWORD2 NAME(WindowPos2fv)(const GLfloat * v)
+{
+ DISPATCH(WindowPos2fvMESA, (v), (F, "glWindowPos2fv(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(WindowPos2fvARB)(const GLfloat * v)
+{
+ DISPATCH(WindowPos2fvMESA, (v), (F, "glWindowPos2fvARB(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(WindowPos2fvMESA)(const GLfloat * v)
+{
+ DISPATCH(WindowPos2fvMESA, (v), (F, "glWindowPos2fvMESA(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(WindowPos2i)(GLint x, GLint y)
+{
+ DISPATCH(WindowPos2iMESA, (x, y), (F, "glWindowPos2i(%d, %d);\n", x, y));
+}
+
+KEYWORD1 void KEYWORD2 NAME(WindowPos2iARB)(GLint x, GLint y)
+{
+ DISPATCH(WindowPos2iMESA, (x, y), (F, "glWindowPos2iARB(%d, %d);\n", x, y));
+}
+
+KEYWORD1 void KEYWORD2 NAME(WindowPos2iMESA)(GLint x, GLint y)
+{
+ DISPATCH(WindowPos2iMESA, (x, y), (F, "glWindowPos2iMESA(%d, %d);\n", x, y));
+}
+
+KEYWORD1 void KEYWORD2 NAME(WindowPos2iv)(const GLint * v)
+{
+ DISPATCH(WindowPos2ivMESA, (v), (F, "glWindowPos2iv(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(WindowPos2ivARB)(const GLint * v)
+{
+ DISPATCH(WindowPos2ivMESA, (v), (F, "glWindowPos2ivARB(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(WindowPos2ivMESA)(const GLint * v)
+{
+ DISPATCH(WindowPos2ivMESA, (v), (F, "glWindowPos2ivMESA(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(WindowPos2s)(GLshort x, GLshort y)
+{
+ DISPATCH(WindowPos2sMESA, (x, y), (F, "glWindowPos2s(%d, %d);\n", x, y));
+}
+
+KEYWORD1 void KEYWORD2 NAME(WindowPos2sARB)(GLshort x, GLshort y)
+{
+ DISPATCH(WindowPos2sMESA, (x, y), (F, "glWindowPos2sARB(%d, %d);\n", x, y));
+}
+
+KEYWORD1 void KEYWORD2 NAME(WindowPos2sMESA)(GLshort x, GLshort y)
+{
+ DISPATCH(WindowPos2sMESA, (x, y), (F, "glWindowPos2sMESA(%d, %d);\n", x, y));
+}
+
+KEYWORD1 void KEYWORD2 NAME(WindowPos2sv)(const GLshort * v)
+{
+ DISPATCH(WindowPos2svMESA, (v), (F, "glWindowPos2sv(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(WindowPos2svARB)(const GLshort * v)
+{
+ DISPATCH(WindowPos2svMESA, (v), (F, "glWindowPos2svARB(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(WindowPos2svMESA)(const GLshort * v)
+{
+ DISPATCH(WindowPos2svMESA, (v), (F, "glWindowPos2svMESA(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(WindowPos3d)(GLdouble x, GLdouble y, GLdouble z)
+{
+ DISPATCH(WindowPos3dMESA, (x, y, z), (F, "glWindowPos3d(%f, %f, %f);\n", x, y, z));
+}
+
+KEYWORD1 void KEYWORD2 NAME(WindowPos3dARB)(GLdouble x, GLdouble y, GLdouble z)
+{
+ DISPATCH(WindowPos3dMESA, (x, y, z), (F, "glWindowPos3dARB(%f, %f, %f);\n", x, y, z));
+}
+
+KEYWORD1 void KEYWORD2 NAME(WindowPos3dMESA)(GLdouble x, GLdouble y, GLdouble z)
+{
+ DISPATCH(WindowPos3dMESA, (x, y, z), (F, "glWindowPos3dMESA(%f, %f, %f);\n", x, y, z));
+}
+
+KEYWORD1 void KEYWORD2 NAME(WindowPos3dv)(const GLdouble * v)
+{
+ DISPATCH(WindowPos3dvMESA, (v), (F, "glWindowPos3dv(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(WindowPos3dvARB)(const GLdouble * v)
+{
+ DISPATCH(WindowPos3dvMESA, (v), (F, "glWindowPos3dvARB(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(WindowPos3dvMESA)(const GLdouble * v)
+{
+ DISPATCH(WindowPos3dvMESA, (v), (F, "glWindowPos3dvMESA(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(WindowPos3f)(GLfloat x, GLfloat y, GLfloat z)
+{
+ DISPATCH(WindowPos3fMESA, (x, y, z), (F, "glWindowPos3f(%f, %f, %f);\n", x, y, z));
+}
+
+KEYWORD1 void KEYWORD2 NAME(WindowPos3fARB)(GLfloat x, GLfloat y, GLfloat z)
+{
+ DISPATCH(WindowPos3fMESA, (x, y, z), (F, "glWindowPos3fARB(%f, %f, %f);\n", x, y, z));
+}
+
+KEYWORD1 void KEYWORD2 NAME(WindowPos3fMESA)(GLfloat x, GLfloat y, GLfloat z)
+{
+ DISPATCH(WindowPos3fMESA, (x, y, z), (F, "glWindowPos3fMESA(%f, %f, %f);\n", x, y, z));
+}
+
+KEYWORD1 void KEYWORD2 NAME(WindowPos3fv)(const GLfloat * v)
+{
+ DISPATCH(WindowPos3fvMESA, (v), (F, "glWindowPos3fv(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(WindowPos3fvARB)(const GLfloat * v)
+{
+ DISPATCH(WindowPos3fvMESA, (v), (F, "glWindowPos3fvARB(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(WindowPos3fvMESA)(const GLfloat * v)
+{
+ DISPATCH(WindowPos3fvMESA, (v), (F, "glWindowPos3fvMESA(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(WindowPos3i)(GLint x, GLint y, GLint z)
+{
+ DISPATCH(WindowPos3iMESA, (x, y, z), (F, "glWindowPos3i(%d, %d, %d);\n", x, y, z));
+}
+
+KEYWORD1 void KEYWORD2 NAME(WindowPos3iARB)(GLint x, GLint y, GLint z)
+{
+ DISPATCH(WindowPos3iMESA, (x, y, z), (F, "glWindowPos3iARB(%d, %d, %d);\n", x, y, z));
+}
+
+KEYWORD1 void KEYWORD2 NAME(WindowPos3iMESA)(GLint x, GLint y, GLint z)
+{
+ DISPATCH(WindowPos3iMESA, (x, y, z), (F, "glWindowPos3iMESA(%d, %d, %d);\n", x, y, z));
+}
+
+KEYWORD1 void KEYWORD2 NAME(WindowPos3iv)(const GLint * v)
+{
+ DISPATCH(WindowPos3ivMESA, (v), (F, "glWindowPos3iv(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(WindowPos3ivARB)(const GLint * v)
+{
+ DISPATCH(WindowPos3ivMESA, (v), (F, "glWindowPos3ivARB(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(WindowPos3ivMESA)(const GLint * v)
+{
+ DISPATCH(WindowPos3ivMESA, (v), (F, "glWindowPos3ivMESA(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(WindowPos3s)(GLshort x, GLshort y, GLshort z)
+{
+ DISPATCH(WindowPos3sMESA, (x, y, z), (F, "glWindowPos3s(%d, %d, %d);\n", x, y, z));
+}
+
+KEYWORD1 void KEYWORD2 NAME(WindowPos3sARB)(GLshort x, GLshort y, GLshort z)
+{
+ DISPATCH(WindowPos3sMESA, (x, y, z), (F, "glWindowPos3sARB(%d, %d, %d);\n", x, y, z));
+}
+
+KEYWORD1 void KEYWORD2 NAME(WindowPos3sMESA)(GLshort x, GLshort y, GLshort z)
+{
+ DISPATCH(WindowPos3sMESA, (x, y, z), (F, "glWindowPos3sMESA(%d, %d, %d);\n", x, y, z));
+}
+
+KEYWORD1 void KEYWORD2 NAME(WindowPos3sv)(const GLshort * v)
+{
+ DISPATCH(WindowPos3svMESA, (v), (F, "glWindowPos3sv(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(WindowPos3svARB)(const GLshort * v)
+{
+ DISPATCH(WindowPos3svMESA, (v), (F, "glWindowPos3svARB(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(WindowPos3svMESA)(const GLshort * v)
+{
+ DISPATCH(WindowPos3svMESA, (v), (F, "glWindowPos3svMESA(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(WindowPos4dMESA)(GLdouble x, GLdouble y, GLdouble z, GLdouble w)
+{
+ DISPATCH(WindowPos4dMESA, (x, y, z, w), (F, "glWindowPos4dMESA(%f, %f, %f, %f);\n", x, y, z, w));
+}
+
+KEYWORD1 void KEYWORD2 NAME(WindowPos4dvMESA)(const GLdouble * v)
+{
+ DISPATCH(WindowPos4dvMESA, (v), (F, "glWindowPos4dvMESA(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(WindowPos4fMESA)(GLfloat x, GLfloat y, GLfloat z, GLfloat w)
+{
+ DISPATCH(WindowPos4fMESA, (x, y, z, w), (F, "glWindowPos4fMESA(%f, %f, %f, %f);\n", x, y, z, w));
+}
+
+KEYWORD1 void KEYWORD2 NAME(WindowPos4fvMESA)(const GLfloat * v)
+{
+ DISPATCH(WindowPos4fvMESA, (v), (F, "glWindowPos4fvMESA(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(WindowPos4iMESA)(GLint x, GLint y, GLint z, GLint w)
+{
+ DISPATCH(WindowPos4iMESA, (x, y, z, w), (F, "glWindowPos4iMESA(%d, %d, %d, %d);\n", x, y, z, w));
+}
+
+KEYWORD1 void KEYWORD2 NAME(WindowPos4ivMESA)(const GLint * v)
+{
+ DISPATCH(WindowPos4ivMESA, (v), (F, "glWindowPos4ivMESA(%p);\n", (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(WindowPos4sMESA)(GLshort x, GLshort y, GLshort z, GLshort w)
+{
+ DISPATCH(WindowPos4sMESA, (x, y, z, w), (F, "glWindowPos4sMESA(%d, %d, %d, %d);\n", x, y, z, w));
+}
+
+KEYWORD1 void KEYWORD2 NAME(WindowPos4svMESA)(const GLshort * v)
+{
+ DISPATCH(WindowPos4svMESA, (v), (F, "glWindowPos4svMESA(%p);\n", (const void *) v));
+}
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_731)(const GLenum * mode, const GLint * first, const GLsizei * count, GLsizei primcount, GLint modestride);
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_731)(const GLenum * mode, const GLint * first, const GLsizei * count, GLsizei primcount, GLint modestride)
+{
+ DISPATCH(MultiModeDrawArraysIBM, (mode, first, count, primcount, modestride), (F, "glMultiModeDrawArraysIBM(%p, %p, %p, %d, %d);\n", (const void *) mode, (const void *) first, (const void *) count, primcount, modestride));
+}
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_732)(const GLenum * mode, const GLsizei * count, GLenum type, const GLvoid * const * indices, GLsizei primcount, GLint modestride);
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_732)(const GLenum * mode, const GLsizei * count, GLenum type, const GLvoid * const * indices, GLsizei primcount, GLint modestride)
+{
+ DISPATCH(MultiModeDrawElementsIBM, (mode, count, type, indices, primcount, modestride), (F, "glMultiModeDrawElementsIBM(%p, %p, 0x%x, %p, %d, %d);\n", (const void *) mode, (const void *) count, type, (const void *) indices, primcount, modestride));
+}
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_733)(GLsizei n, const GLuint * fences);
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_733)(GLsizei n, const GLuint * fences)
+{
+ DISPATCH(DeleteFencesNV, (n, fences), (F, "glDeleteFencesNV(%d, %p);\n", n, (const void *) fences));
+}
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_734)(GLuint fence);
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_734)(GLuint fence)
+{
+ DISPATCH(FinishFenceNV, (fence), (F, "glFinishFenceNV(%d);\n", fence));
+}
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_735)(GLsizei n, GLuint * fences);
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_735)(GLsizei n, GLuint * fences)
+{
+ DISPATCH(GenFencesNV, (n, fences), (F, "glGenFencesNV(%d, %p);\n", n, (const void *) fences));
+}
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_736)(GLuint fence, GLenum pname, GLint * params);
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_736)(GLuint fence, GLenum pname, GLint * params)
+{
+ DISPATCH(GetFenceivNV, (fence, pname, params), (F, "glGetFenceivNV(%d, 0x%x, %p);\n", fence, pname, (const void *) params));
+}
+
+KEYWORD1_ALT GLboolean KEYWORD2 NAME(_dispatch_stub_737)(GLuint fence);
+
+KEYWORD1_ALT GLboolean KEYWORD2 NAME(_dispatch_stub_737)(GLuint fence)
+{
+ RETURN_DISPATCH(IsFenceNV, (fence), (F, "glIsFenceNV(%d);\n", fence));
+}
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_738)(GLuint fence, GLenum condition);
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_738)(GLuint fence, GLenum condition)
+{
+ DISPATCH(SetFenceNV, (fence, condition), (F, "glSetFenceNV(%d, 0x%x);\n", fence, condition));
+}
+
+KEYWORD1_ALT GLboolean KEYWORD2 NAME(_dispatch_stub_739)(GLuint fence);
+
+KEYWORD1_ALT GLboolean KEYWORD2 NAME(_dispatch_stub_739)(GLuint fence)
+{
+ RETURN_DISPATCH(TestFenceNV, (fence), (F, "glTestFenceNV(%d);\n", fence));
+}
+
+KEYWORD1 GLboolean KEYWORD2 NAME(AreProgramsResidentNV)(GLsizei n, const GLuint * ids, GLboolean * residences)
+{
+ RETURN_DISPATCH(AreProgramsResidentNV, (n, ids, residences), (F, "glAreProgramsResidentNV(%d, %p, %p);\n", n, (const void *) ids, (const void *) residences));
+}
+
+KEYWORD1 void KEYWORD2 NAME(BindProgramARB)(GLenum target, GLuint program)
+{
+ DISPATCH(BindProgramNV, (target, program), (F, "glBindProgramARB(0x%x, %d);\n", target, program));
+}
+
+KEYWORD1 void KEYWORD2 NAME(BindProgramNV)(GLenum target, GLuint program)
+{
+ DISPATCH(BindProgramNV, (target, program), (F, "glBindProgramNV(0x%x, %d);\n", target, program));
+}
+
+KEYWORD1 void KEYWORD2 NAME(DeleteProgramsARB)(GLsizei n, const GLuint * programs)
+{
+ DISPATCH(DeleteProgramsNV, (n, programs), (F, "glDeleteProgramsARB(%d, %p);\n", n, (const void *) programs));
+}
+
+KEYWORD1 void KEYWORD2 NAME(DeleteProgramsNV)(GLsizei n, const GLuint * programs)
+{
+ DISPATCH(DeleteProgramsNV, (n, programs), (F, "glDeleteProgramsNV(%d, %p);\n", n, (const void *) programs));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ExecuteProgramNV)(GLenum target, GLuint id, const GLfloat * params)
+{
+ DISPATCH(ExecuteProgramNV, (target, id, params), (F, "glExecuteProgramNV(0x%x, %d, %p);\n", target, id, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GenProgramsARB)(GLsizei n, GLuint * programs)
+{
+ DISPATCH(GenProgramsNV, (n, programs), (F, "glGenProgramsARB(%d, %p);\n", n, (const void *) programs));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GenProgramsNV)(GLsizei n, GLuint * programs)
+{
+ DISPATCH(GenProgramsNV, (n, programs), (F, "glGenProgramsNV(%d, %p);\n", n, (const void *) programs));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetProgramParameterdvNV)(GLenum target, GLuint index, GLenum pname, GLdouble * params)
+{
+ DISPATCH(GetProgramParameterdvNV, (target, index, pname, params), (F, "glGetProgramParameterdvNV(0x%x, %d, 0x%x, %p);\n", target, index, pname, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetProgramParameterfvNV)(GLenum target, GLuint index, GLenum pname, GLfloat * params)
+{
+ DISPATCH(GetProgramParameterfvNV, (target, index, pname, params), (F, "glGetProgramParameterfvNV(0x%x, %d, 0x%x, %p);\n", target, index, pname, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetProgramStringNV)(GLuint id, GLenum pname, GLubyte * program)
+{
+ DISPATCH(GetProgramStringNV, (id, pname, program), (F, "glGetProgramStringNV(%d, 0x%x, %p);\n", id, pname, (const void *) program));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetProgramivNV)(GLuint id, GLenum pname, GLint * params)
+{
+ DISPATCH(GetProgramivNV, (id, pname, params), (F, "glGetProgramivNV(%d, 0x%x, %p);\n", id, pname, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetTrackMatrixivNV)(GLenum target, GLuint address, GLenum pname, GLint * params)
+{
+ DISPATCH(GetTrackMatrixivNV, (target, address, pname, params), (F, "glGetTrackMatrixivNV(0x%x, %d, 0x%x, %p);\n", target, address, pname, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetVertexAttribPointerv)(GLuint index, GLenum pname, GLvoid ** pointer)
+{
+ DISPATCH(GetVertexAttribPointervNV, (index, pname, pointer), (F, "glGetVertexAttribPointerv(%d, 0x%x, %p);\n", index, pname, (const void *) pointer));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetVertexAttribPointervARB)(GLuint index, GLenum pname, GLvoid ** pointer)
+{
+ DISPATCH(GetVertexAttribPointervNV, (index, pname, pointer), (F, "glGetVertexAttribPointervARB(%d, 0x%x, %p);\n", index, pname, (const void *) pointer));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetVertexAttribPointervNV)(GLuint index, GLenum pname, GLvoid ** pointer)
+{
+ DISPATCH(GetVertexAttribPointervNV, (index, pname, pointer), (F, "glGetVertexAttribPointervNV(%d, 0x%x, %p);\n", index, pname, (const void *) pointer));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetVertexAttribdvNV)(GLuint index, GLenum pname, GLdouble * params)
+{
+ DISPATCH(GetVertexAttribdvNV, (index, pname, params), (F, "glGetVertexAttribdvNV(%d, 0x%x, %p);\n", index, pname, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetVertexAttribfvNV)(GLuint index, GLenum pname, GLfloat * params)
+{
+ DISPATCH(GetVertexAttribfvNV, (index, pname, params), (F, "glGetVertexAttribfvNV(%d, 0x%x, %p);\n", index, pname, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetVertexAttribivNV)(GLuint index, GLenum pname, GLint * params)
+{
+ DISPATCH(GetVertexAttribivNV, (index, pname, params), (F, "glGetVertexAttribivNV(%d, 0x%x, %p);\n", index, pname, (const void *) params));
+}
+
+KEYWORD1 GLboolean KEYWORD2 NAME(IsProgramARB)(GLuint program)
+{
+ RETURN_DISPATCH(IsProgramNV, (program), (F, "glIsProgramARB(%d);\n", program));
+}
+
+KEYWORD1 GLboolean KEYWORD2 NAME(IsProgramNV)(GLuint program)
+{
+ RETURN_DISPATCH(IsProgramNV, (program), (F, "glIsProgramNV(%d);\n", program));
+}
+
+KEYWORD1 void KEYWORD2 NAME(LoadProgramNV)(GLenum target, GLuint id, GLsizei len, const GLubyte * program)
+{
+ DISPATCH(LoadProgramNV, (target, id, len, program), (F, "glLoadProgramNV(0x%x, %d, %d, %p);\n", target, id, len, (const void *) program));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ProgramParameters4dvNV)(GLenum target, GLuint index, GLsizei num, const GLdouble * params)
+{
+ DISPATCH(ProgramParameters4dvNV, (target, index, num, params), (F, "glProgramParameters4dvNV(0x%x, %d, %d, %p);\n", target, index, num, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ProgramParameters4fvNV)(GLenum target, GLuint index, GLsizei num, const GLfloat * params)
+{
+ DISPATCH(ProgramParameters4fvNV, (target, index, num, params), (F, "glProgramParameters4fvNV(0x%x, %d, %d, %p);\n", target, index, num, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(RequestResidentProgramsNV)(GLsizei n, const GLuint * ids)
+{
+ DISPATCH(RequestResidentProgramsNV, (n, ids), (F, "glRequestResidentProgramsNV(%d, %p);\n", n, (const void *) ids));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TrackMatrixNV)(GLenum target, GLuint address, GLenum matrix, GLenum transform)
+{
+ DISPATCH(TrackMatrixNV, (target, address, matrix, transform), (F, "glTrackMatrixNV(0x%x, %d, 0x%x, 0x%x);\n", target, address, matrix, transform));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib1dNV)(GLuint index, GLdouble x)
+{
+ DISPATCH(VertexAttrib1dNV, (index, x), (F, "glVertexAttrib1dNV(%d, %f);\n", index, x));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib1dvNV)(GLuint index, const GLdouble * v)
+{
+ DISPATCH(VertexAttrib1dvNV, (index, v), (F, "glVertexAttrib1dvNV(%d, %p);\n", index, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib1fNV)(GLuint index, GLfloat x)
+{
+ DISPATCH(VertexAttrib1fNV, (index, x), (F, "glVertexAttrib1fNV(%d, %f);\n", index, x));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib1fvNV)(GLuint index, const GLfloat * v)
+{
+ DISPATCH(VertexAttrib1fvNV, (index, v), (F, "glVertexAttrib1fvNV(%d, %p);\n", index, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib1sNV)(GLuint index, GLshort x)
+{
+ DISPATCH(VertexAttrib1sNV, (index, x), (F, "glVertexAttrib1sNV(%d, %d);\n", index, x));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib1svNV)(GLuint index, const GLshort * v)
+{
+ DISPATCH(VertexAttrib1svNV, (index, v), (F, "glVertexAttrib1svNV(%d, %p);\n", index, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib2dNV)(GLuint index, GLdouble x, GLdouble y)
+{
+ DISPATCH(VertexAttrib2dNV, (index, x, y), (F, "glVertexAttrib2dNV(%d, %f, %f);\n", index, x, y));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib2dvNV)(GLuint index, const GLdouble * v)
+{
+ DISPATCH(VertexAttrib2dvNV, (index, v), (F, "glVertexAttrib2dvNV(%d, %p);\n", index, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib2fNV)(GLuint index, GLfloat x, GLfloat y)
+{
+ DISPATCH(VertexAttrib2fNV, (index, x, y), (F, "glVertexAttrib2fNV(%d, %f, %f);\n", index, x, y));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib2fvNV)(GLuint index, const GLfloat * v)
+{
+ DISPATCH(VertexAttrib2fvNV, (index, v), (F, "glVertexAttrib2fvNV(%d, %p);\n", index, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib2sNV)(GLuint index, GLshort x, GLshort y)
+{
+ DISPATCH(VertexAttrib2sNV, (index, x, y), (F, "glVertexAttrib2sNV(%d, %d, %d);\n", index, x, y));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib2svNV)(GLuint index, const GLshort * v)
+{
+ DISPATCH(VertexAttrib2svNV, (index, v), (F, "glVertexAttrib2svNV(%d, %p);\n", index, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib3dNV)(GLuint index, GLdouble x, GLdouble y, GLdouble z)
+{
+ DISPATCH(VertexAttrib3dNV, (index, x, y, z), (F, "glVertexAttrib3dNV(%d, %f, %f, %f);\n", index, x, y, z));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib3dvNV)(GLuint index, const GLdouble * v)
+{
+ DISPATCH(VertexAttrib3dvNV, (index, v), (F, "glVertexAttrib3dvNV(%d, %p);\n", index, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib3fNV)(GLuint index, GLfloat x, GLfloat y, GLfloat z)
+{
+ DISPATCH(VertexAttrib3fNV, (index, x, y, z), (F, "glVertexAttrib3fNV(%d, %f, %f, %f);\n", index, x, y, z));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib3fvNV)(GLuint index, const GLfloat * v)
+{
+ DISPATCH(VertexAttrib3fvNV, (index, v), (F, "glVertexAttrib3fvNV(%d, %p);\n", index, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib3sNV)(GLuint index, GLshort x, GLshort y, GLshort z)
+{
+ DISPATCH(VertexAttrib3sNV, (index, x, y, z), (F, "glVertexAttrib3sNV(%d, %d, %d, %d);\n", index, x, y, z));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib3svNV)(GLuint index, const GLshort * v)
+{
+ DISPATCH(VertexAttrib3svNV, (index, v), (F, "glVertexAttrib3svNV(%d, %p);\n", index, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib4dNV)(GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w)
+{
+ DISPATCH(VertexAttrib4dNV, (index, x, y, z, w), (F, "glVertexAttrib4dNV(%d, %f, %f, %f, %f);\n", index, x, y, z, w));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib4dvNV)(GLuint index, const GLdouble * v)
+{
+ DISPATCH(VertexAttrib4dvNV, (index, v), (F, "glVertexAttrib4dvNV(%d, %p);\n", index, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib4fNV)(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
+{
+ DISPATCH(VertexAttrib4fNV, (index, x, y, z, w), (F, "glVertexAttrib4fNV(%d, %f, %f, %f, %f);\n", index, x, y, z, w));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib4fvNV)(GLuint index, const GLfloat * v)
+{
+ DISPATCH(VertexAttrib4fvNV, (index, v), (F, "glVertexAttrib4fvNV(%d, %p);\n", index, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib4sNV)(GLuint index, GLshort x, GLshort y, GLshort z, GLshort w)
+{
+ DISPATCH(VertexAttrib4sNV, (index, x, y, z, w), (F, "glVertexAttrib4sNV(%d, %d, %d, %d, %d);\n", index, x, y, z, w));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib4svNV)(GLuint index, const GLshort * v)
+{
+ DISPATCH(VertexAttrib4svNV, (index, v), (F, "glVertexAttrib4svNV(%d, %p);\n", index, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib4ubNV)(GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w)
+{
+ DISPATCH(VertexAttrib4ubNV, (index, x, y, z, w), (F, "glVertexAttrib4ubNV(%d, %d, %d, %d, %d);\n", index, x, y, z, w));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib4ubvNV)(GLuint index, const GLubyte * v)
+{
+ DISPATCH(VertexAttrib4ubvNV, (index, v), (F, "glVertexAttrib4ubvNV(%d, %p);\n", index, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttribPointerNV)(GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid * pointer)
+{
+ DISPATCH(VertexAttribPointerNV, (index, size, type, stride, pointer), (F, "glVertexAttribPointerNV(%d, %d, 0x%x, %d, %p);\n", index, size, type, stride, (const void *) pointer));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttribs1dvNV)(GLuint index, GLsizei n, const GLdouble * v)
+{
+ DISPATCH(VertexAttribs1dvNV, (index, n, v), (F, "glVertexAttribs1dvNV(%d, %d, %p);\n", index, n, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttribs1fvNV)(GLuint index, GLsizei n, const GLfloat * v)
+{
+ DISPATCH(VertexAttribs1fvNV, (index, n, v), (F, "glVertexAttribs1fvNV(%d, %d, %p);\n", index, n, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttribs1svNV)(GLuint index, GLsizei n, const GLshort * v)
+{
+ DISPATCH(VertexAttribs1svNV, (index, n, v), (F, "glVertexAttribs1svNV(%d, %d, %p);\n", index, n, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttribs2dvNV)(GLuint index, GLsizei n, const GLdouble * v)
+{
+ DISPATCH(VertexAttribs2dvNV, (index, n, v), (F, "glVertexAttribs2dvNV(%d, %d, %p);\n", index, n, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttribs2fvNV)(GLuint index, GLsizei n, const GLfloat * v)
+{
+ DISPATCH(VertexAttribs2fvNV, (index, n, v), (F, "glVertexAttribs2fvNV(%d, %d, %p);\n", index, n, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttribs2svNV)(GLuint index, GLsizei n, const GLshort * v)
+{
+ DISPATCH(VertexAttribs2svNV, (index, n, v), (F, "glVertexAttribs2svNV(%d, %d, %p);\n", index, n, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttribs3dvNV)(GLuint index, GLsizei n, const GLdouble * v)
+{
+ DISPATCH(VertexAttribs3dvNV, (index, n, v), (F, "glVertexAttribs3dvNV(%d, %d, %p);\n", index, n, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttribs3fvNV)(GLuint index, GLsizei n, const GLfloat * v)
+{
+ DISPATCH(VertexAttribs3fvNV, (index, n, v), (F, "glVertexAttribs3fvNV(%d, %d, %p);\n", index, n, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttribs3svNV)(GLuint index, GLsizei n, const GLshort * v)
+{
+ DISPATCH(VertexAttribs3svNV, (index, n, v), (F, "glVertexAttribs3svNV(%d, %d, %p);\n", index, n, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttribs4dvNV)(GLuint index, GLsizei n, const GLdouble * v)
+{
+ DISPATCH(VertexAttribs4dvNV, (index, n, v), (F, "glVertexAttribs4dvNV(%d, %d, %p);\n", index, n, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttribs4fvNV)(GLuint index, GLsizei n, const GLfloat * v)
+{
+ DISPATCH(VertexAttribs4fvNV, (index, n, v), (F, "glVertexAttribs4fvNV(%d, %d, %p);\n", index, n, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttribs4svNV)(GLuint index, GLsizei n, const GLshort * v)
+{
+ DISPATCH(VertexAttribs4svNV, (index, n, v), (F, "glVertexAttribs4svNV(%d, %d, %p);\n", index, n, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttribs4ubvNV)(GLuint index, GLsizei n, const GLubyte * v)
+{
+ DISPATCH(VertexAttribs4ubvNV, (index, n, v), (F, "glVertexAttribs4ubvNV(%d, %d, %p);\n", index, n, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetTexBumpParameterfvATI)(GLenum pname, GLfloat * param)
+{
+ DISPATCH(GetTexBumpParameterfvATI, (pname, param), (F, "glGetTexBumpParameterfvATI(0x%x, %p);\n", pname, (const void *) param));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetTexBumpParameterivATI)(GLenum pname, GLint * param)
+{
+ DISPATCH(GetTexBumpParameterivATI, (pname, param), (F, "glGetTexBumpParameterivATI(0x%x, %p);\n", pname, (const void *) param));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TexBumpParameterfvATI)(GLenum pname, const GLfloat * param)
+{
+ DISPATCH(TexBumpParameterfvATI, (pname, param), (F, "glTexBumpParameterfvATI(0x%x, %p);\n", pname, (const void *) param));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TexBumpParameterivATI)(GLenum pname, const GLint * param)
+{
+ DISPATCH(TexBumpParameterivATI, (pname, param), (F, "glTexBumpParameterivATI(0x%x, %p);\n", pname, (const void *) param));
+}
+
+KEYWORD1 void KEYWORD2 NAME(AlphaFragmentOp1ATI)(GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod)
+{
+ DISPATCH(AlphaFragmentOp1ATI, (op, dst, dstMod, arg1, arg1Rep, arg1Mod), (F, "glAlphaFragmentOp1ATI(0x%x, %d, %d, %d, %d, %d);\n", op, dst, dstMod, arg1, arg1Rep, arg1Mod));
+}
+
+KEYWORD1 void KEYWORD2 NAME(AlphaFragmentOp2ATI)(GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod)
+{
+ DISPATCH(AlphaFragmentOp2ATI, (op, dst, dstMod, arg1, arg1Rep, arg1Mod, arg2, arg2Rep, arg2Mod), (F, "glAlphaFragmentOp2ATI(0x%x, %d, %d, %d, %d, %d, %d, %d, %d);\n", op, dst, dstMod, arg1, arg1Rep, arg1Mod, arg2, arg2Rep, arg2Mod));
+}
+
+KEYWORD1 void KEYWORD2 NAME(AlphaFragmentOp3ATI)(GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod)
+{
+ DISPATCH(AlphaFragmentOp3ATI, (op, dst, dstMod, arg1, arg1Rep, arg1Mod, arg2, arg2Rep, arg2Mod, arg3, arg3Rep, arg3Mod), (F, "glAlphaFragmentOp3ATI(0x%x, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d);\n", op, dst, dstMod, arg1, arg1Rep, arg1Mod, arg2, arg2Rep, arg2Mod, arg3, arg3Rep, arg3Mod));
+}
+
+KEYWORD1 void KEYWORD2 NAME(BeginFragmentShaderATI)(void)
+{
+ DISPATCH(BeginFragmentShaderATI, (), (F, "glBeginFragmentShaderATI();\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(BindFragmentShaderATI)(GLuint id)
+{
+ DISPATCH(BindFragmentShaderATI, (id), (F, "glBindFragmentShaderATI(%d);\n", id));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ColorFragmentOp1ATI)(GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod)
+{
+ DISPATCH(ColorFragmentOp1ATI, (op, dst, dstMask, dstMod, arg1, arg1Rep, arg1Mod), (F, "glColorFragmentOp1ATI(0x%x, %d, %d, %d, %d, %d, %d);\n", op, dst, dstMask, dstMod, arg1, arg1Rep, arg1Mod));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ColorFragmentOp2ATI)(GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod)
+{
+ DISPATCH(ColorFragmentOp2ATI, (op, dst, dstMask, dstMod, arg1, arg1Rep, arg1Mod, arg2, arg2Rep, arg2Mod), (F, "glColorFragmentOp2ATI(0x%x, %d, %d, %d, %d, %d, %d, %d, %d, %d);\n", op, dst, dstMask, dstMod, arg1, arg1Rep, arg1Mod, arg2, arg2Rep, arg2Mod));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ColorFragmentOp3ATI)(GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod)
+{
+ DISPATCH(ColorFragmentOp3ATI, (op, dst, dstMask, dstMod, arg1, arg1Rep, arg1Mod, arg2, arg2Rep, arg2Mod, arg3, arg3Rep, arg3Mod), (F, "glColorFragmentOp3ATI(0x%x, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d);\n", op, dst, dstMask, dstMod, arg1, arg1Rep, arg1Mod, arg2, arg2Rep, arg2Mod, arg3, arg3Rep, arg3Mod));
+}
+
+KEYWORD1 void KEYWORD2 NAME(DeleteFragmentShaderATI)(GLuint id)
+{
+ DISPATCH(DeleteFragmentShaderATI, (id), (F, "glDeleteFragmentShaderATI(%d);\n", id));
+}
+
+KEYWORD1 void KEYWORD2 NAME(EndFragmentShaderATI)(void)
+{
+ DISPATCH(EndFragmentShaderATI, (), (F, "glEndFragmentShaderATI();\n"));
+}
+
+KEYWORD1 GLuint KEYWORD2 NAME(GenFragmentShadersATI)(GLuint range)
+{
+ RETURN_DISPATCH(GenFragmentShadersATI, (range), (F, "glGenFragmentShadersATI(%d);\n", range));
+}
+
+KEYWORD1 void KEYWORD2 NAME(PassTexCoordATI)(GLuint dst, GLuint coord, GLenum swizzle)
+{
+ DISPATCH(PassTexCoordATI, (dst, coord, swizzle), (F, "glPassTexCoordATI(%d, %d, 0x%x);\n", dst, coord, swizzle));
+}
+
+KEYWORD1 void KEYWORD2 NAME(SampleMapATI)(GLuint dst, GLuint interp, GLenum swizzle)
+{
+ DISPATCH(SampleMapATI, (dst, interp, swizzle), (F, "glSampleMapATI(%d, %d, 0x%x);\n", dst, interp, swizzle));
+}
+
+KEYWORD1 void KEYWORD2 NAME(SetFragmentShaderConstantATI)(GLuint dst, const GLfloat * value)
+{
+ DISPATCH(SetFragmentShaderConstantATI, (dst, value), (F, "glSetFragmentShaderConstantATI(%d, %p);\n", dst, (const void *) value));
+}
+
+KEYWORD1 void KEYWORD2 NAME(PointParameteri)(GLenum pname, GLint param)
+{
+ DISPATCH(PointParameteriNV, (pname, param), (F, "glPointParameteri(0x%x, %d);\n", pname, param));
+}
+
+KEYWORD1 void KEYWORD2 NAME(PointParameteriNV)(GLenum pname, GLint param)
+{
+ DISPATCH(PointParameteriNV, (pname, param), (F, "glPointParameteriNV(0x%x, %d);\n", pname, param));
+}
+
+KEYWORD1 void KEYWORD2 NAME(PointParameteriv)(GLenum pname, const GLint * params)
+{
+ DISPATCH(PointParameterivNV, (pname, params), (F, "glPointParameteriv(0x%x, %p);\n", pname, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(PointParameterivNV)(GLenum pname, const GLint * params)
+{
+ DISPATCH(PointParameterivNV, (pname, params), (F, "glPointParameterivNV(0x%x, %p);\n", pname, (const void *) params));
+}
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_820)(GLenum face);
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_820)(GLenum face)
+{
+ DISPATCH(ActiveStencilFaceEXT, (face), (F, "glActiveStencilFaceEXT(0x%x);\n", face));
+}
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_821)(GLuint array);
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_821)(GLuint array)
+{
+ DISPATCH(BindVertexArrayAPPLE, (array), (F, "glBindVertexArrayAPPLE(%d);\n", array));
+}
+
+KEYWORD1 void KEYWORD2 NAME(DeleteVertexArrays)(GLsizei n, const GLuint * arrays)
+{
+ DISPATCH(DeleteVertexArraysAPPLE, (n, arrays), (F, "glDeleteVertexArrays(%d, %p);\n", n, (const void *) arrays));
+}
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_822)(GLsizei n, const GLuint * arrays);
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_822)(GLsizei n, const GLuint * arrays)
+{
+ DISPATCH(DeleteVertexArraysAPPLE, (n, arrays), (F, "glDeleteVertexArraysAPPLE(%d, %p);\n", n, (const void *) arrays));
+}
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_823)(GLsizei n, GLuint * arrays);
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_823)(GLsizei n, GLuint * arrays)
+{
+ DISPATCH(GenVertexArraysAPPLE, (n, arrays), (F, "glGenVertexArraysAPPLE(%d, %p);\n", n, (const void *) arrays));
+}
+
+KEYWORD1 GLboolean KEYWORD2 NAME(IsVertexArray)(GLuint array)
+{
+ RETURN_DISPATCH(IsVertexArrayAPPLE, (array), (F, "glIsVertexArray(%d);\n", array));
+}
+
+KEYWORD1_ALT GLboolean KEYWORD2 NAME(_dispatch_stub_824)(GLuint array);
+
+KEYWORD1_ALT GLboolean KEYWORD2 NAME(_dispatch_stub_824)(GLuint array)
+{
+ RETURN_DISPATCH(IsVertexArrayAPPLE, (array), (F, "glIsVertexArrayAPPLE(%d);\n", array));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetProgramNamedParameterdvNV)(GLuint id, GLsizei len, const GLubyte * name, GLdouble * params)
+{
+ DISPATCH(GetProgramNamedParameterdvNV, (id, len, name, params), (F, "glGetProgramNamedParameterdvNV(%d, %d, %p, %p);\n", id, len, (const void *) name, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetProgramNamedParameterfvNV)(GLuint id, GLsizei len, const GLubyte * name, GLfloat * params)
+{
+ DISPATCH(GetProgramNamedParameterfvNV, (id, len, name, params), (F, "glGetProgramNamedParameterfvNV(%d, %d, %p, %p);\n", id, len, (const void *) name, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ProgramNamedParameter4dNV)(GLuint id, GLsizei len, const GLubyte * name, GLdouble x, GLdouble y, GLdouble z, GLdouble w)
+{
+ DISPATCH(ProgramNamedParameter4dNV, (id, len, name, x, y, z, w), (F, "glProgramNamedParameter4dNV(%d, %d, %p, %f, %f, %f, %f);\n", id, len, (const void *) name, x, y, z, w));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ProgramNamedParameter4dvNV)(GLuint id, GLsizei len, const GLubyte * name, const GLdouble * v)
+{
+ DISPATCH(ProgramNamedParameter4dvNV, (id, len, name, v), (F, "glProgramNamedParameter4dvNV(%d, %d, %p, %p);\n", id, len, (const void *) name, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ProgramNamedParameter4fNV)(GLuint id, GLsizei len, const GLubyte * name, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
+{
+ DISPATCH(ProgramNamedParameter4fNV, (id, len, name, x, y, z, w), (F, "glProgramNamedParameter4fNV(%d, %d, %p, %f, %f, %f, %f);\n", id, len, (const void *) name, x, y, z, w));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ProgramNamedParameter4fvNV)(GLuint id, GLsizei len, const GLubyte * name, const GLfloat * v)
+{
+ DISPATCH(ProgramNamedParameter4fvNV, (id, len, name, v), (F, "glProgramNamedParameter4fvNV(%d, %d, %p, %p);\n", id, len, (const void *) name, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(PrimitiveRestartIndexNV)(GLuint index)
+{
+ DISPATCH(PrimitiveRestartIndexNV, (index), (F, "glPrimitiveRestartIndexNV(%d);\n", index));
+}
+
+KEYWORD1 void KEYWORD2 NAME(PrimitiveRestartIndex)(GLuint index)
+{
+ DISPATCH(PrimitiveRestartIndexNV, (index), (F, "glPrimitiveRestartIndex(%d);\n", index));
+}
+
+KEYWORD1 void KEYWORD2 NAME(PrimitiveRestartNV)(void)
+{
+ DISPATCH(PrimitiveRestartNV, (), (F, "glPrimitiveRestartNV();\n"));
+}
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_833)(GLclampd zmin, GLclampd zmax);
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_833)(GLclampd zmin, GLclampd zmax)
+{
+ DISPATCH(DepthBoundsEXT, (zmin, zmax), (F, "glDepthBoundsEXT(%f, %f);\n", zmin, zmax));
+}
+
+KEYWORD1 void KEYWORD2 NAME(BlendEquationSeparate)(GLenum modeRGB, GLenum modeA)
+{
+ DISPATCH(BlendEquationSeparateEXT, (modeRGB, modeA), (F, "glBlendEquationSeparate(0x%x, 0x%x);\n", modeRGB, modeA));
+}
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_834)(GLenum modeRGB, GLenum modeA);
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_834)(GLenum modeRGB, GLenum modeA)
+{
+ DISPATCH(BlendEquationSeparateEXT, (modeRGB, modeA), (F, "glBlendEquationSeparateEXT(0x%x, 0x%x);\n", modeRGB, modeA));
+}
+
+KEYWORD1 void KEYWORD2 NAME(BindFramebuffer)(GLenum target, GLuint framebuffer)
+{
+ DISPATCH(BindFramebufferEXT, (target, framebuffer), (F, "glBindFramebuffer(0x%x, %d);\n", target, framebuffer));
+}
+
+KEYWORD1 void KEYWORD2 NAME(BindFramebufferEXT)(GLenum target, GLuint framebuffer)
+{
+ DISPATCH(BindFramebufferEXT, (target, framebuffer), (F, "glBindFramebufferEXT(0x%x, %d);\n", target, framebuffer));
+}
+
+KEYWORD1 void KEYWORD2 NAME(BindRenderbuffer)(GLenum target, GLuint renderbuffer)
+{
+ DISPATCH(BindRenderbufferEXT, (target, renderbuffer), (F, "glBindRenderbuffer(0x%x, %d);\n", target, renderbuffer));
+}
+
+KEYWORD1 void KEYWORD2 NAME(BindRenderbufferEXT)(GLenum target, GLuint renderbuffer)
+{
+ DISPATCH(BindRenderbufferEXT, (target, renderbuffer), (F, "glBindRenderbufferEXT(0x%x, %d);\n", target, renderbuffer));
+}
+
+KEYWORD1 GLenum KEYWORD2 NAME(CheckFramebufferStatus)(GLenum target)
+{
+ RETURN_DISPATCH(CheckFramebufferStatusEXT, (target), (F, "glCheckFramebufferStatus(0x%x);\n", target));
+}
+
+KEYWORD1 GLenum KEYWORD2 NAME(CheckFramebufferStatusEXT)(GLenum target)
+{
+ RETURN_DISPATCH(CheckFramebufferStatusEXT, (target), (F, "glCheckFramebufferStatusEXT(0x%x);\n", target));
+}
+
+KEYWORD1 void KEYWORD2 NAME(DeleteFramebuffers)(GLsizei n, const GLuint * framebuffers)
+{
+ DISPATCH(DeleteFramebuffersEXT, (n, framebuffers), (F, "glDeleteFramebuffers(%d, %p);\n", n, (const void *) framebuffers));
+}
+
+KEYWORD1 void KEYWORD2 NAME(DeleteFramebuffersEXT)(GLsizei n, const GLuint * framebuffers)
+{
+ DISPATCH(DeleteFramebuffersEXT, (n, framebuffers), (F, "glDeleteFramebuffersEXT(%d, %p);\n", n, (const void *) framebuffers));
+}
+
+KEYWORD1 void KEYWORD2 NAME(DeleteRenderbuffers)(GLsizei n, const GLuint * renderbuffers)
+{
+ DISPATCH(DeleteRenderbuffersEXT, (n, renderbuffers), (F, "glDeleteRenderbuffers(%d, %p);\n", n, (const void *) renderbuffers));
+}
+
+KEYWORD1 void KEYWORD2 NAME(DeleteRenderbuffersEXT)(GLsizei n, const GLuint * renderbuffers)
+{
+ DISPATCH(DeleteRenderbuffersEXT, (n, renderbuffers), (F, "glDeleteRenderbuffersEXT(%d, %p);\n", n, (const void *) renderbuffers));
+}
+
+KEYWORD1 void KEYWORD2 NAME(FramebufferRenderbuffer)(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer)
+{
+ DISPATCH(FramebufferRenderbufferEXT, (target, attachment, renderbuffertarget, renderbuffer), (F, "glFramebufferRenderbuffer(0x%x, 0x%x, 0x%x, %d);\n", target, attachment, renderbuffertarget, renderbuffer));
+}
+
+KEYWORD1 void KEYWORD2 NAME(FramebufferRenderbufferEXT)(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer)
+{
+ DISPATCH(FramebufferRenderbufferEXT, (target, attachment, renderbuffertarget, renderbuffer), (F, "glFramebufferRenderbufferEXT(0x%x, 0x%x, 0x%x, %d);\n", target, attachment, renderbuffertarget, renderbuffer));
+}
+
+KEYWORD1 void KEYWORD2 NAME(FramebufferTexture1D)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level)
+{
+ DISPATCH(FramebufferTexture1DEXT, (target, attachment, textarget, texture, level), (F, "glFramebufferTexture1D(0x%x, 0x%x, 0x%x, %d, %d);\n", target, attachment, textarget, texture, level));
+}
+
+KEYWORD1 void KEYWORD2 NAME(FramebufferTexture1DEXT)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level)
+{
+ DISPATCH(FramebufferTexture1DEXT, (target, attachment, textarget, texture, level), (F, "glFramebufferTexture1DEXT(0x%x, 0x%x, 0x%x, %d, %d);\n", target, attachment, textarget, texture, level));
+}
+
+KEYWORD1 void KEYWORD2 NAME(FramebufferTexture2D)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level)
+{
+ DISPATCH(FramebufferTexture2DEXT, (target, attachment, textarget, texture, level), (F, "glFramebufferTexture2D(0x%x, 0x%x, 0x%x, %d, %d);\n", target, attachment, textarget, texture, level));
+}
+
+KEYWORD1 void KEYWORD2 NAME(FramebufferTexture2DEXT)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level)
+{
+ DISPATCH(FramebufferTexture2DEXT, (target, attachment, textarget, texture, level), (F, "glFramebufferTexture2DEXT(0x%x, 0x%x, 0x%x, %d, %d);\n", target, attachment, textarget, texture, level));
+}
+
+KEYWORD1 void KEYWORD2 NAME(FramebufferTexture3D)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset)
+{
+ DISPATCH(FramebufferTexture3DEXT, (target, attachment, textarget, texture, level, zoffset), (F, "glFramebufferTexture3D(0x%x, 0x%x, 0x%x, %d, %d, %d);\n", target, attachment, textarget, texture, level, zoffset));
+}
+
+KEYWORD1 void KEYWORD2 NAME(FramebufferTexture3DEXT)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset)
+{
+ DISPATCH(FramebufferTexture3DEXT, (target, attachment, textarget, texture, level, zoffset), (F, "glFramebufferTexture3DEXT(0x%x, 0x%x, 0x%x, %d, %d, %d);\n", target, attachment, textarget, texture, level, zoffset));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GenFramebuffers)(GLsizei n, GLuint * framebuffers)
+{
+ DISPATCH(GenFramebuffersEXT, (n, framebuffers), (F, "glGenFramebuffers(%d, %p);\n", n, (const void *) framebuffers));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GenFramebuffersEXT)(GLsizei n, GLuint * framebuffers)
+{
+ DISPATCH(GenFramebuffersEXT, (n, framebuffers), (F, "glGenFramebuffersEXT(%d, %p);\n", n, (const void *) framebuffers));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GenRenderbuffers)(GLsizei n, GLuint * renderbuffers)
+{
+ DISPATCH(GenRenderbuffersEXT, (n, renderbuffers), (F, "glGenRenderbuffers(%d, %p);\n", n, (const void *) renderbuffers));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GenRenderbuffersEXT)(GLsizei n, GLuint * renderbuffers)
+{
+ DISPATCH(GenRenderbuffersEXT, (n, renderbuffers), (F, "glGenRenderbuffersEXT(%d, %p);\n", n, (const void *) renderbuffers));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GenerateMipmap)(GLenum target)
+{
+ DISPATCH(GenerateMipmapEXT, (target), (F, "glGenerateMipmap(0x%x);\n", target));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GenerateMipmapEXT)(GLenum target)
+{
+ DISPATCH(GenerateMipmapEXT, (target), (F, "glGenerateMipmapEXT(0x%x);\n", target));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetFramebufferAttachmentParameteriv)(GLenum target, GLenum attachment, GLenum pname, GLint * params)
+{
+ DISPATCH(GetFramebufferAttachmentParameterivEXT, (target, attachment, pname, params), (F, "glGetFramebufferAttachmentParameteriv(0x%x, 0x%x, 0x%x, %p);\n", target, attachment, pname, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetFramebufferAttachmentParameterivEXT)(GLenum target, GLenum attachment, GLenum pname, GLint * params)
+{
+ DISPATCH(GetFramebufferAttachmentParameterivEXT, (target, attachment, pname, params), (F, "glGetFramebufferAttachmentParameterivEXT(0x%x, 0x%x, 0x%x, %p);\n", target, attachment, pname, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetRenderbufferParameteriv)(GLenum target, GLenum pname, GLint * params)
+{
+ DISPATCH(GetRenderbufferParameterivEXT, (target, pname, params), (F, "glGetRenderbufferParameteriv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetRenderbufferParameterivEXT)(GLenum target, GLenum pname, GLint * params)
+{
+ DISPATCH(GetRenderbufferParameterivEXT, (target, pname, params), (F, "glGetRenderbufferParameterivEXT(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
+}
+
+KEYWORD1 GLboolean KEYWORD2 NAME(IsFramebuffer)(GLuint framebuffer)
+{
+ RETURN_DISPATCH(IsFramebufferEXT, (framebuffer), (F, "glIsFramebuffer(%d);\n", framebuffer));
+}
+
+KEYWORD1 GLboolean KEYWORD2 NAME(IsFramebufferEXT)(GLuint framebuffer)
+{
+ RETURN_DISPATCH(IsFramebufferEXT, (framebuffer), (F, "glIsFramebufferEXT(%d);\n", framebuffer));
+}
+
+KEYWORD1 GLboolean KEYWORD2 NAME(IsRenderbuffer)(GLuint renderbuffer)
+{
+ RETURN_DISPATCH(IsRenderbufferEXT, (renderbuffer), (F, "glIsRenderbuffer(%d);\n", renderbuffer));
+}
+
+KEYWORD1 GLboolean KEYWORD2 NAME(IsRenderbufferEXT)(GLuint renderbuffer)
+{
+ RETURN_DISPATCH(IsRenderbufferEXT, (renderbuffer), (F, "glIsRenderbufferEXT(%d);\n", renderbuffer));
+}
+
+KEYWORD1 void KEYWORD2 NAME(RenderbufferStorage)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height)
+{
+ DISPATCH(RenderbufferStorageEXT, (target, internalformat, width, height), (F, "glRenderbufferStorage(0x%x, 0x%x, %d, %d);\n", target, internalformat, width, height));
+}
+
+KEYWORD1 void KEYWORD2 NAME(RenderbufferStorageEXT)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height)
+{
+ DISPATCH(RenderbufferStorageEXT, (target, internalformat, width, height), (F, "glRenderbufferStorageEXT(0x%x, 0x%x, %d, %d);\n", target, internalformat, width, height));
+}
+
+KEYWORD1 void KEYWORD2 NAME(BlitFramebuffer)(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter)
+{
+ DISPATCH(BlitFramebufferEXT, (srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter), (F, "glBlitFramebuffer(%d, %d, %d, %d, %d, %d, %d, %d, %d, 0x%x);\n", srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter));
+}
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_852)(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_852)(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter)
+{
+ DISPATCH(BlitFramebufferEXT, (srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter), (F, "glBlitFramebufferEXT(%d, %d, %d, %d, %d, %d, %d, %d, %d, 0x%x);\n", srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter));
+}
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_853)(GLenum target, GLenum pname, GLint param);
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_853)(GLenum target, GLenum pname, GLint param)
+{
+ DISPATCH(BufferParameteriAPPLE, (target, pname, param), (F, "glBufferParameteriAPPLE(0x%x, 0x%x, %d);\n", target, pname, param));
+}
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_854)(GLenum target, GLintptr offset, GLsizeiptr size);
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_854)(GLenum target, GLintptr offset, GLsizeiptr size)
+{
+ DISPATCH(FlushMappedBufferRangeAPPLE, (target, offset, size), (F, "glFlushMappedBufferRangeAPPLE(0x%x, %d, %d);\n", target, offset, size));
+}
+
+KEYWORD1 void KEYWORD2 NAME(BindFragDataLocationEXT)(GLuint program, GLuint colorNumber, const GLchar * name)
+{
+ DISPATCH(BindFragDataLocationEXT, (program, colorNumber, name), (F, "glBindFragDataLocationEXT(%d, %d, %p);\n", program, colorNumber, (const void *) name));
+}
+
+KEYWORD1 void KEYWORD2 NAME(BindFragDataLocation)(GLuint program, GLuint colorNumber, const GLchar * name)
+{
+ DISPATCH(BindFragDataLocationEXT, (program, colorNumber, name), (F, "glBindFragDataLocation(%d, %d, %p);\n", program, colorNumber, (const void *) name));
+}
+
+KEYWORD1 GLint KEYWORD2 NAME(GetFragDataLocationEXT)(GLuint program, const GLchar * name)
+{
+ RETURN_DISPATCH(GetFragDataLocationEXT, (program, name), (F, "glGetFragDataLocationEXT(%d, %p);\n", program, (const void *) name));
+}
+
+KEYWORD1 GLint KEYWORD2 NAME(GetFragDataLocation)(GLuint program, const GLchar * name)
+{
+ RETURN_DISPATCH(GetFragDataLocationEXT, (program, name), (F, "glGetFragDataLocation(%d, %p);\n", program, (const void *) name));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetUniformuivEXT)(GLuint program, GLint location, GLuint * params)
+{
+ DISPATCH(GetUniformuivEXT, (program, location, params), (F, "glGetUniformuivEXT(%d, %d, %p);\n", program, location, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetUniformuiv)(GLuint program, GLint location, GLuint * params)
+{
+ DISPATCH(GetUniformuivEXT, (program, location, params), (F, "glGetUniformuiv(%d, %d, %p);\n", program, location, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetVertexAttribIivEXT)(GLuint index, GLenum pname, GLint * params)
+{
+ DISPATCH(GetVertexAttribIivEXT, (index, pname, params), (F, "glGetVertexAttribIivEXT(%d, 0x%x, %p);\n", index, pname, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetVertexAttribIiv)(GLuint index, GLenum pname, GLint * params)
+{
+ DISPATCH(GetVertexAttribIivEXT, (index, pname, params), (F, "glGetVertexAttribIiv(%d, 0x%x, %p);\n", index, pname, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetVertexAttribIuivEXT)(GLuint index, GLenum pname, GLuint * params)
+{
+ DISPATCH(GetVertexAttribIuivEXT, (index, pname, params), (F, "glGetVertexAttribIuivEXT(%d, 0x%x, %p);\n", index, pname, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetVertexAttribIuiv)(GLuint index, GLenum pname, GLuint * params)
+{
+ DISPATCH(GetVertexAttribIuivEXT, (index, pname, params), (F, "glGetVertexAttribIuiv(%d, 0x%x, %p);\n", index, pname, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Uniform1uiEXT)(GLint location, GLuint x)
+{
+ DISPATCH(Uniform1uiEXT, (location, x), (F, "glUniform1uiEXT(%d, %d);\n", location, x));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Uniform1ui)(GLint location, GLuint x)
+{
+ DISPATCH(Uniform1uiEXT, (location, x), (F, "glUniform1ui(%d, %d);\n", location, x));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Uniform1uivEXT)(GLint location, GLsizei count, const GLuint * value)
+{
+ DISPATCH(Uniform1uivEXT, (location, count, value), (F, "glUniform1uivEXT(%d, %d, %p);\n", location, count, (const void *) value));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Uniform1uiv)(GLint location, GLsizei count, const GLuint * value)
+{
+ DISPATCH(Uniform1uivEXT, (location, count, value), (F, "glUniform1uiv(%d, %d, %p);\n", location, count, (const void *) value));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Uniform2uiEXT)(GLint location, GLuint x, GLuint y)
+{
+ DISPATCH(Uniform2uiEXT, (location, x, y), (F, "glUniform2uiEXT(%d, %d, %d);\n", location, x, y));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Uniform2ui)(GLint location, GLuint x, GLuint y)
+{
+ DISPATCH(Uniform2uiEXT, (location, x, y), (F, "glUniform2ui(%d, %d, %d);\n", location, x, y));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Uniform2uivEXT)(GLint location, GLsizei count, const GLuint * value)
+{
+ DISPATCH(Uniform2uivEXT, (location, count, value), (F, "glUniform2uivEXT(%d, %d, %p);\n", location, count, (const void *) value));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Uniform2uiv)(GLint location, GLsizei count, const GLuint * value)
+{
+ DISPATCH(Uniform2uivEXT, (location, count, value), (F, "glUniform2uiv(%d, %d, %p);\n", location, count, (const void *) value));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Uniform3uiEXT)(GLint location, GLuint x, GLuint y, GLuint z)
+{
+ DISPATCH(Uniform3uiEXT, (location, x, y, z), (F, "glUniform3uiEXT(%d, %d, %d, %d);\n", location, x, y, z));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Uniform3ui)(GLint location, GLuint x, GLuint y, GLuint z)
+{
+ DISPATCH(Uniform3uiEXT, (location, x, y, z), (F, "glUniform3ui(%d, %d, %d, %d);\n", location, x, y, z));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Uniform3uivEXT)(GLint location, GLsizei count, const GLuint * value)
+{
+ DISPATCH(Uniform3uivEXT, (location, count, value), (F, "glUniform3uivEXT(%d, %d, %p);\n", location, count, (const void *) value));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Uniform3uiv)(GLint location, GLsizei count, const GLuint * value)
+{
+ DISPATCH(Uniform3uivEXT, (location, count, value), (F, "glUniform3uiv(%d, %d, %p);\n", location, count, (const void *) value));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Uniform4uiEXT)(GLint location, GLuint x, GLuint y, GLuint z, GLuint w)
+{
+ DISPATCH(Uniform4uiEXT, (location, x, y, z, w), (F, "glUniform4uiEXT(%d, %d, %d, %d, %d);\n", location, x, y, z, w));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Uniform4ui)(GLint location, GLuint x, GLuint y, GLuint z, GLuint w)
+{
+ DISPATCH(Uniform4uiEXT, (location, x, y, z, w), (F, "glUniform4ui(%d, %d, %d, %d, %d);\n", location, x, y, z, w));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Uniform4uivEXT)(GLint location, GLsizei count, const GLuint * value)
+{
+ DISPATCH(Uniform4uivEXT, (location, count, value), (F, "glUniform4uivEXT(%d, %d, %p);\n", location, count, (const void *) value));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Uniform4uiv)(GLint location, GLsizei count, const GLuint * value)
+{
+ DISPATCH(Uniform4uivEXT, (location, count, value), (F, "glUniform4uiv(%d, %d, %p);\n", location, count, (const void *) value));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttribI1iEXT)(GLuint index, GLint x)
+{
+ DISPATCH(VertexAttribI1iEXT, (index, x), (F, "glVertexAttribI1iEXT(%d, %d);\n", index, x));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttribI1i)(GLuint index, GLint x)
+{
+ DISPATCH(VertexAttribI1iEXT, (index, x), (F, "glVertexAttribI1i(%d, %d);\n", index, x));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttribI1ivEXT)(GLuint index, const GLint * v)
+{
+ DISPATCH(VertexAttribI1ivEXT, (index, v), (F, "glVertexAttribI1ivEXT(%d, %p);\n", index, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttribI1iv)(GLuint index, const GLint * v)
+{
+ DISPATCH(VertexAttribI1ivEXT, (index, v), (F, "glVertexAttribI1iv(%d, %p);\n", index, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttribI1uiEXT)(GLuint index, GLuint x)
+{
+ DISPATCH(VertexAttribI1uiEXT, (index, x), (F, "glVertexAttribI1uiEXT(%d, %d);\n", index, x));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttribI1ui)(GLuint index, GLuint x)
+{
+ DISPATCH(VertexAttribI1uiEXT, (index, x), (F, "glVertexAttribI1ui(%d, %d);\n", index, x));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttribI1uivEXT)(GLuint index, const GLuint * v)
+{
+ DISPATCH(VertexAttribI1uivEXT, (index, v), (F, "glVertexAttribI1uivEXT(%d, %p);\n", index, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttribI1uiv)(GLuint index, const GLuint * v)
+{
+ DISPATCH(VertexAttribI1uivEXT, (index, v), (F, "glVertexAttribI1uiv(%d, %p);\n", index, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttribI2iEXT)(GLuint index, GLint x, GLint y)
+{
+ DISPATCH(VertexAttribI2iEXT, (index, x, y), (F, "glVertexAttribI2iEXT(%d, %d, %d);\n", index, x, y));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttribI2i)(GLuint index, GLint x, GLint y)
+{
+ DISPATCH(VertexAttribI2iEXT, (index, x, y), (F, "glVertexAttribI2i(%d, %d, %d);\n", index, x, y));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttribI2ivEXT)(GLuint index, const GLint * v)
+{
+ DISPATCH(VertexAttribI2ivEXT, (index, v), (F, "glVertexAttribI2ivEXT(%d, %p);\n", index, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttribI2iv)(GLuint index, const GLint * v)
+{
+ DISPATCH(VertexAttribI2ivEXT, (index, v), (F, "glVertexAttribI2iv(%d, %p);\n", index, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttribI2uiEXT)(GLuint index, GLuint x, GLuint y)
+{
+ DISPATCH(VertexAttribI2uiEXT, (index, x, y), (F, "glVertexAttribI2uiEXT(%d, %d, %d);\n", index, x, y));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttribI2ui)(GLuint index, GLuint x, GLuint y)
+{
+ DISPATCH(VertexAttribI2uiEXT, (index, x, y), (F, "glVertexAttribI2ui(%d, %d, %d);\n", index, x, y));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttribI2uivEXT)(GLuint index, const GLuint * v)
+{
+ DISPATCH(VertexAttribI2uivEXT, (index, v), (F, "glVertexAttribI2uivEXT(%d, %p);\n", index, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttribI2uiv)(GLuint index, const GLuint * v)
+{
+ DISPATCH(VertexAttribI2uivEXT, (index, v), (F, "glVertexAttribI2uiv(%d, %p);\n", index, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttribI3iEXT)(GLuint index, GLint x, GLint y, GLint z)
+{
+ DISPATCH(VertexAttribI3iEXT, (index, x, y, z), (F, "glVertexAttribI3iEXT(%d, %d, %d, %d);\n", index, x, y, z));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttribI3i)(GLuint index, GLint x, GLint y, GLint z)
+{
+ DISPATCH(VertexAttribI3iEXT, (index, x, y, z), (F, "glVertexAttribI3i(%d, %d, %d, %d);\n", index, x, y, z));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttribI3ivEXT)(GLuint index, const GLint * v)
+{
+ DISPATCH(VertexAttribI3ivEXT, (index, v), (F, "glVertexAttribI3ivEXT(%d, %p);\n", index, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttribI3iv)(GLuint index, const GLint * v)
+{
+ DISPATCH(VertexAttribI3ivEXT, (index, v), (F, "glVertexAttribI3iv(%d, %p);\n", index, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttribI3uiEXT)(GLuint index, GLuint x, GLuint y, GLuint z)
+{
+ DISPATCH(VertexAttribI3uiEXT, (index, x, y, z), (F, "glVertexAttribI3uiEXT(%d, %d, %d, %d);\n", index, x, y, z));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttribI3ui)(GLuint index, GLuint x, GLuint y, GLuint z)
+{
+ DISPATCH(VertexAttribI3uiEXT, (index, x, y, z), (F, "glVertexAttribI3ui(%d, %d, %d, %d);\n", index, x, y, z));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttribI3uivEXT)(GLuint index, const GLuint * v)
+{
+ DISPATCH(VertexAttribI3uivEXT, (index, v), (F, "glVertexAttribI3uivEXT(%d, %p);\n", index, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttribI3uiv)(GLuint index, const GLuint * v)
+{
+ DISPATCH(VertexAttribI3uivEXT, (index, v), (F, "glVertexAttribI3uiv(%d, %p);\n", index, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttribI4bvEXT)(GLuint index, const GLbyte * v)
+{
+ DISPATCH(VertexAttribI4bvEXT, (index, v), (F, "glVertexAttribI4bvEXT(%d, %p);\n", index, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttribI4bv)(GLuint index, const GLbyte * v)
+{
+ DISPATCH(VertexAttribI4bvEXT, (index, v), (F, "glVertexAttribI4bv(%d, %p);\n", index, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttribI4iEXT)(GLuint index, GLint x, GLint y, GLint z, GLint w)
+{
+ DISPATCH(VertexAttribI4iEXT, (index, x, y, z, w), (F, "glVertexAttribI4iEXT(%d, %d, %d, %d, %d);\n", index, x, y, z, w));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttribI4i)(GLuint index, GLint x, GLint y, GLint z, GLint w)
+{
+ DISPATCH(VertexAttribI4iEXT, (index, x, y, z, w), (F, "glVertexAttribI4i(%d, %d, %d, %d, %d);\n", index, x, y, z, w));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttribI4ivEXT)(GLuint index, const GLint * v)
+{
+ DISPATCH(VertexAttribI4ivEXT, (index, v), (F, "glVertexAttribI4ivEXT(%d, %p);\n", index, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttribI4iv)(GLuint index, const GLint * v)
+{
+ DISPATCH(VertexAttribI4ivEXT, (index, v), (F, "glVertexAttribI4iv(%d, %p);\n", index, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttribI4svEXT)(GLuint index, const GLshort * v)
+{
+ DISPATCH(VertexAttribI4svEXT, (index, v), (F, "glVertexAttribI4svEXT(%d, %p);\n", index, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttribI4sv)(GLuint index, const GLshort * v)
+{
+ DISPATCH(VertexAttribI4svEXT, (index, v), (F, "glVertexAttribI4sv(%d, %p);\n", index, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttribI4ubvEXT)(GLuint index, const GLubyte * v)
+{
+ DISPATCH(VertexAttribI4ubvEXT, (index, v), (F, "glVertexAttribI4ubvEXT(%d, %p);\n", index, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttribI4ubv)(GLuint index, const GLubyte * v)
+{
+ DISPATCH(VertexAttribI4ubvEXT, (index, v), (F, "glVertexAttribI4ubv(%d, %p);\n", index, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttribI4uiEXT)(GLuint index, GLuint x, GLuint y, GLuint z, GLuint w)
+{
+ DISPATCH(VertexAttribI4uiEXT, (index, x, y, z, w), (F, "glVertexAttribI4uiEXT(%d, %d, %d, %d, %d);\n", index, x, y, z, w));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttribI4ui)(GLuint index, GLuint x, GLuint y, GLuint z, GLuint w)
+{
+ DISPATCH(VertexAttribI4uiEXT, (index, x, y, z, w), (F, "glVertexAttribI4ui(%d, %d, %d, %d, %d);\n", index, x, y, z, w));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttribI4uivEXT)(GLuint index, const GLuint * v)
+{
+ DISPATCH(VertexAttribI4uivEXT, (index, v), (F, "glVertexAttribI4uivEXT(%d, %p);\n", index, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttribI4uiv)(GLuint index, const GLuint * v)
+{
+ DISPATCH(VertexAttribI4uivEXT, (index, v), (F, "glVertexAttribI4uiv(%d, %p);\n", index, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttribI4usvEXT)(GLuint index, const GLushort * v)
+{
+ DISPATCH(VertexAttribI4usvEXT, (index, v), (F, "glVertexAttribI4usvEXT(%d, %p);\n", index, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttribI4usv)(GLuint index, const GLushort * v)
+{
+ DISPATCH(VertexAttribI4usvEXT, (index, v), (F, "glVertexAttribI4usv(%d, %p);\n", index, (const void *) v));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttribIPointerEXT)(GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid * pointer)
+{
+ DISPATCH(VertexAttribIPointerEXT, (index, size, type, stride, pointer), (F, "glVertexAttribIPointerEXT(%d, %d, 0x%x, %d, %p);\n", index, size, type, stride, (const void *) pointer));
+}
+
+KEYWORD1 void KEYWORD2 NAME(VertexAttribIPointer)(GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid * pointer)
+{
+ DISPATCH(VertexAttribIPointerEXT, (index, size, type, stride, pointer), (F, "glVertexAttribIPointer(%d, %d, 0x%x, %d, %p);\n", index, size, type, stride, (const void *) pointer));
+}
+
+KEYWORD1 void KEYWORD2 NAME(FramebufferTextureLayer)(GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer)
+{
+ DISPATCH(FramebufferTextureLayerEXT, (target, attachment, texture, level, layer), (F, "glFramebufferTextureLayer(0x%x, 0x%x, %d, %d, %d);\n", target, attachment, texture, level, layer));
+}
+
+KEYWORD1 void KEYWORD2 NAME(FramebufferTextureLayerEXT)(GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer)
+{
+ DISPATCH(FramebufferTextureLayerEXT, (target, attachment, texture, level, layer), (F, "glFramebufferTextureLayerEXT(0x%x, 0x%x, %d, %d, %d);\n", target, attachment, texture, level, layer));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ColorMaskIndexedEXT)(GLuint buf, GLboolean r, GLboolean g, GLboolean b, GLboolean a)
+{
+ DISPATCH(ColorMaskIndexedEXT, (buf, r, g, b, a), (F, "glColorMaskIndexedEXT(%d, %d, %d, %d, %d);\n", buf, r, g, b, a));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ColorMaski)(GLuint buf, GLboolean r, GLboolean g, GLboolean b, GLboolean a)
+{
+ DISPATCH(ColorMaskIndexedEXT, (buf, r, g, b, a), (F, "glColorMaski(%d, %d, %d, %d, %d);\n", buf, r, g, b, a));
+}
+
+KEYWORD1 void KEYWORD2 NAME(DisableIndexedEXT)(GLenum target, GLuint index)
+{
+ DISPATCH(DisableIndexedEXT, (target, index), (F, "glDisableIndexedEXT(0x%x, %d);\n", target, index));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Disablei)(GLenum target, GLuint index)
+{
+ DISPATCH(DisableIndexedEXT, (target, index), (F, "glDisablei(0x%x, %d);\n", target, index));
+}
+
+KEYWORD1 void KEYWORD2 NAME(EnableIndexedEXT)(GLenum target, GLuint index)
+{
+ DISPATCH(EnableIndexedEXT, (target, index), (F, "glEnableIndexedEXT(0x%x, %d);\n", target, index));
+}
+
+KEYWORD1 void KEYWORD2 NAME(Enablei)(GLenum target, GLuint index)
+{
+ DISPATCH(EnableIndexedEXT, (target, index), (F, "glEnablei(0x%x, %d);\n", target, index));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetBooleanIndexedvEXT)(GLenum value, GLuint index, GLboolean * data)
+{
+ DISPATCH(GetBooleanIndexedvEXT, (value, index, data), (F, "glGetBooleanIndexedvEXT(0x%x, %d, %p);\n", value, index, (const void *) data));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetBooleani_v)(GLenum value, GLuint index, GLboolean * data)
+{
+ DISPATCH(GetBooleanIndexedvEXT, (value, index, data), (F, "glGetBooleani_v(0x%x, %d, %p);\n", value, index, (const void *) data));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetIntegerIndexedvEXT)(GLenum value, GLuint index, GLint * data)
+{
+ DISPATCH(GetIntegerIndexedvEXT, (value, index, data), (F, "glGetIntegerIndexedvEXT(0x%x, %d, %p);\n", value, index, (const void *) data));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetIntegeri_v)(GLenum value, GLuint index, GLint * data)
+{
+ DISPATCH(GetIntegerIndexedvEXT, (value, index, data), (F, "glGetIntegeri_v(0x%x, %d, %p);\n", value, index, (const void *) data));
+}
+
+KEYWORD1 GLboolean KEYWORD2 NAME(IsEnabledIndexedEXT)(GLenum target, GLuint index)
+{
+ RETURN_DISPATCH(IsEnabledIndexedEXT, (target, index), (F, "glIsEnabledIndexedEXT(0x%x, %d);\n", target, index));
+}
+
+KEYWORD1 GLboolean KEYWORD2 NAME(IsEnabledi)(GLenum target, GLuint index)
+{
+ RETURN_DISPATCH(IsEnabledIndexedEXT, (target, index), (F, "glIsEnabledi(0x%x, %d);\n", target, index));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ClearColorIiEXT)(GLint r, GLint g, GLint b, GLint a)
+{
+ DISPATCH(ClearColorIiEXT, (r, g, b, a), (F, "glClearColorIiEXT(%d, %d, %d, %d);\n", r, g, b, a));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ClearColorIuiEXT)(GLuint r, GLuint g, GLuint b, GLuint a)
+{
+ DISPATCH(ClearColorIuiEXT, (r, g, b, a), (F, "glClearColorIuiEXT(%d, %d, %d, %d);\n", r, g, b, a));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetTexParameterIivEXT)(GLenum target, GLenum pname, GLint * params)
+{
+ DISPATCH(GetTexParameterIivEXT, (target, pname, params), (F, "glGetTexParameterIivEXT(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetTexParameterIiv)(GLenum target, GLenum pname, GLint * params)
+{
+ DISPATCH(GetTexParameterIivEXT, (target, pname, params), (F, "glGetTexParameterIiv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetTexParameterIuivEXT)(GLenum target, GLenum pname, GLuint * params)
+{
+ DISPATCH(GetTexParameterIuivEXT, (target, pname, params), (F, "glGetTexParameterIuivEXT(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetTexParameterIuiv)(GLenum target, GLenum pname, GLuint * params)
+{
+ DISPATCH(GetTexParameterIuivEXT, (target, pname, params), (F, "glGetTexParameterIuiv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TexParameterIivEXT)(GLenum target, GLenum pname, const GLint * params)
+{
+ DISPATCH(TexParameterIivEXT, (target, pname, params), (F, "glTexParameterIivEXT(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TexParameterIiv)(GLenum target, GLenum pname, const GLint * params)
+{
+ DISPATCH(TexParameterIivEXT, (target, pname, params), (F, "glTexParameterIiv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TexParameterIuivEXT)(GLenum target, GLenum pname, const GLuint * params)
+{
+ DISPATCH(TexParameterIuivEXT, (target, pname, params), (F, "glTexParameterIuivEXT(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TexParameterIuiv)(GLenum target, GLenum pname, const GLuint * params)
+{
+ DISPATCH(TexParameterIuivEXT, (target, pname, params), (F, "glTexParameterIuiv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(BeginConditionalRenderNV)(GLuint query, GLenum mode)
+{
+ DISPATCH(BeginConditionalRenderNV, (query, mode), (F, "glBeginConditionalRenderNV(%d, 0x%x);\n", query, mode));
+}
+
+KEYWORD1 void KEYWORD2 NAME(BeginConditionalRender)(GLuint query, GLenum mode)
+{
+ DISPATCH(BeginConditionalRenderNV, (query, mode), (F, "glBeginConditionalRender(%d, 0x%x);\n", query, mode));
+}
+
+KEYWORD1 void KEYWORD2 NAME(EndConditionalRenderNV)(void)
+{
+ DISPATCH(EndConditionalRenderNV, (), (F, "glEndConditionalRenderNV();\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(EndConditionalRender)(void)
+{
+ DISPATCH(EndConditionalRenderNV, (), (F, "glEndConditionalRender();\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(BeginTransformFeedbackEXT)(GLenum mode)
+{
+ DISPATCH(BeginTransformFeedbackEXT, (mode), (F, "glBeginTransformFeedbackEXT(0x%x);\n", mode));
+}
+
+KEYWORD1 void KEYWORD2 NAME(BeginTransformFeedback)(GLenum mode)
+{
+ DISPATCH(BeginTransformFeedbackEXT, (mode), (F, "glBeginTransformFeedback(0x%x);\n", mode));
+}
+
+KEYWORD1 void KEYWORD2 NAME(BindBufferBaseEXT)(GLenum target, GLuint index, GLuint buffer)
+{
+ DISPATCH(BindBufferBaseEXT, (target, index, buffer), (F, "glBindBufferBaseEXT(0x%x, %d, %d);\n", target, index, buffer));
+}
+
+KEYWORD1 void KEYWORD2 NAME(BindBufferBase)(GLenum target, GLuint index, GLuint buffer)
+{
+ DISPATCH(BindBufferBaseEXT, (target, index, buffer), (F, "glBindBufferBase(0x%x, %d, %d);\n", target, index, buffer));
+}
+
+KEYWORD1 void KEYWORD2 NAME(BindBufferOffsetEXT)(GLenum target, GLuint index, GLuint buffer, GLintptr offset)
+{
+ DISPATCH(BindBufferOffsetEXT, (target, index, buffer, offset), (F, "glBindBufferOffsetEXT(0x%x, %d, %d, %d);\n", target, index, buffer, offset));
+}
+
+KEYWORD1 void KEYWORD2 NAME(BindBufferRangeEXT)(GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size)
+{
+ DISPATCH(BindBufferRangeEXT, (target, index, buffer, offset, size), (F, "glBindBufferRangeEXT(0x%x, %d, %d, %d, %d);\n", target, index, buffer, offset, size));
+}
+
+KEYWORD1 void KEYWORD2 NAME(BindBufferRange)(GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size)
+{
+ DISPATCH(BindBufferRangeEXT, (target, index, buffer, offset, size), (F, "glBindBufferRange(0x%x, %d, %d, %d, %d);\n", target, index, buffer, offset, size));
+}
+
+KEYWORD1 void KEYWORD2 NAME(EndTransformFeedbackEXT)(void)
+{
+ DISPATCH(EndTransformFeedbackEXT, (), (F, "glEndTransformFeedbackEXT();\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(EndTransformFeedback)(void)
+{
+ DISPATCH(EndTransformFeedbackEXT, (), (F, "glEndTransformFeedback();\n"));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetTransformFeedbackVaryingEXT)(GLuint program, GLuint index, GLsizei bufSize, GLsizei * length, GLsizei * size, GLenum * type, GLchar * name)
+{
+ DISPATCH(GetTransformFeedbackVaryingEXT, (program, index, bufSize, length, size, type, name), (F, "glGetTransformFeedbackVaryingEXT(%d, %d, %d, %p, %p, %p, %p);\n", program, index, bufSize, (const void *) length, (const void *) size, (const void *) type, (const void *) name));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetTransformFeedbackVarying)(GLuint program, GLuint index, GLsizei bufSize, GLsizei * length, GLsizei * size, GLenum * type, GLchar * name)
+{
+ DISPATCH(GetTransformFeedbackVaryingEXT, (program, index, bufSize, length, size, type, name), (F, "glGetTransformFeedbackVarying(%d, %d, %d, %p, %p, %p, %p);\n", program, index, bufSize, (const void *) length, (const void *) size, (const void *) type, (const void *) name));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TransformFeedbackVaryingsEXT)(GLuint program, GLsizei count, const char ** varyings, GLenum bufferMode)
+{
+ DISPATCH(TransformFeedbackVaryingsEXT, (program, count, varyings, bufferMode), (F, "glTransformFeedbackVaryingsEXT(%d, %d, %p, 0x%x);\n", program, count, (const void *) varyings, bufferMode));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TransformFeedbackVaryings)(GLuint program, GLsizei count, const GLchar* * varyings, GLenum bufferMode)
+{
+ DISPATCH(TransformFeedbackVaryingsEXT, (program, count, varyings, bufferMode), (F, "glTransformFeedbackVaryings(%d, %d, %p, 0x%x);\n", program, count, (const void *) varyings, bufferMode));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ProvokingVertexEXT)(GLenum mode)
+{
+ DISPATCH(ProvokingVertexEXT, (mode), (F, "glProvokingVertexEXT(0x%x);\n", mode));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ProvokingVertex)(GLenum mode)
+{
+ DISPATCH(ProvokingVertexEXT, (mode), (F, "glProvokingVertex(0x%x);\n", mode));
+}
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_912)(GLenum target, GLenum pname, GLvoid ** params);
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_912)(GLenum target, GLenum pname, GLvoid ** params)
+{
+ DISPATCH(GetTexParameterPointervAPPLE, (target, pname, params), (F, "glGetTexParameterPointervAPPLE(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
+}
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_913)(GLenum target, GLsizei length, GLvoid * pointer);
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_913)(GLenum target, GLsizei length, GLvoid * pointer)
+{
+ DISPATCH(TextureRangeAPPLE, (target, length, pointer), (F, "glTextureRangeAPPLE(0x%x, %d, %p);\n", target, length, (const void *) pointer));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetObjectParameterivAPPLE)(GLenum objectType, GLuint name, GLenum pname, GLint * value)
+{
+ DISPATCH(GetObjectParameterivAPPLE, (objectType, name, pname, value), (F, "glGetObjectParameterivAPPLE(0x%x, %d, 0x%x, %p);\n", objectType, name, pname, (const void *) value));
+}
+
+KEYWORD1 GLenum KEYWORD2 NAME(ObjectPurgeableAPPLE)(GLenum objectType, GLuint name, GLenum option)
+{
+ RETURN_DISPATCH(ObjectPurgeableAPPLE, (objectType, name, option), (F, "glObjectPurgeableAPPLE(0x%x, %d, 0x%x);\n", objectType, name, option));
+}
+
+KEYWORD1 GLenum KEYWORD2 NAME(ObjectUnpurgeableAPPLE)(GLenum objectType, GLuint name, GLenum option)
+{
+ RETURN_DISPATCH(ObjectUnpurgeableAPPLE, (objectType, name, option), (F, "glObjectUnpurgeableAPPLE(0x%x, %d, 0x%x);\n", objectType, name, option));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ActiveProgramEXT)(GLuint program)
+{
+ DISPATCH(ActiveProgramEXT, (program), (F, "glActiveProgramEXT(%d);\n", program));
+}
+
+KEYWORD1 GLuint KEYWORD2 NAME(CreateShaderProgramEXT)(GLenum type, const GLchar * string)
+{
+ RETURN_DISPATCH(CreateShaderProgramEXT, (type, string), (F, "glCreateShaderProgramEXT(0x%x, %p);\n", type, (const void *) string));
+}
+
+KEYWORD1 void KEYWORD2 NAME(UseShaderProgramEXT)(GLenum type, GLuint program)
+{
+ DISPATCH(UseShaderProgramEXT, (type, program), (F, "glUseShaderProgramEXT(0x%x, %d);\n", type, program));
+}
+
+KEYWORD1 void KEYWORD2 NAME(TextureBarrierNV)(void)
+{
+ DISPATCH(TextureBarrierNV, (), (F, "glTextureBarrierNV();\n"));
+}
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_921)(GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask);
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_921)(GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask)
+{
+ DISPATCH(StencilFuncSeparateATI, (frontfunc, backfunc, ref, mask), (F, "glStencilFuncSeparateATI(0x%x, 0x%x, %d, %d);\n", frontfunc, backfunc, ref, mask));
+}
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_922)(GLenum target, GLuint index, GLsizei count, const GLfloat * params);
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_922)(GLenum target, GLuint index, GLsizei count, const GLfloat * params)
+{
+ DISPATCH(ProgramEnvParameters4fvEXT, (target, index, count, params), (F, "glProgramEnvParameters4fvEXT(0x%x, %d, %d, %p);\n", target, index, count, (const void *) params));
+}
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_923)(GLenum target, GLuint index, GLsizei count, const GLfloat * params);
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_923)(GLenum target, GLuint index, GLsizei count, const GLfloat * params)
+{
+ DISPATCH(ProgramLocalParameters4fvEXT, (target, index, count, params), (F, "glProgramLocalParameters4fvEXT(0x%x, %d, %d, %p);\n", target, index, count, (const void *) params));
+}
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_924)(GLuint id, GLenum pname, GLint64EXT * params);
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_924)(GLuint id, GLenum pname, GLint64EXT * params)
+{
+ DISPATCH(GetQueryObjecti64vEXT, (id, pname, params), (F, "glGetQueryObjecti64vEXT(%d, 0x%x, %p);\n", id, pname, (const void *) params));
+}
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_925)(GLuint id, GLenum pname, GLuint64EXT * params);
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_925)(GLuint id, GLenum pname, GLuint64EXT * params)
+{
+ DISPATCH(GetQueryObjectui64vEXT, (id, pname, params), (F, "glGetQueryObjectui64vEXT(%d, 0x%x, %p);\n", id, pname, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(EGLImageTargetRenderbufferStorageOES)(GLenum target, GLvoid * writeOffset)
+{
+ DISPATCH(EGLImageTargetRenderbufferStorageOES, (target, writeOffset), (F, "glEGLImageTargetRenderbufferStorageOES(0x%x, %p);\n", target, (const void *) writeOffset));
+}
+
+KEYWORD1 void KEYWORD2 NAME(EGLImageTargetTexture2DOES)(GLenum target, GLvoid * writeOffset)
+{
+ DISPATCH(EGLImageTargetTexture2DOES, (target, writeOffset), (F, "glEGLImageTargetTexture2DOES(0x%x, %p);\n", target, (const void *) writeOffset));
+}
+
+
+#endif /* _GLAPI_SKIP_NORMAL_ENTRY_POINTS */
+
+/* these entry points might require different protocols */
+#ifndef _GLAPI_SKIP_PROTO_ENTRY_POINTS
+
+KEYWORD1 GLboolean KEYWORD2 NAME(AreTexturesResidentEXT)(GLsizei n, const GLuint * textures, GLboolean * residences)
+{
+ RETURN_DISPATCH(AreTexturesResident, (n, textures, residences), (F, "glAreTexturesResidentEXT(%d, %p, %p);\n", n, (const void *) textures, (const void *) residences));
+}
+
+KEYWORD1 void KEYWORD2 NAME(DeleteTexturesEXT)(GLsizei n, const GLuint * textures)
+{
+ DISPATCH(DeleteTextures, (n, textures), (F, "glDeleteTexturesEXT(%d, %p);\n", n, (const void *) textures));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GenTexturesEXT)(GLsizei n, GLuint * textures)
+{
+ DISPATCH(GenTextures, (n, textures), (F, "glGenTexturesEXT(%d, %p);\n", n, (const void *) textures));
+}
+
+KEYWORD1 GLboolean KEYWORD2 NAME(IsTextureEXT)(GLuint texture)
+{
+ RETURN_DISPATCH(IsTexture, (texture), (F, "glIsTextureEXT(%d);\n", texture));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetColorTableEXT)(GLenum target, GLenum format, GLenum type, GLvoid * table)
+{
+ DISPATCH(GetColorTable, (target, format, type, table), (F, "glGetColorTableEXT(0x%x, 0x%x, 0x%x, %p);\n", target, format, type, (const void *) table));
+}
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_343)(GLenum target, GLenum format, GLenum type, GLvoid * table);
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_343)(GLenum target, GLenum format, GLenum type, GLvoid * table)
+{
+ DISPATCH(GetColorTable, (target, format, type, table), (F, "glGetColorTableSGI(0x%x, 0x%x, 0x%x, %p);\n", target, format, type, (const void *) table));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetColorTableParameterfvEXT)(GLenum target, GLenum pname, GLfloat * params)
+{
+ DISPATCH(GetColorTableParameterfv, (target, pname, params), (F, "glGetColorTableParameterfvEXT(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
+}
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_344)(GLenum target, GLenum pname, GLfloat * params);
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_344)(GLenum target, GLenum pname, GLfloat * params)
+{
+ DISPATCH(GetColorTableParameterfv, (target, pname, params), (F, "glGetColorTableParameterfvSGI(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(GetColorTableParameterivEXT)(GLenum target, GLenum pname, GLint * params)
+{
+ DISPATCH(GetColorTableParameteriv, (target, pname, params), (F, "glGetColorTableParameterivEXT(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
+}
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_345)(GLenum target, GLenum pname, GLint * params);
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_345)(GLenum target, GLenum pname, GLint * params)
+{
+ DISPATCH(GetColorTableParameteriv, (target, pname, params), (F, "glGetColorTableParameterivSGI(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
+}
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_356)(GLenum target, GLenum format, GLenum type, GLvoid * image);
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_356)(GLenum target, GLenum format, GLenum type, GLvoid * image)
+{
+ DISPATCH(GetConvolutionFilter, (target, format, type, image), (F, "glGetConvolutionFilterEXT(0x%x, 0x%x, 0x%x, %p);\n", target, format, type, (const void *) image));
+}
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_357)(GLenum target, GLenum pname, GLfloat * params);
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_357)(GLenum target, GLenum pname, GLfloat * params)
+{
+ DISPATCH(GetConvolutionParameterfv, (target, pname, params), (F, "glGetConvolutionParameterfvEXT(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
+}
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_358)(GLenum target, GLenum pname, GLint * params);
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_358)(GLenum target, GLenum pname, GLint * params)
+{
+ DISPATCH(GetConvolutionParameteriv, (target, pname, params), (F, "glGetConvolutionParameterivEXT(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
+}
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_359)(GLenum target, GLenum format, GLenum type, GLvoid * row, GLvoid * column, GLvoid * span);
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_359)(GLenum target, GLenum format, GLenum type, GLvoid * row, GLvoid * column, GLvoid * span)
+{
+ DISPATCH(GetSeparableFilter, (target, format, type, row, column, span), (F, "glGetSeparableFilterEXT(0x%x, 0x%x, 0x%x, %p, %p, %p);\n", target, format, type, (const void *) row, (const void *) column, (const void *) span));
+}
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_361)(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid * values);
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_361)(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid * values)
+{
+ DISPATCH(GetHistogram, (target, reset, format, type, values), (F, "glGetHistogramEXT(0x%x, %d, 0x%x, 0x%x, %p);\n", target, reset, format, type, (const void *) values));
+}
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_362)(GLenum target, GLenum pname, GLfloat * params);
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_362)(GLenum target, GLenum pname, GLfloat * params)
+{
+ DISPATCH(GetHistogramParameterfv, (target, pname, params), (F, "glGetHistogramParameterfvEXT(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
+}
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_363)(GLenum target, GLenum pname, GLint * params);
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_363)(GLenum target, GLenum pname, GLint * params)
+{
+ DISPATCH(GetHistogramParameteriv, (target, pname, params), (F, "glGetHistogramParameterivEXT(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
+}
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_364)(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid * values);
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_364)(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid * values)
+{
+ DISPATCH(GetMinmax, (target, reset, format, type, values), (F, "glGetMinmaxEXT(0x%x, %d, 0x%x, 0x%x, %p);\n", target, reset, format, type, (const void *) values));
+}
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_365)(GLenum target, GLenum pname, GLfloat * params);
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_365)(GLenum target, GLenum pname, GLfloat * params)
+{
+ DISPATCH(GetMinmaxParameterfv, (target, pname, params), (F, "glGetMinmaxParameterfvEXT(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
+}
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_366)(GLenum target, GLenum pname, GLint * params);
+
+KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_366)(GLenum target, GLenum pname, GLint * params)
+{
+ DISPATCH(GetMinmaxParameteriv, (target, pname, params), (F, "glGetMinmaxParameterivEXT(0x%x, 0x%x, %p);\n", target, pname, (const void *) params));
+}
+
+
+#endif /* _GLAPI_SKIP_PROTO_ENTRY_POINTS */
+
+
+#endif /* defined( NAME ) */
+
+/*
+ * This is how a dispatch table can be initialized with all the functions
+ * we generated above.
+ */
+#ifdef DISPATCH_TABLE_NAME
+
+#ifndef TABLE_ENTRY
+#error TABLE_ENTRY must be defined
+#endif
+
+#ifdef _GLAPI_SKIP_NORMAL_ENTRY_POINTS
+#error _GLAPI_SKIP_NORMAL_ENTRY_POINTS must not be defined
+#endif
+
+_glapi_proc DISPATCH_TABLE_NAME[] = {
+ TABLE_ENTRY(NewList),
+ TABLE_ENTRY(EndList),
+ TABLE_ENTRY(CallList),
+ TABLE_ENTRY(CallLists),
+ TABLE_ENTRY(DeleteLists),
+ TABLE_ENTRY(GenLists),
+ TABLE_ENTRY(ListBase),
+ TABLE_ENTRY(Begin),
+ TABLE_ENTRY(Bitmap),
+ TABLE_ENTRY(Color3b),
+ TABLE_ENTRY(Color3bv),
+ TABLE_ENTRY(Color3d),
+ TABLE_ENTRY(Color3dv),
+ TABLE_ENTRY(Color3f),
+ TABLE_ENTRY(Color3fv),
+ TABLE_ENTRY(Color3i),
+ TABLE_ENTRY(Color3iv),
+ TABLE_ENTRY(Color3s),
+ TABLE_ENTRY(Color3sv),
+ TABLE_ENTRY(Color3ub),
+ TABLE_ENTRY(Color3ubv),
+ TABLE_ENTRY(Color3ui),
+ TABLE_ENTRY(Color3uiv),
+ TABLE_ENTRY(Color3us),
+ TABLE_ENTRY(Color3usv),
+ TABLE_ENTRY(Color4b),
+ TABLE_ENTRY(Color4bv),
+ TABLE_ENTRY(Color4d),
+ TABLE_ENTRY(Color4dv),
+ TABLE_ENTRY(Color4f),
+ TABLE_ENTRY(Color4fv),
+ TABLE_ENTRY(Color4i),
+ TABLE_ENTRY(Color4iv),
+ TABLE_ENTRY(Color4s),
+ TABLE_ENTRY(Color4sv),
+ TABLE_ENTRY(Color4ub),
+ TABLE_ENTRY(Color4ubv),
+ TABLE_ENTRY(Color4ui),
+ TABLE_ENTRY(Color4uiv),
+ TABLE_ENTRY(Color4us),
+ TABLE_ENTRY(Color4usv),
+ TABLE_ENTRY(EdgeFlag),
+ TABLE_ENTRY(EdgeFlagv),
+ TABLE_ENTRY(End),
+ TABLE_ENTRY(Indexd),
+ TABLE_ENTRY(Indexdv),
+ TABLE_ENTRY(Indexf),
+ TABLE_ENTRY(Indexfv),
+ TABLE_ENTRY(Indexi),
+ TABLE_ENTRY(Indexiv),
+ TABLE_ENTRY(Indexs),
+ TABLE_ENTRY(Indexsv),
+ TABLE_ENTRY(Normal3b),
+ TABLE_ENTRY(Normal3bv),
+ TABLE_ENTRY(Normal3d),
+ TABLE_ENTRY(Normal3dv),
+ TABLE_ENTRY(Normal3f),
+ TABLE_ENTRY(Normal3fv),
+ TABLE_ENTRY(Normal3i),
+ TABLE_ENTRY(Normal3iv),
+ TABLE_ENTRY(Normal3s),
+ TABLE_ENTRY(Normal3sv),
+ TABLE_ENTRY(RasterPos2d),
+ TABLE_ENTRY(RasterPos2dv),
+ TABLE_ENTRY(RasterPos2f),
+ TABLE_ENTRY(RasterPos2fv),
+ TABLE_ENTRY(RasterPos2i),
+ TABLE_ENTRY(RasterPos2iv),
+ TABLE_ENTRY(RasterPos2s),
+ TABLE_ENTRY(RasterPos2sv),
+ TABLE_ENTRY(RasterPos3d),
+ TABLE_ENTRY(RasterPos3dv),
+ TABLE_ENTRY(RasterPos3f),
+ TABLE_ENTRY(RasterPos3fv),
+ TABLE_ENTRY(RasterPos3i),
+ TABLE_ENTRY(RasterPos3iv),
+ TABLE_ENTRY(RasterPos3s),
+ TABLE_ENTRY(RasterPos3sv),
+ TABLE_ENTRY(RasterPos4d),
+ TABLE_ENTRY(RasterPos4dv),
+ TABLE_ENTRY(RasterPos4f),
+ TABLE_ENTRY(RasterPos4fv),
+ TABLE_ENTRY(RasterPos4i),
+ TABLE_ENTRY(RasterPos4iv),
+ TABLE_ENTRY(RasterPos4s),
+ TABLE_ENTRY(RasterPos4sv),
+ TABLE_ENTRY(Rectd),
+ TABLE_ENTRY(Rectdv),
+ TABLE_ENTRY(Rectf),
+ TABLE_ENTRY(Rectfv),
+ TABLE_ENTRY(Recti),
+ TABLE_ENTRY(Rectiv),
+ TABLE_ENTRY(Rects),
+ TABLE_ENTRY(Rectsv),
+ TABLE_ENTRY(TexCoord1d),
+ TABLE_ENTRY(TexCoord1dv),
+ TABLE_ENTRY(TexCoord1f),
+ TABLE_ENTRY(TexCoord1fv),
+ TABLE_ENTRY(TexCoord1i),
+ TABLE_ENTRY(TexCoord1iv),
+ TABLE_ENTRY(TexCoord1s),
+ TABLE_ENTRY(TexCoord1sv),
+ TABLE_ENTRY(TexCoord2d),
+ TABLE_ENTRY(TexCoord2dv),
+ TABLE_ENTRY(TexCoord2f),
+ TABLE_ENTRY(TexCoord2fv),
+ TABLE_ENTRY(TexCoord2i),
+ TABLE_ENTRY(TexCoord2iv),
+ TABLE_ENTRY(TexCoord2s),
+ TABLE_ENTRY(TexCoord2sv),
+ TABLE_ENTRY(TexCoord3d),
+ TABLE_ENTRY(TexCoord3dv),
+ TABLE_ENTRY(TexCoord3f),
+ TABLE_ENTRY(TexCoord3fv),
+ TABLE_ENTRY(TexCoord3i),
+ TABLE_ENTRY(TexCoord3iv),
+ TABLE_ENTRY(TexCoord3s),
+ TABLE_ENTRY(TexCoord3sv),
+ TABLE_ENTRY(TexCoord4d),
+ TABLE_ENTRY(TexCoord4dv),
+ TABLE_ENTRY(TexCoord4f),
+ TABLE_ENTRY(TexCoord4fv),
+ TABLE_ENTRY(TexCoord4i),
+ TABLE_ENTRY(TexCoord4iv),
+ TABLE_ENTRY(TexCoord4s),
+ TABLE_ENTRY(TexCoord4sv),
+ TABLE_ENTRY(Vertex2d),
+ TABLE_ENTRY(Vertex2dv),
+ TABLE_ENTRY(Vertex2f),
+ TABLE_ENTRY(Vertex2fv),
+ TABLE_ENTRY(Vertex2i),
+ TABLE_ENTRY(Vertex2iv),
+ TABLE_ENTRY(Vertex2s),
+ TABLE_ENTRY(Vertex2sv),
+ TABLE_ENTRY(Vertex3d),
+ TABLE_ENTRY(Vertex3dv),
+ TABLE_ENTRY(Vertex3f),
+ TABLE_ENTRY(Vertex3fv),
+ TABLE_ENTRY(Vertex3i),
+ TABLE_ENTRY(Vertex3iv),
+ TABLE_ENTRY(Vertex3s),
+ TABLE_ENTRY(Vertex3sv),
+ TABLE_ENTRY(Vertex4d),
+ TABLE_ENTRY(Vertex4dv),
+ TABLE_ENTRY(Vertex4f),
+ TABLE_ENTRY(Vertex4fv),
+ TABLE_ENTRY(Vertex4i),
+ TABLE_ENTRY(Vertex4iv),
+ TABLE_ENTRY(Vertex4s),
+ TABLE_ENTRY(Vertex4sv),
+ TABLE_ENTRY(ClipPlane),
+ TABLE_ENTRY(ColorMaterial),
+ TABLE_ENTRY(CullFace),
+ TABLE_ENTRY(Fogf),
+ TABLE_ENTRY(Fogfv),
+ TABLE_ENTRY(Fogi),
+ TABLE_ENTRY(Fogiv),
+ TABLE_ENTRY(FrontFace),
+ TABLE_ENTRY(Hint),
+ TABLE_ENTRY(Lightf),
+ TABLE_ENTRY(Lightfv),
+ TABLE_ENTRY(Lighti),
+ TABLE_ENTRY(Lightiv),
+ TABLE_ENTRY(LightModelf),
+ TABLE_ENTRY(LightModelfv),
+ TABLE_ENTRY(LightModeli),
+ TABLE_ENTRY(LightModeliv),
+ TABLE_ENTRY(LineStipple),
+ TABLE_ENTRY(LineWidth),
+ TABLE_ENTRY(Materialf),
+ TABLE_ENTRY(Materialfv),
+ TABLE_ENTRY(Materiali),
+ TABLE_ENTRY(Materialiv),
+ TABLE_ENTRY(PointSize),
+ TABLE_ENTRY(PolygonMode),
+ TABLE_ENTRY(PolygonStipple),
+ TABLE_ENTRY(Scissor),
+ TABLE_ENTRY(ShadeModel),
+ TABLE_ENTRY(TexParameterf),
+ TABLE_ENTRY(TexParameterfv),
+ TABLE_ENTRY(TexParameteri),
+ TABLE_ENTRY(TexParameteriv),
+ TABLE_ENTRY(TexImage1D),
+ TABLE_ENTRY(TexImage2D),
+ TABLE_ENTRY(TexEnvf),
+ TABLE_ENTRY(TexEnvfv),
+ TABLE_ENTRY(TexEnvi),
+ TABLE_ENTRY(TexEnviv),
+ TABLE_ENTRY(TexGend),
+ TABLE_ENTRY(TexGendv),
+ TABLE_ENTRY(TexGenf),
+ TABLE_ENTRY(TexGenfv),
+ TABLE_ENTRY(TexGeni),
+ TABLE_ENTRY(TexGeniv),
+ TABLE_ENTRY(FeedbackBuffer),
+ TABLE_ENTRY(SelectBuffer),
+ TABLE_ENTRY(RenderMode),
+ TABLE_ENTRY(InitNames),
+ TABLE_ENTRY(LoadName),
+ TABLE_ENTRY(PassThrough),
+ TABLE_ENTRY(PopName),
+ TABLE_ENTRY(PushName),
+ TABLE_ENTRY(DrawBuffer),
+ TABLE_ENTRY(Clear),
+ TABLE_ENTRY(ClearAccum),
+ TABLE_ENTRY(ClearIndex),
+ TABLE_ENTRY(ClearColor),
+ TABLE_ENTRY(ClearStencil),
+ TABLE_ENTRY(ClearDepth),
+ TABLE_ENTRY(StencilMask),
+ TABLE_ENTRY(ColorMask),
+ TABLE_ENTRY(DepthMask),
+ TABLE_ENTRY(IndexMask),
+ TABLE_ENTRY(Accum),
+ TABLE_ENTRY(Disable),
+ TABLE_ENTRY(Enable),
+ TABLE_ENTRY(Finish),
+ TABLE_ENTRY(Flush),
+ TABLE_ENTRY(PopAttrib),
+ TABLE_ENTRY(PushAttrib),
+ TABLE_ENTRY(Map1d),
+ TABLE_ENTRY(Map1f),
+ TABLE_ENTRY(Map2d),
+ TABLE_ENTRY(Map2f),
+ TABLE_ENTRY(MapGrid1d),
+ TABLE_ENTRY(MapGrid1f),
+ TABLE_ENTRY(MapGrid2d),
+ TABLE_ENTRY(MapGrid2f),
+ TABLE_ENTRY(EvalCoord1d),
+ TABLE_ENTRY(EvalCoord1dv),
+ TABLE_ENTRY(EvalCoord1f),
+ TABLE_ENTRY(EvalCoord1fv),
+ TABLE_ENTRY(EvalCoord2d),
+ TABLE_ENTRY(EvalCoord2dv),
+ TABLE_ENTRY(EvalCoord2f),
+ TABLE_ENTRY(EvalCoord2fv),
+ TABLE_ENTRY(EvalMesh1),
+ TABLE_ENTRY(EvalPoint1),
+ TABLE_ENTRY(EvalMesh2),
+ TABLE_ENTRY(EvalPoint2),
+ TABLE_ENTRY(AlphaFunc),
+ TABLE_ENTRY(BlendFunc),
+ TABLE_ENTRY(LogicOp),
+ TABLE_ENTRY(StencilFunc),
+ TABLE_ENTRY(StencilOp),
+ TABLE_ENTRY(DepthFunc),
+ TABLE_ENTRY(PixelZoom),
+ TABLE_ENTRY(PixelTransferf),
+ TABLE_ENTRY(PixelTransferi),
+ TABLE_ENTRY(PixelStoref),
+ TABLE_ENTRY(PixelStorei),
+ TABLE_ENTRY(PixelMapfv),
+ TABLE_ENTRY(PixelMapuiv),
+ TABLE_ENTRY(PixelMapusv),
+ TABLE_ENTRY(ReadBuffer),
+ TABLE_ENTRY(CopyPixels),
+ TABLE_ENTRY(ReadPixels),
+ TABLE_ENTRY(DrawPixels),
+ TABLE_ENTRY(GetBooleanv),
+ TABLE_ENTRY(GetClipPlane),
+ TABLE_ENTRY(GetDoublev),
+ TABLE_ENTRY(GetError),
+ TABLE_ENTRY(GetFloatv),
+ TABLE_ENTRY(GetIntegerv),
+ TABLE_ENTRY(GetLightfv),
+ TABLE_ENTRY(GetLightiv),
+ TABLE_ENTRY(GetMapdv),
+ TABLE_ENTRY(GetMapfv),
+ TABLE_ENTRY(GetMapiv),
+ TABLE_ENTRY(GetMaterialfv),
+ TABLE_ENTRY(GetMaterialiv),
+ TABLE_ENTRY(GetPixelMapfv),
+ TABLE_ENTRY(GetPixelMapuiv),
+ TABLE_ENTRY(GetPixelMapusv),
+ TABLE_ENTRY(GetPolygonStipple),
+ TABLE_ENTRY(GetString),
+ TABLE_ENTRY(GetTexEnvfv),
+ TABLE_ENTRY(GetTexEnviv),
+ TABLE_ENTRY(GetTexGendv),
+ TABLE_ENTRY(GetTexGenfv),
+ TABLE_ENTRY(GetTexGeniv),
+ TABLE_ENTRY(GetTexImage),
+ TABLE_ENTRY(GetTexParameterfv),
+ TABLE_ENTRY(GetTexParameteriv),
+ TABLE_ENTRY(GetTexLevelParameterfv),
+ TABLE_ENTRY(GetTexLevelParameteriv),
+ TABLE_ENTRY(IsEnabled),
+ TABLE_ENTRY(IsList),
+ TABLE_ENTRY(DepthRange),
+ TABLE_ENTRY(Frustum),
+ TABLE_ENTRY(LoadIdentity),
+ TABLE_ENTRY(LoadMatrixf),
+ TABLE_ENTRY(LoadMatrixd),
+ TABLE_ENTRY(MatrixMode),
+ TABLE_ENTRY(MultMatrixf),
+ TABLE_ENTRY(MultMatrixd),
+ TABLE_ENTRY(Ortho),
+ TABLE_ENTRY(PopMatrix),
+ TABLE_ENTRY(PushMatrix),
+ TABLE_ENTRY(Rotated),
+ TABLE_ENTRY(Rotatef),
+ TABLE_ENTRY(Scaled),
+ TABLE_ENTRY(Scalef),
+ TABLE_ENTRY(Translated),
+ TABLE_ENTRY(Translatef),
+ TABLE_ENTRY(Viewport),
+ TABLE_ENTRY(ArrayElement),
+ TABLE_ENTRY(BindTexture),
+ TABLE_ENTRY(ColorPointer),
+ TABLE_ENTRY(DisableClientState),
+ TABLE_ENTRY(DrawArrays),
+ TABLE_ENTRY(DrawElements),
+ TABLE_ENTRY(EdgeFlagPointer),
+ TABLE_ENTRY(EnableClientState),
+ TABLE_ENTRY(IndexPointer),
+ TABLE_ENTRY(Indexub),
+ TABLE_ENTRY(Indexubv),
+ TABLE_ENTRY(InterleavedArrays),
+ TABLE_ENTRY(NormalPointer),
+ TABLE_ENTRY(PolygonOffset),
+ TABLE_ENTRY(TexCoordPointer),
+ TABLE_ENTRY(VertexPointer),
+ TABLE_ENTRY(AreTexturesResident),
+ TABLE_ENTRY(CopyTexImage1D),
+ TABLE_ENTRY(CopyTexImage2D),
+ TABLE_ENTRY(CopyTexSubImage1D),
+ TABLE_ENTRY(CopyTexSubImage2D),
+ TABLE_ENTRY(DeleteTextures),
+ TABLE_ENTRY(GenTextures),
+ TABLE_ENTRY(GetPointerv),
+ TABLE_ENTRY(IsTexture),
+ TABLE_ENTRY(PrioritizeTextures),
+ TABLE_ENTRY(TexSubImage1D),
+ TABLE_ENTRY(TexSubImage2D),
+ TABLE_ENTRY(PopClientAttrib),
+ TABLE_ENTRY(PushClientAttrib),
+ TABLE_ENTRY(BlendColor),
+ TABLE_ENTRY(BlendEquation),
+ TABLE_ENTRY(DrawRangeElements),
+ TABLE_ENTRY(ColorTable),
+ TABLE_ENTRY(ColorTableParameterfv),
+ TABLE_ENTRY(ColorTableParameteriv),
+ TABLE_ENTRY(CopyColorTable),
+ TABLE_ENTRY(GetColorTable),
+ TABLE_ENTRY(GetColorTableParameterfv),
+ TABLE_ENTRY(GetColorTableParameteriv),
+ TABLE_ENTRY(ColorSubTable),
+ TABLE_ENTRY(CopyColorSubTable),
+ TABLE_ENTRY(ConvolutionFilter1D),
+ TABLE_ENTRY(ConvolutionFilter2D),
+ TABLE_ENTRY(ConvolutionParameterf),
+ TABLE_ENTRY(ConvolutionParameterfv),
+ TABLE_ENTRY(ConvolutionParameteri),
+ TABLE_ENTRY(ConvolutionParameteriv),
+ TABLE_ENTRY(CopyConvolutionFilter1D),
+ TABLE_ENTRY(CopyConvolutionFilter2D),
+ TABLE_ENTRY(GetConvolutionFilter),
+ TABLE_ENTRY(GetConvolutionParameterfv),
+ TABLE_ENTRY(GetConvolutionParameteriv),
+ TABLE_ENTRY(GetSeparableFilter),
+ TABLE_ENTRY(SeparableFilter2D),
+ TABLE_ENTRY(GetHistogram),
+ TABLE_ENTRY(GetHistogramParameterfv),
+ TABLE_ENTRY(GetHistogramParameteriv),
+ TABLE_ENTRY(GetMinmax),
+ TABLE_ENTRY(GetMinmaxParameterfv),
+ TABLE_ENTRY(GetMinmaxParameteriv),
+ TABLE_ENTRY(Histogram),
+ TABLE_ENTRY(Minmax),
+ TABLE_ENTRY(ResetHistogram),
+ TABLE_ENTRY(ResetMinmax),
+ TABLE_ENTRY(TexImage3D),
+ TABLE_ENTRY(TexSubImage3D),
+ TABLE_ENTRY(CopyTexSubImage3D),
+ TABLE_ENTRY(ActiveTextureARB),
+ TABLE_ENTRY(ClientActiveTextureARB),
+ TABLE_ENTRY(MultiTexCoord1dARB),
+ TABLE_ENTRY(MultiTexCoord1dvARB),
+ TABLE_ENTRY(MultiTexCoord1fARB),
+ TABLE_ENTRY(MultiTexCoord1fvARB),
+ TABLE_ENTRY(MultiTexCoord1iARB),
+ TABLE_ENTRY(MultiTexCoord1ivARB),
+ TABLE_ENTRY(MultiTexCoord1sARB),
+ TABLE_ENTRY(MultiTexCoord1svARB),
+ TABLE_ENTRY(MultiTexCoord2dARB),
+ TABLE_ENTRY(MultiTexCoord2dvARB),
+ TABLE_ENTRY(MultiTexCoord2fARB),
+ TABLE_ENTRY(MultiTexCoord2fvARB),
+ TABLE_ENTRY(MultiTexCoord2iARB),
+ TABLE_ENTRY(MultiTexCoord2ivARB),
+ TABLE_ENTRY(MultiTexCoord2sARB),
+ TABLE_ENTRY(MultiTexCoord2svARB),
+ TABLE_ENTRY(MultiTexCoord3dARB),
+ TABLE_ENTRY(MultiTexCoord3dvARB),
+ TABLE_ENTRY(MultiTexCoord3fARB),
+ TABLE_ENTRY(MultiTexCoord3fvARB),
+ TABLE_ENTRY(MultiTexCoord3iARB),
+ TABLE_ENTRY(MultiTexCoord3ivARB),
+ TABLE_ENTRY(MultiTexCoord3sARB),
+ TABLE_ENTRY(MultiTexCoord3svARB),
+ TABLE_ENTRY(MultiTexCoord4dARB),
+ TABLE_ENTRY(MultiTexCoord4dvARB),
+ TABLE_ENTRY(MultiTexCoord4fARB),
+ TABLE_ENTRY(MultiTexCoord4fvARB),
+ TABLE_ENTRY(MultiTexCoord4iARB),
+ TABLE_ENTRY(MultiTexCoord4ivARB),
+ TABLE_ENTRY(MultiTexCoord4sARB),
+ TABLE_ENTRY(MultiTexCoord4svARB),
+ TABLE_ENTRY(AttachShader),
+ TABLE_ENTRY(CreateProgram),
+ TABLE_ENTRY(CreateShader),
+ TABLE_ENTRY(DeleteProgram),
+ TABLE_ENTRY(DeleteShader),
+ TABLE_ENTRY(DetachShader),
+ TABLE_ENTRY(GetAttachedShaders),
+ TABLE_ENTRY(GetProgramInfoLog),
+ TABLE_ENTRY(GetProgramiv),
+ TABLE_ENTRY(GetShaderInfoLog),
+ TABLE_ENTRY(GetShaderiv),
+ TABLE_ENTRY(IsProgram),
+ TABLE_ENTRY(IsShader),
+ TABLE_ENTRY(StencilFuncSeparate),
+ TABLE_ENTRY(StencilMaskSeparate),
+ TABLE_ENTRY(StencilOpSeparate),
+ TABLE_ENTRY(UniformMatrix2x3fv),
+ TABLE_ENTRY(UniformMatrix2x4fv),
+ TABLE_ENTRY(UniformMatrix3x2fv),
+ TABLE_ENTRY(UniformMatrix3x4fv),
+ TABLE_ENTRY(UniformMatrix4x2fv),
+ TABLE_ENTRY(UniformMatrix4x3fv),
+ TABLE_ENTRY(ClampColor),
+ TABLE_ENTRY(ClearBufferfi),
+ TABLE_ENTRY(ClearBufferfv),
+ TABLE_ENTRY(ClearBufferiv),
+ TABLE_ENTRY(ClearBufferuiv),
+ TABLE_ENTRY(GetStringi),
+ TABLE_ENTRY(TexBuffer),
+ TABLE_ENTRY(FramebufferTexture),
+ TABLE_ENTRY(GetBufferParameteri64v),
+ TABLE_ENTRY(GetInteger64i_v),
+ TABLE_ENTRY(VertexAttribDivisor),
+ TABLE_ENTRY(LoadTransposeMatrixdARB),
+ TABLE_ENTRY(LoadTransposeMatrixfARB),
+ TABLE_ENTRY(MultTransposeMatrixdARB),
+ TABLE_ENTRY(MultTransposeMatrixfARB),
+ TABLE_ENTRY(SampleCoverageARB),
+ TABLE_ENTRY(CompressedTexImage1DARB),
+ TABLE_ENTRY(CompressedTexImage2DARB),
+ TABLE_ENTRY(CompressedTexImage3DARB),
+ TABLE_ENTRY(CompressedTexSubImage1DARB),
+ TABLE_ENTRY(CompressedTexSubImage2DARB),
+ TABLE_ENTRY(CompressedTexSubImage3DARB),
+ TABLE_ENTRY(GetCompressedTexImageARB),
+ TABLE_ENTRY(DisableVertexAttribArrayARB),
+ TABLE_ENTRY(EnableVertexAttribArrayARB),
+ TABLE_ENTRY(GetProgramEnvParameterdvARB),
+ TABLE_ENTRY(GetProgramEnvParameterfvARB),
+ TABLE_ENTRY(GetProgramLocalParameterdvARB),
+ TABLE_ENTRY(GetProgramLocalParameterfvARB),
+ TABLE_ENTRY(GetProgramStringARB),
+ TABLE_ENTRY(GetProgramivARB),
+ TABLE_ENTRY(GetVertexAttribdvARB),
+ TABLE_ENTRY(GetVertexAttribfvARB),
+ TABLE_ENTRY(GetVertexAttribivARB),
+ TABLE_ENTRY(ProgramEnvParameter4dARB),
+ TABLE_ENTRY(ProgramEnvParameter4dvARB),
+ TABLE_ENTRY(ProgramEnvParameter4fARB),
+ TABLE_ENTRY(ProgramEnvParameter4fvARB),
+ TABLE_ENTRY(ProgramLocalParameter4dARB),
+ TABLE_ENTRY(ProgramLocalParameter4dvARB),
+ TABLE_ENTRY(ProgramLocalParameter4fARB),
+ TABLE_ENTRY(ProgramLocalParameter4fvARB),
+ TABLE_ENTRY(ProgramStringARB),
+ TABLE_ENTRY(VertexAttrib1dARB),
+ TABLE_ENTRY(VertexAttrib1dvARB),
+ TABLE_ENTRY(VertexAttrib1fARB),
+ TABLE_ENTRY(VertexAttrib1fvARB),
+ TABLE_ENTRY(VertexAttrib1sARB),
+ TABLE_ENTRY(VertexAttrib1svARB),
+ TABLE_ENTRY(VertexAttrib2dARB),
+ TABLE_ENTRY(VertexAttrib2dvARB),
+ TABLE_ENTRY(VertexAttrib2fARB),
+ TABLE_ENTRY(VertexAttrib2fvARB),
+ TABLE_ENTRY(VertexAttrib2sARB),
+ TABLE_ENTRY(VertexAttrib2svARB),
+ TABLE_ENTRY(VertexAttrib3dARB),
+ TABLE_ENTRY(VertexAttrib3dvARB),
+ TABLE_ENTRY(VertexAttrib3fARB),
+ TABLE_ENTRY(VertexAttrib3fvARB),
+ TABLE_ENTRY(VertexAttrib3sARB),
+ TABLE_ENTRY(VertexAttrib3svARB),
+ TABLE_ENTRY(VertexAttrib4NbvARB),
+ TABLE_ENTRY(VertexAttrib4NivARB),
+ TABLE_ENTRY(VertexAttrib4NsvARB),
+ TABLE_ENTRY(VertexAttrib4NubARB),
+ TABLE_ENTRY(VertexAttrib4NubvARB),
+ TABLE_ENTRY(VertexAttrib4NuivARB),
+ TABLE_ENTRY(VertexAttrib4NusvARB),
+ TABLE_ENTRY(VertexAttrib4bvARB),
+ TABLE_ENTRY(VertexAttrib4dARB),
+ TABLE_ENTRY(VertexAttrib4dvARB),
+ TABLE_ENTRY(VertexAttrib4fARB),
+ TABLE_ENTRY(VertexAttrib4fvARB),
+ TABLE_ENTRY(VertexAttrib4ivARB),
+ TABLE_ENTRY(VertexAttrib4sARB),
+ TABLE_ENTRY(VertexAttrib4svARB),
+ TABLE_ENTRY(VertexAttrib4ubvARB),
+ TABLE_ENTRY(VertexAttrib4uivARB),
+ TABLE_ENTRY(VertexAttrib4usvARB),
+ TABLE_ENTRY(VertexAttribPointerARB),
+ TABLE_ENTRY(BindBufferARB),
+ TABLE_ENTRY(BufferDataARB),
+ TABLE_ENTRY(BufferSubDataARB),
+ TABLE_ENTRY(DeleteBuffersARB),
+ TABLE_ENTRY(GenBuffersARB),
+ TABLE_ENTRY(GetBufferParameterivARB),
+ TABLE_ENTRY(GetBufferPointervARB),
+ TABLE_ENTRY(GetBufferSubDataARB),
+ TABLE_ENTRY(IsBufferARB),
+ TABLE_ENTRY(MapBufferARB),
+ TABLE_ENTRY(UnmapBufferARB),
+ TABLE_ENTRY(BeginQueryARB),
+ TABLE_ENTRY(DeleteQueriesARB),
+ TABLE_ENTRY(EndQueryARB),
+ TABLE_ENTRY(GenQueriesARB),
+ TABLE_ENTRY(GetQueryObjectivARB),
+ TABLE_ENTRY(GetQueryObjectuivARB),
+ TABLE_ENTRY(GetQueryivARB),
+ TABLE_ENTRY(IsQueryARB),
+ TABLE_ENTRY(AttachObjectARB),
+ TABLE_ENTRY(CompileShaderARB),
+ TABLE_ENTRY(CreateProgramObjectARB),
+ TABLE_ENTRY(CreateShaderObjectARB),
+ TABLE_ENTRY(DeleteObjectARB),
+ TABLE_ENTRY(DetachObjectARB),
+ TABLE_ENTRY(GetActiveUniformARB),
+ TABLE_ENTRY(GetAttachedObjectsARB),
+ TABLE_ENTRY(GetHandleARB),
+ TABLE_ENTRY(GetInfoLogARB),
+ TABLE_ENTRY(GetObjectParameterfvARB),
+ TABLE_ENTRY(GetObjectParameterivARB),
+ TABLE_ENTRY(GetShaderSourceARB),
+ TABLE_ENTRY(GetUniformLocationARB),
+ TABLE_ENTRY(GetUniformfvARB),
+ TABLE_ENTRY(GetUniformivARB),
+ TABLE_ENTRY(LinkProgramARB),
+ TABLE_ENTRY(ShaderSourceARB),
+ TABLE_ENTRY(Uniform1fARB),
+ TABLE_ENTRY(Uniform1fvARB),
+ TABLE_ENTRY(Uniform1iARB),
+ TABLE_ENTRY(Uniform1ivARB),
+ TABLE_ENTRY(Uniform2fARB),
+ TABLE_ENTRY(Uniform2fvARB),
+ TABLE_ENTRY(Uniform2iARB),
+ TABLE_ENTRY(Uniform2ivARB),
+ TABLE_ENTRY(Uniform3fARB),
+ TABLE_ENTRY(Uniform3fvARB),
+ TABLE_ENTRY(Uniform3iARB),
+ TABLE_ENTRY(Uniform3ivARB),
+ TABLE_ENTRY(Uniform4fARB),
+ TABLE_ENTRY(Uniform4fvARB),
+ TABLE_ENTRY(Uniform4iARB),
+ TABLE_ENTRY(Uniform4ivARB),
+ TABLE_ENTRY(UniformMatrix2fvARB),
+ TABLE_ENTRY(UniformMatrix3fvARB),
+ TABLE_ENTRY(UniformMatrix4fvARB),
+ TABLE_ENTRY(UseProgramObjectARB),
+ TABLE_ENTRY(ValidateProgramARB),
+ TABLE_ENTRY(BindAttribLocationARB),
+ TABLE_ENTRY(GetActiveAttribARB),
+ TABLE_ENTRY(GetAttribLocationARB),
+ TABLE_ENTRY(DrawBuffersARB),
+ TABLE_ENTRY(ClampColorARB),
+ TABLE_ENTRY(DrawArraysInstancedARB),
+ TABLE_ENTRY(DrawElementsInstancedARB),
+ TABLE_ENTRY(RenderbufferStorageMultisample),
+ TABLE_ENTRY(FramebufferTextureARB),
+ TABLE_ENTRY(FramebufferTextureFaceARB),
+ TABLE_ENTRY(ProgramParameteriARB),
+ TABLE_ENTRY(VertexAttribDivisorARB),
+ TABLE_ENTRY(FlushMappedBufferRange),
+ TABLE_ENTRY(MapBufferRange),
+ TABLE_ENTRY(TexBufferARB),
+ TABLE_ENTRY(BindVertexArray),
+ TABLE_ENTRY(GenVertexArrays),
+ TABLE_ENTRY(CopyBufferSubData),
+ TABLE_ENTRY(ClientWaitSync),
+ TABLE_ENTRY(DeleteSync),
+ TABLE_ENTRY(FenceSync),
+ TABLE_ENTRY(GetInteger64v),
+ TABLE_ENTRY(GetSynciv),
+ TABLE_ENTRY(IsSync),
+ TABLE_ENTRY(WaitSync),
+ TABLE_ENTRY(DrawElementsBaseVertex),
+ TABLE_ENTRY(DrawRangeElementsBaseVertex),
+ TABLE_ENTRY(MultiDrawElementsBaseVertex),
+ TABLE_ENTRY(BlendEquationSeparateiARB),
+ TABLE_ENTRY(BlendEquationiARB),
+ TABLE_ENTRY(BlendFuncSeparateiARB),
+ TABLE_ENTRY(BlendFunciARB),
+ TABLE_ENTRY(BindSampler),
+ TABLE_ENTRY(DeleteSamplers),
+ TABLE_ENTRY(GenSamplers),
+ TABLE_ENTRY(GetSamplerParameterIiv),
+ TABLE_ENTRY(GetSamplerParameterIuiv),
+ TABLE_ENTRY(GetSamplerParameterfv),
+ TABLE_ENTRY(GetSamplerParameteriv),
+ TABLE_ENTRY(IsSampler),
+ TABLE_ENTRY(SamplerParameterIiv),
+ TABLE_ENTRY(SamplerParameterIuiv),
+ TABLE_ENTRY(SamplerParameterf),
+ TABLE_ENTRY(SamplerParameterfv),
+ TABLE_ENTRY(SamplerParameteri),
+ TABLE_ENTRY(SamplerParameteriv),
+ TABLE_ENTRY(BindTransformFeedback),
+ TABLE_ENTRY(DeleteTransformFeedbacks),
+ TABLE_ENTRY(DrawTransformFeedback),
+ TABLE_ENTRY(GenTransformFeedbacks),
+ TABLE_ENTRY(IsTransformFeedback),
+ TABLE_ENTRY(PauseTransformFeedback),
+ TABLE_ENTRY(ResumeTransformFeedback),
+ TABLE_ENTRY(ClearDepthf),
+ TABLE_ENTRY(DepthRangef),
+ TABLE_ENTRY(GetShaderPrecisionFormat),
+ TABLE_ENTRY(ReleaseShaderCompiler),
+ TABLE_ENTRY(ShaderBinary),
+ TABLE_ENTRY(GetGraphicsResetStatusARB),
+ TABLE_ENTRY(GetnColorTableARB),
+ TABLE_ENTRY(GetnCompressedTexImageARB),
+ TABLE_ENTRY(GetnConvolutionFilterARB),
+ TABLE_ENTRY(GetnHistogramARB),
+ TABLE_ENTRY(GetnMapdvARB),
+ TABLE_ENTRY(GetnMapfvARB),
+ TABLE_ENTRY(GetnMapivARB),
+ TABLE_ENTRY(GetnMinmaxARB),
+ TABLE_ENTRY(GetnPixelMapfvARB),
+ TABLE_ENTRY(GetnPixelMapuivARB),
+ TABLE_ENTRY(GetnPixelMapusvARB),
+ TABLE_ENTRY(GetnPolygonStippleARB),
+ TABLE_ENTRY(GetnSeparableFilterARB),
+ TABLE_ENTRY(GetnTexImageARB),
+ TABLE_ENTRY(GetnUniformdvARB),
+ TABLE_ENTRY(GetnUniformfvARB),
+ TABLE_ENTRY(GetnUniformivARB),
+ TABLE_ENTRY(GetnUniformuivARB),
+ TABLE_ENTRY(ReadnPixelsARB),
+ TABLE_ENTRY(PolygonOffsetEXT),
+ TABLE_ENTRY(_dispatch_stub_647),
+ TABLE_ENTRY(_dispatch_stub_648),
+ TABLE_ENTRY(_dispatch_stub_649),
+ TABLE_ENTRY(_dispatch_stub_650),
+ TABLE_ENTRY(_dispatch_stub_651),
+ TABLE_ENTRY(_dispatch_stub_652),
+ TABLE_ENTRY(_dispatch_stub_653),
+ TABLE_ENTRY(_dispatch_stub_654),
+ TABLE_ENTRY(ColorPointerEXT),
+ TABLE_ENTRY(EdgeFlagPointerEXT),
+ TABLE_ENTRY(IndexPointerEXT),
+ TABLE_ENTRY(NormalPointerEXT),
+ TABLE_ENTRY(TexCoordPointerEXT),
+ TABLE_ENTRY(VertexPointerEXT),
+ TABLE_ENTRY(PointParameterfEXT),
+ TABLE_ENTRY(PointParameterfvEXT),
+ TABLE_ENTRY(LockArraysEXT),
+ TABLE_ENTRY(UnlockArraysEXT),
+ TABLE_ENTRY(SecondaryColor3bEXT),
+ TABLE_ENTRY(SecondaryColor3bvEXT),
+ TABLE_ENTRY(SecondaryColor3dEXT),
+ TABLE_ENTRY(SecondaryColor3dvEXT),
+ TABLE_ENTRY(SecondaryColor3fEXT),
+ TABLE_ENTRY(SecondaryColor3fvEXT),
+ TABLE_ENTRY(SecondaryColor3iEXT),
+ TABLE_ENTRY(SecondaryColor3ivEXT),
+ TABLE_ENTRY(SecondaryColor3sEXT),
+ TABLE_ENTRY(SecondaryColor3svEXT),
+ TABLE_ENTRY(SecondaryColor3ubEXT),
+ TABLE_ENTRY(SecondaryColor3ubvEXT),
+ TABLE_ENTRY(SecondaryColor3uiEXT),
+ TABLE_ENTRY(SecondaryColor3uivEXT),
+ TABLE_ENTRY(SecondaryColor3usEXT),
+ TABLE_ENTRY(SecondaryColor3usvEXT),
+ TABLE_ENTRY(SecondaryColorPointerEXT),
+ TABLE_ENTRY(MultiDrawArraysEXT),
+ TABLE_ENTRY(MultiDrawElementsEXT),
+ TABLE_ENTRY(FogCoordPointerEXT),
+ TABLE_ENTRY(FogCoorddEXT),
+ TABLE_ENTRY(FogCoorddvEXT),
+ TABLE_ENTRY(FogCoordfEXT),
+ TABLE_ENTRY(FogCoordfvEXT),
+ TABLE_ENTRY(_dispatch_stub_689),
+ TABLE_ENTRY(BlendFuncSeparateEXT),
+ TABLE_ENTRY(FlushVertexArrayRangeNV),
+ TABLE_ENTRY(VertexArrayRangeNV),
+ TABLE_ENTRY(CombinerInputNV),
+ TABLE_ENTRY(CombinerOutputNV),
+ TABLE_ENTRY(CombinerParameterfNV),
+ TABLE_ENTRY(CombinerParameterfvNV),
+ TABLE_ENTRY(CombinerParameteriNV),
+ TABLE_ENTRY(CombinerParameterivNV),
+ TABLE_ENTRY(FinalCombinerInputNV),
+ TABLE_ENTRY(GetCombinerInputParameterfvNV),
+ TABLE_ENTRY(GetCombinerInputParameterivNV),
+ TABLE_ENTRY(GetCombinerOutputParameterfvNV),
+ TABLE_ENTRY(GetCombinerOutputParameterivNV),
+ TABLE_ENTRY(GetFinalCombinerInputParameterfvNV),
+ TABLE_ENTRY(GetFinalCombinerInputParameterivNV),
+ TABLE_ENTRY(ResizeBuffersMESA),
+ TABLE_ENTRY(WindowPos2dMESA),
+ TABLE_ENTRY(WindowPos2dvMESA),
+ TABLE_ENTRY(WindowPos2fMESA),
+ TABLE_ENTRY(WindowPos2fvMESA),
+ TABLE_ENTRY(WindowPos2iMESA),
+ TABLE_ENTRY(WindowPos2ivMESA),
+ TABLE_ENTRY(WindowPos2sMESA),
+ TABLE_ENTRY(WindowPos2svMESA),
+ TABLE_ENTRY(WindowPos3dMESA),
+ TABLE_ENTRY(WindowPos3dvMESA),
+ TABLE_ENTRY(WindowPos3fMESA),
+ TABLE_ENTRY(WindowPos3fvMESA),
+ TABLE_ENTRY(WindowPos3iMESA),
+ TABLE_ENTRY(WindowPos3ivMESA),
+ TABLE_ENTRY(WindowPos3sMESA),
+ TABLE_ENTRY(WindowPos3svMESA),
+ TABLE_ENTRY(WindowPos4dMESA),
+ TABLE_ENTRY(WindowPos4dvMESA),
+ TABLE_ENTRY(WindowPos4fMESA),
+ TABLE_ENTRY(WindowPos4fvMESA),
+ TABLE_ENTRY(WindowPos4iMESA),
+ TABLE_ENTRY(WindowPos4ivMESA),
+ TABLE_ENTRY(WindowPos4sMESA),
+ TABLE_ENTRY(WindowPos4svMESA),
+ TABLE_ENTRY(_dispatch_stub_731),
+ TABLE_ENTRY(_dispatch_stub_732),
+ TABLE_ENTRY(_dispatch_stub_733),
+ TABLE_ENTRY(_dispatch_stub_734),
+ TABLE_ENTRY(_dispatch_stub_735),
+ TABLE_ENTRY(_dispatch_stub_736),
+ TABLE_ENTRY(_dispatch_stub_737),
+ TABLE_ENTRY(_dispatch_stub_738),
+ TABLE_ENTRY(_dispatch_stub_739),
+ TABLE_ENTRY(AreProgramsResidentNV),
+ TABLE_ENTRY(BindProgramNV),
+ TABLE_ENTRY(DeleteProgramsNV),
+ TABLE_ENTRY(ExecuteProgramNV),
+ TABLE_ENTRY(GenProgramsNV),
+ TABLE_ENTRY(GetProgramParameterdvNV),
+ TABLE_ENTRY(GetProgramParameterfvNV),
+ TABLE_ENTRY(GetProgramStringNV),
+ TABLE_ENTRY(GetProgramivNV),
+ TABLE_ENTRY(GetTrackMatrixivNV),
+ TABLE_ENTRY(GetVertexAttribPointervNV),
+ TABLE_ENTRY(GetVertexAttribdvNV),
+ TABLE_ENTRY(GetVertexAttribfvNV),
+ TABLE_ENTRY(GetVertexAttribivNV),
+ TABLE_ENTRY(IsProgramNV),
+ TABLE_ENTRY(LoadProgramNV),
+ TABLE_ENTRY(ProgramParameters4dvNV),
+ TABLE_ENTRY(ProgramParameters4fvNV),
+ TABLE_ENTRY(RequestResidentProgramsNV),
+ TABLE_ENTRY(TrackMatrixNV),
+ TABLE_ENTRY(VertexAttrib1dNV),
+ TABLE_ENTRY(VertexAttrib1dvNV),
+ TABLE_ENTRY(VertexAttrib1fNV),
+ TABLE_ENTRY(VertexAttrib1fvNV),
+ TABLE_ENTRY(VertexAttrib1sNV),
+ TABLE_ENTRY(VertexAttrib1svNV),
+ TABLE_ENTRY(VertexAttrib2dNV),
+ TABLE_ENTRY(VertexAttrib2dvNV),
+ TABLE_ENTRY(VertexAttrib2fNV),
+ TABLE_ENTRY(VertexAttrib2fvNV),
+ TABLE_ENTRY(VertexAttrib2sNV),
+ TABLE_ENTRY(VertexAttrib2svNV),
+ TABLE_ENTRY(VertexAttrib3dNV),
+ TABLE_ENTRY(VertexAttrib3dvNV),
+ TABLE_ENTRY(VertexAttrib3fNV),
+ TABLE_ENTRY(VertexAttrib3fvNV),
+ TABLE_ENTRY(VertexAttrib3sNV),
+ TABLE_ENTRY(VertexAttrib3svNV),
+ TABLE_ENTRY(VertexAttrib4dNV),
+ TABLE_ENTRY(VertexAttrib4dvNV),
+ TABLE_ENTRY(VertexAttrib4fNV),
+ TABLE_ENTRY(VertexAttrib4fvNV),
+ TABLE_ENTRY(VertexAttrib4sNV),
+ TABLE_ENTRY(VertexAttrib4svNV),
+ TABLE_ENTRY(VertexAttrib4ubNV),
+ TABLE_ENTRY(VertexAttrib4ubvNV),
+ TABLE_ENTRY(VertexAttribPointerNV),
+ TABLE_ENTRY(VertexAttribs1dvNV),
+ TABLE_ENTRY(VertexAttribs1fvNV),
+ TABLE_ENTRY(VertexAttribs1svNV),
+ TABLE_ENTRY(VertexAttribs2dvNV),
+ TABLE_ENTRY(VertexAttribs2fvNV),
+ TABLE_ENTRY(VertexAttribs2svNV),
+ TABLE_ENTRY(VertexAttribs3dvNV),
+ TABLE_ENTRY(VertexAttribs3fvNV),
+ TABLE_ENTRY(VertexAttribs3svNV),
+ TABLE_ENTRY(VertexAttribs4dvNV),
+ TABLE_ENTRY(VertexAttribs4fvNV),
+ TABLE_ENTRY(VertexAttribs4svNV),
+ TABLE_ENTRY(VertexAttribs4ubvNV),
+ TABLE_ENTRY(GetTexBumpParameterfvATI),
+ TABLE_ENTRY(GetTexBumpParameterivATI),
+ TABLE_ENTRY(TexBumpParameterfvATI),
+ TABLE_ENTRY(TexBumpParameterivATI),
+ TABLE_ENTRY(AlphaFragmentOp1ATI),
+ TABLE_ENTRY(AlphaFragmentOp2ATI),
+ TABLE_ENTRY(AlphaFragmentOp3ATI),
+ TABLE_ENTRY(BeginFragmentShaderATI),
+ TABLE_ENTRY(BindFragmentShaderATI),
+ TABLE_ENTRY(ColorFragmentOp1ATI),
+ TABLE_ENTRY(ColorFragmentOp2ATI),
+ TABLE_ENTRY(ColorFragmentOp3ATI),
+ TABLE_ENTRY(DeleteFragmentShaderATI),
+ TABLE_ENTRY(EndFragmentShaderATI),
+ TABLE_ENTRY(GenFragmentShadersATI),
+ TABLE_ENTRY(PassTexCoordATI),
+ TABLE_ENTRY(SampleMapATI),
+ TABLE_ENTRY(SetFragmentShaderConstantATI),
+ TABLE_ENTRY(PointParameteriNV),
+ TABLE_ENTRY(PointParameterivNV),
+ TABLE_ENTRY(_dispatch_stub_820),
+ TABLE_ENTRY(_dispatch_stub_821),
+ TABLE_ENTRY(_dispatch_stub_822),
+ TABLE_ENTRY(_dispatch_stub_823),
+ TABLE_ENTRY(_dispatch_stub_824),
+ TABLE_ENTRY(GetProgramNamedParameterdvNV),
+ TABLE_ENTRY(GetProgramNamedParameterfvNV),
+ TABLE_ENTRY(ProgramNamedParameter4dNV),
+ TABLE_ENTRY(ProgramNamedParameter4dvNV),
+ TABLE_ENTRY(ProgramNamedParameter4fNV),
+ TABLE_ENTRY(ProgramNamedParameter4fvNV),
+ TABLE_ENTRY(PrimitiveRestartIndexNV),
+ TABLE_ENTRY(PrimitiveRestartNV),
+ TABLE_ENTRY(_dispatch_stub_833),
+ TABLE_ENTRY(_dispatch_stub_834),
+ TABLE_ENTRY(BindFramebufferEXT),
+ TABLE_ENTRY(BindRenderbufferEXT),
+ TABLE_ENTRY(CheckFramebufferStatusEXT),
+ TABLE_ENTRY(DeleteFramebuffersEXT),
+ TABLE_ENTRY(DeleteRenderbuffersEXT),
+ TABLE_ENTRY(FramebufferRenderbufferEXT),
+ TABLE_ENTRY(FramebufferTexture1DEXT),
+ TABLE_ENTRY(FramebufferTexture2DEXT),
+ TABLE_ENTRY(FramebufferTexture3DEXT),
+ TABLE_ENTRY(GenFramebuffersEXT),
+ TABLE_ENTRY(GenRenderbuffersEXT),
+ TABLE_ENTRY(GenerateMipmapEXT),
+ TABLE_ENTRY(GetFramebufferAttachmentParameterivEXT),
+ TABLE_ENTRY(GetRenderbufferParameterivEXT),
+ TABLE_ENTRY(IsFramebufferEXT),
+ TABLE_ENTRY(IsRenderbufferEXT),
+ TABLE_ENTRY(RenderbufferStorageEXT),
+ TABLE_ENTRY(_dispatch_stub_852),
+ TABLE_ENTRY(_dispatch_stub_853),
+ TABLE_ENTRY(_dispatch_stub_854),
+ TABLE_ENTRY(BindFragDataLocationEXT),
+ TABLE_ENTRY(GetFragDataLocationEXT),
+ TABLE_ENTRY(GetUniformuivEXT),
+ TABLE_ENTRY(GetVertexAttribIivEXT),
+ TABLE_ENTRY(GetVertexAttribIuivEXT),
+ TABLE_ENTRY(Uniform1uiEXT),
+ TABLE_ENTRY(Uniform1uivEXT),
+ TABLE_ENTRY(Uniform2uiEXT),
+ TABLE_ENTRY(Uniform2uivEXT),
+ TABLE_ENTRY(Uniform3uiEXT),
+ TABLE_ENTRY(Uniform3uivEXT),
+ TABLE_ENTRY(Uniform4uiEXT),
+ TABLE_ENTRY(Uniform4uivEXT),
+ TABLE_ENTRY(VertexAttribI1iEXT),
+ TABLE_ENTRY(VertexAttribI1ivEXT),
+ TABLE_ENTRY(VertexAttribI1uiEXT),
+ TABLE_ENTRY(VertexAttribI1uivEXT),
+ TABLE_ENTRY(VertexAttribI2iEXT),
+ TABLE_ENTRY(VertexAttribI2ivEXT),
+ TABLE_ENTRY(VertexAttribI2uiEXT),
+ TABLE_ENTRY(VertexAttribI2uivEXT),
+ TABLE_ENTRY(VertexAttribI3iEXT),
+ TABLE_ENTRY(VertexAttribI3ivEXT),
+ TABLE_ENTRY(VertexAttribI3uiEXT),
+ TABLE_ENTRY(VertexAttribI3uivEXT),
+ TABLE_ENTRY(VertexAttribI4bvEXT),
+ TABLE_ENTRY(VertexAttribI4iEXT),
+ TABLE_ENTRY(VertexAttribI4ivEXT),
+ TABLE_ENTRY(VertexAttribI4svEXT),
+ TABLE_ENTRY(VertexAttribI4ubvEXT),
+ TABLE_ENTRY(VertexAttribI4uiEXT),
+ TABLE_ENTRY(VertexAttribI4uivEXT),
+ TABLE_ENTRY(VertexAttribI4usvEXT),
+ TABLE_ENTRY(VertexAttribIPointerEXT),
+ TABLE_ENTRY(FramebufferTextureLayerEXT),
+ TABLE_ENTRY(ColorMaskIndexedEXT),
+ TABLE_ENTRY(DisableIndexedEXT),
+ TABLE_ENTRY(EnableIndexedEXT),
+ TABLE_ENTRY(GetBooleanIndexedvEXT),
+ TABLE_ENTRY(GetIntegerIndexedvEXT),
+ TABLE_ENTRY(IsEnabledIndexedEXT),
+ TABLE_ENTRY(ClearColorIiEXT),
+ TABLE_ENTRY(ClearColorIuiEXT),
+ TABLE_ENTRY(GetTexParameterIivEXT),
+ TABLE_ENTRY(GetTexParameterIuivEXT),
+ TABLE_ENTRY(TexParameterIivEXT),
+ TABLE_ENTRY(TexParameterIuivEXT),
+ TABLE_ENTRY(BeginConditionalRenderNV),
+ TABLE_ENTRY(EndConditionalRenderNV),
+ TABLE_ENTRY(BeginTransformFeedbackEXT),
+ TABLE_ENTRY(BindBufferBaseEXT),
+ TABLE_ENTRY(BindBufferOffsetEXT),
+ TABLE_ENTRY(BindBufferRangeEXT),
+ TABLE_ENTRY(EndTransformFeedbackEXT),
+ TABLE_ENTRY(GetTransformFeedbackVaryingEXT),
+ TABLE_ENTRY(TransformFeedbackVaryingsEXT),
+ TABLE_ENTRY(ProvokingVertexEXT),
+ TABLE_ENTRY(_dispatch_stub_912),
+ TABLE_ENTRY(_dispatch_stub_913),
+ TABLE_ENTRY(GetObjectParameterivAPPLE),
+ TABLE_ENTRY(ObjectPurgeableAPPLE),
+ TABLE_ENTRY(ObjectUnpurgeableAPPLE),
+ TABLE_ENTRY(ActiveProgramEXT),
+ TABLE_ENTRY(CreateShaderProgramEXT),
+ TABLE_ENTRY(UseShaderProgramEXT),
+ TABLE_ENTRY(TextureBarrierNV),
+ TABLE_ENTRY(_dispatch_stub_921),
+ TABLE_ENTRY(_dispatch_stub_922),
+ TABLE_ENTRY(_dispatch_stub_923),
+ TABLE_ENTRY(_dispatch_stub_924),
+ TABLE_ENTRY(_dispatch_stub_925),
+ TABLE_ENTRY(EGLImageTargetRenderbufferStorageOES),
+ TABLE_ENTRY(EGLImageTargetTexture2DOES),
+ /* A whole bunch of no-op functions. These might be called
+ * when someone tries to call a dynamically-registered
+ * extension function without a current rendering context.
+ */
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+ TABLE_ENTRY(Unused),
+};
+#endif /* DISPATCH_TABLE_NAME */
+
+
+/*
+ * This is just used to silence compiler warnings.
+ * We list the functions which are not otherwise used.
+ */
+#ifdef UNUSED_TABLE_NAME
+_glapi_proc UNUSED_TABLE_NAME[] = {
+#ifndef _GLAPI_SKIP_NORMAL_ENTRY_POINTS
+ TABLE_ENTRY(ArrayElementEXT),
+ TABLE_ENTRY(BindTextureEXT),
+ TABLE_ENTRY(DrawArraysEXT),
+ TABLE_ENTRY(CopyTexImage1DEXT),
+ TABLE_ENTRY(CopyTexImage2DEXT),
+ TABLE_ENTRY(CopyTexSubImage1DEXT),
+ TABLE_ENTRY(CopyTexSubImage2DEXT),
+ TABLE_ENTRY(GetPointervEXT),
+ TABLE_ENTRY(PrioritizeTexturesEXT),
+ TABLE_ENTRY(TexSubImage1DEXT),
+ TABLE_ENTRY(TexSubImage2DEXT),
+ TABLE_ENTRY(BlendColorEXT),
+ TABLE_ENTRY(BlendEquationEXT),
+ TABLE_ENTRY(DrawRangeElementsEXT),
+ TABLE_ENTRY(ColorTableEXT),
+ TABLE_ENTRY(_dispatch_stub_339),
+ TABLE_ENTRY(_dispatch_stub_340),
+ TABLE_ENTRY(_dispatch_stub_341),
+ TABLE_ENTRY(_dispatch_stub_342),
+ TABLE_ENTRY(_dispatch_stub_346),
+ TABLE_ENTRY(_dispatch_stub_347),
+ TABLE_ENTRY(_dispatch_stub_348),
+ TABLE_ENTRY(_dispatch_stub_349),
+ TABLE_ENTRY(_dispatch_stub_350),
+ TABLE_ENTRY(_dispatch_stub_351),
+ TABLE_ENTRY(_dispatch_stub_352),
+ TABLE_ENTRY(_dispatch_stub_353),
+ TABLE_ENTRY(_dispatch_stub_354),
+ TABLE_ENTRY(_dispatch_stub_355),
+ TABLE_ENTRY(_dispatch_stub_360),
+ TABLE_ENTRY(_dispatch_stub_367),
+ TABLE_ENTRY(_dispatch_stub_368),
+ TABLE_ENTRY(_dispatch_stub_369),
+ TABLE_ENTRY(_dispatch_stub_370),
+ TABLE_ENTRY(TexImage3DEXT),
+ TABLE_ENTRY(TexSubImage3DEXT),
+ TABLE_ENTRY(CopyTexSubImage3DEXT),
+ TABLE_ENTRY(ActiveTexture),
+ TABLE_ENTRY(ClientActiveTexture),
+ TABLE_ENTRY(MultiTexCoord1d),
+ TABLE_ENTRY(MultiTexCoord1dv),
+ TABLE_ENTRY(MultiTexCoord1f),
+ TABLE_ENTRY(MultiTexCoord1fv),
+ TABLE_ENTRY(MultiTexCoord1i),
+ TABLE_ENTRY(MultiTexCoord1iv),
+ TABLE_ENTRY(MultiTexCoord1s),
+ TABLE_ENTRY(MultiTexCoord1sv),
+ TABLE_ENTRY(MultiTexCoord2d),
+ TABLE_ENTRY(MultiTexCoord2dv),
+ TABLE_ENTRY(MultiTexCoord2f),
+ TABLE_ENTRY(MultiTexCoord2fv),
+ TABLE_ENTRY(MultiTexCoord2i),
+ TABLE_ENTRY(MultiTexCoord2iv),
+ TABLE_ENTRY(MultiTexCoord2s),
+ TABLE_ENTRY(MultiTexCoord2sv),
+ TABLE_ENTRY(MultiTexCoord3d),
+ TABLE_ENTRY(MultiTexCoord3dv),
+ TABLE_ENTRY(MultiTexCoord3f),
+ TABLE_ENTRY(MultiTexCoord3fv),
+ TABLE_ENTRY(MultiTexCoord3i),
+ TABLE_ENTRY(MultiTexCoord3iv),
+ TABLE_ENTRY(MultiTexCoord3s),
+ TABLE_ENTRY(MultiTexCoord3sv),
+ TABLE_ENTRY(MultiTexCoord4d),
+ TABLE_ENTRY(MultiTexCoord4dv),
+ TABLE_ENTRY(MultiTexCoord4f),
+ TABLE_ENTRY(MultiTexCoord4fv),
+ TABLE_ENTRY(MultiTexCoord4i),
+ TABLE_ENTRY(MultiTexCoord4iv),
+ TABLE_ENTRY(MultiTexCoord4s),
+ TABLE_ENTRY(MultiTexCoord4sv),
+ TABLE_ENTRY(_dispatch_stub_423),
+ TABLE_ENTRY(LoadTransposeMatrixd),
+ TABLE_ENTRY(LoadTransposeMatrixf),
+ TABLE_ENTRY(MultTransposeMatrixd),
+ TABLE_ENTRY(MultTransposeMatrixf),
+ TABLE_ENTRY(SampleCoverage),
+ TABLE_ENTRY(CompressedTexImage1D),
+ TABLE_ENTRY(CompressedTexImage2D),
+ TABLE_ENTRY(CompressedTexImage3D),
+ TABLE_ENTRY(CompressedTexSubImage1D),
+ TABLE_ENTRY(CompressedTexSubImage2D),
+ TABLE_ENTRY(CompressedTexSubImage3D),
+ TABLE_ENTRY(GetCompressedTexImage),
+ TABLE_ENTRY(DisableVertexAttribArray),
+ TABLE_ENTRY(EnableVertexAttribArray),
+ TABLE_ENTRY(GetVertexAttribdv),
+ TABLE_ENTRY(GetVertexAttribfv),
+ TABLE_ENTRY(GetVertexAttribiv),
+ TABLE_ENTRY(ProgramParameter4dNV),
+ TABLE_ENTRY(ProgramParameter4dvNV),
+ TABLE_ENTRY(ProgramParameter4fNV),
+ TABLE_ENTRY(ProgramParameter4fvNV),
+ TABLE_ENTRY(VertexAttrib1d),
+ TABLE_ENTRY(VertexAttrib1dv),
+ TABLE_ENTRY(VertexAttrib1f),
+ TABLE_ENTRY(VertexAttrib1fv),
+ TABLE_ENTRY(VertexAttrib1s),
+ TABLE_ENTRY(VertexAttrib1sv),
+ TABLE_ENTRY(VertexAttrib2d),
+ TABLE_ENTRY(VertexAttrib2dv),
+ TABLE_ENTRY(VertexAttrib2f),
+ TABLE_ENTRY(VertexAttrib2fv),
+ TABLE_ENTRY(VertexAttrib2s),
+ TABLE_ENTRY(VertexAttrib2sv),
+ TABLE_ENTRY(VertexAttrib3d),
+ TABLE_ENTRY(VertexAttrib3dv),
+ TABLE_ENTRY(VertexAttrib3f),
+ TABLE_ENTRY(VertexAttrib3fv),
+ TABLE_ENTRY(VertexAttrib3s),
+ TABLE_ENTRY(VertexAttrib3sv),
+ TABLE_ENTRY(VertexAttrib4Nbv),
+ TABLE_ENTRY(VertexAttrib4Niv),
+ TABLE_ENTRY(VertexAttrib4Nsv),
+ TABLE_ENTRY(VertexAttrib4Nub),
+ TABLE_ENTRY(VertexAttrib4Nubv),
+ TABLE_ENTRY(VertexAttrib4Nuiv),
+ TABLE_ENTRY(VertexAttrib4Nusv),
+ TABLE_ENTRY(VertexAttrib4bv),
+ TABLE_ENTRY(VertexAttrib4d),
+ TABLE_ENTRY(VertexAttrib4dv),
+ TABLE_ENTRY(VertexAttrib4f),
+ TABLE_ENTRY(VertexAttrib4fv),
+ TABLE_ENTRY(VertexAttrib4iv),
+ TABLE_ENTRY(VertexAttrib4s),
+ TABLE_ENTRY(VertexAttrib4sv),
+ TABLE_ENTRY(VertexAttrib4ubv),
+ TABLE_ENTRY(VertexAttrib4uiv),
+ TABLE_ENTRY(VertexAttrib4usv),
+ TABLE_ENTRY(VertexAttribPointer),
+ TABLE_ENTRY(BindBuffer),
+ TABLE_ENTRY(BufferData),
+ TABLE_ENTRY(BufferSubData),
+ TABLE_ENTRY(DeleteBuffers),
+ TABLE_ENTRY(GenBuffers),
+ TABLE_ENTRY(GetBufferParameteriv),
+ TABLE_ENTRY(GetBufferPointerv),
+ TABLE_ENTRY(GetBufferSubData),
+ TABLE_ENTRY(IsBuffer),
+ TABLE_ENTRY(MapBuffer),
+ TABLE_ENTRY(UnmapBuffer),
+ TABLE_ENTRY(BeginQuery),
+ TABLE_ENTRY(DeleteQueries),
+ TABLE_ENTRY(EndQuery),
+ TABLE_ENTRY(GenQueries),
+ TABLE_ENTRY(GetQueryObjectiv),
+ TABLE_ENTRY(GetQueryObjectuiv),
+ TABLE_ENTRY(GetQueryiv),
+ TABLE_ENTRY(IsQuery),
+ TABLE_ENTRY(CompileShader),
+ TABLE_ENTRY(GetActiveUniform),
+ TABLE_ENTRY(GetShaderSource),
+ TABLE_ENTRY(GetUniformLocation),
+ TABLE_ENTRY(GetUniformfv),
+ TABLE_ENTRY(GetUniformiv),
+ TABLE_ENTRY(LinkProgram),
+ TABLE_ENTRY(ShaderSource),
+ TABLE_ENTRY(Uniform1f),
+ TABLE_ENTRY(Uniform1fv),
+ TABLE_ENTRY(Uniform1i),
+ TABLE_ENTRY(Uniform1iv),
+ TABLE_ENTRY(Uniform2f),
+ TABLE_ENTRY(Uniform2fv),
+ TABLE_ENTRY(Uniform2i),
+ TABLE_ENTRY(Uniform2iv),
+ TABLE_ENTRY(Uniform3f),
+ TABLE_ENTRY(Uniform3fv),
+ TABLE_ENTRY(Uniform3i),
+ TABLE_ENTRY(Uniform3iv),
+ TABLE_ENTRY(Uniform4f),
+ TABLE_ENTRY(Uniform4fv),
+ TABLE_ENTRY(Uniform4i),
+ TABLE_ENTRY(Uniform4iv),
+ TABLE_ENTRY(UniformMatrix2fv),
+ TABLE_ENTRY(UniformMatrix3fv),
+ TABLE_ENTRY(UniformMatrix4fv),
+ TABLE_ENTRY(UseProgram),
+ TABLE_ENTRY(ValidateProgram),
+ TABLE_ENTRY(BindAttribLocation),
+ TABLE_ENTRY(GetActiveAttrib),
+ TABLE_ENTRY(GetAttribLocation),
+ TABLE_ENTRY(DrawBuffers),
+ TABLE_ENTRY(DrawBuffersATI),
+ TABLE_ENTRY(DrawArraysInstancedEXT),
+ TABLE_ENTRY(DrawArraysInstanced),
+ TABLE_ENTRY(DrawElementsInstancedEXT),
+ TABLE_ENTRY(DrawElementsInstanced),
+ TABLE_ENTRY(RenderbufferStorageMultisampleEXT),
+ TABLE_ENTRY(BlendEquationSeparateIndexedAMD),
+ TABLE_ENTRY(BlendEquationIndexedAMD),
+ TABLE_ENTRY(BlendFuncSeparateIndexedAMD),
+ TABLE_ENTRY(BlendFuncIndexedAMD),
+ TABLE_ENTRY(PointParameterf),
+ TABLE_ENTRY(PointParameterfARB),
+ TABLE_ENTRY(_dispatch_stub_661),
+ TABLE_ENTRY(PointParameterfv),
+ TABLE_ENTRY(PointParameterfvARB),
+ TABLE_ENTRY(_dispatch_stub_662),
+ TABLE_ENTRY(SecondaryColor3b),
+ TABLE_ENTRY(SecondaryColor3bv),
+ TABLE_ENTRY(SecondaryColor3d),
+ TABLE_ENTRY(SecondaryColor3dv),
+ TABLE_ENTRY(SecondaryColor3f),
+ TABLE_ENTRY(SecondaryColor3fv),
+ TABLE_ENTRY(SecondaryColor3i),
+ TABLE_ENTRY(SecondaryColor3iv),
+ TABLE_ENTRY(SecondaryColor3s),
+ TABLE_ENTRY(SecondaryColor3sv),
+ TABLE_ENTRY(SecondaryColor3ub),
+ TABLE_ENTRY(SecondaryColor3ubv),
+ TABLE_ENTRY(SecondaryColor3ui),
+ TABLE_ENTRY(SecondaryColor3uiv),
+ TABLE_ENTRY(SecondaryColor3us),
+ TABLE_ENTRY(SecondaryColor3usv),
+ TABLE_ENTRY(SecondaryColorPointer),
+ TABLE_ENTRY(MultiDrawArrays),
+ TABLE_ENTRY(MultiDrawElements),
+ TABLE_ENTRY(FogCoordPointer),
+ TABLE_ENTRY(FogCoordd),
+ TABLE_ENTRY(FogCoorddv),
+ TABLE_ENTRY(FogCoordf),
+ TABLE_ENTRY(FogCoordfv),
+ TABLE_ENTRY(BlendFuncSeparate),
+ TABLE_ENTRY(_dispatch_stub_690),
+ TABLE_ENTRY(WindowPos2d),
+ TABLE_ENTRY(WindowPos2dARB),
+ TABLE_ENTRY(WindowPos2dv),
+ TABLE_ENTRY(WindowPos2dvARB),
+ TABLE_ENTRY(WindowPos2f),
+ TABLE_ENTRY(WindowPos2fARB),
+ TABLE_ENTRY(WindowPos2fv),
+ TABLE_ENTRY(WindowPos2fvARB),
+ TABLE_ENTRY(WindowPos2i),
+ TABLE_ENTRY(WindowPos2iARB),
+ TABLE_ENTRY(WindowPos2iv),
+ TABLE_ENTRY(WindowPos2ivARB),
+ TABLE_ENTRY(WindowPos2s),
+ TABLE_ENTRY(WindowPos2sARB),
+ TABLE_ENTRY(WindowPos2sv),
+ TABLE_ENTRY(WindowPos2svARB),
+ TABLE_ENTRY(WindowPos3d),
+ TABLE_ENTRY(WindowPos3dARB),
+ TABLE_ENTRY(WindowPos3dv),
+ TABLE_ENTRY(WindowPos3dvARB),
+ TABLE_ENTRY(WindowPos3f),
+ TABLE_ENTRY(WindowPos3fARB),
+ TABLE_ENTRY(WindowPos3fv),
+ TABLE_ENTRY(WindowPos3fvARB),
+ TABLE_ENTRY(WindowPos3i),
+ TABLE_ENTRY(WindowPos3iARB),
+ TABLE_ENTRY(WindowPos3iv),
+ TABLE_ENTRY(WindowPos3ivARB),
+ TABLE_ENTRY(WindowPos3s),
+ TABLE_ENTRY(WindowPos3sARB),
+ TABLE_ENTRY(WindowPos3sv),
+ TABLE_ENTRY(WindowPos3svARB),
+ TABLE_ENTRY(BindProgramARB),
+ TABLE_ENTRY(DeleteProgramsARB),
+ TABLE_ENTRY(GenProgramsARB),
+ TABLE_ENTRY(GetVertexAttribPointerv),
+ TABLE_ENTRY(GetVertexAttribPointervARB),
+ TABLE_ENTRY(IsProgramARB),
+ TABLE_ENTRY(PointParameteri),
+ TABLE_ENTRY(PointParameteriv),
+ TABLE_ENTRY(DeleteVertexArrays),
+ TABLE_ENTRY(IsVertexArray),
+ TABLE_ENTRY(PrimitiveRestartIndex),
+ TABLE_ENTRY(BlendEquationSeparate),
+ TABLE_ENTRY(BindFramebuffer),
+ TABLE_ENTRY(BindRenderbuffer),
+ TABLE_ENTRY(CheckFramebufferStatus),
+ TABLE_ENTRY(DeleteFramebuffers),
+ TABLE_ENTRY(DeleteRenderbuffers),
+ TABLE_ENTRY(FramebufferRenderbuffer),
+ TABLE_ENTRY(FramebufferTexture1D),
+ TABLE_ENTRY(FramebufferTexture2D),
+ TABLE_ENTRY(FramebufferTexture3D),
+ TABLE_ENTRY(GenFramebuffers),
+ TABLE_ENTRY(GenRenderbuffers),
+ TABLE_ENTRY(GenerateMipmap),
+ TABLE_ENTRY(GetFramebufferAttachmentParameteriv),
+ TABLE_ENTRY(GetRenderbufferParameteriv),
+ TABLE_ENTRY(IsFramebuffer),
+ TABLE_ENTRY(IsRenderbuffer),
+ TABLE_ENTRY(RenderbufferStorage),
+ TABLE_ENTRY(BlitFramebuffer),
+ TABLE_ENTRY(BindFragDataLocation),
+ TABLE_ENTRY(GetFragDataLocation),
+ TABLE_ENTRY(GetUniformuiv),
+ TABLE_ENTRY(GetVertexAttribIiv),
+ TABLE_ENTRY(GetVertexAttribIuiv),
+ TABLE_ENTRY(Uniform1ui),
+ TABLE_ENTRY(Uniform1uiv),
+ TABLE_ENTRY(Uniform2ui),
+ TABLE_ENTRY(Uniform2uiv),
+ TABLE_ENTRY(Uniform3ui),
+ TABLE_ENTRY(Uniform3uiv),
+ TABLE_ENTRY(Uniform4ui),
+ TABLE_ENTRY(Uniform4uiv),
+ TABLE_ENTRY(VertexAttribI1i),
+ TABLE_ENTRY(VertexAttribI1iv),
+ TABLE_ENTRY(VertexAttribI1ui),
+ TABLE_ENTRY(VertexAttribI1uiv),
+ TABLE_ENTRY(VertexAttribI2i),
+ TABLE_ENTRY(VertexAttribI2iv),
+ TABLE_ENTRY(VertexAttribI2ui),
+ TABLE_ENTRY(VertexAttribI2uiv),
+ TABLE_ENTRY(VertexAttribI3i),
+ TABLE_ENTRY(VertexAttribI3iv),
+ TABLE_ENTRY(VertexAttribI3ui),
+ TABLE_ENTRY(VertexAttribI3uiv),
+ TABLE_ENTRY(VertexAttribI4bv),
+ TABLE_ENTRY(VertexAttribI4i),
+ TABLE_ENTRY(VertexAttribI4iv),
+ TABLE_ENTRY(VertexAttribI4sv),
+ TABLE_ENTRY(VertexAttribI4ubv),
+ TABLE_ENTRY(VertexAttribI4ui),
+ TABLE_ENTRY(VertexAttribI4uiv),
+ TABLE_ENTRY(VertexAttribI4usv),
+ TABLE_ENTRY(VertexAttribIPointer),
+ TABLE_ENTRY(FramebufferTextureLayer),
+ TABLE_ENTRY(ColorMaski),
+ TABLE_ENTRY(Disablei),
+ TABLE_ENTRY(Enablei),
+ TABLE_ENTRY(GetBooleani_v),
+ TABLE_ENTRY(GetIntegeri_v),
+ TABLE_ENTRY(IsEnabledi),
+ TABLE_ENTRY(GetTexParameterIiv),
+ TABLE_ENTRY(GetTexParameterIuiv),
+ TABLE_ENTRY(TexParameterIiv),
+ TABLE_ENTRY(TexParameterIuiv),
+ TABLE_ENTRY(BeginConditionalRender),
+ TABLE_ENTRY(EndConditionalRender),
+ TABLE_ENTRY(BeginTransformFeedback),
+ TABLE_ENTRY(BindBufferBase),
+ TABLE_ENTRY(BindBufferRange),
+ TABLE_ENTRY(EndTransformFeedback),
+ TABLE_ENTRY(GetTransformFeedbackVarying),
+ TABLE_ENTRY(TransformFeedbackVaryings),
+ TABLE_ENTRY(ProvokingVertex),
+#endif /* _GLAPI_SKIP_NORMAL_ENTRY_POINTS */
+#ifndef _GLAPI_SKIP_PROTO_ENTRY_POINTS
+ TABLE_ENTRY(AreTexturesResidentEXT),
+ TABLE_ENTRY(DeleteTexturesEXT),
+ TABLE_ENTRY(GenTexturesEXT),
+ TABLE_ENTRY(IsTextureEXT),
+ TABLE_ENTRY(GetColorTableEXT),
+ TABLE_ENTRY(_dispatch_stub_343),
+ TABLE_ENTRY(GetColorTableParameterfvEXT),
+ TABLE_ENTRY(_dispatch_stub_344),
+ TABLE_ENTRY(GetColorTableParameterivEXT),
+ TABLE_ENTRY(_dispatch_stub_345),
+ TABLE_ENTRY(_dispatch_stub_356),
+ TABLE_ENTRY(_dispatch_stub_357),
+ TABLE_ENTRY(_dispatch_stub_358),
+ TABLE_ENTRY(_dispatch_stub_359),
+ TABLE_ENTRY(_dispatch_stub_361),
+ TABLE_ENTRY(_dispatch_stub_362),
+ TABLE_ENTRY(_dispatch_stub_363),
+ TABLE_ENTRY(_dispatch_stub_364),
+ TABLE_ENTRY(_dispatch_stub_365),
+ TABLE_ENTRY(_dispatch_stub_366),
+#endif /* _GLAPI_SKIP_PROTO_ENTRY_POINTS */
+};
+#endif /*UNUSED_TABLE_NAME*/
+
+
+# undef KEYWORD1
+# undef KEYWORD1_ALT
+# undef KEYWORD2
+# undef NAME
+# undef DISPATCH
+# undef RETURN_DISPATCH
+# undef DISPATCH_TABLE_NAME
+# undef UNUSED_TABLE_NAME
+# undef TABLE_ENTRY
+# undef HIDDEN
diff --git a/mesalib/src/mapi/glapi/glprocs.h b/mesalib/src/mapi/glapi/glprocs.h
index c10c3da40..b71df9227 100644
--- a/mesalib/src/mapi/glapi/glprocs.h
+++ b/mesalib/src/mapi/glapi/glprocs.h
@@ -1,2747 +1,2747 @@
-/* DO NOT EDIT - This file generated automatically by gl_procs.py (from Mesa) script */
-
-/*
- * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
- * (C) Copyright IBM Corporation 2004, 2006
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sub license,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL, IBM,
- * AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
- * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-
-/* This file is only included by glapi.c and is used for
- * the GetProcAddress() function
- */
-
-typedef struct {
- GLint Name_offset;
-#if defined(NEED_FUNCTION_POINTER) || defined(GLX_INDIRECT_RENDERING)
- _glapi_proc Address;
-#endif
- GLuint Offset;
-} glprocs_table_t;
-
-#if !defined(NEED_FUNCTION_POINTER) && !defined(GLX_INDIRECT_RENDERING)
-# define NAME_FUNC_OFFSET(n,f1,f2,f3,o) { n , o }
-#elif defined(NEED_FUNCTION_POINTER) && !defined(GLX_INDIRECT_RENDERING)
-# define NAME_FUNC_OFFSET(n,f1,f2,f3,o) { n , (_glapi_proc) f1 , o }
-#elif defined(NEED_FUNCTION_POINTER) && defined(GLX_INDIRECT_RENDERING)
-# define NAME_FUNC_OFFSET(n,f1,f2,f3,o) { n , (_glapi_proc) f2 , o }
-#elif !defined(NEED_FUNCTION_POINTER) && defined(GLX_INDIRECT_RENDERING)
-# define NAME_FUNC_OFFSET(n,f1,f2,f3,o) { n , (_glapi_proc) f3 , o }
-#endif
-
-
-
-static const char gl_string_table[] =
- "glNewList\0"
- "glEndList\0"
- "glCallList\0"
- "glCallLists\0"
- "glDeleteLists\0"
- "glGenLists\0"
- "glListBase\0"
- "glBegin\0"
- "glBitmap\0"
- "glColor3b\0"
- "glColor3bv\0"
- "glColor3d\0"
- "glColor3dv\0"
- "glColor3f\0"
- "glColor3fv\0"
- "glColor3i\0"
- "glColor3iv\0"
- "glColor3s\0"
- "glColor3sv\0"
- "glColor3ub\0"
- "glColor3ubv\0"
- "glColor3ui\0"
- "glColor3uiv\0"
- "glColor3us\0"
- "glColor3usv\0"
- "glColor4b\0"
- "glColor4bv\0"
- "glColor4d\0"
- "glColor4dv\0"
- "glColor4f\0"
- "glColor4fv\0"
- "glColor4i\0"
- "glColor4iv\0"
- "glColor4s\0"
- "glColor4sv\0"
- "glColor4ub\0"
- "glColor4ubv\0"
- "glColor4ui\0"
- "glColor4uiv\0"
- "glColor4us\0"
- "glColor4usv\0"
- "glEdgeFlag\0"
- "glEdgeFlagv\0"
- "glEnd\0"
- "glIndexd\0"
- "glIndexdv\0"
- "glIndexf\0"
- "glIndexfv\0"
- "glIndexi\0"
- "glIndexiv\0"
- "glIndexs\0"
- "glIndexsv\0"
- "glNormal3b\0"
- "glNormal3bv\0"
- "glNormal3d\0"
- "glNormal3dv\0"
- "glNormal3f\0"
- "glNormal3fv\0"
- "glNormal3i\0"
- "glNormal3iv\0"
- "glNormal3s\0"
- "glNormal3sv\0"
- "glRasterPos2d\0"
- "glRasterPos2dv\0"
- "glRasterPos2f\0"
- "glRasterPos2fv\0"
- "glRasterPos2i\0"
- "glRasterPos2iv\0"
- "glRasterPos2s\0"
- "glRasterPos2sv\0"
- "glRasterPos3d\0"
- "glRasterPos3dv\0"
- "glRasterPos3f\0"
- "glRasterPos3fv\0"
- "glRasterPos3i\0"
- "glRasterPos3iv\0"
- "glRasterPos3s\0"
- "glRasterPos3sv\0"
- "glRasterPos4d\0"
- "glRasterPos4dv\0"
- "glRasterPos4f\0"
- "glRasterPos4fv\0"
- "glRasterPos4i\0"
- "glRasterPos4iv\0"
- "glRasterPos4s\0"
- "glRasterPos4sv\0"
- "glRectd\0"
- "glRectdv\0"
- "glRectf\0"
- "glRectfv\0"
- "glRecti\0"
- "glRectiv\0"
- "glRects\0"
- "glRectsv\0"
- "glTexCoord1d\0"
- "glTexCoord1dv\0"
- "glTexCoord1f\0"
- "glTexCoord1fv\0"
- "glTexCoord1i\0"
- "glTexCoord1iv\0"
- "glTexCoord1s\0"
- "glTexCoord1sv\0"
- "glTexCoord2d\0"
- "glTexCoord2dv\0"
- "glTexCoord2f\0"
- "glTexCoord2fv\0"
- "glTexCoord2i\0"
- "glTexCoord2iv\0"
- "glTexCoord2s\0"
- "glTexCoord2sv\0"
- "glTexCoord3d\0"
- "glTexCoord3dv\0"
- "glTexCoord3f\0"
- "glTexCoord3fv\0"
- "glTexCoord3i\0"
- "glTexCoord3iv\0"
- "glTexCoord3s\0"
- "glTexCoord3sv\0"
- "glTexCoord4d\0"
- "glTexCoord4dv\0"
- "glTexCoord4f\0"
- "glTexCoord4fv\0"
- "glTexCoord4i\0"
- "glTexCoord4iv\0"
- "glTexCoord4s\0"
- "glTexCoord4sv\0"
- "glVertex2d\0"
- "glVertex2dv\0"
- "glVertex2f\0"
- "glVertex2fv\0"
- "glVertex2i\0"
- "glVertex2iv\0"
- "glVertex2s\0"
- "glVertex2sv\0"
- "glVertex3d\0"
- "glVertex3dv\0"
- "glVertex3f\0"
- "glVertex3fv\0"
- "glVertex3i\0"
- "glVertex3iv\0"
- "glVertex3s\0"
- "glVertex3sv\0"
- "glVertex4d\0"
- "glVertex4dv\0"
- "glVertex4f\0"
- "glVertex4fv\0"
- "glVertex4i\0"
- "glVertex4iv\0"
- "glVertex4s\0"
- "glVertex4sv\0"
- "glClipPlane\0"
- "glColorMaterial\0"
- "glCullFace\0"
- "glFogf\0"
- "glFogfv\0"
- "glFogi\0"
- "glFogiv\0"
- "glFrontFace\0"
- "glHint\0"
- "glLightf\0"
- "glLightfv\0"
- "glLighti\0"
- "glLightiv\0"
- "glLightModelf\0"
- "glLightModelfv\0"
- "glLightModeli\0"
- "glLightModeliv\0"
- "glLineStipple\0"
- "glLineWidth\0"
- "glMaterialf\0"
- "glMaterialfv\0"
- "glMateriali\0"
- "glMaterialiv\0"
- "glPointSize\0"
- "glPolygonMode\0"
- "glPolygonStipple\0"
- "glScissor\0"
- "glShadeModel\0"
- "glTexParameterf\0"
- "glTexParameterfv\0"
- "glTexParameteri\0"
- "glTexParameteriv\0"
- "glTexImage1D\0"
- "glTexImage2D\0"
- "glTexEnvf\0"
- "glTexEnvfv\0"
- "glTexEnvi\0"
- "glTexEnviv\0"
- "glTexGend\0"
- "glTexGendv\0"
- "glTexGenf\0"
- "glTexGenfv\0"
- "glTexGeni\0"
- "glTexGeniv\0"
- "glFeedbackBuffer\0"
- "glSelectBuffer\0"
- "glRenderMode\0"
- "glInitNames\0"
- "glLoadName\0"
- "glPassThrough\0"
- "glPopName\0"
- "glPushName\0"
- "glDrawBuffer\0"
- "glClear\0"
- "glClearAccum\0"
- "glClearIndex\0"
- "glClearColor\0"
- "glClearStencil\0"
- "glClearDepth\0"
- "glStencilMask\0"
- "glColorMask\0"
- "glDepthMask\0"
- "glIndexMask\0"
- "glAccum\0"
- "glDisable\0"
- "glEnable\0"
- "glFinish\0"
- "glFlush\0"
- "glPopAttrib\0"
- "glPushAttrib\0"
- "glMap1d\0"
- "glMap1f\0"
- "glMap2d\0"
- "glMap2f\0"
- "glMapGrid1d\0"
- "glMapGrid1f\0"
- "glMapGrid2d\0"
- "glMapGrid2f\0"
- "glEvalCoord1d\0"
- "glEvalCoord1dv\0"
- "glEvalCoord1f\0"
- "glEvalCoord1fv\0"
- "glEvalCoord2d\0"
- "glEvalCoord2dv\0"
- "glEvalCoord2f\0"
- "glEvalCoord2fv\0"
- "glEvalMesh1\0"
- "glEvalPoint1\0"
- "glEvalMesh2\0"
- "glEvalPoint2\0"
- "glAlphaFunc\0"
- "glBlendFunc\0"
- "glLogicOp\0"
- "glStencilFunc\0"
- "glStencilOp\0"
- "glDepthFunc\0"
- "glPixelZoom\0"
- "glPixelTransferf\0"
- "glPixelTransferi\0"
- "glPixelStoref\0"
- "glPixelStorei\0"
- "glPixelMapfv\0"
- "glPixelMapuiv\0"
- "glPixelMapusv\0"
- "glReadBuffer\0"
- "glCopyPixels\0"
- "glReadPixels\0"
- "glDrawPixels\0"
- "glGetBooleanv\0"
- "glGetClipPlane\0"
- "glGetDoublev\0"
- "glGetError\0"
- "glGetFloatv\0"
- "glGetIntegerv\0"
- "glGetLightfv\0"
- "glGetLightiv\0"
- "glGetMapdv\0"
- "glGetMapfv\0"
- "glGetMapiv\0"
- "glGetMaterialfv\0"
- "glGetMaterialiv\0"
- "glGetPixelMapfv\0"
- "glGetPixelMapuiv\0"
- "glGetPixelMapusv\0"
- "glGetPolygonStipple\0"
- "glGetString\0"
- "glGetTexEnvfv\0"
- "glGetTexEnviv\0"
- "glGetTexGendv\0"
- "glGetTexGenfv\0"
- "glGetTexGeniv\0"
- "glGetTexImage\0"
- "glGetTexParameterfv\0"
- "glGetTexParameteriv\0"
- "glGetTexLevelParameterfv\0"
- "glGetTexLevelParameteriv\0"
- "glIsEnabled\0"
- "glIsList\0"
- "glDepthRange\0"
- "glFrustum\0"
- "glLoadIdentity\0"
- "glLoadMatrixf\0"
- "glLoadMatrixd\0"
- "glMatrixMode\0"
- "glMultMatrixf\0"
- "glMultMatrixd\0"
- "glOrtho\0"
- "glPopMatrix\0"
- "glPushMatrix\0"
- "glRotated\0"
- "glRotatef\0"
- "glScaled\0"
- "glScalef\0"
- "glTranslated\0"
- "glTranslatef\0"
- "glViewport\0"
- "glArrayElement\0"
- "glBindTexture\0"
- "glColorPointer\0"
- "glDisableClientState\0"
- "glDrawArrays\0"
- "glDrawElements\0"
- "glEdgeFlagPointer\0"
- "glEnableClientState\0"
- "glIndexPointer\0"
- "glIndexub\0"
- "glIndexubv\0"
- "glInterleavedArrays\0"
- "glNormalPointer\0"
- "glPolygonOffset\0"
- "glTexCoordPointer\0"
- "glVertexPointer\0"
- "glAreTexturesResident\0"
- "glCopyTexImage1D\0"
- "glCopyTexImage2D\0"
- "glCopyTexSubImage1D\0"
- "glCopyTexSubImage2D\0"
- "glDeleteTextures\0"
- "glGenTextures\0"
- "glGetPointerv\0"
- "glIsTexture\0"
- "glPrioritizeTextures\0"
- "glTexSubImage1D\0"
- "glTexSubImage2D\0"
- "glPopClientAttrib\0"
- "glPushClientAttrib\0"
- "glBlendColor\0"
- "glBlendEquation\0"
- "glDrawRangeElements\0"
- "glColorTable\0"
- "glColorTableParameterfv\0"
- "glColorTableParameteriv\0"
- "glCopyColorTable\0"
- "glGetColorTable\0"
- "glGetColorTableParameterfv\0"
- "glGetColorTableParameteriv\0"
- "glColorSubTable\0"
- "glCopyColorSubTable\0"
- "glConvolutionFilter1D\0"
- "glConvolutionFilter2D\0"
- "glConvolutionParameterf\0"
- "glConvolutionParameterfv\0"
- "glConvolutionParameteri\0"
- "glConvolutionParameteriv\0"
- "glCopyConvolutionFilter1D\0"
- "glCopyConvolutionFilter2D\0"
- "glGetConvolutionFilter\0"
- "glGetConvolutionParameterfv\0"
- "glGetConvolutionParameteriv\0"
- "glGetSeparableFilter\0"
- "glSeparableFilter2D\0"
- "glGetHistogram\0"
- "glGetHistogramParameterfv\0"
- "glGetHistogramParameteriv\0"
- "glGetMinmax\0"
- "glGetMinmaxParameterfv\0"
- "glGetMinmaxParameteriv\0"
- "glHistogram\0"
- "glMinmax\0"
- "glResetHistogram\0"
- "glResetMinmax\0"
- "glTexImage3D\0"
- "glTexSubImage3D\0"
- "glCopyTexSubImage3D\0"
- "glActiveTextureARB\0"
- "glClientActiveTextureARB\0"
- "glMultiTexCoord1dARB\0"
- "glMultiTexCoord1dvARB\0"
- "glMultiTexCoord1fARB\0"
- "glMultiTexCoord1fvARB\0"
- "glMultiTexCoord1iARB\0"
- "glMultiTexCoord1ivARB\0"
- "glMultiTexCoord1sARB\0"
- "glMultiTexCoord1svARB\0"
- "glMultiTexCoord2dARB\0"
- "glMultiTexCoord2dvARB\0"
- "glMultiTexCoord2fARB\0"
- "glMultiTexCoord2fvARB\0"
- "glMultiTexCoord2iARB\0"
- "glMultiTexCoord2ivARB\0"
- "glMultiTexCoord2sARB\0"
- "glMultiTexCoord2svARB\0"
- "glMultiTexCoord3dARB\0"
- "glMultiTexCoord3dvARB\0"
- "glMultiTexCoord3fARB\0"
- "glMultiTexCoord3fvARB\0"
- "glMultiTexCoord3iARB\0"
- "glMultiTexCoord3ivARB\0"
- "glMultiTexCoord3sARB\0"
- "glMultiTexCoord3svARB\0"
- "glMultiTexCoord4dARB\0"
- "glMultiTexCoord4dvARB\0"
- "glMultiTexCoord4fARB\0"
- "glMultiTexCoord4fvARB\0"
- "glMultiTexCoord4iARB\0"
- "glMultiTexCoord4ivARB\0"
- "glMultiTexCoord4sARB\0"
- "glMultiTexCoord4svARB\0"
- "glAttachShader\0"
- "glCreateProgram\0"
- "glCreateShader\0"
- "glDeleteProgram\0"
- "glDeleteShader\0"
- "glDetachShader\0"
- "glGetAttachedShaders\0"
- "glGetProgramInfoLog\0"
- "glGetProgramiv\0"
- "glGetShaderInfoLog\0"
- "glGetShaderiv\0"
- "glIsProgram\0"
- "glIsShader\0"
- "glStencilFuncSeparate\0"
- "glStencilMaskSeparate\0"
- "glStencilOpSeparate\0"
- "glUniformMatrix2x3fv\0"
- "glUniformMatrix2x4fv\0"
- "glUniformMatrix3x2fv\0"
- "glUniformMatrix3x4fv\0"
- "glUniformMatrix4x2fv\0"
- "glUniformMatrix4x3fv\0"
- "glClampColor\0"
- "glClearBufferfi\0"
- "glClearBufferfv\0"
- "glClearBufferiv\0"
- "glClearBufferuiv\0"
- "glGetStringi\0"
- "glTexBuffer\0"
- "glFramebufferTexture\0"
- "glGetBufferParameteri64v\0"
- "glGetInteger64i_v\0"
- "glVertexAttribDivisor\0"
- "glLoadTransposeMatrixdARB\0"
- "glLoadTransposeMatrixfARB\0"
- "glMultTransposeMatrixdARB\0"
- "glMultTransposeMatrixfARB\0"
- "glSampleCoverageARB\0"
- "glCompressedTexImage1DARB\0"
- "glCompressedTexImage2DARB\0"
- "glCompressedTexImage3DARB\0"
- "glCompressedTexSubImage1DARB\0"
- "glCompressedTexSubImage2DARB\0"
- "glCompressedTexSubImage3DARB\0"
- "glGetCompressedTexImageARB\0"
- "glDisableVertexAttribArrayARB\0"
- "glEnableVertexAttribArrayARB\0"
- "glGetProgramEnvParameterdvARB\0"
- "glGetProgramEnvParameterfvARB\0"
- "glGetProgramLocalParameterdvARB\0"
- "glGetProgramLocalParameterfvARB\0"
- "glGetProgramStringARB\0"
- "glGetProgramivARB\0"
- "glGetVertexAttribdvARB\0"
- "glGetVertexAttribfvARB\0"
- "glGetVertexAttribivARB\0"
- "glProgramEnvParameter4dARB\0"
- "glProgramEnvParameter4dvARB\0"
- "glProgramEnvParameter4fARB\0"
- "glProgramEnvParameter4fvARB\0"
- "glProgramLocalParameter4dARB\0"
- "glProgramLocalParameter4dvARB\0"
- "glProgramLocalParameter4fARB\0"
- "glProgramLocalParameter4fvARB\0"
- "glProgramStringARB\0"
- "glVertexAttrib1dARB\0"
- "glVertexAttrib1dvARB\0"
- "glVertexAttrib1fARB\0"
- "glVertexAttrib1fvARB\0"
- "glVertexAttrib1sARB\0"
- "glVertexAttrib1svARB\0"
- "glVertexAttrib2dARB\0"
- "glVertexAttrib2dvARB\0"
- "glVertexAttrib2fARB\0"
- "glVertexAttrib2fvARB\0"
- "glVertexAttrib2sARB\0"
- "glVertexAttrib2svARB\0"
- "glVertexAttrib3dARB\0"
- "glVertexAttrib3dvARB\0"
- "glVertexAttrib3fARB\0"
- "glVertexAttrib3fvARB\0"
- "glVertexAttrib3sARB\0"
- "glVertexAttrib3svARB\0"
- "glVertexAttrib4NbvARB\0"
- "glVertexAttrib4NivARB\0"
- "glVertexAttrib4NsvARB\0"
- "glVertexAttrib4NubARB\0"
- "glVertexAttrib4NubvARB\0"
- "glVertexAttrib4NuivARB\0"
- "glVertexAttrib4NusvARB\0"
- "glVertexAttrib4bvARB\0"
- "glVertexAttrib4dARB\0"
- "glVertexAttrib4dvARB\0"
- "glVertexAttrib4fARB\0"
- "glVertexAttrib4fvARB\0"
- "glVertexAttrib4ivARB\0"
- "glVertexAttrib4sARB\0"
- "glVertexAttrib4svARB\0"
- "glVertexAttrib4ubvARB\0"
- "glVertexAttrib4uivARB\0"
- "glVertexAttrib4usvARB\0"
- "glVertexAttribPointerARB\0"
- "glBindBufferARB\0"
- "glBufferDataARB\0"
- "glBufferSubDataARB\0"
- "glDeleteBuffersARB\0"
- "glGenBuffersARB\0"
- "glGetBufferParameterivARB\0"
- "glGetBufferPointervARB\0"
- "glGetBufferSubDataARB\0"
- "glIsBufferARB\0"
- "glMapBufferARB\0"
- "glUnmapBufferARB\0"
- "glBeginQueryARB\0"
- "glDeleteQueriesARB\0"
- "glEndQueryARB\0"
- "glGenQueriesARB\0"
- "glGetQueryObjectivARB\0"
- "glGetQueryObjectuivARB\0"
- "glGetQueryivARB\0"
- "glIsQueryARB\0"
- "glAttachObjectARB\0"
- "glCompileShaderARB\0"
- "glCreateProgramObjectARB\0"
- "glCreateShaderObjectARB\0"
- "glDeleteObjectARB\0"
- "glDetachObjectARB\0"
- "glGetActiveUniformARB\0"
- "glGetAttachedObjectsARB\0"
- "glGetHandleARB\0"
- "glGetInfoLogARB\0"
- "glGetObjectParameterfvARB\0"
- "glGetObjectParameterivARB\0"
- "glGetShaderSourceARB\0"
- "glGetUniformLocationARB\0"
- "glGetUniformfvARB\0"
- "glGetUniformivARB\0"
- "glLinkProgramARB\0"
- "glShaderSourceARB\0"
- "glUniform1fARB\0"
- "glUniform1fvARB\0"
- "glUniform1iARB\0"
- "glUniform1ivARB\0"
- "glUniform2fARB\0"
- "glUniform2fvARB\0"
- "glUniform2iARB\0"
- "glUniform2ivARB\0"
- "glUniform3fARB\0"
- "glUniform3fvARB\0"
- "glUniform3iARB\0"
- "glUniform3ivARB\0"
- "glUniform4fARB\0"
- "glUniform4fvARB\0"
- "glUniform4iARB\0"
- "glUniform4ivARB\0"
- "glUniformMatrix2fvARB\0"
- "glUniformMatrix3fvARB\0"
- "glUniformMatrix4fvARB\0"
- "glUseProgramObjectARB\0"
- "glValidateProgramARB\0"
- "glBindAttribLocationARB\0"
- "glGetActiveAttribARB\0"
- "glGetAttribLocationARB\0"
- "glDrawBuffersARB\0"
- "glClampColorARB\0"
- "glDrawArraysInstancedARB\0"
- "glDrawElementsInstancedARB\0"
- "glRenderbufferStorageMultisample\0"
- "glFramebufferTextureARB\0"
- "glFramebufferTextureFaceARB\0"
- "glProgramParameteriARB\0"
- "glVertexAttribDivisorARB\0"
- "glFlushMappedBufferRange\0"
- "glMapBufferRange\0"
- "glTexBufferARB\0"
- "glBindVertexArray\0"
- "glGenVertexArrays\0"
- "glCopyBufferSubData\0"
- "glClientWaitSync\0"
- "glDeleteSync\0"
- "glFenceSync\0"
- "glGetInteger64v\0"
- "glGetSynciv\0"
- "glIsSync\0"
- "glWaitSync\0"
- "glDrawElementsBaseVertex\0"
- "glDrawRangeElementsBaseVertex\0"
- "glMultiDrawElementsBaseVertex\0"
- "glBlendEquationSeparateiARB\0"
- "glBlendEquationiARB\0"
- "glBlendFuncSeparateiARB\0"
- "glBlendFunciARB\0"
- "glBindSampler\0"
- "glDeleteSamplers\0"
- "glGenSamplers\0"
- "glGetSamplerParameterIiv\0"
- "glGetSamplerParameterIuiv\0"
- "glGetSamplerParameterfv\0"
- "glGetSamplerParameteriv\0"
- "glIsSampler\0"
- "glSamplerParameterIiv\0"
- "glSamplerParameterIuiv\0"
- "glSamplerParameterf\0"
- "glSamplerParameterfv\0"
- "glSamplerParameteri\0"
- "glSamplerParameteriv\0"
- "glBindTransformFeedback\0"
- "glDeleteTransformFeedbacks\0"
- "glDrawTransformFeedback\0"
- "glGenTransformFeedbacks\0"
- "glIsTransformFeedback\0"
- "glPauseTransformFeedback\0"
- "glResumeTransformFeedback\0"
- "glClearDepthf\0"
- "glDepthRangef\0"
- "glGetShaderPrecisionFormat\0"
- "glReleaseShaderCompiler\0"
- "glShaderBinary\0"
- "glGetGraphicsResetStatusARB\0"
- "glGetnColorTableARB\0"
- "glGetnCompressedTexImageARB\0"
- "glGetnConvolutionFilterARB\0"
- "glGetnHistogramARB\0"
- "glGetnMapdvARB\0"
- "glGetnMapfvARB\0"
- "glGetnMapivARB\0"
- "glGetnMinmaxARB\0"
- "glGetnPixelMapfvARB\0"
- "glGetnPixelMapuivARB\0"
- "glGetnPixelMapusvARB\0"
- "glGetnPolygonStippleARB\0"
- "glGetnSeparableFilterARB\0"
- "glGetnTexImageARB\0"
- "glGetnUniformdvARB\0"
- "glGetnUniformfvARB\0"
- "glGetnUniformivARB\0"
- "glGetnUniformuivARB\0"
- "glReadnPixelsARB\0"
- "glPolygonOffsetEXT\0"
- "glGetPixelTexGenParameterfvSGIS\0"
- "glGetPixelTexGenParameterivSGIS\0"
- "glPixelTexGenParameterfSGIS\0"
- "glPixelTexGenParameterfvSGIS\0"
- "glPixelTexGenParameteriSGIS\0"
- "glPixelTexGenParameterivSGIS\0"
- "glSampleMaskSGIS\0"
- "glSamplePatternSGIS\0"
- "glColorPointerEXT\0"
- "glEdgeFlagPointerEXT\0"
- "glIndexPointerEXT\0"
- "glNormalPointerEXT\0"
- "glTexCoordPointerEXT\0"
- "glVertexPointerEXT\0"
- "glPointParameterfEXT\0"
- "glPointParameterfvEXT\0"
- "glLockArraysEXT\0"
- "glUnlockArraysEXT\0"
- "glSecondaryColor3bEXT\0"
- "glSecondaryColor3bvEXT\0"
- "glSecondaryColor3dEXT\0"
- "glSecondaryColor3dvEXT\0"
- "glSecondaryColor3fEXT\0"
- "glSecondaryColor3fvEXT\0"
- "glSecondaryColor3iEXT\0"
- "glSecondaryColor3ivEXT\0"
- "glSecondaryColor3sEXT\0"
- "glSecondaryColor3svEXT\0"
- "glSecondaryColor3ubEXT\0"
- "glSecondaryColor3ubvEXT\0"
- "glSecondaryColor3uiEXT\0"
- "glSecondaryColor3uivEXT\0"
- "glSecondaryColor3usEXT\0"
- "glSecondaryColor3usvEXT\0"
- "glSecondaryColorPointerEXT\0"
- "glMultiDrawArraysEXT\0"
- "glMultiDrawElementsEXT\0"
- "glFogCoordPointerEXT\0"
- "glFogCoorddEXT\0"
- "glFogCoorddvEXT\0"
- "glFogCoordfEXT\0"
- "glFogCoordfvEXT\0"
- "glPixelTexGenSGIX\0"
- "glBlendFuncSeparateEXT\0"
- "glFlushVertexArrayRangeNV\0"
- "glVertexArrayRangeNV\0"
- "glCombinerInputNV\0"
- "glCombinerOutputNV\0"
- "glCombinerParameterfNV\0"
- "glCombinerParameterfvNV\0"
- "glCombinerParameteriNV\0"
- "glCombinerParameterivNV\0"
- "glFinalCombinerInputNV\0"
- "glGetCombinerInputParameterfvNV\0"
- "glGetCombinerInputParameterivNV\0"
- "glGetCombinerOutputParameterfvNV\0"
- "glGetCombinerOutputParameterivNV\0"
- "glGetFinalCombinerInputParameterfvNV\0"
- "glGetFinalCombinerInputParameterivNV\0"
- "glResizeBuffersMESA\0"
- "glWindowPos2dMESA\0"
- "glWindowPos2dvMESA\0"
- "glWindowPos2fMESA\0"
- "glWindowPos2fvMESA\0"
- "glWindowPos2iMESA\0"
- "glWindowPos2ivMESA\0"
- "glWindowPos2sMESA\0"
- "glWindowPos2svMESA\0"
- "glWindowPos3dMESA\0"
- "glWindowPos3dvMESA\0"
- "glWindowPos3fMESA\0"
- "glWindowPos3fvMESA\0"
- "glWindowPos3iMESA\0"
- "glWindowPos3ivMESA\0"
- "glWindowPos3sMESA\0"
- "glWindowPos3svMESA\0"
- "glWindowPos4dMESA\0"
- "glWindowPos4dvMESA\0"
- "glWindowPos4fMESA\0"
- "glWindowPos4fvMESA\0"
- "glWindowPos4iMESA\0"
- "glWindowPos4ivMESA\0"
- "glWindowPos4sMESA\0"
- "glWindowPos4svMESA\0"
- "glMultiModeDrawArraysIBM\0"
- "glMultiModeDrawElementsIBM\0"
- "glDeleteFencesNV\0"
- "glFinishFenceNV\0"
- "glGenFencesNV\0"
- "glGetFenceivNV\0"
- "glIsFenceNV\0"
- "glSetFenceNV\0"
- "glTestFenceNV\0"
- "glAreProgramsResidentNV\0"
- "glBindProgramNV\0"
- "glDeleteProgramsNV\0"
- "glExecuteProgramNV\0"
- "glGenProgramsNV\0"
- "glGetProgramParameterdvNV\0"
- "glGetProgramParameterfvNV\0"
- "glGetProgramStringNV\0"
- "glGetProgramivNV\0"
- "glGetTrackMatrixivNV\0"
- "glGetVertexAttribPointervNV\0"
- "glGetVertexAttribdvNV\0"
- "glGetVertexAttribfvNV\0"
- "glGetVertexAttribivNV\0"
- "glIsProgramNV\0"
- "glLoadProgramNV\0"
- "glProgramParameters4dvNV\0"
- "glProgramParameters4fvNV\0"
- "glRequestResidentProgramsNV\0"
- "glTrackMatrixNV\0"
- "glVertexAttrib1dNV\0"
- "glVertexAttrib1dvNV\0"
- "glVertexAttrib1fNV\0"
- "glVertexAttrib1fvNV\0"
- "glVertexAttrib1sNV\0"
- "glVertexAttrib1svNV\0"
- "glVertexAttrib2dNV\0"
- "glVertexAttrib2dvNV\0"
- "glVertexAttrib2fNV\0"
- "glVertexAttrib2fvNV\0"
- "glVertexAttrib2sNV\0"
- "glVertexAttrib2svNV\0"
- "glVertexAttrib3dNV\0"
- "glVertexAttrib3dvNV\0"
- "glVertexAttrib3fNV\0"
- "glVertexAttrib3fvNV\0"
- "glVertexAttrib3sNV\0"
- "glVertexAttrib3svNV\0"
- "glVertexAttrib4dNV\0"
- "glVertexAttrib4dvNV\0"
- "glVertexAttrib4fNV\0"
- "glVertexAttrib4fvNV\0"
- "glVertexAttrib4sNV\0"
- "glVertexAttrib4svNV\0"
- "glVertexAttrib4ubNV\0"
- "glVertexAttrib4ubvNV\0"
- "glVertexAttribPointerNV\0"
- "glVertexAttribs1dvNV\0"
- "glVertexAttribs1fvNV\0"
- "glVertexAttribs1svNV\0"
- "glVertexAttribs2dvNV\0"
- "glVertexAttribs2fvNV\0"
- "glVertexAttribs2svNV\0"
- "glVertexAttribs3dvNV\0"
- "glVertexAttribs3fvNV\0"
- "glVertexAttribs3svNV\0"
- "glVertexAttribs4dvNV\0"
- "glVertexAttribs4fvNV\0"
- "glVertexAttribs4svNV\0"
- "glVertexAttribs4ubvNV\0"
- "glGetTexBumpParameterfvATI\0"
- "glGetTexBumpParameterivATI\0"
- "glTexBumpParameterfvATI\0"
- "glTexBumpParameterivATI\0"
- "glAlphaFragmentOp1ATI\0"
- "glAlphaFragmentOp2ATI\0"
- "glAlphaFragmentOp3ATI\0"
- "glBeginFragmentShaderATI\0"
- "glBindFragmentShaderATI\0"
- "glColorFragmentOp1ATI\0"
- "glColorFragmentOp2ATI\0"
- "glColorFragmentOp3ATI\0"
- "glDeleteFragmentShaderATI\0"
- "glEndFragmentShaderATI\0"
- "glGenFragmentShadersATI\0"
- "glPassTexCoordATI\0"
- "glSampleMapATI\0"
- "glSetFragmentShaderConstantATI\0"
- "glPointParameteriNV\0"
- "glPointParameterivNV\0"
- "glActiveStencilFaceEXT\0"
- "glBindVertexArrayAPPLE\0"
- "glDeleteVertexArraysAPPLE\0"
- "glGenVertexArraysAPPLE\0"
- "glIsVertexArrayAPPLE\0"
- "glGetProgramNamedParameterdvNV\0"
- "glGetProgramNamedParameterfvNV\0"
- "glProgramNamedParameter4dNV\0"
- "glProgramNamedParameter4dvNV\0"
- "glProgramNamedParameter4fNV\0"
- "glProgramNamedParameter4fvNV\0"
- "glPrimitiveRestartIndexNV\0"
- "glPrimitiveRestartNV\0"
- "glDepthBoundsEXT\0"
- "glBlendEquationSeparateEXT\0"
- "glBindFramebufferEXT\0"
- "glBindRenderbufferEXT\0"
- "glCheckFramebufferStatusEXT\0"
- "glDeleteFramebuffersEXT\0"
- "glDeleteRenderbuffersEXT\0"
- "glFramebufferRenderbufferEXT\0"
- "glFramebufferTexture1DEXT\0"
- "glFramebufferTexture2DEXT\0"
- "glFramebufferTexture3DEXT\0"
- "glGenFramebuffersEXT\0"
- "glGenRenderbuffersEXT\0"
- "glGenerateMipmapEXT\0"
- "glGetFramebufferAttachmentParameterivEXT\0"
- "glGetRenderbufferParameterivEXT\0"
- "glIsFramebufferEXT\0"
- "glIsRenderbufferEXT\0"
- "glRenderbufferStorageEXT\0"
- "glBlitFramebufferEXT\0"
- "glBufferParameteriAPPLE\0"
- "glFlushMappedBufferRangeAPPLE\0"
- "glBindFragDataLocationEXT\0"
- "glGetFragDataLocationEXT\0"
- "glGetUniformuivEXT\0"
- "glGetVertexAttribIivEXT\0"
- "glGetVertexAttribIuivEXT\0"
- "glUniform1uiEXT\0"
- "glUniform1uivEXT\0"
- "glUniform2uiEXT\0"
- "glUniform2uivEXT\0"
- "glUniform3uiEXT\0"
- "glUniform3uivEXT\0"
- "glUniform4uiEXT\0"
- "glUniform4uivEXT\0"
- "glVertexAttribI1iEXT\0"
- "glVertexAttribI1ivEXT\0"
- "glVertexAttribI1uiEXT\0"
- "glVertexAttribI1uivEXT\0"
- "glVertexAttribI2iEXT\0"
- "glVertexAttribI2ivEXT\0"
- "glVertexAttribI2uiEXT\0"
- "glVertexAttribI2uivEXT\0"
- "glVertexAttribI3iEXT\0"
- "glVertexAttribI3ivEXT\0"
- "glVertexAttribI3uiEXT\0"
- "glVertexAttribI3uivEXT\0"
- "glVertexAttribI4bvEXT\0"
- "glVertexAttribI4iEXT\0"
- "glVertexAttribI4ivEXT\0"
- "glVertexAttribI4svEXT\0"
- "glVertexAttribI4ubvEXT\0"
- "glVertexAttribI4uiEXT\0"
- "glVertexAttribI4uivEXT\0"
- "glVertexAttribI4usvEXT\0"
- "glVertexAttribIPointerEXT\0"
- "glFramebufferTextureLayerEXT\0"
- "glColorMaskIndexedEXT\0"
- "glDisableIndexedEXT\0"
- "glEnableIndexedEXT\0"
- "glGetBooleanIndexedvEXT\0"
- "glGetIntegerIndexedvEXT\0"
- "glIsEnabledIndexedEXT\0"
- "glClearColorIiEXT\0"
- "glClearColorIuiEXT\0"
- "glGetTexParameterIivEXT\0"
- "glGetTexParameterIuivEXT\0"
- "glTexParameterIivEXT\0"
- "glTexParameterIuivEXT\0"
- "glBeginConditionalRenderNV\0"
- "glEndConditionalRenderNV\0"
- "glBeginTransformFeedbackEXT\0"
- "glBindBufferBaseEXT\0"
- "glBindBufferOffsetEXT\0"
- "glBindBufferRangeEXT\0"
- "glEndTransformFeedbackEXT\0"
- "glGetTransformFeedbackVaryingEXT\0"
- "glTransformFeedbackVaryingsEXT\0"
- "glProvokingVertexEXT\0"
- "glGetTexParameterPointervAPPLE\0"
- "glTextureRangeAPPLE\0"
- "glGetObjectParameterivAPPLE\0"
- "glObjectPurgeableAPPLE\0"
- "glObjectUnpurgeableAPPLE\0"
- "glActiveProgramEXT\0"
- "glCreateShaderProgramEXT\0"
- "glUseShaderProgramEXT\0"
- "glTextureBarrierNV\0"
- "glStencilFuncSeparateATI\0"
- "glProgramEnvParameters4fvEXT\0"
- "glProgramLocalParameters4fvEXT\0"
- "glGetQueryObjecti64vEXT\0"
- "glGetQueryObjectui64vEXT\0"
- "glEGLImageTargetRenderbufferStorageOES\0"
- "glEGLImageTargetTexture2DOES\0"
- "glArrayElementEXT\0"
- "glBindTextureEXT\0"
- "glDrawArraysEXT\0"
- "glAreTexturesResidentEXT\0"
- "glCopyTexImage1DEXT\0"
- "glCopyTexImage2DEXT\0"
- "glCopyTexSubImage1DEXT\0"
- "glCopyTexSubImage2DEXT\0"
- "glDeleteTexturesEXT\0"
- "glGenTexturesEXT\0"
- "glGetPointervEXT\0"
- "glIsTextureEXT\0"
- "glPrioritizeTexturesEXT\0"
- "glTexSubImage1DEXT\0"
- "glTexSubImage2DEXT\0"
- "glBlendColorEXT\0"
- "glBlendEquationEXT\0"
- "glDrawRangeElementsEXT\0"
- "glColorTableSGI\0"
- "glColorTableEXT\0"
- "glColorTableParameterfvSGI\0"
- "glColorTableParameterivSGI\0"
- "glCopyColorTableSGI\0"
- "glGetColorTableSGI\0"
- "glGetColorTableEXT\0"
- "glGetColorTableParameterfvSGI\0"
- "glGetColorTableParameterfvEXT\0"
- "glGetColorTableParameterivSGI\0"
- "glGetColorTableParameterivEXT\0"
- "glColorSubTableEXT\0"
- "glCopyColorSubTableEXT\0"
- "glConvolutionFilter1DEXT\0"
- "glConvolutionFilter2DEXT\0"
- "glConvolutionParameterfEXT\0"
- "glConvolutionParameterfvEXT\0"
- "glConvolutionParameteriEXT\0"
- "glConvolutionParameterivEXT\0"
- "glCopyConvolutionFilter1DEXT\0"
- "glCopyConvolutionFilter2DEXT\0"
- "glGetConvolutionFilterEXT\0"
- "glGetConvolutionParameterfvEXT\0"
- "glGetConvolutionParameterivEXT\0"
- "glGetSeparableFilterEXT\0"
- "glSeparableFilter2DEXT\0"
- "glGetHistogramEXT\0"
- "glGetHistogramParameterfvEXT\0"
- "glGetHistogramParameterivEXT\0"
- "glGetMinmaxEXT\0"
- "glGetMinmaxParameterfvEXT\0"
- "glGetMinmaxParameterivEXT\0"
- "glHistogramEXT\0"
- "glMinmaxEXT\0"
- "glResetHistogramEXT\0"
- "glResetMinmaxEXT\0"
- "glTexImage3DEXT\0"
- "glTexSubImage3DEXT\0"
- "glCopyTexSubImage3DEXT\0"
- "glActiveTexture\0"
- "glClientActiveTexture\0"
- "glMultiTexCoord1d\0"
- "glMultiTexCoord1dv\0"
- "glMultiTexCoord1f\0"
- "glMultiTexCoord1fv\0"
- "glMultiTexCoord1i\0"
- "glMultiTexCoord1iv\0"
- "glMultiTexCoord1s\0"
- "glMultiTexCoord1sv\0"
- "glMultiTexCoord2d\0"
- "glMultiTexCoord2dv\0"
- "glMultiTexCoord2f\0"
- "glMultiTexCoord2fv\0"
- "glMultiTexCoord2i\0"
- "glMultiTexCoord2iv\0"
- "glMultiTexCoord2s\0"
- "glMultiTexCoord2sv\0"
- "glMultiTexCoord3d\0"
- "glMultiTexCoord3dv\0"
- "glMultiTexCoord3f\0"
- "glMultiTexCoord3fv\0"
- "glMultiTexCoord3i\0"
- "glMultiTexCoord3iv\0"
- "glMultiTexCoord3s\0"
- "glMultiTexCoord3sv\0"
- "glMultiTexCoord4d\0"
- "glMultiTexCoord4dv\0"
- "glMultiTexCoord4f\0"
- "glMultiTexCoord4fv\0"
- "glMultiTexCoord4i\0"
- "glMultiTexCoord4iv\0"
- "glMultiTexCoord4s\0"
- "glMultiTexCoord4sv\0"
- "glStencilOpSeparateATI\0"
- "glLoadTransposeMatrixd\0"
- "glLoadTransposeMatrixf\0"
- "glMultTransposeMatrixd\0"
- "glMultTransposeMatrixf\0"
- "glSampleCoverage\0"
- "glCompressedTexImage1D\0"
- "glCompressedTexImage2D\0"
- "glCompressedTexImage3D\0"
- "glCompressedTexSubImage1D\0"
- "glCompressedTexSubImage2D\0"
- "glCompressedTexSubImage3D\0"
- "glGetCompressedTexImage\0"
- "glDisableVertexAttribArray\0"
- "glEnableVertexAttribArray\0"
- "glGetVertexAttribdv\0"
- "glGetVertexAttribfv\0"
- "glGetVertexAttribiv\0"
- "glProgramParameter4dNV\0"
- "glProgramParameter4dvNV\0"
- "glProgramParameter4fNV\0"
- "glProgramParameter4fvNV\0"
- "glVertexAttrib1d\0"
- "glVertexAttrib1dv\0"
- "glVertexAttrib1f\0"
- "glVertexAttrib1fv\0"
- "glVertexAttrib1s\0"
- "glVertexAttrib1sv\0"
- "glVertexAttrib2d\0"
- "glVertexAttrib2dv\0"
- "glVertexAttrib2f\0"
- "glVertexAttrib2fv\0"
- "glVertexAttrib2s\0"
- "glVertexAttrib2sv\0"
- "glVertexAttrib3d\0"
- "glVertexAttrib3dv\0"
- "glVertexAttrib3f\0"
- "glVertexAttrib3fv\0"
- "glVertexAttrib3s\0"
- "glVertexAttrib3sv\0"
- "glVertexAttrib4Nbv\0"
- "glVertexAttrib4Niv\0"
- "glVertexAttrib4Nsv\0"
- "glVertexAttrib4Nub\0"
- "glVertexAttrib4Nubv\0"
- "glVertexAttrib4Nuiv\0"
- "glVertexAttrib4Nusv\0"
- "glVertexAttrib4bv\0"
- "glVertexAttrib4d\0"
- "glVertexAttrib4dv\0"
- "glVertexAttrib4f\0"
- "glVertexAttrib4fv\0"
- "glVertexAttrib4iv\0"
- "glVertexAttrib4s\0"
- "glVertexAttrib4sv\0"
- "glVertexAttrib4ubv\0"
- "glVertexAttrib4uiv\0"
- "glVertexAttrib4usv\0"
- "glVertexAttribPointer\0"
- "glBindBuffer\0"
- "glBufferData\0"
- "glBufferSubData\0"
- "glDeleteBuffers\0"
- "glGenBuffers\0"
- "glGetBufferParameteriv\0"
- "glGetBufferPointerv\0"
- "glGetBufferSubData\0"
- "glIsBuffer\0"
- "glMapBuffer\0"
- "glUnmapBuffer\0"
- "glBeginQuery\0"
- "glDeleteQueries\0"
- "glEndQuery\0"
- "glGenQueries\0"
- "glGetQueryObjectiv\0"
- "glGetQueryObjectuiv\0"
- "glGetQueryiv\0"
- "glIsQuery\0"
- "glCompileShader\0"
- "glGetActiveUniform\0"
- "glGetShaderSource\0"
- "glGetUniformLocation\0"
- "glGetUniformfv\0"
- "glGetUniformiv\0"
- "glLinkProgram\0"
- "glShaderSource\0"
- "glUniform1f\0"
- "glUniform1fv\0"
- "glUniform1i\0"
- "glUniform1iv\0"
- "glUniform2f\0"
- "glUniform2fv\0"
- "glUniform2i\0"
- "glUniform2iv\0"
- "glUniform3f\0"
- "glUniform3fv\0"
- "glUniform3i\0"
- "glUniform3iv\0"
- "glUniform4f\0"
- "glUniform4fv\0"
- "glUniform4i\0"
- "glUniform4iv\0"
- "glUniformMatrix2fv\0"
- "glUniformMatrix3fv\0"
- "glUniformMatrix4fv\0"
- "glUseProgram\0"
- "glValidateProgram\0"
- "glBindAttribLocation\0"
- "glGetActiveAttrib\0"
- "glGetAttribLocation\0"
- "glDrawBuffers\0"
- "glDrawBuffersATI\0"
- "glDrawArraysInstancedEXT\0"
- "glDrawArraysInstanced\0"
- "glDrawElementsInstancedEXT\0"
- "glDrawElementsInstanced\0"
- "glRenderbufferStorageMultisampleEXT\0"
- "glBlendEquationSeparateIndexedAMD\0"
- "glBlendEquationIndexedAMD\0"
- "glBlendFuncSeparateIndexedAMD\0"
- "glBlendFuncIndexedAMD\0"
- "glSampleMaskEXT\0"
- "glSamplePatternEXT\0"
- "glPointParameterf\0"
- "glPointParameterfARB\0"
- "glPointParameterfSGIS\0"
- "glPointParameterfv\0"
- "glPointParameterfvARB\0"
- "glPointParameterfvSGIS\0"
- "glSecondaryColor3b\0"
- "glSecondaryColor3bv\0"
- "glSecondaryColor3d\0"
- "glSecondaryColor3dv\0"
- "glSecondaryColor3f\0"
- "glSecondaryColor3fv\0"
- "glSecondaryColor3i\0"
- "glSecondaryColor3iv\0"
- "glSecondaryColor3s\0"
- "glSecondaryColor3sv\0"
- "glSecondaryColor3ub\0"
- "glSecondaryColor3ubv\0"
- "glSecondaryColor3ui\0"
- "glSecondaryColor3uiv\0"
- "glSecondaryColor3us\0"
- "glSecondaryColor3usv\0"
- "glSecondaryColorPointer\0"
- "glMultiDrawArrays\0"
- "glMultiDrawElements\0"
- "glFogCoordPointer\0"
- "glFogCoordd\0"
- "glFogCoorddv\0"
- "glFogCoordf\0"
- "glFogCoordfv\0"
- "glBlendFuncSeparate\0"
- "glBlendFuncSeparateINGR\0"
- "glWindowPos2d\0"
- "glWindowPos2dARB\0"
- "glWindowPos2dv\0"
- "glWindowPos2dvARB\0"
- "glWindowPos2f\0"
- "glWindowPos2fARB\0"
- "glWindowPos2fv\0"
- "glWindowPos2fvARB\0"
- "glWindowPos2i\0"
- "glWindowPos2iARB\0"
- "glWindowPos2iv\0"
- "glWindowPos2ivARB\0"
- "glWindowPos2s\0"
- "glWindowPos2sARB\0"
- "glWindowPos2sv\0"
- "glWindowPos2svARB\0"
- "glWindowPos3d\0"
- "glWindowPos3dARB\0"
- "glWindowPos3dv\0"
- "glWindowPos3dvARB\0"
- "glWindowPos3f\0"
- "glWindowPos3fARB\0"
- "glWindowPos3fv\0"
- "glWindowPos3fvARB\0"
- "glWindowPos3i\0"
- "glWindowPos3iARB\0"
- "glWindowPos3iv\0"
- "glWindowPos3ivARB\0"
- "glWindowPos3s\0"
- "glWindowPos3sARB\0"
- "glWindowPos3sv\0"
- "glWindowPos3svARB\0"
- "glBindProgramARB\0"
- "glDeleteProgramsARB\0"
- "glGenProgramsARB\0"
- "glGetVertexAttribPointerv\0"
- "glGetVertexAttribPointervARB\0"
- "glIsProgramARB\0"
- "glPointParameteri\0"
- "glPointParameteriv\0"
- "glDeleteVertexArrays\0"
- "glIsVertexArray\0"
- "glPrimitiveRestartIndex\0"
- "glBlendEquationSeparate\0"
- "glBlendEquationSeparateATI\0"
- "glBindFramebuffer\0"
- "glBindRenderbuffer\0"
- "glCheckFramebufferStatus\0"
- "glDeleteFramebuffers\0"
- "glDeleteRenderbuffers\0"
- "glFramebufferRenderbuffer\0"
- "glFramebufferTexture1D\0"
- "glFramebufferTexture2D\0"
- "glFramebufferTexture3D\0"
- "glGenFramebuffers\0"
- "glGenRenderbuffers\0"
- "glGenerateMipmap\0"
- "glGetFramebufferAttachmentParameteriv\0"
- "glGetRenderbufferParameteriv\0"
- "glIsFramebuffer\0"
- "glIsRenderbuffer\0"
- "glRenderbufferStorage\0"
- "glBlitFramebuffer\0"
- "glBindFragDataLocation\0"
- "glGetFragDataLocation\0"
- "glGetUniformuiv\0"
- "glGetVertexAttribIiv\0"
- "glGetVertexAttribIuiv\0"
- "glUniform1ui\0"
- "glUniform1uiv\0"
- "glUniform2ui\0"
- "glUniform2uiv\0"
- "glUniform3ui\0"
- "glUniform3uiv\0"
- "glUniform4ui\0"
- "glUniform4uiv\0"
- "glVertexAttribI1i\0"
- "glVertexAttribI1iv\0"
- "glVertexAttribI1ui\0"
- "glVertexAttribI1uiv\0"
- "glVertexAttribI2i\0"
- "glVertexAttribI2iv\0"
- "glVertexAttribI2ui\0"
- "glVertexAttribI2uiv\0"
- "glVertexAttribI3i\0"
- "glVertexAttribI3iv\0"
- "glVertexAttribI3ui\0"
- "glVertexAttribI3uiv\0"
- "glVertexAttribI4bv\0"
- "glVertexAttribI4i\0"
- "glVertexAttribI4iv\0"
- "glVertexAttribI4sv\0"
- "glVertexAttribI4ubv\0"
- "glVertexAttribI4ui\0"
- "glVertexAttribI4uiv\0"
- "glVertexAttribI4usv\0"
- "glVertexAttribIPointer\0"
- "glFramebufferTextureLayer\0"
- "glColorMaski\0"
- "glDisablei\0"
- "glEnablei\0"
- "glGetBooleani_v\0"
- "glGetIntegeri_v\0"
- "glIsEnabledi\0"
- "glGetTexParameterIiv\0"
- "glGetTexParameterIuiv\0"
- "glTexParameterIiv\0"
- "glTexParameterIuiv\0"
- "glBeginConditionalRender\0"
- "glEndConditionalRender\0"
- "glBeginTransformFeedback\0"
- "glBindBufferBase\0"
- "glBindBufferRange\0"
- "glEndTransformFeedback\0"
- "glGetTransformFeedbackVarying\0"
- "glTransformFeedbackVaryings\0"
- "glProvokingVertex\0"
- ;
-
-
-#ifdef USE_MGL_NAMESPACE
-#define gl_dispatch_stub_343 mgl_dispatch_stub_343
-#define gl_dispatch_stub_344 mgl_dispatch_stub_344
-#define gl_dispatch_stub_345 mgl_dispatch_stub_345
-#define gl_dispatch_stub_356 mgl_dispatch_stub_356
-#define gl_dispatch_stub_357 mgl_dispatch_stub_357
-#define gl_dispatch_stub_358 mgl_dispatch_stub_358
-#define gl_dispatch_stub_359 mgl_dispatch_stub_359
-#define gl_dispatch_stub_361 mgl_dispatch_stub_361
-#define gl_dispatch_stub_362 mgl_dispatch_stub_362
-#define gl_dispatch_stub_363 mgl_dispatch_stub_363
-#define gl_dispatch_stub_364 mgl_dispatch_stub_364
-#define gl_dispatch_stub_365 mgl_dispatch_stub_365
-#define gl_dispatch_stub_366 mgl_dispatch_stub_366
-#define gl_dispatch_stub_647 mgl_dispatch_stub_647
-#define gl_dispatch_stub_648 mgl_dispatch_stub_648
-#define gl_dispatch_stub_649 mgl_dispatch_stub_649
-#define gl_dispatch_stub_650 mgl_dispatch_stub_650
-#define gl_dispatch_stub_651 mgl_dispatch_stub_651
-#define gl_dispatch_stub_652 mgl_dispatch_stub_652
-#define gl_dispatch_stub_653 mgl_dispatch_stub_653
-#define gl_dispatch_stub_654 mgl_dispatch_stub_654
-#define gl_dispatch_stub_689 mgl_dispatch_stub_689
-#define gl_dispatch_stub_731 mgl_dispatch_stub_731
-#define gl_dispatch_stub_732 mgl_dispatch_stub_732
-#define gl_dispatch_stub_733 mgl_dispatch_stub_733
-#define gl_dispatch_stub_734 mgl_dispatch_stub_734
-#define gl_dispatch_stub_735 mgl_dispatch_stub_735
-#define gl_dispatch_stub_736 mgl_dispatch_stub_736
-#define gl_dispatch_stub_737 mgl_dispatch_stub_737
-#define gl_dispatch_stub_738 mgl_dispatch_stub_738
-#define gl_dispatch_stub_739 mgl_dispatch_stub_739
-#define gl_dispatch_stub_820 mgl_dispatch_stub_820
-#define gl_dispatch_stub_821 mgl_dispatch_stub_821
-#define gl_dispatch_stub_822 mgl_dispatch_stub_822
-#define gl_dispatch_stub_823 mgl_dispatch_stub_823
-#define gl_dispatch_stub_824 mgl_dispatch_stub_824
-#define gl_dispatch_stub_833 mgl_dispatch_stub_833
-#define gl_dispatch_stub_834 mgl_dispatch_stub_834
-#define gl_dispatch_stub_852 mgl_dispatch_stub_852
-#define gl_dispatch_stub_853 mgl_dispatch_stub_853
-#define gl_dispatch_stub_854 mgl_dispatch_stub_854
-#define gl_dispatch_stub_912 mgl_dispatch_stub_912
-#define gl_dispatch_stub_913 mgl_dispatch_stub_913
-#define gl_dispatch_stub_921 mgl_dispatch_stub_921
-#define gl_dispatch_stub_922 mgl_dispatch_stub_922
-#define gl_dispatch_stub_923 mgl_dispatch_stub_923
-#define gl_dispatch_stub_924 mgl_dispatch_stub_924
-#define gl_dispatch_stub_925 mgl_dispatch_stub_925
-#endif /* USE_MGL_NAMESPACE */
-
-
-#if defined(NEED_FUNCTION_POINTER) || defined(GLX_INDIRECT_RENDERING)
-void GLAPIENTRY gl_dispatch_stub_343(GLenum target, GLenum format, GLenum type, GLvoid * table);
-void GLAPIENTRY gl_dispatch_stub_344(GLenum target, GLenum pname, GLfloat * params);
-void GLAPIENTRY gl_dispatch_stub_345(GLenum target, GLenum pname, GLint * params);
-void GLAPIENTRY gl_dispatch_stub_356(GLenum target, GLenum format, GLenum type, GLvoid * image);
-void GLAPIENTRY gl_dispatch_stub_357(GLenum target, GLenum pname, GLfloat * params);
-void GLAPIENTRY gl_dispatch_stub_358(GLenum target, GLenum pname, GLint * params);
-void GLAPIENTRY gl_dispatch_stub_359(GLenum target, GLenum format, GLenum type, GLvoid * row, GLvoid * column, GLvoid * span);
-void GLAPIENTRY gl_dispatch_stub_361(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid * values);
-void GLAPIENTRY gl_dispatch_stub_362(GLenum target, GLenum pname, GLfloat * params);
-void GLAPIENTRY gl_dispatch_stub_363(GLenum target, GLenum pname, GLint * params);
-void GLAPIENTRY gl_dispatch_stub_364(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid * values);
-void GLAPIENTRY gl_dispatch_stub_365(GLenum target, GLenum pname, GLfloat * params);
-void GLAPIENTRY gl_dispatch_stub_366(GLenum target, GLenum pname, GLint * params);
-void GLAPIENTRY gl_dispatch_stub_647(GLenum pname, GLfloat * params);
-void GLAPIENTRY gl_dispatch_stub_648(GLenum pname, GLint * params);
-void GLAPIENTRY gl_dispatch_stub_649(GLenum pname, GLfloat param);
-void GLAPIENTRY gl_dispatch_stub_650(GLenum pname, const GLfloat * params);
-void GLAPIENTRY gl_dispatch_stub_651(GLenum pname, GLint param);
-void GLAPIENTRY gl_dispatch_stub_652(GLenum pname, const GLint * params);
-void GLAPIENTRY gl_dispatch_stub_653(GLclampf value, GLboolean invert);
-void GLAPIENTRY gl_dispatch_stub_654(GLenum pattern);
-void GLAPIENTRY gl_dispatch_stub_689(GLenum mode);
-void GLAPIENTRY gl_dispatch_stub_731(const GLenum * mode, const GLint * first, const GLsizei * count, GLsizei primcount, GLint modestride);
-void GLAPIENTRY gl_dispatch_stub_732(const GLenum * mode, const GLsizei * count, GLenum type, const GLvoid * const * indices, GLsizei primcount, GLint modestride);
-void GLAPIENTRY gl_dispatch_stub_733(GLsizei n, const GLuint * fences);
-void GLAPIENTRY gl_dispatch_stub_734(GLuint fence);
-void GLAPIENTRY gl_dispatch_stub_735(GLsizei n, GLuint * fences);
-void GLAPIENTRY gl_dispatch_stub_736(GLuint fence, GLenum pname, GLint * params);
-GLboolean GLAPIENTRY gl_dispatch_stub_737(GLuint fence);
-void GLAPIENTRY gl_dispatch_stub_738(GLuint fence, GLenum condition);
-GLboolean GLAPIENTRY gl_dispatch_stub_739(GLuint fence);
-void GLAPIENTRY gl_dispatch_stub_820(GLenum face);
-void GLAPIENTRY gl_dispatch_stub_821(GLuint array);
-void GLAPIENTRY gl_dispatch_stub_822(GLsizei n, const GLuint * arrays);
-void GLAPIENTRY gl_dispatch_stub_823(GLsizei n, GLuint * arrays);
-GLboolean GLAPIENTRY gl_dispatch_stub_824(GLuint array);
-void GLAPIENTRY gl_dispatch_stub_833(GLclampd zmin, GLclampd zmax);
-void GLAPIENTRY gl_dispatch_stub_834(GLenum modeRGB, GLenum modeA);
-void GLAPIENTRY gl_dispatch_stub_852(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
-void GLAPIENTRY gl_dispatch_stub_853(GLenum target, GLenum pname, GLint param);
-void GLAPIENTRY gl_dispatch_stub_854(GLenum target, GLintptr offset, GLsizeiptr size);
-void GLAPIENTRY gl_dispatch_stub_912(GLenum target, GLenum pname, GLvoid ** params);
-void GLAPIENTRY gl_dispatch_stub_913(GLenum target, GLsizei length, GLvoid * pointer);
-void GLAPIENTRY gl_dispatch_stub_921(GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask);
-void GLAPIENTRY gl_dispatch_stub_922(GLenum target, GLuint index, GLsizei count, const GLfloat * params);
-void GLAPIENTRY gl_dispatch_stub_923(GLenum target, GLuint index, GLsizei count, const GLfloat * params);
-void GLAPIENTRY gl_dispatch_stub_924(GLuint id, GLenum pname, GLint64EXT * params);
-void GLAPIENTRY gl_dispatch_stub_925(GLuint id, GLenum pname, GLuint64EXT * params);
-#endif /* defined(NEED_FUNCTION_POINTER) || defined(GLX_INDIRECT_RENDERING) */
-
-static const glprocs_table_t static_functions[] = {
- NAME_FUNC_OFFSET( 0, glNewList, glNewList, NULL, 0),
- NAME_FUNC_OFFSET( 10, glEndList, glEndList, NULL, 1),
- NAME_FUNC_OFFSET( 20, glCallList, glCallList, NULL, 2),
- NAME_FUNC_OFFSET( 31, glCallLists, glCallLists, NULL, 3),
- NAME_FUNC_OFFSET( 43, glDeleteLists, glDeleteLists, NULL, 4),
- NAME_FUNC_OFFSET( 57, glGenLists, glGenLists, NULL, 5),
- NAME_FUNC_OFFSET( 68, glListBase, glListBase, NULL, 6),
- NAME_FUNC_OFFSET( 79, glBegin, glBegin, NULL, 7),
- NAME_FUNC_OFFSET( 87, glBitmap, glBitmap, NULL, 8),
- NAME_FUNC_OFFSET( 96, glColor3b, glColor3b, NULL, 9),
- NAME_FUNC_OFFSET( 106, glColor3bv, glColor3bv, NULL, 10),
- NAME_FUNC_OFFSET( 117, glColor3d, glColor3d, NULL, 11),
- NAME_FUNC_OFFSET( 127, glColor3dv, glColor3dv, NULL, 12),
- NAME_FUNC_OFFSET( 138, glColor3f, glColor3f, NULL, 13),
- NAME_FUNC_OFFSET( 148, glColor3fv, glColor3fv, NULL, 14),
- NAME_FUNC_OFFSET( 159, glColor3i, glColor3i, NULL, 15),
- NAME_FUNC_OFFSET( 169, glColor3iv, glColor3iv, NULL, 16),
- NAME_FUNC_OFFSET( 180, glColor3s, glColor3s, NULL, 17),
- NAME_FUNC_OFFSET( 190, glColor3sv, glColor3sv, NULL, 18),
- NAME_FUNC_OFFSET( 201, glColor3ub, glColor3ub, NULL, 19),
- NAME_FUNC_OFFSET( 212, glColor3ubv, glColor3ubv, NULL, 20),
- NAME_FUNC_OFFSET( 224, glColor3ui, glColor3ui, NULL, 21),
- NAME_FUNC_OFFSET( 235, glColor3uiv, glColor3uiv, NULL, 22),
- NAME_FUNC_OFFSET( 247, glColor3us, glColor3us, NULL, 23),
- NAME_FUNC_OFFSET( 258, glColor3usv, glColor3usv, NULL, 24),
- NAME_FUNC_OFFSET( 270, glColor4b, glColor4b, NULL, 25),
- NAME_FUNC_OFFSET( 280, glColor4bv, glColor4bv, NULL, 26),
- NAME_FUNC_OFFSET( 291, glColor4d, glColor4d, NULL, 27),
- NAME_FUNC_OFFSET( 301, glColor4dv, glColor4dv, NULL, 28),
- NAME_FUNC_OFFSET( 312, glColor4f, glColor4f, NULL, 29),
- NAME_FUNC_OFFSET( 322, glColor4fv, glColor4fv, NULL, 30),
- NAME_FUNC_OFFSET( 333, glColor4i, glColor4i, NULL, 31),
- NAME_FUNC_OFFSET( 343, glColor4iv, glColor4iv, NULL, 32),
- NAME_FUNC_OFFSET( 354, glColor4s, glColor4s, NULL, 33),
- NAME_FUNC_OFFSET( 364, glColor4sv, glColor4sv, NULL, 34),
- NAME_FUNC_OFFSET( 375, glColor4ub, glColor4ub, NULL, 35),
- NAME_FUNC_OFFSET( 386, glColor4ubv, glColor4ubv, NULL, 36),
- NAME_FUNC_OFFSET( 398, glColor4ui, glColor4ui, NULL, 37),
- NAME_FUNC_OFFSET( 409, glColor4uiv, glColor4uiv, NULL, 38),
- NAME_FUNC_OFFSET( 421, glColor4us, glColor4us, NULL, 39),
- NAME_FUNC_OFFSET( 432, glColor4usv, glColor4usv, NULL, 40),
- NAME_FUNC_OFFSET( 444, glEdgeFlag, glEdgeFlag, NULL, 41),
- NAME_FUNC_OFFSET( 455, glEdgeFlagv, glEdgeFlagv, NULL, 42),
- NAME_FUNC_OFFSET( 467, glEnd, glEnd, NULL, 43),
- NAME_FUNC_OFFSET( 473, glIndexd, glIndexd, NULL, 44),
- NAME_FUNC_OFFSET( 482, glIndexdv, glIndexdv, NULL, 45),
- NAME_FUNC_OFFSET( 492, glIndexf, glIndexf, NULL, 46),
- NAME_FUNC_OFFSET( 501, glIndexfv, glIndexfv, NULL, 47),
- NAME_FUNC_OFFSET( 511, glIndexi, glIndexi, NULL, 48),
- NAME_FUNC_OFFSET( 520, glIndexiv, glIndexiv, NULL, 49),
- NAME_FUNC_OFFSET( 530, glIndexs, glIndexs, NULL, 50),
- NAME_FUNC_OFFSET( 539, glIndexsv, glIndexsv, NULL, 51),
- NAME_FUNC_OFFSET( 549, glNormal3b, glNormal3b, NULL, 52),
- NAME_FUNC_OFFSET( 560, glNormal3bv, glNormal3bv, NULL, 53),
- NAME_FUNC_OFFSET( 572, glNormal3d, glNormal3d, NULL, 54),
- NAME_FUNC_OFFSET( 583, glNormal3dv, glNormal3dv, NULL, 55),
- NAME_FUNC_OFFSET( 595, glNormal3f, glNormal3f, NULL, 56),
- NAME_FUNC_OFFSET( 606, glNormal3fv, glNormal3fv, NULL, 57),
- NAME_FUNC_OFFSET( 618, glNormal3i, glNormal3i, NULL, 58),
- NAME_FUNC_OFFSET( 629, glNormal3iv, glNormal3iv, NULL, 59),
- NAME_FUNC_OFFSET( 641, glNormal3s, glNormal3s, NULL, 60),
- NAME_FUNC_OFFSET( 652, glNormal3sv, glNormal3sv, NULL, 61),
- NAME_FUNC_OFFSET( 664, glRasterPos2d, glRasterPos2d, NULL, 62),
- NAME_FUNC_OFFSET( 678, glRasterPos2dv, glRasterPos2dv, NULL, 63),
- NAME_FUNC_OFFSET( 693, glRasterPos2f, glRasterPos2f, NULL, 64),
- NAME_FUNC_OFFSET( 707, glRasterPos2fv, glRasterPos2fv, NULL, 65),
- NAME_FUNC_OFFSET( 722, glRasterPos2i, glRasterPos2i, NULL, 66),
- NAME_FUNC_OFFSET( 736, glRasterPos2iv, glRasterPos2iv, NULL, 67),
- NAME_FUNC_OFFSET( 751, glRasterPos2s, glRasterPos2s, NULL, 68),
- NAME_FUNC_OFFSET( 765, glRasterPos2sv, glRasterPos2sv, NULL, 69),
- NAME_FUNC_OFFSET( 780, glRasterPos3d, glRasterPos3d, NULL, 70),
- NAME_FUNC_OFFSET( 794, glRasterPos3dv, glRasterPos3dv, NULL, 71),
- NAME_FUNC_OFFSET( 809, glRasterPos3f, glRasterPos3f, NULL, 72),
- NAME_FUNC_OFFSET( 823, glRasterPos3fv, glRasterPos3fv, NULL, 73),
- NAME_FUNC_OFFSET( 838, glRasterPos3i, glRasterPos3i, NULL, 74),
- NAME_FUNC_OFFSET( 852, glRasterPos3iv, glRasterPos3iv, NULL, 75),
- NAME_FUNC_OFFSET( 867, glRasterPos3s, glRasterPos3s, NULL, 76),
- NAME_FUNC_OFFSET( 881, glRasterPos3sv, glRasterPos3sv, NULL, 77),
- NAME_FUNC_OFFSET( 896, glRasterPos4d, glRasterPos4d, NULL, 78),
- NAME_FUNC_OFFSET( 910, glRasterPos4dv, glRasterPos4dv, NULL, 79),
- NAME_FUNC_OFFSET( 925, glRasterPos4f, glRasterPos4f, NULL, 80),
- NAME_FUNC_OFFSET( 939, glRasterPos4fv, glRasterPos4fv, NULL, 81),
- NAME_FUNC_OFFSET( 954, glRasterPos4i, glRasterPos4i, NULL, 82),
- NAME_FUNC_OFFSET( 968, glRasterPos4iv, glRasterPos4iv, NULL, 83),
- NAME_FUNC_OFFSET( 983, glRasterPos4s, glRasterPos4s, NULL, 84),
- NAME_FUNC_OFFSET( 997, glRasterPos4sv, glRasterPos4sv, NULL, 85),
- NAME_FUNC_OFFSET( 1012, glRectd, glRectd, NULL, 86),
- NAME_FUNC_OFFSET( 1020, glRectdv, glRectdv, NULL, 87),
- NAME_FUNC_OFFSET( 1029, glRectf, glRectf, NULL, 88),
- NAME_FUNC_OFFSET( 1037, glRectfv, glRectfv, NULL, 89),
- NAME_FUNC_OFFSET( 1046, glRecti, glRecti, NULL, 90),
- NAME_FUNC_OFFSET( 1054, glRectiv, glRectiv, NULL, 91),
- NAME_FUNC_OFFSET( 1063, glRects, glRects, NULL, 92),
- NAME_FUNC_OFFSET( 1071, glRectsv, glRectsv, NULL, 93),
- NAME_FUNC_OFFSET( 1080, glTexCoord1d, glTexCoord1d, NULL, 94),
- NAME_FUNC_OFFSET( 1093, glTexCoord1dv, glTexCoord1dv, NULL, 95),
- NAME_FUNC_OFFSET( 1107, glTexCoord1f, glTexCoord1f, NULL, 96),
- NAME_FUNC_OFFSET( 1120, glTexCoord1fv, glTexCoord1fv, NULL, 97),
- NAME_FUNC_OFFSET( 1134, glTexCoord1i, glTexCoord1i, NULL, 98),
- NAME_FUNC_OFFSET( 1147, glTexCoord1iv, glTexCoord1iv, NULL, 99),
- NAME_FUNC_OFFSET( 1161, glTexCoord1s, glTexCoord1s, NULL, 100),
- NAME_FUNC_OFFSET( 1174, glTexCoord1sv, glTexCoord1sv, NULL, 101),
- NAME_FUNC_OFFSET( 1188, glTexCoord2d, glTexCoord2d, NULL, 102),
- NAME_FUNC_OFFSET( 1201, glTexCoord2dv, glTexCoord2dv, NULL, 103),
- NAME_FUNC_OFFSET( 1215, glTexCoord2f, glTexCoord2f, NULL, 104),
- NAME_FUNC_OFFSET( 1228, glTexCoord2fv, glTexCoord2fv, NULL, 105),
- NAME_FUNC_OFFSET( 1242, glTexCoord2i, glTexCoord2i, NULL, 106),
- NAME_FUNC_OFFSET( 1255, glTexCoord2iv, glTexCoord2iv, NULL, 107),
- NAME_FUNC_OFFSET( 1269, glTexCoord2s, glTexCoord2s, NULL, 108),
- NAME_FUNC_OFFSET( 1282, glTexCoord2sv, glTexCoord2sv, NULL, 109),
- NAME_FUNC_OFFSET( 1296, glTexCoord3d, glTexCoord3d, NULL, 110),
- NAME_FUNC_OFFSET( 1309, glTexCoord3dv, glTexCoord3dv, NULL, 111),
- NAME_FUNC_OFFSET( 1323, glTexCoord3f, glTexCoord3f, NULL, 112),
- NAME_FUNC_OFFSET( 1336, glTexCoord3fv, glTexCoord3fv, NULL, 113),
- NAME_FUNC_OFFSET( 1350, glTexCoord3i, glTexCoord3i, NULL, 114),
- NAME_FUNC_OFFSET( 1363, glTexCoord3iv, glTexCoord3iv, NULL, 115),
- NAME_FUNC_OFFSET( 1377, glTexCoord3s, glTexCoord3s, NULL, 116),
- NAME_FUNC_OFFSET( 1390, glTexCoord3sv, glTexCoord3sv, NULL, 117),
- NAME_FUNC_OFFSET( 1404, glTexCoord4d, glTexCoord4d, NULL, 118),
- NAME_FUNC_OFFSET( 1417, glTexCoord4dv, glTexCoord4dv, NULL, 119),
- NAME_FUNC_OFFSET( 1431, glTexCoord4f, glTexCoord4f, NULL, 120),
- NAME_FUNC_OFFSET( 1444, glTexCoord4fv, glTexCoord4fv, NULL, 121),
- NAME_FUNC_OFFSET( 1458, glTexCoord4i, glTexCoord4i, NULL, 122),
- NAME_FUNC_OFFSET( 1471, glTexCoord4iv, glTexCoord4iv, NULL, 123),
- NAME_FUNC_OFFSET( 1485, glTexCoord4s, glTexCoord4s, NULL, 124),
- NAME_FUNC_OFFSET( 1498, glTexCoord4sv, glTexCoord4sv, NULL, 125),
- NAME_FUNC_OFFSET( 1512, glVertex2d, glVertex2d, NULL, 126),
- NAME_FUNC_OFFSET( 1523, glVertex2dv, glVertex2dv, NULL, 127),
- NAME_FUNC_OFFSET( 1535, glVertex2f, glVertex2f, NULL, 128),
- NAME_FUNC_OFFSET( 1546, glVertex2fv, glVertex2fv, NULL, 129),
- NAME_FUNC_OFFSET( 1558, glVertex2i, glVertex2i, NULL, 130),
- NAME_FUNC_OFFSET( 1569, glVertex2iv, glVertex2iv, NULL, 131),
- NAME_FUNC_OFFSET( 1581, glVertex2s, glVertex2s, NULL, 132),
- NAME_FUNC_OFFSET( 1592, glVertex2sv, glVertex2sv, NULL, 133),
- NAME_FUNC_OFFSET( 1604, glVertex3d, glVertex3d, NULL, 134),
- NAME_FUNC_OFFSET( 1615, glVertex3dv, glVertex3dv, NULL, 135),
- NAME_FUNC_OFFSET( 1627, glVertex3f, glVertex3f, NULL, 136),
- NAME_FUNC_OFFSET( 1638, glVertex3fv, glVertex3fv, NULL, 137),
- NAME_FUNC_OFFSET( 1650, glVertex3i, glVertex3i, NULL, 138),
- NAME_FUNC_OFFSET( 1661, glVertex3iv, glVertex3iv, NULL, 139),
- NAME_FUNC_OFFSET( 1673, glVertex3s, glVertex3s, NULL, 140),
- NAME_FUNC_OFFSET( 1684, glVertex3sv, glVertex3sv, NULL, 141),
- NAME_FUNC_OFFSET( 1696, glVertex4d, glVertex4d, NULL, 142),
- NAME_FUNC_OFFSET( 1707, glVertex4dv, glVertex4dv, NULL, 143),
- NAME_FUNC_OFFSET( 1719, glVertex4f, glVertex4f, NULL, 144),
- NAME_FUNC_OFFSET( 1730, glVertex4fv, glVertex4fv, NULL, 145),
- NAME_FUNC_OFFSET( 1742, glVertex4i, glVertex4i, NULL, 146),
- NAME_FUNC_OFFSET( 1753, glVertex4iv, glVertex4iv, NULL, 147),
- NAME_FUNC_OFFSET( 1765, glVertex4s, glVertex4s, NULL, 148),
- NAME_FUNC_OFFSET( 1776, glVertex4sv, glVertex4sv, NULL, 149),
- NAME_FUNC_OFFSET( 1788, glClipPlane, glClipPlane, NULL, 150),
- NAME_FUNC_OFFSET( 1800, glColorMaterial, glColorMaterial, NULL, 151),
- NAME_FUNC_OFFSET( 1816, glCullFace, glCullFace, NULL, 152),
- NAME_FUNC_OFFSET( 1827, glFogf, glFogf, NULL, 153),
- NAME_FUNC_OFFSET( 1834, glFogfv, glFogfv, NULL, 154),
- NAME_FUNC_OFFSET( 1842, glFogi, glFogi, NULL, 155),
- NAME_FUNC_OFFSET( 1849, glFogiv, glFogiv, NULL, 156),
- NAME_FUNC_OFFSET( 1857, glFrontFace, glFrontFace, NULL, 157),
- NAME_FUNC_OFFSET( 1869, glHint, glHint, NULL, 158),
- NAME_FUNC_OFFSET( 1876, glLightf, glLightf, NULL, 159),
- NAME_FUNC_OFFSET( 1885, glLightfv, glLightfv, NULL, 160),
- NAME_FUNC_OFFSET( 1895, glLighti, glLighti, NULL, 161),
- NAME_FUNC_OFFSET( 1904, glLightiv, glLightiv, NULL, 162),
- NAME_FUNC_OFFSET( 1914, glLightModelf, glLightModelf, NULL, 163),
- NAME_FUNC_OFFSET( 1928, glLightModelfv, glLightModelfv, NULL, 164),
- NAME_FUNC_OFFSET( 1943, glLightModeli, glLightModeli, NULL, 165),
- NAME_FUNC_OFFSET( 1957, glLightModeliv, glLightModeliv, NULL, 166),
- NAME_FUNC_OFFSET( 1972, glLineStipple, glLineStipple, NULL, 167),
- NAME_FUNC_OFFSET( 1986, glLineWidth, glLineWidth, NULL, 168),
- NAME_FUNC_OFFSET( 1998, glMaterialf, glMaterialf, NULL, 169),
- NAME_FUNC_OFFSET( 2010, glMaterialfv, glMaterialfv, NULL, 170),
- NAME_FUNC_OFFSET( 2023, glMateriali, glMateriali, NULL, 171),
- NAME_FUNC_OFFSET( 2035, glMaterialiv, glMaterialiv, NULL, 172),
- NAME_FUNC_OFFSET( 2048, glPointSize, glPointSize, NULL, 173),
- NAME_FUNC_OFFSET( 2060, glPolygonMode, glPolygonMode, NULL, 174),
- NAME_FUNC_OFFSET( 2074, glPolygonStipple, glPolygonStipple, NULL, 175),
- NAME_FUNC_OFFSET( 2091, glScissor, glScissor, NULL, 176),
- NAME_FUNC_OFFSET( 2101, glShadeModel, glShadeModel, NULL, 177),
- NAME_FUNC_OFFSET( 2114, glTexParameterf, glTexParameterf, NULL, 178),
- NAME_FUNC_OFFSET( 2130, glTexParameterfv, glTexParameterfv, NULL, 179),
- NAME_FUNC_OFFSET( 2147, glTexParameteri, glTexParameteri, NULL, 180),
- NAME_FUNC_OFFSET( 2163, glTexParameteriv, glTexParameteriv, NULL, 181),
- NAME_FUNC_OFFSET( 2180, glTexImage1D, glTexImage1D, NULL, 182),
- NAME_FUNC_OFFSET( 2193, glTexImage2D, glTexImage2D, NULL, 183),
- NAME_FUNC_OFFSET( 2206, glTexEnvf, glTexEnvf, NULL, 184),
- NAME_FUNC_OFFSET( 2216, glTexEnvfv, glTexEnvfv, NULL, 185),
- NAME_FUNC_OFFSET( 2227, glTexEnvi, glTexEnvi, NULL, 186),
- NAME_FUNC_OFFSET( 2237, glTexEnviv, glTexEnviv, NULL, 187),
- NAME_FUNC_OFFSET( 2248, glTexGend, glTexGend, NULL, 188),
- NAME_FUNC_OFFSET( 2258, glTexGendv, glTexGendv, NULL, 189),
- NAME_FUNC_OFFSET( 2269, glTexGenf, glTexGenf, NULL, 190),
- NAME_FUNC_OFFSET( 2279, glTexGenfv, glTexGenfv, NULL, 191),
- NAME_FUNC_OFFSET( 2290, glTexGeni, glTexGeni, NULL, 192),
- NAME_FUNC_OFFSET( 2300, glTexGeniv, glTexGeniv, NULL, 193),
- NAME_FUNC_OFFSET( 2311, glFeedbackBuffer, glFeedbackBuffer, NULL, 194),
- NAME_FUNC_OFFSET( 2328, glSelectBuffer, glSelectBuffer, NULL, 195),
- NAME_FUNC_OFFSET( 2343, glRenderMode, glRenderMode, NULL, 196),
- NAME_FUNC_OFFSET( 2356, glInitNames, glInitNames, NULL, 197),
- NAME_FUNC_OFFSET( 2368, glLoadName, glLoadName, NULL, 198),
- NAME_FUNC_OFFSET( 2379, glPassThrough, glPassThrough, NULL, 199),
- NAME_FUNC_OFFSET( 2393, glPopName, glPopName, NULL, 200),
- NAME_FUNC_OFFSET( 2403, glPushName, glPushName, NULL, 201),
- NAME_FUNC_OFFSET( 2414, glDrawBuffer, glDrawBuffer, NULL, 202),
- NAME_FUNC_OFFSET( 2427, glClear, glClear, NULL, 203),
- NAME_FUNC_OFFSET( 2435, glClearAccum, glClearAccum, NULL, 204),
- NAME_FUNC_OFFSET( 2448, glClearIndex, glClearIndex, NULL, 205),
- NAME_FUNC_OFFSET( 2461, glClearColor, glClearColor, NULL, 206),
- NAME_FUNC_OFFSET( 2474, glClearStencil, glClearStencil, NULL, 207),
- NAME_FUNC_OFFSET( 2489, glClearDepth, glClearDepth, NULL, 208),
- NAME_FUNC_OFFSET( 2502, glStencilMask, glStencilMask, NULL, 209),
- NAME_FUNC_OFFSET( 2516, glColorMask, glColorMask, NULL, 210),
- NAME_FUNC_OFFSET( 2528, glDepthMask, glDepthMask, NULL, 211),
- NAME_FUNC_OFFSET( 2540, glIndexMask, glIndexMask, NULL, 212),
- NAME_FUNC_OFFSET( 2552, glAccum, glAccum, NULL, 213),
- NAME_FUNC_OFFSET( 2560, glDisable, glDisable, NULL, 214),
- NAME_FUNC_OFFSET( 2570, glEnable, glEnable, NULL, 215),
- NAME_FUNC_OFFSET( 2579, glFinish, glFinish, NULL, 216),
- NAME_FUNC_OFFSET( 2588, glFlush, glFlush, NULL, 217),
- NAME_FUNC_OFFSET( 2596, glPopAttrib, glPopAttrib, NULL, 218),
- NAME_FUNC_OFFSET( 2608, glPushAttrib, glPushAttrib, NULL, 219),
- NAME_FUNC_OFFSET( 2621, glMap1d, glMap1d, NULL, 220),
- NAME_FUNC_OFFSET( 2629, glMap1f, glMap1f, NULL, 221),
- NAME_FUNC_OFFSET( 2637, glMap2d, glMap2d, NULL, 222),
- NAME_FUNC_OFFSET( 2645, glMap2f, glMap2f, NULL, 223),
- NAME_FUNC_OFFSET( 2653, glMapGrid1d, glMapGrid1d, NULL, 224),
- NAME_FUNC_OFFSET( 2665, glMapGrid1f, glMapGrid1f, NULL, 225),
- NAME_FUNC_OFFSET( 2677, glMapGrid2d, glMapGrid2d, NULL, 226),
- NAME_FUNC_OFFSET( 2689, glMapGrid2f, glMapGrid2f, NULL, 227),
- NAME_FUNC_OFFSET( 2701, glEvalCoord1d, glEvalCoord1d, NULL, 228),
- NAME_FUNC_OFFSET( 2715, glEvalCoord1dv, glEvalCoord1dv, NULL, 229),
- NAME_FUNC_OFFSET( 2730, glEvalCoord1f, glEvalCoord1f, NULL, 230),
- NAME_FUNC_OFFSET( 2744, glEvalCoord1fv, glEvalCoord1fv, NULL, 231),
- NAME_FUNC_OFFSET( 2759, glEvalCoord2d, glEvalCoord2d, NULL, 232),
- NAME_FUNC_OFFSET( 2773, glEvalCoord2dv, glEvalCoord2dv, NULL, 233),
- NAME_FUNC_OFFSET( 2788, glEvalCoord2f, glEvalCoord2f, NULL, 234),
- NAME_FUNC_OFFSET( 2802, glEvalCoord2fv, glEvalCoord2fv, NULL, 235),
- NAME_FUNC_OFFSET( 2817, glEvalMesh1, glEvalMesh1, NULL, 236),
- NAME_FUNC_OFFSET( 2829, glEvalPoint1, glEvalPoint1, NULL, 237),
- NAME_FUNC_OFFSET( 2842, glEvalMesh2, glEvalMesh2, NULL, 238),
- NAME_FUNC_OFFSET( 2854, glEvalPoint2, glEvalPoint2, NULL, 239),
- NAME_FUNC_OFFSET( 2867, glAlphaFunc, glAlphaFunc, NULL, 240),
- NAME_FUNC_OFFSET( 2879, glBlendFunc, glBlendFunc, NULL, 241),
- NAME_FUNC_OFFSET( 2891, glLogicOp, glLogicOp, NULL, 242),
- NAME_FUNC_OFFSET( 2901, glStencilFunc, glStencilFunc, NULL, 243),
- NAME_FUNC_OFFSET( 2915, glStencilOp, glStencilOp, NULL, 244),
- NAME_FUNC_OFFSET( 2927, glDepthFunc, glDepthFunc, NULL, 245),
- NAME_FUNC_OFFSET( 2939, glPixelZoom, glPixelZoom, NULL, 246),
- NAME_FUNC_OFFSET( 2951, glPixelTransferf, glPixelTransferf, NULL, 247),
- NAME_FUNC_OFFSET( 2968, glPixelTransferi, glPixelTransferi, NULL, 248),
- NAME_FUNC_OFFSET( 2985, glPixelStoref, glPixelStoref, NULL, 249),
- NAME_FUNC_OFFSET( 2999, glPixelStorei, glPixelStorei, NULL, 250),
- NAME_FUNC_OFFSET( 3013, glPixelMapfv, glPixelMapfv, NULL, 251),
- NAME_FUNC_OFFSET( 3026, glPixelMapuiv, glPixelMapuiv, NULL, 252),
- NAME_FUNC_OFFSET( 3040, glPixelMapusv, glPixelMapusv, NULL, 253),
- NAME_FUNC_OFFSET( 3054, glReadBuffer, glReadBuffer, NULL, 254),
- NAME_FUNC_OFFSET( 3067, glCopyPixels, glCopyPixels, NULL, 255),
- NAME_FUNC_OFFSET( 3080, glReadPixels, glReadPixels, NULL, 256),
- NAME_FUNC_OFFSET( 3093, glDrawPixels, glDrawPixels, NULL, 257),
- NAME_FUNC_OFFSET( 3106, glGetBooleanv, glGetBooleanv, NULL, 258),
- NAME_FUNC_OFFSET( 3120, glGetClipPlane, glGetClipPlane, NULL, 259),
- NAME_FUNC_OFFSET( 3135, glGetDoublev, glGetDoublev, NULL, 260),
- NAME_FUNC_OFFSET( 3148, glGetError, glGetError, NULL, 261),
- NAME_FUNC_OFFSET( 3159, glGetFloatv, glGetFloatv, NULL, 262),
- NAME_FUNC_OFFSET( 3171, glGetIntegerv, glGetIntegerv, NULL, 263),
- NAME_FUNC_OFFSET( 3185, glGetLightfv, glGetLightfv, NULL, 264),
- NAME_FUNC_OFFSET( 3198, glGetLightiv, glGetLightiv, NULL, 265),
- NAME_FUNC_OFFSET( 3211, glGetMapdv, glGetMapdv, NULL, 266),
- NAME_FUNC_OFFSET( 3222, glGetMapfv, glGetMapfv, NULL, 267),
- NAME_FUNC_OFFSET( 3233, glGetMapiv, glGetMapiv, NULL, 268),
- NAME_FUNC_OFFSET( 3244, glGetMaterialfv, glGetMaterialfv, NULL, 269),
- NAME_FUNC_OFFSET( 3260, glGetMaterialiv, glGetMaterialiv, NULL, 270),
- NAME_FUNC_OFFSET( 3276, glGetPixelMapfv, glGetPixelMapfv, NULL, 271),
- NAME_FUNC_OFFSET( 3292, glGetPixelMapuiv, glGetPixelMapuiv, NULL, 272),
- NAME_FUNC_OFFSET( 3309, glGetPixelMapusv, glGetPixelMapusv, NULL, 273),
- NAME_FUNC_OFFSET( 3326, glGetPolygonStipple, glGetPolygonStipple, NULL, 274),
- NAME_FUNC_OFFSET( 3346, glGetString, glGetString, NULL, 275),
- NAME_FUNC_OFFSET( 3358, glGetTexEnvfv, glGetTexEnvfv, NULL, 276),
- NAME_FUNC_OFFSET( 3372, glGetTexEnviv, glGetTexEnviv, NULL, 277),
- NAME_FUNC_OFFSET( 3386, glGetTexGendv, glGetTexGendv, NULL, 278),
- NAME_FUNC_OFFSET( 3400, glGetTexGenfv, glGetTexGenfv, NULL, 279),
- NAME_FUNC_OFFSET( 3414, glGetTexGeniv, glGetTexGeniv, NULL, 280),
- NAME_FUNC_OFFSET( 3428, glGetTexImage, glGetTexImage, NULL, 281),
- NAME_FUNC_OFFSET( 3442, glGetTexParameterfv, glGetTexParameterfv, NULL, 282),
- NAME_FUNC_OFFSET( 3462, glGetTexParameteriv, glGetTexParameteriv, NULL, 283),
- NAME_FUNC_OFFSET( 3482, glGetTexLevelParameterfv, glGetTexLevelParameterfv, NULL, 284),
- NAME_FUNC_OFFSET( 3507, glGetTexLevelParameteriv, glGetTexLevelParameteriv, NULL, 285),
- NAME_FUNC_OFFSET( 3532, glIsEnabled, glIsEnabled, NULL, 286),
- NAME_FUNC_OFFSET( 3544, glIsList, glIsList, NULL, 287),
- NAME_FUNC_OFFSET( 3553, glDepthRange, glDepthRange, NULL, 288),
- NAME_FUNC_OFFSET( 3566, glFrustum, glFrustum, NULL, 289),
- NAME_FUNC_OFFSET( 3576, glLoadIdentity, glLoadIdentity, NULL, 290),
- NAME_FUNC_OFFSET( 3591, glLoadMatrixf, glLoadMatrixf, NULL, 291),
- NAME_FUNC_OFFSET( 3605, glLoadMatrixd, glLoadMatrixd, NULL, 292),
- NAME_FUNC_OFFSET( 3619, glMatrixMode, glMatrixMode, NULL, 293),
- NAME_FUNC_OFFSET( 3632, glMultMatrixf, glMultMatrixf, NULL, 294),
- NAME_FUNC_OFFSET( 3646, glMultMatrixd, glMultMatrixd, NULL, 295),
- NAME_FUNC_OFFSET( 3660, glOrtho, glOrtho, NULL, 296),
- NAME_FUNC_OFFSET( 3668, glPopMatrix, glPopMatrix, NULL, 297),
- NAME_FUNC_OFFSET( 3680, glPushMatrix, glPushMatrix, NULL, 298),
- NAME_FUNC_OFFSET( 3693, glRotated, glRotated, NULL, 299),
- NAME_FUNC_OFFSET( 3703, glRotatef, glRotatef, NULL, 300),
- NAME_FUNC_OFFSET( 3713, glScaled, glScaled, NULL, 301),
- NAME_FUNC_OFFSET( 3722, glScalef, glScalef, NULL, 302),
- NAME_FUNC_OFFSET( 3731, glTranslated, glTranslated, NULL, 303),
- NAME_FUNC_OFFSET( 3744, glTranslatef, glTranslatef, NULL, 304),
- NAME_FUNC_OFFSET( 3757, glViewport, glViewport, NULL, 305),
- NAME_FUNC_OFFSET( 3768, glArrayElement, glArrayElement, NULL, 306),
- NAME_FUNC_OFFSET( 3783, glBindTexture, glBindTexture, NULL, 307),
- NAME_FUNC_OFFSET( 3797, glColorPointer, glColorPointer, NULL, 308),
- NAME_FUNC_OFFSET( 3812, glDisableClientState, glDisableClientState, NULL, 309),
- NAME_FUNC_OFFSET( 3833, glDrawArrays, glDrawArrays, NULL, 310),
- NAME_FUNC_OFFSET( 3846, glDrawElements, glDrawElements, NULL, 311),
- NAME_FUNC_OFFSET( 3861, glEdgeFlagPointer, glEdgeFlagPointer, NULL, 312),
- NAME_FUNC_OFFSET( 3879, glEnableClientState, glEnableClientState, NULL, 313),
- NAME_FUNC_OFFSET( 3899, glIndexPointer, glIndexPointer, NULL, 314),
- NAME_FUNC_OFFSET( 3914, glIndexub, glIndexub, NULL, 315),
- NAME_FUNC_OFFSET( 3924, glIndexubv, glIndexubv, NULL, 316),
- NAME_FUNC_OFFSET( 3935, glInterleavedArrays, glInterleavedArrays, NULL, 317),
- NAME_FUNC_OFFSET( 3955, glNormalPointer, glNormalPointer, NULL, 318),
- NAME_FUNC_OFFSET( 3971, glPolygonOffset, glPolygonOffset, NULL, 319),
- NAME_FUNC_OFFSET( 3987, glTexCoordPointer, glTexCoordPointer, NULL, 320),
- NAME_FUNC_OFFSET( 4005, glVertexPointer, glVertexPointer, NULL, 321),
- NAME_FUNC_OFFSET( 4021, glAreTexturesResident, glAreTexturesResident, NULL, 322),
- NAME_FUNC_OFFSET( 4043, glCopyTexImage1D, glCopyTexImage1D, NULL, 323),
- NAME_FUNC_OFFSET( 4060, glCopyTexImage2D, glCopyTexImage2D, NULL, 324),
- NAME_FUNC_OFFSET( 4077, glCopyTexSubImage1D, glCopyTexSubImage1D, NULL, 325),
- NAME_FUNC_OFFSET( 4097, glCopyTexSubImage2D, glCopyTexSubImage2D, NULL, 326),
- NAME_FUNC_OFFSET( 4117, glDeleteTextures, glDeleteTextures, NULL, 327),
- NAME_FUNC_OFFSET( 4134, glGenTextures, glGenTextures, NULL, 328),
- NAME_FUNC_OFFSET( 4148, glGetPointerv, glGetPointerv, NULL, 329),
- NAME_FUNC_OFFSET( 4162, glIsTexture, glIsTexture, NULL, 330),
- NAME_FUNC_OFFSET( 4174, glPrioritizeTextures, glPrioritizeTextures, NULL, 331),
- NAME_FUNC_OFFSET( 4195, glTexSubImage1D, glTexSubImage1D, NULL, 332),
- NAME_FUNC_OFFSET( 4211, glTexSubImage2D, glTexSubImage2D, NULL, 333),
- NAME_FUNC_OFFSET( 4227, glPopClientAttrib, glPopClientAttrib, NULL, 334),
- NAME_FUNC_OFFSET( 4245, glPushClientAttrib, glPushClientAttrib, NULL, 335),
- NAME_FUNC_OFFSET( 4264, glBlendColor, glBlendColor, NULL, 336),
- NAME_FUNC_OFFSET( 4277, glBlendEquation, glBlendEquation, NULL, 337),
- NAME_FUNC_OFFSET( 4293, glDrawRangeElements, glDrawRangeElements, NULL, 338),
- NAME_FUNC_OFFSET( 4313, glColorTable, glColorTable, NULL, 339),
- NAME_FUNC_OFFSET( 4326, glColorTableParameterfv, glColorTableParameterfv, NULL, 340),
- NAME_FUNC_OFFSET( 4350, glColorTableParameteriv, glColorTableParameteriv, NULL, 341),
- NAME_FUNC_OFFSET( 4374, glCopyColorTable, glCopyColorTable, NULL, 342),
- NAME_FUNC_OFFSET( 4391, glGetColorTable, glGetColorTable, NULL, 343),
- NAME_FUNC_OFFSET( 4407, glGetColorTableParameterfv, glGetColorTableParameterfv, NULL, 344),
- NAME_FUNC_OFFSET( 4434, glGetColorTableParameteriv, glGetColorTableParameteriv, NULL, 345),
- NAME_FUNC_OFFSET( 4461, glColorSubTable, glColorSubTable, NULL, 346),
- NAME_FUNC_OFFSET( 4477, glCopyColorSubTable, glCopyColorSubTable, NULL, 347),
- NAME_FUNC_OFFSET( 4497, glConvolutionFilter1D, glConvolutionFilter1D, NULL, 348),
- NAME_FUNC_OFFSET( 4519, glConvolutionFilter2D, glConvolutionFilter2D, NULL, 349),
- NAME_FUNC_OFFSET( 4541, glConvolutionParameterf, glConvolutionParameterf, NULL, 350),
- NAME_FUNC_OFFSET( 4565, glConvolutionParameterfv, glConvolutionParameterfv, NULL, 351),
- NAME_FUNC_OFFSET( 4590, glConvolutionParameteri, glConvolutionParameteri, NULL, 352),
- NAME_FUNC_OFFSET( 4614, glConvolutionParameteriv, glConvolutionParameteriv, NULL, 353),
- NAME_FUNC_OFFSET( 4639, glCopyConvolutionFilter1D, glCopyConvolutionFilter1D, NULL, 354),
- NAME_FUNC_OFFSET( 4665, glCopyConvolutionFilter2D, glCopyConvolutionFilter2D, NULL, 355),
- NAME_FUNC_OFFSET( 4691, glGetConvolutionFilter, glGetConvolutionFilter, NULL, 356),
- NAME_FUNC_OFFSET( 4714, glGetConvolutionParameterfv, glGetConvolutionParameterfv, NULL, 357),
- NAME_FUNC_OFFSET( 4742, glGetConvolutionParameteriv, glGetConvolutionParameteriv, NULL, 358),
- NAME_FUNC_OFFSET( 4770, glGetSeparableFilter, glGetSeparableFilter, NULL, 359),
- NAME_FUNC_OFFSET( 4791, glSeparableFilter2D, glSeparableFilter2D, NULL, 360),
- NAME_FUNC_OFFSET( 4811, glGetHistogram, glGetHistogram, NULL, 361),
- NAME_FUNC_OFFSET( 4826, glGetHistogramParameterfv, glGetHistogramParameterfv, NULL, 362),
- NAME_FUNC_OFFSET( 4852, glGetHistogramParameteriv, glGetHistogramParameteriv, NULL, 363),
- NAME_FUNC_OFFSET( 4878, glGetMinmax, glGetMinmax, NULL, 364),
- NAME_FUNC_OFFSET( 4890, glGetMinmaxParameterfv, glGetMinmaxParameterfv, NULL, 365),
- NAME_FUNC_OFFSET( 4913, glGetMinmaxParameteriv, glGetMinmaxParameteriv, NULL, 366),
- NAME_FUNC_OFFSET( 4936, glHistogram, glHistogram, NULL, 367),
- NAME_FUNC_OFFSET( 4948, glMinmax, glMinmax, NULL, 368),
- NAME_FUNC_OFFSET( 4957, glResetHistogram, glResetHistogram, NULL, 369),
- NAME_FUNC_OFFSET( 4974, glResetMinmax, glResetMinmax, NULL, 370),
- NAME_FUNC_OFFSET( 4988, glTexImage3D, glTexImage3D, NULL, 371),
- NAME_FUNC_OFFSET( 5001, glTexSubImage3D, glTexSubImage3D, NULL, 372),
- NAME_FUNC_OFFSET( 5017, glCopyTexSubImage3D, glCopyTexSubImage3D, NULL, 373),
- NAME_FUNC_OFFSET( 5037, glActiveTextureARB, glActiveTextureARB, NULL, 374),
- NAME_FUNC_OFFSET( 5056, glClientActiveTextureARB, glClientActiveTextureARB, NULL, 375),
- NAME_FUNC_OFFSET( 5081, glMultiTexCoord1dARB, glMultiTexCoord1dARB, NULL, 376),
- NAME_FUNC_OFFSET( 5102, glMultiTexCoord1dvARB, glMultiTexCoord1dvARB, NULL, 377),
- NAME_FUNC_OFFSET( 5124, glMultiTexCoord1fARB, glMultiTexCoord1fARB, NULL, 378),
- NAME_FUNC_OFFSET( 5145, glMultiTexCoord1fvARB, glMultiTexCoord1fvARB, NULL, 379),
- NAME_FUNC_OFFSET( 5167, glMultiTexCoord1iARB, glMultiTexCoord1iARB, NULL, 380),
- NAME_FUNC_OFFSET( 5188, glMultiTexCoord1ivARB, glMultiTexCoord1ivARB, NULL, 381),
- NAME_FUNC_OFFSET( 5210, glMultiTexCoord1sARB, glMultiTexCoord1sARB, NULL, 382),
- NAME_FUNC_OFFSET( 5231, glMultiTexCoord1svARB, glMultiTexCoord1svARB, NULL, 383),
- NAME_FUNC_OFFSET( 5253, glMultiTexCoord2dARB, glMultiTexCoord2dARB, NULL, 384),
- NAME_FUNC_OFFSET( 5274, glMultiTexCoord2dvARB, glMultiTexCoord2dvARB, NULL, 385),
- NAME_FUNC_OFFSET( 5296, glMultiTexCoord2fARB, glMultiTexCoord2fARB, NULL, 386),
- NAME_FUNC_OFFSET( 5317, glMultiTexCoord2fvARB, glMultiTexCoord2fvARB, NULL, 387),
- NAME_FUNC_OFFSET( 5339, glMultiTexCoord2iARB, glMultiTexCoord2iARB, NULL, 388),
- NAME_FUNC_OFFSET( 5360, glMultiTexCoord2ivARB, glMultiTexCoord2ivARB, NULL, 389),
- NAME_FUNC_OFFSET( 5382, glMultiTexCoord2sARB, glMultiTexCoord2sARB, NULL, 390),
- NAME_FUNC_OFFSET( 5403, glMultiTexCoord2svARB, glMultiTexCoord2svARB, NULL, 391),
- NAME_FUNC_OFFSET( 5425, glMultiTexCoord3dARB, glMultiTexCoord3dARB, NULL, 392),
- NAME_FUNC_OFFSET( 5446, glMultiTexCoord3dvARB, glMultiTexCoord3dvARB, NULL, 393),
- NAME_FUNC_OFFSET( 5468, glMultiTexCoord3fARB, glMultiTexCoord3fARB, NULL, 394),
- NAME_FUNC_OFFSET( 5489, glMultiTexCoord3fvARB, glMultiTexCoord3fvARB, NULL, 395),
- NAME_FUNC_OFFSET( 5511, glMultiTexCoord3iARB, glMultiTexCoord3iARB, NULL, 396),
- NAME_FUNC_OFFSET( 5532, glMultiTexCoord3ivARB, glMultiTexCoord3ivARB, NULL, 397),
- NAME_FUNC_OFFSET( 5554, glMultiTexCoord3sARB, glMultiTexCoord3sARB, NULL, 398),
- NAME_FUNC_OFFSET( 5575, glMultiTexCoord3svARB, glMultiTexCoord3svARB, NULL, 399),
- NAME_FUNC_OFFSET( 5597, glMultiTexCoord4dARB, glMultiTexCoord4dARB, NULL, 400),
- NAME_FUNC_OFFSET( 5618, glMultiTexCoord4dvARB, glMultiTexCoord4dvARB, NULL, 401),
- NAME_FUNC_OFFSET( 5640, glMultiTexCoord4fARB, glMultiTexCoord4fARB, NULL, 402),
- NAME_FUNC_OFFSET( 5661, glMultiTexCoord4fvARB, glMultiTexCoord4fvARB, NULL, 403),
- NAME_FUNC_OFFSET( 5683, glMultiTexCoord4iARB, glMultiTexCoord4iARB, NULL, 404),
- NAME_FUNC_OFFSET( 5704, glMultiTexCoord4ivARB, glMultiTexCoord4ivARB, NULL, 405),
- NAME_FUNC_OFFSET( 5726, glMultiTexCoord4sARB, glMultiTexCoord4sARB, NULL, 406),
- NAME_FUNC_OFFSET( 5747, glMultiTexCoord4svARB, glMultiTexCoord4svARB, NULL, 407),
- NAME_FUNC_OFFSET( 5769, glAttachShader, glAttachShader, NULL, 408),
- NAME_FUNC_OFFSET( 5784, glCreateProgram, glCreateProgram, NULL, 409),
- NAME_FUNC_OFFSET( 5800, glCreateShader, glCreateShader, NULL, 410),
- NAME_FUNC_OFFSET( 5815, glDeleteProgram, glDeleteProgram, NULL, 411),
- NAME_FUNC_OFFSET( 5831, glDeleteShader, glDeleteShader, NULL, 412),
- NAME_FUNC_OFFSET( 5846, glDetachShader, glDetachShader, NULL, 413),
- NAME_FUNC_OFFSET( 5861, glGetAttachedShaders, glGetAttachedShaders, NULL, 414),
- NAME_FUNC_OFFSET( 5882, glGetProgramInfoLog, glGetProgramInfoLog, NULL, 415),
- NAME_FUNC_OFFSET( 5902, glGetProgramiv, glGetProgramiv, NULL, 416),
- NAME_FUNC_OFFSET( 5917, glGetShaderInfoLog, glGetShaderInfoLog, NULL, 417),
- NAME_FUNC_OFFSET( 5936, glGetShaderiv, glGetShaderiv, NULL, 418),
- NAME_FUNC_OFFSET( 5950, glIsProgram, glIsProgram, NULL, 419),
- NAME_FUNC_OFFSET( 5962, glIsShader, glIsShader, NULL, 420),
- NAME_FUNC_OFFSET( 5973, glStencilFuncSeparate, glStencilFuncSeparate, NULL, 421),
- NAME_FUNC_OFFSET( 5995, glStencilMaskSeparate, glStencilMaskSeparate, NULL, 422),
- NAME_FUNC_OFFSET( 6017, glStencilOpSeparate, glStencilOpSeparate, NULL, 423),
- NAME_FUNC_OFFSET( 6037, glUniformMatrix2x3fv, glUniformMatrix2x3fv, NULL, 424),
- NAME_FUNC_OFFSET( 6058, glUniformMatrix2x4fv, glUniformMatrix2x4fv, NULL, 425),
- NAME_FUNC_OFFSET( 6079, glUniformMatrix3x2fv, glUniformMatrix3x2fv, NULL, 426),
- NAME_FUNC_OFFSET( 6100, glUniformMatrix3x4fv, glUniformMatrix3x4fv, NULL, 427),
- NAME_FUNC_OFFSET( 6121, glUniformMatrix4x2fv, glUniformMatrix4x2fv, NULL, 428),
- NAME_FUNC_OFFSET( 6142, glUniformMatrix4x3fv, glUniformMatrix4x3fv, NULL, 429),
- NAME_FUNC_OFFSET( 6163, glClampColor, glClampColor, NULL, 430),
- NAME_FUNC_OFFSET( 6176, glClearBufferfi, glClearBufferfi, NULL, 431),
- NAME_FUNC_OFFSET( 6192, glClearBufferfv, glClearBufferfv, NULL, 432),
- NAME_FUNC_OFFSET( 6208, glClearBufferiv, glClearBufferiv, NULL, 433),
- NAME_FUNC_OFFSET( 6224, glClearBufferuiv, glClearBufferuiv, NULL, 434),
- NAME_FUNC_OFFSET( 6241, glGetStringi, glGetStringi, NULL, 435),
- NAME_FUNC_OFFSET( 6254, glTexBuffer, glTexBuffer, NULL, 436),
- NAME_FUNC_OFFSET( 6266, glFramebufferTexture, glFramebufferTexture, NULL, 437),
- NAME_FUNC_OFFSET( 6287, glGetBufferParameteri64v, glGetBufferParameteri64v, NULL, 438),
- NAME_FUNC_OFFSET( 6312, glGetInteger64i_v, glGetInteger64i_v, NULL, 439),
- NAME_FUNC_OFFSET( 6330, glVertexAttribDivisor, glVertexAttribDivisor, NULL, 440),
- NAME_FUNC_OFFSET( 6352, glLoadTransposeMatrixdARB, glLoadTransposeMatrixdARB, NULL, 441),
- NAME_FUNC_OFFSET( 6378, glLoadTransposeMatrixfARB, glLoadTransposeMatrixfARB, NULL, 442),
- NAME_FUNC_OFFSET( 6404, glMultTransposeMatrixdARB, glMultTransposeMatrixdARB, NULL, 443),
- NAME_FUNC_OFFSET( 6430, glMultTransposeMatrixfARB, glMultTransposeMatrixfARB, NULL, 444),
- NAME_FUNC_OFFSET( 6456, glSampleCoverageARB, glSampleCoverageARB, NULL, 445),
- NAME_FUNC_OFFSET( 6476, glCompressedTexImage1DARB, glCompressedTexImage1DARB, NULL, 446),
- NAME_FUNC_OFFSET( 6502, glCompressedTexImage2DARB, glCompressedTexImage2DARB, NULL, 447),
- NAME_FUNC_OFFSET( 6528, glCompressedTexImage3DARB, glCompressedTexImage3DARB, NULL, 448),
- NAME_FUNC_OFFSET( 6554, glCompressedTexSubImage1DARB, glCompressedTexSubImage1DARB, NULL, 449),
- NAME_FUNC_OFFSET( 6583, glCompressedTexSubImage2DARB, glCompressedTexSubImage2DARB, NULL, 450),
- NAME_FUNC_OFFSET( 6612, glCompressedTexSubImage3DARB, glCompressedTexSubImage3DARB, NULL, 451),
- NAME_FUNC_OFFSET( 6641, glGetCompressedTexImageARB, glGetCompressedTexImageARB, NULL, 452),
- NAME_FUNC_OFFSET( 6668, glDisableVertexAttribArrayARB, glDisableVertexAttribArrayARB, NULL, 453),
- NAME_FUNC_OFFSET( 6698, glEnableVertexAttribArrayARB, glEnableVertexAttribArrayARB, NULL, 454),
- NAME_FUNC_OFFSET( 6727, glGetProgramEnvParameterdvARB, glGetProgramEnvParameterdvARB, NULL, 455),
- NAME_FUNC_OFFSET( 6757, glGetProgramEnvParameterfvARB, glGetProgramEnvParameterfvARB, NULL, 456),
- NAME_FUNC_OFFSET( 6787, glGetProgramLocalParameterdvARB, glGetProgramLocalParameterdvARB, NULL, 457),
- NAME_FUNC_OFFSET( 6819, glGetProgramLocalParameterfvARB, glGetProgramLocalParameterfvARB, NULL, 458),
- NAME_FUNC_OFFSET( 6851, glGetProgramStringARB, glGetProgramStringARB, NULL, 459),
- NAME_FUNC_OFFSET( 6873, glGetProgramivARB, glGetProgramivARB, NULL, 460),
- NAME_FUNC_OFFSET( 6891, glGetVertexAttribdvARB, glGetVertexAttribdvARB, NULL, 461),
- NAME_FUNC_OFFSET( 6914, glGetVertexAttribfvARB, glGetVertexAttribfvARB, NULL, 462),
- NAME_FUNC_OFFSET( 6937, glGetVertexAttribivARB, glGetVertexAttribivARB, NULL, 463),
- NAME_FUNC_OFFSET( 6960, glProgramEnvParameter4dARB, glProgramEnvParameter4dARB, NULL, 464),
- NAME_FUNC_OFFSET( 6987, glProgramEnvParameter4dvARB, glProgramEnvParameter4dvARB, NULL, 465),
- NAME_FUNC_OFFSET( 7015, glProgramEnvParameter4fARB, glProgramEnvParameter4fARB, NULL, 466),
- NAME_FUNC_OFFSET( 7042, glProgramEnvParameter4fvARB, glProgramEnvParameter4fvARB, NULL, 467),
- NAME_FUNC_OFFSET( 7070, glProgramLocalParameter4dARB, glProgramLocalParameter4dARB, NULL, 468),
- NAME_FUNC_OFFSET( 7099, glProgramLocalParameter4dvARB, glProgramLocalParameter4dvARB, NULL, 469),
- NAME_FUNC_OFFSET( 7129, glProgramLocalParameter4fARB, glProgramLocalParameter4fARB, NULL, 470),
- NAME_FUNC_OFFSET( 7158, glProgramLocalParameter4fvARB, glProgramLocalParameter4fvARB, NULL, 471),
- NAME_FUNC_OFFSET( 7188, glProgramStringARB, glProgramStringARB, NULL, 472),
- NAME_FUNC_OFFSET( 7207, glVertexAttrib1dARB, glVertexAttrib1dARB, NULL, 473),
- NAME_FUNC_OFFSET( 7227, glVertexAttrib1dvARB, glVertexAttrib1dvARB, NULL, 474),
- NAME_FUNC_OFFSET( 7248, glVertexAttrib1fARB, glVertexAttrib1fARB, NULL, 475),
- NAME_FUNC_OFFSET( 7268, glVertexAttrib1fvARB, glVertexAttrib1fvARB, NULL, 476),
- NAME_FUNC_OFFSET( 7289, glVertexAttrib1sARB, glVertexAttrib1sARB, NULL, 477),
- NAME_FUNC_OFFSET( 7309, glVertexAttrib1svARB, glVertexAttrib1svARB, NULL, 478),
- NAME_FUNC_OFFSET( 7330, glVertexAttrib2dARB, glVertexAttrib2dARB, NULL, 479),
- NAME_FUNC_OFFSET( 7350, glVertexAttrib2dvARB, glVertexAttrib2dvARB, NULL, 480),
- NAME_FUNC_OFFSET( 7371, glVertexAttrib2fARB, glVertexAttrib2fARB, NULL, 481),
- NAME_FUNC_OFFSET( 7391, glVertexAttrib2fvARB, glVertexAttrib2fvARB, NULL, 482),
- NAME_FUNC_OFFSET( 7412, glVertexAttrib2sARB, glVertexAttrib2sARB, NULL, 483),
- NAME_FUNC_OFFSET( 7432, glVertexAttrib2svARB, glVertexAttrib2svARB, NULL, 484),
- NAME_FUNC_OFFSET( 7453, glVertexAttrib3dARB, glVertexAttrib3dARB, NULL, 485),
- NAME_FUNC_OFFSET( 7473, glVertexAttrib3dvARB, glVertexAttrib3dvARB, NULL, 486),
- NAME_FUNC_OFFSET( 7494, glVertexAttrib3fARB, glVertexAttrib3fARB, NULL, 487),
- NAME_FUNC_OFFSET( 7514, glVertexAttrib3fvARB, glVertexAttrib3fvARB, NULL, 488),
- NAME_FUNC_OFFSET( 7535, glVertexAttrib3sARB, glVertexAttrib3sARB, NULL, 489),
- NAME_FUNC_OFFSET( 7555, glVertexAttrib3svARB, glVertexAttrib3svARB, NULL, 490),
- NAME_FUNC_OFFSET( 7576, glVertexAttrib4NbvARB, glVertexAttrib4NbvARB, NULL, 491),
- NAME_FUNC_OFFSET( 7598, glVertexAttrib4NivARB, glVertexAttrib4NivARB, NULL, 492),
- NAME_FUNC_OFFSET( 7620, glVertexAttrib4NsvARB, glVertexAttrib4NsvARB, NULL, 493),
- NAME_FUNC_OFFSET( 7642, glVertexAttrib4NubARB, glVertexAttrib4NubARB, NULL, 494),
- NAME_FUNC_OFFSET( 7664, glVertexAttrib4NubvARB, glVertexAttrib4NubvARB, NULL, 495),
- NAME_FUNC_OFFSET( 7687, glVertexAttrib4NuivARB, glVertexAttrib4NuivARB, NULL, 496),
- NAME_FUNC_OFFSET( 7710, glVertexAttrib4NusvARB, glVertexAttrib4NusvARB, NULL, 497),
- NAME_FUNC_OFFSET( 7733, glVertexAttrib4bvARB, glVertexAttrib4bvARB, NULL, 498),
- NAME_FUNC_OFFSET( 7754, glVertexAttrib4dARB, glVertexAttrib4dARB, NULL, 499),
- NAME_FUNC_OFFSET( 7774, glVertexAttrib4dvARB, glVertexAttrib4dvARB, NULL, 500),
- NAME_FUNC_OFFSET( 7795, glVertexAttrib4fARB, glVertexAttrib4fARB, NULL, 501),
- NAME_FUNC_OFFSET( 7815, glVertexAttrib4fvARB, glVertexAttrib4fvARB, NULL, 502),
- NAME_FUNC_OFFSET( 7836, glVertexAttrib4ivARB, glVertexAttrib4ivARB, NULL, 503),
- NAME_FUNC_OFFSET( 7857, glVertexAttrib4sARB, glVertexAttrib4sARB, NULL, 504),
- NAME_FUNC_OFFSET( 7877, glVertexAttrib4svARB, glVertexAttrib4svARB, NULL, 505),
- NAME_FUNC_OFFSET( 7898, glVertexAttrib4ubvARB, glVertexAttrib4ubvARB, NULL, 506),
- NAME_FUNC_OFFSET( 7920, glVertexAttrib4uivARB, glVertexAttrib4uivARB, NULL, 507),
- NAME_FUNC_OFFSET( 7942, glVertexAttrib4usvARB, glVertexAttrib4usvARB, NULL, 508),
- NAME_FUNC_OFFSET( 7964, glVertexAttribPointerARB, glVertexAttribPointerARB, NULL, 509),
- NAME_FUNC_OFFSET( 7989, glBindBufferARB, glBindBufferARB, NULL, 510),
- NAME_FUNC_OFFSET( 8005, glBufferDataARB, glBufferDataARB, NULL, 511),
- NAME_FUNC_OFFSET( 8021, glBufferSubDataARB, glBufferSubDataARB, NULL, 512),
- NAME_FUNC_OFFSET( 8040, glDeleteBuffersARB, glDeleteBuffersARB, NULL, 513),
- NAME_FUNC_OFFSET( 8059, glGenBuffersARB, glGenBuffersARB, NULL, 514),
- NAME_FUNC_OFFSET( 8075, glGetBufferParameterivARB, glGetBufferParameterivARB, NULL, 515),
- NAME_FUNC_OFFSET( 8101, glGetBufferPointervARB, glGetBufferPointervARB, NULL, 516),
- NAME_FUNC_OFFSET( 8124, glGetBufferSubDataARB, glGetBufferSubDataARB, NULL, 517),
- NAME_FUNC_OFFSET( 8146, glIsBufferARB, glIsBufferARB, NULL, 518),
- NAME_FUNC_OFFSET( 8160, glMapBufferARB, glMapBufferARB, NULL, 519),
- NAME_FUNC_OFFSET( 8175, glUnmapBufferARB, glUnmapBufferARB, NULL, 520),
- NAME_FUNC_OFFSET( 8192, glBeginQueryARB, glBeginQueryARB, NULL, 521),
- NAME_FUNC_OFFSET( 8208, glDeleteQueriesARB, glDeleteQueriesARB, NULL, 522),
- NAME_FUNC_OFFSET( 8227, glEndQueryARB, glEndQueryARB, NULL, 523),
- NAME_FUNC_OFFSET( 8241, glGenQueriesARB, glGenQueriesARB, NULL, 524),
- NAME_FUNC_OFFSET( 8257, glGetQueryObjectivARB, glGetQueryObjectivARB, NULL, 525),
- NAME_FUNC_OFFSET( 8279, glGetQueryObjectuivARB, glGetQueryObjectuivARB, NULL, 526),
- NAME_FUNC_OFFSET( 8302, glGetQueryivARB, glGetQueryivARB, NULL, 527),
- NAME_FUNC_OFFSET( 8318, glIsQueryARB, glIsQueryARB, NULL, 528),
- NAME_FUNC_OFFSET( 8331, glAttachObjectARB, glAttachObjectARB, NULL, 529),
- NAME_FUNC_OFFSET( 8349, glCompileShaderARB, glCompileShaderARB, NULL, 530),
- NAME_FUNC_OFFSET( 8368, glCreateProgramObjectARB, glCreateProgramObjectARB, NULL, 531),
- NAME_FUNC_OFFSET( 8393, glCreateShaderObjectARB, glCreateShaderObjectARB, NULL, 532),
- NAME_FUNC_OFFSET( 8417, glDeleteObjectARB, glDeleteObjectARB, NULL, 533),
- NAME_FUNC_OFFSET( 8435, glDetachObjectARB, glDetachObjectARB, NULL, 534),
- NAME_FUNC_OFFSET( 8453, glGetActiveUniformARB, glGetActiveUniformARB, NULL, 535),
- NAME_FUNC_OFFSET( 8475, glGetAttachedObjectsARB, glGetAttachedObjectsARB, NULL, 536),
- NAME_FUNC_OFFSET( 8499, glGetHandleARB, glGetHandleARB, NULL, 537),
- NAME_FUNC_OFFSET( 8514, glGetInfoLogARB, glGetInfoLogARB, NULL, 538),
- NAME_FUNC_OFFSET( 8530, glGetObjectParameterfvARB, glGetObjectParameterfvARB, NULL, 539),
- NAME_FUNC_OFFSET( 8556, glGetObjectParameterivARB, glGetObjectParameterivARB, NULL, 540),
- NAME_FUNC_OFFSET( 8582, glGetShaderSourceARB, glGetShaderSourceARB, NULL, 541),
- NAME_FUNC_OFFSET( 8603, glGetUniformLocationARB, glGetUniformLocationARB, NULL, 542),
- NAME_FUNC_OFFSET( 8627, glGetUniformfvARB, glGetUniformfvARB, NULL, 543),
- NAME_FUNC_OFFSET( 8645, glGetUniformivARB, glGetUniformivARB, NULL, 544),
- NAME_FUNC_OFFSET( 8663, glLinkProgramARB, glLinkProgramARB, NULL, 545),
- NAME_FUNC_OFFSET( 8680, glShaderSourceARB, glShaderSourceARB, NULL, 546),
- NAME_FUNC_OFFSET( 8698, glUniform1fARB, glUniform1fARB, NULL, 547),
- NAME_FUNC_OFFSET( 8713, glUniform1fvARB, glUniform1fvARB, NULL, 548),
- NAME_FUNC_OFFSET( 8729, glUniform1iARB, glUniform1iARB, NULL, 549),
- NAME_FUNC_OFFSET( 8744, glUniform1ivARB, glUniform1ivARB, NULL, 550),
- NAME_FUNC_OFFSET( 8760, glUniform2fARB, glUniform2fARB, NULL, 551),
- NAME_FUNC_OFFSET( 8775, glUniform2fvARB, glUniform2fvARB, NULL, 552),
- NAME_FUNC_OFFSET( 8791, glUniform2iARB, glUniform2iARB, NULL, 553),
- NAME_FUNC_OFFSET( 8806, glUniform2ivARB, glUniform2ivARB, NULL, 554),
- NAME_FUNC_OFFSET( 8822, glUniform3fARB, glUniform3fARB, NULL, 555),
- NAME_FUNC_OFFSET( 8837, glUniform3fvARB, glUniform3fvARB, NULL, 556),
- NAME_FUNC_OFFSET( 8853, glUniform3iARB, glUniform3iARB, NULL, 557),
- NAME_FUNC_OFFSET( 8868, glUniform3ivARB, glUniform3ivARB, NULL, 558),
- NAME_FUNC_OFFSET( 8884, glUniform4fARB, glUniform4fARB, NULL, 559),
- NAME_FUNC_OFFSET( 8899, glUniform4fvARB, glUniform4fvARB, NULL, 560),
- NAME_FUNC_OFFSET( 8915, glUniform4iARB, glUniform4iARB, NULL, 561),
- NAME_FUNC_OFFSET( 8930, glUniform4ivARB, glUniform4ivARB, NULL, 562),
- NAME_FUNC_OFFSET( 8946, glUniformMatrix2fvARB, glUniformMatrix2fvARB, NULL, 563),
- NAME_FUNC_OFFSET( 8968, glUniformMatrix3fvARB, glUniformMatrix3fvARB, NULL, 564),
- NAME_FUNC_OFFSET( 8990, glUniformMatrix4fvARB, glUniformMatrix4fvARB, NULL, 565),
- NAME_FUNC_OFFSET( 9012, glUseProgramObjectARB, glUseProgramObjectARB, NULL, 566),
- NAME_FUNC_OFFSET( 9034, glValidateProgramARB, glValidateProgramARB, NULL, 567),
- NAME_FUNC_OFFSET( 9055, glBindAttribLocationARB, glBindAttribLocationARB, NULL, 568),
- NAME_FUNC_OFFSET( 9079, glGetActiveAttribARB, glGetActiveAttribARB, NULL, 569),
- NAME_FUNC_OFFSET( 9100, glGetAttribLocationARB, glGetAttribLocationARB, NULL, 570),
- NAME_FUNC_OFFSET( 9123, glDrawBuffersARB, glDrawBuffersARB, NULL, 571),
- NAME_FUNC_OFFSET( 9140, glClampColorARB, glClampColorARB, NULL, 572),
- NAME_FUNC_OFFSET( 9156, glDrawArraysInstancedARB, glDrawArraysInstancedARB, NULL, 573),
- NAME_FUNC_OFFSET( 9181, glDrawElementsInstancedARB, glDrawElementsInstancedARB, NULL, 574),
- NAME_FUNC_OFFSET( 9208, glRenderbufferStorageMultisample, glRenderbufferStorageMultisample, NULL, 575),
- NAME_FUNC_OFFSET( 9241, glFramebufferTextureARB, glFramebufferTextureARB, NULL, 576),
- NAME_FUNC_OFFSET( 9265, glFramebufferTextureFaceARB, glFramebufferTextureFaceARB, NULL, 577),
- NAME_FUNC_OFFSET( 9293, glProgramParameteriARB, glProgramParameteriARB, NULL, 578),
- NAME_FUNC_OFFSET( 9316, glVertexAttribDivisorARB, glVertexAttribDivisorARB, NULL, 579),
- NAME_FUNC_OFFSET( 9341, glFlushMappedBufferRange, glFlushMappedBufferRange, NULL, 580),
- NAME_FUNC_OFFSET( 9366, glMapBufferRange, glMapBufferRange, NULL, 581),
- NAME_FUNC_OFFSET( 9383, glTexBufferARB, glTexBufferARB, NULL, 582),
- NAME_FUNC_OFFSET( 9398, glBindVertexArray, glBindVertexArray, NULL, 583),
- NAME_FUNC_OFFSET( 9416, glGenVertexArrays, glGenVertexArrays, NULL, 584),
- NAME_FUNC_OFFSET( 9434, glCopyBufferSubData, glCopyBufferSubData, NULL, 585),
- NAME_FUNC_OFFSET( 9454, glClientWaitSync, glClientWaitSync, NULL, 586),
- NAME_FUNC_OFFSET( 9471, glDeleteSync, glDeleteSync, NULL, 587),
- NAME_FUNC_OFFSET( 9484, glFenceSync, glFenceSync, NULL, 588),
- NAME_FUNC_OFFSET( 9496, glGetInteger64v, glGetInteger64v, NULL, 589),
- NAME_FUNC_OFFSET( 9512, glGetSynciv, glGetSynciv, NULL, 590),
- NAME_FUNC_OFFSET( 9524, glIsSync, glIsSync, NULL, 591),
- NAME_FUNC_OFFSET( 9533, glWaitSync, glWaitSync, NULL, 592),
- NAME_FUNC_OFFSET( 9544, glDrawElementsBaseVertex, glDrawElementsBaseVertex, NULL, 593),
- NAME_FUNC_OFFSET( 9569, glDrawRangeElementsBaseVertex, glDrawRangeElementsBaseVertex, NULL, 594),
- NAME_FUNC_OFFSET( 9599, glMultiDrawElementsBaseVertex, glMultiDrawElementsBaseVertex, NULL, 595),
- NAME_FUNC_OFFSET( 9629, glBlendEquationSeparateiARB, glBlendEquationSeparateiARB, NULL, 596),
- NAME_FUNC_OFFSET( 9657, glBlendEquationiARB, glBlendEquationiARB, NULL, 597),
- NAME_FUNC_OFFSET( 9677, glBlendFuncSeparateiARB, glBlendFuncSeparateiARB, NULL, 598),
- NAME_FUNC_OFFSET( 9701, glBlendFunciARB, glBlendFunciARB, NULL, 599),
- NAME_FUNC_OFFSET( 9717, glBindSampler, glBindSampler, NULL, 600),
- NAME_FUNC_OFFSET( 9731, glDeleteSamplers, glDeleteSamplers, NULL, 601),
- NAME_FUNC_OFFSET( 9748, glGenSamplers, glGenSamplers, NULL, 602),
- NAME_FUNC_OFFSET( 9762, glGetSamplerParameterIiv, glGetSamplerParameterIiv, NULL, 603),
- NAME_FUNC_OFFSET( 9787, glGetSamplerParameterIuiv, glGetSamplerParameterIuiv, NULL, 604),
- NAME_FUNC_OFFSET( 9813, glGetSamplerParameterfv, glGetSamplerParameterfv, NULL, 605),
- NAME_FUNC_OFFSET( 9837, glGetSamplerParameteriv, glGetSamplerParameteriv, NULL, 606),
- NAME_FUNC_OFFSET( 9861, glIsSampler, glIsSampler, NULL, 607),
- NAME_FUNC_OFFSET( 9873, glSamplerParameterIiv, glSamplerParameterIiv, NULL, 608),
- NAME_FUNC_OFFSET( 9895, glSamplerParameterIuiv, glSamplerParameterIuiv, NULL, 609),
- NAME_FUNC_OFFSET( 9918, glSamplerParameterf, glSamplerParameterf, NULL, 610),
- NAME_FUNC_OFFSET( 9938, glSamplerParameterfv, glSamplerParameterfv, NULL, 611),
- NAME_FUNC_OFFSET( 9959, glSamplerParameteri, glSamplerParameteri, NULL, 612),
- NAME_FUNC_OFFSET( 9979, glSamplerParameteriv, glSamplerParameteriv, NULL, 613),
- NAME_FUNC_OFFSET(10000, glBindTransformFeedback, glBindTransformFeedback, NULL, 614),
- NAME_FUNC_OFFSET(10024, glDeleteTransformFeedbacks, glDeleteTransformFeedbacks, NULL, 615),
- NAME_FUNC_OFFSET(10051, glDrawTransformFeedback, glDrawTransformFeedback, NULL, 616),
- NAME_FUNC_OFFSET(10075, glGenTransformFeedbacks, glGenTransformFeedbacks, NULL, 617),
- NAME_FUNC_OFFSET(10099, glIsTransformFeedback, glIsTransformFeedback, NULL, 618),
- NAME_FUNC_OFFSET(10121, glPauseTransformFeedback, glPauseTransformFeedback, NULL, 619),
- NAME_FUNC_OFFSET(10146, glResumeTransformFeedback, glResumeTransformFeedback, NULL, 620),
- NAME_FUNC_OFFSET(10172, glClearDepthf, glClearDepthf, NULL, 621),
- NAME_FUNC_OFFSET(10186, glDepthRangef, glDepthRangef, NULL, 622),
- NAME_FUNC_OFFSET(10200, glGetShaderPrecisionFormat, glGetShaderPrecisionFormat, NULL, 623),
- NAME_FUNC_OFFSET(10227, glReleaseShaderCompiler, glReleaseShaderCompiler, NULL, 624),
- NAME_FUNC_OFFSET(10251, glShaderBinary, glShaderBinary, NULL, 625),
- NAME_FUNC_OFFSET(10266, glGetGraphicsResetStatusARB, glGetGraphicsResetStatusARB, NULL, 626),
- NAME_FUNC_OFFSET(10294, glGetnColorTableARB, glGetnColorTableARB, NULL, 627),
- NAME_FUNC_OFFSET(10314, glGetnCompressedTexImageARB, glGetnCompressedTexImageARB, NULL, 628),
- NAME_FUNC_OFFSET(10342, glGetnConvolutionFilterARB, glGetnConvolutionFilterARB, NULL, 629),
- NAME_FUNC_OFFSET(10369, glGetnHistogramARB, glGetnHistogramARB, NULL, 630),
- NAME_FUNC_OFFSET(10388, glGetnMapdvARB, glGetnMapdvARB, NULL, 631),
- NAME_FUNC_OFFSET(10403, glGetnMapfvARB, glGetnMapfvARB, NULL, 632),
- NAME_FUNC_OFFSET(10418, glGetnMapivARB, glGetnMapivARB, NULL, 633),
- NAME_FUNC_OFFSET(10433, glGetnMinmaxARB, glGetnMinmaxARB, NULL, 634),
- NAME_FUNC_OFFSET(10449, glGetnPixelMapfvARB, glGetnPixelMapfvARB, NULL, 635),
- NAME_FUNC_OFFSET(10469, glGetnPixelMapuivARB, glGetnPixelMapuivARB, NULL, 636),
- NAME_FUNC_OFFSET(10490, glGetnPixelMapusvARB, glGetnPixelMapusvARB, NULL, 637),
- NAME_FUNC_OFFSET(10511, glGetnPolygonStippleARB, glGetnPolygonStippleARB, NULL, 638),
- NAME_FUNC_OFFSET(10535, glGetnSeparableFilterARB, glGetnSeparableFilterARB, NULL, 639),
- NAME_FUNC_OFFSET(10560, glGetnTexImageARB, glGetnTexImageARB, NULL, 640),
- NAME_FUNC_OFFSET(10578, glGetnUniformdvARB, glGetnUniformdvARB, NULL, 641),
- NAME_FUNC_OFFSET(10597, glGetnUniformfvARB, glGetnUniformfvARB, NULL, 642),
- NAME_FUNC_OFFSET(10616, glGetnUniformivARB, glGetnUniformivARB, NULL, 643),
- NAME_FUNC_OFFSET(10635, glGetnUniformuivARB, glGetnUniformuivARB, NULL, 644),
- NAME_FUNC_OFFSET(10655, glReadnPixelsARB, glReadnPixelsARB, NULL, 645),
- NAME_FUNC_OFFSET(10672, glPolygonOffsetEXT, glPolygonOffsetEXT, NULL, 646),
- NAME_FUNC_OFFSET(10691, gl_dispatch_stub_647, gl_dispatch_stub_647, NULL, 647),
- NAME_FUNC_OFFSET(10723, gl_dispatch_stub_648, gl_dispatch_stub_648, NULL, 648),
- NAME_FUNC_OFFSET(10755, gl_dispatch_stub_649, gl_dispatch_stub_649, NULL, 649),
- NAME_FUNC_OFFSET(10783, gl_dispatch_stub_650, gl_dispatch_stub_650, NULL, 650),
- NAME_FUNC_OFFSET(10812, gl_dispatch_stub_651, gl_dispatch_stub_651, NULL, 651),
- NAME_FUNC_OFFSET(10840, gl_dispatch_stub_652, gl_dispatch_stub_652, NULL, 652),
- NAME_FUNC_OFFSET(10869, gl_dispatch_stub_653, gl_dispatch_stub_653, NULL, 653),
- NAME_FUNC_OFFSET(10886, gl_dispatch_stub_654, gl_dispatch_stub_654, NULL, 654),
- NAME_FUNC_OFFSET(10906, glColorPointerEXT, glColorPointerEXT, NULL, 655),
- NAME_FUNC_OFFSET(10924, glEdgeFlagPointerEXT, glEdgeFlagPointerEXT, NULL, 656),
- NAME_FUNC_OFFSET(10945, glIndexPointerEXT, glIndexPointerEXT, NULL, 657),
- NAME_FUNC_OFFSET(10963, glNormalPointerEXT, glNormalPointerEXT, NULL, 658),
- NAME_FUNC_OFFSET(10982, glTexCoordPointerEXT, glTexCoordPointerEXT, NULL, 659),
- NAME_FUNC_OFFSET(11003, glVertexPointerEXT, glVertexPointerEXT, NULL, 660),
- NAME_FUNC_OFFSET(11022, glPointParameterfEXT, glPointParameterfEXT, NULL, 661),
- NAME_FUNC_OFFSET(11043, glPointParameterfvEXT, glPointParameterfvEXT, NULL, 662),
- NAME_FUNC_OFFSET(11065, glLockArraysEXT, glLockArraysEXT, NULL, 663),
- NAME_FUNC_OFFSET(11081, glUnlockArraysEXT, glUnlockArraysEXT, NULL, 664),
- NAME_FUNC_OFFSET(11099, glSecondaryColor3bEXT, glSecondaryColor3bEXT, NULL, 665),
- NAME_FUNC_OFFSET(11121, glSecondaryColor3bvEXT, glSecondaryColor3bvEXT, NULL, 666),
- NAME_FUNC_OFFSET(11144, glSecondaryColor3dEXT, glSecondaryColor3dEXT, NULL, 667),
- NAME_FUNC_OFFSET(11166, glSecondaryColor3dvEXT, glSecondaryColor3dvEXT, NULL, 668),
- NAME_FUNC_OFFSET(11189, glSecondaryColor3fEXT, glSecondaryColor3fEXT, NULL, 669),
- NAME_FUNC_OFFSET(11211, glSecondaryColor3fvEXT, glSecondaryColor3fvEXT, NULL, 670),
- NAME_FUNC_OFFSET(11234, glSecondaryColor3iEXT, glSecondaryColor3iEXT, NULL, 671),
- NAME_FUNC_OFFSET(11256, glSecondaryColor3ivEXT, glSecondaryColor3ivEXT, NULL, 672),
- NAME_FUNC_OFFSET(11279, glSecondaryColor3sEXT, glSecondaryColor3sEXT, NULL, 673),
- NAME_FUNC_OFFSET(11301, glSecondaryColor3svEXT, glSecondaryColor3svEXT, NULL, 674),
- NAME_FUNC_OFFSET(11324, glSecondaryColor3ubEXT, glSecondaryColor3ubEXT, NULL, 675),
- NAME_FUNC_OFFSET(11347, glSecondaryColor3ubvEXT, glSecondaryColor3ubvEXT, NULL, 676),
- NAME_FUNC_OFFSET(11371, glSecondaryColor3uiEXT, glSecondaryColor3uiEXT, NULL, 677),
- NAME_FUNC_OFFSET(11394, glSecondaryColor3uivEXT, glSecondaryColor3uivEXT, NULL, 678),
- NAME_FUNC_OFFSET(11418, glSecondaryColor3usEXT, glSecondaryColor3usEXT, NULL, 679),
- NAME_FUNC_OFFSET(11441, glSecondaryColor3usvEXT, glSecondaryColor3usvEXT, NULL, 680),
- NAME_FUNC_OFFSET(11465, glSecondaryColorPointerEXT, glSecondaryColorPointerEXT, NULL, 681),
- NAME_FUNC_OFFSET(11492, glMultiDrawArraysEXT, glMultiDrawArraysEXT, NULL, 682),
- NAME_FUNC_OFFSET(11513, glMultiDrawElementsEXT, glMultiDrawElementsEXT, NULL, 683),
- NAME_FUNC_OFFSET(11536, glFogCoordPointerEXT, glFogCoordPointerEXT, NULL, 684),
- NAME_FUNC_OFFSET(11557, glFogCoorddEXT, glFogCoorddEXT, NULL, 685),
- NAME_FUNC_OFFSET(11572, glFogCoorddvEXT, glFogCoorddvEXT, NULL, 686),
- NAME_FUNC_OFFSET(11588, glFogCoordfEXT, glFogCoordfEXT, NULL, 687),
- NAME_FUNC_OFFSET(11603, glFogCoordfvEXT, glFogCoordfvEXT, NULL, 688),
- NAME_FUNC_OFFSET(11619, gl_dispatch_stub_689, gl_dispatch_stub_689, NULL, 689),
- NAME_FUNC_OFFSET(11637, glBlendFuncSeparateEXT, glBlendFuncSeparateEXT, NULL, 690),
- NAME_FUNC_OFFSET(11660, glFlushVertexArrayRangeNV, glFlushVertexArrayRangeNV, NULL, 691),
- NAME_FUNC_OFFSET(11686, glVertexArrayRangeNV, glVertexArrayRangeNV, NULL, 692),
- NAME_FUNC_OFFSET(11707, glCombinerInputNV, glCombinerInputNV, NULL, 693),
- NAME_FUNC_OFFSET(11725, glCombinerOutputNV, glCombinerOutputNV, NULL, 694),
- NAME_FUNC_OFFSET(11744, glCombinerParameterfNV, glCombinerParameterfNV, NULL, 695),
- NAME_FUNC_OFFSET(11767, glCombinerParameterfvNV, glCombinerParameterfvNV, NULL, 696),
- NAME_FUNC_OFFSET(11791, glCombinerParameteriNV, glCombinerParameteriNV, NULL, 697),
- NAME_FUNC_OFFSET(11814, glCombinerParameterivNV, glCombinerParameterivNV, NULL, 698),
- NAME_FUNC_OFFSET(11838, glFinalCombinerInputNV, glFinalCombinerInputNV, NULL, 699),
- NAME_FUNC_OFFSET(11861, glGetCombinerInputParameterfvNV, glGetCombinerInputParameterfvNV, NULL, 700),
- NAME_FUNC_OFFSET(11893, glGetCombinerInputParameterivNV, glGetCombinerInputParameterivNV, NULL, 701),
- NAME_FUNC_OFFSET(11925, glGetCombinerOutputParameterfvNV, glGetCombinerOutputParameterfvNV, NULL, 702),
- NAME_FUNC_OFFSET(11958, glGetCombinerOutputParameterivNV, glGetCombinerOutputParameterivNV, NULL, 703),
- NAME_FUNC_OFFSET(11991, glGetFinalCombinerInputParameterfvNV, glGetFinalCombinerInputParameterfvNV, NULL, 704),
- NAME_FUNC_OFFSET(12028, glGetFinalCombinerInputParameterivNV, glGetFinalCombinerInputParameterivNV, NULL, 705),
- NAME_FUNC_OFFSET(12065, glResizeBuffersMESA, glResizeBuffersMESA, NULL, 706),
- NAME_FUNC_OFFSET(12085, glWindowPos2dMESA, glWindowPos2dMESA, NULL, 707),
- NAME_FUNC_OFFSET(12103, glWindowPos2dvMESA, glWindowPos2dvMESA, NULL, 708),
- NAME_FUNC_OFFSET(12122, glWindowPos2fMESA, glWindowPos2fMESA, NULL, 709),
- NAME_FUNC_OFFSET(12140, glWindowPos2fvMESA, glWindowPos2fvMESA, NULL, 710),
- NAME_FUNC_OFFSET(12159, glWindowPos2iMESA, glWindowPos2iMESA, NULL, 711),
- NAME_FUNC_OFFSET(12177, glWindowPos2ivMESA, glWindowPos2ivMESA, NULL, 712),
- NAME_FUNC_OFFSET(12196, glWindowPos2sMESA, glWindowPos2sMESA, NULL, 713),
- NAME_FUNC_OFFSET(12214, glWindowPos2svMESA, glWindowPos2svMESA, NULL, 714),
- NAME_FUNC_OFFSET(12233, glWindowPos3dMESA, glWindowPos3dMESA, NULL, 715),
- NAME_FUNC_OFFSET(12251, glWindowPos3dvMESA, glWindowPos3dvMESA, NULL, 716),
- NAME_FUNC_OFFSET(12270, glWindowPos3fMESA, glWindowPos3fMESA, NULL, 717),
- NAME_FUNC_OFFSET(12288, glWindowPos3fvMESA, glWindowPos3fvMESA, NULL, 718),
- NAME_FUNC_OFFSET(12307, glWindowPos3iMESA, glWindowPos3iMESA, NULL, 719),
- NAME_FUNC_OFFSET(12325, glWindowPos3ivMESA, glWindowPos3ivMESA, NULL, 720),
- NAME_FUNC_OFFSET(12344, glWindowPos3sMESA, glWindowPos3sMESA, NULL, 721),
- NAME_FUNC_OFFSET(12362, glWindowPos3svMESA, glWindowPos3svMESA, NULL, 722),
- NAME_FUNC_OFFSET(12381, glWindowPos4dMESA, glWindowPos4dMESA, NULL, 723),
- NAME_FUNC_OFFSET(12399, glWindowPos4dvMESA, glWindowPos4dvMESA, NULL, 724),
- NAME_FUNC_OFFSET(12418, glWindowPos4fMESA, glWindowPos4fMESA, NULL, 725),
- NAME_FUNC_OFFSET(12436, glWindowPos4fvMESA, glWindowPos4fvMESA, NULL, 726),
- NAME_FUNC_OFFSET(12455, glWindowPos4iMESA, glWindowPos4iMESA, NULL, 727),
- NAME_FUNC_OFFSET(12473, glWindowPos4ivMESA, glWindowPos4ivMESA, NULL, 728),
- NAME_FUNC_OFFSET(12492, glWindowPos4sMESA, glWindowPos4sMESA, NULL, 729),
- NAME_FUNC_OFFSET(12510, glWindowPos4svMESA, glWindowPos4svMESA, NULL, 730),
- NAME_FUNC_OFFSET(12529, gl_dispatch_stub_731, gl_dispatch_stub_731, NULL, 731),
- NAME_FUNC_OFFSET(12554, gl_dispatch_stub_732, gl_dispatch_stub_732, NULL, 732),
- NAME_FUNC_OFFSET(12581, gl_dispatch_stub_733, gl_dispatch_stub_733, NULL, 733),
- NAME_FUNC_OFFSET(12598, gl_dispatch_stub_734, gl_dispatch_stub_734, NULL, 734),
- NAME_FUNC_OFFSET(12614, gl_dispatch_stub_735, gl_dispatch_stub_735, NULL, 735),
- NAME_FUNC_OFFSET(12628, gl_dispatch_stub_736, gl_dispatch_stub_736, NULL, 736),
- NAME_FUNC_OFFSET(12643, gl_dispatch_stub_737, gl_dispatch_stub_737, NULL, 737),
- NAME_FUNC_OFFSET(12655, gl_dispatch_stub_738, gl_dispatch_stub_738, NULL, 738),
- NAME_FUNC_OFFSET(12668, gl_dispatch_stub_739, gl_dispatch_stub_739, NULL, 739),
- NAME_FUNC_OFFSET(12682, glAreProgramsResidentNV, glAreProgramsResidentNV, NULL, 740),
- NAME_FUNC_OFFSET(12706, glBindProgramNV, glBindProgramNV, NULL, 741),
- NAME_FUNC_OFFSET(12722, glDeleteProgramsNV, glDeleteProgramsNV, NULL, 742),
- NAME_FUNC_OFFSET(12741, glExecuteProgramNV, glExecuteProgramNV, NULL, 743),
- NAME_FUNC_OFFSET(12760, glGenProgramsNV, glGenProgramsNV, NULL, 744),
- NAME_FUNC_OFFSET(12776, glGetProgramParameterdvNV, glGetProgramParameterdvNV, NULL, 745),
- NAME_FUNC_OFFSET(12802, glGetProgramParameterfvNV, glGetProgramParameterfvNV, NULL, 746),
- NAME_FUNC_OFFSET(12828, glGetProgramStringNV, glGetProgramStringNV, NULL, 747),
- NAME_FUNC_OFFSET(12849, glGetProgramivNV, glGetProgramivNV, NULL, 748),
- NAME_FUNC_OFFSET(12866, glGetTrackMatrixivNV, glGetTrackMatrixivNV, NULL, 749),
- NAME_FUNC_OFFSET(12887, glGetVertexAttribPointervNV, glGetVertexAttribPointervNV, NULL, 750),
- NAME_FUNC_OFFSET(12915, glGetVertexAttribdvNV, glGetVertexAttribdvNV, NULL, 751),
- NAME_FUNC_OFFSET(12937, glGetVertexAttribfvNV, glGetVertexAttribfvNV, NULL, 752),
- NAME_FUNC_OFFSET(12959, glGetVertexAttribivNV, glGetVertexAttribivNV, NULL, 753),
- NAME_FUNC_OFFSET(12981, glIsProgramNV, glIsProgramNV, NULL, 754),
- NAME_FUNC_OFFSET(12995, glLoadProgramNV, glLoadProgramNV, NULL, 755),
- NAME_FUNC_OFFSET(13011, glProgramParameters4dvNV, glProgramParameters4dvNV, NULL, 756),
- NAME_FUNC_OFFSET(13036, glProgramParameters4fvNV, glProgramParameters4fvNV, NULL, 757),
- NAME_FUNC_OFFSET(13061, glRequestResidentProgramsNV, glRequestResidentProgramsNV, NULL, 758),
- NAME_FUNC_OFFSET(13089, glTrackMatrixNV, glTrackMatrixNV, NULL, 759),
- NAME_FUNC_OFFSET(13105, glVertexAttrib1dNV, glVertexAttrib1dNV, NULL, 760),
- NAME_FUNC_OFFSET(13124, glVertexAttrib1dvNV, glVertexAttrib1dvNV, NULL, 761),
- NAME_FUNC_OFFSET(13144, glVertexAttrib1fNV, glVertexAttrib1fNV, NULL, 762),
- NAME_FUNC_OFFSET(13163, glVertexAttrib1fvNV, glVertexAttrib1fvNV, NULL, 763),
- NAME_FUNC_OFFSET(13183, glVertexAttrib1sNV, glVertexAttrib1sNV, NULL, 764),
- NAME_FUNC_OFFSET(13202, glVertexAttrib1svNV, glVertexAttrib1svNV, NULL, 765),
- NAME_FUNC_OFFSET(13222, glVertexAttrib2dNV, glVertexAttrib2dNV, NULL, 766),
- NAME_FUNC_OFFSET(13241, glVertexAttrib2dvNV, glVertexAttrib2dvNV, NULL, 767),
- NAME_FUNC_OFFSET(13261, glVertexAttrib2fNV, glVertexAttrib2fNV, NULL, 768),
- NAME_FUNC_OFFSET(13280, glVertexAttrib2fvNV, glVertexAttrib2fvNV, NULL, 769),
- NAME_FUNC_OFFSET(13300, glVertexAttrib2sNV, glVertexAttrib2sNV, NULL, 770),
- NAME_FUNC_OFFSET(13319, glVertexAttrib2svNV, glVertexAttrib2svNV, NULL, 771),
- NAME_FUNC_OFFSET(13339, glVertexAttrib3dNV, glVertexAttrib3dNV, NULL, 772),
- NAME_FUNC_OFFSET(13358, glVertexAttrib3dvNV, glVertexAttrib3dvNV, NULL, 773),
- NAME_FUNC_OFFSET(13378, glVertexAttrib3fNV, glVertexAttrib3fNV, NULL, 774),
- NAME_FUNC_OFFSET(13397, glVertexAttrib3fvNV, glVertexAttrib3fvNV, NULL, 775),
- NAME_FUNC_OFFSET(13417, glVertexAttrib3sNV, glVertexAttrib3sNV, NULL, 776),
- NAME_FUNC_OFFSET(13436, glVertexAttrib3svNV, glVertexAttrib3svNV, NULL, 777),
- NAME_FUNC_OFFSET(13456, glVertexAttrib4dNV, glVertexAttrib4dNV, NULL, 778),
- NAME_FUNC_OFFSET(13475, glVertexAttrib4dvNV, glVertexAttrib4dvNV, NULL, 779),
- NAME_FUNC_OFFSET(13495, glVertexAttrib4fNV, glVertexAttrib4fNV, NULL, 780),
- NAME_FUNC_OFFSET(13514, glVertexAttrib4fvNV, glVertexAttrib4fvNV, NULL, 781),
- NAME_FUNC_OFFSET(13534, glVertexAttrib4sNV, glVertexAttrib4sNV, NULL, 782),
- NAME_FUNC_OFFSET(13553, glVertexAttrib4svNV, glVertexAttrib4svNV, NULL, 783),
- NAME_FUNC_OFFSET(13573, glVertexAttrib4ubNV, glVertexAttrib4ubNV, NULL, 784),
- NAME_FUNC_OFFSET(13593, glVertexAttrib4ubvNV, glVertexAttrib4ubvNV, NULL, 785),
- NAME_FUNC_OFFSET(13614, glVertexAttribPointerNV, glVertexAttribPointerNV, NULL, 786),
- NAME_FUNC_OFFSET(13638, glVertexAttribs1dvNV, glVertexAttribs1dvNV, NULL, 787),
- NAME_FUNC_OFFSET(13659, glVertexAttribs1fvNV, glVertexAttribs1fvNV, NULL, 788),
- NAME_FUNC_OFFSET(13680, glVertexAttribs1svNV, glVertexAttribs1svNV, NULL, 789),
- NAME_FUNC_OFFSET(13701, glVertexAttribs2dvNV, glVertexAttribs2dvNV, NULL, 790),
- NAME_FUNC_OFFSET(13722, glVertexAttribs2fvNV, glVertexAttribs2fvNV, NULL, 791),
- NAME_FUNC_OFFSET(13743, glVertexAttribs2svNV, glVertexAttribs2svNV, NULL, 792),
- NAME_FUNC_OFFSET(13764, glVertexAttribs3dvNV, glVertexAttribs3dvNV, NULL, 793),
- NAME_FUNC_OFFSET(13785, glVertexAttribs3fvNV, glVertexAttribs3fvNV, NULL, 794),
- NAME_FUNC_OFFSET(13806, glVertexAttribs3svNV, glVertexAttribs3svNV, NULL, 795),
- NAME_FUNC_OFFSET(13827, glVertexAttribs4dvNV, glVertexAttribs4dvNV, NULL, 796),
- NAME_FUNC_OFFSET(13848, glVertexAttribs4fvNV, glVertexAttribs4fvNV, NULL, 797),
- NAME_FUNC_OFFSET(13869, glVertexAttribs4svNV, glVertexAttribs4svNV, NULL, 798),
- NAME_FUNC_OFFSET(13890, glVertexAttribs4ubvNV, glVertexAttribs4ubvNV, NULL, 799),
- NAME_FUNC_OFFSET(13912, glGetTexBumpParameterfvATI, glGetTexBumpParameterfvATI, NULL, 800),
- NAME_FUNC_OFFSET(13939, glGetTexBumpParameterivATI, glGetTexBumpParameterivATI, NULL, 801),
- NAME_FUNC_OFFSET(13966, glTexBumpParameterfvATI, glTexBumpParameterfvATI, NULL, 802),
- NAME_FUNC_OFFSET(13990, glTexBumpParameterivATI, glTexBumpParameterivATI, NULL, 803),
- NAME_FUNC_OFFSET(14014, glAlphaFragmentOp1ATI, glAlphaFragmentOp1ATI, NULL, 804),
- NAME_FUNC_OFFSET(14036, glAlphaFragmentOp2ATI, glAlphaFragmentOp2ATI, NULL, 805),
- NAME_FUNC_OFFSET(14058, glAlphaFragmentOp3ATI, glAlphaFragmentOp3ATI, NULL, 806),
- NAME_FUNC_OFFSET(14080, glBeginFragmentShaderATI, glBeginFragmentShaderATI, NULL, 807),
- NAME_FUNC_OFFSET(14105, glBindFragmentShaderATI, glBindFragmentShaderATI, NULL, 808),
- NAME_FUNC_OFFSET(14129, glColorFragmentOp1ATI, glColorFragmentOp1ATI, NULL, 809),
- NAME_FUNC_OFFSET(14151, glColorFragmentOp2ATI, glColorFragmentOp2ATI, NULL, 810),
- NAME_FUNC_OFFSET(14173, glColorFragmentOp3ATI, glColorFragmentOp3ATI, NULL, 811),
- NAME_FUNC_OFFSET(14195, glDeleteFragmentShaderATI, glDeleteFragmentShaderATI, NULL, 812),
- NAME_FUNC_OFFSET(14221, glEndFragmentShaderATI, glEndFragmentShaderATI, NULL, 813),
- NAME_FUNC_OFFSET(14244, glGenFragmentShadersATI, glGenFragmentShadersATI, NULL, 814),
- NAME_FUNC_OFFSET(14268, glPassTexCoordATI, glPassTexCoordATI, NULL, 815),
- NAME_FUNC_OFFSET(14286, glSampleMapATI, glSampleMapATI, NULL, 816),
- NAME_FUNC_OFFSET(14301, glSetFragmentShaderConstantATI, glSetFragmentShaderConstantATI, NULL, 817),
- NAME_FUNC_OFFSET(14332, glPointParameteriNV, glPointParameteriNV, NULL, 818),
- NAME_FUNC_OFFSET(14352, glPointParameterivNV, glPointParameterivNV, NULL, 819),
- NAME_FUNC_OFFSET(14373, gl_dispatch_stub_820, gl_dispatch_stub_820, NULL, 820),
- NAME_FUNC_OFFSET(14396, gl_dispatch_stub_821, gl_dispatch_stub_821, NULL, 821),
- NAME_FUNC_OFFSET(14419, gl_dispatch_stub_822, gl_dispatch_stub_822, NULL, 822),
- NAME_FUNC_OFFSET(14445, gl_dispatch_stub_823, gl_dispatch_stub_823, NULL, 823),
- NAME_FUNC_OFFSET(14468, gl_dispatch_stub_824, gl_dispatch_stub_824, NULL, 824),
- NAME_FUNC_OFFSET(14489, glGetProgramNamedParameterdvNV, glGetProgramNamedParameterdvNV, NULL, 825),
- NAME_FUNC_OFFSET(14520, glGetProgramNamedParameterfvNV, glGetProgramNamedParameterfvNV, NULL, 826),
- NAME_FUNC_OFFSET(14551, glProgramNamedParameter4dNV, glProgramNamedParameter4dNV, NULL, 827),
- NAME_FUNC_OFFSET(14579, glProgramNamedParameter4dvNV, glProgramNamedParameter4dvNV, NULL, 828),
- NAME_FUNC_OFFSET(14608, glProgramNamedParameter4fNV, glProgramNamedParameter4fNV, NULL, 829),
- NAME_FUNC_OFFSET(14636, glProgramNamedParameter4fvNV, glProgramNamedParameter4fvNV, NULL, 830),
- NAME_FUNC_OFFSET(14665, glPrimitiveRestartIndexNV, glPrimitiveRestartIndexNV, NULL, 831),
- NAME_FUNC_OFFSET(14691, glPrimitiveRestartNV, glPrimitiveRestartNV, NULL, 832),
- NAME_FUNC_OFFSET(14712, gl_dispatch_stub_833, gl_dispatch_stub_833, NULL, 833),
- NAME_FUNC_OFFSET(14729, gl_dispatch_stub_834, gl_dispatch_stub_834, NULL, 834),
- NAME_FUNC_OFFSET(14756, glBindFramebufferEXT, glBindFramebufferEXT, NULL, 835),
- NAME_FUNC_OFFSET(14777, glBindRenderbufferEXT, glBindRenderbufferEXT, NULL, 836),
- NAME_FUNC_OFFSET(14799, glCheckFramebufferStatusEXT, glCheckFramebufferStatusEXT, NULL, 837),
- NAME_FUNC_OFFSET(14827, glDeleteFramebuffersEXT, glDeleteFramebuffersEXT, NULL, 838),
- NAME_FUNC_OFFSET(14851, glDeleteRenderbuffersEXT, glDeleteRenderbuffersEXT, NULL, 839),
- NAME_FUNC_OFFSET(14876, glFramebufferRenderbufferEXT, glFramebufferRenderbufferEXT, NULL, 840),
- NAME_FUNC_OFFSET(14905, glFramebufferTexture1DEXT, glFramebufferTexture1DEXT, NULL, 841),
- NAME_FUNC_OFFSET(14931, glFramebufferTexture2DEXT, glFramebufferTexture2DEXT, NULL, 842),
- NAME_FUNC_OFFSET(14957, glFramebufferTexture3DEXT, glFramebufferTexture3DEXT, NULL, 843),
- NAME_FUNC_OFFSET(14983, glGenFramebuffersEXT, glGenFramebuffersEXT, NULL, 844),
- NAME_FUNC_OFFSET(15004, glGenRenderbuffersEXT, glGenRenderbuffersEXT, NULL, 845),
- NAME_FUNC_OFFSET(15026, glGenerateMipmapEXT, glGenerateMipmapEXT, NULL, 846),
- NAME_FUNC_OFFSET(15046, glGetFramebufferAttachmentParameterivEXT, glGetFramebufferAttachmentParameterivEXT, NULL, 847),
- NAME_FUNC_OFFSET(15087, glGetRenderbufferParameterivEXT, glGetRenderbufferParameterivEXT, NULL, 848),
- NAME_FUNC_OFFSET(15119, glIsFramebufferEXT, glIsFramebufferEXT, NULL, 849),
- NAME_FUNC_OFFSET(15138, glIsRenderbufferEXT, glIsRenderbufferEXT, NULL, 850),
- NAME_FUNC_OFFSET(15158, glRenderbufferStorageEXT, glRenderbufferStorageEXT, NULL, 851),
- NAME_FUNC_OFFSET(15183, gl_dispatch_stub_852, gl_dispatch_stub_852, NULL, 852),
- NAME_FUNC_OFFSET(15204, gl_dispatch_stub_853, gl_dispatch_stub_853, NULL, 853),
- NAME_FUNC_OFFSET(15228, gl_dispatch_stub_854, gl_dispatch_stub_854, NULL, 854),
- NAME_FUNC_OFFSET(15258, glBindFragDataLocationEXT, glBindFragDataLocationEXT, NULL, 855),
- NAME_FUNC_OFFSET(15284, glGetFragDataLocationEXT, glGetFragDataLocationEXT, NULL, 856),
- NAME_FUNC_OFFSET(15309, glGetUniformuivEXT, glGetUniformuivEXT, NULL, 857),
- NAME_FUNC_OFFSET(15328, glGetVertexAttribIivEXT, glGetVertexAttribIivEXT, NULL, 858),
- NAME_FUNC_OFFSET(15352, glGetVertexAttribIuivEXT, glGetVertexAttribIuivEXT, NULL, 859),
- NAME_FUNC_OFFSET(15377, glUniform1uiEXT, glUniform1uiEXT, NULL, 860),
- NAME_FUNC_OFFSET(15393, glUniform1uivEXT, glUniform1uivEXT, NULL, 861),
- NAME_FUNC_OFFSET(15410, glUniform2uiEXT, glUniform2uiEXT, NULL, 862),
- NAME_FUNC_OFFSET(15426, glUniform2uivEXT, glUniform2uivEXT, NULL, 863),
- NAME_FUNC_OFFSET(15443, glUniform3uiEXT, glUniform3uiEXT, NULL, 864),
- NAME_FUNC_OFFSET(15459, glUniform3uivEXT, glUniform3uivEXT, NULL, 865),
- NAME_FUNC_OFFSET(15476, glUniform4uiEXT, glUniform4uiEXT, NULL, 866),
- NAME_FUNC_OFFSET(15492, glUniform4uivEXT, glUniform4uivEXT, NULL, 867),
- NAME_FUNC_OFFSET(15509, glVertexAttribI1iEXT, glVertexAttribI1iEXT, NULL, 868),
- NAME_FUNC_OFFSET(15530, glVertexAttribI1ivEXT, glVertexAttribI1ivEXT, NULL, 869),
- NAME_FUNC_OFFSET(15552, glVertexAttribI1uiEXT, glVertexAttribI1uiEXT, NULL, 870),
- NAME_FUNC_OFFSET(15574, glVertexAttribI1uivEXT, glVertexAttribI1uivEXT, NULL, 871),
- NAME_FUNC_OFFSET(15597, glVertexAttribI2iEXT, glVertexAttribI2iEXT, NULL, 872),
- NAME_FUNC_OFFSET(15618, glVertexAttribI2ivEXT, glVertexAttribI2ivEXT, NULL, 873),
- NAME_FUNC_OFFSET(15640, glVertexAttribI2uiEXT, glVertexAttribI2uiEXT, NULL, 874),
- NAME_FUNC_OFFSET(15662, glVertexAttribI2uivEXT, glVertexAttribI2uivEXT, NULL, 875),
- NAME_FUNC_OFFSET(15685, glVertexAttribI3iEXT, glVertexAttribI3iEXT, NULL, 876),
- NAME_FUNC_OFFSET(15706, glVertexAttribI3ivEXT, glVertexAttribI3ivEXT, NULL, 877),
- NAME_FUNC_OFFSET(15728, glVertexAttribI3uiEXT, glVertexAttribI3uiEXT, NULL, 878),
- NAME_FUNC_OFFSET(15750, glVertexAttribI3uivEXT, glVertexAttribI3uivEXT, NULL, 879),
- NAME_FUNC_OFFSET(15773, glVertexAttribI4bvEXT, glVertexAttribI4bvEXT, NULL, 880),
- NAME_FUNC_OFFSET(15795, glVertexAttribI4iEXT, glVertexAttribI4iEXT, NULL, 881),
- NAME_FUNC_OFFSET(15816, glVertexAttribI4ivEXT, glVertexAttribI4ivEXT, NULL, 882),
- NAME_FUNC_OFFSET(15838, glVertexAttribI4svEXT, glVertexAttribI4svEXT, NULL, 883),
- NAME_FUNC_OFFSET(15860, glVertexAttribI4ubvEXT, glVertexAttribI4ubvEXT, NULL, 884),
- NAME_FUNC_OFFSET(15883, glVertexAttribI4uiEXT, glVertexAttribI4uiEXT, NULL, 885),
- NAME_FUNC_OFFSET(15905, glVertexAttribI4uivEXT, glVertexAttribI4uivEXT, NULL, 886),
- NAME_FUNC_OFFSET(15928, glVertexAttribI4usvEXT, glVertexAttribI4usvEXT, NULL, 887),
- NAME_FUNC_OFFSET(15951, glVertexAttribIPointerEXT, glVertexAttribIPointerEXT, NULL, 888),
- NAME_FUNC_OFFSET(15977, glFramebufferTextureLayerEXT, glFramebufferTextureLayerEXT, NULL, 889),
- NAME_FUNC_OFFSET(16006, glColorMaskIndexedEXT, glColorMaskIndexedEXT, NULL, 890),
- NAME_FUNC_OFFSET(16028, glDisableIndexedEXT, glDisableIndexedEXT, NULL, 891),
- NAME_FUNC_OFFSET(16048, glEnableIndexedEXT, glEnableIndexedEXT, NULL, 892),
- NAME_FUNC_OFFSET(16067, glGetBooleanIndexedvEXT, glGetBooleanIndexedvEXT, NULL, 893),
- NAME_FUNC_OFFSET(16091, glGetIntegerIndexedvEXT, glGetIntegerIndexedvEXT, NULL, 894),
- NAME_FUNC_OFFSET(16115, glIsEnabledIndexedEXT, glIsEnabledIndexedEXT, NULL, 895),
- NAME_FUNC_OFFSET(16137, glClearColorIiEXT, glClearColorIiEXT, NULL, 896),
- NAME_FUNC_OFFSET(16155, glClearColorIuiEXT, glClearColorIuiEXT, NULL, 897),
- NAME_FUNC_OFFSET(16174, glGetTexParameterIivEXT, glGetTexParameterIivEXT, NULL, 898),
- NAME_FUNC_OFFSET(16198, glGetTexParameterIuivEXT, glGetTexParameterIuivEXT, NULL, 899),
- NAME_FUNC_OFFSET(16223, glTexParameterIivEXT, glTexParameterIivEXT, NULL, 900),
- NAME_FUNC_OFFSET(16244, glTexParameterIuivEXT, glTexParameterIuivEXT, NULL, 901),
- NAME_FUNC_OFFSET(16266, glBeginConditionalRenderNV, glBeginConditionalRenderNV, NULL, 902),
- NAME_FUNC_OFFSET(16293, glEndConditionalRenderNV, glEndConditionalRenderNV, NULL, 903),
- NAME_FUNC_OFFSET(16318, glBeginTransformFeedbackEXT, glBeginTransformFeedbackEXT, NULL, 904),
- NAME_FUNC_OFFSET(16346, glBindBufferBaseEXT, glBindBufferBaseEXT, NULL, 905),
- NAME_FUNC_OFFSET(16366, glBindBufferOffsetEXT, glBindBufferOffsetEXT, NULL, 906),
- NAME_FUNC_OFFSET(16388, glBindBufferRangeEXT, glBindBufferRangeEXT, NULL, 907),
- NAME_FUNC_OFFSET(16409, glEndTransformFeedbackEXT, glEndTransformFeedbackEXT, NULL, 908),
- NAME_FUNC_OFFSET(16435, glGetTransformFeedbackVaryingEXT, glGetTransformFeedbackVaryingEXT, NULL, 909),
- NAME_FUNC_OFFSET(16468, glTransformFeedbackVaryingsEXT, glTransformFeedbackVaryingsEXT, NULL, 910),
- NAME_FUNC_OFFSET(16499, glProvokingVertexEXT, glProvokingVertexEXT, NULL, 911),
- NAME_FUNC_OFFSET(16520, gl_dispatch_stub_912, gl_dispatch_stub_912, NULL, 912),
- NAME_FUNC_OFFSET(16551, gl_dispatch_stub_913, gl_dispatch_stub_913, NULL, 913),
- NAME_FUNC_OFFSET(16571, glGetObjectParameterivAPPLE, glGetObjectParameterivAPPLE, NULL, 914),
- NAME_FUNC_OFFSET(16599, glObjectPurgeableAPPLE, glObjectPurgeableAPPLE, NULL, 915),
- NAME_FUNC_OFFSET(16622, glObjectUnpurgeableAPPLE, glObjectUnpurgeableAPPLE, NULL, 916),
- NAME_FUNC_OFFSET(16647, glActiveProgramEXT, glActiveProgramEXT, NULL, 917),
- NAME_FUNC_OFFSET(16666, glCreateShaderProgramEXT, glCreateShaderProgramEXT, NULL, 918),
- NAME_FUNC_OFFSET(16691, glUseShaderProgramEXT, glUseShaderProgramEXT, NULL, 919),
- NAME_FUNC_OFFSET(16713, glTextureBarrierNV, glTextureBarrierNV, NULL, 920),
- NAME_FUNC_OFFSET(16732, gl_dispatch_stub_921, gl_dispatch_stub_921, NULL, 921),
- NAME_FUNC_OFFSET(16757, gl_dispatch_stub_922, gl_dispatch_stub_922, NULL, 922),
- NAME_FUNC_OFFSET(16786, gl_dispatch_stub_923, gl_dispatch_stub_923, NULL, 923),
- NAME_FUNC_OFFSET(16817, gl_dispatch_stub_924, gl_dispatch_stub_924, NULL, 924),
- NAME_FUNC_OFFSET(16841, gl_dispatch_stub_925, gl_dispatch_stub_925, NULL, 925),
- NAME_FUNC_OFFSET(16866, glEGLImageTargetRenderbufferStorageOES, glEGLImageTargetRenderbufferStorageOES, NULL, 926),
- NAME_FUNC_OFFSET(16905, glEGLImageTargetTexture2DOES, glEGLImageTargetTexture2DOES, NULL, 927),
- NAME_FUNC_OFFSET(16934, glArrayElement, glArrayElement, NULL, 306),
- NAME_FUNC_OFFSET(16952, glBindTexture, glBindTexture, NULL, 307),
- NAME_FUNC_OFFSET(16969, glDrawArrays, glDrawArrays, NULL, 310),
- NAME_FUNC_OFFSET(16985, glAreTexturesResident, glAreTexturesResidentEXT, glAreTexturesResidentEXT, 322),
- NAME_FUNC_OFFSET(17010, glCopyTexImage1D, glCopyTexImage1D, NULL, 323),
- NAME_FUNC_OFFSET(17030, glCopyTexImage2D, glCopyTexImage2D, NULL, 324),
- NAME_FUNC_OFFSET(17050, glCopyTexSubImage1D, glCopyTexSubImage1D, NULL, 325),
- NAME_FUNC_OFFSET(17073, glCopyTexSubImage2D, glCopyTexSubImage2D, NULL, 326),
- NAME_FUNC_OFFSET(17096, glDeleteTextures, glDeleteTexturesEXT, glDeleteTexturesEXT, 327),
- NAME_FUNC_OFFSET(17116, glGenTextures, glGenTexturesEXT, glGenTexturesEXT, 328),
- NAME_FUNC_OFFSET(17133, glGetPointerv, glGetPointerv, NULL, 329),
- NAME_FUNC_OFFSET(17150, glIsTexture, glIsTextureEXT, glIsTextureEXT, 330),
- NAME_FUNC_OFFSET(17165, glPrioritizeTextures, glPrioritizeTextures, NULL, 331),
- NAME_FUNC_OFFSET(17189, glTexSubImage1D, glTexSubImage1D, NULL, 332),
- NAME_FUNC_OFFSET(17208, glTexSubImage2D, glTexSubImage2D, NULL, 333),
- NAME_FUNC_OFFSET(17227, glBlendColor, glBlendColor, NULL, 336),
- NAME_FUNC_OFFSET(17243, glBlendEquation, glBlendEquation, NULL, 337),
- NAME_FUNC_OFFSET(17262, glDrawRangeElements, glDrawRangeElements, NULL, 338),
- NAME_FUNC_OFFSET(17285, glColorTable, glColorTable, NULL, 339),
- NAME_FUNC_OFFSET(17301, glColorTable, glColorTable, NULL, 339),
- NAME_FUNC_OFFSET(17317, glColorTableParameterfv, glColorTableParameterfv, NULL, 340),
- NAME_FUNC_OFFSET(17344, glColorTableParameteriv, glColorTableParameteriv, NULL, 341),
- NAME_FUNC_OFFSET(17371, glCopyColorTable, glCopyColorTable, NULL, 342),
- NAME_FUNC_OFFSET(17391, glGetColorTable, glGetColorTableEXT, glGetColorTableEXT, 343),
- NAME_FUNC_OFFSET(17410, glGetColorTable, glGetColorTableEXT, glGetColorTableEXT, 343),
- NAME_FUNC_OFFSET(17429, glGetColorTableParameterfv, glGetColorTableParameterfvEXT, glGetColorTableParameterfvEXT, 344),
- NAME_FUNC_OFFSET(17459, glGetColorTableParameterfv, glGetColorTableParameterfvEXT, glGetColorTableParameterfvEXT, 344),
- NAME_FUNC_OFFSET(17489, glGetColorTableParameteriv, glGetColorTableParameterivEXT, glGetColorTableParameterivEXT, 345),
- NAME_FUNC_OFFSET(17519, glGetColorTableParameteriv, glGetColorTableParameterivEXT, glGetColorTableParameterivEXT, 345),
- NAME_FUNC_OFFSET(17549, glColorSubTable, glColorSubTable, NULL, 346),
- NAME_FUNC_OFFSET(17568, glCopyColorSubTable, glCopyColorSubTable, NULL, 347),
- NAME_FUNC_OFFSET(17591, glConvolutionFilter1D, glConvolutionFilter1D, NULL, 348),
- NAME_FUNC_OFFSET(17616, glConvolutionFilter2D, glConvolutionFilter2D, NULL, 349),
- NAME_FUNC_OFFSET(17641, glConvolutionParameterf, glConvolutionParameterf, NULL, 350),
- NAME_FUNC_OFFSET(17668, glConvolutionParameterfv, glConvolutionParameterfv, NULL, 351),
- NAME_FUNC_OFFSET(17696, glConvolutionParameteri, glConvolutionParameteri, NULL, 352),
- NAME_FUNC_OFFSET(17723, glConvolutionParameteriv, glConvolutionParameteriv, NULL, 353),
- NAME_FUNC_OFFSET(17751, glCopyConvolutionFilter1D, glCopyConvolutionFilter1D, NULL, 354),
- NAME_FUNC_OFFSET(17780, glCopyConvolutionFilter2D, glCopyConvolutionFilter2D, NULL, 355),
- NAME_FUNC_OFFSET(17809, glGetConvolutionFilter, gl_dispatch_stub_356, gl_dispatch_stub_356, 356),
- NAME_FUNC_OFFSET(17835, glGetConvolutionParameterfv, gl_dispatch_stub_357, gl_dispatch_stub_357, 357),
- NAME_FUNC_OFFSET(17866, glGetConvolutionParameteriv, gl_dispatch_stub_358, gl_dispatch_stub_358, 358),
- NAME_FUNC_OFFSET(17897, glGetSeparableFilter, gl_dispatch_stub_359, gl_dispatch_stub_359, 359),
- NAME_FUNC_OFFSET(17921, glSeparableFilter2D, glSeparableFilter2D, NULL, 360),
- NAME_FUNC_OFFSET(17944, glGetHistogram, gl_dispatch_stub_361, gl_dispatch_stub_361, 361),
- NAME_FUNC_OFFSET(17962, glGetHistogramParameterfv, gl_dispatch_stub_362, gl_dispatch_stub_362, 362),
- NAME_FUNC_OFFSET(17991, glGetHistogramParameteriv, gl_dispatch_stub_363, gl_dispatch_stub_363, 363),
- NAME_FUNC_OFFSET(18020, glGetMinmax, gl_dispatch_stub_364, gl_dispatch_stub_364, 364),
- NAME_FUNC_OFFSET(18035, glGetMinmaxParameterfv, gl_dispatch_stub_365, gl_dispatch_stub_365, 365),
- NAME_FUNC_OFFSET(18061, glGetMinmaxParameteriv, gl_dispatch_stub_366, gl_dispatch_stub_366, 366),
- NAME_FUNC_OFFSET(18087, glHistogram, glHistogram, NULL, 367),
- NAME_FUNC_OFFSET(18102, glMinmax, glMinmax, NULL, 368),
- NAME_FUNC_OFFSET(18114, glResetHistogram, glResetHistogram, NULL, 369),
- NAME_FUNC_OFFSET(18134, glResetMinmax, glResetMinmax, NULL, 370),
- NAME_FUNC_OFFSET(18151, glTexImage3D, glTexImage3D, NULL, 371),
- NAME_FUNC_OFFSET(18167, glTexSubImage3D, glTexSubImage3D, NULL, 372),
- NAME_FUNC_OFFSET(18186, glCopyTexSubImage3D, glCopyTexSubImage3D, NULL, 373),
- NAME_FUNC_OFFSET(18209, glActiveTextureARB, glActiveTextureARB, NULL, 374),
- NAME_FUNC_OFFSET(18225, glClientActiveTextureARB, glClientActiveTextureARB, NULL, 375),
- NAME_FUNC_OFFSET(18247, glMultiTexCoord1dARB, glMultiTexCoord1dARB, NULL, 376),
- NAME_FUNC_OFFSET(18265, glMultiTexCoord1dvARB, glMultiTexCoord1dvARB, NULL, 377),
- NAME_FUNC_OFFSET(18284, glMultiTexCoord1fARB, glMultiTexCoord1fARB, NULL, 378),
- NAME_FUNC_OFFSET(18302, glMultiTexCoord1fvARB, glMultiTexCoord1fvARB, NULL, 379),
- NAME_FUNC_OFFSET(18321, glMultiTexCoord1iARB, glMultiTexCoord1iARB, NULL, 380),
- NAME_FUNC_OFFSET(18339, glMultiTexCoord1ivARB, glMultiTexCoord1ivARB, NULL, 381),
- NAME_FUNC_OFFSET(18358, glMultiTexCoord1sARB, glMultiTexCoord1sARB, NULL, 382),
- NAME_FUNC_OFFSET(18376, glMultiTexCoord1svARB, glMultiTexCoord1svARB, NULL, 383),
- NAME_FUNC_OFFSET(18395, glMultiTexCoord2dARB, glMultiTexCoord2dARB, NULL, 384),
- NAME_FUNC_OFFSET(18413, glMultiTexCoord2dvARB, glMultiTexCoord2dvARB, NULL, 385),
- NAME_FUNC_OFFSET(18432, glMultiTexCoord2fARB, glMultiTexCoord2fARB, NULL, 386),
- NAME_FUNC_OFFSET(18450, glMultiTexCoord2fvARB, glMultiTexCoord2fvARB, NULL, 387),
- NAME_FUNC_OFFSET(18469, glMultiTexCoord2iARB, glMultiTexCoord2iARB, NULL, 388),
- NAME_FUNC_OFFSET(18487, glMultiTexCoord2ivARB, glMultiTexCoord2ivARB, NULL, 389),
- NAME_FUNC_OFFSET(18506, glMultiTexCoord2sARB, glMultiTexCoord2sARB, NULL, 390),
- NAME_FUNC_OFFSET(18524, glMultiTexCoord2svARB, glMultiTexCoord2svARB, NULL, 391),
- NAME_FUNC_OFFSET(18543, glMultiTexCoord3dARB, glMultiTexCoord3dARB, NULL, 392),
- NAME_FUNC_OFFSET(18561, glMultiTexCoord3dvARB, glMultiTexCoord3dvARB, NULL, 393),
- NAME_FUNC_OFFSET(18580, glMultiTexCoord3fARB, glMultiTexCoord3fARB, NULL, 394),
- NAME_FUNC_OFFSET(18598, glMultiTexCoord3fvARB, glMultiTexCoord3fvARB, NULL, 395),
- NAME_FUNC_OFFSET(18617, glMultiTexCoord3iARB, glMultiTexCoord3iARB, NULL, 396),
- NAME_FUNC_OFFSET(18635, glMultiTexCoord3ivARB, glMultiTexCoord3ivARB, NULL, 397),
- NAME_FUNC_OFFSET(18654, glMultiTexCoord3sARB, glMultiTexCoord3sARB, NULL, 398),
- NAME_FUNC_OFFSET(18672, glMultiTexCoord3svARB, glMultiTexCoord3svARB, NULL, 399),
- NAME_FUNC_OFFSET(18691, glMultiTexCoord4dARB, glMultiTexCoord4dARB, NULL, 400),
- NAME_FUNC_OFFSET(18709, glMultiTexCoord4dvARB, glMultiTexCoord4dvARB, NULL, 401),
- NAME_FUNC_OFFSET(18728, glMultiTexCoord4fARB, glMultiTexCoord4fARB, NULL, 402),
- NAME_FUNC_OFFSET(18746, glMultiTexCoord4fvARB, glMultiTexCoord4fvARB, NULL, 403),
- NAME_FUNC_OFFSET(18765, glMultiTexCoord4iARB, glMultiTexCoord4iARB, NULL, 404),
- NAME_FUNC_OFFSET(18783, glMultiTexCoord4ivARB, glMultiTexCoord4ivARB, NULL, 405),
- NAME_FUNC_OFFSET(18802, glMultiTexCoord4sARB, glMultiTexCoord4sARB, NULL, 406),
- NAME_FUNC_OFFSET(18820, glMultiTexCoord4svARB, glMultiTexCoord4svARB, NULL, 407),
- NAME_FUNC_OFFSET(18839, glStencilOpSeparate, glStencilOpSeparate, NULL, 423),
- NAME_FUNC_OFFSET(18862, glLoadTransposeMatrixdARB, glLoadTransposeMatrixdARB, NULL, 441),
- NAME_FUNC_OFFSET(18885, glLoadTransposeMatrixfARB, glLoadTransposeMatrixfARB, NULL, 442),
- NAME_FUNC_OFFSET(18908, glMultTransposeMatrixdARB, glMultTransposeMatrixdARB, NULL, 443),
- NAME_FUNC_OFFSET(18931, glMultTransposeMatrixfARB, glMultTransposeMatrixfARB, NULL, 444),
- NAME_FUNC_OFFSET(18954, glSampleCoverageARB, glSampleCoverageARB, NULL, 445),
- NAME_FUNC_OFFSET(18971, glCompressedTexImage1DARB, glCompressedTexImage1DARB, NULL, 446),
- NAME_FUNC_OFFSET(18994, glCompressedTexImage2DARB, glCompressedTexImage2DARB, NULL, 447),
- NAME_FUNC_OFFSET(19017, glCompressedTexImage3DARB, glCompressedTexImage3DARB, NULL, 448),
- NAME_FUNC_OFFSET(19040, glCompressedTexSubImage1DARB, glCompressedTexSubImage1DARB, NULL, 449),
- NAME_FUNC_OFFSET(19066, glCompressedTexSubImage2DARB, glCompressedTexSubImage2DARB, NULL, 450),
- NAME_FUNC_OFFSET(19092, glCompressedTexSubImage3DARB, glCompressedTexSubImage3DARB, NULL, 451),
- NAME_FUNC_OFFSET(19118, glGetCompressedTexImageARB, glGetCompressedTexImageARB, NULL, 452),
- NAME_FUNC_OFFSET(19142, glDisableVertexAttribArrayARB, glDisableVertexAttribArrayARB, NULL, 453),
- NAME_FUNC_OFFSET(19169, glEnableVertexAttribArrayARB, glEnableVertexAttribArrayARB, NULL, 454),
- NAME_FUNC_OFFSET(19195, glGetVertexAttribdvARB, glGetVertexAttribdvARB, NULL, 461),
- NAME_FUNC_OFFSET(19215, glGetVertexAttribfvARB, glGetVertexAttribfvARB, NULL, 462),
- NAME_FUNC_OFFSET(19235, glGetVertexAttribivARB, glGetVertexAttribivARB, NULL, 463),
- NAME_FUNC_OFFSET(19255, glProgramEnvParameter4dARB, glProgramEnvParameter4dARB, NULL, 464),
- NAME_FUNC_OFFSET(19278, glProgramEnvParameter4dvARB, glProgramEnvParameter4dvARB, NULL, 465),
- NAME_FUNC_OFFSET(19302, glProgramEnvParameter4fARB, glProgramEnvParameter4fARB, NULL, 466),
- NAME_FUNC_OFFSET(19325, glProgramEnvParameter4fvARB, glProgramEnvParameter4fvARB, NULL, 467),
- NAME_FUNC_OFFSET(19349, glVertexAttrib1dARB, glVertexAttrib1dARB, NULL, 473),
- NAME_FUNC_OFFSET(19366, glVertexAttrib1dvARB, glVertexAttrib1dvARB, NULL, 474),
- NAME_FUNC_OFFSET(19384, glVertexAttrib1fARB, glVertexAttrib1fARB, NULL, 475),
- NAME_FUNC_OFFSET(19401, glVertexAttrib1fvARB, glVertexAttrib1fvARB, NULL, 476),
- NAME_FUNC_OFFSET(19419, glVertexAttrib1sARB, glVertexAttrib1sARB, NULL, 477),
- NAME_FUNC_OFFSET(19436, glVertexAttrib1svARB, glVertexAttrib1svARB, NULL, 478),
- NAME_FUNC_OFFSET(19454, glVertexAttrib2dARB, glVertexAttrib2dARB, NULL, 479),
- NAME_FUNC_OFFSET(19471, glVertexAttrib2dvARB, glVertexAttrib2dvARB, NULL, 480),
- NAME_FUNC_OFFSET(19489, glVertexAttrib2fARB, glVertexAttrib2fARB, NULL, 481),
- NAME_FUNC_OFFSET(19506, glVertexAttrib2fvARB, glVertexAttrib2fvARB, NULL, 482),
- NAME_FUNC_OFFSET(19524, glVertexAttrib2sARB, glVertexAttrib2sARB, NULL, 483),
- NAME_FUNC_OFFSET(19541, glVertexAttrib2svARB, glVertexAttrib2svARB, NULL, 484),
- NAME_FUNC_OFFSET(19559, glVertexAttrib3dARB, glVertexAttrib3dARB, NULL, 485),
- NAME_FUNC_OFFSET(19576, glVertexAttrib3dvARB, glVertexAttrib3dvARB, NULL, 486),
- NAME_FUNC_OFFSET(19594, glVertexAttrib3fARB, glVertexAttrib3fARB, NULL, 487),
- NAME_FUNC_OFFSET(19611, glVertexAttrib3fvARB, glVertexAttrib3fvARB, NULL, 488),
- NAME_FUNC_OFFSET(19629, glVertexAttrib3sARB, glVertexAttrib3sARB, NULL, 489),
- NAME_FUNC_OFFSET(19646, glVertexAttrib3svARB, glVertexAttrib3svARB, NULL, 490),
- NAME_FUNC_OFFSET(19664, glVertexAttrib4NbvARB, glVertexAttrib4NbvARB, NULL, 491),
- NAME_FUNC_OFFSET(19683, glVertexAttrib4NivARB, glVertexAttrib4NivARB, NULL, 492),
- NAME_FUNC_OFFSET(19702, glVertexAttrib4NsvARB, glVertexAttrib4NsvARB, NULL, 493),
- NAME_FUNC_OFFSET(19721, glVertexAttrib4NubARB, glVertexAttrib4NubARB, NULL, 494),
- NAME_FUNC_OFFSET(19740, glVertexAttrib4NubvARB, glVertexAttrib4NubvARB, NULL, 495),
- NAME_FUNC_OFFSET(19760, glVertexAttrib4NuivARB, glVertexAttrib4NuivARB, NULL, 496),
- NAME_FUNC_OFFSET(19780, glVertexAttrib4NusvARB, glVertexAttrib4NusvARB, NULL, 497),
- NAME_FUNC_OFFSET(19800, glVertexAttrib4bvARB, glVertexAttrib4bvARB, NULL, 498),
- NAME_FUNC_OFFSET(19818, glVertexAttrib4dARB, glVertexAttrib4dARB, NULL, 499),
- NAME_FUNC_OFFSET(19835, glVertexAttrib4dvARB, glVertexAttrib4dvARB, NULL, 500),
- NAME_FUNC_OFFSET(19853, glVertexAttrib4fARB, glVertexAttrib4fARB, NULL, 501),
- NAME_FUNC_OFFSET(19870, glVertexAttrib4fvARB, glVertexAttrib4fvARB, NULL, 502),
- NAME_FUNC_OFFSET(19888, glVertexAttrib4ivARB, glVertexAttrib4ivARB, NULL, 503),
- NAME_FUNC_OFFSET(19906, glVertexAttrib4sARB, glVertexAttrib4sARB, NULL, 504),
- NAME_FUNC_OFFSET(19923, glVertexAttrib4svARB, glVertexAttrib4svARB, NULL, 505),
- NAME_FUNC_OFFSET(19941, glVertexAttrib4ubvARB, glVertexAttrib4ubvARB, NULL, 506),
- NAME_FUNC_OFFSET(19960, glVertexAttrib4uivARB, glVertexAttrib4uivARB, NULL, 507),
- NAME_FUNC_OFFSET(19979, glVertexAttrib4usvARB, glVertexAttrib4usvARB, NULL, 508),
- NAME_FUNC_OFFSET(19998, glVertexAttribPointerARB, glVertexAttribPointerARB, NULL, 509),
- NAME_FUNC_OFFSET(20020, glBindBufferARB, glBindBufferARB, NULL, 510),
- NAME_FUNC_OFFSET(20033, glBufferDataARB, glBufferDataARB, NULL, 511),
- NAME_FUNC_OFFSET(20046, glBufferSubDataARB, glBufferSubDataARB, NULL, 512),
- NAME_FUNC_OFFSET(20062, glDeleteBuffersARB, glDeleteBuffersARB, NULL, 513),
- NAME_FUNC_OFFSET(20078, glGenBuffersARB, glGenBuffersARB, NULL, 514),
- NAME_FUNC_OFFSET(20091, glGetBufferParameterivARB, glGetBufferParameterivARB, NULL, 515),
- NAME_FUNC_OFFSET(20114, glGetBufferPointervARB, glGetBufferPointervARB, NULL, 516),
- NAME_FUNC_OFFSET(20134, glGetBufferSubDataARB, glGetBufferSubDataARB, NULL, 517),
- NAME_FUNC_OFFSET(20153, glIsBufferARB, glIsBufferARB, NULL, 518),
- NAME_FUNC_OFFSET(20164, glMapBufferARB, glMapBufferARB, NULL, 519),
- NAME_FUNC_OFFSET(20176, glUnmapBufferARB, glUnmapBufferARB, NULL, 520),
- NAME_FUNC_OFFSET(20190, glBeginQueryARB, glBeginQueryARB, NULL, 521),
- NAME_FUNC_OFFSET(20203, glDeleteQueriesARB, glDeleteQueriesARB, NULL, 522),
- NAME_FUNC_OFFSET(20219, glEndQueryARB, glEndQueryARB, NULL, 523),
- NAME_FUNC_OFFSET(20230, glGenQueriesARB, glGenQueriesARB, NULL, 524),
- NAME_FUNC_OFFSET(20243, glGetQueryObjectivARB, glGetQueryObjectivARB, NULL, 525),
- NAME_FUNC_OFFSET(20262, glGetQueryObjectuivARB, glGetQueryObjectuivARB, NULL, 526),
- NAME_FUNC_OFFSET(20282, glGetQueryivARB, glGetQueryivARB, NULL, 527),
- NAME_FUNC_OFFSET(20295, glIsQueryARB, glIsQueryARB, NULL, 528),
- NAME_FUNC_OFFSET(20305, glCompileShaderARB, glCompileShaderARB, NULL, 530),
- NAME_FUNC_OFFSET(20321, glGetActiveUniformARB, glGetActiveUniformARB, NULL, 535),
- NAME_FUNC_OFFSET(20340, glGetShaderSourceARB, glGetShaderSourceARB, NULL, 541),
- NAME_FUNC_OFFSET(20358, glGetUniformLocationARB, glGetUniformLocationARB, NULL, 542),
- NAME_FUNC_OFFSET(20379, glGetUniformfvARB, glGetUniformfvARB, NULL, 543),
- NAME_FUNC_OFFSET(20394, glGetUniformivARB, glGetUniformivARB, NULL, 544),
- NAME_FUNC_OFFSET(20409, glLinkProgramARB, glLinkProgramARB, NULL, 545),
- NAME_FUNC_OFFSET(20423, glShaderSourceARB, glShaderSourceARB, NULL, 546),
- NAME_FUNC_OFFSET(20438, glUniform1fARB, glUniform1fARB, NULL, 547),
- NAME_FUNC_OFFSET(20450, glUniform1fvARB, glUniform1fvARB, NULL, 548),
- NAME_FUNC_OFFSET(20463, glUniform1iARB, glUniform1iARB, NULL, 549),
- NAME_FUNC_OFFSET(20475, glUniform1ivARB, glUniform1ivARB, NULL, 550),
- NAME_FUNC_OFFSET(20488, glUniform2fARB, glUniform2fARB, NULL, 551),
- NAME_FUNC_OFFSET(20500, glUniform2fvARB, glUniform2fvARB, NULL, 552),
- NAME_FUNC_OFFSET(20513, glUniform2iARB, glUniform2iARB, NULL, 553),
- NAME_FUNC_OFFSET(20525, glUniform2ivARB, glUniform2ivARB, NULL, 554),
- NAME_FUNC_OFFSET(20538, glUniform3fARB, glUniform3fARB, NULL, 555),
- NAME_FUNC_OFFSET(20550, glUniform3fvARB, glUniform3fvARB, NULL, 556),
- NAME_FUNC_OFFSET(20563, glUniform3iARB, glUniform3iARB, NULL, 557),
- NAME_FUNC_OFFSET(20575, glUniform3ivARB, glUniform3ivARB, NULL, 558),
- NAME_FUNC_OFFSET(20588, glUniform4fARB, glUniform4fARB, NULL, 559),
- NAME_FUNC_OFFSET(20600, glUniform4fvARB, glUniform4fvARB, NULL, 560),
- NAME_FUNC_OFFSET(20613, glUniform4iARB, glUniform4iARB, NULL, 561),
- NAME_FUNC_OFFSET(20625, glUniform4ivARB, glUniform4ivARB, NULL, 562),
- NAME_FUNC_OFFSET(20638, glUniformMatrix2fvARB, glUniformMatrix2fvARB, NULL, 563),
- NAME_FUNC_OFFSET(20657, glUniformMatrix3fvARB, glUniformMatrix3fvARB, NULL, 564),
- NAME_FUNC_OFFSET(20676, glUniformMatrix4fvARB, glUniformMatrix4fvARB, NULL, 565),
- NAME_FUNC_OFFSET(20695, glUseProgramObjectARB, glUseProgramObjectARB, NULL, 566),
- NAME_FUNC_OFFSET(20708, glValidateProgramARB, glValidateProgramARB, NULL, 567),
- NAME_FUNC_OFFSET(20726, glBindAttribLocationARB, glBindAttribLocationARB, NULL, 568),
- NAME_FUNC_OFFSET(20747, glGetActiveAttribARB, glGetActiveAttribARB, NULL, 569),
- NAME_FUNC_OFFSET(20765, glGetAttribLocationARB, glGetAttribLocationARB, NULL, 570),
- NAME_FUNC_OFFSET(20785, glDrawBuffersARB, glDrawBuffersARB, NULL, 571),
- NAME_FUNC_OFFSET(20799, glDrawBuffersARB, glDrawBuffersARB, NULL, 571),
- NAME_FUNC_OFFSET(20816, glDrawArraysInstancedARB, glDrawArraysInstancedARB, NULL, 573),
- NAME_FUNC_OFFSET(20841, glDrawArraysInstancedARB, glDrawArraysInstancedARB, NULL, 573),
- NAME_FUNC_OFFSET(20863, glDrawElementsInstancedARB, glDrawElementsInstancedARB, NULL, 574),
- NAME_FUNC_OFFSET(20890, glDrawElementsInstancedARB, glDrawElementsInstancedARB, NULL, 574),
- NAME_FUNC_OFFSET(20914, glRenderbufferStorageMultisample, glRenderbufferStorageMultisample, NULL, 575),
- NAME_FUNC_OFFSET(20950, glBlendEquationSeparateiARB, glBlendEquationSeparateiARB, NULL, 596),
- NAME_FUNC_OFFSET(20984, glBlendEquationiARB, glBlendEquationiARB, NULL, 597),
- NAME_FUNC_OFFSET(21010, glBlendFuncSeparateiARB, glBlendFuncSeparateiARB, NULL, 598),
- NAME_FUNC_OFFSET(21040, glBlendFunciARB, glBlendFunciARB, NULL, 599),
- NAME_FUNC_OFFSET(21062, gl_dispatch_stub_653, gl_dispatch_stub_653, NULL, 653),
- NAME_FUNC_OFFSET(21078, gl_dispatch_stub_654, gl_dispatch_stub_654, NULL, 654),
- NAME_FUNC_OFFSET(21097, glPointParameterfEXT, glPointParameterfEXT, NULL, 661),
- NAME_FUNC_OFFSET(21115, glPointParameterfEXT, glPointParameterfEXT, NULL, 661),
- NAME_FUNC_OFFSET(21136, glPointParameterfEXT, glPointParameterfEXT, NULL, 661),
- NAME_FUNC_OFFSET(21158, glPointParameterfvEXT, glPointParameterfvEXT, NULL, 662),
- NAME_FUNC_OFFSET(21177, glPointParameterfvEXT, glPointParameterfvEXT, NULL, 662),
- NAME_FUNC_OFFSET(21199, glPointParameterfvEXT, glPointParameterfvEXT, NULL, 662),
- NAME_FUNC_OFFSET(21222, glSecondaryColor3bEXT, glSecondaryColor3bEXT, NULL, 665),
- NAME_FUNC_OFFSET(21241, glSecondaryColor3bvEXT, glSecondaryColor3bvEXT, NULL, 666),
- NAME_FUNC_OFFSET(21261, glSecondaryColor3dEXT, glSecondaryColor3dEXT, NULL, 667),
- NAME_FUNC_OFFSET(21280, glSecondaryColor3dvEXT, glSecondaryColor3dvEXT, NULL, 668),
- NAME_FUNC_OFFSET(21300, glSecondaryColor3fEXT, glSecondaryColor3fEXT, NULL, 669),
- NAME_FUNC_OFFSET(21319, glSecondaryColor3fvEXT, glSecondaryColor3fvEXT, NULL, 670),
- NAME_FUNC_OFFSET(21339, glSecondaryColor3iEXT, glSecondaryColor3iEXT, NULL, 671),
- NAME_FUNC_OFFSET(21358, glSecondaryColor3ivEXT, glSecondaryColor3ivEXT, NULL, 672),
- NAME_FUNC_OFFSET(21378, glSecondaryColor3sEXT, glSecondaryColor3sEXT, NULL, 673),
- NAME_FUNC_OFFSET(21397, glSecondaryColor3svEXT, glSecondaryColor3svEXT, NULL, 674),
- NAME_FUNC_OFFSET(21417, glSecondaryColor3ubEXT, glSecondaryColor3ubEXT, NULL, 675),
- NAME_FUNC_OFFSET(21437, glSecondaryColor3ubvEXT, glSecondaryColor3ubvEXT, NULL, 676),
- NAME_FUNC_OFFSET(21458, glSecondaryColor3uiEXT, glSecondaryColor3uiEXT, NULL, 677),
- NAME_FUNC_OFFSET(21478, glSecondaryColor3uivEXT, glSecondaryColor3uivEXT, NULL, 678),
- NAME_FUNC_OFFSET(21499, glSecondaryColor3usEXT, glSecondaryColor3usEXT, NULL, 679),
- NAME_FUNC_OFFSET(21519, glSecondaryColor3usvEXT, glSecondaryColor3usvEXT, NULL, 680),
- NAME_FUNC_OFFSET(21540, glSecondaryColorPointerEXT, glSecondaryColorPointerEXT, NULL, 681),
- NAME_FUNC_OFFSET(21564, glMultiDrawArraysEXT, glMultiDrawArraysEXT, NULL, 682),
- NAME_FUNC_OFFSET(21582, glMultiDrawElementsEXT, glMultiDrawElementsEXT, NULL, 683),
- NAME_FUNC_OFFSET(21602, glFogCoordPointerEXT, glFogCoordPointerEXT, NULL, 684),
- NAME_FUNC_OFFSET(21620, glFogCoorddEXT, glFogCoorddEXT, NULL, 685),
- NAME_FUNC_OFFSET(21632, glFogCoorddvEXT, glFogCoorddvEXT, NULL, 686),
- NAME_FUNC_OFFSET(21645, glFogCoordfEXT, glFogCoordfEXT, NULL, 687),
- NAME_FUNC_OFFSET(21657, glFogCoordfvEXT, glFogCoordfvEXT, NULL, 688),
- NAME_FUNC_OFFSET(21670, glBlendFuncSeparateEXT, glBlendFuncSeparateEXT, NULL, 690),
- NAME_FUNC_OFFSET(21690, glBlendFuncSeparateEXT, glBlendFuncSeparateEXT, NULL, 690),
- NAME_FUNC_OFFSET(21714, glWindowPos2dMESA, glWindowPos2dMESA, NULL, 707),
- NAME_FUNC_OFFSET(21728, glWindowPos2dMESA, glWindowPos2dMESA, NULL, 707),
- NAME_FUNC_OFFSET(21745, glWindowPos2dvMESA, glWindowPos2dvMESA, NULL, 708),
- NAME_FUNC_OFFSET(21760, glWindowPos2dvMESA, glWindowPos2dvMESA, NULL, 708),
- NAME_FUNC_OFFSET(21778, glWindowPos2fMESA, glWindowPos2fMESA, NULL, 709),
- NAME_FUNC_OFFSET(21792, glWindowPos2fMESA, glWindowPos2fMESA, NULL, 709),
- NAME_FUNC_OFFSET(21809, glWindowPos2fvMESA, glWindowPos2fvMESA, NULL, 710),
- NAME_FUNC_OFFSET(21824, glWindowPos2fvMESA, glWindowPos2fvMESA, NULL, 710),
- NAME_FUNC_OFFSET(21842, glWindowPos2iMESA, glWindowPos2iMESA, NULL, 711),
- NAME_FUNC_OFFSET(21856, glWindowPos2iMESA, glWindowPos2iMESA, NULL, 711),
- NAME_FUNC_OFFSET(21873, glWindowPos2ivMESA, glWindowPos2ivMESA, NULL, 712),
- NAME_FUNC_OFFSET(21888, glWindowPos2ivMESA, glWindowPos2ivMESA, NULL, 712),
- NAME_FUNC_OFFSET(21906, glWindowPos2sMESA, glWindowPos2sMESA, NULL, 713),
- NAME_FUNC_OFFSET(21920, glWindowPos2sMESA, glWindowPos2sMESA, NULL, 713),
- NAME_FUNC_OFFSET(21937, glWindowPos2svMESA, glWindowPos2svMESA, NULL, 714),
- NAME_FUNC_OFFSET(21952, glWindowPos2svMESA, glWindowPos2svMESA, NULL, 714),
- NAME_FUNC_OFFSET(21970, glWindowPos3dMESA, glWindowPos3dMESA, NULL, 715),
- NAME_FUNC_OFFSET(21984, glWindowPos3dMESA, glWindowPos3dMESA, NULL, 715),
- NAME_FUNC_OFFSET(22001, glWindowPos3dvMESA, glWindowPos3dvMESA, NULL, 716),
- NAME_FUNC_OFFSET(22016, glWindowPos3dvMESA, glWindowPos3dvMESA, NULL, 716),
- NAME_FUNC_OFFSET(22034, glWindowPos3fMESA, glWindowPos3fMESA, NULL, 717),
- NAME_FUNC_OFFSET(22048, glWindowPos3fMESA, glWindowPos3fMESA, NULL, 717),
- NAME_FUNC_OFFSET(22065, glWindowPos3fvMESA, glWindowPos3fvMESA, NULL, 718),
- NAME_FUNC_OFFSET(22080, glWindowPos3fvMESA, glWindowPos3fvMESA, NULL, 718),
- NAME_FUNC_OFFSET(22098, glWindowPos3iMESA, glWindowPos3iMESA, NULL, 719),
- NAME_FUNC_OFFSET(22112, glWindowPos3iMESA, glWindowPos3iMESA, NULL, 719),
- NAME_FUNC_OFFSET(22129, glWindowPos3ivMESA, glWindowPos3ivMESA, NULL, 720),
- NAME_FUNC_OFFSET(22144, glWindowPos3ivMESA, glWindowPos3ivMESA, NULL, 720),
- NAME_FUNC_OFFSET(22162, glWindowPos3sMESA, glWindowPos3sMESA, NULL, 721),
- NAME_FUNC_OFFSET(22176, glWindowPos3sMESA, glWindowPos3sMESA, NULL, 721),
- NAME_FUNC_OFFSET(22193, glWindowPos3svMESA, glWindowPos3svMESA, NULL, 722),
- NAME_FUNC_OFFSET(22208, glWindowPos3svMESA, glWindowPos3svMESA, NULL, 722),
- NAME_FUNC_OFFSET(22226, glBindProgramNV, glBindProgramNV, NULL, 741),
- NAME_FUNC_OFFSET(22243, glDeleteProgramsNV, glDeleteProgramsNV, NULL, 742),
- NAME_FUNC_OFFSET(22263, glGenProgramsNV, glGenProgramsNV, NULL, 744),
- NAME_FUNC_OFFSET(22280, glGetVertexAttribPointervNV, glGetVertexAttribPointervNV, NULL, 750),
- NAME_FUNC_OFFSET(22306, glGetVertexAttribPointervNV, glGetVertexAttribPointervNV, NULL, 750),
- NAME_FUNC_OFFSET(22335, glIsProgramNV, glIsProgramNV, NULL, 754),
- NAME_FUNC_OFFSET(22350, glPointParameteriNV, glPointParameteriNV, NULL, 818),
- NAME_FUNC_OFFSET(22368, glPointParameterivNV, glPointParameterivNV, NULL, 819),
- NAME_FUNC_OFFSET(22387, gl_dispatch_stub_822, gl_dispatch_stub_822, NULL, 822),
- NAME_FUNC_OFFSET(22408, gl_dispatch_stub_824, gl_dispatch_stub_824, NULL, 824),
- NAME_FUNC_OFFSET(22424, glPrimitiveRestartIndexNV, glPrimitiveRestartIndexNV, NULL, 831),
- NAME_FUNC_OFFSET(22448, gl_dispatch_stub_834, gl_dispatch_stub_834, NULL, 834),
- NAME_FUNC_OFFSET(22472, gl_dispatch_stub_834, gl_dispatch_stub_834, NULL, 834),
- NAME_FUNC_OFFSET(22499, glBindFramebufferEXT, glBindFramebufferEXT, NULL, 835),
- NAME_FUNC_OFFSET(22517, glBindRenderbufferEXT, glBindRenderbufferEXT, NULL, 836),
- NAME_FUNC_OFFSET(22536, glCheckFramebufferStatusEXT, glCheckFramebufferStatusEXT, NULL, 837),
- NAME_FUNC_OFFSET(22561, glDeleteFramebuffersEXT, glDeleteFramebuffersEXT, NULL, 838),
- NAME_FUNC_OFFSET(22582, glDeleteRenderbuffersEXT, glDeleteRenderbuffersEXT, NULL, 839),
- NAME_FUNC_OFFSET(22604, glFramebufferRenderbufferEXT, glFramebufferRenderbufferEXT, NULL, 840),
- NAME_FUNC_OFFSET(22630, glFramebufferTexture1DEXT, glFramebufferTexture1DEXT, NULL, 841),
- NAME_FUNC_OFFSET(22653, glFramebufferTexture2DEXT, glFramebufferTexture2DEXT, NULL, 842),
- NAME_FUNC_OFFSET(22676, glFramebufferTexture3DEXT, glFramebufferTexture3DEXT, NULL, 843),
- NAME_FUNC_OFFSET(22699, glGenFramebuffersEXT, glGenFramebuffersEXT, NULL, 844),
- NAME_FUNC_OFFSET(22717, glGenRenderbuffersEXT, glGenRenderbuffersEXT, NULL, 845),
- NAME_FUNC_OFFSET(22736, glGenerateMipmapEXT, glGenerateMipmapEXT, NULL, 846),
- NAME_FUNC_OFFSET(22753, glGetFramebufferAttachmentParameterivEXT, glGetFramebufferAttachmentParameterivEXT, NULL, 847),
- NAME_FUNC_OFFSET(22791, glGetRenderbufferParameterivEXT, glGetRenderbufferParameterivEXT, NULL, 848),
- NAME_FUNC_OFFSET(22820, glIsFramebufferEXT, glIsFramebufferEXT, NULL, 849),
- NAME_FUNC_OFFSET(22836, glIsRenderbufferEXT, glIsRenderbufferEXT, NULL, 850),
- NAME_FUNC_OFFSET(22853, glRenderbufferStorageEXT, glRenderbufferStorageEXT, NULL, 851),
- NAME_FUNC_OFFSET(22875, gl_dispatch_stub_852, gl_dispatch_stub_852, NULL, 852),
- NAME_FUNC_OFFSET(22893, glBindFragDataLocationEXT, glBindFragDataLocationEXT, NULL, 855),
- NAME_FUNC_OFFSET(22916, glGetFragDataLocationEXT, glGetFragDataLocationEXT, NULL, 856),
- NAME_FUNC_OFFSET(22938, glGetUniformuivEXT, glGetUniformuivEXT, NULL, 857),
- NAME_FUNC_OFFSET(22954, glGetVertexAttribIivEXT, glGetVertexAttribIivEXT, NULL, 858),
- NAME_FUNC_OFFSET(22975, glGetVertexAttribIuivEXT, glGetVertexAttribIuivEXT, NULL, 859),
- NAME_FUNC_OFFSET(22997, glUniform1uiEXT, glUniform1uiEXT, NULL, 860),
- NAME_FUNC_OFFSET(23010, glUniform1uivEXT, glUniform1uivEXT, NULL, 861),
- NAME_FUNC_OFFSET(23024, glUniform2uiEXT, glUniform2uiEXT, NULL, 862),
- NAME_FUNC_OFFSET(23037, glUniform2uivEXT, glUniform2uivEXT, NULL, 863),
- NAME_FUNC_OFFSET(23051, glUniform3uiEXT, glUniform3uiEXT, NULL, 864),
- NAME_FUNC_OFFSET(23064, glUniform3uivEXT, glUniform3uivEXT, NULL, 865),
- NAME_FUNC_OFFSET(23078, glUniform4uiEXT, glUniform4uiEXT, NULL, 866),
- NAME_FUNC_OFFSET(23091, glUniform4uivEXT, glUniform4uivEXT, NULL, 867),
- NAME_FUNC_OFFSET(23105, glVertexAttribI1iEXT, glVertexAttribI1iEXT, NULL, 868),
- NAME_FUNC_OFFSET(23123, glVertexAttribI1ivEXT, glVertexAttribI1ivEXT, NULL, 869),
- NAME_FUNC_OFFSET(23142, glVertexAttribI1uiEXT, glVertexAttribI1uiEXT, NULL, 870),
- NAME_FUNC_OFFSET(23161, glVertexAttribI1uivEXT, glVertexAttribI1uivEXT, NULL, 871),
- NAME_FUNC_OFFSET(23181, glVertexAttribI2iEXT, glVertexAttribI2iEXT, NULL, 872),
- NAME_FUNC_OFFSET(23199, glVertexAttribI2ivEXT, glVertexAttribI2ivEXT, NULL, 873),
- NAME_FUNC_OFFSET(23218, glVertexAttribI2uiEXT, glVertexAttribI2uiEXT, NULL, 874),
- NAME_FUNC_OFFSET(23237, glVertexAttribI2uivEXT, glVertexAttribI2uivEXT, NULL, 875),
- NAME_FUNC_OFFSET(23257, glVertexAttribI3iEXT, glVertexAttribI3iEXT, NULL, 876),
- NAME_FUNC_OFFSET(23275, glVertexAttribI3ivEXT, glVertexAttribI3ivEXT, NULL, 877),
- NAME_FUNC_OFFSET(23294, glVertexAttribI3uiEXT, glVertexAttribI3uiEXT, NULL, 878),
- NAME_FUNC_OFFSET(23313, glVertexAttribI3uivEXT, glVertexAttribI3uivEXT, NULL, 879),
- NAME_FUNC_OFFSET(23333, glVertexAttribI4bvEXT, glVertexAttribI4bvEXT, NULL, 880),
- NAME_FUNC_OFFSET(23352, glVertexAttribI4iEXT, glVertexAttribI4iEXT, NULL, 881),
- NAME_FUNC_OFFSET(23370, glVertexAttribI4ivEXT, glVertexAttribI4ivEXT, NULL, 882),
- NAME_FUNC_OFFSET(23389, glVertexAttribI4svEXT, glVertexAttribI4svEXT, NULL, 883),
- NAME_FUNC_OFFSET(23408, glVertexAttribI4ubvEXT, glVertexAttribI4ubvEXT, NULL, 884),
- NAME_FUNC_OFFSET(23428, glVertexAttribI4uiEXT, glVertexAttribI4uiEXT, NULL, 885),
- NAME_FUNC_OFFSET(23447, glVertexAttribI4uivEXT, glVertexAttribI4uivEXT, NULL, 886),
- NAME_FUNC_OFFSET(23467, glVertexAttribI4usvEXT, glVertexAttribI4usvEXT, NULL, 887),
- NAME_FUNC_OFFSET(23487, glVertexAttribIPointerEXT, glVertexAttribIPointerEXT, NULL, 888),
- NAME_FUNC_OFFSET(23510, glFramebufferTextureLayerEXT, glFramebufferTextureLayerEXT, NULL, 889),
- NAME_FUNC_OFFSET(23536, glColorMaskIndexedEXT, glColorMaskIndexedEXT, NULL, 890),
- NAME_FUNC_OFFSET(23549, glDisableIndexedEXT, glDisableIndexedEXT, NULL, 891),
- NAME_FUNC_OFFSET(23560, glEnableIndexedEXT, glEnableIndexedEXT, NULL, 892),
- NAME_FUNC_OFFSET(23570, glGetBooleanIndexedvEXT, glGetBooleanIndexedvEXT, NULL, 893),
- NAME_FUNC_OFFSET(23586, glGetIntegerIndexedvEXT, glGetIntegerIndexedvEXT, NULL, 894),
- NAME_FUNC_OFFSET(23602, glIsEnabledIndexedEXT, glIsEnabledIndexedEXT, NULL, 895),
- NAME_FUNC_OFFSET(23615, glGetTexParameterIivEXT, glGetTexParameterIivEXT, NULL, 898),
- NAME_FUNC_OFFSET(23636, glGetTexParameterIuivEXT, glGetTexParameterIuivEXT, NULL, 899),
- NAME_FUNC_OFFSET(23658, glTexParameterIivEXT, glTexParameterIivEXT, NULL, 900),
- NAME_FUNC_OFFSET(23676, glTexParameterIuivEXT, glTexParameterIuivEXT, NULL, 901),
- NAME_FUNC_OFFSET(23695, glBeginConditionalRenderNV, glBeginConditionalRenderNV, NULL, 902),
- NAME_FUNC_OFFSET(23720, glEndConditionalRenderNV, glEndConditionalRenderNV, NULL, 903),
- NAME_FUNC_OFFSET(23743, glBeginTransformFeedbackEXT, glBeginTransformFeedbackEXT, NULL, 904),
- NAME_FUNC_OFFSET(23768, glBindBufferBaseEXT, glBindBufferBaseEXT, NULL, 905),
- NAME_FUNC_OFFSET(23785, glBindBufferRangeEXT, glBindBufferRangeEXT, NULL, 907),
- NAME_FUNC_OFFSET(23803, glEndTransformFeedbackEXT, glEndTransformFeedbackEXT, NULL, 908),
- NAME_FUNC_OFFSET(23826, glGetTransformFeedbackVaryingEXT, glGetTransformFeedbackVaryingEXT, NULL, 909),
- NAME_FUNC_OFFSET(23856, glTransformFeedbackVaryingsEXT, glTransformFeedbackVaryingsEXT, NULL, 910),
- NAME_FUNC_OFFSET(23884, glProvokingVertexEXT, glProvokingVertexEXT, NULL, 911),
- NAME_FUNC_OFFSET(-1, NULL, NULL, NULL, 0)
-};
-
-#undef NAME_FUNC_OFFSET
+/* DO NOT EDIT - This file generated automatically by gl_procs.py (from Mesa) script */
+
+/*
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
+ * (C) Copyright IBM Corporation 2004, 2006
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sub license,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL, IBM,
+ * AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
+ * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+
+/* This file is only included by glapi.c and is used for
+ * the GetProcAddress() function
+ */
+
+typedef struct {
+ GLint Name_offset;
+#if defined(NEED_FUNCTION_POINTER) || defined(GLX_INDIRECT_RENDERING)
+ _glapi_proc Address;
+#endif
+ GLuint Offset;
+} glprocs_table_t;
+
+#if !defined(NEED_FUNCTION_POINTER) && !defined(GLX_INDIRECT_RENDERING)
+# define NAME_FUNC_OFFSET(n,f1,f2,f3,o) { n , o }
+#elif defined(NEED_FUNCTION_POINTER) && !defined(GLX_INDIRECT_RENDERING)
+# define NAME_FUNC_OFFSET(n,f1,f2,f3,o) { n , (_glapi_proc) f1 , o }
+#elif defined(NEED_FUNCTION_POINTER) && defined(GLX_INDIRECT_RENDERING)
+# define NAME_FUNC_OFFSET(n,f1,f2,f3,o) { n , (_glapi_proc) f2 , o }
+#elif !defined(NEED_FUNCTION_POINTER) && defined(GLX_INDIRECT_RENDERING)
+# define NAME_FUNC_OFFSET(n,f1,f2,f3,o) { n , (_glapi_proc) f3 , o }
+#endif
+
+
+
+static const char gl_string_table[] =
+ "glNewList\0"
+ "glEndList\0"
+ "glCallList\0"
+ "glCallLists\0"
+ "glDeleteLists\0"
+ "glGenLists\0"
+ "glListBase\0"
+ "glBegin\0"
+ "glBitmap\0"
+ "glColor3b\0"
+ "glColor3bv\0"
+ "glColor3d\0"
+ "glColor3dv\0"
+ "glColor3f\0"
+ "glColor3fv\0"
+ "glColor3i\0"
+ "glColor3iv\0"
+ "glColor3s\0"
+ "glColor3sv\0"
+ "glColor3ub\0"
+ "glColor3ubv\0"
+ "glColor3ui\0"
+ "glColor3uiv\0"
+ "glColor3us\0"
+ "glColor3usv\0"
+ "glColor4b\0"
+ "glColor4bv\0"
+ "glColor4d\0"
+ "glColor4dv\0"
+ "glColor4f\0"
+ "glColor4fv\0"
+ "glColor4i\0"
+ "glColor4iv\0"
+ "glColor4s\0"
+ "glColor4sv\0"
+ "glColor4ub\0"
+ "glColor4ubv\0"
+ "glColor4ui\0"
+ "glColor4uiv\0"
+ "glColor4us\0"
+ "glColor4usv\0"
+ "glEdgeFlag\0"
+ "glEdgeFlagv\0"
+ "glEnd\0"
+ "glIndexd\0"
+ "glIndexdv\0"
+ "glIndexf\0"
+ "glIndexfv\0"
+ "glIndexi\0"
+ "glIndexiv\0"
+ "glIndexs\0"
+ "glIndexsv\0"
+ "glNormal3b\0"
+ "glNormal3bv\0"
+ "glNormal3d\0"
+ "glNormal3dv\0"
+ "glNormal3f\0"
+ "glNormal3fv\0"
+ "glNormal3i\0"
+ "glNormal3iv\0"
+ "glNormal3s\0"
+ "glNormal3sv\0"
+ "glRasterPos2d\0"
+ "glRasterPos2dv\0"
+ "glRasterPos2f\0"
+ "glRasterPos2fv\0"
+ "glRasterPos2i\0"
+ "glRasterPos2iv\0"
+ "glRasterPos2s\0"
+ "glRasterPos2sv\0"
+ "glRasterPos3d\0"
+ "glRasterPos3dv\0"
+ "glRasterPos3f\0"
+ "glRasterPos3fv\0"
+ "glRasterPos3i\0"
+ "glRasterPos3iv\0"
+ "glRasterPos3s\0"
+ "glRasterPos3sv\0"
+ "glRasterPos4d\0"
+ "glRasterPos4dv\0"
+ "glRasterPos4f\0"
+ "glRasterPos4fv\0"
+ "glRasterPos4i\0"
+ "glRasterPos4iv\0"
+ "glRasterPos4s\0"
+ "glRasterPos4sv\0"
+ "glRectd\0"
+ "glRectdv\0"
+ "glRectf\0"
+ "glRectfv\0"
+ "glRecti\0"
+ "glRectiv\0"
+ "glRects\0"
+ "glRectsv\0"
+ "glTexCoord1d\0"
+ "glTexCoord1dv\0"
+ "glTexCoord1f\0"
+ "glTexCoord1fv\0"
+ "glTexCoord1i\0"
+ "glTexCoord1iv\0"
+ "glTexCoord1s\0"
+ "glTexCoord1sv\0"
+ "glTexCoord2d\0"
+ "glTexCoord2dv\0"
+ "glTexCoord2f\0"
+ "glTexCoord2fv\0"
+ "glTexCoord2i\0"
+ "glTexCoord2iv\0"
+ "glTexCoord2s\0"
+ "glTexCoord2sv\0"
+ "glTexCoord3d\0"
+ "glTexCoord3dv\0"
+ "glTexCoord3f\0"
+ "glTexCoord3fv\0"
+ "glTexCoord3i\0"
+ "glTexCoord3iv\0"
+ "glTexCoord3s\0"
+ "glTexCoord3sv\0"
+ "glTexCoord4d\0"
+ "glTexCoord4dv\0"
+ "glTexCoord4f\0"
+ "glTexCoord4fv\0"
+ "glTexCoord4i\0"
+ "glTexCoord4iv\0"
+ "glTexCoord4s\0"
+ "glTexCoord4sv\0"
+ "glVertex2d\0"
+ "glVertex2dv\0"
+ "glVertex2f\0"
+ "glVertex2fv\0"
+ "glVertex2i\0"
+ "glVertex2iv\0"
+ "glVertex2s\0"
+ "glVertex2sv\0"
+ "glVertex3d\0"
+ "glVertex3dv\0"
+ "glVertex3f\0"
+ "glVertex3fv\0"
+ "glVertex3i\0"
+ "glVertex3iv\0"
+ "glVertex3s\0"
+ "glVertex3sv\0"
+ "glVertex4d\0"
+ "glVertex4dv\0"
+ "glVertex4f\0"
+ "glVertex4fv\0"
+ "glVertex4i\0"
+ "glVertex4iv\0"
+ "glVertex4s\0"
+ "glVertex4sv\0"
+ "glClipPlane\0"
+ "glColorMaterial\0"
+ "glCullFace\0"
+ "glFogf\0"
+ "glFogfv\0"
+ "glFogi\0"
+ "glFogiv\0"
+ "glFrontFace\0"
+ "glHint\0"
+ "glLightf\0"
+ "glLightfv\0"
+ "glLighti\0"
+ "glLightiv\0"
+ "glLightModelf\0"
+ "glLightModelfv\0"
+ "glLightModeli\0"
+ "glLightModeliv\0"
+ "glLineStipple\0"
+ "glLineWidth\0"
+ "glMaterialf\0"
+ "glMaterialfv\0"
+ "glMateriali\0"
+ "glMaterialiv\0"
+ "glPointSize\0"
+ "glPolygonMode\0"
+ "glPolygonStipple\0"
+ "glScissor\0"
+ "glShadeModel\0"
+ "glTexParameterf\0"
+ "glTexParameterfv\0"
+ "glTexParameteri\0"
+ "glTexParameteriv\0"
+ "glTexImage1D\0"
+ "glTexImage2D\0"
+ "glTexEnvf\0"
+ "glTexEnvfv\0"
+ "glTexEnvi\0"
+ "glTexEnviv\0"
+ "glTexGend\0"
+ "glTexGendv\0"
+ "glTexGenf\0"
+ "glTexGenfv\0"
+ "glTexGeni\0"
+ "glTexGeniv\0"
+ "glFeedbackBuffer\0"
+ "glSelectBuffer\0"
+ "glRenderMode\0"
+ "glInitNames\0"
+ "glLoadName\0"
+ "glPassThrough\0"
+ "glPopName\0"
+ "glPushName\0"
+ "glDrawBuffer\0"
+ "glClear\0"
+ "glClearAccum\0"
+ "glClearIndex\0"
+ "glClearColor\0"
+ "glClearStencil\0"
+ "glClearDepth\0"
+ "glStencilMask\0"
+ "glColorMask\0"
+ "glDepthMask\0"
+ "glIndexMask\0"
+ "glAccum\0"
+ "glDisable\0"
+ "glEnable\0"
+ "glFinish\0"
+ "glFlush\0"
+ "glPopAttrib\0"
+ "glPushAttrib\0"
+ "glMap1d\0"
+ "glMap1f\0"
+ "glMap2d\0"
+ "glMap2f\0"
+ "glMapGrid1d\0"
+ "glMapGrid1f\0"
+ "glMapGrid2d\0"
+ "glMapGrid2f\0"
+ "glEvalCoord1d\0"
+ "glEvalCoord1dv\0"
+ "glEvalCoord1f\0"
+ "glEvalCoord1fv\0"
+ "glEvalCoord2d\0"
+ "glEvalCoord2dv\0"
+ "glEvalCoord2f\0"
+ "glEvalCoord2fv\0"
+ "glEvalMesh1\0"
+ "glEvalPoint1\0"
+ "glEvalMesh2\0"
+ "glEvalPoint2\0"
+ "glAlphaFunc\0"
+ "glBlendFunc\0"
+ "glLogicOp\0"
+ "glStencilFunc\0"
+ "glStencilOp\0"
+ "glDepthFunc\0"
+ "glPixelZoom\0"
+ "glPixelTransferf\0"
+ "glPixelTransferi\0"
+ "glPixelStoref\0"
+ "glPixelStorei\0"
+ "glPixelMapfv\0"
+ "glPixelMapuiv\0"
+ "glPixelMapusv\0"
+ "glReadBuffer\0"
+ "glCopyPixels\0"
+ "glReadPixels\0"
+ "glDrawPixels\0"
+ "glGetBooleanv\0"
+ "glGetClipPlane\0"
+ "glGetDoublev\0"
+ "glGetError\0"
+ "glGetFloatv\0"
+ "glGetIntegerv\0"
+ "glGetLightfv\0"
+ "glGetLightiv\0"
+ "glGetMapdv\0"
+ "glGetMapfv\0"
+ "glGetMapiv\0"
+ "glGetMaterialfv\0"
+ "glGetMaterialiv\0"
+ "glGetPixelMapfv\0"
+ "glGetPixelMapuiv\0"
+ "glGetPixelMapusv\0"
+ "glGetPolygonStipple\0"
+ "glGetString\0"
+ "glGetTexEnvfv\0"
+ "glGetTexEnviv\0"
+ "glGetTexGendv\0"
+ "glGetTexGenfv\0"
+ "glGetTexGeniv\0"
+ "glGetTexImage\0"
+ "glGetTexParameterfv\0"
+ "glGetTexParameteriv\0"
+ "glGetTexLevelParameterfv\0"
+ "glGetTexLevelParameteriv\0"
+ "glIsEnabled\0"
+ "glIsList\0"
+ "glDepthRange\0"
+ "glFrustum\0"
+ "glLoadIdentity\0"
+ "glLoadMatrixf\0"
+ "glLoadMatrixd\0"
+ "glMatrixMode\0"
+ "glMultMatrixf\0"
+ "glMultMatrixd\0"
+ "glOrtho\0"
+ "glPopMatrix\0"
+ "glPushMatrix\0"
+ "glRotated\0"
+ "glRotatef\0"
+ "glScaled\0"
+ "glScalef\0"
+ "glTranslated\0"
+ "glTranslatef\0"
+ "glViewport\0"
+ "glArrayElement\0"
+ "glBindTexture\0"
+ "glColorPointer\0"
+ "glDisableClientState\0"
+ "glDrawArrays\0"
+ "glDrawElements\0"
+ "glEdgeFlagPointer\0"
+ "glEnableClientState\0"
+ "glIndexPointer\0"
+ "glIndexub\0"
+ "glIndexubv\0"
+ "glInterleavedArrays\0"
+ "glNormalPointer\0"
+ "glPolygonOffset\0"
+ "glTexCoordPointer\0"
+ "glVertexPointer\0"
+ "glAreTexturesResident\0"
+ "glCopyTexImage1D\0"
+ "glCopyTexImage2D\0"
+ "glCopyTexSubImage1D\0"
+ "glCopyTexSubImage2D\0"
+ "glDeleteTextures\0"
+ "glGenTextures\0"
+ "glGetPointerv\0"
+ "glIsTexture\0"
+ "glPrioritizeTextures\0"
+ "glTexSubImage1D\0"
+ "glTexSubImage2D\0"
+ "glPopClientAttrib\0"
+ "glPushClientAttrib\0"
+ "glBlendColor\0"
+ "glBlendEquation\0"
+ "glDrawRangeElements\0"
+ "glColorTable\0"
+ "glColorTableParameterfv\0"
+ "glColorTableParameteriv\0"
+ "glCopyColorTable\0"
+ "glGetColorTable\0"
+ "glGetColorTableParameterfv\0"
+ "glGetColorTableParameteriv\0"
+ "glColorSubTable\0"
+ "glCopyColorSubTable\0"
+ "glConvolutionFilter1D\0"
+ "glConvolutionFilter2D\0"
+ "glConvolutionParameterf\0"
+ "glConvolutionParameterfv\0"
+ "glConvolutionParameteri\0"
+ "glConvolutionParameteriv\0"
+ "glCopyConvolutionFilter1D\0"
+ "glCopyConvolutionFilter2D\0"
+ "glGetConvolutionFilter\0"
+ "glGetConvolutionParameterfv\0"
+ "glGetConvolutionParameteriv\0"
+ "glGetSeparableFilter\0"
+ "glSeparableFilter2D\0"
+ "glGetHistogram\0"
+ "glGetHistogramParameterfv\0"
+ "glGetHistogramParameteriv\0"
+ "glGetMinmax\0"
+ "glGetMinmaxParameterfv\0"
+ "glGetMinmaxParameteriv\0"
+ "glHistogram\0"
+ "glMinmax\0"
+ "glResetHistogram\0"
+ "glResetMinmax\0"
+ "glTexImage3D\0"
+ "glTexSubImage3D\0"
+ "glCopyTexSubImage3D\0"
+ "glActiveTextureARB\0"
+ "glClientActiveTextureARB\0"
+ "glMultiTexCoord1dARB\0"
+ "glMultiTexCoord1dvARB\0"
+ "glMultiTexCoord1fARB\0"
+ "glMultiTexCoord1fvARB\0"
+ "glMultiTexCoord1iARB\0"
+ "glMultiTexCoord1ivARB\0"
+ "glMultiTexCoord1sARB\0"
+ "glMultiTexCoord1svARB\0"
+ "glMultiTexCoord2dARB\0"
+ "glMultiTexCoord2dvARB\0"
+ "glMultiTexCoord2fARB\0"
+ "glMultiTexCoord2fvARB\0"
+ "glMultiTexCoord2iARB\0"
+ "glMultiTexCoord2ivARB\0"
+ "glMultiTexCoord2sARB\0"
+ "glMultiTexCoord2svARB\0"
+ "glMultiTexCoord3dARB\0"
+ "glMultiTexCoord3dvARB\0"
+ "glMultiTexCoord3fARB\0"
+ "glMultiTexCoord3fvARB\0"
+ "glMultiTexCoord3iARB\0"
+ "glMultiTexCoord3ivARB\0"
+ "glMultiTexCoord3sARB\0"
+ "glMultiTexCoord3svARB\0"
+ "glMultiTexCoord4dARB\0"
+ "glMultiTexCoord4dvARB\0"
+ "glMultiTexCoord4fARB\0"
+ "glMultiTexCoord4fvARB\0"
+ "glMultiTexCoord4iARB\0"
+ "glMultiTexCoord4ivARB\0"
+ "glMultiTexCoord4sARB\0"
+ "glMultiTexCoord4svARB\0"
+ "glAttachShader\0"
+ "glCreateProgram\0"
+ "glCreateShader\0"
+ "glDeleteProgram\0"
+ "glDeleteShader\0"
+ "glDetachShader\0"
+ "glGetAttachedShaders\0"
+ "glGetProgramInfoLog\0"
+ "glGetProgramiv\0"
+ "glGetShaderInfoLog\0"
+ "glGetShaderiv\0"
+ "glIsProgram\0"
+ "glIsShader\0"
+ "glStencilFuncSeparate\0"
+ "glStencilMaskSeparate\0"
+ "glStencilOpSeparate\0"
+ "glUniformMatrix2x3fv\0"
+ "glUniformMatrix2x4fv\0"
+ "glUniformMatrix3x2fv\0"
+ "glUniformMatrix3x4fv\0"
+ "glUniformMatrix4x2fv\0"
+ "glUniformMatrix4x3fv\0"
+ "glClampColor\0"
+ "glClearBufferfi\0"
+ "glClearBufferfv\0"
+ "glClearBufferiv\0"
+ "glClearBufferuiv\0"
+ "glGetStringi\0"
+ "glTexBuffer\0"
+ "glFramebufferTexture\0"
+ "glGetBufferParameteri64v\0"
+ "glGetInteger64i_v\0"
+ "glVertexAttribDivisor\0"
+ "glLoadTransposeMatrixdARB\0"
+ "glLoadTransposeMatrixfARB\0"
+ "glMultTransposeMatrixdARB\0"
+ "glMultTransposeMatrixfARB\0"
+ "glSampleCoverageARB\0"
+ "glCompressedTexImage1DARB\0"
+ "glCompressedTexImage2DARB\0"
+ "glCompressedTexImage3DARB\0"
+ "glCompressedTexSubImage1DARB\0"
+ "glCompressedTexSubImage2DARB\0"
+ "glCompressedTexSubImage3DARB\0"
+ "glGetCompressedTexImageARB\0"
+ "glDisableVertexAttribArrayARB\0"
+ "glEnableVertexAttribArrayARB\0"
+ "glGetProgramEnvParameterdvARB\0"
+ "glGetProgramEnvParameterfvARB\0"
+ "glGetProgramLocalParameterdvARB\0"
+ "glGetProgramLocalParameterfvARB\0"
+ "glGetProgramStringARB\0"
+ "glGetProgramivARB\0"
+ "glGetVertexAttribdvARB\0"
+ "glGetVertexAttribfvARB\0"
+ "glGetVertexAttribivARB\0"
+ "glProgramEnvParameter4dARB\0"
+ "glProgramEnvParameter4dvARB\0"
+ "glProgramEnvParameter4fARB\0"
+ "glProgramEnvParameter4fvARB\0"
+ "glProgramLocalParameter4dARB\0"
+ "glProgramLocalParameter4dvARB\0"
+ "glProgramLocalParameter4fARB\0"
+ "glProgramLocalParameter4fvARB\0"
+ "glProgramStringARB\0"
+ "glVertexAttrib1dARB\0"
+ "glVertexAttrib1dvARB\0"
+ "glVertexAttrib1fARB\0"
+ "glVertexAttrib1fvARB\0"
+ "glVertexAttrib1sARB\0"
+ "glVertexAttrib1svARB\0"
+ "glVertexAttrib2dARB\0"
+ "glVertexAttrib2dvARB\0"
+ "glVertexAttrib2fARB\0"
+ "glVertexAttrib2fvARB\0"
+ "glVertexAttrib2sARB\0"
+ "glVertexAttrib2svARB\0"
+ "glVertexAttrib3dARB\0"
+ "glVertexAttrib3dvARB\0"
+ "glVertexAttrib3fARB\0"
+ "glVertexAttrib3fvARB\0"
+ "glVertexAttrib3sARB\0"
+ "glVertexAttrib3svARB\0"
+ "glVertexAttrib4NbvARB\0"
+ "glVertexAttrib4NivARB\0"
+ "glVertexAttrib4NsvARB\0"
+ "glVertexAttrib4NubARB\0"
+ "glVertexAttrib4NubvARB\0"
+ "glVertexAttrib4NuivARB\0"
+ "glVertexAttrib4NusvARB\0"
+ "glVertexAttrib4bvARB\0"
+ "glVertexAttrib4dARB\0"
+ "glVertexAttrib4dvARB\0"
+ "glVertexAttrib4fARB\0"
+ "glVertexAttrib4fvARB\0"
+ "glVertexAttrib4ivARB\0"
+ "glVertexAttrib4sARB\0"
+ "glVertexAttrib4svARB\0"
+ "glVertexAttrib4ubvARB\0"
+ "glVertexAttrib4uivARB\0"
+ "glVertexAttrib4usvARB\0"
+ "glVertexAttribPointerARB\0"
+ "glBindBufferARB\0"
+ "glBufferDataARB\0"
+ "glBufferSubDataARB\0"
+ "glDeleteBuffersARB\0"
+ "glGenBuffersARB\0"
+ "glGetBufferParameterivARB\0"
+ "glGetBufferPointervARB\0"
+ "glGetBufferSubDataARB\0"
+ "glIsBufferARB\0"
+ "glMapBufferARB\0"
+ "glUnmapBufferARB\0"
+ "glBeginQueryARB\0"
+ "glDeleteQueriesARB\0"
+ "glEndQueryARB\0"
+ "glGenQueriesARB\0"
+ "glGetQueryObjectivARB\0"
+ "glGetQueryObjectuivARB\0"
+ "glGetQueryivARB\0"
+ "glIsQueryARB\0"
+ "glAttachObjectARB\0"
+ "glCompileShaderARB\0"
+ "glCreateProgramObjectARB\0"
+ "glCreateShaderObjectARB\0"
+ "glDeleteObjectARB\0"
+ "glDetachObjectARB\0"
+ "glGetActiveUniformARB\0"
+ "glGetAttachedObjectsARB\0"
+ "glGetHandleARB\0"
+ "glGetInfoLogARB\0"
+ "glGetObjectParameterfvARB\0"
+ "glGetObjectParameterivARB\0"
+ "glGetShaderSourceARB\0"
+ "glGetUniformLocationARB\0"
+ "glGetUniformfvARB\0"
+ "glGetUniformivARB\0"
+ "glLinkProgramARB\0"
+ "glShaderSourceARB\0"
+ "glUniform1fARB\0"
+ "glUniform1fvARB\0"
+ "glUniform1iARB\0"
+ "glUniform1ivARB\0"
+ "glUniform2fARB\0"
+ "glUniform2fvARB\0"
+ "glUniform2iARB\0"
+ "glUniform2ivARB\0"
+ "glUniform3fARB\0"
+ "glUniform3fvARB\0"
+ "glUniform3iARB\0"
+ "glUniform3ivARB\0"
+ "glUniform4fARB\0"
+ "glUniform4fvARB\0"
+ "glUniform4iARB\0"
+ "glUniform4ivARB\0"
+ "glUniformMatrix2fvARB\0"
+ "glUniformMatrix3fvARB\0"
+ "glUniformMatrix4fvARB\0"
+ "glUseProgramObjectARB\0"
+ "glValidateProgramARB\0"
+ "glBindAttribLocationARB\0"
+ "glGetActiveAttribARB\0"
+ "glGetAttribLocationARB\0"
+ "glDrawBuffersARB\0"
+ "glClampColorARB\0"
+ "glDrawArraysInstancedARB\0"
+ "glDrawElementsInstancedARB\0"
+ "glRenderbufferStorageMultisample\0"
+ "glFramebufferTextureARB\0"
+ "glFramebufferTextureFaceARB\0"
+ "glProgramParameteriARB\0"
+ "glVertexAttribDivisorARB\0"
+ "glFlushMappedBufferRange\0"
+ "glMapBufferRange\0"
+ "glTexBufferARB\0"
+ "glBindVertexArray\0"
+ "glGenVertexArrays\0"
+ "glCopyBufferSubData\0"
+ "glClientWaitSync\0"
+ "glDeleteSync\0"
+ "glFenceSync\0"
+ "glGetInteger64v\0"
+ "glGetSynciv\0"
+ "glIsSync\0"
+ "glWaitSync\0"
+ "glDrawElementsBaseVertex\0"
+ "glDrawRangeElementsBaseVertex\0"
+ "glMultiDrawElementsBaseVertex\0"
+ "glBlendEquationSeparateiARB\0"
+ "glBlendEquationiARB\0"
+ "glBlendFuncSeparateiARB\0"
+ "glBlendFunciARB\0"
+ "glBindSampler\0"
+ "glDeleteSamplers\0"
+ "glGenSamplers\0"
+ "glGetSamplerParameterIiv\0"
+ "glGetSamplerParameterIuiv\0"
+ "glGetSamplerParameterfv\0"
+ "glGetSamplerParameteriv\0"
+ "glIsSampler\0"
+ "glSamplerParameterIiv\0"
+ "glSamplerParameterIuiv\0"
+ "glSamplerParameterf\0"
+ "glSamplerParameterfv\0"
+ "glSamplerParameteri\0"
+ "glSamplerParameteriv\0"
+ "glBindTransformFeedback\0"
+ "glDeleteTransformFeedbacks\0"
+ "glDrawTransformFeedback\0"
+ "glGenTransformFeedbacks\0"
+ "glIsTransformFeedback\0"
+ "glPauseTransformFeedback\0"
+ "glResumeTransformFeedback\0"
+ "glClearDepthf\0"
+ "glDepthRangef\0"
+ "glGetShaderPrecisionFormat\0"
+ "glReleaseShaderCompiler\0"
+ "glShaderBinary\0"
+ "glGetGraphicsResetStatusARB\0"
+ "glGetnColorTableARB\0"
+ "glGetnCompressedTexImageARB\0"
+ "glGetnConvolutionFilterARB\0"
+ "glGetnHistogramARB\0"
+ "glGetnMapdvARB\0"
+ "glGetnMapfvARB\0"
+ "glGetnMapivARB\0"
+ "glGetnMinmaxARB\0"
+ "glGetnPixelMapfvARB\0"
+ "glGetnPixelMapuivARB\0"
+ "glGetnPixelMapusvARB\0"
+ "glGetnPolygonStippleARB\0"
+ "glGetnSeparableFilterARB\0"
+ "glGetnTexImageARB\0"
+ "glGetnUniformdvARB\0"
+ "glGetnUniformfvARB\0"
+ "glGetnUniformivARB\0"
+ "glGetnUniformuivARB\0"
+ "glReadnPixelsARB\0"
+ "glPolygonOffsetEXT\0"
+ "glGetPixelTexGenParameterfvSGIS\0"
+ "glGetPixelTexGenParameterivSGIS\0"
+ "glPixelTexGenParameterfSGIS\0"
+ "glPixelTexGenParameterfvSGIS\0"
+ "glPixelTexGenParameteriSGIS\0"
+ "glPixelTexGenParameterivSGIS\0"
+ "glSampleMaskSGIS\0"
+ "glSamplePatternSGIS\0"
+ "glColorPointerEXT\0"
+ "glEdgeFlagPointerEXT\0"
+ "glIndexPointerEXT\0"
+ "glNormalPointerEXT\0"
+ "glTexCoordPointerEXT\0"
+ "glVertexPointerEXT\0"
+ "glPointParameterfEXT\0"
+ "glPointParameterfvEXT\0"
+ "glLockArraysEXT\0"
+ "glUnlockArraysEXT\0"
+ "glSecondaryColor3bEXT\0"
+ "glSecondaryColor3bvEXT\0"
+ "glSecondaryColor3dEXT\0"
+ "glSecondaryColor3dvEXT\0"
+ "glSecondaryColor3fEXT\0"
+ "glSecondaryColor3fvEXT\0"
+ "glSecondaryColor3iEXT\0"
+ "glSecondaryColor3ivEXT\0"
+ "glSecondaryColor3sEXT\0"
+ "glSecondaryColor3svEXT\0"
+ "glSecondaryColor3ubEXT\0"
+ "glSecondaryColor3ubvEXT\0"
+ "glSecondaryColor3uiEXT\0"
+ "glSecondaryColor3uivEXT\0"
+ "glSecondaryColor3usEXT\0"
+ "glSecondaryColor3usvEXT\0"
+ "glSecondaryColorPointerEXT\0"
+ "glMultiDrawArraysEXT\0"
+ "glMultiDrawElementsEXT\0"
+ "glFogCoordPointerEXT\0"
+ "glFogCoorddEXT\0"
+ "glFogCoorddvEXT\0"
+ "glFogCoordfEXT\0"
+ "glFogCoordfvEXT\0"
+ "glPixelTexGenSGIX\0"
+ "glBlendFuncSeparateEXT\0"
+ "glFlushVertexArrayRangeNV\0"
+ "glVertexArrayRangeNV\0"
+ "glCombinerInputNV\0"
+ "glCombinerOutputNV\0"
+ "glCombinerParameterfNV\0"
+ "glCombinerParameterfvNV\0"
+ "glCombinerParameteriNV\0"
+ "glCombinerParameterivNV\0"
+ "glFinalCombinerInputNV\0"
+ "glGetCombinerInputParameterfvNV\0"
+ "glGetCombinerInputParameterivNV\0"
+ "glGetCombinerOutputParameterfvNV\0"
+ "glGetCombinerOutputParameterivNV\0"
+ "glGetFinalCombinerInputParameterfvNV\0"
+ "glGetFinalCombinerInputParameterivNV\0"
+ "glResizeBuffersMESA\0"
+ "glWindowPos2dMESA\0"
+ "glWindowPos2dvMESA\0"
+ "glWindowPos2fMESA\0"
+ "glWindowPos2fvMESA\0"
+ "glWindowPos2iMESA\0"
+ "glWindowPos2ivMESA\0"
+ "glWindowPos2sMESA\0"
+ "glWindowPos2svMESA\0"
+ "glWindowPos3dMESA\0"
+ "glWindowPos3dvMESA\0"
+ "glWindowPos3fMESA\0"
+ "glWindowPos3fvMESA\0"
+ "glWindowPos3iMESA\0"
+ "glWindowPos3ivMESA\0"
+ "glWindowPos3sMESA\0"
+ "glWindowPos3svMESA\0"
+ "glWindowPos4dMESA\0"
+ "glWindowPos4dvMESA\0"
+ "glWindowPos4fMESA\0"
+ "glWindowPos4fvMESA\0"
+ "glWindowPos4iMESA\0"
+ "glWindowPos4ivMESA\0"
+ "glWindowPos4sMESA\0"
+ "glWindowPos4svMESA\0"
+ "glMultiModeDrawArraysIBM\0"
+ "glMultiModeDrawElementsIBM\0"
+ "glDeleteFencesNV\0"
+ "glFinishFenceNV\0"
+ "glGenFencesNV\0"
+ "glGetFenceivNV\0"
+ "glIsFenceNV\0"
+ "glSetFenceNV\0"
+ "glTestFenceNV\0"
+ "glAreProgramsResidentNV\0"
+ "glBindProgramNV\0"
+ "glDeleteProgramsNV\0"
+ "glExecuteProgramNV\0"
+ "glGenProgramsNV\0"
+ "glGetProgramParameterdvNV\0"
+ "glGetProgramParameterfvNV\0"
+ "glGetProgramStringNV\0"
+ "glGetProgramivNV\0"
+ "glGetTrackMatrixivNV\0"
+ "glGetVertexAttribPointervNV\0"
+ "glGetVertexAttribdvNV\0"
+ "glGetVertexAttribfvNV\0"
+ "glGetVertexAttribivNV\0"
+ "glIsProgramNV\0"
+ "glLoadProgramNV\0"
+ "glProgramParameters4dvNV\0"
+ "glProgramParameters4fvNV\0"
+ "glRequestResidentProgramsNV\0"
+ "glTrackMatrixNV\0"
+ "glVertexAttrib1dNV\0"
+ "glVertexAttrib1dvNV\0"
+ "glVertexAttrib1fNV\0"
+ "glVertexAttrib1fvNV\0"
+ "glVertexAttrib1sNV\0"
+ "glVertexAttrib1svNV\0"
+ "glVertexAttrib2dNV\0"
+ "glVertexAttrib2dvNV\0"
+ "glVertexAttrib2fNV\0"
+ "glVertexAttrib2fvNV\0"
+ "glVertexAttrib2sNV\0"
+ "glVertexAttrib2svNV\0"
+ "glVertexAttrib3dNV\0"
+ "glVertexAttrib3dvNV\0"
+ "glVertexAttrib3fNV\0"
+ "glVertexAttrib3fvNV\0"
+ "glVertexAttrib3sNV\0"
+ "glVertexAttrib3svNV\0"
+ "glVertexAttrib4dNV\0"
+ "glVertexAttrib4dvNV\0"
+ "glVertexAttrib4fNV\0"
+ "glVertexAttrib4fvNV\0"
+ "glVertexAttrib4sNV\0"
+ "glVertexAttrib4svNV\0"
+ "glVertexAttrib4ubNV\0"
+ "glVertexAttrib4ubvNV\0"
+ "glVertexAttribPointerNV\0"
+ "glVertexAttribs1dvNV\0"
+ "glVertexAttribs1fvNV\0"
+ "glVertexAttribs1svNV\0"
+ "glVertexAttribs2dvNV\0"
+ "glVertexAttribs2fvNV\0"
+ "glVertexAttribs2svNV\0"
+ "glVertexAttribs3dvNV\0"
+ "glVertexAttribs3fvNV\0"
+ "glVertexAttribs3svNV\0"
+ "glVertexAttribs4dvNV\0"
+ "glVertexAttribs4fvNV\0"
+ "glVertexAttribs4svNV\0"
+ "glVertexAttribs4ubvNV\0"
+ "glGetTexBumpParameterfvATI\0"
+ "glGetTexBumpParameterivATI\0"
+ "glTexBumpParameterfvATI\0"
+ "glTexBumpParameterivATI\0"
+ "glAlphaFragmentOp1ATI\0"
+ "glAlphaFragmentOp2ATI\0"
+ "glAlphaFragmentOp3ATI\0"
+ "glBeginFragmentShaderATI\0"
+ "glBindFragmentShaderATI\0"
+ "glColorFragmentOp1ATI\0"
+ "glColorFragmentOp2ATI\0"
+ "glColorFragmentOp3ATI\0"
+ "glDeleteFragmentShaderATI\0"
+ "glEndFragmentShaderATI\0"
+ "glGenFragmentShadersATI\0"
+ "glPassTexCoordATI\0"
+ "glSampleMapATI\0"
+ "glSetFragmentShaderConstantATI\0"
+ "glPointParameteriNV\0"
+ "glPointParameterivNV\0"
+ "glActiveStencilFaceEXT\0"
+ "glBindVertexArrayAPPLE\0"
+ "glDeleteVertexArraysAPPLE\0"
+ "glGenVertexArraysAPPLE\0"
+ "glIsVertexArrayAPPLE\0"
+ "glGetProgramNamedParameterdvNV\0"
+ "glGetProgramNamedParameterfvNV\0"
+ "glProgramNamedParameter4dNV\0"
+ "glProgramNamedParameter4dvNV\0"
+ "glProgramNamedParameter4fNV\0"
+ "glProgramNamedParameter4fvNV\0"
+ "glPrimitiveRestartIndexNV\0"
+ "glPrimitiveRestartNV\0"
+ "glDepthBoundsEXT\0"
+ "glBlendEquationSeparateEXT\0"
+ "glBindFramebufferEXT\0"
+ "glBindRenderbufferEXT\0"
+ "glCheckFramebufferStatusEXT\0"
+ "glDeleteFramebuffersEXT\0"
+ "glDeleteRenderbuffersEXT\0"
+ "glFramebufferRenderbufferEXT\0"
+ "glFramebufferTexture1DEXT\0"
+ "glFramebufferTexture2DEXT\0"
+ "glFramebufferTexture3DEXT\0"
+ "glGenFramebuffersEXT\0"
+ "glGenRenderbuffersEXT\0"
+ "glGenerateMipmapEXT\0"
+ "glGetFramebufferAttachmentParameterivEXT\0"
+ "glGetRenderbufferParameterivEXT\0"
+ "glIsFramebufferEXT\0"
+ "glIsRenderbufferEXT\0"
+ "glRenderbufferStorageEXT\0"
+ "glBlitFramebufferEXT\0"
+ "glBufferParameteriAPPLE\0"
+ "glFlushMappedBufferRangeAPPLE\0"
+ "glBindFragDataLocationEXT\0"
+ "glGetFragDataLocationEXT\0"
+ "glGetUniformuivEXT\0"
+ "glGetVertexAttribIivEXT\0"
+ "glGetVertexAttribIuivEXT\0"
+ "glUniform1uiEXT\0"
+ "glUniform1uivEXT\0"
+ "glUniform2uiEXT\0"
+ "glUniform2uivEXT\0"
+ "glUniform3uiEXT\0"
+ "glUniform3uivEXT\0"
+ "glUniform4uiEXT\0"
+ "glUniform4uivEXT\0"
+ "glVertexAttribI1iEXT\0"
+ "glVertexAttribI1ivEXT\0"
+ "glVertexAttribI1uiEXT\0"
+ "glVertexAttribI1uivEXT\0"
+ "glVertexAttribI2iEXT\0"
+ "glVertexAttribI2ivEXT\0"
+ "glVertexAttribI2uiEXT\0"
+ "glVertexAttribI2uivEXT\0"
+ "glVertexAttribI3iEXT\0"
+ "glVertexAttribI3ivEXT\0"
+ "glVertexAttribI3uiEXT\0"
+ "glVertexAttribI3uivEXT\0"
+ "glVertexAttribI4bvEXT\0"
+ "glVertexAttribI4iEXT\0"
+ "glVertexAttribI4ivEXT\0"
+ "glVertexAttribI4svEXT\0"
+ "glVertexAttribI4ubvEXT\0"
+ "glVertexAttribI4uiEXT\0"
+ "glVertexAttribI4uivEXT\0"
+ "glVertexAttribI4usvEXT\0"
+ "glVertexAttribIPointerEXT\0"
+ "glFramebufferTextureLayerEXT\0"
+ "glColorMaskIndexedEXT\0"
+ "glDisableIndexedEXT\0"
+ "glEnableIndexedEXT\0"
+ "glGetBooleanIndexedvEXT\0"
+ "glGetIntegerIndexedvEXT\0"
+ "glIsEnabledIndexedEXT\0"
+ "glClearColorIiEXT\0"
+ "glClearColorIuiEXT\0"
+ "glGetTexParameterIivEXT\0"
+ "glGetTexParameterIuivEXT\0"
+ "glTexParameterIivEXT\0"
+ "glTexParameterIuivEXT\0"
+ "glBeginConditionalRenderNV\0"
+ "glEndConditionalRenderNV\0"
+ "glBeginTransformFeedbackEXT\0"
+ "glBindBufferBaseEXT\0"
+ "glBindBufferOffsetEXT\0"
+ "glBindBufferRangeEXT\0"
+ "glEndTransformFeedbackEXT\0"
+ "glGetTransformFeedbackVaryingEXT\0"
+ "glTransformFeedbackVaryingsEXT\0"
+ "glProvokingVertexEXT\0"
+ "glGetTexParameterPointervAPPLE\0"
+ "glTextureRangeAPPLE\0"
+ "glGetObjectParameterivAPPLE\0"
+ "glObjectPurgeableAPPLE\0"
+ "glObjectUnpurgeableAPPLE\0"
+ "glActiveProgramEXT\0"
+ "glCreateShaderProgramEXT\0"
+ "glUseShaderProgramEXT\0"
+ "glTextureBarrierNV\0"
+ "glStencilFuncSeparateATI\0"
+ "glProgramEnvParameters4fvEXT\0"
+ "glProgramLocalParameters4fvEXT\0"
+ "glGetQueryObjecti64vEXT\0"
+ "glGetQueryObjectui64vEXT\0"
+ "glEGLImageTargetRenderbufferStorageOES\0"
+ "glEGLImageTargetTexture2DOES\0"
+ "glArrayElementEXT\0"
+ "glBindTextureEXT\0"
+ "glDrawArraysEXT\0"
+ "glAreTexturesResidentEXT\0"
+ "glCopyTexImage1DEXT\0"
+ "glCopyTexImage2DEXT\0"
+ "glCopyTexSubImage1DEXT\0"
+ "glCopyTexSubImage2DEXT\0"
+ "glDeleteTexturesEXT\0"
+ "glGenTexturesEXT\0"
+ "glGetPointervEXT\0"
+ "glIsTextureEXT\0"
+ "glPrioritizeTexturesEXT\0"
+ "glTexSubImage1DEXT\0"
+ "glTexSubImage2DEXT\0"
+ "glBlendColorEXT\0"
+ "glBlendEquationEXT\0"
+ "glDrawRangeElementsEXT\0"
+ "glColorTableSGI\0"
+ "glColorTableEXT\0"
+ "glColorTableParameterfvSGI\0"
+ "glColorTableParameterivSGI\0"
+ "glCopyColorTableSGI\0"
+ "glGetColorTableSGI\0"
+ "glGetColorTableEXT\0"
+ "glGetColorTableParameterfvSGI\0"
+ "glGetColorTableParameterfvEXT\0"
+ "glGetColorTableParameterivSGI\0"
+ "glGetColorTableParameterivEXT\0"
+ "glColorSubTableEXT\0"
+ "glCopyColorSubTableEXT\0"
+ "glConvolutionFilter1DEXT\0"
+ "glConvolutionFilter2DEXT\0"
+ "glConvolutionParameterfEXT\0"
+ "glConvolutionParameterfvEXT\0"
+ "glConvolutionParameteriEXT\0"
+ "glConvolutionParameterivEXT\0"
+ "glCopyConvolutionFilter1DEXT\0"
+ "glCopyConvolutionFilter2DEXT\0"
+ "glGetConvolutionFilterEXT\0"
+ "glGetConvolutionParameterfvEXT\0"
+ "glGetConvolutionParameterivEXT\0"
+ "glGetSeparableFilterEXT\0"
+ "glSeparableFilter2DEXT\0"
+ "glGetHistogramEXT\0"
+ "glGetHistogramParameterfvEXT\0"
+ "glGetHistogramParameterivEXT\0"
+ "glGetMinmaxEXT\0"
+ "glGetMinmaxParameterfvEXT\0"
+ "glGetMinmaxParameterivEXT\0"
+ "glHistogramEXT\0"
+ "glMinmaxEXT\0"
+ "glResetHistogramEXT\0"
+ "glResetMinmaxEXT\0"
+ "glTexImage3DEXT\0"
+ "glTexSubImage3DEXT\0"
+ "glCopyTexSubImage3DEXT\0"
+ "glActiveTexture\0"
+ "glClientActiveTexture\0"
+ "glMultiTexCoord1d\0"
+ "glMultiTexCoord1dv\0"
+ "glMultiTexCoord1f\0"
+ "glMultiTexCoord1fv\0"
+ "glMultiTexCoord1i\0"
+ "glMultiTexCoord1iv\0"
+ "glMultiTexCoord1s\0"
+ "glMultiTexCoord1sv\0"
+ "glMultiTexCoord2d\0"
+ "glMultiTexCoord2dv\0"
+ "glMultiTexCoord2f\0"
+ "glMultiTexCoord2fv\0"
+ "glMultiTexCoord2i\0"
+ "glMultiTexCoord2iv\0"
+ "glMultiTexCoord2s\0"
+ "glMultiTexCoord2sv\0"
+ "glMultiTexCoord3d\0"
+ "glMultiTexCoord3dv\0"
+ "glMultiTexCoord3f\0"
+ "glMultiTexCoord3fv\0"
+ "glMultiTexCoord3i\0"
+ "glMultiTexCoord3iv\0"
+ "glMultiTexCoord3s\0"
+ "glMultiTexCoord3sv\0"
+ "glMultiTexCoord4d\0"
+ "glMultiTexCoord4dv\0"
+ "glMultiTexCoord4f\0"
+ "glMultiTexCoord4fv\0"
+ "glMultiTexCoord4i\0"
+ "glMultiTexCoord4iv\0"
+ "glMultiTexCoord4s\0"
+ "glMultiTexCoord4sv\0"
+ "glStencilOpSeparateATI\0"
+ "glLoadTransposeMatrixd\0"
+ "glLoadTransposeMatrixf\0"
+ "glMultTransposeMatrixd\0"
+ "glMultTransposeMatrixf\0"
+ "glSampleCoverage\0"
+ "glCompressedTexImage1D\0"
+ "glCompressedTexImage2D\0"
+ "glCompressedTexImage3D\0"
+ "glCompressedTexSubImage1D\0"
+ "glCompressedTexSubImage2D\0"
+ "glCompressedTexSubImage3D\0"
+ "glGetCompressedTexImage\0"
+ "glDisableVertexAttribArray\0"
+ "glEnableVertexAttribArray\0"
+ "glGetVertexAttribdv\0"
+ "glGetVertexAttribfv\0"
+ "glGetVertexAttribiv\0"
+ "glProgramParameter4dNV\0"
+ "glProgramParameter4dvNV\0"
+ "glProgramParameter4fNV\0"
+ "glProgramParameter4fvNV\0"
+ "glVertexAttrib1d\0"
+ "glVertexAttrib1dv\0"
+ "glVertexAttrib1f\0"
+ "glVertexAttrib1fv\0"
+ "glVertexAttrib1s\0"
+ "glVertexAttrib1sv\0"
+ "glVertexAttrib2d\0"
+ "glVertexAttrib2dv\0"
+ "glVertexAttrib2f\0"
+ "glVertexAttrib2fv\0"
+ "glVertexAttrib2s\0"
+ "glVertexAttrib2sv\0"
+ "glVertexAttrib3d\0"
+ "glVertexAttrib3dv\0"
+ "glVertexAttrib3f\0"
+ "glVertexAttrib3fv\0"
+ "glVertexAttrib3s\0"
+ "glVertexAttrib3sv\0"
+ "glVertexAttrib4Nbv\0"
+ "glVertexAttrib4Niv\0"
+ "glVertexAttrib4Nsv\0"
+ "glVertexAttrib4Nub\0"
+ "glVertexAttrib4Nubv\0"
+ "glVertexAttrib4Nuiv\0"
+ "glVertexAttrib4Nusv\0"
+ "glVertexAttrib4bv\0"
+ "glVertexAttrib4d\0"
+ "glVertexAttrib4dv\0"
+ "glVertexAttrib4f\0"
+ "glVertexAttrib4fv\0"
+ "glVertexAttrib4iv\0"
+ "glVertexAttrib4s\0"
+ "glVertexAttrib4sv\0"
+ "glVertexAttrib4ubv\0"
+ "glVertexAttrib4uiv\0"
+ "glVertexAttrib4usv\0"
+ "glVertexAttribPointer\0"
+ "glBindBuffer\0"
+ "glBufferData\0"
+ "glBufferSubData\0"
+ "glDeleteBuffers\0"
+ "glGenBuffers\0"
+ "glGetBufferParameteriv\0"
+ "glGetBufferPointerv\0"
+ "glGetBufferSubData\0"
+ "glIsBuffer\0"
+ "glMapBuffer\0"
+ "glUnmapBuffer\0"
+ "glBeginQuery\0"
+ "glDeleteQueries\0"
+ "glEndQuery\0"
+ "glGenQueries\0"
+ "glGetQueryObjectiv\0"
+ "glGetQueryObjectuiv\0"
+ "glGetQueryiv\0"
+ "glIsQuery\0"
+ "glCompileShader\0"
+ "glGetActiveUniform\0"
+ "glGetShaderSource\0"
+ "glGetUniformLocation\0"
+ "glGetUniformfv\0"
+ "glGetUniformiv\0"
+ "glLinkProgram\0"
+ "glShaderSource\0"
+ "glUniform1f\0"
+ "glUniform1fv\0"
+ "glUniform1i\0"
+ "glUniform1iv\0"
+ "glUniform2f\0"
+ "glUniform2fv\0"
+ "glUniform2i\0"
+ "glUniform2iv\0"
+ "glUniform3f\0"
+ "glUniform3fv\0"
+ "glUniform3i\0"
+ "glUniform3iv\0"
+ "glUniform4f\0"
+ "glUniform4fv\0"
+ "glUniform4i\0"
+ "glUniform4iv\0"
+ "glUniformMatrix2fv\0"
+ "glUniformMatrix3fv\0"
+ "glUniformMatrix4fv\0"
+ "glUseProgram\0"
+ "glValidateProgram\0"
+ "glBindAttribLocation\0"
+ "glGetActiveAttrib\0"
+ "glGetAttribLocation\0"
+ "glDrawBuffers\0"
+ "glDrawBuffersATI\0"
+ "glDrawArraysInstancedEXT\0"
+ "glDrawArraysInstanced\0"
+ "glDrawElementsInstancedEXT\0"
+ "glDrawElementsInstanced\0"
+ "glRenderbufferStorageMultisampleEXT\0"
+ "glBlendEquationSeparateIndexedAMD\0"
+ "glBlendEquationIndexedAMD\0"
+ "glBlendFuncSeparateIndexedAMD\0"
+ "glBlendFuncIndexedAMD\0"
+ "glSampleMaskEXT\0"
+ "glSamplePatternEXT\0"
+ "glPointParameterf\0"
+ "glPointParameterfARB\0"
+ "glPointParameterfSGIS\0"
+ "glPointParameterfv\0"
+ "glPointParameterfvARB\0"
+ "glPointParameterfvSGIS\0"
+ "glSecondaryColor3b\0"
+ "glSecondaryColor3bv\0"
+ "glSecondaryColor3d\0"
+ "glSecondaryColor3dv\0"
+ "glSecondaryColor3f\0"
+ "glSecondaryColor3fv\0"
+ "glSecondaryColor3i\0"
+ "glSecondaryColor3iv\0"
+ "glSecondaryColor3s\0"
+ "glSecondaryColor3sv\0"
+ "glSecondaryColor3ub\0"
+ "glSecondaryColor3ubv\0"
+ "glSecondaryColor3ui\0"
+ "glSecondaryColor3uiv\0"
+ "glSecondaryColor3us\0"
+ "glSecondaryColor3usv\0"
+ "glSecondaryColorPointer\0"
+ "glMultiDrawArrays\0"
+ "glMultiDrawElements\0"
+ "glFogCoordPointer\0"
+ "glFogCoordd\0"
+ "glFogCoorddv\0"
+ "glFogCoordf\0"
+ "glFogCoordfv\0"
+ "glBlendFuncSeparate\0"
+ "glBlendFuncSeparateINGR\0"
+ "glWindowPos2d\0"
+ "glWindowPos2dARB\0"
+ "glWindowPos2dv\0"
+ "glWindowPos2dvARB\0"
+ "glWindowPos2f\0"
+ "glWindowPos2fARB\0"
+ "glWindowPos2fv\0"
+ "glWindowPos2fvARB\0"
+ "glWindowPos2i\0"
+ "glWindowPos2iARB\0"
+ "glWindowPos2iv\0"
+ "glWindowPos2ivARB\0"
+ "glWindowPos2s\0"
+ "glWindowPos2sARB\0"
+ "glWindowPos2sv\0"
+ "glWindowPos2svARB\0"
+ "glWindowPos3d\0"
+ "glWindowPos3dARB\0"
+ "glWindowPos3dv\0"
+ "glWindowPos3dvARB\0"
+ "glWindowPos3f\0"
+ "glWindowPos3fARB\0"
+ "glWindowPos3fv\0"
+ "glWindowPos3fvARB\0"
+ "glWindowPos3i\0"
+ "glWindowPos3iARB\0"
+ "glWindowPos3iv\0"
+ "glWindowPos3ivARB\0"
+ "glWindowPos3s\0"
+ "glWindowPos3sARB\0"
+ "glWindowPos3sv\0"
+ "glWindowPos3svARB\0"
+ "glBindProgramARB\0"
+ "glDeleteProgramsARB\0"
+ "glGenProgramsARB\0"
+ "glGetVertexAttribPointerv\0"
+ "glGetVertexAttribPointervARB\0"
+ "glIsProgramARB\0"
+ "glPointParameteri\0"
+ "glPointParameteriv\0"
+ "glDeleteVertexArrays\0"
+ "glIsVertexArray\0"
+ "glPrimitiveRestartIndex\0"
+ "glBlendEquationSeparate\0"
+ "glBlendEquationSeparateATI\0"
+ "glBindFramebuffer\0"
+ "glBindRenderbuffer\0"
+ "glCheckFramebufferStatus\0"
+ "glDeleteFramebuffers\0"
+ "glDeleteRenderbuffers\0"
+ "glFramebufferRenderbuffer\0"
+ "glFramebufferTexture1D\0"
+ "glFramebufferTexture2D\0"
+ "glFramebufferTexture3D\0"
+ "glGenFramebuffers\0"
+ "glGenRenderbuffers\0"
+ "glGenerateMipmap\0"
+ "glGetFramebufferAttachmentParameteriv\0"
+ "glGetRenderbufferParameteriv\0"
+ "glIsFramebuffer\0"
+ "glIsRenderbuffer\0"
+ "glRenderbufferStorage\0"
+ "glBlitFramebuffer\0"
+ "glBindFragDataLocation\0"
+ "glGetFragDataLocation\0"
+ "glGetUniformuiv\0"
+ "glGetVertexAttribIiv\0"
+ "glGetVertexAttribIuiv\0"
+ "glUniform1ui\0"
+ "glUniform1uiv\0"
+ "glUniform2ui\0"
+ "glUniform2uiv\0"
+ "glUniform3ui\0"
+ "glUniform3uiv\0"
+ "glUniform4ui\0"
+ "glUniform4uiv\0"
+ "glVertexAttribI1i\0"
+ "glVertexAttribI1iv\0"
+ "glVertexAttribI1ui\0"
+ "glVertexAttribI1uiv\0"
+ "glVertexAttribI2i\0"
+ "glVertexAttribI2iv\0"
+ "glVertexAttribI2ui\0"
+ "glVertexAttribI2uiv\0"
+ "glVertexAttribI3i\0"
+ "glVertexAttribI3iv\0"
+ "glVertexAttribI3ui\0"
+ "glVertexAttribI3uiv\0"
+ "glVertexAttribI4bv\0"
+ "glVertexAttribI4i\0"
+ "glVertexAttribI4iv\0"
+ "glVertexAttribI4sv\0"
+ "glVertexAttribI4ubv\0"
+ "glVertexAttribI4ui\0"
+ "glVertexAttribI4uiv\0"
+ "glVertexAttribI4usv\0"
+ "glVertexAttribIPointer\0"
+ "glFramebufferTextureLayer\0"
+ "glColorMaski\0"
+ "glDisablei\0"
+ "glEnablei\0"
+ "glGetBooleani_v\0"
+ "glGetIntegeri_v\0"
+ "glIsEnabledi\0"
+ "glGetTexParameterIiv\0"
+ "glGetTexParameterIuiv\0"
+ "glTexParameterIiv\0"
+ "glTexParameterIuiv\0"
+ "glBeginConditionalRender\0"
+ "glEndConditionalRender\0"
+ "glBeginTransformFeedback\0"
+ "glBindBufferBase\0"
+ "glBindBufferRange\0"
+ "glEndTransformFeedback\0"
+ "glGetTransformFeedbackVarying\0"
+ "glTransformFeedbackVaryings\0"
+ "glProvokingVertex\0"
+ ;
+
+
+#ifdef USE_MGL_NAMESPACE
+#define gl_dispatch_stub_343 mgl_dispatch_stub_343
+#define gl_dispatch_stub_344 mgl_dispatch_stub_344
+#define gl_dispatch_stub_345 mgl_dispatch_stub_345
+#define gl_dispatch_stub_356 mgl_dispatch_stub_356
+#define gl_dispatch_stub_357 mgl_dispatch_stub_357
+#define gl_dispatch_stub_358 mgl_dispatch_stub_358
+#define gl_dispatch_stub_359 mgl_dispatch_stub_359
+#define gl_dispatch_stub_361 mgl_dispatch_stub_361
+#define gl_dispatch_stub_362 mgl_dispatch_stub_362
+#define gl_dispatch_stub_363 mgl_dispatch_stub_363
+#define gl_dispatch_stub_364 mgl_dispatch_stub_364
+#define gl_dispatch_stub_365 mgl_dispatch_stub_365
+#define gl_dispatch_stub_366 mgl_dispatch_stub_366
+#define gl_dispatch_stub_647 mgl_dispatch_stub_647
+#define gl_dispatch_stub_648 mgl_dispatch_stub_648
+#define gl_dispatch_stub_649 mgl_dispatch_stub_649
+#define gl_dispatch_stub_650 mgl_dispatch_stub_650
+#define gl_dispatch_stub_651 mgl_dispatch_stub_651
+#define gl_dispatch_stub_652 mgl_dispatch_stub_652
+#define gl_dispatch_stub_653 mgl_dispatch_stub_653
+#define gl_dispatch_stub_654 mgl_dispatch_stub_654
+#define gl_dispatch_stub_689 mgl_dispatch_stub_689
+#define gl_dispatch_stub_731 mgl_dispatch_stub_731
+#define gl_dispatch_stub_732 mgl_dispatch_stub_732
+#define gl_dispatch_stub_733 mgl_dispatch_stub_733
+#define gl_dispatch_stub_734 mgl_dispatch_stub_734
+#define gl_dispatch_stub_735 mgl_dispatch_stub_735
+#define gl_dispatch_stub_736 mgl_dispatch_stub_736
+#define gl_dispatch_stub_737 mgl_dispatch_stub_737
+#define gl_dispatch_stub_738 mgl_dispatch_stub_738
+#define gl_dispatch_stub_739 mgl_dispatch_stub_739
+#define gl_dispatch_stub_820 mgl_dispatch_stub_820
+#define gl_dispatch_stub_821 mgl_dispatch_stub_821
+#define gl_dispatch_stub_822 mgl_dispatch_stub_822
+#define gl_dispatch_stub_823 mgl_dispatch_stub_823
+#define gl_dispatch_stub_824 mgl_dispatch_stub_824
+#define gl_dispatch_stub_833 mgl_dispatch_stub_833
+#define gl_dispatch_stub_834 mgl_dispatch_stub_834
+#define gl_dispatch_stub_852 mgl_dispatch_stub_852
+#define gl_dispatch_stub_853 mgl_dispatch_stub_853
+#define gl_dispatch_stub_854 mgl_dispatch_stub_854
+#define gl_dispatch_stub_912 mgl_dispatch_stub_912
+#define gl_dispatch_stub_913 mgl_dispatch_stub_913
+#define gl_dispatch_stub_921 mgl_dispatch_stub_921
+#define gl_dispatch_stub_922 mgl_dispatch_stub_922
+#define gl_dispatch_stub_923 mgl_dispatch_stub_923
+#define gl_dispatch_stub_924 mgl_dispatch_stub_924
+#define gl_dispatch_stub_925 mgl_dispatch_stub_925
+#endif /* USE_MGL_NAMESPACE */
+
+
+#if defined(NEED_FUNCTION_POINTER) || defined(GLX_INDIRECT_RENDERING)
+void GLAPIENTRY gl_dispatch_stub_343(GLenum target, GLenum format, GLenum type, GLvoid * table);
+void GLAPIENTRY gl_dispatch_stub_344(GLenum target, GLenum pname, GLfloat * params);
+void GLAPIENTRY gl_dispatch_stub_345(GLenum target, GLenum pname, GLint * params);
+void GLAPIENTRY gl_dispatch_stub_356(GLenum target, GLenum format, GLenum type, GLvoid * image);
+void GLAPIENTRY gl_dispatch_stub_357(GLenum target, GLenum pname, GLfloat * params);
+void GLAPIENTRY gl_dispatch_stub_358(GLenum target, GLenum pname, GLint * params);
+void GLAPIENTRY gl_dispatch_stub_359(GLenum target, GLenum format, GLenum type, GLvoid * row, GLvoid * column, GLvoid * span);
+void GLAPIENTRY gl_dispatch_stub_361(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid * values);
+void GLAPIENTRY gl_dispatch_stub_362(GLenum target, GLenum pname, GLfloat * params);
+void GLAPIENTRY gl_dispatch_stub_363(GLenum target, GLenum pname, GLint * params);
+void GLAPIENTRY gl_dispatch_stub_364(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid * values);
+void GLAPIENTRY gl_dispatch_stub_365(GLenum target, GLenum pname, GLfloat * params);
+void GLAPIENTRY gl_dispatch_stub_366(GLenum target, GLenum pname, GLint * params);
+void GLAPIENTRY gl_dispatch_stub_647(GLenum pname, GLfloat * params);
+void GLAPIENTRY gl_dispatch_stub_648(GLenum pname, GLint * params);
+void GLAPIENTRY gl_dispatch_stub_649(GLenum pname, GLfloat param);
+void GLAPIENTRY gl_dispatch_stub_650(GLenum pname, const GLfloat * params);
+void GLAPIENTRY gl_dispatch_stub_651(GLenum pname, GLint param);
+void GLAPIENTRY gl_dispatch_stub_652(GLenum pname, const GLint * params);
+void GLAPIENTRY gl_dispatch_stub_653(GLclampf value, GLboolean invert);
+void GLAPIENTRY gl_dispatch_stub_654(GLenum pattern);
+void GLAPIENTRY gl_dispatch_stub_689(GLenum mode);
+void GLAPIENTRY gl_dispatch_stub_731(const GLenum * mode, const GLint * first, const GLsizei * count, GLsizei primcount, GLint modestride);
+void GLAPIENTRY gl_dispatch_stub_732(const GLenum * mode, const GLsizei * count, GLenum type, const GLvoid * const * indices, GLsizei primcount, GLint modestride);
+void GLAPIENTRY gl_dispatch_stub_733(GLsizei n, const GLuint * fences);
+void GLAPIENTRY gl_dispatch_stub_734(GLuint fence);
+void GLAPIENTRY gl_dispatch_stub_735(GLsizei n, GLuint * fences);
+void GLAPIENTRY gl_dispatch_stub_736(GLuint fence, GLenum pname, GLint * params);
+GLboolean GLAPIENTRY gl_dispatch_stub_737(GLuint fence);
+void GLAPIENTRY gl_dispatch_stub_738(GLuint fence, GLenum condition);
+GLboolean GLAPIENTRY gl_dispatch_stub_739(GLuint fence);
+void GLAPIENTRY gl_dispatch_stub_820(GLenum face);
+void GLAPIENTRY gl_dispatch_stub_821(GLuint array);
+void GLAPIENTRY gl_dispatch_stub_822(GLsizei n, const GLuint * arrays);
+void GLAPIENTRY gl_dispatch_stub_823(GLsizei n, GLuint * arrays);
+GLboolean GLAPIENTRY gl_dispatch_stub_824(GLuint array);
+void GLAPIENTRY gl_dispatch_stub_833(GLclampd zmin, GLclampd zmax);
+void GLAPIENTRY gl_dispatch_stub_834(GLenum modeRGB, GLenum modeA);
+void GLAPIENTRY gl_dispatch_stub_852(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
+void GLAPIENTRY gl_dispatch_stub_853(GLenum target, GLenum pname, GLint param);
+void GLAPIENTRY gl_dispatch_stub_854(GLenum target, GLintptr offset, GLsizeiptr size);
+void GLAPIENTRY gl_dispatch_stub_912(GLenum target, GLenum pname, GLvoid ** params);
+void GLAPIENTRY gl_dispatch_stub_913(GLenum target, GLsizei length, GLvoid * pointer);
+void GLAPIENTRY gl_dispatch_stub_921(GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask);
+void GLAPIENTRY gl_dispatch_stub_922(GLenum target, GLuint index, GLsizei count, const GLfloat * params);
+void GLAPIENTRY gl_dispatch_stub_923(GLenum target, GLuint index, GLsizei count, const GLfloat * params);
+void GLAPIENTRY gl_dispatch_stub_924(GLuint id, GLenum pname, GLint64EXT * params);
+void GLAPIENTRY gl_dispatch_stub_925(GLuint id, GLenum pname, GLuint64EXT * params);
+#endif /* defined(NEED_FUNCTION_POINTER) || defined(GLX_INDIRECT_RENDERING) */
+
+static const glprocs_table_t static_functions[] = {
+ NAME_FUNC_OFFSET( 0, glNewList, glNewList, NULL, 0),
+ NAME_FUNC_OFFSET( 10, glEndList, glEndList, NULL, 1),
+ NAME_FUNC_OFFSET( 20, glCallList, glCallList, NULL, 2),
+ NAME_FUNC_OFFSET( 31, glCallLists, glCallLists, NULL, 3),
+ NAME_FUNC_OFFSET( 43, glDeleteLists, glDeleteLists, NULL, 4),
+ NAME_FUNC_OFFSET( 57, glGenLists, glGenLists, NULL, 5),
+ NAME_FUNC_OFFSET( 68, glListBase, glListBase, NULL, 6),
+ NAME_FUNC_OFFSET( 79, glBegin, glBegin, NULL, 7),
+ NAME_FUNC_OFFSET( 87, glBitmap, glBitmap, NULL, 8),
+ NAME_FUNC_OFFSET( 96, glColor3b, glColor3b, NULL, 9),
+ NAME_FUNC_OFFSET( 106, glColor3bv, glColor3bv, NULL, 10),
+ NAME_FUNC_OFFSET( 117, glColor3d, glColor3d, NULL, 11),
+ NAME_FUNC_OFFSET( 127, glColor3dv, glColor3dv, NULL, 12),
+ NAME_FUNC_OFFSET( 138, glColor3f, glColor3f, NULL, 13),
+ NAME_FUNC_OFFSET( 148, glColor3fv, glColor3fv, NULL, 14),
+ NAME_FUNC_OFFSET( 159, glColor3i, glColor3i, NULL, 15),
+ NAME_FUNC_OFFSET( 169, glColor3iv, glColor3iv, NULL, 16),
+ NAME_FUNC_OFFSET( 180, glColor3s, glColor3s, NULL, 17),
+ NAME_FUNC_OFFSET( 190, glColor3sv, glColor3sv, NULL, 18),
+ NAME_FUNC_OFFSET( 201, glColor3ub, glColor3ub, NULL, 19),
+ NAME_FUNC_OFFSET( 212, glColor3ubv, glColor3ubv, NULL, 20),
+ NAME_FUNC_OFFSET( 224, glColor3ui, glColor3ui, NULL, 21),
+ NAME_FUNC_OFFSET( 235, glColor3uiv, glColor3uiv, NULL, 22),
+ NAME_FUNC_OFFSET( 247, glColor3us, glColor3us, NULL, 23),
+ NAME_FUNC_OFFSET( 258, glColor3usv, glColor3usv, NULL, 24),
+ NAME_FUNC_OFFSET( 270, glColor4b, glColor4b, NULL, 25),
+ NAME_FUNC_OFFSET( 280, glColor4bv, glColor4bv, NULL, 26),
+ NAME_FUNC_OFFSET( 291, glColor4d, glColor4d, NULL, 27),
+ NAME_FUNC_OFFSET( 301, glColor4dv, glColor4dv, NULL, 28),
+ NAME_FUNC_OFFSET( 312, glColor4f, glColor4f, NULL, 29),
+ NAME_FUNC_OFFSET( 322, glColor4fv, glColor4fv, NULL, 30),
+ NAME_FUNC_OFFSET( 333, glColor4i, glColor4i, NULL, 31),
+ NAME_FUNC_OFFSET( 343, glColor4iv, glColor4iv, NULL, 32),
+ NAME_FUNC_OFFSET( 354, glColor4s, glColor4s, NULL, 33),
+ NAME_FUNC_OFFSET( 364, glColor4sv, glColor4sv, NULL, 34),
+ NAME_FUNC_OFFSET( 375, glColor4ub, glColor4ub, NULL, 35),
+ NAME_FUNC_OFFSET( 386, glColor4ubv, glColor4ubv, NULL, 36),
+ NAME_FUNC_OFFSET( 398, glColor4ui, glColor4ui, NULL, 37),
+ NAME_FUNC_OFFSET( 409, glColor4uiv, glColor4uiv, NULL, 38),
+ NAME_FUNC_OFFSET( 421, glColor4us, glColor4us, NULL, 39),
+ NAME_FUNC_OFFSET( 432, glColor4usv, glColor4usv, NULL, 40),
+ NAME_FUNC_OFFSET( 444, glEdgeFlag, glEdgeFlag, NULL, 41),
+ NAME_FUNC_OFFSET( 455, glEdgeFlagv, glEdgeFlagv, NULL, 42),
+ NAME_FUNC_OFFSET( 467, glEnd, glEnd, NULL, 43),
+ NAME_FUNC_OFFSET( 473, glIndexd, glIndexd, NULL, 44),
+ NAME_FUNC_OFFSET( 482, glIndexdv, glIndexdv, NULL, 45),
+ NAME_FUNC_OFFSET( 492, glIndexf, glIndexf, NULL, 46),
+ NAME_FUNC_OFFSET( 501, glIndexfv, glIndexfv, NULL, 47),
+ NAME_FUNC_OFFSET( 511, glIndexi, glIndexi, NULL, 48),
+ NAME_FUNC_OFFSET( 520, glIndexiv, glIndexiv, NULL, 49),
+ NAME_FUNC_OFFSET( 530, glIndexs, glIndexs, NULL, 50),
+ NAME_FUNC_OFFSET( 539, glIndexsv, glIndexsv, NULL, 51),
+ NAME_FUNC_OFFSET( 549, glNormal3b, glNormal3b, NULL, 52),
+ NAME_FUNC_OFFSET( 560, glNormal3bv, glNormal3bv, NULL, 53),
+ NAME_FUNC_OFFSET( 572, glNormal3d, glNormal3d, NULL, 54),
+ NAME_FUNC_OFFSET( 583, glNormal3dv, glNormal3dv, NULL, 55),
+ NAME_FUNC_OFFSET( 595, glNormal3f, glNormal3f, NULL, 56),
+ NAME_FUNC_OFFSET( 606, glNormal3fv, glNormal3fv, NULL, 57),
+ NAME_FUNC_OFFSET( 618, glNormal3i, glNormal3i, NULL, 58),
+ NAME_FUNC_OFFSET( 629, glNormal3iv, glNormal3iv, NULL, 59),
+ NAME_FUNC_OFFSET( 641, glNormal3s, glNormal3s, NULL, 60),
+ NAME_FUNC_OFFSET( 652, glNormal3sv, glNormal3sv, NULL, 61),
+ NAME_FUNC_OFFSET( 664, glRasterPos2d, glRasterPos2d, NULL, 62),
+ NAME_FUNC_OFFSET( 678, glRasterPos2dv, glRasterPos2dv, NULL, 63),
+ NAME_FUNC_OFFSET( 693, glRasterPos2f, glRasterPos2f, NULL, 64),
+ NAME_FUNC_OFFSET( 707, glRasterPos2fv, glRasterPos2fv, NULL, 65),
+ NAME_FUNC_OFFSET( 722, glRasterPos2i, glRasterPos2i, NULL, 66),
+ NAME_FUNC_OFFSET( 736, glRasterPos2iv, glRasterPos2iv, NULL, 67),
+ NAME_FUNC_OFFSET( 751, glRasterPos2s, glRasterPos2s, NULL, 68),
+ NAME_FUNC_OFFSET( 765, glRasterPos2sv, glRasterPos2sv, NULL, 69),
+ NAME_FUNC_OFFSET( 780, glRasterPos3d, glRasterPos3d, NULL, 70),
+ NAME_FUNC_OFFSET( 794, glRasterPos3dv, glRasterPos3dv, NULL, 71),
+ NAME_FUNC_OFFSET( 809, glRasterPos3f, glRasterPos3f, NULL, 72),
+ NAME_FUNC_OFFSET( 823, glRasterPos3fv, glRasterPos3fv, NULL, 73),
+ NAME_FUNC_OFFSET( 838, glRasterPos3i, glRasterPos3i, NULL, 74),
+ NAME_FUNC_OFFSET( 852, glRasterPos3iv, glRasterPos3iv, NULL, 75),
+ NAME_FUNC_OFFSET( 867, glRasterPos3s, glRasterPos3s, NULL, 76),
+ NAME_FUNC_OFFSET( 881, glRasterPos3sv, glRasterPos3sv, NULL, 77),
+ NAME_FUNC_OFFSET( 896, glRasterPos4d, glRasterPos4d, NULL, 78),
+ NAME_FUNC_OFFSET( 910, glRasterPos4dv, glRasterPos4dv, NULL, 79),
+ NAME_FUNC_OFFSET( 925, glRasterPos4f, glRasterPos4f, NULL, 80),
+ NAME_FUNC_OFFSET( 939, glRasterPos4fv, glRasterPos4fv, NULL, 81),
+ NAME_FUNC_OFFSET( 954, glRasterPos4i, glRasterPos4i, NULL, 82),
+ NAME_FUNC_OFFSET( 968, glRasterPos4iv, glRasterPos4iv, NULL, 83),
+ NAME_FUNC_OFFSET( 983, glRasterPos4s, glRasterPos4s, NULL, 84),
+ NAME_FUNC_OFFSET( 997, glRasterPos4sv, glRasterPos4sv, NULL, 85),
+ NAME_FUNC_OFFSET( 1012, glRectd, glRectd, NULL, 86),
+ NAME_FUNC_OFFSET( 1020, glRectdv, glRectdv, NULL, 87),
+ NAME_FUNC_OFFSET( 1029, glRectf, glRectf, NULL, 88),
+ NAME_FUNC_OFFSET( 1037, glRectfv, glRectfv, NULL, 89),
+ NAME_FUNC_OFFSET( 1046, glRecti, glRecti, NULL, 90),
+ NAME_FUNC_OFFSET( 1054, glRectiv, glRectiv, NULL, 91),
+ NAME_FUNC_OFFSET( 1063, glRects, glRects, NULL, 92),
+ NAME_FUNC_OFFSET( 1071, glRectsv, glRectsv, NULL, 93),
+ NAME_FUNC_OFFSET( 1080, glTexCoord1d, glTexCoord1d, NULL, 94),
+ NAME_FUNC_OFFSET( 1093, glTexCoord1dv, glTexCoord1dv, NULL, 95),
+ NAME_FUNC_OFFSET( 1107, glTexCoord1f, glTexCoord1f, NULL, 96),
+ NAME_FUNC_OFFSET( 1120, glTexCoord1fv, glTexCoord1fv, NULL, 97),
+ NAME_FUNC_OFFSET( 1134, glTexCoord1i, glTexCoord1i, NULL, 98),
+ NAME_FUNC_OFFSET( 1147, glTexCoord1iv, glTexCoord1iv, NULL, 99),
+ NAME_FUNC_OFFSET( 1161, glTexCoord1s, glTexCoord1s, NULL, 100),
+ NAME_FUNC_OFFSET( 1174, glTexCoord1sv, glTexCoord1sv, NULL, 101),
+ NAME_FUNC_OFFSET( 1188, glTexCoord2d, glTexCoord2d, NULL, 102),
+ NAME_FUNC_OFFSET( 1201, glTexCoord2dv, glTexCoord2dv, NULL, 103),
+ NAME_FUNC_OFFSET( 1215, glTexCoord2f, glTexCoord2f, NULL, 104),
+ NAME_FUNC_OFFSET( 1228, glTexCoord2fv, glTexCoord2fv, NULL, 105),
+ NAME_FUNC_OFFSET( 1242, glTexCoord2i, glTexCoord2i, NULL, 106),
+ NAME_FUNC_OFFSET( 1255, glTexCoord2iv, glTexCoord2iv, NULL, 107),
+ NAME_FUNC_OFFSET( 1269, glTexCoord2s, glTexCoord2s, NULL, 108),
+ NAME_FUNC_OFFSET( 1282, glTexCoord2sv, glTexCoord2sv, NULL, 109),
+ NAME_FUNC_OFFSET( 1296, glTexCoord3d, glTexCoord3d, NULL, 110),
+ NAME_FUNC_OFFSET( 1309, glTexCoord3dv, glTexCoord3dv, NULL, 111),
+ NAME_FUNC_OFFSET( 1323, glTexCoord3f, glTexCoord3f, NULL, 112),
+ NAME_FUNC_OFFSET( 1336, glTexCoord3fv, glTexCoord3fv, NULL, 113),
+ NAME_FUNC_OFFSET( 1350, glTexCoord3i, glTexCoord3i, NULL, 114),
+ NAME_FUNC_OFFSET( 1363, glTexCoord3iv, glTexCoord3iv, NULL, 115),
+ NAME_FUNC_OFFSET( 1377, glTexCoord3s, glTexCoord3s, NULL, 116),
+ NAME_FUNC_OFFSET( 1390, glTexCoord3sv, glTexCoord3sv, NULL, 117),
+ NAME_FUNC_OFFSET( 1404, glTexCoord4d, glTexCoord4d, NULL, 118),
+ NAME_FUNC_OFFSET( 1417, glTexCoord4dv, glTexCoord4dv, NULL, 119),
+ NAME_FUNC_OFFSET( 1431, glTexCoord4f, glTexCoord4f, NULL, 120),
+ NAME_FUNC_OFFSET( 1444, glTexCoord4fv, glTexCoord4fv, NULL, 121),
+ NAME_FUNC_OFFSET( 1458, glTexCoord4i, glTexCoord4i, NULL, 122),
+ NAME_FUNC_OFFSET( 1471, glTexCoord4iv, glTexCoord4iv, NULL, 123),
+ NAME_FUNC_OFFSET( 1485, glTexCoord4s, glTexCoord4s, NULL, 124),
+ NAME_FUNC_OFFSET( 1498, glTexCoord4sv, glTexCoord4sv, NULL, 125),
+ NAME_FUNC_OFFSET( 1512, glVertex2d, glVertex2d, NULL, 126),
+ NAME_FUNC_OFFSET( 1523, glVertex2dv, glVertex2dv, NULL, 127),
+ NAME_FUNC_OFFSET( 1535, glVertex2f, glVertex2f, NULL, 128),
+ NAME_FUNC_OFFSET( 1546, glVertex2fv, glVertex2fv, NULL, 129),
+ NAME_FUNC_OFFSET( 1558, glVertex2i, glVertex2i, NULL, 130),
+ NAME_FUNC_OFFSET( 1569, glVertex2iv, glVertex2iv, NULL, 131),
+ NAME_FUNC_OFFSET( 1581, glVertex2s, glVertex2s, NULL, 132),
+ NAME_FUNC_OFFSET( 1592, glVertex2sv, glVertex2sv, NULL, 133),
+ NAME_FUNC_OFFSET( 1604, glVertex3d, glVertex3d, NULL, 134),
+ NAME_FUNC_OFFSET( 1615, glVertex3dv, glVertex3dv, NULL, 135),
+ NAME_FUNC_OFFSET( 1627, glVertex3f, glVertex3f, NULL, 136),
+ NAME_FUNC_OFFSET( 1638, glVertex3fv, glVertex3fv, NULL, 137),
+ NAME_FUNC_OFFSET( 1650, glVertex3i, glVertex3i, NULL, 138),
+ NAME_FUNC_OFFSET( 1661, glVertex3iv, glVertex3iv, NULL, 139),
+ NAME_FUNC_OFFSET( 1673, glVertex3s, glVertex3s, NULL, 140),
+ NAME_FUNC_OFFSET( 1684, glVertex3sv, glVertex3sv, NULL, 141),
+ NAME_FUNC_OFFSET( 1696, glVertex4d, glVertex4d, NULL, 142),
+ NAME_FUNC_OFFSET( 1707, glVertex4dv, glVertex4dv, NULL, 143),
+ NAME_FUNC_OFFSET( 1719, glVertex4f, glVertex4f, NULL, 144),
+ NAME_FUNC_OFFSET( 1730, glVertex4fv, glVertex4fv, NULL, 145),
+ NAME_FUNC_OFFSET( 1742, glVertex4i, glVertex4i, NULL, 146),
+ NAME_FUNC_OFFSET( 1753, glVertex4iv, glVertex4iv, NULL, 147),
+ NAME_FUNC_OFFSET( 1765, glVertex4s, glVertex4s, NULL, 148),
+ NAME_FUNC_OFFSET( 1776, glVertex4sv, glVertex4sv, NULL, 149),
+ NAME_FUNC_OFFSET( 1788, glClipPlane, glClipPlane, NULL, 150),
+ NAME_FUNC_OFFSET( 1800, glColorMaterial, glColorMaterial, NULL, 151),
+ NAME_FUNC_OFFSET( 1816, glCullFace, glCullFace, NULL, 152),
+ NAME_FUNC_OFFSET( 1827, glFogf, glFogf, NULL, 153),
+ NAME_FUNC_OFFSET( 1834, glFogfv, glFogfv, NULL, 154),
+ NAME_FUNC_OFFSET( 1842, glFogi, glFogi, NULL, 155),
+ NAME_FUNC_OFFSET( 1849, glFogiv, glFogiv, NULL, 156),
+ NAME_FUNC_OFFSET( 1857, glFrontFace, glFrontFace, NULL, 157),
+ NAME_FUNC_OFFSET( 1869, glHint, glHint, NULL, 158),
+ NAME_FUNC_OFFSET( 1876, glLightf, glLightf, NULL, 159),
+ NAME_FUNC_OFFSET( 1885, glLightfv, glLightfv, NULL, 160),
+ NAME_FUNC_OFFSET( 1895, glLighti, glLighti, NULL, 161),
+ NAME_FUNC_OFFSET( 1904, glLightiv, glLightiv, NULL, 162),
+ NAME_FUNC_OFFSET( 1914, glLightModelf, glLightModelf, NULL, 163),
+ NAME_FUNC_OFFSET( 1928, glLightModelfv, glLightModelfv, NULL, 164),
+ NAME_FUNC_OFFSET( 1943, glLightModeli, glLightModeli, NULL, 165),
+ NAME_FUNC_OFFSET( 1957, glLightModeliv, glLightModeliv, NULL, 166),
+ NAME_FUNC_OFFSET( 1972, glLineStipple, glLineStipple, NULL, 167),
+ NAME_FUNC_OFFSET( 1986, glLineWidth, glLineWidth, NULL, 168),
+ NAME_FUNC_OFFSET( 1998, glMaterialf, glMaterialf, NULL, 169),
+ NAME_FUNC_OFFSET( 2010, glMaterialfv, glMaterialfv, NULL, 170),
+ NAME_FUNC_OFFSET( 2023, glMateriali, glMateriali, NULL, 171),
+ NAME_FUNC_OFFSET( 2035, glMaterialiv, glMaterialiv, NULL, 172),
+ NAME_FUNC_OFFSET( 2048, glPointSize, glPointSize, NULL, 173),
+ NAME_FUNC_OFFSET( 2060, glPolygonMode, glPolygonMode, NULL, 174),
+ NAME_FUNC_OFFSET( 2074, glPolygonStipple, glPolygonStipple, NULL, 175),
+ NAME_FUNC_OFFSET( 2091, glScissor, glScissor, NULL, 176),
+ NAME_FUNC_OFFSET( 2101, glShadeModel, glShadeModel, NULL, 177),
+ NAME_FUNC_OFFSET( 2114, glTexParameterf, glTexParameterf, NULL, 178),
+ NAME_FUNC_OFFSET( 2130, glTexParameterfv, glTexParameterfv, NULL, 179),
+ NAME_FUNC_OFFSET( 2147, glTexParameteri, glTexParameteri, NULL, 180),
+ NAME_FUNC_OFFSET( 2163, glTexParameteriv, glTexParameteriv, NULL, 181),
+ NAME_FUNC_OFFSET( 2180, glTexImage1D, glTexImage1D, NULL, 182),
+ NAME_FUNC_OFFSET( 2193, glTexImage2D, glTexImage2D, NULL, 183),
+ NAME_FUNC_OFFSET( 2206, glTexEnvf, glTexEnvf, NULL, 184),
+ NAME_FUNC_OFFSET( 2216, glTexEnvfv, glTexEnvfv, NULL, 185),
+ NAME_FUNC_OFFSET( 2227, glTexEnvi, glTexEnvi, NULL, 186),
+ NAME_FUNC_OFFSET( 2237, glTexEnviv, glTexEnviv, NULL, 187),
+ NAME_FUNC_OFFSET( 2248, glTexGend, glTexGend, NULL, 188),
+ NAME_FUNC_OFFSET( 2258, glTexGendv, glTexGendv, NULL, 189),
+ NAME_FUNC_OFFSET( 2269, glTexGenf, glTexGenf, NULL, 190),
+ NAME_FUNC_OFFSET( 2279, glTexGenfv, glTexGenfv, NULL, 191),
+ NAME_FUNC_OFFSET( 2290, glTexGeni, glTexGeni, NULL, 192),
+ NAME_FUNC_OFFSET( 2300, glTexGeniv, glTexGeniv, NULL, 193),
+ NAME_FUNC_OFFSET( 2311, glFeedbackBuffer, glFeedbackBuffer, NULL, 194),
+ NAME_FUNC_OFFSET( 2328, glSelectBuffer, glSelectBuffer, NULL, 195),
+ NAME_FUNC_OFFSET( 2343, glRenderMode, glRenderMode, NULL, 196),
+ NAME_FUNC_OFFSET( 2356, glInitNames, glInitNames, NULL, 197),
+ NAME_FUNC_OFFSET( 2368, glLoadName, glLoadName, NULL, 198),
+ NAME_FUNC_OFFSET( 2379, glPassThrough, glPassThrough, NULL, 199),
+ NAME_FUNC_OFFSET( 2393, glPopName, glPopName, NULL, 200),
+ NAME_FUNC_OFFSET( 2403, glPushName, glPushName, NULL, 201),
+ NAME_FUNC_OFFSET( 2414, glDrawBuffer, glDrawBuffer, NULL, 202),
+ NAME_FUNC_OFFSET( 2427, glClear, glClear, NULL, 203),
+ NAME_FUNC_OFFSET( 2435, glClearAccum, glClearAccum, NULL, 204),
+ NAME_FUNC_OFFSET( 2448, glClearIndex, glClearIndex, NULL, 205),
+ NAME_FUNC_OFFSET( 2461, glClearColor, glClearColor, NULL, 206),
+ NAME_FUNC_OFFSET( 2474, glClearStencil, glClearStencil, NULL, 207),
+ NAME_FUNC_OFFSET( 2489, glClearDepth, glClearDepth, NULL, 208),
+ NAME_FUNC_OFFSET( 2502, glStencilMask, glStencilMask, NULL, 209),
+ NAME_FUNC_OFFSET( 2516, glColorMask, glColorMask, NULL, 210),
+ NAME_FUNC_OFFSET( 2528, glDepthMask, glDepthMask, NULL, 211),
+ NAME_FUNC_OFFSET( 2540, glIndexMask, glIndexMask, NULL, 212),
+ NAME_FUNC_OFFSET( 2552, glAccum, glAccum, NULL, 213),
+ NAME_FUNC_OFFSET( 2560, glDisable, glDisable, NULL, 214),
+ NAME_FUNC_OFFSET( 2570, glEnable, glEnable, NULL, 215),
+ NAME_FUNC_OFFSET( 2579, glFinish, glFinish, NULL, 216),
+ NAME_FUNC_OFFSET( 2588, glFlush, glFlush, NULL, 217),
+ NAME_FUNC_OFFSET( 2596, glPopAttrib, glPopAttrib, NULL, 218),
+ NAME_FUNC_OFFSET( 2608, glPushAttrib, glPushAttrib, NULL, 219),
+ NAME_FUNC_OFFSET( 2621, glMap1d, glMap1d, NULL, 220),
+ NAME_FUNC_OFFSET( 2629, glMap1f, glMap1f, NULL, 221),
+ NAME_FUNC_OFFSET( 2637, glMap2d, glMap2d, NULL, 222),
+ NAME_FUNC_OFFSET( 2645, glMap2f, glMap2f, NULL, 223),
+ NAME_FUNC_OFFSET( 2653, glMapGrid1d, glMapGrid1d, NULL, 224),
+ NAME_FUNC_OFFSET( 2665, glMapGrid1f, glMapGrid1f, NULL, 225),
+ NAME_FUNC_OFFSET( 2677, glMapGrid2d, glMapGrid2d, NULL, 226),
+ NAME_FUNC_OFFSET( 2689, glMapGrid2f, glMapGrid2f, NULL, 227),
+ NAME_FUNC_OFFSET( 2701, glEvalCoord1d, glEvalCoord1d, NULL, 228),
+ NAME_FUNC_OFFSET( 2715, glEvalCoord1dv, glEvalCoord1dv, NULL, 229),
+ NAME_FUNC_OFFSET( 2730, glEvalCoord1f, glEvalCoord1f, NULL, 230),
+ NAME_FUNC_OFFSET( 2744, glEvalCoord1fv, glEvalCoord1fv, NULL, 231),
+ NAME_FUNC_OFFSET( 2759, glEvalCoord2d, glEvalCoord2d, NULL, 232),
+ NAME_FUNC_OFFSET( 2773, glEvalCoord2dv, glEvalCoord2dv, NULL, 233),
+ NAME_FUNC_OFFSET( 2788, glEvalCoord2f, glEvalCoord2f, NULL, 234),
+ NAME_FUNC_OFFSET( 2802, glEvalCoord2fv, glEvalCoord2fv, NULL, 235),
+ NAME_FUNC_OFFSET( 2817, glEvalMesh1, glEvalMesh1, NULL, 236),
+ NAME_FUNC_OFFSET( 2829, glEvalPoint1, glEvalPoint1, NULL, 237),
+ NAME_FUNC_OFFSET( 2842, glEvalMesh2, glEvalMesh2, NULL, 238),
+ NAME_FUNC_OFFSET( 2854, glEvalPoint2, glEvalPoint2, NULL, 239),
+ NAME_FUNC_OFFSET( 2867, glAlphaFunc, glAlphaFunc, NULL, 240),
+ NAME_FUNC_OFFSET( 2879, glBlendFunc, glBlendFunc, NULL, 241),
+ NAME_FUNC_OFFSET( 2891, glLogicOp, glLogicOp, NULL, 242),
+ NAME_FUNC_OFFSET( 2901, glStencilFunc, glStencilFunc, NULL, 243),
+ NAME_FUNC_OFFSET( 2915, glStencilOp, glStencilOp, NULL, 244),
+ NAME_FUNC_OFFSET( 2927, glDepthFunc, glDepthFunc, NULL, 245),
+ NAME_FUNC_OFFSET( 2939, glPixelZoom, glPixelZoom, NULL, 246),
+ NAME_FUNC_OFFSET( 2951, glPixelTransferf, glPixelTransferf, NULL, 247),
+ NAME_FUNC_OFFSET( 2968, glPixelTransferi, glPixelTransferi, NULL, 248),
+ NAME_FUNC_OFFSET( 2985, glPixelStoref, glPixelStoref, NULL, 249),
+ NAME_FUNC_OFFSET( 2999, glPixelStorei, glPixelStorei, NULL, 250),
+ NAME_FUNC_OFFSET( 3013, glPixelMapfv, glPixelMapfv, NULL, 251),
+ NAME_FUNC_OFFSET( 3026, glPixelMapuiv, glPixelMapuiv, NULL, 252),
+ NAME_FUNC_OFFSET( 3040, glPixelMapusv, glPixelMapusv, NULL, 253),
+ NAME_FUNC_OFFSET( 3054, glReadBuffer, glReadBuffer, NULL, 254),
+ NAME_FUNC_OFFSET( 3067, glCopyPixels, glCopyPixels, NULL, 255),
+ NAME_FUNC_OFFSET( 3080, glReadPixels, glReadPixels, NULL, 256),
+ NAME_FUNC_OFFSET( 3093, glDrawPixels, glDrawPixels, NULL, 257),
+ NAME_FUNC_OFFSET( 3106, glGetBooleanv, glGetBooleanv, NULL, 258),
+ NAME_FUNC_OFFSET( 3120, glGetClipPlane, glGetClipPlane, NULL, 259),
+ NAME_FUNC_OFFSET( 3135, glGetDoublev, glGetDoublev, NULL, 260),
+ NAME_FUNC_OFFSET( 3148, glGetError, glGetError, NULL, 261),
+ NAME_FUNC_OFFSET( 3159, glGetFloatv, glGetFloatv, NULL, 262),
+ NAME_FUNC_OFFSET( 3171, glGetIntegerv, glGetIntegerv, NULL, 263),
+ NAME_FUNC_OFFSET( 3185, glGetLightfv, glGetLightfv, NULL, 264),
+ NAME_FUNC_OFFSET( 3198, glGetLightiv, glGetLightiv, NULL, 265),
+ NAME_FUNC_OFFSET( 3211, glGetMapdv, glGetMapdv, NULL, 266),
+ NAME_FUNC_OFFSET( 3222, glGetMapfv, glGetMapfv, NULL, 267),
+ NAME_FUNC_OFFSET( 3233, glGetMapiv, glGetMapiv, NULL, 268),
+ NAME_FUNC_OFFSET( 3244, glGetMaterialfv, glGetMaterialfv, NULL, 269),
+ NAME_FUNC_OFFSET( 3260, glGetMaterialiv, glGetMaterialiv, NULL, 270),
+ NAME_FUNC_OFFSET( 3276, glGetPixelMapfv, glGetPixelMapfv, NULL, 271),
+ NAME_FUNC_OFFSET( 3292, glGetPixelMapuiv, glGetPixelMapuiv, NULL, 272),
+ NAME_FUNC_OFFSET( 3309, glGetPixelMapusv, glGetPixelMapusv, NULL, 273),
+ NAME_FUNC_OFFSET( 3326, glGetPolygonStipple, glGetPolygonStipple, NULL, 274),
+ NAME_FUNC_OFFSET( 3346, glGetString, glGetString, NULL, 275),
+ NAME_FUNC_OFFSET( 3358, glGetTexEnvfv, glGetTexEnvfv, NULL, 276),
+ NAME_FUNC_OFFSET( 3372, glGetTexEnviv, glGetTexEnviv, NULL, 277),
+ NAME_FUNC_OFFSET( 3386, glGetTexGendv, glGetTexGendv, NULL, 278),
+ NAME_FUNC_OFFSET( 3400, glGetTexGenfv, glGetTexGenfv, NULL, 279),
+ NAME_FUNC_OFFSET( 3414, glGetTexGeniv, glGetTexGeniv, NULL, 280),
+ NAME_FUNC_OFFSET( 3428, glGetTexImage, glGetTexImage, NULL, 281),
+ NAME_FUNC_OFFSET( 3442, glGetTexParameterfv, glGetTexParameterfv, NULL, 282),
+ NAME_FUNC_OFFSET( 3462, glGetTexParameteriv, glGetTexParameteriv, NULL, 283),
+ NAME_FUNC_OFFSET( 3482, glGetTexLevelParameterfv, glGetTexLevelParameterfv, NULL, 284),
+ NAME_FUNC_OFFSET( 3507, glGetTexLevelParameteriv, glGetTexLevelParameteriv, NULL, 285),
+ NAME_FUNC_OFFSET( 3532, glIsEnabled, glIsEnabled, NULL, 286),
+ NAME_FUNC_OFFSET( 3544, glIsList, glIsList, NULL, 287),
+ NAME_FUNC_OFFSET( 3553, glDepthRange, glDepthRange, NULL, 288),
+ NAME_FUNC_OFFSET( 3566, glFrustum, glFrustum, NULL, 289),
+ NAME_FUNC_OFFSET( 3576, glLoadIdentity, glLoadIdentity, NULL, 290),
+ NAME_FUNC_OFFSET( 3591, glLoadMatrixf, glLoadMatrixf, NULL, 291),
+ NAME_FUNC_OFFSET( 3605, glLoadMatrixd, glLoadMatrixd, NULL, 292),
+ NAME_FUNC_OFFSET( 3619, glMatrixMode, glMatrixMode, NULL, 293),
+ NAME_FUNC_OFFSET( 3632, glMultMatrixf, glMultMatrixf, NULL, 294),
+ NAME_FUNC_OFFSET( 3646, glMultMatrixd, glMultMatrixd, NULL, 295),
+ NAME_FUNC_OFFSET( 3660, glOrtho, glOrtho, NULL, 296),
+ NAME_FUNC_OFFSET( 3668, glPopMatrix, glPopMatrix, NULL, 297),
+ NAME_FUNC_OFFSET( 3680, glPushMatrix, glPushMatrix, NULL, 298),
+ NAME_FUNC_OFFSET( 3693, glRotated, glRotated, NULL, 299),
+ NAME_FUNC_OFFSET( 3703, glRotatef, glRotatef, NULL, 300),
+ NAME_FUNC_OFFSET( 3713, glScaled, glScaled, NULL, 301),
+ NAME_FUNC_OFFSET( 3722, glScalef, glScalef, NULL, 302),
+ NAME_FUNC_OFFSET( 3731, glTranslated, glTranslated, NULL, 303),
+ NAME_FUNC_OFFSET( 3744, glTranslatef, glTranslatef, NULL, 304),
+ NAME_FUNC_OFFSET( 3757, glViewport, glViewport, NULL, 305),
+ NAME_FUNC_OFFSET( 3768, glArrayElement, glArrayElement, NULL, 306),
+ NAME_FUNC_OFFSET( 3783, glBindTexture, glBindTexture, NULL, 307),
+ NAME_FUNC_OFFSET( 3797, glColorPointer, glColorPointer, NULL, 308),
+ NAME_FUNC_OFFSET( 3812, glDisableClientState, glDisableClientState, NULL, 309),
+ NAME_FUNC_OFFSET( 3833, glDrawArrays, glDrawArrays, NULL, 310),
+ NAME_FUNC_OFFSET( 3846, glDrawElements, glDrawElements, NULL, 311),
+ NAME_FUNC_OFFSET( 3861, glEdgeFlagPointer, glEdgeFlagPointer, NULL, 312),
+ NAME_FUNC_OFFSET( 3879, glEnableClientState, glEnableClientState, NULL, 313),
+ NAME_FUNC_OFFSET( 3899, glIndexPointer, glIndexPointer, NULL, 314),
+ NAME_FUNC_OFFSET( 3914, glIndexub, glIndexub, NULL, 315),
+ NAME_FUNC_OFFSET( 3924, glIndexubv, glIndexubv, NULL, 316),
+ NAME_FUNC_OFFSET( 3935, glInterleavedArrays, glInterleavedArrays, NULL, 317),
+ NAME_FUNC_OFFSET( 3955, glNormalPointer, glNormalPointer, NULL, 318),
+ NAME_FUNC_OFFSET( 3971, glPolygonOffset, glPolygonOffset, NULL, 319),
+ NAME_FUNC_OFFSET( 3987, glTexCoordPointer, glTexCoordPointer, NULL, 320),
+ NAME_FUNC_OFFSET( 4005, glVertexPointer, glVertexPointer, NULL, 321),
+ NAME_FUNC_OFFSET( 4021, glAreTexturesResident, glAreTexturesResident, NULL, 322),
+ NAME_FUNC_OFFSET( 4043, glCopyTexImage1D, glCopyTexImage1D, NULL, 323),
+ NAME_FUNC_OFFSET( 4060, glCopyTexImage2D, glCopyTexImage2D, NULL, 324),
+ NAME_FUNC_OFFSET( 4077, glCopyTexSubImage1D, glCopyTexSubImage1D, NULL, 325),
+ NAME_FUNC_OFFSET( 4097, glCopyTexSubImage2D, glCopyTexSubImage2D, NULL, 326),
+ NAME_FUNC_OFFSET( 4117, glDeleteTextures, glDeleteTextures, NULL, 327),
+ NAME_FUNC_OFFSET( 4134, glGenTextures, glGenTextures, NULL, 328),
+ NAME_FUNC_OFFSET( 4148, glGetPointerv, glGetPointerv, NULL, 329),
+ NAME_FUNC_OFFSET( 4162, glIsTexture, glIsTexture, NULL, 330),
+ NAME_FUNC_OFFSET( 4174, glPrioritizeTextures, glPrioritizeTextures, NULL, 331),
+ NAME_FUNC_OFFSET( 4195, glTexSubImage1D, glTexSubImage1D, NULL, 332),
+ NAME_FUNC_OFFSET( 4211, glTexSubImage2D, glTexSubImage2D, NULL, 333),
+ NAME_FUNC_OFFSET( 4227, glPopClientAttrib, glPopClientAttrib, NULL, 334),
+ NAME_FUNC_OFFSET( 4245, glPushClientAttrib, glPushClientAttrib, NULL, 335),
+ NAME_FUNC_OFFSET( 4264, glBlendColor, glBlendColor, NULL, 336),
+ NAME_FUNC_OFFSET( 4277, glBlendEquation, glBlendEquation, NULL, 337),
+ NAME_FUNC_OFFSET( 4293, glDrawRangeElements, glDrawRangeElements, NULL, 338),
+ NAME_FUNC_OFFSET( 4313, glColorTable, glColorTable, NULL, 339),
+ NAME_FUNC_OFFSET( 4326, glColorTableParameterfv, glColorTableParameterfv, NULL, 340),
+ NAME_FUNC_OFFSET( 4350, glColorTableParameteriv, glColorTableParameteriv, NULL, 341),
+ NAME_FUNC_OFFSET( 4374, glCopyColorTable, glCopyColorTable, NULL, 342),
+ NAME_FUNC_OFFSET( 4391, glGetColorTable, glGetColorTable, NULL, 343),
+ NAME_FUNC_OFFSET( 4407, glGetColorTableParameterfv, glGetColorTableParameterfv, NULL, 344),
+ NAME_FUNC_OFFSET( 4434, glGetColorTableParameteriv, glGetColorTableParameteriv, NULL, 345),
+ NAME_FUNC_OFFSET( 4461, glColorSubTable, glColorSubTable, NULL, 346),
+ NAME_FUNC_OFFSET( 4477, glCopyColorSubTable, glCopyColorSubTable, NULL, 347),
+ NAME_FUNC_OFFSET( 4497, glConvolutionFilter1D, glConvolutionFilter1D, NULL, 348),
+ NAME_FUNC_OFFSET( 4519, glConvolutionFilter2D, glConvolutionFilter2D, NULL, 349),
+ NAME_FUNC_OFFSET( 4541, glConvolutionParameterf, glConvolutionParameterf, NULL, 350),
+ NAME_FUNC_OFFSET( 4565, glConvolutionParameterfv, glConvolutionParameterfv, NULL, 351),
+ NAME_FUNC_OFFSET( 4590, glConvolutionParameteri, glConvolutionParameteri, NULL, 352),
+ NAME_FUNC_OFFSET( 4614, glConvolutionParameteriv, glConvolutionParameteriv, NULL, 353),
+ NAME_FUNC_OFFSET( 4639, glCopyConvolutionFilter1D, glCopyConvolutionFilter1D, NULL, 354),
+ NAME_FUNC_OFFSET( 4665, glCopyConvolutionFilter2D, glCopyConvolutionFilter2D, NULL, 355),
+ NAME_FUNC_OFFSET( 4691, glGetConvolutionFilter, glGetConvolutionFilter, NULL, 356),
+ NAME_FUNC_OFFSET( 4714, glGetConvolutionParameterfv, glGetConvolutionParameterfv, NULL, 357),
+ NAME_FUNC_OFFSET( 4742, glGetConvolutionParameteriv, glGetConvolutionParameteriv, NULL, 358),
+ NAME_FUNC_OFFSET( 4770, glGetSeparableFilter, glGetSeparableFilter, NULL, 359),
+ NAME_FUNC_OFFSET( 4791, glSeparableFilter2D, glSeparableFilter2D, NULL, 360),
+ NAME_FUNC_OFFSET( 4811, glGetHistogram, glGetHistogram, NULL, 361),
+ NAME_FUNC_OFFSET( 4826, glGetHistogramParameterfv, glGetHistogramParameterfv, NULL, 362),
+ NAME_FUNC_OFFSET( 4852, glGetHistogramParameteriv, glGetHistogramParameteriv, NULL, 363),
+ NAME_FUNC_OFFSET( 4878, glGetMinmax, glGetMinmax, NULL, 364),
+ NAME_FUNC_OFFSET( 4890, glGetMinmaxParameterfv, glGetMinmaxParameterfv, NULL, 365),
+ NAME_FUNC_OFFSET( 4913, glGetMinmaxParameteriv, glGetMinmaxParameteriv, NULL, 366),
+ NAME_FUNC_OFFSET( 4936, glHistogram, glHistogram, NULL, 367),
+ NAME_FUNC_OFFSET( 4948, glMinmax, glMinmax, NULL, 368),
+ NAME_FUNC_OFFSET( 4957, glResetHistogram, glResetHistogram, NULL, 369),
+ NAME_FUNC_OFFSET( 4974, glResetMinmax, glResetMinmax, NULL, 370),
+ NAME_FUNC_OFFSET( 4988, glTexImage3D, glTexImage3D, NULL, 371),
+ NAME_FUNC_OFFSET( 5001, glTexSubImage3D, glTexSubImage3D, NULL, 372),
+ NAME_FUNC_OFFSET( 5017, glCopyTexSubImage3D, glCopyTexSubImage3D, NULL, 373),
+ NAME_FUNC_OFFSET( 5037, glActiveTextureARB, glActiveTextureARB, NULL, 374),
+ NAME_FUNC_OFFSET( 5056, glClientActiveTextureARB, glClientActiveTextureARB, NULL, 375),
+ NAME_FUNC_OFFSET( 5081, glMultiTexCoord1dARB, glMultiTexCoord1dARB, NULL, 376),
+ NAME_FUNC_OFFSET( 5102, glMultiTexCoord1dvARB, glMultiTexCoord1dvARB, NULL, 377),
+ NAME_FUNC_OFFSET( 5124, glMultiTexCoord1fARB, glMultiTexCoord1fARB, NULL, 378),
+ NAME_FUNC_OFFSET( 5145, glMultiTexCoord1fvARB, glMultiTexCoord1fvARB, NULL, 379),
+ NAME_FUNC_OFFSET( 5167, glMultiTexCoord1iARB, glMultiTexCoord1iARB, NULL, 380),
+ NAME_FUNC_OFFSET( 5188, glMultiTexCoord1ivARB, glMultiTexCoord1ivARB, NULL, 381),
+ NAME_FUNC_OFFSET( 5210, glMultiTexCoord1sARB, glMultiTexCoord1sARB, NULL, 382),
+ NAME_FUNC_OFFSET( 5231, glMultiTexCoord1svARB, glMultiTexCoord1svARB, NULL, 383),
+ NAME_FUNC_OFFSET( 5253, glMultiTexCoord2dARB, glMultiTexCoord2dARB, NULL, 384),
+ NAME_FUNC_OFFSET( 5274, glMultiTexCoord2dvARB, glMultiTexCoord2dvARB, NULL, 385),
+ NAME_FUNC_OFFSET( 5296, glMultiTexCoord2fARB, glMultiTexCoord2fARB, NULL, 386),
+ NAME_FUNC_OFFSET( 5317, glMultiTexCoord2fvARB, glMultiTexCoord2fvARB, NULL, 387),
+ NAME_FUNC_OFFSET( 5339, glMultiTexCoord2iARB, glMultiTexCoord2iARB, NULL, 388),
+ NAME_FUNC_OFFSET( 5360, glMultiTexCoord2ivARB, glMultiTexCoord2ivARB, NULL, 389),
+ NAME_FUNC_OFFSET( 5382, glMultiTexCoord2sARB, glMultiTexCoord2sARB, NULL, 390),
+ NAME_FUNC_OFFSET( 5403, glMultiTexCoord2svARB, glMultiTexCoord2svARB, NULL, 391),
+ NAME_FUNC_OFFSET( 5425, glMultiTexCoord3dARB, glMultiTexCoord3dARB, NULL, 392),
+ NAME_FUNC_OFFSET( 5446, glMultiTexCoord3dvARB, glMultiTexCoord3dvARB, NULL, 393),
+ NAME_FUNC_OFFSET( 5468, glMultiTexCoord3fARB, glMultiTexCoord3fARB, NULL, 394),
+ NAME_FUNC_OFFSET( 5489, glMultiTexCoord3fvARB, glMultiTexCoord3fvARB, NULL, 395),
+ NAME_FUNC_OFFSET( 5511, glMultiTexCoord3iARB, glMultiTexCoord3iARB, NULL, 396),
+ NAME_FUNC_OFFSET( 5532, glMultiTexCoord3ivARB, glMultiTexCoord3ivARB, NULL, 397),
+ NAME_FUNC_OFFSET( 5554, glMultiTexCoord3sARB, glMultiTexCoord3sARB, NULL, 398),
+ NAME_FUNC_OFFSET( 5575, glMultiTexCoord3svARB, glMultiTexCoord3svARB, NULL, 399),
+ NAME_FUNC_OFFSET( 5597, glMultiTexCoord4dARB, glMultiTexCoord4dARB, NULL, 400),
+ NAME_FUNC_OFFSET( 5618, glMultiTexCoord4dvARB, glMultiTexCoord4dvARB, NULL, 401),
+ NAME_FUNC_OFFSET( 5640, glMultiTexCoord4fARB, glMultiTexCoord4fARB, NULL, 402),
+ NAME_FUNC_OFFSET( 5661, glMultiTexCoord4fvARB, glMultiTexCoord4fvARB, NULL, 403),
+ NAME_FUNC_OFFSET( 5683, glMultiTexCoord4iARB, glMultiTexCoord4iARB, NULL, 404),
+ NAME_FUNC_OFFSET( 5704, glMultiTexCoord4ivARB, glMultiTexCoord4ivARB, NULL, 405),
+ NAME_FUNC_OFFSET( 5726, glMultiTexCoord4sARB, glMultiTexCoord4sARB, NULL, 406),
+ NAME_FUNC_OFFSET( 5747, glMultiTexCoord4svARB, glMultiTexCoord4svARB, NULL, 407),
+ NAME_FUNC_OFFSET( 5769, glAttachShader, glAttachShader, NULL, 408),
+ NAME_FUNC_OFFSET( 5784, glCreateProgram, glCreateProgram, NULL, 409),
+ NAME_FUNC_OFFSET( 5800, glCreateShader, glCreateShader, NULL, 410),
+ NAME_FUNC_OFFSET( 5815, glDeleteProgram, glDeleteProgram, NULL, 411),
+ NAME_FUNC_OFFSET( 5831, glDeleteShader, glDeleteShader, NULL, 412),
+ NAME_FUNC_OFFSET( 5846, glDetachShader, glDetachShader, NULL, 413),
+ NAME_FUNC_OFFSET( 5861, glGetAttachedShaders, glGetAttachedShaders, NULL, 414),
+ NAME_FUNC_OFFSET( 5882, glGetProgramInfoLog, glGetProgramInfoLog, NULL, 415),
+ NAME_FUNC_OFFSET( 5902, glGetProgramiv, glGetProgramiv, NULL, 416),
+ NAME_FUNC_OFFSET( 5917, glGetShaderInfoLog, glGetShaderInfoLog, NULL, 417),
+ NAME_FUNC_OFFSET( 5936, glGetShaderiv, glGetShaderiv, NULL, 418),
+ NAME_FUNC_OFFSET( 5950, glIsProgram, glIsProgram, NULL, 419),
+ NAME_FUNC_OFFSET( 5962, glIsShader, glIsShader, NULL, 420),
+ NAME_FUNC_OFFSET( 5973, glStencilFuncSeparate, glStencilFuncSeparate, NULL, 421),
+ NAME_FUNC_OFFSET( 5995, glStencilMaskSeparate, glStencilMaskSeparate, NULL, 422),
+ NAME_FUNC_OFFSET( 6017, glStencilOpSeparate, glStencilOpSeparate, NULL, 423),
+ NAME_FUNC_OFFSET( 6037, glUniformMatrix2x3fv, glUniformMatrix2x3fv, NULL, 424),
+ NAME_FUNC_OFFSET( 6058, glUniformMatrix2x4fv, glUniformMatrix2x4fv, NULL, 425),
+ NAME_FUNC_OFFSET( 6079, glUniformMatrix3x2fv, glUniformMatrix3x2fv, NULL, 426),
+ NAME_FUNC_OFFSET( 6100, glUniformMatrix3x4fv, glUniformMatrix3x4fv, NULL, 427),
+ NAME_FUNC_OFFSET( 6121, glUniformMatrix4x2fv, glUniformMatrix4x2fv, NULL, 428),
+ NAME_FUNC_OFFSET( 6142, glUniformMatrix4x3fv, glUniformMatrix4x3fv, NULL, 429),
+ NAME_FUNC_OFFSET( 6163, glClampColor, glClampColor, NULL, 430),
+ NAME_FUNC_OFFSET( 6176, glClearBufferfi, glClearBufferfi, NULL, 431),
+ NAME_FUNC_OFFSET( 6192, glClearBufferfv, glClearBufferfv, NULL, 432),
+ NAME_FUNC_OFFSET( 6208, glClearBufferiv, glClearBufferiv, NULL, 433),
+ NAME_FUNC_OFFSET( 6224, glClearBufferuiv, glClearBufferuiv, NULL, 434),
+ NAME_FUNC_OFFSET( 6241, glGetStringi, glGetStringi, NULL, 435),
+ NAME_FUNC_OFFSET( 6254, glTexBuffer, glTexBuffer, NULL, 436),
+ NAME_FUNC_OFFSET( 6266, glFramebufferTexture, glFramebufferTexture, NULL, 437),
+ NAME_FUNC_OFFSET( 6287, glGetBufferParameteri64v, glGetBufferParameteri64v, NULL, 438),
+ NAME_FUNC_OFFSET( 6312, glGetInteger64i_v, glGetInteger64i_v, NULL, 439),
+ NAME_FUNC_OFFSET( 6330, glVertexAttribDivisor, glVertexAttribDivisor, NULL, 440),
+ NAME_FUNC_OFFSET( 6352, glLoadTransposeMatrixdARB, glLoadTransposeMatrixdARB, NULL, 441),
+ NAME_FUNC_OFFSET( 6378, glLoadTransposeMatrixfARB, glLoadTransposeMatrixfARB, NULL, 442),
+ NAME_FUNC_OFFSET( 6404, glMultTransposeMatrixdARB, glMultTransposeMatrixdARB, NULL, 443),
+ NAME_FUNC_OFFSET( 6430, glMultTransposeMatrixfARB, glMultTransposeMatrixfARB, NULL, 444),
+ NAME_FUNC_OFFSET( 6456, glSampleCoverageARB, glSampleCoverageARB, NULL, 445),
+ NAME_FUNC_OFFSET( 6476, glCompressedTexImage1DARB, glCompressedTexImage1DARB, NULL, 446),
+ NAME_FUNC_OFFSET( 6502, glCompressedTexImage2DARB, glCompressedTexImage2DARB, NULL, 447),
+ NAME_FUNC_OFFSET( 6528, glCompressedTexImage3DARB, glCompressedTexImage3DARB, NULL, 448),
+ NAME_FUNC_OFFSET( 6554, glCompressedTexSubImage1DARB, glCompressedTexSubImage1DARB, NULL, 449),
+ NAME_FUNC_OFFSET( 6583, glCompressedTexSubImage2DARB, glCompressedTexSubImage2DARB, NULL, 450),
+ NAME_FUNC_OFFSET( 6612, glCompressedTexSubImage3DARB, glCompressedTexSubImage3DARB, NULL, 451),
+ NAME_FUNC_OFFSET( 6641, glGetCompressedTexImageARB, glGetCompressedTexImageARB, NULL, 452),
+ NAME_FUNC_OFFSET( 6668, glDisableVertexAttribArrayARB, glDisableVertexAttribArrayARB, NULL, 453),
+ NAME_FUNC_OFFSET( 6698, glEnableVertexAttribArrayARB, glEnableVertexAttribArrayARB, NULL, 454),
+ NAME_FUNC_OFFSET( 6727, glGetProgramEnvParameterdvARB, glGetProgramEnvParameterdvARB, NULL, 455),
+ NAME_FUNC_OFFSET( 6757, glGetProgramEnvParameterfvARB, glGetProgramEnvParameterfvARB, NULL, 456),
+ NAME_FUNC_OFFSET( 6787, glGetProgramLocalParameterdvARB, glGetProgramLocalParameterdvARB, NULL, 457),
+ NAME_FUNC_OFFSET( 6819, glGetProgramLocalParameterfvARB, glGetProgramLocalParameterfvARB, NULL, 458),
+ NAME_FUNC_OFFSET( 6851, glGetProgramStringARB, glGetProgramStringARB, NULL, 459),
+ NAME_FUNC_OFFSET( 6873, glGetProgramivARB, glGetProgramivARB, NULL, 460),
+ NAME_FUNC_OFFSET( 6891, glGetVertexAttribdvARB, glGetVertexAttribdvARB, NULL, 461),
+ NAME_FUNC_OFFSET( 6914, glGetVertexAttribfvARB, glGetVertexAttribfvARB, NULL, 462),
+ NAME_FUNC_OFFSET( 6937, glGetVertexAttribivARB, glGetVertexAttribivARB, NULL, 463),
+ NAME_FUNC_OFFSET( 6960, glProgramEnvParameter4dARB, glProgramEnvParameter4dARB, NULL, 464),
+ NAME_FUNC_OFFSET( 6987, glProgramEnvParameter4dvARB, glProgramEnvParameter4dvARB, NULL, 465),
+ NAME_FUNC_OFFSET( 7015, glProgramEnvParameter4fARB, glProgramEnvParameter4fARB, NULL, 466),
+ NAME_FUNC_OFFSET( 7042, glProgramEnvParameter4fvARB, glProgramEnvParameter4fvARB, NULL, 467),
+ NAME_FUNC_OFFSET( 7070, glProgramLocalParameter4dARB, glProgramLocalParameter4dARB, NULL, 468),
+ NAME_FUNC_OFFSET( 7099, glProgramLocalParameter4dvARB, glProgramLocalParameter4dvARB, NULL, 469),
+ NAME_FUNC_OFFSET( 7129, glProgramLocalParameter4fARB, glProgramLocalParameter4fARB, NULL, 470),
+ NAME_FUNC_OFFSET( 7158, glProgramLocalParameter4fvARB, glProgramLocalParameter4fvARB, NULL, 471),
+ NAME_FUNC_OFFSET( 7188, glProgramStringARB, glProgramStringARB, NULL, 472),
+ NAME_FUNC_OFFSET( 7207, glVertexAttrib1dARB, glVertexAttrib1dARB, NULL, 473),
+ NAME_FUNC_OFFSET( 7227, glVertexAttrib1dvARB, glVertexAttrib1dvARB, NULL, 474),
+ NAME_FUNC_OFFSET( 7248, glVertexAttrib1fARB, glVertexAttrib1fARB, NULL, 475),
+ NAME_FUNC_OFFSET( 7268, glVertexAttrib1fvARB, glVertexAttrib1fvARB, NULL, 476),
+ NAME_FUNC_OFFSET( 7289, glVertexAttrib1sARB, glVertexAttrib1sARB, NULL, 477),
+ NAME_FUNC_OFFSET( 7309, glVertexAttrib1svARB, glVertexAttrib1svARB, NULL, 478),
+ NAME_FUNC_OFFSET( 7330, glVertexAttrib2dARB, glVertexAttrib2dARB, NULL, 479),
+ NAME_FUNC_OFFSET( 7350, glVertexAttrib2dvARB, glVertexAttrib2dvARB, NULL, 480),
+ NAME_FUNC_OFFSET( 7371, glVertexAttrib2fARB, glVertexAttrib2fARB, NULL, 481),
+ NAME_FUNC_OFFSET( 7391, glVertexAttrib2fvARB, glVertexAttrib2fvARB, NULL, 482),
+ NAME_FUNC_OFFSET( 7412, glVertexAttrib2sARB, glVertexAttrib2sARB, NULL, 483),
+ NAME_FUNC_OFFSET( 7432, glVertexAttrib2svARB, glVertexAttrib2svARB, NULL, 484),
+ NAME_FUNC_OFFSET( 7453, glVertexAttrib3dARB, glVertexAttrib3dARB, NULL, 485),
+ NAME_FUNC_OFFSET( 7473, glVertexAttrib3dvARB, glVertexAttrib3dvARB, NULL, 486),
+ NAME_FUNC_OFFSET( 7494, glVertexAttrib3fARB, glVertexAttrib3fARB, NULL, 487),
+ NAME_FUNC_OFFSET( 7514, glVertexAttrib3fvARB, glVertexAttrib3fvARB, NULL, 488),
+ NAME_FUNC_OFFSET( 7535, glVertexAttrib3sARB, glVertexAttrib3sARB, NULL, 489),
+ NAME_FUNC_OFFSET( 7555, glVertexAttrib3svARB, glVertexAttrib3svARB, NULL, 490),
+ NAME_FUNC_OFFSET( 7576, glVertexAttrib4NbvARB, glVertexAttrib4NbvARB, NULL, 491),
+ NAME_FUNC_OFFSET( 7598, glVertexAttrib4NivARB, glVertexAttrib4NivARB, NULL, 492),
+ NAME_FUNC_OFFSET( 7620, glVertexAttrib4NsvARB, glVertexAttrib4NsvARB, NULL, 493),
+ NAME_FUNC_OFFSET( 7642, glVertexAttrib4NubARB, glVertexAttrib4NubARB, NULL, 494),
+ NAME_FUNC_OFFSET( 7664, glVertexAttrib4NubvARB, glVertexAttrib4NubvARB, NULL, 495),
+ NAME_FUNC_OFFSET( 7687, glVertexAttrib4NuivARB, glVertexAttrib4NuivARB, NULL, 496),
+ NAME_FUNC_OFFSET( 7710, glVertexAttrib4NusvARB, glVertexAttrib4NusvARB, NULL, 497),
+ NAME_FUNC_OFFSET( 7733, glVertexAttrib4bvARB, glVertexAttrib4bvARB, NULL, 498),
+ NAME_FUNC_OFFSET( 7754, glVertexAttrib4dARB, glVertexAttrib4dARB, NULL, 499),
+ NAME_FUNC_OFFSET( 7774, glVertexAttrib4dvARB, glVertexAttrib4dvARB, NULL, 500),
+ NAME_FUNC_OFFSET( 7795, glVertexAttrib4fARB, glVertexAttrib4fARB, NULL, 501),
+ NAME_FUNC_OFFSET( 7815, glVertexAttrib4fvARB, glVertexAttrib4fvARB, NULL, 502),
+ NAME_FUNC_OFFSET( 7836, glVertexAttrib4ivARB, glVertexAttrib4ivARB, NULL, 503),
+ NAME_FUNC_OFFSET( 7857, glVertexAttrib4sARB, glVertexAttrib4sARB, NULL, 504),
+ NAME_FUNC_OFFSET( 7877, glVertexAttrib4svARB, glVertexAttrib4svARB, NULL, 505),
+ NAME_FUNC_OFFSET( 7898, glVertexAttrib4ubvARB, glVertexAttrib4ubvARB, NULL, 506),
+ NAME_FUNC_OFFSET( 7920, glVertexAttrib4uivARB, glVertexAttrib4uivARB, NULL, 507),
+ NAME_FUNC_OFFSET( 7942, glVertexAttrib4usvARB, glVertexAttrib4usvARB, NULL, 508),
+ NAME_FUNC_OFFSET( 7964, glVertexAttribPointerARB, glVertexAttribPointerARB, NULL, 509),
+ NAME_FUNC_OFFSET( 7989, glBindBufferARB, glBindBufferARB, NULL, 510),
+ NAME_FUNC_OFFSET( 8005, glBufferDataARB, glBufferDataARB, NULL, 511),
+ NAME_FUNC_OFFSET( 8021, glBufferSubDataARB, glBufferSubDataARB, NULL, 512),
+ NAME_FUNC_OFFSET( 8040, glDeleteBuffersARB, glDeleteBuffersARB, NULL, 513),
+ NAME_FUNC_OFFSET( 8059, glGenBuffersARB, glGenBuffersARB, NULL, 514),
+ NAME_FUNC_OFFSET( 8075, glGetBufferParameterivARB, glGetBufferParameterivARB, NULL, 515),
+ NAME_FUNC_OFFSET( 8101, glGetBufferPointervARB, glGetBufferPointervARB, NULL, 516),
+ NAME_FUNC_OFFSET( 8124, glGetBufferSubDataARB, glGetBufferSubDataARB, NULL, 517),
+ NAME_FUNC_OFFSET( 8146, glIsBufferARB, glIsBufferARB, NULL, 518),
+ NAME_FUNC_OFFSET( 8160, glMapBufferARB, glMapBufferARB, NULL, 519),
+ NAME_FUNC_OFFSET( 8175, glUnmapBufferARB, glUnmapBufferARB, NULL, 520),
+ NAME_FUNC_OFFSET( 8192, glBeginQueryARB, glBeginQueryARB, NULL, 521),
+ NAME_FUNC_OFFSET( 8208, glDeleteQueriesARB, glDeleteQueriesARB, NULL, 522),
+ NAME_FUNC_OFFSET( 8227, glEndQueryARB, glEndQueryARB, NULL, 523),
+ NAME_FUNC_OFFSET( 8241, glGenQueriesARB, glGenQueriesARB, NULL, 524),
+ NAME_FUNC_OFFSET( 8257, glGetQueryObjectivARB, glGetQueryObjectivARB, NULL, 525),
+ NAME_FUNC_OFFSET( 8279, glGetQueryObjectuivARB, glGetQueryObjectuivARB, NULL, 526),
+ NAME_FUNC_OFFSET( 8302, glGetQueryivARB, glGetQueryivARB, NULL, 527),
+ NAME_FUNC_OFFSET( 8318, glIsQueryARB, glIsQueryARB, NULL, 528),
+ NAME_FUNC_OFFSET( 8331, glAttachObjectARB, glAttachObjectARB, NULL, 529),
+ NAME_FUNC_OFFSET( 8349, glCompileShaderARB, glCompileShaderARB, NULL, 530),
+ NAME_FUNC_OFFSET( 8368, glCreateProgramObjectARB, glCreateProgramObjectARB, NULL, 531),
+ NAME_FUNC_OFFSET( 8393, glCreateShaderObjectARB, glCreateShaderObjectARB, NULL, 532),
+ NAME_FUNC_OFFSET( 8417, glDeleteObjectARB, glDeleteObjectARB, NULL, 533),
+ NAME_FUNC_OFFSET( 8435, glDetachObjectARB, glDetachObjectARB, NULL, 534),
+ NAME_FUNC_OFFSET( 8453, glGetActiveUniformARB, glGetActiveUniformARB, NULL, 535),
+ NAME_FUNC_OFFSET( 8475, glGetAttachedObjectsARB, glGetAttachedObjectsARB, NULL, 536),
+ NAME_FUNC_OFFSET( 8499, glGetHandleARB, glGetHandleARB, NULL, 537),
+ NAME_FUNC_OFFSET( 8514, glGetInfoLogARB, glGetInfoLogARB, NULL, 538),
+ NAME_FUNC_OFFSET( 8530, glGetObjectParameterfvARB, glGetObjectParameterfvARB, NULL, 539),
+ NAME_FUNC_OFFSET( 8556, glGetObjectParameterivARB, glGetObjectParameterivARB, NULL, 540),
+ NAME_FUNC_OFFSET( 8582, glGetShaderSourceARB, glGetShaderSourceARB, NULL, 541),
+ NAME_FUNC_OFFSET( 8603, glGetUniformLocationARB, glGetUniformLocationARB, NULL, 542),
+ NAME_FUNC_OFFSET( 8627, glGetUniformfvARB, glGetUniformfvARB, NULL, 543),
+ NAME_FUNC_OFFSET( 8645, glGetUniformivARB, glGetUniformivARB, NULL, 544),
+ NAME_FUNC_OFFSET( 8663, glLinkProgramARB, glLinkProgramARB, NULL, 545),
+ NAME_FUNC_OFFSET( 8680, glShaderSourceARB, glShaderSourceARB, NULL, 546),
+ NAME_FUNC_OFFSET( 8698, glUniform1fARB, glUniform1fARB, NULL, 547),
+ NAME_FUNC_OFFSET( 8713, glUniform1fvARB, glUniform1fvARB, NULL, 548),
+ NAME_FUNC_OFFSET( 8729, glUniform1iARB, glUniform1iARB, NULL, 549),
+ NAME_FUNC_OFFSET( 8744, glUniform1ivARB, glUniform1ivARB, NULL, 550),
+ NAME_FUNC_OFFSET( 8760, glUniform2fARB, glUniform2fARB, NULL, 551),
+ NAME_FUNC_OFFSET( 8775, glUniform2fvARB, glUniform2fvARB, NULL, 552),
+ NAME_FUNC_OFFSET( 8791, glUniform2iARB, glUniform2iARB, NULL, 553),
+ NAME_FUNC_OFFSET( 8806, glUniform2ivARB, glUniform2ivARB, NULL, 554),
+ NAME_FUNC_OFFSET( 8822, glUniform3fARB, glUniform3fARB, NULL, 555),
+ NAME_FUNC_OFFSET( 8837, glUniform3fvARB, glUniform3fvARB, NULL, 556),
+ NAME_FUNC_OFFSET( 8853, glUniform3iARB, glUniform3iARB, NULL, 557),
+ NAME_FUNC_OFFSET( 8868, glUniform3ivARB, glUniform3ivARB, NULL, 558),
+ NAME_FUNC_OFFSET( 8884, glUniform4fARB, glUniform4fARB, NULL, 559),
+ NAME_FUNC_OFFSET( 8899, glUniform4fvARB, glUniform4fvARB, NULL, 560),
+ NAME_FUNC_OFFSET( 8915, glUniform4iARB, glUniform4iARB, NULL, 561),
+ NAME_FUNC_OFFSET( 8930, glUniform4ivARB, glUniform4ivARB, NULL, 562),
+ NAME_FUNC_OFFSET( 8946, glUniformMatrix2fvARB, glUniformMatrix2fvARB, NULL, 563),
+ NAME_FUNC_OFFSET( 8968, glUniformMatrix3fvARB, glUniformMatrix3fvARB, NULL, 564),
+ NAME_FUNC_OFFSET( 8990, glUniformMatrix4fvARB, glUniformMatrix4fvARB, NULL, 565),
+ NAME_FUNC_OFFSET( 9012, glUseProgramObjectARB, glUseProgramObjectARB, NULL, 566),
+ NAME_FUNC_OFFSET( 9034, glValidateProgramARB, glValidateProgramARB, NULL, 567),
+ NAME_FUNC_OFFSET( 9055, glBindAttribLocationARB, glBindAttribLocationARB, NULL, 568),
+ NAME_FUNC_OFFSET( 9079, glGetActiveAttribARB, glGetActiveAttribARB, NULL, 569),
+ NAME_FUNC_OFFSET( 9100, glGetAttribLocationARB, glGetAttribLocationARB, NULL, 570),
+ NAME_FUNC_OFFSET( 9123, glDrawBuffersARB, glDrawBuffersARB, NULL, 571),
+ NAME_FUNC_OFFSET( 9140, glClampColorARB, glClampColorARB, NULL, 572),
+ NAME_FUNC_OFFSET( 9156, glDrawArraysInstancedARB, glDrawArraysInstancedARB, NULL, 573),
+ NAME_FUNC_OFFSET( 9181, glDrawElementsInstancedARB, glDrawElementsInstancedARB, NULL, 574),
+ NAME_FUNC_OFFSET( 9208, glRenderbufferStorageMultisample, glRenderbufferStorageMultisample, NULL, 575),
+ NAME_FUNC_OFFSET( 9241, glFramebufferTextureARB, glFramebufferTextureARB, NULL, 576),
+ NAME_FUNC_OFFSET( 9265, glFramebufferTextureFaceARB, glFramebufferTextureFaceARB, NULL, 577),
+ NAME_FUNC_OFFSET( 9293, glProgramParameteriARB, glProgramParameteriARB, NULL, 578),
+ NAME_FUNC_OFFSET( 9316, glVertexAttribDivisorARB, glVertexAttribDivisorARB, NULL, 579),
+ NAME_FUNC_OFFSET( 9341, glFlushMappedBufferRange, glFlushMappedBufferRange, NULL, 580),
+ NAME_FUNC_OFFSET( 9366, glMapBufferRange, glMapBufferRange, NULL, 581),
+ NAME_FUNC_OFFSET( 9383, glTexBufferARB, glTexBufferARB, NULL, 582),
+ NAME_FUNC_OFFSET( 9398, glBindVertexArray, glBindVertexArray, NULL, 583),
+ NAME_FUNC_OFFSET( 9416, glGenVertexArrays, glGenVertexArrays, NULL, 584),
+ NAME_FUNC_OFFSET( 9434, glCopyBufferSubData, glCopyBufferSubData, NULL, 585),
+ NAME_FUNC_OFFSET( 9454, glClientWaitSync, glClientWaitSync, NULL, 586),
+ NAME_FUNC_OFFSET( 9471, glDeleteSync, glDeleteSync, NULL, 587),
+ NAME_FUNC_OFFSET( 9484, glFenceSync, glFenceSync, NULL, 588),
+ NAME_FUNC_OFFSET( 9496, glGetInteger64v, glGetInteger64v, NULL, 589),
+ NAME_FUNC_OFFSET( 9512, glGetSynciv, glGetSynciv, NULL, 590),
+ NAME_FUNC_OFFSET( 9524, glIsSync, glIsSync, NULL, 591),
+ NAME_FUNC_OFFSET( 9533, glWaitSync, glWaitSync, NULL, 592),
+ NAME_FUNC_OFFSET( 9544, glDrawElementsBaseVertex, glDrawElementsBaseVertex, NULL, 593),
+ NAME_FUNC_OFFSET( 9569, glDrawRangeElementsBaseVertex, glDrawRangeElementsBaseVertex, NULL, 594),
+ NAME_FUNC_OFFSET( 9599, glMultiDrawElementsBaseVertex, glMultiDrawElementsBaseVertex, NULL, 595),
+ NAME_FUNC_OFFSET( 9629, glBlendEquationSeparateiARB, glBlendEquationSeparateiARB, NULL, 596),
+ NAME_FUNC_OFFSET( 9657, glBlendEquationiARB, glBlendEquationiARB, NULL, 597),
+ NAME_FUNC_OFFSET( 9677, glBlendFuncSeparateiARB, glBlendFuncSeparateiARB, NULL, 598),
+ NAME_FUNC_OFFSET( 9701, glBlendFunciARB, glBlendFunciARB, NULL, 599),
+ NAME_FUNC_OFFSET( 9717, glBindSampler, glBindSampler, NULL, 600),
+ NAME_FUNC_OFFSET( 9731, glDeleteSamplers, glDeleteSamplers, NULL, 601),
+ NAME_FUNC_OFFSET( 9748, glGenSamplers, glGenSamplers, NULL, 602),
+ NAME_FUNC_OFFSET( 9762, glGetSamplerParameterIiv, glGetSamplerParameterIiv, NULL, 603),
+ NAME_FUNC_OFFSET( 9787, glGetSamplerParameterIuiv, glGetSamplerParameterIuiv, NULL, 604),
+ NAME_FUNC_OFFSET( 9813, glGetSamplerParameterfv, glGetSamplerParameterfv, NULL, 605),
+ NAME_FUNC_OFFSET( 9837, glGetSamplerParameteriv, glGetSamplerParameteriv, NULL, 606),
+ NAME_FUNC_OFFSET( 9861, glIsSampler, glIsSampler, NULL, 607),
+ NAME_FUNC_OFFSET( 9873, glSamplerParameterIiv, glSamplerParameterIiv, NULL, 608),
+ NAME_FUNC_OFFSET( 9895, glSamplerParameterIuiv, glSamplerParameterIuiv, NULL, 609),
+ NAME_FUNC_OFFSET( 9918, glSamplerParameterf, glSamplerParameterf, NULL, 610),
+ NAME_FUNC_OFFSET( 9938, glSamplerParameterfv, glSamplerParameterfv, NULL, 611),
+ NAME_FUNC_OFFSET( 9959, glSamplerParameteri, glSamplerParameteri, NULL, 612),
+ NAME_FUNC_OFFSET( 9979, glSamplerParameteriv, glSamplerParameteriv, NULL, 613),
+ NAME_FUNC_OFFSET(10000, glBindTransformFeedback, glBindTransformFeedback, NULL, 614),
+ NAME_FUNC_OFFSET(10024, glDeleteTransformFeedbacks, glDeleteTransformFeedbacks, NULL, 615),
+ NAME_FUNC_OFFSET(10051, glDrawTransformFeedback, glDrawTransformFeedback, NULL, 616),
+ NAME_FUNC_OFFSET(10075, glGenTransformFeedbacks, glGenTransformFeedbacks, NULL, 617),
+ NAME_FUNC_OFFSET(10099, glIsTransformFeedback, glIsTransformFeedback, NULL, 618),
+ NAME_FUNC_OFFSET(10121, glPauseTransformFeedback, glPauseTransformFeedback, NULL, 619),
+ NAME_FUNC_OFFSET(10146, glResumeTransformFeedback, glResumeTransformFeedback, NULL, 620),
+ NAME_FUNC_OFFSET(10172, glClearDepthf, glClearDepthf, NULL, 621),
+ NAME_FUNC_OFFSET(10186, glDepthRangef, glDepthRangef, NULL, 622),
+ NAME_FUNC_OFFSET(10200, glGetShaderPrecisionFormat, glGetShaderPrecisionFormat, NULL, 623),
+ NAME_FUNC_OFFSET(10227, glReleaseShaderCompiler, glReleaseShaderCompiler, NULL, 624),
+ NAME_FUNC_OFFSET(10251, glShaderBinary, glShaderBinary, NULL, 625),
+ NAME_FUNC_OFFSET(10266, glGetGraphicsResetStatusARB, glGetGraphicsResetStatusARB, NULL, 626),
+ NAME_FUNC_OFFSET(10294, glGetnColorTableARB, glGetnColorTableARB, NULL, 627),
+ NAME_FUNC_OFFSET(10314, glGetnCompressedTexImageARB, glGetnCompressedTexImageARB, NULL, 628),
+ NAME_FUNC_OFFSET(10342, glGetnConvolutionFilterARB, glGetnConvolutionFilterARB, NULL, 629),
+ NAME_FUNC_OFFSET(10369, glGetnHistogramARB, glGetnHistogramARB, NULL, 630),
+ NAME_FUNC_OFFSET(10388, glGetnMapdvARB, glGetnMapdvARB, NULL, 631),
+ NAME_FUNC_OFFSET(10403, glGetnMapfvARB, glGetnMapfvARB, NULL, 632),
+ NAME_FUNC_OFFSET(10418, glGetnMapivARB, glGetnMapivARB, NULL, 633),
+ NAME_FUNC_OFFSET(10433, glGetnMinmaxARB, glGetnMinmaxARB, NULL, 634),
+ NAME_FUNC_OFFSET(10449, glGetnPixelMapfvARB, glGetnPixelMapfvARB, NULL, 635),
+ NAME_FUNC_OFFSET(10469, glGetnPixelMapuivARB, glGetnPixelMapuivARB, NULL, 636),
+ NAME_FUNC_OFFSET(10490, glGetnPixelMapusvARB, glGetnPixelMapusvARB, NULL, 637),
+ NAME_FUNC_OFFSET(10511, glGetnPolygonStippleARB, glGetnPolygonStippleARB, NULL, 638),
+ NAME_FUNC_OFFSET(10535, glGetnSeparableFilterARB, glGetnSeparableFilterARB, NULL, 639),
+ NAME_FUNC_OFFSET(10560, glGetnTexImageARB, glGetnTexImageARB, NULL, 640),
+ NAME_FUNC_OFFSET(10578, glGetnUniformdvARB, glGetnUniformdvARB, NULL, 641),
+ NAME_FUNC_OFFSET(10597, glGetnUniformfvARB, glGetnUniformfvARB, NULL, 642),
+ NAME_FUNC_OFFSET(10616, glGetnUniformivARB, glGetnUniformivARB, NULL, 643),
+ NAME_FUNC_OFFSET(10635, glGetnUniformuivARB, glGetnUniformuivARB, NULL, 644),
+ NAME_FUNC_OFFSET(10655, glReadnPixelsARB, glReadnPixelsARB, NULL, 645),
+ NAME_FUNC_OFFSET(10672, glPolygonOffsetEXT, glPolygonOffsetEXT, NULL, 646),
+ NAME_FUNC_OFFSET(10691, gl_dispatch_stub_647, gl_dispatch_stub_647, NULL, 647),
+ NAME_FUNC_OFFSET(10723, gl_dispatch_stub_648, gl_dispatch_stub_648, NULL, 648),
+ NAME_FUNC_OFFSET(10755, gl_dispatch_stub_649, gl_dispatch_stub_649, NULL, 649),
+ NAME_FUNC_OFFSET(10783, gl_dispatch_stub_650, gl_dispatch_stub_650, NULL, 650),
+ NAME_FUNC_OFFSET(10812, gl_dispatch_stub_651, gl_dispatch_stub_651, NULL, 651),
+ NAME_FUNC_OFFSET(10840, gl_dispatch_stub_652, gl_dispatch_stub_652, NULL, 652),
+ NAME_FUNC_OFFSET(10869, gl_dispatch_stub_653, gl_dispatch_stub_653, NULL, 653),
+ NAME_FUNC_OFFSET(10886, gl_dispatch_stub_654, gl_dispatch_stub_654, NULL, 654),
+ NAME_FUNC_OFFSET(10906, glColorPointerEXT, glColorPointerEXT, NULL, 655),
+ NAME_FUNC_OFFSET(10924, glEdgeFlagPointerEXT, glEdgeFlagPointerEXT, NULL, 656),
+ NAME_FUNC_OFFSET(10945, glIndexPointerEXT, glIndexPointerEXT, NULL, 657),
+ NAME_FUNC_OFFSET(10963, glNormalPointerEXT, glNormalPointerEXT, NULL, 658),
+ NAME_FUNC_OFFSET(10982, glTexCoordPointerEXT, glTexCoordPointerEXT, NULL, 659),
+ NAME_FUNC_OFFSET(11003, glVertexPointerEXT, glVertexPointerEXT, NULL, 660),
+ NAME_FUNC_OFFSET(11022, glPointParameterfEXT, glPointParameterfEXT, NULL, 661),
+ NAME_FUNC_OFFSET(11043, glPointParameterfvEXT, glPointParameterfvEXT, NULL, 662),
+ NAME_FUNC_OFFSET(11065, glLockArraysEXT, glLockArraysEXT, NULL, 663),
+ NAME_FUNC_OFFSET(11081, glUnlockArraysEXT, glUnlockArraysEXT, NULL, 664),
+ NAME_FUNC_OFFSET(11099, glSecondaryColor3bEXT, glSecondaryColor3bEXT, NULL, 665),
+ NAME_FUNC_OFFSET(11121, glSecondaryColor3bvEXT, glSecondaryColor3bvEXT, NULL, 666),
+ NAME_FUNC_OFFSET(11144, glSecondaryColor3dEXT, glSecondaryColor3dEXT, NULL, 667),
+ NAME_FUNC_OFFSET(11166, glSecondaryColor3dvEXT, glSecondaryColor3dvEXT, NULL, 668),
+ NAME_FUNC_OFFSET(11189, glSecondaryColor3fEXT, glSecondaryColor3fEXT, NULL, 669),
+ NAME_FUNC_OFFSET(11211, glSecondaryColor3fvEXT, glSecondaryColor3fvEXT, NULL, 670),
+ NAME_FUNC_OFFSET(11234, glSecondaryColor3iEXT, glSecondaryColor3iEXT, NULL, 671),
+ NAME_FUNC_OFFSET(11256, glSecondaryColor3ivEXT, glSecondaryColor3ivEXT, NULL, 672),
+ NAME_FUNC_OFFSET(11279, glSecondaryColor3sEXT, glSecondaryColor3sEXT, NULL, 673),
+ NAME_FUNC_OFFSET(11301, glSecondaryColor3svEXT, glSecondaryColor3svEXT, NULL, 674),
+ NAME_FUNC_OFFSET(11324, glSecondaryColor3ubEXT, glSecondaryColor3ubEXT, NULL, 675),
+ NAME_FUNC_OFFSET(11347, glSecondaryColor3ubvEXT, glSecondaryColor3ubvEXT, NULL, 676),
+ NAME_FUNC_OFFSET(11371, glSecondaryColor3uiEXT, glSecondaryColor3uiEXT, NULL, 677),
+ NAME_FUNC_OFFSET(11394, glSecondaryColor3uivEXT, glSecondaryColor3uivEXT, NULL, 678),
+ NAME_FUNC_OFFSET(11418, glSecondaryColor3usEXT, glSecondaryColor3usEXT, NULL, 679),
+ NAME_FUNC_OFFSET(11441, glSecondaryColor3usvEXT, glSecondaryColor3usvEXT, NULL, 680),
+ NAME_FUNC_OFFSET(11465, glSecondaryColorPointerEXT, glSecondaryColorPointerEXT, NULL, 681),
+ NAME_FUNC_OFFSET(11492, glMultiDrawArraysEXT, glMultiDrawArraysEXT, NULL, 682),
+ NAME_FUNC_OFFSET(11513, glMultiDrawElementsEXT, glMultiDrawElementsEXT, NULL, 683),
+ NAME_FUNC_OFFSET(11536, glFogCoordPointerEXT, glFogCoordPointerEXT, NULL, 684),
+ NAME_FUNC_OFFSET(11557, glFogCoorddEXT, glFogCoorddEXT, NULL, 685),
+ NAME_FUNC_OFFSET(11572, glFogCoorddvEXT, glFogCoorddvEXT, NULL, 686),
+ NAME_FUNC_OFFSET(11588, glFogCoordfEXT, glFogCoordfEXT, NULL, 687),
+ NAME_FUNC_OFFSET(11603, glFogCoordfvEXT, glFogCoordfvEXT, NULL, 688),
+ NAME_FUNC_OFFSET(11619, gl_dispatch_stub_689, gl_dispatch_stub_689, NULL, 689),
+ NAME_FUNC_OFFSET(11637, glBlendFuncSeparateEXT, glBlendFuncSeparateEXT, NULL, 690),
+ NAME_FUNC_OFFSET(11660, glFlushVertexArrayRangeNV, glFlushVertexArrayRangeNV, NULL, 691),
+ NAME_FUNC_OFFSET(11686, glVertexArrayRangeNV, glVertexArrayRangeNV, NULL, 692),
+ NAME_FUNC_OFFSET(11707, glCombinerInputNV, glCombinerInputNV, NULL, 693),
+ NAME_FUNC_OFFSET(11725, glCombinerOutputNV, glCombinerOutputNV, NULL, 694),
+ NAME_FUNC_OFFSET(11744, glCombinerParameterfNV, glCombinerParameterfNV, NULL, 695),
+ NAME_FUNC_OFFSET(11767, glCombinerParameterfvNV, glCombinerParameterfvNV, NULL, 696),
+ NAME_FUNC_OFFSET(11791, glCombinerParameteriNV, glCombinerParameteriNV, NULL, 697),
+ NAME_FUNC_OFFSET(11814, glCombinerParameterivNV, glCombinerParameterivNV, NULL, 698),
+ NAME_FUNC_OFFSET(11838, glFinalCombinerInputNV, glFinalCombinerInputNV, NULL, 699),
+ NAME_FUNC_OFFSET(11861, glGetCombinerInputParameterfvNV, glGetCombinerInputParameterfvNV, NULL, 700),
+ NAME_FUNC_OFFSET(11893, glGetCombinerInputParameterivNV, glGetCombinerInputParameterivNV, NULL, 701),
+ NAME_FUNC_OFFSET(11925, glGetCombinerOutputParameterfvNV, glGetCombinerOutputParameterfvNV, NULL, 702),
+ NAME_FUNC_OFFSET(11958, glGetCombinerOutputParameterivNV, glGetCombinerOutputParameterivNV, NULL, 703),
+ NAME_FUNC_OFFSET(11991, glGetFinalCombinerInputParameterfvNV, glGetFinalCombinerInputParameterfvNV, NULL, 704),
+ NAME_FUNC_OFFSET(12028, glGetFinalCombinerInputParameterivNV, glGetFinalCombinerInputParameterivNV, NULL, 705),
+ NAME_FUNC_OFFSET(12065, glResizeBuffersMESA, glResizeBuffersMESA, NULL, 706),
+ NAME_FUNC_OFFSET(12085, glWindowPos2dMESA, glWindowPos2dMESA, NULL, 707),
+ NAME_FUNC_OFFSET(12103, glWindowPos2dvMESA, glWindowPos2dvMESA, NULL, 708),
+ NAME_FUNC_OFFSET(12122, glWindowPos2fMESA, glWindowPos2fMESA, NULL, 709),
+ NAME_FUNC_OFFSET(12140, glWindowPos2fvMESA, glWindowPos2fvMESA, NULL, 710),
+ NAME_FUNC_OFFSET(12159, glWindowPos2iMESA, glWindowPos2iMESA, NULL, 711),
+ NAME_FUNC_OFFSET(12177, glWindowPos2ivMESA, glWindowPos2ivMESA, NULL, 712),
+ NAME_FUNC_OFFSET(12196, glWindowPos2sMESA, glWindowPos2sMESA, NULL, 713),
+ NAME_FUNC_OFFSET(12214, glWindowPos2svMESA, glWindowPos2svMESA, NULL, 714),
+ NAME_FUNC_OFFSET(12233, glWindowPos3dMESA, glWindowPos3dMESA, NULL, 715),
+ NAME_FUNC_OFFSET(12251, glWindowPos3dvMESA, glWindowPos3dvMESA, NULL, 716),
+ NAME_FUNC_OFFSET(12270, glWindowPos3fMESA, glWindowPos3fMESA, NULL, 717),
+ NAME_FUNC_OFFSET(12288, glWindowPos3fvMESA, glWindowPos3fvMESA, NULL, 718),
+ NAME_FUNC_OFFSET(12307, glWindowPos3iMESA, glWindowPos3iMESA, NULL, 719),
+ NAME_FUNC_OFFSET(12325, glWindowPos3ivMESA, glWindowPos3ivMESA, NULL, 720),
+ NAME_FUNC_OFFSET(12344, glWindowPos3sMESA, glWindowPos3sMESA, NULL, 721),
+ NAME_FUNC_OFFSET(12362, glWindowPos3svMESA, glWindowPos3svMESA, NULL, 722),
+ NAME_FUNC_OFFSET(12381, glWindowPos4dMESA, glWindowPos4dMESA, NULL, 723),
+ NAME_FUNC_OFFSET(12399, glWindowPos4dvMESA, glWindowPos4dvMESA, NULL, 724),
+ NAME_FUNC_OFFSET(12418, glWindowPos4fMESA, glWindowPos4fMESA, NULL, 725),
+ NAME_FUNC_OFFSET(12436, glWindowPos4fvMESA, glWindowPos4fvMESA, NULL, 726),
+ NAME_FUNC_OFFSET(12455, glWindowPos4iMESA, glWindowPos4iMESA, NULL, 727),
+ NAME_FUNC_OFFSET(12473, glWindowPos4ivMESA, glWindowPos4ivMESA, NULL, 728),
+ NAME_FUNC_OFFSET(12492, glWindowPos4sMESA, glWindowPos4sMESA, NULL, 729),
+ NAME_FUNC_OFFSET(12510, glWindowPos4svMESA, glWindowPos4svMESA, NULL, 730),
+ NAME_FUNC_OFFSET(12529, gl_dispatch_stub_731, gl_dispatch_stub_731, NULL, 731),
+ NAME_FUNC_OFFSET(12554, gl_dispatch_stub_732, gl_dispatch_stub_732, NULL, 732),
+ NAME_FUNC_OFFSET(12581, gl_dispatch_stub_733, gl_dispatch_stub_733, NULL, 733),
+ NAME_FUNC_OFFSET(12598, gl_dispatch_stub_734, gl_dispatch_stub_734, NULL, 734),
+ NAME_FUNC_OFFSET(12614, gl_dispatch_stub_735, gl_dispatch_stub_735, NULL, 735),
+ NAME_FUNC_OFFSET(12628, gl_dispatch_stub_736, gl_dispatch_stub_736, NULL, 736),
+ NAME_FUNC_OFFSET(12643, gl_dispatch_stub_737, gl_dispatch_stub_737, NULL, 737),
+ NAME_FUNC_OFFSET(12655, gl_dispatch_stub_738, gl_dispatch_stub_738, NULL, 738),
+ NAME_FUNC_OFFSET(12668, gl_dispatch_stub_739, gl_dispatch_stub_739, NULL, 739),
+ NAME_FUNC_OFFSET(12682, glAreProgramsResidentNV, glAreProgramsResidentNV, NULL, 740),
+ NAME_FUNC_OFFSET(12706, glBindProgramNV, glBindProgramNV, NULL, 741),
+ NAME_FUNC_OFFSET(12722, glDeleteProgramsNV, glDeleteProgramsNV, NULL, 742),
+ NAME_FUNC_OFFSET(12741, glExecuteProgramNV, glExecuteProgramNV, NULL, 743),
+ NAME_FUNC_OFFSET(12760, glGenProgramsNV, glGenProgramsNV, NULL, 744),
+ NAME_FUNC_OFFSET(12776, glGetProgramParameterdvNV, glGetProgramParameterdvNV, NULL, 745),
+ NAME_FUNC_OFFSET(12802, glGetProgramParameterfvNV, glGetProgramParameterfvNV, NULL, 746),
+ NAME_FUNC_OFFSET(12828, glGetProgramStringNV, glGetProgramStringNV, NULL, 747),
+ NAME_FUNC_OFFSET(12849, glGetProgramivNV, glGetProgramivNV, NULL, 748),
+ NAME_FUNC_OFFSET(12866, glGetTrackMatrixivNV, glGetTrackMatrixivNV, NULL, 749),
+ NAME_FUNC_OFFSET(12887, glGetVertexAttribPointervNV, glGetVertexAttribPointervNV, NULL, 750),
+ NAME_FUNC_OFFSET(12915, glGetVertexAttribdvNV, glGetVertexAttribdvNV, NULL, 751),
+ NAME_FUNC_OFFSET(12937, glGetVertexAttribfvNV, glGetVertexAttribfvNV, NULL, 752),
+ NAME_FUNC_OFFSET(12959, glGetVertexAttribivNV, glGetVertexAttribivNV, NULL, 753),
+ NAME_FUNC_OFFSET(12981, glIsProgramNV, glIsProgramNV, NULL, 754),
+ NAME_FUNC_OFFSET(12995, glLoadProgramNV, glLoadProgramNV, NULL, 755),
+ NAME_FUNC_OFFSET(13011, glProgramParameters4dvNV, glProgramParameters4dvNV, NULL, 756),
+ NAME_FUNC_OFFSET(13036, glProgramParameters4fvNV, glProgramParameters4fvNV, NULL, 757),
+ NAME_FUNC_OFFSET(13061, glRequestResidentProgramsNV, glRequestResidentProgramsNV, NULL, 758),
+ NAME_FUNC_OFFSET(13089, glTrackMatrixNV, glTrackMatrixNV, NULL, 759),
+ NAME_FUNC_OFFSET(13105, glVertexAttrib1dNV, glVertexAttrib1dNV, NULL, 760),
+ NAME_FUNC_OFFSET(13124, glVertexAttrib1dvNV, glVertexAttrib1dvNV, NULL, 761),
+ NAME_FUNC_OFFSET(13144, glVertexAttrib1fNV, glVertexAttrib1fNV, NULL, 762),
+ NAME_FUNC_OFFSET(13163, glVertexAttrib1fvNV, glVertexAttrib1fvNV, NULL, 763),
+ NAME_FUNC_OFFSET(13183, glVertexAttrib1sNV, glVertexAttrib1sNV, NULL, 764),
+ NAME_FUNC_OFFSET(13202, glVertexAttrib1svNV, glVertexAttrib1svNV, NULL, 765),
+ NAME_FUNC_OFFSET(13222, glVertexAttrib2dNV, glVertexAttrib2dNV, NULL, 766),
+ NAME_FUNC_OFFSET(13241, glVertexAttrib2dvNV, glVertexAttrib2dvNV, NULL, 767),
+ NAME_FUNC_OFFSET(13261, glVertexAttrib2fNV, glVertexAttrib2fNV, NULL, 768),
+ NAME_FUNC_OFFSET(13280, glVertexAttrib2fvNV, glVertexAttrib2fvNV, NULL, 769),
+ NAME_FUNC_OFFSET(13300, glVertexAttrib2sNV, glVertexAttrib2sNV, NULL, 770),
+ NAME_FUNC_OFFSET(13319, glVertexAttrib2svNV, glVertexAttrib2svNV, NULL, 771),
+ NAME_FUNC_OFFSET(13339, glVertexAttrib3dNV, glVertexAttrib3dNV, NULL, 772),
+ NAME_FUNC_OFFSET(13358, glVertexAttrib3dvNV, glVertexAttrib3dvNV, NULL, 773),
+ NAME_FUNC_OFFSET(13378, glVertexAttrib3fNV, glVertexAttrib3fNV, NULL, 774),
+ NAME_FUNC_OFFSET(13397, glVertexAttrib3fvNV, glVertexAttrib3fvNV, NULL, 775),
+ NAME_FUNC_OFFSET(13417, glVertexAttrib3sNV, glVertexAttrib3sNV, NULL, 776),
+ NAME_FUNC_OFFSET(13436, glVertexAttrib3svNV, glVertexAttrib3svNV, NULL, 777),
+ NAME_FUNC_OFFSET(13456, glVertexAttrib4dNV, glVertexAttrib4dNV, NULL, 778),
+ NAME_FUNC_OFFSET(13475, glVertexAttrib4dvNV, glVertexAttrib4dvNV, NULL, 779),
+ NAME_FUNC_OFFSET(13495, glVertexAttrib4fNV, glVertexAttrib4fNV, NULL, 780),
+ NAME_FUNC_OFFSET(13514, glVertexAttrib4fvNV, glVertexAttrib4fvNV, NULL, 781),
+ NAME_FUNC_OFFSET(13534, glVertexAttrib4sNV, glVertexAttrib4sNV, NULL, 782),
+ NAME_FUNC_OFFSET(13553, glVertexAttrib4svNV, glVertexAttrib4svNV, NULL, 783),
+ NAME_FUNC_OFFSET(13573, glVertexAttrib4ubNV, glVertexAttrib4ubNV, NULL, 784),
+ NAME_FUNC_OFFSET(13593, glVertexAttrib4ubvNV, glVertexAttrib4ubvNV, NULL, 785),
+ NAME_FUNC_OFFSET(13614, glVertexAttribPointerNV, glVertexAttribPointerNV, NULL, 786),
+ NAME_FUNC_OFFSET(13638, glVertexAttribs1dvNV, glVertexAttribs1dvNV, NULL, 787),
+ NAME_FUNC_OFFSET(13659, glVertexAttribs1fvNV, glVertexAttribs1fvNV, NULL, 788),
+ NAME_FUNC_OFFSET(13680, glVertexAttribs1svNV, glVertexAttribs1svNV, NULL, 789),
+ NAME_FUNC_OFFSET(13701, glVertexAttribs2dvNV, glVertexAttribs2dvNV, NULL, 790),
+ NAME_FUNC_OFFSET(13722, glVertexAttribs2fvNV, glVertexAttribs2fvNV, NULL, 791),
+ NAME_FUNC_OFFSET(13743, glVertexAttribs2svNV, glVertexAttribs2svNV, NULL, 792),
+ NAME_FUNC_OFFSET(13764, glVertexAttribs3dvNV, glVertexAttribs3dvNV, NULL, 793),
+ NAME_FUNC_OFFSET(13785, glVertexAttribs3fvNV, glVertexAttribs3fvNV, NULL, 794),
+ NAME_FUNC_OFFSET(13806, glVertexAttribs3svNV, glVertexAttribs3svNV, NULL, 795),
+ NAME_FUNC_OFFSET(13827, glVertexAttribs4dvNV, glVertexAttribs4dvNV, NULL, 796),
+ NAME_FUNC_OFFSET(13848, glVertexAttribs4fvNV, glVertexAttribs4fvNV, NULL, 797),
+ NAME_FUNC_OFFSET(13869, glVertexAttribs4svNV, glVertexAttribs4svNV, NULL, 798),
+ NAME_FUNC_OFFSET(13890, glVertexAttribs4ubvNV, glVertexAttribs4ubvNV, NULL, 799),
+ NAME_FUNC_OFFSET(13912, glGetTexBumpParameterfvATI, glGetTexBumpParameterfvATI, NULL, 800),
+ NAME_FUNC_OFFSET(13939, glGetTexBumpParameterivATI, glGetTexBumpParameterivATI, NULL, 801),
+ NAME_FUNC_OFFSET(13966, glTexBumpParameterfvATI, glTexBumpParameterfvATI, NULL, 802),
+ NAME_FUNC_OFFSET(13990, glTexBumpParameterivATI, glTexBumpParameterivATI, NULL, 803),
+ NAME_FUNC_OFFSET(14014, glAlphaFragmentOp1ATI, glAlphaFragmentOp1ATI, NULL, 804),
+ NAME_FUNC_OFFSET(14036, glAlphaFragmentOp2ATI, glAlphaFragmentOp2ATI, NULL, 805),
+ NAME_FUNC_OFFSET(14058, glAlphaFragmentOp3ATI, glAlphaFragmentOp3ATI, NULL, 806),
+ NAME_FUNC_OFFSET(14080, glBeginFragmentShaderATI, glBeginFragmentShaderATI, NULL, 807),
+ NAME_FUNC_OFFSET(14105, glBindFragmentShaderATI, glBindFragmentShaderATI, NULL, 808),
+ NAME_FUNC_OFFSET(14129, glColorFragmentOp1ATI, glColorFragmentOp1ATI, NULL, 809),
+ NAME_FUNC_OFFSET(14151, glColorFragmentOp2ATI, glColorFragmentOp2ATI, NULL, 810),
+ NAME_FUNC_OFFSET(14173, glColorFragmentOp3ATI, glColorFragmentOp3ATI, NULL, 811),
+ NAME_FUNC_OFFSET(14195, glDeleteFragmentShaderATI, glDeleteFragmentShaderATI, NULL, 812),
+ NAME_FUNC_OFFSET(14221, glEndFragmentShaderATI, glEndFragmentShaderATI, NULL, 813),
+ NAME_FUNC_OFFSET(14244, glGenFragmentShadersATI, glGenFragmentShadersATI, NULL, 814),
+ NAME_FUNC_OFFSET(14268, glPassTexCoordATI, glPassTexCoordATI, NULL, 815),
+ NAME_FUNC_OFFSET(14286, glSampleMapATI, glSampleMapATI, NULL, 816),
+ NAME_FUNC_OFFSET(14301, glSetFragmentShaderConstantATI, glSetFragmentShaderConstantATI, NULL, 817),
+ NAME_FUNC_OFFSET(14332, glPointParameteriNV, glPointParameteriNV, NULL, 818),
+ NAME_FUNC_OFFSET(14352, glPointParameterivNV, glPointParameterivNV, NULL, 819),
+ NAME_FUNC_OFFSET(14373, gl_dispatch_stub_820, gl_dispatch_stub_820, NULL, 820),
+ NAME_FUNC_OFFSET(14396, gl_dispatch_stub_821, gl_dispatch_stub_821, NULL, 821),
+ NAME_FUNC_OFFSET(14419, gl_dispatch_stub_822, gl_dispatch_stub_822, NULL, 822),
+ NAME_FUNC_OFFSET(14445, gl_dispatch_stub_823, gl_dispatch_stub_823, NULL, 823),
+ NAME_FUNC_OFFSET(14468, gl_dispatch_stub_824, gl_dispatch_stub_824, NULL, 824),
+ NAME_FUNC_OFFSET(14489, glGetProgramNamedParameterdvNV, glGetProgramNamedParameterdvNV, NULL, 825),
+ NAME_FUNC_OFFSET(14520, glGetProgramNamedParameterfvNV, glGetProgramNamedParameterfvNV, NULL, 826),
+ NAME_FUNC_OFFSET(14551, glProgramNamedParameter4dNV, glProgramNamedParameter4dNV, NULL, 827),
+ NAME_FUNC_OFFSET(14579, glProgramNamedParameter4dvNV, glProgramNamedParameter4dvNV, NULL, 828),
+ NAME_FUNC_OFFSET(14608, glProgramNamedParameter4fNV, glProgramNamedParameter4fNV, NULL, 829),
+ NAME_FUNC_OFFSET(14636, glProgramNamedParameter4fvNV, glProgramNamedParameter4fvNV, NULL, 830),
+ NAME_FUNC_OFFSET(14665, glPrimitiveRestartIndexNV, glPrimitiveRestartIndexNV, NULL, 831),
+ NAME_FUNC_OFFSET(14691, glPrimitiveRestartNV, glPrimitiveRestartNV, NULL, 832),
+ NAME_FUNC_OFFSET(14712, gl_dispatch_stub_833, gl_dispatch_stub_833, NULL, 833),
+ NAME_FUNC_OFFSET(14729, gl_dispatch_stub_834, gl_dispatch_stub_834, NULL, 834),
+ NAME_FUNC_OFFSET(14756, glBindFramebufferEXT, glBindFramebufferEXT, NULL, 835),
+ NAME_FUNC_OFFSET(14777, glBindRenderbufferEXT, glBindRenderbufferEXT, NULL, 836),
+ NAME_FUNC_OFFSET(14799, glCheckFramebufferStatusEXT, glCheckFramebufferStatusEXT, NULL, 837),
+ NAME_FUNC_OFFSET(14827, glDeleteFramebuffersEXT, glDeleteFramebuffersEXT, NULL, 838),
+ NAME_FUNC_OFFSET(14851, glDeleteRenderbuffersEXT, glDeleteRenderbuffersEXT, NULL, 839),
+ NAME_FUNC_OFFSET(14876, glFramebufferRenderbufferEXT, glFramebufferRenderbufferEXT, NULL, 840),
+ NAME_FUNC_OFFSET(14905, glFramebufferTexture1DEXT, glFramebufferTexture1DEXT, NULL, 841),
+ NAME_FUNC_OFFSET(14931, glFramebufferTexture2DEXT, glFramebufferTexture2DEXT, NULL, 842),
+ NAME_FUNC_OFFSET(14957, glFramebufferTexture3DEXT, glFramebufferTexture3DEXT, NULL, 843),
+ NAME_FUNC_OFFSET(14983, glGenFramebuffersEXT, glGenFramebuffersEXT, NULL, 844),
+ NAME_FUNC_OFFSET(15004, glGenRenderbuffersEXT, glGenRenderbuffersEXT, NULL, 845),
+ NAME_FUNC_OFFSET(15026, glGenerateMipmapEXT, glGenerateMipmapEXT, NULL, 846),
+ NAME_FUNC_OFFSET(15046, glGetFramebufferAttachmentParameterivEXT, glGetFramebufferAttachmentParameterivEXT, NULL, 847),
+ NAME_FUNC_OFFSET(15087, glGetRenderbufferParameterivEXT, glGetRenderbufferParameterivEXT, NULL, 848),
+ NAME_FUNC_OFFSET(15119, glIsFramebufferEXT, glIsFramebufferEXT, NULL, 849),
+ NAME_FUNC_OFFSET(15138, glIsRenderbufferEXT, glIsRenderbufferEXT, NULL, 850),
+ NAME_FUNC_OFFSET(15158, glRenderbufferStorageEXT, glRenderbufferStorageEXT, NULL, 851),
+ NAME_FUNC_OFFSET(15183, gl_dispatch_stub_852, gl_dispatch_stub_852, NULL, 852),
+ NAME_FUNC_OFFSET(15204, gl_dispatch_stub_853, gl_dispatch_stub_853, NULL, 853),
+ NAME_FUNC_OFFSET(15228, gl_dispatch_stub_854, gl_dispatch_stub_854, NULL, 854),
+ NAME_FUNC_OFFSET(15258, glBindFragDataLocationEXT, glBindFragDataLocationEXT, NULL, 855),
+ NAME_FUNC_OFFSET(15284, glGetFragDataLocationEXT, glGetFragDataLocationEXT, NULL, 856),
+ NAME_FUNC_OFFSET(15309, glGetUniformuivEXT, glGetUniformuivEXT, NULL, 857),
+ NAME_FUNC_OFFSET(15328, glGetVertexAttribIivEXT, glGetVertexAttribIivEXT, NULL, 858),
+ NAME_FUNC_OFFSET(15352, glGetVertexAttribIuivEXT, glGetVertexAttribIuivEXT, NULL, 859),
+ NAME_FUNC_OFFSET(15377, glUniform1uiEXT, glUniform1uiEXT, NULL, 860),
+ NAME_FUNC_OFFSET(15393, glUniform1uivEXT, glUniform1uivEXT, NULL, 861),
+ NAME_FUNC_OFFSET(15410, glUniform2uiEXT, glUniform2uiEXT, NULL, 862),
+ NAME_FUNC_OFFSET(15426, glUniform2uivEXT, glUniform2uivEXT, NULL, 863),
+ NAME_FUNC_OFFSET(15443, glUniform3uiEXT, glUniform3uiEXT, NULL, 864),
+ NAME_FUNC_OFFSET(15459, glUniform3uivEXT, glUniform3uivEXT, NULL, 865),
+ NAME_FUNC_OFFSET(15476, glUniform4uiEXT, glUniform4uiEXT, NULL, 866),
+ NAME_FUNC_OFFSET(15492, glUniform4uivEXT, glUniform4uivEXT, NULL, 867),
+ NAME_FUNC_OFFSET(15509, glVertexAttribI1iEXT, glVertexAttribI1iEXT, NULL, 868),
+ NAME_FUNC_OFFSET(15530, glVertexAttribI1ivEXT, glVertexAttribI1ivEXT, NULL, 869),
+ NAME_FUNC_OFFSET(15552, glVertexAttribI1uiEXT, glVertexAttribI1uiEXT, NULL, 870),
+ NAME_FUNC_OFFSET(15574, glVertexAttribI1uivEXT, glVertexAttribI1uivEXT, NULL, 871),
+ NAME_FUNC_OFFSET(15597, glVertexAttribI2iEXT, glVertexAttribI2iEXT, NULL, 872),
+ NAME_FUNC_OFFSET(15618, glVertexAttribI2ivEXT, glVertexAttribI2ivEXT, NULL, 873),
+ NAME_FUNC_OFFSET(15640, glVertexAttribI2uiEXT, glVertexAttribI2uiEXT, NULL, 874),
+ NAME_FUNC_OFFSET(15662, glVertexAttribI2uivEXT, glVertexAttribI2uivEXT, NULL, 875),
+ NAME_FUNC_OFFSET(15685, glVertexAttribI3iEXT, glVertexAttribI3iEXT, NULL, 876),
+ NAME_FUNC_OFFSET(15706, glVertexAttribI3ivEXT, glVertexAttribI3ivEXT, NULL, 877),
+ NAME_FUNC_OFFSET(15728, glVertexAttribI3uiEXT, glVertexAttribI3uiEXT, NULL, 878),
+ NAME_FUNC_OFFSET(15750, glVertexAttribI3uivEXT, glVertexAttribI3uivEXT, NULL, 879),
+ NAME_FUNC_OFFSET(15773, glVertexAttribI4bvEXT, glVertexAttribI4bvEXT, NULL, 880),
+ NAME_FUNC_OFFSET(15795, glVertexAttribI4iEXT, glVertexAttribI4iEXT, NULL, 881),
+ NAME_FUNC_OFFSET(15816, glVertexAttribI4ivEXT, glVertexAttribI4ivEXT, NULL, 882),
+ NAME_FUNC_OFFSET(15838, glVertexAttribI4svEXT, glVertexAttribI4svEXT, NULL, 883),
+ NAME_FUNC_OFFSET(15860, glVertexAttribI4ubvEXT, glVertexAttribI4ubvEXT, NULL, 884),
+ NAME_FUNC_OFFSET(15883, glVertexAttribI4uiEXT, glVertexAttribI4uiEXT, NULL, 885),
+ NAME_FUNC_OFFSET(15905, glVertexAttribI4uivEXT, glVertexAttribI4uivEXT, NULL, 886),
+ NAME_FUNC_OFFSET(15928, glVertexAttribI4usvEXT, glVertexAttribI4usvEXT, NULL, 887),
+ NAME_FUNC_OFFSET(15951, glVertexAttribIPointerEXT, glVertexAttribIPointerEXT, NULL, 888),
+ NAME_FUNC_OFFSET(15977, glFramebufferTextureLayerEXT, glFramebufferTextureLayerEXT, NULL, 889),
+ NAME_FUNC_OFFSET(16006, glColorMaskIndexedEXT, glColorMaskIndexedEXT, NULL, 890),
+ NAME_FUNC_OFFSET(16028, glDisableIndexedEXT, glDisableIndexedEXT, NULL, 891),
+ NAME_FUNC_OFFSET(16048, glEnableIndexedEXT, glEnableIndexedEXT, NULL, 892),
+ NAME_FUNC_OFFSET(16067, glGetBooleanIndexedvEXT, glGetBooleanIndexedvEXT, NULL, 893),
+ NAME_FUNC_OFFSET(16091, glGetIntegerIndexedvEXT, glGetIntegerIndexedvEXT, NULL, 894),
+ NAME_FUNC_OFFSET(16115, glIsEnabledIndexedEXT, glIsEnabledIndexedEXT, NULL, 895),
+ NAME_FUNC_OFFSET(16137, glClearColorIiEXT, glClearColorIiEXT, NULL, 896),
+ NAME_FUNC_OFFSET(16155, glClearColorIuiEXT, glClearColorIuiEXT, NULL, 897),
+ NAME_FUNC_OFFSET(16174, glGetTexParameterIivEXT, glGetTexParameterIivEXT, NULL, 898),
+ NAME_FUNC_OFFSET(16198, glGetTexParameterIuivEXT, glGetTexParameterIuivEXT, NULL, 899),
+ NAME_FUNC_OFFSET(16223, glTexParameterIivEXT, glTexParameterIivEXT, NULL, 900),
+ NAME_FUNC_OFFSET(16244, glTexParameterIuivEXT, glTexParameterIuivEXT, NULL, 901),
+ NAME_FUNC_OFFSET(16266, glBeginConditionalRenderNV, glBeginConditionalRenderNV, NULL, 902),
+ NAME_FUNC_OFFSET(16293, glEndConditionalRenderNV, glEndConditionalRenderNV, NULL, 903),
+ NAME_FUNC_OFFSET(16318, glBeginTransformFeedbackEXT, glBeginTransformFeedbackEXT, NULL, 904),
+ NAME_FUNC_OFFSET(16346, glBindBufferBaseEXT, glBindBufferBaseEXT, NULL, 905),
+ NAME_FUNC_OFFSET(16366, glBindBufferOffsetEXT, glBindBufferOffsetEXT, NULL, 906),
+ NAME_FUNC_OFFSET(16388, glBindBufferRangeEXT, glBindBufferRangeEXT, NULL, 907),
+ NAME_FUNC_OFFSET(16409, glEndTransformFeedbackEXT, glEndTransformFeedbackEXT, NULL, 908),
+ NAME_FUNC_OFFSET(16435, glGetTransformFeedbackVaryingEXT, glGetTransformFeedbackVaryingEXT, NULL, 909),
+ NAME_FUNC_OFFSET(16468, glTransformFeedbackVaryingsEXT, glTransformFeedbackVaryingsEXT, NULL, 910),
+ NAME_FUNC_OFFSET(16499, glProvokingVertexEXT, glProvokingVertexEXT, NULL, 911),
+ NAME_FUNC_OFFSET(16520, gl_dispatch_stub_912, gl_dispatch_stub_912, NULL, 912),
+ NAME_FUNC_OFFSET(16551, gl_dispatch_stub_913, gl_dispatch_stub_913, NULL, 913),
+ NAME_FUNC_OFFSET(16571, glGetObjectParameterivAPPLE, glGetObjectParameterivAPPLE, NULL, 914),
+ NAME_FUNC_OFFSET(16599, glObjectPurgeableAPPLE, glObjectPurgeableAPPLE, NULL, 915),
+ NAME_FUNC_OFFSET(16622, glObjectUnpurgeableAPPLE, glObjectUnpurgeableAPPLE, NULL, 916),
+ NAME_FUNC_OFFSET(16647, glActiveProgramEXT, glActiveProgramEXT, NULL, 917),
+ NAME_FUNC_OFFSET(16666, glCreateShaderProgramEXT, glCreateShaderProgramEXT, NULL, 918),
+ NAME_FUNC_OFFSET(16691, glUseShaderProgramEXT, glUseShaderProgramEXT, NULL, 919),
+ NAME_FUNC_OFFSET(16713, glTextureBarrierNV, glTextureBarrierNV, NULL, 920),
+ NAME_FUNC_OFFSET(16732, gl_dispatch_stub_921, gl_dispatch_stub_921, NULL, 921),
+ NAME_FUNC_OFFSET(16757, gl_dispatch_stub_922, gl_dispatch_stub_922, NULL, 922),
+ NAME_FUNC_OFFSET(16786, gl_dispatch_stub_923, gl_dispatch_stub_923, NULL, 923),
+ NAME_FUNC_OFFSET(16817, gl_dispatch_stub_924, gl_dispatch_stub_924, NULL, 924),
+ NAME_FUNC_OFFSET(16841, gl_dispatch_stub_925, gl_dispatch_stub_925, NULL, 925),
+ NAME_FUNC_OFFSET(16866, glEGLImageTargetRenderbufferStorageOES, glEGLImageTargetRenderbufferStorageOES, NULL, 926),
+ NAME_FUNC_OFFSET(16905, glEGLImageTargetTexture2DOES, glEGLImageTargetTexture2DOES, NULL, 927),
+ NAME_FUNC_OFFSET(16934, glArrayElement, glArrayElement, NULL, 306),
+ NAME_FUNC_OFFSET(16952, glBindTexture, glBindTexture, NULL, 307),
+ NAME_FUNC_OFFSET(16969, glDrawArrays, glDrawArrays, NULL, 310),
+ NAME_FUNC_OFFSET(16985, glAreTexturesResident, glAreTexturesResidentEXT, glAreTexturesResidentEXT, 322),
+ NAME_FUNC_OFFSET(17010, glCopyTexImage1D, glCopyTexImage1D, NULL, 323),
+ NAME_FUNC_OFFSET(17030, glCopyTexImage2D, glCopyTexImage2D, NULL, 324),
+ NAME_FUNC_OFFSET(17050, glCopyTexSubImage1D, glCopyTexSubImage1D, NULL, 325),
+ NAME_FUNC_OFFSET(17073, glCopyTexSubImage2D, glCopyTexSubImage2D, NULL, 326),
+ NAME_FUNC_OFFSET(17096, glDeleteTextures, glDeleteTexturesEXT, glDeleteTexturesEXT, 327),
+ NAME_FUNC_OFFSET(17116, glGenTextures, glGenTexturesEXT, glGenTexturesEXT, 328),
+ NAME_FUNC_OFFSET(17133, glGetPointerv, glGetPointerv, NULL, 329),
+ NAME_FUNC_OFFSET(17150, glIsTexture, glIsTextureEXT, glIsTextureEXT, 330),
+ NAME_FUNC_OFFSET(17165, glPrioritizeTextures, glPrioritizeTextures, NULL, 331),
+ NAME_FUNC_OFFSET(17189, glTexSubImage1D, glTexSubImage1D, NULL, 332),
+ NAME_FUNC_OFFSET(17208, glTexSubImage2D, glTexSubImage2D, NULL, 333),
+ NAME_FUNC_OFFSET(17227, glBlendColor, glBlendColor, NULL, 336),
+ NAME_FUNC_OFFSET(17243, glBlendEquation, glBlendEquation, NULL, 337),
+ NAME_FUNC_OFFSET(17262, glDrawRangeElements, glDrawRangeElements, NULL, 338),
+ NAME_FUNC_OFFSET(17285, glColorTable, glColorTable, NULL, 339),
+ NAME_FUNC_OFFSET(17301, glColorTable, glColorTable, NULL, 339),
+ NAME_FUNC_OFFSET(17317, glColorTableParameterfv, glColorTableParameterfv, NULL, 340),
+ NAME_FUNC_OFFSET(17344, glColorTableParameteriv, glColorTableParameteriv, NULL, 341),
+ NAME_FUNC_OFFSET(17371, glCopyColorTable, glCopyColorTable, NULL, 342),
+ NAME_FUNC_OFFSET(17391, glGetColorTable, glGetColorTableEXT, glGetColorTableEXT, 343),
+ NAME_FUNC_OFFSET(17410, glGetColorTable, glGetColorTableEXT, glGetColorTableEXT, 343),
+ NAME_FUNC_OFFSET(17429, glGetColorTableParameterfv, glGetColorTableParameterfvEXT, glGetColorTableParameterfvEXT, 344),
+ NAME_FUNC_OFFSET(17459, glGetColorTableParameterfv, glGetColorTableParameterfvEXT, glGetColorTableParameterfvEXT, 344),
+ NAME_FUNC_OFFSET(17489, glGetColorTableParameteriv, glGetColorTableParameterivEXT, glGetColorTableParameterivEXT, 345),
+ NAME_FUNC_OFFSET(17519, glGetColorTableParameteriv, glGetColorTableParameterivEXT, glGetColorTableParameterivEXT, 345),
+ NAME_FUNC_OFFSET(17549, glColorSubTable, glColorSubTable, NULL, 346),
+ NAME_FUNC_OFFSET(17568, glCopyColorSubTable, glCopyColorSubTable, NULL, 347),
+ NAME_FUNC_OFFSET(17591, glConvolutionFilter1D, glConvolutionFilter1D, NULL, 348),
+ NAME_FUNC_OFFSET(17616, glConvolutionFilter2D, glConvolutionFilter2D, NULL, 349),
+ NAME_FUNC_OFFSET(17641, glConvolutionParameterf, glConvolutionParameterf, NULL, 350),
+ NAME_FUNC_OFFSET(17668, glConvolutionParameterfv, glConvolutionParameterfv, NULL, 351),
+ NAME_FUNC_OFFSET(17696, glConvolutionParameteri, glConvolutionParameteri, NULL, 352),
+ NAME_FUNC_OFFSET(17723, glConvolutionParameteriv, glConvolutionParameteriv, NULL, 353),
+ NAME_FUNC_OFFSET(17751, glCopyConvolutionFilter1D, glCopyConvolutionFilter1D, NULL, 354),
+ NAME_FUNC_OFFSET(17780, glCopyConvolutionFilter2D, glCopyConvolutionFilter2D, NULL, 355),
+ NAME_FUNC_OFFSET(17809, glGetConvolutionFilter, gl_dispatch_stub_356, gl_dispatch_stub_356, 356),
+ NAME_FUNC_OFFSET(17835, glGetConvolutionParameterfv, gl_dispatch_stub_357, gl_dispatch_stub_357, 357),
+ NAME_FUNC_OFFSET(17866, glGetConvolutionParameteriv, gl_dispatch_stub_358, gl_dispatch_stub_358, 358),
+ NAME_FUNC_OFFSET(17897, glGetSeparableFilter, gl_dispatch_stub_359, gl_dispatch_stub_359, 359),
+ NAME_FUNC_OFFSET(17921, glSeparableFilter2D, glSeparableFilter2D, NULL, 360),
+ NAME_FUNC_OFFSET(17944, glGetHistogram, gl_dispatch_stub_361, gl_dispatch_stub_361, 361),
+ NAME_FUNC_OFFSET(17962, glGetHistogramParameterfv, gl_dispatch_stub_362, gl_dispatch_stub_362, 362),
+ NAME_FUNC_OFFSET(17991, glGetHistogramParameteriv, gl_dispatch_stub_363, gl_dispatch_stub_363, 363),
+ NAME_FUNC_OFFSET(18020, glGetMinmax, gl_dispatch_stub_364, gl_dispatch_stub_364, 364),
+ NAME_FUNC_OFFSET(18035, glGetMinmaxParameterfv, gl_dispatch_stub_365, gl_dispatch_stub_365, 365),
+ NAME_FUNC_OFFSET(18061, glGetMinmaxParameteriv, gl_dispatch_stub_366, gl_dispatch_stub_366, 366),
+ NAME_FUNC_OFFSET(18087, glHistogram, glHistogram, NULL, 367),
+ NAME_FUNC_OFFSET(18102, glMinmax, glMinmax, NULL, 368),
+ NAME_FUNC_OFFSET(18114, glResetHistogram, glResetHistogram, NULL, 369),
+ NAME_FUNC_OFFSET(18134, glResetMinmax, glResetMinmax, NULL, 370),
+ NAME_FUNC_OFFSET(18151, glTexImage3D, glTexImage3D, NULL, 371),
+ NAME_FUNC_OFFSET(18167, glTexSubImage3D, glTexSubImage3D, NULL, 372),
+ NAME_FUNC_OFFSET(18186, glCopyTexSubImage3D, glCopyTexSubImage3D, NULL, 373),
+ NAME_FUNC_OFFSET(18209, glActiveTextureARB, glActiveTextureARB, NULL, 374),
+ NAME_FUNC_OFFSET(18225, glClientActiveTextureARB, glClientActiveTextureARB, NULL, 375),
+ NAME_FUNC_OFFSET(18247, glMultiTexCoord1dARB, glMultiTexCoord1dARB, NULL, 376),
+ NAME_FUNC_OFFSET(18265, glMultiTexCoord1dvARB, glMultiTexCoord1dvARB, NULL, 377),
+ NAME_FUNC_OFFSET(18284, glMultiTexCoord1fARB, glMultiTexCoord1fARB, NULL, 378),
+ NAME_FUNC_OFFSET(18302, glMultiTexCoord1fvARB, glMultiTexCoord1fvARB, NULL, 379),
+ NAME_FUNC_OFFSET(18321, glMultiTexCoord1iARB, glMultiTexCoord1iARB, NULL, 380),
+ NAME_FUNC_OFFSET(18339, glMultiTexCoord1ivARB, glMultiTexCoord1ivARB, NULL, 381),
+ NAME_FUNC_OFFSET(18358, glMultiTexCoord1sARB, glMultiTexCoord1sARB, NULL, 382),
+ NAME_FUNC_OFFSET(18376, glMultiTexCoord1svARB, glMultiTexCoord1svARB, NULL, 383),
+ NAME_FUNC_OFFSET(18395, glMultiTexCoord2dARB, glMultiTexCoord2dARB, NULL, 384),
+ NAME_FUNC_OFFSET(18413, glMultiTexCoord2dvARB, glMultiTexCoord2dvARB, NULL, 385),
+ NAME_FUNC_OFFSET(18432, glMultiTexCoord2fARB, glMultiTexCoord2fARB, NULL, 386),
+ NAME_FUNC_OFFSET(18450, glMultiTexCoord2fvARB, glMultiTexCoord2fvARB, NULL, 387),
+ NAME_FUNC_OFFSET(18469, glMultiTexCoord2iARB, glMultiTexCoord2iARB, NULL, 388),
+ NAME_FUNC_OFFSET(18487, glMultiTexCoord2ivARB, glMultiTexCoord2ivARB, NULL, 389),
+ NAME_FUNC_OFFSET(18506, glMultiTexCoord2sARB, glMultiTexCoord2sARB, NULL, 390),
+ NAME_FUNC_OFFSET(18524, glMultiTexCoord2svARB, glMultiTexCoord2svARB, NULL, 391),
+ NAME_FUNC_OFFSET(18543, glMultiTexCoord3dARB, glMultiTexCoord3dARB, NULL, 392),
+ NAME_FUNC_OFFSET(18561, glMultiTexCoord3dvARB, glMultiTexCoord3dvARB, NULL, 393),
+ NAME_FUNC_OFFSET(18580, glMultiTexCoord3fARB, glMultiTexCoord3fARB, NULL, 394),
+ NAME_FUNC_OFFSET(18598, glMultiTexCoord3fvARB, glMultiTexCoord3fvARB, NULL, 395),
+ NAME_FUNC_OFFSET(18617, glMultiTexCoord3iARB, glMultiTexCoord3iARB, NULL, 396),
+ NAME_FUNC_OFFSET(18635, glMultiTexCoord3ivARB, glMultiTexCoord3ivARB, NULL, 397),
+ NAME_FUNC_OFFSET(18654, glMultiTexCoord3sARB, glMultiTexCoord3sARB, NULL, 398),
+ NAME_FUNC_OFFSET(18672, glMultiTexCoord3svARB, glMultiTexCoord3svARB, NULL, 399),
+ NAME_FUNC_OFFSET(18691, glMultiTexCoord4dARB, glMultiTexCoord4dARB, NULL, 400),
+ NAME_FUNC_OFFSET(18709, glMultiTexCoord4dvARB, glMultiTexCoord4dvARB, NULL, 401),
+ NAME_FUNC_OFFSET(18728, glMultiTexCoord4fARB, glMultiTexCoord4fARB, NULL, 402),
+ NAME_FUNC_OFFSET(18746, glMultiTexCoord4fvARB, glMultiTexCoord4fvARB, NULL, 403),
+ NAME_FUNC_OFFSET(18765, glMultiTexCoord4iARB, glMultiTexCoord4iARB, NULL, 404),
+ NAME_FUNC_OFFSET(18783, glMultiTexCoord4ivARB, glMultiTexCoord4ivARB, NULL, 405),
+ NAME_FUNC_OFFSET(18802, glMultiTexCoord4sARB, glMultiTexCoord4sARB, NULL, 406),
+ NAME_FUNC_OFFSET(18820, glMultiTexCoord4svARB, glMultiTexCoord4svARB, NULL, 407),
+ NAME_FUNC_OFFSET(18839, glStencilOpSeparate, glStencilOpSeparate, NULL, 423),
+ NAME_FUNC_OFFSET(18862, glLoadTransposeMatrixdARB, glLoadTransposeMatrixdARB, NULL, 441),
+ NAME_FUNC_OFFSET(18885, glLoadTransposeMatrixfARB, glLoadTransposeMatrixfARB, NULL, 442),
+ NAME_FUNC_OFFSET(18908, glMultTransposeMatrixdARB, glMultTransposeMatrixdARB, NULL, 443),
+ NAME_FUNC_OFFSET(18931, glMultTransposeMatrixfARB, glMultTransposeMatrixfARB, NULL, 444),
+ NAME_FUNC_OFFSET(18954, glSampleCoverageARB, glSampleCoverageARB, NULL, 445),
+ NAME_FUNC_OFFSET(18971, glCompressedTexImage1DARB, glCompressedTexImage1DARB, NULL, 446),
+ NAME_FUNC_OFFSET(18994, glCompressedTexImage2DARB, glCompressedTexImage2DARB, NULL, 447),
+ NAME_FUNC_OFFSET(19017, glCompressedTexImage3DARB, glCompressedTexImage3DARB, NULL, 448),
+ NAME_FUNC_OFFSET(19040, glCompressedTexSubImage1DARB, glCompressedTexSubImage1DARB, NULL, 449),
+ NAME_FUNC_OFFSET(19066, glCompressedTexSubImage2DARB, glCompressedTexSubImage2DARB, NULL, 450),
+ NAME_FUNC_OFFSET(19092, glCompressedTexSubImage3DARB, glCompressedTexSubImage3DARB, NULL, 451),
+ NAME_FUNC_OFFSET(19118, glGetCompressedTexImageARB, glGetCompressedTexImageARB, NULL, 452),
+ NAME_FUNC_OFFSET(19142, glDisableVertexAttribArrayARB, glDisableVertexAttribArrayARB, NULL, 453),
+ NAME_FUNC_OFFSET(19169, glEnableVertexAttribArrayARB, glEnableVertexAttribArrayARB, NULL, 454),
+ NAME_FUNC_OFFSET(19195, glGetVertexAttribdvARB, glGetVertexAttribdvARB, NULL, 461),
+ NAME_FUNC_OFFSET(19215, glGetVertexAttribfvARB, glGetVertexAttribfvARB, NULL, 462),
+ NAME_FUNC_OFFSET(19235, glGetVertexAttribivARB, glGetVertexAttribivARB, NULL, 463),
+ NAME_FUNC_OFFSET(19255, glProgramEnvParameter4dARB, glProgramEnvParameter4dARB, NULL, 464),
+ NAME_FUNC_OFFSET(19278, glProgramEnvParameter4dvARB, glProgramEnvParameter4dvARB, NULL, 465),
+ NAME_FUNC_OFFSET(19302, glProgramEnvParameter4fARB, glProgramEnvParameter4fARB, NULL, 466),
+ NAME_FUNC_OFFSET(19325, glProgramEnvParameter4fvARB, glProgramEnvParameter4fvARB, NULL, 467),
+ NAME_FUNC_OFFSET(19349, glVertexAttrib1dARB, glVertexAttrib1dARB, NULL, 473),
+ NAME_FUNC_OFFSET(19366, glVertexAttrib1dvARB, glVertexAttrib1dvARB, NULL, 474),
+ NAME_FUNC_OFFSET(19384, glVertexAttrib1fARB, glVertexAttrib1fARB, NULL, 475),
+ NAME_FUNC_OFFSET(19401, glVertexAttrib1fvARB, glVertexAttrib1fvARB, NULL, 476),
+ NAME_FUNC_OFFSET(19419, glVertexAttrib1sARB, glVertexAttrib1sARB, NULL, 477),
+ NAME_FUNC_OFFSET(19436, glVertexAttrib1svARB, glVertexAttrib1svARB, NULL, 478),
+ NAME_FUNC_OFFSET(19454, glVertexAttrib2dARB, glVertexAttrib2dARB, NULL, 479),
+ NAME_FUNC_OFFSET(19471, glVertexAttrib2dvARB, glVertexAttrib2dvARB, NULL, 480),
+ NAME_FUNC_OFFSET(19489, glVertexAttrib2fARB, glVertexAttrib2fARB, NULL, 481),
+ NAME_FUNC_OFFSET(19506, glVertexAttrib2fvARB, glVertexAttrib2fvARB, NULL, 482),
+ NAME_FUNC_OFFSET(19524, glVertexAttrib2sARB, glVertexAttrib2sARB, NULL, 483),
+ NAME_FUNC_OFFSET(19541, glVertexAttrib2svARB, glVertexAttrib2svARB, NULL, 484),
+ NAME_FUNC_OFFSET(19559, glVertexAttrib3dARB, glVertexAttrib3dARB, NULL, 485),
+ NAME_FUNC_OFFSET(19576, glVertexAttrib3dvARB, glVertexAttrib3dvARB, NULL, 486),
+ NAME_FUNC_OFFSET(19594, glVertexAttrib3fARB, glVertexAttrib3fARB, NULL, 487),
+ NAME_FUNC_OFFSET(19611, glVertexAttrib3fvARB, glVertexAttrib3fvARB, NULL, 488),
+ NAME_FUNC_OFFSET(19629, glVertexAttrib3sARB, glVertexAttrib3sARB, NULL, 489),
+ NAME_FUNC_OFFSET(19646, glVertexAttrib3svARB, glVertexAttrib3svARB, NULL, 490),
+ NAME_FUNC_OFFSET(19664, glVertexAttrib4NbvARB, glVertexAttrib4NbvARB, NULL, 491),
+ NAME_FUNC_OFFSET(19683, glVertexAttrib4NivARB, glVertexAttrib4NivARB, NULL, 492),
+ NAME_FUNC_OFFSET(19702, glVertexAttrib4NsvARB, glVertexAttrib4NsvARB, NULL, 493),
+ NAME_FUNC_OFFSET(19721, glVertexAttrib4NubARB, glVertexAttrib4NubARB, NULL, 494),
+ NAME_FUNC_OFFSET(19740, glVertexAttrib4NubvARB, glVertexAttrib4NubvARB, NULL, 495),
+ NAME_FUNC_OFFSET(19760, glVertexAttrib4NuivARB, glVertexAttrib4NuivARB, NULL, 496),
+ NAME_FUNC_OFFSET(19780, glVertexAttrib4NusvARB, glVertexAttrib4NusvARB, NULL, 497),
+ NAME_FUNC_OFFSET(19800, glVertexAttrib4bvARB, glVertexAttrib4bvARB, NULL, 498),
+ NAME_FUNC_OFFSET(19818, glVertexAttrib4dARB, glVertexAttrib4dARB, NULL, 499),
+ NAME_FUNC_OFFSET(19835, glVertexAttrib4dvARB, glVertexAttrib4dvARB, NULL, 500),
+ NAME_FUNC_OFFSET(19853, glVertexAttrib4fARB, glVertexAttrib4fARB, NULL, 501),
+ NAME_FUNC_OFFSET(19870, glVertexAttrib4fvARB, glVertexAttrib4fvARB, NULL, 502),
+ NAME_FUNC_OFFSET(19888, glVertexAttrib4ivARB, glVertexAttrib4ivARB, NULL, 503),
+ NAME_FUNC_OFFSET(19906, glVertexAttrib4sARB, glVertexAttrib4sARB, NULL, 504),
+ NAME_FUNC_OFFSET(19923, glVertexAttrib4svARB, glVertexAttrib4svARB, NULL, 505),
+ NAME_FUNC_OFFSET(19941, glVertexAttrib4ubvARB, glVertexAttrib4ubvARB, NULL, 506),
+ NAME_FUNC_OFFSET(19960, glVertexAttrib4uivARB, glVertexAttrib4uivARB, NULL, 507),
+ NAME_FUNC_OFFSET(19979, glVertexAttrib4usvARB, glVertexAttrib4usvARB, NULL, 508),
+ NAME_FUNC_OFFSET(19998, glVertexAttribPointerARB, glVertexAttribPointerARB, NULL, 509),
+ NAME_FUNC_OFFSET(20020, glBindBufferARB, glBindBufferARB, NULL, 510),
+ NAME_FUNC_OFFSET(20033, glBufferDataARB, glBufferDataARB, NULL, 511),
+ NAME_FUNC_OFFSET(20046, glBufferSubDataARB, glBufferSubDataARB, NULL, 512),
+ NAME_FUNC_OFFSET(20062, glDeleteBuffersARB, glDeleteBuffersARB, NULL, 513),
+ NAME_FUNC_OFFSET(20078, glGenBuffersARB, glGenBuffersARB, NULL, 514),
+ NAME_FUNC_OFFSET(20091, glGetBufferParameterivARB, glGetBufferParameterivARB, NULL, 515),
+ NAME_FUNC_OFFSET(20114, glGetBufferPointervARB, glGetBufferPointervARB, NULL, 516),
+ NAME_FUNC_OFFSET(20134, glGetBufferSubDataARB, glGetBufferSubDataARB, NULL, 517),
+ NAME_FUNC_OFFSET(20153, glIsBufferARB, glIsBufferARB, NULL, 518),
+ NAME_FUNC_OFFSET(20164, glMapBufferARB, glMapBufferARB, NULL, 519),
+ NAME_FUNC_OFFSET(20176, glUnmapBufferARB, glUnmapBufferARB, NULL, 520),
+ NAME_FUNC_OFFSET(20190, glBeginQueryARB, glBeginQueryARB, NULL, 521),
+ NAME_FUNC_OFFSET(20203, glDeleteQueriesARB, glDeleteQueriesARB, NULL, 522),
+ NAME_FUNC_OFFSET(20219, glEndQueryARB, glEndQueryARB, NULL, 523),
+ NAME_FUNC_OFFSET(20230, glGenQueriesARB, glGenQueriesARB, NULL, 524),
+ NAME_FUNC_OFFSET(20243, glGetQueryObjectivARB, glGetQueryObjectivARB, NULL, 525),
+ NAME_FUNC_OFFSET(20262, glGetQueryObjectuivARB, glGetQueryObjectuivARB, NULL, 526),
+ NAME_FUNC_OFFSET(20282, glGetQueryivARB, glGetQueryivARB, NULL, 527),
+ NAME_FUNC_OFFSET(20295, glIsQueryARB, glIsQueryARB, NULL, 528),
+ NAME_FUNC_OFFSET(20305, glCompileShaderARB, glCompileShaderARB, NULL, 530),
+ NAME_FUNC_OFFSET(20321, glGetActiveUniformARB, glGetActiveUniformARB, NULL, 535),
+ NAME_FUNC_OFFSET(20340, glGetShaderSourceARB, glGetShaderSourceARB, NULL, 541),
+ NAME_FUNC_OFFSET(20358, glGetUniformLocationARB, glGetUniformLocationARB, NULL, 542),
+ NAME_FUNC_OFFSET(20379, glGetUniformfvARB, glGetUniformfvARB, NULL, 543),
+ NAME_FUNC_OFFSET(20394, glGetUniformivARB, glGetUniformivARB, NULL, 544),
+ NAME_FUNC_OFFSET(20409, glLinkProgramARB, glLinkProgramARB, NULL, 545),
+ NAME_FUNC_OFFSET(20423, glShaderSourceARB, glShaderSourceARB, NULL, 546),
+ NAME_FUNC_OFFSET(20438, glUniform1fARB, glUniform1fARB, NULL, 547),
+ NAME_FUNC_OFFSET(20450, glUniform1fvARB, glUniform1fvARB, NULL, 548),
+ NAME_FUNC_OFFSET(20463, glUniform1iARB, glUniform1iARB, NULL, 549),
+ NAME_FUNC_OFFSET(20475, glUniform1ivARB, glUniform1ivARB, NULL, 550),
+ NAME_FUNC_OFFSET(20488, glUniform2fARB, glUniform2fARB, NULL, 551),
+ NAME_FUNC_OFFSET(20500, glUniform2fvARB, glUniform2fvARB, NULL, 552),
+ NAME_FUNC_OFFSET(20513, glUniform2iARB, glUniform2iARB, NULL, 553),
+ NAME_FUNC_OFFSET(20525, glUniform2ivARB, glUniform2ivARB, NULL, 554),
+ NAME_FUNC_OFFSET(20538, glUniform3fARB, glUniform3fARB, NULL, 555),
+ NAME_FUNC_OFFSET(20550, glUniform3fvARB, glUniform3fvARB, NULL, 556),
+ NAME_FUNC_OFFSET(20563, glUniform3iARB, glUniform3iARB, NULL, 557),
+ NAME_FUNC_OFFSET(20575, glUniform3ivARB, glUniform3ivARB, NULL, 558),
+ NAME_FUNC_OFFSET(20588, glUniform4fARB, glUniform4fARB, NULL, 559),
+ NAME_FUNC_OFFSET(20600, glUniform4fvARB, glUniform4fvARB, NULL, 560),
+ NAME_FUNC_OFFSET(20613, glUniform4iARB, glUniform4iARB, NULL, 561),
+ NAME_FUNC_OFFSET(20625, glUniform4ivARB, glUniform4ivARB, NULL, 562),
+ NAME_FUNC_OFFSET(20638, glUniformMatrix2fvARB, glUniformMatrix2fvARB, NULL, 563),
+ NAME_FUNC_OFFSET(20657, glUniformMatrix3fvARB, glUniformMatrix3fvARB, NULL, 564),
+ NAME_FUNC_OFFSET(20676, glUniformMatrix4fvARB, glUniformMatrix4fvARB, NULL, 565),
+ NAME_FUNC_OFFSET(20695, glUseProgramObjectARB, glUseProgramObjectARB, NULL, 566),
+ NAME_FUNC_OFFSET(20708, glValidateProgramARB, glValidateProgramARB, NULL, 567),
+ NAME_FUNC_OFFSET(20726, glBindAttribLocationARB, glBindAttribLocationARB, NULL, 568),
+ NAME_FUNC_OFFSET(20747, glGetActiveAttribARB, glGetActiveAttribARB, NULL, 569),
+ NAME_FUNC_OFFSET(20765, glGetAttribLocationARB, glGetAttribLocationARB, NULL, 570),
+ NAME_FUNC_OFFSET(20785, glDrawBuffersARB, glDrawBuffersARB, NULL, 571),
+ NAME_FUNC_OFFSET(20799, glDrawBuffersARB, glDrawBuffersARB, NULL, 571),
+ NAME_FUNC_OFFSET(20816, glDrawArraysInstancedARB, glDrawArraysInstancedARB, NULL, 573),
+ NAME_FUNC_OFFSET(20841, glDrawArraysInstancedARB, glDrawArraysInstancedARB, NULL, 573),
+ NAME_FUNC_OFFSET(20863, glDrawElementsInstancedARB, glDrawElementsInstancedARB, NULL, 574),
+ NAME_FUNC_OFFSET(20890, glDrawElementsInstancedARB, glDrawElementsInstancedARB, NULL, 574),
+ NAME_FUNC_OFFSET(20914, glRenderbufferStorageMultisample, glRenderbufferStorageMultisample, NULL, 575),
+ NAME_FUNC_OFFSET(20950, glBlendEquationSeparateiARB, glBlendEquationSeparateiARB, NULL, 596),
+ NAME_FUNC_OFFSET(20984, glBlendEquationiARB, glBlendEquationiARB, NULL, 597),
+ NAME_FUNC_OFFSET(21010, glBlendFuncSeparateiARB, glBlendFuncSeparateiARB, NULL, 598),
+ NAME_FUNC_OFFSET(21040, glBlendFunciARB, glBlendFunciARB, NULL, 599),
+ NAME_FUNC_OFFSET(21062, gl_dispatch_stub_653, gl_dispatch_stub_653, NULL, 653),
+ NAME_FUNC_OFFSET(21078, gl_dispatch_stub_654, gl_dispatch_stub_654, NULL, 654),
+ NAME_FUNC_OFFSET(21097, glPointParameterfEXT, glPointParameterfEXT, NULL, 661),
+ NAME_FUNC_OFFSET(21115, glPointParameterfEXT, glPointParameterfEXT, NULL, 661),
+ NAME_FUNC_OFFSET(21136, glPointParameterfEXT, glPointParameterfEXT, NULL, 661),
+ NAME_FUNC_OFFSET(21158, glPointParameterfvEXT, glPointParameterfvEXT, NULL, 662),
+ NAME_FUNC_OFFSET(21177, glPointParameterfvEXT, glPointParameterfvEXT, NULL, 662),
+ NAME_FUNC_OFFSET(21199, glPointParameterfvEXT, glPointParameterfvEXT, NULL, 662),
+ NAME_FUNC_OFFSET(21222, glSecondaryColor3bEXT, glSecondaryColor3bEXT, NULL, 665),
+ NAME_FUNC_OFFSET(21241, glSecondaryColor3bvEXT, glSecondaryColor3bvEXT, NULL, 666),
+ NAME_FUNC_OFFSET(21261, glSecondaryColor3dEXT, glSecondaryColor3dEXT, NULL, 667),
+ NAME_FUNC_OFFSET(21280, glSecondaryColor3dvEXT, glSecondaryColor3dvEXT, NULL, 668),
+ NAME_FUNC_OFFSET(21300, glSecondaryColor3fEXT, glSecondaryColor3fEXT, NULL, 669),
+ NAME_FUNC_OFFSET(21319, glSecondaryColor3fvEXT, glSecondaryColor3fvEXT, NULL, 670),
+ NAME_FUNC_OFFSET(21339, glSecondaryColor3iEXT, glSecondaryColor3iEXT, NULL, 671),
+ NAME_FUNC_OFFSET(21358, glSecondaryColor3ivEXT, glSecondaryColor3ivEXT, NULL, 672),
+ NAME_FUNC_OFFSET(21378, glSecondaryColor3sEXT, glSecondaryColor3sEXT, NULL, 673),
+ NAME_FUNC_OFFSET(21397, glSecondaryColor3svEXT, glSecondaryColor3svEXT, NULL, 674),
+ NAME_FUNC_OFFSET(21417, glSecondaryColor3ubEXT, glSecondaryColor3ubEXT, NULL, 675),
+ NAME_FUNC_OFFSET(21437, glSecondaryColor3ubvEXT, glSecondaryColor3ubvEXT, NULL, 676),
+ NAME_FUNC_OFFSET(21458, glSecondaryColor3uiEXT, glSecondaryColor3uiEXT, NULL, 677),
+ NAME_FUNC_OFFSET(21478, glSecondaryColor3uivEXT, glSecondaryColor3uivEXT, NULL, 678),
+ NAME_FUNC_OFFSET(21499, glSecondaryColor3usEXT, glSecondaryColor3usEXT, NULL, 679),
+ NAME_FUNC_OFFSET(21519, glSecondaryColor3usvEXT, glSecondaryColor3usvEXT, NULL, 680),
+ NAME_FUNC_OFFSET(21540, glSecondaryColorPointerEXT, glSecondaryColorPointerEXT, NULL, 681),
+ NAME_FUNC_OFFSET(21564, glMultiDrawArraysEXT, glMultiDrawArraysEXT, NULL, 682),
+ NAME_FUNC_OFFSET(21582, glMultiDrawElementsEXT, glMultiDrawElementsEXT, NULL, 683),
+ NAME_FUNC_OFFSET(21602, glFogCoordPointerEXT, glFogCoordPointerEXT, NULL, 684),
+ NAME_FUNC_OFFSET(21620, glFogCoorddEXT, glFogCoorddEXT, NULL, 685),
+ NAME_FUNC_OFFSET(21632, glFogCoorddvEXT, glFogCoorddvEXT, NULL, 686),
+ NAME_FUNC_OFFSET(21645, glFogCoordfEXT, glFogCoordfEXT, NULL, 687),
+ NAME_FUNC_OFFSET(21657, glFogCoordfvEXT, glFogCoordfvEXT, NULL, 688),
+ NAME_FUNC_OFFSET(21670, glBlendFuncSeparateEXT, glBlendFuncSeparateEXT, NULL, 690),
+ NAME_FUNC_OFFSET(21690, glBlendFuncSeparateEXT, glBlendFuncSeparateEXT, NULL, 690),
+ NAME_FUNC_OFFSET(21714, glWindowPos2dMESA, glWindowPos2dMESA, NULL, 707),
+ NAME_FUNC_OFFSET(21728, glWindowPos2dMESA, glWindowPos2dMESA, NULL, 707),
+ NAME_FUNC_OFFSET(21745, glWindowPos2dvMESA, glWindowPos2dvMESA, NULL, 708),
+ NAME_FUNC_OFFSET(21760, glWindowPos2dvMESA, glWindowPos2dvMESA, NULL, 708),
+ NAME_FUNC_OFFSET(21778, glWindowPos2fMESA, glWindowPos2fMESA, NULL, 709),
+ NAME_FUNC_OFFSET(21792, glWindowPos2fMESA, glWindowPos2fMESA, NULL, 709),
+ NAME_FUNC_OFFSET(21809, glWindowPos2fvMESA, glWindowPos2fvMESA, NULL, 710),
+ NAME_FUNC_OFFSET(21824, glWindowPos2fvMESA, glWindowPos2fvMESA, NULL, 710),
+ NAME_FUNC_OFFSET(21842, glWindowPos2iMESA, glWindowPos2iMESA, NULL, 711),
+ NAME_FUNC_OFFSET(21856, glWindowPos2iMESA, glWindowPos2iMESA, NULL, 711),
+ NAME_FUNC_OFFSET(21873, glWindowPos2ivMESA, glWindowPos2ivMESA, NULL, 712),
+ NAME_FUNC_OFFSET(21888, glWindowPos2ivMESA, glWindowPos2ivMESA, NULL, 712),
+ NAME_FUNC_OFFSET(21906, glWindowPos2sMESA, glWindowPos2sMESA, NULL, 713),
+ NAME_FUNC_OFFSET(21920, glWindowPos2sMESA, glWindowPos2sMESA, NULL, 713),
+ NAME_FUNC_OFFSET(21937, glWindowPos2svMESA, glWindowPos2svMESA, NULL, 714),
+ NAME_FUNC_OFFSET(21952, glWindowPos2svMESA, glWindowPos2svMESA, NULL, 714),
+ NAME_FUNC_OFFSET(21970, glWindowPos3dMESA, glWindowPos3dMESA, NULL, 715),
+ NAME_FUNC_OFFSET(21984, glWindowPos3dMESA, glWindowPos3dMESA, NULL, 715),
+ NAME_FUNC_OFFSET(22001, glWindowPos3dvMESA, glWindowPos3dvMESA, NULL, 716),
+ NAME_FUNC_OFFSET(22016, glWindowPos3dvMESA, glWindowPos3dvMESA, NULL, 716),
+ NAME_FUNC_OFFSET(22034, glWindowPos3fMESA, glWindowPos3fMESA, NULL, 717),
+ NAME_FUNC_OFFSET(22048, glWindowPos3fMESA, glWindowPos3fMESA, NULL, 717),
+ NAME_FUNC_OFFSET(22065, glWindowPos3fvMESA, glWindowPos3fvMESA, NULL, 718),
+ NAME_FUNC_OFFSET(22080, glWindowPos3fvMESA, glWindowPos3fvMESA, NULL, 718),
+ NAME_FUNC_OFFSET(22098, glWindowPos3iMESA, glWindowPos3iMESA, NULL, 719),
+ NAME_FUNC_OFFSET(22112, glWindowPos3iMESA, glWindowPos3iMESA, NULL, 719),
+ NAME_FUNC_OFFSET(22129, glWindowPos3ivMESA, glWindowPos3ivMESA, NULL, 720),
+ NAME_FUNC_OFFSET(22144, glWindowPos3ivMESA, glWindowPos3ivMESA, NULL, 720),
+ NAME_FUNC_OFFSET(22162, glWindowPos3sMESA, glWindowPos3sMESA, NULL, 721),
+ NAME_FUNC_OFFSET(22176, glWindowPos3sMESA, glWindowPos3sMESA, NULL, 721),
+ NAME_FUNC_OFFSET(22193, glWindowPos3svMESA, glWindowPos3svMESA, NULL, 722),
+ NAME_FUNC_OFFSET(22208, glWindowPos3svMESA, glWindowPos3svMESA, NULL, 722),
+ NAME_FUNC_OFFSET(22226, glBindProgramNV, glBindProgramNV, NULL, 741),
+ NAME_FUNC_OFFSET(22243, glDeleteProgramsNV, glDeleteProgramsNV, NULL, 742),
+ NAME_FUNC_OFFSET(22263, glGenProgramsNV, glGenProgramsNV, NULL, 744),
+ NAME_FUNC_OFFSET(22280, glGetVertexAttribPointervNV, glGetVertexAttribPointervNV, NULL, 750),
+ NAME_FUNC_OFFSET(22306, glGetVertexAttribPointervNV, glGetVertexAttribPointervNV, NULL, 750),
+ NAME_FUNC_OFFSET(22335, glIsProgramNV, glIsProgramNV, NULL, 754),
+ NAME_FUNC_OFFSET(22350, glPointParameteriNV, glPointParameteriNV, NULL, 818),
+ NAME_FUNC_OFFSET(22368, glPointParameterivNV, glPointParameterivNV, NULL, 819),
+ NAME_FUNC_OFFSET(22387, gl_dispatch_stub_822, gl_dispatch_stub_822, NULL, 822),
+ NAME_FUNC_OFFSET(22408, gl_dispatch_stub_824, gl_dispatch_stub_824, NULL, 824),
+ NAME_FUNC_OFFSET(22424, glPrimitiveRestartIndexNV, glPrimitiveRestartIndexNV, NULL, 831),
+ NAME_FUNC_OFFSET(22448, gl_dispatch_stub_834, gl_dispatch_stub_834, NULL, 834),
+ NAME_FUNC_OFFSET(22472, gl_dispatch_stub_834, gl_dispatch_stub_834, NULL, 834),
+ NAME_FUNC_OFFSET(22499, glBindFramebufferEXT, glBindFramebufferEXT, NULL, 835),
+ NAME_FUNC_OFFSET(22517, glBindRenderbufferEXT, glBindRenderbufferEXT, NULL, 836),
+ NAME_FUNC_OFFSET(22536, glCheckFramebufferStatusEXT, glCheckFramebufferStatusEXT, NULL, 837),
+ NAME_FUNC_OFFSET(22561, glDeleteFramebuffersEXT, glDeleteFramebuffersEXT, NULL, 838),
+ NAME_FUNC_OFFSET(22582, glDeleteRenderbuffersEXT, glDeleteRenderbuffersEXT, NULL, 839),
+ NAME_FUNC_OFFSET(22604, glFramebufferRenderbufferEXT, glFramebufferRenderbufferEXT, NULL, 840),
+ NAME_FUNC_OFFSET(22630, glFramebufferTexture1DEXT, glFramebufferTexture1DEXT, NULL, 841),
+ NAME_FUNC_OFFSET(22653, glFramebufferTexture2DEXT, glFramebufferTexture2DEXT, NULL, 842),
+ NAME_FUNC_OFFSET(22676, glFramebufferTexture3DEXT, glFramebufferTexture3DEXT, NULL, 843),
+ NAME_FUNC_OFFSET(22699, glGenFramebuffersEXT, glGenFramebuffersEXT, NULL, 844),
+ NAME_FUNC_OFFSET(22717, glGenRenderbuffersEXT, glGenRenderbuffersEXT, NULL, 845),
+ NAME_FUNC_OFFSET(22736, glGenerateMipmapEXT, glGenerateMipmapEXT, NULL, 846),
+ NAME_FUNC_OFFSET(22753, glGetFramebufferAttachmentParameterivEXT, glGetFramebufferAttachmentParameterivEXT, NULL, 847),
+ NAME_FUNC_OFFSET(22791, glGetRenderbufferParameterivEXT, glGetRenderbufferParameterivEXT, NULL, 848),
+ NAME_FUNC_OFFSET(22820, glIsFramebufferEXT, glIsFramebufferEXT, NULL, 849),
+ NAME_FUNC_OFFSET(22836, glIsRenderbufferEXT, glIsRenderbufferEXT, NULL, 850),
+ NAME_FUNC_OFFSET(22853, glRenderbufferStorageEXT, glRenderbufferStorageEXT, NULL, 851),
+ NAME_FUNC_OFFSET(22875, gl_dispatch_stub_852, gl_dispatch_stub_852, NULL, 852),
+ NAME_FUNC_OFFSET(22893, glBindFragDataLocationEXT, glBindFragDataLocationEXT, NULL, 855),
+ NAME_FUNC_OFFSET(22916, glGetFragDataLocationEXT, glGetFragDataLocationEXT, NULL, 856),
+ NAME_FUNC_OFFSET(22938, glGetUniformuivEXT, glGetUniformuivEXT, NULL, 857),
+ NAME_FUNC_OFFSET(22954, glGetVertexAttribIivEXT, glGetVertexAttribIivEXT, NULL, 858),
+ NAME_FUNC_OFFSET(22975, glGetVertexAttribIuivEXT, glGetVertexAttribIuivEXT, NULL, 859),
+ NAME_FUNC_OFFSET(22997, glUniform1uiEXT, glUniform1uiEXT, NULL, 860),
+ NAME_FUNC_OFFSET(23010, glUniform1uivEXT, glUniform1uivEXT, NULL, 861),
+ NAME_FUNC_OFFSET(23024, glUniform2uiEXT, glUniform2uiEXT, NULL, 862),
+ NAME_FUNC_OFFSET(23037, glUniform2uivEXT, glUniform2uivEXT, NULL, 863),
+ NAME_FUNC_OFFSET(23051, glUniform3uiEXT, glUniform3uiEXT, NULL, 864),
+ NAME_FUNC_OFFSET(23064, glUniform3uivEXT, glUniform3uivEXT, NULL, 865),
+ NAME_FUNC_OFFSET(23078, glUniform4uiEXT, glUniform4uiEXT, NULL, 866),
+ NAME_FUNC_OFFSET(23091, glUniform4uivEXT, glUniform4uivEXT, NULL, 867),
+ NAME_FUNC_OFFSET(23105, glVertexAttribI1iEXT, glVertexAttribI1iEXT, NULL, 868),
+ NAME_FUNC_OFFSET(23123, glVertexAttribI1ivEXT, glVertexAttribI1ivEXT, NULL, 869),
+ NAME_FUNC_OFFSET(23142, glVertexAttribI1uiEXT, glVertexAttribI1uiEXT, NULL, 870),
+ NAME_FUNC_OFFSET(23161, glVertexAttribI1uivEXT, glVertexAttribI1uivEXT, NULL, 871),
+ NAME_FUNC_OFFSET(23181, glVertexAttribI2iEXT, glVertexAttribI2iEXT, NULL, 872),
+ NAME_FUNC_OFFSET(23199, glVertexAttribI2ivEXT, glVertexAttribI2ivEXT, NULL, 873),
+ NAME_FUNC_OFFSET(23218, glVertexAttribI2uiEXT, glVertexAttribI2uiEXT, NULL, 874),
+ NAME_FUNC_OFFSET(23237, glVertexAttribI2uivEXT, glVertexAttribI2uivEXT, NULL, 875),
+ NAME_FUNC_OFFSET(23257, glVertexAttribI3iEXT, glVertexAttribI3iEXT, NULL, 876),
+ NAME_FUNC_OFFSET(23275, glVertexAttribI3ivEXT, glVertexAttribI3ivEXT, NULL, 877),
+ NAME_FUNC_OFFSET(23294, glVertexAttribI3uiEXT, glVertexAttribI3uiEXT, NULL, 878),
+ NAME_FUNC_OFFSET(23313, glVertexAttribI3uivEXT, glVertexAttribI3uivEXT, NULL, 879),
+ NAME_FUNC_OFFSET(23333, glVertexAttribI4bvEXT, glVertexAttribI4bvEXT, NULL, 880),
+ NAME_FUNC_OFFSET(23352, glVertexAttribI4iEXT, glVertexAttribI4iEXT, NULL, 881),
+ NAME_FUNC_OFFSET(23370, glVertexAttribI4ivEXT, glVertexAttribI4ivEXT, NULL, 882),
+ NAME_FUNC_OFFSET(23389, glVertexAttribI4svEXT, glVertexAttribI4svEXT, NULL, 883),
+ NAME_FUNC_OFFSET(23408, glVertexAttribI4ubvEXT, glVertexAttribI4ubvEXT, NULL, 884),
+ NAME_FUNC_OFFSET(23428, glVertexAttribI4uiEXT, glVertexAttribI4uiEXT, NULL, 885),
+ NAME_FUNC_OFFSET(23447, glVertexAttribI4uivEXT, glVertexAttribI4uivEXT, NULL, 886),
+ NAME_FUNC_OFFSET(23467, glVertexAttribI4usvEXT, glVertexAttribI4usvEXT, NULL, 887),
+ NAME_FUNC_OFFSET(23487, glVertexAttribIPointerEXT, glVertexAttribIPointerEXT, NULL, 888),
+ NAME_FUNC_OFFSET(23510, glFramebufferTextureLayerEXT, glFramebufferTextureLayerEXT, NULL, 889),
+ NAME_FUNC_OFFSET(23536, glColorMaskIndexedEXT, glColorMaskIndexedEXT, NULL, 890),
+ NAME_FUNC_OFFSET(23549, glDisableIndexedEXT, glDisableIndexedEXT, NULL, 891),
+ NAME_FUNC_OFFSET(23560, glEnableIndexedEXT, glEnableIndexedEXT, NULL, 892),
+ NAME_FUNC_OFFSET(23570, glGetBooleanIndexedvEXT, glGetBooleanIndexedvEXT, NULL, 893),
+ NAME_FUNC_OFFSET(23586, glGetIntegerIndexedvEXT, glGetIntegerIndexedvEXT, NULL, 894),
+ NAME_FUNC_OFFSET(23602, glIsEnabledIndexedEXT, glIsEnabledIndexedEXT, NULL, 895),
+ NAME_FUNC_OFFSET(23615, glGetTexParameterIivEXT, glGetTexParameterIivEXT, NULL, 898),
+ NAME_FUNC_OFFSET(23636, glGetTexParameterIuivEXT, glGetTexParameterIuivEXT, NULL, 899),
+ NAME_FUNC_OFFSET(23658, glTexParameterIivEXT, glTexParameterIivEXT, NULL, 900),
+ NAME_FUNC_OFFSET(23676, glTexParameterIuivEXT, glTexParameterIuivEXT, NULL, 901),
+ NAME_FUNC_OFFSET(23695, glBeginConditionalRenderNV, glBeginConditionalRenderNV, NULL, 902),
+ NAME_FUNC_OFFSET(23720, glEndConditionalRenderNV, glEndConditionalRenderNV, NULL, 903),
+ NAME_FUNC_OFFSET(23743, glBeginTransformFeedbackEXT, glBeginTransformFeedbackEXT, NULL, 904),
+ NAME_FUNC_OFFSET(23768, glBindBufferBaseEXT, glBindBufferBaseEXT, NULL, 905),
+ NAME_FUNC_OFFSET(23785, glBindBufferRangeEXT, glBindBufferRangeEXT, NULL, 907),
+ NAME_FUNC_OFFSET(23803, glEndTransformFeedbackEXT, glEndTransformFeedbackEXT, NULL, 908),
+ NAME_FUNC_OFFSET(23826, glGetTransformFeedbackVaryingEXT, glGetTransformFeedbackVaryingEXT, NULL, 909),
+ NAME_FUNC_OFFSET(23856, glTransformFeedbackVaryingsEXT, glTransformFeedbackVaryingsEXT, NULL, 910),
+ NAME_FUNC_OFFSET(23884, glProvokingVertexEXT, glProvokingVertexEXT, NULL, 911),
+ NAME_FUNC_OFFSET(-1, NULL, NULL, NULL, 0)
+};
+
+#undef NAME_FUNC_OFFSET
diff --git a/mesalib/src/mapi/glapi/glthread.c b/mesalib/src/mapi/glapi/glthread.c
index 00915380f..239090ecf 100644
--- a/mesalib/src/mapi/glapi/glthread.c
+++ b/mesalib/src/mapi/glapi/glthread.c
@@ -1,6 +1,6 @@
#include "glapi/glapi.h"
-unsigned long
+unsigned long _GLAPI_EXPORT
_glthread_GetID(void)
{
return u_thread_self();
diff --git a/mesalib/src/mapi/mapi/u_current.c b/mesalib/src/mapi/mapi/u_current.c
index 21a07abba..8fc7096a3 100644
--- a/mesalib/src/mapi/mapi/u_current.c
+++ b/mesalib/src/mapi/mapi/u_current.c
@@ -1,266 +1,266 @@
-/*
- * Mesa 3-D graphics library
- * Version: 7.1
- *
- * Copyright (C) 1999-2008 Brian Paul All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-
-/*
- * This file manages the OpenGL API dispatch layer.
- * The dispatch table (struct _glapi_table) is basically just a list
- * of function pointers.
- * There are functions to set/get the current dispatch table for the
- * current thread and to manage registration/dispatch of dynamically
- * added extension functions.
- *
- * It's intended that this file and the other glapi*.[ch] files are
- * flexible enough to be reused in several places: XFree86, DRI-
- * based libGL.so, and perhaps the SGI SI.
- *
- * NOTE: There are no dependencies on Mesa in this code.
- *
- * Versions (API changes):
- * 2000/02/23 - original version for Mesa 3.3 and XFree86 4.0
- * 2001/01/16 - added dispatch override feature for Mesa 3.5
- * 2002/06/28 - added _glapi_set_warning_func(), Mesa 4.1.
- * 2002/10/01 - _glapi_get_proc_address() will now generate new entrypoints
- * itself (using offset ~0). _glapi_add_entrypoint() can be
- * called afterward and it'll fill in the correct dispatch
- * offset. This allows DRI libGL to avoid probing for DRI
- * drivers! No changes to the public glapi interface.
- */
-
-#include "u_current.h"
-#include "u_thread.h"
-
-#ifndef MAPI_MODE_UTIL
-
-#include "table.h"
-#include "stub.h"
-
-#else
-
-extern void init_glapi_relocs_once(void);
-extern void (*__glapi_noop_table[])(void);
-
-#define table_noop_array __glapi_noop_table
-#define stub_init_once() init_glapi_relocs_once()
-
-#endif
-
-/**
- * \name Current dispatch and current context control variables
- *
- * Depending on whether or not multithreading is support, and the type of
- * support available, several variables are used to store the current context
- * pointer and the current dispatch table pointer. In the non-threaded case,
- * the variables \c _glapi_Dispatch and \c _glapi_Context are used for this
- * purpose.
- *
- * In the "normal" threaded case, the variables \c _glapi_Dispatch and
- * \c _glapi_Context will be \c NULL if an application is detected as being
- * multithreaded. Single-threaded applications will use \c _glapi_Dispatch
- * and \c _glapi_Context just like the case without any threading support.
- * When \c _glapi_Dispatch and \c _glapi_Context are \c NULL, the thread state
- * data \c _gl_DispatchTSD and \c ContextTSD are used. Drivers and the
- * static dispatch functions access these variables via \c _glapi_get_dispatch
- * and \c _glapi_get_context.
- *
- * There is a race condition in setting \c _glapi_Dispatch to \c NULL. It is
- * possible for the original thread to be setting it at the same instant a new
- * thread, perhaps running on a different processor, is clearing it. Because
- * of that, \c ThreadSafe, which can only ever be changed to \c GL_TRUE, is
- * used to determine whether or not the application is multithreaded.
- *
- * In the TLS case, the variables \c _glapi_Dispatch and \c _glapi_Context are
- * hardcoded to \c NULL. Instead the TLS variables \c _glapi_tls_Dispatch and
- * \c _glapi_tls_Context are used. Having \c _glapi_Dispatch and
- * \c _glapi_Context be hardcoded to \c NULL maintains binary compatability
- * between TLS enabled loaders and non-TLS DRI drivers.
- */
-/*@{*/
-#if defined(GLX_USE_TLS)
-
-__thread struct mapi_table *u_current_table
- __attribute__((tls_model("initial-exec")))
- = (struct mapi_table *) table_noop_array;
-
-__thread void *u_current_user
- __attribute__((tls_model("initial-exec")));
-
-#else
-
-struct mapi_table *u_current_table =
- (struct mapi_table *) table_noop_array;
-void *u_current_user;
-
-#ifdef THREADS
-struct u_tsd u_current_table_tsd;
-static struct u_tsd u_current_user_tsd;
-static int ThreadSafe;
-#endif /* THREADS */
-
-#endif /* defined(GLX_USE_TLS) */
-/*@}*/
-
-
-void
-u_current_destroy(void)
-{
-#if defined(THREADS) && defined(WIN32)
- u_tsd_destroy(&u_current_table_tsd);
- u_tsd_destroy(&u_current_user_tsd);
-#endif
-}
-
-
-#if defined(THREADS) && !defined(GLX_USE_TLS)
-
-static void
-u_current_init_tsd(void)
-{
- u_tsd_init(&u_current_table_tsd);
- u_tsd_init(&u_current_user_tsd);
-}
-
-/**
- * Mutex for multithread check.
- */
-u_mutex_declare_static(ThreadCheckMutex);
-
-/**
- * We should call this periodically from a function such as glXMakeCurrent
- * in order to test if multiple threads are being used.
- */
-void
-u_current_init(void)
-{
- static unsigned long knownID;
- static int firstCall = 1;
-
- if (ThreadSafe)
- return;
-
- u_mutex_lock(ThreadCheckMutex);
- if (firstCall) {
- u_current_init_tsd();
-
- knownID = u_thread_self();
- firstCall = 0;
- }
- else if (knownID != u_thread_self()) {
- ThreadSafe = 1;
- u_current_set(NULL);
- u_current_set_user(NULL);
- }
- u_mutex_unlock(ThreadCheckMutex);
-}
-
-#else
-
-void
-u_current_init(void)
-{
-}
-
-#endif
-
-
-
-/**
- * Set the current context pointer for this thread.
- * The context pointer is an opaque type which should be cast to
- * void from the real context pointer type.
- */
-void
-u_current_set_user(const void *ptr)
-{
- u_current_init();
-
-#if defined(GLX_USE_TLS)
- u_current_user = (void *) ptr;
-#elif defined(THREADS)
- u_tsd_set(&u_current_user_tsd, (void *) ptr);
- u_current_user = (ThreadSafe) ? NULL : (void *) ptr;
-#else
- u_current_user = (void *) ptr;
-#endif
-}
-
-/**
- * Get the current context pointer for this thread.
- * The context pointer is an opaque type which should be cast from
- * void to the real context pointer type.
- */
-void *
-u_current_get_user_internal(void)
-{
-#if defined(GLX_USE_TLS)
- return u_current_user;
-#elif defined(THREADS)
- return (ThreadSafe)
- ? u_tsd_get(&u_current_user_tsd)
- : u_current_user;
-#else
- return u_current_user;
-#endif
-}
-
-/**
- * Set the global or per-thread dispatch table pointer.
- * If the dispatch parameter is NULL we'll plug in the no-op dispatch
- * table (__glapi_noop_table).
- */
-void
-u_current_set(const struct mapi_table *tbl)
-{
- u_current_init();
-
- stub_init_once();
-
- if (!tbl)
- tbl = (const struct mapi_table *) table_noop_array;
-
-#if defined(GLX_USE_TLS)
- u_current_table = (struct mapi_table *) tbl;
-#elif defined(THREADS)
- u_tsd_set(&u_current_table_tsd, (void *) tbl);
- u_current_table = (ThreadSafe) ? NULL : (void *) tbl;
-#else
- u_current_table = (struct mapi_table *) tbl;
-#endif
-}
-
-/**
- * Return pointer to current dispatch table for calling thread.
- */
-struct mapi_table *
-u_current_get_internal(void)
-{
-#if defined(GLX_USE_TLS)
- return u_current_table;
-#elif defined(THREADS)
- return (struct mapi_table *) ((ThreadSafe) ?
- u_tsd_get(&u_current_table_tsd) : (void *) u_current_table);
-#else
- return u_current_table;
-#endif
-}
+/*
+ * Mesa 3-D graphics library
+ * Version: 7.1
+ *
+ * Copyright (C) 1999-2008 Brian Paul All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+
+/*
+ * This file manages the OpenGL API dispatch layer.
+ * The dispatch table (struct _glapi_table) is basically just a list
+ * of function pointers.
+ * There are functions to set/get the current dispatch table for the
+ * current thread and to manage registration/dispatch of dynamically
+ * added extension functions.
+ *
+ * It's intended that this file and the other glapi*.[ch] files are
+ * flexible enough to be reused in several places: XFree86, DRI-
+ * based libGL.so, and perhaps the SGI SI.
+ *
+ * NOTE: There are no dependencies on Mesa in this code.
+ *
+ * Versions (API changes):
+ * 2000/02/23 - original version for Mesa 3.3 and XFree86 4.0
+ * 2001/01/16 - added dispatch override feature for Mesa 3.5
+ * 2002/06/28 - added _glapi_set_warning_func(), Mesa 4.1.
+ * 2002/10/01 - _glapi_get_proc_address() will now generate new entrypoints
+ * itself (using offset ~0). _glapi_add_entrypoint() can be
+ * called afterward and it'll fill in the correct dispatch
+ * offset. This allows DRI libGL to avoid probing for DRI
+ * drivers! No changes to the public glapi interface.
+ */
+
+#include "u_current.h"
+#include "u_thread.h"
+
+#ifndef MAPI_MODE_UTIL
+
+#include "table.h"
+#include "stub.h"
+
+#else
+
+extern void init_glapi_relocs_once(void);
+extern void (*__glapi_noop_table[])(void);
+
+#define table_noop_array __glapi_noop_table
+#define stub_init_once() init_glapi_relocs_once()
+
+#endif
+
+/**
+ * \name Current dispatch and current context control variables
+ *
+ * Depending on whether or not multithreading is support, and the type of
+ * support available, several variables are used to store the current context
+ * pointer and the current dispatch table pointer. In the non-threaded case,
+ * the variables \c _glapi_Dispatch and \c _glapi_Context are used for this
+ * purpose.
+ *
+ * In the "normal" threaded case, the variables \c _glapi_Dispatch and
+ * \c _glapi_Context will be \c NULL if an application is detected as being
+ * multithreaded. Single-threaded applications will use \c _glapi_Dispatch
+ * and \c _glapi_Context just like the case without any threading support.
+ * When \c _glapi_Dispatch and \c _glapi_Context are \c NULL, the thread state
+ * data \c _gl_DispatchTSD and \c ContextTSD are used. Drivers and the
+ * static dispatch functions access these variables via \c _glapi_get_dispatch
+ * and \c _glapi_get_context.
+ *
+ * There is a race condition in setting \c _glapi_Dispatch to \c NULL. It is
+ * possible for the original thread to be setting it at the same instant a new
+ * thread, perhaps running on a different processor, is clearing it. Because
+ * of that, \c ThreadSafe, which can only ever be changed to \c GL_TRUE, is
+ * used to determine whether or not the application is multithreaded.
+ *
+ * In the TLS case, the variables \c _glapi_Dispatch and \c _glapi_Context are
+ * hardcoded to \c NULL. Instead the TLS variables \c _glapi_tls_Dispatch and
+ * \c _glapi_tls_Context are used. Having \c _glapi_Dispatch and
+ * \c _glapi_Context be hardcoded to \c NULL maintains binary compatability
+ * between TLS enabled loaders and non-TLS DRI drivers.
+ */
+/*@{*/
+#if defined(GLX_USE_TLS)
+
+__thread struct mapi_table *u_current_table
+ __attribute__((tls_model("initial-exec")))
+ = (struct mapi_table *) table_noop_array;
+
+__thread void *u_current_user
+ __attribute__((tls_model("initial-exec")));
+
+#else
+
+struct mapi_table *u_current_table =
+ (struct mapi_table *) table_noop_array;
+void *u_current_user;
+
+#ifdef THREADS
+struct u_tsd u_current_table_tsd;
+static struct u_tsd u_current_user_tsd;
+static int ThreadSafe;
+#endif /* THREADS */
+
+#endif /* defined(GLX_USE_TLS) */
+/*@}*/
+
+
+void
+u_current_destroy(void)
+{
+#if defined(THREADS) && defined(WIN32)
+ u_tsd_destroy(&u_current_table_tsd);
+ u_tsd_destroy(&u_current_user_tsd);
+#endif
+}
+
+
+#if defined(THREADS) && !defined(GLX_USE_TLS)
+
+static void
+u_current_init_tsd(void)
+{
+ u_tsd_init(&u_current_table_tsd);
+ u_tsd_init(&u_current_user_tsd);
+}
+
+/**
+ * Mutex for multithread check.
+ */
+u_mutex_declare_static(ThreadCheckMutex);
+
+/**
+ * We should call this periodically from a function such as glXMakeCurrent
+ * in order to test if multiple threads are being used.
+ */
+void
+u_current_init(void)
+{
+ static unsigned long knownID;
+ static int firstCall = 1;
+
+ if (ThreadSafe)
+ return;
+
+ u_mutex_lock(ThreadCheckMutex);
+ if (firstCall) {
+ u_current_init_tsd();
+
+ knownID = u_thread_self();
+ firstCall = 0;
+ }
+ else if (knownID != u_thread_self()) {
+ ThreadSafe = 1;
+ u_current_set(NULL);
+ u_current_set_user(NULL);
+ }
+ u_mutex_unlock(ThreadCheckMutex);
+}
+
+#else
+
+void
+u_current_init(void)
+{
+}
+
+#endif
+
+
+
+/**
+ * Set the current context pointer for this thread.
+ * The context pointer is an opaque type which should be cast to
+ * void from the real context pointer type.
+ */
+void
+u_current_set_user(const void *ptr)
+{
+ u_current_init();
+
+#if defined(GLX_USE_TLS)
+ u_current_user = (void *) ptr;
+#elif defined(THREADS)
+ u_tsd_set(&u_current_user_tsd, (void *) ptr);
+ u_current_user = (ThreadSafe) ? NULL : (void *) ptr;
+#else
+ u_current_user = (void *) ptr;
+#endif
+}
+
+/**
+ * Get the current context pointer for this thread.
+ * The context pointer is an opaque type which should be cast from
+ * void to the real context pointer type.
+ */
+void *
+u_current_get_user_internal(void)
+{
+#if defined(GLX_USE_TLS)
+ return u_current_user;
+#elif defined(THREADS)
+ return (ThreadSafe)
+ ? u_tsd_get(&u_current_user_tsd)
+ : u_current_user;
+#else
+ return u_current_user;
+#endif
+}
+
+/**
+ * Set the global or per-thread dispatch table pointer.
+ * If the dispatch parameter is NULL we'll plug in the no-op dispatch
+ * table (__glapi_noop_table).
+ */
+void
+u_current_set(const struct mapi_table *tbl)
+{
+ u_current_init();
+
+ stub_init_once();
+
+ if (!tbl)
+ tbl = (const struct mapi_table *) table_noop_array;
+
+#if defined(GLX_USE_TLS)
+ u_current_table = (struct mapi_table *) tbl;
+#elif defined(THREADS)
+ u_tsd_set(&u_current_table_tsd, (void *) tbl);
+ u_current_table = (ThreadSafe) ? NULL : (void *) tbl;
+#else
+ u_current_table = (struct mapi_table *) tbl;
+#endif
+}
+
+/**
+ * Return pointer to current dispatch table for calling thread.
+ */
+struct mapi_table *
+u_current_get_internal(void)
+{
+#if defined(GLX_USE_TLS)
+ return u_current_table;
+#elif defined(THREADS)
+ return (struct mapi_table *) ((ThreadSafe) ?
+ u_tsd_get(&u_current_table_tsd) : (void *) u_current_table);
+#else
+ return u_current_table;
+#endif
+}
diff --git a/mesalib/src/mapi/mapi/u_thread.c b/mesalib/src/mapi/mapi/u_thread.c
index 12e748fe8..3154b89de 100644
--- a/mesalib/src/mapi/mapi/u_thread.c
+++ b/mesalib/src/mapi/mapi/u_thread.c
@@ -1,249 +1,249 @@
-/*
- * Mesa 3-D graphics library
- * Version: 6.5.1
- *
- * Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-
-#include <stdio.h>
-#include <stdlib.h>
-#include "u_compiler.h"
-#include "u_thread.h"
-
-
-/*
- * This file should still compile even when THREADS is not defined.
- * This is to make things easier to deal with on the makefile scene..
- */
-#ifdef THREADS
-#include <errno.h>
-
-/*
- * Error messages
- */
-#define INIT_TSD_ERROR "_glthread_: failed to allocate key for thread specific data"
-#define GET_TSD_ERROR "_glthread_: failed to get thread specific data"
-#define SET_TSD_ERROR "_glthread_: thread failed to set thread specific data"
-
-
-/*
- * Magic number to determine if a TSD object has been initialized.
- * Kind of a hack but there doesn't appear to be a better cross-platform
- * solution.
- */
-#define INIT_MAGIC 0xff8adc98
-
-
-
-/*
- * POSIX Threads -- The best way to go if your platform supports them.
- * Solaris >= 2.5 have POSIX threads, IRIX >= 6.4 reportedly
- * has them, and many of the free Unixes now have them.
- * Be sure to use appropriate -mt or -D_REENTRANT type
- * compile flags when building.
- */
-#ifdef PTHREADS
-
-unsigned long
-u_thread_self(void)
-{
- return (unsigned long) pthread_self();
-}
-
-
-void
-u_tsd_init(struct u_tsd *tsd)
-{
- if (pthread_key_create(&tsd->key, NULL/*free*/) != 0) {
- perror(INIT_TSD_ERROR);
- exit(-1);
- }
- tsd->initMagic = INIT_MAGIC;
-}
-
-
-void *
-u_tsd_get(struct u_tsd *tsd)
-{
- if (tsd->initMagic != (int) INIT_MAGIC) {
- u_tsd_init(tsd);
- }
- return pthread_getspecific(tsd->key);
-}
-
-
-void
-u_tsd_set(struct u_tsd *tsd, void *ptr)
-{
- if (tsd->initMagic != (int) INIT_MAGIC) {
- u_tsd_init(tsd);
- }
- if (pthread_setspecific(tsd->key, ptr) != 0) {
- perror(SET_TSD_ERROR);
- exit(-1);
- }
-}
-
-#endif /* PTHREADS */
-
-
-
-/*
- * Win32 Threads. The only available option for Windows 95/NT.
- * Be sure that you compile using the Multithreaded runtime, otherwise
- * bad things will happen.
- */
-#ifdef WIN32
-
-unsigned long
-u_thread_self(void)
-{
- return GetCurrentThreadId();
-}
-
-
-void
-u_tsd_init(struct u_tsd *tsd)
-{
- tsd->key = TlsAlloc();
- if (tsd->key == TLS_OUT_OF_INDEXES) {
- perror(INIT_TSD_ERROR);
- exit(-1);
- }
- tsd->initMagic = INIT_MAGIC;
-}
-
-
-void
-u_tsd_destroy(struct u_tsd *tsd)
-{
- if (tsd->initMagic != INIT_MAGIC) {
- return;
- }
- TlsFree(tsd->key);
- tsd->initMagic = 0x0;
-}
-
-
-void *
-u_tsd_get(struct u_tsd *tsd)
-{
- if (tsd->initMagic != INIT_MAGIC) {
- u_tsd_init(tsd);
- }
- return TlsGetValue(tsd->key);
-}
-
-
-void
-u_tsd_set(struct u_tsd *tsd, void *ptr)
-{
- /* the following code assumes that the struct u_tsd has been initialized
- to zero at creation */
- if (tsd->initMagic != INIT_MAGIC) {
- u_tsd_init(tsd);
- }
- if (TlsSetValue(tsd->key, ptr) == 0) {
- perror(SET_TSD_ERROR);
- exit(-1);
- }
-}
-
-#endif /* WIN32 */
-
-/*
- * BeOS threads
- */
-#ifdef BEOS_THREADS
-
-unsigned long
-u_thread_self(void)
-{
- return (unsigned long) find_thread(NULL);
-}
-
-void
-u_tsd_init(struct u_tsd *tsd)
-{
- tsd->key = tls_allocate();
- tsd->initMagic = INIT_MAGIC;
-}
-
-void *
-u_tsd_get(struct u_tsd *tsd)
-{
- if (tsd->initMagic != (int) INIT_MAGIC) {
- u_tsd_init(tsd);
- }
- return tls_get(tsd->key);
-}
-
-void
-u_tsd_set(struct u_tsd *tsd, void *ptr)
-{
- if (tsd->initMagic != (int) INIT_MAGIC) {
- u_tsd_init(tsd);
- }
- tls_set(tsd->key, ptr);
-}
-
-#endif /* BEOS_THREADS */
-
-
-
-#else /* THREADS */
-
-
-/*
- * no-op functions
- */
-
-unsigned long
-u_thread_self(void)
-{
- return 0;
-}
-
-
-void
-u_tsd_init(struct u_tsd *tsd)
-{
- (void) tsd;
-}
-
-
-void *
-u_tsd_get(struct u_tsd *tsd)
-{
- (void) tsd;
- return NULL;
-}
-
-
-void
-u_tsd_set(struct u_tsd *tsd, void *ptr)
-{
- (void) tsd;
- (void) ptr;
-}
-
-
-#endif /* THREADS */
+/*
+ * Mesa 3-D graphics library
+ * Version: 6.5.1
+ *
+ * Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+
+#include <stdio.h>
+#include <stdlib.h>
+#include "u_compiler.h"
+#include "u_thread.h"
+
+
+/*
+ * This file should still compile even when THREADS is not defined.
+ * This is to make things easier to deal with on the makefile scene..
+ */
+#ifdef THREADS
+#include <errno.h>
+
+/*
+ * Error messages
+ */
+#define INIT_TSD_ERROR "_glthread_: failed to allocate key for thread specific data"
+#define GET_TSD_ERROR "_glthread_: failed to get thread specific data"
+#define SET_TSD_ERROR "_glthread_: thread failed to set thread specific data"
+
+
+/*
+ * Magic number to determine if a TSD object has been initialized.
+ * Kind of a hack but there doesn't appear to be a better cross-platform
+ * solution.
+ */
+#define INIT_MAGIC 0xff8adc98
+
+
+
+/*
+ * POSIX Threads -- The best way to go if your platform supports them.
+ * Solaris >= 2.5 have POSIX threads, IRIX >= 6.4 reportedly
+ * has them, and many of the free Unixes now have them.
+ * Be sure to use appropriate -mt or -D_REENTRANT type
+ * compile flags when building.
+ */
+#ifdef PTHREADS
+
+unsigned long
+u_thread_self(void)
+{
+ return (unsigned long) pthread_self();
+}
+
+
+void
+u_tsd_init(struct u_tsd *tsd)
+{
+ if (pthread_key_create(&tsd->key, NULL/*free*/) != 0) {
+ perror(INIT_TSD_ERROR);
+ exit(-1);
+ }
+ tsd->initMagic = INIT_MAGIC;
+}
+
+
+void *
+u_tsd_get(struct u_tsd *tsd)
+{
+ if (tsd->initMagic != (int) INIT_MAGIC) {
+ u_tsd_init(tsd);
+ }
+ return pthread_getspecific(tsd->key);
+}
+
+
+void
+u_tsd_set(struct u_tsd *tsd, void *ptr)
+{
+ if (tsd->initMagic != (int) INIT_MAGIC) {
+ u_tsd_init(tsd);
+ }
+ if (pthread_setspecific(tsd->key, ptr) != 0) {
+ perror(SET_TSD_ERROR);
+ exit(-1);
+ }
+}
+
+#endif /* PTHREADS */
+
+
+
+/*
+ * Win32 Threads. The only available option for Windows 95/NT.
+ * Be sure that you compile using the Multithreaded runtime, otherwise
+ * bad things will happen.
+ */
+#ifdef WIN32
+
+unsigned long
+u_thread_self(void)
+{
+ return GetCurrentThreadId();
+}
+
+
+void
+u_tsd_init(struct u_tsd *tsd)
+{
+ tsd->key = TlsAlloc();
+ if (tsd->key == TLS_OUT_OF_INDEXES) {
+ perror(INIT_TSD_ERROR);
+ exit(-1);
+ }
+ tsd->initMagic = INIT_MAGIC;
+}
+
+
+void
+u_tsd_destroy(struct u_tsd *tsd)
+{
+ if (tsd->initMagic != INIT_MAGIC) {
+ return;
+ }
+ TlsFree(tsd->key);
+ tsd->initMagic = 0x0;
+}
+
+
+void *
+u_tsd_get(struct u_tsd *tsd)
+{
+ if (tsd->initMagic != INIT_MAGIC) {
+ u_tsd_init(tsd);
+ }
+ return TlsGetValue(tsd->key);
+}
+
+
+void
+u_tsd_set(struct u_tsd *tsd, void *ptr)
+{
+ /* the following code assumes that the struct u_tsd has been initialized
+ to zero at creation */
+ if (tsd->initMagic != INIT_MAGIC) {
+ u_tsd_init(tsd);
+ }
+ if (TlsSetValue(tsd->key, ptr) == 0) {
+ perror(SET_TSD_ERROR);
+ exit(-1);
+ }
+}
+
+#endif /* WIN32 */
+
+/*
+ * BeOS threads
+ */
+#ifdef BEOS_THREADS
+
+unsigned long
+u_thread_self(void)
+{
+ return (unsigned long) find_thread(NULL);
+}
+
+void
+u_tsd_init(struct u_tsd *tsd)
+{
+ tsd->key = tls_allocate();
+ tsd->initMagic = INIT_MAGIC;
+}
+
+void *
+u_tsd_get(struct u_tsd *tsd)
+{
+ if (tsd->initMagic != (int) INIT_MAGIC) {
+ u_tsd_init(tsd);
+ }
+ return tls_get(tsd->key);
+}
+
+void
+u_tsd_set(struct u_tsd *tsd, void *ptr)
+{
+ if (tsd->initMagic != (int) INIT_MAGIC) {
+ u_tsd_init(tsd);
+ }
+ tls_set(tsd->key, ptr);
+}
+
+#endif /* BEOS_THREADS */
+
+
+
+#else /* THREADS */
+
+
+/*
+ * no-op functions
+ */
+
+unsigned long
+u_thread_self(void)
+{
+ return 0;
+}
+
+
+void
+u_tsd_init(struct u_tsd *tsd)
+{
+ (void) tsd;
+}
+
+
+void *
+u_tsd_get(struct u_tsd *tsd)
+{
+ (void) tsd;
+ return NULL;
+}
+
+
+void
+u_tsd_set(struct u_tsd *tsd, void *ptr)
+{
+ (void) tsd;
+ (void) ptr;
+}
+
+
+#endif /* THREADS */
diff --git a/mesalib/src/mapi/mapi/u_thread.h b/mesalib/src/mapi/mapi/u_thread.h
index 1cc8be3fa..290066d16 100644
--- a/mesalib/src/mapi/mapi/u_thread.h
+++ b/mesalib/src/mapi/mapi/u_thread.h
@@ -1,201 +1,201 @@
-/*
- * Mesa 3-D graphics library
- * Version: 6.5.2
- *
- * Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-
-/*
- * Thread support for gl dispatch.
- *
- * Initial version by John Stone (j.stone@acm.org) (johns@cs.umr.edu)
- * and Christoph Poliwoda (poliwoda@volumegraphics.com)
- * Revised by Keith Whitwell
- * Adapted for new gl dispatcher by Brian Paul
- * Modified for use in mapi by Chia-I Wu
- */
-
-/*
- * If this file is accidentally included by a non-threaded build,
- * it should not cause the build to fail, or otherwise cause problems.
- * In general, it should only be included when needed however.
- */
-
-#ifndef _U_THREAD_H_
-#define _U_THREAD_H_
-
-#include "u_compiler.h"
-
-#if defined(PTHREADS) || defined(WIN32) || defined(BEOS_THREADS)
-#ifndef THREADS
-#define THREADS
-#endif
-#endif
-
-/*
- * POSIX threads. This should be your choice in the Unix world
- * whenever possible. When building with POSIX threads, be sure
- * to enable any compiler flags which will cause the MT-safe
- * libc (if one exists) to be used when linking, as well as any
- * header macros for MT-safe errno, etc. For Solaris, this is the -mt
- * compiler flag. On Solaris with gcc, use -D_REENTRANT to enable
- * proper compiling for MT-safe libc etc.
- */
-#if defined(PTHREADS)
-#include <pthread.h> /* POSIX threads headers */
-
-struct u_tsd {
- pthread_key_t key;
- int initMagic;
-};
-
-typedef pthread_mutex_t u_mutex;
-
-#define u_mutex_declare_static(name) \
- static u_mutex name = PTHREAD_MUTEX_INITIALIZER
-
-#define u_mutex_init(name) pthread_mutex_init(&(name), NULL)
-#define u_mutex_destroy(name) pthread_mutex_destroy(&(name))
-#define u_mutex_lock(name) (void) pthread_mutex_lock(&(name))
-#define u_mutex_unlock(name) (void) pthread_mutex_unlock(&(name))
-
-#endif /* PTHREADS */
-
-
-/*
- * Windows threads. Should work with Windows NT and 95.
- * IMPORTANT: Link with multithreaded runtime library when THREADS are
- * used!
- */
-#ifdef WIN32
-#include <windows.h>
-
-struct u_tsd {
- DWORD key;
- int initMagic;
-};
-
-typedef CRITICAL_SECTION u_mutex;
-
-/* http://locklessinc.com/articles/pthreads_on_windows/ */
-#define u_mutex_declare_static(name) \
- static u_mutex name = {(PCRITICAL_SECTION_DEBUG)-1, -1, 0, 0, 0, 0}
-
-#define u_mutex_init(name) InitializeCriticalSection(&name)
-#define u_mutex_destroy(name) DeleteCriticalSection(&name)
-#define u_mutex_lock(name) EnterCriticalSection(&name)
-#define u_mutex_unlock(name) LeaveCriticalSection(&name)
-
-#endif /* WIN32 */
-
-
-/*
- * BeOS threads. R5.x required.
- */
-#ifdef BEOS_THREADS
-
-/* Problem with OS.h and this file on haiku */
-#ifndef __HAIKU__
-#include <kernel/OS.h>
-#endif
-
-#include <support/TLS.h>
-
-/* The only two typedefs required here
- * this is cause of the OS.h problem
- */
-#ifdef __HAIKU__
-typedef int32 thread_id;
-typedef int32 sem_id;
-#endif
-
-struct u_tsd {
- int32 key;
- int initMagic;
-};
-
-/* Use Benaphore, aka speeder semaphore */
-typedef struct {
- int32 lock;
- sem_id sem;
-} benaphore;
-typedef benaphore u_mutex;
-
-#define u_mutex_declare_static(name) \
- static u_mutex name = { 0, 0 }
-
-#define u_mutex_init(name) \
- name.sem = create_sem(0, #name"_benaphore"), \
- name.lock = 0
-
-#define u_mutex_destroy(name) \
- delete_sem(name.sem), \
- name.lock = 0
-
-#define u_mutex_lock(name) \
- if (name.sem == 0) \
- u_mutex_init(name); \
- if (atomic_add(&(name.lock), 1) >= 1) \
- acquire_sem(name.sem)
-
-#define u_mutex_unlock(name) \
- if (atomic_add(&(name.lock), -1) > 1) \
- release_sem(name.sem)
-
-#endif /* BEOS_THREADS */
-
-
-/*
- * THREADS not defined
- */
-#ifndef THREADS
-
-struct u_tsd {
- int initMagic;
-};
-
-typedef unsigned u_mutex;
-
-#define u_mutex_declare_static(name) static u_mutex name = 0
-#define u_mutex_init(name) (void) name
-#define u_mutex_destroy(name) (void) name
-#define u_mutex_lock(name) (void) name
-#define u_mutex_unlock(name) (void) name
-
-#endif /* THREADS */
-
-
-unsigned long
-u_thread_self(void);
-
-void
-u_tsd_init(struct u_tsd *tsd);
-
-void
-u_tsd_destroy(struct u_tsd *tsd); /* WIN32 only */
-
-void *
-u_tsd_get(struct u_tsd *tsd);
-
-void
-u_tsd_set(struct u_tsd *tsd, void *ptr);
-
-#endif /* _U_THREAD_H_ */
+/*
+ * Mesa 3-D graphics library
+ * Version: 6.5.2
+ *
+ * Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+
+/*
+ * Thread support for gl dispatch.
+ *
+ * Initial version by John Stone (j.stone@acm.org) (johns@cs.umr.edu)
+ * and Christoph Poliwoda (poliwoda@volumegraphics.com)
+ * Revised by Keith Whitwell
+ * Adapted for new gl dispatcher by Brian Paul
+ * Modified for use in mapi by Chia-I Wu
+ */
+
+/*
+ * If this file is accidentally included by a non-threaded build,
+ * it should not cause the build to fail, or otherwise cause problems.
+ * In general, it should only be included when needed however.
+ */
+
+#ifndef _U_THREAD_H_
+#define _U_THREAD_H_
+
+#include "u_compiler.h"
+
+#if defined(PTHREADS) || defined(WIN32) || defined(BEOS_THREADS)
+#ifndef THREADS
+#define THREADS
+#endif
+#endif
+
+/*
+ * POSIX threads. This should be your choice in the Unix world
+ * whenever possible. When building with POSIX threads, be sure
+ * to enable any compiler flags which will cause the MT-safe
+ * libc (if one exists) to be used when linking, as well as any
+ * header macros for MT-safe errno, etc. For Solaris, this is the -mt
+ * compiler flag. On Solaris with gcc, use -D_REENTRANT to enable
+ * proper compiling for MT-safe libc etc.
+ */
+#if defined(PTHREADS)
+#include <pthread.h> /* POSIX threads headers */
+
+struct u_tsd {
+ pthread_key_t key;
+ int initMagic;
+};
+
+typedef pthread_mutex_t u_mutex;
+
+#define u_mutex_declare_static(name) \
+ static u_mutex name = PTHREAD_MUTEX_INITIALIZER
+
+#define u_mutex_init(name) pthread_mutex_init(&(name), NULL)
+#define u_mutex_destroy(name) pthread_mutex_destroy(&(name))
+#define u_mutex_lock(name) (void) pthread_mutex_lock(&(name))
+#define u_mutex_unlock(name) (void) pthread_mutex_unlock(&(name))
+
+#endif /* PTHREADS */
+
+
+/*
+ * Windows threads. Should work with Windows NT and 95.
+ * IMPORTANT: Link with multithreaded runtime library when THREADS are
+ * used!
+ */
+#ifdef WIN32
+#include <windows.h>
+
+struct u_tsd {
+ DWORD key;
+ int initMagic;
+};
+
+typedef CRITICAL_SECTION u_mutex;
+
+/* http://locklessinc.com/articles/pthreads_on_windows/ */
+#define u_mutex_declare_static(name) \
+ static u_mutex name = {(PCRITICAL_SECTION_DEBUG)-1, -1, 0, 0, 0, 0}
+
+#define u_mutex_init(name) InitializeCriticalSection(&name)
+#define u_mutex_destroy(name) DeleteCriticalSection(&name)
+#define u_mutex_lock(name) EnterCriticalSection(&name)
+#define u_mutex_unlock(name) LeaveCriticalSection(&name)
+
+#endif /* WIN32 */
+
+
+/*
+ * BeOS threads. R5.x required.
+ */
+#ifdef BEOS_THREADS
+
+/* Problem with OS.h and this file on haiku */
+#ifndef __HAIKU__
+#include <kernel/OS.h>
+#endif
+
+#include <support/TLS.h>
+
+/* The only two typedefs required here
+ * this is cause of the OS.h problem
+ */
+#ifdef __HAIKU__
+typedef int32 thread_id;
+typedef int32 sem_id;
+#endif
+
+struct u_tsd {
+ int32 key;
+ int initMagic;
+};
+
+/* Use Benaphore, aka speeder semaphore */
+typedef struct {
+ int32 lock;
+ sem_id sem;
+} benaphore;
+typedef benaphore u_mutex;
+
+#define u_mutex_declare_static(name) \
+ static u_mutex name = { 0, 0 }
+
+#define u_mutex_init(name) \
+ name.sem = create_sem(0, #name"_benaphore"), \
+ name.lock = 0
+
+#define u_mutex_destroy(name) \
+ delete_sem(name.sem), \
+ name.lock = 0
+
+#define u_mutex_lock(name) \
+ if (name.sem == 0) \
+ u_mutex_init(name); \
+ if (atomic_add(&(name.lock), 1) >= 1) \
+ acquire_sem(name.sem)
+
+#define u_mutex_unlock(name) \
+ if (atomic_add(&(name.lock), -1) > 1) \
+ release_sem(name.sem)
+
+#endif /* BEOS_THREADS */
+
+
+/*
+ * THREADS not defined
+ */
+#ifndef THREADS
+
+struct u_tsd {
+ int initMagic;
+};
+
+typedef unsigned u_mutex;
+
+#define u_mutex_declare_static(name) static u_mutex name = 0
+#define u_mutex_init(name) (void) name
+#define u_mutex_destroy(name) (void) name
+#define u_mutex_lock(name) (void) name
+#define u_mutex_unlock(name) (void) name
+
+#endif /* THREADS */
+
+
+unsigned long
+u_thread_self(void);
+
+void
+u_tsd_init(struct u_tsd *tsd);
+
+void
+u_tsd_destroy(struct u_tsd *tsd); /* WIN32 only */
+
+void *
+u_tsd_get(struct u_tsd *tsd);
+
+void
+u_tsd_set(struct u_tsd *tsd, void *ptr);
+
+#endif /* _U_THREAD_H_ */
diff --git a/mesalib/src/mesa/SConscript b/mesalib/src/mesa/SConscript
index 2d8a17727..a3f025ff9 100644
--- a/mesalib/src/mesa/SConscript
+++ b/mesalib/src/mesa/SConscript
@@ -1,481 +1,481 @@
-#######################################################################
-# SConscript for Mesa
-
-
-Import('*')
-
-env = env.Clone()
-
-env.Append(CPPPATH = [
- '#/src/mapi',
- '#/src/glsl',
- '#/src/mesa',
-])
-
-env.Append(CPPDEFINES = [
- 'FEATURE_GL=1',
-])
-
-if env['platform'] == 'windows':
- env.Append(CPPDEFINES = [
- '_GDI32_', # prevent gl* being declared __declspec(dllimport) in MS headers
- 'BUILD_GL32', # declare gl* as __declspec(dllexport) in Mesa headers
- ])
- if not env['gles']:
- # prevent _glapi_* from being declared __declspec(dllimport)
- env.Append(CPPDEFINES = ['_GLAPI_NO_EXPORTS'])
-else:
- env.Append(CPPDEFINES = [
- 'IN_DRI_DRIVER', # enable the remap table (for DRI drivers)
- ])
-
-#
-# Source files
-#
-
-main_sources = [
- 'main/api_arrayelt.c',
- 'main/api_exec.c',
- 'main/api_loopback.c',
- 'main/api_noop.c',
- 'main/api_validate.c',
- 'main/accum.c',
- 'main/arbprogram.c',
- 'main/atifragshader.c',
- 'main/attrib.c',
- 'main/arrayobj.c',
- 'main/blend.c',
- 'main/bufferobj.c',
- 'main/buffers.c',
- 'main/clear.c',
- 'main/clip.c',
- 'main/colortab.c',
- 'main/condrender.c',
- 'main/context.c',
- 'main/convolve.c',
- 'main/cpuinfo.c',
- 'main/debug.c',
- 'main/depth.c',
- 'main/depthstencil.c',
- 'main/dlist.c',
- 'main/dlopen.c',
- 'main/drawpix.c',
- 'main/drawtex.c',
- 'main/enable.c',
- 'main/enums.c',
- 'main/eval.c',
- 'main/execmem.c',
- 'main/extensions.c',
- 'main/fbobject.c',
- 'main/feedback.c',
- 'main/ff_fragment_shader.cpp',
- 'main/ffvertex_prog.c',
- 'main/fog.c',
- 'main/formats.c',
- 'main/framebuffer.c',
- 'main/get.c',
- 'main/getstring.c',
- 'main/hash.c',
- 'main/hint.c',
- 'main/histogram.c',
- 'main/image.c',
- 'main/imports.c',
- 'main/light.c',
- 'main/lines.c',
- 'main/matrix.c',
- 'main/mipmap.c',
- 'main/mm.c',
- 'main/multisample.c',
- 'main/nvprogram.c',
- 'main/pack.c',
- 'main/pbo.c',
- 'main/pixel.c',
- 'main/pixelstore.c',
- 'main/pixeltransfer.c',
- 'main/points.c',
- 'main/polygon.c',
- 'main/querymatrix.c',
- 'main/queryobj.c',
- 'main/rastpos.c',
- 'main/readpix.c',
- 'main/remap.c',
- 'main/renderbuffer.c',
- 'main/samplerobj.c',
- 'main/scissor.c',
- 'main/shaderapi.c',
- 'main/shaderobj.c',
- 'main/shared.c',
- 'main/state.c',
- 'main/stencil.c',
- 'main/syncobj.c',
- 'main/texcompress.c',
- 'main/texcompress_rgtc.c',
- 'main/texcompress_s3tc.c',
- 'main/texcompress_fxt1.c',
- 'main/texenv.c',
- 'main/texfetch.c',
- 'main/texformat.c',
- 'main/texgen.c',
- 'main/texgetimage.c',
- 'main/teximage.c',
- 'main/texobj.c',
- 'main/texpal.c',
- 'main/texparam.c',
- 'main/texrender.c',
- 'main/texstate.c',
- 'main/texstore.c',
- 'main/texturebarrier.c',
- 'main/transformfeedback.c',
- 'main/uniforms.c',
- 'main/varray.c',
- 'main/version.c',
- 'main/viewport.c',
- 'main/vtxfmt.c',
-]
-
-math_sources = [
- 'math/m_debug_clip.c',
- 'math/m_debug_norm.c',
- 'math/m_debug_xform.c',
- 'math/m_eval.c',
- 'math/m_matrix.c',
- 'math/m_translate.c',
- 'math/m_vector.c',
- 'math/m_xform.c',
-]
-
-math_xform_sources = [
- 'math/m_xform.c'
-]
-
-swrast_sources = [
- 'swrast/s_aaline.c',
- 'swrast/s_aatriangle.c',
- 'swrast/s_accum.c',
- 'swrast/s_alpha.c',
- 'swrast/s_atifragshader.c',
- 'swrast/s_bitmap.c',
- 'swrast/s_blend.c',
- 'swrast/s_blit.c',
- 'swrast/s_clear.c',
- 'swrast/s_copypix.c',
- 'swrast/s_context.c',
- 'swrast/s_depth.c',
- 'swrast/s_drawpix.c',
- 'swrast/s_feedback.c',
- 'swrast/s_fog.c',
- 'swrast/s_fragprog.c',
- 'swrast/s_lines.c',
- 'swrast/s_logic.c',
- 'swrast/s_masking.c',
- 'swrast/s_points.c',
- 'swrast/s_readpix.c',
- 'swrast/s_span.c',
- 'swrast/s_stencil.c',
- 'swrast/s_texcombine.c',
- 'swrast/s_texfilter.c',
- 'swrast/s_triangle.c',
- 'swrast/s_zoom.c',
-]
-
-swrast_setup_sources = [
- 'swrast_setup/ss_context.c',
- 'swrast_setup/ss_triangle.c',
-]
-
-tnl_sources = [
- 'tnl/t_context.c',
- 'tnl/t_pipeline.c',
- 'tnl/t_draw.c',
- 'tnl/t_rasterpos.c',
- 'tnl/t_vb_program.c',
- 'tnl/t_vb_render.c',
- 'tnl/t_vb_texgen.c',
- 'tnl/t_vb_texmat.c',
- 'tnl/t_vb_vertex.c',
- 'tnl/t_vb_fog.c',
- 'tnl/t_vb_light.c',
- 'tnl/t_vb_normals.c',
- 'tnl/t_vb_points.c',
- 'tnl/t_vp_build.c',
- 'tnl/t_vertex.c',
- 'tnl/t_vertex_sse.c',
- 'tnl/t_vertex_generic.c',
-]
-
-vbo_sources = [
- 'vbo/vbo_context.c',
- 'vbo/vbo_exec.c',
- 'vbo/vbo_exec_api.c',
- 'vbo/vbo_exec_array.c',
- 'vbo/vbo_exec_draw.c',
- 'vbo/vbo_exec_eval.c',
- 'vbo/vbo_rebase.c',
- 'vbo/vbo_split.c',
- 'vbo/vbo_split_copy.c',
- 'vbo/vbo_split_inplace.c',
- 'vbo/vbo_save.c',
- 'vbo/vbo_save_api.c',
- 'vbo/vbo_save_draw.c',
- 'vbo/vbo_save_loopback.c',
-]
-
-statetracker_sources = [
- 'state_tracker/st_atom.c',
- 'state_tracker/st_atom_blend.c',
- 'state_tracker/st_atom_clip.c',
- 'state_tracker/st_atom_constbuf.c',
- 'state_tracker/st_atom_depth.c',
- 'state_tracker/st_atom_framebuffer.c',
- 'state_tracker/st_atom_msaa.c',
- 'state_tracker/st_atom_pixeltransfer.c',
- 'state_tracker/st_atom_sampler.c',
- 'state_tracker/st_atom_scissor.c',
- 'state_tracker/st_atom_shader.c',
- 'state_tracker/st_atom_rasterizer.c',
- 'state_tracker/st_atom_stipple.c',
- 'state_tracker/st_atom_texture.c',
- 'state_tracker/st_atom_viewport.c',
- 'state_tracker/st_cb_accum.c',
- 'state_tracker/st_cb_bitmap.c',
- 'state_tracker/st_cb_blit.c',
- 'state_tracker/st_cb_bufferobjects.c',
- 'state_tracker/st_cb_clear.c',
- 'state_tracker/st_cb_condrender.c',
- 'state_tracker/st_cb_flush.c',
- 'state_tracker/st_cb_drawpixels.c',
- 'state_tracker/st_cb_drawtex.c',
- 'state_tracker/st_cb_eglimage.c',
- 'state_tracker/st_cb_fbo.c',
- 'state_tracker/st_cb_feedback.c',
- 'state_tracker/st_cb_program.c',
- 'state_tracker/st_cb_queryobj.c',
- 'state_tracker/st_cb_rasterpos.c',
- 'state_tracker/st_cb_readpixels.c',
- 'state_tracker/st_cb_syncobj.c',
- 'state_tracker/st_cb_strings.c',
- 'state_tracker/st_cb_texture.c',
- 'state_tracker/st_cb_texturebarrier.c',
- 'state_tracker/st_cb_viewport.c',
- 'state_tracker/st_cb_xformfb.c',
- 'state_tracker/st_context.c',
- 'state_tracker/st_debug.c',
- 'state_tracker/st_draw.c',
- 'state_tracker/st_draw_feedback.c',
- 'state_tracker/st_extensions.c',
- 'state_tracker/st_format.c',
- 'state_tracker/st_gen_mipmap.c',
- 'state_tracker/st_manager.c',
- 'state_tracker/st_mesa_to_tgsi.c',
- 'state_tracker/st_program.c',
- 'state_tracker/st_texture.c',
-]
-
-env.Append(YACCFLAGS = '-d')
-program_lex = env.CFile('program/lex.yy.c', 'program/program_lexer.l')
-program_parse = env.CFile('program/program_parse.tab.c',
- 'program/program_parse.y')
-
-# Make program/program_parse.tab.h reacheable from the include path
-env.Append(CPPPATH = [Dir('.').abspath])
-
-program_sources = [
- 'program/arbprogparse.c',
- 'program/hash_table.c',
- 'program/ir_to_mesa.cpp',
- 'program/nvfragparse.c',
- 'program/nvvertparse.c',
- 'program/program.c',
- 'program/program_parse_extra.c',
- 'program/prog_cache.c',
- 'program/prog_execute.c',
- 'program/prog_instruction.c',
- 'program/prog_noise.c',
- 'program/prog_optimize.c',
- 'program/prog_parameter.c',
- 'program/prog_parameter_layout.c',
- 'program/prog_print.c',
- 'program/prog_statevars.c',
- 'program/prog_uniform.c',
- 'program/programopt.c',
- 'program/sampler.cpp',
- 'program/symbol_table.c',
- program_lex,
- program_parse[0],
-]
-
-common_driver_sources = [
- 'drivers/common/driverfuncs.c',
- 'drivers/common/meta.c',
-]
-
-mesa_sources = (
- main_sources +
- math_sources +
- math_xform_sources +
- program_sources +
- vbo_sources +
- tnl_sources +
- swrast_sources +
- swrast_setup_sources +
- common_driver_sources +
- statetracker_sources
-)
-
-if env['gles']:
- from sys import executable as python_cmd
-
- env.Append(CPPDEFINES = ['FEATURE_ES1=1', 'FEATURE_ES2=1'])
-
- # generate GLES sources
- gles_sources = []
- gles_sources += env.CodeGenerate(
- target = 'main/api_exec_es1.c',
- script = 'main/es_generator.py',
- source = 'main/APIspec.xml',
- command = python_cmd + ' $SCRIPT -S $SOURCE -V GLES1.1 > $TARGET'
- )
- gles_sources += env.CodeGenerate(
- target = 'main/api_exec_es2.c',
- script = 'main/es_generator.py',
- source = 'main/APIspec.xml',
- command = python_cmd + ' $SCRIPT -S $SOURCE -V GLES2.0 > $TARGET'
- )
-
- # generate GLES headers
- GLAPI = '#src/mapi/glapi/'
- gles_headers = []
- gles_headers += env.CodeGenerate(
- target = 'es1api/main/glapidispatch.h',
- script = GLAPI + 'gen/gl_table.py',
- source = GLAPI + 'gen-es/es1_API.xml',
- command = python_cmd + ' $SCRIPT -c -m remap_table -f $SOURCE > $TARGET',
- )
- gles_headers += env.CodeGenerate(
- target = 'es1api/main/remap_helper.h',
- script = GLAPI + 'gen/remap_helper.py',
- source = GLAPI + 'gen-es/es1_API.xml',
- command = python_cmd + ' $SCRIPT -f $SOURCE > $TARGET',
- )
- gles_headers += env.CodeGenerate(
- target = 'es2api/main/glapidispatch.h',
- script = GLAPI + 'gen/gl_table.py',
- source = GLAPI + 'gen-es/es2_API.xml',
- command = python_cmd + ' $SCRIPT -c -m remap_table -f $SOURCE > $TARGET',
- )
- gles_headers += env.CodeGenerate(
- target = 'es2api/main/remap_helper.h',
- script = GLAPI + 'gen/remap_helper.py',
- source = GLAPI + 'gen-es/es2_API.xml',
- command = python_cmd + ' $SCRIPT -f $SOURCE > $TARGET',
- )
-
- env.Depends(gles_sources, gles_headers)
-
- # gles_sources #include gles_headers with full path
- env.Append(CPPPATH = [gles_headers[0].dir.up().up()])
-
- mesa_sources += gles_sources
-
-#
-# Assembly sources
-#
-if env['gcc'] and env['platform'] != 'windows':
- if env['machine'] == 'x86':
- env.Append(CPPDEFINES = [
- 'USE_X86_ASM',
- 'USE_MMX_ASM',
- 'USE_3DNOW_ASM',
- 'USE_SSE_ASM',
- ])
- mesa_sources += [
- 'x86/common_x86.c',
- 'x86/x86_xform.c',
- 'x86/3dnow.c',
- 'x86/sse.c',
- 'x86/common_x86_asm.S',
- 'x86/x86_xform2.S',
- 'x86/x86_xform3.S',
- 'x86/x86_xform4.S',
- 'x86/x86_cliptest.S',
- 'x86/mmx_blend.S',
- 'x86/3dnow_xform1.S',
- 'x86/3dnow_xform2.S',
- 'x86/3dnow_xform3.S',
- 'x86/3dnow_xform4.S',
- 'x86/3dnow_normal.S',
- 'x86/sse_xform1.S',
- 'x86/sse_xform2.S',
- 'x86/sse_xform3.S',
- 'x86/sse_xform4.S',
- 'x86/sse_normal.S',
- 'x86/read_rgba_span_x86.S',
- ]
- elif env['machine'] == 'x86_64':
- env.Append(CPPDEFINES = [
- 'USE_X86_64_ASM',
- ])
- mesa_sources += [
- 'x86-64/x86-64.c',
- 'x86-64/xform4.S',
- ]
- elif env['machine'] == 'ppc':
- env.Append(CPPDEFINES = [
- 'USE_PPC_ASM',
- 'USE_VMX_ASM',
- ])
- mesa_sources += [
- 'ppc/common_ppc.c',
- ]
- elif env['machine'] == 'sparc':
- mesa_sources += [
- 'sparc/sparc.c',
- 'sparc/clip.S',
- 'sparc/norm.S',
- 'sparc/xform.S',
- ]
- else:
- pass
-
- # Generate matypes.h
- if env['machine'] in ('x86', 'x86_64'):
- # See http://www.scons.org/wiki/UsingCodeGenerators
- gen_matypes = env.Program(
- target = 'gen_matypes',
- source = 'x86/gen_matypes.c',
- )
- matypes = env.Command(
- 'matypes.h',
- gen_matypes,
- gen_matypes[0].abspath + ' > $TARGET',
- )
- # Add the dir containing the generated header (somewhere inside the
- # build dir) to the include path
- env.Append(CPPPATH = [matypes[0].dir])
-
-
-# Create the git_sha1.h file if it doesn't exist already
-try:
- f = open('main/git_sha1.h', 'r')
- f.close()
-except IOError:
- f = open('main/git_sha1.h', 'w')
- f.close()
-# and update CPPPATH so the git_sha1.h header can be found
-env.Append(CPPPATH = ["#" + env['build_dir'] + "/mesa/main"])
-
-
-#
-# Libraries
-#
-
-mesa = env.ConvenienceLibrary(
- target = 'mesa',
- source = mesa_sources,
-)
-
-env.Alias('mesa', mesa)
-
-Export('mesa')
-
-SConscript('drivers/SConscript')
+#######################################################################
+# SConscript for Mesa
+
+
+Import('*')
+
+env = env.Clone()
+
+env.Append(CPPPATH = [
+ '#/src/mapi',
+ '#/src/glsl',
+ '#/src/mesa',
+])
+
+env.Append(CPPDEFINES = [
+ 'FEATURE_GL=1',
+])
+
+if env['platform'] == 'windows':
+ env.Append(CPPDEFINES = [
+ '_GDI32_', # prevent gl* being declared __declspec(dllimport) in MS headers
+ 'BUILD_GL32', # declare gl* as __declspec(dllexport) in Mesa headers
+ ])
+ if not env['gles']:
+ # prevent _glapi_* from being declared __declspec(dllimport)
+ env.Append(CPPDEFINES = ['_GLAPI_NO_EXPORTS'])
+else:
+ env.Append(CPPDEFINES = [
+ 'IN_DRI_DRIVER', # enable the remap table (for DRI drivers)
+ ])
+
+#
+# Source files
+#
+
+main_sources = [
+ 'main/api_arrayelt.c',
+ 'main/api_exec.c',
+ 'main/api_loopback.c',
+ 'main/api_noop.c',
+ 'main/api_validate.c',
+ 'main/accum.c',
+ 'main/arbprogram.c',
+ 'main/atifragshader.c',
+ 'main/attrib.c',
+ 'main/arrayobj.c',
+ 'main/blend.c',
+ 'main/bufferobj.c',
+ 'main/buffers.c',
+ 'main/clear.c',
+ 'main/clip.c',
+ 'main/colortab.c',
+ 'main/condrender.c',
+ 'main/context.c',
+ 'main/convolve.c',
+ 'main/cpuinfo.c',
+ 'main/debug.c',
+ 'main/depth.c',
+ 'main/depthstencil.c',
+ 'main/dlist.c',
+ 'main/dlopen.c',
+ 'main/drawpix.c',
+ 'main/drawtex.c',
+ 'main/enable.c',
+ 'main/enums.c',
+ 'main/eval.c',
+ 'main/execmem.c',
+ 'main/extensions.c',
+ 'main/fbobject.c',
+ 'main/feedback.c',
+ 'main/ff_fragment_shader.cpp',
+ 'main/ffvertex_prog.c',
+ 'main/fog.c',
+ 'main/formats.c',
+ 'main/framebuffer.c',
+ 'main/get.c',
+ 'main/getstring.c',
+ 'main/hash.c',
+ 'main/hint.c',
+ 'main/histogram.c',
+ 'main/image.c',
+ 'main/imports.c',
+ 'main/light.c',
+ 'main/lines.c',
+ 'main/matrix.c',
+ 'main/mipmap.c',
+ 'main/mm.c',
+ 'main/multisample.c',
+ 'main/nvprogram.c',
+ 'main/pack.c',
+ 'main/pbo.c',
+ 'main/pixel.c',
+ 'main/pixelstore.c',
+ 'main/pixeltransfer.c',
+ 'main/points.c',
+ 'main/polygon.c',
+ 'main/querymatrix.c',
+ 'main/queryobj.c',
+ 'main/rastpos.c',
+ 'main/readpix.c',
+ 'main/remap.c',
+ 'main/renderbuffer.c',
+ 'main/samplerobj.c',
+ 'main/scissor.c',
+ 'main/shaderapi.c',
+ 'main/shaderobj.c',
+ 'main/shared.c',
+ 'main/state.c',
+ 'main/stencil.c',
+ 'main/syncobj.c',
+ 'main/texcompress.c',
+ 'main/texcompress_rgtc.c',
+ 'main/texcompress_s3tc.c',
+ 'main/texcompress_fxt1.c',
+ 'main/texenv.c',
+ 'main/texfetch.c',
+ 'main/texformat.c',
+ 'main/texgen.c',
+ 'main/texgetimage.c',
+ 'main/teximage.c',
+ 'main/texobj.c',
+ 'main/texpal.c',
+ 'main/texparam.c',
+ 'main/texrender.c',
+ 'main/texstate.c',
+ 'main/texstore.c',
+ 'main/texturebarrier.c',
+ 'main/transformfeedback.c',
+ 'main/uniforms.c',
+ 'main/varray.c',
+ 'main/version.c',
+ 'main/viewport.c',
+ 'main/vtxfmt.c',
+]
+
+math_sources = [
+ 'math/m_debug_clip.c',
+ 'math/m_debug_norm.c',
+ 'math/m_debug_xform.c',
+ 'math/m_eval.c',
+ 'math/m_matrix.c',
+ 'math/m_translate.c',
+ 'math/m_vector.c',
+ 'math/m_xform.c',
+]
+
+math_xform_sources = [
+ 'math/m_xform.c'
+]
+
+swrast_sources = [
+ 'swrast/s_aaline.c',
+ 'swrast/s_aatriangle.c',
+ 'swrast/s_accum.c',
+ 'swrast/s_alpha.c',
+ 'swrast/s_atifragshader.c',
+ 'swrast/s_bitmap.c',
+ 'swrast/s_blend.c',
+ 'swrast/s_blit.c',
+ 'swrast/s_clear.c',
+ 'swrast/s_copypix.c',
+ 'swrast/s_context.c',
+ 'swrast/s_depth.c',
+ 'swrast/s_drawpix.c',
+ 'swrast/s_feedback.c',
+ 'swrast/s_fog.c',
+ 'swrast/s_fragprog.c',
+ 'swrast/s_lines.c',
+ 'swrast/s_logic.c',
+ 'swrast/s_masking.c',
+ 'swrast/s_points.c',
+ 'swrast/s_readpix.c',
+ 'swrast/s_span.c',
+ 'swrast/s_stencil.c',
+ 'swrast/s_texcombine.c',
+ 'swrast/s_texfilter.c',
+ 'swrast/s_triangle.c',
+ 'swrast/s_zoom.c',
+]
+
+swrast_setup_sources = [
+ 'swrast_setup/ss_context.c',
+ 'swrast_setup/ss_triangle.c',
+]
+
+tnl_sources = [
+ 'tnl/t_context.c',
+ 'tnl/t_pipeline.c',
+ 'tnl/t_draw.c',
+ 'tnl/t_rasterpos.c',
+ 'tnl/t_vb_program.c',
+ 'tnl/t_vb_render.c',
+ 'tnl/t_vb_texgen.c',
+ 'tnl/t_vb_texmat.c',
+ 'tnl/t_vb_vertex.c',
+ 'tnl/t_vb_fog.c',
+ 'tnl/t_vb_light.c',
+ 'tnl/t_vb_normals.c',
+ 'tnl/t_vb_points.c',
+ 'tnl/t_vp_build.c',
+ 'tnl/t_vertex.c',
+ 'tnl/t_vertex_sse.c',
+ 'tnl/t_vertex_generic.c',
+]
+
+vbo_sources = [
+ 'vbo/vbo_context.c',
+ 'vbo/vbo_exec.c',
+ 'vbo/vbo_exec_api.c',
+ 'vbo/vbo_exec_array.c',
+ 'vbo/vbo_exec_draw.c',
+ 'vbo/vbo_exec_eval.c',
+ 'vbo/vbo_rebase.c',
+ 'vbo/vbo_split.c',
+ 'vbo/vbo_split_copy.c',
+ 'vbo/vbo_split_inplace.c',
+ 'vbo/vbo_save.c',
+ 'vbo/vbo_save_api.c',
+ 'vbo/vbo_save_draw.c',
+ 'vbo/vbo_save_loopback.c',
+]
+
+statetracker_sources = [
+ 'state_tracker/st_atom.c',
+ 'state_tracker/st_atom_blend.c',
+ 'state_tracker/st_atom_clip.c',
+ 'state_tracker/st_atom_constbuf.c',
+ 'state_tracker/st_atom_depth.c',
+ 'state_tracker/st_atom_framebuffer.c',
+ 'state_tracker/st_atom_msaa.c',
+ 'state_tracker/st_atom_pixeltransfer.c',
+ 'state_tracker/st_atom_sampler.c',
+ 'state_tracker/st_atom_scissor.c',
+ 'state_tracker/st_atom_shader.c',
+ 'state_tracker/st_atom_rasterizer.c',
+ 'state_tracker/st_atom_stipple.c',
+ 'state_tracker/st_atom_texture.c',
+ 'state_tracker/st_atom_viewport.c',
+ 'state_tracker/st_cb_accum.c',
+ 'state_tracker/st_cb_bitmap.c',
+ 'state_tracker/st_cb_blit.c',
+ 'state_tracker/st_cb_bufferobjects.c',
+ 'state_tracker/st_cb_clear.c',
+ 'state_tracker/st_cb_condrender.c',
+ 'state_tracker/st_cb_flush.c',
+ 'state_tracker/st_cb_drawpixels.c',
+ 'state_tracker/st_cb_drawtex.c',
+ 'state_tracker/st_cb_eglimage.c',
+ 'state_tracker/st_cb_fbo.c',
+ 'state_tracker/st_cb_feedback.c',
+ 'state_tracker/st_cb_program.c',
+ 'state_tracker/st_cb_queryobj.c',
+ 'state_tracker/st_cb_rasterpos.c',
+ 'state_tracker/st_cb_readpixels.c',
+ 'state_tracker/st_cb_syncobj.c',
+ 'state_tracker/st_cb_strings.c',
+ 'state_tracker/st_cb_texture.c',
+ 'state_tracker/st_cb_texturebarrier.c',
+ 'state_tracker/st_cb_viewport.c',
+ 'state_tracker/st_cb_xformfb.c',
+ 'state_tracker/st_context.c',
+ 'state_tracker/st_debug.c',
+ 'state_tracker/st_draw.c',
+ 'state_tracker/st_draw_feedback.c',
+ 'state_tracker/st_extensions.c',
+ 'state_tracker/st_format.c',
+ 'state_tracker/st_gen_mipmap.c',
+ 'state_tracker/st_manager.c',
+ 'state_tracker/st_mesa_to_tgsi.c',
+ 'state_tracker/st_program.c',
+ 'state_tracker/st_texture.c',
+]
+
+env.Append(YACCFLAGS = '-d')
+program_lex = env.CFile('program/lex.yy.c', 'program/program_lexer.l')
+program_parse = env.CFile('program/program_parse.tab.c',
+ 'program/program_parse.y')
+
+# Make program/program_parse.tab.h reacheable from the include path
+env.Append(CPPPATH = [Dir('.').abspath])
+
+program_sources = [
+ 'program/arbprogparse.c',
+ 'program/hash_table.c',
+ 'program/ir_to_mesa.cpp',
+ 'program/nvfragparse.c',
+ 'program/nvvertparse.c',
+ 'program/program.c',
+ 'program/program_parse_extra.c',
+ 'program/prog_cache.c',
+ 'program/prog_execute.c',
+ 'program/prog_instruction.c',
+ 'program/prog_noise.c',
+ 'program/prog_optimize.c',
+ 'program/prog_parameter.c',
+ 'program/prog_parameter_layout.c',
+ 'program/prog_print.c',
+ 'program/prog_statevars.c',
+ 'program/prog_uniform.c',
+ 'program/programopt.c',
+ 'program/sampler.cpp',
+ 'program/symbol_table.c',
+ program_lex,
+ program_parse[0],
+]
+
+common_driver_sources = [
+ 'drivers/common/driverfuncs.c',
+ 'drivers/common/meta.c',
+]
+
+mesa_sources = (
+ main_sources +
+ math_sources +
+ math_xform_sources +
+ program_sources +
+ vbo_sources +
+ tnl_sources +
+ swrast_sources +
+ swrast_setup_sources +
+ common_driver_sources +
+ statetracker_sources
+)
+
+if env['gles']:
+ from sys import executable as python_cmd
+
+ env.Append(CPPDEFINES = ['FEATURE_ES1=1', 'FEATURE_ES2=1'])
+
+ # generate GLES sources
+ gles_sources = []
+ gles_sources += env.CodeGenerate(
+ target = 'main/api_exec_es1.c',
+ script = 'main/es_generator.py',
+ source = 'main/APIspec.xml',
+ command = python_cmd + ' $SCRIPT -S $SOURCE -V GLES1.1 > $TARGET'
+ )
+ gles_sources += env.CodeGenerate(
+ target = 'main/api_exec_es2.c',
+ script = 'main/es_generator.py',
+ source = 'main/APIspec.xml',
+ command = python_cmd + ' $SCRIPT -S $SOURCE -V GLES2.0 > $TARGET'
+ )
+
+ # generate GLES headers
+ GLAPI = '#src/mapi/glapi/'
+ gles_headers = []
+ gles_headers += env.CodeGenerate(
+ target = 'es1api/main/glapidispatch.h',
+ script = GLAPI + 'gen/gl_table.py',
+ source = GLAPI + 'gen-es/es1_API.xml',
+ command = python_cmd + ' $SCRIPT -c -m remap_table -f $SOURCE > $TARGET',
+ )
+ gles_headers += env.CodeGenerate(
+ target = 'es1api/main/remap_helper.h',
+ script = GLAPI + 'gen/remap_helper.py',
+ source = GLAPI + 'gen-es/es1_API.xml',
+ command = python_cmd + ' $SCRIPT -f $SOURCE > $TARGET',
+ )
+ gles_headers += env.CodeGenerate(
+ target = 'es2api/main/glapidispatch.h',
+ script = GLAPI + 'gen/gl_table.py',
+ source = GLAPI + 'gen-es/es2_API.xml',
+ command = python_cmd + ' $SCRIPT -c -m remap_table -f $SOURCE > $TARGET',
+ )
+ gles_headers += env.CodeGenerate(
+ target = 'es2api/main/remap_helper.h',
+ script = GLAPI + 'gen/remap_helper.py',
+ source = GLAPI + 'gen-es/es2_API.xml',
+ command = python_cmd + ' $SCRIPT -f $SOURCE > $TARGET',
+ )
+
+ env.Depends(gles_sources, gles_headers)
+
+ # gles_sources #include gles_headers with full path
+ env.Append(CPPPATH = [gles_headers[0].dir.up().up()])
+
+ mesa_sources += gles_sources
+
+#
+# Assembly sources
+#
+if env['gcc'] and env['platform'] != 'windows':
+ if env['machine'] == 'x86':
+ env.Append(CPPDEFINES = [
+ 'USE_X86_ASM',
+ 'USE_MMX_ASM',
+ 'USE_3DNOW_ASM',
+ 'USE_SSE_ASM',
+ ])
+ mesa_sources += [
+ 'x86/common_x86.c',
+ 'x86/x86_xform.c',
+ 'x86/3dnow.c',
+ 'x86/sse.c',
+ 'x86/common_x86_asm.S',
+ 'x86/x86_xform2.S',
+ 'x86/x86_xform3.S',
+ 'x86/x86_xform4.S',
+ 'x86/x86_cliptest.S',
+ 'x86/mmx_blend.S',
+ 'x86/3dnow_xform1.S',
+ 'x86/3dnow_xform2.S',
+ 'x86/3dnow_xform3.S',
+ 'x86/3dnow_xform4.S',
+ 'x86/3dnow_normal.S',
+ 'x86/sse_xform1.S',
+ 'x86/sse_xform2.S',
+ 'x86/sse_xform3.S',
+ 'x86/sse_xform4.S',
+ 'x86/sse_normal.S',
+ 'x86/read_rgba_span_x86.S',
+ ]
+ elif env['machine'] == 'x86_64':
+ env.Append(CPPDEFINES = [
+ 'USE_X86_64_ASM',
+ ])
+ mesa_sources += [
+ 'x86-64/x86-64.c',
+ 'x86-64/xform4.S',
+ ]
+ elif env['machine'] == 'ppc':
+ env.Append(CPPDEFINES = [
+ 'USE_PPC_ASM',
+ 'USE_VMX_ASM',
+ ])
+ mesa_sources += [
+ 'ppc/common_ppc.c',
+ ]
+ elif env['machine'] == 'sparc':
+ mesa_sources += [
+ 'sparc/sparc.c',
+ 'sparc/clip.S',
+ 'sparc/norm.S',
+ 'sparc/xform.S',
+ ]
+ else:
+ pass
+
+ # Generate matypes.h
+ if env['machine'] in ('x86', 'x86_64'):
+ # See http://www.scons.org/wiki/UsingCodeGenerators
+ gen_matypes = env.Program(
+ target = 'gen_matypes',
+ source = 'x86/gen_matypes.c',
+ )
+ matypes = env.Command(
+ 'matypes.h',
+ gen_matypes,
+ gen_matypes[0].abspath + ' > $TARGET',
+ )
+ # Add the dir containing the generated header (somewhere inside the
+ # build dir) to the include path
+ env.Append(CPPPATH = [matypes[0].dir])
+
+
+# Create the git_sha1.h file if it doesn't exist already
+try:
+ f = open('main/git_sha1.h', 'r')
+ f.close()
+except IOError:
+ f = open('main/git_sha1.h', 'w')
+ f.close()
+# and update CPPPATH so the git_sha1.h header can be found
+env.Append(CPPPATH = ["#" + env['build_dir'] + "/mesa/main"])
+
+
+#
+# Libraries
+#
+
+mesa = env.ConvenienceLibrary(
+ target = 'mesa',
+ source = mesa_sources,
+)
+
+env.Alias('mesa', mesa)
+
+Export('mesa')
+
+SConscript('drivers/SConscript')
diff --git a/mesalib/src/mesa/drivers/common/driverfuncs.c b/mesalib/src/mesa/drivers/common/driverfuncs.c
index 0dbc7c3e8..830fcf8a2 100644
--- a/mesalib/src/mesa/drivers/common/driverfuncs.c
+++ b/mesalib/src/mesa/drivers/common/driverfuncs.c
@@ -1,332 +1,332 @@
-/*
- * Mesa 3-D graphics library
- * Version: 7.1
- *
- * Copyright (C) 1999-2007 Brian Paul All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-
-#include "main/glheader.h"
-#include "main/imports.h"
-#include "main/arrayobj.h"
-#include "main/context.h"
-#include "main/framebuffer.h"
-#include "main/mipmap.h"
-#include "main/queryobj.h"
-#include "main/renderbuffer.h"
-#include "main/shaderobj.h"
-#include "main/texcompress.h"
-#include "main/texformat.h"
-#include "main/texgetimage.h"
-#include "main/teximage.h"
-#include "main/texobj.h"
-#include "main/texstore.h"
-#include "main/bufferobj.h"
-#include "main/fbobject.h"
-#include "main/texrender.h"
-#include "main/samplerobj.h"
-#include "main/syncobj.h"
-#include "main/texturebarrier.h"
-#include "main/transformfeedback.h"
-
-#include "program/program.h"
-#include "tnl/tnl.h"
-#include "swrast/swrast.h"
-
-#include "driverfuncs.h"
-#include "meta.h"
-
-
-
-/**
- * Plug in default functions for all pointers in the dd_function_table
- * structure.
- * Device drivers should call this function and then plug in any
- * functions which it wants to override.
- * Some functions (pointers) MUST be implemented by all drivers (REQUIRED).
- *
- * \param table the dd_function_table to initialize
- */
-void
-_mesa_init_driver_functions(struct dd_function_table *driver)
-{
- memset(driver, 0, sizeof(*driver));
-
- driver->GetString = NULL; /* REQUIRED! */
- driver->UpdateState = NULL; /* REQUIRED! */
- driver->GetBufferSize = NULL; /* REQUIRED! */
- driver->ResizeBuffers = _mesa_resize_framebuffer;
- driver->Error = NULL;
-
- driver->Finish = NULL;
- driver->Flush = NULL;
-
- /* framebuffer/image functions */
- driver->Clear = _swrast_Clear;
- driver->Accum = _swrast_Accum;
- driver->RasterPos = _tnl_RasterPos;
- driver->DrawPixels = _swrast_DrawPixels;
- driver->ReadPixels = _swrast_ReadPixels;
- driver->CopyPixels = _swrast_CopyPixels;
- driver->Bitmap = _swrast_Bitmap;
-
- /* Texture functions */
- driver->ChooseTextureFormat = _mesa_choose_tex_format;
- driver->TexImage1D = _mesa_store_teximage1d;
- driver->TexImage2D = _mesa_store_teximage2d;
- driver->TexImage3D = _mesa_store_teximage3d;
- driver->TexSubImage1D = _mesa_store_texsubimage1d;
- driver->TexSubImage2D = _mesa_store_texsubimage2d;
- driver->TexSubImage3D = _mesa_store_texsubimage3d;
- driver->GetTexImage = _mesa_get_teximage;
- driver->CopyTexImage1D = _mesa_meta_CopyTexImage1D;
- driver->CopyTexImage2D = _mesa_meta_CopyTexImage2D;
- driver->CopyTexSubImage1D = _mesa_meta_CopyTexSubImage1D;
- driver->CopyTexSubImage2D = _mesa_meta_CopyTexSubImage2D;
- driver->CopyTexSubImage3D = _mesa_meta_CopyTexSubImage3D;
- driver->GenerateMipmap = _mesa_meta_GenerateMipmap;
- driver->TestProxyTexImage = _mesa_test_proxy_teximage;
- driver->CompressedTexImage1D = _mesa_store_compressed_teximage1d;
- driver->CompressedTexImage2D = _mesa_store_compressed_teximage2d;
- driver->CompressedTexImage3D = _mesa_store_compressed_teximage3d;
- driver->CompressedTexSubImage1D = _mesa_store_compressed_texsubimage1d;
- driver->CompressedTexSubImage2D = _mesa_store_compressed_texsubimage2d;
- driver->CompressedTexSubImage3D = _mesa_store_compressed_texsubimage3d;
- driver->GetCompressedTexImage = _mesa_get_compressed_teximage;
- driver->BindTexture = NULL;
- driver->NewTextureObject = _mesa_new_texture_object;
- driver->DeleteTexture = _mesa_delete_texture_object;
- driver->NewTextureImage = _mesa_new_texture_image;
- driver->FreeTexImageData = _mesa_free_texture_image_data;
- driver->MapTexture = NULL;
- driver->UnmapTexture = NULL;
- driver->TextureMemCpy = memcpy;
- driver->IsTextureResident = NULL;
- driver->UpdateTexturePalette = NULL;
-
- /* imaging */
- driver->CopyColorTable = _mesa_meta_CopyColorTable;
- driver->CopyColorSubTable = _mesa_meta_CopyColorSubTable;
-
- /* Vertex/fragment programs */
- driver->BindProgram = NULL;
- driver->NewProgram = _mesa_new_program;
- driver->DeleteProgram = _mesa_delete_program;
-
- /* simple state commands */
- driver->AlphaFunc = NULL;
- driver->BlendColor = NULL;
- driver->BlendEquationSeparate = NULL;
- driver->BlendFuncSeparate = NULL;
- driver->ClearColor = NULL;
- driver->ClearDepth = NULL;
- driver->ClearStencil = NULL;
- driver->ClipPlane = NULL;
- driver->ColorMask = NULL;
- driver->ColorMaterial = NULL;
- driver->CullFace = NULL;
- driver->DrawBuffer = NULL;
- driver->DrawBuffers = NULL;
- driver->FrontFace = NULL;
- driver->DepthFunc = NULL;
- driver->DepthMask = NULL;
- driver->DepthRange = NULL;
- driver->Enable = NULL;
- driver->Fogfv = NULL;
- driver->Hint = NULL;
- driver->Lightfv = NULL;
- driver->LightModelfv = NULL;
- driver->LineStipple = NULL;
- driver->LineWidth = NULL;
- driver->LogicOpcode = NULL;
- driver->PointParameterfv = NULL;
- driver->PointSize = NULL;
- driver->PolygonMode = NULL;
- driver->PolygonOffset = NULL;
- driver->PolygonStipple = NULL;
- driver->ReadBuffer = NULL;
- driver->RenderMode = NULL;
- driver->Scissor = NULL;
- driver->ShadeModel = NULL;
- driver->StencilFuncSeparate = NULL;
- driver->StencilOpSeparate = NULL;
- driver->StencilMaskSeparate = NULL;
- driver->TexGen = NULL;
- driver->TexEnv = NULL;
- driver->TexParameter = NULL;
- driver->Viewport = NULL;
-
- /* buffer objects */
- _mesa_init_buffer_object_functions(driver);
-
- /* query objects */
- _mesa_init_query_object_functions(driver);
-
- _mesa_init_sync_object_functions(driver);
-
- driver->NewFramebuffer = _mesa_new_framebuffer;
- driver->NewRenderbuffer = _mesa_new_soft_renderbuffer;
- driver->RenderTexture = _mesa_render_texture;
- driver->FinishRenderTexture = _mesa_finish_render_texture;
- driver->FramebufferRenderbuffer = _mesa_framebuffer_renderbuffer;
- driver->ValidateFramebuffer = _mesa_validate_framebuffer;
-
- driver->BlitFramebuffer = _swrast_BlitFramebuffer;
-
- _mesa_init_texture_barrier_functions(driver);
-
- /* APPLE_vertex_array_object */
- driver->NewArrayObject = _mesa_new_array_object;
- driver->DeleteArrayObject = _mesa_delete_array_object;
- driver->BindArrayObject = NULL;
-
- _mesa_init_shader_object_functions(driver);
-
- _mesa_init_transform_feedback_functions(driver);
-
- _mesa_init_sampler_object_functions(driver);
-
- /* T&L stuff */
- driver->NeedValidate = GL_FALSE;
- driver->ValidateTnlModule = NULL;
- driver->CurrentExecPrimitive = 0;
- driver->CurrentSavePrimitive = 0;
- driver->NeedFlush = 0;
- driver->SaveNeedFlush = 0;
-
- driver->ProgramStringNotify = _tnl_program_string;
- driver->FlushVertices = NULL;
- driver->SaveFlushVertices = NULL;
- driver->NotifySaveBegin = NULL;
- driver->LightingSpaceChange = NULL;
-
- /* display list */
- driver->NewList = NULL;
- driver->EndList = NULL;
- driver->BeginCallList = NULL;
- driver->EndCallList = NULL;
-}
-
-
-/**
- * Call the ctx->Driver.* state functions with current values to initialize
- * driver state.
- * Only the Intel drivers use this so far.
- */
-void
-_mesa_init_driver_state(struct gl_context *ctx)
-{
- ctx->Driver.AlphaFunc(ctx, ctx->Color.AlphaFunc, ctx->Color.AlphaRef);
-
- ctx->Driver.BlendColor(ctx, ctx->Color.BlendColor);
-
- ctx->Driver.BlendEquationSeparate(ctx,
- ctx->Color.Blend[0].EquationRGB,
- ctx->Color.Blend[0].EquationA);
-
- ctx->Driver.BlendFuncSeparate(ctx,
- ctx->Color.Blend[0].SrcRGB,
- ctx->Color.Blend[0].DstRGB,
- ctx->Color.Blend[0].SrcA,
- ctx->Color.Blend[0].DstA);
-
- if (ctx->Driver.ColorMaskIndexed) {
- GLuint i;
- for (i = 0; i < ctx->Const.MaxDrawBuffers; i++) {
- ctx->Driver.ColorMaskIndexed(ctx, i,
- ctx->Color.ColorMask[0][RCOMP],
- ctx->Color.ColorMask[0][GCOMP],
- ctx->Color.ColorMask[0][BCOMP],
- ctx->Color.ColorMask[0][ACOMP]);
- }
- }
- else {
- ctx->Driver.ColorMask(ctx,
- ctx->Color.ColorMask[0][RCOMP],
- ctx->Color.ColorMask[0][GCOMP],
- ctx->Color.ColorMask[0][BCOMP],
- ctx->Color.ColorMask[0][ACOMP]);
- }
-
- ctx->Driver.CullFace(ctx, ctx->Polygon.CullFaceMode);
- ctx->Driver.DepthFunc(ctx, ctx->Depth.Func);
- ctx->Driver.DepthMask(ctx, ctx->Depth.Mask);
-
- ctx->Driver.Enable(ctx, GL_ALPHA_TEST, ctx->Color.AlphaEnabled);
- ctx->Driver.Enable(ctx, GL_BLEND, ctx->Color.BlendEnabled);
- ctx->Driver.Enable(ctx, GL_COLOR_LOGIC_OP, ctx->Color.ColorLogicOpEnabled);
- ctx->Driver.Enable(ctx, GL_COLOR_SUM, ctx->Fog.ColorSumEnabled);
- ctx->Driver.Enable(ctx, GL_CULL_FACE, ctx->Polygon.CullFlag);
- ctx->Driver.Enable(ctx, GL_DEPTH_TEST, ctx->Depth.Test);
- ctx->Driver.Enable(ctx, GL_DITHER, ctx->Color.DitherFlag);
- ctx->Driver.Enable(ctx, GL_FOG, ctx->Fog.Enabled);
- ctx->Driver.Enable(ctx, GL_LIGHTING, ctx->Light.Enabled);
- ctx->Driver.Enable(ctx, GL_LINE_SMOOTH, ctx->Line.SmoothFlag);
- ctx->Driver.Enable(ctx, GL_POLYGON_STIPPLE, ctx->Polygon.StippleFlag);
- ctx->Driver.Enable(ctx, GL_SCISSOR_TEST, ctx->Scissor.Enabled);
- ctx->Driver.Enable(ctx, GL_STENCIL_TEST, ctx->Stencil._Enabled);
- ctx->Driver.Enable(ctx, GL_TEXTURE_1D, GL_FALSE);
- ctx->Driver.Enable(ctx, GL_TEXTURE_2D, GL_FALSE);
- ctx->Driver.Enable(ctx, GL_TEXTURE_RECTANGLE_NV, GL_FALSE);
- ctx->Driver.Enable(ctx, GL_TEXTURE_3D, GL_FALSE);
- ctx->Driver.Enable(ctx, GL_TEXTURE_CUBE_MAP, GL_FALSE);
-
- ctx->Driver.Fogfv(ctx, GL_FOG_COLOR, ctx->Fog.Color);
- ctx->Driver.Fogfv(ctx, GL_FOG_MODE, 0);
- ctx->Driver.Fogfv(ctx, GL_FOG_DENSITY, &ctx->Fog.Density);
- ctx->Driver.Fogfv(ctx, GL_FOG_START, &ctx->Fog.Start);
- ctx->Driver.Fogfv(ctx, GL_FOG_END, &ctx->Fog.End);
-
- ctx->Driver.FrontFace(ctx, ctx->Polygon.FrontFace);
-
- {
- GLfloat f = (GLfloat) ctx->Light.Model.ColorControl;
- ctx->Driver.LightModelfv(ctx, GL_LIGHT_MODEL_COLOR_CONTROL, &f);
- }
-
- ctx->Driver.LineWidth(ctx, ctx->Line.Width);
- ctx->Driver.LogicOpcode(ctx, ctx->Color.LogicOp);
- ctx->Driver.PointSize(ctx, ctx->Point.Size);
- ctx->Driver.PolygonStipple(ctx, (const GLubyte *) ctx->PolygonStipple);
- ctx->Driver.Scissor(ctx, ctx->Scissor.X, ctx->Scissor.Y,
- ctx->Scissor.Width, ctx->Scissor.Height);
- ctx->Driver.ShadeModel(ctx, ctx->Light.ShadeModel);
- ctx->Driver.StencilFuncSeparate(ctx, GL_FRONT,
- ctx->Stencil.Function[0],
- ctx->Stencil.Ref[0],
- ctx->Stencil.ValueMask[0]);
- ctx->Driver.StencilFuncSeparate(ctx, GL_BACK,
- ctx->Stencil.Function[1],
- ctx->Stencil.Ref[1],
- ctx->Stencil.ValueMask[1]);
- ctx->Driver.StencilMaskSeparate(ctx, GL_FRONT, ctx->Stencil.WriteMask[0]);
- ctx->Driver.StencilMaskSeparate(ctx, GL_BACK, ctx->Stencil.WriteMask[1]);
- ctx->Driver.StencilOpSeparate(ctx, GL_FRONT,
- ctx->Stencil.FailFunc[0],
- ctx->Stencil.ZFailFunc[0],
- ctx->Stencil.ZPassFunc[0]);
- ctx->Driver.StencilOpSeparate(ctx, GL_BACK,
- ctx->Stencil.FailFunc[1],
- ctx->Stencil.ZFailFunc[1],
- ctx->Stencil.ZPassFunc[1]);
-
-
- ctx->Driver.DrawBuffer(ctx, ctx->Color.DrawBuffer[0]);
-}
+/*
+ * Mesa 3-D graphics library
+ * Version: 7.1
+ *
+ * Copyright (C) 1999-2007 Brian Paul All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+
+#include "main/glheader.h"
+#include "main/imports.h"
+#include "main/arrayobj.h"
+#include "main/context.h"
+#include "main/framebuffer.h"
+#include "main/mipmap.h"
+#include "main/queryobj.h"
+#include "main/renderbuffer.h"
+#include "main/shaderobj.h"
+#include "main/texcompress.h"
+#include "main/texformat.h"
+#include "main/texgetimage.h"
+#include "main/teximage.h"
+#include "main/texobj.h"
+#include "main/texstore.h"
+#include "main/bufferobj.h"
+#include "main/fbobject.h"
+#include "main/texrender.h"
+#include "main/samplerobj.h"
+#include "main/syncobj.h"
+#include "main/texturebarrier.h"
+#include "main/transformfeedback.h"
+
+#include "program/program.h"
+#include "tnl/tnl.h"
+#include "swrast/swrast.h"
+
+#include "driverfuncs.h"
+#include "meta.h"
+
+
+
+/**
+ * Plug in default functions for all pointers in the dd_function_table
+ * structure.
+ * Device drivers should call this function and then plug in any
+ * functions which it wants to override.
+ * Some functions (pointers) MUST be implemented by all drivers (REQUIRED).
+ *
+ * \param table the dd_function_table to initialize
+ */
+void
+_mesa_init_driver_functions(struct dd_function_table *driver)
+{
+ memset(driver, 0, sizeof(*driver));
+
+ driver->GetString = NULL; /* REQUIRED! */
+ driver->UpdateState = NULL; /* REQUIRED! */
+ driver->GetBufferSize = NULL; /* REQUIRED! */
+ driver->ResizeBuffers = _mesa_resize_framebuffer;
+ driver->Error = NULL;
+
+ driver->Finish = NULL;
+ driver->Flush = NULL;
+
+ /* framebuffer/image functions */
+ driver->Clear = _swrast_Clear;
+ driver->Accum = _swrast_Accum;
+ driver->RasterPos = _tnl_RasterPos;
+ driver->DrawPixels = _swrast_DrawPixels;
+ driver->ReadPixels = _swrast_ReadPixels;
+ driver->CopyPixels = _swrast_CopyPixels;
+ driver->Bitmap = _swrast_Bitmap;
+
+ /* Texture functions */
+ driver->ChooseTextureFormat = _mesa_choose_tex_format;
+ driver->TexImage1D = _mesa_store_teximage1d;
+ driver->TexImage2D = _mesa_store_teximage2d;
+ driver->TexImage3D = _mesa_store_teximage3d;
+ driver->TexSubImage1D = _mesa_store_texsubimage1d;
+ driver->TexSubImage2D = _mesa_store_texsubimage2d;
+ driver->TexSubImage3D = _mesa_store_texsubimage3d;
+ driver->GetTexImage = _mesa_get_teximage;
+ driver->CopyTexImage1D = _mesa_meta_CopyTexImage1D;
+ driver->CopyTexImage2D = _mesa_meta_CopyTexImage2D;
+ driver->CopyTexSubImage1D = _mesa_meta_CopyTexSubImage1D;
+ driver->CopyTexSubImage2D = _mesa_meta_CopyTexSubImage2D;
+ driver->CopyTexSubImage3D = _mesa_meta_CopyTexSubImage3D;
+ driver->GenerateMipmap = _mesa_meta_GenerateMipmap;
+ driver->TestProxyTexImage = _mesa_test_proxy_teximage;
+ driver->CompressedTexImage1D = _mesa_store_compressed_teximage1d;
+ driver->CompressedTexImage2D = _mesa_store_compressed_teximage2d;
+ driver->CompressedTexImage3D = _mesa_store_compressed_teximage3d;
+ driver->CompressedTexSubImage1D = _mesa_store_compressed_texsubimage1d;
+ driver->CompressedTexSubImage2D = _mesa_store_compressed_texsubimage2d;
+ driver->CompressedTexSubImage3D = _mesa_store_compressed_texsubimage3d;
+ driver->GetCompressedTexImage = _mesa_get_compressed_teximage;
+ driver->BindTexture = NULL;
+ driver->NewTextureObject = _mesa_new_texture_object;
+ driver->DeleteTexture = _mesa_delete_texture_object;
+ driver->NewTextureImage = _mesa_new_texture_image;
+ driver->FreeTexImageData = _mesa_free_texture_image_data;
+ driver->MapTexture = NULL;
+ driver->UnmapTexture = NULL;
+ driver->TextureMemCpy = memcpy;
+ driver->IsTextureResident = NULL;
+ driver->UpdateTexturePalette = NULL;
+
+ /* imaging */
+ driver->CopyColorTable = _mesa_meta_CopyColorTable;
+ driver->CopyColorSubTable = _mesa_meta_CopyColorSubTable;
+
+ /* Vertex/fragment programs */
+ driver->BindProgram = NULL;
+ driver->NewProgram = _mesa_new_program;
+ driver->DeleteProgram = _mesa_delete_program;
+
+ /* simple state commands */
+ driver->AlphaFunc = NULL;
+ driver->BlendColor = NULL;
+ driver->BlendEquationSeparate = NULL;
+ driver->BlendFuncSeparate = NULL;
+ driver->ClearColor = NULL;
+ driver->ClearDepth = NULL;
+ driver->ClearStencil = NULL;
+ driver->ClipPlane = NULL;
+ driver->ColorMask = NULL;
+ driver->ColorMaterial = NULL;
+ driver->CullFace = NULL;
+ driver->DrawBuffer = NULL;
+ driver->DrawBuffers = NULL;
+ driver->FrontFace = NULL;
+ driver->DepthFunc = NULL;
+ driver->DepthMask = NULL;
+ driver->DepthRange = NULL;
+ driver->Enable = NULL;
+ driver->Fogfv = NULL;
+ driver->Hint = NULL;
+ driver->Lightfv = NULL;
+ driver->LightModelfv = NULL;
+ driver->LineStipple = NULL;
+ driver->LineWidth = NULL;
+ driver->LogicOpcode = NULL;
+ driver->PointParameterfv = NULL;
+ driver->PointSize = NULL;
+ driver->PolygonMode = NULL;
+ driver->PolygonOffset = NULL;
+ driver->PolygonStipple = NULL;
+ driver->ReadBuffer = NULL;
+ driver->RenderMode = NULL;
+ driver->Scissor = NULL;
+ driver->ShadeModel = NULL;
+ driver->StencilFuncSeparate = NULL;
+ driver->StencilOpSeparate = NULL;
+ driver->StencilMaskSeparate = NULL;
+ driver->TexGen = NULL;
+ driver->TexEnv = NULL;
+ driver->TexParameter = NULL;
+ driver->Viewport = NULL;
+
+ /* buffer objects */
+ _mesa_init_buffer_object_functions(driver);
+
+ /* query objects */
+ _mesa_init_query_object_functions(driver);
+
+ _mesa_init_sync_object_functions(driver);
+
+ driver->NewFramebuffer = _mesa_new_framebuffer;
+ driver->NewRenderbuffer = _mesa_new_soft_renderbuffer;
+ driver->RenderTexture = _mesa_render_texture;
+ driver->FinishRenderTexture = _mesa_finish_render_texture;
+ driver->FramebufferRenderbuffer = _mesa_framebuffer_renderbuffer;
+ driver->ValidateFramebuffer = _mesa_validate_framebuffer;
+
+ driver->BlitFramebuffer = _swrast_BlitFramebuffer;
+
+ _mesa_init_texture_barrier_functions(driver);
+
+ /* APPLE_vertex_array_object */
+ driver->NewArrayObject = _mesa_new_array_object;
+ driver->DeleteArrayObject = _mesa_delete_array_object;
+ driver->BindArrayObject = NULL;
+
+ _mesa_init_shader_object_functions(driver);
+
+ _mesa_init_transform_feedback_functions(driver);
+
+ _mesa_init_sampler_object_functions(driver);
+
+ /* T&L stuff */
+ driver->NeedValidate = GL_FALSE;
+ driver->ValidateTnlModule = NULL;
+ driver->CurrentExecPrimitive = 0;
+ driver->CurrentSavePrimitive = 0;
+ driver->NeedFlush = 0;
+ driver->SaveNeedFlush = 0;
+
+ driver->ProgramStringNotify = _tnl_program_string;
+ driver->FlushVertices = NULL;
+ driver->SaveFlushVertices = NULL;
+ driver->NotifySaveBegin = NULL;
+ driver->LightingSpaceChange = NULL;
+
+ /* display list */
+ driver->NewList = NULL;
+ driver->EndList = NULL;
+ driver->BeginCallList = NULL;
+ driver->EndCallList = NULL;
+}
+
+
+/**
+ * Call the ctx->Driver.* state functions with current values to initialize
+ * driver state.
+ * Only the Intel drivers use this so far.
+ */
+void
+_mesa_init_driver_state(struct gl_context *ctx)
+{
+ ctx->Driver.AlphaFunc(ctx, ctx->Color.AlphaFunc, ctx->Color.AlphaRef);
+
+ ctx->Driver.BlendColor(ctx, ctx->Color.BlendColor);
+
+ ctx->Driver.BlendEquationSeparate(ctx,
+ ctx->Color.Blend[0].EquationRGB,
+ ctx->Color.Blend[0].EquationA);
+
+ ctx->Driver.BlendFuncSeparate(ctx,
+ ctx->Color.Blend[0].SrcRGB,
+ ctx->Color.Blend[0].DstRGB,
+ ctx->Color.Blend[0].SrcA,
+ ctx->Color.Blend[0].DstA);
+
+ if (ctx->Driver.ColorMaskIndexed) {
+ GLuint i;
+ for (i = 0; i < ctx->Const.MaxDrawBuffers; i++) {
+ ctx->Driver.ColorMaskIndexed(ctx, i,
+ ctx->Color.ColorMask[0][RCOMP],
+ ctx->Color.ColorMask[0][GCOMP],
+ ctx->Color.ColorMask[0][BCOMP],
+ ctx->Color.ColorMask[0][ACOMP]);
+ }
+ }
+ else {
+ ctx->Driver.ColorMask(ctx,
+ ctx->Color.ColorMask[0][RCOMP],
+ ctx->Color.ColorMask[0][GCOMP],
+ ctx->Color.ColorMask[0][BCOMP],
+ ctx->Color.ColorMask[0][ACOMP]);
+ }
+
+ ctx->Driver.CullFace(ctx, ctx->Polygon.CullFaceMode);
+ ctx->Driver.DepthFunc(ctx, ctx->Depth.Func);
+ ctx->Driver.DepthMask(ctx, ctx->Depth.Mask);
+
+ ctx->Driver.Enable(ctx, GL_ALPHA_TEST, ctx->Color.AlphaEnabled);
+ ctx->Driver.Enable(ctx, GL_BLEND, ctx->Color.BlendEnabled);
+ ctx->Driver.Enable(ctx, GL_COLOR_LOGIC_OP, ctx->Color.ColorLogicOpEnabled);
+ ctx->Driver.Enable(ctx, GL_COLOR_SUM, ctx->Fog.ColorSumEnabled);
+ ctx->Driver.Enable(ctx, GL_CULL_FACE, ctx->Polygon.CullFlag);
+ ctx->Driver.Enable(ctx, GL_DEPTH_TEST, ctx->Depth.Test);
+ ctx->Driver.Enable(ctx, GL_DITHER, ctx->Color.DitherFlag);
+ ctx->Driver.Enable(ctx, GL_FOG, ctx->Fog.Enabled);
+ ctx->Driver.Enable(ctx, GL_LIGHTING, ctx->Light.Enabled);
+ ctx->Driver.Enable(ctx, GL_LINE_SMOOTH, ctx->Line.SmoothFlag);
+ ctx->Driver.Enable(ctx, GL_POLYGON_STIPPLE, ctx->Polygon.StippleFlag);
+ ctx->Driver.Enable(ctx, GL_SCISSOR_TEST, ctx->Scissor.Enabled);
+ ctx->Driver.Enable(ctx, GL_STENCIL_TEST, ctx->Stencil._Enabled);
+ ctx->Driver.Enable(ctx, GL_TEXTURE_1D, GL_FALSE);
+ ctx->Driver.Enable(ctx, GL_TEXTURE_2D, GL_FALSE);
+ ctx->Driver.Enable(ctx, GL_TEXTURE_RECTANGLE_NV, GL_FALSE);
+ ctx->Driver.Enable(ctx, GL_TEXTURE_3D, GL_FALSE);
+ ctx->Driver.Enable(ctx, GL_TEXTURE_CUBE_MAP, GL_FALSE);
+
+ ctx->Driver.Fogfv(ctx, GL_FOG_COLOR, ctx->Fog.Color);
+ ctx->Driver.Fogfv(ctx, GL_FOG_MODE, 0);
+ ctx->Driver.Fogfv(ctx, GL_FOG_DENSITY, &ctx->Fog.Density);
+ ctx->Driver.Fogfv(ctx, GL_FOG_START, &ctx->Fog.Start);
+ ctx->Driver.Fogfv(ctx, GL_FOG_END, &ctx->Fog.End);
+
+ ctx->Driver.FrontFace(ctx, ctx->Polygon.FrontFace);
+
+ {
+ GLfloat f = (GLfloat) ctx->Light.Model.ColorControl;
+ ctx->Driver.LightModelfv(ctx, GL_LIGHT_MODEL_COLOR_CONTROL, &f);
+ }
+
+ ctx->Driver.LineWidth(ctx, ctx->Line.Width);
+ ctx->Driver.LogicOpcode(ctx, ctx->Color.LogicOp);
+ ctx->Driver.PointSize(ctx, ctx->Point.Size);
+ ctx->Driver.PolygonStipple(ctx, (const GLubyte *) ctx->PolygonStipple);
+ ctx->Driver.Scissor(ctx, ctx->Scissor.X, ctx->Scissor.Y,
+ ctx->Scissor.Width, ctx->Scissor.Height);
+ ctx->Driver.ShadeModel(ctx, ctx->Light.ShadeModel);
+ ctx->Driver.StencilFuncSeparate(ctx, GL_FRONT,
+ ctx->Stencil.Function[0],
+ ctx->Stencil.Ref[0],
+ ctx->Stencil.ValueMask[0]);
+ ctx->Driver.StencilFuncSeparate(ctx, GL_BACK,
+ ctx->Stencil.Function[1],
+ ctx->Stencil.Ref[1],
+ ctx->Stencil.ValueMask[1]);
+ ctx->Driver.StencilMaskSeparate(ctx, GL_FRONT, ctx->Stencil.WriteMask[0]);
+ ctx->Driver.StencilMaskSeparate(ctx, GL_BACK, ctx->Stencil.WriteMask[1]);
+ ctx->Driver.StencilOpSeparate(ctx, GL_FRONT,
+ ctx->Stencil.FailFunc[0],
+ ctx->Stencil.ZFailFunc[0],
+ ctx->Stencil.ZPassFunc[0]);
+ ctx->Driver.StencilOpSeparate(ctx, GL_BACK,
+ ctx->Stencil.FailFunc[1],
+ ctx->Stencil.ZFailFunc[1],
+ ctx->Stencil.ZPassFunc[1]);
+
+
+ ctx->Driver.DrawBuffer(ctx, ctx->Color.DrawBuffer[0]);
+}
diff --git a/mesalib/src/mesa/drivers/dri/Makefile.template b/mesalib/src/mesa/drivers/dri/Makefile.template
index d1a119379..195d60a9c 100644
--- a/mesalib/src/mesa/drivers/dri/Makefile.template
+++ b/mesalib/src/mesa/drivers/dri/Makefile.template
@@ -1,111 +1,111 @@
-# -*-makefile-*-
-
-COMMON_GALLIUM_SOURCES = \
- ../common/utils.c \
- ../common/vblank.c \
- ../common/dri_util.c \
- ../common/xmlconfig.c
-
-COMMON_SOURCES = $(COMMON_GALLIUM_SOURCES) \
- ../../common/driverfuncs.c \
- ../common/texmem.c \
- ../common/drirenderbuffer.c
-
-INCLUDES = $(SHARED_INCLUDES) $(EXPAT_INCLUDES)
-
-OBJECTS = $(C_SOURCES:.c=.o) \
- $(CXX_SOURCES:.cpp=.o) \
- $(ASM_SOURCES:.S=.o)
-
-
-### Include directories
-SHARED_INCLUDES = \
- -I. \
- -I$(TOP)/src/mesa/drivers/dri/common \
- -Iserver \
- -I$(TOP)/include \
- -I$(TOP)/src/mapi \
- -I$(TOP)/src/mesa \
- -I$(TOP)/src/egl/main \
- -I$(TOP)/src/egl/drivers/dri \
- $(LIBDRM_CFLAGS)
-
-CFLAGS += $(API_DEFINES)
-CXXFLAGS += $(API_DEFINES)
-
-##### RULES #####
-
-.c.o:
- $(CC) -c $(INCLUDES) $(DRI_CFLAGS) $(DRIVER_DEFINES) $< -o $@
-
-.cpp.o:
- $(CC) -c $(INCLUDES) $(DRI_CXXFLAGS) $(DRIVER_DEFINES) $< -o $@
-
-.S.o:
- $(CC) -c $(INCLUDES) $(DRI_CFLAGS) $(DRIVER_DEFINES) $< -o $@
-
-
-##### TARGETS #####
-
-default: subdirs lib
-
-
-.PHONY: lib
-lib: symlinks subdirs depend
- @$(MAKE) $(LIBNAME) $(TOP)/$(LIB_DIR)/$(LIBNAME)
-
-$(LIBNAME): $(OBJECTS) $(EXTRA_MODULES) $(MESA_MODULES) Makefile \
- $(TOP)/src/mesa/drivers/dri/Makefile.template $(TOP)/src/mesa/drivers/dri/common/dri_test.o
- $(MKLIB) -o $@.tmp -noprefix -linker '$(CXX)' -ldflags '$(LDFLAGS)' \
- $(OBJECTS) $(EXTRA_MODULES) $(DRI_LIB_DEPS)
- $(CXX) $(CFLAGS) -o $@.test $(TOP)/src/mesa/drivers/dri/common/dri_test.o $@.tmp $(DRI_LIB_DEPS)
- @rm -f $@.test
- mv -f $@.tmp $@
-
-
-$(TOP)/$(LIB_DIR)/$(LIBNAME): $(LIBNAME)
- $(INSTALL) $(LIBNAME) $(TOP)/$(LIB_DIR)
-
-
-# If the Makefile defined SUBDIRS, run make in each
-.PHONY: subdirs
-subdirs:
- @if test -n "$(SUBDIRS)" ; then \
- for dir in $(SUBDIRS) ; do \
- if [ -d $$dir ] ; then \
- (cd $$dir && $(MAKE)) || exit 1; \
- fi \
- done \
- fi
-
-
-.PHONY: symlinks
-symlinks:
-
-
-depend: $(C_SOURCES) $(CXX_SOURCES) $(ASM_SOURCES) $(SYMLINKS)
- @ echo "running $(MKDEP)"
- @ rm -f depend
- @ touch depend
- @ $(MKDEP) $(MKDEP_OPTIONS) $(DRIVER_DEFINES) $(INCLUDES) \
- $(C_SOURCES) $(CXX_SOURCES) \
- $(ASM_SOURCES) > /dev/null 2>/dev/null
-
-
-# Emacs tags
-tags:
- etags `find . -name \*.[ch]` `find ../include`
-
-
-# Remove .o and backup files
-clean:
- -rm -f *.o */*.o *~ *.so *~ server/*.o $(SYMLINKS)
- -rm -f depend depend.bak
-
-
-install: $(LIBNAME)
- $(INSTALL) -d $(DESTDIR)$(DRI_DRIVER_INSTALL_DIR)
- $(MINSTALL) -m 755 $(LIBNAME) $(DESTDIR)$(DRI_DRIVER_INSTALL_DIR)
-
-
--include depend
+# -*-makefile-*-
+
+COMMON_GALLIUM_SOURCES = \
+ ../common/utils.c \
+ ../common/vblank.c \
+ ../common/dri_util.c \
+ ../common/xmlconfig.c
+
+COMMON_SOURCES = $(COMMON_GALLIUM_SOURCES) \
+ ../../common/driverfuncs.c \
+ ../common/texmem.c \
+ ../common/drirenderbuffer.c
+
+INCLUDES = $(SHARED_INCLUDES) $(EXPAT_INCLUDES)
+
+OBJECTS = $(C_SOURCES:.c=.o) \
+ $(CXX_SOURCES:.cpp=.o) \
+ $(ASM_SOURCES:.S=.o)
+
+
+### Include directories
+SHARED_INCLUDES = \
+ -I. \
+ -I$(TOP)/src/mesa/drivers/dri/common \
+ -Iserver \
+ -I$(TOP)/include \
+ -I$(TOP)/src/mapi \
+ -I$(TOP)/src/mesa \
+ -I$(TOP)/src/egl/main \
+ -I$(TOP)/src/egl/drivers/dri \
+ $(LIBDRM_CFLAGS)
+
+CFLAGS += $(API_DEFINES)
+CXXFLAGS += $(API_DEFINES)
+
+##### RULES #####
+
+.c.o:
+ $(CC) -c $(INCLUDES) $(DRI_CFLAGS) $(DRIVER_DEFINES) $< -o $@
+
+.cpp.o:
+ $(CC) -c $(INCLUDES) $(DRI_CXXFLAGS) $(DRIVER_DEFINES) $< -o $@
+
+.S.o:
+ $(CC) -c $(INCLUDES) $(DRI_CFLAGS) $(DRIVER_DEFINES) $< -o $@
+
+
+##### TARGETS #####
+
+default: subdirs lib
+
+
+.PHONY: lib
+lib: symlinks subdirs depend
+ @$(MAKE) $(LIBNAME) $(TOP)/$(LIB_DIR)/$(LIBNAME)
+
+$(LIBNAME): $(OBJECTS) $(EXTRA_MODULES) $(MESA_MODULES) Makefile \
+ $(TOP)/src/mesa/drivers/dri/Makefile.template $(TOP)/src/mesa/drivers/dri/common/dri_test.o
+ $(MKLIB) -o $@.tmp -noprefix -linker '$(CXX)' -ldflags '$(LDFLAGS)' \
+ $(OBJECTS) $(EXTRA_MODULES) $(DRI_LIB_DEPS)
+ $(CXX) $(CFLAGS) -o $@.test $(TOP)/src/mesa/drivers/dri/common/dri_test.o $@.tmp $(DRI_LIB_DEPS)
+ @rm -f $@.test
+ mv -f $@.tmp $@
+
+
+$(TOP)/$(LIB_DIR)/$(LIBNAME): $(LIBNAME)
+ $(INSTALL) $(LIBNAME) $(TOP)/$(LIB_DIR)
+
+
+# If the Makefile defined SUBDIRS, run make in each
+.PHONY: subdirs
+subdirs:
+ @if test -n "$(SUBDIRS)" ; then \
+ for dir in $(SUBDIRS) ; do \
+ if [ -d $$dir ] ; then \
+ (cd $$dir && $(MAKE)) || exit 1; \
+ fi \
+ done \
+ fi
+
+
+.PHONY: symlinks
+symlinks:
+
+
+depend: $(C_SOURCES) $(CXX_SOURCES) $(ASM_SOURCES) $(SYMLINKS)
+ @ echo "running $(MKDEP)"
+ @ rm -f depend
+ @ touch depend
+ @ $(MKDEP) $(MKDEP_OPTIONS) $(DRIVER_DEFINES) $(INCLUDES) \
+ $(C_SOURCES) $(CXX_SOURCES) \
+ $(ASM_SOURCES) > /dev/null 2>/dev/null
+
+
+# Emacs tags
+tags:
+ etags `find . -name \*.[ch]` `find ../include`
+
+
+# Remove .o and backup files
+clean:
+ -rm -f *.o */*.o *~ *.so *~ server/*.o $(SYMLINKS)
+ -rm -f depend depend.bak
+
+
+install: $(LIBNAME)
+ $(INSTALL) -d $(DESTDIR)$(DRI_DRIVER_INSTALL_DIR)
+ $(MINSTALL) -m 755 $(LIBNAME) $(DESTDIR)$(DRI_DRIVER_INSTALL_DIR)
+
+
+-include depend
diff --git a/mesalib/src/mesa/drivers/dri/common/dri_util.c b/mesalib/src/mesa/drivers/dri/common/dri_util.c
index 82638fa72..6d3dd0a2c 100644
--- a/mesalib/src/mesa/drivers/dri/common/dri_util.c
+++ b/mesalib/src/mesa/drivers/dri/common/dri_util.c
@@ -1,1030 +1,1030 @@
-/**
- * \file dri_util.c
- * DRI utility functions.
- *
- * This module acts as glue between GLX and the actual hardware driver. A DRI
- * driver doesn't really \e have to use any of this - it's optional. But, some
- * useful stuff is done here that otherwise would have to be duplicated in most
- * drivers.
- *
- * Basically, these utility functions take care of some of the dirty details of
- * screen initialization, context creation, context binding, DRM setup, etc.
- *
- * These functions are compiled into each DRI driver so libGL.so knows nothing
- * about them.
- */
-
-
-#include <assert.h>
-#include <stdarg.h>
-#include <unistd.h>
-#include <sys/mman.h>
-#include <stdio.h>
-
-#ifndef MAP_FAILED
-#define MAP_FAILED ((void *)-1)
-#endif
-
-#include "main/imports.h"
-#define None 0
-
-#include "dri_util.h"
-#include "drm_sarea.h"
-#include "utils.h"
-#include "xmlpool.h"
-#include "../glsl/glsl_parser_extras.h"
-
-PUBLIC const char __dri2ConfigOptions[] =
- DRI_CONF_BEGIN
- DRI_CONF_SECTION_PERFORMANCE
- DRI_CONF_VBLANK_MODE(DRI_CONF_VBLANK_DEF_INTERVAL_1)
- DRI_CONF_SECTION_END
- DRI_CONF_END;
-
-static const uint __dri2NConfigOptions = 1;
-
-#ifndef GLX_OML_sync_control
-typedef GLboolean ( * PFNGLXGETMSCRATEOMLPROC) (__DRIdrawable *drawable, int32_t *numerator, int32_t *denominator);
-#endif
-
-static void dri_get_drawable(__DRIdrawable *pdp);
-static void dri_put_drawable(__DRIdrawable *pdp);
-
-/**
- * This is just a token extension used to signal that the driver
- * supports setting a read drawable.
- */
-const __DRIextension driReadDrawableExtension = {
- __DRI_READ_DRAWABLE, __DRI_READ_DRAWABLE_VERSION
-};
-
-GLint
-driIntersectArea( drm_clip_rect_t rect1, drm_clip_rect_t rect2 )
-{
- if (rect2.x1 > rect1.x1) rect1.x1 = rect2.x1;
- if (rect2.x2 < rect1.x2) rect1.x2 = rect2.x2;
- if (rect2.y1 > rect1.y1) rect1.y1 = rect2.y1;
- if (rect2.y2 < rect1.y2) rect1.y2 = rect2.y2;
-
- if (rect1.x1 > rect1.x2 || rect1.y1 > rect1.y2) return 0;
-
- return (rect1.x2 - rect1.x1) * (rect1.y2 - rect1.y1);
-}
-
-/*****************************************************************/
-/** \name Context (un)binding functions */
-/*****************************************************************/
-/*@{*/
-
-/**
- * Unbind context.
- *
- * \param scrn the screen.
- * \param gc context.
- *
- * \return \c GL_TRUE on success, or \c GL_FALSE on failure.
- *
- * \internal
- * This function calls __DriverAPIRec::UnbindContext, and then decrements
- * __DRIdrawableRec::refcount which must be non-zero for a successful
- * return.
- *
- * While casting the opaque private pointers associated with the parameters
- * into their respective real types it also assures they are not \c NULL.
- */
-static int driUnbindContext(__DRIcontext *pcp)
-{
- __DRIscreen *psp;
- __DRIdrawable *pdp;
- __DRIdrawable *prp;
-
- /*
- ** Assume error checking is done properly in glXMakeCurrent before
- ** calling driUnbindContext.
- */
-
- if (pcp == NULL)
- return GL_FALSE;
-
- psp = pcp->driScreenPriv;
- pdp = pcp->driDrawablePriv;
- prp = pcp->driReadablePriv;
-
- /* already unbound */
- if (!pdp && !prp)
- return GL_TRUE;
- /* Let driver unbind drawable from context */
- (*psp->DriverAPI.UnbindContext)(pcp);
-
- assert(pdp);
- if (pdp->refcount == 0) {
- /* ERROR!!! */
- return GL_FALSE;
- }
-
- dri_put_drawable(pdp);
-
- if (prp != pdp) {
- if (prp->refcount == 0) {
- /* ERROR!!! */
- return GL_FALSE;
- }
-
- dri_put_drawable(prp);
- }
-
-
- /* XXX this is disabled so that if we call SwapBuffers on an unbound
- * window we can determine the last context bound to the window and
- * use that context's lock. (BrianP, 2-Dec-2000)
- */
- pcp->driDrawablePriv = pcp->driReadablePriv = NULL;
-
- return GL_TRUE;
-}
-
-/**
- * This function takes both a read buffer and a draw buffer. This is needed
- * for \c glXMakeCurrentReadSGI or GLX 1.3's \c glXMakeContextCurrent
- * function.
- */
-static int driBindContext(__DRIcontext *pcp,
- __DRIdrawable *pdp,
- __DRIdrawable *prp)
-{
- __DRIscreen *psp = NULL;
-
- /*
- ** Assume error checking is done properly in glXMakeCurrent before
- ** calling driUnbindContext.
- */
-
- if (!pcp)
- return GL_FALSE;
-
- /* Bind the drawable to the context */
- psp = pcp->driScreenPriv;
- pcp->driDrawablePriv = pdp;
- pcp->driReadablePriv = prp;
- if (pdp) {
- pdp->driContextPriv = pcp;
- dri_get_drawable(pdp);
- }
- if (prp && pdp != prp) {
- dri_get_drawable(prp);
- }
-
- /*
- ** Now that we have a context associated with this drawable, we can
- ** initialize the drawable information if has not been done before.
- */
-
- if (!psp->dri2.enabled) {
- if (pdp && !pdp->pStamp) {
- DRM_SPINLOCK(&psp->pSAREA->drawable_lock, psp->drawLockID);
- __driUtilUpdateDrawableInfo(pdp);
- DRM_SPINUNLOCK(&psp->pSAREA->drawable_lock, psp->drawLockID);
- }
- if (prp && pdp != prp && !prp->pStamp) {
- DRM_SPINLOCK(&psp->pSAREA->drawable_lock, psp->drawLockID);
- __driUtilUpdateDrawableInfo(prp);
- DRM_SPINUNLOCK(&psp->pSAREA->drawable_lock, psp->drawLockID);
- }
- }
-
- /* Call device-specific MakeCurrent */
- return (*psp->DriverAPI.MakeCurrent)(pcp, pdp, prp);
-}
-
-/*@}*/
-
-
-/*****************************************************************/
-/** \name Drawable handling functions */
-/*****************************************************************/
-/*@{*/
-
-/**
- * Update private drawable information.
- *
- * \param pdp pointer to the private drawable information to update.
- *
- * This function basically updates the __DRIdrawable struct's
- * cliprect information by calling \c __DRIinterfaceMethods::getDrawableInfo.
- * This is usually called by the DRI_VALIDATE_DRAWABLE_INFO macro which
- * compares the __DRIdrwablePrivate pStamp and lastStamp values. If
- * the values are different that means we have to update the clipping
- * info.
- */
-void
-__driUtilUpdateDrawableInfo(__DRIdrawable *pdp)
-{
- __DRIscreen *psp = pdp->driScreenPriv;
- __DRIcontext *pcp = pdp->driContextPriv;
-
- if (!pcp
- || ((pdp != pcp->driDrawablePriv) && (pdp != pcp->driReadablePriv))) {
- /* ERROR!!!
- * ...but we must ignore it. There can be many contexts bound to a
- * drawable.
- */
- }
-
- if (pdp->pClipRects) {
- free(pdp->pClipRects);
- pdp->pClipRects = NULL;
- }
-
- if (pdp->pBackClipRects) {
- free(pdp->pBackClipRects);
- pdp->pBackClipRects = NULL;
- }
-
- DRM_SPINUNLOCK(&psp->pSAREA->drawable_lock, psp->drawLockID);
-
- if (! (*psp->getDrawableInfo->getDrawableInfo)(pdp,
- &pdp->index, &pdp->lastStamp,
- &pdp->x, &pdp->y, &pdp->w, &pdp->h,
- &pdp->numClipRects, &pdp->pClipRects,
- &pdp->backX,
- &pdp->backY,
- &pdp->numBackClipRects,
- &pdp->pBackClipRects,
- pdp->loaderPrivate)) {
- /* Error -- eg the window may have been destroyed. Keep going
- * with no cliprects.
- */
- pdp->pStamp = &pdp->lastStamp; /* prevent endless loop */
- pdp->numClipRects = 0;
- pdp->pClipRects = NULL;
- pdp->numBackClipRects = 0;
- pdp->pBackClipRects = NULL;
- }
- else
- pdp->pStamp = &(psp->pSAREA->drawableTable[pdp->index].stamp);
-
- DRM_SPINLOCK(&psp->pSAREA->drawable_lock, psp->drawLockID);
-}
-
-/*@}*/
-
-/*****************************************************************/
-/** \name GLX callbacks */
-/*****************************************************************/
-/*@{*/
-
-static void driReportDamage(__DRIdrawable *pdp,
- struct drm_clip_rect *pClipRects, int numClipRects)
-{
- __DRIscreen *psp = pdp->driScreenPriv;
-
- /* Check that we actually have the new damage report method */
- if (psp->damage) {
- /* Report the damage. Currently, all our drivers draw
- * directly to the front buffer, so we report the damage there
- * rather than to the backing storein (if any).
- */
- (*psp->damage->reportDamage)(pdp,
- pdp->x, pdp->y,
- pClipRects, numClipRects,
- GL_TRUE, pdp->loaderPrivate);
- }
-}
-
-
-/**
- * Swap buffers.
- *
- * \param drawablePrivate opaque pointer to the per-drawable private info.
- *
- * \internal
- * This function calls __DRIdrawable::swapBuffers.
- *
- * Is called directly from glXSwapBuffers().
- */
-static void driSwapBuffers(__DRIdrawable *dPriv)
-{
- __DRIscreen *psp = dPriv->driScreenPriv;
- drm_clip_rect_t *rects;
- int i;
-
- psp->DriverAPI.SwapBuffers(dPriv);
-
- if (!dPriv->numClipRects)
- return;
-
- rects = malloc(sizeof(*rects) * dPriv->numClipRects);
-
- if (!rects)
- return;
-
- for (i = 0; i < dPriv->numClipRects; i++) {
- rects[i].x1 = dPriv->pClipRects[i].x1 - dPriv->x;
- rects[i].y1 = dPriv->pClipRects[i].y1 - dPriv->y;
- rects[i].x2 = dPriv->pClipRects[i].x2 - dPriv->x;
- rects[i].y2 = dPriv->pClipRects[i].y2 - dPriv->y;
- }
-
- driReportDamage(dPriv, rects, dPriv->numClipRects);
- free(rects);
-}
-
-static int driDrawableGetMSC( __DRIscreen *sPriv, __DRIdrawable *dPriv,
- int64_t *msc )
-{
- return sPriv->DriverAPI.GetDrawableMSC(sPriv, dPriv, msc);
-}
-
-
-static int driWaitForMSC(__DRIdrawable *dPriv, int64_t target_msc,
- int64_t divisor, int64_t remainder,
- int64_t * msc, int64_t * sbc)
-{
- __DRIswapInfo sInfo;
- int status;
-
- status = dPriv->driScreenPriv->DriverAPI.WaitForMSC( dPriv, target_msc,
- divisor, remainder,
- msc );
-
- /* GetSwapInfo() may not be provided by the driver if GLX_SGI_video_sync
- * is supported but GLX_OML_sync_control is not. Therefore, don't return
- * an error value if GetSwapInfo() is not implemented.
- */
- if ( status == 0
- && dPriv->driScreenPriv->DriverAPI.GetSwapInfo ) {
- status = dPriv->driScreenPriv->DriverAPI.GetSwapInfo( dPriv, & sInfo );
- *sbc = sInfo.swap_count;
- }
-
- return status;
-}
-
-
-const __DRImediaStreamCounterExtension driMediaStreamCounterExtension = {
- { __DRI_MEDIA_STREAM_COUNTER, __DRI_MEDIA_STREAM_COUNTER_VERSION },
- driWaitForMSC,
- driDrawableGetMSC,
-};
-
-
-static void driCopySubBuffer(__DRIdrawable *dPriv,
- int x, int y, int w, int h)
-{
- drm_clip_rect_t rect;
-
- rect.x1 = x;
- rect.y1 = dPriv->h - y - h;
- rect.x2 = x + w;
- rect.y2 = rect.y1 + h;
- driReportDamage(dPriv, &rect, 1);
-
- dPriv->driScreenPriv->DriverAPI.CopySubBuffer(dPriv, x, y, w, h);
-}
-
-const __DRIcopySubBufferExtension driCopySubBufferExtension = {
- { __DRI_COPY_SUB_BUFFER, __DRI_COPY_SUB_BUFFER_VERSION },
- driCopySubBuffer
-};
-
-static void driSetSwapInterval(__DRIdrawable *dPriv, unsigned int interval)
-{
- dPriv->swap_interval = interval;
-}
-
-static unsigned int driGetSwapInterval(__DRIdrawable *dPriv)
-{
- return dPriv->swap_interval;
-}
-
-const __DRIswapControlExtension driSwapControlExtension = {
- { __DRI_SWAP_CONTROL, __DRI_SWAP_CONTROL_VERSION },
- driSetSwapInterval,
- driGetSwapInterval
-};
-
-
-/**
- * This is called via __DRIscreenRec's createNewDrawable pointer.
- */
-static __DRIdrawable *
-driCreateNewDrawable(__DRIscreen *psp, const __DRIconfig *config,
- drm_drawable_t hwDrawable, int renderType,
- const int *attrs, void *data)
-{
- __DRIdrawable *pdp;
-
- /* Since pbuffers are not yet supported, no drawable attributes are
- * supported either.
- */
- (void) attrs;
-
- pdp = malloc(sizeof *pdp);
- if (!pdp) {
- return NULL;
- }
-
- pdp->driContextPriv = NULL;
- pdp->loaderPrivate = data;
- pdp->hHWDrawable = hwDrawable;
- pdp->refcount = 1;
- pdp->pStamp = NULL;
- pdp->lastStamp = 0;
- pdp->index = 0;
- pdp->x = 0;
- pdp->y = 0;
- pdp->w = 0;
- pdp->h = 0;
- pdp->numClipRects = 0;
- pdp->numBackClipRects = 0;
- pdp->pClipRects = NULL;
- pdp->pBackClipRects = NULL;
- pdp->vblSeq = 0;
- pdp->vblFlags = 0;
-
- pdp->driScreenPriv = psp;
-
- if (!(*psp->DriverAPI.CreateBuffer)(psp, pdp, &config->modes, 0)) {
- free(pdp);
- return NULL;
- }
-
- pdp->msc_base = 0;
-
- /* This special default value is replaced with the configured
- * default value when the drawable is first bound to a direct
- * rendering context.
- */
- pdp->swap_interval = (unsigned)-1;
-
- return pdp;
-}
-
-
-static __DRIdrawable *
-dri2CreateNewDrawable(__DRIscreen *screen,
- const __DRIconfig *config,
- void *loaderPrivate)
-{
- __DRIdrawable *pdraw;
-
- pdraw = driCreateNewDrawable(screen, config, 0, 0, NULL, loaderPrivate);
- if (!pdraw)
- return NULL;
-
- pdraw->pClipRects = &pdraw->dri2.clipRect;
- pdraw->pBackClipRects = &pdraw->dri2.clipRect;
-
- pdraw->pStamp = &pdraw->dri2.stamp;
- *pdraw->pStamp = pdraw->lastStamp + 1;
-
- return pdraw;
-}
-
-static __DRIbuffer *
-dri2AllocateBuffer(__DRIscreen *screen,
- unsigned int attachment, unsigned int format,
- int width, int height)
-{
- return (*screen->DriverAPI.AllocateBuffer)(screen, attachment, format,
- width, height);
-}
-
-static void
-dri2ReleaseBuffer(__DRIscreen *screen, __DRIbuffer *buffer)
-{
- (*screen->DriverAPI.ReleaseBuffer)(screen, buffer);
-}
-
-
-static int
-dri2ConfigQueryb(__DRIscreen *screen, const char *var, GLboolean *val)
-{
- if (!driCheckOption(&screen->optionCache, var, DRI_BOOL))
- return -1;
-
- *val = driQueryOptionb(&screen->optionCache, var);
-
- return 0;
-}
-
-static int
-dri2ConfigQueryi(__DRIscreen *screen, const char *var, GLint *val)
-{
- if (!driCheckOption(&screen->optionCache, var, DRI_INT) &&
- !driCheckOption(&screen->optionCache, var, DRI_ENUM))
- return -1;
-
- *val = driQueryOptioni(&screen->optionCache, var);
-
- return 0;
-}
-
-static int
-dri2ConfigQueryf(__DRIscreen *screen, const char *var, GLfloat *val)
-{
- if (!driCheckOption(&screen->optionCache, var, DRI_FLOAT))
- return -1;
-
- *val = driQueryOptionf(&screen->optionCache, var);
-
- return 0;
-}
-
-
-static void dri_get_drawable(__DRIdrawable *pdp)
-{
- pdp->refcount++;
-}
-
-static void dri_put_drawable(__DRIdrawable *pdp)
-{
- __DRIscreen *psp;
-
- if (pdp) {
- pdp->refcount--;
- if (pdp->refcount)
- return;
-
- psp = pdp->driScreenPriv;
- (*psp->DriverAPI.DestroyBuffer)(pdp);
- if (pdp->pClipRects && pdp->pClipRects != &pdp->dri2.clipRect) {
- free(pdp->pClipRects);
- pdp->pClipRects = NULL;
- }
- if (pdp->pBackClipRects && pdp->pClipRects != &pdp->dri2.clipRect) {
- free(pdp->pBackClipRects);
- pdp->pBackClipRects = NULL;
- }
- free(pdp);
- }
-}
-
-static void
-driDestroyDrawable(__DRIdrawable *pdp)
-{
- dri_put_drawable(pdp);
-}
-
-/*@}*/
-
-
-/*****************************************************************/
-/** \name Context handling functions */
-/*****************************************************************/
-/*@{*/
-
-/**
- * Destroy the per-context private information.
- *
- * \internal
- * This function calls __DriverAPIRec::DestroyContext on \p contextPrivate, calls
- * drmDestroyContext(), and finally frees \p contextPrivate.
- */
-static void
-driDestroyContext(__DRIcontext *pcp)
-{
- if (pcp) {
- (*pcp->driScreenPriv->DriverAPI.DestroyContext)(pcp);
- free(pcp);
- }
-}
-
-
-/**
- * Create the per-drawable private driver information.
- *
- * \param render_type Type of rendering target. \c GLX_RGBA is the only
- * type likely to ever be supported for direct-rendering.
- * \param shared Context with which to share textures, etc. or NULL
- *
- * \returns An opaque pointer to the per-context private information on
- * success, or \c NULL on failure.
- *
- * \internal
- * This function allocates and fills a __DRIcontextRec structure. It
- * performs some device independent initialization and passes all the
- * relevent information to __DriverAPIRec::CreateContext to create the
- * context.
- *
- */
-static __DRIcontext *
-driCreateNewContext(__DRIscreen *psp, const __DRIconfig *config,
- int render_type, __DRIcontext *shared,
- drm_context_t hwContext, void *data)
-{
- __DRIcontext *pcp;
- void * const shareCtx = (shared != NULL) ? shared->driverPrivate : NULL;
-
- pcp = malloc(sizeof *pcp);
- if (!pcp)
- return NULL;
-
- pcp->driScreenPriv = psp;
- pcp->driDrawablePriv = NULL;
- pcp->loaderPrivate = data;
-
- pcp->dri2.draw_stamp = 0;
- pcp->dri2.read_stamp = 0;
-
- pcp->hHWContext = hwContext;
-
- if ( !(*psp->DriverAPI.CreateContext)(API_OPENGL,
- &config->modes, pcp, shareCtx) ) {
- free(pcp);
- return NULL;
- }
-
- return pcp;
-}
-
-static unsigned int
-dri2GetAPIMask(__DRIscreen *screen)
-{
- return screen->api_mask;
-}
-
-static __DRIcontext *
-dri2CreateNewContextForAPI(__DRIscreen *screen, int api,
- const __DRIconfig *config,
- __DRIcontext *shared, void *data)
-{
- __DRIcontext *context;
- const struct gl_config *modes = (config != NULL) ? &config->modes : NULL;
- void *shareCtx = (shared != NULL) ? shared->driverPrivate : NULL;
- gl_api mesa_api;
-
- if (!(screen->api_mask & (1 << api)))
- return NULL;
-
- switch (api) {
- case __DRI_API_OPENGL:
- mesa_api = API_OPENGL;
- break;
- case __DRI_API_GLES:
- mesa_api = API_OPENGLES;
- break;
- case __DRI_API_GLES2:
- mesa_api = API_OPENGLES2;
- break;
- default:
- return NULL;
- }
-
- context = malloc(sizeof *context);
- if (!context)
- return NULL;
-
- context->driScreenPriv = screen;
- context->driDrawablePriv = NULL;
- context->loaderPrivate = data;
-
- if (!(*screen->DriverAPI.CreateContext)(mesa_api, modes,
- context, shareCtx) ) {
- free(context);
- return NULL;
- }
-
- return context;
-}
-
-
-static __DRIcontext *
-dri2CreateNewContext(__DRIscreen *screen, const __DRIconfig *config,
- __DRIcontext *shared, void *data)
-{
- return dri2CreateNewContextForAPI(screen, __DRI_API_OPENGL,
- config, shared, data);
-}
-
-static int
-driCopyContext(__DRIcontext *dest, __DRIcontext *src, unsigned long mask)
-{
- return GL_FALSE;
-}
-
-/*@}*/
-
-
-/*****************************************************************/
-/** \name Screen handling functions */
-/*****************************************************************/
-/*@{*/
-
-/**
- * Destroy the per-screen private information.
- *
- * \internal
- * This function calls __DriverAPIRec::DestroyScreen on \p screenPrivate, calls
- * drmClose(), and finally frees \p screenPrivate.
- */
-static void driDestroyScreen(__DRIscreen *psp)
-{
- if (psp) {
- /* No interaction with the X-server is possible at this point. This
- * routine is called after XCloseDisplay, so there is no protocol
- * stream open to the X-server anymore.
- */
-
- _mesa_destroy_shader_compiler();
-
- if (psp->DriverAPI.DestroyScreen)
- (*psp->DriverAPI.DestroyScreen)(psp);
-
- if (!psp->dri2.enabled) {
- (void)drmUnmap((drmAddress)psp->pSAREA, SAREA_MAX);
- (void)drmUnmap((drmAddress)psp->pFB, psp->fbSize);
- (void)drmCloseOnce(psp->fd);
- } else {
- driDestroyOptionCache(&psp->optionCache);
- driDestroyOptionInfo(&psp->optionInfo);
- }
-
- free(psp);
- }
-}
-
-static void
-setupLoaderExtensions(__DRIscreen *psp,
- const __DRIextension **extensions)
-{
- int i;
-
- for (i = 0; extensions[i]; i++) {
- if (strcmp(extensions[i]->name, __DRI_GET_DRAWABLE_INFO) == 0)
- psp->getDrawableInfo = (__DRIgetDrawableInfoExtension *) extensions[i];
- if (strcmp(extensions[i]->name, __DRI_DAMAGE) == 0)
- psp->damage = (__DRIdamageExtension *) extensions[i];
- if (strcmp(extensions[i]->name, __DRI_SYSTEM_TIME) == 0)
- psp->systemTime = (__DRIsystemTimeExtension *) extensions[i];
- if (strcmp(extensions[i]->name, __DRI_DRI2_LOADER) == 0)
- psp->dri2.loader = (__DRIdri2LoaderExtension *) extensions[i];
- if (strcmp(extensions[i]->name, __DRI_IMAGE_LOOKUP) == 0)
- psp->dri2.image = (__DRIimageLookupExtension *) extensions[i];
- if (strcmp(extensions[i]->name, __DRI_USE_INVALIDATE) == 0)
- psp->dri2.useInvalidate = (__DRIuseInvalidateExtension *) extensions[i];
- }
-}
-
-/**
- * This is the bootstrap function for the driver. libGL supplies all of the
- * requisite information about the system, and the driver initializes itself.
- * This routine also fills in the linked list pointed to by \c driver_modes
- * with the \c struct gl_config that the driver can support for windows or
- * pbuffers.
- *
- * For legacy DRI.
- *
- * \param scrn Index of the screen
- * \param ddx_version Version of the 2D DDX. This may not be meaningful for
- * all drivers.
- * \param dri_version Version of the "server-side" DRI.
- * \param drm_version Version of the kernel DRM.
- * \param frame_buffer Data describing the location and layout of the
- * framebuffer.
- * \param pSAREA Pointer to the SAREA.
- * \param fd Device handle for the DRM.
- * \param extensions ??
- * \param driver_modes Returns modes suppoted by the driver
- * \param loaderPrivate ??
- *
- * \note There is no need to check the minimum API version in this
- * function. Since the name of this function is versioned, it is
- * impossible for a loader that is too old to even load this driver.
- */
-static __DRIscreen *
-driCreateNewScreen(int scrn,
- const __DRIversion *ddx_version,
- const __DRIversion *dri_version,
- const __DRIversion *drm_version,
- const __DRIframebuffer *frame_buffer,
- drmAddress pSAREA, int fd,
- const __DRIextension **extensions,
- const __DRIconfig ***driver_modes,
- void *loaderPrivate)
-{
- static const __DRIextension *emptyExtensionList[] = { NULL };
- __DRIscreen *psp;
-
- if (driDriverAPI.InitScreen == NULL)
- return NULL;
-
- psp = calloc(1, sizeof *psp);
- if (!psp)
- return NULL;
-
- setupLoaderExtensions(psp, extensions);
-
- /*
- ** NOT_DONE: This is used by the X server to detect when the client
- ** has died while holding the drawable lock. The client sets the
- ** drawable lock to this value.
- */
- psp->drawLockID = 1;
-
- psp->drm_version = *drm_version;
- psp->ddx_version = *ddx_version;
- psp->dri_version = *dri_version;
-
- psp->pSAREA = pSAREA;
- psp->lock = (drmLock *) &psp->pSAREA->lock;
-
- psp->pFB = frame_buffer->base;
- psp->fbSize = frame_buffer->size;
- psp->fbStride = frame_buffer->stride;
- psp->fbWidth = frame_buffer->width;
- psp->fbHeight = frame_buffer->height;
- psp->devPrivSize = frame_buffer->dev_priv_size;
- psp->pDevPriv = frame_buffer->dev_priv;
- psp->fbBPP = psp->fbStride * 8 / frame_buffer->width;
-
- psp->extensions = emptyExtensionList;
- psp->fd = fd;
- psp->myNum = scrn;
- psp->dri2.enabled = GL_FALSE;
-
- psp->DriverAPI = driDriverAPI;
- psp->api_mask = (1 << __DRI_API_OPENGL);
-
- *driver_modes = driDriverAPI.InitScreen(psp);
- if (*driver_modes == NULL) {
- free(psp);
- return NULL;
- }
-
- return psp;
-}
-
-/**
- * DRI2
- */
-static __DRIscreen *
-dri2CreateNewScreen(int scrn, int fd,
- const __DRIextension **extensions,
- const __DRIconfig ***driver_configs, void *data)
-{
- static const __DRIextension *emptyExtensionList[] = { NULL };
- __DRIscreen *psp;
- drmVersionPtr version;
-
- if (driDriverAPI.InitScreen2 == NULL)
- return NULL;
-
- psp = calloc(1, sizeof(*psp));
- if (!psp)
- return NULL;
-
- setupLoaderExtensions(psp, extensions);
-
- version = drmGetVersion(fd);
- if (version) {
- psp->drm_version.major = version->version_major;
- psp->drm_version.minor = version->version_minor;
- psp->drm_version.patch = version->version_patchlevel;
- drmFreeVersion(version);
- }
-
- psp->extensions = emptyExtensionList;
- psp->fd = fd;
- psp->myNum = scrn;
- psp->dri2.enabled = GL_TRUE;
-
- psp->DriverAPI = driDriverAPI;
- psp->api_mask = (1 << __DRI_API_OPENGL);
- *driver_configs = driDriverAPI.InitScreen2(psp);
- if (*driver_configs == NULL) {
- free(psp);
- return NULL;
- }
-
- psp->DriverAPI = driDriverAPI;
- psp->loaderPrivate = data;
-
- driParseOptionInfo(&psp->optionInfo, __dri2ConfigOptions,
- __dri2NConfigOptions);
- driParseConfigFiles(&psp->optionCache, &psp->optionInfo, psp->myNum,
- "dri2");
-
- return psp;
-}
-
-static const __DRIextension **driGetExtensions(__DRIscreen *psp)
-{
- return psp->extensions;
-}
-
-/** Core interface */
-const __DRIcoreExtension driCoreExtension = {
- { __DRI_CORE, __DRI_CORE_VERSION },
- NULL,
- driDestroyScreen,
- driGetExtensions,
- driGetConfigAttrib,
- driIndexConfigAttrib,
- NULL,
- driDestroyDrawable,
- driSwapBuffers,
- NULL,
- driCopyContext,
- driDestroyContext,
- driBindContext,
- driUnbindContext
-};
-
-/** Legacy DRI interface */
-const __DRIlegacyExtension driLegacyExtension = {
- { __DRI_LEGACY, __DRI_LEGACY_VERSION },
- driCreateNewScreen,
- driCreateNewDrawable,
- driCreateNewContext,
-};
-
-/** DRI2 interface */
-const __DRIdri2Extension driDRI2Extension = {
- { __DRI_DRI2, __DRI_DRI2_VERSION },
- dri2CreateNewScreen,
- dri2CreateNewDrawable,
- dri2CreateNewContext,
- dri2GetAPIMask,
- dri2CreateNewContextForAPI,
- dri2AllocateBuffer,
- dri2ReleaseBuffer
-};
-
-const __DRI2configQueryExtension dri2ConfigQueryExtension = {
- { __DRI2_CONFIG_QUERY, __DRI2_CONFIG_QUERY_VERSION },
- dri2ConfigQueryb,
- dri2ConfigQueryi,
- dri2ConfigQueryf,
-};
-
-/**
- * Calculate amount of swap interval used between GLX buffer swaps.
- *
- * The usage value, on the range [0,max], is the fraction of total swap
- * interval time used between GLX buffer swaps is calculated.
- *
- * \f$p = t_d / (i * t_r)\f$
- *
- * Where \f$t_d\f$ is the time since the last GLX buffer swap, \f$i\f$ is the
- * swap interval (as set by \c glXSwapIntervalSGI), and \f$t_r\f$ time
- * required for a single vertical refresh period (as returned by \c
- * glXGetMscRateOML).
- *
- * See the documentation for the GLX_MESA_swap_frame_usage extension for more
- * details.
- *
- * \param dPriv Pointer to the private drawable structure.
- * \return If less than a single swap interval time period was required
- * between GLX buffer swaps, a number greater than 0 and less than
- * 1.0 is returned. If exactly one swap interval time period is
- * required, 1.0 is returned, and if more than one is required then
- * a number greater than 1.0 will be returned.
- *
- * \sa glXSwapIntervalSGI glXGetMscRateOML
- *
- * \todo Instead of caching the \c glXGetMscRateOML function pointer, would it
- * be possible to cache the sync rate?
- */
-float
-driCalculateSwapUsage( __DRIdrawable *dPriv, int64_t last_swap_ust,
- int64_t current_ust )
-{
- int32_t n;
- int32_t d;
- int interval;
- float usage = 1.0;
- __DRIscreen *psp = dPriv->driScreenPriv;
-
- if ( (*psp->systemTime->getMSCRate)(dPriv, &n, &d, dPriv->loaderPrivate) ) {
- interval = (dPriv->swap_interval != 0) ? dPriv->swap_interval : 1;
-
-
- /* We want to calculate
- * (current_UST - last_swap_UST) / (interval * us_per_refresh). We get
- * current_UST by calling __glXGetUST. last_swap_UST is stored in
- * dPriv->swap_ust. interval has already been calculated.
- *
- * The only tricky part is us_per_refresh. us_per_refresh is
- * 1000000 / MSC_rate. We know the MSC_rate is n / d. We can flip it
- * around and say us_per_refresh = 1000000 * d / n. Since this goes in
- * the denominator of the final calculation, we calculate
- * (interval * 1000000 * d) and move n into the numerator.
- */
-
- usage = (current_ust - last_swap_ust);
- usage *= n;
- usage /= (interval * d);
- usage /= 1000000.0;
- }
-
- return usage;
-}
-
-void
-dri2InvalidateDrawable(__DRIdrawable *drawable)
-{
- drawable->dri2.stamp++;
-}
-
-/*@}*/
+/**
+ * \file dri_util.c
+ * DRI utility functions.
+ *
+ * This module acts as glue between GLX and the actual hardware driver. A DRI
+ * driver doesn't really \e have to use any of this - it's optional. But, some
+ * useful stuff is done here that otherwise would have to be duplicated in most
+ * drivers.
+ *
+ * Basically, these utility functions take care of some of the dirty details of
+ * screen initialization, context creation, context binding, DRM setup, etc.
+ *
+ * These functions are compiled into each DRI driver so libGL.so knows nothing
+ * about them.
+ */
+
+
+#include <assert.h>
+#include <stdarg.h>
+#include <unistd.h>
+#include <sys/mman.h>
+#include <stdio.h>
+
+#ifndef MAP_FAILED
+#define MAP_FAILED ((void *)-1)
+#endif
+
+#include "main/imports.h"
+#define None 0
+
+#include "dri_util.h"
+#include "drm_sarea.h"
+#include "utils.h"
+#include "xmlpool.h"
+#include "../glsl/glsl_parser_extras.h"
+
+PUBLIC const char __dri2ConfigOptions[] =
+ DRI_CONF_BEGIN
+ DRI_CONF_SECTION_PERFORMANCE
+ DRI_CONF_VBLANK_MODE(DRI_CONF_VBLANK_DEF_INTERVAL_1)
+ DRI_CONF_SECTION_END
+ DRI_CONF_END;
+
+static const uint __dri2NConfigOptions = 1;
+
+#ifndef GLX_OML_sync_control
+typedef GLboolean ( * PFNGLXGETMSCRATEOMLPROC) (__DRIdrawable *drawable, int32_t *numerator, int32_t *denominator);
+#endif
+
+static void dri_get_drawable(__DRIdrawable *pdp);
+static void dri_put_drawable(__DRIdrawable *pdp);
+
+/**
+ * This is just a token extension used to signal that the driver
+ * supports setting a read drawable.
+ */
+const __DRIextension driReadDrawableExtension = {
+ __DRI_READ_DRAWABLE, __DRI_READ_DRAWABLE_VERSION
+};
+
+GLint
+driIntersectArea( drm_clip_rect_t rect1, drm_clip_rect_t rect2 )
+{
+ if (rect2.x1 > rect1.x1) rect1.x1 = rect2.x1;
+ if (rect2.x2 < rect1.x2) rect1.x2 = rect2.x2;
+ if (rect2.y1 > rect1.y1) rect1.y1 = rect2.y1;
+ if (rect2.y2 < rect1.y2) rect1.y2 = rect2.y2;
+
+ if (rect1.x1 > rect1.x2 || rect1.y1 > rect1.y2) return 0;
+
+ return (rect1.x2 - rect1.x1) * (rect1.y2 - rect1.y1);
+}
+
+/*****************************************************************/
+/** \name Context (un)binding functions */
+/*****************************************************************/
+/*@{*/
+
+/**
+ * Unbind context.
+ *
+ * \param scrn the screen.
+ * \param gc context.
+ *
+ * \return \c GL_TRUE on success, or \c GL_FALSE on failure.
+ *
+ * \internal
+ * This function calls __DriverAPIRec::UnbindContext, and then decrements
+ * __DRIdrawableRec::refcount which must be non-zero for a successful
+ * return.
+ *
+ * While casting the opaque private pointers associated with the parameters
+ * into their respective real types it also assures they are not \c NULL.
+ */
+static int driUnbindContext(__DRIcontext *pcp)
+{
+ __DRIscreen *psp;
+ __DRIdrawable *pdp;
+ __DRIdrawable *prp;
+
+ /*
+ ** Assume error checking is done properly in glXMakeCurrent before
+ ** calling driUnbindContext.
+ */
+
+ if (pcp == NULL)
+ return GL_FALSE;
+
+ psp = pcp->driScreenPriv;
+ pdp = pcp->driDrawablePriv;
+ prp = pcp->driReadablePriv;
+
+ /* already unbound */
+ if (!pdp && !prp)
+ return GL_TRUE;
+ /* Let driver unbind drawable from context */
+ (*psp->DriverAPI.UnbindContext)(pcp);
+
+ assert(pdp);
+ if (pdp->refcount == 0) {
+ /* ERROR!!! */
+ return GL_FALSE;
+ }
+
+ dri_put_drawable(pdp);
+
+ if (prp != pdp) {
+ if (prp->refcount == 0) {
+ /* ERROR!!! */
+ return GL_FALSE;
+ }
+
+ dri_put_drawable(prp);
+ }
+
+
+ /* XXX this is disabled so that if we call SwapBuffers on an unbound
+ * window we can determine the last context bound to the window and
+ * use that context's lock. (BrianP, 2-Dec-2000)
+ */
+ pcp->driDrawablePriv = pcp->driReadablePriv = NULL;
+
+ return GL_TRUE;
+}
+
+/**
+ * This function takes both a read buffer and a draw buffer. This is needed
+ * for \c glXMakeCurrentReadSGI or GLX 1.3's \c glXMakeContextCurrent
+ * function.
+ */
+static int driBindContext(__DRIcontext *pcp,
+ __DRIdrawable *pdp,
+ __DRIdrawable *prp)
+{
+ __DRIscreen *psp = NULL;
+
+ /*
+ ** Assume error checking is done properly in glXMakeCurrent before
+ ** calling driUnbindContext.
+ */
+
+ if (!pcp)
+ return GL_FALSE;
+
+ /* Bind the drawable to the context */
+ psp = pcp->driScreenPriv;
+ pcp->driDrawablePriv = pdp;
+ pcp->driReadablePriv = prp;
+ if (pdp) {
+ pdp->driContextPriv = pcp;
+ dri_get_drawable(pdp);
+ }
+ if (prp && pdp != prp) {
+ dri_get_drawable(prp);
+ }
+
+ /*
+ ** Now that we have a context associated with this drawable, we can
+ ** initialize the drawable information if has not been done before.
+ */
+
+ if (!psp->dri2.enabled) {
+ if (pdp && !pdp->pStamp) {
+ DRM_SPINLOCK(&psp->pSAREA->drawable_lock, psp->drawLockID);
+ __driUtilUpdateDrawableInfo(pdp);
+ DRM_SPINUNLOCK(&psp->pSAREA->drawable_lock, psp->drawLockID);
+ }
+ if (prp && pdp != prp && !prp->pStamp) {
+ DRM_SPINLOCK(&psp->pSAREA->drawable_lock, psp->drawLockID);
+ __driUtilUpdateDrawableInfo(prp);
+ DRM_SPINUNLOCK(&psp->pSAREA->drawable_lock, psp->drawLockID);
+ }
+ }
+
+ /* Call device-specific MakeCurrent */
+ return (*psp->DriverAPI.MakeCurrent)(pcp, pdp, prp);
+}
+
+/*@}*/
+
+
+/*****************************************************************/
+/** \name Drawable handling functions */
+/*****************************************************************/
+/*@{*/
+
+/**
+ * Update private drawable information.
+ *
+ * \param pdp pointer to the private drawable information to update.
+ *
+ * This function basically updates the __DRIdrawable struct's
+ * cliprect information by calling \c __DRIinterfaceMethods::getDrawableInfo.
+ * This is usually called by the DRI_VALIDATE_DRAWABLE_INFO macro which
+ * compares the __DRIdrwablePrivate pStamp and lastStamp values. If
+ * the values are different that means we have to update the clipping
+ * info.
+ */
+void
+__driUtilUpdateDrawableInfo(__DRIdrawable *pdp)
+{
+ __DRIscreen *psp = pdp->driScreenPriv;
+ __DRIcontext *pcp = pdp->driContextPriv;
+
+ if (!pcp
+ || ((pdp != pcp->driDrawablePriv) && (pdp != pcp->driReadablePriv))) {
+ /* ERROR!!!
+ * ...but we must ignore it. There can be many contexts bound to a
+ * drawable.
+ */
+ }
+
+ if (pdp->pClipRects) {
+ free(pdp->pClipRects);
+ pdp->pClipRects = NULL;
+ }
+
+ if (pdp->pBackClipRects) {
+ free(pdp->pBackClipRects);
+ pdp->pBackClipRects = NULL;
+ }
+
+ DRM_SPINUNLOCK(&psp->pSAREA->drawable_lock, psp->drawLockID);
+
+ if (! (*psp->getDrawableInfo->getDrawableInfo)(pdp,
+ &pdp->index, &pdp->lastStamp,
+ &pdp->x, &pdp->y, &pdp->w, &pdp->h,
+ &pdp->numClipRects, &pdp->pClipRects,
+ &pdp->backX,
+ &pdp->backY,
+ &pdp->numBackClipRects,
+ &pdp->pBackClipRects,
+ pdp->loaderPrivate)) {
+ /* Error -- eg the window may have been destroyed. Keep going
+ * with no cliprects.
+ */
+ pdp->pStamp = &pdp->lastStamp; /* prevent endless loop */
+ pdp->numClipRects = 0;
+ pdp->pClipRects = NULL;
+ pdp->numBackClipRects = 0;
+ pdp->pBackClipRects = NULL;
+ }
+ else
+ pdp->pStamp = &(psp->pSAREA->drawableTable[pdp->index].stamp);
+
+ DRM_SPINLOCK(&psp->pSAREA->drawable_lock, psp->drawLockID);
+}
+
+/*@}*/
+
+/*****************************************************************/
+/** \name GLX callbacks */
+/*****************************************************************/
+/*@{*/
+
+static void driReportDamage(__DRIdrawable *pdp,
+ struct drm_clip_rect *pClipRects, int numClipRects)
+{
+ __DRIscreen *psp = pdp->driScreenPriv;
+
+ /* Check that we actually have the new damage report method */
+ if (psp->damage) {
+ /* Report the damage. Currently, all our drivers draw
+ * directly to the front buffer, so we report the damage there
+ * rather than to the backing storein (if any).
+ */
+ (*psp->damage->reportDamage)(pdp,
+ pdp->x, pdp->y,
+ pClipRects, numClipRects,
+ GL_TRUE, pdp->loaderPrivate);
+ }
+}
+
+
+/**
+ * Swap buffers.
+ *
+ * \param drawablePrivate opaque pointer to the per-drawable private info.
+ *
+ * \internal
+ * This function calls __DRIdrawable::swapBuffers.
+ *
+ * Is called directly from glXSwapBuffers().
+ */
+static void driSwapBuffers(__DRIdrawable *dPriv)
+{
+ __DRIscreen *psp = dPriv->driScreenPriv;
+ drm_clip_rect_t *rects;
+ int i;
+
+ psp->DriverAPI.SwapBuffers(dPriv);
+
+ if (!dPriv->numClipRects)
+ return;
+
+ rects = malloc(sizeof(*rects) * dPriv->numClipRects);
+
+ if (!rects)
+ return;
+
+ for (i = 0; i < dPriv->numClipRects; i++) {
+ rects[i].x1 = dPriv->pClipRects[i].x1 - dPriv->x;
+ rects[i].y1 = dPriv->pClipRects[i].y1 - dPriv->y;
+ rects[i].x2 = dPriv->pClipRects[i].x2 - dPriv->x;
+ rects[i].y2 = dPriv->pClipRects[i].y2 - dPriv->y;
+ }
+
+ driReportDamage(dPriv, rects, dPriv->numClipRects);
+ free(rects);
+}
+
+static int driDrawableGetMSC( __DRIscreen *sPriv, __DRIdrawable *dPriv,
+ int64_t *msc )
+{
+ return sPriv->DriverAPI.GetDrawableMSC(sPriv, dPriv, msc);
+}
+
+
+static int driWaitForMSC(__DRIdrawable *dPriv, int64_t target_msc,
+ int64_t divisor, int64_t remainder,
+ int64_t * msc, int64_t * sbc)
+{
+ __DRIswapInfo sInfo;
+ int status;
+
+ status = dPriv->driScreenPriv->DriverAPI.WaitForMSC( dPriv, target_msc,
+ divisor, remainder,
+ msc );
+
+ /* GetSwapInfo() may not be provided by the driver if GLX_SGI_video_sync
+ * is supported but GLX_OML_sync_control is not. Therefore, don't return
+ * an error value if GetSwapInfo() is not implemented.
+ */
+ if ( status == 0
+ && dPriv->driScreenPriv->DriverAPI.GetSwapInfo ) {
+ status = dPriv->driScreenPriv->DriverAPI.GetSwapInfo( dPriv, & sInfo );
+ *sbc = sInfo.swap_count;
+ }
+
+ return status;
+}
+
+
+const __DRImediaStreamCounterExtension driMediaStreamCounterExtension = {
+ { __DRI_MEDIA_STREAM_COUNTER, __DRI_MEDIA_STREAM_COUNTER_VERSION },
+ driWaitForMSC,
+ driDrawableGetMSC,
+};
+
+
+static void driCopySubBuffer(__DRIdrawable *dPriv,
+ int x, int y, int w, int h)
+{
+ drm_clip_rect_t rect;
+
+ rect.x1 = x;
+ rect.y1 = dPriv->h - y - h;
+ rect.x2 = x + w;
+ rect.y2 = rect.y1 + h;
+ driReportDamage(dPriv, &rect, 1);
+
+ dPriv->driScreenPriv->DriverAPI.CopySubBuffer(dPriv, x, y, w, h);
+}
+
+const __DRIcopySubBufferExtension driCopySubBufferExtension = {
+ { __DRI_COPY_SUB_BUFFER, __DRI_COPY_SUB_BUFFER_VERSION },
+ driCopySubBuffer
+};
+
+static void driSetSwapInterval(__DRIdrawable *dPriv, unsigned int interval)
+{
+ dPriv->swap_interval = interval;
+}
+
+static unsigned int driGetSwapInterval(__DRIdrawable *dPriv)
+{
+ return dPriv->swap_interval;
+}
+
+const __DRIswapControlExtension driSwapControlExtension = {
+ { __DRI_SWAP_CONTROL, __DRI_SWAP_CONTROL_VERSION },
+ driSetSwapInterval,
+ driGetSwapInterval
+};
+
+
+/**
+ * This is called via __DRIscreenRec's createNewDrawable pointer.
+ */
+static __DRIdrawable *
+driCreateNewDrawable(__DRIscreen *psp, const __DRIconfig *config,
+ drm_drawable_t hwDrawable, int renderType,
+ const int *attrs, void *data)
+{
+ __DRIdrawable *pdp;
+
+ /* Since pbuffers are not yet supported, no drawable attributes are
+ * supported either.
+ */
+ (void) attrs;
+
+ pdp = malloc(sizeof *pdp);
+ if (!pdp) {
+ return NULL;
+ }
+
+ pdp->driContextPriv = NULL;
+ pdp->loaderPrivate = data;
+ pdp->hHWDrawable = hwDrawable;
+ pdp->refcount = 1;
+ pdp->pStamp = NULL;
+ pdp->lastStamp = 0;
+ pdp->index = 0;
+ pdp->x = 0;
+ pdp->y = 0;
+ pdp->w = 0;
+ pdp->h = 0;
+ pdp->numClipRects = 0;
+ pdp->numBackClipRects = 0;
+ pdp->pClipRects = NULL;
+ pdp->pBackClipRects = NULL;
+ pdp->vblSeq = 0;
+ pdp->vblFlags = 0;
+
+ pdp->driScreenPriv = psp;
+
+ if (!(*psp->DriverAPI.CreateBuffer)(psp, pdp, &config->modes, 0)) {
+ free(pdp);
+ return NULL;
+ }
+
+ pdp->msc_base = 0;
+
+ /* This special default value is replaced with the configured
+ * default value when the drawable is first bound to a direct
+ * rendering context.
+ */
+ pdp->swap_interval = (unsigned)-1;
+
+ return pdp;
+}
+
+
+static __DRIdrawable *
+dri2CreateNewDrawable(__DRIscreen *screen,
+ const __DRIconfig *config,
+ void *loaderPrivate)
+{
+ __DRIdrawable *pdraw;
+
+ pdraw = driCreateNewDrawable(screen, config, 0, 0, NULL, loaderPrivate);
+ if (!pdraw)
+ return NULL;
+
+ pdraw->pClipRects = &pdraw->dri2.clipRect;
+ pdraw->pBackClipRects = &pdraw->dri2.clipRect;
+
+ pdraw->pStamp = &pdraw->dri2.stamp;
+ *pdraw->pStamp = pdraw->lastStamp + 1;
+
+ return pdraw;
+}
+
+static __DRIbuffer *
+dri2AllocateBuffer(__DRIscreen *screen,
+ unsigned int attachment, unsigned int format,
+ int width, int height)
+{
+ return (*screen->DriverAPI.AllocateBuffer)(screen, attachment, format,
+ width, height);
+}
+
+static void
+dri2ReleaseBuffer(__DRIscreen *screen, __DRIbuffer *buffer)
+{
+ (*screen->DriverAPI.ReleaseBuffer)(screen, buffer);
+}
+
+
+static int
+dri2ConfigQueryb(__DRIscreen *screen, const char *var, GLboolean *val)
+{
+ if (!driCheckOption(&screen->optionCache, var, DRI_BOOL))
+ return -1;
+
+ *val = driQueryOptionb(&screen->optionCache, var);
+
+ return 0;
+}
+
+static int
+dri2ConfigQueryi(__DRIscreen *screen, const char *var, GLint *val)
+{
+ if (!driCheckOption(&screen->optionCache, var, DRI_INT) &&
+ !driCheckOption(&screen->optionCache, var, DRI_ENUM))
+ return -1;
+
+ *val = driQueryOptioni(&screen->optionCache, var);
+
+ return 0;
+}
+
+static int
+dri2ConfigQueryf(__DRIscreen *screen, const char *var, GLfloat *val)
+{
+ if (!driCheckOption(&screen->optionCache, var, DRI_FLOAT))
+ return -1;
+
+ *val = driQueryOptionf(&screen->optionCache, var);
+
+ return 0;
+}
+
+
+static void dri_get_drawable(__DRIdrawable *pdp)
+{
+ pdp->refcount++;
+}
+
+static void dri_put_drawable(__DRIdrawable *pdp)
+{
+ __DRIscreen *psp;
+
+ if (pdp) {
+ pdp->refcount--;
+ if (pdp->refcount)
+ return;
+
+ psp = pdp->driScreenPriv;
+ (*psp->DriverAPI.DestroyBuffer)(pdp);
+ if (pdp->pClipRects && pdp->pClipRects != &pdp->dri2.clipRect) {
+ free(pdp->pClipRects);
+ pdp->pClipRects = NULL;
+ }
+ if (pdp->pBackClipRects && pdp->pClipRects != &pdp->dri2.clipRect) {
+ free(pdp->pBackClipRects);
+ pdp->pBackClipRects = NULL;
+ }
+ free(pdp);
+ }
+}
+
+static void
+driDestroyDrawable(__DRIdrawable *pdp)
+{
+ dri_put_drawable(pdp);
+}
+
+/*@}*/
+
+
+/*****************************************************************/
+/** \name Context handling functions */
+/*****************************************************************/
+/*@{*/
+
+/**
+ * Destroy the per-context private information.
+ *
+ * \internal
+ * This function calls __DriverAPIRec::DestroyContext on \p contextPrivate, calls
+ * drmDestroyContext(), and finally frees \p contextPrivate.
+ */
+static void
+driDestroyContext(__DRIcontext *pcp)
+{
+ if (pcp) {
+ (*pcp->driScreenPriv->DriverAPI.DestroyContext)(pcp);
+ free(pcp);
+ }
+}
+
+
+/**
+ * Create the per-drawable private driver information.
+ *
+ * \param render_type Type of rendering target. \c GLX_RGBA is the only
+ * type likely to ever be supported for direct-rendering.
+ * \param shared Context with which to share textures, etc. or NULL
+ *
+ * \returns An opaque pointer to the per-context private information on
+ * success, or \c NULL on failure.
+ *
+ * \internal
+ * This function allocates and fills a __DRIcontextRec structure. It
+ * performs some device independent initialization and passes all the
+ * relevent information to __DriverAPIRec::CreateContext to create the
+ * context.
+ *
+ */
+static __DRIcontext *
+driCreateNewContext(__DRIscreen *psp, const __DRIconfig *config,
+ int render_type, __DRIcontext *shared,
+ drm_context_t hwContext, void *data)
+{
+ __DRIcontext *pcp;
+ void * const shareCtx = (shared != NULL) ? shared->driverPrivate : NULL;
+
+ pcp = malloc(sizeof *pcp);
+ if (!pcp)
+ return NULL;
+
+ pcp->driScreenPriv = psp;
+ pcp->driDrawablePriv = NULL;
+ pcp->loaderPrivate = data;
+
+ pcp->dri2.draw_stamp = 0;
+ pcp->dri2.read_stamp = 0;
+
+ pcp->hHWContext = hwContext;
+
+ if ( !(*psp->DriverAPI.CreateContext)(API_OPENGL,
+ &config->modes, pcp, shareCtx) ) {
+ free(pcp);
+ return NULL;
+ }
+
+ return pcp;
+}
+
+static unsigned int
+dri2GetAPIMask(__DRIscreen *screen)
+{
+ return screen->api_mask;
+}
+
+static __DRIcontext *
+dri2CreateNewContextForAPI(__DRIscreen *screen, int api,
+ const __DRIconfig *config,
+ __DRIcontext *shared, void *data)
+{
+ __DRIcontext *context;
+ const struct gl_config *modes = (config != NULL) ? &config->modes : NULL;
+ void *shareCtx = (shared != NULL) ? shared->driverPrivate : NULL;
+ gl_api mesa_api;
+
+ if (!(screen->api_mask & (1 << api)))
+ return NULL;
+
+ switch (api) {
+ case __DRI_API_OPENGL:
+ mesa_api = API_OPENGL;
+ break;
+ case __DRI_API_GLES:
+ mesa_api = API_OPENGLES;
+ break;
+ case __DRI_API_GLES2:
+ mesa_api = API_OPENGLES2;
+ break;
+ default:
+ return NULL;
+ }
+
+ context = malloc(sizeof *context);
+ if (!context)
+ return NULL;
+
+ context->driScreenPriv = screen;
+ context->driDrawablePriv = NULL;
+ context->loaderPrivate = data;
+
+ if (!(*screen->DriverAPI.CreateContext)(mesa_api, modes,
+ context, shareCtx) ) {
+ free(context);
+ return NULL;
+ }
+
+ return context;
+}
+
+
+static __DRIcontext *
+dri2CreateNewContext(__DRIscreen *screen, const __DRIconfig *config,
+ __DRIcontext *shared, void *data)
+{
+ return dri2CreateNewContextForAPI(screen, __DRI_API_OPENGL,
+ config, shared, data);
+}
+
+static int
+driCopyContext(__DRIcontext *dest, __DRIcontext *src, unsigned long mask)
+{
+ return GL_FALSE;
+}
+
+/*@}*/
+
+
+/*****************************************************************/
+/** \name Screen handling functions */
+/*****************************************************************/
+/*@{*/
+
+/**
+ * Destroy the per-screen private information.
+ *
+ * \internal
+ * This function calls __DriverAPIRec::DestroyScreen on \p screenPrivate, calls
+ * drmClose(), and finally frees \p screenPrivate.
+ */
+static void driDestroyScreen(__DRIscreen *psp)
+{
+ if (psp) {
+ /* No interaction with the X-server is possible at this point. This
+ * routine is called after XCloseDisplay, so there is no protocol
+ * stream open to the X-server anymore.
+ */
+
+ _mesa_destroy_shader_compiler();
+
+ if (psp->DriverAPI.DestroyScreen)
+ (*psp->DriverAPI.DestroyScreen)(psp);
+
+ if (!psp->dri2.enabled) {
+ (void)drmUnmap((drmAddress)psp->pSAREA, SAREA_MAX);
+ (void)drmUnmap((drmAddress)psp->pFB, psp->fbSize);
+ (void)drmCloseOnce(psp->fd);
+ } else {
+ driDestroyOptionCache(&psp->optionCache);
+ driDestroyOptionInfo(&psp->optionInfo);
+ }
+
+ free(psp);
+ }
+}
+
+static void
+setupLoaderExtensions(__DRIscreen *psp,
+ const __DRIextension **extensions)
+{
+ int i;
+
+ for (i = 0; extensions[i]; i++) {
+ if (strcmp(extensions[i]->name, __DRI_GET_DRAWABLE_INFO) == 0)
+ psp->getDrawableInfo = (__DRIgetDrawableInfoExtension *) extensions[i];
+ if (strcmp(extensions[i]->name, __DRI_DAMAGE) == 0)
+ psp->damage = (__DRIdamageExtension *) extensions[i];
+ if (strcmp(extensions[i]->name, __DRI_SYSTEM_TIME) == 0)
+ psp->systemTime = (__DRIsystemTimeExtension *) extensions[i];
+ if (strcmp(extensions[i]->name, __DRI_DRI2_LOADER) == 0)
+ psp->dri2.loader = (__DRIdri2LoaderExtension *) extensions[i];
+ if (strcmp(extensions[i]->name, __DRI_IMAGE_LOOKUP) == 0)
+ psp->dri2.image = (__DRIimageLookupExtension *) extensions[i];
+ if (strcmp(extensions[i]->name, __DRI_USE_INVALIDATE) == 0)
+ psp->dri2.useInvalidate = (__DRIuseInvalidateExtension *) extensions[i];
+ }
+}
+
+/**
+ * This is the bootstrap function for the driver. libGL supplies all of the
+ * requisite information about the system, and the driver initializes itself.
+ * This routine also fills in the linked list pointed to by \c driver_modes
+ * with the \c struct gl_config that the driver can support for windows or
+ * pbuffers.
+ *
+ * For legacy DRI.
+ *
+ * \param scrn Index of the screen
+ * \param ddx_version Version of the 2D DDX. This may not be meaningful for
+ * all drivers.
+ * \param dri_version Version of the "server-side" DRI.
+ * \param drm_version Version of the kernel DRM.
+ * \param frame_buffer Data describing the location and layout of the
+ * framebuffer.
+ * \param pSAREA Pointer to the SAREA.
+ * \param fd Device handle for the DRM.
+ * \param extensions ??
+ * \param driver_modes Returns modes suppoted by the driver
+ * \param loaderPrivate ??
+ *
+ * \note There is no need to check the minimum API version in this
+ * function. Since the name of this function is versioned, it is
+ * impossible for a loader that is too old to even load this driver.
+ */
+static __DRIscreen *
+driCreateNewScreen(int scrn,
+ const __DRIversion *ddx_version,
+ const __DRIversion *dri_version,
+ const __DRIversion *drm_version,
+ const __DRIframebuffer *frame_buffer,
+ drmAddress pSAREA, int fd,
+ const __DRIextension **extensions,
+ const __DRIconfig ***driver_modes,
+ void *loaderPrivate)
+{
+ static const __DRIextension *emptyExtensionList[] = { NULL };
+ __DRIscreen *psp;
+
+ if (driDriverAPI.InitScreen == NULL)
+ return NULL;
+
+ psp = calloc(1, sizeof *psp);
+ if (!psp)
+ return NULL;
+
+ setupLoaderExtensions(psp, extensions);
+
+ /*
+ ** NOT_DONE: This is used by the X server to detect when the client
+ ** has died while holding the drawable lock. The client sets the
+ ** drawable lock to this value.
+ */
+ psp->drawLockID = 1;
+
+ psp->drm_version = *drm_version;
+ psp->ddx_version = *ddx_version;
+ psp->dri_version = *dri_version;
+
+ psp->pSAREA = pSAREA;
+ psp->lock = (drmLock *) &psp->pSAREA->lock;
+
+ psp->pFB = frame_buffer->base;
+ psp->fbSize = frame_buffer->size;
+ psp->fbStride = frame_buffer->stride;
+ psp->fbWidth = frame_buffer->width;
+ psp->fbHeight = frame_buffer->height;
+ psp->devPrivSize = frame_buffer->dev_priv_size;
+ psp->pDevPriv = frame_buffer->dev_priv;
+ psp->fbBPP = psp->fbStride * 8 / frame_buffer->width;
+
+ psp->extensions = emptyExtensionList;
+ psp->fd = fd;
+ psp->myNum = scrn;
+ psp->dri2.enabled = GL_FALSE;
+
+ psp->DriverAPI = driDriverAPI;
+ psp->api_mask = (1 << __DRI_API_OPENGL);
+
+ *driver_modes = driDriverAPI.InitScreen(psp);
+ if (*driver_modes == NULL) {
+ free(psp);
+ return NULL;
+ }
+
+ return psp;
+}
+
+/**
+ * DRI2
+ */
+static __DRIscreen *
+dri2CreateNewScreen(int scrn, int fd,
+ const __DRIextension **extensions,
+ const __DRIconfig ***driver_configs, void *data)
+{
+ static const __DRIextension *emptyExtensionList[] = { NULL };
+ __DRIscreen *psp;
+ drmVersionPtr version;
+
+ if (driDriverAPI.InitScreen2 == NULL)
+ return NULL;
+
+ psp = calloc(1, sizeof(*psp));
+ if (!psp)
+ return NULL;
+
+ setupLoaderExtensions(psp, extensions);
+
+ version = drmGetVersion(fd);
+ if (version) {
+ psp->drm_version.major = version->version_major;
+ psp->drm_version.minor = version->version_minor;
+ psp->drm_version.patch = version->version_patchlevel;
+ drmFreeVersion(version);
+ }
+
+ psp->extensions = emptyExtensionList;
+ psp->fd = fd;
+ psp->myNum = scrn;
+ psp->dri2.enabled = GL_TRUE;
+
+ psp->DriverAPI = driDriverAPI;
+ psp->api_mask = (1 << __DRI_API_OPENGL);
+ *driver_configs = driDriverAPI.InitScreen2(psp);
+ if (*driver_configs == NULL) {
+ free(psp);
+ return NULL;
+ }
+
+ psp->DriverAPI = driDriverAPI;
+ psp->loaderPrivate = data;
+
+ driParseOptionInfo(&psp->optionInfo, __dri2ConfigOptions,
+ __dri2NConfigOptions);
+ driParseConfigFiles(&psp->optionCache, &psp->optionInfo, psp->myNum,
+ "dri2");
+
+ return psp;
+}
+
+static const __DRIextension **driGetExtensions(__DRIscreen *psp)
+{
+ return psp->extensions;
+}
+
+/** Core interface */
+const __DRIcoreExtension driCoreExtension = {
+ { __DRI_CORE, __DRI_CORE_VERSION },
+ NULL,
+ driDestroyScreen,
+ driGetExtensions,
+ driGetConfigAttrib,
+ driIndexConfigAttrib,
+ NULL,
+ driDestroyDrawable,
+ driSwapBuffers,
+ NULL,
+ driCopyContext,
+ driDestroyContext,
+ driBindContext,
+ driUnbindContext
+};
+
+/** Legacy DRI interface */
+const __DRIlegacyExtension driLegacyExtension = {
+ { __DRI_LEGACY, __DRI_LEGACY_VERSION },
+ driCreateNewScreen,
+ driCreateNewDrawable,
+ driCreateNewContext,
+};
+
+/** DRI2 interface */
+const __DRIdri2Extension driDRI2Extension = {
+ { __DRI_DRI2, __DRI_DRI2_VERSION },
+ dri2CreateNewScreen,
+ dri2CreateNewDrawable,
+ dri2CreateNewContext,
+ dri2GetAPIMask,
+ dri2CreateNewContextForAPI,
+ dri2AllocateBuffer,
+ dri2ReleaseBuffer
+};
+
+const __DRI2configQueryExtension dri2ConfigQueryExtension = {
+ { __DRI2_CONFIG_QUERY, __DRI2_CONFIG_QUERY_VERSION },
+ dri2ConfigQueryb,
+ dri2ConfigQueryi,
+ dri2ConfigQueryf,
+};
+
+/**
+ * Calculate amount of swap interval used between GLX buffer swaps.
+ *
+ * The usage value, on the range [0,max], is the fraction of total swap
+ * interval time used between GLX buffer swaps is calculated.
+ *
+ * \f$p = t_d / (i * t_r)\f$
+ *
+ * Where \f$t_d\f$ is the time since the last GLX buffer swap, \f$i\f$ is the
+ * swap interval (as set by \c glXSwapIntervalSGI), and \f$t_r\f$ time
+ * required for a single vertical refresh period (as returned by \c
+ * glXGetMscRateOML).
+ *
+ * See the documentation for the GLX_MESA_swap_frame_usage extension for more
+ * details.
+ *
+ * \param dPriv Pointer to the private drawable structure.
+ * \return If less than a single swap interval time period was required
+ * between GLX buffer swaps, a number greater than 0 and less than
+ * 1.0 is returned. If exactly one swap interval time period is
+ * required, 1.0 is returned, and if more than one is required then
+ * a number greater than 1.0 will be returned.
+ *
+ * \sa glXSwapIntervalSGI glXGetMscRateOML
+ *
+ * \todo Instead of caching the \c glXGetMscRateOML function pointer, would it
+ * be possible to cache the sync rate?
+ */
+float
+driCalculateSwapUsage( __DRIdrawable *dPriv, int64_t last_swap_ust,
+ int64_t current_ust )
+{
+ int32_t n;
+ int32_t d;
+ int interval;
+ float usage = 1.0;
+ __DRIscreen *psp = dPriv->driScreenPriv;
+
+ if ( (*psp->systemTime->getMSCRate)(dPriv, &n, &d, dPriv->loaderPrivate) ) {
+ interval = (dPriv->swap_interval != 0) ? dPriv->swap_interval : 1;
+
+
+ /* We want to calculate
+ * (current_UST - last_swap_UST) / (interval * us_per_refresh). We get
+ * current_UST by calling __glXGetUST. last_swap_UST is stored in
+ * dPriv->swap_ust. interval has already been calculated.
+ *
+ * The only tricky part is us_per_refresh. us_per_refresh is
+ * 1000000 / MSC_rate. We know the MSC_rate is n / d. We can flip it
+ * around and say us_per_refresh = 1000000 * d / n. Since this goes in
+ * the denominator of the final calculation, we calculate
+ * (interval * 1000000 * d) and move n into the numerator.
+ */
+
+ usage = (current_ust - last_swap_ust);
+ usage *= n;
+ usage /= (interval * d);
+ usage /= 1000000.0;
+ }
+
+ return usage;
+}
+
+void
+dri2InvalidateDrawable(__DRIdrawable *drawable)
+{
+ drawable->dri2.stamp++;
+}
+
+/*@}*/
diff --git a/mesalib/src/mesa/drivers/dri/common/dri_util.h b/mesalib/src/mesa/drivers/dri/common/dri_util.h
index 3d3d5c9cd..8d2a38524 100644
--- a/mesalib/src/mesa/drivers/dri/common/dri_util.h
+++ b/mesalib/src/mesa/drivers/dri/common/dri_util.h
@@ -1,563 +1,563 @@
-/*
- * Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sub license, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice (including the
- * next paragraph) shall be included in all copies or substantial portions
- * of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
- * IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
- * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-/**
- * \file dri_util.h
- * DRI utility functions definitions.
- *
- * This module acts as glue between GLX and the actual hardware driver. A DRI
- * driver doesn't really \e have to use any of this - it's optional. But, some
- * useful stuff is done here that otherwise would have to be duplicated in most
- * drivers.
- *
- * Basically, these utility functions take care of some of the dirty details of
- * screen initialization, context creation, context binding, DRM setup, etc.
- *
- * These functions are compiled into each DRI driver so libGL.so knows nothing
- * about them.
- *
- * \sa dri_util.c.
- *
- * \author Kevin E. Martin <kevin@precisioninsight.com>
- * \author Brian Paul <brian@precisioninsight.com>
- */
-
-#ifndef _DRI_UTIL_H_
-#define _DRI_UTIL_H_
-
-#include <GL/gl.h>
-#include <drm.h>
-#include <drm_sarea.h>
-#include <xf86drm.h>
-#include "xmlconfig.h"
-#include "main/glheader.h"
-#include "main/mtypes.h"
-#include "GL/internal/dri_interface.h"
-
-#define GLX_BAD_CONTEXT 5
-
-typedef struct __DRIswapInfoRec __DRIswapInfo;
-
-/**
- * Extensions.
- */
-extern const __DRIlegacyExtension driLegacyExtension;
-extern const __DRIcoreExtension driCoreExtension;
-extern const __DRIdri2Extension driDRI2Extension;
-extern const __DRIextension driReadDrawableExtension;
-extern const __DRIcopySubBufferExtension driCopySubBufferExtension;
-extern const __DRIswapControlExtension driSwapControlExtension;
-extern const __DRImediaStreamCounterExtension driMediaStreamCounterExtension;
-extern const __DRI2configQueryExtension dri2ConfigQueryExtension;
-
-/**
- * Used by DRI_VALIDATE_DRAWABLE_INFO
- */
-#define DRI_VALIDATE_DRAWABLE_INFO_ONCE(pDrawPriv) \
- do { \
- if (*(pDrawPriv->pStamp) != pDrawPriv->lastStamp) { \
- __driUtilUpdateDrawableInfo(pDrawPriv); \
- } \
- } while (0)
-
-
-/**
- * Utility macro to validate the drawable information.
- *
- * See __DRIdrawable::pStamp and __DRIdrawable::lastStamp.
- */
-#define DRI_VALIDATE_DRAWABLE_INFO(psp, pdp) \
-do { \
- while (*(pdp->pStamp) != pdp->lastStamp) { \
- register unsigned int hwContext = psp->pSAREA->lock.lock & \
- ~(DRM_LOCK_HELD | DRM_LOCK_CONT); \
- DRM_UNLOCK(psp->fd, &psp->pSAREA->lock, hwContext); \
- \
- DRM_SPINLOCK(&psp->pSAREA->drawable_lock, psp->drawLockID); \
- DRI_VALIDATE_DRAWABLE_INFO_ONCE(pdp); \
- DRM_SPINUNLOCK(&psp->pSAREA->drawable_lock, psp->drawLockID); \
- \
- DRM_LIGHT_LOCK(psp->fd, &psp->pSAREA->lock, hwContext); \
- } \
-} while (0)
-
-/**
- * Same as above, but for two drawables simultaneously.
- *
- */
-
-#define DRI_VALIDATE_TWO_DRAWABLES_INFO(psp, pdp, prp) \
-do { \
- while (*((pdp)->pStamp) != (pdp)->lastStamp || \
- *((prp)->pStamp) != (prp)->lastStamp) { \
- register unsigned int hwContext = (psp)->pSAREA->lock.lock & \
- ~(DRM_LOCK_HELD | DRM_LOCK_CONT); \
- DRM_UNLOCK((psp)->fd, &(psp)->pSAREA->lock, hwContext); \
- \
- DRM_SPINLOCK(&(psp)->pSAREA->drawable_lock, (psp)->drawLockID); \
- DRI_VALIDATE_DRAWABLE_INFO_ONCE(pdp); \
- DRI_VALIDATE_DRAWABLE_INFO_ONCE(prp); \
- DRM_SPINUNLOCK(&(psp)->pSAREA->drawable_lock, (psp)->drawLockID); \
- \
- DRM_LIGHT_LOCK((psp)->fd, &(psp)->pSAREA->lock, hwContext); \
- } \
-} while (0)
-
-
-/**
- * Driver callback functions.
- *
- * Each DRI driver must have one of these structures with all the pointers set
- * to appropriate functions within the driver.
- *
- * When glXCreateContext() is called, for example, it'll call a helper function
- * dri_util.c which in turn will jump through the \a CreateContext pointer in
- * this structure.
- */
-struct __DriverAPIRec {
- const __DRIconfig **(*InitScreen) (__DRIscreen * priv);
-
- /**
- * Screen destruction callback
- */
- void (*DestroyScreen)(__DRIscreen *driScrnPriv);
-
- /**
- * Context creation callback
- */
- GLboolean (*CreateContext)(gl_api api,
- const struct gl_config *glVis,
- __DRIcontext *driContextPriv,
- void *sharedContextPrivate);
-
- /**
- * Context destruction callback
- */
- void (*DestroyContext)(__DRIcontext *driContextPriv);
-
- /**
- * Buffer (drawable) creation callback
- */
- GLboolean (*CreateBuffer)(__DRIscreen *driScrnPriv,
- __DRIdrawable *driDrawPriv,
- const struct gl_config *glVis,
- GLboolean pixmapBuffer);
-
- /**
- * Buffer (drawable) destruction callback
- */
- void (*DestroyBuffer)(__DRIdrawable *driDrawPriv);
-
- /**
- * Buffer swapping callback
- */
- void (*SwapBuffers)(__DRIdrawable *driDrawPriv);
-
- /**
- * Context activation callback
- */
- GLboolean (*MakeCurrent)(__DRIcontext *driContextPriv,
- __DRIdrawable *driDrawPriv,
- __DRIdrawable *driReadPriv);
-
- /**
- * Context unbinding callback
- */
- GLboolean (*UnbindContext)(__DRIcontext *driContextPriv);
-
- /**
- * Retrieves statistics about buffer swap operations. Required if
- * GLX_OML_sync_control or GLX_MESA_swap_frame_usage is supported.
- */
- int (*GetSwapInfo)( __DRIdrawable *dPriv, __DRIswapInfo * sInfo );
-
-
- /**
- * These are required if GLX_OML_sync_control is supported.
- */
- /*@{*/
- int (*WaitForMSC)( __DRIdrawable *priv, int64_t target_msc,
- int64_t divisor, int64_t remainder,
- int64_t * msc );
- int (*WaitForSBC)( __DRIdrawable *priv, int64_t target_sbc,
- int64_t * msc, int64_t * sbc );
-
- int64_t (*SwapBuffersMSC)( __DRIdrawable *priv, int64_t target_msc,
- int64_t divisor, int64_t remainder );
- /*@}*/
- void (*CopySubBuffer)(__DRIdrawable *driDrawPriv,
- int x, int y, int w, int h);
-
- /**
- * New version of GetMSC so we can pass drawable data to the low
- * level DRM driver (e.g. pipe info). Required if
- * GLX_SGI_video_sync or GLX_OML_sync_control is supported.
- */
- int (*GetDrawableMSC) ( __DRIscreen * priv,
- __DRIdrawable *drawablePrivate,
- int64_t *count);
-
-
-
- /* DRI2 Entry point */
- const __DRIconfig **(*InitScreen2) (__DRIscreen * priv);
-
- __DRIbuffer *(*AllocateBuffer) (__DRIscreen *screenPrivate,
- unsigned int attachment,
- unsigned int format,
- int width, int height);
- void (*ReleaseBuffer) (__DRIscreen *screenPrivate, __DRIbuffer *buffer);
-};
-
-extern const struct __DriverAPIRec driDriverAPI;
-
-
-struct __DRIswapInfoRec {
- /**
- * Number of swapBuffers operations that have been *completed*.
- */
- uint64_t swap_count;
-
- /**
- * Unadjusted system time of the last buffer swap. This is the time
- * when the swap completed, not the time when swapBuffers was called.
- */
- int64_t swap_ust;
-
- /**
- * Number of swap operations that occurred after the swap deadline. That
- * is if a swap happens more than swap_interval frames after the previous
- * swap, it has missed its deadline. If swap_interval is 0, then the
- * swap deadline is 1 frame after the previous swap.
- */
- uint64_t swap_missed_count;
-
- /**
- * Amount of time used by the last swap that missed its deadline. This
- * is calculated as (__glXGetUST() - swap_ust) / (swap_interval *
- * time_for_single_vrefresh)). If the actual value of swap_interval is
- * 0, then 1 is used instead. If swap_missed_count is non-zero, this
- * should be greater-than 1.0.
- */
- float swap_missed_usage;
-};
-
-
-/**
- * Per-drawable private DRI driver information.
- */
-struct __DRIdrawableRec {
- /**
- * Kernel drawable handle
- */
- drm_drawable_t hHWDrawable;
-
- /**
- * Driver's private drawable information.
- *
- * This structure is opaque.
- */
- void *driverPrivate;
-
- /**
- * Private data from the loader. We just hold on to it and pass
- * it back when calling into loader provided functions.
- */
- void *loaderPrivate;
-
- /**
- * Reference count for number of context's currently bound to this
- * drawable.
- *
- * Once it reaches zero, the drawable can be destroyed.
- *
- * \note This behavior will change with GLX 1.3.
- */
- int refcount;
-
- /**
- * Index of this drawable information in the SAREA.
- */
- unsigned int index;
-
- /**
- * Pointer to the "drawable has changed ID" stamp in the SAREA (or
- * to dri2.stamp if DRI2 is being used).
- */
- unsigned int *pStamp;
-
- /**
- * Last value of the stamp.
- *
- * If this differs from the value stored at __DRIdrawable::pStamp,
- * then the drawable information has been modified by the X server, and the
- * drawable information (below) should be retrieved from the X server.
- */
- unsigned int lastStamp;
-
- /**
- * \name Drawable
- *
- * Drawable information used in software fallbacks.
- */
- /*@{*/
- int x;
- int y;
- int w;
- int h;
- int numClipRects;
- drm_clip_rect_t *pClipRects;
- /*@}*/
-
- /**
- * \name Back and depthbuffer
- *
- * Information about the back and depthbuffer where different from above.
- */
- /*@{*/
- int backX;
- int backY;
- int backClipRectType;
- int numBackClipRects;
- drm_clip_rect_t *pBackClipRects;
- /*@}*/
-
- /**
- * \name Vertical blank tracking information
- * Used for waiting on vertical blank events.
- */
- /*@{*/
- unsigned int vblSeq;
- unsigned int vblFlags;
- /*@}*/
-
- /**
- * \name Monotonic MSC tracking
- *
- * Low level driver is responsible for updating msc_base and
- * vblSeq values so that higher level code can calculate
- * a new msc value or msc target for a WaitMSC call. The new value
- * will be:
- * msc = msc_base + get_vblank_count() - vblank_base;
- *
- * And for waiting on a value, core code will use:
- * actual_target = target_msc - msc_base + vblank_base;
- */
- /*@{*/
- int64_t vblank_base;
- int64_t msc_base;
- /*@}*/
-
- /**
- * Pointer to context to which this drawable is currently bound.
- */
- __DRIcontext *driContextPriv;
-
- /**
- * Pointer to screen on which this drawable was created.
- */
- __DRIscreen *driScreenPriv;
-
- /**
- * Controls swap interval as used by GLX_SGI_swap_control and
- * GLX_MESA_swap_control.
- */
- unsigned int swap_interval;
-
- struct {
- unsigned int stamp;
- drm_clip_rect_t clipRect;
- } dri2;
-};
-
-/**
- * Per-context private driver information.
- */
-struct __DRIcontextRec {
- /**
- * Kernel context handle used to access the device lock.
- */
- drm_context_t hHWContext;
-
- /**
- * Device driver's private context data. This structure is opaque.
- */
- void *driverPrivate;
-
- /**
- * Pointer to drawable currently bound to this context for drawing.
- */
- __DRIdrawable *driDrawablePriv;
-
- /**
- * Pointer to drawable currently bound to this context for reading.
- */
- __DRIdrawable *driReadablePriv;
-
- /**
- * Pointer to screen on which this context was created.
- */
- __DRIscreen *driScreenPriv;
-
- /**
- * The loaders's private context data. This structure is opaque.
- */
- void *loaderPrivate;
-
- struct {
- int draw_stamp;
- int read_stamp;
- } dri2;
-};
-
-/**
- * Per-screen private driver information.
- */
-struct __DRIscreenRec {
- /**
- * Current screen's number
- */
- int myNum;
-
- /**
- * Callback functions into the hardware-specific DRI driver code.
- */
- struct __DriverAPIRec DriverAPI;
-
- const __DRIextension **extensions;
- /**
- * DDX / 2D driver version information.
- */
- __DRIversion ddx_version;
-
- /**
- * DRI X extension version information.
- */
- __DRIversion dri_version;
-
- /**
- * DRM (kernel module) version information.
- */
- __DRIversion drm_version;
-
- /**
- * ID used when the client sets the drawable lock.
- *
- * The X server uses this value to detect if the client has died while
- * holding the drawable lock.
- */
- int drawLockID;
-
- /**
- * File descriptor returned when the kernel device driver is opened.
- *
- * Used to:
- * - authenticate client to kernel
- * - map the frame buffer, SAREA, etc.
- * - close the kernel device driver
- */
- int fd;
-
- /**
- * SAREA pointer
- *
- * Used to access:
- * - the device lock
- * - the device-independent per-drawable and per-context(?) information
- */
- drm_sarea_t *pSAREA;
-
- /**
- * \name Direct frame buffer access information
- * Used for software fallbacks.
- */
- /*@{*/
- unsigned char *pFB;
- int fbSize;
- int fbOrigin;
- int fbStride;
- int fbWidth;
- int fbHeight;
- int fbBPP;
- /*@}*/
-
- /**
- * \name Device-dependent private information (stored in the SAREA).
- *
- * This data is accessed by the client driver only.
- */
- /*@{*/
- void *pDevPriv;
- int devPrivSize;
- /*@}*/
-
- /**
- * Device-dependent private information (not stored in the SAREA).
- *
- * This pointer is never touched by the DRI layer.
- */
-#ifdef __cplusplus
- void *priv;
-#else
- void *private;
-#endif
-
- /* Extensions provided by the loader. */
- const __DRIgetDrawableInfoExtension *getDrawableInfo;
- const __DRIsystemTimeExtension *systemTime;
- const __DRIdamageExtension *damage;
-
- struct {
- /* Flag to indicate that this is a DRI2 screen. Many of the above
- * fields will not be valid or initializaed in that case. */
- int enabled;
- __DRIdri2LoaderExtension *loader;
- __DRIimageLookupExtension *image;
- __DRIuseInvalidateExtension *useInvalidate;
- } dri2;
-
- /* The lock actually in use, old sarea or DRI2 */
- drmLock *lock;
-
- driOptionCache optionInfo;
- driOptionCache optionCache;
- unsigned int api_mask;
- void *loaderPrivate;
-};
-
-extern void
-__driUtilUpdateDrawableInfo(__DRIdrawable *pdp);
-
-extern float
-driCalculateSwapUsage( __DRIdrawable *dPriv,
- int64_t last_swap_ust, int64_t current_ust );
-
-extern GLint
-driIntersectArea( drm_clip_rect_t rect1, drm_clip_rect_t rect2 );
-
-extern void
-dri2InvalidateDrawable(__DRIdrawable *drawable);
-
-#endif /* _DRI_UTIL_H_ */
+/*
+ * Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+/**
+ * \file dri_util.h
+ * DRI utility functions definitions.
+ *
+ * This module acts as glue between GLX and the actual hardware driver. A DRI
+ * driver doesn't really \e have to use any of this - it's optional. But, some
+ * useful stuff is done here that otherwise would have to be duplicated in most
+ * drivers.
+ *
+ * Basically, these utility functions take care of some of the dirty details of
+ * screen initialization, context creation, context binding, DRM setup, etc.
+ *
+ * These functions are compiled into each DRI driver so libGL.so knows nothing
+ * about them.
+ *
+ * \sa dri_util.c.
+ *
+ * \author Kevin E. Martin <kevin@precisioninsight.com>
+ * \author Brian Paul <brian@precisioninsight.com>
+ */
+
+#ifndef _DRI_UTIL_H_
+#define _DRI_UTIL_H_
+
+#include <GL/gl.h>
+#include <drm.h>
+#include <drm_sarea.h>
+#include <xf86drm.h>
+#include "xmlconfig.h"
+#include "main/glheader.h"
+#include "main/mtypes.h"
+#include "GL/internal/dri_interface.h"
+
+#define GLX_BAD_CONTEXT 5
+
+typedef struct __DRIswapInfoRec __DRIswapInfo;
+
+/**
+ * Extensions.
+ */
+extern const __DRIlegacyExtension driLegacyExtension;
+extern const __DRIcoreExtension driCoreExtension;
+extern const __DRIdri2Extension driDRI2Extension;
+extern const __DRIextension driReadDrawableExtension;
+extern const __DRIcopySubBufferExtension driCopySubBufferExtension;
+extern const __DRIswapControlExtension driSwapControlExtension;
+extern const __DRImediaStreamCounterExtension driMediaStreamCounterExtension;
+extern const __DRI2configQueryExtension dri2ConfigQueryExtension;
+
+/**
+ * Used by DRI_VALIDATE_DRAWABLE_INFO
+ */
+#define DRI_VALIDATE_DRAWABLE_INFO_ONCE(pDrawPriv) \
+ do { \
+ if (*(pDrawPriv->pStamp) != pDrawPriv->lastStamp) { \
+ __driUtilUpdateDrawableInfo(pDrawPriv); \
+ } \
+ } while (0)
+
+
+/**
+ * Utility macro to validate the drawable information.
+ *
+ * See __DRIdrawable::pStamp and __DRIdrawable::lastStamp.
+ */
+#define DRI_VALIDATE_DRAWABLE_INFO(psp, pdp) \
+do { \
+ while (*(pdp->pStamp) != pdp->lastStamp) { \
+ register unsigned int hwContext = psp->pSAREA->lock.lock & \
+ ~(DRM_LOCK_HELD | DRM_LOCK_CONT); \
+ DRM_UNLOCK(psp->fd, &psp->pSAREA->lock, hwContext); \
+ \
+ DRM_SPINLOCK(&psp->pSAREA->drawable_lock, psp->drawLockID); \
+ DRI_VALIDATE_DRAWABLE_INFO_ONCE(pdp); \
+ DRM_SPINUNLOCK(&psp->pSAREA->drawable_lock, psp->drawLockID); \
+ \
+ DRM_LIGHT_LOCK(psp->fd, &psp->pSAREA->lock, hwContext); \
+ } \
+} while (0)
+
+/**
+ * Same as above, but for two drawables simultaneously.
+ *
+ */
+
+#define DRI_VALIDATE_TWO_DRAWABLES_INFO(psp, pdp, prp) \
+do { \
+ while (*((pdp)->pStamp) != (pdp)->lastStamp || \
+ *((prp)->pStamp) != (prp)->lastStamp) { \
+ register unsigned int hwContext = (psp)->pSAREA->lock.lock & \
+ ~(DRM_LOCK_HELD | DRM_LOCK_CONT); \
+ DRM_UNLOCK((psp)->fd, &(psp)->pSAREA->lock, hwContext); \
+ \
+ DRM_SPINLOCK(&(psp)->pSAREA->drawable_lock, (psp)->drawLockID); \
+ DRI_VALIDATE_DRAWABLE_INFO_ONCE(pdp); \
+ DRI_VALIDATE_DRAWABLE_INFO_ONCE(prp); \
+ DRM_SPINUNLOCK(&(psp)->pSAREA->drawable_lock, (psp)->drawLockID); \
+ \
+ DRM_LIGHT_LOCK((psp)->fd, &(psp)->pSAREA->lock, hwContext); \
+ } \
+} while (0)
+
+
+/**
+ * Driver callback functions.
+ *
+ * Each DRI driver must have one of these structures with all the pointers set
+ * to appropriate functions within the driver.
+ *
+ * When glXCreateContext() is called, for example, it'll call a helper function
+ * dri_util.c which in turn will jump through the \a CreateContext pointer in
+ * this structure.
+ */
+struct __DriverAPIRec {
+ const __DRIconfig **(*InitScreen) (__DRIscreen * priv);
+
+ /**
+ * Screen destruction callback
+ */
+ void (*DestroyScreen)(__DRIscreen *driScrnPriv);
+
+ /**
+ * Context creation callback
+ */
+ GLboolean (*CreateContext)(gl_api api,
+ const struct gl_config *glVis,
+ __DRIcontext *driContextPriv,
+ void *sharedContextPrivate);
+
+ /**
+ * Context destruction callback
+ */
+ void (*DestroyContext)(__DRIcontext *driContextPriv);
+
+ /**
+ * Buffer (drawable) creation callback
+ */
+ GLboolean (*CreateBuffer)(__DRIscreen *driScrnPriv,
+ __DRIdrawable *driDrawPriv,
+ const struct gl_config *glVis,
+ GLboolean pixmapBuffer);
+
+ /**
+ * Buffer (drawable) destruction callback
+ */
+ void (*DestroyBuffer)(__DRIdrawable *driDrawPriv);
+
+ /**
+ * Buffer swapping callback
+ */
+ void (*SwapBuffers)(__DRIdrawable *driDrawPriv);
+
+ /**
+ * Context activation callback
+ */
+ GLboolean (*MakeCurrent)(__DRIcontext *driContextPriv,
+ __DRIdrawable *driDrawPriv,
+ __DRIdrawable *driReadPriv);
+
+ /**
+ * Context unbinding callback
+ */
+ GLboolean (*UnbindContext)(__DRIcontext *driContextPriv);
+
+ /**
+ * Retrieves statistics about buffer swap operations. Required if
+ * GLX_OML_sync_control or GLX_MESA_swap_frame_usage is supported.
+ */
+ int (*GetSwapInfo)( __DRIdrawable *dPriv, __DRIswapInfo * sInfo );
+
+
+ /**
+ * These are required if GLX_OML_sync_control is supported.
+ */
+ /*@{*/
+ int (*WaitForMSC)( __DRIdrawable *priv, int64_t target_msc,
+ int64_t divisor, int64_t remainder,
+ int64_t * msc );
+ int (*WaitForSBC)( __DRIdrawable *priv, int64_t target_sbc,
+ int64_t * msc, int64_t * sbc );
+
+ int64_t (*SwapBuffersMSC)( __DRIdrawable *priv, int64_t target_msc,
+ int64_t divisor, int64_t remainder );
+ /*@}*/
+ void (*CopySubBuffer)(__DRIdrawable *driDrawPriv,
+ int x, int y, int w, int h);
+
+ /**
+ * New version of GetMSC so we can pass drawable data to the low
+ * level DRM driver (e.g. pipe info). Required if
+ * GLX_SGI_video_sync or GLX_OML_sync_control is supported.
+ */
+ int (*GetDrawableMSC) ( __DRIscreen * priv,
+ __DRIdrawable *drawablePrivate,
+ int64_t *count);
+
+
+
+ /* DRI2 Entry point */
+ const __DRIconfig **(*InitScreen2) (__DRIscreen * priv);
+
+ __DRIbuffer *(*AllocateBuffer) (__DRIscreen *screenPrivate,
+ unsigned int attachment,
+ unsigned int format,
+ int width, int height);
+ void (*ReleaseBuffer) (__DRIscreen *screenPrivate, __DRIbuffer *buffer);
+};
+
+extern const struct __DriverAPIRec driDriverAPI;
+
+
+struct __DRIswapInfoRec {
+ /**
+ * Number of swapBuffers operations that have been *completed*.
+ */
+ uint64_t swap_count;
+
+ /**
+ * Unadjusted system time of the last buffer swap. This is the time
+ * when the swap completed, not the time when swapBuffers was called.
+ */
+ int64_t swap_ust;
+
+ /**
+ * Number of swap operations that occurred after the swap deadline. That
+ * is if a swap happens more than swap_interval frames after the previous
+ * swap, it has missed its deadline. If swap_interval is 0, then the
+ * swap deadline is 1 frame after the previous swap.
+ */
+ uint64_t swap_missed_count;
+
+ /**
+ * Amount of time used by the last swap that missed its deadline. This
+ * is calculated as (__glXGetUST() - swap_ust) / (swap_interval *
+ * time_for_single_vrefresh)). If the actual value of swap_interval is
+ * 0, then 1 is used instead. If swap_missed_count is non-zero, this
+ * should be greater-than 1.0.
+ */
+ float swap_missed_usage;
+};
+
+
+/**
+ * Per-drawable private DRI driver information.
+ */
+struct __DRIdrawableRec {
+ /**
+ * Kernel drawable handle
+ */
+ drm_drawable_t hHWDrawable;
+
+ /**
+ * Driver's private drawable information.
+ *
+ * This structure is opaque.
+ */
+ void *driverPrivate;
+
+ /**
+ * Private data from the loader. We just hold on to it and pass
+ * it back when calling into loader provided functions.
+ */
+ void *loaderPrivate;
+
+ /**
+ * Reference count for number of context's currently bound to this
+ * drawable.
+ *
+ * Once it reaches zero, the drawable can be destroyed.
+ *
+ * \note This behavior will change with GLX 1.3.
+ */
+ int refcount;
+
+ /**
+ * Index of this drawable information in the SAREA.
+ */
+ unsigned int index;
+
+ /**
+ * Pointer to the "drawable has changed ID" stamp in the SAREA (or
+ * to dri2.stamp if DRI2 is being used).
+ */
+ unsigned int *pStamp;
+
+ /**
+ * Last value of the stamp.
+ *
+ * If this differs from the value stored at __DRIdrawable::pStamp,
+ * then the drawable information has been modified by the X server, and the
+ * drawable information (below) should be retrieved from the X server.
+ */
+ unsigned int lastStamp;
+
+ /**
+ * \name Drawable
+ *
+ * Drawable information used in software fallbacks.
+ */
+ /*@{*/
+ int x;
+ int y;
+ int w;
+ int h;
+ int numClipRects;
+ drm_clip_rect_t *pClipRects;
+ /*@}*/
+
+ /**
+ * \name Back and depthbuffer
+ *
+ * Information about the back and depthbuffer where different from above.
+ */
+ /*@{*/
+ int backX;
+ int backY;
+ int backClipRectType;
+ int numBackClipRects;
+ drm_clip_rect_t *pBackClipRects;
+ /*@}*/
+
+ /**
+ * \name Vertical blank tracking information
+ * Used for waiting on vertical blank events.
+ */
+ /*@{*/
+ unsigned int vblSeq;
+ unsigned int vblFlags;
+ /*@}*/
+
+ /**
+ * \name Monotonic MSC tracking
+ *
+ * Low level driver is responsible for updating msc_base and
+ * vblSeq values so that higher level code can calculate
+ * a new msc value or msc target for a WaitMSC call. The new value
+ * will be:
+ * msc = msc_base + get_vblank_count() - vblank_base;
+ *
+ * And for waiting on a value, core code will use:
+ * actual_target = target_msc - msc_base + vblank_base;
+ */
+ /*@{*/
+ int64_t vblank_base;
+ int64_t msc_base;
+ /*@}*/
+
+ /**
+ * Pointer to context to which this drawable is currently bound.
+ */
+ __DRIcontext *driContextPriv;
+
+ /**
+ * Pointer to screen on which this drawable was created.
+ */
+ __DRIscreen *driScreenPriv;
+
+ /**
+ * Controls swap interval as used by GLX_SGI_swap_control and
+ * GLX_MESA_swap_control.
+ */
+ unsigned int swap_interval;
+
+ struct {
+ unsigned int stamp;
+ drm_clip_rect_t clipRect;
+ } dri2;
+};
+
+/**
+ * Per-context private driver information.
+ */
+struct __DRIcontextRec {
+ /**
+ * Kernel context handle used to access the device lock.
+ */
+ drm_context_t hHWContext;
+
+ /**
+ * Device driver's private context data. This structure is opaque.
+ */
+ void *driverPrivate;
+
+ /**
+ * Pointer to drawable currently bound to this context for drawing.
+ */
+ __DRIdrawable *driDrawablePriv;
+
+ /**
+ * Pointer to drawable currently bound to this context for reading.
+ */
+ __DRIdrawable *driReadablePriv;
+
+ /**
+ * Pointer to screen on which this context was created.
+ */
+ __DRIscreen *driScreenPriv;
+
+ /**
+ * The loaders's private context data. This structure is opaque.
+ */
+ void *loaderPrivate;
+
+ struct {
+ int draw_stamp;
+ int read_stamp;
+ } dri2;
+};
+
+/**
+ * Per-screen private driver information.
+ */
+struct __DRIscreenRec {
+ /**
+ * Current screen's number
+ */
+ int myNum;
+
+ /**
+ * Callback functions into the hardware-specific DRI driver code.
+ */
+ struct __DriverAPIRec DriverAPI;
+
+ const __DRIextension **extensions;
+ /**
+ * DDX / 2D driver version information.
+ */
+ __DRIversion ddx_version;
+
+ /**
+ * DRI X extension version information.
+ */
+ __DRIversion dri_version;
+
+ /**
+ * DRM (kernel module) version information.
+ */
+ __DRIversion drm_version;
+
+ /**
+ * ID used when the client sets the drawable lock.
+ *
+ * The X server uses this value to detect if the client has died while
+ * holding the drawable lock.
+ */
+ int drawLockID;
+
+ /**
+ * File descriptor returned when the kernel device driver is opened.
+ *
+ * Used to:
+ * - authenticate client to kernel
+ * - map the frame buffer, SAREA, etc.
+ * - close the kernel device driver
+ */
+ int fd;
+
+ /**
+ * SAREA pointer
+ *
+ * Used to access:
+ * - the device lock
+ * - the device-independent per-drawable and per-context(?) information
+ */
+ drm_sarea_t *pSAREA;
+
+ /**
+ * \name Direct frame buffer access information
+ * Used for software fallbacks.
+ */
+ /*@{*/
+ unsigned char *pFB;
+ int fbSize;
+ int fbOrigin;
+ int fbStride;
+ int fbWidth;
+ int fbHeight;
+ int fbBPP;
+ /*@}*/
+
+ /**
+ * \name Device-dependent private information (stored in the SAREA).
+ *
+ * This data is accessed by the client driver only.
+ */
+ /*@{*/
+ void *pDevPriv;
+ int devPrivSize;
+ /*@}*/
+
+ /**
+ * Device-dependent private information (not stored in the SAREA).
+ *
+ * This pointer is never touched by the DRI layer.
+ */
+#ifdef __cplusplus
+ void *priv;
+#else
+ void *private;
+#endif
+
+ /* Extensions provided by the loader. */
+ const __DRIgetDrawableInfoExtension *getDrawableInfo;
+ const __DRIsystemTimeExtension *systemTime;
+ const __DRIdamageExtension *damage;
+
+ struct {
+ /* Flag to indicate that this is a DRI2 screen. Many of the above
+ * fields will not be valid or initializaed in that case. */
+ int enabled;
+ __DRIdri2LoaderExtension *loader;
+ __DRIimageLookupExtension *image;
+ __DRIuseInvalidateExtension *useInvalidate;
+ } dri2;
+
+ /* The lock actually in use, old sarea or DRI2 */
+ drmLock *lock;
+
+ driOptionCache optionInfo;
+ driOptionCache optionCache;
+ unsigned int api_mask;
+ void *loaderPrivate;
+};
+
+extern void
+__driUtilUpdateDrawableInfo(__DRIdrawable *pdp);
+
+extern float
+driCalculateSwapUsage( __DRIdrawable *dPriv,
+ int64_t last_swap_ust, int64_t current_ust );
+
+extern GLint
+driIntersectArea( drm_clip_rect_t rect1, drm_clip_rect_t rect2 );
+
+extern void
+dri2InvalidateDrawable(__DRIdrawable *drawable);
+
+#endif /* _DRI_UTIL_H_ */
diff --git a/mesalib/src/mesa/drivers/dri/common/spantmp2.h b/mesalib/src/mesa/drivers/dri/common/spantmp2.h
index abd79562f..536dffc54 100644
--- a/mesalib/src/mesa/drivers/dri/common/spantmp2.h
+++ b/mesalib/src/mesa/drivers/dri/common/spantmp2.h
@@ -1,916 +1,916 @@
-/*
- * Copyright 2000-2001 VA Linux Systems, Inc.
- * (C) Copyright IBM Corporation 2004
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * on the rights to use, copy, modify, merge, publish, distribute, sub
- * license, and/or sell copies of the Software, and to permit persons to whom
- * the Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
- * VA LINUX SYSTEM, IBM AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
- * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
- * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
- * USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-/**
- * \file spantmp2.h
- *
- * Template file of span read / write functions.
- *
- * \author Keith Whitwell <keithw@tungstengraphics.com>
- * \author Gareth Hughes <gareth@nvidia.com>
- * \author Ian Romanick <idr@us.ibm.com>
- */
-
-#include "main/colormac.h"
-#include "spantmp_common.h"
-
-#ifndef DBG
-#define DBG 0
-#endif
-
-#ifndef HW_READ_CLIPLOOP
-#define HW_READ_CLIPLOOP() HW_CLIPLOOP()
-#endif
-
-#ifndef HW_WRITE_CLIPLOOP
-#define HW_WRITE_CLIPLOOP() HW_CLIPLOOP()
-#endif
-
-#if (SPANTMP_PIXEL_FMT == GL_RGB) && (SPANTMP_PIXEL_TYPE == GL_UNSIGNED_SHORT_5_6_5)
-
-/**
- ** GL_RGB, GL_UNSIGNED_SHORT_5_6_5
- **/
-
-#ifndef GET_VALUE
-#ifndef GET_PTR
-#define GET_PTR(_x, _y) (buf + (_x) * 2 + (_y) * pitch)
-#endif
-
-#define GET_VALUE(_x, _y) *(volatile GLushort *)(GET_PTR(_x, _y))
-#define PUT_VALUE(_x, _y, _v) *(volatile GLushort *)(GET_PTR(_x, _y)) = (_v)
-#endif /* GET_VALUE */
-
-#define INIT_MONO_PIXEL(p, color) \
- p = PACK_COLOR_565( color[0], color[1], color[2] )
-
-#define WRITE_RGBA( _x, _y, r, g, b, a ) \
- PUT_VALUE(_x, _y, ((((int)r & 0xf8) << 8) | \
- (((int)g & 0xfc) << 3) | \
- (((int)b & 0xf8) >> 3))) \
-
-#define WRITE_PIXEL( _x, _y, p ) PUT_VALUE(_x, _y, p)
-
-#define READ_RGBA( rgba, _x, _y ) \
- do { \
- GLushort p = GET_VALUE(_x, _y); \
- rgba[0] = ((p >> 8) & 0xf8) * 255 / 0xf8; \
- rgba[1] = ((p >> 3) & 0xfc) * 255 / 0xfc; \
- rgba[2] = ((p << 3) & 0xf8) * 255 / 0xf8; \
- rgba[3] = 0xff; \
- } while (0)
-
-#elif (SPANTMP_PIXEL_FMT == GL_RGB) && (SPANTMP_PIXEL_TYPE == GL_UNSIGNED_SHORT_5_6_5_REV)
-
-/**
- ** GL_RGB, GL_UNSIGNED_SHORT_5_6_5_REV
- **/
-
-#ifndef GET_VALUE
-#ifndef GET_PTR
-#define GET_PTR(_x, _y) (buf + (_x) * 2 + (_y) * pitch)
-#endif
-
-#define GET_VALUE(_x, _y) *(volatile GLushort *)(GET_PTR(_x, _y))
-#define PUT_VALUE(_x, _y, _v) *(volatile GLushort *)(GET_PTR(_x, _y)) = (_v)
-#endif /* GET_VALUE */
-
-#define INIT_MONO_PIXEL(p, color) \
- p = PACK_COLOR_565_REV( color[0], color[1], color[2] )
-
-#define WRITE_RGBA( _x, _y, r, g, b, a ) \
- PUT_VALUE(_x, _y, PACK_COLOR_565_REV( r, g, b ))
-
-#define WRITE_PIXEL( _x, _y, p ) PUT_VALUE(_x, _y, p)
-
-#define READ_RGBA( rgba, _x, _y ) \
- do { \
- GLushort p = GET_VALUE(_x, _y); \
- p = p << 8 | p >> 8; \
- rgba[0] = ((p >> 8) & 0xf8) * 255 / 0xf8; \
- rgba[1] = ((p >> 3) & 0xfc) * 255 / 0xfc; \
- rgba[2] = ((p << 3) & 0xf8) * 255 / 0xf8; \
- rgba[3] = 0xff; \
- } while (0)
-
-#elif (SPANTMP_PIXEL_FMT == GL_BGRA) && (SPANTMP_PIXEL_TYPE == GL_UNSIGNED_SHORT_4_4_4_4)
-
-/**
- ** GL_BGRA, GL_UNSIGNED_SHORT_4_4_4_4
- **/
-
-#ifndef GET_VALUE
-#ifndef GET_PTR
-#define GET_PTR(_x, _y) (buf + (_x) * 2 + (_y) * pitch)
-#endif
-
-#define GET_VALUE(_x, _y) *(volatile GLushort *)(GET_PTR(_x, _y))
-#define PUT_VALUE(_x, _y, _v) *(volatile GLushort *)(GET_PTR(_x, _y)) = (_v)
-#endif /* GET_VALUE */
-
-#define INIT_MONO_PIXEL(p, color) \
- p = PACK_COLOR_4444_REV(color[3], color[0], color[1], color[2])
-
-#define WRITE_RGBA( _x, _y, r, g, b, a ) \
- PUT_VALUE(_x, _y, PACK_COLOR_4444_REV(a, r, g, b)) \
-
-#define WRITE_PIXEL( _x, _y, p ) PUT_VALUE(_x, _y, p)
-
-#define READ_RGBA( rgba, _x, _y ) \
- do { \
- GLushort p = GET_VALUE(_x, _y); \
- rgba[0] = ((p >> 0) & 0xf) * 0x11; \
- rgba[1] = ((p >> 12) & 0xf) * 0x11; \
- rgba[2] = ((p >> 4) & 0xf) * 0x11; \
- rgba[3] = ((p >> 8) & 0xf) * 0x11; \
- } while (0)
-
-
-#elif (SPANTMP_PIXEL_FMT == GL_BGRA) && (SPANTMP_PIXEL_TYPE == GL_UNSIGNED_SHORT_4_4_4_4_REV)
-
-/**
- ** GL_BGRA, GL_UNSIGNED_SHORT_4_4_4_4_REV
- **/
-
-#ifndef GET_VALUE
-#ifndef GET_PTR
-#define GET_PTR(_x, _y) (buf + (_x) * 2 + (_y) * pitch)
-#endif
-
-#define GET_VALUE(_x, _y) *(volatile GLushort *)(GET_PTR(_x, _y))
-#define PUT_VALUE(_x, _y, _v) *(volatile GLushort *)(GET_PTR(_x, _y)) = (_v)
-#endif /* GET_VALUE */
-
-#define INIT_MONO_PIXEL(p, color) \
- p = PACK_COLOR_4444(color[3], color[0], color[1], color[2])
-
-#define WRITE_RGBA( _x, _y, r, g, b, a ) \
- PUT_VALUE(_x, _y, PACK_COLOR_4444(a, r, g, b)) \
-
-#define WRITE_PIXEL( _x, _y, p ) PUT_VALUE(_x, _y, p)
-
-#define READ_RGBA( rgba, _x, _y ) \
- do { \
- GLushort p = GET_VALUE(_x, _y); \
- rgba[0] = ((p >> 8) & 0xf) * 0x11; \
- rgba[1] = ((p >> 4) & 0xf) * 0x11; \
- rgba[2] = ((p >> 0) & 0xf) * 0x11; \
- rgba[3] = ((p >> 12) & 0xf) * 0x11; \
- } while (0)
-
-
-#elif (SPANTMP_PIXEL_FMT == GL_BGRA) && (SPANTMP_PIXEL_TYPE == GL_UNSIGNED_SHORT_1_5_5_5_REV)
-
-/**
- ** GL_BGRA, GL_UNSIGNED_SHORT_1_5_5_5_REV
- **/
-
-#ifndef GET_VALUE
-#ifndef GET_PTR
-#define GET_PTR(_x, _y) (buf + (_x) * 2 + (_y) * pitch)
-#endif
-
-#define GET_VALUE(_x, _y) *(volatile GLushort *)(GET_PTR(_x, _y))
-#define PUT_VALUE(_x, _y, _v) *(volatile GLushort *)(GET_PTR(_x, _y)) = (_v)
-#endif /* GET_VALUE */
-
-#define INIT_MONO_PIXEL(p, color) \
- p = PACK_COLOR_1555(color[3], color[0], color[1], color[2])
-
-#define WRITE_RGBA( _x, _y, r, g, b, a ) \
- PUT_VALUE(_x, _y, PACK_COLOR_1555(a, r, g, b)) \
-
-#define WRITE_PIXEL( _x, _y, p ) PUT_VALUE(_x, _y, p)
-
-#define READ_RGBA( rgba, _x, _y ) \
- do { \
- GLushort p = GET_VALUE(_x, _y); \
- rgba[0] = ((p >> 7) & 0xf8) * 255 / 0xf8; \
- rgba[1] = ((p >> 2) & 0xf8) * 255 / 0xf8; \
- rgba[2] = ((p << 3) & 0xf8) * 255 / 0xf8; \
- rgba[3] = ((p >> 15) & 0x1) * 0xff; \
- } while (0)
-
-#elif (SPANTMP_PIXEL_FMT == GL_BGRA) && (SPANTMP_PIXEL_TYPE == GL_UNSIGNED_SHORT_1_5_5_5)
-
-/**
- ** GL_BGRA, GL_UNSIGNED_SHORT_1_5_5_5
- **/
-
-#ifndef GET_VALUE
-#ifndef GET_PTR
-#define GET_PTR(_x, _y) (buf + (_x) * 2 + (_y) * pitch)
-#endif
-
-#define GET_VALUE(_x, _y) *(volatile GLushort *)(GET_PTR(_x, _y))
-#define PUT_VALUE(_x, _y, _v) *(volatile GLushort *)(GET_PTR(_x, _y)) = (_v)
-#endif /* GET_VALUE */
-
-#define INIT_MONO_PIXEL(p, color) \
- p = PACK_COLOR_1555_REV(color[3], color[0], color[1], color[2])
-
-#define WRITE_RGBA( _x, _y, r, g, b, a ) \
- PUT_VALUE(_x, _y, PACK_COLOR_1555_REV(a, r, g, b)) \
-
-#define WRITE_PIXEL( _x, _y, p ) PUT_VALUE(_x, _y, p)
-
-#define READ_RGBA( rgba, _x, _y ) \
- do { \
- GLushort p = GET_VALUE(_x, _y); \
- p = p << 8 | p >> 8; \
- rgba[0] = ((p >> 7) & 0xf8) * 255 / 0xf8; \
- rgba[1] = ((p >> 2) & 0xf8) * 255 / 0xf8; \
- rgba[2] = ((p << 3) & 0xf8) * 255 / 0xf8; \
- rgba[3] = ((p >> 15) & 0x1) * 0xff; \
- } while (0)
-
-#elif (SPANTMP_PIXEL_FMT == GL_BGRA) && (SPANTMP_PIXEL_TYPE == GL_UNSIGNED_INT_8_8_8_8_REV)
-
-/**
- ** GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV
- **/
-
-#ifndef GET_VALUE
-#ifndef GET_PTR
-#define GET_PTR(_x, _y) ( buf + (_x) * 4 + (_y) * pitch)
-#endif
-
-#define GET_VALUE(_x, _y) *(volatile GLuint *)(GET_PTR(_x, _y))
-#define PUT_VALUE(_x, _y, _v) *(volatile GLuint *)(GET_PTR(_x, _y)) = (_v)
-#endif /* GET_VALUE */
-
-# define INIT_MONO_PIXEL(p, color) \
- p = PACK_COLOR_8888(color[3], color[0], color[1], color[2])
-
-# define WRITE_RGBA(_x, _y, r, g, b, a) \
- PUT_VALUE(_x, _y, ((r << 16) | \
- (g << 8) | \
- (b << 0) | \
- (a << 24)))
-
-#define WRITE_PIXEL(_x, _y, p) PUT_VALUE(_x, _y, p)
-
-# if defined( USE_X86_ASM )
-# define READ_RGBA(rgba, _x, _y) \
- do { \
- GLuint p = GET_VALUE(_x, _y); \
- __asm__ __volatile__( "bswap %0; rorl $8, %0" \
- : "=r" (p) : "0" (p) ); \
- ((GLuint *)rgba)[0] = p; \
- } while (0)
-# elif defined( MESA_BIG_ENDIAN )
- /* On PowerPC with GCC 3.4.2 the shift madness below becomes a single
- * rotlwi instruction. It also produces good code on SPARC.
- */
-# define READ_RGBA( rgba, _x, _y ) \
- do { \
- GLuint p = GET_VALUE(_x, _y); \
- GLuint t = p; \
- *((uint32_t *) rgba) = (t >> 24) | (p << 8); \
- } while (0)
-# else
-# define READ_RGBA( rgba, _x, _y ) \
- do { \
- GLuint p = GET_VALUE(_x, _y); \
- rgba[0] = (p >> 16) & 0xff; \
- rgba[1] = (p >> 8) & 0xff; \
- rgba[2] = (p >> 0) & 0xff; \
- rgba[3] = (p >> 24) & 0xff; \
- } while (0)
-# endif
-
-#elif (SPANTMP_PIXEL_FMT == GL_BGRA) && (SPANTMP_PIXEL_TYPE == GL_UNSIGNED_INT_8_8_8_8)
-
-/**
- ** GL_BGRA, GL_UNSIGNED_INT_8_8_8_8
- **/
-
-#ifndef GET_VALUE
-#ifndef GET_PTR
-#define GET_PTR(_x, _y) ( buf + (_x) * 4 + (_y) * pitch)
-#endif
-
-#define GET_VALUE(_x, _y) *(volatile GLuint *)(GET_PTR(_x, _y))
-#define PUT_VALUE(_x, _y, _v) *(volatile GLuint *)(GET_PTR(_x, _y)) = (_v)
-#endif /* GET_VALUE */
-
-# define INIT_MONO_PIXEL(p, color) \
- p = PACK_COLOR_8888(color[2], color[1], color[0], color[3])
-
-# define WRITE_RGBA(_x, _y, r, g, b, a) \
- PUT_VALUE(_x, _y, ((r << 8) | \
- (g << 16) | \
- (b << 24) | \
- (a << 0)))
-
-#define WRITE_PIXEL(_x, _y, p) PUT_VALUE(_x, _y, p)
-
-# if defined( USE_X86_ASM )
-# define READ_RGBA(rgba, _x, _y) \
- do { \
- GLuint p = GET_VALUE(_x, _y); \
- __asm__ __volatile__( "rorl $8, %0" \
- : "=r" (p) : "0" (p) ); \
- ((GLuint *)rgba)[0] = p; \
- } while (0)
-# elif defined( MESA_BIG_ENDIAN )
- /* On PowerPC with GCC 3.4.2 the shift madness below becomes a single
- * rotlwi instruction. It also produces good code on SPARC.
- */
-# define READ_RGBA( rgba, _x, _y ) \
- do { \
- GLuint p = CPU_TO_LE32(GET_VALUE(_x, _y)); \
- GLuint t = p; \
- *((uint32_t *) rgba) = (t >> 24) | (p << 8); \
- } while (0)
-# else
-# define READ_RGBA( rgba, _x, _y ) \
- do { \
- GLuint p = GET_VALUE(_x, _y); \
- rgba[0] = (p >> 8) & 0xff; \
- rgba[1] = (p >> 16) & 0xff; \
- rgba[2] = (p >> 24) & 0xff; \
- rgba[3] = (p >> 0) & 0xff; \
- } while (0)
-# endif
-
-#elif (SPANTMP_PIXEL_FMT == GL_BGR) && (SPANTMP_PIXEL_TYPE == GL_UNSIGNED_INT_8_8_8_8_REV)
-
-/**
- ** GL_BGR, GL_UNSIGNED_INT_8_8_8_8_REV
- **
- ** This is really for MESA_FORMAT_XRGB8888. The spantmp code needs to be
- ** kicked to the curb, and we need to just code-gen this.
- **/
-
-#ifndef GET_VALUE
-#ifndef GET_PTR
-#define GET_PTR(_x, _y) ( buf + (_x) * 4 + (_y) * pitch)
-#endif
-
-#define GET_VALUE(_x, _y) *(volatile GLuint *)(GET_PTR(_x, _y))
-#define PUT_VALUE(_x, _y, _v) *(volatile GLuint *)(GET_PTR(_x, _y)) = (_v)
-#endif /* GET_VALUE */
-
-# define INIT_MONO_PIXEL(p, color) \
- p = PACK_COLOR_8888(0xff, color[0], color[1], color[2])
-
-# define WRITE_RGBA(_x, _y, r, g, b, a) \
- PUT_VALUE(_x, _y, ((r << 16) | \
- (g << 8) | \
- (b << 0) | \
- (0xff << 24)))
-
-#define WRITE_PIXEL(_x, _y, p) PUT_VALUE(_x, _y, p)
-
-# if defined( USE_X86_ASM )
-# define READ_RGBA(rgba, _x, _y) \
- do { \
- GLuint p = GET_VALUE(_x, _y); \
- __asm__ __volatile__( "bswap %0; rorl $8, %0" \
- : "=r" (p) : "0" (p) ); \
- ((GLuint *)rgba)[0] = p | 0xff000000; \
- } while (0)
-# elif defined( MESA_BIG_ENDIAN )
- /* On PowerPC with GCC 3.4.2 the shift madness below becomes a single
- * rotlwi instruction. It also produces good code on SPARC.
- */
-# define READ_RGBA( rgba, _x, _y ) \
- do { \
- GLuint p = GET_VALUE(_x, _y); \
- *((uint32_t *) rgba) = (p << 8) | 0xff; \
- } while (0)
-# else
-# define READ_RGBA( rgba, _x, _y ) \
- do { \
- GLuint p = GET_VALUE(_x, _y); \
- rgba[0] = (p >> 16) & 0xff; \
- rgba[1] = (p >> 8) & 0xff; \
- rgba[2] = (p >> 0) & 0xff; \
- rgba[3] = 0xff; \
- } while (0)
-# endif
-
-#elif (SPANTMP_PIXEL_FMT == GL_ALPHA) && (SPANTMP_PIXEL_TYPE == GL_UNSIGNED_BYTE)
-
-/**
- ** GL_ALPHA, GL_UNSIGNED_BYTE
- **/
-
-#ifndef GET_VALUE
-#ifndef GET_PTR
-#define GET_PTR(_x, _y) ( buf + (_x) + (_y) * pitch)
-#endif
-
-#define GET_VALUE(_x, _y) *(volatile GLubyte *)(GET_PTR(_x, _y))
-#define PUT_VALUE(_x, _y, _v) *(volatile GLubyte *)(GET_PTR(_x, _y)) = (_v)
-#endif /* GET_VALUE */
-
-# define INIT_MONO_PIXEL(p, color) \
- p = color[3]
-
-# define WRITE_RGBA(_x, _y, r, g, b, a) \
- PUT_VALUE(_x, _y, a | (r & 0 /* quiet warnings */))
-
-#define WRITE_PIXEL(_x, _y, p) PUT_VALUE(_x, _y, p)
-
-#define READ_RGBA( rgba, _x, _y ) \
- do { \
- GLubyte p = GET_VALUE(_x, _y); \
- rgba[0] = 0; \
- rgba[1] = 0; \
- rgba[2] = 0; \
- rgba[3] = p; \
- } while (0)
-
-#else
-#error SPANTMP_PIXEL_FMT must be set to a valid value!
-#endif
-
-
-
-/**
- ** Assembly routines.
- **/
-
-#if defined( USE_MMX_ASM ) || defined( USE_SSE_ASM )
-#include "x86/read_rgba_span_x86.h"
-#include "x86/common_x86_asm.h"
-#endif
-
-static void TAG(WriteRGBASpan)( struct gl_context *ctx,
- struct gl_renderbuffer *rb,
- GLuint n, GLint x, GLint y,
- const void *values, const GLubyte mask[] )
-{
- HW_WRITE_LOCK()
- {
- const GLubyte (*rgba)[4] = (const GLubyte (*)[4]) values;
- GLint x1;
- GLint n1;
- LOCAL_VARS;
-
- y = Y_FLIP(y);
-
- HW_WRITE_CLIPLOOP()
- {
- GLint i = 0;
- CLIPSPAN(x,y,n,x1,n1,i);
-
- if (DBG) fprintf(stderr, "WriteRGBASpan %d..%d (x1 %d)\n",
- (int)i, (int)n1, (int)x1);
-
- if (mask)
- {
- for (;n1>0;i++,x1++,n1--)
- if (mask[i])
- WRITE_RGBA( x1, y,
- rgba[i][0], rgba[i][1],
- rgba[i][2], rgba[i][3] );
- }
- else
- {
- for (;n1>0;i++,x1++,n1--)
- WRITE_RGBA( x1, y,
- rgba[i][0], rgba[i][1],
- rgba[i][2], rgba[i][3] );
- }
- }
- HW_ENDCLIPLOOP();
- }
- HW_WRITE_UNLOCK();
-}
-
-static void TAG(WriteRGBSpan)( struct gl_context *ctx,
- struct gl_renderbuffer *rb,
- GLuint n, GLint x, GLint y,
- const void *values, const GLubyte mask[] )
-{
- HW_WRITE_LOCK()
- {
- const GLubyte (*rgb)[3] = (const GLubyte (*)[3]) values;
- GLint x1;
- GLint n1;
- LOCAL_VARS;
-
- y = Y_FLIP(y);
-
- HW_WRITE_CLIPLOOP()
- {
- GLint i = 0;
- CLIPSPAN(x,y,n,x1,n1,i);
-
- if (DBG) fprintf(stderr, "WriteRGBSpan %d..%d (x1 %d)\n",
- (int)i, (int)n1, (int)x1);
-
- if (mask)
- {
- for (;n1>0;i++,x1++,n1--)
- if (mask[i])
- WRITE_RGBA( x1, y, rgb[i][0], rgb[i][1], rgb[i][2], 255 );
- }
- else
- {
- for (;n1>0;i++,x1++,n1--)
- WRITE_RGBA( x1, y, rgb[i][0], rgb[i][1], rgb[i][2], 255 );
- }
- }
- HW_ENDCLIPLOOP();
- }
- HW_WRITE_UNLOCK();
-}
-
-static void TAG(WriteRGBAPixels)( struct gl_context *ctx,
- struct gl_renderbuffer *rb,
- GLuint n, const GLint x[], const GLint y[],
- const void *values, const GLubyte mask[] )
-{
- HW_WRITE_LOCK()
- {
- const GLubyte (*rgba)[4] = (const GLubyte (*)[4]) values;
- GLint i;
- LOCAL_VARS;
-
- if (DBG) fprintf(stderr, "WriteRGBAPixels\n");
-
- HW_WRITE_CLIPLOOP()
- {
- if (mask)
- {
- for (i=0;i<n;i++)
- {
- if (mask[i]) {
- const int fy = Y_FLIP(y[i]);
- if (CLIPPIXEL(x[i],fy))
- WRITE_RGBA( x[i], fy,
- rgba[i][0], rgba[i][1],
- rgba[i][2], rgba[i][3] );
- }
- }
- }
- else
- {
- for (i=0;i<n;i++)
- {
- const int fy = Y_FLIP(y[i]);
- if (CLIPPIXEL(x[i],fy))
- WRITE_RGBA( x[i], fy,
- rgba[i][0], rgba[i][1],
- rgba[i][2], rgba[i][3] );
- }
- }
- }
- HW_ENDCLIPLOOP();
- }
- HW_WRITE_UNLOCK();
-}
-
-
-static void TAG(WriteMonoRGBASpan)( struct gl_context *ctx,
- struct gl_renderbuffer *rb,
- GLuint n, GLint x, GLint y,
- const void *value, const GLubyte mask[] )
-{
- HW_WRITE_LOCK()
- {
- const GLubyte *color = (const GLubyte *) value;
- GLint x1;
- GLint n1;
- LOCAL_VARS;
- INIT_MONO_PIXEL(p, color);
-
- y = Y_FLIP( y );
-
- if (DBG) fprintf(stderr, "WriteMonoRGBASpan\n");
-
- HW_WRITE_CLIPLOOP()
- {
- GLint i = 0;
- CLIPSPAN(x,y,n,x1,n1,i);
- if (mask)
- {
- for (;n1>0;i++,x1++,n1--)
- if (mask[i])
- WRITE_PIXEL( x1, y, p );
- }
- else
- {
- for (;n1>0;i++,x1++,n1--)
- WRITE_PIXEL( x1, y, p );
- }
- }
- HW_ENDCLIPLOOP();
- }
- HW_WRITE_UNLOCK();
-}
-
-
-static void TAG(WriteMonoRGBAPixels)( struct gl_context *ctx,
- struct gl_renderbuffer *rb,
- GLuint n,
- const GLint x[], const GLint y[],
- const void *value,
- const GLubyte mask[] )
-{
- HW_WRITE_LOCK()
- {
- const GLubyte *color = (const GLubyte *) value;
- GLint i;
- LOCAL_VARS;
- INIT_MONO_PIXEL(p, color);
-
- if (DBG) fprintf(stderr, "WriteMonoRGBAPixels\n");
-
- HW_WRITE_CLIPLOOP()
- {
- if (mask)
- {
- for (i=0;i<n;i++)
- if (mask[i]) {
- int fy = Y_FLIP(y[i]);
- if (CLIPPIXEL( x[i], fy ))
- WRITE_PIXEL( x[i], fy, p );
- }
- }
- else
- {
- for (i=0;i<n;i++) {
- int fy = Y_FLIP(y[i]);
- if (CLIPPIXEL( x[i], fy ))
- WRITE_PIXEL( x[i], fy, p );
- }
- }
- }
- HW_ENDCLIPLOOP();
- }
- HW_WRITE_UNLOCK();
-}
-
-
-static void TAG(ReadRGBASpan)( struct gl_context *ctx,
- struct gl_renderbuffer *rb,
- GLuint n, GLint x, GLint y, void *values)
-{
- HW_READ_LOCK()
- {
- GLubyte (*rgba)[4] = (GLubyte (*)[4]) values;
- GLint x1,n1;
- LOCAL_VARS;
-
- y = Y_FLIP(y);
-
- if (DBG) fprintf(stderr, "ReadRGBASpan\n");
-
- HW_READ_CLIPLOOP()
- {
- GLint i = 0;
- CLIPSPAN(x,y,n,x1,n1,i);
- for (;n1>0;i++,x1++,n1--)
- READ_RGBA( rgba[i], x1, y );
- }
- HW_ENDCLIPLOOP();
- }
- HW_READ_UNLOCK();
-}
-
-
-#if defined(GET_PTR) && \
- defined(USE_MMX_ASM) && \
- (((SPANTMP_PIXEL_FMT == GL_BGRA) && \
- (SPANTMP_PIXEL_TYPE == GL_UNSIGNED_INT_8_8_8_8_REV)) || \
- ((SPANTMP_PIXEL_FMT == GL_RGB) && \
- (SPANTMP_PIXEL_TYPE == GL_UNSIGNED_SHORT_5_6_5)))
-static void TAG2(ReadRGBASpan,_MMX)( struct gl_context *ctx,
- struct gl_renderbuffer *rb,
- GLuint n, GLint x, GLint y, void *values)
-{
-#ifndef USE_INNER_EMMS
- /* The EMMS instruction is directly in-lined here because using GCC's
- * built-in _mm_empty function was found to utterly destroy performance.
- */
- __asm__ __volatile__( "emms" );
-#endif
-
- HW_READ_LOCK()
- {
- GLubyte (*rgba)[4] = (GLubyte (*)[4]) values;
- GLint x1,n1;
- LOCAL_VARS;
-
- y = Y_FLIP(y);
-
- if (DBG) fprintf(stderr, "ReadRGBASpan\n");
-
- HW_READ_CLIPLOOP()
- {
- GLint i = 0;
- CLIPSPAN(x,y,n,x1,n1,i);
-
- {
- const void * src = GET_PTR( x1, y );
-#if (SPANTMP_PIXEL_FMT == GL_RGB) && \
- (SPANTMP_PIXEL_TYPE == GL_UNSIGNED_SHORT_5_6_5)
- _generic_read_RGBA_span_RGB565_MMX( src, rgba[i], n1 );
-#else
- _generic_read_RGBA_span_BGRA8888_REV_MMX( src, rgba[i], n1 );
-#endif
- }
- }
- HW_ENDCLIPLOOP();
- }
- HW_READ_UNLOCK();
-#ifndef USE_INNER_EMMS
- __asm__ __volatile__( "emms" );
-#endif
-}
-#endif
-
-
-#if defined(GET_PTR) && \
- defined(USE_SSE_ASM) && \
- (SPANTMP_PIXEL_FMT == GL_BGRA) && \
- (SPANTMP_PIXEL_TYPE == GL_UNSIGNED_INT_8_8_8_8_REV)
-static void TAG2(ReadRGBASpan,_SSE2)( struct gl_context *ctx,
- struct gl_renderbuffer *rb,
- GLuint n, GLint x, GLint y,
- void *values)
-{
- HW_READ_LOCK()
- {
- GLubyte (*rgba)[4] = (GLubyte (*)[4]) values;
- GLint x1,n1;
- LOCAL_VARS;
-
- y = Y_FLIP(y);
-
- if (DBG) fprintf(stderr, "ReadRGBASpan\n");
-
- HW_READ_CLIPLOOP()
- {
- GLint i = 0;
- CLIPSPAN(x,y,n,x1,n1,i);
-
- {
- const void * src = GET_PTR( x1, y );
- _generic_read_RGBA_span_BGRA8888_REV_SSE2( src, rgba[i], n1 );
- }
- }
- HW_ENDCLIPLOOP();
- }
- HW_READ_UNLOCK();
-}
-#endif
-
-#if defined(GET_PTR) && \
- defined(USE_SSE_ASM) && \
- (SPANTMP_PIXEL_FMT == GL_BGRA) && \
- (SPANTMP_PIXEL_TYPE == GL_UNSIGNED_INT_8_8_8_8_REV)
-static void TAG2(ReadRGBASpan,_SSE)( struct gl_context *ctx,
- struct gl_renderbuffer *rb,
- GLuint n, GLint x, GLint y,
- void *values)
-{
-#ifndef USE_INNER_EMMS
- /* The EMMS instruction is directly in-lined here because using GCC's
- * built-in _mm_empty function was found to utterly destroy performance.
- */
- __asm__ __volatile__( "emms" );
-#endif
-
- HW_READ_LOCK()
- {
- GLubyte (*rgba)[4] = (GLubyte (*)[4]) values;
- GLint x1,n1;
- LOCAL_VARS;
-
- y = Y_FLIP(y);
-
- if (DBG) fprintf(stderr, "ReadRGBASpan\n");
-
- HW_READ_CLIPLOOP()
- {
- GLint i = 0;
- CLIPSPAN(x,y,n,x1,n1,i);
-
- {
- const void * src = GET_PTR( x1, y );
- _generic_read_RGBA_span_BGRA8888_REV_SSE( src, rgba[i], n1 );
- }
- }
- HW_ENDCLIPLOOP();
- }
- HW_READ_UNLOCK();
-#ifndef USE_INNER_EMMS
- __asm__ __volatile__( "emms" );
-#endif
-}
-#endif
-
-
-static void TAG(ReadRGBAPixels)( struct gl_context *ctx,
- struct gl_renderbuffer *rb,
- GLuint n, const GLint x[], const GLint y[],
- void *values )
-{
- HW_READ_LOCK()
- {
- GLubyte (*rgba)[4] = (GLubyte (*)[4]) values;
- GLint i;
- LOCAL_VARS;
-
- if (DBG) fprintf(stderr, "ReadRGBAPixels\n");
-
- HW_READ_CLIPLOOP()
- {
- for (i=0;i<n;i++) {
- int fy = Y_FLIP( y[i] );
- if (CLIPPIXEL( x[i], fy ))
- READ_RGBA( rgba[i], x[i], fy );
- }
- }
- HW_ENDCLIPLOOP();
- }
- HW_READ_UNLOCK();
-}
-
-static void TAG(InitPointers)(struct gl_renderbuffer *rb)
-{
- rb->PutRow = TAG(WriteRGBASpan);
- rb->PutRowRGB = TAG(WriteRGBSpan);
- rb->PutMonoRow = TAG(WriteMonoRGBASpan);
- rb->PutValues = TAG(WriteRGBAPixels);
- rb->PutMonoValues = TAG(WriteMonoRGBAPixels);
- rb->GetValues = TAG(ReadRGBAPixels);
-
-#if defined(GET_PTR)
-#if defined(USE_SSE_ASM) && \
- (SPANTMP_PIXEL_FMT == GL_BGRA) && \
- (SPANTMP_PIXEL_TYPE == GL_UNSIGNED_INT_8_8_8_8_REV)
- if ( cpu_has_xmm2 ) {
- if (DBG) fprintf( stderr, "Using %s version of GetRow\n", "SSE2" );
- rb->GetRow = TAG2(ReadRGBASpan, _SSE2);
- }
- else
-#endif
-#if defined(USE_SSE_ASM) && \
- (SPANTMP_PIXEL_FMT == GL_BGRA) && \
- (SPANTMP_PIXEL_TYPE == GL_UNSIGNED_INT_8_8_8_8_REV)
- if ( cpu_has_xmm ) {
- if (DBG) fprintf( stderr, "Using %s version of GetRow\n", "SSE" );
- rb->GetRow = TAG2(ReadRGBASpan, _SSE);
- }
- else
-#endif
-#if defined(USE_MMX_ASM) && \
- (((SPANTMP_PIXEL_FMT == GL_BGRA) && \
- (SPANTMP_PIXEL_TYPE == GL_UNSIGNED_INT_8_8_8_8_REV)) || \
- ((SPANTMP_PIXEL_FMT == GL_RGB) && \
- (SPANTMP_PIXEL_TYPE == GL_UNSIGNED_SHORT_5_6_5)))
- if ( cpu_has_mmx ) {
- if (DBG) fprintf( stderr, "Using %s version of GetRow\n", "MMX" );
- rb->GetRow = TAG2(ReadRGBASpan, _MMX);
- }
- else
-#endif
-#endif /* GET_PTR */
- {
- if (DBG) fprintf( stderr, "Using %s version of GetRow\n", "C" );
- rb->GetRow = TAG(ReadRGBASpan);
- }
-
-}
-
-
-#undef INIT_MONO_PIXEL
-#undef WRITE_PIXEL
-#undef WRITE_RGBA
-#undef READ_RGBA
-#undef TAG
-#undef TAG2
-#undef GET_VALUE
-#undef PUT_VALUE
-#undef GET_PTR
-#undef SPANTMP_PIXEL_FMT
-#undef SPANTMP_PIXEL_TYPE
+/*
+ * Copyright 2000-2001 VA Linux Systems, Inc.
+ * (C) Copyright IBM Corporation 2004
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * on the rights to use, copy, modify, merge, publish, distribute, sub
+ * license, and/or sell copies of the Software, and to permit persons to whom
+ * the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
+ * VA LINUX SYSTEM, IBM AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+ * USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+/**
+ * \file spantmp2.h
+ *
+ * Template file of span read / write functions.
+ *
+ * \author Keith Whitwell <keithw@tungstengraphics.com>
+ * \author Gareth Hughes <gareth@nvidia.com>
+ * \author Ian Romanick <idr@us.ibm.com>
+ */
+
+#include "main/colormac.h"
+#include "spantmp_common.h"
+
+#ifndef DBG
+#define DBG 0
+#endif
+
+#ifndef HW_READ_CLIPLOOP
+#define HW_READ_CLIPLOOP() HW_CLIPLOOP()
+#endif
+
+#ifndef HW_WRITE_CLIPLOOP
+#define HW_WRITE_CLIPLOOP() HW_CLIPLOOP()
+#endif
+
+#if (SPANTMP_PIXEL_FMT == GL_RGB) && (SPANTMP_PIXEL_TYPE == GL_UNSIGNED_SHORT_5_6_5)
+
+/**
+ ** GL_RGB, GL_UNSIGNED_SHORT_5_6_5
+ **/
+
+#ifndef GET_VALUE
+#ifndef GET_PTR
+#define GET_PTR(_x, _y) (buf + (_x) * 2 + (_y) * pitch)
+#endif
+
+#define GET_VALUE(_x, _y) *(volatile GLushort *)(GET_PTR(_x, _y))
+#define PUT_VALUE(_x, _y, _v) *(volatile GLushort *)(GET_PTR(_x, _y)) = (_v)
+#endif /* GET_VALUE */
+
+#define INIT_MONO_PIXEL(p, color) \
+ p = PACK_COLOR_565( color[0], color[1], color[2] )
+
+#define WRITE_RGBA( _x, _y, r, g, b, a ) \
+ PUT_VALUE(_x, _y, ((((int)r & 0xf8) << 8) | \
+ (((int)g & 0xfc) << 3) | \
+ (((int)b & 0xf8) >> 3))) \
+
+#define WRITE_PIXEL( _x, _y, p ) PUT_VALUE(_x, _y, p)
+
+#define READ_RGBA( rgba, _x, _y ) \
+ do { \
+ GLushort p = GET_VALUE(_x, _y); \
+ rgba[0] = ((p >> 8) & 0xf8) * 255 / 0xf8; \
+ rgba[1] = ((p >> 3) & 0xfc) * 255 / 0xfc; \
+ rgba[2] = ((p << 3) & 0xf8) * 255 / 0xf8; \
+ rgba[3] = 0xff; \
+ } while (0)
+
+#elif (SPANTMP_PIXEL_FMT == GL_RGB) && (SPANTMP_PIXEL_TYPE == GL_UNSIGNED_SHORT_5_6_5_REV)
+
+/**
+ ** GL_RGB, GL_UNSIGNED_SHORT_5_6_5_REV
+ **/
+
+#ifndef GET_VALUE
+#ifndef GET_PTR
+#define GET_PTR(_x, _y) (buf + (_x) * 2 + (_y) * pitch)
+#endif
+
+#define GET_VALUE(_x, _y) *(volatile GLushort *)(GET_PTR(_x, _y))
+#define PUT_VALUE(_x, _y, _v) *(volatile GLushort *)(GET_PTR(_x, _y)) = (_v)
+#endif /* GET_VALUE */
+
+#define INIT_MONO_PIXEL(p, color) \
+ p = PACK_COLOR_565_REV( color[0], color[1], color[2] )
+
+#define WRITE_RGBA( _x, _y, r, g, b, a ) \
+ PUT_VALUE(_x, _y, PACK_COLOR_565_REV( r, g, b ))
+
+#define WRITE_PIXEL( _x, _y, p ) PUT_VALUE(_x, _y, p)
+
+#define READ_RGBA( rgba, _x, _y ) \
+ do { \
+ GLushort p = GET_VALUE(_x, _y); \
+ p = p << 8 | p >> 8; \
+ rgba[0] = ((p >> 8) & 0xf8) * 255 / 0xf8; \
+ rgba[1] = ((p >> 3) & 0xfc) * 255 / 0xfc; \
+ rgba[2] = ((p << 3) & 0xf8) * 255 / 0xf8; \
+ rgba[3] = 0xff; \
+ } while (0)
+
+#elif (SPANTMP_PIXEL_FMT == GL_BGRA) && (SPANTMP_PIXEL_TYPE == GL_UNSIGNED_SHORT_4_4_4_4)
+
+/**
+ ** GL_BGRA, GL_UNSIGNED_SHORT_4_4_4_4
+ **/
+
+#ifndef GET_VALUE
+#ifndef GET_PTR
+#define GET_PTR(_x, _y) (buf + (_x) * 2 + (_y) * pitch)
+#endif
+
+#define GET_VALUE(_x, _y) *(volatile GLushort *)(GET_PTR(_x, _y))
+#define PUT_VALUE(_x, _y, _v) *(volatile GLushort *)(GET_PTR(_x, _y)) = (_v)
+#endif /* GET_VALUE */
+
+#define INIT_MONO_PIXEL(p, color) \
+ p = PACK_COLOR_4444_REV(color[3], color[0], color[1], color[2])
+
+#define WRITE_RGBA( _x, _y, r, g, b, a ) \
+ PUT_VALUE(_x, _y, PACK_COLOR_4444_REV(a, r, g, b)) \
+
+#define WRITE_PIXEL( _x, _y, p ) PUT_VALUE(_x, _y, p)
+
+#define READ_RGBA( rgba, _x, _y ) \
+ do { \
+ GLushort p = GET_VALUE(_x, _y); \
+ rgba[0] = ((p >> 0) & 0xf) * 0x11; \
+ rgba[1] = ((p >> 12) & 0xf) * 0x11; \
+ rgba[2] = ((p >> 4) & 0xf) * 0x11; \
+ rgba[3] = ((p >> 8) & 0xf) * 0x11; \
+ } while (0)
+
+
+#elif (SPANTMP_PIXEL_FMT == GL_BGRA) && (SPANTMP_PIXEL_TYPE == GL_UNSIGNED_SHORT_4_4_4_4_REV)
+
+/**
+ ** GL_BGRA, GL_UNSIGNED_SHORT_4_4_4_4_REV
+ **/
+
+#ifndef GET_VALUE
+#ifndef GET_PTR
+#define GET_PTR(_x, _y) (buf + (_x) * 2 + (_y) * pitch)
+#endif
+
+#define GET_VALUE(_x, _y) *(volatile GLushort *)(GET_PTR(_x, _y))
+#define PUT_VALUE(_x, _y, _v) *(volatile GLushort *)(GET_PTR(_x, _y)) = (_v)
+#endif /* GET_VALUE */
+
+#define INIT_MONO_PIXEL(p, color) \
+ p = PACK_COLOR_4444(color[3], color[0], color[1], color[2])
+
+#define WRITE_RGBA( _x, _y, r, g, b, a ) \
+ PUT_VALUE(_x, _y, PACK_COLOR_4444(a, r, g, b)) \
+
+#define WRITE_PIXEL( _x, _y, p ) PUT_VALUE(_x, _y, p)
+
+#define READ_RGBA( rgba, _x, _y ) \
+ do { \
+ GLushort p = GET_VALUE(_x, _y); \
+ rgba[0] = ((p >> 8) & 0xf) * 0x11; \
+ rgba[1] = ((p >> 4) & 0xf) * 0x11; \
+ rgba[2] = ((p >> 0) & 0xf) * 0x11; \
+ rgba[3] = ((p >> 12) & 0xf) * 0x11; \
+ } while (0)
+
+
+#elif (SPANTMP_PIXEL_FMT == GL_BGRA) && (SPANTMP_PIXEL_TYPE == GL_UNSIGNED_SHORT_1_5_5_5_REV)
+
+/**
+ ** GL_BGRA, GL_UNSIGNED_SHORT_1_5_5_5_REV
+ **/
+
+#ifndef GET_VALUE
+#ifndef GET_PTR
+#define GET_PTR(_x, _y) (buf + (_x) * 2 + (_y) * pitch)
+#endif
+
+#define GET_VALUE(_x, _y) *(volatile GLushort *)(GET_PTR(_x, _y))
+#define PUT_VALUE(_x, _y, _v) *(volatile GLushort *)(GET_PTR(_x, _y)) = (_v)
+#endif /* GET_VALUE */
+
+#define INIT_MONO_PIXEL(p, color) \
+ p = PACK_COLOR_1555(color[3], color[0], color[1], color[2])
+
+#define WRITE_RGBA( _x, _y, r, g, b, a ) \
+ PUT_VALUE(_x, _y, PACK_COLOR_1555(a, r, g, b)) \
+
+#define WRITE_PIXEL( _x, _y, p ) PUT_VALUE(_x, _y, p)
+
+#define READ_RGBA( rgba, _x, _y ) \
+ do { \
+ GLushort p = GET_VALUE(_x, _y); \
+ rgba[0] = ((p >> 7) & 0xf8) * 255 / 0xf8; \
+ rgba[1] = ((p >> 2) & 0xf8) * 255 / 0xf8; \
+ rgba[2] = ((p << 3) & 0xf8) * 255 / 0xf8; \
+ rgba[3] = ((p >> 15) & 0x1) * 0xff; \
+ } while (0)
+
+#elif (SPANTMP_PIXEL_FMT == GL_BGRA) && (SPANTMP_PIXEL_TYPE == GL_UNSIGNED_SHORT_1_5_5_5)
+
+/**
+ ** GL_BGRA, GL_UNSIGNED_SHORT_1_5_5_5
+ **/
+
+#ifndef GET_VALUE
+#ifndef GET_PTR
+#define GET_PTR(_x, _y) (buf + (_x) * 2 + (_y) * pitch)
+#endif
+
+#define GET_VALUE(_x, _y) *(volatile GLushort *)(GET_PTR(_x, _y))
+#define PUT_VALUE(_x, _y, _v) *(volatile GLushort *)(GET_PTR(_x, _y)) = (_v)
+#endif /* GET_VALUE */
+
+#define INIT_MONO_PIXEL(p, color) \
+ p = PACK_COLOR_1555_REV(color[3], color[0], color[1], color[2])
+
+#define WRITE_RGBA( _x, _y, r, g, b, a ) \
+ PUT_VALUE(_x, _y, PACK_COLOR_1555_REV(a, r, g, b)) \
+
+#define WRITE_PIXEL( _x, _y, p ) PUT_VALUE(_x, _y, p)
+
+#define READ_RGBA( rgba, _x, _y ) \
+ do { \
+ GLushort p = GET_VALUE(_x, _y); \
+ p = p << 8 | p >> 8; \
+ rgba[0] = ((p >> 7) & 0xf8) * 255 / 0xf8; \
+ rgba[1] = ((p >> 2) & 0xf8) * 255 / 0xf8; \
+ rgba[2] = ((p << 3) & 0xf8) * 255 / 0xf8; \
+ rgba[3] = ((p >> 15) & 0x1) * 0xff; \
+ } while (0)
+
+#elif (SPANTMP_PIXEL_FMT == GL_BGRA) && (SPANTMP_PIXEL_TYPE == GL_UNSIGNED_INT_8_8_8_8_REV)
+
+/**
+ ** GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV
+ **/
+
+#ifndef GET_VALUE
+#ifndef GET_PTR
+#define GET_PTR(_x, _y) ( buf + (_x) * 4 + (_y) * pitch)
+#endif
+
+#define GET_VALUE(_x, _y) *(volatile GLuint *)(GET_PTR(_x, _y))
+#define PUT_VALUE(_x, _y, _v) *(volatile GLuint *)(GET_PTR(_x, _y)) = (_v)
+#endif /* GET_VALUE */
+
+# define INIT_MONO_PIXEL(p, color) \
+ p = PACK_COLOR_8888(color[3], color[0], color[1], color[2])
+
+# define WRITE_RGBA(_x, _y, r, g, b, a) \
+ PUT_VALUE(_x, _y, ((r << 16) | \
+ (g << 8) | \
+ (b << 0) | \
+ (a << 24)))
+
+#define WRITE_PIXEL(_x, _y, p) PUT_VALUE(_x, _y, p)
+
+# if defined( USE_X86_ASM )
+# define READ_RGBA(rgba, _x, _y) \
+ do { \
+ GLuint p = GET_VALUE(_x, _y); \
+ __asm__ __volatile__( "bswap %0; rorl $8, %0" \
+ : "=r" (p) : "0" (p) ); \
+ ((GLuint *)rgba)[0] = p; \
+ } while (0)
+# elif defined( MESA_BIG_ENDIAN )
+ /* On PowerPC with GCC 3.4.2 the shift madness below becomes a single
+ * rotlwi instruction. It also produces good code on SPARC.
+ */
+# define READ_RGBA( rgba, _x, _y ) \
+ do { \
+ GLuint p = GET_VALUE(_x, _y); \
+ GLuint t = p; \
+ *((uint32_t *) rgba) = (t >> 24) | (p << 8); \
+ } while (0)
+# else
+# define READ_RGBA( rgba, _x, _y ) \
+ do { \
+ GLuint p = GET_VALUE(_x, _y); \
+ rgba[0] = (p >> 16) & 0xff; \
+ rgba[1] = (p >> 8) & 0xff; \
+ rgba[2] = (p >> 0) & 0xff; \
+ rgba[3] = (p >> 24) & 0xff; \
+ } while (0)
+# endif
+
+#elif (SPANTMP_PIXEL_FMT == GL_BGRA) && (SPANTMP_PIXEL_TYPE == GL_UNSIGNED_INT_8_8_8_8)
+
+/**
+ ** GL_BGRA, GL_UNSIGNED_INT_8_8_8_8
+ **/
+
+#ifndef GET_VALUE
+#ifndef GET_PTR
+#define GET_PTR(_x, _y) ( buf + (_x) * 4 + (_y) * pitch)
+#endif
+
+#define GET_VALUE(_x, _y) *(volatile GLuint *)(GET_PTR(_x, _y))
+#define PUT_VALUE(_x, _y, _v) *(volatile GLuint *)(GET_PTR(_x, _y)) = (_v)
+#endif /* GET_VALUE */
+
+# define INIT_MONO_PIXEL(p, color) \
+ p = PACK_COLOR_8888(color[2], color[1], color[0], color[3])
+
+# define WRITE_RGBA(_x, _y, r, g, b, a) \
+ PUT_VALUE(_x, _y, ((r << 8) | \
+ (g << 16) | \
+ (b << 24) | \
+ (a << 0)))
+
+#define WRITE_PIXEL(_x, _y, p) PUT_VALUE(_x, _y, p)
+
+# if defined( USE_X86_ASM )
+# define READ_RGBA(rgba, _x, _y) \
+ do { \
+ GLuint p = GET_VALUE(_x, _y); \
+ __asm__ __volatile__( "rorl $8, %0" \
+ : "=r" (p) : "0" (p) ); \
+ ((GLuint *)rgba)[0] = p; \
+ } while (0)
+# elif defined( MESA_BIG_ENDIAN )
+ /* On PowerPC with GCC 3.4.2 the shift madness below becomes a single
+ * rotlwi instruction. It also produces good code on SPARC.
+ */
+# define READ_RGBA( rgba, _x, _y ) \
+ do { \
+ GLuint p = CPU_TO_LE32(GET_VALUE(_x, _y)); \
+ GLuint t = p; \
+ *((uint32_t *) rgba) = (t >> 24) | (p << 8); \
+ } while (0)
+# else
+# define READ_RGBA( rgba, _x, _y ) \
+ do { \
+ GLuint p = GET_VALUE(_x, _y); \
+ rgba[0] = (p >> 8) & 0xff; \
+ rgba[1] = (p >> 16) & 0xff; \
+ rgba[2] = (p >> 24) & 0xff; \
+ rgba[3] = (p >> 0) & 0xff; \
+ } while (0)
+# endif
+
+#elif (SPANTMP_PIXEL_FMT == GL_BGR) && (SPANTMP_PIXEL_TYPE == GL_UNSIGNED_INT_8_8_8_8_REV)
+
+/**
+ ** GL_BGR, GL_UNSIGNED_INT_8_8_8_8_REV
+ **
+ ** This is really for MESA_FORMAT_XRGB8888. The spantmp code needs to be
+ ** kicked to the curb, and we need to just code-gen this.
+ **/
+
+#ifndef GET_VALUE
+#ifndef GET_PTR
+#define GET_PTR(_x, _y) ( buf + (_x) * 4 + (_y) * pitch)
+#endif
+
+#define GET_VALUE(_x, _y) *(volatile GLuint *)(GET_PTR(_x, _y))
+#define PUT_VALUE(_x, _y, _v) *(volatile GLuint *)(GET_PTR(_x, _y)) = (_v)
+#endif /* GET_VALUE */
+
+# define INIT_MONO_PIXEL(p, color) \
+ p = PACK_COLOR_8888(0xff, color[0], color[1], color[2])
+
+# define WRITE_RGBA(_x, _y, r, g, b, a) \
+ PUT_VALUE(_x, _y, ((r << 16) | \
+ (g << 8) | \
+ (b << 0) | \
+ (0xff << 24)))
+
+#define WRITE_PIXEL(_x, _y, p) PUT_VALUE(_x, _y, p)
+
+# if defined( USE_X86_ASM )
+# define READ_RGBA(rgba, _x, _y) \
+ do { \
+ GLuint p = GET_VALUE(_x, _y); \
+ __asm__ __volatile__( "bswap %0; rorl $8, %0" \
+ : "=r" (p) : "0" (p) ); \
+ ((GLuint *)rgba)[0] = p | 0xff000000; \
+ } while (0)
+# elif defined( MESA_BIG_ENDIAN )
+ /* On PowerPC with GCC 3.4.2 the shift madness below becomes a single
+ * rotlwi instruction. It also produces good code on SPARC.
+ */
+# define READ_RGBA( rgba, _x, _y ) \
+ do { \
+ GLuint p = GET_VALUE(_x, _y); \
+ *((uint32_t *) rgba) = (p << 8) | 0xff; \
+ } while (0)
+# else
+# define READ_RGBA( rgba, _x, _y ) \
+ do { \
+ GLuint p = GET_VALUE(_x, _y); \
+ rgba[0] = (p >> 16) & 0xff; \
+ rgba[1] = (p >> 8) & 0xff; \
+ rgba[2] = (p >> 0) & 0xff; \
+ rgba[3] = 0xff; \
+ } while (0)
+# endif
+
+#elif (SPANTMP_PIXEL_FMT == GL_ALPHA) && (SPANTMP_PIXEL_TYPE == GL_UNSIGNED_BYTE)
+
+/**
+ ** GL_ALPHA, GL_UNSIGNED_BYTE
+ **/
+
+#ifndef GET_VALUE
+#ifndef GET_PTR
+#define GET_PTR(_x, _y) ( buf + (_x) + (_y) * pitch)
+#endif
+
+#define GET_VALUE(_x, _y) *(volatile GLubyte *)(GET_PTR(_x, _y))
+#define PUT_VALUE(_x, _y, _v) *(volatile GLubyte *)(GET_PTR(_x, _y)) = (_v)
+#endif /* GET_VALUE */
+
+# define INIT_MONO_PIXEL(p, color) \
+ p = color[3]
+
+# define WRITE_RGBA(_x, _y, r, g, b, a) \
+ PUT_VALUE(_x, _y, a | (r & 0 /* quiet warnings */))
+
+#define WRITE_PIXEL(_x, _y, p) PUT_VALUE(_x, _y, p)
+
+#define READ_RGBA( rgba, _x, _y ) \
+ do { \
+ GLubyte p = GET_VALUE(_x, _y); \
+ rgba[0] = 0; \
+ rgba[1] = 0; \
+ rgba[2] = 0; \
+ rgba[3] = p; \
+ } while (0)
+
+#else
+#error SPANTMP_PIXEL_FMT must be set to a valid value!
+#endif
+
+
+
+/**
+ ** Assembly routines.
+ **/
+
+#if defined( USE_MMX_ASM ) || defined( USE_SSE_ASM )
+#include "x86/read_rgba_span_x86.h"
+#include "x86/common_x86_asm.h"
+#endif
+
+static void TAG(WriteRGBASpan)( struct gl_context *ctx,
+ struct gl_renderbuffer *rb,
+ GLuint n, GLint x, GLint y,
+ const void *values, const GLubyte mask[] )
+{
+ HW_WRITE_LOCK()
+ {
+ const GLubyte (*rgba)[4] = (const GLubyte (*)[4]) values;
+ GLint x1;
+ GLint n1;
+ LOCAL_VARS;
+
+ y = Y_FLIP(y);
+
+ HW_WRITE_CLIPLOOP()
+ {
+ GLint i = 0;
+ CLIPSPAN(x,y,n,x1,n1,i);
+
+ if (DBG) fprintf(stderr, "WriteRGBASpan %d..%d (x1 %d)\n",
+ (int)i, (int)n1, (int)x1);
+
+ if (mask)
+ {
+ for (;n1>0;i++,x1++,n1--)
+ if (mask[i])
+ WRITE_RGBA( x1, y,
+ rgba[i][0], rgba[i][1],
+ rgba[i][2], rgba[i][3] );
+ }
+ else
+ {
+ for (;n1>0;i++,x1++,n1--)
+ WRITE_RGBA( x1, y,
+ rgba[i][0], rgba[i][1],
+ rgba[i][2], rgba[i][3] );
+ }
+ }
+ HW_ENDCLIPLOOP();
+ }
+ HW_WRITE_UNLOCK();
+}
+
+static void TAG(WriteRGBSpan)( struct gl_context *ctx,
+ struct gl_renderbuffer *rb,
+ GLuint n, GLint x, GLint y,
+ const void *values, const GLubyte mask[] )
+{
+ HW_WRITE_LOCK()
+ {
+ const GLubyte (*rgb)[3] = (const GLubyte (*)[3]) values;
+ GLint x1;
+ GLint n1;
+ LOCAL_VARS;
+
+ y = Y_FLIP(y);
+
+ HW_WRITE_CLIPLOOP()
+ {
+ GLint i = 0;
+ CLIPSPAN(x,y,n,x1,n1,i);
+
+ if (DBG) fprintf(stderr, "WriteRGBSpan %d..%d (x1 %d)\n",
+ (int)i, (int)n1, (int)x1);
+
+ if (mask)
+ {
+ for (;n1>0;i++,x1++,n1--)
+ if (mask[i])
+ WRITE_RGBA( x1, y, rgb[i][0], rgb[i][1], rgb[i][2], 255 );
+ }
+ else
+ {
+ for (;n1>0;i++,x1++,n1--)
+ WRITE_RGBA( x1, y, rgb[i][0], rgb[i][1], rgb[i][2], 255 );
+ }
+ }
+ HW_ENDCLIPLOOP();
+ }
+ HW_WRITE_UNLOCK();
+}
+
+static void TAG(WriteRGBAPixels)( struct gl_context *ctx,
+ struct gl_renderbuffer *rb,
+ GLuint n, const GLint x[], const GLint y[],
+ const void *values, const GLubyte mask[] )
+{
+ HW_WRITE_LOCK()
+ {
+ const GLubyte (*rgba)[4] = (const GLubyte (*)[4]) values;
+ GLint i;
+ LOCAL_VARS;
+
+ if (DBG) fprintf(stderr, "WriteRGBAPixels\n");
+
+ HW_WRITE_CLIPLOOP()
+ {
+ if (mask)
+ {
+ for (i=0;i<n;i++)
+ {
+ if (mask[i]) {
+ const int fy = Y_FLIP(y[i]);
+ if (CLIPPIXEL(x[i],fy))
+ WRITE_RGBA( x[i], fy,
+ rgba[i][0], rgba[i][1],
+ rgba[i][2], rgba[i][3] );
+ }
+ }
+ }
+ else
+ {
+ for (i=0;i<n;i++)
+ {
+ const int fy = Y_FLIP(y[i]);
+ if (CLIPPIXEL(x[i],fy))
+ WRITE_RGBA( x[i], fy,
+ rgba[i][0], rgba[i][1],
+ rgba[i][2], rgba[i][3] );
+ }
+ }
+ }
+ HW_ENDCLIPLOOP();
+ }
+ HW_WRITE_UNLOCK();
+}
+
+
+static void TAG(WriteMonoRGBASpan)( struct gl_context *ctx,
+ struct gl_renderbuffer *rb,
+ GLuint n, GLint x, GLint y,
+ const void *value, const GLubyte mask[] )
+{
+ HW_WRITE_LOCK()
+ {
+ const GLubyte *color = (const GLubyte *) value;
+ GLint x1;
+ GLint n1;
+ LOCAL_VARS;
+ INIT_MONO_PIXEL(p, color);
+
+ y = Y_FLIP( y );
+
+ if (DBG) fprintf(stderr, "WriteMonoRGBASpan\n");
+
+ HW_WRITE_CLIPLOOP()
+ {
+ GLint i = 0;
+ CLIPSPAN(x,y,n,x1,n1,i);
+ if (mask)
+ {
+ for (;n1>0;i++,x1++,n1--)
+ if (mask[i])
+ WRITE_PIXEL( x1, y, p );
+ }
+ else
+ {
+ for (;n1>0;i++,x1++,n1--)
+ WRITE_PIXEL( x1, y, p );
+ }
+ }
+ HW_ENDCLIPLOOP();
+ }
+ HW_WRITE_UNLOCK();
+}
+
+
+static void TAG(WriteMonoRGBAPixels)( struct gl_context *ctx,
+ struct gl_renderbuffer *rb,
+ GLuint n,
+ const GLint x[], const GLint y[],
+ const void *value,
+ const GLubyte mask[] )
+{
+ HW_WRITE_LOCK()
+ {
+ const GLubyte *color = (const GLubyte *) value;
+ GLint i;
+ LOCAL_VARS;
+ INIT_MONO_PIXEL(p, color);
+
+ if (DBG) fprintf(stderr, "WriteMonoRGBAPixels\n");
+
+ HW_WRITE_CLIPLOOP()
+ {
+ if (mask)
+ {
+ for (i=0;i<n;i++)
+ if (mask[i]) {
+ int fy = Y_FLIP(y[i]);
+ if (CLIPPIXEL( x[i], fy ))
+ WRITE_PIXEL( x[i], fy, p );
+ }
+ }
+ else
+ {
+ for (i=0;i<n;i++) {
+ int fy = Y_FLIP(y[i]);
+ if (CLIPPIXEL( x[i], fy ))
+ WRITE_PIXEL( x[i], fy, p );
+ }
+ }
+ }
+ HW_ENDCLIPLOOP();
+ }
+ HW_WRITE_UNLOCK();
+}
+
+
+static void TAG(ReadRGBASpan)( struct gl_context *ctx,
+ struct gl_renderbuffer *rb,
+ GLuint n, GLint x, GLint y, void *values)
+{
+ HW_READ_LOCK()
+ {
+ GLubyte (*rgba)[4] = (GLubyte (*)[4]) values;
+ GLint x1,n1;
+ LOCAL_VARS;
+
+ y = Y_FLIP(y);
+
+ if (DBG) fprintf(stderr, "ReadRGBASpan\n");
+
+ HW_READ_CLIPLOOP()
+ {
+ GLint i = 0;
+ CLIPSPAN(x,y,n,x1,n1,i);
+ for (;n1>0;i++,x1++,n1--)
+ READ_RGBA( rgba[i], x1, y );
+ }
+ HW_ENDCLIPLOOP();
+ }
+ HW_READ_UNLOCK();
+}
+
+
+#if defined(GET_PTR) && \
+ defined(USE_MMX_ASM) && \
+ (((SPANTMP_PIXEL_FMT == GL_BGRA) && \
+ (SPANTMP_PIXEL_TYPE == GL_UNSIGNED_INT_8_8_8_8_REV)) || \
+ ((SPANTMP_PIXEL_FMT == GL_RGB) && \
+ (SPANTMP_PIXEL_TYPE == GL_UNSIGNED_SHORT_5_6_5)))
+static void TAG2(ReadRGBASpan,_MMX)( struct gl_context *ctx,
+ struct gl_renderbuffer *rb,
+ GLuint n, GLint x, GLint y, void *values)
+{
+#ifndef USE_INNER_EMMS
+ /* The EMMS instruction is directly in-lined here because using GCC's
+ * built-in _mm_empty function was found to utterly destroy performance.
+ */
+ __asm__ __volatile__( "emms" );
+#endif
+
+ HW_READ_LOCK()
+ {
+ GLubyte (*rgba)[4] = (GLubyte (*)[4]) values;
+ GLint x1,n1;
+ LOCAL_VARS;
+
+ y = Y_FLIP(y);
+
+ if (DBG) fprintf(stderr, "ReadRGBASpan\n");
+
+ HW_READ_CLIPLOOP()
+ {
+ GLint i = 0;
+ CLIPSPAN(x,y,n,x1,n1,i);
+
+ {
+ const void * src = GET_PTR( x1, y );
+#if (SPANTMP_PIXEL_FMT == GL_RGB) && \
+ (SPANTMP_PIXEL_TYPE == GL_UNSIGNED_SHORT_5_6_5)
+ _generic_read_RGBA_span_RGB565_MMX( src, rgba[i], n1 );
+#else
+ _generic_read_RGBA_span_BGRA8888_REV_MMX( src, rgba[i], n1 );
+#endif
+ }
+ }
+ HW_ENDCLIPLOOP();
+ }
+ HW_READ_UNLOCK();
+#ifndef USE_INNER_EMMS
+ __asm__ __volatile__( "emms" );
+#endif
+}
+#endif
+
+
+#if defined(GET_PTR) && \
+ defined(USE_SSE_ASM) && \
+ (SPANTMP_PIXEL_FMT == GL_BGRA) && \
+ (SPANTMP_PIXEL_TYPE == GL_UNSIGNED_INT_8_8_8_8_REV)
+static void TAG2(ReadRGBASpan,_SSE2)( struct gl_context *ctx,
+ struct gl_renderbuffer *rb,
+ GLuint n, GLint x, GLint y,
+ void *values)
+{
+ HW_READ_LOCK()
+ {
+ GLubyte (*rgba)[4] = (GLubyte (*)[4]) values;
+ GLint x1,n1;
+ LOCAL_VARS;
+
+ y = Y_FLIP(y);
+
+ if (DBG) fprintf(stderr, "ReadRGBASpan\n");
+
+ HW_READ_CLIPLOOP()
+ {
+ GLint i = 0;
+ CLIPSPAN(x,y,n,x1,n1,i);
+
+ {
+ const void * src = GET_PTR( x1, y );
+ _generic_read_RGBA_span_BGRA8888_REV_SSE2( src, rgba[i], n1 );
+ }
+ }
+ HW_ENDCLIPLOOP();
+ }
+ HW_READ_UNLOCK();
+}
+#endif
+
+#if defined(GET_PTR) && \
+ defined(USE_SSE_ASM) && \
+ (SPANTMP_PIXEL_FMT == GL_BGRA) && \
+ (SPANTMP_PIXEL_TYPE == GL_UNSIGNED_INT_8_8_8_8_REV)
+static void TAG2(ReadRGBASpan,_SSE)( struct gl_context *ctx,
+ struct gl_renderbuffer *rb,
+ GLuint n, GLint x, GLint y,
+ void *values)
+{
+#ifndef USE_INNER_EMMS
+ /* The EMMS instruction is directly in-lined here because using GCC's
+ * built-in _mm_empty function was found to utterly destroy performance.
+ */
+ __asm__ __volatile__( "emms" );
+#endif
+
+ HW_READ_LOCK()
+ {
+ GLubyte (*rgba)[4] = (GLubyte (*)[4]) values;
+ GLint x1,n1;
+ LOCAL_VARS;
+
+ y = Y_FLIP(y);
+
+ if (DBG) fprintf(stderr, "ReadRGBASpan\n");
+
+ HW_READ_CLIPLOOP()
+ {
+ GLint i = 0;
+ CLIPSPAN(x,y,n,x1,n1,i);
+
+ {
+ const void * src = GET_PTR( x1, y );
+ _generic_read_RGBA_span_BGRA8888_REV_SSE( src, rgba[i], n1 );
+ }
+ }
+ HW_ENDCLIPLOOP();
+ }
+ HW_READ_UNLOCK();
+#ifndef USE_INNER_EMMS
+ __asm__ __volatile__( "emms" );
+#endif
+}
+#endif
+
+
+static void TAG(ReadRGBAPixels)( struct gl_context *ctx,
+ struct gl_renderbuffer *rb,
+ GLuint n, const GLint x[], const GLint y[],
+ void *values )
+{
+ HW_READ_LOCK()
+ {
+ GLubyte (*rgba)[4] = (GLubyte (*)[4]) values;
+ GLint i;
+ LOCAL_VARS;
+
+ if (DBG) fprintf(stderr, "ReadRGBAPixels\n");
+
+ HW_READ_CLIPLOOP()
+ {
+ for (i=0;i<n;i++) {
+ int fy = Y_FLIP( y[i] );
+ if (CLIPPIXEL( x[i], fy ))
+ READ_RGBA( rgba[i], x[i], fy );
+ }
+ }
+ HW_ENDCLIPLOOP();
+ }
+ HW_READ_UNLOCK();
+}
+
+static void TAG(InitPointers)(struct gl_renderbuffer *rb)
+{
+ rb->PutRow = TAG(WriteRGBASpan);
+ rb->PutRowRGB = TAG(WriteRGBSpan);
+ rb->PutMonoRow = TAG(WriteMonoRGBASpan);
+ rb->PutValues = TAG(WriteRGBAPixels);
+ rb->PutMonoValues = TAG(WriteMonoRGBAPixels);
+ rb->GetValues = TAG(ReadRGBAPixels);
+
+#if defined(GET_PTR)
+#if defined(USE_SSE_ASM) && \
+ (SPANTMP_PIXEL_FMT == GL_BGRA) && \
+ (SPANTMP_PIXEL_TYPE == GL_UNSIGNED_INT_8_8_8_8_REV)
+ if ( cpu_has_xmm2 ) {
+ if (DBG) fprintf( stderr, "Using %s version of GetRow\n", "SSE2" );
+ rb->GetRow = TAG2(ReadRGBASpan, _SSE2);
+ }
+ else
+#endif
+#if defined(USE_SSE_ASM) && \
+ (SPANTMP_PIXEL_FMT == GL_BGRA) && \
+ (SPANTMP_PIXEL_TYPE == GL_UNSIGNED_INT_8_8_8_8_REV)
+ if ( cpu_has_xmm ) {
+ if (DBG) fprintf( stderr, "Using %s version of GetRow\n", "SSE" );
+ rb->GetRow = TAG2(ReadRGBASpan, _SSE);
+ }
+ else
+#endif
+#if defined(USE_MMX_ASM) && \
+ (((SPANTMP_PIXEL_FMT == GL_BGRA) && \
+ (SPANTMP_PIXEL_TYPE == GL_UNSIGNED_INT_8_8_8_8_REV)) || \
+ ((SPANTMP_PIXEL_FMT == GL_RGB) && \
+ (SPANTMP_PIXEL_TYPE == GL_UNSIGNED_SHORT_5_6_5)))
+ if ( cpu_has_mmx ) {
+ if (DBG) fprintf( stderr, "Using %s version of GetRow\n", "MMX" );
+ rb->GetRow = TAG2(ReadRGBASpan, _MMX);
+ }
+ else
+#endif
+#endif /* GET_PTR */
+ {
+ if (DBG) fprintf( stderr, "Using %s version of GetRow\n", "C" );
+ rb->GetRow = TAG(ReadRGBASpan);
+ }
+
+}
+
+
+#undef INIT_MONO_PIXEL
+#undef WRITE_PIXEL
+#undef WRITE_RGBA
+#undef READ_RGBA
+#undef TAG
+#undef TAG2
+#undef GET_VALUE
+#undef PUT_VALUE
+#undef GET_PTR
+#undef SPANTMP_PIXEL_FMT
+#undef SPANTMP_PIXEL_TYPE
diff --git a/mesalib/src/mesa/drivers/dri/common/texmem.c b/mesalib/src/mesa/drivers/dri/common/texmem.c
index e927cf0ad..03c15c895 100644
--- a/mesalib/src/mesa/drivers/dri/common/texmem.c
+++ b/mesalib/src/mesa/drivers/dri/common/texmem.c
@@ -1,1342 +1,1342 @@
-/*
- * Copyright 2000-2001 VA Linux Systems, Inc.
- * (C) Copyright IBM Corporation 2002, 2003
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * on the rights to use, copy, modify, merge, publish, distribute, sub
- * license, and/or sell copies of the Software, and to permit persons to whom
- * the Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
- * VA LINUX SYSTEM, IBM AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
- * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
- * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
- * USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- * Authors:
- * Ian Romanick <idr@us.ibm.com>
- * Keith Whitwell <keithw@tungstengraphics.com>
- * Kevin E. Martin <kem@users.sourceforge.net>
- * Gareth Hughes <gareth@nvidia.com>
- */
-
-/** \file texmem.c
- * Implements all of the device-independent texture memory management.
- *
- * Currently, only a simple LRU texture memory management policy is
- * implemented. In the (hopefully very near) future, better policies will be
- * implemented. The idea is that the DRI should be able to run in one of two
- * modes. In the default mode the DRI will dynamically attempt to discover
- * the best texture management policy for the running application. In the
- * other mode, the user (via some sort of as yet TBD mechanism) will select
- * a texture management policy that is known to work well with the
- * application.
- */
-
-#include "main/imports.h"
-#include "main/macros.h"
-#include "main/simple_list.h"
-#include "texmem.h"
-
-
-static unsigned dummy_swap_counter;
-
-
-/**
- * Calculate \f$\log_2\f$ of a value. This is a particularly poor
- * implementation of this function. However, since system performance is in
- * no way dependent on this function, the slowness of the implementation is
- * irrelevent.
- *
- * \param n Value whose \f$\log_2\f$ is to be calculated
- */
-
-static GLuint
-driLog2( GLuint n )
-{
- GLuint log2;
-
- for ( log2 = 1 ; n > 1 ; log2++ ) {
- n >>= 1;
- }
-
- return log2;
-}
-
-
-
-
-/**
- * Determine if a texture is resident in textureable memory. Depending on
- * the driver, this may or may not be on-card memory. It could be AGP memory
- * or anyother type of memory from which the hardware can directly read
- * texels.
- *
- * This function is intended to be used as the \c IsTextureResident function
- * in the device's \c dd_function_table.
- *
- * \param ctx GL context pointer (currently unused)
- * \param texObj Texture object to be tested
- */
-
-GLboolean
-driIsTextureResident( struct gl_context * ctx,
- struct gl_texture_object * texObj )
-{
- driTextureObject * t;
-
-
- t = (driTextureObject *) texObj->DriverData;
- return( (t != NULL) && (t->memBlock != NULL) );
-}
-
-
-
-
-/**
- * (Re)initialize the global circular LRU list. The last element
- * in the array (\a heap->nrRegions) is the sentinal. Keeping it
- * at the end of the array allows the other elements of the array
- * to be addressed rationally when looking up objects at a particular
- * location in texture memory.
- *
- * \param heap Texture heap to be reset
- */
-
-static void resetGlobalLRU( driTexHeap * heap )
-{
- drmTextureRegionPtr list = heap->global_regions;
- unsigned sz = 1U << heap->logGranularity;
- unsigned i;
-
- for (i = 0 ; (i+1) * sz <= heap->size ; i++) {
- list[i].prev = i-1;
- list[i].next = i+1;
- list[i].age = 0;
- }
-
- i--;
- list[0].prev = heap->nrRegions;
- list[i].prev = i-1;
- list[i].next = heap->nrRegions;
- list[heap->nrRegions].prev = i;
- list[heap->nrRegions].next = 0;
- heap->global_age[0] = 0;
-}
-
-/**
- * Print out debugging information about the local texture LRU.
- *
- * \param heap Texture heap to be printed
- * \param callername Name of calling function
- */
-static void printLocalLRU( driTexHeap * heap, const char *callername )
-{
- driTextureObject *t;
- unsigned sz = 1U << heap->logGranularity;
-
- fprintf( stderr, "%s in %s:\nLocal LRU, heap %d:\n",
- __FUNCTION__, callername, heap->heapId );
-
- foreach ( t, &heap->texture_objects ) {
- if (!t->memBlock)
- continue;
- if (!t->tObj) {
- fprintf( stderr, "Placeholder (%p) %d at 0x%x sz 0x%x\n",
- (void *)t,
- t->memBlock->ofs / sz,
- t->memBlock->ofs,
- t->memBlock->size );
- } else {
- fprintf( stderr, "Texture (%p) at 0x%x sz 0x%x\n",
- (void *)t,
- t->memBlock->ofs,
- t->memBlock->size );
- }
- }
- foreach ( t, heap->swapped_objects ) {
- if (!t->tObj) {
- fprintf( stderr, "Swapped Placeholder (%p)\n", (void *)t );
- } else {
- fprintf( stderr, "Swapped Texture (%p)\n", (void *)t );
- }
- }
-
- fprintf( stderr, "\n" );
-}
-
-/**
- * Print out debugging information about the global texture LRU.
- *
- * \param heap Texture heap to be printed
- * \param callername Name of calling function
- */
-static void printGlobalLRU( driTexHeap * heap, const char *callername )
-{
- drmTextureRegionPtr list = heap->global_regions;
- unsigned int i, j;
-
- fprintf( stderr, "%s in %s:\nGlobal LRU, heap %d list %p:\n",
- __FUNCTION__, callername, heap->heapId, (void *)list );
-
- for ( i = 0, j = heap->nrRegions ; i < heap->nrRegions ; i++ ) {
- fprintf( stderr, "list[%d] age %d next %d prev %d in_use %d\n",
- j, list[j].age, list[j].next, list[j].prev, list[j].in_use );
- j = list[j].next;
- if ( j == heap->nrRegions ) break;
- }
-
- if ( j != heap->nrRegions ) {
- fprintf( stderr, "Loop detected in global LRU\n" );
- for ( i = 0 ; i < heap->nrRegions ; i++ ) {
- fprintf( stderr, "list[%d] age %d next %d prev %d in_use %d\n",
- i, list[i].age, list[i].next, list[i].prev, list[i].in_use );
- }
- }
-
- fprintf( stderr, "\n" );
-}
-
-
-/**
- * Called by the client whenever it touches a local texture.
- *
- * \param t Texture object that the client has accessed
- */
-
-void driUpdateTextureLRU( driTextureObject * t )
-{
- driTexHeap * heap;
- drmTextureRegionPtr list;
- unsigned shift;
- unsigned start;
- unsigned end;
- unsigned i;
-
-
- heap = t->heap;
- if ( heap != NULL ) {
- shift = heap->logGranularity;
- start = t->memBlock->ofs >> shift;
- end = (t->memBlock->ofs + t->memBlock->size - 1) >> shift;
-
-
- heap->local_age = ++heap->global_age[0];
- list = heap->global_regions;
-
-
- /* Update the context's local LRU
- */
-
- move_to_head( & heap->texture_objects, t );
-
-
- for (i = start ; i <= end ; i++) {
- list[i].age = heap->local_age;
-
- /* remove_from_list(i)
- */
- list[(unsigned)list[i].next].prev = list[i].prev;
- list[(unsigned)list[i].prev].next = list[i].next;
-
- /* insert_at_head(list, i)
- */
- list[i].prev = heap->nrRegions;
- list[i].next = list[heap->nrRegions].next;
- list[(unsigned)list[heap->nrRegions].next].prev = i;
- list[heap->nrRegions].next = i;
- }
-
- if ( 0 ) {
- printGlobalLRU( heap, __FUNCTION__ );
- printLocalLRU( heap, __FUNCTION__ );
- }
- }
-}
-
-
-
-
-/**
- * Keep track of swapped out texture objects.
- *
- * \param t Texture object to be "swapped" out of its texture heap
- */
-
-void driSwapOutTextureObject( driTextureObject * t )
-{
- unsigned face;
-
-
- if ( t->memBlock != NULL ) {
- assert( t->heap != NULL );
- mmFreeMem( t->memBlock );
- t->memBlock = NULL;
-
- if (t->timestamp > t->heap->timestamp)
- t->heap->timestamp = t->timestamp;
-
- t->heap->texture_swaps[0]++;
- move_to_tail( t->heap->swapped_objects, t );
- t->heap = NULL;
- }
- else {
- assert( t->heap == NULL );
- }
-
-
- for ( face = 0 ; face < 6 ; face++ ) {
- t->dirty_images[face] = ~0;
- }
-}
-
-
-
-
-/**
- * Destroy hardware state associated with texture \a t. Calls the
- * \a destroy_texture_object method associated with the heap from which
- * \a t was allocated.
- *
- * \param t Texture object to be destroyed
- */
-
-void driDestroyTextureObject( driTextureObject * t )
-{
- driTexHeap * heap;
-
-
- if ( 0 ) {
- fprintf( stderr, "[%s:%d] freeing %p (tObj = %p, DriverData = %p)\n",
- __FILE__, __LINE__,
- (void *)t,
- (void *)((t != NULL) ? t->tObj : NULL),
- (void *)((t != NULL && t->tObj != NULL) ? t->tObj->DriverData : NULL ));
- }
-
- if ( t != NULL ) {
- if ( t->memBlock ) {
- heap = t->heap;
- assert( heap != NULL );
-
- heap->texture_swaps[0]++;
-
- mmFreeMem( t->memBlock );
- t->memBlock = NULL;
-
- if (t->timestamp > t->heap->timestamp)
- t->heap->timestamp = t->timestamp;
-
- heap->destroy_texture_object( heap->driverContext, t );
- t->heap = NULL;
- }
-
- if ( t->tObj != NULL ) {
- assert( t->tObj->DriverData == t );
- t->tObj->DriverData = NULL;
- }
-
- remove_from_list( t );
- FREE( t );
- }
-
- if ( 0 ) {
- fprintf( stderr, "[%s:%d] done freeing %p\n", __FILE__, __LINE__, (void *)t );
- }
-}
-
-
-
-
-/**
- * Update the local heap's representation of texture memory based on
- * data in the SAREA. This is done each time it is detected that some other
- * direct rendering client has held the lock. This pertains to both our local
- * textures and the textures belonging to other clients. Keep track of other
- * client's textures by pushing a placeholder texture onto the LRU list --
- * these are denoted by \a tObj being \a NULL.
- *
- * \param heap Heap whose state is to be updated
- * \param offset Byte offset in the heap that has been stolen
- * \param size Size, in bytes, of the stolen block
- * \param in_use Non-zero if the block is pinned/reserved by the kernel
- */
-
-static void driTexturesGone( driTexHeap * heap, int offset, int size,
- int in_use )
-{
- driTextureObject * t;
- driTextureObject * tmp;
-
-
- foreach_s ( t, tmp, & heap->texture_objects ) {
- if ( (t->memBlock->ofs < (offset + size))
- && ((t->memBlock->ofs + t->memBlock->size) > offset) ) {
- /* It overlaps - kick it out. If the texture object is just a
- * place holder, then destroy it all together. Otherwise, mark
- * it as being swapped out.
- */
-
- if ( t->tObj != NULL ) {
- driSwapOutTextureObject( t );
- }
- else {
- driDestroyTextureObject( t );
- }
- }
- }
-
-
- {
- t = (driTextureObject *) CALLOC( heap->texture_object_size );
- if ( t == NULL ) return;
-
- t->memBlock = mmAllocMem( heap->memory_heap, size, 0, offset );
- if ( t->memBlock == NULL ) {
- fprintf( stderr, "Couldn't alloc placeholder: heap %u sz %x ofs %x\n", heap->heapId,
- (int)size, (int)offset );
- mmDumpMemInfo( heap->memory_heap );
- FREE(t);
- return;
- }
- t->heap = heap;
- if (in_use)
- t->reserved = 1;
- insert_at_head( & heap->texture_objects, t );
- }
-}
-
-
-
-
-/**
- * Called by the client on lock contention to determine whether textures have
- * been stolen. If another client has modified a region in which we have
- * textures, then we need to figure out which of our textures have been
- * removed and update our global LRU.
- *
- * \param heap Texture heap to be updated
- */
-
-void driAgeTextures( driTexHeap * heap )
-{
- drmTextureRegionPtr list = heap->global_regions;
- unsigned sz = 1U << (heap->logGranularity);
- unsigned i, nr = 0;
-
-
- /* Have to go right round from the back to ensure stuff ends up
- * LRU in the local list... Fix with a cursor pointer.
- */
-
- for (i = list[heap->nrRegions].prev ;
- i != heap->nrRegions && nr < heap->nrRegions ;
- i = list[i].prev, nr++) {
- /* If switching texturing schemes, then the SAREA might not have been
- * properly cleared, so we need to reset the global texture LRU.
- */
-
- if ( (i * sz) > heap->size ) {
- nr = heap->nrRegions;
- break;
- }
-
- if (list[i].age > heap->local_age)
- driTexturesGone( heap, i * sz, sz, list[i].in_use);
- }
-
- /* Loop or uninitialized heap detected. Reset.
- */
-
- if (nr == heap->nrRegions) {
- driTexturesGone( heap, 0, heap->size, 0);
- resetGlobalLRU( heap );
- }
-
- if ( 0 ) {
- printGlobalLRU( heap, __FUNCTION__ );
- printLocalLRU( heap, __FUNCTION__ );
- }
-
- heap->local_age = heap->global_age[0];
-}
-
-
-
-
-#define INDEX_ARRAY_SIZE 6 /* I'm not aware of driver with more than 2 heaps */
-
-/**
- * Allocate memory from a texture heap to hold a texture object. This
- * routine will attempt to allocate memory for the texture from the heaps
- * specified by \c heap_array in order. That is, first it will try to
- * allocate from \c heap_array[0], then \c heap_array[1], and so on.
- *
- * \param heap_array Array of pointers to texture heaps to use
- * \param nr_heaps Number of heap pointer in \a heap_array
- * \param t Texture object for which space is needed
- * \return The ID of the heap from which memory was allocated, or -1 if
- * memory could not be allocated.
- *
- * \bug The replacement policy implemented by this function is horrible.
- */
-
-
-int
-driAllocateTexture( driTexHeap * const * heap_array, unsigned nr_heaps,
- driTextureObject * t )
-{
- driTexHeap * heap;
- driTextureObject * temp;
- driTextureObject * cursor;
- unsigned id;
-
-
- /* In case it already has texture space, initialize heap. This also
- * prevents GCC from issuing a warning that heap might be used
- * uninitialized.
- */
-
- heap = t->heap;
-
-
- /* Run through each of the existing heaps and try to allocate a buffer
- * to hold the texture.
- */
-
- for ( id = 0 ; (t->memBlock == NULL) && (id < nr_heaps) ; id++ ) {
- heap = heap_array[ id ];
- if ( heap != NULL ) {
- t->memBlock = mmAllocMem( heap->memory_heap, t->totalSize,
- heap->alignmentShift, 0 );
- }
- }
-
-
- /* Kick textures out until the requested texture fits.
- */
-
- if ( t->memBlock == NULL ) {
- unsigned index[INDEX_ARRAY_SIZE];
- unsigned nrGoodHeaps = 0;
-
- /* Trying to avoid dynamic memory allocation. If you have more
- * heaps, increase INDEX_ARRAY_SIZE. I'm not aware of any
- * drivers with more than 2 tex heaps. */
- assert( nr_heaps < INDEX_ARRAY_SIZE );
-
- /* Sort large enough heaps by duty. Insertion sort should be
- * fast enough for such a short array. */
- for ( id = 0 ; id < nr_heaps ; id++ ) {
- heap = heap_array[ id ];
-
- if ( heap != NULL && t->totalSize <= heap->size ) {
- unsigned j;
-
- for ( j = 0 ; j < nrGoodHeaps; j++ ) {
- if ( heap->duty > heap_array[ index[ j ] ]->duty )
- break;
- }
-
- if ( j < nrGoodHeaps ) {
- memmove( &index[ j+1 ], &index[ j ],
- sizeof(index[ 0 ]) * (nrGoodHeaps - j) );
- }
-
- index[ j ] = id;
-
- nrGoodHeaps++;
- }
- }
-
- for ( id = 0 ; (t->memBlock == NULL) && (id < nrGoodHeaps) ; id++ ) {
- heap = heap_array[ index[ id ] ];
-
- for ( cursor = heap->texture_objects.prev, temp = cursor->prev;
- cursor != &heap->texture_objects ;
- cursor = temp, temp = cursor->prev ) {
-
- /* The the LRU element. If the texture is bound to one of
- * the texture units, then we cannot kick it out.
- */
- if ( cursor->bound || cursor->reserved ) {
- continue;
- }
-
- if ( cursor->memBlock )
- heap->duty -= cursor->memBlock->size;
-
- /* If this is a placeholder, there's no need to keep it */
- if (cursor->tObj)
- driSwapOutTextureObject( cursor );
- else
- driDestroyTextureObject( cursor );
-
- t->memBlock = mmAllocMem( heap->memory_heap, t->totalSize,
- heap->alignmentShift, 0 );
-
- if (t->memBlock)
- break;
- }
- }
-
- /* Rebalance duties. If a heap kicked more data than its duty,
- * then all other heaps get that amount multiplied with their
- * relative weight added to their duty. The negative duty is
- * reset to 0. In the end all heaps have a duty >= 0.
- *
- * CAUTION: we must not change the heap pointer here, because it
- * is used below to update the texture object.
- */
- for ( id = 0 ; id < nr_heaps ; id++ )
- if ( heap_array[ id ] != NULL && heap_array[ id ]->duty < 0) {
- int duty = -heap_array[ id ]->duty;
- double weight = heap_array[ id ]->weight;
- unsigned j;
-
- for ( j = 0 ; j < nr_heaps ; j++ )
- if ( j != id && heap_array[ j ] != NULL ) {
- heap_array[ j ]->duty += (double) duty *
- heap_array[ j ]->weight / weight;
- }
-
- heap_array[ id ]->duty = 0;
- }
- }
-
-
- if ( t->memBlock != NULL ) {
- /* id and heap->heapId may or may not be the same value here.
- */
-
- assert( heap != NULL );
- assert( (t->heap == NULL) || (t->heap == heap) );
-
- t->heap = heap;
- return heap->heapId;
- }
- else {
- assert( t->heap == NULL );
-
- fprintf( stderr, "[%s:%d] unable to allocate texture\n",
- __FUNCTION__, __LINE__ );
- return -1;
- }
-}
-
-
-
-
-
-
-/**
- * Set the location where the texture-swap counter is stored.
- */
-
-void
-driSetTextureSwapCounterLocation( driTexHeap * heap, unsigned * counter )
-{
- heap->texture_swaps = (counter == NULL) ? & dummy_swap_counter : counter;
-}
-
-
-
-
-/**
- * Create a new heap for texture data.
- *
- * \param heap_id Device-dependent heap identifier. This value
- * will returned by driAllocateTexture when memory
- * is allocated from this heap.
- * \param context Device-dependent driver context. This is
- * supplied as the first parameter to the
- * \c destroy_tex_obj function.
- * \param size Size, in bytes, of the texture region
- * \param alignmentShift Alignment requirement for textures. If textures
- * must be allocated on a 4096 byte boundry, this
- * would be 12.
- * \param nr_regions Number of regions into which this texture space
- * should be partitioned
- * \param global_regions Array of \c drmTextureRegion structures in the SAREA
- * \param global_age Pointer to the global texture age in the SAREA
- * \param swapped_objects Pointer to the list of texture objects that are
- * not in texture memory (i.e., have been swapped
- * out).
- * \param texture_object_size Size, in bytes, of a device-dependent texture
- * object
- * \param destroy_tex_obj Function used to destroy a device-dependent
- * texture object
- *
- * \sa driDestroyTextureHeap
- */
-
-driTexHeap *
-driCreateTextureHeap( unsigned heap_id, void * context, unsigned size,
- unsigned alignmentShift, unsigned nr_regions,
- drmTextureRegionPtr global_regions, unsigned * global_age,
- driTextureObject * swapped_objects,
- unsigned texture_object_size,
- destroy_texture_object_t * destroy_tex_obj
- )
-{
- driTexHeap * heap;
- unsigned l;
-
-
- if ( 0 )
- fprintf( stderr, "%s( %u, %p, %u, %u, %u )\n",
- __FUNCTION__,
- heap_id, (void *)context, size, alignmentShift, nr_regions );
-
- heap = (driTexHeap *) CALLOC( sizeof( driTexHeap ) );
- if ( heap != NULL ) {
- l = driLog2( (size - 1) / nr_regions );
- if ( l < alignmentShift )
- {
- l = alignmentShift;
- }
-
- heap->logGranularity = l;
- heap->size = size & ~((1L << l) - 1);
-
- heap->memory_heap = mmInit( 0, heap->size );
- if ( heap->memory_heap != NULL ) {
- heap->heapId = heap_id;
- heap->driverContext = context;
-
- heap->alignmentShift = alignmentShift;
- heap->nrRegions = nr_regions;
- heap->global_regions = global_regions;
- heap->global_age = global_age;
- heap->swapped_objects = swapped_objects;
- heap->texture_object_size = texture_object_size;
- heap->destroy_texture_object = destroy_tex_obj;
-
- /* Force global heap init */
- if (heap->global_age[0] == 0)
- heap->local_age = ~0;
- else
- heap->local_age = 0;
-
- make_empty_list( & heap->texture_objects );
- driSetTextureSwapCounterLocation( heap, NULL );
-
- heap->weight = heap->size;
- heap->duty = 0;
- }
- else {
- FREE( heap );
- heap = NULL;
- }
- }
-
-
- if ( 0 )
- fprintf( stderr, "%s returning %p\n", __FUNCTION__, (void *)heap );
-
- return heap;
-}
-
-
-
-
-/** Destroys a texture heap
- *
- * \param heap Texture heap to be destroyed
- */
-
-void
-driDestroyTextureHeap( driTexHeap * heap )
-{
- driTextureObject * t;
- driTextureObject * temp;
-
-
- if ( heap != NULL ) {
- foreach_s( t, temp, & heap->texture_objects ) {
- driDestroyTextureObject( t );
- }
- foreach_s( t, temp, heap->swapped_objects ) {
- driDestroyTextureObject( t );
- }
-
- mmDestroy( heap->memory_heap );
- FREE( heap );
- }
-}
-
-
-
-
-/****************************************************************************/
-/**
- * Determine how many texels (including all mipmap levels) would be required
- * for a texture map of size \f$2^^\c base_size_log2\f$ would require.
- *
- * \param base_size_log2 \f$log_2\f$ of the size of a side of the texture
- * \param dimensions Number of dimensions of the texture. Either 2 or 3.
- * \param faces Number of faces of the texture. Either 1 or 6 (for cube maps).
- * \return Number of texels
- */
-
-static unsigned
-texels_this_map_size( int base_size_log2, unsigned dimensions, unsigned faces )
-{
- unsigned texels;
-
-
- assert( (faces == 1) || (faces == 6) );
- assert( (dimensions == 2) || (dimensions == 3) );
-
- texels = 0;
- if ( base_size_log2 >= 0 ) {
- texels = (1U << (dimensions * base_size_log2));
-
- /* See http://www.mail-archive.com/dri-devel@lists.sourceforge.net/msg03636.html
- * for the complete explaination of why this formulation is used.
- * Basically, the smaller mipmap levels sum to 0.333 the size of the
- * level 0 map. The total size is therefore the size of the map
- * multipled by 1.333. The +2 is there to round up.
- */
-
- texels = (texels * 4 * faces + 2) / 3;
- }
-
- return texels;
-}
-
-
-
-
-struct maps_per_heap {
- unsigned c[32];
-};
-
-static void
-fill_in_maximums( driTexHeap * const * heaps, unsigned nr_heaps,
- unsigned max_bytes_per_texel, unsigned max_size,
- unsigned mipmaps_at_once, unsigned dimensions,
- unsigned faces, struct maps_per_heap * max_textures )
-{
- unsigned heap;
- unsigned log2_size;
- unsigned mask;
-
-
- /* Determine how many textures of each size can be stored in each
- * texture heap.
- */
-
- for ( heap = 0 ; heap < nr_heaps ; heap++ ) {
- if ( heaps[ heap ] == NULL ) {
- (void) memset( max_textures[ heap ].c, 0,
- sizeof( max_textures[ heap ].c ) );
- continue;
- }
-
- mask = (1U << heaps[ heap ]->logGranularity) - 1;
-
- if ( 0 ) {
- fprintf( stderr, "[%s:%d] heap[%u] = %u bytes, mask = 0x%08x\n",
- __FILE__, __LINE__,
- heap, heaps[ heap ]->size, mask );
- }
-
- for ( log2_size = max_size ; log2_size > 0 ; log2_size-- ) {
- unsigned total;
-
-
- /* Determine the total number of bytes required by a texture of
- * size log2_size.
- */
-
- total = texels_this_map_size( log2_size, dimensions, faces )
- - texels_this_map_size( log2_size - mipmaps_at_once,
- dimensions, faces );
- total *= max_bytes_per_texel;
- total = (total + mask) & ~mask;
-
- /* The number of textures of a given size that will fit in a heap
- * is equal to the size of the heap divided by the size of the
- * texture.
- */
-
- max_textures[ heap ].c[ log2_size ] = heaps[ heap ]->size / total;
-
- if ( 0 ) {
- fprintf( stderr, "[%s:%d] max_textures[%u].c[%02u] "
- "= 0x%08x / 0x%08x "
- "= %u (%u)\n",
- __FILE__, __LINE__,
- heap, log2_size,
- heaps[ heap ]->size, total,
- heaps[ heap ]->size / total,
- max_textures[ heap ].c[ log2_size ] );
- }
- }
- }
-}
-
-
-static unsigned
-get_max_size( unsigned nr_heaps,
- unsigned texture_units,
- unsigned max_size,
- int all_textures_one_heap,
- struct maps_per_heap * max_textures )
-{
- unsigned heap;
- unsigned log2_size;
-
-
- /* Determine the largest texture size such that a texture of that size
- * can be bound to each texture unit at the same time. Some hardware
- * may require that all textures be in the same texture heap for
- * multitexturing.
- */
-
- for ( log2_size = max_size ; log2_size > 0 ; log2_size-- ) {
- unsigned total = 0;
-
- for ( heap = 0 ; heap < nr_heaps ; heap++ )
- {
- total += max_textures[ heap ].c[ log2_size ];
-
- if ( 0 ) {
- fprintf( stderr, "[%s:%d] max_textures[%u].c[%02u] = %u, "
- "total = %u\n", __FILE__, __LINE__, heap, log2_size,
- max_textures[ heap ].c[ log2_size ], total );
- }
-
- if ( (max_textures[ heap ].c[ log2_size ] >= texture_units)
- || (!all_textures_one_heap && (total >= texture_units)) ) {
- /* The number of mipmap levels is the log-base-2 of the
- * maximum texture size plus 1. If the maximum texture size
- * is 1x1, the log-base-2 is 0 and 1 mipmap level (the base
- * level) is available.
- */
-
- return log2_size + 1;
- }
- }
- }
-
- /* This should NEVER happen. It should always be possible to have at
- * *least* a 1x1 texture in memory!
- */
- assert( log2_size != 0 );
- return 0;
-}
-
-#define SET_MAX(f,v) \
- do { if ( max_sizes[v] != 0 ) { limits-> f = max_sizes[v]; } } while( 0 )
-
-#define SET_MAX_RECT(f,v) \
- do { if ( max_sizes[v] != 0 ) { limits-> f = 1 << (max_sizes[v] - 1); } } while( 0 )
-
-
-/**
- * Given the amount of texture memory, the number of texture units, and the
- * maximum size of a texel, calculate the maximum texture size the driver can
- * advertise.
- *
- * \param heaps Texture heaps for this card
- * \param nr_heap Number of texture heaps
- * \param limits OpenGL contants. MaxTextureUnits must be set.
- * \param max_bytes_per_texel Maximum size of a single texel, in bytes
- * \param max_2D_size \f$\log_2\f$ of the maximum 2D texture size (i.e.,
- * 1024x1024 textures, this would be 10)
- * \param max_3D_size \f$\log_2\f$ of the maximum 3D texture size (i.e.,
- * 1024x1024x1024 textures, this would be 10)
- * \param max_cube_size \f$\log_2\f$ of the maximum cube texture size (i.e.,
- * 1024x1024 textures, this would be 10)
- * \param max_rect_size \f$\log_2\f$ of the maximum texture rectangle size
- * (i.e., 1024x1024 textures, this would be 10). This is a power-of-2
- * even though texture rectangles need not be a power-of-2.
- * \param mipmaps_at_once Total number of mipmaps that can be used
- * at one time. For most hardware this will be \f$\c max_size + 1\f$.
- * For hardware that does not support mipmapping, this will be 1.
- * \param all_textures_one_heap True if the hardware requires that all
- * textures be in a single texture heap for multitexturing.
- * \param allow_larger_textures 0 conservative, 1 calculate limits
- * so at least one worst-case texture can fit, 2 just use hw limits.
- */
-
-void
-driCalculateMaxTextureLevels( driTexHeap * const * heaps,
- unsigned nr_heaps,
- struct gl_constants * limits,
- unsigned max_bytes_per_texel,
- unsigned max_2D_size,
- unsigned max_3D_size,
- unsigned max_cube_size,
- unsigned max_rect_size,
- unsigned mipmaps_at_once,
- int all_textures_one_heap,
- int allow_larger_textures )
-{
- struct maps_per_heap max_textures[8];
- unsigned i;
- const unsigned dimensions[4] = { 2, 3, 2, 2 };
- const unsigned faces[4] = { 1, 1, 6, 1 };
- unsigned max_sizes[4];
- unsigned mipmaps[4];
-
-
- max_sizes[0] = max_2D_size;
- max_sizes[1] = max_3D_size;
- max_sizes[2] = max_cube_size;
- max_sizes[3] = max_rect_size;
-
- mipmaps[0] = mipmaps_at_once;
- mipmaps[1] = mipmaps_at_once;
- mipmaps[2] = mipmaps_at_once;
- mipmaps[3] = 1;
-
-
- /* Calculate the maximum number of texture levels in two passes. The
- * first pass determines how many textures of each power-of-two size
- * (including all mipmap levels for that size) can fit in each texture
- * heap. The second pass finds the largest texture size that allows
- * a texture of that size to be bound to every texture unit.
- */
-
- for ( i = 0 ; i < 4 ; i++ ) {
- if ( (allow_larger_textures != 2) && (max_sizes[ i ] != 0) ) {
- fill_in_maximums( heaps, nr_heaps, max_bytes_per_texel,
- max_sizes[ i ], mipmaps[ i ],
- dimensions[ i ], faces[ i ],
- max_textures );
-
- max_sizes[ i ] = get_max_size( nr_heaps,
- allow_larger_textures == 1 ?
- 1 : limits->MaxTextureUnits,
- max_sizes[ i ],
- all_textures_one_heap,
- max_textures );
- }
- else if (max_sizes[ i ] != 0) {
- max_sizes[ i ] += 1;
- }
- }
-
- SET_MAX( MaxTextureLevels, 0 );
- SET_MAX( Max3DTextureLevels, 1 );
- SET_MAX( MaxCubeTextureLevels, 2 );
- SET_MAX_RECT( MaxTextureRectSize, 3 );
-}
-
-
-
-
-/**
- * Perform initial binding of default textures objects on a per unit, per
- * texture target basis.
- *
- * \param ctx Current OpenGL context
- * \param swapped List of swapped-out textures
- * \param targets Bit-mask of value texture targets
- */
-
-void driInitTextureObjects( struct gl_context *ctx, driTextureObject * swapped,
- GLuint targets )
-{
- struct gl_texture_object *texObj;
- GLuint tmp = ctx->Texture.CurrentUnit;
- unsigned i;
-
-
- for ( i = 0 ; i < ctx->Const.MaxTextureUnits ; i++ ) {
- ctx->Texture.CurrentUnit = i;
-
- if ( (targets & DRI_TEXMGR_DO_TEXTURE_1D) != 0 ) {
- texObj = ctx->Texture.Unit[i].CurrentTex[TEXTURE_1D_INDEX];
- ctx->Driver.BindTexture( ctx, GL_TEXTURE_1D, texObj );
- move_to_tail( swapped, (driTextureObject *) texObj->DriverData );
- }
-
- if ( (targets & DRI_TEXMGR_DO_TEXTURE_2D) != 0 ) {
- texObj = ctx->Texture.Unit[i].CurrentTex[TEXTURE_2D_INDEX];
- ctx->Driver.BindTexture( ctx, GL_TEXTURE_2D, texObj );
- move_to_tail( swapped, (driTextureObject *) texObj->DriverData );
- }
-
- if ( (targets & DRI_TEXMGR_DO_TEXTURE_3D) != 0 ) {
- texObj = ctx->Texture.Unit[i].CurrentTex[TEXTURE_3D_INDEX];
- ctx->Driver.BindTexture( ctx, GL_TEXTURE_3D, texObj );
- move_to_tail( swapped, (driTextureObject *) texObj->DriverData );
- }
-
- if ( (targets & DRI_TEXMGR_DO_TEXTURE_CUBE) != 0 ) {
- texObj = ctx->Texture.Unit[i].CurrentTex[TEXTURE_CUBE_INDEX];
- ctx->Driver.BindTexture( ctx, GL_TEXTURE_CUBE_MAP_ARB, texObj );
- move_to_tail( swapped, (driTextureObject *) texObj->DriverData );
- }
-
- if ( (targets & DRI_TEXMGR_DO_TEXTURE_RECT) != 0 ) {
- texObj = ctx->Texture.Unit[i].CurrentTex[TEXTURE_RECT_INDEX];
- ctx->Driver.BindTexture( ctx, GL_TEXTURE_RECTANGLE_NV, texObj );
- move_to_tail( swapped, (driTextureObject *) texObj->DriverData );
- }
- }
-
- ctx->Texture.CurrentUnit = tmp;
-}
-
-
-
-
-/**
- * Verify that the specified texture is in the specificed heap.
- *
- * \param tex Texture to be tested.
- * \param heap Texture memory heap to be tested.
- * \return True if the texture is in the heap, false otherwise.
- */
-
-static GLboolean
-check_in_heap( const driTextureObject * tex, const driTexHeap * heap )
-{
-#if 1
- return tex->heap == heap;
-#else
- driTextureObject * curr;
-
- foreach( curr, & heap->texture_objects ) {
- if ( curr == tex ) {
- break;
- }
- }
-
- return curr == tex;
-#endif
-}
-
-
-
-/****************************************************************************/
-/**
- * Validate the consistency of a set of texture heaps.
- * Original version by Keith Whitwell in r200/r200_sanity.c.
- */
-
-GLboolean
-driValidateTextureHeaps( driTexHeap * const * texture_heaps,
- unsigned nr_heaps, const driTextureObject * swapped )
-{
- driTextureObject *t;
- unsigned i;
-
- for ( i = 0 ; i < nr_heaps ; i++ ) {
- int last_end = 0;
- unsigned textures_in_heap = 0;
- unsigned blocks_in_mempool = 0;
- const driTexHeap * heap = texture_heaps[i];
- const struct mem_block *p = heap->memory_heap;
-
- /* Check each texture object has a MemBlock, and is linked into
- * the correct heap.
- *
- * Check the texobj base address corresponds to the MemBlock
- * range. Check the texobj size (recalculate?) fits within
- * the MemBlock.
- *
- * Count the number of texobj's using this heap.
- */
-
- foreach ( t, &heap->texture_objects ) {
- if ( !check_in_heap( t, heap ) ) {
- fprintf( stderr, "%s memory block for texture object @ %p not "
- "found in heap #%d\n",
- __FUNCTION__, (void *)t, i );
- return GL_FALSE;
- }
-
-
- if ( t->totalSize > t->memBlock->size ) {
- fprintf( stderr, "%s: Memory block for texture object @ %p is "
- "only %u bytes, but %u are required\n",
- __FUNCTION__, (void *)t, t->totalSize, t->memBlock->size );
- return GL_FALSE;
- }
-
- textures_in_heap++;
- }
-
- /* Validate the contents of the heap:
- * - Ordering
- * - Overlaps
- * - Bounds
- */
-
- while ( p != NULL ) {
- if (p->reserved) {
- fprintf( stderr, "%s: Block (%08x,%x), is reserved?!\n",
- __FUNCTION__, p->ofs, p->size );
- return GL_FALSE;
- }
-
- if (p->ofs != last_end) {
- fprintf( stderr, "%s: blocks_in_mempool = %d, last_end = %d, p->ofs = %d\n",
- __FUNCTION__, blocks_in_mempool, last_end, p->ofs );
- return GL_FALSE;
- }
-
- if (!p->reserved && !p->free) {
- blocks_in_mempool++;
- }
-
- last_end = p->ofs + p->size;
- p = p->next;
- }
-
- if (textures_in_heap != blocks_in_mempool) {
- fprintf( stderr, "%s: Different number of textures objects (%u) and "
- "inuse memory blocks (%u)\n",
- __FUNCTION__, textures_in_heap, blocks_in_mempool );
- return GL_FALSE;
- }
-
-#if 0
- fprintf( stderr, "%s: textures_in_heap = %u\n",
- __FUNCTION__, textures_in_heap );
-#endif
- }
-
-
- /* Check swapped texobj's have zero memblocks
- */
- i = 0;
- foreach ( t, swapped ) {
- if ( t->memBlock != NULL ) {
- fprintf( stderr, "%s: Swapped texobj %p has non-NULL memblock %p\n",
- __FUNCTION__, (void *)t, (void *)t->memBlock );
- return GL_FALSE;
- }
- i++;
- }
-
-#if 0
- fprintf( stderr, "%s: swapped texture count = %u\n", __FUNCTION__, i );
-#endif
-
- return GL_TRUE;
-}
-
-
-
-
-/****************************************************************************/
-/**
- * Compute which mipmap levels that really need to be sent to the hardware.
- * This depends on the base image size, GL_TEXTURE_MIN_LOD,
- * GL_TEXTURE_MAX_LOD, GL_TEXTURE_BASE_LEVEL, and GL_TEXTURE_MAX_LEVEL.
- */
-
-void
-driCalculateTextureFirstLastLevel( driTextureObject * t )
-{
- struct gl_texture_object * const tObj = t->tObj;
- const struct gl_texture_image * const baseImage =
- tObj->Image[0][tObj->BaseLevel];
-
- /* These must be signed values. MinLod and MaxLod can be negative numbers,
- * and having firstLevel and lastLevel as signed prevents the need for
- * extra sign checks.
- */
- int firstLevel;
- int lastLevel;
-
- /* Yes, this looks overly complicated, but it's all needed.
- */
-
- switch (tObj->Target) {
- case GL_TEXTURE_1D:
- case GL_TEXTURE_2D:
- case GL_TEXTURE_3D:
- case GL_TEXTURE_CUBE_MAP:
- if (tObj->Sampler.MinFilter == GL_NEAREST ||
- tObj->Sampler.MinFilter == GL_LINEAR) {
- /* GL_NEAREST and GL_LINEAR only care about GL_TEXTURE_BASE_LEVEL.
- */
-
- firstLevel = lastLevel = tObj->BaseLevel;
- }
- else {
- firstLevel = tObj->BaseLevel + (GLint)(tObj->Sampler.MinLod + 0.5);
- firstLevel = MAX2(firstLevel, tObj->BaseLevel);
- firstLevel = MIN2(firstLevel, tObj->BaseLevel + baseImage->MaxLog2);
- lastLevel = tObj->BaseLevel + (GLint)(tObj->Sampler.MaxLod + 0.5);
- lastLevel = MAX2(lastLevel, t->tObj->BaseLevel);
- lastLevel = MIN2(lastLevel, t->tObj->BaseLevel + baseImage->MaxLog2);
- lastLevel = MIN2(lastLevel, t->tObj->MaxLevel);
- lastLevel = MAX2(firstLevel, lastLevel); /* need at least one level */
- }
- break;
- case GL_TEXTURE_RECTANGLE_NV:
- case GL_TEXTURE_4D_SGIS:
- firstLevel = lastLevel = 0;
- break;
- default:
- return;
- }
-
- /* save these values */
- t->firstLevel = firstLevel;
- t->lastLevel = lastLevel;
-}
-
-
-
-
-/**
- * \name DRI texture formats. These vars are initialized to either the
- * big- or little-endian Mesa formats.
- */
-/*@{*/
-gl_format _dri_texformat_rgba8888 = MESA_FORMAT_NONE;
-gl_format _dri_texformat_argb8888 = MESA_FORMAT_NONE;
-gl_format _dri_texformat_rgb565 = MESA_FORMAT_NONE;
-gl_format _dri_texformat_argb4444 = MESA_FORMAT_NONE;
-gl_format _dri_texformat_argb1555 = MESA_FORMAT_NONE;
-gl_format _dri_texformat_al88 = MESA_FORMAT_NONE;
-gl_format _dri_texformat_a8 = MESA_FORMAT_A8;
-gl_format _dri_texformat_ci8 = MESA_FORMAT_CI8;
-gl_format _dri_texformat_i8 = MESA_FORMAT_I8;
-gl_format _dri_texformat_l8 = MESA_FORMAT_L8;
-/*@}*/
-
-
-/**
- * Initialize _dri_texformat_* vars according to whether we're on
- * a big or little endian system.
- */
-void
-driInitTextureFormats(void)
-{
- if (_mesa_little_endian()) {
- _dri_texformat_rgba8888 = MESA_FORMAT_RGBA8888;
- _dri_texformat_argb8888 = MESA_FORMAT_ARGB8888;
- _dri_texformat_rgb565 = MESA_FORMAT_RGB565;
- _dri_texformat_argb4444 = MESA_FORMAT_ARGB4444;
- _dri_texformat_argb1555 = MESA_FORMAT_ARGB1555;
- _dri_texformat_al88 = MESA_FORMAT_AL88;
- }
- else {
- _dri_texformat_rgba8888 = MESA_FORMAT_RGBA8888_REV;
- _dri_texformat_argb8888 = MESA_FORMAT_ARGB8888_REV;
- _dri_texformat_rgb565 = MESA_FORMAT_RGB565_REV;
- _dri_texformat_argb4444 = MESA_FORMAT_ARGB4444_REV;
- _dri_texformat_argb1555 = MESA_FORMAT_ARGB1555_REV;
- _dri_texformat_al88 = MESA_FORMAT_AL88_REV;
- }
-}
+/*
+ * Copyright 2000-2001 VA Linux Systems, Inc.
+ * (C) Copyright IBM Corporation 2002, 2003
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * on the rights to use, copy, modify, merge, publish, distribute, sub
+ * license, and/or sell copies of the Software, and to permit persons to whom
+ * the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
+ * VA LINUX SYSTEM, IBM AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+ * USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * Authors:
+ * Ian Romanick <idr@us.ibm.com>
+ * Keith Whitwell <keithw@tungstengraphics.com>
+ * Kevin E. Martin <kem@users.sourceforge.net>
+ * Gareth Hughes <gareth@nvidia.com>
+ */
+
+/** \file texmem.c
+ * Implements all of the device-independent texture memory management.
+ *
+ * Currently, only a simple LRU texture memory management policy is
+ * implemented. In the (hopefully very near) future, better policies will be
+ * implemented. The idea is that the DRI should be able to run in one of two
+ * modes. In the default mode the DRI will dynamically attempt to discover
+ * the best texture management policy for the running application. In the
+ * other mode, the user (via some sort of as yet TBD mechanism) will select
+ * a texture management policy that is known to work well with the
+ * application.
+ */
+
+#include "main/imports.h"
+#include "main/macros.h"
+#include "main/simple_list.h"
+#include "texmem.h"
+
+
+static unsigned dummy_swap_counter;
+
+
+/**
+ * Calculate \f$\log_2\f$ of a value. This is a particularly poor
+ * implementation of this function. However, since system performance is in
+ * no way dependent on this function, the slowness of the implementation is
+ * irrelevent.
+ *
+ * \param n Value whose \f$\log_2\f$ is to be calculated
+ */
+
+static GLuint
+driLog2( GLuint n )
+{
+ GLuint log2;
+
+ for ( log2 = 1 ; n > 1 ; log2++ ) {
+ n >>= 1;
+ }
+
+ return log2;
+}
+
+
+
+
+/**
+ * Determine if a texture is resident in textureable memory. Depending on
+ * the driver, this may or may not be on-card memory. It could be AGP memory
+ * or anyother type of memory from which the hardware can directly read
+ * texels.
+ *
+ * This function is intended to be used as the \c IsTextureResident function
+ * in the device's \c dd_function_table.
+ *
+ * \param ctx GL context pointer (currently unused)
+ * \param texObj Texture object to be tested
+ */
+
+GLboolean
+driIsTextureResident( struct gl_context * ctx,
+ struct gl_texture_object * texObj )
+{
+ driTextureObject * t;
+
+
+ t = (driTextureObject *) texObj->DriverData;
+ return( (t != NULL) && (t->memBlock != NULL) );
+}
+
+
+
+
+/**
+ * (Re)initialize the global circular LRU list. The last element
+ * in the array (\a heap->nrRegions) is the sentinal. Keeping it
+ * at the end of the array allows the other elements of the array
+ * to be addressed rationally when looking up objects at a particular
+ * location in texture memory.
+ *
+ * \param heap Texture heap to be reset
+ */
+
+static void resetGlobalLRU( driTexHeap * heap )
+{
+ drmTextureRegionPtr list = heap->global_regions;
+ unsigned sz = 1U << heap->logGranularity;
+ unsigned i;
+
+ for (i = 0 ; (i+1) * sz <= heap->size ; i++) {
+ list[i].prev = i-1;
+ list[i].next = i+1;
+ list[i].age = 0;
+ }
+
+ i--;
+ list[0].prev = heap->nrRegions;
+ list[i].prev = i-1;
+ list[i].next = heap->nrRegions;
+ list[heap->nrRegions].prev = i;
+ list[heap->nrRegions].next = 0;
+ heap->global_age[0] = 0;
+}
+
+/**
+ * Print out debugging information about the local texture LRU.
+ *
+ * \param heap Texture heap to be printed
+ * \param callername Name of calling function
+ */
+static void printLocalLRU( driTexHeap * heap, const char *callername )
+{
+ driTextureObject *t;
+ unsigned sz = 1U << heap->logGranularity;
+
+ fprintf( stderr, "%s in %s:\nLocal LRU, heap %d:\n",
+ __FUNCTION__, callername, heap->heapId );
+
+ foreach ( t, &heap->texture_objects ) {
+ if (!t->memBlock)
+ continue;
+ if (!t->tObj) {
+ fprintf( stderr, "Placeholder (%p) %d at 0x%x sz 0x%x\n",
+ (void *)t,
+ t->memBlock->ofs / sz,
+ t->memBlock->ofs,
+ t->memBlock->size );
+ } else {
+ fprintf( stderr, "Texture (%p) at 0x%x sz 0x%x\n",
+ (void *)t,
+ t->memBlock->ofs,
+ t->memBlock->size );
+ }
+ }
+ foreach ( t, heap->swapped_objects ) {
+ if (!t->tObj) {
+ fprintf( stderr, "Swapped Placeholder (%p)\n", (void *)t );
+ } else {
+ fprintf( stderr, "Swapped Texture (%p)\n", (void *)t );
+ }
+ }
+
+ fprintf( stderr, "\n" );
+}
+
+/**
+ * Print out debugging information about the global texture LRU.
+ *
+ * \param heap Texture heap to be printed
+ * \param callername Name of calling function
+ */
+static void printGlobalLRU( driTexHeap * heap, const char *callername )
+{
+ drmTextureRegionPtr list = heap->global_regions;
+ unsigned int i, j;
+
+ fprintf( stderr, "%s in %s:\nGlobal LRU, heap %d list %p:\n",
+ __FUNCTION__, callername, heap->heapId, (void *)list );
+
+ for ( i = 0, j = heap->nrRegions ; i < heap->nrRegions ; i++ ) {
+ fprintf( stderr, "list[%d] age %d next %d prev %d in_use %d\n",
+ j, list[j].age, list[j].next, list[j].prev, list[j].in_use );
+ j = list[j].next;
+ if ( j == heap->nrRegions ) break;
+ }
+
+ if ( j != heap->nrRegions ) {
+ fprintf( stderr, "Loop detected in global LRU\n" );
+ for ( i = 0 ; i < heap->nrRegions ; i++ ) {
+ fprintf( stderr, "list[%d] age %d next %d prev %d in_use %d\n",
+ i, list[i].age, list[i].next, list[i].prev, list[i].in_use );
+ }
+ }
+
+ fprintf( stderr, "\n" );
+}
+
+
+/**
+ * Called by the client whenever it touches a local texture.
+ *
+ * \param t Texture object that the client has accessed
+ */
+
+void driUpdateTextureLRU( driTextureObject * t )
+{
+ driTexHeap * heap;
+ drmTextureRegionPtr list;
+ unsigned shift;
+ unsigned start;
+ unsigned end;
+ unsigned i;
+
+
+ heap = t->heap;
+ if ( heap != NULL ) {
+ shift = heap->logGranularity;
+ start = t->memBlock->ofs >> shift;
+ end = (t->memBlock->ofs + t->memBlock->size - 1) >> shift;
+
+
+ heap->local_age = ++heap->global_age[0];
+ list = heap->global_regions;
+
+
+ /* Update the context's local LRU
+ */
+
+ move_to_head( & heap->texture_objects, t );
+
+
+ for (i = start ; i <= end ; i++) {
+ list[i].age = heap->local_age;
+
+ /* remove_from_list(i)
+ */
+ list[(unsigned)list[i].next].prev = list[i].prev;
+ list[(unsigned)list[i].prev].next = list[i].next;
+
+ /* insert_at_head(list, i)
+ */
+ list[i].prev = heap->nrRegions;
+ list[i].next = list[heap->nrRegions].next;
+ list[(unsigned)list[heap->nrRegions].next].prev = i;
+ list[heap->nrRegions].next = i;
+ }
+
+ if ( 0 ) {
+ printGlobalLRU( heap, __FUNCTION__ );
+ printLocalLRU( heap, __FUNCTION__ );
+ }
+ }
+}
+
+
+
+
+/**
+ * Keep track of swapped out texture objects.
+ *
+ * \param t Texture object to be "swapped" out of its texture heap
+ */
+
+void driSwapOutTextureObject( driTextureObject * t )
+{
+ unsigned face;
+
+
+ if ( t->memBlock != NULL ) {
+ assert( t->heap != NULL );
+ mmFreeMem( t->memBlock );
+ t->memBlock = NULL;
+
+ if (t->timestamp > t->heap->timestamp)
+ t->heap->timestamp = t->timestamp;
+
+ t->heap->texture_swaps[0]++;
+ move_to_tail( t->heap->swapped_objects, t );
+ t->heap = NULL;
+ }
+ else {
+ assert( t->heap == NULL );
+ }
+
+
+ for ( face = 0 ; face < 6 ; face++ ) {
+ t->dirty_images[face] = ~0;
+ }
+}
+
+
+
+
+/**
+ * Destroy hardware state associated with texture \a t. Calls the
+ * \a destroy_texture_object method associated with the heap from which
+ * \a t was allocated.
+ *
+ * \param t Texture object to be destroyed
+ */
+
+void driDestroyTextureObject( driTextureObject * t )
+{
+ driTexHeap * heap;
+
+
+ if ( 0 ) {
+ fprintf( stderr, "[%s:%d] freeing %p (tObj = %p, DriverData = %p)\n",
+ __FILE__, __LINE__,
+ (void *)t,
+ (void *)((t != NULL) ? t->tObj : NULL),
+ (void *)((t != NULL && t->tObj != NULL) ? t->tObj->DriverData : NULL ));
+ }
+
+ if ( t != NULL ) {
+ if ( t->memBlock ) {
+ heap = t->heap;
+ assert( heap != NULL );
+
+ heap->texture_swaps[0]++;
+
+ mmFreeMem( t->memBlock );
+ t->memBlock = NULL;
+
+ if (t->timestamp > t->heap->timestamp)
+ t->heap->timestamp = t->timestamp;
+
+ heap->destroy_texture_object( heap->driverContext, t );
+ t->heap = NULL;
+ }
+
+ if ( t->tObj != NULL ) {
+ assert( t->tObj->DriverData == t );
+ t->tObj->DriverData = NULL;
+ }
+
+ remove_from_list( t );
+ FREE( t );
+ }
+
+ if ( 0 ) {
+ fprintf( stderr, "[%s:%d] done freeing %p\n", __FILE__, __LINE__, (void *)t );
+ }
+}
+
+
+
+
+/**
+ * Update the local heap's representation of texture memory based on
+ * data in the SAREA. This is done each time it is detected that some other
+ * direct rendering client has held the lock. This pertains to both our local
+ * textures and the textures belonging to other clients. Keep track of other
+ * client's textures by pushing a placeholder texture onto the LRU list --
+ * these are denoted by \a tObj being \a NULL.
+ *
+ * \param heap Heap whose state is to be updated
+ * \param offset Byte offset in the heap that has been stolen
+ * \param size Size, in bytes, of the stolen block
+ * \param in_use Non-zero if the block is pinned/reserved by the kernel
+ */
+
+static void driTexturesGone( driTexHeap * heap, int offset, int size,
+ int in_use )
+{
+ driTextureObject * t;
+ driTextureObject * tmp;
+
+
+ foreach_s ( t, tmp, & heap->texture_objects ) {
+ if ( (t->memBlock->ofs < (offset + size))
+ && ((t->memBlock->ofs + t->memBlock->size) > offset) ) {
+ /* It overlaps - kick it out. If the texture object is just a
+ * place holder, then destroy it all together. Otherwise, mark
+ * it as being swapped out.
+ */
+
+ if ( t->tObj != NULL ) {
+ driSwapOutTextureObject( t );
+ }
+ else {
+ driDestroyTextureObject( t );
+ }
+ }
+ }
+
+
+ {
+ t = (driTextureObject *) CALLOC( heap->texture_object_size );
+ if ( t == NULL ) return;
+
+ t->memBlock = mmAllocMem( heap->memory_heap, size, 0, offset );
+ if ( t->memBlock == NULL ) {
+ fprintf( stderr, "Couldn't alloc placeholder: heap %u sz %x ofs %x\n", heap->heapId,
+ (int)size, (int)offset );
+ mmDumpMemInfo( heap->memory_heap );
+ FREE(t);
+ return;
+ }
+ t->heap = heap;
+ if (in_use)
+ t->reserved = 1;
+ insert_at_head( & heap->texture_objects, t );
+ }
+}
+
+
+
+
+/**
+ * Called by the client on lock contention to determine whether textures have
+ * been stolen. If another client has modified a region in which we have
+ * textures, then we need to figure out which of our textures have been
+ * removed and update our global LRU.
+ *
+ * \param heap Texture heap to be updated
+ */
+
+void driAgeTextures( driTexHeap * heap )
+{
+ drmTextureRegionPtr list = heap->global_regions;
+ unsigned sz = 1U << (heap->logGranularity);
+ unsigned i, nr = 0;
+
+
+ /* Have to go right round from the back to ensure stuff ends up
+ * LRU in the local list... Fix with a cursor pointer.
+ */
+
+ for (i = list[heap->nrRegions].prev ;
+ i != heap->nrRegions && nr < heap->nrRegions ;
+ i = list[i].prev, nr++) {
+ /* If switching texturing schemes, then the SAREA might not have been
+ * properly cleared, so we need to reset the global texture LRU.
+ */
+
+ if ( (i * sz) > heap->size ) {
+ nr = heap->nrRegions;
+ break;
+ }
+
+ if (list[i].age > heap->local_age)
+ driTexturesGone( heap, i * sz, sz, list[i].in_use);
+ }
+
+ /* Loop or uninitialized heap detected. Reset.
+ */
+
+ if (nr == heap->nrRegions) {
+ driTexturesGone( heap, 0, heap->size, 0);
+ resetGlobalLRU( heap );
+ }
+
+ if ( 0 ) {
+ printGlobalLRU( heap, __FUNCTION__ );
+ printLocalLRU( heap, __FUNCTION__ );
+ }
+
+ heap->local_age = heap->global_age[0];
+}
+
+
+
+
+#define INDEX_ARRAY_SIZE 6 /* I'm not aware of driver with more than 2 heaps */
+
+/**
+ * Allocate memory from a texture heap to hold a texture object. This
+ * routine will attempt to allocate memory for the texture from the heaps
+ * specified by \c heap_array in order. That is, first it will try to
+ * allocate from \c heap_array[0], then \c heap_array[1], and so on.
+ *
+ * \param heap_array Array of pointers to texture heaps to use
+ * \param nr_heaps Number of heap pointer in \a heap_array
+ * \param t Texture object for which space is needed
+ * \return The ID of the heap from which memory was allocated, or -1 if
+ * memory could not be allocated.
+ *
+ * \bug The replacement policy implemented by this function is horrible.
+ */
+
+
+int
+driAllocateTexture( driTexHeap * const * heap_array, unsigned nr_heaps,
+ driTextureObject * t )
+{
+ driTexHeap * heap;
+ driTextureObject * temp;
+ driTextureObject * cursor;
+ unsigned id;
+
+
+ /* In case it already has texture space, initialize heap. This also
+ * prevents GCC from issuing a warning that heap might be used
+ * uninitialized.
+ */
+
+ heap = t->heap;
+
+
+ /* Run through each of the existing heaps and try to allocate a buffer
+ * to hold the texture.
+ */
+
+ for ( id = 0 ; (t->memBlock == NULL) && (id < nr_heaps) ; id++ ) {
+ heap = heap_array[ id ];
+ if ( heap != NULL ) {
+ t->memBlock = mmAllocMem( heap->memory_heap, t->totalSize,
+ heap->alignmentShift, 0 );
+ }
+ }
+
+
+ /* Kick textures out until the requested texture fits.
+ */
+
+ if ( t->memBlock == NULL ) {
+ unsigned index[INDEX_ARRAY_SIZE];
+ unsigned nrGoodHeaps = 0;
+
+ /* Trying to avoid dynamic memory allocation. If you have more
+ * heaps, increase INDEX_ARRAY_SIZE. I'm not aware of any
+ * drivers with more than 2 tex heaps. */
+ assert( nr_heaps < INDEX_ARRAY_SIZE );
+
+ /* Sort large enough heaps by duty. Insertion sort should be
+ * fast enough for such a short array. */
+ for ( id = 0 ; id < nr_heaps ; id++ ) {
+ heap = heap_array[ id ];
+
+ if ( heap != NULL && t->totalSize <= heap->size ) {
+ unsigned j;
+
+ for ( j = 0 ; j < nrGoodHeaps; j++ ) {
+ if ( heap->duty > heap_array[ index[ j ] ]->duty )
+ break;
+ }
+
+ if ( j < nrGoodHeaps ) {
+ memmove( &index[ j+1 ], &index[ j ],
+ sizeof(index[ 0 ]) * (nrGoodHeaps - j) );
+ }
+
+ index[ j ] = id;
+
+ nrGoodHeaps++;
+ }
+ }
+
+ for ( id = 0 ; (t->memBlock == NULL) && (id < nrGoodHeaps) ; id++ ) {
+ heap = heap_array[ index[ id ] ];
+
+ for ( cursor = heap->texture_objects.prev, temp = cursor->prev;
+ cursor != &heap->texture_objects ;
+ cursor = temp, temp = cursor->prev ) {
+
+ /* The the LRU element. If the texture is bound to one of
+ * the texture units, then we cannot kick it out.
+ */
+ if ( cursor->bound || cursor->reserved ) {
+ continue;
+ }
+
+ if ( cursor->memBlock )
+ heap->duty -= cursor->memBlock->size;
+
+ /* If this is a placeholder, there's no need to keep it */
+ if (cursor->tObj)
+ driSwapOutTextureObject( cursor );
+ else
+ driDestroyTextureObject( cursor );
+
+ t->memBlock = mmAllocMem( heap->memory_heap, t->totalSize,
+ heap->alignmentShift, 0 );
+
+ if (t->memBlock)
+ break;
+ }
+ }
+
+ /* Rebalance duties. If a heap kicked more data than its duty,
+ * then all other heaps get that amount multiplied with their
+ * relative weight added to their duty. The negative duty is
+ * reset to 0. In the end all heaps have a duty >= 0.
+ *
+ * CAUTION: we must not change the heap pointer here, because it
+ * is used below to update the texture object.
+ */
+ for ( id = 0 ; id < nr_heaps ; id++ )
+ if ( heap_array[ id ] != NULL && heap_array[ id ]->duty < 0) {
+ int duty = -heap_array[ id ]->duty;
+ double weight = heap_array[ id ]->weight;
+ unsigned j;
+
+ for ( j = 0 ; j < nr_heaps ; j++ )
+ if ( j != id && heap_array[ j ] != NULL ) {
+ heap_array[ j ]->duty += (double) duty *
+ heap_array[ j ]->weight / weight;
+ }
+
+ heap_array[ id ]->duty = 0;
+ }
+ }
+
+
+ if ( t->memBlock != NULL ) {
+ /* id and heap->heapId may or may not be the same value here.
+ */
+
+ assert( heap != NULL );
+ assert( (t->heap == NULL) || (t->heap == heap) );
+
+ t->heap = heap;
+ return heap->heapId;
+ }
+ else {
+ assert( t->heap == NULL );
+
+ fprintf( stderr, "[%s:%d] unable to allocate texture\n",
+ __FUNCTION__, __LINE__ );
+ return -1;
+ }
+}
+
+
+
+
+
+
+/**
+ * Set the location where the texture-swap counter is stored.
+ */
+
+void
+driSetTextureSwapCounterLocation( driTexHeap * heap, unsigned * counter )
+{
+ heap->texture_swaps = (counter == NULL) ? & dummy_swap_counter : counter;
+}
+
+
+
+
+/**
+ * Create a new heap for texture data.
+ *
+ * \param heap_id Device-dependent heap identifier. This value
+ * will returned by driAllocateTexture when memory
+ * is allocated from this heap.
+ * \param context Device-dependent driver context. This is
+ * supplied as the first parameter to the
+ * \c destroy_tex_obj function.
+ * \param size Size, in bytes, of the texture region
+ * \param alignmentShift Alignment requirement for textures. If textures
+ * must be allocated on a 4096 byte boundry, this
+ * would be 12.
+ * \param nr_regions Number of regions into which this texture space
+ * should be partitioned
+ * \param global_regions Array of \c drmTextureRegion structures in the SAREA
+ * \param global_age Pointer to the global texture age in the SAREA
+ * \param swapped_objects Pointer to the list of texture objects that are
+ * not in texture memory (i.e., have been swapped
+ * out).
+ * \param texture_object_size Size, in bytes, of a device-dependent texture
+ * object
+ * \param destroy_tex_obj Function used to destroy a device-dependent
+ * texture object
+ *
+ * \sa driDestroyTextureHeap
+ */
+
+driTexHeap *
+driCreateTextureHeap( unsigned heap_id, void * context, unsigned size,
+ unsigned alignmentShift, unsigned nr_regions,
+ drmTextureRegionPtr global_regions, unsigned * global_age,
+ driTextureObject * swapped_objects,
+ unsigned texture_object_size,
+ destroy_texture_object_t * destroy_tex_obj
+ )
+{
+ driTexHeap * heap;
+ unsigned l;
+
+
+ if ( 0 )
+ fprintf( stderr, "%s( %u, %p, %u, %u, %u )\n",
+ __FUNCTION__,
+ heap_id, (void *)context, size, alignmentShift, nr_regions );
+
+ heap = (driTexHeap *) CALLOC( sizeof( driTexHeap ) );
+ if ( heap != NULL ) {
+ l = driLog2( (size - 1) / nr_regions );
+ if ( l < alignmentShift )
+ {
+ l = alignmentShift;
+ }
+
+ heap->logGranularity = l;
+ heap->size = size & ~((1L << l) - 1);
+
+ heap->memory_heap = mmInit( 0, heap->size );
+ if ( heap->memory_heap != NULL ) {
+ heap->heapId = heap_id;
+ heap->driverContext = context;
+
+ heap->alignmentShift = alignmentShift;
+ heap->nrRegions = nr_regions;
+ heap->global_regions = global_regions;
+ heap->global_age = global_age;
+ heap->swapped_objects = swapped_objects;
+ heap->texture_object_size = texture_object_size;
+ heap->destroy_texture_object = destroy_tex_obj;
+
+ /* Force global heap init */
+ if (heap->global_age[0] == 0)
+ heap->local_age = ~0;
+ else
+ heap->local_age = 0;
+
+ make_empty_list( & heap->texture_objects );
+ driSetTextureSwapCounterLocation( heap, NULL );
+
+ heap->weight = heap->size;
+ heap->duty = 0;
+ }
+ else {
+ FREE( heap );
+ heap = NULL;
+ }
+ }
+
+
+ if ( 0 )
+ fprintf( stderr, "%s returning %p\n", __FUNCTION__, (void *)heap );
+
+ return heap;
+}
+
+
+
+
+/** Destroys a texture heap
+ *
+ * \param heap Texture heap to be destroyed
+ */
+
+void
+driDestroyTextureHeap( driTexHeap * heap )
+{
+ driTextureObject * t;
+ driTextureObject * temp;
+
+
+ if ( heap != NULL ) {
+ foreach_s( t, temp, & heap->texture_objects ) {
+ driDestroyTextureObject( t );
+ }
+ foreach_s( t, temp, heap->swapped_objects ) {
+ driDestroyTextureObject( t );
+ }
+
+ mmDestroy( heap->memory_heap );
+ FREE( heap );
+ }
+}
+
+
+
+
+/****************************************************************************/
+/**
+ * Determine how many texels (including all mipmap levels) would be required
+ * for a texture map of size \f$2^^\c base_size_log2\f$ would require.
+ *
+ * \param base_size_log2 \f$log_2\f$ of the size of a side of the texture
+ * \param dimensions Number of dimensions of the texture. Either 2 or 3.
+ * \param faces Number of faces of the texture. Either 1 or 6 (for cube maps).
+ * \return Number of texels
+ */
+
+static unsigned
+texels_this_map_size( int base_size_log2, unsigned dimensions, unsigned faces )
+{
+ unsigned texels;
+
+
+ assert( (faces == 1) || (faces == 6) );
+ assert( (dimensions == 2) || (dimensions == 3) );
+
+ texels = 0;
+ if ( base_size_log2 >= 0 ) {
+ texels = (1U << (dimensions * base_size_log2));
+
+ /* See http://www.mail-archive.com/dri-devel@lists.sourceforge.net/msg03636.html
+ * for the complete explaination of why this formulation is used.
+ * Basically, the smaller mipmap levels sum to 0.333 the size of the
+ * level 0 map. The total size is therefore the size of the map
+ * multipled by 1.333. The +2 is there to round up.
+ */
+
+ texels = (texels * 4 * faces + 2) / 3;
+ }
+
+ return texels;
+}
+
+
+
+
+struct maps_per_heap {
+ unsigned c[32];
+};
+
+static void
+fill_in_maximums( driTexHeap * const * heaps, unsigned nr_heaps,
+ unsigned max_bytes_per_texel, unsigned max_size,
+ unsigned mipmaps_at_once, unsigned dimensions,
+ unsigned faces, struct maps_per_heap * max_textures )
+{
+ unsigned heap;
+ unsigned log2_size;
+ unsigned mask;
+
+
+ /* Determine how many textures of each size can be stored in each
+ * texture heap.
+ */
+
+ for ( heap = 0 ; heap < nr_heaps ; heap++ ) {
+ if ( heaps[ heap ] == NULL ) {
+ (void) memset( max_textures[ heap ].c, 0,
+ sizeof( max_textures[ heap ].c ) );
+ continue;
+ }
+
+ mask = (1U << heaps[ heap ]->logGranularity) - 1;
+
+ if ( 0 ) {
+ fprintf( stderr, "[%s:%d] heap[%u] = %u bytes, mask = 0x%08x\n",
+ __FILE__, __LINE__,
+ heap, heaps[ heap ]->size, mask );
+ }
+
+ for ( log2_size = max_size ; log2_size > 0 ; log2_size-- ) {
+ unsigned total;
+
+
+ /* Determine the total number of bytes required by a texture of
+ * size log2_size.
+ */
+
+ total = texels_this_map_size( log2_size, dimensions, faces )
+ - texels_this_map_size( log2_size - mipmaps_at_once,
+ dimensions, faces );
+ total *= max_bytes_per_texel;
+ total = (total + mask) & ~mask;
+
+ /* The number of textures of a given size that will fit in a heap
+ * is equal to the size of the heap divided by the size of the
+ * texture.
+ */
+
+ max_textures[ heap ].c[ log2_size ] = heaps[ heap ]->size / total;
+
+ if ( 0 ) {
+ fprintf( stderr, "[%s:%d] max_textures[%u].c[%02u] "
+ "= 0x%08x / 0x%08x "
+ "= %u (%u)\n",
+ __FILE__, __LINE__,
+ heap, log2_size,
+ heaps[ heap ]->size, total,
+ heaps[ heap ]->size / total,
+ max_textures[ heap ].c[ log2_size ] );
+ }
+ }
+ }
+}
+
+
+static unsigned
+get_max_size( unsigned nr_heaps,
+ unsigned texture_units,
+ unsigned max_size,
+ int all_textures_one_heap,
+ struct maps_per_heap * max_textures )
+{
+ unsigned heap;
+ unsigned log2_size;
+
+
+ /* Determine the largest texture size such that a texture of that size
+ * can be bound to each texture unit at the same time. Some hardware
+ * may require that all textures be in the same texture heap for
+ * multitexturing.
+ */
+
+ for ( log2_size = max_size ; log2_size > 0 ; log2_size-- ) {
+ unsigned total = 0;
+
+ for ( heap = 0 ; heap < nr_heaps ; heap++ )
+ {
+ total += max_textures[ heap ].c[ log2_size ];
+
+ if ( 0 ) {
+ fprintf( stderr, "[%s:%d] max_textures[%u].c[%02u] = %u, "
+ "total = %u\n", __FILE__, __LINE__, heap, log2_size,
+ max_textures[ heap ].c[ log2_size ], total );
+ }
+
+ if ( (max_textures[ heap ].c[ log2_size ] >= texture_units)
+ || (!all_textures_one_heap && (total >= texture_units)) ) {
+ /* The number of mipmap levels is the log-base-2 of the
+ * maximum texture size plus 1. If the maximum texture size
+ * is 1x1, the log-base-2 is 0 and 1 mipmap level (the base
+ * level) is available.
+ */
+
+ return log2_size + 1;
+ }
+ }
+ }
+
+ /* This should NEVER happen. It should always be possible to have at
+ * *least* a 1x1 texture in memory!
+ */
+ assert( log2_size != 0 );
+ return 0;
+}
+
+#define SET_MAX(f,v) \
+ do { if ( max_sizes[v] != 0 ) { limits-> f = max_sizes[v]; } } while( 0 )
+
+#define SET_MAX_RECT(f,v) \
+ do { if ( max_sizes[v] != 0 ) { limits-> f = 1 << (max_sizes[v] - 1); } } while( 0 )
+
+
+/**
+ * Given the amount of texture memory, the number of texture units, and the
+ * maximum size of a texel, calculate the maximum texture size the driver can
+ * advertise.
+ *
+ * \param heaps Texture heaps for this card
+ * \param nr_heap Number of texture heaps
+ * \param limits OpenGL contants. MaxTextureUnits must be set.
+ * \param max_bytes_per_texel Maximum size of a single texel, in bytes
+ * \param max_2D_size \f$\log_2\f$ of the maximum 2D texture size (i.e.,
+ * 1024x1024 textures, this would be 10)
+ * \param max_3D_size \f$\log_2\f$ of the maximum 3D texture size (i.e.,
+ * 1024x1024x1024 textures, this would be 10)
+ * \param max_cube_size \f$\log_2\f$ of the maximum cube texture size (i.e.,
+ * 1024x1024 textures, this would be 10)
+ * \param max_rect_size \f$\log_2\f$ of the maximum texture rectangle size
+ * (i.e., 1024x1024 textures, this would be 10). This is a power-of-2
+ * even though texture rectangles need not be a power-of-2.
+ * \param mipmaps_at_once Total number of mipmaps that can be used
+ * at one time. For most hardware this will be \f$\c max_size + 1\f$.
+ * For hardware that does not support mipmapping, this will be 1.
+ * \param all_textures_one_heap True if the hardware requires that all
+ * textures be in a single texture heap for multitexturing.
+ * \param allow_larger_textures 0 conservative, 1 calculate limits
+ * so at least one worst-case texture can fit, 2 just use hw limits.
+ */
+
+void
+driCalculateMaxTextureLevels( driTexHeap * const * heaps,
+ unsigned nr_heaps,
+ struct gl_constants * limits,
+ unsigned max_bytes_per_texel,
+ unsigned max_2D_size,
+ unsigned max_3D_size,
+ unsigned max_cube_size,
+ unsigned max_rect_size,
+ unsigned mipmaps_at_once,
+ int all_textures_one_heap,
+ int allow_larger_textures )
+{
+ struct maps_per_heap max_textures[8];
+ unsigned i;
+ const unsigned dimensions[4] = { 2, 3, 2, 2 };
+ const unsigned faces[4] = { 1, 1, 6, 1 };
+ unsigned max_sizes[4];
+ unsigned mipmaps[4];
+
+
+ max_sizes[0] = max_2D_size;
+ max_sizes[1] = max_3D_size;
+ max_sizes[2] = max_cube_size;
+ max_sizes[3] = max_rect_size;
+
+ mipmaps[0] = mipmaps_at_once;
+ mipmaps[1] = mipmaps_at_once;
+ mipmaps[2] = mipmaps_at_once;
+ mipmaps[3] = 1;
+
+
+ /* Calculate the maximum number of texture levels in two passes. The
+ * first pass determines how many textures of each power-of-two size
+ * (including all mipmap levels for that size) can fit in each texture
+ * heap. The second pass finds the largest texture size that allows
+ * a texture of that size to be bound to every texture unit.
+ */
+
+ for ( i = 0 ; i < 4 ; i++ ) {
+ if ( (allow_larger_textures != 2) && (max_sizes[ i ] != 0) ) {
+ fill_in_maximums( heaps, nr_heaps, max_bytes_per_texel,
+ max_sizes[ i ], mipmaps[ i ],
+ dimensions[ i ], faces[ i ],
+ max_textures );
+
+ max_sizes[ i ] = get_max_size( nr_heaps,
+ allow_larger_textures == 1 ?
+ 1 : limits->MaxTextureUnits,
+ max_sizes[ i ],
+ all_textures_one_heap,
+ max_textures );
+ }
+ else if (max_sizes[ i ] != 0) {
+ max_sizes[ i ] += 1;
+ }
+ }
+
+ SET_MAX( MaxTextureLevels, 0 );
+ SET_MAX( Max3DTextureLevels, 1 );
+ SET_MAX( MaxCubeTextureLevels, 2 );
+ SET_MAX_RECT( MaxTextureRectSize, 3 );
+}
+
+
+
+
+/**
+ * Perform initial binding of default textures objects on a per unit, per
+ * texture target basis.
+ *
+ * \param ctx Current OpenGL context
+ * \param swapped List of swapped-out textures
+ * \param targets Bit-mask of value texture targets
+ */
+
+void driInitTextureObjects( struct gl_context *ctx, driTextureObject * swapped,
+ GLuint targets )
+{
+ struct gl_texture_object *texObj;
+ GLuint tmp = ctx->Texture.CurrentUnit;
+ unsigned i;
+
+
+ for ( i = 0 ; i < ctx->Const.MaxTextureUnits ; i++ ) {
+ ctx->Texture.CurrentUnit = i;
+
+ if ( (targets & DRI_TEXMGR_DO_TEXTURE_1D) != 0 ) {
+ texObj = ctx->Texture.Unit[i].CurrentTex[TEXTURE_1D_INDEX];
+ ctx->Driver.BindTexture( ctx, GL_TEXTURE_1D, texObj );
+ move_to_tail( swapped, (driTextureObject *) texObj->DriverData );
+ }
+
+ if ( (targets & DRI_TEXMGR_DO_TEXTURE_2D) != 0 ) {
+ texObj = ctx->Texture.Unit[i].CurrentTex[TEXTURE_2D_INDEX];
+ ctx->Driver.BindTexture( ctx, GL_TEXTURE_2D, texObj );
+ move_to_tail( swapped, (driTextureObject *) texObj->DriverData );
+ }
+
+ if ( (targets & DRI_TEXMGR_DO_TEXTURE_3D) != 0 ) {
+ texObj = ctx->Texture.Unit[i].CurrentTex[TEXTURE_3D_INDEX];
+ ctx->Driver.BindTexture( ctx, GL_TEXTURE_3D, texObj );
+ move_to_tail( swapped, (driTextureObject *) texObj->DriverData );
+ }
+
+ if ( (targets & DRI_TEXMGR_DO_TEXTURE_CUBE) != 0 ) {
+ texObj = ctx->Texture.Unit[i].CurrentTex[TEXTURE_CUBE_INDEX];
+ ctx->Driver.BindTexture( ctx, GL_TEXTURE_CUBE_MAP_ARB, texObj );
+ move_to_tail( swapped, (driTextureObject *) texObj->DriverData );
+ }
+
+ if ( (targets & DRI_TEXMGR_DO_TEXTURE_RECT) != 0 ) {
+ texObj = ctx->Texture.Unit[i].CurrentTex[TEXTURE_RECT_INDEX];
+ ctx->Driver.BindTexture( ctx, GL_TEXTURE_RECTANGLE_NV, texObj );
+ move_to_tail( swapped, (driTextureObject *) texObj->DriverData );
+ }
+ }
+
+ ctx->Texture.CurrentUnit = tmp;
+}
+
+
+
+
+/**
+ * Verify that the specified texture is in the specificed heap.
+ *
+ * \param tex Texture to be tested.
+ * \param heap Texture memory heap to be tested.
+ * \return True if the texture is in the heap, false otherwise.
+ */
+
+static GLboolean
+check_in_heap( const driTextureObject * tex, const driTexHeap * heap )
+{
+#if 1
+ return tex->heap == heap;
+#else
+ driTextureObject * curr;
+
+ foreach( curr, & heap->texture_objects ) {
+ if ( curr == tex ) {
+ break;
+ }
+ }
+
+ return curr == tex;
+#endif
+}
+
+
+
+/****************************************************************************/
+/**
+ * Validate the consistency of a set of texture heaps.
+ * Original version by Keith Whitwell in r200/r200_sanity.c.
+ */
+
+GLboolean
+driValidateTextureHeaps( driTexHeap * const * texture_heaps,
+ unsigned nr_heaps, const driTextureObject * swapped )
+{
+ driTextureObject *t;
+ unsigned i;
+
+ for ( i = 0 ; i < nr_heaps ; i++ ) {
+ int last_end = 0;
+ unsigned textures_in_heap = 0;
+ unsigned blocks_in_mempool = 0;
+ const driTexHeap * heap = texture_heaps[i];
+ const struct mem_block *p = heap->memory_heap;
+
+ /* Check each texture object has a MemBlock, and is linked into
+ * the correct heap.
+ *
+ * Check the texobj base address corresponds to the MemBlock
+ * range. Check the texobj size (recalculate?) fits within
+ * the MemBlock.
+ *
+ * Count the number of texobj's using this heap.
+ */
+
+ foreach ( t, &heap->texture_objects ) {
+ if ( !check_in_heap( t, heap ) ) {
+ fprintf( stderr, "%s memory block for texture object @ %p not "
+ "found in heap #%d\n",
+ __FUNCTION__, (void *)t, i );
+ return GL_FALSE;
+ }
+
+
+ if ( t->totalSize > t->memBlock->size ) {
+ fprintf( stderr, "%s: Memory block for texture object @ %p is "
+ "only %u bytes, but %u are required\n",
+ __FUNCTION__, (void *)t, t->totalSize, t->memBlock->size );
+ return GL_FALSE;
+ }
+
+ textures_in_heap++;
+ }
+
+ /* Validate the contents of the heap:
+ * - Ordering
+ * - Overlaps
+ * - Bounds
+ */
+
+ while ( p != NULL ) {
+ if (p->reserved) {
+ fprintf( stderr, "%s: Block (%08x,%x), is reserved?!\n",
+ __FUNCTION__, p->ofs, p->size );
+ return GL_FALSE;
+ }
+
+ if (p->ofs != last_end) {
+ fprintf( stderr, "%s: blocks_in_mempool = %d, last_end = %d, p->ofs = %d\n",
+ __FUNCTION__, blocks_in_mempool, last_end, p->ofs );
+ return GL_FALSE;
+ }
+
+ if (!p->reserved && !p->free) {
+ blocks_in_mempool++;
+ }
+
+ last_end = p->ofs + p->size;
+ p = p->next;
+ }
+
+ if (textures_in_heap != blocks_in_mempool) {
+ fprintf( stderr, "%s: Different number of textures objects (%u) and "
+ "inuse memory blocks (%u)\n",
+ __FUNCTION__, textures_in_heap, blocks_in_mempool );
+ return GL_FALSE;
+ }
+
+#if 0
+ fprintf( stderr, "%s: textures_in_heap = %u\n",
+ __FUNCTION__, textures_in_heap );
+#endif
+ }
+
+
+ /* Check swapped texobj's have zero memblocks
+ */
+ i = 0;
+ foreach ( t, swapped ) {
+ if ( t->memBlock != NULL ) {
+ fprintf( stderr, "%s: Swapped texobj %p has non-NULL memblock %p\n",
+ __FUNCTION__, (void *)t, (void *)t->memBlock );
+ return GL_FALSE;
+ }
+ i++;
+ }
+
+#if 0
+ fprintf( stderr, "%s: swapped texture count = %u\n", __FUNCTION__, i );
+#endif
+
+ return GL_TRUE;
+}
+
+
+
+
+/****************************************************************************/
+/**
+ * Compute which mipmap levels that really need to be sent to the hardware.
+ * This depends on the base image size, GL_TEXTURE_MIN_LOD,
+ * GL_TEXTURE_MAX_LOD, GL_TEXTURE_BASE_LEVEL, and GL_TEXTURE_MAX_LEVEL.
+ */
+
+void
+driCalculateTextureFirstLastLevel( driTextureObject * t )
+{
+ struct gl_texture_object * const tObj = t->tObj;
+ const struct gl_texture_image * const baseImage =
+ tObj->Image[0][tObj->BaseLevel];
+
+ /* These must be signed values. MinLod and MaxLod can be negative numbers,
+ * and having firstLevel and lastLevel as signed prevents the need for
+ * extra sign checks.
+ */
+ int firstLevel;
+ int lastLevel;
+
+ /* Yes, this looks overly complicated, but it's all needed.
+ */
+
+ switch (tObj->Target) {
+ case GL_TEXTURE_1D:
+ case GL_TEXTURE_2D:
+ case GL_TEXTURE_3D:
+ case GL_TEXTURE_CUBE_MAP:
+ if (tObj->Sampler.MinFilter == GL_NEAREST ||
+ tObj->Sampler.MinFilter == GL_LINEAR) {
+ /* GL_NEAREST and GL_LINEAR only care about GL_TEXTURE_BASE_LEVEL.
+ */
+
+ firstLevel = lastLevel = tObj->BaseLevel;
+ }
+ else {
+ firstLevel = tObj->BaseLevel + (GLint)(tObj->Sampler.MinLod + 0.5);
+ firstLevel = MAX2(firstLevel, tObj->BaseLevel);
+ firstLevel = MIN2(firstLevel, tObj->BaseLevel + baseImage->MaxLog2);
+ lastLevel = tObj->BaseLevel + (GLint)(tObj->Sampler.MaxLod + 0.5);
+ lastLevel = MAX2(lastLevel, t->tObj->BaseLevel);
+ lastLevel = MIN2(lastLevel, t->tObj->BaseLevel + baseImage->MaxLog2);
+ lastLevel = MIN2(lastLevel, t->tObj->MaxLevel);
+ lastLevel = MAX2(firstLevel, lastLevel); /* need at least one level */
+ }
+ break;
+ case GL_TEXTURE_RECTANGLE_NV:
+ case GL_TEXTURE_4D_SGIS:
+ firstLevel = lastLevel = 0;
+ break;
+ default:
+ return;
+ }
+
+ /* save these values */
+ t->firstLevel = firstLevel;
+ t->lastLevel = lastLevel;
+}
+
+
+
+
+/**
+ * \name DRI texture formats. These vars are initialized to either the
+ * big- or little-endian Mesa formats.
+ */
+/*@{*/
+gl_format _dri_texformat_rgba8888 = MESA_FORMAT_NONE;
+gl_format _dri_texformat_argb8888 = MESA_FORMAT_NONE;
+gl_format _dri_texformat_rgb565 = MESA_FORMAT_NONE;
+gl_format _dri_texformat_argb4444 = MESA_FORMAT_NONE;
+gl_format _dri_texformat_argb1555 = MESA_FORMAT_NONE;
+gl_format _dri_texformat_al88 = MESA_FORMAT_NONE;
+gl_format _dri_texformat_a8 = MESA_FORMAT_A8;
+gl_format _dri_texformat_ci8 = MESA_FORMAT_CI8;
+gl_format _dri_texformat_i8 = MESA_FORMAT_I8;
+gl_format _dri_texformat_l8 = MESA_FORMAT_L8;
+/*@}*/
+
+
+/**
+ * Initialize _dri_texformat_* vars according to whether we're on
+ * a big or little endian system.
+ */
+void
+driInitTextureFormats(void)
+{
+ if (_mesa_little_endian()) {
+ _dri_texformat_rgba8888 = MESA_FORMAT_RGBA8888;
+ _dri_texformat_argb8888 = MESA_FORMAT_ARGB8888;
+ _dri_texformat_rgb565 = MESA_FORMAT_RGB565;
+ _dri_texformat_argb4444 = MESA_FORMAT_ARGB4444;
+ _dri_texformat_argb1555 = MESA_FORMAT_ARGB1555;
+ _dri_texformat_al88 = MESA_FORMAT_AL88;
+ }
+ else {
+ _dri_texformat_rgba8888 = MESA_FORMAT_RGBA8888_REV;
+ _dri_texformat_argb8888 = MESA_FORMAT_ARGB8888_REV;
+ _dri_texformat_rgb565 = MESA_FORMAT_RGB565_REV;
+ _dri_texformat_argb4444 = MESA_FORMAT_ARGB4444_REV;
+ _dri_texformat_argb1555 = MESA_FORMAT_ARGB1555_REV;
+ _dri_texformat_al88 = MESA_FORMAT_AL88_REV;
+ }
+}
diff --git a/mesalib/src/mesa/drivers/dri/common/utils.c b/mesalib/src/mesa/drivers/dri/common/utils.c
index 539296d1a..2df2386ff 100644
--- a/mesalib/src/mesa/drivers/dri/common/utils.c
+++ b/mesalib/src/mesa/drivers/dri/common/utils.c
@@ -218,7 +218,9 @@ void driInitExtensions( struct gl_context * ctx,
/* Map the static functions. Together with those mapped by remap
* table, this should cover everything mesa core knows.
*/
+#ifdef _GLAPI_USE_REMAP_TABLE
_mesa_map_static_functions();
+#endif
return;
}
diff --git a/mesalib/src/mesa/drivers/dri/swrast/swrast.c b/mesalib/src/mesa/drivers/dri/swrast/swrast.c
index 719b406ec..e6d1ab741 100644
--- a/mesalib/src/mesa/drivers/dri/swrast/swrast.c
+++ b/mesalib/src/mesa/drivers/dri/swrast/swrast.c
@@ -1,806 +1,811 @@
-/*
- * Copyright 2008, 2010 George Sapountzis <gsapountzis@gmail.com>
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-/*
- * DRI software rasterizer
- *
- * This is the mesa swrast module packaged into a DRI driver structure.
- *
- * The front-buffer is allocated by the loader. The loader provides read/write
- * callbacks for access to the front-buffer. The driver uses a scratch row for
- * front-buffer rendering to avoid repeated calls to the loader.
- *
- * The back-buffer is allocated by the driver and is private.
- */
-
-#include "main/context.h"
-#include "main/extensions.h"
-#include "main/formats.h"
-#include "main/framebuffer.h"
-#include "main/imports.h"
-#include "main/renderbuffer.h"
-#include "swrast/swrast.h"
-#include "swrast_setup/swrast_setup.h"
-#include "tnl/tnl.h"
-#include "tnl/t_context.h"
-#include "tnl/t_pipeline.h"
-#include "vbo/vbo.h"
-#include "drivers/common/driverfuncs.h"
-#include "drivers/common/meta.h"
-#include "utils.h"
-
-#include "main/teximage.h"
-#include "main/texformat.h"
-#include "main/texstate.h"
-
-#include "swrast_priv.h"
-
-
-/**
- * Screen and config-related functions
- */
-
-static void swrastSetTexBuffer2(__DRIcontext *pDRICtx, GLint target,
- GLint texture_format, __DRIdrawable *dPriv)
-{
- struct dri_context *dri_ctx;
- int x, y, w, h;
- __DRIscreen *sPriv = dPriv->driScreenPriv;
- struct gl_texture_unit *texUnit;
- struct gl_texture_object *texObj;
- struct gl_texture_image *texImage;
- uint32_t internalFormat;
- gl_format texFormat;
-
- dri_ctx = pDRICtx->driverPrivate;
-
- internalFormat = (texture_format == __DRI_TEXTURE_FORMAT_RGB ? 3 : 4);
-
- texUnit = _mesa_get_current_tex_unit(&dri_ctx->Base);
- texObj = _mesa_select_tex_object(&dri_ctx->Base, texUnit, target);
- texImage = _mesa_get_tex_image(&dri_ctx->Base, texObj, target, 0);
-
- _mesa_lock_texture(&dri_ctx->Base, texObj);
-
- sPriv->swrast_loader->getDrawableInfo(dPriv, &x, &y, &w, &h, dPriv->loaderPrivate);
-
- if (texture_format == __DRI_TEXTURE_FORMAT_RGB)
- texFormat = MESA_FORMAT_XRGB8888;
- else
- texFormat = MESA_FORMAT_ARGB8888;
-
- _mesa_init_teximage_fields(&dri_ctx->Base, target, texImage,
- w, h, 1, 0, internalFormat, texFormat);
-
- sPriv->swrast_loader->getImage(dPriv, x, y, w, h, (char *)texImage->Data,
- dPriv->loaderPrivate);
-
- _mesa_unlock_texture(&dri_ctx->Base, texObj);
-}
-
-static void swrastSetTexBuffer(__DRIcontext *pDRICtx, GLint target,
- __DRIdrawable *dPriv)
-{
- swrastSetTexBuffer2(pDRICtx, target, __DRI_TEXTURE_FORMAT_RGBA, dPriv);
-}
-
-static const __DRItexBufferExtension swrastTexBufferExtension = {
- { __DRI_TEX_BUFFER, __DRI_TEX_BUFFER_VERSION },
- swrastSetTexBuffer,
- swrastSetTexBuffer2,
-};
-
-static const __DRIextension *dri_screen_extensions[] = {
- &swrastTexBufferExtension.base,
- NULL
-};
-
-static __DRIconfig **
-swrastFillInModes(__DRIscreen *psp,
- unsigned pixel_bits, unsigned depth_bits,
- unsigned stencil_bits, GLboolean have_back_buffer)
-{
- __DRIconfig **configs;
- unsigned depth_buffer_factor;
- unsigned back_buffer_factor;
- GLenum fb_format;
- GLenum fb_type;
-
- /* GLX_SWAP_COPY_OML is only supported because the Intel driver doesn't
- * support pageflipping at all.
- */
- static const GLenum back_buffer_modes[] = {
- GLX_NONE, GLX_SWAP_UNDEFINED_OML
- };
-
- uint8_t depth_bits_array[4];
- uint8_t stencil_bits_array[4];
- uint8_t msaa_samples_array[1];
-
- depth_bits_array[0] = 0;
- depth_bits_array[1] = 0;
- depth_bits_array[2] = depth_bits;
- depth_bits_array[3] = depth_bits;
-
- /* Just like with the accumulation buffer, always provide some modes
- * with a stencil buffer.
- */
- stencil_bits_array[0] = 0;
- stencil_bits_array[1] = (stencil_bits == 0) ? 8 : stencil_bits;
- stencil_bits_array[2] = 0;
- stencil_bits_array[3] = (stencil_bits == 0) ? 8 : stencil_bits;
-
- msaa_samples_array[0] = 0;
-
- depth_buffer_factor = 4;
- back_buffer_factor = 2;
-
- switch (pixel_bits) {
- case 8:
- fb_format = GL_RGB;
- fb_type = GL_UNSIGNED_BYTE_2_3_3_REV;
- break;
- case 16:
- fb_format = GL_RGB;
- fb_type = GL_UNSIGNED_SHORT_5_6_5;
- break;
- case 24:
- fb_format = GL_BGR;
- fb_type = GL_UNSIGNED_INT_8_8_8_8_REV;
- break;
- case 32:
- fb_format = GL_BGRA;
- fb_type = GL_UNSIGNED_INT_8_8_8_8_REV;
- break;
- default:
- fprintf(stderr, "[%s:%u] bad depth %d\n", __func__, __LINE__,
- pixel_bits);
- return NULL;
- }
-
- configs = driCreateConfigs(fb_format, fb_type,
- depth_bits_array, stencil_bits_array,
- depth_buffer_factor, back_buffer_modes,
- back_buffer_factor, msaa_samples_array, 1,
- GL_TRUE);
- if (configs == NULL) {
- fprintf(stderr, "[%s:%u] Error creating FBConfig!\n", __func__,
- __LINE__);
- return NULL;
- }
-
- return configs;
-}
-
-static const __DRIconfig **
-dri_init_screen(__DRIscreen * psp)
-{
- __DRIconfig **configs8, **configs16, **configs24, **configs32;
-
- TRACE;
-
- psp->extensions = dri_screen_extensions;
-
- configs8 = swrastFillInModes(psp, 8, 8, 0, 1);
- configs16 = swrastFillInModes(psp, 16, 16, 0, 1);
- configs24 = swrastFillInModes(psp, 24, 24, 8, 1);
- configs32 = swrastFillInModes(psp, 32, 24, 8, 1);
-
- configs16 = driConcatConfigs(configs8, configs16);
- configs24 = driConcatConfigs(configs16, configs24);
- configs32 = driConcatConfigs(configs24, configs32);
-
- return (const __DRIconfig **)configs32;
-}
-
-static void
-dri_destroy_screen(__DRIscreen * sPriv)
-{
- TRACE;
-}
-
-
-/**
- * Framebuffer and renderbuffer-related functions.
- */
-
-static GLuint
-choose_pixel_format(const struct gl_config *v)
-{
- int depth = v->rgbBits;
-
- if (depth == 32
- && v->redMask == 0xff0000
- && v->greenMask == 0x00ff00
- && v->blueMask == 0x0000ff)
- return PF_A8R8G8B8;
- else if (depth == 24
- && v->redMask == 0xff0000
- && v->greenMask == 0x00ff00
- && v->blueMask == 0x0000ff)
- return PF_X8R8G8B8;
- else if (depth == 16
- && v->redMask == 0xf800
- && v->greenMask == 0x07e0
- && v->blueMask == 0x001f)
- return PF_R5G6B5;
- else if (depth == 8
- && v->redMask == 0x07
- && v->greenMask == 0x38
- && v->blueMask == 0xc0)
- return PF_R3G3B2;
-
- _mesa_problem( NULL, "unexpected format in %s", __FUNCTION__ );
- return 0;
-}
-
-static void
-swrast_delete_renderbuffer(struct gl_renderbuffer *rb)
-{
- TRACE;
-
- free(rb->Data);
- free(rb);
-}
-
-/* see bytes_per_line in libGL */
-static INLINE int
-bytes_per_line(unsigned pitch_bits, unsigned mul)
-{
- unsigned mask = mul - 1;
-
- return ((pitch_bits + mask) & ~mask) / 8;
-}
-
-static GLboolean
-swrast_alloc_front_storage(struct gl_context *ctx, struct gl_renderbuffer *rb,
- GLenum internalFormat, GLuint width, GLuint height)
-{
- struct swrast_renderbuffer *xrb = swrast_renderbuffer(rb);
-
- TRACE;
-
- rb->Data = NULL;
- rb->Width = width;
- rb->Height = height;
-
- xrb->pitch = bytes_per_line(width * xrb->bpp, 32);
-
- return GL_TRUE;
-}
-
-static GLboolean
-swrast_alloc_back_storage(struct gl_context *ctx, struct gl_renderbuffer *rb,
- GLenum internalFormat, GLuint width, GLuint height)
-{
- struct swrast_renderbuffer *xrb = swrast_renderbuffer(rb);
-
- TRACE;
-
- free(rb->Data);
-
- swrast_alloc_front_storage(ctx, rb, internalFormat, width, height);
-
- rb->Data = malloc(height * xrb->pitch);
-
- return GL_TRUE;
-}
-
-static struct swrast_renderbuffer *
-swrast_new_renderbuffer(const struct gl_config *visual, GLboolean front)
-{
- struct swrast_renderbuffer *xrb = calloc(1, sizeof *xrb);
- GLuint pixel_format;
-
- TRACE;
-
- if (!xrb)
- return NULL;
-
- _mesa_init_renderbuffer(&xrb->Base, 0);
-
- pixel_format = choose_pixel_format(visual);
-
- xrb->Base.Delete = swrast_delete_renderbuffer;
- if (front) {
- xrb->Base.AllocStorage = swrast_alloc_front_storage;
- swrast_set_span_funcs_front(xrb, pixel_format);
- }
- else {
- xrb->Base.AllocStorage = swrast_alloc_back_storage;
- swrast_set_span_funcs_back(xrb, pixel_format);
- }
-
- switch (pixel_format) {
- case PF_A8R8G8B8:
- xrb->Base.Format = MESA_FORMAT_ARGB8888;
- xrb->Base.InternalFormat = GL_RGBA;
- xrb->Base._BaseFormat = GL_RGBA;
- xrb->Base.DataType = GL_UNSIGNED_BYTE;
- xrb->bpp = 32;
- break;
- case PF_X8R8G8B8:
- xrb->Base.Format = MESA_FORMAT_ARGB8888; /* XXX */
- xrb->Base.InternalFormat = GL_RGB;
- xrb->Base._BaseFormat = GL_RGB;
- xrb->Base.DataType = GL_UNSIGNED_BYTE;
- xrb->bpp = 32;
- break;
- case PF_R5G6B5:
- xrb->Base.Format = MESA_FORMAT_RGB565;
- xrb->Base.InternalFormat = GL_RGB;
- xrb->Base._BaseFormat = GL_RGB;
- xrb->Base.DataType = GL_UNSIGNED_BYTE;
- xrb->bpp = 16;
- break;
- case PF_R3G3B2:
- xrb->Base.Format = MESA_FORMAT_RGB332;
- xrb->Base.InternalFormat = GL_RGB;
- xrb->Base._BaseFormat = GL_RGB;
- xrb->Base.DataType = GL_UNSIGNED_BYTE;
- xrb->bpp = 8;
- break;
- default:
- return NULL;
- }
-
- return xrb;
-}
-
-static GLboolean
-dri_create_buffer(__DRIscreen * sPriv,
- __DRIdrawable * dPriv,
- const struct gl_config * visual, GLboolean isPixmap)
-{
- struct dri_drawable *drawable = NULL;
- struct gl_framebuffer *fb;
- struct swrast_renderbuffer *frontrb, *backrb;
-
- TRACE;
-
- drawable = CALLOC_STRUCT(dri_drawable);
- if (drawable == NULL)
- goto drawable_fail;
-
- dPriv->driverPrivate = drawable;
- drawable->dPriv = dPriv;
-
- drawable->row = malloc(MAX_WIDTH * 4);
- if (drawable->row == NULL)
- goto drawable_fail;
-
- fb = &drawable->Base;
-
- /* basic framebuffer setup */
- _mesa_initialize_window_framebuffer(fb, visual);
-
- /* add front renderbuffer */
- frontrb = swrast_new_renderbuffer(visual, GL_TRUE);
- _mesa_add_renderbuffer(fb, BUFFER_FRONT_LEFT, &frontrb->Base);
-
- /* add back renderbuffer */
- if (visual->doubleBufferMode) {
- backrb = swrast_new_renderbuffer(visual, GL_FALSE);
- _mesa_add_renderbuffer(fb, BUFFER_BACK_LEFT, &backrb->Base);
- }
-
- /* add software renderbuffers */
- _mesa_add_soft_renderbuffers(fb,
- GL_FALSE, /* color */
- visual->haveDepthBuffer,
- visual->haveStencilBuffer,
- visual->haveAccumBuffer,
- GL_FALSE, /* alpha */
- GL_FALSE /* aux bufs */);
-
- return GL_TRUE;
-
-drawable_fail:
-
- if (drawable)
- free(drawable->row);
-
- FREE(drawable);
-
- return GL_FALSE;
-}
-
-static void
-dri_destroy_buffer(__DRIdrawable * dPriv)
-{
- TRACE;
-
- if (dPriv) {
- struct dri_drawable *drawable = dri_drawable(dPriv);
- struct gl_framebuffer *fb;
-
- free(drawable->row);
-
- fb = &drawable->Base;
-
- fb->DeletePending = GL_TRUE;
- _mesa_reference_framebuffer(&fb, NULL);
- }
-}
-
-static void
-dri_swap_buffers(__DRIdrawable * dPriv)
-{
- __DRIscreen *sPriv = dPriv->driScreenPriv;
-
- GET_CURRENT_CONTEXT(ctx);
-
- struct dri_drawable *drawable = dri_drawable(dPriv);
- struct gl_framebuffer *fb;
- struct swrast_renderbuffer *frontrb, *backrb;
-
- TRACE;
-
- fb = &drawable->Base;
-
- frontrb =
- swrast_renderbuffer(fb->Attachment[BUFFER_FRONT_LEFT].Renderbuffer);
- backrb =
- swrast_renderbuffer(fb->Attachment[BUFFER_BACK_LEFT].Renderbuffer);
-
- /* check for signle-buffered */
- if (backrb == NULL)
- return;
-
- /* check if swapping currently bound buffer */
- if (ctx && ctx->DrawBuffer == fb) {
- /* flush pending rendering */
- _mesa_notifySwapBuffers(ctx);
- }
-
- sPriv->swrast_loader->putImage(dPriv, __DRI_SWRAST_IMAGE_OP_SWAP,
- 0, 0,
- frontrb->Base.Width,
- frontrb->Base.Height,
- backrb->Base.Data,
- dPriv->loaderPrivate);
-}
-
-
-/**
- * General device driver functions.
- */
-
-static void
-get_window_size( struct gl_framebuffer *fb, GLsizei *w, GLsizei *h )
-{
- __DRIdrawable *dPriv = swrast_drawable(fb)->dPriv;
- __DRIscreen *sPriv = dPriv->driScreenPriv;
- int x, y;
-
- sPriv->swrast_loader->getDrawableInfo(dPriv,
- &x, &y, w, h,
- dPriv->loaderPrivate);
-}
-
-static void
-swrast_check_and_update_window_size( struct gl_context *ctx, struct gl_framebuffer *fb )
-{
- GLsizei width, height;
-
- get_window_size(fb, &width, &height);
- if (fb->Width != width || fb->Height != height) {
- _mesa_resize_framebuffer(ctx, fb, width, height);
- }
-}
-
-static const GLubyte *
-get_string(struct gl_context *ctx, GLenum pname)
-{
- (void) ctx;
- switch (pname) {
- case GL_VENDOR:
- return (const GLubyte *) "Mesa Project";
- case GL_RENDERER:
- return (const GLubyte *) "Software Rasterizer";
- default:
- return NULL;
- }
-}
-
-static void
-update_state( struct gl_context *ctx, GLuint new_state )
-{
- /* not much to do here - pass it on */
- _swrast_InvalidateState( ctx, new_state );
- _swsetup_InvalidateState( ctx, new_state );
- _vbo_InvalidateState( ctx, new_state );
- _tnl_InvalidateState( ctx, new_state );
-}
-
-static void
-viewport(struct gl_context *ctx, GLint x, GLint y, GLsizei w, GLsizei h)
-{
- struct gl_framebuffer *draw = ctx->WinSysDrawBuffer;
- struct gl_framebuffer *read = ctx->WinSysReadBuffer;
-
- swrast_check_and_update_window_size(ctx, draw);
- swrast_check_and_update_window_size(ctx, read);
-}
-
-static gl_format swrastChooseTextureFormat(struct gl_context * ctx,
- GLint internalFormat,
- GLenum format,
- GLenum type)
-{
- if (internalFormat == GL_RGB)
- return MESA_FORMAT_XRGB8888;
- return _mesa_choose_tex_format(ctx, internalFormat, format, type);
-}
-
-static void
-swrast_init_driver_functions(struct dd_function_table *driver)
-{
- driver->GetString = get_string;
- driver->UpdateState = update_state;
- driver->GetBufferSize = NULL;
- driver->Viewport = viewport;
- driver->ChooseTextureFormat = swrastChooseTextureFormat;
-}
-
-static const char *es2_extensions[] = {
- /* Used by mesa internally (cf all_mesa_extensions in ../common/utils.c) */
- "GL_ARB_draw_buffers",
- "GL_ARB_multisample",
- "GL_ARB_texture_compression",
- "GL_ARB_transpose_matrix",
- "GL_ARB_vertex_buffer_object",
- "GL_ARB_window_pos",
- "GL_EXT_blend_func_separate",
- "GL_EXT_compiled_vertex_array",
- "GL_EXT_framebuffer_blit",
- "GL_EXT_multi_draw_arrays",
- "GL_EXT_polygon_offset",
- "GL_EXT_texture_object",
- "GL_EXT_vertex_array",
- "GL_IBM_multimode_draw_arrays",
- "GL_MESA_window_pos",
- "GL_NV_vertex_program",
-
- /* Required by GLES2 */
- "GL_ARB_fragment_program",
- "GL_ARB_fragment_shader",
- "GL_ARB_multitexture",
- "GL_ARB_shader_objects",
- "GL_ARB_texture_cube_map",
- "GL_ARB_texture_mirrored_repeat",
- "GL_ARB_texture_non_power_of_two",
- "GL_ARB_vertex_shader",
- "GL_EXT_blend_color",
- "GL_EXT_blend_equation_separate",
- "GL_EXT_blend_minmax",
- "GL_EXT_blend_subtract",
- "GL_EXT_stencil_wrap",
-
- /* Optional GLES2 */
- "GL_ARB_framebuffer_object",
- "GL_EXT_texture_filter_anisotropic",
- "GL_ARB_depth_texture",
- "GL_EXT_packed_depth_stencil",
- "GL_EXT_framebuffer_object",
- NULL,
-};
-
-static void
-InitExtensionsES2(struct gl_context *ctx)
-{
- int i;
-
- /* Can't use driInitExtensions() since it uses extensions from
- * main/remap_helper.h when called the first time. */
-
- for (i = 0; es2_extensions[i]; i++)
- _mesa_enable_extension(ctx, es2_extensions[i]);
-}
-
-/**
- * Context-related functions.
- */
-
-static GLboolean
-dri_create_context(gl_api api,
- const struct gl_config * visual,
- __DRIcontext * cPriv, void *sharedContextPrivate)
-{
- struct dri_context *ctx = NULL;
- struct dri_context *share = (struct dri_context *)sharedContextPrivate;
- struct gl_context *mesaCtx = NULL;
- struct gl_context *sharedCtx = NULL;
- struct dd_function_table functions;
-
- TRACE;
-
- ctx = CALLOC_STRUCT(dri_context);
- if (ctx == NULL)
- goto context_fail;
-
- cPriv->driverPrivate = ctx;
- ctx->cPriv = cPriv;
-
- /* build table of device driver functions */
- _mesa_init_driver_functions(&functions);
- swrast_init_driver_functions(&functions);
-
- if (share) {
- sharedCtx = &share->Base;
- }
-
- mesaCtx = &ctx->Base;
-
- /* basic context setup */
- if (!_mesa_initialize_context(mesaCtx, api, visual, sharedCtx, &functions, (void *) cPriv)) {
- goto context_fail;
- }
-
- /* do bounds checking to prevent segfaults and server crashes! */
- mesaCtx->Const.CheckArrayBounds = GL_TRUE;
-
- /* create module contexts */
- _swrast_CreateContext( mesaCtx );
- _vbo_CreateContext( mesaCtx );
- _tnl_CreateContext( mesaCtx );
- _swsetup_CreateContext( mesaCtx );
- _swsetup_Wakeup( mesaCtx );
-
- /* use default TCL pipeline */
- {
- TNLcontext *tnl = TNL_CONTEXT(mesaCtx);
- tnl->Driver.RunPipeline = _tnl_run_pipeline;
- }
-
- _mesa_meta_init(mesaCtx);
- _mesa_enable_sw_extensions(mesaCtx);
-
- switch (api) {
- case API_OPENGL:
- _mesa_enable_1_3_extensions(mesaCtx);
- _mesa_enable_1_4_extensions(mesaCtx);
- _mesa_enable_1_5_extensions(mesaCtx);
- _mesa_enable_2_0_extensions(mesaCtx);
- _mesa_enable_2_1_extensions(mesaCtx);
-
- driInitExtensions( mesaCtx, NULL, GL_FALSE );
- break;
- case API_OPENGLES:
- _mesa_enable_1_3_extensions(mesaCtx);
- _mesa_enable_1_4_extensions(mesaCtx);
- _mesa_enable_1_5_extensions(mesaCtx);
-
- break;
- case API_OPENGLES2:
- InitExtensionsES2( mesaCtx);
- break;
- }
-
- return GL_TRUE;
-
-context_fail:
-
- FREE(ctx);
-
- return GL_FALSE;
-}
-
-static void
-dri_destroy_context(__DRIcontext * cPriv)
-{
- TRACE;
-
- if (cPriv) {
- struct dri_context *ctx = dri_context(cPriv);
- struct gl_context *mesaCtx;
-
- mesaCtx = &ctx->Base;
-
- _mesa_meta_free(mesaCtx);
- _swsetup_DestroyContext( mesaCtx );
- _swrast_DestroyContext( mesaCtx );
- _tnl_DestroyContext( mesaCtx );
- _vbo_DestroyContext( mesaCtx );
- _mesa_destroy_context( mesaCtx );
- }
-}
-
-static GLboolean
-dri_make_current(__DRIcontext * cPriv,
- __DRIdrawable * driDrawPriv,
- __DRIdrawable * driReadPriv)
-{
- struct gl_context *mesaCtx;
- struct gl_framebuffer *mesaDraw;
- struct gl_framebuffer *mesaRead;
- TRACE;
-
- if (cPriv) {
- struct dri_context *ctx = dri_context(cPriv);
- struct dri_drawable *draw;
- struct dri_drawable *read;
-
- if (!driDrawPriv || !driReadPriv)
- return GL_FALSE;
-
- draw = dri_drawable(driDrawPriv);
- read = dri_drawable(driReadPriv);
- mesaCtx = &ctx->Base;
- mesaDraw = &draw->Base;
- mesaRead = &read->Base;
-
- /* check for same context and buffer */
- if (mesaCtx == _mesa_get_current_context()
- && mesaCtx->DrawBuffer == mesaDraw
- && mesaCtx->ReadBuffer == mesaRead) {
- return GL_TRUE;
- }
-
- _glapi_check_multithread();
-
- swrast_check_and_update_window_size(mesaCtx, mesaDraw);
- if (mesaRead != mesaDraw)
- swrast_check_and_update_window_size(mesaCtx, mesaRead);
-
- _mesa_make_current( mesaCtx,
- mesaDraw,
- mesaRead );
- }
- else {
- /* unbind */
- _mesa_make_current( NULL, NULL, NULL );
- }
-
- return GL_TRUE;
-}
-
-static GLboolean
-dri_unbind_context(__DRIcontext * cPriv)
-{
- TRACE;
- (void) cPriv;
-
- /* Unset current context and dispath table */
- _mesa_make_current(NULL, NULL, NULL);
-
- return GL_TRUE;
-}
-
-
-const struct __DriverAPIRec driDriverAPI = {
- .InitScreen = dri_init_screen,
- .DestroyScreen = dri_destroy_screen,
- .CreateContext = dri_create_context,
- .DestroyContext = dri_destroy_context,
- .CreateBuffer = dri_create_buffer,
- .DestroyBuffer = dri_destroy_buffer,
- .SwapBuffers = dri_swap_buffers,
- .MakeCurrent = dri_make_current,
- .UnbindContext = dri_unbind_context,
-};
-
-/* This is the table of extensions that the loader will dlsym() for. */
-PUBLIC const __DRIextension *__driDriverExtensions[] = {
- &driCoreExtension.base,
- &driSWRastExtension.base,
- NULL
-};
+/*
+ * Copyright 2008, 2010 George Sapountzis <gsapountzis@gmail.com>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+/*
+ * DRI software rasterizer
+ *
+ * This is the mesa swrast module packaged into a DRI driver structure.
+ *
+ * The front-buffer is allocated by the loader. The loader provides read/write
+ * callbacks for access to the front-buffer. The driver uses a scratch row for
+ * front-buffer rendering to avoid repeated calls to the loader.
+ *
+ * The back-buffer is allocated by the driver and is private.
+ */
+
+#ifdef _MSC_VER
+#define WIN32_LEAN_AND_MEAN 1
+#include <windows.h>
+#endif
+
+#include "main/context.h"
+#include "main/extensions.h"
+#include "main/formats.h"
+#include "main/framebuffer.h"
+#include "main/imports.h"
+#include "main/renderbuffer.h"
+#include "swrast/swrast.h"
+#include "swrast_setup/swrast_setup.h"
+#include "tnl/tnl.h"
+#include "tnl/t_context.h"
+#include "tnl/t_pipeline.h"
+#include "vbo/vbo.h"
+#include "drivers/common/driverfuncs.h"
+#include "drivers/common/meta.h"
+#include "utils.h"
+
+#include "main/teximage.h"
+#include "main/texformat.h"
+#include "main/texstate.h"
+
+#include "swrast_priv.h"
+
+
+/**
+ * Screen and config-related functions
+ */
+
+static void swrastSetTexBuffer2(__DRIcontext *pDRICtx, GLint target,
+ GLint texture_format, __DRIdrawable *dPriv)
+{
+ struct dri_context *dri_ctx;
+ int x, y, w, h;
+ __DRIscreen *sPriv = dPriv->driScreenPriv;
+ struct gl_texture_unit *texUnit;
+ struct gl_texture_object *texObj;
+ struct gl_texture_image *texImage;
+ uint32_t internalFormat;
+ gl_format texFormat;
+
+ dri_ctx = pDRICtx->driverPrivate;
+
+ internalFormat = (texture_format == __DRI_TEXTURE_FORMAT_RGB ? 3 : 4);
+
+ texUnit = _mesa_get_current_tex_unit(&dri_ctx->Base);
+ texObj = _mesa_select_tex_object(&dri_ctx->Base, texUnit, target);
+ texImage = _mesa_get_tex_image(&dri_ctx->Base, texObj, target, 0);
+
+ _mesa_lock_texture(&dri_ctx->Base, texObj);
+
+ sPriv->swrast_loader->getDrawableInfo(dPriv, &x, &y, &w, &h, dPriv->loaderPrivate);
+
+ if (texture_format == __DRI_TEXTURE_FORMAT_RGB)
+ texFormat = MESA_FORMAT_XRGB8888;
+ else
+ texFormat = MESA_FORMAT_ARGB8888;
+
+ _mesa_init_teximage_fields(&dri_ctx->Base, target, texImage,
+ w, h, 1, 0, internalFormat, texFormat);
+
+ sPriv->swrast_loader->getImage(dPriv, x, y, w, h, (char *)texImage->Data,
+ dPriv->loaderPrivate);
+
+ _mesa_unlock_texture(&dri_ctx->Base, texObj);
+}
+
+static void swrastSetTexBuffer(__DRIcontext *pDRICtx, GLint target,
+ __DRIdrawable *dPriv)
+{
+ swrastSetTexBuffer2(pDRICtx, target, __DRI_TEXTURE_FORMAT_RGBA, dPriv);
+}
+
+static const __DRItexBufferExtension swrastTexBufferExtension = {
+ { __DRI_TEX_BUFFER, __DRI_TEX_BUFFER_VERSION },
+ swrastSetTexBuffer,
+ swrastSetTexBuffer2,
+};
+
+static const __DRIextension *dri_screen_extensions[] = {
+ &swrastTexBufferExtension.base,
+ NULL
+};
+
+static __DRIconfig **
+swrastFillInModes(__DRIscreen *psp,
+ unsigned pixel_bits, unsigned depth_bits,
+ unsigned stencil_bits, GLboolean have_back_buffer)
+{
+ __DRIconfig **configs;
+ unsigned depth_buffer_factor;
+ unsigned back_buffer_factor;
+ GLenum fb_format;
+ GLenum fb_type;
+
+ /* GLX_SWAP_COPY_OML is only supported because the Intel driver doesn't
+ * support pageflipping at all.
+ */
+ static const GLenum back_buffer_modes[] = {
+ GLX_NONE, GLX_SWAP_UNDEFINED_OML
+ };
+
+ uint8_t depth_bits_array[4];
+ uint8_t stencil_bits_array[4];
+ uint8_t msaa_samples_array[1];
+
+ depth_bits_array[0] = 0;
+ depth_bits_array[1] = 0;
+ depth_bits_array[2] = depth_bits;
+ depth_bits_array[3] = depth_bits;
+
+ /* Just like with the accumulation buffer, always provide some modes
+ * with a stencil buffer.
+ */
+ stencil_bits_array[0] = 0;
+ stencil_bits_array[1] = (stencil_bits == 0) ? 8 : stencil_bits;
+ stencil_bits_array[2] = 0;
+ stencil_bits_array[3] = (stencil_bits == 0) ? 8 : stencil_bits;
+
+ msaa_samples_array[0] = 0;
+
+ depth_buffer_factor = 4;
+ back_buffer_factor = 2;
+
+ switch (pixel_bits) {
+ case 8:
+ fb_format = GL_RGB;
+ fb_type = GL_UNSIGNED_BYTE_2_3_3_REV;
+ break;
+ case 16:
+ fb_format = GL_RGB;
+ fb_type = GL_UNSIGNED_SHORT_5_6_5;
+ break;
+ case 24:
+ fb_format = GL_BGR;
+ fb_type = GL_UNSIGNED_INT_8_8_8_8_REV;
+ break;
+ case 32:
+ fb_format = GL_BGRA;
+ fb_type = GL_UNSIGNED_INT_8_8_8_8_REV;
+ break;
+ default:
+ fprintf(stderr, "[%s:%u] bad depth %d\n", __FUNCTION__, __LINE__,
+ pixel_bits);
+ return NULL;
+ }
+
+ configs = driCreateConfigs(fb_format, fb_type,
+ depth_bits_array, stencil_bits_array,
+ depth_buffer_factor, back_buffer_modes,
+ back_buffer_factor, msaa_samples_array, 1,
+ GL_TRUE);
+ if (configs == NULL) {
+ fprintf(stderr, "[%s:%u] Error creating FBConfig!\n", __FUNCTION__,
+ __LINE__);
+ return NULL;
+ }
+
+ return configs;
+}
+
+static const __DRIconfig **
+dri_init_screen(__DRIscreen * psp)
+{
+ __DRIconfig **configs8, **configs16, **configs24, **configs32;
+
+ TRACE;
+
+ psp->extensions = dri_screen_extensions;
+
+ configs8 = swrastFillInModes(psp, 8, 8, 0, 1);
+ configs16 = swrastFillInModes(psp, 16, 16, 0, 1);
+ configs24 = swrastFillInModes(psp, 24, 24, 8, 1);
+ configs32 = swrastFillInModes(psp, 32, 24, 8, 1);
+
+ configs16 = driConcatConfigs(configs8, configs16);
+ configs24 = driConcatConfigs(configs16, configs24);
+ configs32 = driConcatConfigs(configs24, configs32);
+
+ return (const __DRIconfig **)configs32;
+}
+
+static void
+dri_destroy_screen(__DRIscreen * sPriv)
+{
+ TRACE;
+}
+
+
+/**
+ * Framebuffer and renderbuffer-related functions.
+ */
+
+static GLuint
+choose_pixel_format(const struct gl_config *v)
+{
+ int depth = v->rgbBits;
+
+ if (depth == 32
+ && v->redMask == 0xff0000
+ && v->greenMask == 0x00ff00
+ && v->blueMask == 0x0000ff)
+ return PF_A8R8G8B8;
+ else if (depth == 24
+ && v->redMask == 0xff0000
+ && v->greenMask == 0x00ff00
+ && v->blueMask == 0x0000ff)
+ return PF_X8R8G8B8;
+ else if (depth == 16
+ && v->redMask == 0xf800
+ && v->greenMask == 0x07e0
+ && v->blueMask == 0x001f)
+ return PF_R5G6B5;
+ else if (depth == 8
+ && v->redMask == 0x07
+ && v->greenMask == 0x38
+ && v->blueMask == 0xc0)
+ return PF_R3G3B2;
+
+ _mesa_problem( NULL, "unexpected format in %s", __FUNCTION__ );
+ return 0;
+}
+
+static void
+swrast_delete_renderbuffer(struct gl_renderbuffer *rb)
+{
+ TRACE;
+
+ free(rb->Data);
+ free(rb);
+}
+
+/* see bytes_per_line in libGL */
+static INLINE int
+bytes_per_line(unsigned pitch_bits, unsigned mul)
+{
+ unsigned mask = mul - 1;
+
+ return ((pitch_bits + mask) & ~mask) / 8;
+}
+
+static GLboolean
+swrast_alloc_front_storage(struct gl_context *ctx, struct gl_renderbuffer *rb,
+ GLenum internalFormat, GLuint width, GLuint height)
+{
+ struct swrast_renderbuffer *xrb = swrast_renderbuffer(rb);
+
+ TRACE;
+
+ rb->Data = NULL;
+ rb->Width = width;
+ rb->Height = height;
+
+ xrb->pitch = bytes_per_line(width * xrb->bpp, 32);
+
+ return GL_TRUE;
+}
+
+static GLboolean
+swrast_alloc_back_storage(struct gl_context *ctx, struct gl_renderbuffer *rb,
+ GLenum internalFormat, GLuint width, GLuint height)
+{
+ struct swrast_renderbuffer *xrb = swrast_renderbuffer(rb);
+
+ TRACE;
+
+ free(rb->Data);
+
+ swrast_alloc_front_storage(ctx, rb, internalFormat, width, height);
+
+ rb->Data = malloc(height * xrb->pitch);
+
+ return GL_TRUE;
+}
+
+static struct swrast_renderbuffer *
+swrast_new_renderbuffer(const struct gl_config *visual, GLboolean front)
+{
+ struct swrast_renderbuffer *xrb = calloc(1, sizeof *xrb);
+ GLuint pixel_format;
+
+ TRACE;
+
+ if (!xrb)
+ return NULL;
+
+ _mesa_init_renderbuffer(&xrb->Base, 0);
+
+ pixel_format = choose_pixel_format(visual);
+
+ xrb->Base.Delete = swrast_delete_renderbuffer;
+ if (front) {
+ xrb->Base.AllocStorage = swrast_alloc_front_storage;
+ swrast_set_span_funcs_front(xrb, pixel_format);
+ }
+ else {
+ xrb->Base.AllocStorage = swrast_alloc_back_storage;
+ swrast_set_span_funcs_back(xrb, pixel_format);
+ }
+
+ switch (pixel_format) {
+ case PF_A8R8G8B8:
+ xrb->Base.Format = MESA_FORMAT_ARGB8888;
+ xrb->Base.InternalFormat = GL_RGBA;
+ xrb->Base._BaseFormat = GL_RGBA;
+ xrb->Base.DataType = GL_UNSIGNED_BYTE;
+ xrb->bpp = 32;
+ break;
+ case PF_X8R8G8B8:
+ xrb->Base.Format = MESA_FORMAT_ARGB8888; /* XXX */
+ xrb->Base.InternalFormat = GL_RGB;
+ xrb->Base._BaseFormat = GL_RGB;
+ xrb->Base.DataType = GL_UNSIGNED_BYTE;
+ xrb->bpp = 32;
+ break;
+ case PF_R5G6B5:
+ xrb->Base.Format = MESA_FORMAT_RGB565;
+ xrb->Base.InternalFormat = GL_RGB;
+ xrb->Base._BaseFormat = GL_RGB;
+ xrb->Base.DataType = GL_UNSIGNED_BYTE;
+ xrb->bpp = 16;
+ break;
+ case PF_R3G3B2:
+ xrb->Base.Format = MESA_FORMAT_RGB332;
+ xrb->Base.InternalFormat = GL_RGB;
+ xrb->Base._BaseFormat = GL_RGB;
+ xrb->Base.DataType = GL_UNSIGNED_BYTE;
+ xrb->bpp = 8;
+ break;
+ default:
+ return NULL;
+ }
+
+ return xrb;
+}
+
+static GLboolean
+dri_create_buffer(__DRIscreen * sPriv,
+ __DRIdrawable * dPriv,
+ const struct gl_config * visual, GLboolean isPixmap)
+{
+ struct dri_drawable *drawable = NULL;
+ struct gl_framebuffer *fb;
+ struct swrast_renderbuffer *frontrb, *backrb;
+
+ TRACE;
+
+ drawable = CALLOC_STRUCT(dri_drawable);
+ if (drawable == NULL)
+ goto drawable_fail;
+
+ dPriv->driverPrivate = drawable;
+ drawable->dPriv = dPriv;
+
+ drawable->row = malloc(MAX_WIDTH * 4);
+ if (drawable->row == NULL)
+ goto drawable_fail;
+
+ fb = &drawable->Base;
+
+ /* basic framebuffer setup */
+ _mesa_initialize_window_framebuffer(fb, visual);
+
+ /* add front renderbuffer */
+ frontrb = swrast_new_renderbuffer(visual, GL_TRUE);
+ _mesa_add_renderbuffer(fb, BUFFER_FRONT_LEFT, &frontrb->Base);
+
+ /* add back renderbuffer */
+ if (visual->doubleBufferMode) {
+ backrb = swrast_new_renderbuffer(visual, GL_FALSE);
+ _mesa_add_renderbuffer(fb, BUFFER_BACK_LEFT, &backrb->Base);
+ }
+
+ /* add software renderbuffers */
+ _mesa_add_soft_renderbuffers(fb,
+ GL_FALSE, /* color */
+ visual->haveDepthBuffer,
+ visual->haveStencilBuffer,
+ visual->haveAccumBuffer,
+ GL_FALSE, /* alpha */
+ GL_FALSE /* aux bufs */);
+
+ return GL_TRUE;
+
+drawable_fail:
+
+ if (drawable)
+ free(drawable->row);
+
+ FREE(drawable);
+
+ return GL_FALSE;
+}
+
+static void
+dri_destroy_buffer(__DRIdrawable * dPriv)
+{
+ TRACE;
+
+ if (dPriv) {
+ struct dri_drawable *drawable = dri_drawable(dPriv);
+ struct gl_framebuffer *fb;
+
+ free(drawable->row);
+
+ fb = &drawable->Base;
+
+ fb->DeletePending = GL_TRUE;
+ _mesa_reference_framebuffer(&fb, NULL);
+ }
+}
+
+static void
+dri_swap_buffers(__DRIdrawable * dPriv)
+{
+ __DRIscreen *sPriv = dPriv->driScreenPriv;
+
+ GET_CURRENT_CONTEXT(ctx);
+
+ struct dri_drawable *drawable = dri_drawable(dPriv);
+ struct gl_framebuffer *fb;
+ struct swrast_renderbuffer *frontrb, *backrb;
+
+ TRACE;
+
+ fb = &drawable->Base;
+
+ frontrb =
+ swrast_renderbuffer(fb->Attachment[BUFFER_FRONT_LEFT].Renderbuffer);
+ backrb =
+ swrast_renderbuffer(fb->Attachment[BUFFER_BACK_LEFT].Renderbuffer);
+
+ /* check for signle-buffered */
+ if (backrb == NULL)
+ return;
+
+ /* check if swapping currently bound buffer */
+ if (ctx && ctx->DrawBuffer == fb) {
+ /* flush pending rendering */
+ _mesa_notifySwapBuffers(ctx);
+ }
+
+ sPriv->swrast_loader->putImage(dPriv, __DRI_SWRAST_IMAGE_OP_SWAP,
+ 0, 0,
+ frontrb->Base.Width,
+ frontrb->Base.Height,
+ backrb->Base.Data,
+ dPriv->loaderPrivate);
+}
+
+
+/**
+ * General device driver functions.
+ */
+
+static void
+get_window_size( struct gl_framebuffer *fb, GLsizei *w, GLsizei *h )
+{
+ __DRIdrawable *dPriv = swrast_drawable(fb)->dPriv;
+ __DRIscreen *sPriv = dPriv->driScreenPriv;
+ int x, y;
+
+ sPriv->swrast_loader->getDrawableInfo(dPriv,
+ &x, &y, w, h,
+ dPriv->loaderPrivate);
+}
+
+static void
+swrast_check_and_update_window_size( struct gl_context *ctx, struct gl_framebuffer *fb )
+{
+ GLsizei width, height;
+
+ get_window_size(fb, &width, &height);
+ if (fb->Width != width || fb->Height != height) {
+ _mesa_resize_framebuffer(ctx, fb, width, height);
+ }
+}
+
+static const GLubyte *
+get_string(struct gl_context *ctx, GLenum pname)
+{
+ (void) ctx;
+ switch (pname) {
+ case GL_VENDOR:
+ return (const GLubyte *) "Mesa Project";
+ case GL_RENDERER:
+ return (const GLubyte *) "Software Rasterizer";
+ default:
+ return NULL;
+ }
+}
+
+static void
+update_state( struct gl_context *ctx, GLuint new_state )
+{
+ /* not much to do here - pass it on */
+ _swrast_InvalidateState( ctx, new_state );
+ _swsetup_InvalidateState( ctx, new_state );
+ _vbo_InvalidateState( ctx, new_state );
+ _tnl_InvalidateState( ctx, new_state );
+}
+
+static void
+viewport(struct gl_context *ctx, GLint x, GLint y, GLsizei w, GLsizei h)
+{
+ struct gl_framebuffer *draw = ctx->WinSysDrawBuffer;
+ struct gl_framebuffer *read = ctx->WinSysReadBuffer;
+
+ swrast_check_and_update_window_size(ctx, draw);
+ swrast_check_and_update_window_size(ctx, read);
+}
+
+static gl_format swrastChooseTextureFormat(struct gl_context * ctx,
+ GLint internalFormat,
+ GLenum format,
+ GLenum type)
+{
+ if (internalFormat == GL_RGB)
+ return MESA_FORMAT_XRGB8888;
+ return _mesa_choose_tex_format(ctx, internalFormat, format, type);
+}
+
+static void
+swrast_init_driver_functions(struct dd_function_table *driver)
+{
+ driver->GetString = get_string;
+ driver->UpdateState = update_state;
+ driver->GetBufferSize = NULL;
+ driver->Viewport = viewport;
+ driver->ChooseTextureFormat = swrastChooseTextureFormat;
+}
+
+static const char *es2_extensions[] = {
+ /* Used by mesa internally (cf all_mesa_extensions in ../common/utils.c) */
+ "GL_ARB_draw_buffers",
+ "GL_ARB_multisample",
+ "GL_ARB_texture_compression",
+ "GL_ARB_transpose_matrix",
+ "GL_ARB_vertex_buffer_object",
+ "GL_ARB_window_pos",
+ "GL_EXT_blend_func_separate",
+ "GL_EXT_compiled_vertex_array",
+ "GL_EXT_framebuffer_blit",
+ "GL_EXT_multi_draw_arrays",
+ "GL_EXT_polygon_offset",
+ "GL_EXT_texture_object",
+ "GL_EXT_vertex_array",
+ "GL_IBM_multimode_draw_arrays",
+ "GL_MESA_window_pos",
+ "GL_NV_vertex_program",
+
+ /* Required by GLES2 */
+ "GL_ARB_fragment_program",
+ "GL_ARB_fragment_shader",
+ "GL_ARB_multitexture",
+ "GL_ARB_shader_objects",
+ "GL_ARB_texture_cube_map",
+ "GL_ARB_texture_mirrored_repeat",
+ "GL_ARB_texture_non_power_of_two",
+ "GL_ARB_vertex_shader",
+ "GL_EXT_blend_color",
+ "GL_EXT_blend_equation_separate",
+ "GL_EXT_blend_minmax",
+ "GL_EXT_blend_subtract",
+ "GL_EXT_stencil_wrap",
+
+ /* Optional GLES2 */
+ "GL_ARB_framebuffer_object",
+ "GL_EXT_texture_filter_anisotropic",
+ "GL_ARB_depth_texture",
+ "GL_EXT_packed_depth_stencil",
+ "GL_EXT_framebuffer_object",
+ NULL,
+};
+
+static void
+InitExtensionsES2(struct gl_context *ctx)
+{
+ int i;
+
+ /* Can't use driInitExtensions() since it uses extensions from
+ * main/remap_helper.h when called the first time. */
+
+ for (i = 0; es2_extensions[i]; i++)
+ _mesa_enable_extension(ctx, es2_extensions[i]);
+}
+
+/**
+ * Context-related functions.
+ */
+
+static GLboolean
+dri_create_context(gl_api api,
+ const struct gl_config * visual,
+ __DRIcontext * cPriv, void *sharedContextPrivate)
+{
+ struct dri_context *ctx = NULL;
+ struct dri_context *share = (struct dri_context *)sharedContextPrivate;
+ struct gl_context *mesaCtx = NULL;
+ struct gl_context *sharedCtx = NULL;
+ struct dd_function_table functions;
+
+ TRACE;
+
+ ctx = CALLOC_STRUCT(dri_context);
+ if (ctx == NULL)
+ goto context_fail;
+
+ cPriv->driverPrivate = ctx;
+ ctx->cPriv = cPriv;
+
+ /* build table of device driver functions */
+ _mesa_init_driver_functions(&functions);
+ swrast_init_driver_functions(&functions);
+
+ if (share) {
+ sharedCtx = &share->Base;
+ }
+
+ mesaCtx = &ctx->Base;
+
+ /* basic context setup */
+ if (!_mesa_initialize_context(mesaCtx, api, visual, sharedCtx, &functions, (void *) cPriv)) {
+ goto context_fail;
+ }
+
+ /* do bounds checking to prevent segfaults and server crashes! */
+ mesaCtx->Const.CheckArrayBounds = GL_TRUE;
+
+ /* create module contexts */
+ _swrast_CreateContext( mesaCtx );
+ _vbo_CreateContext( mesaCtx );
+ _tnl_CreateContext( mesaCtx );
+ _swsetup_CreateContext( mesaCtx );
+ _swsetup_Wakeup( mesaCtx );
+
+ /* use default TCL pipeline */
+ {
+ TNLcontext *tnl = TNL_CONTEXT(mesaCtx);
+ tnl->Driver.RunPipeline = _tnl_run_pipeline;
+ }
+
+ _mesa_meta_init(mesaCtx);
+ _mesa_enable_sw_extensions(mesaCtx);
+
+ switch (api) {
+ case API_OPENGL:
+ _mesa_enable_1_3_extensions(mesaCtx);
+ _mesa_enable_1_4_extensions(mesaCtx);
+ _mesa_enable_1_5_extensions(mesaCtx);
+ _mesa_enable_2_0_extensions(mesaCtx);
+ _mesa_enable_2_1_extensions(mesaCtx);
+
+ driInitExtensions( mesaCtx, NULL, GL_FALSE );
+ break;
+ case API_OPENGLES:
+ _mesa_enable_1_3_extensions(mesaCtx);
+ _mesa_enable_1_4_extensions(mesaCtx);
+ _mesa_enable_1_5_extensions(mesaCtx);
+
+ break;
+ case API_OPENGLES2:
+ InitExtensionsES2( mesaCtx);
+ break;
+ }
+
+ return GL_TRUE;
+
+context_fail:
+
+ FREE(ctx);
+
+ return GL_FALSE;
+}
+
+static void
+dri_destroy_context(__DRIcontext * cPriv)
+{
+ TRACE;
+
+ if (cPriv) {
+ struct dri_context *ctx = dri_context(cPriv);
+ struct gl_context *mesaCtx;
+
+ mesaCtx = &ctx->Base;
+
+ _mesa_meta_free(mesaCtx);
+ _swsetup_DestroyContext( mesaCtx );
+ _swrast_DestroyContext( mesaCtx );
+ _tnl_DestroyContext( mesaCtx );
+ _vbo_DestroyContext( mesaCtx );
+ _mesa_destroy_context( mesaCtx );
+ }
+}
+
+static GLboolean
+dri_make_current(__DRIcontext * cPriv,
+ __DRIdrawable * driDrawPriv,
+ __DRIdrawable * driReadPriv)
+{
+ struct gl_context *mesaCtx;
+ struct gl_framebuffer *mesaDraw;
+ struct gl_framebuffer *mesaRead;
+ TRACE;
+
+ if (cPriv) {
+ struct dri_context *ctx = dri_context(cPriv);
+ struct dri_drawable *draw;
+ struct dri_drawable *read;
+
+ if (!driDrawPriv || !driReadPriv)
+ return GL_FALSE;
+
+ draw = dri_drawable(driDrawPriv);
+ read = dri_drawable(driReadPriv);
+ mesaCtx = &ctx->Base;
+ mesaDraw = &draw->Base;
+ mesaRead = &read->Base;
+
+ /* check for same context and buffer */
+ if (mesaCtx == _mesa_get_current_context()
+ && mesaCtx->DrawBuffer == mesaDraw
+ && mesaCtx->ReadBuffer == mesaRead) {
+ return GL_TRUE;
+ }
+
+ _glapi_check_multithread();
+
+ swrast_check_and_update_window_size(mesaCtx, mesaDraw);
+ if (mesaRead != mesaDraw)
+ swrast_check_and_update_window_size(mesaCtx, mesaRead);
+
+ _mesa_make_current( mesaCtx,
+ mesaDraw,
+ mesaRead );
+ }
+ else {
+ /* unbind */
+ _mesa_make_current( NULL, NULL, NULL );
+ }
+
+ return GL_TRUE;
+}
+
+static GLboolean
+dri_unbind_context(__DRIcontext * cPriv)
+{
+ TRACE;
+ (void) cPriv;
+
+ /* Unset current context and dispath table */
+ _mesa_make_current(NULL, NULL, NULL);
+
+ return GL_TRUE;
+}
+
+
+const struct __DriverAPIRec driDriverAPI = {
+ /*.InitScreen = */dri_init_screen,
+ /*.DestroyScreen = */dri_destroy_screen,
+ /*.CreateContext = */dri_create_context,
+ /*.DestroyContext = */dri_destroy_context,
+ /*.CreateBuffer = */dri_create_buffer,
+ /*.DestroyBuffer = */dri_destroy_buffer,
+ /*.SwapBuffers = */dri_swap_buffers,
+ /*.MakeCurrent = */dri_make_current,
+ /*.UnbindContext = */dri_unbind_context,
+};
+
+/* This is the table of extensions that the loader will dlsym() for. */
+PUBLIC const __DRIextension *__driDriverExtensions[] = {
+ &driCoreExtension.base,
+ &driSWRastExtension.base,
+ NULL
+};
diff --git a/mesalib/src/mesa/drivers/dri/swrast/swrast_priv.h b/mesalib/src/mesa/drivers/dri/swrast/swrast_priv.h
index 4c3c9830f..e61965147 100644
--- a/mesalib/src/mesa/drivers/dri/swrast/swrast_priv.h
+++ b/mesalib/src/mesa/drivers/dri/swrast/swrast_priv.h
@@ -32,6 +32,13 @@
#include "main/mtypes.h"
#include "drisw_util.h"
+#ifdef _MSC_VER
+#ifdef PUBLIC
+#undef PUBLIC
+#endif
+#define PUBLIC __declspec(dllexport)
+#endif
+
/**
* Debugging
diff --git a/mesalib/src/mesa/drivers/windows/gdi/mesa.def b/mesalib/src/mesa/drivers/windows/gdi/mesa.def
index d5c98801d..fbf275609 100644
--- a/mesalib/src/mesa/drivers/windows/gdi/mesa.def
+++ b/mesalib/src/mesa/drivers/windows/gdi/mesa.def
@@ -1,856 +1,856 @@
-; DO NOT EDIT - This file generated automatically by mesadef.py script
-;DESCRIPTION 'Mesa (OpenGL work-alike) for Win32'
-VERSION 6.5
-;
-; Module definition file for Mesa (OPENGL32.DLL)
-;
-; Note: The OpenGL functions use the STDCALL
-; function calling convention. Microsoft's
-; OPENGL32 uses this convention and so must the
-; Mesa OPENGL32 so that the Mesa DLL can be used
-; as a drop-in replacement.
-;
-; The linker exports STDCALL entry points with
-; 'decorated' names; e.g., _glBegin@0, where the
-; trailing number is the number of bytes of
-; parameter data pushed onto the stack. The
-; callee is responsible for popping this data
-; off the stack, usually via a RETF n instruction.
-;
-; However, the Microsoft OPENGL32.DLL does not export
-; the decorated names, even though the calling convention
-; is STDCALL. So, this module definition file is
-; needed to force the Mesa OPENGL32.DLL to export the
-; symbols in the same manner as the Microsoft DLL.
-; Were it not for this problem, this file would not
-; be needed (for the gl* functions) since the entry
-; points are compiled with dllexport declspec.
-;
-EXPORTS
- glNewList
- glEndList
- glCallList
- glCallLists
- glDeleteLists
- glGenLists
- glListBase
- glBegin
- glBitmap
- glColor3b
- glColor3bv
- glColor3d
- glColor3dv
- glColor3f
- glColor3fv
- glColor3i
- glColor3iv
- glColor3s
- glColor3sv
- glColor3ub
- glColor3ubv
- glColor3ui
- glColor3uiv
- glColor3us
- glColor3usv
- glColor4b
- glColor4bv
- glColor4d
- glColor4dv
- glColor4f
- glColor4fv
- glColor4i
- glColor4iv
- glColor4s
- glColor4sv
- glColor4ub
- glColor4ubv
- glColor4ui
- glColor4uiv
- glColor4us
- glColor4usv
- glEdgeFlag
- glEdgeFlagv
- glEnd
- glIndexd
- glIndexdv
- glIndexf
- glIndexfv
- glIndexi
- glIndexiv
- glIndexs
- glIndexsv
- glNormal3b
- glNormal3bv
- glNormal3d
- glNormal3dv
- glNormal3f
- glNormal3fv
- glNormal3i
- glNormal3iv
- glNormal3s
- glNormal3sv
- glRasterPos2d
- glRasterPos2dv
- glRasterPos2f
- glRasterPos2fv
- glRasterPos2i
- glRasterPos2iv
- glRasterPos2s
- glRasterPos2sv
- glRasterPos3d
- glRasterPos3dv
- glRasterPos3f
- glRasterPos3fv
- glRasterPos3i
- glRasterPos3iv
- glRasterPos3s
- glRasterPos3sv
- glRasterPos4d
- glRasterPos4dv
- glRasterPos4f
- glRasterPos4fv
- glRasterPos4i
- glRasterPos4iv
- glRasterPos4s
- glRasterPos4sv
- glRectd
- glRectdv
- glRectf
- glRectfv
- glRecti
- glRectiv
- glRects
- glRectsv
- glTexCoord1d
- glTexCoord1dv
- glTexCoord1f
- glTexCoord1fv
- glTexCoord1i
- glTexCoord1iv
- glTexCoord1s
- glTexCoord1sv
- glTexCoord2d
- glTexCoord2dv
- glTexCoord2f
- glTexCoord2fv
- glTexCoord2i
- glTexCoord2iv
- glTexCoord2s
- glTexCoord2sv
- glTexCoord3d
- glTexCoord3dv
- glTexCoord3f
- glTexCoord3fv
- glTexCoord3i
- glTexCoord3iv
- glTexCoord3s
- glTexCoord3sv
- glTexCoord4d
- glTexCoord4dv
- glTexCoord4f
- glTexCoord4fv
- glTexCoord4i
- glTexCoord4iv
- glTexCoord4s
- glTexCoord4sv
- glVertex2d
- glVertex2dv
- glVertex2f
- glVertex2fv
- glVertex2i
- glVertex2iv
- glVertex2s
- glVertex2sv
- glVertex3d
- glVertex3dv
- glVertex3f
- glVertex3fv
- glVertex3i
- glVertex3iv
- glVertex3s
- glVertex3sv
- glVertex4d
- glVertex4dv
- glVertex4f
- glVertex4fv
- glVertex4i
- glVertex4iv
- glVertex4s
- glVertex4sv
- glClipPlane
- glColorMaterial
- glCullFace
- glFogf
- glFogfv
- glFogi
- glFogiv
- glFrontFace
- glHint
- glLightf
- glLightfv
- glLighti
- glLightiv
- glLightModelf
- glLightModelfv
- glLightModeli
- glLightModeliv
- glLineStipple
- glLineWidth
- glMaterialf
- glMaterialfv
- glMateriali
- glMaterialiv
- glPointSize
- glPolygonMode
- glPolygonStipple
- glScissor
- glShadeModel
- glTexParameterf
- glTexParameterfv
- glTexParameteri
- glTexParameteriv
- glTexImage1D
- glTexImage2D
- glTexEnvf
- glTexEnvfv
- glTexEnvi
- glTexEnviv
- glTexGend
- glTexGendv
- glTexGenf
- glTexGenfv
- glTexGeni
- glTexGeniv
- glFeedbackBuffer
- glSelectBuffer
- glRenderMode
- glInitNames
- glLoadName
- glPassThrough
- glPopName
- glPushName
- glDrawBuffer
- glClear
- glClearAccum
- glClearIndex
- glClearColor
- glClearStencil
- glClearDepth
- glStencilMask
- glColorMask
- glDepthMask
- glIndexMask
- glAccum
- glDisable
- glEnable
- glFinish
- glFlush
- glPopAttrib
- glPushAttrib
- glMap1d
- glMap1f
- glMap2d
- glMap2f
- glMapGrid1d
- glMapGrid1f
- glMapGrid2d
- glMapGrid2f
- glEvalCoord1d
- glEvalCoord1dv
- glEvalCoord1f
- glEvalCoord1fv
- glEvalCoord2d
- glEvalCoord2dv
- glEvalCoord2f
- glEvalCoord2fv
- glEvalMesh1
- glEvalPoint1
- glEvalMesh2
- glEvalPoint2
- glAlphaFunc
- glBlendFunc
- glLogicOp
- glStencilFunc
- glStencilOp
- glDepthFunc
- glPixelZoom
- glPixelTransferf
- glPixelTransferi
- glPixelStoref
- glPixelStorei
- glPixelMapfv
- glPixelMapuiv
- glPixelMapusv
- glReadBuffer
- glCopyPixels
- glReadPixels
- glDrawPixels
- glGetBooleanv
- glGetClipPlane
- glGetDoublev
- glGetError
- glGetFloatv
- glGetIntegerv
- glGetLightfv
- glGetLightiv
- glGetMapdv
- glGetMapfv
- glGetMapiv
- glGetMaterialfv
- glGetMaterialiv
- glGetPixelMapfv
- glGetPixelMapuiv
- glGetPixelMapusv
- glGetPolygonStipple
- glGetString
- glGetTexEnvfv
- glGetTexEnviv
- glGetTexGendv
- glGetTexGenfv
- glGetTexGeniv
- glGetTexImage
- glGetTexParameterfv
- glGetTexParameteriv
- glGetTexLevelParameterfv
- glGetTexLevelParameteriv
- glIsEnabled
- glIsList
- glDepthRange
- glFrustum
- glLoadIdentity
- glLoadMatrixf
- glLoadMatrixd
- glMatrixMode
- glMultMatrixf
- glMultMatrixd
- glOrtho
- glPopMatrix
- glPushMatrix
- glRotated
- glRotatef
- glScaled
- glScalef
- glTranslated
- glTranslatef
- glViewport
- glArrayElement
- glColorPointer
- glDisableClientState
- glDrawArrays
- glDrawElements
- glEdgeFlagPointer
- glEnableClientState
- glGetPointerv
- glIndexPointer
- glInterleavedArrays
- glNormalPointer
- glTexCoordPointer
- glVertexPointer
- glPolygonOffset
- glCopyTexImage1D
- glCopyTexImage2D
- glCopyTexSubImage1D
- glCopyTexSubImage2D
- glTexSubImage1D
- glTexSubImage2D
- glAreTexturesResident
- glBindTexture
- glDeleteTextures
- glGenTextures
- glIsTexture
- glPrioritizeTextures
- glIndexub
- glIndexubv
- glPopClientAttrib
- glPushClientAttrib
- glBlendColor
- glBlendEquation
- glDrawRangeElements
- glColorTable
- glColorTableParameterfv
- glColorTableParameteriv
- glCopyColorTable
- glGetColorTable
- glGetColorTableParameterfv
- glGetColorTableParameteriv
- glColorSubTable
- glCopyColorSubTable
- glConvolutionFilter1D
- glConvolutionFilter2D
- glConvolutionParameterf
- glConvolutionParameterfv
- glConvolutionParameteri
- glConvolutionParameteriv
- glCopyConvolutionFilter1D
- glCopyConvolutionFilter2D
- glGetConvolutionFilter
- glGetConvolutionParameterfv
- glGetConvolutionParameteriv
- glGetSeparableFilter
- glSeparableFilter2D
- glGetHistogram
- glGetHistogramParameterfv
- glGetHistogramParameteriv
- glGetMinmax
- glGetMinmaxParameterfv
- glGetMinmaxParameteriv
- glHistogram
- glMinmax
- glResetHistogram
- glResetMinmax
- glTexImage3D
- glTexSubImage3D
- glCopyTexSubImage3D
- glActiveTextureARB
- glClientActiveTextureARB
- glMultiTexCoord1dARB
- glMultiTexCoord1dvARB
- glMultiTexCoord1fARB
- glMultiTexCoord1fvARB
- glMultiTexCoord1iARB
- glMultiTexCoord1ivARB
- glMultiTexCoord1sARB
- glMultiTexCoord1svARB
- glMultiTexCoord2dARB
- glMultiTexCoord2dvARB
- glMultiTexCoord2fARB
- glMultiTexCoord2fvARB
- glMultiTexCoord2iARB
- glMultiTexCoord2ivARB
- glMultiTexCoord2sARB
- glMultiTexCoord2svARB
- glMultiTexCoord3dARB
- glMultiTexCoord3dvARB
- glMultiTexCoord3fARB
- glMultiTexCoord3fvARB
- glMultiTexCoord3iARB
- glMultiTexCoord3ivARB
- glMultiTexCoord3sARB
- glMultiTexCoord3svARB
- glMultiTexCoord4dARB
- glMultiTexCoord4dvARB
- glMultiTexCoord4fARB
- glMultiTexCoord4fvARB
- glMultiTexCoord4iARB
- glMultiTexCoord4ivARB
- glMultiTexCoord4sARB
- glMultiTexCoord4svARB
- glLoadTransposeMatrixfARB
- glLoadTransposeMatrixdARB
- glMultTransposeMatrixfARB
- glMultTransposeMatrixdARB
- glSampleCoverageARB
- glCompressedTexImage3DARB
- glCompressedTexImage2DARB
- glCompressedTexImage1DARB
- glCompressedTexSubImage3DARB
- glCompressedTexSubImage2DARB
- glCompressedTexSubImage1DARB
- glGetCompressedTexImageARB
- glActiveTexture
- glClientActiveTexture
- glMultiTexCoord1d
- glMultiTexCoord1dv
- glMultiTexCoord1f
- glMultiTexCoord1fv
- glMultiTexCoord1i
- glMultiTexCoord1iv
- glMultiTexCoord1s
- glMultiTexCoord1sv
- glMultiTexCoord2d
- glMultiTexCoord2dv
- glMultiTexCoord2f
- glMultiTexCoord2fv
- glMultiTexCoord2i
- glMultiTexCoord2iv
- glMultiTexCoord2s
- glMultiTexCoord2sv
- glMultiTexCoord3d
- glMultiTexCoord3dv
- glMultiTexCoord3f
- glMultiTexCoord3fv
- glMultiTexCoord3i
- glMultiTexCoord3iv
- glMultiTexCoord3s
- glMultiTexCoord3sv
- glMultiTexCoord4d
- glMultiTexCoord4dv
- glMultiTexCoord4f
- glMultiTexCoord4fv
- glMultiTexCoord4i
- glMultiTexCoord4iv
- glMultiTexCoord4s
- glMultiTexCoord4sv
- glLoadTransposeMatrixf
- glLoadTransposeMatrixd
- glMultTransposeMatrixf
- glMultTransposeMatrixd
- glSampleCoverage
- glCompressedTexImage3D
- glCompressedTexImage2D
- glCompressedTexImage1D
- glCompressedTexSubImage3D
- glCompressedTexSubImage2D
- glCompressedTexSubImage1D
- glGetCompressedTexImage
- glBlendColorEXT
- glPolygonOffsetEXT
- glTexImage3DEXT
- glTexSubImage3DEXT
- glTexSubImage1DEXT
- glTexSubImage2DEXT
- glCopyTexImage1DEXT
- glCopyTexImage2DEXT
- glCopyTexSubImage1DEXT
- glCopyTexSubImage2DEXT
- glCopyTexSubImage3DEXT
- glAreTexturesResidentEXT
- glBindTextureEXT
- glDeleteTexturesEXT
- glGenTexturesEXT
- glIsTextureEXT
- glPrioritizeTexturesEXT
- glArrayElementEXT
- glColorPointerEXT
- glDrawArraysEXT
- glEdgeFlagPointerEXT
- glGetPointervEXT
- glIndexPointerEXT
- glNormalPointerEXT
- glTexCoordPointerEXT
- glVertexPointerEXT
- glBlendEquationEXT
- glPointParameterfEXT
- glPointParameterfvEXT
- glPointParameterfARB
- glPointParameterfvARB
- glColorTableEXT
- glGetColorTableEXT
- glGetColorTableParameterivEXT
- glGetColorTableParameterfvEXT
- glLockArraysEXT
- glUnlockArraysEXT
- glDrawRangeElementsEXT
- glSecondaryColor3bEXT
- glSecondaryColor3bvEXT
- glSecondaryColor3dEXT
- glSecondaryColor3dvEXT
- glSecondaryColor3fEXT
- glSecondaryColor3fvEXT
- glSecondaryColor3iEXT
- glSecondaryColor3ivEXT
- glSecondaryColor3sEXT
- glSecondaryColor3svEXT
- glSecondaryColor3ubEXT
- glSecondaryColor3ubvEXT
- glSecondaryColor3uiEXT
- glSecondaryColor3uivEXT
- glSecondaryColor3usEXT
- glSecondaryColor3usvEXT
- glSecondaryColorPointerEXT
- glMultiDrawArraysEXT
- glMultiDrawElementsEXT
- glFogCoordfEXT
- glFogCoordfvEXT
- glFogCoorddEXT
- glFogCoorddvEXT
- glFogCoordPointerEXT
- glBlendFuncSeparateEXT
- glFlushVertexArrayRangeNV
- glVertexArrayRangeNV
- glCombinerParameterfvNV
- glCombinerParameterfNV
- glCombinerParameterivNV
- glCombinerParameteriNV
- glCombinerInputNV
- glCombinerOutputNV
- glFinalCombinerInputNV
- glGetCombinerInputParameterfvNV
- glGetCombinerInputParameterivNV
- glGetCombinerOutputParameterfvNV
- glGetCombinerOutputParameterivNV
- glGetFinalCombinerInputParameterfvNV
- glGetFinalCombinerInputParameterivNV
- glResizeBuffersMESA
- glWindowPos2dMESA
- glWindowPos2dvMESA
- glWindowPos2fMESA
- glWindowPos2fvMESA
- glWindowPos2iMESA
- glWindowPos2ivMESA
- glWindowPos2sMESA
- glWindowPos2svMESA
- glWindowPos3dMESA
- glWindowPos3dvMESA
- glWindowPos3fMESA
- glWindowPos3fvMESA
- glWindowPos3iMESA
- glWindowPos3ivMESA
- glWindowPos3sMESA
- glWindowPos3svMESA
- glWindowPos4dMESA
- glWindowPos4dvMESA
- glWindowPos4fMESA
- glWindowPos4fvMESA
- glWindowPos4iMESA
- glWindowPos4ivMESA
- glWindowPos4sMESA
- glWindowPos4svMESA
- glWindowPos2dARB
- glWindowPos2fARB
- glWindowPos2iARB
- glWindowPos2sARB
- glWindowPos2dvARB
- glWindowPos2fvARB
- glWindowPos2ivARB
- glWindowPos2svARB
- glWindowPos3dARB
- glWindowPos3fARB
- glWindowPos3iARB
- glWindowPos3sARB
- glWindowPos3dvARB
- glWindowPos3fvARB
- glWindowPos3ivARB
- glWindowPos3svARB
- glAreProgramsResidentNV
- glBindProgramNV
- glDeleteProgramsNV
- glExecuteProgramNV
- glGenProgramsNV
- glGetProgramParameterdvNV
- glGetProgramParameterfvNV
- glGetProgramivNV
- glGetProgramStringNV
- glGetTrackMatrixivNV
- glGetVertexAttribdvNV
- glGetVertexAttribfvNV
- glGetVertexAttribivNV
- glGetVertexAttribPointervNV
- glIsProgramNV
- glLoadProgramNV
- glProgramParameter4dNV
- glProgramParameter4dvNV
- glProgramParameter4fNV
- glProgramParameter4fvNV
- glProgramParameters4dvNV
- glProgramParameters4fvNV
- glRequestResidentProgramsNV
- glTrackMatrixNV
- glVertexAttribPointerNV
- glVertexAttrib1dNV
- glVertexAttrib1dvNV
- glVertexAttrib1fNV
- glVertexAttrib1fvNV
- glVertexAttrib1sNV
- glVertexAttrib1svNV
- glVertexAttrib2dNV
- glVertexAttrib2dvNV
- glVertexAttrib2fNV
- glVertexAttrib2fvNV
- glVertexAttrib2sNV
- glVertexAttrib2svNV
- glVertexAttrib3dNV
- glVertexAttrib3dvNV
- glVertexAttrib3fNV
- glVertexAttrib3fvNV
- glVertexAttrib3sNV
- glVertexAttrib3svNV
- glVertexAttrib4dNV
- glVertexAttrib4dvNV
- glVertexAttrib4fNV
- glVertexAttrib4fvNV
- glVertexAttrib4sNV
- glVertexAttrib4svNV
- glVertexAttrib4ubNV
- glVertexAttrib4ubvNV
- glVertexAttribs1dvNV
- glVertexAttribs1fvNV
- glVertexAttribs1svNV
- glVertexAttribs2dvNV
- glVertexAttribs2fvNV
- glVertexAttribs2svNV
- glVertexAttribs3dvNV
- glVertexAttribs3fvNV
- glVertexAttribs3svNV
- glVertexAttribs4dvNV
- glVertexAttribs4fvNV
- glVertexAttribs4svNV
- glVertexAttribs4ubvNV
- glPointParameteriNV
- glPointParameterivNV
- glFogCoordf
- glFogCoordfv
- glFogCoordd
- glFogCoorddv
- glFogCoordPointer
- glMultiDrawArrays
- glMultiDrawElements
- glPointParameterf
- glPointParameterfv
- glPointParameteri
- glPointParameteriv
- glSecondaryColor3b
- glSecondaryColor3bv
- glSecondaryColor3d
- glSecondaryColor3dv
- glSecondaryColor3f
- glSecondaryColor3fv
- glSecondaryColor3i
- glSecondaryColor3iv
- glSecondaryColor3s
- glSecondaryColor3sv
- glSecondaryColor3ub
- glSecondaryColor3ubv
- glSecondaryColor3ui
- glSecondaryColor3uiv
- glSecondaryColor3us
- glSecondaryColor3usv
- glSecondaryColorPointer
- glWindowPos2d
- glWindowPos2dv
- glWindowPos2f
- glWindowPos2fv
- glWindowPos2i
- glWindowPos2iv
- glWindowPos2s
- glWindowPos2sv
- glWindowPos3d
- glWindowPos3dv
- glWindowPos3f
- glWindowPos3fv
- glWindowPos3i
- glWindowPos3iv
- glWindowPos3s
- glWindowPos3sv
- glVertexAttrib1sARB
- glVertexAttrib1fARB
- glVertexAttrib1dARB
- glVertexAttrib2sARB
- glVertexAttrib2fARB
- glVertexAttrib2dARB
- glVertexAttrib3sARB
- glVertexAttrib3fARB
- glVertexAttrib3dARB
- glVertexAttrib4sARB
- glVertexAttrib4fARB
- glVertexAttrib4dARB
- glVertexAttrib4NubARB
- glVertexAttrib1svARB
- glVertexAttrib1fvARB
- glVertexAttrib1dvARB
- glVertexAttrib2svARB
- glVertexAttrib2fvARB
- glVertexAttrib2dvARB
- glVertexAttrib3svARB
- glVertexAttrib3fvARB
- glVertexAttrib3dvARB
- glVertexAttrib4bvARB
- glVertexAttrib4svARB
- glVertexAttrib4ivARB
- glVertexAttrib4ubvARB
- glVertexAttrib4usvARB
- glVertexAttrib4uivARB
- glVertexAttrib4fvARB
- glVertexAttrib4dvARB
- glVertexAttrib4NbvARB
- glVertexAttrib4NsvARB
- glVertexAttrib4NivARB
- glVertexAttrib4NubvARB
- glVertexAttrib4NusvARB
- glVertexAttrib4NuivARB
- glVertexAttribPointerARB
- glEnableVertexAttribArrayARB
- glDisableVertexAttribArrayARB
- glProgramStringARB
- glBindProgramARB
- glDeleteProgramsARB
- glGenProgramsARB
- glIsProgramARB
- glProgramEnvParameter4dARB
- glProgramEnvParameter4dvARB
- glProgramEnvParameter4fARB
- glProgramEnvParameter4fvARB
- glProgramLocalParameter4dARB
- glProgramLocalParameter4dvARB
- glProgramLocalParameter4fARB
- glProgramLocalParameter4fvARB
- glGetProgramEnvParameterdvARB
- glGetProgramEnvParameterfvARB
- glGetProgramLocalParameterdvARB
- glGetProgramLocalParameterfvARB
- glGetProgramivARB
- glGetProgramStringARB
- glGetVertexAttribdvARB
- glGetVertexAttribfvARB
- glGetVertexAttribivARB
- glGetVertexAttribPointervARB
- glProgramNamedParameter4fNV
- glProgramNamedParameter4dNV
- glProgramNamedParameter4fvNV
- glProgramNamedParameter4dvNV
- glGetProgramNamedParameterfvNV
- glGetProgramNamedParameterdvNV
- glBindBufferARB
- glBufferDataARB
- glBufferSubDataARB
- glDeleteBuffersARB
- glGenBuffersARB
- glGetBufferParameterivARB
- glGetBufferPointervARB
- glGetBufferSubDataARB
- glIsBufferARB
- glMapBufferARB
- glUnmapBufferARB
- glGenQueriesARB
- glDeleteQueriesARB
- glIsQueryARB
- glBeginQueryARB
- glEndQueryARB
- glGetQueryivARB
- glGetQueryObjectivARB
- glGetQueryObjectuivARB
- glBindBuffer
- glBufferData
- glBufferSubData
- glDeleteBuffers
- glGenBuffers
- glGetBufferParameteriv
- glGetBufferPointerv
- glGetBufferSubData
- glIsBuffer
- glMapBuffer
- glUnmapBuffer
- glGenQueries
- glDeleteQueries
- glIsQuery
- glBeginQuery
- glEndQuery
- glGetQueryiv
- glGetQueryObjectiv
- glGetQueryObjectuiv
-;
-; WGL API
- wglChoosePixelFormat
- wglCopyContext
- wglCreateContext
- wglCreateLayerContext
- wglDeleteContext
- wglDescribeLayerPlane
- wglDescribePixelFormat
- wglGetCurrentContext
- wglGetCurrentDC
- wglGetLayerPaletteEntries
- wglGetPixelFormat
- wglGetProcAddress
- wglMakeCurrent
- wglRealizeLayerPalette
- wglSetLayerPaletteEntries
- wglSetPixelFormat
- wglShareLists
- wglSwapBuffers
- wglSwapLayerBuffers
- wglUseFontBitmapsA
- wglUseFontBitmapsW
- wglUseFontOutlinesA
- wglUseFontOutlinesW
- wglGetExtensionsStringARB
+; DO NOT EDIT - This file generated automatically by mesadef.py script
+;DESCRIPTION 'Mesa (OpenGL work-alike) for Win32'
+VERSION 6.5
+;
+; Module definition file for Mesa (OPENGL32.DLL)
+;
+; Note: The OpenGL functions use the STDCALL
+; function calling convention. Microsoft's
+; OPENGL32 uses this convention and so must the
+; Mesa OPENGL32 so that the Mesa DLL can be used
+; as a drop-in replacement.
+;
+; The linker exports STDCALL entry points with
+; 'decorated' names; e.g., _glBegin@0, where the
+; trailing number is the number of bytes of
+; parameter data pushed onto the stack. The
+; callee is responsible for popping this data
+; off the stack, usually via a RETF n instruction.
+;
+; However, the Microsoft OPENGL32.DLL does not export
+; the decorated names, even though the calling convention
+; is STDCALL. So, this module definition file is
+; needed to force the Mesa OPENGL32.DLL to export the
+; symbols in the same manner as the Microsoft DLL.
+; Were it not for this problem, this file would not
+; be needed (for the gl* functions) since the entry
+; points are compiled with dllexport declspec.
+;
+EXPORTS
+ glNewList
+ glEndList
+ glCallList
+ glCallLists
+ glDeleteLists
+ glGenLists
+ glListBase
+ glBegin
+ glBitmap
+ glColor3b
+ glColor3bv
+ glColor3d
+ glColor3dv
+ glColor3f
+ glColor3fv
+ glColor3i
+ glColor3iv
+ glColor3s
+ glColor3sv
+ glColor3ub
+ glColor3ubv
+ glColor3ui
+ glColor3uiv
+ glColor3us
+ glColor3usv
+ glColor4b
+ glColor4bv
+ glColor4d
+ glColor4dv
+ glColor4f
+ glColor4fv
+ glColor4i
+ glColor4iv
+ glColor4s
+ glColor4sv
+ glColor4ub
+ glColor4ubv
+ glColor4ui
+ glColor4uiv
+ glColor4us
+ glColor4usv
+ glEdgeFlag
+ glEdgeFlagv
+ glEnd
+ glIndexd
+ glIndexdv
+ glIndexf
+ glIndexfv
+ glIndexi
+ glIndexiv
+ glIndexs
+ glIndexsv
+ glNormal3b
+ glNormal3bv
+ glNormal3d
+ glNormal3dv
+ glNormal3f
+ glNormal3fv
+ glNormal3i
+ glNormal3iv
+ glNormal3s
+ glNormal3sv
+ glRasterPos2d
+ glRasterPos2dv
+ glRasterPos2f
+ glRasterPos2fv
+ glRasterPos2i
+ glRasterPos2iv
+ glRasterPos2s
+ glRasterPos2sv
+ glRasterPos3d
+ glRasterPos3dv
+ glRasterPos3f
+ glRasterPos3fv
+ glRasterPos3i
+ glRasterPos3iv
+ glRasterPos3s
+ glRasterPos3sv
+ glRasterPos4d
+ glRasterPos4dv
+ glRasterPos4f
+ glRasterPos4fv
+ glRasterPos4i
+ glRasterPos4iv
+ glRasterPos4s
+ glRasterPos4sv
+ glRectd
+ glRectdv
+ glRectf
+ glRectfv
+ glRecti
+ glRectiv
+ glRects
+ glRectsv
+ glTexCoord1d
+ glTexCoord1dv
+ glTexCoord1f
+ glTexCoord1fv
+ glTexCoord1i
+ glTexCoord1iv
+ glTexCoord1s
+ glTexCoord1sv
+ glTexCoord2d
+ glTexCoord2dv
+ glTexCoord2f
+ glTexCoord2fv
+ glTexCoord2i
+ glTexCoord2iv
+ glTexCoord2s
+ glTexCoord2sv
+ glTexCoord3d
+ glTexCoord3dv
+ glTexCoord3f
+ glTexCoord3fv
+ glTexCoord3i
+ glTexCoord3iv
+ glTexCoord3s
+ glTexCoord3sv
+ glTexCoord4d
+ glTexCoord4dv
+ glTexCoord4f
+ glTexCoord4fv
+ glTexCoord4i
+ glTexCoord4iv
+ glTexCoord4s
+ glTexCoord4sv
+ glVertex2d
+ glVertex2dv
+ glVertex2f
+ glVertex2fv
+ glVertex2i
+ glVertex2iv
+ glVertex2s
+ glVertex2sv
+ glVertex3d
+ glVertex3dv
+ glVertex3f
+ glVertex3fv
+ glVertex3i
+ glVertex3iv
+ glVertex3s
+ glVertex3sv
+ glVertex4d
+ glVertex4dv
+ glVertex4f
+ glVertex4fv
+ glVertex4i
+ glVertex4iv
+ glVertex4s
+ glVertex4sv
+ glClipPlane
+ glColorMaterial
+ glCullFace
+ glFogf
+ glFogfv
+ glFogi
+ glFogiv
+ glFrontFace
+ glHint
+ glLightf
+ glLightfv
+ glLighti
+ glLightiv
+ glLightModelf
+ glLightModelfv
+ glLightModeli
+ glLightModeliv
+ glLineStipple
+ glLineWidth
+ glMaterialf
+ glMaterialfv
+ glMateriali
+ glMaterialiv
+ glPointSize
+ glPolygonMode
+ glPolygonStipple
+ glScissor
+ glShadeModel
+ glTexParameterf
+ glTexParameterfv
+ glTexParameteri
+ glTexParameteriv
+ glTexImage1D
+ glTexImage2D
+ glTexEnvf
+ glTexEnvfv
+ glTexEnvi
+ glTexEnviv
+ glTexGend
+ glTexGendv
+ glTexGenf
+ glTexGenfv
+ glTexGeni
+ glTexGeniv
+ glFeedbackBuffer
+ glSelectBuffer
+ glRenderMode
+ glInitNames
+ glLoadName
+ glPassThrough
+ glPopName
+ glPushName
+ glDrawBuffer
+ glClear
+ glClearAccum
+ glClearIndex
+ glClearColor
+ glClearStencil
+ glClearDepth
+ glStencilMask
+ glColorMask
+ glDepthMask
+ glIndexMask
+ glAccum
+ glDisable
+ glEnable
+ glFinish
+ glFlush
+ glPopAttrib
+ glPushAttrib
+ glMap1d
+ glMap1f
+ glMap2d
+ glMap2f
+ glMapGrid1d
+ glMapGrid1f
+ glMapGrid2d
+ glMapGrid2f
+ glEvalCoord1d
+ glEvalCoord1dv
+ glEvalCoord1f
+ glEvalCoord1fv
+ glEvalCoord2d
+ glEvalCoord2dv
+ glEvalCoord2f
+ glEvalCoord2fv
+ glEvalMesh1
+ glEvalPoint1
+ glEvalMesh2
+ glEvalPoint2
+ glAlphaFunc
+ glBlendFunc
+ glLogicOp
+ glStencilFunc
+ glStencilOp
+ glDepthFunc
+ glPixelZoom
+ glPixelTransferf
+ glPixelTransferi
+ glPixelStoref
+ glPixelStorei
+ glPixelMapfv
+ glPixelMapuiv
+ glPixelMapusv
+ glReadBuffer
+ glCopyPixels
+ glReadPixels
+ glDrawPixels
+ glGetBooleanv
+ glGetClipPlane
+ glGetDoublev
+ glGetError
+ glGetFloatv
+ glGetIntegerv
+ glGetLightfv
+ glGetLightiv
+ glGetMapdv
+ glGetMapfv
+ glGetMapiv
+ glGetMaterialfv
+ glGetMaterialiv
+ glGetPixelMapfv
+ glGetPixelMapuiv
+ glGetPixelMapusv
+ glGetPolygonStipple
+ glGetString
+ glGetTexEnvfv
+ glGetTexEnviv
+ glGetTexGendv
+ glGetTexGenfv
+ glGetTexGeniv
+ glGetTexImage
+ glGetTexParameterfv
+ glGetTexParameteriv
+ glGetTexLevelParameterfv
+ glGetTexLevelParameteriv
+ glIsEnabled
+ glIsList
+ glDepthRange
+ glFrustum
+ glLoadIdentity
+ glLoadMatrixf
+ glLoadMatrixd
+ glMatrixMode
+ glMultMatrixf
+ glMultMatrixd
+ glOrtho
+ glPopMatrix
+ glPushMatrix
+ glRotated
+ glRotatef
+ glScaled
+ glScalef
+ glTranslated
+ glTranslatef
+ glViewport
+ glArrayElement
+ glColorPointer
+ glDisableClientState
+ glDrawArrays
+ glDrawElements
+ glEdgeFlagPointer
+ glEnableClientState
+ glGetPointerv
+ glIndexPointer
+ glInterleavedArrays
+ glNormalPointer
+ glTexCoordPointer
+ glVertexPointer
+ glPolygonOffset
+ glCopyTexImage1D
+ glCopyTexImage2D
+ glCopyTexSubImage1D
+ glCopyTexSubImage2D
+ glTexSubImage1D
+ glTexSubImage2D
+ glAreTexturesResident
+ glBindTexture
+ glDeleteTextures
+ glGenTextures
+ glIsTexture
+ glPrioritizeTextures
+ glIndexub
+ glIndexubv
+ glPopClientAttrib
+ glPushClientAttrib
+ glBlendColor
+ glBlendEquation
+ glDrawRangeElements
+ glColorTable
+ glColorTableParameterfv
+ glColorTableParameteriv
+ glCopyColorTable
+ glGetColorTable
+ glGetColorTableParameterfv
+ glGetColorTableParameteriv
+ glColorSubTable
+ glCopyColorSubTable
+ glConvolutionFilter1D
+ glConvolutionFilter2D
+ glConvolutionParameterf
+ glConvolutionParameterfv
+ glConvolutionParameteri
+ glConvolutionParameteriv
+ glCopyConvolutionFilter1D
+ glCopyConvolutionFilter2D
+ glGetConvolutionFilter
+ glGetConvolutionParameterfv
+ glGetConvolutionParameteriv
+ glGetSeparableFilter
+ glSeparableFilter2D
+ glGetHistogram
+ glGetHistogramParameterfv
+ glGetHistogramParameteriv
+ glGetMinmax
+ glGetMinmaxParameterfv
+ glGetMinmaxParameteriv
+ glHistogram
+ glMinmax
+ glResetHistogram
+ glResetMinmax
+ glTexImage3D
+ glTexSubImage3D
+ glCopyTexSubImage3D
+ glActiveTextureARB
+ glClientActiveTextureARB
+ glMultiTexCoord1dARB
+ glMultiTexCoord1dvARB
+ glMultiTexCoord1fARB
+ glMultiTexCoord1fvARB
+ glMultiTexCoord1iARB
+ glMultiTexCoord1ivARB
+ glMultiTexCoord1sARB
+ glMultiTexCoord1svARB
+ glMultiTexCoord2dARB
+ glMultiTexCoord2dvARB
+ glMultiTexCoord2fARB
+ glMultiTexCoord2fvARB
+ glMultiTexCoord2iARB
+ glMultiTexCoord2ivARB
+ glMultiTexCoord2sARB
+ glMultiTexCoord2svARB
+ glMultiTexCoord3dARB
+ glMultiTexCoord3dvARB
+ glMultiTexCoord3fARB
+ glMultiTexCoord3fvARB
+ glMultiTexCoord3iARB
+ glMultiTexCoord3ivARB
+ glMultiTexCoord3sARB
+ glMultiTexCoord3svARB
+ glMultiTexCoord4dARB
+ glMultiTexCoord4dvARB
+ glMultiTexCoord4fARB
+ glMultiTexCoord4fvARB
+ glMultiTexCoord4iARB
+ glMultiTexCoord4ivARB
+ glMultiTexCoord4sARB
+ glMultiTexCoord4svARB
+ glLoadTransposeMatrixfARB
+ glLoadTransposeMatrixdARB
+ glMultTransposeMatrixfARB
+ glMultTransposeMatrixdARB
+ glSampleCoverageARB
+ glCompressedTexImage3DARB
+ glCompressedTexImage2DARB
+ glCompressedTexImage1DARB
+ glCompressedTexSubImage3DARB
+ glCompressedTexSubImage2DARB
+ glCompressedTexSubImage1DARB
+ glGetCompressedTexImageARB
+ glActiveTexture
+ glClientActiveTexture
+ glMultiTexCoord1d
+ glMultiTexCoord1dv
+ glMultiTexCoord1f
+ glMultiTexCoord1fv
+ glMultiTexCoord1i
+ glMultiTexCoord1iv
+ glMultiTexCoord1s
+ glMultiTexCoord1sv
+ glMultiTexCoord2d
+ glMultiTexCoord2dv
+ glMultiTexCoord2f
+ glMultiTexCoord2fv
+ glMultiTexCoord2i
+ glMultiTexCoord2iv
+ glMultiTexCoord2s
+ glMultiTexCoord2sv
+ glMultiTexCoord3d
+ glMultiTexCoord3dv
+ glMultiTexCoord3f
+ glMultiTexCoord3fv
+ glMultiTexCoord3i
+ glMultiTexCoord3iv
+ glMultiTexCoord3s
+ glMultiTexCoord3sv
+ glMultiTexCoord4d
+ glMultiTexCoord4dv
+ glMultiTexCoord4f
+ glMultiTexCoord4fv
+ glMultiTexCoord4i
+ glMultiTexCoord4iv
+ glMultiTexCoord4s
+ glMultiTexCoord4sv
+ glLoadTransposeMatrixf
+ glLoadTransposeMatrixd
+ glMultTransposeMatrixf
+ glMultTransposeMatrixd
+ glSampleCoverage
+ glCompressedTexImage3D
+ glCompressedTexImage2D
+ glCompressedTexImage1D
+ glCompressedTexSubImage3D
+ glCompressedTexSubImage2D
+ glCompressedTexSubImage1D
+ glGetCompressedTexImage
+ glBlendColorEXT
+ glPolygonOffsetEXT
+ glTexImage3DEXT
+ glTexSubImage3DEXT
+ glTexSubImage1DEXT
+ glTexSubImage2DEXT
+ glCopyTexImage1DEXT
+ glCopyTexImage2DEXT
+ glCopyTexSubImage1DEXT
+ glCopyTexSubImage2DEXT
+ glCopyTexSubImage3DEXT
+ glAreTexturesResidentEXT
+ glBindTextureEXT
+ glDeleteTexturesEXT
+ glGenTexturesEXT
+ glIsTextureEXT
+ glPrioritizeTexturesEXT
+ glArrayElementEXT
+ glColorPointerEXT
+ glDrawArraysEXT
+ glEdgeFlagPointerEXT
+ glGetPointervEXT
+ glIndexPointerEXT
+ glNormalPointerEXT
+ glTexCoordPointerEXT
+ glVertexPointerEXT
+ glBlendEquationEXT
+ glPointParameterfEXT
+ glPointParameterfvEXT
+ glPointParameterfARB
+ glPointParameterfvARB
+ glColorTableEXT
+ glGetColorTableEXT
+ glGetColorTableParameterivEXT
+ glGetColorTableParameterfvEXT
+ glLockArraysEXT
+ glUnlockArraysEXT
+ glDrawRangeElementsEXT
+ glSecondaryColor3bEXT
+ glSecondaryColor3bvEXT
+ glSecondaryColor3dEXT
+ glSecondaryColor3dvEXT
+ glSecondaryColor3fEXT
+ glSecondaryColor3fvEXT
+ glSecondaryColor3iEXT
+ glSecondaryColor3ivEXT
+ glSecondaryColor3sEXT
+ glSecondaryColor3svEXT
+ glSecondaryColor3ubEXT
+ glSecondaryColor3ubvEXT
+ glSecondaryColor3uiEXT
+ glSecondaryColor3uivEXT
+ glSecondaryColor3usEXT
+ glSecondaryColor3usvEXT
+ glSecondaryColorPointerEXT
+ glMultiDrawArraysEXT
+ glMultiDrawElementsEXT
+ glFogCoordfEXT
+ glFogCoordfvEXT
+ glFogCoorddEXT
+ glFogCoorddvEXT
+ glFogCoordPointerEXT
+ glBlendFuncSeparateEXT
+ glFlushVertexArrayRangeNV
+ glVertexArrayRangeNV
+ glCombinerParameterfvNV
+ glCombinerParameterfNV
+ glCombinerParameterivNV
+ glCombinerParameteriNV
+ glCombinerInputNV
+ glCombinerOutputNV
+ glFinalCombinerInputNV
+ glGetCombinerInputParameterfvNV
+ glGetCombinerInputParameterivNV
+ glGetCombinerOutputParameterfvNV
+ glGetCombinerOutputParameterivNV
+ glGetFinalCombinerInputParameterfvNV
+ glGetFinalCombinerInputParameterivNV
+ glResizeBuffersMESA
+ glWindowPos2dMESA
+ glWindowPos2dvMESA
+ glWindowPos2fMESA
+ glWindowPos2fvMESA
+ glWindowPos2iMESA
+ glWindowPos2ivMESA
+ glWindowPos2sMESA
+ glWindowPos2svMESA
+ glWindowPos3dMESA
+ glWindowPos3dvMESA
+ glWindowPos3fMESA
+ glWindowPos3fvMESA
+ glWindowPos3iMESA
+ glWindowPos3ivMESA
+ glWindowPos3sMESA
+ glWindowPos3svMESA
+ glWindowPos4dMESA
+ glWindowPos4dvMESA
+ glWindowPos4fMESA
+ glWindowPos4fvMESA
+ glWindowPos4iMESA
+ glWindowPos4ivMESA
+ glWindowPos4sMESA
+ glWindowPos4svMESA
+ glWindowPos2dARB
+ glWindowPos2fARB
+ glWindowPos2iARB
+ glWindowPos2sARB
+ glWindowPos2dvARB
+ glWindowPos2fvARB
+ glWindowPos2ivARB
+ glWindowPos2svARB
+ glWindowPos3dARB
+ glWindowPos3fARB
+ glWindowPos3iARB
+ glWindowPos3sARB
+ glWindowPos3dvARB
+ glWindowPos3fvARB
+ glWindowPos3ivARB
+ glWindowPos3svARB
+ glAreProgramsResidentNV
+ glBindProgramNV
+ glDeleteProgramsNV
+ glExecuteProgramNV
+ glGenProgramsNV
+ glGetProgramParameterdvNV
+ glGetProgramParameterfvNV
+ glGetProgramivNV
+ glGetProgramStringNV
+ glGetTrackMatrixivNV
+ glGetVertexAttribdvNV
+ glGetVertexAttribfvNV
+ glGetVertexAttribivNV
+ glGetVertexAttribPointervNV
+ glIsProgramNV
+ glLoadProgramNV
+ glProgramParameter4dNV
+ glProgramParameter4dvNV
+ glProgramParameter4fNV
+ glProgramParameter4fvNV
+ glProgramParameters4dvNV
+ glProgramParameters4fvNV
+ glRequestResidentProgramsNV
+ glTrackMatrixNV
+ glVertexAttribPointerNV
+ glVertexAttrib1dNV
+ glVertexAttrib1dvNV
+ glVertexAttrib1fNV
+ glVertexAttrib1fvNV
+ glVertexAttrib1sNV
+ glVertexAttrib1svNV
+ glVertexAttrib2dNV
+ glVertexAttrib2dvNV
+ glVertexAttrib2fNV
+ glVertexAttrib2fvNV
+ glVertexAttrib2sNV
+ glVertexAttrib2svNV
+ glVertexAttrib3dNV
+ glVertexAttrib3dvNV
+ glVertexAttrib3fNV
+ glVertexAttrib3fvNV
+ glVertexAttrib3sNV
+ glVertexAttrib3svNV
+ glVertexAttrib4dNV
+ glVertexAttrib4dvNV
+ glVertexAttrib4fNV
+ glVertexAttrib4fvNV
+ glVertexAttrib4sNV
+ glVertexAttrib4svNV
+ glVertexAttrib4ubNV
+ glVertexAttrib4ubvNV
+ glVertexAttribs1dvNV
+ glVertexAttribs1fvNV
+ glVertexAttribs1svNV
+ glVertexAttribs2dvNV
+ glVertexAttribs2fvNV
+ glVertexAttribs2svNV
+ glVertexAttribs3dvNV
+ glVertexAttribs3fvNV
+ glVertexAttribs3svNV
+ glVertexAttribs4dvNV
+ glVertexAttribs4fvNV
+ glVertexAttribs4svNV
+ glVertexAttribs4ubvNV
+ glPointParameteriNV
+ glPointParameterivNV
+ glFogCoordf
+ glFogCoordfv
+ glFogCoordd
+ glFogCoorddv
+ glFogCoordPointer
+ glMultiDrawArrays
+ glMultiDrawElements
+ glPointParameterf
+ glPointParameterfv
+ glPointParameteri
+ glPointParameteriv
+ glSecondaryColor3b
+ glSecondaryColor3bv
+ glSecondaryColor3d
+ glSecondaryColor3dv
+ glSecondaryColor3f
+ glSecondaryColor3fv
+ glSecondaryColor3i
+ glSecondaryColor3iv
+ glSecondaryColor3s
+ glSecondaryColor3sv
+ glSecondaryColor3ub
+ glSecondaryColor3ubv
+ glSecondaryColor3ui
+ glSecondaryColor3uiv
+ glSecondaryColor3us
+ glSecondaryColor3usv
+ glSecondaryColorPointer
+ glWindowPos2d
+ glWindowPos2dv
+ glWindowPos2f
+ glWindowPos2fv
+ glWindowPos2i
+ glWindowPos2iv
+ glWindowPos2s
+ glWindowPos2sv
+ glWindowPos3d
+ glWindowPos3dv
+ glWindowPos3f
+ glWindowPos3fv
+ glWindowPos3i
+ glWindowPos3iv
+ glWindowPos3s
+ glWindowPos3sv
+ glVertexAttrib1sARB
+ glVertexAttrib1fARB
+ glVertexAttrib1dARB
+ glVertexAttrib2sARB
+ glVertexAttrib2fARB
+ glVertexAttrib2dARB
+ glVertexAttrib3sARB
+ glVertexAttrib3fARB
+ glVertexAttrib3dARB
+ glVertexAttrib4sARB
+ glVertexAttrib4fARB
+ glVertexAttrib4dARB
+ glVertexAttrib4NubARB
+ glVertexAttrib1svARB
+ glVertexAttrib1fvARB
+ glVertexAttrib1dvARB
+ glVertexAttrib2svARB
+ glVertexAttrib2fvARB
+ glVertexAttrib2dvARB
+ glVertexAttrib3svARB
+ glVertexAttrib3fvARB
+ glVertexAttrib3dvARB
+ glVertexAttrib4bvARB
+ glVertexAttrib4svARB
+ glVertexAttrib4ivARB
+ glVertexAttrib4ubvARB
+ glVertexAttrib4usvARB
+ glVertexAttrib4uivARB
+ glVertexAttrib4fvARB
+ glVertexAttrib4dvARB
+ glVertexAttrib4NbvARB
+ glVertexAttrib4NsvARB
+ glVertexAttrib4NivARB
+ glVertexAttrib4NubvARB
+ glVertexAttrib4NusvARB
+ glVertexAttrib4NuivARB
+ glVertexAttribPointerARB
+ glEnableVertexAttribArrayARB
+ glDisableVertexAttribArrayARB
+ glProgramStringARB
+ glBindProgramARB
+ glDeleteProgramsARB
+ glGenProgramsARB
+ glIsProgramARB
+ glProgramEnvParameter4dARB
+ glProgramEnvParameter4dvARB
+ glProgramEnvParameter4fARB
+ glProgramEnvParameter4fvARB
+ glProgramLocalParameter4dARB
+ glProgramLocalParameter4dvARB
+ glProgramLocalParameter4fARB
+ glProgramLocalParameter4fvARB
+ glGetProgramEnvParameterdvARB
+ glGetProgramEnvParameterfvARB
+ glGetProgramLocalParameterdvARB
+ glGetProgramLocalParameterfvARB
+ glGetProgramivARB
+ glGetProgramStringARB
+ glGetVertexAttribdvARB
+ glGetVertexAttribfvARB
+ glGetVertexAttribivARB
+ glGetVertexAttribPointervARB
+ glProgramNamedParameter4fNV
+ glProgramNamedParameter4dNV
+ glProgramNamedParameter4fvNV
+ glProgramNamedParameter4dvNV
+ glGetProgramNamedParameterfvNV
+ glGetProgramNamedParameterdvNV
+ glBindBufferARB
+ glBufferDataARB
+ glBufferSubDataARB
+ glDeleteBuffersARB
+ glGenBuffersARB
+ glGetBufferParameterivARB
+ glGetBufferPointervARB
+ glGetBufferSubDataARB
+ glIsBufferARB
+ glMapBufferARB
+ glUnmapBufferARB
+ glGenQueriesARB
+ glDeleteQueriesARB
+ glIsQueryARB
+ glBeginQueryARB
+ glEndQueryARB
+ glGetQueryivARB
+ glGetQueryObjectivARB
+ glGetQueryObjectuivARB
+ glBindBuffer
+ glBufferData
+ glBufferSubData
+ glDeleteBuffers
+ glGenBuffers
+ glGetBufferParameteriv
+ glGetBufferPointerv
+ glGetBufferSubData
+ glIsBuffer
+ glMapBuffer
+ glUnmapBuffer
+ glGenQueries
+ glDeleteQueries
+ glIsQuery
+ glBeginQuery
+ glEndQuery
+ glGetQueryiv
+ glGetQueryObjectiv
+ glGetQueryObjectuiv
+;
+; WGL API
+ wglChoosePixelFormat
+ wglCopyContext
+ wglCreateContext
+ wglCreateLayerContext
+ wglDeleteContext
+ wglDescribeLayerPlane
+ wglDescribePixelFormat
+ wglGetCurrentContext
+ wglGetCurrentDC
+ wglGetLayerPaletteEntries
+ wglGetPixelFormat
+ wglGetProcAddress
+ wglMakeCurrent
+ wglRealizeLayerPalette
+ wglSetLayerPaletteEntries
+ wglSetPixelFormat
+ wglShareLists
+ wglSwapBuffers
+ wglSwapLayerBuffers
+ wglUseFontBitmapsA
+ wglUseFontBitmapsW
+ wglUseFontOutlinesA
+ wglUseFontOutlinesW
+ wglGetExtensionsStringARB
diff --git a/mesalib/src/mesa/drivers/windows/gdi/wgl.c b/mesalib/src/mesa/drivers/windows/gdi/wgl.c
index bf4ca9c90..d9285c420 100644
--- a/mesalib/src/mesa/drivers/windows/gdi/wgl.c
+++ b/mesalib/src/mesa/drivers/windows/gdi/wgl.c
@@ -1,707 +1,707 @@
-
-/*
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public
- * License along with this library; if not, write to the Free
- * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- */
-
-/*
- * File name : wgl.c
- * WGL stuff. Added by Oleg Letsinsky, ajl@ultersys.ru
- * Some things originated from the 3Dfx WGL functions
- */
-
-/*
- * This file contains the implementation of the wgl* functions for
- * Mesa on Windows. Since these functions are provided by Windows in
- * GDI/OpenGL, we must supply our versions that work with Mesa here.
- */
-
-
-/* We're essentially building part of GDI here, so define this so that
- * we get the right export linkage. */
-#ifdef __MINGW32__
-
-#include <stdarg.h>
-#include <windef.h>
-#include <wincon.h>
-#include <winbase.h>
-
-# if defined(BUILD_GL32)
-# define WINGDIAPI __declspec(dllexport)
-# else
-# define __W32API_USE_DLLIMPORT__
-# endif
-
-#include <wingdi.h>
-#include "GL/mesa_wgl.h"
-#include <stdlib.h>
-
-#else
-
-#define _GDI32_
-#include <windows.h>
-
-#endif
-#include "main/config.h"
-#include "glapi/glapi.h"
-#include "GL/wmesa.h" /* protos for wmesa* functions */
-
-/*
- * Pixel Format Descriptors
- */
-
-/* Extend the PFD to include DB flag */
-struct __pixelformat__
-{
- PIXELFORMATDESCRIPTOR pfd;
- GLboolean doubleBuffered;
-};
-
-
-
-/* These are the PFD's supported by this driver. */
-struct __pixelformat__ pfd[] =
-{
-#if 0
- /* Double Buffer, alpha */
- {
- {
- sizeof(PIXELFORMATDESCRIPTOR), 1,
- PFD_DRAW_TO_WINDOW|PFD_SUPPORT_OPENGL|
- PFD_GENERIC_FORMAT|PFD_DOUBLEBUFFER|PFD_SWAP_COPY,
- PFD_TYPE_RGBA,
- 24,
- 8, 0,
- 8, 8,
- 8, 16,
- 8, 24,
- 0, 0, 0, 0, 0,
- DEFAULT_SOFTWARE_DEPTH_BITS, 8,
- 0, 0, 0,
- 0, 0, 0
- },
- GL_TRUE
- },
- /* Single Buffer, alpha */
- {
- {
- sizeof(PIXELFORMATDESCRIPTOR), 1,
- PFD_DRAW_TO_WINDOW|PFD_SUPPORT_OPENGL|
- PFD_GENERIC_FORMAT,
- PFD_TYPE_RGBA,
- 24,
- 8, 0,
- 8, 8,
- 8, 16,
- 8, 24,
- 0, 0, 0, 0, 0,
- DEFAULT_SOFTWARE_DEPTH_BITS, 8,
- 0, 0, 0,
- 0, 0, 0
- },
- GL_FALSE
- },
-#endif
- /* Double Buffer, no alpha */
- {
- {
- sizeof(PIXELFORMATDESCRIPTOR), 1,
- PFD_DRAW_TO_WINDOW|PFD_SUPPORT_OPENGL|
- PFD_GENERIC_FORMAT|PFD_DOUBLEBUFFER|PFD_SWAP_COPY,
- PFD_TYPE_RGBA,
- 24,
- 8, 0,
- 8, 8,
- 8, 16,
- 0, 0,
- 0, 0, 0, 0, 0,
- DEFAULT_SOFTWARE_DEPTH_BITS, 8,
- 0, 0, 0,
- 0, 0, 0
- },
- GL_TRUE
- },
- /* Single Buffer, no alpha */
- {
- {
- sizeof(PIXELFORMATDESCRIPTOR), 1,
- PFD_DRAW_TO_WINDOW|PFD_SUPPORT_OPENGL|
- PFD_GENERIC_FORMAT,
- PFD_TYPE_RGBA,
- 24,
- 8, 0,
- 8, 8,
- 8, 16,
- 0, 0,
- 0, 0, 0, 0, 0,
- DEFAULT_SOFTWARE_DEPTH_BITS, 8,
- 0, 0, 0,
- 0, 0, 0
- },
- GL_FALSE
- },
-};
-
-int npfd = sizeof(pfd) / sizeof(pfd[0]);
-
-
-/*
- * Contexts
- */
-
-typedef struct {
- WMesaContext ctx;
-} MesaWglCtx;
-
-#define MESAWGL_CTX_MAX_COUNT 20
-
-static MesaWglCtx wgl_ctx[MESAWGL_CTX_MAX_COUNT];
-
-static unsigned ctx_count = 0;
-static int ctx_current = -1;
-static unsigned curPFD = 0;
-
-static HDC CurrentHDC = 0;
-
-
-WINGDIAPI HGLRC GLAPIENTRY wglCreateContext(HDC hdc)
-{
- int i = 0;
- if (!ctx_count) {
- for(i=0;i<MESAWGL_CTX_MAX_COUNT;i++) {
- wgl_ctx[i].ctx = NULL;
- }
- }
- for( i = 0; i < MESAWGL_CTX_MAX_COUNT; i++ ) {
- if ( wgl_ctx[i].ctx == NULL ) {
- wgl_ctx[i].ctx =
- WMesaCreateContext(hdc, NULL, (GLboolean)GL_TRUE,
- (GLboolean) (pfd[curPFD-1].doubleBuffered ?
- GL_TRUE : GL_FALSE),
- (GLboolean)(pfd[curPFD-1].pfd.cAlphaBits ?
- GL_TRUE : GL_FALSE) );
- if (wgl_ctx[i].ctx == NULL)
- break;
- ctx_count++;
- return ((HGLRC)wgl_ctx[i].ctx);
- }
- }
- SetLastError(0);
- return(NULL);
-}
-
-WINGDIAPI BOOL GLAPIENTRY wglDeleteContext(HGLRC hglrc)
-{
- int i;
- for ( i = 0; i < MESAWGL_CTX_MAX_COUNT; i++ ) {
- if ( wgl_ctx[i].ctx == (WMesaContext) hglrc ){
- WMesaMakeCurrent((WMesaContext) hglrc, NULL);
- WMesaDestroyContext(wgl_ctx[i].ctx);
- wgl_ctx[i].ctx = NULL;
- ctx_count--;
- return(TRUE);
- }
- }
- SetLastError(0);
- return(FALSE);
-}
-
-WINGDIAPI HGLRC GLAPIENTRY wglGetCurrentContext(VOID)
-{
- if (ctx_current < 0)
- return 0;
- else
- return (HGLRC) wgl_ctx[ctx_current].ctx;
-}
-
-WINGDIAPI HDC GLAPIENTRY wglGetCurrentDC(VOID)
-{
- return CurrentHDC;
-}
-
-WINGDIAPI BOOL GLAPIENTRY wglMakeCurrent(HDC hdc, HGLRC hglrc)
-{
- int i;
-
- CurrentHDC = hdc;
-
- if (!hdc || !hglrc) {
- WMesaMakeCurrent(NULL, NULL);
- ctx_current = -1;
- return TRUE;
- }
-
- for ( i = 0; i < MESAWGL_CTX_MAX_COUNT; i++ ) {
- if ( wgl_ctx[i].ctx == (WMesaContext) hglrc ) {
- WMesaMakeCurrent( (WMesaContext) hglrc, hdc );
- ctx_current = i;
- return TRUE;
- }
- }
- return FALSE;
-}
-
-
-WINGDIAPI int GLAPIENTRY wglChoosePixelFormat(HDC hdc,
- CONST
- PIXELFORMATDESCRIPTOR *ppfd)
-{
- int i,best = -1,bestdelta = 0x7FFFFFFF,delta;
- (void) hdc;
-
- if(ppfd->nSize != sizeof(PIXELFORMATDESCRIPTOR) || ppfd->nVersion != 1)
- {
- SetLastError(0);
- return(0);
- }
- for(i = 0; i < npfd;i++)
- {
- delta = 0;
- if(
- (ppfd->dwFlags & PFD_DRAW_TO_WINDOW) &&
- !(pfd[i].pfd.dwFlags & PFD_DRAW_TO_WINDOW))
- continue;
- if(
- (ppfd->dwFlags & PFD_DRAW_TO_BITMAP) &&
- !(pfd[i].pfd.dwFlags & PFD_DRAW_TO_BITMAP))
- continue;
- if(
- (ppfd->dwFlags & PFD_SUPPORT_GDI) &&
- !(pfd[i].pfd.dwFlags & PFD_SUPPORT_GDI))
- continue;
- if(
- (ppfd->dwFlags & PFD_SUPPORT_OPENGL) &&
- !(pfd[i].pfd.dwFlags & PFD_SUPPORT_OPENGL))
- continue;
- if(
- !(ppfd->dwFlags & PFD_DOUBLEBUFFER_DONTCARE) &&
- ((ppfd->dwFlags & PFD_DOUBLEBUFFER) !=
- (pfd[i].pfd.dwFlags & PFD_DOUBLEBUFFER)))
- continue;
- if(
- !(ppfd->dwFlags & PFD_STEREO_DONTCARE) &&
- ((ppfd->dwFlags & PFD_STEREO) !=
- (pfd[i].pfd.dwFlags & PFD_STEREO)))
- continue;
- if(ppfd->iPixelType != pfd[i].pfd.iPixelType)
- delta++;
- if(ppfd->cAlphaBits != pfd[i].pfd.cAlphaBits)
- delta++;
- if(delta < bestdelta)
- {
- best = i + 1;
- bestdelta = delta;
- if(bestdelta == 0)
- break;
- }
- }
- if(best == -1)
- {
- SetLastError(0);
- return(0);
- }
- return(best);
-}
-
-WINGDIAPI int GLAPIENTRY wglDescribePixelFormat(HDC hdc,
- int iPixelFormat,
- UINT nBytes,
- LPPIXELFORMATDESCRIPTOR ppfd)
-{
- (void) hdc;
-
- if(ppfd == NULL)
- return(npfd);
- if(iPixelFormat < 1 || iPixelFormat > npfd ||
- nBytes != sizeof(PIXELFORMATDESCRIPTOR))
- {
- SetLastError(0);
- return(0);
- }
- *ppfd = pfd[iPixelFormat - 1].pfd;
- return(npfd);
-}
-
-WINGDIAPI PROC GLAPIENTRY wglGetProcAddress(LPCSTR lpszProc)
-{
- PROC p = (PROC) _glapi_get_proc_address((const char *) lpszProc);
- if (p)
- return p;
-
- SetLastError(0);
- return(NULL);
-}
-
-WINGDIAPI int GLAPIENTRY wglGetPixelFormat(HDC hdc)
-{
- (void) hdc;
- if(curPFD == 0) {
- SetLastError(0);
- return(0);
- }
- return(curPFD);
-}
-
-WINGDIAPI BOOL GLAPIENTRY wglSetPixelFormat(HDC hdc,int iPixelFormat,
- const PIXELFORMATDESCRIPTOR *ppfd)
-{
- (void) hdc;
-
- if(iPixelFormat < 1 || iPixelFormat > npfd ||
- ppfd->nSize != sizeof(PIXELFORMATDESCRIPTOR)) {
- SetLastError(0);
- return(FALSE);
- }
- curPFD = iPixelFormat;
- return(TRUE);
-}
-
-WINGDIAPI BOOL GLAPIENTRY wglSwapBuffers(HDC hdc)
-{
- WMesaSwapBuffers(hdc);
- return TRUE;
-}
-
-static FIXED FixedFromDouble(double d)
-{
- long l = (long) (d * 65536L);
- return *(FIXED *) (void *) &l;
-}
-
-
-/*
-** This is cribbed from FX/fxwgl.c, and seems to implement support
-** for bitmap fonts where the wglUseFontBitmapsA() code implements
-** support for outline fonts. In combination they hopefully give
-** fairly generic support for fonts.
-*/
-static BOOL wglUseFontBitmaps_FX(HDC fontDevice, DWORD firstChar,
- DWORD numChars, DWORD listBase)
-{
-#define VERIFY(a) (void)(a)
-
- TEXTMETRIC metric;
- BITMAPINFO *dibInfo;
- HDC bitDevice;
- COLORREF tempColor;
- int i;
-
- VERIFY(GetTextMetrics(fontDevice, &metric));
-
- dibInfo = (BITMAPINFO *) calloc(sizeof(BITMAPINFO) + sizeof(RGBQUAD), 1);
- dibInfo->bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
- dibInfo->bmiHeader.biPlanes = 1;
- dibInfo->bmiHeader.biBitCount = 1;
- dibInfo->bmiHeader.biCompression = BI_RGB;
-
- bitDevice = CreateCompatibleDC(fontDevice);
-
- /* Swap fore and back colors so the bitmap has the right polarity */
- tempColor = GetBkColor(bitDevice);
- SetBkColor(bitDevice, GetTextColor(bitDevice));
- SetTextColor(bitDevice, tempColor);
-
- /* Place chars based on base line */
- VERIFY(SetTextAlign(bitDevice, TA_BASELINE) != GDI_ERROR ? 1 : 0);
-
- for(i = 0; i < (int)numChars; i++) {
- SIZE size;
- char curChar;
- int charWidth,charHeight,bmapWidth,bmapHeight,numBytes,res;
- HBITMAP bitObject;
- HGDIOBJ origBmap;
- unsigned char *bmap;
-
- curChar = (char)(i + firstChar);
-
- /* Find how high/wide this character is */
- VERIFY(GetTextExtentPoint32(bitDevice, &curChar, 1, &size));
-
- /* Create the output bitmap */
- charWidth = size.cx;
- charHeight = size.cy;
- /* Round up to the next multiple of 32 bits */
- bmapWidth = ((charWidth + 31) / 32) * 32;
- bmapHeight = charHeight;
- bitObject = CreateCompatibleBitmap(bitDevice,
- bmapWidth,
- bmapHeight);
- /* VERIFY(bitObject); */
-
- /* Assign the output bitmap to the device */
- origBmap = SelectObject(bitDevice, bitObject);
- (void) VERIFY(origBmap);
-
- VERIFY( PatBlt( bitDevice, 0, 0, bmapWidth, bmapHeight,BLACKNESS ) );
-
- /* Use our source font on the device */
- VERIFY(SelectObject(bitDevice, GetCurrentObject(fontDevice,OBJ_FONT)));
-
- /* Draw the character */
- VERIFY(TextOut(bitDevice, 0, metric.tmAscent, &curChar, 1));
-
- /* Unselect our bmap object */
- VERIFY(SelectObject(bitDevice, origBmap));
-
- /* Convert the display dependant representation to a 1 bit deep DIB */
- numBytes = (bmapWidth * bmapHeight) / 8;
- bmap = malloc(numBytes);
- dibInfo->bmiHeader.biWidth = bmapWidth;
- dibInfo->bmiHeader.biHeight = bmapHeight;
- res = GetDIBits(bitDevice, bitObject, 0, bmapHeight, bmap,
- dibInfo,
- DIB_RGB_COLORS);
- /* VERIFY(res); */
-
- /* Create the GL object */
- glNewList(i + listBase, GL_COMPILE);
- glBitmap(bmapWidth, bmapHeight, 0.0, (GLfloat)metric.tmDescent,
- (GLfloat)charWidth, 0.0,
- bmap);
- glEndList();
- /* CheckGL(); */
-
- /* Destroy the bmap object */
- DeleteObject(bitObject);
-
- /* Deallocate the bitmap data */
- free(bmap);
- }
-
- /* Destroy the DC */
- VERIFY(DeleteDC(bitDevice));
-
- free(dibInfo);
-
- return TRUE;
-#undef VERIFY
-}
-
-WINGDIAPI BOOL GLAPIENTRY wglUseFontBitmapsA(HDC hdc, DWORD first,
- DWORD count, DWORD listBase)
-{
- int i;
- GLuint font_list;
- DWORD size;
- GLYPHMETRICS gm;
- HANDLE hBits;
- LPSTR lpBits;
- MAT2 mat;
- int success = TRUE;
-
- if (count == 0)
- return FALSE;
-
- font_list = listBase;
-
- mat.eM11 = FixedFromDouble(1);
- mat.eM12 = FixedFromDouble(0);
- mat.eM21 = FixedFromDouble(0);
- mat.eM22 = FixedFromDouble(-1);
-
- memset(&gm,0,sizeof(gm));
-
- /*
- ** If we can't get the glyph outline, it may be because this is a fixed
- ** font. Try processing it that way.
- */
- if( GetGlyphOutline(hdc, first, GGO_BITMAP, &gm, 0, NULL, &mat)
- == GDI_ERROR ) {
- return wglUseFontBitmaps_FX( hdc, first, count, listBase );
- }
-
- /*
- ** Otherwise process all desired characters.
- */
- for (i = 0; i < (int)count; i++) {
- DWORD err;
-
- glNewList( font_list+i, GL_COMPILE );
-
- /* allocate space for the bitmap/outline */
- size = GetGlyphOutline(hdc, first + i, GGO_BITMAP,
- &gm, 0, NULL, &mat);
- if (size == GDI_ERROR) {
- glEndList( );
- err = GetLastError();
- success = FALSE;
- continue;
- }
-
- hBits = GlobalAlloc(GHND, size+1);
- lpBits = GlobalLock(hBits);
-
- err =
- GetGlyphOutline(hdc, /* handle to device context */
- first + i, /* character to query */
- GGO_BITMAP, /* format of data to return */
- &gm, /* ptr to structure for metrics*/
- size, /* size of buffer for data */
- lpBits, /* pointer to buffer for data */
- &mat /* pointer to transformation */
- /* matrix structure */
- );
-
- if (err == GDI_ERROR) {
- GlobalUnlock(hBits);
- GlobalFree(hBits);
-
- glEndList( );
- err = GetLastError();
- success = FALSE;
- continue;
- }
-
- glBitmap(gm.gmBlackBoxX,gm.gmBlackBoxY,
- (GLfloat)-gm.gmptGlyphOrigin.x,
- (GLfloat)gm.gmptGlyphOrigin.y,
- (GLfloat)gm.gmCellIncX,
- (GLfloat)gm.gmCellIncY,
- (const GLubyte * )lpBits);
-
- GlobalUnlock(hBits);
- GlobalFree(hBits);
-
- glEndList( );
- }
-
- return success;
-}
-
-WINGDIAPI BOOL GLAPIENTRY wglShareLists(HGLRC hglrc1,
- HGLRC hglrc2)
-{
- WMesaShareLists((WMesaContext)hglrc1, (WMesaContext)hglrc2);
- return(TRUE);
-}
-
-
-
-/* NOT IMPLEMENTED YET */
-WINGDIAPI BOOL GLAPIENTRY wglCopyContext(HGLRC hglrcSrc,
- HGLRC hglrcDst,
- UINT mask)
-{
- (void) hglrcSrc; (void) hglrcDst; (void) mask;
- return(FALSE);
-}
-
-WINGDIAPI HGLRC GLAPIENTRY wglCreateLayerContext(HDC hdc,
- int iLayerPlane)
-{
- SetLastError(0);
- if (iLayerPlane == 0)
- return wglCreateContext( hdc );
- return(NULL);
-}
-
-
-WINGDIAPI BOOL GLAPIENTRY wglUseFontBitmapsW(HDC hdc,
- DWORD first,
- DWORD count,
- DWORD listBase)
-{
- (void) hdc; (void) first; (void) count; (void) listBase;
- return FALSE;
-}
-
-WINGDIAPI BOOL GLAPIENTRY wglUseFontOutlinesA(HDC hdc,
- DWORD first,
- DWORD count,
- DWORD listBase,
- FLOAT deviation,
- FLOAT extrusion,
- int format,
- LPGLYPHMETRICSFLOAT lpgmf)
-{
- (void) hdc; (void) first; (void) count;
- (void) listBase; (void) deviation; (void) extrusion; (void) format;
- (void) lpgmf;
- SetLastError(0);
- return(FALSE);
-}
-
-WINGDIAPI BOOL GLAPIENTRY wglUseFontOutlinesW(HDC hdc,
- DWORD first,
- DWORD count,
- DWORD listBase,
- FLOAT deviation,
- FLOAT extrusion,
- int format,
- LPGLYPHMETRICSFLOAT lpgmf)
-{
- (void) hdc; (void) first; (void) count;
- (void) listBase; (void) deviation; (void) extrusion; (void) format;
- (void) lpgmf;
- SetLastError(0);
- return(FALSE);
-}
-
-WINGDIAPI BOOL GLAPIENTRY wglDescribeLayerPlane(HDC hdc,
- int iPixelFormat,
- int iLayerPlane,
- UINT nBytes,
- LPLAYERPLANEDESCRIPTOR plpd)
-{
- (void) hdc; (void) iPixelFormat; (void) iLayerPlane;
- (void) nBytes; (void) plpd;
- SetLastError(0);
- return(FALSE);
-}
-
-WINGDIAPI int GLAPIENTRY wglSetLayerPaletteEntries(HDC hdc,
- int iLayerPlane,
- int iStart,
- int cEntries,
- CONST COLORREF *pcr)
-{
- (void) hdc; (void) iLayerPlane; (void) iStart;
- (void) cEntries; (void) pcr;
- SetLastError(0);
- return(0);
-}
-
-WINGDIAPI int GLAPIENTRY wglGetLayerPaletteEntries(HDC hdc,
- int iLayerPlane,
- int iStart,
- int cEntries,
- COLORREF *pcr)
-{
- (void) hdc; (void) iLayerPlane; (void) iStart; (void) cEntries; (void) pcr;
- SetLastError(0);
- return(0);
-}
-
-WINGDIAPI BOOL GLAPIENTRY wglRealizeLayerPalette(HDC hdc,
- int iLayerPlane,
- BOOL bRealize)
-{
- (void) hdc; (void) iLayerPlane; (void) bRealize;
- SetLastError(0);
- return(FALSE);
-}
-
-WINGDIAPI BOOL GLAPIENTRY wglSwapLayerBuffers(HDC hdc,
- UINT fuPlanes)
-{
- (void) hdc; (void) fuPlanes;
- SetLastError(0);
- return(FALSE);
-}
-
-WINGDIAPI const char * GLAPIENTRY wglGetExtensionsStringARB(HDC hdc)
-{
- return "WGL_ARB_extensions_string";
-}
+
+/*
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the Free
+ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ */
+
+/*
+ * File name : wgl.c
+ * WGL stuff. Added by Oleg Letsinsky, ajl@ultersys.ru
+ * Some things originated from the 3Dfx WGL functions
+ */
+
+/*
+ * This file contains the implementation of the wgl* functions for
+ * Mesa on Windows. Since these functions are provided by Windows in
+ * GDI/OpenGL, we must supply our versions that work with Mesa here.
+ */
+
+
+/* We're essentially building part of GDI here, so define this so that
+ * we get the right export linkage. */
+#ifdef __MINGW32__
+
+#include <stdarg.h>
+#include <windef.h>
+#include <wincon.h>
+#include <winbase.h>
+
+# if defined(BUILD_GL32)
+# define WINGDIAPI __declspec(dllexport)
+# else
+# define __W32API_USE_DLLIMPORT__
+# endif
+
+#include <wingdi.h>
+#include "GL/mesa_wgl.h"
+#include <stdlib.h>
+
+#else
+
+#define _GDI32_
+#include <windows.h>
+
+#endif
+#include "main/config.h"
+#include "glapi/glapi.h"
+#include "GL/wmesa.h" /* protos for wmesa* functions */
+
+/*
+ * Pixel Format Descriptors
+ */
+
+/* Extend the PFD to include DB flag */
+struct __pixelformat__
+{
+ PIXELFORMATDESCRIPTOR pfd;
+ GLboolean doubleBuffered;
+};
+
+
+
+/* These are the PFD's supported by this driver. */
+struct __pixelformat__ pfd[] =
+{
+#if 0
+ /* Double Buffer, alpha */
+ {
+ {
+ sizeof(PIXELFORMATDESCRIPTOR), 1,
+ PFD_DRAW_TO_WINDOW|PFD_SUPPORT_OPENGL|
+ PFD_GENERIC_FORMAT|PFD_DOUBLEBUFFER|PFD_SWAP_COPY,
+ PFD_TYPE_RGBA,
+ 24,
+ 8, 0,
+ 8, 8,
+ 8, 16,
+ 8, 24,
+ 0, 0, 0, 0, 0,
+ DEFAULT_SOFTWARE_DEPTH_BITS, 8,
+ 0, 0, 0,
+ 0, 0, 0
+ },
+ GL_TRUE
+ },
+ /* Single Buffer, alpha */
+ {
+ {
+ sizeof(PIXELFORMATDESCRIPTOR), 1,
+ PFD_DRAW_TO_WINDOW|PFD_SUPPORT_OPENGL|
+ PFD_GENERIC_FORMAT,
+ PFD_TYPE_RGBA,
+ 24,
+ 8, 0,
+ 8, 8,
+ 8, 16,
+ 8, 24,
+ 0, 0, 0, 0, 0,
+ DEFAULT_SOFTWARE_DEPTH_BITS, 8,
+ 0, 0, 0,
+ 0, 0, 0
+ },
+ GL_FALSE
+ },
+#endif
+ /* Double Buffer, no alpha */
+ {
+ {
+ sizeof(PIXELFORMATDESCRIPTOR), 1,
+ PFD_DRAW_TO_WINDOW|PFD_SUPPORT_OPENGL|
+ PFD_GENERIC_FORMAT|PFD_DOUBLEBUFFER|PFD_SWAP_COPY,
+ PFD_TYPE_RGBA,
+ 24,
+ 8, 0,
+ 8, 8,
+ 8, 16,
+ 0, 0,
+ 0, 0, 0, 0, 0,
+ DEFAULT_SOFTWARE_DEPTH_BITS, 8,
+ 0, 0, 0,
+ 0, 0, 0
+ },
+ GL_TRUE
+ },
+ /* Single Buffer, no alpha */
+ {
+ {
+ sizeof(PIXELFORMATDESCRIPTOR), 1,
+ PFD_DRAW_TO_WINDOW|PFD_SUPPORT_OPENGL|
+ PFD_GENERIC_FORMAT,
+ PFD_TYPE_RGBA,
+ 24,
+ 8, 0,
+ 8, 8,
+ 8, 16,
+ 0, 0,
+ 0, 0, 0, 0, 0,
+ DEFAULT_SOFTWARE_DEPTH_BITS, 8,
+ 0, 0, 0,
+ 0, 0, 0
+ },
+ GL_FALSE
+ },
+};
+
+int npfd = sizeof(pfd) / sizeof(pfd[0]);
+
+
+/*
+ * Contexts
+ */
+
+typedef struct {
+ WMesaContext ctx;
+} MesaWglCtx;
+
+#define MESAWGL_CTX_MAX_COUNT 20
+
+static MesaWglCtx wgl_ctx[MESAWGL_CTX_MAX_COUNT];
+
+static unsigned ctx_count = 0;
+static int ctx_current = -1;
+static unsigned curPFD = 0;
+
+static HDC CurrentHDC = 0;
+
+
+WINGDIAPI HGLRC GLAPIENTRY wglCreateContext(HDC hdc)
+{
+ int i = 0;
+ if (!ctx_count) {
+ for(i=0;i<MESAWGL_CTX_MAX_COUNT;i++) {
+ wgl_ctx[i].ctx = NULL;
+ }
+ }
+ for( i = 0; i < MESAWGL_CTX_MAX_COUNT; i++ ) {
+ if ( wgl_ctx[i].ctx == NULL ) {
+ wgl_ctx[i].ctx =
+ WMesaCreateContext(hdc, NULL, (GLboolean)GL_TRUE,
+ (GLboolean) (pfd[curPFD-1].doubleBuffered ?
+ GL_TRUE : GL_FALSE),
+ (GLboolean)(pfd[curPFD-1].pfd.cAlphaBits ?
+ GL_TRUE : GL_FALSE) );
+ if (wgl_ctx[i].ctx == NULL)
+ break;
+ ctx_count++;
+ return ((HGLRC)wgl_ctx[i].ctx);
+ }
+ }
+ SetLastError(0);
+ return(NULL);
+}
+
+WINGDIAPI BOOL GLAPIENTRY wglDeleteContext(HGLRC hglrc)
+{
+ int i;
+ for ( i = 0; i < MESAWGL_CTX_MAX_COUNT; i++ ) {
+ if ( wgl_ctx[i].ctx == (WMesaContext) hglrc ){
+ WMesaMakeCurrent((WMesaContext) hglrc, NULL);
+ WMesaDestroyContext(wgl_ctx[i].ctx);
+ wgl_ctx[i].ctx = NULL;
+ ctx_count--;
+ return(TRUE);
+ }
+ }
+ SetLastError(0);
+ return(FALSE);
+}
+
+WINGDIAPI HGLRC GLAPIENTRY wglGetCurrentContext(VOID)
+{
+ if (ctx_current < 0)
+ return 0;
+ else
+ return (HGLRC) wgl_ctx[ctx_current].ctx;
+}
+
+WINGDIAPI HDC GLAPIENTRY wglGetCurrentDC(VOID)
+{
+ return CurrentHDC;
+}
+
+WINGDIAPI BOOL GLAPIENTRY wglMakeCurrent(HDC hdc, HGLRC hglrc)
+{
+ int i;
+
+ CurrentHDC = hdc;
+
+ if (!hdc || !hglrc) {
+ WMesaMakeCurrent(NULL, NULL);
+ ctx_current = -1;
+ return TRUE;
+ }
+
+ for ( i = 0; i < MESAWGL_CTX_MAX_COUNT; i++ ) {
+ if ( wgl_ctx[i].ctx == (WMesaContext) hglrc ) {
+ WMesaMakeCurrent( (WMesaContext) hglrc, hdc );
+ ctx_current = i;
+ return TRUE;
+ }
+ }
+ return FALSE;
+}
+
+
+WINGDIAPI int GLAPIENTRY wglChoosePixelFormat(HDC hdc,
+ CONST
+ PIXELFORMATDESCRIPTOR *ppfd)
+{
+ int i,best = -1,bestdelta = 0x7FFFFFFF,delta;
+ (void) hdc;
+
+ if(ppfd->nSize != sizeof(PIXELFORMATDESCRIPTOR) || ppfd->nVersion != 1)
+ {
+ SetLastError(0);
+ return(0);
+ }
+ for(i = 0; i < npfd;i++)
+ {
+ delta = 0;
+ if(
+ (ppfd->dwFlags & PFD_DRAW_TO_WINDOW) &&
+ !(pfd[i].pfd.dwFlags & PFD_DRAW_TO_WINDOW))
+ continue;
+ if(
+ (ppfd->dwFlags & PFD_DRAW_TO_BITMAP) &&
+ !(pfd[i].pfd.dwFlags & PFD_DRAW_TO_BITMAP))
+ continue;
+ if(
+ (ppfd->dwFlags & PFD_SUPPORT_GDI) &&
+ !(pfd[i].pfd.dwFlags & PFD_SUPPORT_GDI))
+ continue;
+ if(
+ (ppfd->dwFlags & PFD_SUPPORT_OPENGL) &&
+ !(pfd[i].pfd.dwFlags & PFD_SUPPORT_OPENGL))
+ continue;
+ if(
+ !(ppfd->dwFlags & PFD_DOUBLEBUFFER_DONTCARE) &&
+ ((ppfd->dwFlags & PFD_DOUBLEBUFFER) !=
+ (pfd[i].pfd.dwFlags & PFD_DOUBLEBUFFER)))
+ continue;
+ if(
+ !(ppfd->dwFlags & PFD_STEREO_DONTCARE) &&
+ ((ppfd->dwFlags & PFD_STEREO) !=
+ (pfd[i].pfd.dwFlags & PFD_STEREO)))
+ continue;
+ if(ppfd->iPixelType != pfd[i].pfd.iPixelType)
+ delta++;
+ if(ppfd->cAlphaBits != pfd[i].pfd.cAlphaBits)
+ delta++;
+ if(delta < bestdelta)
+ {
+ best = i + 1;
+ bestdelta = delta;
+ if(bestdelta == 0)
+ break;
+ }
+ }
+ if(best == -1)
+ {
+ SetLastError(0);
+ return(0);
+ }
+ return(best);
+}
+
+WINGDIAPI int GLAPIENTRY wglDescribePixelFormat(HDC hdc,
+ int iPixelFormat,
+ UINT nBytes,
+ LPPIXELFORMATDESCRIPTOR ppfd)
+{
+ (void) hdc;
+
+ if(ppfd == NULL)
+ return(npfd);
+ if(iPixelFormat < 1 || iPixelFormat > npfd ||
+ nBytes != sizeof(PIXELFORMATDESCRIPTOR))
+ {
+ SetLastError(0);
+ return(0);
+ }
+ *ppfd = pfd[iPixelFormat - 1].pfd;
+ return(npfd);
+}
+
+WINGDIAPI PROC GLAPIENTRY wglGetProcAddress(LPCSTR lpszProc)
+{
+ PROC p = (PROC) _glapi_get_proc_address((const char *) lpszProc);
+ if (p)
+ return p;
+
+ SetLastError(0);
+ return(NULL);
+}
+
+WINGDIAPI int GLAPIENTRY wglGetPixelFormat(HDC hdc)
+{
+ (void) hdc;
+ if(curPFD == 0) {
+ SetLastError(0);
+ return(0);
+ }
+ return(curPFD);
+}
+
+WINGDIAPI BOOL GLAPIENTRY wglSetPixelFormat(HDC hdc,int iPixelFormat,
+ const PIXELFORMATDESCRIPTOR *ppfd)
+{
+ (void) hdc;
+
+ if(iPixelFormat < 1 || iPixelFormat > npfd ||
+ ppfd->nSize != sizeof(PIXELFORMATDESCRIPTOR)) {
+ SetLastError(0);
+ return(FALSE);
+ }
+ curPFD = iPixelFormat;
+ return(TRUE);
+}
+
+WINGDIAPI BOOL GLAPIENTRY wglSwapBuffers(HDC hdc)
+{
+ WMesaSwapBuffers(hdc);
+ return TRUE;
+}
+
+static FIXED FixedFromDouble(double d)
+{
+ long l = (long) (d * 65536L);
+ return *(FIXED *) (void *) &l;
+}
+
+
+/*
+** This is cribbed from FX/fxwgl.c, and seems to implement support
+** for bitmap fonts where the wglUseFontBitmapsA() code implements
+** support for outline fonts. In combination they hopefully give
+** fairly generic support for fonts.
+*/
+static BOOL wglUseFontBitmaps_FX(HDC fontDevice, DWORD firstChar,
+ DWORD numChars, DWORD listBase)
+{
+#define VERIFY(a) (void)(a)
+
+ TEXTMETRIC metric;
+ BITMAPINFO *dibInfo;
+ HDC bitDevice;
+ COLORREF tempColor;
+ int i;
+
+ VERIFY(GetTextMetrics(fontDevice, &metric));
+
+ dibInfo = (BITMAPINFO *) calloc(sizeof(BITMAPINFO) + sizeof(RGBQUAD), 1);
+ dibInfo->bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
+ dibInfo->bmiHeader.biPlanes = 1;
+ dibInfo->bmiHeader.biBitCount = 1;
+ dibInfo->bmiHeader.biCompression = BI_RGB;
+
+ bitDevice = CreateCompatibleDC(fontDevice);
+
+ /* Swap fore and back colors so the bitmap has the right polarity */
+ tempColor = GetBkColor(bitDevice);
+ SetBkColor(bitDevice, GetTextColor(bitDevice));
+ SetTextColor(bitDevice, tempColor);
+
+ /* Place chars based on base line */
+ VERIFY(SetTextAlign(bitDevice, TA_BASELINE) != GDI_ERROR ? 1 : 0);
+
+ for(i = 0; i < (int)numChars; i++) {
+ SIZE size;
+ char curChar;
+ int charWidth,charHeight,bmapWidth,bmapHeight,numBytes,res;
+ HBITMAP bitObject;
+ HGDIOBJ origBmap;
+ unsigned char *bmap;
+
+ curChar = (char)(i + firstChar);
+
+ /* Find how high/wide this character is */
+ VERIFY(GetTextExtentPoint32(bitDevice, &curChar, 1, &size));
+
+ /* Create the output bitmap */
+ charWidth = size.cx;
+ charHeight = size.cy;
+ /* Round up to the next multiple of 32 bits */
+ bmapWidth = ((charWidth + 31) / 32) * 32;
+ bmapHeight = charHeight;
+ bitObject = CreateCompatibleBitmap(bitDevice,
+ bmapWidth,
+ bmapHeight);
+ /* VERIFY(bitObject); */
+
+ /* Assign the output bitmap to the device */
+ origBmap = SelectObject(bitDevice, bitObject);
+ (void) VERIFY(origBmap);
+
+ VERIFY( PatBlt( bitDevice, 0, 0, bmapWidth, bmapHeight,BLACKNESS ) );
+
+ /* Use our source font on the device */
+ VERIFY(SelectObject(bitDevice, GetCurrentObject(fontDevice,OBJ_FONT)));
+
+ /* Draw the character */
+ VERIFY(TextOut(bitDevice, 0, metric.tmAscent, &curChar, 1));
+
+ /* Unselect our bmap object */
+ VERIFY(SelectObject(bitDevice, origBmap));
+
+ /* Convert the display dependant representation to a 1 bit deep DIB */
+ numBytes = (bmapWidth * bmapHeight) / 8;
+ bmap = malloc(numBytes);
+ dibInfo->bmiHeader.biWidth = bmapWidth;
+ dibInfo->bmiHeader.biHeight = bmapHeight;
+ res = GetDIBits(bitDevice, bitObject, 0, bmapHeight, bmap,
+ dibInfo,
+ DIB_RGB_COLORS);
+ /* VERIFY(res); */
+
+ /* Create the GL object */
+ glNewList(i + listBase, GL_COMPILE);
+ glBitmap(bmapWidth, bmapHeight, 0.0, (GLfloat)metric.tmDescent,
+ (GLfloat)charWidth, 0.0,
+ bmap);
+ glEndList();
+ /* CheckGL(); */
+
+ /* Destroy the bmap object */
+ DeleteObject(bitObject);
+
+ /* Deallocate the bitmap data */
+ free(bmap);
+ }
+
+ /* Destroy the DC */
+ VERIFY(DeleteDC(bitDevice));
+
+ free(dibInfo);
+
+ return TRUE;
+#undef VERIFY
+}
+
+WINGDIAPI BOOL GLAPIENTRY wglUseFontBitmapsA(HDC hdc, DWORD first,
+ DWORD count, DWORD listBase)
+{
+ int i;
+ GLuint font_list;
+ DWORD size;
+ GLYPHMETRICS gm;
+ HANDLE hBits;
+ LPSTR lpBits;
+ MAT2 mat;
+ int success = TRUE;
+
+ if (count == 0)
+ return FALSE;
+
+ font_list = listBase;
+
+ mat.eM11 = FixedFromDouble(1);
+ mat.eM12 = FixedFromDouble(0);
+ mat.eM21 = FixedFromDouble(0);
+ mat.eM22 = FixedFromDouble(-1);
+
+ memset(&gm,0,sizeof(gm));
+
+ /*
+ ** If we can't get the glyph outline, it may be because this is a fixed
+ ** font. Try processing it that way.
+ */
+ if( GetGlyphOutline(hdc, first, GGO_BITMAP, &gm, 0, NULL, &mat)
+ == GDI_ERROR ) {
+ return wglUseFontBitmaps_FX( hdc, first, count, listBase );
+ }
+
+ /*
+ ** Otherwise process all desired characters.
+ */
+ for (i = 0; i < (int)count; i++) {
+ DWORD err;
+
+ glNewList( font_list+i, GL_COMPILE );
+
+ /* allocate space for the bitmap/outline */
+ size = GetGlyphOutline(hdc, first + i, GGO_BITMAP,
+ &gm, 0, NULL, &mat);
+ if (size == GDI_ERROR) {
+ glEndList( );
+ err = GetLastError();
+ success = FALSE;
+ continue;
+ }
+
+ hBits = GlobalAlloc(GHND, size+1);
+ lpBits = GlobalLock(hBits);
+
+ err =
+ GetGlyphOutline(hdc, /* handle to device context */
+ first + i, /* character to query */
+ GGO_BITMAP, /* format of data to return */
+ &gm, /* ptr to structure for metrics*/
+ size, /* size of buffer for data */
+ lpBits, /* pointer to buffer for data */
+ &mat /* pointer to transformation */
+ /* matrix structure */
+ );
+
+ if (err == GDI_ERROR) {
+ GlobalUnlock(hBits);
+ GlobalFree(hBits);
+
+ glEndList( );
+ err = GetLastError();
+ success = FALSE;
+ continue;
+ }
+
+ glBitmap(gm.gmBlackBoxX,gm.gmBlackBoxY,
+ (GLfloat)-gm.gmptGlyphOrigin.x,
+ (GLfloat)gm.gmptGlyphOrigin.y,
+ (GLfloat)gm.gmCellIncX,
+ (GLfloat)gm.gmCellIncY,
+ (const GLubyte * )lpBits);
+
+ GlobalUnlock(hBits);
+ GlobalFree(hBits);
+
+ glEndList( );
+ }
+
+ return success;
+}
+
+WINGDIAPI BOOL GLAPIENTRY wglShareLists(HGLRC hglrc1,
+ HGLRC hglrc2)
+{
+ WMesaShareLists((WMesaContext)hglrc1, (WMesaContext)hglrc2);
+ return(TRUE);
+}
+
+
+
+/* NOT IMPLEMENTED YET */
+WINGDIAPI BOOL GLAPIENTRY wglCopyContext(HGLRC hglrcSrc,
+ HGLRC hglrcDst,
+ UINT mask)
+{
+ (void) hglrcSrc; (void) hglrcDst; (void) mask;
+ return(FALSE);
+}
+
+WINGDIAPI HGLRC GLAPIENTRY wglCreateLayerContext(HDC hdc,
+ int iLayerPlane)
+{
+ SetLastError(0);
+ if (iLayerPlane == 0)
+ return wglCreateContext( hdc );
+ return(NULL);
+}
+
+
+WINGDIAPI BOOL GLAPIENTRY wglUseFontBitmapsW(HDC hdc,
+ DWORD first,
+ DWORD count,
+ DWORD listBase)
+{
+ (void) hdc; (void) first; (void) count; (void) listBase;
+ return FALSE;
+}
+
+WINGDIAPI BOOL GLAPIENTRY wglUseFontOutlinesA(HDC hdc,
+ DWORD first,
+ DWORD count,
+ DWORD listBase,
+ FLOAT deviation,
+ FLOAT extrusion,
+ int format,
+ LPGLYPHMETRICSFLOAT lpgmf)
+{
+ (void) hdc; (void) first; (void) count;
+ (void) listBase; (void) deviation; (void) extrusion; (void) format;
+ (void) lpgmf;
+ SetLastError(0);
+ return(FALSE);
+}
+
+WINGDIAPI BOOL GLAPIENTRY wglUseFontOutlinesW(HDC hdc,
+ DWORD first,
+ DWORD count,
+ DWORD listBase,
+ FLOAT deviation,
+ FLOAT extrusion,
+ int format,
+ LPGLYPHMETRICSFLOAT lpgmf)
+{
+ (void) hdc; (void) first; (void) count;
+ (void) listBase; (void) deviation; (void) extrusion; (void) format;
+ (void) lpgmf;
+ SetLastError(0);
+ return(FALSE);
+}
+
+WINGDIAPI BOOL GLAPIENTRY wglDescribeLayerPlane(HDC hdc,
+ int iPixelFormat,
+ int iLayerPlane,
+ UINT nBytes,
+ LPLAYERPLANEDESCRIPTOR plpd)
+{
+ (void) hdc; (void) iPixelFormat; (void) iLayerPlane;
+ (void) nBytes; (void) plpd;
+ SetLastError(0);
+ return(FALSE);
+}
+
+WINGDIAPI int GLAPIENTRY wglSetLayerPaletteEntries(HDC hdc,
+ int iLayerPlane,
+ int iStart,
+ int cEntries,
+ CONST COLORREF *pcr)
+{
+ (void) hdc; (void) iLayerPlane; (void) iStart;
+ (void) cEntries; (void) pcr;
+ SetLastError(0);
+ return(0);
+}
+
+WINGDIAPI int GLAPIENTRY wglGetLayerPaletteEntries(HDC hdc,
+ int iLayerPlane,
+ int iStart,
+ int cEntries,
+ COLORREF *pcr)
+{
+ (void) hdc; (void) iLayerPlane; (void) iStart; (void) cEntries; (void) pcr;
+ SetLastError(0);
+ return(0);
+}
+
+WINGDIAPI BOOL GLAPIENTRY wglRealizeLayerPalette(HDC hdc,
+ int iLayerPlane,
+ BOOL bRealize)
+{
+ (void) hdc; (void) iLayerPlane; (void) bRealize;
+ SetLastError(0);
+ return(FALSE);
+}
+
+WINGDIAPI BOOL GLAPIENTRY wglSwapLayerBuffers(HDC hdc,
+ UINT fuPlanes)
+{
+ (void) hdc; (void) fuPlanes;
+ SetLastError(0);
+ return(FALSE);
+}
+
+WINGDIAPI const char * GLAPIENTRY wglGetExtensionsStringARB(HDC hdc)
+{
+ return "WGL_ARB_extensions_string";
+}
diff --git a/mesalib/src/mesa/drivers/windows/gdi/wmesa.c b/mesalib/src/mesa/drivers/windows/gdi/wmesa.c
index 35a150d06..47580c4e9 100644
--- a/mesalib/src/mesa/drivers/windows/gdi/wmesa.c
+++ b/mesalib/src/mesa/drivers/windows/gdi/wmesa.c
@@ -1,1658 +1,1658 @@
-/*
- * Windows (Win32/Win64) device driver for Mesa
- *
- */
-
-#include "wmesadef.h"
-#include "colors.h"
-#include "GL/wmesa.h"
-#include <winuser.h>
-#include "main/context.h"
-#include "main/extensions.h"
-#include "main/framebuffer.h"
-#include "main/renderbuffer.h"
-#include "main/macros.h"
-#include "drivers/common/driverfuncs.h"
-#include "drivers/common/meta.h"
-#include "vbo/vbo.h"
-#include "swrast/swrast.h"
-#include "swrast_setup/swrast_setup.h"
-#include "tnl/tnl.h"
-#include "tnl/t_context.h"
-#include "tnl/t_pipeline.h"
-
-
-/* linked list of our Framebuffers (windows) */
-static WMesaFramebuffer FirstFramebuffer = NULL;
-
-
-/**
- * Create a new WMesaFramebuffer object which will correspond to the
- * given HDC (Window handle).
- */
-static WMesaFramebuffer
-wmesa_new_framebuffer(HDC hdc, struct gl_config *visual)
-{
- WMesaFramebuffer pwfb
- = (WMesaFramebuffer) malloc(sizeof(struct wmesa_framebuffer));
- if (pwfb) {
- _mesa_initialize_window_framebuffer(&pwfb->Base, visual);
- pwfb->hDC = hdc;
- /* insert at head of list */
- pwfb->next = FirstFramebuffer;
- FirstFramebuffer = pwfb;
- }
- return pwfb;
-}
-
-/**
- * Given an hdc, free the corresponding WMesaFramebuffer
- */
-static void
-wmesa_free_framebuffer(HDC hdc)
-{
- WMesaFramebuffer pwfb, prev;
- for (pwfb = FirstFramebuffer; pwfb; pwfb = pwfb->next) {
- if (pwfb->hDC == hdc)
- break;
- prev = pwfb;
- }
- if (pwfb) {
- struct gl_framebuffer *fb;
- if (pwfb == FirstFramebuffer)
- FirstFramebuffer = pwfb->next;
- else
- prev->next = pwfb->next;
- fb = &pwfb->Base;
- _mesa_reference_framebuffer(&fb, NULL);
- }
-}
-
-/**
- * Given an hdc, return the corresponding WMesaFramebuffer
- */
-static WMesaFramebuffer
-wmesa_lookup_framebuffer(HDC hdc)
-{
- WMesaFramebuffer pwfb;
- for (pwfb = FirstFramebuffer; pwfb; pwfb = pwfb->next) {
- if (pwfb->hDC == hdc)
- return pwfb;
- }
- return NULL;
-}
-
-
-/**
- * Given a struct gl_framebuffer, return the corresponding WMesaFramebuffer.
- */
-static WMesaFramebuffer wmesa_framebuffer(struct gl_framebuffer *fb)
-{
- return (WMesaFramebuffer) fb;
-}
-
-
-/**
- * Given a struct gl_context, return the corresponding WMesaContext.
- */
-static WMesaContext wmesa_context(const struct gl_context *ctx)
-{
- return (WMesaContext) ctx;
-}
-
-
-/*
- * Every driver should implement a GetString function in order to
- * return a meaningful GL_RENDERER string.
- */
-static const GLubyte *wmesa_get_string(struct gl_context *ctx, GLenum name)
-{
- return (name == GL_RENDERER) ?
- (GLubyte *) "Mesa Windows GDI Driver" : NULL;
-}
-
-
-/*
- * Determine the pixel format based on the pixel size.
- */
-static void wmSetPixelFormat(WMesaFramebuffer pwfb, HDC hDC)
-{
- pwfb->cColorBits = GetDeviceCaps(hDC, BITSPIXEL);
-
- /* Only 16 and 32 bit targets are supported now */
- assert(pwfb->cColorBits == 0 ||
- pwfb->cColorBits == 16 ||
- pwfb->cColorBits == 24 ||
- pwfb->cColorBits == 32);
-
- switch(pwfb->cColorBits){
- case 8:
- pwfb->pixelformat = PF_INDEX8;
- break;
- case 16:
- pwfb->pixelformat = PF_5R6G5B;
- break;
- case 24:
- case 32:
- pwfb->pixelformat = PF_8R8G8B;
- break;
- default:
- pwfb->pixelformat = PF_BADFORMAT;
- }
-}
-
-
-/**
- * Create DIB for back buffer.
- * We write into this memory with the span routines and then blit it
- * to the window on a buffer swap.
- */
-static BOOL wmCreateBackingStore(WMesaFramebuffer pwfb, long lxSize, long lySize)
-{
- LPBITMAPINFO pbmi = &(pwfb->bmi);
- HDC hic;
-
- pbmi->bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
- pbmi->bmiHeader.biWidth = lxSize;
- pbmi->bmiHeader.biHeight= -lySize;
- pbmi->bmiHeader.biPlanes = 1;
- pbmi->bmiHeader.biBitCount = GetDeviceCaps(pwfb->hDC, BITSPIXEL);
- pbmi->bmiHeader.biCompression = BI_RGB;
- pbmi->bmiHeader.biSizeImage = 0;
- pbmi->bmiHeader.biXPelsPerMeter = 0;
- pbmi->bmiHeader.biYPelsPerMeter = 0;
- pbmi->bmiHeader.biClrUsed = 0;
- pbmi->bmiHeader.biClrImportant = 0;
-
- pwfb->cColorBits = pbmi->bmiHeader.biBitCount;
- pwfb->ScanWidth = (lxSize * (pwfb->cColorBits / 8) + 3) & ~3;
-
- hic = CreateIC("display", NULL, NULL, NULL);
- pwfb->dib_hDC = CreateCompatibleDC(hic);
-
- pwfb->hbmDIB = CreateDIBSection(hic,
- &pwfb->bmi,
- DIB_RGB_COLORS,
- (void **)&(pwfb->pbPixels),
- 0,
- 0);
- pwfb->hOldBitmap = SelectObject(pwfb->dib_hDC, pwfb->hbmDIB);
-
- DeleteDC(hic);
-
- wmSetPixelFormat(pwfb, pwfb->hDC);
- return TRUE;
-}
-
-
-static void wmDeleteBackingStore(WMesaFramebuffer pwfb)
-{
- if (pwfb->hbmDIB) {
- SelectObject(pwfb->dib_hDC, pwfb->hOldBitmap);
- DeleteDC(pwfb->dib_hDC);
- DeleteObject(pwfb->hbmDIB);
- }
-}
-
-
-/**
- * Find the width and height of the window named by hdc.
- */
-static void
-get_window_size(HDC hdc, GLuint *width, GLuint *height)
-{
- if (WindowFromDC(hdc)) {
- RECT rect;
- GetClientRect(WindowFromDC(hdc), &rect);
- *width = rect.right - rect.left;
- *height = rect.bottom - rect.top;
- }
- else { /* Memory context */
- /* From contributed code - use the size of the desktop
- * for the size of a memory context (?) */
- *width = GetDeviceCaps(hdc, HORZRES);
- *height = GetDeviceCaps(hdc, VERTRES);
- }
-}
-
-
-static void
-wmesa_get_buffer_size(struct gl_framebuffer *buffer, GLuint *width, GLuint *height)
-{
- WMesaFramebuffer pwfb = wmesa_framebuffer(buffer);
- get_window_size(pwfb->hDC, width, height);
-}
-
-
-static void wmesa_flush(struct gl_context *ctx)
-{
- WMesaFramebuffer pwfb = wmesa_framebuffer(ctx->WinSysDrawBuffer);
-
- if (ctx->Visual.doubleBufferMode == 1) {
- BitBlt(pwfb->hDC, 0, 0, pwfb->Base.Width, pwfb->Base.Height,
- pwfb->dib_hDC, 0, 0, SRCCOPY);
- }
- else {
- /* Do nothing for single buffer */
- }
-}
-
-
-/**********************************************************************/
-/***** CLEAR Functions *****/
-/**********************************************************************/
-
-/* If we do not implement these, Mesa clears the buffers via the pixel
- * span writing interface, which is very slow for a clear operation.
- */
-
-/*
- * Set the color used to clear the color buffer.
- */
-static void clear_color(struct gl_context *ctx, const GLfloat color[4])
-{
- WMesaContext pwc = wmesa_context(ctx);
- GLubyte col[3];
-
- CLAMPED_FLOAT_TO_UBYTE(col[0], color[0]);
- CLAMPED_FLOAT_TO_UBYTE(col[1], color[1]);
- CLAMPED_FLOAT_TO_UBYTE(col[2], color[2]);
- pwc->clearColorRef = RGB(col[0], col[1], col[2]);
- DeleteObject(pwc->clearPen);
- DeleteObject(pwc->clearBrush);
- pwc->clearPen = CreatePen(PS_SOLID, 1, pwc->clearColorRef);
- pwc->clearBrush = CreateSolidBrush(pwc->clearColorRef);
-}
-
-
-/*
- * Clear the specified region of the color buffer using the clear color
- * or index as specified by one of the two functions above.
- *
- * This procedure clears either the front and/or the back COLOR buffers.
- * Only the "left" buffer is cleared since we are not stereo.
- * Clearing of the other non-color buffers is left to the swrast.
- */
-
-static void clear(struct gl_context *ctx, GLbitfield mask)
-{
-#define FLIP(Y) (ctx->DrawBuffer->Height - (Y) - 1)
- const GLint x = ctx->DrawBuffer->_Xmin;
- const GLint y = ctx->DrawBuffer->_Ymin;
- const GLint height = ctx->DrawBuffer->_Ymax - ctx->DrawBuffer->_Ymin;
- const GLint width = ctx->DrawBuffer->_Xmax - ctx->DrawBuffer->_Xmin;
-
- WMesaContext pwc = wmesa_context(ctx);
- WMesaFramebuffer pwfb = wmesa_framebuffer(ctx->DrawBuffer);
- int done = 0;
-
- /* Let swrast do all the work if the masks are not set to
- * clear all channels. */
- if (!ctx->Color.ColorMask[0][0] ||
- !ctx->Color.ColorMask[0][1] ||
- !ctx->Color.ColorMask[0][2] ||
- !ctx->Color.ColorMask[0][3]) {
- _swrast_Clear(ctx, mask);
- return;
- }
-
- /* Back buffer */
- if (mask & BUFFER_BIT_BACK_LEFT) {
-
- int i, rowSize;
- UINT bytesPerPixel = pwfb->cColorBits / 8;
- LPBYTE lpb, clearRow;
- LPWORD lpw;
- BYTE bColor;
- WORD wColor;
- BYTE r, g, b;
- DWORD dwColor;
- LPDWORD lpdw;
-
- /* Try for a fast clear - clearing entire buffer with a single
- * byte value. */
- if (width == ctx->DrawBuffer->Width &&
- height == ctx->DrawBuffer->Height) { /* entire buffer */
- /* Now check for an easy clear value */
- switch (bytesPerPixel) {
- case 1:
- bColor = BGR8(GetRValue(pwc->clearColorRef),
- GetGValue(pwc->clearColorRef),
- GetBValue(pwc->clearColorRef));
- memset(pwfb->pbPixels, bColor,
- pwfb->ScanWidth * height);
- done = 1;
- break;
- case 2:
- wColor = BGR16(GetRValue(pwc->clearColorRef),
- GetGValue(pwc->clearColorRef),
- GetBValue(pwc->clearColorRef));
- if (((wColor >> 8) & 0xff) == (wColor & 0xff)) {
- memset(pwfb->pbPixels, wColor & 0xff,
- pwfb->ScanWidth * height);
- done = 1;
- }
- break;
- case 3:
- /* fall through */
- case 4:
- if (GetRValue(pwc->clearColorRef) ==
- GetGValue(pwc->clearColorRef) &&
- GetRValue(pwc->clearColorRef) ==
- GetBValue(pwc->clearColorRef)) {
- memset(pwfb->pbPixels,
- GetRValue(pwc->clearColorRef),
- pwfb->ScanWidth * height);
- done = 1;
- }
- break;
- default:
- break;
- }
- } /* all */
-
- if (!done) {
- /* Need to clear a row at a time. Begin by setting the first
- * row in the area to be cleared to the clear color. */
-
- clearRow = pwfb->pbPixels +
- pwfb->ScanWidth * FLIP(y) +
- bytesPerPixel * x;
- switch (bytesPerPixel) {
- case 1:
- lpb = clearRow;
- bColor = BGR8(GetRValue(pwc->clearColorRef),
- GetGValue(pwc->clearColorRef),
- GetBValue(pwc->clearColorRef));
- memset(lpb, bColor, width);
- break;
- case 2:
- lpw = (LPWORD)clearRow;
- wColor = BGR16(GetRValue(pwc->clearColorRef),
- GetGValue(pwc->clearColorRef),
- GetBValue(pwc->clearColorRef));
- for (i=0; i<width; i++)
- *lpw++ = wColor;
- break;
- case 3:
- lpb = clearRow;
- r = GetRValue(pwc->clearColorRef);
- g = GetGValue(pwc->clearColorRef);
- b = GetBValue(pwc->clearColorRef);
- for (i=0; i<width; i++) {
- *lpb++ = b;
- *lpb++ = g;
- *lpb++ = r;
- }
- break;
- case 4:
- lpdw = (LPDWORD)clearRow;
- dwColor = BGR32(GetRValue(pwc->clearColorRef),
- GetGValue(pwc->clearColorRef),
- GetBValue(pwc->clearColorRef));
- for (i=0; i<width; i++)
- *lpdw++ = dwColor;
- break;
- default:
- break;
- } /* switch */
-
- /* copy cleared row to other rows in buffer */
- lpb = clearRow - pwfb->ScanWidth;
- rowSize = width * bytesPerPixel;
- for (i=1; i<height; i++) {
- memcpy(lpb, clearRow, rowSize);
- lpb -= pwfb->ScanWidth;
- }
- } /* not done */
- mask &= ~BUFFER_BIT_BACK_LEFT;
- } /* back buffer */
-
- /* front buffer */
- if (mask & BUFFER_BIT_FRONT_LEFT) {
- HDC DC = pwc->hDC;
- HPEN Old_Pen = SelectObject(DC, pwc->clearPen);
- HBRUSH Old_Brush = SelectObject(DC, pwc->clearBrush);
- Rectangle(DC,
- x,
- FLIP(y) + 1,
- x + width + 1,
- FLIP(y) - height + 1);
- SelectObject(DC, Old_Pen);
- SelectObject(DC, Old_Brush);
- mask &= ~BUFFER_BIT_FRONT_LEFT;
- } /* front buffer */
-
- /* Call swrast if there is anything left to clear (like DEPTH) */
- if (mask)
- _swrast_Clear(ctx, mask);
-
-#undef FLIP
-}
-
-
-/**********************************************************************/
-/***** PIXEL Functions *****/
-/**********************************************************************/
-
-#define FLIP(Y) (rb->Height - (Y) - 1)
-
-
-/**
- ** Front Buffer reading/writing
- ** These are slow, but work with all non-indexed visual types.
- **/
-
-/* Write a horizontal span of RGBA color pixels with a boolean mask. */
-static void write_rgba_span_front(struct gl_context *ctx,
- struct gl_renderbuffer *rb,
- GLuint n, GLint x, GLint y,
- const void *values,
- const GLubyte *mask)
-{
- const GLubyte (*rgba)[4] = (const GLubyte (*)[4])values;
- WMesaContext pwc = wmesa_context(ctx);
- WMesaFramebuffer pwfb = wmesa_lookup_framebuffer(pwc->hDC);
- HBITMAP bmp=0;
- HDC mdc=0;
- typedef union
- {
- unsigned i;
- struct {
- unsigned b:8, g:8, r:8, a:8;
- };
- } BGRA;
- BGRA *bgra, c;
- GLuint i;
-
- if (n < 16) { // the value 16 is just guessed
- y=FLIP(y);
- if (mask) {
- for (i=0; i<n; i++)
- if (mask[i])
- SetPixel(pwc->hDC, x+i, y,
- RGB(rgba[i][RCOMP], rgba[i][GCOMP], rgba[i][BCOMP]));
- }
- else {
- for (i=0; i<n; i++)
- SetPixel(pwc->hDC, x+i, y,
- RGB(rgba[i][RCOMP], rgba[i][GCOMP], rgba[i][BCOMP]));
- }
- }
- else {
- if (!pwfb) {
- _mesa_problem(NULL, "wmesa: write_rgba_span_front on unknown hdc");
- return;
- }
- bgra=malloc(n*sizeof(BGRA));
- if (!bgra) {
- _mesa_problem(NULL, "wmesa: write_rgba_span_front: out of memory");
- return;
- }
- c.a=0;
- if (mask) {
- for (i=0; i<n; i++) {
- if (mask[i]) {
- c.r=rgba[i][RCOMP];
- c.g=rgba[i][GCOMP];
- c.b=rgba[i][BCOMP];
- c.a=rgba[i][ACOMP];
- bgra[i]=c;
- }
- else
- bgra[i].i=0;
- }
- }
- else {
- for (i=0; i<n; i++) {
- c.r=rgba[i][RCOMP];
- c.g=rgba[i][GCOMP];
- c.b=rgba[i][BCOMP];
- c.a=rgba[i][ACOMP];
- bgra[i]=c;
- }
- }
- bmp=CreateBitmap(n, 1, 1, 32, bgra);
- mdc=CreateCompatibleDC(pwfb->hDC);
- SelectObject(mdc, bmp);
- y=FLIP(y);
- BitBlt(pwfb->hDC, x, y, n, 1, mdc, 0, 0, SRCCOPY);
- SelectObject(mdc, 0);
- DeleteObject(bmp);
- DeleteDC(mdc);
- free(bgra);
- }
-}
-
-/* Write a horizontal span of RGB color pixels with a boolean mask. */
-static void write_rgb_span_front(struct gl_context *ctx,
- struct gl_renderbuffer *rb,
- GLuint n, GLint x, GLint y,
- const void *values,
- const GLubyte *mask)
-{
- const GLubyte (*rgb)[3] = (const GLubyte (*)[3])values;
- WMesaContext pwc = wmesa_context(ctx);
- GLuint i;
-
- (void) ctx;
- y=FLIP(y);
- if (mask) {
- for (i=0; i<n; i++)
- if (mask[i])
- SetPixel(pwc->hDC, x+i, y, RGB(rgb[i][RCOMP], rgb[i][GCOMP],
- rgb[i][BCOMP]));
- }
- else {
- for (i=0; i<n; i++)
- SetPixel(pwc->hDC, x+i, y, RGB(rgb[i][RCOMP], rgb[i][GCOMP],
- rgb[i][BCOMP]));
- }
-
-}
-
-/*
- * Write a horizontal span of pixels with a boolean mask. The current color
- * is used for all pixels.
- */
-static void write_mono_rgba_span_front(struct gl_context *ctx,
- struct gl_renderbuffer *rb,
- GLuint n, GLint x, GLint y,
- const void *value,
- const GLubyte *mask)
-{
- const GLchan *color = (const GLchan *)value;
- GLuint i;
- WMesaContext pwc = wmesa_context(ctx);
- COLORREF colorref;
-
- (void) ctx;
- colorref = RGB(color[RCOMP], color[GCOMP], color[BCOMP]);
- y=FLIP(y);
- if (mask) {
- for (i=0; i<n; i++)
- if (mask[i])
- SetPixel(pwc->hDC, x+i, y, colorref);
- }
- else
- for (i=0; i<n; i++)
- SetPixel(pwc->hDC, x+i, y, colorref);
-
-}
-
-/* Write an array of RGBA pixels with a boolean mask. */
-static void write_rgba_pixels_front(struct gl_context *ctx,
- struct gl_renderbuffer *rb,
- GLuint n,
- const GLint x[], const GLint y[],
- const void *values,
- const GLubyte *mask)
-{
- const GLubyte (*rgba)[4] = (const GLubyte (*)[4])values;
- GLuint i;
- WMesaContext pwc = wmesa_context(ctx);
- (void) ctx;
- for (i=0; i<n; i++)
- if (mask[i])
- SetPixel(pwc->hDC, x[i], FLIP(y[i]),
- RGB(rgba[i][RCOMP], rgba[i][GCOMP],
- rgba[i][BCOMP]));
-}
-
-
-
-/*
- * Write an array of pixels with a boolean mask. The current color
- * is used for all pixels.
- */
-static void write_mono_rgba_pixels_front(struct gl_context *ctx,
- struct gl_renderbuffer *rb,
- GLuint n,
- const GLint x[], const GLint y[],
- const void *value,
- const GLubyte *mask)
-{
- const GLchan *color = (const GLchan *)value;
- GLuint i;
- WMesaContext pwc = wmesa_context(ctx);
- COLORREF colorref;
- (void) ctx;
- colorref = RGB(color[RCOMP], color[GCOMP], color[BCOMP]);
- for (i=0; i<n; i++)
- if (mask[i])
- SetPixel(pwc->hDC, x[i], FLIP(y[i]), colorref);
-}
-
-/* Read a horizontal span of color pixels. */
-static void read_rgba_span_front(struct gl_context *ctx,
- struct gl_renderbuffer *rb,
- GLuint n, GLint x, GLint y,
- void *values)
-{
- GLubyte (*rgba)[4] = (GLubyte (*)[4])values;
- WMesaContext pwc = wmesa_context(ctx);
- GLuint i;
- COLORREF Color;
- y = FLIP(y);
- for (i=0; i<n; i++) {
- Color = GetPixel(pwc->hDC, x+i, y);
- rgba[i][RCOMP] = GetRValue(Color);
- rgba[i][GCOMP] = GetGValue(Color);
- rgba[i][BCOMP] = GetBValue(Color);
- rgba[i][ACOMP] = 255;
- }
-}
-
-
-/* Read an array of color pixels. */
-static void read_rgba_pixels_front(struct gl_context *ctx,
- struct gl_renderbuffer *rb,
- GLuint n, const GLint x[], const GLint y[],
- void *values)
-{
- GLubyte (*rgba)[4] = (GLubyte (*)[4])values;
- WMesaContext pwc = wmesa_context(ctx);
- GLuint i;
- COLORREF Color;
- for (i=0; i<n; i++) {
- GLint y2 = FLIP(y[i]);
- Color = GetPixel(pwc->hDC, x[i], y2);
- rgba[i][RCOMP] = GetRValue(Color);
- rgba[i][GCOMP] = GetGValue(Color);
- rgba[i][BCOMP] = GetBValue(Color);
- rgba[i][ACOMP] = 255;
- }
-}
-
-/*********************************************************************/
-
-/* DOUBLE BUFFER 32-bit */
-
-#define WMSETPIXEL32(pwc, y, x, r, g, b) { \
-LPDWORD lpdw = ((LPDWORD)((pwc)->pbPixels + (pwc)->ScanWidth * (y)) + (x)); \
-*lpdw = BGR32((r),(g),(b)); }
-
-
-
-/* Write a horizontal span of RGBA color pixels with a boolean mask. */
-static void write_rgba_span_32(struct gl_context *ctx,
- struct gl_renderbuffer *rb,
- GLuint n, GLint x, GLint y,
- const void *values,
- const GLubyte *mask)
-{
- const GLubyte (*rgba)[4] = (const GLubyte (*)[4])values;
- WMesaFramebuffer pwfb = wmesa_framebuffer(ctx->DrawBuffer);
- GLuint i;
- LPDWORD lpdw;
-
- (void) ctx;
-
- y=FLIP(y);
- lpdw = ((LPDWORD)(pwfb->pbPixels + pwfb->ScanWidth * y)) + x;
- if (mask) {
- for (i=0; i<n; i++)
- if (mask[i])
- lpdw[i] = BGR32(rgba[i][RCOMP], rgba[i][GCOMP],
- rgba[i][BCOMP]);
- }
- else {
- for (i=0; i<n; i++)
- *lpdw++ = BGR32(rgba[i][RCOMP], rgba[i][GCOMP],
- rgba[i][BCOMP]);
- }
-}
-
-
-/* Write a horizontal span of RGB color pixels with a boolean mask. */
-static void write_rgb_span_32(struct gl_context *ctx,
- struct gl_renderbuffer *rb,
- GLuint n, GLint x, GLint y,
- const void *values,
- const GLubyte *mask)
-{
- const GLubyte (*rgb)[3] = (const GLubyte (*)[3])values;
- WMesaFramebuffer pwfb = wmesa_framebuffer(ctx->DrawBuffer);
- GLuint i;
- LPDWORD lpdw;
-
- (void) ctx;
-
- y=FLIP(y);
- lpdw = ((LPDWORD)(pwfb->pbPixels + pwfb->ScanWidth * y)) + x;
- if (mask) {
- for (i=0; i<n; i++)
- if (mask[i])
- lpdw[i] = BGR32(rgb[i][RCOMP], rgb[i][GCOMP],
- rgb[i][BCOMP]);
- }
- else {
- for (i=0; i<n; i++)
- *lpdw++ = BGR32(rgb[i][RCOMP], rgb[i][GCOMP],
- rgb[i][BCOMP]);
- }
-}
-
-/*
- * Write a horizontal span of pixels with a boolean mask. The current color
- * is used for all pixels.
- */
-static void write_mono_rgba_span_32(struct gl_context *ctx,
- struct gl_renderbuffer *rb,
- GLuint n, GLint x, GLint y,
- const void *value,
- const GLubyte *mask)
-{
- const GLchan *color = (const GLchan *)value;
- LPDWORD lpdw;
- DWORD pixel;
- GLuint i;
- WMesaFramebuffer pwfb = wmesa_framebuffer(ctx->DrawBuffer);
- lpdw = ((LPDWORD)(pwfb->pbPixels + pwfb->ScanWidth * y)) + x;
- y=FLIP(y);
- pixel = BGR32(color[RCOMP], color[GCOMP], color[BCOMP]);
- if (mask) {
- for (i=0; i<n; i++)
- if (mask[i])
- lpdw[i] = pixel;
- }
- else
- for (i=0; i<n; i++)
- *lpdw++ = pixel;
-
-}
-
-/* Write an array of RGBA pixels with a boolean mask. */
-static void write_rgba_pixels_32(struct gl_context *ctx,
- struct gl_renderbuffer *rb,
- GLuint n, const GLint x[], const GLint y[],
- const void *values,
- const GLubyte *mask)
-{
- const GLubyte (*rgba)[4] = (const GLubyte (*)[4])values;
- GLuint i;
- WMesaFramebuffer pwfb = wmesa_framebuffer(ctx->DrawBuffer);
- for (i=0; i<n; i++)
- if (mask[i])
- WMSETPIXEL32(pwfb, FLIP(y[i]), x[i],
- rgba[i][RCOMP], rgba[i][GCOMP], rgba[i][BCOMP]);
-}
-
-/*
- * Write an array of pixels with a boolean mask. The current color
- * is used for all pixels.
- */
-static void write_mono_rgba_pixels_32(struct gl_context *ctx,
- struct gl_renderbuffer *rb,
- GLuint n,
- const GLint x[], const GLint y[],
- const void *value,
- const GLubyte *mask)
-{
- const GLchan *color = (const GLchan *)value;
- GLuint i;
- WMesaFramebuffer pwfb = wmesa_framebuffer(ctx->DrawBuffer);
- for (i=0; i<n; i++)
- if (mask[i])
- WMSETPIXEL32(pwfb, FLIP(y[i]),x[i],color[RCOMP],
- color[GCOMP], color[BCOMP]);
-}
-
-/* Read a horizontal span of color pixels. */
-static void read_rgba_span_32(struct gl_context *ctx,
- struct gl_renderbuffer *rb,
- GLuint n, GLint x, GLint y,
- void *values)
-{
- GLubyte (*rgba)[4] = (GLubyte (*)[4])values;
- GLuint i;
- DWORD pixel;
- LPDWORD lpdw;
- WMesaFramebuffer pwfb = wmesa_framebuffer(ctx->DrawBuffer);
-
- y = FLIP(y);
- lpdw = ((LPDWORD)(pwfb->pbPixels + pwfb->ScanWidth * y)) + x;
- for (i=0; i<n; i++) {
- pixel = lpdw[i];
- rgba[i][RCOMP] = (GLubyte)((pixel & 0x00ff0000) >> 16);
- rgba[i][GCOMP] = (GLubyte)((pixel & 0x0000ff00) >> 8);
- rgba[i][BCOMP] = (GLubyte)(pixel & 0x000000ff);
- rgba[i][ACOMP] = 255;
- }
-}
-
-
-/* Read an array of color pixels. */
-static void read_rgba_pixels_32(struct gl_context *ctx,
- struct gl_renderbuffer *rb,
- GLuint n, const GLint x[], const GLint y[],
- void *values)
-{
- GLubyte (*rgba)[4] = (GLubyte (*)[4])values;
- GLuint i;
- DWORD pixel;
- LPDWORD lpdw;
- WMesaFramebuffer pwfb = wmesa_framebuffer(ctx->DrawBuffer);
-
- for (i=0; i<n; i++) {
- GLint y2 = FLIP(y[i]);
- lpdw = ((LPDWORD)(pwfb->pbPixels + pwfb->ScanWidth * y2)) + x[i];
- pixel = *lpdw;
- rgba[i][RCOMP] = (GLubyte)((pixel & 0x00ff0000) >> 16);
- rgba[i][GCOMP] = (GLubyte)((pixel & 0x0000ff00) >> 8);
- rgba[i][BCOMP] = (GLubyte)(pixel & 0x000000ff);
- rgba[i][ACOMP] = 255;
- }
-}
-
-
-/*********************************************************************/
-
-/* DOUBLE BUFFER 24-bit */
-
-#define WMSETPIXEL24(pwc, y, x, r, g, b) { \
-LPBYTE lpb = ((LPBYTE)((pwc)->pbPixels + (pwc)->ScanWidth * (y)) + (3 * x)); \
-lpb[0] = (b); \
-lpb[1] = (g); \
-lpb[2] = (r); }
-
-/* Write a horizontal span of RGBA color pixels with a boolean mask. */
-static void write_rgba_span_24(struct gl_context *ctx,
- struct gl_renderbuffer *rb,
- GLuint n, GLint x, GLint y,
- const void *values,
- const GLubyte *mask)
-{
- const GLubyte (*rgba)[4] = (const GLubyte (*)[4])values;
- WMesaFramebuffer pwfb = wmesa_framebuffer(ctx->DrawBuffer);
- GLuint i;
- LPBYTE lpb;
-
- (void) ctx;
-
- y=FLIP(y);
- lpb = ((LPBYTE)(pwfb->pbPixels + pwfb->ScanWidth * y)) + (3 * x);
- if (mask) {
- for (i=0; i<n; i++)
- if (mask[i]) {
- lpb[3*i] = rgba[i][BCOMP];
- lpb[3*i+1] = rgba[i][GCOMP];
- lpb[3*i+2] = rgba[i][RCOMP];
- }
- }
- else {
- for (i=0; i<n; i++) {
- *lpb++ = rgba[i][BCOMP];
- *lpb++ = rgba[i][GCOMP];
- *lpb++ = rgba[i][RCOMP];
- }
- }
-}
-
-
-/* Write a horizontal span of RGB color pixels with a boolean mask. */
-static void write_rgb_span_24(struct gl_context *ctx,
- struct gl_renderbuffer *rb,
- GLuint n, GLint x, GLint y,
- const void *values,
- const GLubyte *mask)
-{
- const GLubyte (*rgb)[3] = (const GLubyte (*)[3])values;
- WMesaFramebuffer pwfb = wmesa_framebuffer(ctx->DrawBuffer);
- GLuint i;
- LPBYTE lpb;
-
- (void) ctx;
-
- y=FLIP(y);
- lpb = ((LPBYTE)(pwfb->pbPixels + pwfb->ScanWidth * y)) + (3 * x);
- if (mask) {
- for (i=0; i<n; i++)
- if (mask[i]) {
- lpb[3*i] = rgb[i][BCOMP];
- lpb[3*i+1] = rgb[i][GCOMP];
- lpb[3*i+2] = rgb[i][RCOMP];
- }
- }
- else {
- for (i=0; i<n; i++) {
- *lpb++ = rgb[i][BCOMP];
- *lpb++ = rgb[i][GCOMP];
- *lpb++ = rgb[i][RCOMP];
- }
- }
-}
-
-/*
- * Write a horizontal span of pixels with a boolean mask. The current color
- * is used for all pixels.
- */
-static void write_mono_rgba_span_24(struct gl_context *ctx,
- struct gl_renderbuffer *rb,
- GLuint n, GLint x, GLint y,
- const void *value,
- const GLubyte *mask)
-{
- const GLchan *color = (const GLchan *)value;
- LPBYTE lpb;
- GLuint i;
- WMesaFramebuffer pwfb = wmesa_framebuffer(ctx->DrawBuffer);
- lpb = ((LPBYTE)(pwfb->pbPixels + pwfb->ScanWidth * y)) + (3 * x);
- y=FLIP(y);
- if (mask) {
- for (i=0; i<n; i++)
- if (mask[i]) {
- lpb[3*i] = color[BCOMP];
- lpb[3*i+1] = color[GCOMP];
- lpb[3*i+2] = color[RCOMP];
- }
- }
- else
- for (i=0; i<n; i++) {
- *lpb++ = color[BCOMP];
- *lpb++ = color[GCOMP];
- *lpb++ = color[RCOMP];
- }
-}
-
-/* Write an array of RGBA pixels with a boolean mask. */
-static void write_rgba_pixels_24(struct gl_context *ctx,
- struct gl_renderbuffer *rb,
- GLuint n, const GLint x[], const GLint y[],
- const void *values,
- const GLubyte *mask)
-{
- const GLubyte (*rgba)[4] = (const GLubyte (*)[4])values;
- GLuint i;
- WMesaFramebuffer pwfb = wmesa_framebuffer(ctx->DrawBuffer);
- for (i=0; i<n; i++)
- if (mask[i])
- WMSETPIXEL24(pwfb, FLIP(y[i]), x[i],
- rgba[i][RCOMP], rgba[i][GCOMP], rgba[i][BCOMP]);
-}
-
-/*
- * Write an array of pixels with a boolean mask. The current color
- * is used for all pixels.
- */
-static void write_mono_rgba_pixels_24(struct gl_context *ctx,
- struct gl_renderbuffer *rb,
- GLuint n,
- const GLint x[], const GLint y[],
- const void *value,
- const GLubyte *mask)
-{
- const GLchan *color = (const GLchan *)value;
- GLuint i;
- WMesaFramebuffer pwfb = wmesa_framebuffer(ctx->DrawBuffer);
- for (i=0; i<n; i++)
- if (mask[i])
- WMSETPIXEL24(pwfb, FLIP(y[i]),x[i],color[RCOMP],
- color[GCOMP], color[BCOMP]);
-}
-
-/* Read a horizontal span of color pixels. */
-static void read_rgba_span_24(struct gl_context *ctx,
- struct gl_renderbuffer *rb,
- GLuint n, GLint x, GLint y,
- void *values)
-{
- GLubyte (*rgba)[4] = (GLubyte (*)[4])values;
- GLuint i;
- LPBYTE lpb;
- WMesaFramebuffer pwfb = wmesa_framebuffer(ctx->DrawBuffer);
-
- y = FLIP(y);
- lpb = ((LPBYTE)(pwfb->pbPixels + pwfb->ScanWidth * y)) + (3 * x);
- for (i=0; i<n; i++) {
- rgba[i][RCOMP] = lpb[3*i+2];
- rgba[i][GCOMP] = lpb[3*i+1];
- rgba[i][BCOMP] = lpb[3*i];
- rgba[i][ACOMP] = 255;
- }
-}
-
-
-/* Read an array of color pixels. */
-static void read_rgba_pixels_24(struct gl_context *ctx,
- struct gl_renderbuffer *rb,
- GLuint n, const GLint x[], const GLint y[],
- void *values)
-{
- GLubyte (*rgba)[4] = (GLubyte (*)[4])values;
- GLuint i;
- LPBYTE lpb;
- WMesaFramebuffer pwfb = wmesa_framebuffer(ctx->DrawBuffer);
-
- for (i=0; i<n; i++) {
- GLint y2 = FLIP(y[i]);
- lpb = ((LPBYTE)(pwfb->pbPixels + pwfb->ScanWidth * y2)) + (3 * x[i]);
- rgba[i][RCOMP] = lpb[3*i+2];
- rgba[i][GCOMP] = lpb[3*i+1];
- rgba[i][BCOMP] = lpb[3*i];
- rgba[i][ACOMP] = 255;
- }
-}
-
-
-/*********************************************************************/
-
-/* DOUBLE BUFFER 16-bit */
-
-#define WMSETPIXEL16(pwc, y, x, r, g, b) { \
-LPWORD lpw = ((LPWORD)((pwc)->pbPixels + (pwc)->ScanWidth * (y)) + (x)); \
-*lpw = BGR16((r),(g),(b)); }
-
-
-
-/* Write a horizontal span of RGBA color pixels with a boolean mask. */
-static void write_rgba_span_16(struct gl_context *ctx,
- struct gl_renderbuffer *rb,
- GLuint n, GLint x, GLint y,
- const void *values,
- const GLubyte *mask)
-{
- const GLubyte (*rgba)[4] = (const GLubyte (*)[4])values;
- WMesaFramebuffer pwfb = wmesa_framebuffer(ctx->DrawBuffer);
- GLuint i;
- LPWORD lpw;
-
- (void) ctx;
-
- y=FLIP(y);
- lpw = ((LPWORD)(pwfb->pbPixels + pwfb->ScanWidth * y)) + x;
- if (mask) {
- for (i=0; i<n; i++)
- if (mask[i])
- lpw[i] = BGR16(rgba[i][RCOMP], rgba[i][GCOMP],
- rgba[i][BCOMP]);
- }
- else {
- for (i=0; i<n; i++)
- *lpw++ = BGR16(rgba[i][RCOMP], rgba[i][GCOMP],
- rgba[i][BCOMP]);
- }
-}
-
-
-/* Write a horizontal span of RGB color pixels with a boolean mask. */
-static void write_rgb_span_16(struct gl_context *ctx,
- struct gl_renderbuffer *rb,
- GLuint n, GLint x, GLint y,
- const void *values,
- const GLubyte *mask)
-{
- const GLubyte (*rgb)[3] = (const GLubyte (*)[3])values;
- WMesaFramebuffer pwfb = wmesa_framebuffer(ctx->DrawBuffer);
- GLuint i;
- LPWORD lpw;
-
- (void) ctx;
-
- y=FLIP(y);
- lpw = ((LPWORD)(pwfb->pbPixels + pwfb->ScanWidth * y)) + x;
- if (mask) {
- for (i=0; i<n; i++)
- if (mask[i])
- lpw[i] = BGR16(rgb[i][RCOMP], rgb[i][GCOMP],
- rgb[i][BCOMP]);
- }
- else {
- for (i=0; i<n; i++)
- *lpw++ = BGR16(rgb[i][RCOMP], rgb[i][GCOMP],
- rgb[i][BCOMP]);
- }
-}
-
-/*
- * Write a horizontal span of pixels with a boolean mask. The current color
- * is used for all pixels.
- */
-static void write_mono_rgba_span_16(struct gl_context *ctx,
- struct gl_renderbuffer *rb,
- GLuint n, GLint x, GLint y,
- const void *value,
- const GLubyte *mask)
-{
- const GLchan *color = (const GLchan *)value;
- LPWORD lpw;
- WORD pixel;
- GLuint i;
- WMesaFramebuffer pwfb = wmesa_framebuffer(ctx->DrawBuffer);
- (void) ctx;
- lpw = ((LPWORD)(pwfb->pbPixels + pwfb->ScanWidth * y)) + x;
- y=FLIP(y);
- pixel = BGR16(color[RCOMP], color[GCOMP], color[BCOMP]);
- if (mask) {
- for (i=0; i<n; i++)
- if (mask[i])
- lpw[i] = pixel;
- }
- else
- for (i=0; i<n; i++)
- *lpw++ = pixel;
-
-}
-
-/* Write an array of RGBA pixels with a boolean mask. */
-static void write_rgba_pixels_16(struct gl_context *ctx,
- struct gl_renderbuffer *rb,
- GLuint n, const GLint x[], const GLint y[],
- const void *values,
- const GLubyte *mask)
-{
- const GLubyte (*rgba)[4] = (const GLubyte (*)[4])values;
- GLuint i;
- WMesaFramebuffer pwfb = wmesa_framebuffer(ctx->DrawBuffer);
- (void) ctx;
- for (i=0; i<n; i++)
- if (mask[i])
- WMSETPIXEL16(pwfb, FLIP(y[i]), x[i],
- rgba[i][RCOMP], rgba[i][GCOMP], rgba[i][BCOMP]);
-}
-
-/*
- * Write an array of pixels with a boolean mask. The current color
- * is used for all pixels.
- */
-static void write_mono_rgba_pixels_16(struct gl_context *ctx,
- struct gl_renderbuffer *rb,
- GLuint n,
- const GLint x[], const GLint y[],
- const void *value,
- const GLubyte *mask)
-{
- const GLchan *color = (const GLchan *)value;
- GLuint i;
- WMesaFramebuffer pwfb = wmesa_framebuffer(ctx->DrawBuffer);
- (void) ctx;
- for (i=0; i<n; i++)
- if (mask[i])
- WMSETPIXEL16(pwfb, FLIP(y[i]),x[i],color[RCOMP],
- color[GCOMP], color[BCOMP]);
-}
-
-/* Read a horizontal span of color pixels. */
-static void read_rgba_span_16(struct gl_context *ctx,
- struct gl_renderbuffer *rb,
- GLuint n, GLint x, GLint y,
- void *values)
-{
- GLubyte (*rgba)[4] = (GLubyte (*)[4])values;
- GLuint i, pixel;
- LPWORD lpw;
- WMesaFramebuffer pwfb = wmesa_framebuffer(ctx->DrawBuffer);
-
- y = FLIP(y);
- lpw = ((LPWORD)(pwfb->pbPixels + pwfb->ScanWidth * y)) + x;
- for (i=0; i<n; i++) {
- pixel = lpw[i];
- /* Windows uses 5,5,5 for 16-bit */
- rgba[i][RCOMP] = (pixel & 0x7c00) >> 7;
- rgba[i][GCOMP] = (pixel & 0x03e0) >> 2;
- rgba[i][BCOMP] = (pixel & 0x001f) << 3;
- rgba[i][ACOMP] = 255;
- }
-}
-
-
-/* Read an array of color pixels. */
-static void read_rgba_pixels_16(struct gl_context *ctx,
- struct gl_renderbuffer *rb,
- GLuint n, const GLint x[], const GLint y[],
- void *values)
-{
- GLubyte (*rgba)[4] = (GLubyte (*)[4])values;
- GLuint i, pixel;
- LPWORD lpw;
- WMesaFramebuffer pwfb = wmesa_framebuffer(ctx->DrawBuffer);
-
- for (i=0; i<n; i++) {
- GLint y2 = FLIP(y[i]);
- lpw = ((LPWORD)(pwfb->pbPixels + pwfb->ScanWidth * y2)) + x[i];
- pixel = *lpw;
- /* Windows uses 5,5,5 for 16-bit */
- rgba[i][RCOMP] = (pixel & 0x7c00) >> 7;
- rgba[i][GCOMP] = (pixel & 0x03e0) >> 2;
- rgba[i][BCOMP] = (pixel & 0x001f) << 3;
- rgba[i][ACOMP] = 255;
- }
-}
-
-
-
-
-/**********************************************************************/
-/***** BUFFER Functions *****/
-/**********************************************************************/
-
-
-
-
-static void
-wmesa_delete_renderbuffer(struct gl_renderbuffer *rb)
-{
- free(rb);
-}
-
-
-/**
- * This is called by Mesa whenever it determines that the window size
- * has changed. Do whatever's needed to cope with that.
- */
-static GLboolean
-wmesa_renderbuffer_storage(struct gl_context *ctx,
- struct gl_renderbuffer *rb,
- GLenum internalFormat,
- GLuint width,
- GLuint height)
-{
- rb->Width = width;
- rb->Height = height;
- return GL_TRUE;
-}
-
-
-/**
- * Plug in the Get/PutRow/Values functions for a renderbuffer depending
- * on if we're drawing to the front or back color buffer.
- */
-static void
-wmesa_set_renderbuffer_funcs(struct gl_renderbuffer *rb, int pixelformat,
- int cColorBits, int double_buffer)
-{
- if (double_buffer) {
- /* back buffer */
- /* Picking the correct span functions is important because
- * the DIB was allocated with the indicated depth. */
- switch(pixelformat) {
- case PF_5R6G5B:
- rb->PutRow = write_rgba_span_16;
- rb->PutRowRGB = write_rgb_span_16;
- rb->PutMonoRow = write_mono_rgba_span_16;
- rb->PutValues = write_rgba_pixels_16;
- rb->PutMonoValues = write_mono_rgba_pixels_16;
- rb->GetRow = read_rgba_span_16;
- rb->GetValues = read_rgba_pixels_16;
- break;
- case PF_8R8G8B:
- if (cColorBits == 24)
- {
- rb->PutRow = write_rgba_span_24;
- rb->PutRowRGB = write_rgb_span_24;
- rb->PutMonoRow = write_mono_rgba_span_24;
- rb->PutValues = write_rgba_pixels_24;
- rb->PutMonoValues = write_mono_rgba_pixels_24;
- rb->GetRow = read_rgba_span_24;
- rb->GetValues = read_rgba_pixels_24;
- }
- else
- {
- rb->PutRow = write_rgba_span_32;
- rb->PutRowRGB = write_rgb_span_32;
- rb->PutMonoRow = write_mono_rgba_span_32;
- rb->PutValues = write_rgba_pixels_32;
- rb->PutMonoValues = write_mono_rgba_pixels_32;
- rb->GetRow = read_rgba_span_32;
- rb->GetValues = read_rgba_pixels_32;
- }
- break;
- default:
- break;
- }
- }
- else {
- /* front buffer (actual Windows window) */
- rb->PutRow = write_rgba_span_front;
- rb->PutRowRGB = write_rgb_span_front;
- rb->PutMonoRow = write_mono_rgba_span_front;
- rb->PutValues = write_rgba_pixels_front;
- rb->PutMonoValues = write_mono_rgba_pixels_front;
- rb->GetRow = read_rgba_span_front;
- rb->GetValues = read_rgba_pixels_front;
- }
-}
-
-/**
- * Called by ctx->Driver.ResizeBuffers()
- * Resize the front/back colorbuffers to match the latest window size.
- */
-static void
-wmesa_resize_buffers(struct gl_context *ctx, struct gl_framebuffer *buffer,
- GLuint width, GLuint height)
-{
- WMesaFramebuffer pwfb = wmesa_framebuffer(buffer);
-
- if (pwfb->Base.Width != width || pwfb->Base.Height != height) {
- /* Realloc back buffer */
- if (ctx->Visual.doubleBufferMode == 1) {
- wmDeleteBackingStore(pwfb);
- wmCreateBackingStore(pwfb, width, height);
- }
- }
- _mesa_resize_framebuffer(ctx, buffer, width, height);
-}
-
-
-/**
- * Called by glViewport.
- * This is a good time for us to poll the current window size and adjust
- * our renderbuffers to match the current window size.
- * Remember, we have no opportunity to respond to conventional
- * resize events since the driver has no event loop.
- * Thus, we poll.
- * MakeCurrent also ends up making a call here, so that ensures
- * we get the viewport set correctly, even if the app does not call
- * glViewport and relies on the defaults.
- */
-static void wmesa_viewport(struct gl_context *ctx,
- GLint x, GLint y,
- GLsizei width, GLsizei height)
-{
- GLuint new_width, new_height;
-
- wmesa_get_buffer_size(ctx->WinSysDrawBuffer, &new_width, &new_height);
-
- /**
- * Resize buffers if the window size changed.
- */
- wmesa_resize_buffers(ctx, ctx->WinSysDrawBuffer, new_width, new_height);
- ctx->NewState |= _NEW_BUFFERS; /* to update scissor / window bounds */
-}
-
-
-
-
-/**
- * Called when the driver should update it's state, based on the new_state
- * flags.
- */
-static void wmesa_update_state(struct gl_context *ctx, GLuint new_state)
-{
- _swrast_InvalidateState(ctx, new_state);
- _swsetup_InvalidateState(ctx, new_state);
- _vbo_InvalidateState(ctx, new_state);
- _tnl_InvalidateState(ctx, new_state);
-
- /* TODO - This code is not complete yet because I
- * don't know what to do for all state updates.
- */
-
- if (new_state & _NEW_BUFFERS) {
- }
-}
-
-
-
-
-
-/**********************************************************************/
-/***** WMESA Functions *****/
-/**********************************************************************/
-
-WMesaContext WMesaCreateContext(HDC hDC,
- HPALETTE* Pal,
- GLboolean rgb_flag,
- GLboolean db_flag,
- GLboolean alpha_flag)
-{
- WMesaContext c;
- struct dd_function_table functions;
- GLint red_bits, green_bits, blue_bits, alpha_bits;
- struct gl_context *ctx;
- struct gl_config *visual;
-
- (void) Pal;
-
- /* Indexed mode not supported */
- if (!rgb_flag)
- return NULL;
-
- /* Allocate wmesa context */
- c = CALLOC_STRUCT(wmesa_context);
- if (!c)
- return NULL;
-
-#if 0
- /* I do not understand this contributed code */
- /* Support memory and device contexts */
- if(WindowFromDC(hDC) != NULL) {
- c->hDC = GetDC(WindowFromDC(hDC)); /* huh ???? */
- }
- else {
- c->hDC = hDC;
- }
-#else
- c->hDC = hDC;
-#endif
-
- /* Get data for visual */
- /* Dealing with this is actually a bit of overkill because Mesa will end
- * up treating all color component size requests less than 8 by using
- * a single byte per channel. In addition, the interface to the span
- * routines passes colors as an entire byte per channel anyway, so there
- * is nothing to be saved by telling the visual to be 16 bits if the device
- * is 16 bits. That is, Mesa is going to compute colors down to 8 bits per
- * channel anyway.
- * But we go through the motions here anyway.
- */
- switch (GetDeviceCaps(c->hDC, BITSPIXEL)) {
- case 16:
- red_bits = green_bits = blue_bits = 5;
- alpha_bits = 0;
- break;
- default:
- red_bits = green_bits = blue_bits = 8;
- alpha_bits = 8;
- break;
- }
- /* Create visual based on flags */
- visual = _mesa_create_visual(db_flag, /* db_flag */
- GL_FALSE, /* stereo */
- red_bits, green_bits, blue_bits, /* color RGB */
- alpha_flag ? alpha_bits : 0, /* color A */
- DEFAULT_SOFTWARE_DEPTH_BITS, /* depth_bits */
- 8, /* stencil_bits */
- 16,16,16, /* accum RGB */
- alpha_flag ? 16 : 0, /* accum A */
- 1); /* num samples */
-
- if (!visual) {
- free(c);
- return NULL;
- }
-
- /* Set up driver functions */
- _mesa_init_driver_functions(&functions);
- functions.GetString = wmesa_get_string;
- functions.UpdateState = wmesa_update_state;
- functions.GetBufferSize = wmesa_get_buffer_size;
- functions.Flush = wmesa_flush;
- functions.Clear = clear;
- functions.ClearColor = clear_color;
- functions.ResizeBuffers = wmesa_resize_buffers;
- functions.Viewport = wmesa_viewport;
-
- /* initialize the Mesa context data */
- ctx = &c->gl_ctx;
- _mesa_initialize_context(ctx, API_OPENGL, visual,
- NULL, &functions, (void *)c);
-
- /* visual no longer needed - it was copied by _mesa_initialize_context() */
- _mesa_destroy_visual(visual);
-
- _mesa_enable_sw_extensions(ctx);
- _mesa_enable_1_3_extensions(ctx);
- _mesa_enable_1_4_extensions(ctx);
- _mesa_enable_1_5_extensions(ctx);
- _mesa_enable_2_0_extensions(ctx);
- _mesa_enable_2_1_extensions(ctx);
-
- _mesa_meta_init(ctx);
-
- /* Initialize the software rasterizer and helper modules. */
- if (!_swrast_CreateContext(ctx) ||
- !_vbo_CreateContext(ctx) ||
- !_tnl_CreateContext(ctx) ||
- !_swsetup_CreateContext(ctx)) {
- _mesa_free_context_data(ctx);
- free(c);
- return NULL;
- }
- _swsetup_Wakeup(ctx);
- TNL_CONTEXT(ctx)->Driver.RunPipeline = _tnl_run_pipeline;
-
- return c;
-}
-
-
-void WMesaDestroyContext( WMesaContext pwc )
-{
- struct gl_context *ctx = &pwc->gl_ctx;
- WMesaFramebuffer pwfb;
- GET_CURRENT_CONTEXT(cur_ctx);
-
- if (cur_ctx == ctx) {
- /* unbind current if deleting current context */
- WMesaMakeCurrent(NULL, NULL);
- }
-
- /* clean up frame buffer resources */
- pwfb = wmesa_lookup_framebuffer(pwc->hDC);
- if (pwfb) {
- if (ctx->Visual.doubleBufferMode == 1)
- wmDeleteBackingStore(pwfb);
- wmesa_free_framebuffer(pwc->hDC);
- }
-
- /* Release for device, not memory contexts */
- if (WindowFromDC(pwc->hDC) != NULL)
- {
- ReleaseDC(WindowFromDC(pwc->hDC), pwc->hDC);
- }
- DeleteObject(pwc->clearPen);
- DeleteObject(pwc->clearBrush);
-
- _mesa_meta_free(ctx);
-
- _swsetup_DestroyContext(ctx);
- _tnl_DestroyContext(ctx);
- _vbo_DestroyContext(ctx);
- _swrast_DestroyContext(ctx);
-
- _mesa_free_context_data(ctx);
- free(pwc);
-}
-
-
-/**
- * Create a new color renderbuffer.
- */
-static struct gl_renderbuffer *
-wmesa_new_renderbuffer(void)
-{
- struct gl_renderbuffer *rb = CALLOC_STRUCT(gl_renderbuffer);
- if (!rb)
- return NULL;
-
- _mesa_init_renderbuffer(rb, (GLuint)0);
-
- rb->_BaseFormat = GL_RGBA;
- rb->InternalFormat = GL_RGBA;
- rb->DataType = CHAN_TYPE;
- rb->Delete = wmesa_delete_renderbuffer;
- rb->AllocStorage = wmesa_renderbuffer_storage;
- return rb;
-}
-
-
-void WMesaMakeCurrent(WMesaContext c, HDC hdc)
-{
- WMesaFramebuffer pwfb;
-
- {
- /* return if already current */
- GET_CURRENT_CONTEXT(ctx);
- WMesaContext pwc = wmesa_context(ctx);
- if (pwc && c == pwc && pwc->hDC == hdc)
- return;
- }
-
- pwfb = wmesa_lookup_framebuffer(hdc);
-
- /* Lazy creation of framebuffers */
- if (c && !pwfb && hdc) {
- struct gl_renderbuffer *rb;
- struct gl_config *visual = &c->gl_ctx.Visual;
- GLuint width, height;
-
- get_window_size(hdc, &width, &height);
-
- c->clearPen = CreatePen(PS_SOLID, 1, 0);
- c->clearBrush = CreateSolidBrush(0);
-
- pwfb = wmesa_new_framebuffer(hdc, visual);
-
- /* Create back buffer if double buffered */
- if (visual->doubleBufferMode == 1) {
- wmCreateBackingStore(pwfb, width, height);
- }
-
- /* make render buffers */
- if (visual->doubleBufferMode == 1) {
- rb = wmesa_new_renderbuffer();
- _mesa_add_renderbuffer(&pwfb->Base, BUFFER_BACK_LEFT, rb);
- wmesa_set_renderbuffer_funcs(rb, pwfb->pixelformat, pwfb->cColorBits, 1);
- }
- rb = wmesa_new_renderbuffer();
- _mesa_add_renderbuffer(&pwfb->Base, BUFFER_FRONT_LEFT, rb);
- wmesa_set_renderbuffer_funcs(rb, pwfb->pixelformat, pwfb->cColorBits, 0);
-
- /* Let Mesa own the Depth, Stencil, and Accum buffers */
- _mesa_add_soft_renderbuffers(&pwfb->Base,
- GL_FALSE, /* color */
- visual->depthBits > 0,
- visual->stencilBits > 0,
- visual->accumRedBits > 0,
- visual->alphaBits >0,
- GL_FALSE);
- }
-
- if (c && pwfb)
- _mesa_make_current(&c->gl_ctx, &pwfb->Base, &pwfb->Base);
- else
- _mesa_make_current(NULL, NULL, NULL);
-}
-
-
-void WMesaSwapBuffers( HDC hdc )
-{
- GET_CURRENT_CONTEXT(ctx);
- WMesaContext pwc = wmesa_context(ctx);
- WMesaFramebuffer pwfb = wmesa_lookup_framebuffer(hdc);
-
- if (!pwfb) {
- _mesa_problem(NULL, "wmesa: swapbuffers on unknown hdc");
- return;
- }
-
- /* If we're swapping the buffer associated with the current context
- * we have to flush any pending rendering commands first.
- */
- if (pwc->hDC == hdc) {
- _mesa_notifySwapBuffers(ctx);
-
- BitBlt(pwfb->hDC, 0, 0, pwfb->Base.Width, pwfb->Base.Height,
- pwfb->dib_hDC, 0, 0, SRCCOPY);
- }
- else {
- /* XXX for now only allow swapping current window */
- _mesa_problem(NULL, "wmesa: can't swap non-current window");
- }
-}
-
-void WMesaShareLists(WMesaContext ctx_to_share, WMesaContext ctx)
-{
- _mesa_share_state(&ctx->gl_ctx, &ctx_to_share->gl_ctx);
-}
-
+/*
+ * Windows (Win32/Win64) device driver for Mesa
+ *
+ */
+
+#include "wmesadef.h"
+#include "colors.h"
+#include "GL/wmesa.h"
+#include <winuser.h>
+#include "main/context.h"
+#include "main/extensions.h"
+#include "main/framebuffer.h"
+#include "main/renderbuffer.h"
+#include "main/macros.h"
+#include "drivers/common/driverfuncs.h"
+#include "drivers/common/meta.h"
+#include "vbo/vbo.h"
+#include "swrast/swrast.h"
+#include "swrast_setup/swrast_setup.h"
+#include "tnl/tnl.h"
+#include "tnl/t_context.h"
+#include "tnl/t_pipeline.h"
+
+
+/* linked list of our Framebuffers (windows) */
+static WMesaFramebuffer FirstFramebuffer = NULL;
+
+
+/**
+ * Create a new WMesaFramebuffer object which will correspond to the
+ * given HDC (Window handle).
+ */
+static WMesaFramebuffer
+wmesa_new_framebuffer(HDC hdc, struct gl_config *visual)
+{
+ WMesaFramebuffer pwfb
+ = (WMesaFramebuffer) malloc(sizeof(struct wmesa_framebuffer));
+ if (pwfb) {
+ _mesa_initialize_window_framebuffer(&pwfb->Base, visual);
+ pwfb->hDC = hdc;
+ /* insert at head of list */
+ pwfb->next = FirstFramebuffer;
+ FirstFramebuffer = pwfb;
+ }
+ return pwfb;
+}
+
+/**
+ * Given an hdc, free the corresponding WMesaFramebuffer
+ */
+static void
+wmesa_free_framebuffer(HDC hdc)
+{
+ WMesaFramebuffer pwfb, prev;
+ for (pwfb = FirstFramebuffer; pwfb; pwfb = pwfb->next) {
+ if (pwfb->hDC == hdc)
+ break;
+ prev = pwfb;
+ }
+ if (pwfb) {
+ struct gl_framebuffer *fb;
+ if (pwfb == FirstFramebuffer)
+ FirstFramebuffer = pwfb->next;
+ else
+ prev->next = pwfb->next;
+ fb = &pwfb->Base;
+ _mesa_reference_framebuffer(&fb, NULL);
+ }
+}
+
+/**
+ * Given an hdc, return the corresponding WMesaFramebuffer
+ */
+static WMesaFramebuffer
+wmesa_lookup_framebuffer(HDC hdc)
+{
+ WMesaFramebuffer pwfb;
+ for (pwfb = FirstFramebuffer; pwfb; pwfb = pwfb->next) {
+ if (pwfb->hDC == hdc)
+ return pwfb;
+ }
+ return NULL;
+}
+
+
+/**
+ * Given a struct gl_framebuffer, return the corresponding WMesaFramebuffer.
+ */
+static WMesaFramebuffer wmesa_framebuffer(struct gl_framebuffer *fb)
+{
+ return (WMesaFramebuffer) fb;
+}
+
+
+/**
+ * Given a struct gl_context, return the corresponding WMesaContext.
+ */
+static WMesaContext wmesa_context(const struct gl_context *ctx)
+{
+ return (WMesaContext) ctx;
+}
+
+
+/*
+ * Every driver should implement a GetString function in order to
+ * return a meaningful GL_RENDERER string.
+ */
+static const GLubyte *wmesa_get_string(struct gl_context *ctx, GLenum name)
+{
+ return (name == GL_RENDERER) ?
+ (GLubyte *) "Mesa Windows GDI Driver" : NULL;
+}
+
+
+/*
+ * Determine the pixel format based on the pixel size.
+ */
+static void wmSetPixelFormat(WMesaFramebuffer pwfb, HDC hDC)
+{
+ pwfb->cColorBits = GetDeviceCaps(hDC, BITSPIXEL);
+
+ /* Only 16 and 32 bit targets are supported now */
+ assert(pwfb->cColorBits == 0 ||
+ pwfb->cColorBits == 16 ||
+ pwfb->cColorBits == 24 ||
+ pwfb->cColorBits == 32);
+
+ switch(pwfb->cColorBits){
+ case 8:
+ pwfb->pixelformat = PF_INDEX8;
+ break;
+ case 16:
+ pwfb->pixelformat = PF_5R6G5B;
+ break;
+ case 24:
+ case 32:
+ pwfb->pixelformat = PF_8R8G8B;
+ break;
+ default:
+ pwfb->pixelformat = PF_BADFORMAT;
+ }
+}
+
+
+/**
+ * Create DIB for back buffer.
+ * We write into this memory with the span routines and then blit it
+ * to the window on a buffer swap.
+ */
+static BOOL wmCreateBackingStore(WMesaFramebuffer pwfb, long lxSize, long lySize)
+{
+ LPBITMAPINFO pbmi = &(pwfb->bmi);
+ HDC hic;
+
+ pbmi->bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
+ pbmi->bmiHeader.biWidth = lxSize;
+ pbmi->bmiHeader.biHeight= -lySize;
+ pbmi->bmiHeader.biPlanes = 1;
+ pbmi->bmiHeader.biBitCount = GetDeviceCaps(pwfb->hDC, BITSPIXEL);
+ pbmi->bmiHeader.biCompression = BI_RGB;
+ pbmi->bmiHeader.biSizeImage = 0;
+ pbmi->bmiHeader.biXPelsPerMeter = 0;
+ pbmi->bmiHeader.biYPelsPerMeter = 0;
+ pbmi->bmiHeader.biClrUsed = 0;
+ pbmi->bmiHeader.biClrImportant = 0;
+
+ pwfb->cColorBits = pbmi->bmiHeader.biBitCount;
+ pwfb->ScanWidth = (lxSize * (pwfb->cColorBits / 8) + 3) & ~3;
+
+ hic = CreateIC("display", NULL, NULL, NULL);
+ pwfb->dib_hDC = CreateCompatibleDC(hic);
+
+ pwfb->hbmDIB = CreateDIBSection(hic,
+ &pwfb->bmi,
+ DIB_RGB_COLORS,
+ (void **)&(pwfb->pbPixels),
+ 0,
+ 0);
+ pwfb->hOldBitmap = SelectObject(pwfb->dib_hDC, pwfb->hbmDIB);
+
+ DeleteDC(hic);
+
+ wmSetPixelFormat(pwfb, pwfb->hDC);
+ return TRUE;
+}
+
+
+static void wmDeleteBackingStore(WMesaFramebuffer pwfb)
+{
+ if (pwfb->hbmDIB) {
+ SelectObject(pwfb->dib_hDC, pwfb->hOldBitmap);
+ DeleteDC(pwfb->dib_hDC);
+ DeleteObject(pwfb->hbmDIB);
+ }
+}
+
+
+/**
+ * Find the width and height of the window named by hdc.
+ */
+static void
+get_window_size(HDC hdc, GLuint *width, GLuint *height)
+{
+ if (WindowFromDC(hdc)) {
+ RECT rect;
+ GetClientRect(WindowFromDC(hdc), &rect);
+ *width = rect.right - rect.left;
+ *height = rect.bottom - rect.top;
+ }
+ else { /* Memory context */
+ /* From contributed code - use the size of the desktop
+ * for the size of a memory context (?) */
+ *width = GetDeviceCaps(hdc, HORZRES);
+ *height = GetDeviceCaps(hdc, VERTRES);
+ }
+}
+
+
+static void
+wmesa_get_buffer_size(struct gl_framebuffer *buffer, GLuint *width, GLuint *height)
+{
+ WMesaFramebuffer pwfb = wmesa_framebuffer(buffer);
+ get_window_size(pwfb->hDC, width, height);
+}
+
+
+static void wmesa_flush(struct gl_context *ctx)
+{
+ WMesaFramebuffer pwfb = wmesa_framebuffer(ctx->WinSysDrawBuffer);
+
+ if (ctx->Visual.doubleBufferMode == 1) {
+ BitBlt(pwfb->hDC, 0, 0, pwfb->Base.Width, pwfb->Base.Height,
+ pwfb->dib_hDC, 0, 0, SRCCOPY);
+ }
+ else {
+ /* Do nothing for single buffer */
+ }
+}
+
+
+/**********************************************************************/
+/***** CLEAR Functions *****/
+/**********************************************************************/
+
+/* If we do not implement these, Mesa clears the buffers via the pixel
+ * span writing interface, which is very slow for a clear operation.
+ */
+
+/*
+ * Set the color used to clear the color buffer.
+ */
+static void clear_color(struct gl_context *ctx, const GLfloat color[4])
+{
+ WMesaContext pwc = wmesa_context(ctx);
+ GLubyte col[3];
+
+ CLAMPED_FLOAT_TO_UBYTE(col[0], color[0]);
+ CLAMPED_FLOAT_TO_UBYTE(col[1], color[1]);
+ CLAMPED_FLOAT_TO_UBYTE(col[2], color[2]);
+ pwc->clearColorRef = RGB(col[0], col[1], col[2]);
+ DeleteObject(pwc->clearPen);
+ DeleteObject(pwc->clearBrush);
+ pwc->clearPen = CreatePen(PS_SOLID, 1, pwc->clearColorRef);
+ pwc->clearBrush = CreateSolidBrush(pwc->clearColorRef);
+}
+
+
+/*
+ * Clear the specified region of the color buffer using the clear color
+ * or index as specified by one of the two functions above.
+ *
+ * This procedure clears either the front and/or the back COLOR buffers.
+ * Only the "left" buffer is cleared since we are not stereo.
+ * Clearing of the other non-color buffers is left to the swrast.
+ */
+
+static void clear(struct gl_context *ctx, GLbitfield mask)
+{
+#define FLIP(Y) (ctx->DrawBuffer->Height - (Y) - 1)
+ const GLint x = ctx->DrawBuffer->_Xmin;
+ const GLint y = ctx->DrawBuffer->_Ymin;
+ const GLint height = ctx->DrawBuffer->_Ymax - ctx->DrawBuffer->_Ymin;
+ const GLint width = ctx->DrawBuffer->_Xmax - ctx->DrawBuffer->_Xmin;
+
+ WMesaContext pwc = wmesa_context(ctx);
+ WMesaFramebuffer pwfb = wmesa_framebuffer(ctx->DrawBuffer);
+ int done = 0;
+
+ /* Let swrast do all the work if the masks are not set to
+ * clear all channels. */
+ if (!ctx->Color.ColorMask[0][0] ||
+ !ctx->Color.ColorMask[0][1] ||
+ !ctx->Color.ColorMask[0][2] ||
+ !ctx->Color.ColorMask[0][3]) {
+ _swrast_Clear(ctx, mask);
+ return;
+ }
+
+ /* Back buffer */
+ if (mask & BUFFER_BIT_BACK_LEFT) {
+
+ int i, rowSize;
+ UINT bytesPerPixel = pwfb->cColorBits / 8;
+ LPBYTE lpb, clearRow;
+ LPWORD lpw;
+ BYTE bColor;
+ WORD wColor;
+ BYTE r, g, b;
+ DWORD dwColor;
+ LPDWORD lpdw;
+
+ /* Try for a fast clear - clearing entire buffer with a single
+ * byte value. */
+ if (width == ctx->DrawBuffer->Width &&
+ height == ctx->DrawBuffer->Height) { /* entire buffer */
+ /* Now check for an easy clear value */
+ switch (bytesPerPixel) {
+ case 1:
+ bColor = BGR8(GetRValue(pwc->clearColorRef),
+ GetGValue(pwc->clearColorRef),
+ GetBValue(pwc->clearColorRef));
+ memset(pwfb->pbPixels, bColor,
+ pwfb->ScanWidth * height);
+ done = 1;
+ break;
+ case 2:
+ wColor = BGR16(GetRValue(pwc->clearColorRef),
+ GetGValue(pwc->clearColorRef),
+ GetBValue(pwc->clearColorRef));
+ if (((wColor >> 8) & 0xff) == (wColor & 0xff)) {
+ memset(pwfb->pbPixels, wColor & 0xff,
+ pwfb->ScanWidth * height);
+ done = 1;
+ }
+ break;
+ case 3:
+ /* fall through */
+ case 4:
+ if (GetRValue(pwc->clearColorRef) ==
+ GetGValue(pwc->clearColorRef) &&
+ GetRValue(pwc->clearColorRef) ==
+ GetBValue(pwc->clearColorRef)) {
+ memset(pwfb->pbPixels,
+ GetRValue(pwc->clearColorRef),
+ pwfb->ScanWidth * height);
+ done = 1;
+ }
+ break;
+ default:
+ break;
+ }
+ } /* all */
+
+ if (!done) {
+ /* Need to clear a row at a time. Begin by setting the first
+ * row in the area to be cleared to the clear color. */
+
+ clearRow = pwfb->pbPixels +
+ pwfb->ScanWidth * FLIP(y) +
+ bytesPerPixel * x;
+ switch (bytesPerPixel) {
+ case 1:
+ lpb = clearRow;
+ bColor = BGR8(GetRValue(pwc->clearColorRef),
+ GetGValue(pwc->clearColorRef),
+ GetBValue(pwc->clearColorRef));
+ memset(lpb, bColor, width);
+ break;
+ case 2:
+ lpw = (LPWORD)clearRow;
+ wColor = BGR16(GetRValue(pwc->clearColorRef),
+ GetGValue(pwc->clearColorRef),
+ GetBValue(pwc->clearColorRef));
+ for (i=0; i<width; i++)
+ *lpw++ = wColor;
+ break;
+ case 3:
+ lpb = clearRow;
+ r = GetRValue(pwc->clearColorRef);
+ g = GetGValue(pwc->clearColorRef);
+ b = GetBValue(pwc->clearColorRef);
+ for (i=0; i<width; i++) {
+ *lpb++ = b;
+ *lpb++ = g;
+ *lpb++ = r;
+ }
+ break;
+ case 4:
+ lpdw = (LPDWORD)clearRow;
+ dwColor = BGR32(GetRValue(pwc->clearColorRef),
+ GetGValue(pwc->clearColorRef),
+ GetBValue(pwc->clearColorRef));
+ for (i=0; i<width; i++)
+ *lpdw++ = dwColor;
+ break;
+ default:
+ break;
+ } /* switch */
+
+ /* copy cleared row to other rows in buffer */
+ lpb = clearRow - pwfb->ScanWidth;
+ rowSize = width * bytesPerPixel;
+ for (i=1; i<height; i++) {
+ memcpy(lpb, clearRow, rowSize);
+ lpb -= pwfb->ScanWidth;
+ }
+ } /* not done */
+ mask &= ~BUFFER_BIT_BACK_LEFT;
+ } /* back buffer */
+
+ /* front buffer */
+ if (mask & BUFFER_BIT_FRONT_LEFT) {
+ HDC DC = pwc->hDC;
+ HPEN Old_Pen = SelectObject(DC, pwc->clearPen);
+ HBRUSH Old_Brush = SelectObject(DC, pwc->clearBrush);
+ Rectangle(DC,
+ x,
+ FLIP(y) + 1,
+ x + width + 1,
+ FLIP(y) - height + 1);
+ SelectObject(DC, Old_Pen);
+ SelectObject(DC, Old_Brush);
+ mask &= ~BUFFER_BIT_FRONT_LEFT;
+ } /* front buffer */
+
+ /* Call swrast if there is anything left to clear (like DEPTH) */
+ if (mask)
+ _swrast_Clear(ctx, mask);
+
+#undef FLIP
+}
+
+
+/**********************************************************************/
+/***** PIXEL Functions *****/
+/**********************************************************************/
+
+#define FLIP(Y) (rb->Height - (Y) - 1)
+
+
+/**
+ ** Front Buffer reading/writing
+ ** These are slow, but work with all non-indexed visual types.
+ **/
+
+/* Write a horizontal span of RGBA color pixels with a boolean mask. */
+static void write_rgba_span_front(struct gl_context *ctx,
+ struct gl_renderbuffer *rb,
+ GLuint n, GLint x, GLint y,
+ const void *values,
+ const GLubyte *mask)
+{
+ const GLubyte (*rgba)[4] = (const GLubyte (*)[4])values;
+ WMesaContext pwc = wmesa_context(ctx);
+ WMesaFramebuffer pwfb = wmesa_lookup_framebuffer(pwc->hDC);
+ HBITMAP bmp=0;
+ HDC mdc=0;
+ typedef union
+ {
+ unsigned i;
+ struct {
+ unsigned b:8, g:8, r:8, a:8;
+ };
+ } BGRA;
+ BGRA *bgra, c;
+ GLuint i;
+
+ if (n < 16) { // the value 16 is just guessed
+ y=FLIP(y);
+ if (mask) {
+ for (i=0; i<n; i++)
+ if (mask[i])
+ SetPixel(pwc->hDC, x+i, y,
+ RGB(rgba[i][RCOMP], rgba[i][GCOMP], rgba[i][BCOMP]));
+ }
+ else {
+ for (i=0; i<n; i++)
+ SetPixel(pwc->hDC, x+i, y,
+ RGB(rgba[i][RCOMP], rgba[i][GCOMP], rgba[i][BCOMP]));
+ }
+ }
+ else {
+ if (!pwfb) {
+ _mesa_problem(NULL, "wmesa: write_rgba_span_front on unknown hdc");
+ return;
+ }
+ bgra=malloc(n*sizeof(BGRA));
+ if (!bgra) {
+ _mesa_problem(NULL, "wmesa: write_rgba_span_front: out of memory");
+ return;
+ }
+ c.a=0;
+ if (mask) {
+ for (i=0; i<n; i++) {
+ if (mask[i]) {
+ c.r=rgba[i][RCOMP];
+ c.g=rgba[i][GCOMP];
+ c.b=rgba[i][BCOMP];
+ c.a=rgba[i][ACOMP];
+ bgra[i]=c;
+ }
+ else
+ bgra[i].i=0;
+ }
+ }
+ else {
+ for (i=0; i<n; i++) {
+ c.r=rgba[i][RCOMP];
+ c.g=rgba[i][GCOMP];
+ c.b=rgba[i][BCOMP];
+ c.a=rgba[i][ACOMP];
+ bgra[i]=c;
+ }
+ }
+ bmp=CreateBitmap(n, 1, 1, 32, bgra);
+ mdc=CreateCompatibleDC(pwfb->hDC);
+ SelectObject(mdc, bmp);
+ y=FLIP(y);
+ BitBlt(pwfb->hDC, x, y, n, 1, mdc, 0, 0, SRCCOPY);
+ SelectObject(mdc, 0);
+ DeleteObject(bmp);
+ DeleteDC(mdc);
+ free(bgra);
+ }
+}
+
+/* Write a horizontal span of RGB color pixels with a boolean mask. */
+static void write_rgb_span_front(struct gl_context *ctx,
+ struct gl_renderbuffer *rb,
+ GLuint n, GLint x, GLint y,
+ const void *values,
+ const GLubyte *mask)
+{
+ const GLubyte (*rgb)[3] = (const GLubyte (*)[3])values;
+ WMesaContext pwc = wmesa_context(ctx);
+ GLuint i;
+
+ (void) ctx;
+ y=FLIP(y);
+ if (mask) {
+ for (i=0; i<n; i++)
+ if (mask[i])
+ SetPixel(pwc->hDC, x+i, y, RGB(rgb[i][RCOMP], rgb[i][GCOMP],
+ rgb[i][BCOMP]));
+ }
+ else {
+ for (i=0; i<n; i++)
+ SetPixel(pwc->hDC, x+i, y, RGB(rgb[i][RCOMP], rgb[i][GCOMP],
+ rgb[i][BCOMP]));
+ }
+
+}
+
+/*
+ * Write a horizontal span of pixels with a boolean mask. The current color
+ * is used for all pixels.
+ */
+static void write_mono_rgba_span_front(struct gl_context *ctx,
+ struct gl_renderbuffer *rb,
+ GLuint n, GLint x, GLint y,
+ const void *value,
+ const GLubyte *mask)
+{
+ const GLchan *color = (const GLchan *)value;
+ GLuint i;
+ WMesaContext pwc = wmesa_context(ctx);
+ COLORREF colorref;
+
+ (void) ctx;
+ colorref = RGB(color[RCOMP], color[GCOMP], color[BCOMP]);
+ y=FLIP(y);
+ if (mask) {
+ for (i=0; i<n; i++)
+ if (mask[i])
+ SetPixel(pwc->hDC, x+i, y, colorref);
+ }
+ else
+ for (i=0; i<n; i++)
+ SetPixel(pwc->hDC, x+i, y, colorref);
+
+}
+
+/* Write an array of RGBA pixels with a boolean mask. */
+static void write_rgba_pixels_front(struct gl_context *ctx,
+ struct gl_renderbuffer *rb,
+ GLuint n,
+ const GLint x[], const GLint y[],
+ const void *values,
+ const GLubyte *mask)
+{
+ const GLubyte (*rgba)[4] = (const GLubyte (*)[4])values;
+ GLuint i;
+ WMesaContext pwc = wmesa_context(ctx);
+ (void) ctx;
+ for (i=0; i<n; i++)
+ if (mask[i])
+ SetPixel(pwc->hDC, x[i], FLIP(y[i]),
+ RGB(rgba[i][RCOMP], rgba[i][GCOMP],
+ rgba[i][BCOMP]));
+}
+
+
+
+/*
+ * Write an array of pixels with a boolean mask. The current color
+ * is used for all pixels.
+ */
+static void write_mono_rgba_pixels_front(struct gl_context *ctx,
+ struct gl_renderbuffer *rb,
+ GLuint n,
+ const GLint x[], const GLint y[],
+ const void *value,
+ const GLubyte *mask)
+{
+ const GLchan *color = (const GLchan *)value;
+ GLuint i;
+ WMesaContext pwc = wmesa_context(ctx);
+ COLORREF colorref;
+ (void) ctx;
+ colorref = RGB(color[RCOMP], color[GCOMP], color[BCOMP]);
+ for (i=0; i<n; i++)
+ if (mask[i])
+ SetPixel(pwc->hDC, x[i], FLIP(y[i]), colorref);
+}
+
+/* Read a horizontal span of color pixels. */
+static void read_rgba_span_front(struct gl_context *ctx,
+ struct gl_renderbuffer *rb,
+ GLuint n, GLint x, GLint y,
+ void *values)
+{
+ GLubyte (*rgba)[4] = (GLubyte (*)[4])values;
+ WMesaContext pwc = wmesa_context(ctx);
+ GLuint i;
+ COLORREF Color;
+ y = FLIP(y);
+ for (i=0; i<n; i++) {
+ Color = GetPixel(pwc->hDC, x+i, y);
+ rgba[i][RCOMP] = GetRValue(Color);
+ rgba[i][GCOMP] = GetGValue(Color);
+ rgba[i][BCOMP] = GetBValue(Color);
+ rgba[i][ACOMP] = 255;
+ }
+}
+
+
+/* Read an array of color pixels. */
+static void read_rgba_pixels_front(struct gl_context *ctx,
+ struct gl_renderbuffer *rb,
+ GLuint n, const GLint x[], const GLint y[],
+ void *values)
+{
+ GLubyte (*rgba)[4] = (GLubyte (*)[4])values;
+ WMesaContext pwc = wmesa_context(ctx);
+ GLuint i;
+ COLORREF Color;
+ for (i=0; i<n; i++) {
+ GLint y2 = FLIP(y[i]);
+ Color = GetPixel(pwc->hDC, x[i], y2);
+ rgba[i][RCOMP] = GetRValue(Color);
+ rgba[i][GCOMP] = GetGValue(Color);
+ rgba[i][BCOMP] = GetBValue(Color);
+ rgba[i][ACOMP] = 255;
+ }
+}
+
+/*********************************************************************/
+
+/* DOUBLE BUFFER 32-bit */
+
+#define WMSETPIXEL32(pwc, y, x, r, g, b) { \
+LPDWORD lpdw = ((LPDWORD)((pwc)->pbPixels + (pwc)->ScanWidth * (y)) + (x)); \
+*lpdw = BGR32((r),(g),(b)); }
+
+
+
+/* Write a horizontal span of RGBA color pixels with a boolean mask. */
+static void write_rgba_span_32(struct gl_context *ctx,
+ struct gl_renderbuffer *rb,
+ GLuint n, GLint x, GLint y,
+ const void *values,
+ const GLubyte *mask)
+{
+ const GLubyte (*rgba)[4] = (const GLubyte (*)[4])values;
+ WMesaFramebuffer pwfb = wmesa_framebuffer(ctx->DrawBuffer);
+ GLuint i;
+ LPDWORD lpdw;
+
+ (void) ctx;
+
+ y=FLIP(y);
+ lpdw = ((LPDWORD)(pwfb->pbPixels + pwfb->ScanWidth * y)) + x;
+ if (mask) {
+ for (i=0; i<n; i++)
+ if (mask[i])
+ lpdw[i] = BGR32(rgba[i][RCOMP], rgba[i][GCOMP],
+ rgba[i][BCOMP]);
+ }
+ else {
+ for (i=0; i<n; i++)
+ *lpdw++ = BGR32(rgba[i][RCOMP], rgba[i][GCOMP],
+ rgba[i][BCOMP]);
+ }
+}
+
+
+/* Write a horizontal span of RGB color pixels with a boolean mask. */
+static void write_rgb_span_32(struct gl_context *ctx,
+ struct gl_renderbuffer *rb,
+ GLuint n, GLint x, GLint y,
+ const void *values,
+ const GLubyte *mask)
+{
+ const GLubyte (*rgb)[3] = (const GLubyte (*)[3])values;
+ WMesaFramebuffer pwfb = wmesa_framebuffer(ctx->DrawBuffer);
+ GLuint i;
+ LPDWORD lpdw;
+
+ (void) ctx;
+
+ y=FLIP(y);
+ lpdw = ((LPDWORD)(pwfb->pbPixels + pwfb->ScanWidth * y)) + x;
+ if (mask) {
+ for (i=0; i<n; i++)
+ if (mask[i])
+ lpdw[i] = BGR32(rgb[i][RCOMP], rgb[i][GCOMP],
+ rgb[i][BCOMP]);
+ }
+ else {
+ for (i=0; i<n; i++)
+ *lpdw++ = BGR32(rgb[i][RCOMP], rgb[i][GCOMP],
+ rgb[i][BCOMP]);
+ }
+}
+
+/*
+ * Write a horizontal span of pixels with a boolean mask. The current color
+ * is used for all pixels.
+ */
+static void write_mono_rgba_span_32(struct gl_context *ctx,
+ struct gl_renderbuffer *rb,
+ GLuint n, GLint x, GLint y,
+ const void *value,
+ const GLubyte *mask)
+{
+ const GLchan *color = (const GLchan *)value;
+ LPDWORD lpdw;
+ DWORD pixel;
+ GLuint i;
+ WMesaFramebuffer pwfb = wmesa_framebuffer(ctx->DrawBuffer);
+ lpdw = ((LPDWORD)(pwfb->pbPixels + pwfb->ScanWidth * y)) + x;
+ y=FLIP(y);
+ pixel = BGR32(color[RCOMP], color[GCOMP], color[BCOMP]);
+ if (mask) {
+ for (i=0; i<n; i++)
+ if (mask[i])
+ lpdw[i] = pixel;
+ }
+ else
+ for (i=0; i<n; i++)
+ *lpdw++ = pixel;
+
+}
+
+/* Write an array of RGBA pixels with a boolean mask. */
+static void write_rgba_pixels_32(struct gl_context *ctx,
+ struct gl_renderbuffer *rb,
+ GLuint n, const GLint x[], const GLint y[],
+ const void *values,
+ const GLubyte *mask)
+{
+ const GLubyte (*rgba)[4] = (const GLubyte (*)[4])values;
+ GLuint i;
+ WMesaFramebuffer pwfb = wmesa_framebuffer(ctx->DrawBuffer);
+ for (i=0; i<n; i++)
+ if (mask[i])
+ WMSETPIXEL32(pwfb, FLIP(y[i]), x[i],
+ rgba[i][RCOMP], rgba[i][GCOMP], rgba[i][BCOMP]);
+}
+
+/*
+ * Write an array of pixels with a boolean mask. The current color
+ * is used for all pixels.
+ */
+static void write_mono_rgba_pixels_32(struct gl_context *ctx,
+ struct gl_renderbuffer *rb,
+ GLuint n,
+ const GLint x[], const GLint y[],
+ const void *value,
+ const GLubyte *mask)
+{
+ const GLchan *color = (const GLchan *)value;
+ GLuint i;
+ WMesaFramebuffer pwfb = wmesa_framebuffer(ctx->DrawBuffer);
+ for (i=0; i<n; i++)
+ if (mask[i])
+ WMSETPIXEL32(pwfb, FLIP(y[i]),x[i],color[RCOMP],
+ color[GCOMP], color[BCOMP]);
+}
+
+/* Read a horizontal span of color pixels. */
+static void read_rgba_span_32(struct gl_context *ctx,
+ struct gl_renderbuffer *rb,
+ GLuint n, GLint x, GLint y,
+ void *values)
+{
+ GLubyte (*rgba)[4] = (GLubyte (*)[4])values;
+ GLuint i;
+ DWORD pixel;
+ LPDWORD lpdw;
+ WMesaFramebuffer pwfb = wmesa_framebuffer(ctx->DrawBuffer);
+
+ y = FLIP(y);
+ lpdw = ((LPDWORD)(pwfb->pbPixels + pwfb->ScanWidth * y)) + x;
+ for (i=0; i<n; i++) {
+ pixel = lpdw[i];
+ rgba[i][RCOMP] = (GLubyte)((pixel & 0x00ff0000) >> 16);
+ rgba[i][GCOMP] = (GLubyte)((pixel & 0x0000ff00) >> 8);
+ rgba[i][BCOMP] = (GLubyte)(pixel & 0x000000ff);
+ rgba[i][ACOMP] = 255;
+ }
+}
+
+
+/* Read an array of color pixels. */
+static void read_rgba_pixels_32(struct gl_context *ctx,
+ struct gl_renderbuffer *rb,
+ GLuint n, const GLint x[], const GLint y[],
+ void *values)
+{
+ GLubyte (*rgba)[4] = (GLubyte (*)[4])values;
+ GLuint i;
+ DWORD pixel;
+ LPDWORD lpdw;
+ WMesaFramebuffer pwfb = wmesa_framebuffer(ctx->DrawBuffer);
+
+ for (i=0; i<n; i++) {
+ GLint y2 = FLIP(y[i]);
+ lpdw = ((LPDWORD)(pwfb->pbPixels + pwfb->ScanWidth * y2)) + x[i];
+ pixel = *lpdw;
+ rgba[i][RCOMP] = (GLubyte)((pixel & 0x00ff0000) >> 16);
+ rgba[i][GCOMP] = (GLubyte)((pixel & 0x0000ff00) >> 8);
+ rgba[i][BCOMP] = (GLubyte)(pixel & 0x000000ff);
+ rgba[i][ACOMP] = 255;
+ }
+}
+
+
+/*********************************************************************/
+
+/* DOUBLE BUFFER 24-bit */
+
+#define WMSETPIXEL24(pwc, y, x, r, g, b) { \
+LPBYTE lpb = ((LPBYTE)((pwc)->pbPixels + (pwc)->ScanWidth * (y)) + (3 * x)); \
+lpb[0] = (b); \
+lpb[1] = (g); \
+lpb[2] = (r); }
+
+/* Write a horizontal span of RGBA color pixels with a boolean mask. */
+static void write_rgba_span_24(struct gl_context *ctx,
+ struct gl_renderbuffer *rb,
+ GLuint n, GLint x, GLint y,
+ const void *values,
+ const GLubyte *mask)
+{
+ const GLubyte (*rgba)[4] = (const GLubyte (*)[4])values;
+ WMesaFramebuffer pwfb = wmesa_framebuffer(ctx->DrawBuffer);
+ GLuint i;
+ LPBYTE lpb;
+
+ (void) ctx;
+
+ y=FLIP(y);
+ lpb = ((LPBYTE)(pwfb->pbPixels + pwfb->ScanWidth * y)) + (3 * x);
+ if (mask) {
+ for (i=0; i<n; i++)
+ if (mask[i]) {
+ lpb[3*i] = rgba[i][BCOMP];
+ lpb[3*i+1] = rgba[i][GCOMP];
+ lpb[3*i+2] = rgba[i][RCOMP];
+ }
+ }
+ else {
+ for (i=0; i<n; i++) {
+ *lpb++ = rgba[i][BCOMP];
+ *lpb++ = rgba[i][GCOMP];
+ *lpb++ = rgba[i][RCOMP];
+ }
+ }
+}
+
+
+/* Write a horizontal span of RGB color pixels with a boolean mask. */
+static void write_rgb_span_24(struct gl_context *ctx,
+ struct gl_renderbuffer *rb,
+ GLuint n, GLint x, GLint y,
+ const void *values,
+ const GLubyte *mask)
+{
+ const GLubyte (*rgb)[3] = (const GLubyte (*)[3])values;
+ WMesaFramebuffer pwfb = wmesa_framebuffer(ctx->DrawBuffer);
+ GLuint i;
+ LPBYTE lpb;
+
+ (void) ctx;
+
+ y=FLIP(y);
+ lpb = ((LPBYTE)(pwfb->pbPixels + pwfb->ScanWidth * y)) + (3 * x);
+ if (mask) {
+ for (i=0; i<n; i++)
+ if (mask[i]) {
+ lpb[3*i] = rgb[i][BCOMP];
+ lpb[3*i+1] = rgb[i][GCOMP];
+ lpb[3*i+2] = rgb[i][RCOMP];
+ }
+ }
+ else {
+ for (i=0; i<n; i++) {
+ *lpb++ = rgb[i][BCOMP];
+ *lpb++ = rgb[i][GCOMP];
+ *lpb++ = rgb[i][RCOMP];
+ }
+ }
+}
+
+/*
+ * Write a horizontal span of pixels with a boolean mask. The current color
+ * is used for all pixels.
+ */
+static void write_mono_rgba_span_24(struct gl_context *ctx,
+ struct gl_renderbuffer *rb,
+ GLuint n, GLint x, GLint y,
+ const void *value,
+ const GLubyte *mask)
+{
+ const GLchan *color = (const GLchan *)value;
+ LPBYTE lpb;
+ GLuint i;
+ WMesaFramebuffer pwfb = wmesa_framebuffer(ctx->DrawBuffer);
+ lpb = ((LPBYTE)(pwfb->pbPixels + pwfb->ScanWidth * y)) + (3 * x);
+ y=FLIP(y);
+ if (mask) {
+ for (i=0; i<n; i++)
+ if (mask[i]) {
+ lpb[3*i] = color[BCOMP];
+ lpb[3*i+1] = color[GCOMP];
+ lpb[3*i+2] = color[RCOMP];
+ }
+ }
+ else
+ for (i=0; i<n; i++) {
+ *lpb++ = color[BCOMP];
+ *lpb++ = color[GCOMP];
+ *lpb++ = color[RCOMP];
+ }
+}
+
+/* Write an array of RGBA pixels with a boolean mask. */
+static void write_rgba_pixels_24(struct gl_context *ctx,
+ struct gl_renderbuffer *rb,
+ GLuint n, const GLint x[], const GLint y[],
+ const void *values,
+ const GLubyte *mask)
+{
+ const GLubyte (*rgba)[4] = (const GLubyte (*)[4])values;
+ GLuint i;
+ WMesaFramebuffer pwfb = wmesa_framebuffer(ctx->DrawBuffer);
+ for (i=0; i<n; i++)
+ if (mask[i])
+ WMSETPIXEL24(pwfb, FLIP(y[i]), x[i],
+ rgba[i][RCOMP], rgba[i][GCOMP], rgba[i][BCOMP]);
+}
+
+/*
+ * Write an array of pixels with a boolean mask. The current color
+ * is used for all pixels.
+ */
+static void write_mono_rgba_pixels_24(struct gl_context *ctx,
+ struct gl_renderbuffer *rb,
+ GLuint n,
+ const GLint x[], const GLint y[],
+ const void *value,
+ const GLubyte *mask)
+{
+ const GLchan *color = (const GLchan *)value;
+ GLuint i;
+ WMesaFramebuffer pwfb = wmesa_framebuffer(ctx->DrawBuffer);
+ for (i=0; i<n; i++)
+ if (mask[i])
+ WMSETPIXEL24(pwfb, FLIP(y[i]),x[i],color[RCOMP],
+ color[GCOMP], color[BCOMP]);
+}
+
+/* Read a horizontal span of color pixels. */
+static void read_rgba_span_24(struct gl_context *ctx,
+ struct gl_renderbuffer *rb,
+ GLuint n, GLint x, GLint y,
+ void *values)
+{
+ GLubyte (*rgba)[4] = (GLubyte (*)[4])values;
+ GLuint i;
+ LPBYTE lpb;
+ WMesaFramebuffer pwfb = wmesa_framebuffer(ctx->DrawBuffer);
+
+ y = FLIP(y);
+ lpb = ((LPBYTE)(pwfb->pbPixels + pwfb->ScanWidth * y)) + (3 * x);
+ for (i=0; i<n; i++) {
+ rgba[i][RCOMP] = lpb[3*i+2];
+ rgba[i][GCOMP] = lpb[3*i+1];
+ rgba[i][BCOMP] = lpb[3*i];
+ rgba[i][ACOMP] = 255;
+ }
+}
+
+
+/* Read an array of color pixels. */
+static void read_rgba_pixels_24(struct gl_context *ctx,
+ struct gl_renderbuffer *rb,
+ GLuint n, const GLint x[], const GLint y[],
+ void *values)
+{
+ GLubyte (*rgba)[4] = (GLubyte (*)[4])values;
+ GLuint i;
+ LPBYTE lpb;
+ WMesaFramebuffer pwfb = wmesa_framebuffer(ctx->DrawBuffer);
+
+ for (i=0; i<n; i++) {
+ GLint y2 = FLIP(y[i]);
+ lpb = ((LPBYTE)(pwfb->pbPixels + pwfb->ScanWidth * y2)) + (3 * x[i]);
+ rgba[i][RCOMP] = lpb[3*i+2];
+ rgba[i][GCOMP] = lpb[3*i+1];
+ rgba[i][BCOMP] = lpb[3*i];
+ rgba[i][ACOMP] = 255;
+ }
+}
+
+
+/*********************************************************************/
+
+/* DOUBLE BUFFER 16-bit */
+
+#define WMSETPIXEL16(pwc, y, x, r, g, b) { \
+LPWORD lpw = ((LPWORD)((pwc)->pbPixels + (pwc)->ScanWidth * (y)) + (x)); \
+*lpw = BGR16((r),(g),(b)); }
+
+
+
+/* Write a horizontal span of RGBA color pixels with a boolean mask. */
+static void write_rgba_span_16(struct gl_context *ctx,
+ struct gl_renderbuffer *rb,
+ GLuint n, GLint x, GLint y,
+ const void *values,
+ const GLubyte *mask)
+{
+ const GLubyte (*rgba)[4] = (const GLubyte (*)[4])values;
+ WMesaFramebuffer pwfb = wmesa_framebuffer(ctx->DrawBuffer);
+ GLuint i;
+ LPWORD lpw;
+
+ (void) ctx;
+
+ y=FLIP(y);
+ lpw = ((LPWORD)(pwfb->pbPixels + pwfb->ScanWidth * y)) + x;
+ if (mask) {
+ for (i=0; i<n; i++)
+ if (mask[i])
+ lpw[i] = BGR16(rgba[i][RCOMP], rgba[i][GCOMP],
+ rgba[i][BCOMP]);
+ }
+ else {
+ for (i=0; i<n; i++)
+ *lpw++ = BGR16(rgba[i][RCOMP], rgba[i][GCOMP],
+ rgba[i][BCOMP]);
+ }
+}
+
+
+/* Write a horizontal span of RGB color pixels with a boolean mask. */
+static void write_rgb_span_16(struct gl_context *ctx,
+ struct gl_renderbuffer *rb,
+ GLuint n, GLint x, GLint y,
+ const void *values,
+ const GLubyte *mask)
+{
+ const GLubyte (*rgb)[3] = (const GLubyte (*)[3])values;
+ WMesaFramebuffer pwfb = wmesa_framebuffer(ctx->DrawBuffer);
+ GLuint i;
+ LPWORD lpw;
+
+ (void) ctx;
+
+ y=FLIP(y);
+ lpw = ((LPWORD)(pwfb->pbPixels + pwfb->ScanWidth * y)) + x;
+ if (mask) {
+ for (i=0; i<n; i++)
+ if (mask[i])
+ lpw[i] = BGR16(rgb[i][RCOMP], rgb[i][GCOMP],
+ rgb[i][BCOMP]);
+ }
+ else {
+ for (i=0; i<n; i++)
+ *lpw++ = BGR16(rgb[i][RCOMP], rgb[i][GCOMP],
+ rgb[i][BCOMP]);
+ }
+}
+
+/*
+ * Write a horizontal span of pixels with a boolean mask. The current color
+ * is used for all pixels.
+ */
+static void write_mono_rgba_span_16(struct gl_context *ctx,
+ struct gl_renderbuffer *rb,
+ GLuint n, GLint x, GLint y,
+ const void *value,
+ const GLubyte *mask)
+{
+ const GLchan *color = (const GLchan *)value;
+ LPWORD lpw;
+ WORD pixel;
+ GLuint i;
+ WMesaFramebuffer pwfb = wmesa_framebuffer(ctx->DrawBuffer);
+ (void) ctx;
+ lpw = ((LPWORD)(pwfb->pbPixels + pwfb->ScanWidth * y)) + x;
+ y=FLIP(y);
+ pixel = BGR16(color[RCOMP], color[GCOMP], color[BCOMP]);
+ if (mask) {
+ for (i=0; i<n; i++)
+ if (mask[i])
+ lpw[i] = pixel;
+ }
+ else
+ for (i=0; i<n; i++)
+ *lpw++ = pixel;
+
+}
+
+/* Write an array of RGBA pixels with a boolean mask. */
+static void write_rgba_pixels_16(struct gl_context *ctx,
+ struct gl_renderbuffer *rb,
+ GLuint n, const GLint x[], const GLint y[],
+ const void *values,
+ const GLubyte *mask)
+{
+ const GLubyte (*rgba)[4] = (const GLubyte (*)[4])values;
+ GLuint i;
+ WMesaFramebuffer pwfb = wmesa_framebuffer(ctx->DrawBuffer);
+ (void) ctx;
+ for (i=0; i<n; i++)
+ if (mask[i])
+ WMSETPIXEL16(pwfb, FLIP(y[i]), x[i],
+ rgba[i][RCOMP], rgba[i][GCOMP], rgba[i][BCOMP]);
+}
+
+/*
+ * Write an array of pixels with a boolean mask. The current color
+ * is used for all pixels.
+ */
+static void write_mono_rgba_pixels_16(struct gl_context *ctx,
+ struct gl_renderbuffer *rb,
+ GLuint n,
+ const GLint x[], const GLint y[],
+ const void *value,
+ const GLubyte *mask)
+{
+ const GLchan *color = (const GLchan *)value;
+ GLuint i;
+ WMesaFramebuffer pwfb = wmesa_framebuffer(ctx->DrawBuffer);
+ (void) ctx;
+ for (i=0; i<n; i++)
+ if (mask[i])
+ WMSETPIXEL16(pwfb, FLIP(y[i]),x[i],color[RCOMP],
+ color[GCOMP], color[BCOMP]);
+}
+
+/* Read a horizontal span of color pixels. */
+static void read_rgba_span_16(struct gl_context *ctx,
+ struct gl_renderbuffer *rb,
+ GLuint n, GLint x, GLint y,
+ void *values)
+{
+ GLubyte (*rgba)[4] = (GLubyte (*)[4])values;
+ GLuint i, pixel;
+ LPWORD lpw;
+ WMesaFramebuffer pwfb = wmesa_framebuffer(ctx->DrawBuffer);
+
+ y = FLIP(y);
+ lpw = ((LPWORD)(pwfb->pbPixels + pwfb->ScanWidth * y)) + x;
+ for (i=0; i<n; i++) {
+ pixel = lpw[i];
+ /* Windows uses 5,5,5 for 16-bit */
+ rgba[i][RCOMP] = (pixel & 0x7c00) >> 7;
+ rgba[i][GCOMP] = (pixel & 0x03e0) >> 2;
+ rgba[i][BCOMP] = (pixel & 0x001f) << 3;
+ rgba[i][ACOMP] = 255;
+ }
+}
+
+
+/* Read an array of color pixels. */
+static void read_rgba_pixels_16(struct gl_context *ctx,
+ struct gl_renderbuffer *rb,
+ GLuint n, const GLint x[], const GLint y[],
+ void *values)
+{
+ GLubyte (*rgba)[4] = (GLubyte (*)[4])values;
+ GLuint i, pixel;
+ LPWORD lpw;
+ WMesaFramebuffer pwfb = wmesa_framebuffer(ctx->DrawBuffer);
+
+ for (i=0; i<n; i++) {
+ GLint y2 = FLIP(y[i]);
+ lpw = ((LPWORD)(pwfb->pbPixels + pwfb->ScanWidth * y2)) + x[i];
+ pixel = *lpw;
+ /* Windows uses 5,5,5 for 16-bit */
+ rgba[i][RCOMP] = (pixel & 0x7c00) >> 7;
+ rgba[i][GCOMP] = (pixel & 0x03e0) >> 2;
+ rgba[i][BCOMP] = (pixel & 0x001f) << 3;
+ rgba[i][ACOMP] = 255;
+ }
+}
+
+
+
+
+/**********************************************************************/
+/***** BUFFER Functions *****/
+/**********************************************************************/
+
+
+
+
+static void
+wmesa_delete_renderbuffer(struct gl_renderbuffer *rb)
+{
+ free(rb);
+}
+
+
+/**
+ * This is called by Mesa whenever it determines that the window size
+ * has changed. Do whatever's needed to cope with that.
+ */
+static GLboolean
+wmesa_renderbuffer_storage(struct gl_context *ctx,
+ struct gl_renderbuffer *rb,
+ GLenum internalFormat,
+ GLuint width,
+ GLuint height)
+{
+ rb->Width = width;
+ rb->Height = height;
+ return GL_TRUE;
+}
+
+
+/**
+ * Plug in the Get/PutRow/Values functions for a renderbuffer depending
+ * on if we're drawing to the front or back color buffer.
+ */
+static void
+wmesa_set_renderbuffer_funcs(struct gl_renderbuffer *rb, int pixelformat,
+ int cColorBits, int double_buffer)
+{
+ if (double_buffer) {
+ /* back buffer */
+ /* Picking the correct span functions is important because
+ * the DIB was allocated with the indicated depth. */
+ switch(pixelformat) {
+ case PF_5R6G5B:
+ rb->PutRow = write_rgba_span_16;
+ rb->PutRowRGB = write_rgb_span_16;
+ rb->PutMonoRow = write_mono_rgba_span_16;
+ rb->PutValues = write_rgba_pixels_16;
+ rb->PutMonoValues = write_mono_rgba_pixels_16;
+ rb->GetRow = read_rgba_span_16;
+ rb->GetValues = read_rgba_pixels_16;
+ break;
+ case PF_8R8G8B:
+ if (cColorBits == 24)
+ {
+ rb->PutRow = write_rgba_span_24;
+ rb->PutRowRGB = write_rgb_span_24;
+ rb->PutMonoRow = write_mono_rgba_span_24;
+ rb->PutValues = write_rgba_pixels_24;
+ rb->PutMonoValues = write_mono_rgba_pixels_24;
+ rb->GetRow = read_rgba_span_24;
+ rb->GetValues = read_rgba_pixels_24;
+ }
+ else
+ {
+ rb->PutRow = write_rgba_span_32;
+ rb->PutRowRGB = write_rgb_span_32;
+ rb->PutMonoRow = write_mono_rgba_span_32;
+ rb->PutValues = write_rgba_pixels_32;
+ rb->PutMonoValues = write_mono_rgba_pixels_32;
+ rb->GetRow = read_rgba_span_32;
+ rb->GetValues = read_rgba_pixels_32;
+ }
+ break;
+ default:
+ break;
+ }
+ }
+ else {
+ /* front buffer (actual Windows window) */
+ rb->PutRow = write_rgba_span_front;
+ rb->PutRowRGB = write_rgb_span_front;
+ rb->PutMonoRow = write_mono_rgba_span_front;
+ rb->PutValues = write_rgba_pixels_front;
+ rb->PutMonoValues = write_mono_rgba_pixels_front;
+ rb->GetRow = read_rgba_span_front;
+ rb->GetValues = read_rgba_pixels_front;
+ }
+}
+
+/**
+ * Called by ctx->Driver.ResizeBuffers()
+ * Resize the front/back colorbuffers to match the latest window size.
+ */
+static void
+wmesa_resize_buffers(struct gl_context *ctx, struct gl_framebuffer *buffer,
+ GLuint width, GLuint height)
+{
+ WMesaFramebuffer pwfb = wmesa_framebuffer(buffer);
+
+ if (pwfb->Base.Width != width || pwfb->Base.Height != height) {
+ /* Realloc back buffer */
+ if (ctx->Visual.doubleBufferMode == 1) {
+ wmDeleteBackingStore(pwfb);
+ wmCreateBackingStore(pwfb, width, height);
+ }
+ }
+ _mesa_resize_framebuffer(ctx, buffer, width, height);
+}
+
+
+/**
+ * Called by glViewport.
+ * This is a good time for us to poll the current window size and adjust
+ * our renderbuffers to match the current window size.
+ * Remember, we have no opportunity to respond to conventional
+ * resize events since the driver has no event loop.
+ * Thus, we poll.
+ * MakeCurrent also ends up making a call here, so that ensures
+ * we get the viewport set correctly, even if the app does not call
+ * glViewport and relies on the defaults.
+ */
+static void wmesa_viewport(struct gl_context *ctx,
+ GLint x, GLint y,
+ GLsizei width, GLsizei height)
+{
+ GLuint new_width, new_height;
+
+ wmesa_get_buffer_size(ctx->WinSysDrawBuffer, &new_width, &new_height);
+
+ /**
+ * Resize buffers if the window size changed.
+ */
+ wmesa_resize_buffers(ctx, ctx->WinSysDrawBuffer, new_width, new_height);
+ ctx->NewState |= _NEW_BUFFERS; /* to update scissor / window bounds */
+}
+
+
+
+
+/**
+ * Called when the driver should update it's state, based on the new_state
+ * flags.
+ */
+static void wmesa_update_state(struct gl_context *ctx, GLuint new_state)
+{
+ _swrast_InvalidateState(ctx, new_state);
+ _swsetup_InvalidateState(ctx, new_state);
+ _vbo_InvalidateState(ctx, new_state);
+ _tnl_InvalidateState(ctx, new_state);
+
+ /* TODO - This code is not complete yet because I
+ * don't know what to do for all state updates.
+ */
+
+ if (new_state & _NEW_BUFFERS) {
+ }
+}
+
+
+
+
+
+/**********************************************************************/
+/***** WMESA Functions *****/
+/**********************************************************************/
+
+WMesaContext WMesaCreateContext(HDC hDC,
+ HPALETTE* Pal,
+ GLboolean rgb_flag,
+ GLboolean db_flag,
+ GLboolean alpha_flag)
+{
+ WMesaContext c;
+ struct dd_function_table functions;
+ GLint red_bits, green_bits, blue_bits, alpha_bits;
+ struct gl_context *ctx;
+ struct gl_config *visual;
+
+ (void) Pal;
+
+ /* Indexed mode not supported */
+ if (!rgb_flag)
+ return NULL;
+
+ /* Allocate wmesa context */
+ c = CALLOC_STRUCT(wmesa_context);
+ if (!c)
+ return NULL;
+
+#if 0
+ /* I do not understand this contributed code */
+ /* Support memory and device contexts */
+ if(WindowFromDC(hDC) != NULL) {
+ c->hDC = GetDC(WindowFromDC(hDC)); /* huh ???? */
+ }
+ else {
+ c->hDC = hDC;
+ }
+#else
+ c->hDC = hDC;
+#endif
+
+ /* Get data for visual */
+ /* Dealing with this is actually a bit of overkill because Mesa will end
+ * up treating all color component size requests less than 8 by using
+ * a single byte per channel. In addition, the interface to the span
+ * routines passes colors as an entire byte per channel anyway, so there
+ * is nothing to be saved by telling the visual to be 16 bits if the device
+ * is 16 bits. That is, Mesa is going to compute colors down to 8 bits per
+ * channel anyway.
+ * But we go through the motions here anyway.
+ */
+ switch (GetDeviceCaps(c->hDC, BITSPIXEL)) {
+ case 16:
+ red_bits = green_bits = blue_bits = 5;
+ alpha_bits = 0;
+ break;
+ default:
+ red_bits = green_bits = blue_bits = 8;
+ alpha_bits = 8;
+ break;
+ }
+ /* Create visual based on flags */
+ visual = _mesa_create_visual(db_flag, /* db_flag */
+ GL_FALSE, /* stereo */
+ red_bits, green_bits, blue_bits, /* color RGB */
+ alpha_flag ? alpha_bits : 0, /* color A */
+ DEFAULT_SOFTWARE_DEPTH_BITS, /* depth_bits */
+ 8, /* stencil_bits */
+ 16,16,16, /* accum RGB */
+ alpha_flag ? 16 : 0, /* accum A */
+ 1); /* num samples */
+
+ if (!visual) {
+ free(c);
+ return NULL;
+ }
+
+ /* Set up driver functions */
+ _mesa_init_driver_functions(&functions);
+ functions.GetString = wmesa_get_string;
+ functions.UpdateState = wmesa_update_state;
+ functions.GetBufferSize = wmesa_get_buffer_size;
+ functions.Flush = wmesa_flush;
+ functions.Clear = clear;
+ functions.ClearColor = clear_color;
+ functions.ResizeBuffers = wmesa_resize_buffers;
+ functions.Viewport = wmesa_viewport;
+
+ /* initialize the Mesa context data */
+ ctx = &c->gl_ctx;
+ _mesa_initialize_context(ctx, API_OPENGL, visual,
+ NULL, &functions, (void *)c);
+
+ /* visual no longer needed - it was copied by _mesa_initialize_context() */
+ _mesa_destroy_visual(visual);
+
+ _mesa_enable_sw_extensions(ctx);
+ _mesa_enable_1_3_extensions(ctx);
+ _mesa_enable_1_4_extensions(ctx);
+ _mesa_enable_1_5_extensions(ctx);
+ _mesa_enable_2_0_extensions(ctx);
+ _mesa_enable_2_1_extensions(ctx);
+
+ _mesa_meta_init(ctx);
+
+ /* Initialize the software rasterizer and helper modules. */
+ if (!_swrast_CreateContext(ctx) ||
+ !_vbo_CreateContext(ctx) ||
+ !_tnl_CreateContext(ctx) ||
+ !_swsetup_CreateContext(ctx)) {
+ _mesa_free_context_data(ctx);
+ free(c);
+ return NULL;
+ }
+ _swsetup_Wakeup(ctx);
+ TNL_CONTEXT(ctx)->Driver.RunPipeline = _tnl_run_pipeline;
+
+ return c;
+}
+
+
+void WMesaDestroyContext( WMesaContext pwc )
+{
+ struct gl_context *ctx = &pwc->gl_ctx;
+ WMesaFramebuffer pwfb;
+ GET_CURRENT_CONTEXT(cur_ctx);
+
+ if (cur_ctx == ctx) {
+ /* unbind current if deleting current context */
+ WMesaMakeCurrent(NULL, NULL);
+ }
+
+ /* clean up frame buffer resources */
+ pwfb = wmesa_lookup_framebuffer(pwc->hDC);
+ if (pwfb) {
+ if (ctx->Visual.doubleBufferMode == 1)
+ wmDeleteBackingStore(pwfb);
+ wmesa_free_framebuffer(pwc->hDC);
+ }
+
+ /* Release for device, not memory contexts */
+ if (WindowFromDC(pwc->hDC) != NULL)
+ {
+ ReleaseDC(WindowFromDC(pwc->hDC), pwc->hDC);
+ }
+ DeleteObject(pwc->clearPen);
+ DeleteObject(pwc->clearBrush);
+
+ _mesa_meta_free(ctx);
+
+ _swsetup_DestroyContext(ctx);
+ _tnl_DestroyContext(ctx);
+ _vbo_DestroyContext(ctx);
+ _swrast_DestroyContext(ctx);
+
+ _mesa_free_context_data(ctx);
+ free(pwc);
+}
+
+
+/**
+ * Create a new color renderbuffer.
+ */
+static struct gl_renderbuffer *
+wmesa_new_renderbuffer(void)
+{
+ struct gl_renderbuffer *rb = CALLOC_STRUCT(gl_renderbuffer);
+ if (!rb)
+ return NULL;
+
+ _mesa_init_renderbuffer(rb, (GLuint)0);
+
+ rb->_BaseFormat = GL_RGBA;
+ rb->InternalFormat = GL_RGBA;
+ rb->DataType = CHAN_TYPE;
+ rb->Delete = wmesa_delete_renderbuffer;
+ rb->AllocStorage = wmesa_renderbuffer_storage;
+ return rb;
+}
+
+
+void WMesaMakeCurrent(WMesaContext c, HDC hdc)
+{
+ WMesaFramebuffer pwfb;
+
+ {
+ /* return if already current */
+ GET_CURRENT_CONTEXT(ctx);
+ WMesaContext pwc = wmesa_context(ctx);
+ if (pwc && c == pwc && pwc->hDC == hdc)
+ return;
+ }
+
+ pwfb = wmesa_lookup_framebuffer(hdc);
+
+ /* Lazy creation of framebuffers */
+ if (c && !pwfb && hdc) {
+ struct gl_renderbuffer *rb;
+ struct gl_config *visual = &c->gl_ctx.Visual;
+ GLuint width, height;
+
+ get_window_size(hdc, &width, &height);
+
+ c->clearPen = CreatePen(PS_SOLID, 1, 0);
+ c->clearBrush = CreateSolidBrush(0);
+
+ pwfb = wmesa_new_framebuffer(hdc, visual);
+
+ /* Create back buffer if double buffered */
+ if (visual->doubleBufferMode == 1) {
+ wmCreateBackingStore(pwfb, width, height);
+ }
+
+ /* make render buffers */
+ if (visual->doubleBufferMode == 1) {
+ rb = wmesa_new_renderbuffer();
+ _mesa_add_renderbuffer(&pwfb->Base, BUFFER_BACK_LEFT, rb);
+ wmesa_set_renderbuffer_funcs(rb, pwfb->pixelformat, pwfb->cColorBits, 1);
+ }
+ rb = wmesa_new_renderbuffer();
+ _mesa_add_renderbuffer(&pwfb->Base, BUFFER_FRONT_LEFT, rb);
+ wmesa_set_renderbuffer_funcs(rb, pwfb->pixelformat, pwfb->cColorBits, 0);
+
+ /* Let Mesa own the Depth, Stencil, and Accum buffers */
+ _mesa_add_soft_renderbuffers(&pwfb->Base,
+ GL_FALSE, /* color */
+ visual->depthBits > 0,
+ visual->stencilBits > 0,
+ visual->accumRedBits > 0,
+ visual->alphaBits >0,
+ GL_FALSE);
+ }
+
+ if (c && pwfb)
+ _mesa_make_current(&c->gl_ctx, &pwfb->Base, &pwfb->Base);
+ else
+ _mesa_make_current(NULL, NULL, NULL);
+}
+
+
+void WMesaSwapBuffers( HDC hdc )
+{
+ GET_CURRENT_CONTEXT(ctx);
+ WMesaContext pwc = wmesa_context(ctx);
+ WMesaFramebuffer pwfb = wmesa_lookup_framebuffer(hdc);
+
+ if (!pwfb) {
+ _mesa_problem(NULL, "wmesa: swapbuffers on unknown hdc");
+ return;
+ }
+
+ /* If we're swapping the buffer associated with the current context
+ * we have to flush any pending rendering commands first.
+ */
+ if (pwc->hDC == hdc) {
+ _mesa_notifySwapBuffers(ctx);
+
+ BitBlt(pwfb->hDC, 0, 0, pwfb->Base.Width, pwfb->Base.Height,
+ pwfb->dib_hDC, 0, 0, SRCCOPY);
+ }
+ else {
+ /* XXX for now only allow swapping current window */
+ _mesa_problem(NULL, "wmesa: can't swap non-current window");
+ }
+}
+
+void WMesaShareLists(WMesaContext ctx_to_share, WMesaContext ctx)
+{
+ _mesa_share_state(&ctx->gl_ctx, &ctx_to_share->gl_ctx);
+}
+
diff --git a/mesalib/src/mesa/drivers/windows/gdi/wmesadef.h b/mesalib/src/mesa/drivers/windows/gdi/wmesadef.h
index 9fda88390..344f9488b 100644
--- a/mesalib/src/mesa/drivers/windows/gdi/wmesadef.h
+++ b/mesalib/src/mesa/drivers/windows/gdi/wmesadef.h
@@ -1,43 +1,43 @@
-#ifndef WMESADEF_H
-#define WMESADEF_H
-
-#include <windows.h>
-
-#include "main/context.h"
-
-
-/**
- * The Windows Mesa rendering context, derived from struct gl_context.
- */
-struct wmesa_context {
- struct gl_context gl_ctx; /* The core GL/Mesa context */
- HDC hDC;
- COLORREF clearColorRef;
- HPEN clearPen;
- HBRUSH clearBrush;
-};
-
-
-/**
- * Windows framebuffer, derived from gl_framebuffer
- */
-struct wmesa_framebuffer
-{
- struct gl_framebuffer Base;
- HDC hDC;
- int pixelformat;
- GLuint ScanWidth;
- int cColorBits;
- /* back buffer DIB fields */
- HDC dib_hDC;
- BITMAPINFO bmi;
- HBITMAP hbmDIB;
- HBITMAP hOldBitmap;
- PBYTE pbPixels;
- struct wmesa_framebuffer *next;
-};
-
-typedef struct wmesa_framebuffer *WMesaFramebuffer;
-
-
-#endif /* WMESADEF_H */
+#ifndef WMESADEF_H
+#define WMESADEF_H
+
+#include <windows.h>
+
+#include "main/context.h"
+
+
+/**
+ * The Windows Mesa rendering context, derived from struct gl_context.
+ */
+struct wmesa_context {
+ struct gl_context gl_ctx; /* The core GL/Mesa context */
+ HDC hDC;
+ COLORREF clearColorRef;
+ HPEN clearPen;
+ HBRUSH clearBrush;
+};
+
+
+/**
+ * Windows framebuffer, derived from gl_framebuffer
+ */
+struct wmesa_framebuffer
+{
+ struct gl_framebuffer Base;
+ HDC hDC;
+ int pixelformat;
+ GLuint ScanWidth;
+ int cColorBits;
+ /* back buffer DIB fields */
+ HDC dib_hDC;
+ BITMAPINFO bmi;
+ HBITMAP hbmDIB;
+ HBITMAP hOldBitmap;
+ PBYTE pbPixels;
+ struct wmesa_framebuffer *next;
+};
+
+typedef struct wmesa_framebuffer *WMesaFramebuffer;
+
+
+#endif /* WMESADEF_H */
diff --git a/mesalib/src/mesa/drivers/windows/gldirect/dglcontext.c b/mesalib/src/mesa/drivers/windows/gldirect/dglcontext.c
index 9aedd2e3c..bc4839cfe 100644
--- a/mesalib/src/mesa/drivers/windows/gldirect/dglcontext.c
+++ b/mesalib/src/mesa/drivers/windows/gldirect/dglcontext.c
@@ -1,2212 +1,2212 @@
-/****************************************************************************
-*
-* Mesa 3-D graphics library
-* Direct3D Driver Interface
-*
-* ========================================================================
-*
-* Copyright (C) 1991-2004 SciTech Software, Inc. All rights reserved.
-*
-* Permission is hereby granted, free of charge, to any person obtaining a
-* copy of this software and associated documentation files (the "Software"),
-* to deal in the Software without restriction, including without limitation
-* the rights to use, copy, modify, merge, publish, distribute, sublicense,
-* and/or sell copies of the Software, and to permit persons to whom the
-* Software is furnished to do so, subject to the following conditions:
-*
-* The above copyright notice and this permission notice shall be included
-* in all copies or substantial portions of the Software.
-*
-* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
-* SCITECH SOFTWARE INC BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
-* OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-* SOFTWARE.
-*
-* ======================================================================
-*
-* Language: ANSI C
-* Environment: Windows 9x (Win32)
-*
-* Description: Context handling.
-*
-****************************************************************************/
-
-#include "dglcontext.h"
-
-// Get compile errors without this. KeithH
-//#include "scitech.h" // ibool, etc.
-
-#ifdef _USE_GLD3_WGL
-#include "gld_driver.h"
-
-extern void _gld_mesa_warning(struct gl_context *, char *);
-extern void _gld_mesa_fatal(struct gl_context *, char *);
-#endif // _USE_GLD3_WGL
-
-// TODO: Clean out old DX6-specific code from GLD 2.x CAD driver
-// if it is no longer being built as part of GLDirect. (DaveM)
-
-// ***********************************************************************
-
-#define GLDERR_NONE 0
-#define GLDERR_MEM 1
-#define GLDERR_DDRAW 2
-#define GLDERR_D3D 3
-#define GLDERR_BPP 4
-
-char szResourceWarning[] =
-"GLDirect does not have enough video memory resources\n"
-"to support the requested OpenGL rendering context.\n\n"
-"You may have to reduce the current display resolution\n"
-"to obtain satisfactory OpenGL performance.\n";
-
-char szDDrawWarning[] =
-"GLDirect is unable to initialize DirectDraw for the\n"
-"requested OpenGL rendering context.\n\n"
-"You will have to check the DirectX control panel\n"
-"for further information.\n";
-
-char szD3DWarning[] =
-"GLDirect is unable to initialize Direct3D for the\n"
-"requested OpenGL rendering context.\n\n"
-"You may have to change the display mode resolution\n"
-"color depth or check the DirectX control panel for\n"
-"further information.\n";
-
-char szBPPWarning[] =
-"GLDirect is unable to use the selected color depth for\n"
-"the requested OpenGL rendering context.\n\n"
-"You will have to change the display mode resolution\n"
-"color depth with the Display Settings control panel.\n";
-
-int nContextError = GLDERR_NONE;
-
-// ***********************************************************************
-
-#define VENDORID_ATI 0x1002
-
-static DWORD devATIRagePro[] = {
- 0x4742, // 3D RAGE PRO BGA AGP 1X/2X
- 0x4744, // 3D RAGE PRO BGA AGP 1X only
- 0x4749, // 3D RAGE PRO BGA PCI 33 MHz
- 0x4750, // 3D RAGE PRO PQFP PCI 33 MHz
- 0x4751, // 3D RAGE PRO PQFP PCI 33 MHz limited 3D
- 0x4C42, // 3D RAGE LT PRO BGA-312 AGP 133 MHz
- 0x4C44, // 3D RAGE LT PRO BGA-312 AGP 66 MHz
- 0x4C49, // 3D RAGE LT PRO BGA-312 PCI 33 MHz
- 0x4C50, // 3D RAGE LT PRO BGA-256 PCI 33 MHz
- 0x4C51, // 3D RAGE LT PRO BGA-256 PCI 33 MHz limited 3D
-};
-
-static DWORD devATIRageIIplus[] = {
- 0x4755, // 3D RAGE II+
- 0x4756, // 3D RAGE IIC PQFP PCI
- 0x4757, // 3D RAGE IIC BGA AGP
- 0x475A, // 3D RAGE IIC PQFP AGP
- 0x4C47, // 3D RAGE LT-G
-};
-
-// ***********************************************************************
-
-#ifndef _USE_GLD3_WGL
-extern DGL_mesaFuncs mesaFuncs;
-#endif
-
-extern DWORD dwLogging;
-
-#ifdef GLD_THREADS
-#pragma message("compiling DGLCONTEXT.C vars for multi-threaded support")
-CRITICAL_SECTION CriticalSection; // for serialized access
-DWORD dwTLSCurrentContext = 0xFFFFFFFF; // TLS index for current context
-DWORD dwTLSPixelFormat = 0xFFFFFFFF; // TLS index for current pixel format
-#endif
-HGLRC iCurrentContext = 0; // Index of current context (static)
-BOOL bContextReady = FALSE; // Context state ready ?
-
-DGL_ctx ctxlist[DGL_MAX_CONTEXTS]; // Context list
-
-// ***********************************************************************
-
-static BOOL bHaveWin95 = FALSE;
-static BOOL bHaveWinNT = FALSE;
-static BOOL bHaveWin2K = FALSE;
-
-/****************************************************************************
-REMARKS:
-Detect the installed OS type.
-****************************************************************************/
-static void DetectOS(void)
-{
- OSVERSIONINFO VersionInformation;
- LPOSVERSIONINFO lpVersionInformation = &VersionInformation;
-
- VersionInformation.dwOSVersionInfoSize = sizeof(VersionInformation);
-
- GetVersionEx(lpVersionInformation);
-
- switch (VersionInformation.dwPlatformId) {
- case VER_PLATFORM_WIN32_WINDOWS:
- bHaveWin95 = TRUE;
- bHaveWinNT = FALSE;
- bHaveWin2K = FALSE;
- break;
- case VER_PLATFORM_WIN32_NT:
- bHaveWin95 = FALSE;
- if (VersionInformation.dwMajorVersion <= 4) {
- bHaveWinNT = TRUE;
- bHaveWin2K = FALSE;
- }
- else {
- bHaveWinNT = FALSE;
- bHaveWin2K = TRUE;
- }
- break;
- case VER_PLATFORM_WIN32s:
- bHaveWin95 = FALSE;
- bHaveWinNT = FALSE;
- bHaveWin2K = FALSE;
- break;
- }
-}
-
-// ***********************************************************************
-
-HWND hWndEvent = NULL; // event monitor window
-HWND hWndLastActive = NULL; // last active client window
-LONG __stdcall GLD_EventWndProc(HWND hwnd,UINT msg,WPARAM wParam,LPARAM lParam);
-
-// ***********************************************************************
-
-// Checks if the HGLRC is valid in range of context list.
-BOOL dglIsValidContext(
- HGLRC a)
-{
- return ((int)a > 0 && (int)a <= DGL_MAX_CONTEXTS);
-}
-
-// ***********************************************************************
-
-// Convert a HGLRC to a pointer into the context list.
-DGL_ctx* dglGetContextAddress(
- const HGLRC a)
-{
- if (dglIsValidContext(a))
- return &ctxlist[(int)a-1];
- return NULL;
-}
-
-// ***********************************************************************
-
-// Return the current HGLRC (however it may be stored for multi-threading).
-HGLRC dglGetCurrentContext(void)
-{
-#ifdef GLD_THREADS
- HGLRC hGLRC;
- // load from thread-specific instance
- if (glb.bMultiThreaded) {
- // protect against calls from arbitrary threads
- __try {
- hGLRC = (HGLRC)TlsGetValue(dwTLSCurrentContext);
- }
- __except(EXCEPTION_EXECUTE_HANDLER) {
- hGLRC = iCurrentContext;
- }
- }
- // load from global static var
- else {
- hGLRC = iCurrentContext;
- }
- return hGLRC;
-#else
- return iCurrentContext;
-#endif
-}
-
-// ***********************************************************************
-
-// Set the current HGLRC (however it may be stored for multi-threading).
-void dglSetCurrentContext(HGLRC hGLRC)
-{
-#ifdef GLD_THREADS
- // store in thread-specific instance
- if (glb.bMultiThreaded) {
- // protect against calls from arbitrary threads
- __try {
- TlsSetValue(dwTLSCurrentContext, (LPVOID)hGLRC);
- }
- __except(EXCEPTION_EXECUTE_HANDLER) {
- iCurrentContext = hGLRC;
- }
- }
- // store in global static var
- else {
- iCurrentContext = hGLRC;
- }
-#else
- iCurrentContext = hGLRC;
-#endif
-}
-
-// ***********************************************************************
-
-// Return the current HDC only for a currently active HGLRC.
-HDC dglGetCurrentDC(void)
-{
- HGLRC hGLRC;
- DGL_ctx* lpCtx;
-
- hGLRC = dglGetCurrentContext();
- if (hGLRC) {
- lpCtx = dglGetContextAddress(hGLRC);
- return lpCtx->hDC;
- }
- return 0;
-}
-
-// ***********************************************************************
-
-void dglInitContextState()
-{
- int i;
- WNDCLASS wc;
-
-#ifdef GLD_THREADS
- // Allocate thread local storage indexes for current context and pixel format
- dwTLSCurrentContext = TlsAlloc();
- dwTLSPixelFormat = TlsAlloc();
-#endif
-
- dglSetCurrentContext(NULL); // No current rendering context
-
- // Clear all context data
- ZeroMemory(ctxlist, sizeof(ctxlist[0]) * DGL_MAX_CONTEXTS);
-
- for (i=0; i<DGL_MAX_CONTEXTS; i++)
- ctxlist[i].bAllocated = FALSE; // Flag context as unused
-
- // This section of code crashes the dll in circumstances where the app
- // creates and destroys contexts.
-/*
- // Register the class for our event monitor window
- wc.style = 0;
- wc.lpfnWndProc = GLD_EventWndProc;
- wc.cbClsExtra = 0;
- wc.cbWndExtra = 0;
- wc.hInstance = GetModuleHandle(NULL);
- wc.hIcon = LoadIcon(GetModuleHandle(NULL), IDI_APPLICATION);
- wc.hCursor = LoadCursor(NULL, IDC_ARROW);
- wc.hbrBackground = (HBRUSH)GetStockObject(BLACK_BRUSH);
- wc.lpszMenuName = NULL;
- wc.lpszClassName = "GLDIRECT";
- RegisterClass(&wc);
-
- // Create the non-visible window to monitor all broadcast messages
- hWndEvent = CreateWindowEx(
- WS_EX_TOOLWINDOW,"GLDIRECT","GLDIRECT",WS_POPUP,
- 0,0,0,0,
- NULL,NULL,GetModuleHandle(NULL),NULL);
-*/
-
-#ifdef GLD_THREADS
- // Create a critical section object for serializing access to
- // DirectDraw and DDStereo create/destroy functions in multiple threads
- if (glb.bMultiThreaded)
- InitializeCriticalSection(&CriticalSection);
-#endif
-
- // Context state is now initialized and ready
- bContextReady = TRUE;
-}
-
-// ***********************************************************************
-
-void dglDeleteContextState()
-{
- int i;
- static BOOL bOnceIsEnough = FALSE;
-
- // Only call once, from either DGL_exitDriver(), or DLL_PROCESS_DETACH
- if (bOnceIsEnough)
- return;
- bOnceIsEnough = TRUE;
-
- for (i=0; i<DGL_MAX_CONTEXTS; i++) {
- if (ctxlist[i].bAllocated == TRUE) {
- ddlogPrintf(DDLOG_WARN, "** Context %i not deleted - cleaning up.", (i+1));
- dglDeleteContext((HGLRC)(i+1));
- }
- }
-
- // Context state is no longer ready
- bContextReady = FALSE;
-
- // If executed when DLL unloads, DDraw objects may be invalid.
- // So catch any page faults with this exception handler.
-__try {
-
- // Release final DirectDraw interfaces
- if (glb.bDirectDrawPersistant) {
-// RELEASE(glb.lpGlobalPalette);
-// RELEASE(glb.lpDepth4);
-// RELEASE(glb.lpBack4);
-// RELEASE(glb.lpPrimary4);
-// RELEASE(glb.lpDD4);
- }
-}
-__except(EXCEPTION_EXECUTE_HANDLER) {
- ddlogPrintf(DDLOG_WARN, "Exception raised in dglDeleteContextState.");
-}
-
- // Destroy our event monitor window
- if (hWndEvent) {
- DestroyWindow(hWndEvent);
- hWndEvent = hWndLastActive = NULL;
- }
-
-#ifdef GLD_THREADS
- // Destroy the critical section object
- if (glb.bMultiThreaded)
- DeleteCriticalSection(&CriticalSection);
-
- // Release thread local storage indexes for current HGLRC and pixel format
- TlsFree(dwTLSPixelFormat);
- TlsFree(dwTLSCurrentContext);
-#endif
-}
-
-// ***********************************************************************
-
-// Application Window message handler interception
-static LONG __stdcall dglWndProc(
- HWND hwnd,
- UINT msg,
- WPARAM wParam,
- LPARAM lParam)
-{
- DGL_ctx* lpCtx = NULL;
- LONG lpfnWndProc = 0L;
- int i;
- HGLRC hGLRC;
- RECT rect;
- PAINTSTRUCT ps;
- BOOL bQuit = FALSE;
- BOOL bMain = FALSE;
- LONG rc;
-
- // Get the window's message handler *before* it is unhooked in WM_DESTROY
-
- // Is this the main window?
- if (hwnd == glb.hWndActive) {
- bMain = TRUE;
- lpfnWndProc = glb.lpfnWndProc;
- }
- // Search for DGL context matching window handle
- for (i=0; i<DGL_MAX_CONTEXTS; i++) {
- if (ctxlist[i].hWnd == hwnd) {
- lpCtx = &ctxlist[i];
- lpfnWndProc = lpCtx->lpfnWndProc;
- break;
- }
- }
- // Not one of ours...
- if (!lpfnWndProc)
- return DefWindowProc(hwnd, msg, wParam, lParam);
-
- // Intercept messages amd process *before* passing on to window
- switch (msg) {
-#ifdef _USE_GLD3_WGL
- case WM_DISPLAYCHANGE:
- glb.bPixelformatsDirty = TRUE;
- break;
-#endif
- case WM_ACTIVATEAPP:
- glb.bAppActive = (BOOL)wParam;
- ddlogPrintf(DDLOG_INFO, "Calling app has been %s", glb.bAppActive ? "activated" : "de-activated");
- break;
- case WM_ERASEBKGND:
- // Eat the GDI erase event for the GL window
- if (!lpCtx || !lpCtx->bHasBeenCurrent)
- break;
- lpCtx->bGDIEraseBkgnd = TRUE;
- return TRUE;
- case WM_PAINT:
- // Eat the invalidated update region if render scene is in progress
- if (!lpCtx || !lpCtx->bHasBeenCurrent)
- break;
- if (lpCtx->bFrameStarted) {
- if (GetUpdateRect(hwnd, &rect, FALSE)) {
- BeginPaint(hwnd, &ps);
- EndPaint(hwnd, &ps);
- ValidateRect(hwnd, &rect);
- return TRUE;
- }
- }
- break;
- }
- // Call the appropriate window message handler
- rc = CallWindowProc((WNDPROC)lpfnWndProc, hwnd, msg, wParam, lParam);
-
- // Intercept messages and process *after* passing on to window
- switch (msg) {
- case WM_QUIT:
- case WM_DESTROY:
- bQuit = TRUE;
- if (lpCtx && lpCtx->bAllocated) {
- ddlogPrintf(DDLOG_WARN, "WM_DESTROY detected for HWND=%X, HDC=%X, HGLRC=%d", hwnd, lpCtx->hDC, i+1);
- dglDeleteContext((HGLRC)(i+1));
- }
- break;
-#if 0
- case WM_SIZE:
- // Resize surfaces to fit window but not viewport (in case app did not bother)
- if (!lpCtx || !lpCtx->bHasBeenCurrent)
- break;
- w = LOWORD(lParam);
- h = HIWORD(lParam);
- if (lpCtx->dwWidth < w || lpCtx->dwHeight < h) {
- if (!dglWglResizeBuffers(lpCtx->glCtx, TRUE))
- dglWglResizeBuffers(lpCtx->glCtx, FALSE);
- }
- break;
-#endif
- }
-
- // If the main window is quitting, then so should we...
- if (bMain && bQuit) {
- ddlogPrintf(DDLOG_SYSTEM, "shutting down after WM_DESTROY detected for main HWND=%X", hwnd);
- dglDeleteContextState();
- dglExitDriver();
- }
-
- return rc;
-}
-
-// ***********************************************************************
-
-// Driver Window message handler
-static LONG __stdcall GLD_EventWndProc(
- HWND hwnd,
- UINT msg,
- WPARAM wParam,
- LPARAM lParam)
-{
- switch (msg) {
- // May be sent by splash screen dialog on exit
- case WM_ACTIVATE:
- if (LOWORD(wParam) == WA_ACTIVE && glb.hWndActive) {
- SetForegroundWindow(glb.hWndActive);
- return 0;
- }
- break;
- }
- return DefWindowProc(hwnd, msg, wParam, lParam);
-}
-
-// ***********************************************************************
-
-// Intercepted Keyboard handler for detecting hot keys.
-LRESULT CALLBACK dglKeyProc(
- int code,
- WPARAM wParam,
- LPARAM lParam)
-{
- HWND hWnd, hWndFrame;
- HGLRC hGLRC = NULL;
- DGL_ctx* lpCtx = NULL;
- int cmd = 0, dx1 = 0, dx2 = 0, i;
- static BOOL bAltPressed = FALSE;
- static BOOL bCtrlPressed = FALSE;
- static BOOL bShiftPressed = FALSE;
- RECT r, rf, rc;
- POINT pt;
- BOOL bForceReshape = FALSE;
-
- return CallNextHookEx(hKeyHook, code, wParam, lParam);
-}
-
-// ***********************************************************************
-
-HWND hWndMatch;
-
-// Window handle enumeration procedure.
-BOOL CALLBACK dglEnumChildProc(
- HWND hWnd,
- LPARAM lParam)
-{
- RECT rect;
-
- // Find window handle with matching client rect.
- GetClientRect(hWnd, &rect);
- if (EqualRect(&rect, (RECT*)lParam)) {
- hWndMatch = hWnd;
- return FALSE;
- }
- // Continue with next child window.
- return TRUE;
-}
-
-// ***********************************************************************
-
-// Find window handle with matching client rect.
-HWND dglFindWindowRect(
- RECT* pRect)
-{
- hWndMatch = NULL;
- EnumChildWindows(GetForegroundWindow(), dglEnumChildProc, (LPARAM)pRect);
- return hWndMatch;
-}
-
-// ***********************************************************************
-#ifndef _USE_GLD3_WGL
-void dglChooseDisplayMode(
- DGL_ctx *lpCtx)
-{
- // Note: Choose an exact match if possible.
-
- int i;
- DWORD area;
- DWORD bestarea;
- DDSURFACEDESC2 *lpDDSD = NULL; // Mode list pointer
- DDSURFACEDESC2 *lpBestDDSD = NULL; // Pointer to best
-
- lpDDSD = glb.lpDisplayModes;
- for (i=0; i<glb.nDisplayModeCount; i++, lpDDSD++) {
- if ((lpDDSD->dwWidth == lpCtx->dwWidth) &&
- (lpDDSD->dwHeight == lpCtx->dwHeight))
- goto matched; // Mode has been exactly matched
- // Choose modes that are larger in both dimensions than
- // the window, but smaller in area than the current best.
- if ( (lpDDSD->dwWidth >= lpCtx->dwWidth) &&
- (lpDDSD->dwHeight >= lpCtx->dwHeight))
- {
- if (lpBestDDSD == NULL) {
- lpBestDDSD = lpDDSD;
- bestarea = lpDDSD->dwWidth * lpDDSD->dwHeight;
- continue;
- }
- area = lpDDSD->dwWidth * lpDDSD->dwHeight;
- if (area < bestarea) {
- lpBestDDSD = lpDDSD;
- bestarea = area;
- }
- }
- }
-
- // Safety check
- if (lpBestDDSD == NULL) {
- ddlogMessage(DDLOG_CRITICAL, "dglChooseDisplayMode");
- return;
- }
-
- lpCtx->dwModeWidth = lpBestDDSD->dwWidth;
- lpCtx->dwModeHeight = lpBestDDSD->dwHeight;
-matched:
- ddlogPrintf(DDLOG_INFO, "Matched (%ldx%ld) to (%ldx%ld)",
- lpCtx->dwWidth, lpCtx->dwHeight, lpCtx->dwModeWidth, lpCtx->dwModeHeight);
-}
-#endif // _USE_GLD3_WGL
-// ***********************************************************************
-
-static BOOL IsDevice(
- DWORD *lpDeviceIdList,
- DWORD dwDeviceId,
- int count)
-{
- int i;
-
- for (i=0; i<count; i++)
- if (dwDeviceId == lpDeviceIdList[i])
- return TRUE;
-
- return FALSE;
-}
-
-// ***********************************************************************
-
-void dglTestForBrokenCards(
- DGL_ctx *lpCtx)
-{
-#ifndef _GLD3
- DDDEVICEIDENTIFIER dddi; // DX6 device identifier
-
- // Sanity check.
- if (lpCtx == NULL) {
- // Testing for broken cards is sensitive area, so we don't want
- // anything saying "broken cards" in the error message. ;)
- ddlogMessage(DDLOG_ERROR, "Null context passed to TFBC\n");
- return;
- }
-
- if (lpCtx->lpDD4 == NULL) {
- // Testing for broken cards is sensitive area, so we don't want
- // anything saying "broken cards" in the error message. ;)
- ddlogMessage(DDLOG_ERROR, "Null DD4 passed to TFBC\n");
- return;
- }
-
- // Microsoft really fucked up with the GetDeviceIdentifier function
- // on Windows 2000, since it locks up on stock driers on the CD. Updated
- // drivers from vendors appear to work, but we can't identify the drivers
- // without this function!!! For now we skip these tests on Windows 2000.
- if ((GetVersion() & 0x80000000UL) == 0)
- return;
-
- // Obtain device info
- if (FAILED(IDirectDraw4_GetDeviceIdentifier(lpCtx->lpDD4, &dddi, 0)))
- return;
-
- // Useful info. Log it.
- ddlogPrintf(DDLOG_INFO, "DirectDraw: VendorId=0x%x, DeviceId=0x%x", dddi.dwVendorId, dddi.dwDeviceId);
-
- // Vendor 1: ATI
- if (dddi.dwVendorId == VENDORID_ATI) {
- // Test A: ATI Rage PRO
- if (IsDevice(devATIRagePro, dddi.dwDeviceId, sizeof(devATIRagePro)))
- glb.bUseMipmaps = FALSE;
- // Test B: ATI Rage II+
- if (IsDevice(devATIRageIIplus, dddi.dwDeviceId, sizeof(devATIRageIIplus)))
- glb.bEmulateAlphaTest = TRUE;
- }
-
- // Vendor 2: Matrox
- if (dddi.dwVendorId == 0x102B) {
- // Test: Matrox G400 stencil buffer support does not work for AutoCAD
- if (dddi.dwDeviceId == 0x0525) {
- lpCtx->lpPF->pfd.cStencilBits = 0;
- if (lpCtx->lpPF->iZBufferPF != -1) {
- glb.lpZBufferPF[lpCtx->lpPF->iZBufferPF].dwStencilBitDepth = 0;
- glb.lpZBufferPF[lpCtx->lpPF->iZBufferPF].dwStencilBitMask = 0;
- glb.lpZBufferPF[lpCtx->lpPF->iZBufferPF].dwFlags &= ~DDPF_STENCILBUFFER;
- }
- }
- }
-#endif // _GLD3
-}
-
-// ***********************************************************************
-
-BOOL dglCreateContextBuffers(
- HDC a,
- DGL_ctx *lpCtx,
- BOOL bFallback)
-{
- HRESULT hResult;
-
- int i;
-// HGLRC hGLRC;
-// DGL_ctx* lpCtx;
-
-#ifndef _USE_GLD3_WGL
- DWORD dwFlags;
- DDSURFACEDESC2 ddsd2;
- DDSCAPS2 ddscaps2;
- LPDIRECTDRAWCLIPPER lpddClipper;
- D3DDEVICEDESC D3DHWDevDesc; // Direct3D Hardware description
- D3DDEVICEDESC D3DHELDevDesc; // Direct3D Hardware Emulation Layer
-#endif // _USE_GLD3_WGL
-
- float inv_aspect;
-
- GLenum bDoubleBuffer; // TRUE if double buffer required
- GLenum bDepthBuffer; // TRUE if depth buffer required
-
- const PIXELFORMATDESCRIPTOR *lpPFD = &lpCtx->lpPF->pfd;
-
- // Vars for Mesa visual
- DWORD dwDepthBits = 0;
- DWORD dwStencilBits = 0;
- DWORD dwAlphaBits = 0;
- DWORD bAlphaSW = GL_FALSE;
- DWORD bDouble = GL_FALSE;
-
- DDSURFACEDESC2 ddsd2DisplayMode;
- BOOL bFullScrnWin = FALSE; // fullscreen-size window ?
- DDBLTFX ddbltfx;
- DWORD dwMemoryType = (bFallback) ? DDSCAPS_SYSTEMMEMORY : glb.dwMemoryType;
- BOOL bBogusWindow = FALSE; // non-drawable window ?
- DWORD dwColorRef = 0; // GDI background color
- RECT rcDst; // GDI window rect
- POINT pt; // GDI window point
-
- // Palette used for creating default global palette
- PALETTEENTRY ppe[256];
-
-#ifndef _USE_GLD3_WGL
- // Vertex buffer description. Used for creation of vertex buffers
- D3DVERTEXBUFFERDESC vbufdesc;
-#endif // _USE_GLD3_WGL
-
-#define DDLOG_CRITICAL_OR_WARN (bFallback ? DDLOG_CRITICAL : DDLOG_WARN)
-
- ddlogPrintf(DDLOG_SYSTEM, "dglCreateContextBuffers for HDC=%X", a);
- nContextError = GLDERR_NONE;
-
-#ifdef GLD_THREADS
- // Serialize access to DirectDraw object creation or DDS start
- if (glb.bMultiThreaded)
- EnterCriticalSection(&CriticalSection);
-#endif
-
- // Check for back buffer
- bDoubleBuffer = GL_TRUE; //(lpPFD->dwFlags & PFD_DOUBLEBUFFER) ? GL_TRUE : GL_FALSE;
- // Since we always do back buffering, check if we emulate front buffering
- lpCtx->EmulateSingle =
- (lpPFD->dwFlags & PFD_DOUBLEBUFFER) ? FALSE : TRUE;
-#if 0 // Don't have to mimic MS OpenGL behavior for front-buffering (DaveM)
- lpCtx->EmulateSingle |=
- (lpPFD->dwFlags & PFD_SUPPORT_GDI) ? TRUE : FALSE;
-#endif
-
- // Check for depth buffer
- bDepthBuffer = (lpPFD->cDepthBits) ? GL_TRUE : GL_FALSE;
-
- lpCtx->bDoubleBuffer = bDoubleBuffer;
- lpCtx->bDepthBuffer = bDepthBuffer;
-
- // Set the Fullscreen flag for the context.
-// lpCtx->bFullscreen = glb.bFullscreen;
-
- // Obtain the dimensions of the rendering window
- lpCtx->hDC = a; // Cache DC
- lpCtx->hWnd = WindowFromDC(lpCtx->hDC);
- // Check for non-window DC = memory DC ?
- if (lpCtx->hWnd == NULL) {
- // bitmap memory contexts are always single-buffered
- lpCtx->EmulateSingle = TRUE;
- bBogusWindow = TRUE;
- ddlogPrintf(DDLOG_INFO, "Non-Window Memory Device Context");
- if (GetClipBox(lpCtx->hDC, &lpCtx->rcScreenRect) == ERROR) {
- ddlogMessage(DDLOG_WARN, "GetClipBox failed in dglCreateContext\n");
- SetRect(&lpCtx->rcScreenRect, 0, 0, 0, 0);
- }
- }
- else if (!GetClientRect(lpCtx->hWnd, &lpCtx->rcScreenRect)) {
- bBogusWindow = TRUE;
- ddlogMessage(DDLOG_WARN, "GetClientRect failed in dglCreateContext\n");
- SetRect(&lpCtx->rcScreenRect, 0, 0, 0, 0);
- }
- lpCtx->dwWidth = lpCtx->rcScreenRect.right - lpCtx->rcScreenRect.left;
- lpCtx->dwHeight = lpCtx->rcScreenRect.bottom - lpCtx->rcScreenRect.top;
-
- ddlogPrintf(DDLOG_INFO, "Input window %X: w=%i, h=%i",
- lpCtx->hWnd, lpCtx->dwWidth, lpCtx->dwHeight);
-
- // What if app only zeroes one dimension instead of both? (DaveM)
- if ( (lpCtx->dwWidth == 0) || (lpCtx->dwHeight == 0) ) {
- // Make the buffer size something sensible
- lpCtx->dwWidth = 8;
- lpCtx->dwHeight = 8;
- }
-
- // Set defaults
- lpCtx->dwModeWidth = lpCtx->dwWidth;
- lpCtx->dwModeHeight = lpCtx->dwHeight;
-/*
- // Find best display mode for fullscreen
- if (glb.bFullscreen || !glb.bPrimary) {
- dglChooseDisplayMode(lpCtx);
- }
-*/
- // Misc initialisation
- lpCtx->bCanRender = FALSE; // No rendering allowed yet
- lpCtx->bSceneStarted = FALSE;
- lpCtx->bFrameStarted = FALSE;
-
- // Detect OS (specifically 'Windows 2000' or 'Windows XP')
- DetectOS();
-
- // NOTE: WinNT not supported
- ddlogPrintf(DDLOG_INFO, "OS: %s", bHaveWin95 ? "Win9x" : (bHaveWin2K ? "Win2000/XP" : "Unsupported") );
-
- // Test for Fullscreen
- if (bHaveWin95) { // Problems with fullscreen on Win2K/XP
- if ((GetSystemMetrics(SM_CXSCREEN) == lpCtx->dwWidth) &&
- (GetSystemMetrics(SM_CYSCREEN) == lpCtx->dwHeight))
- {
- // Workaround for some apps that crash when going fullscreen.
- //lpCtx->bFullscreen = TRUE;
- }
-
- }
-
-#ifdef _USE_GLD3_WGL
- _gldDriver.CreateDrawable(lpCtx, glb.bDirectDrawPersistant, glb.bPersistantBuffers);
-#else
- // Check if DirectDraw has already been created by original GLRC (DaveM)
- if (glb.bDirectDrawPersistant && glb.bDirectDraw) {
- lpCtx->lpDD4 = glb.lpDD4;
- IDirectDraw4_AddRef(lpCtx->lpDD4);
- goto SkipDirectDrawCreate;
- }
-
- // Create DirectDraw object
- if (glb.bPrimary)
- hResult = DirectDrawCreate(NULL, &lpCtx->lpDD1, NULL);
- else {
- // A non-primary device is to be used.
- // Force context to be Fullscreen, secondary adaptors can not
- // be used in a window.
- hResult = DirectDrawCreate(&glb.ddGuid, &lpCtx->lpDD1, NULL);
- lpCtx->bFullscreen = TRUE;
- }
- if (FAILED(hResult)) {
- MessageBox(NULL, "Unable to initialize DirectDraw", "GLDirect", MB_OK);
- ddlogError(DDLOG_CRITICAL_OR_WARN, "Unable to create DirectDraw interface", hResult);
- nContextError = GLDERR_DDRAW;
- goto return_with_error;
- }
-
- // Query for DX6 IDirectDraw4.
- hResult = IDirectDraw_QueryInterface(lpCtx->lpDD1,
- &IID_IDirectDraw4,
- (void**)&lpCtx->lpDD4);
- if (FAILED(hResult)) {
- MessageBox(NULL, "GLDirect requires DirectX 6.0 or above", "GLDirect", MB_OK);
- ddlogError(DDLOG_CRITICAL_OR_WARN, "Unable to create DirectDraw4 interface", hResult);
- nContextError = GLDERR_DDRAW;
- goto return_with_error;
- }
-
- // Cache DirectDraw interface for subsequent GLRCs
- if (glb.bDirectDrawPersistant && !glb.bDirectDraw) {
- glb.lpDD4 = lpCtx->lpDD4;
- IDirectDraw4_AddRef(glb.lpDD4);
- glb.bDirectDraw = TRUE;
- }
-SkipDirectDrawCreate:
-
- // Now we have a DD4 interface we can check for broken cards
- dglTestForBrokenCards(lpCtx);
-
- // Test if primary device can use flipping instead of blitting
- ZeroMemory(&ddsd2DisplayMode, sizeof(ddsd2DisplayMode));
- ddsd2DisplayMode.dwSize = sizeof(ddsd2DisplayMode);
- hResult = IDirectDraw4_GetDisplayMode(
- lpCtx->lpDD4,
- &ddsd2DisplayMode);
- if (SUCCEEDED(hResult)) {
- if ( (lpCtx->dwWidth == ddsd2DisplayMode.dwWidth) &&
- (lpCtx->dwHeight == ddsd2DisplayMode.dwHeight) ) {
- // We have a fullscreen-size window
- bFullScrnWin = TRUE;
- // OK to use DirectDraw fullscreen mode ?
- if (glb.bPrimary && !glb.bFullscreenBlit && !lpCtx->EmulateSingle && !glb.bDirectDrawPersistant) {
- lpCtx->bFullscreen = TRUE;
- ddlogMessage(DDLOG_INFO, "Primary upgraded to page flipping.\n");
- }
- }
- // Cache the display mode dimensions
- lpCtx->dwModeWidth = ddsd2DisplayMode.dwWidth;
- lpCtx->dwModeHeight = ddsd2DisplayMode.dwHeight;
- }
-
- // Clamp the effective window dimensions to primary surface.
- // We need to do this for D3D viewport dimensions even if wide
- // surfaces are supported. This also is a good idea for handling
- // whacked-out window dimensions passed for non-drawable windows
- // like Solid Edge. (DaveM)
- if (lpCtx->dwWidth > ddsd2DisplayMode.dwWidth)
- lpCtx->dwWidth = ddsd2DisplayMode.dwWidth;
- if (lpCtx->dwHeight > ddsd2DisplayMode.dwHeight)
- lpCtx->dwHeight = ddsd2DisplayMode.dwHeight;
-
- // Check for non-RGB desktop resolution
- if (!lpCtx->bFullscreen && ddsd2DisplayMode.ddpfPixelFormat.dwRGBBitCount <= 8) {
- ddlogPrintf(DDLOG_CRITICAL_OR_WARN, "Desktop color depth %d bpp not supported",
- ddsd2DisplayMode.ddpfPixelFormat.dwRGBBitCount);
- nContextError = GLDERR_BPP;
- goto return_with_error;
- }
-#endif // _USE_GLD3_WGL
-
- ddlogPrintf(DDLOG_INFO, "Window: w=%i, h=%i (%s)",
- lpCtx->dwWidth,
- lpCtx->dwHeight,
- lpCtx->bFullscreen ? "fullscreen" : "windowed");
-
-#ifndef _USE_GLD3_WGL
- // Obtain ddraw caps
- ZeroMemory(&lpCtx->ddCaps, sizeof(DDCAPS));
- lpCtx->ddCaps.dwSize = sizeof(DDCAPS);
- if (glb.bHardware) {
- // Get HAL caps
- IDirectDraw4_GetCaps(lpCtx->lpDD4, &lpCtx->ddCaps, NULL);
- } else {
- // Get HEL caps
- IDirectDraw4_GetCaps(lpCtx->lpDD4, NULL, &lpCtx->ddCaps);
- }
-
- // If this flag is present then we can't default to Mesa
- // SW rendering between BeginScene() and EndScene().
- if (lpCtx->ddCaps.dwCaps2 & DDCAPS2_NO2DDURING3DSCENE) {
- ddlogMessage(DDLOG_INFO,
- "Warning : No 2D allowed during 3D scene.\n");
- }
-
- // Query for DX6 Direct3D3 interface
- hResult = IDirectDraw4_QueryInterface(lpCtx->lpDD4,
- &IID_IDirect3D3,
- (void**)&lpCtx->lpD3D3);
- if (FAILED(hResult)) {
- MessageBox(NULL, "Unable to initialize Direct3D", "GLDirect", MB_OK);
- ddlogError(DDLOG_CRITICAL_OR_WARN, "Unable to create Direct3D interface", hResult);
- nContextError = GLDERR_D3D;
- goto return_with_error;
- }
-
- // Context creation
- if (lpCtx->bFullscreen) {
- // FULLSCREEN
-
- // Disable warning popups when in fullscreen mode
- ddlogWarnOption(FALSE);
-
- // Have to release persistant primary surface if fullscreen mode
- if (glb.bDirectDrawPersistant && glb.bDirectDrawPrimary) {
- RELEASE(glb.lpPrimary4);
- glb.bDirectDrawPrimary = FALSE;
- }
-
- dwFlags = DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN | DDSCL_ALLOWREBOOT;
- if (glb.bFastFPU)
- dwFlags |= DDSCL_FPUSETUP; // fast FPU setup optional (DaveM)
- hResult = IDirectDraw4_SetCooperativeLevel(lpCtx->lpDD4, lpCtx->hWnd, dwFlags);
- if (FAILED(hResult)) {
- ddlogError(DDLOG_CRITICAL_OR_WARN, "Unable to set Exclusive Fullscreen mode", hResult);
- goto return_with_error;
- }
-
- hResult = IDirectDraw4_SetDisplayMode(lpCtx->lpDD4,
- lpCtx->dwModeWidth,
- lpCtx->dwModeHeight,
- lpPFD->cColorBits,
- 0,
- 0);
- if (FAILED(hResult)) {
- ddlogError(DDLOG_CRITICAL_OR_WARN, "SetDisplayMode failed", hResult);
- goto return_with_error;
- }
-
- // ** The display mode has changed, so dont use MessageBox! **
-
- ZeroMemory(&ddsd2, sizeof(ddsd2));
- ddsd2.dwSize = sizeof(ddsd2);
-
- if (bDoubleBuffer) {
- // Double buffered
- // Primary surface
- ddsd2.dwFlags = DDSD_CAPS | DDSD_BACKBUFFERCOUNT;
- ddsd2.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE |
- DDSCAPS_FLIP |
- DDSCAPS_COMPLEX |
- DDSCAPS_3DDEVICE |
- dwMemoryType;
- ddsd2.dwBackBufferCount = 1;
-
- hResult = IDirectDraw4_CreateSurface(lpCtx->lpDD4, &ddsd2, &lpCtx->lpFront4, NULL);
- if (FAILED(hResult)) {
- ddlogError(DDLOG_CRITICAL_OR_WARN, "CreateSurface (primary) failed", hResult);
- nContextError = GLDERR_MEM;
- goto return_with_error;
- }
-
- // Render target surface
- ZeroMemory(&ddscaps2, sizeof(ddscaps2)); // Clear the entire struct.
- ddscaps2.dwCaps = DDSCAPS_BACKBUFFER;
- hResult = IDirectDrawSurface4_GetAttachedSurface(lpCtx->lpFront4, &ddscaps2, &lpCtx->lpBack4);
- if (FAILED(hResult)) {
- ddlogError(DDLOG_CRITICAL_OR_WARN, "GetAttachedSurface failed", hResult);
- nContextError = GLDERR_MEM;
- goto return_with_error;
- }
- } else {
- // Single buffered
- // Primary surface
- ddsd2.dwFlags = DDSD_CAPS;
- ddsd2.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE |
- //DDSCAPS_3DDEVICE |
- dwMemoryType;
-
- hResult = IDirectDraw4_CreateSurface(lpCtx->lpDD4, &ddsd2, &lpCtx->lpFront4, NULL);
- if (FAILED(hResult)) {
- ddlogError(DDLOG_CRITICAL_OR_WARN, "CreateSurface (primary) failed", hResult);
- nContextError = GLDERR_MEM;
- goto return_with_error;
- }
-
- lpCtx->lpBack4 = NULL;
- }
- } else {
- // WINDOWED
-
- // OK to enable warning popups in windowed mode
- ddlogWarnOption(glb.bMessageBoxWarnings);
-
- dwFlags = DDSCL_NORMAL;
- if (glb.bMultiThreaded)
- dwFlags |= DDSCL_MULTITHREADED;
- if (glb.bFastFPU)
- dwFlags |= DDSCL_FPUSETUP; // fast FPU setup optional (DaveM)
- hResult = IDirectDraw4_SetCooperativeLevel(lpCtx->lpDD4,
- lpCtx->hWnd,
- dwFlags);
- if (FAILED(hResult)) {
- ddlogError(DDLOG_CRITICAL_OR_WARN, "Unable to set Normal coop level", hResult);
- goto return_with_error;
- }
- // Has Primary surface already been created for original GLRC ?
- // Note this can only be applicable for windowed modes
- if (glb.bDirectDrawPersistant && glb.bDirectDrawPrimary) {
- lpCtx->lpFront4 = glb.lpPrimary4;
- IDirectDrawSurface4_AddRef(lpCtx->lpFront4);
- // Update the window on the default clipper
- IDirectDrawSurface4_GetClipper(lpCtx->lpFront4, &lpddClipper);
- IDirectDrawClipper_SetHWnd(lpddClipper, 0, lpCtx->hWnd);
- IDirectDrawClipper_Release(lpddClipper);
- goto SkipPrimaryCreate;
- }
-
- // Primary surface
- ZeroMemory(&ddsd2, sizeof(ddsd2));
- ddsd2.dwSize = sizeof(ddsd2);
- ddsd2.dwFlags = DDSD_CAPS;
- ddsd2.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE;
- hResult = IDirectDraw4_CreateSurface(lpCtx->lpDD4, &ddsd2, &lpCtx->lpFront4, NULL);
- if (FAILED(hResult)) {
- ddlogError(DDLOG_CRITICAL_OR_WARN, "CreateSurface (primary) failed", hResult);
- nContextError = GLDERR_MEM;
- goto return_with_error;
- }
-
- // Cache Primary surface for subsequent GLRCs
- // Note this can only be applicable to subsequent windowed modes
- if (glb.bDirectDrawPersistant && !glb.bDirectDrawPrimary) {
- glb.lpPrimary4 = lpCtx->lpFront4;
- IDirectDrawSurface4_AddRef(glb.lpPrimary4);
- glb.bDirectDrawPrimary = TRUE;
- }
-
- // Clipper object
- hResult = DirectDrawCreateClipper(0, &lpddClipper, NULL);
- if (FAILED(hResult)) {
- ddlogError(DDLOG_CRITICAL_OR_WARN, "CreateClipper failed", hResult);
- goto return_with_error;
- }
- hResult = IDirectDrawClipper_SetHWnd(lpddClipper, 0, lpCtx->hWnd);
- if (FAILED(hResult)) {
- RELEASE(lpddClipper);
- ddlogError(DDLOG_CRITICAL_OR_WARN, "SetHWnd failed", hResult);
- goto return_with_error;
- }
- hResult = IDirectDrawSurface4_SetClipper(lpCtx->lpFront4, lpddClipper);
- RELEASE(lpddClipper); // We have finished with it.
- if (FAILED(hResult)) {
- ddlogError(DDLOG_CRITICAL_OR_WARN, "SetClipper failed", hResult);
- goto return_with_error;
- }
-SkipPrimaryCreate:
-
- if (bDoubleBuffer) {
- // Render target surface
- ZeroMemory(&ddsd2, sizeof(ddsd2));
- ddsd2.dwSize = sizeof(ddsd2);
- ddsd2.dwFlags = DDSD_CAPS | DDSD_WIDTH | DDSD_HEIGHT;
- ddsd2.dwWidth = lpCtx->dwWidth;
- ddsd2.dwHeight = lpCtx->dwHeight;
- ddsd2.ddsCaps.dwCaps = DDSCAPS_3DDEVICE |
- DDSCAPS_OFFSCREENPLAIN |
- dwMemoryType;
-
- // Reserve the entire desktop size for persistant buffers option
- if (glb.bDirectDrawPersistant && glb.bPersistantBuffers) {
- ddsd2.dwWidth = ddsd2DisplayMode.dwWidth;
- ddsd2.dwHeight = ddsd2DisplayMode.dwHeight;
- }
- // Re-use original back buffer if persistant buffers exist
- if (glb.bDirectDrawPersistant && glb.bPersistantBuffers && glb.lpBack4)
- hResult = IDirectDrawSurface4_AddRef(lpCtx->lpBack4 = glb.lpBack4);
- else
- hResult = IDirectDraw4_CreateSurface(lpCtx->lpDD4, &ddsd2, &lpCtx->lpBack4, NULL);
- if (FAILED(hResult)) {
- ddlogError(DDLOG_CRITICAL_OR_WARN, "Create Backbuffer failed", hResult);
- nContextError = GLDERR_MEM;
- goto return_with_error;
- }
- if (glb.bDirectDrawPersistant && glb.bPersistantBuffers && !glb.lpBack4)
- IDirectDrawSurface4_AddRef(glb.lpBack4 = lpCtx->lpBack4);
- } else {
- lpCtx->lpBack4 = NULL;
- }
- }
-
- //
- // Now create the Z-buffer
- //
- lpCtx->bStencil = FALSE; // Default to no stencil buffer
- if (bDepthBuffer && (lpCtx->lpPF->iZBufferPF != -1)) {
- // Get z-buffer dimensions from the render target
- // Setup the surface desc for the z-buffer.
- ZeroMemory(&ddsd2, sizeof(ddsd2));
- ddsd2.dwSize = sizeof(ddsd2);
- ddsd2.dwFlags = DDSD_CAPS | DDSD_WIDTH | DDSD_HEIGHT | DDSD_PIXELFORMAT;
- ddsd2.ddsCaps.dwCaps = DDSCAPS_ZBUFFER | dwMemoryType;
- ddsd2.dwWidth = lpCtx->dwWidth;
- ddsd2.dwHeight = lpCtx->dwHeight;
- memcpy(&ddsd2.ddpfPixelFormat,
- &glb.lpZBufferPF[lpCtx->lpPF->iZBufferPF],
- sizeof(DDPIXELFORMAT) );
-
- // Reserve the entire desktop size for persistant buffers option
- if (glb.bDirectDrawPersistant && glb.bPersistantBuffers) {
- ddsd2.dwWidth = ddsd2DisplayMode.dwWidth;
- ddsd2.dwHeight = ddsd2DisplayMode.dwHeight;
- }
-
- // Create a z-buffer
- if (glb.bDirectDrawPersistant && glb.bPersistantBuffers && glb.lpDepth4)
- hResult = IDirectDrawSurface4_AddRef(lpCtx->lpDepth4 = glb.lpDepth4);
- else
- hResult = IDirectDraw4_CreateSurface(lpCtx->lpDD4, &ddsd2, &lpCtx->lpDepth4, NULL);
- if (FAILED(hResult)) {
- ddlogError(DDLOG_CRITICAL_OR_WARN, "CreateSurface (ZBuffer) failed", hResult);
- nContextError = GLDERR_MEM;
- goto return_with_error;
- }
- if (glb.bDirectDrawPersistant && glb.bPersistantBuffers && !glb.lpDepth4)
- IDirectDrawSurface4_AddRef(glb.lpDepth4 = lpCtx->lpDepth4);
- else if (glb.bDirectDrawPersistant && glb.bPersistantBuffers && glb.lpDepth4 && glb.lpBack4)
- IDirectDrawSurface4_DeleteAttachedSurface(glb.lpBack4, 0, glb.lpDepth4);
-
- // Attach Zbuffer to render target
- TRY(IDirectDrawSurface4_AddAttachedSurface(
- bDoubleBuffer ? lpCtx->lpBack4 : lpCtx->lpFront4,
- lpCtx->lpDepth4),
- "dglCreateContext: Attach Zbuffer");
- if (glb.lpZBufferPF[lpCtx->lpPF->iZBufferPF].dwFlags & DDPF_STENCILBUFFER) {
- lpCtx->bStencil = TRUE;
- ddlogMessage(DDLOG_INFO, "Depth buffer has stencil\n");
- }
- }
-
- // Clear all back buffers and Z-buffers in case of memory recycling.
- ZeroMemory(&ddbltfx, sizeof(ddbltfx));
- ddbltfx.dwSize = sizeof(ddbltfx);
- IDirectDrawSurface4_Blt(lpCtx->lpBack4, NULL, NULL, NULL,
- DDBLT_COLORFILL | DDBLT_WAIT, &ddbltfx);
- if (lpCtx->lpDepth4)
- IDirectDrawSurface4_Blt(lpCtx->lpDepth4, NULL, NULL, NULL,
- DDBLT_COLORFILL | DDBLT_WAIT, &ddbltfx);
-
- // Now that we have a Z-buffer we can create the 3D device
- hResult = IDirect3D3_CreateDevice(lpCtx->lpD3D3,
- &glb.d3dGuid,
- bDoubleBuffer ? lpCtx->lpBack4 : lpCtx->lpFront4,
- &lpCtx->lpDev3,
- NULL);
- if (FAILED(hResult)) {
- ddlogError(DDLOG_CRITICAL_OR_WARN, "Unable to create Direct3D device", hResult);
- nContextError = GLDERR_D3D;
- goto return_with_error;
- }
-
- // We must do this as soon as the device is created
- dglInitStateCaches(lpCtx);
-
- // Obtain the D3D Device Description
- D3DHWDevDesc.dwSize = D3DHELDevDesc.dwSize = sizeof(D3DDEVICEDESC);
- TRY(IDirect3DDevice3_GetCaps(lpCtx->lpDev3,
- &D3DHWDevDesc,
- &D3DHELDevDesc),
- "dglCreateContext: GetCaps failed");
-
- // Choose the relevant description and cache it in the context.
- // We will use this description later for caps checking
- memcpy( &lpCtx->D3DDevDesc,
- glb.bHardware ? &D3DHWDevDesc : &D3DHELDevDesc,
- sizeof(D3DDEVICEDESC));
-
- // Now we can examine the texture formats
- if (!dglBuildTextureFormatList(lpCtx->lpDev3)) {
- ddlogMessage(DDLOG_CRITICAL_OR_WARN, "dglBuildTextureFormatList failed\n");
- goto return_with_error;
- }
-
- // Get the pixel format of the back buffer
- lpCtx->ddpfRender.dwSize = sizeof(lpCtx->ddpfRender);
- if (bDoubleBuffer)
- hResult = IDirectDrawSurface4_GetPixelFormat(
- lpCtx->lpBack4,
- &lpCtx->ddpfRender);
- else
- hResult = IDirectDrawSurface4_GetPixelFormat(
- lpCtx->lpFront4,
- &lpCtx->ddpfRender);
-
- if (FAILED(hResult)) {
- ddlogError(DDLOG_CRITICAL_OR_WARN, "GetPixelFormat failed", hResult);
- goto return_with_error;
- }
- // Find a pixel packing function suitable for this surface
- pxClassifyPixelFormat(&lpCtx->ddpfRender,
- &lpCtx->fnPackFunc,
- &lpCtx->fnUnpackFunc,
- &lpCtx->fnPackSpanFunc);
-
- // Viewport
- hResult = IDirect3D3_CreateViewport(lpCtx->lpD3D3, &lpCtx->lpViewport3, NULL);
- if (FAILED(hResult)) {
- ddlogError(DDLOG_CRITICAL_OR_WARN, "CreateViewport failed", hResult);
- goto return_with_error;
- }
-
- hResult = IDirect3DDevice3_AddViewport(lpCtx->lpDev3, lpCtx->lpViewport3);
- if (FAILED(hResult)) {
- ddlogError(DDLOG_CRITICAL_OR_WARN, "AddViewport failed", hResult);
- goto return_with_error;
- }
-
- // Initialise the viewport
- // Note screen coordinates are used for viewport clipping since D3D
- // transform operations are not used in the GLD CAD driver. (DaveM)
- inv_aspect = (float)lpCtx->dwHeight/(float)lpCtx->dwWidth;
-
- lpCtx->d3dViewport.dwSize = sizeof(lpCtx->d3dViewport);
- lpCtx->d3dViewport.dwX = 0;
- lpCtx->d3dViewport.dwY = 0;
- lpCtx->d3dViewport.dwWidth = lpCtx->dwWidth;
- lpCtx->d3dViewport.dwHeight = lpCtx->dwHeight;
- lpCtx->d3dViewport.dvClipX = 0; // -1.0f;
- lpCtx->d3dViewport.dvClipY = 0; // inv_aspect;
- lpCtx->d3dViewport.dvClipWidth = lpCtx->dwWidth; // 2.0f;
- lpCtx->d3dViewport.dvClipHeight = lpCtx->dwHeight; // 2.0f * inv_aspect;
- lpCtx->d3dViewport.dvMinZ = 0.0f;
- lpCtx->d3dViewport.dvMaxZ = 1.0f;
- TRY(IDirect3DViewport3_SetViewport2(lpCtx->lpViewport3, &lpCtx->d3dViewport), "dglCreateContext: SetViewport2");
-
- hResult = IDirect3DDevice3_SetCurrentViewport(lpCtx->lpDev3, lpCtx->lpViewport3);
- if (FAILED(hResult)) {
- ddlogError(DDLOG_CRITICAL_OR_WARN, "SetCurrentViewport failed", hResult);
- goto return_with_error;
- }
-
- lpCtx->dwBPP = lpPFD->cColorBits;
- lpCtx->iZBufferPF = lpCtx->lpPF->iZBufferPF;
-
- // Set last texture to NULL
- for (i=0; i<MAX_TEXTURE_UNITS; i++) {
- lpCtx->ColorOp[i] = D3DTOP_DISABLE;
- lpCtx->AlphaOp[i] = D3DTOP_DISABLE;
- lpCtx->tObj[i] = NULL;
- }
-
- // Default to perspective correct texture mapping
- dglSetRenderState(lpCtx, D3DRENDERSTATE_TEXTUREPERSPECTIVE, TRUE, "TexturePersp");
-
- // Set the default culling mode
- lpCtx->cullmode = D3DCULL_NONE;
- dglSetRenderState(lpCtx, D3DRENDERSTATE_CULLMODE, D3DCULL_NONE, "CullMode");
-
- // Disable specular
- dglSetRenderState(lpCtx, D3DRENDERSTATE_SPECULARENABLE, FALSE, "SpecularEnable");
- // Disable subpixel correction
-// dglSetRenderState(lpCtx, D3DRENDERSTATE_SUBPIXEL, FALSE, "SubpixelEnable");
- // Disable dithering
- dglSetRenderState(lpCtx, D3DRENDERSTATE_DITHERENABLE, FALSE, "DitherEnable");
-
- // Initialise the primitive caches
-// lpCtx->dwNextLineVert = 0;
-// lpCtx->dwNextTriVert = 0;
-
- // Init the global texture palette
- lpCtx->lpGlobalPalette = NULL;
-
- // Init the HW/SW usage counters
-// lpCtx->dwHWUsageCount = lpCtx->dwSWUsageCount = 0L;
-
- //
- // Create two D3D vertex buffers.
- // One will hold the pre-transformed data with the other one
- // being used to hold the post-transformed & clipped verts.
- //
-#if 0 // never used (DaveM)
- vbufdesc.dwSize = sizeof(D3DVERTEXBUFFERDESC);
- vbufdesc.dwCaps = D3DVBCAPS_WRITEONLY;
- if (glb.bHardware == FALSE)
- vbufdesc.dwCaps = D3DVBCAPS_SYSTEMMEMORY;
- vbufdesc.dwNumVertices = 32768; // For the time being
-
- // Source vertex buffer
- vbufdesc.dwFVF = DGL_LVERTEX;
- hResult = IDirect3D3_CreateVertexBuffer(lpCtx->lpD3D3, &vbufdesc, &lpCtx->m_vbuf, 0, NULL);
- if (FAILED(hResult)) {
- ddlogError(DDLOG_CRITICAL_OR_WARN, "CreateVertexBuffer(src) failed", hResult);
- goto return_with_error;
- }
-
- // Destination vertex buffer
- vbufdesc.dwFVF = (glb.bMultitexture == FALSE) ? D3DFVF_TLVERTEX : (D3DFVF_XYZRHW | D3DFVF_DIFFUSE | D3DFVF_TEX2);
- hResult = IDirect3D3_CreateVertexBuffer(lpCtx->lpD3D3, &vbufdesc, &lpCtx->m_pvbuf, 0, NULL);
- if(FAILED(hResult)) {
- ddlogError(DDLOG_CRITICAL_OR_WARN, "CreateVertexBuffer(dst) failed", hResult);
- goto return_with_error;
- }
-#endif
-
-#endif _USE_GLD3_WGL
-
- //
- // Now create the Mesa context
- //
-
- // Create the Mesa visual
- if (lpPFD->cDepthBits)
- dwDepthBits = 16;
- if (lpPFD->cStencilBits)
- dwStencilBits = 8;
- if (lpPFD->cAlphaBits) {
- dwAlphaBits = 8;
- bAlphaSW = GL_TRUE;
- }
- if (lpPFD->dwFlags & PFD_DOUBLEBUFFER)
- bDouble = GL_TRUE;
-// lpCtx->EmulateSingle =
-// (lpPFD->dwFlags & PFD_DOUBLEBUFFER) ? FALSE : TRUE;
-
-#ifdef _USE_GLD3_WGL
- lpCtx->glVis = _mesa_create_visual(
- bDouble, /* double buffer */
- GL_FALSE, // stereo
- lpPFD->cRedBits,
- lpPFD->cGreenBits,
- lpPFD->cBlueBits,
- dwAlphaBits,
- dwDepthBits,
- dwStencilBits,
- lpPFD->cAccumRedBits, // accum bits
- lpPFD->cAccumGreenBits, // accum bits
- lpPFD->cAccumBlueBits, // accum bits
- lpPFD->cAccumAlphaBits, // accum alpha bits
- 1 // num samples
- );
-#else // _USE_GLD3_WGL
- lpCtx->glVis = (*mesaFuncs.gl_create_visual)(
- GL_TRUE, // RGB mode
- bAlphaSW, // Is an alpha buffer required?
- bDouble, // Is an double-buffering required?
- GL_FALSE, // stereo
- dwDepthBits, // depth_size
- dwStencilBits, // stencil_size
- lpPFD->cAccumBits, // accum_size
- 0, // colour-index bits
- lpPFD->cRedBits, // Red bit count
- lpPFD->cGreenBits, // Green bit count
- lpPFD->cBlueBits, // Blue bit count
- dwAlphaBits // Alpha bit count
- );
-#endif // _USE_GLD3_WGL
-
- if (lpCtx->glVis == NULL) {
- ddlogMessage(DDLOG_CRITICAL_OR_WARN, "gl_create_visual failed\n");
- goto return_with_error;
- }
-
-#ifdef _USE_GLD3_WGL
- lpCtx->glCtx = _mesa_create_context(API_OPENGL, lpCtx->glVis, NULL, (void *)lpCtx, GL_TRUE);
-#else
- // Create the Mesa context
- lpCtx->glCtx = (*mesaFuncs.gl_create_context)(
- lpCtx->glVis, // Mesa visual
- NULL, // share list context
- (void *)lpCtx, // Pointer to our driver context
- GL_TRUE // Direct context flag
- );
-#endif // _USE_GLD3_WGL
-
- if (lpCtx->glCtx == NULL) {
- ddlogMessage(DDLOG_CRITICAL_OR_WARN, "gl_create_context failed\n");
- goto return_with_error;
- }
-
- // Create the Mesa framebuffer
-#ifdef _USE_GLD3_WGL
- lpCtx->glBuffer = _mesa_create_framebuffer(
- lpCtx->glVis,
- lpCtx->glVis->depthBits > 0,
- lpCtx->glVis->stencilBits > 0,
- lpCtx->glVis->accumRedBits > 0,
- GL_FALSE //swalpha
- );
-#else
- lpCtx->glBuffer = (*mesaFuncs.gl_create_framebuffer)(lpCtx->glVis);
-#endif // _USE_GLD3_WGL
-
- if (lpCtx->glBuffer == NULL) {
- ddlogMessage(DDLOG_CRITICAL_OR_WARN, "gl_create_framebuffer failed\n");
- goto return_with_error;
- }
-
-#ifdef _USE_GLD3_WGL
- // Init Mesa internals
- _swrast_CreateContext( lpCtx->glCtx );
- _vbo_CreateContext( lpCtx->glCtx );
- _tnl_CreateContext( lpCtx->glCtx );
- _swsetup_CreateContext( lpCtx->glCtx );
-
- _gldDriver.InitialiseMesa(lpCtx);
-
- lpCtx->glCtx->imports.warning = _gld_mesa_warning;
- lpCtx->glCtx->imports.fatal = _gld_mesa_fatal;
-
-#else
- // Tell Mesa how many texture stages we have
- glb.wMaxSimultaneousTextures = lpCtx->D3DDevDesc.wMaxSimultaneousTextures;
- // Only use as many Units as the spec requires
- if (glb.wMaxSimultaneousTextures > MAX_TEXTURE_UNITS)
- glb.wMaxSimultaneousTextures = MAX_TEXTURE_UNITS;
- lpCtx->glCtx->Const.MaxTextureUnits = glb.wMaxSimultaneousTextures;
- ddlogPrintf(DDLOG_INFO, "Texture stages : %d", glb.wMaxSimultaneousTextures);
-
- // Set the max texture size.
- // NOTE: clamped to a max of 1024 for extra performance!
- lpCtx->dwMaxTextureSize = (lpCtx->D3DDevDesc.dwMaxTextureWidth <= 1024) ? lpCtx->D3DDevDesc.dwMaxTextureWidth : 1024;
-
-// Texture resize takes place elsewhere. KH
-// NOTE: This was added to workaround an issue with the Intel app.
-#if 0
- lpCtx->glCtx->Const.MaxTextureSize = lpCtx->dwMaxTextureSize;
-#else
- lpCtx->glCtx->Const.MaxTextureSize = 1024;
-#endif
- lpCtx->glCtx->Const.MaxDrawBuffers = 1;
-
- // Setup the Display Driver pointers
- dglSetupDDPointers(lpCtx->glCtx);
-
- // Initialise all the Direct3D renderstates
- dglInitStateD3D(lpCtx->glCtx);
-
-#if 0
- // Signal a reload of texture state on next glBegin
- lpCtx->m_texHandleValid = FALSE;
- lpCtx->m_mtex = FALSE;
- lpCtx->m_texturing = FALSE;
-#else
- // Set default texture unit state
-// dglSetTexture(lpCtx, 0, NULL);
-// dglSetTexture(lpCtx, 1, NULL);
-#endif
-
- //
- // Set the global texture palette to default values.
- //
-
- // Clear the entire palette
- ZeroMemory(ppe, sizeof(PALETTEENTRY) * 256);
-
- // Fill the palette with a default colour.
- // A garish colour is used to catch bugs. Here Magenta is used.
- for (i=0; i < 256; i++) {
- ppe[i].peRed = 255;
- ppe[i].peGreen = 0;
- ppe[i].peBlue = 255;
- }
-
- RELEASE(lpCtx->lpGlobalPalette);
-
- if (glb.bDirectDrawPersistant && glb.bPersistantBuffers && glb.lpGlobalPalette)
- hResult = IDirectDrawPalette_AddRef(lpCtx->lpGlobalPalette = glb.lpGlobalPalette);
- else
- hResult = IDirectDraw4_CreatePalette(
- lpCtx->lpDD4,
- DDPCAPS_INITIALIZE | DDPCAPS_8BIT | DDPCAPS_ALLOW256,
- ppe,
- &(lpCtx->lpGlobalPalette),
- NULL);
- if (FAILED(hResult)) {
- ddlogError(DDLOG_ERROR, "Default CreatePalette failed\n", hResult);
- lpCtx->lpGlobalPalette = NULL;
- goto return_with_error;
- }
- if (glb.bDirectDrawPersistant && glb.bPersistantBuffers && !glb.lpGlobalPalette)
- IDirectDrawPalette_AddRef(glb.lpGlobalPalette = lpCtx->lpGlobalPalette);
-
-#endif // _USE_GLD3_WGL
-
- // ** If we have made it to here then we can enable rendering **
- lpCtx->bCanRender = TRUE;
-
-// ddlogMessage(DDLOG_SYSTEM, "dglCreateContextBuffers succeded\n");
-
-#ifdef GLD_THREADS
- // Release serialized access
- if (glb.bMultiThreaded)
- LeaveCriticalSection(&CriticalSection);
-#endif
-
- return TRUE;
-
-return_with_error:
- // Clean up before returning.
- // This is critical for secondary devices.
-
- lpCtx->bCanRender = FALSE;
-
-#ifdef _USE_GLD3_WGL
- // Destroy the Mesa context
- if (lpCtx->glBuffer)
- _mesa_destroy_framebuffer(lpCtx->glBuffer);
- if (lpCtx->glCtx)
- _mesa_destroy_context(lpCtx->glCtx);
- if (lpCtx->glVis)
- _mesa_destroy_visual(lpCtx->glVis);
-
- // Destroy driver data
- _gldDriver.DestroyDrawable(lpCtx);
-#else
- // Destroy the Mesa context
- if (lpCtx->glBuffer)
- (*mesaFuncs.gl_destroy_framebuffer)(lpCtx->glBuffer);
- if (lpCtx->glCtx)
- (*mesaFuncs.gl_destroy_context)(lpCtx->glCtx);
- if (lpCtx->glVis)
- (*mesaFuncs.gl_destroy_visual)(lpCtx->glVis);
-
- RELEASE(lpCtx->m_pvbuf); // Release D3D vertex buffer
- RELEASE(lpCtx->m_vbuf); // Release D3D vertex buffer
-
- if (lpCtx->lpViewport3) {
- if (lpCtx->lpDev3) IDirect3DDevice3_DeleteViewport(lpCtx->lpDev3, lpCtx->lpViewport3);
- RELEASE(lpCtx->lpViewport3);
- lpCtx->lpViewport3 = NULL;
- }
-
- RELEASE(lpCtx->lpDev3);
- if (lpCtx->lpDepth4) {
- if (lpCtx->lpBack4)
- IDirectDrawSurface4_DeleteAttachedSurface(lpCtx->lpBack4, 0L, lpCtx->lpDepth4);
- else
- IDirectDrawSurface4_DeleteAttachedSurface(lpCtx->lpFront4, 0L, lpCtx->lpDepth4);
- RELEASE(lpCtx->lpDepth4);
- lpCtx->lpDepth4 = NULL;
- }
- RELEASE(lpCtx->lpBack4);
- RELEASE(lpCtx->lpFront4);
- else
- if (lpCtx->bFullscreen) {
- IDirectDraw4_RestoreDisplayMode(lpCtx->lpDD4);
- IDirectDraw4_SetCooperativeLevel(lpCtx->lpDD4, NULL, DDSCL_NORMAL);
- }
- RELEASE(lpCtx->lpD3D3);
- RELEASE(lpCtx->lpDD4);
- RELEASE(lpCtx->lpDD1);
-#endif // _USE_GLD3_WGL
-
- lpCtx->bAllocated = FALSE;
-
-#ifdef GLD_THREADS
- // Release serialized access
- if (glb.bMultiThreaded)
- LeaveCriticalSection(&CriticalSection);
-#endif
-
- return FALSE;
-
-#undef DDLOG_CRITICAL_OR_WARN
-}
-
-// ***********************************************************************
-
-HGLRC dglCreateContext(
- HDC a,
- const DGL_pixelFormat *lpPF)
-{
- int i;
- HGLRC hGLRC;
- DGL_ctx* lpCtx;
- static BOOL bWarnOnce = TRUE;
- DWORD dwThreadId = GetCurrentThreadId();
- char szMsg[256];
- HWND hWnd;
- LONG lpfnWndProc;
-
- // Validate license
- if (!dglValidate())
- return NULL;
-
- // Is context state ready ?
- if (!bContextReady)
- return NULL;
-
- ddlogPrintf(DDLOG_SYSTEM, "dglCreateContext for HDC=%X, ThreadId=%X", a, dwThreadId);
-
- // Find next free context.
- // Also ensure that only one Fullscreen context is created at any one time.
- hGLRC = 0; // Default to Not Found
- for (i=0; i<DGL_MAX_CONTEXTS; i++) {
- if (ctxlist[i].bAllocated) {
- if (/*glb.bFullscreen && */ctxlist[i].bFullscreen)
- break;
- } else {
- hGLRC = (HGLRC)(i+1);
- break;
- }
- }
-
- // Bail if no GLRC was found
- if (!hGLRC)
- return NULL;
-
- // Set the context pointer
- lpCtx = dglGetContextAddress(hGLRC);
- // Make sure that context is zeroed before we do anything.
- // MFC and C++ apps call wglCreateContext() and wglDeleteContext() multiple times,
- // even though only one context is ever used by the app, so keep it clean. (DaveM)
- ZeroMemory(lpCtx, sizeof(DGL_ctx));
- lpCtx->bAllocated = TRUE;
- // Flag that buffers need creating on next wglMakeCurrent call.
- lpCtx->bHasBeenCurrent = FALSE;
- lpCtx->lpPF = (DGL_pixelFormat *)lpPF; // cache pixel format
- lpCtx->bCanRender = FALSE;
-
- // Create all the internal resources here, not in dglMakeCurrent().
- // We do a re-size check in dglMakeCurrent in case of re-allocations. (DaveM)
- // We now try context allocations twice, first with video memory,
- // then again with system memory. This is similar to technique
- // used for dglWglResizeBuffers(). (DaveM)
- if (lpCtx->bHasBeenCurrent == FALSE) {
- if (!dglCreateContextBuffers(a, lpCtx, FALSE)) {
- if (glb.bMessageBoxWarnings && bWarnOnce && dwLogging) {
- bWarnOnce = FALSE;
- switch (nContextError) {
- case GLDERR_DDRAW: strcpy(szMsg, szDDrawWarning); break;
- case GLDERR_D3D: strcpy(szMsg, szD3DWarning); break;
- case GLDERR_MEM: strcpy(szMsg, szResourceWarning); break;
- case GLDERR_BPP: strcpy(szMsg, szBPPWarning); break;
- default: strcpy(szMsg, "");
- }
- if (strlen(szMsg))
- MessageBox(NULL, szMsg, "GLDirect", MB_OK | MB_ICONWARNING);
- }
- // Only need to try again if memory error
- if (nContextError == GLDERR_MEM) {
- ddlogPrintf(DDLOG_WARN, "dglCreateContext failed 1st time with video memory");
- }
- else {
- ddlogPrintf(DDLOG_ERROR, "dglCreateContext failed");
- return NULL;
- }
- }
- }
-
- // Now that we have a hWnd, we can intercept the WindowProc.
- hWnd = lpCtx->hWnd;
- if (hWnd) {
- // Only hook individual window handler once if not hooked before.
- lpfnWndProc = GetWindowLong(hWnd, GWL_WNDPROC);
- if (lpfnWndProc != (LONG)dglWndProc) {
- lpCtx->lpfnWndProc = lpfnWndProc;
- SetWindowLong(hWnd, GWL_WNDPROC, (LONG)dglWndProc);
- }
- // Find the parent window of the app too.
- if (glb.hWndActive == NULL) {
- while (hWnd != NULL) {
- glb.hWndActive = hWnd;
- hWnd = GetParent(hWnd);
- }
- // Hook the parent window too.
- lpfnWndProc = GetWindowLong(glb.hWndActive, GWL_WNDPROC);
- if (glb.hWndActive == lpCtx->hWnd)
- glb.lpfnWndProc = lpCtx->lpfnWndProc;
- else if (lpfnWndProc != (LONG)dglWndProc)
- glb.lpfnWndProc = lpfnWndProc;
- if (glb.lpfnWndProc)
- SetWindowLong(glb.hWndActive, GWL_WNDPROC, (LONG)dglWndProc);
- }
- }
-
- ddlogPrintf(DDLOG_SYSTEM, "dglCreateContext succeeded for HGLRC=%d", (int)hGLRC);
-
- return hGLRC;
-}
-
-// ***********************************************************************
-// Make a DirectGL context current
-// Used by wgl functions and dgl functions
-BOOL dglMakeCurrent(
- HDC a,
- HGLRC b)
-{
- int context;
- DGL_ctx* lpCtx;
- HWND hWnd;
- BOOL bNeedResize = FALSE;
- BOOL bWindowChanged, bContextChanged;
- LPDIRECTDRAWCLIPPER lpddClipper;
- DWORD dwThreadId = GetCurrentThreadId();
- LONG lpfnWndProc;
-
- // Validate license
- if (!dglValidate())
- return FALSE;
-
- // Is context state ready ?
- if (!bContextReady)
- return FALSE;
-
- context = (int)b; // This is as a result of STRICT!
- ddlogPrintf(DDLOG_SYSTEM, "dglMakeCurrent: HDC=%X, HGLRC=%d, ThreadId=%X", a, context, dwThreadId);
-
- // If the HGLRC is NULL then make no context current;
- // Ditto if the HDC is NULL either. (DaveM)
- if (context == 0 || a == 0) {
- // Corresponding Mesa operation
-#ifdef _USE_GLD3_WGL
- _mesa_make_current(NULL, NULL);
-#else
- (*mesaFuncs.gl_make_current)(NULL, NULL);
-#endif
- dglSetCurrentContext(0);
- return TRUE;
- }
-
- // Make sure the HGLRC is in range
- if ((context > DGL_MAX_CONTEXTS) || (context < 0)) {
- ddlogMessage(DDLOG_ERROR, "dglMakeCurrent: HGLRC out of range\n");
- return FALSE;
- }
-
- // Find address of context and make sure that it has been allocated
- lpCtx = dglGetContextAddress(b);
- if (!lpCtx->bAllocated) {
- ddlogMessage(DDLOG_ERROR, "dglMakeCurrent: Context not allocated\n");
-// return FALSE;
- return TRUE; // HACK: Shuts up "WebLab Viewer Pro". KeithH
- }
-
-#ifdef GLD_THREADS
- // Serialize access to DirectDraw or DDS operations
- if (glb.bMultiThreaded)
- EnterCriticalSection(&CriticalSection);
-#endif
-
- // Check if window has changed
- hWnd = (a != lpCtx->hDC) ? WindowFromDC(a) : lpCtx->hWnd;
- bWindowChanged = (hWnd != lpCtx->hWnd) ? TRUE : FALSE;
- bContextChanged = (b != dglGetCurrentContext()) ? TRUE : FALSE;
-
- // If the window has changed, make sure the clipper is updated. (DaveM)
- if (glb.bDirectDrawPersistant && !lpCtx->bFullscreen && (bWindowChanged || bContextChanged)) {
- lpCtx->hWnd = hWnd;
-#ifndef _USE_GLD3_WGL
- IDirectDrawSurface4_GetClipper(lpCtx->lpFront4, &lpddClipper);
- IDirectDrawClipper_SetHWnd(lpddClipper, 0, lpCtx->hWnd);
- IDirectDrawClipper_Release(lpddClipper);
-#endif // _USE_GLD3_WGL
- }
-
- // Make sure hDC and hWnd is current. (DaveM)
- // Obtain the dimensions of the rendering window
- lpCtx->hDC = a; // Cache DC
- lpCtx->hWnd = hWnd;
- hWndLastActive = hWnd;
-
- // Check for non-window DC = memory DC ?
- if (hWnd == NULL) {
- if (GetClipBox(a, &lpCtx->rcScreenRect) == ERROR) {
- ddlogMessage(DDLOG_WARN, "GetClipBox failed in dglMakeCurrent\n");
- SetRect(&lpCtx->rcScreenRect, 0, 0, 0, 0);
- }
- }
- else if (!GetClientRect(lpCtx->hWnd, &lpCtx->rcScreenRect)) {
- ddlogMessage(DDLOG_WARN, "GetClientRect failed in dglMakeCurrent\n");
- SetRect(&lpCtx->rcScreenRect, 0, 0, 0, 0);
- }
- // Check if buffers need to be re-sized;
- // If so, wait until Mesa GL stuff is setup before re-sizing;
- if (lpCtx->dwWidth != lpCtx->rcScreenRect.right - lpCtx->rcScreenRect.left ||
- lpCtx->dwHeight != lpCtx->rcScreenRect.bottom - lpCtx->rcScreenRect.top)
- bNeedResize = TRUE;
-
- // Now we can update our globals
- dglSetCurrentContext(b);
-
- // Corresponding Mesa operation
-#ifdef _USE_GLD3_WGL
- _mesa_make_current(lpCtx->glCtx, lpCtx->glBuffer);
- lpCtx->glCtx->Driver.UpdateState(lpCtx->glCtx, _NEW_ALL);
- if (bNeedResize) {
- // Resize buffers (Note Mesa GL needs to be setup beforehand);
- // Resize Mesa internal buffer too via glViewport() command,
- // which subsequently calls dglWglResizeBuffers() too.
- lpCtx->glCtx->Driver.Viewport(lpCtx->glCtx, 0, 0, lpCtx->dwWidth, lpCtx->dwHeight);
- lpCtx->bHasBeenCurrent = TRUE;
- }
-#else
- (*mesaFuncs.gl_make_current)(lpCtx->glCtx, lpCtx->glBuffer);
-
- dglSetupDDPointers(lpCtx->glCtx);
-
- // Insure DirectDraw surfaces fit current window DC
- if (bNeedResize) {
- // Resize buffers (Note Mesa GL needs to be setup beforehand);
- // Resize Mesa internal buffer too via glViewport() command,
- // which subsequently calls dglWglResizeBuffers() too.
- (*mesaFuncs.gl_Viewport)(lpCtx->glCtx, 0, 0, lpCtx->dwWidth, lpCtx->dwHeight);
- lpCtx->bHasBeenCurrent = TRUE;
- }
-#endif // _USE_GLD3_WGL
- ddlogPrintf(DDLOG_SYSTEM, "dglMakeCurrent: width = %d, height = %d", lpCtx->dwWidth, lpCtx->dwHeight);
-
- // We have to clear D3D back buffer and render state if emulated front buffering
- // for different window (but not context) like in Solid Edge.
- if (glb.bDirectDrawPersistant && glb.bPersistantBuffers
- && (bWindowChanged /* || bContextChanged */) && lpCtx->EmulateSingle) {
-#ifdef _USE_GLD3_WGL
-// IDirect3DDevice8_EndScene(lpCtx->pDev);
-// lpCtx->bSceneStarted = FALSE;
- lpCtx->glCtx->Driver.Clear(lpCtx->glCtx, GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT,
- GL_TRUE, 0, 0, lpCtx->dwWidth, lpCtx->dwHeight);
-#else
- IDirect3DDevice3_EndScene(lpCtx->lpDev3);
- lpCtx->bSceneStarted = FALSE;
- dglClearD3D(lpCtx->glCtx, GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT,
- GL_TRUE, 0, 0, lpCtx->dwWidth, lpCtx->dwHeight);
-#endif // _USE_GLD3_WGL
- }
-
- // The first time we call MakeCurrent we set the initial viewport size
- if (lpCtx->bHasBeenCurrent == FALSE)
-#ifdef _USE_GLD3_WGL
- lpCtx->glCtx->Driver.Viewport(lpCtx->glCtx, 0, 0, lpCtx->dwWidth, lpCtx->dwHeight);
-#else
- (*mesaFuncs.gl_Viewport)(lpCtx->glCtx, 0, 0, lpCtx->dwWidth, lpCtx->dwHeight);
-#endif // _USE_GLD3_WGL
- lpCtx->bHasBeenCurrent = TRUE;
-
-#ifdef GLD_THREADS
- // Release serialized access
- if (glb.bMultiThreaded)
- LeaveCriticalSection(&CriticalSection);
-#endif
-
- return TRUE;
-}
-
-// ***********************************************************************
-
-BOOL dglDeleteContext(
- HGLRC a)
-{
- DGL_ctx* lpCtx;
- DWORD dwThreadId = GetCurrentThreadId();
- char argstr[256];
-
-#if 0 // We have enough trouble throwing exceptions as it is... (DaveM)
- // Validate license
- if (!dglValidate())
- return FALSE;
-#endif
-
- // Is context state ready ?
- if (!bContextReady)
- return FALSE;
-
- ddlogPrintf(DDLOG_SYSTEM, "dglDeleteContext: Deleting context HGLRC=%d, ThreadId=%X", (int)a, dwThreadId);
-
- // Make sure the HGLRC is in range
- if (((int) a> DGL_MAX_CONTEXTS) || ((int)a < 0)) {
- ddlogMessage(DDLOG_ERROR, "dglDeleteCurrent: HGLRC out of range\n");
- return FALSE;
- }
-
- // Make sure context is valid
- lpCtx = dglGetContextAddress(a);
- if (!lpCtx->bAllocated) {
- ddlogPrintf(DDLOG_WARN, "Tried to delete unallocated context HGLRC=%d", (int)a);
-// return FALSE;
- return TRUE; // HACK: Shuts up "WebLab Viewer Pro". KeithH
- }
-
- // Make sure context is de-activated
- if (a == dglGetCurrentContext()) {
- ddlogPrintf(DDLOG_WARN, "dglDeleteContext: context HGLRC=%d still active", (int)a);
- dglMakeCurrent(NULL, NULL);
- }
-
-#ifdef GLD_THREADS
- // Serialize access to DirectDraw or DDS operations
- if (glb.bMultiThreaded)
- EnterCriticalSection(&CriticalSection);
-#endif
-
- // We are about to destroy all Direct3D objects.
- // Therefore we must disable rendering
- lpCtx->bCanRender = FALSE;
-
- // This exception handler was installed to catch some
- // particularly nasty apps. Console apps that call exit()
- // fall into this catagory (i.e. Win32 Glut).
-
- // VC cannot successfully implement multiple exception handlers
- // if more than one exception occurs. Therefore reverting back to
- // single exception handler as Keith originally had it. (DaveM)
-
-#define WARN_MESSAGE(p) strcpy(argstr, (#p));
-#define SAFE_RELEASE(p) WARN_MESSAGE(p); RELEASE(p);
-
-__try {
-#ifdef _USE_GLD3_WGL
- WARN_MESSAGE(gl_destroy_framebuffer);
- if (lpCtx->glBuffer)
- _mesa_destroy_framebuffer(lpCtx->glBuffer);
- WARN_MESSAGE(gl_destroy_context);
- if (lpCtx->glCtx)
- _mesa_destroy_context(lpCtx->glCtx);
- WARN_MESSAGE(gl_destroy_visual);
- if (lpCtx->glVis)
- _mesa_destroy_visual(lpCtx->glVis);
-
- _gldDriver.DestroyDrawable(lpCtx);
-#else
- // Destroy the Mesa context
- WARN_MESSAGE(gl_destroy_framebuffer);
- if (lpCtx->glBuffer)
- (*mesaFuncs.gl_destroy_framebuffer)(lpCtx->glBuffer);
- WARN_MESSAGE(gl_destroy_context);
- if (lpCtx->glCtx)
- (*mesaFuncs.gl_destroy_context)(lpCtx->glCtx);
- WARN_MESSAGE(gl_destroy_visual);
- if (lpCtx->glVis)
- (*mesaFuncs.gl_destroy_visual)(lpCtx->glVis);
-
- SAFE_RELEASE(lpCtx->m_pvbuf); // release D3D vertex buffer
- SAFE_RELEASE(lpCtx->m_vbuf); // release D3D vertex buffer
-
- // Delete the global palette
- SAFE_RELEASE(lpCtx->lpGlobalPalette);
-
- // Clean up.
- if (lpCtx->lpViewport3) {
- if (lpCtx->lpDev3) IDirect3DDevice3_DeleteViewport(lpCtx->lpDev3, lpCtx->lpViewport3);
- SAFE_RELEASE(lpCtx->lpViewport3);
- lpCtx->lpViewport3 = NULL;
- }
-
- SAFE_RELEASE(lpCtx->lpDev3);
- if (lpCtx->lpDepth4) {
- if (lpCtx->lpBack4)
- IDirectDrawSurface4_DeleteAttachedSurface(lpCtx->lpBack4, 0L, lpCtx->lpDepth4);
- else
- IDirectDrawSurface4_DeleteAttachedSurface(lpCtx->lpFront4, 0L, lpCtx->lpDepth4);
- SAFE_RELEASE(lpCtx->lpDepth4);
- lpCtx->lpDepth4 = NULL;
- }
- SAFE_RELEASE(lpCtx->lpBack4);
- SAFE_RELEASE(lpCtx->lpFront4);
- if (lpCtx->bFullscreen) {
- IDirectDraw4_RestoreDisplayMode(lpCtx->lpDD4);
- IDirectDraw4_SetCooperativeLevel(lpCtx->lpDD4, NULL, DDSCL_NORMAL);
- }
- SAFE_RELEASE(lpCtx->lpD3D3);
- SAFE_RELEASE(lpCtx->lpDD4);
- SAFE_RELEASE(lpCtx->lpDD1);
-#endif // _ULSE_GLD3_WGL
-
-}
-__except(EXCEPTION_EXECUTE_HANDLER) {
- ddlogPrintf(DDLOG_WARN, "Exception raised in dglDeleteContext: %s", argstr);
-}
-
- // Restore the window message handler because this context may be used
- // again by another window with a *different* message handler. (DaveM)
- if (lpCtx->lpfnWndProc) {
- SetWindowLong(lpCtx->hWnd, GWL_WNDPROC, (LONG)lpCtx->lpfnWndProc);
- lpCtx->lpfnWndProc = (LONG)NULL;
- }
-
- lpCtx->bAllocated = FALSE; // This context is now free for use
-
-#ifdef GLD_THREADS
- // Release serialized access
- if (glb.bMultiThreaded)
- LeaveCriticalSection(&CriticalSection);
-#endif
-
- return TRUE;
-}
-
-// ***********************************************************************
-
-BOOL dglSwapBuffers(
- HDC hDC)
-{
- RECT rSrcRect; // Source rectangle
- RECT rDstRect; // Destination rectangle
- POINT pt;
- HRESULT hResult;
-
- DDBLTFX bltFX;
- DWORD dwBlitFlags;
- DDBLTFX *lpBltFX;
-
-// DWORD dwThreadId = GetCurrentThreadId();
- HGLRC hGLRC = dglGetCurrentContext();
- DGL_ctx *lpCtx = dglGetContextAddress(hGLRC);
- HWND hWnd;
-
- HDC hDCAux; // for memory DC
- int x,y,w,h; // for memory DC BitBlt
-
-#if 0 // Perhaps not a good idea. Called too often. KH
- // Validate license
- if (!dglValidate())
- return FALSE;
-#endif
-
- if (!lpCtx) {
- return TRUE; //FALSE; // No current context
- }
-
- if (!lpCtx->bCanRender) {
- // Don't return false else some apps will bail.
- return TRUE;
- }
-
- hWnd = lpCtx->hWnd;
- if (hDC != lpCtx->hDC) {
- ddlogPrintf(DDLOG_WARN, "dglSwapBuffers: HDC=%X does not match HDC=%X for HGLRC=%d", hDC, lpCtx->hDC, hGLRC);
- hWnd = WindowFromDC(hDC);
- }
-
-#ifndef _USE_GLD3_WGL
- // Ensure that the surfaces exist before we tell
- // the device to render to them.
- IDirectDraw4_RestoreAllSurfaces(lpCtx->lpDD4);
-
- // Make sure that the vertex caches have been emptied
-// dglStateChange(lpCtx);
-
- // Some OpenGL programs don't issue a glFinish - check for it here.
- if (lpCtx->bSceneStarted) {
- IDirect3DDevice3_EndScene(lpCtx->lpDev3);
- lpCtx->bSceneStarted = FALSE;
- }
-#endif
-
-#if 0
- // If the calling app is not active then we don't need to Blit/Flip.
- // We can therefore simply return TRUE.
- if (!glb.bAppActive)
- return TRUE;
- // Addendum: This is WRONG! We should bail if the app is *minimized*,
- // not merely if the app is just plain 'not active'.
- // KeithH, 27/May/2000.
-#endif
-
- // Check for non-window DC = memory DC ?
- if (hWnd == NULL) {
- if (GetClipBox(hDC, &rSrcRect) == ERROR)
- return TRUE;
- // Use GDI BitBlt instead from compatible DirectDraw DC
- x = rSrcRect.left;
- y = rSrcRect.top;
- w = rSrcRect.right - rSrcRect.left;
- h = rSrcRect.bottom - rSrcRect.top;
-
- // Ack. DX8 does not have a GetDC() function...
- // TODO: Defer to DX7 or DX9 drivers... (DaveM)
- return TRUE;
- }
-
- // Bail if window client region is not drawable, like in Solid Edge
- if (!IsWindow(hWnd) /* || !IsWindowVisible(hWnd) */ || !GetClientRect(hWnd, &rSrcRect))
- return TRUE;
-
-#ifdef GLD_THREADS
- // Serialize access to DirectDraw or DDS operations
- if (glb.bMultiThreaded)
- EnterCriticalSection(&CriticalSection);
-#endif
-
-#ifdef _USE_GLD3_WGL
- // Notify Mesa of impending swap, so Mesa can flush internal buffers.
- _mesa_notifySwapBuffers(lpCtx->glCtx);
- // Now perform driver buffer swap
- _gldDriver.SwapBuffers(lpCtx, hDC, hWnd);
-#else
- if (lpCtx->bFullscreen) {
- // Sync with retrace if required
- if (glb.bWaitForRetrace) {
- IDirectDraw4_WaitForVerticalBlank(
- lpCtx->lpDD4,
- DDWAITVB_BLOCKBEGIN,
- 0);
- }
-
- // Perform the fullscreen flip
- TRY(IDirectDrawSurface4_Flip(
- lpCtx->lpFront4,
- NULL,
- DDFLIP_WAIT),
- "dglSwapBuffers: Flip");
- } else {
- // Calculate current window position and size
- pt.x = pt.y = 0;
- ClientToScreen(hWnd, &pt);
- GetClientRect(hWnd, &rDstRect);
- if (rDstRect.right > lpCtx->dwModeWidth)
- rDstRect.right = lpCtx->dwModeWidth;
- if (rDstRect.bottom > lpCtx->dwModeHeight)
- rDstRect.bottom = lpCtx->dwModeHeight;
- OffsetRect(&rDstRect, pt.x, pt.y);
- rSrcRect.left = rSrcRect.top = 0;
- rSrcRect.right = lpCtx->dwWidth;
- rSrcRect.bottom = lpCtx->dwHeight;
- if (rSrcRect.right > lpCtx->dwModeWidth)
- rSrcRect.right = lpCtx->dwModeWidth;
- if (rSrcRect.bottom > lpCtx->dwModeHeight)
- rSrcRect.bottom = lpCtx->dwModeHeight;
-
- if (glb.bWaitForRetrace) {
- // Sync the blit to the vertical retrace
- ZeroMemory(&bltFX, sizeof(bltFX));
- bltFX.dwSize = sizeof(bltFX);
- bltFX.dwDDFX = DDBLTFX_NOTEARING;
- dwBlitFlags = DDBLT_WAIT | DDBLT_DDFX;
- lpBltFX = &bltFX;
- } else {
- dwBlitFlags = DDBLT_WAIT;
- lpBltFX = NULL;
- }
-
- // Perform the actual blit
- TRY(IDirectDrawSurface4_Blt(
- lpCtx->lpFront4,
- &rDstRect,
- lpCtx->lpBack4, // Blit source
- &rSrcRect,
- dwBlitFlags,
- lpBltFX),
- "dglSwapBuffers: Blt");
- }
-#endif // _USE_GLD3_WGL
-
-#ifdef GLD_THREADS
- // Release serialized access
- if (glb.bMultiThreaded)
- LeaveCriticalSection(&CriticalSection);
-#endif
-
- // TODO: Re-instate rendering bitmap snapshot feature??? (DaveM)
-
- // Render frame is completed
- ValidateRect(hWnd, NULL);
- lpCtx->bFrameStarted = FALSE;
-
- return TRUE;
-}
-
-// ***********************************************************************
+/****************************************************************************
+*
+* Mesa 3-D graphics library
+* Direct3D Driver Interface
+*
+* ========================================================================
+*
+* Copyright (C) 1991-2004 SciTech Software, Inc. All rights reserved.
+*
+* Permission is hereby granted, free of charge, to any person obtaining a
+* copy of this software and associated documentation files (the "Software"),
+* to deal in the Software without restriction, including without limitation
+* the rights to use, copy, modify, merge, publish, distribute, sublicense,
+* and/or sell copies of the Software, and to permit persons to whom the
+* Software is furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included
+* in all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+* SCITECH SOFTWARE INC BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
+* OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+* SOFTWARE.
+*
+* ======================================================================
+*
+* Language: ANSI C
+* Environment: Windows 9x (Win32)
+*
+* Description: Context handling.
+*
+****************************************************************************/
+
+#include "dglcontext.h"
+
+// Get compile errors without this. KeithH
+//#include "scitech.h" // ibool, etc.
+
+#ifdef _USE_GLD3_WGL
+#include "gld_driver.h"
+
+extern void _gld_mesa_warning(struct gl_context *, char *);
+extern void _gld_mesa_fatal(struct gl_context *, char *);
+#endif // _USE_GLD3_WGL
+
+// TODO: Clean out old DX6-specific code from GLD 2.x CAD driver
+// if it is no longer being built as part of GLDirect. (DaveM)
+
+// ***********************************************************************
+
+#define GLDERR_NONE 0
+#define GLDERR_MEM 1
+#define GLDERR_DDRAW 2
+#define GLDERR_D3D 3
+#define GLDERR_BPP 4
+
+char szResourceWarning[] =
+"GLDirect does not have enough video memory resources\n"
+"to support the requested OpenGL rendering context.\n\n"
+"You may have to reduce the current display resolution\n"
+"to obtain satisfactory OpenGL performance.\n";
+
+char szDDrawWarning[] =
+"GLDirect is unable to initialize DirectDraw for the\n"
+"requested OpenGL rendering context.\n\n"
+"You will have to check the DirectX control panel\n"
+"for further information.\n";
+
+char szD3DWarning[] =
+"GLDirect is unable to initialize Direct3D for the\n"
+"requested OpenGL rendering context.\n\n"
+"You may have to change the display mode resolution\n"
+"color depth or check the DirectX control panel for\n"
+"further information.\n";
+
+char szBPPWarning[] =
+"GLDirect is unable to use the selected color depth for\n"
+"the requested OpenGL rendering context.\n\n"
+"You will have to change the display mode resolution\n"
+"color depth with the Display Settings control panel.\n";
+
+int nContextError = GLDERR_NONE;
+
+// ***********************************************************************
+
+#define VENDORID_ATI 0x1002
+
+static DWORD devATIRagePro[] = {
+ 0x4742, // 3D RAGE PRO BGA AGP 1X/2X
+ 0x4744, // 3D RAGE PRO BGA AGP 1X only
+ 0x4749, // 3D RAGE PRO BGA PCI 33 MHz
+ 0x4750, // 3D RAGE PRO PQFP PCI 33 MHz
+ 0x4751, // 3D RAGE PRO PQFP PCI 33 MHz limited 3D
+ 0x4C42, // 3D RAGE LT PRO BGA-312 AGP 133 MHz
+ 0x4C44, // 3D RAGE LT PRO BGA-312 AGP 66 MHz
+ 0x4C49, // 3D RAGE LT PRO BGA-312 PCI 33 MHz
+ 0x4C50, // 3D RAGE LT PRO BGA-256 PCI 33 MHz
+ 0x4C51, // 3D RAGE LT PRO BGA-256 PCI 33 MHz limited 3D
+};
+
+static DWORD devATIRageIIplus[] = {
+ 0x4755, // 3D RAGE II+
+ 0x4756, // 3D RAGE IIC PQFP PCI
+ 0x4757, // 3D RAGE IIC BGA AGP
+ 0x475A, // 3D RAGE IIC PQFP AGP
+ 0x4C47, // 3D RAGE LT-G
+};
+
+// ***********************************************************************
+
+#ifndef _USE_GLD3_WGL
+extern DGL_mesaFuncs mesaFuncs;
+#endif
+
+extern DWORD dwLogging;
+
+#ifdef GLD_THREADS
+#pragma message("compiling DGLCONTEXT.C vars for multi-threaded support")
+CRITICAL_SECTION CriticalSection; // for serialized access
+DWORD dwTLSCurrentContext = 0xFFFFFFFF; // TLS index for current context
+DWORD dwTLSPixelFormat = 0xFFFFFFFF; // TLS index for current pixel format
+#endif
+HGLRC iCurrentContext = 0; // Index of current context (static)
+BOOL bContextReady = FALSE; // Context state ready ?
+
+DGL_ctx ctxlist[DGL_MAX_CONTEXTS]; // Context list
+
+// ***********************************************************************
+
+static BOOL bHaveWin95 = FALSE;
+static BOOL bHaveWinNT = FALSE;
+static BOOL bHaveWin2K = FALSE;
+
+/****************************************************************************
+REMARKS:
+Detect the installed OS type.
+****************************************************************************/
+static void DetectOS(void)
+{
+ OSVERSIONINFO VersionInformation;
+ LPOSVERSIONINFO lpVersionInformation = &VersionInformation;
+
+ VersionInformation.dwOSVersionInfoSize = sizeof(VersionInformation);
+
+ GetVersionEx(lpVersionInformation);
+
+ switch (VersionInformation.dwPlatformId) {
+ case VER_PLATFORM_WIN32_WINDOWS:
+ bHaveWin95 = TRUE;
+ bHaveWinNT = FALSE;
+ bHaveWin2K = FALSE;
+ break;
+ case VER_PLATFORM_WIN32_NT:
+ bHaveWin95 = FALSE;
+ if (VersionInformation.dwMajorVersion <= 4) {
+ bHaveWinNT = TRUE;
+ bHaveWin2K = FALSE;
+ }
+ else {
+ bHaveWinNT = FALSE;
+ bHaveWin2K = TRUE;
+ }
+ break;
+ case VER_PLATFORM_WIN32s:
+ bHaveWin95 = FALSE;
+ bHaveWinNT = FALSE;
+ bHaveWin2K = FALSE;
+ break;
+ }
+}
+
+// ***********************************************************************
+
+HWND hWndEvent = NULL; // event monitor window
+HWND hWndLastActive = NULL; // last active client window
+LONG __stdcall GLD_EventWndProc(HWND hwnd,UINT msg,WPARAM wParam,LPARAM lParam);
+
+// ***********************************************************************
+
+// Checks if the HGLRC is valid in range of context list.
+BOOL dglIsValidContext(
+ HGLRC a)
+{
+ return ((int)a > 0 && (int)a <= DGL_MAX_CONTEXTS);
+}
+
+// ***********************************************************************
+
+// Convert a HGLRC to a pointer into the context list.
+DGL_ctx* dglGetContextAddress(
+ const HGLRC a)
+{
+ if (dglIsValidContext(a))
+ return &ctxlist[(int)a-1];
+ return NULL;
+}
+
+// ***********************************************************************
+
+// Return the current HGLRC (however it may be stored for multi-threading).
+HGLRC dglGetCurrentContext(void)
+{
+#ifdef GLD_THREADS
+ HGLRC hGLRC;
+ // load from thread-specific instance
+ if (glb.bMultiThreaded) {
+ // protect against calls from arbitrary threads
+ __try {
+ hGLRC = (HGLRC)TlsGetValue(dwTLSCurrentContext);
+ }
+ __except(EXCEPTION_EXECUTE_HANDLER) {
+ hGLRC = iCurrentContext;
+ }
+ }
+ // load from global static var
+ else {
+ hGLRC = iCurrentContext;
+ }
+ return hGLRC;
+#else
+ return iCurrentContext;
+#endif
+}
+
+// ***********************************************************************
+
+// Set the current HGLRC (however it may be stored for multi-threading).
+void dglSetCurrentContext(HGLRC hGLRC)
+{
+#ifdef GLD_THREADS
+ // store in thread-specific instance
+ if (glb.bMultiThreaded) {
+ // protect against calls from arbitrary threads
+ __try {
+ TlsSetValue(dwTLSCurrentContext, (LPVOID)hGLRC);
+ }
+ __except(EXCEPTION_EXECUTE_HANDLER) {
+ iCurrentContext = hGLRC;
+ }
+ }
+ // store in global static var
+ else {
+ iCurrentContext = hGLRC;
+ }
+#else
+ iCurrentContext = hGLRC;
+#endif
+}
+
+// ***********************************************************************
+
+// Return the current HDC only for a currently active HGLRC.
+HDC dglGetCurrentDC(void)
+{
+ HGLRC hGLRC;
+ DGL_ctx* lpCtx;
+
+ hGLRC = dglGetCurrentContext();
+ if (hGLRC) {
+ lpCtx = dglGetContextAddress(hGLRC);
+ return lpCtx->hDC;
+ }
+ return 0;
+}
+
+// ***********************************************************************
+
+void dglInitContextState()
+{
+ int i;
+ WNDCLASS wc;
+
+#ifdef GLD_THREADS
+ // Allocate thread local storage indexes for current context and pixel format
+ dwTLSCurrentContext = TlsAlloc();
+ dwTLSPixelFormat = TlsAlloc();
+#endif
+
+ dglSetCurrentContext(NULL); // No current rendering context
+
+ // Clear all context data
+ ZeroMemory(ctxlist, sizeof(ctxlist[0]) * DGL_MAX_CONTEXTS);
+
+ for (i=0; i<DGL_MAX_CONTEXTS; i++)
+ ctxlist[i].bAllocated = FALSE; // Flag context as unused
+
+ // This section of code crashes the dll in circumstances where the app
+ // creates and destroys contexts.
+/*
+ // Register the class for our event monitor window
+ wc.style = 0;
+ wc.lpfnWndProc = GLD_EventWndProc;
+ wc.cbClsExtra = 0;
+ wc.cbWndExtra = 0;
+ wc.hInstance = GetModuleHandle(NULL);
+ wc.hIcon = LoadIcon(GetModuleHandle(NULL), IDI_APPLICATION);
+ wc.hCursor = LoadCursor(NULL, IDC_ARROW);
+ wc.hbrBackground = (HBRUSH)GetStockObject(BLACK_BRUSH);
+ wc.lpszMenuName = NULL;
+ wc.lpszClassName = "GLDIRECT";
+ RegisterClass(&wc);
+
+ // Create the non-visible window to monitor all broadcast messages
+ hWndEvent = CreateWindowEx(
+ WS_EX_TOOLWINDOW,"GLDIRECT","GLDIRECT",WS_POPUP,
+ 0,0,0,0,
+ NULL,NULL,GetModuleHandle(NULL),NULL);
+*/
+
+#ifdef GLD_THREADS
+ // Create a critical section object for serializing access to
+ // DirectDraw and DDStereo create/destroy functions in multiple threads
+ if (glb.bMultiThreaded)
+ InitializeCriticalSection(&CriticalSection);
+#endif
+
+ // Context state is now initialized and ready
+ bContextReady = TRUE;
+}
+
+// ***********************************************************************
+
+void dglDeleteContextState()
+{
+ int i;
+ static BOOL bOnceIsEnough = FALSE;
+
+ // Only call once, from either DGL_exitDriver(), or DLL_PROCESS_DETACH
+ if (bOnceIsEnough)
+ return;
+ bOnceIsEnough = TRUE;
+
+ for (i=0; i<DGL_MAX_CONTEXTS; i++) {
+ if (ctxlist[i].bAllocated == TRUE) {
+ ddlogPrintf(DDLOG_WARN, "** Context %i not deleted - cleaning up.", (i+1));
+ dglDeleteContext((HGLRC)(i+1));
+ }
+ }
+
+ // Context state is no longer ready
+ bContextReady = FALSE;
+
+ // If executed when DLL unloads, DDraw objects may be invalid.
+ // So catch any page faults with this exception handler.
+__try {
+
+ // Release final DirectDraw interfaces
+ if (glb.bDirectDrawPersistant) {
+// RELEASE(glb.lpGlobalPalette);
+// RELEASE(glb.lpDepth4);
+// RELEASE(glb.lpBack4);
+// RELEASE(glb.lpPrimary4);
+// RELEASE(glb.lpDD4);
+ }
+}
+__except(EXCEPTION_EXECUTE_HANDLER) {
+ ddlogPrintf(DDLOG_WARN, "Exception raised in dglDeleteContextState.");
+}
+
+ // Destroy our event monitor window
+ if (hWndEvent) {
+ DestroyWindow(hWndEvent);
+ hWndEvent = hWndLastActive = NULL;
+ }
+
+#ifdef GLD_THREADS
+ // Destroy the critical section object
+ if (glb.bMultiThreaded)
+ DeleteCriticalSection(&CriticalSection);
+
+ // Release thread local storage indexes for current HGLRC and pixel format
+ TlsFree(dwTLSPixelFormat);
+ TlsFree(dwTLSCurrentContext);
+#endif
+}
+
+// ***********************************************************************
+
+// Application Window message handler interception
+static LONG __stdcall dglWndProc(
+ HWND hwnd,
+ UINT msg,
+ WPARAM wParam,
+ LPARAM lParam)
+{
+ DGL_ctx* lpCtx = NULL;
+ LONG lpfnWndProc = 0L;
+ int i;
+ HGLRC hGLRC;
+ RECT rect;
+ PAINTSTRUCT ps;
+ BOOL bQuit = FALSE;
+ BOOL bMain = FALSE;
+ LONG rc;
+
+ // Get the window's message handler *before* it is unhooked in WM_DESTROY
+
+ // Is this the main window?
+ if (hwnd == glb.hWndActive) {
+ bMain = TRUE;
+ lpfnWndProc = glb.lpfnWndProc;
+ }
+ // Search for DGL context matching window handle
+ for (i=0; i<DGL_MAX_CONTEXTS; i++) {
+ if (ctxlist[i].hWnd == hwnd) {
+ lpCtx = &ctxlist[i];
+ lpfnWndProc = lpCtx->lpfnWndProc;
+ break;
+ }
+ }
+ // Not one of ours...
+ if (!lpfnWndProc)
+ return DefWindowProc(hwnd, msg, wParam, lParam);
+
+ // Intercept messages amd process *before* passing on to window
+ switch (msg) {
+#ifdef _USE_GLD3_WGL
+ case WM_DISPLAYCHANGE:
+ glb.bPixelformatsDirty = TRUE;
+ break;
+#endif
+ case WM_ACTIVATEAPP:
+ glb.bAppActive = (BOOL)wParam;
+ ddlogPrintf(DDLOG_INFO, "Calling app has been %s", glb.bAppActive ? "activated" : "de-activated");
+ break;
+ case WM_ERASEBKGND:
+ // Eat the GDI erase event for the GL window
+ if (!lpCtx || !lpCtx->bHasBeenCurrent)
+ break;
+ lpCtx->bGDIEraseBkgnd = TRUE;
+ return TRUE;
+ case WM_PAINT:
+ // Eat the invalidated update region if render scene is in progress
+ if (!lpCtx || !lpCtx->bHasBeenCurrent)
+ break;
+ if (lpCtx->bFrameStarted) {
+ if (GetUpdateRect(hwnd, &rect, FALSE)) {
+ BeginPaint(hwnd, &ps);
+ EndPaint(hwnd, &ps);
+ ValidateRect(hwnd, &rect);
+ return TRUE;
+ }
+ }
+ break;
+ }
+ // Call the appropriate window message handler
+ rc = CallWindowProc((WNDPROC)lpfnWndProc, hwnd, msg, wParam, lParam);
+
+ // Intercept messages and process *after* passing on to window
+ switch (msg) {
+ case WM_QUIT:
+ case WM_DESTROY:
+ bQuit = TRUE;
+ if (lpCtx && lpCtx->bAllocated) {
+ ddlogPrintf(DDLOG_WARN, "WM_DESTROY detected for HWND=%X, HDC=%X, HGLRC=%d", hwnd, lpCtx->hDC, i+1);
+ dglDeleteContext((HGLRC)(i+1));
+ }
+ break;
+#if 0
+ case WM_SIZE:
+ // Resize surfaces to fit window but not viewport (in case app did not bother)
+ if (!lpCtx || !lpCtx->bHasBeenCurrent)
+ break;
+ w = LOWORD(lParam);
+ h = HIWORD(lParam);
+ if (lpCtx->dwWidth < w || lpCtx->dwHeight < h) {
+ if (!dglWglResizeBuffers(lpCtx->glCtx, TRUE))
+ dglWglResizeBuffers(lpCtx->glCtx, FALSE);
+ }
+ break;
+#endif
+ }
+
+ // If the main window is quitting, then so should we...
+ if (bMain && bQuit) {
+ ddlogPrintf(DDLOG_SYSTEM, "shutting down after WM_DESTROY detected for main HWND=%X", hwnd);
+ dglDeleteContextState();
+ dglExitDriver();
+ }
+
+ return rc;
+}
+
+// ***********************************************************************
+
+// Driver Window message handler
+static LONG __stdcall GLD_EventWndProc(
+ HWND hwnd,
+ UINT msg,
+ WPARAM wParam,
+ LPARAM lParam)
+{
+ switch (msg) {
+ // May be sent by splash screen dialog on exit
+ case WM_ACTIVATE:
+ if (LOWORD(wParam) == WA_ACTIVE && glb.hWndActive) {
+ SetForegroundWindow(glb.hWndActive);
+ return 0;
+ }
+ break;
+ }
+ return DefWindowProc(hwnd, msg, wParam, lParam);
+}
+
+// ***********************************************************************
+
+// Intercepted Keyboard handler for detecting hot keys.
+LRESULT CALLBACK dglKeyProc(
+ int code,
+ WPARAM wParam,
+ LPARAM lParam)
+{
+ HWND hWnd, hWndFrame;
+ HGLRC hGLRC = NULL;
+ DGL_ctx* lpCtx = NULL;
+ int cmd = 0, dx1 = 0, dx2 = 0, i;
+ static BOOL bAltPressed = FALSE;
+ static BOOL bCtrlPressed = FALSE;
+ static BOOL bShiftPressed = FALSE;
+ RECT r, rf, rc;
+ POINT pt;
+ BOOL bForceReshape = FALSE;
+
+ return CallNextHookEx(hKeyHook, code, wParam, lParam);
+}
+
+// ***********************************************************************
+
+HWND hWndMatch;
+
+// Window handle enumeration procedure.
+BOOL CALLBACK dglEnumChildProc(
+ HWND hWnd,
+ LPARAM lParam)
+{
+ RECT rect;
+
+ // Find window handle with matching client rect.
+ GetClientRect(hWnd, &rect);
+ if (EqualRect(&rect, (RECT*)lParam)) {
+ hWndMatch = hWnd;
+ return FALSE;
+ }
+ // Continue with next child window.
+ return TRUE;
+}
+
+// ***********************************************************************
+
+// Find window handle with matching client rect.
+HWND dglFindWindowRect(
+ RECT* pRect)
+{
+ hWndMatch = NULL;
+ EnumChildWindows(GetForegroundWindow(), dglEnumChildProc, (LPARAM)pRect);
+ return hWndMatch;
+}
+
+// ***********************************************************************
+#ifndef _USE_GLD3_WGL
+void dglChooseDisplayMode(
+ DGL_ctx *lpCtx)
+{
+ // Note: Choose an exact match if possible.
+
+ int i;
+ DWORD area;
+ DWORD bestarea;
+ DDSURFACEDESC2 *lpDDSD = NULL; // Mode list pointer
+ DDSURFACEDESC2 *lpBestDDSD = NULL; // Pointer to best
+
+ lpDDSD = glb.lpDisplayModes;
+ for (i=0; i<glb.nDisplayModeCount; i++, lpDDSD++) {
+ if ((lpDDSD->dwWidth == lpCtx->dwWidth) &&
+ (lpDDSD->dwHeight == lpCtx->dwHeight))
+ goto matched; // Mode has been exactly matched
+ // Choose modes that are larger in both dimensions than
+ // the window, but smaller in area than the current best.
+ if ( (lpDDSD->dwWidth >= lpCtx->dwWidth) &&
+ (lpDDSD->dwHeight >= lpCtx->dwHeight))
+ {
+ if (lpBestDDSD == NULL) {
+ lpBestDDSD = lpDDSD;
+ bestarea = lpDDSD->dwWidth * lpDDSD->dwHeight;
+ continue;
+ }
+ area = lpDDSD->dwWidth * lpDDSD->dwHeight;
+ if (area < bestarea) {
+ lpBestDDSD = lpDDSD;
+ bestarea = area;
+ }
+ }
+ }
+
+ // Safety check
+ if (lpBestDDSD == NULL) {
+ ddlogMessage(DDLOG_CRITICAL, "dglChooseDisplayMode");
+ return;
+ }
+
+ lpCtx->dwModeWidth = lpBestDDSD->dwWidth;
+ lpCtx->dwModeHeight = lpBestDDSD->dwHeight;
+matched:
+ ddlogPrintf(DDLOG_INFO, "Matched (%ldx%ld) to (%ldx%ld)",
+ lpCtx->dwWidth, lpCtx->dwHeight, lpCtx->dwModeWidth, lpCtx->dwModeHeight);
+}
+#endif // _USE_GLD3_WGL
+// ***********************************************************************
+
+static BOOL IsDevice(
+ DWORD *lpDeviceIdList,
+ DWORD dwDeviceId,
+ int count)
+{
+ int i;
+
+ for (i=0; i<count; i++)
+ if (dwDeviceId == lpDeviceIdList[i])
+ return TRUE;
+
+ return FALSE;
+}
+
+// ***********************************************************************
+
+void dglTestForBrokenCards(
+ DGL_ctx *lpCtx)
+{
+#ifndef _GLD3
+ DDDEVICEIDENTIFIER dddi; // DX6 device identifier
+
+ // Sanity check.
+ if (lpCtx == NULL) {
+ // Testing for broken cards is sensitive area, so we don't want
+ // anything saying "broken cards" in the error message. ;)
+ ddlogMessage(DDLOG_ERROR, "Null context passed to TFBC\n");
+ return;
+ }
+
+ if (lpCtx->lpDD4 == NULL) {
+ // Testing for broken cards is sensitive area, so we don't want
+ // anything saying "broken cards" in the error message. ;)
+ ddlogMessage(DDLOG_ERROR, "Null DD4 passed to TFBC\n");
+ return;
+ }
+
+ // Microsoft really fucked up with the GetDeviceIdentifier function
+ // on Windows 2000, since it locks up on stock driers on the CD. Updated
+ // drivers from vendors appear to work, but we can't identify the drivers
+ // without this function!!! For now we skip these tests on Windows 2000.
+ if ((GetVersion() & 0x80000000UL) == 0)
+ return;
+
+ // Obtain device info
+ if (FAILED(IDirectDraw4_GetDeviceIdentifier(lpCtx->lpDD4, &dddi, 0)))
+ return;
+
+ // Useful info. Log it.
+ ddlogPrintf(DDLOG_INFO, "DirectDraw: VendorId=0x%x, DeviceId=0x%x", dddi.dwVendorId, dddi.dwDeviceId);
+
+ // Vendor 1: ATI
+ if (dddi.dwVendorId == VENDORID_ATI) {
+ // Test A: ATI Rage PRO
+ if (IsDevice(devATIRagePro, dddi.dwDeviceId, sizeof(devATIRagePro)))
+ glb.bUseMipmaps = FALSE;
+ // Test B: ATI Rage II+
+ if (IsDevice(devATIRageIIplus, dddi.dwDeviceId, sizeof(devATIRageIIplus)))
+ glb.bEmulateAlphaTest = TRUE;
+ }
+
+ // Vendor 2: Matrox
+ if (dddi.dwVendorId == 0x102B) {
+ // Test: Matrox G400 stencil buffer support does not work for AutoCAD
+ if (dddi.dwDeviceId == 0x0525) {
+ lpCtx->lpPF->pfd.cStencilBits = 0;
+ if (lpCtx->lpPF->iZBufferPF != -1) {
+ glb.lpZBufferPF[lpCtx->lpPF->iZBufferPF].dwStencilBitDepth = 0;
+ glb.lpZBufferPF[lpCtx->lpPF->iZBufferPF].dwStencilBitMask = 0;
+ glb.lpZBufferPF[lpCtx->lpPF->iZBufferPF].dwFlags &= ~DDPF_STENCILBUFFER;
+ }
+ }
+ }
+#endif // _GLD3
+}
+
+// ***********************************************************************
+
+BOOL dglCreateContextBuffers(
+ HDC a,
+ DGL_ctx *lpCtx,
+ BOOL bFallback)
+{
+ HRESULT hResult;
+
+ int i;
+// HGLRC hGLRC;
+// DGL_ctx* lpCtx;
+
+#ifndef _USE_GLD3_WGL
+ DWORD dwFlags;
+ DDSURFACEDESC2 ddsd2;
+ DDSCAPS2 ddscaps2;
+ LPDIRECTDRAWCLIPPER lpddClipper;
+ D3DDEVICEDESC D3DHWDevDesc; // Direct3D Hardware description
+ D3DDEVICEDESC D3DHELDevDesc; // Direct3D Hardware Emulation Layer
+#endif // _USE_GLD3_WGL
+
+ float inv_aspect;
+
+ GLenum bDoubleBuffer; // TRUE if double buffer required
+ GLenum bDepthBuffer; // TRUE if depth buffer required
+
+ const PIXELFORMATDESCRIPTOR *lpPFD = &lpCtx->lpPF->pfd;
+
+ // Vars for Mesa visual
+ DWORD dwDepthBits = 0;
+ DWORD dwStencilBits = 0;
+ DWORD dwAlphaBits = 0;
+ DWORD bAlphaSW = GL_FALSE;
+ DWORD bDouble = GL_FALSE;
+
+ DDSURFACEDESC2 ddsd2DisplayMode;
+ BOOL bFullScrnWin = FALSE; // fullscreen-size window ?
+ DDBLTFX ddbltfx;
+ DWORD dwMemoryType = (bFallback) ? DDSCAPS_SYSTEMMEMORY : glb.dwMemoryType;
+ BOOL bBogusWindow = FALSE; // non-drawable window ?
+ DWORD dwColorRef = 0; // GDI background color
+ RECT rcDst; // GDI window rect
+ POINT pt; // GDI window point
+
+ // Palette used for creating default global palette
+ PALETTEENTRY ppe[256];
+
+#ifndef _USE_GLD3_WGL
+ // Vertex buffer description. Used for creation of vertex buffers
+ D3DVERTEXBUFFERDESC vbufdesc;
+#endif // _USE_GLD3_WGL
+
+#define DDLOG_CRITICAL_OR_WARN (bFallback ? DDLOG_CRITICAL : DDLOG_WARN)
+
+ ddlogPrintf(DDLOG_SYSTEM, "dglCreateContextBuffers for HDC=%X", a);
+ nContextError = GLDERR_NONE;
+
+#ifdef GLD_THREADS
+ // Serialize access to DirectDraw object creation or DDS start
+ if (glb.bMultiThreaded)
+ EnterCriticalSection(&CriticalSection);
+#endif
+
+ // Check for back buffer
+ bDoubleBuffer = GL_TRUE; //(lpPFD->dwFlags & PFD_DOUBLEBUFFER) ? GL_TRUE : GL_FALSE;
+ // Since we always do back buffering, check if we emulate front buffering
+ lpCtx->EmulateSingle =
+ (lpPFD->dwFlags & PFD_DOUBLEBUFFER) ? FALSE : TRUE;
+#if 0 // Don't have to mimic MS OpenGL behavior for front-buffering (DaveM)
+ lpCtx->EmulateSingle |=
+ (lpPFD->dwFlags & PFD_SUPPORT_GDI) ? TRUE : FALSE;
+#endif
+
+ // Check for depth buffer
+ bDepthBuffer = (lpPFD->cDepthBits) ? GL_TRUE : GL_FALSE;
+
+ lpCtx->bDoubleBuffer = bDoubleBuffer;
+ lpCtx->bDepthBuffer = bDepthBuffer;
+
+ // Set the Fullscreen flag for the context.
+// lpCtx->bFullscreen = glb.bFullscreen;
+
+ // Obtain the dimensions of the rendering window
+ lpCtx->hDC = a; // Cache DC
+ lpCtx->hWnd = WindowFromDC(lpCtx->hDC);
+ // Check for non-window DC = memory DC ?
+ if (lpCtx->hWnd == NULL) {
+ // bitmap memory contexts are always single-buffered
+ lpCtx->EmulateSingle = TRUE;
+ bBogusWindow = TRUE;
+ ddlogPrintf(DDLOG_INFO, "Non-Window Memory Device Context");
+ if (GetClipBox(lpCtx->hDC, &lpCtx->rcScreenRect) == ERROR) {
+ ddlogMessage(DDLOG_WARN, "GetClipBox failed in dglCreateContext\n");
+ SetRect(&lpCtx->rcScreenRect, 0, 0, 0, 0);
+ }
+ }
+ else if (!GetClientRect(lpCtx->hWnd, &lpCtx->rcScreenRect)) {
+ bBogusWindow = TRUE;
+ ddlogMessage(DDLOG_WARN, "GetClientRect failed in dglCreateContext\n");
+ SetRect(&lpCtx->rcScreenRect, 0, 0, 0, 0);
+ }
+ lpCtx->dwWidth = lpCtx->rcScreenRect.right - lpCtx->rcScreenRect.left;
+ lpCtx->dwHeight = lpCtx->rcScreenRect.bottom - lpCtx->rcScreenRect.top;
+
+ ddlogPrintf(DDLOG_INFO, "Input window %X: w=%i, h=%i",
+ lpCtx->hWnd, lpCtx->dwWidth, lpCtx->dwHeight);
+
+ // What if app only zeroes one dimension instead of both? (DaveM)
+ if ( (lpCtx->dwWidth == 0) || (lpCtx->dwHeight == 0) ) {
+ // Make the buffer size something sensible
+ lpCtx->dwWidth = 8;
+ lpCtx->dwHeight = 8;
+ }
+
+ // Set defaults
+ lpCtx->dwModeWidth = lpCtx->dwWidth;
+ lpCtx->dwModeHeight = lpCtx->dwHeight;
+/*
+ // Find best display mode for fullscreen
+ if (glb.bFullscreen || !glb.bPrimary) {
+ dglChooseDisplayMode(lpCtx);
+ }
+*/
+ // Misc initialisation
+ lpCtx->bCanRender = FALSE; // No rendering allowed yet
+ lpCtx->bSceneStarted = FALSE;
+ lpCtx->bFrameStarted = FALSE;
+
+ // Detect OS (specifically 'Windows 2000' or 'Windows XP')
+ DetectOS();
+
+ // NOTE: WinNT not supported
+ ddlogPrintf(DDLOG_INFO, "OS: %s", bHaveWin95 ? "Win9x" : (bHaveWin2K ? "Win2000/XP" : "Unsupported") );
+
+ // Test for Fullscreen
+ if (bHaveWin95) { // Problems with fullscreen on Win2K/XP
+ if ((GetSystemMetrics(SM_CXSCREEN) == lpCtx->dwWidth) &&
+ (GetSystemMetrics(SM_CYSCREEN) == lpCtx->dwHeight))
+ {
+ // Workaround for some apps that crash when going fullscreen.
+ //lpCtx->bFullscreen = TRUE;
+ }
+
+ }
+
+#ifdef _USE_GLD3_WGL
+ _gldDriver.CreateDrawable(lpCtx, glb.bDirectDrawPersistant, glb.bPersistantBuffers);
+#else
+ // Check if DirectDraw has already been created by original GLRC (DaveM)
+ if (glb.bDirectDrawPersistant && glb.bDirectDraw) {
+ lpCtx->lpDD4 = glb.lpDD4;
+ IDirectDraw4_AddRef(lpCtx->lpDD4);
+ goto SkipDirectDrawCreate;
+ }
+
+ // Create DirectDraw object
+ if (glb.bPrimary)
+ hResult = DirectDrawCreate(NULL, &lpCtx->lpDD1, NULL);
+ else {
+ // A non-primary device is to be used.
+ // Force context to be Fullscreen, secondary adaptors can not
+ // be used in a window.
+ hResult = DirectDrawCreate(&glb.ddGuid, &lpCtx->lpDD1, NULL);
+ lpCtx->bFullscreen = TRUE;
+ }
+ if (FAILED(hResult)) {
+ MessageBox(NULL, "Unable to initialize DirectDraw", "GLDirect", MB_OK);
+ ddlogError(DDLOG_CRITICAL_OR_WARN, "Unable to create DirectDraw interface", hResult);
+ nContextError = GLDERR_DDRAW;
+ goto return_with_error;
+ }
+
+ // Query for DX6 IDirectDraw4.
+ hResult = IDirectDraw_QueryInterface(lpCtx->lpDD1,
+ &IID_IDirectDraw4,
+ (void**)&lpCtx->lpDD4);
+ if (FAILED(hResult)) {
+ MessageBox(NULL, "GLDirect requires DirectX 6.0 or above", "GLDirect", MB_OK);
+ ddlogError(DDLOG_CRITICAL_OR_WARN, "Unable to create DirectDraw4 interface", hResult);
+ nContextError = GLDERR_DDRAW;
+ goto return_with_error;
+ }
+
+ // Cache DirectDraw interface for subsequent GLRCs
+ if (glb.bDirectDrawPersistant && !glb.bDirectDraw) {
+ glb.lpDD4 = lpCtx->lpDD4;
+ IDirectDraw4_AddRef(glb.lpDD4);
+ glb.bDirectDraw = TRUE;
+ }
+SkipDirectDrawCreate:
+
+ // Now we have a DD4 interface we can check for broken cards
+ dglTestForBrokenCards(lpCtx);
+
+ // Test if primary device can use flipping instead of blitting
+ ZeroMemory(&ddsd2DisplayMode, sizeof(ddsd2DisplayMode));
+ ddsd2DisplayMode.dwSize = sizeof(ddsd2DisplayMode);
+ hResult = IDirectDraw4_GetDisplayMode(
+ lpCtx->lpDD4,
+ &ddsd2DisplayMode);
+ if (SUCCEEDED(hResult)) {
+ if ( (lpCtx->dwWidth == ddsd2DisplayMode.dwWidth) &&
+ (lpCtx->dwHeight == ddsd2DisplayMode.dwHeight) ) {
+ // We have a fullscreen-size window
+ bFullScrnWin = TRUE;
+ // OK to use DirectDraw fullscreen mode ?
+ if (glb.bPrimary && !glb.bFullscreenBlit && !lpCtx->EmulateSingle && !glb.bDirectDrawPersistant) {
+ lpCtx->bFullscreen = TRUE;
+ ddlogMessage(DDLOG_INFO, "Primary upgraded to page flipping.\n");
+ }
+ }
+ // Cache the display mode dimensions
+ lpCtx->dwModeWidth = ddsd2DisplayMode.dwWidth;
+ lpCtx->dwModeHeight = ddsd2DisplayMode.dwHeight;
+ }
+
+ // Clamp the effective window dimensions to primary surface.
+ // We need to do this for D3D viewport dimensions even if wide
+ // surfaces are supported. This also is a good idea for handling
+ // whacked-out window dimensions passed for non-drawable windows
+ // like Solid Edge. (DaveM)
+ if (lpCtx->dwWidth > ddsd2DisplayMode.dwWidth)
+ lpCtx->dwWidth = ddsd2DisplayMode.dwWidth;
+ if (lpCtx->dwHeight > ddsd2DisplayMode.dwHeight)
+ lpCtx->dwHeight = ddsd2DisplayMode.dwHeight;
+
+ // Check for non-RGB desktop resolution
+ if (!lpCtx->bFullscreen && ddsd2DisplayMode.ddpfPixelFormat.dwRGBBitCount <= 8) {
+ ddlogPrintf(DDLOG_CRITICAL_OR_WARN, "Desktop color depth %d bpp not supported",
+ ddsd2DisplayMode.ddpfPixelFormat.dwRGBBitCount);
+ nContextError = GLDERR_BPP;
+ goto return_with_error;
+ }
+#endif // _USE_GLD3_WGL
+
+ ddlogPrintf(DDLOG_INFO, "Window: w=%i, h=%i (%s)",
+ lpCtx->dwWidth,
+ lpCtx->dwHeight,
+ lpCtx->bFullscreen ? "fullscreen" : "windowed");
+
+#ifndef _USE_GLD3_WGL
+ // Obtain ddraw caps
+ ZeroMemory(&lpCtx->ddCaps, sizeof(DDCAPS));
+ lpCtx->ddCaps.dwSize = sizeof(DDCAPS);
+ if (glb.bHardware) {
+ // Get HAL caps
+ IDirectDraw4_GetCaps(lpCtx->lpDD4, &lpCtx->ddCaps, NULL);
+ } else {
+ // Get HEL caps
+ IDirectDraw4_GetCaps(lpCtx->lpDD4, NULL, &lpCtx->ddCaps);
+ }
+
+ // If this flag is present then we can't default to Mesa
+ // SW rendering between BeginScene() and EndScene().
+ if (lpCtx->ddCaps.dwCaps2 & DDCAPS2_NO2DDURING3DSCENE) {
+ ddlogMessage(DDLOG_INFO,
+ "Warning : No 2D allowed during 3D scene.\n");
+ }
+
+ // Query for DX6 Direct3D3 interface
+ hResult = IDirectDraw4_QueryInterface(lpCtx->lpDD4,
+ &IID_IDirect3D3,
+ (void**)&lpCtx->lpD3D3);
+ if (FAILED(hResult)) {
+ MessageBox(NULL, "Unable to initialize Direct3D", "GLDirect", MB_OK);
+ ddlogError(DDLOG_CRITICAL_OR_WARN, "Unable to create Direct3D interface", hResult);
+ nContextError = GLDERR_D3D;
+ goto return_with_error;
+ }
+
+ // Context creation
+ if (lpCtx->bFullscreen) {
+ // FULLSCREEN
+
+ // Disable warning popups when in fullscreen mode
+ ddlogWarnOption(FALSE);
+
+ // Have to release persistant primary surface if fullscreen mode
+ if (glb.bDirectDrawPersistant && glb.bDirectDrawPrimary) {
+ RELEASE(glb.lpPrimary4);
+ glb.bDirectDrawPrimary = FALSE;
+ }
+
+ dwFlags = DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN | DDSCL_ALLOWREBOOT;
+ if (glb.bFastFPU)
+ dwFlags |= DDSCL_FPUSETUP; // fast FPU setup optional (DaveM)
+ hResult = IDirectDraw4_SetCooperativeLevel(lpCtx->lpDD4, lpCtx->hWnd, dwFlags);
+ if (FAILED(hResult)) {
+ ddlogError(DDLOG_CRITICAL_OR_WARN, "Unable to set Exclusive Fullscreen mode", hResult);
+ goto return_with_error;
+ }
+
+ hResult = IDirectDraw4_SetDisplayMode(lpCtx->lpDD4,
+ lpCtx->dwModeWidth,
+ lpCtx->dwModeHeight,
+ lpPFD->cColorBits,
+ 0,
+ 0);
+ if (FAILED(hResult)) {
+ ddlogError(DDLOG_CRITICAL_OR_WARN, "SetDisplayMode failed", hResult);
+ goto return_with_error;
+ }
+
+ // ** The display mode has changed, so dont use MessageBox! **
+
+ ZeroMemory(&ddsd2, sizeof(ddsd2));
+ ddsd2.dwSize = sizeof(ddsd2);
+
+ if (bDoubleBuffer) {
+ // Double buffered
+ // Primary surface
+ ddsd2.dwFlags = DDSD_CAPS | DDSD_BACKBUFFERCOUNT;
+ ddsd2.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE |
+ DDSCAPS_FLIP |
+ DDSCAPS_COMPLEX |
+ DDSCAPS_3DDEVICE |
+ dwMemoryType;
+ ddsd2.dwBackBufferCount = 1;
+
+ hResult = IDirectDraw4_CreateSurface(lpCtx->lpDD4, &ddsd2, &lpCtx->lpFront4, NULL);
+ if (FAILED(hResult)) {
+ ddlogError(DDLOG_CRITICAL_OR_WARN, "CreateSurface (primary) failed", hResult);
+ nContextError = GLDERR_MEM;
+ goto return_with_error;
+ }
+
+ // Render target surface
+ ZeroMemory(&ddscaps2, sizeof(ddscaps2)); // Clear the entire struct.
+ ddscaps2.dwCaps = DDSCAPS_BACKBUFFER;
+ hResult = IDirectDrawSurface4_GetAttachedSurface(lpCtx->lpFront4, &ddscaps2, &lpCtx->lpBack4);
+ if (FAILED(hResult)) {
+ ddlogError(DDLOG_CRITICAL_OR_WARN, "GetAttachedSurface failed", hResult);
+ nContextError = GLDERR_MEM;
+ goto return_with_error;
+ }
+ } else {
+ // Single buffered
+ // Primary surface
+ ddsd2.dwFlags = DDSD_CAPS;
+ ddsd2.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE |
+ //DDSCAPS_3DDEVICE |
+ dwMemoryType;
+
+ hResult = IDirectDraw4_CreateSurface(lpCtx->lpDD4, &ddsd2, &lpCtx->lpFront4, NULL);
+ if (FAILED(hResult)) {
+ ddlogError(DDLOG_CRITICAL_OR_WARN, "CreateSurface (primary) failed", hResult);
+ nContextError = GLDERR_MEM;
+ goto return_with_error;
+ }
+
+ lpCtx->lpBack4 = NULL;
+ }
+ } else {
+ // WINDOWED
+
+ // OK to enable warning popups in windowed mode
+ ddlogWarnOption(glb.bMessageBoxWarnings);
+
+ dwFlags = DDSCL_NORMAL;
+ if (glb.bMultiThreaded)
+ dwFlags |= DDSCL_MULTITHREADED;
+ if (glb.bFastFPU)
+ dwFlags |= DDSCL_FPUSETUP; // fast FPU setup optional (DaveM)
+ hResult = IDirectDraw4_SetCooperativeLevel(lpCtx->lpDD4,
+ lpCtx->hWnd,
+ dwFlags);
+ if (FAILED(hResult)) {
+ ddlogError(DDLOG_CRITICAL_OR_WARN, "Unable to set Normal coop level", hResult);
+ goto return_with_error;
+ }
+ // Has Primary surface already been created for original GLRC ?
+ // Note this can only be applicable for windowed modes
+ if (glb.bDirectDrawPersistant && glb.bDirectDrawPrimary) {
+ lpCtx->lpFront4 = glb.lpPrimary4;
+ IDirectDrawSurface4_AddRef(lpCtx->lpFront4);
+ // Update the window on the default clipper
+ IDirectDrawSurface4_GetClipper(lpCtx->lpFront4, &lpddClipper);
+ IDirectDrawClipper_SetHWnd(lpddClipper, 0, lpCtx->hWnd);
+ IDirectDrawClipper_Release(lpddClipper);
+ goto SkipPrimaryCreate;
+ }
+
+ // Primary surface
+ ZeroMemory(&ddsd2, sizeof(ddsd2));
+ ddsd2.dwSize = sizeof(ddsd2);
+ ddsd2.dwFlags = DDSD_CAPS;
+ ddsd2.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE;
+ hResult = IDirectDraw4_CreateSurface(lpCtx->lpDD4, &ddsd2, &lpCtx->lpFront4, NULL);
+ if (FAILED(hResult)) {
+ ddlogError(DDLOG_CRITICAL_OR_WARN, "CreateSurface (primary) failed", hResult);
+ nContextError = GLDERR_MEM;
+ goto return_with_error;
+ }
+
+ // Cache Primary surface for subsequent GLRCs
+ // Note this can only be applicable to subsequent windowed modes
+ if (glb.bDirectDrawPersistant && !glb.bDirectDrawPrimary) {
+ glb.lpPrimary4 = lpCtx->lpFront4;
+ IDirectDrawSurface4_AddRef(glb.lpPrimary4);
+ glb.bDirectDrawPrimary = TRUE;
+ }
+
+ // Clipper object
+ hResult = DirectDrawCreateClipper(0, &lpddClipper, NULL);
+ if (FAILED(hResult)) {
+ ddlogError(DDLOG_CRITICAL_OR_WARN, "CreateClipper failed", hResult);
+ goto return_with_error;
+ }
+ hResult = IDirectDrawClipper_SetHWnd(lpddClipper, 0, lpCtx->hWnd);
+ if (FAILED(hResult)) {
+ RELEASE(lpddClipper);
+ ddlogError(DDLOG_CRITICAL_OR_WARN, "SetHWnd failed", hResult);
+ goto return_with_error;
+ }
+ hResult = IDirectDrawSurface4_SetClipper(lpCtx->lpFront4, lpddClipper);
+ RELEASE(lpddClipper); // We have finished with it.
+ if (FAILED(hResult)) {
+ ddlogError(DDLOG_CRITICAL_OR_WARN, "SetClipper failed", hResult);
+ goto return_with_error;
+ }
+SkipPrimaryCreate:
+
+ if (bDoubleBuffer) {
+ // Render target surface
+ ZeroMemory(&ddsd2, sizeof(ddsd2));
+ ddsd2.dwSize = sizeof(ddsd2);
+ ddsd2.dwFlags = DDSD_CAPS | DDSD_WIDTH | DDSD_HEIGHT;
+ ddsd2.dwWidth = lpCtx->dwWidth;
+ ddsd2.dwHeight = lpCtx->dwHeight;
+ ddsd2.ddsCaps.dwCaps = DDSCAPS_3DDEVICE |
+ DDSCAPS_OFFSCREENPLAIN |
+ dwMemoryType;
+
+ // Reserve the entire desktop size for persistant buffers option
+ if (glb.bDirectDrawPersistant && glb.bPersistantBuffers) {
+ ddsd2.dwWidth = ddsd2DisplayMode.dwWidth;
+ ddsd2.dwHeight = ddsd2DisplayMode.dwHeight;
+ }
+ // Re-use original back buffer if persistant buffers exist
+ if (glb.bDirectDrawPersistant && glb.bPersistantBuffers && glb.lpBack4)
+ hResult = IDirectDrawSurface4_AddRef(lpCtx->lpBack4 = glb.lpBack4);
+ else
+ hResult = IDirectDraw4_CreateSurface(lpCtx->lpDD4, &ddsd2, &lpCtx->lpBack4, NULL);
+ if (FAILED(hResult)) {
+ ddlogError(DDLOG_CRITICAL_OR_WARN, "Create Backbuffer failed", hResult);
+ nContextError = GLDERR_MEM;
+ goto return_with_error;
+ }
+ if (glb.bDirectDrawPersistant && glb.bPersistantBuffers && !glb.lpBack4)
+ IDirectDrawSurface4_AddRef(glb.lpBack4 = lpCtx->lpBack4);
+ } else {
+ lpCtx->lpBack4 = NULL;
+ }
+ }
+
+ //
+ // Now create the Z-buffer
+ //
+ lpCtx->bStencil = FALSE; // Default to no stencil buffer
+ if (bDepthBuffer && (lpCtx->lpPF->iZBufferPF != -1)) {
+ // Get z-buffer dimensions from the render target
+ // Setup the surface desc for the z-buffer.
+ ZeroMemory(&ddsd2, sizeof(ddsd2));
+ ddsd2.dwSize = sizeof(ddsd2);
+ ddsd2.dwFlags = DDSD_CAPS | DDSD_WIDTH | DDSD_HEIGHT | DDSD_PIXELFORMAT;
+ ddsd2.ddsCaps.dwCaps = DDSCAPS_ZBUFFER | dwMemoryType;
+ ddsd2.dwWidth = lpCtx->dwWidth;
+ ddsd2.dwHeight = lpCtx->dwHeight;
+ memcpy(&ddsd2.ddpfPixelFormat,
+ &glb.lpZBufferPF[lpCtx->lpPF->iZBufferPF],
+ sizeof(DDPIXELFORMAT) );
+
+ // Reserve the entire desktop size for persistant buffers option
+ if (glb.bDirectDrawPersistant && glb.bPersistantBuffers) {
+ ddsd2.dwWidth = ddsd2DisplayMode.dwWidth;
+ ddsd2.dwHeight = ddsd2DisplayMode.dwHeight;
+ }
+
+ // Create a z-buffer
+ if (glb.bDirectDrawPersistant && glb.bPersistantBuffers && glb.lpDepth4)
+ hResult = IDirectDrawSurface4_AddRef(lpCtx->lpDepth4 = glb.lpDepth4);
+ else
+ hResult = IDirectDraw4_CreateSurface(lpCtx->lpDD4, &ddsd2, &lpCtx->lpDepth4, NULL);
+ if (FAILED(hResult)) {
+ ddlogError(DDLOG_CRITICAL_OR_WARN, "CreateSurface (ZBuffer) failed", hResult);
+ nContextError = GLDERR_MEM;
+ goto return_with_error;
+ }
+ if (glb.bDirectDrawPersistant && glb.bPersistantBuffers && !glb.lpDepth4)
+ IDirectDrawSurface4_AddRef(glb.lpDepth4 = lpCtx->lpDepth4);
+ else if (glb.bDirectDrawPersistant && glb.bPersistantBuffers && glb.lpDepth4 && glb.lpBack4)
+ IDirectDrawSurface4_DeleteAttachedSurface(glb.lpBack4, 0, glb.lpDepth4);
+
+ // Attach Zbuffer to render target
+ TRY(IDirectDrawSurface4_AddAttachedSurface(
+ bDoubleBuffer ? lpCtx->lpBack4 : lpCtx->lpFront4,
+ lpCtx->lpDepth4),
+ "dglCreateContext: Attach Zbuffer");
+ if (glb.lpZBufferPF[lpCtx->lpPF->iZBufferPF].dwFlags & DDPF_STENCILBUFFER) {
+ lpCtx->bStencil = TRUE;
+ ddlogMessage(DDLOG_INFO, "Depth buffer has stencil\n");
+ }
+ }
+
+ // Clear all back buffers and Z-buffers in case of memory recycling.
+ ZeroMemory(&ddbltfx, sizeof(ddbltfx));
+ ddbltfx.dwSize = sizeof(ddbltfx);
+ IDirectDrawSurface4_Blt(lpCtx->lpBack4, NULL, NULL, NULL,
+ DDBLT_COLORFILL | DDBLT_WAIT, &ddbltfx);
+ if (lpCtx->lpDepth4)
+ IDirectDrawSurface4_Blt(lpCtx->lpDepth4, NULL, NULL, NULL,
+ DDBLT_COLORFILL | DDBLT_WAIT, &ddbltfx);
+
+ // Now that we have a Z-buffer we can create the 3D device
+ hResult = IDirect3D3_CreateDevice(lpCtx->lpD3D3,
+ &glb.d3dGuid,
+ bDoubleBuffer ? lpCtx->lpBack4 : lpCtx->lpFront4,
+ &lpCtx->lpDev3,
+ NULL);
+ if (FAILED(hResult)) {
+ ddlogError(DDLOG_CRITICAL_OR_WARN, "Unable to create Direct3D device", hResult);
+ nContextError = GLDERR_D3D;
+ goto return_with_error;
+ }
+
+ // We must do this as soon as the device is created
+ dglInitStateCaches(lpCtx);
+
+ // Obtain the D3D Device Description
+ D3DHWDevDesc.dwSize = D3DHELDevDesc.dwSize = sizeof(D3DDEVICEDESC);
+ TRY(IDirect3DDevice3_GetCaps(lpCtx->lpDev3,
+ &D3DHWDevDesc,
+ &D3DHELDevDesc),
+ "dglCreateContext: GetCaps failed");
+
+ // Choose the relevant description and cache it in the context.
+ // We will use this description later for caps checking
+ memcpy( &lpCtx->D3DDevDesc,
+ glb.bHardware ? &D3DHWDevDesc : &D3DHELDevDesc,
+ sizeof(D3DDEVICEDESC));
+
+ // Now we can examine the texture formats
+ if (!dglBuildTextureFormatList(lpCtx->lpDev3)) {
+ ddlogMessage(DDLOG_CRITICAL_OR_WARN, "dglBuildTextureFormatList failed\n");
+ goto return_with_error;
+ }
+
+ // Get the pixel format of the back buffer
+ lpCtx->ddpfRender.dwSize = sizeof(lpCtx->ddpfRender);
+ if (bDoubleBuffer)
+ hResult = IDirectDrawSurface4_GetPixelFormat(
+ lpCtx->lpBack4,
+ &lpCtx->ddpfRender);
+ else
+ hResult = IDirectDrawSurface4_GetPixelFormat(
+ lpCtx->lpFront4,
+ &lpCtx->ddpfRender);
+
+ if (FAILED(hResult)) {
+ ddlogError(DDLOG_CRITICAL_OR_WARN, "GetPixelFormat failed", hResult);
+ goto return_with_error;
+ }
+ // Find a pixel packing function suitable for this surface
+ pxClassifyPixelFormat(&lpCtx->ddpfRender,
+ &lpCtx->fnPackFunc,
+ &lpCtx->fnUnpackFunc,
+ &lpCtx->fnPackSpanFunc);
+
+ // Viewport
+ hResult = IDirect3D3_CreateViewport(lpCtx->lpD3D3, &lpCtx->lpViewport3, NULL);
+ if (FAILED(hResult)) {
+ ddlogError(DDLOG_CRITICAL_OR_WARN, "CreateViewport failed", hResult);
+ goto return_with_error;
+ }
+
+ hResult = IDirect3DDevice3_AddViewport(lpCtx->lpDev3, lpCtx->lpViewport3);
+ if (FAILED(hResult)) {
+ ddlogError(DDLOG_CRITICAL_OR_WARN, "AddViewport failed", hResult);
+ goto return_with_error;
+ }
+
+ // Initialise the viewport
+ // Note screen coordinates are used for viewport clipping since D3D
+ // transform operations are not used in the GLD CAD driver. (DaveM)
+ inv_aspect = (float)lpCtx->dwHeight/(float)lpCtx->dwWidth;
+
+ lpCtx->d3dViewport.dwSize = sizeof(lpCtx->d3dViewport);
+ lpCtx->d3dViewport.dwX = 0;
+ lpCtx->d3dViewport.dwY = 0;
+ lpCtx->d3dViewport.dwWidth = lpCtx->dwWidth;
+ lpCtx->d3dViewport.dwHeight = lpCtx->dwHeight;
+ lpCtx->d3dViewport.dvClipX = 0; // -1.0f;
+ lpCtx->d3dViewport.dvClipY = 0; // inv_aspect;
+ lpCtx->d3dViewport.dvClipWidth = lpCtx->dwWidth; // 2.0f;
+ lpCtx->d3dViewport.dvClipHeight = lpCtx->dwHeight; // 2.0f * inv_aspect;
+ lpCtx->d3dViewport.dvMinZ = 0.0f;
+ lpCtx->d3dViewport.dvMaxZ = 1.0f;
+ TRY(IDirect3DViewport3_SetViewport2(lpCtx->lpViewport3, &lpCtx->d3dViewport), "dglCreateContext: SetViewport2");
+
+ hResult = IDirect3DDevice3_SetCurrentViewport(lpCtx->lpDev3, lpCtx->lpViewport3);
+ if (FAILED(hResult)) {
+ ddlogError(DDLOG_CRITICAL_OR_WARN, "SetCurrentViewport failed", hResult);
+ goto return_with_error;
+ }
+
+ lpCtx->dwBPP = lpPFD->cColorBits;
+ lpCtx->iZBufferPF = lpCtx->lpPF->iZBufferPF;
+
+ // Set last texture to NULL
+ for (i=0; i<MAX_TEXTURE_UNITS; i++) {
+ lpCtx->ColorOp[i] = D3DTOP_DISABLE;
+ lpCtx->AlphaOp[i] = D3DTOP_DISABLE;
+ lpCtx->tObj[i] = NULL;
+ }
+
+ // Default to perspective correct texture mapping
+ dglSetRenderState(lpCtx, D3DRENDERSTATE_TEXTUREPERSPECTIVE, TRUE, "TexturePersp");
+
+ // Set the default culling mode
+ lpCtx->cullmode = D3DCULL_NONE;
+ dglSetRenderState(lpCtx, D3DRENDERSTATE_CULLMODE, D3DCULL_NONE, "CullMode");
+
+ // Disable specular
+ dglSetRenderState(lpCtx, D3DRENDERSTATE_SPECULARENABLE, FALSE, "SpecularEnable");
+ // Disable subpixel correction
+// dglSetRenderState(lpCtx, D3DRENDERSTATE_SUBPIXEL, FALSE, "SubpixelEnable");
+ // Disable dithering
+ dglSetRenderState(lpCtx, D3DRENDERSTATE_DITHERENABLE, FALSE, "DitherEnable");
+
+ // Initialise the primitive caches
+// lpCtx->dwNextLineVert = 0;
+// lpCtx->dwNextTriVert = 0;
+
+ // Init the global texture palette
+ lpCtx->lpGlobalPalette = NULL;
+
+ // Init the HW/SW usage counters
+// lpCtx->dwHWUsageCount = lpCtx->dwSWUsageCount = 0L;
+
+ //
+ // Create two D3D vertex buffers.
+ // One will hold the pre-transformed data with the other one
+ // being used to hold the post-transformed & clipped verts.
+ //
+#if 0 // never used (DaveM)
+ vbufdesc.dwSize = sizeof(D3DVERTEXBUFFERDESC);
+ vbufdesc.dwCaps = D3DVBCAPS_WRITEONLY;
+ if (glb.bHardware == FALSE)
+ vbufdesc.dwCaps = D3DVBCAPS_SYSTEMMEMORY;
+ vbufdesc.dwNumVertices = 32768; // For the time being
+
+ // Source vertex buffer
+ vbufdesc.dwFVF = DGL_LVERTEX;
+ hResult = IDirect3D3_CreateVertexBuffer(lpCtx->lpD3D3, &vbufdesc, &lpCtx->m_vbuf, 0, NULL);
+ if (FAILED(hResult)) {
+ ddlogError(DDLOG_CRITICAL_OR_WARN, "CreateVertexBuffer(src) failed", hResult);
+ goto return_with_error;
+ }
+
+ // Destination vertex buffer
+ vbufdesc.dwFVF = (glb.bMultitexture == FALSE) ? D3DFVF_TLVERTEX : (D3DFVF_XYZRHW | D3DFVF_DIFFUSE | D3DFVF_TEX2);
+ hResult = IDirect3D3_CreateVertexBuffer(lpCtx->lpD3D3, &vbufdesc, &lpCtx->m_pvbuf, 0, NULL);
+ if(FAILED(hResult)) {
+ ddlogError(DDLOG_CRITICAL_OR_WARN, "CreateVertexBuffer(dst) failed", hResult);
+ goto return_with_error;
+ }
+#endif
+
+#endif _USE_GLD3_WGL
+
+ //
+ // Now create the Mesa context
+ //
+
+ // Create the Mesa visual
+ if (lpPFD->cDepthBits)
+ dwDepthBits = 16;
+ if (lpPFD->cStencilBits)
+ dwStencilBits = 8;
+ if (lpPFD->cAlphaBits) {
+ dwAlphaBits = 8;
+ bAlphaSW = GL_TRUE;
+ }
+ if (lpPFD->dwFlags & PFD_DOUBLEBUFFER)
+ bDouble = GL_TRUE;
+// lpCtx->EmulateSingle =
+// (lpPFD->dwFlags & PFD_DOUBLEBUFFER) ? FALSE : TRUE;
+
+#ifdef _USE_GLD3_WGL
+ lpCtx->glVis = _mesa_create_visual(
+ bDouble, /* double buffer */
+ GL_FALSE, // stereo
+ lpPFD->cRedBits,
+ lpPFD->cGreenBits,
+ lpPFD->cBlueBits,
+ dwAlphaBits,
+ dwDepthBits,
+ dwStencilBits,
+ lpPFD->cAccumRedBits, // accum bits
+ lpPFD->cAccumGreenBits, // accum bits
+ lpPFD->cAccumBlueBits, // accum bits
+ lpPFD->cAccumAlphaBits, // accum alpha bits
+ 1 // num samples
+ );
+#else // _USE_GLD3_WGL
+ lpCtx->glVis = (*mesaFuncs.gl_create_visual)(
+ GL_TRUE, // RGB mode
+ bAlphaSW, // Is an alpha buffer required?
+ bDouble, // Is an double-buffering required?
+ GL_FALSE, // stereo
+ dwDepthBits, // depth_size
+ dwStencilBits, // stencil_size
+ lpPFD->cAccumBits, // accum_size
+ 0, // colour-index bits
+ lpPFD->cRedBits, // Red bit count
+ lpPFD->cGreenBits, // Green bit count
+ lpPFD->cBlueBits, // Blue bit count
+ dwAlphaBits // Alpha bit count
+ );
+#endif // _USE_GLD3_WGL
+
+ if (lpCtx->glVis == NULL) {
+ ddlogMessage(DDLOG_CRITICAL_OR_WARN, "gl_create_visual failed\n");
+ goto return_with_error;
+ }
+
+#ifdef _USE_GLD3_WGL
+ lpCtx->glCtx = _mesa_create_context(API_OPENGL, lpCtx->glVis, NULL, (void *)lpCtx, GL_TRUE);
+#else
+ // Create the Mesa context
+ lpCtx->glCtx = (*mesaFuncs.gl_create_context)(
+ lpCtx->glVis, // Mesa visual
+ NULL, // share list context
+ (void *)lpCtx, // Pointer to our driver context
+ GL_TRUE // Direct context flag
+ );
+#endif // _USE_GLD3_WGL
+
+ if (lpCtx->glCtx == NULL) {
+ ddlogMessage(DDLOG_CRITICAL_OR_WARN, "gl_create_context failed\n");
+ goto return_with_error;
+ }
+
+ // Create the Mesa framebuffer
+#ifdef _USE_GLD3_WGL
+ lpCtx->glBuffer = _mesa_create_framebuffer(
+ lpCtx->glVis,
+ lpCtx->glVis->depthBits > 0,
+ lpCtx->glVis->stencilBits > 0,
+ lpCtx->glVis->accumRedBits > 0,
+ GL_FALSE //swalpha
+ );
+#else
+ lpCtx->glBuffer = (*mesaFuncs.gl_create_framebuffer)(lpCtx->glVis);
+#endif // _USE_GLD3_WGL
+
+ if (lpCtx->glBuffer == NULL) {
+ ddlogMessage(DDLOG_CRITICAL_OR_WARN, "gl_create_framebuffer failed\n");
+ goto return_with_error;
+ }
+
+#ifdef _USE_GLD3_WGL
+ // Init Mesa internals
+ _swrast_CreateContext( lpCtx->glCtx );
+ _vbo_CreateContext( lpCtx->glCtx );
+ _tnl_CreateContext( lpCtx->glCtx );
+ _swsetup_CreateContext( lpCtx->glCtx );
+
+ _gldDriver.InitialiseMesa(lpCtx);
+
+ lpCtx->glCtx->imports.warning = _gld_mesa_warning;
+ lpCtx->glCtx->imports.fatal = _gld_mesa_fatal;
+
+#else
+ // Tell Mesa how many texture stages we have
+ glb.wMaxSimultaneousTextures = lpCtx->D3DDevDesc.wMaxSimultaneousTextures;
+ // Only use as many Units as the spec requires
+ if (glb.wMaxSimultaneousTextures > MAX_TEXTURE_UNITS)
+ glb.wMaxSimultaneousTextures = MAX_TEXTURE_UNITS;
+ lpCtx->glCtx->Const.MaxTextureUnits = glb.wMaxSimultaneousTextures;
+ ddlogPrintf(DDLOG_INFO, "Texture stages : %d", glb.wMaxSimultaneousTextures);
+
+ // Set the max texture size.
+ // NOTE: clamped to a max of 1024 for extra performance!
+ lpCtx->dwMaxTextureSize = (lpCtx->D3DDevDesc.dwMaxTextureWidth <= 1024) ? lpCtx->D3DDevDesc.dwMaxTextureWidth : 1024;
+
+// Texture resize takes place elsewhere. KH
+// NOTE: This was added to workaround an issue with the Intel app.
+#if 0
+ lpCtx->glCtx->Const.MaxTextureSize = lpCtx->dwMaxTextureSize;
+#else
+ lpCtx->glCtx->Const.MaxTextureSize = 1024;
+#endif
+ lpCtx->glCtx->Const.MaxDrawBuffers = 1;
+
+ // Setup the Display Driver pointers
+ dglSetupDDPointers(lpCtx->glCtx);
+
+ // Initialise all the Direct3D renderstates
+ dglInitStateD3D(lpCtx->glCtx);
+
+#if 0
+ // Signal a reload of texture state on next glBegin
+ lpCtx->m_texHandleValid = FALSE;
+ lpCtx->m_mtex = FALSE;
+ lpCtx->m_texturing = FALSE;
+#else
+ // Set default texture unit state
+// dglSetTexture(lpCtx, 0, NULL);
+// dglSetTexture(lpCtx, 1, NULL);
+#endif
+
+ //
+ // Set the global texture palette to default values.
+ //
+
+ // Clear the entire palette
+ ZeroMemory(ppe, sizeof(PALETTEENTRY) * 256);
+
+ // Fill the palette with a default colour.
+ // A garish colour is used to catch bugs. Here Magenta is used.
+ for (i=0; i < 256; i++) {
+ ppe[i].peRed = 255;
+ ppe[i].peGreen = 0;
+ ppe[i].peBlue = 255;
+ }
+
+ RELEASE(lpCtx->lpGlobalPalette);
+
+ if (glb.bDirectDrawPersistant && glb.bPersistantBuffers && glb.lpGlobalPalette)
+ hResult = IDirectDrawPalette_AddRef(lpCtx->lpGlobalPalette = glb.lpGlobalPalette);
+ else
+ hResult = IDirectDraw4_CreatePalette(
+ lpCtx->lpDD4,
+ DDPCAPS_INITIALIZE | DDPCAPS_8BIT | DDPCAPS_ALLOW256,
+ ppe,
+ &(lpCtx->lpGlobalPalette),
+ NULL);
+ if (FAILED(hResult)) {
+ ddlogError(DDLOG_ERROR, "Default CreatePalette failed\n", hResult);
+ lpCtx->lpGlobalPalette = NULL;
+ goto return_with_error;
+ }
+ if (glb.bDirectDrawPersistant && glb.bPersistantBuffers && !glb.lpGlobalPalette)
+ IDirectDrawPalette_AddRef(glb.lpGlobalPalette = lpCtx->lpGlobalPalette);
+
+#endif // _USE_GLD3_WGL
+
+ // ** If we have made it to here then we can enable rendering **
+ lpCtx->bCanRender = TRUE;
+
+// ddlogMessage(DDLOG_SYSTEM, "dglCreateContextBuffers succeded\n");
+
+#ifdef GLD_THREADS
+ // Release serialized access
+ if (glb.bMultiThreaded)
+ LeaveCriticalSection(&CriticalSection);
+#endif
+
+ return TRUE;
+
+return_with_error:
+ // Clean up before returning.
+ // This is critical for secondary devices.
+
+ lpCtx->bCanRender = FALSE;
+
+#ifdef _USE_GLD3_WGL
+ // Destroy the Mesa context
+ if (lpCtx->glBuffer)
+ _mesa_destroy_framebuffer(lpCtx->glBuffer);
+ if (lpCtx->glCtx)
+ _mesa_destroy_context(lpCtx->glCtx);
+ if (lpCtx->glVis)
+ _mesa_destroy_visual(lpCtx->glVis);
+
+ // Destroy driver data
+ _gldDriver.DestroyDrawable(lpCtx);
+#else
+ // Destroy the Mesa context
+ if (lpCtx->glBuffer)
+ (*mesaFuncs.gl_destroy_framebuffer)(lpCtx->glBuffer);
+ if (lpCtx->glCtx)
+ (*mesaFuncs.gl_destroy_context)(lpCtx->glCtx);
+ if (lpCtx->glVis)
+ (*mesaFuncs.gl_destroy_visual)(lpCtx->glVis);
+
+ RELEASE(lpCtx->m_pvbuf); // Release D3D vertex buffer
+ RELEASE(lpCtx->m_vbuf); // Release D3D vertex buffer
+
+ if (lpCtx->lpViewport3) {
+ if (lpCtx->lpDev3) IDirect3DDevice3_DeleteViewport(lpCtx->lpDev3, lpCtx->lpViewport3);
+ RELEASE(lpCtx->lpViewport3);
+ lpCtx->lpViewport3 = NULL;
+ }
+
+ RELEASE(lpCtx->lpDev3);
+ if (lpCtx->lpDepth4) {
+ if (lpCtx->lpBack4)
+ IDirectDrawSurface4_DeleteAttachedSurface(lpCtx->lpBack4, 0L, lpCtx->lpDepth4);
+ else
+ IDirectDrawSurface4_DeleteAttachedSurface(lpCtx->lpFront4, 0L, lpCtx->lpDepth4);
+ RELEASE(lpCtx->lpDepth4);
+ lpCtx->lpDepth4 = NULL;
+ }
+ RELEASE(lpCtx->lpBack4);
+ RELEASE(lpCtx->lpFront4);
+ else
+ if (lpCtx->bFullscreen) {
+ IDirectDraw4_RestoreDisplayMode(lpCtx->lpDD4);
+ IDirectDraw4_SetCooperativeLevel(lpCtx->lpDD4, NULL, DDSCL_NORMAL);
+ }
+ RELEASE(lpCtx->lpD3D3);
+ RELEASE(lpCtx->lpDD4);
+ RELEASE(lpCtx->lpDD1);
+#endif // _USE_GLD3_WGL
+
+ lpCtx->bAllocated = FALSE;
+
+#ifdef GLD_THREADS
+ // Release serialized access
+ if (glb.bMultiThreaded)
+ LeaveCriticalSection(&CriticalSection);
+#endif
+
+ return FALSE;
+
+#undef DDLOG_CRITICAL_OR_WARN
+}
+
+// ***********************************************************************
+
+HGLRC dglCreateContext(
+ HDC a,
+ const DGL_pixelFormat *lpPF)
+{
+ int i;
+ HGLRC hGLRC;
+ DGL_ctx* lpCtx;
+ static BOOL bWarnOnce = TRUE;
+ DWORD dwThreadId = GetCurrentThreadId();
+ char szMsg[256];
+ HWND hWnd;
+ LONG lpfnWndProc;
+
+ // Validate license
+ if (!dglValidate())
+ return NULL;
+
+ // Is context state ready ?
+ if (!bContextReady)
+ return NULL;
+
+ ddlogPrintf(DDLOG_SYSTEM, "dglCreateContext for HDC=%X, ThreadId=%X", a, dwThreadId);
+
+ // Find next free context.
+ // Also ensure that only one Fullscreen context is created at any one time.
+ hGLRC = 0; // Default to Not Found
+ for (i=0; i<DGL_MAX_CONTEXTS; i++) {
+ if (ctxlist[i].bAllocated) {
+ if (/*glb.bFullscreen && */ctxlist[i].bFullscreen)
+ break;
+ } else {
+ hGLRC = (HGLRC)(i+1);
+ break;
+ }
+ }
+
+ // Bail if no GLRC was found
+ if (!hGLRC)
+ return NULL;
+
+ // Set the context pointer
+ lpCtx = dglGetContextAddress(hGLRC);
+ // Make sure that context is zeroed before we do anything.
+ // MFC and C++ apps call wglCreateContext() and wglDeleteContext() multiple times,
+ // even though only one context is ever used by the app, so keep it clean. (DaveM)
+ ZeroMemory(lpCtx, sizeof(DGL_ctx));
+ lpCtx->bAllocated = TRUE;
+ // Flag that buffers need creating on next wglMakeCurrent call.
+ lpCtx->bHasBeenCurrent = FALSE;
+ lpCtx->lpPF = (DGL_pixelFormat *)lpPF; // cache pixel format
+ lpCtx->bCanRender = FALSE;
+
+ // Create all the internal resources here, not in dglMakeCurrent().
+ // We do a re-size check in dglMakeCurrent in case of re-allocations. (DaveM)
+ // We now try context allocations twice, first with video memory,
+ // then again with system memory. This is similar to technique
+ // used for dglWglResizeBuffers(). (DaveM)
+ if (lpCtx->bHasBeenCurrent == FALSE) {
+ if (!dglCreateContextBuffers(a, lpCtx, FALSE)) {
+ if (glb.bMessageBoxWarnings && bWarnOnce && dwLogging) {
+ bWarnOnce = FALSE;
+ switch (nContextError) {
+ case GLDERR_DDRAW: strcpy(szMsg, szDDrawWarning); break;
+ case GLDERR_D3D: strcpy(szMsg, szD3DWarning); break;
+ case GLDERR_MEM: strcpy(szMsg, szResourceWarning); break;
+ case GLDERR_BPP: strcpy(szMsg, szBPPWarning); break;
+ default: strcpy(szMsg, "");
+ }
+ if (strlen(szMsg))
+ MessageBox(NULL, szMsg, "GLDirect", MB_OK | MB_ICONWARNING);
+ }
+ // Only need to try again if memory error
+ if (nContextError == GLDERR_MEM) {
+ ddlogPrintf(DDLOG_WARN, "dglCreateContext failed 1st time with video memory");
+ }
+ else {
+ ddlogPrintf(DDLOG_ERROR, "dglCreateContext failed");
+ return NULL;
+ }
+ }
+ }
+
+ // Now that we have a hWnd, we can intercept the WindowProc.
+ hWnd = lpCtx->hWnd;
+ if (hWnd) {
+ // Only hook individual window handler once if not hooked before.
+ lpfnWndProc = GetWindowLong(hWnd, GWL_WNDPROC);
+ if (lpfnWndProc != (LONG)dglWndProc) {
+ lpCtx->lpfnWndProc = lpfnWndProc;
+ SetWindowLong(hWnd, GWL_WNDPROC, (LONG)dglWndProc);
+ }
+ // Find the parent window of the app too.
+ if (glb.hWndActive == NULL) {
+ while (hWnd != NULL) {
+ glb.hWndActive = hWnd;
+ hWnd = GetParent(hWnd);
+ }
+ // Hook the parent window too.
+ lpfnWndProc = GetWindowLong(glb.hWndActive, GWL_WNDPROC);
+ if (glb.hWndActive == lpCtx->hWnd)
+ glb.lpfnWndProc = lpCtx->lpfnWndProc;
+ else if (lpfnWndProc != (LONG)dglWndProc)
+ glb.lpfnWndProc = lpfnWndProc;
+ if (glb.lpfnWndProc)
+ SetWindowLong(glb.hWndActive, GWL_WNDPROC, (LONG)dglWndProc);
+ }
+ }
+
+ ddlogPrintf(DDLOG_SYSTEM, "dglCreateContext succeeded for HGLRC=%d", (int)hGLRC);
+
+ return hGLRC;
+}
+
+// ***********************************************************************
+// Make a DirectGL context current
+// Used by wgl functions and dgl functions
+BOOL dglMakeCurrent(
+ HDC a,
+ HGLRC b)
+{
+ int context;
+ DGL_ctx* lpCtx;
+ HWND hWnd;
+ BOOL bNeedResize = FALSE;
+ BOOL bWindowChanged, bContextChanged;
+ LPDIRECTDRAWCLIPPER lpddClipper;
+ DWORD dwThreadId = GetCurrentThreadId();
+ LONG lpfnWndProc;
+
+ // Validate license
+ if (!dglValidate())
+ return FALSE;
+
+ // Is context state ready ?
+ if (!bContextReady)
+ return FALSE;
+
+ context = (int)b; // This is as a result of STRICT!
+ ddlogPrintf(DDLOG_SYSTEM, "dglMakeCurrent: HDC=%X, HGLRC=%d, ThreadId=%X", a, context, dwThreadId);
+
+ // If the HGLRC is NULL then make no context current;
+ // Ditto if the HDC is NULL either. (DaveM)
+ if (context == 0 || a == 0) {
+ // Corresponding Mesa operation
+#ifdef _USE_GLD3_WGL
+ _mesa_make_current(NULL, NULL);
+#else
+ (*mesaFuncs.gl_make_current)(NULL, NULL);
+#endif
+ dglSetCurrentContext(0);
+ return TRUE;
+ }
+
+ // Make sure the HGLRC is in range
+ if ((context > DGL_MAX_CONTEXTS) || (context < 0)) {
+ ddlogMessage(DDLOG_ERROR, "dglMakeCurrent: HGLRC out of range\n");
+ return FALSE;
+ }
+
+ // Find address of context and make sure that it has been allocated
+ lpCtx = dglGetContextAddress(b);
+ if (!lpCtx->bAllocated) {
+ ddlogMessage(DDLOG_ERROR, "dglMakeCurrent: Context not allocated\n");
+// return FALSE;
+ return TRUE; // HACK: Shuts up "WebLab Viewer Pro". KeithH
+ }
+
+#ifdef GLD_THREADS
+ // Serialize access to DirectDraw or DDS operations
+ if (glb.bMultiThreaded)
+ EnterCriticalSection(&CriticalSection);
+#endif
+
+ // Check if window has changed
+ hWnd = (a != lpCtx->hDC) ? WindowFromDC(a) : lpCtx->hWnd;
+ bWindowChanged = (hWnd != lpCtx->hWnd) ? TRUE : FALSE;
+ bContextChanged = (b != dglGetCurrentContext()) ? TRUE : FALSE;
+
+ // If the window has changed, make sure the clipper is updated. (DaveM)
+ if (glb.bDirectDrawPersistant && !lpCtx->bFullscreen && (bWindowChanged || bContextChanged)) {
+ lpCtx->hWnd = hWnd;
+#ifndef _USE_GLD3_WGL
+ IDirectDrawSurface4_GetClipper(lpCtx->lpFront4, &lpddClipper);
+ IDirectDrawClipper_SetHWnd(lpddClipper, 0, lpCtx->hWnd);
+ IDirectDrawClipper_Release(lpddClipper);
+#endif // _USE_GLD3_WGL
+ }
+
+ // Make sure hDC and hWnd is current. (DaveM)
+ // Obtain the dimensions of the rendering window
+ lpCtx->hDC = a; // Cache DC
+ lpCtx->hWnd = hWnd;
+ hWndLastActive = hWnd;
+
+ // Check for non-window DC = memory DC ?
+ if (hWnd == NULL) {
+ if (GetClipBox(a, &lpCtx->rcScreenRect) == ERROR) {
+ ddlogMessage(DDLOG_WARN, "GetClipBox failed in dglMakeCurrent\n");
+ SetRect(&lpCtx->rcScreenRect, 0, 0, 0, 0);
+ }
+ }
+ else if (!GetClientRect(lpCtx->hWnd, &lpCtx->rcScreenRect)) {
+ ddlogMessage(DDLOG_WARN, "GetClientRect failed in dglMakeCurrent\n");
+ SetRect(&lpCtx->rcScreenRect, 0, 0, 0, 0);
+ }
+ // Check if buffers need to be re-sized;
+ // If so, wait until Mesa GL stuff is setup before re-sizing;
+ if (lpCtx->dwWidth != lpCtx->rcScreenRect.right - lpCtx->rcScreenRect.left ||
+ lpCtx->dwHeight != lpCtx->rcScreenRect.bottom - lpCtx->rcScreenRect.top)
+ bNeedResize = TRUE;
+
+ // Now we can update our globals
+ dglSetCurrentContext(b);
+
+ // Corresponding Mesa operation
+#ifdef _USE_GLD3_WGL
+ _mesa_make_current(lpCtx->glCtx, lpCtx->glBuffer);
+ lpCtx->glCtx->Driver.UpdateState(lpCtx->glCtx, _NEW_ALL);
+ if (bNeedResize) {
+ // Resize buffers (Note Mesa GL needs to be setup beforehand);
+ // Resize Mesa internal buffer too via glViewport() command,
+ // which subsequently calls dglWglResizeBuffers() too.
+ lpCtx->glCtx->Driver.Viewport(lpCtx->glCtx, 0, 0, lpCtx->dwWidth, lpCtx->dwHeight);
+ lpCtx->bHasBeenCurrent = TRUE;
+ }
+#else
+ (*mesaFuncs.gl_make_current)(lpCtx->glCtx, lpCtx->glBuffer);
+
+ dglSetupDDPointers(lpCtx->glCtx);
+
+ // Insure DirectDraw surfaces fit current window DC
+ if (bNeedResize) {
+ // Resize buffers (Note Mesa GL needs to be setup beforehand);
+ // Resize Mesa internal buffer too via glViewport() command,
+ // which subsequently calls dglWglResizeBuffers() too.
+ (*mesaFuncs.gl_Viewport)(lpCtx->glCtx, 0, 0, lpCtx->dwWidth, lpCtx->dwHeight);
+ lpCtx->bHasBeenCurrent = TRUE;
+ }
+#endif // _USE_GLD3_WGL
+ ddlogPrintf(DDLOG_SYSTEM, "dglMakeCurrent: width = %d, height = %d", lpCtx->dwWidth, lpCtx->dwHeight);
+
+ // We have to clear D3D back buffer and render state if emulated front buffering
+ // for different window (but not context) like in Solid Edge.
+ if (glb.bDirectDrawPersistant && glb.bPersistantBuffers
+ && (bWindowChanged /* || bContextChanged */) && lpCtx->EmulateSingle) {
+#ifdef _USE_GLD3_WGL
+// IDirect3DDevice8_EndScene(lpCtx->pDev);
+// lpCtx->bSceneStarted = FALSE;
+ lpCtx->glCtx->Driver.Clear(lpCtx->glCtx, GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT,
+ GL_TRUE, 0, 0, lpCtx->dwWidth, lpCtx->dwHeight);
+#else
+ IDirect3DDevice3_EndScene(lpCtx->lpDev3);
+ lpCtx->bSceneStarted = FALSE;
+ dglClearD3D(lpCtx->glCtx, GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT,
+ GL_TRUE, 0, 0, lpCtx->dwWidth, lpCtx->dwHeight);
+#endif // _USE_GLD3_WGL
+ }
+
+ // The first time we call MakeCurrent we set the initial viewport size
+ if (lpCtx->bHasBeenCurrent == FALSE)
+#ifdef _USE_GLD3_WGL
+ lpCtx->glCtx->Driver.Viewport(lpCtx->glCtx, 0, 0, lpCtx->dwWidth, lpCtx->dwHeight);
+#else
+ (*mesaFuncs.gl_Viewport)(lpCtx->glCtx, 0, 0, lpCtx->dwWidth, lpCtx->dwHeight);
+#endif // _USE_GLD3_WGL
+ lpCtx->bHasBeenCurrent = TRUE;
+
+#ifdef GLD_THREADS
+ // Release serialized access
+ if (glb.bMultiThreaded)
+ LeaveCriticalSection(&CriticalSection);
+#endif
+
+ return TRUE;
+}
+
+// ***********************************************************************
+
+BOOL dglDeleteContext(
+ HGLRC a)
+{
+ DGL_ctx* lpCtx;
+ DWORD dwThreadId = GetCurrentThreadId();
+ char argstr[256];
+
+#if 0 // We have enough trouble throwing exceptions as it is... (DaveM)
+ // Validate license
+ if (!dglValidate())
+ return FALSE;
+#endif
+
+ // Is context state ready ?
+ if (!bContextReady)
+ return FALSE;
+
+ ddlogPrintf(DDLOG_SYSTEM, "dglDeleteContext: Deleting context HGLRC=%d, ThreadId=%X", (int)a, dwThreadId);
+
+ // Make sure the HGLRC is in range
+ if (((int) a> DGL_MAX_CONTEXTS) || ((int)a < 0)) {
+ ddlogMessage(DDLOG_ERROR, "dglDeleteCurrent: HGLRC out of range\n");
+ return FALSE;
+ }
+
+ // Make sure context is valid
+ lpCtx = dglGetContextAddress(a);
+ if (!lpCtx->bAllocated) {
+ ddlogPrintf(DDLOG_WARN, "Tried to delete unallocated context HGLRC=%d", (int)a);
+// return FALSE;
+ return TRUE; // HACK: Shuts up "WebLab Viewer Pro". KeithH
+ }
+
+ // Make sure context is de-activated
+ if (a == dglGetCurrentContext()) {
+ ddlogPrintf(DDLOG_WARN, "dglDeleteContext: context HGLRC=%d still active", (int)a);
+ dglMakeCurrent(NULL, NULL);
+ }
+
+#ifdef GLD_THREADS
+ // Serialize access to DirectDraw or DDS operations
+ if (glb.bMultiThreaded)
+ EnterCriticalSection(&CriticalSection);
+#endif
+
+ // We are about to destroy all Direct3D objects.
+ // Therefore we must disable rendering
+ lpCtx->bCanRender = FALSE;
+
+ // This exception handler was installed to catch some
+ // particularly nasty apps. Console apps that call exit()
+ // fall into this catagory (i.e. Win32 Glut).
+
+ // VC cannot successfully implement multiple exception handlers
+ // if more than one exception occurs. Therefore reverting back to
+ // single exception handler as Keith originally had it. (DaveM)
+
+#define WARN_MESSAGE(p) strcpy(argstr, (#p));
+#define SAFE_RELEASE(p) WARN_MESSAGE(p); RELEASE(p);
+
+__try {
+#ifdef _USE_GLD3_WGL
+ WARN_MESSAGE(gl_destroy_framebuffer);
+ if (lpCtx->glBuffer)
+ _mesa_destroy_framebuffer(lpCtx->glBuffer);
+ WARN_MESSAGE(gl_destroy_context);
+ if (lpCtx->glCtx)
+ _mesa_destroy_context(lpCtx->glCtx);
+ WARN_MESSAGE(gl_destroy_visual);
+ if (lpCtx->glVis)
+ _mesa_destroy_visual(lpCtx->glVis);
+
+ _gldDriver.DestroyDrawable(lpCtx);
+#else
+ // Destroy the Mesa context
+ WARN_MESSAGE(gl_destroy_framebuffer);
+ if (lpCtx->glBuffer)
+ (*mesaFuncs.gl_destroy_framebuffer)(lpCtx->glBuffer);
+ WARN_MESSAGE(gl_destroy_context);
+ if (lpCtx->glCtx)
+ (*mesaFuncs.gl_destroy_context)(lpCtx->glCtx);
+ WARN_MESSAGE(gl_destroy_visual);
+ if (lpCtx->glVis)
+ (*mesaFuncs.gl_destroy_visual)(lpCtx->glVis);
+
+ SAFE_RELEASE(lpCtx->m_pvbuf); // release D3D vertex buffer
+ SAFE_RELEASE(lpCtx->m_vbuf); // release D3D vertex buffer
+
+ // Delete the global palette
+ SAFE_RELEASE(lpCtx->lpGlobalPalette);
+
+ // Clean up.
+ if (lpCtx->lpViewport3) {
+ if (lpCtx->lpDev3) IDirect3DDevice3_DeleteViewport(lpCtx->lpDev3, lpCtx->lpViewport3);
+ SAFE_RELEASE(lpCtx->lpViewport3);
+ lpCtx->lpViewport3 = NULL;
+ }
+
+ SAFE_RELEASE(lpCtx->lpDev3);
+ if (lpCtx->lpDepth4) {
+ if (lpCtx->lpBack4)
+ IDirectDrawSurface4_DeleteAttachedSurface(lpCtx->lpBack4, 0L, lpCtx->lpDepth4);
+ else
+ IDirectDrawSurface4_DeleteAttachedSurface(lpCtx->lpFront4, 0L, lpCtx->lpDepth4);
+ SAFE_RELEASE(lpCtx->lpDepth4);
+ lpCtx->lpDepth4 = NULL;
+ }
+ SAFE_RELEASE(lpCtx->lpBack4);
+ SAFE_RELEASE(lpCtx->lpFront4);
+ if (lpCtx->bFullscreen) {
+ IDirectDraw4_RestoreDisplayMode(lpCtx->lpDD4);
+ IDirectDraw4_SetCooperativeLevel(lpCtx->lpDD4, NULL, DDSCL_NORMAL);
+ }
+ SAFE_RELEASE(lpCtx->lpD3D3);
+ SAFE_RELEASE(lpCtx->lpDD4);
+ SAFE_RELEASE(lpCtx->lpDD1);
+#endif // _ULSE_GLD3_WGL
+
+}
+__except(EXCEPTION_EXECUTE_HANDLER) {
+ ddlogPrintf(DDLOG_WARN, "Exception raised in dglDeleteContext: %s", argstr);
+}
+
+ // Restore the window message handler because this context may be used
+ // again by another window with a *different* message handler. (DaveM)
+ if (lpCtx->lpfnWndProc) {
+ SetWindowLong(lpCtx->hWnd, GWL_WNDPROC, (LONG)lpCtx->lpfnWndProc);
+ lpCtx->lpfnWndProc = (LONG)NULL;
+ }
+
+ lpCtx->bAllocated = FALSE; // This context is now free for use
+
+#ifdef GLD_THREADS
+ // Release serialized access
+ if (glb.bMultiThreaded)
+ LeaveCriticalSection(&CriticalSection);
+#endif
+
+ return TRUE;
+}
+
+// ***********************************************************************
+
+BOOL dglSwapBuffers(
+ HDC hDC)
+{
+ RECT rSrcRect; // Source rectangle
+ RECT rDstRect; // Destination rectangle
+ POINT pt;
+ HRESULT hResult;
+
+ DDBLTFX bltFX;
+ DWORD dwBlitFlags;
+ DDBLTFX *lpBltFX;
+
+// DWORD dwThreadId = GetCurrentThreadId();
+ HGLRC hGLRC = dglGetCurrentContext();
+ DGL_ctx *lpCtx = dglGetContextAddress(hGLRC);
+ HWND hWnd;
+
+ HDC hDCAux; // for memory DC
+ int x,y,w,h; // for memory DC BitBlt
+
+#if 0 // Perhaps not a good idea. Called too often. KH
+ // Validate license
+ if (!dglValidate())
+ return FALSE;
+#endif
+
+ if (!lpCtx) {
+ return TRUE; //FALSE; // No current context
+ }
+
+ if (!lpCtx->bCanRender) {
+ // Don't return false else some apps will bail.
+ return TRUE;
+ }
+
+ hWnd = lpCtx->hWnd;
+ if (hDC != lpCtx->hDC) {
+ ddlogPrintf(DDLOG_WARN, "dglSwapBuffers: HDC=%X does not match HDC=%X for HGLRC=%d", hDC, lpCtx->hDC, hGLRC);
+ hWnd = WindowFromDC(hDC);
+ }
+
+#ifndef _USE_GLD3_WGL
+ // Ensure that the surfaces exist before we tell
+ // the device to render to them.
+ IDirectDraw4_RestoreAllSurfaces(lpCtx->lpDD4);
+
+ // Make sure that the vertex caches have been emptied
+// dglStateChange(lpCtx);
+
+ // Some OpenGL programs don't issue a glFinish - check for it here.
+ if (lpCtx->bSceneStarted) {
+ IDirect3DDevice3_EndScene(lpCtx->lpDev3);
+ lpCtx->bSceneStarted = FALSE;
+ }
+#endif
+
+#if 0
+ // If the calling app is not active then we don't need to Blit/Flip.
+ // We can therefore simply return TRUE.
+ if (!glb.bAppActive)
+ return TRUE;
+ // Addendum: This is WRONG! We should bail if the app is *minimized*,
+ // not merely if the app is just plain 'not active'.
+ // KeithH, 27/May/2000.
+#endif
+
+ // Check for non-window DC = memory DC ?
+ if (hWnd == NULL) {
+ if (GetClipBox(hDC, &rSrcRect) == ERROR)
+ return TRUE;
+ // Use GDI BitBlt instead from compatible DirectDraw DC
+ x = rSrcRect.left;
+ y = rSrcRect.top;
+ w = rSrcRect.right - rSrcRect.left;
+ h = rSrcRect.bottom - rSrcRect.top;
+
+ // Ack. DX8 does not have a GetDC() function...
+ // TODO: Defer to DX7 or DX9 drivers... (DaveM)
+ return TRUE;
+ }
+
+ // Bail if window client region is not drawable, like in Solid Edge
+ if (!IsWindow(hWnd) /* || !IsWindowVisible(hWnd) */ || !GetClientRect(hWnd, &rSrcRect))
+ return TRUE;
+
+#ifdef GLD_THREADS
+ // Serialize access to DirectDraw or DDS operations
+ if (glb.bMultiThreaded)
+ EnterCriticalSection(&CriticalSection);
+#endif
+
+#ifdef _USE_GLD3_WGL
+ // Notify Mesa of impending swap, so Mesa can flush internal buffers.
+ _mesa_notifySwapBuffers(lpCtx->glCtx);
+ // Now perform driver buffer swap
+ _gldDriver.SwapBuffers(lpCtx, hDC, hWnd);
+#else
+ if (lpCtx->bFullscreen) {
+ // Sync with retrace if required
+ if (glb.bWaitForRetrace) {
+ IDirectDraw4_WaitForVerticalBlank(
+ lpCtx->lpDD4,
+ DDWAITVB_BLOCKBEGIN,
+ 0);
+ }
+
+ // Perform the fullscreen flip
+ TRY(IDirectDrawSurface4_Flip(
+ lpCtx->lpFront4,
+ NULL,
+ DDFLIP_WAIT),
+ "dglSwapBuffers: Flip");
+ } else {
+ // Calculate current window position and size
+ pt.x = pt.y = 0;
+ ClientToScreen(hWnd, &pt);
+ GetClientRect(hWnd, &rDstRect);
+ if (rDstRect.right > lpCtx->dwModeWidth)
+ rDstRect.right = lpCtx->dwModeWidth;
+ if (rDstRect.bottom > lpCtx->dwModeHeight)
+ rDstRect.bottom = lpCtx->dwModeHeight;
+ OffsetRect(&rDstRect, pt.x, pt.y);
+ rSrcRect.left = rSrcRect.top = 0;
+ rSrcRect.right = lpCtx->dwWidth;
+ rSrcRect.bottom = lpCtx->dwHeight;
+ if (rSrcRect.right > lpCtx->dwModeWidth)
+ rSrcRect.right = lpCtx->dwModeWidth;
+ if (rSrcRect.bottom > lpCtx->dwModeHeight)
+ rSrcRect.bottom = lpCtx->dwModeHeight;
+
+ if (glb.bWaitForRetrace) {
+ // Sync the blit to the vertical retrace
+ ZeroMemory(&bltFX, sizeof(bltFX));
+ bltFX.dwSize = sizeof(bltFX);
+ bltFX.dwDDFX = DDBLTFX_NOTEARING;
+ dwBlitFlags = DDBLT_WAIT | DDBLT_DDFX;
+ lpBltFX = &bltFX;
+ } else {
+ dwBlitFlags = DDBLT_WAIT;
+ lpBltFX = NULL;
+ }
+
+ // Perform the actual blit
+ TRY(IDirectDrawSurface4_Blt(
+ lpCtx->lpFront4,
+ &rDstRect,
+ lpCtx->lpBack4, // Blit source
+ &rSrcRect,
+ dwBlitFlags,
+ lpBltFX),
+ "dglSwapBuffers: Blt");
+ }
+#endif // _USE_GLD3_WGL
+
+#ifdef GLD_THREADS
+ // Release serialized access
+ if (glb.bMultiThreaded)
+ LeaveCriticalSection(&CriticalSection);
+#endif
+
+ // TODO: Re-instate rendering bitmap snapshot feature??? (DaveM)
+
+ // Render frame is completed
+ ValidateRect(hWnd, NULL);
+ lpCtx->bFrameStarted = FALSE;
+
+ return TRUE;
+}
+
+// ***********************************************************************
diff --git a/mesalib/src/mesa/main/api_arrayelt.c b/mesalib/src/mesa/main/api_arrayelt.c
index f88da8458..2eb41996d 100644
--- a/mesalib/src/mesa/main/api_arrayelt.c
+++ b/mesalib/src/mesa/main/api_arrayelt.c
@@ -1,1710 +1,1710 @@
-/*
- * Mesa 3-D graphics library
- * Version: 6.5.1
- *
- * Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-/**
- * This file implements the glArrayElement() function.
- * It involves looking at the format/type of all the enabled vertex arrays
- * and emitting a list of pointers to functions which set the per-vertex
- * state for the element/index.
- */
-
-
-/* Author:
- * Keith Whitwell <keith@tungstengraphics.com>
- */
-
-#include "glheader.h"
-#include "api_arrayelt.h"
-#include "bufferobj.h"
-#include "context.h"
-#include "imports.h"
-#include "macros.h"
-#include "mfeatures.h"
-#include "mtypes.h"
-#include "main/dispatch.h"
-
-typedef void (GLAPIENTRY *array_func)( const void * );
-
-typedef struct {
- const struct gl_client_array *array;
- int offset;
-} AEarray;
-
-typedef void (GLAPIENTRY *attrib_func)( GLuint indx, const void *data );
-
-typedef struct {
- const struct gl_client_array *array;
- attrib_func func;
- GLuint index;
-} AEattrib;
-
-typedef struct {
- AEarray arrays[32];
- AEattrib attribs[VERT_ATTRIB_MAX + 1];
- GLuint NewState;
-
- struct gl_buffer_object *vbo[VERT_ATTRIB_MAX];
- GLuint nr_vbos;
- GLboolean mapped_vbos;
-
-} AEcontext;
-
-#define AE_CONTEXT(ctx) ((AEcontext *)(ctx)->aelt_context)
-
-
-/*
- * Convert GL_BYTE, GL_UNSIGNED_BYTE, .. GL_DOUBLE into an integer
- * in the range [0, 7]. Luckily these type tokens are sequentially
- * numbered in gl.h, except for GL_DOUBLE.
- */
-#define TYPE_IDX(t) ( (t) == GL_DOUBLE ? 7 : (t) & 7 )
-
-#define NUM_TYPES 8
-
-
-#if FEATURE_arrayelt
-
-
-static const int ColorFuncs[2][NUM_TYPES] = {
- {
- _gloffset_Color3bv,
- _gloffset_Color3ubv,
- _gloffset_Color3sv,
- _gloffset_Color3usv,
- _gloffset_Color3iv,
- _gloffset_Color3uiv,
- _gloffset_Color3fv,
- _gloffset_Color3dv,
- },
- {
- _gloffset_Color4bv,
- _gloffset_Color4ubv,
- _gloffset_Color4sv,
- _gloffset_Color4usv,
- _gloffset_Color4iv,
- _gloffset_Color4uiv,
- _gloffset_Color4fv,
- _gloffset_Color4dv,
- },
-};
-
-static const int VertexFuncs[3][NUM_TYPES] = {
- {
- -1,
- -1,
- _gloffset_Vertex2sv,
- -1,
- _gloffset_Vertex2iv,
- -1,
- _gloffset_Vertex2fv,
- _gloffset_Vertex2dv,
- },
- {
- -1,
- -1,
- _gloffset_Vertex3sv,
- -1,
- _gloffset_Vertex3iv,
- -1,
- _gloffset_Vertex3fv,
- _gloffset_Vertex3dv,
- },
- {
- -1,
- -1,
- _gloffset_Vertex4sv,
- -1,
- _gloffset_Vertex4iv,
- -1,
- _gloffset_Vertex4fv,
- _gloffset_Vertex4dv,
- },
-};
-
-static const int IndexFuncs[NUM_TYPES] = {
- -1,
- _gloffset_Indexubv,
- _gloffset_Indexsv,
- -1,
- _gloffset_Indexiv,
- -1,
- _gloffset_Indexfv,
- _gloffset_Indexdv,
-};
-
-static const int NormalFuncs[NUM_TYPES] = {
- _gloffset_Normal3bv,
- -1,
- _gloffset_Normal3sv,
- -1,
- _gloffset_Normal3iv,
- -1,
- _gloffset_Normal3fv,
- _gloffset_Normal3dv,
-};
-
-/* Note: _gloffset_* for these may not be a compile-time constant. */
-static int SecondaryColorFuncs[NUM_TYPES];
-static int FogCoordFuncs[NUM_TYPES];
-
-
-/**
- ** GL_NV_vertex_program
- **/
-
-/* GL_BYTE attributes */
-
-static void GLAPIENTRY
-VertexAttrib1NbvNV(GLuint index, const GLbyte *v)
-{
- CALL_VertexAttrib1fNV(GET_DISPATCH(), (index, BYTE_TO_FLOAT(v[0])));
-}
-
-static void GLAPIENTRY
-VertexAttrib1bvNV(GLuint index, const GLbyte *v)
-{
- CALL_VertexAttrib1fNV(GET_DISPATCH(), (index, (GLfloat)v[0]));
-}
-
-static void GLAPIENTRY
-VertexAttrib2NbvNV(GLuint index, const GLbyte *v)
-{
- CALL_VertexAttrib2fNV(GET_DISPATCH(), (index, BYTE_TO_FLOAT(v[0]), BYTE_TO_FLOAT(v[1])));
-}
-
-static void GLAPIENTRY
-VertexAttrib2bvNV(GLuint index, const GLbyte *v)
-{
- CALL_VertexAttrib2fNV(GET_DISPATCH(), (index, (GLfloat)v[0], (GLfloat)v[1]));
-}
-
-static void GLAPIENTRY
-VertexAttrib3NbvNV(GLuint index, const GLbyte *v)
-{
- CALL_VertexAttrib3fNV(GET_DISPATCH(), (index, BYTE_TO_FLOAT(v[0]),
- BYTE_TO_FLOAT(v[1]),
- BYTE_TO_FLOAT(v[2])));
-}
-
-static void GLAPIENTRY
-VertexAttrib3bvNV(GLuint index, const GLbyte *v)
-{
- CALL_VertexAttrib3fNV(GET_DISPATCH(), (index, (GLfloat)v[0], (GLfloat)v[1], (GLfloat)v[2]));
-}
-
-static void GLAPIENTRY
-VertexAttrib4NbvNV(GLuint index, const GLbyte *v)
-{
- CALL_VertexAttrib4fNV(GET_DISPATCH(), (index, BYTE_TO_FLOAT(v[0]),
- BYTE_TO_FLOAT(v[1]),
- BYTE_TO_FLOAT(v[2]),
- BYTE_TO_FLOAT(v[3])));
-}
-
-static void GLAPIENTRY
-VertexAttrib4bvNV(GLuint index, const GLbyte *v)
-{
- CALL_VertexAttrib4fNV(GET_DISPATCH(), (index, (GLfloat)v[0], (GLfloat)v[1], (GLfloat)v[2], (GLfloat)v[3]));
-}
-
-/* GL_UNSIGNED_BYTE attributes */
-
-static void GLAPIENTRY
-VertexAttrib1NubvNV(GLuint index, const GLubyte *v)
-{
- CALL_VertexAttrib1fNV(GET_DISPATCH(), (index, UBYTE_TO_FLOAT(v[0])));
-}
-
-static void GLAPIENTRY
-VertexAttrib1ubvNV(GLuint index, const GLubyte *v)
-{
- CALL_VertexAttrib1fNV(GET_DISPATCH(), (index, (GLfloat)v[0]));
-}
-
-static void GLAPIENTRY
-VertexAttrib2NubvNV(GLuint index, const GLubyte *v)
-{
- CALL_VertexAttrib2fNV(GET_DISPATCH(), (index, UBYTE_TO_FLOAT(v[0]),
- UBYTE_TO_FLOAT(v[1])));
-}
-
-static void GLAPIENTRY
-VertexAttrib2ubvNV(GLuint index, const GLubyte *v)
-{
- CALL_VertexAttrib2fNV(GET_DISPATCH(), (index, (GLfloat)v[0], (GLfloat)v[1]));
-}
-
-static void GLAPIENTRY
-VertexAttrib3NubvNV(GLuint index, const GLubyte *v)
-{
- CALL_VertexAttrib3fNV(GET_DISPATCH(), (index, UBYTE_TO_FLOAT(v[0]),
- UBYTE_TO_FLOAT(v[1]),
- UBYTE_TO_FLOAT(v[2])));
-}
-static void GLAPIENTRY
-VertexAttrib3ubvNV(GLuint index, const GLubyte *v)
-{
- CALL_VertexAttrib3fNV(GET_DISPATCH(), (index, (GLfloat)v[0],
- (GLfloat)v[1], (GLfloat)v[2]));
-}
-
-static void GLAPIENTRY
-VertexAttrib4NubvNV(GLuint index, const GLubyte *v)
-{
- CALL_VertexAttrib4fNV(GET_DISPATCH(), (index, UBYTE_TO_FLOAT(v[0]),
- UBYTE_TO_FLOAT(v[1]),
- UBYTE_TO_FLOAT(v[2]),
- UBYTE_TO_FLOAT(v[3])));
-}
-
-static void GLAPIENTRY
-VertexAttrib4ubvNV(GLuint index, const GLubyte *v)
-{
- CALL_VertexAttrib4fNV(GET_DISPATCH(), (index, (GLfloat)v[0],
- (GLfloat)v[1], (GLfloat)v[2],
- (GLfloat)v[3]));
-}
-
-/* GL_SHORT attributes */
-
-static void GLAPIENTRY
-VertexAttrib1NsvNV(GLuint index, const GLshort *v)
-{
- CALL_VertexAttrib1fNV(GET_DISPATCH(), (index, SHORT_TO_FLOAT(v[0])));
-}
-
-static void GLAPIENTRY
-VertexAttrib1svNV(GLuint index, const GLshort *v)
-{
- CALL_VertexAttrib1fNV(GET_DISPATCH(), (index, (GLfloat)v[0]));
-}
-
-static void GLAPIENTRY
-VertexAttrib2NsvNV(GLuint index, const GLshort *v)
-{
- CALL_VertexAttrib2fNV(GET_DISPATCH(), (index, SHORT_TO_FLOAT(v[0]),
- SHORT_TO_FLOAT(v[1])));
-}
-
-static void GLAPIENTRY
-VertexAttrib2svNV(GLuint index, const GLshort *v)
-{
- CALL_VertexAttrib2fNV(GET_DISPATCH(), (index, (GLfloat)v[0], (GLfloat)v[1]));
-}
-
-static void GLAPIENTRY
-VertexAttrib3NsvNV(GLuint index, const GLshort *v)
-{
- CALL_VertexAttrib3fNV(GET_DISPATCH(), (index, SHORT_TO_FLOAT(v[0]),
- SHORT_TO_FLOAT(v[1]),
- SHORT_TO_FLOAT(v[2])));
-}
-
-static void GLAPIENTRY
-VertexAttrib3svNV(GLuint index, const GLshort *v)
-{
- CALL_VertexAttrib3fNV(GET_DISPATCH(), (index, (GLfloat)v[0], (GLfloat)v[1],
- (GLfloat)v[2]));
-}
-
-static void GLAPIENTRY
-VertexAttrib4NsvNV(GLuint index, const GLshort *v)
-{
- CALL_VertexAttrib4fNV(GET_DISPATCH(), (index, SHORT_TO_FLOAT(v[0]),
- SHORT_TO_FLOAT(v[1]),
- SHORT_TO_FLOAT(v[2]),
- SHORT_TO_FLOAT(v[3])));
-}
-
-static void GLAPIENTRY
-VertexAttrib4svNV(GLuint index, const GLshort *v)
-{
- CALL_VertexAttrib4fNV(GET_DISPATCH(), (index, (GLfloat)v[0], (GLfloat)v[1],
- (GLfloat)v[2], (GLfloat)v[3]));
-}
-
-/* GL_UNSIGNED_SHORT attributes */
-
-static void GLAPIENTRY
-VertexAttrib1NusvNV(GLuint index, const GLushort *v)
-{
- CALL_VertexAttrib1fNV(GET_DISPATCH(), (index, USHORT_TO_FLOAT(v[0])));
-}
-
-static void GLAPIENTRY
-VertexAttrib1usvNV(GLuint index, const GLushort *v)
-{
- CALL_VertexAttrib1fNV(GET_DISPATCH(), (index, (GLfloat)v[0]));
-}
-
-static void GLAPIENTRY
-VertexAttrib2NusvNV(GLuint index, const GLushort *v)
-{
- CALL_VertexAttrib2fNV(GET_DISPATCH(), (index, USHORT_TO_FLOAT(v[0]),
- USHORT_TO_FLOAT(v[1])));
-}
-
-static void GLAPIENTRY
-VertexAttrib2usvNV(GLuint index, const GLushort *v)
-{
- CALL_VertexAttrib2fNV(GET_DISPATCH(), (index, (GLfloat)v[0],
- (GLfloat)v[1]));
-}
-
-static void GLAPIENTRY
-VertexAttrib3NusvNV(GLuint index, const GLushort *v)
-{
- CALL_VertexAttrib3fNV(GET_DISPATCH(), (index, USHORT_TO_FLOAT(v[0]),
- USHORT_TO_FLOAT(v[1]),
- USHORT_TO_FLOAT(v[2])));
-}
-
-static void GLAPIENTRY
-VertexAttrib3usvNV(GLuint index, const GLushort *v)
-{
- CALL_VertexAttrib3fNV(GET_DISPATCH(), (index, (GLfloat)v[0], (GLfloat)v[1],
- (GLfloat)v[2]));
-}
-
-static void GLAPIENTRY
-VertexAttrib4NusvNV(GLuint index, const GLushort *v)
-{
- CALL_VertexAttrib4fNV(GET_DISPATCH(), (index, USHORT_TO_FLOAT(v[0]),
- USHORT_TO_FLOAT(v[1]),
- USHORT_TO_FLOAT(v[2]),
- USHORT_TO_FLOAT(v[3])));
-}
-
-static void GLAPIENTRY
-VertexAttrib4usvNV(GLuint index, const GLushort *v)
-{
- CALL_VertexAttrib4fNV(GET_DISPATCH(), (index, (GLfloat)v[0], (GLfloat)v[1],
- (GLfloat)v[2], (GLfloat)v[3]));
-}
-
-/* GL_INT attributes */
-
-static void GLAPIENTRY
-VertexAttrib1NivNV(GLuint index, const GLint *v)
-{
- CALL_VertexAttrib1fNV(GET_DISPATCH(), (index, INT_TO_FLOAT(v[0])));
-}
-
-static void GLAPIENTRY
-VertexAttrib1ivNV(GLuint index, const GLint *v)
-{
- CALL_VertexAttrib1fNV(GET_DISPATCH(), (index, (GLfloat)v[0]));
-}
-
-static void GLAPIENTRY
-VertexAttrib2NivNV(GLuint index, const GLint *v)
-{
- CALL_VertexAttrib2fNV(GET_DISPATCH(), (index, INT_TO_FLOAT(v[0]),
- INT_TO_FLOAT(v[1])));
-}
-
-static void GLAPIENTRY
-VertexAttrib2ivNV(GLuint index, const GLint *v)
-{
- CALL_VertexAttrib2fNV(GET_DISPATCH(), (index, (GLfloat)v[0], (GLfloat)v[1]));
-}
-
-static void GLAPIENTRY
-VertexAttrib3NivNV(GLuint index, const GLint *v)
-{
- CALL_VertexAttrib3fNV(GET_DISPATCH(), (index, INT_TO_FLOAT(v[0]),
- INT_TO_FLOAT(v[1]),
- INT_TO_FLOAT(v[2])));
-}
-
-static void GLAPIENTRY
-VertexAttrib3ivNV(GLuint index, const GLint *v)
-{
- CALL_VertexAttrib3fNV(GET_DISPATCH(), (index, (GLfloat)v[0], (GLfloat)v[1],
- (GLfloat)v[2]));
-}
-
-static void GLAPIENTRY
-VertexAttrib4NivNV(GLuint index, const GLint *v)
-{
- CALL_VertexAttrib4fNV(GET_DISPATCH(), (index, INT_TO_FLOAT(v[0]),
- INT_TO_FLOAT(v[1]),
- INT_TO_FLOAT(v[2]),
- INT_TO_FLOAT(v[3])));
-}
-
-static void GLAPIENTRY
-VertexAttrib4ivNV(GLuint index, const GLint *v)
-{
- CALL_VertexAttrib4fNV(GET_DISPATCH(), (index, (GLfloat)v[0], (GLfloat)v[1],
- (GLfloat)v[2], (GLfloat)v[3]));
-}
-
-/* GL_UNSIGNED_INT attributes */
-
-static void GLAPIENTRY
-VertexAttrib1NuivNV(GLuint index, const GLuint *v)
-{
- CALL_VertexAttrib1fNV(GET_DISPATCH(), (index, UINT_TO_FLOAT(v[0])));
-}
-
-static void GLAPIENTRY
-VertexAttrib1uivNV(GLuint index, const GLuint *v)
-{
- CALL_VertexAttrib1fNV(GET_DISPATCH(), (index, (GLfloat)v[0]));
-}
-
-static void GLAPIENTRY
-VertexAttrib2NuivNV(GLuint index, const GLuint *v)
-{
- CALL_VertexAttrib2fNV(GET_DISPATCH(), (index, UINT_TO_FLOAT(v[0]),
- UINT_TO_FLOAT(v[1])));
-}
-
-static void GLAPIENTRY
-VertexAttrib2uivNV(GLuint index, const GLuint *v)
-{
- CALL_VertexAttrib2fNV(GET_DISPATCH(), (index, (GLfloat)v[0],
- (GLfloat)v[1]));
-}
-
-static void GLAPIENTRY
-VertexAttrib3NuivNV(GLuint index, const GLuint *v)
-{
- CALL_VertexAttrib3fNV(GET_DISPATCH(), (index, UINT_TO_FLOAT(v[0]),
- UINT_TO_FLOAT(v[1]),
- UINT_TO_FLOAT(v[2])));
-}
-
-static void GLAPIENTRY
-VertexAttrib3uivNV(GLuint index, const GLuint *v)
-{
- CALL_VertexAttrib3fNV(GET_DISPATCH(), (index, (GLfloat)v[0], (GLfloat)v[1],
- (GLfloat)v[2]));
-}
-
-static void GLAPIENTRY
-VertexAttrib4NuivNV(GLuint index, const GLuint *v)
-{
- CALL_VertexAttrib4fNV(GET_DISPATCH(), (index, UINT_TO_FLOAT(v[0]),
- UINT_TO_FLOAT(v[1]),
- UINT_TO_FLOAT(v[2]),
- UINT_TO_FLOAT(v[3])));
-}
-
-static void GLAPIENTRY
-VertexAttrib4uivNV(GLuint index, const GLuint *v)
-{
- CALL_VertexAttrib4fNV(GET_DISPATCH(), (index, (GLfloat)v[0], (GLfloat)v[1],
- (GLfloat)v[2], (GLfloat)v[3]));
-}
-
-/* GL_FLOAT attributes */
-
-static void GLAPIENTRY
-VertexAttrib1fvNV(GLuint index, const GLfloat *v)
-{
- CALL_VertexAttrib1fvNV(GET_DISPATCH(), (index, v));
-}
-
-static void GLAPIENTRY
-VertexAttrib2fvNV(GLuint index, const GLfloat *v)
-{
- CALL_VertexAttrib2fvNV(GET_DISPATCH(), (index, v));
-}
-
-static void GLAPIENTRY
-VertexAttrib3fvNV(GLuint index, const GLfloat *v)
-{
- CALL_VertexAttrib3fvNV(GET_DISPATCH(), (index, v));
-}
-
-static void GLAPIENTRY
-VertexAttrib4fvNV(GLuint index, const GLfloat *v)
-{
- CALL_VertexAttrib4fvNV(GET_DISPATCH(), (index, v));
-}
-
-/* GL_DOUBLE attributes */
-
-static void GLAPIENTRY
-VertexAttrib1dvNV(GLuint index, const GLdouble *v)
-{
- CALL_VertexAttrib1dvNV(GET_DISPATCH(), (index, v));
-}
-
-static void GLAPIENTRY
-VertexAttrib2dvNV(GLuint index, const GLdouble *v)
-{
- CALL_VertexAttrib2dvNV(GET_DISPATCH(), (index, v));
-}
-
-static void GLAPIENTRY
-VertexAttrib3dvNV(GLuint index, const GLdouble *v)
-{
- CALL_VertexAttrib3dvNV(GET_DISPATCH(), (index, v));
-}
-
-static void GLAPIENTRY
-VertexAttrib4dvNV(GLuint index, const GLdouble *v)
-{
- CALL_VertexAttrib4dvNV(GET_DISPATCH(), (index, v));
-}
-
-
-/*
- * Array [size][type] of VertexAttrib functions
- */
-static attrib_func AttribFuncsNV[2][4][NUM_TYPES] = {
- {
- /* non-normalized */
- {
- /* size 1 */
- (attrib_func) VertexAttrib1bvNV,
- (attrib_func) VertexAttrib1ubvNV,
- (attrib_func) VertexAttrib1svNV,
- (attrib_func) VertexAttrib1usvNV,
- (attrib_func) VertexAttrib1ivNV,
- (attrib_func) VertexAttrib1uivNV,
- (attrib_func) VertexAttrib1fvNV,
- (attrib_func) VertexAttrib1dvNV
- },
- {
- /* size 2 */
- (attrib_func) VertexAttrib2bvNV,
- (attrib_func) VertexAttrib2ubvNV,
- (attrib_func) VertexAttrib2svNV,
- (attrib_func) VertexAttrib2usvNV,
- (attrib_func) VertexAttrib2ivNV,
- (attrib_func) VertexAttrib2uivNV,
- (attrib_func) VertexAttrib2fvNV,
- (attrib_func) VertexAttrib2dvNV
- },
- {
- /* size 3 */
- (attrib_func) VertexAttrib3bvNV,
- (attrib_func) VertexAttrib3ubvNV,
- (attrib_func) VertexAttrib3svNV,
- (attrib_func) VertexAttrib3usvNV,
- (attrib_func) VertexAttrib3ivNV,
- (attrib_func) VertexAttrib3uivNV,
- (attrib_func) VertexAttrib3fvNV,
- (attrib_func) VertexAttrib3dvNV
- },
- {
- /* size 4 */
- (attrib_func) VertexAttrib4bvNV,
- (attrib_func) VertexAttrib4ubvNV,
- (attrib_func) VertexAttrib4svNV,
- (attrib_func) VertexAttrib4usvNV,
- (attrib_func) VertexAttrib4ivNV,
- (attrib_func) VertexAttrib4uivNV,
- (attrib_func) VertexAttrib4fvNV,
- (attrib_func) VertexAttrib4dvNV
- }
- },
- {
- /* normalized (except for float/double) */
- {
- /* size 1 */
- (attrib_func) VertexAttrib1NbvNV,
- (attrib_func) VertexAttrib1NubvNV,
- (attrib_func) VertexAttrib1NsvNV,
- (attrib_func) VertexAttrib1NusvNV,
- (attrib_func) VertexAttrib1NivNV,
- (attrib_func) VertexAttrib1NuivNV,
- (attrib_func) VertexAttrib1fvNV,
- (attrib_func) VertexAttrib1dvNV
- },
- {
- /* size 2 */
- (attrib_func) VertexAttrib2NbvNV,
- (attrib_func) VertexAttrib2NubvNV,
- (attrib_func) VertexAttrib2NsvNV,
- (attrib_func) VertexAttrib2NusvNV,
- (attrib_func) VertexAttrib2NivNV,
- (attrib_func) VertexAttrib2NuivNV,
- (attrib_func) VertexAttrib2fvNV,
- (attrib_func) VertexAttrib2dvNV
- },
- {
- /* size 3 */
- (attrib_func) VertexAttrib3NbvNV,
- (attrib_func) VertexAttrib3NubvNV,
- (attrib_func) VertexAttrib3NsvNV,
- (attrib_func) VertexAttrib3NusvNV,
- (attrib_func) VertexAttrib3NivNV,
- (attrib_func) VertexAttrib3NuivNV,
- (attrib_func) VertexAttrib3fvNV,
- (attrib_func) VertexAttrib3dvNV
- },
- {
- /* size 4 */
- (attrib_func) VertexAttrib4NbvNV,
- (attrib_func) VertexAttrib4NubvNV,
- (attrib_func) VertexAttrib4NsvNV,
- (attrib_func) VertexAttrib4NusvNV,
- (attrib_func) VertexAttrib4NivNV,
- (attrib_func) VertexAttrib4NuivNV,
- (attrib_func) VertexAttrib4fvNV,
- (attrib_func) VertexAttrib4dvNV
- }
- }
-};
-
-
-/**
- ** GL_ARB_vertex_program
- **/
-
-/* GL_BYTE attributes */
-
-static void GLAPIENTRY
-VertexAttrib1NbvARB(GLuint index, const GLbyte *v)
-{
- CALL_VertexAttrib1fARB(GET_DISPATCH(), (index, BYTE_TO_FLOAT(v[0])));
-}
-
-static void GLAPIENTRY
-VertexAttrib1bvARB(GLuint index, const GLbyte *v)
-{
- CALL_VertexAttrib1fARB(GET_DISPATCH(), (index, (GLfloat)v[0]));
-}
-
-static void GLAPIENTRY
-VertexAttrib2NbvARB(GLuint index, const GLbyte *v)
-{
- CALL_VertexAttrib2fARB(GET_DISPATCH(), (index, BYTE_TO_FLOAT(v[0]), BYTE_TO_FLOAT(v[1])));
-}
-
-static void GLAPIENTRY
-VertexAttrib2bvARB(GLuint index, const GLbyte *v)
-{
- CALL_VertexAttrib2fARB(GET_DISPATCH(), (index, (GLfloat)v[0], (GLfloat)v[1]));
-}
-
-static void GLAPIENTRY
-VertexAttrib3NbvARB(GLuint index, const GLbyte *v)
-{
- CALL_VertexAttrib3fARB(GET_DISPATCH(), (index, BYTE_TO_FLOAT(v[0]),
- BYTE_TO_FLOAT(v[1]),
- BYTE_TO_FLOAT(v[2])));
-}
-
-static void GLAPIENTRY
-VertexAttrib3bvARB(GLuint index, const GLbyte *v)
-{
- CALL_VertexAttrib3fARB(GET_DISPATCH(), (index, (GLfloat)v[0], (GLfloat)v[1], (GLfloat)v[2]));
-}
-
-static void GLAPIENTRY
-VertexAttrib4NbvARB(GLuint index, const GLbyte *v)
-{
- CALL_VertexAttrib4fARB(GET_DISPATCH(), (index, BYTE_TO_FLOAT(v[0]),
- BYTE_TO_FLOAT(v[1]),
- BYTE_TO_FLOAT(v[2]),
- BYTE_TO_FLOAT(v[3])));
-}
-
-static void GLAPIENTRY
-VertexAttrib4bvARB(GLuint index, const GLbyte *v)
-{
- CALL_VertexAttrib4fARB(GET_DISPATCH(), (index, (GLfloat)v[0], (GLfloat)v[1], (GLfloat)v[2], (GLfloat)v[3]));
-}
-
-/* GL_UNSIGNED_BYTE attributes */
-
-static void GLAPIENTRY
-VertexAttrib1NubvARB(GLuint index, const GLubyte *v)
-{
- CALL_VertexAttrib1fARB(GET_DISPATCH(), (index, UBYTE_TO_FLOAT(v[0])));
-}
-
-static void GLAPIENTRY
-VertexAttrib1ubvARB(GLuint index, const GLubyte *v)
-{
- CALL_VertexAttrib1fARB(GET_DISPATCH(), (index, (GLfloat)v[0]));
-}
-
-static void GLAPIENTRY
-VertexAttrib2NubvARB(GLuint index, const GLubyte *v)
-{
- CALL_VertexAttrib2fARB(GET_DISPATCH(), (index,
- UBYTE_TO_FLOAT(v[0]),
- UBYTE_TO_FLOAT(v[1])));
-}
-
-static void GLAPIENTRY
-VertexAttrib2ubvARB(GLuint index, const GLubyte *v)
-{
- CALL_VertexAttrib2fARB(GET_DISPATCH(), (index,
- (GLfloat)v[0], (GLfloat)v[1]));
-}
-
-static void GLAPIENTRY
-VertexAttrib3NubvARB(GLuint index, const GLubyte *v)
-{
- CALL_VertexAttrib3fARB(GET_DISPATCH(), (index,
- UBYTE_TO_FLOAT(v[0]),
- UBYTE_TO_FLOAT(v[1]),
- UBYTE_TO_FLOAT(v[2])));
-}
-static void GLAPIENTRY
-VertexAttrib3ubvARB(GLuint index, const GLubyte *v)
-{
- CALL_VertexAttrib3fARB(GET_DISPATCH(), (index,
- (GLfloat)v[0],
- (GLfloat)v[1],
- (GLfloat)v[2]));
-}
-
-static void GLAPIENTRY
-VertexAttrib4NubvARB(GLuint index, const GLubyte *v)
-{
- CALL_VertexAttrib4fARB(GET_DISPATCH(),
- (index,
- UBYTE_TO_FLOAT(v[0]),
- UBYTE_TO_FLOAT(v[1]),
- UBYTE_TO_FLOAT(v[2]),
- UBYTE_TO_FLOAT(v[3])));
-}
-
-static void GLAPIENTRY
-VertexAttrib4ubvARB(GLuint index, const GLubyte *v)
-{
- CALL_VertexAttrib4fARB(GET_DISPATCH(),
- (index,
- (GLfloat)v[0], (GLfloat)v[1],
- (GLfloat)v[2], (GLfloat)v[3]));
-}
-
-/* GL_SHORT attributes */
-
-static void GLAPIENTRY
-VertexAttrib1NsvARB(GLuint index, const GLshort *v)
-{
- CALL_VertexAttrib1fARB(GET_DISPATCH(), (index, SHORT_TO_FLOAT(v[0])));
-}
-
-static void GLAPIENTRY
-VertexAttrib1svARB(GLuint index, const GLshort *v)
-{
- CALL_VertexAttrib1fARB(GET_DISPATCH(), (index, (GLfloat)v[0]));
-}
-
-static void GLAPIENTRY
-VertexAttrib2NsvARB(GLuint index, const GLshort *v)
-{
- CALL_VertexAttrib2fARB(GET_DISPATCH(),
- (index, SHORT_TO_FLOAT(v[0]),
- SHORT_TO_FLOAT(v[1])));
-}
-
-static void GLAPIENTRY
-VertexAttrib2svARB(GLuint index, const GLshort *v)
-{
- CALL_VertexAttrib2fARB(GET_DISPATCH(),
- (index, (GLfloat)v[0], (GLfloat)v[1]));
-}
-
-static void GLAPIENTRY
-VertexAttrib3NsvARB(GLuint index, const GLshort *v)
-{
- CALL_VertexAttrib3fARB(GET_DISPATCH(),
- (index,
- SHORT_TO_FLOAT(v[0]),
- SHORT_TO_FLOAT(v[1]),
- SHORT_TO_FLOAT(v[2])));
-}
-
-static void GLAPIENTRY
-VertexAttrib3svARB(GLuint index, const GLshort *v)
-{
- CALL_VertexAttrib3fARB(GET_DISPATCH(),
- (index,
- (GLfloat)v[0], (GLfloat)v[1], (GLfloat)v[2]));
-}
-
-static void GLAPIENTRY
-VertexAttrib4NsvARB(GLuint index, const GLshort *v)
-{
- CALL_VertexAttrib4fARB(GET_DISPATCH(),
- (index,
- SHORT_TO_FLOAT(v[0]),
- SHORT_TO_FLOAT(v[1]),
- SHORT_TO_FLOAT(v[2]),
- SHORT_TO_FLOAT(v[3])));
-}
-
-static void GLAPIENTRY
-VertexAttrib4svARB(GLuint index, const GLshort *v)
-{
- CALL_VertexAttrib4fARB(GET_DISPATCH(), (index, (GLfloat)v[0], (GLfloat)v[1],
- (GLfloat)v[2], (GLfloat)v[3]));
-}
-
-/* GL_UNSIGNED_SHORT attributes */
-
-static void GLAPIENTRY
-VertexAttrib1NusvARB(GLuint index, const GLushort *v)
-{
- CALL_VertexAttrib1fARB(GET_DISPATCH(), (index, USHORT_TO_FLOAT(v[0])));
-}
-
-static void GLAPIENTRY
-VertexAttrib1usvARB(GLuint index, const GLushort *v)
-{
- CALL_VertexAttrib1fARB(GET_DISPATCH(), (index, (GLfloat)v[0]));
-}
-
-static void GLAPIENTRY
-VertexAttrib2NusvARB(GLuint index, const GLushort *v)
-{
- CALL_VertexAttrib2fARB(GET_DISPATCH(), (index, USHORT_TO_FLOAT(v[0]),
- USHORT_TO_FLOAT(v[1])));
-}
-
-static void GLAPIENTRY
-VertexAttrib2usvARB(GLuint index, const GLushort *v)
-{
- CALL_VertexAttrib2fARB(GET_DISPATCH(), (index, (GLfloat)v[0],
- (GLfloat)v[1]));
-}
-
-static void GLAPIENTRY
-VertexAttrib3NusvARB(GLuint index, const GLushort *v)
-{
- CALL_VertexAttrib3fARB(GET_DISPATCH(), (index, USHORT_TO_FLOAT(v[0]),
- USHORT_TO_FLOAT(v[1]),
- USHORT_TO_FLOAT(v[2])));
-}
-
-static void GLAPIENTRY
-VertexAttrib3usvARB(GLuint index, const GLushort *v)
-{
- CALL_VertexAttrib3fARB(GET_DISPATCH(), (index, (GLfloat)v[0],
- (GLfloat)v[1], (GLfloat)v[2]));
-}
-
-static void GLAPIENTRY
-VertexAttrib4NusvARB(GLuint index, const GLushort *v)
-{
- CALL_VertexAttrib4fARB(GET_DISPATCH(), (index, USHORT_TO_FLOAT(v[0]),
- USHORT_TO_FLOAT(v[1]),
- USHORT_TO_FLOAT(v[2]),
- USHORT_TO_FLOAT(v[3])));
-}
-
-static void GLAPIENTRY
-VertexAttrib4usvARB(GLuint index, const GLushort *v)
-{
- CALL_VertexAttrib4fARB(GET_DISPATCH(), (index, (GLfloat)v[0], (GLfloat)v[1], (GLfloat)v[2], (GLfloat)v[3]));
-}
-
-/* GL_INT attributes */
-
-static void GLAPIENTRY
-VertexAttrib1NivARB(GLuint index, const GLint *v)
-{
- CALL_VertexAttrib1fARB(GET_DISPATCH(), (index, INT_TO_FLOAT(v[0])));
-}
-
-static void GLAPIENTRY
-VertexAttrib1ivARB(GLuint index, const GLint *v)
-{
- CALL_VertexAttrib1fARB(GET_DISPATCH(), (index, (GLfloat)v[0]));
-}
-
-static void GLAPIENTRY
-VertexAttrib2NivARB(GLuint index, const GLint *v)
-{
- CALL_VertexAttrib2fARB(GET_DISPATCH(), (index, INT_TO_FLOAT(v[0]),
- INT_TO_FLOAT(v[1])));
-}
-
-static void GLAPIENTRY
-VertexAttrib2ivARB(GLuint index, const GLint *v)
-{
- CALL_VertexAttrib2fARB(GET_DISPATCH(), (index, (GLfloat)v[0],
- (GLfloat)v[1]));
-}
-
-static void GLAPIENTRY
-VertexAttrib3NivARB(GLuint index, const GLint *v)
-{
- CALL_VertexAttrib3fARB(GET_DISPATCH(), (index, INT_TO_FLOAT(v[0]),
- INT_TO_FLOAT(v[1]),
- INT_TO_FLOAT(v[2])));
-}
-
-static void GLAPIENTRY
-VertexAttrib3ivARB(GLuint index, const GLint *v)
-{
- CALL_VertexAttrib3fARB(GET_DISPATCH(), (index, (GLfloat)v[0],
- (GLfloat)v[1], (GLfloat)v[2]));
-}
-
-static void GLAPIENTRY
-VertexAttrib4NivARB(GLuint index, const GLint *v)
-{
- CALL_VertexAttrib4fARB(GET_DISPATCH(), (index, INT_TO_FLOAT(v[0]),
- INT_TO_FLOAT(v[1]),
- INT_TO_FLOAT(v[2]),
- INT_TO_FLOAT(v[3])));
-}
-
-static void GLAPIENTRY
-VertexAttrib4ivARB(GLuint index, const GLint *v)
-{
- CALL_VertexAttrib4fARB(GET_DISPATCH(), (index, (GLfloat)v[0], (GLfloat)v[1],
- (GLfloat)v[2], (GLfloat)v[3]));
-}
-
-/* GL_UNSIGNED_INT attributes */
-
-static void GLAPIENTRY
-VertexAttrib1NuivARB(GLuint index, const GLuint *v)
-{
- CALL_VertexAttrib1fARB(GET_DISPATCH(), (index, UINT_TO_FLOAT(v[0])));
-}
-
-static void GLAPIENTRY
-VertexAttrib1uivARB(GLuint index, const GLuint *v)
-{
- CALL_VertexAttrib1fARB(GET_DISPATCH(), (index, (GLfloat)v[0]));
-}
-
-static void GLAPIENTRY
-VertexAttrib2NuivARB(GLuint index, const GLuint *v)
-{
- CALL_VertexAttrib2fARB(GET_DISPATCH(), (index, UINT_TO_FLOAT(v[0]),
- UINT_TO_FLOAT(v[1])));
-}
-
-static void GLAPIENTRY
-VertexAttrib2uivARB(GLuint index, const GLuint *v)
-{
- CALL_VertexAttrib2fARB(GET_DISPATCH(), (index, (GLfloat)v[0],
- (GLfloat)v[1]));
-}
-
-static void GLAPIENTRY
-VertexAttrib3NuivARB(GLuint index, const GLuint *v)
-{
- CALL_VertexAttrib3fARB(GET_DISPATCH(), (index, UINT_TO_FLOAT(v[0]),
- UINT_TO_FLOAT(v[1]),
- UINT_TO_FLOAT(v[2])));
-}
-
-static void GLAPIENTRY
-VertexAttrib3uivARB(GLuint index, const GLuint *v)
-{
- CALL_VertexAttrib3fARB(GET_DISPATCH(), (index, (GLfloat)v[0],
- (GLfloat)v[1], (GLfloat)v[2]));
-}
-
-static void GLAPIENTRY
-VertexAttrib4NuivARB(GLuint index, const GLuint *v)
-{
- CALL_VertexAttrib4fARB(GET_DISPATCH(), (index, UINT_TO_FLOAT(v[0]),
- UINT_TO_FLOAT(v[1]),
- UINT_TO_FLOAT(v[2]),
- UINT_TO_FLOAT(v[3])));
-}
-
-static void GLAPIENTRY
-VertexAttrib4uivARB(GLuint index, const GLuint *v)
-{
- CALL_VertexAttrib4fARB(GET_DISPATCH(), (index, (GLfloat)v[0], (GLfloat)v[1],
- (GLfloat)v[2], (GLfloat)v[3]));
-}
-
-/* GL_FLOAT attributes */
-
-static void GLAPIENTRY
-VertexAttrib1fvARB(GLuint index, const GLfloat *v)
-{
- CALL_VertexAttrib1fvARB(GET_DISPATCH(), (index, v));
-}
-
-static void GLAPIENTRY
-VertexAttrib2fvARB(GLuint index, const GLfloat *v)
-{
- CALL_VertexAttrib2fvARB(GET_DISPATCH(), (index, v));
-}
-
-static void GLAPIENTRY
-VertexAttrib3fvARB(GLuint index, const GLfloat *v)
-{
- CALL_VertexAttrib3fvARB(GET_DISPATCH(), (index, v));
-}
-
-static void GLAPIENTRY
-VertexAttrib4fvARB(GLuint index, const GLfloat *v)
-{
- CALL_VertexAttrib4fvARB(GET_DISPATCH(), (index, v));
-}
-
-/* GL_DOUBLE attributes */
-
-static void GLAPIENTRY
-VertexAttrib1dvARB(GLuint index, const GLdouble *v)
-{
- CALL_VertexAttrib1dvARB(GET_DISPATCH(), (index, v));
-}
-
-static void GLAPIENTRY
-VertexAttrib2dvARB(GLuint index, const GLdouble *v)
-{
- CALL_VertexAttrib2dvARB(GET_DISPATCH(), (index, v));
-}
-
-static void GLAPIENTRY
-VertexAttrib3dvARB(GLuint index, const GLdouble *v)
-{
- CALL_VertexAttrib3dvARB(GET_DISPATCH(), (index, v));
-}
-
-static void GLAPIENTRY
-VertexAttrib4dvARB(GLuint index, const GLdouble *v)
-{
- CALL_VertexAttrib4dvARB(GET_DISPATCH(), (index, v));
-}
-
-
-/**
- * Integer-valued attributes
- */
-static void GLAPIENTRY
-VertexAttribI1bv(GLuint index, const GLbyte *v)
-{
- CALL_VertexAttribI1iEXT(GET_DISPATCH(), (index, v[0]));
-}
-
-static void GLAPIENTRY
-VertexAttribI2bv(GLuint index, const GLbyte *v)
-{
- CALL_VertexAttribI2iEXT(GET_DISPATCH(), (index, v[0], v[1]));
-}
-
-static void GLAPIENTRY
-VertexAttribI3bv(GLuint index, const GLbyte *v)
-{
- CALL_VertexAttribI3iEXT(GET_DISPATCH(), (index, v[0], v[1], v[2]));
-}
-
-static void GLAPIENTRY
-VertexAttribI4bv(GLuint index, const GLbyte *v)
-{
- CALL_VertexAttribI4bvEXT(GET_DISPATCH(), (index, v));
-}
-
-
-static void GLAPIENTRY
-VertexAttribI1ubv(GLuint index, const GLubyte *v)
-{
- CALL_VertexAttribI1uiEXT(GET_DISPATCH(), (index, v[0]));
-}
-
-static void GLAPIENTRY
-VertexAttribI2ubv(GLuint index, const GLubyte *v)
-{
- CALL_VertexAttribI2uiEXT(GET_DISPATCH(), (index, v[0], v[1]));
-}
-
-static void GLAPIENTRY
-VertexAttribI3ubv(GLuint index, const GLubyte *v)
-{
- CALL_VertexAttribI3uiEXT(GET_DISPATCH(), (index, v[0], v[1], v[2]));
-}
-
-static void GLAPIENTRY
-VertexAttribI4ubv(GLuint index, const GLubyte *v)
-{
- CALL_VertexAttribI4ubvEXT(GET_DISPATCH(), (index, v));
-}
-
-
-
-static void GLAPIENTRY
-VertexAttribI1sv(GLuint index, const GLshort *v)
-{
- CALL_VertexAttribI1iEXT(GET_DISPATCH(), (index, v[0]));
-}
-
-static void GLAPIENTRY
-VertexAttribI2sv(GLuint index, const GLshort *v)
-{
- CALL_VertexAttribI2iEXT(GET_DISPATCH(), (index, v[0], v[1]));
-}
-
-static void GLAPIENTRY
-VertexAttribI3sv(GLuint index, const GLshort *v)
-{
- CALL_VertexAttribI3iEXT(GET_DISPATCH(), (index, v[0], v[1], v[2]));
-}
-
-static void GLAPIENTRY
-VertexAttribI4sv(GLuint index, const GLshort *v)
-{
- CALL_VertexAttribI4svEXT(GET_DISPATCH(), (index, v));
-}
-
-
-static void GLAPIENTRY
-VertexAttribI1usv(GLuint index, const GLushort *v)
-{
- CALL_VertexAttribI1uiEXT(GET_DISPATCH(), (index, v[0]));
-}
-
-static void GLAPIENTRY
-VertexAttribI2usv(GLuint index, const GLushort *v)
-{
- CALL_VertexAttribI2uiEXT(GET_DISPATCH(), (index, v[0], v[1]));
-}
-
-static void GLAPIENTRY
-VertexAttribI3usv(GLuint index, const GLushort *v)
-{
- CALL_VertexAttribI3uiEXT(GET_DISPATCH(), (index, v[0], v[1], v[2]));
-}
-
-static void GLAPIENTRY
-VertexAttribI4usv(GLuint index, const GLushort *v)
-{
- CALL_VertexAttribI4usvEXT(GET_DISPATCH(), (index, v));
-}
-
-
-
-static void GLAPIENTRY
-VertexAttribI1iv(GLuint index, const GLint *v)
-{
- CALL_VertexAttribI1iEXT(GET_DISPATCH(), (index, v[0]));
-}
-
-static void GLAPIENTRY
-VertexAttribI2iv(GLuint index, const GLint *v)
-{
- CALL_VertexAttribI2iEXT(GET_DISPATCH(), (index, v[0], v[1]));
-}
-
-static void GLAPIENTRY
-VertexAttribI3iv(GLuint index, const GLint *v)
-{
- CALL_VertexAttribI3iEXT(GET_DISPATCH(), (index, v[0], v[1], v[2]));
-}
-
-static void GLAPIENTRY
-VertexAttribI4iv(GLuint index, const GLint *v)
-{
- CALL_VertexAttribI4ivEXT(GET_DISPATCH(), (index, v));
-}
-
-
-static void GLAPIENTRY
-VertexAttribI1uiv(GLuint index, const GLuint *v)
-{
- CALL_VertexAttribI1uiEXT(GET_DISPATCH(), (index, v[0]));
-}
-
-static void GLAPIENTRY
-VertexAttribI2uiv(GLuint index, const GLuint *v)
-{
- CALL_VertexAttribI2uiEXT(GET_DISPATCH(), (index, v[0], v[1]));
-}
-
-static void GLAPIENTRY
-VertexAttribI3uiv(GLuint index, const GLuint *v)
-{
- CALL_VertexAttribI3uiEXT(GET_DISPATCH(), (index, v[0], v[1], v[2]));
-}
-
-static void GLAPIENTRY
-VertexAttribI4uiv(GLuint index, const GLuint *v)
-{
- CALL_VertexAttribI4uivEXT(GET_DISPATCH(), (index, v));
-}
-
-
-
-
-/*
- * Array [unnormalized/normalized/integer][size][type] of VertexAttrib
- * functions
- */
-static attrib_func AttribFuncsARB[3][4][NUM_TYPES] = {
- {
- /* non-normalized */
- {
- /* size 1 */
- (attrib_func) VertexAttrib1bvARB,
- (attrib_func) VertexAttrib1ubvARB,
- (attrib_func) VertexAttrib1svARB,
- (attrib_func) VertexAttrib1usvARB,
- (attrib_func) VertexAttrib1ivARB,
- (attrib_func) VertexAttrib1uivARB,
- (attrib_func) VertexAttrib1fvARB,
- (attrib_func) VertexAttrib1dvARB
- },
- {
- /* size 2 */
- (attrib_func) VertexAttrib2bvARB,
- (attrib_func) VertexAttrib2ubvARB,
- (attrib_func) VertexAttrib2svARB,
- (attrib_func) VertexAttrib2usvARB,
- (attrib_func) VertexAttrib2ivARB,
- (attrib_func) VertexAttrib2uivARB,
- (attrib_func) VertexAttrib2fvARB,
- (attrib_func) VertexAttrib2dvARB
- },
- {
- /* size 3 */
- (attrib_func) VertexAttrib3bvARB,
- (attrib_func) VertexAttrib3ubvARB,
- (attrib_func) VertexAttrib3svARB,
- (attrib_func) VertexAttrib3usvARB,
- (attrib_func) VertexAttrib3ivARB,
- (attrib_func) VertexAttrib3uivARB,
- (attrib_func) VertexAttrib3fvARB,
- (attrib_func) VertexAttrib3dvARB
- },
- {
- /* size 4 */
- (attrib_func) VertexAttrib4bvARB,
- (attrib_func) VertexAttrib4ubvARB,
- (attrib_func) VertexAttrib4svARB,
- (attrib_func) VertexAttrib4usvARB,
- (attrib_func) VertexAttrib4ivARB,
- (attrib_func) VertexAttrib4uivARB,
- (attrib_func) VertexAttrib4fvARB,
- (attrib_func) VertexAttrib4dvARB
- }
- },
- {
- /* normalized (except for float/double) */
- {
- /* size 1 */
- (attrib_func) VertexAttrib1NbvARB,
- (attrib_func) VertexAttrib1NubvARB,
- (attrib_func) VertexAttrib1NsvARB,
- (attrib_func) VertexAttrib1NusvARB,
- (attrib_func) VertexAttrib1NivARB,
- (attrib_func) VertexAttrib1NuivARB,
- (attrib_func) VertexAttrib1fvARB,
- (attrib_func) VertexAttrib1dvARB
- },
- {
- /* size 2 */
- (attrib_func) VertexAttrib2NbvARB,
- (attrib_func) VertexAttrib2NubvARB,
- (attrib_func) VertexAttrib2NsvARB,
- (attrib_func) VertexAttrib2NusvARB,
- (attrib_func) VertexAttrib2NivARB,
- (attrib_func) VertexAttrib2NuivARB,
- (attrib_func) VertexAttrib2fvARB,
- (attrib_func) VertexAttrib2dvARB
- },
- {
- /* size 3 */
- (attrib_func) VertexAttrib3NbvARB,
- (attrib_func) VertexAttrib3NubvARB,
- (attrib_func) VertexAttrib3NsvARB,
- (attrib_func) VertexAttrib3NusvARB,
- (attrib_func) VertexAttrib3NivARB,
- (attrib_func) VertexAttrib3NuivARB,
- (attrib_func) VertexAttrib3fvARB,
- (attrib_func) VertexAttrib3dvARB
- },
- {
- /* size 4 */
- (attrib_func) VertexAttrib4NbvARB,
- (attrib_func) VertexAttrib4NubvARB,
- (attrib_func) VertexAttrib4NsvARB,
- (attrib_func) VertexAttrib4NusvARB,
- (attrib_func) VertexAttrib4NivARB,
- (attrib_func) VertexAttrib4NuivARB,
- (attrib_func) VertexAttrib4fvARB,
- (attrib_func) VertexAttrib4dvARB
- }
- },
-
- {
- /* integer-valued */
- {
- /* size 1 */
- (attrib_func) VertexAttribI1bv,
- (attrib_func) VertexAttribI1ubv,
- (attrib_func) VertexAttribI1sv,
- (attrib_func) VertexAttribI1usv,
- (attrib_func) VertexAttribI1iv,
- (attrib_func) VertexAttribI1uiv,
- NULL, /* GL_FLOAT */
- NULL /* GL_DOUBLE */
- },
- {
- /* size 2 */
- (attrib_func) VertexAttribI2bv,
- (attrib_func) VertexAttribI2ubv,
- (attrib_func) VertexAttribI2sv,
- (attrib_func) VertexAttribI2usv,
- (attrib_func) VertexAttribI2iv,
- (attrib_func) VertexAttribI2uiv,
- NULL, /* GL_FLOAT */
- NULL /* GL_DOUBLE */
- },
- {
- /* size 3 */
- (attrib_func) VertexAttribI3bv,
- (attrib_func) VertexAttribI3ubv,
- (attrib_func) VertexAttribI3sv,
- (attrib_func) VertexAttribI3usv,
- (attrib_func) VertexAttribI3iv,
- (attrib_func) VertexAttribI3uiv,
- NULL, /* GL_FLOAT */
- NULL /* GL_DOUBLE */
- },
- {
- /* size 4 */
- (attrib_func) VertexAttribI4bv,
- (attrib_func) VertexAttribI4ubv,
- (attrib_func) VertexAttribI4sv,
- (attrib_func) VertexAttribI4usv,
- (attrib_func) VertexAttribI4iv,
- (attrib_func) VertexAttribI4uiv,
- NULL, /* GL_FLOAT */
- NULL /* GL_DOUBLE */
- }
- }
-};
-
-/**********************************************************************/
-
-
-GLboolean _ae_create_context( struct gl_context *ctx )
-{
- if (ctx->aelt_context)
- return GL_TRUE;
-
- /* These _gloffset_* values may not be compile-time constants */
- SecondaryColorFuncs[0] = _gloffset_SecondaryColor3bvEXT;
- SecondaryColorFuncs[1] = _gloffset_SecondaryColor3ubvEXT;
- SecondaryColorFuncs[2] = _gloffset_SecondaryColor3svEXT;
- SecondaryColorFuncs[3] = _gloffset_SecondaryColor3usvEXT;
- SecondaryColorFuncs[4] = _gloffset_SecondaryColor3ivEXT;
- SecondaryColorFuncs[5] = _gloffset_SecondaryColor3uivEXT;
- SecondaryColorFuncs[6] = _gloffset_SecondaryColor3fvEXT;
- SecondaryColorFuncs[7] = _gloffset_SecondaryColor3dvEXT;
-
- FogCoordFuncs[0] = -1;
- FogCoordFuncs[1] = -1;
- FogCoordFuncs[2] = -1;
- FogCoordFuncs[3] = -1;
- FogCoordFuncs[4] = -1;
- FogCoordFuncs[5] = -1;
- FogCoordFuncs[6] = _gloffset_FogCoordfvEXT;
- FogCoordFuncs[7] = _gloffset_FogCoorddvEXT;
-
- ctx->aelt_context = CALLOC( sizeof(AEcontext) );
- if (!ctx->aelt_context)
- return GL_FALSE;
-
- AE_CONTEXT(ctx)->NewState = ~0;
- return GL_TRUE;
-}
-
-
-void _ae_destroy_context( struct gl_context *ctx )
-{
- if ( AE_CONTEXT( ctx ) ) {
- FREE( ctx->aelt_context );
- ctx->aelt_context = NULL;
- }
-}
-
-static void check_vbo( AEcontext *actx,
- struct gl_buffer_object *vbo )
-{
- if (_mesa_is_bufferobj(vbo) && !_mesa_bufferobj_mapped(vbo)) {
- GLuint i;
- for (i = 0; i < actx->nr_vbos; i++)
- if (actx->vbo[i] == vbo)
- return;
- assert(actx->nr_vbos < VERT_ATTRIB_MAX);
- actx->vbo[actx->nr_vbos++] = vbo;
- }
-}
-
-
-/**
- * Make a list of per-vertex functions to call for each glArrayElement call.
- * These functions access the array data (i.e. glVertex, glColor, glNormal,
- * etc).
- * Note: this may be called during display list construction.
- */
-static void _ae_update_state( struct gl_context *ctx )
-{
- AEcontext *actx = AE_CONTEXT(ctx);
- AEarray *aa = actx->arrays;
- AEattrib *at = actx->attribs;
- GLuint i;
- struct gl_array_object *arrayObj = ctx->Array.ArrayObj;
-
- actx->nr_vbos = 0;
-
- /* conventional vertex arrays */
- if (arrayObj->Index.Enabled) {
- aa->array = &arrayObj->Index;
- aa->offset = IndexFuncs[TYPE_IDX(aa->array->Type)];
- check_vbo(actx, aa->array->BufferObj);
- aa++;
- }
- if (arrayObj->EdgeFlag.Enabled) {
- aa->array = &arrayObj->EdgeFlag;
- aa->offset = _gloffset_EdgeFlagv;
- check_vbo(actx, aa->array->BufferObj);
- aa++;
- }
- if (arrayObj->Normal.Enabled) {
- aa->array = &arrayObj->Normal;
- aa->offset = NormalFuncs[TYPE_IDX(aa->array->Type)];
- check_vbo(actx, aa->array->BufferObj);
- aa++;
- }
- if (arrayObj->Color.Enabled) {
- aa->array = &arrayObj->Color;
- aa->offset = ColorFuncs[aa->array->Size-3][TYPE_IDX(aa->array->Type)];
- check_vbo(actx, aa->array->BufferObj);
- aa++;
- }
- if (arrayObj->SecondaryColor.Enabled) {
- aa->array = &arrayObj->SecondaryColor;
- aa->offset = SecondaryColorFuncs[TYPE_IDX(aa->array->Type)];
- check_vbo(actx, aa->array->BufferObj);
- aa++;
- }
- if (arrayObj->FogCoord.Enabled) {
- aa->array = &arrayObj->FogCoord;
- aa->offset = FogCoordFuncs[TYPE_IDX(aa->array->Type)];
- check_vbo(actx, aa->array->BufferObj);
- aa++;
- }
- for (i = 0; i < ctx->Const.MaxTextureCoordUnits; i++) {
- struct gl_client_array *attribArray = &arrayObj->TexCoord[i];
- if (attribArray->Enabled) {
- /* NOTE: we use generic glVertexAttribNV functions here.
- * If we ever remove GL_NV_vertex_program this will have to change.
- */
- at->array = attribArray;
- ASSERT(!at->array->Normalized);
- at->func = AttribFuncsNV[at->array->Normalized]
- [at->array->Size-1]
- [TYPE_IDX(at->array->Type)];
- at->index = VERT_ATTRIB_TEX0 + i;
- check_vbo(actx, at->array->BufferObj);
- at++;
- }
- }
-
- /* generic vertex attribute arrays */
- for (i = 1; i < Elements(arrayObj->VertexAttrib); i++) { /* skip zero! */
- struct gl_client_array *attribArray = &arrayObj->VertexAttrib[i];
- if (attribArray->Enabled) {
- at->array = attribArray;
- /* Note: we can't grab the _glapi_Dispatch->VertexAttrib1fvNV
- * function pointer here (for float arrays) since the pointer may
- * change from one execution of _ae_ArrayElement() to
- * the next. Doing so caused UT to break.
- */
- if (ctx->VertexProgram._Enabled
- && ctx->VertexProgram.Current->IsNVProgram) {
- at->func = AttribFuncsNV[at->array->Normalized]
- [at->array->Size-1]
- [TYPE_IDX(at->array->Type)];
- }
- else {
- GLint intOrNorm;
- if (at->array->Integer)
- intOrNorm = 2;
- else if (at->array->Normalized)
- intOrNorm = 1;
- else
- intOrNorm = 0;
-
- at->func = AttribFuncsARB[intOrNorm]
- [at->array->Size-1]
- [TYPE_IDX(at->array->Type)];
- }
- at->index = i;
- check_vbo(actx, at->array->BufferObj);
- at++;
- }
- }
-
- /* finally, vertex position */
- if (arrayObj->VertexAttrib[0].Enabled) {
- /* Use glVertex(v) instead of glVertexAttrib(0, v) to be sure it's
- * issued as the last (provoking) attribute).
- */
- aa->array = &arrayObj->VertexAttrib[0];
- assert(aa->array->Size >= 2); /* XXX fix someday? */
- aa->offset = VertexFuncs[aa->array->Size-2][TYPE_IDX(aa->array->Type)];
- check_vbo(actx, aa->array->BufferObj);
- aa++;
- }
- else if (arrayObj->Vertex.Enabled) {
- aa->array = &arrayObj->Vertex;
- aa->offset = VertexFuncs[aa->array->Size-2][TYPE_IDX(aa->array->Type)];
- check_vbo(actx, aa->array->BufferObj);
- aa++;
- }
-
- check_vbo(actx, ctx->Array.ElementArrayBufferObj);
-
- ASSERT(at - actx->attribs <= VERT_ATTRIB_MAX);
- ASSERT(aa - actx->arrays < 32);
- at->func = NULL; /* terminate the list */
- aa->offset = -1; /* terminate the list */
-
- actx->NewState = 0;
-}
-
-void _ae_map_vbos( struct gl_context *ctx )
-{
- AEcontext *actx = AE_CONTEXT(ctx);
- GLuint i;
-
- if (actx->mapped_vbos)
- return;
-
- if (actx->NewState)
- _ae_update_state(ctx);
-
- for (i = 0; i < actx->nr_vbos; i++)
- ctx->Driver.MapBuffer(ctx,
- GL_ARRAY_BUFFER_ARB,
- GL_DYNAMIC_DRAW_ARB,
- actx->vbo[i]);
-
- if (actx->nr_vbos)
- actx->mapped_vbos = GL_TRUE;
-}
-
-void _ae_unmap_vbos( struct gl_context *ctx )
-{
- AEcontext *actx = AE_CONTEXT(ctx);
- GLuint i;
-
- if (!actx->mapped_vbos)
- return;
-
- assert (!actx->NewState);
-
- for (i = 0; i < actx->nr_vbos; i++)
- ctx->Driver.UnmapBuffer(ctx,
- GL_ARRAY_BUFFER_ARB,
- actx->vbo[i]);
-
- actx->mapped_vbos = GL_FALSE;
-}
-
-
-/**
- * Called via glArrayElement() and glDrawArrays().
- * Issue the glNormal, glVertex, glColor, glVertexAttrib, etc functions
- * for all enabled vertex arrays (for elt-th element).
- * Note: this may be called during display list construction.
- */
-void GLAPIENTRY _ae_ArrayElement( GLint elt )
-{
- GET_CURRENT_CONTEXT(ctx);
- const AEcontext *actx = AE_CONTEXT(ctx);
- const AEarray *aa;
- const AEattrib *at;
- const struct _glapi_table * const disp = GET_DISPATCH();
- GLboolean do_map;
-
- if (actx->NewState) {
- assert(!actx->mapped_vbos);
- _ae_update_state( ctx );
- }
-
- /* Determine if w need to map/unmap VBOs */
- do_map = actx->nr_vbos && !actx->mapped_vbos;
-
- if (do_map)
- _ae_map_vbos(ctx);
-
- /* emit generic attribute elements */
- for (at = actx->attribs; at->func; at++) {
- const GLubyte *src
- = ADD_POINTERS(at->array->BufferObj->Pointer, at->array->Ptr)
- + elt * at->array->StrideB;
- at->func( at->index, src );
- }
-
- /* emit conventional arrays elements */
- for (aa = actx->arrays; aa->offset != -1 ; aa++) {
- const GLubyte *src
- = ADD_POINTERS(aa->array->BufferObj->Pointer, aa->array->Ptr)
- + elt * aa->array->StrideB;
- CALL_by_offset( disp, (array_func), aa->offset,
- ((const void *) src) );
- }
-
- if (do_map)
- _ae_unmap_vbos(ctx);
-}
-
-
-void _ae_invalidate_state( struct gl_context *ctx, GLuint new_state )
-{
- AEcontext *actx = AE_CONTEXT(ctx);
-
-
- /* Only interested in this subset of mesa state. Need to prune
- * this down as both tnl/ and the drivers can raise statechanges
- * for arcane reasons in the middle of seemingly atomic operations
- * like DrawElements, over which we'd like to keep a known set of
- * arrays and vbo's mapped.
- *
- * Luckily, neither the drivers nor tnl muck with the state that
- * concerns us here:
- */
- new_state &= _NEW_ARRAY | _NEW_PROGRAM;
- if (new_state) {
- assert(!actx->mapped_vbos);
- actx->NewState |= new_state;
- }
-}
-
-
-void _mesa_install_arrayelt_vtxfmt(struct _glapi_table *disp,
- const GLvertexformat *vfmt)
-{
- SET_ArrayElement(disp, vfmt->ArrayElement);
-}
-
-
-#endif /* FEATURE_arrayelt */
+/*
+ * Mesa 3-D graphics library
+ * Version: 6.5.1
+ *
+ * Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+/**
+ * This file implements the glArrayElement() function.
+ * It involves looking at the format/type of all the enabled vertex arrays
+ * and emitting a list of pointers to functions which set the per-vertex
+ * state for the element/index.
+ */
+
+
+/* Author:
+ * Keith Whitwell <keith@tungstengraphics.com>
+ */
+
+#include "glheader.h"
+#include "api_arrayelt.h"
+#include "bufferobj.h"
+#include "context.h"
+#include "imports.h"
+#include "macros.h"
+#include "mfeatures.h"
+#include "mtypes.h"
+#include "main/dispatch.h"
+
+typedef void (GLAPIENTRY *array_func)( const void * );
+
+typedef struct {
+ const struct gl_client_array *array;
+ int offset;
+} AEarray;
+
+typedef void (GLAPIENTRY *attrib_func)( GLuint indx, const void *data );
+
+typedef struct {
+ const struct gl_client_array *array;
+ attrib_func func;
+ GLuint index;
+} AEattrib;
+
+typedef struct {
+ AEarray arrays[32];
+ AEattrib attribs[VERT_ATTRIB_MAX + 1];
+ GLuint NewState;
+
+ struct gl_buffer_object *vbo[VERT_ATTRIB_MAX];
+ GLuint nr_vbos;
+ GLboolean mapped_vbos;
+
+} AEcontext;
+
+#define AE_CONTEXT(ctx) ((AEcontext *)(ctx)->aelt_context)
+
+
+/*
+ * Convert GL_BYTE, GL_UNSIGNED_BYTE, .. GL_DOUBLE into an integer
+ * in the range [0, 7]. Luckily these type tokens are sequentially
+ * numbered in gl.h, except for GL_DOUBLE.
+ */
+#define TYPE_IDX(t) ( (t) == GL_DOUBLE ? 7 : (t) & 7 )
+
+#define NUM_TYPES 8
+
+
+#if FEATURE_arrayelt
+
+
+static const int ColorFuncs[2][NUM_TYPES] = {
+ {
+ _gloffset_Color3bv,
+ _gloffset_Color3ubv,
+ _gloffset_Color3sv,
+ _gloffset_Color3usv,
+ _gloffset_Color3iv,
+ _gloffset_Color3uiv,
+ _gloffset_Color3fv,
+ _gloffset_Color3dv,
+ },
+ {
+ _gloffset_Color4bv,
+ _gloffset_Color4ubv,
+ _gloffset_Color4sv,
+ _gloffset_Color4usv,
+ _gloffset_Color4iv,
+ _gloffset_Color4uiv,
+ _gloffset_Color4fv,
+ _gloffset_Color4dv,
+ },
+};
+
+static const int VertexFuncs[3][NUM_TYPES] = {
+ {
+ -1,
+ -1,
+ _gloffset_Vertex2sv,
+ -1,
+ _gloffset_Vertex2iv,
+ -1,
+ _gloffset_Vertex2fv,
+ _gloffset_Vertex2dv,
+ },
+ {
+ -1,
+ -1,
+ _gloffset_Vertex3sv,
+ -1,
+ _gloffset_Vertex3iv,
+ -1,
+ _gloffset_Vertex3fv,
+ _gloffset_Vertex3dv,
+ },
+ {
+ -1,
+ -1,
+ _gloffset_Vertex4sv,
+ -1,
+ _gloffset_Vertex4iv,
+ -1,
+ _gloffset_Vertex4fv,
+ _gloffset_Vertex4dv,
+ },
+};
+
+static const int IndexFuncs[NUM_TYPES] = {
+ -1,
+ _gloffset_Indexubv,
+ _gloffset_Indexsv,
+ -1,
+ _gloffset_Indexiv,
+ -1,
+ _gloffset_Indexfv,
+ _gloffset_Indexdv,
+};
+
+static const int NormalFuncs[NUM_TYPES] = {
+ _gloffset_Normal3bv,
+ -1,
+ _gloffset_Normal3sv,
+ -1,
+ _gloffset_Normal3iv,
+ -1,
+ _gloffset_Normal3fv,
+ _gloffset_Normal3dv,
+};
+
+/* Note: _gloffset_* for these may not be a compile-time constant. */
+static int SecondaryColorFuncs[NUM_TYPES];
+static int FogCoordFuncs[NUM_TYPES];
+
+
+/**
+ ** GL_NV_vertex_program
+ **/
+
+/* GL_BYTE attributes */
+
+static void GLAPIENTRY
+VertexAttrib1NbvNV(GLuint index, const GLbyte *v)
+{
+ CALL_VertexAttrib1fNV(GET_DISPATCH(), (index, BYTE_TO_FLOAT(v[0])));
+}
+
+static void GLAPIENTRY
+VertexAttrib1bvNV(GLuint index, const GLbyte *v)
+{
+ CALL_VertexAttrib1fNV(GET_DISPATCH(), (index, (GLfloat)v[0]));
+}
+
+static void GLAPIENTRY
+VertexAttrib2NbvNV(GLuint index, const GLbyte *v)
+{
+ CALL_VertexAttrib2fNV(GET_DISPATCH(), (index, BYTE_TO_FLOAT(v[0]), BYTE_TO_FLOAT(v[1])));
+}
+
+static void GLAPIENTRY
+VertexAttrib2bvNV(GLuint index, const GLbyte *v)
+{
+ CALL_VertexAttrib2fNV(GET_DISPATCH(), (index, (GLfloat)v[0], (GLfloat)v[1]));
+}
+
+static void GLAPIENTRY
+VertexAttrib3NbvNV(GLuint index, const GLbyte *v)
+{
+ CALL_VertexAttrib3fNV(GET_DISPATCH(), (index, BYTE_TO_FLOAT(v[0]),
+ BYTE_TO_FLOAT(v[1]),
+ BYTE_TO_FLOAT(v[2])));
+}
+
+static void GLAPIENTRY
+VertexAttrib3bvNV(GLuint index, const GLbyte *v)
+{
+ CALL_VertexAttrib3fNV(GET_DISPATCH(), (index, (GLfloat)v[0], (GLfloat)v[1], (GLfloat)v[2]));
+}
+
+static void GLAPIENTRY
+VertexAttrib4NbvNV(GLuint index, const GLbyte *v)
+{
+ CALL_VertexAttrib4fNV(GET_DISPATCH(), (index, BYTE_TO_FLOAT(v[0]),
+ BYTE_TO_FLOAT(v[1]),
+ BYTE_TO_FLOAT(v[2]),
+ BYTE_TO_FLOAT(v[3])));
+}
+
+static void GLAPIENTRY
+VertexAttrib4bvNV(GLuint index, const GLbyte *v)
+{
+ CALL_VertexAttrib4fNV(GET_DISPATCH(), (index, (GLfloat)v[0], (GLfloat)v[1], (GLfloat)v[2], (GLfloat)v[3]));
+}
+
+/* GL_UNSIGNED_BYTE attributes */
+
+static void GLAPIENTRY
+VertexAttrib1NubvNV(GLuint index, const GLubyte *v)
+{
+ CALL_VertexAttrib1fNV(GET_DISPATCH(), (index, UBYTE_TO_FLOAT(v[0])));
+}
+
+static void GLAPIENTRY
+VertexAttrib1ubvNV(GLuint index, const GLubyte *v)
+{
+ CALL_VertexAttrib1fNV(GET_DISPATCH(), (index, (GLfloat)v[0]));
+}
+
+static void GLAPIENTRY
+VertexAttrib2NubvNV(GLuint index, const GLubyte *v)
+{
+ CALL_VertexAttrib2fNV(GET_DISPATCH(), (index, UBYTE_TO_FLOAT(v[0]),
+ UBYTE_TO_FLOAT(v[1])));
+}
+
+static void GLAPIENTRY
+VertexAttrib2ubvNV(GLuint index, const GLubyte *v)
+{
+ CALL_VertexAttrib2fNV(GET_DISPATCH(), (index, (GLfloat)v[0], (GLfloat)v[1]));
+}
+
+static void GLAPIENTRY
+VertexAttrib3NubvNV(GLuint index, const GLubyte *v)
+{
+ CALL_VertexAttrib3fNV(GET_DISPATCH(), (index, UBYTE_TO_FLOAT(v[0]),
+ UBYTE_TO_FLOAT(v[1]),
+ UBYTE_TO_FLOAT(v[2])));
+}
+static void GLAPIENTRY
+VertexAttrib3ubvNV(GLuint index, const GLubyte *v)
+{
+ CALL_VertexAttrib3fNV(GET_DISPATCH(), (index, (GLfloat)v[0],
+ (GLfloat)v[1], (GLfloat)v[2]));
+}
+
+static void GLAPIENTRY
+VertexAttrib4NubvNV(GLuint index, const GLubyte *v)
+{
+ CALL_VertexAttrib4fNV(GET_DISPATCH(), (index, UBYTE_TO_FLOAT(v[0]),
+ UBYTE_TO_FLOAT(v[1]),
+ UBYTE_TO_FLOAT(v[2]),
+ UBYTE_TO_FLOAT(v[3])));
+}
+
+static void GLAPIENTRY
+VertexAttrib4ubvNV(GLuint index, const GLubyte *v)
+{
+ CALL_VertexAttrib4fNV(GET_DISPATCH(), (index, (GLfloat)v[0],
+ (GLfloat)v[1], (GLfloat)v[2],
+ (GLfloat)v[3]));
+}
+
+/* GL_SHORT attributes */
+
+static void GLAPIENTRY
+VertexAttrib1NsvNV(GLuint index, const GLshort *v)
+{
+ CALL_VertexAttrib1fNV(GET_DISPATCH(), (index, SHORT_TO_FLOAT(v[0])));
+}
+
+static void GLAPIENTRY
+VertexAttrib1svNV(GLuint index, const GLshort *v)
+{
+ CALL_VertexAttrib1fNV(GET_DISPATCH(), (index, (GLfloat)v[0]));
+}
+
+static void GLAPIENTRY
+VertexAttrib2NsvNV(GLuint index, const GLshort *v)
+{
+ CALL_VertexAttrib2fNV(GET_DISPATCH(), (index, SHORT_TO_FLOAT(v[0]),
+ SHORT_TO_FLOAT(v[1])));
+}
+
+static void GLAPIENTRY
+VertexAttrib2svNV(GLuint index, const GLshort *v)
+{
+ CALL_VertexAttrib2fNV(GET_DISPATCH(), (index, (GLfloat)v[0], (GLfloat)v[1]));
+}
+
+static void GLAPIENTRY
+VertexAttrib3NsvNV(GLuint index, const GLshort *v)
+{
+ CALL_VertexAttrib3fNV(GET_DISPATCH(), (index, SHORT_TO_FLOAT(v[0]),
+ SHORT_TO_FLOAT(v[1]),
+ SHORT_TO_FLOAT(v[2])));
+}
+
+static void GLAPIENTRY
+VertexAttrib3svNV(GLuint index, const GLshort *v)
+{
+ CALL_VertexAttrib3fNV(GET_DISPATCH(), (index, (GLfloat)v[0], (GLfloat)v[1],
+ (GLfloat)v[2]));
+}
+
+static void GLAPIENTRY
+VertexAttrib4NsvNV(GLuint index, const GLshort *v)
+{
+ CALL_VertexAttrib4fNV(GET_DISPATCH(), (index, SHORT_TO_FLOAT(v[0]),
+ SHORT_TO_FLOAT(v[1]),
+ SHORT_TO_FLOAT(v[2]),
+ SHORT_TO_FLOAT(v[3])));
+}
+
+static void GLAPIENTRY
+VertexAttrib4svNV(GLuint index, const GLshort *v)
+{
+ CALL_VertexAttrib4fNV(GET_DISPATCH(), (index, (GLfloat)v[0], (GLfloat)v[1],
+ (GLfloat)v[2], (GLfloat)v[3]));
+}
+
+/* GL_UNSIGNED_SHORT attributes */
+
+static void GLAPIENTRY
+VertexAttrib1NusvNV(GLuint index, const GLushort *v)
+{
+ CALL_VertexAttrib1fNV(GET_DISPATCH(), (index, USHORT_TO_FLOAT(v[0])));
+}
+
+static void GLAPIENTRY
+VertexAttrib1usvNV(GLuint index, const GLushort *v)
+{
+ CALL_VertexAttrib1fNV(GET_DISPATCH(), (index, (GLfloat)v[0]));
+}
+
+static void GLAPIENTRY
+VertexAttrib2NusvNV(GLuint index, const GLushort *v)
+{
+ CALL_VertexAttrib2fNV(GET_DISPATCH(), (index, USHORT_TO_FLOAT(v[0]),
+ USHORT_TO_FLOAT(v[1])));
+}
+
+static void GLAPIENTRY
+VertexAttrib2usvNV(GLuint index, const GLushort *v)
+{
+ CALL_VertexAttrib2fNV(GET_DISPATCH(), (index, (GLfloat)v[0],
+ (GLfloat)v[1]));
+}
+
+static void GLAPIENTRY
+VertexAttrib3NusvNV(GLuint index, const GLushort *v)
+{
+ CALL_VertexAttrib3fNV(GET_DISPATCH(), (index, USHORT_TO_FLOAT(v[0]),
+ USHORT_TO_FLOAT(v[1]),
+ USHORT_TO_FLOAT(v[2])));
+}
+
+static void GLAPIENTRY
+VertexAttrib3usvNV(GLuint index, const GLushort *v)
+{
+ CALL_VertexAttrib3fNV(GET_DISPATCH(), (index, (GLfloat)v[0], (GLfloat)v[1],
+ (GLfloat)v[2]));
+}
+
+static void GLAPIENTRY
+VertexAttrib4NusvNV(GLuint index, const GLushort *v)
+{
+ CALL_VertexAttrib4fNV(GET_DISPATCH(), (index, USHORT_TO_FLOAT(v[0]),
+ USHORT_TO_FLOAT(v[1]),
+ USHORT_TO_FLOAT(v[2]),
+ USHORT_TO_FLOAT(v[3])));
+}
+
+static void GLAPIENTRY
+VertexAttrib4usvNV(GLuint index, const GLushort *v)
+{
+ CALL_VertexAttrib4fNV(GET_DISPATCH(), (index, (GLfloat)v[0], (GLfloat)v[1],
+ (GLfloat)v[2], (GLfloat)v[3]));
+}
+
+/* GL_INT attributes */
+
+static void GLAPIENTRY
+VertexAttrib1NivNV(GLuint index, const GLint *v)
+{
+ CALL_VertexAttrib1fNV(GET_DISPATCH(), (index, INT_TO_FLOAT(v[0])));
+}
+
+static void GLAPIENTRY
+VertexAttrib1ivNV(GLuint index, const GLint *v)
+{
+ CALL_VertexAttrib1fNV(GET_DISPATCH(), (index, (GLfloat)v[0]));
+}
+
+static void GLAPIENTRY
+VertexAttrib2NivNV(GLuint index, const GLint *v)
+{
+ CALL_VertexAttrib2fNV(GET_DISPATCH(), (index, INT_TO_FLOAT(v[0]),
+ INT_TO_FLOAT(v[1])));
+}
+
+static void GLAPIENTRY
+VertexAttrib2ivNV(GLuint index, const GLint *v)
+{
+ CALL_VertexAttrib2fNV(GET_DISPATCH(), (index, (GLfloat)v[0], (GLfloat)v[1]));
+}
+
+static void GLAPIENTRY
+VertexAttrib3NivNV(GLuint index, const GLint *v)
+{
+ CALL_VertexAttrib3fNV(GET_DISPATCH(), (index, INT_TO_FLOAT(v[0]),
+ INT_TO_FLOAT(v[1]),
+ INT_TO_FLOAT(v[2])));
+}
+
+static void GLAPIENTRY
+VertexAttrib3ivNV(GLuint index, const GLint *v)
+{
+ CALL_VertexAttrib3fNV(GET_DISPATCH(), (index, (GLfloat)v[0], (GLfloat)v[1],
+ (GLfloat)v[2]));
+}
+
+static void GLAPIENTRY
+VertexAttrib4NivNV(GLuint index, const GLint *v)
+{
+ CALL_VertexAttrib4fNV(GET_DISPATCH(), (index, INT_TO_FLOAT(v[0]),
+ INT_TO_FLOAT(v[1]),
+ INT_TO_FLOAT(v[2]),
+ INT_TO_FLOAT(v[3])));
+}
+
+static void GLAPIENTRY
+VertexAttrib4ivNV(GLuint index, const GLint *v)
+{
+ CALL_VertexAttrib4fNV(GET_DISPATCH(), (index, (GLfloat)v[0], (GLfloat)v[1],
+ (GLfloat)v[2], (GLfloat)v[3]));
+}
+
+/* GL_UNSIGNED_INT attributes */
+
+static void GLAPIENTRY
+VertexAttrib1NuivNV(GLuint index, const GLuint *v)
+{
+ CALL_VertexAttrib1fNV(GET_DISPATCH(), (index, UINT_TO_FLOAT(v[0])));
+}
+
+static void GLAPIENTRY
+VertexAttrib1uivNV(GLuint index, const GLuint *v)
+{
+ CALL_VertexAttrib1fNV(GET_DISPATCH(), (index, (GLfloat)v[0]));
+}
+
+static void GLAPIENTRY
+VertexAttrib2NuivNV(GLuint index, const GLuint *v)
+{
+ CALL_VertexAttrib2fNV(GET_DISPATCH(), (index, UINT_TO_FLOAT(v[0]),
+ UINT_TO_FLOAT(v[1])));
+}
+
+static void GLAPIENTRY
+VertexAttrib2uivNV(GLuint index, const GLuint *v)
+{
+ CALL_VertexAttrib2fNV(GET_DISPATCH(), (index, (GLfloat)v[0],
+ (GLfloat)v[1]));
+}
+
+static void GLAPIENTRY
+VertexAttrib3NuivNV(GLuint index, const GLuint *v)
+{
+ CALL_VertexAttrib3fNV(GET_DISPATCH(), (index, UINT_TO_FLOAT(v[0]),
+ UINT_TO_FLOAT(v[1]),
+ UINT_TO_FLOAT(v[2])));
+}
+
+static void GLAPIENTRY
+VertexAttrib3uivNV(GLuint index, const GLuint *v)
+{
+ CALL_VertexAttrib3fNV(GET_DISPATCH(), (index, (GLfloat)v[0], (GLfloat)v[1],
+ (GLfloat)v[2]));
+}
+
+static void GLAPIENTRY
+VertexAttrib4NuivNV(GLuint index, const GLuint *v)
+{
+ CALL_VertexAttrib4fNV(GET_DISPATCH(), (index, UINT_TO_FLOAT(v[0]),
+ UINT_TO_FLOAT(v[1]),
+ UINT_TO_FLOAT(v[2]),
+ UINT_TO_FLOAT(v[3])));
+}
+
+static void GLAPIENTRY
+VertexAttrib4uivNV(GLuint index, const GLuint *v)
+{
+ CALL_VertexAttrib4fNV(GET_DISPATCH(), (index, (GLfloat)v[0], (GLfloat)v[1],
+ (GLfloat)v[2], (GLfloat)v[3]));
+}
+
+/* GL_FLOAT attributes */
+
+static void GLAPIENTRY
+VertexAttrib1fvNV(GLuint index, const GLfloat *v)
+{
+ CALL_VertexAttrib1fvNV(GET_DISPATCH(), (index, v));
+}
+
+static void GLAPIENTRY
+VertexAttrib2fvNV(GLuint index, const GLfloat *v)
+{
+ CALL_VertexAttrib2fvNV(GET_DISPATCH(), (index, v));
+}
+
+static void GLAPIENTRY
+VertexAttrib3fvNV(GLuint index, const GLfloat *v)
+{
+ CALL_VertexAttrib3fvNV(GET_DISPATCH(), (index, v));
+}
+
+static void GLAPIENTRY
+VertexAttrib4fvNV(GLuint index, const GLfloat *v)
+{
+ CALL_VertexAttrib4fvNV(GET_DISPATCH(), (index, v));
+}
+
+/* GL_DOUBLE attributes */
+
+static void GLAPIENTRY
+VertexAttrib1dvNV(GLuint index, const GLdouble *v)
+{
+ CALL_VertexAttrib1dvNV(GET_DISPATCH(), (index, v));
+}
+
+static void GLAPIENTRY
+VertexAttrib2dvNV(GLuint index, const GLdouble *v)
+{
+ CALL_VertexAttrib2dvNV(GET_DISPATCH(), (index, v));
+}
+
+static void GLAPIENTRY
+VertexAttrib3dvNV(GLuint index, const GLdouble *v)
+{
+ CALL_VertexAttrib3dvNV(GET_DISPATCH(), (index, v));
+}
+
+static void GLAPIENTRY
+VertexAttrib4dvNV(GLuint index, const GLdouble *v)
+{
+ CALL_VertexAttrib4dvNV(GET_DISPATCH(), (index, v));
+}
+
+
+/*
+ * Array [size][type] of VertexAttrib functions
+ */
+static attrib_func AttribFuncsNV[2][4][NUM_TYPES] = {
+ {
+ /* non-normalized */
+ {
+ /* size 1 */
+ (attrib_func) VertexAttrib1bvNV,
+ (attrib_func) VertexAttrib1ubvNV,
+ (attrib_func) VertexAttrib1svNV,
+ (attrib_func) VertexAttrib1usvNV,
+ (attrib_func) VertexAttrib1ivNV,
+ (attrib_func) VertexAttrib1uivNV,
+ (attrib_func) VertexAttrib1fvNV,
+ (attrib_func) VertexAttrib1dvNV
+ },
+ {
+ /* size 2 */
+ (attrib_func) VertexAttrib2bvNV,
+ (attrib_func) VertexAttrib2ubvNV,
+ (attrib_func) VertexAttrib2svNV,
+ (attrib_func) VertexAttrib2usvNV,
+ (attrib_func) VertexAttrib2ivNV,
+ (attrib_func) VertexAttrib2uivNV,
+ (attrib_func) VertexAttrib2fvNV,
+ (attrib_func) VertexAttrib2dvNV
+ },
+ {
+ /* size 3 */
+ (attrib_func) VertexAttrib3bvNV,
+ (attrib_func) VertexAttrib3ubvNV,
+ (attrib_func) VertexAttrib3svNV,
+ (attrib_func) VertexAttrib3usvNV,
+ (attrib_func) VertexAttrib3ivNV,
+ (attrib_func) VertexAttrib3uivNV,
+ (attrib_func) VertexAttrib3fvNV,
+ (attrib_func) VertexAttrib3dvNV
+ },
+ {
+ /* size 4 */
+ (attrib_func) VertexAttrib4bvNV,
+ (attrib_func) VertexAttrib4ubvNV,
+ (attrib_func) VertexAttrib4svNV,
+ (attrib_func) VertexAttrib4usvNV,
+ (attrib_func) VertexAttrib4ivNV,
+ (attrib_func) VertexAttrib4uivNV,
+ (attrib_func) VertexAttrib4fvNV,
+ (attrib_func) VertexAttrib4dvNV
+ }
+ },
+ {
+ /* normalized (except for float/double) */
+ {
+ /* size 1 */
+ (attrib_func) VertexAttrib1NbvNV,
+ (attrib_func) VertexAttrib1NubvNV,
+ (attrib_func) VertexAttrib1NsvNV,
+ (attrib_func) VertexAttrib1NusvNV,
+ (attrib_func) VertexAttrib1NivNV,
+ (attrib_func) VertexAttrib1NuivNV,
+ (attrib_func) VertexAttrib1fvNV,
+ (attrib_func) VertexAttrib1dvNV
+ },
+ {
+ /* size 2 */
+ (attrib_func) VertexAttrib2NbvNV,
+ (attrib_func) VertexAttrib2NubvNV,
+ (attrib_func) VertexAttrib2NsvNV,
+ (attrib_func) VertexAttrib2NusvNV,
+ (attrib_func) VertexAttrib2NivNV,
+ (attrib_func) VertexAttrib2NuivNV,
+ (attrib_func) VertexAttrib2fvNV,
+ (attrib_func) VertexAttrib2dvNV
+ },
+ {
+ /* size 3 */
+ (attrib_func) VertexAttrib3NbvNV,
+ (attrib_func) VertexAttrib3NubvNV,
+ (attrib_func) VertexAttrib3NsvNV,
+ (attrib_func) VertexAttrib3NusvNV,
+ (attrib_func) VertexAttrib3NivNV,
+ (attrib_func) VertexAttrib3NuivNV,
+ (attrib_func) VertexAttrib3fvNV,
+ (attrib_func) VertexAttrib3dvNV
+ },
+ {
+ /* size 4 */
+ (attrib_func) VertexAttrib4NbvNV,
+ (attrib_func) VertexAttrib4NubvNV,
+ (attrib_func) VertexAttrib4NsvNV,
+ (attrib_func) VertexAttrib4NusvNV,
+ (attrib_func) VertexAttrib4NivNV,
+ (attrib_func) VertexAttrib4NuivNV,
+ (attrib_func) VertexAttrib4fvNV,
+ (attrib_func) VertexAttrib4dvNV
+ }
+ }
+};
+
+
+/**
+ ** GL_ARB_vertex_program
+ **/
+
+/* GL_BYTE attributes */
+
+static void GLAPIENTRY
+VertexAttrib1NbvARB(GLuint index, const GLbyte *v)
+{
+ CALL_VertexAttrib1fARB(GET_DISPATCH(), (index, BYTE_TO_FLOAT(v[0])));
+}
+
+static void GLAPIENTRY
+VertexAttrib1bvARB(GLuint index, const GLbyte *v)
+{
+ CALL_VertexAttrib1fARB(GET_DISPATCH(), (index, (GLfloat)v[0]));
+}
+
+static void GLAPIENTRY
+VertexAttrib2NbvARB(GLuint index, const GLbyte *v)
+{
+ CALL_VertexAttrib2fARB(GET_DISPATCH(), (index, BYTE_TO_FLOAT(v[0]), BYTE_TO_FLOAT(v[1])));
+}
+
+static void GLAPIENTRY
+VertexAttrib2bvARB(GLuint index, const GLbyte *v)
+{
+ CALL_VertexAttrib2fARB(GET_DISPATCH(), (index, (GLfloat)v[0], (GLfloat)v[1]));
+}
+
+static void GLAPIENTRY
+VertexAttrib3NbvARB(GLuint index, const GLbyte *v)
+{
+ CALL_VertexAttrib3fARB(GET_DISPATCH(), (index, BYTE_TO_FLOAT(v[0]),
+ BYTE_TO_FLOAT(v[1]),
+ BYTE_TO_FLOAT(v[2])));
+}
+
+static void GLAPIENTRY
+VertexAttrib3bvARB(GLuint index, const GLbyte *v)
+{
+ CALL_VertexAttrib3fARB(GET_DISPATCH(), (index, (GLfloat)v[0], (GLfloat)v[1], (GLfloat)v[2]));
+}
+
+static void GLAPIENTRY
+VertexAttrib4NbvARB(GLuint index, const GLbyte *v)
+{
+ CALL_VertexAttrib4fARB(GET_DISPATCH(), (index, BYTE_TO_FLOAT(v[0]),
+ BYTE_TO_FLOAT(v[1]),
+ BYTE_TO_FLOAT(v[2]),
+ BYTE_TO_FLOAT(v[3])));
+}
+
+static void GLAPIENTRY
+VertexAttrib4bvARB(GLuint index, const GLbyte *v)
+{
+ CALL_VertexAttrib4fARB(GET_DISPATCH(), (index, (GLfloat)v[0], (GLfloat)v[1], (GLfloat)v[2], (GLfloat)v[3]));
+}
+
+/* GL_UNSIGNED_BYTE attributes */
+
+static void GLAPIENTRY
+VertexAttrib1NubvARB(GLuint index, const GLubyte *v)
+{
+ CALL_VertexAttrib1fARB(GET_DISPATCH(), (index, UBYTE_TO_FLOAT(v[0])));
+}
+
+static void GLAPIENTRY
+VertexAttrib1ubvARB(GLuint index, const GLubyte *v)
+{
+ CALL_VertexAttrib1fARB(GET_DISPATCH(), (index, (GLfloat)v[0]));
+}
+
+static void GLAPIENTRY
+VertexAttrib2NubvARB(GLuint index, const GLubyte *v)
+{
+ CALL_VertexAttrib2fARB(GET_DISPATCH(), (index,
+ UBYTE_TO_FLOAT(v[0]),
+ UBYTE_TO_FLOAT(v[1])));
+}
+
+static void GLAPIENTRY
+VertexAttrib2ubvARB(GLuint index, const GLubyte *v)
+{
+ CALL_VertexAttrib2fARB(GET_DISPATCH(), (index,
+ (GLfloat)v[0], (GLfloat)v[1]));
+}
+
+static void GLAPIENTRY
+VertexAttrib3NubvARB(GLuint index, const GLubyte *v)
+{
+ CALL_VertexAttrib3fARB(GET_DISPATCH(), (index,
+ UBYTE_TO_FLOAT(v[0]),
+ UBYTE_TO_FLOAT(v[1]),
+ UBYTE_TO_FLOAT(v[2])));
+}
+static void GLAPIENTRY
+VertexAttrib3ubvARB(GLuint index, const GLubyte *v)
+{
+ CALL_VertexAttrib3fARB(GET_DISPATCH(), (index,
+ (GLfloat)v[0],
+ (GLfloat)v[1],
+ (GLfloat)v[2]));
+}
+
+static void GLAPIENTRY
+VertexAttrib4NubvARB(GLuint index, const GLubyte *v)
+{
+ CALL_VertexAttrib4fARB(GET_DISPATCH(),
+ (index,
+ UBYTE_TO_FLOAT(v[0]),
+ UBYTE_TO_FLOAT(v[1]),
+ UBYTE_TO_FLOAT(v[2]),
+ UBYTE_TO_FLOAT(v[3])));
+}
+
+static void GLAPIENTRY
+VertexAttrib4ubvARB(GLuint index, const GLubyte *v)
+{
+ CALL_VertexAttrib4fARB(GET_DISPATCH(),
+ (index,
+ (GLfloat)v[0], (GLfloat)v[1],
+ (GLfloat)v[2], (GLfloat)v[3]));
+}
+
+/* GL_SHORT attributes */
+
+static void GLAPIENTRY
+VertexAttrib1NsvARB(GLuint index, const GLshort *v)
+{
+ CALL_VertexAttrib1fARB(GET_DISPATCH(), (index, SHORT_TO_FLOAT(v[0])));
+}
+
+static void GLAPIENTRY
+VertexAttrib1svARB(GLuint index, const GLshort *v)
+{
+ CALL_VertexAttrib1fARB(GET_DISPATCH(), (index, (GLfloat)v[0]));
+}
+
+static void GLAPIENTRY
+VertexAttrib2NsvARB(GLuint index, const GLshort *v)
+{
+ CALL_VertexAttrib2fARB(GET_DISPATCH(),
+ (index, SHORT_TO_FLOAT(v[0]),
+ SHORT_TO_FLOAT(v[1])));
+}
+
+static void GLAPIENTRY
+VertexAttrib2svARB(GLuint index, const GLshort *v)
+{
+ CALL_VertexAttrib2fARB(GET_DISPATCH(),
+ (index, (GLfloat)v[0], (GLfloat)v[1]));
+}
+
+static void GLAPIENTRY
+VertexAttrib3NsvARB(GLuint index, const GLshort *v)
+{
+ CALL_VertexAttrib3fARB(GET_DISPATCH(),
+ (index,
+ SHORT_TO_FLOAT(v[0]),
+ SHORT_TO_FLOAT(v[1]),
+ SHORT_TO_FLOAT(v[2])));
+}
+
+static void GLAPIENTRY
+VertexAttrib3svARB(GLuint index, const GLshort *v)
+{
+ CALL_VertexAttrib3fARB(GET_DISPATCH(),
+ (index,
+ (GLfloat)v[0], (GLfloat)v[1], (GLfloat)v[2]));
+}
+
+static void GLAPIENTRY
+VertexAttrib4NsvARB(GLuint index, const GLshort *v)
+{
+ CALL_VertexAttrib4fARB(GET_DISPATCH(),
+ (index,
+ SHORT_TO_FLOAT(v[0]),
+ SHORT_TO_FLOAT(v[1]),
+ SHORT_TO_FLOAT(v[2]),
+ SHORT_TO_FLOAT(v[3])));
+}
+
+static void GLAPIENTRY
+VertexAttrib4svARB(GLuint index, const GLshort *v)
+{
+ CALL_VertexAttrib4fARB(GET_DISPATCH(), (index, (GLfloat)v[0], (GLfloat)v[1],
+ (GLfloat)v[2], (GLfloat)v[3]));
+}
+
+/* GL_UNSIGNED_SHORT attributes */
+
+static void GLAPIENTRY
+VertexAttrib1NusvARB(GLuint index, const GLushort *v)
+{
+ CALL_VertexAttrib1fARB(GET_DISPATCH(), (index, USHORT_TO_FLOAT(v[0])));
+}
+
+static void GLAPIENTRY
+VertexAttrib1usvARB(GLuint index, const GLushort *v)
+{
+ CALL_VertexAttrib1fARB(GET_DISPATCH(), (index, (GLfloat)v[0]));
+}
+
+static void GLAPIENTRY
+VertexAttrib2NusvARB(GLuint index, const GLushort *v)
+{
+ CALL_VertexAttrib2fARB(GET_DISPATCH(), (index, USHORT_TO_FLOAT(v[0]),
+ USHORT_TO_FLOAT(v[1])));
+}
+
+static void GLAPIENTRY
+VertexAttrib2usvARB(GLuint index, const GLushort *v)
+{
+ CALL_VertexAttrib2fARB(GET_DISPATCH(), (index, (GLfloat)v[0],
+ (GLfloat)v[1]));
+}
+
+static void GLAPIENTRY
+VertexAttrib3NusvARB(GLuint index, const GLushort *v)
+{
+ CALL_VertexAttrib3fARB(GET_DISPATCH(), (index, USHORT_TO_FLOAT(v[0]),
+ USHORT_TO_FLOAT(v[1]),
+ USHORT_TO_FLOAT(v[2])));
+}
+
+static void GLAPIENTRY
+VertexAttrib3usvARB(GLuint index, const GLushort *v)
+{
+ CALL_VertexAttrib3fARB(GET_DISPATCH(), (index, (GLfloat)v[0],
+ (GLfloat)v[1], (GLfloat)v[2]));
+}
+
+static void GLAPIENTRY
+VertexAttrib4NusvARB(GLuint index, const GLushort *v)
+{
+ CALL_VertexAttrib4fARB(GET_DISPATCH(), (index, USHORT_TO_FLOAT(v[0]),
+ USHORT_TO_FLOAT(v[1]),
+ USHORT_TO_FLOAT(v[2]),
+ USHORT_TO_FLOAT(v[3])));
+}
+
+static void GLAPIENTRY
+VertexAttrib4usvARB(GLuint index, const GLushort *v)
+{
+ CALL_VertexAttrib4fARB(GET_DISPATCH(), (index, (GLfloat)v[0], (GLfloat)v[1], (GLfloat)v[2], (GLfloat)v[3]));
+}
+
+/* GL_INT attributes */
+
+static void GLAPIENTRY
+VertexAttrib1NivARB(GLuint index, const GLint *v)
+{
+ CALL_VertexAttrib1fARB(GET_DISPATCH(), (index, INT_TO_FLOAT(v[0])));
+}
+
+static void GLAPIENTRY
+VertexAttrib1ivARB(GLuint index, const GLint *v)
+{
+ CALL_VertexAttrib1fARB(GET_DISPATCH(), (index, (GLfloat)v[0]));
+}
+
+static void GLAPIENTRY
+VertexAttrib2NivARB(GLuint index, const GLint *v)
+{
+ CALL_VertexAttrib2fARB(GET_DISPATCH(), (index, INT_TO_FLOAT(v[0]),
+ INT_TO_FLOAT(v[1])));
+}
+
+static void GLAPIENTRY
+VertexAttrib2ivARB(GLuint index, const GLint *v)
+{
+ CALL_VertexAttrib2fARB(GET_DISPATCH(), (index, (GLfloat)v[0],
+ (GLfloat)v[1]));
+}
+
+static void GLAPIENTRY
+VertexAttrib3NivARB(GLuint index, const GLint *v)
+{
+ CALL_VertexAttrib3fARB(GET_DISPATCH(), (index, INT_TO_FLOAT(v[0]),
+ INT_TO_FLOAT(v[1]),
+ INT_TO_FLOAT(v[2])));
+}
+
+static void GLAPIENTRY
+VertexAttrib3ivARB(GLuint index, const GLint *v)
+{
+ CALL_VertexAttrib3fARB(GET_DISPATCH(), (index, (GLfloat)v[0],
+ (GLfloat)v[1], (GLfloat)v[2]));
+}
+
+static void GLAPIENTRY
+VertexAttrib4NivARB(GLuint index, const GLint *v)
+{
+ CALL_VertexAttrib4fARB(GET_DISPATCH(), (index, INT_TO_FLOAT(v[0]),
+ INT_TO_FLOAT(v[1]),
+ INT_TO_FLOAT(v[2]),
+ INT_TO_FLOAT(v[3])));
+}
+
+static void GLAPIENTRY
+VertexAttrib4ivARB(GLuint index, const GLint *v)
+{
+ CALL_VertexAttrib4fARB(GET_DISPATCH(), (index, (GLfloat)v[0], (GLfloat)v[1],
+ (GLfloat)v[2], (GLfloat)v[3]));
+}
+
+/* GL_UNSIGNED_INT attributes */
+
+static void GLAPIENTRY
+VertexAttrib1NuivARB(GLuint index, const GLuint *v)
+{
+ CALL_VertexAttrib1fARB(GET_DISPATCH(), (index, UINT_TO_FLOAT(v[0])));
+}
+
+static void GLAPIENTRY
+VertexAttrib1uivARB(GLuint index, const GLuint *v)
+{
+ CALL_VertexAttrib1fARB(GET_DISPATCH(), (index, (GLfloat)v[0]));
+}
+
+static void GLAPIENTRY
+VertexAttrib2NuivARB(GLuint index, const GLuint *v)
+{
+ CALL_VertexAttrib2fARB(GET_DISPATCH(), (index, UINT_TO_FLOAT(v[0]),
+ UINT_TO_FLOAT(v[1])));
+}
+
+static void GLAPIENTRY
+VertexAttrib2uivARB(GLuint index, const GLuint *v)
+{
+ CALL_VertexAttrib2fARB(GET_DISPATCH(), (index, (GLfloat)v[0],
+ (GLfloat)v[1]));
+}
+
+static void GLAPIENTRY
+VertexAttrib3NuivARB(GLuint index, const GLuint *v)
+{
+ CALL_VertexAttrib3fARB(GET_DISPATCH(), (index, UINT_TO_FLOAT(v[0]),
+ UINT_TO_FLOAT(v[1]),
+ UINT_TO_FLOAT(v[2])));
+}
+
+static void GLAPIENTRY
+VertexAttrib3uivARB(GLuint index, const GLuint *v)
+{
+ CALL_VertexAttrib3fARB(GET_DISPATCH(), (index, (GLfloat)v[0],
+ (GLfloat)v[1], (GLfloat)v[2]));
+}
+
+static void GLAPIENTRY
+VertexAttrib4NuivARB(GLuint index, const GLuint *v)
+{
+ CALL_VertexAttrib4fARB(GET_DISPATCH(), (index, UINT_TO_FLOAT(v[0]),
+ UINT_TO_FLOAT(v[1]),
+ UINT_TO_FLOAT(v[2]),
+ UINT_TO_FLOAT(v[3])));
+}
+
+static void GLAPIENTRY
+VertexAttrib4uivARB(GLuint index, const GLuint *v)
+{
+ CALL_VertexAttrib4fARB(GET_DISPATCH(), (index, (GLfloat)v[0], (GLfloat)v[1],
+ (GLfloat)v[2], (GLfloat)v[3]));
+}
+
+/* GL_FLOAT attributes */
+
+static void GLAPIENTRY
+VertexAttrib1fvARB(GLuint index, const GLfloat *v)
+{
+ CALL_VertexAttrib1fvARB(GET_DISPATCH(), (index, v));
+}
+
+static void GLAPIENTRY
+VertexAttrib2fvARB(GLuint index, const GLfloat *v)
+{
+ CALL_VertexAttrib2fvARB(GET_DISPATCH(), (index, v));
+}
+
+static void GLAPIENTRY
+VertexAttrib3fvARB(GLuint index, const GLfloat *v)
+{
+ CALL_VertexAttrib3fvARB(GET_DISPATCH(), (index, v));
+}
+
+static void GLAPIENTRY
+VertexAttrib4fvARB(GLuint index, const GLfloat *v)
+{
+ CALL_VertexAttrib4fvARB(GET_DISPATCH(), (index, v));
+}
+
+/* GL_DOUBLE attributes */
+
+static void GLAPIENTRY
+VertexAttrib1dvARB(GLuint index, const GLdouble *v)
+{
+ CALL_VertexAttrib1dvARB(GET_DISPATCH(), (index, v));
+}
+
+static void GLAPIENTRY
+VertexAttrib2dvARB(GLuint index, const GLdouble *v)
+{
+ CALL_VertexAttrib2dvARB(GET_DISPATCH(), (index, v));
+}
+
+static void GLAPIENTRY
+VertexAttrib3dvARB(GLuint index, const GLdouble *v)
+{
+ CALL_VertexAttrib3dvARB(GET_DISPATCH(), (index, v));
+}
+
+static void GLAPIENTRY
+VertexAttrib4dvARB(GLuint index, const GLdouble *v)
+{
+ CALL_VertexAttrib4dvARB(GET_DISPATCH(), (index, v));
+}
+
+
+/**
+ * Integer-valued attributes
+ */
+static void GLAPIENTRY
+VertexAttribI1bv(GLuint index, const GLbyte *v)
+{
+ CALL_VertexAttribI1iEXT(GET_DISPATCH(), (index, v[0]));
+}
+
+static void GLAPIENTRY
+VertexAttribI2bv(GLuint index, const GLbyte *v)
+{
+ CALL_VertexAttribI2iEXT(GET_DISPATCH(), (index, v[0], v[1]));
+}
+
+static void GLAPIENTRY
+VertexAttribI3bv(GLuint index, const GLbyte *v)
+{
+ CALL_VertexAttribI3iEXT(GET_DISPATCH(), (index, v[0], v[1], v[2]));
+}
+
+static void GLAPIENTRY
+VertexAttribI4bv(GLuint index, const GLbyte *v)
+{
+ CALL_VertexAttribI4bvEXT(GET_DISPATCH(), (index, v));
+}
+
+
+static void GLAPIENTRY
+VertexAttribI1ubv(GLuint index, const GLubyte *v)
+{
+ CALL_VertexAttribI1uiEXT(GET_DISPATCH(), (index, v[0]));
+}
+
+static void GLAPIENTRY
+VertexAttribI2ubv(GLuint index, const GLubyte *v)
+{
+ CALL_VertexAttribI2uiEXT(GET_DISPATCH(), (index, v[0], v[1]));
+}
+
+static void GLAPIENTRY
+VertexAttribI3ubv(GLuint index, const GLubyte *v)
+{
+ CALL_VertexAttribI3uiEXT(GET_DISPATCH(), (index, v[0], v[1], v[2]));
+}
+
+static void GLAPIENTRY
+VertexAttribI4ubv(GLuint index, const GLubyte *v)
+{
+ CALL_VertexAttribI4ubvEXT(GET_DISPATCH(), (index, v));
+}
+
+
+
+static void GLAPIENTRY
+VertexAttribI1sv(GLuint index, const GLshort *v)
+{
+ CALL_VertexAttribI1iEXT(GET_DISPATCH(), (index, v[0]));
+}
+
+static void GLAPIENTRY
+VertexAttribI2sv(GLuint index, const GLshort *v)
+{
+ CALL_VertexAttribI2iEXT(GET_DISPATCH(), (index, v[0], v[1]));
+}
+
+static void GLAPIENTRY
+VertexAttribI3sv(GLuint index, const GLshort *v)
+{
+ CALL_VertexAttribI3iEXT(GET_DISPATCH(), (index, v[0], v[1], v[2]));
+}
+
+static void GLAPIENTRY
+VertexAttribI4sv(GLuint index, const GLshort *v)
+{
+ CALL_VertexAttribI4svEXT(GET_DISPATCH(), (index, v));
+}
+
+
+static void GLAPIENTRY
+VertexAttribI1usv(GLuint index, const GLushort *v)
+{
+ CALL_VertexAttribI1uiEXT(GET_DISPATCH(), (index, v[0]));
+}
+
+static void GLAPIENTRY
+VertexAttribI2usv(GLuint index, const GLushort *v)
+{
+ CALL_VertexAttribI2uiEXT(GET_DISPATCH(), (index, v[0], v[1]));
+}
+
+static void GLAPIENTRY
+VertexAttribI3usv(GLuint index, const GLushort *v)
+{
+ CALL_VertexAttribI3uiEXT(GET_DISPATCH(), (index, v[0], v[1], v[2]));
+}
+
+static void GLAPIENTRY
+VertexAttribI4usv(GLuint index, const GLushort *v)
+{
+ CALL_VertexAttribI4usvEXT(GET_DISPATCH(), (index, v));
+}
+
+
+
+static void GLAPIENTRY
+VertexAttribI1iv(GLuint index, const GLint *v)
+{
+ CALL_VertexAttribI1iEXT(GET_DISPATCH(), (index, v[0]));
+}
+
+static void GLAPIENTRY
+VertexAttribI2iv(GLuint index, const GLint *v)
+{
+ CALL_VertexAttribI2iEXT(GET_DISPATCH(), (index, v[0], v[1]));
+}
+
+static void GLAPIENTRY
+VertexAttribI3iv(GLuint index, const GLint *v)
+{
+ CALL_VertexAttribI3iEXT(GET_DISPATCH(), (index, v[0], v[1], v[2]));
+}
+
+static void GLAPIENTRY
+VertexAttribI4iv(GLuint index, const GLint *v)
+{
+ CALL_VertexAttribI4ivEXT(GET_DISPATCH(), (index, v));
+}
+
+
+static void GLAPIENTRY
+VertexAttribI1uiv(GLuint index, const GLuint *v)
+{
+ CALL_VertexAttribI1uiEXT(GET_DISPATCH(), (index, v[0]));
+}
+
+static void GLAPIENTRY
+VertexAttribI2uiv(GLuint index, const GLuint *v)
+{
+ CALL_VertexAttribI2uiEXT(GET_DISPATCH(), (index, v[0], v[1]));
+}
+
+static void GLAPIENTRY
+VertexAttribI3uiv(GLuint index, const GLuint *v)
+{
+ CALL_VertexAttribI3uiEXT(GET_DISPATCH(), (index, v[0], v[1], v[2]));
+}
+
+static void GLAPIENTRY
+VertexAttribI4uiv(GLuint index, const GLuint *v)
+{
+ CALL_VertexAttribI4uivEXT(GET_DISPATCH(), (index, v));
+}
+
+
+
+
+/*
+ * Array [unnormalized/normalized/integer][size][type] of VertexAttrib
+ * functions
+ */
+static attrib_func AttribFuncsARB[3][4][NUM_TYPES] = {
+ {
+ /* non-normalized */
+ {
+ /* size 1 */
+ (attrib_func) VertexAttrib1bvARB,
+ (attrib_func) VertexAttrib1ubvARB,
+ (attrib_func) VertexAttrib1svARB,
+ (attrib_func) VertexAttrib1usvARB,
+ (attrib_func) VertexAttrib1ivARB,
+ (attrib_func) VertexAttrib1uivARB,
+ (attrib_func) VertexAttrib1fvARB,
+ (attrib_func) VertexAttrib1dvARB
+ },
+ {
+ /* size 2 */
+ (attrib_func) VertexAttrib2bvARB,
+ (attrib_func) VertexAttrib2ubvARB,
+ (attrib_func) VertexAttrib2svARB,
+ (attrib_func) VertexAttrib2usvARB,
+ (attrib_func) VertexAttrib2ivARB,
+ (attrib_func) VertexAttrib2uivARB,
+ (attrib_func) VertexAttrib2fvARB,
+ (attrib_func) VertexAttrib2dvARB
+ },
+ {
+ /* size 3 */
+ (attrib_func) VertexAttrib3bvARB,
+ (attrib_func) VertexAttrib3ubvARB,
+ (attrib_func) VertexAttrib3svARB,
+ (attrib_func) VertexAttrib3usvARB,
+ (attrib_func) VertexAttrib3ivARB,
+ (attrib_func) VertexAttrib3uivARB,
+ (attrib_func) VertexAttrib3fvARB,
+ (attrib_func) VertexAttrib3dvARB
+ },
+ {
+ /* size 4 */
+ (attrib_func) VertexAttrib4bvARB,
+ (attrib_func) VertexAttrib4ubvARB,
+ (attrib_func) VertexAttrib4svARB,
+ (attrib_func) VertexAttrib4usvARB,
+ (attrib_func) VertexAttrib4ivARB,
+ (attrib_func) VertexAttrib4uivARB,
+ (attrib_func) VertexAttrib4fvARB,
+ (attrib_func) VertexAttrib4dvARB
+ }
+ },
+ {
+ /* normalized (except for float/double) */
+ {
+ /* size 1 */
+ (attrib_func) VertexAttrib1NbvARB,
+ (attrib_func) VertexAttrib1NubvARB,
+ (attrib_func) VertexAttrib1NsvARB,
+ (attrib_func) VertexAttrib1NusvARB,
+ (attrib_func) VertexAttrib1NivARB,
+ (attrib_func) VertexAttrib1NuivARB,
+ (attrib_func) VertexAttrib1fvARB,
+ (attrib_func) VertexAttrib1dvARB
+ },
+ {
+ /* size 2 */
+ (attrib_func) VertexAttrib2NbvARB,
+ (attrib_func) VertexAttrib2NubvARB,
+ (attrib_func) VertexAttrib2NsvARB,
+ (attrib_func) VertexAttrib2NusvARB,
+ (attrib_func) VertexAttrib2NivARB,
+ (attrib_func) VertexAttrib2NuivARB,
+ (attrib_func) VertexAttrib2fvARB,
+ (attrib_func) VertexAttrib2dvARB
+ },
+ {
+ /* size 3 */
+ (attrib_func) VertexAttrib3NbvARB,
+ (attrib_func) VertexAttrib3NubvARB,
+ (attrib_func) VertexAttrib3NsvARB,
+ (attrib_func) VertexAttrib3NusvARB,
+ (attrib_func) VertexAttrib3NivARB,
+ (attrib_func) VertexAttrib3NuivARB,
+ (attrib_func) VertexAttrib3fvARB,
+ (attrib_func) VertexAttrib3dvARB
+ },
+ {
+ /* size 4 */
+ (attrib_func) VertexAttrib4NbvARB,
+ (attrib_func) VertexAttrib4NubvARB,
+ (attrib_func) VertexAttrib4NsvARB,
+ (attrib_func) VertexAttrib4NusvARB,
+ (attrib_func) VertexAttrib4NivARB,
+ (attrib_func) VertexAttrib4NuivARB,
+ (attrib_func) VertexAttrib4fvARB,
+ (attrib_func) VertexAttrib4dvARB
+ }
+ },
+
+ {
+ /* integer-valued */
+ {
+ /* size 1 */
+ (attrib_func) VertexAttribI1bv,
+ (attrib_func) VertexAttribI1ubv,
+ (attrib_func) VertexAttribI1sv,
+ (attrib_func) VertexAttribI1usv,
+ (attrib_func) VertexAttribI1iv,
+ (attrib_func) VertexAttribI1uiv,
+ NULL, /* GL_FLOAT */
+ NULL /* GL_DOUBLE */
+ },
+ {
+ /* size 2 */
+ (attrib_func) VertexAttribI2bv,
+ (attrib_func) VertexAttribI2ubv,
+ (attrib_func) VertexAttribI2sv,
+ (attrib_func) VertexAttribI2usv,
+ (attrib_func) VertexAttribI2iv,
+ (attrib_func) VertexAttribI2uiv,
+ NULL, /* GL_FLOAT */
+ NULL /* GL_DOUBLE */
+ },
+ {
+ /* size 3 */
+ (attrib_func) VertexAttribI3bv,
+ (attrib_func) VertexAttribI3ubv,
+ (attrib_func) VertexAttribI3sv,
+ (attrib_func) VertexAttribI3usv,
+ (attrib_func) VertexAttribI3iv,
+ (attrib_func) VertexAttribI3uiv,
+ NULL, /* GL_FLOAT */
+ NULL /* GL_DOUBLE */
+ },
+ {
+ /* size 4 */
+ (attrib_func) VertexAttribI4bv,
+ (attrib_func) VertexAttribI4ubv,
+ (attrib_func) VertexAttribI4sv,
+ (attrib_func) VertexAttribI4usv,
+ (attrib_func) VertexAttribI4iv,
+ (attrib_func) VertexAttribI4uiv,
+ NULL, /* GL_FLOAT */
+ NULL /* GL_DOUBLE */
+ }
+ }
+};
+
+/**********************************************************************/
+
+
+GLboolean _ae_create_context( struct gl_context *ctx )
+{
+ if (ctx->aelt_context)
+ return GL_TRUE;
+
+ /* These _gloffset_* values may not be compile-time constants */
+ SecondaryColorFuncs[0] = _gloffset_SecondaryColor3bvEXT;
+ SecondaryColorFuncs[1] = _gloffset_SecondaryColor3ubvEXT;
+ SecondaryColorFuncs[2] = _gloffset_SecondaryColor3svEXT;
+ SecondaryColorFuncs[3] = _gloffset_SecondaryColor3usvEXT;
+ SecondaryColorFuncs[4] = _gloffset_SecondaryColor3ivEXT;
+ SecondaryColorFuncs[5] = _gloffset_SecondaryColor3uivEXT;
+ SecondaryColorFuncs[6] = _gloffset_SecondaryColor3fvEXT;
+ SecondaryColorFuncs[7] = _gloffset_SecondaryColor3dvEXT;
+
+ FogCoordFuncs[0] = -1;
+ FogCoordFuncs[1] = -1;
+ FogCoordFuncs[2] = -1;
+ FogCoordFuncs[3] = -1;
+ FogCoordFuncs[4] = -1;
+ FogCoordFuncs[5] = -1;
+ FogCoordFuncs[6] = _gloffset_FogCoordfvEXT;
+ FogCoordFuncs[7] = _gloffset_FogCoorddvEXT;
+
+ ctx->aelt_context = CALLOC( sizeof(AEcontext) );
+ if (!ctx->aelt_context)
+ return GL_FALSE;
+
+ AE_CONTEXT(ctx)->NewState = ~0;
+ return GL_TRUE;
+}
+
+
+void _ae_destroy_context( struct gl_context *ctx )
+{
+ if ( AE_CONTEXT( ctx ) ) {
+ FREE( ctx->aelt_context );
+ ctx->aelt_context = NULL;
+ }
+}
+
+static void check_vbo( AEcontext *actx,
+ struct gl_buffer_object *vbo )
+{
+ if (_mesa_is_bufferobj(vbo) && !_mesa_bufferobj_mapped(vbo)) {
+ GLuint i;
+ for (i = 0; i < actx->nr_vbos; i++)
+ if (actx->vbo[i] == vbo)
+ return;
+ assert(actx->nr_vbos < VERT_ATTRIB_MAX);
+ actx->vbo[actx->nr_vbos++] = vbo;
+ }
+}
+
+
+/**
+ * Make a list of per-vertex functions to call for each glArrayElement call.
+ * These functions access the array data (i.e. glVertex, glColor, glNormal,
+ * etc).
+ * Note: this may be called during display list construction.
+ */
+static void _ae_update_state( struct gl_context *ctx )
+{
+ AEcontext *actx = AE_CONTEXT(ctx);
+ AEarray *aa = actx->arrays;
+ AEattrib *at = actx->attribs;
+ GLuint i;
+ struct gl_array_object *arrayObj = ctx->Array.ArrayObj;
+
+ actx->nr_vbos = 0;
+
+ /* conventional vertex arrays */
+ if (arrayObj->Index.Enabled) {
+ aa->array = &arrayObj->Index;
+ aa->offset = IndexFuncs[TYPE_IDX(aa->array->Type)];
+ check_vbo(actx, aa->array->BufferObj);
+ aa++;
+ }
+ if (arrayObj->EdgeFlag.Enabled) {
+ aa->array = &arrayObj->EdgeFlag;
+ aa->offset = _gloffset_EdgeFlagv;
+ check_vbo(actx, aa->array->BufferObj);
+ aa++;
+ }
+ if (arrayObj->Normal.Enabled) {
+ aa->array = &arrayObj->Normal;
+ aa->offset = NormalFuncs[TYPE_IDX(aa->array->Type)];
+ check_vbo(actx, aa->array->BufferObj);
+ aa++;
+ }
+ if (arrayObj->Color.Enabled) {
+ aa->array = &arrayObj->Color;
+ aa->offset = ColorFuncs[aa->array->Size-3][TYPE_IDX(aa->array->Type)];
+ check_vbo(actx, aa->array->BufferObj);
+ aa++;
+ }
+ if (arrayObj->SecondaryColor.Enabled) {
+ aa->array = &arrayObj->SecondaryColor;
+ aa->offset = SecondaryColorFuncs[TYPE_IDX(aa->array->Type)];
+ check_vbo(actx, aa->array->BufferObj);
+ aa++;
+ }
+ if (arrayObj->FogCoord.Enabled) {
+ aa->array = &arrayObj->FogCoord;
+ aa->offset = FogCoordFuncs[TYPE_IDX(aa->array->Type)];
+ check_vbo(actx, aa->array->BufferObj);
+ aa++;
+ }
+ for (i = 0; i < ctx->Const.MaxTextureCoordUnits; i++) {
+ struct gl_client_array *attribArray = &arrayObj->TexCoord[i];
+ if (attribArray->Enabled) {
+ /* NOTE: we use generic glVertexAttribNV functions here.
+ * If we ever remove GL_NV_vertex_program this will have to change.
+ */
+ at->array = attribArray;
+ ASSERT(!at->array->Normalized);
+ at->func = AttribFuncsNV[at->array->Normalized]
+ [at->array->Size-1]
+ [TYPE_IDX(at->array->Type)];
+ at->index = VERT_ATTRIB_TEX0 + i;
+ check_vbo(actx, at->array->BufferObj);
+ at++;
+ }
+ }
+
+ /* generic vertex attribute arrays */
+ for (i = 1; i < Elements(arrayObj->VertexAttrib); i++) { /* skip zero! */
+ struct gl_client_array *attribArray = &arrayObj->VertexAttrib[i];
+ if (attribArray->Enabled) {
+ at->array = attribArray;
+ /* Note: we can't grab the _glapi_Dispatch->VertexAttrib1fvNV
+ * function pointer here (for float arrays) since the pointer may
+ * change from one execution of _ae_ArrayElement() to
+ * the next. Doing so caused UT to break.
+ */
+ if (ctx->VertexProgram._Enabled
+ && ctx->VertexProgram.Current->IsNVProgram) {
+ at->func = AttribFuncsNV[at->array->Normalized]
+ [at->array->Size-1]
+ [TYPE_IDX(at->array->Type)];
+ }
+ else {
+ GLint intOrNorm;
+ if (at->array->Integer)
+ intOrNorm = 2;
+ else if (at->array->Normalized)
+ intOrNorm = 1;
+ else
+ intOrNorm = 0;
+
+ at->func = AttribFuncsARB[intOrNorm]
+ [at->array->Size-1]
+ [TYPE_IDX(at->array->Type)];
+ }
+ at->index = i;
+ check_vbo(actx, at->array->BufferObj);
+ at++;
+ }
+ }
+
+ /* finally, vertex position */
+ if (arrayObj->VertexAttrib[0].Enabled) {
+ /* Use glVertex(v) instead of glVertexAttrib(0, v) to be sure it's
+ * issued as the last (provoking) attribute).
+ */
+ aa->array = &arrayObj->VertexAttrib[0];
+ assert(aa->array->Size >= 2); /* XXX fix someday? */
+ aa->offset = VertexFuncs[aa->array->Size-2][TYPE_IDX(aa->array->Type)];
+ check_vbo(actx, aa->array->BufferObj);
+ aa++;
+ }
+ else if (arrayObj->Vertex.Enabled) {
+ aa->array = &arrayObj->Vertex;
+ aa->offset = VertexFuncs[aa->array->Size-2][TYPE_IDX(aa->array->Type)];
+ check_vbo(actx, aa->array->BufferObj);
+ aa++;
+ }
+
+ check_vbo(actx, ctx->Array.ElementArrayBufferObj);
+
+ ASSERT(at - actx->attribs <= VERT_ATTRIB_MAX);
+ ASSERT(aa - actx->arrays < 32);
+ at->func = NULL; /* terminate the list */
+ aa->offset = -1; /* terminate the list */
+
+ actx->NewState = 0;
+}
+
+void _ae_map_vbos( struct gl_context *ctx )
+{
+ AEcontext *actx = AE_CONTEXT(ctx);
+ GLuint i;
+
+ if (actx->mapped_vbos)
+ return;
+
+ if (actx->NewState)
+ _ae_update_state(ctx);
+
+ for (i = 0; i < actx->nr_vbos; i++)
+ ctx->Driver.MapBuffer(ctx,
+ GL_ARRAY_BUFFER_ARB,
+ GL_DYNAMIC_DRAW_ARB,
+ actx->vbo[i]);
+
+ if (actx->nr_vbos)
+ actx->mapped_vbos = GL_TRUE;
+}
+
+void _ae_unmap_vbos( struct gl_context *ctx )
+{
+ AEcontext *actx = AE_CONTEXT(ctx);
+ GLuint i;
+
+ if (!actx->mapped_vbos)
+ return;
+
+ assert (!actx->NewState);
+
+ for (i = 0; i < actx->nr_vbos; i++)
+ ctx->Driver.UnmapBuffer(ctx,
+ GL_ARRAY_BUFFER_ARB,
+ actx->vbo[i]);
+
+ actx->mapped_vbos = GL_FALSE;
+}
+
+
+/**
+ * Called via glArrayElement() and glDrawArrays().
+ * Issue the glNormal, glVertex, glColor, glVertexAttrib, etc functions
+ * for all enabled vertex arrays (for elt-th element).
+ * Note: this may be called during display list construction.
+ */
+void GLAPIENTRY _ae_ArrayElement( GLint elt )
+{
+ GET_CURRENT_CONTEXT(ctx);
+ const AEcontext *actx = AE_CONTEXT(ctx);
+ const AEarray *aa;
+ const AEattrib *at;
+ const struct _glapi_table * const disp = GET_DISPATCH();
+ GLboolean do_map;
+
+ if (actx->NewState) {
+ assert(!actx->mapped_vbos);
+ _ae_update_state( ctx );
+ }
+
+ /* Determine if w need to map/unmap VBOs */
+ do_map = actx->nr_vbos && !actx->mapped_vbos;
+
+ if (do_map)
+ _ae_map_vbos(ctx);
+
+ /* emit generic attribute elements */
+ for (at = actx->attribs; at->func; at++) {
+ const GLubyte *src
+ = ADD_POINTERS(at->array->BufferObj->Pointer, at->array->Ptr)
+ + elt * at->array->StrideB;
+ at->func( at->index, src );
+ }
+
+ /* emit conventional arrays elements */
+ for (aa = actx->arrays; aa->offset != -1 ; aa++) {
+ const GLubyte *src
+ = ADD_POINTERS(aa->array->BufferObj->Pointer, aa->array->Ptr)
+ + elt * aa->array->StrideB;
+ CALL_by_offset( disp, (array_func), aa->offset,
+ ((const void *) src) );
+ }
+
+ if (do_map)
+ _ae_unmap_vbos(ctx);
+}
+
+
+void _ae_invalidate_state( struct gl_context *ctx, GLuint new_state )
+{
+ AEcontext *actx = AE_CONTEXT(ctx);
+
+
+ /* Only interested in this subset of mesa state. Need to prune
+ * this down as both tnl/ and the drivers can raise statechanges
+ * for arcane reasons in the middle of seemingly atomic operations
+ * like DrawElements, over which we'd like to keep a known set of
+ * arrays and vbo's mapped.
+ *
+ * Luckily, neither the drivers nor tnl muck with the state that
+ * concerns us here:
+ */
+ new_state &= _NEW_ARRAY | _NEW_PROGRAM;
+ if (new_state) {
+ assert(!actx->mapped_vbos);
+ actx->NewState |= new_state;
+ }
+}
+
+
+void _mesa_install_arrayelt_vtxfmt(struct _glapi_table *disp,
+ const GLvertexformat *vfmt)
+{
+ SET_ArrayElement(disp, vfmt->ArrayElement);
+}
+
+
+#endif /* FEATURE_arrayelt */
diff --git a/mesalib/src/mesa/main/api_exec.c b/mesalib/src/mesa/main/api_exec.c
index 93214dd0b..ef4278992 100644
--- a/mesalib/src/mesa/main/api_exec.c
+++ b/mesalib/src/mesa/main/api_exec.c
@@ -1,751 +1,751 @@
-/*
- * Mesa 3-D graphics library
- * Version: 7.1
- *
- * Copyright (C) 1999-2008 Brian Paul All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-
-/**
- * \file api_exec.c
- * Initialize dispatch table with the immidiate mode functions.
- */
-
-
-#include "mfeatures.h"
-#include "accum.h"
-#include "api_loopback.h"
-#include "api_exec.h"
-#if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
-#include "arbprogram.h"
-#endif
-#include "atifragshader.h"
-#include "attrib.h"
-#include "blend.h"
-#if FEATURE_ARB_vertex_buffer_object
-#include "bufferobj.h"
-#endif
-#include "arrayobj.h"
-#if FEATURE_draw_read_buffer
-#include "buffers.h"
-#endif
-#include "clear.h"
-#include "clip.h"
-#include "colortab.h"
-#include "condrender.h"
-#include "context.h"
-#include "convolve.h"
-#include "depth.h"
-#include "dlist.h"
-#include "drawpix.h"
-#include "rastpos.h"
-#include "enable.h"
-#include "eval.h"
-#include "get.h"
-#include "feedback.h"
-#include "fog.h"
-#if FEATURE_EXT_framebuffer_object
-#include "fbobject.h"
-#endif
-#include "framebuffer.h"
-#include "hint.h"
-#include "histogram.h"
-#include "imports.h"
-#include "light.h"
-#include "lines.h"
-#include "matrix.h"
-#include "multisample.h"
-#include "pixel.h"
-#include "pixelstore.h"
-#include "points.h"
-#include "polygon.h"
-#include "queryobj.h"
-#include "readpix.h"
-#if FEATURE_ARB_sampler_objects
-#include "samplerobj.h"
-#endif
-#include "scissor.h"
-#include "stencil.h"
-#include "texenv.h"
-#include "texgetimage.h"
-#include "teximage.h"
-#include "texgen.h"
-#include "texobj.h"
-#include "texparam.h"
-#include "texstate.h"
-#include "texturebarrier.h"
-#include "transformfeedback.h"
-#include "mtypes.h"
-#include "varray.h"
-#include "viewport.h"
-#if FEATURE_NV_vertex_program || FEATURE_NV_fragment_program
-#include "nvprogram.h"
-#endif
-#if FEATURE_ARB_shader_objects
-#include "shaderapi.h"
-#include "uniforms.h"
-#endif
-#include "syncobj.h"
-#include "main/dispatch.h"
-
-
-#if FEATURE_GL
-
-
-/**
- * Initialize a dispatch table with pointers to Mesa's immediate-mode
- * commands.
- *
- * Pointers to glBegin()/glEnd() object commands and a few others
- * are provided via the GLvertexformat interface.
- *
- * \param ctx GL context to which \c exec belongs.
- * \param exec dispatch table.
- */
-struct _glapi_table *
-_mesa_create_exec_table(void)
-{
- struct _glapi_table *exec;
-
- exec = _mesa_alloc_dispatch_table(_gloffset_COUNT);
- if (exec == NULL)
- return NULL;
-
-#if _HAVE_FULL_GL
- _mesa_loopback_init_api_table( exec );
-#endif
-
- /* load the dispatch slots we understand */
- SET_AlphaFunc(exec, _mesa_AlphaFunc);
- SET_BlendFunc(exec, _mesa_BlendFunc);
- SET_Clear(exec, _mesa_Clear);
- SET_ClearColor(exec, _mesa_ClearColor);
- SET_ClearStencil(exec, _mesa_ClearStencil);
- SET_ColorMask(exec, _mesa_ColorMask);
- SET_CullFace(exec, _mesa_CullFace);
- SET_Disable(exec, _mesa_Disable);
-#if FEATURE_draw_read_buffer
- SET_DrawBuffer(exec, _mesa_DrawBuffer);
- SET_ReadBuffer(exec, _mesa_ReadBuffer);
-#endif
- SET_Enable(exec, _mesa_Enable);
- SET_Finish(exec, _mesa_Finish);
- SET_Flush(exec, _mesa_Flush);
- SET_FrontFace(exec, _mesa_FrontFace);
- SET_Frustum(exec, _mesa_Frustum);
- SET_GetError(exec, _mesa_GetError);
- SET_GetFloatv(exec, _mesa_GetFloatv);
- SET_GetString(exec, _mesa_GetString);
- SET_LineStipple(exec, _mesa_LineStipple);
- SET_LineWidth(exec, _mesa_LineWidth);
- SET_LoadIdentity(exec, _mesa_LoadIdentity);
- SET_LoadMatrixf(exec, _mesa_LoadMatrixf);
- SET_LogicOp(exec, _mesa_LogicOp);
- SET_MatrixMode(exec, _mesa_MatrixMode);
- SET_MultMatrixf(exec, _mesa_MultMatrixf);
- SET_Ortho(exec, _mesa_Ortho);
- SET_PixelStorei(exec, _mesa_PixelStorei);
- SET_PopMatrix(exec, _mesa_PopMatrix);
- SET_PushMatrix(exec, _mesa_PushMatrix);
- SET_Rotatef(exec, _mesa_Rotatef);
- SET_Scalef(exec, _mesa_Scalef);
- SET_Scissor(exec, _mesa_Scissor);
- SET_ShadeModel(exec, _mesa_ShadeModel);
- SET_StencilFunc(exec, _mesa_StencilFunc);
- SET_StencilMask(exec, _mesa_StencilMask);
- SET_StencilOp(exec, _mesa_StencilOp);
- SET_TexEnvfv(exec, _mesa_TexEnvfv);
- SET_TexEnvi(exec, _mesa_TexEnvi);
- SET_TexImage2D(exec, _mesa_TexImage2D);
- SET_TexParameteri(exec, _mesa_TexParameteri);
- SET_Translatef(exec, _mesa_Translatef);
- SET_Viewport(exec, _mesa_Viewport);
-
- _mesa_init_accum_dispatch(exec);
- _mesa_init_dlist_dispatch(exec);
-
- SET_ClearDepth(exec, _mesa_ClearDepth);
- SET_ClearIndex(exec, _mesa_ClearIndex);
- SET_ClipPlane(exec, _mesa_ClipPlane);
- SET_ColorMaterial(exec, _mesa_ColorMaterial);
- SET_DepthFunc(exec, _mesa_DepthFunc);
- SET_DepthMask(exec, _mesa_DepthMask);
- SET_DepthRange(exec, _mesa_DepthRange);
-
- _mesa_init_drawpix_dispatch(exec);
- _mesa_init_feedback_dispatch(exec);
-
- SET_FogCoordPointerEXT(exec, _mesa_FogCoordPointerEXT);
- SET_Fogf(exec, _mesa_Fogf);
- SET_Fogfv(exec, _mesa_Fogfv);
- SET_Fogi(exec, _mesa_Fogi);
- SET_Fogiv(exec, _mesa_Fogiv);
- SET_GetClipPlane(exec, _mesa_GetClipPlane);
- SET_GetBooleanv(exec, _mesa_GetBooleanv);
- SET_GetDoublev(exec, _mesa_GetDoublev);
- SET_GetIntegerv(exec, _mesa_GetIntegerv);
- SET_GetLightfv(exec, _mesa_GetLightfv);
- SET_GetLightiv(exec, _mesa_GetLightiv);
- SET_GetMaterialfv(exec, _mesa_GetMaterialfv);
- SET_GetMaterialiv(exec, _mesa_GetMaterialiv);
- SET_GetPolygonStipple(exec, _mesa_GetPolygonStipple);
- SET_GetTexEnvfv(exec, _mesa_GetTexEnvfv);
- SET_GetTexEnviv(exec, _mesa_GetTexEnviv);
- SET_GetTexLevelParameterfv(exec, _mesa_GetTexLevelParameterfv);
- SET_GetTexLevelParameteriv(exec, _mesa_GetTexLevelParameteriv);
- SET_GetTexParameterfv(exec, _mesa_GetTexParameterfv);
- SET_GetTexParameteriv(exec, _mesa_GetTexParameteriv);
- SET_GetTexImage(exec, _mesa_GetTexImage);
- SET_Hint(exec, _mesa_Hint);
- SET_IndexMask(exec, _mesa_IndexMask);
- SET_IsEnabled(exec, _mesa_IsEnabled);
- SET_LightModelf(exec, _mesa_LightModelf);
- SET_LightModelfv(exec, _mesa_LightModelfv);
- SET_LightModeli(exec, _mesa_LightModeli);
- SET_LightModeliv(exec, _mesa_LightModeliv);
- SET_Lightf(exec, _mesa_Lightf);
- SET_Lightfv(exec, _mesa_Lightfv);
- SET_Lighti(exec, _mesa_Lighti);
- SET_Lightiv(exec, _mesa_Lightiv);
- SET_LoadMatrixd(exec, _mesa_LoadMatrixd);
-
- _mesa_init_eval_dispatch(exec);
-
- SET_MultMatrixd(exec, _mesa_MultMatrixd);
-
- _mesa_init_pixel_dispatch(exec);
-
- SET_PixelStoref(exec, _mesa_PixelStoref);
- SET_PointSize(exec, _mesa_PointSize);
- SET_PolygonMode(exec, _mesa_PolygonMode);
- SET_PolygonOffset(exec, _mesa_PolygonOffset);
- SET_PolygonStipple(exec, _mesa_PolygonStipple);
-
- _mesa_init_attrib_dispatch(exec);
- _mesa_init_rastpos_dispatch(exec);
-
- SET_ReadPixels(exec, _mesa_ReadPixels);
- SET_Rotated(exec, _mesa_Rotated);
- SET_Scaled(exec, _mesa_Scaled);
- SET_SecondaryColorPointerEXT(exec, _mesa_SecondaryColorPointerEXT);
- SET_TexEnvf(exec, _mesa_TexEnvf);
- SET_TexEnviv(exec, _mesa_TexEnviv);
-
- _mesa_init_texgen_dispatch(exec);
-
- SET_TexImage1D(exec, _mesa_TexImage1D);
- SET_TexParameterf(exec, _mesa_TexParameterf);
- SET_TexParameterfv(exec, _mesa_TexParameterfv);
- SET_TexParameteriv(exec, _mesa_TexParameteriv);
- SET_Translated(exec, _mesa_Translated);
-
- /* 1.1 */
- SET_BindTexture(exec, _mesa_BindTexture);
- SET_DeleteTextures(exec, _mesa_DeleteTextures);
- SET_GenTextures(exec, _mesa_GenTextures);
-#if _HAVE_FULL_GL
- SET_AreTexturesResident(exec, _mesa_AreTexturesResident);
- SET_ColorPointer(exec, _mesa_ColorPointer);
- SET_CopyTexImage1D(exec, _mesa_CopyTexImage1D);
- SET_CopyTexImage2D(exec, _mesa_CopyTexImage2D);
- SET_CopyTexSubImage1D(exec, _mesa_CopyTexSubImage1D);
- SET_CopyTexSubImage2D(exec, _mesa_CopyTexSubImage2D);
- SET_DisableClientState(exec, _mesa_DisableClientState);
- SET_EdgeFlagPointer(exec, _mesa_EdgeFlagPointer);
- SET_EnableClientState(exec, _mesa_EnableClientState);
- SET_GetPointerv(exec, _mesa_GetPointerv);
- SET_IndexPointer(exec, _mesa_IndexPointer);
- SET_InterleavedArrays(exec, _mesa_InterleavedArrays);
- SET_IsTexture(exec, _mesa_IsTexture);
- SET_NormalPointer(exec, _mesa_NormalPointer);
- SET_PrioritizeTextures(exec, _mesa_PrioritizeTextures);
- SET_TexCoordPointer(exec, _mesa_TexCoordPointer);
- SET_TexSubImage1D(exec, _mesa_TexSubImage1D);
- SET_TexSubImage2D(exec, _mesa_TexSubImage2D);
- SET_VertexPointer(exec, _mesa_VertexPointer);
-#endif
-
- /* 1.2 */
-#if _HAVE_FULL_GL
- SET_CopyTexSubImage3D(exec, _mesa_CopyTexSubImage3D);
- SET_TexImage3D(exec, _mesa_TexImage3D);
- SET_TexSubImage3D(exec, _mesa_TexSubImage3D);
-#endif
-
- /* OpenGL 1.2 GL_ARB_imaging */
- SET_BlendColor(exec, _mesa_BlendColor);
- SET_BlendEquation(exec, _mesa_BlendEquation);
- SET_BlendEquationSeparateEXT(exec, _mesa_BlendEquationSeparateEXT);
-
- _mesa_init_colortable_dispatch(exec);
- _mesa_init_convolve_dispatch(exec);
- _mesa_init_histogram_dispatch(exec);
-
- /* OpenGL 2.0 */
- SET_StencilFuncSeparate(exec, _mesa_StencilFuncSeparate);
- SET_StencilMaskSeparate(exec, _mesa_StencilMaskSeparate);
- SET_StencilOpSeparate(exec, _mesa_StencilOpSeparate);
-
-#if FEATURE_ARB_shader_objects
- _mesa_init_shader_dispatch(exec);
- _mesa_init_shader_uniform_dispatch(exec);
-#endif
-
- /* 2. GL_EXT_blend_color */
-#if 0
-/* SET_BlendColorEXT(exec, _mesa_BlendColorEXT); */
-#endif
-
- /* 3. GL_EXT_polygon_offset */
-#if _HAVE_FULL_GL
- SET_PolygonOffsetEXT(exec, _mesa_PolygonOffsetEXT);
-#endif
-
- /* 6. GL_EXT_texture3d */
-#if 0
-/* SET_CopyTexSubImage3DEXT(exec, _mesa_CopyTexSubImage3D); */
-/* SET_TexImage3DEXT(exec, _mesa_TexImage3DEXT); */
-/* SET_TexSubImage3DEXT(exec, _mesa_TexSubImage3D); */
-#endif
-
- /* 11. GL_EXT_histogram */
-#if 0
- SET_GetHistogramEXT(exec, _mesa_GetHistogram);
- SET_GetHistogramParameterfvEXT(exec, _mesa_GetHistogramParameterfv);
- SET_GetHistogramParameterivEXT(exec, _mesa_GetHistogramParameteriv);
- SET_GetMinmaxEXT(exec, _mesa_GetMinmax);
- SET_GetMinmaxParameterfvEXT(exec, _mesa_GetMinmaxParameterfv);
- SET_GetMinmaxParameterivEXT(exec, _mesa_GetMinmaxParameteriv);
-#endif
-
- /* 14. SGI_color_table */
-#if 0
- SET_ColorTableSGI(exec, _mesa_ColorTable);
- SET_ColorSubTableSGI(exec, _mesa_ColorSubTable);
- SET_GetColorTableSGI(exec, _mesa_GetColorTable);
- SET_GetColorTableParameterfvSGI(exec, _mesa_GetColorTableParameterfv);
- SET_GetColorTableParameterivSGI(exec, _mesa_GetColorTableParameteriv);
-#endif
-
- /* 30. GL_EXT_vertex_array */
-#if _HAVE_FULL_GL
- SET_ColorPointerEXT(exec, _mesa_ColorPointerEXT);
- SET_EdgeFlagPointerEXT(exec, _mesa_EdgeFlagPointerEXT);
- SET_IndexPointerEXT(exec, _mesa_IndexPointerEXT);
- SET_NormalPointerEXT(exec, _mesa_NormalPointerEXT);
- SET_TexCoordPointerEXT(exec, _mesa_TexCoordPointerEXT);
- SET_VertexPointerEXT(exec, _mesa_VertexPointerEXT);
-#endif
-
- /* 37. GL_EXT_blend_minmax */
-#if 0
- SET_BlendEquationEXT(exec, _mesa_BlendEquationEXT);
-#endif
-
- /* 54. GL_EXT_point_parameters */
-#if _HAVE_FULL_GL
- SET_PointParameterfEXT(exec, _mesa_PointParameterf);
- SET_PointParameterfvEXT(exec, _mesa_PointParameterfv);
-#endif
-
- /* 95. GL_ARB_ES2_compatibility */
- SET_ClearDepthf(exec, _mesa_ClearDepthf);
- SET_DepthRangef(exec, _mesa_DepthRangef);
-
- /* 97. GL_EXT_compiled_vertex_array */
-#if _HAVE_FULL_GL
- SET_LockArraysEXT(exec, _mesa_LockArraysEXT);
- SET_UnlockArraysEXT(exec, _mesa_UnlockArraysEXT);
-#endif
-
- /* 148. GL_EXT_multi_draw_arrays */
-#if _HAVE_FULL_GL
- SET_MultiDrawArraysEXT(exec, _mesa_MultiDrawArraysEXT);
-#endif
-
- /* 173. GL_INGR_blend_func_separate */
-#if _HAVE_FULL_GL
- SET_BlendFuncSeparateEXT(exec, _mesa_BlendFuncSeparateEXT);
-#endif
-
- /* 196. GL_MESA_resize_buffers */
-#if _HAVE_FULL_GL
- SET_ResizeBuffersMESA(exec, _mesa_ResizeBuffersMESA);
-#endif
-
- /* 197. GL_MESA_window_pos */
- /* part of _mesa_init_rastpos_dispatch(exec); */
-
- /* 200. GL_IBM_multimode_draw_arrays */
-#if _HAVE_FULL_GL
- SET_MultiModeDrawArraysIBM(exec, _mesa_MultiModeDrawArraysIBM);
- SET_MultiModeDrawElementsIBM(exec, _mesa_MultiModeDrawElementsIBM);
-#endif
-
- /* 233. GL_NV_vertex_program */
-#if FEATURE_NV_vertex_program
- SET_BindProgramNV(exec, _mesa_BindProgram);
- SET_DeleteProgramsNV(exec, _mesa_DeletePrograms);
- SET_ExecuteProgramNV(exec, _mesa_ExecuteProgramNV);
- SET_GenProgramsNV(exec, _mesa_GenPrograms);
- SET_AreProgramsResidentNV(exec, _mesa_AreProgramsResidentNV);
- SET_RequestResidentProgramsNV(exec, _mesa_RequestResidentProgramsNV);
- SET_GetProgramParameterfvNV(exec, _mesa_GetProgramParameterfvNV);
- SET_GetProgramParameterdvNV(exec, _mesa_GetProgramParameterdvNV);
- SET_GetProgramivNV(exec, _mesa_GetProgramivNV);
- SET_GetProgramStringNV(exec, _mesa_GetProgramStringNV);
- SET_GetTrackMatrixivNV(exec, _mesa_GetTrackMatrixivNV);
- SET_GetVertexAttribdvNV(exec, _mesa_GetVertexAttribdvNV);
- SET_GetVertexAttribfvNV(exec, _mesa_GetVertexAttribfvNV);
- SET_GetVertexAttribivNV(exec, _mesa_GetVertexAttribivNV);
- SET_GetVertexAttribPointervNV(exec, _mesa_GetVertexAttribPointervNV);
- SET_IsProgramNV(exec, _mesa_IsProgramARB);
- SET_LoadProgramNV(exec, _mesa_LoadProgramNV);
- SET_ProgramEnvParameter4dARB(exec, _mesa_ProgramEnvParameter4dARB); /* alias to ProgramParameter4dNV */
- SET_ProgramEnvParameter4dvARB(exec, _mesa_ProgramEnvParameter4dvARB); /* alias to ProgramParameter4dvNV */
- SET_ProgramEnvParameter4fARB(exec, _mesa_ProgramEnvParameter4fARB); /* alias to ProgramParameter4fNV */
- SET_ProgramEnvParameter4fvARB(exec, _mesa_ProgramEnvParameter4fvARB); /* alias to ProgramParameter4fvNV */
- SET_ProgramParameters4dvNV(exec, _mesa_ProgramParameters4dvNV);
- SET_ProgramParameters4fvNV(exec, _mesa_ProgramParameters4fvNV);
- SET_TrackMatrixNV(exec, _mesa_TrackMatrixNV);
- SET_VertexAttribPointerNV(exec, _mesa_VertexAttribPointerNV);
- /* glVertexAttrib*NV functions handled in api_loopback.c */
-#endif
-
- /* 273. GL_APPLE_vertex_array_object */
- SET_BindVertexArrayAPPLE(exec, _mesa_BindVertexArrayAPPLE);
- SET_DeleteVertexArraysAPPLE(exec, _mesa_DeleteVertexArraysAPPLE);
- SET_GenVertexArraysAPPLE(exec, _mesa_GenVertexArraysAPPLE);
- SET_IsVertexArrayAPPLE(exec, _mesa_IsVertexArrayAPPLE);
-
- /* 282. GL_NV_fragment_program */
-#if FEATURE_NV_fragment_program
- SET_ProgramNamedParameter4fNV(exec, _mesa_ProgramNamedParameter4fNV);
- SET_ProgramNamedParameter4dNV(exec, _mesa_ProgramNamedParameter4dNV);
- SET_ProgramNamedParameter4fvNV(exec, _mesa_ProgramNamedParameter4fvNV);
- SET_ProgramNamedParameter4dvNV(exec, _mesa_ProgramNamedParameter4dvNV);
- SET_GetProgramNamedParameterfvNV(exec, _mesa_GetProgramNamedParameterfvNV);
- SET_GetProgramNamedParameterdvNV(exec, _mesa_GetProgramNamedParameterdvNV);
- SET_ProgramLocalParameter4dARB(exec, _mesa_ProgramLocalParameter4dARB);
- SET_ProgramLocalParameter4dvARB(exec, _mesa_ProgramLocalParameter4dvARB);
- SET_ProgramLocalParameter4fARB(exec, _mesa_ProgramLocalParameter4fARB);
- SET_ProgramLocalParameter4fvARB(exec, _mesa_ProgramLocalParameter4fvARB);
- SET_GetProgramLocalParameterdvARB(exec, _mesa_GetProgramLocalParameterdvARB);
- SET_GetProgramLocalParameterfvARB(exec, _mesa_GetProgramLocalParameterfvARB);
-#endif
-
- /* 262. GL_NV_point_sprite */
-#if _HAVE_FULL_GL
- SET_PointParameteriNV(exec, _mesa_PointParameteri);
- SET_PointParameterivNV(exec, _mesa_PointParameteriv);
-#endif
-
- /* 268. GL_EXT_stencil_two_side */
-#if _HAVE_FULL_GL
- SET_ActiveStencilFaceEXT(exec, _mesa_ActiveStencilFaceEXT);
-#endif
-
- /* 285. GL_NV_primitive_restart */
- SET_PrimitiveRestartIndexNV(exec, _mesa_PrimitiveRestartIndex);
-
- /* ???. GL_EXT_depth_bounds_test */
- SET_DepthBoundsEXT(exec, _mesa_DepthBoundsEXT);
-
- /* 352. GL_EXT_transform_feedback */
- _mesa_init_transform_feedback_dispatch(exec);
-
- /* 364. GL_EXT_provoking_vertex */
- SET_ProvokingVertexEXT(exec, _mesa_ProvokingVertexEXT);
-
- /* ARB 1. GL_ARB_multitexture */
-#if _HAVE_FULL_GL
- SET_ActiveTextureARB(exec, _mesa_ActiveTextureARB);
- SET_ClientActiveTextureARB(exec, _mesa_ClientActiveTextureARB);
-#endif
-
- /* ARB 3. GL_ARB_transpose_matrix */
-#if _HAVE_FULL_GL
- SET_LoadTransposeMatrixdARB(exec, _mesa_LoadTransposeMatrixdARB);
- SET_LoadTransposeMatrixfARB(exec, _mesa_LoadTransposeMatrixfARB);
- SET_MultTransposeMatrixdARB(exec, _mesa_MultTransposeMatrixdARB);
- SET_MultTransposeMatrixfARB(exec, _mesa_MultTransposeMatrixfARB);
-#endif
-
- /* ARB 5. GL_ARB_multisample */
-#if _HAVE_FULL_GL
- SET_SampleCoverageARB(exec, _mesa_SampleCoverageARB);
-#endif
-
- /* ARB 12. GL_ARB_texture_compression */
-#if _HAVE_FULL_GL
- SET_CompressedTexImage3DARB(exec, _mesa_CompressedTexImage3DARB);
- SET_CompressedTexImage2DARB(exec, _mesa_CompressedTexImage2DARB);
- SET_CompressedTexImage1DARB(exec, _mesa_CompressedTexImage1DARB);
- SET_CompressedTexSubImage3DARB(exec, _mesa_CompressedTexSubImage3DARB);
- SET_CompressedTexSubImage2DARB(exec, _mesa_CompressedTexSubImage2DARB);
- SET_CompressedTexSubImage1DARB(exec, _mesa_CompressedTexSubImage1DARB);
- SET_GetCompressedTexImageARB(exec, _mesa_GetCompressedTexImageARB);
-
- /* ARB 104. GL_ARB_robustness */
- SET_GetnCompressedTexImageARB(exec, _mesa_GetnCompressedTexImageARB);
-#endif
-
- /* ARB 14. GL_ARB_point_parameters */
- /* reuse EXT_point_parameters functions */
-
- /* ARB 26. GL_ARB_vertex_program */
- /* ARB 27. GL_ARB_fragment_program */
-#if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
- /* glVertexAttrib1sARB aliases glVertexAttrib1sNV */
- /* glVertexAttrib1fARB aliases glVertexAttrib1fNV */
- /* glVertexAttrib1dARB aliases glVertexAttrib1dNV */
- /* glVertexAttrib2sARB aliases glVertexAttrib2sNV */
- /* glVertexAttrib2fARB aliases glVertexAttrib2fNV */
- /* glVertexAttrib2dARB aliases glVertexAttrib2dNV */
- /* glVertexAttrib3sARB aliases glVertexAttrib3sNV */
- /* glVertexAttrib3fARB aliases glVertexAttrib3fNV */
- /* glVertexAttrib3dARB aliases glVertexAttrib3dNV */
- /* glVertexAttrib4sARB aliases glVertexAttrib4sNV */
- /* glVertexAttrib4fARB aliases glVertexAttrib4fNV */
- /* glVertexAttrib4dARB aliases glVertexAttrib4dNV */
- /* glVertexAttrib4NubARB aliases glVertexAttrib4NubNV */
- /* glVertexAttrib1svARB aliases glVertexAttrib1svNV */
- /* glVertexAttrib1fvARB aliases glVertexAttrib1fvNV */
- /* glVertexAttrib1dvARB aliases glVertexAttrib1dvNV */
- /* glVertexAttrib2svARB aliases glVertexAttrib2svNV */
- /* glVertexAttrib2fvARB aliases glVertexAttrib2fvNV */
- /* glVertexAttrib2dvARB aliases glVertexAttrib2dvNV */
- /* glVertexAttrib3svARB aliases glVertexAttrib3svNV */
- /* glVertexAttrib3fvARB aliases glVertexAttrib3fvNV */
- /* glVertexAttrib3dvARB aliases glVertexAttrib3dvNV */
- /* glVertexAttrib4svARB aliases glVertexAttrib4svNV */
- /* glVertexAttrib4fvARB aliases glVertexAttrib4fvNV */
- /* glVertexAttrib4dvARB aliases glVertexAttrib4dvNV */
- /* glVertexAttrib4NubvARB aliases glVertexAttrib4NubvNV */
- /* glVertexAttrib4bvARB handled in api_loopback.c */
- /* glVertexAttrib4ivARB handled in api_loopback.c */
- /* glVertexAttrib4ubvARB handled in api_loopback.c */
- /* glVertexAttrib4usvARB handled in api_loopback.c */
- /* glVertexAttrib4uivARB handled in api_loopback.c */
- /* glVertexAttrib4NbvARB handled in api_loopback.c */
- /* glVertexAttrib4NsvARB handled in api_loopback.c */
- /* glVertexAttrib4NivARB handled in api_loopback.c */
- /* glVertexAttrib4NusvARB handled in api_loopback.c */
- /* glVertexAttrib4NuivARB handled in api_loopback.c */
- SET_VertexAttribPointerARB(exec, _mesa_VertexAttribPointerARB);
- SET_EnableVertexAttribArrayARB(exec, _mesa_EnableVertexAttribArrayARB);
- SET_DisableVertexAttribArrayARB(exec, _mesa_DisableVertexAttribArrayARB);
- SET_ProgramStringARB(exec, _mesa_ProgramStringARB);
- /* glBindProgramARB aliases glBindProgramNV */
- /* glDeleteProgramsARB aliases glDeleteProgramsNV */
- /* glGenProgramsARB aliases glGenProgramsNV */
- /* glIsProgramARB aliases glIsProgramNV */
- SET_GetVertexAttribdvARB(exec, _mesa_GetVertexAttribdvARB);
- SET_GetVertexAttribfvARB(exec, _mesa_GetVertexAttribfvARB);
- SET_GetVertexAttribivARB(exec, _mesa_GetVertexAttribivARB);
- /* glGetVertexAttribPointervARB aliases glGetVertexAttribPointervNV */
- SET_ProgramEnvParameter4dARB(exec, _mesa_ProgramEnvParameter4dARB);
- SET_ProgramEnvParameter4dvARB(exec, _mesa_ProgramEnvParameter4dvARB);
- SET_ProgramEnvParameter4fARB(exec, _mesa_ProgramEnvParameter4fARB);
- SET_ProgramEnvParameter4fvARB(exec, _mesa_ProgramEnvParameter4fvARB);
- SET_ProgramLocalParameter4dARB(exec, _mesa_ProgramLocalParameter4dARB);
- SET_ProgramLocalParameter4dvARB(exec, _mesa_ProgramLocalParameter4dvARB);
- SET_ProgramLocalParameter4fARB(exec, _mesa_ProgramLocalParameter4fARB);
- SET_ProgramLocalParameter4fvARB(exec, _mesa_ProgramLocalParameter4fvARB);
- SET_GetProgramEnvParameterdvARB(exec, _mesa_GetProgramEnvParameterdvARB);
- SET_GetProgramEnvParameterfvARB(exec, _mesa_GetProgramEnvParameterfvARB);
- SET_GetProgramLocalParameterdvARB(exec, _mesa_GetProgramLocalParameterdvARB);
- SET_GetProgramLocalParameterfvARB(exec, _mesa_GetProgramLocalParameterfvARB);
- SET_GetProgramivARB(exec, _mesa_GetProgramivARB);
- SET_GetProgramStringARB(exec, _mesa_GetProgramStringARB);
-#endif
-
- /* ARB 28. GL_ARB_vertex_buffer_object */
-#if FEATURE_ARB_vertex_buffer_object
- SET_BindBufferARB(exec, _mesa_BindBufferARB);
- SET_BufferDataARB(exec, _mesa_BufferDataARB);
- SET_BufferSubDataARB(exec, _mesa_BufferSubDataARB);
- SET_DeleteBuffersARB(exec, _mesa_DeleteBuffersARB);
- SET_GenBuffersARB(exec, _mesa_GenBuffersARB);
- SET_GetBufferParameterivARB(exec, _mesa_GetBufferParameterivARB);
- SET_GetBufferPointervARB(exec, _mesa_GetBufferPointervARB);
- SET_GetBufferSubDataARB(exec, _mesa_GetBufferSubDataARB);
- SET_IsBufferARB(exec, _mesa_IsBufferARB);
- SET_MapBufferARB(exec, _mesa_MapBufferARB);
- SET_UnmapBufferARB(exec, _mesa_UnmapBufferARB);
-#endif
-
- /* ARB 29. GL_ARB_occlusion_query */
- _mesa_init_queryobj_dispatch(exec);
-
- /* ARB 37. GL_ARB_draw_buffers */
-#if FEATURE_draw_read_buffer
- SET_DrawBuffersARB(exec, _mesa_DrawBuffersARB);
-#endif
-
- /* ARB 104. GL_ARB_robustness */
- SET_GetGraphicsResetStatusARB(exec, _mesa_GetGraphicsResetStatusARB);
- SET_GetnPolygonStippleARB(exec, _mesa_GetnPolygonStippleARB);
- SET_GetnTexImageARB(exec, _mesa_GetnTexImageARB);
- SET_ReadnPixelsARB(exec, _mesa_ReadnPixelsARB);
-
- /* GL_ARB_sync */
- _mesa_init_sync_dispatch(exec);
-
- /* GL_ATI_fragment_shader */
- _mesa_init_ati_fragment_shader_dispatch(exec);
-
- /* GL_ATI_envmap_bumpmap */
- SET_GetTexBumpParameterivATI(exec, _mesa_GetTexBumpParameterivATI);
- SET_GetTexBumpParameterfvATI(exec, _mesa_GetTexBumpParameterfvATI);
- SET_TexBumpParameterivATI(exec, _mesa_TexBumpParameterivATI);
- SET_TexBumpParameterfvATI(exec, _mesa_TexBumpParameterfvATI);
-
-#if FEATURE_EXT_framebuffer_object
- SET_IsRenderbufferEXT(exec, _mesa_IsRenderbufferEXT);
- SET_BindRenderbufferEXT(exec, _mesa_BindRenderbufferEXT);
- SET_DeleteRenderbuffersEXT(exec, _mesa_DeleteRenderbuffersEXT);
- SET_GenRenderbuffersEXT(exec, _mesa_GenRenderbuffersEXT);
- SET_RenderbufferStorageEXT(exec, _mesa_RenderbufferStorageEXT);
- SET_GetRenderbufferParameterivEXT(exec, _mesa_GetRenderbufferParameterivEXT);
- SET_IsFramebufferEXT(exec, _mesa_IsFramebufferEXT);
- SET_BindFramebufferEXT(exec, _mesa_BindFramebufferEXT);
- SET_DeleteFramebuffersEXT(exec, _mesa_DeleteFramebuffersEXT);
- SET_GenFramebuffersEXT(exec, _mesa_GenFramebuffersEXT);
- SET_CheckFramebufferStatusEXT(exec, _mesa_CheckFramebufferStatusEXT);
- SET_FramebufferTexture1DEXT(exec, _mesa_FramebufferTexture1DEXT);
- SET_FramebufferTexture2DEXT(exec, _mesa_FramebufferTexture2DEXT);
- SET_FramebufferTexture3DEXT(exec, _mesa_FramebufferTexture3DEXT);
- SET_FramebufferRenderbufferEXT(exec, _mesa_FramebufferRenderbufferEXT);
- SET_GetFramebufferAttachmentParameterivEXT(exec, _mesa_GetFramebufferAttachmentParameterivEXT);
- SET_GenerateMipmapEXT(exec, _mesa_GenerateMipmapEXT);
-#endif
-
-#if FEATURE_EXT_framebuffer_blit
- SET_BlitFramebufferEXT(exec, _mesa_BlitFramebufferEXT);
-#endif
-
- /* GL_EXT_gpu_program_parameters */
-#if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
- SET_ProgramEnvParameters4fvEXT(exec, _mesa_ProgramEnvParameters4fvEXT);
- SET_ProgramLocalParameters4fvEXT(exec, _mesa_ProgramLocalParameters4fvEXT);
-#endif
-
- /* GL_MESA_texture_array / GL_EXT_texture_array */
-#if FEATURE_EXT_framebuffer_object
- SET_FramebufferTextureLayerEXT(exec, _mesa_FramebufferTextureLayerEXT);
-#endif
-
- /* GL_ATI_separate_stencil */
- SET_StencilFuncSeparateATI(exec, _mesa_StencilFuncSeparateATI);
-
-#if FEATURE_ARB_framebuffer_object
- /* The ARB_fbo functions are the union of
- * GL_EXT_fbo, GL_EXT_framebuffer_blit, GL_EXT_texture_array
- */
- SET_RenderbufferStorageMultisample(exec, _mesa_RenderbufferStorageMultisample);
-#endif
-
-#if FEATURE_ARB_map_buffer_range
- SET_MapBufferRange(exec, _mesa_MapBufferRange);
- SET_FlushMappedBufferRange(exec, _mesa_FlushMappedBufferRange);
-#endif
-
- /* GL_ARB_copy_buffer */
- SET_CopyBufferSubData(exec, _mesa_CopyBufferSubData);
-
- /* GL_ARB_vertex_array_object */
- SET_BindVertexArray(exec, _mesa_BindVertexArray);
- SET_GenVertexArrays(exec, _mesa_GenVertexArrays);
-
- /* GL_EXT_draw_buffers2 */
- SET_ColorMaskIndexedEXT(exec, _mesa_ColorMaskIndexed);
- SET_GetBooleanIndexedvEXT(exec, _mesa_GetBooleanIndexedv);
- SET_GetIntegerIndexedvEXT(exec, _mesa_GetIntegerIndexedv);
- SET_EnableIndexedEXT(exec, _mesa_EnableIndexed);
- SET_DisableIndexedEXT(exec, _mesa_DisableIndexed);
- SET_IsEnabledIndexedEXT(exec, _mesa_IsEnabledIndexed);
-
- /* GL_NV_conditional_render */
- SET_BeginConditionalRenderNV(exec, _mesa_BeginConditionalRender);
- SET_EndConditionalRenderNV(exec, _mesa_EndConditionalRender);
-
-#if FEATURE_OES_EGL_image
- SET_EGLImageTargetTexture2DOES(exec, _mesa_EGLImageTargetTexture2DOES);
- SET_EGLImageTargetRenderbufferStorageOES(exec, _mesa_EGLImageTargetRenderbufferStorageOES);
-#endif
-
-#if FEATURE_APPLE_object_purgeable
- SET_ObjectPurgeableAPPLE(exec, _mesa_ObjectPurgeableAPPLE);
- SET_ObjectUnpurgeableAPPLE(exec, _mesa_ObjectUnpurgeableAPPLE);
- SET_GetObjectParameterivAPPLE(exec, _mesa_GetObjectParameterivAPPLE);
-#endif
-
-#if FEATURE_ARB_geometry_shader4
- SET_FramebufferTextureARB(exec, _mesa_FramebufferTextureARB);
- SET_FramebufferTextureFaceARB(exec, _mesa_FramebufferTextureFaceARB);
-#endif
-
- SET_ClampColorARB(exec, _mesa_ClampColorARB);
-
- /* GL_EXT_texture_integer */
- SET_ClearColorIiEXT(exec, _mesa_ClearColorIiEXT);
- SET_ClearColorIuiEXT(exec, _mesa_ClearColorIuiEXT);
- SET_GetTexParameterIivEXT(exec, _mesa_GetTexParameterIiv);
- SET_GetTexParameterIuivEXT(exec, _mesa_GetTexParameterIuiv);
- SET_TexParameterIivEXT(exec, _mesa_TexParameterIiv);
- SET_TexParameterIuivEXT(exec, _mesa_TexParameterIuiv);
-
- /* GL_EXT_gpu_shader4 / OpenGL 3.0 */
- SET_GetVertexAttribIivEXT(exec, _mesa_GetVertexAttribIiv);
- SET_GetVertexAttribIuivEXT(exec, _mesa_GetVertexAttribIuiv);
- SET_VertexAttribIPointerEXT(exec, _mesa_VertexAttribIPointer);
-
- /* GL 3.0 (functions not covered by other extensions) */
- SET_ClearBufferiv(exec, _mesa_ClearBufferiv);
- SET_ClearBufferuiv(exec, _mesa_ClearBufferuiv);
- SET_ClearBufferfv(exec, _mesa_ClearBufferfv);
- SET_ClearBufferfi(exec, _mesa_ClearBufferfi);
- SET_GetStringi(exec, _mesa_GetStringi);
- SET_ClampColor(exec, _mesa_ClampColorARB);
-
- /* GL_ARB_instanced_arrays */
- SET_VertexAttribDivisorARB(exec, _mesa_VertexAttribDivisor);
-
- /* GL_ARB_draw_buffer_blend */
- SET_BlendFunciARB(exec, _mesa_BlendFunci);
- SET_BlendFuncSeparateiARB(exec, _mesa_BlendFuncSeparatei);
- SET_BlendEquationiARB(exec, _mesa_BlendEquationi);
- SET_BlendEquationSeparateiARB(exec, _mesa_BlendEquationSeparatei);
-
- /* GL_NV_texture_barrier */
- SET_TextureBarrierNV(exec, _mesa_TextureBarrierNV);
-
- /* GL_ARB_texture_buffer_object */
- SET_TexBufferARB(exec, _mesa_TexBuffer);
-
-#if FEATURE_ARB_sampler_objects
- _mesa_init_sampler_object_dispatch(exec);
-#endif
-
- return exec;
-}
-
-#endif /* FEATURE_GL */
+/*
+ * Mesa 3-D graphics library
+ * Version: 7.1
+ *
+ * Copyright (C) 1999-2008 Brian Paul All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+
+/**
+ * \file api_exec.c
+ * Initialize dispatch table with the immidiate mode functions.
+ */
+
+
+#include "mfeatures.h"
+#include "accum.h"
+#include "api_loopback.h"
+#include "api_exec.h"
+#if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
+#include "arbprogram.h"
+#endif
+#include "atifragshader.h"
+#include "attrib.h"
+#include "blend.h"
+#if FEATURE_ARB_vertex_buffer_object
+#include "bufferobj.h"
+#endif
+#include "arrayobj.h"
+#if FEATURE_draw_read_buffer
+#include "buffers.h"
+#endif
+#include "clear.h"
+#include "clip.h"
+#include "colortab.h"
+#include "condrender.h"
+#include "context.h"
+#include "convolve.h"
+#include "depth.h"
+#include "dlist.h"
+#include "drawpix.h"
+#include "rastpos.h"
+#include "enable.h"
+#include "eval.h"
+#include "get.h"
+#include "feedback.h"
+#include "fog.h"
+#if FEATURE_EXT_framebuffer_object
+#include "fbobject.h"
+#endif
+#include "framebuffer.h"
+#include "hint.h"
+#include "histogram.h"
+#include "imports.h"
+#include "light.h"
+#include "lines.h"
+#include "matrix.h"
+#include "multisample.h"
+#include "pixel.h"
+#include "pixelstore.h"
+#include "points.h"
+#include "polygon.h"
+#include "queryobj.h"
+#include "readpix.h"
+#if FEATURE_ARB_sampler_objects
+#include "samplerobj.h"
+#endif
+#include "scissor.h"
+#include "stencil.h"
+#include "texenv.h"
+#include "texgetimage.h"
+#include "teximage.h"
+#include "texgen.h"
+#include "texobj.h"
+#include "texparam.h"
+#include "texstate.h"
+#include "texturebarrier.h"
+#include "transformfeedback.h"
+#include "mtypes.h"
+#include "varray.h"
+#include "viewport.h"
+#if FEATURE_NV_vertex_program || FEATURE_NV_fragment_program
+#include "nvprogram.h"
+#endif
+#if FEATURE_ARB_shader_objects
+#include "shaderapi.h"
+#include "uniforms.h"
+#endif
+#include "syncobj.h"
+#include "main/dispatch.h"
+
+
+#if FEATURE_GL
+
+
+/**
+ * Initialize a dispatch table with pointers to Mesa's immediate-mode
+ * commands.
+ *
+ * Pointers to glBegin()/glEnd() object commands and a few others
+ * are provided via the GLvertexformat interface.
+ *
+ * \param ctx GL context to which \c exec belongs.
+ * \param exec dispatch table.
+ */
+struct _glapi_table *
+_mesa_create_exec_table(void)
+{
+ struct _glapi_table *exec;
+
+ exec = _mesa_alloc_dispatch_table(_gloffset_COUNT);
+ if (exec == NULL)
+ return NULL;
+
+#if _HAVE_FULL_GL
+ _mesa_loopback_init_api_table( exec );
+#endif
+
+ /* load the dispatch slots we understand */
+ SET_AlphaFunc(exec, _mesa_AlphaFunc);
+ SET_BlendFunc(exec, _mesa_BlendFunc);
+ SET_Clear(exec, _mesa_Clear);
+ SET_ClearColor(exec, _mesa_ClearColor);
+ SET_ClearStencil(exec, _mesa_ClearStencil);
+ SET_ColorMask(exec, _mesa_ColorMask);
+ SET_CullFace(exec, _mesa_CullFace);
+ SET_Disable(exec, _mesa_Disable);
+#if FEATURE_draw_read_buffer
+ SET_DrawBuffer(exec, _mesa_DrawBuffer);
+ SET_ReadBuffer(exec, _mesa_ReadBuffer);
+#endif
+ SET_Enable(exec, _mesa_Enable);
+ SET_Finish(exec, _mesa_Finish);
+ SET_Flush(exec, _mesa_Flush);
+ SET_FrontFace(exec, _mesa_FrontFace);
+ SET_Frustum(exec, _mesa_Frustum);
+ SET_GetError(exec, _mesa_GetError);
+ SET_GetFloatv(exec, _mesa_GetFloatv);
+ SET_GetString(exec, _mesa_GetString);
+ SET_LineStipple(exec, _mesa_LineStipple);
+ SET_LineWidth(exec, _mesa_LineWidth);
+ SET_LoadIdentity(exec, _mesa_LoadIdentity);
+ SET_LoadMatrixf(exec, _mesa_LoadMatrixf);
+ SET_LogicOp(exec, _mesa_LogicOp);
+ SET_MatrixMode(exec, _mesa_MatrixMode);
+ SET_MultMatrixf(exec, _mesa_MultMatrixf);
+ SET_Ortho(exec, _mesa_Ortho);
+ SET_PixelStorei(exec, _mesa_PixelStorei);
+ SET_PopMatrix(exec, _mesa_PopMatrix);
+ SET_PushMatrix(exec, _mesa_PushMatrix);
+ SET_Rotatef(exec, _mesa_Rotatef);
+ SET_Scalef(exec, _mesa_Scalef);
+ SET_Scissor(exec, _mesa_Scissor);
+ SET_ShadeModel(exec, _mesa_ShadeModel);
+ SET_StencilFunc(exec, _mesa_StencilFunc);
+ SET_StencilMask(exec, _mesa_StencilMask);
+ SET_StencilOp(exec, _mesa_StencilOp);
+ SET_TexEnvfv(exec, _mesa_TexEnvfv);
+ SET_TexEnvi(exec, _mesa_TexEnvi);
+ SET_TexImage2D(exec, _mesa_TexImage2D);
+ SET_TexParameteri(exec, _mesa_TexParameteri);
+ SET_Translatef(exec, _mesa_Translatef);
+ SET_Viewport(exec, _mesa_Viewport);
+
+ _mesa_init_accum_dispatch(exec);
+ _mesa_init_dlist_dispatch(exec);
+
+ SET_ClearDepth(exec, _mesa_ClearDepth);
+ SET_ClearIndex(exec, _mesa_ClearIndex);
+ SET_ClipPlane(exec, _mesa_ClipPlane);
+ SET_ColorMaterial(exec, _mesa_ColorMaterial);
+ SET_DepthFunc(exec, _mesa_DepthFunc);
+ SET_DepthMask(exec, _mesa_DepthMask);
+ SET_DepthRange(exec, _mesa_DepthRange);
+
+ _mesa_init_drawpix_dispatch(exec);
+ _mesa_init_feedback_dispatch(exec);
+
+ SET_FogCoordPointerEXT(exec, _mesa_FogCoordPointerEXT);
+ SET_Fogf(exec, _mesa_Fogf);
+ SET_Fogfv(exec, _mesa_Fogfv);
+ SET_Fogi(exec, _mesa_Fogi);
+ SET_Fogiv(exec, _mesa_Fogiv);
+ SET_GetClipPlane(exec, _mesa_GetClipPlane);
+ SET_GetBooleanv(exec, _mesa_GetBooleanv);
+ SET_GetDoublev(exec, _mesa_GetDoublev);
+ SET_GetIntegerv(exec, _mesa_GetIntegerv);
+ SET_GetLightfv(exec, _mesa_GetLightfv);
+ SET_GetLightiv(exec, _mesa_GetLightiv);
+ SET_GetMaterialfv(exec, _mesa_GetMaterialfv);
+ SET_GetMaterialiv(exec, _mesa_GetMaterialiv);
+ SET_GetPolygonStipple(exec, _mesa_GetPolygonStipple);
+ SET_GetTexEnvfv(exec, _mesa_GetTexEnvfv);
+ SET_GetTexEnviv(exec, _mesa_GetTexEnviv);
+ SET_GetTexLevelParameterfv(exec, _mesa_GetTexLevelParameterfv);
+ SET_GetTexLevelParameteriv(exec, _mesa_GetTexLevelParameteriv);
+ SET_GetTexParameterfv(exec, _mesa_GetTexParameterfv);
+ SET_GetTexParameteriv(exec, _mesa_GetTexParameteriv);
+ SET_GetTexImage(exec, _mesa_GetTexImage);
+ SET_Hint(exec, _mesa_Hint);
+ SET_IndexMask(exec, _mesa_IndexMask);
+ SET_IsEnabled(exec, _mesa_IsEnabled);
+ SET_LightModelf(exec, _mesa_LightModelf);
+ SET_LightModelfv(exec, _mesa_LightModelfv);
+ SET_LightModeli(exec, _mesa_LightModeli);
+ SET_LightModeliv(exec, _mesa_LightModeliv);
+ SET_Lightf(exec, _mesa_Lightf);
+ SET_Lightfv(exec, _mesa_Lightfv);
+ SET_Lighti(exec, _mesa_Lighti);
+ SET_Lightiv(exec, _mesa_Lightiv);
+ SET_LoadMatrixd(exec, _mesa_LoadMatrixd);
+
+ _mesa_init_eval_dispatch(exec);
+
+ SET_MultMatrixd(exec, _mesa_MultMatrixd);
+
+ _mesa_init_pixel_dispatch(exec);
+
+ SET_PixelStoref(exec, _mesa_PixelStoref);
+ SET_PointSize(exec, _mesa_PointSize);
+ SET_PolygonMode(exec, _mesa_PolygonMode);
+ SET_PolygonOffset(exec, _mesa_PolygonOffset);
+ SET_PolygonStipple(exec, _mesa_PolygonStipple);
+
+ _mesa_init_attrib_dispatch(exec);
+ _mesa_init_rastpos_dispatch(exec);
+
+ SET_ReadPixels(exec, _mesa_ReadPixels);
+ SET_Rotated(exec, _mesa_Rotated);
+ SET_Scaled(exec, _mesa_Scaled);
+ SET_SecondaryColorPointerEXT(exec, _mesa_SecondaryColorPointerEXT);
+ SET_TexEnvf(exec, _mesa_TexEnvf);
+ SET_TexEnviv(exec, _mesa_TexEnviv);
+
+ _mesa_init_texgen_dispatch(exec);
+
+ SET_TexImage1D(exec, _mesa_TexImage1D);
+ SET_TexParameterf(exec, _mesa_TexParameterf);
+ SET_TexParameterfv(exec, _mesa_TexParameterfv);
+ SET_TexParameteriv(exec, _mesa_TexParameteriv);
+ SET_Translated(exec, _mesa_Translated);
+
+ /* 1.1 */
+ SET_BindTexture(exec, _mesa_BindTexture);
+ SET_DeleteTextures(exec, _mesa_DeleteTextures);
+ SET_GenTextures(exec, _mesa_GenTextures);
+#if _HAVE_FULL_GL
+ SET_AreTexturesResident(exec, _mesa_AreTexturesResident);
+ SET_ColorPointer(exec, _mesa_ColorPointer);
+ SET_CopyTexImage1D(exec, _mesa_CopyTexImage1D);
+ SET_CopyTexImage2D(exec, _mesa_CopyTexImage2D);
+ SET_CopyTexSubImage1D(exec, _mesa_CopyTexSubImage1D);
+ SET_CopyTexSubImage2D(exec, _mesa_CopyTexSubImage2D);
+ SET_DisableClientState(exec, _mesa_DisableClientState);
+ SET_EdgeFlagPointer(exec, _mesa_EdgeFlagPointer);
+ SET_EnableClientState(exec, _mesa_EnableClientState);
+ SET_GetPointerv(exec, _mesa_GetPointerv);
+ SET_IndexPointer(exec, _mesa_IndexPointer);
+ SET_InterleavedArrays(exec, _mesa_InterleavedArrays);
+ SET_IsTexture(exec, _mesa_IsTexture);
+ SET_NormalPointer(exec, _mesa_NormalPointer);
+ SET_PrioritizeTextures(exec, _mesa_PrioritizeTextures);
+ SET_TexCoordPointer(exec, _mesa_TexCoordPointer);
+ SET_TexSubImage1D(exec, _mesa_TexSubImage1D);
+ SET_TexSubImage2D(exec, _mesa_TexSubImage2D);
+ SET_VertexPointer(exec, _mesa_VertexPointer);
+#endif
+
+ /* 1.2 */
+#if _HAVE_FULL_GL
+ SET_CopyTexSubImage3D(exec, _mesa_CopyTexSubImage3D);
+ SET_TexImage3D(exec, _mesa_TexImage3D);
+ SET_TexSubImage3D(exec, _mesa_TexSubImage3D);
+#endif
+
+ /* OpenGL 1.2 GL_ARB_imaging */
+ SET_BlendColor(exec, _mesa_BlendColor);
+ SET_BlendEquation(exec, _mesa_BlendEquation);
+ SET_BlendEquationSeparateEXT(exec, _mesa_BlendEquationSeparateEXT);
+
+ _mesa_init_colortable_dispatch(exec);
+ _mesa_init_convolve_dispatch(exec);
+ _mesa_init_histogram_dispatch(exec);
+
+ /* OpenGL 2.0 */
+ SET_StencilFuncSeparate(exec, _mesa_StencilFuncSeparate);
+ SET_StencilMaskSeparate(exec, _mesa_StencilMaskSeparate);
+ SET_StencilOpSeparate(exec, _mesa_StencilOpSeparate);
+
+#if FEATURE_ARB_shader_objects
+ _mesa_init_shader_dispatch(exec);
+ _mesa_init_shader_uniform_dispatch(exec);
+#endif
+
+ /* 2. GL_EXT_blend_color */
+#if 0
+/* SET_BlendColorEXT(exec, _mesa_BlendColorEXT); */
+#endif
+
+ /* 3. GL_EXT_polygon_offset */
+#if _HAVE_FULL_GL
+ SET_PolygonOffsetEXT(exec, _mesa_PolygonOffsetEXT);
+#endif
+
+ /* 6. GL_EXT_texture3d */
+#if 0
+/* SET_CopyTexSubImage3DEXT(exec, _mesa_CopyTexSubImage3D); */
+/* SET_TexImage3DEXT(exec, _mesa_TexImage3DEXT); */
+/* SET_TexSubImage3DEXT(exec, _mesa_TexSubImage3D); */
+#endif
+
+ /* 11. GL_EXT_histogram */
+#if 0
+ SET_GetHistogramEXT(exec, _mesa_GetHistogram);
+ SET_GetHistogramParameterfvEXT(exec, _mesa_GetHistogramParameterfv);
+ SET_GetHistogramParameterivEXT(exec, _mesa_GetHistogramParameteriv);
+ SET_GetMinmaxEXT(exec, _mesa_GetMinmax);
+ SET_GetMinmaxParameterfvEXT(exec, _mesa_GetMinmaxParameterfv);
+ SET_GetMinmaxParameterivEXT(exec, _mesa_GetMinmaxParameteriv);
+#endif
+
+ /* 14. SGI_color_table */
+#if 0
+ SET_ColorTableSGI(exec, _mesa_ColorTable);
+ SET_ColorSubTableSGI(exec, _mesa_ColorSubTable);
+ SET_GetColorTableSGI(exec, _mesa_GetColorTable);
+ SET_GetColorTableParameterfvSGI(exec, _mesa_GetColorTableParameterfv);
+ SET_GetColorTableParameterivSGI(exec, _mesa_GetColorTableParameteriv);
+#endif
+
+ /* 30. GL_EXT_vertex_array */
+#if _HAVE_FULL_GL
+ SET_ColorPointerEXT(exec, _mesa_ColorPointerEXT);
+ SET_EdgeFlagPointerEXT(exec, _mesa_EdgeFlagPointerEXT);
+ SET_IndexPointerEXT(exec, _mesa_IndexPointerEXT);
+ SET_NormalPointerEXT(exec, _mesa_NormalPointerEXT);
+ SET_TexCoordPointerEXT(exec, _mesa_TexCoordPointerEXT);
+ SET_VertexPointerEXT(exec, _mesa_VertexPointerEXT);
+#endif
+
+ /* 37. GL_EXT_blend_minmax */
+#if 0
+ SET_BlendEquationEXT(exec, _mesa_BlendEquationEXT);
+#endif
+
+ /* 54. GL_EXT_point_parameters */
+#if _HAVE_FULL_GL
+ SET_PointParameterfEXT(exec, _mesa_PointParameterf);
+ SET_PointParameterfvEXT(exec, _mesa_PointParameterfv);
+#endif
+
+ /* 95. GL_ARB_ES2_compatibility */
+ SET_ClearDepthf(exec, _mesa_ClearDepthf);
+ SET_DepthRangef(exec, _mesa_DepthRangef);
+
+ /* 97. GL_EXT_compiled_vertex_array */
+#if _HAVE_FULL_GL
+ SET_LockArraysEXT(exec, _mesa_LockArraysEXT);
+ SET_UnlockArraysEXT(exec, _mesa_UnlockArraysEXT);
+#endif
+
+ /* 148. GL_EXT_multi_draw_arrays */
+#if _HAVE_FULL_GL
+ SET_MultiDrawArraysEXT(exec, _mesa_MultiDrawArraysEXT);
+#endif
+
+ /* 173. GL_INGR_blend_func_separate */
+#if _HAVE_FULL_GL
+ SET_BlendFuncSeparateEXT(exec, _mesa_BlendFuncSeparateEXT);
+#endif
+
+ /* 196. GL_MESA_resize_buffers */
+#if _HAVE_FULL_GL
+ SET_ResizeBuffersMESA(exec, _mesa_ResizeBuffersMESA);
+#endif
+
+ /* 197. GL_MESA_window_pos */
+ /* part of _mesa_init_rastpos_dispatch(exec); */
+
+ /* 200. GL_IBM_multimode_draw_arrays */
+#if _HAVE_FULL_GL
+ SET_MultiModeDrawArraysIBM(exec, _mesa_MultiModeDrawArraysIBM);
+ SET_MultiModeDrawElementsIBM(exec, _mesa_MultiModeDrawElementsIBM);
+#endif
+
+ /* 233. GL_NV_vertex_program */
+#if FEATURE_NV_vertex_program
+ SET_BindProgramNV(exec, _mesa_BindProgram);
+ SET_DeleteProgramsNV(exec, _mesa_DeletePrograms);
+ SET_ExecuteProgramNV(exec, _mesa_ExecuteProgramNV);
+ SET_GenProgramsNV(exec, _mesa_GenPrograms);
+ SET_AreProgramsResidentNV(exec, _mesa_AreProgramsResidentNV);
+ SET_RequestResidentProgramsNV(exec, _mesa_RequestResidentProgramsNV);
+ SET_GetProgramParameterfvNV(exec, _mesa_GetProgramParameterfvNV);
+ SET_GetProgramParameterdvNV(exec, _mesa_GetProgramParameterdvNV);
+ SET_GetProgramivNV(exec, _mesa_GetProgramivNV);
+ SET_GetProgramStringNV(exec, _mesa_GetProgramStringNV);
+ SET_GetTrackMatrixivNV(exec, _mesa_GetTrackMatrixivNV);
+ SET_GetVertexAttribdvNV(exec, _mesa_GetVertexAttribdvNV);
+ SET_GetVertexAttribfvNV(exec, _mesa_GetVertexAttribfvNV);
+ SET_GetVertexAttribivNV(exec, _mesa_GetVertexAttribivNV);
+ SET_GetVertexAttribPointervNV(exec, _mesa_GetVertexAttribPointervNV);
+ SET_IsProgramNV(exec, _mesa_IsProgramARB);
+ SET_LoadProgramNV(exec, _mesa_LoadProgramNV);
+ SET_ProgramEnvParameter4dARB(exec, _mesa_ProgramEnvParameter4dARB); /* alias to ProgramParameter4dNV */
+ SET_ProgramEnvParameter4dvARB(exec, _mesa_ProgramEnvParameter4dvARB); /* alias to ProgramParameter4dvNV */
+ SET_ProgramEnvParameter4fARB(exec, _mesa_ProgramEnvParameter4fARB); /* alias to ProgramParameter4fNV */
+ SET_ProgramEnvParameter4fvARB(exec, _mesa_ProgramEnvParameter4fvARB); /* alias to ProgramParameter4fvNV */
+ SET_ProgramParameters4dvNV(exec, _mesa_ProgramParameters4dvNV);
+ SET_ProgramParameters4fvNV(exec, _mesa_ProgramParameters4fvNV);
+ SET_TrackMatrixNV(exec, _mesa_TrackMatrixNV);
+ SET_VertexAttribPointerNV(exec, _mesa_VertexAttribPointerNV);
+ /* glVertexAttrib*NV functions handled in api_loopback.c */
+#endif
+
+ /* 273. GL_APPLE_vertex_array_object */
+ SET_BindVertexArrayAPPLE(exec, _mesa_BindVertexArrayAPPLE);
+ SET_DeleteVertexArraysAPPLE(exec, _mesa_DeleteVertexArraysAPPLE);
+ SET_GenVertexArraysAPPLE(exec, _mesa_GenVertexArraysAPPLE);
+ SET_IsVertexArrayAPPLE(exec, _mesa_IsVertexArrayAPPLE);
+
+ /* 282. GL_NV_fragment_program */
+#if FEATURE_NV_fragment_program
+ SET_ProgramNamedParameter4fNV(exec, _mesa_ProgramNamedParameter4fNV);
+ SET_ProgramNamedParameter4dNV(exec, _mesa_ProgramNamedParameter4dNV);
+ SET_ProgramNamedParameter4fvNV(exec, _mesa_ProgramNamedParameter4fvNV);
+ SET_ProgramNamedParameter4dvNV(exec, _mesa_ProgramNamedParameter4dvNV);
+ SET_GetProgramNamedParameterfvNV(exec, _mesa_GetProgramNamedParameterfvNV);
+ SET_GetProgramNamedParameterdvNV(exec, _mesa_GetProgramNamedParameterdvNV);
+ SET_ProgramLocalParameter4dARB(exec, _mesa_ProgramLocalParameter4dARB);
+ SET_ProgramLocalParameter4dvARB(exec, _mesa_ProgramLocalParameter4dvARB);
+ SET_ProgramLocalParameter4fARB(exec, _mesa_ProgramLocalParameter4fARB);
+ SET_ProgramLocalParameter4fvARB(exec, _mesa_ProgramLocalParameter4fvARB);
+ SET_GetProgramLocalParameterdvARB(exec, _mesa_GetProgramLocalParameterdvARB);
+ SET_GetProgramLocalParameterfvARB(exec, _mesa_GetProgramLocalParameterfvARB);
+#endif
+
+ /* 262. GL_NV_point_sprite */
+#if _HAVE_FULL_GL
+ SET_PointParameteriNV(exec, _mesa_PointParameteri);
+ SET_PointParameterivNV(exec, _mesa_PointParameteriv);
+#endif
+
+ /* 268. GL_EXT_stencil_two_side */
+#if _HAVE_FULL_GL
+ SET_ActiveStencilFaceEXT(exec, _mesa_ActiveStencilFaceEXT);
+#endif
+
+ /* 285. GL_NV_primitive_restart */
+ SET_PrimitiveRestartIndexNV(exec, _mesa_PrimitiveRestartIndex);
+
+ /* ???. GL_EXT_depth_bounds_test */
+ SET_DepthBoundsEXT(exec, _mesa_DepthBoundsEXT);
+
+ /* 352. GL_EXT_transform_feedback */
+ _mesa_init_transform_feedback_dispatch(exec);
+
+ /* 364. GL_EXT_provoking_vertex */
+ SET_ProvokingVertexEXT(exec, _mesa_ProvokingVertexEXT);
+
+ /* ARB 1. GL_ARB_multitexture */
+#if _HAVE_FULL_GL
+ SET_ActiveTextureARB(exec, _mesa_ActiveTextureARB);
+ SET_ClientActiveTextureARB(exec, _mesa_ClientActiveTextureARB);
+#endif
+
+ /* ARB 3. GL_ARB_transpose_matrix */
+#if _HAVE_FULL_GL
+ SET_LoadTransposeMatrixdARB(exec, _mesa_LoadTransposeMatrixdARB);
+ SET_LoadTransposeMatrixfARB(exec, _mesa_LoadTransposeMatrixfARB);
+ SET_MultTransposeMatrixdARB(exec, _mesa_MultTransposeMatrixdARB);
+ SET_MultTransposeMatrixfARB(exec, _mesa_MultTransposeMatrixfARB);
+#endif
+
+ /* ARB 5. GL_ARB_multisample */
+#if _HAVE_FULL_GL
+ SET_SampleCoverageARB(exec, _mesa_SampleCoverageARB);
+#endif
+
+ /* ARB 12. GL_ARB_texture_compression */
+#if _HAVE_FULL_GL
+ SET_CompressedTexImage3DARB(exec, _mesa_CompressedTexImage3DARB);
+ SET_CompressedTexImage2DARB(exec, _mesa_CompressedTexImage2DARB);
+ SET_CompressedTexImage1DARB(exec, _mesa_CompressedTexImage1DARB);
+ SET_CompressedTexSubImage3DARB(exec, _mesa_CompressedTexSubImage3DARB);
+ SET_CompressedTexSubImage2DARB(exec, _mesa_CompressedTexSubImage2DARB);
+ SET_CompressedTexSubImage1DARB(exec, _mesa_CompressedTexSubImage1DARB);
+ SET_GetCompressedTexImageARB(exec, _mesa_GetCompressedTexImageARB);
+
+ /* ARB 104. GL_ARB_robustness */
+ SET_GetnCompressedTexImageARB(exec, _mesa_GetnCompressedTexImageARB);
+#endif
+
+ /* ARB 14. GL_ARB_point_parameters */
+ /* reuse EXT_point_parameters functions */
+
+ /* ARB 26. GL_ARB_vertex_program */
+ /* ARB 27. GL_ARB_fragment_program */
+#if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
+ /* glVertexAttrib1sARB aliases glVertexAttrib1sNV */
+ /* glVertexAttrib1fARB aliases glVertexAttrib1fNV */
+ /* glVertexAttrib1dARB aliases glVertexAttrib1dNV */
+ /* glVertexAttrib2sARB aliases glVertexAttrib2sNV */
+ /* glVertexAttrib2fARB aliases glVertexAttrib2fNV */
+ /* glVertexAttrib2dARB aliases glVertexAttrib2dNV */
+ /* glVertexAttrib3sARB aliases glVertexAttrib3sNV */
+ /* glVertexAttrib3fARB aliases glVertexAttrib3fNV */
+ /* glVertexAttrib3dARB aliases glVertexAttrib3dNV */
+ /* glVertexAttrib4sARB aliases glVertexAttrib4sNV */
+ /* glVertexAttrib4fARB aliases glVertexAttrib4fNV */
+ /* glVertexAttrib4dARB aliases glVertexAttrib4dNV */
+ /* glVertexAttrib4NubARB aliases glVertexAttrib4NubNV */
+ /* glVertexAttrib1svARB aliases glVertexAttrib1svNV */
+ /* glVertexAttrib1fvARB aliases glVertexAttrib1fvNV */
+ /* glVertexAttrib1dvARB aliases glVertexAttrib1dvNV */
+ /* glVertexAttrib2svARB aliases glVertexAttrib2svNV */
+ /* glVertexAttrib2fvARB aliases glVertexAttrib2fvNV */
+ /* glVertexAttrib2dvARB aliases glVertexAttrib2dvNV */
+ /* glVertexAttrib3svARB aliases glVertexAttrib3svNV */
+ /* glVertexAttrib3fvARB aliases glVertexAttrib3fvNV */
+ /* glVertexAttrib3dvARB aliases glVertexAttrib3dvNV */
+ /* glVertexAttrib4svARB aliases glVertexAttrib4svNV */
+ /* glVertexAttrib4fvARB aliases glVertexAttrib4fvNV */
+ /* glVertexAttrib4dvARB aliases glVertexAttrib4dvNV */
+ /* glVertexAttrib4NubvARB aliases glVertexAttrib4NubvNV */
+ /* glVertexAttrib4bvARB handled in api_loopback.c */
+ /* glVertexAttrib4ivARB handled in api_loopback.c */
+ /* glVertexAttrib4ubvARB handled in api_loopback.c */
+ /* glVertexAttrib4usvARB handled in api_loopback.c */
+ /* glVertexAttrib4uivARB handled in api_loopback.c */
+ /* glVertexAttrib4NbvARB handled in api_loopback.c */
+ /* glVertexAttrib4NsvARB handled in api_loopback.c */
+ /* glVertexAttrib4NivARB handled in api_loopback.c */
+ /* glVertexAttrib4NusvARB handled in api_loopback.c */
+ /* glVertexAttrib4NuivARB handled in api_loopback.c */
+ SET_VertexAttribPointerARB(exec, _mesa_VertexAttribPointerARB);
+ SET_EnableVertexAttribArrayARB(exec, _mesa_EnableVertexAttribArrayARB);
+ SET_DisableVertexAttribArrayARB(exec, _mesa_DisableVertexAttribArrayARB);
+ SET_ProgramStringARB(exec, _mesa_ProgramStringARB);
+ /* glBindProgramARB aliases glBindProgramNV */
+ /* glDeleteProgramsARB aliases glDeleteProgramsNV */
+ /* glGenProgramsARB aliases glGenProgramsNV */
+ /* glIsProgramARB aliases glIsProgramNV */
+ SET_GetVertexAttribdvARB(exec, _mesa_GetVertexAttribdvARB);
+ SET_GetVertexAttribfvARB(exec, _mesa_GetVertexAttribfvARB);
+ SET_GetVertexAttribivARB(exec, _mesa_GetVertexAttribivARB);
+ /* glGetVertexAttribPointervARB aliases glGetVertexAttribPointervNV */
+ SET_ProgramEnvParameter4dARB(exec, _mesa_ProgramEnvParameter4dARB);
+ SET_ProgramEnvParameter4dvARB(exec, _mesa_ProgramEnvParameter4dvARB);
+ SET_ProgramEnvParameter4fARB(exec, _mesa_ProgramEnvParameter4fARB);
+ SET_ProgramEnvParameter4fvARB(exec, _mesa_ProgramEnvParameter4fvARB);
+ SET_ProgramLocalParameter4dARB(exec, _mesa_ProgramLocalParameter4dARB);
+ SET_ProgramLocalParameter4dvARB(exec, _mesa_ProgramLocalParameter4dvARB);
+ SET_ProgramLocalParameter4fARB(exec, _mesa_ProgramLocalParameter4fARB);
+ SET_ProgramLocalParameter4fvARB(exec, _mesa_ProgramLocalParameter4fvARB);
+ SET_GetProgramEnvParameterdvARB(exec, _mesa_GetProgramEnvParameterdvARB);
+ SET_GetProgramEnvParameterfvARB(exec, _mesa_GetProgramEnvParameterfvARB);
+ SET_GetProgramLocalParameterdvARB(exec, _mesa_GetProgramLocalParameterdvARB);
+ SET_GetProgramLocalParameterfvARB(exec, _mesa_GetProgramLocalParameterfvARB);
+ SET_GetProgramivARB(exec, _mesa_GetProgramivARB);
+ SET_GetProgramStringARB(exec, _mesa_GetProgramStringARB);
+#endif
+
+ /* ARB 28. GL_ARB_vertex_buffer_object */
+#if FEATURE_ARB_vertex_buffer_object
+ SET_BindBufferARB(exec, _mesa_BindBufferARB);
+ SET_BufferDataARB(exec, _mesa_BufferDataARB);
+ SET_BufferSubDataARB(exec, _mesa_BufferSubDataARB);
+ SET_DeleteBuffersARB(exec, _mesa_DeleteBuffersARB);
+ SET_GenBuffersARB(exec, _mesa_GenBuffersARB);
+ SET_GetBufferParameterivARB(exec, _mesa_GetBufferParameterivARB);
+ SET_GetBufferPointervARB(exec, _mesa_GetBufferPointervARB);
+ SET_GetBufferSubDataARB(exec, _mesa_GetBufferSubDataARB);
+ SET_IsBufferARB(exec, _mesa_IsBufferARB);
+ SET_MapBufferARB(exec, _mesa_MapBufferARB);
+ SET_UnmapBufferARB(exec, _mesa_UnmapBufferARB);
+#endif
+
+ /* ARB 29. GL_ARB_occlusion_query */
+ _mesa_init_queryobj_dispatch(exec);
+
+ /* ARB 37. GL_ARB_draw_buffers */
+#if FEATURE_draw_read_buffer
+ SET_DrawBuffersARB(exec, _mesa_DrawBuffersARB);
+#endif
+
+ /* ARB 104. GL_ARB_robustness */
+ SET_GetGraphicsResetStatusARB(exec, _mesa_GetGraphicsResetStatusARB);
+ SET_GetnPolygonStippleARB(exec, _mesa_GetnPolygonStippleARB);
+ SET_GetnTexImageARB(exec, _mesa_GetnTexImageARB);
+ SET_ReadnPixelsARB(exec, _mesa_ReadnPixelsARB);
+
+ /* GL_ARB_sync */
+ _mesa_init_sync_dispatch(exec);
+
+ /* GL_ATI_fragment_shader */
+ _mesa_init_ati_fragment_shader_dispatch(exec);
+
+ /* GL_ATI_envmap_bumpmap */
+ SET_GetTexBumpParameterivATI(exec, _mesa_GetTexBumpParameterivATI);
+ SET_GetTexBumpParameterfvATI(exec, _mesa_GetTexBumpParameterfvATI);
+ SET_TexBumpParameterivATI(exec, _mesa_TexBumpParameterivATI);
+ SET_TexBumpParameterfvATI(exec, _mesa_TexBumpParameterfvATI);
+
+#if FEATURE_EXT_framebuffer_object
+ SET_IsRenderbufferEXT(exec, _mesa_IsRenderbufferEXT);
+ SET_BindRenderbufferEXT(exec, _mesa_BindRenderbufferEXT);
+ SET_DeleteRenderbuffersEXT(exec, _mesa_DeleteRenderbuffersEXT);
+ SET_GenRenderbuffersEXT(exec, _mesa_GenRenderbuffersEXT);
+ SET_RenderbufferStorageEXT(exec, _mesa_RenderbufferStorageEXT);
+ SET_GetRenderbufferParameterivEXT(exec, _mesa_GetRenderbufferParameterivEXT);
+ SET_IsFramebufferEXT(exec, _mesa_IsFramebufferEXT);
+ SET_BindFramebufferEXT(exec, _mesa_BindFramebufferEXT);
+ SET_DeleteFramebuffersEXT(exec, _mesa_DeleteFramebuffersEXT);
+ SET_GenFramebuffersEXT(exec, _mesa_GenFramebuffersEXT);
+ SET_CheckFramebufferStatusEXT(exec, _mesa_CheckFramebufferStatusEXT);
+ SET_FramebufferTexture1DEXT(exec, _mesa_FramebufferTexture1DEXT);
+ SET_FramebufferTexture2DEXT(exec, _mesa_FramebufferTexture2DEXT);
+ SET_FramebufferTexture3DEXT(exec, _mesa_FramebufferTexture3DEXT);
+ SET_FramebufferRenderbufferEXT(exec, _mesa_FramebufferRenderbufferEXT);
+ SET_GetFramebufferAttachmentParameterivEXT(exec, _mesa_GetFramebufferAttachmentParameterivEXT);
+ SET_GenerateMipmapEXT(exec, _mesa_GenerateMipmapEXT);
+#endif
+
+#if FEATURE_EXT_framebuffer_blit
+ SET_BlitFramebufferEXT(exec, _mesa_BlitFramebufferEXT);
+#endif
+
+ /* GL_EXT_gpu_program_parameters */
+#if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
+ SET_ProgramEnvParameters4fvEXT(exec, _mesa_ProgramEnvParameters4fvEXT);
+ SET_ProgramLocalParameters4fvEXT(exec, _mesa_ProgramLocalParameters4fvEXT);
+#endif
+
+ /* GL_MESA_texture_array / GL_EXT_texture_array */
+#if FEATURE_EXT_framebuffer_object
+ SET_FramebufferTextureLayerEXT(exec, _mesa_FramebufferTextureLayerEXT);
+#endif
+
+ /* GL_ATI_separate_stencil */
+ SET_StencilFuncSeparateATI(exec, _mesa_StencilFuncSeparateATI);
+
+#if FEATURE_ARB_framebuffer_object
+ /* The ARB_fbo functions are the union of
+ * GL_EXT_fbo, GL_EXT_framebuffer_blit, GL_EXT_texture_array
+ */
+ SET_RenderbufferStorageMultisample(exec, _mesa_RenderbufferStorageMultisample);
+#endif
+
+#if FEATURE_ARB_map_buffer_range
+ SET_MapBufferRange(exec, _mesa_MapBufferRange);
+ SET_FlushMappedBufferRange(exec, _mesa_FlushMappedBufferRange);
+#endif
+
+ /* GL_ARB_copy_buffer */
+ SET_CopyBufferSubData(exec, _mesa_CopyBufferSubData);
+
+ /* GL_ARB_vertex_array_object */
+ SET_BindVertexArray(exec, _mesa_BindVertexArray);
+ SET_GenVertexArrays(exec, _mesa_GenVertexArrays);
+
+ /* GL_EXT_draw_buffers2 */
+ SET_ColorMaskIndexedEXT(exec, _mesa_ColorMaskIndexed);
+ SET_GetBooleanIndexedvEXT(exec, _mesa_GetBooleanIndexedv);
+ SET_GetIntegerIndexedvEXT(exec, _mesa_GetIntegerIndexedv);
+ SET_EnableIndexedEXT(exec, _mesa_EnableIndexed);
+ SET_DisableIndexedEXT(exec, _mesa_DisableIndexed);
+ SET_IsEnabledIndexedEXT(exec, _mesa_IsEnabledIndexed);
+
+ /* GL_NV_conditional_render */
+ SET_BeginConditionalRenderNV(exec, _mesa_BeginConditionalRender);
+ SET_EndConditionalRenderNV(exec, _mesa_EndConditionalRender);
+
+#if FEATURE_OES_EGL_image
+ SET_EGLImageTargetTexture2DOES(exec, _mesa_EGLImageTargetTexture2DOES);
+ SET_EGLImageTargetRenderbufferStorageOES(exec, _mesa_EGLImageTargetRenderbufferStorageOES);
+#endif
+
+#if FEATURE_APPLE_object_purgeable
+ SET_ObjectPurgeableAPPLE(exec, _mesa_ObjectPurgeableAPPLE);
+ SET_ObjectUnpurgeableAPPLE(exec, _mesa_ObjectUnpurgeableAPPLE);
+ SET_GetObjectParameterivAPPLE(exec, _mesa_GetObjectParameterivAPPLE);
+#endif
+
+#if FEATURE_ARB_geometry_shader4
+ SET_FramebufferTextureARB(exec, _mesa_FramebufferTextureARB);
+ SET_FramebufferTextureFaceARB(exec, _mesa_FramebufferTextureFaceARB);
+#endif
+
+ SET_ClampColorARB(exec, _mesa_ClampColorARB);
+
+ /* GL_EXT_texture_integer */
+ SET_ClearColorIiEXT(exec, _mesa_ClearColorIiEXT);
+ SET_ClearColorIuiEXT(exec, _mesa_ClearColorIuiEXT);
+ SET_GetTexParameterIivEXT(exec, _mesa_GetTexParameterIiv);
+ SET_GetTexParameterIuivEXT(exec, _mesa_GetTexParameterIuiv);
+ SET_TexParameterIivEXT(exec, _mesa_TexParameterIiv);
+ SET_TexParameterIuivEXT(exec, _mesa_TexParameterIuiv);
+
+ /* GL_EXT_gpu_shader4 / OpenGL 3.0 */
+ SET_GetVertexAttribIivEXT(exec, _mesa_GetVertexAttribIiv);
+ SET_GetVertexAttribIuivEXT(exec, _mesa_GetVertexAttribIuiv);
+ SET_VertexAttribIPointerEXT(exec, _mesa_VertexAttribIPointer);
+
+ /* GL 3.0 (functions not covered by other extensions) */
+ SET_ClearBufferiv(exec, _mesa_ClearBufferiv);
+ SET_ClearBufferuiv(exec, _mesa_ClearBufferuiv);
+ SET_ClearBufferfv(exec, _mesa_ClearBufferfv);
+ SET_ClearBufferfi(exec, _mesa_ClearBufferfi);
+ SET_GetStringi(exec, _mesa_GetStringi);
+ SET_ClampColor(exec, _mesa_ClampColorARB);
+
+ /* GL_ARB_instanced_arrays */
+ SET_VertexAttribDivisorARB(exec, _mesa_VertexAttribDivisor);
+
+ /* GL_ARB_draw_buffer_blend */
+ SET_BlendFunciARB(exec, _mesa_BlendFunci);
+ SET_BlendFuncSeparateiARB(exec, _mesa_BlendFuncSeparatei);
+ SET_BlendEquationiARB(exec, _mesa_BlendEquationi);
+ SET_BlendEquationSeparateiARB(exec, _mesa_BlendEquationSeparatei);
+
+ /* GL_NV_texture_barrier */
+ SET_TextureBarrierNV(exec, _mesa_TextureBarrierNV);
+
+ /* GL_ARB_texture_buffer_object */
+ SET_TexBufferARB(exec, _mesa_TexBuffer);
+
+#if FEATURE_ARB_sampler_objects
+ _mesa_init_sampler_object_dispatch(exec);
+#endif
+
+ return exec;
+}
+
+#endif /* FEATURE_GL */
diff --git a/mesalib/src/mesa/main/attrib.c b/mesalib/src/mesa/main/attrib.c
index 573100402..ed461f1e7 100644
--- a/mesalib/src/mesa/main/attrib.c
+++ b/mesalib/src/mesa/main/attrib.c
@@ -1,1563 +1,1563 @@
-/*
- * Mesa 3-D graphics library
- * Version: 7.6
- *
- * Copyright (C) 1999-2008 Brian Paul All Rights Reserved.
- * Copyright (C) 2009 VMware, Inc. All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-#include "glheader.h"
-#include "imports.h"
-#include "accum.h"
-#include "arrayobj.h"
-#include "attrib.h"
-#include "blend.h"
-#include "buffers.h"
-#include "bufferobj.h"
-#include "clear.h"
-#include "colormac.h"
-#include "context.h"
-#include "depth.h"
-#include "enable.h"
-#include "enums.h"
-#include "fog.h"
-#include "hint.h"
-#include "light.h"
-#include "lines.h"
-#include "macros.h"
-#include "matrix.h"
-#include "mfeatures.h"
-#include "multisample.h"
-#include "points.h"
-#include "polygon.h"
-#include "scissor.h"
-#include "stencil.h"
-#include "texenv.h"
-#include "texgen.h"
-#include "texobj.h"
-#include "texparam.h"
-#include "texstate.h"
-#include "varray.h"
-#include "viewport.h"
-#include "mtypes.h"
-#include "main/dispatch.h"
-
-
-/**
- * glEnable()/glDisable() attribute group (GL_ENABLE_BIT).
- */
-struct gl_enable_attrib
-{
- GLboolean AlphaTest;
- GLboolean AutoNormal;
- GLboolean Blend;
- GLbitfield ClipPlanes;
- GLboolean ColorMaterial;
- GLboolean CullFace;
- GLboolean DepthClamp;
- GLboolean DepthTest;
- GLboolean Dither;
- GLboolean Fog;
- GLboolean Light[MAX_LIGHTS];
- GLboolean Lighting;
- GLboolean LineSmooth;
- GLboolean LineStipple;
- GLboolean IndexLogicOp;
- GLboolean ColorLogicOp;
-
- GLboolean Map1Color4;
- GLboolean Map1Index;
- GLboolean Map1Normal;
- GLboolean Map1TextureCoord1;
- GLboolean Map1TextureCoord2;
- GLboolean Map1TextureCoord3;
- GLboolean Map1TextureCoord4;
- GLboolean Map1Vertex3;
- GLboolean Map1Vertex4;
- GLboolean Map1Attrib[16]; /* GL_NV_vertex_program */
- GLboolean Map2Color4;
- GLboolean Map2Index;
- GLboolean Map2Normal;
- GLboolean Map2TextureCoord1;
- GLboolean Map2TextureCoord2;
- GLboolean Map2TextureCoord3;
- GLboolean Map2TextureCoord4;
- GLboolean Map2Vertex3;
- GLboolean Map2Vertex4;
- GLboolean Map2Attrib[16]; /* GL_NV_vertex_program */
-
- GLboolean Normalize;
- GLboolean PixelTexture;
- GLboolean PointSmooth;
- GLboolean PolygonOffsetPoint;
- GLboolean PolygonOffsetLine;
- GLboolean PolygonOffsetFill;
- GLboolean PolygonSmooth;
- GLboolean PolygonStipple;
- GLboolean RescaleNormals;
- GLboolean Scissor;
- GLboolean Stencil;
- GLboolean StencilTwoSide; /* GL_EXT_stencil_two_side */
- GLboolean MultisampleEnabled; /* GL_ARB_multisample */
- GLboolean SampleAlphaToCoverage; /* GL_ARB_multisample */
- GLboolean SampleAlphaToOne; /* GL_ARB_multisample */
- GLboolean SampleCoverage; /* GL_ARB_multisample */
- GLboolean SampleCoverageInvert; /* GL_ARB_multisample */
- GLboolean RasterPositionUnclipped; /* GL_IBM_rasterpos_clip */
-
- GLbitfield Texture[MAX_TEXTURE_UNITS];
- GLbitfield TexGen[MAX_TEXTURE_UNITS];
-
- /* GL_ARB_vertex_program / GL_NV_vertex_program */
- GLboolean VertexProgram;
- GLboolean VertexProgramPointSize;
- GLboolean VertexProgramTwoSide;
-
- /* GL_ARB_point_sprite / GL_NV_point_sprite */
- GLboolean PointSprite;
- GLboolean FragmentShaderATI;
-};
-
-
-/**
- * Node for the attribute stack.
- */
-struct gl_attrib_node
-{
- GLbitfield kind;
- void *data;
- struct gl_attrib_node *next;
-};
-
-
-
-/**
- * Special struct for saving/restoring texture state (GL_TEXTURE_BIT)
- */
-struct texture_state
-{
- struct gl_texture_attrib Texture; /**< The usual context state */
-
- /** to save per texture object state (wrap modes, filters, etc): */
- struct gl_texture_object SavedObj[MAX_TEXTURE_UNITS][NUM_TEXTURE_TARGETS];
-
- /**
- * To save references to texture objects (so they don't get accidentally
- * deleted while saved in the attribute stack).
- */
- struct gl_texture_object *SavedTexRef[MAX_TEXTURE_UNITS][NUM_TEXTURE_TARGETS];
-};
-
-
-#if FEATURE_attrib_stack
-
-
-/**
- * Allocate new attribute node of given type/kind. Attach payload data.
- * Insert it into the linked list named by 'head'.
- */
-static void
-save_attrib_data(struct gl_attrib_node **head,
- GLbitfield kind, void *payload)
-{
- struct gl_attrib_node *n = MALLOC_STRUCT(gl_attrib_node);
- if (n) {
- n->kind = kind;
- n->data = payload;
- /* insert at head */
- n->next = *head;
- *head = n;
- }
- else {
- /* out of memory! */
- }
-}
-
-
-void GLAPIENTRY
-_mesa_PushAttrib(GLbitfield mask)
-{
- struct gl_attrib_node *head;
-
- GET_CURRENT_CONTEXT(ctx);
- ASSERT_OUTSIDE_BEGIN_END(ctx);
-
- if (MESA_VERBOSE & VERBOSE_API)
- _mesa_debug(ctx, "glPushAttrib %x\n", (int) mask);
-
- if (ctx->AttribStackDepth >= MAX_ATTRIB_STACK_DEPTH) {
- _mesa_error( ctx, GL_STACK_OVERFLOW, "glPushAttrib" );
- return;
- }
-
- /* Build linked list of attribute nodes which save all attribute */
- /* groups specified by the mask. */
- head = NULL;
-
- if (mask & GL_ACCUM_BUFFER_BIT) {
- struct gl_accum_attrib *attr;
- attr = MALLOC_STRUCT( gl_accum_attrib );
- memcpy( attr, &ctx->Accum, sizeof(struct gl_accum_attrib) );
- save_attrib_data(&head, GL_ACCUM_BUFFER_BIT, attr);
- }
-
- if (mask & GL_COLOR_BUFFER_BIT) {
- GLuint i;
- struct gl_colorbuffer_attrib *attr;
- attr = MALLOC_STRUCT( gl_colorbuffer_attrib );
- memcpy( attr, &ctx->Color, sizeof(struct gl_colorbuffer_attrib) );
- /* push the Draw FBO's DrawBuffer[] state, not ctx->Color.DrawBuffer[] */
- for (i = 0; i < ctx->Const.MaxDrawBuffers; i ++)
- attr->DrawBuffer[i] = ctx->DrawBuffer->ColorDrawBuffer[i];
- save_attrib_data(&head, GL_COLOR_BUFFER_BIT, attr);
- }
-
- if (mask & GL_CURRENT_BIT) {
- struct gl_current_attrib *attr;
- FLUSH_CURRENT( ctx, 0 );
- attr = MALLOC_STRUCT( gl_current_attrib );
- memcpy( attr, &ctx->Current, sizeof(struct gl_current_attrib) );
- save_attrib_data(&head, GL_CURRENT_BIT, attr);
- }
-
- if (mask & GL_DEPTH_BUFFER_BIT) {
- struct gl_depthbuffer_attrib *attr;
- attr = MALLOC_STRUCT( gl_depthbuffer_attrib );
- memcpy( attr, &ctx->Depth, sizeof(struct gl_depthbuffer_attrib) );
- save_attrib_data(&head, GL_DEPTH_BUFFER_BIT, attr);
- }
-
- if (mask & GL_ENABLE_BIT) {
- struct gl_enable_attrib *attr;
- GLuint i;
- attr = MALLOC_STRUCT( gl_enable_attrib );
- /* Copy enable flags from all other attributes into the enable struct. */
- attr->AlphaTest = ctx->Color.AlphaEnabled;
- attr->AutoNormal = ctx->Eval.AutoNormal;
- attr->Blend = ctx->Color.BlendEnabled;
- attr->ClipPlanes = ctx->Transform.ClipPlanesEnabled;
- attr->ColorMaterial = ctx->Light.ColorMaterialEnabled;
- attr->CullFace = ctx->Polygon.CullFlag;
- attr->DepthClamp = ctx->Transform.DepthClamp;
- attr->DepthTest = ctx->Depth.Test;
- attr->Dither = ctx->Color.DitherFlag;
- attr->Fog = ctx->Fog.Enabled;
- for (i = 0; i < ctx->Const.MaxLights; i++) {
- attr->Light[i] = ctx->Light.Light[i].Enabled;
- }
- attr->Lighting = ctx->Light.Enabled;
- attr->LineSmooth = ctx->Line.SmoothFlag;
- attr->LineStipple = ctx->Line.StippleFlag;
- attr->IndexLogicOp = ctx->Color.IndexLogicOpEnabled;
- attr->ColorLogicOp = ctx->Color.ColorLogicOpEnabled;
- attr->Map1Color4 = ctx->Eval.Map1Color4;
- attr->Map1Index = ctx->Eval.Map1Index;
- attr->Map1Normal = ctx->Eval.Map1Normal;
- attr->Map1TextureCoord1 = ctx->Eval.Map1TextureCoord1;
- attr->Map1TextureCoord2 = ctx->Eval.Map1TextureCoord2;
- attr->Map1TextureCoord3 = ctx->Eval.Map1TextureCoord3;
- attr->Map1TextureCoord4 = ctx->Eval.Map1TextureCoord4;
- attr->Map1Vertex3 = ctx->Eval.Map1Vertex3;
- attr->Map1Vertex4 = ctx->Eval.Map1Vertex4;
- memcpy(attr->Map1Attrib, ctx->Eval.Map1Attrib, sizeof(ctx->Eval.Map1Attrib));
- attr->Map2Color4 = ctx->Eval.Map2Color4;
- attr->Map2Index = ctx->Eval.Map2Index;
- attr->Map2Normal = ctx->Eval.Map2Normal;
- attr->Map2TextureCoord1 = ctx->Eval.Map2TextureCoord1;
- attr->Map2TextureCoord2 = ctx->Eval.Map2TextureCoord2;
- attr->Map2TextureCoord3 = ctx->Eval.Map2TextureCoord3;
- attr->Map2TextureCoord4 = ctx->Eval.Map2TextureCoord4;
- attr->Map2Vertex3 = ctx->Eval.Map2Vertex3;
- attr->Map2Vertex4 = ctx->Eval.Map2Vertex4;
- memcpy(attr->Map2Attrib, ctx->Eval.Map2Attrib, sizeof(ctx->Eval.Map2Attrib));
- attr->Normalize = ctx->Transform.Normalize;
- attr->RasterPositionUnclipped = ctx->Transform.RasterPositionUnclipped;
- attr->PointSmooth = ctx->Point.SmoothFlag;
- attr->PointSprite = ctx->Point.PointSprite;
- attr->PolygonOffsetPoint = ctx->Polygon.OffsetPoint;
- attr->PolygonOffsetLine = ctx->Polygon.OffsetLine;
- attr->PolygonOffsetFill = ctx->Polygon.OffsetFill;
- attr->PolygonSmooth = ctx->Polygon.SmoothFlag;
- attr->PolygonStipple = ctx->Polygon.StippleFlag;
- attr->RescaleNormals = ctx->Transform.RescaleNormals;
- attr->Scissor = ctx->Scissor.Enabled;
- attr->Stencil = ctx->Stencil.Enabled;
- attr->StencilTwoSide = ctx->Stencil.TestTwoSide;
- attr->MultisampleEnabled = ctx->Multisample.Enabled;
- attr->SampleAlphaToCoverage = ctx->Multisample.SampleAlphaToCoverage;
- attr->SampleAlphaToOne = ctx->Multisample.SampleAlphaToOne;
- attr->SampleCoverage = ctx->Multisample.SampleCoverage;
- attr->SampleCoverageInvert = ctx->Multisample.SampleCoverageInvert;
- for (i = 0; i < ctx->Const.MaxTextureUnits; i++) {
- attr->Texture[i] = ctx->Texture.Unit[i].Enabled;
- attr->TexGen[i] = ctx->Texture.Unit[i].TexGenEnabled;
- }
- /* GL_NV_vertex_program */
- attr->VertexProgram = ctx->VertexProgram.Enabled;
- attr->VertexProgramPointSize = ctx->VertexProgram.PointSizeEnabled;
- attr->VertexProgramTwoSide = ctx->VertexProgram.TwoSideEnabled;
- save_attrib_data(&head, GL_ENABLE_BIT, attr);
- }
-
- if (mask & GL_EVAL_BIT) {
- struct gl_eval_attrib *attr;
- attr = MALLOC_STRUCT( gl_eval_attrib );
- memcpy( attr, &ctx->Eval, sizeof(struct gl_eval_attrib) );
- save_attrib_data(&head, GL_EVAL_BIT, attr);
- }
-
- if (mask & GL_FOG_BIT) {
- struct gl_fog_attrib *attr;
- attr = MALLOC_STRUCT( gl_fog_attrib );
- memcpy( attr, &ctx->Fog, sizeof(struct gl_fog_attrib) );
- save_attrib_data(&head, GL_FOG_BIT, attr);
- }
-
- if (mask & GL_HINT_BIT) {
- struct gl_hint_attrib *attr;
- attr = MALLOC_STRUCT( gl_hint_attrib );
- memcpy( attr, &ctx->Hint, sizeof(struct gl_hint_attrib) );
- save_attrib_data(&head, GL_HINT_BIT, attr);
- }
-
- if (mask & GL_LIGHTING_BIT) {
- struct gl_light_attrib *attr;
- FLUSH_CURRENT(ctx, 0); /* flush material changes */
- attr = MALLOC_STRUCT( gl_light_attrib );
- memcpy( attr, &ctx->Light, sizeof(struct gl_light_attrib) );
- save_attrib_data(&head, GL_LIGHTING_BIT, attr);
- }
-
- if (mask & GL_LINE_BIT) {
- struct gl_line_attrib *attr;
- attr = MALLOC_STRUCT( gl_line_attrib );
- memcpy( attr, &ctx->Line, sizeof(struct gl_line_attrib) );
- save_attrib_data(&head, GL_LINE_BIT, attr);
- }
-
- if (mask & GL_LIST_BIT) {
- struct gl_list_attrib *attr;
- attr = MALLOC_STRUCT( gl_list_attrib );
- memcpy( attr, &ctx->List, sizeof(struct gl_list_attrib) );
- save_attrib_data(&head, GL_LIST_BIT, attr);
- }
-
- if (mask & GL_PIXEL_MODE_BIT) {
- struct gl_pixel_attrib *attr;
- attr = MALLOC_STRUCT( gl_pixel_attrib );
- memcpy( attr, &ctx->Pixel, sizeof(struct gl_pixel_attrib) );
- /* push the Read FBO's ReadBuffer state, not ctx->Pixel.ReadBuffer */
- attr->ReadBuffer = ctx->ReadBuffer->ColorReadBuffer;
- save_attrib_data(&head, GL_PIXEL_MODE_BIT, attr);
- }
-
- if (mask & GL_POINT_BIT) {
- struct gl_point_attrib *attr;
- attr = MALLOC_STRUCT( gl_point_attrib );
- memcpy( attr, &ctx->Point, sizeof(struct gl_point_attrib) );
- save_attrib_data(&head, GL_POINT_BIT, attr);
- }
-
- if (mask & GL_POLYGON_BIT) {
- struct gl_polygon_attrib *attr;
- attr = MALLOC_STRUCT( gl_polygon_attrib );
- memcpy( attr, &ctx->Polygon, sizeof(struct gl_polygon_attrib) );
- save_attrib_data(&head, GL_POLYGON_BIT, attr);
- }
-
- if (mask & GL_POLYGON_STIPPLE_BIT) {
- GLuint *stipple;
- stipple = (GLuint *) MALLOC( 32*sizeof(GLuint) );
- memcpy( stipple, ctx->PolygonStipple, 32*sizeof(GLuint) );
- save_attrib_data(&head, GL_POLYGON_STIPPLE_BIT, stipple);
- }
-
- if (mask & GL_SCISSOR_BIT) {
- struct gl_scissor_attrib *attr;
- attr = MALLOC_STRUCT( gl_scissor_attrib );
- memcpy( attr, &ctx->Scissor, sizeof(struct gl_scissor_attrib) );
- save_attrib_data(&head, GL_SCISSOR_BIT, attr);
- }
-
- if (mask & GL_STENCIL_BUFFER_BIT) {
- struct gl_stencil_attrib *attr;
- attr = MALLOC_STRUCT( gl_stencil_attrib );
- memcpy( attr, &ctx->Stencil, sizeof(struct gl_stencil_attrib) );
- save_attrib_data(&head, GL_STENCIL_BUFFER_BIT, attr);
- }
-
- if (mask & GL_TEXTURE_BIT) {
- struct texture_state *texstate = CALLOC_STRUCT(texture_state);
- GLuint u, tex;
-
- if (!texstate) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "glPushAttrib(GL_TEXTURE_BIT)");
- goto end;
- }
-
- _mesa_lock_context_textures(ctx);
-
- /* copy/save the bulk of texture state here */
- memcpy(&texstate->Texture, &ctx->Texture, sizeof(ctx->Texture));
-
- /* Save references to the currently bound texture objects so they don't
- * accidentally get deleted while referenced in the attribute stack.
- */
- for (u = 0; u < ctx->Const.MaxTextureUnits; u++) {
- for (tex = 0; tex < NUM_TEXTURE_TARGETS; tex++) {
- _mesa_reference_texobj(&texstate->SavedTexRef[u][tex],
- ctx->Texture.Unit[u].CurrentTex[tex]);
- }
- }
-
- /* copy state/contents of the currently bound texture objects */
- for (u = 0; u < ctx->Const.MaxTextureUnits; u++) {
- for (tex = 0; tex < NUM_TEXTURE_TARGETS; tex++) {
- _mesa_copy_texture_object(&texstate->SavedObj[u][tex],
- ctx->Texture.Unit[u].CurrentTex[tex]);
- }
- }
-
- _mesa_unlock_context_textures(ctx);
-
- save_attrib_data(&head, GL_TEXTURE_BIT, texstate);
- }
-
- if (mask & GL_TRANSFORM_BIT) {
- struct gl_transform_attrib *attr;
- attr = MALLOC_STRUCT( gl_transform_attrib );
- memcpy( attr, &ctx->Transform, sizeof(struct gl_transform_attrib) );
- save_attrib_data(&head, GL_TRANSFORM_BIT, attr);
- }
-
- if (mask & GL_VIEWPORT_BIT) {
- struct gl_viewport_attrib *attr;
- attr = MALLOC_STRUCT( gl_viewport_attrib );
- memcpy( attr, &ctx->Viewport, sizeof(struct gl_viewport_attrib) );
- save_attrib_data(&head, GL_VIEWPORT_BIT, attr);
- }
-
- /* GL_ARB_multisample */
- if (mask & GL_MULTISAMPLE_BIT_ARB) {
- struct gl_multisample_attrib *attr;
- attr = MALLOC_STRUCT( gl_multisample_attrib );
- memcpy( attr, &ctx->Multisample, sizeof(struct gl_multisample_attrib) );
- save_attrib_data(&head, GL_MULTISAMPLE_BIT_ARB, attr);
- }
-
-end:
- ctx->AttribStack[ctx->AttribStackDepth] = head;
- ctx->AttribStackDepth++;
-}
-
-
-
-static void
-pop_enable_group(struct gl_context *ctx, const struct gl_enable_attrib *enable)
-{
- const GLuint curTexUnitSave = ctx->Texture.CurrentUnit;
- GLuint i;
-
-#define TEST_AND_UPDATE(VALUE, NEWVALUE, ENUM) \
- if ((VALUE) != (NEWVALUE)) { \
- _mesa_set_enable( ctx, ENUM, (NEWVALUE) ); \
- }
-
- TEST_AND_UPDATE(ctx->Color.AlphaEnabled, enable->AlphaTest, GL_ALPHA_TEST);
- if (ctx->Color.BlendEnabled != enable->Blend) {
- if (ctx->Extensions.EXT_draw_buffers2) {
- GLuint i;
- for (i = 0; i < ctx->Const.MaxDrawBuffers; i++) {
- _mesa_set_enablei(ctx, GL_BLEND, i, (enable->Blend >> i) & 1);
- }
- }
- else {
- _mesa_set_enable(ctx, GL_BLEND, (enable->Blend & 1));
- }
- }
-
- for (i=0;i<MAX_CLIP_PLANES;i++) {
- const GLuint mask = 1 << i;
- if ((ctx->Transform.ClipPlanesEnabled & mask) != (enable->ClipPlanes & mask))
- _mesa_set_enable(ctx, (GLenum) (GL_CLIP_PLANE0 + i),
- (GLboolean) ((enable->ClipPlanes & mask) ? GL_TRUE : GL_FALSE));
- }
-
- TEST_AND_UPDATE(ctx->Light.ColorMaterialEnabled, enable->ColorMaterial,
- GL_COLOR_MATERIAL);
- TEST_AND_UPDATE(ctx->Polygon.CullFlag, enable->CullFace, GL_CULL_FACE);
- TEST_AND_UPDATE(ctx->Transform.DepthClamp, enable->DepthClamp,
- GL_DEPTH_CLAMP);
- TEST_AND_UPDATE(ctx->Depth.Test, enable->DepthTest, GL_DEPTH_TEST);
- TEST_AND_UPDATE(ctx->Color.DitherFlag, enable->Dither, GL_DITHER);
- TEST_AND_UPDATE(ctx->Fog.Enabled, enable->Fog, GL_FOG);
- TEST_AND_UPDATE(ctx->Light.Enabled, enable->Lighting, GL_LIGHTING);
- TEST_AND_UPDATE(ctx->Line.SmoothFlag, enable->LineSmooth, GL_LINE_SMOOTH);
- TEST_AND_UPDATE(ctx->Line.StippleFlag, enable->LineStipple,
- GL_LINE_STIPPLE);
- TEST_AND_UPDATE(ctx->Color.IndexLogicOpEnabled, enable->IndexLogicOp,
- GL_INDEX_LOGIC_OP);
- TEST_AND_UPDATE(ctx->Color.ColorLogicOpEnabled, enable->ColorLogicOp,
- GL_COLOR_LOGIC_OP);
-
- TEST_AND_UPDATE(ctx->Eval.Map1Color4, enable->Map1Color4, GL_MAP1_COLOR_4);
- TEST_AND_UPDATE(ctx->Eval.Map1Index, enable->Map1Index, GL_MAP1_INDEX);
- TEST_AND_UPDATE(ctx->Eval.Map1Normal, enable->Map1Normal, GL_MAP1_NORMAL);
- TEST_AND_UPDATE(ctx->Eval.Map1TextureCoord1, enable->Map1TextureCoord1,
- GL_MAP1_TEXTURE_COORD_1);
- TEST_AND_UPDATE(ctx->Eval.Map1TextureCoord2, enable->Map1TextureCoord2,
- GL_MAP1_TEXTURE_COORD_2);
- TEST_AND_UPDATE(ctx->Eval.Map1TextureCoord3, enable->Map1TextureCoord3,
- GL_MAP1_TEXTURE_COORD_3);
- TEST_AND_UPDATE(ctx->Eval.Map1TextureCoord4, enable->Map1TextureCoord4,
- GL_MAP1_TEXTURE_COORD_4);
- TEST_AND_UPDATE(ctx->Eval.Map1Vertex3, enable->Map1Vertex3,
- GL_MAP1_VERTEX_3);
- TEST_AND_UPDATE(ctx->Eval.Map1Vertex4, enable->Map1Vertex4,
- GL_MAP1_VERTEX_4);
- for (i = 0; i < 16; i++) {
- TEST_AND_UPDATE(ctx->Eval.Map1Attrib[i], enable->Map1Attrib[i],
- GL_MAP1_VERTEX_ATTRIB0_4_NV + i);
- }
-
- TEST_AND_UPDATE(ctx->Eval.Map2Color4, enable->Map2Color4, GL_MAP2_COLOR_4);
- TEST_AND_UPDATE(ctx->Eval.Map2Index, enable->Map2Index, GL_MAP2_INDEX);
- TEST_AND_UPDATE(ctx->Eval.Map2Normal, enable->Map2Normal, GL_MAP2_NORMAL);
- TEST_AND_UPDATE(ctx->Eval.Map2TextureCoord1, enable->Map2TextureCoord1,
- GL_MAP2_TEXTURE_COORD_1);
- TEST_AND_UPDATE(ctx->Eval.Map2TextureCoord2, enable->Map2TextureCoord2,
- GL_MAP2_TEXTURE_COORD_2);
- TEST_AND_UPDATE(ctx->Eval.Map2TextureCoord3, enable->Map2TextureCoord3,
- GL_MAP2_TEXTURE_COORD_3);
- TEST_AND_UPDATE(ctx->Eval.Map2TextureCoord4, enable->Map2TextureCoord4,
- GL_MAP2_TEXTURE_COORD_4);
- TEST_AND_UPDATE(ctx->Eval.Map2Vertex3, enable->Map2Vertex3,
- GL_MAP2_VERTEX_3);
- TEST_AND_UPDATE(ctx->Eval.Map2Vertex4, enable->Map2Vertex4,
- GL_MAP2_VERTEX_4);
- for (i = 0; i < 16; i++) {
- TEST_AND_UPDATE(ctx->Eval.Map2Attrib[i], enable->Map2Attrib[i],
- GL_MAP2_VERTEX_ATTRIB0_4_NV + i);
- }
-
- TEST_AND_UPDATE(ctx->Eval.AutoNormal, enable->AutoNormal, GL_AUTO_NORMAL);
- TEST_AND_UPDATE(ctx->Transform.Normalize, enable->Normalize, GL_NORMALIZE);
- TEST_AND_UPDATE(ctx->Transform.RescaleNormals, enable->RescaleNormals,
- GL_RESCALE_NORMAL_EXT);
- TEST_AND_UPDATE(ctx->Transform.RasterPositionUnclipped,
- enable->RasterPositionUnclipped,
- GL_RASTER_POSITION_UNCLIPPED_IBM);
- TEST_AND_UPDATE(ctx->Point.SmoothFlag, enable->PointSmooth,
- GL_POINT_SMOOTH);
- if (ctx->Extensions.NV_point_sprite || ctx->Extensions.ARB_point_sprite) {
- TEST_AND_UPDATE(ctx->Point.PointSprite, enable->PointSprite,
- GL_POINT_SPRITE_NV);
- }
- TEST_AND_UPDATE(ctx->Polygon.OffsetPoint, enable->PolygonOffsetPoint,
- GL_POLYGON_OFFSET_POINT);
- TEST_AND_UPDATE(ctx->Polygon.OffsetLine, enable->PolygonOffsetLine,
- GL_POLYGON_OFFSET_LINE);
- TEST_AND_UPDATE(ctx->Polygon.OffsetFill, enable->PolygonOffsetFill,
- GL_POLYGON_OFFSET_FILL);
- TEST_AND_UPDATE(ctx->Polygon.SmoothFlag, enable->PolygonSmooth,
- GL_POLYGON_SMOOTH);
- TEST_AND_UPDATE(ctx->Polygon.StippleFlag, enable->PolygonStipple,
- GL_POLYGON_STIPPLE);
- TEST_AND_UPDATE(ctx->Scissor.Enabled, enable->Scissor, GL_SCISSOR_TEST);
- TEST_AND_UPDATE(ctx->Stencil.Enabled, enable->Stencil, GL_STENCIL_TEST);
- if (ctx->Extensions.EXT_stencil_two_side) {
- TEST_AND_UPDATE(ctx->Stencil.TestTwoSide, enable->StencilTwoSide, GL_STENCIL_TEST_TWO_SIDE_EXT);
- }
- TEST_AND_UPDATE(ctx->Multisample.Enabled, enable->MultisampleEnabled,
- GL_MULTISAMPLE_ARB);
- TEST_AND_UPDATE(ctx->Multisample.SampleAlphaToCoverage,
- enable->SampleAlphaToCoverage,
- GL_SAMPLE_ALPHA_TO_COVERAGE_ARB);
- TEST_AND_UPDATE(ctx->Multisample.SampleAlphaToOne,
- enable->SampleAlphaToOne,
- GL_SAMPLE_ALPHA_TO_ONE_ARB);
- TEST_AND_UPDATE(ctx->Multisample.SampleCoverage,
- enable->SampleCoverage,
- GL_SAMPLE_COVERAGE_ARB);
- TEST_AND_UPDATE(ctx->Multisample.SampleCoverageInvert,
- enable->SampleCoverageInvert,
- GL_SAMPLE_COVERAGE_INVERT_ARB);
- /* GL_ARB_vertex_program, GL_NV_vertex_program */
- TEST_AND_UPDATE(ctx->VertexProgram.Enabled,
- enable->VertexProgram,
- GL_VERTEX_PROGRAM_ARB);
- TEST_AND_UPDATE(ctx->VertexProgram.PointSizeEnabled,
- enable->VertexProgramPointSize,
- GL_VERTEX_PROGRAM_POINT_SIZE_ARB);
- TEST_AND_UPDATE(ctx->VertexProgram.TwoSideEnabled,
- enable->VertexProgramTwoSide,
- GL_VERTEX_PROGRAM_TWO_SIDE_ARB);
-
-#undef TEST_AND_UPDATE
-
- /* texture unit enables */
- for (i = 0; i < ctx->Const.MaxTextureUnits; i++) {
- const GLbitfield enabled = enable->Texture[i];
- const GLbitfield genEnabled = enable->TexGen[i];
-
- if (ctx->Texture.Unit[i].Enabled != enabled) {
- _mesa_ActiveTextureARB(GL_TEXTURE0 + i);
-
- _mesa_set_enable(ctx, GL_TEXTURE_1D,
- (enabled & TEXTURE_1D_BIT) ? GL_TRUE : GL_FALSE);
- _mesa_set_enable(ctx, GL_TEXTURE_2D,
- (enabled & TEXTURE_2D_BIT) ? GL_TRUE : GL_FALSE);
- _mesa_set_enable(ctx, GL_TEXTURE_3D,
- (enabled & TEXTURE_3D_BIT) ? GL_TRUE : GL_FALSE);
- if (ctx->Extensions.NV_texture_rectangle) {
- _mesa_set_enable(ctx, GL_TEXTURE_RECTANGLE_ARB,
- (enabled & TEXTURE_RECT_BIT) ? GL_TRUE : GL_FALSE);
- }
- if (ctx->Extensions.ARB_texture_cube_map) {
- _mesa_set_enable(ctx, GL_TEXTURE_CUBE_MAP,
- (enabled & TEXTURE_CUBE_BIT) ? GL_TRUE : GL_FALSE);
- }
- if (ctx->Extensions.MESA_texture_array) {
- _mesa_set_enable(ctx, GL_TEXTURE_1D_ARRAY_EXT,
- (enabled & TEXTURE_1D_ARRAY_BIT) ? GL_TRUE : GL_FALSE);
- _mesa_set_enable(ctx, GL_TEXTURE_2D_ARRAY_EXT,
- (enabled & TEXTURE_2D_ARRAY_BIT) ? GL_TRUE : GL_FALSE);
- }
- }
-
- if (ctx->Texture.Unit[i].TexGenEnabled != genEnabled) {
- _mesa_ActiveTextureARB(GL_TEXTURE0 + i);
- _mesa_set_enable(ctx, GL_TEXTURE_GEN_S,
- (genEnabled & S_BIT) ? GL_TRUE : GL_FALSE);
- _mesa_set_enable(ctx, GL_TEXTURE_GEN_T,
- (genEnabled & T_BIT) ? GL_TRUE : GL_FALSE);
- _mesa_set_enable(ctx, GL_TEXTURE_GEN_R,
- (genEnabled & R_BIT) ? GL_TRUE : GL_FALSE);
- _mesa_set_enable(ctx, GL_TEXTURE_GEN_Q,
- (genEnabled & Q_BIT) ? GL_TRUE : GL_FALSE);
- }
- }
-
- _mesa_ActiveTextureARB(GL_TEXTURE0 + curTexUnitSave);
-}
-
-
-/**
- * Pop/restore texture attribute/group state.
- */
-static void
-pop_texture_group(struct gl_context *ctx, struct texture_state *texstate)
-{
- GLuint u;
-
- _mesa_lock_context_textures(ctx);
-
- for (u = 0; u < ctx->Const.MaxTextureUnits; u++) {
- const struct gl_texture_unit *unit = &texstate->Texture.Unit[u];
- GLuint tgt;
-
- _mesa_ActiveTextureARB(GL_TEXTURE0_ARB + u);
- _mesa_set_enable(ctx, GL_TEXTURE_1D,
- (unit->Enabled & TEXTURE_1D_BIT) ? GL_TRUE : GL_FALSE);
- _mesa_set_enable(ctx, GL_TEXTURE_2D,
- (unit->Enabled & TEXTURE_2D_BIT) ? GL_TRUE : GL_FALSE);
- _mesa_set_enable(ctx, GL_TEXTURE_3D,
- (unit->Enabled & TEXTURE_3D_BIT) ? GL_TRUE : GL_FALSE);
- if (ctx->Extensions.ARB_texture_cube_map) {
- _mesa_set_enable(ctx, GL_TEXTURE_CUBE_MAP_ARB,
- (unit->Enabled & TEXTURE_CUBE_BIT) ? GL_TRUE : GL_FALSE);
- }
- if (ctx->Extensions.NV_texture_rectangle) {
- _mesa_set_enable(ctx, GL_TEXTURE_RECTANGLE_NV,
- (unit->Enabled & TEXTURE_RECT_BIT) ? GL_TRUE : GL_FALSE);
- }
- if (ctx->Extensions.MESA_texture_array) {
- _mesa_set_enable(ctx, GL_TEXTURE_1D_ARRAY_EXT,
- (unit->Enabled & TEXTURE_1D_ARRAY_BIT) ? GL_TRUE : GL_FALSE);
- _mesa_set_enable(ctx, GL_TEXTURE_2D_ARRAY_EXT,
- (unit->Enabled & TEXTURE_2D_ARRAY_BIT) ? GL_TRUE : GL_FALSE);
- }
-
- _mesa_TexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, unit->EnvMode);
- _mesa_TexEnvfv(GL_TEXTURE_ENV, GL_TEXTURE_ENV_COLOR, unit->EnvColor);
- _mesa_TexGeni(GL_S, GL_TEXTURE_GEN_MODE, unit->GenS.Mode);
- _mesa_TexGeni(GL_T, GL_TEXTURE_GEN_MODE, unit->GenT.Mode);
- _mesa_TexGeni(GL_R, GL_TEXTURE_GEN_MODE, unit->GenR.Mode);
- _mesa_TexGeni(GL_Q, GL_TEXTURE_GEN_MODE, unit->GenQ.Mode);
- _mesa_TexGenfv(GL_S, GL_OBJECT_PLANE, unit->GenS.ObjectPlane);
- _mesa_TexGenfv(GL_T, GL_OBJECT_PLANE, unit->GenT.ObjectPlane);
- _mesa_TexGenfv(GL_R, GL_OBJECT_PLANE, unit->GenR.ObjectPlane);
- _mesa_TexGenfv(GL_Q, GL_OBJECT_PLANE, unit->GenQ.ObjectPlane);
- /* Eye plane done differently to avoid re-transformation */
- {
- struct gl_texture_unit *destUnit = &ctx->Texture.Unit[u];
- COPY_4FV(destUnit->GenS.EyePlane, unit->GenS.EyePlane);
- COPY_4FV(destUnit->GenT.EyePlane, unit->GenT.EyePlane);
- COPY_4FV(destUnit->GenR.EyePlane, unit->GenR.EyePlane);
- COPY_4FV(destUnit->GenQ.EyePlane, unit->GenQ.EyePlane);
- if (ctx->Driver.TexGen) {
- ctx->Driver.TexGen(ctx, GL_S, GL_EYE_PLANE, unit->GenS.EyePlane);
- ctx->Driver.TexGen(ctx, GL_T, GL_EYE_PLANE, unit->GenT.EyePlane);
- ctx->Driver.TexGen(ctx, GL_R, GL_EYE_PLANE, unit->GenR.EyePlane);
- ctx->Driver.TexGen(ctx, GL_Q, GL_EYE_PLANE, unit->GenQ.EyePlane);
- }
- }
- _mesa_set_enable(ctx, GL_TEXTURE_GEN_S,
- ((unit->TexGenEnabled & S_BIT) ? GL_TRUE : GL_FALSE));
- _mesa_set_enable(ctx, GL_TEXTURE_GEN_T,
- ((unit->TexGenEnabled & T_BIT) ? GL_TRUE : GL_FALSE));
- _mesa_set_enable(ctx, GL_TEXTURE_GEN_R,
- ((unit->TexGenEnabled & R_BIT) ? GL_TRUE : GL_FALSE));
- _mesa_set_enable(ctx, GL_TEXTURE_GEN_Q,
- ((unit->TexGenEnabled & Q_BIT) ? GL_TRUE : GL_FALSE));
- if (ctx->Extensions.EXT_texture_lod_bias) {
- _mesa_TexEnvf(GL_TEXTURE_FILTER_CONTROL_EXT,
- GL_TEXTURE_LOD_BIAS_EXT, unit->LodBias);
- }
- if (ctx->Extensions.EXT_texture_env_combine ||
- ctx->Extensions.ARB_texture_env_combine) {
- _mesa_TexEnvi(GL_TEXTURE_ENV, GL_COMBINE_RGB,
- unit->Combine.ModeRGB);
- _mesa_TexEnvi(GL_TEXTURE_ENV, GL_COMBINE_ALPHA,
- unit->Combine.ModeA);
- _mesa_TexEnvi(GL_TEXTURE_ENV, GL_SOURCE0_RGB,
- unit->Combine.SourceRGB[0]);
- _mesa_TexEnvi(GL_TEXTURE_ENV, GL_SOURCE1_RGB,
- unit->Combine.SourceRGB[1]);
- _mesa_TexEnvi(GL_TEXTURE_ENV, GL_SOURCE2_RGB,
- unit->Combine.SourceRGB[2]);
- _mesa_TexEnvi(GL_TEXTURE_ENV, GL_SOURCE0_ALPHA,
- unit->Combine.SourceA[0]);
- _mesa_TexEnvi(GL_TEXTURE_ENV, GL_SOURCE1_ALPHA,
- unit->Combine.SourceA[1]);
- _mesa_TexEnvi(GL_TEXTURE_ENV, GL_SOURCE2_ALPHA,
- unit->Combine.SourceA[2]);
- _mesa_TexEnvi(GL_TEXTURE_ENV, GL_OPERAND0_RGB,
- unit->Combine.OperandRGB[0]);
- _mesa_TexEnvi(GL_TEXTURE_ENV, GL_OPERAND1_RGB,
- unit->Combine.OperandRGB[1]);
- _mesa_TexEnvi(GL_TEXTURE_ENV, GL_OPERAND2_RGB,
- unit->Combine.OperandRGB[2]);
- _mesa_TexEnvi(GL_TEXTURE_ENV, GL_OPERAND0_ALPHA,
- unit->Combine.OperandA[0]);
- _mesa_TexEnvi(GL_TEXTURE_ENV, GL_OPERAND1_ALPHA,
- unit->Combine.OperandA[1]);
- _mesa_TexEnvi(GL_TEXTURE_ENV, GL_OPERAND2_ALPHA,
- unit->Combine.OperandA[2]);
- _mesa_TexEnvi(GL_TEXTURE_ENV, GL_RGB_SCALE,
- 1 << unit->Combine.ScaleShiftRGB);
- _mesa_TexEnvi(GL_TEXTURE_ENV, GL_ALPHA_SCALE,
- 1 << unit->Combine.ScaleShiftA);
- }
-
- /* Restore texture object state for each target */
- for (tgt = 0; tgt < NUM_TEXTURE_TARGETS; tgt++) {
- const struct gl_texture_object *obj = NULL;
- const struct gl_sampler_object *samp;
- GLenum target;
-
- obj = &texstate->SavedObj[u][tgt];
-
- /* don't restore state for unsupported targets to prevent
- * raising GL errors.
- */
- if (obj->Target == GL_TEXTURE_CUBE_MAP_ARB &&
- !ctx->Extensions.ARB_texture_cube_map) {
- continue;
- }
- else if (obj->Target == GL_TEXTURE_RECTANGLE_NV &&
- !ctx->Extensions.NV_texture_rectangle) {
- continue;
- }
- else if ((obj->Target == GL_TEXTURE_1D_ARRAY_EXT ||
- obj->Target == GL_TEXTURE_2D_ARRAY_EXT) &&
- !ctx->Extensions.MESA_texture_array) {
- continue;
- }
- else if (obj->Target == GL_TEXTURE_BUFFER)
- continue;
-
- target = obj->Target;
-
- _mesa_BindTexture(target, obj->Name);
-
- samp = &obj->Sampler;
-
- _mesa_TexParameterfv(target, GL_TEXTURE_BORDER_COLOR, samp->BorderColor.f);
- _mesa_TexParameteri(target, GL_TEXTURE_WRAP_S, samp->WrapS);
- _mesa_TexParameteri(target, GL_TEXTURE_WRAP_T, samp->WrapT);
- _mesa_TexParameteri(target, GL_TEXTURE_WRAP_R, samp->WrapR);
- _mesa_TexParameteri(target, GL_TEXTURE_MIN_FILTER, samp->MinFilter);
- _mesa_TexParameteri(target, GL_TEXTURE_MAG_FILTER, samp->MagFilter);
- _mesa_TexParameterf(target, GL_TEXTURE_MIN_LOD, samp->MinLod);
- _mesa_TexParameterf(target, GL_TEXTURE_MAX_LOD, samp->MaxLod);
- _mesa_TexParameterf(target, GL_TEXTURE_LOD_BIAS, samp->LodBias);
- _mesa_TexParameterf(target, GL_TEXTURE_PRIORITY, obj->Priority);
- _mesa_TexParameteri(target, GL_TEXTURE_BASE_LEVEL, obj->BaseLevel);
- if (target != GL_TEXTURE_RECTANGLE_ARB)
- _mesa_TexParameteri(target, GL_TEXTURE_MAX_LEVEL, obj->MaxLevel);
- if (ctx->Extensions.EXT_texture_filter_anisotropic) {
- _mesa_TexParameterf(target, GL_TEXTURE_MAX_ANISOTROPY_EXT,
- samp->MaxAnisotropy);
- }
- if (ctx->Extensions.ARB_shadow_ambient) {
- _mesa_TexParameterf(target, GL_TEXTURE_COMPARE_FAIL_VALUE_ARB,
- samp->CompareFailValue);
- }
- }
-
- /* remove saved references to the texture objects */
- for (tgt = 0; tgt < NUM_TEXTURE_TARGETS; tgt++) {
- _mesa_reference_texobj(&texstate->SavedTexRef[u][tgt], NULL);
- }
- }
-
- _mesa_ActiveTextureARB(GL_TEXTURE0_ARB + texstate->Texture.CurrentUnit);
-
- _mesa_unlock_context_textures(ctx);
-}
-
-
-/*
- * This function is kind of long just because we have to call a lot
- * of device driver functions to update device driver state.
- *
- * XXX As it is now, most of the pop-code calls immediate-mode Mesa functions
- * in order to restore GL state. This isn't terribly efficient but it
- * ensures that dirty flags and any derived state gets updated correctly.
- * We could at least check if the value to restore equals the current value
- * and then skip the Mesa call.
- */
-void GLAPIENTRY
-_mesa_PopAttrib(void)
-{
- struct gl_attrib_node *attr, *next;
- GET_CURRENT_CONTEXT(ctx);
- ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
-
- if (ctx->AttribStackDepth == 0) {
- _mesa_error( ctx, GL_STACK_UNDERFLOW, "glPopAttrib" );
- return;
- }
-
- ctx->AttribStackDepth--;
- attr = ctx->AttribStack[ctx->AttribStackDepth];
-
- while (attr) {
-
- if (MESA_VERBOSE & VERBOSE_API) {
- _mesa_debug(ctx, "glPopAttrib %s\n",
- _mesa_lookup_enum_by_nr(attr->kind));
- }
-
- switch (attr->kind) {
- case GL_ACCUM_BUFFER_BIT:
- {
- const struct gl_accum_attrib *accum;
- accum = (const struct gl_accum_attrib *) attr->data;
- _mesa_ClearAccum(accum->ClearColor[0],
- accum->ClearColor[1],
- accum->ClearColor[2],
- accum->ClearColor[3]);
- }
- break;
- case GL_COLOR_BUFFER_BIT:
- {
- const struct gl_colorbuffer_attrib *color;
-
- color = (const struct gl_colorbuffer_attrib *) attr->data;
- _mesa_ClearIndex((GLfloat) color->ClearIndex);
- _mesa_ClearColor(color->ClearColorUnclamped[0],
- color->ClearColorUnclamped[1],
- color->ClearColorUnclamped[2],
- color->ClearColorUnclamped[3]);
- _mesa_IndexMask(color->IndexMask);
- if (!ctx->Extensions.EXT_draw_buffers2) {
- _mesa_ColorMask((GLboolean) (color->ColorMask[0][0] != 0),
- (GLboolean) (color->ColorMask[0][1] != 0),
- (GLboolean) (color->ColorMask[0][2] != 0),
- (GLboolean) (color->ColorMask[0][3] != 0));
- }
- else {
- GLuint i;
- for (i = 0; i < ctx->Const.MaxDrawBuffers; i++) {
- _mesa_ColorMaskIndexed(i,
- (GLboolean) (color->ColorMask[i][0] != 0),
- (GLboolean) (color->ColorMask[i][1] != 0),
- (GLboolean) (color->ColorMask[i][2] != 0),
- (GLboolean) (color->ColorMask[i][3] != 0));
- }
- }
- {
- /* Need to determine if more than one color output is
- * specified. If so, call glDrawBuffersARB, else call
- * glDrawBuffer(). This is a subtle, but essential point
- * since GL_FRONT (for example) is illegal for the former
- * function, but legal for the later.
- */
- GLboolean multipleBuffers = GL_FALSE;
- GLuint i;
-
- for (i = 1; i < ctx->Const.MaxDrawBuffers; i++) {
- if (color->DrawBuffer[i] != GL_NONE) {
- multipleBuffers = GL_TRUE;
- break;
- }
- }
- /* Call the API_level functions, not _mesa_drawbuffers()
- * since we need to do error checking on the pop'd
- * GL_DRAW_BUFFER.
- * Ex: if GL_FRONT were pushed, but we're popping with a
- * user FBO bound, GL_FRONT will be illegal and we'll need
- * to record that error. Per OpenGL ARB decision.
- */
- if (multipleBuffers)
- _mesa_DrawBuffersARB(ctx->Const.MaxDrawBuffers,
- color->DrawBuffer);
- else
- _mesa_DrawBuffer(color->DrawBuffer[0]);
- }
- _mesa_set_enable(ctx, GL_ALPHA_TEST, color->AlphaEnabled);
- _mesa_AlphaFunc(color->AlphaFunc, color->AlphaRefUnclamped);
- if (ctx->Color.BlendEnabled != color->BlendEnabled) {
- if (ctx->Extensions.EXT_draw_buffers2) {
- GLuint i;
- for (i = 0; i < ctx->Const.MaxDrawBuffers; i++) {
- _mesa_set_enablei(ctx, GL_BLEND, i,
- (color->BlendEnabled >> i) & 1);
- }
- }
- else {
- _mesa_set_enable(ctx, GL_BLEND, (color->BlendEnabled & 1));
- }
- }
- if (ctx->Color._BlendFuncPerBuffer ||
- ctx->Color._BlendEquationPerBuffer) {
- /* set blend per buffer */
- GLuint buf;
- for (buf = 0; buf < ctx->Const.MaxDrawBuffers; buf++) {
- _mesa_BlendFuncSeparatei(buf, color->Blend[buf].SrcRGB,
- color->Blend[buf].DstRGB,
- color->Blend[buf].SrcA,
- color->Blend[buf].DstA);
- _mesa_BlendEquationSeparatei(buf,
- color->Blend[buf].EquationRGB,
- color->Blend[buf].EquationA);
- }
- }
- else {
- /* set same blend modes for all buffers */
- _mesa_BlendFuncSeparateEXT(color->Blend[0].SrcRGB,
- color->Blend[0].DstRGB,
- color->Blend[0].SrcA,
- color->Blend[0].DstA);
- /* This special case is because glBlendEquationSeparateEXT
- * cannot take GL_LOGIC_OP as a parameter.
- */
- if (color->Blend[0].EquationRGB ==
- color->Blend[0].EquationA) {
- _mesa_BlendEquation(color->Blend[0].EquationRGB);
- }
- else {
- _mesa_BlendEquationSeparateEXT(
- color->Blend[0].EquationRGB,
- color->Blend[0].EquationA);
- }
- }
- _mesa_BlendColor(color->BlendColorUnclamped[0],
- color->BlendColorUnclamped[1],
- color->BlendColorUnclamped[2],
- color->BlendColorUnclamped[3]);
- _mesa_LogicOp(color->LogicOp);
- _mesa_set_enable(ctx, GL_COLOR_LOGIC_OP,
- color->ColorLogicOpEnabled);
- _mesa_set_enable(ctx, GL_INDEX_LOGIC_OP,
- color->IndexLogicOpEnabled);
- _mesa_set_enable(ctx, GL_DITHER, color->DitherFlag);
- _mesa_ClampColorARB(GL_CLAMP_FRAGMENT_COLOR_ARB, color->ClampFragmentColor);
- _mesa_ClampColorARB(GL_CLAMP_READ_COLOR_ARB, color->ClampReadColor);
- }
- break;
- case GL_CURRENT_BIT:
- FLUSH_CURRENT( ctx, 0 );
- memcpy( &ctx->Current, attr->data,
- sizeof(struct gl_current_attrib) );
- break;
- case GL_DEPTH_BUFFER_BIT:
- {
- const struct gl_depthbuffer_attrib *depth;
- depth = (const struct gl_depthbuffer_attrib *) attr->data;
- _mesa_DepthFunc(depth->Func);
- _mesa_ClearDepth(depth->Clear);
- _mesa_set_enable(ctx, GL_DEPTH_TEST, depth->Test);
- _mesa_DepthMask(depth->Mask);
- }
- break;
- case GL_ENABLE_BIT:
- {
- const struct gl_enable_attrib *enable;
- enable = (const struct gl_enable_attrib *) attr->data;
- pop_enable_group(ctx, enable);
- ctx->NewState |= _NEW_ALL;
- }
- break;
- case GL_EVAL_BIT:
- memcpy( &ctx->Eval, attr->data, sizeof(struct gl_eval_attrib) );
- ctx->NewState |= _NEW_EVAL;
- break;
- case GL_FOG_BIT:
- {
- const struct gl_fog_attrib *fog;
- fog = (const struct gl_fog_attrib *) attr->data;
- _mesa_set_enable(ctx, GL_FOG, fog->Enabled);
- _mesa_Fogfv(GL_FOG_COLOR, fog->Color);
- _mesa_Fogf(GL_FOG_DENSITY, fog->Density);
- _mesa_Fogf(GL_FOG_START, fog->Start);
- _mesa_Fogf(GL_FOG_END, fog->End);
- _mesa_Fogf(GL_FOG_INDEX, fog->Index);
- _mesa_Fogi(GL_FOG_MODE, fog->Mode);
- }
- break;
- case GL_HINT_BIT:
- {
- const struct gl_hint_attrib *hint;
- hint = (const struct gl_hint_attrib *) attr->data;
- _mesa_Hint(GL_PERSPECTIVE_CORRECTION_HINT,
- hint->PerspectiveCorrection );
- _mesa_Hint(GL_POINT_SMOOTH_HINT, hint->PointSmooth);
- _mesa_Hint(GL_LINE_SMOOTH_HINT, hint->LineSmooth);
- _mesa_Hint(GL_POLYGON_SMOOTH_HINT, hint->PolygonSmooth);
- _mesa_Hint(GL_FOG_HINT, hint->Fog);
- _mesa_Hint(GL_CLIP_VOLUME_CLIPPING_HINT_EXT,
- hint->ClipVolumeClipping);
- _mesa_Hint(GL_TEXTURE_COMPRESSION_HINT_ARB,
- hint->TextureCompression);
- }
- break;
- case GL_LIGHTING_BIT:
- {
- GLuint i;
- const struct gl_light_attrib *light;
- light = (const struct gl_light_attrib *) attr->data;
- /* lighting enable */
- _mesa_set_enable(ctx, GL_LIGHTING, light->Enabled);
- /* per-light state */
- if (_math_matrix_is_dirty(ctx->ModelviewMatrixStack.Top))
- _math_matrix_analyse( ctx->ModelviewMatrixStack.Top );
-
- for (i = 0; i < ctx->Const.MaxLights; i++) {
- const struct gl_light *l = &light->Light[i];
- _mesa_set_enable(ctx, GL_LIGHT0 + i, l->Enabled);
- _mesa_light(ctx, i, GL_AMBIENT, l->Ambient);
- _mesa_light(ctx, i, GL_DIFFUSE, l->Diffuse);
- _mesa_light(ctx, i, GL_SPECULAR, l->Specular );
- _mesa_light(ctx, i, GL_POSITION, l->EyePosition);
- _mesa_light(ctx, i, GL_SPOT_DIRECTION, l->SpotDirection);
- {
- GLfloat p[4] = { 0 };
- p[0] = l->SpotExponent;
- _mesa_light(ctx, i, GL_SPOT_EXPONENT, p);
- }
- {
- GLfloat p[4] = { 0 };
- p[0] = l->SpotCutoff;
- _mesa_light(ctx, i, GL_SPOT_CUTOFF, p);
- }
- {
- GLfloat p[4] = { 0 };
- p[0] = l->ConstantAttenuation;
- _mesa_light(ctx, i, GL_CONSTANT_ATTENUATION, p);
- }
- {
- GLfloat p[4] = { 0 };
- p[0] = l->LinearAttenuation;
- _mesa_light(ctx, i, GL_LINEAR_ATTENUATION, p);
- }
- {
- GLfloat p[4] = { 0 };
- p[0] = l->QuadraticAttenuation;
- _mesa_light(ctx, i, GL_QUADRATIC_ATTENUATION, p);
- }
- }
- /* light model */
- _mesa_LightModelfv(GL_LIGHT_MODEL_AMBIENT,
- light->Model.Ambient);
- _mesa_LightModelf(GL_LIGHT_MODEL_LOCAL_VIEWER,
- (GLfloat) light->Model.LocalViewer);
- _mesa_LightModelf(GL_LIGHT_MODEL_TWO_SIDE,
- (GLfloat) light->Model.TwoSide);
- _mesa_LightModelf(GL_LIGHT_MODEL_COLOR_CONTROL,
- (GLfloat) light->Model.ColorControl);
- /* shade model */
- _mesa_ShadeModel(light->ShadeModel);
- /* color material */
- _mesa_ColorMaterial(light->ColorMaterialFace,
- light->ColorMaterialMode);
- _mesa_set_enable(ctx, GL_COLOR_MATERIAL,
- light->ColorMaterialEnabled);
- /* materials */
- memcpy(&ctx->Light.Material, &light->Material,
- sizeof(struct gl_material));
- _mesa_ClampColorARB(GL_CLAMP_VERTEX_COLOR_ARB, light->ClampVertexColor);
- }
- break;
- case GL_LINE_BIT:
- {
- const struct gl_line_attrib *line;
- line = (const struct gl_line_attrib *) attr->data;
- _mesa_set_enable(ctx, GL_LINE_SMOOTH, line->SmoothFlag);
- _mesa_set_enable(ctx, GL_LINE_STIPPLE, line->StippleFlag);
- _mesa_LineStipple(line->StippleFactor, line->StipplePattern);
- _mesa_LineWidth(line->Width);
- }
- break;
- case GL_LIST_BIT:
- memcpy( &ctx->List, attr->data, sizeof(struct gl_list_attrib) );
- break;
- case GL_PIXEL_MODE_BIT:
- memcpy( &ctx->Pixel, attr->data, sizeof(struct gl_pixel_attrib) );
- /* XXX what other pixel state needs to be set by function calls? */
- _mesa_ReadBuffer(ctx->Pixel.ReadBuffer);
- ctx->NewState |= _NEW_PIXEL;
- break;
- case GL_POINT_BIT:
- {
- const struct gl_point_attrib *point;
- point = (const struct gl_point_attrib *) attr->data;
- _mesa_PointSize(point->Size);
- _mesa_set_enable(ctx, GL_POINT_SMOOTH, point->SmoothFlag);
- if (ctx->Extensions.EXT_point_parameters) {
- _mesa_PointParameterfv(GL_DISTANCE_ATTENUATION_EXT,
- point->Params);
- _mesa_PointParameterf(GL_POINT_SIZE_MIN_EXT,
- point->MinSize);
- _mesa_PointParameterf(GL_POINT_SIZE_MAX_EXT,
- point->MaxSize);
- _mesa_PointParameterf(GL_POINT_FADE_THRESHOLD_SIZE_EXT,
- point->Threshold);
- }
- if (ctx->Extensions.NV_point_sprite
- || ctx->Extensions.ARB_point_sprite) {
- GLuint u;
- for (u = 0; u < ctx->Const.MaxTextureUnits; u++) {
- _mesa_TexEnvi(GL_POINT_SPRITE_NV, GL_COORD_REPLACE_NV,
- (GLint) point->CoordReplace[u]);
- }
- _mesa_set_enable(ctx, GL_POINT_SPRITE_NV,point->PointSprite);
- if (ctx->Extensions.NV_point_sprite)
- _mesa_PointParameteri(GL_POINT_SPRITE_R_MODE_NV,
- ctx->Point.SpriteRMode);
- _mesa_PointParameterf(GL_POINT_SPRITE_COORD_ORIGIN,
- (GLfloat)ctx->Point.SpriteOrigin);
- }
- }
- break;
- case GL_POLYGON_BIT:
- {
- const struct gl_polygon_attrib *polygon;
- polygon = (const struct gl_polygon_attrib *) attr->data;
- _mesa_CullFace(polygon->CullFaceMode);
- _mesa_FrontFace(polygon->FrontFace);
- _mesa_PolygonMode(GL_FRONT, polygon->FrontMode);
- _mesa_PolygonMode(GL_BACK, polygon->BackMode);
- _mesa_PolygonOffset(polygon->OffsetFactor,
- polygon->OffsetUnits);
- _mesa_set_enable(ctx, GL_POLYGON_SMOOTH, polygon->SmoothFlag);
- _mesa_set_enable(ctx, GL_POLYGON_STIPPLE, polygon->StippleFlag);
- _mesa_set_enable(ctx, GL_CULL_FACE, polygon->CullFlag);
- _mesa_set_enable(ctx, GL_POLYGON_OFFSET_POINT,
- polygon->OffsetPoint);
- _mesa_set_enable(ctx, GL_POLYGON_OFFSET_LINE,
- polygon->OffsetLine);
- _mesa_set_enable(ctx, GL_POLYGON_OFFSET_FILL,
- polygon->OffsetFill);
- }
- break;
- case GL_POLYGON_STIPPLE_BIT:
- memcpy( ctx->PolygonStipple, attr->data, 32*sizeof(GLuint) );
- ctx->NewState |= _NEW_POLYGONSTIPPLE;
- if (ctx->Driver.PolygonStipple)
- ctx->Driver.PolygonStipple( ctx, (const GLubyte *) attr->data );
- break;
- case GL_SCISSOR_BIT:
- {
- const struct gl_scissor_attrib *scissor;
- scissor = (const struct gl_scissor_attrib *) attr->data;
- _mesa_Scissor(scissor->X, scissor->Y,
- scissor->Width, scissor->Height);
- _mesa_set_enable(ctx, GL_SCISSOR_TEST, scissor->Enabled);
- }
- break;
- case GL_STENCIL_BUFFER_BIT:
- {
- const struct gl_stencil_attrib *stencil;
- stencil = (const struct gl_stencil_attrib *) attr->data;
- _mesa_set_enable(ctx, GL_STENCIL_TEST, stencil->Enabled);
- _mesa_ClearStencil(stencil->Clear);
- if (ctx->Extensions.EXT_stencil_two_side) {
- _mesa_set_enable(ctx, GL_STENCIL_TEST_TWO_SIDE_EXT,
- stencil->TestTwoSide);
- _mesa_ActiveStencilFaceEXT(stencil->ActiveFace
- ? GL_BACK : GL_FRONT);
- }
- /* front state */
- _mesa_StencilFuncSeparate(GL_FRONT,
- stencil->Function[0],
- stencil->Ref[0],
- stencil->ValueMask[0]);
- _mesa_StencilMaskSeparate(GL_FRONT, stencil->WriteMask[0]);
- _mesa_StencilOpSeparate(GL_FRONT, stencil->FailFunc[0],
- stencil->ZFailFunc[0],
- stencil->ZPassFunc[0]);
- /* back state */
- _mesa_StencilFuncSeparate(GL_BACK,
- stencil->Function[1],
- stencil->Ref[1],
- stencil->ValueMask[1]);
- _mesa_StencilMaskSeparate(GL_BACK, stencil->WriteMask[1]);
- _mesa_StencilOpSeparate(GL_BACK, stencil->FailFunc[1],
- stencil->ZFailFunc[1],
- stencil->ZPassFunc[1]);
- }
- break;
- case GL_TRANSFORM_BIT:
- {
- GLuint i;
- const struct gl_transform_attrib *xform;
- xform = (const struct gl_transform_attrib *) attr->data;
- _mesa_MatrixMode(xform->MatrixMode);
- if (_math_matrix_is_dirty(ctx->ProjectionMatrixStack.Top))
- _math_matrix_analyse( ctx->ProjectionMatrixStack.Top );
-
- /* restore clip planes */
- for (i = 0; i < MAX_CLIP_PLANES; i++) {
- const GLuint mask = 1 << i;
- const GLfloat *eyePlane = xform->EyeUserPlane[i];
- COPY_4V(ctx->Transform.EyeUserPlane[i], eyePlane);
- if (xform->ClipPlanesEnabled & mask) {
- _mesa_set_enable(ctx, GL_CLIP_PLANE0 + i, GL_TRUE);
- }
- else {
- _mesa_set_enable(ctx, GL_CLIP_PLANE0 + i, GL_FALSE);
- }
- if (ctx->Driver.ClipPlane)
- ctx->Driver.ClipPlane( ctx, GL_CLIP_PLANE0 + i, eyePlane );
- }
-
- /* normalize/rescale */
- if (xform->Normalize != ctx->Transform.Normalize)
- _mesa_set_enable(ctx, GL_NORMALIZE,ctx->Transform.Normalize);
- if (xform->RescaleNormals != ctx->Transform.RescaleNormals)
- _mesa_set_enable(ctx, GL_RESCALE_NORMAL_EXT,
- ctx->Transform.RescaleNormals);
- if (xform->DepthClamp != ctx->Transform.DepthClamp)
- _mesa_set_enable(ctx, GL_DEPTH_CLAMP,
- ctx->Transform.DepthClamp);
- }
- break;
- case GL_TEXTURE_BIT:
- /* Take care of texture object reference counters */
- {
- struct texture_state *texstate
- = (struct texture_state *) attr->data;
- pop_texture_group(ctx, texstate);
- ctx->NewState |= _NEW_TEXTURE;
- }
- break;
- case GL_VIEWPORT_BIT:
- {
- const struct gl_viewport_attrib *vp;
- vp = (const struct gl_viewport_attrib *) attr->data;
- _mesa_Viewport(vp->X, vp->Y, vp->Width, vp->Height);
- _mesa_DepthRange(vp->Near, vp->Far);
- }
- break;
- case GL_MULTISAMPLE_BIT_ARB:
- {
- const struct gl_multisample_attrib *ms;
- ms = (const struct gl_multisample_attrib *) attr->data;
- _mesa_SampleCoverageARB(ms->SampleCoverageValue,
- ms->SampleCoverageInvert);
- }
- break;
-
- default:
- _mesa_problem( ctx, "Bad attrib flag in PopAttrib");
- break;
- }
-
- next = attr->next;
- FREE( attr->data );
- FREE( attr );
- attr = next;
- }
-}
-
-
-/**
- * Helper for incrementing/decrementing vertex buffer object reference
- * counts when pushing/popping the GL_CLIENT_VERTEX_ARRAY_BIT attribute group.
- */
-static void
-adjust_buffer_object_ref_counts(struct gl_array_object *arrayObj, GLint step)
-{
- GLuint i;
-
- arrayObj->Vertex.BufferObj->RefCount += step;
- arrayObj->Weight.BufferObj->RefCount += step;
- arrayObj->Normal.BufferObj->RefCount += step;
- arrayObj->Color.BufferObj->RefCount += step;
- arrayObj->SecondaryColor.BufferObj->RefCount += step;
- arrayObj->FogCoord.BufferObj->RefCount += step;
- arrayObj->Index.BufferObj->RefCount += step;
- arrayObj->EdgeFlag.BufferObj->RefCount += step;
- for (i = 0; i < Elements(arrayObj->TexCoord); i++)
- arrayObj->TexCoord[i].BufferObj->RefCount += step;
- for (i = 0; i < Elements(arrayObj->VertexAttrib); i++)
- arrayObj->VertexAttrib[i].BufferObj->RefCount += step;
-}
-
-
-/**
- * Copy gl_pixelstore_attrib from src to dst, updating buffer
- * object refcounts.
- */
-static void
-copy_pixelstore(struct gl_context *ctx,
- struct gl_pixelstore_attrib *dst,
- const struct gl_pixelstore_attrib *src)
-{
- dst->Alignment = src->Alignment;
- dst->RowLength = src->RowLength;
- dst->SkipPixels = src->SkipPixels;
- dst->SkipRows = src->SkipRows;
- dst->ImageHeight = src->ImageHeight;
- dst->SkipImages = src->SkipImages;
- dst->SwapBytes = src->SwapBytes;
- dst->LsbFirst = src->LsbFirst;
- dst->ClientStorage = src->ClientStorage;
- dst->Invert = src->Invert;
- _mesa_reference_buffer_object(ctx, &dst->BufferObj, src->BufferObj);
-}
-
-
-#define GL_CLIENT_PACK_BIT (1<<20)
-#define GL_CLIENT_UNPACK_BIT (1<<21)
-
-
-void GLAPIENTRY
-_mesa_PushClientAttrib(GLbitfield mask)
-{
- struct gl_attrib_node *head;
-
- GET_CURRENT_CONTEXT(ctx);
- ASSERT_OUTSIDE_BEGIN_END(ctx);
-
- if (ctx->ClientAttribStackDepth >= MAX_CLIENT_ATTRIB_STACK_DEPTH) {
- _mesa_error( ctx, GL_STACK_OVERFLOW, "glPushClientAttrib" );
- return;
- }
-
- /* Build linked list of attribute nodes which save all attribute
- * groups specified by the mask.
- */
- head = NULL;
-
- if (mask & GL_CLIENT_PIXEL_STORE_BIT) {
- struct gl_pixelstore_attrib *attr;
- /* packing attribs */
- attr = CALLOC_STRUCT( gl_pixelstore_attrib );
- copy_pixelstore(ctx, attr, &ctx->Pack);
- save_attrib_data(&head, GL_CLIENT_PACK_BIT, attr);
- /* unpacking attribs */
- attr = CALLOC_STRUCT( gl_pixelstore_attrib );
- copy_pixelstore(ctx, attr, &ctx->Unpack);
- save_attrib_data(&head, GL_CLIENT_UNPACK_BIT, attr);
- }
-
- if (mask & GL_CLIENT_VERTEX_ARRAY_BIT) {
- struct gl_array_attrib *attr;
- struct gl_array_object *obj;
-
- attr = MALLOC_STRUCT( gl_array_attrib );
- obj = MALLOC_STRUCT( gl_array_object );
-
-#if FEATURE_ARB_vertex_buffer_object
- /* increment ref counts since we're copying pointers to these objects */
- ctx->Array.ArrayBufferObj->RefCount++;
- ctx->Array.ElementArrayBufferObj->RefCount++;
-#endif
-
- memcpy( attr, &ctx->Array, sizeof(struct gl_array_attrib) );
- memcpy( obj, ctx->Array.ArrayObj, sizeof(struct gl_array_object) );
-
- attr->ArrayObj = obj;
-
- save_attrib_data(&head, GL_CLIENT_VERTEX_ARRAY_BIT, attr);
-
- /* bump reference counts on buffer objects */
- adjust_buffer_object_ref_counts(ctx->Array.ArrayObj, 1);
- }
-
- ctx->ClientAttribStack[ctx->ClientAttribStackDepth] = head;
- ctx->ClientAttribStackDepth++;
-}
-
-
-
-
-void GLAPIENTRY
-_mesa_PopClientAttrib(void)
-{
- struct gl_attrib_node *node, *next;
-
- GET_CURRENT_CONTEXT(ctx);
- ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
-
- if (ctx->ClientAttribStackDepth == 0) {
- _mesa_error( ctx, GL_STACK_UNDERFLOW, "glPopClientAttrib" );
- return;
- }
-
- ctx->ClientAttribStackDepth--;
- node = ctx->ClientAttribStack[ctx->ClientAttribStackDepth];
-
- while (node) {
- switch (node->kind) {
- case GL_CLIENT_PACK_BIT:
- {
- struct gl_pixelstore_attrib *store =
- (struct gl_pixelstore_attrib *) node->data;
- copy_pixelstore(ctx, &ctx->Pack, store);
- _mesa_reference_buffer_object(ctx, &store->BufferObj, NULL);
- }
- ctx->NewState |= _NEW_PACKUNPACK;
- break;
- case GL_CLIENT_UNPACK_BIT:
- {
- struct gl_pixelstore_attrib *store =
- (struct gl_pixelstore_attrib *) node->data;
- copy_pixelstore(ctx, &ctx->Unpack, store);
- _mesa_reference_buffer_object(ctx, &store->BufferObj, NULL);
- }
- ctx->NewState |= _NEW_PACKUNPACK;
- break;
- case GL_CLIENT_VERTEX_ARRAY_BIT: {
- struct gl_array_attrib * data =
- (struct gl_array_attrib *) node->data;
-
- adjust_buffer_object_ref_counts(ctx->Array.ArrayObj, -1);
-
- ctx->Array.ActiveTexture = data->ActiveTexture;
- if (data->LockCount != 0)
- _mesa_LockArraysEXT(data->LockFirst, data->LockCount);
- else if (ctx->Array.LockCount)
- _mesa_UnlockArraysEXT();
-
- _mesa_BindVertexArrayAPPLE( data->ArrayObj->Name );
-
-#if FEATURE_ARB_vertex_buffer_object
- _mesa_BindBufferARB(GL_ARRAY_BUFFER_ARB,
- data->ArrayBufferObj->Name);
- _mesa_BindBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB,
- data->ElementArrayBufferObj->Name);
-#endif
-
- memcpy( ctx->Array.ArrayObj, data->ArrayObj,
- sizeof( struct gl_array_object ) );
-
- FREE( data->ArrayObj );
-
- /* FIXME: Should some bits in ctx->Array->NewState also be set
- * FIXME: here? It seems like it should be set to inclusive-or
- * FIXME: of the old ArrayObj->_Enabled and the new _Enabled.
- */
-
- ctx->NewState |= _NEW_ARRAY;
- break;
- }
- default:
- _mesa_problem( ctx, "Bad attrib flag in PopClientAttrib");
- break;
- }
-
- next = node->next;
- FREE( node->data );
- FREE( node );
- node = next;
- }
-}
-
-
-void
-_mesa_init_attrib_dispatch(struct _glapi_table *disp)
-{
- SET_PopAttrib(disp, _mesa_PopAttrib);
- SET_PushAttrib(disp, _mesa_PushAttrib);
- SET_PopClientAttrib(disp, _mesa_PopClientAttrib);
- SET_PushClientAttrib(disp, _mesa_PushClientAttrib);
-}
-
-
-#endif /* FEATURE_attrib_stack */
-
-
-/**
- * Free any attribute state data that might be attached to the context.
- */
-void
-_mesa_free_attrib_data(struct gl_context *ctx)
-{
- while (ctx->AttribStackDepth > 0) {
- struct gl_attrib_node *attr, *next;
-
- ctx->AttribStackDepth--;
- attr = ctx->AttribStack[ctx->AttribStackDepth];
-
- while (attr) {
- if (attr->kind == GL_TEXTURE_BIT) {
- struct texture_state *texstate = (struct texture_state*)attr->data;
- GLuint u, tgt;
- /* clear references to the saved texture objects */
- for (u = 0; u < ctx->Const.MaxTextureUnits; u++) {
- for (tgt = 0; tgt < NUM_TEXTURE_TARGETS; tgt++) {
- _mesa_reference_texobj(&texstate->SavedTexRef[u][tgt], NULL);
- }
- }
- }
- else {
- /* any other chunks of state that requires special handling? */
- }
-
- next = attr->next;
- free(attr->data);
- free(attr);
- attr = next;
- }
- }
-}
-
-
-void _mesa_init_attrib( struct gl_context *ctx )
-{
- /* Renderer and client attribute stacks */
- ctx->AttribStackDepth = 0;
- ctx->ClientAttribStackDepth = 0;
-}
+/*
+ * Mesa 3-D graphics library
+ * Version: 7.6
+ *
+ * Copyright (C) 1999-2008 Brian Paul All Rights Reserved.
+ * Copyright (C) 2009 VMware, Inc. All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+#include "glheader.h"
+#include "imports.h"
+#include "accum.h"
+#include "arrayobj.h"
+#include "attrib.h"
+#include "blend.h"
+#include "buffers.h"
+#include "bufferobj.h"
+#include "clear.h"
+#include "colormac.h"
+#include "context.h"
+#include "depth.h"
+#include "enable.h"
+#include "enums.h"
+#include "fog.h"
+#include "hint.h"
+#include "light.h"
+#include "lines.h"
+#include "macros.h"
+#include "matrix.h"
+#include "mfeatures.h"
+#include "multisample.h"
+#include "points.h"
+#include "polygon.h"
+#include "scissor.h"
+#include "stencil.h"
+#include "texenv.h"
+#include "texgen.h"
+#include "texobj.h"
+#include "texparam.h"
+#include "texstate.h"
+#include "varray.h"
+#include "viewport.h"
+#include "mtypes.h"
+#include "main/dispatch.h"
+
+
+/**
+ * glEnable()/glDisable() attribute group (GL_ENABLE_BIT).
+ */
+struct gl_enable_attrib
+{
+ GLboolean AlphaTest;
+ GLboolean AutoNormal;
+ GLboolean Blend;
+ GLbitfield ClipPlanes;
+ GLboolean ColorMaterial;
+ GLboolean CullFace;
+ GLboolean DepthClamp;
+ GLboolean DepthTest;
+ GLboolean Dither;
+ GLboolean Fog;
+ GLboolean Light[MAX_LIGHTS];
+ GLboolean Lighting;
+ GLboolean LineSmooth;
+ GLboolean LineStipple;
+ GLboolean IndexLogicOp;
+ GLboolean ColorLogicOp;
+
+ GLboolean Map1Color4;
+ GLboolean Map1Index;
+ GLboolean Map1Normal;
+ GLboolean Map1TextureCoord1;
+ GLboolean Map1TextureCoord2;
+ GLboolean Map1TextureCoord3;
+ GLboolean Map1TextureCoord4;
+ GLboolean Map1Vertex3;
+ GLboolean Map1Vertex4;
+ GLboolean Map1Attrib[16]; /* GL_NV_vertex_program */
+ GLboolean Map2Color4;
+ GLboolean Map2Index;
+ GLboolean Map2Normal;
+ GLboolean Map2TextureCoord1;
+ GLboolean Map2TextureCoord2;
+ GLboolean Map2TextureCoord3;
+ GLboolean Map2TextureCoord4;
+ GLboolean Map2Vertex3;
+ GLboolean Map2Vertex4;
+ GLboolean Map2Attrib[16]; /* GL_NV_vertex_program */
+
+ GLboolean Normalize;
+ GLboolean PixelTexture;
+ GLboolean PointSmooth;
+ GLboolean PolygonOffsetPoint;
+ GLboolean PolygonOffsetLine;
+ GLboolean PolygonOffsetFill;
+ GLboolean PolygonSmooth;
+ GLboolean PolygonStipple;
+ GLboolean RescaleNormals;
+ GLboolean Scissor;
+ GLboolean Stencil;
+ GLboolean StencilTwoSide; /* GL_EXT_stencil_two_side */
+ GLboolean MultisampleEnabled; /* GL_ARB_multisample */
+ GLboolean SampleAlphaToCoverage; /* GL_ARB_multisample */
+ GLboolean SampleAlphaToOne; /* GL_ARB_multisample */
+ GLboolean SampleCoverage; /* GL_ARB_multisample */
+ GLboolean SampleCoverageInvert; /* GL_ARB_multisample */
+ GLboolean RasterPositionUnclipped; /* GL_IBM_rasterpos_clip */
+
+ GLbitfield Texture[MAX_TEXTURE_UNITS];
+ GLbitfield TexGen[MAX_TEXTURE_UNITS];
+
+ /* GL_ARB_vertex_program / GL_NV_vertex_program */
+ GLboolean VertexProgram;
+ GLboolean VertexProgramPointSize;
+ GLboolean VertexProgramTwoSide;
+
+ /* GL_ARB_point_sprite / GL_NV_point_sprite */
+ GLboolean PointSprite;
+ GLboolean FragmentShaderATI;
+};
+
+
+/**
+ * Node for the attribute stack.
+ */
+struct gl_attrib_node
+{
+ GLbitfield kind;
+ void *data;
+ struct gl_attrib_node *next;
+};
+
+
+
+/**
+ * Special struct for saving/restoring texture state (GL_TEXTURE_BIT)
+ */
+struct texture_state
+{
+ struct gl_texture_attrib Texture; /**< The usual context state */
+
+ /** to save per texture object state (wrap modes, filters, etc): */
+ struct gl_texture_object SavedObj[MAX_TEXTURE_UNITS][NUM_TEXTURE_TARGETS];
+
+ /**
+ * To save references to texture objects (so they don't get accidentally
+ * deleted while saved in the attribute stack).
+ */
+ struct gl_texture_object *SavedTexRef[MAX_TEXTURE_UNITS][NUM_TEXTURE_TARGETS];
+};
+
+
+#if FEATURE_attrib_stack
+
+
+/**
+ * Allocate new attribute node of given type/kind. Attach payload data.
+ * Insert it into the linked list named by 'head'.
+ */
+static void
+save_attrib_data(struct gl_attrib_node **head,
+ GLbitfield kind, void *payload)
+{
+ struct gl_attrib_node *n = MALLOC_STRUCT(gl_attrib_node);
+ if (n) {
+ n->kind = kind;
+ n->data = payload;
+ /* insert at head */
+ n->next = *head;
+ *head = n;
+ }
+ else {
+ /* out of memory! */
+ }
+}
+
+
+void GLAPIENTRY
+_mesa_PushAttrib(GLbitfield mask)
+{
+ struct gl_attrib_node *head;
+
+ GET_CURRENT_CONTEXT(ctx);
+ ASSERT_OUTSIDE_BEGIN_END(ctx);
+
+ if (MESA_VERBOSE & VERBOSE_API)
+ _mesa_debug(ctx, "glPushAttrib %x\n", (int) mask);
+
+ if (ctx->AttribStackDepth >= MAX_ATTRIB_STACK_DEPTH) {
+ _mesa_error( ctx, GL_STACK_OVERFLOW, "glPushAttrib" );
+ return;
+ }
+
+ /* Build linked list of attribute nodes which save all attribute */
+ /* groups specified by the mask. */
+ head = NULL;
+
+ if (mask & GL_ACCUM_BUFFER_BIT) {
+ struct gl_accum_attrib *attr;
+ attr = MALLOC_STRUCT( gl_accum_attrib );
+ memcpy( attr, &ctx->Accum, sizeof(struct gl_accum_attrib) );
+ save_attrib_data(&head, GL_ACCUM_BUFFER_BIT, attr);
+ }
+
+ if (mask & GL_COLOR_BUFFER_BIT) {
+ GLuint i;
+ struct gl_colorbuffer_attrib *attr;
+ attr = MALLOC_STRUCT( gl_colorbuffer_attrib );
+ memcpy( attr, &ctx->Color, sizeof(struct gl_colorbuffer_attrib) );
+ /* push the Draw FBO's DrawBuffer[] state, not ctx->Color.DrawBuffer[] */
+ for (i = 0; i < ctx->Const.MaxDrawBuffers; i ++)
+ attr->DrawBuffer[i] = ctx->DrawBuffer->ColorDrawBuffer[i];
+ save_attrib_data(&head, GL_COLOR_BUFFER_BIT, attr);
+ }
+
+ if (mask & GL_CURRENT_BIT) {
+ struct gl_current_attrib *attr;
+ FLUSH_CURRENT( ctx, 0 );
+ attr = MALLOC_STRUCT( gl_current_attrib );
+ memcpy( attr, &ctx->Current, sizeof(struct gl_current_attrib) );
+ save_attrib_data(&head, GL_CURRENT_BIT, attr);
+ }
+
+ if (mask & GL_DEPTH_BUFFER_BIT) {
+ struct gl_depthbuffer_attrib *attr;
+ attr = MALLOC_STRUCT( gl_depthbuffer_attrib );
+ memcpy( attr, &ctx->Depth, sizeof(struct gl_depthbuffer_attrib) );
+ save_attrib_data(&head, GL_DEPTH_BUFFER_BIT, attr);
+ }
+
+ if (mask & GL_ENABLE_BIT) {
+ struct gl_enable_attrib *attr;
+ GLuint i;
+ attr = MALLOC_STRUCT( gl_enable_attrib );
+ /* Copy enable flags from all other attributes into the enable struct. */
+ attr->AlphaTest = ctx->Color.AlphaEnabled;
+ attr->AutoNormal = ctx->Eval.AutoNormal;
+ attr->Blend = ctx->Color.BlendEnabled;
+ attr->ClipPlanes = ctx->Transform.ClipPlanesEnabled;
+ attr->ColorMaterial = ctx->Light.ColorMaterialEnabled;
+ attr->CullFace = ctx->Polygon.CullFlag;
+ attr->DepthClamp = ctx->Transform.DepthClamp;
+ attr->DepthTest = ctx->Depth.Test;
+ attr->Dither = ctx->Color.DitherFlag;
+ attr->Fog = ctx->Fog.Enabled;
+ for (i = 0; i < ctx->Const.MaxLights; i++) {
+ attr->Light[i] = ctx->Light.Light[i].Enabled;
+ }
+ attr->Lighting = ctx->Light.Enabled;
+ attr->LineSmooth = ctx->Line.SmoothFlag;
+ attr->LineStipple = ctx->Line.StippleFlag;
+ attr->IndexLogicOp = ctx->Color.IndexLogicOpEnabled;
+ attr->ColorLogicOp = ctx->Color.ColorLogicOpEnabled;
+ attr->Map1Color4 = ctx->Eval.Map1Color4;
+ attr->Map1Index = ctx->Eval.Map1Index;
+ attr->Map1Normal = ctx->Eval.Map1Normal;
+ attr->Map1TextureCoord1 = ctx->Eval.Map1TextureCoord1;
+ attr->Map1TextureCoord2 = ctx->Eval.Map1TextureCoord2;
+ attr->Map1TextureCoord3 = ctx->Eval.Map1TextureCoord3;
+ attr->Map1TextureCoord4 = ctx->Eval.Map1TextureCoord4;
+ attr->Map1Vertex3 = ctx->Eval.Map1Vertex3;
+ attr->Map1Vertex4 = ctx->Eval.Map1Vertex4;
+ memcpy(attr->Map1Attrib, ctx->Eval.Map1Attrib, sizeof(ctx->Eval.Map1Attrib));
+ attr->Map2Color4 = ctx->Eval.Map2Color4;
+ attr->Map2Index = ctx->Eval.Map2Index;
+ attr->Map2Normal = ctx->Eval.Map2Normal;
+ attr->Map2TextureCoord1 = ctx->Eval.Map2TextureCoord1;
+ attr->Map2TextureCoord2 = ctx->Eval.Map2TextureCoord2;
+ attr->Map2TextureCoord3 = ctx->Eval.Map2TextureCoord3;
+ attr->Map2TextureCoord4 = ctx->Eval.Map2TextureCoord4;
+ attr->Map2Vertex3 = ctx->Eval.Map2Vertex3;
+ attr->Map2Vertex4 = ctx->Eval.Map2Vertex4;
+ memcpy(attr->Map2Attrib, ctx->Eval.Map2Attrib, sizeof(ctx->Eval.Map2Attrib));
+ attr->Normalize = ctx->Transform.Normalize;
+ attr->RasterPositionUnclipped = ctx->Transform.RasterPositionUnclipped;
+ attr->PointSmooth = ctx->Point.SmoothFlag;
+ attr->PointSprite = ctx->Point.PointSprite;
+ attr->PolygonOffsetPoint = ctx->Polygon.OffsetPoint;
+ attr->PolygonOffsetLine = ctx->Polygon.OffsetLine;
+ attr->PolygonOffsetFill = ctx->Polygon.OffsetFill;
+ attr->PolygonSmooth = ctx->Polygon.SmoothFlag;
+ attr->PolygonStipple = ctx->Polygon.StippleFlag;
+ attr->RescaleNormals = ctx->Transform.RescaleNormals;
+ attr->Scissor = ctx->Scissor.Enabled;
+ attr->Stencil = ctx->Stencil.Enabled;
+ attr->StencilTwoSide = ctx->Stencil.TestTwoSide;
+ attr->MultisampleEnabled = ctx->Multisample.Enabled;
+ attr->SampleAlphaToCoverage = ctx->Multisample.SampleAlphaToCoverage;
+ attr->SampleAlphaToOne = ctx->Multisample.SampleAlphaToOne;
+ attr->SampleCoverage = ctx->Multisample.SampleCoverage;
+ attr->SampleCoverageInvert = ctx->Multisample.SampleCoverageInvert;
+ for (i = 0; i < ctx->Const.MaxTextureUnits; i++) {
+ attr->Texture[i] = ctx->Texture.Unit[i].Enabled;
+ attr->TexGen[i] = ctx->Texture.Unit[i].TexGenEnabled;
+ }
+ /* GL_NV_vertex_program */
+ attr->VertexProgram = ctx->VertexProgram.Enabled;
+ attr->VertexProgramPointSize = ctx->VertexProgram.PointSizeEnabled;
+ attr->VertexProgramTwoSide = ctx->VertexProgram.TwoSideEnabled;
+ save_attrib_data(&head, GL_ENABLE_BIT, attr);
+ }
+
+ if (mask & GL_EVAL_BIT) {
+ struct gl_eval_attrib *attr;
+ attr = MALLOC_STRUCT( gl_eval_attrib );
+ memcpy( attr, &ctx->Eval, sizeof(struct gl_eval_attrib) );
+ save_attrib_data(&head, GL_EVAL_BIT, attr);
+ }
+
+ if (mask & GL_FOG_BIT) {
+ struct gl_fog_attrib *attr;
+ attr = MALLOC_STRUCT( gl_fog_attrib );
+ memcpy( attr, &ctx->Fog, sizeof(struct gl_fog_attrib) );
+ save_attrib_data(&head, GL_FOG_BIT, attr);
+ }
+
+ if (mask & GL_HINT_BIT) {
+ struct gl_hint_attrib *attr;
+ attr = MALLOC_STRUCT( gl_hint_attrib );
+ memcpy( attr, &ctx->Hint, sizeof(struct gl_hint_attrib) );
+ save_attrib_data(&head, GL_HINT_BIT, attr);
+ }
+
+ if (mask & GL_LIGHTING_BIT) {
+ struct gl_light_attrib *attr;
+ FLUSH_CURRENT(ctx, 0); /* flush material changes */
+ attr = MALLOC_STRUCT( gl_light_attrib );
+ memcpy( attr, &ctx->Light, sizeof(struct gl_light_attrib) );
+ save_attrib_data(&head, GL_LIGHTING_BIT, attr);
+ }
+
+ if (mask & GL_LINE_BIT) {
+ struct gl_line_attrib *attr;
+ attr = MALLOC_STRUCT( gl_line_attrib );
+ memcpy( attr, &ctx->Line, sizeof(struct gl_line_attrib) );
+ save_attrib_data(&head, GL_LINE_BIT, attr);
+ }
+
+ if (mask & GL_LIST_BIT) {
+ struct gl_list_attrib *attr;
+ attr = MALLOC_STRUCT( gl_list_attrib );
+ memcpy( attr, &ctx->List, sizeof(struct gl_list_attrib) );
+ save_attrib_data(&head, GL_LIST_BIT, attr);
+ }
+
+ if (mask & GL_PIXEL_MODE_BIT) {
+ struct gl_pixel_attrib *attr;
+ attr = MALLOC_STRUCT( gl_pixel_attrib );
+ memcpy( attr, &ctx->Pixel, sizeof(struct gl_pixel_attrib) );
+ /* push the Read FBO's ReadBuffer state, not ctx->Pixel.ReadBuffer */
+ attr->ReadBuffer = ctx->ReadBuffer->ColorReadBuffer;
+ save_attrib_data(&head, GL_PIXEL_MODE_BIT, attr);
+ }
+
+ if (mask & GL_POINT_BIT) {
+ struct gl_point_attrib *attr;
+ attr = MALLOC_STRUCT( gl_point_attrib );
+ memcpy( attr, &ctx->Point, sizeof(struct gl_point_attrib) );
+ save_attrib_data(&head, GL_POINT_BIT, attr);
+ }
+
+ if (mask & GL_POLYGON_BIT) {
+ struct gl_polygon_attrib *attr;
+ attr = MALLOC_STRUCT( gl_polygon_attrib );
+ memcpy( attr, &ctx->Polygon, sizeof(struct gl_polygon_attrib) );
+ save_attrib_data(&head, GL_POLYGON_BIT, attr);
+ }
+
+ if (mask & GL_POLYGON_STIPPLE_BIT) {
+ GLuint *stipple;
+ stipple = (GLuint *) MALLOC( 32*sizeof(GLuint) );
+ memcpy( stipple, ctx->PolygonStipple, 32*sizeof(GLuint) );
+ save_attrib_data(&head, GL_POLYGON_STIPPLE_BIT, stipple);
+ }
+
+ if (mask & GL_SCISSOR_BIT) {
+ struct gl_scissor_attrib *attr;
+ attr = MALLOC_STRUCT( gl_scissor_attrib );
+ memcpy( attr, &ctx->Scissor, sizeof(struct gl_scissor_attrib) );
+ save_attrib_data(&head, GL_SCISSOR_BIT, attr);
+ }
+
+ if (mask & GL_STENCIL_BUFFER_BIT) {
+ struct gl_stencil_attrib *attr;
+ attr = MALLOC_STRUCT( gl_stencil_attrib );
+ memcpy( attr, &ctx->Stencil, sizeof(struct gl_stencil_attrib) );
+ save_attrib_data(&head, GL_STENCIL_BUFFER_BIT, attr);
+ }
+
+ if (mask & GL_TEXTURE_BIT) {
+ struct texture_state *texstate = CALLOC_STRUCT(texture_state);
+ GLuint u, tex;
+
+ if (!texstate) {
+ _mesa_error(ctx, GL_OUT_OF_MEMORY, "glPushAttrib(GL_TEXTURE_BIT)");
+ goto end;
+ }
+
+ _mesa_lock_context_textures(ctx);
+
+ /* copy/save the bulk of texture state here */
+ memcpy(&texstate->Texture, &ctx->Texture, sizeof(ctx->Texture));
+
+ /* Save references to the currently bound texture objects so they don't
+ * accidentally get deleted while referenced in the attribute stack.
+ */
+ for (u = 0; u < ctx->Const.MaxTextureUnits; u++) {
+ for (tex = 0; tex < NUM_TEXTURE_TARGETS; tex++) {
+ _mesa_reference_texobj(&texstate->SavedTexRef[u][tex],
+ ctx->Texture.Unit[u].CurrentTex[tex]);
+ }
+ }
+
+ /* copy state/contents of the currently bound texture objects */
+ for (u = 0; u < ctx->Const.MaxTextureUnits; u++) {
+ for (tex = 0; tex < NUM_TEXTURE_TARGETS; tex++) {
+ _mesa_copy_texture_object(&texstate->SavedObj[u][tex],
+ ctx->Texture.Unit[u].CurrentTex[tex]);
+ }
+ }
+
+ _mesa_unlock_context_textures(ctx);
+
+ save_attrib_data(&head, GL_TEXTURE_BIT, texstate);
+ }
+
+ if (mask & GL_TRANSFORM_BIT) {
+ struct gl_transform_attrib *attr;
+ attr = MALLOC_STRUCT( gl_transform_attrib );
+ memcpy( attr, &ctx->Transform, sizeof(struct gl_transform_attrib) );
+ save_attrib_data(&head, GL_TRANSFORM_BIT, attr);
+ }
+
+ if (mask & GL_VIEWPORT_BIT) {
+ struct gl_viewport_attrib *attr;
+ attr = MALLOC_STRUCT( gl_viewport_attrib );
+ memcpy( attr, &ctx->Viewport, sizeof(struct gl_viewport_attrib) );
+ save_attrib_data(&head, GL_VIEWPORT_BIT, attr);
+ }
+
+ /* GL_ARB_multisample */
+ if (mask & GL_MULTISAMPLE_BIT_ARB) {
+ struct gl_multisample_attrib *attr;
+ attr = MALLOC_STRUCT( gl_multisample_attrib );
+ memcpy( attr, &ctx->Multisample, sizeof(struct gl_multisample_attrib) );
+ save_attrib_data(&head, GL_MULTISAMPLE_BIT_ARB, attr);
+ }
+
+end:
+ ctx->AttribStack[ctx->AttribStackDepth] = head;
+ ctx->AttribStackDepth++;
+}
+
+
+
+static void
+pop_enable_group(struct gl_context *ctx, const struct gl_enable_attrib *enable)
+{
+ const GLuint curTexUnitSave = ctx->Texture.CurrentUnit;
+ GLuint i;
+
+#define TEST_AND_UPDATE(VALUE, NEWVALUE, ENUM) \
+ if ((VALUE) != (NEWVALUE)) { \
+ _mesa_set_enable( ctx, ENUM, (NEWVALUE) ); \
+ }
+
+ TEST_AND_UPDATE(ctx->Color.AlphaEnabled, enable->AlphaTest, GL_ALPHA_TEST);
+ if (ctx->Color.BlendEnabled != enable->Blend) {
+ if (ctx->Extensions.EXT_draw_buffers2) {
+ GLuint i;
+ for (i = 0; i < ctx->Const.MaxDrawBuffers; i++) {
+ _mesa_set_enablei(ctx, GL_BLEND, i, (enable->Blend >> i) & 1);
+ }
+ }
+ else {
+ _mesa_set_enable(ctx, GL_BLEND, (enable->Blend & 1));
+ }
+ }
+
+ for (i=0;i<MAX_CLIP_PLANES;i++) {
+ const GLuint mask = 1 << i;
+ if ((ctx->Transform.ClipPlanesEnabled & mask) != (enable->ClipPlanes & mask))
+ _mesa_set_enable(ctx, (GLenum) (GL_CLIP_PLANE0 + i),
+ (GLboolean) ((enable->ClipPlanes & mask) ? GL_TRUE : GL_FALSE));
+ }
+
+ TEST_AND_UPDATE(ctx->Light.ColorMaterialEnabled, enable->ColorMaterial,
+ GL_COLOR_MATERIAL);
+ TEST_AND_UPDATE(ctx->Polygon.CullFlag, enable->CullFace, GL_CULL_FACE);
+ TEST_AND_UPDATE(ctx->Transform.DepthClamp, enable->DepthClamp,
+ GL_DEPTH_CLAMP);
+ TEST_AND_UPDATE(ctx->Depth.Test, enable->DepthTest, GL_DEPTH_TEST);
+ TEST_AND_UPDATE(ctx->Color.DitherFlag, enable->Dither, GL_DITHER);
+ TEST_AND_UPDATE(ctx->Fog.Enabled, enable->Fog, GL_FOG);
+ TEST_AND_UPDATE(ctx->Light.Enabled, enable->Lighting, GL_LIGHTING);
+ TEST_AND_UPDATE(ctx->Line.SmoothFlag, enable->LineSmooth, GL_LINE_SMOOTH);
+ TEST_AND_UPDATE(ctx->Line.StippleFlag, enable->LineStipple,
+ GL_LINE_STIPPLE);
+ TEST_AND_UPDATE(ctx->Color.IndexLogicOpEnabled, enable->IndexLogicOp,
+ GL_INDEX_LOGIC_OP);
+ TEST_AND_UPDATE(ctx->Color.ColorLogicOpEnabled, enable->ColorLogicOp,
+ GL_COLOR_LOGIC_OP);
+
+ TEST_AND_UPDATE(ctx->Eval.Map1Color4, enable->Map1Color4, GL_MAP1_COLOR_4);
+ TEST_AND_UPDATE(ctx->Eval.Map1Index, enable->Map1Index, GL_MAP1_INDEX);
+ TEST_AND_UPDATE(ctx->Eval.Map1Normal, enable->Map1Normal, GL_MAP1_NORMAL);
+ TEST_AND_UPDATE(ctx->Eval.Map1TextureCoord1, enable->Map1TextureCoord1,
+ GL_MAP1_TEXTURE_COORD_1);
+ TEST_AND_UPDATE(ctx->Eval.Map1TextureCoord2, enable->Map1TextureCoord2,
+ GL_MAP1_TEXTURE_COORD_2);
+ TEST_AND_UPDATE(ctx->Eval.Map1TextureCoord3, enable->Map1TextureCoord3,
+ GL_MAP1_TEXTURE_COORD_3);
+ TEST_AND_UPDATE(ctx->Eval.Map1TextureCoord4, enable->Map1TextureCoord4,
+ GL_MAP1_TEXTURE_COORD_4);
+ TEST_AND_UPDATE(ctx->Eval.Map1Vertex3, enable->Map1Vertex3,
+ GL_MAP1_VERTEX_3);
+ TEST_AND_UPDATE(ctx->Eval.Map1Vertex4, enable->Map1Vertex4,
+ GL_MAP1_VERTEX_4);
+ for (i = 0; i < 16; i++) {
+ TEST_AND_UPDATE(ctx->Eval.Map1Attrib[i], enable->Map1Attrib[i],
+ GL_MAP1_VERTEX_ATTRIB0_4_NV + i);
+ }
+
+ TEST_AND_UPDATE(ctx->Eval.Map2Color4, enable->Map2Color4, GL_MAP2_COLOR_4);
+ TEST_AND_UPDATE(ctx->Eval.Map2Index, enable->Map2Index, GL_MAP2_INDEX);
+ TEST_AND_UPDATE(ctx->Eval.Map2Normal, enable->Map2Normal, GL_MAP2_NORMAL);
+ TEST_AND_UPDATE(ctx->Eval.Map2TextureCoord1, enable->Map2TextureCoord1,
+ GL_MAP2_TEXTURE_COORD_1);
+ TEST_AND_UPDATE(ctx->Eval.Map2TextureCoord2, enable->Map2TextureCoord2,
+ GL_MAP2_TEXTURE_COORD_2);
+ TEST_AND_UPDATE(ctx->Eval.Map2TextureCoord3, enable->Map2TextureCoord3,
+ GL_MAP2_TEXTURE_COORD_3);
+ TEST_AND_UPDATE(ctx->Eval.Map2TextureCoord4, enable->Map2TextureCoord4,
+ GL_MAP2_TEXTURE_COORD_4);
+ TEST_AND_UPDATE(ctx->Eval.Map2Vertex3, enable->Map2Vertex3,
+ GL_MAP2_VERTEX_3);
+ TEST_AND_UPDATE(ctx->Eval.Map2Vertex4, enable->Map2Vertex4,
+ GL_MAP2_VERTEX_4);
+ for (i = 0; i < 16; i++) {
+ TEST_AND_UPDATE(ctx->Eval.Map2Attrib[i], enable->Map2Attrib[i],
+ GL_MAP2_VERTEX_ATTRIB0_4_NV + i);
+ }
+
+ TEST_AND_UPDATE(ctx->Eval.AutoNormal, enable->AutoNormal, GL_AUTO_NORMAL);
+ TEST_AND_UPDATE(ctx->Transform.Normalize, enable->Normalize, GL_NORMALIZE);
+ TEST_AND_UPDATE(ctx->Transform.RescaleNormals, enable->RescaleNormals,
+ GL_RESCALE_NORMAL_EXT);
+ TEST_AND_UPDATE(ctx->Transform.RasterPositionUnclipped,
+ enable->RasterPositionUnclipped,
+ GL_RASTER_POSITION_UNCLIPPED_IBM);
+ TEST_AND_UPDATE(ctx->Point.SmoothFlag, enable->PointSmooth,
+ GL_POINT_SMOOTH);
+ if (ctx->Extensions.NV_point_sprite || ctx->Extensions.ARB_point_sprite) {
+ TEST_AND_UPDATE(ctx->Point.PointSprite, enable->PointSprite,
+ GL_POINT_SPRITE_NV);
+ }
+ TEST_AND_UPDATE(ctx->Polygon.OffsetPoint, enable->PolygonOffsetPoint,
+ GL_POLYGON_OFFSET_POINT);
+ TEST_AND_UPDATE(ctx->Polygon.OffsetLine, enable->PolygonOffsetLine,
+ GL_POLYGON_OFFSET_LINE);
+ TEST_AND_UPDATE(ctx->Polygon.OffsetFill, enable->PolygonOffsetFill,
+ GL_POLYGON_OFFSET_FILL);
+ TEST_AND_UPDATE(ctx->Polygon.SmoothFlag, enable->PolygonSmooth,
+ GL_POLYGON_SMOOTH);
+ TEST_AND_UPDATE(ctx->Polygon.StippleFlag, enable->PolygonStipple,
+ GL_POLYGON_STIPPLE);
+ TEST_AND_UPDATE(ctx->Scissor.Enabled, enable->Scissor, GL_SCISSOR_TEST);
+ TEST_AND_UPDATE(ctx->Stencil.Enabled, enable->Stencil, GL_STENCIL_TEST);
+ if (ctx->Extensions.EXT_stencil_two_side) {
+ TEST_AND_UPDATE(ctx->Stencil.TestTwoSide, enable->StencilTwoSide, GL_STENCIL_TEST_TWO_SIDE_EXT);
+ }
+ TEST_AND_UPDATE(ctx->Multisample.Enabled, enable->MultisampleEnabled,
+ GL_MULTISAMPLE_ARB);
+ TEST_AND_UPDATE(ctx->Multisample.SampleAlphaToCoverage,
+ enable->SampleAlphaToCoverage,
+ GL_SAMPLE_ALPHA_TO_COVERAGE_ARB);
+ TEST_AND_UPDATE(ctx->Multisample.SampleAlphaToOne,
+ enable->SampleAlphaToOne,
+ GL_SAMPLE_ALPHA_TO_ONE_ARB);
+ TEST_AND_UPDATE(ctx->Multisample.SampleCoverage,
+ enable->SampleCoverage,
+ GL_SAMPLE_COVERAGE_ARB);
+ TEST_AND_UPDATE(ctx->Multisample.SampleCoverageInvert,
+ enable->SampleCoverageInvert,
+ GL_SAMPLE_COVERAGE_INVERT_ARB);
+ /* GL_ARB_vertex_program, GL_NV_vertex_program */
+ TEST_AND_UPDATE(ctx->VertexProgram.Enabled,
+ enable->VertexProgram,
+ GL_VERTEX_PROGRAM_ARB);
+ TEST_AND_UPDATE(ctx->VertexProgram.PointSizeEnabled,
+ enable->VertexProgramPointSize,
+ GL_VERTEX_PROGRAM_POINT_SIZE_ARB);
+ TEST_AND_UPDATE(ctx->VertexProgram.TwoSideEnabled,
+ enable->VertexProgramTwoSide,
+ GL_VERTEX_PROGRAM_TWO_SIDE_ARB);
+
+#undef TEST_AND_UPDATE
+
+ /* texture unit enables */
+ for (i = 0; i < ctx->Const.MaxTextureUnits; i++) {
+ const GLbitfield enabled = enable->Texture[i];
+ const GLbitfield genEnabled = enable->TexGen[i];
+
+ if (ctx->Texture.Unit[i].Enabled != enabled) {
+ _mesa_ActiveTextureARB(GL_TEXTURE0 + i);
+
+ _mesa_set_enable(ctx, GL_TEXTURE_1D,
+ (enabled & TEXTURE_1D_BIT) ? GL_TRUE : GL_FALSE);
+ _mesa_set_enable(ctx, GL_TEXTURE_2D,
+ (enabled & TEXTURE_2D_BIT) ? GL_TRUE : GL_FALSE);
+ _mesa_set_enable(ctx, GL_TEXTURE_3D,
+ (enabled & TEXTURE_3D_BIT) ? GL_TRUE : GL_FALSE);
+ if (ctx->Extensions.NV_texture_rectangle) {
+ _mesa_set_enable(ctx, GL_TEXTURE_RECTANGLE_ARB,
+ (enabled & TEXTURE_RECT_BIT) ? GL_TRUE : GL_FALSE);
+ }
+ if (ctx->Extensions.ARB_texture_cube_map) {
+ _mesa_set_enable(ctx, GL_TEXTURE_CUBE_MAP,
+ (enabled & TEXTURE_CUBE_BIT) ? GL_TRUE : GL_FALSE);
+ }
+ if (ctx->Extensions.MESA_texture_array) {
+ _mesa_set_enable(ctx, GL_TEXTURE_1D_ARRAY_EXT,
+ (enabled & TEXTURE_1D_ARRAY_BIT) ? GL_TRUE : GL_FALSE);
+ _mesa_set_enable(ctx, GL_TEXTURE_2D_ARRAY_EXT,
+ (enabled & TEXTURE_2D_ARRAY_BIT) ? GL_TRUE : GL_FALSE);
+ }
+ }
+
+ if (ctx->Texture.Unit[i].TexGenEnabled != genEnabled) {
+ _mesa_ActiveTextureARB(GL_TEXTURE0 + i);
+ _mesa_set_enable(ctx, GL_TEXTURE_GEN_S,
+ (genEnabled & S_BIT) ? GL_TRUE : GL_FALSE);
+ _mesa_set_enable(ctx, GL_TEXTURE_GEN_T,
+ (genEnabled & T_BIT) ? GL_TRUE : GL_FALSE);
+ _mesa_set_enable(ctx, GL_TEXTURE_GEN_R,
+ (genEnabled & R_BIT) ? GL_TRUE : GL_FALSE);
+ _mesa_set_enable(ctx, GL_TEXTURE_GEN_Q,
+ (genEnabled & Q_BIT) ? GL_TRUE : GL_FALSE);
+ }
+ }
+
+ _mesa_ActiveTextureARB(GL_TEXTURE0 + curTexUnitSave);
+}
+
+
+/**
+ * Pop/restore texture attribute/group state.
+ */
+static void
+pop_texture_group(struct gl_context *ctx, struct texture_state *texstate)
+{
+ GLuint u;
+
+ _mesa_lock_context_textures(ctx);
+
+ for (u = 0; u < ctx->Const.MaxTextureUnits; u++) {
+ const struct gl_texture_unit *unit = &texstate->Texture.Unit[u];
+ GLuint tgt;
+
+ _mesa_ActiveTextureARB(GL_TEXTURE0_ARB + u);
+ _mesa_set_enable(ctx, GL_TEXTURE_1D,
+ (unit->Enabled & TEXTURE_1D_BIT) ? GL_TRUE : GL_FALSE);
+ _mesa_set_enable(ctx, GL_TEXTURE_2D,
+ (unit->Enabled & TEXTURE_2D_BIT) ? GL_TRUE : GL_FALSE);
+ _mesa_set_enable(ctx, GL_TEXTURE_3D,
+ (unit->Enabled & TEXTURE_3D_BIT) ? GL_TRUE : GL_FALSE);
+ if (ctx->Extensions.ARB_texture_cube_map) {
+ _mesa_set_enable(ctx, GL_TEXTURE_CUBE_MAP_ARB,
+ (unit->Enabled & TEXTURE_CUBE_BIT) ? GL_TRUE : GL_FALSE);
+ }
+ if (ctx->Extensions.NV_texture_rectangle) {
+ _mesa_set_enable(ctx, GL_TEXTURE_RECTANGLE_NV,
+ (unit->Enabled & TEXTURE_RECT_BIT) ? GL_TRUE : GL_FALSE);
+ }
+ if (ctx->Extensions.MESA_texture_array) {
+ _mesa_set_enable(ctx, GL_TEXTURE_1D_ARRAY_EXT,
+ (unit->Enabled & TEXTURE_1D_ARRAY_BIT) ? GL_TRUE : GL_FALSE);
+ _mesa_set_enable(ctx, GL_TEXTURE_2D_ARRAY_EXT,
+ (unit->Enabled & TEXTURE_2D_ARRAY_BIT) ? GL_TRUE : GL_FALSE);
+ }
+
+ _mesa_TexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, unit->EnvMode);
+ _mesa_TexEnvfv(GL_TEXTURE_ENV, GL_TEXTURE_ENV_COLOR, unit->EnvColor);
+ _mesa_TexGeni(GL_S, GL_TEXTURE_GEN_MODE, unit->GenS.Mode);
+ _mesa_TexGeni(GL_T, GL_TEXTURE_GEN_MODE, unit->GenT.Mode);
+ _mesa_TexGeni(GL_R, GL_TEXTURE_GEN_MODE, unit->GenR.Mode);
+ _mesa_TexGeni(GL_Q, GL_TEXTURE_GEN_MODE, unit->GenQ.Mode);
+ _mesa_TexGenfv(GL_S, GL_OBJECT_PLANE, unit->GenS.ObjectPlane);
+ _mesa_TexGenfv(GL_T, GL_OBJECT_PLANE, unit->GenT.ObjectPlane);
+ _mesa_TexGenfv(GL_R, GL_OBJECT_PLANE, unit->GenR.ObjectPlane);
+ _mesa_TexGenfv(GL_Q, GL_OBJECT_PLANE, unit->GenQ.ObjectPlane);
+ /* Eye plane done differently to avoid re-transformation */
+ {
+ struct gl_texture_unit *destUnit = &ctx->Texture.Unit[u];
+ COPY_4FV(destUnit->GenS.EyePlane, unit->GenS.EyePlane);
+ COPY_4FV(destUnit->GenT.EyePlane, unit->GenT.EyePlane);
+ COPY_4FV(destUnit->GenR.EyePlane, unit->GenR.EyePlane);
+ COPY_4FV(destUnit->GenQ.EyePlane, unit->GenQ.EyePlane);
+ if (ctx->Driver.TexGen) {
+ ctx->Driver.TexGen(ctx, GL_S, GL_EYE_PLANE, unit->GenS.EyePlane);
+ ctx->Driver.TexGen(ctx, GL_T, GL_EYE_PLANE, unit->GenT.EyePlane);
+ ctx->Driver.TexGen(ctx, GL_R, GL_EYE_PLANE, unit->GenR.EyePlane);
+ ctx->Driver.TexGen(ctx, GL_Q, GL_EYE_PLANE, unit->GenQ.EyePlane);
+ }
+ }
+ _mesa_set_enable(ctx, GL_TEXTURE_GEN_S,
+ ((unit->TexGenEnabled & S_BIT) ? GL_TRUE : GL_FALSE));
+ _mesa_set_enable(ctx, GL_TEXTURE_GEN_T,
+ ((unit->TexGenEnabled & T_BIT) ? GL_TRUE : GL_FALSE));
+ _mesa_set_enable(ctx, GL_TEXTURE_GEN_R,
+ ((unit->TexGenEnabled & R_BIT) ? GL_TRUE : GL_FALSE));
+ _mesa_set_enable(ctx, GL_TEXTURE_GEN_Q,
+ ((unit->TexGenEnabled & Q_BIT) ? GL_TRUE : GL_FALSE));
+ if (ctx->Extensions.EXT_texture_lod_bias) {
+ _mesa_TexEnvf(GL_TEXTURE_FILTER_CONTROL_EXT,
+ GL_TEXTURE_LOD_BIAS_EXT, unit->LodBias);
+ }
+ if (ctx->Extensions.EXT_texture_env_combine ||
+ ctx->Extensions.ARB_texture_env_combine) {
+ _mesa_TexEnvi(GL_TEXTURE_ENV, GL_COMBINE_RGB,
+ unit->Combine.ModeRGB);
+ _mesa_TexEnvi(GL_TEXTURE_ENV, GL_COMBINE_ALPHA,
+ unit->Combine.ModeA);
+ _mesa_TexEnvi(GL_TEXTURE_ENV, GL_SOURCE0_RGB,
+ unit->Combine.SourceRGB[0]);
+ _mesa_TexEnvi(GL_TEXTURE_ENV, GL_SOURCE1_RGB,
+ unit->Combine.SourceRGB[1]);
+ _mesa_TexEnvi(GL_TEXTURE_ENV, GL_SOURCE2_RGB,
+ unit->Combine.SourceRGB[2]);
+ _mesa_TexEnvi(GL_TEXTURE_ENV, GL_SOURCE0_ALPHA,
+ unit->Combine.SourceA[0]);
+ _mesa_TexEnvi(GL_TEXTURE_ENV, GL_SOURCE1_ALPHA,
+ unit->Combine.SourceA[1]);
+ _mesa_TexEnvi(GL_TEXTURE_ENV, GL_SOURCE2_ALPHA,
+ unit->Combine.SourceA[2]);
+ _mesa_TexEnvi(GL_TEXTURE_ENV, GL_OPERAND0_RGB,
+ unit->Combine.OperandRGB[0]);
+ _mesa_TexEnvi(GL_TEXTURE_ENV, GL_OPERAND1_RGB,
+ unit->Combine.OperandRGB[1]);
+ _mesa_TexEnvi(GL_TEXTURE_ENV, GL_OPERAND2_RGB,
+ unit->Combine.OperandRGB[2]);
+ _mesa_TexEnvi(GL_TEXTURE_ENV, GL_OPERAND0_ALPHA,
+ unit->Combine.OperandA[0]);
+ _mesa_TexEnvi(GL_TEXTURE_ENV, GL_OPERAND1_ALPHA,
+ unit->Combine.OperandA[1]);
+ _mesa_TexEnvi(GL_TEXTURE_ENV, GL_OPERAND2_ALPHA,
+ unit->Combine.OperandA[2]);
+ _mesa_TexEnvi(GL_TEXTURE_ENV, GL_RGB_SCALE,
+ 1 << unit->Combine.ScaleShiftRGB);
+ _mesa_TexEnvi(GL_TEXTURE_ENV, GL_ALPHA_SCALE,
+ 1 << unit->Combine.ScaleShiftA);
+ }
+
+ /* Restore texture object state for each target */
+ for (tgt = 0; tgt < NUM_TEXTURE_TARGETS; tgt++) {
+ const struct gl_texture_object *obj = NULL;
+ const struct gl_sampler_object *samp;
+ GLenum target;
+
+ obj = &texstate->SavedObj[u][tgt];
+
+ /* don't restore state for unsupported targets to prevent
+ * raising GL errors.
+ */
+ if (obj->Target == GL_TEXTURE_CUBE_MAP_ARB &&
+ !ctx->Extensions.ARB_texture_cube_map) {
+ continue;
+ }
+ else if (obj->Target == GL_TEXTURE_RECTANGLE_NV &&
+ !ctx->Extensions.NV_texture_rectangle) {
+ continue;
+ }
+ else if ((obj->Target == GL_TEXTURE_1D_ARRAY_EXT ||
+ obj->Target == GL_TEXTURE_2D_ARRAY_EXT) &&
+ !ctx->Extensions.MESA_texture_array) {
+ continue;
+ }
+ else if (obj->Target == GL_TEXTURE_BUFFER)
+ continue;
+
+ target = obj->Target;
+
+ _mesa_BindTexture(target, obj->Name);
+
+ samp = &obj->Sampler;
+
+ _mesa_TexParameterfv(target, GL_TEXTURE_BORDER_COLOR, samp->BorderColor.f);
+ _mesa_TexParameteri(target, GL_TEXTURE_WRAP_S, samp->WrapS);
+ _mesa_TexParameteri(target, GL_TEXTURE_WRAP_T, samp->WrapT);
+ _mesa_TexParameteri(target, GL_TEXTURE_WRAP_R, samp->WrapR);
+ _mesa_TexParameteri(target, GL_TEXTURE_MIN_FILTER, samp->MinFilter);
+ _mesa_TexParameteri(target, GL_TEXTURE_MAG_FILTER, samp->MagFilter);
+ _mesa_TexParameterf(target, GL_TEXTURE_MIN_LOD, samp->MinLod);
+ _mesa_TexParameterf(target, GL_TEXTURE_MAX_LOD, samp->MaxLod);
+ _mesa_TexParameterf(target, GL_TEXTURE_LOD_BIAS, samp->LodBias);
+ _mesa_TexParameterf(target, GL_TEXTURE_PRIORITY, obj->Priority);
+ _mesa_TexParameteri(target, GL_TEXTURE_BASE_LEVEL, obj->BaseLevel);
+ if (target != GL_TEXTURE_RECTANGLE_ARB)
+ _mesa_TexParameteri(target, GL_TEXTURE_MAX_LEVEL, obj->MaxLevel);
+ if (ctx->Extensions.EXT_texture_filter_anisotropic) {
+ _mesa_TexParameterf(target, GL_TEXTURE_MAX_ANISOTROPY_EXT,
+ samp->MaxAnisotropy);
+ }
+ if (ctx->Extensions.ARB_shadow_ambient) {
+ _mesa_TexParameterf(target, GL_TEXTURE_COMPARE_FAIL_VALUE_ARB,
+ samp->CompareFailValue);
+ }
+ }
+
+ /* remove saved references to the texture objects */
+ for (tgt = 0; tgt < NUM_TEXTURE_TARGETS; tgt++) {
+ _mesa_reference_texobj(&texstate->SavedTexRef[u][tgt], NULL);
+ }
+ }
+
+ _mesa_ActiveTextureARB(GL_TEXTURE0_ARB + texstate->Texture.CurrentUnit);
+
+ _mesa_unlock_context_textures(ctx);
+}
+
+
+/*
+ * This function is kind of long just because we have to call a lot
+ * of device driver functions to update device driver state.
+ *
+ * XXX As it is now, most of the pop-code calls immediate-mode Mesa functions
+ * in order to restore GL state. This isn't terribly efficient but it
+ * ensures that dirty flags and any derived state gets updated correctly.
+ * We could at least check if the value to restore equals the current value
+ * and then skip the Mesa call.
+ */
+void GLAPIENTRY
+_mesa_PopAttrib(void)
+{
+ struct gl_attrib_node *attr, *next;
+ GET_CURRENT_CONTEXT(ctx);
+ ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
+
+ if (ctx->AttribStackDepth == 0) {
+ _mesa_error( ctx, GL_STACK_UNDERFLOW, "glPopAttrib" );
+ return;
+ }
+
+ ctx->AttribStackDepth--;
+ attr = ctx->AttribStack[ctx->AttribStackDepth];
+
+ while (attr) {
+
+ if (MESA_VERBOSE & VERBOSE_API) {
+ _mesa_debug(ctx, "glPopAttrib %s\n",
+ _mesa_lookup_enum_by_nr(attr->kind));
+ }
+
+ switch (attr->kind) {
+ case GL_ACCUM_BUFFER_BIT:
+ {
+ const struct gl_accum_attrib *accum;
+ accum = (const struct gl_accum_attrib *) attr->data;
+ _mesa_ClearAccum(accum->ClearColor[0],
+ accum->ClearColor[1],
+ accum->ClearColor[2],
+ accum->ClearColor[3]);
+ }
+ break;
+ case GL_COLOR_BUFFER_BIT:
+ {
+ const struct gl_colorbuffer_attrib *color;
+
+ color = (const struct gl_colorbuffer_attrib *) attr->data;
+ _mesa_ClearIndex((GLfloat) color->ClearIndex);
+ _mesa_ClearColor(color->ClearColorUnclamped[0],
+ color->ClearColorUnclamped[1],
+ color->ClearColorUnclamped[2],
+ color->ClearColorUnclamped[3]);
+ _mesa_IndexMask(color->IndexMask);
+ if (!ctx->Extensions.EXT_draw_buffers2) {
+ _mesa_ColorMask((GLboolean) (color->ColorMask[0][0] != 0),
+ (GLboolean) (color->ColorMask[0][1] != 0),
+ (GLboolean) (color->ColorMask[0][2] != 0),
+ (GLboolean) (color->ColorMask[0][3] != 0));
+ }
+ else {
+ GLuint i;
+ for (i = 0; i < ctx->Const.MaxDrawBuffers; i++) {
+ _mesa_ColorMaskIndexed(i,
+ (GLboolean) (color->ColorMask[i][0] != 0),
+ (GLboolean) (color->ColorMask[i][1] != 0),
+ (GLboolean) (color->ColorMask[i][2] != 0),
+ (GLboolean) (color->ColorMask[i][3] != 0));
+ }
+ }
+ {
+ /* Need to determine if more than one color output is
+ * specified. If so, call glDrawBuffersARB, else call
+ * glDrawBuffer(). This is a subtle, but essential point
+ * since GL_FRONT (for example) is illegal for the former
+ * function, but legal for the later.
+ */
+ GLboolean multipleBuffers = GL_FALSE;
+ GLuint i;
+
+ for (i = 1; i < ctx->Const.MaxDrawBuffers; i++) {
+ if (color->DrawBuffer[i] != GL_NONE) {
+ multipleBuffers = GL_TRUE;
+ break;
+ }
+ }
+ /* Call the API_level functions, not _mesa_drawbuffers()
+ * since we need to do error checking on the pop'd
+ * GL_DRAW_BUFFER.
+ * Ex: if GL_FRONT were pushed, but we're popping with a
+ * user FBO bound, GL_FRONT will be illegal and we'll need
+ * to record that error. Per OpenGL ARB decision.
+ */
+ if (multipleBuffers)
+ _mesa_DrawBuffersARB(ctx->Const.MaxDrawBuffers,
+ color->DrawBuffer);
+ else
+ _mesa_DrawBuffer(color->DrawBuffer[0]);
+ }
+ _mesa_set_enable(ctx, GL_ALPHA_TEST, color->AlphaEnabled);
+ _mesa_AlphaFunc(color->AlphaFunc, color->AlphaRefUnclamped);
+ if (ctx->Color.BlendEnabled != color->BlendEnabled) {
+ if (ctx->Extensions.EXT_draw_buffers2) {
+ GLuint i;
+ for (i = 0; i < ctx->Const.MaxDrawBuffers; i++) {
+ _mesa_set_enablei(ctx, GL_BLEND, i,
+ (color->BlendEnabled >> i) & 1);
+ }
+ }
+ else {
+ _mesa_set_enable(ctx, GL_BLEND, (color->BlendEnabled & 1));
+ }
+ }
+ if (ctx->Color._BlendFuncPerBuffer ||
+ ctx->Color._BlendEquationPerBuffer) {
+ /* set blend per buffer */
+ GLuint buf;
+ for (buf = 0; buf < ctx->Const.MaxDrawBuffers; buf++) {
+ _mesa_BlendFuncSeparatei(buf, color->Blend[buf].SrcRGB,
+ color->Blend[buf].DstRGB,
+ color->Blend[buf].SrcA,
+ color->Blend[buf].DstA);
+ _mesa_BlendEquationSeparatei(buf,
+ color->Blend[buf].EquationRGB,
+ color->Blend[buf].EquationA);
+ }
+ }
+ else {
+ /* set same blend modes for all buffers */
+ _mesa_BlendFuncSeparateEXT(color->Blend[0].SrcRGB,
+ color->Blend[0].DstRGB,
+ color->Blend[0].SrcA,
+ color->Blend[0].DstA);
+ /* This special case is because glBlendEquationSeparateEXT
+ * cannot take GL_LOGIC_OP as a parameter.
+ */
+ if (color->Blend[0].EquationRGB ==
+ color->Blend[0].EquationA) {
+ _mesa_BlendEquation(color->Blend[0].EquationRGB);
+ }
+ else {
+ _mesa_BlendEquationSeparateEXT(
+ color->Blend[0].EquationRGB,
+ color->Blend[0].EquationA);
+ }
+ }
+ _mesa_BlendColor(color->BlendColorUnclamped[0],
+ color->BlendColorUnclamped[1],
+ color->BlendColorUnclamped[2],
+ color->BlendColorUnclamped[3]);
+ _mesa_LogicOp(color->LogicOp);
+ _mesa_set_enable(ctx, GL_COLOR_LOGIC_OP,
+ color->ColorLogicOpEnabled);
+ _mesa_set_enable(ctx, GL_INDEX_LOGIC_OP,
+ color->IndexLogicOpEnabled);
+ _mesa_set_enable(ctx, GL_DITHER, color->DitherFlag);
+ _mesa_ClampColorARB(GL_CLAMP_FRAGMENT_COLOR_ARB, color->ClampFragmentColor);
+ _mesa_ClampColorARB(GL_CLAMP_READ_COLOR_ARB, color->ClampReadColor);
+ }
+ break;
+ case GL_CURRENT_BIT:
+ FLUSH_CURRENT( ctx, 0 );
+ memcpy( &ctx->Current, attr->data,
+ sizeof(struct gl_current_attrib) );
+ break;
+ case GL_DEPTH_BUFFER_BIT:
+ {
+ const struct gl_depthbuffer_attrib *depth;
+ depth = (const struct gl_depthbuffer_attrib *) attr->data;
+ _mesa_DepthFunc(depth->Func);
+ _mesa_ClearDepth(depth->Clear);
+ _mesa_set_enable(ctx, GL_DEPTH_TEST, depth->Test);
+ _mesa_DepthMask(depth->Mask);
+ }
+ break;
+ case GL_ENABLE_BIT:
+ {
+ const struct gl_enable_attrib *enable;
+ enable = (const struct gl_enable_attrib *) attr->data;
+ pop_enable_group(ctx, enable);
+ ctx->NewState |= _NEW_ALL;
+ }
+ break;
+ case GL_EVAL_BIT:
+ memcpy( &ctx->Eval, attr->data, sizeof(struct gl_eval_attrib) );
+ ctx->NewState |= _NEW_EVAL;
+ break;
+ case GL_FOG_BIT:
+ {
+ const struct gl_fog_attrib *fog;
+ fog = (const struct gl_fog_attrib *) attr->data;
+ _mesa_set_enable(ctx, GL_FOG, fog->Enabled);
+ _mesa_Fogfv(GL_FOG_COLOR, fog->Color);
+ _mesa_Fogf(GL_FOG_DENSITY, fog->Density);
+ _mesa_Fogf(GL_FOG_START, fog->Start);
+ _mesa_Fogf(GL_FOG_END, fog->End);
+ _mesa_Fogf(GL_FOG_INDEX, fog->Index);
+ _mesa_Fogi(GL_FOG_MODE, fog->Mode);
+ }
+ break;
+ case GL_HINT_BIT:
+ {
+ const struct gl_hint_attrib *hint;
+ hint = (const struct gl_hint_attrib *) attr->data;
+ _mesa_Hint(GL_PERSPECTIVE_CORRECTION_HINT,
+ hint->PerspectiveCorrection );
+ _mesa_Hint(GL_POINT_SMOOTH_HINT, hint->PointSmooth);
+ _mesa_Hint(GL_LINE_SMOOTH_HINT, hint->LineSmooth);
+ _mesa_Hint(GL_POLYGON_SMOOTH_HINT, hint->PolygonSmooth);
+ _mesa_Hint(GL_FOG_HINT, hint->Fog);
+ _mesa_Hint(GL_CLIP_VOLUME_CLIPPING_HINT_EXT,
+ hint->ClipVolumeClipping);
+ _mesa_Hint(GL_TEXTURE_COMPRESSION_HINT_ARB,
+ hint->TextureCompression);
+ }
+ break;
+ case GL_LIGHTING_BIT:
+ {
+ GLuint i;
+ const struct gl_light_attrib *light;
+ light = (const struct gl_light_attrib *) attr->data;
+ /* lighting enable */
+ _mesa_set_enable(ctx, GL_LIGHTING, light->Enabled);
+ /* per-light state */
+ if (_math_matrix_is_dirty(ctx->ModelviewMatrixStack.Top))
+ _math_matrix_analyse( ctx->ModelviewMatrixStack.Top );
+
+ for (i = 0; i < ctx->Const.MaxLights; i++) {
+ const struct gl_light *l = &light->Light[i];
+ _mesa_set_enable(ctx, GL_LIGHT0 + i, l->Enabled);
+ _mesa_light(ctx, i, GL_AMBIENT, l->Ambient);
+ _mesa_light(ctx, i, GL_DIFFUSE, l->Diffuse);
+ _mesa_light(ctx, i, GL_SPECULAR, l->Specular );
+ _mesa_light(ctx, i, GL_POSITION, l->EyePosition);
+ _mesa_light(ctx, i, GL_SPOT_DIRECTION, l->SpotDirection);
+ {
+ GLfloat p[4] = { 0 };
+ p[0] = l->SpotExponent;
+ _mesa_light(ctx, i, GL_SPOT_EXPONENT, p);
+ }
+ {
+ GLfloat p[4] = { 0 };
+ p[0] = l->SpotCutoff;
+ _mesa_light(ctx, i, GL_SPOT_CUTOFF, p);
+ }
+ {
+ GLfloat p[4] = { 0 };
+ p[0] = l->ConstantAttenuation;
+ _mesa_light(ctx, i, GL_CONSTANT_ATTENUATION, p);
+ }
+ {
+ GLfloat p[4] = { 0 };
+ p[0] = l->LinearAttenuation;
+ _mesa_light(ctx, i, GL_LINEAR_ATTENUATION, p);
+ }
+ {
+ GLfloat p[4] = { 0 };
+ p[0] = l->QuadraticAttenuation;
+ _mesa_light(ctx, i, GL_QUADRATIC_ATTENUATION, p);
+ }
+ }
+ /* light model */
+ _mesa_LightModelfv(GL_LIGHT_MODEL_AMBIENT,
+ light->Model.Ambient);
+ _mesa_LightModelf(GL_LIGHT_MODEL_LOCAL_VIEWER,
+ (GLfloat) light->Model.LocalViewer);
+ _mesa_LightModelf(GL_LIGHT_MODEL_TWO_SIDE,
+ (GLfloat) light->Model.TwoSide);
+ _mesa_LightModelf(GL_LIGHT_MODEL_COLOR_CONTROL,
+ (GLfloat) light->Model.ColorControl);
+ /* shade model */
+ _mesa_ShadeModel(light->ShadeModel);
+ /* color material */
+ _mesa_ColorMaterial(light->ColorMaterialFace,
+ light->ColorMaterialMode);
+ _mesa_set_enable(ctx, GL_COLOR_MATERIAL,
+ light->ColorMaterialEnabled);
+ /* materials */
+ memcpy(&ctx->Light.Material, &light->Material,
+ sizeof(struct gl_material));
+ _mesa_ClampColorARB(GL_CLAMP_VERTEX_COLOR_ARB, light->ClampVertexColor);
+ }
+ break;
+ case GL_LINE_BIT:
+ {
+ const struct gl_line_attrib *line;
+ line = (const struct gl_line_attrib *) attr->data;
+ _mesa_set_enable(ctx, GL_LINE_SMOOTH, line->SmoothFlag);
+ _mesa_set_enable(ctx, GL_LINE_STIPPLE, line->StippleFlag);
+ _mesa_LineStipple(line->StippleFactor, line->StipplePattern);
+ _mesa_LineWidth(line->Width);
+ }
+ break;
+ case GL_LIST_BIT:
+ memcpy( &ctx->List, attr->data, sizeof(struct gl_list_attrib) );
+ break;
+ case GL_PIXEL_MODE_BIT:
+ memcpy( &ctx->Pixel, attr->data, sizeof(struct gl_pixel_attrib) );
+ /* XXX what other pixel state needs to be set by function calls? */
+ _mesa_ReadBuffer(ctx->Pixel.ReadBuffer);
+ ctx->NewState |= _NEW_PIXEL;
+ break;
+ case GL_POINT_BIT:
+ {
+ const struct gl_point_attrib *point;
+ point = (const struct gl_point_attrib *) attr->data;
+ _mesa_PointSize(point->Size);
+ _mesa_set_enable(ctx, GL_POINT_SMOOTH, point->SmoothFlag);
+ if (ctx->Extensions.EXT_point_parameters) {
+ _mesa_PointParameterfv(GL_DISTANCE_ATTENUATION_EXT,
+ point->Params);
+ _mesa_PointParameterf(GL_POINT_SIZE_MIN_EXT,
+ point->MinSize);
+ _mesa_PointParameterf(GL_POINT_SIZE_MAX_EXT,
+ point->MaxSize);
+ _mesa_PointParameterf(GL_POINT_FADE_THRESHOLD_SIZE_EXT,
+ point->Threshold);
+ }
+ if (ctx->Extensions.NV_point_sprite
+ || ctx->Extensions.ARB_point_sprite) {
+ GLuint u;
+ for (u = 0; u < ctx->Const.MaxTextureUnits; u++) {
+ _mesa_TexEnvi(GL_POINT_SPRITE_NV, GL_COORD_REPLACE_NV,
+ (GLint) point->CoordReplace[u]);
+ }
+ _mesa_set_enable(ctx, GL_POINT_SPRITE_NV,point->PointSprite);
+ if (ctx->Extensions.NV_point_sprite)
+ _mesa_PointParameteri(GL_POINT_SPRITE_R_MODE_NV,
+ ctx->Point.SpriteRMode);
+ _mesa_PointParameterf(GL_POINT_SPRITE_COORD_ORIGIN,
+ (GLfloat)ctx->Point.SpriteOrigin);
+ }
+ }
+ break;
+ case GL_POLYGON_BIT:
+ {
+ const struct gl_polygon_attrib *polygon;
+ polygon = (const struct gl_polygon_attrib *) attr->data;
+ _mesa_CullFace(polygon->CullFaceMode);
+ _mesa_FrontFace(polygon->FrontFace);
+ _mesa_PolygonMode(GL_FRONT, polygon->FrontMode);
+ _mesa_PolygonMode(GL_BACK, polygon->BackMode);
+ _mesa_PolygonOffset(polygon->OffsetFactor,
+ polygon->OffsetUnits);
+ _mesa_set_enable(ctx, GL_POLYGON_SMOOTH, polygon->SmoothFlag);
+ _mesa_set_enable(ctx, GL_POLYGON_STIPPLE, polygon->StippleFlag);
+ _mesa_set_enable(ctx, GL_CULL_FACE, polygon->CullFlag);
+ _mesa_set_enable(ctx, GL_POLYGON_OFFSET_POINT,
+ polygon->OffsetPoint);
+ _mesa_set_enable(ctx, GL_POLYGON_OFFSET_LINE,
+ polygon->OffsetLine);
+ _mesa_set_enable(ctx, GL_POLYGON_OFFSET_FILL,
+ polygon->OffsetFill);
+ }
+ break;
+ case GL_POLYGON_STIPPLE_BIT:
+ memcpy( ctx->PolygonStipple, attr->data, 32*sizeof(GLuint) );
+ ctx->NewState |= _NEW_POLYGONSTIPPLE;
+ if (ctx->Driver.PolygonStipple)
+ ctx->Driver.PolygonStipple( ctx, (const GLubyte *) attr->data );
+ break;
+ case GL_SCISSOR_BIT:
+ {
+ const struct gl_scissor_attrib *scissor;
+ scissor = (const struct gl_scissor_attrib *) attr->data;
+ _mesa_Scissor(scissor->X, scissor->Y,
+ scissor->Width, scissor->Height);
+ _mesa_set_enable(ctx, GL_SCISSOR_TEST, scissor->Enabled);
+ }
+ break;
+ case GL_STENCIL_BUFFER_BIT:
+ {
+ const struct gl_stencil_attrib *stencil;
+ stencil = (const struct gl_stencil_attrib *) attr->data;
+ _mesa_set_enable(ctx, GL_STENCIL_TEST, stencil->Enabled);
+ _mesa_ClearStencil(stencil->Clear);
+ if (ctx->Extensions.EXT_stencil_two_side) {
+ _mesa_set_enable(ctx, GL_STENCIL_TEST_TWO_SIDE_EXT,
+ stencil->TestTwoSide);
+ _mesa_ActiveStencilFaceEXT(stencil->ActiveFace
+ ? GL_BACK : GL_FRONT);
+ }
+ /* front state */
+ _mesa_StencilFuncSeparate(GL_FRONT,
+ stencil->Function[0],
+ stencil->Ref[0],
+ stencil->ValueMask[0]);
+ _mesa_StencilMaskSeparate(GL_FRONT, stencil->WriteMask[0]);
+ _mesa_StencilOpSeparate(GL_FRONT, stencil->FailFunc[0],
+ stencil->ZFailFunc[0],
+ stencil->ZPassFunc[0]);
+ /* back state */
+ _mesa_StencilFuncSeparate(GL_BACK,
+ stencil->Function[1],
+ stencil->Ref[1],
+ stencil->ValueMask[1]);
+ _mesa_StencilMaskSeparate(GL_BACK, stencil->WriteMask[1]);
+ _mesa_StencilOpSeparate(GL_BACK, stencil->FailFunc[1],
+ stencil->ZFailFunc[1],
+ stencil->ZPassFunc[1]);
+ }
+ break;
+ case GL_TRANSFORM_BIT:
+ {
+ GLuint i;
+ const struct gl_transform_attrib *xform;
+ xform = (const struct gl_transform_attrib *) attr->data;
+ _mesa_MatrixMode(xform->MatrixMode);
+ if (_math_matrix_is_dirty(ctx->ProjectionMatrixStack.Top))
+ _math_matrix_analyse( ctx->ProjectionMatrixStack.Top );
+
+ /* restore clip planes */
+ for (i = 0; i < MAX_CLIP_PLANES; i++) {
+ const GLuint mask = 1 << i;
+ const GLfloat *eyePlane = xform->EyeUserPlane[i];
+ COPY_4V(ctx->Transform.EyeUserPlane[i], eyePlane);
+ if (xform->ClipPlanesEnabled & mask) {
+ _mesa_set_enable(ctx, GL_CLIP_PLANE0 + i, GL_TRUE);
+ }
+ else {
+ _mesa_set_enable(ctx, GL_CLIP_PLANE0 + i, GL_FALSE);
+ }
+ if (ctx->Driver.ClipPlane)
+ ctx->Driver.ClipPlane( ctx, GL_CLIP_PLANE0 + i, eyePlane );
+ }
+
+ /* normalize/rescale */
+ if (xform->Normalize != ctx->Transform.Normalize)
+ _mesa_set_enable(ctx, GL_NORMALIZE,ctx->Transform.Normalize);
+ if (xform->RescaleNormals != ctx->Transform.RescaleNormals)
+ _mesa_set_enable(ctx, GL_RESCALE_NORMAL_EXT,
+ ctx->Transform.RescaleNormals);
+ if (xform->DepthClamp != ctx->Transform.DepthClamp)
+ _mesa_set_enable(ctx, GL_DEPTH_CLAMP,
+ ctx->Transform.DepthClamp);
+ }
+ break;
+ case GL_TEXTURE_BIT:
+ /* Take care of texture object reference counters */
+ {
+ struct texture_state *texstate
+ = (struct texture_state *) attr->data;
+ pop_texture_group(ctx, texstate);
+ ctx->NewState |= _NEW_TEXTURE;
+ }
+ break;
+ case GL_VIEWPORT_BIT:
+ {
+ const struct gl_viewport_attrib *vp;
+ vp = (const struct gl_viewport_attrib *) attr->data;
+ _mesa_Viewport(vp->X, vp->Y, vp->Width, vp->Height);
+ _mesa_DepthRange(vp->Near, vp->Far);
+ }
+ break;
+ case GL_MULTISAMPLE_BIT_ARB:
+ {
+ const struct gl_multisample_attrib *ms;
+ ms = (const struct gl_multisample_attrib *) attr->data;
+ _mesa_SampleCoverageARB(ms->SampleCoverageValue,
+ ms->SampleCoverageInvert);
+ }
+ break;
+
+ default:
+ _mesa_problem( ctx, "Bad attrib flag in PopAttrib");
+ break;
+ }
+
+ next = attr->next;
+ FREE( attr->data );
+ FREE( attr );
+ attr = next;
+ }
+}
+
+
+/**
+ * Helper for incrementing/decrementing vertex buffer object reference
+ * counts when pushing/popping the GL_CLIENT_VERTEX_ARRAY_BIT attribute group.
+ */
+static void
+adjust_buffer_object_ref_counts(struct gl_array_object *arrayObj, GLint step)
+{
+ GLuint i;
+
+ arrayObj->Vertex.BufferObj->RefCount += step;
+ arrayObj->Weight.BufferObj->RefCount += step;
+ arrayObj->Normal.BufferObj->RefCount += step;
+ arrayObj->Color.BufferObj->RefCount += step;
+ arrayObj->SecondaryColor.BufferObj->RefCount += step;
+ arrayObj->FogCoord.BufferObj->RefCount += step;
+ arrayObj->Index.BufferObj->RefCount += step;
+ arrayObj->EdgeFlag.BufferObj->RefCount += step;
+ for (i = 0; i < Elements(arrayObj->TexCoord); i++)
+ arrayObj->TexCoord[i].BufferObj->RefCount += step;
+ for (i = 0; i < Elements(arrayObj->VertexAttrib); i++)
+ arrayObj->VertexAttrib[i].BufferObj->RefCount += step;
+}
+
+
+/**
+ * Copy gl_pixelstore_attrib from src to dst, updating buffer
+ * object refcounts.
+ */
+static void
+copy_pixelstore(struct gl_context *ctx,
+ struct gl_pixelstore_attrib *dst,
+ const struct gl_pixelstore_attrib *src)
+{
+ dst->Alignment = src->Alignment;
+ dst->RowLength = src->RowLength;
+ dst->SkipPixels = src->SkipPixels;
+ dst->SkipRows = src->SkipRows;
+ dst->ImageHeight = src->ImageHeight;
+ dst->SkipImages = src->SkipImages;
+ dst->SwapBytes = src->SwapBytes;
+ dst->LsbFirst = src->LsbFirst;
+ dst->ClientStorage = src->ClientStorage;
+ dst->Invert = src->Invert;
+ _mesa_reference_buffer_object(ctx, &dst->BufferObj, src->BufferObj);
+}
+
+
+#define GL_CLIENT_PACK_BIT (1<<20)
+#define GL_CLIENT_UNPACK_BIT (1<<21)
+
+
+void GLAPIENTRY
+_mesa_PushClientAttrib(GLbitfield mask)
+{
+ struct gl_attrib_node *head;
+
+ GET_CURRENT_CONTEXT(ctx);
+ ASSERT_OUTSIDE_BEGIN_END(ctx);
+
+ if (ctx->ClientAttribStackDepth >= MAX_CLIENT_ATTRIB_STACK_DEPTH) {
+ _mesa_error( ctx, GL_STACK_OVERFLOW, "glPushClientAttrib" );
+ return;
+ }
+
+ /* Build linked list of attribute nodes which save all attribute
+ * groups specified by the mask.
+ */
+ head = NULL;
+
+ if (mask & GL_CLIENT_PIXEL_STORE_BIT) {
+ struct gl_pixelstore_attrib *attr;
+ /* packing attribs */
+ attr = CALLOC_STRUCT( gl_pixelstore_attrib );
+ copy_pixelstore(ctx, attr, &ctx->Pack);
+ save_attrib_data(&head, GL_CLIENT_PACK_BIT, attr);
+ /* unpacking attribs */
+ attr = CALLOC_STRUCT( gl_pixelstore_attrib );
+ copy_pixelstore(ctx, attr, &ctx->Unpack);
+ save_attrib_data(&head, GL_CLIENT_UNPACK_BIT, attr);
+ }
+
+ if (mask & GL_CLIENT_VERTEX_ARRAY_BIT) {
+ struct gl_array_attrib *attr;
+ struct gl_array_object *obj;
+
+ attr = MALLOC_STRUCT( gl_array_attrib );
+ obj = MALLOC_STRUCT( gl_array_object );
+
+#if FEATURE_ARB_vertex_buffer_object
+ /* increment ref counts since we're copying pointers to these objects */
+ ctx->Array.ArrayBufferObj->RefCount++;
+ ctx->Array.ElementArrayBufferObj->RefCount++;
+#endif
+
+ memcpy( attr, &ctx->Array, sizeof(struct gl_array_attrib) );
+ memcpy( obj, ctx->Array.ArrayObj, sizeof(struct gl_array_object) );
+
+ attr->ArrayObj = obj;
+
+ save_attrib_data(&head, GL_CLIENT_VERTEX_ARRAY_BIT, attr);
+
+ /* bump reference counts on buffer objects */
+ adjust_buffer_object_ref_counts(ctx->Array.ArrayObj, 1);
+ }
+
+ ctx->ClientAttribStack[ctx->ClientAttribStackDepth] = head;
+ ctx->ClientAttribStackDepth++;
+}
+
+
+
+
+void GLAPIENTRY
+_mesa_PopClientAttrib(void)
+{
+ struct gl_attrib_node *node, *next;
+
+ GET_CURRENT_CONTEXT(ctx);
+ ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
+
+ if (ctx->ClientAttribStackDepth == 0) {
+ _mesa_error( ctx, GL_STACK_UNDERFLOW, "glPopClientAttrib" );
+ return;
+ }
+
+ ctx->ClientAttribStackDepth--;
+ node = ctx->ClientAttribStack[ctx->ClientAttribStackDepth];
+
+ while (node) {
+ switch (node->kind) {
+ case GL_CLIENT_PACK_BIT:
+ {
+ struct gl_pixelstore_attrib *store =
+ (struct gl_pixelstore_attrib *) node->data;
+ copy_pixelstore(ctx, &ctx->Pack, store);
+ _mesa_reference_buffer_object(ctx, &store->BufferObj, NULL);
+ }
+ ctx->NewState |= _NEW_PACKUNPACK;
+ break;
+ case GL_CLIENT_UNPACK_BIT:
+ {
+ struct gl_pixelstore_attrib *store =
+ (struct gl_pixelstore_attrib *) node->data;
+ copy_pixelstore(ctx, &ctx->Unpack, store);
+ _mesa_reference_buffer_object(ctx, &store->BufferObj, NULL);
+ }
+ ctx->NewState |= _NEW_PACKUNPACK;
+ break;
+ case GL_CLIENT_VERTEX_ARRAY_BIT: {
+ struct gl_array_attrib * data =
+ (struct gl_array_attrib *) node->data;
+
+ adjust_buffer_object_ref_counts(ctx->Array.ArrayObj, -1);
+
+ ctx->Array.ActiveTexture = data->ActiveTexture;
+ if (data->LockCount != 0)
+ _mesa_LockArraysEXT(data->LockFirst, data->LockCount);
+ else if (ctx->Array.LockCount)
+ _mesa_UnlockArraysEXT();
+
+ _mesa_BindVertexArrayAPPLE( data->ArrayObj->Name );
+
+#if FEATURE_ARB_vertex_buffer_object
+ _mesa_BindBufferARB(GL_ARRAY_BUFFER_ARB,
+ data->ArrayBufferObj->Name);
+ _mesa_BindBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB,
+ data->ElementArrayBufferObj->Name);
+#endif
+
+ memcpy( ctx->Array.ArrayObj, data->ArrayObj,
+ sizeof( struct gl_array_object ) );
+
+ FREE( data->ArrayObj );
+
+ /* FIXME: Should some bits in ctx->Array->NewState also be set
+ * FIXME: here? It seems like it should be set to inclusive-or
+ * FIXME: of the old ArrayObj->_Enabled and the new _Enabled.
+ */
+
+ ctx->NewState |= _NEW_ARRAY;
+ break;
+ }
+ default:
+ _mesa_problem( ctx, "Bad attrib flag in PopClientAttrib");
+ break;
+ }
+
+ next = node->next;
+ FREE( node->data );
+ FREE( node );
+ node = next;
+ }
+}
+
+
+void
+_mesa_init_attrib_dispatch(struct _glapi_table *disp)
+{
+ SET_PopAttrib(disp, _mesa_PopAttrib);
+ SET_PushAttrib(disp, _mesa_PushAttrib);
+ SET_PopClientAttrib(disp, _mesa_PopClientAttrib);
+ SET_PushClientAttrib(disp, _mesa_PushClientAttrib);
+}
+
+
+#endif /* FEATURE_attrib_stack */
+
+
+/**
+ * Free any attribute state data that might be attached to the context.
+ */
+void
+_mesa_free_attrib_data(struct gl_context *ctx)
+{
+ while (ctx->AttribStackDepth > 0) {
+ struct gl_attrib_node *attr, *next;
+
+ ctx->AttribStackDepth--;
+ attr = ctx->AttribStack[ctx->AttribStackDepth];
+
+ while (attr) {
+ if (attr->kind == GL_TEXTURE_BIT) {
+ struct texture_state *texstate = (struct texture_state*)attr->data;
+ GLuint u, tgt;
+ /* clear references to the saved texture objects */
+ for (u = 0; u < ctx->Const.MaxTextureUnits; u++) {
+ for (tgt = 0; tgt < NUM_TEXTURE_TARGETS; tgt++) {
+ _mesa_reference_texobj(&texstate->SavedTexRef[u][tgt], NULL);
+ }
+ }
+ }
+ else {
+ /* any other chunks of state that requires special handling? */
+ }
+
+ next = attr->next;
+ free(attr->data);
+ free(attr);
+ attr = next;
+ }
+ }
+}
+
+
+void _mesa_init_attrib( struct gl_context *ctx )
+{
+ /* Renderer and client attribute stacks */
+ ctx->AttribStackDepth = 0;
+ ctx->ClientAttribStackDepth = 0;
+}
diff --git a/mesalib/src/mesa/main/bufferobj.c b/mesalib/src/mesa/main/bufferobj.c
index 308555570..31faaebd4 100644
--- a/mesalib/src/mesa/main/bufferobj.c
+++ b/mesalib/src/mesa/main/bufferobj.c
@@ -202,7 +202,7 @@ buffer_object_subdata_range_good( struct gl_context * ctx, GLenum target,
*
* Default callback for the \c dd_function_table::NewBufferObject() hook.
*/
-static struct gl_buffer_object *
+struct gl_buffer_object *
_mesa_new_buffer_object( struct gl_context *ctx, GLuint name, GLenum target )
{
struct gl_buffer_object *obj;
@@ -220,7 +220,7 @@ _mesa_new_buffer_object( struct gl_context *ctx, GLuint name, GLenum target )
*
* Default callback for the \c dd_function_table::DeleteBuffer() hook.
*/
-static void
+void
_mesa_delete_buffer_object(struct gl_context *ctx,
struct gl_buffer_object *bufObj)
{
@@ -342,7 +342,7 @@ _mesa_initialize_buffer_object( struct gl_buffer_object *obj,
* \return GL_TRUE for success, GL_FALSE for failure
* \sa glBufferDataARB, dd_function_table::BufferData.
*/
-static GLboolean
+GLboolean
_mesa_buffer_data( struct gl_context *ctx, GLenum target, GLsizeiptrARB size,
const GLvoid * data, GLenum usage,
struct gl_buffer_object * bufObj )
@@ -386,7 +386,7 @@ _mesa_buffer_data( struct gl_context *ctx, GLenum target, GLsizeiptrARB size,
*
* \sa glBufferSubDataARB, dd_function_table::BufferSubData.
*/
-static void
+void
_mesa_buffer_subdata( struct gl_context *ctx, GLenum target, GLintptrARB offset,
GLsizeiptrARB size, const GLvoid * data,
struct gl_buffer_object * bufObj )
@@ -419,7 +419,7 @@ _mesa_buffer_subdata( struct gl_context *ctx, GLenum target, GLintptrARB offset,
*
* \sa glBufferGetSubDataARB, dd_function_table::GetBufferSubData.
*/
-static void
+void
_mesa_buffer_get_subdata( struct gl_context *ctx,
GLenum target, GLintptrARB offset,
GLsizeiptrARB size, GLvoid * data,
@@ -447,7 +447,7 @@ _mesa_buffer_get_subdata( struct gl_context *ctx,
*
* \sa glMapBufferARB, dd_function_table::MapBuffer
*/
-static void *
+void *
_mesa_buffer_map( struct gl_context *ctx, GLenum target, GLenum access,
struct gl_buffer_object *bufObj )
{
@@ -512,7 +512,7 @@ _mesa_buffer_flush_mapped_range( struct gl_context *ctx, GLenum target,
*
* \sa glUnmapBufferARB, dd_function_table::UnmapBuffer
*/
-static GLboolean
+GLboolean
_mesa_buffer_unmap( struct gl_context *ctx, GLenum target,
struct gl_buffer_object *bufObj )
{
diff --git a/mesalib/src/mesa/main/bufferobj.h b/mesalib/src/mesa/main/bufferobj.h
index 91fa073b6..f673f431f 100644
--- a/mesalib/src/mesa/main/bufferobj.h
+++ b/mesalib/src/mesa/main/bufferobj.h
@@ -1,149 +1,149 @@
-/*
- * Mesa 3-D graphics library
- * Version: 7.6
- *
- * Copyright (C) 1999-2008 Brian Paul All Rights Reserved.
- * Copyright (C) 2009 VMware, Inc. All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-
-
-#ifndef BUFFEROBJ_H
-#define BUFFEROBJ_H
-
-
-#include "mfeatures.h"
-#include "mtypes.h"
-
-
-/*
- * Internal functions
- */
-
-
-/** Is the given buffer object currently mapped? */
-static INLINE GLboolean
-_mesa_bufferobj_mapped(const struct gl_buffer_object *obj)
-{
- return obj->Pointer != NULL;
-}
-
-/**
- * Is the given buffer object a user-created buffer object?
- * Mesa uses default buffer objects in several places. Default buffers
- * always have Name==0. User created buffers have Name!=0.
- */
-static INLINE GLboolean
-_mesa_is_bufferobj(const struct gl_buffer_object *obj)
-{
- return obj->Name != 0;
-}
-
-
-extern void
-_mesa_init_buffer_objects( struct gl_context *ctx );
-
-extern void
-_mesa_free_buffer_objects( struct gl_context *ctx );
-
-extern void
-_mesa_update_default_objects_buffer_objects(struct gl_context *ctx);
-
-
-extern struct gl_buffer_object *
-_mesa_lookup_bufferobj(struct gl_context *ctx, GLuint buffer);
-
-extern void
-_mesa_initialize_buffer_object( struct gl_buffer_object *obj,
- GLuint name, GLenum target );
-
-extern void
-_mesa_reference_buffer_object(struct gl_context *ctx,
- struct gl_buffer_object **ptr,
- struct gl_buffer_object *bufObj);
-
-extern void
-_mesa_init_buffer_object_functions(struct dd_function_table *driver);
-
-
-/*
- * API functions
- */
-
-extern void GLAPIENTRY
-_mesa_BindBufferARB(GLenum target, GLuint buffer);
-
-extern void GLAPIENTRY
-_mesa_DeleteBuffersARB(GLsizei n, const GLuint * buffer);
-
-extern void GLAPIENTRY
-_mesa_GenBuffersARB(GLsizei n, GLuint * buffer);
-
-extern GLboolean GLAPIENTRY
-_mesa_IsBufferARB(GLuint buffer);
-
-extern void GLAPIENTRY
-_mesa_BufferDataARB(GLenum target, GLsizeiptrARB size, const GLvoid * data, GLenum usage);
-
-extern void GLAPIENTRY
-_mesa_BufferSubDataARB(GLenum target, GLintptrARB offset, GLsizeiptrARB size, const GLvoid * data);
-
-extern void GLAPIENTRY
-_mesa_GetBufferSubDataARB(GLenum target, GLintptrARB offset, GLsizeiptrARB size, void * data);
-
-extern void * GLAPIENTRY
-_mesa_MapBufferARB(GLenum target, GLenum access);
-
-extern GLboolean GLAPIENTRY
-_mesa_UnmapBufferARB(GLenum target);
-
-extern void GLAPIENTRY
-_mesa_GetBufferParameterivARB(GLenum target, GLenum pname, GLint *params);
-
-extern void GLAPIENTRY
-_mesa_GetBufferParameteri64v(GLenum target, GLenum pname, GLint64 *params);
-
-extern void GLAPIENTRY
-_mesa_GetBufferPointervARB(GLenum target, GLenum pname, GLvoid **params);
-
-extern void GLAPIENTRY
-_mesa_CopyBufferSubData(GLenum readTarget, GLenum writeTarget,
- GLintptr readOffset, GLintptr writeOffset,
- GLsizeiptr size);
-
-extern void * GLAPIENTRY
-_mesa_MapBufferRange(GLenum target, GLintptr offset, GLsizeiptr length,
- GLbitfield access);
-
-extern void GLAPIENTRY
-_mesa_FlushMappedBufferRange(GLenum target, GLintptr offset, GLsizeiptr length);
-
-#if FEATURE_APPLE_object_purgeable
-extern GLenum GLAPIENTRY
-_mesa_ObjectPurgeableAPPLE(GLenum objectType, GLuint name, GLenum option);
-
-extern GLenum GLAPIENTRY
-_mesa_ObjectUnpurgeableAPPLE(GLenum objectType, GLuint name, GLenum option);
-
-extern void GLAPIENTRY
-_mesa_GetObjectParameterivAPPLE(GLenum objectType, GLuint name, GLenum pname, GLint* params);
-#endif
-
-#endif
+/*
+ * Mesa 3-D graphics library
+ * Version: 7.6
+ *
+ * Copyright (C) 1999-2008 Brian Paul All Rights Reserved.
+ * Copyright (C) 2009 VMware, Inc. All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+
+
+#ifndef BUFFEROBJ_H
+#define BUFFEROBJ_H
+
+
+#include "mfeatures.h"
+#include "mtypes.h"
+
+
+/*
+ * Internal functions
+ */
+
+
+/** Is the given buffer object currently mapped? */
+static INLINE GLboolean
+_mesa_bufferobj_mapped(const struct gl_buffer_object *obj)
+{
+ return obj->Pointer != NULL;
+}
+
+/**
+ * Is the given buffer object a user-created buffer object?
+ * Mesa uses default buffer objects in several places. Default buffers
+ * always have Name==0. User created buffers have Name!=0.
+ */
+static INLINE GLboolean
+_mesa_is_bufferobj(const struct gl_buffer_object *obj)
+{
+ return obj->Name != 0;
+}
+
+
+extern void
+_mesa_init_buffer_objects( struct gl_context *ctx );
+
+extern void
+_mesa_free_buffer_objects( struct gl_context *ctx );
+
+extern void
+_mesa_update_default_objects_buffer_objects(struct gl_context *ctx);
+
+
+extern struct gl_buffer_object *
+_mesa_lookup_bufferobj(struct gl_context *ctx, GLuint buffer);
+
+extern void
+_mesa_initialize_buffer_object( struct gl_buffer_object *obj,
+ GLuint name, GLenum target );
+
+extern void
+_mesa_reference_buffer_object(struct gl_context *ctx,
+ struct gl_buffer_object **ptr,
+ struct gl_buffer_object *bufObj);
+
+extern void
+_mesa_init_buffer_object_functions(struct dd_function_table *driver);
+
+
+/*
+ * API functions
+ */
+
+extern void GLAPIENTRY
+_mesa_BindBufferARB(GLenum target, GLuint buffer);
+
+extern void GLAPIENTRY
+_mesa_DeleteBuffersARB(GLsizei n, const GLuint * buffer);
+
+extern void GLAPIENTRY
+_mesa_GenBuffersARB(GLsizei n, GLuint * buffer);
+
+extern GLboolean GLAPIENTRY
+_mesa_IsBufferARB(GLuint buffer);
+
+extern void GLAPIENTRY
+_mesa_BufferDataARB(GLenum target, GLsizeiptrARB size, const GLvoid * data, GLenum usage);
+
+extern void GLAPIENTRY
+_mesa_BufferSubDataARB(GLenum target, GLintptrARB offset, GLsizeiptrARB size, const GLvoid * data);
+
+extern void GLAPIENTRY
+_mesa_GetBufferSubDataARB(GLenum target, GLintptrARB offset, GLsizeiptrARB size, void * data);
+
+extern void * GLAPIENTRY
+_mesa_MapBufferARB(GLenum target, GLenum access);
+
+extern GLboolean GLAPIENTRY
+_mesa_UnmapBufferARB(GLenum target);
+
+extern void GLAPIENTRY
+_mesa_GetBufferParameterivARB(GLenum target, GLenum pname, GLint *params);
+
+extern void GLAPIENTRY
+_mesa_GetBufferParameteri64v(GLenum target, GLenum pname, GLint64 *params);
+
+extern void GLAPIENTRY
+_mesa_GetBufferPointervARB(GLenum target, GLenum pname, GLvoid **params);
+
+extern void GLAPIENTRY
+_mesa_CopyBufferSubData(GLenum readTarget, GLenum writeTarget,
+ GLintptr readOffset, GLintptr writeOffset,
+ GLsizeiptr size);
+
+extern void * GLAPIENTRY
+_mesa_MapBufferRange(GLenum target, GLintptr offset, GLsizeiptr length,
+ GLbitfield access);
+
+extern void GLAPIENTRY
+_mesa_FlushMappedBufferRange(GLenum target, GLintptr offset, GLsizeiptr length);
+
+#if FEATURE_APPLE_object_purgeable
+extern GLenum GLAPIENTRY
+_mesa_ObjectPurgeableAPPLE(GLenum objectType, GLuint name, GLenum option);
+
+extern GLenum GLAPIENTRY
+_mesa_ObjectUnpurgeableAPPLE(GLenum objectType, GLuint name, GLenum option);
+
+extern void GLAPIENTRY
+_mesa_GetObjectParameterivAPPLE(GLenum objectType, GLuint name, GLenum pname, GLint* params);
+#endif
+
+#endif
diff --git a/mesalib/src/mesa/main/clear.c b/mesalib/src/mesa/main/clear.c
index fa95e4522..449a8d6ec 100644
--- a/mesalib/src/mesa/main/clear.c
+++ b/mesalib/src/mesa/main/clear.c
@@ -1,575 +1,575 @@
-/*
- * Mesa 3-D graphics library
- * Version: 7.1
- *
- * Copyright (C) 1999-2007 Brian Paul All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-
-/**
- * \file clear.c
- * glClearColor, glClearIndex, glClear() functions.
- */
-
-
-
-#include "glheader.h"
-#include "clear.h"
-#include "context.h"
-#include "colormac.h"
-#include "enums.h"
-#include "macros.h"
-#include "mtypes.h"
-#include "state.h"
-
-
-
-#if _HAVE_FULL_GL
-void GLAPIENTRY
-_mesa_ClearIndex( GLfloat c )
-{
- GET_CURRENT_CONTEXT(ctx);
- ASSERT_OUTSIDE_BEGIN_END(ctx);
-
- if (ctx->Color.ClearIndex == (GLuint) c)
- return;
-
- FLUSH_VERTICES(ctx, _NEW_COLOR);
- ctx->Color.ClearIndex = (GLuint) c;
-}
-#endif
-
-
-/**
- * Specify the clear values for the color buffers.
- *
- * \param red red color component.
- * \param green green color component.
- * \param blue blue color component.
- * \param alpha alpha component.
- *
- * \sa glClearColor().
- *
- * Clamps the parameters and updates gl_colorbuffer_attrib::ClearColor. On a
- * change, flushes the vertices and notifies the driver via the
- * dd_function_table::ClearColor callback.
- */
-void GLAPIENTRY
-_mesa_ClearColor( GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha )
-{
- GLfloat tmp[4];
- GET_CURRENT_CONTEXT(ctx);
- ASSERT_OUTSIDE_BEGIN_END(ctx);
-
- tmp[0] = red;
- tmp[1] = green;
- tmp[2] = blue;
- tmp[3] = alpha;
-
- if (TEST_EQ_4V(tmp, ctx->Color.ClearColorUnclamped))
- return; /* no change */
-
- FLUSH_VERTICES(ctx, _NEW_COLOR);
- COPY_4V(ctx->Color.ClearColorUnclamped, tmp);
-
- ctx->Color.ClearColor[0] = CLAMP(tmp[0], 0.0F, 1.0F);
- ctx->Color.ClearColor[1] = CLAMP(tmp[1], 0.0F, 1.0F);
- ctx->Color.ClearColor[2] = CLAMP(tmp[2], 0.0F, 1.0F);
- ctx->Color.ClearColor[3] = CLAMP(tmp[3], 0.0F, 1.0F);
-
- if (ctx->Driver.ClearColor) {
- /* it's OK to call glClearColor in CI mode but it should be a NOP */
- /* we pass the clamped color, since all drivers that need this don't
- * support GL_ARB_color_buffer_float
- */
- (*ctx->Driver.ClearColor)(ctx, ctx->Color.ClearColor);
- }
-}
-
-
-/**
- * GL_EXT_texture_integer
- */
-void GLAPIENTRY
-_mesa_ClearColorIiEXT(GLint r, GLint g, GLint b, GLint a)
-{
- GLfloat tmp[4];
- GET_CURRENT_CONTEXT(ctx);
- ASSERT_OUTSIDE_BEGIN_END(ctx);
-
- tmp[0] = (GLfloat) r;
- tmp[1] = (GLfloat) g;
- tmp[2] = (GLfloat) b;
- tmp[3] = (GLfloat) a;
-
- if (TEST_EQ_4V(tmp, ctx->Color.ClearColor))
- return; /* no change */
-
- FLUSH_VERTICES(ctx, _NEW_COLOR);
-
- /* XXX we should eventually have a float/int/uint union for
- * the ctx->Color.ClearColor state.
- */
- COPY_4V(ctx->Color.ClearColor, tmp);
-
- if (ctx->Driver.ClearColor) {
- ctx->Driver.ClearColor(ctx, ctx->Color.ClearColor);
- }
-}
-
-
-/**
- * GL_EXT_texture_integer
- */
-void GLAPIENTRY
-_mesa_ClearColorIuiEXT(GLuint r, GLuint g, GLuint b, GLuint a)
-{
- GLfloat tmp[4];
- GET_CURRENT_CONTEXT(ctx);
- ASSERT_OUTSIDE_BEGIN_END(ctx);
-
- tmp[0] = (GLfloat) r;
- tmp[1] = (GLfloat) g;
- tmp[2] = (GLfloat) b;
- tmp[3] = (GLfloat) a;
-
- if (TEST_EQ_4V(tmp, ctx->Color.ClearColor))
- return; /* no change */
-
- FLUSH_VERTICES(ctx, _NEW_COLOR);
-
- /* XXX we should eventually have a float/int/uint union for
- * the ctx->Color.ClearColor state.
- */
- COPY_4V(ctx->Color.ClearColor, tmp);
-
- if (ctx->Driver.ClearColor) {
- ctx->Driver.ClearColor(ctx, ctx->Color.ClearColor);
- }
-}
-
-
-/**
- * Clear buffers.
- *
- * \param mask bit-mask indicating the buffers to be cleared.
- *
- * Flushes the vertices and verifies the parameter. If __struct gl_contextRec::NewState
- * is set then calls _mesa_update_state() to update gl_frame_buffer::_Xmin,
- * etc. If the rasterization mode is set to GL_RENDER then requests the driver
- * to clear the buffers, via the dd_function_table::Clear callback.
- */
-void GLAPIENTRY
-_mesa_Clear( GLbitfield mask )
-{
- GET_CURRENT_CONTEXT(ctx);
- ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
-
- FLUSH_CURRENT(ctx, 0);
-
- if (MESA_VERBOSE & VERBOSE_API)
- _mesa_debug(ctx, "glClear 0x%x\n", mask);
-
- if (mask & ~(GL_COLOR_BUFFER_BIT |
- GL_DEPTH_BUFFER_BIT |
- GL_STENCIL_BUFFER_BIT |
- GL_ACCUM_BUFFER_BIT)) {
- /* invalid bit set */
- _mesa_error( ctx, GL_INVALID_VALUE, "glClear(0x%x)", mask);
- return;
- }
-
- if (ctx->NewState) {
- _mesa_update_state( ctx ); /* update _Xmin, etc */
- }
-
- if (ctx->DrawBuffer->_Status != GL_FRAMEBUFFER_COMPLETE_EXT) {
- _mesa_error(ctx, GL_INVALID_FRAMEBUFFER_OPERATION_EXT,
- "glClear(incomplete framebuffer)");
- return;
- }
-
- if (ctx->DrawBuffer->Width == 0 || ctx->DrawBuffer->Height == 0 ||
- ctx->DrawBuffer->_Xmin >= ctx->DrawBuffer->_Xmax ||
- ctx->DrawBuffer->_Ymin >= ctx->DrawBuffer->_Ymax)
- return;
-
- if (ctx->RenderMode == GL_RENDER) {
- GLbitfield bufferMask;
-
- /* don't clear depth buffer if depth writing disabled */
- if (!ctx->Depth.Mask)
- mask &= ~GL_DEPTH_BUFFER_BIT;
-
- /* Build the bitmask to send to device driver's Clear function.
- * Note that the GL_COLOR_BUFFER_BIT flag will expand to 0, 1, 2 or 4
- * of the BUFFER_BIT_FRONT/BACK_LEFT/RIGHT flags, or one of the
- * BUFFER_BIT_COLORn flags.
- */
- bufferMask = 0;
- if (mask & GL_COLOR_BUFFER_BIT) {
- GLuint i;
- for (i = 0; i < ctx->DrawBuffer->_NumColorDrawBuffers; i++) {
- bufferMask |= (1 << ctx->DrawBuffer->_ColorDrawBufferIndexes[i]);
- }
- }
-
- if ((mask & GL_DEPTH_BUFFER_BIT)
- && ctx->DrawBuffer->Visual.haveDepthBuffer) {
- bufferMask |= BUFFER_BIT_DEPTH;
- }
-
- if ((mask & GL_STENCIL_BUFFER_BIT)
- && ctx->DrawBuffer->Visual.haveStencilBuffer) {
- bufferMask |= BUFFER_BIT_STENCIL;
- }
-
- if ((mask & GL_ACCUM_BUFFER_BIT)
- && ctx->DrawBuffer->Visual.haveAccumBuffer) {
- bufferMask |= BUFFER_BIT_ACCUM;
- }
-
- ASSERT(ctx->Driver.Clear);
- ctx->Driver.Clear(ctx, bufferMask);
- }
-}
-
-
-/** Returned by make_color_buffer_mask() for errors */
-#define INVALID_MASK ~0x0
-
-
-/**
- * Convert the glClearBuffer 'drawbuffer' parameter into a bitmask of
- * BUFFER_BIT_x values.
- * Return INVALID_MASK if the drawbuffer value is invalid.
- */
-static GLbitfield
-make_color_buffer_mask(struct gl_context *ctx, GLint drawbuffer)
-{
- const struct gl_renderbuffer_attachment *att = ctx->DrawBuffer->Attachment;
- GLbitfield mask = 0x0;
-
- switch (drawbuffer) {
- case GL_FRONT:
- if (att[BUFFER_FRONT_LEFT].Renderbuffer)
- mask |= BUFFER_BIT_FRONT_LEFT;
- if (att[BUFFER_FRONT_RIGHT].Renderbuffer)
- mask |= BUFFER_BIT_FRONT_RIGHT;
- break;
- case GL_BACK:
- if (att[BUFFER_BACK_LEFT].Renderbuffer)
- mask |= BUFFER_BIT_BACK_LEFT;
- if (att[BUFFER_BACK_RIGHT].Renderbuffer)
- mask |= BUFFER_BIT_BACK_RIGHT;
- break;
- case GL_LEFT:
- if (att[BUFFER_FRONT_LEFT].Renderbuffer)
- mask |= BUFFER_BIT_FRONT_LEFT;
- if (att[BUFFER_BACK_LEFT].Renderbuffer)
- mask |= BUFFER_BIT_BACK_LEFT;
- break;
- case GL_RIGHT:
- if (att[BUFFER_FRONT_RIGHT].Renderbuffer)
- mask |= BUFFER_BIT_FRONT_RIGHT;
- if (att[BUFFER_BACK_RIGHT].Renderbuffer)
- mask |= BUFFER_BIT_BACK_RIGHT;
- break;
- case GL_FRONT_AND_BACK:
- if (att[BUFFER_FRONT_LEFT].Renderbuffer)
- mask |= BUFFER_BIT_FRONT_LEFT;
- if (att[BUFFER_BACK_LEFT].Renderbuffer)
- mask |= BUFFER_BIT_BACK_LEFT;
- if (att[BUFFER_FRONT_RIGHT].Renderbuffer)
- mask |= BUFFER_BIT_FRONT_RIGHT;
- if (att[BUFFER_BACK_RIGHT].Renderbuffer)
- mask |= BUFFER_BIT_BACK_RIGHT;
- break;
- default:
- if (drawbuffer < 0 || drawbuffer >= (GLint)ctx->Const.MaxDrawBuffers) {
- mask = INVALID_MASK;
- }
- else if (att[BUFFER_COLOR0 + drawbuffer].Renderbuffer) {
- mask |= (BUFFER_BIT_COLOR0 << drawbuffer);
- }
- }
-
- return mask;
-}
-
-
-
-/**
- * New in GL 3.0
- * Clear signed integer color buffer or stencil buffer (not depth).
- */
-void GLAPIENTRY
-_mesa_ClearBufferiv(GLenum buffer, GLint drawbuffer, const GLint *value)
-{
- GET_CURRENT_CONTEXT(ctx);
- ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
-
- FLUSH_CURRENT(ctx, 0);
-
- if (ctx->NewState) {
- _mesa_update_state( ctx );
- }
-
- switch (buffer) {
- case GL_STENCIL:
- if (drawbuffer != 0) {
- _mesa_error(ctx, GL_INVALID_VALUE, "glClearBufferiv(drawbuffer=%d)",
- drawbuffer);
- return;
- }
- else {
- /* Save current stencil clear value, set to 'value', do the
- * stencil clear and restore the clear value.
- * XXX in the future we may have a new ctx->Driver.ClearBuffer()
- * hook instead.
- */
- const GLuint clearSave = ctx->Stencil.Clear;
- ctx->Stencil.Clear = *value;
- if (ctx->Driver.ClearStencil)
- ctx->Driver.ClearStencil(ctx, *value);
- ctx->Driver.Clear(ctx, BUFFER_BIT_STENCIL);
- ctx->Stencil.Clear = clearSave;
- if (ctx->Driver.ClearStencil)
- ctx->Driver.ClearStencil(ctx, clearSave);
- }
- break;
- case GL_COLOR:
- {
- const GLbitfield mask = make_color_buffer_mask(ctx, drawbuffer);
- if (mask == INVALID_MASK) {
- _mesa_error(ctx, GL_INVALID_VALUE, "glClearBufferiv(drawbuffer=%d)",
- drawbuffer);
- return;
- }
- else if (mask) {
- /* XXX note: we're putting the integer clear values into the
- * floating point state var. This will not always work. We'll
- * need a new ctx->Driver.ClearBuffer() hook....
- */
- GLclampf clearSave[4];
- /* save color */
- COPY_4V(clearSave, ctx->Color.ClearColor);
- /* set color */
- COPY_4V_CAST(ctx->Color.ClearColor, value, GLclampf);
- if (ctx->Driver.ClearColor)
- ctx->Driver.ClearColor(ctx, ctx->Color.ClearColor);
- /* clear buffer(s) */
- ctx->Driver.Clear(ctx, mask);
- /* restore color */
- COPY_4V(ctx->Color.ClearColor, clearSave);
- if (ctx->Driver.ClearColor)
- ctx->Driver.ClearColor(ctx, clearSave);
- }
- }
- break;
- default:
- _mesa_error(ctx, GL_INVALID_ENUM, "glClearBufferiv(buffer=%s)",
- _mesa_lookup_enum_by_nr(buffer));
- return;
- }
-}
-
-
-/**
- * New in GL 3.0
- * Clear unsigned integer color buffer (not depth, not stencil).
- */
-void GLAPIENTRY
-_mesa_ClearBufferuiv(GLenum buffer, GLint drawbuffer, const GLuint *value)
-{
- GET_CURRENT_CONTEXT(ctx);
- ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
-
- FLUSH_CURRENT(ctx, 0);
-
- if (ctx->NewState) {
- _mesa_update_state( ctx );
- }
-
- switch (buffer) {
- case GL_COLOR:
- {
- const GLbitfield mask = make_color_buffer_mask(ctx, drawbuffer);
- if (mask == INVALID_MASK) {
- _mesa_error(ctx, GL_INVALID_VALUE, "glClearBufferuiv(drawbuffer=%d)",
- drawbuffer);
- return;
- }
- else if (mask) {
- /* XXX note: we're putting the uint clear values into the
- * floating point state var. This will not always work. We'll
- * need a new ctx->Driver.ClearBuffer() hook....
- */
- GLclampf clearSave[4];
- /* save color */
- COPY_4V(clearSave, ctx->Color.ClearColor);
- /* set color */
- COPY_4V_CAST(ctx->Color.ClearColor, value, GLclampf);
- if (ctx->Driver.ClearColor)
- ctx->Driver.ClearColor(ctx, ctx->Color.ClearColor);
- /* clear buffer(s) */
- ctx->Driver.Clear(ctx, mask);
- /* restore color */
- COPY_4V(ctx->Color.ClearColor, clearSave);
- if (ctx->Driver.ClearColor)
- ctx->Driver.ClearColor(ctx, clearSave);
- }
- }
- break;
- default:
- _mesa_error(ctx, GL_INVALID_ENUM, "glClearBufferuiv(buffer=%s)",
- _mesa_lookup_enum_by_nr(buffer));
- return;
- }
-}
-
-
-/**
- * New in GL 3.0
- * Clear fixed-pt or float color buffer or depth buffer (not stencil).
- */
-void GLAPIENTRY
-_mesa_ClearBufferfv(GLenum buffer, GLint drawbuffer, const GLfloat *value)
-{
- GET_CURRENT_CONTEXT(ctx);
- ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
-
- FLUSH_CURRENT(ctx, 0);
-
- if (ctx->NewState) {
- _mesa_update_state( ctx );
- }
-
- switch (buffer) {
- case GL_DEPTH:
- if (drawbuffer != 0) {
- _mesa_error(ctx, GL_INVALID_VALUE, "glClearBufferfv(drawbuffer=%d)",
- drawbuffer);
- return;
- }
- else {
- /* Save current depth clear value, set to 'value', do the
- * depth clear and restore the clear value.
- * XXX in the future we may have a new ctx->Driver.ClearBuffer()
- * hook instead.
- */
- const GLclampd clearSave = ctx->Depth.Clear;
- ctx->Depth.Clear = *value;
- if (ctx->Driver.ClearDepth)
- ctx->Driver.ClearDepth(ctx, *value);
- ctx->Driver.Clear(ctx, BUFFER_BIT_DEPTH);
- ctx->Depth.Clear = clearSave;
- if (ctx->Driver.ClearDepth)
- ctx->Driver.ClearDepth(ctx, clearSave);
- }
- /* clear depth buffer to value */
- break;
- case GL_COLOR:
- {
- const GLbitfield mask = make_color_buffer_mask(ctx, drawbuffer);
- if (mask == INVALID_MASK) {
- _mesa_error(ctx, GL_INVALID_VALUE, "glClearBufferfv(drawbuffer=%d)",
- drawbuffer);
- return;
- }
- else if (mask) {
- GLclampf clearSave[4];
- /* save color */
- COPY_4V(clearSave, ctx->Color.ClearColor);
- /* set color */
- COPY_4V_CAST(ctx->Color.ClearColor, value, GLclampf);
- if (ctx->Driver.ClearColor)
- ctx->Driver.ClearColor(ctx, ctx->Color.ClearColor);
- /* clear buffer(s) */
- ctx->Driver.Clear(ctx, mask);
- /* restore color */
- COPY_4V(ctx->Color.ClearColor, clearSave);
- if (ctx->Driver.ClearColor)
- ctx->Driver.ClearColor(ctx, clearSave);
- }
- }
- break;
- default:
- _mesa_error(ctx, GL_INVALID_ENUM, "glClearBufferfv(buffer=%s)",
- _mesa_lookup_enum_by_nr(buffer));
- return;
- }
-}
-
-
-/**
- * New in GL 3.0
- * Clear depth/stencil buffer only.
- */
-void GLAPIENTRY
-_mesa_ClearBufferfi(GLenum buffer, GLint drawbuffer,
- GLfloat depth, GLint stencil)
-{
- GET_CURRENT_CONTEXT(ctx);
- ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
-
- FLUSH_CURRENT(ctx, 0);
-
- if (buffer != GL_DEPTH_STENCIL) {
- _mesa_error(ctx, GL_INVALID_ENUM, "glClearBufferfi(buffer=%s)",
- _mesa_lookup_enum_by_nr(buffer));
- return;
- }
-
- if (drawbuffer != 0) {
- _mesa_error(ctx, GL_INVALID_VALUE, "glClearBufferfi(drawbuffer=%d)",
- drawbuffer);
- return;
- }
-
- if (ctx->NewState) {
- _mesa_update_state( ctx );
- }
-
- {
- /* save current clear values */
- const GLclampd clearDepthSave = ctx->Depth.Clear;
- const GLuint clearStencilSave = ctx->Stencil.Clear;
-
- /* set new clear values */
- ctx->Depth.Clear = depth;
- ctx->Stencil.Clear = stencil;
- if (ctx->Driver.ClearDepth)
- ctx->Driver.ClearDepth(ctx, depth);
- if (ctx->Driver.ClearStencil)
- ctx->Driver.ClearStencil(ctx, stencil);
-
- /* clear buffers */
- ctx->Driver.Clear(ctx, BUFFER_BIT_DEPTH | BUFFER_BIT_STENCIL);
-
- /* restore */
- ctx->Depth.Clear = clearDepthSave;
- ctx->Stencil.Clear = clearStencilSave;
- if (ctx->Driver.ClearDepth)
- ctx->Driver.ClearDepth(ctx, clearDepthSave);
- if (ctx->Driver.ClearStencil)
- ctx->Driver.ClearStencil(ctx, clearStencilSave);
- }
-}
+/*
+ * Mesa 3-D graphics library
+ * Version: 7.1
+ *
+ * Copyright (C) 1999-2007 Brian Paul All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+
+/**
+ * \file clear.c
+ * glClearColor, glClearIndex, glClear() functions.
+ */
+
+
+
+#include "glheader.h"
+#include "clear.h"
+#include "context.h"
+#include "colormac.h"
+#include "enums.h"
+#include "macros.h"
+#include "mtypes.h"
+#include "state.h"
+
+
+
+#if _HAVE_FULL_GL
+void GLAPIENTRY
+_mesa_ClearIndex( GLfloat c )
+{
+ GET_CURRENT_CONTEXT(ctx);
+ ASSERT_OUTSIDE_BEGIN_END(ctx);
+
+ if (ctx->Color.ClearIndex == (GLuint) c)
+ return;
+
+ FLUSH_VERTICES(ctx, _NEW_COLOR);
+ ctx->Color.ClearIndex = (GLuint) c;
+}
+#endif
+
+
+/**
+ * Specify the clear values for the color buffers.
+ *
+ * \param red red color component.
+ * \param green green color component.
+ * \param blue blue color component.
+ * \param alpha alpha component.
+ *
+ * \sa glClearColor().
+ *
+ * Clamps the parameters and updates gl_colorbuffer_attrib::ClearColor. On a
+ * change, flushes the vertices and notifies the driver via the
+ * dd_function_table::ClearColor callback.
+ */
+void GLAPIENTRY
+_mesa_ClearColor( GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha )
+{
+ GLfloat tmp[4];
+ GET_CURRENT_CONTEXT(ctx);
+ ASSERT_OUTSIDE_BEGIN_END(ctx);
+
+ tmp[0] = red;
+ tmp[1] = green;
+ tmp[2] = blue;
+ tmp[3] = alpha;
+
+ if (TEST_EQ_4V(tmp, ctx->Color.ClearColorUnclamped))
+ return; /* no change */
+
+ FLUSH_VERTICES(ctx, _NEW_COLOR);
+ COPY_4V(ctx->Color.ClearColorUnclamped, tmp);
+
+ ctx->Color.ClearColor[0] = CLAMP(tmp[0], 0.0F, 1.0F);
+ ctx->Color.ClearColor[1] = CLAMP(tmp[1], 0.0F, 1.0F);
+ ctx->Color.ClearColor[2] = CLAMP(tmp[2], 0.0F, 1.0F);
+ ctx->Color.ClearColor[3] = CLAMP(tmp[3], 0.0F, 1.0F);
+
+ if (ctx->Driver.ClearColor) {
+ /* it's OK to call glClearColor in CI mode but it should be a NOP */
+ /* we pass the clamped color, since all drivers that need this don't
+ * support GL_ARB_color_buffer_float
+ */
+ (*ctx->Driver.ClearColor)(ctx, ctx->Color.ClearColor);
+ }
+}
+
+
+/**
+ * GL_EXT_texture_integer
+ */
+void GLAPIENTRY
+_mesa_ClearColorIiEXT(GLint r, GLint g, GLint b, GLint a)
+{
+ GLfloat tmp[4];
+ GET_CURRENT_CONTEXT(ctx);
+ ASSERT_OUTSIDE_BEGIN_END(ctx);
+
+ tmp[0] = (GLfloat) r;
+ tmp[1] = (GLfloat) g;
+ tmp[2] = (GLfloat) b;
+ tmp[3] = (GLfloat) a;
+
+ if (TEST_EQ_4V(tmp, ctx->Color.ClearColor))
+ return; /* no change */
+
+ FLUSH_VERTICES(ctx, _NEW_COLOR);
+
+ /* XXX we should eventually have a float/int/uint union for
+ * the ctx->Color.ClearColor state.
+ */
+ COPY_4V(ctx->Color.ClearColor, tmp);
+
+ if (ctx->Driver.ClearColor) {
+ ctx->Driver.ClearColor(ctx, ctx->Color.ClearColor);
+ }
+}
+
+
+/**
+ * GL_EXT_texture_integer
+ */
+void GLAPIENTRY
+_mesa_ClearColorIuiEXT(GLuint r, GLuint g, GLuint b, GLuint a)
+{
+ GLfloat tmp[4];
+ GET_CURRENT_CONTEXT(ctx);
+ ASSERT_OUTSIDE_BEGIN_END(ctx);
+
+ tmp[0] = (GLfloat) r;
+ tmp[1] = (GLfloat) g;
+ tmp[2] = (GLfloat) b;
+ tmp[3] = (GLfloat) a;
+
+ if (TEST_EQ_4V(tmp, ctx->Color.ClearColor))
+ return; /* no change */
+
+ FLUSH_VERTICES(ctx, _NEW_COLOR);
+
+ /* XXX we should eventually have a float/int/uint union for
+ * the ctx->Color.ClearColor state.
+ */
+ COPY_4V(ctx->Color.ClearColor, tmp);
+
+ if (ctx->Driver.ClearColor) {
+ ctx->Driver.ClearColor(ctx, ctx->Color.ClearColor);
+ }
+}
+
+
+/**
+ * Clear buffers.
+ *
+ * \param mask bit-mask indicating the buffers to be cleared.
+ *
+ * Flushes the vertices and verifies the parameter. If __struct gl_contextRec::NewState
+ * is set then calls _mesa_update_state() to update gl_frame_buffer::_Xmin,
+ * etc. If the rasterization mode is set to GL_RENDER then requests the driver
+ * to clear the buffers, via the dd_function_table::Clear callback.
+ */
+void GLAPIENTRY
+_mesa_Clear( GLbitfield mask )
+{
+ GET_CURRENT_CONTEXT(ctx);
+ ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
+
+ FLUSH_CURRENT(ctx, 0);
+
+ if (MESA_VERBOSE & VERBOSE_API)
+ _mesa_debug(ctx, "glClear 0x%x\n", mask);
+
+ if (mask & ~(GL_COLOR_BUFFER_BIT |
+ GL_DEPTH_BUFFER_BIT |
+ GL_STENCIL_BUFFER_BIT |
+ GL_ACCUM_BUFFER_BIT)) {
+ /* invalid bit set */
+ _mesa_error( ctx, GL_INVALID_VALUE, "glClear(0x%x)", mask);
+ return;
+ }
+
+ if (ctx->NewState) {
+ _mesa_update_state( ctx ); /* update _Xmin, etc */
+ }
+
+ if (ctx->DrawBuffer->_Status != GL_FRAMEBUFFER_COMPLETE_EXT) {
+ _mesa_error(ctx, GL_INVALID_FRAMEBUFFER_OPERATION_EXT,
+ "glClear(incomplete framebuffer)");
+ return;
+ }
+
+ if (ctx->DrawBuffer->Width == 0 || ctx->DrawBuffer->Height == 0 ||
+ ctx->DrawBuffer->_Xmin >= ctx->DrawBuffer->_Xmax ||
+ ctx->DrawBuffer->_Ymin >= ctx->DrawBuffer->_Ymax)
+ return;
+
+ if (ctx->RenderMode == GL_RENDER) {
+ GLbitfield bufferMask;
+
+ /* don't clear depth buffer if depth writing disabled */
+ if (!ctx->Depth.Mask)
+ mask &= ~GL_DEPTH_BUFFER_BIT;
+
+ /* Build the bitmask to send to device driver's Clear function.
+ * Note that the GL_COLOR_BUFFER_BIT flag will expand to 0, 1, 2 or 4
+ * of the BUFFER_BIT_FRONT/BACK_LEFT/RIGHT flags, or one of the
+ * BUFFER_BIT_COLORn flags.
+ */
+ bufferMask = 0;
+ if (mask & GL_COLOR_BUFFER_BIT) {
+ GLuint i;
+ for (i = 0; i < ctx->DrawBuffer->_NumColorDrawBuffers; i++) {
+ bufferMask |= (1 << ctx->DrawBuffer->_ColorDrawBufferIndexes[i]);
+ }
+ }
+
+ if ((mask & GL_DEPTH_BUFFER_BIT)
+ && ctx->DrawBuffer->Visual.haveDepthBuffer) {
+ bufferMask |= BUFFER_BIT_DEPTH;
+ }
+
+ if ((mask & GL_STENCIL_BUFFER_BIT)
+ && ctx->DrawBuffer->Visual.haveStencilBuffer) {
+ bufferMask |= BUFFER_BIT_STENCIL;
+ }
+
+ if ((mask & GL_ACCUM_BUFFER_BIT)
+ && ctx->DrawBuffer->Visual.haveAccumBuffer) {
+ bufferMask |= BUFFER_BIT_ACCUM;
+ }
+
+ ASSERT(ctx->Driver.Clear);
+ ctx->Driver.Clear(ctx, bufferMask);
+ }
+}
+
+
+/** Returned by make_color_buffer_mask() for errors */
+#define INVALID_MASK ~0x0
+
+
+/**
+ * Convert the glClearBuffer 'drawbuffer' parameter into a bitmask of
+ * BUFFER_BIT_x values.
+ * Return INVALID_MASK if the drawbuffer value is invalid.
+ */
+static GLbitfield
+make_color_buffer_mask(struct gl_context *ctx, GLint drawbuffer)
+{
+ const struct gl_renderbuffer_attachment *att = ctx->DrawBuffer->Attachment;
+ GLbitfield mask = 0x0;
+
+ switch (drawbuffer) {
+ case GL_FRONT:
+ if (att[BUFFER_FRONT_LEFT].Renderbuffer)
+ mask |= BUFFER_BIT_FRONT_LEFT;
+ if (att[BUFFER_FRONT_RIGHT].Renderbuffer)
+ mask |= BUFFER_BIT_FRONT_RIGHT;
+ break;
+ case GL_BACK:
+ if (att[BUFFER_BACK_LEFT].Renderbuffer)
+ mask |= BUFFER_BIT_BACK_LEFT;
+ if (att[BUFFER_BACK_RIGHT].Renderbuffer)
+ mask |= BUFFER_BIT_BACK_RIGHT;
+ break;
+ case GL_LEFT:
+ if (att[BUFFER_FRONT_LEFT].Renderbuffer)
+ mask |= BUFFER_BIT_FRONT_LEFT;
+ if (att[BUFFER_BACK_LEFT].Renderbuffer)
+ mask |= BUFFER_BIT_BACK_LEFT;
+ break;
+ case GL_RIGHT:
+ if (att[BUFFER_FRONT_RIGHT].Renderbuffer)
+ mask |= BUFFER_BIT_FRONT_RIGHT;
+ if (att[BUFFER_BACK_RIGHT].Renderbuffer)
+ mask |= BUFFER_BIT_BACK_RIGHT;
+ break;
+ case GL_FRONT_AND_BACK:
+ if (att[BUFFER_FRONT_LEFT].Renderbuffer)
+ mask |= BUFFER_BIT_FRONT_LEFT;
+ if (att[BUFFER_BACK_LEFT].Renderbuffer)
+ mask |= BUFFER_BIT_BACK_LEFT;
+ if (att[BUFFER_FRONT_RIGHT].Renderbuffer)
+ mask |= BUFFER_BIT_FRONT_RIGHT;
+ if (att[BUFFER_BACK_RIGHT].Renderbuffer)
+ mask |= BUFFER_BIT_BACK_RIGHT;
+ break;
+ default:
+ if (drawbuffer < 0 || drawbuffer >= (GLint)ctx->Const.MaxDrawBuffers) {
+ mask = INVALID_MASK;
+ }
+ else if (att[BUFFER_COLOR0 + drawbuffer].Renderbuffer) {
+ mask |= (BUFFER_BIT_COLOR0 << drawbuffer);
+ }
+ }
+
+ return mask;
+}
+
+
+
+/**
+ * New in GL 3.0
+ * Clear signed integer color buffer or stencil buffer (not depth).
+ */
+void GLAPIENTRY
+_mesa_ClearBufferiv(GLenum buffer, GLint drawbuffer, const GLint *value)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
+
+ FLUSH_CURRENT(ctx, 0);
+
+ if (ctx->NewState) {
+ _mesa_update_state( ctx );
+ }
+
+ switch (buffer) {
+ case GL_STENCIL:
+ if (drawbuffer != 0) {
+ _mesa_error(ctx, GL_INVALID_VALUE, "glClearBufferiv(drawbuffer=%d)",
+ drawbuffer);
+ return;
+ }
+ else {
+ /* Save current stencil clear value, set to 'value', do the
+ * stencil clear and restore the clear value.
+ * XXX in the future we may have a new ctx->Driver.ClearBuffer()
+ * hook instead.
+ */
+ const GLuint clearSave = ctx->Stencil.Clear;
+ ctx->Stencil.Clear = *value;
+ if (ctx->Driver.ClearStencil)
+ ctx->Driver.ClearStencil(ctx, *value);
+ ctx->Driver.Clear(ctx, BUFFER_BIT_STENCIL);
+ ctx->Stencil.Clear = clearSave;
+ if (ctx->Driver.ClearStencil)
+ ctx->Driver.ClearStencil(ctx, clearSave);
+ }
+ break;
+ case GL_COLOR:
+ {
+ const GLbitfield mask = make_color_buffer_mask(ctx, drawbuffer);
+ if (mask == INVALID_MASK) {
+ _mesa_error(ctx, GL_INVALID_VALUE, "glClearBufferiv(drawbuffer=%d)",
+ drawbuffer);
+ return;
+ }
+ else if (mask) {
+ /* XXX note: we're putting the integer clear values into the
+ * floating point state var. This will not always work. We'll
+ * need a new ctx->Driver.ClearBuffer() hook....
+ */
+ GLclampf clearSave[4];
+ /* save color */
+ COPY_4V(clearSave, ctx->Color.ClearColor);
+ /* set color */
+ COPY_4V_CAST(ctx->Color.ClearColor, value, GLclampf);
+ if (ctx->Driver.ClearColor)
+ ctx->Driver.ClearColor(ctx, ctx->Color.ClearColor);
+ /* clear buffer(s) */
+ ctx->Driver.Clear(ctx, mask);
+ /* restore color */
+ COPY_4V(ctx->Color.ClearColor, clearSave);
+ if (ctx->Driver.ClearColor)
+ ctx->Driver.ClearColor(ctx, clearSave);
+ }
+ }
+ break;
+ default:
+ _mesa_error(ctx, GL_INVALID_ENUM, "glClearBufferiv(buffer=%s)",
+ _mesa_lookup_enum_by_nr(buffer));
+ return;
+ }
+}
+
+
+/**
+ * New in GL 3.0
+ * Clear unsigned integer color buffer (not depth, not stencil).
+ */
+void GLAPIENTRY
+_mesa_ClearBufferuiv(GLenum buffer, GLint drawbuffer, const GLuint *value)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
+
+ FLUSH_CURRENT(ctx, 0);
+
+ if (ctx->NewState) {
+ _mesa_update_state( ctx );
+ }
+
+ switch (buffer) {
+ case GL_COLOR:
+ {
+ const GLbitfield mask = make_color_buffer_mask(ctx, drawbuffer);
+ if (mask == INVALID_MASK) {
+ _mesa_error(ctx, GL_INVALID_VALUE, "glClearBufferuiv(drawbuffer=%d)",
+ drawbuffer);
+ return;
+ }
+ else if (mask) {
+ /* XXX note: we're putting the uint clear values into the
+ * floating point state var. This will not always work. We'll
+ * need a new ctx->Driver.ClearBuffer() hook....
+ */
+ GLclampf clearSave[4];
+ /* save color */
+ COPY_4V(clearSave, ctx->Color.ClearColor);
+ /* set color */
+ COPY_4V_CAST(ctx->Color.ClearColor, value, GLclampf);
+ if (ctx->Driver.ClearColor)
+ ctx->Driver.ClearColor(ctx, ctx->Color.ClearColor);
+ /* clear buffer(s) */
+ ctx->Driver.Clear(ctx, mask);
+ /* restore color */
+ COPY_4V(ctx->Color.ClearColor, clearSave);
+ if (ctx->Driver.ClearColor)
+ ctx->Driver.ClearColor(ctx, clearSave);
+ }
+ }
+ break;
+ default:
+ _mesa_error(ctx, GL_INVALID_ENUM, "glClearBufferuiv(buffer=%s)",
+ _mesa_lookup_enum_by_nr(buffer));
+ return;
+ }
+}
+
+
+/**
+ * New in GL 3.0
+ * Clear fixed-pt or float color buffer or depth buffer (not stencil).
+ */
+void GLAPIENTRY
+_mesa_ClearBufferfv(GLenum buffer, GLint drawbuffer, const GLfloat *value)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
+
+ FLUSH_CURRENT(ctx, 0);
+
+ if (ctx->NewState) {
+ _mesa_update_state( ctx );
+ }
+
+ switch (buffer) {
+ case GL_DEPTH:
+ if (drawbuffer != 0) {
+ _mesa_error(ctx, GL_INVALID_VALUE, "glClearBufferfv(drawbuffer=%d)",
+ drawbuffer);
+ return;
+ }
+ else {
+ /* Save current depth clear value, set to 'value', do the
+ * depth clear and restore the clear value.
+ * XXX in the future we may have a new ctx->Driver.ClearBuffer()
+ * hook instead.
+ */
+ const GLclampd clearSave = ctx->Depth.Clear;
+ ctx->Depth.Clear = *value;
+ if (ctx->Driver.ClearDepth)
+ ctx->Driver.ClearDepth(ctx, *value);
+ ctx->Driver.Clear(ctx, BUFFER_BIT_DEPTH);
+ ctx->Depth.Clear = clearSave;
+ if (ctx->Driver.ClearDepth)
+ ctx->Driver.ClearDepth(ctx, clearSave);
+ }
+ /* clear depth buffer to value */
+ break;
+ case GL_COLOR:
+ {
+ const GLbitfield mask = make_color_buffer_mask(ctx, drawbuffer);
+ if (mask == INVALID_MASK) {
+ _mesa_error(ctx, GL_INVALID_VALUE, "glClearBufferfv(drawbuffer=%d)",
+ drawbuffer);
+ return;
+ }
+ else if (mask) {
+ GLclampf clearSave[4];
+ /* save color */
+ COPY_4V(clearSave, ctx->Color.ClearColor);
+ /* set color */
+ COPY_4V_CAST(ctx->Color.ClearColor, value, GLclampf);
+ if (ctx->Driver.ClearColor)
+ ctx->Driver.ClearColor(ctx, ctx->Color.ClearColor);
+ /* clear buffer(s) */
+ ctx->Driver.Clear(ctx, mask);
+ /* restore color */
+ COPY_4V(ctx->Color.ClearColor, clearSave);
+ if (ctx->Driver.ClearColor)
+ ctx->Driver.ClearColor(ctx, clearSave);
+ }
+ }
+ break;
+ default:
+ _mesa_error(ctx, GL_INVALID_ENUM, "glClearBufferfv(buffer=%s)",
+ _mesa_lookup_enum_by_nr(buffer));
+ return;
+ }
+}
+
+
+/**
+ * New in GL 3.0
+ * Clear depth/stencil buffer only.
+ */
+void GLAPIENTRY
+_mesa_ClearBufferfi(GLenum buffer, GLint drawbuffer,
+ GLfloat depth, GLint stencil)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
+
+ FLUSH_CURRENT(ctx, 0);
+
+ if (buffer != GL_DEPTH_STENCIL) {
+ _mesa_error(ctx, GL_INVALID_ENUM, "glClearBufferfi(buffer=%s)",
+ _mesa_lookup_enum_by_nr(buffer));
+ return;
+ }
+
+ if (drawbuffer != 0) {
+ _mesa_error(ctx, GL_INVALID_VALUE, "glClearBufferfi(drawbuffer=%d)",
+ drawbuffer);
+ return;
+ }
+
+ if (ctx->NewState) {
+ _mesa_update_state( ctx );
+ }
+
+ {
+ /* save current clear values */
+ const GLclampd clearDepthSave = ctx->Depth.Clear;
+ const GLuint clearStencilSave = ctx->Stencil.Clear;
+
+ /* set new clear values */
+ ctx->Depth.Clear = depth;
+ ctx->Stencil.Clear = stencil;
+ if (ctx->Driver.ClearDepth)
+ ctx->Driver.ClearDepth(ctx, depth);
+ if (ctx->Driver.ClearStencil)
+ ctx->Driver.ClearStencil(ctx, stencil);
+
+ /* clear buffers */
+ ctx->Driver.Clear(ctx, BUFFER_BIT_DEPTH | BUFFER_BIT_STENCIL);
+
+ /* restore */
+ ctx->Depth.Clear = clearDepthSave;
+ ctx->Stencil.Clear = clearStencilSave;
+ if (ctx->Driver.ClearDepth)
+ ctx->Driver.ClearDepth(ctx, clearDepthSave);
+ if (ctx->Driver.ClearStencil)
+ ctx->Driver.ClearStencil(ctx, clearStencilSave);
+ }
+}
diff --git a/mesalib/src/mesa/main/colortab.c b/mesalib/src/mesa/main/colortab.c
index ddb0f1f65..6f01b6c51 100644
--- a/mesalib/src/mesa/main/colortab.c
+++ b/mesalib/src/mesa/main/colortab.c
@@ -1,836 +1,836 @@
-/*
- * Mesa 3-D graphics library
- * Version: 7.1
- *
- * Copyright (C) 1999-2007 Brian Paul All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-
-#include "glheader.h"
-#include "bufferobj.h"
-#include "colortab.h"
-#include "context.h"
-#include "image.h"
-#include "macros.h"
-#include "mfeatures.h"
-#include "mtypes.h"
-#include "pack.h"
-#include "pbo.h"
-#include "state.h"
-#include "teximage.h"
-#include "texstate.h"
-#include "main/dispatch.h"
-
-
-#if FEATURE_colortable
-
-
-/**
- * Given an internalFormat token passed to glColorTable,
- * return the corresponding base format.
- * Return -1 if invalid token.
- */
-static GLint
-base_colortab_format( GLenum format )
-{
- switch (format) {
- case GL_ALPHA:
- case GL_ALPHA4:
- case GL_ALPHA8:
- case GL_ALPHA12:
- case GL_ALPHA16:
- return GL_ALPHA;
- case GL_LUMINANCE:
- case GL_LUMINANCE4:
- case GL_LUMINANCE8:
- case GL_LUMINANCE12:
- case GL_LUMINANCE16:
- return GL_LUMINANCE;
- case GL_LUMINANCE_ALPHA:
- case GL_LUMINANCE4_ALPHA4:
- case GL_LUMINANCE6_ALPHA2:
- case GL_LUMINANCE8_ALPHA8:
- case GL_LUMINANCE12_ALPHA4:
- case GL_LUMINANCE12_ALPHA12:
- case GL_LUMINANCE16_ALPHA16:
- return GL_LUMINANCE_ALPHA;
- case GL_INTENSITY:
- case GL_INTENSITY4:
- case GL_INTENSITY8:
- case GL_INTENSITY12:
- case GL_INTENSITY16:
- return GL_INTENSITY;
- case GL_RGB:
- case GL_R3_G3_B2:
- case GL_RGB4:
- case GL_RGB5:
- case GL_RGB8:
- case GL_RGB10:
- case GL_RGB12:
- case GL_RGB16:
- return GL_RGB;
- case GL_RGBA:
- case GL_RGBA2:
- case GL_RGBA4:
- case GL_RGB5_A1:
- case GL_RGBA8:
- case GL_RGB10_A2:
- case GL_RGBA12:
- case GL_RGBA16:
- return GL_RGBA;
- default:
- return -1; /* error */
- }
-}
-
-
-
-/**
- * Examine table's format and set the component sizes accordingly.
- */
-static void
-set_component_sizes( struct gl_color_table *table )
-{
- /* assuming the ubyte table */
- const GLubyte sz = 8;
-
- switch (table->_BaseFormat) {
- case GL_ALPHA:
- table->RedSize = 0;
- table->GreenSize = 0;
- table->BlueSize = 0;
- table->AlphaSize = sz;
- table->IntensitySize = 0;
- table->LuminanceSize = 0;
- break;
- case GL_LUMINANCE:
- table->RedSize = 0;
- table->GreenSize = 0;
- table->BlueSize = 0;
- table->AlphaSize = 0;
- table->IntensitySize = 0;
- table->LuminanceSize = sz;
- break;
- case GL_LUMINANCE_ALPHA:
- table->RedSize = 0;
- table->GreenSize = 0;
- table->BlueSize = 0;
- table->AlphaSize = sz;
- table->IntensitySize = 0;
- table->LuminanceSize = sz;
- break;
- case GL_INTENSITY:
- table->RedSize = 0;
- table->GreenSize = 0;
- table->BlueSize = 0;
- table->AlphaSize = 0;
- table->IntensitySize = sz;
- table->LuminanceSize = 0;
- break;
- case GL_RGB:
- table->RedSize = sz;
- table->GreenSize = sz;
- table->BlueSize = sz;
- table->AlphaSize = 0;
- table->IntensitySize = 0;
- table->LuminanceSize = 0;
- break;
- case GL_RGBA:
- table->RedSize = sz;
- table->GreenSize = sz;
- table->BlueSize = sz;
- table->AlphaSize = sz;
- table->IntensitySize = 0;
- table->LuminanceSize = 0;
- break;
- default:
- _mesa_problem(NULL, "unexpected format in set_component_sizes");
- }
-}
-
-
-
-/**
- * Update/replace all or part of a color table. Helper function
- * used by _mesa_ColorTable() and _mesa_ColorSubTable().
- * The table->Table buffer should already be allocated.
- * \param start first entry to update
- * \param count number of entries to update
- * \param format format of user-provided table data
- * \param type datatype of user-provided table data
- * \param data user-provided table data
- * \param [rgba]Scale - RGBA scale factors
- * \param [rgba]Bias - RGBA bias factors
- */
-static void
-store_colortable_entries(struct gl_context *ctx, struct gl_color_table *table,
- GLsizei start, GLsizei count,
- GLenum format, GLenum type, const GLvoid *data,
- GLfloat rScale, GLfloat rBias,
- GLfloat gScale, GLfloat gBias,
- GLfloat bScale, GLfloat bBias,
- GLfloat aScale, GLfloat aBias)
-{
- data = _mesa_map_validate_pbo_source(ctx,
- 1, &ctx->Unpack, count, 1, 1,
- format, type, INT_MAX, data,
- "glColor[Sub]Table");
- if (!data)
- return;
-
- {
- /* convert user-provided data to GLfloat values */
- GLfloat tempTab[MAX_COLOR_TABLE_SIZE * 4];
- GLfloat *tableF;
- GLint i;
-
- _mesa_unpack_color_span_float(ctx,
- count, /* number of pixels */
- table->_BaseFormat, /* dest format */
- tempTab, /* dest address */
- format, type, /* src format/type */
- data, /* src data */
- &ctx->Unpack,
- IMAGE_CLAMP_BIT); /* transfer ops */
-
- /* the destination */
- tableF = table->TableF;
-
- /* Apply scale & bias & clamp now */
- switch (table->_BaseFormat) {
- case GL_INTENSITY:
- for (i = 0; i < count; i++) {
- GLuint j = start + i;
- tableF[j] = CLAMP(tempTab[i] * rScale + rBias, 0.0F, 1.0F);
- }
- break;
- case GL_LUMINANCE:
- for (i = 0; i < count; i++) {
- GLuint j = start + i;
- tableF[j] = CLAMP(tempTab[i] * rScale + rBias, 0.0F, 1.0F);
- }
- break;
- case GL_ALPHA:
- for (i = 0; i < count; i++) {
- GLuint j = start + i;
- tableF[j] = CLAMP(tempTab[i] * aScale + aBias, 0.0F, 1.0F);
- }
- break;
- case GL_LUMINANCE_ALPHA:
- for (i = 0; i < count; i++) {
- GLuint j = start + i;
- tableF[j*2+0] = CLAMP(tempTab[i*2+0] * rScale + rBias, 0.0F, 1.0F);
- tableF[j*2+1] = CLAMP(tempTab[i*2+1] * aScale + aBias, 0.0F, 1.0F);
- }
- break;
- case GL_RGB:
- for (i = 0; i < count; i++) {
- GLuint j = start + i;
- tableF[j*3+0] = CLAMP(tempTab[i*3+0] * rScale + rBias, 0.0F, 1.0F);
- tableF[j*3+1] = CLAMP(tempTab[i*3+1] * gScale + gBias, 0.0F, 1.0F);
- tableF[j*3+2] = CLAMP(tempTab[i*3+2] * bScale + bBias, 0.0F, 1.0F);
- }
- break;
- case GL_RGBA:
- for (i = 0; i < count; i++) {
- GLuint j = start + i;
- tableF[j*4+0] = CLAMP(tempTab[i*4+0] * rScale + rBias, 0.0F, 1.0F);
- tableF[j*4+1] = CLAMP(tempTab[i*4+1] * gScale + gBias, 0.0F, 1.0F);
- tableF[j*4+2] = CLAMP(tempTab[i*4+2] * bScale + bBias, 0.0F, 1.0F);
- tableF[j*4+3] = CLAMP(tempTab[i*4+3] * aScale + aBias, 0.0F, 1.0F);
- }
- break;
- default:
- _mesa_problem(ctx, "Bad format in store_colortable_entries");
- return;
- }
- }
-
- /* update the ubyte table */
- {
- const GLint comps = _mesa_components_in_format(table->_BaseFormat);
- const GLfloat *tableF = table->TableF + start * comps;
- GLubyte *tableUB = table->TableUB + start * comps;
- GLint i;
- for (i = 0; i < count * comps; i++) {
- CLAMPED_FLOAT_TO_UBYTE(tableUB[i], tableF[i]);
- }
- }
-
- _mesa_unmap_pbo_source(ctx, &ctx->Unpack);
-}
-
-
-
-void GLAPIENTRY
-_mesa_ColorTable( GLenum target, GLenum internalFormat,
- GLsizei width, GLenum format, GLenum type,
- const GLvoid *data )
-{
- static const GLfloat one[4] = { 1.0, 1.0, 1.0, 1.0 };
- static const GLfloat zero[4] = { 0.0, 0.0, 0.0, 0.0 };
- GET_CURRENT_CONTEXT(ctx);
- struct gl_texture_unit *texUnit = _mesa_get_current_tex_unit(ctx);
- struct gl_texture_object *texObj = NULL;
- struct gl_color_table *table = NULL;
- GLboolean proxy = GL_FALSE;
- GLint baseFormat;
- const GLfloat *scale = one, *bias = zero;
- GLint comps;
-
- ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); /* too complex */
-
- switch (target) {
- case GL_SHARED_TEXTURE_PALETTE_EXT:
- table = &ctx->Texture.Palette;
- break;
- default:
- /* try texture targets */
- {
- struct gl_texture_object *texobj
- = _mesa_select_tex_object(ctx, texUnit, target);
- if (texobj) {
- table = &texobj->Palette;
- proxy = _mesa_is_proxy_texture(target);
- }
- else {
- _mesa_error(ctx, GL_INVALID_ENUM, "glColorTable(target)");
- return;
- }
- }
- }
-
- assert(table);
-
- if (!_mesa_is_legal_format_and_type(ctx, format, type) ||
- format == GL_INTENSITY) {
- _mesa_error(ctx, GL_INVALID_OPERATION, "glColorTable(format or type)");
- return;
- }
-
- baseFormat = base_colortab_format(internalFormat);
- if (baseFormat < 0) {
- _mesa_error(ctx, GL_INVALID_ENUM, "glColorTable(internalFormat)");
- return;
- }
-
- if (width < 0 || (width != 0 && !_mesa_is_pow_two(width))) {
- /* error */
- if (proxy) {
- table->Size = 0;
- table->InternalFormat = (GLenum) 0;
- table->_BaseFormat = (GLenum) 0;
- }
- else {
- _mesa_error(ctx, GL_INVALID_VALUE, "glColorTable(width=%d)", width);
- }
- return;
- }
-
- if (width > (GLsizei) ctx->Const.MaxColorTableSize) {
- if (proxy) {
- table->Size = 0;
- table->InternalFormat = (GLenum) 0;
- table->_BaseFormat = (GLenum) 0;
- }
- else {
- _mesa_error(ctx, GL_TABLE_TOO_LARGE, "glColorTable(width)");
- }
- return;
- }
-
- table->Size = width;
- table->InternalFormat = internalFormat;
- table->_BaseFormat = (GLenum) baseFormat;
-
- comps = _mesa_components_in_format(table->_BaseFormat);
- assert(comps > 0); /* error should have been caught sooner */
-
- if (!proxy) {
- _mesa_free_colortable_data(table);
-
- if (width > 0) {
- table->TableF = (GLfloat *) malloc(comps * width * sizeof(GLfloat));
- table->TableUB = (GLubyte *) malloc(comps * width * sizeof(GLubyte));
-
- if (!table->TableF || !table->TableUB) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "glColorTable");
- return;
- }
-
- store_colortable_entries(ctx, table,
- 0, width, /* start, count */
- format, type, data,
- scale[0], bias[0],
- scale[1], bias[1],
- scale[2], bias[2],
- scale[3], bias[3]);
- }
- } /* proxy */
-
- /* do this after the table's Type and Format are set */
- set_component_sizes(table);
-
- if (texObj || target == GL_SHARED_TEXTURE_PALETTE_EXT) {
- /* texture object palette, texObj==NULL means the shared palette */
- if (ctx->Driver.UpdateTexturePalette) {
- (*ctx->Driver.UpdateTexturePalette)( ctx, texObj );
- }
- }
-
- ctx->NewState |= _NEW_PIXEL;
-}
-
-
-
-void GLAPIENTRY
-_mesa_ColorSubTable( GLenum target, GLsizei start,
- GLsizei count, GLenum format, GLenum type,
- const GLvoid *data )
-{
- static const GLfloat one[4] = { 1.0, 1.0, 1.0, 1.0 };
- static const GLfloat zero[4] = { 0.0, 0.0, 0.0, 0.0 };
- GET_CURRENT_CONTEXT(ctx);
- struct gl_texture_unit *texUnit = _mesa_get_current_tex_unit(ctx);
- struct gl_texture_object *texObj = NULL;
- struct gl_color_table *table = NULL;
- const GLfloat *scale = one, *bias = zero;
-
- ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
-
- switch (target) {
- case GL_SHARED_TEXTURE_PALETTE_EXT:
- table = &ctx->Texture.Palette;
- break;
- default:
- /* try texture targets */
- texObj = _mesa_select_tex_object(ctx, texUnit, target);
- if (texObj && !_mesa_is_proxy_texture(target)) {
- table = &texObj->Palette;
- }
- else {
- _mesa_error(ctx, GL_INVALID_ENUM, "glColorSubTable(target)");
- return;
- }
- }
-
- assert(table);
-
- if (!_mesa_is_legal_format_and_type(ctx, format, type) ||
- format == GL_INTENSITY) {
- _mesa_error(ctx, GL_INVALID_OPERATION, "glColorSubTable(format or type)");
- return;
- }
-
- if (count < 1) {
- _mesa_error(ctx, GL_INVALID_VALUE, "glColorSubTable(count)");
- return;
- }
-
- /* error should have been caught sooner */
- assert(_mesa_components_in_format(table->_BaseFormat) > 0);
-
- if (start + count > (GLint) table->Size) {
- _mesa_error(ctx, GL_INVALID_VALUE, "glColorSubTable(count)");
- return;
- }
-
- if (!table->TableF || !table->TableUB) {
- /* a GL_OUT_OF_MEMORY error would have been recorded previously */
- return;
- }
-
- store_colortable_entries(ctx, table, start, count,
- format, type, data,
- scale[0], bias[0],
- scale[1], bias[1],
- scale[2], bias[2],
- scale[3], bias[3]);
-
- if (texObj || target == GL_SHARED_TEXTURE_PALETTE_EXT) {
- /* per-texture object palette */
- if (ctx->Driver.UpdateTexturePalette) {
- (*ctx->Driver.UpdateTexturePalette)( ctx, texObj );
- }
- }
-
- ctx->NewState |= _NEW_PIXEL;
-}
-
-
-
-static void GLAPIENTRY
-_mesa_CopyColorTable(GLenum target, GLenum internalformat,
- GLint x, GLint y, GLsizei width)
-{
- GET_CURRENT_CONTEXT(ctx);
- ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
-
- if (!ctx->ReadBuffer->_ColorReadBuffer) {
- return; /* no readbuffer - OK */
- }
-
- ctx->Driver.CopyColorTable( ctx, target, internalformat, x, y, width );
-}
-
-
-
-static void GLAPIENTRY
-_mesa_CopyColorSubTable(GLenum target, GLsizei start,
- GLint x, GLint y, GLsizei width)
-{
- GET_CURRENT_CONTEXT(ctx);
- ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
-
- if (!ctx->ReadBuffer->_ColorReadBuffer) {
- return; /* no readbuffer - OK */
- }
-
- ctx->Driver.CopyColorSubTable( ctx, target, start, x, y, width );
-}
-
-
-
-static void GLAPIENTRY
-_mesa_GetnColorTableARB( GLenum target, GLenum format, GLenum type,
- GLsizei bufSize, GLvoid *data )
-{
- GET_CURRENT_CONTEXT(ctx);
- struct gl_texture_unit *texUnit = _mesa_get_current_tex_unit(ctx);
- struct gl_color_table *table = NULL;
- GLfloat rgba[MAX_COLOR_TABLE_SIZE][4];
- GLbitfield transferOps = 0;
- ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
-
- if (ctx->NewState) {
- _mesa_update_state(ctx);
- }
-
- switch (target) {
- case GL_SHARED_TEXTURE_PALETTE_EXT:
- table = &ctx->Texture.Palette;
- break;
- default:
- /* try texture targets */
- {
- struct gl_texture_object *texobj
- = _mesa_select_tex_object(ctx, texUnit, target);
- if (texobj && !_mesa_is_proxy_texture(target)) {
- table = &texobj->Palette;
- }
- else {
- _mesa_error(ctx, GL_INVALID_ENUM, "glGetColorTable(target)");
- return;
- }
- }
- }
-
- ASSERT(table);
-
- if (table->Size <= 0) {
- return;
- }
-
- switch (table->_BaseFormat) {
- case GL_ALPHA:
- {
- GLuint i;
- for (i = 0; i < table->Size; i++) {
- rgba[i][RCOMP] = 0;
- rgba[i][GCOMP] = 0;
- rgba[i][BCOMP] = 0;
- rgba[i][ACOMP] = table->TableF[i];
- }
- }
- break;
- case GL_LUMINANCE:
- {
- GLuint i;
- for (i = 0; i < table->Size; i++) {
- rgba[i][RCOMP] =
- rgba[i][GCOMP] =
- rgba[i][BCOMP] = table->TableF[i];
- rgba[i][ACOMP] = 1.0F;
- }
- }
- break;
- case GL_LUMINANCE_ALPHA:
- {
- GLuint i;
- for (i = 0; i < table->Size; i++) {
- rgba[i][RCOMP] =
- rgba[i][GCOMP] =
- rgba[i][BCOMP] = table->TableF[i*2+0];
- rgba[i][ACOMP] = table->TableF[i*2+1];
- }
- }
- break;
- case GL_INTENSITY:
- {
- GLuint i;
- for (i = 0; i < table->Size; i++) {
- rgba[i][RCOMP] =
- rgba[i][GCOMP] =
- rgba[i][BCOMP] =
- rgba[i][ACOMP] = table->TableF[i];
- }
- }
- break;
- case GL_RGB:
- {
- GLuint i;
- for (i = 0; i < table->Size; i++) {
- rgba[i][RCOMP] = table->TableF[i*3+0];
- rgba[i][GCOMP] = table->TableF[i*3+1];
- rgba[i][BCOMP] = table->TableF[i*3+2];
- rgba[i][ACOMP] = 1.0F;
- }
- }
- break;
- case GL_RGBA:
- memcpy(rgba, table->TableF, 4 * table->Size * sizeof(GLfloat));
- break;
- default:
- _mesa_problem(ctx, "bad table format in glGetColorTable");
- return;
- }
-
- data = _mesa_map_validate_pbo_dest(ctx,
- 1, &ctx->Pack, table->Size, 1, 1,
- format, type, bufSize, data,
- "glGetColorTable");
- if (!data)
- return;
-
- /* TODO: is this correct? */
- if(ctx->Color._ClampReadColor)
- transferOps |= IMAGE_CLAMP_BIT;
-
- _mesa_pack_rgba_span_float(ctx, table->Size, rgba,
- format, type, data, &ctx->Pack, transferOps);
-
- _mesa_unmap_pbo_dest(ctx, &ctx->Pack);
-}
-
-
-static void GLAPIENTRY
-_mesa_GetColorTable( GLenum target, GLenum format,
- GLenum type, GLvoid *data )
-{
- _mesa_GetnColorTableARB(target, format, type, INT_MAX, data);
-}
-
-
-static void GLAPIENTRY
-_mesa_ColorTableParameterfv(GLenum target, GLenum pname, const GLfloat *params)
-{
- /* no extensions use this function */
- GET_CURRENT_CONTEXT(ctx);
- ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
- _mesa_error(ctx, GL_INVALID_ENUM, "glColorTableParameterfv(target)");
-}
-
-
-
-static void GLAPIENTRY
-_mesa_ColorTableParameteriv(GLenum target, GLenum pname, const GLint *params)
-{
- /* no extensions use this function */
- GET_CURRENT_CONTEXT(ctx);
- ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
- _mesa_error(ctx, GL_INVALID_ENUM, "glColorTableParameteriv(target)");
-}
-
-
-
-static void GLAPIENTRY
-_mesa_GetColorTableParameterfv( GLenum target, GLenum pname, GLfloat *params )
-{
- GET_CURRENT_CONTEXT(ctx);
- struct gl_texture_unit *texUnit = _mesa_get_current_tex_unit(ctx);
- struct gl_color_table *table = NULL;
- ASSERT_OUTSIDE_BEGIN_END(ctx);
-
- switch (target) {
- case GL_SHARED_TEXTURE_PALETTE_EXT:
- table = &ctx->Texture.Palette;
- break;
- default:
- /* try texture targets */
- {
- struct gl_texture_object *texobj
- = _mesa_select_tex_object(ctx, texUnit, target);
- if (texobj) {
- table = &texobj->Palette;
- }
- else {
- _mesa_error(ctx, GL_INVALID_ENUM,
- "glGetColorTableParameterfv(target)");
- return;
- }
- }
- }
-
- assert(table);
-
- switch (pname) {
- case GL_COLOR_TABLE_FORMAT:
- *params = (GLfloat) table->InternalFormat;
- break;
- case GL_COLOR_TABLE_WIDTH:
- *params = (GLfloat) table->Size;
- break;
- case GL_COLOR_TABLE_RED_SIZE:
- *params = (GLfloat) table->RedSize;
- break;
- case GL_COLOR_TABLE_GREEN_SIZE:
- *params = (GLfloat) table->GreenSize;
- break;
- case GL_COLOR_TABLE_BLUE_SIZE:
- *params = (GLfloat) table->BlueSize;
- break;
- case GL_COLOR_TABLE_ALPHA_SIZE:
- *params = (GLfloat) table->AlphaSize;
- break;
- case GL_COLOR_TABLE_LUMINANCE_SIZE:
- *params = (GLfloat) table->LuminanceSize;
- break;
- case GL_COLOR_TABLE_INTENSITY_SIZE:
- *params = (GLfloat) table->IntensitySize;
- break;
- default:
- _mesa_error(ctx, GL_INVALID_ENUM, "glGetColorTableParameterfv(pname)" );
- return;
- }
-}
-
-
-
-static void GLAPIENTRY
-_mesa_GetColorTableParameteriv( GLenum target, GLenum pname, GLint *params )
-{
- GET_CURRENT_CONTEXT(ctx);
- struct gl_texture_unit *texUnit = _mesa_get_current_tex_unit(ctx);
- struct gl_color_table *table = NULL;
- ASSERT_OUTSIDE_BEGIN_END(ctx);
-
- switch (target) {
- case GL_SHARED_TEXTURE_PALETTE_EXT:
- table = &ctx->Texture.Palette;
- break;
- default:
- /* Try texture targets */
- {
- struct gl_texture_object *texobj
- = _mesa_select_tex_object(ctx, texUnit, target);
- if (texobj) {
- table = &texobj->Palette;
- }
- else {
- _mesa_error(ctx, GL_INVALID_ENUM,
- "glGetColorTableParameteriv(target)");
- return;
- }
- }
- }
-
- assert(table);
-
- switch (pname) {
- case GL_COLOR_TABLE_FORMAT:
- *params = table->InternalFormat;
- break;
- case GL_COLOR_TABLE_WIDTH:
- *params = table->Size;
- break;
- case GL_COLOR_TABLE_RED_SIZE:
- *params = table->RedSize;
- break;
- case GL_COLOR_TABLE_GREEN_SIZE:
- *params = table->GreenSize;
- break;
- case GL_COLOR_TABLE_BLUE_SIZE:
- *params = table->BlueSize;
- break;
- case GL_COLOR_TABLE_ALPHA_SIZE:
- *params = table->AlphaSize;
- break;
- case GL_COLOR_TABLE_LUMINANCE_SIZE:
- *params = table->LuminanceSize;
- break;
- case GL_COLOR_TABLE_INTENSITY_SIZE:
- *params = table->IntensitySize;
- break;
- default:
- _mesa_error(ctx, GL_INVALID_ENUM, "glGetColorTableParameteriv(pname)" );
- return;
- }
-}
-
-
-void
-_mesa_init_colortable_dispatch(struct _glapi_table *disp)
-{
- SET_ColorSubTable(disp, _mesa_ColorSubTable);
- SET_ColorTable(disp, _mesa_ColorTable);
- SET_ColorTableParameterfv(disp, _mesa_ColorTableParameterfv);
- SET_ColorTableParameteriv(disp, _mesa_ColorTableParameteriv);
- SET_CopyColorSubTable(disp, _mesa_CopyColorSubTable);
- SET_CopyColorTable(disp, _mesa_CopyColorTable);
- SET_GetColorTable(disp, _mesa_GetColorTable);
- SET_GetColorTableParameterfv(disp, _mesa_GetColorTableParameterfv);
- SET_GetColorTableParameteriv(disp, _mesa_GetColorTableParameteriv);
-
- /* GL_ARB_robustness */
- SET_GetnColorTableARB(disp, _mesa_GetnColorTableARB);
-}
-
-
-#endif /* FEATURE_colortable */
-
-
-/**********************************************************************/
-/***** Initialization *****/
-/**********************************************************************/
-
-
-void
-_mesa_init_colortable( struct gl_color_table *p )
-{
- p->TableF = NULL;
- p->TableUB = NULL;
- p->Size = 0;
- p->InternalFormat = GL_RGBA;
-}
-
-
-
-void
-_mesa_free_colortable_data( struct gl_color_table *p )
-{
- if (p->TableF) {
- free(p->TableF);
- p->TableF = NULL;
- }
- if (p->TableUB) {
- free(p->TableUB);
- p->TableUB = NULL;
- }
-}
+/*
+ * Mesa 3-D graphics library
+ * Version: 7.1
+ *
+ * Copyright (C) 1999-2007 Brian Paul All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+
+#include "glheader.h"
+#include "bufferobj.h"
+#include "colortab.h"
+#include "context.h"
+#include "image.h"
+#include "macros.h"
+#include "mfeatures.h"
+#include "mtypes.h"
+#include "pack.h"
+#include "pbo.h"
+#include "state.h"
+#include "teximage.h"
+#include "texstate.h"
+#include "main/dispatch.h"
+
+
+#if FEATURE_colortable
+
+
+/**
+ * Given an internalFormat token passed to glColorTable,
+ * return the corresponding base format.
+ * Return -1 if invalid token.
+ */
+static GLint
+base_colortab_format( GLenum format )
+{
+ switch (format) {
+ case GL_ALPHA:
+ case GL_ALPHA4:
+ case GL_ALPHA8:
+ case GL_ALPHA12:
+ case GL_ALPHA16:
+ return GL_ALPHA;
+ case GL_LUMINANCE:
+ case GL_LUMINANCE4:
+ case GL_LUMINANCE8:
+ case GL_LUMINANCE12:
+ case GL_LUMINANCE16:
+ return GL_LUMINANCE;
+ case GL_LUMINANCE_ALPHA:
+ case GL_LUMINANCE4_ALPHA4:
+ case GL_LUMINANCE6_ALPHA2:
+ case GL_LUMINANCE8_ALPHA8:
+ case GL_LUMINANCE12_ALPHA4:
+ case GL_LUMINANCE12_ALPHA12:
+ case GL_LUMINANCE16_ALPHA16:
+ return GL_LUMINANCE_ALPHA;
+ case GL_INTENSITY:
+ case GL_INTENSITY4:
+ case GL_INTENSITY8:
+ case GL_INTENSITY12:
+ case GL_INTENSITY16:
+ return GL_INTENSITY;
+ case GL_RGB:
+ case GL_R3_G3_B2:
+ case GL_RGB4:
+ case GL_RGB5:
+ case GL_RGB8:
+ case GL_RGB10:
+ case GL_RGB12:
+ case GL_RGB16:
+ return GL_RGB;
+ case GL_RGBA:
+ case GL_RGBA2:
+ case GL_RGBA4:
+ case GL_RGB5_A1:
+ case GL_RGBA8:
+ case GL_RGB10_A2:
+ case GL_RGBA12:
+ case GL_RGBA16:
+ return GL_RGBA;
+ default:
+ return -1; /* error */
+ }
+}
+
+
+
+/**
+ * Examine table's format and set the component sizes accordingly.
+ */
+static void
+set_component_sizes( struct gl_color_table *table )
+{
+ /* assuming the ubyte table */
+ const GLubyte sz = 8;
+
+ switch (table->_BaseFormat) {
+ case GL_ALPHA:
+ table->RedSize = 0;
+ table->GreenSize = 0;
+ table->BlueSize = 0;
+ table->AlphaSize = sz;
+ table->IntensitySize = 0;
+ table->LuminanceSize = 0;
+ break;
+ case GL_LUMINANCE:
+ table->RedSize = 0;
+ table->GreenSize = 0;
+ table->BlueSize = 0;
+ table->AlphaSize = 0;
+ table->IntensitySize = 0;
+ table->LuminanceSize = sz;
+ break;
+ case GL_LUMINANCE_ALPHA:
+ table->RedSize = 0;
+ table->GreenSize = 0;
+ table->BlueSize = 0;
+ table->AlphaSize = sz;
+ table->IntensitySize = 0;
+ table->LuminanceSize = sz;
+ break;
+ case GL_INTENSITY:
+ table->RedSize = 0;
+ table->GreenSize = 0;
+ table->BlueSize = 0;
+ table->AlphaSize = 0;
+ table->IntensitySize = sz;
+ table->LuminanceSize = 0;
+ break;
+ case GL_RGB:
+ table->RedSize = sz;
+ table->GreenSize = sz;
+ table->BlueSize = sz;
+ table->AlphaSize = 0;
+ table->IntensitySize = 0;
+ table->LuminanceSize = 0;
+ break;
+ case GL_RGBA:
+ table->RedSize = sz;
+ table->GreenSize = sz;
+ table->BlueSize = sz;
+ table->AlphaSize = sz;
+ table->IntensitySize = 0;
+ table->LuminanceSize = 0;
+ break;
+ default:
+ _mesa_problem(NULL, "unexpected format in set_component_sizes");
+ }
+}
+
+
+
+/**
+ * Update/replace all or part of a color table. Helper function
+ * used by _mesa_ColorTable() and _mesa_ColorSubTable().
+ * The table->Table buffer should already be allocated.
+ * \param start first entry to update
+ * \param count number of entries to update
+ * \param format format of user-provided table data
+ * \param type datatype of user-provided table data
+ * \param data user-provided table data
+ * \param [rgba]Scale - RGBA scale factors
+ * \param [rgba]Bias - RGBA bias factors
+ */
+static void
+store_colortable_entries(struct gl_context *ctx, struct gl_color_table *table,
+ GLsizei start, GLsizei count,
+ GLenum format, GLenum type, const GLvoid *data,
+ GLfloat rScale, GLfloat rBias,
+ GLfloat gScale, GLfloat gBias,
+ GLfloat bScale, GLfloat bBias,
+ GLfloat aScale, GLfloat aBias)
+{
+ data = _mesa_map_validate_pbo_source(ctx,
+ 1, &ctx->Unpack, count, 1, 1,
+ format, type, INT_MAX, data,
+ "glColor[Sub]Table");
+ if (!data)
+ return;
+
+ {
+ /* convert user-provided data to GLfloat values */
+ GLfloat tempTab[MAX_COLOR_TABLE_SIZE * 4];
+ GLfloat *tableF;
+ GLint i;
+
+ _mesa_unpack_color_span_float(ctx,
+ count, /* number of pixels */
+ table->_BaseFormat, /* dest format */
+ tempTab, /* dest address */
+ format, type, /* src format/type */
+ data, /* src data */
+ &ctx->Unpack,
+ IMAGE_CLAMP_BIT); /* transfer ops */
+
+ /* the destination */
+ tableF = table->TableF;
+
+ /* Apply scale & bias & clamp now */
+ switch (table->_BaseFormat) {
+ case GL_INTENSITY:
+ for (i = 0; i < count; i++) {
+ GLuint j = start + i;
+ tableF[j] = CLAMP(tempTab[i] * rScale + rBias, 0.0F, 1.0F);
+ }
+ break;
+ case GL_LUMINANCE:
+ for (i = 0; i < count; i++) {
+ GLuint j = start + i;
+ tableF[j] = CLAMP(tempTab[i] * rScale + rBias, 0.0F, 1.0F);
+ }
+ break;
+ case GL_ALPHA:
+ for (i = 0; i < count; i++) {
+ GLuint j = start + i;
+ tableF[j] = CLAMP(tempTab[i] * aScale + aBias, 0.0F, 1.0F);
+ }
+ break;
+ case GL_LUMINANCE_ALPHA:
+ for (i = 0; i < count; i++) {
+ GLuint j = start + i;
+ tableF[j*2+0] = CLAMP(tempTab[i*2+0] * rScale + rBias, 0.0F, 1.0F);
+ tableF[j*2+1] = CLAMP(tempTab[i*2+1] * aScale + aBias, 0.0F, 1.0F);
+ }
+ break;
+ case GL_RGB:
+ for (i = 0; i < count; i++) {
+ GLuint j = start + i;
+ tableF[j*3+0] = CLAMP(tempTab[i*3+0] * rScale + rBias, 0.0F, 1.0F);
+ tableF[j*3+1] = CLAMP(tempTab[i*3+1] * gScale + gBias, 0.0F, 1.0F);
+ tableF[j*3+2] = CLAMP(tempTab[i*3+2] * bScale + bBias, 0.0F, 1.0F);
+ }
+ break;
+ case GL_RGBA:
+ for (i = 0; i < count; i++) {
+ GLuint j = start + i;
+ tableF[j*4+0] = CLAMP(tempTab[i*4+0] * rScale + rBias, 0.0F, 1.0F);
+ tableF[j*4+1] = CLAMP(tempTab[i*4+1] * gScale + gBias, 0.0F, 1.0F);
+ tableF[j*4+2] = CLAMP(tempTab[i*4+2] * bScale + bBias, 0.0F, 1.0F);
+ tableF[j*4+3] = CLAMP(tempTab[i*4+3] * aScale + aBias, 0.0F, 1.0F);
+ }
+ break;
+ default:
+ _mesa_problem(ctx, "Bad format in store_colortable_entries");
+ return;
+ }
+ }
+
+ /* update the ubyte table */
+ {
+ const GLint comps = _mesa_components_in_format(table->_BaseFormat);
+ const GLfloat *tableF = table->TableF + start * comps;
+ GLubyte *tableUB = table->TableUB + start * comps;
+ GLint i;
+ for (i = 0; i < count * comps; i++) {
+ CLAMPED_FLOAT_TO_UBYTE(tableUB[i], tableF[i]);
+ }
+ }
+
+ _mesa_unmap_pbo_source(ctx, &ctx->Unpack);
+}
+
+
+
+void GLAPIENTRY
+_mesa_ColorTable( GLenum target, GLenum internalFormat,
+ GLsizei width, GLenum format, GLenum type,
+ const GLvoid *data )
+{
+ static const GLfloat one[4] = { 1.0, 1.0, 1.0, 1.0 };
+ static const GLfloat zero[4] = { 0.0, 0.0, 0.0, 0.0 };
+ GET_CURRENT_CONTEXT(ctx);
+ struct gl_texture_unit *texUnit = _mesa_get_current_tex_unit(ctx);
+ struct gl_texture_object *texObj = NULL;
+ struct gl_color_table *table = NULL;
+ GLboolean proxy = GL_FALSE;
+ GLint baseFormat;
+ const GLfloat *scale = one, *bias = zero;
+ GLint comps;
+
+ ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); /* too complex */
+
+ switch (target) {
+ case GL_SHARED_TEXTURE_PALETTE_EXT:
+ table = &ctx->Texture.Palette;
+ break;
+ default:
+ /* try texture targets */
+ {
+ struct gl_texture_object *texobj
+ = _mesa_select_tex_object(ctx, texUnit, target);
+ if (texobj) {
+ table = &texobj->Palette;
+ proxy = _mesa_is_proxy_texture(target);
+ }
+ else {
+ _mesa_error(ctx, GL_INVALID_ENUM, "glColorTable(target)");
+ return;
+ }
+ }
+ }
+
+ assert(table);
+
+ if (!_mesa_is_legal_format_and_type(ctx, format, type) ||
+ format == GL_INTENSITY) {
+ _mesa_error(ctx, GL_INVALID_OPERATION, "glColorTable(format or type)");
+ return;
+ }
+
+ baseFormat = base_colortab_format(internalFormat);
+ if (baseFormat < 0) {
+ _mesa_error(ctx, GL_INVALID_ENUM, "glColorTable(internalFormat)");
+ return;
+ }
+
+ if (width < 0 || (width != 0 && !_mesa_is_pow_two(width))) {
+ /* error */
+ if (proxy) {
+ table->Size = 0;
+ table->InternalFormat = (GLenum) 0;
+ table->_BaseFormat = (GLenum) 0;
+ }
+ else {
+ _mesa_error(ctx, GL_INVALID_VALUE, "glColorTable(width=%d)", width);
+ }
+ return;
+ }
+
+ if (width > (GLsizei) ctx->Const.MaxColorTableSize) {
+ if (proxy) {
+ table->Size = 0;
+ table->InternalFormat = (GLenum) 0;
+ table->_BaseFormat = (GLenum) 0;
+ }
+ else {
+ _mesa_error(ctx, GL_TABLE_TOO_LARGE, "glColorTable(width)");
+ }
+ return;
+ }
+
+ table->Size = width;
+ table->InternalFormat = internalFormat;
+ table->_BaseFormat = (GLenum) baseFormat;
+
+ comps = _mesa_components_in_format(table->_BaseFormat);
+ assert(comps > 0); /* error should have been caught sooner */
+
+ if (!proxy) {
+ _mesa_free_colortable_data(table);
+
+ if (width > 0) {
+ table->TableF = (GLfloat *) malloc(comps * width * sizeof(GLfloat));
+ table->TableUB = (GLubyte *) malloc(comps * width * sizeof(GLubyte));
+
+ if (!table->TableF || !table->TableUB) {
+ _mesa_error(ctx, GL_OUT_OF_MEMORY, "glColorTable");
+ return;
+ }
+
+ store_colortable_entries(ctx, table,
+ 0, width, /* start, count */
+ format, type, data,
+ scale[0], bias[0],
+ scale[1], bias[1],
+ scale[2], bias[2],
+ scale[3], bias[3]);
+ }
+ } /* proxy */
+
+ /* do this after the table's Type and Format are set */
+ set_component_sizes(table);
+
+ if (texObj || target == GL_SHARED_TEXTURE_PALETTE_EXT) {
+ /* texture object palette, texObj==NULL means the shared palette */
+ if (ctx->Driver.UpdateTexturePalette) {
+ (*ctx->Driver.UpdateTexturePalette)( ctx, texObj );
+ }
+ }
+
+ ctx->NewState |= _NEW_PIXEL;
+}
+
+
+
+void GLAPIENTRY
+_mesa_ColorSubTable( GLenum target, GLsizei start,
+ GLsizei count, GLenum format, GLenum type,
+ const GLvoid *data )
+{
+ static const GLfloat one[4] = { 1.0, 1.0, 1.0, 1.0 };
+ static const GLfloat zero[4] = { 0.0, 0.0, 0.0, 0.0 };
+ GET_CURRENT_CONTEXT(ctx);
+ struct gl_texture_unit *texUnit = _mesa_get_current_tex_unit(ctx);
+ struct gl_texture_object *texObj = NULL;
+ struct gl_color_table *table = NULL;
+ const GLfloat *scale = one, *bias = zero;
+
+ ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
+
+ switch (target) {
+ case GL_SHARED_TEXTURE_PALETTE_EXT:
+ table = &ctx->Texture.Palette;
+ break;
+ default:
+ /* try texture targets */
+ texObj = _mesa_select_tex_object(ctx, texUnit, target);
+ if (texObj && !_mesa_is_proxy_texture(target)) {
+ table = &texObj->Palette;
+ }
+ else {
+ _mesa_error(ctx, GL_INVALID_ENUM, "glColorSubTable(target)");
+ return;
+ }
+ }
+
+ assert(table);
+
+ if (!_mesa_is_legal_format_and_type(ctx, format, type) ||
+ format == GL_INTENSITY) {
+ _mesa_error(ctx, GL_INVALID_OPERATION, "glColorSubTable(format or type)");
+ return;
+ }
+
+ if (count < 1) {
+ _mesa_error(ctx, GL_INVALID_VALUE, "glColorSubTable(count)");
+ return;
+ }
+
+ /* error should have been caught sooner */
+ assert(_mesa_components_in_format(table->_BaseFormat) > 0);
+
+ if (start + count > (GLint) table->Size) {
+ _mesa_error(ctx, GL_INVALID_VALUE, "glColorSubTable(count)");
+ return;
+ }
+
+ if (!table->TableF || !table->TableUB) {
+ /* a GL_OUT_OF_MEMORY error would have been recorded previously */
+ return;
+ }
+
+ store_colortable_entries(ctx, table, start, count,
+ format, type, data,
+ scale[0], bias[0],
+ scale[1], bias[1],
+ scale[2], bias[2],
+ scale[3], bias[3]);
+
+ if (texObj || target == GL_SHARED_TEXTURE_PALETTE_EXT) {
+ /* per-texture object palette */
+ if (ctx->Driver.UpdateTexturePalette) {
+ (*ctx->Driver.UpdateTexturePalette)( ctx, texObj );
+ }
+ }
+
+ ctx->NewState |= _NEW_PIXEL;
+}
+
+
+
+static void GLAPIENTRY
+_mesa_CopyColorTable(GLenum target, GLenum internalformat,
+ GLint x, GLint y, GLsizei width)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
+
+ if (!ctx->ReadBuffer->_ColorReadBuffer) {
+ return; /* no readbuffer - OK */
+ }
+
+ ctx->Driver.CopyColorTable( ctx, target, internalformat, x, y, width );
+}
+
+
+
+static void GLAPIENTRY
+_mesa_CopyColorSubTable(GLenum target, GLsizei start,
+ GLint x, GLint y, GLsizei width)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
+
+ if (!ctx->ReadBuffer->_ColorReadBuffer) {
+ return; /* no readbuffer - OK */
+ }
+
+ ctx->Driver.CopyColorSubTable( ctx, target, start, x, y, width );
+}
+
+
+
+static void GLAPIENTRY
+_mesa_GetnColorTableARB( GLenum target, GLenum format, GLenum type,
+ GLsizei bufSize, GLvoid *data )
+{
+ GET_CURRENT_CONTEXT(ctx);
+ struct gl_texture_unit *texUnit = _mesa_get_current_tex_unit(ctx);
+ struct gl_color_table *table = NULL;
+ GLfloat rgba[MAX_COLOR_TABLE_SIZE][4];
+ GLbitfield transferOps = 0;
+ ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
+
+ if (ctx->NewState) {
+ _mesa_update_state(ctx);
+ }
+
+ switch (target) {
+ case GL_SHARED_TEXTURE_PALETTE_EXT:
+ table = &ctx->Texture.Palette;
+ break;
+ default:
+ /* try texture targets */
+ {
+ struct gl_texture_object *texobj
+ = _mesa_select_tex_object(ctx, texUnit, target);
+ if (texobj && !_mesa_is_proxy_texture(target)) {
+ table = &texobj->Palette;
+ }
+ else {
+ _mesa_error(ctx, GL_INVALID_ENUM, "glGetColorTable(target)");
+ return;
+ }
+ }
+ }
+
+ ASSERT(table);
+
+ if (table->Size <= 0) {
+ return;
+ }
+
+ switch (table->_BaseFormat) {
+ case GL_ALPHA:
+ {
+ GLuint i;
+ for (i = 0; i < table->Size; i++) {
+ rgba[i][RCOMP] = 0;
+ rgba[i][GCOMP] = 0;
+ rgba[i][BCOMP] = 0;
+ rgba[i][ACOMP] = table->TableF[i];
+ }
+ }
+ break;
+ case GL_LUMINANCE:
+ {
+ GLuint i;
+ for (i = 0; i < table->Size; i++) {
+ rgba[i][RCOMP] =
+ rgba[i][GCOMP] =
+ rgba[i][BCOMP] = table->TableF[i];
+ rgba[i][ACOMP] = 1.0F;
+ }
+ }
+ break;
+ case GL_LUMINANCE_ALPHA:
+ {
+ GLuint i;
+ for (i = 0; i < table->Size; i++) {
+ rgba[i][RCOMP] =
+ rgba[i][GCOMP] =
+ rgba[i][BCOMP] = table->TableF[i*2+0];
+ rgba[i][ACOMP] = table->TableF[i*2+1];
+ }
+ }
+ break;
+ case GL_INTENSITY:
+ {
+ GLuint i;
+ for (i = 0; i < table->Size; i++) {
+ rgba[i][RCOMP] =
+ rgba[i][GCOMP] =
+ rgba[i][BCOMP] =
+ rgba[i][ACOMP] = table->TableF[i];
+ }
+ }
+ break;
+ case GL_RGB:
+ {
+ GLuint i;
+ for (i = 0; i < table->Size; i++) {
+ rgba[i][RCOMP] = table->TableF[i*3+0];
+ rgba[i][GCOMP] = table->TableF[i*3+1];
+ rgba[i][BCOMP] = table->TableF[i*3+2];
+ rgba[i][ACOMP] = 1.0F;
+ }
+ }
+ break;
+ case GL_RGBA:
+ memcpy(rgba, table->TableF, 4 * table->Size * sizeof(GLfloat));
+ break;
+ default:
+ _mesa_problem(ctx, "bad table format in glGetColorTable");
+ return;
+ }
+
+ data = _mesa_map_validate_pbo_dest(ctx,
+ 1, &ctx->Pack, table->Size, 1, 1,
+ format, type, bufSize, data,
+ "glGetColorTable");
+ if (!data)
+ return;
+
+ /* TODO: is this correct? */
+ if(ctx->Color._ClampReadColor)
+ transferOps |= IMAGE_CLAMP_BIT;
+
+ _mesa_pack_rgba_span_float(ctx, table->Size, rgba,
+ format, type, data, &ctx->Pack, transferOps);
+
+ _mesa_unmap_pbo_dest(ctx, &ctx->Pack);
+}
+
+
+static void GLAPIENTRY
+_mesa_GetColorTable( GLenum target, GLenum format,
+ GLenum type, GLvoid *data )
+{
+ _mesa_GetnColorTableARB(target, format, type, INT_MAX, data);
+}
+
+
+static void GLAPIENTRY
+_mesa_ColorTableParameterfv(GLenum target, GLenum pname, const GLfloat *params)
+{
+ /* no extensions use this function */
+ GET_CURRENT_CONTEXT(ctx);
+ ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
+ _mesa_error(ctx, GL_INVALID_ENUM, "glColorTableParameterfv(target)");
+}
+
+
+
+static void GLAPIENTRY
+_mesa_ColorTableParameteriv(GLenum target, GLenum pname, const GLint *params)
+{
+ /* no extensions use this function */
+ GET_CURRENT_CONTEXT(ctx);
+ ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
+ _mesa_error(ctx, GL_INVALID_ENUM, "glColorTableParameteriv(target)");
+}
+
+
+
+static void GLAPIENTRY
+_mesa_GetColorTableParameterfv( GLenum target, GLenum pname, GLfloat *params )
+{
+ GET_CURRENT_CONTEXT(ctx);
+ struct gl_texture_unit *texUnit = _mesa_get_current_tex_unit(ctx);
+ struct gl_color_table *table = NULL;
+ ASSERT_OUTSIDE_BEGIN_END(ctx);
+
+ switch (target) {
+ case GL_SHARED_TEXTURE_PALETTE_EXT:
+ table = &ctx->Texture.Palette;
+ break;
+ default:
+ /* try texture targets */
+ {
+ struct gl_texture_object *texobj
+ = _mesa_select_tex_object(ctx, texUnit, target);
+ if (texobj) {
+ table = &texobj->Palette;
+ }
+ else {
+ _mesa_error(ctx, GL_INVALID_ENUM,
+ "glGetColorTableParameterfv(target)");
+ return;
+ }
+ }
+ }
+
+ assert(table);
+
+ switch (pname) {
+ case GL_COLOR_TABLE_FORMAT:
+ *params = (GLfloat) table->InternalFormat;
+ break;
+ case GL_COLOR_TABLE_WIDTH:
+ *params = (GLfloat) table->Size;
+ break;
+ case GL_COLOR_TABLE_RED_SIZE:
+ *params = (GLfloat) table->RedSize;
+ break;
+ case GL_COLOR_TABLE_GREEN_SIZE:
+ *params = (GLfloat) table->GreenSize;
+ break;
+ case GL_COLOR_TABLE_BLUE_SIZE:
+ *params = (GLfloat) table->BlueSize;
+ break;
+ case GL_COLOR_TABLE_ALPHA_SIZE:
+ *params = (GLfloat) table->AlphaSize;
+ break;
+ case GL_COLOR_TABLE_LUMINANCE_SIZE:
+ *params = (GLfloat) table->LuminanceSize;
+ break;
+ case GL_COLOR_TABLE_INTENSITY_SIZE:
+ *params = (GLfloat) table->IntensitySize;
+ break;
+ default:
+ _mesa_error(ctx, GL_INVALID_ENUM, "glGetColorTableParameterfv(pname)" );
+ return;
+ }
+}
+
+
+
+static void GLAPIENTRY
+_mesa_GetColorTableParameteriv( GLenum target, GLenum pname, GLint *params )
+{
+ GET_CURRENT_CONTEXT(ctx);
+ struct gl_texture_unit *texUnit = _mesa_get_current_tex_unit(ctx);
+ struct gl_color_table *table = NULL;
+ ASSERT_OUTSIDE_BEGIN_END(ctx);
+
+ switch (target) {
+ case GL_SHARED_TEXTURE_PALETTE_EXT:
+ table = &ctx->Texture.Palette;
+ break;
+ default:
+ /* Try texture targets */
+ {
+ struct gl_texture_object *texobj
+ = _mesa_select_tex_object(ctx, texUnit, target);
+ if (texobj) {
+ table = &texobj->Palette;
+ }
+ else {
+ _mesa_error(ctx, GL_INVALID_ENUM,
+ "glGetColorTableParameteriv(target)");
+ return;
+ }
+ }
+ }
+
+ assert(table);
+
+ switch (pname) {
+ case GL_COLOR_TABLE_FORMAT:
+ *params = table->InternalFormat;
+ break;
+ case GL_COLOR_TABLE_WIDTH:
+ *params = table->Size;
+ break;
+ case GL_COLOR_TABLE_RED_SIZE:
+ *params = table->RedSize;
+ break;
+ case GL_COLOR_TABLE_GREEN_SIZE:
+ *params = table->GreenSize;
+ break;
+ case GL_COLOR_TABLE_BLUE_SIZE:
+ *params = table->BlueSize;
+ break;
+ case GL_COLOR_TABLE_ALPHA_SIZE:
+ *params = table->AlphaSize;
+ break;
+ case GL_COLOR_TABLE_LUMINANCE_SIZE:
+ *params = table->LuminanceSize;
+ break;
+ case GL_COLOR_TABLE_INTENSITY_SIZE:
+ *params = table->IntensitySize;
+ break;
+ default:
+ _mesa_error(ctx, GL_INVALID_ENUM, "glGetColorTableParameteriv(pname)" );
+ return;
+ }
+}
+
+
+void
+_mesa_init_colortable_dispatch(struct _glapi_table *disp)
+{
+ SET_ColorSubTable(disp, _mesa_ColorSubTable);
+ SET_ColorTable(disp, _mesa_ColorTable);
+ SET_ColorTableParameterfv(disp, _mesa_ColorTableParameterfv);
+ SET_ColorTableParameteriv(disp, _mesa_ColorTableParameteriv);
+ SET_CopyColorSubTable(disp, _mesa_CopyColorSubTable);
+ SET_CopyColorTable(disp, _mesa_CopyColorTable);
+ SET_GetColorTable(disp, _mesa_GetColorTable);
+ SET_GetColorTableParameterfv(disp, _mesa_GetColorTableParameterfv);
+ SET_GetColorTableParameteriv(disp, _mesa_GetColorTableParameteriv);
+
+ /* GL_ARB_robustness */
+ SET_GetnColorTableARB(disp, _mesa_GetnColorTableARB);
+}
+
+
+#endif /* FEATURE_colortable */
+
+
+/**********************************************************************/
+/***** Initialization *****/
+/**********************************************************************/
+
+
+void
+_mesa_init_colortable( struct gl_color_table *p )
+{
+ p->TableF = NULL;
+ p->TableUB = NULL;
+ p->Size = 0;
+ p->InternalFormat = GL_RGBA;
+}
+
+
+
+void
+_mesa_free_colortable_data( struct gl_color_table *p )
+{
+ if (p->TableF) {
+ free(p->TableF);
+ p->TableF = NULL;
+ }
+ if (p->TableUB) {
+ free(p->TableUB);
+ p->TableUB = NULL;
+ }
+}
diff --git a/mesalib/src/mesa/main/compiler.h b/mesalib/src/mesa/main/compiler.h
index 743841be4..b5cac72d3 100644
--- a/mesalib/src/mesa/main/compiler.h
+++ b/mesalib/src/mesa/main/compiler.h
@@ -1,516 +1,494 @@
-/*
- * Mesa 3-D graphics library
- * Version: 7.5
- *
- * Copyright (C) 1999-2008 Brian Paul All Rights Reserved.
- * Copyright (C) 2009 VMware, Inc. All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-
-/**
- * \file compiler.h
- * Compiler-related stuff.
- */
-
-
-#ifndef COMPILER_H
-#define COMPILER_H
-
-
-#include <assert.h>
-#include <ctype.h>
-#if defined(__alpha__) && defined(CCPML)
-#include <cpml.h> /* use Compaq's Fast Math Library on Alpha */
-#else
-#include <math.h>
-#endif
-#include <limits.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#if defined(__linux__) && defined(__i386__)
-#include <fpu_control.h>
-#endif
-#include <float.h>
-#include <stdarg.h>
-
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/**
- * Get standard integer types
- */
-#if defined(_MSC_VER)
- typedef __int8 int8_t;
- typedef unsigned __int8 uint8_t;
- typedef __int16 int16_t;
- typedef unsigned __int16 uint16_t;
- typedef __int32 int32_t;
- typedef unsigned __int32 uint32_t;
- typedef __int64 int64_t;
- typedef unsigned __int64 uint64_t;
-
-# if defined(_WIN64)
- typedef __int64 intptr_t;
- typedef unsigned __int64 uintptr_t;
-# else
- typedef __int32 intptr_t;
- typedef unsigned __int32 uintptr_t;
-# endif
-
-# define INT64_C(__val) __val##i64
-# define UINT64_C(__val) __val##ui64
-#else
-# include <stdint.h>
-#endif
-
-
-/**
- * Sun compilers define __i386 instead of the gcc-style __i386__
- */
-#ifdef __SUNPRO_C
-# if !defined(__i386__) && defined(__i386)
-# define __i386__
-# elif !defined(__amd64__) && defined(__amd64)
-# define __amd64__
-# elif !defined(__sparc__) && defined(__sparc)
-# define __sparc__
-# endif
-# if !defined(__volatile)
-# define __volatile volatile
-# endif
-#endif
-
-
-/**
- * finite macro.
- */
-#if defined(_MSC_VER)
-# define finite _finite
-#elif defined(__WATCOMC__)
-# define finite _finite
-#endif
-
-
-/**
- * Disable assorted warnings
- */
-#if !defined(OPENSTEP) && (defined(__WIN32__) && !defined(__CYGWIN__)) && !defined(BUILD_FOR_SNAP)
-# if !defined(__GNUC__) /* mingw environment */
-# pragma warning( disable : 4068 ) /* unknown pragma */
-# pragma warning( disable : 4710 ) /* function 'foo' not inlined */
-# pragma warning( disable : 4711 ) /* function 'foo' selected for automatic inline expansion */
-# pragma warning( disable : 4127 ) /* conditional expression is constant */
-# if defined(MESA_MINWARN)
-# pragma warning( disable : 4244 ) /* '=' : conversion from 'const double ' to 'float ', possible loss of data */
-# pragma warning( disable : 4018 ) /* '<' : signed/unsigned mismatch */
-# pragma warning( disable : 4305 ) /* '=' : truncation from 'const double ' to 'float ' */
-# pragma warning( disable : 4550 ) /* 'function' undefined; assuming extern returning int */
-# pragma warning( disable : 4761 ) /* integral size mismatch in argument; conversion supplied */
-# endif
-# endif
-#endif
-#if defined(__WATCOMC__)
-# pragma disable_message(201) /* Disable unreachable code warnings */
-#endif
-
-
-
-/**
- * Function inlining
- */
-#if defined(__GNUC__)
-# define INLINE __inline__
-#elif defined(__MSC__)
-# define INLINE __inline
-#elif defined(_MSC_VER)
-# define INLINE __inline
-#elif defined(__ICL)
-# define INLINE __inline
-#elif defined(__INTEL_COMPILER)
-# define INLINE inline
-#elif defined(__WATCOMC__) && (__WATCOMC__ >= 1100)
-# define INLINE __inline
-#elif defined(__SUNPRO_C) && defined(__C99FEATURES__)
-# define INLINE inline
-# define __inline inline
-# define __inline__ inline
-#elif (__STDC_VERSION__ >= 199901L) /* C99 */
-# define INLINE inline
-#else
-# define INLINE
-#endif
-
-
-/**
- * PUBLIC/USED macros
- *
- * If we build the library with gcc's -fvisibility=hidden flag, we'll
- * use the PUBLIC macro to mark functions that are to be exported.
- *
- * We also need to define a USED attribute, so the optimizer doesn't
- * inline a static function that we later use in an alias. - ajax
- */
-#ifndef PUBLIC
-# if defined(__GNUC__) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590))
-# define PUBLIC __attribute__((visibility("default")))
-# define USED __attribute__((used))
-# else
-# define PUBLIC
-# define USED
-# endif
-#endif
-
-
-/**
- * Some compilers don't like some of Mesa's const usage. In those places use
- * CONST instead of const. Pass -DNO_CONST to compilers where this matters.
- */
-#ifdef NO_CONST
-# define CONST
-#else
-# define CONST const
-#endif
-
-
-/**
- * __builtin_expect macros
- */
-#if !defined(__GNUC__)
-# define __builtin_expect(x, y) (x)
-#endif
-
-#ifndef likely
-# ifdef __GNUC__
-# define likely(x) __builtin_expect(!!(x), 1)
-# define unlikely(x) __builtin_expect(!!(x), 0)
-# else
-# define likely(x) (x)
-# define unlikely(x) (x)
-# endif
-#endif
-
-/**
- * The __FUNCTION__ gcc variable is generally only used for debugging.
- * If we're not using gcc, define __FUNCTION__ as a cpp symbol here.
- * Don't define it if using a newer Windows compiler.
- */
-#ifndef __FUNCTION__
-# if defined(__VMS)
-# define __FUNCTION__ "VMS$NL:"
-# elif !defined(__GNUC__) && !defined(__xlC__) && \
- (!defined(_MSC_VER) || _MSC_VER < 1300)
-# if (__STDC_VERSION__ >= 199901L) /* C99 */ || \
- (defined(__SUNPRO_C) && defined(__C99FEATURES__))
-# define __FUNCTION__ __func__
-# else
-# define __FUNCTION__ "<unknown>"
-# endif
-# endif
-#endif
-#ifndef __func__
-# if (__STDC_VERSION__ >= 199901L) || \
- (defined(__SUNPRO_C) && defined(__C99FEATURES__))
- /* __func__ is part of C99 */
-# elif defined(_MSC_VER)
-# if _MSC_VER >= 1300
-# define __func__ __FUNCTION__
-# else
-# define __func__ "<unknown>"
-# endif
-# endif
-#endif
-
-
-/**
- * Either define MESA_BIG_ENDIAN or MESA_LITTLE_ENDIAN, and CPU_TO_LE32.
- * Do not use these unless absolutely necessary!
- * Try to use a runtime test instead.
- * For now, only used by some DRI hardware drivers for color/texel packing.
- */
-#if defined(BYTE_ORDER) && defined(BIG_ENDIAN) && BYTE_ORDER == BIG_ENDIAN
-#if defined(__linux__)
-#include <byteswap.h>
-#define CPU_TO_LE32( x ) bswap_32( x )
-#elif defined(__APPLE__)
-#include <CoreFoundation/CFByteOrder.h>
-#define CPU_TO_LE32( x ) CFSwapInt32HostToLittle( x )
-#elif (defined(_AIX) || defined(__blrts))
-static INLINE GLuint CPU_TO_LE32(GLuint x)
-{
- return (((x & 0x000000ff) << 24) |
- ((x & 0x0000ff00) << 8) |
- ((x & 0x00ff0000) >> 8) |
- ((x & 0xff000000) >> 24));
-}
-#else /*__linux__ */
-#include <sys/endian.h>
-#define CPU_TO_LE32( x ) bswap32( x )
-#endif /*__linux__*/
-#define MESA_BIG_ENDIAN 1
-#else
-#define CPU_TO_LE32( x ) ( x )
-#define MESA_LITTLE_ENDIAN 1
-#endif
-#define LE32_TO_CPU( x ) CPU_TO_LE32( x )
-
-
-
-#if !defined(CAPI) && defined(WIN32) && !defined(BUILD_FOR_SNAP)
-#define CAPI _cdecl
-#endif
-
-
-/**
- * Create a macro so that asm functions can be linked into compilers other
- * than GNU C
- */
-#ifndef _ASMAPI
-#if defined(WIN32) && !defined(BUILD_FOR_SNAP)/* was: !defined( __GNUC__ ) && !defined( VMS ) && !defined( __INTEL_COMPILER )*/
-#define _ASMAPI __cdecl
-#else
-#define _ASMAPI
-#endif
-#ifdef PTR_DECL_IN_FRONT
-#define _ASMAPIP * _ASMAPI
-#else
-#define _ASMAPIP _ASMAPI *
-#endif
-#endif
-
-#ifdef USE_X86_ASM
-#define _NORMAPI _ASMAPI
-#define _NORMAPIP _ASMAPIP
-#else
-#define _NORMAPI
-#define _NORMAPIP *
-#endif
-
-
-/* This is a macro on IRIX */
-#ifdef _P
-#undef _P
-#endif
-
-
-/* Turn off macro checking systems used by other libraries */
-#ifdef CHECK
-#undef CHECK
-#endif
-
-
-/**
- * ASSERT macro
- */
-#if !defined(_WIN32_WCE)
-#if defined(BUILD_FOR_SNAP) && defined(CHECKED)
-# define ASSERT(X) _CHECK(X)
-#elif defined(DEBUG)
-# define ASSERT(X) assert(X)
-#else
-# define ASSERT(X)
-#endif
-#endif
-
-#if (__GNUC__ >= 3)
-#define PRINTFLIKE(f, a) __attribute__ ((format(__printf__, f, a)))
-#else
-#define PRINTFLIKE(f, a)
-#endif
-
-#ifndef NULL
-#define NULL 0
-#endif
-
-
-/**
- * LONGSTRING macro
- * gcc -pedantic warns about long string literals, LONGSTRING silences that.
- */
-#if !defined(__GNUC__)
-# define LONGSTRING
-#else
-# define LONGSTRING __extension__
-#endif
-
-
-#ifndef M_PI
-#define M_PI (3.14159265358979323846)
-#endif
-
-#ifndef M_E
-#define M_E (2.7182818284590452354)
-#endif
-
-#ifndef M_LOG2E
-#define M_LOG2E (1.4426950408889634074)
-#endif
-
-#ifndef ONE_DIV_SQRT_LN2
-#define ONE_DIV_SQRT_LN2 (1.201122408786449815)
-#endif
-
-#ifndef FLT_MAX_EXP
-#define FLT_MAX_EXP 128
-#endif
-
-
-/**
- * USE_IEEE: Determine if we're using IEEE floating point
- */
-#if defined(__i386__) || defined(__386__) || defined(__sparc__) || \
- defined(__s390x__) || defined(__powerpc__) || \
- defined(__x86_64__) || \
- defined(ia64) || defined(__ia64__) || \
- defined(__hppa__) || defined(hpux) || \
- defined(__mips) || defined(_MIPS_ARCH) || \
- defined(__arm__) || \
- defined(__sh__) || defined(__m32r__) || \
- (defined(__sun) && defined(_IEEE_754)) || \
- (defined(__alpha__) && (defined(__IEEE_FLOAT) || !defined(VMS)))
-#define USE_IEEE
-#define IEEE_ONE 0x3f800000
-#endif
-
-
-/**
- * START/END_FAST_MATH macros:
- *
- * START_FAST_MATH: Set x86 FPU to faster, 32-bit precision mode (and save
- * original mode to a temporary).
- * END_FAST_MATH: Restore x86 FPU to original mode.
- */
-#if defined(__GNUC__) && defined(__i386__)
-/*
- * Set the x86 FPU control word to guarentee only 32 bits of precision
- * are stored in registers. Allowing the FPU to store more introduces
- * differences between situations where numbers are pulled out of memory
- * vs. situations where the compiler is able to optimize register usage.
- *
- * In the worst case, we force the compiler to use a memory access to
- * truncate the float, by specifying the 'volatile' keyword.
- */
-/* Hardware default: All exceptions masked, extended double precision,
- * round to nearest (IEEE compliant):
- */
-#define DEFAULT_X86_FPU 0x037f
-/* All exceptions masked, single precision, round to nearest:
- */
-#define FAST_X86_FPU 0x003f
-/* The fldcw instruction will cause any pending FP exceptions to be
- * raised prior to entering the block, and we clear any pending
- * exceptions before exiting the block. Hence, asm code has free
- * reign over the FPU while in the fast math block.
- */
-#if defined(NO_FAST_MATH)
-#define START_FAST_MATH(x) \
-do { \
- static GLuint mask = DEFAULT_X86_FPU; \
- __asm__ ( "fnstcw %0" : "=m" (*&(x)) ); \
- __asm__ ( "fldcw %0" : : "m" (mask) ); \
-} while (0)
-#else
-#define START_FAST_MATH(x) \
-do { \
- static GLuint mask = FAST_X86_FPU; \
- __asm__ ( "fnstcw %0" : "=m" (*&(x)) ); \
- __asm__ ( "fldcw %0" : : "m" (mask) ); \
-} while (0)
-#endif
-/* Restore original FPU mode, and clear any exceptions that may have
- * occurred in the FAST_MATH block.
- */
-#define END_FAST_MATH(x) \
-do { \
- __asm__ ( "fnclex ; fldcw %0" : : "m" (*&(x)) ); \
-} while (0)
-
-#elif defined(__WATCOMC__) && defined(__386__)
-#define DEFAULT_X86_FPU 0x037f /* See GCC comments above */
-#define FAST_X86_FPU 0x003f /* See GCC comments above */
-void _watcom_start_fast_math(unsigned short *x,unsigned short *mask);
-#pragma aux _watcom_start_fast_math = \
- "fnstcw word ptr [eax]" \
- "fldcw word ptr [ecx]" \
- parm [eax] [ecx] \
- modify exact [];
-void _watcom_end_fast_math(unsigned short *x);
-#pragma aux _watcom_end_fast_math = \
- "fnclex" \
- "fldcw word ptr [eax]" \
- parm [eax] \
- modify exact [];
-#if defined(NO_FAST_MATH)
-#define START_FAST_MATH(x) \
-do { \
- static GLushort mask = DEFAULT_X86_FPU; \
- _watcom_start_fast_math(&x,&mask); \
-} while (0)
-#else
-#define START_FAST_MATH(x) \
-do { \
- static GLushort mask = FAST_X86_FPU; \
- _watcom_start_fast_math(&x,&mask); \
-} while (0)
-#endif
-#define END_FAST_MATH(x) _watcom_end_fast_math(&x)
-
-#elif defined(_MSC_VER) && defined(_M_IX86)
-#define DEFAULT_X86_FPU 0x037f /* See GCC comments above */
-#define FAST_X86_FPU 0x003f /* See GCC comments above */
-#if defined(NO_FAST_MATH)
-#define START_FAST_MATH(x) do {\
- static GLuint mask = DEFAULT_X86_FPU;\
- __asm fnstcw word ptr [x]\
- __asm fldcw word ptr [mask]\
-} while(0)
-#else
-#define START_FAST_MATH(x) do {\
- static GLuint mask = FAST_X86_FPU;\
- __asm fnstcw word ptr [x]\
- __asm fldcw word ptr [mask]\
-} while(0)
-#endif
-#define END_FAST_MATH(x) do {\
- __asm fnclex\
- __asm fldcw word ptr [x]\
-} while(0)
-
-#else
-#define START_FAST_MATH(x) x = 0
-#define END_FAST_MATH(x) (void)(x)
-#endif
-
-
-#ifndef Elements
-#define Elements(x) (sizeof(x)/sizeof(*(x)))
-#endif
-
-
-
-#ifdef __cplusplus
-}
-#endif
-
-
-#endif /* COMPILER_H */
+/*
+ * Mesa 3-D graphics library
+ * Version: 7.5
+ *
+ * Copyright (C) 1999-2008 Brian Paul All Rights Reserved.
+ * Copyright (C) 2009 VMware, Inc. All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+
+/**
+ * \file compiler.h
+ * Compiler-related stuff.
+ */
+
+
+#ifndef COMPILER_H
+#define COMPILER_H
+
+
+#include <assert.h>
+#include <ctype.h>
+#if defined(__alpha__) && defined(CCPML)
+#include <cpml.h> /* use Compaq's Fast Math Library on Alpha */
+#else
+#include <math.h>
+#endif
+#include <limits.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#if defined(__linux__) && defined(__i386__)
+#include <fpu_control.h>
+#endif
+#include <float.h>
+#include <stdarg.h>
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/**
+ * Get standard integer types
+ */
+#include <stdint.h>
+
+
+/**
+ * Sun compilers define __i386 instead of the gcc-style __i386__
+ */
+#ifdef __SUNPRO_C
+# if !defined(__i386__) && defined(__i386)
+# define __i386__
+# elif !defined(__amd64__) && defined(__amd64)
+# define __amd64__
+# elif !defined(__sparc__) && defined(__sparc)
+# define __sparc__
+# endif
+# if !defined(__volatile)
+# define __volatile volatile
+# endif
+#endif
+
+
+/**
+ * finite macro.
+ */
+#if defined(_MSC_VER)
+# define finite _finite
+#elif defined(__WATCOMC__)
+# define finite _finite
+#endif
+
+
+/**
+ * Disable assorted warnings
+ */
+#if !defined(OPENSTEP) && (defined(__WIN32__) && !defined(__CYGWIN__)) && !defined(BUILD_FOR_SNAP)
+# if !defined(__GNUC__) /* mingw environment */
+# pragma warning( disable : 4068 ) /* unknown pragma */
+# pragma warning( disable : 4710 ) /* function 'foo' not inlined */
+# pragma warning( disable : 4711 ) /* function 'foo' selected for automatic inline expansion */
+# pragma warning( disable : 4127 ) /* conditional expression is constant */
+# if defined(MESA_MINWARN)
+# pragma warning( disable : 4244 ) /* '=' : conversion from 'const double ' to 'float ', possible loss of data */
+# pragma warning( disable : 4018 ) /* '<' : signed/unsigned mismatch */
+# pragma warning( disable : 4305 ) /* '=' : truncation from 'const double ' to 'float ' */
+# pragma warning( disable : 4550 ) /* 'function' undefined; assuming extern returning int */
+# pragma warning( disable : 4761 ) /* integral size mismatch in argument; conversion supplied */
+# endif
+# endif
+#endif
+#if defined(__WATCOMC__)
+# pragma disable_message(201) /* Disable unreachable code warnings */
+#endif
+
+
+
+/**
+ * Function inlining
+ */
+#if defined(__GNUC__)
+# define INLINE __inline__
+#elif defined(__MSC__)
+# define INLINE __inline
+#elif defined(_MSC_VER)
+# define INLINE __inline
+#elif defined(__ICL)
+# define INLINE __inline
+#elif defined(__INTEL_COMPILER)
+# define INLINE inline
+#elif defined(__WATCOMC__) && (__WATCOMC__ >= 1100)
+# define INLINE __inline
+#elif defined(__SUNPRO_C) && defined(__C99FEATURES__)
+# define INLINE inline
+# define __inline inline
+# define __inline__ inline
+#elif (__STDC_VERSION__ >= 199901L) /* C99 */
+# define INLINE inline
+#else
+# define INLINE
+#endif
+
+
+/**
+ * PUBLIC/USED macros
+ *
+ * If we build the library with gcc's -fvisibility=hidden flag, we'll
+ * use the PUBLIC macro to mark functions that are to be exported.
+ *
+ * We also need to define a USED attribute, so the optimizer doesn't
+ * inline a static function that we later use in an alias. - ajax
+ */
+#ifndef PUBLIC
+# if defined(__GNUC__) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590))
+# define PUBLIC __attribute__((visibility("default")))
+# define USED __attribute__((used))
+# else
+# define PUBLIC
+# define USED
+# endif
+#endif
+
+
+/**
+ * Some compilers don't like some of Mesa's const usage. In those places use
+ * CONST instead of const. Pass -DNO_CONST to compilers where this matters.
+ */
+#ifdef NO_CONST
+# define CONST
+#else
+# define CONST const
+#endif
+
+
+/**
+ * __builtin_expect macros
+ */
+#if !defined(__GNUC__)
+# define __builtin_expect(x, y) (x)
+#endif
+
+#ifndef likely
+# ifdef __GNUC__
+# define likely(x) __builtin_expect(!!(x), 1)
+# define unlikely(x) __builtin_expect(!!(x), 0)
+# else
+# define likely(x) (x)
+# define unlikely(x) (x)
+# endif
+#endif
+
+/**
+ * The __FUNCTION__ gcc variable is generally only used for debugging.
+ * If we're not using gcc, define __FUNCTION__ as a cpp symbol here.
+ * Don't define it if using a newer Windows compiler.
+ */
+#ifndef __FUNCTION__
+# if defined(__VMS)
+# define __FUNCTION__ "VMS$NL:"
+# elif !defined(__GNUC__) && !defined(__xlC__) && \
+ (!defined(_MSC_VER) || _MSC_VER < 1300)
+# if (__STDC_VERSION__ >= 199901L) /* C99 */ || \
+ (defined(__SUNPRO_C) && defined(__C99FEATURES__))
+# define __FUNCTION__ __func__
+# else
+# define __FUNCTION__ "<unknown>"
+# endif
+# endif
+#endif
+#ifndef __func__
+# if (__STDC_VERSION__ >= 199901L) || \
+ (defined(__SUNPRO_C) && defined(__C99FEATURES__))
+ /* __func__ is part of C99 */
+# elif defined(_MSC_VER)
+# if _MSC_VER >= 1300
+# define __func__ __FUNCTION__
+# else
+# define __func__ "<unknown>"
+# endif
+# endif
+#endif
+
+
+/**
+ * Either define MESA_BIG_ENDIAN or MESA_LITTLE_ENDIAN, and CPU_TO_LE32.
+ * Do not use these unless absolutely necessary!
+ * Try to use a runtime test instead.
+ * For now, only used by some DRI hardware drivers for color/texel packing.
+ */
+#if defined(BYTE_ORDER) && defined(BIG_ENDIAN) && BYTE_ORDER == BIG_ENDIAN
+#if defined(__linux__)
+#include <byteswap.h>
+#define CPU_TO_LE32( x ) bswap_32( x )
+#elif defined(__APPLE__)
+#include <CoreFoundation/CFByteOrder.h>
+#define CPU_TO_LE32( x ) CFSwapInt32HostToLittle( x )
+#elif (defined(_AIX) || defined(__blrts))
+static INLINE GLuint CPU_TO_LE32(GLuint x)
+{
+ return (((x & 0x000000ff) << 24) |
+ ((x & 0x0000ff00) << 8) |
+ ((x & 0x00ff0000) >> 8) |
+ ((x & 0xff000000) >> 24));
+}
+#else /*__linux__ */
+#include <sys/endian.h>
+#define CPU_TO_LE32( x ) bswap32( x )
+#endif /*__linux__*/
+#define MESA_BIG_ENDIAN 1
+#else
+#define CPU_TO_LE32( x ) ( x )
+#define MESA_LITTLE_ENDIAN 1
+#endif
+#define LE32_TO_CPU( x ) CPU_TO_LE32( x )
+
+
+
+#if !defined(CAPI) && defined(WIN32) && !defined(BUILD_FOR_SNAP)
+#define CAPI _cdecl
+#endif
+
+
+/**
+ * Create a macro so that asm functions can be linked into compilers other
+ * than GNU C
+ */
+#ifndef _ASMAPI
+#if defined(WIN32) && !defined(BUILD_FOR_SNAP)/* was: !defined( __GNUC__ ) && !defined( VMS ) && !defined( __INTEL_COMPILER )*/
+#define _ASMAPI __cdecl
+#else
+#define _ASMAPI
+#endif
+#ifdef PTR_DECL_IN_FRONT
+#define _ASMAPIP * _ASMAPI
+#else
+#define _ASMAPIP _ASMAPI *
+#endif
+#endif
+
+#ifdef USE_X86_ASM
+#define _NORMAPI _ASMAPI
+#define _NORMAPIP _ASMAPIP
+#else
+#define _NORMAPI
+#define _NORMAPIP *
+#endif
+
+
+/* This is a macro on IRIX */
+#ifdef _P
+#undef _P
+#endif
+
+
+/* Turn off macro checking systems used by other libraries */
+#ifdef CHECK
+#undef CHECK
+#endif
+
+
+/**
+ * ASSERT macro
+ */
+#if !defined(_WIN32_WCE)
+#if defined(BUILD_FOR_SNAP) && defined(CHECKED)
+# define ASSERT(X) _CHECK(X)
+#elif defined(DEBUG)
+# define ASSERT(X) assert(X)
+#else
+# define ASSERT(X)
+#endif
+#endif
+
+#if (__GNUC__ >= 3)
+#define PRINTFLIKE(f, a) __attribute__ ((format(__printf__, f, a)))
+#else
+#define PRINTFLIKE(f, a)
+#endif
+
+#ifndef NULL
+#define NULL 0
+#endif
+
+
+/**
+ * LONGSTRING macro
+ * gcc -pedantic warns about long string literals, LONGSTRING silences that.
+ */
+#if !defined(__GNUC__)
+# define LONGSTRING
+#else
+# define LONGSTRING __extension__
+#endif
+
+
+#ifndef M_PI
+#define M_PI (3.14159265358979323846)
+#endif
+
+#ifndef M_E
+#define M_E (2.7182818284590452354)
+#endif
+
+#ifndef M_LOG2E
+#define M_LOG2E (1.4426950408889634074)
+#endif
+
+#ifndef ONE_DIV_SQRT_LN2
+#define ONE_DIV_SQRT_LN2 (1.201122408786449815)
+#endif
+
+#ifndef FLT_MAX_EXP
+#define FLT_MAX_EXP 128
+#endif
+
+
+/**
+ * USE_IEEE: Determine if we're using IEEE floating point
+ */
+#if defined(__i386__) || defined(__386__) || defined(__sparc__) || \
+ defined(__s390x__) || defined(__powerpc__) || \
+ defined(__x86_64__) || \
+ defined(ia64) || defined(__ia64__) || \
+ defined(__hppa__) || defined(hpux) || \
+ defined(__mips) || defined(_MIPS_ARCH) || \
+ defined(__arm__) || \
+ defined(__sh__) || defined(__m32r__) || \
+ (defined(__sun) && defined(_IEEE_754)) || \
+ (defined(__alpha__) && (defined(__IEEE_FLOAT) || !defined(VMS)))
+#define USE_IEEE
+#define IEEE_ONE 0x3f800000
+#endif
+
+
+/**
+ * START/END_FAST_MATH macros:
+ *
+ * START_FAST_MATH: Set x86 FPU to faster, 32-bit precision mode (and save
+ * original mode to a temporary).
+ * END_FAST_MATH: Restore x86 FPU to original mode.
+ */
+#if defined(__GNUC__) && defined(__i386__)
+/*
+ * Set the x86 FPU control word to guarentee only 32 bits of precision
+ * are stored in registers. Allowing the FPU to store more introduces
+ * differences between situations where numbers are pulled out of memory
+ * vs. situations where the compiler is able to optimize register usage.
+ *
+ * In the worst case, we force the compiler to use a memory access to
+ * truncate the float, by specifying the 'volatile' keyword.
+ */
+/* Hardware default: All exceptions masked, extended double precision,
+ * round to nearest (IEEE compliant):
+ */
+#define DEFAULT_X86_FPU 0x037f
+/* All exceptions masked, single precision, round to nearest:
+ */
+#define FAST_X86_FPU 0x003f
+/* The fldcw instruction will cause any pending FP exceptions to be
+ * raised prior to entering the block, and we clear any pending
+ * exceptions before exiting the block. Hence, asm code has free
+ * reign over the FPU while in the fast math block.
+ */
+#if defined(NO_FAST_MATH)
+#define START_FAST_MATH(x) \
+do { \
+ static GLuint mask = DEFAULT_X86_FPU; \
+ __asm__ ( "fnstcw %0" : "=m" (*&(x)) ); \
+ __asm__ ( "fldcw %0" : : "m" (mask) ); \
+} while (0)
+#else
+#define START_FAST_MATH(x) \
+do { \
+ static GLuint mask = FAST_X86_FPU; \
+ __asm__ ( "fnstcw %0" : "=m" (*&(x)) ); \
+ __asm__ ( "fldcw %0" : : "m" (mask) ); \
+} while (0)
+#endif
+/* Restore original FPU mode, and clear any exceptions that may have
+ * occurred in the FAST_MATH block.
+ */
+#define END_FAST_MATH(x) \
+do { \
+ __asm__ ( "fnclex ; fldcw %0" : : "m" (*&(x)) ); \
+} while (0)
+
+#elif defined(__WATCOMC__) && defined(__386__)
+#define DEFAULT_X86_FPU 0x037f /* See GCC comments above */
+#define FAST_X86_FPU 0x003f /* See GCC comments above */
+void _watcom_start_fast_math(unsigned short *x,unsigned short *mask);
+#pragma aux _watcom_start_fast_math = \
+ "fnstcw word ptr [eax]" \
+ "fldcw word ptr [ecx]" \
+ parm [eax] [ecx] \
+ modify exact [];
+void _watcom_end_fast_math(unsigned short *x);
+#pragma aux _watcom_end_fast_math = \
+ "fnclex" \
+ "fldcw word ptr [eax]" \
+ parm [eax] \
+ modify exact [];
+#if defined(NO_FAST_MATH)
+#define START_FAST_MATH(x) \
+do { \
+ static GLushort mask = DEFAULT_X86_FPU; \
+ _watcom_start_fast_math(&x,&mask); \
+} while (0)
+#else
+#define START_FAST_MATH(x) \
+do { \
+ static GLushort mask = FAST_X86_FPU; \
+ _watcom_start_fast_math(&x,&mask); \
+} while (0)
+#endif
+#define END_FAST_MATH(x) _watcom_end_fast_math(&x)
+
+#elif defined(_MSC_VER) && defined(_M_IX86)
+#define DEFAULT_X86_FPU 0x037f /* See GCC comments above */
+#define FAST_X86_FPU 0x003f /* See GCC comments above */
+#if defined(NO_FAST_MATH)
+#define START_FAST_MATH(x) do {\
+ static GLuint mask = DEFAULT_X86_FPU;\
+ __asm fnstcw word ptr [x]\
+ __asm fldcw word ptr [mask]\
+} while(0)
+#else
+#define START_FAST_MATH(x) do {\
+ static GLuint mask = FAST_X86_FPU;\
+ __asm fnstcw word ptr [x]\
+ __asm fldcw word ptr [mask]\
+} while(0)
+#endif
+#define END_FAST_MATH(x) do {\
+ __asm fnclex\
+ __asm fldcw word ptr [x]\
+} while(0)
+
+#else
+#define START_FAST_MATH(x) x = 0
+#define END_FAST_MATH(x) (void)(x)
+#endif
+
+
+#ifndef Elements
+#define Elements(x) (sizeof(x)/sizeof(*(x)))
+#endif
+
+
+
+#ifdef __cplusplus
+}
+#endif
+
+
+#endif /* COMPILER_H */
diff --git a/mesalib/src/mesa/main/context.c b/mesalib/src/mesa/main/context.c
index ea13bdd68..22959c69e 100644
--- a/mesalib/src/mesa/main/context.c
+++ b/mesalib/src/mesa/main/context.c
@@ -1,1892 +1,1892 @@
-/*
- * Mesa 3-D graphics library
- * Version: 7.3
- *
- * Copyright (C) 1999-2007 Brian Paul All Rights Reserved.
- * Copyright (C) 2008 VMware, Inc. All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-/**
- * \file context.c
- * Mesa context/visual/framebuffer management functions.
- * \author Brian Paul
- */
-
-/**
- * \mainpage Mesa Main Module
- *
- * \section MainIntroduction Introduction
- *
- * The Mesa Main module consists of all the files in the main/ directory.
- * Among the features of this module are:
- * <UL>
- * <LI> Structures to represent most GL state </LI>
- * <LI> State set/get functions </LI>
- * <LI> Display lists </LI>
- * <LI> Texture unit, object and image handling </LI>
- * <LI> Matrix and attribute stacks </LI>
- * </UL>
- *
- * Other modules are responsible for API dispatch, vertex transformation,
- * point/line/triangle setup, rasterization, vertex array caching,
- * vertex/fragment programs/shaders, etc.
- *
- *
- * \section AboutDoxygen About Doxygen
- *
- * If you're viewing this information as Doxygen-generated HTML you'll
- * see the documentation index at the top of this page.
- *
- * The first line lists the Mesa source code modules.
- * The second line lists the indexes available for viewing the documentation
- * for each module.
- *
- * Selecting the <b>Main page</b> link will display a summary of the module
- * (this page).
- *
- * Selecting <b>Data Structures</b> will list all C structures.
- *
- * Selecting the <b>File List</b> link will list all the source files in
- * the module.
- * Selecting a filename will show a list of all functions defined in that file.
- *
- * Selecting the <b>Data Fields</b> link will display a list of all
- * documented structure members.
- *
- * Selecting the <b>Globals</b> link will display a list
- * of all functions, structures, global variables and macros in the module.
- *
- */
-
-
-#include "glheader.h"
-#include "mfeatures.h"
-#include "imports.h"
-#include "accum.h"
-#include "api_exec.h"
-#include "arrayobj.h"
-#include "attrib.h"
-#include "blend.h"
-#include "buffers.h"
-#include "bufferobj.h"
-#include "context.h"
-#include "cpuinfo.h"
-#include "debug.h"
-#include "depth.h"
-#include "dlist.h"
-#include "eval.h"
-#include "extensions.h"
-#include "fbobject.h"
-#include "feedback.h"
-#include "fog.h"
-#include "formats.h"
-#include "framebuffer.h"
-#include "hint.h"
-#include "hash.h"
-#include "light.h"
-#include "lines.h"
-#include "macros.h"
-#include "matrix.h"
-#include "multisample.h"
-#include "pixel.h"
-#include "pixelstore.h"
-#include "points.h"
-#include "polygon.h"
-#include "queryobj.h"
-#include "syncobj.h"
-#include "rastpos.h"
-#include "remap.h"
-#include "scissor.h"
-#include "shared.h"
-#include "shaderobj.h"
-#include "simple_list.h"
-#include "state.h"
-#include "stencil.h"
-#include "texcompress_s3tc.h"
-#include "texstate.h"
-#include "transformfeedback.h"
-#include "mtypes.h"
-#include "varray.h"
-#include "version.h"
-#include "viewport.h"
-#include "vtxfmt.h"
-#include "program/program.h"
-#include "program/prog_print.h"
-#if _HAVE_FULL_GL
-#include "math/m_matrix.h"
-#endif
-#include "main/dispatch.h" /* for _gloffset_COUNT */
-
-#ifdef USE_SPARC_ASM
-#include "sparc/sparc.h"
-#endif
-
-#include "glsl_parser_extras.h"
-#include <stdbool.h>
-
-
-#ifndef MESA_VERBOSE
-int MESA_VERBOSE = 0;
-#endif
-
-#ifndef MESA_DEBUG_FLAGS
-int MESA_DEBUG_FLAGS = 0;
-#endif
-
-
-/* ubyte -> float conversion */
-GLfloat _mesa_ubyte_to_float_color_tab[256];
-
-
-
-/**
- * Swap buffers notification callback.
- *
- * \param ctx GL context.
- *
- * Called by window system just before swapping buffers.
- * We have to finish any pending rendering.
- */
-void
-_mesa_notifySwapBuffers(struct gl_context *ctx)
-{
- if (MESA_VERBOSE & VERBOSE_SWAPBUFFERS)
- _mesa_debug(ctx, "SwapBuffers\n");
- FLUSH_CURRENT( ctx, 0 );
- if (ctx->Driver.Flush) {
- ctx->Driver.Flush(ctx);
- }
-}
-
-
-/**********************************************************************/
-/** \name GL Visual allocation/destruction */
-/**********************************************************************/
-/*@{*/
-
-/**
- * Allocates a struct gl_config structure and initializes it via
- * _mesa_initialize_visual().
- *
- * \param dbFlag double buffering
- * \param stereoFlag stereo buffer
- * \param depthBits requested bits per depth buffer value. Any value in [0, 32]
- * is acceptable but the actual depth type will be GLushort or GLuint as
- * needed.
- * \param stencilBits requested minimum bits per stencil buffer value
- * \param accumRedBits, accumGreenBits, accumBlueBits, accumAlphaBits number
- * of bits per color component in accum buffer.
- * \param indexBits number of bits per pixel if \p rgbFlag is GL_FALSE
- * \param redBits number of bits per color component in frame buffer for RGB(A)
- * mode. We always use 8 in core Mesa though.
- * \param greenBits same as above.
- * \param blueBits same as above.
- * \param alphaBits same as above.
- * \param numSamples not really used.
- *
- * \return pointer to new struct gl_config or NULL if requested parameters
- * can't be met.
- *
- * \note Need to add params for level and numAuxBuffers (at least)
- */
-struct gl_config *
-_mesa_create_visual( GLboolean dbFlag,
- GLboolean stereoFlag,
- GLint redBits,
- GLint greenBits,
- GLint blueBits,
- GLint alphaBits,
- GLint depthBits,
- GLint stencilBits,
- GLint accumRedBits,
- GLint accumGreenBits,
- GLint accumBlueBits,
- GLint accumAlphaBits,
- GLint numSamples )
-{
- struct gl_config *vis = CALLOC_STRUCT(gl_config);
- if (vis) {
- if (!_mesa_initialize_visual(vis, dbFlag, stereoFlag,
- redBits, greenBits, blueBits, alphaBits,
- depthBits, stencilBits,
- accumRedBits, accumGreenBits,
- accumBlueBits, accumAlphaBits,
- numSamples)) {
- free(vis);
- return NULL;
- }
- }
- return vis;
-}
-
-
-/**
- * Makes some sanity checks and fills in the fields of the struct
- * gl_config object with the given parameters. If the caller needs to
- * set additional fields, he should just probably init the whole
- * gl_config object himself.
- *
- * \return GL_TRUE on success, or GL_FALSE on failure.
- *
- * \sa _mesa_create_visual() above for the parameter description.
- */
-GLboolean
-_mesa_initialize_visual( struct gl_config *vis,
- GLboolean dbFlag,
- GLboolean stereoFlag,
- GLint redBits,
- GLint greenBits,
- GLint blueBits,
- GLint alphaBits,
- GLint depthBits,
- GLint stencilBits,
- GLint accumRedBits,
- GLint accumGreenBits,
- GLint accumBlueBits,
- GLint accumAlphaBits,
- GLint numSamples )
-{
- assert(vis);
-
- if (depthBits < 0 || depthBits > 32) {
- return GL_FALSE;
- }
- if (stencilBits < 0 || stencilBits > STENCIL_BITS) {
- return GL_FALSE;
- }
- assert(accumRedBits >= 0);
- assert(accumGreenBits >= 0);
- assert(accumBlueBits >= 0);
- assert(accumAlphaBits >= 0);
-
- vis->rgbMode = GL_TRUE;
- vis->doubleBufferMode = dbFlag;
- vis->stereoMode = stereoFlag;
-
- vis->redBits = redBits;
- vis->greenBits = greenBits;
- vis->blueBits = blueBits;
- vis->alphaBits = alphaBits;
- vis->rgbBits = redBits + greenBits + blueBits;
-
- vis->indexBits = 0;
- vis->depthBits = depthBits;
- vis->stencilBits = stencilBits;
-
- vis->accumRedBits = accumRedBits;
- vis->accumGreenBits = accumGreenBits;
- vis->accumBlueBits = accumBlueBits;
- vis->accumAlphaBits = accumAlphaBits;
-
- vis->haveAccumBuffer = accumRedBits > 0;
- vis->haveDepthBuffer = depthBits > 0;
- vis->haveStencilBuffer = stencilBits > 0;
-
- vis->numAuxBuffers = 0;
- vis->level = 0;
- vis->sampleBuffers = numSamples > 0 ? 1 : 0;
- vis->samples = numSamples;
-
- return GL_TRUE;
-}
-
-
-/**
- * Destroy a visual and free its memory.
- *
- * \param vis visual.
- *
- * Frees the visual structure.
- */
-void
-_mesa_destroy_visual( struct gl_config *vis )
-{
- free(vis);
-}
-
-/*@}*/
-
-
-/**********************************************************************/
-/** \name Context allocation, initialization, destroying
- *
- * The purpose of the most initialization functions here is to provide the
- * default state values according to the OpenGL specification.
- */
-/**********************************************************************/
-/*@{*/
-
-
-/**
- * This is lame. gdb only seems to recognize enum types that are
- * actually used somewhere. We want to be able to print/use enum
- * values such as TEXTURE_2D_INDEX in gdb. But we don't actually use
- * the gl_texture_index type anywhere. Thus, this lame function.
- */
-static void
-dummy_enum_func(void)
-{
- gl_buffer_index bi = BUFFER_FRONT_LEFT;
- gl_face_index fi = FACE_POS_X;
- gl_frag_attrib fa = FRAG_ATTRIB_WPOS;
- gl_frag_result fr = FRAG_RESULT_DEPTH;
- gl_texture_index ti = TEXTURE_2D_ARRAY_INDEX;
- gl_vert_attrib va = VERT_ATTRIB_POS;
- gl_vert_result vr = VERT_RESULT_HPOS;
- gl_geom_attrib ga = GEOM_ATTRIB_POSITION;
- gl_geom_result gr = GEOM_RESULT_POS;
-
- (void) bi;
- (void) fi;
- (void) fa;
- (void) fr;
- (void) ti;
- (void) va;
- (void) vr;
- (void) ga;
- (void) gr;
-}
-
-
-/**
- * One-time initialization mutex lock.
- *
- * \sa Used by one_time_init().
- */
-_glthread_DECLARE_STATIC_MUTEX(OneTimeLock);
-
-
-
-/**
- * Calls all the various one-time-init functions in Mesa.
- *
- * While holding a global mutex lock, calls several initialization functions,
- * and sets the glapi callbacks if the \c MESA_DEBUG environment variable is
- * defined.
- *
- * \sa _math_init().
- */
-static void
-one_time_init( struct gl_context *ctx )
-{
- static GLbitfield api_init_mask = 0x0;
-
- _glthread_LOCK_MUTEX(OneTimeLock);
-
- /* truly one-time init */
- if (!api_init_mask) {
- GLuint i;
-
- /* do some implementation tests */
- assert( sizeof(GLbyte) == 1 );
- assert( sizeof(GLubyte) == 1 );
- assert( sizeof(GLshort) == 2 );
- assert( sizeof(GLushort) == 2 );
- assert( sizeof(GLint) == 4 );
- assert( sizeof(GLuint) == 4 );
-
- _mesa_get_cpu_features();
-
- _mesa_init_sqrt_table();
-
- /* context dependence is never a one-time thing... */
- _mesa_init_get_hash(ctx);
-
- for (i = 0; i < 256; i++) {
- _mesa_ubyte_to_float_color_tab[i] = (float) i / 255.0F;
- }
-
-#if defined(DEBUG) && defined(__DATE__) && defined(__TIME__)
- if (MESA_VERBOSE != 0) {
- _mesa_debug(ctx, "Mesa %s DEBUG build %s %s\n",
- MESA_VERSION_STRING, __DATE__, __TIME__);
- }
-#endif
-
-#ifdef DEBUG
- _mesa_test_formats();
-#endif
- }
-
- /* per-API one-time init */
- if (!(api_init_mask & (1 << ctx->API))) {
- /*
- * This is fine as ES does not use the remap table, but it may not be
- * future-proof. We cannot always initialize the remap table because
- * when an app is linked to libGLES*, there are not enough dynamic
- * entries.
- */
- if (ctx->API == API_OPENGL)
- _mesa_init_remap_table();
- }
-
- api_init_mask |= 1 << ctx->API;
-
- _glthread_UNLOCK_MUTEX(OneTimeLock);
-
- /* Hopefully atexit() is widely available. If not, we may need some
- * #ifdef tests here.
- */
- atexit(_mesa_destroy_shader_compiler);
-
- dummy_enum_func();
-}
-
-
-/**
- * Initialize fields of gl_current_attrib (aka ctx->Current.*)
- */
-static void
-_mesa_init_current(struct gl_context *ctx)
-{
- GLuint i;
-
- /* Init all to (0,0,0,1) */
- for (i = 0; i < Elements(ctx->Current.Attrib); i++) {
- ASSIGN_4V( ctx->Current.Attrib[i], 0.0, 0.0, 0.0, 1.0 );
- }
-
- /* redo special cases: */
- ASSIGN_4V( ctx->Current.Attrib[VERT_ATTRIB_WEIGHT], 1.0, 0.0, 0.0, 0.0 );
- ASSIGN_4V( ctx->Current.Attrib[VERT_ATTRIB_NORMAL], 0.0, 0.0, 1.0, 1.0 );
- ASSIGN_4V( ctx->Current.Attrib[VERT_ATTRIB_COLOR0], 1.0, 1.0, 1.0, 1.0 );
- ASSIGN_4V( ctx->Current.Attrib[VERT_ATTRIB_COLOR1], 0.0, 0.0, 0.0, 1.0 );
- ASSIGN_4V( ctx->Current.Attrib[VERT_ATTRIB_COLOR_INDEX], 1.0, 0.0, 0.0, 1.0 );
- ASSIGN_4V( ctx->Current.Attrib[VERT_ATTRIB_EDGEFLAG], 1.0, 0.0, 0.0, 1.0 );
-}
-
-
-/**
- * Init vertex/fragment/geometry program limits.
- * Important: drivers should override these with actual limits.
- */
-static void
-init_program_limits(GLenum type, struct gl_program_constants *prog)
-{
- prog->MaxInstructions = MAX_PROGRAM_INSTRUCTIONS;
- prog->MaxAluInstructions = MAX_PROGRAM_INSTRUCTIONS;
- prog->MaxTexInstructions = MAX_PROGRAM_INSTRUCTIONS;
- prog->MaxTexIndirections = MAX_PROGRAM_INSTRUCTIONS;
- prog->MaxTemps = MAX_PROGRAM_TEMPS;
- prog->MaxEnvParams = MAX_PROGRAM_ENV_PARAMS;
- prog->MaxLocalParams = MAX_PROGRAM_LOCAL_PARAMS;
- prog->MaxAddressOffset = MAX_PROGRAM_LOCAL_PARAMS;
-
- switch (type) {
- case GL_VERTEX_PROGRAM_ARB:
- prog->MaxParameters = MAX_VERTEX_PROGRAM_PARAMS;
- prog->MaxAttribs = MAX_NV_VERTEX_PROGRAM_INPUTS;
- prog->MaxAddressRegs = MAX_VERTEX_PROGRAM_ADDRESS_REGS;
- prog->MaxUniformComponents = 4 * MAX_UNIFORMS;
- break;
- case GL_FRAGMENT_PROGRAM_ARB:
- prog->MaxParameters = MAX_NV_FRAGMENT_PROGRAM_PARAMS;
- prog->MaxAttribs = MAX_NV_FRAGMENT_PROGRAM_INPUTS;
- prog->MaxAddressRegs = MAX_FRAGMENT_PROGRAM_ADDRESS_REGS;
- prog->MaxUniformComponents = 4 * MAX_UNIFORMS;
- break;
- case MESA_GEOMETRY_PROGRAM:
- prog->MaxParameters = MAX_NV_VERTEX_PROGRAM_PARAMS;
- prog->MaxAttribs = MAX_NV_VERTEX_PROGRAM_INPUTS;
- prog->MaxAddressRegs = MAX_VERTEX_PROGRAM_ADDRESS_REGS;
- prog->MaxUniformComponents = MAX_GEOMETRY_UNIFORM_COMPONENTS;
- break;
- default:
- assert(0 && "Bad program type in init_program_limits()");
- }
-
- /* Set the native limits to zero. This implies that there is no native
- * support for shaders. Let the drivers fill in the actual values.
- */
- prog->MaxNativeInstructions = 0;
- prog->MaxNativeAluInstructions = 0;
- prog->MaxNativeTexInstructions = 0;
- prog->MaxNativeTexIndirections = 0;
- prog->MaxNativeAttribs = 0;
- prog->MaxNativeTemps = 0;
- prog->MaxNativeAddressRegs = 0;
- prog->MaxNativeParameters = 0;
-
- /* Set GLSL datatype range/precision info assuming IEEE float values.
- * Drivers should override these defaults as needed.
- */
- prog->MediumFloat.RangeMin = 127;
- prog->MediumFloat.RangeMax = 127;
- prog->MediumFloat.Precision = 23;
- prog->LowFloat = prog->HighFloat = prog->MediumFloat;
-
- /* Assume ints are stored as floats for now, since this is the least-common
- * denominator. The OpenGL ES spec implies (page 132) that the precision
- * of integer types should be 0. Practically speaking, IEEE
- * single-precision floating point values can only store integers in the
- * range [-0x01000000, 0x01000000] without loss of precision.
- */
- prog->MediumInt.RangeMin = 24;
- prog->MediumInt.RangeMax = 24;
- prog->MediumInt.Precision = 0;
- prog->LowInt = prog->HighInt = prog->MediumInt;
-}
-
-
-/**
- * Initialize fields of gl_constants (aka ctx->Const.*).
- * Use defaults from config.h. The device drivers will often override
- * some of these values (such as number of texture units).
- */
-static void
-_mesa_init_constants(struct gl_context *ctx)
-{
- assert(ctx);
-
- /* Constants, may be overriden (usually only reduced) by device drivers */
- ctx->Const.MaxTextureMbytes = MAX_TEXTURE_MBYTES;
- ctx->Const.MaxTextureLevels = MAX_TEXTURE_LEVELS;
- ctx->Const.Max3DTextureLevels = MAX_3D_TEXTURE_LEVELS;
- ctx->Const.MaxCubeTextureLevels = MAX_CUBE_TEXTURE_LEVELS;
- ctx->Const.MaxTextureRectSize = MAX_TEXTURE_RECT_SIZE;
- ctx->Const.MaxArrayTextureLayers = MAX_ARRAY_TEXTURE_LAYERS;
- ctx->Const.MaxTextureCoordUnits = MAX_TEXTURE_COORD_UNITS;
- ctx->Const.MaxTextureImageUnits = MAX_TEXTURE_IMAGE_UNITS;
- ctx->Const.MaxTextureUnits = MIN2(ctx->Const.MaxTextureCoordUnits,
- ctx->Const.MaxTextureImageUnits);
- ctx->Const.MaxTextureMaxAnisotropy = MAX_TEXTURE_MAX_ANISOTROPY;
- ctx->Const.MaxTextureLodBias = MAX_TEXTURE_LOD_BIAS;
- ctx->Const.MaxTextureBufferSize = 65536;
- ctx->Const.MaxArrayLockSize = MAX_ARRAY_LOCK_SIZE;
- ctx->Const.SubPixelBits = SUB_PIXEL_BITS;
- ctx->Const.MinPointSize = MIN_POINT_SIZE;
- ctx->Const.MaxPointSize = MAX_POINT_SIZE;
- ctx->Const.MinPointSizeAA = MIN_POINT_SIZE;
- ctx->Const.MaxPointSizeAA = MAX_POINT_SIZE;
- ctx->Const.PointSizeGranularity = (GLfloat) POINT_SIZE_GRANULARITY;
- ctx->Const.MinLineWidth = MIN_LINE_WIDTH;
- ctx->Const.MaxLineWidth = MAX_LINE_WIDTH;
- ctx->Const.MinLineWidthAA = MIN_LINE_WIDTH;
- ctx->Const.MaxLineWidthAA = MAX_LINE_WIDTH;
- ctx->Const.LineWidthGranularity = (GLfloat) LINE_WIDTH_GRANULARITY;
- ctx->Const.MaxColorTableSize = MAX_COLOR_TABLE_SIZE;
- ctx->Const.MaxClipPlanes = MAX_CLIP_PLANES;
- ctx->Const.MaxLights = MAX_LIGHTS;
- ctx->Const.MaxShininess = 128.0;
- ctx->Const.MaxSpotExponent = 128.0;
- ctx->Const.MaxViewportWidth = MAX_WIDTH;
- ctx->Const.MaxViewportHeight = MAX_HEIGHT;
-#if FEATURE_ARB_vertex_program
- init_program_limits(GL_VERTEX_PROGRAM_ARB, &ctx->Const.VertexProgram);
-#endif
-#if FEATURE_ARB_fragment_program
- init_program_limits(GL_FRAGMENT_PROGRAM_ARB, &ctx->Const.FragmentProgram);
-#endif
-#if FEATURE_ARB_geometry_shader4
- init_program_limits(MESA_GEOMETRY_PROGRAM, &ctx->Const.GeometryProgram);
-#endif
- ctx->Const.MaxProgramMatrices = MAX_PROGRAM_MATRICES;
- ctx->Const.MaxProgramMatrixStackDepth = MAX_PROGRAM_MATRIX_STACK_DEPTH;
-
- /* CheckArrayBounds is overriden by drivers/x11 for X server */
- ctx->Const.CheckArrayBounds = GL_FALSE;
-
- /* GL_ARB_draw_buffers */
- ctx->Const.MaxDrawBuffers = MAX_DRAW_BUFFERS;
-
-#if FEATURE_EXT_framebuffer_object
- ctx->Const.MaxColorAttachments = MAX_COLOR_ATTACHMENTS;
- ctx->Const.MaxRenderbufferSize = MAX_WIDTH;
-#endif
-
-#if FEATURE_ARB_vertex_shader
- ctx->Const.MaxVertexTextureImageUnits = MAX_VERTEX_TEXTURE_IMAGE_UNITS;
- ctx->Const.MaxCombinedTextureImageUnits = MAX_COMBINED_TEXTURE_IMAGE_UNITS;
- ctx->Const.MaxVarying = MAX_VARYING;
-#endif
-#if FEATURE_ARB_geometry_shader4
- ctx->Const.MaxGeometryTextureImageUnits = MAX_GEOMETRY_TEXTURE_IMAGE_UNITS;
- ctx->Const.MaxVertexVaryingComponents = MAX_VERTEX_VARYING_COMPONENTS;
- ctx->Const.MaxGeometryVaryingComponents = MAX_GEOMETRY_VARYING_COMPONENTS;
- ctx->Const.MaxGeometryOutputVertices = MAX_GEOMETRY_OUTPUT_VERTICES;
- ctx->Const.MaxGeometryTotalOutputComponents = MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS;
-#endif
-
- /* Shading language version */
- if (ctx->API == API_OPENGL) {
- ctx->Const.GLSLVersion = 120;
- }
- else if (ctx->API == API_OPENGLES2) {
- ctx->Const.GLSLVersion = 100;
- }
- else if (ctx->API == API_OPENGLES) {
- ctx->Const.GLSLVersion = 0; /* GLSL not supported */
- }
-
- /* GL_ARB_framebuffer_object */
- ctx->Const.MaxSamples = 0;
-
- /* GL_ARB_sync */
- ctx->Const.MaxServerWaitTimeout = (GLuint64) ~0;
-
- /* GL_ATI_envmap_bumpmap */
- ctx->Const.SupportedBumpUnits = SUPPORTED_ATI_BUMP_UNITS;
-
- /* GL_EXT_provoking_vertex */
- ctx->Const.QuadsFollowProvokingVertexConvention = GL_TRUE;
-
- /* GL_EXT_transform_feedback */
- ctx->Const.MaxTransformFeedbackSeparateAttribs = MAX_FEEDBACK_ATTRIBS;
- ctx->Const.MaxTransformFeedbackSeparateComponents = 4 * MAX_FEEDBACK_ATTRIBS;
- ctx->Const.MaxTransformFeedbackInterleavedComponents = 4 * MAX_FEEDBACK_ATTRIBS;
-
- /* GL 3.2: hard-coded for now: */
- ctx->Const.ProfileMask = GL_CONTEXT_COMPATIBILITY_PROFILE_BIT;
-
- /** GL_EXT_gpu_shader4 */
- ctx->Const.MinProgramTexelOffset = -8;
- ctx->Const.MaxProgramTexelOffset = 7;
-
- /* GL_ARB_robustness */
- ctx->Const.ResetStrategy = GL_NO_RESET_NOTIFICATION_ARB;
-}
-
-
-/**
- * Do some sanity checks on the limits/constants for the given context.
- * Only called the first time a context is bound.
- */
-static void
-check_context_limits(struct gl_context *ctx)
-{
- /* check that we don't exceed the size of various bitfields */
- assert(VERT_RESULT_MAX <=
- (8 * sizeof(ctx->VertexProgram._Current->Base.OutputsWritten)));
- assert(FRAG_ATTRIB_MAX <=
- (8 * sizeof(ctx->FragmentProgram._Current->Base.InputsRead)));
-
- assert(MAX_COMBINED_TEXTURE_IMAGE_UNITS <= 8 * sizeof(GLbitfield));
-
- /* shader-related checks */
- assert(ctx->Const.FragmentProgram.MaxLocalParams <= MAX_PROGRAM_LOCAL_PARAMS);
- assert(ctx->Const.VertexProgram.MaxLocalParams <= MAX_PROGRAM_LOCAL_PARAMS);
-
- assert(MAX_NV_FRAGMENT_PROGRAM_TEMPS <= MAX_PROGRAM_TEMPS);
- assert(MAX_NV_VERTEX_PROGRAM_TEMPS <= MAX_PROGRAM_TEMPS);
- assert(MAX_NV_VERTEX_PROGRAM_INPUTS <= VERT_ATTRIB_MAX);
- assert(MAX_NV_VERTEX_PROGRAM_OUTPUTS <= VERT_RESULT_MAX);
-
- /* Texture unit checks */
- assert(ctx->Const.MaxTextureImageUnits > 0);
- assert(ctx->Const.MaxTextureImageUnits <= MAX_TEXTURE_IMAGE_UNITS);
- assert(ctx->Const.MaxTextureCoordUnits > 0);
- assert(ctx->Const.MaxTextureCoordUnits <= MAX_TEXTURE_COORD_UNITS);
- assert(ctx->Const.MaxTextureUnits > 0);
- assert(ctx->Const.MaxTextureUnits <= MAX_TEXTURE_IMAGE_UNITS);
- assert(ctx->Const.MaxTextureUnits <= MAX_TEXTURE_COORD_UNITS);
- assert(ctx->Const.MaxTextureUnits == MIN2(ctx->Const.MaxTextureImageUnits,
- ctx->Const.MaxTextureCoordUnits));
- assert(ctx->Const.MaxCombinedTextureImageUnits > 0);
- assert(ctx->Const.MaxCombinedTextureImageUnits <= MAX_COMBINED_TEXTURE_IMAGE_UNITS);
- assert(ctx->Const.MaxTextureCoordUnits <= MAX_COMBINED_TEXTURE_IMAGE_UNITS);
- /* number of coord units cannot be greater than number of image units */
- assert(ctx->Const.MaxTextureCoordUnits <= ctx->Const.MaxTextureImageUnits);
-
-
- /* Texture size checks */
- assert(ctx->Const.MaxTextureLevels <= MAX_TEXTURE_LEVELS);
- assert(ctx->Const.Max3DTextureLevels <= MAX_3D_TEXTURE_LEVELS);
- assert(ctx->Const.MaxCubeTextureLevels <= MAX_CUBE_TEXTURE_LEVELS);
- assert(ctx->Const.MaxTextureRectSize <= MAX_TEXTURE_RECT_SIZE);
-
- /* make sure largest texture image is <= MAX_WIDTH in size */
- assert((1 << (ctx->Const.MaxTextureLevels - 1)) <= MAX_WIDTH);
- assert((1 << (ctx->Const.MaxCubeTextureLevels - 1)) <= MAX_WIDTH);
- assert((1 << (ctx->Const.Max3DTextureLevels - 1)) <= MAX_WIDTH);
-
- /* Texture level checks */
- assert(MAX_TEXTURE_LEVELS >= MAX_3D_TEXTURE_LEVELS);
- assert(MAX_TEXTURE_LEVELS >= MAX_CUBE_TEXTURE_LEVELS);
-
- /* Max texture size should be <= max viewport size (render to texture) */
- assert((1 << (MAX_TEXTURE_LEVELS - 1)) <= MAX_WIDTH);
-
- assert(ctx->Const.MaxViewportWidth <= MAX_WIDTH);
- assert(ctx->Const.MaxViewportHeight <= MAX_WIDTH);
-
- assert(ctx->Const.MaxDrawBuffers <= MAX_DRAW_BUFFERS);
-
- /* if this fails, add more enum values to gl_buffer_index */
- assert(BUFFER_COLOR0 + MAX_DRAW_BUFFERS <= BUFFER_COUNT);
-
- /* XXX probably add more tests */
-}
-
-
-/**
- * Initialize the attribute groups in a GL context.
- *
- * \param ctx GL context.
- *
- * Initializes all the attributes, calling the respective <tt>init*</tt>
- * functions for the more complex data structures.
- */
-static GLboolean
-init_attrib_groups(struct gl_context *ctx)
-{
- assert(ctx);
-
- /* Constants */
- _mesa_init_constants( ctx );
-
- /* Extensions */
- _mesa_init_extensions( ctx );
-
- /* Attribute Groups */
- _mesa_init_accum( ctx );
- _mesa_init_attrib( ctx );
- _mesa_init_buffer_objects( ctx );
- _mesa_init_color( ctx );
- _mesa_init_current( ctx );
- _mesa_init_depth( ctx );
- _mesa_init_debug( ctx );
- _mesa_init_display_list( ctx );
- _mesa_init_eval( ctx );
- _mesa_init_fbobjects( ctx );
- _mesa_init_feedback( ctx );
- _mesa_init_fog( ctx );
- _mesa_init_hint( ctx );
- _mesa_init_line( ctx );
- _mesa_init_lighting( ctx );
- _mesa_init_matrix( ctx );
- _mesa_init_multisample( ctx );
- _mesa_init_pixel( ctx );
- _mesa_init_pixelstore( ctx );
- _mesa_init_point( ctx );
- _mesa_init_polygon( ctx );
- _mesa_init_program( ctx );
- _mesa_init_queryobj( ctx );
- _mesa_init_sync( ctx );
- _mesa_init_rastpos( ctx );
- _mesa_init_scissor( ctx );
- _mesa_init_shader_state( ctx );
- _mesa_init_stencil( ctx );
- _mesa_init_transform( ctx );
- _mesa_init_transform_feedback( ctx );
- _mesa_init_varray( ctx );
- _mesa_init_viewport( ctx );
-
- if (!_mesa_init_texture( ctx ))
- return GL_FALSE;
-
- _mesa_init_texture_s3tc( ctx );
-
- /* Miscellaneous */
- ctx->NewState = _NEW_ALL;
- ctx->ErrorValue = (GLenum) GL_NO_ERROR;
- ctx->ResetStatus = (GLenum) GL_NO_ERROR;
- ctx->varying_vp_inputs = ~0;
-
- return GL_TRUE;
-}
-
-
-/**
- * Update default objects in a GL context with respect to shared state.
- *
- * \param ctx GL context.
- *
- * Removes references to old default objects, (texture objects, program
- * objects, etc.) and changes to reference those from the current shared
- * state.
- */
-static GLboolean
-update_default_objects(struct gl_context *ctx)
-{
- assert(ctx);
-
- _mesa_update_default_objects_program(ctx);
- _mesa_update_default_objects_texture(ctx);
- _mesa_update_default_objects_buffer_objects(ctx);
-
- return GL_TRUE;
-}
-
-
-/**
- * This is the default function we plug into all dispatch table slots
- * This helps prevents a segfault when someone calls a GL function without
- * first checking if the extension's supported.
- */
-static int
-generic_nop(void)
-{
- _mesa_warning(NULL, "User called no-op dispatch function (an unsupported extension function?)");
- return 0;
-}
-
-
-/**
- * Allocate and initialize a new dispatch table.
- */
-struct _glapi_table *
-_mesa_alloc_dispatch_table(int size)
-{
- /* Find the larger of Mesa's dispatch table and libGL's dispatch table.
- * In practice, this'll be the same for stand-alone Mesa. But for DRI
- * Mesa we do this to accomodate different versions of libGL and various
- * DRI drivers.
- */
- GLint numEntries = MAX2(_glapi_get_dispatch_table_size(), _gloffset_COUNT);
- struct _glapi_table *table;
-
- /* should never happen, but just in case */
- numEntries = MAX2(numEntries, size);
-
- table = (struct _glapi_table *) malloc(numEntries * sizeof(_glapi_proc));
- if (table) {
- _glapi_proc *entry = (_glapi_proc *) table;
- GLint i;
- for (i = 0; i < numEntries; i++) {
- entry[i] = (_glapi_proc) generic_nop;
- }
- }
- return table;
-}
-
-
-/**
- * Initialize a struct gl_context struct (rendering context).
- *
- * This includes allocating all the other structs and arrays which hang off of
- * the context by pointers.
- * Note that the driver needs to pass in its dd_function_table here since
- * we need to at least call driverFunctions->NewTextureObject to create the
- * default texture objects.
- *
- * Called by _mesa_create_context().
- *
- * Performs the imports and exports callback tables initialization, and
- * miscellaneous one-time initializations. If no shared context is supplied one
- * is allocated, and increase its reference count. Setups the GL API dispatch
- * tables. Initialize the TNL module. Sets the maximum Z buffer depth.
- * Finally queries the \c MESA_DEBUG and \c MESA_VERBOSE environment variables
- * for debug flags.
- *
- * \param ctx the context to initialize
- * \param api the GL API type to create the context for
- * \param visual describes the visual attributes for this context
- * \param share_list points to context to share textures, display lists,
- * etc with, or NULL
- * \param driverFunctions table of device driver functions for this context
- * to use
- * \param driverContext pointer to driver-specific context data
- */
-GLboolean
-_mesa_initialize_context(struct gl_context *ctx,
- gl_api api,
- const struct gl_config *visual,
- struct gl_context *share_list,
- const struct dd_function_table *driverFunctions,
- void *driverContext)
-{
- struct gl_shared_state *shared;
- int i;
-
- /*ASSERT(driverContext);*/
- assert(driverFunctions->NewTextureObject);
- assert(driverFunctions->FreeTexImageData);
-
- ctx->API = api;
- ctx->Visual = *visual;
- ctx->DrawBuffer = NULL;
- ctx->ReadBuffer = NULL;
- ctx->WinSysDrawBuffer = NULL;
- ctx->WinSysReadBuffer = NULL;
-
- /* misc one-time initializations */
- one_time_init(ctx);
-
- /* Plug in driver functions and context pointer here.
- * This is important because when we call alloc_shared_state() below
- * we'll call ctx->Driver.NewTextureObject() to create the default
- * textures.
- */
- ctx->Driver = *driverFunctions;
- ctx->DriverCtx = driverContext;
-
- if (share_list) {
- /* share state with another context */
- shared = share_list->Shared;
- }
- else {
- /* allocate new, unshared state */
- shared = _mesa_alloc_shared_state(ctx);
- if (!shared)
- return GL_FALSE;
- }
-
- _glthread_LOCK_MUTEX(shared->Mutex);
- ctx->Shared = shared;
- shared->RefCount++;
- _glthread_UNLOCK_MUTEX(shared->Mutex);
-
- if (!init_attrib_groups( ctx )) {
- _mesa_release_shared_state(ctx, ctx->Shared);
- return GL_FALSE;
- }
-
-#if FEATURE_dispatch
- /* setup the API dispatch tables */
- switch (ctx->API) {
-#if FEATURE_GL
- case API_OPENGL:
- ctx->Exec = _mesa_create_exec_table();
- break;
-#endif
-#if FEATURE_ES1
- case API_OPENGLES:
- ctx->Exec = _mesa_create_exec_table_es1();
- break;
-#endif
-#if FEATURE_ES2
- case API_OPENGLES2:
- ctx->Exec = _mesa_create_exec_table_es2();
- break;
-#endif
- default:
- _mesa_problem(ctx, "unknown or unsupported API");
- break;
- }
-
- if (!ctx->Exec) {
- _mesa_release_shared_state(ctx, ctx->Shared);
- return GL_FALSE;
- }
-#endif
- ctx->CurrentDispatch = ctx->Exec;
-
- ctx->FragmentProgram._MaintainTexEnvProgram
- = (_mesa_getenv("MESA_TEX_PROG") != NULL);
-
- ctx->VertexProgram._MaintainTnlProgram
- = (_mesa_getenv("MESA_TNL_PROG") != NULL);
- if (ctx->VertexProgram._MaintainTnlProgram) {
- /* this is required... */
- ctx->FragmentProgram._MaintainTexEnvProgram = GL_TRUE;
- }
-
- /* Mesa core handles all the formats that mesa core knows about.
- * Drivers will want to override this list with just the formats
- * they can handle, and confirm that appropriate fallbacks exist in
- * _mesa_choose_tex_format().
- */
- memset(&ctx->TextureFormatSupported, GL_TRUE,
- sizeof(ctx->TextureFormatSupported));
-
- switch (ctx->API) {
- case API_OPENGL:
-#if FEATURE_dlist
- ctx->Save = _mesa_create_save_table();
- if (!ctx->Save) {
- _mesa_release_shared_state(ctx, ctx->Shared);
- free(ctx->Exec);
- return GL_FALSE;
- }
-
- _mesa_install_save_vtxfmt( ctx, &ctx->ListState.ListVtxfmt );
-#endif
- break;
- case API_OPENGLES:
- /**
- * GL_OES_texture_cube_map says
- * "Initially all texture generation modes are set to REFLECTION_MAP_OES"
- */
- for (i = 0; i < MAX_TEXTURE_UNITS; i++) {
- struct gl_texture_unit *texUnit = &ctx->Texture.Unit[i];
- texUnit->GenS.Mode = GL_REFLECTION_MAP_NV;
- texUnit->GenT.Mode = GL_REFLECTION_MAP_NV;
- texUnit->GenR.Mode = GL_REFLECTION_MAP_NV;
- texUnit->GenS._ModeBit = TEXGEN_REFLECTION_MAP_NV;
- texUnit->GenT._ModeBit = TEXGEN_REFLECTION_MAP_NV;
- texUnit->GenR._ModeBit = TEXGEN_REFLECTION_MAP_NV;
- }
- break;
- case API_OPENGLES2:
- ctx->FragmentProgram._MaintainTexEnvProgram = GL_TRUE;
- ctx->VertexProgram._MaintainTnlProgram = GL_TRUE;
- ctx->Point.PointSprite = GL_TRUE; /* always on for ES 2.x */
- break;
- }
-
- ctx->FirstTimeCurrent = GL_TRUE;
-
- return GL_TRUE;
-}
-
-
-/**
- * Allocate and initialize a struct gl_context structure.
- * Note that the driver needs to pass in its dd_function_table here since
- * we need to at least call driverFunctions->NewTextureObject to initialize
- * the rendering context.
- *
- * \param api the GL API type to create the context for
- * \param visual a struct gl_config pointer (we copy the struct contents)
- * \param share_list another context to share display lists with or NULL
- * \param driverFunctions points to the dd_function_table into which the
- * driver has plugged in all its special functions.
- * \param driverContext points to the device driver's private context state
- *
- * \return pointer to a new __struct gl_contextRec or NULL if error.
- */
-struct gl_context *
-_mesa_create_context(gl_api api,
- const struct gl_config *visual,
- struct gl_context *share_list,
- const struct dd_function_table *driverFunctions,
- void *driverContext)
-{
- struct gl_context *ctx;
-
- ASSERT(visual);
- /*ASSERT(driverContext);*/
-
- ctx = (struct gl_context *) calloc(1, sizeof(struct gl_context));
- if (!ctx)
- return NULL;
-
- if (_mesa_initialize_context(ctx, api, visual, share_list,
- driverFunctions, driverContext)) {
- return ctx;
- }
- else {
- free(ctx);
- return NULL;
- }
-}
-
-
-/**
- * Free the data associated with the given context.
- *
- * But doesn't free the struct gl_context struct itself.
- *
- * \sa _mesa_initialize_context() and init_attrib_groups().
- */
-void
-_mesa_free_context_data( struct gl_context *ctx )
-{
- if (!_mesa_get_current_context()){
- /* No current context, but we may need one in order to delete
- * texture objs, etc. So temporarily bind the context now.
- */
- _mesa_make_current(ctx, NULL, NULL);
- }
-
- /* unreference WinSysDraw/Read buffers */
- _mesa_reference_framebuffer(&ctx->WinSysDrawBuffer, NULL);
- _mesa_reference_framebuffer(&ctx->WinSysReadBuffer, NULL);
- _mesa_reference_framebuffer(&ctx->DrawBuffer, NULL);
- _mesa_reference_framebuffer(&ctx->ReadBuffer, NULL);
-
- _mesa_reference_vertprog(ctx, &ctx->VertexProgram.Current, NULL);
- _mesa_reference_vertprog(ctx, &ctx->VertexProgram._Current, NULL);
- _mesa_reference_vertprog(ctx, &ctx->VertexProgram._TnlProgram, NULL);
-
- _mesa_reference_fragprog(ctx, &ctx->FragmentProgram.Current, NULL);
- _mesa_reference_fragprog(ctx, &ctx->FragmentProgram._Current, NULL);
- _mesa_reference_fragprog(ctx, &ctx->FragmentProgram._TexEnvProgram, NULL);
-
- _mesa_free_attrib_data(ctx);
- _mesa_free_buffer_objects(ctx);
- _mesa_free_lighting_data( ctx );
- _mesa_free_eval_data( ctx );
- _mesa_free_texture_data( ctx );
- _mesa_free_matrix_data( ctx );
- _mesa_free_viewport_data( ctx );
- _mesa_free_program_data(ctx);
- _mesa_free_shader_state(ctx);
- _mesa_free_queryobj_data(ctx);
- _mesa_free_sync_data(ctx);
- _mesa_free_varray_data(ctx);
- _mesa_free_transform_feedback(ctx);
-
- _mesa_delete_array_object(ctx, ctx->Array.DefaultArrayObj);
-
-#if FEATURE_ARB_pixel_buffer_object
- _mesa_reference_buffer_object(ctx, &ctx->Pack.BufferObj, NULL);
- _mesa_reference_buffer_object(ctx, &ctx->Unpack.BufferObj, NULL);
- _mesa_reference_buffer_object(ctx, &ctx->DefaultPacking.BufferObj, NULL);
-#endif
-
-#if FEATURE_ARB_vertex_buffer_object
- _mesa_reference_buffer_object(ctx, &ctx->Array.ArrayBufferObj, NULL);
- _mesa_reference_buffer_object(ctx, &ctx->Array.ElementArrayBufferObj, NULL);
-#endif
-
- /* free dispatch tables */
- free(ctx->Exec);
- free(ctx->Save);
-
- /* Shared context state (display lists, textures, etc) */
- _mesa_release_shared_state( ctx, ctx->Shared );
-
- /* needs to be after freeing shared state */
- _mesa_free_display_list_data(ctx);
-
- if (ctx->Extensions.String)
- free((void *) ctx->Extensions.String);
-
- if (ctx->VersionString)
- free(ctx->VersionString);
-
- /* unbind the context if it's currently bound */
- if (ctx == _mesa_get_current_context()) {
- _mesa_make_current(NULL, NULL, NULL);
- }
-}
-
-
-/**
- * Destroy a struct gl_context structure.
- *
- * \param ctx GL context.
- *
- * Calls _mesa_free_context_data() and frees the gl_context object itself.
- */
-void
-_mesa_destroy_context( struct gl_context *ctx )
-{
- if (ctx) {
- _mesa_free_context_data(ctx);
- free( (void *) ctx );
- }
-}
-
-
-#if _HAVE_FULL_GL
-/**
- * Copy attribute groups from one context to another.
- *
- * \param src source context
- * \param dst destination context
- * \param mask bitwise OR of GL_*_BIT flags
- *
- * According to the bits specified in \p mask, copies the corresponding
- * attributes from \p src into \p dst. For many of the attributes a simple \c
- * memcpy is not enough due to the existence of internal pointers in their data
- * structures.
- */
-void
-_mesa_copy_context( const struct gl_context *src, struct gl_context *dst,
- GLuint mask )
-{
- if (mask & GL_ACCUM_BUFFER_BIT) {
- /* OK to memcpy */
- dst->Accum = src->Accum;
- }
- if (mask & GL_COLOR_BUFFER_BIT) {
- /* OK to memcpy */
- dst->Color = src->Color;
- }
- if (mask & GL_CURRENT_BIT) {
- /* OK to memcpy */
- dst->Current = src->Current;
- }
- if (mask & GL_DEPTH_BUFFER_BIT) {
- /* OK to memcpy */
- dst->Depth = src->Depth;
- }
- if (mask & GL_ENABLE_BIT) {
- /* no op */
- }
- if (mask & GL_EVAL_BIT) {
- /* OK to memcpy */
- dst->Eval = src->Eval;
- }
- if (mask & GL_FOG_BIT) {
- /* OK to memcpy */
- dst->Fog = src->Fog;
- }
- if (mask & GL_HINT_BIT) {
- /* OK to memcpy */
- dst->Hint = src->Hint;
- }
- if (mask & GL_LIGHTING_BIT) {
- GLuint i;
- /* begin with memcpy */
- dst->Light = src->Light;
- /* fixup linked lists to prevent pointer insanity */
- make_empty_list( &(dst->Light.EnabledList) );
- for (i = 0; i < MAX_LIGHTS; i++) {
- if (dst->Light.Light[i].Enabled) {
- insert_at_tail(&(dst->Light.EnabledList), &(dst->Light.Light[i]));
- }
- }
- }
- if (mask & GL_LINE_BIT) {
- /* OK to memcpy */
- dst->Line = src->Line;
- }
- if (mask & GL_LIST_BIT) {
- /* OK to memcpy */
- dst->List = src->List;
- }
- if (mask & GL_PIXEL_MODE_BIT) {
- /* OK to memcpy */
- dst->Pixel = src->Pixel;
- }
- if (mask & GL_POINT_BIT) {
- /* OK to memcpy */
- dst->Point = src->Point;
- }
- if (mask & GL_POLYGON_BIT) {
- /* OK to memcpy */
- dst->Polygon = src->Polygon;
- }
- if (mask & GL_POLYGON_STIPPLE_BIT) {
- /* Use loop instead of memcpy due to problem with Portland Group's
- * C compiler. Reported by John Stone.
- */
- GLuint i;
- for (i = 0; i < 32; i++) {
- dst->PolygonStipple[i] = src->PolygonStipple[i];
- }
- }
- if (mask & GL_SCISSOR_BIT) {
- /* OK to memcpy */
- dst->Scissor = src->Scissor;
- }
- if (mask & GL_STENCIL_BUFFER_BIT) {
- /* OK to memcpy */
- dst->Stencil = src->Stencil;
- }
- if (mask & GL_TEXTURE_BIT) {
- /* Cannot memcpy because of pointers */
- _mesa_copy_texture_state(src, dst);
- }
- if (mask & GL_TRANSFORM_BIT) {
- /* OK to memcpy */
- dst->Transform = src->Transform;
- }
- if (mask & GL_VIEWPORT_BIT) {
- /* Cannot use memcpy, because of pointers in GLmatrix _WindowMap */
- dst->Viewport.X = src->Viewport.X;
- dst->Viewport.Y = src->Viewport.Y;
- dst->Viewport.Width = src->Viewport.Width;
- dst->Viewport.Height = src->Viewport.Height;
- dst->Viewport.Near = src->Viewport.Near;
- dst->Viewport.Far = src->Viewport.Far;
- _math_matrix_copy(&dst->Viewport._WindowMap, &src->Viewport._WindowMap);
- }
-
- /* XXX FIXME: Call callbacks?
- */
- dst->NewState = _NEW_ALL;
-}
-#endif
-
-
-/**
- * Check if the given context can render into the given framebuffer
- * by checking visual attributes.
- *
- * Most of these tests could go away because Mesa is now pretty flexible
- * in terms of mixing rendering contexts with framebuffers. As long
- * as RGB vs. CI mode agree, we're probably good.
- *
- * \return GL_TRUE if compatible, GL_FALSE otherwise.
- */
-static GLboolean
-check_compatible(const struct gl_context *ctx,
- const struct gl_framebuffer *buffer)
-{
- const struct gl_config *ctxvis = &ctx->Visual;
- const struct gl_config *bufvis = &buffer->Visual;
-
- if (buffer == _mesa_get_incomplete_framebuffer())
- return GL_TRUE;
-
-#if 0
- /* disabling this fixes the fgl_glxgears pbuffer demo */
- if (ctxvis->doubleBufferMode && !bufvis->doubleBufferMode)
- return GL_FALSE;
-#endif
- if (ctxvis->stereoMode && !bufvis->stereoMode)
- return GL_FALSE;
- if (ctxvis->haveAccumBuffer && !bufvis->haveAccumBuffer)
- return GL_FALSE;
- if (ctxvis->haveDepthBuffer && !bufvis->haveDepthBuffer)
- return GL_FALSE;
- if (ctxvis->haveStencilBuffer && !bufvis->haveStencilBuffer)
- return GL_FALSE;
- if (ctxvis->redMask && ctxvis->redMask != bufvis->redMask)
- return GL_FALSE;
- if (ctxvis->greenMask && ctxvis->greenMask != bufvis->greenMask)
- return GL_FALSE;
- if (ctxvis->blueMask && ctxvis->blueMask != bufvis->blueMask)
- return GL_FALSE;
-#if 0
- /* disabled (see bug 11161) */
- if (ctxvis->depthBits && ctxvis->depthBits != bufvis->depthBits)
- return GL_FALSE;
-#endif
- if (ctxvis->stencilBits && ctxvis->stencilBits != bufvis->stencilBits)
- return GL_FALSE;
-
- return GL_TRUE;
-}
-
-
-/**
- * Do one-time initialization for the given framebuffer. Specifically,
- * ask the driver for the window's current size and update the framebuffer
- * object to match.
- * Really, the device driver should totally take care of this.
- */
-static void
-initialize_framebuffer_size(struct gl_context *ctx, struct gl_framebuffer *fb)
-{
- GLuint width, height;
- if (ctx->Driver.GetBufferSize) {
- ctx->Driver.GetBufferSize(fb, &width, &height);
- if (ctx->Driver.ResizeBuffers)
- ctx->Driver.ResizeBuffers(ctx, fb, width, height);
- fb->Initialized = GL_TRUE;
- }
-}
-
-
-/**
- * Check if the viewport/scissor size has not yet been initialized.
- * Initialize the size if the given width and height are non-zero.
- */
-void
-_mesa_check_init_viewport(struct gl_context *ctx, GLuint width, GLuint height)
-{
- if (!ctx->ViewportInitialized && width > 0 && height > 0) {
- /* Note: set flag here, before calling _mesa_set_viewport(), to prevent
- * potential infinite recursion.
- */
- ctx->ViewportInitialized = GL_TRUE;
- _mesa_set_viewport(ctx, 0, 0, width, height);
- _mesa_set_scissor(ctx, 0, 0, width, height);
- }
-}
-
-
-/**
- * Bind the given context to the given drawBuffer and readBuffer and
- * make it the current context for the calling thread.
- * We'll render into the drawBuffer and read pixels from the
- * readBuffer (i.e. glRead/CopyPixels, glCopyTexImage, etc).
- *
- * We check that the context's and framebuffer's visuals are compatible
- * and return immediately if they're not.
- *
- * \param newCtx the new GL context. If NULL then there will be no current GL
- * context.
- * \param drawBuffer the drawing framebuffer
- * \param readBuffer the reading framebuffer
- */
-GLboolean
-_mesa_make_current( struct gl_context *newCtx,
- struct gl_framebuffer *drawBuffer,
- struct gl_framebuffer *readBuffer )
-{
- GET_CURRENT_CONTEXT(curCtx);
-
- if (MESA_VERBOSE & VERBOSE_API)
- _mesa_debug(newCtx, "_mesa_make_current()\n");
-
- /* Check that the context's and framebuffer's visuals are compatible.
- */
- if (newCtx && drawBuffer && newCtx->WinSysDrawBuffer != drawBuffer) {
- if (!check_compatible(newCtx, drawBuffer)) {
- _mesa_warning(newCtx,
- "MakeCurrent: incompatible visuals for context and drawbuffer");
- return GL_FALSE;
- }
- }
- if (newCtx && readBuffer && newCtx->WinSysReadBuffer != readBuffer) {
- if (!check_compatible(newCtx, readBuffer)) {
- _mesa_warning(newCtx,
- "MakeCurrent: incompatible visuals for context and readbuffer");
- return GL_FALSE;
- }
- }
-
- if (curCtx &&
- (curCtx->WinSysDrawBuffer || curCtx->WinSysReadBuffer) && /* make sure this context is valid for flushing */
- curCtx != newCtx)
- _mesa_flush(curCtx);
-
- /* We used to call _glapi_check_multithread() here. Now do it in drivers */
- _glapi_set_context((void *) newCtx);
- ASSERT(_mesa_get_current_context() == newCtx);
-
- if (!newCtx) {
- _glapi_set_dispatch(NULL); /* none current */
- }
- else {
- _glapi_set_dispatch(newCtx->CurrentDispatch);
-
- if (drawBuffer && readBuffer) {
- /* TODO: check if newCtx and buffer's visual match??? */
-
- ASSERT(drawBuffer->Name == 0);
- ASSERT(readBuffer->Name == 0);
- _mesa_reference_framebuffer(&newCtx->WinSysDrawBuffer, drawBuffer);
- _mesa_reference_framebuffer(&newCtx->WinSysReadBuffer, readBuffer);
-
- /*
- * Only set the context's Draw/ReadBuffer fields if they're NULL
- * or not bound to a user-created FBO.
- */
- if (!newCtx->DrawBuffer || newCtx->DrawBuffer->Name == 0) {
- /* KW: merge conflict here, revisit.
- */
- /* fix up the fb fields - these will end up wrong otherwise
- * if the DRIdrawable changes, and everything relies on them.
- * This is a bit messy (same as needed in _mesa_BindFramebufferEXT)
- */
- unsigned int i;
- GLenum buffers[MAX_DRAW_BUFFERS];
-
- _mesa_reference_framebuffer(&newCtx->DrawBuffer, drawBuffer);
-
- for(i = 0; i < newCtx->Const.MaxDrawBuffers; i++) {
- buffers[i] = newCtx->Color.DrawBuffer[i];
- }
-
- _mesa_drawbuffers(newCtx, newCtx->Const.MaxDrawBuffers,
- buffers, NULL);
- }
- if (!newCtx->ReadBuffer || newCtx->ReadBuffer->Name == 0) {
- _mesa_reference_framebuffer(&newCtx->ReadBuffer, readBuffer);
- }
-
- /* XXX only set this flag if we're really changing the draw/read
- * framebuffer bindings.
- */
- newCtx->NewState |= _NEW_BUFFERS;
-
-#if 1
- /* We want to get rid of these lines: */
-
-#if _HAVE_FULL_GL
- if (!drawBuffer->Initialized) {
- initialize_framebuffer_size(newCtx, drawBuffer);
- }
- if (readBuffer != drawBuffer && !readBuffer->Initialized) {
- initialize_framebuffer_size(newCtx, readBuffer);
- }
-
- _mesa_resizebuffers(newCtx);
-#endif
-
-#else
- /* We want the drawBuffer and readBuffer to be initialized by
- * the driver.
- * This generally means the Width and Height match the actual
- * window size and the renderbuffers (both hardware and software
- * based) are allocated to match. The later can generally be
- * done with a call to _mesa_resize_framebuffer().
- *
- * It's theoretically possible for a buffer to have zero width
- * or height, but for now, assert check that the driver did what's
- * expected of it.
- */
- ASSERT(drawBuffer->Width > 0);
- ASSERT(drawBuffer->Height > 0);
-#endif
-
- if (drawBuffer) {
- _mesa_check_init_viewport(newCtx,
- drawBuffer->Width, drawBuffer->Height);
- }
- }
-
- if (newCtx->FirstTimeCurrent) {
- _mesa_compute_version(newCtx);
-
- newCtx->Extensions.String = _mesa_make_extension_string(newCtx);
-
- check_context_limits(newCtx);
-
- /* We can use this to help debug user's problems. Tell them to set
- * the MESA_INFO env variable before running their app. Then the
- * first time each context is made current we'll print some useful
- * information.
- */
- if (_mesa_getenv("MESA_INFO")) {
- _mesa_print_info();
- }
-
- newCtx->FirstTimeCurrent = GL_FALSE;
- }
- }
-
- return GL_TRUE;
-}
-
-
-/**
- * Make context 'ctx' share the display lists, textures and programs
- * that are associated with 'ctxToShare'.
- * Any display lists, textures or programs associated with 'ctx' will
- * be deleted if nobody else is sharing them.
- */
-GLboolean
-_mesa_share_state(struct gl_context *ctx, struct gl_context *ctxToShare)
-{
- if (ctx && ctxToShare && ctx->Shared && ctxToShare->Shared) {
- struct gl_shared_state *oldSharedState = ctx->Shared;
-
- ctx->Shared = ctxToShare->Shared;
-
- _glthread_LOCK_MUTEX(ctx->Shared->Mutex);
- ctx->Shared->RefCount++;
- _glthread_UNLOCK_MUTEX(ctx->Shared->Mutex);
-
- update_default_objects(ctx);
-
- _mesa_release_shared_state(ctx, oldSharedState);
-
- return GL_TRUE;
- }
- else {
- return GL_FALSE;
- }
-}
-
-
-
-/**
- * \return pointer to the current GL context for this thread.
- *
- * Calls _glapi_get_context(). This isn't the fastest way to get the current
- * context. If you need speed, see the #GET_CURRENT_CONTEXT macro in
- * context.h.
- */
-struct gl_context *
-_mesa_get_current_context( void )
-{
- return (struct gl_context *) _glapi_get_context();
-}
-
-
-/**
- * Get context's current API dispatch table.
- *
- * It'll either be the immediate-mode execute dispatcher or the display list
- * compile dispatcher.
- *
- * \param ctx GL context.
- *
- * \return pointer to dispatch_table.
- *
- * Simply returns __struct gl_contextRec::CurrentDispatch.
- */
-struct _glapi_table *
-_mesa_get_dispatch(struct gl_context *ctx)
-{
- return ctx->CurrentDispatch;
-}
-
-/*@}*/
-
-
-/**********************************************************************/
-/** \name Miscellaneous functions */
-/**********************************************************************/
-/*@{*/
-
-/**
- * Record an error.
- *
- * \param ctx GL context.
- * \param error error code.
- *
- * Records the given error code and call the driver's dd_function_table::Error
- * function if defined.
- *
- * \sa
- * This is called via _mesa_error().
- */
-void
-_mesa_record_error(struct gl_context *ctx, GLenum error)
-{
- if (!ctx)
- return;
-
- if (ctx->ErrorValue == GL_NO_ERROR) {
- ctx->ErrorValue = error;
- }
-
- /* Call device driver's error handler, if any. This is used on the Mac. */
- if (ctx->Driver.Error) {
- ctx->Driver.Error(ctx);
- }
-}
-
-
-/**
- * Flush commands and wait for completion.
- */
-void
-_mesa_finish(struct gl_context *ctx)
-{
- FLUSH_CURRENT( ctx, 0 );
- if (ctx->Driver.Finish) {
- ctx->Driver.Finish(ctx);
- }
-}
-
-
-/**
- * Flush commands.
- */
-void
-_mesa_flush(struct gl_context *ctx)
-{
- FLUSH_CURRENT( ctx, 0 );
- if (ctx->Driver.Flush) {
- ctx->Driver.Flush(ctx);
- }
-}
-
-
-
-/**
- * Execute glFinish().
- *
- * Calls the #ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH macro and the
- * dd_function_table::Finish driver callback, if not NULL.
- */
-void GLAPIENTRY
-_mesa_Finish(void)
-{
- GET_CURRENT_CONTEXT(ctx);
- ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
- _mesa_finish(ctx);
-}
-
-
-/**
- * Execute glFlush().
- *
- * Calls the #ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH macro and the
- * dd_function_table::Flush driver callback, if not NULL.
- */
-void GLAPIENTRY
-_mesa_Flush(void)
-{
- GET_CURRENT_CONTEXT(ctx);
- ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
- _mesa_flush(ctx);
-}
-
-
-/**
- * Set mvp_with_dp4 flag. If a driver has a preference for DP4 over
- * MUL/MAD, or vice versa, call this function to register that.
- * Otherwise we default to MUL/MAD.
- */
-void
-_mesa_set_mvp_with_dp4( struct gl_context *ctx,
- GLboolean flag )
-{
- ctx->mvp_with_dp4 = flag;
-}
-
-
-
-/**
- * Prior to drawing anything with glBegin, glDrawArrays, etc. this function
- * is called to see if it's valid to render. This involves checking that
- * the current shader is valid and the framebuffer is complete.
- * If an error is detected it'll be recorded here.
- * \return GL_TRUE if OK to render, GL_FALSE if not
- */
-GLboolean
-_mesa_valid_to_render(struct gl_context *ctx, const char *where)
-{
- bool vert_from_glsl_shader = false;
- bool geom_from_glsl_shader = false;
- bool frag_from_glsl_shader = false;
-
- /* This depends on having up to date derived state (shaders) */
- if (ctx->NewState)
- _mesa_update_state(ctx);
-
- if (ctx->Shader.CurrentVertexProgram) {
- vert_from_glsl_shader = true;
-
- if (!ctx->Shader.CurrentVertexProgram->LinkStatus) {
- _mesa_error(ctx, GL_INVALID_OPERATION,
- "%s(shader not linked)", where);
- return GL_FALSE;
- }
-#if 0 /* not normally enabled */
- {
- char errMsg[100];
- if (!_mesa_validate_shader_program(ctx,
- ctx->Shader.CurrentVertexProgram,
- errMsg)) {
- _mesa_warning(ctx, "Shader program %u is invalid: %s",
- ctx->Shader.CurrentVertexProgram->Name, errMsg);
- }
- }
-#endif
- }
-
- if (ctx->Shader.CurrentGeometryProgram) {
- geom_from_glsl_shader = true;
-
- if (!ctx->Shader.CurrentGeometryProgram->LinkStatus) {
- _mesa_error(ctx, GL_INVALID_OPERATION,
- "%s(shader not linked)", where);
- return GL_FALSE;
- }
-#if 0 /* not normally enabled */
- {
- char errMsg[100];
- if (!_mesa_validate_shader_program(ctx,
- ctx->Shader.CurrentGeometryProgram,
- errMsg)) {
- _mesa_warning(ctx, "Shader program %u is invalid: %s",
- ctx->Shader.CurrentGeometryProgram->Name, errMsg);
- }
- }
-#endif
- }
-
- if (ctx->Shader.CurrentFragmentProgram) {
- frag_from_glsl_shader = true;
-
- if (!ctx->Shader.CurrentFragmentProgram->LinkStatus) {
- _mesa_error(ctx, GL_INVALID_OPERATION,
- "%s(shader not linked)", where);
- return GL_FALSE;
- }
-#if 0 /* not normally enabled */
- {
- char errMsg[100];
- if (!_mesa_validate_shader_program(ctx,
- ctx->Shader.CurrentFragmentProgram,
- errMsg)) {
- _mesa_warning(ctx, "Shader program %u is invalid: %s",
- ctx->Shader.CurrentFragmentProgram->Name, errMsg);
- }
- }
-#endif
- }
-
- /* Any shader stages that are not supplied by the GLSL shader and have
- * assembly shaders enabled must now be validated.
- */
- if (!vert_from_glsl_shader
- && ctx->VertexProgram.Enabled && !ctx->VertexProgram._Enabled) {
- _mesa_error(ctx, GL_INVALID_OPERATION,
- "%s(vertex program not valid)", where);
- return GL_FALSE;
- }
-
- /* FINISHME: If GL_NV_geometry_program4 is ever supported, the current
- * FINISHME: geometry program should validated here.
- */
- (void) geom_from_glsl_shader;
-
- if (!frag_from_glsl_shader) {
- if (ctx->FragmentProgram.Enabled && !ctx->FragmentProgram._Enabled) {
- _mesa_error(ctx, GL_INVALID_OPERATION,
- "%s(fragment program not valid)", where);
- return GL_FALSE;
- }
-
- /* If drawing to integer-valued color buffers, there must be an
- * active fragment shader (GL_EXT_texture_integer).
- */
- if (ctx->DrawBuffer && ctx->DrawBuffer->_IntegerColor) {
- _mesa_error(ctx, GL_INVALID_OPERATION,
- "%s(integer format but no fragment shader)", where);
- return GL_FALSE;
- }
- }
-
- if (ctx->DrawBuffer->_Status != GL_FRAMEBUFFER_COMPLETE_EXT) {
- _mesa_error(ctx, GL_INVALID_FRAMEBUFFER_OPERATION_EXT,
- "%s(incomplete framebuffer)", where);
- return GL_FALSE;
- }
-
-#ifdef DEBUG
- if (ctx->Shader.Flags & GLSL_LOG) {
- struct gl_shader_program *shProg[MESA_SHADER_TYPES];
- gl_shader_type i;
-
- shProg[MESA_SHADER_VERTEX] = ctx->Shader.CurrentVertexProgram;
- shProg[MESA_SHADER_GEOMETRY] = ctx->Shader.CurrentGeometryProgram;
- shProg[MESA_SHADER_FRAGMENT] = ctx->Shader.CurrentFragmentProgram;
-
- for (i = 0; i < MESA_SHADER_TYPES; i++) {
- struct gl_shader *sh;
-
- if (shProg[i] == NULL || shProg[i]->_Used
- || shProg[i]->_LinkedShaders[i] == NULL)
- continue;
-
- /* This is the first time this shader is being used.
- * Append shader's constants/uniforms to log file.
- *
- * The logic is a little odd here. We only want to log data for each
- * shader target that will actually be used, and we only want to log
- * it once. It's possible to have a program bound to the vertex
- * shader target that also supplied a fragment shader. If that
- * program isn't also bound to the fragment shader target we don't
- * want to log its fragment data.
- */
- sh = shProg[i]->_LinkedShaders[i];
- switch (sh->Type) {
- case GL_VERTEX_SHADER:
- _mesa_append_uniforms_to_file(sh, &shProg[i]->VertexProgram->Base);
- break;
-
- case GL_GEOMETRY_SHADER_ARB:
- _mesa_append_uniforms_to_file(sh,
- &shProg[i]->GeometryProgram->Base);
- break;
-
- case GL_FRAGMENT_SHADER:
- _mesa_append_uniforms_to_file(sh,
- &shProg[i]->FragmentProgram->Base);
- break;
- }
- }
-
- for (i = 0; i < MESA_SHADER_TYPES; i++) {
- if (shProg[i] != NULL)
- shProg[i]->_Used = GL_TRUE;
- }
- }
-#endif
-
- return GL_TRUE;
-}
-
-
-/*@}*/
+/*
+ * Mesa 3-D graphics library
+ * Version: 7.3
+ *
+ * Copyright (C) 1999-2007 Brian Paul All Rights Reserved.
+ * Copyright (C) 2008 VMware, Inc. All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+/**
+ * \file context.c
+ * Mesa context/visual/framebuffer management functions.
+ * \author Brian Paul
+ */
+
+/**
+ * \mainpage Mesa Main Module
+ *
+ * \section MainIntroduction Introduction
+ *
+ * The Mesa Main module consists of all the files in the main/ directory.
+ * Among the features of this module are:
+ * <UL>
+ * <LI> Structures to represent most GL state </LI>
+ * <LI> State set/get functions </LI>
+ * <LI> Display lists </LI>
+ * <LI> Texture unit, object and image handling </LI>
+ * <LI> Matrix and attribute stacks </LI>
+ * </UL>
+ *
+ * Other modules are responsible for API dispatch, vertex transformation,
+ * point/line/triangle setup, rasterization, vertex array caching,
+ * vertex/fragment programs/shaders, etc.
+ *
+ *
+ * \section AboutDoxygen About Doxygen
+ *
+ * If you're viewing this information as Doxygen-generated HTML you'll
+ * see the documentation index at the top of this page.
+ *
+ * The first line lists the Mesa source code modules.
+ * The second line lists the indexes available for viewing the documentation
+ * for each module.
+ *
+ * Selecting the <b>Main page</b> link will display a summary of the module
+ * (this page).
+ *
+ * Selecting <b>Data Structures</b> will list all C structures.
+ *
+ * Selecting the <b>File List</b> link will list all the source files in
+ * the module.
+ * Selecting a filename will show a list of all functions defined in that file.
+ *
+ * Selecting the <b>Data Fields</b> link will display a list of all
+ * documented structure members.
+ *
+ * Selecting the <b>Globals</b> link will display a list
+ * of all functions, structures, global variables and macros in the module.
+ *
+ */
+
+
+#include "glheader.h"
+#include "mfeatures.h"
+#include "imports.h"
+#include "accum.h"
+#include "api_exec.h"
+#include "arrayobj.h"
+#include "attrib.h"
+#include "blend.h"
+#include "buffers.h"
+#include "bufferobj.h"
+#include "context.h"
+#include "cpuinfo.h"
+#include "debug.h"
+#include "depth.h"
+#include "dlist.h"
+#include "eval.h"
+#include "extensions.h"
+#include "fbobject.h"
+#include "feedback.h"
+#include "fog.h"
+#include "formats.h"
+#include "framebuffer.h"
+#include "hint.h"
+#include "hash.h"
+#include "light.h"
+#include "lines.h"
+#include "macros.h"
+#include "matrix.h"
+#include "multisample.h"
+#include "pixel.h"
+#include "pixelstore.h"
+#include "points.h"
+#include "polygon.h"
+#include "queryobj.h"
+#include "syncobj.h"
+#include "rastpos.h"
+#include "remap.h"
+#include "scissor.h"
+#include "shared.h"
+#include "shaderobj.h"
+#include "simple_list.h"
+#include "state.h"
+#include "stencil.h"
+#include "texcompress_s3tc.h"
+#include "texstate.h"
+#include "transformfeedback.h"
+#include "mtypes.h"
+#include "varray.h"
+#include "version.h"
+#include "viewport.h"
+#include "vtxfmt.h"
+#include "program/program.h"
+#include "program/prog_print.h"
+#if _HAVE_FULL_GL
+#include "math/m_matrix.h"
+#endif
+#include "main/dispatch.h" /* for _gloffset_COUNT */
+
+#ifdef USE_SPARC_ASM
+#include "sparc/sparc.h"
+#endif
+
+#include "glsl_parser_extras.h"
+#include <stdbool.h>
+
+
+#ifndef MESA_VERBOSE
+int MESA_VERBOSE = 0;
+#endif
+
+#ifndef MESA_DEBUG_FLAGS
+int MESA_DEBUG_FLAGS = 0;
+#endif
+
+
+/* ubyte -> float conversion */
+GLfloat _mesa_ubyte_to_float_color_tab[256];
+
+
+
+/**
+ * Swap buffers notification callback.
+ *
+ * \param ctx GL context.
+ *
+ * Called by window system just before swapping buffers.
+ * We have to finish any pending rendering.
+ */
+void
+_mesa_notifySwapBuffers(struct gl_context *ctx)
+{
+ if (MESA_VERBOSE & VERBOSE_SWAPBUFFERS)
+ _mesa_debug(ctx, "SwapBuffers\n");
+ FLUSH_CURRENT( ctx, 0 );
+ if (ctx->Driver.Flush) {
+ ctx->Driver.Flush(ctx);
+ }
+}
+
+
+/**********************************************************************/
+/** \name GL Visual allocation/destruction */
+/**********************************************************************/
+/*@{*/
+
+/**
+ * Allocates a struct gl_config structure and initializes it via
+ * _mesa_initialize_visual().
+ *
+ * \param dbFlag double buffering
+ * \param stereoFlag stereo buffer
+ * \param depthBits requested bits per depth buffer value. Any value in [0, 32]
+ * is acceptable but the actual depth type will be GLushort or GLuint as
+ * needed.
+ * \param stencilBits requested minimum bits per stencil buffer value
+ * \param accumRedBits, accumGreenBits, accumBlueBits, accumAlphaBits number
+ * of bits per color component in accum buffer.
+ * \param indexBits number of bits per pixel if \p rgbFlag is GL_FALSE
+ * \param redBits number of bits per color component in frame buffer for RGB(A)
+ * mode. We always use 8 in core Mesa though.
+ * \param greenBits same as above.
+ * \param blueBits same as above.
+ * \param alphaBits same as above.
+ * \param numSamples not really used.
+ *
+ * \return pointer to new struct gl_config or NULL if requested parameters
+ * can't be met.
+ *
+ * \note Need to add params for level and numAuxBuffers (at least)
+ */
+struct gl_config *
+_mesa_create_visual( GLboolean dbFlag,
+ GLboolean stereoFlag,
+ GLint redBits,
+ GLint greenBits,
+ GLint blueBits,
+ GLint alphaBits,
+ GLint depthBits,
+ GLint stencilBits,
+ GLint accumRedBits,
+ GLint accumGreenBits,
+ GLint accumBlueBits,
+ GLint accumAlphaBits,
+ GLint numSamples )
+{
+ struct gl_config *vis = CALLOC_STRUCT(gl_config);
+ if (vis) {
+ if (!_mesa_initialize_visual(vis, dbFlag, stereoFlag,
+ redBits, greenBits, blueBits, alphaBits,
+ depthBits, stencilBits,
+ accumRedBits, accumGreenBits,
+ accumBlueBits, accumAlphaBits,
+ numSamples)) {
+ free(vis);
+ return NULL;
+ }
+ }
+ return vis;
+}
+
+
+/**
+ * Makes some sanity checks and fills in the fields of the struct
+ * gl_config object with the given parameters. If the caller needs to
+ * set additional fields, he should just probably init the whole
+ * gl_config object himself.
+ *
+ * \return GL_TRUE on success, or GL_FALSE on failure.
+ *
+ * \sa _mesa_create_visual() above for the parameter description.
+ */
+GLboolean
+_mesa_initialize_visual( struct gl_config *vis,
+ GLboolean dbFlag,
+ GLboolean stereoFlag,
+ GLint redBits,
+ GLint greenBits,
+ GLint blueBits,
+ GLint alphaBits,
+ GLint depthBits,
+ GLint stencilBits,
+ GLint accumRedBits,
+ GLint accumGreenBits,
+ GLint accumBlueBits,
+ GLint accumAlphaBits,
+ GLint numSamples )
+{
+ assert(vis);
+
+ if (depthBits < 0 || depthBits > 32) {
+ return GL_FALSE;
+ }
+ if (stencilBits < 0 || stencilBits > STENCIL_BITS) {
+ return GL_FALSE;
+ }
+ assert(accumRedBits >= 0);
+ assert(accumGreenBits >= 0);
+ assert(accumBlueBits >= 0);
+ assert(accumAlphaBits >= 0);
+
+ vis->rgbMode = GL_TRUE;
+ vis->doubleBufferMode = dbFlag;
+ vis->stereoMode = stereoFlag;
+
+ vis->redBits = redBits;
+ vis->greenBits = greenBits;
+ vis->blueBits = blueBits;
+ vis->alphaBits = alphaBits;
+ vis->rgbBits = redBits + greenBits + blueBits;
+
+ vis->indexBits = 0;
+ vis->depthBits = depthBits;
+ vis->stencilBits = stencilBits;
+
+ vis->accumRedBits = accumRedBits;
+ vis->accumGreenBits = accumGreenBits;
+ vis->accumBlueBits = accumBlueBits;
+ vis->accumAlphaBits = accumAlphaBits;
+
+ vis->haveAccumBuffer = accumRedBits > 0;
+ vis->haveDepthBuffer = depthBits > 0;
+ vis->haveStencilBuffer = stencilBits > 0;
+
+ vis->numAuxBuffers = 0;
+ vis->level = 0;
+ vis->sampleBuffers = numSamples > 0 ? 1 : 0;
+ vis->samples = numSamples;
+
+ return GL_TRUE;
+}
+
+
+/**
+ * Destroy a visual and free its memory.
+ *
+ * \param vis visual.
+ *
+ * Frees the visual structure.
+ */
+void
+_mesa_destroy_visual( struct gl_config *vis )
+{
+ free(vis);
+}
+
+/*@}*/
+
+
+/**********************************************************************/
+/** \name Context allocation, initialization, destroying
+ *
+ * The purpose of the most initialization functions here is to provide the
+ * default state values according to the OpenGL specification.
+ */
+/**********************************************************************/
+/*@{*/
+
+
+/**
+ * This is lame. gdb only seems to recognize enum types that are
+ * actually used somewhere. We want to be able to print/use enum
+ * values such as TEXTURE_2D_INDEX in gdb. But we don't actually use
+ * the gl_texture_index type anywhere. Thus, this lame function.
+ */
+static void
+dummy_enum_func(void)
+{
+ gl_buffer_index bi = BUFFER_FRONT_LEFT;
+ gl_face_index fi = FACE_POS_X;
+ gl_frag_attrib fa = FRAG_ATTRIB_WPOS;
+ gl_frag_result fr = FRAG_RESULT_DEPTH;
+ gl_texture_index ti = TEXTURE_2D_ARRAY_INDEX;
+ gl_vert_attrib va = VERT_ATTRIB_POS;
+ gl_vert_result vr = VERT_RESULT_HPOS;
+ gl_geom_attrib ga = GEOM_ATTRIB_POSITION;
+ gl_geom_result gr = GEOM_RESULT_POS;
+
+ (void) bi;
+ (void) fi;
+ (void) fa;
+ (void) fr;
+ (void) ti;
+ (void) va;
+ (void) vr;
+ (void) ga;
+ (void) gr;
+}
+
+
+/**
+ * One-time initialization mutex lock.
+ *
+ * \sa Used by one_time_init().
+ */
+_glthread_DECLARE_STATIC_MUTEX(OneTimeLock);
+
+
+
+/**
+ * Calls all the various one-time-init functions in Mesa.
+ *
+ * While holding a global mutex lock, calls several initialization functions,
+ * and sets the glapi callbacks if the \c MESA_DEBUG environment variable is
+ * defined.
+ *
+ * \sa _math_init().
+ */
+static void
+one_time_init( struct gl_context *ctx )
+{
+ static GLbitfield api_init_mask = 0x0;
+
+ _glthread_LOCK_MUTEX(OneTimeLock);
+
+ /* truly one-time init */
+ if (!api_init_mask) {
+ GLuint i;
+
+ /* do some implementation tests */
+ assert( sizeof(GLbyte) == 1 );
+ assert( sizeof(GLubyte) == 1 );
+ assert( sizeof(GLshort) == 2 );
+ assert( sizeof(GLushort) == 2 );
+ assert( sizeof(GLint) == 4 );
+ assert( sizeof(GLuint) == 4 );
+
+ _mesa_get_cpu_features();
+
+ _mesa_init_sqrt_table();
+
+ /* context dependence is never a one-time thing... */
+ _mesa_init_get_hash(ctx);
+
+ for (i = 0; i < 256; i++) {
+ _mesa_ubyte_to_float_color_tab[i] = (float) i / 255.0F;
+ }
+
+#if defined(DEBUG) && defined(__DATE__) && defined(__TIME__)
+ if (MESA_VERBOSE != 0) {
+ _mesa_debug(ctx, "Mesa %s DEBUG build %s %s\n",
+ MESA_VERSION_STRING, __DATE__, __TIME__);
+ }
+#endif
+
+#ifdef DEBUG
+ _mesa_test_formats();
+#endif
+ }
+
+ /* per-API one-time init */
+ if (!(api_init_mask & (1 << ctx->API))) {
+ /*
+ * This is fine as ES does not use the remap table, but it may not be
+ * future-proof. We cannot always initialize the remap table because
+ * when an app is linked to libGLES*, there are not enough dynamic
+ * entries.
+ */
+ if (ctx->API == API_OPENGL)
+ _mesa_init_remap_table();
+ }
+
+ api_init_mask |= 1 << ctx->API;
+
+ _glthread_UNLOCK_MUTEX(OneTimeLock);
+
+ /* Hopefully atexit() is widely available. If not, we may need some
+ * #ifdef tests here.
+ */
+ atexit(_mesa_destroy_shader_compiler);
+
+ dummy_enum_func();
+}
+
+
+/**
+ * Initialize fields of gl_current_attrib (aka ctx->Current.*)
+ */
+static void
+_mesa_init_current(struct gl_context *ctx)
+{
+ GLuint i;
+
+ /* Init all to (0,0,0,1) */
+ for (i = 0; i < Elements(ctx->Current.Attrib); i++) {
+ ASSIGN_4V( ctx->Current.Attrib[i], 0.0, 0.0, 0.0, 1.0 );
+ }
+
+ /* redo special cases: */
+ ASSIGN_4V( ctx->Current.Attrib[VERT_ATTRIB_WEIGHT], 1.0, 0.0, 0.0, 0.0 );
+ ASSIGN_4V( ctx->Current.Attrib[VERT_ATTRIB_NORMAL], 0.0, 0.0, 1.0, 1.0 );
+ ASSIGN_4V( ctx->Current.Attrib[VERT_ATTRIB_COLOR0], 1.0, 1.0, 1.0, 1.0 );
+ ASSIGN_4V( ctx->Current.Attrib[VERT_ATTRIB_COLOR1], 0.0, 0.0, 0.0, 1.0 );
+ ASSIGN_4V( ctx->Current.Attrib[VERT_ATTRIB_COLOR_INDEX], 1.0, 0.0, 0.0, 1.0 );
+ ASSIGN_4V( ctx->Current.Attrib[VERT_ATTRIB_EDGEFLAG], 1.0, 0.0, 0.0, 1.0 );
+}
+
+
+/**
+ * Init vertex/fragment/geometry program limits.
+ * Important: drivers should override these with actual limits.
+ */
+static void
+init_program_limits(GLenum type, struct gl_program_constants *prog)
+{
+ prog->MaxInstructions = MAX_PROGRAM_INSTRUCTIONS;
+ prog->MaxAluInstructions = MAX_PROGRAM_INSTRUCTIONS;
+ prog->MaxTexInstructions = MAX_PROGRAM_INSTRUCTIONS;
+ prog->MaxTexIndirections = MAX_PROGRAM_INSTRUCTIONS;
+ prog->MaxTemps = MAX_PROGRAM_TEMPS;
+ prog->MaxEnvParams = MAX_PROGRAM_ENV_PARAMS;
+ prog->MaxLocalParams = MAX_PROGRAM_LOCAL_PARAMS;
+ prog->MaxAddressOffset = MAX_PROGRAM_LOCAL_PARAMS;
+
+ switch (type) {
+ case GL_VERTEX_PROGRAM_ARB:
+ prog->MaxParameters = MAX_VERTEX_PROGRAM_PARAMS;
+ prog->MaxAttribs = MAX_NV_VERTEX_PROGRAM_INPUTS;
+ prog->MaxAddressRegs = MAX_VERTEX_PROGRAM_ADDRESS_REGS;
+ prog->MaxUniformComponents = 4 * MAX_UNIFORMS;
+ break;
+ case GL_FRAGMENT_PROGRAM_ARB:
+ prog->MaxParameters = MAX_NV_FRAGMENT_PROGRAM_PARAMS;
+ prog->MaxAttribs = MAX_NV_FRAGMENT_PROGRAM_INPUTS;
+ prog->MaxAddressRegs = MAX_FRAGMENT_PROGRAM_ADDRESS_REGS;
+ prog->MaxUniformComponents = 4 * MAX_UNIFORMS;
+ break;
+ case MESA_GEOMETRY_PROGRAM:
+ prog->MaxParameters = MAX_NV_VERTEX_PROGRAM_PARAMS;
+ prog->MaxAttribs = MAX_NV_VERTEX_PROGRAM_INPUTS;
+ prog->MaxAddressRegs = MAX_VERTEX_PROGRAM_ADDRESS_REGS;
+ prog->MaxUniformComponents = MAX_GEOMETRY_UNIFORM_COMPONENTS;
+ break;
+ default:
+ assert(0 && "Bad program type in init_program_limits()");
+ }
+
+ /* Set the native limits to zero. This implies that there is no native
+ * support for shaders. Let the drivers fill in the actual values.
+ */
+ prog->MaxNativeInstructions = 0;
+ prog->MaxNativeAluInstructions = 0;
+ prog->MaxNativeTexInstructions = 0;
+ prog->MaxNativeTexIndirections = 0;
+ prog->MaxNativeAttribs = 0;
+ prog->MaxNativeTemps = 0;
+ prog->MaxNativeAddressRegs = 0;
+ prog->MaxNativeParameters = 0;
+
+ /* Set GLSL datatype range/precision info assuming IEEE float values.
+ * Drivers should override these defaults as needed.
+ */
+ prog->MediumFloat.RangeMin = 127;
+ prog->MediumFloat.RangeMax = 127;
+ prog->MediumFloat.Precision = 23;
+ prog->LowFloat = prog->HighFloat = prog->MediumFloat;
+
+ /* Assume ints are stored as floats for now, since this is the least-common
+ * denominator. The OpenGL ES spec implies (page 132) that the precision
+ * of integer types should be 0. Practically speaking, IEEE
+ * single-precision floating point values can only store integers in the
+ * range [-0x01000000, 0x01000000] without loss of precision.
+ */
+ prog->MediumInt.RangeMin = 24;
+ prog->MediumInt.RangeMax = 24;
+ prog->MediumInt.Precision = 0;
+ prog->LowInt = prog->HighInt = prog->MediumInt;
+}
+
+
+/**
+ * Initialize fields of gl_constants (aka ctx->Const.*).
+ * Use defaults from config.h. The device drivers will often override
+ * some of these values (such as number of texture units).
+ */
+static void
+_mesa_init_constants(struct gl_context *ctx)
+{
+ assert(ctx);
+
+ /* Constants, may be overriden (usually only reduced) by device drivers */
+ ctx->Const.MaxTextureMbytes = MAX_TEXTURE_MBYTES;
+ ctx->Const.MaxTextureLevels = MAX_TEXTURE_LEVELS;
+ ctx->Const.Max3DTextureLevels = MAX_3D_TEXTURE_LEVELS;
+ ctx->Const.MaxCubeTextureLevels = MAX_CUBE_TEXTURE_LEVELS;
+ ctx->Const.MaxTextureRectSize = MAX_TEXTURE_RECT_SIZE;
+ ctx->Const.MaxArrayTextureLayers = MAX_ARRAY_TEXTURE_LAYERS;
+ ctx->Const.MaxTextureCoordUnits = MAX_TEXTURE_COORD_UNITS;
+ ctx->Const.MaxTextureImageUnits = MAX_TEXTURE_IMAGE_UNITS;
+ ctx->Const.MaxTextureUnits = MIN2(ctx->Const.MaxTextureCoordUnits,
+ ctx->Const.MaxTextureImageUnits);
+ ctx->Const.MaxTextureMaxAnisotropy = MAX_TEXTURE_MAX_ANISOTROPY;
+ ctx->Const.MaxTextureLodBias = MAX_TEXTURE_LOD_BIAS;
+ ctx->Const.MaxTextureBufferSize = 65536;
+ ctx->Const.MaxArrayLockSize = MAX_ARRAY_LOCK_SIZE;
+ ctx->Const.SubPixelBits = SUB_PIXEL_BITS;
+ ctx->Const.MinPointSize = MIN_POINT_SIZE;
+ ctx->Const.MaxPointSize = MAX_POINT_SIZE;
+ ctx->Const.MinPointSizeAA = MIN_POINT_SIZE;
+ ctx->Const.MaxPointSizeAA = MAX_POINT_SIZE;
+ ctx->Const.PointSizeGranularity = (GLfloat) POINT_SIZE_GRANULARITY;
+ ctx->Const.MinLineWidth = MIN_LINE_WIDTH;
+ ctx->Const.MaxLineWidth = MAX_LINE_WIDTH;
+ ctx->Const.MinLineWidthAA = MIN_LINE_WIDTH;
+ ctx->Const.MaxLineWidthAA = MAX_LINE_WIDTH;
+ ctx->Const.LineWidthGranularity = (GLfloat) LINE_WIDTH_GRANULARITY;
+ ctx->Const.MaxColorTableSize = MAX_COLOR_TABLE_SIZE;
+ ctx->Const.MaxClipPlanes = MAX_CLIP_PLANES;
+ ctx->Const.MaxLights = MAX_LIGHTS;
+ ctx->Const.MaxShininess = 128.0;
+ ctx->Const.MaxSpotExponent = 128.0;
+ ctx->Const.MaxViewportWidth = MAX_WIDTH;
+ ctx->Const.MaxViewportHeight = MAX_HEIGHT;
+#if FEATURE_ARB_vertex_program
+ init_program_limits(GL_VERTEX_PROGRAM_ARB, &ctx->Const.VertexProgram);
+#endif
+#if FEATURE_ARB_fragment_program
+ init_program_limits(GL_FRAGMENT_PROGRAM_ARB, &ctx->Const.FragmentProgram);
+#endif
+#if FEATURE_ARB_geometry_shader4
+ init_program_limits(MESA_GEOMETRY_PROGRAM, &ctx->Const.GeometryProgram);
+#endif
+ ctx->Const.MaxProgramMatrices = MAX_PROGRAM_MATRICES;
+ ctx->Const.MaxProgramMatrixStackDepth = MAX_PROGRAM_MATRIX_STACK_DEPTH;
+
+ /* CheckArrayBounds is overriden by drivers/x11 for X server */
+ ctx->Const.CheckArrayBounds = GL_FALSE;
+
+ /* GL_ARB_draw_buffers */
+ ctx->Const.MaxDrawBuffers = MAX_DRAW_BUFFERS;
+
+#if FEATURE_EXT_framebuffer_object
+ ctx->Const.MaxColorAttachments = MAX_COLOR_ATTACHMENTS;
+ ctx->Const.MaxRenderbufferSize = MAX_WIDTH;
+#endif
+
+#if FEATURE_ARB_vertex_shader
+ ctx->Const.MaxVertexTextureImageUnits = MAX_VERTEX_TEXTURE_IMAGE_UNITS;
+ ctx->Const.MaxCombinedTextureImageUnits = MAX_COMBINED_TEXTURE_IMAGE_UNITS;
+ ctx->Const.MaxVarying = MAX_VARYING;
+#endif
+#if FEATURE_ARB_geometry_shader4
+ ctx->Const.MaxGeometryTextureImageUnits = MAX_GEOMETRY_TEXTURE_IMAGE_UNITS;
+ ctx->Const.MaxVertexVaryingComponents = MAX_VERTEX_VARYING_COMPONENTS;
+ ctx->Const.MaxGeometryVaryingComponents = MAX_GEOMETRY_VARYING_COMPONENTS;
+ ctx->Const.MaxGeometryOutputVertices = MAX_GEOMETRY_OUTPUT_VERTICES;
+ ctx->Const.MaxGeometryTotalOutputComponents = MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS;
+#endif
+
+ /* Shading language version */
+ if (ctx->API == API_OPENGL) {
+ ctx->Const.GLSLVersion = 120;
+ }
+ else if (ctx->API == API_OPENGLES2) {
+ ctx->Const.GLSLVersion = 100;
+ }
+ else if (ctx->API == API_OPENGLES) {
+ ctx->Const.GLSLVersion = 0; /* GLSL not supported */
+ }
+
+ /* GL_ARB_framebuffer_object */
+ ctx->Const.MaxSamples = 0;
+
+ /* GL_ARB_sync */
+ ctx->Const.MaxServerWaitTimeout = (GLuint64) ~0;
+
+ /* GL_ATI_envmap_bumpmap */
+ ctx->Const.SupportedBumpUnits = SUPPORTED_ATI_BUMP_UNITS;
+
+ /* GL_EXT_provoking_vertex */
+ ctx->Const.QuadsFollowProvokingVertexConvention = GL_TRUE;
+
+ /* GL_EXT_transform_feedback */
+ ctx->Const.MaxTransformFeedbackSeparateAttribs = MAX_FEEDBACK_ATTRIBS;
+ ctx->Const.MaxTransformFeedbackSeparateComponents = 4 * MAX_FEEDBACK_ATTRIBS;
+ ctx->Const.MaxTransformFeedbackInterleavedComponents = 4 * MAX_FEEDBACK_ATTRIBS;
+
+ /* GL 3.2: hard-coded for now: */
+ ctx->Const.ProfileMask = GL_CONTEXT_COMPATIBILITY_PROFILE_BIT;
+
+ /** GL_EXT_gpu_shader4 */
+ ctx->Const.MinProgramTexelOffset = -8;
+ ctx->Const.MaxProgramTexelOffset = 7;
+
+ /* GL_ARB_robustness */
+ ctx->Const.ResetStrategy = GL_NO_RESET_NOTIFICATION_ARB;
+}
+
+
+/**
+ * Do some sanity checks on the limits/constants for the given context.
+ * Only called the first time a context is bound.
+ */
+static void
+check_context_limits(struct gl_context *ctx)
+{
+ /* check that we don't exceed the size of various bitfields */
+ assert(VERT_RESULT_MAX <=
+ (8 * sizeof(ctx->VertexProgram._Current->Base.OutputsWritten)));
+ assert(FRAG_ATTRIB_MAX <=
+ (8 * sizeof(ctx->FragmentProgram._Current->Base.InputsRead)));
+
+ assert(MAX_COMBINED_TEXTURE_IMAGE_UNITS <= 8 * sizeof(GLbitfield));
+
+ /* shader-related checks */
+ assert(ctx->Const.FragmentProgram.MaxLocalParams <= MAX_PROGRAM_LOCAL_PARAMS);
+ assert(ctx->Const.VertexProgram.MaxLocalParams <= MAX_PROGRAM_LOCAL_PARAMS);
+
+ assert(MAX_NV_FRAGMENT_PROGRAM_TEMPS <= MAX_PROGRAM_TEMPS);
+ assert(MAX_NV_VERTEX_PROGRAM_TEMPS <= MAX_PROGRAM_TEMPS);
+ assert(MAX_NV_VERTEX_PROGRAM_INPUTS <= VERT_ATTRIB_MAX);
+ assert(MAX_NV_VERTEX_PROGRAM_OUTPUTS <= VERT_RESULT_MAX);
+
+ /* Texture unit checks */
+ assert(ctx->Const.MaxTextureImageUnits > 0);
+ assert(ctx->Const.MaxTextureImageUnits <= MAX_TEXTURE_IMAGE_UNITS);
+ assert(ctx->Const.MaxTextureCoordUnits > 0);
+ assert(ctx->Const.MaxTextureCoordUnits <= MAX_TEXTURE_COORD_UNITS);
+ assert(ctx->Const.MaxTextureUnits > 0);
+ assert(ctx->Const.MaxTextureUnits <= MAX_TEXTURE_IMAGE_UNITS);
+ assert(ctx->Const.MaxTextureUnits <= MAX_TEXTURE_COORD_UNITS);
+ assert(ctx->Const.MaxTextureUnits == MIN2(ctx->Const.MaxTextureImageUnits,
+ ctx->Const.MaxTextureCoordUnits));
+ assert(ctx->Const.MaxCombinedTextureImageUnits > 0);
+ assert(ctx->Const.MaxCombinedTextureImageUnits <= MAX_COMBINED_TEXTURE_IMAGE_UNITS);
+ assert(ctx->Const.MaxTextureCoordUnits <= MAX_COMBINED_TEXTURE_IMAGE_UNITS);
+ /* number of coord units cannot be greater than number of image units */
+ assert(ctx->Const.MaxTextureCoordUnits <= ctx->Const.MaxTextureImageUnits);
+
+
+ /* Texture size checks */
+ assert(ctx->Const.MaxTextureLevels <= MAX_TEXTURE_LEVELS);
+ assert(ctx->Const.Max3DTextureLevels <= MAX_3D_TEXTURE_LEVELS);
+ assert(ctx->Const.MaxCubeTextureLevels <= MAX_CUBE_TEXTURE_LEVELS);
+ assert(ctx->Const.MaxTextureRectSize <= MAX_TEXTURE_RECT_SIZE);
+
+ /* make sure largest texture image is <= MAX_WIDTH in size */
+ assert((1 << (ctx->Const.MaxTextureLevels - 1)) <= MAX_WIDTH);
+ assert((1 << (ctx->Const.MaxCubeTextureLevels - 1)) <= MAX_WIDTH);
+ assert((1 << (ctx->Const.Max3DTextureLevels - 1)) <= MAX_WIDTH);
+
+ /* Texture level checks */
+ assert(MAX_TEXTURE_LEVELS >= MAX_3D_TEXTURE_LEVELS);
+ assert(MAX_TEXTURE_LEVELS >= MAX_CUBE_TEXTURE_LEVELS);
+
+ /* Max texture size should be <= max viewport size (render to texture) */
+ assert((1 << (MAX_TEXTURE_LEVELS - 1)) <= MAX_WIDTH);
+
+ assert(ctx->Const.MaxViewportWidth <= MAX_WIDTH);
+ assert(ctx->Const.MaxViewportHeight <= MAX_WIDTH);
+
+ assert(ctx->Const.MaxDrawBuffers <= MAX_DRAW_BUFFERS);
+
+ /* if this fails, add more enum values to gl_buffer_index */
+ assert(BUFFER_COLOR0 + MAX_DRAW_BUFFERS <= BUFFER_COUNT);
+
+ /* XXX probably add more tests */
+}
+
+
+/**
+ * Initialize the attribute groups in a GL context.
+ *
+ * \param ctx GL context.
+ *
+ * Initializes all the attributes, calling the respective <tt>init*</tt>
+ * functions for the more complex data structures.
+ */
+static GLboolean
+init_attrib_groups(struct gl_context *ctx)
+{
+ assert(ctx);
+
+ /* Constants */
+ _mesa_init_constants( ctx );
+
+ /* Extensions */
+ _mesa_init_extensions( ctx );
+
+ /* Attribute Groups */
+ _mesa_init_accum( ctx );
+ _mesa_init_attrib( ctx );
+ _mesa_init_buffer_objects( ctx );
+ _mesa_init_color( ctx );
+ _mesa_init_current( ctx );
+ _mesa_init_depth( ctx );
+ _mesa_init_debug( ctx );
+ _mesa_init_display_list( ctx );
+ _mesa_init_eval( ctx );
+ _mesa_init_fbobjects( ctx );
+ _mesa_init_feedback( ctx );
+ _mesa_init_fog( ctx );
+ _mesa_init_hint( ctx );
+ _mesa_init_line( ctx );
+ _mesa_init_lighting( ctx );
+ _mesa_init_matrix( ctx );
+ _mesa_init_multisample( ctx );
+ _mesa_init_pixel( ctx );
+ _mesa_init_pixelstore( ctx );
+ _mesa_init_point( ctx );
+ _mesa_init_polygon( ctx );
+ _mesa_init_program( ctx );
+ _mesa_init_queryobj( ctx );
+ _mesa_init_sync( ctx );
+ _mesa_init_rastpos( ctx );
+ _mesa_init_scissor( ctx );
+ _mesa_init_shader_state( ctx );
+ _mesa_init_stencil( ctx );
+ _mesa_init_transform( ctx );
+ _mesa_init_transform_feedback( ctx );
+ _mesa_init_varray( ctx );
+ _mesa_init_viewport( ctx );
+
+ if (!_mesa_init_texture( ctx ))
+ return GL_FALSE;
+
+ _mesa_init_texture_s3tc( ctx );
+
+ /* Miscellaneous */
+ ctx->NewState = _NEW_ALL;
+ ctx->ErrorValue = (GLenum) GL_NO_ERROR;
+ ctx->ResetStatus = (GLenum) GL_NO_ERROR;
+ ctx->varying_vp_inputs = ~0;
+
+ return GL_TRUE;
+}
+
+
+/**
+ * Update default objects in a GL context with respect to shared state.
+ *
+ * \param ctx GL context.
+ *
+ * Removes references to old default objects, (texture objects, program
+ * objects, etc.) and changes to reference those from the current shared
+ * state.
+ */
+static GLboolean
+update_default_objects(struct gl_context *ctx)
+{
+ assert(ctx);
+
+ _mesa_update_default_objects_program(ctx);
+ _mesa_update_default_objects_texture(ctx);
+ _mesa_update_default_objects_buffer_objects(ctx);
+
+ return GL_TRUE;
+}
+
+
+/**
+ * This is the default function we plug into all dispatch table slots
+ * This helps prevents a segfault when someone calls a GL function without
+ * first checking if the extension's supported.
+ */
+static int
+generic_nop(void)
+{
+ _mesa_warning(NULL, "User called no-op dispatch function (an unsupported extension function?)");
+ return 0;
+}
+
+
+/**
+ * Allocate and initialize a new dispatch table.
+ */
+struct _glapi_table *
+_mesa_alloc_dispatch_table(int size)
+{
+ /* Find the larger of Mesa's dispatch table and libGL's dispatch table.
+ * In practice, this'll be the same for stand-alone Mesa. But for DRI
+ * Mesa we do this to accomodate different versions of libGL and various
+ * DRI drivers.
+ */
+ GLint numEntries = MAX2(_glapi_get_dispatch_table_size(), _gloffset_COUNT);
+ struct _glapi_table *table;
+
+ /* should never happen, but just in case */
+ numEntries = MAX2(numEntries, size);
+
+ table = (struct _glapi_table *) malloc(numEntries * sizeof(_glapi_proc));
+ if (table) {
+ _glapi_proc *entry = (_glapi_proc *) table;
+ GLint i;
+ for (i = 0; i < numEntries; i++) {
+ entry[i] = (_glapi_proc) generic_nop;
+ }
+ }
+ return table;
+}
+
+
+/**
+ * Initialize a struct gl_context struct (rendering context).
+ *
+ * This includes allocating all the other structs and arrays which hang off of
+ * the context by pointers.
+ * Note that the driver needs to pass in its dd_function_table here since
+ * we need to at least call driverFunctions->NewTextureObject to create the
+ * default texture objects.
+ *
+ * Called by _mesa_create_context().
+ *
+ * Performs the imports and exports callback tables initialization, and
+ * miscellaneous one-time initializations. If no shared context is supplied one
+ * is allocated, and increase its reference count. Setups the GL API dispatch
+ * tables. Initialize the TNL module. Sets the maximum Z buffer depth.
+ * Finally queries the \c MESA_DEBUG and \c MESA_VERBOSE environment variables
+ * for debug flags.
+ *
+ * \param ctx the context to initialize
+ * \param api the GL API type to create the context for
+ * \param visual describes the visual attributes for this context
+ * \param share_list points to context to share textures, display lists,
+ * etc with, or NULL
+ * \param driverFunctions table of device driver functions for this context
+ * to use
+ * \param driverContext pointer to driver-specific context data
+ */
+GLboolean
+_mesa_initialize_context(struct gl_context *ctx,
+ gl_api api,
+ const struct gl_config *visual,
+ struct gl_context *share_list,
+ const struct dd_function_table *driverFunctions,
+ void *driverContext)
+{
+ struct gl_shared_state *shared;
+ int i;
+
+ /*ASSERT(driverContext);*/
+ assert(driverFunctions->NewTextureObject);
+ assert(driverFunctions->FreeTexImageData);
+
+ ctx->API = api;
+ ctx->Visual = *visual;
+ ctx->DrawBuffer = NULL;
+ ctx->ReadBuffer = NULL;
+ ctx->WinSysDrawBuffer = NULL;
+ ctx->WinSysReadBuffer = NULL;
+
+ /* misc one-time initializations */
+ one_time_init(ctx);
+
+ /* Plug in driver functions and context pointer here.
+ * This is important because when we call alloc_shared_state() below
+ * we'll call ctx->Driver.NewTextureObject() to create the default
+ * textures.
+ */
+ ctx->Driver = *driverFunctions;
+ ctx->DriverCtx = driverContext;
+
+ if (share_list) {
+ /* share state with another context */
+ shared = share_list->Shared;
+ }
+ else {
+ /* allocate new, unshared state */
+ shared = _mesa_alloc_shared_state(ctx);
+ if (!shared)
+ return GL_FALSE;
+ }
+
+ _glthread_LOCK_MUTEX(shared->Mutex);
+ ctx->Shared = shared;
+ shared->RefCount++;
+ _glthread_UNLOCK_MUTEX(shared->Mutex);
+
+ if (!init_attrib_groups( ctx )) {
+ _mesa_release_shared_state(ctx, ctx->Shared);
+ return GL_FALSE;
+ }
+
+#if FEATURE_dispatch
+ /* setup the API dispatch tables */
+ switch (ctx->API) {
+#if FEATURE_GL
+ case API_OPENGL:
+ ctx->Exec = _mesa_create_exec_table();
+ break;
+#endif
+#if FEATURE_ES1
+ case API_OPENGLES:
+ ctx->Exec = _mesa_create_exec_table_es1();
+ break;
+#endif
+#if FEATURE_ES2
+ case API_OPENGLES2:
+ ctx->Exec = _mesa_create_exec_table_es2();
+ break;
+#endif
+ default:
+ _mesa_problem(ctx, "unknown or unsupported API");
+ break;
+ }
+
+ if (!ctx->Exec) {
+ _mesa_release_shared_state(ctx, ctx->Shared);
+ return GL_FALSE;
+ }
+#endif
+ ctx->CurrentDispatch = ctx->Exec;
+
+ ctx->FragmentProgram._MaintainTexEnvProgram
+ = (_mesa_getenv("MESA_TEX_PROG") != NULL);
+
+ ctx->VertexProgram._MaintainTnlProgram
+ = (_mesa_getenv("MESA_TNL_PROG") != NULL);
+ if (ctx->VertexProgram._MaintainTnlProgram) {
+ /* this is required... */
+ ctx->FragmentProgram._MaintainTexEnvProgram = GL_TRUE;
+ }
+
+ /* Mesa core handles all the formats that mesa core knows about.
+ * Drivers will want to override this list with just the formats
+ * they can handle, and confirm that appropriate fallbacks exist in
+ * _mesa_choose_tex_format().
+ */
+ memset(&ctx->TextureFormatSupported, GL_TRUE,
+ sizeof(ctx->TextureFormatSupported));
+
+ switch (ctx->API) {
+ case API_OPENGL:
+#if FEATURE_dlist
+ ctx->Save = _mesa_create_save_table();
+ if (!ctx->Save) {
+ _mesa_release_shared_state(ctx, ctx->Shared);
+ free(ctx->Exec);
+ return GL_FALSE;
+ }
+
+ _mesa_install_save_vtxfmt( ctx, &ctx->ListState.ListVtxfmt );
+#endif
+ break;
+ case API_OPENGLES:
+ /**
+ * GL_OES_texture_cube_map says
+ * "Initially all texture generation modes are set to REFLECTION_MAP_OES"
+ */
+ for (i = 0; i < MAX_TEXTURE_UNITS; i++) {
+ struct gl_texture_unit *texUnit = &ctx->Texture.Unit[i];
+ texUnit->GenS.Mode = GL_REFLECTION_MAP_NV;
+ texUnit->GenT.Mode = GL_REFLECTION_MAP_NV;
+ texUnit->GenR.Mode = GL_REFLECTION_MAP_NV;
+ texUnit->GenS._ModeBit = TEXGEN_REFLECTION_MAP_NV;
+ texUnit->GenT._ModeBit = TEXGEN_REFLECTION_MAP_NV;
+ texUnit->GenR._ModeBit = TEXGEN_REFLECTION_MAP_NV;
+ }
+ break;
+ case API_OPENGLES2:
+ ctx->FragmentProgram._MaintainTexEnvProgram = GL_TRUE;
+ ctx->VertexProgram._MaintainTnlProgram = GL_TRUE;
+ ctx->Point.PointSprite = GL_TRUE; /* always on for ES 2.x */
+ break;
+ }
+
+ ctx->FirstTimeCurrent = GL_TRUE;
+
+ return GL_TRUE;
+}
+
+
+/**
+ * Allocate and initialize a struct gl_context structure.
+ * Note that the driver needs to pass in its dd_function_table here since
+ * we need to at least call driverFunctions->NewTextureObject to initialize
+ * the rendering context.
+ *
+ * \param api the GL API type to create the context for
+ * \param visual a struct gl_config pointer (we copy the struct contents)
+ * \param share_list another context to share display lists with or NULL
+ * \param driverFunctions points to the dd_function_table into which the
+ * driver has plugged in all its special functions.
+ * \param driverContext points to the device driver's private context state
+ *
+ * \return pointer to a new __struct gl_contextRec or NULL if error.
+ */
+struct gl_context *
+_mesa_create_context(gl_api api,
+ const struct gl_config *visual,
+ struct gl_context *share_list,
+ const struct dd_function_table *driverFunctions,
+ void *driverContext)
+{
+ struct gl_context *ctx;
+
+ ASSERT(visual);
+ /*ASSERT(driverContext);*/
+
+ ctx = (struct gl_context *) calloc(1, sizeof(struct gl_context));
+ if (!ctx)
+ return NULL;
+
+ if (_mesa_initialize_context(ctx, api, visual, share_list,
+ driverFunctions, driverContext)) {
+ return ctx;
+ }
+ else {
+ free(ctx);
+ return NULL;
+ }
+}
+
+
+/**
+ * Free the data associated with the given context.
+ *
+ * But doesn't free the struct gl_context struct itself.
+ *
+ * \sa _mesa_initialize_context() and init_attrib_groups().
+ */
+void
+_mesa_free_context_data( struct gl_context *ctx )
+{
+ if (!_mesa_get_current_context()){
+ /* No current context, but we may need one in order to delete
+ * texture objs, etc. So temporarily bind the context now.
+ */
+ _mesa_make_current(ctx, NULL, NULL);
+ }
+
+ /* unreference WinSysDraw/Read buffers */
+ _mesa_reference_framebuffer(&ctx->WinSysDrawBuffer, NULL);
+ _mesa_reference_framebuffer(&ctx->WinSysReadBuffer, NULL);
+ _mesa_reference_framebuffer(&ctx->DrawBuffer, NULL);
+ _mesa_reference_framebuffer(&ctx->ReadBuffer, NULL);
+
+ _mesa_reference_vertprog(ctx, &ctx->VertexProgram.Current, NULL);
+ _mesa_reference_vertprog(ctx, &ctx->VertexProgram._Current, NULL);
+ _mesa_reference_vertprog(ctx, &ctx->VertexProgram._TnlProgram, NULL);
+
+ _mesa_reference_fragprog(ctx, &ctx->FragmentProgram.Current, NULL);
+ _mesa_reference_fragprog(ctx, &ctx->FragmentProgram._Current, NULL);
+ _mesa_reference_fragprog(ctx, &ctx->FragmentProgram._TexEnvProgram, NULL);
+
+ _mesa_free_attrib_data(ctx);
+ _mesa_free_buffer_objects(ctx);
+ _mesa_free_lighting_data( ctx );
+ _mesa_free_eval_data( ctx );
+ _mesa_free_texture_data( ctx );
+ _mesa_free_matrix_data( ctx );
+ _mesa_free_viewport_data( ctx );
+ _mesa_free_program_data(ctx);
+ _mesa_free_shader_state(ctx);
+ _mesa_free_queryobj_data(ctx);
+ _mesa_free_sync_data(ctx);
+ _mesa_free_varray_data(ctx);
+ _mesa_free_transform_feedback(ctx);
+
+ _mesa_delete_array_object(ctx, ctx->Array.DefaultArrayObj);
+
+#if FEATURE_ARB_pixel_buffer_object
+ _mesa_reference_buffer_object(ctx, &ctx->Pack.BufferObj, NULL);
+ _mesa_reference_buffer_object(ctx, &ctx->Unpack.BufferObj, NULL);
+ _mesa_reference_buffer_object(ctx, &ctx->DefaultPacking.BufferObj, NULL);
+#endif
+
+#if FEATURE_ARB_vertex_buffer_object
+ _mesa_reference_buffer_object(ctx, &ctx->Array.ArrayBufferObj, NULL);
+ _mesa_reference_buffer_object(ctx, &ctx->Array.ElementArrayBufferObj, NULL);
+#endif
+
+ /* free dispatch tables */
+ free(ctx->Exec);
+ free(ctx->Save);
+
+ /* Shared context state (display lists, textures, etc) */
+ _mesa_release_shared_state( ctx, ctx->Shared );
+
+ /* needs to be after freeing shared state */
+ _mesa_free_display_list_data(ctx);
+
+ if (ctx->Extensions.String)
+ free((void *) ctx->Extensions.String);
+
+ if (ctx->VersionString)
+ free(ctx->VersionString);
+
+ /* unbind the context if it's currently bound */
+ if (ctx == _mesa_get_current_context()) {
+ _mesa_make_current(NULL, NULL, NULL);
+ }
+}
+
+
+/**
+ * Destroy a struct gl_context structure.
+ *
+ * \param ctx GL context.
+ *
+ * Calls _mesa_free_context_data() and frees the gl_context object itself.
+ */
+void
+_mesa_destroy_context( struct gl_context *ctx )
+{
+ if (ctx) {
+ _mesa_free_context_data(ctx);
+ free( (void *) ctx );
+ }
+}
+
+
+#if _HAVE_FULL_GL
+/**
+ * Copy attribute groups from one context to another.
+ *
+ * \param src source context
+ * \param dst destination context
+ * \param mask bitwise OR of GL_*_BIT flags
+ *
+ * According to the bits specified in \p mask, copies the corresponding
+ * attributes from \p src into \p dst. For many of the attributes a simple \c
+ * memcpy is not enough due to the existence of internal pointers in their data
+ * structures.
+ */
+void
+_mesa_copy_context( const struct gl_context *src, struct gl_context *dst,
+ GLuint mask )
+{
+ if (mask & GL_ACCUM_BUFFER_BIT) {
+ /* OK to memcpy */
+ dst->Accum = src->Accum;
+ }
+ if (mask & GL_COLOR_BUFFER_BIT) {
+ /* OK to memcpy */
+ dst->Color = src->Color;
+ }
+ if (mask & GL_CURRENT_BIT) {
+ /* OK to memcpy */
+ dst->Current = src->Current;
+ }
+ if (mask & GL_DEPTH_BUFFER_BIT) {
+ /* OK to memcpy */
+ dst->Depth = src->Depth;
+ }
+ if (mask & GL_ENABLE_BIT) {
+ /* no op */
+ }
+ if (mask & GL_EVAL_BIT) {
+ /* OK to memcpy */
+ dst->Eval = src->Eval;
+ }
+ if (mask & GL_FOG_BIT) {
+ /* OK to memcpy */
+ dst->Fog = src->Fog;
+ }
+ if (mask & GL_HINT_BIT) {
+ /* OK to memcpy */
+ dst->Hint = src->Hint;
+ }
+ if (mask & GL_LIGHTING_BIT) {
+ GLuint i;
+ /* begin with memcpy */
+ dst->Light = src->Light;
+ /* fixup linked lists to prevent pointer insanity */
+ make_empty_list( &(dst->Light.EnabledList) );
+ for (i = 0; i < MAX_LIGHTS; i++) {
+ if (dst->Light.Light[i].Enabled) {
+ insert_at_tail(&(dst->Light.EnabledList), &(dst->Light.Light[i]));
+ }
+ }
+ }
+ if (mask & GL_LINE_BIT) {
+ /* OK to memcpy */
+ dst->Line = src->Line;
+ }
+ if (mask & GL_LIST_BIT) {
+ /* OK to memcpy */
+ dst->List = src->List;
+ }
+ if (mask & GL_PIXEL_MODE_BIT) {
+ /* OK to memcpy */
+ dst->Pixel = src->Pixel;
+ }
+ if (mask & GL_POINT_BIT) {
+ /* OK to memcpy */
+ dst->Point = src->Point;
+ }
+ if (mask & GL_POLYGON_BIT) {
+ /* OK to memcpy */
+ dst->Polygon = src->Polygon;
+ }
+ if (mask & GL_POLYGON_STIPPLE_BIT) {
+ /* Use loop instead of memcpy due to problem with Portland Group's
+ * C compiler. Reported by John Stone.
+ */
+ GLuint i;
+ for (i = 0; i < 32; i++) {
+ dst->PolygonStipple[i] = src->PolygonStipple[i];
+ }
+ }
+ if (mask & GL_SCISSOR_BIT) {
+ /* OK to memcpy */
+ dst->Scissor = src->Scissor;
+ }
+ if (mask & GL_STENCIL_BUFFER_BIT) {
+ /* OK to memcpy */
+ dst->Stencil = src->Stencil;
+ }
+ if (mask & GL_TEXTURE_BIT) {
+ /* Cannot memcpy because of pointers */
+ _mesa_copy_texture_state(src, dst);
+ }
+ if (mask & GL_TRANSFORM_BIT) {
+ /* OK to memcpy */
+ dst->Transform = src->Transform;
+ }
+ if (mask & GL_VIEWPORT_BIT) {
+ /* Cannot use memcpy, because of pointers in GLmatrix _WindowMap */
+ dst->Viewport.X = src->Viewport.X;
+ dst->Viewport.Y = src->Viewport.Y;
+ dst->Viewport.Width = src->Viewport.Width;
+ dst->Viewport.Height = src->Viewport.Height;
+ dst->Viewport.Near = src->Viewport.Near;
+ dst->Viewport.Far = src->Viewport.Far;
+ _math_matrix_copy(&dst->Viewport._WindowMap, &src->Viewport._WindowMap);
+ }
+
+ /* XXX FIXME: Call callbacks?
+ */
+ dst->NewState = _NEW_ALL;
+}
+#endif
+
+
+/**
+ * Check if the given context can render into the given framebuffer
+ * by checking visual attributes.
+ *
+ * Most of these tests could go away because Mesa is now pretty flexible
+ * in terms of mixing rendering contexts with framebuffers. As long
+ * as RGB vs. CI mode agree, we're probably good.
+ *
+ * \return GL_TRUE if compatible, GL_FALSE otherwise.
+ */
+static GLboolean
+check_compatible(const struct gl_context *ctx,
+ const struct gl_framebuffer *buffer)
+{
+ const struct gl_config *ctxvis = &ctx->Visual;
+ const struct gl_config *bufvis = &buffer->Visual;
+
+ if (buffer == _mesa_get_incomplete_framebuffer())
+ return GL_TRUE;
+
+#if 0
+ /* disabling this fixes the fgl_glxgears pbuffer demo */
+ if (ctxvis->doubleBufferMode && !bufvis->doubleBufferMode)
+ return GL_FALSE;
+#endif
+ if (ctxvis->stereoMode && !bufvis->stereoMode)
+ return GL_FALSE;
+ if (ctxvis->haveAccumBuffer && !bufvis->haveAccumBuffer)
+ return GL_FALSE;
+ if (ctxvis->haveDepthBuffer && !bufvis->haveDepthBuffer)
+ return GL_FALSE;
+ if (ctxvis->haveStencilBuffer && !bufvis->haveStencilBuffer)
+ return GL_FALSE;
+ if (ctxvis->redMask && ctxvis->redMask != bufvis->redMask)
+ return GL_FALSE;
+ if (ctxvis->greenMask && ctxvis->greenMask != bufvis->greenMask)
+ return GL_FALSE;
+ if (ctxvis->blueMask && ctxvis->blueMask != bufvis->blueMask)
+ return GL_FALSE;
+#if 0
+ /* disabled (see bug 11161) */
+ if (ctxvis->depthBits && ctxvis->depthBits != bufvis->depthBits)
+ return GL_FALSE;
+#endif
+ if (ctxvis->stencilBits && ctxvis->stencilBits != bufvis->stencilBits)
+ return GL_FALSE;
+
+ return GL_TRUE;
+}
+
+
+/**
+ * Do one-time initialization for the given framebuffer. Specifically,
+ * ask the driver for the window's current size and update the framebuffer
+ * object to match.
+ * Really, the device driver should totally take care of this.
+ */
+static void
+initialize_framebuffer_size(struct gl_context *ctx, struct gl_framebuffer *fb)
+{
+ GLuint width, height;
+ if (ctx->Driver.GetBufferSize) {
+ ctx->Driver.GetBufferSize(fb, &width, &height);
+ if (ctx->Driver.ResizeBuffers)
+ ctx->Driver.ResizeBuffers(ctx, fb, width, height);
+ fb->Initialized = GL_TRUE;
+ }
+}
+
+
+/**
+ * Check if the viewport/scissor size has not yet been initialized.
+ * Initialize the size if the given width and height are non-zero.
+ */
+void
+_mesa_check_init_viewport(struct gl_context *ctx, GLuint width, GLuint height)
+{
+ if (!ctx->ViewportInitialized && width > 0 && height > 0) {
+ /* Note: set flag here, before calling _mesa_set_viewport(), to prevent
+ * potential infinite recursion.
+ */
+ ctx->ViewportInitialized = GL_TRUE;
+ _mesa_set_viewport(ctx, 0, 0, width, height);
+ _mesa_set_scissor(ctx, 0, 0, width, height);
+ }
+}
+
+
+/**
+ * Bind the given context to the given drawBuffer and readBuffer and
+ * make it the current context for the calling thread.
+ * We'll render into the drawBuffer and read pixels from the
+ * readBuffer (i.e. glRead/CopyPixels, glCopyTexImage, etc).
+ *
+ * We check that the context's and framebuffer's visuals are compatible
+ * and return immediately if they're not.
+ *
+ * \param newCtx the new GL context. If NULL then there will be no current GL
+ * context.
+ * \param drawBuffer the drawing framebuffer
+ * \param readBuffer the reading framebuffer
+ */
+GLboolean
+_mesa_make_current( struct gl_context *newCtx,
+ struct gl_framebuffer *drawBuffer,
+ struct gl_framebuffer *readBuffer )
+{
+ GET_CURRENT_CONTEXT(curCtx);
+
+ if (MESA_VERBOSE & VERBOSE_API)
+ _mesa_debug(newCtx, "_mesa_make_current()\n");
+
+ /* Check that the context's and framebuffer's visuals are compatible.
+ */
+ if (newCtx && drawBuffer && newCtx->WinSysDrawBuffer != drawBuffer) {
+ if (!check_compatible(newCtx, drawBuffer)) {
+ _mesa_warning(newCtx,
+ "MakeCurrent: incompatible visuals for context and drawbuffer");
+ return GL_FALSE;
+ }
+ }
+ if (newCtx && readBuffer && newCtx->WinSysReadBuffer != readBuffer) {
+ if (!check_compatible(newCtx, readBuffer)) {
+ _mesa_warning(newCtx,
+ "MakeCurrent: incompatible visuals for context and readbuffer");
+ return GL_FALSE;
+ }
+ }
+
+ if (curCtx &&
+ (curCtx->WinSysDrawBuffer || curCtx->WinSysReadBuffer) && /* make sure this context is valid for flushing */
+ curCtx != newCtx)
+ _mesa_flush(curCtx);
+
+ /* We used to call _glapi_check_multithread() here. Now do it in drivers */
+ _glapi_set_context((void *) newCtx);
+ ASSERT(_mesa_get_current_context() == newCtx);
+
+ if (!newCtx) {
+ _glapi_set_dispatch(NULL); /* none current */
+ }
+ else {
+ _glapi_set_dispatch(newCtx->CurrentDispatch);
+
+ if (drawBuffer && readBuffer) {
+ /* TODO: check if newCtx and buffer's visual match??? */
+
+ ASSERT(drawBuffer->Name == 0);
+ ASSERT(readBuffer->Name == 0);
+ _mesa_reference_framebuffer(&newCtx->WinSysDrawBuffer, drawBuffer);
+ _mesa_reference_framebuffer(&newCtx->WinSysReadBuffer, readBuffer);
+
+ /*
+ * Only set the context's Draw/ReadBuffer fields if they're NULL
+ * or not bound to a user-created FBO.
+ */
+ if (!newCtx->DrawBuffer || newCtx->DrawBuffer->Name == 0) {
+ /* KW: merge conflict here, revisit.
+ */
+ /* fix up the fb fields - these will end up wrong otherwise
+ * if the DRIdrawable changes, and everything relies on them.
+ * This is a bit messy (same as needed in _mesa_BindFramebufferEXT)
+ */
+ unsigned int i;
+ GLenum buffers[MAX_DRAW_BUFFERS];
+
+ _mesa_reference_framebuffer(&newCtx->DrawBuffer, drawBuffer);
+
+ for(i = 0; i < newCtx->Const.MaxDrawBuffers; i++) {
+ buffers[i] = newCtx->Color.DrawBuffer[i];
+ }
+
+ _mesa_drawbuffers(newCtx, newCtx->Const.MaxDrawBuffers,
+ buffers, NULL);
+ }
+ if (!newCtx->ReadBuffer || newCtx->ReadBuffer->Name == 0) {
+ _mesa_reference_framebuffer(&newCtx->ReadBuffer, readBuffer);
+ }
+
+ /* XXX only set this flag if we're really changing the draw/read
+ * framebuffer bindings.
+ */
+ newCtx->NewState |= _NEW_BUFFERS;
+
+#if 1
+ /* We want to get rid of these lines: */
+
+#if _HAVE_FULL_GL
+ if (!drawBuffer->Initialized) {
+ initialize_framebuffer_size(newCtx, drawBuffer);
+ }
+ if (readBuffer != drawBuffer && !readBuffer->Initialized) {
+ initialize_framebuffer_size(newCtx, readBuffer);
+ }
+
+ _mesa_resizebuffers(newCtx);
+#endif
+
+#else
+ /* We want the drawBuffer and readBuffer to be initialized by
+ * the driver.
+ * This generally means the Width and Height match the actual
+ * window size and the renderbuffers (both hardware and software
+ * based) are allocated to match. The later can generally be
+ * done with a call to _mesa_resize_framebuffer().
+ *
+ * It's theoretically possible for a buffer to have zero width
+ * or height, but for now, assert check that the driver did what's
+ * expected of it.
+ */
+ ASSERT(drawBuffer->Width > 0);
+ ASSERT(drawBuffer->Height > 0);
+#endif
+
+ if (drawBuffer) {
+ _mesa_check_init_viewport(newCtx,
+ drawBuffer->Width, drawBuffer->Height);
+ }
+ }
+
+ if (newCtx->FirstTimeCurrent) {
+ _mesa_compute_version(newCtx);
+
+ newCtx->Extensions.String = _mesa_make_extension_string(newCtx);
+
+ check_context_limits(newCtx);
+
+ /* We can use this to help debug user's problems. Tell them to set
+ * the MESA_INFO env variable before running their app. Then the
+ * first time each context is made current we'll print some useful
+ * information.
+ */
+ if (_mesa_getenv("MESA_INFO")) {
+ _mesa_print_info();
+ }
+
+ newCtx->FirstTimeCurrent = GL_FALSE;
+ }
+ }
+
+ return GL_TRUE;
+}
+
+
+/**
+ * Make context 'ctx' share the display lists, textures and programs
+ * that are associated with 'ctxToShare'.
+ * Any display lists, textures or programs associated with 'ctx' will
+ * be deleted if nobody else is sharing them.
+ */
+GLboolean
+_mesa_share_state(struct gl_context *ctx, struct gl_context *ctxToShare)
+{
+ if (ctx && ctxToShare && ctx->Shared && ctxToShare->Shared) {
+ struct gl_shared_state *oldSharedState = ctx->Shared;
+
+ ctx->Shared = ctxToShare->Shared;
+
+ _glthread_LOCK_MUTEX(ctx->Shared->Mutex);
+ ctx->Shared->RefCount++;
+ _glthread_UNLOCK_MUTEX(ctx->Shared->Mutex);
+
+ update_default_objects(ctx);
+
+ _mesa_release_shared_state(ctx, oldSharedState);
+
+ return GL_TRUE;
+ }
+ else {
+ return GL_FALSE;
+ }
+}
+
+
+
+/**
+ * \return pointer to the current GL context for this thread.
+ *
+ * Calls _glapi_get_context(). This isn't the fastest way to get the current
+ * context. If you need speed, see the #GET_CURRENT_CONTEXT macro in
+ * context.h.
+ */
+struct gl_context *
+_mesa_get_current_context( void )
+{
+ return (struct gl_context *) _glapi_get_context();
+}
+
+
+/**
+ * Get context's current API dispatch table.
+ *
+ * It'll either be the immediate-mode execute dispatcher or the display list
+ * compile dispatcher.
+ *
+ * \param ctx GL context.
+ *
+ * \return pointer to dispatch_table.
+ *
+ * Simply returns __struct gl_contextRec::CurrentDispatch.
+ */
+struct _glapi_table *
+_mesa_get_dispatch(struct gl_context *ctx)
+{
+ return ctx->CurrentDispatch;
+}
+
+/*@}*/
+
+
+/**********************************************************************/
+/** \name Miscellaneous functions */
+/**********************************************************************/
+/*@{*/
+
+/**
+ * Record an error.
+ *
+ * \param ctx GL context.
+ * \param error error code.
+ *
+ * Records the given error code and call the driver's dd_function_table::Error
+ * function if defined.
+ *
+ * \sa
+ * This is called via _mesa_error().
+ */
+void
+_mesa_record_error(struct gl_context *ctx, GLenum error)
+{
+ if (!ctx)
+ return;
+
+ if (ctx->ErrorValue == GL_NO_ERROR) {
+ ctx->ErrorValue = error;
+ }
+
+ /* Call device driver's error handler, if any. This is used on the Mac. */
+ if (ctx->Driver.Error) {
+ ctx->Driver.Error(ctx);
+ }
+}
+
+
+/**
+ * Flush commands and wait for completion.
+ */
+void
+_mesa_finish(struct gl_context *ctx)
+{
+ FLUSH_CURRENT( ctx, 0 );
+ if (ctx->Driver.Finish) {
+ ctx->Driver.Finish(ctx);
+ }
+}
+
+
+/**
+ * Flush commands.
+ */
+void
+_mesa_flush(struct gl_context *ctx)
+{
+ FLUSH_CURRENT( ctx, 0 );
+ if (ctx->Driver.Flush) {
+ ctx->Driver.Flush(ctx);
+ }
+}
+
+
+
+/**
+ * Execute glFinish().
+ *
+ * Calls the #ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH macro and the
+ * dd_function_table::Finish driver callback, if not NULL.
+ */
+void GLAPIENTRY
+_mesa_Finish(void)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
+ _mesa_finish(ctx);
+}
+
+
+/**
+ * Execute glFlush().
+ *
+ * Calls the #ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH macro and the
+ * dd_function_table::Flush driver callback, if not NULL.
+ */
+void GLAPIENTRY
+_mesa_Flush(void)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
+ _mesa_flush(ctx);
+}
+
+
+/**
+ * Set mvp_with_dp4 flag. If a driver has a preference for DP4 over
+ * MUL/MAD, or vice versa, call this function to register that.
+ * Otherwise we default to MUL/MAD.
+ */
+void
+_mesa_set_mvp_with_dp4( struct gl_context *ctx,
+ GLboolean flag )
+{
+ ctx->mvp_with_dp4 = flag;
+}
+
+
+
+/**
+ * Prior to drawing anything with glBegin, glDrawArrays, etc. this function
+ * is called to see if it's valid to render. This involves checking that
+ * the current shader is valid and the framebuffer is complete.
+ * If an error is detected it'll be recorded here.
+ * \return GL_TRUE if OK to render, GL_FALSE if not
+ */
+GLboolean
+_mesa_valid_to_render(struct gl_context *ctx, const char *where)
+{
+ bool vert_from_glsl_shader = false;
+ bool geom_from_glsl_shader = false;
+ bool frag_from_glsl_shader = false;
+
+ /* This depends on having up to date derived state (shaders) */
+ if (ctx->NewState)
+ _mesa_update_state(ctx);
+
+ if (ctx->Shader.CurrentVertexProgram) {
+ vert_from_glsl_shader = true;
+
+ if (!ctx->Shader.CurrentVertexProgram->LinkStatus) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "%s(shader not linked)", where);
+ return GL_FALSE;
+ }
+#if 0 /* not normally enabled */
+ {
+ char errMsg[100];
+ if (!_mesa_validate_shader_program(ctx,
+ ctx->Shader.CurrentVertexProgram,
+ errMsg)) {
+ _mesa_warning(ctx, "Shader program %u is invalid: %s",
+ ctx->Shader.CurrentVertexProgram->Name, errMsg);
+ }
+ }
+#endif
+ }
+
+ if (ctx->Shader.CurrentGeometryProgram) {
+ geom_from_glsl_shader = true;
+
+ if (!ctx->Shader.CurrentGeometryProgram->LinkStatus) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "%s(shader not linked)", where);
+ return GL_FALSE;
+ }
+#if 0 /* not normally enabled */
+ {
+ char errMsg[100];
+ if (!_mesa_validate_shader_program(ctx,
+ ctx->Shader.CurrentGeometryProgram,
+ errMsg)) {
+ _mesa_warning(ctx, "Shader program %u is invalid: %s",
+ ctx->Shader.CurrentGeometryProgram->Name, errMsg);
+ }
+ }
+#endif
+ }
+
+ if (ctx->Shader.CurrentFragmentProgram) {
+ frag_from_glsl_shader = true;
+
+ if (!ctx->Shader.CurrentFragmentProgram->LinkStatus) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "%s(shader not linked)", where);
+ return GL_FALSE;
+ }
+#if 0 /* not normally enabled */
+ {
+ char errMsg[100];
+ if (!_mesa_validate_shader_program(ctx,
+ ctx->Shader.CurrentFragmentProgram,
+ errMsg)) {
+ _mesa_warning(ctx, "Shader program %u is invalid: %s",
+ ctx->Shader.CurrentFragmentProgram->Name, errMsg);
+ }
+ }
+#endif
+ }
+
+ /* Any shader stages that are not supplied by the GLSL shader and have
+ * assembly shaders enabled must now be validated.
+ */
+ if (!vert_from_glsl_shader
+ && ctx->VertexProgram.Enabled && !ctx->VertexProgram._Enabled) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "%s(vertex program not valid)", where);
+ return GL_FALSE;
+ }
+
+ /* FINISHME: If GL_NV_geometry_program4 is ever supported, the current
+ * FINISHME: geometry program should validated here.
+ */
+ (void) geom_from_glsl_shader;
+
+ if (!frag_from_glsl_shader) {
+ if (ctx->FragmentProgram.Enabled && !ctx->FragmentProgram._Enabled) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "%s(fragment program not valid)", where);
+ return GL_FALSE;
+ }
+
+ /* If drawing to integer-valued color buffers, there must be an
+ * active fragment shader (GL_EXT_texture_integer).
+ */
+ if (ctx->DrawBuffer && ctx->DrawBuffer->_IntegerColor) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "%s(integer format but no fragment shader)", where);
+ return GL_FALSE;
+ }
+ }
+
+ if (ctx->DrawBuffer->_Status != GL_FRAMEBUFFER_COMPLETE_EXT) {
+ _mesa_error(ctx, GL_INVALID_FRAMEBUFFER_OPERATION_EXT,
+ "%s(incomplete framebuffer)", where);
+ return GL_FALSE;
+ }
+
+#ifdef DEBUG
+ if (ctx->Shader.Flags & GLSL_LOG) {
+ struct gl_shader_program *shProg[MESA_SHADER_TYPES];
+ gl_shader_type i;
+
+ shProg[MESA_SHADER_VERTEX] = ctx->Shader.CurrentVertexProgram;
+ shProg[MESA_SHADER_GEOMETRY] = ctx->Shader.CurrentGeometryProgram;
+ shProg[MESA_SHADER_FRAGMENT] = ctx->Shader.CurrentFragmentProgram;
+
+ for (i = 0; i < MESA_SHADER_TYPES; i++) {
+ struct gl_shader *sh;
+
+ if (shProg[i] == NULL || shProg[i]->_Used
+ || shProg[i]->_LinkedShaders[i] == NULL)
+ continue;
+
+ /* This is the first time this shader is being used.
+ * Append shader's constants/uniforms to log file.
+ *
+ * The logic is a little odd here. We only want to log data for each
+ * shader target that will actually be used, and we only want to log
+ * it once. It's possible to have a program bound to the vertex
+ * shader target that also supplied a fragment shader. If that
+ * program isn't also bound to the fragment shader target we don't
+ * want to log its fragment data.
+ */
+ sh = shProg[i]->_LinkedShaders[i];
+ switch (sh->Type) {
+ case GL_VERTEX_SHADER:
+ _mesa_append_uniforms_to_file(sh, &shProg[i]->VertexProgram->Base);
+ break;
+
+ case GL_GEOMETRY_SHADER_ARB:
+ _mesa_append_uniforms_to_file(sh,
+ &shProg[i]->GeometryProgram->Base);
+ break;
+
+ case GL_FRAGMENT_SHADER:
+ _mesa_append_uniforms_to_file(sh,
+ &shProg[i]->FragmentProgram->Base);
+ break;
+ }
+ }
+
+ for (i = 0; i < MESA_SHADER_TYPES; i++) {
+ if (shProg[i] != NULL)
+ shProg[i]->_Used = GL_TRUE;
+ }
+ }
+#endif
+
+ return GL_TRUE;
+}
+
+
+/*@}*/
diff --git a/mesalib/src/mesa/main/context.h b/mesalib/src/mesa/main/context.h
index a4c7ba2c5..2e9fbc77a 100644
--- a/mesalib/src/mesa/main/context.h
+++ b/mesalib/src/mesa/main/context.h
@@ -1,289 +1,289 @@
-/*
- * Mesa 3-D graphics library
- * Version: 6.5.1
- *
- * Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-
-/**
- * \file context.h
- * Mesa context and visual-related functions.
- *
- * There are three large Mesa data types/classes which are meant to be
- * used by device drivers:
- * - struct gl_context: this contains the Mesa rendering state
- * - struct gl_config: this describes the color buffer (RGB vs. ci), whether
- * or not there's a depth buffer, stencil buffer, etc.
- * - struct gl_framebuffer: contains pointers to the depth buffer, stencil
- * buffer, accum buffer and alpha buffers.
- *
- * These types should be encapsulated by corresponding device driver
- * data types. See xmesa.h and xmesaP.h for an example.
- *
- * In OOP terms, struct gl_context, struct gl_config, and struct gl_framebuffer
- * are base classes which the device driver must derive from.
- *
- * The following functions create and destroy these data types.
- */
-
-
-#ifndef CONTEXT_H
-#define CONTEXT_H
-
-
-#include "imports.h"
-#include "mtypes.h"
-
-
-struct _glapi_table;
-
-
-/** \name Visual-related functions */
-/*@{*/
-
-extern struct gl_config *
-_mesa_create_visual( GLboolean dbFlag,
- GLboolean stereoFlag,
- GLint redBits,
- GLint greenBits,
- GLint blueBits,
- GLint alphaBits,
- GLint depthBits,
- GLint stencilBits,
- GLint accumRedBits,
- GLint accumGreenBits,
- GLint accumBlueBits,
- GLint accumAlphaBits,
- GLint numSamples );
-
-extern GLboolean
-_mesa_initialize_visual( struct gl_config *v,
- GLboolean dbFlag,
- GLboolean stereoFlag,
- GLint redBits,
- GLint greenBits,
- GLint blueBits,
- GLint alphaBits,
- GLint depthBits,
- GLint stencilBits,
- GLint accumRedBits,
- GLint accumGreenBits,
- GLint accumBlueBits,
- GLint accumAlphaBits,
- GLint numSamples );
-
-extern void
-_mesa_destroy_visual( struct gl_config *vis );
-
-/*@}*/
-
-
-/** \name Context-related functions */
-/*@{*/
-
-extern GLboolean
-_mesa_initialize_context( struct gl_context *ctx,
- gl_api api,
- const struct gl_config *visual,
- struct gl_context *share_list,
- const struct dd_function_table *driverFunctions,
- void *driverContext );
-
-extern struct gl_context *
-_mesa_create_context(gl_api api,
- const struct gl_config *visual,
- struct gl_context *share_list,
- const struct dd_function_table *driverFunctions,
- void *driverContext);
-
-extern void
-_mesa_free_context_data( struct gl_context *ctx );
-
-extern void
-_mesa_destroy_context( struct gl_context *ctx );
-
-
-extern void
-_mesa_copy_context(const struct gl_context *src, struct gl_context *dst, GLuint mask);
-
-
-extern void
-_mesa_check_init_viewport(struct gl_context *ctx, GLuint width, GLuint height);
-
-extern GLboolean
-_mesa_make_current( struct gl_context *ctx, struct gl_framebuffer *drawBuffer,
- struct gl_framebuffer *readBuffer );
-
-extern GLboolean
-_mesa_share_state(struct gl_context *ctx, struct gl_context *ctxToShare);
-
-extern struct gl_context *
-_mesa_get_current_context(void);
-
-/*@}*/
-
-extern void
-_mesa_init_get_hash(struct gl_context *ctx);
-
-extern void
-_mesa_notifySwapBuffers(struct gl_context *gc);
-
-
-extern struct _glapi_table *
-_mesa_get_dispatch(struct gl_context *ctx);
-
-
-void
-_mesa_set_mvp_with_dp4( struct gl_context *ctx,
- GLboolean flag );
-
-
-extern GLboolean
-_mesa_valid_to_render(struct gl_context *ctx, const char *where);
-
-
-
-/** \name Miscellaneous */
-/*@{*/
-
-extern void
-_mesa_record_error( struct gl_context *ctx, GLenum error );
-
-
-extern void
-_mesa_finish(struct gl_context *ctx);
-
-extern void
-_mesa_flush(struct gl_context *ctx);
-
-
-extern void GLAPIENTRY
-_mesa_Finish( void );
-
-extern void GLAPIENTRY
-_mesa_Flush( void );
-
-/*@}*/
-
-
-/**
- * \name Macros for flushing buffered rendering commands before state changes,
- * checking if inside glBegin/glEnd, etc.
- */
-/*@{*/
-
-/**
- * Flush vertices.
- *
- * \param ctx GL context.
- * \param newstate new state.
- *
- * Checks if dd_function_table::NeedFlush is marked to flush stored vertices,
- * and calls dd_function_table::FlushVertices if so. Marks
- * __struct gl_contextRec::NewState with \p newstate.
- */
-#define FLUSH_VERTICES(ctx, newstate) \
-do { \
- if (MESA_VERBOSE & VERBOSE_STATE) \
- _mesa_debug(ctx, "FLUSH_VERTICES in %s\n", MESA_FUNCTION);\
- if (ctx->Driver.NeedFlush & FLUSH_STORED_VERTICES) \
- ctx->Driver.FlushVertices(ctx, FLUSH_STORED_VERTICES); \
- ctx->NewState |= newstate; \
-} while (0)
-
-/**
- * Flush current state.
- *
- * \param ctx GL context.
- * \param newstate new state.
- *
- * Checks if dd_function_table::NeedFlush is marked to flush current state,
- * and calls dd_function_table::FlushVertices if so. Marks
- * __struct gl_contextRec::NewState with \p newstate.
- */
-#define FLUSH_CURRENT(ctx, newstate) \
-do { \
- if (MESA_VERBOSE & VERBOSE_STATE) \
- _mesa_debug(ctx, "FLUSH_CURRENT in %s\n", MESA_FUNCTION); \
- if (ctx->Driver.NeedFlush & FLUSH_UPDATE_CURRENT) \
- ctx->Driver.FlushVertices(ctx, FLUSH_UPDATE_CURRENT); \
- ctx->NewState |= newstate; \
-} while (0)
-
-/**
- * Macro to assert that the API call was made outside the
- * glBegin()/glEnd() pair, with return value.
- *
- * \param ctx GL context.
- * \param retval value to return value in case the assertion fails.
- */
-#define ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, retval) \
-do { \
- if (ctx->Driver.CurrentExecPrimitive != PRIM_OUTSIDE_BEGIN_END) { \
- _mesa_error(ctx, GL_INVALID_OPERATION, "Inside glBegin/glEnd"); \
- return retval; \
- } \
-} while (0)
-
-/**
- * Macro to assert that the API call was made outside the
- * glBegin()/glEnd() pair.
- *
- * \param ctx GL context.
- */
-#define ASSERT_OUTSIDE_BEGIN_END(ctx) \
-do { \
- if (ctx->Driver.CurrentExecPrimitive != PRIM_OUTSIDE_BEGIN_END) { \
- _mesa_error(ctx, GL_INVALID_OPERATION, "Inside glBegin/glEnd"); \
- return; \
- } \
-} while (0)
-
-/**
- * Macro to assert that the API call was made outside the
- * glBegin()/glEnd() pair and flush the vertices.
- *
- * \param ctx GL context.
- */
-#define ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx) \
-do { \
- ASSERT_OUTSIDE_BEGIN_END(ctx); \
- FLUSH_VERTICES(ctx, 0); \
-} while (0)
-
-/**
- * Macro to assert that the API call was made outside the
- * glBegin()/glEnd() pair and flush the vertices, with return value.
- *
- * \param ctx GL context.
- * \param retval value to return value in case the assertion fails.
- */
-#define ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH_WITH_RETVAL(ctx, retval) \
-do { \
- ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, retval); \
- FLUSH_VERTICES(ctx, 0); \
-} while (0)
-
-/*@}*/
-
-
-
-#endif /* CONTEXT_H */
+/*
+ * Mesa 3-D graphics library
+ * Version: 6.5.1
+ *
+ * Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+
+/**
+ * \file context.h
+ * Mesa context and visual-related functions.
+ *
+ * There are three large Mesa data types/classes which are meant to be
+ * used by device drivers:
+ * - struct gl_context: this contains the Mesa rendering state
+ * - struct gl_config: this describes the color buffer (RGB vs. ci), whether
+ * or not there's a depth buffer, stencil buffer, etc.
+ * - struct gl_framebuffer: contains pointers to the depth buffer, stencil
+ * buffer, accum buffer and alpha buffers.
+ *
+ * These types should be encapsulated by corresponding device driver
+ * data types. See xmesa.h and xmesaP.h for an example.
+ *
+ * In OOP terms, struct gl_context, struct gl_config, and struct gl_framebuffer
+ * are base classes which the device driver must derive from.
+ *
+ * The following functions create and destroy these data types.
+ */
+
+
+#ifndef CONTEXT_H
+#define CONTEXT_H
+
+
+#include "imports.h"
+#include "mtypes.h"
+
+
+struct _glapi_table;
+
+
+/** \name Visual-related functions */
+/*@{*/
+
+extern struct gl_config *
+_mesa_create_visual( GLboolean dbFlag,
+ GLboolean stereoFlag,
+ GLint redBits,
+ GLint greenBits,
+ GLint blueBits,
+ GLint alphaBits,
+ GLint depthBits,
+ GLint stencilBits,
+ GLint accumRedBits,
+ GLint accumGreenBits,
+ GLint accumBlueBits,
+ GLint accumAlphaBits,
+ GLint numSamples );
+
+extern GLboolean
+_mesa_initialize_visual( struct gl_config *v,
+ GLboolean dbFlag,
+ GLboolean stereoFlag,
+ GLint redBits,
+ GLint greenBits,
+ GLint blueBits,
+ GLint alphaBits,
+ GLint depthBits,
+ GLint stencilBits,
+ GLint accumRedBits,
+ GLint accumGreenBits,
+ GLint accumBlueBits,
+ GLint accumAlphaBits,
+ GLint numSamples );
+
+extern void
+_mesa_destroy_visual( struct gl_config *vis );
+
+/*@}*/
+
+
+/** \name Context-related functions */
+/*@{*/
+
+extern GLboolean
+_mesa_initialize_context( struct gl_context *ctx,
+ gl_api api,
+ const struct gl_config *visual,
+ struct gl_context *share_list,
+ const struct dd_function_table *driverFunctions,
+ void *driverContext );
+
+extern struct gl_context *
+_mesa_create_context(gl_api api,
+ const struct gl_config *visual,
+ struct gl_context *share_list,
+ const struct dd_function_table *driverFunctions,
+ void *driverContext);
+
+extern void
+_mesa_free_context_data( struct gl_context *ctx );
+
+extern void
+_mesa_destroy_context( struct gl_context *ctx );
+
+
+extern void
+_mesa_copy_context(const struct gl_context *src, struct gl_context *dst, GLuint mask);
+
+
+extern void
+_mesa_check_init_viewport(struct gl_context *ctx, GLuint width, GLuint height);
+
+extern GLboolean
+_mesa_make_current( struct gl_context *ctx, struct gl_framebuffer *drawBuffer,
+ struct gl_framebuffer *readBuffer );
+
+extern GLboolean
+_mesa_share_state(struct gl_context *ctx, struct gl_context *ctxToShare);
+
+extern struct gl_context *
+_mesa_get_current_context(void);
+
+/*@}*/
+
+extern void
+_mesa_init_get_hash(struct gl_context *ctx);
+
+extern void
+_mesa_notifySwapBuffers(struct gl_context *gc);
+
+
+extern struct _glapi_table *
+_mesa_get_dispatch(struct gl_context *ctx);
+
+
+void
+_mesa_set_mvp_with_dp4( struct gl_context *ctx,
+ GLboolean flag );
+
+
+extern GLboolean
+_mesa_valid_to_render(struct gl_context *ctx, const char *where);
+
+
+
+/** \name Miscellaneous */
+/*@{*/
+
+extern void
+_mesa_record_error( struct gl_context *ctx, GLenum error );
+
+
+extern void
+_mesa_finish(struct gl_context *ctx);
+
+extern void
+_mesa_flush(struct gl_context *ctx);
+
+
+extern void GLAPIENTRY
+_mesa_Finish( void );
+
+extern void GLAPIENTRY
+_mesa_Flush( void );
+
+/*@}*/
+
+
+/**
+ * \name Macros for flushing buffered rendering commands before state changes,
+ * checking if inside glBegin/glEnd, etc.
+ */
+/*@{*/
+
+/**
+ * Flush vertices.
+ *
+ * \param ctx GL context.
+ * \param newstate new state.
+ *
+ * Checks if dd_function_table::NeedFlush is marked to flush stored vertices,
+ * and calls dd_function_table::FlushVertices if so. Marks
+ * __struct gl_contextRec::NewState with \p newstate.
+ */
+#define FLUSH_VERTICES(ctx, newstate) \
+do { \
+ if (MESA_VERBOSE & VERBOSE_STATE) \
+ _mesa_debug(ctx, "FLUSH_VERTICES in %s\n", MESA_FUNCTION);\
+ if (ctx->Driver.NeedFlush & FLUSH_STORED_VERTICES) \
+ ctx->Driver.FlushVertices(ctx, FLUSH_STORED_VERTICES); \
+ ctx->NewState |= newstate; \
+} while (0)
+
+/**
+ * Flush current state.
+ *
+ * \param ctx GL context.
+ * \param newstate new state.
+ *
+ * Checks if dd_function_table::NeedFlush is marked to flush current state,
+ * and calls dd_function_table::FlushVertices if so. Marks
+ * __struct gl_contextRec::NewState with \p newstate.
+ */
+#define FLUSH_CURRENT(ctx, newstate) \
+do { \
+ if (MESA_VERBOSE & VERBOSE_STATE) \
+ _mesa_debug(ctx, "FLUSH_CURRENT in %s\n", MESA_FUNCTION); \
+ if (ctx->Driver.NeedFlush & FLUSH_UPDATE_CURRENT) \
+ ctx->Driver.FlushVertices(ctx, FLUSH_UPDATE_CURRENT); \
+ ctx->NewState |= newstate; \
+} while (0)
+
+/**
+ * Macro to assert that the API call was made outside the
+ * glBegin()/glEnd() pair, with return value.
+ *
+ * \param ctx GL context.
+ * \param retval value to return value in case the assertion fails.
+ */
+#define ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, retval) \
+do { \
+ if (ctx->Driver.CurrentExecPrimitive != PRIM_OUTSIDE_BEGIN_END) { \
+ _mesa_error(ctx, GL_INVALID_OPERATION, "Inside glBegin/glEnd"); \
+ return retval; \
+ } \
+} while (0)
+
+/**
+ * Macro to assert that the API call was made outside the
+ * glBegin()/glEnd() pair.
+ *
+ * \param ctx GL context.
+ */
+#define ASSERT_OUTSIDE_BEGIN_END(ctx) \
+do { \
+ if (ctx->Driver.CurrentExecPrimitive != PRIM_OUTSIDE_BEGIN_END) { \
+ _mesa_error(ctx, GL_INVALID_OPERATION, "Inside glBegin/glEnd"); \
+ return; \
+ } \
+} while (0)
+
+/**
+ * Macro to assert that the API call was made outside the
+ * glBegin()/glEnd() pair and flush the vertices.
+ *
+ * \param ctx GL context.
+ */
+#define ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx) \
+do { \
+ ASSERT_OUTSIDE_BEGIN_END(ctx); \
+ FLUSH_VERTICES(ctx, 0); \
+} while (0)
+
+/**
+ * Macro to assert that the API call was made outside the
+ * glBegin()/glEnd() pair and flush the vertices, with return value.
+ *
+ * \param ctx GL context.
+ * \param retval value to return value in case the assertion fails.
+ */
+#define ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH_WITH_RETVAL(ctx, retval) \
+do { \
+ ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, retval); \
+ FLUSH_VERTICES(ctx, 0); \
+} while (0)
+
+/*@}*/
+
+
+
+#endif /* CONTEXT_H */
diff --git a/mesalib/src/mesa/main/convolve.c b/mesalib/src/mesa/main/convolve.c
index 74f28da87..104f71ff8 100644
--- a/mesalib/src/mesa/main/convolve.c
+++ b/mesalib/src/mesa/main/convolve.c
@@ -1,205 +1,205 @@
-/*
- * Mesa 3-D graphics library
- * Version: 6.5.2
- *
- * Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-
-/*
- * Image convolution functions.
- *
- * Notes: filter kernel elements are indexed by <n> and <m> as in
- * the GL spec.
- */
-
-
-#include "glheader.h"
-#include "bufferobj.h"
-#include "colormac.h"
-#include "convolve.h"
-#include "macros.h"
-#include "mfeatures.h"
-#include "mtypes.h"
-#include "main/dispatch.h"
-
-
-#if FEATURE_convolve
-
-static void GLAPIENTRY
-_mesa_ConvolutionFilter1D(GLenum target, GLenum internalFormat, GLsizei width, GLenum format, GLenum type, const GLvoid *image)
-{
- GET_CURRENT_CONTEXT(ctx);
-
- _mesa_error(ctx, GL_INVALID_ENUM, "glConvolutionFilter1D");
-}
-
-static void GLAPIENTRY
-_mesa_ConvolutionFilter2D(GLenum target, GLenum internalFormat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *image)
-{
- GET_CURRENT_CONTEXT(ctx);
-
- _mesa_error(ctx, GL_INVALID_ENUM, "glConvolutionFilter2D");
-}
-
-
-static void GLAPIENTRY
-_mesa_ConvolutionParameterf(GLenum target, GLenum pname, GLfloat param)
-{
- GET_CURRENT_CONTEXT(ctx);
-
- _mesa_error(ctx, GL_INVALID_ENUM, "glConvolutionParameterf");
-}
-
-
-static void GLAPIENTRY
-_mesa_ConvolutionParameterfv(GLenum target, GLenum pname, const GLfloat *params)
-{
- GET_CURRENT_CONTEXT(ctx);
-
- _mesa_error(ctx, GL_INVALID_ENUM, "glConvolutionParameterfv");
-}
-
-
-static void GLAPIENTRY
-_mesa_ConvolutionParameteri(GLenum target, GLenum pname, GLint param)
-{
- GET_CURRENT_CONTEXT(ctx);
-
- _mesa_error(ctx, GL_INVALID_ENUM, "glConvolutionParameteri");
-}
-
-
-static void GLAPIENTRY
-_mesa_ConvolutionParameteriv(GLenum target, GLenum pname, const GLint *params)
-{
- GET_CURRENT_CONTEXT(ctx);
-
- _mesa_error(ctx, GL_INVALID_ENUM, "glConvolutionParameteriv");
-}
-
-
-static void GLAPIENTRY
-_mesa_CopyConvolutionFilter1D(GLenum target, GLenum internalFormat, GLint x, GLint y, GLsizei width)
-{
- GET_CURRENT_CONTEXT(ctx);
-
- _mesa_error(ctx, GL_INVALID_ENUM, "glCopyConvolutionFilter1D");
-}
-
-
-static void GLAPIENTRY
-_mesa_CopyConvolutionFilter2D(GLenum target, GLenum internalFormat, GLint x, GLint y, GLsizei width, GLsizei height)
-{
- GET_CURRENT_CONTEXT(ctx);
-
- _mesa_error(ctx, GL_INVALID_ENUM, "glCopyConvolutionFilter2D");
-}
-
-
-static void GLAPIENTRY
-_mesa_GetnConvolutionFilterARB(GLenum target, GLenum format, GLenum type,
- GLsizei bufSize, GLvoid *image)
-{
- GET_CURRENT_CONTEXT(ctx);
-
- _mesa_error(ctx, GL_INVALID_OPERATION, "glGetConvolutionFilter");
-}
-
-
-static void GLAPIENTRY
-_mesa_GetConvolutionFilter(GLenum target, GLenum format, GLenum type,
- GLvoid *image)
-{
- _mesa_GetnConvolutionFilterARB(target, format, type, INT_MAX, image);
-}
-
-
-static void GLAPIENTRY
-_mesa_GetConvolutionParameterfv(GLenum target, GLenum pname, GLfloat *params)
-{
- GET_CURRENT_CONTEXT(ctx);
-
- _mesa_error(ctx, GL_INVALID_ENUM, "glGetConvolutionParameterfv");
-}
-
-
-static void GLAPIENTRY
-_mesa_GetConvolutionParameteriv(GLenum target, GLenum pname, GLint *params)
-{
- GET_CURRENT_CONTEXT(ctx);
-
- _mesa_error(ctx, GL_INVALID_ENUM, "glGetConvolutionParameteriv");
-}
-
-
-static void GLAPIENTRY
-_mesa_GetnSeparableFilterARB(GLenum target, GLenum format, GLenum type,
- GLsizei rowBufSize, GLvoid *row,
- GLsizei columnBufSize, GLvoid *column,
- GLvoid *span)
-{
- GET_CURRENT_CONTEXT(ctx);
-
- _mesa_error(ctx, GL_INVALID_ENUM, "glGetSeparableFilter");
-}
-
-
-static void GLAPIENTRY
-_mesa_GetSeparableFilter(GLenum target, GLenum format, GLenum type,
- GLvoid *row, GLvoid *column, GLvoid *span)
-{
- _mesa_GetnSeparableFilterARB(target, format, type, INT_MAX, row,
- INT_MAX, column, span);
-}
-
-
-static void GLAPIENTRY
-_mesa_SeparableFilter2D(GLenum target, GLenum internalFormat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *row, const GLvoid *column)
-{
- GET_CURRENT_CONTEXT(ctx);
-
- _mesa_error(ctx, GL_INVALID_ENUM, "glSeparableFilter2D");
-}
-
-void
-_mesa_init_convolve_dispatch(struct _glapi_table *disp)
-{
- SET_ConvolutionFilter1D(disp, _mesa_ConvolutionFilter1D);
- SET_ConvolutionFilter2D(disp, _mesa_ConvolutionFilter2D);
- SET_ConvolutionParameterf(disp, _mesa_ConvolutionParameterf);
- SET_ConvolutionParameterfv(disp, _mesa_ConvolutionParameterfv);
- SET_ConvolutionParameteri(disp, _mesa_ConvolutionParameteri);
- SET_ConvolutionParameteriv(disp, _mesa_ConvolutionParameteriv);
- SET_CopyConvolutionFilter1D(disp, _mesa_CopyConvolutionFilter1D);
- SET_CopyConvolutionFilter2D(disp, _mesa_CopyConvolutionFilter2D);
- SET_GetConvolutionFilter(disp, _mesa_GetConvolutionFilter);
- SET_GetConvolutionParameterfv(disp, _mesa_GetConvolutionParameterfv);
- SET_GetConvolutionParameteriv(disp, _mesa_GetConvolutionParameteriv);
- SET_SeparableFilter2D(disp, _mesa_SeparableFilter2D);
- SET_GetSeparableFilter(disp, _mesa_GetSeparableFilter);
-
- /* GL_ARB_robustness */
- SET_GetnConvolutionFilterARB(disp, _mesa_GetnConvolutionFilterARB);
- SET_GetnSeparableFilterARB(disp, _mesa_GetnSeparableFilterARB);
-}
-
-
-#endif /* FEATURE_convolve */
+/*
+ * Mesa 3-D graphics library
+ * Version: 6.5.2
+ *
+ * Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+
+/*
+ * Image convolution functions.
+ *
+ * Notes: filter kernel elements are indexed by <n> and <m> as in
+ * the GL spec.
+ */
+
+
+#include "glheader.h"
+#include "bufferobj.h"
+#include "colormac.h"
+#include "convolve.h"
+#include "macros.h"
+#include "mfeatures.h"
+#include "mtypes.h"
+#include "main/dispatch.h"
+
+
+#if FEATURE_convolve
+
+static void GLAPIENTRY
+_mesa_ConvolutionFilter1D(GLenum target, GLenum internalFormat, GLsizei width, GLenum format, GLenum type, const GLvoid *image)
+{
+ GET_CURRENT_CONTEXT(ctx);
+
+ _mesa_error(ctx, GL_INVALID_ENUM, "glConvolutionFilter1D");
+}
+
+static void GLAPIENTRY
+_mesa_ConvolutionFilter2D(GLenum target, GLenum internalFormat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *image)
+{
+ GET_CURRENT_CONTEXT(ctx);
+
+ _mesa_error(ctx, GL_INVALID_ENUM, "glConvolutionFilter2D");
+}
+
+
+static void GLAPIENTRY
+_mesa_ConvolutionParameterf(GLenum target, GLenum pname, GLfloat param)
+{
+ GET_CURRENT_CONTEXT(ctx);
+
+ _mesa_error(ctx, GL_INVALID_ENUM, "glConvolutionParameterf");
+}
+
+
+static void GLAPIENTRY
+_mesa_ConvolutionParameterfv(GLenum target, GLenum pname, const GLfloat *params)
+{
+ GET_CURRENT_CONTEXT(ctx);
+
+ _mesa_error(ctx, GL_INVALID_ENUM, "glConvolutionParameterfv");
+}
+
+
+static void GLAPIENTRY
+_mesa_ConvolutionParameteri(GLenum target, GLenum pname, GLint param)
+{
+ GET_CURRENT_CONTEXT(ctx);
+
+ _mesa_error(ctx, GL_INVALID_ENUM, "glConvolutionParameteri");
+}
+
+
+static void GLAPIENTRY
+_mesa_ConvolutionParameteriv(GLenum target, GLenum pname, const GLint *params)
+{
+ GET_CURRENT_CONTEXT(ctx);
+
+ _mesa_error(ctx, GL_INVALID_ENUM, "glConvolutionParameteriv");
+}
+
+
+static void GLAPIENTRY
+_mesa_CopyConvolutionFilter1D(GLenum target, GLenum internalFormat, GLint x, GLint y, GLsizei width)
+{
+ GET_CURRENT_CONTEXT(ctx);
+
+ _mesa_error(ctx, GL_INVALID_ENUM, "glCopyConvolutionFilter1D");
+}
+
+
+static void GLAPIENTRY
+_mesa_CopyConvolutionFilter2D(GLenum target, GLenum internalFormat, GLint x, GLint y, GLsizei width, GLsizei height)
+{
+ GET_CURRENT_CONTEXT(ctx);
+
+ _mesa_error(ctx, GL_INVALID_ENUM, "glCopyConvolutionFilter2D");
+}
+
+
+static void GLAPIENTRY
+_mesa_GetnConvolutionFilterARB(GLenum target, GLenum format, GLenum type,
+ GLsizei bufSize, GLvoid *image)
+{
+ GET_CURRENT_CONTEXT(ctx);
+
+ _mesa_error(ctx, GL_INVALID_OPERATION, "glGetConvolutionFilter");
+}
+
+
+static void GLAPIENTRY
+_mesa_GetConvolutionFilter(GLenum target, GLenum format, GLenum type,
+ GLvoid *image)
+{
+ _mesa_GetnConvolutionFilterARB(target, format, type, INT_MAX, image);
+}
+
+
+static void GLAPIENTRY
+_mesa_GetConvolutionParameterfv(GLenum target, GLenum pname, GLfloat *params)
+{
+ GET_CURRENT_CONTEXT(ctx);
+
+ _mesa_error(ctx, GL_INVALID_ENUM, "glGetConvolutionParameterfv");
+}
+
+
+static void GLAPIENTRY
+_mesa_GetConvolutionParameteriv(GLenum target, GLenum pname, GLint *params)
+{
+ GET_CURRENT_CONTEXT(ctx);
+
+ _mesa_error(ctx, GL_INVALID_ENUM, "glGetConvolutionParameteriv");
+}
+
+
+static void GLAPIENTRY
+_mesa_GetnSeparableFilterARB(GLenum target, GLenum format, GLenum type,
+ GLsizei rowBufSize, GLvoid *row,
+ GLsizei columnBufSize, GLvoid *column,
+ GLvoid *span)
+{
+ GET_CURRENT_CONTEXT(ctx);
+
+ _mesa_error(ctx, GL_INVALID_ENUM, "glGetSeparableFilter");
+}
+
+
+static void GLAPIENTRY
+_mesa_GetSeparableFilter(GLenum target, GLenum format, GLenum type,
+ GLvoid *row, GLvoid *column, GLvoid *span)
+{
+ _mesa_GetnSeparableFilterARB(target, format, type, INT_MAX, row,
+ INT_MAX, column, span);
+}
+
+
+static void GLAPIENTRY
+_mesa_SeparableFilter2D(GLenum target, GLenum internalFormat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *row, const GLvoid *column)
+{
+ GET_CURRENT_CONTEXT(ctx);
+
+ _mesa_error(ctx, GL_INVALID_ENUM, "glSeparableFilter2D");
+}
+
+void
+_mesa_init_convolve_dispatch(struct _glapi_table *disp)
+{
+ SET_ConvolutionFilter1D(disp, _mesa_ConvolutionFilter1D);
+ SET_ConvolutionFilter2D(disp, _mesa_ConvolutionFilter2D);
+ SET_ConvolutionParameterf(disp, _mesa_ConvolutionParameterf);
+ SET_ConvolutionParameterfv(disp, _mesa_ConvolutionParameterfv);
+ SET_ConvolutionParameteri(disp, _mesa_ConvolutionParameteri);
+ SET_ConvolutionParameteriv(disp, _mesa_ConvolutionParameteriv);
+ SET_CopyConvolutionFilter1D(disp, _mesa_CopyConvolutionFilter1D);
+ SET_CopyConvolutionFilter2D(disp, _mesa_CopyConvolutionFilter2D);
+ SET_GetConvolutionFilter(disp, _mesa_GetConvolutionFilter);
+ SET_GetConvolutionParameterfv(disp, _mesa_GetConvolutionParameterfv);
+ SET_GetConvolutionParameteriv(disp, _mesa_GetConvolutionParameteriv);
+ SET_SeparableFilter2D(disp, _mesa_SeparableFilter2D);
+ SET_GetSeparableFilter(disp, _mesa_GetSeparableFilter);
+
+ /* GL_ARB_robustness */
+ SET_GetnConvolutionFilterARB(disp, _mesa_GetnConvolutionFilterARB);
+ SET_GetnSeparableFilterARB(disp, _mesa_GetnSeparableFilterARB);
+}
+
+
+#endif /* FEATURE_convolve */
diff --git a/mesalib/src/mesa/main/dd.h b/mesalib/src/mesa/main/dd.h
index d749b245e..cd8c8cf3f 100644
--- a/mesalib/src/mesa/main/dd.h
+++ b/mesalib/src/mesa/main/dd.h
@@ -1,1200 +1,1200 @@
-/**
- * \file dd.h
- * Device driver interfaces.
- */
-
-/*
- * Mesa 3-D graphics library
- * Version: 6.5.2
- *
- * Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-
-#ifndef DD_INCLUDED
-#define DD_INCLUDED
-
-/* THIS FILE ONLY INCLUDED BY mtypes.h !!!!! */
-
-#include "glheader.h"
-
-struct gl_buffer_object;
-struct gl_context;
-struct gl_display_list;
-struct gl_framebuffer;
-struct gl_pixelstore_attrib;
-struct gl_program;
-struct gl_renderbuffer;
-struct gl_renderbuffer_attachment;
-struct gl_shader;
-struct gl_shader_program;
-struct gl_texture_image;
-struct gl_texture_object;
-
-/* GL_ARB_vertex_buffer_object */
-/* Modifies GL_MAP_UNSYNCHRONIZED_BIT to allow driver to fail (return
- * NULL) if buffer is unavailable for immediate mapping.
- *
- * Does GL_MAP_INVALIDATE_RANGE_BIT do this? It seems so, but it
- * would require more book-keeping in the driver than seems necessary
- * at this point.
- *
- * Does GL_MAP_INVALDIATE_BUFFER_BIT do this? Not really -- we don't
- * want to provoke the driver to throw away the old storage, we will
- * respect the contents of already referenced data.
- */
-#define MESA_MAP_NOWAIT_BIT 0x0040
-
-
-/**
- * Device driver function table.
- * Core Mesa uses these function pointers to call into device drivers.
- * Most of these functions directly correspond to OpenGL state commands.
- * Core Mesa will call these functions after error checking has been done
- * so that the drivers don't have to worry about error testing.
- *
- * Vertex transformation/clipping/lighting is patched into the T&L module.
- * Rasterization functions are patched into the swrast module.
- *
- * Note: when new functions are added here, the drivers/common/driverfuncs.c
- * file should be updated too!!!
- */
-struct dd_function_table {
- /**
- * Return a string as needed by glGetString().
- * Only the GL_RENDERER query must be implemented. Otherwise, NULL can be
- * returned.
- */
- const GLubyte * (*GetString)( struct gl_context *ctx, GLenum name );
-
- /**
- * Notify the driver after Mesa has made some internal state changes.
- *
- * This is in addition to any state change callbacks Mesa may already have
- * made.
- */
- void (*UpdateState)( struct gl_context *ctx, GLbitfield new_state );
-
- /**
- * Get the width and height of the named buffer/window.
- *
- * Mesa uses this to determine when the driver's window size has changed.
- * XXX OBSOLETE: this function will be removed in the future.
- */
- void (*GetBufferSize)( struct gl_framebuffer *buffer,
- GLuint *width, GLuint *height );
-
- /**
- * Resize the given framebuffer to the given size.
- * XXX OBSOLETE: this function will be removed in the future.
- */
- void (*ResizeBuffers)( struct gl_context *ctx, struct gl_framebuffer *fb,
- GLuint width, GLuint height);
-
- /**
- * Called whenever an error is generated.
- * __struct gl_contextRec::ErrorValue contains the error value.
- */
- void (*Error)( struct gl_context *ctx );
-
- /**
- * This is called whenever glFinish() is called.
- */
- void (*Finish)( struct gl_context *ctx );
-
- /**
- * This is called whenever glFlush() is called.
- */
- void (*Flush)( struct gl_context *ctx );
-
- /**
- * Clear the color/depth/stencil/accum buffer(s).
- * \param buffers a bitmask of BUFFER_BIT_* flags indicating which
- * renderbuffers need to be cleared.
- */
- void (*Clear)( struct gl_context *ctx, GLbitfield buffers );
-
- /**
- * Execute glAccum command.
- */
- void (*Accum)( struct gl_context *ctx, GLenum op, GLfloat value );
-
-
- /**
- * Execute glRasterPos, updating the ctx->Current.Raster fields
- */
- void (*RasterPos)( struct gl_context *ctx, const GLfloat v[4] );
-
- /**
- * \name Image-related functions
- */
- /*@{*/
-
- /**
- * Called by glDrawPixels().
- * \p unpack describes how to unpack the source image data.
- */
- void (*DrawPixels)( struct gl_context *ctx,
- GLint x, GLint y, GLsizei width, GLsizei height,
- GLenum format, GLenum type,
- const struct gl_pixelstore_attrib *unpack,
- const GLvoid *pixels );
-
- /**
- * Called by glReadPixels().
- */
- void (*ReadPixels)( struct gl_context *ctx,
- GLint x, GLint y, GLsizei width, GLsizei height,
- GLenum format, GLenum type,
- const struct gl_pixelstore_attrib *unpack,
- GLvoid *dest );
-
- /**
- * Called by glCopyPixels().
- */
- void (*CopyPixels)( struct gl_context *ctx, GLint srcx, GLint srcy,
- GLsizei width, GLsizei height,
- GLint dstx, GLint dsty, GLenum type );
-
- /**
- * Called by glBitmap().
- */
- void (*Bitmap)( struct gl_context *ctx,
- GLint x, GLint y, GLsizei width, GLsizei height,
- const struct gl_pixelstore_attrib *unpack,
- const GLubyte *bitmap );
- /*@}*/
-
-
- /**
- * \name Texture image functions
- */
- /*@{*/
-
- /**
- * Choose texture format.
- *
- * This is called by the \c _mesa_store_tex[sub]image[123]d() fallback
- * functions. The driver should examine \p internalFormat and return a
- * gl_format value.
- */
- GLuint (*ChooseTextureFormat)( struct gl_context *ctx, GLint internalFormat,
- GLenum srcFormat, GLenum srcType );
-
- /**
- * Called by glTexImage1D().
- *
- * \param target user specified.
- * \param format user specified.
- * \param type user specified.
- * \param pixels user specified.
- * \param packing indicates the image packing of pixels.
- * \param texObj is the target texture object.
- * \param texImage is the target texture image. It will have the texture \p
- * width, \p height, \p depth, \p border and \p internalFormat information.
- *
- * \p retainInternalCopy is returned by this function and indicates whether
- * core Mesa should keep an internal copy of the texture image.
- *
- * Drivers should call a fallback routine from texstore.c if needed.
- */
- void (*TexImage1D)( struct gl_context *ctx, GLenum target, GLint level,
- GLint internalFormat,
- GLint width, GLint border,
- GLenum format, GLenum type, const GLvoid *pixels,
- const struct gl_pixelstore_attrib *packing,
- struct gl_texture_object *texObj,
- struct gl_texture_image *texImage );
-
- /**
- * Called by glTexImage2D().
- *
- * \sa dd_function_table::TexImage1D.
- */
- void (*TexImage2D)( struct gl_context *ctx, GLenum target, GLint level,
- GLint internalFormat,
- GLint width, GLint height, GLint border,
- GLenum format, GLenum type, const GLvoid *pixels,
- const struct gl_pixelstore_attrib *packing,
- struct gl_texture_object *texObj,
- struct gl_texture_image *texImage );
-
- /**
- * Called by glTexImage3D().
- *
- * \sa dd_function_table::TexImage1D.
- */
- void (*TexImage3D)( struct gl_context *ctx, GLenum target, GLint level,
- GLint internalFormat,
- GLint width, GLint height, GLint depth, GLint border,
- GLenum format, GLenum type, const GLvoid *pixels,
- const struct gl_pixelstore_attrib *packing,
- struct gl_texture_object *texObj,
- struct gl_texture_image *texImage );
-
- /**
- * Called by glTexSubImage1D().
- *
- * \param target user specified.
- * \param level user specified.
- * \param xoffset user specified.
- * \param yoffset user specified.
- * \param zoffset user specified.
- * \param width user specified.
- * \param height user specified.
- * \param depth user specified.
- * \param format user specified.
- * \param type user specified.
- * \param pixels user specified.
- * \param packing indicates the image packing of pixels.
- * \param texObj is the target texture object.
- * \param texImage is the target texture image. It will have the texture \p
- * width, \p height, \p border and \p internalFormat information.
- *
- * The driver should use a fallback routine from texstore.c if needed.
- */
- void (*TexSubImage1D)( struct gl_context *ctx, GLenum target, GLint level,
- GLint xoffset, GLsizei width,
- GLenum format, GLenum type,
- const GLvoid *pixels,
- const struct gl_pixelstore_attrib *packing,
- struct gl_texture_object *texObj,
- struct gl_texture_image *texImage );
-
- /**
- * Called by glTexSubImage2D().
- *
- * \sa dd_function_table::TexSubImage1D.
- */
- void (*TexSubImage2D)( struct gl_context *ctx, GLenum target, GLint level,
- GLint xoffset, GLint yoffset,
- GLsizei width, GLsizei height,
- GLenum format, GLenum type,
- const GLvoid *pixels,
- const struct gl_pixelstore_attrib *packing,
- struct gl_texture_object *texObj,
- struct gl_texture_image *texImage );
-
- /**
- * Called by glTexSubImage3D().
- *
- * \sa dd_function_table::TexSubImage1D.
- */
- void (*TexSubImage3D)( struct gl_context *ctx, GLenum target, GLint level,
- GLint xoffset, GLint yoffset, GLint zoffset,
- GLsizei width, GLsizei height, GLint depth,
- GLenum format, GLenum type,
- const GLvoid *pixels,
- const struct gl_pixelstore_attrib *packing,
- struct gl_texture_object *texObj,
- struct gl_texture_image *texImage );
-
- /**
- * Called by glGetTexImage().
- */
- void (*GetTexImage)( struct gl_context *ctx, GLenum target, GLint level,
- GLenum format, GLenum type, GLvoid *pixels,
- struct gl_texture_object *texObj,
- struct gl_texture_image *texImage );
-
- /**
- * Called by glCopyTexImage1D().
- *
- * Drivers should use a fallback routine from texstore.c if needed.
- */
- void (*CopyTexImage1D)( struct gl_context *ctx, GLenum target, GLint level,
- GLenum internalFormat, GLint x, GLint y,
- GLsizei width, GLint border );
-
- /**
- * Called by glCopyTexImage2D().
- *
- * Drivers should use a fallback routine from texstore.c if needed.
- */
- void (*CopyTexImage2D)( struct gl_context *ctx, GLenum target, GLint level,
- GLenum internalFormat, GLint x, GLint y,
- GLsizei width, GLsizei height, GLint border );
-
- /**
- * Called by glCopyTexSubImage1D().
- *
- * Drivers should use a fallback routine from texstore.c if needed.
- */
- void (*CopyTexSubImage1D)( struct gl_context *ctx, GLenum target, GLint level,
- GLint xoffset,
- GLint x, GLint y, GLsizei width );
- /**
- * Called by glCopyTexSubImage2D().
- *
- * Drivers should use a fallback routine from texstore.c if needed.
- */
- void (*CopyTexSubImage2D)( struct gl_context *ctx, GLenum target, GLint level,
- GLint xoffset, GLint yoffset,
- GLint x, GLint y,
- GLsizei width, GLsizei height );
- /**
- * Called by glCopyTexSubImage3D().
- *
- * Drivers should use a fallback routine from texstore.c if needed.
- */
- void (*CopyTexSubImage3D)( struct gl_context *ctx, GLenum target, GLint level,
- GLint xoffset, GLint yoffset, GLint zoffset,
- GLint x, GLint y,
- GLsizei width, GLsizei height );
-
- /**
- * Called by glGenerateMipmap() or when GL_GENERATE_MIPMAP_SGIS is enabled.
- */
- void (*GenerateMipmap)(struct gl_context *ctx, GLenum target,
- struct gl_texture_object *texObj);
-
- /**
- * Called by glTexImage[123]D when user specifies a proxy texture
- * target.
- *
- * \return GL_TRUE if the proxy test passes, or GL_FALSE if the test fails.
- */
- GLboolean (*TestProxyTexImage)(struct gl_context *ctx, GLenum target,
- GLint level, GLint internalFormat,
- GLenum format, GLenum type,
- GLint width, GLint height,
- GLint depth, GLint border);
- /*@}*/
-
-
- /**
- * \name Compressed texture functions
- */
- /*@{*/
-
- /**
- * Called by glCompressedTexImage1D().
- *
- * \param target user specified.
- * \param format user specified.
- * \param type user specified.
- * \param pixels user specified.
- * \param packing indicates the image packing of pixels.
- * \param texObj is the target texture object.
- * \param texImage is the target texture image. It will have the texture \p
- * width, \p height, \p depth, \p border and \p internalFormat information.
- *
- * \a retainInternalCopy is returned by this function and indicates whether
- * core Mesa should keep an internal copy of the texture image.
- */
- void (*CompressedTexImage1D)( struct gl_context *ctx, GLenum target,
- GLint level, GLint internalFormat,
- GLsizei width, GLint border,
- GLsizei imageSize, const GLvoid *data,
- struct gl_texture_object *texObj,
- struct gl_texture_image *texImage );
- /**
- * Called by glCompressedTexImage2D().
- *
- * \sa dd_function_table::CompressedTexImage1D.
- */
- void (*CompressedTexImage2D)( struct gl_context *ctx, GLenum target,
- GLint level, GLint internalFormat,
- GLsizei width, GLsizei height, GLint border,
- GLsizei imageSize, const GLvoid *data,
- struct gl_texture_object *texObj,
- struct gl_texture_image *texImage );
- /**
- * Called by glCompressedTexImage3D().
- *
- * \sa dd_function_table::CompressedTexImage3D.
- */
- void (*CompressedTexImage3D)( struct gl_context *ctx, GLenum target,
- GLint level, GLint internalFormat,
- GLsizei width, GLsizei height, GLsizei depth,
- GLint border,
- GLsizei imageSize, const GLvoid *data,
- struct gl_texture_object *texObj,
- struct gl_texture_image *texImage );
-
- /**
- * Called by glCompressedTexSubImage1D().
- *
- * \param target user specified.
- * \param level user specified.
- * \param xoffset user specified.
- * \param yoffset user specified.
- * \param zoffset user specified.
- * \param width user specified.
- * \param height user specified.
- * \param depth user specified.
- * \param imageSize user specified.
- * \param data user specified.
- * \param texObj is the target texture object.
- * \param texImage is the target texture image. It will have the texture \p
- * width, \p height, \p depth, \p border and \p internalFormat information.
- */
- void (*CompressedTexSubImage1D)(struct gl_context *ctx, GLenum target, GLint level,
- GLint xoffset, GLsizei width,
- GLenum format,
- GLsizei imageSize, const GLvoid *data,
- struct gl_texture_object *texObj,
- struct gl_texture_image *texImage);
- /**
- * Called by glCompressedTexSubImage2D().
- *
- * \sa dd_function_table::CompressedTexImage3D.
- */
- void (*CompressedTexSubImage2D)(struct gl_context *ctx, GLenum target, GLint level,
- GLint xoffset, GLint yoffset,
- GLsizei width, GLint height,
- GLenum format,
- GLsizei imageSize, const GLvoid *data,
- struct gl_texture_object *texObj,
- struct gl_texture_image *texImage);
- /**
- * Called by glCompressedTexSubImage3D().
- *
- * \sa dd_function_table::CompressedTexImage3D.
- */
- void (*CompressedTexSubImage3D)(struct gl_context *ctx, GLenum target, GLint level,
- GLint xoffset, GLint yoffset, GLint zoffset,
- GLsizei width, GLint height, GLint depth,
- GLenum format,
- GLsizei imageSize, const GLvoid *data,
- struct gl_texture_object *texObj,
- struct gl_texture_image *texImage);
-
-
- /**
- * Called by glGetCompressedTexImage.
- */
- void (*GetCompressedTexImage)(struct gl_context *ctx, GLenum target, GLint level,
- GLvoid *img,
- struct gl_texture_object *texObj,
- struct gl_texture_image *texImage);
-
- /*@}*/
-
- /**
- * \name Texture object functions
- */
- /*@{*/
-
- /**
- * Called by glBindTexture().
- */
- void (*BindTexture)( struct gl_context *ctx, GLenum target,
- struct gl_texture_object *tObj );
-
- /**
- * Called to allocate a new texture object.
- * A new gl_texture_object should be returned. The driver should
- * attach to it any device-specific info it needs.
- */
- struct gl_texture_object * (*NewTextureObject)( struct gl_context *ctx, GLuint name,
- GLenum target );
- /**
- * Called when a texture object is about to be deallocated.
- *
- * Driver should delete the gl_texture_object object and anything
- * hanging off of it.
- */
- void (*DeleteTexture)( struct gl_context *ctx, struct gl_texture_object *tObj );
-
- /**
- * Called to allocate a new texture image object.
- */
- struct gl_texture_image * (*NewTextureImage)( struct gl_context *ctx );
-
- /**
- * Called to free tImage->Data.
- */
- void (*FreeTexImageData)( struct gl_context *ctx, struct gl_texture_image *tImage );
-
- /** Map texture image data into user space */
- void (*MapTexture)( struct gl_context *ctx, struct gl_texture_object *tObj );
- /** Unmap texture images from user space */
- void (*UnmapTexture)( struct gl_context *ctx, struct gl_texture_object *tObj );
-
- /**
- * Note: no context argument. This function doesn't initially look
- * like it belongs here, except that the driver is the only entity
- * that knows for sure how the texture memory is allocated - via
- * the above callbacks. There is then an argument that the driver
- * knows what memcpy paths might be fast. Typically this is invoked with
- *
- * to -- a pointer into texture memory allocated by NewTextureImage() above.
- * from -- a pointer into client memory or a mesa temporary.
- * sz -- nr bytes to copy.
- */
- void* (*TextureMemCpy)( void *to, const void *from, size_t sz );
-
- /**
- * Called by glAreTextureResident().
- */
- GLboolean (*IsTextureResident)( struct gl_context *ctx,
- struct gl_texture_object *t );
-
- /**
- * Called when the texture's color lookup table is changed.
- *
- * If \p tObj is NULL then the shared texture palette
- * gl_texture_object::Palette is to be updated.
- */
- void (*UpdateTexturePalette)( struct gl_context *ctx,
- struct gl_texture_object *tObj );
- /*@}*/
-
-
- /**
- * \name Imaging functionality
- */
- /*@{*/
- void (*CopyColorTable)( struct gl_context *ctx,
- GLenum target, GLenum internalformat,
- GLint x, GLint y, GLsizei width );
-
- void (*CopyColorSubTable)( struct gl_context *ctx,
- GLenum target, GLsizei start,
- GLint x, GLint y, GLsizei width );
- /*@}*/
-
-
- /**
- * \name Vertex/fragment program functions
- */
- /*@{*/
- /** Bind a vertex/fragment program */
- void (*BindProgram)(struct gl_context *ctx, GLenum target, struct gl_program *prog);
- /** Allocate a new program */
- struct gl_program * (*NewProgram)(struct gl_context *ctx, GLenum target, GLuint id);
- /** Delete a program */
- void (*DeleteProgram)(struct gl_context *ctx, struct gl_program *prog);
- /**
- * Notify driver that a program string (and GPU code) has been specified
- * or modified. Return GL_TRUE or GL_FALSE to indicate if the program is
- * supported by the driver.
- */
- GLboolean (*ProgramStringNotify)(struct gl_context *ctx, GLenum target,
- struct gl_program *prog);
-
- /** Query if program can be loaded onto hardware */
- GLboolean (*IsProgramNative)(struct gl_context *ctx, GLenum target,
- struct gl_program *prog);
-
- /*@}*/
-
- /**
- * \name GLSL shader/program functions.
- */
- /*@{*/
- /**
- * Called when a shader program is linked.
- *
- * This gives drivers an opportunity to clone the IR and make their
- * own transformations on it for the purposes of code generation.
- */
- GLboolean (*LinkShader)(struct gl_context *ctx, struct gl_shader_program *shader);
- /*@}*/
-
- /**
- * \name State-changing functions.
- *
- * \note drawing functions are above.
- *
- * These functions are called by their corresponding OpenGL API functions.
- * They are \e also called by the gl_PopAttrib() function!!!
- * May add more functions like these to the device driver in the future.
- */
- /*@{*/
- /** Specify the alpha test function */
- void (*AlphaFunc)(struct gl_context *ctx, GLenum func, GLfloat ref);
- /** Set the blend color */
- void (*BlendColor)(struct gl_context *ctx, const GLfloat color[4]);
- /** Set the blend equation */
- void (*BlendEquationSeparate)(struct gl_context *ctx, GLenum modeRGB, GLenum modeA);
- void (*BlendEquationSeparatei)(struct gl_context *ctx, GLuint buffer,
- GLenum modeRGB, GLenum modeA);
- /** Specify pixel arithmetic */
- void (*BlendFuncSeparate)(struct gl_context *ctx,
- GLenum sfactorRGB, GLenum dfactorRGB,
- GLenum sfactorA, GLenum dfactorA);
- void (*BlendFuncSeparatei)(struct gl_context *ctx, GLuint buffer,
- GLenum sfactorRGB, GLenum dfactorRGB,
- GLenum sfactorA, GLenum dfactorA);
- /** Specify clear values for the color buffers */
- void (*ClearColor)(struct gl_context *ctx, const GLfloat color[4]);
- /** Specify the clear value for the depth buffer */
- void (*ClearDepth)(struct gl_context *ctx, GLclampd d);
- /** Specify the clear value for the stencil buffer */
- void (*ClearStencil)(struct gl_context *ctx, GLint s);
- /** Specify a plane against which all geometry is clipped */
- void (*ClipPlane)(struct gl_context *ctx, GLenum plane, const GLfloat *equation );
- /** Enable and disable writing of frame buffer color components */
- void (*ColorMask)(struct gl_context *ctx, GLboolean rmask, GLboolean gmask,
- GLboolean bmask, GLboolean amask );
- void (*ColorMaskIndexed)(struct gl_context *ctx, GLuint buf, GLboolean rmask,
- GLboolean gmask, GLboolean bmask, GLboolean amask);
- /** Cause a material color to track the current color */
- void (*ColorMaterial)(struct gl_context *ctx, GLenum face, GLenum mode);
- /** Specify whether front- or back-facing facets can be culled */
- void (*CullFace)(struct gl_context *ctx, GLenum mode);
- /** Define front- and back-facing polygons */
- void (*FrontFace)(struct gl_context *ctx, GLenum mode);
- /** Specify the value used for depth buffer comparisons */
- void (*DepthFunc)(struct gl_context *ctx, GLenum func);
- /** Enable or disable writing into the depth buffer */
- void (*DepthMask)(struct gl_context *ctx, GLboolean flag);
- /** Specify mapping of depth values from NDC to window coordinates */
- void (*DepthRange)(struct gl_context *ctx, GLclampd nearval, GLclampd farval);
- /** Specify the current buffer for writing */
- void (*DrawBuffer)( struct gl_context *ctx, GLenum buffer );
- /** Specify the buffers for writing for fragment programs*/
- void (*DrawBuffers)( struct gl_context *ctx, GLsizei n, const GLenum *buffers );
- /** Enable or disable server-side gl capabilities */
- void (*Enable)(struct gl_context *ctx, GLenum cap, GLboolean state);
- /** Specify fog parameters */
- void (*Fogfv)(struct gl_context *ctx, GLenum pname, const GLfloat *params);
- /** Specify implementation-specific hints */
- void (*Hint)(struct gl_context *ctx, GLenum target, GLenum mode);
- /** Set light source parameters.
- * Note: for GL_POSITION and GL_SPOT_DIRECTION, params will have already
- * been transformed to eye-space.
- */
- void (*Lightfv)(struct gl_context *ctx, GLenum light,
- GLenum pname, const GLfloat *params );
- /** Set the lighting model parameters */
- void (*LightModelfv)(struct gl_context *ctx, GLenum pname, const GLfloat *params);
- /** Specify the line stipple pattern */
- void (*LineStipple)(struct gl_context *ctx, GLint factor, GLushort pattern );
- /** Specify the width of rasterized lines */
- void (*LineWidth)(struct gl_context *ctx, GLfloat width);
- /** Specify a logical pixel operation for color index rendering */
- void (*LogicOpcode)(struct gl_context *ctx, GLenum opcode);
- void (*PointParameterfv)(struct gl_context *ctx, GLenum pname,
- const GLfloat *params);
- /** Specify the diameter of rasterized points */
- void (*PointSize)(struct gl_context *ctx, GLfloat size);
- /** Select a polygon rasterization mode */
- void (*PolygonMode)(struct gl_context *ctx, GLenum face, GLenum mode);
- /** Set the scale and units used to calculate depth values */
- void (*PolygonOffset)(struct gl_context *ctx, GLfloat factor, GLfloat units);
- /** Set the polygon stippling pattern */
- void (*PolygonStipple)(struct gl_context *ctx, const GLubyte *mask );
- /* Specifies the current buffer for reading */
- void (*ReadBuffer)( struct gl_context *ctx, GLenum buffer );
- /** Set rasterization mode */
- void (*RenderMode)(struct gl_context *ctx, GLenum mode );
- /** Define the scissor box */
- void (*Scissor)(struct gl_context *ctx, GLint x, GLint y, GLsizei w, GLsizei h);
- /** Select flat or smooth shading */
- void (*ShadeModel)(struct gl_context *ctx, GLenum mode);
- /** OpenGL 2.0 two-sided StencilFunc */
- void (*StencilFuncSeparate)(struct gl_context *ctx, GLenum face, GLenum func,
- GLint ref, GLuint mask);
- /** OpenGL 2.0 two-sided StencilMask */
- void (*StencilMaskSeparate)(struct gl_context *ctx, GLenum face, GLuint mask);
- /** OpenGL 2.0 two-sided StencilOp */
- void (*StencilOpSeparate)(struct gl_context *ctx, GLenum face, GLenum fail,
- GLenum zfail, GLenum zpass);
- /** Control the generation of texture coordinates */
- void (*TexGen)(struct gl_context *ctx, GLenum coord, GLenum pname,
- const GLfloat *params);
- /** Set texture environment parameters */
- void (*TexEnv)(struct gl_context *ctx, GLenum target, GLenum pname,
- const GLfloat *param);
- /** Set texture parameters */
- void (*TexParameter)(struct gl_context *ctx, GLenum target,
- struct gl_texture_object *texObj,
- GLenum pname, const GLfloat *params);
- /** Set the viewport */
- void (*Viewport)(struct gl_context *ctx, GLint x, GLint y, GLsizei w, GLsizei h);
- /*@}*/
-
-
- /**
- * \name Vertex/pixel buffer object functions
- */
- /*@{*/
- void (*BindBuffer)( struct gl_context *ctx, GLenum target,
- struct gl_buffer_object *obj );
-
- struct gl_buffer_object * (*NewBufferObject)( struct gl_context *ctx, GLuint buffer,
- GLenum target );
-
- void (*DeleteBuffer)( struct gl_context *ctx, struct gl_buffer_object *obj );
-
- GLboolean (*BufferData)( struct gl_context *ctx, GLenum target, GLsizeiptrARB size,
- const GLvoid *data, GLenum usage,
- struct gl_buffer_object *obj );
-
- void (*BufferSubData)( struct gl_context *ctx, GLenum target, GLintptrARB offset,
- GLsizeiptrARB size, const GLvoid *data,
- struct gl_buffer_object *obj );
-
- void (*GetBufferSubData)( struct gl_context *ctx, GLenum target,
- GLintptrARB offset, GLsizeiptrARB size,
- GLvoid *data, struct gl_buffer_object *obj );
-
- void * (*MapBuffer)( struct gl_context *ctx, GLenum target, GLenum access,
- struct gl_buffer_object *obj );
-
- void (*CopyBufferSubData)( struct gl_context *ctx,
- struct gl_buffer_object *src,
- struct gl_buffer_object *dst,
- GLintptr readOffset, GLintptr writeOffset,
- GLsizeiptr size );
-
- /* May return NULL if MESA_MAP_NOWAIT_BIT is set in access:
- */
- void * (*MapBufferRange)( struct gl_context *ctx, GLenum target, GLintptr offset,
- GLsizeiptr length, GLbitfield access,
- struct gl_buffer_object *obj);
-
- void (*FlushMappedBufferRange)(struct gl_context *ctx, GLenum target,
- GLintptr offset, GLsizeiptr length,
- struct gl_buffer_object *obj);
-
- GLboolean (*UnmapBuffer)( struct gl_context *ctx, GLenum target,
- struct gl_buffer_object *obj );
- /*@}*/
-
- /**
- * \name Functions for GL_APPLE_object_purgeable
- */
- /*@{*/
- /* variations on ObjectPurgeable */
- GLenum (*BufferObjectPurgeable)( struct gl_context *ctx, struct gl_buffer_object *obj, GLenum option );
- GLenum (*RenderObjectPurgeable)( struct gl_context *ctx, struct gl_renderbuffer *obj, GLenum option );
- GLenum (*TextureObjectPurgeable)( struct gl_context *ctx, struct gl_texture_object *obj, GLenum option );
-
- /* variations on ObjectUnpurgeable */
- GLenum (*BufferObjectUnpurgeable)( struct gl_context *ctx, struct gl_buffer_object *obj, GLenum option );
- GLenum (*RenderObjectUnpurgeable)( struct gl_context *ctx, struct gl_renderbuffer *obj, GLenum option );
- GLenum (*TextureObjectUnpurgeable)( struct gl_context *ctx, struct gl_texture_object *obj, GLenum option );
- /*@}*/
-
- /**
- * \name Functions for GL_EXT_framebuffer_{object,blit}.
- */
- /*@{*/
- struct gl_framebuffer * (*NewFramebuffer)(struct gl_context *ctx, GLuint name);
- struct gl_renderbuffer * (*NewRenderbuffer)(struct gl_context *ctx, GLuint name);
- void (*BindFramebuffer)(struct gl_context *ctx, GLenum target,
- struct gl_framebuffer *drawFb,
- struct gl_framebuffer *readFb);
- void (*FramebufferRenderbuffer)(struct gl_context *ctx,
- struct gl_framebuffer *fb,
- GLenum attachment,
- struct gl_renderbuffer *rb);
- void (*RenderTexture)(struct gl_context *ctx,
- struct gl_framebuffer *fb,
- struct gl_renderbuffer_attachment *att);
- void (*FinishRenderTexture)(struct gl_context *ctx,
- struct gl_renderbuffer_attachment *att);
- void (*ValidateFramebuffer)(struct gl_context *ctx,
- struct gl_framebuffer *fb);
- /*@}*/
- void (*BlitFramebuffer)(struct gl_context *ctx,
- GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1,
- GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1,
- GLbitfield mask, GLenum filter);
-
- /**
- * \name Query objects
- */
- /*@{*/
- struct gl_query_object * (*NewQueryObject)(struct gl_context *ctx, GLuint id);
- void (*DeleteQuery)(struct gl_context *ctx, struct gl_query_object *q);
- void (*BeginQuery)(struct gl_context *ctx, struct gl_query_object *q);
- void (*EndQuery)(struct gl_context *ctx, struct gl_query_object *q);
- void (*CheckQuery)(struct gl_context *ctx, struct gl_query_object *q);
- void (*WaitQuery)(struct gl_context *ctx, struct gl_query_object *q);
- /*@}*/
-
-
- /**
- * \name Vertex Array objects
- */
- /*@{*/
- struct gl_array_object * (*NewArrayObject)(struct gl_context *ctx, GLuint id);
- void (*DeleteArrayObject)(struct gl_context *ctx, struct gl_array_object *obj);
- void (*BindArrayObject)(struct gl_context *ctx, struct gl_array_object *obj);
- /*@}*/
-
- /**
- * \name GLSL-related functions (ARB extensions and OpenGL 2.x)
- */
- /*@{*/
- struct gl_shader *(*NewShader)(struct gl_context *ctx, GLuint name, GLenum type);
- void (*DeleteShader)(struct gl_context *ctx, struct gl_shader *shader);
- struct gl_shader_program *(*NewShaderProgram)(struct gl_context *ctx, GLuint name);
- void (*DeleteShaderProgram)(struct gl_context *ctx,
- struct gl_shader_program *shProg);
- void (*UseProgram)(struct gl_context *ctx, struct gl_shader_program *shProg);
- /*@}*/
-
-
- /**
- * \name Support for multiple T&L engines
- */
- /*@{*/
-
- /**
- * Bitmask of state changes that require the current T&L module to be
- * validated, using ValidateTnlModule() below.
- */
- GLuint NeedValidate;
-
- /**
- * Validate the current T&L module.
- *
- * This is called directly after UpdateState() when a state change that has
- * occurred matches the dd_function_table::NeedValidate bitmask above. This
- * ensures all computed values are up to date, thus allowing the driver to
- * decide if the current T&L module needs to be swapped out.
- *
- * This must be non-NULL if a driver installs a custom T&L module and sets
- * the dd_function_table::NeedValidate bitmask, but may be NULL otherwise.
- */
- void (*ValidateTnlModule)( struct gl_context *ctx, GLuint new_state );
-
- /**
- * Set by the driver-supplied T&L engine.
- *
- * Set to PRIM_OUTSIDE_BEGIN_END when outside glBegin()/glEnd().
- */
- GLuint CurrentExecPrimitive;
-
- /**
- * Current state of an in-progress compilation.
- *
- * May take on any of the additional values PRIM_OUTSIDE_BEGIN_END,
- * PRIM_INSIDE_UNKNOWN_PRIM or PRIM_UNKNOWN defined above.
- */
- GLuint CurrentSavePrimitive;
-
-
-#define FLUSH_STORED_VERTICES 0x1
-#define FLUSH_UPDATE_CURRENT 0x2
- /**
- * Set by the driver-supplied T&L engine whenever vertices are buffered
- * between glBegin()/glEnd() objects or __struct gl_contextRec::Current is not
- * updated.
- *
- * The dd_function_table::FlushVertices call below may be used to resolve
- * these conditions.
- */
- GLuint NeedFlush;
- GLuint SaveNeedFlush;
-
-
- /* Called prior to any of the GLvertexformat functions being
- * called. Paired with Driver.FlushVertices().
- */
- void (*BeginVertices)( struct gl_context *ctx );
-
- /**
- * If inside glBegin()/glEnd(), it should ASSERT(0). Otherwise, if
- * FLUSH_STORED_VERTICES bit in \p flags is set flushes any buffered
- * vertices, if FLUSH_UPDATE_CURRENT bit is set updates
- * __struct gl_contextRec::Current and gl_light_attrib::Material
- *
- * Note that the default T&L engine never clears the
- * FLUSH_UPDATE_CURRENT bit, even after performing the update.
- */
- void (*FlushVertices)( struct gl_context *ctx, GLuint flags );
- void (*SaveFlushVertices)( struct gl_context *ctx );
-
- /**
- * Give the driver the opportunity to hook in its own vtxfmt for
- * compiling optimized display lists. This is called on each valid
- * glBegin() during list compilation.
- */
- GLboolean (*NotifySaveBegin)( struct gl_context *ctx, GLenum mode );
-
- /**
- * Notify driver that the special derived value _NeedEyeCoords has
- * changed.
- */
- void (*LightingSpaceChange)( struct gl_context *ctx );
-
- /**
- * Called by glNewList().
- *
- * Let the T&L component know what is going on with display lists
- * in time to make changes to dispatch tables, etc.
- */
- void (*NewList)( struct gl_context *ctx, GLuint list, GLenum mode );
- /**
- * Called by glEndList().
- *
- * \sa dd_function_table::NewList.
- */
- void (*EndList)( struct gl_context *ctx );
-
- /**
- * Called by glCallList(s).
- *
- * Notify the T&L component before and after calling a display list.
- */
- void (*BeginCallList)( struct gl_context *ctx,
- struct gl_display_list *dlist );
- /**
- * Called by glEndCallList().
- *
- * \sa dd_function_table::BeginCallList.
- */
- void (*EndCallList)( struct gl_context *ctx );
-
-
- /**
- * \name GL_ARB_sync interfaces
- */
- /*@{*/
- struct gl_sync_object * (*NewSyncObject)(struct gl_context *, GLenum);
- void (*FenceSync)(struct gl_context *, struct gl_sync_object *, GLenum, GLbitfield);
- void (*DeleteSyncObject)(struct gl_context *, struct gl_sync_object *);
- void (*CheckSync)(struct gl_context *, struct gl_sync_object *);
- void (*ClientWaitSync)(struct gl_context *, struct gl_sync_object *,
- GLbitfield, GLuint64);
- void (*ServerWaitSync)(struct gl_context *, struct gl_sync_object *,
- GLbitfield, GLuint64);
- /*@}*/
-
- /** GL_NV_conditional_render */
- void (*BeginConditionalRender)(struct gl_context *ctx, struct gl_query_object *q,
- GLenum mode);
- void (*EndConditionalRender)(struct gl_context *ctx, struct gl_query_object *q);
-
- /**
- * \name GL_OES_draw_texture interface
- */
- /*@{*/
- void (*DrawTex)(struct gl_context *ctx, GLfloat x, GLfloat y, GLfloat z,
- GLfloat width, GLfloat height);
- /*@}*/
-
- /**
- * \name GL_OES_EGL_image interface
- */
- void (*EGLImageTargetTexture2D)(struct gl_context *ctx, GLenum target,
- struct gl_texture_object *texObj,
- struct gl_texture_image *texImage,
- GLeglImageOES image_handle);
- void (*EGLImageTargetRenderbufferStorage)(struct gl_context *ctx,
- struct gl_renderbuffer *rb,
- void *image_handle);
-
- /**
- * \name GL_EXT_transform_feedback interface
- */
- struct gl_transform_feedback_object *
- (*NewTransformFeedback)(struct gl_context *ctx, GLuint name);
- void (*DeleteTransformFeedback)(struct gl_context *ctx,
- struct gl_transform_feedback_object *obj);
- void (*BeginTransformFeedback)(struct gl_context *ctx, GLenum mode,
- struct gl_transform_feedback_object *obj);
- void (*EndTransformFeedback)(struct gl_context *ctx,
- struct gl_transform_feedback_object *obj);
- void (*PauseTransformFeedback)(struct gl_context *ctx,
- struct gl_transform_feedback_object *obj);
- void (*ResumeTransformFeedback)(struct gl_context *ctx,
- struct gl_transform_feedback_object *obj);
- void (*DrawTransformFeedback)(struct gl_context *ctx, GLenum mode,
- struct gl_transform_feedback_object *obj);
-
- /**
- * \name GL_NV_texture_barrier interface
- */
- void (*TextureBarrier)(struct gl_context *ctx);
-
- /**
- * \name GL_ARB_sampler_objects
- */
- struct gl_sampler_object * (*NewSamplerObject)(struct gl_context *ctx,
- GLuint name);
- void (*DeleteSamplerObject)(struct gl_context *ctx,
- struct gl_sampler_object *samp);
-};
-
-
-/**
- * Transform/Clip/Lighting interface
- *
- * Drivers present a reduced set of the functions possible in
- * glBegin()/glEnd() objects. Core mesa provides translation stubs for the
- * remaining functions to map down to these entry points.
- *
- * These are the initial values to be installed into dispatch by
- * mesa. If the T&L driver wants to modify the dispatch table
- * while installed, it must do so itself. It would be possible for
- * the vertexformat to install its own initial values for these
- * functions, but this way there is an obvious list of what is
- * expected of the driver.
- *
- * If the driver wants to hook in entry points other than those
- * listed, it must restore them to their original values in
- * the disable() callback, below.
- */
-typedef struct {
- /**
- * \name Vertex
- */
- /*@{*/
- void (GLAPIENTRYP ArrayElement)( GLint );
- void (GLAPIENTRYP Color3f)( GLfloat, GLfloat, GLfloat );
- void (GLAPIENTRYP Color3fv)( const GLfloat * );
- void (GLAPIENTRYP Color4f)( GLfloat, GLfloat, GLfloat, GLfloat );
- void (GLAPIENTRYP Color4fv)( const GLfloat * );
- void (GLAPIENTRYP EdgeFlag)( GLboolean );
- void (GLAPIENTRYP EvalCoord1f)( GLfloat );
- void (GLAPIENTRYP EvalCoord1fv)( const GLfloat * );
- void (GLAPIENTRYP EvalCoord2f)( GLfloat, GLfloat );
- void (GLAPIENTRYP EvalCoord2fv)( const GLfloat * );
- void (GLAPIENTRYP EvalPoint1)( GLint );
- void (GLAPIENTRYP EvalPoint2)( GLint, GLint );
- void (GLAPIENTRYP FogCoordfEXT)( GLfloat );
- void (GLAPIENTRYP FogCoordfvEXT)( const GLfloat * );
- void (GLAPIENTRYP Indexf)( GLfloat );
- void (GLAPIENTRYP Indexfv)( const GLfloat * );
- void (GLAPIENTRYP Materialfv)( GLenum face, GLenum pname, const GLfloat * );
- void (GLAPIENTRYP MultiTexCoord1fARB)( GLenum, GLfloat );
- void (GLAPIENTRYP MultiTexCoord1fvARB)( GLenum, const GLfloat * );
- void (GLAPIENTRYP MultiTexCoord2fARB)( GLenum, GLfloat, GLfloat );
- void (GLAPIENTRYP MultiTexCoord2fvARB)( GLenum, const GLfloat * );
- void (GLAPIENTRYP MultiTexCoord3fARB)( GLenum, GLfloat, GLfloat, GLfloat );
- void (GLAPIENTRYP MultiTexCoord3fvARB)( GLenum, const GLfloat * );
- void (GLAPIENTRYP MultiTexCoord4fARB)( GLenum, GLfloat, GLfloat, GLfloat, GLfloat );
- void (GLAPIENTRYP MultiTexCoord4fvARB)( GLenum, const GLfloat * );
- void (GLAPIENTRYP Normal3f)( GLfloat, GLfloat, GLfloat );
- void (GLAPIENTRYP Normal3fv)( const GLfloat * );
- void (GLAPIENTRYP SecondaryColor3fEXT)( GLfloat, GLfloat, GLfloat );
- void (GLAPIENTRYP SecondaryColor3fvEXT)( const GLfloat * );
- void (GLAPIENTRYP TexCoord1f)( GLfloat );
- void (GLAPIENTRYP TexCoord1fv)( const GLfloat * );
- void (GLAPIENTRYP TexCoord2f)( GLfloat, GLfloat );
- void (GLAPIENTRYP TexCoord2fv)( const GLfloat * );
- void (GLAPIENTRYP TexCoord3f)( GLfloat, GLfloat, GLfloat );
- void (GLAPIENTRYP TexCoord3fv)( const GLfloat * );
- void (GLAPIENTRYP TexCoord4f)( GLfloat, GLfloat, GLfloat, GLfloat );
- void (GLAPIENTRYP TexCoord4fv)( const GLfloat * );
- void (GLAPIENTRYP Vertex2f)( GLfloat, GLfloat );
- void (GLAPIENTRYP Vertex2fv)( const GLfloat * );
- void (GLAPIENTRYP Vertex3f)( GLfloat, GLfloat, GLfloat );
- void (GLAPIENTRYP Vertex3fv)( const GLfloat * );
- void (GLAPIENTRYP Vertex4f)( GLfloat, GLfloat, GLfloat, GLfloat );
- void (GLAPIENTRYP Vertex4fv)( const GLfloat * );
- void (GLAPIENTRYP CallList)( GLuint );
- void (GLAPIENTRYP CallLists)( GLsizei, GLenum, const GLvoid * );
- void (GLAPIENTRYP Begin)( GLenum );
- void (GLAPIENTRYP End)( void );
- void (GLAPIENTRYP PrimitiveRestartNV)( void );
- /* GL_NV_vertex_program */
- void (GLAPIENTRYP VertexAttrib1fNV)( GLuint index, GLfloat x );
- void (GLAPIENTRYP VertexAttrib1fvNV)( GLuint index, const GLfloat *v );
- void (GLAPIENTRYP VertexAttrib2fNV)( GLuint index, GLfloat x, GLfloat y );
- void (GLAPIENTRYP VertexAttrib2fvNV)( GLuint index, const GLfloat *v );
- void (GLAPIENTRYP VertexAttrib3fNV)( GLuint index, GLfloat x, GLfloat y, GLfloat z );
- void (GLAPIENTRYP VertexAttrib3fvNV)( GLuint index, const GLfloat *v );
- void (GLAPIENTRYP VertexAttrib4fNV)( GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w );
- void (GLAPIENTRYP VertexAttrib4fvNV)( GLuint index, const GLfloat *v );
- /* GL_ARB_vertex_program */
- void (GLAPIENTRYP VertexAttrib1fARB)( GLuint index, GLfloat x );
- void (GLAPIENTRYP VertexAttrib1fvARB)( GLuint index, const GLfloat *v );
- void (GLAPIENTRYP VertexAttrib2fARB)( GLuint index, GLfloat x, GLfloat y );
- void (GLAPIENTRYP VertexAttrib2fvARB)( GLuint index, const GLfloat *v );
- void (GLAPIENTRYP VertexAttrib3fARB)( GLuint index, GLfloat x, GLfloat y, GLfloat z );
- void (GLAPIENTRYP VertexAttrib3fvARB)( GLuint index, const GLfloat *v );
- void (GLAPIENTRYP VertexAttrib4fARB)( GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w );
- void (GLAPIENTRYP VertexAttrib4fvARB)( GLuint index, const GLfloat *v );
-
- /* GL_EXT_gpu_shader4 / GL 3.0 */
- void (GLAPIENTRYP VertexAttribI1i)( GLuint index, GLint x);
- void (GLAPIENTRYP VertexAttribI2i)( GLuint index, GLint x, GLint y);
- void (GLAPIENTRYP VertexAttribI3i)( GLuint index, GLint x, GLint y, GLint z);
- void (GLAPIENTRYP VertexAttribI4i)( GLuint index, GLint x, GLint y, GLint z, GLint w);
- void (GLAPIENTRYP VertexAttribI2iv)( GLuint index, const GLint *v);
- void (GLAPIENTRYP VertexAttribI3iv)( GLuint index, const GLint *v);
- void (GLAPIENTRYP VertexAttribI4iv)( GLuint index, const GLint *v);
-
- void (GLAPIENTRYP VertexAttribI1ui)( GLuint index, GLuint x);
- void (GLAPIENTRYP VertexAttribI2ui)( GLuint index, GLuint x, GLuint y);
- void (GLAPIENTRYP VertexAttribI3ui)( GLuint index, GLuint x, GLuint y, GLuint z);
- void (GLAPIENTRYP VertexAttribI4ui)( GLuint index, GLuint x, GLuint y, GLuint z, GLuint w);
- void (GLAPIENTRYP VertexAttribI2uiv)( GLuint index, const GLuint *v);
- void (GLAPIENTRYP VertexAttribI3uiv)( GLuint index, const GLuint *v);
- void (GLAPIENTRYP VertexAttribI4uiv)( GLuint index, const GLuint *v);
-
- /*@}*/
-
- void (GLAPIENTRYP Rectf)( GLfloat, GLfloat, GLfloat, GLfloat );
-
- /**
- * \name Array
- */
- /*@{*/
- void (GLAPIENTRYP DrawArrays)( GLenum mode, GLint start, GLsizei count );
- void (GLAPIENTRYP DrawElements)( GLenum mode, GLsizei count, GLenum type,
- const GLvoid *indices );
- void (GLAPIENTRYP DrawRangeElements)( GLenum mode, GLuint start,
- GLuint end, GLsizei count,
- GLenum type, const GLvoid *indices );
- void (GLAPIENTRYP MultiDrawElementsEXT)( GLenum mode, const GLsizei *count,
- GLenum type,
- const GLvoid **indices,
- GLsizei primcount);
- void (GLAPIENTRYP DrawElementsBaseVertex)( GLenum mode, GLsizei count,
- GLenum type,
- const GLvoid *indices,
- GLint basevertex );
- void (GLAPIENTRYP DrawRangeElementsBaseVertex)( GLenum mode, GLuint start,
- GLuint end, GLsizei count,
- GLenum type,
- const GLvoid *indices,
- GLint basevertex);
- void (GLAPIENTRYP MultiDrawElementsBaseVertex)( GLenum mode,
- const GLsizei *count,
- GLenum type,
- const GLvoid **indices,
- GLsizei primcount,
- const GLint *basevertex);
- void (GLAPIENTRYP DrawArraysInstanced)(GLenum mode, GLint first,
- GLsizei count, GLsizei primcount);
- void (GLAPIENTRYP DrawElementsInstanced)(GLenum mode, GLsizei count,
- GLenum type, const GLvoid *indices,
- GLsizei primcount);
- /*@}*/
-
- /**
- * \name Eval
- *
- * If you don't support eval, fallback to the default vertex format
- * on receiving an eval call and use the pipeline mechanism to
- * provide partial T&L acceleration.
- *
- * Mesa will provide a set of helper functions to do eval within
- * accelerated vertex formats, eventually...
- */
- /*@{*/
- void (GLAPIENTRYP EvalMesh1)( GLenum mode, GLint i1, GLint i2 );
- void (GLAPIENTRYP EvalMesh2)( GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2 );
- /*@}*/
-
-} GLvertexformat;
-
-
-#endif /* DD_INCLUDED */
+/**
+ * \file dd.h
+ * Device driver interfaces.
+ */
+
+/*
+ * Mesa 3-D graphics library
+ * Version: 6.5.2
+ *
+ * Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+
+#ifndef DD_INCLUDED
+#define DD_INCLUDED
+
+/* THIS FILE ONLY INCLUDED BY mtypes.h !!!!! */
+
+#include "glheader.h"
+
+struct gl_buffer_object;
+struct gl_context;
+struct gl_display_list;
+struct gl_framebuffer;
+struct gl_pixelstore_attrib;
+struct gl_program;
+struct gl_renderbuffer;
+struct gl_renderbuffer_attachment;
+struct gl_shader;
+struct gl_shader_program;
+struct gl_texture_image;
+struct gl_texture_object;
+
+/* GL_ARB_vertex_buffer_object */
+/* Modifies GL_MAP_UNSYNCHRONIZED_BIT to allow driver to fail (return
+ * NULL) if buffer is unavailable for immediate mapping.
+ *
+ * Does GL_MAP_INVALIDATE_RANGE_BIT do this? It seems so, but it
+ * would require more book-keeping in the driver than seems necessary
+ * at this point.
+ *
+ * Does GL_MAP_INVALDIATE_BUFFER_BIT do this? Not really -- we don't
+ * want to provoke the driver to throw away the old storage, we will
+ * respect the contents of already referenced data.
+ */
+#define MESA_MAP_NOWAIT_BIT 0x0040
+
+
+/**
+ * Device driver function table.
+ * Core Mesa uses these function pointers to call into device drivers.
+ * Most of these functions directly correspond to OpenGL state commands.
+ * Core Mesa will call these functions after error checking has been done
+ * so that the drivers don't have to worry about error testing.
+ *
+ * Vertex transformation/clipping/lighting is patched into the T&L module.
+ * Rasterization functions are patched into the swrast module.
+ *
+ * Note: when new functions are added here, the drivers/common/driverfuncs.c
+ * file should be updated too!!!
+ */
+struct dd_function_table {
+ /**
+ * Return a string as needed by glGetString().
+ * Only the GL_RENDERER query must be implemented. Otherwise, NULL can be
+ * returned.
+ */
+ const GLubyte * (*GetString)( struct gl_context *ctx, GLenum name );
+
+ /**
+ * Notify the driver after Mesa has made some internal state changes.
+ *
+ * This is in addition to any state change callbacks Mesa may already have
+ * made.
+ */
+ void (*UpdateState)( struct gl_context *ctx, GLbitfield new_state );
+
+ /**
+ * Get the width and height of the named buffer/window.
+ *
+ * Mesa uses this to determine when the driver's window size has changed.
+ * XXX OBSOLETE: this function will be removed in the future.
+ */
+ void (*GetBufferSize)( struct gl_framebuffer *buffer,
+ GLuint *width, GLuint *height );
+
+ /**
+ * Resize the given framebuffer to the given size.
+ * XXX OBSOLETE: this function will be removed in the future.
+ */
+ void (*ResizeBuffers)( struct gl_context *ctx, struct gl_framebuffer *fb,
+ GLuint width, GLuint height);
+
+ /**
+ * Called whenever an error is generated.
+ * __struct gl_contextRec::ErrorValue contains the error value.
+ */
+ void (*Error)( struct gl_context *ctx );
+
+ /**
+ * This is called whenever glFinish() is called.
+ */
+ void (*Finish)( struct gl_context *ctx );
+
+ /**
+ * This is called whenever glFlush() is called.
+ */
+ void (*Flush)( struct gl_context *ctx );
+
+ /**
+ * Clear the color/depth/stencil/accum buffer(s).
+ * \param buffers a bitmask of BUFFER_BIT_* flags indicating which
+ * renderbuffers need to be cleared.
+ */
+ void (*Clear)( struct gl_context *ctx, GLbitfield buffers );
+
+ /**
+ * Execute glAccum command.
+ */
+ void (*Accum)( struct gl_context *ctx, GLenum op, GLfloat value );
+
+
+ /**
+ * Execute glRasterPos, updating the ctx->Current.Raster fields
+ */
+ void (*RasterPos)( struct gl_context *ctx, const GLfloat v[4] );
+
+ /**
+ * \name Image-related functions
+ */
+ /*@{*/
+
+ /**
+ * Called by glDrawPixels().
+ * \p unpack describes how to unpack the source image data.
+ */
+ void (*DrawPixels)( struct gl_context *ctx,
+ GLint x, GLint y, GLsizei width, GLsizei height,
+ GLenum format, GLenum type,
+ const struct gl_pixelstore_attrib *unpack,
+ const GLvoid *pixels );
+
+ /**
+ * Called by glReadPixels().
+ */
+ void (*ReadPixels)( struct gl_context *ctx,
+ GLint x, GLint y, GLsizei width, GLsizei height,
+ GLenum format, GLenum type,
+ const struct gl_pixelstore_attrib *unpack,
+ GLvoid *dest );
+
+ /**
+ * Called by glCopyPixels().
+ */
+ void (*CopyPixels)( struct gl_context *ctx, GLint srcx, GLint srcy,
+ GLsizei width, GLsizei height,
+ GLint dstx, GLint dsty, GLenum type );
+
+ /**
+ * Called by glBitmap().
+ */
+ void (*Bitmap)( struct gl_context *ctx,
+ GLint x, GLint y, GLsizei width, GLsizei height,
+ const struct gl_pixelstore_attrib *unpack,
+ const GLubyte *bitmap );
+ /*@}*/
+
+
+ /**
+ * \name Texture image functions
+ */
+ /*@{*/
+
+ /**
+ * Choose texture format.
+ *
+ * This is called by the \c _mesa_store_tex[sub]image[123]d() fallback
+ * functions. The driver should examine \p internalFormat and return a
+ * gl_format value.
+ */
+ GLuint (*ChooseTextureFormat)( struct gl_context *ctx, GLint internalFormat,
+ GLenum srcFormat, GLenum srcType );
+
+ /**
+ * Called by glTexImage1D().
+ *
+ * \param target user specified.
+ * \param format user specified.
+ * \param type user specified.
+ * \param pixels user specified.
+ * \param packing indicates the image packing of pixels.
+ * \param texObj is the target texture object.
+ * \param texImage is the target texture image. It will have the texture \p
+ * width, \p height, \p depth, \p border and \p internalFormat information.
+ *
+ * \p retainInternalCopy is returned by this function and indicates whether
+ * core Mesa should keep an internal copy of the texture image.
+ *
+ * Drivers should call a fallback routine from texstore.c if needed.
+ */
+ void (*TexImage1D)( struct gl_context *ctx, GLenum target, GLint level,
+ GLint internalFormat,
+ GLint width, GLint border,
+ GLenum format, GLenum type, const GLvoid *pixels,
+ const struct gl_pixelstore_attrib *packing,
+ struct gl_texture_object *texObj,
+ struct gl_texture_image *texImage );
+
+ /**
+ * Called by glTexImage2D().
+ *
+ * \sa dd_function_table::TexImage1D.
+ */
+ void (*TexImage2D)( struct gl_context *ctx, GLenum target, GLint level,
+ GLint internalFormat,
+ GLint width, GLint height, GLint border,
+ GLenum format, GLenum type, const GLvoid *pixels,
+ const struct gl_pixelstore_attrib *packing,
+ struct gl_texture_object *texObj,
+ struct gl_texture_image *texImage );
+
+ /**
+ * Called by glTexImage3D().
+ *
+ * \sa dd_function_table::TexImage1D.
+ */
+ void (*TexImage3D)( struct gl_context *ctx, GLenum target, GLint level,
+ GLint internalFormat,
+ GLint width, GLint height, GLint depth, GLint border,
+ GLenum format, GLenum type, const GLvoid *pixels,
+ const struct gl_pixelstore_attrib *packing,
+ struct gl_texture_object *texObj,
+ struct gl_texture_image *texImage );
+
+ /**
+ * Called by glTexSubImage1D().
+ *
+ * \param target user specified.
+ * \param level user specified.
+ * \param xoffset user specified.
+ * \param yoffset user specified.
+ * \param zoffset user specified.
+ * \param width user specified.
+ * \param height user specified.
+ * \param depth user specified.
+ * \param format user specified.
+ * \param type user specified.
+ * \param pixels user specified.
+ * \param packing indicates the image packing of pixels.
+ * \param texObj is the target texture object.
+ * \param texImage is the target texture image. It will have the texture \p
+ * width, \p height, \p border and \p internalFormat information.
+ *
+ * The driver should use a fallback routine from texstore.c if needed.
+ */
+ void (*TexSubImage1D)( struct gl_context *ctx, GLenum target, GLint level,
+ GLint xoffset, GLsizei width,
+ GLenum format, GLenum type,
+ const GLvoid *pixels,
+ const struct gl_pixelstore_attrib *packing,
+ struct gl_texture_object *texObj,
+ struct gl_texture_image *texImage );
+
+ /**
+ * Called by glTexSubImage2D().
+ *
+ * \sa dd_function_table::TexSubImage1D.
+ */
+ void (*TexSubImage2D)( struct gl_context *ctx, GLenum target, GLint level,
+ GLint xoffset, GLint yoffset,
+ GLsizei width, GLsizei height,
+ GLenum format, GLenum type,
+ const GLvoid *pixels,
+ const struct gl_pixelstore_attrib *packing,
+ struct gl_texture_object *texObj,
+ struct gl_texture_image *texImage );
+
+ /**
+ * Called by glTexSubImage3D().
+ *
+ * \sa dd_function_table::TexSubImage1D.
+ */
+ void (*TexSubImage3D)( struct gl_context *ctx, GLenum target, GLint level,
+ GLint xoffset, GLint yoffset, GLint zoffset,
+ GLsizei width, GLsizei height, GLint depth,
+ GLenum format, GLenum type,
+ const GLvoid *pixels,
+ const struct gl_pixelstore_attrib *packing,
+ struct gl_texture_object *texObj,
+ struct gl_texture_image *texImage );
+
+ /**
+ * Called by glGetTexImage().
+ */
+ void (*GetTexImage)( struct gl_context *ctx, GLenum target, GLint level,
+ GLenum format, GLenum type, GLvoid *pixels,
+ struct gl_texture_object *texObj,
+ struct gl_texture_image *texImage );
+
+ /**
+ * Called by glCopyTexImage1D().
+ *
+ * Drivers should use a fallback routine from texstore.c if needed.
+ */
+ void (*CopyTexImage1D)( struct gl_context *ctx, GLenum target, GLint level,
+ GLenum internalFormat, GLint x, GLint y,
+ GLsizei width, GLint border );
+
+ /**
+ * Called by glCopyTexImage2D().
+ *
+ * Drivers should use a fallback routine from texstore.c if needed.
+ */
+ void (*CopyTexImage2D)( struct gl_context *ctx, GLenum target, GLint level,
+ GLenum internalFormat, GLint x, GLint y,
+ GLsizei width, GLsizei height, GLint border );
+
+ /**
+ * Called by glCopyTexSubImage1D().
+ *
+ * Drivers should use a fallback routine from texstore.c if needed.
+ */
+ void (*CopyTexSubImage1D)( struct gl_context *ctx, GLenum target, GLint level,
+ GLint xoffset,
+ GLint x, GLint y, GLsizei width );
+ /**
+ * Called by glCopyTexSubImage2D().
+ *
+ * Drivers should use a fallback routine from texstore.c if needed.
+ */
+ void (*CopyTexSubImage2D)( struct gl_context *ctx, GLenum target, GLint level,
+ GLint xoffset, GLint yoffset,
+ GLint x, GLint y,
+ GLsizei width, GLsizei height );
+ /**
+ * Called by glCopyTexSubImage3D().
+ *
+ * Drivers should use a fallback routine from texstore.c if needed.
+ */
+ void (*CopyTexSubImage3D)( struct gl_context *ctx, GLenum target, GLint level,
+ GLint xoffset, GLint yoffset, GLint zoffset,
+ GLint x, GLint y,
+ GLsizei width, GLsizei height );
+
+ /**
+ * Called by glGenerateMipmap() or when GL_GENERATE_MIPMAP_SGIS is enabled.
+ */
+ void (*GenerateMipmap)(struct gl_context *ctx, GLenum target,
+ struct gl_texture_object *texObj);
+
+ /**
+ * Called by glTexImage[123]D when user specifies a proxy texture
+ * target.
+ *
+ * \return GL_TRUE if the proxy test passes, or GL_FALSE if the test fails.
+ */
+ GLboolean (*TestProxyTexImage)(struct gl_context *ctx, GLenum target,
+ GLint level, GLint internalFormat,
+ GLenum format, GLenum type,
+ GLint width, GLint height,
+ GLint depth, GLint border);
+ /*@}*/
+
+
+ /**
+ * \name Compressed texture functions
+ */
+ /*@{*/
+
+ /**
+ * Called by glCompressedTexImage1D().
+ *
+ * \param target user specified.
+ * \param format user specified.
+ * \param type user specified.
+ * \param pixels user specified.
+ * \param packing indicates the image packing of pixels.
+ * \param texObj is the target texture object.
+ * \param texImage is the target texture image. It will have the texture \p
+ * width, \p height, \p depth, \p border and \p internalFormat information.
+ *
+ * \a retainInternalCopy is returned by this function and indicates whether
+ * core Mesa should keep an internal copy of the texture image.
+ */
+ void (*CompressedTexImage1D)( struct gl_context *ctx, GLenum target,
+ GLint level, GLint internalFormat,
+ GLsizei width, GLint border,
+ GLsizei imageSize, const GLvoid *data,
+ struct gl_texture_object *texObj,
+ struct gl_texture_image *texImage );
+ /**
+ * Called by glCompressedTexImage2D().
+ *
+ * \sa dd_function_table::CompressedTexImage1D.
+ */
+ void (*CompressedTexImage2D)( struct gl_context *ctx, GLenum target,
+ GLint level, GLint internalFormat,
+ GLsizei width, GLsizei height, GLint border,
+ GLsizei imageSize, const GLvoid *data,
+ struct gl_texture_object *texObj,
+ struct gl_texture_image *texImage );
+ /**
+ * Called by glCompressedTexImage3D().
+ *
+ * \sa dd_function_table::CompressedTexImage3D.
+ */
+ void (*CompressedTexImage3D)( struct gl_context *ctx, GLenum target,
+ GLint level, GLint internalFormat,
+ GLsizei width, GLsizei height, GLsizei depth,
+ GLint border,
+ GLsizei imageSize, const GLvoid *data,
+ struct gl_texture_object *texObj,
+ struct gl_texture_image *texImage );
+
+ /**
+ * Called by glCompressedTexSubImage1D().
+ *
+ * \param target user specified.
+ * \param level user specified.
+ * \param xoffset user specified.
+ * \param yoffset user specified.
+ * \param zoffset user specified.
+ * \param width user specified.
+ * \param height user specified.
+ * \param depth user specified.
+ * \param imageSize user specified.
+ * \param data user specified.
+ * \param texObj is the target texture object.
+ * \param texImage is the target texture image. It will have the texture \p
+ * width, \p height, \p depth, \p border and \p internalFormat information.
+ */
+ void (*CompressedTexSubImage1D)(struct gl_context *ctx, GLenum target, GLint level,
+ GLint xoffset, GLsizei width,
+ GLenum format,
+ GLsizei imageSize, const GLvoid *data,
+ struct gl_texture_object *texObj,
+ struct gl_texture_image *texImage);
+ /**
+ * Called by glCompressedTexSubImage2D().
+ *
+ * \sa dd_function_table::CompressedTexImage3D.
+ */
+ void (*CompressedTexSubImage2D)(struct gl_context *ctx, GLenum target, GLint level,
+ GLint xoffset, GLint yoffset,
+ GLsizei width, GLint height,
+ GLenum format,
+ GLsizei imageSize, const GLvoid *data,
+ struct gl_texture_object *texObj,
+ struct gl_texture_image *texImage);
+ /**
+ * Called by glCompressedTexSubImage3D().
+ *
+ * \sa dd_function_table::CompressedTexImage3D.
+ */
+ void (*CompressedTexSubImage3D)(struct gl_context *ctx, GLenum target, GLint level,
+ GLint xoffset, GLint yoffset, GLint zoffset,
+ GLsizei width, GLint height, GLint depth,
+ GLenum format,
+ GLsizei imageSize, const GLvoid *data,
+ struct gl_texture_object *texObj,
+ struct gl_texture_image *texImage);
+
+
+ /**
+ * Called by glGetCompressedTexImage.
+ */
+ void (*GetCompressedTexImage)(struct gl_context *ctx, GLenum target, GLint level,
+ GLvoid *img,
+ struct gl_texture_object *texObj,
+ struct gl_texture_image *texImage);
+
+ /*@}*/
+
+ /**
+ * \name Texture object functions
+ */
+ /*@{*/
+
+ /**
+ * Called by glBindTexture().
+ */
+ void (*BindTexture)( struct gl_context *ctx, GLenum target,
+ struct gl_texture_object *tObj );
+
+ /**
+ * Called to allocate a new texture object.
+ * A new gl_texture_object should be returned. The driver should
+ * attach to it any device-specific info it needs.
+ */
+ struct gl_texture_object * (*NewTextureObject)( struct gl_context *ctx, GLuint name,
+ GLenum target );
+ /**
+ * Called when a texture object is about to be deallocated.
+ *
+ * Driver should delete the gl_texture_object object and anything
+ * hanging off of it.
+ */
+ void (*DeleteTexture)( struct gl_context *ctx, struct gl_texture_object *tObj );
+
+ /**
+ * Called to allocate a new texture image object.
+ */
+ struct gl_texture_image * (*NewTextureImage)( struct gl_context *ctx );
+
+ /**
+ * Called to free tImage->Data.
+ */
+ void (*FreeTexImageData)( struct gl_context *ctx, struct gl_texture_image *tImage );
+
+ /** Map texture image data into user space */
+ void (*MapTexture)( struct gl_context *ctx, struct gl_texture_object *tObj );
+ /** Unmap texture images from user space */
+ void (*UnmapTexture)( struct gl_context *ctx, struct gl_texture_object *tObj );
+
+ /**
+ * Note: no context argument. This function doesn't initially look
+ * like it belongs here, except that the driver is the only entity
+ * that knows for sure how the texture memory is allocated - via
+ * the above callbacks. There is then an argument that the driver
+ * knows what memcpy paths might be fast. Typically this is invoked with
+ *
+ * to -- a pointer into texture memory allocated by NewTextureImage() above.
+ * from -- a pointer into client memory or a mesa temporary.
+ * sz -- nr bytes to copy.
+ */
+ void* (*TextureMemCpy)( void *to, const void *from, size_t sz );
+
+ /**
+ * Called by glAreTextureResident().
+ */
+ GLboolean (*IsTextureResident)( struct gl_context *ctx,
+ struct gl_texture_object *t );
+
+ /**
+ * Called when the texture's color lookup table is changed.
+ *
+ * If \p tObj is NULL then the shared texture palette
+ * gl_texture_object::Palette is to be updated.
+ */
+ void (*UpdateTexturePalette)( struct gl_context *ctx,
+ struct gl_texture_object *tObj );
+ /*@}*/
+
+
+ /**
+ * \name Imaging functionality
+ */
+ /*@{*/
+ void (*CopyColorTable)( struct gl_context *ctx,
+ GLenum target, GLenum internalformat,
+ GLint x, GLint y, GLsizei width );
+
+ void (*CopyColorSubTable)( struct gl_context *ctx,
+ GLenum target, GLsizei start,
+ GLint x, GLint y, GLsizei width );
+ /*@}*/
+
+
+ /**
+ * \name Vertex/fragment program functions
+ */
+ /*@{*/
+ /** Bind a vertex/fragment program */
+ void (*BindProgram)(struct gl_context *ctx, GLenum target, struct gl_program *prog);
+ /** Allocate a new program */
+ struct gl_program * (*NewProgram)(struct gl_context *ctx, GLenum target, GLuint id);
+ /** Delete a program */
+ void (*DeleteProgram)(struct gl_context *ctx, struct gl_program *prog);
+ /**
+ * Notify driver that a program string (and GPU code) has been specified
+ * or modified. Return GL_TRUE or GL_FALSE to indicate if the program is
+ * supported by the driver.
+ */
+ GLboolean (*ProgramStringNotify)(struct gl_context *ctx, GLenum target,
+ struct gl_program *prog);
+
+ /** Query if program can be loaded onto hardware */
+ GLboolean (*IsProgramNative)(struct gl_context *ctx, GLenum target,
+ struct gl_program *prog);
+
+ /*@}*/
+
+ /**
+ * \name GLSL shader/program functions.
+ */
+ /*@{*/
+ /**
+ * Called when a shader program is linked.
+ *
+ * This gives drivers an opportunity to clone the IR and make their
+ * own transformations on it for the purposes of code generation.
+ */
+ GLboolean (*LinkShader)(struct gl_context *ctx, struct gl_shader_program *shader);
+ /*@}*/
+
+ /**
+ * \name State-changing functions.
+ *
+ * \note drawing functions are above.
+ *
+ * These functions are called by their corresponding OpenGL API functions.
+ * They are \e also called by the gl_PopAttrib() function!!!
+ * May add more functions like these to the device driver in the future.
+ */
+ /*@{*/
+ /** Specify the alpha test function */
+ void (*AlphaFunc)(struct gl_context *ctx, GLenum func, GLfloat ref);
+ /** Set the blend color */
+ void (*BlendColor)(struct gl_context *ctx, const GLfloat color[4]);
+ /** Set the blend equation */
+ void (*BlendEquationSeparate)(struct gl_context *ctx, GLenum modeRGB, GLenum modeA);
+ void (*BlendEquationSeparatei)(struct gl_context *ctx, GLuint buffer,
+ GLenum modeRGB, GLenum modeA);
+ /** Specify pixel arithmetic */
+ void (*BlendFuncSeparate)(struct gl_context *ctx,
+ GLenum sfactorRGB, GLenum dfactorRGB,
+ GLenum sfactorA, GLenum dfactorA);
+ void (*BlendFuncSeparatei)(struct gl_context *ctx, GLuint buffer,
+ GLenum sfactorRGB, GLenum dfactorRGB,
+ GLenum sfactorA, GLenum dfactorA);
+ /** Specify clear values for the color buffers */
+ void (*ClearColor)(struct gl_context *ctx, const GLfloat color[4]);
+ /** Specify the clear value for the depth buffer */
+ void (*ClearDepth)(struct gl_context *ctx, GLclampd d);
+ /** Specify the clear value for the stencil buffer */
+ void (*ClearStencil)(struct gl_context *ctx, GLint s);
+ /** Specify a plane against which all geometry is clipped */
+ void (*ClipPlane)(struct gl_context *ctx, GLenum plane, const GLfloat *equation );
+ /** Enable and disable writing of frame buffer color components */
+ void (*ColorMask)(struct gl_context *ctx, GLboolean rmask, GLboolean gmask,
+ GLboolean bmask, GLboolean amask );
+ void (*ColorMaskIndexed)(struct gl_context *ctx, GLuint buf, GLboolean rmask,
+ GLboolean gmask, GLboolean bmask, GLboolean amask);
+ /** Cause a material color to track the current color */
+ void (*ColorMaterial)(struct gl_context *ctx, GLenum face, GLenum mode);
+ /** Specify whether front- or back-facing facets can be culled */
+ void (*CullFace)(struct gl_context *ctx, GLenum mode);
+ /** Define front- and back-facing polygons */
+ void (*FrontFace)(struct gl_context *ctx, GLenum mode);
+ /** Specify the value used for depth buffer comparisons */
+ void (*DepthFunc)(struct gl_context *ctx, GLenum func);
+ /** Enable or disable writing into the depth buffer */
+ void (*DepthMask)(struct gl_context *ctx, GLboolean flag);
+ /** Specify mapping of depth values from NDC to window coordinates */
+ void (*DepthRange)(struct gl_context *ctx, GLclampd nearval, GLclampd farval);
+ /** Specify the current buffer for writing */
+ void (*DrawBuffer)( struct gl_context *ctx, GLenum buffer );
+ /** Specify the buffers for writing for fragment programs*/
+ void (*DrawBuffers)( struct gl_context *ctx, GLsizei n, const GLenum *buffers );
+ /** Enable or disable server-side gl capabilities */
+ void (*Enable)(struct gl_context *ctx, GLenum cap, GLboolean state);
+ /** Specify fog parameters */
+ void (*Fogfv)(struct gl_context *ctx, GLenum pname, const GLfloat *params);
+ /** Specify implementation-specific hints */
+ void (*Hint)(struct gl_context *ctx, GLenum target, GLenum mode);
+ /** Set light source parameters.
+ * Note: for GL_POSITION and GL_SPOT_DIRECTION, params will have already
+ * been transformed to eye-space.
+ */
+ void (*Lightfv)(struct gl_context *ctx, GLenum light,
+ GLenum pname, const GLfloat *params );
+ /** Set the lighting model parameters */
+ void (*LightModelfv)(struct gl_context *ctx, GLenum pname, const GLfloat *params);
+ /** Specify the line stipple pattern */
+ void (*LineStipple)(struct gl_context *ctx, GLint factor, GLushort pattern );
+ /** Specify the width of rasterized lines */
+ void (*LineWidth)(struct gl_context *ctx, GLfloat width);
+ /** Specify a logical pixel operation for color index rendering */
+ void (*LogicOpcode)(struct gl_context *ctx, GLenum opcode);
+ void (*PointParameterfv)(struct gl_context *ctx, GLenum pname,
+ const GLfloat *params);
+ /** Specify the diameter of rasterized points */
+ void (*PointSize)(struct gl_context *ctx, GLfloat size);
+ /** Select a polygon rasterization mode */
+ void (*PolygonMode)(struct gl_context *ctx, GLenum face, GLenum mode);
+ /** Set the scale and units used to calculate depth values */
+ void (*PolygonOffset)(struct gl_context *ctx, GLfloat factor, GLfloat units);
+ /** Set the polygon stippling pattern */
+ void (*PolygonStipple)(struct gl_context *ctx, const GLubyte *mask );
+ /* Specifies the current buffer for reading */
+ void (*ReadBuffer)( struct gl_context *ctx, GLenum buffer );
+ /** Set rasterization mode */
+ void (*RenderMode)(struct gl_context *ctx, GLenum mode );
+ /** Define the scissor box */
+ void (*Scissor)(struct gl_context *ctx, GLint x, GLint y, GLsizei w, GLsizei h);
+ /** Select flat or smooth shading */
+ void (*ShadeModel)(struct gl_context *ctx, GLenum mode);
+ /** OpenGL 2.0 two-sided StencilFunc */
+ void (*StencilFuncSeparate)(struct gl_context *ctx, GLenum face, GLenum func,
+ GLint ref, GLuint mask);
+ /** OpenGL 2.0 two-sided StencilMask */
+ void (*StencilMaskSeparate)(struct gl_context *ctx, GLenum face, GLuint mask);
+ /** OpenGL 2.0 two-sided StencilOp */
+ void (*StencilOpSeparate)(struct gl_context *ctx, GLenum face, GLenum fail,
+ GLenum zfail, GLenum zpass);
+ /** Control the generation of texture coordinates */
+ void (*TexGen)(struct gl_context *ctx, GLenum coord, GLenum pname,
+ const GLfloat *params);
+ /** Set texture environment parameters */
+ void (*TexEnv)(struct gl_context *ctx, GLenum target, GLenum pname,
+ const GLfloat *param);
+ /** Set texture parameters */
+ void (*TexParameter)(struct gl_context *ctx, GLenum target,
+ struct gl_texture_object *texObj,
+ GLenum pname, const GLfloat *params);
+ /** Set the viewport */
+ void (*Viewport)(struct gl_context *ctx, GLint x, GLint y, GLsizei w, GLsizei h);
+ /*@}*/
+
+
+ /**
+ * \name Vertex/pixel buffer object functions
+ */
+ /*@{*/
+ void (*BindBuffer)( struct gl_context *ctx, GLenum target,
+ struct gl_buffer_object *obj );
+
+ struct gl_buffer_object * (*NewBufferObject)( struct gl_context *ctx, GLuint buffer,
+ GLenum target );
+
+ void (*DeleteBuffer)( struct gl_context *ctx, struct gl_buffer_object *obj );
+
+ GLboolean (*BufferData)( struct gl_context *ctx, GLenum target, GLsizeiptrARB size,
+ const GLvoid *data, GLenum usage,
+ struct gl_buffer_object *obj );
+
+ void (*BufferSubData)( struct gl_context *ctx, GLenum target, GLintptrARB offset,
+ GLsizeiptrARB size, const GLvoid *data,
+ struct gl_buffer_object *obj );
+
+ void (*GetBufferSubData)( struct gl_context *ctx, GLenum target,
+ GLintptrARB offset, GLsizeiptrARB size,
+ GLvoid *data, struct gl_buffer_object *obj );
+
+ void * (*MapBuffer)( struct gl_context *ctx, GLenum target, GLenum access,
+ struct gl_buffer_object *obj );
+
+ void (*CopyBufferSubData)( struct gl_context *ctx,
+ struct gl_buffer_object *src,
+ struct gl_buffer_object *dst,
+ GLintptr readOffset, GLintptr writeOffset,
+ GLsizeiptr size );
+
+ /* May return NULL if MESA_MAP_NOWAIT_BIT is set in access:
+ */
+ void * (*MapBufferRange)( struct gl_context *ctx, GLenum target, GLintptr offset,
+ GLsizeiptr length, GLbitfield access,
+ struct gl_buffer_object *obj);
+
+ void (*FlushMappedBufferRange)(struct gl_context *ctx, GLenum target,
+ GLintptr offset, GLsizeiptr length,
+ struct gl_buffer_object *obj);
+
+ GLboolean (*UnmapBuffer)( struct gl_context *ctx, GLenum target,
+ struct gl_buffer_object *obj );
+ /*@}*/
+
+ /**
+ * \name Functions for GL_APPLE_object_purgeable
+ */
+ /*@{*/
+ /* variations on ObjectPurgeable */
+ GLenum (*BufferObjectPurgeable)( struct gl_context *ctx, struct gl_buffer_object *obj, GLenum option );
+ GLenum (*RenderObjectPurgeable)( struct gl_context *ctx, struct gl_renderbuffer *obj, GLenum option );
+ GLenum (*TextureObjectPurgeable)( struct gl_context *ctx, struct gl_texture_object *obj, GLenum option );
+
+ /* variations on ObjectUnpurgeable */
+ GLenum (*BufferObjectUnpurgeable)( struct gl_context *ctx, struct gl_buffer_object *obj, GLenum option );
+ GLenum (*RenderObjectUnpurgeable)( struct gl_context *ctx, struct gl_renderbuffer *obj, GLenum option );
+ GLenum (*TextureObjectUnpurgeable)( struct gl_context *ctx, struct gl_texture_object *obj, GLenum option );
+ /*@}*/
+
+ /**
+ * \name Functions for GL_EXT_framebuffer_{object,blit}.
+ */
+ /*@{*/
+ struct gl_framebuffer * (*NewFramebuffer)(struct gl_context *ctx, GLuint name);
+ struct gl_renderbuffer * (*NewRenderbuffer)(struct gl_context *ctx, GLuint name);
+ void (*BindFramebuffer)(struct gl_context *ctx, GLenum target,
+ struct gl_framebuffer *drawFb,
+ struct gl_framebuffer *readFb);
+ void (*FramebufferRenderbuffer)(struct gl_context *ctx,
+ struct gl_framebuffer *fb,
+ GLenum attachment,
+ struct gl_renderbuffer *rb);
+ void (*RenderTexture)(struct gl_context *ctx,
+ struct gl_framebuffer *fb,
+ struct gl_renderbuffer_attachment *att);
+ void (*FinishRenderTexture)(struct gl_context *ctx,
+ struct gl_renderbuffer_attachment *att);
+ void (*ValidateFramebuffer)(struct gl_context *ctx,
+ struct gl_framebuffer *fb);
+ /*@}*/
+ void (*BlitFramebuffer)(struct gl_context *ctx,
+ GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1,
+ GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1,
+ GLbitfield mask, GLenum filter);
+
+ /**
+ * \name Query objects
+ */
+ /*@{*/
+ struct gl_query_object * (*NewQueryObject)(struct gl_context *ctx, GLuint id);
+ void (*DeleteQuery)(struct gl_context *ctx, struct gl_query_object *q);
+ void (*BeginQuery)(struct gl_context *ctx, struct gl_query_object *q);
+ void (*EndQuery)(struct gl_context *ctx, struct gl_query_object *q);
+ void (*CheckQuery)(struct gl_context *ctx, struct gl_query_object *q);
+ void (*WaitQuery)(struct gl_context *ctx, struct gl_query_object *q);
+ /*@}*/
+
+
+ /**
+ * \name Vertex Array objects
+ */
+ /*@{*/
+ struct gl_array_object * (*NewArrayObject)(struct gl_context *ctx, GLuint id);
+ void (*DeleteArrayObject)(struct gl_context *ctx, struct gl_array_object *obj);
+ void (*BindArrayObject)(struct gl_context *ctx, struct gl_array_object *obj);
+ /*@}*/
+
+ /**
+ * \name GLSL-related functions (ARB extensions and OpenGL 2.x)
+ */
+ /*@{*/
+ struct gl_shader *(*NewShader)(struct gl_context *ctx, GLuint name, GLenum type);
+ void (*DeleteShader)(struct gl_context *ctx, struct gl_shader *shader);
+ struct gl_shader_program *(*NewShaderProgram)(struct gl_context *ctx, GLuint name);
+ void (*DeleteShaderProgram)(struct gl_context *ctx,
+ struct gl_shader_program *shProg);
+ void (*UseProgram)(struct gl_context *ctx, struct gl_shader_program *shProg);
+ /*@}*/
+
+
+ /**
+ * \name Support for multiple T&L engines
+ */
+ /*@{*/
+
+ /**
+ * Bitmask of state changes that require the current T&L module to be
+ * validated, using ValidateTnlModule() below.
+ */
+ GLuint NeedValidate;
+
+ /**
+ * Validate the current T&L module.
+ *
+ * This is called directly after UpdateState() when a state change that has
+ * occurred matches the dd_function_table::NeedValidate bitmask above. This
+ * ensures all computed values are up to date, thus allowing the driver to
+ * decide if the current T&L module needs to be swapped out.
+ *
+ * This must be non-NULL if a driver installs a custom T&L module and sets
+ * the dd_function_table::NeedValidate bitmask, but may be NULL otherwise.
+ */
+ void (*ValidateTnlModule)( struct gl_context *ctx, GLuint new_state );
+
+ /**
+ * Set by the driver-supplied T&L engine.
+ *
+ * Set to PRIM_OUTSIDE_BEGIN_END when outside glBegin()/glEnd().
+ */
+ GLuint CurrentExecPrimitive;
+
+ /**
+ * Current state of an in-progress compilation.
+ *
+ * May take on any of the additional values PRIM_OUTSIDE_BEGIN_END,
+ * PRIM_INSIDE_UNKNOWN_PRIM or PRIM_UNKNOWN defined above.
+ */
+ GLuint CurrentSavePrimitive;
+
+
+#define FLUSH_STORED_VERTICES 0x1
+#define FLUSH_UPDATE_CURRENT 0x2
+ /**
+ * Set by the driver-supplied T&L engine whenever vertices are buffered
+ * between glBegin()/glEnd() objects or __struct gl_contextRec::Current is not
+ * updated.
+ *
+ * The dd_function_table::FlushVertices call below may be used to resolve
+ * these conditions.
+ */
+ GLuint NeedFlush;
+ GLuint SaveNeedFlush;
+
+
+ /* Called prior to any of the GLvertexformat functions being
+ * called. Paired with Driver.FlushVertices().
+ */
+ void (*BeginVertices)( struct gl_context *ctx );
+
+ /**
+ * If inside glBegin()/glEnd(), it should ASSERT(0). Otherwise, if
+ * FLUSH_STORED_VERTICES bit in \p flags is set flushes any buffered
+ * vertices, if FLUSH_UPDATE_CURRENT bit is set updates
+ * __struct gl_contextRec::Current and gl_light_attrib::Material
+ *
+ * Note that the default T&L engine never clears the
+ * FLUSH_UPDATE_CURRENT bit, even after performing the update.
+ */
+ void (*FlushVertices)( struct gl_context *ctx, GLuint flags );
+ void (*SaveFlushVertices)( struct gl_context *ctx );
+
+ /**
+ * Give the driver the opportunity to hook in its own vtxfmt for
+ * compiling optimized display lists. This is called on each valid
+ * glBegin() during list compilation.
+ */
+ GLboolean (*NotifySaveBegin)( struct gl_context *ctx, GLenum mode );
+
+ /**
+ * Notify driver that the special derived value _NeedEyeCoords has
+ * changed.
+ */
+ void (*LightingSpaceChange)( struct gl_context *ctx );
+
+ /**
+ * Called by glNewList().
+ *
+ * Let the T&L component know what is going on with display lists
+ * in time to make changes to dispatch tables, etc.
+ */
+ void (*NewList)( struct gl_context *ctx, GLuint list, GLenum mode );
+ /**
+ * Called by glEndList().
+ *
+ * \sa dd_function_table::NewList.
+ */
+ void (*EndList)( struct gl_context *ctx );
+
+ /**
+ * Called by glCallList(s).
+ *
+ * Notify the T&L component before and after calling a display list.
+ */
+ void (*BeginCallList)( struct gl_context *ctx,
+ struct gl_display_list *dlist );
+ /**
+ * Called by glEndCallList().
+ *
+ * \sa dd_function_table::BeginCallList.
+ */
+ void (*EndCallList)( struct gl_context *ctx );
+
+
+ /**
+ * \name GL_ARB_sync interfaces
+ */
+ /*@{*/
+ struct gl_sync_object * (*NewSyncObject)(struct gl_context *, GLenum);
+ void (*FenceSync)(struct gl_context *, struct gl_sync_object *, GLenum, GLbitfield);
+ void (*DeleteSyncObject)(struct gl_context *, struct gl_sync_object *);
+ void (*CheckSync)(struct gl_context *, struct gl_sync_object *);
+ void (*ClientWaitSync)(struct gl_context *, struct gl_sync_object *,
+ GLbitfield, GLuint64);
+ void (*ServerWaitSync)(struct gl_context *, struct gl_sync_object *,
+ GLbitfield, GLuint64);
+ /*@}*/
+
+ /** GL_NV_conditional_render */
+ void (*BeginConditionalRender)(struct gl_context *ctx, struct gl_query_object *q,
+ GLenum mode);
+ void (*EndConditionalRender)(struct gl_context *ctx, struct gl_query_object *q);
+
+ /**
+ * \name GL_OES_draw_texture interface
+ */
+ /*@{*/
+ void (*DrawTex)(struct gl_context *ctx, GLfloat x, GLfloat y, GLfloat z,
+ GLfloat width, GLfloat height);
+ /*@}*/
+
+ /**
+ * \name GL_OES_EGL_image interface
+ */
+ void (*EGLImageTargetTexture2D)(struct gl_context *ctx, GLenum target,
+ struct gl_texture_object *texObj,
+ struct gl_texture_image *texImage,
+ GLeglImageOES image_handle);
+ void (*EGLImageTargetRenderbufferStorage)(struct gl_context *ctx,
+ struct gl_renderbuffer *rb,
+ void *image_handle);
+
+ /**
+ * \name GL_EXT_transform_feedback interface
+ */
+ struct gl_transform_feedback_object *
+ (*NewTransformFeedback)(struct gl_context *ctx, GLuint name);
+ void (*DeleteTransformFeedback)(struct gl_context *ctx,
+ struct gl_transform_feedback_object *obj);
+ void (*BeginTransformFeedback)(struct gl_context *ctx, GLenum mode,
+ struct gl_transform_feedback_object *obj);
+ void (*EndTransformFeedback)(struct gl_context *ctx,
+ struct gl_transform_feedback_object *obj);
+ void (*PauseTransformFeedback)(struct gl_context *ctx,
+ struct gl_transform_feedback_object *obj);
+ void (*ResumeTransformFeedback)(struct gl_context *ctx,
+ struct gl_transform_feedback_object *obj);
+ void (*DrawTransformFeedback)(struct gl_context *ctx, GLenum mode,
+ struct gl_transform_feedback_object *obj);
+
+ /**
+ * \name GL_NV_texture_barrier interface
+ */
+ void (*TextureBarrier)(struct gl_context *ctx);
+
+ /**
+ * \name GL_ARB_sampler_objects
+ */
+ struct gl_sampler_object * (*NewSamplerObject)(struct gl_context *ctx,
+ GLuint name);
+ void (*DeleteSamplerObject)(struct gl_context *ctx,
+ struct gl_sampler_object *samp);
+};
+
+
+/**
+ * Transform/Clip/Lighting interface
+ *
+ * Drivers present a reduced set of the functions possible in
+ * glBegin()/glEnd() objects. Core mesa provides translation stubs for the
+ * remaining functions to map down to these entry points.
+ *
+ * These are the initial values to be installed into dispatch by
+ * mesa. If the T&L driver wants to modify the dispatch table
+ * while installed, it must do so itself. It would be possible for
+ * the vertexformat to install its own initial values for these
+ * functions, but this way there is an obvious list of what is
+ * expected of the driver.
+ *
+ * If the driver wants to hook in entry points other than those
+ * listed, it must restore them to their original values in
+ * the disable() callback, below.
+ */
+typedef struct {
+ /**
+ * \name Vertex
+ */
+ /*@{*/
+ void (GLAPIENTRYP ArrayElement)( GLint );
+ void (GLAPIENTRYP Color3f)( GLfloat, GLfloat, GLfloat );
+ void (GLAPIENTRYP Color3fv)( const GLfloat * );
+ void (GLAPIENTRYP Color4f)( GLfloat, GLfloat, GLfloat, GLfloat );
+ void (GLAPIENTRYP Color4fv)( const GLfloat * );
+ void (GLAPIENTRYP EdgeFlag)( GLboolean );
+ void (GLAPIENTRYP EvalCoord1f)( GLfloat );
+ void (GLAPIENTRYP EvalCoord1fv)( const GLfloat * );
+ void (GLAPIENTRYP EvalCoord2f)( GLfloat, GLfloat );
+ void (GLAPIENTRYP EvalCoord2fv)( const GLfloat * );
+ void (GLAPIENTRYP EvalPoint1)( GLint );
+ void (GLAPIENTRYP EvalPoint2)( GLint, GLint );
+ void (GLAPIENTRYP FogCoordfEXT)( GLfloat );
+ void (GLAPIENTRYP FogCoordfvEXT)( const GLfloat * );
+ void (GLAPIENTRYP Indexf)( GLfloat );
+ void (GLAPIENTRYP Indexfv)( const GLfloat * );
+ void (GLAPIENTRYP Materialfv)( GLenum face, GLenum pname, const GLfloat * );
+ void (GLAPIENTRYP MultiTexCoord1fARB)( GLenum, GLfloat );
+ void (GLAPIENTRYP MultiTexCoord1fvARB)( GLenum, const GLfloat * );
+ void (GLAPIENTRYP MultiTexCoord2fARB)( GLenum, GLfloat, GLfloat );
+ void (GLAPIENTRYP MultiTexCoord2fvARB)( GLenum, const GLfloat * );
+ void (GLAPIENTRYP MultiTexCoord3fARB)( GLenum, GLfloat, GLfloat, GLfloat );
+ void (GLAPIENTRYP MultiTexCoord3fvARB)( GLenum, const GLfloat * );
+ void (GLAPIENTRYP MultiTexCoord4fARB)( GLenum, GLfloat, GLfloat, GLfloat, GLfloat );
+ void (GLAPIENTRYP MultiTexCoord4fvARB)( GLenum, const GLfloat * );
+ void (GLAPIENTRYP Normal3f)( GLfloat, GLfloat, GLfloat );
+ void (GLAPIENTRYP Normal3fv)( const GLfloat * );
+ void (GLAPIENTRYP SecondaryColor3fEXT)( GLfloat, GLfloat, GLfloat );
+ void (GLAPIENTRYP SecondaryColor3fvEXT)( const GLfloat * );
+ void (GLAPIENTRYP TexCoord1f)( GLfloat );
+ void (GLAPIENTRYP TexCoord1fv)( const GLfloat * );
+ void (GLAPIENTRYP TexCoord2f)( GLfloat, GLfloat );
+ void (GLAPIENTRYP TexCoord2fv)( const GLfloat * );
+ void (GLAPIENTRYP TexCoord3f)( GLfloat, GLfloat, GLfloat );
+ void (GLAPIENTRYP TexCoord3fv)( const GLfloat * );
+ void (GLAPIENTRYP TexCoord4f)( GLfloat, GLfloat, GLfloat, GLfloat );
+ void (GLAPIENTRYP TexCoord4fv)( const GLfloat * );
+ void (GLAPIENTRYP Vertex2f)( GLfloat, GLfloat );
+ void (GLAPIENTRYP Vertex2fv)( const GLfloat * );
+ void (GLAPIENTRYP Vertex3f)( GLfloat, GLfloat, GLfloat );
+ void (GLAPIENTRYP Vertex3fv)( const GLfloat * );
+ void (GLAPIENTRYP Vertex4f)( GLfloat, GLfloat, GLfloat, GLfloat );
+ void (GLAPIENTRYP Vertex4fv)( const GLfloat * );
+ void (GLAPIENTRYP CallList)( GLuint );
+ void (GLAPIENTRYP CallLists)( GLsizei, GLenum, const GLvoid * );
+ void (GLAPIENTRYP Begin)( GLenum );
+ void (GLAPIENTRYP End)( void );
+ void (GLAPIENTRYP PrimitiveRestartNV)( void );
+ /* GL_NV_vertex_program */
+ void (GLAPIENTRYP VertexAttrib1fNV)( GLuint index, GLfloat x );
+ void (GLAPIENTRYP VertexAttrib1fvNV)( GLuint index, const GLfloat *v );
+ void (GLAPIENTRYP VertexAttrib2fNV)( GLuint index, GLfloat x, GLfloat y );
+ void (GLAPIENTRYP VertexAttrib2fvNV)( GLuint index, const GLfloat *v );
+ void (GLAPIENTRYP VertexAttrib3fNV)( GLuint index, GLfloat x, GLfloat y, GLfloat z );
+ void (GLAPIENTRYP VertexAttrib3fvNV)( GLuint index, const GLfloat *v );
+ void (GLAPIENTRYP VertexAttrib4fNV)( GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w );
+ void (GLAPIENTRYP VertexAttrib4fvNV)( GLuint index, const GLfloat *v );
+ /* GL_ARB_vertex_program */
+ void (GLAPIENTRYP VertexAttrib1fARB)( GLuint index, GLfloat x );
+ void (GLAPIENTRYP VertexAttrib1fvARB)( GLuint index, const GLfloat *v );
+ void (GLAPIENTRYP VertexAttrib2fARB)( GLuint index, GLfloat x, GLfloat y );
+ void (GLAPIENTRYP VertexAttrib2fvARB)( GLuint index, const GLfloat *v );
+ void (GLAPIENTRYP VertexAttrib3fARB)( GLuint index, GLfloat x, GLfloat y, GLfloat z );
+ void (GLAPIENTRYP VertexAttrib3fvARB)( GLuint index, const GLfloat *v );
+ void (GLAPIENTRYP VertexAttrib4fARB)( GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w );
+ void (GLAPIENTRYP VertexAttrib4fvARB)( GLuint index, const GLfloat *v );
+
+ /* GL_EXT_gpu_shader4 / GL 3.0 */
+ void (GLAPIENTRYP VertexAttribI1i)( GLuint index, GLint x);
+ void (GLAPIENTRYP VertexAttribI2i)( GLuint index, GLint x, GLint y);
+ void (GLAPIENTRYP VertexAttribI3i)( GLuint index, GLint x, GLint y, GLint z);
+ void (GLAPIENTRYP VertexAttribI4i)( GLuint index, GLint x, GLint y, GLint z, GLint w);
+ void (GLAPIENTRYP VertexAttribI2iv)( GLuint index, const GLint *v);
+ void (GLAPIENTRYP VertexAttribI3iv)( GLuint index, const GLint *v);
+ void (GLAPIENTRYP VertexAttribI4iv)( GLuint index, const GLint *v);
+
+ void (GLAPIENTRYP VertexAttribI1ui)( GLuint index, GLuint x);
+ void (GLAPIENTRYP VertexAttribI2ui)( GLuint index, GLuint x, GLuint y);
+ void (GLAPIENTRYP VertexAttribI3ui)( GLuint index, GLuint x, GLuint y, GLuint z);
+ void (GLAPIENTRYP VertexAttribI4ui)( GLuint index, GLuint x, GLuint y, GLuint z, GLuint w);
+ void (GLAPIENTRYP VertexAttribI2uiv)( GLuint index, const GLuint *v);
+ void (GLAPIENTRYP VertexAttribI3uiv)( GLuint index, const GLuint *v);
+ void (GLAPIENTRYP VertexAttribI4uiv)( GLuint index, const GLuint *v);
+
+ /*@}*/
+
+ void (GLAPIENTRYP Rectf)( GLfloat, GLfloat, GLfloat, GLfloat );
+
+ /**
+ * \name Array
+ */
+ /*@{*/
+ void (GLAPIENTRYP DrawArrays)( GLenum mode, GLint start, GLsizei count );
+ void (GLAPIENTRYP DrawElements)( GLenum mode, GLsizei count, GLenum type,
+ const GLvoid *indices );
+ void (GLAPIENTRYP DrawRangeElements)( GLenum mode, GLuint start,
+ GLuint end, GLsizei count,
+ GLenum type, const GLvoid *indices );
+ void (GLAPIENTRYP MultiDrawElementsEXT)( GLenum mode, const GLsizei *count,
+ GLenum type,
+ const GLvoid **indices,
+ GLsizei primcount);
+ void (GLAPIENTRYP DrawElementsBaseVertex)( GLenum mode, GLsizei count,
+ GLenum type,
+ const GLvoid *indices,
+ GLint basevertex );
+ void (GLAPIENTRYP DrawRangeElementsBaseVertex)( GLenum mode, GLuint start,
+ GLuint end, GLsizei count,
+ GLenum type,
+ const GLvoid *indices,
+ GLint basevertex);
+ void (GLAPIENTRYP MultiDrawElementsBaseVertex)( GLenum mode,
+ const GLsizei *count,
+ GLenum type,
+ const GLvoid **indices,
+ GLsizei primcount,
+ const GLint *basevertex);
+ void (GLAPIENTRYP DrawArraysInstanced)(GLenum mode, GLint first,
+ GLsizei count, GLsizei primcount);
+ void (GLAPIENTRYP DrawElementsInstanced)(GLenum mode, GLsizei count,
+ GLenum type, const GLvoid *indices,
+ GLsizei primcount);
+ /*@}*/
+
+ /**
+ * \name Eval
+ *
+ * If you don't support eval, fallback to the default vertex format
+ * on receiving an eval call and use the pipeline mechanism to
+ * provide partial T&L acceleration.
+ *
+ * Mesa will provide a set of helper functions to do eval within
+ * accelerated vertex formats, eventually...
+ */
+ /*@{*/
+ void (GLAPIENTRYP EvalMesh1)( GLenum mode, GLint i1, GLint i2 );
+ void (GLAPIENTRYP EvalMesh2)( GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2 );
+ /*@}*/
+
+} GLvertexformat;
+
+
+#endif /* DD_INCLUDED */
diff --git a/mesalib/src/mesa/main/debug.h b/mesalib/src/mesa/main/debug.h
index d7c53b655..eda377abb 100644
--- a/mesalib/src/mesa/main/debug.h
+++ b/mesalib/src/mesa/main/debug.h
@@ -1,94 +1,94 @@
-/*
- * Mesa 3-D graphics library
- * Version: 6.1
- *
- * Copyright (C) 1999-2004 Brian Paul All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-/**
- * \file debug.h
- * Debugging functions.
- *
- * \if subset
- * (No-op)
- *
- * \endif
- */
-
-
-#ifndef _DEBUG_H
-#define _DEBUG_H
-
-#include "glheader.h"
-#include "mfeatures.h"
-
-struct gl_context;
-struct gl_texture_image;
-
-#if _HAVE_FULL_GL
-
-extern void _mesa_print_tri_caps( const char *name, GLuint flags );
-extern void _mesa_print_enable_flags( const char *msg, GLuint flags );
-extern void _mesa_print_state( const char *msg, GLuint state );
-extern void _mesa_print_info( void );
-extern void _mesa_init_debug( struct gl_context *ctx );
-
-#else
-
-/** No-op */
-#define _mesa_print_state( m, s ) ((void)0)
-
-/** No-op */
-#define _mesa_print_info() ((void)0)
-
-/** No-op */
-#define _mesa_init_debug( c ) ((void)0)
-
-#endif
-
-extern void
-_mesa_write_renderbuffer_image(const struct gl_renderbuffer *rb);
-
-extern void
-_mesa_dump_texture(GLuint texture, GLuint writeImages);
-
-extern void
-_mesa_dump_textures(GLuint writeImages);
-
-extern void
-_mesa_dump_renderbuffers(GLboolean writeImages);
-
-extern void
-_mesa_dump_color_buffer(const char *filename);
-
-extern void
-_mesa_dump_depth_buffer(const char *filename);
-
-extern void
-_mesa_dump_stencil_buffer(const char *filename);
-
-extern void
-_mesa_dump_image(const char *filename, const void *image, GLuint w, GLuint h,
- GLenum format, GLenum type);
-
-extern void
-_mesa_print_texture(struct gl_context *ctx, const struct gl_texture_image *img);
-
-#endif
+/*
+ * Mesa 3-D graphics library
+ * Version: 6.1
+ *
+ * Copyright (C) 1999-2004 Brian Paul All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+/**
+ * \file debug.h
+ * Debugging functions.
+ *
+ * \if subset
+ * (No-op)
+ *
+ * \endif
+ */
+
+
+#ifndef _DEBUG_H
+#define _DEBUG_H
+
+#include "glheader.h"
+#include "mfeatures.h"
+
+struct gl_context;
+struct gl_texture_image;
+
+#if _HAVE_FULL_GL
+
+extern void _mesa_print_tri_caps( const char *name, GLuint flags );
+extern void _mesa_print_enable_flags( const char *msg, GLuint flags );
+extern void _mesa_print_state( const char *msg, GLuint state );
+extern void _mesa_print_info( void );
+extern void _mesa_init_debug( struct gl_context *ctx );
+
+#else
+
+/** No-op */
+#define _mesa_print_state( m, s ) ((void)0)
+
+/** No-op */
+#define _mesa_print_info() ((void)0)
+
+/** No-op */
+#define _mesa_init_debug( c ) ((void)0)
+
+#endif
+
+extern void
+_mesa_write_renderbuffer_image(const struct gl_renderbuffer *rb);
+
+extern void
+_mesa_dump_texture(GLuint texture, GLuint writeImages);
+
+extern void
+_mesa_dump_textures(GLuint writeImages);
+
+extern void
+_mesa_dump_renderbuffers(GLboolean writeImages);
+
+extern void
+_mesa_dump_color_buffer(const char *filename);
+
+extern void
+_mesa_dump_depth_buffer(const char *filename);
+
+extern void
+_mesa_dump_stencil_buffer(const char *filename);
+
+extern void
+_mesa_dump_image(const char *filename, const void *image, GLuint w, GLuint h,
+ GLenum format, GLenum type);
+
+extern void
+_mesa_print_texture(struct gl_context *ctx, const struct gl_texture_image *img);
+
+#endif
diff --git a/mesalib/src/mesa/main/depth.c b/mesalib/src/mesa/main/depth.c
index 52c69a6bc..d666ed5fe 100644
--- a/mesalib/src/mesa/main/depth.c
+++ b/mesalib/src/mesa/main/depth.c
@@ -1,174 +1,174 @@
-/*
- * Mesa 3-D graphics library
- * Version: 7.1
- *
- * Copyright (C) 1999-2007 Brian Paul All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-
-#include "glheader.h"
-#include "imports.h"
-#include "context.h"
-#include "depth.h"
-#include "enums.h"
-#include "macros.h"
-#include "mtypes.h"
-
-
-/**********************************************************************/
-/***** API Functions *****/
-/**********************************************************************/
-
-
-
-void GLAPIENTRY
-_mesa_ClearDepth( GLclampd depth )
-{
- GET_CURRENT_CONTEXT(ctx);
- ASSERT_OUTSIDE_BEGIN_END(ctx);
-
- if (MESA_VERBOSE & VERBOSE_API)
- _mesa_debug(ctx, "glClearDepth(%f)\n", depth);
-
- depth = CLAMP( depth, 0.0, 1.0 );
-
- if (ctx->Depth.Clear == depth)
- return;
-
- FLUSH_VERTICES(ctx, _NEW_DEPTH);
- ctx->Depth.Clear = depth;
- if (ctx->Driver.ClearDepth)
- (*ctx->Driver.ClearDepth)( ctx, ctx->Depth.Clear );
-}
-
-
-void GLAPIENTRY
-_mesa_ClearDepthf( GLclampf depth )
-{
- _mesa_ClearDepth(depth);
-}
-
-
-void GLAPIENTRY
-_mesa_DepthFunc( GLenum func )
-{
- GET_CURRENT_CONTEXT(ctx);
- ASSERT_OUTSIDE_BEGIN_END(ctx);
-
- if (MESA_VERBOSE & VERBOSE_API)
- _mesa_debug(ctx, "glDepthFunc %s\n", _mesa_lookup_enum_by_nr(func));
-
- switch (func) {
- case GL_LESS: /* (default) pass if incoming z < stored z */
- case GL_GEQUAL:
- case GL_LEQUAL:
- case GL_GREATER:
- case GL_NOTEQUAL:
- case GL_EQUAL:
- case GL_ALWAYS:
- case GL_NEVER:
- break;
- default:
- _mesa_error( ctx, GL_INVALID_ENUM, "glDepth.Func" );
- return;
- }
-
- if (ctx->Depth.Func == func)
- return;
-
- FLUSH_VERTICES(ctx, _NEW_DEPTH);
- ctx->Depth.Func = func;
-
- if (ctx->Driver.DepthFunc)
- ctx->Driver.DepthFunc( ctx, func );
-}
-
-
-
-void GLAPIENTRY
-_mesa_DepthMask( GLboolean flag )
-{
- GET_CURRENT_CONTEXT(ctx);
- ASSERT_OUTSIDE_BEGIN_END(ctx);
-
- if (MESA_VERBOSE & VERBOSE_API)
- _mesa_debug(ctx, "glDepthMask %d\n", flag);
-
- /*
- * GL_TRUE indicates depth buffer writing is enabled (default)
- * GL_FALSE indicates depth buffer writing is disabled
- */
- if (ctx->Depth.Mask == flag)
- return;
-
- FLUSH_VERTICES(ctx, _NEW_DEPTH);
- ctx->Depth.Mask = flag;
-
- if (ctx->Driver.DepthMask)
- ctx->Driver.DepthMask( ctx, flag );
-}
-
-
-
-/**
- * Specified by the GL_EXT_depth_bounds_test extension.
- */
-void GLAPIENTRY
-_mesa_DepthBoundsEXT( GLclampd zmin, GLclampd zmax )
-{
- GET_CURRENT_CONTEXT(ctx);
- ASSERT_OUTSIDE_BEGIN_END(ctx);
-
- if (MESA_VERBOSE & VERBOSE_API)
- _mesa_debug(ctx, "glDepthBounds(%f, %f)\n", zmin, zmax);
-
- if (zmin > zmax) {
- _mesa_error(ctx, GL_INVALID_VALUE, "glDepthBoundsEXT(zmin > zmax)");
- return;
- }
-
- zmin = CLAMP(zmin, 0.0, 1.0);
- zmax = CLAMP(zmax, 0.0, 1.0);
-
- if (ctx->Depth.BoundsMin == zmin && ctx->Depth.BoundsMax == zmax)
- return;
-
- FLUSH_VERTICES(ctx, _NEW_DEPTH);
- ctx->Depth.BoundsMin = (GLfloat) zmin;
- ctx->Depth.BoundsMax = (GLfloat) zmax;
-}
-
-
-/**********************************************************************/
-/***** Initialization *****/
-/**********************************************************************/
-
-
-/**
- * Initialize the depth buffer attribute group in the given context.
- */
-void
-_mesa_init_depth(struct gl_context *ctx)
-{
- ctx->Depth.Test = GL_FALSE;
- ctx->Depth.Clear = 1.0;
- ctx->Depth.Func = GL_LESS;
- ctx->Depth.Mask = GL_TRUE;
-}
+/*
+ * Mesa 3-D graphics library
+ * Version: 7.1
+ *
+ * Copyright (C) 1999-2007 Brian Paul All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+
+#include "glheader.h"
+#include "imports.h"
+#include "context.h"
+#include "depth.h"
+#include "enums.h"
+#include "macros.h"
+#include "mtypes.h"
+
+
+/**********************************************************************/
+/***** API Functions *****/
+/**********************************************************************/
+
+
+
+void GLAPIENTRY
+_mesa_ClearDepth( GLclampd depth )
+{
+ GET_CURRENT_CONTEXT(ctx);
+ ASSERT_OUTSIDE_BEGIN_END(ctx);
+
+ if (MESA_VERBOSE & VERBOSE_API)
+ _mesa_debug(ctx, "glClearDepth(%f)\n", depth);
+
+ depth = CLAMP( depth, 0.0, 1.0 );
+
+ if (ctx->Depth.Clear == depth)
+ return;
+
+ FLUSH_VERTICES(ctx, _NEW_DEPTH);
+ ctx->Depth.Clear = depth;
+ if (ctx->Driver.ClearDepth)
+ (*ctx->Driver.ClearDepth)( ctx, ctx->Depth.Clear );
+}
+
+
+void GLAPIENTRY
+_mesa_ClearDepthf( GLclampf depth )
+{
+ _mesa_ClearDepth(depth);
+}
+
+
+void GLAPIENTRY
+_mesa_DepthFunc( GLenum func )
+{
+ GET_CURRENT_CONTEXT(ctx);
+ ASSERT_OUTSIDE_BEGIN_END(ctx);
+
+ if (MESA_VERBOSE & VERBOSE_API)
+ _mesa_debug(ctx, "glDepthFunc %s\n", _mesa_lookup_enum_by_nr(func));
+
+ switch (func) {
+ case GL_LESS: /* (default) pass if incoming z < stored z */
+ case GL_GEQUAL:
+ case GL_LEQUAL:
+ case GL_GREATER:
+ case GL_NOTEQUAL:
+ case GL_EQUAL:
+ case GL_ALWAYS:
+ case GL_NEVER:
+ break;
+ default:
+ _mesa_error( ctx, GL_INVALID_ENUM, "glDepth.Func" );
+ return;
+ }
+
+ if (ctx->Depth.Func == func)
+ return;
+
+ FLUSH_VERTICES(ctx, _NEW_DEPTH);
+ ctx->Depth.Func = func;
+
+ if (ctx->Driver.DepthFunc)
+ ctx->Driver.DepthFunc( ctx, func );
+}
+
+
+
+void GLAPIENTRY
+_mesa_DepthMask( GLboolean flag )
+{
+ GET_CURRENT_CONTEXT(ctx);
+ ASSERT_OUTSIDE_BEGIN_END(ctx);
+
+ if (MESA_VERBOSE & VERBOSE_API)
+ _mesa_debug(ctx, "glDepthMask %d\n", flag);
+
+ /*
+ * GL_TRUE indicates depth buffer writing is enabled (default)
+ * GL_FALSE indicates depth buffer writing is disabled
+ */
+ if (ctx->Depth.Mask == flag)
+ return;
+
+ FLUSH_VERTICES(ctx, _NEW_DEPTH);
+ ctx->Depth.Mask = flag;
+
+ if (ctx->Driver.DepthMask)
+ ctx->Driver.DepthMask( ctx, flag );
+}
+
+
+
+/**
+ * Specified by the GL_EXT_depth_bounds_test extension.
+ */
+void GLAPIENTRY
+_mesa_DepthBoundsEXT( GLclampd zmin, GLclampd zmax )
+{
+ GET_CURRENT_CONTEXT(ctx);
+ ASSERT_OUTSIDE_BEGIN_END(ctx);
+
+ if (MESA_VERBOSE & VERBOSE_API)
+ _mesa_debug(ctx, "glDepthBounds(%f, %f)\n", zmin, zmax);
+
+ if (zmin > zmax) {
+ _mesa_error(ctx, GL_INVALID_VALUE, "glDepthBoundsEXT(zmin > zmax)");
+ return;
+ }
+
+ zmin = CLAMP(zmin, 0.0, 1.0);
+ zmax = CLAMP(zmax, 0.0, 1.0);
+
+ if (ctx->Depth.BoundsMin == zmin && ctx->Depth.BoundsMax == zmax)
+ return;
+
+ FLUSH_VERTICES(ctx, _NEW_DEPTH);
+ ctx->Depth.BoundsMin = (GLfloat) zmin;
+ ctx->Depth.BoundsMax = (GLfloat) zmax;
+}
+
+
+/**********************************************************************/
+/***** Initialization *****/
+/**********************************************************************/
+
+
+/**
+ * Initialize the depth buffer attribute group in the given context.
+ */
+void
+_mesa_init_depth(struct gl_context *ctx)
+{
+ ctx->Depth.Test = GL_FALSE;
+ ctx->Depth.Clear = 1.0;
+ ctx->Depth.Func = GL_LESS;
+ ctx->Depth.Mask = GL_TRUE;
+}
diff --git a/mesalib/src/mesa/main/depthstencil.c b/mesalib/src/mesa/main/depthstencil.c
index ab62c97fe..0ce5a19f7 100644
--- a/mesalib/src/mesa/main/depthstencil.c
+++ b/mesalib/src/mesa/main/depthstencil.c
@@ -1,835 +1,835 @@
-/*
- * Mesa 3-D graphics library
- * Version: 6.5
- *
- * Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-#include "glheader.h"
-#include "imports.h"
-#include "context.h"
-#include "formats.h"
-#include "mtypes.h"
-#include "depthstencil.h"
-#include "renderbuffer.h"
-
-
-/**
- * Adaptor/wrappers for GL_DEPTH_STENCIL renderbuffers.
- *
- * The problem with a GL_DEPTH_STENCIL renderbuffer is that sometimes we
- * want to treat it as a stencil buffer, other times we want to treat it
- * as a depth/z buffer and still other times when we want to treat it as
- * a combined Z+stencil buffer! That implies we need three different sets
- * of Get/Put functions.
- *
- * We solve this by wrapping the Z24_S8 or S8_Z24 renderbuffer with depth and
- * stencil adaptors, each with the right kind of depth/stencil Get/Put functions.
- */
-
-
-static void *
-nop_get_pointer(struct gl_context *ctx, struct gl_renderbuffer *rb, GLint x, GLint y)
-{
- (void) ctx;
- (void) rb;
- (void) x;
- (void) y;
- return NULL;
-}
-
-
-/**
- * Delete a depth or stencil wrapper renderbuffer.
- */
-static void
-delete_wrapper(struct gl_renderbuffer *rb)
-{
- ASSERT(rb->Format == MESA_FORMAT_S8 ||
- rb->Format == MESA_FORMAT_X8_Z24);
- _mesa_reference_renderbuffer(&rb->Wrapped, NULL);
- free(rb);
-}
-
-
-/**
- * Realloc storage for wrapper.
- */
-static GLboolean
-alloc_wrapper_storage(struct gl_context *ctx, struct gl_renderbuffer *rb,
- GLenum internalFormat, GLuint width, GLuint height)
-{
- /* just pass this on to the wrapped renderbuffer */
- struct gl_renderbuffer *dsrb = rb->Wrapped;
- GLboolean retVal;
-
- (void) internalFormat;
-
- ASSERT(dsrb->Format == MESA_FORMAT_Z24_S8 ||
- dsrb->Format == MESA_FORMAT_Z24_X8 ||
- dsrb->Format == MESA_FORMAT_S8_Z24 ||
- dsrb->Format == MESA_FORMAT_X8_Z24);
-
- retVal = dsrb->AllocStorage(ctx, dsrb, dsrb->InternalFormat, width, height);
- if (retVal) {
- rb->Width = width;
- rb->Height = height;
- rb->RowStride = dsrb->RowStride;
- }
- return retVal;
-}
-
-
-
-
-/*======================================================================
- * Depth wrapper around depth/stencil renderbuffer
- */
-
-static void
-get_row_z24(struct gl_context *ctx, struct gl_renderbuffer *z24rb, GLuint count,
- GLint x, GLint y, void *values)
-{
- struct gl_renderbuffer *dsrb = z24rb->Wrapped;
- GLuint temp[MAX_WIDTH], i;
- GLuint *dst = (GLuint *) values;
- const GLuint *src = (const GLuint *) dsrb->GetPointer(ctx, dsrb, x, y);
- ASSERT(z24rb->DataType == GL_UNSIGNED_INT);
- ASSERT(dsrb->DataType == GL_UNSIGNED_INT_24_8_EXT);
- if (!src) {
- dsrb->GetRow(ctx, dsrb, count, x, y, temp);
- src = temp;
- }
- if (dsrb->Format == MESA_FORMAT_Z24_S8) {
- for (i = 0; i < count; i++) {
- dst[i] = src[i] >> 8;
- }
- }
- else {
- assert(dsrb->Format == MESA_FORMAT_S8_Z24);
- for (i = 0; i < count; i++) {
- dst[i] = src[i] & 0xffffff;
- }
- }
-}
-
-static void
-get_values_z24(struct gl_context *ctx, struct gl_renderbuffer *z24rb, GLuint count,
- const GLint x[], const GLint y[], void *values)
-{
- struct gl_renderbuffer *dsrb = z24rb->Wrapped;
- GLuint temp[MAX_WIDTH], i;
- GLuint *dst = (GLuint *) values;
- ASSERT(z24rb->DataType == GL_UNSIGNED_INT);
- ASSERT(dsrb->DataType == GL_UNSIGNED_INT_24_8_EXT);
- ASSERT(count <= MAX_WIDTH);
- /* don't bother trying direct access */
- dsrb->GetValues(ctx, dsrb, count, x, y, temp);
- if (dsrb->Format == MESA_FORMAT_Z24_S8) {
- for (i = 0; i < count; i++) {
- dst[i] = temp[i] >> 8;
- }
- }
- else {
- assert(dsrb->Format == MESA_FORMAT_S8_Z24);
- for (i = 0; i < count; i++) {
- dst[i] = temp[i] & 0xffffff;
- }
- }
-}
-
-static void
-put_row_z24(struct gl_context *ctx, struct gl_renderbuffer *z24rb, GLuint count,
- GLint x, GLint y, const void *values, const GLubyte *mask)
-{
- struct gl_renderbuffer *dsrb = z24rb->Wrapped;
- const GLuint *src = (const GLuint *) values;
- GLuint *dst = (GLuint *) dsrb->GetPointer(ctx, dsrb, x, y);
- ASSERT(z24rb->DataType == GL_UNSIGNED_INT);
- ASSERT(dsrb->DataType == GL_UNSIGNED_INT_24_8_EXT);
- if (dst) {
- /* direct access */
- GLuint i;
- if (dsrb->Format == MESA_FORMAT_Z24_S8) {
- for (i = 0; i < count; i++) {
- if (!mask || mask[i]) {
- dst[i] = (src[i] << 8) | (dst[i] & 0xff);
- }
- }
- }
- else {
- assert(dsrb->Format == MESA_FORMAT_S8_Z24);
- for (i = 0; i < count; i++) {
- if (!mask || mask[i]) {
- dst[i] = (src[i] & 0xffffff) | (dst[i] & 0xff000000);
- }
- }
- }
- }
- else {
- /* get, modify, put */
- GLuint temp[MAX_WIDTH], i;
- dsrb->GetRow(ctx, dsrb, count, x, y, temp);
- if (dsrb->Format == MESA_FORMAT_Z24_S8) {
- for (i = 0; i < count; i++) {
- if (!mask || mask[i]) {
- temp[i] = (src[i] << 8) | (temp[i] & 0xff);
- }
- }
- }
- else {
- assert(dsrb->Format == MESA_FORMAT_S8_Z24);
- for (i = 0; i < count; i++) {
- if (!mask || mask[i]) {
- temp[i] = (src[i] & 0xffffff) | (temp[i] & 0xff000000);
- }
- }
- }
- dsrb->PutRow(ctx, dsrb, count, x, y, temp, mask);
- }
-}
-
-static void
-put_mono_row_z24(struct gl_context *ctx, struct gl_renderbuffer *z24rb, GLuint count,
- GLint x, GLint y, const void *value, const GLubyte *mask)
-{
- struct gl_renderbuffer *dsrb = z24rb->Wrapped;
- GLuint *dst = (GLuint *) dsrb->GetPointer(ctx, dsrb, x, y);
- ASSERT(z24rb->DataType == GL_UNSIGNED_INT);
- ASSERT(dsrb->DataType == GL_UNSIGNED_INT_24_8_EXT);
- if (dst) {
- /* direct access */
- GLuint i;
- if (dsrb->Format == MESA_FORMAT_Z24_S8) {
- const GLuint shiftedVal = *((GLuint *) value) << 8;
- for (i = 0; i < count; i++) {
- if (!mask || mask[i]) {
- dst[i] = shiftedVal | (dst[i] & 0xff);
- }
- }
- }
- else {
- const GLuint shiftedVal = *((GLuint *) value);
- assert(dsrb->Format == MESA_FORMAT_S8_Z24);
- for (i = 0; i < count; i++) {
- if (!mask || mask[i]) {
- dst[i] = shiftedVal | (dst[i] & 0xff000000);
- }
- }
- }
- }
- else {
- /* get, modify, put */
- GLuint temp[MAX_WIDTH], i;
- dsrb->GetRow(ctx, dsrb, count, x, y, temp);
- if (dsrb->Format == MESA_FORMAT_Z24_S8) {
- const GLuint shiftedVal = *((GLuint *) value) << 8;
- for (i = 0; i < count; i++) {
- if (!mask || mask[i]) {
- temp[i] = shiftedVal | (temp[i] & 0xff);
- }
- }
- }
- else {
- const GLuint shiftedVal = *((GLuint *) value);
- assert(dsrb->Format == MESA_FORMAT_S8_Z24);
- for (i = 0; i < count; i++) {
- if (!mask || mask[i]) {
- temp[i] = shiftedVal | (temp[i] & 0xff000000);
- }
- }
- }
- dsrb->PutRow(ctx, dsrb, count, x, y, temp, mask);
- }
-}
-
-static void
-put_values_z24(struct gl_context *ctx, struct gl_renderbuffer *z24rb, GLuint count,
- const GLint x[], const GLint y[],
- const void *values, const GLubyte *mask)
-{
- struct gl_renderbuffer *dsrb = z24rb->Wrapped;
- const GLuint *src = (const GLuint *) values;
- ASSERT(z24rb->DataType == GL_UNSIGNED_INT);
- ASSERT(dsrb->DataType == GL_UNSIGNED_INT_24_8_EXT);
- if (dsrb->GetPointer(ctx, dsrb, 0, 0)) {
- /* direct access */
- GLuint i;
- if (dsrb->Format == MESA_FORMAT_Z24_S8) {
- for (i = 0; i < count; i++) {
- if (!mask || mask[i]) {
- GLuint *dst = (GLuint *) dsrb->GetPointer(ctx, dsrb, x[i], y[i]);
- *dst = (src[i] << 8) | (*dst & 0xff);
- }
- }
- }
- else {
- assert(dsrb->Format == MESA_FORMAT_S8_Z24);
- for (i = 0; i < count; i++) {
- if (!mask || mask[i]) {
- GLuint *dst = (GLuint *) dsrb->GetPointer(ctx, dsrb, x[i], y[i]);
- *dst = (src[i] & 0xffffff) | (*dst & 0xff000000);
- }
- }
- }
- }
- else {
- /* get, modify, put */
- GLuint temp[MAX_WIDTH], i;
- dsrb->GetValues(ctx, dsrb, count, x, y, temp);
- if (dsrb->Format == MESA_FORMAT_Z24_S8) {
- for (i = 0; i < count; i++) {
- if (!mask || mask[i]) {
- temp[i] = (src[i] << 8) | (temp[i] & 0xff);
- }
- }
- }
- else {
- assert(dsrb->Format == MESA_FORMAT_S8_Z24);
- for (i = 0; i < count; i++) {
- if (!mask || mask[i]) {
- temp[i] = (src[i] & 0xffffff) | (temp[i] & 0xff000000);
- }
- }
- }
- dsrb->PutValues(ctx, dsrb, count, x, y, temp, mask);
- }
-}
-
-static void
-put_mono_values_z24(struct gl_context *ctx, struct gl_renderbuffer *z24rb,
- GLuint count, const GLint x[], const GLint y[],
- const void *value, const GLubyte *mask)
-{
- struct gl_renderbuffer *dsrb = z24rb->Wrapped;
- GLuint temp[MAX_WIDTH], i;
- /* get, modify, put */
- dsrb->GetValues(ctx, dsrb, count, x, y, temp);
- if (dsrb->Format == MESA_FORMAT_Z24_S8) {
- const GLuint shiftedVal = *((GLuint *) value) << 8;
- for (i = 0; i < count; i++) {
- if (!mask || mask[i]) {
- temp[i] = shiftedVal | (temp[i] & 0xff);
- }
- }
- }
- else {
- const GLuint shiftedVal = *((GLuint *) value);
- assert(dsrb->Format == MESA_FORMAT_S8_Z24);
- for (i = 0; i < count; i++) {
- if (!mask || mask[i]) {
- temp[i] = shiftedVal | (temp[i] & 0xff000000);
- }
- }
- }
- dsrb->PutValues(ctx, dsrb, count, x, y, temp, mask);
-}
-
-
-/**
- * Wrap the given GL_DEPTH_STENCIL renderbuffer so that it acts like
- * a depth renderbuffer.
- * \return new depth renderbuffer
- */
-struct gl_renderbuffer *
-_mesa_new_z24_renderbuffer_wrapper(struct gl_context *ctx,
- struct gl_renderbuffer *dsrb)
-{
- struct gl_renderbuffer *z24rb;
-
- ASSERT(dsrb->Format == MESA_FORMAT_Z24_S8 ||
- dsrb->Format == MESA_FORMAT_Z24_X8 ||
- dsrb->Format == MESA_FORMAT_S8_Z24 ||
- dsrb->Format == MESA_FORMAT_X8_Z24);
- ASSERT(dsrb->DataType == GL_UNSIGNED_INT_24_8_EXT);
-
- z24rb = ctx->Driver.NewRenderbuffer(ctx, 0);
- if (!z24rb)
- return NULL;
-
- /* NOTE: need to do manual refcounting here */
- z24rb->Wrapped = dsrb;
- dsrb->RefCount++;
-
- z24rb->Name = dsrb->Name;
- z24rb->RefCount = 0;
- z24rb->Width = dsrb->Width;
- z24rb->Height = dsrb->Height;
- z24rb->RowStride = dsrb->RowStride;
- z24rb->InternalFormat = GL_DEPTH_COMPONENT24;
- z24rb->Format = MESA_FORMAT_X8_Z24;
- z24rb->_BaseFormat = GL_DEPTH_COMPONENT;
- z24rb->DataType = GL_UNSIGNED_INT;
- z24rb->Data = NULL;
- z24rb->Delete = delete_wrapper;
- z24rb->AllocStorage = alloc_wrapper_storage;
- z24rb->GetPointer = nop_get_pointer;
- z24rb->GetRow = get_row_z24;
- z24rb->GetValues = get_values_z24;
- z24rb->PutRow = put_row_z24;
- z24rb->PutRowRGB = NULL;
- z24rb->PutMonoRow = put_mono_row_z24;
- z24rb->PutValues = put_values_z24;
- z24rb->PutMonoValues = put_mono_values_z24;
-
- return z24rb;
-}
-
-
-/*======================================================================
- * Stencil wrapper around depth/stencil renderbuffer
- */
-
-static void
-get_row_s8(struct gl_context *ctx, struct gl_renderbuffer *s8rb, GLuint count,
- GLint x, GLint y, void *values)
-{
- struct gl_renderbuffer *dsrb = s8rb->Wrapped;
- GLuint temp[MAX_WIDTH], i;
- GLubyte *dst = (GLubyte *) values;
- const GLuint *src = (const GLuint *) dsrb->GetPointer(ctx, dsrb, x, y);
- ASSERT(s8rb->DataType == GL_UNSIGNED_BYTE);
- ASSERT(dsrb->DataType == GL_UNSIGNED_INT_24_8_EXT);
- if (!src) {
- dsrb->GetRow(ctx, dsrb, count, x, y, temp);
- src = temp;
- }
- if (dsrb->Format == MESA_FORMAT_Z24_S8) {
- for (i = 0; i < count; i++) {
- dst[i] = src[i] & 0xff;
- }
- }
- else {
- assert(dsrb->Format == MESA_FORMAT_S8_Z24);
- for (i = 0; i < count; i++) {
- dst[i] = src[i] >> 24;
- }
- }
-}
-
-static void
-get_values_s8(struct gl_context *ctx, struct gl_renderbuffer *s8rb, GLuint count,
- const GLint x[], const GLint y[], void *values)
-{
- struct gl_renderbuffer *dsrb = s8rb->Wrapped;
- GLuint temp[MAX_WIDTH], i;
- GLubyte *dst = (GLubyte *) values;
- ASSERT(s8rb->DataType == GL_UNSIGNED_BYTE);
- ASSERT(dsrb->DataType == GL_UNSIGNED_INT_24_8_EXT);
- ASSERT(count <= MAX_WIDTH);
- /* don't bother trying direct access */
- dsrb->GetValues(ctx, dsrb, count, x, y, temp);
- if (dsrb->Format == MESA_FORMAT_Z24_S8) {
- for (i = 0; i < count; i++) {
- dst[i] = temp[i] & 0xff;
- }
- }
- else {
- assert(dsrb->Format == MESA_FORMAT_S8_Z24);
- for (i = 0; i < count; i++) {
- dst[i] = temp[i] >> 24;
- }
- }
-}
-
-static void
-put_row_s8(struct gl_context *ctx, struct gl_renderbuffer *s8rb, GLuint count,
- GLint x, GLint y, const void *values, const GLubyte *mask)
-{
- struct gl_renderbuffer *dsrb = s8rb->Wrapped;
- const GLubyte *src = (const GLubyte *) values;
- GLuint *dst = (GLuint *) dsrb->GetPointer(ctx, dsrb, x, y);
- ASSERT(s8rb->DataType == GL_UNSIGNED_BYTE);
- ASSERT(dsrb->DataType == GL_UNSIGNED_INT_24_8_EXT);
- if (dst) {
- /* direct access */
- GLuint i;
- if (dsrb->Format == MESA_FORMAT_Z24_S8) {
- for (i = 0; i < count; i++) {
- if (!mask || mask[i]) {
- dst[i] = (dst[i] & 0xffffff00) | src[i];
- }
- }
- }
- else {
- assert(dsrb->Format == MESA_FORMAT_S8_Z24);
- for (i = 0; i < count; i++) {
- if (!mask || mask[i]) {
- dst[i] = (dst[i] & 0xffffff) | (src[i] << 24);
- }
- }
- }
- }
- else {
- /* get, modify, put */
- GLuint temp[MAX_WIDTH], i;
- dsrb->GetRow(ctx, dsrb, count, x, y, temp);
- if (dsrb->Format == MESA_FORMAT_Z24_S8) {
- for (i = 0; i < count; i++) {
- if (!mask || mask[i]) {
- temp[i] = (temp[i] & 0xffffff00) | src[i];
- }
- }
- }
- else {
- assert(dsrb->Format == MESA_FORMAT_S8_Z24);
- for (i = 0; i < count; i++) {
- if (!mask || mask[i]) {
- temp[i] = (temp[i] & 0xffffff) | (src[i] << 24);
- }
- }
- }
- dsrb->PutRow(ctx, dsrb, count, x, y, temp, mask);
- }
-}
-
-static void
-put_mono_row_s8(struct gl_context *ctx, struct gl_renderbuffer *s8rb, GLuint count,
- GLint x, GLint y, const void *value, const GLubyte *mask)
-{
- struct gl_renderbuffer *dsrb = s8rb->Wrapped;
- const GLubyte val = *((GLubyte *) value);
- GLuint *dst = (GLuint *) dsrb->GetPointer(ctx, dsrb, x, y);
- ASSERT(s8rb->DataType == GL_UNSIGNED_BYTE);
- ASSERT(dsrb->DataType == GL_UNSIGNED_INT_24_8_EXT);
- if (dst) {
- /* direct access */
- GLuint i;
- if (dsrb->Format == MESA_FORMAT_Z24_S8) {
- for (i = 0; i < count; i++) {
- if (!mask || mask[i]) {
- dst[i] = (dst[i] & 0xffffff00) | val;
- }
- }
- }
- else {
- assert(dsrb->Format == MESA_FORMAT_S8_Z24);
- for (i = 0; i < count; i++) {
- if (!mask || mask[i]) {
- dst[i] = (dst[i] & 0xffffff) | (val << 24);
- }
- }
- }
- }
- else {
- /* get, modify, put */
- GLuint temp[MAX_WIDTH], i;
- dsrb->GetRow(ctx, dsrb, count, x, y, temp);
- if (dsrb->Format == MESA_FORMAT_Z24_S8) {
- for (i = 0; i < count; i++) {
- if (!mask || mask[i]) {
- temp[i] = (temp[i] & 0xffffff00) | val;
- }
- }
- }
- else {
- assert(dsrb->Format == MESA_FORMAT_S8_Z24);
- for (i = 0; i < count; i++) {
- if (!mask || mask[i]) {
- temp[i] = (temp[i] & 0xffffff) | (val << 24);
- }
- }
- }
- dsrb->PutRow(ctx, dsrb, count, x, y, temp, mask);
- }
-}
-
-static void
-put_values_s8(struct gl_context *ctx, struct gl_renderbuffer *s8rb, GLuint count,
- const GLint x[], const GLint y[],
- const void *values, const GLubyte *mask)
-{
- struct gl_renderbuffer *dsrb = s8rb->Wrapped;
- const GLubyte *src = (const GLubyte *) values;
- ASSERT(s8rb->DataType == GL_UNSIGNED_BYTE);
- ASSERT(dsrb->DataType == GL_UNSIGNED_INT_24_8_EXT);
- if (dsrb->GetPointer(ctx, dsrb, 0, 0)) {
- /* direct access */
- GLuint i;
- if (dsrb->Format == MESA_FORMAT_Z24_S8) {
- for (i = 0; i < count; i++) {
- if (!mask || mask[i]) {
- GLuint *dst = (GLuint *) dsrb->GetPointer(ctx, dsrb, x[i], y[i]);
- *dst = (*dst & 0xffffff00) | src[i];
- }
- }
- }
- else {
- assert(dsrb->Format == MESA_FORMAT_S8_Z24);
- for (i = 0; i < count; i++) {
- if (!mask || mask[i]) {
- GLuint *dst = (GLuint *) dsrb->GetPointer(ctx, dsrb, x[i], y[i]);
- *dst = (*dst & 0xffffff) | (src[i] << 24);
- }
- }
- }
- }
- else {
- /* get, modify, put */
- GLuint temp[MAX_WIDTH], i;
- dsrb->GetValues(ctx, dsrb, count, x, y, temp);
- if (dsrb->Format == MESA_FORMAT_Z24_S8) {
- for (i = 0; i < count; i++) {
- if (!mask || mask[i]) {
- temp[i] = (temp[i] & 0xffffff00) | src[i];
- }
- }
- }
- else {
- assert(dsrb->Format == MESA_FORMAT_S8_Z24);
- for (i = 0; i < count; i++) {
- if (!mask || mask[i]) {
- temp[i] = (temp[i] & 0xffffff) | (src[i] << 24);
- }
- }
- }
- dsrb->PutValues(ctx, dsrb, count, x, y, temp, mask);
- }
-}
-
-static void
-put_mono_values_s8(struct gl_context *ctx, struct gl_renderbuffer *s8rb, GLuint count,
- const GLint x[], const GLint y[],
- const void *value, const GLubyte *mask)
-{
- struct gl_renderbuffer *dsrb = s8rb->Wrapped;
- GLuint temp[MAX_WIDTH], i;
- const GLubyte val = *((GLubyte *) value);
- /* get, modify, put */
- dsrb->GetValues(ctx, dsrb, count, x, y, temp);
- if (dsrb->Format == MESA_FORMAT_Z24_S8) {
- for (i = 0; i < count; i++) {
- if (!mask || mask[i]) {
- temp[i] = (temp[i] & 0xffffff00) | val;
- }
- }
- }
- else {
- assert(dsrb->Format == MESA_FORMAT_S8_Z24);
- for (i = 0; i < count; i++) {
- if (!mask || mask[i]) {
- temp[i] = (temp[i] & 0xffffff) | (val << 24);
- }
- }
- }
- dsrb->PutValues(ctx, dsrb, count, x, y, temp, mask);
-}
-
-
-/**
- * Wrap the given GL_DEPTH_STENCIL renderbuffer so that it acts like
- * a stencil renderbuffer.
- * \return new stencil renderbuffer
- */
-struct gl_renderbuffer *
-_mesa_new_s8_renderbuffer_wrapper(struct gl_context *ctx, struct gl_renderbuffer *dsrb)
-{
- struct gl_renderbuffer *s8rb;
-
- ASSERT(dsrb->Format == MESA_FORMAT_Z24_S8 ||
- dsrb->Format == MESA_FORMAT_S8_Z24);
- ASSERT(dsrb->DataType == GL_UNSIGNED_INT_24_8_EXT);
-
- s8rb = ctx->Driver.NewRenderbuffer(ctx, 0);
- if (!s8rb)
- return NULL;
-
- /* NOTE: need to do manual refcounting here */
- s8rb->Wrapped = dsrb;
- dsrb->RefCount++;
-
- s8rb->Name = dsrb->Name;
- s8rb->RefCount = 0;
- s8rb->Width = dsrb->Width;
- s8rb->Height = dsrb->Height;
- s8rb->RowStride = dsrb->RowStride;
- s8rb->InternalFormat = GL_STENCIL_INDEX8_EXT;
- s8rb->Format = MESA_FORMAT_S8;
- s8rb->_BaseFormat = GL_STENCIL_INDEX;
- s8rb->DataType = GL_UNSIGNED_BYTE;
- s8rb->Data = NULL;
- s8rb->Delete = delete_wrapper;
- s8rb->AllocStorage = alloc_wrapper_storage;
- s8rb->GetPointer = nop_get_pointer;
- s8rb->GetRow = get_row_s8;
- s8rb->GetValues = get_values_s8;
- s8rb->PutRow = put_row_s8;
- s8rb->PutRowRGB = NULL;
- s8rb->PutMonoRow = put_mono_row_s8;
- s8rb->PutValues = put_values_s8;
- s8rb->PutMonoValues = put_mono_values_s8;
-
- return s8rb;
-}
-
-
-
-/**
- ** The following functions are useful for hardware drivers that only
- ** implement combined depth/stencil buffers.
- ** The GL_EXT_framebuffer_object extension allows indepedent depth and
- ** stencil buffers to be used in any combination.
- ** Therefore, we sometimes have to merge separate depth and stencil
- ** renderbuffers into a single depth+stencil renderbuffer. And sometimes
- ** we have to split combined depth+stencil renderbuffers into separate
- ** renderbuffers.
- **/
-
-
-/**
- * Extract stencil values from the combined depth/stencil renderbuffer, storing
- * the values into a separate stencil renderbuffer.
- * \param dsRb the source depth/stencil renderbuffer
- * \param stencilRb the destination stencil renderbuffer
- * (either 8-bit or 32-bit)
- */
-void
-_mesa_extract_stencil(struct gl_context *ctx,
- struct gl_renderbuffer *dsRb,
- struct gl_renderbuffer *stencilRb)
-{
- GLuint row, width, height;
-
- ASSERT(dsRb);
- ASSERT(stencilRb);
-
- ASSERT(dsRb->Format == MESA_FORMAT_Z24_S8);
- ASSERT(dsRb->DataType == GL_UNSIGNED_INT_24_8_EXT);
- ASSERT(stencilRb->Format == MESA_FORMAT_Z24_S8 ||
- stencilRb->Format == MESA_FORMAT_S8);
- ASSERT(dsRb->Width == stencilRb->Width);
- ASSERT(dsRb->Height == stencilRb->Height);
-
- width = dsRb->Width;
- height = dsRb->Height;
-
- for (row = 0; row < height; row++) {
- GLuint depthStencil[MAX_WIDTH];
- dsRb->GetRow(ctx, dsRb, width, 0, row, depthStencil);
- if (stencilRb->Format == MESA_FORMAT_S8) {
- /* 8bpp stencil */
- GLubyte stencil[MAX_WIDTH];
- GLuint i;
- for (i = 0; i < width; i++) {
- stencil[i] = depthStencil[i] & 0xff;
- }
- stencilRb->PutRow(ctx, stencilRb, width, 0, row, stencil, NULL);
- }
- else {
- /* 32bpp stencil */
- /* the 24 depth bits will be ignored */
- ASSERT(stencilRb->Format == MESA_FORMAT_Z24_S8);
- ASSERT(stencilRb->DataType == GL_UNSIGNED_INT_24_8_EXT);
- stencilRb->PutRow(ctx, stencilRb, width, 0, row, depthStencil, NULL);
- }
- }
-}
-
-
-/**
- * Copy stencil values from a stencil renderbuffer into a combined
- * depth/stencil renderbuffer.
- * \param dsRb the destination depth/stencil renderbuffer
- * \param stencilRb the source stencil buffer (either 8-bit or 32-bit)
- */
-void
-_mesa_insert_stencil(struct gl_context *ctx,
- struct gl_renderbuffer *dsRb,
- struct gl_renderbuffer *stencilRb)
-{
- GLuint row, width, height;
-
- ASSERT(dsRb);
- ASSERT(stencilRb);
-
- ASSERT(dsRb->Format == MESA_FORMAT_Z24_S8);
- ASSERT(dsRb->DataType == GL_UNSIGNED_INT_24_8_EXT);
- ASSERT(stencilRb->Format == MESA_FORMAT_Z24_S8 ||
- stencilRb->Format == MESA_FORMAT_S8);
-
- ASSERT(dsRb->Width == stencilRb->Width);
- ASSERT(dsRb->Height == stencilRb->Height);
-
- width = dsRb->Width;
- height = dsRb->Height;
-
- for (row = 0; row < height; row++) {
- GLuint depthStencil[MAX_WIDTH];
-
- dsRb->GetRow(ctx, dsRb, width, 0, row, depthStencil);
-
- if (stencilRb->Format == MESA_FORMAT_S8) {
- /* 8bpp stencil */
- GLubyte stencil[MAX_WIDTH];
- GLuint i;
- stencilRb->GetRow(ctx, stencilRb, width, 0, row, stencil);
- for (i = 0; i < width; i++) {
- depthStencil[i] = (depthStencil[i] & 0xffffff00) | stencil[i];
- }
- }
- else {
- /* 32bpp stencil buffer */
- GLuint stencil[MAX_WIDTH], i;
- ASSERT(stencilRb->Format == MESA_FORMAT_Z24_S8);
- ASSERT(stencilRb->DataType == GL_UNSIGNED_INT_24_8_EXT);
- stencilRb->GetRow(ctx, stencilRb, width, 0, row, stencil);
- for (i = 0; i < width; i++) {
- depthStencil[i]
- = (depthStencil[i] & 0xffffff00) | (stencil[i] & 0xff);
- }
- }
-
- dsRb->PutRow(ctx, dsRb, width, 0, row, depthStencil, NULL);
- }
-}
-
-
-/**
- * Convert the stencil buffer from 8bpp to 32bpp depth/stencil.
- * \param stencilRb the stencil renderbuffer to promote
- */
-void
-_mesa_promote_stencil(struct gl_context *ctx, struct gl_renderbuffer *stencilRb)
-{
- const GLsizei width = stencilRb->Width;
- const GLsizei height = stencilRb->Height;
- GLubyte *data;
- GLint i, j, k;
-
- ASSERT(stencilRb->Format == MESA_FORMAT_S8);
- ASSERT(stencilRb->Data);
-
- data = (GLubyte *) stencilRb->Data;
- stencilRb->Data = NULL;
- stencilRb->AllocStorage(ctx, stencilRb, GL_DEPTH24_STENCIL8_EXT,
- width, height);
-
- ASSERT(stencilRb->DataType == GL_UNSIGNED_INT_24_8_EXT);
-
- k = 0;
- for (i = 0; i < height; i++) {
- GLuint depthStencil[MAX_WIDTH];
- for (j = 0; j < width; j++) {
- depthStencil[j] = data[k++];
- }
- stencilRb->PutRow(ctx, stencilRb, width, 0, i, depthStencil, NULL);
- }
- free(data);
-}
+/*
+ * Mesa 3-D graphics library
+ * Version: 6.5
+ *
+ * Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+#include "glheader.h"
+#include "imports.h"
+#include "context.h"
+#include "formats.h"
+#include "mtypes.h"
+#include "depthstencil.h"
+#include "renderbuffer.h"
+
+
+/**
+ * Adaptor/wrappers for GL_DEPTH_STENCIL renderbuffers.
+ *
+ * The problem with a GL_DEPTH_STENCIL renderbuffer is that sometimes we
+ * want to treat it as a stencil buffer, other times we want to treat it
+ * as a depth/z buffer and still other times when we want to treat it as
+ * a combined Z+stencil buffer! That implies we need three different sets
+ * of Get/Put functions.
+ *
+ * We solve this by wrapping the Z24_S8 or S8_Z24 renderbuffer with depth and
+ * stencil adaptors, each with the right kind of depth/stencil Get/Put functions.
+ */
+
+
+static void *
+nop_get_pointer(struct gl_context *ctx, struct gl_renderbuffer *rb, GLint x, GLint y)
+{
+ (void) ctx;
+ (void) rb;
+ (void) x;
+ (void) y;
+ return NULL;
+}
+
+
+/**
+ * Delete a depth or stencil wrapper renderbuffer.
+ */
+static void
+delete_wrapper(struct gl_renderbuffer *rb)
+{
+ ASSERT(rb->Format == MESA_FORMAT_S8 ||
+ rb->Format == MESA_FORMAT_X8_Z24);
+ _mesa_reference_renderbuffer(&rb->Wrapped, NULL);
+ free(rb);
+}
+
+
+/**
+ * Realloc storage for wrapper.
+ */
+static GLboolean
+alloc_wrapper_storage(struct gl_context *ctx, struct gl_renderbuffer *rb,
+ GLenum internalFormat, GLuint width, GLuint height)
+{
+ /* just pass this on to the wrapped renderbuffer */
+ struct gl_renderbuffer *dsrb = rb->Wrapped;
+ GLboolean retVal;
+
+ (void) internalFormat;
+
+ ASSERT(dsrb->Format == MESA_FORMAT_Z24_S8 ||
+ dsrb->Format == MESA_FORMAT_Z24_X8 ||
+ dsrb->Format == MESA_FORMAT_S8_Z24 ||
+ dsrb->Format == MESA_FORMAT_X8_Z24);
+
+ retVal = dsrb->AllocStorage(ctx, dsrb, dsrb->InternalFormat, width, height);
+ if (retVal) {
+ rb->Width = width;
+ rb->Height = height;
+ rb->RowStride = dsrb->RowStride;
+ }
+ return retVal;
+}
+
+
+
+
+/*======================================================================
+ * Depth wrapper around depth/stencil renderbuffer
+ */
+
+static void
+get_row_z24(struct gl_context *ctx, struct gl_renderbuffer *z24rb, GLuint count,
+ GLint x, GLint y, void *values)
+{
+ struct gl_renderbuffer *dsrb = z24rb->Wrapped;
+ GLuint temp[MAX_WIDTH], i;
+ GLuint *dst = (GLuint *) values;
+ const GLuint *src = (const GLuint *) dsrb->GetPointer(ctx, dsrb, x, y);
+ ASSERT(z24rb->DataType == GL_UNSIGNED_INT);
+ ASSERT(dsrb->DataType == GL_UNSIGNED_INT_24_8_EXT);
+ if (!src) {
+ dsrb->GetRow(ctx, dsrb, count, x, y, temp);
+ src = temp;
+ }
+ if (dsrb->Format == MESA_FORMAT_Z24_S8) {
+ for (i = 0; i < count; i++) {
+ dst[i] = src[i] >> 8;
+ }
+ }
+ else {
+ assert(dsrb->Format == MESA_FORMAT_S8_Z24);
+ for (i = 0; i < count; i++) {
+ dst[i] = src[i] & 0xffffff;
+ }
+ }
+}
+
+static void
+get_values_z24(struct gl_context *ctx, struct gl_renderbuffer *z24rb, GLuint count,
+ const GLint x[], const GLint y[], void *values)
+{
+ struct gl_renderbuffer *dsrb = z24rb->Wrapped;
+ GLuint temp[MAX_WIDTH], i;
+ GLuint *dst = (GLuint *) values;
+ ASSERT(z24rb->DataType == GL_UNSIGNED_INT);
+ ASSERT(dsrb->DataType == GL_UNSIGNED_INT_24_8_EXT);
+ ASSERT(count <= MAX_WIDTH);
+ /* don't bother trying direct access */
+ dsrb->GetValues(ctx, dsrb, count, x, y, temp);
+ if (dsrb->Format == MESA_FORMAT_Z24_S8) {
+ for (i = 0; i < count; i++) {
+ dst[i] = temp[i] >> 8;
+ }
+ }
+ else {
+ assert(dsrb->Format == MESA_FORMAT_S8_Z24);
+ for (i = 0; i < count; i++) {
+ dst[i] = temp[i] & 0xffffff;
+ }
+ }
+}
+
+static void
+put_row_z24(struct gl_context *ctx, struct gl_renderbuffer *z24rb, GLuint count,
+ GLint x, GLint y, const void *values, const GLubyte *mask)
+{
+ struct gl_renderbuffer *dsrb = z24rb->Wrapped;
+ const GLuint *src = (const GLuint *) values;
+ GLuint *dst = (GLuint *) dsrb->GetPointer(ctx, dsrb, x, y);
+ ASSERT(z24rb->DataType == GL_UNSIGNED_INT);
+ ASSERT(dsrb->DataType == GL_UNSIGNED_INT_24_8_EXT);
+ if (dst) {
+ /* direct access */
+ GLuint i;
+ if (dsrb->Format == MESA_FORMAT_Z24_S8) {
+ for (i = 0; i < count; i++) {
+ if (!mask || mask[i]) {
+ dst[i] = (src[i] << 8) | (dst[i] & 0xff);
+ }
+ }
+ }
+ else {
+ assert(dsrb->Format == MESA_FORMAT_S8_Z24);
+ for (i = 0; i < count; i++) {
+ if (!mask || mask[i]) {
+ dst[i] = (src[i] & 0xffffff) | (dst[i] & 0xff000000);
+ }
+ }
+ }
+ }
+ else {
+ /* get, modify, put */
+ GLuint temp[MAX_WIDTH], i;
+ dsrb->GetRow(ctx, dsrb, count, x, y, temp);
+ if (dsrb->Format == MESA_FORMAT_Z24_S8) {
+ for (i = 0; i < count; i++) {
+ if (!mask || mask[i]) {
+ temp[i] = (src[i] << 8) | (temp[i] & 0xff);
+ }
+ }
+ }
+ else {
+ assert(dsrb->Format == MESA_FORMAT_S8_Z24);
+ for (i = 0; i < count; i++) {
+ if (!mask || mask[i]) {
+ temp[i] = (src[i] & 0xffffff) | (temp[i] & 0xff000000);
+ }
+ }
+ }
+ dsrb->PutRow(ctx, dsrb, count, x, y, temp, mask);
+ }
+}
+
+static void
+put_mono_row_z24(struct gl_context *ctx, struct gl_renderbuffer *z24rb, GLuint count,
+ GLint x, GLint y, const void *value, const GLubyte *mask)
+{
+ struct gl_renderbuffer *dsrb = z24rb->Wrapped;
+ GLuint *dst = (GLuint *) dsrb->GetPointer(ctx, dsrb, x, y);
+ ASSERT(z24rb->DataType == GL_UNSIGNED_INT);
+ ASSERT(dsrb->DataType == GL_UNSIGNED_INT_24_8_EXT);
+ if (dst) {
+ /* direct access */
+ GLuint i;
+ if (dsrb->Format == MESA_FORMAT_Z24_S8) {
+ const GLuint shiftedVal = *((GLuint *) value) << 8;
+ for (i = 0; i < count; i++) {
+ if (!mask || mask[i]) {
+ dst[i] = shiftedVal | (dst[i] & 0xff);
+ }
+ }
+ }
+ else {
+ const GLuint shiftedVal = *((GLuint *) value);
+ assert(dsrb->Format == MESA_FORMAT_S8_Z24);
+ for (i = 0; i < count; i++) {
+ if (!mask || mask[i]) {
+ dst[i] = shiftedVal | (dst[i] & 0xff000000);
+ }
+ }
+ }
+ }
+ else {
+ /* get, modify, put */
+ GLuint temp[MAX_WIDTH], i;
+ dsrb->GetRow(ctx, dsrb, count, x, y, temp);
+ if (dsrb->Format == MESA_FORMAT_Z24_S8) {
+ const GLuint shiftedVal = *((GLuint *) value) << 8;
+ for (i = 0; i < count; i++) {
+ if (!mask || mask[i]) {
+ temp[i] = shiftedVal | (temp[i] & 0xff);
+ }
+ }
+ }
+ else {
+ const GLuint shiftedVal = *((GLuint *) value);
+ assert(dsrb->Format == MESA_FORMAT_S8_Z24);
+ for (i = 0; i < count; i++) {
+ if (!mask || mask[i]) {
+ temp[i] = shiftedVal | (temp[i] & 0xff000000);
+ }
+ }
+ }
+ dsrb->PutRow(ctx, dsrb, count, x, y, temp, mask);
+ }
+}
+
+static void
+put_values_z24(struct gl_context *ctx, struct gl_renderbuffer *z24rb, GLuint count,
+ const GLint x[], const GLint y[],
+ const void *values, const GLubyte *mask)
+{
+ struct gl_renderbuffer *dsrb = z24rb->Wrapped;
+ const GLuint *src = (const GLuint *) values;
+ ASSERT(z24rb->DataType == GL_UNSIGNED_INT);
+ ASSERT(dsrb->DataType == GL_UNSIGNED_INT_24_8_EXT);
+ if (dsrb->GetPointer(ctx, dsrb, 0, 0)) {
+ /* direct access */
+ GLuint i;
+ if (dsrb->Format == MESA_FORMAT_Z24_S8) {
+ for (i = 0; i < count; i++) {
+ if (!mask || mask[i]) {
+ GLuint *dst = (GLuint *) dsrb->GetPointer(ctx, dsrb, x[i], y[i]);
+ *dst = (src[i] << 8) | (*dst & 0xff);
+ }
+ }
+ }
+ else {
+ assert(dsrb->Format == MESA_FORMAT_S8_Z24);
+ for (i = 0; i < count; i++) {
+ if (!mask || mask[i]) {
+ GLuint *dst = (GLuint *) dsrb->GetPointer(ctx, dsrb, x[i], y[i]);
+ *dst = (src[i] & 0xffffff) | (*dst & 0xff000000);
+ }
+ }
+ }
+ }
+ else {
+ /* get, modify, put */
+ GLuint temp[MAX_WIDTH], i;
+ dsrb->GetValues(ctx, dsrb, count, x, y, temp);
+ if (dsrb->Format == MESA_FORMAT_Z24_S8) {
+ for (i = 0; i < count; i++) {
+ if (!mask || mask[i]) {
+ temp[i] = (src[i] << 8) | (temp[i] & 0xff);
+ }
+ }
+ }
+ else {
+ assert(dsrb->Format == MESA_FORMAT_S8_Z24);
+ for (i = 0; i < count; i++) {
+ if (!mask || mask[i]) {
+ temp[i] = (src[i] & 0xffffff) | (temp[i] & 0xff000000);
+ }
+ }
+ }
+ dsrb->PutValues(ctx, dsrb, count, x, y, temp, mask);
+ }
+}
+
+static void
+put_mono_values_z24(struct gl_context *ctx, struct gl_renderbuffer *z24rb,
+ GLuint count, const GLint x[], const GLint y[],
+ const void *value, const GLubyte *mask)
+{
+ struct gl_renderbuffer *dsrb = z24rb->Wrapped;
+ GLuint temp[MAX_WIDTH], i;
+ /* get, modify, put */
+ dsrb->GetValues(ctx, dsrb, count, x, y, temp);
+ if (dsrb->Format == MESA_FORMAT_Z24_S8) {
+ const GLuint shiftedVal = *((GLuint *) value) << 8;
+ for (i = 0; i < count; i++) {
+ if (!mask || mask[i]) {
+ temp[i] = shiftedVal | (temp[i] & 0xff);
+ }
+ }
+ }
+ else {
+ const GLuint shiftedVal = *((GLuint *) value);
+ assert(dsrb->Format == MESA_FORMAT_S8_Z24);
+ for (i = 0; i < count; i++) {
+ if (!mask || mask[i]) {
+ temp[i] = shiftedVal | (temp[i] & 0xff000000);
+ }
+ }
+ }
+ dsrb->PutValues(ctx, dsrb, count, x, y, temp, mask);
+}
+
+
+/**
+ * Wrap the given GL_DEPTH_STENCIL renderbuffer so that it acts like
+ * a depth renderbuffer.
+ * \return new depth renderbuffer
+ */
+struct gl_renderbuffer *
+_mesa_new_z24_renderbuffer_wrapper(struct gl_context *ctx,
+ struct gl_renderbuffer *dsrb)
+{
+ struct gl_renderbuffer *z24rb;
+
+ ASSERT(dsrb->Format == MESA_FORMAT_Z24_S8 ||
+ dsrb->Format == MESA_FORMAT_Z24_X8 ||
+ dsrb->Format == MESA_FORMAT_S8_Z24 ||
+ dsrb->Format == MESA_FORMAT_X8_Z24);
+ ASSERT(dsrb->DataType == GL_UNSIGNED_INT_24_8_EXT);
+
+ z24rb = ctx->Driver.NewRenderbuffer(ctx, 0);
+ if (!z24rb)
+ return NULL;
+
+ /* NOTE: need to do manual refcounting here */
+ z24rb->Wrapped = dsrb;
+ dsrb->RefCount++;
+
+ z24rb->Name = dsrb->Name;
+ z24rb->RefCount = 0;
+ z24rb->Width = dsrb->Width;
+ z24rb->Height = dsrb->Height;
+ z24rb->RowStride = dsrb->RowStride;
+ z24rb->InternalFormat = GL_DEPTH_COMPONENT24;
+ z24rb->Format = MESA_FORMAT_X8_Z24;
+ z24rb->_BaseFormat = GL_DEPTH_COMPONENT;
+ z24rb->DataType = GL_UNSIGNED_INT;
+ z24rb->Data = NULL;
+ z24rb->Delete = delete_wrapper;
+ z24rb->AllocStorage = alloc_wrapper_storage;
+ z24rb->GetPointer = nop_get_pointer;
+ z24rb->GetRow = get_row_z24;
+ z24rb->GetValues = get_values_z24;
+ z24rb->PutRow = put_row_z24;
+ z24rb->PutRowRGB = NULL;
+ z24rb->PutMonoRow = put_mono_row_z24;
+ z24rb->PutValues = put_values_z24;
+ z24rb->PutMonoValues = put_mono_values_z24;
+
+ return z24rb;
+}
+
+
+/*======================================================================
+ * Stencil wrapper around depth/stencil renderbuffer
+ */
+
+static void
+get_row_s8(struct gl_context *ctx, struct gl_renderbuffer *s8rb, GLuint count,
+ GLint x, GLint y, void *values)
+{
+ struct gl_renderbuffer *dsrb = s8rb->Wrapped;
+ GLuint temp[MAX_WIDTH], i;
+ GLubyte *dst = (GLubyte *) values;
+ const GLuint *src = (const GLuint *) dsrb->GetPointer(ctx, dsrb, x, y);
+ ASSERT(s8rb->DataType == GL_UNSIGNED_BYTE);
+ ASSERT(dsrb->DataType == GL_UNSIGNED_INT_24_8_EXT);
+ if (!src) {
+ dsrb->GetRow(ctx, dsrb, count, x, y, temp);
+ src = temp;
+ }
+ if (dsrb->Format == MESA_FORMAT_Z24_S8) {
+ for (i = 0; i < count; i++) {
+ dst[i] = src[i] & 0xff;
+ }
+ }
+ else {
+ assert(dsrb->Format == MESA_FORMAT_S8_Z24);
+ for (i = 0; i < count; i++) {
+ dst[i] = src[i] >> 24;
+ }
+ }
+}
+
+static void
+get_values_s8(struct gl_context *ctx, struct gl_renderbuffer *s8rb, GLuint count,
+ const GLint x[], const GLint y[], void *values)
+{
+ struct gl_renderbuffer *dsrb = s8rb->Wrapped;
+ GLuint temp[MAX_WIDTH], i;
+ GLubyte *dst = (GLubyte *) values;
+ ASSERT(s8rb->DataType == GL_UNSIGNED_BYTE);
+ ASSERT(dsrb->DataType == GL_UNSIGNED_INT_24_8_EXT);
+ ASSERT(count <= MAX_WIDTH);
+ /* don't bother trying direct access */
+ dsrb->GetValues(ctx, dsrb, count, x, y, temp);
+ if (dsrb->Format == MESA_FORMAT_Z24_S8) {
+ for (i = 0; i < count; i++) {
+ dst[i] = temp[i] & 0xff;
+ }
+ }
+ else {
+ assert(dsrb->Format == MESA_FORMAT_S8_Z24);
+ for (i = 0; i < count; i++) {
+ dst[i] = temp[i] >> 24;
+ }
+ }
+}
+
+static void
+put_row_s8(struct gl_context *ctx, struct gl_renderbuffer *s8rb, GLuint count,
+ GLint x, GLint y, const void *values, const GLubyte *mask)
+{
+ struct gl_renderbuffer *dsrb = s8rb->Wrapped;
+ const GLubyte *src = (const GLubyte *) values;
+ GLuint *dst = (GLuint *) dsrb->GetPointer(ctx, dsrb, x, y);
+ ASSERT(s8rb->DataType == GL_UNSIGNED_BYTE);
+ ASSERT(dsrb->DataType == GL_UNSIGNED_INT_24_8_EXT);
+ if (dst) {
+ /* direct access */
+ GLuint i;
+ if (dsrb->Format == MESA_FORMAT_Z24_S8) {
+ for (i = 0; i < count; i++) {
+ if (!mask || mask[i]) {
+ dst[i] = (dst[i] & 0xffffff00) | src[i];
+ }
+ }
+ }
+ else {
+ assert(dsrb->Format == MESA_FORMAT_S8_Z24);
+ for (i = 0; i < count; i++) {
+ if (!mask || mask[i]) {
+ dst[i] = (dst[i] & 0xffffff) | (src[i] << 24);
+ }
+ }
+ }
+ }
+ else {
+ /* get, modify, put */
+ GLuint temp[MAX_WIDTH], i;
+ dsrb->GetRow(ctx, dsrb, count, x, y, temp);
+ if (dsrb->Format == MESA_FORMAT_Z24_S8) {
+ for (i = 0; i < count; i++) {
+ if (!mask || mask[i]) {
+ temp[i] = (temp[i] & 0xffffff00) | src[i];
+ }
+ }
+ }
+ else {
+ assert(dsrb->Format == MESA_FORMAT_S8_Z24);
+ for (i = 0; i < count; i++) {
+ if (!mask || mask[i]) {
+ temp[i] = (temp[i] & 0xffffff) | (src[i] << 24);
+ }
+ }
+ }
+ dsrb->PutRow(ctx, dsrb, count, x, y, temp, mask);
+ }
+}
+
+static void
+put_mono_row_s8(struct gl_context *ctx, struct gl_renderbuffer *s8rb, GLuint count,
+ GLint x, GLint y, const void *value, const GLubyte *mask)
+{
+ struct gl_renderbuffer *dsrb = s8rb->Wrapped;
+ const GLubyte val = *((GLubyte *) value);
+ GLuint *dst = (GLuint *) dsrb->GetPointer(ctx, dsrb, x, y);
+ ASSERT(s8rb->DataType == GL_UNSIGNED_BYTE);
+ ASSERT(dsrb->DataType == GL_UNSIGNED_INT_24_8_EXT);
+ if (dst) {
+ /* direct access */
+ GLuint i;
+ if (dsrb->Format == MESA_FORMAT_Z24_S8) {
+ for (i = 0; i < count; i++) {
+ if (!mask || mask[i]) {
+ dst[i] = (dst[i] & 0xffffff00) | val;
+ }
+ }
+ }
+ else {
+ assert(dsrb->Format == MESA_FORMAT_S8_Z24);
+ for (i = 0; i < count; i++) {
+ if (!mask || mask[i]) {
+ dst[i] = (dst[i] & 0xffffff) | (val << 24);
+ }
+ }
+ }
+ }
+ else {
+ /* get, modify, put */
+ GLuint temp[MAX_WIDTH], i;
+ dsrb->GetRow(ctx, dsrb, count, x, y, temp);
+ if (dsrb->Format == MESA_FORMAT_Z24_S8) {
+ for (i = 0; i < count; i++) {
+ if (!mask || mask[i]) {
+ temp[i] = (temp[i] & 0xffffff00) | val;
+ }
+ }
+ }
+ else {
+ assert(dsrb->Format == MESA_FORMAT_S8_Z24);
+ for (i = 0; i < count; i++) {
+ if (!mask || mask[i]) {
+ temp[i] = (temp[i] & 0xffffff) | (val << 24);
+ }
+ }
+ }
+ dsrb->PutRow(ctx, dsrb, count, x, y, temp, mask);
+ }
+}
+
+static void
+put_values_s8(struct gl_context *ctx, struct gl_renderbuffer *s8rb, GLuint count,
+ const GLint x[], const GLint y[],
+ const void *values, const GLubyte *mask)
+{
+ struct gl_renderbuffer *dsrb = s8rb->Wrapped;
+ const GLubyte *src = (const GLubyte *) values;
+ ASSERT(s8rb->DataType == GL_UNSIGNED_BYTE);
+ ASSERT(dsrb->DataType == GL_UNSIGNED_INT_24_8_EXT);
+ if (dsrb->GetPointer(ctx, dsrb, 0, 0)) {
+ /* direct access */
+ GLuint i;
+ if (dsrb->Format == MESA_FORMAT_Z24_S8) {
+ for (i = 0; i < count; i++) {
+ if (!mask || mask[i]) {
+ GLuint *dst = (GLuint *) dsrb->GetPointer(ctx, dsrb, x[i], y[i]);
+ *dst = (*dst & 0xffffff00) | src[i];
+ }
+ }
+ }
+ else {
+ assert(dsrb->Format == MESA_FORMAT_S8_Z24);
+ for (i = 0; i < count; i++) {
+ if (!mask || mask[i]) {
+ GLuint *dst = (GLuint *) dsrb->GetPointer(ctx, dsrb, x[i], y[i]);
+ *dst = (*dst & 0xffffff) | (src[i] << 24);
+ }
+ }
+ }
+ }
+ else {
+ /* get, modify, put */
+ GLuint temp[MAX_WIDTH], i;
+ dsrb->GetValues(ctx, dsrb, count, x, y, temp);
+ if (dsrb->Format == MESA_FORMAT_Z24_S8) {
+ for (i = 0; i < count; i++) {
+ if (!mask || mask[i]) {
+ temp[i] = (temp[i] & 0xffffff00) | src[i];
+ }
+ }
+ }
+ else {
+ assert(dsrb->Format == MESA_FORMAT_S8_Z24);
+ for (i = 0; i < count; i++) {
+ if (!mask || mask[i]) {
+ temp[i] = (temp[i] & 0xffffff) | (src[i] << 24);
+ }
+ }
+ }
+ dsrb->PutValues(ctx, dsrb, count, x, y, temp, mask);
+ }
+}
+
+static void
+put_mono_values_s8(struct gl_context *ctx, struct gl_renderbuffer *s8rb, GLuint count,
+ const GLint x[], const GLint y[],
+ const void *value, const GLubyte *mask)
+{
+ struct gl_renderbuffer *dsrb = s8rb->Wrapped;
+ GLuint temp[MAX_WIDTH], i;
+ const GLubyte val = *((GLubyte *) value);
+ /* get, modify, put */
+ dsrb->GetValues(ctx, dsrb, count, x, y, temp);
+ if (dsrb->Format == MESA_FORMAT_Z24_S8) {
+ for (i = 0; i < count; i++) {
+ if (!mask || mask[i]) {
+ temp[i] = (temp[i] & 0xffffff00) | val;
+ }
+ }
+ }
+ else {
+ assert(dsrb->Format == MESA_FORMAT_S8_Z24);
+ for (i = 0; i < count; i++) {
+ if (!mask || mask[i]) {
+ temp[i] = (temp[i] & 0xffffff) | (val << 24);
+ }
+ }
+ }
+ dsrb->PutValues(ctx, dsrb, count, x, y, temp, mask);
+}
+
+
+/**
+ * Wrap the given GL_DEPTH_STENCIL renderbuffer so that it acts like
+ * a stencil renderbuffer.
+ * \return new stencil renderbuffer
+ */
+struct gl_renderbuffer *
+_mesa_new_s8_renderbuffer_wrapper(struct gl_context *ctx, struct gl_renderbuffer *dsrb)
+{
+ struct gl_renderbuffer *s8rb;
+
+ ASSERT(dsrb->Format == MESA_FORMAT_Z24_S8 ||
+ dsrb->Format == MESA_FORMAT_S8_Z24);
+ ASSERT(dsrb->DataType == GL_UNSIGNED_INT_24_8_EXT);
+
+ s8rb = ctx->Driver.NewRenderbuffer(ctx, 0);
+ if (!s8rb)
+ return NULL;
+
+ /* NOTE: need to do manual refcounting here */
+ s8rb->Wrapped = dsrb;
+ dsrb->RefCount++;
+
+ s8rb->Name = dsrb->Name;
+ s8rb->RefCount = 0;
+ s8rb->Width = dsrb->Width;
+ s8rb->Height = dsrb->Height;
+ s8rb->RowStride = dsrb->RowStride;
+ s8rb->InternalFormat = GL_STENCIL_INDEX8_EXT;
+ s8rb->Format = MESA_FORMAT_S8;
+ s8rb->_BaseFormat = GL_STENCIL_INDEX;
+ s8rb->DataType = GL_UNSIGNED_BYTE;
+ s8rb->Data = NULL;
+ s8rb->Delete = delete_wrapper;
+ s8rb->AllocStorage = alloc_wrapper_storage;
+ s8rb->GetPointer = nop_get_pointer;
+ s8rb->GetRow = get_row_s8;
+ s8rb->GetValues = get_values_s8;
+ s8rb->PutRow = put_row_s8;
+ s8rb->PutRowRGB = NULL;
+ s8rb->PutMonoRow = put_mono_row_s8;
+ s8rb->PutValues = put_values_s8;
+ s8rb->PutMonoValues = put_mono_values_s8;
+
+ return s8rb;
+}
+
+
+
+/**
+ ** The following functions are useful for hardware drivers that only
+ ** implement combined depth/stencil buffers.
+ ** The GL_EXT_framebuffer_object extension allows indepedent depth and
+ ** stencil buffers to be used in any combination.
+ ** Therefore, we sometimes have to merge separate depth and stencil
+ ** renderbuffers into a single depth+stencil renderbuffer. And sometimes
+ ** we have to split combined depth+stencil renderbuffers into separate
+ ** renderbuffers.
+ **/
+
+
+/**
+ * Extract stencil values from the combined depth/stencil renderbuffer, storing
+ * the values into a separate stencil renderbuffer.
+ * \param dsRb the source depth/stencil renderbuffer
+ * \param stencilRb the destination stencil renderbuffer
+ * (either 8-bit or 32-bit)
+ */
+void
+_mesa_extract_stencil(struct gl_context *ctx,
+ struct gl_renderbuffer *dsRb,
+ struct gl_renderbuffer *stencilRb)
+{
+ GLuint row, width, height;
+
+ ASSERT(dsRb);
+ ASSERT(stencilRb);
+
+ ASSERT(dsRb->Format == MESA_FORMAT_Z24_S8);
+ ASSERT(dsRb->DataType == GL_UNSIGNED_INT_24_8_EXT);
+ ASSERT(stencilRb->Format == MESA_FORMAT_Z24_S8 ||
+ stencilRb->Format == MESA_FORMAT_S8);
+ ASSERT(dsRb->Width == stencilRb->Width);
+ ASSERT(dsRb->Height == stencilRb->Height);
+
+ width = dsRb->Width;
+ height = dsRb->Height;
+
+ for (row = 0; row < height; row++) {
+ GLuint depthStencil[MAX_WIDTH];
+ dsRb->GetRow(ctx, dsRb, width, 0, row, depthStencil);
+ if (stencilRb->Format == MESA_FORMAT_S8) {
+ /* 8bpp stencil */
+ GLubyte stencil[MAX_WIDTH];
+ GLuint i;
+ for (i = 0; i < width; i++) {
+ stencil[i] = depthStencil[i] & 0xff;
+ }
+ stencilRb->PutRow(ctx, stencilRb, width, 0, row, stencil, NULL);
+ }
+ else {
+ /* 32bpp stencil */
+ /* the 24 depth bits will be ignored */
+ ASSERT(stencilRb->Format == MESA_FORMAT_Z24_S8);
+ ASSERT(stencilRb->DataType == GL_UNSIGNED_INT_24_8_EXT);
+ stencilRb->PutRow(ctx, stencilRb, width, 0, row, depthStencil, NULL);
+ }
+ }
+}
+
+
+/**
+ * Copy stencil values from a stencil renderbuffer into a combined
+ * depth/stencil renderbuffer.
+ * \param dsRb the destination depth/stencil renderbuffer
+ * \param stencilRb the source stencil buffer (either 8-bit or 32-bit)
+ */
+void
+_mesa_insert_stencil(struct gl_context *ctx,
+ struct gl_renderbuffer *dsRb,
+ struct gl_renderbuffer *stencilRb)
+{
+ GLuint row, width, height;
+
+ ASSERT(dsRb);
+ ASSERT(stencilRb);
+
+ ASSERT(dsRb->Format == MESA_FORMAT_Z24_S8);
+ ASSERT(dsRb->DataType == GL_UNSIGNED_INT_24_8_EXT);
+ ASSERT(stencilRb->Format == MESA_FORMAT_Z24_S8 ||
+ stencilRb->Format == MESA_FORMAT_S8);
+
+ ASSERT(dsRb->Width == stencilRb->Width);
+ ASSERT(dsRb->Height == stencilRb->Height);
+
+ width = dsRb->Width;
+ height = dsRb->Height;
+
+ for (row = 0; row < height; row++) {
+ GLuint depthStencil[MAX_WIDTH];
+
+ dsRb->GetRow(ctx, dsRb, width, 0, row, depthStencil);
+
+ if (stencilRb->Format == MESA_FORMAT_S8) {
+ /* 8bpp stencil */
+ GLubyte stencil[MAX_WIDTH];
+ GLuint i;
+ stencilRb->GetRow(ctx, stencilRb, width, 0, row, stencil);
+ for (i = 0; i < width; i++) {
+ depthStencil[i] = (depthStencil[i] & 0xffffff00) | stencil[i];
+ }
+ }
+ else {
+ /* 32bpp stencil buffer */
+ GLuint stencil[MAX_WIDTH], i;
+ ASSERT(stencilRb->Format == MESA_FORMAT_Z24_S8);
+ ASSERT(stencilRb->DataType == GL_UNSIGNED_INT_24_8_EXT);
+ stencilRb->GetRow(ctx, stencilRb, width, 0, row, stencil);
+ for (i = 0; i < width; i++) {
+ depthStencil[i]
+ = (depthStencil[i] & 0xffffff00) | (stencil[i] & 0xff);
+ }
+ }
+
+ dsRb->PutRow(ctx, dsRb, width, 0, row, depthStencil, NULL);
+ }
+}
+
+
+/**
+ * Convert the stencil buffer from 8bpp to 32bpp depth/stencil.
+ * \param stencilRb the stencil renderbuffer to promote
+ */
+void
+_mesa_promote_stencil(struct gl_context *ctx, struct gl_renderbuffer *stencilRb)
+{
+ const GLsizei width = stencilRb->Width;
+ const GLsizei height = stencilRb->Height;
+ GLubyte *data;
+ GLint i, j, k;
+
+ ASSERT(stencilRb->Format == MESA_FORMAT_S8);
+ ASSERT(stencilRb->Data);
+
+ data = (GLubyte *) stencilRb->Data;
+ stencilRb->Data = NULL;
+ stencilRb->AllocStorage(ctx, stencilRb, GL_DEPTH24_STENCIL8_EXT,
+ width, height);
+
+ ASSERT(stencilRb->DataType == GL_UNSIGNED_INT_24_8_EXT);
+
+ k = 0;
+ for (i = 0; i < height; i++) {
+ GLuint depthStencil[MAX_WIDTH];
+ for (j = 0; j < width; j++) {
+ depthStencil[j] = data[k++];
+ }
+ stencilRb->PutRow(ctx, stencilRb, width, 0, i, depthStencil, NULL);
+ }
+ free(data);
+}
diff --git a/mesalib/src/mesa/main/dlist.c b/mesalib/src/mesa/main/dlist.c
index 2aba82fc0..b9c29cb84 100644
--- a/mesalib/src/mesa/main/dlist.c
+++ b/mesalib/src/mesa/main/dlist.c
@@ -1,10411 +1,10411 @@
-/*
- * Mesa 3-D graphics library
- * Version: 7.7
- *
- * Copyright (C) 1999-2008 Brian Paul All Rights Reserved.
- * Copyright (C) 2009 VMware, Inc. All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-
-/**
- * \file dlist.c
- * Display lists management functions.
- */
-
-#include "glheader.h"
-#include "imports.h"
-#include "api_arrayelt.h"
-#include "api_exec.h"
-#include "api_loopback.h"
-#if FEATURE_ATI_fragment_shader
-#include "atifragshader.h"
-#endif
-#include "config.h"
-#include "mfeatures.h"
-#if FEATURE_ARB_vertex_buffer_object
-#include "bufferobj.h"
-#endif
-#include "arrayobj.h"
-#include "context.h"
-#include "dlist.h"
-#include "enums.h"
-#include "eval.h"
-#include "framebuffer.h"
-#include "glapi/glapi.h"
-#include "glapidispatch.h"
-#include "hash.h"
-#include "image.h"
-#include "light.h"
-#include "macros.h"
-#include "pack.h"
-#include "pbo.h"
-#include "queryobj.h"
-#include "teximage.h"
-#include "mtypes.h"
-#include "varray.h"
-#if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
-#include "arbprogram.h"
-#endif
-#if FEATURE_NV_vertex_program || FEATURE_NV_fragment_program
-#include "nvprogram.h"
-#endif
-
-#include "math/m_matrix.h"
-
-#include "main/dispatch.h"
-
-
-
-/**
- * Other parts of Mesa (such as the VBO module) can plug into the display
- * list system. This structure describes new display list instructions.
- */
-struct gl_list_instruction
-{
- GLuint Size;
- void (*Execute)( struct gl_context *ctx, void *data );
- void (*Destroy)( struct gl_context *ctx, void *data );
- void (*Print)( struct gl_context *ctx, void *data );
-};
-
-
-#define MAX_DLIST_EXT_OPCODES 16
-
-/**
- * Used by device drivers to hook new commands into display lists.
- */
-struct gl_list_extensions
-{
- struct gl_list_instruction Opcode[MAX_DLIST_EXT_OPCODES];
- GLuint NumOpcodes;
-};
-
-
-
-/**
- * Flush vertices.
- *
- * \param ctx GL context.
- *
- * Checks if dd_function_table::SaveNeedFlush is marked to flush
- * stored (save) vertices, and calls
- * dd_function_table::SaveFlushVertices if so.
- */
-#define SAVE_FLUSH_VERTICES(ctx) \
-do { \
- if (ctx->Driver.SaveNeedFlush) \
- ctx->Driver.SaveFlushVertices(ctx); \
-} while (0)
-
-
-/**
- * Macro to assert that the API call was made outside the
- * glBegin()/glEnd() pair, with return value.
- *
- * \param ctx GL context.
- * \param retval value to return value in case the assertion fails.
- */
-#define ASSERT_OUTSIDE_SAVE_BEGIN_END_WITH_RETVAL(ctx, retval) \
-do { \
- if (ctx->Driver.CurrentSavePrimitive <= GL_POLYGON || \
- ctx->Driver.CurrentSavePrimitive == PRIM_INSIDE_UNKNOWN_PRIM) { \
- _mesa_compile_error( ctx, GL_INVALID_OPERATION, "begin/end" ); \
- return retval; \
- } \
-} while (0)
-
-/**
- * Macro to assert that the API call was made outside the
- * glBegin()/glEnd() pair.
- *
- * \param ctx GL context.
- */
-#define ASSERT_OUTSIDE_SAVE_BEGIN_END(ctx) \
-do { \
- if (ctx->Driver.CurrentSavePrimitive <= GL_POLYGON || \
- ctx->Driver.CurrentSavePrimitive == PRIM_INSIDE_UNKNOWN_PRIM) { \
- _mesa_compile_error( ctx, GL_INVALID_OPERATION, "begin/end" ); \
- return; \
- } \
-} while (0)
-
-/**
- * Macro to assert that the API call was made outside the
- * glBegin()/glEnd() pair and flush the vertices.
- *
- * \param ctx GL context.
- */
-#define ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx) \
-do { \
- ASSERT_OUTSIDE_SAVE_BEGIN_END(ctx); \
- SAVE_FLUSH_VERTICES(ctx); \
-} while (0)
-
-/**
- * Macro to assert that the API call was made outside the
- * glBegin()/glEnd() pair and flush the vertices, with return value.
- *
- * \param ctx GL context.
- * \param retval value to return value in case the assertion fails.
- */
-#define ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH_WITH_RETVAL(ctx, retval)\
-do { \
- ASSERT_OUTSIDE_SAVE_BEGIN_END_WITH_RETVAL(ctx, retval); \
- SAVE_FLUSH_VERTICES(ctx); \
-} while (0)
-
-
-
-/**
- * Display list opcodes.
- *
- * The fact that these identifiers are assigned consecutive
- * integer values starting at 0 is very important, see InstSize array usage)
- */
-typedef enum
-{
- OPCODE_INVALID = -1, /* Force signed enum */
- OPCODE_ACCUM,
- OPCODE_ALPHA_FUNC,
- OPCODE_BIND_TEXTURE,
- OPCODE_BITMAP,
- OPCODE_BLEND_COLOR,
- OPCODE_BLEND_EQUATION,
- OPCODE_BLEND_EQUATION_SEPARATE,
- OPCODE_BLEND_FUNC_SEPARATE,
-
- OPCODE_BLEND_EQUATION_I,
- OPCODE_BLEND_EQUATION_SEPARATE_I,
- OPCODE_BLEND_FUNC_I,
- OPCODE_BLEND_FUNC_SEPARATE_I,
-
- OPCODE_CALL_LIST,
- OPCODE_CALL_LIST_OFFSET,
- OPCODE_CLEAR,
- OPCODE_CLEAR_ACCUM,
- OPCODE_CLEAR_COLOR,
- OPCODE_CLEAR_DEPTH,
- OPCODE_CLEAR_INDEX,
- OPCODE_CLEAR_STENCIL,
- OPCODE_CLEAR_BUFFER_IV,
- OPCODE_CLEAR_BUFFER_UIV,
- OPCODE_CLEAR_BUFFER_FV,
- OPCODE_CLEAR_BUFFER_FI,
- OPCODE_CLIP_PLANE,
- OPCODE_COLOR_MASK,
- OPCODE_COLOR_MASK_INDEXED,
- OPCODE_COLOR_MATERIAL,
- OPCODE_COLOR_TABLE,
- OPCODE_COLOR_TABLE_PARAMETER_FV,
- OPCODE_COLOR_TABLE_PARAMETER_IV,
- OPCODE_COLOR_SUB_TABLE,
- OPCODE_CONVOLUTION_FILTER_1D,
- OPCODE_CONVOLUTION_FILTER_2D,
- OPCODE_CONVOLUTION_PARAMETER_I,
- OPCODE_CONVOLUTION_PARAMETER_IV,
- OPCODE_CONVOLUTION_PARAMETER_F,
- OPCODE_CONVOLUTION_PARAMETER_FV,
- OPCODE_COPY_COLOR_SUB_TABLE,
- OPCODE_COPY_COLOR_TABLE,
- OPCODE_COPY_PIXELS,
- OPCODE_COPY_TEX_IMAGE1D,
- OPCODE_COPY_TEX_IMAGE2D,
- OPCODE_COPY_TEX_SUB_IMAGE1D,
- OPCODE_COPY_TEX_SUB_IMAGE2D,
- OPCODE_COPY_TEX_SUB_IMAGE3D,
- OPCODE_CULL_FACE,
- OPCODE_DEPTH_FUNC,
- OPCODE_DEPTH_MASK,
- OPCODE_DEPTH_RANGE,
- OPCODE_DISABLE,
- OPCODE_DISABLE_INDEXED,
- OPCODE_DRAW_BUFFER,
- OPCODE_DRAW_PIXELS,
- OPCODE_ENABLE,
- OPCODE_ENABLE_INDEXED,
- OPCODE_EVALMESH1,
- OPCODE_EVALMESH2,
- OPCODE_FOG,
- OPCODE_FRONT_FACE,
- OPCODE_FRUSTUM,
- OPCODE_HINT,
- OPCODE_HISTOGRAM,
- OPCODE_INDEX_MASK,
- OPCODE_INIT_NAMES,
- OPCODE_LIGHT,
- OPCODE_LIGHT_MODEL,
- OPCODE_LINE_STIPPLE,
- OPCODE_LINE_WIDTH,
- OPCODE_LIST_BASE,
- OPCODE_LOAD_IDENTITY,
- OPCODE_LOAD_MATRIX,
- OPCODE_LOAD_NAME,
- OPCODE_LOGIC_OP,
- OPCODE_MAP1,
- OPCODE_MAP2,
- OPCODE_MAPGRID1,
- OPCODE_MAPGRID2,
- OPCODE_MATRIX_MODE,
- OPCODE_MIN_MAX,
- OPCODE_MULT_MATRIX,
- OPCODE_ORTHO,
- OPCODE_PASSTHROUGH,
- OPCODE_PIXEL_MAP,
- OPCODE_PIXEL_TRANSFER,
- OPCODE_PIXEL_ZOOM,
- OPCODE_POINT_SIZE,
- OPCODE_POINT_PARAMETERS,
- OPCODE_POLYGON_MODE,
- OPCODE_POLYGON_STIPPLE,
- OPCODE_POLYGON_OFFSET,
- OPCODE_POP_ATTRIB,
- OPCODE_POP_MATRIX,
- OPCODE_POP_NAME,
- OPCODE_PRIORITIZE_TEXTURE,
- OPCODE_PUSH_ATTRIB,
- OPCODE_PUSH_MATRIX,
- OPCODE_PUSH_NAME,
- OPCODE_RASTER_POS,
- OPCODE_READ_BUFFER,
- OPCODE_RESET_HISTOGRAM,
- OPCODE_RESET_MIN_MAX,
- OPCODE_ROTATE,
- OPCODE_SCALE,
- OPCODE_SCISSOR,
- OPCODE_SELECT_TEXTURE_SGIS,
- OPCODE_SELECT_TEXTURE_COORD_SET,
- OPCODE_SHADE_MODEL,
- OPCODE_STENCIL_FUNC,
- OPCODE_STENCIL_MASK,
- OPCODE_STENCIL_OP,
- OPCODE_TEXENV,
- OPCODE_TEXGEN,
- OPCODE_TEXPARAMETER,
- OPCODE_TEX_IMAGE1D,
- OPCODE_TEX_IMAGE2D,
- OPCODE_TEX_IMAGE3D,
- OPCODE_TEX_SUB_IMAGE1D,
- OPCODE_TEX_SUB_IMAGE2D,
- OPCODE_TEX_SUB_IMAGE3D,
- OPCODE_TRANSLATE,
- OPCODE_VIEWPORT,
- OPCODE_WINDOW_POS,
- /* GL_ARB_multitexture */
- OPCODE_ACTIVE_TEXTURE,
- /* GL_ARB_texture_compression */
- OPCODE_COMPRESSED_TEX_IMAGE_1D,
- OPCODE_COMPRESSED_TEX_IMAGE_2D,
- OPCODE_COMPRESSED_TEX_IMAGE_3D,
- OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D,
- OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D,
- OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D,
- /* GL_ARB_multisample */
- OPCODE_SAMPLE_COVERAGE,
- /* GL_ARB_window_pos */
- OPCODE_WINDOW_POS_ARB,
- /* GL_NV_vertex_program */
- OPCODE_BIND_PROGRAM_NV,
- OPCODE_EXECUTE_PROGRAM_NV,
- OPCODE_REQUEST_RESIDENT_PROGRAMS_NV,
- OPCODE_LOAD_PROGRAM_NV,
- OPCODE_TRACK_MATRIX_NV,
- /* GL_NV_fragment_program */
- OPCODE_PROGRAM_LOCAL_PARAMETER_ARB,
- OPCODE_PROGRAM_NAMED_PARAMETER_NV,
- /* GL_EXT_stencil_two_side */
- OPCODE_ACTIVE_STENCIL_FACE_EXT,
- /* GL_EXT_depth_bounds_test */
- OPCODE_DEPTH_BOUNDS_EXT,
- /* GL_ARB_vertex/fragment_program */
- OPCODE_PROGRAM_STRING_ARB,
- OPCODE_PROGRAM_ENV_PARAMETER_ARB,
- /* GL_ARB_occlusion_query */
- OPCODE_BEGIN_QUERY_ARB,
- OPCODE_END_QUERY_ARB,
- /* GL_ARB_draw_buffers */
- OPCODE_DRAW_BUFFERS_ARB,
- /* GL_ATI_fragment_shader */
- OPCODE_TEX_BUMP_PARAMETER_ATI,
- /* GL_ATI_fragment_shader */
- OPCODE_BIND_FRAGMENT_SHADER_ATI,
- OPCODE_SET_FRAGMENT_SHADER_CONSTANTS_ATI,
- /* OpenGL 2.0 */
- OPCODE_STENCIL_FUNC_SEPARATE,
- OPCODE_STENCIL_OP_SEPARATE,
- OPCODE_STENCIL_MASK_SEPARATE,
-
- /* GL_ARB_shader_objects */
- OPCODE_USE_PROGRAM,
- OPCODE_UNIFORM_1F,
- OPCODE_UNIFORM_2F,
- OPCODE_UNIFORM_3F,
- OPCODE_UNIFORM_4F,
- OPCODE_UNIFORM_1FV,
- OPCODE_UNIFORM_2FV,
- OPCODE_UNIFORM_3FV,
- OPCODE_UNIFORM_4FV,
- OPCODE_UNIFORM_1I,
- OPCODE_UNIFORM_2I,
- OPCODE_UNIFORM_3I,
- OPCODE_UNIFORM_4I,
- OPCODE_UNIFORM_1IV,
- OPCODE_UNIFORM_2IV,
- OPCODE_UNIFORM_3IV,
- OPCODE_UNIFORM_4IV,
- OPCODE_UNIFORM_MATRIX22,
- OPCODE_UNIFORM_MATRIX33,
- OPCODE_UNIFORM_MATRIX44,
- OPCODE_UNIFORM_MATRIX23,
- OPCODE_UNIFORM_MATRIX32,
- OPCODE_UNIFORM_MATRIX24,
- OPCODE_UNIFORM_MATRIX42,
- OPCODE_UNIFORM_MATRIX34,
- OPCODE_UNIFORM_MATRIX43,
-
- /* OpenGL 3.0 */
- OPCODE_UNIFORM_1UI,
- OPCODE_UNIFORM_2UI,
- OPCODE_UNIFORM_3UI,
- OPCODE_UNIFORM_4UI,
- OPCODE_UNIFORM_1UIV,
- OPCODE_UNIFORM_2UIV,
- OPCODE_UNIFORM_3UIV,
- OPCODE_UNIFORM_4UIV,
-
- /* GL_ARB_color_buffer_float */
- OPCODE_CLAMP_COLOR,
-
- /* GL_EXT_framebuffer_blit */
- OPCODE_BLIT_FRAMEBUFFER,
-
- /* Vertex attributes -- fallback for when optimized display
- * list build isn't active.
- */
- OPCODE_ATTR_1F_NV,
- OPCODE_ATTR_2F_NV,
- OPCODE_ATTR_3F_NV,
- OPCODE_ATTR_4F_NV,
- OPCODE_ATTR_1F_ARB,
- OPCODE_ATTR_2F_ARB,
- OPCODE_ATTR_3F_ARB,
- OPCODE_ATTR_4F_ARB,
- OPCODE_MATERIAL,
- OPCODE_BEGIN,
- OPCODE_END,
- OPCODE_RECTF,
- OPCODE_EVAL_C1,
- OPCODE_EVAL_C2,
- OPCODE_EVAL_P1,
- OPCODE_EVAL_P2,
-
- /* GL_EXT_provoking_vertex */
- OPCODE_PROVOKING_VERTEX,
-
- /* GL_EXT_transform_feedback */
- OPCODE_BEGIN_TRANSFORM_FEEDBACK,
- OPCODE_END_TRANSFORM_FEEDBACK,
-
- /* GL_EXT_texture_integer */
- OPCODE_CLEARCOLOR_I,
- OPCODE_CLEARCOLOR_UI,
- OPCODE_TEXPARAMETER_I,
- OPCODE_TEXPARAMETER_UI,
-
- /* GL_EXT_separate_shader_objects */
- OPCODE_ACTIVE_PROGRAM_EXT,
- OPCODE_USE_SHADER_PROGRAM_EXT,
-
- /* GL_ARB_instanced_arrays */
- OPCODE_VERTEX_ATTRIB_DIVISOR,
-
- /* GL_NV_texture_barrier */
- OPCODE_TEXTURE_BARRIER_NV,
-
- /* GL_ARB_sampler_object */
- OPCODE_BIND_SAMPLER,
-
- /* The following three are meta instructions */
- OPCODE_ERROR, /* raise compiled-in error */
- OPCODE_CONTINUE,
- OPCODE_END_OF_LIST,
- OPCODE_EXT_0
-} OpCode;
-
-
-
-/**
- * Display list node.
- *
- * Display list instructions are stored as sequences of "nodes". Nodes
- * are allocated in blocks. Each block has BLOCK_SIZE nodes. Blocks
- * are linked together with a pointer.
- *
- * Each instruction in the display list is stored as a sequence of
- * contiguous nodes in memory.
- * Each node is the union of a variety of data types.
- */
-union gl_dlist_node
-{
- OpCode opcode;
- GLboolean b;
- GLbitfield bf;
- GLubyte ub;
- GLshort s;
- GLushort us;
- GLint i;
- GLuint ui;
- GLenum e;
- GLfloat f;
- GLvoid *data;
- void *next; /* If prev node's opcode==OPCODE_CONTINUE */
-};
-
-
-typedef union gl_dlist_node Node;
-
-
-/**
- * How many nodes to allocate at a time.
- *
- * \note Reduced now that we hold vertices etc. elsewhere.
- */
-#define BLOCK_SIZE 256
-
-
-
-/**
- * Number of nodes of storage needed for each instruction.
- * Sizes for dynamically allocated opcodes are stored in the context struct.
- */
-static GLuint InstSize[OPCODE_END_OF_LIST + 1];
-
-
-#if FEATURE_dlist
-
-
-void mesa_print_display_list(GLuint list);
-
-
-/**********************************************************************/
-/***** Private *****/
-/**********************************************************************/
-
-
-/**
- * Make an empty display list. This is used by glGenLists() to
- * reserve display list IDs.
- */
-static struct gl_display_list *
-make_list(GLuint name, GLuint count)
-{
- struct gl_display_list *dlist = CALLOC_STRUCT(gl_display_list);
- dlist->Name = name;
- dlist->Head = (Node *) malloc(sizeof(Node) * count);
- dlist->Head[0].opcode = OPCODE_END_OF_LIST;
- return dlist;
-}
-
-
-/**
- * Lookup function to just encapsulate casting.
- */
-static INLINE struct gl_display_list *
-lookup_list(struct gl_context *ctx, GLuint list)
-{
- return (struct gl_display_list *)
- _mesa_HashLookup(ctx->Shared->DisplayList, list);
-}
-
-
-/** Is the given opcode an extension code? */
-static INLINE GLboolean
-is_ext_opcode(OpCode opcode)
-{
- return (opcode >= OPCODE_EXT_0);
-}
-
-
-/** Destroy an extended opcode instruction */
-static GLint
-ext_opcode_destroy(struct gl_context *ctx, Node *node)
-{
- const GLint i = node[0].opcode - OPCODE_EXT_0;
- GLint step;
- ctx->ListExt->Opcode[i].Destroy(ctx, &node[1]);
- step = ctx->ListExt->Opcode[i].Size;
- return step;
-}
-
-
-/** Execute an extended opcode instruction */
-static GLint
-ext_opcode_execute(struct gl_context *ctx, Node *node)
-{
- const GLint i = node[0].opcode - OPCODE_EXT_0;
- GLint step;
- ctx->ListExt->Opcode[i].Execute(ctx, &node[1]);
- step = ctx->ListExt->Opcode[i].Size;
- return step;
-}
-
-
-/** Print an extended opcode instruction */
-static GLint
-ext_opcode_print(struct gl_context *ctx, Node *node)
-{
- const GLint i = node[0].opcode - OPCODE_EXT_0;
- GLint step;
- ctx->ListExt->Opcode[i].Print(ctx, &node[1]);
- step = ctx->ListExt->Opcode[i].Size;
- return step;
-}
-
-
-/**
- * Delete the named display list, but don't remove from hash table.
- * \param dlist - display list pointer
- */
-void
-_mesa_delete_list(struct gl_context *ctx, struct gl_display_list *dlist)
-{
- Node *n, *block;
- GLboolean done;
-
- n = block = dlist->Head;
-
- done = block ? GL_FALSE : GL_TRUE;
- while (!done) {
- const OpCode opcode = n[0].opcode;
-
- /* check for extension opcodes first */
- if (is_ext_opcode(opcode)) {
- n += ext_opcode_destroy(ctx, n);
- }
- else {
- switch (opcode) {
- /* for some commands, we need to free malloc'd memory */
- case OPCODE_MAP1:
- free(n[6].data);
- n += InstSize[n[0].opcode];
- break;
- case OPCODE_MAP2:
- free(n[10].data);
- n += InstSize[n[0].opcode];
- break;
- case OPCODE_DRAW_PIXELS:
- free(n[5].data);
- n += InstSize[n[0].opcode];
- break;
- case OPCODE_BITMAP:
- free(n[7].data);
- n += InstSize[n[0].opcode];
- break;
- case OPCODE_COLOR_TABLE:
- free(n[6].data);
- n += InstSize[n[0].opcode];
- break;
- case OPCODE_COLOR_SUB_TABLE:
- free(n[6].data);
- n += InstSize[n[0].opcode];
- break;
- case OPCODE_CONVOLUTION_FILTER_1D:
- free(n[6].data);
- n += InstSize[n[0].opcode];
- break;
- case OPCODE_CONVOLUTION_FILTER_2D:
- free(n[7].data);
- n += InstSize[n[0].opcode];
- break;
- case OPCODE_POLYGON_STIPPLE:
- free(n[1].data);
- n += InstSize[n[0].opcode];
- break;
- case OPCODE_TEX_IMAGE1D:
- free(n[8].data);
- n += InstSize[n[0].opcode];
- break;
- case OPCODE_TEX_IMAGE2D:
- free(n[9].data);
- n += InstSize[n[0].opcode];
- break;
- case OPCODE_TEX_IMAGE3D:
- free(n[10].data);
- n += InstSize[n[0].opcode];
- break;
- case OPCODE_TEX_SUB_IMAGE1D:
- free(n[7].data);
- n += InstSize[n[0].opcode];
- break;
- case OPCODE_TEX_SUB_IMAGE2D:
- free(n[9].data);
- n += InstSize[n[0].opcode];
- break;
- case OPCODE_TEX_SUB_IMAGE3D:
- free(n[11].data);
- n += InstSize[n[0].opcode];
- break;
- case OPCODE_COMPRESSED_TEX_IMAGE_1D:
- free(n[7].data);
- n += InstSize[n[0].opcode];
- break;
- case OPCODE_COMPRESSED_TEX_IMAGE_2D:
- free(n[8].data);
- n += InstSize[n[0].opcode];
- break;
- case OPCODE_COMPRESSED_TEX_IMAGE_3D:
- free(n[9].data);
- n += InstSize[n[0].opcode];
- break;
- case OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D:
- free(n[7].data);
- n += InstSize[n[0].opcode];
- break;
- case OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D:
- free(n[9].data);
- n += InstSize[n[0].opcode];
- break;
- case OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D:
- free(n[11].data);
- n += InstSize[n[0].opcode];
- break;
-#if FEATURE_NV_vertex_program
- case OPCODE_LOAD_PROGRAM_NV:
- free(n[4].data); /* program string */
- n += InstSize[n[0].opcode];
- break;
- case OPCODE_REQUEST_RESIDENT_PROGRAMS_NV:
- free(n[2].data); /* array of program ids */
- n += InstSize[n[0].opcode];
- break;
-#endif
-#if FEATURE_NV_fragment_program
- case OPCODE_PROGRAM_NAMED_PARAMETER_NV:
- free(n[3].data); /* parameter name */
- n += InstSize[n[0].opcode];
- break;
-#endif
-#if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
- case OPCODE_PROGRAM_STRING_ARB:
- free(n[4].data); /* program string */
- n += InstSize[n[0].opcode];
- break;
-#endif
- case OPCODE_UNIFORM_1FV:
- case OPCODE_UNIFORM_2FV:
- case OPCODE_UNIFORM_3FV:
- case OPCODE_UNIFORM_4FV:
- case OPCODE_UNIFORM_1IV:
- case OPCODE_UNIFORM_2IV:
- case OPCODE_UNIFORM_3IV:
- case OPCODE_UNIFORM_4IV:
- case OPCODE_UNIFORM_1UIV:
- case OPCODE_UNIFORM_2UIV:
- case OPCODE_UNIFORM_3UIV:
- case OPCODE_UNIFORM_4UIV:
- free(n[3].data);
- n += InstSize[n[0].opcode];
- break;
- case OPCODE_UNIFORM_MATRIX22:
- case OPCODE_UNIFORM_MATRIX33:
- case OPCODE_UNIFORM_MATRIX44:
- case OPCODE_UNIFORM_MATRIX24:
- case OPCODE_UNIFORM_MATRIX42:
- case OPCODE_UNIFORM_MATRIX23:
- case OPCODE_UNIFORM_MATRIX32:
- case OPCODE_UNIFORM_MATRIX34:
- case OPCODE_UNIFORM_MATRIX43:
- free(n[4].data);
- n += InstSize[n[0].opcode];
- break;
-
- case OPCODE_CONTINUE:
- n = (Node *) n[1].next;
- free(block);
- block = n;
- break;
- case OPCODE_END_OF_LIST:
- free(block);
- done = GL_TRUE;
- break;
- default:
- /* Most frequent case */
- n += InstSize[n[0].opcode];
- break;
- }
- }
- }
-
- free(dlist);
-}
-
-
-/**
- * Destroy a display list and remove from hash table.
- * \param list - display list number
- */
-static void
-destroy_list(struct gl_context *ctx, GLuint list)
-{
- struct gl_display_list *dlist;
-
- if (list == 0)
- return;
-
- dlist = lookup_list(ctx, list);
- if (!dlist)
- return;
-
- _mesa_delete_list(ctx, dlist);
- _mesa_HashRemove(ctx->Shared->DisplayList, list);
-}
-
-
-/*
- * Translate the nth element of list from <type> to GLint.
- */
-static GLint
-translate_id(GLsizei n, GLenum type, const GLvoid * list)
-{
- GLbyte *bptr;
- GLubyte *ubptr;
- GLshort *sptr;
- GLushort *usptr;
- GLint *iptr;
- GLuint *uiptr;
- GLfloat *fptr;
-
- switch (type) {
- case GL_BYTE:
- bptr = (GLbyte *) list;
- return (GLint) bptr[n];
- case GL_UNSIGNED_BYTE:
- ubptr = (GLubyte *) list;
- return (GLint) ubptr[n];
- case GL_SHORT:
- sptr = (GLshort *) list;
- return (GLint) sptr[n];
- case GL_UNSIGNED_SHORT:
- usptr = (GLushort *) list;
- return (GLint) usptr[n];
- case GL_INT:
- iptr = (GLint *) list;
- return iptr[n];
- case GL_UNSIGNED_INT:
- uiptr = (GLuint *) list;
- return (GLint) uiptr[n];
- case GL_FLOAT:
- fptr = (GLfloat *) list;
- return (GLint) FLOORF(fptr[n]);
- case GL_2_BYTES:
- ubptr = ((GLubyte *) list) + 2 * n;
- return (GLint) ubptr[0] * 256
- + (GLint) ubptr[1];
- case GL_3_BYTES:
- ubptr = ((GLubyte *) list) + 3 * n;
- return (GLint) ubptr[0] * 65536
- + (GLint) ubptr[1] * 256
- + (GLint) ubptr[2];
- case GL_4_BYTES:
- ubptr = ((GLubyte *) list) + 4 * n;
- return (GLint) ubptr[0] * 16777216
- + (GLint) ubptr[1] * 65536
- + (GLint) ubptr[2] * 256
- + (GLint) ubptr[3];
- default:
- return 0;
- }
-}
-
-
-
-
-/**********************************************************************/
-/***** Public *****/
-/**********************************************************************/
-
-/**
- * Wrapper for _mesa_unpack_image() that handles pixel buffer objects.
- * If we run out of memory, GL_OUT_OF_MEMORY will be recorded.
- */
-static GLvoid *
-unpack_image(struct gl_context *ctx, GLuint dimensions,
- GLsizei width, GLsizei height, GLsizei depth,
- GLenum format, GLenum type, const GLvoid * pixels,
- const struct gl_pixelstore_attrib *unpack)
-{
- if (!_mesa_is_bufferobj(unpack->BufferObj)) {
- /* no PBO */
- GLvoid *image = _mesa_unpack_image(dimensions, width, height, depth,
- format, type, pixels, unpack);
- if (pixels && !image) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "display list construction");
- }
- return image;
- }
- else if (_mesa_validate_pbo_access(dimensions, unpack, width, height,
- depth, format, type, INT_MAX, pixels)) {
- const GLubyte *map, *src;
- GLvoid *image;
-
- map = (GLubyte *)
- ctx->Driver.MapBuffer(ctx, GL_PIXEL_UNPACK_BUFFER_EXT,
- GL_READ_ONLY_ARB, unpack->BufferObj);
- if (!map) {
- /* unable to map src buffer! */
- _mesa_error(ctx, GL_INVALID_OPERATION, "unable to map PBO");
- return NULL;
- }
-
- src = ADD_POINTERS(map, pixels);
- image = _mesa_unpack_image(dimensions, width, height, depth,
- format, type, src, unpack);
-
- ctx->Driver.UnmapBuffer(ctx, GL_PIXEL_UNPACK_BUFFER_EXT,
- unpack->BufferObj);
-
- if (!image) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "display list construction");
- }
- return image;
- }
- /* bad access! */
- return NULL;
-}
-
-
-/**
- * Allocate space for a display list instruction (opcode + payload space).
- * \param opcode the instruction opcode (OPCODE_* value)
- * \param bytes instruction payload size (not counting opcode)
- * \return pointer to allocated memory (the opcode space)
- */
-static Node *
-dlist_alloc(struct gl_context *ctx, OpCode opcode, GLuint bytes)
-{
- const GLuint numNodes = 1 + (bytes + sizeof(Node) - 1) / sizeof(Node);
- Node *n;
-
- if (opcode < (GLuint) OPCODE_EXT_0) {
- if (InstSize[opcode] == 0) {
- /* save instruction size now */
- InstSize[opcode] = numNodes;
- }
- else {
- /* make sure instruction size agrees */
- ASSERT(numNodes == InstSize[opcode]);
- }
- }
-
- if (ctx->ListState.CurrentPos + numNodes + 2 > BLOCK_SIZE) {
- /* This block is full. Allocate a new block and chain to it */
- Node *newblock;
- n = ctx->ListState.CurrentBlock + ctx->ListState.CurrentPos;
- n[0].opcode = OPCODE_CONTINUE;
- newblock = (Node *) malloc(sizeof(Node) * BLOCK_SIZE);
- if (!newblock) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "Building display list");
- return NULL;
- }
- n[1].next = (Node *) newblock;
- ctx->ListState.CurrentBlock = newblock;
- ctx->ListState.CurrentPos = 0;
- }
-
- n = ctx->ListState.CurrentBlock + ctx->ListState.CurrentPos;
- ctx->ListState.CurrentPos += numNodes;
-
- n[0].opcode = opcode;
-
- return n;
-}
-
-
-
-/**
- * Allocate space for a display list instruction. Used by callers outside
- * this file for things like VBO vertex data.
- *
- * \param opcode the instruction opcode (OPCODE_* value)
- * \param bytes instruction size in bytes, not counting opcode.
- * \return pointer to the usable data area (not including the internal
- * opcode).
- */
-void *
-_mesa_dlist_alloc(struct gl_context *ctx, GLuint opcode, GLuint bytes)
-{
- Node *n = dlist_alloc(ctx, (OpCode) opcode, bytes);
- if (n)
- return n + 1; /* return pointer to payload area, after opcode */
- else
- return NULL;
-}
-
-
-/**
- * This function allows modules and drivers to get their own opcodes
- * for extending display list functionality.
- * \param ctx the rendering context
- * \param size number of bytes for storing the new display list command
- * \param execute function to execute the new display list command
- * \param destroy function to destroy the new display list command
- * \param print function to print the new display list command
- * \return the new opcode number or -1 if error
- */
-GLint
-_mesa_dlist_alloc_opcode(struct gl_context *ctx,
- GLuint size,
- void (*execute) (struct gl_context *, void *),
- void (*destroy) (struct gl_context *, void *),
- void (*print) (struct gl_context *, void *))
-{
- if (ctx->ListExt->NumOpcodes < MAX_DLIST_EXT_OPCODES) {
- const GLuint i = ctx->ListExt->NumOpcodes++;
- ctx->ListExt->Opcode[i].Size =
- 1 + (size + sizeof(Node) - 1) / sizeof(Node);
- ctx->ListExt->Opcode[i].Execute = execute;
- ctx->ListExt->Opcode[i].Destroy = destroy;
- ctx->ListExt->Opcode[i].Print = print;
- return i + OPCODE_EXT_0;
- }
- return -1;
-}
-
-
-/**
- * Allocate space for a display list instruction. The space is basically
- * an array of Nodes where node[0] holds the opcode, node[1] is the first
- * function parameter, node[2] is the second parameter, etc.
- *
- * \param opcode one of OPCODE_x
- * \param nparams number of function parameters
- * \return pointer to start of instruction space
- */
-static INLINE Node *
-alloc_instruction(struct gl_context *ctx, OpCode opcode, GLuint nparams)
-{
- return dlist_alloc(ctx, opcode, nparams * sizeof(Node));
-}
-
-
-
-/*
- * Display List compilation functions
- */
-static void GLAPIENTRY
-save_Accum(GLenum op, GLfloat value)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = alloc_instruction(ctx, OPCODE_ACCUM, 2);
- if (n) {
- n[1].e = op;
- n[2].f = value;
- }
- if (ctx->ExecuteFlag) {
- CALL_Accum(ctx->Exec, (op, value));
- }
-}
-
-
-static void GLAPIENTRY
-save_AlphaFunc(GLenum func, GLclampf ref)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = alloc_instruction(ctx, OPCODE_ALPHA_FUNC, 2);
- if (n) {
- n[1].e = func;
- n[2].f = (GLfloat) ref;
- }
- if (ctx->ExecuteFlag) {
- CALL_AlphaFunc(ctx->Exec, (func, ref));
- }
-}
-
-
-static void GLAPIENTRY
-save_BindTexture(GLenum target, GLuint texture)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = alloc_instruction(ctx, OPCODE_BIND_TEXTURE, 2);
- if (n) {
- n[1].e = target;
- n[2].ui = texture;
- }
- if (ctx->ExecuteFlag) {
- CALL_BindTexture(ctx->Exec, (target, texture));
- }
-}
-
-
-static void GLAPIENTRY
-save_Bitmap(GLsizei width, GLsizei height,
- GLfloat xorig, GLfloat yorig,
- GLfloat xmove, GLfloat ymove, const GLubyte * pixels)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = alloc_instruction(ctx, OPCODE_BITMAP, 7);
- if (n) {
- n[1].i = (GLint) width;
- n[2].i = (GLint) height;
- n[3].f = xorig;
- n[4].f = yorig;
- n[5].f = xmove;
- n[6].f = ymove;
- n[7].data = _mesa_unpack_bitmap(width, height, pixels, &ctx->Unpack);
- }
- if (ctx->ExecuteFlag) {
- CALL_Bitmap(ctx->Exec, (width, height,
- xorig, yorig, xmove, ymove, pixels));
- }
-}
-
-
-static void GLAPIENTRY
-save_BlendEquation(GLenum mode)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = alloc_instruction(ctx, OPCODE_BLEND_EQUATION, 1);
- if (n) {
- n[1].e = mode;
- }
- if (ctx->ExecuteFlag) {
- CALL_BlendEquation(ctx->Exec, (mode));
- }
-}
-
-
-static void GLAPIENTRY
-save_BlendEquationSeparateEXT(GLenum modeRGB, GLenum modeA)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = alloc_instruction(ctx, OPCODE_BLEND_EQUATION_SEPARATE, 2);
- if (n) {
- n[1].e = modeRGB;
- n[2].e = modeA;
- }
- if (ctx->ExecuteFlag) {
- CALL_BlendEquationSeparateEXT(ctx->Exec, (modeRGB, modeA));
- }
-}
-
-
-static void GLAPIENTRY
-save_BlendFuncSeparateEXT(GLenum sfactorRGB, GLenum dfactorRGB,
- GLenum sfactorA, GLenum dfactorA)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = alloc_instruction(ctx, OPCODE_BLEND_FUNC_SEPARATE, 4);
- if (n) {
- n[1].e = sfactorRGB;
- n[2].e = dfactorRGB;
- n[3].e = sfactorA;
- n[4].e = dfactorA;
- }
- if (ctx->ExecuteFlag) {
- CALL_BlendFuncSeparateEXT(ctx->Exec,
- (sfactorRGB, dfactorRGB, sfactorA, dfactorA));
- }
-}
-
-
-static void GLAPIENTRY
-save_BlendFunc(GLenum srcfactor, GLenum dstfactor)
-{
- save_BlendFuncSeparateEXT(srcfactor, dstfactor, srcfactor, dstfactor);
-}
-
-
-static void GLAPIENTRY
-save_BlendColor(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = alloc_instruction(ctx, OPCODE_BLEND_COLOR, 4);
- if (n) {
- n[1].f = red;
- n[2].f = green;
- n[3].f = blue;
- n[4].f = alpha;
- }
- if (ctx->ExecuteFlag) {
- CALL_BlendColor(ctx->Exec, (red, green, blue, alpha));
- }
-}
-
-/* GL_ARB_draw_buffers_blend */
-static void GLAPIENTRY
-save_BlendFuncSeparatei(GLuint buf, GLenum sfactorRGB, GLenum dfactorRGB,
- GLenum sfactorA, GLenum dfactorA)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = alloc_instruction(ctx, OPCODE_BLEND_FUNC_SEPARATE_I, 5);
- if (n) {
- n[1].ui = buf;
- n[2].e = sfactorRGB;
- n[3].e = dfactorRGB;
- n[4].e = sfactorA;
- n[5].e = dfactorA;
- }
- if (ctx->ExecuteFlag) {
- CALL_BlendFuncSeparateiARB(ctx->Exec, (buf, sfactorRGB, dfactorRGB,
- sfactorA, dfactorA));
- }
-}
-
-/* GL_ARB_draw_buffers_blend */
-static void GLAPIENTRY
-save_BlendFunci(GLuint buf, GLenum sfactor, GLenum dfactor)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = alloc_instruction(ctx, OPCODE_BLEND_FUNC_SEPARATE_I, 3);
- if (n) {
- n[1].ui = buf;
- n[2].e = sfactor;
- n[3].e = dfactor;
- }
- if (ctx->ExecuteFlag) {
- CALL_BlendFunciARB(ctx->Exec, (buf, sfactor, dfactor));
- }
-}
-
-/* GL_ARB_draw_buffers_blend */
-static void GLAPIENTRY
-save_BlendEquationi(GLuint buf, GLenum mode)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = alloc_instruction(ctx, OPCODE_BLEND_EQUATION_I, 2);
- if (n) {
- n[1].ui = buf;
- n[2].e = mode;
- }
- if (ctx->ExecuteFlag) {
- CALL_BlendEquationiARB(ctx->Exec, (buf, mode));
- }
-}
-
-/* GL_ARB_draw_buffers_blend */
-static void GLAPIENTRY
-save_BlendEquationSeparatei(GLuint buf, GLenum modeRGB, GLenum modeA)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = alloc_instruction(ctx, OPCODE_BLEND_EQUATION_SEPARATE_I, 3);
- if (n) {
- n[1].ui = buf;
- n[2].e = modeRGB;
- n[3].e = modeA;
- }
- if (ctx->ExecuteFlag) {
- CALL_BlendEquationSeparateiARB(ctx->Exec, (buf, modeRGB, modeA));
- }
-}
-
-
-static void invalidate_saved_current_state( struct gl_context *ctx )
-{
- GLint i;
-
- for (i = 0; i < VERT_ATTRIB_MAX; i++)
- ctx->ListState.ActiveAttribSize[i] = 0;
-
- for (i = 0; i < MAT_ATTRIB_MAX; i++)
- ctx->ListState.ActiveMaterialSize[i] = 0;
-
- memset(&ctx->ListState.Current, 0, sizeof ctx->ListState.Current);
-
- ctx->Driver.CurrentSavePrimitive = PRIM_UNKNOWN;
-}
-
-static void GLAPIENTRY
-save_CallList(GLuint list)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- SAVE_FLUSH_VERTICES(ctx);
-
- n = alloc_instruction(ctx, OPCODE_CALL_LIST, 1);
- if (n) {
- n[1].ui = list;
- }
-
- /* After this, we don't know what state we're in. Invalidate all
- * cached information previously gathered:
- */
- invalidate_saved_current_state( ctx );
-
- if (ctx->ExecuteFlag) {
- _mesa_CallList(list);
- }
-}
-
-
-static void GLAPIENTRY
-save_CallLists(GLsizei num, GLenum type, const GLvoid * lists)
-{
- GET_CURRENT_CONTEXT(ctx);
- GLint i;
- GLboolean typeErrorFlag;
-
- SAVE_FLUSH_VERTICES(ctx);
-
- switch (type) {
- case GL_BYTE:
- case GL_UNSIGNED_BYTE:
- case GL_SHORT:
- case GL_UNSIGNED_SHORT:
- case GL_INT:
- case GL_UNSIGNED_INT:
- case GL_FLOAT:
- case GL_2_BYTES:
- case GL_3_BYTES:
- case GL_4_BYTES:
- typeErrorFlag = GL_FALSE;
- break;
- default:
- typeErrorFlag = GL_TRUE;
- }
-
- for (i = 0; i < num; i++) {
- GLint list = translate_id(i, type, lists);
- Node *n = alloc_instruction(ctx, OPCODE_CALL_LIST_OFFSET, 2);
- if (n) {
- n[1].i = list;
- n[2].b = typeErrorFlag;
- }
- }
-
- /* After this, we don't know what state we're in. Invalidate all
- * cached information previously gathered:
- */
- invalidate_saved_current_state( ctx );
-
- if (ctx->ExecuteFlag) {
- CALL_CallLists(ctx->Exec, (num, type, lists));
- }
-}
-
-
-static void GLAPIENTRY
-save_Clear(GLbitfield mask)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = alloc_instruction(ctx, OPCODE_CLEAR, 1);
- if (n) {
- n[1].bf = mask;
- }
- if (ctx->ExecuteFlag) {
- CALL_Clear(ctx->Exec, (mask));
- }
-}
-
-
-static void GLAPIENTRY
-save_ClearBufferiv(GLenum buffer, GLint drawbuffer, const GLint *value)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = alloc_instruction(ctx, OPCODE_CLEAR_BUFFER_IV, 6);
- if (n) {
- n[1].e = buffer;
- n[2].i = drawbuffer;
- n[3].i = value[0];
- if (buffer == GL_COLOR) {
- n[4].i = value[1];
- n[5].i = value[2];
- n[6].i = value[3];
- }
- else {
- n[4].i = 0;
- n[5].i = 0;
- n[6].i = 0;
- }
- }
- if (ctx->ExecuteFlag) {
- /*CALL_ClearBufferiv(ctx->Exec, (buffer, drawbuffer, value));*/
- }
-}
-
-
-static void GLAPIENTRY
-save_ClearBufferuiv(GLenum buffer, GLint drawbuffer, const GLuint *value)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = alloc_instruction(ctx, OPCODE_CLEAR_BUFFER_UIV, 6);
- if (n) {
- n[1].e = buffer;
- n[2].i = drawbuffer;
- n[3].ui = value[0];
- if (buffer == GL_COLOR) {
- n[4].ui = value[1];
- n[5].ui = value[2];
- n[6].ui = value[3];
- }
- else {
- n[4].ui = 0;
- n[5].ui = 0;
- n[6].ui = 0;
- }
- }
- if (ctx->ExecuteFlag) {
- /*CALL_ClearBufferuiv(ctx->Exec, (buffer, drawbuffer, value));*/
- }
-}
-
-
-static void GLAPIENTRY
-save_ClearBufferfv(GLenum buffer, GLint drawbuffer, const GLfloat *value)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = alloc_instruction(ctx, OPCODE_CLEAR_BUFFER_FV, 6);
- if (n) {
- n[1].e = buffer;
- n[2].i = drawbuffer;
- n[3].f = value[0];
- if (buffer == GL_COLOR) {
- n[4].f = value[1];
- n[5].f = value[2];
- n[6].f = value[3];
- }
- else {
- n[4].f = 0.0F;
- n[5].f = 0.0F;
- n[6].f = 0.0F;
- }
- }
- if (ctx->ExecuteFlag) {
- /*CALL_ClearBufferuiv(ctx->Exec, (buffer, drawbuffer, value));*/
- }
-}
-
-
-static void GLAPIENTRY
-save_ClearBufferfi(GLenum buffer, GLint drawbuffer,
- GLfloat depth, GLint stencil)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = alloc_instruction(ctx, OPCODE_CLEAR_BUFFER_FI, 4);
- if (n) {
- n[1].e = buffer;
- n[2].i = drawbuffer;
- n[3].f = depth;
- n[4].i = stencil;
- }
- if (ctx->ExecuteFlag) {
- /*CALL_ClearBufferfi(ctx->Exec, (buffer, drawbuffer, depth, stencil));*/
- }
-}
-
-
-static void GLAPIENTRY
-save_ClearAccum(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = alloc_instruction(ctx, OPCODE_CLEAR_ACCUM, 4);
- if (n) {
- n[1].f = red;
- n[2].f = green;
- n[3].f = blue;
- n[4].f = alpha;
- }
- if (ctx->ExecuteFlag) {
- CALL_ClearAccum(ctx->Exec, (red, green, blue, alpha));
- }
-}
-
-
-static void GLAPIENTRY
-save_ClearColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = alloc_instruction(ctx, OPCODE_CLEAR_COLOR, 4);
- if (n) {
- n[1].f = red;
- n[2].f = green;
- n[3].f = blue;
- n[4].f = alpha;
- }
- if (ctx->ExecuteFlag) {
- CALL_ClearColor(ctx->Exec, (red, green, blue, alpha));
- }
-}
-
-
-static void GLAPIENTRY
-save_ClearDepth(GLclampd depth)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = alloc_instruction(ctx, OPCODE_CLEAR_DEPTH, 1);
- if (n) {
- n[1].f = (GLfloat) depth;
- }
- if (ctx->ExecuteFlag) {
- CALL_ClearDepth(ctx->Exec, (depth));
- }
-}
-
-
-static void GLAPIENTRY
-save_ClearIndex(GLfloat c)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = alloc_instruction(ctx, OPCODE_CLEAR_INDEX, 1);
- if (n) {
- n[1].f = c;
- }
- if (ctx->ExecuteFlag) {
- CALL_ClearIndex(ctx->Exec, (c));
- }
-}
-
-
-static void GLAPIENTRY
-save_ClearStencil(GLint s)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = alloc_instruction(ctx, OPCODE_CLEAR_STENCIL, 1);
- if (n) {
- n[1].i = s;
- }
- if (ctx->ExecuteFlag) {
- CALL_ClearStencil(ctx->Exec, (s));
- }
-}
-
-
-static void GLAPIENTRY
-save_ClipPlane(GLenum plane, const GLdouble * equ)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = alloc_instruction(ctx, OPCODE_CLIP_PLANE, 5);
- if (n) {
- n[1].e = plane;
- n[2].f = (GLfloat) equ[0];
- n[3].f = (GLfloat) equ[1];
- n[4].f = (GLfloat) equ[2];
- n[5].f = (GLfloat) equ[3];
- }
- if (ctx->ExecuteFlag) {
- CALL_ClipPlane(ctx->Exec, (plane, equ));
- }
-}
-
-
-
-static void GLAPIENTRY
-save_ColorMask(GLboolean red, GLboolean green,
- GLboolean blue, GLboolean alpha)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = alloc_instruction(ctx, OPCODE_COLOR_MASK, 4);
- if (n) {
- n[1].b = red;
- n[2].b = green;
- n[3].b = blue;
- n[4].b = alpha;
- }
- if (ctx->ExecuteFlag) {
- CALL_ColorMask(ctx->Exec, (red, green, blue, alpha));
- }
-}
-
-
-static void GLAPIENTRY
-save_ColorMaskIndexed(GLuint buf, GLboolean red, GLboolean green,
- GLboolean blue, GLboolean alpha)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = alloc_instruction(ctx, OPCODE_COLOR_MASK_INDEXED, 5);
- if (n) {
- n[1].ui = buf;
- n[2].b = red;
- n[3].b = green;
- n[4].b = blue;
- n[5].b = alpha;
- }
- if (ctx->ExecuteFlag) {
- /*CALL_ColorMaskIndexedEXT(ctx->Exec, (buf, red, green, blue, alpha));*/
- }
-}
-
-
-static void GLAPIENTRY
-save_ColorMaterial(GLenum face, GLenum mode)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
-
- n = alloc_instruction(ctx, OPCODE_COLOR_MATERIAL, 2);
- if (n) {
- n[1].e = face;
- n[2].e = mode;
- }
- if (ctx->ExecuteFlag) {
- CALL_ColorMaterial(ctx->Exec, (face, mode));
- }
-}
-
-
-static void GLAPIENTRY
-save_ColorTable(GLenum target, GLenum internalFormat,
- GLsizei width, GLenum format, GLenum type,
- const GLvoid * table)
-{
- GET_CURRENT_CONTEXT(ctx);
- if (_mesa_is_proxy_texture(target)) {
- /* execute immediately */
- CALL_ColorTable(ctx->Exec, (target, internalFormat, width,
- format, type, table));
- }
- else {
- Node *n;
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = alloc_instruction(ctx, OPCODE_COLOR_TABLE, 6);
- if (n) {
- n[1].e = target;
- n[2].e = internalFormat;
- n[3].i = width;
- n[4].e = format;
- n[5].e = type;
- n[6].data = unpack_image(ctx, 1, width, 1, 1, format, type, table,
- &ctx->Unpack);
- }
- if (ctx->ExecuteFlag) {
- CALL_ColorTable(ctx->Exec, (target, internalFormat, width,
- format, type, table));
- }
- }
-}
-
-
-
-static void GLAPIENTRY
-save_ColorTableParameterfv(GLenum target, GLenum pname,
- const GLfloat *params)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
-
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
-
- n = alloc_instruction(ctx, OPCODE_COLOR_TABLE_PARAMETER_FV, 6);
- if (n) {
- n[1].e = target;
- n[2].e = pname;
- n[3].f = params[0];
- if (pname == GL_COLOR_TABLE_SGI ||
- pname == GL_POST_CONVOLUTION_COLOR_TABLE_SGI ||
- pname == GL_TEXTURE_COLOR_TABLE_SGI) {
- n[4].f = params[1];
- n[5].f = params[2];
- n[6].f = params[3];
- }
- }
-
- if (ctx->ExecuteFlag) {
- CALL_ColorTableParameterfv(ctx->Exec, (target, pname, params));
- }
-}
-
-
-static void GLAPIENTRY
-save_ColorTableParameteriv(GLenum target, GLenum pname, const GLint *params)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
-
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
-
- n = alloc_instruction(ctx, OPCODE_COLOR_TABLE_PARAMETER_IV, 6);
- if (n) {
- n[1].e = target;
- n[2].e = pname;
- n[3].i = params[0];
- if (pname == GL_COLOR_TABLE_SGI ||
- pname == GL_POST_CONVOLUTION_COLOR_TABLE_SGI ||
- pname == GL_TEXTURE_COLOR_TABLE_SGI) {
- n[4].i = params[1];
- n[5].i = params[2];
- n[6].i = params[3];
- }
- }
-
- if (ctx->ExecuteFlag) {
- CALL_ColorTableParameteriv(ctx->Exec, (target, pname, params));
- }
-}
-
-
-
-static void GLAPIENTRY
-save_ColorSubTable(GLenum target, GLsizei start, GLsizei count,
- GLenum format, GLenum type, const GLvoid * table)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = alloc_instruction(ctx, OPCODE_COLOR_SUB_TABLE, 6);
- if (n) {
- n[1].e = target;
- n[2].i = start;
- n[3].i = count;
- n[4].e = format;
- n[5].e = type;
- n[6].data = unpack_image(ctx, 1, count, 1, 1, format, type, table,
- &ctx->Unpack);
- }
- if (ctx->ExecuteFlag) {
- CALL_ColorSubTable(ctx->Exec,
- (target, start, count, format, type, table));
- }
-}
-
-
-static void GLAPIENTRY
-save_CopyColorSubTable(GLenum target, GLsizei start,
- GLint x, GLint y, GLsizei width)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
-
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = alloc_instruction(ctx, OPCODE_COPY_COLOR_SUB_TABLE, 5);
- if (n) {
- n[1].e = target;
- n[2].i = start;
- n[3].i = x;
- n[4].i = y;
- n[5].i = width;
- }
- if (ctx->ExecuteFlag) {
- CALL_CopyColorSubTable(ctx->Exec, (target, start, x, y, width));
- }
-}
-
-
-static void GLAPIENTRY
-save_CopyColorTable(GLenum target, GLenum internalformat,
- GLint x, GLint y, GLsizei width)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
-
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = alloc_instruction(ctx, OPCODE_COPY_COLOR_TABLE, 5);
- if (n) {
- n[1].e = target;
- n[2].e = internalformat;
- n[3].i = x;
- n[4].i = y;
- n[5].i = width;
- }
- if (ctx->ExecuteFlag) {
- CALL_CopyColorTable(ctx->Exec, (target, internalformat, x, y, width));
- }
-}
-
-
-static void GLAPIENTRY
-save_ConvolutionFilter1D(GLenum target, GLenum internalFormat, GLsizei width,
- GLenum format, GLenum type, const GLvoid * filter)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
-
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
-
- n = alloc_instruction(ctx, OPCODE_CONVOLUTION_FILTER_1D, 6);
- if (n) {
- n[1].e = target;
- n[2].e = internalFormat;
- n[3].i = width;
- n[4].e = format;
- n[5].e = type;
- n[6].data = unpack_image(ctx, 1, width, 1, 1, format, type, filter,
- &ctx->Unpack);
- }
- if (ctx->ExecuteFlag) {
- CALL_ConvolutionFilter1D(ctx->Exec, (target, internalFormat, width,
- format, type, filter));
- }
-}
-
-
-static void GLAPIENTRY
-save_ConvolutionFilter2D(GLenum target, GLenum internalFormat,
- GLsizei width, GLsizei height, GLenum format,
- GLenum type, const GLvoid * filter)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
-
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
-
- n = alloc_instruction(ctx, OPCODE_CONVOLUTION_FILTER_2D, 7);
- if (n) {
- n[1].e = target;
- n[2].e = internalFormat;
- n[3].i = width;
- n[4].i = height;
- n[5].e = format;
- n[6].e = type;
- n[7].data = unpack_image(ctx, 2, width, height, 1, format, type, filter,
- &ctx->Unpack);
- }
- if (ctx->ExecuteFlag) {
- CALL_ConvolutionFilter2D(ctx->Exec,
- (target, internalFormat, width, height, format,
- type, filter));
- }
-}
-
-
-static void GLAPIENTRY
-save_ConvolutionParameteri(GLenum target, GLenum pname, GLint param)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = alloc_instruction(ctx, OPCODE_CONVOLUTION_PARAMETER_I, 3);
- if (n) {
- n[1].e = target;
- n[2].e = pname;
- n[3].i = param;
- }
- if (ctx->ExecuteFlag) {
- CALL_ConvolutionParameteri(ctx->Exec, (target, pname, param));
- }
-}
-
-
-static void GLAPIENTRY
-save_ConvolutionParameteriv(GLenum target, GLenum pname, const GLint *params)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = alloc_instruction(ctx, OPCODE_CONVOLUTION_PARAMETER_IV, 6);
- if (n) {
- n[1].e = target;
- n[2].e = pname;
- n[3].i = params[0];
- if (pname == GL_CONVOLUTION_BORDER_COLOR ||
- pname == GL_CONVOLUTION_FILTER_SCALE ||
- pname == GL_CONVOLUTION_FILTER_BIAS) {
- n[4].i = params[1];
- n[5].i = params[2];
- n[6].i = params[3];
- }
- else {
- n[4].i = n[5].i = n[6].i = 0;
- }
- }
- if (ctx->ExecuteFlag) {
- CALL_ConvolutionParameteriv(ctx->Exec, (target, pname, params));
- }
-}
-
-
-static void GLAPIENTRY
-save_ConvolutionParameterf(GLenum target, GLenum pname, GLfloat param)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = alloc_instruction(ctx, OPCODE_CONVOLUTION_PARAMETER_F, 3);
- if (n) {
- n[1].e = target;
- n[2].e = pname;
- n[3].f = param;
- }
- if (ctx->ExecuteFlag) {
- CALL_ConvolutionParameterf(ctx->Exec, (target, pname, param));
- }
-}
-
-
-static void GLAPIENTRY
-save_ConvolutionParameterfv(GLenum target, GLenum pname,
- const GLfloat *params)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = alloc_instruction(ctx, OPCODE_CONVOLUTION_PARAMETER_FV, 6);
- if (n) {
- n[1].e = target;
- n[2].e = pname;
- n[3].f = params[0];
- if (pname == GL_CONVOLUTION_BORDER_COLOR ||
- pname == GL_CONVOLUTION_FILTER_SCALE ||
- pname == GL_CONVOLUTION_FILTER_BIAS) {
- n[4].f = params[1];
- n[5].f = params[2];
- n[6].f = params[3];
- }
- else {
- n[4].f = n[5].f = n[6].f = 0.0F;
- }
- }
- if (ctx->ExecuteFlag) {
- CALL_ConvolutionParameterfv(ctx->Exec, (target, pname, params));
- }
-}
-
-
-static void GLAPIENTRY
-save_CopyPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum type)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = alloc_instruction(ctx, OPCODE_COPY_PIXELS, 5);
- if (n) {
- n[1].i = x;
- n[2].i = y;
- n[3].i = (GLint) width;
- n[4].i = (GLint) height;
- n[5].e = type;
- }
- if (ctx->ExecuteFlag) {
- CALL_CopyPixels(ctx->Exec, (x, y, width, height, type));
- }
-}
-
-
-
-static void GLAPIENTRY
-save_CopyTexImage1D(GLenum target, GLint level, GLenum internalformat,
- GLint x, GLint y, GLsizei width, GLint border)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = alloc_instruction(ctx, OPCODE_COPY_TEX_IMAGE1D, 7);
- if (n) {
- n[1].e = target;
- n[2].i = level;
- n[3].e = internalformat;
- n[4].i = x;
- n[5].i = y;
- n[6].i = width;
- n[7].i = border;
- }
- if (ctx->ExecuteFlag) {
- CALL_CopyTexImage1D(ctx->Exec, (target, level, internalformat,
- x, y, width, border));
- }
-}
-
-
-static void GLAPIENTRY
-save_CopyTexImage2D(GLenum target, GLint level,
- GLenum internalformat,
- GLint x, GLint y, GLsizei width,
- GLsizei height, GLint border)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = alloc_instruction(ctx, OPCODE_COPY_TEX_IMAGE2D, 8);
- if (n) {
- n[1].e = target;
- n[2].i = level;
- n[3].e = internalformat;
- n[4].i = x;
- n[5].i = y;
- n[6].i = width;
- n[7].i = height;
- n[8].i = border;
- }
- if (ctx->ExecuteFlag) {
- CALL_CopyTexImage2D(ctx->Exec, (target, level, internalformat,
- x, y, width, height, border));
- }
-}
-
-
-
-static void GLAPIENTRY
-save_CopyTexSubImage1D(GLenum target, GLint level,
- GLint xoffset, GLint x, GLint y, GLsizei width)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = alloc_instruction(ctx, OPCODE_COPY_TEX_SUB_IMAGE1D, 6);
- if (n) {
- n[1].e = target;
- n[2].i = level;
- n[3].i = xoffset;
- n[4].i = x;
- n[5].i = y;
- n[6].i = width;
- }
- if (ctx->ExecuteFlag) {
- CALL_CopyTexSubImage1D(ctx->Exec,
- (target, level, xoffset, x, y, width));
- }
-}
-
-
-static void GLAPIENTRY
-save_CopyTexSubImage2D(GLenum target, GLint level,
- GLint xoffset, GLint yoffset,
- GLint x, GLint y, GLsizei width, GLint height)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = alloc_instruction(ctx, OPCODE_COPY_TEX_SUB_IMAGE2D, 8);
- if (n) {
- n[1].e = target;
- n[2].i = level;
- n[3].i = xoffset;
- n[4].i = yoffset;
- n[5].i = x;
- n[6].i = y;
- n[7].i = width;
- n[8].i = height;
- }
- if (ctx->ExecuteFlag) {
- CALL_CopyTexSubImage2D(ctx->Exec, (target, level, xoffset, yoffset,
- x, y, width, height));
- }
-}
-
-
-static void GLAPIENTRY
-save_CopyTexSubImage3D(GLenum target, GLint level,
- GLint xoffset, GLint yoffset, GLint zoffset,
- GLint x, GLint y, GLsizei width, GLint height)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = alloc_instruction(ctx, OPCODE_COPY_TEX_SUB_IMAGE3D, 9);
- if (n) {
- n[1].e = target;
- n[2].i = level;
- n[3].i = xoffset;
- n[4].i = yoffset;
- n[5].i = zoffset;
- n[6].i = x;
- n[7].i = y;
- n[8].i = width;
- n[9].i = height;
- }
- if (ctx->ExecuteFlag) {
- CALL_CopyTexSubImage3D(ctx->Exec, (target, level,
- xoffset, yoffset, zoffset,
- x, y, width, height));
- }
-}
-
-
-static void GLAPIENTRY
-save_CullFace(GLenum mode)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = alloc_instruction(ctx, OPCODE_CULL_FACE, 1);
- if (n) {
- n[1].e = mode;
- }
- if (ctx->ExecuteFlag) {
- CALL_CullFace(ctx->Exec, (mode));
- }
-}
-
-
-static void GLAPIENTRY
-save_DepthFunc(GLenum func)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = alloc_instruction(ctx, OPCODE_DEPTH_FUNC, 1);
- if (n) {
- n[1].e = func;
- }
- if (ctx->ExecuteFlag) {
- CALL_DepthFunc(ctx->Exec, (func));
- }
-}
-
-
-static void GLAPIENTRY
-save_DepthMask(GLboolean mask)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = alloc_instruction(ctx, OPCODE_DEPTH_MASK, 1);
- if (n) {
- n[1].b = mask;
- }
- if (ctx->ExecuteFlag) {
- CALL_DepthMask(ctx->Exec, (mask));
- }
-}
-
-
-static void GLAPIENTRY
-save_DepthRange(GLclampd nearval, GLclampd farval)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = alloc_instruction(ctx, OPCODE_DEPTH_RANGE, 2);
- if (n) {
- n[1].f = (GLfloat) nearval;
- n[2].f = (GLfloat) farval;
- }
- if (ctx->ExecuteFlag) {
- CALL_DepthRange(ctx->Exec, (nearval, farval));
- }
-}
-
-
-static void GLAPIENTRY
-save_Disable(GLenum cap)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = alloc_instruction(ctx, OPCODE_DISABLE, 1);
- if (n) {
- n[1].e = cap;
- }
- if (ctx->ExecuteFlag) {
- CALL_Disable(ctx->Exec, (cap));
- }
-}
-
-
-static void GLAPIENTRY
-save_DisableIndexed(GLuint index, GLenum cap)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = alloc_instruction(ctx, OPCODE_DISABLE_INDEXED, 2);
- if (n) {
- n[1].ui = index;
- n[2].e = cap;
- }
- if (ctx->ExecuteFlag) {
- CALL_DisableIndexedEXT(ctx->Exec, (index, cap));
- }
-}
-
-
-static void GLAPIENTRY
-save_DrawBuffer(GLenum mode)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = alloc_instruction(ctx, OPCODE_DRAW_BUFFER, 1);
- if (n) {
- n[1].e = mode;
- }
- if (ctx->ExecuteFlag) {
- CALL_DrawBuffer(ctx->Exec, (mode));
- }
-}
-
-
-static void GLAPIENTRY
-save_DrawPixels(GLsizei width, GLsizei height,
- GLenum format, GLenum type, const GLvoid * pixels)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
-
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
-
- n = alloc_instruction(ctx, OPCODE_DRAW_PIXELS, 5);
- if (n) {
- n[1].i = width;
- n[2].i = height;
- n[3].e = format;
- n[4].e = type;
- n[5].data = unpack_image(ctx, 2, width, height, 1, format, type,
- pixels, &ctx->Unpack);
- }
- if (ctx->ExecuteFlag) {
- CALL_DrawPixels(ctx->Exec, (width, height, format, type, pixels));
- }
-}
-
-
-
-static void GLAPIENTRY
-save_Enable(GLenum cap)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = alloc_instruction(ctx, OPCODE_ENABLE, 1);
- if (n) {
- n[1].e = cap;
- }
- if (ctx->ExecuteFlag) {
- CALL_Enable(ctx->Exec, (cap));
- }
-}
-
-
-
-static void GLAPIENTRY
-save_EnableIndexed(GLuint index, GLenum cap)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = alloc_instruction(ctx, OPCODE_ENABLE_INDEXED, 2);
- if (n) {
- n[1].ui = index;
- n[2].e = cap;
- }
- if (ctx->ExecuteFlag) {
- CALL_EnableIndexedEXT(ctx->Exec, (index, cap));
- }
-}
-
-
-
-static void GLAPIENTRY
-save_EvalMesh1(GLenum mode, GLint i1, GLint i2)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = alloc_instruction(ctx, OPCODE_EVALMESH1, 3);
- if (n) {
- n[1].e = mode;
- n[2].i = i1;
- n[3].i = i2;
- }
- if (ctx->ExecuteFlag) {
- CALL_EvalMesh1(ctx->Exec, (mode, i1, i2));
- }
-}
-
-
-static void GLAPIENTRY
-save_EvalMesh2(GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = alloc_instruction(ctx, OPCODE_EVALMESH2, 5);
- if (n) {
- n[1].e = mode;
- n[2].i = i1;
- n[3].i = i2;
- n[4].i = j1;
- n[5].i = j2;
- }
- if (ctx->ExecuteFlag) {
- CALL_EvalMesh2(ctx->Exec, (mode, i1, i2, j1, j2));
- }
-}
-
-
-
-
-static void GLAPIENTRY
-save_Fogfv(GLenum pname, const GLfloat *params)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = alloc_instruction(ctx, OPCODE_FOG, 5);
- if (n) {
- n[1].e = pname;
- n[2].f = params[0];
- n[3].f = params[1];
- n[4].f = params[2];
- n[5].f = params[3];
- }
- if (ctx->ExecuteFlag) {
- CALL_Fogfv(ctx->Exec, (pname, params));
- }
-}
-
-
-static void GLAPIENTRY
-save_Fogf(GLenum pname, GLfloat param)
-{
- GLfloat parray[4];
- parray[0] = param;
- parray[1] = parray[2] = parray[3] = 0.0F;
- save_Fogfv(pname, parray);
-}
-
-
-static void GLAPIENTRY
-save_Fogiv(GLenum pname, const GLint *params)
-{
- GLfloat p[4];
- switch (pname) {
- case GL_FOG_MODE:
- case GL_FOG_DENSITY:
- case GL_FOG_START:
- case GL_FOG_END:
- case GL_FOG_INDEX:
- p[0] = (GLfloat) *params;
- p[1] = 0.0f;
- p[2] = 0.0f;
- p[3] = 0.0f;
- break;
- case GL_FOG_COLOR:
- p[0] = INT_TO_FLOAT(params[0]);
- p[1] = INT_TO_FLOAT(params[1]);
- p[2] = INT_TO_FLOAT(params[2]);
- p[3] = INT_TO_FLOAT(params[3]);
- break;
- default:
- /* Error will be caught later in gl_Fogfv */
- ASSIGN_4V(p, 0.0F, 0.0F, 0.0F, 0.0F);
- }
- save_Fogfv(pname, p);
-}
-
-
-static void GLAPIENTRY
-save_Fogi(GLenum pname, GLint param)
-{
- GLint parray[4];
- parray[0] = param;
- parray[1] = parray[2] = parray[3] = 0;
- save_Fogiv(pname, parray);
-}
-
-
-static void GLAPIENTRY
-save_FrontFace(GLenum mode)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = alloc_instruction(ctx, OPCODE_FRONT_FACE, 1);
- if (n) {
- n[1].e = mode;
- }
- if (ctx->ExecuteFlag) {
- CALL_FrontFace(ctx->Exec, (mode));
- }
-}
-
-
-static void GLAPIENTRY
-save_Frustum(GLdouble left, GLdouble right,
- GLdouble bottom, GLdouble top, GLdouble nearval, GLdouble farval)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = alloc_instruction(ctx, OPCODE_FRUSTUM, 6);
- if (n) {
- n[1].f = (GLfloat) left;
- n[2].f = (GLfloat) right;
- n[3].f = (GLfloat) bottom;
- n[4].f = (GLfloat) top;
- n[5].f = (GLfloat) nearval;
- n[6].f = (GLfloat) farval;
- }
- if (ctx->ExecuteFlag) {
- CALL_Frustum(ctx->Exec, (left, right, bottom, top, nearval, farval));
- }
-}
-
-
-static void GLAPIENTRY
-save_Hint(GLenum target, GLenum mode)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = alloc_instruction(ctx, OPCODE_HINT, 2);
- if (n) {
- n[1].e = target;
- n[2].e = mode;
- }
- if (ctx->ExecuteFlag) {
- CALL_Hint(ctx->Exec, (target, mode));
- }
-}
-
-
-static void GLAPIENTRY
-save_Histogram(GLenum target, GLsizei width, GLenum internalFormat,
- GLboolean sink)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
-
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = alloc_instruction(ctx, OPCODE_HISTOGRAM, 4);
- if (n) {
- n[1].e = target;
- n[2].i = width;
- n[3].e = internalFormat;
- n[4].b = sink;
- }
- if (ctx->ExecuteFlag) {
- CALL_Histogram(ctx->Exec, (target, width, internalFormat, sink));
- }
-}
-
-
-static void GLAPIENTRY
-save_IndexMask(GLuint mask)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = alloc_instruction(ctx, OPCODE_INDEX_MASK, 1);
- if (n) {
- n[1].ui = mask;
- }
- if (ctx->ExecuteFlag) {
- CALL_IndexMask(ctx->Exec, (mask));
- }
-}
-
-
-static void GLAPIENTRY
-save_InitNames(void)
-{
- GET_CURRENT_CONTEXT(ctx);
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- (void) alloc_instruction(ctx, OPCODE_INIT_NAMES, 0);
- if (ctx->ExecuteFlag) {
- CALL_InitNames(ctx->Exec, ());
- }
-}
-
-
-static void GLAPIENTRY
-save_Lightfv(GLenum light, GLenum pname, const GLfloat *params)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = alloc_instruction(ctx, OPCODE_LIGHT, 6);
- if (n) {
- GLint i, nParams;
- n[1].e = light;
- n[2].e = pname;
- switch (pname) {
- case GL_AMBIENT:
- nParams = 4;
- break;
- case GL_DIFFUSE:
- nParams = 4;
- break;
- case GL_SPECULAR:
- nParams = 4;
- break;
- case GL_POSITION:
- nParams = 4;
- break;
- case GL_SPOT_DIRECTION:
- nParams = 3;
- break;
- case GL_SPOT_EXPONENT:
- nParams = 1;
- break;
- case GL_SPOT_CUTOFF:
- nParams = 1;
- break;
- case GL_CONSTANT_ATTENUATION:
- nParams = 1;
- break;
- case GL_LINEAR_ATTENUATION:
- nParams = 1;
- break;
- case GL_QUADRATIC_ATTENUATION:
- nParams = 1;
- break;
- default:
- nParams = 0;
- }
- for (i = 0; i < nParams; i++) {
- n[3 + i].f = params[i];
- }
- }
- if (ctx->ExecuteFlag) {
- CALL_Lightfv(ctx->Exec, (light, pname, params));
- }
-}
-
-
-static void GLAPIENTRY
-save_Lightf(GLenum light, GLenum pname, GLfloat param)
-{
- GLfloat parray[4];
- parray[0] = param;
- parray[1] = parray[2] = parray[3] = 0.0F;
- save_Lightfv(light, pname, parray);
-}
-
-
-static void GLAPIENTRY
-save_Lightiv(GLenum light, GLenum pname, const GLint *params)
-{
- GLfloat fparam[4];
- switch (pname) {
- case GL_AMBIENT:
- case GL_DIFFUSE:
- case GL_SPECULAR:
- fparam[0] = INT_TO_FLOAT(params[0]);
- fparam[1] = INT_TO_FLOAT(params[1]);
- fparam[2] = INT_TO_FLOAT(params[2]);
- fparam[3] = INT_TO_FLOAT(params[3]);
- break;
- case GL_POSITION:
- fparam[0] = (GLfloat) params[0];
- fparam[1] = (GLfloat) params[1];
- fparam[2] = (GLfloat) params[2];
- fparam[3] = (GLfloat) params[3];
- break;
- case GL_SPOT_DIRECTION:
- fparam[0] = (GLfloat) params[0];
- fparam[1] = (GLfloat) params[1];
- fparam[2] = (GLfloat) params[2];
- break;
- case GL_SPOT_EXPONENT:
- case GL_SPOT_CUTOFF:
- case GL_CONSTANT_ATTENUATION:
- case GL_LINEAR_ATTENUATION:
- case GL_QUADRATIC_ATTENUATION:
- fparam[0] = (GLfloat) params[0];
- break;
- default:
- /* error will be caught later in gl_Lightfv */
- ;
- }
- save_Lightfv(light, pname, fparam);
-}
-
-
-static void GLAPIENTRY
-save_Lighti(GLenum light, GLenum pname, GLint param)
-{
- GLint parray[4];
- parray[0] = param;
- parray[1] = parray[2] = parray[3] = 0;
- save_Lightiv(light, pname, parray);
-}
-
-
-static void GLAPIENTRY
-save_LightModelfv(GLenum pname, const GLfloat *params)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = alloc_instruction(ctx, OPCODE_LIGHT_MODEL, 5);
- if (n) {
- n[1].e = pname;
- n[2].f = params[0];
- n[3].f = params[1];
- n[4].f = params[2];
- n[5].f = params[3];
- }
- if (ctx->ExecuteFlag) {
- CALL_LightModelfv(ctx->Exec, (pname, params));
- }
-}
-
-
-static void GLAPIENTRY
-save_LightModelf(GLenum pname, GLfloat param)
-{
- GLfloat parray[4];
- parray[0] = param;
- parray[1] = parray[2] = parray[3] = 0.0F;
- save_LightModelfv(pname, parray);
-}
-
-
-static void GLAPIENTRY
-save_LightModeliv(GLenum pname, const GLint *params)
-{
- GLfloat fparam[4];
- switch (pname) {
- case GL_LIGHT_MODEL_AMBIENT:
- fparam[0] = INT_TO_FLOAT(params[0]);
- fparam[1] = INT_TO_FLOAT(params[1]);
- fparam[2] = INT_TO_FLOAT(params[2]);
- fparam[3] = INT_TO_FLOAT(params[3]);
- break;
- case GL_LIGHT_MODEL_LOCAL_VIEWER:
- case GL_LIGHT_MODEL_TWO_SIDE:
- case GL_LIGHT_MODEL_COLOR_CONTROL:
- fparam[0] = (GLfloat) params[0];
- fparam[1] = 0.0F;
- fparam[2] = 0.0F;
- fparam[3] = 0.0F;
- break;
- default:
- /* Error will be caught later in gl_LightModelfv */
- ASSIGN_4V(fparam, 0.0F, 0.0F, 0.0F, 0.0F);
- }
- save_LightModelfv(pname, fparam);
-}
-
-
-static void GLAPIENTRY
-save_LightModeli(GLenum pname, GLint param)
-{
- GLint parray[4];
- parray[0] = param;
- parray[1] = parray[2] = parray[3] = 0;
- save_LightModeliv(pname, parray);
-}
-
-
-static void GLAPIENTRY
-save_LineStipple(GLint factor, GLushort pattern)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = alloc_instruction(ctx, OPCODE_LINE_STIPPLE, 2);
- if (n) {
- n[1].i = factor;
- n[2].us = pattern;
- }
- if (ctx->ExecuteFlag) {
- CALL_LineStipple(ctx->Exec, (factor, pattern));
- }
-}
-
-
-static void GLAPIENTRY
-save_LineWidth(GLfloat width)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = alloc_instruction(ctx, OPCODE_LINE_WIDTH, 1);
- if (n) {
- n[1].f = width;
- }
- if (ctx->ExecuteFlag) {
- CALL_LineWidth(ctx->Exec, (width));
- }
-}
-
-
-static void GLAPIENTRY
-save_ListBase(GLuint base)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = alloc_instruction(ctx, OPCODE_LIST_BASE, 1);
- if (n) {
- n[1].ui = base;
- }
- if (ctx->ExecuteFlag) {
- CALL_ListBase(ctx->Exec, (base));
- }
-}
-
-
-static void GLAPIENTRY
-save_LoadIdentity(void)
-{
- GET_CURRENT_CONTEXT(ctx);
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- (void) alloc_instruction(ctx, OPCODE_LOAD_IDENTITY, 0);
- if (ctx->ExecuteFlag) {
- CALL_LoadIdentity(ctx->Exec, ());
- }
-}
-
-
-static void GLAPIENTRY
-save_LoadMatrixf(const GLfloat * m)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = alloc_instruction(ctx, OPCODE_LOAD_MATRIX, 16);
- if (n) {
- GLuint i;
- for (i = 0; i < 16; i++) {
- n[1 + i].f = m[i];
- }
- }
- if (ctx->ExecuteFlag) {
- CALL_LoadMatrixf(ctx->Exec, (m));
- }
-}
-
-
-static void GLAPIENTRY
-save_LoadMatrixd(const GLdouble * m)
-{
- GLfloat f[16];
- GLint i;
- for (i = 0; i < 16; i++) {
- f[i] = (GLfloat) m[i];
- }
- save_LoadMatrixf(f);
-}
-
-
-static void GLAPIENTRY
-save_LoadName(GLuint name)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = alloc_instruction(ctx, OPCODE_LOAD_NAME, 1);
- if (n) {
- n[1].ui = name;
- }
- if (ctx->ExecuteFlag) {
- CALL_LoadName(ctx->Exec, (name));
- }
-}
-
-
-static void GLAPIENTRY
-save_LogicOp(GLenum opcode)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = alloc_instruction(ctx, OPCODE_LOGIC_OP, 1);
- if (n) {
- n[1].e = opcode;
- }
- if (ctx->ExecuteFlag) {
- CALL_LogicOp(ctx->Exec, (opcode));
- }
-}
-
-
-static void GLAPIENTRY
-save_Map1d(GLenum target, GLdouble u1, GLdouble u2, GLint stride,
- GLint order, const GLdouble * points)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = alloc_instruction(ctx, OPCODE_MAP1, 6);
- if (n) {
- GLfloat *pnts = _mesa_copy_map_points1d(target, stride, order, points);
- n[1].e = target;
- n[2].f = (GLfloat) u1;
- n[3].f = (GLfloat) u2;
- n[4].i = _mesa_evaluator_components(target); /* stride */
- n[5].i = order;
- n[6].data = (void *) pnts;
- }
- if (ctx->ExecuteFlag) {
- CALL_Map1d(ctx->Exec, (target, u1, u2, stride, order, points));
- }
-}
-
-static void GLAPIENTRY
-save_Map1f(GLenum target, GLfloat u1, GLfloat u2, GLint stride,
- GLint order, const GLfloat * points)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = alloc_instruction(ctx, OPCODE_MAP1, 6);
- if (n) {
- GLfloat *pnts = _mesa_copy_map_points1f(target, stride, order, points);
- n[1].e = target;
- n[2].f = u1;
- n[3].f = u2;
- n[4].i = _mesa_evaluator_components(target); /* stride */
- n[5].i = order;
- n[6].data = (void *) pnts;
- }
- if (ctx->ExecuteFlag) {
- CALL_Map1f(ctx->Exec, (target, u1, u2, stride, order, points));
- }
-}
-
-
-static void GLAPIENTRY
-save_Map2d(GLenum target,
- GLdouble u1, GLdouble u2, GLint ustride, GLint uorder,
- GLdouble v1, GLdouble v2, GLint vstride, GLint vorder,
- const GLdouble * points)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = alloc_instruction(ctx, OPCODE_MAP2, 10);
- if (n) {
- GLfloat *pnts = _mesa_copy_map_points2d(target, ustride, uorder,
- vstride, vorder, points);
- n[1].e = target;
- n[2].f = (GLfloat) u1;
- n[3].f = (GLfloat) u2;
- n[4].f = (GLfloat) v1;
- n[5].f = (GLfloat) v2;
- /* XXX verify these strides are correct */
- n[6].i = _mesa_evaluator_components(target) * vorder; /*ustride */
- n[7].i = _mesa_evaluator_components(target); /*vstride */
- n[8].i = uorder;
- n[9].i = vorder;
- n[10].data = (void *) pnts;
- }
- if (ctx->ExecuteFlag) {
- CALL_Map2d(ctx->Exec, (target,
- u1, u2, ustride, uorder,
- v1, v2, vstride, vorder, points));
- }
-}
-
-
-static void GLAPIENTRY
-save_Map2f(GLenum target,
- GLfloat u1, GLfloat u2, GLint ustride, GLint uorder,
- GLfloat v1, GLfloat v2, GLint vstride, GLint vorder,
- const GLfloat * points)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = alloc_instruction(ctx, OPCODE_MAP2, 10);
- if (n) {
- GLfloat *pnts = _mesa_copy_map_points2f(target, ustride, uorder,
- vstride, vorder, points);
- n[1].e = target;
- n[2].f = u1;
- n[3].f = u2;
- n[4].f = v1;
- n[5].f = v2;
- /* XXX verify these strides are correct */
- n[6].i = _mesa_evaluator_components(target) * vorder; /*ustride */
- n[7].i = _mesa_evaluator_components(target); /*vstride */
- n[8].i = uorder;
- n[9].i = vorder;
- n[10].data = (void *) pnts;
- }
- if (ctx->ExecuteFlag) {
- CALL_Map2f(ctx->Exec, (target, u1, u2, ustride, uorder,
- v1, v2, vstride, vorder, points));
- }
-}
-
-
-static void GLAPIENTRY
-save_MapGrid1f(GLint un, GLfloat u1, GLfloat u2)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = alloc_instruction(ctx, OPCODE_MAPGRID1, 3);
- if (n) {
- n[1].i = un;
- n[2].f = u1;
- n[3].f = u2;
- }
- if (ctx->ExecuteFlag) {
- CALL_MapGrid1f(ctx->Exec, (un, u1, u2));
- }
-}
-
-
-static void GLAPIENTRY
-save_MapGrid1d(GLint un, GLdouble u1, GLdouble u2)
-{
- save_MapGrid1f(un, (GLfloat) u1, (GLfloat) u2);
-}
-
-
-static void GLAPIENTRY
-save_MapGrid2f(GLint un, GLfloat u1, GLfloat u2,
- GLint vn, GLfloat v1, GLfloat v2)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = alloc_instruction(ctx, OPCODE_MAPGRID2, 6);
- if (n) {
- n[1].i = un;
- n[2].f = u1;
- n[3].f = u2;
- n[4].i = vn;
- n[5].f = v1;
- n[6].f = v2;
- }
- if (ctx->ExecuteFlag) {
- CALL_MapGrid2f(ctx->Exec, (un, u1, u2, vn, v1, v2));
- }
-}
-
-
-
-static void GLAPIENTRY
-save_MapGrid2d(GLint un, GLdouble u1, GLdouble u2,
- GLint vn, GLdouble v1, GLdouble v2)
-{
- save_MapGrid2f(un, (GLfloat) u1, (GLfloat) u2,
- vn, (GLfloat) v1, (GLfloat) v2);
-}
-
-
-static void GLAPIENTRY
-save_MatrixMode(GLenum mode)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = alloc_instruction(ctx, OPCODE_MATRIX_MODE, 1);
- if (n) {
- n[1].e = mode;
- }
- if (ctx->ExecuteFlag) {
- CALL_MatrixMode(ctx->Exec, (mode));
- }
-}
-
-
-static void GLAPIENTRY
-save_Minmax(GLenum target, GLenum internalFormat, GLboolean sink)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
-
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = alloc_instruction(ctx, OPCODE_MIN_MAX, 3);
- if (n) {
- n[1].e = target;
- n[2].e = internalFormat;
- n[3].b = sink;
- }
- if (ctx->ExecuteFlag) {
- CALL_Minmax(ctx->Exec, (target, internalFormat, sink));
- }
-}
-
-
-static void GLAPIENTRY
-save_MultMatrixf(const GLfloat * m)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = alloc_instruction(ctx, OPCODE_MULT_MATRIX, 16);
- if (n) {
- GLuint i;
- for (i = 0; i < 16; i++) {
- n[1 + i].f = m[i];
- }
- }
- if (ctx->ExecuteFlag) {
- CALL_MultMatrixf(ctx->Exec, (m));
- }
-}
-
-
-static void GLAPIENTRY
-save_MultMatrixd(const GLdouble * m)
-{
- GLfloat f[16];
- GLint i;
- for (i = 0; i < 16; i++) {
- f[i] = (GLfloat) m[i];
- }
- save_MultMatrixf(f);
-}
-
-
-static void GLAPIENTRY
-save_NewList(GLuint name, GLenum mode)
-{
- GET_CURRENT_CONTEXT(ctx);
- /* It's an error to call this function while building a display list */
- _mesa_error(ctx, GL_INVALID_OPERATION, "glNewList");
- (void) name;
- (void) mode;
-}
-
-
-
-static void GLAPIENTRY
-save_Ortho(GLdouble left, GLdouble right,
- GLdouble bottom, GLdouble top, GLdouble nearval, GLdouble farval)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = alloc_instruction(ctx, OPCODE_ORTHO, 6);
- if (n) {
- n[1].f = (GLfloat) left;
- n[2].f = (GLfloat) right;
- n[3].f = (GLfloat) bottom;
- n[4].f = (GLfloat) top;
- n[5].f = (GLfloat) nearval;
- n[6].f = (GLfloat) farval;
- }
- if (ctx->ExecuteFlag) {
- CALL_Ortho(ctx->Exec, (left, right, bottom, top, nearval, farval));
- }
-}
-
-
-static void GLAPIENTRY
-save_PixelMapfv(GLenum map, GLint mapsize, const GLfloat *values)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = alloc_instruction(ctx, OPCODE_PIXEL_MAP, 3);
- if (n) {
- n[1].e = map;
- n[2].i = mapsize;
- n[3].data = (void *) malloc(mapsize * sizeof(GLfloat));
- memcpy(n[3].data, (void *) values, mapsize * sizeof(GLfloat));
- }
- if (ctx->ExecuteFlag) {
- CALL_PixelMapfv(ctx->Exec, (map, mapsize, values));
- }
-}
-
-
-static void GLAPIENTRY
-save_PixelMapuiv(GLenum map, GLint mapsize, const GLuint *values)
-{
- GLfloat fvalues[MAX_PIXEL_MAP_TABLE];
- GLint i;
- if (map == GL_PIXEL_MAP_I_TO_I || map == GL_PIXEL_MAP_S_TO_S) {
- for (i = 0; i < mapsize; i++) {
- fvalues[i] = (GLfloat) values[i];
- }
- }
- else {
- for (i = 0; i < mapsize; i++) {
- fvalues[i] = UINT_TO_FLOAT(values[i]);
- }
- }
- save_PixelMapfv(map, mapsize, fvalues);
-}
-
-
-static void GLAPIENTRY
-save_PixelMapusv(GLenum map, GLint mapsize, const GLushort *values)
-{
- GLfloat fvalues[MAX_PIXEL_MAP_TABLE];
- GLint i;
- if (map == GL_PIXEL_MAP_I_TO_I || map == GL_PIXEL_MAP_S_TO_S) {
- for (i = 0; i < mapsize; i++) {
- fvalues[i] = (GLfloat) values[i];
- }
- }
- else {
- for (i = 0; i < mapsize; i++) {
- fvalues[i] = USHORT_TO_FLOAT(values[i]);
- }
- }
- save_PixelMapfv(map, mapsize, fvalues);
-}
-
-
-static void GLAPIENTRY
-save_PixelTransferf(GLenum pname, GLfloat param)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = alloc_instruction(ctx, OPCODE_PIXEL_TRANSFER, 2);
- if (n) {
- n[1].e = pname;
- n[2].f = param;
- }
- if (ctx->ExecuteFlag) {
- CALL_PixelTransferf(ctx->Exec, (pname, param));
- }
-}
-
-
-static void GLAPIENTRY
-save_PixelTransferi(GLenum pname, GLint param)
-{
- save_PixelTransferf(pname, (GLfloat) param);
-}
-
-
-static void GLAPIENTRY
-save_PixelZoom(GLfloat xfactor, GLfloat yfactor)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = alloc_instruction(ctx, OPCODE_PIXEL_ZOOM, 2);
- if (n) {
- n[1].f = xfactor;
- n[2].f = yfactor;
- }
- if (ctx->ExecuteFlag) {
- CALL_PixelZoom(ctx->Exec, (xfactor, yfactor));
- }
-}
-
-
-static void GLAPIENTRY
-save_PointParameterfvEXT(GLenum pname, const GLfloat *params)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = alloc_instruction(ctx, OPCODE_POINT_PARAMETERS, 4);
- if (n) {
- n[1].e = pname;
- n[2].f = params[0];
- n[3].f = params[1];
- n[4].f = params[2];
- }
- if (ctx->ExecuteFlag) {
- CALL_PointParameterfvEXT(ctx->Exec, (pname, params));
- }
-}
-
-
-static void GLAPIENTRY
-save_PointParameterfEXT(GLenum pname, GLfloat param)
-{
- GLfloat parray[3];
- parray[0] = param;
- parray[1] = parray[2] = 0.0F;
- save_PointParameterfvEXT(pname, parray);
-}
-
-static void GLAPIENTRY
-save_PointParameteriNV(GLenum pname, GLint param)
-{
- GLfloat parray[3];
- parray[0] = (GLfloat) param;
- parray[1] = parray[2] = 0.0F;
- save_PointParameterfvEXT(pname, parray);
-}
-
-static void GLAPIENTRY
-save_PointParameterivNV(GLenum pname, const GLint * param)
-{
- GLfloat parray[3];
- parray[0] = (GLfloat) param[0];
- parray[1] = parray[2] = 0.0F;
- save_PointParameterfvEXT(pname, parray);
-}
-
-
-static void GLAPIENTRY
-save_PointSize(GLfloat size)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = alloc_instruction(ctx, OPCODE_POINT_SIZE, 1);
- if (n) {
- n[1].f = size;
- }
- if (ctx->ExecuteFlag) {
- CALL_PointSize(ctx->Exec, (size));
- }
-}
-
-
-static void GLAPIENTRY
-save_PolygonMode(GLenum face, GLenum mode)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = alloc_instruction(ctx, OPCODE_POLYGON_MODE, 2);
- if (n) {
- n[1].e = face;
- n[2].e = mode;
- }
- if (ctx->ExecuteFlag) {
- CALL_PolygonMode(ctx->Exec, (face, mode));
- }
-}
-
-
-static void GLAPIENTRY
-save_PolygonStipple(const GLubyte * pattern)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
-
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
-
- n = alloc_instruction(ctx, OPCODE_POLYGON_STIPPLE, 1);
- if (n) {
- n[1].data = unpack_image(ctx, 2, 32, 32, 1, GL_COLOR_INDEX, GL_BITMAP,
- pattern, &ctx->Unpack);
- }
- if (ctx->ExecuteFlag) {
- CALL_PolygonStipple(ctx->Exec, ((GLubyte *) pattern));
- }
-}
-
-
-static void GLAPIENTRY
-save_PolygonOffset(GLfloat factor, GLfloat units)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = alloc_instruction(ctx, OPCODE_POLYGON_OFFSET, 2);
- if (n) {
- n[1].f = factor;
- n[2].f = units;
- }
- if (ctx->ExecuteFlag) {
- CALL_PolygonOffset(ctx->Exec, (factor, units));
- }
-}
-
-
-static void GLAPIENTRY
-save_PolygonOffsetEXT(GLfloat factor, GLfloat bias)
-{
- GET_CURRENT_CONTEXT(ctx);
- /* XXX mult by DepthMaxF here??? */
- save_PolygonOffset(factor, ctx->DrawBuffer->_DepthMaxF * bias);
-}
-
-
-static void GLAPIENTRY
-save_PopAttrib(void)
-{
- GET_CURRENT_CONTEXT(ctx);
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- (void) alloc_instruction(ctx, OPCODE_POP_ATTRIB, 0);
- if (ctx->ExecuteFlag) {
- CALL_PopAttrib(ctx->Exec, ());
- }
-}
-
-
-static void GLAPIENTRY
-save_PopMatrix(void)
-{
- GET_CURRENT_CONTEXT(ctx);
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- (void) alloc_instruction(ctx, OPCODE_POP_MATRIX, 0);
- if (ctx->ExecuteFlag) {
- CALL_PopMatrix(ctx->Exec, ());
- }
-}
-
-
-static void GLAPIENTRY
-save_PopName(void)
-{
- GET_CURRENT_CONTEXT(ctx);
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- (void) alloc_instruction(ctx, OPCODE_POP_NAME, 0);
- if (ctx->ExecuteFlag) {
- CALL_PopName(ctx->Exec, ());
- }
-}
-
-
-static void GLAPIENTRY
-save_PrioritizeTextures(GLsizei num, const GLuint * textures,
- const GLclampf * priorities)
-{
- GET_CURRENT_CONTEXT(ctx);
- GLint i;
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
-
- for (i = 0; i < num; i++) {
- Node *n;
- n = alloc_instruction(ctx, OPCODE_PRIORITIZE_TEXTURE, 2);
- if (n) {
- n[1].ui = textures[i];
- n[2].f = priorities[i];
- }
- }
- if (ctx->ExecuteFlag) {
- CALL_PrioritizeTextures(ctx->Exec, (num, textures, priorities));
- }
-}
-
-
-static void GLAPIENTRY
-save_PushAttrib(GLbitfield mask)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = alloc_instruction(ctx, OPCODE_PUSH_ATTRIB, 1);
- if (n) {
- n[1].bf = mask;
- }
- if (ctx->ExecuteFlag) {
- CALL_PushAttrib(ctx->Exec, (mask));
- }
-}
-
-
-static void GLAPIENTRY
-save_PushMatrix(void)
-{
- GET_CURRENT_CONTEXT(ctx);
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- (void) alloc_instruction(ctx, OPCODE_PUSH_MATRIX, 0);
- if (ctx->ExecuteFlag) {
- CALL_PushMatrix(ctx->Exec, ());
- }
-}
-
-
-static void GLAPIENTRY
-save_PushName(GLuint name)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = alloc_instruction(ctx, OPCODE_PUSH_NAME, 1);
- if (n) {
- n[1].ui = name;
- }
- if (ctx->ExecuteFlag) {
- CALL_PushName(ctx->Exec, (name));
- }
-}
-
-
-static void GLAPIENTRY
-save_RasterPos4f(GLfloat x, GLfloat y, GLfloat z, GLfloat w)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = alloc_instruction(ctx, OPCODE_RASTER_POS, 4);
- if (n) {
- n[1].f = x;
- n[2].f = y;
- n[3].f = z;
- n[4].f = w;
- }
- if (ctx->ExecuteFlag) {
- CALL_RasterPos4f(ctx->Exec, (x, y, z, w));
- }
-}
-
-static void GLAPIENTRY
-save_RasterPos2d(GLdouble x, GLdouble y)
-{
- save_RasterPos4f((GLfloat) x, (GLfloat) y, 0.0F, 1.0F);
-}
-
-static void GLAPIENTRY
-save_RasterPos2f(GLfloat x, GLfloat y)
-{
- save_RasterPos4f(x, y, 0.0F, 1.0F);
-}
-
-static void GLAPIENTRY
-save_RasterPos2i(GLint x, GLint y)
-{
- save_RasterPos4f((GLfloat) x, (GLfloat) y, 0.0F, 1.0F);
-}
-
-static void GLAPIENTRY
-save_RasterPos2s(GLshort x, GLshort y)
-{
- save_RasterPos4f(x, y, 0.0F, 1.0F);
-}
-
-static void GLAPIENTRY
-save_RasterPos3d(GLdouble x, GLdouble y, GLdouble z)
-{
- save_RasterPos4f((GLfloat) x, (GLfloat) y, (GLfloat) z, 1.0F);
-}
-
-static void GLAPIENTRY
-save_RasterPos3f(GLfloat x, GLfloat y, GLfloat z)
-{
- save_RasterPos4f(x, y, z, 1.0F);
-}
-
-static void GLAPIENTRY
-save_RasterPos3i(GLint x, GLint y, GLint z)
-{
- save_RasterPos4f((GLfloat) x, (GLfloat) y, (GLfloat) z, 1.0F);
-}
-
-static void GLAPIENTRY
-save_RasterPos3s(GLshort x, GLshort y, GLshort z)
-{
- save_RasterPos4f(x, y, z, 1.0F);
-}
-
-static void GLAPIENTRY
-save_RasterPos4d(GLdouble x, GLdouble y, GLdouble z, GLdouble w)
-{
- save_RasterPos4f((GLfloat) x, (GLfloat) y, (GLfloat) z, (GLfloat) w);
-}
-
-static void GLAPIENTRY
-save_RasterPos4i(GLint x, GLint y, GLint z, GLint w)
-{
- save_RasterPos4f((GLfloat) x, (GLfloat) y, (GLfloat) z, (GLfloat) w);
-}
-
-static void GLAPIENTRY
-save_RasterPos4s(GLshort x, GLshort y, GLshort z, GLshort w)
-{
- save_RasterPos4f(x, y, z, w);
-}
-
-static void GLAPIENTRY
-save_RasterPos2dv(const GLdouble * v)
-{
- save_RasterPos4f((GLfloat) v[0], (GLfloat) v[1], 0.0F, 1.0F);
-}
-
-static void GLAPIENTRY
-save_RasterPos2fv(const GLfloat * v)
-{
- save_RasterPos4f(v[0], v[1], 0.0F, 1.0F);
-}
-
-static void GLAPIENTRY
-save_RasterPos2iv(const GLint * v)
-{
- save_RasterPos4f((GLfloat) v[0], (GLfloat) v[1], 0.0F, 1.0F);
-}
-
-static void GLAPIENTRY
-save_RasterPos2sv(const GLshort * v)
-{
- save_RasterPos4f(v[0], v[1], 0.0F, 1.0F);
-}
-
-static void GLAPIENTRY
-save_RasterPos3dv(const GLdouble * v)
-{
- save_RasterPos4f((GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2], 1.0F);
-}
-
-static void GLAPIENTRY
-save_RasterPos3fv(const GLfloat * v)
-{
- save_RasterPos4f(v[0], v[1], v[2], 1.0F);
-}
-
-static void GLAPIENTRY
-save_RasterPos3iv(const GLint * v)
-{
- save_RasterPos4f((GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2], 1.0F);
-}
-
-static void GLAPIENTRY
-save_RasterPos3sv(const GLshort * v)
-{
- save_RasterPos4f(v[0], v[1], v[2], 1.0F);
-}
-
-static void GLAPIENTRY
-save_RasterPos4dv(const GLdouble * v)
-{
- save_RasterPos4f((GLfloat) v[0], (GLfloat) v[1],
- (GLfloat) v[2], (GLfloat) v[3]);
-}
-
-static void GLAPIENTRY
-save_RasterPos4fv(const GLfloat * v)
-{
- save_RasterPos4f(v[0], v[1], v[2], v[3]);
-}
-
-static void GLAPIENTRY
-save_RasterPos4iv(const GLint * v)
-{
- save_RasterPos4f((GLfloat) v[0], (GLfloat) v[1],
- (GLfloat) v[2], (GLfloat) v[3]);
-}
-
-static void GLAPIENTRY
-save_RasterPos4sv(const GLshort * v)
-{
- save_RasterPos4f(v[0], v[1], v[2], v[3]);
-}
-
-
-static void GLAPIENTRY
-save_PassThrough(GLfloat token)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = alloc_instruction(ctx, OPCODE_PASSTHROUGH, 1);
- if (n) {
- n[1].f = token;
- }
- if (ctx->ExecuteFlag) {
- CALL_PassThrough(ctx->Exec, (token));
- }
-}
-
-
-static void GLAPIENTRY
-save_ReadBuffer(GLenum mode)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = alloc_instruction(ctx, OPCODE_READ_BUFFER, 1);
- if (n) {
- n[1].e = mode;
- }
- if (ctx->ExecuteFlag) {
- CALL_ReadBuffer(ctx->Exec, (mode));
- }
-}
-
-
-static void GLAPIENTRY
-save_ResetHistogram(GLenum target)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = alloc_instruction(ctx, OPCODE_RESET_HISTOGRAM, 1);
- if (n) {
- n[1].e = target;
- }
- if (ctx->ExecuteFlag) {
- CALL_ResetHistogram(ctx->Exec, (target));
- }
-}
-
-
-static void GLAPIENTRY
-save_ResetMinmax(GLenum target)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = alloc_instruction(ctx, OPCODE_RESET_MIN_MAX, 1);
- if (n) {
- n[1].e = target;
- }
- if (ctx->ExecuteFlag) {
- CALL_ResetMinmax(ctx->Exec, (target));
- }
-}
-
-
-static void GLAPIENTRY
-save_Rotatef(GLfloat angle, GLfloat x, GLfloat y, GLfloat z)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = alloc_instruction(ctx, OPCODE_ROTATE, 4);
- if (n) {
- n[1].f = angle;
- n[2].f = x;
- n[3].f = y;
- n[4].f = z;
- }
- if (ctx->ExecuteFlag) {
- CALL_Rotatef(ctx->Exec, (angle, x, y, z));
- }
-}
-
-
-static void GLAPIENTRY
-save_Rotated(GLdouble angle, GLdouble x, GLdouble y, GLdouble z)
-{
- save_Rotatef((GLfloat) angle, (GLfloat) x, (GLfloat) y, (GLfloat) z);
-}
-
-
-static void GLAPIENTRY
-save_Scalef(GLfloat x, GLfloat y, GLfloat z)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = alloc_instruction(ctx, OPCODE_SCALE, 3);
- if (n) {
- n[1].f = x;
- n[2].f = y;
- n[3].f = z;
- }
- if (ctx->ExecuteFlag) {
- CALL_Scalef(ctx->Exec, (x, y, z));
- }
-}
-
-
-static void GLAPIENTRY
-save_Scaled(GLdouble x, GLdouble y, GLdouble z)
-{
- save_Scalef((GLfloat) x, (GLfloat) y, (GLfloat) z);
-}
-
-
-static void GLAPIENTRY
-save_Scissor(GLint x, GLint y, GLsizei width, GLsizei height)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = alloc_instruction(ctx, OPCODE_SCISSOR, 4);
- if (n) {
- n[1].i = x;
- n[2].i = y;
- n[3].i = width;
- n[4].i = height;
- }
- if (ctx->ExecuteFlag) {
- CALL_Scissor(ctx->Exec, (x, y, width, height));
- }
-}
-
-
-static void GLAPIENTRY
-save_ShadeModel(GLenum mode)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- ASSERT_OUTSIDE_SAVE_BEGIN_END(ctx);
-
- if (ctx->ExecuteFlag) {
- CALL_ShadeModel(ctx->Exec, (mode));
- }
-
- if (ctx->ListState.Current.ShadeModel == mode)
- return;
-
- SAVE_FLUSH_VERTICES(ctx);
-
- /* Only save the value if we know the statechange will take effect:
- */
- if (ctx->Driver.CurrentSavePrimitive == PRIM_OUTSIDE_BEGIN_END)
- ctx->ListState.Current.ShadeModel = mode;
-
- n = alloc_instruction(ctx, OPCODE_SHADE_MODEL, 1);
- if (n) {
- n[1].e = mode;
- }
-}
-
-
-static void GLAPIENTRY
-save_StencilFunc(GLenum func, GLint ref, GLuint mask)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = alloc_instruction(ctx, OPCODE_STENCIL_FUNC, 3);
- if (n) {
- n[1].e = func;
- n[2].i = ref;
- n[3].ui = mask;
- }
- if (ctx->ExecuteFlag) {
- CALL_StencilFunc(ctx->Exec, (func, ref, mask));
- }
-}
-
-
-static void GLAPIENTRY
-save_StencilMask(GLuint mask)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = alloc_instruction(ctx, OPCODE_STENCIL_MASK, 1);
- if (n) {
- n[1].ui = mask;
- }
- if (ctx->ExecuteFlag) {
- CALL_StencilMask(ctx->Exec, (mask));
- }
-}
-
-
-static void GLAPIENTRY
-save_StencilOp(GLenum fail, GLenum zfail, GLenum zpass)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = alloc_instruction(ctx, OPCODE_STENCIL_OP, 3);
- if (n) {
- n[1].e = fail;
- n[2].e = zfail;
- n[3].e = zpass;
- }
- if (ctx->ExecuteFlag) {
- CALL_StencilOp(ctx->Exec, (fail, zfail, zpass));
- }
-}
-
-
-static void GLAPIENTRY
-save_StencilFuncSeparate(GLenum face, GLenum func, GLint ref, GLuint mask)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = alloc_instruction(ctx, OPCODE_STENCIL_FUNC_SEPARATE, 4);
- if (n) {
- n[1].e = face;
- n[2].e = func;
- n[3].i = ref;
- n[4].ui = mask;
- }
- if (ctx->ExecuteFlag) {
- CALL_StencilFuncSeparate(ctx->Exec, (face, func, ref, mask));
- }
-}
-
-
-static void GLAPIENTRY
-save_StencilFuncSeparateATI(GLenum frontfunc, GLenum backfunc, GLint ref,
- GLuint mask)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- /* GL_FRONT */
- n = alloc_instruction(ctx, OPCODE_STENCIL_FUNC_SEPARATE, 4);
- if (n) {
- n[1].e = GL_FRONT;
- n[2].e = frontfunc;
- n[3].i = ref;
- n[4].ui = mask;
- }
- /* GL_BACK */
- n = alloc_instruction(ctx, OPCODE_STENCIL_FUNC_SEPARATE, 4);
- if (n) {
- n[1].e = GL_BACK;
- n[2].e = backfunc;
- n[3].i = ref;
- n[4].ui = mask;
- }
- if (ctx->ExecuteFlag) {
- CALL_StencilFuncSeparate(ctx->Exec, (GL_FRONT, frontfunc, ref, mask));
- CALL_StencilFuncSeparate(ctx->Exec, (GL_BACK, backfunc, ref, mask));
- }
-}
-
-
-static void GLAPIENTRY
-save_StencilMaskSeparate(GLenum face, GLuint mask)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = alloc_instruction(ctx, OPCODE_STENCIL_MASK_SEPARATE, 2);
- if (n) {
- n[1].e = face;
- n[2].ui = mask;
- }
- if (ctx->ExecuteFlag) {
- CALL_StencilMaskSeparate(ctx->Exec, (face, mask));
- }
-}
-
-
-static void GLAPIENTRY
-save_StencilOpSeparate(GLenum face, GLenum fail, GLenum zfail, GLenum zpass)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = alloc_instruction(ctx, OPCODE_STENCIL_OP_SEPARATE, 4);
- if (n) {
- n[1].e = face;
- n[2].e = fail;
- n[3].e = zfail;
- n[4].e = zpass;
- }
- if (ctx->ExecuteFlag) {
- CALL_StencilOpSeparate(ctx->Exec, (face, fail, zfail, zpass));
- }
-}
-
-
-static void GLAPIENTRY
-save_TexEnvfv(GLenum target, GLenum pname, const GLfloat *params)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = alloc_instruction(ctx, OPCODE_TEXENV, 6);
- if (n) {
- n[1].e = target;
- n[2].e = pname;
- if (pname == GL_TEXTURE_ENV_COLOR) {
- n[3].f = params[0];
- n[4].f = params[1];
- n[5].f = params[2];
- n[6].f = params[3];
- }
- else {
- n[3].f = params[0];
- n[4].f = n[5].f = n[6].f = 0.0F;
- }
- }
- if (ctx->ExecuteFlag) {
- CALL_TexEnvfv(ctx->Exec, (target, pname, params));
- }
-}
-
-
-static void GLAPIENTRY
-save_TexEnvf(GLenum target, GLenum pname, GLfloat param)
-{
- GLfloat parray[4];
- parray[0] = (GLfloat) param;
- parray[1] = parray[2] = parray[3] = 0.0F;
- save_TexEnvfv(target, pname, parray);
-}
-
-
-static void GLAPIENTRY
-save_TexEnvi(GLenum target, GLenum pname, GLint param)
-{
- GLfloat p[4];
- p[0] = (GLfloat) param;
- p[1] = p[2] = p[3] = 0.0F;
- save_TexEnvfv(target, pname, p);
-}
-
-
-static void GLAPIENTRY
-save_TexEnviv(GLenum target, GLenum pname, const GLint * param)
-{
- GLfloat p[4];
- if (pname == GL_TEXTURE_ENV_COLOR) {
- p[0] = INT_TO_FLOAT(param[0]);
- p[1] = INT_TO_FLOAT(param[1]);
- p[2] = INT_TO_FLOAT(param[2]);
- p[3] = INT_TO_FLOAT(param[3]);
- }
- else {
- p[0] = (GLfloat) param[0];
- p[1] = p[2] = p[3] = 0.0F;
- }
- save_TexEnvfv(target, pname, p);
-}
-
-
-static void GLAPIENTRY
-save_TexGenfv(GLenum coord, GLenum pname, const GLfloat *params)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = alloc_instruction(ctx, OPCODE_TEXGEN, 6);
- if (n) {
- n[1].e = coord;
- n[2].e = pname;
- n[3].f = params[0];
- n[4].f = params[1];
- n[5].f = params[2];
- n[6].f = params[3];
- }
- if (ctx->ExecuteFlag) {
- CALL_TexGenfv(ctx->Exec, (coord, pname, params));
- }
-}
-
-
-static void GLAPIENTRY
-save_TexGeniv(GLenum coord, GLenum pname, const GLint *params)
-{
- GLfloat p[4];
- p[0] = (GLfloat) params[0];
- p[1] = (GLfloat) params[1];
- p[2] = (GLfloat) params[2];
- p[3] = (GLfloat) params[3];
- save_TexGenfv(coord, pname, p);
-}
-
-
-static void GLAPIENTRY
-save_TexGend(GLenum coord, GLenum pname, GLdouble param)
-{
- GLfloat parray[4];
- parray[0] = (GLfloat) param;
- parray[1] = parray[2] = parray[3] = 0.0F;
- save_TexGenfv(coord, pname, parray);
-}
-
-
-static void GLAPIENTRY
-save_TexGendv(GLenum coord, GLenum pname, const GLdouble *params)
-{
- GLfloat p[4];
- p[0] = (GLfloat) params[0];
- p[1] = (GLfloat) params[1];
- p[2] = (GLfloat) params[2];
- p[3] = (GLfloat) params[3];
- save_TexGenfv(coord, pname, p);
-}
-
-
-static void GLAPIENTRY
-save_TexGenf(GLenum coord, GLenum pname, GLfloat param)
-{
- GLfloat parray[4];
- parray[0] = param;
- parray[1] = parray[2] = parray[3] = 0.0F;
- save_TexGenfv(coord, pname, parray);
-}
-
-
-static void GLAPIENTRY
-save_TexGeni(GLenum coord, GLenum pname, GLint param)
-{
- GLint parray[4];
- parray[0] = param;
- parray[1] = parray[2] = parray[3] = 0;
- save_TexGeniv(coord, pname, parray);
-}
-
-
-static void GLAPIENTRY
-save_TexParameterfv(GLenum target, GLenum pname, const GLfloat *params)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = alloc_instruction(ctx, OPCODE_TEXPARAMETER, 6);
- if (n) {
- n[1].e = target;
- n[2].e = pname;
- n[3].f = params[0];
- n[4].f = params[1];
- n[5].f = params[2];
- n[6].f = params[3];
- }
- if (ctx->ExecuteFlag) {
- CALL_TexParameterfv(ctx->Exec, (target, pname, params));
- }
-}
-
-
-static void GLAPIENTRY
-save_TexParameterf(GLenum target, GLenum pname, GLfloat param)
-{
- GLfloat parray[4];
- parray[0] = param;
- parray[1] = parray[2] = parray[3] = 0.0F;
- save_TexParameterfv(target, pname, parray);
-}
-
-
-static void GLAPIENTRY
-save_TexParameteri(GLenum target, GLenum pname, GLint param)
-{
- GLfloat fparam[4];
- fparam[0] = (GLfloat) param;
- fparam[1] = fparam[2] = fparam[3] = 0.0F;
- save_TexParameterfv(target, pname, fparam);
-}
-
-
-static void GLAPIENTRY
-save_TexParameteriv(GLenum target, GLenum pname, const GLint *params)
-{
- GLfloat fparam[4];
- fparam[0] = (GLfloat) params[0];
- fparam[1] = fparam[2] = fparam[3] = 0.0F;
- save_TexParameterfv(target, pname, fparam);
-}
-
-
-static void GLAPIENTRY
-save_TexImage1D(GLenum target,
- GLint level, GLint components,
- GLsizei width, GLint border,
- GLenum format, GLenum type, const GLvoid * pixels)
-{
- GET_CURRENT_CONTEXT(ctx);
- if (target == GL_PROXY_TEXTURE_1D) {
- /* don't compile, execute immediately */
- CALL_TexImage1D(ctx->Exec, (target, level, components, width,
- border, format, type, pixels));
- }
- else {
- Node *n;
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = alloc_instruction(ctx, OPCODE_TEX_IMAGE1D, 8);
- if (n) {
- n[1].e = target;
- n[2].i = level;
- n[3].i = components;
- n[4].i = (GLint) width;
- n[5].i = border;
- n[6].e = format;
- n[7].e = type;
- n[8].data = unpack_image(ctx, 1, width, 1, 1, format, type,
- pixels, &ctx->Unpack);
- }
- if (ctx->ExecuteFlag) {
- CALL_TexImage1D(ctx->Exec, (target, level, components, width,
- border, format, type, pixels));
- }
- }
-}
-
-
-static void GLAPIENTRY
-save_TexImage2D(GLenum target,
- GLint level, GLint components,
- GLsizei width, GLsizei height, GLint border,
- GLenum format, GLenum type, const GLvoid * pixels)
-{
- GET_CURRENT_CONTEXT(ctx);
- if (target == GL_PROXY_TEXTURE_2D) {
- /* don't compile, execute immediately */
- CALL_TexImage2D(ctx->Exec, (target, level, components, width,
- height, border, format, type, pixels));
- }
- else {
- Node *n;
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = alloc_instruction(ctx, OPCODE_TEX_IMAGE2D, 9);
- if (n) {
- n[1].e = target;
- n[2].i = level;
- n[3].i = components;
- n[4].i = (GLint) width;
- n[5].i = (GLint) height;
- n[6].i = border;
- n[7].e = format;
- n[8].e = type;
- n[9].data = unpack_image(ctx, 2, width, height, 1, format, type,
- pixels, &ctx->Unpack);
- }
- if (ctx->ExecuteFlag) {
- CALL_TexImage2D(ctx->Exec, (target, level, components, width,
- height, border, format, type, pixels));
- }
- }
-}
-
-
-static void GLAPIENTRY
-save_TexImage3D(GLenum target,
- GLint level, GLint internalFormat,
- GLsizei width, GLsizei height, GLsizei depth,
- GLint border,
- GLenum format, GLenum type, const GLvoid * pixels)
-{
- GET_CURRENT_CONTEXT(ctx);
- if (target == GL_PROXY_TEXTURE_3D) {
- /* don't compile, execute immediately */
- CALL_TexImage3D(ctx->Exec, (target, level, internalFormat, width,
- height, depth, border, format, type,
- pixels));
- }
- else {
- Node *n;
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = alloc_instruction(ctx, OPCODE_TEX_IMAGE3D, 10);
- if (n) {
- n[1].e = target;
- n[2].i = level;
- n[3].i = (GLint) internalFormat;
- n[4].i = (GLint) width;
- n[5].i = (GLint) height;
- n[6].i = (GLint) depth;
- n[7].i = border;
- n[8].e = format;
- n[9].e = type;
- n[10].data = unpack_image(ctx, 3, width, height, depth, format, type,
- pixels, &ctx->Unpack);
- }
- if (ctx->ExecuteFlag) {
- CALL_TexImage3D(ctx->Exec, (target, level, internalFormat, width,
- height, depth, border, format, type,
- pixels));
- }
- }
-}
-
-
-static void GLAPIENTRY
-save_TexSubImage1D(GLenum target, GLint level, GLint xoffset,
- GLsizei width, GLenum format, GLenum type,
- const GLvoid * pixels)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
-
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
-
- n = alloc_instruction(ctx, OPCODE_TEX_SUB_IMAGE1D, 7);
- if (n) {
- n[1].e = target;
- n[2].i = level;
- n[3].i = xoffset;
- n[4].i = (GLint) width;
- n[5].e = format;
- n[6].e = type;
- n[7].data = unpack_image(ctx, 1, width, 1, 1, format, type,
- pixels, &ctx->Unpack);
- }
- if (ctx->ExecuteFlag) {
- CALL_TexSubImage1D(ctx->Exec, (target, level, xoffset, width,
- format, type, pixels));
- }
-}
-
-
-static void GLAPIENTRY
-save_TexSubImage2D(GLenum target, GLint level,
- GLint xoffset, GLint yoffset,
- GLsizei width, GLsizei height,
- GLenum format, GLenum type, const GLvoid * pixels)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
-
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
-
- n = alloc_instruction(ctx, OPCODE_TEX_SUB_IMAGE2D, 9);
- if (n) {
- n[1].e = target;
- n[2].i = level;
- n[3].i = xoffset;
- n[4].i = yoffset;
- n[5].i = (GLint) width;
- n[6].i = (GLint) height;
- n[7].e = format;
- n[8].e = type;
- n[9].data = unpack_image(ctx, 2, width, height, 1, format, type,
- pixels, &ctx->Unpack);
- }
- if (ctx->ExecuteFlag) {
- CALL_TexSubImage2D(ctx->Exec, (target, level, xoffset, yoffset,
- width, height, format, type, pixels));
- }
-}
-
-
-static void GLAPIENTRY
-save_TexSubImage3D(GLenum target, GLint level,
- GLint xoffset, GLint yoffset, GLint zoffset,
- GLsizei width, GLsizei height, GLsizei depth,
- GLenum format, GLenum type, const GLvoid * pixels)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
-
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
-
- n = alloc_instruction(ctx, OPCODE_TEX_SUB_IMAGE3D, 11);
- if (n) {
- n[1].e = target;
- n[2].i = level;
- n[3].i = xoffset;
- n[4].i = yoffset;
- n[5].i = zoffset;
- n[6].i = (GLint) width;
- n[7].i = (GLint) height;
- n[8].i = (GLint) depth;
- n[9].e = format;
- n[10].e = type;
- n[11].data = unpack_image(ctx, 3, width, height, depth, format, type,
- pixels, &ctx->Unpack);
- }
- if (ctx->ExecuteFlag) {
- CALL_TexSubImage3D(ctx->Exec, (target, level,
- xoffset, yoffset, zoffset,
- width, height, depth, format, type,
- pixels));
- }
-}
-
-
-static void GLAPIENTRY
-save_Translatef(GLfloat x, GLfloat y, GLfloat z)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = alloc_instruction(ctx, OPCODE_TRANSLATE, 3);
- if (n) {
- n[1].f = x;
- n[2].f = y;
- n[3].f = z;
- }
- if (ctx->ExecuteFlag) {
- CALL_Translatef(ctx->Exec, (x, y, z));
- }
-}
-
-
-static void GLAPIENTRY
-save_Translated(GLdouble x, GLdouble y, GLdouble z)
-{
- save_Translatef((GLfloat) x, (GLfloat) y, (GLfloat) z);
-}
-
-
-
-static void GLAPIENTRY
-save_Viewport(GLint x, GLint y, GLsizei width, GLsizei height)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = alloc_instruction(ctx, OPCODE_VIEWPORT, 4);
- if (n) {
- n[1].i = x;
- n[2].i = y;
- n[3].i = (GLint) width;
- n[4].i = (GLint) height;
- }
- if (ctx->ExecuteFlag) {
- CALL_Viewport(ctx->Exec, (x, y, width, height));
- }
-}
-
-
-static void GLAPIENTRY
-save_WindowPos4fMESA(GLfloat x, GLfloat y, GLfloat z, GLfloat w)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = alloc_instruction(ctx, OPCODE_WINDOW_POS, 4);
- if (n) {
- n[1].f = x;
- n[2].f = y;
- n[3].f = z;
- n[4].f = w;
- }
- if (ctx->ExecuteFlag) {
- CALL_WindowPos4fMESA(ctx->Exec, (x, y, z, w));
- }
-}
-
-static void GLAPIENTRY
-save_WindowPos2dMESA(GLdouble x, GLdouble y)
-{
- save_WindowPos4fMESA((GLfloat) x, (GLfloat) y, 0.0F, 1.0F);
-}
-
-static void GLAPIENTRY
-save_WindowPos2fMESA(GLfloat x, GLfloat y)
-{
- save_WindowPos4fMESA(x, y, 0.0F, 1.0F);
-}
-
-static void GLAPIENTRY
-save_WindowPos2iMESA(GLint x, GLint y)
-{
- save_WindowPos4fMESA((GLfloat) x, (GLfloat) y, 0.0F, 1.0F);
-}
-
-static void GLAPIENTRY
-save_WindowPos2sMESA(GLshort x, GLshort y)
-{
- save_WindowPos4fMESA(x, y, 0.0F, 1.0F);
-}
-
-static void GLAPIENTRY
-save_WindowPos3dMESA(GLdouble x, GLdouble y, GLdouble z)
-{
- save_WindowPos4fMESA((GLfloat) x, (GLfloat) y, (GLfloat) z, 1.0F);
-}
-
-static void GLAPIENTRY
-save_WindowPos3fMESA(GLfloat x, GLfloat y, GLfloat z)
-{
- save_WindowPos4fMESA(x, y, z, 1.0F);
-}
-
-static void GLAPIENTRY
-save_WindowPos3iMESA(GLint x, GLint y, GLint z)
-{
- save_WindowPos4fMESA((GLfloat) x, (GLfloat) y, (GLfloat) z, 1.0F);
-}
-
-static void GLAPIENTRY
-save_WindowPos3sMESA(GLshort x, GLshort y, GLshort z)
-{
- save_WindowPos4fMESA(x, y, z, 1.0F);
-}
-
-static void GLAPIENTRY
-save_WindowPos4dMESA(GLdouble x, GLdouble y, GLdouble z, GLdouble w)
-{
- save_WindowPos4fMESA((GLfloat) x, (GLfloat) y, (GLfloat) z, (GLfloat) w);
-}
-
-static void GLAPIENTRY
-save_WindowPos4iMESA(GLint x, GLint y, GLint z, GLint w)
-{
- save_WindowPos4fMESA((GLfloat) x, (GLfloat) y, (GLfloat) z, (GLfloat) w);
-}
-
-static void GLAPIENTRY
-save_WindowPos4sMESA(GLshort x, GLshort y, GLshort z, GLshort w)
-{
- save_WindowPos4fMESA(x, y, z, w);
-}
-
-static void GLAPIENTRY
-save_WindowPos2dvMESA(const GLdouble * v)
-{
- save_WindowPos4fMESA((GLfloat) v[0], (GLfloat) v[1], 0.0F, 1.0F);
-}
-
-static void GLAPIENTRY
-save_WindowPos2fvMESA(const GLfloat * v)
-{
- save_WindowPos4fMESA(v[0], v[1], 0.0F, 1.0F);
-}
-
-static void GLAPIENTRY
-save_WindowPos2ivMESA(const GLint * v)
-{
- save_WindowPos4fMESA((GLfloat) v[0], (GLfloat) v[1], 0.0F, 1.0F);
-}
-
-static void GLAPIENTRY
-save_WindowPos2svMESA(const GLshort * v)
-{
- save_WindowPos4fMESA(v[0], v[1], 0.0F, 1.0F);
-}
-
-static void GLAPIENTRY
-save_WindowPos3dvMESA(const GLdouble * v)
-{
- save_WindowPos4fMESA((GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2], 1.0F);
-}
-
-static void GLAPIENTRY
-save_WindowPos3fvMESA(const GLfloat * v)
-{
- save_WindowPos4fMESA(v[0], v[1], v[2], 1.0F);
-}
-
-static void GLAPIENTRY
-save_WindowPos3ivMESA(const GLint * v)
-{
- save_WindowPos4fMESA((GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2], 1.0F);
-}
-
-static void GLAPIENTRY
-save_WindowPos3svMESA(const GLshort * v)
-{
- save_WindowPos4fMESA(v[0], v[1], v[2], 1.0F);
-}
-
-static void GLAPIENTRY
-save_WindowPos4dvMESA(const GLdouble * v)
-{
- save_WindowPos4fMESA((GLfloat) v[0], (GLfloat) v[1],
- (GLfloat) v[2], (GLfloat) v[3]);
-}
-
-static void GLAPIENTRY
-save_WindowPos4fvMESA(const GLfloat * v)
-{
- save_WindowPos4fMESA(v[0], v[1], v[2], v[3]);
-}
-
-static void GLAPIENTRY
-save_WindowPos4ivMESA(const GLint * v)
-{
- save_WindowPos4fMESA((GLfloat) v[0], (GLfloat) v[1],
- (GLfloat) v[2], (GLfloat) v[3]);
-}
-
-static void GLAPIENTRY
-save_WindowPos4svMESA(const GLshort * v)
-{
- save_WindowPos4fMESA(v[0], v[1], v[2], v[3]);
-}
-
-
-
-/* GL_ARB_multitexture */
-static void GLAPIENTRY
-save_ActiveTextureARB(GLenum target)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = alloc_instruction(ctx, OPCODE_ACTIVE_TEXTURE, 1);
- if (n) {
- n[1].e = target;
- }
- if (ctx->ExecuteFlag) {
- CALL_ActiveTextureARB(ctx->Exec, (target));
- }
-}
-
-
-/* GL_ARB_transpose_matrix */
-
-static void GLAPIENTRY
-save_LoadTransposeMatrixdARB(const GLdouble m[16])
-{
- GLfloat tm[16];
- _math_transposefd(tm, m);
- save_LoadMatrixf(tm);
-}
-
-
-static void GLAPIENTRY
-save_LoadTransposeMatrixfARB(const GLfloat m[16])
-{
- GLfloat tm[16];
- _math_transposef(tm, m);
- save_LoadMatrixf(tm);
-}
-
-
-static void GLAPIENTRY
-save_MultTransposeMatrixdARB(const GLdouble m[16])
-{
- GLfloat tm[16];
- _math_transposefd(tm, m);
- save_MultMatrixf(tm);
-}
-
-
-static void GLAPIENTRY
-save_MultTransposeMatrixfARB(const GLfloat m[16])
-{
- GLfloat tm[16];
- _math_transposef(tm, m);
- save_MultMatrixf(tm);
-}
-
-
-/* GL_ARB_texture_compression */
-static void GLAPIENTRY
-save_CompressedTexImage1DARB(GLenum target, GLint level,
- GLenum internalFormat, GLsizei width,
- GLint border, GLsizei imageSize,
- const GLvoid * data)
-{
- GET_CURRENT_CONTEXT(ctx);
- if (target == GL_PROXY_TEXTURE_1D) {
- /* don't compile, execute immediately */
- CALL_CompressedTexImage1DARB(ctx->Exec, (target, level, internalFormat,
- width, border, imageSize,
- data));
- }
- else {
- Node *n;
- GLvoid *image;
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- /* make copy of image */
- image = malloc(imageSize);
- if (!image) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCompressedTexImage1DARB");
- return;
- }
- memcpy(image, data, imageSize);
- n = alloc_instruction(ctx, OPCODE_COMPRESSED_TEX_IMAGE_1D, 7);
- if (n) {
- n[1].e = target;
- n[2].i = level;
- n[3].e = internalFormat;
- n[4].i = (GLint) width;
- n[5].i = border;
- n[6].i = imageSize;
- n[7].data = image;
- }
- else if (image) {
- free(image);
- }
- if (ctx->ExecuteFlag) {
- CALL_CompressedTexImage1DARB(ctx->Exec,
- (target, level, internalFormat, width,
- border, imageSize, data));
- }
- }
-}
-
-
-static void GLAPIENTRY
-save_CompressedTexImage2DARB(GLenum target, GLint level,
- GLenum internalFormat, GLsizei width,
- GLsizei height, GLint border, GLsizei imageSize,
- const GLvoid * data)
-{
- GET_CURRENT_CONTEXT(ctx);
- if (target == GL_PROXY_TEXTURE_2D) {
- /* don't compile, execute immediately */
- CALL_CompressedTexImage2DARB(ctx->Exec, (target, level, internalFormat,
- width, height, border,
- imageSize, data));
- }
- else {
- Node *n;
- GLvoid *image;
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- /* make copy of image */
- image = malloc(imageSize);
- if (!image) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCompressedTexImage2DARB");
- return;
- }
- memcpy(image, data, imageSize);
- n = alloc_instruction(ctx, OPCODE_COMPRESSED_TEX_IMAGE_2D, 8);
- if (n) {
- n[1].e = target;
- n[2].i = level;
- n[3].e = internalFormat;
- n[4].i = (GLint) width;
- n[5].i = (GLint) height;
- n[6].i = border;
- n[7].i = imageSize;
- n[8].data = image;
- }
- else if (image) {
- free(image);
- }
- if (ctx->ExecuteFlag) {
- CALL_CompressedTexImage2DARB(ctx->Exec,
- (target, level, internalFormat, width,
- height, border, imageSize, data));
- }
- }
-}
-
-
-static void GLAPIENTRY
-save_CompressedTexImage3DARB(GLenum target, GLint level,
- GLenum internalFormat, GLsizei width,
- GLsizei height, GLsizei depth, GLint border,
- GLsizei imageSize, const GLvoid * data)
-{
- GET_CURRENT_CONTEXT(ctx);
- if (target == GL_PROXY_TEXTURE_3D) {
- /* don't compile, execute immediately */
- CALL_CompressedTexImage3DARB(ctx->Exec, (target, level, internalFormat,
- width, height, depth, border,
- imageSize, data));
- }
- else {
- Node *n;
- GLvoid *image;
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- /* make copy of image */
- image = malloc(imageSize);
- if (!image) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCompressedTexImage3DARB");
- return;
- }
- memcpy(image, data, imageSize);
- n = alloc_instruction(ctx, OPCODE_COMPRESSED_TEX_IMAGE_3D, 9);
- if (n) {
- n[1].e = target;
- n[2].i = level;
- n[3].e = internalFormat;
- n[4].i = (GLint) width;
- n[5].i = (GLint) height;
- n[6].i = (GLint) depth;
- n[7].i = border;
- n[8].i = imageSize;
- n[9].data = image;
- }
- else if (image) {
- free(image);
- }
- if (ctx->ExecuteFlag) {
- CALL_CompressedTexImage3DARB(ctx->Exec,
- (target, level, internalFormat, width,
- height, depth, border, imageSize,
- data));
- }
- }
-}
-
-
-static void GLAPIENTRY
-save_CompressedTexSubImage1DARB(GLenum target, GLint level, GLint xoffset,
- GLsizei width, GLenum format,
- GLsizei imageSize, const GLvoid * data)
-{
- Node *n;
- GLvoid *image;
-
- GET_CURRENT_CONTEXT(ctx);
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
-
- /* make copy of image */
- image = malloc(imageSize);
- if (!image) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCompressedTexSubImage1DARB");
- return;
- }
- memcpy(image, data, imageSize);
- n = alloc_instruction(ctx, OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D, 7);
- if (n) {
- n[1].e = target;
- n[2].i = level;
- n[3].i = xoffset;
- n[4].i = (GLint) width;
- n[5].e = format;
- n[6].i = imageSize;
- n[7].data = image;
- }
- else if (image) {
- free(image);
- }
- if (ctx->ExecuteFlag) {
- CALL_CompressedTexSubImage1DARB(ctx->Exec, (target, level, xoffset,
- width, format, imageSize,
- data));
- }
-}
-
-
-static void GLAPIENTRY
-save_CompressedTexSubImage2DARB(GLenum target, GLint level, GLint xoffset,
- GLint yoffset, GLsizei width, GLsizei height,
- GLenum format, GLsizei imageSize,
- const GLvoid * data)
-{
- Node *n;
- GLvoid *image;
-
- GET_CURRENT_CONTEXT(ctx);
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
-
- /* make copy of image */
- image = malloc(imageSize);
- if (!image) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCompressedTexSubImage2DARB");
- return;
- }
- memcpy(image, data, imageSize);
- n = alloc_instruction(ctx, OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D, 9);
- if (n) {
- n[1].e = target;
- n[2].i = level;
- n[3].i = xoffset;
- n[4].i = yoffset;
- n[5].i = (GLint) width;
- n[6].i = (GLint) height;
- n[7].e = format;
- n[8].i = imageSize;
- n[9].data = image;
- }
- else if (image) {
- free(image);
- }
- if (ctx->ExecuteFlag) {
- CALL_CompressedTexSubImage2DARB(ctx->Exec,
- (target, level, xoffset, yoffset, width,
- height, format, imageSize, data));
- }
-}
-
-
-static void GLAPIENTRY
-save_CompressedTexSubImage3DARB(GLenum target, GLint level, GLint xoffset,
- GLint yoffset, GLint zoffset, GLsizei width,
- GLsizei height, GLsizei depth, GLenum format,
- GLsizei imageSize, const GLvoid * data)
-{
- Node *n;
- GLvoid *image;
-
- GET_CURRENT_CONTEXT(ctx);
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
-
- /* make copy of image */
- image = malloc(imageSize);
- if (!image) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCompressedTexSubImage3DARB");
- return;
- }
- memcpy(image, data, imageSize);
- n = alloc_instruction(ctx, OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D, 11);
- if (n) {
- n[1].e = target;
- n[2].i = level;
- n[3].i = xoffset;
- n[4].i = yoffset;
- n[5].i = zoffset;
- n[6].i = (GLint) width;
- n[7].i = (GLint) height;
- n[8].i = (GLint) depth;
- n[9].e = format;
- n[10].i = imageSize;
- n[11].data = image;
- }
- else if (image) {
- free(image);
- }
- if (ctx->ExecuteFlag) {
- CALL_CompressedTexSubImage3DARB(ctx->Exec,
- (target, level, xoffset, yoffset,
- zoffset, width, height, depth, format,
- imageSize, data));
- }
-}
-
-
-/* GL_ARB_multisample */
-static void GLAPIENTRY
-save_SampleCoverageARB(GLclampf value, GLboolean invert)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = alloc_instruction(ctx, OPCODE_SAMPLE_COVERAGE, 2);
- if (n) {
- n[1].f = value;
- n[2].b = invert;
- }
- if (ctx->ExecuteFlag) {
- CALL_SampleCoverageARB(ctx->Exec, (value, invert));
- }
-}
-
-
-/*
- * GL_NV_vertex_program
- */
-#if FEATURE_NV_vertex_program || FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
-static void GLAPIENTRY
-save_BindProgramNV(GLenum target, GLuint id)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = alloc_instruction(ctx, OPCODE_BIND_PROGRAM_NV, 2);
- if (n) {
- n[1].e = target;
- n[2].ui = id;
- }
- if (ctx->ExecuteFlag) {
- CALL_BindProgramNV(ctx->Exec, (target, id));
- }
-}
-
-static void GLAPIENTRY
-save_ProgramEnvParameter4fARB(GLenum target, GLuint index,
- GLfloat x, GLfloat y, GLfloat z, GLfloat w)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = alloc_instruction(ctx, OPCODE_PROGRAM_ENV_PARAMETER_ARB, 6);
- if (n) {
- n[1].e = target;
- n[2].ui = index;
- n[3].f = x;
- n[4].f = y;
- n[5].f = z;
- n[6].f = w;
- }
- if (ctx->ExecuteFlag) {
- CALL_ProgramEnvParameter4fARB(ctx->Exec, (target, index, x, y, z, w));
- }
-}
-
-
-static void GLAPIENTRY
-save_ProgramEnvParameter4fvARB(GLenum target, GLuint index,
- const GLfloat *params)
-{
- save_ProgramEnvParameter4fARB(target, index, params[0], params[1],
- params[2], params[3]);
-}
-
-
-static void GLAPIENTRY
-save_ProgramEnvParameters4fvEXT(GLenum target, GLuint index, GLsizei count,
- const GLfloat * params)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
-
- if (count > 0) {
- GLint i;
- const GLfloat * p = params;
-
- for (i = 0 ; i < count ; i++) {
- n = alloc_instruction(ctx, OPCODE_PROGRAM_ENV_PARAMETER_ARB, 6);
- if (n) {
- n[1].e = target;
- n[2].ui = index;
- n[3].f = p[0];
- n[4].f = p[1];
- n[5].f = p[2];
- n[6].f = p[3];
- p += 4;
- }
- }
- }
-
- if (ctx->ExecuteFlag) {
- CALL_ProgramEnvParameters4fvEXT(ctx->Exec, (target, index, count, params));
- }
-}
-
-
-static void GLAPIENTRY
-save_ProgramEnvParameter4dARB(GLenum target, GLuint index,
- GLdouble x, GLdouble y, GLdouble z, GLdouble w)
-{
- save_ProgramEnvParameter4fARB(target, index,
- (GLfloat) x,
- (GLfloat) y, (GLfloat) z, (GLfloat) w);
-}
-
-
-static void GLAPIENTRY
-save_ProgramEnvParameter4dvARB(GLenum target, GLuint index,
- const GLdouble *params)
-{
- save_ProgramEnvParameter4fARB(target, index,
- (GLfloat) params[0],
- (GLfloat) params[1],
- (GLfloat) params[2], (GLfloat) params[3]);
-}
-
-#endif /* FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program || FEATURE_NV_vertex_program */
-
-#if FEATURE_NV_vertex_program
-static void GLAPIENTRY
-save_ExecuteProgramNV(GLenum target, GLuint id, const GLfloat *params)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = alloc_instruction(ctx, OPCODE_EXECUTE_PROGRAM_NV, 6);
- if (n) {
- n[1].e = target;
- n[2].ui = id;
- n[3].f = params[0];
- n[4].f = params[1];
- n[5].f = params[2];
- n[6].f = params[3];
- }
- if (ctx->ExecuteFlag) {
- CALL_ExecuteProgramNV(ctx->Exec, (target, id, params));
- }
-}
-
-
-static void GLAPIENTRY
-save_ProgramParameters4dvNV(GLenum target, GLuint index,
- GLsizei num, const GLdouble *params)
-{
- GLint i;
- for (i = 0; i < num; i++) {
- save_ProgramEnvParameter4dvARB(target, index + i, params + 4 * i);
- }
-}
-
-
-static void GLAPIENTRY
-save_ProgramParameters4fvNV(GLenum target, GLuint index,
- GLsizei num, const GLfloat *params)
-{
- GLint i;
- for (i = 0; i < num; i++) {
- save_ProgramEnvParameter4fvARB(target, index + i, params + 4 * i);
- }
-}
-
-
-static void GLAPIENTRY
-save_LoadProgramNV(GLenum target, GLuint id, GLsizei len,
- const GLubyte * program)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
-
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
-
- n = alloc_instruction(ctx, OPCODE_LOAD_PROGRAM_NV, 4);
- if (n) {
- GLubyte *programCopy = (GLubyte *) malloc(len);
- if (!programCopy) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "glLoadProgramNV");
- return;
- }
- memcpy(programCopy, program, len);
- n[1].e = target;
- n[2].ui = id;
- n[3].i = len;
- n[4].data = programCopy;
- }
- if (ctx->ExecuteFlag) {
- CALL_LoadProgramNV(ctx->Exec, (target, id, len, program));
- }
-}
-
-
-static void GLAPIENTRY
-save_RequestResidentProgramsNV(GLsizei num, const GLuint * ids)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
-
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
-
- n = alloc_instruction(ctx, OPCODE_TRACK_MATRIX_NV, 2);
- if (n) {
- GLuint *idCopy = (GLuint *) malloc(num * sizeof(GLuint));
- if (!idCopy) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "glRequestResidentProgramsNV");
- return;
- }
- memcpy(idCopy, ids, num * sizeof(GLuint));
- n[1].i = num;
- n[2].data = idCopy;
- }
- if (ctx->ExecuteFlag) {
- CALL_RequestResidentProgramsNV(ctx->Exec, (num, ids));
- }
-}
-
-
-static void GLAPIENTRY
-save_TrackMatrixNV(GLenum target, GLuint address,
- GLenum matrix, GLenum transform)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = alloc_instruction(ctx, OPCODE_TRACK_MATRIX_NV, 4);
- if (n) {
- n[1].e = target;
- n[2].ui = address;
- n[3].e = matrix;
- n[4].e = transform;
- }
- if (ctx->ExecuteFlag) {
- CALL_TrackMatrixNV(ctx->Exec, (target, address, matrix, transform));
- }
-}
-#endif /* FEATURE_NV_vertex_program */
-
-
-/*
- * GL_NV_fragment_program
- */
-#if FEATURE_NV_fragment_program
-static void GLAPIENTRY
-save_ProgramLocalParameter4fARB(GLenum target, GLuint index,
- GLfloat x, GLfloat y, GLfloat z, GLfloat w)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = alloc_instruction(ctx, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB, 6);
- if (n) {
- n[1].e = target;
- n[2].ui = index;
- n[3].f = x;
- n[4].f = y;
- n[5].f = z;
- n[6].f = w;
- }
- if (ctx->ExecuteFlag) {
- CALL_ProgramLocalParameter4fARB(ctx->Exec, (target, index, x, y, z, w));
- }
-}
-
-
-static void GLAPIENTRY
-save_ProgramLocalParameter4fvARB(GLenum target, GLuint index,
- const GLfloat *params)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = alloc_instruction(ctx, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB, 6);
- if (n) {
- n[1].e = target;
- n[2].ui = index;
- n[3].f = params[0];
- n[4].f = params[1];
- n[5].f = params[2];
- n[6].f = params[3];
- }
- if (ctx->ExecuteFlag) {
- CALL_ProgramLocalParameter4fvARB(ctx->Exec, (target, index, params));
- }
-}
-
-
-static void GLAPIENTRY
-save_ProgramLocalParameters4fvEXT(GLenum target, GLuint index, GLsizei count,
- const GLfloat *params)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
-
- if (count > 0) {
- GLint i;
- const GLfloat * p = params;
-
- for (i = 0 ; i < count ; i++) {
- n = alloc_instruction(ctx, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB, 6);
- if (n) {
- n[1].e = target;
- n[2].ui = index;
- n[3].f = p[0];
- n[4].f = p[1];
- n[5].f = p[2];
- n[6].f = p[3];
- p += 4;
- }
- }
- }
-
- if (ctx->ExecuteFlag) {
- CALL_ProgramLocalParameters4fvEXT(ctx->Exec, (target, index, count, params));
- }
-}
-
-
-static void GLAPIENTRY
-save_ProgramLocalParameter4dARB(GLenum target, GLuint index,
- GLdouble x, GLdouble y,
- GLdouble z, GLdouble w)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = alloc_instruction(ctx, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB, 6);
- if (n) {
- n[1].e = target;
- n[2].ui = index;
- n[3].f = (GLfloat) x;
- n[4].f = (GLfloat) y;
- n[5].f = (GLfloat) z;
- n[6].f = (GLfloat) w;
- }
- if (ctx->ExecuteFlag) {
- CALL_ProgramLocalParameter4dARB(ctx->Exec, (target, index, x, y, z, w));
- }
-}
-
-
-static void GLAPIENTRY
-save_ProgramLocalParameter4dvARB(GLenum target, GLuint index,
- const GLdouble *params)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = alloc_instruction(ctx, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB, 6);
- if (n) {
- n[1].e = target;
- n[2].ui = index;
- n[3].f = (GLfloat) params[0];
- n[4].f = (GLfloat) params[1];
- n[5].f = (GLfloat) params[2];
- n[6].f = (GLfloat) params[3];
- }
- if (ctx->ExecuteFlag) {
- CALL_ProgramLocalParameter4dvARB(ctx->Exec, (target, index, params));
- }
-}
-
-static void GLAPIENTRY
-save_ProgramNamedParameter4fNV(GLuint id, GLsizei len, const GLubyte * name,
- GLfloat x, GLfloat y, GLfloat z, GLfloat w)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
-
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
-
- n = alloc_instruction(ctx, OPCODE_PROGRAM_NAMED_PARAMETER_NV, 6);
- if (n) {
- GLubyte *nameCopy = (GLubyte *) malloc(len);
- if (!nameCopy) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "glProgramNamedParameter4fNV");
- return;
- }
- memcpy(nameCopy, name, len);
- n[1].ui = id;
- n[2].i = len;
- n[3].data = nameCopy;
- n[4].f = x;
- n[5].f = y;
- n[6].f = z;
- n[7].f = w;
- }
- if (ctx->ExecuteFlag) {
- CALL_ProgramNamedParameter4fNV(ctx->Exec, (id, len, name, x, y, z, w));
- }
-}
-
-
-static void GLAPIENTRY
-save_ProgramNamedParameter4fvNV(GLuint id, GLsizei len, const GLubyte * name,
- const float v[])
-{
- save_ProgramNamedParameter4fNV(id, len, name, v[0], v[1], v[2], v[3]);
-}
-
-
-static void GLAPIENTRY
-save_ProgramNamedParameter4dNV(GLuint id, GLsizei len, const GLubyte * name,
- GLdouble x, GLdouble y, GLdouble z, GLdouble w)
-{
- save_ProgramNamedParameter4fNV(id, len, name, (GLfloat) x, (GLfloat) y,
- (GLfloat) z, (GLfloat) w);
-}
-
-
-static void GLAPIENTRY
-save_ProgramNamedParameter4dvNV(GLuint id, GLsizei len, const GLubyte * name,
- const double v[])
-{
- save_ProgramNamedParameter4fNV(id, len, name, (GLfloat) v[0],
- (GLfloat) v[1], (GLfloat) v[2],
- (GLfloat) v[3]);
-}
-
-#endif /* FEATURE_NV_fragment_program */
-
-
-
-/* GL_EXT_stencil_two_side */
-static void GLAPIENTRY
-save_ActiveStencilFaceEXT(GLenum face)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = alloc_instruction(ctx, OPCODE_ACTIVE_STENCIL_FACE_EXT, 1);
- if (n) {
- n[1].e = face;
- }
- if (ctx->ExecuteFlag) {
- CALL_ActiveStencilFaceEXT(ctx->Exec, (face));
- }
-}
-
-
-/* GL_EXT_depth_bounds_test */
-static void GLAPIENTRY
-save_DepthBoundsEXT(GLclampd zmin, GLclampd zmax)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = alloc_instruction(ctx, OPCODE_DEPTH_BOUNDS_EXT, 2);
- if (n) {
- n[1].f = (GLfloat) zmin;
- n[2].f = (GLfloat) zmax;
- }
- if (ctx->ExecuteFlag) {
- CALL_DepthBoundsEXT(ctx->Exec, (zmin, zmax));
- }
-}
-
-
-
-#if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
-
-static void GLAPIENTRY
-save_ProgramStringARB(GLenum target, GLenum format, GLsizei len,
- const GLvoid * string)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
-
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
-
- n = alloc_instruction(ctx, OPCODE_PROGRAM_STRING_ARB, 4);
- if (n) {
- GLubyte *programCopy = (GLubyte *) malloc(len);
- if (!programCopy) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "glProgramStringARB");
- return;
- }
- memcpy(programCopy, string, len);
- n[1].e = target;
- n[2].e = format;
- n[3].i = len;
- n[4].data = programCopy;
- }
- if (ctx->ExecuteFlag) {
- CALL_ProgramStringARB(ctx->Exec, (target, format, len, string));
- }
-}
-
-#endif /* FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program */
-
-
-#if FEATURE_queryobj
-
-static void GLAPIENTRY
-save_BeginQueryARB(GLenum target, GLuint id)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = alloc_instruction(ctx, OPCODE_BEGIN_QUERY_ARB, 2);
- if (n) {
- n[1].e = target;
- n[2].ui = id;
- }
- if (ctx->ExecuteFlag) {
- CALL_BeginQueryARB(ctx->Exec, (target, id));
- }
-}
-
-
-static void GLAPIENTRY
-save_EndQueryARB(GLenum target)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = alloc_instruction(ctx, OPCODE_END_QUERY_ARB, 1);
- if (n) {
- n[1].e = target;
- }
- if (ctx->ExecuteFlag) {
- CALL_EndQueryARB(ctx->Exec, (target));
- }
-}
-
-#endif /* FEATURE_queryobj */
-
-
-static void GLAPIENTRY
-save_DrawBuffersARB(GLsizei count, const GLenum * buffers)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = alloc_instruction(ctx, OPCODE_DRAW_BUFFERS_ARB, 1 + MAX_DRAW_BUFFERS);
- if (n) {
- GLint i;
- n[1].i = count;
- if (count > MAX_DRAW_BUFFERS)
- count = MAX_DRAW_BUFFERS;
- for (i = 0; i < count; i++) {
- n[2 + i].e = buffers[i];
- }
- }
- if (ctx->ExecuteFlag) {
- CALL_DrawBuffersARB(ctx->Exec, (count, buffers));
- }
-}
-
-static void GLAPIENTRY
-save_TexBumpParameterfvATI(GLenum pname, const GLfloat *param)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
-
- n = alloc_instruction(ctx, OPCODE_TEX_BUMP_PARAMETER_ATI, 5);
- if (n) {
- n[1].ui = pname;
- n[2].f = param[0];
- n[3].f = param[1];
- n[4].f = param[2];
- n[5].f = param[3];
- }
- if (ctx->ExecuteFlag) {
- CALL_TexBumpParameterfvATI(ctx->Exec, (pname, param));
- }
-}
-
-static void GLAPIENTRY
-save_TexBumpParameterivATI(GLenum pname, const GLint *param)
-{
- GLfloat p[4];
- p[0] = INT_TO_FLOAT(param[0]);
- p[1] = INT_TO_FLOAT(param[1]);
- p[2] = INT_TO_FLOAT(param[2]);
- p[3] = INT_TO_FLOAT(param[3]);
- save_TexBumpParameterfvATI(pname, p);
-}
-
-#if FEATURE_ATI_fragment_shader
-static void GLAPIENTRY
-save_BindFragmentShaderATI(GLuint id)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
-
- n = alloc_instruction(ctx, OPCODE_BIND_FRAGMENT_SHADER_ATI, 1);
- if (n) {
- n[1].ui = id;
- }
- if (ctx->ExecuteFlag) {
- CALL_BindFragmentShaderATI(ctx->Exec, (id));
- }
-}
-
-static void GLAPIENTRY
-save_SetFragmentShaderConstantATI(GLuint dst, const GLfloat *value)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
-
- n = alloc_instruction(ctx, OPCODE_SET_FRAGMENT_SHADER_CONSTANTS_ATI, 5);
- if (n) {
- n[1].ui = dst;
- n[2].f = value[0];
- n[3].f = value[1];
- n[4].f = value[2];
- n[5].f = value[3];
- }
- if (ctx->ExecuteFlag) {
- CALL_SetFragmentShaderConstantATI(ctx->Exec, (dst, value));
- }
-}
-#endif
-
-static void GLAPIENTRY
-save_Attr1fNV(GLenum attr, GLfloat x)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- SAVE_FLUSH_VERTICES(ctx);
- n = alloc_instruction(ctx, OPCODE_ATTR_1F_NV, 2);
- if (n) {
- n[1].e = attr;
- n[2].f = x;
- }
-
- ASSERT(attr < MAX_VERTEX_GENERIC_ATTRIBS);
- ctx->ListState.ActiveAttribSize[attr] = 1;
- ASSIGN_4V(ctx->ListState.CurrentAttrib[attr], x, 0, 0, 1);
-
- if (ctx->ExecuteFlag) {
- CALL_VertexAttrib1fNV(ctx->Exec, (attr, x));
- }
-}
-
-static void GLAPIENTRY
-save_Attr2fNV(GLenum attr, GLfloat x, GLfloat y)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- SAVE_FLUSH_VERTICES(ctx);
- n = alloc_instruction(ctx, OPCODE_ATTR_2F_NV, 3);
- if (n) {
- n[1].e = attr;
- n[2].f = x;
- n[3].f = y;
- }
-
- ASSERT(attr < MAX_VERTEX_GENERIC_ATTRIBS);
- ctx->ListState.ActiveAttribSize[attr] = 2;
- ASSIGN_4V(ctx->ListState.CurrentAttrib[attr], x, y, 0, 1);
-
- if (ctx->ExecuteFlag) {
- CALL_VertexAttrib2fNV(ctx->Exec, (attr, x, y));
- }
-}
-
-static void GLAPIENTRY
-save_Attr3fNV(GLenum attr, GLfloat x, GLfloat y, GLfloat z)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- SAVE_FLUSH_VERTICES(ctx);
- n = alloc_instruction(ctx, OPCODE_ATTR_3F_NV, 4);
- if (n) {
- n[1].e = attr;
- n[2].f = x;
- n[3].f = y;
- n[4].f = z;
- }
-
- ASSERT(attr < MAX_VERTEX_GENERIC_ATTRIBS);
- ctx->ListState.ActiveAttribSize[attr] = 3;
- ASSIGN_4V(ctx->ListState.CurrentAttrib[attr], x, y, z, 1);
-
- if (ctx->ExecuteFlag) {
- CALL_VertexAttrib3fNV(ctx->Exec, (attr, x, y, z));
- }
-}
-
-static void GLAPIENTRY
-save_Attr4fNV(GLenum attr, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- SAVE_FLUSH_VERTICES(ctx);
- n = alloc_instruction(ctx, OPCODE_ATTR_4F_NV, 5);
- if (n) {
- n[1].e = attr;
- n[2].f = x;
- n[3].f = y;
- n[4].f = z;
- n[5].f = w;
- }
-
- ASSERT(attr < MAX_VERTEX_GENERIC_ATTRIBS);
- ctx->ListState.ActiveAttribSize[attr] = 4;
- ASSIGN_4V(ctx->ListState.CurrentAttrib[attr], x, y, z, w);
-
- if (ctx->ExecuteFlag) {
- CALL_VertexAttrib4fNV(ctx->Exec, (attr, x, y, z, w));
- }
-}
-
-
-static void GLAPIENTRY
-save_Attr1fARB(GLenum attr, GLfloat x)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- SAVE_FLUSH_VERTICES(ctx);
- n = alloc_instruction(ctx, OPCODE_ATTR_1F_ARB, 2);
- if (n) {
- n[1].e = attr;
- n[2].f = x;
- }
-
- ASSERT(attr < MAX_VERTEX_GENERIC_ATTRIBS);
- ctx->ListState.ActiveAttribSize[attr] = 1;
- ASSIGN_4V(ctx->ListState.CurrentAttrib[attr], x, 0, 0, 1);
-
- if (ctx->ExecuteFlag) {
- CALL_VertexAttrib1fARB(ctx->Exec, (attr, x));
- }
-}
-
-static void GLAPIENTRY
-save_Attr2fARB(GLenum attr, GLfloat x, GLfloat y)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- SAVE_FLUSH_VERTICES(ctx);
- n = alloc_instruction(ctx, OPCODE_ATTR_2F_ARB, 3);
- if (n) {
- n[1].e = attr;
- n[2].f = x;
- n[3].f = y;
- }
-
- ASSERT(attr < MAX_VERTEX_GENERIC_ATTRIBS);
- ctx->ListState.ActiveAttribSize[attr] = 2;
- ASSIGN_4V(ctx->ListState.CurrentAttrib[attr], x, y, 0, 1);
-
- if (ctx->ExecuteFlag) {
- CALL_VertexAttrib2fARB(ctx->Exec, (attr, x, y));
- }
-}
-
-static void GLAPIENTRY
-save_Attr3fARB(GLenum attr, GLfloat x, GLfloat y, GLfloat z)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- SAVE_FLUSH_VERTICES(ctx);
- n = alloc_instruction(ctx, OPCODE_ATTR_3F_ARB, 4);
- if (n) {
- n[1].e = attr;
- n[2].f = x;
- n[3].f = y;
- n[4].f = z;
- }
-
- ASSERT(attr < MAX_VERTEX_GENERIC_ATTRIBS);
- ctx->ListState.ActiveAttribSize[attr] = 3;
- ASSIGN_4V(ctx->ListState.CurrentAttrib[attr], x, y, z, 1);
-
- if (ctx->ExecuteFlag) {
- CALL_VertexAttrib3fARB(ctx->Exec, (attr, x, y, z));
- }
-}
-
-static void GLAPIENTRY
-save_Attr4fARB(GLenum attr, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- SAVE_FLUSH_VERTICES(ctx);
- n = alloc_instruction(ctx, OPCODE_ATTR_4F_ARB, 5);
- if (n) {
- n[1].e = attr;
- n[2].f = x;
- n[3].f = y;
- n[4].f = z;
- n[5].f = w;
- }
-
- ASSERT(attr < MAX_VERTEX_GENERIC_ATTRIBS);
- ctx->ListState.ActiveAttribSize[attr] = 4;
- ASSIGN_4V(ctx->ListState.CurrentAttrib[attr], x, y, z, w);
-
- if (ctx->ExecuteFlag) {
- CALL_VertexAttrib4fARB(ctx->Exec, (attr, x, y, z, w));
- }
-}
-
-
-static void GLAPIENTRY
-save_EvalCoord1f(GLfloat x)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- SAVE_FLUSH_VERTICES(ctx);
- n = alloc_instruction(ctx, OPCODE_EVAL_C1, 1);
- if (n) {
- n[1].f = x;
- }
- if (ctx->ExecuteFlag) {
- CALL_EvalCoord1f(ctx->Exec, (x));
- }
-}
-
-static void GLAPIENTRY
-save_EvalCoord1fv(const GLfloat * v)
-{
- save_EvalCoord1f(v[0]);
-}
-
-static void GLAPIENTRY
-save_EvalCoord2f(GLfloat x, GLfloat y)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- SAVE_FLUSH_VERTICES(ctx);
- n = alloc_instruction(ctx, OPCODE_EVAL_C2, 2);
- if (n) {
- n[1].f = x;
- n[2].f = y;
- }
- if (ctx->ExecuteFlag) {
- CALL_EvalCoord2f(ctx->Exec, (x, y));
- }
-}
-
-static void GLAPIENTRY
-save_EvalCoord2fv(const GLfloat * v)
-{
- save_EvalCoord2f(v[0], v[1]);
-}
-
-
-static void GLAPIENTRY
-save_EvalPoint1(GLint x)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- SAVE_FLUSH_VERTICES(ctx);
- n = alloc_instruction(ctx, OPCODE_EVAL_P1, 1);
- if (n) {
- n[1].i = x;
- }
- if (ctx->ExecuteFlag) {
- CALL_EvalPoint1(ctx->Exec, (x));
- }
-}
-
-static void GLAPIENTRY
-save_EvalPoint2(GLint x, GLint y)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- SAVE_FLUSH_VERTICES(ctx);
- n = alloc_instruction(ctx, OPCODE_EVAL_P2, 2);
- if (n) {
- n[1].i = x;
- n[2].i = y;
- }
- if (ctx->ExecuteFlag) {
- CALL_EvalPoint2(ctx->Exec, (x, y));
- }
-}
-
-static void GLAPIENTRY
-save_Indexf(GLfloat x)
-{
- save_Attr1fNV(VERT_ATTRIB_COLOR_INDEX, x);
-}
-
-static void GLAPIENTRY
-save_Indexfv(const GLfloat * v)
-{
- save_Attr1fNV(VERT_ATTRIB_COLOR_INDEX, v[0]);
-}
-
-static void GLAPIENTRY
-save_EdgeFlag(GLboolean x)
-{
- save_Attr1fNV(VERT_ATTRIB_EDGEFLAG, x ? (GLfloat)1.0 : (GLfloat)0.0);
-}
-
-static INLINE GLboolean compare4fv( const GLfloat *a,
- const GLfloat *b,
- GLuint count )
-{
- return memcmp( a, b, count * sizeof(GLfloat) ) == 0;
-}
-
-
-static void GLAPIENTRY
-save_Materialfv(GLenum face, GLenum pname, const GLfloat * param)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- int args, i;
- GLuint bitmask;
-
- switch (face) {
- case GL_BACK:
- case GL_FRONT:
- case GL_FRONT_AND_BACK:
- break;
- default:
- _mesa_compile_error(ctx, GL_INVALID_ENUM, "material(face)");
- return;
- }
-
- switch (pname) {
- case GL_EMISSION:
- case GL_AMBIENT:
- case GL_DIFFUSE:
- case GL_SPECULAR:
- case GL_AMBIENT_AND_DIFFUSE:
- args = 4;
- break;
- case GL_SHININESS:
- args = 1;
- break;
- case GL_COLOR_INDEXES:
- args = 3;
- break;
- default:
- _mesa_compile_error(ctx, GL_INVALID_ENUM, "material(pname)");
- return;
- }
-
- if (ctx->ExecuteFlag) {
- CALL_Materialfv(ctx->Exec, (face, pname, param));
- }
-
- bitmask = _mesa_material_bitmask(ctx, face, pname, ~0, NULL);
-
- /* Try to eliminate redundant statechanges. Because it is legal to
- * call glMaterial even inside begin/end calls, don't need to worry
- * about ctx->Driver.CurrentSavePrimitive here.
- */
- for (i = 0; i < MAT_ATTRIB_MAX; i++) {
- if (bitmask & (1 << i)) {
- if (ctx->ListState.ActiveMaterialSize[i] == args &&
- compare4fv(ctx->ListState.CurrentMaterial[i], param, args)) {
- bitmask &= ~(1 << i);
- }
- else {
- ctx->ListState.ActiveMaterialSize[i] = args;
- COPY_SZ_4V(ctx->ListState.CurrentMaterial[i], args, param);
- }
- }
- }
-
- /* If this call has effect, return early:
- */
- if (bitmask == 0)
- return;
-
- SAVE_FLUSH_VERTICES(ctx);
-
- n = alloc_instruction(ctx, OPCODE_MATERIAL, 6);
- if (n) {
- n[1].e = face;
- n[2].e = pname;
- for (i = 0; i < args; i++)
- n[3 + i].f = param[i];
- }
-}
-
-static void GLAPIENTRY
-save_Begin(GLenum mode)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- GLboolean error = GL_FALSE;
-
- if ( /*mode < GL_POINTS || */ mode > GL_POLYGON) {
- _mesa_compile_error(ctx, GL_INVALID_ENUM, "Begin (mode)");
- error = GL_TRUE;
- }
- else if (ctx->Driver.CurrentSavePrimitive == PRIM_UNKNOWN) {
- /* Typically the first begin. This may raise an error on
- * playback, depending on whether CallList is issued from inside
- * a begin/end or not.
- */
- ctx->Driver.CurrentSavePrimitive = PRIM_INSIDE_UNKNOWN_PRIM;
- }
- else if (ctx->Driver.CurrentSavePrimitive == PRIM_OUTSIDE_BEGIN_END) {
- ctx->Driver.CurrentSavePrimitive = mode;
- }
- else {
- _mesa_compile_error(ctx, GL_INVALID_OPERATION, "recursive begin");
- error = GL_TRUE;
- }
-
- if (!error) {
- /* Give the driver an opportunity to hook in an optimized
- * display list compiler.
- */
- if (ctx->Driver.NotifySaveBegin(ctx, mode))
- return;
-
- SAVE_FLUSH_VERTICES(ctx);
- n = alloc_instruction(ctx, OPCODE_BEGIN, 1);
- if (n) {
- n[1].e = mode;
- }
- }
-
- if (ctx->ExecuteFlag) {
- CALL_Begin(ctx->Exec, (mode));
- }
-}
-
-static void GLAPIENTRY
-save_End(void)
-{
- GET_CURRENT_CONTEXT(ctx);
- SAVE_FLUSH_VERTICES(ctx);
- (void) alloc_instruction(ctx, OPCODE_END, 0);
- ctx->Driver.CurrentSavePrimitive = PRIM_OUTSIDE_BEGIN_END;
- if (ctx->ExecuteFlag) {
- CALL_End(ctx->Exec, ());
- }
-}
-
-static void GLAPIENTRY
-save_Rectf(GLfloat a, GLfloat b, GLfloat c, GLfloat d)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- SAVE_FLUSH_VERTICES(ctx);
- n = alloc_instruction(ctx, OPCODE_RECTF, 4);
- if (n) {
- n[1].f = a;
- n[2].f = b;
- n[3].f = c;
- n[4].f = d;
- }
- if (ctx->ExecuteFlag) {
- CALL_Rectf(ctx->Exec, (a, b, c, d));
- }
-}
-
-
-static void GLAPIENTRY
-save_Vertex2f(GLfloat x, GLfloat y)
-{
- save_Attr2fNV(VERT_ATTRIB_POS, x, y);
-}
-
-static void GLAPIENTRY
-save_Vertex2fv(const GLfloat * v)
-{
- save_Attr2fNV(VERT_ATTRIB_POS, v[0], v[1]);
-}
-
-static void GLAPIENTRY
-save_Vertex3f(GLfloat x, GLfloat y, GLfloat z)
-{
- save_Attr3fNV(VERT_ATTRIB_POS, x, y, z);
-}
-
-static void GLAPIENTRY
-save_Vertex3fv(const GLfloat * v)
-{
- save_Attr3fNV(VERT_ATTRIB_POS, v[0], v[1], v[2]);
-}
-
-static void GLAPIENTRY
-save_Vertex4f(GLfloat x, GLfloat y, GLfloat z, GLfloat w)
-{
- save_Attr4fNV(VERT_ATTRIB_POS, x, y, z, w);
-}
-
-static void GLAPIENTRY
-save_Vertex4fv(const GLfloat * v)
-{
- save_Attr4fNV(VERT_ATTRIB_POS, v[0], v[1], v[2], v[3]);
-}
-
-static void GLAPIENTRY
-save_TexCoord1f(GLfloat x)
-{
- save_Attr1fNV(VERT_ATTRIB_TEX0, x);
-}
-
-static void GLAPIENTRY
-save_TexCoord1fv(const GLfloat * v)
-{
- save_Attr1fNV(VERT_ATTRIB_TEX0, v[0]);
-}
-
-static void GLAPIENTRY
-save_TexCoord2f(GLfloat x, GLfloat y)
-{
- save_Attr2fNV(VERT_ATTRIB_TEX0, x, y);
-}
-
-static void GLAPIENTRY
-save_TexCoord2fv(const GLfloat * v)
-{
- save_Attr2fNV(VERT_ATTRIB_TEX0, v[0], v[1]);
-}
-
-static void GLAPIENTRY
-save_TexCoord3f(GLfloat x, GLfloat y, GLfloat z)
-{
- save_Attr3fNV(VERT_ATTRIB_TEX0, x, y, z);
-}
-
-static void GLAPIENTRY
-save_TexCoord3fv(const GLfloat * v)
-{
- save_Attr3fNV(VERT_ATTRIB_TEX0, v[0], v[1], v[2]);
-}
-
-static void GLAPIENTRY
-save_TexCoord4f(GLfloat x, GLfloat y, GLfloat z, GLfloat w)
-{
- save_Attr4fNV(VERT_ATTRIB_TEX0, x, y, z, w);
-}
-
-static void GLAPIENTRY
-save_TexCoord4fv(const GLfloat * v)
-{
- save_Attr4fNV(VERT_ATTRIB_TEX0, v[0], v[1], v[2], v[3]);
-}
-
-static void GLAPIENTRY
-save_Normal3f(GLfloat x, GLfloat y, GLfloat z)
-{
- save_Attr3fNV(VERT_ATTRIB_NORMAL, x, y, z);
-}
-
-static void GLAPIENTRY
-save_Normal3fv(const GLfloat * v)
-{
- save_Attr3fNV(VERT_ATTRIB_NORMAL, v[0], v[1], v[2]);
-}
-
-static void GLAPIENTRY
-save_FogCoordfEXT(GLfloat x)
-{
- save_Attr1fNV(VERT_ATTRIB_FOG, x);
-}
-
-static void GLAPIENTRY
-save_FogCoordfvEXT(const GLfloat * v)
-{
- save_Attr1fNV(VERT_ATTRIB_FOG, v[0]);
-}
-
-static void GLAPIENTRY
-save_Color3f(GLfloat x, GLfloat y, GLfloat z)
-{
- save_Attr3fNV(VERT_ATTRIB_COLOR0, x, y, z);
-}
-
-static void GLAPIENTRY
-save_Color3fv(const GLfloat * v)
-{
- save_Attr3fNV(VERT_ATTRIB_COLOR0, v[0], v[1], v[2]);
-}
-
-static void GLAPIENTRY
-save_Color4f(GLfloat x, GLfloat y, GLfloat z, GLfloat w)
-{
- save_Attr4fNV(VERT_ATTRIB_COLOR0, x, y, z, w);
-}
-
-static void GLAPIENTRY
-save_Color4fv(const GLfloat * v)
-{
- save_Attr4fNV(VERT_ATTRIB_COLOR0, v[0], v[1], v[2], v[3]);
-}
-
-static void GLAPIENTRY
-save_SecondaryColor3fEXT(GLfloat x, GLfloat y, GLfloat z)
-{
- save_Attr3fNV(VERT_ATTRIB_COLOR1, x, y, z);
-}
-
-static void GLAPIENTRY
-save_SecondaryColor3fvEXT(const GLfloat * v)
-{
- save_Attr3fNV(VERT_ATTRIB_COLOR1, v[0], v[1], v[2]);
-}
-
-
-/* Just call the respective ATTR for texcoord
- */
-static void GLAPIENTRY
-save_MultiTexCoord1f(GLenum target, GLfloat x)
-{
- GLuint attr = (target & 0x7) + VERT_ATTRIB_TEX0;
- save_Attr1fNV(attr, x);
-}
-
-static void GLAPIENTRY
-save_MultiTexCoord1fv(GLenum target, const GLfloat * v)
-{
- GLuint attr = (target & 0x7) + VERT_ATTRIB_TEX0;
- save_Attr1fNV(attr, v[0]);
-}
-
-static void GLAPIENTRY
-save_MultiTexCoord2f(GLenum target, GLfloat x, GLfloat y)
-{
- GLuint attr = (target & 0x7) + VERT_ATTRIB_TEX0;
- save_Attr2fNV(attr, x, y);
-}
-
-static void GLAPIENTRY
-save_MultiTexCoord2fv(GLenum target, const GLfloat * v)
-{
- GLuint attr = (target & 0x7) + VERT_ATTRIB_TEX0;
- save_Attr2fNV(attr, v[0], v[1]);
-}
-
-static void GLAPIENTRY
-save_MultiTexCoord3f(GLenum target, GLfloat x, GLfloat y, GLfloat z)
-{
- GLuint attr = (target & 0x7) + VERT_ATTRIB_TEX0;
- save_Attr3fNV(attr, x, y, z);
-}
-
-static void GLAPIENTRY
-save_MultiTexCoord3fv(GLenum target, const GLfloat * v)
-{
- GLuint attr = (target & 0x7) + VERT_ATTRIB_TEX0;
- save_Attr3fNV(attr, v[0], v[1], v[2]);
-}
-
-static void GLAPIENTRY
-save_MultiTexCoord4f(GLenum target, GLfloat x, GLfloat y,
- GLfloat z, GLfloat w)
-{
- GLuint attr = (target & 0x7) + VERT_ATTRIB_TEX0;
- save_Attr4fNV(attr, x, y, z, w);
-}
-
-static void GLAPIENTRY
-save_MultiTexCoord4fv(GLenum target, const GLfloat * v)
-{
- GLuint attr = (target & 0x7) + VERT_ATTRIB_TEX0;
- save_Attr4fNV(attr, v[0], v[1], v[2], v[3]);
-}
-
-
-/**
- * Record a GL_INVALID_VALUE error when a invalid vertex attribute
- * index is found.
- */
-static void
-index_error(void)
-{
- GET_CURRENT_CONTEXT(ctx);
- _mesa_error(ctx, GL_INVALID_VALUE, "VertexAttribf(index)");
-}
-
-
-/* First level for NV_vertex_program:
- *
- * Check for errors at compile time?.
- */
-static void GLAPIENTRY
-save_VertexAttrib1fNV(GLuint index, GLfloat x)
-{
- if (index < MAX_NV_VERTEX_PROGRAM_INPUTS)
- save_Attr1fNV(index, x);
- else
- index_error();
-}
-
-static void GLAPIENTRY
-save_VertexAttrib1fvNV(GLuint index, const GLfloat * v)
-{
- if (index < MAX_NV_VERTEX_PROGRAM_INPUTS)
- save_Attr1fNV(index, v[0]);
- else
- index_error();
-}
-
-static void GLAPIENTRY
-save_VertexAttrib2fNV(GLuint index, GLfloat x, GLfloat y)
-{
- if (index < MAX_NV_VERTEX_PROGRAM_INPUTS)
- save_Attr2fNV(index, x, y);
- else
- index_error();
-}
-
-static void GLAPIENTRY
-save_VertexAttrib2fvNV(GLuint index, const GLfloat * v)
-{
- if (index < MAX_NV_VERTEX_PROGRAM_INPUTS)
- save_Attr2fNV(index, v[0], v[1]);
- else
- index_error();
-}
-
-static void GLAPIENTRY
-save_VertexAttrib3fNV(GLuint index, GLfloat x, GLfloat y, GLfloat z)
-{
- if (index < MAX_NV_VERTEX_PROGRAM_INPUTS)
- save_Attr3fNV(index, x, y, z);
- else
- index_error();
-}
-
-static void GLAPIENTRY
-save_VertexAttrib3fvNV(GLuint index, const GLfloat * v)
-{
- if (index < MAX_NV_VERTEX_PROGRAM_INPUTS)
- save_Attr3fNV(index, v[0], v[1], v[2]);
- else
- index_error();
-}
-
-static void GLAPIENTRY
-save_VertexAttrib4fNV(GLuint index, GLfloat x, GLfloat y,
- GLfloat z, GLfloat w)
-{
- if (index < MAX_NV_VERTEX_PROGRAM_INPUTS)
- save_Attr4fNV(index, x, y, z, w);
- else
- index_error();
-}
-
-static void GLAPIENTRY
-save_VertexAttrib4fvNV(GLuint index, const GLfloat * v)
-{
- if (index < MAX_NV_VERTEX_PROGRAM_INPUTS)
- save_Attr4fNV(index, v[0], v[1], v[2], v[3]);
- else
- index_error();
-}
-
-
-
-
-static void GLAPIENTRY
-save_VertexAttrib1fARB(GLuint index, GLfloat x)
-{
- if (index < MAX_VERTEX_GENERIC_ATTRIBS)
- save_Attr1fARB(index, x);
- else
- index_error();
-}
-
-static void GLAPIENTRY
-save_VertexAttrib1fvARB(GLuint index, const GLfloat * v)
-{
- if (index < MAX_VERTEX_GENERIC_ATTRIBS)
- save_Attr1fARB(index, v[0]);
- else
- index_error();
-}
-
-static void GLAPIENTRY
-save_VertexAttrib2fARB(GLuint index, GLfloat x, GLfloat y)
-{
- if (index < MAX_VERTEX_GENERIC_ATTRIBS)
- save_Attr2fARB(index, x, y);
- else
- index_error();
-}
-
-static void GLAPIENTRY
-save_VertexAttrib2fvARB(GLuint index, const GLfloat * v)
-{
- if (index < MAX_VERTEX_GENERIC_ATTRIBS)
- save_Attr2fARB(index, v[0], v[1]);
- else
- index_error();
-}
-
-static void GLAPIENTRY
-save_VertexAttrib3fARB(GLuint index, GLfloat x, GLfloat y, GLfloat z)
-{
- if (index < MAX_VERTEX_GENERIC_ATTRIBS)
- save_Attr3fARB(index, x, y, z);
- else
- index_error();
-}
-
-static void GLAPIENTRY
-save_VertexAttrib3fvARB(GLuint index, const GLfloat * v)
-{
- if (index < MAX_VERTEX_GENERIC_ATTRIBS)
- save_Attr3fARB(index, v[0], v[1], v[2]);
- else
- index_error();
-}
-
-static void GLAPIENTRY
-save_VertexAttrib4fARB(GLuint index, GLfloat x, GLfloat y, GLfloat z,
- GLfloat w)
-{
- if (index < MAX_VERTEX_GENERIC_ATTRIBS)
- save_Attr4fARB(index, x, y, z, w);
- else
- index_error();
-}
-
-static void GLAPIENTRY
-save_VertexAttrib4fvARB(GLuint index, const GLfloat * v)
-{
- if (index < MAX_VERTEX_GENERIC_ATTRIBS)
- save_Attr4fARB(index, v[0], v[1], v[2], v[3]);
- else
- index_error();
-}
-
-
-/* GL_ARB_shader_objects, GL_ARB_vertex/fragment_shader */
-
-static void GLAPIENTRY
-exec_BindAttribLocationARB(GLuint program, GLuint index, const GLchar *name)
-{
- GET_CURRENT_CONTEXT(ctx);
- FLUSH_VERTICES(ctx, 0);
- CALL_BindAttribLocationARB(ctx->Exec, (program, index, name));
-}
-
-static GLint GLAPIENTRY
-exec_GetAttribLocationARB(GLuint program, const GLchar *name)
-{
- GET_CURRENT_CONTEXT(ctx);
- FLUSH_VERTICES(ctx, 0);
- return CALL_GetAttribLocationARB(ctx->Exec, (program, name));
-}
-
-static GLint GLAPIENTRY
-exec_GetUniformLocationARB(GLuint program, const GLchar *name)
-{
- GET_CURRENT_CONTEXT(ctx);
- FLUSH_VERTICES(ctx, 0);
- return CALL_GetUniformLocationARB(ctx->Exec, (program, name));
-}
-/* XXX more shader functions needed here */
-
-
-#if FEATURE_EXT_framebuffer_blit
-static void GLAPIENTRY
-save_BlitFramebufferEXT(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1,
- GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1,
- GLbitfield mask, GLenum filter)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = alloc_instruction(ctx, OPCODE_BLIT_FRAMEBUFFER, 10);
- if (n) {
- n[1].i = srcX0;
- n[2].i = srcY0;
- n[3].i = srcX1;
- n[4].i = srcY1;
- n[5].i = dstX0;
- n[6].i = dstY0;
- n[7].i = dstX1;
- n[8].i = dstY1;
- n[9].i = mask;
- n[10].e = filter;
- }
- if (ctx->ExecuteFlag) {
- CALL_BlitFramebufferEXT(ctx->Exec, (srcX0, srcY0, srcX1, srcY1,
- dstX0, dstY0, dstX1, dstY1,
- mask, filter));
- }
-}
-#endif
-
-
-/** GL_EXT_provoking_vertex */
-static void GLAPIENTRY
-save_ProvokingVertexEXT(GLenum mode)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = alloc_instruction(ctx, OPCODE_PROVOKING_VERTEX, 1);
- if (n) {
- n[1].e = mode;
- }
- if (ctx->ExecuteFlag) {
- /*CALL_ProvokingVertexEXT(ctx->Exec, (mode));*/
- _mesa_ProvokingVertexEXT(mode);
- }
-}
-
-
-/** GL_EXT_transform_feedback */
-static void GLAPIENTRY
-save_BeginTransformFeedback(GLenum mode)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = alloc_instruction(ctx, OPCODE_BEGIN_TRANSFORM_FEEDBACK, 1);
- if (n) {
- n[1].e = mode;
- }
- if (ctx->ExecuteFlag) {
- CALL_BeginTransformFeedbackEXT(ctx->Exec, (mode));
- }
-}
-
-
-/** GL_EXT_transform_feedback */
-static void GLAPIENTRY
-save_EndTransformFeedback(void)
-{
- GET_CURRENT_CONTEXT(ctx);
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- (void) alloc_instruction(ctx, OPCODE_END_TRANSFORM_FEEDBACK, 0);
- if (ctx->ExecuteFlag) {
- CALL_EndTransformFeedbackEXT(ctx->Exec, ());
- }
-}
-
-
-/* aka UseProgram() */
-static void GLAPIENTRY
-save_UseProgramObjectARB(GLhandleARB program)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = alloc_instruction(ctx, OPCODE_USE_PROGRAM, 1);
- if (n) {
- n[1].ui = program;
- }
- if (ctx->ExecuteFlag) {
- CALL_UseProgramObjectARB(ctx->Exec, (program));
- }
-}
-
-
-static void GLAPIENTRY
-save_Uniform1fARB(GLint location, GLfloat x)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = alloc_instruction(ctx, OPCODE_UNIFORM_1F, 2);
- if (n) {
- n[1].i = location;
- n[2].f = x;
- }
- if (ctx->ExecuteFlag) {
- CALL_Uniform1fARB(ctx->Exec, (location, x));
- }
-}
-
-
-static void GLAPIENTRY
-save_Uniform2fARB(GLint location, GLfloat x, GLfloat y)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = alloc_instruction(ctx, OPCODE_UNIFORM_2F, 3);
- if (n) {
- n[1].i = location;
- n[2].f = x;
- n[3].f = y;
- }
- if (ctx->ExecuteFlag) {
- CALL_Uniform2fARB(ctx->Exec, (location, x, y));
- }
-}
-
-
-static void GLAPIENTRY
-save_Uniform3fARB(GLint location, GLfloat x, GLfloat y, GLfloat z)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = alloc_instruction(ctx, OPCODE_UNIFORM_3F, 4);
- if (n) {
- n[1].i = location;
- n[2].f = x;
- n[3].f = y;
- n[4].f = z;
- }
- if (ctx->ExecuteFlag) {
- CALL_Uniform3fARB(ctx->Exec, (location, x, y, z));
- }
-}
-
-
-static void GLAPIENTRY
-save_Uniform4fARB(GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = alloc_instruction(ctx, OPCODE_UNIFORM_4F, 5);
- if (n) {
- n[1].i = location;
- n[2].f = x;
- n[3].f = y;
- n[4].f = z;
- n[5].f = w;
- }
- if (ctx->ExecuteFlag) {
- CALL_Uniform4fARB(ctx->Exec, (location, x, y, z, w));
- }
-}
-
-
-/** Return copy of memory */
-static void *
-memdup(const void *src, GLsizei bytes)
-{
- void *b = bytes >= 0 ? malloc(bytes) : NULL;
- if (b)
- memcpy(b, src, bytes);
- return b;
-}
-
-
-static void GLAPIENTRY
-save_Uniform1fvARB(GLint location, GLsizei count, const GLfloat *v)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = alloc_instruction(ctx, OPCODE_UNIFORM_1FV, 3);
- if (n) {
- n[1].i = location;
- n[2].i = count;
- n[3].data = memdup(v, count * 1 * sizeof(GLfloat));
- }
- if (ctx->ExecuteFlag) {
- CALL_Uniform1fvARB(ctx->Exec, (location, count, v));
- }
-}
-
-static void GLAPIENTRY
-save_Uniform2fvARB(GLint location, GLsizei count, const GLfloat *v)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = alloc_instruction(ctx, OPCODE_UNIFORM_2FV, 3);
- if (n) {
- n[1].i = location;
- n[2].i = count;
- n[3].data = memdup(v, count * 2 * sizeof(GLfloat));
- }
- if (ctx->ExecuteFlag) {
- CALL_Uniform2fvARB(ctx->Exec, (location, count, v));
- }
-}
-
-static void GLAPIENTRY
-save_Uniform3fvARB(GLint location, GLsizei count, const GLfloat *v)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = alloc_instruction(ctx, OPCODE_UNIFORM_3FV, 3);
- if (n) {
- n[1].i = location;
- n[2].i = count;
- n[3].data = memdup(v, count * 3 * sizeof(GLfloat));
- }
- if (ctx->ExecuteFlag) {
- CALL_Uniform3fvARB(ctx->Exec, (location, count, v));
- }
-}
-
-static void GLAPIENTRY
-save_Uniform4fvARB(GLint location, GLsizei count, const GLfloat *v)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = alloc_instruction(ctx, OPCODE_UNIFORM_4FV, 3);
- if (n) {
- n[1].i = location;
- n[2].i = count;
- n[3].data = memdup(v, count * 4 * sizeof(GLfloat));
- }
- if (ctx->ExecuteFlag) {
- CALL_Uniform4fvARB(ctx->Exec, (location, count, v));
- }
-}
-
-
-static void GLAPIENTRY
-save_Uniform1iARB(GLint location, GLint x)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = alloc_instruction(ctx, OPCODE_UNIFORM_1I, 2);
- if (n) {
- n[1].i = location;
- n[2].i = x;
- }
- if (ctx->ExecuteFlag) {
- CALL_Uniform1iARB(ctx->Exec, (location, x));
- }
-}
-
-static void GLAPIENTRY
-save_Uniform2iARB(GLint location, GLint x, GLint y)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = alloc_instruction(ctx, OPCODE_UNIFORM_2I, 3);
- if (n) {
- n[1].i = location;
- n[2].i = x;
- n[3].i = y;
- }
- if (ctx->ExecuteFlag) {
- CALL_Uniform2iARB(ctx->Exec, (location, x, y));
- }
-}
-
-static void GLAPIENTRY
-save_Uniform3iARB(GLint location, GLint x, GLint y, GLint z)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = alloc_instruction(ctx, OPCODE_UNIFORM_3I, 4);
- if (n) {
- n[1].i = location;
- n[2].i = x;
- n[3].i = y;
- n[4].i = z;
- }
- if (ctx->ExecuteFlag) {
- CALL_Uniform3iARB(ctx->Exec, (location, x, y, z));
- }
-}
-
-static void GLAPIENTRY
-save_Uniform4iARB(GLint location, GLint x, GLint y, GLint z, GLint w)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = alloc_instruction(ctx, OPCODE_UNIFORM_4I, 5);
- if (n) {
- n[1].i = location;
- n[2].i = x;
- n[3].i = y;
- n[4].i = z;
- n[5].i = w;
- }
- if (ctx->ExecuteFlag) {
- CALL_Uniform4iARB(ctx->Exec, (location, x, y, z, w));
- }
-}
-
-
-
-static void GLAPIENTRY
-save_Uniform1ivARB(GLint location, GLsizei count, const GLint *v)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = alloc_instruction(ctx, OPCODE_UNIFORM_1IV, 3);
- if (n) {
- n[1].i = location;
- n[2].i = count;
- n[3].data = memdup(v, count * 1 * sizeof(GLint));
- }
- if (ctx->ExecuteFlag) {
- CALL_Uniform1ivARB(ctx->Exec, (location, count, v));
- }
-}
-
-static void GLAPIENTRY
-save_Uniform2ivARB(GLint location, GLsizei count, const GLint *v)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = alloc_instruction(ctx, OPCODE_UNIFORM_2IV, 3);
- if (n) {
- n[1].i = location;
- n[2].i = count;
- n[3].data = memdup(v, count * 2 * sizeof(GLint));
- }
- if (ctx->ExecuteFlag) {
- CALL_Uniform2ivARB(ctx->Exec, (location, count, v));
- }
-}
-
-static void GLAPIENTRY
-save_Uniform3ivARB(GLint location, GLsizei count, const GLint *v)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = alloc_instruction(ctx, OPCODE_UNIFORM_3IV, 3);
- if (n) {
- n[1].i = location;
- n[2].i = count;
- n[3].data = memdup(v, count * 3 * sizeof(GLint));
- }
- if (ctx->ExecuteFlag) {
- CALL_Uniform3ivARB(ctx->Exec, (location, count, v));
- }
-}
-
-static void GLAPIENTRY
-save_Uniform4ivARB(GLint location, GLsizei count, const GLint *v)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = alloc_instruction(ctx, OPCODE_UNIFORM_4IV, 3);
- if (n) {
- n[1].i = location;
- n[2].i = count;
- n[3].data = memdup(v, count * 4 * sizeof(GLfloat));
- }
- if (ctx->ExecuteFlag) {
- CALL_Uniform4ivARB(ctx->Exec, (location, count, v));
- }
-}
-
-
-
-static void GLAPIENTRY
-save_Uniform1ui(GLint location, GLuint x)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = alloc_instruction(ctx, OPCODE_UNIFORM_1UI, 2);
- if (n) {
- n[1].i = location;
- n[2].i = x;
- }
- if (ctx->ExecuteFlag) {
- /*CALL_Uniform1ui(ctx->Exec, (location, x));*/
- }
-}
-
-static void GLAPIENTRY
-save_Uniform2ui(GLint location, GLuint x, GLuint y)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = alloc_instruction(ctx, OPCODE_UNIFORM_2UI, 3);
- if (n) {
- n[1].i = location;
- n[2].i = x;
- n[3].i = y;
- }
- if (ctx->ExecuteFlag) {
- /*CALL_Uniform2ui(ctx->Exec, (location, x, y));*/
- }
-}
-
-static void GLAPIENTRY
-save_Uniform3ui(GLint location, GLuint x, GLuint y, GLuint z)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = alloc_instruction(ctx, OPCODE_UNIFORM_3UI, 4);
- if (n) {
- n[1].i = location;
- n[2].i = x;
- n[3].i = y;
- n[4].i = z;
- }
- if (ctx->ExecuteFlag) {
- /*CALL_Uniform3ui(ctx->Exec, (location, x, y, z));*/
- }
-}
-
-static void GLAPIENTRY
-save_Uniform4ui(GLint location, GLuint x, GLuint y, GLuint z, GLuint w)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = alloc_instruction(ctx, OPCODE_UNIFORM_4UI, 5);
- if (n) {
- n[1].i = location;
- n[2].i = x;
- n[3].i = y;
- n[4].i = z;
- n[5].i = w;
- }
- if (ctx->ExecuteFlag) {
- /*CALL_Uniform4ui(ctx->Exec, (location, x, y, z, w));*/
- }
-}
-
-
-
-static void GLAPIENTRY
-save_Uniform1uiv(GLint location, GLsizei count, const GLuint *v)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = alloc_instruction(ctx, OPCODE_UNIFORM_1UIV, 3);
- if (n) {
- n[1].i = location;
- n[2].i = count;
- n[3].data = memdup(v, count * 1 * sizeof(*v));
- }
- if (ctx->ExecuteFlag) {
- /*CALL_Uniform1uiv(ctx->Exec, (location, count, v));*/
- }
-}
-
-static void GLAPIENTRY
-save_Uniform2uiv(GLint location, GLsizei count, const GLuint *v)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = alloc_instruction(ctx, OPCODE_UNIFORM_2UIV, 3);
- if (n) {
- n[1].i = location;
- n[2].i = count;
- n[3].data = memdup(v, count * 2 * sizeof(*v));
- }
- if (ctx->ExecuteFlag) {
- /*CALL_Uniform2uiv(ctx->Exec, (location, count, v));*/
- }
-}
-
-static void GLAPIENTRY
-save_Uniform3uiv(GLint location, GLsizei count, const GLuint *v)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = alloc_instruction(ctx, OPCODE_UNIFORM_3UIV, 3);
- if (n) {
- n[1].i = location;
- n[2].i = count;
- n[3].data = memdup(v, count * 3 * sizeof(*v));
- }
- if (ctx->ExecuteFlag) {
- /*CALL_Uniform3uiv(ctx->Exec, (location, count, v));*/
- }
-}
-
-static void GLAPIENTRY
-save_Uniform4uiv(GLint location, GLsizei count, const GLuint *v)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = alloc_instruction(ctx, OPCODE_UNIFORM_4UIV, 3);
- if (n) {
- n[1].i = location;
- n[2].i = count;
- n[3].data = memdup(v, count * 4 * sizeof(*v));
- }
- if (ctx->ExecuteFlag) {
- /*CALL_Uniform4uiv(ctx->Exec, (location, count, v));*/
- }
-}
-
-
-
-static void GLAPIENTRY
-save_UniformMatrix2fvARB(GLint location, GLsizei count, GLboolean transpose,
- const GLfloat *m)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = alloc_instruction(ctx, OPCODE_UNIFORM_MATRIX22, 4);
- if (n) {
- n[1].i = location;
- n[2].i = count;
- n[3].b = transpose;
- n[4].data = memdup(m, count * 2 * 2 * sizeof(GLfloat));
- }
- if (ctx->ExecuteFlag) {
- CALL_UniformMatrix2fvARB(ctx->Exec, (location, count, transpose, m));
- }
-}
-
-static void GLAPIENTRY
-save_UniformMatrix3fvARB(GLint location, GLsizei count, GLboolean transpose,
- const GLfloat *m)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = alloc_instruction(ctx, OPCODE_UNIFORM_MATRIX33, 4);
- if (n) {
- n[1].i = location;
- n[2].i = count;
- n[3].b = transpose;
- n[4].data = memdup(m, count * 3 * 3 * sizeof(GLfloat));
- }
- if (ctx->ExecuteFlag) {
- CALL_UniformMatrix3fvARB(ctx->Exec, (location, count, transpose, m));
- }
-}
-
-static void GLAPIENTRY
-save_UniformMatrix4fvARB(GLint location, GLsizei count, GLboolean transpose,
- const GLfloat *m)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = alloc_instruction(ctx, OPCODE_UNIFORM_MATRIX44, 4);
- if (n) {
- n[1].i = location;
- n[2].i = count;
- n[3].b = transpose;
- n[4].data = memdup(m, count * 4 * 4 * sizeof(GLfloat));
- }
- if (ctx->ExecuteFlag) {
- CALL_UniformMatrix4fvARB(ctx->Exec, (location, count, transpose, m));
- }
-}
-
-
-static void GLAPIENTRY
-save_UniformMatrix2x3fv(GLint location, GLsizei count, GLboolean transpose,
- const GLfloat *m)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = alloc_instruction(ctx, OPCODE_UNIFORM_MATRIX23, 4);
- if (n) {
- n[1].i = location;
- n[2].i = count;
- n[3].b = transpose;
- n[4].data = memdup(m, count * 2 * 3 * sizeof(GLfloat));
- }
- if (ctx->ExecuteFlag) {
- CALL_UniformMatrix2x3fv(ctx->Exec, (location, count, transpose, m));
- }
-}
-
-static void GLAPIENTRY
-save_UniformMatrix3x2fv(GLint location, GLsizei count, GLboolean transpose,
- const GLfloat *m)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = alloc_instruction(ctx, OPCODE_UNIFORM_MATRIX32, 4);
- if (n) {
- n[1].i = location;
- n[2].i = count;
- n[3].b = transpose;
- n[4].data = memdup(m, count * 3 * 2 * sizeof(GLfloat));
- }
- if (ctx->ExecuteFlag) {
- CALL_UniformMatrix3x2fv(ctx->Exec, (location, count, transpose, m));
- }
-}
-
-
-static void GLAPIENTRY
-save_UniformMatrix2x4fv(GLint location, GLsizei count, GLboolean transpose,
- const GLfloat *m)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = alloc_instruction(ctx, OPCODE_UNIFORM_MATRIX24, 4);
- if (n) {
- n[1].i = location;
- n[2].i = count;
- n[3].b = transpose;
- n[4].data = memdup(m, count * 2 * 4 * sizeof(GLfloat));
- }
- if (ctx->ExecuteFlag) {
- CALL_UniformMatrix2x4fv(ctx->Exec, (location, count, transpose, m));
- }
-}
-
-static void GLAPIENTRY
-save_UniformMatrix4x2fv(GLint location, GLsizei count, GLboolean transpose,
- const GLfloat *m)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = alloc_instruction(ctx, OPCODE_UNIFORM_MATRIX42, 4);
- if (n) {
- n[1].i = location;
- n[2].i = count;
- n[3].b = transpose;
- n[4].data = memdup(m, count * 4 * 2 * sizeof(GLfloat));
- }
- if (ctx->ExecuteFlag) {
- CALL_UniformMatrix4x2fv(ctx->Exec, (location, count, transpose, m));
- }
-}
-
-
-static void GLAPIENTRY
-save_UniformMatrix3x4fv(GLint location, GLsizei count, GLboolean transpose,
- const GLfloat *m)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = alloc_instruction(ctx, OPCODE_UNIFORM_MATRIX34, 4);
- if (n) {
- n[1].i = location;
- n[2].i = count;
- n[3].b = transpose;
- n[4].data = memdup(m, count * 3 * 4 * sizeof(GLfloat));
- }
- if (ctx->ExecuteFlag) {
- CALL_UniformMatrix3x4fv(ctx->Exec, (location, count, transpose, m));
- }
-}
-
-static void GLAPIENTRY
-save_UniformMatrix4x3fv(GLint location, GLsizei count, GLboolean transpose,
- const GLfloat *m)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = alloc_instruction(ctx, OPCODE_UNIFORM_MATRIX43, 4);
- if (n) {
- n[1].i = location;
- n[2].i = count;
- n[3].b = transpose;
- n[4].data = memdup(m, count * 4 * 3 * sizeof(GLfloat));
- }
- if (ctx->ExecuteFlag) {
- CALL_UniformMatrix4x3fv(ctx->Exec, (location, count, transpose, m));
- }
-}
-
-static void GLAPIENTRY
-save_ClampColorARB(GLenum target, GLenum clamp)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = alloc_instruction(ctx, OPCODE_CLAMP_COLOR, 2);
- if (n) {
- n[1].e = target;
- n[2].e = clamp;
- }
- if (ctx->ExecuteFlag) {
- CALL_ClampColorARB(ctx->Exec, (target, clamp));
- }
-}
-
-static void GLAPIENTRY
-save_UseShaderProgramEXT(GLenum type, GLuint program)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = alloc_instruction(ctx, OPCODE_USE_SHADER_PROGRAM_EXT, 2);
- if (n) {
- n[1].ui = type;
- n[2].ui = program;
- }
- if (ctx->ExecuteFlag) {
- CALL_UseShaderProgramEXT(ctx->Exec, (type, program));
- }
-}
-
-static void GLAPIENTRY
-save_ActiveProgramEXT(GLuint program)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = alloc_instruction(ctx, OPCODE_ACTIVE_PROGRAM_EXT, 1);
- if (n) {
- n[1].ui = program;
- }
- if (ctx->ExecuteFlag) {
- CALL_ActiveProgramEXT(ctx->Exec, (program));
- }
-}
-
-/** GL_EXT_texture_integer */
-static void GLAPIENTRY
-save_ClearColorIi(GLint red, GLint green, GLint blue, GLint alpha)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = alloc_instruction(ctx, OPCODE_CLEARCOLOR_I, 4);
- if (n) {
- n[1].i = red;
- n[2].i = green;
- n[3].i = blue;
- n[4].i = alpha;
- }
- if (ctx->ExecuteFlag) {
- CALL_ClearColorIiEXT(ctx->Exec, (red, green, blue, alpha));
- }
-}
-
-/** GL_EXT_texture_integer */
-static void GLAPIENTRY
-save_ClearColorIui(GLuint red, GLuint green, GLuint blue, GLuint alpha)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = alloc_instruction(ctx, OPCODE_CLEARCOLOR_UI, 4);
- if (n) {
- n[1].ui = red;
- n[2].ui = green;
- n[3].ui = blue;
- n[4].ui = alpha;
- }
- if (ctx->ExecuteFlag) {
- CALL_ClearColorIuiEXT(ctx->Exec, (red, green, blue, alpha));
- }
-}
-
-/** GL_EXT_texture_integer */
-static void GLAPIENTRY
-save_TexParameterIiv(GLenum target, GLenum pname, const GLint *params)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = alloc_instruction(ctx, OPCODE_TEXPARAMETER_I, 6);
- if (n) {
- n[1].e = target;
- n[2].e = pname;
- n[3].i = params[0];
- n[4].i = params[1];
- n[5].i = params[2];
- n[6].i = params[3];
- }
- if (ctx->ExecuteFlag) {
- CALL_TexParameterIivEXT(ctx->Exec, (target, pname, params));
- }
-}
-
-/** GL_EXT_texture_integer */
-static void GLAPIENTRY
-save_TexParameterIuiv(GLenum target, GLenum pname, const GLuint *params)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = alloc_instruction(ctx, OPCODE_TEXPARAMETER_UI, 6);
- if (n) {
- n[1].e = target;
- n[2].e = pname;
- n[3].ui = params[0];
- n[4].ui = params[1];
- n[5].ui = params[2];
- n[6].ui = params[3];
- }
- if (ctx->ExecuteFlag) {
- CALL_TexParameterIuivEXT(ctx->Exec, (target, pname, params));
- }
-}
-
-/** GL_EXT_texture_integer */
-static void GLAPIENTRY
-exec_GetTexParameterIiv(GLenum target, GLenum pname, GLint *params)
-{
- GET_CURRENT_CONTEXT(ctx);
- FLUSH_VERTICES(ctx, 0);
- CALL_GetTexParameterIivEXT(ctx->Exec, (target, pname, params));
-}
-
-/** GL_EXT_texture_integer */
-static void GLAPIENTRY
-exec_GetTexParameterIuiv(GLenum target, GLenum pname, GLuint *params)
-{
- GET_CURRENT_CONTEXT(ctx);
- FLUSH_VERTICES(ctx, 0);
- CALL_GetTexParameterIuivEXT(ctx->Exec, (target, pname, params));
-}
-
-
-/* GL_ARB_instanced_arrays */
-static void GLAPIENTRY
-save_VertexAttribDivisor(GLuint index, GLuint divisor)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = alloc_instruction(ctx, OPCODE_VERTEX_ATTRIB_DIVISOR, 2);
- if (n) {
- n[1].ui = index;
- n[2].ui = divisor;
- }
- if (ctx->ExecuteFlag) {
- CALL_VertexAttribDivisorARB(ctx->Exec, (index, divisor));
- }
-}
-
-
-/* GL_NV_texture_barrier */
-static void GLAPIENTRY
-save_TextureBarrierNV(void)
-{
- GET_CURRENT_CONTEXT(ctx);
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- alloc_instruction(ctx, OPCODE_TEXTURE_BARRIER_NV, 0);
- if (ctx->ExecuteFlag) {
- CALL_TextureBarrierNV(ctx->Exec, ());
- }
-}
-
-
-/* GL_ARB_sampler_objects */
-static void GLAPIENTRY
-save_BindSampler(GLuint unit, GLuint sampler)
-{
- Node *n;
- GET_CURRENT_CONTEXT(ctx);
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = alloc_instruction(ctx, OPCODE_BIND_SAMPLER, 2);
- if (n) {
- n[1].ui = unit;
- n[2].ui = sampler;
- }
- if (ctx->ExecuteFlag) {
- CALL_BindSampler(ctx->Exec, (unit, sampler));
- }
-}
-
-
-/**
- * Save an error-generating command into display list.
- *
- * KW: Will appear in the list before the vertex buffer containing the
- * command that provoked the error. I don't see this as a problem.
- */
-static void
-save_error(struct gl_context *ctx, GLenum error, const char *s)
-{
- Node *n;
- n = alloc_instruction(ctx, OPCODE_ERROR, 2);
- if (n) {
- n[1].e = error;
- n[2].data = (void *) s;
- }
-}
-
-
-/**
- * Compile an error into current display list.
- */
-void
-_mesa_compile_error(struct gl_context *ctx, GLenum error, const char *s)
-{
- if (ctx->CompileFlag)
- save_error(ctx, error, s);
- if (ctx->ExecuteFlag)
- _mesa_error(ctx, error, "%s", s);
-}
-
-
-/**
- * Test if ID names a display list.
- */
-static GLboolean
-islist(struct gl_context *ctx, GLuint list)
-{
- if (list > 0 && lookup_list(ctx, list)) {
- return GL_TRUE;
- }
- else {
- return GL_FALSE;
- }
-}
-
-
-
-/**********************************************************************/
-/* Display list execution */
-/**********************************************************************/
-
-
-/*
- * Execute a display list. Note that the ListBase offset must have already
- * been added before calling this function. I.e. the list argument is
- * the absolute list number, not relative to ListBase.
- * \param list - display list number
- */
-static void
-execute_list(struct gl_context *ctx, GLuint list)
-{
- struct gl_display_list *dlist;
- Node *n;
- GLboolean done;
-
- if (list == 0 || !islist(ctx, list))
- return;
-
- if (ctx->ListState.CallDepth == MAX_LIST_NESTING) {
- /* raise an error? */
- return;
- }
-
- dlist = lookup_list(ctx, list);
- if (!dlist)
- return;
-
- ctx->ListState.CallDepth++;
-
- if (ctx->Driver.BeginCallList)
- ctx->Driver.BeginCallList(ctx, dlist);
-
- n = dlist->Head;
-
- done = GL_FALSE;
- while (!done) {
- const OpCode opcode = n[0].opcode;
-
- if (is_ext_opcode(opcode)) {
- n += ext_opcode_execute(ctx, n);
- }
- else {
- switch (opcode) {
- case OPCODE_ERROR:
- _mesa_error(ctx, n[1].e, "%s", (const char *) n[2].data);
- break;
- case OPCODE_ACCUM:
- CALL_Accum(ctx->Exec, (n[1].e, n[2].f));
- break;
- case OPCODE_ALPHA_FUNC:
- CALL_AlphaFunc(ctx->Exec, (n[1].e, n[2].f));
- break;
- case OPCODE_BIND_TEXTURE:
- CALL_BindTexture(ctx->Exec, (n[1].e, n[2].ui));
- break;
- case OPCODE_BITMAP:
- {
- const struct gl_pixelstore_attrib save = ctx->Unpack;
- ctx->Unpack = ctx->DefaultPacking;
- CALL_Bitmap(ctx->Exec, ((GLsizei) n[1].i, (GLsizei) n[2].i,
- n[3].f, n[4].f, n[5].f, n[6].f,
- (const GLubyte *) n[7].data));
- ctx->Unpack = save; /* restore */
- }
- break;
- case OPCODE_BLEND_COLOR:
- CALL_BlendColor(ctx->Exec, (n[1].f, n[2].f, n[3].f, n[4].f));
- break;
- case OPCODE_BLEND_EQUATION:
- CALL_BlendEquation(ctx->Exec, (n[1].e));
- break;
- case OPCODE_BLEND_EQUATION_SEPARATE:
- CALL_BlendEquationSeparateEXT(ctx->Exec, (n[1].e, n[2].e));
- break;
- case OPCODE_BLEND_FUNC_SEPARATE:
- CALL_BlendFuncSeparateEXT(ctx->Exec,
- (n[1].e, n[2].e, n[3].e, n[4].e));
- break;
-
- case OPCODE_BLEND_FUNC_I:
- /* GL_ARB_draw_buffers_blend */
- CALL_BlendFunciARB(ctx->Exec, (n[1].ui, n[2].e, n[3].e));
- break;
- case OPCODE_BLEND_FUNC_SEPARATE_I:
- /* GL_ARB_draw_buffers_blend */
- CALL_BlendFuncSeparateiARB(ctx->Exec, (n[1].ui, n[2].e, n[3].e,
- n[4].e, n[5].e));
- break;
- case OPCODE_BLEND_EQUATION_I:
- /* GL_ARB_draw_buffers_blend */
- CALL_BlendEquationiARB(ctx->Exec, (n[1].ui, n[2].e));
- break;
- case OPCODE_BLEND_EQUATION_SEPARATE_I:
- /* GL_ARB_draw_buffers_blend */
- CALL_BlendEquationSeparateiARB(ctx->Exec,
- (n[1].ui, n[2].e, n[3].e));
- break;
-
- case OPCODE_CALL_LIST:
- /* Generated by glCallList(), don't add ListBase */
- if (ctx->ListState.CallDepth < MAX_LIST_NESTING) {
- execute_list(ctx, n[1].ui);
- }
- break;
- case OPCODE_CALL_LIST_OFFSET:
- /* Generated by glCallLists() so we must add ListBase */
- if (n[2].b) {
- /* user specified a bad data type at compile time */
- _mesa_error(ctx, GL_INVALID_ENUM, "glCallLists(type)");
- }
- else if (ctx->ListState.CallDepth < MAX_LIST_NESTING) {
- GLuint list = (GLuint) (ctx->List.ListBase + n[1].i);
- execute_list(ctx, list);
- }
- break;
- case OPCODE_CLEAR:
- CALL_Clear(ctx->Exec, (n[1].bf));
- break;
- case OPCODE_CLEAR_BUFFER_IV:
- {
- GLint value[4];
- value[0] = n[3].i;
- value[1] = n[4].i;
- value[2] = n[5].i;
- value[3] = n[6].i;
- /*CALL_ClearBufferiv(ctx->Exec, (n[1].e, n[2].i, value));*/
- }
- break;
- case OPCODE_CLEAR_BUFFER_UIV:
- {
- GLuint value[4];
- value[0] = n[3].ui;
- value[1] = n[4].ui;
- value[2] = n[5].ui;
- value[3] = n[6].ui;
- /*CALL_ClearBufferiv(ctx->Exec, (n[1].e, n[2].i, value));*/
- }
- break;
- case OPCODE_CLEAR_BUFFER_FV:
- {
- GLfloat value[4];
- value[0] = n[3].f;
- value[1] = n[4].f;
- value[2] = n[5].f;
- value[3] = n[6].f;
- /*CALL_ClearBufferfv(ctx->Exec, (n[1].e, n[2].i, value));*/
- }
- break;
- case OPCODE_CLEAR_BUFFER_FI:
- /*CALL_ClearBufferfi(ctx->Exec, (n[1].e, n[2].i, n[3].f, n[4].i));*/
- break;
- case OPCODE_CLEAR_COLOR:
- CALL_ClearColor(ctx->Exec, (n[1].f, n[2].f, n[3].f, n[4].f));
- break;
- case OPCODE_CLEAR_ACCUM:
- CALL_ClearAccum(ctx->Exec, (n[1].f, n[2].f, n[3].f, n[4].f));
- break;
- case OPCODE_CLEAR_DEPTH:
- CALL_ClearDepth(ctx->Exec, ((GLclampd) n[1].f));
- break;
- case OPCODE_CLEAR_INDEX:
- CALL_ClearIndex(ctx->Exec, ((GLfloat) n[1].ui));
- break;
- case OPCODE_CLEAR_STENCIL:
- CALL_ClearStencil(ctx->Exec, (n[1].i));
- break;
- case OPCODE_CLIP_PLANE:
- {
- GLdouble eq[4];
- eq[0] = n[2].f;
- eq[1] = n[3].f;
- eq[2] = n[4].f;
- eq[3] = n[5].f;
- CALL_ClipPlane(ctx->Exec, (n[1].e, eq));
- }
- break;
- case OPCODE_COLOR_MASK:
- CALL_ColorMask(ctx->Exec, (n[1].b, n[2].b, n[3].b, n[4].b));
- break;
- case OPCODE_COLOR_MASK_INDEXED:
- CALL_ColorMaskIndexedEXT(ctx->Exec, (n[1].ui, n[2].b, n[3].b,
- n[4].b, n[5].b));
- break;
- case OPCODE_COLOR_MATERIAL:
- CALL_ColorMaterial(ctx->Exec, (n[1].e, n[2].e));
- break;
- case OPCODE_COLOR_TABLE:
- {
- const struct gl_pixelstore_attrib save = ctx->Unpack;
- ctx->Unpack = ctx->DefaultPacking;
- CALL_ColorTable(ctx->Exec, (n[1].e, n[2].e, n[3].i, n[4].e,
- n[5].e, n[6].data));
- ctx->Unpack = save; /* restore */
- }
- break;
- case OPCODE_COLOR_TABLE_PARAMETER_FV:
- {
- GLfloat params[4];
- params[0] = n[3].f;
- params[1] = n[4].f;
- params[2] = n[5].f;
- params[3] = n[6].f;
- CALL_ColorTableParameterfv(ctx->Exec,
- (n[1].e, n[2].e, params));
- }
- break;
- case OPCODE_COLOR_TABLE_PARAMETER_IV:
- {
- GLint params[4];
- params[0] = n[3].i;
- params[1] = n[4].i;
- params[2] = n[5].i;
- params[3] = n[6].i;
- CALL_ColorTableParameteriv(ctx->Exec,
- (n[1].e, n[2].e, params));
- }
- break;
- case OPCODE_COLOR_SUB_TABLE:
- {
- const struct gl_pixelstore_attrib save = ctx->Unpack;
- ctx->Unpack = ctx->DefaultPacking;
- CALL_ColorSubTable(ctx->Exec, (n[1].e, n[2].i, n[3].i,
- n[4].e, n[5].e, n[6].data));
- ctx->Unpack = save; /* restore */
- }
- break;
- case OPCODE_CONVOLUTION_FILTER_1D:
- {
- const struct gl_pixelstore_attrib save = ctx->Unpack;
- ctx->Unpack = ctx->DefaultPacking;
- CALL_ConvolutionFilter1D(ctx->Exec, (n[1].e, n[2].i, n[3].i,
- n[4].e, n[5].e,
- n[6].data));
- ctx->Unpack = save; /* restore */
- }
- break;
- case OPCODE_CONVOLUTION_FILTER_2D:
- {
- const struct gl_pixelstore_attrib save = ctx->Unpack;
- ctx->Unpack = ctx->DefaultPacking;
- CALL_ConvolutionFilter2D(ctx->Exec, (n[1].e, n[2].i, n[3].i,
- n[4].i, n[5].e, n[6].e,
- n[7].data));
- ctx->Unpack = save; /* restore */
- }
- break;
- case OPCODE_CONVOLUTION_PARAMETER_I:
- CALL_ConvolutionParameteri(ctx->Exec, (n[1].e, n[2].e, n[3].i));
- break;
- case OPCODE_CONVOLUTION_PARAMETER_IV:
- {
- GLint params[4];
- params[0] = n[3].i;
- params[1] = n[4].i;
- params[2] = n[5].i;
- params[3] = n[6].i;
- CALL_ConvolutionParameteriv(ctx->Exec,
- (n[1].e, n[2].e, params));
- }
- break;
- case OPCODE_CONVOLUTION_PARAMETER_F:
- CALL_ConvolutionParameterf(ctx->Exec, (n[1].e, n[2].e, n[3].f));
- break;
- case OPCODE_CONVOLUTION_PARAMETER_FV:
- {
- GLfloat params[4];
- params[0] = n[3].f;
- params[1] = n[4].f;
- params[2] = n[5].f;
- params[3] = n[6].f;
- CALL_ConvolutionParameterfv(ctx->Exec,
- (n[1].e, n[2].e, params));
- }
- break;
- case OPCODE_COPY_COLOR_SUB_TABLE:
- CALL_CopyColorSubTable(ctx->Exec, (n[1].e, n[2].i,
- n[3].i, n[4].i, n[5].i));
- break;
- case OPCODE_COPY_COLOR_TABLE:
- CALL_CopyColorSubTable(ctx->Exec, (n[1].e, n[2].i,
- n[3].i, n[4].i, n[5].i));
- break;
- case OPCODE_COPY_PIXELS:
- CALL_CopyPixels(ctx->Exec, (n[1].i, n[2].i,
- (GLsizei) n[3].i, (GLsizei) n[4].i,
- n[5].e));
- break;
- case OPCODE_COPY_TEX_IMAGE1D:
- CALL_CopyTexImage1D(ctx->Exec, (n[1].e, n[2].i, n[3].e, n[4].i,
- n[5].i, n[6].i, n[7].i));
- break;
- case OPCODE_COPY_TEX_IMAGE2D:
- CALL_CopyTexImage2D(ctx->Exec, (n[1].e, n[2].i, n[3].e, n[4].i,
- n[5].i, n[6].i, n[7].i, n[8].i));
- break;
- case OPCODE_COPY_TEX_SUB_IMAGE1D:
- CALL_CopyTexSubImage1D(ctx->Exec, (n[1].e, n[2].i, n[3].i,
- n[4].i, n[5].i, n[6].i));
- break;
- case OPCODE_COPY_TEX_SUB_IMAGE2D:
- CALL_CopyTexSubImage2D(ctx->Exec, (n[1].e, n[2].i, n[3].i,
- n[4].i, n[5].i, n[6].i, n[7].i,
- n[8].i));
- break;
- case OPCODE_COPY_TEX_SUB_IMAGE3D:
- CALL_CopyTexSubImage3D(ctx->Exec, (n[1].e, n[2].i, n[3].i,
- n[4].i, n[5].i, n[6].i, n[7].i,
- n[8].i, n[9].i));
- break;
- case OPCODE_CULL_FACE:
- CALL_CullFace(ctx->Exec, (n[1].e));
- break;
- case OPCODE_DEPTH_FUNC:
- CALL_DepthFunc(ctx->Exec, (n[1].e));
- break;
- case OPCODE_DEPTH_MASK:
- CALL_DepthMask(ctx->Exec, (n[1].b));
- break;
- case OPCODE_DEPTH_RANGE:
- CALL_DepthRange(ctx->Exec,
- ((GLclampd) n[1].f, (GLclampd) n[2].f));
- break;
- case OPCODE_DISABLE:
- CALL_Disable(ctx->Exec, (n[1].e));
- break;
- case OPCODE_DISABLE_INDEXED:
- CALL_DisableIndexedEXT(ctx->Exec, (n[1].ui, n[2].e));
- break;
- case OPCODE_DRAW_BUFFER:
- CALL_DrawBuffer(ctx->Exec, (n[1].e));
- break;
- case OPCODE_DRAW_PIXELS:
- {
- const struct gl_pixelstore_attrib save = ctx->Unpack;
- ctx->Unpack = ctx->DefaultPacking;
- CALL_DrawPixels(ctx->Exec, (n[1].i, n[2].i, n[3].e, n[4].e,
- n[5].data));
- ctx->Unpack = save; /* restore */
- }
- break;
- case OPCODE_ENABLE:
- CALL_Enable(ctx->Exec, (n[1].e));
- break;
- case OPCODE_ENABLE_INDEXED:
- CALL_EnableIndexedEXT(ctx->Exec, (n[1].ui, n[2].e));
- break;
- case OPCODE_EVALMESH1:
- CALL_EvalMesh1(ctx->Exec, (n[1].e, n[2].i, n[3].i));
- break;
- case OPCODE_EVALMESH2:
- CALL_EvalMesh2(ctx->Exec,
- (n[1].e, n[2].i, n[3].i, n[4].i, n[5].i));
- break;
- case OPCODE_FOG:
- {
- GLfloat p[4];
- p[0] = n[2].f;
- p[1] = n[3].f;
- p[2] = n[4].f;
- p[3] = n[5].f;
- CALL_Fogfv(ctx->Exec, (n[1].e, p));
- }
- break;
- case OPCODE_FRONT_FACE:
- CALL_FrontFace(ctx->Exec, (n[1].e));
- break;
- case OPCODE_FRUSTUM:
- CALL_Frustum(ctx->Exec,
- (n[1].f, n[2].f, n[3].f, n[4].f, n[5].f, n[6].f));
- break;
- case OPCODE_HINT:
- CALL_Hint(ctx->Exec, (n[1].e, n[2].e));
- break;
- case OPCODE_HISTOGRAM:
- CALL_Histogram(ctx->Exec, (n[1].e, n[2].i, n[3].e, n[4].b));
- break;
- case OPCODE_INDEX_MASK:
- CALL_IndexMask(ctx->Exec, (n[1].ui));
- break;
- case OPCODE_INIT_NAMES:
- CALL_InitNames(ctx->Exec, ());
- break;
- case OPCODE_LIGHT:
- {
- GLfloat p[4];
- p[0] = n[3].f;
- p[1] = n[4].f;
- p[2] = n[5].f;
- p[3] = n[6].f;
- CALL_Lightfv(ctx->Exec, (n[1].e, n[2].e, p));
- }
- break;
- case OPCODE_LIGHT_MODEL:
- {
- GLfloat p[4];
- p[0] = n[2].f;
- p[1] = n[3].f;
- p[2] = n[4].f;
- p[3] = n[5].f;
- CALL_LightModelfv(ctx->Exec, (n[1].e, p));
- }
- break;
- case OPCODE_LINE_STIPPLE:
- CALL_LineStipple(ctx->Exec, (n[1].i, n[2].us));
- break;
- case OPCODE_LINE_WIDTH:
- CALL_LineWidth(ctx->Exec, (n[1].f));
- break;
- case OPCODE_LIST_BASE:
- CALL_ListBase(ctx->Exec, (n[1].ui));
- break;
- case OPCODE_LOAD_IDENTITY:
- CALL_LoadIdentity(ctx->Exec, ());
- break;
- case OPCODE_LOAD_MATRIX:
- if (sizeof(Node) == sizeof(GLfloat)) {
- CALL_LoadMatrixf(ctx->Exec, (&n[1].f));
- }
- else {
- GLfloat m[16];
- GLuint i;
- for (i = 0; i < 16; i++) {
- m[i] = n[1 + i].f;
- }
- CALL_LoadMatrixf(ctx->Exec, (m));
- }
- break;
- case OPCODE_LOAD_NAME:
- CALL_LoadName(ctx->Exec, (n[1].ui));
- break;
- case OPCODE_LOGIC_OP:
- CALL_LogicOp(ctx->Exec, (n[1].e));
- break;
- case OPCODE_MAP1:
- {
- GLenum target = n[1].e;
- GLint ustride = _mesa_evaluator_components(target);
- GLint uorder = n[5].i;
- GLfloat u1 = n[2].f;
- GLfloat u2 = n[3].f;
- CALL_Map1f(ctx->Exec, (target, u1, u2, ustride, uorder,
- (GLfloat *) n[6].data));
- }
- break;
- case OPCODE_MAP2:
- {
- GLenum target = n[1].e;
- GLfloat u1 = n[2].f;
- GLfloat u2 = n[3].f;
- GLfloat v1 = n[4].f;
- GLfloat v2 = n[5].f;
- GLint ustride = n[6].i;
- GLint vstride = n[7].i;
- GLint uorder = n[8].i;
- GLint vorder = n[9].i;
- CALL_Map2f(ctx->Exec, (target, u1, u2, ustride, uorder,
- v1, v2, vstride, vorder,
- (GLfloat *) n[10].data));
- }
- break;
- case OPCODE_MAPGRID1:
- CALL_MapGrid1f(ctx->Exec, (n[1].i, n[2].f, n[3].f));
- break;
- case OPCODE_MAPGRID2:
- CALL_MapGrid2f(ctx->Exec,
- (n[1].i, n[2].f, n[3].f, n[4].i, n[5].f, n[6].f));
- break;
- case OPCODE_MATRIX_MODE:
- CALL_MatrixMode(ctx->Exec, (n[1].e));
- break;
- case OPCODE_MIN_MAX:
- CALL_Minmax(ctx->Exec, (n[1].e, n[2].e, n[3].b));
- break;
- case OPCODE_MULT_MATRIX:
- if (sizeof(Node) == sizeof(GLfloat)) {
- CALL_MultMatrixf(ctx->Exec, (&n[1].f));
- }
- else {
- GLfloat m[16];
- GLuint i;
- for (i = 0; i < 16; i++) {
- m[i] = n[1 + i].f;
- }
- CALL_MultMatrixf(ctx->Exec, (m));
- }
- break;
- case OPCODE_ORTHO:
- CALL_Ortho(ctx->Exec,
- (n[1].f, n[2].f, n[3].f, n[4].f, n[5].f, n[6].f));
- break;
- case OPCODE_PASSTHROUGH:
- CALL_PassThrough(ctx->Exec, (n[1].f));
- break;
- case OPCODE_PIXEL_MAP:
- CALL_PixelMapfv(ctx->Exec,
- (n[1].e, n[2].i, (GLfloat *) n[3].data));
- break;
- case OPCODE_PIXEL_TRANSFER:
- CALL_PixelTransferf(ctx->Exec, (n[1].e, n[2].f));
- break;
- case OPCODE_PIXEL_ZOOM:
- CALL_PixelZoom(ctx->Exec, (n[1].f, n[2].f));
- break;
- case OPCODE_POINT_SIZE:
- CALL_PointSize(ctx->Exec, (n[1].f));
- break;
- case OPCODE_POINT_PARAMETERS:
- {
- GLfloat params[3];
- params[0] = n[2].f;
- params[1] = n[3].f;
- params[2] = n[4].f;
- CALL_PointParameterfvEXT(ctx->Exec, (n[1].e, params));
- }
- break;
- case OPCODE_POLYGON_MODE:
- CALL_PolygonMode(ctx->Exec, (n[1].e, n[2].e));
- break;
- case OPCODE_POLYGON_STIPPLE:
- {
- const struct gl_pixelstore_attrib save = ctx->Unpack;
- ctx->Unpack = ctx->DefaultPacking;
- CALL_PolygonStipple(ctx->Exec, ((GLubyte *) n[1].data));
- ctx->Unpack = save; /* restore */
- }
- break;
- case OPCODE_POLYGON_OFFSET:
- CALL_PolygonOffset(ctx->Exec, (n[1].f, n[2].f));
- break;
- case OPCODE_POP_ATTRIB:
- CALL_PopAttrib(ctx->Exec, ());
- break;
- case OPCODE_POP_MATRIX:
- CALL_PopMatrix(ctx->Exec, ());
- break;
- case OPCODE_POP_NAME:
- CALL_PopName(ctx->Exec, ());
- break;
- case OPCODE_PRIORITIZE_TEXTURE:
- CALL_PrioritizeTextures(ctx->Exec, (1, &n[1].ui, &n[2].f));
- break;
- case OPCODE_PUSH_ATTRIB:
- CALL_PushAttrib(ctx->Exec, (n[1].bf));
- break;
- case OPCODE_PUSH_MATRIX:
- CALL_PushMatrix(ctx->Exec, ());
- break;
- case OPCODE_PUSH_NAME:
- CALL_PushName(ctx->Exec, (n[1].ui));
- break;
- case OPCODE_RASTER_POS:
- CALL_RasterPos4f(ctx->Exec, (n[1].f, n[2].f, n[3].f, n[4].f));
- break;
- case OPCODE_READ_BUFFER:
- CALL_ReadBuffer(ctx->Exec, (n[1].e));
- break;
- case OPCODE_RESET_HISTOGRAM:
- CALL_ResetHistogram(ctx->Exec, (n[1].e));
- break;
- case OPCODE_RESET_MIN_MAX:
- CALL_ResetMinmax(ctx->Exec, (n[1].e));
- break;
- case OPCODE_ROTATE:
- CALL_Rotatef(ctx->Exec, (n[1].f, n[2].f, n[3].f, n[4].f));
- break;
- case OPCODE_SCALE:
- CALL_Scalef(ctx->Exec, (n[1].f, n[2].f, n[3].f));
- break;
- case OPCODE_SCISSOR:
- CALL_Scissor(ctx->Exec, (n[1].i, n[2].i, n[3].i, n[4].i));
- break;
- case OPCODE_SHADE_MODEL:
- CALL_ShadeModel(ctx->Exec, (n[1].e));
- break;
- case OPCODE_PROVOKING_VERTEX:
- CALL_ProvokingVertexEXT(ctx->Exec, (n[1].e));
- break;
- case OPCODE_BEGIN_TRANSFORM_FEEDBACK:
- CALL_BeginTransformFeedbackEXT(ctx->Exec, (n[1].e));
- break;
- case OPCODE_END_TRANSFORM_FEEDBACK:
- CALL_EndTransformFeedbackEXT(ctx->Exec, ());
- break;
- case OPCODE_STENCIL_FUNC:
- CALL_StencilFunc(ctx->Exec, (n[1].e, n[2].i, n[3].ui));
- break;
- case OPCODE_STENCIL_MASK:
- CALL_StencilMask(ctx->Exec, (n[1].ui));
- break;
- case OPCODE_STENCIL_OP:
- CALL_StencilOp(ctx->Exec, (n[1].e, n[2].e, n[3].e));
- break;
- case OPCODE_STENCIL_FUNC_SEPARATE:
- CALL_StencilFuncSeparate(ctx->Exec,
- (n[1].e, n[2].e, n[3].i, n[4].ui));
- break;
- case OPCODE_STENCIL_MASK_SEPARATE:
- CALL_StencilMaskSeparate(ctx->Exec, (n[1].e, n[2].ui));
- break;
- case OPCODE_STENCIL_OP_SEPARATE:
- CALL_StencilOpSeparate(ctx->Exec,
- (n[1].e, n[2].e, n[3].e, n[4].e));
- break;
- case OPCODE_TEXENV:
- {
- GLfloat params[4];
- params[0] = n[3].f;
- params[1] = n[4].f;
- params[2] = n[5].f;
- params[3] = n[6].f;
- CALL_TexEnvfv(ctx->Exec, (n[1].e, n[2].e, params));
- }
- break;
- case OPCODE_TEXGEN:
- {
- GLfloat params[4];
- params[0] = n[3].f;
- params[1] = n[4].f;
- params[2] = n[5].f;
- params[3] = n[6].f;
- CALL_TexGenfv(ctx->Exec, (n[1].e, n[2].e, params));
- }
- break;
- case OPCODE_TEXPARAMETER:
- {
- GLfloat params[4];
- params[0] = n[3].f;
- params[1] = n[4].f;
- params[2] = n[5].f;
- params[3] = n[6].f;
- CALL_TexParameterfv(ctx->Exec, (n[1].e, n[2].e, params));
- }
- break;
- case OPCODE_TEX_IMAGE1D:
- {
- const struct gl_pixelstore_attrib save = ctx->Unpack;
- ctx->Unpack = ctx->DefaultPacking;
- CALL_TexImage1D(ctx->Exec, (n[1].e, /* target */
- n[2].i, /* level */
- n[3].i, /* components */
- n[4].i, /* width */
- n[5].e, /* border */
- n[6].e, /* format */
- n[7].e, /* type */
- n[8].data));
- ctx->Unpack = save; /* restore */
- }
- break;
- case OPCODE_TEX_IMAGE2D:
- {
- const struct gl_pixelstore_attrib save = ctx->Unpack;
- ctx->Unpack = ctx->DefaultPacking;
- CALL_TexImage2D(ctx->Exec, (n[1].e, /* target */
- n[2].i, /* level */
- n[3].i, /* components */
- n[4].i, /* width */
- n[5].i, /* height */
- n[6].e, /* border */
- n[7].e, /* format */
- n[8].e, /* type */
- n[9].data));
- ctx->Unpack = save; /* restore */
- }
- break;
- case OPCODE_TEX_IMAGE3D:
- {
- const struct gl_pixelstore_attrib save = ctx->Unpack;
- ctx->Unpack = ctx->DefaultPacking;
- CALL_TexImage3D(ctx->Exec, (n[1].e, /* target */
- n[2].i, /* level */
- n[3].i, /* components */
- n[4].i, /* width */
- n[5].i, /* height */
- n[6].i, /* depth */
- n[7].e, /* border */
- n[8].e, /* format */
- n[9].e, /* type */
- n[10].data));
- ctx->Unpack = save; /* restore */
- }
- break;
- case OPCODE_TEX_SUB_IMAGE1D:
- {
- const struct gl_pixelstore_attrib save = ctx->Unpack;
- ctx->Unpack = ctx->DefaultPacking;
- CALL_TexSubImage1D(ctx->Exec, (n[1].e, n[2].i, n[3].i,
- n[4].i, n[5].e,
- n[6].e, n[7].data));
- ctx->Unpack = save; /* restore */
- }
- break;
- case OPCODE_TEX_SUB_IMAGE2D:
- {
- const struct gl_pixelstore_attrib save = ctx->Unpack;
- ctx->Unpack = ctx->DefaultPacking;
- CALL_TexSubImage2D(ctx->Exec, (n[1].e, n[2].i, n[3].i,
- n[4].i, n[5].e,
- n[6].i, n[7].e, n[8].e,
- n[9].data));
- ctx->Unpack = save; /* restore */
- }
- break;
- case OPCODE_TEX_SUB_IMAGE3D:
- {
- const struct gl_pixelstore_attrib save = ctx->Unpack;
- ctx->Unpack = ctx->DefaultPacking;
- CALL_TexSubImage3D(ctx->Exec, (n[1].e, n[2].i, n[3].i,
- n[4].i, n[5].i, n[6].i, n[7].i,
- n[8].i, n[9].e, n[10].e,
- n[11].data));
- ctx->Unpack = save; /* restore */
- }
- break;
- case OPCODE_TRANSLATE:
- CALL_Translatef(ctx->Exec, (n[1].f, n[2].f, n[3].f));
- break;
- case OPCODE_VIEWPORT:
- CALL_Viewport(ctx->Exec, (n[1].i, n[2].i,
- (GLsizei) n[3].i, (GLsizei) n[4].i));
- break;
- case OPCODE_WINDOW_POS:
- CALL_WindowPos4fMESA(ctx->Exec, (n[1].f, n[2].f, n[3].f, n[4].f));
- break;
- case OPCODE_ACTIVE_TEXTURE: /* GL_ARB_multitexture */
- CALL_ActiveTextureARB(ctx->Exec, (n[1].e));
- break;
- case OPCODE_COMPRESSED_TEX_IMAGE_1D: /* GL_ARB_texture_compression */
- CALL_CompressedTexImage1DARB(ctx->Exec, (n[1].e, n[2].i, n[3].e,
- n[4].i, n[5].i, n[6].i,
- n[7].data));
- break;
- case OPCODE_COMPRESSED_TEX_IMAGE_2D: /* GL_ARB_texture_compression */
- CALL_CompressedTexImage2DARB(ctx->Exec, (n[1].e, n[2].i, n[3].e,
- n[4].i, n[5].i, n[6].i,
- n[7].i, n[8].data));
- break;
- case OPCODE_COMPRESSED_TEX_IMAGE_3D: /* GL_ARB_texture_compression */
- CALL_CompressedTexImage3DARB(ctx->Exec, (n[1].e, n[2].i, n[3].e,
- n[4].i, n[5].i, n[6].i,
- n[7].i, n[8].i,
- n[9].data));
- break;
- case OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D: /* GL_ARB_texture_compress */
- CALL_CompressedTexSubImage1DARB(ctx->Exec,
- (n[1].e, n[2].i, n[3].i, n[4].i,
- n[5].e, n[6].i, n[7].data));
- break;
- case OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D: /* GL_ARB_texture_compress */
- CALL_CompressedTexSubImage2DARB(ctx->Exec,
- (n[1].e, n[2].i, n[3].i, n[4].i,
- n[5].i, n[6].i, n[7].e, n[8].i,
- n[9].data));
- break;
- case OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D: /* GL_ARB_texture_compress */
- CALL_CompressedTexSubImage3DARB(ctx->Exec,
- (n[1].e, n[2].i, n[3].i, n[4].i,
- n[5].i, n[6].i, n[7].i, n[8].i,
- n[9].e, n[10].i, n[11].data));
- break;
- case OPCODE_SAMPLE_COVERAGE: /* GL_ARB_multisample */
- CALL_SampleCoverageARB(ctx->Exec, (n[1].f, n[2].b));
- break;
- case OPCODE_WINDOW_POS_ARB: /* GL_ARB_window_pos */
- CALL_WindowPos3fMESA(ctx->Exec, (n[1].f, n[2].f, n[3].f));
- break;
-#if FEATURE_NV_vertex_program || FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
- case OPCODE_BIND_PROGRAM_NV: /* GL_NV_vertex_program */
- CALL_BindProgramNV(ctx->Exec, (n[1].e, n[2].ui));
- break;
-#endif
-#if FEATURE_NV_vertex_program
- case OPCODE_EXECUTE_PROGRAM_NV:
- {
- GLfloat v[4];
- v[0] = n[3].f;
- v[1] = n[4].f;
- v[2] = n[5].f;
- v[3] = n[6].f;
- CALL_ExecuteProgramNV(ctx->Exec, (n[1].e, n[2].ui, v));
- }
- break;
- case OPCODE_REQUEST_RESIDENT_PROGRAMS_NV:
- CALL_RequestResidentProgramsNV(ctx->Exec, (n[1].ui,
- (GLuint *) n[2].data));
- break;
- case OPCODE_LOAD_PROGRAM_NV:
- CALL_LoadProgramNV(ctx->Exec, (n[1].e, n[2].ui, n[3].i,
- (const GLubyte *) n[4].data));
- break;
- case OPCODE_TRACK_MATRIX_NV:
- CALL_TrackMatrixNV(ctx->Exec, (n[1].e, n[2].ui, n[3].e, n[4].e));
- break;
-#endif
-
-#if FEATURE_NV_fragment_program
- case OPCODE_PROGRAM_LOCAL_PARAMETER_ARB:
- CALL_ProgramLocalParameter4fARB(ctx->Exec,
- (n[1].e, n[2].ui, n[3].f, n[4].f,
- n[5].f, n[6].f));
- break;
- case OPCODE_PROGRAM_NAMED_PARAMETER_NV:
- CALL_ProgramNamedParameter4fNV(ctx->Exec, (n[1].ui, n[2].i,
- (const GLubyte *) n[3].
- data, n[4].f, n[5].f,
- n[6].f, n[7].f));
- break;
-#endif
-
- case OPCODE_ACTIVE_STENCIL_FACE_EXT:
- CALL_ActiveStencilFaceEXT(ctx->Exec, (n[1].e));
- break;
- case OPCODE_DEPTH_BOUNDS_EXT:
- CALL_DepthBoundsEXT(ctx->Exec, (n[1].f, n[2].f));
- break;
-#if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
- case OPCODE_PROGRAM_STRING_ARB:
- CALL_ProgramStringARB(ctx->Exec,
- (n[1].e, n[2].e, n[3].i, n[4].data));
- break;
-#endif
-#if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program || FEATURE_NV_vertex_program
- case OPCODE_PROGRAM_ENV_PARAMETER_ARB:
- CALL_ProgramEnvParameter4fARB(ctx->Exec, (n[1].e, n[2].ui, n[3].f,
- n[4].f, n[5].f,
- n[6].f));
- break;
-#endif
-#if FEATURE_queryobj
- case OPCODE_BEGIN_QUERY_ARB:
- CALL_BeginQueryARB(ctx->Exec, (n[1].e, n[2].ui));
- break;
- case OPCODE_END_QUERY_ARB:
- CALL_EndQueryARB(ctx->Exec, (n[1].e));
- break;
-#endif
- case OPCODE_DRAW_BUFFERS_ARB:
- {
- GLenum buffers[MAX_DRAW_BUFFERS];
- GLint i, count = MIN2(n[1].i, MAX_DRAW_BUFFERS);
- for (i = 0; i < count; i++)
- buffers[i] = n[2 + i].e;
- CALL_DrawBuffersARB(ctx->Exec, (n[1].i, buffers));
- }
- break;
-#if FEATURE_EXT_framebuffer_blit
- case OPCODE_BLIT_FRAMEBUFFER:
- CALL_BlitFramebufferEXT(ctx->Exec, (n[1].i, n[2].i, n[3].i, n[4].i,
- n[5].i, n[6].i, n[7].i, n[8].i,
- n[9].i, n[10].e));
- break;
-#endif
-
- case OPCODE_USE_PROGRAM:
- CALL_UseProgramObjectARB(ctx->Exec, (n[1].ui));
- break;
- case OPCODE_USE_SHADER_PROGRAM_EXT:
- CALL_UseShaderProgramEXT(ctx->Exec, (n[1].ui, n[2].ui));
- break;
- case OPCODE_ACTIVE_PROGRAM_EXT:
- CALL_ActiveProgramEXT(ctx->Exec, (n[1].ui));
- break;
- case OPCODE_UNIFORM_1F:
- CALL_Uniform1fARB(ctx->Exec, (n[1].i, n[2].f));
- break;
- case OPCODE_UNIFORM_2F:
- CALL_Uniform2fARB(ctx->Exec, (n[1].i, n[2].f, n[3].f));
- break;
- case OPCODE_UNIFORM_3F:
- CALL_Uniform3fARB(ctx->Exec, (n[1].i, n[2].f, n[3].f, n[4].f));
- break;
- case OPCODE_UNIFORM_4F:
- CALL_Uniform4fARB(ctx->Exec,
- (n[1].i, n[2].f, n[3].f, n[4].f, n[5].f));
- break;
- case OPCODE_UNIFORM_1FV:
- CALL_Uniform1fvARB(ctx->Exec, (n[1].i, n[2].i, n[3].data));
- break;
- case OPCODE_UNIFORM_2FV:
- CALL_Uniform2fvARB(ctx->Exec, (n[1].i, n[2].i, n[3].data));
- break;
- case OPCODE_UNIFORM_3FV:
- CALL_Uniform3fvARB(ctx->Exec, (n[1].i, n[2].i, n[3].data));
- break;
- case OPCODE_UNIFORM_4FV:
- CALL_Uniform4fvARB(ctx->Exec, (n[1].i, n[2].i, n[3].data));
- break;
- case OPCODE_UNIFORM_1I:
- CALL_Uniform1iARB(ctx->Exec, (n[1].i, n[2].i));
- break;
- case OPCODE_UNIFORM_2I:
- CALL_Uniform2iARB(ctx->Exec, (n[1].i, n[2].i, n[3].i));
- break;
- case OPCODE_UNIFORM_3I:
- CALL_Uniform3iARB(ctx->Exec, (n[1].i, n[2].i, n[3].i, n[4].i));
- break;
- case OPCODE_UNIFORM_4I:
- CALL_Uniform4iARB(ctx->Exec,
- (n[1].i, n[2].i, n[3].i, n[4].i, n[5].i));
- break;
- case OPCODE_UNIFORM_1IV:
- CALL_Uniform1ivARB(ctx->Exec, (n[1].i, n[2].i, n[3].data));
- break;
- case OPCODE_UNIFORM_2IV:
- CALL_Uniform2ivARB(ctx->Exec, (n[1].i, n[2].i, n[3].data));
- break;
- case OPCODE_UNIFORM_3IV:
- CALL_Uniform3ivARB(ctx->Exec, (n[1].i, n[2].i, n[3].data));
- break;
- case OPCODE_UNIFORM_4IV:
- CALL_Uniform4ivARB(ctx->Exec, (n[1].i, n[2].i, n[3].data));
- break;
- case OPCODE_UNIFORM_1UI:
- /*CALL_Uniform1uiARB(ctx->Exec, (n[1].i, n[2].i));*/
- break;
- case OPCODE_UNIFORM_2UI:
- /*CALL_Uniform2uiARB(ctx->Exec, (n[1].i, n[2].i, n[3].i));*/
- break;
- case OPCODE_UNIFORM_3UI:
- /*CALL_Uniform3uiARB(ctx->Exec, (n[1].i, n[2].i, n[3].i, n[4].i));*/
- break;
- case OPCODE_UNIFORM_4UI:
- /*CALL_Uniform4uiARB(ctx->Exec,
- (n[1].i, n[2].i, n[3].i, n[4].i, n[5].i));
- */
- break;
- case OPCODE_UNIFORM_1UIV:
- /*CALL_Uniform1uivARB(ctx->Exec, (n[1].i, n[2].i, n[3].data));*/
- break;
- case OPCODE_UNIFORM_2UIV:
- /*CALL_Uniform2uivARB(ctx->Exec, (n[1].i, n[2].i, n[3].data));*/
- break;
- case OPCODE_UNIFORM_3UIV:
- /*CALL_Uniform3uivARB(ctx->Exec, (n[1].i, n[2].i, n[3].data));*/
- break;
- case OPCODE_UNIFORM_4UIV:
- /*CALL_Uniform4uivARB(ctx->Exec, (n[1].i, n[2].i, n[3].data));*/
- break;
- case OPCODE_UNIFORM_MATRIX22:
- CALL_UniformMatrix2fvARB(ctx->Exec,
- (n[1].i, n[2].i, n[3].b, n[4].data));
- break;
- case OPCODE_UNIFORM_MATRIX33:
- CALL_UniformMatrix3fvARB(ctx->Exec,
- (n[1].i, n[2].i, n[3].b, n[4].data));
- break;
- case OPCODE_UNIFORM_MATRIX44:
- CALL_UniformMatrix4fvARB(ctx->Exec,
- (n[1].i, n[2].i, n[3].b, n[4].data));
- break;
- case OPCODE_UNIFORM_MATRIX23:
- CALL_UniformMatrix2x3fv(ctx->Exec,
- (n[1].i, n[2].i, n[3].b, n[4].data));
- break;
- case OPCODE_UNIFORM_MATRIX32:
- CALL_UniformMatrix3x2fv(ctx->Exec,
- (n[1].i, n[2].i, n[3].b, n[4].data));
- break;
- case OPCODE_UNIFORM_MATRIX24:
- CALL_UniformMatrix2x4fv(ctx->Exec,
- (n[1].i, n[2].i, n[3].b, n[4].data));
- break;
- case OPCODE_UNIFORM_MATRIX42:
- CALL_UniformMatrix4x2fv(ctx->Exec,
- (n[1].i, n[2].i, n[3].b, n[4].data));
- break;
- case OPCODE_UNIFORM_MATRIX34:
- CALL_UniformMatrix3x4fv(ctx->Exec,
- (n[1].i, n[2].i, n[3].b, n[4].data));
- break;
- case OPCODE_UNIFORM_MATRIX43:
- CALL_UniformMatrix4x3fv(ctx->Exec,
- (n[1].i, n[2].i, n[3].b, n[4].data));
- break;
-
- case OPCODE_CLAMP_COLOR:
- CALL_ClampColorARB(ctx->Exec, (n[1].e, n[2].e));
- break;
-
- case OPCODE_TEX_BUMP_PARAMETER_ATI:
- {
- GLfloat values[4];
- GLuint i, pname = n[1].ui;
-
- for (i = 0; i < 4; i++)
- values[i] = n[1 + i].f;
- CALL_TexBumpParameterfvATI(ctx->Exec, (pname, values));
- }
- break;
-#if FEATURE_ATI_fragment_shader
- case OPCODE_BIND_FRAGMENT_SHADER_ATI:
- CALL_BindFragmentShaderATI(ctx->Exec, (n[1].i));
- break;
- case OPCODE_SET_FRAGMENT_SHADER_CONSTANTS_ATI:
- {
- GLfloat values[4];
- GLuint i, dst = n[1].ui;
-
- for (i = 0; i < 4; i++)
- values[i] = n[1 + i].f;
- CALL_SetFragmentShaderConstantATI(ctx->Exec, (dst, values));
- }
- break;
-#endif
- case OPCODE_ATTR_1F_NV:
- CALL_VertexAttrib1fNV(ctx->Exec, (n[1].e, n[2].f));
- break;
- case OPCODE_ATTR_2F_NV:
- /* Really shouldn't have to do this - the Node structure
- * is convenient, but it would be better to store the data
- * packed appropriately so that it can be sent directly
- * on. With x86_64 becoming common, this will start to
- * matter more.
- */
- if (sizeof(Node) == sizeof(GLfloat))
- CALL_VertexAttrib2fvNV(ctx->Exec, (n[1].e, &n[2].f));
- else
- CALL_VertexAttrib2fNV(ctx->Exec, (n[1].e, n[2].f, n[3].f));
- break;
- case OPCODE_ATTR_3F_NV:
- if (sizeof(Node) == sizeof(GLfloat))
- CALL_VertexAttrib3fvNV(ctx->Exec, (n[1].e, &n[2].f));
- else
- CALL_VertexAttrib3fNV(ctx->Exec, (n[1].e, n[2].f, n[3].f,
- n[4].f));
- break;
- case OPCODE_ATTR_4F_NV:
- if (sizeof(Node) == sizeof(GLfloat))
- CALL_VertexAttrib4fvNV(ctx->Exec, (n[1].e, &n[2].f));
- else
- CALL_VertexAttrib4fNV(ctx->Exec, (n[1].e, n[2].f, n[3].f,
- n[4].f, n[5].f));
- break;
- case OPCODE_ATTR_1F_ARB:
- CALL_VertexAttrib1fARB(ctx->Exec, (n[1].e, n[2].f));
- break;
- case OPCODE_ATTR_2F_ARB:
- /* Really shouldn't have to do this - the Node structure
- * is convenient, but it would be better to store the data
- * packed appropriately so that it can be sent directly
- * on. With x86_64 becoming common, this will start to
- * matter more.
- */
- if (sizeof(Node) == sizeof(GLfloat))
- CALL_VertexAttrib2fvARB(ctx->Exec, (n[1].e, &n[2].f));
- else
- CALL_VertexAttrib2fARB(ctx->Exec, (n[1].e, n[2].f, n[3].f));
- break;
- case OPCODE_ATTR_3F_ARB:
- if (sizeof(Node) == sizeof(GLfloat))
- CALL_VertexAttrib3fvARB(ctx->Exec, (n[1].e, &n[2].f));
- else
- CALL_VertexAttrib3fARB(ctx->Exec, (n[1].e, n[2].f, n[3].f,
- n[4].f));
- break;
- case OPCODE_ATTR_4F_ARB:
- if (sizeof(Node) == sizeof(GLfloat))
- CALL_VertexAttrib4fvARB(ctx->Exec, (n[1].e, &n[2].f));
- else
- CALL_VertexAttrib4fARB(ctx->Exec, (n[1].e, n[2].f, n[3].f,
- n[4].f, n[5].f));
- break;
- case OPCODE_MATERIAL:
- if (sizeof(Node) == sizeof(GLfloat))
- CALL_Materialfv(ctx->Exec, (n[1].e, n[2].e, &n[3].f));
- else {
- GLfloat f[4];
- f[0] = n[3].f;
- f[1] = n[4].f;
- f[2] = n[5].f;
- f[3] = n[6].f;
- CALL_Materialfv(ctx->Exec, (n[1].e, n[2].e, f));
- }
- break;
- case OPCODE_BEGIN:
- CALL_Begin(ctx->Exec, (n[1].e));
- break;
- case OPCODE_END:
- CALL_End(ctx->Exec, ());
- break;
- case OPCODE_RECTF:
- CALL_Rectf(ctx->Exec, (n[1].f, n[2].f, n[3].f, n[4].f));
- break;
- case OPCODE_EVAL_C1:
- CALL_EvalCoord1f(ctx->Exec, (n[1].f));
- break;
- case OPCODE_EVAL_C2:
- CALL_EvalCoord2f(ctx->Exec, (n[1].f, n[2].f));
- break;
- case OPCODE_EVAL_P1:
- CALL_EvalPoint1(ctx->Exec, (n[1].i));
- break;
- case OPCODE_EVAL_P2:
- CALL_EvalPoint2(ctx->Exec, (n[1].i, n[2].i));
- break;
-
- /* GL_EXT_texture_integer */
- case OPCODE_CLEARCOLOR_I:
- CALL_ClearColorIiEXT(ctx->Exec, (n[1].i, n[2].i, n[3].i, n[4].i));
- break;
- case OPCODE_CLEARCOLOR_UI:
- CALL_ClearColorIuiEXT(ctx->Exec,
- (n[1].ui, n[2].ui, n[3].ui, n[4].ui));
- break;
- case OPCODE_TEXPARAMETER_I:
- {
- GLint params[4];
- params[0] = n[3].i;
- params[1] = n[4].i;
- params[2] = n[5].i;
- params[3] = n[6].i;
- CALL_TexParameterIivEXT(ctx->Exec, (n[1].e, n[2].e, params));
- }
- break;
- case OPCODE_TEXPARAMETER_UI:
- {
- GLuint params[4];
- params[0] = n[3].ui;
- params[1] = n[4].ui;
- params[2] = n[5].ui;
- params[3] = n[6].ui;
- CALL_TexParameterIuivEXT(ctx->Exec, (n[1].e, n[2].e, params));
- }
- break;
-
- case OPCODE_VERTEX_ATTRIB_DIVISOR:
- /* GL_ARB_instanced_arrays */
- CALL_VertexAttribDivisorARB(ctx->Exec, (n[1].ui, n[2].ui));
- break;
-
- case OPCODE_TEXTURE_BARRIER_NV:
- CALL_TextureBarrierNV(ctx->Exec, ());
- break;
-
- case OPCODE_BIND_SAMPLER:
- CALL_BindSampler(ctx->Exec, (n[1].ui, n[2].ui));
- break;
-
- case OPCODE_CONTINUE:
- n = (Node *) n[1].next;
- break;
- case OPCODE_END_OF_LIST:
- done = GL_TRUE;
- break;
- default:
- {
- char msg[1000];
- _mesa_snprintf(msg, sizeof(msg), "Error in execute_list: opcode=%d",
- (int) opcode);
- _mesa_problem(ctx, "%s", msg);
- }
- done = GL_TRUE;
- }
-
- /* increment n to point to next compiled command */
- if (opcode != OPCODE_CONTINUE) {
- n += InstSize[opcode];
- }
- }
- }
-
- if (ctx->Driver.EndCallList)
- ctx->Driver.EndCallList(ctx);
-
- ctx->ListState.CallDepth--;
-}
-
-
-
-/**********************************************************************/
-/* GL functions */
-/**********************************************************************/
-
-/**
- * Test if a display list number is valid.
- */
-static GLboolean GLAPIENTRY
-_mesa_IsList(GLuint list)
-{
- GET_CURRENT_CONTEXT(ctx);
- FLUSH_VERTICES(ctx, 0); /* must be called before assert */
- ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, GL_FALSE);
- return islist(ctx, list);
-}
-
-
-/**
- * Delete a sequence of consecutive display lists.
- */
-static void GLAPIENTRY
-_mesa_DeleteLists(GLuint list, GLsizei range)
-{
- GET_CURRENT_CONTEXT(ctx);
- GLuint i;
- FLUSH_VERTICES(ctx, 0); /* must be called before assert */
- ASSERT_OUTSIDE_BEGIN_END(ctx);
-
- if (range < 0) {
- _mesa_error(ctx, GL_INVALID_VALUE, "glDeleteLists");
- return;
- }
- for (i = list; i < list + range; i++) {
- destroy_list(ctx, i);
- }
-}
-
-
-/**
- * Return a display list number, n, such that lists n through n+range-1
- * are free.
- */
-static GLuint GLAPIENTRY
-_mesa_GenLists(GLsizei range)
-{
- GET_CURRENT_CONTEXT(ctx);
- GLuint base;
- FLUSH_VERTICES(ctx, 0); /* must be called before assert */
- ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, 0);
-
- if (range < 0) {
- _mesa_error(ctx, GL_INVALID_VALUE, "glGenLists");
- return 0;
- }
- if (range == 0) {
- return 0;
- }
-
- /*
- * Make this an atomic operation
- */
- _glthread_LOCK_MUTEX(ctx->Shared->Mutex);
-
- base = _mesa_HashFindFreeKeyBlock(ctx->Shared->DisplayList, range);
- if (base) {
- /* reserve the list IDs by with empty/dummy lists */
- GLint i;
- for (i = 0; i < range; i++) {
- _mesa_HashInsert(ctx->Shared->DisplayList, base + i,
- make_list(base + i, 1));
- }
- }
-
- _glthread_UNLOCK_MUTEX(ctx->Shared->Mutex);
-
- return base;
-}
-
-
-/**
- * Begin a new display list.
- */
-static void GLAPIENTRY
-_mesa_NewList(GLuint name, GLenum mode)
-{
- GET_CURRENT_CONTEXT(ctx);
-
- FLUSH_CURRENT(ctx, 0); /* must be called before assert */
- ASSERT_OUTSIDE_BEGIN_END(ctx);
-
- if (MESA_VERBOSE & VERBOSE_API)
- _mesa_debug(ctx, "glNewList %u %s\n", name,
- _mesa_lookup_enum_by_nr(mode));
-
- if (name == 0) {
- _mesa_error(ctx, GL_INVALID_VALUE, "glNewList");
- return;
- }
-
- if (mode != GL_COMPILE && mode != GL_COMPILE_AND_EXECUTE) {
- _mesa_error(ctx, GL_INVALID_ENUM, "glNewList");
- return;
- }
-
- if (ctx->ListState.CurrentList) {
- /* already compiling a display list */
- _mesa_error(ctx, GL_INVALID_OPERATION, "glNewList");
- return;
- }
-
- ctx->CompileFlag = GL_TRUE;
- ctx->ExecuteFlag = (mode == GL_COMPILE_AND_EXECUTE);
-
- /* Reset acumulated list state:
- */
- invalidate_saved_current_state( ctx );
-
- /* Allocate new display list */
- ctx->ListState.CurrentList = make_list(name, BLOCK_SIZE);
- ctx->ListState.CurrentBlock = ctx->ListState.CurrentList->Head;
- ctx->ListState.CurrentPos = 0;
-
- ctx->Driver.NewList(ctx, name, mode);
-
- ctx->CurrentDispatch = ctx->Save;
- _glapi_set_dispatch(ctx->CurrentDispatch);
-}
-
-
-/**
- * End definition of current display list.
- */
-static void GLAPIENTRY
-_mesa_EndList(void)
-{
- GET_CURRENT_CONTEXT(ctx);
- SAVE_FLUSH_VERTICES(ctx);
- ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
-
- if (MESA_VERBOSE & VERBOSE_API)
- _mesa_debug(ctx, "glEndList\n");
-
- /* Check that a list is under construction */
- if (!ctx->ListState.CurrentList) {
- _mesa_error(ctx, GL_INVALID_OPERATION, "glEndList");
- return;
- }
-
- /* Call before emitting END_OF_LIST, in case the driver wants to
- * emit opcodes itself.
- */
- ctx->Driver.EndList(ctx);
-
- (void) alloc_instruction(ctx, OPCODE_END_OF_LIST, 0);
-
- /* Destroy old list, if any */
- destroy_list(ctx, ctx->ListState.CurrentList->Name);
-
- /* Install the new list */
- _mesa_HashInsert(ctx->Shared->DisplayList,
- ctx->ListState.CurrentList->Name,
- ctx->ListState.CurrentList);
-
-
- if (MESA_VERBOSE & VERBOSE_DISPLAY_LIST)
- mesa_print_display_list(ctx->ListState.CurrentList->Name);
-
- ctx->ListState.CurrentList = NULL;
- ctx->ExecuteFlag = GL_TRUE;
- ctx->CompileFlag = GL_FALSE;
-
- ctx->CurrentDispatch = ctx->Exec;
- _glapi_set_dispatch(ctx->CurrentDispatch);
-}
-
-
-void GLAPIENTRY
-_mesa_CallList(GLuint list)
-{
- GLboolean save_compile_flag;
- GET_CURRENT_CONTEXT(ctx);
- FLUSH_CURRENT(ctx, 0);
-
- if (MESA_VERBOSE & VERBOSE_API)
- _mesa_debug(ctx, "glCallList %d\n", list);
-
- if (list == 0) {
- _mesa_error(ctx, GL_INVALID_VALUE, "glCallList(list==0)");
- return;
- }
-
- if (0)
- mesa_print_display_list( list );
-
- /* VERY IMPORTANT: Save the CompileFlag status, turn it off,
- * execute the display list, and restore the CompileFlag.
- */
- save_compile_flag = ctx->CompileFlag;
- if (save_compile_flag) {
- ctx->CompileFlag = GL_FALSE;
- }
-
- execute_list(ctx, list);
- ctx->CompileFlag = save_compile_flag;
-
- /* also restore API function pointers to point to "save" versions */
- if (save_compile_flag) {
- ctx->CurrentDispatch = ctx->Save;
- _glapi_set_dispatch(ctx->CurrentDispatch);
- }
-}
-
-
-/**
- * Execute glCallLists: call multiple display lists.
- */
-void GLAPIENTRY
-_mesa_CallLists(GLsizei n, GLenum type, const GLvoid * lists)
-{
- GET_CURRENT_CONTEXT(ctx);
- GLint i;
- GLboolean save_compile_flag;
-
- if (MESA_VERBOSE & VERBOSE_API)
- _mesa_debug(ctx, "glCallLists %d\n", n);
-
- switch (type) {
- case GL_BYTE:
- case GL_UNSIGNED_BYTE:
- case GL_SHORT:
- case GL_UNSIGNED_SHORT:
- case GL_INT:
- case GL_UNSIGNED_INT:
- case GL_FLOAT:
- case GL_2_BYTES:
- case GL_3_BYTES:
- case GL_4_BYTES:
- /* OK */
- break;
- default:
- _mesa_error(ctx, GL_INVALID_ENUM, "glCallLists(type)");
- return;
- }
-
- /* Save the CompileFlag status, turn it off, execute display list,
- * and restore the CompileFlag.
- */
- save_compile_flag = ctx->CompileFlag;
- ctx->CompileFlag = GL_FALSE;
-
- for (i = 0; i < n; i++) {
- GLuint list = (GLuint) (ctx->List.ListBase + translate_id(i, type, lists));
- execute_list(ctx, list);
- }
-
- ctx->CompileFlag = save_compile_flag;
-
- /* also restore API function pointers to point to "save" versions */
- if (save_compile_flag) {
- ctx->CurrentDispatch = ctx->Save;
- _glapi_set_dispatch(ctx->CurrentDispatch);
- }
-}
-
-
-/**
- * Set the offset added to list numbers in glCallLists.
- */
-static void GLAPIENTRY
-_mesa_ListBase(GLuint base)
-{
- GET_CURRENT_CONTEXT(ctx);
- FLUSH_VERTICES(ctx, 0); /* must be called before assert */
- ASSERT_OUTSIDE_BEGIN_END(ctx);
- ctx->List.ListBase = base;
-}
-
-
-/* Can no longer assume ctx->Exec->Func is equal to _mesa_Func.
- */
-static void GLAPIENTRY
-exec_Finish(void)
-{
- GET_CURRENT_CONTEXT(ctx);
- FLUSH_VERTICES(ctx, 0);
- CALL_Finish(ctx->Exec, ());
-}
-
-static void GLAPIENTRY
-exec_Flush(void)
-{
- GET_CURRENT_CONTEXT(ctx);
- FLUSH_VERTICES(ctx, 0);
- CALL_Flush(ctx->Exec, ());
-}
-
-static void GLAPIENTRY
-exec_GetBooleanv(GLenum pname, GLboolean *params)
-{
- GET_CURRENT_CONTEXT(ctx);
- FLUSH_VERTICES(ctx, 0);
- CALL_GetBooleanv(ctx->Exec, (pname, params));
-}
-
-static void GLAPIENTRY
-exec_GetClipPlane(GLenum plane, GLdouble * equation)
-{
- GET_CURRENT_CONTEXT(ctx);
- FLUSH_VERTICES(ctx, 0);
- CALL_GetClipPlane(ctx->Exec, (plane, equation));
-}
-
-static void GLAPIENTRY
-exec_GetDoublev(GLenum pname, GLdouble *params)
-{
- GET_CURRENT_CONTEXT(ctx);
- FLUSH_VERTICES(ctx, 0);
- CALL_GetDoublev(ctx->Exec, (pname, params));
-}
-
-static GLenum GLAPIENTRY
-exec_GetError(void)
-{
- GET_CURRENT_CONTEXT(ctx);
- FLUSH_VERTICES(ctx, 0);
- return CALL_GetError(ctx->Exec, ());
-}
-
-static void GLAPIENTRY
-exec_GetFloatv(GLenum pname, GLfloat *params)
-{
- GET_CURRENT_CONTEXT(ctx);
- FLUSH_VERTICES(ctx, 0);
- CALL_GetFloatv(ctx->Exec, (pname, params));
-}
-
-static void GLAPIENTRY
-exec_GetIntegerv(GLenum pname, GLint *params)
-{
- GET_CURRENT_CONTEXT(ctx);
- FLUSH_VERTICES(ctx, 0);
- CALL_GetIntegerv(ctx->Exec, (pname, params));
-}
-
-static void GLAPIENTRY
-exec_GetLightfv(GLenum light, GLenum pname, GLfloat *params)
-{
- GET_CURRENT_CONTEXT(ctx);
- FLUSH_VERTICES(ctx, 0);
- CALL_GetLightfv(ctx->Exec, (light, pname, params));
-}
-
-static void GLAPIENTRY
-exec_GetLightiv(GLenum light, GLenum pname, GLint *params)
-{
- GET_CURRENT_CONTEXT(ctx);
- FLUSH_VERTICES(ctx, 0);
- CALL_GetLightiv(ctx->Exec, (light, pname, params));
-}
-
-static void GLAPIENTRY
-exec_GetMapdv(GLenum target, GLenum query, GLdouble * v)
-{
- GET_CURRENT_CONTEXT(ctx);
- FLUSH_VERTICES(ctx, 0);
- CALL_GetMapdv(ctx->Exec, (target, query, v));
-}
-
-static void GLAPIENTRY
-exec_GetMapfv(GLenum target, GLenum query, GLfloat * v)
-{
- GET_CURRENT_CONTEXT(ctx);
- FLUSH_VERTICES(ctx, 0);
- CALL_GetMapfv(ctx->Exec, (target, query, v));
-}
-
-static void GLAPIENTRY
-exec_GetMapiv(GLenum target, GLenum query, GLint * v)
-{
- GET_CURRENT_CONTEXT(ctx);
- FLUSH_VERTICES(ctx, 0);
- CALL_GetMapiv(ctx->Exec, (target, query, v));
-}
-
-static void GLAPIENTRY
-exec_GetMaterialfv(GLenum face, GLenum pname, GLfloat *params)
-{
- GET_CURRENT_CONTEXT(ctx);
- FLUSH_VERTICES(ctx, 0);
- CALL_GetMaterialfv(ctx->Exec, (face, pname, params));
-}
-
-static void GLAPIENTRY
-exec_GetMaterialiv(GLenum face, GLenum pname, GLint *params)
-{
- GET_CURRENT_CONTEXT(ctx);
- FLUSH_VERTICES(ctx, 0);
- CALL_GetMaterialiv(ctx->Exec, (face, pname, params));
-}
-
-static void GLAPIENTRY
-exec_GetPixelMapfv(GLenum map, GLfloat *values)
-{
- GET_CURRENT_CONTEXT(ctx);
- FLUSH_VERTICES(ctx, 0);
- CALL_GetPixelMapfv(ctx->Exec, (map, values));
-}
-
-static void GLAPIENTRY
-exec_GetPixelMapuiv(GLenum map, GLuint *values)
-{
- GET_CURRENT_CONTEXT(ctx);
- FLUSH_VERTICES(ctx, 0);
- CALL_GetPixelMapuiv(ctx->Exec, (map, values));
-}
-
-static void GLAPIENTRY
-exec_GetPixelMapusv(GLenum map, GLushort *values)
-{
- GET_CURRENT_CONTEXT(ctx);
- FLUSH_VERTICES(ctx, 0);
- CALL_GetPixelMapusv(ctx->Exec, (map, values));
-}
-
-static void GLAPIENTRY
-exec_GetPolygonStipple(GLubyte * dest)
-{
- GET_CURRENT_CONTEXT(ctx);
- FLUSH_VERTICES(ctx, 0);
- CALL_GetPolygonStipple(ctx->Exec, (dest));
-}
-
-static const GLubyte *GLAPIENTRY
-exec_GetString(GLenum name)
-{
- GET_CURRENT_CONTEXT(ctx);
- FLUSH_VERTICES(ctx, 0);
- return CALL_GetString(ctx->Exec, (name));
-}
-
-static void GLAPIENTRY
-exec_GetTexEnvfv(GLenum target, GLenum pname, GLfloat *params)
-{
- GET_CURRENT_CONTEXT(ctx);
- FLUSH_VERTICES(ctx, 0);
- CALL_GetTexEnvfv(ctx->Exec, (target, pname, params));
-}
-
-static void GLAPIENTRY
-exec_GetTexEnviv(GLenum target, GLenum pname, GLint *params)
-{
- GET_CURRENT_CONTEXT(ctx);
- FLUSH_VERTICES(ctx, 0);
- CALL_GetTexEnviv(ctx->Exec, (target, pname, params));
-}
-
-static void GLAPIENTRY
-exec_GetTexGendv(GLenum coord, GLenum pname, GLdouble *params)
-{
- GET_CURRENT_CONTEXT(ctx);
- FLUSH_VERTICES(ctx, 0);
- CALL_GetTexGendv(ctx->Exec, (coord, pname, params));
-}
-
-static void GLAPIENTRY
-exec_GetTexGenfv(GLenum coord, GLenum pname, GLfloat *params)
-{
- GET_CURRENT_CONTEXT(ctx);
- FLUSH_VERTICES(ctx, 0);
- CALL_GetTexGenfv(ctx->Exec, (coord, pname, params));
-}
-
-static void GLAPIENTRY
-exec_GetTexGeniv(GLenum coord, GLenum pname, GLint *params)
-{
- GET_CURRENT_CONTEXT(ctx);
- FLUSH_VERTICES(ctx, 0);
- CALL_GetTexGeniv(ctx->Exec, (coord, pname, params));
-}
-
-static void GLAPIENTRY
-exec_GetTexImage(GLenum target, GLint level, GLenum format,
- GLenum type, GLvoid * pixels)
-{
- GET_CURRENT_CONTEXT(ctx);
- FLUSH_VERTICES(ctx, 0);
- CALL_GetTexImage(ctx->Exec, (target, level, format, type, pixels));
-}
-
-static void GLAPIENTRY
-exec_GetTexLevelParameterfv(GLenum target, GLint level,
- GLenum pname, GLfloat *params)
-{
- GET_CURRENT_CONTEXT(ctx);
- FLUSH_VERTICES(ctx, 0);
- CALL_GetTexLevelParameterfv(ctx->Exec, (target, level, pname, params));
-}
-
-static void GLAPIENTRY
-exec_GetTexLevelParameteriv(GLenum target, GLint level,
- GLenum pname, GLint *params)
-{
- GET_CURRENT_CONTEXT(ctx);
- FLUSH_VERTICES(ctx, 0);
- CALL_GetTexLevelParameteriv(ctx->Exec, (target, level, pname, params));
-}
-
-static void GLAPIENTRY
-exec_GetTexParameterfv(GLenum target, GLenum pname, GLfloat *params)
-{
- GET_CURRENT_CONTEXT(ctx);
- FLUSH_VERTICES(ctx, 0);
- CALL_GetTexParameterfv(ctx->Exec, (target, pname, params));
-}
-
-static void GLAPIENTRY
-exec_GetTexParameteriv(GLenum target, GLenum pname, GLint *params)
-{
- GET_CURRENT_CONTEXT(ctx);
- FLUSH_VERTICES(ctx, 0);
- CALL_GetTexParameteriv(ctx->Exec, (target, pname, params));
-}
-
-static GLboolean GLAPIENTRY
-exec_IsEnabled(GLenum cap)
-{
- GET_CURRENT_CONTEXT(ctx);
- FLUSH_VERTICES(ctx, 0);
- return CALL_IsEnabled(ctx->Exec, (cap));
-}
-
-static void GLAPIENTRY
-exec_PixelStoref(GLenum pname, GLfloat param)
-{
- GET_CURRENT_CONTEXT(ctx);
- FLUSH_VERTICES(ctx, 0);
- CALL_PixelStoref(ctx->Exec, (pname, param));
-}
-
-static void GLAPIENTRY
-exec_PixelStorei(GLenum pname, GLint param)
-{
- GET_CURRENT_CONTEXT(ctx);
- FLUSH_VERTICES(ctx, 0);
- CALL_PixelStorei(ctx->Exec, (pname, param));
-}
-
-static void GLAPIENTRY
-exec_ReadPixels(GLint x, GLint y, GLsizei width, GLsizei height,
- GLenum format, GLenum type, GLvoid * pixels)
-{
- GET_CURRENT_CONTEXT(ctx);
- FLUSH_VERTICES(ctx, 0);
- CALL_ReadPixels(ctx->Exec, (x, y, width, height, format, type, pixels));
-}
-
-static GLint GLAPIENTRY
-exec_RenderMode(GLenum mode)
-{
- GET_CURRENT_CONTEXT(ctx);
- FLUSH_VERTICES(ctx, 0);
- return CALL_RenderMode(ctx->Exec, (mode));
-}
-
-static void GLAPIENTRY
-exec_FeedbackBuffer(GLsizei size, GLenum type, GLfloat * buffer)
-{
- GET_CURRENT_CONTEXT(ctx);
- FLUSH_VERTICES(ctx, 0);
- CALL_FeedbackBuffer(ctx->Exec, (size, type, buffer));
-}
-
-static void GLAPIENTRY
-exec_SelectBuffer(GLsizei size, GLuint * buffer)
-{
- GET_CURRENT_CONTEXT(ctx);
- FLUSH_VERTICES(ctx, 0);
- CALL_SelectBuffer(ctx->Exec, (size, buffer));
-}
-
-static GLboolean GLAPIENTRY
-exec_AreTexturesResident(GLsizei n, const GLuint * texName,
- GLboolean * residences)
-{
- GET_CURRENT_CONTEXT(ctx);
- FLUSH_VERTICES(ctx, 0);
- return CALL_AreTexturesResident(ctx->Exec, (n, texName, residences));
-}
-
-static void GLAPIENTRY
-exec_ColorPointer(GLint size, GLenum type, GLsizei stride, const GLvoid *ptr)
-{
- GET_CURRENT_CONTEXT(ctx);
- FLUSH_VERTICES(ctx, 0);
- CALL_ColorPointer(ctx->Exec, (size, type, stride, ptr));
-}
-
-static void GLAPIENTRY
-exec_DeleteTextures(GLsizei n, const GLuint * texName)
-{
- GET_CURRENT_CONTEXT(ctx);
- FLUSH_VERTICES(ctx, 0);
- CALL_DeleteTextures(ctx->Exec, (n, texName));
-}
-
-static void GLAPIENTRY
-exec_DisableClientState(GLenum cap)
-{
- GET_CURRENT_CONTEXT(ctx);
- FLUSH_VERTICES(ctx, 0);
- CALL_DisableClientState(ctx->Exec, (cap));
-}
-
-static void GLAPIENTRY
-exec_EdgeFlagPointer(GLsizei stride, const GLvoid * vptr)
-{
- GET_CURRENT_CONTEXT(ctx);
- FLUSH_VERTICES(ctx, 0);
- CALL_EdgeFlagPointer(ctx->Exec, (stride, vptr));
-}
-
-static void GLAPIENTRY
-exec_EnableClientState(GLenum cap)
-{
- GET_CURRENT_CONTEXT(ctx);
- FLUSH_VERTICES(ctx, 0);
- CALL_EnableClientState(ctx->Exec, (cap));
-}
-
-static void GLAPIENTRY
-exec_GenTextures(GLsizei n, GLuint * texName)
-{
- GET_CURRENT_CONTEXT(ctx);
- FLUSH_VERTICES(ctx, 0);
- CALL_GenTextures(ctx->Exec, (n, texName));
-}
-
-static void GLAPIENTRY
-exec_GetPointerv(GLenum pname, GLvoid **params)
-{
- GET_CURRENT_CONTEXT(ctx);
- FLUSH_VERTICES(ctx, 0);
- CALL_GetPointerv(ctx->Exec, (pname, params));
-}
-
-static void GLAPIENTRY
-exec_IndexPointer(GLenum type, GLsizei stride, const GLvoid *ptr)
-{
- GET_CURRENT_CONTEXT(ctx);
- FLUSH_VERTICES(ctx, 0);
- CALL_IndexPointer(ctx->Exec, (type, stride, ptr));
-}
-
-static void GLAPIENTRY
-exec_InterleavedArrays(GLenum format, GLsizei stride, const GLvoid * pointer)
-{
- GET_CURRENT_CONTEXT(ctx);
- FLUSH_VERTICES(ctx, 0);
- CALL_InterleavedArrays(ctx->Exec, (format, stride, pointer));
-}
-
-static GLboolean GLAPIENTRY
-exec_IsTexture(GLuint texture)
-{
- GET_CURRENT_CONTEXT(ctx);
- FLUSH_VERTICES(ctx, 0);
- return CALL_IsTexture(ctx->Exec, (texture));
-}
-
-static void GLAPIENTRY
-exec_NormalPointer(GLenum type, GLsizei stride, const GLvoid *ptr)
-{
- GET_CURRENT_CONTEXT(ctx);
- FLUSH_VERTICES(ctx, 0);
- CALL_NormalPointer(ctx->Exec, (type, stride, ptr));
-}
-
-static void GLAPIENTRY
-exec_PopClientAttrib(void)
-{
- GET_CURRENT_CONTEXT(ctx);
- FLUSH_VERTICES(ctx, 0);
- CALL_PopClientAttrib(ctx->Exec, ());
-}
-
-static void GLAPIENTRY
-exec_PushClientAttrib(GLbitfield mask)
-{
- GET_CURRENT_CONTEXT(ctx);
- FLUSH_VERTICES(ctx, 0);
- CALL_PushClientAttrib(ctx->Exec, (mask));
-}
-
-static void GLAPIENTRY
-exec_TexCoordPointer(GLint size, GLenum type, GLsizei stride,
- const GLvoid *ptr)
-{
- GET_CURRENT_CONTEXT(ctx);
- FLUSH_VERTICES(ctx, 0);
- CALL_TexCoordPointer(ctx->Exec, (size, type, stride, ptr));
-}
-
-static void GLAPIENTRY
-exec_GetCompressedTexImageARB(GLenum target, GLint level, GLvoid * img)
-{
- GET_CURRENT_CONTEXT(ctx);
- FLUSH_VERTICES(ctx, 0);
- CALL_GetCompressedTexImageARB(ctx->Exec, (target, level, img));
-}
-
-static void GLAPIENTRY
-exec_VertexPointer(GLint size, GLenum type, GLsizei stride,
- const GLvoid *ptr)
-{
- GET_CURRENT_CONTEXT(ctx);
- FLUSH_VERTICES(ctx, 0);
- CALL_VertexPointer(ctx->Exec, (size, type, stride, ptr));
-}
-
-static void GLAPIENTRY
-exec_CopyConvolutionFilter1D(GLenum target, GLenum internalFormat,
- GLint x, GLint y, GLsizei width)
-{
- GET_CURRENT_CONTEXT(ctx);
- FLUSH_VERTICES(ctx, 0);
- CALL_CopyConvolutionFilter1D(ctx->Exec,
- (target, internalFormat, x, y, width));
-}
-
-static void GLAPIENTRY
-exec_CopyConvolutionFilter2D(GLenum target, GLenum internalFormat,
- GLint x, GLint y, GLsizei width, GLsizei height)
-{
- GET_CURRENT_CONTEXT(ctx);
- FLUSH_VERTICES(ctx, 0);
- CALL_CopyConvolutionFilter2D(ctx->Exec,
- (target, internalFormat, x, y, width,
- height));
-}
-
-static void GLAPIENTRY
-exec_GetColorTable(GLenum target, GLenum format, GLenum type, GLvoid * data)
-{
- GET_CURRENT_CONTEXT(ctx);
- FLUSH_VERTICES(ctx, 0);
- CALL_GetColorTable(ctx->Exec, (target, format, type, data));
-}
-
-static void GLAPIENTRY
-exec_GetColorTableParameterfv(GLenum target, GLenum pname, GLfloat *params)
-{
- GET_CURRENT_CONTEXT(ctx);
- FLUSH_VERTICES(ctx, 0);
- CALL_GetColorTableParameterfv(ctx->Exec, (target, pname, params));
-}
-
-static void GLAPIENTRY
-exec_GetColorTableParameteriv(GLenum target, GLenum pname, GLint *params)
-{
- GET_CURRENT_CONTEXT(ctx);
- FLUSH_VERTICES(ctx, 0);
- CALL_GetColorTableParameteriv(ctx->Exec, (target, pname, params));
-}
-
-static void GLAPIENTRY
-exec_GetConvolutionFilter(GLenum target, GLenum format, GLenum type,
- GLvoid * image)
-{
- GET_CURRENT_CONTEXT(ctx);
- FLUSH_VERTICES(ctx, 0);
- CALL_GetConvolutionFilter(ctx->Exec, (target, format, type, image));
-}
-
-static void GLAPIENTRY
-exec_GetConvolutionParameterfv(GLenum target, GLenum pname, GLfloat *params)
-{
- GET_CURRENT_CONTEXT(ctx);
- FLUSH_VERTICES(ctx, 0);
- CALL_GetConvolutionParameterfv(ctx->Exec, (target, pname, params));
-}
-
-static void GLAPIENTRY
-exec_GetConvolutionParameteriv(GLenum target, GLenum pname, GLint *params)
-{
- GET_CURRENT_CONTEXT(ctx);
- FLUSH_VERTICES(ctx, 0);
- CALL_GetConvolutionParameteriv(ctx->Exec, (target, pname, params));
-}
-
-static void GLAPIENTRY
-exec_GetHistogram(GLenum target, GLboolean reset, GLenum format,
- GLenum type, GLvoid *values)
-{
- GET_CURRENT_CONTEXT(ctx);
- FLUSH_VERTICES(ctx, 0);
- CALL_GetHistogram(ctx->Exec, (target, reset, format, type, values));
-}
-
-static void GLAPIENTRY
-exec_GetHistogramParameterfv(GLenum target, GLenum pname, GLfloat *params)
-{
- GET_CURRENT_CONTEXT(ctx);
- FLUSH_VERTICES(ctx, 0);
- CALL_GetHistogramParameterfv(ctx->Exec, (target, pname, params));
-}
-
-static void GLAPIENTRY
-exec_GetHistogramParameteriv(GLenum target, GLenum pname, GLint *params)
-{
- GET_CURRENT_CONTEXT(ctx);
- FLUSH_VERTICES(ctx, 0);
- CALL_GetHistogramParameteriv(ctx->Exec, (target, pname, params));
-}
-
-static void GLAPIENTRY
-exec_GetMinmax(GLenum target, GLboolean reset, GLenum format,
- GLenum type, GLvoid *values)
-{
- GET_CURRENT_CONTEXT(ctx);
- FLUSH_VERTICES(ctx, 0);
- CALL_GetMinmax(ctx->Exec, (target, reset, format, type, values));
-}
-
-static void GLAPIENTRY
-exec_GetMinmaxParameterfv(GLenum target, GLenum pname, GLfloat *params)
-{
- GET_CURRENT_CONTEXT(ctx);
- FLUSH_VERTICES(ctx, 0);
- CALL_GetMinmaxParameterfv(ctx->Exec, (target, pname, params));
-}
-
-static void GLAPIENTRY
-exec_GetMinmaxParameteriv(GLenum target, GLenum pname, GLint *params)
-{
- GET_CURRENT_CONTEXT(ctx);
- FLUSH_VERTICES(ctx, 0);
- CALL_GetMinmaxParameteriv(ctx->Exec, (target, pname, params));
-}
-
-static void GLAPIENTRY
-exec_GetSeparableFilter(GLenum target, GLenum format, GLenum type,
- GLvoid *row, GLvoid *column, GLvoid *span)
-{
- GET_CURRENT_CONTEXT(ctx);
- FLUSH_VERTICES(ctx, 0);
- CALL_GetSeparableFilter(ctx->Exec,
- (target, format, type, row, column, span));
-}
-
-static void GLAPIENTRY
-exec_SeparableFilter2D(GLenum target, GLenum internalFormat,
- GLsizei width, GLsizei height, GLenum format,
- GLenum type, const GLvoid *row, const GLvoid *column)
-{
- GET_CURRENT_CONTEXT(ctx);
- FLUSH_VERTICES(ctx, 0);
- CALL_SeparableFilter2D(ctx->Exec,
- (target, internalFormat, width, height, format,
- type, row, column));
-}
-
-static void GLAPIENTRY
-exec_ColorPointerEXT(GLint size, GLenum type, GLsizei stride,
- GLsizei count, const GLvoid *ptr)
-{
- GET_CURRENT_CONTEXT(ctx);
- FLUSH_VERTICES(ctx, 0);
- CALL_ColorPointerEXT(ctx->Exec, (size, type, stride, count, ptr));
-}
-
-static void GLAPIENTRY
-exec_EdgeFlagPointerEXT(GLsizei stride, GLsizei count, const GLboolean *ptr)
-{
- GET_CURRENT_CONTEXT(ctx);
- FLUSH_VERTICES(ctx, 0);
- CALL_EdgeFlagPointerEXT(ctx->Exec, (stride, count, ptr));
-}
-
-static void GLAPIENTRY
-exec_IndexPointerEXT(GLenum type, GLsizei stride, GLsizei count,
- const GLvoid *ptr)
-{
- GET_CURRENT_CONTEXT(ctx);
- FLUSH_VERTICES(ctx, 0);
- CALL_IndexPointerEXT(ctx->Exec, (type, stride, count, ptr));
-}
-
-static void GLAPIENTRY
-exec_NormalPointerEXT(GLenum type, GLsizei stride, GLsizei count,
- const GLvoid *ptr)
-{
- GET_CURRENT_CONTEXT(ctx);
- FLUSH_VERTICES(ctx, 0);
- CALL_NormalPointerEXT(ctx->Exec, (type, stride, count, ptr));
-}
-
-static void GLAPIENTRY
-exec_TexCoordPointerEXT(GLint size, GLenum type, GLsizei stride,
- GLsizei count, const GLvoid *ptr)
-{
- GET_CURRENT_CONTEXT(ctx);
- FLUSH_VERTICES(ctx, 0);
- CALL_TexCoordPointerEXT(ctx->Exec, (size, type, stride, count, ptr));
-}
-
-static void GLAPIENTRY
-exec_VertexPointerEXT(GLint size, GLenum type, GLsizei stride,
- GLsizei count, const GLvoid *ptr)
-{
- GET_CURRENT_CONTEXT(ctx);
- FLUSH_VERTICES(ctx, 0);
- CALL_VertexPointerEXT(ctx->Exec, (size, type, stride, count, ptr));
-}
-
-static void GLAPIENTRY
-exec_LockArraysEXT(GLint first, GLsizei count)
-{
- GET_CURRENT_CONTEXT(ctx);
- FLUSH_VERTICES(ctx, 0);
- CALL_LockArraysEXT(ctx->Exec, (first, count));
-}
-
-static void GLAPIENTRY
-exec_UnlockArraysEXT(void)
-{
- GET_CURRENT_CONTEXT(ctx);
- FLUSH_VERTICES(ctx, 0);
- CALL_UnlockArraysEXT(ctx->Exec, ());
-}
-
-static void GLAPIENTRY
-exec_ClientActiveTextureARB(GLenum target)
-{
- GET_CURRENT_CONTEXT(ctx);
- FLUSH_VERTICES(ctx, 0);
- CALL_ClientActiveTextureARB(ctx->Exec, (target));
-}
-
-static void GLAPIENTRY
-exec_SecondaryColorPointerEXT(GLint size, GLenum type,
- GLsizei stride, const GLvoid *ptr)
-{
- GET_CURRENT_CONTEXT(ctx);
- FLUSH_VERTICES(ctx, 0);
- CALL_SecondaryColorPointerEXT(ctx->Exec, (size, type, stride, ptr));
-}
-
-static void GLAPIENTRY
-exec_FogCoordPointerEXT(GLenum type, GLsizei stride, const GLvoid *ptr)
-{
- GET_CURRENT_CONTEXT(ctx);
- FLUSH_VERTICES(ctx, 0);
- CALL_FogCoordPointerEXT(ctx->Exec, (type, stride, ptr));
-}
-
-/* GL_EXT_multi_draw_arrays */
-static void GLAPIENTRY
-exec_MultiDrawArraysEXT(GLenum mode, const GLint *first,
- const GLsizei *count, GLsizei primcount)
-{
- GET_CURRENT_CONTEXT(ctx);
- FLUSH_VERTICES(ctx, 0);
- CALL_MultiDrawArraysEXT(ctx->Exec, (mode, first, count, primcount));
-}
-
-/* GL_IBM_multimode_draw_arrays */
-static void GLAPIENTRY
-exec_MultiModeDrawArraysIBM(const GLenum * mode, const GLint * first,
- const GLsizei * count, GLsizei primcount,
- GLint modestride)
-{
- GET_CURRENT_CONTEXT(ctx);
- FLUSH_VERTICES(ctx, 0);
- CALL_MultiModeDrawArraysIBM(ctx->Exec,
- (mode, first, count, primcount, modestride));
-}
-
-/* GL_IBM_multimode_draw_arrays */
-static void GLAPIENTRY
-exec_MultiModeDrawElementsIBM(const GLenum * mode,
- const GLsizei * count,
- GLenum type,
- const GLvoid * const *indices,
- GLsizei primcount, GLint modestride)
-{
- GET_CURRENT_CONTEXT(ctx);
- FLUSH_VERTICES(ctx, 0);
- CALL_MultiModeDrawElementsIBM(ctx->Exec,
- (mode, count, type, indices, primcount,
- modestride));
-}
-
-
-
-/**
- * Setup the given dispatch table to point to Mesa's display list
- * building functions.
- *
- * This does not include any of the tnl functions - they are
- * initialized from _mesa_init_api_defaults and from the active vtxfmt
- * struct.
- */
-struct _glapi_table *
-_mesa_create_save_table(void)
-{
- struct _glapi_table *table;
-
- table = _mesa_alloc_dispatch_table(_gloffset_COUNT);
- if (table == NULL)
- return NULL;
-
- _mesa_loopback_init_api_table(table);
-
- /* GL 1.0 */
- SET_Accum(table, save_Accum);
- SET_AlphaFunc(table, save_AlphaFunc);
- SET_Bitmap(table, save_Bitmap);
- SET_BlendFunc(table, save_BlendFunc);
- SET_CallList(table, save_CallList);
- SET_CallLists(table, save_CallLists);
- SET_Clear(table, save_Clear);
- SET_ClearAccum(table, save_ClearAccum);
- SET_ClearColor(table, save_ClearColor);
- SET_ClearDepth(table, save_ClearDepth);
- SET_ClearIndex(table, save_ClearIndex);
- SET_ClearStencil(table, save_ClearStencil);
- SET_ClipPlane(table, save_ClipPlane);
- SET_ColorMask(table, save_ColorMask);
- SET_ColorMaskIndexedEXT(table, save_ColorMaskIndexed);
- SET_ColorMaterial(table, save_ColorMaterial);
- SET_CopyPixels(table, save_CopyPixels);
- SET_CullFace(table, save_CullFace);
- SET_DeleteLists(table, _mesa_DeleteLists);
- SET_DepthFunc(table, save_DepthFunc);
- SET_DepthMask(table, save_DepthMask);
- SET_DepthRange(table, save_DepthRange);
- SET_Disable(table, save_Disable);
- SET_DisableIndexedEXT(table, save_DisableIndexed);
- SET_DrawBuffer(table, save_DrawBuffer);
- SET_DrawPixels(table, save_DrawPixels);
- SET_Enable(table, save_Enable);
- SET_EnableIndexedEXT(table, save_EnableIndexed);
- SET_EndList(table, _mesa_EndList);
- SET_EvalMesh1(table, save_EvalMesh1);
- SET_EvalMesh2(table, save_EvalMesh2);
- SET_Finish(table, exec_Finish);
- SET_Flush(table, exec_Flush);
- SET_Fogf(table, save_Fogf);
- SET_Fogfv(table, save_Fogfv);
- SET_Fogi(table, save_Fogi);
- SET_Fogiv(table, save_Fogiv);
- SET_FrontFace(table, save_FrontFace);
- SET_Frustum(table, save_Frustum);
- SET_GenLists(table, _mesa_GenLists);
- SET_GetBooleanv(table, exec_GetBooleanv);
- SET_GetClipPlane(table, exec_GetClipPlane);
- SET_GetDoublev(table, exec_GetDoublev);
- SET_GetError(table, exec_GetError);
- SET_GetFloatv(table, exec_GetFloatv);
- SET_GetIntegerv(table, exec_GetIntegerv);
- SET_GetLightfv(table, exec_GetLightfv);
- SET_GetLightiv(table, exec_GetLightiv);
- SET_GetMapdv(table, exec_GetMapdv);
- SET_GetMapfv(table, exec_GetMapfv);
- SET_GetMapiv(table, exec_GetMapiv);
- SET_GetMaterialfv(table, exec_GetMaterialfv);
- SET_GetMaterialiv(table, exec_GetMaterialiv);
- SET_GetPixelMapfv(table, exec_GetPixelMapfv);
- SET_GetPixelMapuiv(table, exec_GetPixelMapuiv);
- SET_GetPixelMapusv(table, exec_GetPixelMapusv);
- SET_GetPolygonStipple(table, exec_GetPolygonStipple);
- SET_GetString(table, exec_GetString);
- SET_GetTexEnvfv(table, exec_GetTexEnvfv);
- SET_GetTexEnviv(table, exec_GetTexEnviv);
- SET_GetTexGendv(table, exec_GetTexGendv);
- SET_GetTexGenfv(table, exec_GetTexGenfv);
- SET_GetTexGeniv(table, exec_GetTexGeniv);
- SET_GetTexImage(table, exec_GetTexImage);
- SET_GetTexLevelParameterfv(table, exec_GetTexLevelParameterfv);
- SET_GetTexLevelParameteriv(table, exec_GetTexLevelParameteriv);
- SET_GetTexParameterfv(table, exec_GetTexParameterfv);
- SET_GetTexParameteriv(table, exec_GetTexParameteriv);
- SET_Hint(table, save_Hint);
- SET_IndexMask(table, save_IndexMask);
- SET_InitNames(table, save_InitNames);
- SET_IsEnabled(table, exec_IsEnabled);
- SET_IsList(table, _mesa_IsList);
- SET_LightModelf(table, save_LightModelf);
- SET_LightModelfv(table, save_LightModelfv);
- SET_LightModeli(table, save_LightModeli);
- SET_LightModeliv(table, save_LightModeliv);
- SET_Lightf(table, save_Lightf);
- SET_Lightfv(table, save_Lightfv);
- SET_Lighti(table, save_Lighti);
- SET_Lightiv(table, save_Lightiv);
- SET_LineStipple(table, save_LineStipple);
- SET_LineWidth(table, save_LineWidth);
- SET_ListBase(table, save_ListBase);
- SET_LoadIdentity(table, save_LoadIdentity);
- SET_LoadMatrixd(table, save_LoadMatrixd);
- SET_LoadMatrixf(table, save_LoadMatrixf);
- SET_LoadName(table, save_LoadName);
- SET_LogicOp(table, save_LogicOp);
- SET_Map1d(table, save_Map1d);
- SET_Map1f(table, save_Map1f);
- SET_Map2d(table, save_Map2d);
- SET_Map2f(table, save_Map2f);
- SET_MapGrid1d(table, save_MapGrid1d);
- SET_MapGrid1f(table, save_MapGrid1f);
- SET_MapGrid2d(table, save_MapGrid2d);
- SET_MapGrid2f(table, save_MapGrid2f);
- SET_MatrixMode(table, save_MatrixMode);
- SET_MultMatrixd(table, save_MultMatrixd);
- SET_MultMatrixf(table, save_MultMatrixf);
- SET_NewList(table, save_NewList);
- SET_Ortho(table, save_Ortho);
- SET_PassThrough(table, save_PassThrough);
- SET_PixelMapfv(table, save_PixelMapfv);
- SET_PixelMapuiv(table, save_PixelMapuiv);
- SET_PixelMapusv(table, save_PixelMapusv);
- SET_PixelStoref(table, exec_PixelStoref);
- SET_PixelStorei(table, exec_PixelStorei);
- SET_PixelTransferf(table, save_PixelTransferf);
- SET_PixelTransferi(table, save_PixelTransferi);
- SET_PixelZoom(table, save_PixelZoom);
- SET_PointSize(table, save_PointSize);
- SET_PolygonMode(table, save_PolygonMode);
- SET_PolygonOffset(table, save_PolygonOffset);
- SET_PolygonStipple(table, save_PolygonStipple);
- SET_PopAttrib(table, save_PopAttrib);
- SET_PopMatrix(table, save_PopMatrix);
- SET_PopName(table, save_PopName);
- SET_PushAttrib(table, save_PushAttrib);
- SET_PushMatrix(table, save_PushMatrix);
- SET_PushName(table, save_PushName);
- SET_RasterPos2d(table, save_RasterPos2d);
- SET_RasterPos2dv(table, save_RasterPos2dv);
- SET_RasterPos2f(table, save_RasterPos2f);
- SET_RasterPos2fv(table, save_RasterPos2fv);
- SET_RasterPos2i(table, save_RasterPos2i);
- SET_RasterPos2iv(table, save_RasterPos2iv);
- SET_RasterPos2s(table, save_RasterPos2s);
- SET_RasterPos2sv(table, save_RasterPos2sv);
- SET_RasterPos3d(table, save_RasterPos3d);
- SET_RasterPos3dv(table, save_RasterPos3dv);
- SET_RasterPos3f(table, save_RasterPos3f);
- SET_RasterPos3fv(table, save_RasterPos3fv);
- SET_RasterPos3i(table, save_RasterPos3i);
- SET_RasterPos3iv(table, save_RasterPos3iv);
- SET_RasterPos3s(table, save_RasterPos3s);
- SET_RasterPos3sv(table, save_RasterPos3sv);
- SET_RasterPos4d(table, save_RasterPos4d);
- SET_RasterPos4dv(table, save_RasterPos4dv);
- SET_RasterPos4f(table, save_RasterPos4f);
- SET_RasterPos4fv(table, save_RasterPos4fv);
- SET_RasterPos4i(table, save_RasterPos4i);
- SET_RasterPos4iv(table, save_RasterPos4iv);
- SET_RasterPos4s(table, save_RasterPos4s);
- SET_RasterPos4sv(table, save_RasterPos4sv);
- SET_ReadBuffer(table, save_ReadBuffer);
- SET_ReadPixels(table, exec_ReadPixels);
- SET_RenderMode(table, exec_RenderMode);
- SET_Rotated(table, save_Rotated);
- SET_Rotatef(table, save_Rotatef);
- SET_Scaled(table, save_Scaled);
- SET_Scalef(table, save_Scalef);
- SET_Scissor(table, save_Scissor);
- SET_FeedbackBuffer(table, exec_FeedbackBuffer);
- SET_SelectBuffer(table, exec_SelectBuffer);
- SET_ShadeModel(table, save_ShadeModel);
- SET_StencilFunc(table, save_StencilFunc);
- SET_StencilMask(table, save_StencilMask);
- SET_StencilOp(table, save_StencilOp);
- SET_TexEnvf(table, save_TexEnvf);
- SET_TexEnvfv(table, save_TexEnvfv);
- SET_TexEnvi(table, save_TexEnvi);
- SET_TexEnviv(table, save_TexEnviv);
- SET_TexGend(table, save_TexGend);
- SET_TexGendv(table, save_TexGendv);
- SET_TexGenf(table, save_TexGenf);
- SET_TexGenfv(table, save_TexGenfv);
- SET_TexGeni(table, save_TexGeni);
- SET_TexGeniv(table, save_TexGeniv);
- SET_TexImage1D(table, save_TexImage1D);
- SET_TexImage2D(table, save_TexImage2D);
- SET_TexParameterf(table, save_TexParameterf);
- SET_TexParameterfv(table, save_TexParameterfv);
- SET_TexParameteri(table, save_TexParameteri);
- SET_TexParameteriv(table, save_TexParameteriv);
- SET_Translated(table, save_Translated);
- SET_Translatef(table, save_Translatef);
- SET_Viewport(table, save_Viewport);
-
- /* GL 1.1 */
- SET_AreTexturesResident(table, exec_AreTexturesResident);
- SET_BindTexture(table, save_BindTexture);
- SET_ColorPointer(table, exec_ColorPointer);
- SET_CopyTexImage1D(table, save_CopyTexImage1D);
- SET_CopyTexImage2D(table, save_CopyTexImage2D);
- SET_CopyTexSubImage1D(table, save_CopyTexSubImage1D);
- SET_CopyTexSubImage2D(table, save_CopyTexSubImage2D);
- SET_DeleteTextures(table, exec_DeleteTextures);
- SET_DisableClientState(table, exec_DisableClientState);
- SET_EdgeFlagPointer(table, exec_EdgeFlagPointer);
- SET_EnableClientState(table, exec_EnableClientState);
- SET_GenTextures(table, exec_GenTextures);
- SET_GetPointerv(table, exec_GetPointerv);
- SET_IndexPointer(table, exec_IndexPointer);
- SET_InterleavedArrays(table, exec_InterleavedArrays);
- SET_IsTexture(table, exec_IsTexture);
- SET_NormalPointer(table, exec_NormalPointer);
- SET_PopClientAttrib(table, exec_PopClientAttrib);
- SET_PrioritizeTextures(table, save_PrioritizeTextures);
- SET_PushClientAttrib(table, exec_PushClientAttrib);
- SET_TexCoordPointer(table, exec_TexCoordPointer);
- SET_TexSubImage1D(table, save_TexSubImage1D);
- SET_TexSubImage2D(table, save_TexSubImage2D);
- SET_VertexPointer(table, exec_VertexPointer);
-
- /* GL 1.2 */
- SET_CopyTexSubImage3D(table, save_CopyTexSubImage3D);
- SET_TexImage3D(table, save_TexImage3D);
- SET_TexSubImage3D(table, save_TexSubImage3D);
-
- /* GL 2.0 */
- SET_StencilFuncSeparate(table, save_StencilFuncSeparate);
- SET_StencilMaskSeparate(table, save_StencilMaskSeparate);
- SET_StencilOpSeparate(table, save_StencilOpSeparate);
-
- /* ATI_separate_stencil */
- SET_StencilFuncSeparateATI(table, save_StencilFuncSeparateATI);
-
- /* GL_ARB_imaging */
- /* Not all are supported */
- SET_BlendColor(table, save_BlendColor);
- SET_BlendEquation(table, save_BlendEquation);
- SET_ColorSubTable(table, save_ColorSubTable);
- SET_ColorTable(table, save_ColorTable);
- SET_ColorTableParameterfv(table, save_ColorTableParameterfv);
- SET_ColorTableParameteriv(table, save_ColorTableParameteriv);
- SET_ConvolutionFilter1D(table, save_ConvolutionFilter1D);
- SET_ConvolutionFilter2D(table, save_ConvolutionFilter2D);
- SET_ConvolutionParameterf(table, save_ConvolutionParameterf);
- SET_ConvolutionParameterfv(table, save_ConvolutionParameterfv);
- SET_ConvolutionParameteri(table, save_ConvolutionParameteri);
- SET_ConvolutionParameteriv(table, save_ConvolutionParameteriv);
- SET_CopyColorSubTable(table, save_CopyColorSubTable);
- SET_CopyColorTable(table, save_CopyColorTable);
- SET_CopyConvolutionFilter1D(table, exec_CopyConvolutionFilter1D);
- SET_CopyConvolutionFilter2D(table, exec_CopyConvolutionFilter2D);
- SET_GetColorTable(table, exec_GetColorTable);
- SET_GetColorTableParameterfv(table, exec_GetColorTableParameterfv);
- SET_GetColorTableParameteriv(table, exec_GetColorTableParameteriv);
- SET_GetConvolutionFilter(table, exec_GetConvolutionFilter);
- SET_GetConvolutionParameterfv(table, exec_GetConvolutionParameterfv);
- SET_GetConvolutionParameteriv(table, exec_GetConvolutionParameteriv);
- SET_GetHistogram(table, exec_GetHistogram);
- SET_GetHistogramParameterfv(table, exec_GetHistogramParameterfv);
- SET_GetHistogramParameteriv(table, exec_GetHistogramParameteriv);
- SET_GetMinmax(table, exec_GetMinmax);
- SET_GetMinmaxParameterfv(table, exec_GetMinmaxParameterfv);
- SET_GetMinmaxParameteriv(table, exec_GetMinmaxParameteriv);
- SET_GetSeparableFilter(table, exec_GetSeparableFilter);
- SET_Histogram(table, save_Histogram);
- SET_Minmax(table, save_Minmax);
- SET_ResetHistogram(table, save_ResetHistogram);
- SET_ResetMinmax(table, save_ResetMinmax);
- SET_SeparableFilter2D(table, exec_SeparableFilter2D);
-
- /* 2. GL_EXT_blend_color */
-#if 0
- SET_BlendColorEXT(table, save_BlendColorEXT);
-#endif
-
- /* 3. GL_EXT_polygon_offset */
- SET_PolygonOffsetEXT(table, save_PolygonOffsetEXT);
-
- /* 6. GL_EXT_texture3d */
-#if 0
- SET_CopyTexSubImage3DEXT(table, save_CopyTexSubImage3D);
- SET_TexImage3DEXT(table, save_TexImage3DEXT);
- SET_TexSubImage3DEXT(table, save_TexSubImage3D);
-#endif
-
- /* 14. GL_SGI_color_table */
-#if 0
- SET_ColorTableSGI(table, save_ColorTable);
- SET_ColorSubTableSGI(table, save_ColorSubTable);
- SET_GetColorTableSGI(table, exec_GetColorTable);
- SET_GetColorTableParameterfvSGI(table, exec_GetColorTableParameterfv);
- SET_GetColorTableParameterivSGI(table, exec_GetColorTableParameteriv);
-#endif
-
- /* 30. GL_EXT_vertex_array */
- SET_ColorPointerEXT(table, exec_ColorPointerEXT);
- SET_EdgeFlagPointerEXT(table, exec_EdgeFlagPointerEXT);
- SET_IndexPointerEXT(table, exec_IndexPointerEXT);
- SET_NormalPointerEXT(table, exec_NormalPointerEXT);
- SET_TexCoordPointerEXT(table, exec_TexCoordPointerEXT);
- SET_VertexPointerEXT(table, exec_VertexPointerEXT);
-
- /* 37. GL_EXT_blend_minmax */
-#if 0
- SET_BlendEquationEXT(table, save_BlendEquationEXT);
-#endif
-
- /* 54. GL_EXT_point_parameters */
- SET_PointParameterfEXT(table, save_PointParameterfEXT);
- SET_PointParameterfvEXT(table, save_PointParameterfvEXT);
-
- /* 97. GL_EXT_compiled_vertex_array */
- SET_LockArraysEXT(table, exec_LockArraysEXT);
- SET_UnlockArraysEXT(table, exec_UnlockArraysEXT);
-
- /* 145. GL_EXT_secondary_color */
- SET_SecondaryColorPointerEXT(table, exec_SecondaryColorPointerEXT);
-
- /* 148. GL_EXT_multi_draw_arrays */
- SET_MultiDrawArraysEXT(table, exec_MultiDrawArraysEXT);
-
- /* 149. GL_EXT_fog_coord */
- SET_FogCoordPointerEXT(table, exec_FogCoordPointerEXT);
-
- /* 173. GL_EXT_blend_func_separate */
- SET_BlendFuncSeparateEXT(table, save_BlendFuncSeparateEXT);
-
- /* 196. GL_MESA_resize_buffers */
- SET_ResizeBuffersMESA(table, _mesa_ResizeBuffersMESA);
-
- /* 197. GL_MESA_window_pos */
- SET_WindowPos2dMESA(table, save_WindowPos2dMESA);
- SET_WindowPos2dvMESA(table, save_WindowPos2dvMESA);
- SET_WindowPos2fMESA(table, save_WindowPos2fMESA);
- SET_WindowPos2fvMESA(table, save_WindowPos2fvMESA);
- SET_WindowPos2iMESA(table, save_WindowPos2iMESA);
- SET_WindowPos2ivMESA(table, save_WindowPos2ivMESA);
- SET_WindowPos2sMESA(table, save_WindowPos2sMESA);
- SET_WindowPos2svMESA(table, save_WindowPos2svMESA);
- SET_WindowPos3dMESA(table, save_WindowPos3dMESA);
- SET_WindowPos3dvMESA(table, save_WindowPos3dvMESA);
- SET_WindowPos3fMESA(table, save_WindowPos3fMESA);
- SET_WindowPos3fvMESA(table, save_WindowPos3fvMESA);
- SET_WindowPos3iMESA(table, save_WindowPos3iMESA);
- SET_WindowPos3ivMESA(table, save_WindowPos3ivMESA);
- SET_WindowPos3sMESA(table, save_WindowPos3sMESA);
- SET_WindowPos3svMESA(table, save_WindowPos3svMESA);
- SET_WindowPos4dMESA(table, save_WindowPos4dMESA);
- SET_WindowPos4dvMESA(table, save_WindowPos4dvMESA);
- SET_WindowPos4fMESA(table, save_WindowPos4fMESA);
- SET_WindowPos4fvMESA(table, save_WindowPos4fvMESA);
- SET_WindowPos4iMESA(table, save_WindowPos4iMESA);
- SET_WindowPos4ivMESA(table, save_WindowPos4ivMESA);
- SET_WindowPos4sMESA(table, save_WindowPos4sMESA);
- SET_WindowPos4svMESA(table, save_WindowPos4svMESA);
-
- /* 200. GL_IBM_multimode_draw_arrays */
- SET_MultiModeDrawArraysIBM(table, exec_MultiModeDrawArraysIBM);
- SET_MultiModeDrawElementsIBM(table, exec_MultiModeDrawElementsIBM);
-
-#if FEATURE_NV_vertex_program
- /* 233. GL_NV_vertex_program */
- /* The following commands DO NOT go into display lists:
- * AreProgramsResidentNV, IsProgramNV, GenProgramsNV, DeleteProgramsNV,
- * VertexAttribPointerNV, GetProgram*, GetVertexAttrib*
- */
- SET_BindProgramNV(table, save_BindProgramNV);
- SET_DeleteProgramsNV(table, _mesa_DeletePrograms);
- SET_ExecuteProgramNV(table, save_ExecuteProgramNV);
- SET_GenProgramsNV(table, _mesa_GenPrograms);
- SET_AreProgramsResidentNV(table, _mesa_AreProgramsResidentNV);
- SET_RequestResidentProgramsNV(table, save_RequestResidentProgramsNV);
- SET_GetProgramParameterfvNV(table, _mesa_GetProgramParameterfvNV);
- SET_GetProgramParameterdvNV(table, _mesa_GetProgramParameterdvNV);
- SET_GetProgramivNV(table, _mesa_GetProgramivNV);
- SET_GetProgramStringNV(table, _mesa_GetProgramStringNV);
- SET_GetTrackMatrixivNV(table, _mesa_GetTrackMatrixivNV);
- SET_GetVertexAttribdvNV(table, _mesa_GetVertexAttribdvNV);
- SET_GetVertexAttribfvNV(table, _mesa_GetVertexAttribfvNV);
- SET_GetVertexAttribivNV(table, _mesa_GetVertexAttribivNV);
- SET_GetVertexAttribPointervNV(table, _mesa_GetVertexAttribPointervNV);
- SET_IsProgramNV(table, _mesa_IsProgramARB);
- SET_LoadProgramNV(table, save_LoadProgramNV);
- SET_ProgramEnvParameter4dARB(table, save_ProgramEnvParameter4dARB);
- SET_ProgramEnvParameter4dvARB(table, save_ProgramEnvParameter4dvARB);
- SET_ProgramEnvParameter4fARB(table, save_ProgramEnvParameter4fARB);
- SET_ProgramEnvParameter4fvARB(table, save_ProgramEnvParameter4fvARB);
- SET_ProgramParameters4dvNV(table, save_ProgramParameters4dvNV);
- SET_ProgramParameters4fvNV(table, save_ProgramParameters4fvNV);
- SET_TrackMatrixNV(table, save_TrackMatrixNV);
- SET_VertexAttribPointerNV(table, _mesa_VertexAttribPointerNV);
-#endif
-
- /* 244. GL_ATI_envmap_bumpmap */
- SET_TexBumpParameterivATI(table, save_TexBumpParameterivATI);
- SET_TexBumpParameterfvATI(table, save_TexBumpParameterfvATI);
-
- /* 245. GL_ATI_fragment_shader */
-#if FEATURE_ATI_fragment_shader
- SET_BindFragmentShaderATI(table, save_BindFragmentShaderATI);
- SET_SetFragmentShaderConstantATI(table, save_SetFragmentShaderConstantATI);
-#endif
-
- /* 282. GL_NV_fragment_program */
-#if FEATURE_NV_fragment_program
- SET_ProgramNamedParameter4fNV(table, save_ProgramNamedParameter4fNV);
- SET_ProgramNamedParameter4dNV(table, save_ProgramNamedParameter4dNV);
- SET_ProgramNamedParameter4fvNV(table, save_ProgramNamedParameter4fvNV);
- SET_ProgramNamedParameter4dvNV(table, save_ProgramNamedParameter4dvNV);
- SET_GetProgramNamedParameterfvNV(table,
- _mesa_GetProgramNamedParameterfvNV);
- SET_GetProgramNamedParameterdvNV(table,
- _mesa_GetProgramNamedParameterdvNV);
- SET_ProgramLocalParameter4dARB(table, save_ProgramLocalParameter4dARB);
- SET_ProgramLocalParameter4dvARB(table, save_ProgramLocalParameter4dvARB);
- SET_ProgramLocalParameter4fARB(table, save_ProgramLocalParameter4fARB);
- SET_ProgramLocalParameter4fvARB(table, save_ProgramLocalParameter4fvARB);
- SET_GetProgramLocalParameterdvARB(table,
- _mesa_GetProgramLocalParameterdvARB);
- SET_GetProgramLocalParameterfvARB(table,
- _mesa_GetProgramLocalParameterfvARB);
-#endif
-
- /* 262. GL_NV_point_sprite */
- SET_PointParameteriNV(table, save_PointParameteriNV);
- SET_PointParameterivNV(table, save_PointParameterivNV);
-
- /* 268. GL_EXT_stencil_two_side */
- SET_ActiveStencilFaceEXT(table, save_ActiveStencilFaceEXT);
-
- /* 273. GL_APPLE_vertex_array_object */
- SET_BindVertexArrayAPPLE(table, _mesa_BindVertexArrayAPPLE);
- SET_DeleteVertexArraysAPPLE(table, _mesa_DeleteVertexArraysAPPLE);
- SET_GenVertexArraysAPPLE(table, _mesa_GenVertexArraysAPPLE);
- SET_IsVertexArrayAPPLE(table, _mesa_IsVertexArrayAPPLE);
-
- /* ???. GL_EXT_depth_bounds_test */
- SET_DepthBoundsEXT(table, save_DepthBoundsEXT);
-
- /* ARB 1. GL_ARB_multitexture */
- SET_ActiveTextureARB(table, save_ActiveTextureARB);
- SET_ClientActiveTextureARB(table, exec_ClientActiveTextureARB);
-
- /* ARB 3. GL_ARB_transpose_matrix */
- SET_LoadTransposeMatrixdARB(table, save_LoadTransposeMatrixdARB);
- SET_LoadTransposeMatrixfARB(table, save_LoadTransposeMatrixfARB);
- SET_MultTransposeMatrixdARB(table, save_MultTransposeMatrixdARB);
- SET_MultTransposeMatrixfARB(table, save_MultTransposeMatrixfARB);
-
- /* ARB 5. GL_ARB_multisample */
- SET_SampleCoverageARB(table, save_SampleCoverageARB);
-
- /* ARB 12. GL_ARB_texture_compression */
- SET_CompressedTexImage3DARB(table, save_CompressedTexImage3DARB);
- SET_CompressedTexImage2DARB(table, save_CompressedTexImage2DARB);
- SET_CompressedTexImage1DARB(table, save_CompressedTexImage1DARB);
- SET_CompressedTexSubImage3DARB(table, save_CompressedTexSubImage3DARB);
- SET_CompressedTexSubImage2DARB(table, save_CompressedTexSubImage2DARB);
- SET_CompressedTexSubImage1DARB(table, save_CompressedTexSubImage1DARB);
- SET_GetCompressedTexImageARB(table, exec_GetCompressedTexImageARB);
-
- /* ARB 14. GL_ARB_point_parameters */
- /* aliased with EXT_point_parameters functions */
-
- /* ARB 25. GL_ARB_window_pos */
- /* aliased with MESA_window_pos functions */
-
- /* ARB 26. GL_ARB_vertex_program */
- /* ARB 27. GL_ARB_fragment_program */
-#if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
- /* glVertexAttrib* functions alias the NV ones, handled elsewhere */
- SET_VertexAttribPointerARB(table, _mesa_VertexAttribPointerARB);
- SET_EnableVertexAttribArrayARB(table, _mesa_EnableVertexAttribArrayARB);
- SET_DisableVertexAttribArrayARB(table, _mesa_DisableVertexAttribArrayARB);
- SET_ProgramStringARB(table, save_ProgramStringARB);
- SET_BindProgramNV(table, save_BindProgramNV);
- SET_DeleteProgramsNV(table, _mesa_DeletePrograms);
- SET_GenProgramsNV(table, _mesa_GenPrograms);
- SET_IsProgramNV(table, _mesa_IsProgramARB);
- SET_GetVertexAttribdvARB(table, _mesa_GetVertexAttribdvARB);
- SET_GetVertexAttribfvARB(table, _mesa_GetVertexAttribfvARB);
- SET_GetVertexAttribivARB(table, _mesa_GetVertexAttribivARB);
- SET_GetVertexAttribPointervNV(table, _mesa_GetVertexAttribPointervNV);
- SET_ProgramEnvParameter4dARB(table, save_ProgramEnvParameter4dARB);
- SET_ProgramEnvParameter4dvARB(table, save_ProgramEnvParameter4dvARB);
- SET_ProgramEnvParameter4fARB(table, save_ProgramEnvParameter4fARB);
- SET_ProgramEnvParameter4fvARB(table, save_ProgramEnvParameter4fvARB);
- SET_ProgramLocalParameter4dARB(table, save_ProgramLocalParameter4dARB);
- SET_ProgramLocalParameter4dvARB(table, save_ProgramLocalParameter4dvARB);
- SET_ProgramLocalParameter4fARB(table, save_ProgramLocalParameter4fARB);
- SET_ProgramLocalParameter4fvARB(table, save_ProgramLocalParameter4fvARB);
- SET_GetProgramEnvParameterdvARB(table, _mesa_GetProgramEnvParameterdvARB);
- SET_GetProgramEnvParameterfvARB(table, _mesa_GetProgramEnvParameterfvARB);
- SET_GetProgramLocalParameterdvARB(table,
- _mesa_GetProgramLocalParameterdvARB);
- SET_GetProgramLocalParameterfvARB(table,
- _mesa_GetProgramLocalParameterfvARB);
- SET_GetProgramivARB(table, _mesa_GetProgramivARB);
- SET_GetProgramStringARB(table, _mesa_GetProgramStringARB);
-#endif
-
- /* ARB 28. GL_ARB_vertex_buffer_object */
-#if FEATURE_ARB_vertex_buffer_object
- /* None of the extension's functions get compiled */
- SET_BindBufferARB(table, _mesa_BindBufferARB);
- SET_BufferDataARB(table, _mesa_BufferDataARB);
- SET_BufferSubDataARB(table, _mesa_BufferSubDataARB);
- SET_DeleteBuffersARB(table, _mesa_DeleteBuffersARB);
- SET_GenBuffersARB(table, _mesa_GenBuffersARB);
- SET_GetBufferParameterivARB(table, _mesa_GetBufferParameterivARB);
- SET_GetBufferPointervARB(table, _mesa_GetBufferPointervARB);
- SET_GetBufferSubDataARB(table, _mesa_GetBufferSubDataARB);
- SET_IsBufferARB(table, _mesa_IsBufferARB);
- SET_MapBufferARB(table, _mesa_MapBufferARB);
- SET_UnmapBufferARB(table, _mesa_UnmapBufferARB);
-#endif
-
-#if FEATURE_queryobj
- SET_BeginQueryARB(table, save_BeginQueryARB);
- SET_EndQueryARB(table, save_EndQueryARB);
- SET_GenQueriesARB(table, _mesa_GenQueriesARB);
- SET_DeleteQueriesARB(table, _mesa_DeleteQueriesARB);
- SET_IsQueryARB(table, _mesa_IsQueryARB);
- SET_GetQueryivARB(table, _mesa_GetQueryivARB);
- SET_GetQueryObjectivARB(table, _mesa_GetQueryObjectivARB);
- SET_GetQueryObjectuivARB(table, _mesa_GetQueryObjectuivARB);
-#endif
- SET_DrawBuffersARB(table, save_DrawBuffersARB);
-
-#if FEATURE_EXT_framebuffer_blit
- SET_BlitFramebufferEXT(table, save_BlitFramebufferEXT);
-#endif
-
- /* GL_ARB_shader_objects */
- SET_UseProgramObjectARB(table, save_UseProgramObjectARB);
- SET_Uniform1fARB(table, save_Uniform1fARB);
- SET_Uniform2fARB(table, save_Uniform2fARB);
- SET_Uniform3fARB(table, save_Uniform3fARB);
- SET_Uniform4fARB(table, save_Uniform4fARB);
- SET_Uniform1fvARB(table, save_Uniform1fvARB);
- SET_Uniform2fvARB(table, save_Uniform2fvARB);
- SET_Uniform3fvARB(table, save_Uniform3fvARB);
- SET_Uniform4fvARB(table, save_Uniform4fvARB);
- SET_Uniform1iARB(table, save_Uniform1iARB);
- SET_Uniform2iARB(table, save_Uniform2iARB);
- SET_Uniform3iARB(table, save_Uniform3iARB);
- SET_Uniform4iARB(table, save_Uniform4iARB);
- SET_Uniform1ivARB(table, save_Uniform1ivARB);
- SET_Uniform2ivARB(table, save_Uniform2ivARB);
- SET_Uniform3ivARB(table, save_Uniform3ivARB);
- SET_Uniform4ivARB(table, save_Uniform4ivARB);
- SET_UniformMatrix2fvARB(table, save_UniformMatrix2fvARB);
- SET_UniformMatrix3fvARB(table, save_UniformMatrix3fvARB);
- SET_UniformMatrix4fvARB(table, save_UniformMatrix4fvARB);
- SET_UniformMatrix2x3fv(table, save_UniformMatrix2x3fv);
- SET_UniformMatrix3x2fv(table, save_UniformMatrix3x2fv);
- SET_UniformMatrix2x4fv(table, save_UniformMatrix2x4fv);
- SET_UniformMatrix4x2fv(table, save_UniformMatrix4x2fv);
- SET_UniformMatrix3x4fv(table, save_UniformMatrix3x4fv);
- SET_UniformMatrix4x3fv(table, save_UniformMatrix4x3fv);
-
- /* ARB 30/31/32. GL_ARB_shader_objects, GL_ARB_vertex/fragment_shader */
- SET_BindAttribLocationARB(table, exec_BindAttribLocationARB);
- SET_GetAttribLocationARB(table, exec_GetAttribLocationARB);
- SET_GetUniformLocationARB(table, exec_GetUniformLocationARB);
- /* XXX additional functions need to be implemented here! */
-
- /* 299. GL_EXT_blend_equation_separate */
- SET_BlendEquationSeparateEXT(table, save_BlendEquationSeparateEXT);
-
- /* GL_EXT_gpu_program_parameters */
-#if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
- SET_ProgramEnvParameters4fvEXT(table, save_ProgramEnvParameters4fvEXT);
- SET_ProgramLocalParameters4fvEXT(table, save_ProgramLocalParameters4fvEXT);
-#endif
-
- /* ARB 50. GL_ARB_map_buffer_range */
-#if FEATURE_ARB_map_buffer_range
- SET_MapBufferRange(table, _mesa_MapBufferRange); /* no dlist save */
- SET_FlushMappedBufferRange(table, _mesa_FlushMappedBufferRange); /* no dl */
-#endif
-
- /* ARB 59. GL_ARB_copy_buffer */
- SET_CopyBufferSubData(table, _mesa_CopyBufferSubData); /* no dlist save */
-
- /* 352. GL_EXT_transform_feedback */
-#if FEATURE_EXT_transform_feedback
- SET_BeginTransformFeedbackEXT(table, save_BeginTransformFeedback);
- SET_EndTransformFeedbackEXT(table, save_EndTransformFeedback);
-#endif
-
- /* 364. GL_EXT_provoking_vertex */
- SET_ProvokingVertexEXT(table, save_ProvokingVertexEXT);
-
- /* 371. GL_APPLE_object_purgeable */
-#if FEATURE_APPLE_object_purgeable
- SET_ObjectPurgeableAPPLE(table, _mesa_ObjectPurgeableAPPLE);
- SET_ObjectUnpurgeableAPPLE(table, _mesa_ObjectUnpurgeableAPPLE);
-#endif
-
- /* GL_EXT_texture_integer */
- SET_ClearColorIiEXT(table, save_ClearColorIi);
- SET_ClearColorIuiEXT(table, save_ClearColorIui);
- SET_TexParameterIivEXT(table, save_TexParameterIiv);
- SET_TexParameterIuivEXT(table, save_TexParameterIuiv);
- SET_GetTexParameterIivEXT(table, exec_GetTexParameterIiv);
- SET_GetTexParameterIuivEXT(table, exec_GetTexParameterIuiv);
-
- /* 377. GL_EXT_separate_shader_objects */
- SET_UseShaderProgramEXT(table, save_UseShaderProgramEXT);
- SET_ActiveProgramEXT(table, save_ActiveProgramEXT);
-
- /* GL_ARB_color_buffer_float */
- SET_ClampColorARB(table, save_ClampColorARB);
- SET_ClampColor(table, save_ClampColorARB);
-
- /* GL 3.0 */
-#if 0
- SET_ClearBufferiv(table, save_ClearBufferiv);
- SET_ClearBufferuiv(table, save_ClearBufferuiv);
- SET_ClearBufferfv(table, save_ClearBufferfv);
- SET_ClearBufferfi(table, save_ClearBufferfi);
- SET_Uniform1ui(table, save_Uniform1ui);
- SET_Uniform2ui(table, save_Uniform2ui);
- SET_Uniform3ui(table, save_Uniform3ui);
- SET_Uniform4ui(table, save_Uniform4ui);
- SET_Uniform1uiv(table, save_Uniform1uiv);
- SET_Uniform2uiv(table, save_Uniform2uiv);
- SET_Uniform3uiv(table, save_Uniform3uiv);
- SET_Uniform4uiv(table, save_Uniform4uiv);
-#else
- (void) save_ClearBufferiv;
- (void) save_ClearBufferuiv;
- (void) save_ClearBufferfv;
- (void) save_ClearBufferfi;
- (void) save_Uniform1ui;
- (void) save_Uniform2ui;
- (void) save_Uniform3ui;
- (void) save_Uniform4ui;
- (void) save_Uniform1uiv;
- (void) save_Uniform2uiv;
- (void) save_Uniform3uiv;
- (void) save_Uniform4uiv;
-#endif
-
- /* GL_ARB_instanced_arrays */
- SET_VertexAttribDivisorARB(table, save_VertexAttribDivisor);
-
- /* GL_NV_texture_barrier */
- SET_TextureBarrierNV(table, save_TextureBarrierNV);
-
- /* GL_ARB_sampler_objects */
- SET_BindSampler(table, save_BindSampler);
-
- /* GL_ARB_draw_buffer_blend */
- SET_BlendFunciARB(table, save_BlendFunci);
- SET_BlendFuncSeparateiARB(table, save_BlendFuncSeparatei);
- SET_BlendEquationiARB(table, save_BlendEquationi);
- SET_BlendEquationSeparateiARB(table, save_BlendEquationSeparatei);
-
- return table;
-}
-
-
-
-static const char *
-enum_string(GLenum k)
-{
- return _mesa_lookup_enum_by_nr(k);
-}
-
-
-/**
- * Print the commands in a display list. For debugging only.
- * TODO: many commands aren't handled yet.
- */
-static void GLAPIENTRY
-print_list(struct gl_context *ctx, GLuint list)
-{
- struct gl_display_list *dlist;
- Node *n;
- GLboolean done;
-
- if (!islist(ctx, list)) {
- printf("%u is not a display list ID\n", list);
- return;
- }
-
- dlist = lookup_list(ctx, list);
- if (!dlist)
- return;
-
- n = dlist->Head;
-
- printf("START-LIST %u, address %p\n", list, (void *) n);
-
- done = n ? GL_FALSE : GL_TRUE;
- while (!done) {
- const OpCode opcode = n[0].opcode;
-
- if (is_ext_opcode(opcode)) {
- n += ext_opcode_print(ctx, n);
- }
- else {
- switch (opcode) {
- case OPCODE_ACCUM:
- printf("Accum %s %g\n", enum_string(n[1].e), n[2].f);
- break;
- case OPCODE_BITMAP:
- printf("Bitmap %d %d %g %g %g %g %p\n", n[1].i, n[2].i,
- n[3].f, n[4].f, n[5].f, n[6].f, (void *) n[7].data);
- break;
- case OPCODE_CALL_LIST:
- printf("CallList %d\n", (int) n[1].ui);
- break;
- case OPCODE_CALL_LIST_OFFSET:
- printf("CallList %d + offset %u = %u\n", (int) n[1].ui,
- ctx->List.ListBase, ctx->List.ListBase + n[1].ui);
- break;
- case OPCODE_COLOR_TABLE_PARAMETER_FV:
- printf("ColorTableParameterfv %s %s %f %f %f %f\n",
- enum_string(n[1].e), enum_string(n[2].e),
- n[3].f, n[4].f, n[5].f, n[6].f);
- break;
- case OPCODE_COLOR_TABLE_PARAMETER_IV:
- printf("ColorTableParameteriv %s %s %d %d %d %d\n",
- enum_string(n[1].e), enum_string(n[2].e),
- n[3].i, n[4].i, n[5].i, n[6].i);
- break;
- case OPCODE_DISABLE:
- printf("Disable %s\n", enum_string(n[1].e));
- break;
- case OPCODE_ENABLE:
- printf("Enable %s\n", enum_string(n[1].e));
- break;
- case OPCODE_FRUSTUM:
- printf("Frustum %g %g %g %g %g %g\n",
- n[1].f, n[2].f, n[3].f, n[4].f, n[5].f, n[6].f);
- break;
- case OPCODE_LINE_STIPPLE:
- printf("LineStipple %d %x\n", n[1].i, (int) n[2].us);
- break;
- case OPCODE_LOAD_IDENTITY:
- printf("LoadIdentity\n");
- break;
- case OPCODE_LOAD_MATRIX:
- printf("LoadMatrix\n");
- printf(" %8f %8f %8f %8f\n",
- n[1].f, n[5].f, n[9].f, n[13].f);
- printf(" %8f %8f %8f %8f\n",
- n[2].f, n[6].f, n[10].f, n[14].f);
- printf(" %8f %8f %8f %8f\n",
- n[3].f, n[7].f, n[11].f, n[15].f);
- printf(" %8f %8f %8f %8f\n",
- n[4].f, n[8].f, n[12].f, n[16].f);
- break;
- case OPCODE_MULT_MATRIX:
- printf("MultMatrix (or Rotate)\n");
- printf(" %8f %8f %8f %8f\n",
- n[1].f, n[5].f, n[9].f, n[13].f);
- printf(" %8f %8f %8f %8f\n",
- n[2].f, n[6].f, n[10].f, n[14].f);
- printf(" %8f %8f %8f %8f\n",
- n[3].f, n[7].f, n[11].f, n[15].f);
- printf(" %8f %8f %8f %8f\n",
- n[4].f, n[8].f, n[12].f, n[16].f);
- break;
- case OPCODE_ORTHO:
- printf("Ortho %g %g %g %g %g %g\n",
- n[1].f, n[2].f, n[3].f, n[4].f, n[5].f, n[6].f);
- break;
- case OPCODE_POP_ATTRIB:
- printf("PopAttrib\n");
- break;
- case OPCODE_POP_MATRIX:
- printf("PopMatrix\n");
- break;
- case OPCODE_POP_NAME:
- printf("PopName\n");
- break;
- case OPCODE_PUSH_ATTRIB:
- printf("PushAttrib %x\n", n[1].bf);
- break;
- case OPCODE_PUSH_MATRIX:
- printf("PushMatrix\n");
- break;
- case OPCODE_PUSH_NAME:
- printf("PushName %d\n", (int) n[1].ui);
- break;
- case OPCODE_RASTER_POS:
- printf("RasterPos %g %g %g %g\n",
- n[1].f, n[2].f, n[3].f, n[4].f);
- break;
- case OPCODE_ROTATE:
- printf("Rotate %g %g %g %g\n",
- n[1].f, n[2].f, n[3].f, n[4].f);
- break;
- case OPCODE_SCALE:
- printf("Scale %g %g %g\n", n[1].f, n[2].f, n[3].f);
- break;
- case OPCODE_TRANSLATE:
- printf("Translate %g %g %g\n", n[1].f, n[2].f, n[3].f);
- break;
- case OPCODE_BIND_TEXTURE:
- printf("BindTexture %s %d\n",
- _mesa_lookup_enum_by_nr(n[1].ui), n[2].ui);
- break;
- case OPCODE_SHADE_MODEL:
- printf("ShadeModel %s\n", _mesa_lookup_enum_by_nr(n[1].ui));
- break;
- case OPCODE_MAP1:
- printf("Map1 %s %.3f %.3f %d %d\n",
- _mesa_lookup_enum_by_nr(n[1].ui),
- n[2].f, n[3].f, n[4].i, n[5].i);
- break;
- case OPCODE_MAP2:
- printf("Map2 %s %.3f %.3f %.3f %.3f %d %d %d %d\n",
- _mesa_lookup_enum_by_nr(n[1].ui),
- n[2].f, n[3].f, n[4].f, n[5].f,
- n[6].i, n[7].i, n[8].i, n[9].i);
- break;
- case OPCODE_MAPGRID1:
- printf("MapGrid1 %d %.3f %.3f\n", n[1].i, n[2].f, n[3].f);
- break;
- case OPCODE_MAPGRID2:
- printf("MapGrid2 %d %.3f %.3f, %d %.3f %.3f\n",
- n[1].i, n[2].f, n[3].f, n[4].i, n[5].f, n[6].f);
- break;
- case OPCODE_EVALMESH1:
- printf("EvalMesh1 %d %d\n", n[1].i, n[2].i);
- break;
- case OPCODE_EVALMESH2:
- printf("EvalMesh2 %d %d %d %d\n",
- n[1].i, n[2].i, n[3].i, n[4].i);
- break;
-
- case OPCODE_ATTR_1F_NV:
- printf("ATTR_1F_NV attr %d: %f\n", n[1].i, n[2].f);
- break;
- case OPCODE_ATTR_2F_NV:
- printf("ATTR_2F_NV attr %d: %f %f\n",
- n[1].i, n[2].f, n[3].f);
- break;
- case OPCODE_ATTR_3F_NV:
- printf("ATTR_3F_NV attr %d: %f %f %f\n",
- n[1].i, n[2].f, n[3].f, n[4].f);
- break;
- case OPCODE_ATTR_4F_NV:
- printf("ATTR_4F_NV attr %d: %f %f %f %f\n",
- n[1].i, n[2].f, n[3].f, n[4].f, n[5].f);
- break;
- case OPCODE_ATTR_1F_ARB:
- printf("ATTR_1F_ARB attr %d: %f\n", n[1].i, n[2].f);
- break;
- case OPCODE_ATTR_2F_ARB:
- printf("ATTR_2F_ARB attr %d: %f %f\n",
- n[1].i, n[2].f, n[3].f);
- break;
- case OPCODE_ATTR_3F_ARB:
- printf("ATTR_3F_ARB attr %d: %f %f %f\n",
- n[1].i, n[2].f, n[3].f, n[4].f);
- break;
- case OPCODE_ATTR_4F_ARB:
- printf("ATTR_4F_ARB attr %d: %f %f %f %f\n",
- n[1].i, n[2].f, n[3].f, n[4].f, n[5].f);
- break;
-
- case OPCODE_MATERIAL:
- printf("MATERIAL %x %x: %f %f %f %f\n",
- n[1].i, n[2].i, n[3].f, n[4].f, n[5].f, n[6].f);
- break;
- case OPCODE_BEGIN:
- printf("BEGIN %x\n", n[1].i);
- break;
- case OPCODE_END:
- printf("END\n");
- break;
- case OPCODE_RECTF:
- printf("RECTF %f %f %f %f\n", n[1].f, n[2].f, n[3].f,
- n[4].f);
- break;
- case OPCODE_EVAL_C1:
- printf("EVAL_C1 %f\n", n[1].f);
- break;
- case OPCODE_EVAL_C2:
- printf("EVAL_C2 %f %f\n", n[1].f, n[2].f);
- break;
- case OPCODE_EVAL_P1:
- printf("EVAL_P1 %d\n", n[1].i);
- break;
- case OPCODE_EVAL_P2:
- printf("EVAL_P2 %d %d\n", n[1].i, n[2].i);
- break;
-
- case OPCODE_PROVOKING_VERTEX:
- printf("ProvokingVertex %s\n",
- _mesa_lookup_enum_by_nr(n[1].ui));
- break;
-
- /*
- * meta opcodes/commands
- */
- case OPCODE_ERROR:
- printf("Error: %s %s\n",
- enum_string(n[1].e), (const char *) n[2].data);
- break;
- case OPCODE_CONTINUE:
- printf("DISPLAY-LIST-CONTINUE\n");
- n = (Node *) n[1].next;
- break;
- case OPCODE_END_OF_LIST:
- printf("END-LIST %u\n", list);
- done = GL_TRUE;
- break;
- default:
- if (opcode < 0 || opcode > OPCODE_END_OF_LIST) {
- printf
- ("ERROR IN DISPLAY LIST: opcode = %d, address = %p\n",
- opcode, (void *) n);
- return;
- }
- else {
- printf("command %d, %u operands\n", opcode,
- InstSize[opcode]);
- }
- }
- /* increment n to point to next compiled command */
- if (opcode != OPCODE_CONTINUE) {
- n += InstSize[opcode];
- }
- }
- }
-}
-
-
-
-/**
- * Clients may call this function to help debug display list problems.
- * This function is _ONLY_FOR_DEBUGGING_PURPOSES_. It may be removed,
- * changed, or break in the future without notice.
- */
-void
-mesa_print_display_list(GLuint list)
-{
- GET_CURRENT_CONTEXT(ctx);
- print_list(ctx, list);
-}
-
-
-/**********************************************************************/
-/***** Initialization *****/
-/**********************************************************************/
-
-void
-_mesa_save_vtxfmt_init(GLvertexformat * vfmt)
-{
- _MESA_INIT_ARRAYELT_VTXFMT(vfmt, _ae_);
-
- vfmt->Begin = save_Begin;
-
- _MESA_INIT_DLIST_VTXFMT(vfmt, save_);
-
- vfmt->Color3f = save_Color3f;
- vfmt->Color3fv = save_Color3fv;
- vfmt->Color4f = save_Color4f;
- vfmt->Color4fv = save_Color4fv;
- vfmt->EdgeFlag = save_EdgeFlag;
- vfmt->End = save_End;
-
- _MESA_INIT_EVAL_VTXFMT(vfmt, save_);
-
- vfmt->FogCoordfEXT = save_FogCoordfEXT;
- vfmt->FogCoordfvEXT = save_FogCoordfvEXT;
- vfmt->Indexf = save_Indexf;
- vfmt->Indexfv = save_Indexfv;
- vfmt->Materialfv = save_Materialfv;
- vfmt->MultiTexCoord1fARB = save_MultiTexCoord1f;
- vfmt->MultiTexCoord1fvARB = save_MultiTexCoord1fv;
- vfmt->MultiTexCoord2fARB = save_MultiTexCoord2f;
- vfmt->MultiTexCoord2fvARB = save_MultiTexCoord2fv;
- vfmt->MultiTexCoord3fARB = save_MultiTexCoord3f;
- vfmt->MultiTexCoord3fvARB = save_MultiTexCoord3fv;
- vfmt->MultiTexCoord4fARB = save_MultiTexCoord4f;
- vfmt->MultiTexCoord4fvARB = save_MultiTexCoord4fv;
- vfmt->Normal3f = save_Normal3f;
- vfmt->Normal3fv = save_Normal3fv;
- vfmt->SecondaryColor3fEXT = save_SecondaryColor3fEXT;
- vfmt->SecondaryColor3fvEXT = save_SecondaryColor3fvEXT;
- vfmt->TexCoord1f = save_TexCoord1f;
- vfmt->TexCoord1fv = save_TexCoord1fv;
- vfmt->TexCoord2f = save_TexCoord2f;
- vfmt->TexCoord2fv = save_TexCoord2fv;
- vfmt->TexCoord3f = save_TexCoord3f;
- vfmt->TexCoord3fv = save_TexCoord3fv;
- vfmt->TexCoord4f = save_TexCoord4f;
- vfmt->TexCoord4fv = save_TexCoord4fv;
- vfmt->Vertex2f = save_Vertex2f;
- vfmt->Vertex2fv = save_Vertex2fv;
- vfmt->Vertex3f = save_Vertex3f;
- vfmt->Vertex3fv = save_Vertex3fv;
- vfmt->Vertex4f = save_Vertex4f;
- vfmt->Vertex4fv = save_Vertex4fv;
- vfmt->VertexAttrib1fNV = save_VertexAttrib1fNV;
- vfmt->VertexAttrib1fvNV = save_VertexAttrib1fvNV;
- vfmt->VertexAttrib2fNV = save_VertexAttrib2fNV;
- vfmt->VertexAttrib2fvNV = save_VertexAttrib2fvNV;
- vfmt->VertexAttrib3fNV = save_VertexAttrib3fNV;
- vfmt->VertexAttrib3fvNV = save_VertexAttrib3fvNV;
- vfmt->VertexAttrib4fNV = save_VertexAttrib4fNV;
- vfmt->VertexAttrib4fvNV = save_VertexAttrib4fvNV;
- vfmt->VertexAttrib1fARB = save_VertexAttrib1fARB;
- vfmt->VertexAttrib1fvARB = save_VertexAttrib1fvARB;
- vfmt->VertexAttrib2fARB = save_VertexAttrib2fARB;
- vfmt->VertexAttrib2fvARB = save_VertexAttrib2fvARB;
- vfmt->VertexAttrib3fARB = save_VertexAttrib3fARB;
- vfmt->VertexAttrib3fvARB = save_VertexAttrib3fvARB;
- vfmt->VertexAttrib4fARB = save_VertexAttrib4fARB;
- vfmt->VertexAttrib4fvARB = save_VertexAttrib4fvARB;
-
- vfmt->Rectf = save_Rectf;
-
- /* The driver is required to implement these as
- * 1) They can probably do a better job.
- * 2) A lot of new mechanisms would have to be added to this module
- * to support it. That code would probably never get used,
- * because of (1).
- */
-#if 0
- vfmt->DrawArrays = 0;
- vfmt->DrawElements = 0;
- vfmt->DrawRangeElements = 0;
- vfmt->MultiDrawElemementsEXT = 0;
- vfmt->DrawElementsBaseVertex = 0;
- vfmt->DrawRangeElementsBaseVertex = 0;
- vfmt->MultiDrawElemementsBaseVertex = 0;
-#endif
-}
-
-
-void
-_mesa_install_dlist_vtxfmt(struct _glapi_table *disp,
- const GLvertexformat *vfmt)
-{
- SET_CallList(disp, vfmt->CallList);
- SET_CallLists(disp, vfmt->CallLists);
-}
-
-
-void _mesa_init_dlist_dispatch(struct _glapi_table *disp)
-{
- SET_CallList(disp, _mesa_CallList);
- SET_CallLists(disp, _mesa_CallLists);
-
- SET_DeleteLists(disp, _mesa_DeleteLists);
- SET_EndList(disp, _mesa_EndList);
- SET_GenLists(disp, _mesa_GenLists);
- SET_IsList(disp, _mesa_IsList);
- SET_ListBase(disp, _mesa_ListBase);
- SET_NewList(disp, _mesa_NewList);
-}
-
-
-#endif /* FEATURE_dlist */
-
-
-/**
- * Initialize display list state for given context.
- */
-void
-_mesa_init_display_list(struct gl_context *ctx)
-{
- static GLboolean tableInitialized = GL_FALSE;
-
- /* zero-out the instruction size table, just once */
- if (!tableInitialized) {
- memset(InstSize, 0, sizeof(InstSize));
- tableInitialized = GL_TRUE;
- }
-
- /* extension info */
- ctx->ListExt = CALLOC_STRUCT(gl_list_extensions);
-
- /* Display list */
- ctx->ListState.CallDepth = 0;
- ctx->ExecuteFlag = GL_TRUE;
- ctx->CompileFlag = GL_FALSE;
- ctx->ListState.CurrentBlock = NULL;
- ctx->ListState.CurrentPos = 0;
-
- /* Display List group */
- ctx->List.ListBase = 0;
-
-#if FEATURE_dlist
- _mesa_save_vtxfmt_init(&ctx->ListState.ListVtxfmt);
-#endif
-}
-
-
-void
-_mesa_free_display_list_data(struct gl_context *ctx)
-{
- free(ctx->ListExt);
- ctx->ListExt = NULL;
-}
+/*
+ * Mesa 3-D graphics library
+ * Version: 7.7
+ *
+ * Copyright (C) 1999-2008 Brian Paul All Rights Reserved.
+ * Copyright (C) 2009 VMware, Inc. All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+
+/**
+ * \file dlist.c
+ * Display lists management functions.
+ */
+
+#include "glheader.h"
+#include "imports.h"
+#include "api_arrayelt.h"
+#include "api_exec.h"
+#include "api_loopback.h"
+#if FEATURE_ATI_fragment_shader
+#include "atifragshader.h"
+#endif
+#include "config.h"
+#include "mfeatures.h"
+#if FEATURE_ARB_vertex_buffer_object
+#include "bufferobj.h"
+#endif
+#include "arrayobj.h"
+#include "context.h"
+#include "dlist.h"
+#include "enums.h"
+#include "eval.h"
+#include "framebuffer.h"
+#include "glapi/glapi.h"
+#include "glapidispatch.h"
+#include "hash.h"
+#include "image.h"
+#include "light.h"
+#include "macros.h"
+#include "pack.h"
+#include "pbo.h"
+#include "queryobj.h"
+#include "teximage.h"
+#include "mtypes.h"
+#include "varray.h"
+#if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
+#include "arbprogram.h"
+#endif
+#if FEATURE_NV_vertex_program || FEATURE_NV_fragment_program
+#include "nvprogram.h"
+#endif
+
+#include "math/m_matrix.h"
+
+#include "main/dispatch.h"
+
+
+
+/**
+ * Other parts of Mesa (such as the VBO module) can plug into the display
+ * list system. This structure describes new display list instructions.
+ */
+struct gl_list_instruction
+{
+ GLuint Size;
+ void (*Execute)( struct gl_context *ctx, void *data );
+ void (*Destroy)( struct gl_context *ctx, void *data );
+ void (*Print)( struct gl_context *ctx, void *data );
+};
+
+
+#define MAX_DLIST_EXT_OPCODES 16
+
+/**
+ * Used by device drivers to hook new commands into display lists.
+ */
+struct gl_list_extensions
+{
+ struct gl_list_instruction Opcode[MAX_DLIST_EXT_OPCODES];
+ GLuint NumOpcodes;
+};
+
+
+
+/**
+ * Flush vertices.
+ *
+ * \param ctx GL context.
+ *
+ * Checks if dd_function_table::SaveNeedFlush is marked to flush
+ * stored (save) vertices, and calls
+ * dd_function_table::SaveFlushVertices if so.
+ */
+#define SAVE_FLUSH_VERTICES(ctx) \
+do { \
+ if (ctx->Driver.SaveNeedFlush) \
+ ctx->Driver.SaveFlushVertices(ctx); \
+} while (0)
+
+
+/**
+ * Macro to assert that the API call was made outside the
+ * glBegin()/glEnd() pair, with return value.
+ *
+ * \param ctx GL context.
+ * \param retval value to return value in case the assertion fails.
+ */
+#define ASSERT_OUTSIDE_SAVE_BEGIN_END_WITH_RETVAL(ctx, retval) \
+do { \
+ if (ctx->Driver.CurrentSavePrimitive <= GL_POLYGON || \
+ ctx->Driver.CurrentSavePrimitive == PRIM_INSIDE_UNKNOWN_PRIM) { \
+ _mesa_compile_error( ctx, GL_INVALID_OPERATION, "begin/end" ); \
+ return retval; \
+ } \
+} while (0)
+
+/**
+ * Macro to assert that the API call was made outside the
+ * glBegin()/glEnd() pair.
+ *
+ * \param ctx GL context.
+ */
+#define ASSERT_OUTSIDE_SAVE_BEGIN_END(ctx) \
+do { \
+ if (ctx->Driver.CurrentSavePrimitive <= GL_POLYGON || \
+ ctx->Driver.CurrentSavePrimitive == PRIM_INSIDE_UNKNOWN_PRIM) { \
+ _mesa_compile_error( ctx, GL_INVALID_OPERATION, "begin/end" ); \
+ return; \
+ } \
+} while (0)
+
+/**
+ * Macro to assert that the API call was made outside the
+ * glBegin()/glEnd() pair and flush the vertices.
+ *
+ * \param ctx GL context.
+ */
+#define ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx) \
+do { \
+ ASSERT_OUTSIDE_SAVE_BEGIN_END(ctx); \
+ SAVE_FLUSH_VERTICES(ctx); \
+} while (0)
+
+/**
+ * Macro to assert that the API call was made outside the
+ * glBegin()/glEnd() pair and flush the vertices, with return value.
+ *
+ * \param ctx GL context.
+ * \param retval value to return value in case the assertion fails.
+ */
+#define ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH_WITH_RETVAL(ctx, retval)\
+do { \
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_WITH_RETVAL(ctx, retval); \
+ SAVE_FLUSH_VERTICES(ctx); \
+} while (0)
+
+
+
+/**
+ * Display list opcodes.
+ *
+ * The fact that these identifiers are assigned consecutive
+ * integer values starting at 0 is very important, see InstSize array usage)
+ */
+typedef enum
+{
+ OPCODE_INVALID = -1, /* Force signed enum */
+ OPCODE_ACCUM,
+ OPCODE_ALPHA_FUNC,
+ OPCODE_BIND_TEXTURE,
+ OPCODE_BITMAP,
+ OPCODE_BLEND_COLOR,
+ OPCODE_BLEND_EQUATION,
+ OPCODE_BLEND_EQUATION_SEPARATE,
+ OPCODE_BLEND_FUNC_SEPARATE,
+
+ OPCODE_BLEND_EQUATION_I,
+ OPCODE_BLEND_EQUATION_SEPARATE_I,
+ OPCODE_BLEND_FUNC_I,
+ OPCODE_BLEND_FUNC_SEPARATE_I,
+
+ OPCODE_CALL_LIST,
+ OPCODE_CALL_LIST_OFFSET,
+ OPCODE_CLEAR,
+ OPCODE_CLEAR_ACCUM,
+ OPCODE_CLEAR_COLOR,
+ OPCODE_CLEAR_DEPTH,
+ OPCODE_CLEAR_INDEX,
+ OPCODE_CLEAR_STENCIL,
+ OPCODE_CLEAR_BUFFER_IV,
+ OPCODE_CLEAR_BUFFER_UIV,
+ OPCODE_CLEAR_BUFFER_FV,
+ OPCODE_CLEAR_BUFFER_FI,
+ OPCODE_CLIP_PLANE,
+ OPCODE_COLOR_MASK,
+ OPCODE_COLOR_MASK_INDEXED,
+ OPCODE_COLOR_MATERIAL,
+ OPCODE_COLOR_TABLE,
+ OPCODE_COLOR_TABLE_PARAMETER_FV,
+ OPCODE_COLOR_TABLE_PARAMETER_IV,
+ OPCODE_COLOR_SUB_TABLE,
+ OPCODE_CONVOLUTION_FILTER_1D,
+ OPCODE_CONVOLUTION_FILTER_2D,
+ OPCODE_CONVOLUTION_PARAMETER_I,
+ OPCODE_CONVOLUTION_PARAMETER_IV,
+ OPCODE_CONVOLUTION_PARAMETER_F,
+ OPCODE_CONVOLUTION_PARAMETER_FV,
+ OPCODE_COPY_COLOR_SUB_TABLE,
+ OPCODE_COPY_COLOR_TABLE,
+ OPCODE_COPY_PIXELS,
+ OPCODE_COPY_TEX_IMAGE1D,
+ OPCODE_COPY_TEX_IMAGE2D,
+ OPCODE_COPY_TEX_SUB_IMAGE1D,
+ OPCODE_COPY_TEX_SUB_IMAGE2D,
+ OPCODE_COPY_TEX_SUB_IMAGE3D,
+ OPCODE_CULL_FACE,
+ OPCODE_DEPTH_FUNC,
+ OPCODE_DEPTH_MASK,
+ OPCODE_DEPTH_RANGE,
+ OPCODE_DISABLE,
+ OPCODE_DISABLE_INDEXED,
+ OPCODE_DRAW_BUFFER,
+ OPCODE_DRAW_PIXELS,
+ OPCODE_ENABLE,
+ OPCODE_ENABLE_INDEXED,
+ OPCODE_EVALMESH1,
+ OPCODE_EVALMESH2,
+ OPCODE_FOG,
+ OPCODE_FRONT_FACE,
+ OPCODE_FRUSTUM,
+ OPCODE_HINT,
+ OPCODE_HISTOGRAM,
+ OPCODE_INDEX_MASK,
+ OPCODE_INIT_NAMES,
+ OPCODE_LIGHT,
+ OPCODE_LIGHT_MODEL,
+ OPCODE_LINE_STIPPLE,
+ OPCODE_LINE_WIDTH,
+ OPCODE_LIST_BASE,
+ OPCODE_LOAD_IDENTITY,
+ OPCODE_LOAD_MATRIX,
+ OPCODE_LOAD_NAME,
+ OPCODE_LOGIC_OP,
+ OPCODE_MAP1,
+ OPCODE_MAP2,
+ OPCODE_MAPGRID1,
+ OPCODE_MAPGRID2,
+ OPCODE_MATRIX_MODE,
+ OPCODE_MIN_MAX,
+ OPCODE_MULT_MATRIX,
+ OPCODE_ORTHO,
+ OPCODE_PASSTHROUGH,
+ OPCODE_PIXEL_MAP,
+ OPCODE_PIXEL_TRANSFER,
+ OPCODE_PIXEL_ZOOM,
+ OPCODE_POINT_SIZE,
+ OPCODE_POINT_PARAMETERS,
+ OPCODE_POLYGON_MODE,
+ OPCODE_POLYGON_STIPPLE,
+ OPCODE_POLYGON_OFFSET,
+ OPCODE_POP_ATTRIB,
+ OPCODE_POP_MATRIX,
+ OPCODE_POP_NAME,
+ OPCODE_PRIORITIZE_TEXTURE,
+ OPCODE_PUSH_ATTRIB,
+ OPCODE_PUSH_MATRIX,
+ OPCODE_PUSH_NAME,
+ OPCODE_RASTER_POS,
+ OPCODE_READ_BUFFER,
+ OPCODE_RESET_HISTOGRAM,
+ OPCODE_RESET_MIN_MAX,
+ OPCODE_ROTATE,
+ OPCODE_SCALE,
+ OPCODE_SCISSOR,
+ OPCODE_SELECT_TEXTURE_SGIS,
+ OPCODE_SELECT_TEXTURE_COORD_SET,
+ OPCODE_SHADE_MODEL,
+ OPCODE_STENCIL_FUNC,
+ OPCODE_STENCIL_MASK,
+ OPCODE_STENCIL_OP,
+ OPCODE_TEXENV,
+ OPCODE_TEXGEN,
+ OPCODE_TEXPARAMETER,
+ OPCODE_TEX_IMAGE1D,
+ OPCODE_TEX_IMAGE2D,
+ OPCODE_TEX_IMAGE3D,
+ OPCODE_TEX_SUB_IMAGE1D,
+ OPCODE_TEX_SUB_IMAGE2D,
+ OPCODE_TEX_SUB_IMAGE3D,
+ OPCODE_TRANSLATE,
+ OPCODE_VIEWPORT,
+ OPCODE_WINDOW_POS,
+ /* GL_ARB_multitexture */
+ OPCODE_ACTIVE_TEXTURE,
+ /* GL_ARB_texture_compression */
+ OPCODE_COMPRESSED_TEX_IMAGE_1D,
+ OPCODE_COMPRESSED_TEX_IMAGE_2D,
+ OPCODE_COMPRESSED_TEX_IMAGE_3D,
+ OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D,
+ OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D,
+ OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D,
+ /* GL_ARB_multisample */
+ OPCODE_SAMPLE_COVERAGE,
+ /* GL_ARB_window_pos */
+ OPCODE_WINDOW_POS_ARB,
+ /* GL_NV_vertex_program */
+ OPCODE_BIND_PROGRAM_NV,
+ OPCODE_EXECUTE_PROGRAM_NV,
+ OPCODE_REQUEST_RESIDENT_PROGRAMS_NV,
+ OPCODE_LOAD_PROGRAM_NV,
+ OPCODE_TRACK_MATRIX_NV,
+ /* GL_NV_fragment_program */
+ OPCODE_PROGRAM_LOCAL_PARAMETER_ARB,
+ OPCODE_PROGRAM_NAMED_PARAMETER_NV,
+ /* GL_EXT_stencil_two_side */
+ OPCODE_ACTIVE_STENCIL_FACE_EXT,
+ /* GL_EXT_depth_bounds_test */
+ OPCODE_DEPTH_BOUNDS_EXT,
+ /* GL_ARB_vertex/fragment_program */
+ OPCODE_PROGRAM_STRING_ARB,
+ OPCODE_PROGRAM_ENV_PARAMETER_ARB,
+ /* GL_ARB_occlusion_query */
+ OPCODE_BEGIN_QUERY_ARB,
+ OPCODE_END_QUERY_ARB,
+ /* GL_ARB_draw_buffers */
+ OPCODE_DRAW_BUFFERS_ARB,
+ /* GL_ATI_fragment_shader */
+ OPCODE_TEX_BUMP_PARAMETER_ATI,
+ /* GL_ATI_fragment_shader */
+ OPCODE_BIND_FRAGMENT_SHADER_ATI,
+ OPCODE_SET_FRAGMENT_SHADER_CONSTANTS_ATI,
+ /* OpenGL 2.0 */
+ OPCODE_STENCIL_FUNC_SEPARATE,
+ OPCODE_STENCIL_OP_SEPARATE,
+ OPCODE_STENCIL_MASK_SEPARATE,
+
+ /* GL_ARB_shader_objects */
+ OPCODE_USE_PROGRAM,
+ OPCODE_UNIFORM_1F,
+ OPCODE_UNIFORM_2F,
+ OPCODE_UNIFORM_3F,
+ OPCODE_UNIFORM_4F,
+ OPCODE_UNIFORM_1FV,
+ OPCODE_UNIFORM_2FV,
+ OPCODE_UNIFORM_3FV,
+ OPCODE_UNIFORM_4FV,
+ OPCODE_UNIFORM_1I,
+ OPCODE_UNIFORM_2I,
+ OPCODE_UNIFORM_3I,
+ OPCODE_UNIFORM_4I,
+ OPCODE_UNIFORM_1IV,
+ OPCODE_UNIFORM_2IV,
+ OPCODE_UNIFORM_3IV,
+ OPCODE_UNIFORM_4IV,
+ OPCODE_UNIFORM_MATRIX22,
+ OPCODE_UNIFORM_MATRIX33,
+ OPCODE_UNIFORM_MATRIX44,
+ OPCODE_UNIFORM_MATRIX23,
+ OPCODE_UNIFORM_MATRIX32,
+ OPCODE_UNIFORM_MATRIX24,
+ OPCODE_UNIFORM_MATRIX42,
+ OPCODE_UNIFORM_MATRIX34,
+ OPCODE_UNIFORM_MATRIX43,
+
+ /* OpenGL 3.0 */
+ OPCODE_UNIFORM_1UI,
+ OPCODE_UNIFORM_2UI,
+ OPCODE_UNIFORM_3UI,
+ OPCODE_UNIFORM_4UI,
+ OPCODE_UNIFORM_1UIV,
+ OPCODE_UNIFORM_2UIV,
+ OPCODE_UNIFORM_3UIV,
+ OPCODE_UNIFORM_4UIV,
+
+ /* GL_ARB_color_buffer_float */
+ OPCODE_CLAMP_COLOR,
+
+ /* GL_EXT_framebuffer_blit */
+ OPCODE_BLIT_FRAMEBUFFER,
+
+ /* Vertex attributes -- fallback for when optimized display
+ * list build isn't active.
+ */
+ OPCODE_ATTR_1F_NV,
+ OPCODE_ATTR_2F_NV,
+ OPCODE_ATTR_3F_NV,
+ OPCODE_ATTR_4F_NV,
+ OPCODE_ATTR_1F_ARB,
+ OPCODE_ATTR_2F_ARB,
+ OPCODE_ATTR_3F_ARB,
+ OPCODE_ATTR_4F_ARB,
+ OPCODE_MATERIAL,
+ OPCODE_BEGIN,
+ OPCODE_END,
+ OPCODE_RECTF,
+ OPCODE_EVAL_C1,
+ OPCODE_EVAL_C2,
+ OPCODE_EVAL_P1,
+ OPCODE_EVAL_P2,
+
+ /* GL_EXT_provoking_vertex */
+ OPCODE_PROVOKING_VERTEX,
+
+ /* GL_EXT_transform_feedback */
+ OPCODE_BEGIN_TRANSFORM_FEEDBACK,
+ OPCODE_END_TRANSFORM_FEEDBACK,
+
+ /* GL_EXT_texture_integer */
+ OPCODE_CLEARCOLOR_I,
+ OPCODE_CLEARCOLOR_UI,
+ OPCODE_TEXPARAMETER_I,
+ OPCODE_TEXPARAMETER_UI,
+
+ /* GL_EXT_separate_shader_objects */
+ OPCODE_ACTIVE_PROGRAM_EXT,
+ OPCODE_USE_SHADER_PROGRAM_EXT,
+
+ /* GL_ARB_instanced_arrays */
+ OPCODE_VERTEX_ATTRIB_DIVISOR,
+
+ /* GL_NV_texture_barrier */
+ OPCODE_TEXTURE_BARRIER_NV,
+
+ /* GL_ARB_sampler_object */
+ OPCODE_BIND_SAMPLER,
+
+ /* The following three are meta instructions */
+ OPCODE_ERROR, /* raise compiled-in error */
+ OPCODE_CONTINUE,
+ OPCODE_END_OF_LIST,
+ OPCODE_EXT_0
+} OpCode;
+
+
+
+/**
+ * Display list node.
+ *
+ * Display list instructions are stored as sequences of "nodes". Nodes
+ * are allocated in blocks. Each block has BLOCK_SIZE nodes. Blocks
+ * are linked together with a pointer.
+ *
+ * Each instruction in the display list is stored as a sequence of
+ * contiguous nodes in memory.
+ * Each node is the union of a variety of data types.
+ */
+union gl_dlist_node
+{
+ OpCode opcode;
+ GLboolean b;
+ GLbitfield bf;
+ GLubyte ub;
+ GLshort s;
+ GLushort us;
+ GLint i;
+ GLuint ui;
+ GLenum e;
+ GLfloat f;
+ GLvoid *data;
+ void *next; /* If prev node's opcode==OPCODE_CONTINUE */
+};
+
+
+typedef union gl_dlist_node Node;
+
+
+/**
+ * How many nodes to allocate at a time.
+ *
+ * \note Reduced now that we hold vertices etc. elsewhere.
+ */
+#define BLOCK_SIZE 256
+
+
+
+/**
+ * Number of nodes of storage needed for each instruction.
+ * Sizes for dynamically allocated opcodes are stored in the context struct.
+ */
+static GLuint InstSize[OPCODE_END_OF_LIST + 1];
+
+
+#if FEATURE_dlist
+
+
+void mesa_print_display_list(GLuint list);
+
+
+/**********************************************************************/
+/***** Private *****/
+/**********************************************************************/
+
+
+/**
+ * Make an empty display list. This is used by glGenLists() to
+ * reserve display list IDs.
+ */
+static struct gl_display_list *
+make_list(GLuint name, GLuint count)
+{
+ struct gl_display_list *dlist = CALLOC_STRUCT(gl_display_list);
+ dlist->Name = name;
+ dlist->Head = (Node *) malloc(sizeof(Node) * count);
+ dlist->Head[0].opcode = OPCODE_END_OF_LIST;
+ return dlist;
+}
+
+
+/**
+ * Lookup function to just encapsulate casting.
+ */
+static INLINE struct gl_display_list *
+lookup_list(struct gl_context *ctx, GLuint list)
+{
+ return (struct gl_display_list *)
+ _mesa_HashLookup(ctx->Shared->DisplayList, list);
+}
+
+
+/** Is the given opcode an extension code? */
+static INLINE GLboolean
+is_ext_opcode(OpCode opcode)
+{
+ return (opcode >= OPCODE_EXT_0);
+}
+
+
+/** Destroy an extended opcode instruction */
+static GLint
+ext_opcode_destroy(struct gl_context *ctx, Node *node)
+{
+ const GLint i = node[0].opcode - OPCODE_EXT_0;
+ GLint step;
+ ctx->ListExt->Opcode[i].Destroy(ctx, &node[1]);
+ step = ctx->ListExt->Opcode[i].Size;
+ return step;
+}
+
+
+/** Execute an extended opcode instruction */
+static GLint
+ext_opcode_execute(struct gl_context *ctx, Node *node)
+{
+ const GLint i = node[0].opcode - OPCODE_EXT_0;
+ GLint step;
+ ctx->ListExt->Opcode[i].Execute(ctx, &node[1]);
+ step = ctx->ListExt->Opcode[i].Size;
+ return step;
+}
+
+
+/** Print an extended opcode instruction */
+static GLint
+ext_opcode_print(struct gl_context *ctx, Node *node)
+{
+ const GLint i = node[0].opcode - OPCODE_EXT_0;
+ GLint step;
+ ctx->ListExt->Opcode[i].Print(ctx, &node[1]);
+ step = ctx->ListExt->Opcode[i].Size;
+ return step;
+}
+
+
+/**
+ * Delete the named display list, but don't remove from hash table.
+ * \param dlist - display list pointer
+ */
+void
+_mesa_delete_list(struct gl_context *ctx, struct gl_display_list *dlist)
+{
+ Node *n, *block;
+ GLboolean done;
+
+ n = block = dlist->Head;
+
+ done = block ? GL_FALSE : GL_TRUE;
+ while (!done) {
+ const OpCode opcode = n[0].opcode;
+
+ /* check for extension opcodes first */
+ if (is_ext_opcode(opcode)) {
+ n += ext_opcode_destroy(ctx, n);
+ }
+ else {
+ switch (opcode) {
+ /* for some commands, we need to free malloc'd memory */
+ case OPCODE_MAP1:
+ free(n[6].data);
+ n += InstSize[n[0].opcode];
+ break;
+ case OPCODE_MAP2:
+ free(n[10].data);
+ n += InstSize[n[0].opcode];
+ break;
+ case OPCODE_DRAW_PIXELS:
+ free(n[5].data);
+ n += InstSize[n[0].opcode];
+ break;
+ case OPCODE_BITMAP:
+ free(n[7].data);
+ n += InstSize[n[0].opcode];
+ break;
+ case OPCODE_COLOR_TABLE:
+ free(n[6].data);
+ n += InstSize[n[0].opcode];
+ break;
+ case OPCODE_COLOR_SUB_TABLE:
+ free(n[6].data);
+ n += InstSize[n[0].opcode];
+ break;
+ case OPCODE_CONVOLUTION_FILTER_1D:
+ free(n[6].data);
+ n += InstSize[n[0].opcode];
+ break;
+ case OPCODE_CONVOLUTION_FILTER_2D:
+ free(n[7].data);
+ n += InstSize[n[0].opcode];
+ break;
+ case OPCODE_POLYGON_STIPPLE:
+ free(n[1].data);
+ n += InstSize[n[0].opcode];
+ break;
+ case OPCODE_TEX_IMAGE1D:
+ free(n[8].data);
+ n += InstSize[n[0].opcode];
+ break;
+ case OPCODE_TEX_IMAGE2D:
+ free(n[9].data);
+ n += InstSize[n[0].opcode];
+ break;
+ case OPCODE_TEX_IMAGE3D:
+ free(n[10].data);
+ n += InstSize[n[0].opcode];
+ break;
+ case OPCODE_TEX_SUB_IMAGE1D:
+ free(n[7].data);
+ n += InstSize[n[0].opcode];
+ break;
+ case OPCODE_TEX_SUB_IMAGE2D:
+ free(n[9].data);
+ n += InstSize[n[0].opcode];
+ break;
+ case OPCODE_TEX_SUB_IMAGE3D:
+ free(n[11].data);
+ n += InstSize[n[0].opcode];
+ break;
+ case OPCODE_COMPRESSED_TEX_IMAGE_1D:
+ free(n[7].data);
+ n += InstSize[n[0].opcode];
+ break;
+ case OPCODE_COMPRESSED_TEX_IMAGE_2D:
+ free(n[8].data);
+ n += InstSize[n[0].opcode];
+ break;
+ case OPCODE_COMPRESSED_TEX_IMAGE_3D:
+ free(n[9].data);
+ n += InstSize[n[0].opcode];
+ break;
+ case OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D:
+ free(n[7].data);
+ n += InstSize[n[0].opcode];
+ break;
+ case OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D:
+ free(n[9].data);
+ n += InstSize[n[0].opcode];
+ break;
+ case OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D:
+ free(n[11].data);
+ n += InstSize[n[0].opcode];
+ break;
+#if FEATURE_NV_vertex_program
+ case OPCODE_LOAD_PROGRAM_NV:
+ free(n[4].data); /* program string */
+ n += InstSize[n[0].opcode];
+ break;
+ case OPCODE_REQUEST_RESIDENT_PROGRAMS_NV:
+ free(n[2].data); /* array of program ids */
+ n += InstSize[n[0].opcode];
+ break;
+#endif
+#if FEATURE_NV_fragment_program
+ case OPCODE_PROGRAM_NAMED_PARAMETER_NV:
+ free(n[3].data); /* parameter name */
+ n += InstSize[n[0].opcode];
+ break;
+#endif
+#if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
+ case OPCODE_PROGRAM_STRING_ARB:
+ free(n[4].data); /* program string */
+ n += InstSize[n[0].opcode];
+ break;
+#endif
+ case OPCODE_UNIFORM_1FV:
+ case OPCODE_UNIFORM_2FV:
+ case OPCODE_UNIFORM_3FV:
+ case OPCODE_UNIFORM_4FV:
+ case OPCODE_UNIFORM_1IV:
+ case OPCODE_UNIFORM_2IV:
+ case OPCODE_UNIFORM_3IV:
+ case OPCODE_UNIFORM_4IV:
+ case OPCODE_UNIFORM_1UIV:
+ case OPCODE_UNIFORM_2UIV:
+ case OPCODE_UNIFORM_3UIV:
+ case OPCODE_UNIFORM_4UIV:
+ free(n[3].data);
+ n += InstSize[n[0].opcode];
+ break;
+ case OPCODE_UNIFORM_MATRIX22:
+ case OPCODE_UNIFORM_MATRIX33:
+ case OPCODE_UNIFORM_MATRIX44:
+ case OPCODE_UNIFORM_MATRIX24:
+ case OPCODE_UNIFORM_MATRIX42:
+ case OPCODE_UNIFORM_MATRIX23:
+ case OPCODE_UNIFORM_MATRIX32:
+ case OPCODE_UNIFORM_MATRIX34:
+ case OPCODE_UNIFORM_MATRIX43:
+ free(n[4].data);
+ n += InstSize[n[0].opcode];
+ break;
+
+ case OPCODE_CONTINUE:
+ n = (Node *) n[1].next;
+ free(block);
+ block = n;
+ break;
+ case OPCODE_END_OF_LIST:
+ free(block);
+ done = GL_TRUE;
+ break;
+ default:
+ /* Most frequent case */
+ n += InstSize[n[0].opcode];
+ break;
+ }
+ }
+ }
+
+ free(dlist);
+}
+
+
+/**
+ * Destroy a display list and remove from hash table.
+ * \param list - display list number
+ */
+static void
+destroy_list(struct gl_context *ctx, GLuint list)
+{
+ struct gl_display_list *dlist;
+
+ if (list == 0)
+ return;
+
+ dlist = lookup_list(ctx, list);
+ if (!dlist)
+ return;
+
+ _mesa_delete_list(ctx, dlist);
+ _mesa_HashRemove(ctx->Shared->DisplayList, list);
+}
+
+
+/*
+ * Translate the nth element of list from <type> to GLint.
+ */
+static GLint
+translate_id(GLsizei n, GLenum type, const GLvoid * list)
+{
+ GLbyte *bptr;
+ GLubyte *ubptr;
+ GLshort *sptr;
+ GLushort *usptr;
+ GLint *iptr;
+ GLuint *uiptr;
+ GLfloat *fptr;
+
+ switch (type) {
+ case GL_BYTE:
+ bptr = (GLbyte *) list;
+ return (GLint) bptr[n];
+ case GL_UNSIGNED_BYTE:
+ ubptr = (GLubyte *) list;
+ return (GLint) ubptr[n];
+ case GL_SHORT:
+ sptr = (GLshort *) list;
+ return (GLint) sptr[n];
+ case GL_UNSIGNED_SHORT:
+ usptr = (GLushort *) list;
+ return (GLint) usptr[n];
+ case GL_INT:
+ iptr = (GLint *) list;
+ return iptr[n];
+ case GL_UNSIGNED_INT:
+ uiptr = (GLuint *) list;
+ return (GLint) uiptr[n];
+ case GL_FLOAT:
+ fptr = (GLfloat *) list;
+ return (GLint) FLOORF(fptr[n]);
+ case GL_2_BYTES:
+ ubptr = ((GLubyte *) list) + 2 * n;
+ return (GLint) ubptr[0] * 256
+ + (GLint) ubptr[1];
+ case GL_3_BYTES:
+ ubptr = ((GLubyte *) list) + 3 * n;
+ return (GLint) ubptr[0] * 65536
+ + (GLint) ubptr[1] * 256
+ + (GLint) ubptr[2];
+ case GL_4_BYTES:
+ ubptr = ((GLubyte *) list) + 4 * n;
+ return (GLint) ubptr[0] * 16777216
+ + (GLint) ubptr[1] * 65536
+ + (GLint) ubptr[2] * 256
+ + (GLint) ubptr[3];
+ default:
+ return 0;
+ }
+}
+
+
+
+
+/**********************************************************************/
+/***** Public *****/
+/**********************************************************************/
+
+/**
+ * Wrapper for _mesa_unpack_image() that handles pixel buffer objects.
+ * If we run out of memory, GL_OUT_OF_MEMORY will be recorded.
+ */
+static GLvoid *
+unpack_image(struct gl_context *ctx, GLuint dimensions,
+ GLsizei width, GLsizei height, GLsizei depth,
+ GLenum format, GLenum type, const GLvoid * pixels,
+ const struct gl_pixelstore_attrib *unpack)
+{
+ if (!_mesa_is_bufferobj(unpack->BufferObj)) {
+ /* no PBO */
+ GLvoid *image = _mesa_unpack_image(dimensions, width, height, depth,
+ format, type, pixels, unpack);
+ if (pixels && !image) {
+ _mesa_error(ctx, GL_OUT_OF_MEMORY, "display list construction");
+ }
+ return image;
+ }
+ else if (_mesa_validate_pbo_access(dimensions, unpack, width, height,
+ depth, format, type, INT_MAX, pixels)) {
+ const GLubyte *map, *src;
+ GLvoid *image;
+
+ map = (GLubyte *)
+ ctx->Driver.MapBuffer(ctx, GL_PIXEL_UNPACK_BUFFER_EXT,
+ GL_READ_ONLY_ARB, unpack->BufferObj);
+ if (!map) {
+ /* unable to map src buffer! */
+ _mesa_error(ctx, GL_INVALID_OPERATION, "unable to map PBO");
+ return NULL;
+ }
+
+ src = ADD_POINTERS(map, pixels);
+ image = _mesa_unpack_image(dimensions, width, height, depth,
+ format, type, src, unpack);
+
+ ctx->Driver.UnmapBuffer(ctx, GL_PIXEL_UNPACK_BUFFER_EXT,
+ unpack->BufferObj);
+
+ if (!image) {
+ _mesa_error(ctx, GL_OUT_OF_MEMORY, "display list construction");
+ }
+ return image;
+ }
+ /* bad access! */
+ return NULL;
+}
+
+
+/**
+ * Allocate space for a display list instruction (opcode + payload space).
+ * \param opcode the instruction opcode (OPCODE_* value)
+ * \param bytes instruction payload size (not counting opcode)
+ * \return pointer to allocated memory (the opcode space)
+ */
+static Node *
+dlist_alloc(struct gl_context *ctx, OpCode opcode, GLuint bytes)
+{
+ const GLuint numNodes = 1 + (bytes + sizeof(Node) - 1) / sizeof(Node);
+ Node *n;
+
+ if (opcode < (GLuint) OPCODE_EXT_0) {
+ if (InstSize[opcode] == 0) {
+ /* save instruction size now */
+ InstSize[opcode] = numNodes;
+ }
+ else {
+ /* make sure instruction size agrees */
+ ASSERT(numNodes == InstSize[opcode]);
+ }
+ }
+
+ if (ctx->ListState.CurrentPos + numNodes + 2 > BLOCK_SIZE) {
+ /* This block is full. Allocate a new block and chain to it */
+ Node *newblock;
+ n = ctx->ListState.CurrentBlock + ctx->ListState.CurrentPos;
+ n[0].opcode = OPCODE_CONTINUE;
+ newblock = (Node *) malloc(sizeof(Node) * BLOCK_SIZE);
+ if (!newblock) {
+ _mesa_error(ctx, GL_OUT_OF_MEMORY, "Building display list");
+ return NULL;
+ }
+ n[1].next = (Node *) newblock;
+ ctx->ListState.CurrentBlock = newblock;
+ ctx->ListState.CurrentPos = 0;
+ }
+
+ n = ctx->ListState.CurrentBlock + ctx->ListState.CurrentPos;
+ ctx->ListState.CurrentPos += numNodes;
+
+ n[0].opcode = opcode;
+
+ return n;
+}
+
+
+
+/**
+ * Allocate space for a display list instruction. Used by callers outside
+ * this file for things like VBO vertex data.
+ *
+ * \param opcode the instruction opcode (OPCODE_* value)
+ * \param bytes instruction size in bytes, not counting opcode.
+ * \return pointer to the usable data area (not including the internal
+ * opcode).
+ */
+void *
+_mesa_dlist_alloc(struct gl_context *ctx, GLuint opcode, GLuint bytes)
+{
+ Node *n = dlist_alloc(ctx, (OpCode) opcode, bytes);
+ if (n)
+ return n + 1; /* return pointer to payload area, after opcode */
+ else
+ return NULL;
+}
+
+
+/**
+ * This function allows modules and drivers to get their own opcodes
+ * for extending display list functionality.
+ * \param ctx the rendering context
+ * \param size number of bytes for storing the new display list command
+ * \param execute function to execute the new display list command
+ * \param destroy function to destroy the new display list command
+ * \param print function to print the new display list command
+ * \return the new opcode number or -1 if error
+ */
+GLint
+_mesa_dlist_alloc_opcode(struct gl_context *ctx,
+ GLuint size,
+ void (*execute) (struct gl_context *, void *),
+ void (*destroy) (struct gl_context *, void *),
+ void (*print) (struct gl_context *, void *))
+{
+ if (ctx->ListExt->NumOpcodes < MAX_DLIST_EXT_OPCODES) {
+ const GLuint i = ctx->ListExt->NumOpcodes++;
+ ctx->ListExt->Opcode[i].Size =
+ 1 + (size + sizeof(Node) - 1) / sizeof(Node);
+ ctx->ListExt->Opcode[i].Execute = execute;
+ ctx->ListExt->Opcode[i].Destroy = destroy;
+ ctx->ListExt->Opcode[i].Print = print;
+ return i + OPCODE_EXT_0;
+ }
+ return -1;
+}
+
+
+/**
+ * Allocate space for a display list instruction. The space is basically
+ * an array of Nodes where node[0] holds the opcode, node[1] is the first
+ * function parameter, node[2] is the second parameter, etc.
+ *
+ * \param opcode one of OPCODE_x
+ * \param nparams number of function parameters
+ * \return pointer to start of instruction space
+ */
+static INLINE Node *
+alloc_instruction(struct gl_context *ctx, OpCode opcode, GLuint nparams)
+{
+ return dlist_alloc(ctx, opcode, nparams * sizeof(Node));
+}
+
+
+
+/*
+ * Display List compilation functions
+ */
+static void GLAPIENTRY
+save_Accum(GLenum op, GLfloat value)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = alloc_instruction(ctx, OPCODE_ACCUM, 2);
+ if (n) {
+ n[1].e = op;
+ n[2].f = value;
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_Accum(ctx->Exec, (op, value));
+ }
+}
+
+
+static void GLAPIENTRY
+save_AlphaFunc(GLenum func, GLclampf ref)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = alloc_instruction(ctx, OPCODE_ALPHA_FUNC, 2);
+ if (n) {
+ n[1].e = func;
+ n[2].f = (GLfloat) ref;
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_AlphaFunc(ctx->Exec, (func, ref));
+ }
+}
+
+
+static void GLAPIENTRY
+save_BindTexture(GLenum target, GLuint texture)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = alloc_instruction(ctx, OPCODE_BIND_TEXTURE, 2);
+ if (n) {
+ n[1].e = target;
+ n[2].ui = texture;
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_BindTexture(ctx->Exec, (target, texture));
+ }
+}
+
+
+static void GLAPIENTRY
+save_Bitmap(GLsizei width, GLsizei height,
+ GLfloat xorig, GLfloat yorig,
+ GLfloat xmove, GLfloat ymove, const GLubyte * pixels)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = alloc_instruction(ctx, OPCODE_BITMAP, 7);
+ if (n) {
+ n[1].i = (GLint) width;
+ n[2].i = (GLint) height;
+ n[3].f = xorig;
+ n[4].f = yorig;
+ n[5].f = xmove;
+ n[6].f = ymove;
+ n[7].data = _mesa_unpack_bitmap(width, height, pixels, &ctx->Unpack);
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_Bitmap(ctx->Exec, (width, height,
+ xorig, yorig, xmove, ymove, pixels));
+ }
+}
+
+
+static void GLAPIENTRY
+save_BlendEquation(GLenum mode)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = alloc_instruction(ctx, OPCODE_BLEND_EQUATION, 1);
+ if (n) {
+ n[1].e = mode;
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_BlendEquation(ctx->Exec, (mode));
+ }
+}
+
+
+static void GLAPIENTRY
+save_BlendEquationSeparateEXT(GLenum modeRGB, GLenum modeA)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = alloc_instruction(ctx, OPCODE_BLEND_EQUATION_SEPARATE, 2);
+ if (n) {
+ n[1].e = modeRGB;
+ n[2].e = modeA;
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_BlendEquationSeparateEXT(ctx->Exec, (modeRGB, modeA));
+ }
+}
+
+
+static void GLAPIENTRY
+save_BlendFuncSeparateEXT(GLenum sfactorRGB, GLenum dfactorRGB,
+ GLenum sfactorA, GLenum dfactorA)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = alloc_instruction(ctx, OPCODE_BLEND_FUNC_SEPARATE, 4);
+ if (n) {
+ n[1].e = sfactorRGB;
+ n[2].e = dfactorRGB;
+ n[3].e = sfactorA;
+ n[4].e = dfactorA;
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_BlendFuncSeparateEXT(ctx->Exec,
+ (sfactorRGB, dfactorRGB, sfactorA, dfactorA));
+ }
+}
+
+
+static void GLAPIENTRY
+save_BlendFunc(GLenum srcfactor, GLenum dstfactor)
+{
+ save_BlendFuncSeparateEXT(srcfactor, dstfactor, srcfactor, dstfactor);
+}
+
+
+static void GLAPIENTRY
+save_BlendColor(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = alloc_instruction(ctx, OPCODE_BLEND_COLOR, 4);
+ if (n) {
+ n[1].f = red;
+ n[2].f = green;
+ n[3].f = blue;
+ n[4].f = alpha;
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_BlendColor(ctx->Exec, (red, green, blue, alpha));
+ }
+}
+
+/* GL_ARB_draw_buffers_blend */
+static void GLAPIENTRY
+save_BlendFuncSeparatei(GLuint buf, GLenum sfactorRGB, GLenum dfactorRGB,
+ GLenum sfactorA, GLenum dfactorA)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = alloc_instruction(ctx, OPCODE_BLEND_FUNC_SEPARATE_I, 5);
+ if (n) {
+ n[1].ui = buf;
+ n[2].e = sfactorRGB;
+ n[3].e = dfactorRGB;
+ n[4].e = sfactorA;
+ n[5].e = dfactorA;
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_BlendFuncSeparateiARB(ctx->Exec, (buf, sfactorRGB, dfactorRGB,
+ sfactorA, dfactorA));
+ }
+}
+
+/* GL_ARB_draw_buffers_blend */
+static void GLAPIENTRY
+save_BlendFunci(GLuint buf, GLenum sfactor, GLenum dfactor)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = alloc_instruction(ctx, OPCODE_BLEND_FUNC_SEPARATE_I, 3);
+ if (n) {
+ n[1].ui = buf;
+ n[2].e = sfactor;
+ n[3].e = dfactor;
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_BlendFunciARB(ctx->Exec, (buf, sfactor, dfactor));
+ }
+}
+
+/* GL_ARB_draw_buffers_blend */
+static void GLAPIENTRY
+save_BlendEquationi(GLuint buf, GLenum mode)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = alloc_instruction(ctx, OPCODE_BLEND_EQUATION_I, 2);
+ if (n) {
+ n[1].ui = buf;
+ n[2].e = mode;
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_BlendEquationiARB(ctx->Exec, (buf, mode));
+ }
+}
+
+/* GL_ARB_draw_buffers_blend */
+static void GLAPIENTRY
+save_BlendEquationSeparatei(GLuint buf, GLenum modeRGB, GLenum modeA)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = alloc_instruction(ctx, OPCODE_BLEND_EQUATION_SEPARATE_I, 3);
+ if (n) {
+ n[1].ui = buf;
+ n[2].e = modeRGB;
+ n[3].e = modeA;
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_BlendEquationSeparateiARB(ctx->Exec, (buf, modeRGB, modeA));
+ }
+}
+
+
+static void invalidate_saved_current_state( struct gl_context *ctx )
+{
+ GLint i;
+
+ for (i = 0; i < VERT_ATTRIB_MAX; i++)
+ ctx->ListState.ActiveAttribSize[i] = 0;
+
+ for (i = 0; i < MAT_ATTRIB_MAX; i++)
+ ctx->ListState.ActiveMaterialSize[i] = 0;
+
+ memset(&ctx->ListState.Current, 0, sizeof ctx->ListState.Current);
+
+ ctx->Driver.CurrentSavePrimitive = PRIM_UNKNOWN;
+}
+
+static void GLAPIENTRY
+save_CallList(GLuint list)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ SAVE_FLUSH_VERTICES(ctx);
+
+ n = alloc_instruction(ctx, OPCODE_CALL_LIST, 1);
+ if (n) {
+ n[1].ui = list;
+ }
+
+ /* After this, we don't know what state we're in. Invalidate all
+ * cached information previously gathered:
+ */
+ invalidate_saved_current_state( ctx );
+
+ if (ctx->ExecuteFlag) {
+ _mesa_CallList(list);
+ }
+}
+
+
+static void GLAPIENTRY
+save_CallLists(GLsizei num, GLenum type, const GLvoid * lists)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ GLint i;
+ GLboolean typeErrorFlag;
+
+ SAVE_FLUSH_VERTICES(ctx);
+
+ switch (type) {
+ case GL_BYTE:
+ case GL_UNSIGNED_BYTE:
+ case GL_SHORT:
+ case GL_UNSIGNED_SHORT:
+ case GL_INT:
+ case GL_UNSIGNED_INT:
+ case GL_FLOAT:
+ case GL_2_BYTES:
+ case GL_3_BYTES:
+ case GL_4_BYTES:
+ typeErrorFlag = GL_FALSE;
+ break;
+ default:
+ typeErrorFlag = GL_TRUE;
+ }
+
+ for (i = 0; i < num; i++) {
+ GLint list = translate_id(i, type, lists);
+ Node *n = alloc_instruction(ctx, OPCODE_CALL_LIST_OFFSET, 2);
+ if (n) {
+ n[1].i = list;
+ n[2].b = typeErrorFlag;
+ }
+ }
+
+ /* After this, we don't know what state we're in. Invalidate all
+ * cached information previously gathered:
+ */
+ invalidate_saved_current_state( ctx );
+
+ if (ctx->ExecuteFlag) {
+ CALL_CallLists(ctx->Exec, (num, type, lists));
+ }
+}
+
+
+static void GLAPIENTRY
+save_Clear(GLbitfield mask)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = alloc_instruction(ctx, OPCODE_CLEAR, 1);
+ if (n) {
+ n[1].bf = mask;
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_Clear(ctx->Exec, (mask));
+ }
+}
+
+
+static void GLAPIENTRY
+save_ClearBufferiv(GLenum buffer, GLint drawbuffer, const GLint *value)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = alloc_instruction(ctx, OPCODE_CLEAR_BUFFER_IV, 6);
+ if (n) {
+ n[1].e = buffer;
+ n[2].i = drawbuffer;
+ n[3].i = value[0];
+ if (buffer == GL_COLOR) {
+ n[4].i = value[1];
+ n[5].i = value[2];
+ n[6].i = value[3];
+ }
+ else {
+ n[4].i = 0;
+ n[5].i = 0;
+ n[6].i = 0;
+ }
+ }
+ if (ctx->ExecuteFlag) {
+ /*CALL_ClearBufferiv(ctx->Exec, (buffer, drawbuffer, value));*/
+ }
+}
+
+
+static void GLAPIENTRY
+save_ClearBufferuiv(GLenum buffer, GLint drawbuffer, const GLuint *value)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = alloc_instruction(ctx, OPCODE_CLEAR_BUFFER_UIV, 6);
+ if (n) {
+ n[1].e = buffer;
+ n[2].i = drawbuffer;
+ n[3].ui = value[0];
+ if (buffer == GL_COLOR) {
+ n[4].ui = value[1];
+ n[5].ui = value[2];
+ n[6].ui = value[3];
+ }
+ else {
+ n[4].ui = 0;
+ n[5].ui = 0;
+ n[6].ui = 0;
+ }
+ }
+ if (ctx->ExecuteFlag) {
+ /*CALL_ClearBufferuiv(ctx->Exec, (buffer, drawbuffer, value));*/
+ }
+}
+
+
+static void GLAPIENTRY
+save_ClearBufferfv(GLenum buffer, GLint drawbuffer, const GLfloat *value)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = alloc_instruction(ctx, OPCODE_CLEAR_BUFFER_FV, 6);
+ if (n) {
+ n[1].e = buffer;
+ n[2].i = drawbuffer;
+ n[3].f = value[0];
+ if (buffer == GL_COLOR) {
+ n[4].f = value[1];
+ n[5].f = value[2];
+ n[6].f = value[3];
+ }
+ else {
+ n[4].f = 0.0F;
+ n[5].f = 0.0F;
+ n[6].f = 0.0F;
+ }
+ }
+ if (ctx->ExecuteFlag) {
+ /*CALL_ClearBufferuiv(ctx->Exec, (buffer, drawbuffer, value));*/
+ }
+}
+
+
+static void GLAPIENTRY
+save_ClearBufferfi(GLenum buffer, GLint drawbuffer,
+ GLfloat depth, GLint stencil)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = alloc_instruction(ctx, OPCODE_CLEAR_BUFFER_FI, 4);
+ if (n) {
+ n[1].e = buffer;
+ n[2].i = drawbuffer;
+ n[3].f = depth;
+ n[4].i = stencil;
+ }
+ if (ctx->ExecuteFlag) {
+ /*CALL_ClearBufferfi(ctx->Exec, (buffer, drawbuffer, depth, stencil));*/
+ }
+}
+
+
+static void GLAPIENTRY
+save_ClearAccum(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = alloc_instruction(ctx, OPCODE_CLEAR_ACCUM, 4);
+ if (n) {
+ n[1].f = red;
+ n[2].f = green;
+ n[3].f = blue;
+ n[4].f = alpha;
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_ClearAccum(ctx->Exec, (red, green, blue, alpha));
+ }
+}
+
+
+static void GLAPIENTRY
+save_ClearColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = alloc_instruction(ctx, OPCODE_CLEAR_COLOR, 4);
+ if (n) {
+ n[1].f = red;
+ n[2].f = green;
+ n[3].f = blue;
+ n[4].f = alpha;
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_ClearColor(ctx->Exec, (red, green, blue, alpha));
+ }
+}
+
+
+static void GLAPIENTRY
+save_ClearDepth(GLclampd depth)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = alloc_instruction(ctx, OPCODE_CLEAR_DEPTH, 1);
+ if (n) {
+ n[1].f = (GLfloat) depth;
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_ClearDepth(ctx->Exec, (depth));
+ }
+}
+
+
+static void GLAPIENTRY
+save_ClearIndex(GLfloat c)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = alloc_instruction(ctx, OPCODE_CLEAR_INDEX, 1);
+ if (n) {
+ n[1].f = c;
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_ClearIndex(ctx->Exec, (c));
+ }
+}
+
+
+static void GLAPIENTRY
+save_ClearStencil(GLint s)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = alloc_instruction(ctx, OPCODE_CLEAR_STENCIL, 1);
+ if (n) {
+ n[1].i = s;
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_ClearStencil(ctx->Exec, (s));
+ }
+}
+
+
+static void GLAPIENTRY
+save_ClipPlane(GLenum plane, const GLdouble * equ)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = alloc_instruction(ctx, OPCODE_CLIP_PLANE, 5);
+ if (n) {
+ n[1].e = plane;
+ n[2].f = (GLfloat) equ[0];
+ n[3].f = (GLfloat) equ[1];
+ n[4].f = (GLfloat) equ[2];
+ n[5].f = (GLfloat) equ[3];
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_ClipPlane(ctx->Exec, (plane, equ));
+ }
+}
+
+
+
+static void GLAPIENTRY
+save_ColorMask(GLboolean red, GLboolean green,
+ GLboolean blue, GLboolean alpha)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = alloc_instruction(ctx, OPCODE_COLOR_MASK, 4);
+ if (n) {
+ n[1].b = red;
+ n[2].b = green;
+ n[3].b = blue;
+ n[4].b = alpha;
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_ColorMask(ctx->Exec, (red, green, blue, alpha));
+ }
+}
+
+
+static void GLAPIENTRY
+save_ColorMaskIndexed(GLuint buf, GLboolean red, GLboolean green,
+ GLboolean blue, GLboolean alpha)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = alloc_instruction(ctx, OPCODE_COLOR_MASK_INDEXED, 5);
+ if (n) {
+ n[1].ui = buf;
+ n[2].b = red;
+ n[3].b = green;
+ n[4].b = blue;
+ n[5].b = alpha;
+ }
+ if (ctx->ExecuteFlag) {
+ /*CALL_ColorMaskIndexedEXT(ctx->Exec, (buf, red, green, blue, alpha));*/
+ }
+}
+
+
+static void GLAPIENTRY
+save_ColorMaterial(GLenum face, GLenum mode)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+
+ n = alloc_instruction(ctx, OPCODE_COLOR_MATERIAL, 2);
+ if (n) {
+ n[1].e = face;
+ n[2].e = mode;
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_ColorMaterial(ctx->Exec, (face, mode));
+ }
+}
+
+
+static void GLAPIENTRY
+save_ColorTable(GLenum target, GLenum internalFormat,
+ GLsizei width, GLenum format, GLenum type,
+ const GLvoid * table)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ if (_mesa_is_proxy_texture(target)) {
+ /* execute immediately */
+ CALL_ColorTable(ctx->Exec, (target, internalFormat, width,
+ format, type, table));
+ }
+ else {
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = alloc_instruction(ctx, OPCODE_COLOR_TABLE, 6);
+ if (n) {
+ n[1].e = target;
+ n[2].e = internalFormat;
+ n[3].i = width;
+ n[4].e = format;
+ n[5].e = type;
+ n[6].data = unpack_image(ctx, 1, width, 1, 1, format, type, table,
+ &ctx->Unpack);
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_ColorTable(ctx->Exec, (target, internalFormat, width,
+ format, type, table));
+ }
+ }
+}
+
+
+
+static void GLAPIENTRY
+save_ColorTableParameterfv(GLenum target, GLenum pname,
+ const GLfloat *params)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+
+ n = alloc_instruction(ctx, OPCODE_COLOR_TABLE_PARAMETER_FV, 6);
+ if (n) {
+ n[1].e = target;
+ n[2].e = pname;
+ n[3].f = params[0];
+ if (pname == GL_COLOR_TABLE_SGI ||
+ pname == GL_POST_CONVOLUTION_COLOR_TABLE_SGI ||
+ pname == GL_TEXTURE_COLOR_TABLE_SGI) {
+ n[4].f = params[1];
+ n[5].f = params[2];
+ n[6].f = params[3];
+ }
+ }
+
+ if (ctx->ExecuteFlag) {
+ CALL_ColorTableParameterfv(ctx->Exec, (target, pname, params));
+ }
+}
+
+
+static void GLAPIENTRY
+save_ColorTableParameteriv(GLenum target, GLenum pname, const GLint *params)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+
+ n = alloc_instruction(ctx, OPCODE_COLOR_TABLE_PARAMETER_IV, 6);
+ if (n) {
+ n[1].e = target;
+ n[2].e = pname;
+ n[3].i = params[0];
+ if (pname == GL_COLOR_TABLE_SGI ||
+ pname == GL_POST_CONVOLUTION_COLOR_TABLE_SGI ||
+ pname == GL_TEXTURE_COLOR_TABLE_SGI) {
+ n[4].i = params[1];
+ n[5].i = params[2];
+ n[6].i = params[3];
+ }
+ }
+
+ if (ctx->ExecuteFlag) {
+ CALL_ColorTableParameteriv(ctx->Exec, (target, pname, params));
+ }
+}
+
+
+
+static void GLAPIENTRY
+save_ColorSubTable(GLenum target, GLsizei start, GLsizei count,
+ GLenum format, GLenum type, const GLvoid * table)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = alloc_instruction(ctx, OPCODE_COLOR_SUB_TABLE, 6);
+ if (n) {
+ n[1].e = target;
+ n[2].i = start;
+ n[3].i = count;
+ n[4].e = format;
+ n[5].e = type;
+ n[6].data = unpack_image(ctx, 1, count, 1, 1, format, type, table,
+ &ctx->Unpack);
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_ColorSubTable(ctx->Exec,
+ (target, start, count, format, type, table));
+ }
+}
+
+
+static void GLAPIENTRY
+save_CopyColorSubTable(GLenum target, GLsizei start,
+ GLint x, GLint y, GLsizei width)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = alloc_instruction(ctx, OPCODE_COPY_COLOR_SUB_TABLE, 5);
+ if (n) {
+ n[1].e = target;
+ n[2].i = start;
+ n[3].i = x;
+ n[4].i = y;
+ n[5].i = width;
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_CopyColorSubTable(ctx->Exec, (target, start, x, y, width));
+ }
+}
+
+
+static void GLAPIENTRY
+save_CopyColorTable(GLenum target, GLenum internalformat,
+ GLint x, GLint y, GLsizei width)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = alloc_instruction(ctx, OPCODE_COPY_COLOR_TABLE, 5);
+ if (n) {
+ n[1].e = target;
+ n[2].e = internalformat;
+ n[3].i = x;
+ n[4].i = y;
+ n[5].i = width;
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_CopyColorTable(ctx->Exec, (target, internalformat, x, y, width));
+ }
+}
+
+
+static void GLAPIENTRY
+save_ConvolutionFilter1D(GLenum target, GLenum internalFormat, GLsizei width,
+ GLenum format, GLenum type, const GLvoid * filter)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+
+ n = alloc_instruction(ctx, OPCODE_CONVOLUTION_FILTER_1D, 6);
+ if (n) {
+ n[1].e = target;
+ n[2].e = internalFormat;
+ n[3].i = width;
+ n[4].e = format;
+ n[5].e = type;
+ n[6].data = unpack_image(ctx, 1, width, 1, 1, format, type, filter,
+ &ctx->Unpack);
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_ConvolutionFilter1D(ctx->Exec, (target, internalFormat, width,
+ format, type, filter));
+ }
+}
+
+
+static void GLAPIENTRY
+save_ConvolutionFilter2D(GLenum target, GLenum internalFormat,
+ GLsizei width, GLsizei height, GLenum format,
+ GLenum type, const GLvoid * filter)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+
+ n = alloc_instruction(ctx, OPCODE_CONVOLUTION_FILTER_2D, 7);
+ if (n) {
+ n[1].e = target;
+ n[2].e = internalFormat;
+ n[3].i = width;
+ n[4].i = height;
+ n[5].e = format;
+ n[6].e = type;
+ n[7].data = unpack_image(ctx, 2, width, height, 1, format, type, filter,
+ &ctx->Unpack);
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_ConvolutionFilter2D(ctx->Exec,
+ (target, internalFormat, width, height, format,
+ type, filter));
+ }
+}
+
+
+static void GLAPIENTRY
+save_ConvolutionParameteri(GLenum target, GLenum pname, GLint param)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = alloc_instruction(ctx, OPCODE_CONVOLUTION_PARAMETER_I, 3);
+ if (n) {
+ n[1].e = target;
+ n[2].e = pname;
+ n[3].i = param;
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_ConvolutionParameteri(ctx->Exec, (target, pname, param));
+ }
+}
+
+
+static void GLAPIENTRY
+save_ConvolutionParameteriv(GLenum target, GLenum pname, const GLint *params)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = alloc_instruction(ctx, OPCODE_CONVOLUTION_PARAMETER_IV, 6);
+ if (n) {
+ n[1].e = target;
+ n[2].e = pname;
+ n[3].i = params[0];
+ if (pname == GL_CONVOLUTION_BORDER_COLOR ||
+ pname == GL_CONVOLUTION_FILTER_SCALE ||
+ pname == GL_CONVOLUTION_FILTER_BIAS) {
+ n[4].i = params[1];
+ n[5].i = params[2];
+ n[6].i = params[3];
+ }
+ else {
+ n[4].i = n[5].i = n[6].i = 0;
+ }
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_ConvolutionParameteriv(ctx->Exec, (target, pname, params));
+ }
+}
+
+
+static void GLAPIENTRY
+save_ConvolutionParameterf(GLenum target, GLenum pname, GLfloat param)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = alloc_instruction(ctx, OPCODE_CONVOLUTION_PARAMETER_F, 3);
+ if (n) {
+ n[1].e = target;
+ n[2].e = pname;
+ n[3].f = param;
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_ConvolutionParameterf(ctx->Exec, (target, pname, param));
+ }
+}
+
+
+static void GLAPIENTRY
+save_ConvolutionParameterfv(GLenum target, GLenum pname,
+ const GLfloat *params)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = alloc_instruction(ctx, OPCODE_CONVOLUTION_PARAMETER_FV, 6);
+ if (n) {
+ n[1].e = target;
+ n[2].e = pname;
+ n[3].f = params[0];
+ if (pname == GL_CONVOLUTION_BORDER_COLOR ||
+ pname == GL_CONVOLUTION_FILTER_SCALE ||
+ pname == GL_CONVOLUTION_FILTER_BIAS) {
+ n[4].f = params[1];
+ n[5].f = params[2];
+ n[6].f = params[3];
+ }
+ else {
+ n[4].f = n[5].f = n[6].f = 0.0F;
+ }
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_ConvolutionParameterfv(ctx->Exec, (target, pname, params));
+ }
+}
+
+
+static void GLAPIENTRY
+save_CopyPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum type)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = alloc_instruction(ctx, OPCODE_COPY_PIXELS, 5);
+ if (n) {
+ n[1].i = x;
+ n[2].i = y;
+ n[3].i = (GLint) width;
+ n[4].i = (GLint) height;
+ n[5].e = type;
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_CopyPixels(ctx->Exec, (x, y, width, height, type));
+ }
+}
+
+
+
+static void GLAPIENTRY
+save_CopyTexImage1D(GLenum target, GLint level, GLenum internalformat,
+ GLint x, GLint y, GLsizei width, GLint border)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = alloc_instruction(ctx, OPCODE_COPY_TEX_IMAGE1D, 7);
+ if (n) {
+ n[1].e = target;
+ n[2].i = level;
+ n[3].e = internalformat;
+ n[4].i = x;
+ n[5].i = y;
+ n[6].i = width;
+ n[7].i = border;
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_CopyTexImage1D(ctx->Exec, (target, level, internalformat,
+ x, y, width, border));
+ }
+}
+
+
+static void GLAPIENTRY
+save_CopyTexImage2D(GLenum target, GLint level,
+ GLenum internalformat,
+ GLint x, GLint y, GLsizei width,
+ GLsizei height, GLint border)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = alloc_instruction(ctx, OPCODE_COPY_TEX_IMAGE2D, 8);
+ if (n) {
+ n[1].e = target;
+ n[2].i = level;
+ n[3].e = internalformat;
+ n[4].i = x;
+ n[5].i = y;
+ n[6].i = width;
+ n[7].i = height;
+ n[8].i = border;
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_CopyTexImage2D(ctx->Exec, (target, level, internalformat,
+ x, y, width, height, border));
+ }
+}
+
+
+
+static void GLAPIENTRY
+save_CopyTexSubImage1D(GLenum target, GLint level,
+ GLint xoffset, GLint x, GLint y, GLsizei width)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = alloc_instruction(ctx, OPCODE_COPY_TEX_SUB_IMAGE1D, 6);
+ if (n) {
+ n[1].e = target;
+ n[2].i = level;
+ n[3].i = xoffset;
+ n[4].i = x;
+ n[5].i = y;
+ n[6].i = width;
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_CopyTexSubImage1D(ctx->Exec,
+ (target, level, xoffset, x, y, width));
+ }
+}
+
+
+static void GLAPIENTRY
+save_CopyTexSubImage2D(GLenum target, GLint level,
+ GLint xoffset, GLint yoffset,
+ GLint x, GLint y, GLsizei width, GLint height)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = alloc_instruction(ctx, OPCODE_COPY_TEX_SUB_IMAGE2D, 8);
+ if (n) {
+ n[1].e = target;
+ n[2].i = level;
+ n[3].i = xoffset;
+ n[4].i = yoffset;
+ n[5].i = x;
+ n[6].i = y;
+ n[7].i = width;
+ n[8].i = height;
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_CopyTexSubImage2D(ctx->Exec, (target, level, xoffset, yoffset,
+ x, y, width, height));
+ }
+}
+
+
+static void GLAPIENTRY
+save_CopyTexSubImage3D(GLenum target, GLint level,
+ GLint xoffset, GLint yoffset, GLint zoffset,
+ GLint x, GLint y, GLsizei width, GLint height)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = alloc_instruction(ctx, OPCODE_COPY_TEX_SUB_IMAGE3D, 9);
+ if (n) {
+ n[1].e = target;
+ n[2].i = level;
+ n[3].i = xoffset;
+ n[4].i = yoffset;
+ n[5].i = zoffset;
+ n[6].i = x;
+ n[7].i = y;
+ n[8].i = width;
+ n[9].i = height;
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_CopyTexSubImage3D(ctx->Exec, (target, level,
+ xoffset, yoffset, zoffset,
+ x, y, width, height));
+ }
+}
+
+
+static void GLAPIENTRY
+save_CullFace(GLenum mode)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = alloc_instruction(ctx, OPCODE_CULL_FACE, 1);
+ if (n) {
+ n[1].e = mode;
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_CullFace(ctx->Exec, (mode));
+ }
+}
+
+
+static void GLAPIENTRY
+save_DepthFunc(GLenum func)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = alloc_instruction(ctx, OPCODE_DEPTH_FUNC, 1);
+ if (n) {
+ n[1].e = func;
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_DepthFunc(ctx->Exec, (func));
+ }
+}
+
+
+static void GLAPIENTRY
+save_DepthMask(GLboolean mask)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = alloc_instruction(ctx, OPCODE_DEPTH_MASK, 1);
+ if (n) {
+ n[1].b = mask;
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_DepthMask(ctx->Exec, (mask));
+ }
+}
+
+
+static void GLAPIENTRY
+save_DepthRange(GLclampd nearval, GLclampd farval)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = alloc_instruction(ctx, OPCODE_DEPTH_RANGE, 2);
+ if (n) {
+ n[1].f = (GLfloat) nearval;
+ n[2].f = (GLfloat) farval;
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_DepthRange(ctx->Exec, (nearval, farval));
+ }
+}
+
+
+static void GLAPIENTRY
+save_Disable(GLenum cap)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = alloc_instruction(ctx, OPCODE_DISABLE, 1);
+ if (n) {
+ n[1].e = cap;
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_Disable(ctx->Exec, (cap));
+ }
+}
+
+
+static void GLAPIENTRY
+save_DisableIndexed(GLuint index, GLenum cap)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = alloc_instruction(ctx, OPCODE_DISABLE_INDEXED, 2);
+ if (n) {
+ n[1].ui = index;
+ n[2].e = cap;
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_DisableIndexedEXT(ctx->Exec, (index, cap));
+ }
+}
+
+
+static void GLAPIENTRY
+save_DrawBuffer(GLenum mode)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = alloc_instruction(ctx, OPCODE_DRAW_BUFFER, 1);
+ if (n) {
+ n[1].e = mode;
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_DrawBuffer(ctx->Exec, (mode));
+ }
+}
+
+
+static void GLAPIENTRY
+save_DrawPixels(GLsizei width, GLsizei height,
+ GLenum format, GLenum type, const GLvoid * pixels)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+
+ n = alloc_instruction(ctx, OPCODE_DRAW_PIXELS, 5);
+ if (n) {
+ n[1].i = width;
+ n[2].i = height;
+ n[3].e = format;
+ n[4].e = type;
+ n[5].data = unpack_image(ctx, 2, width, height, 1, format, type,
+ pixels, &ctx->Unpack);
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_DrawPixels(ctx->Exec, (width, height, format, type, pixels));
+ }
+}
+
+
+
+static void GLAPIENTRY
+save_Enable(GLenum cap)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = alloc_instruction(ctx, OPCODE_ENABLE, 1);
+ if (n) {
+ n[1].e = cap;
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_Enable(ctx->Exec, (cap));
+ }
+}
+
+
+
+static void GLAPIENTRY
+save_EnableIndexed(GLuint index, GLenum cap)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = alloc_instruction(ctx, OPCODE_ENABLE_INDEXED, 2);
+ if (n) {
+ n[1].ui = index;
+ n[2].e = cap;
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_EnableIndexedEXT(ctx->Exec, (index, cap));
+ }
+}
+
+
+
+static void GLAPIENTRY
+save_EvalMesh1(GLenum mode, GLint i1, GLint i2)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = alloc_instruction(ctx, OPCODE_EVALMESH1, 3);
+ if (n) {
+ n[1].e = mode;
+ n[2].i = i1;
+ n[3].i = i2;
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_EvalMesh1(ctx->Exec, (mode, i1, i2));
+ }
+}
+
+
+static void GLAPIENTRY
+save_EvalMesh2(GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = alloc_instruction(ctx, OPCODE_EVALMESH2, 5);
+ if (n) {
+ n[1].e = mode;
+ n[2].i = i1;
+ n[3].i = i2;
+ n[4].i = j1;
+ n[5].i = j2;
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_EvalMesh2(ctx->Exec, (mode, i1, i2, j1, j2));
+ }
+}
+
+
+
+
+static void GLAPIENTRY
+save_Fogfv(GLenum pname, const GLfloat *params)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = alloc_instruction(ctx, OPCODE_FOG, 5);
+ if (n) {
+ n[1].e = pname;
+ n[2].f = params[0];
+ n[3].f = params[1];
+ n[4].f = params[2];
+ n[5].f = params[3];
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_Fogfv(ctx->Exec, (pname, params));
+ }
+}
+
+
+static void GLAPIENTRY
+save_Fogf(GLenum pname, GLfloat param)
+{
+ GLfloat parray[4];
+ parray[0] = param;
+ parray[1] = parray[2] = parray[3] = 0.0F;
+ save_Fogfv(pname, parray);
+}
+
+
+static void GLAPIENTRY
+save_Fogiv(GLenum pname, const GLint *params)
+{
+ GLfloat p[4];
+ switch (pname) {
+ case GL_FOG_MODE:
+ case GL_FOG_DENSITY:
+ case GL_FOG_START:
+ case GL_FOG_END:
+ case GL_FOG_INDEX:
+ p[0] = (GLfloat) *params;
+ p[1] = 0.0f;
+ p[2] = 0.0f;
+ p[3] = 0.0f;
+ break;
+ case GL_FOG_COLOR:
+ p[0] = INT_TO_FLOAT(params[0]);
+ p[1] = INT_TO_FLOAT(params[1]);
+ p[2] = INT_TO_FLOAT(params[2]);
+ p[3] = INT_TO_FLOAT(params[3]);
+ break;
+ default:
+ /* Error will be caught later in gl_Fogfv */
+ ASSIGN_4V(p, 0.0F, 0.0F, 0.0F, 0.0F);
+ }
+ save_Fogfv(pname, p);
+}
+
+
+static void GLAPIENTRY
+save_Fogi(GLenum pname, GLint param)
+{
+ GLint parray[4];
+ parray[0] = param;
+ parray[1] = parray[2] = parray[3] = 0;
+ save_Fogiv(pname, parray);
+}
+
+
+static void GLAPIENTRY
+save_FrontFace(GLenum mode)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = alloc_instruction(ctx, OPCODE_FRONT_FACE, 1);
+ if (n) {
+ n[1].e = mode;
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_FrontFace(ctx->Exec, (mode));
+ }
+}
+
+
+static void GLAPIENTRY
+save_Frustum(GLdouble left, GLdouble right,
+ GLdouble bottom, GLdouble top, GLdouble nearval, GLdouble farval)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = alloc_instruction(ctx, OPCODE_FRUSTUM, 6);
+ if (n) {
+ n[1].f = (GLfloat) left;
+ n[2].f = (GLfloat) right;
+ n[3].f = (GLfloat) bottom;
+ n[4].f = (GLfloat) top;
+ n[5].f = (GLfloat) nearval;
+ n[6].f = (GLfloat) farval;
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_Frustum(ctx->Exec, (left, right, bottom, top, nearval, farval));
+ }
+}
+
+
+static void GLAPIENTRY
+save_Hint(GLenum target, GLenum mode)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = alloc_instruction(ctx, OPCODE_HINT, 2);
+ if (n) {
+ n[1].e = target;
+ n[2].e = mode;
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_Hint(ctx->Exec, (target, mode));
+ }
+}
+
+
+static void GLAPIENTRY
+save_Histogram(GLenum target, GLsizei width, GLenum internalFormat,
+ GLboolean sink)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = alloc_instruction(ctx, OPCODE_HISTOGRAM, 4);
+ if (n) {
+ n[1].e = target;
+ n[2].i = width;
+ n[3].e = internalFormat;
+ n[4].b = sink;
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_Histogram(ctx->Exec, (target, width, internalFormat, sink));
+ }
+}
+
+
+static void GLAPIENTRY
+save_IndexMask(GLuint mask)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = alloc_instruction(ctx, OPCODE_INDEX_MASK, 1);
+ if (n) {
+ n[1].ui = mask;
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_IndexMask(ctx->Exec, (mask));
+ }
+}
+
+
+static void GLAPIENTRY
+save_InitNames(void)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ (void) alloc_instruction(ctx, OPCODE_INIT_NAMES, 0);
+ if (ctx->ExecuteFlag) {
+ CALL_InitNames(ctx->Exec, ());
+ }
+}
+
+
+static void GLAPIENTRY
+save_Lightfv(GLenum light, GLenum pname, const GLfloat *params)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = alloc_instruction(ctx, OPCODE_LIGHT, 6);
+ if (n) {
+ GLint i, nParams;
+ n[1].e = light;
+ n[2].e = pname;
+ switch (pname) {
+ case GL_AMBIENT:
+ nParams = 4;
+ break;
+ case GL_DIFFUSE:
+ nParams = 4;
+ break;
+ case GL_SPECULAR:
+ nParams = 4;
+ break;
+ case GL_POSITION:
+ nParams = 4;
+ break;
+ case GL_SPOT_DIRECTION:
+ nParams = 3;
+ break;
+ case GL_SPOT_EXPONENT:
+ nParams = 1;
+ break;
+ case GL_SPOT_CUTOFF:
+ nParams = 1;
+ break;
+ case GL_CONSTANT_ATTENUATION:
+ nParams = 1;
+ break;
+ case GL_LINEAR_ATTENUATION:
+ nParams = 1;
+ break;
+ case GL_QUADRATIC_ATTENUATION:
+ nParams = 1;
+ break;
+ default:
+ nParams = 0;
+ }
+ for (i = 0; i < nParams; i++) {
+ n[3 + i].f = params[i];
+ }
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_Lightfv(ctx->Exec, (light, pname, params));
+ }
+}
+
+
+static void GLAPIENTRY
+save_Lightf(GLenum light, GLenum pname, GLfloat param)
+{
+ GLfloat parray[4];
+ parray[0] = param;
+ parray[1] = parray[2] = parray[3] = 0.0F;
+ save_Lightfv(light, pname, parray);
+}
+
+
+static void GLAPIENTRY
+save_Lightiv(GLenum light, GLenum pname, const GLint *params)
+{
+ GLfloat fparam[4];
+ switch (pname) {
+ case GL_AMBIENT:
+ case GL_DIFFUSE:
+ case GL_SPECULAR:
+ fparam[0] = INT_TO_FLOAT(params[0]);
+ fparam[1] = INT_TO_FLOAT(params[1]);
+ fparam[2] = INT_TO_FLOAT(params[2]);
+ fparam[3] = INT_TO_FLOAT(params[3]);
+ break;
+ case GL_POSITION:
+ fparam[0] = (GLfloat) params[0];
+ fparam[1] = (GLfloat) params[1];
+ fparam[2] = (GLfloat) params[2];
+ fparam[3] = (GLfloat) params[3];
+ break;
+ case GL_SPOT_DIRECTION:
+ fparam[0] = (GLfloat) params[0];
+ fparam[1] = (GLfloat) params[1];
+ fparam[2] = (GLfloat) params[2];
+ break;
+ case GL_SPOT_EXPONENT:
+ case GL_SPOT_CUTOFF:
+ case GL_CONSTANT_ATTENUATION:
+ case GL_LINEAR_ATTENUATION:
+ case GL_QUADRATIC_ATTENUATION:
+ fparam[0] = (GLfloat) params[0];
+ break;
+ default:
+ /* error will be caught later in gl_Lightfv */
+ ;
+ }
+ save_Lightfv(light, pname, fparam);
+}
+
+
+static void GLAPIENTRY
+save_Lighti(GLenum light, GLenum pname, GLint param)
+{
+ GLint parray[4];
+ parray[0] = param;
+ parray[1] = parray[2] = parray[3] = 0;
+ save_Lightiv(light, pname, parray);
+}
+
+
+static void GLAPIENTRY
+save_LightModelfv(GLenum pname, const GLfloat *params)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = alloc_instruction(ctx, OPCODE_LIGHT_MODEL, 5);
+ if (n) {
+ n[1].e = pname;
+ n[2].f = params[0];
+ n[3].f = params[1];
+ n[4].f = params[2];
+ n[5].f = params[3];
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_LightModelfv(ctx->Exec, (pname, params));
+ }
+}
+
+
+static void GLAPIENTRY
+save_LightModelf(GLenum pname, GLfloat param)
+{
+ GLfloat parray[4];
+ parray[0] = param;
+ parray[1] = parray[2] = parray[3] = 0.0F;
+ save_LightModelfv(pname, parray);
+}
+
+
+static void GLAPIENTRY
+save_LightModeliv(GLenum pname, const GLint *params)
+{
+ GLfloat fparam[4];
+ switch (pname) {
+ case GL_LIGHT_MODEL_AMBIENT:
+ fparam[0] = INT_TO_FLOAT(params[0]);
+ fparam[1] = INT_TO_FLOAT(params[1]);
+ fparam[2] = INT_TO_FLOAT(params[2]);
+ fparam[3] = INT_TO_FLOAT(params[3]);
+ break;
+ case GL_LIGHT_MODEL_LOCAL_VIEWER:
+ case GL_LIGHT_MODEL_TWO_SIDE:
+ case GL_LIGHT_MODEL_COLOR_CONTROL:
+ fparam[0] = (GLfloat) params[0];
+ fparam[1] = 0.0F;
+ fparam[2] = 0.0F;
+ fparam[3] = 0.0F;
+ break;
+ default:
+ /* Error will be caught later in gl_LightModelfv */
+ ASSIGN_4V(fparam, 0.0F, 0.0F, 0.0F, 0.0F);
+ }
+ save_LightModelfv(pname, fparam);
+}
+
+
+static void GLAPIENTRY
+save_LightModeli(GLenum pname, GLint param)
+{
+ GLint parray[4];
+ parray[0] = param;
+ parray[1] = parray[2] = parray[3] = 0;
+ save_LightModeliv(pname, parray);
+}
+
+
+static void GLAPIENTRY
+save_LineStipple(GLint factor, GLushort pattern)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = alloc_instruction(ctx, OPCODE_LINE_STIPPLE, 2);
+ if (n) {
+ n[1].i = factor;
+ n[2].us = pattern;
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_LineStipple(ctx->Exec, (factor, pattern));
+ }
+}
+
+
+static void GLAPIENTRY
+save_LineWidth(GLfloat width)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = alloc_instruction(ctx, OPCODE_LINE_WIDTH, 1);
+ if (n) {
+ n[1].f = width;
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_LineWidth(ctx->Exec, (width));
+ }
+}
+
+
+static void GLAPIENTRY
+save_ListBase(GLuint base)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = alloc_instruction(ctx, OPCODE_LIST_BASE, 1);
+ if (n) {
+ n[1].ui = base;
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_ListBase(ctx->Exec, (base));
+ }
+}
+
+
+static void GLAPIENTRY
+save_LoadIdentity(void)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ (void) alloc_instruction(ctx, OPCODE_LOAD_IDENTITY, 0);
+ if (ctx->ExecuteFlag) {
+ CALL_LoadIdentity(ctx->Exec, ());
+ }
+}
+
+
+static void GLAPIENTRY
+save_LoadMatrixf(const GLfloat * m)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = alloc_instruction(ctx, OPCODE_LOAD_MATRIX, 16);
+ if (n) {
+ GLuint i;
+ for (i = 0; i < 16; i++) {
+ n[1 + i].f = m[i];
+ }
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_LoadMatrixf(ctx->Exec, (m));
+ }
+}
+
+
+static void GLAPIENTRY
+save_LoadMatrixd(const GLdouble * m)
+{
+ GLfloat f[16];
+ GLint i;
+ for (i = 0; i < 16; i++) {
+ f[i] = (GLfloat) m[i];
+ }
+ save_LoadMatrixf(f);
+}
+
+
+static void GLAPIENTRY
+save_LoadName(GLuint name)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = alloc_instruction(ctx, OPCODE_LOAD_NAME, 1);
+ if (n) {
+ n[1].ui = name;
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_LoadName(ctx->Exec, (name));
+ }
+}
+
+
+static void GLAPIENTRY
+save_LogicOp(GLenum opcode)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = alloc_instruction(ctx, OPCODE_LOGIC_OP, 1);
+ if (n) {
+ n[1].e = opcode;
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_LogicOp(ctx->Exec, (opcode));
+ }
+}
+
+
+static void GLAPIENTRY
+save_Map1d(GLenum target, GLdouble u1, GLdouble u2, GLint stride,
+ GLint order, const GLdouble * points)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = alloc_instruction(ctx, OPCODE_MAP1, 6);
+ if (n) {
+ GLfloat *pnts = _mesa_copy_map_points1d(target, stride, order, points);
+ n[1].e = target;
+ n[2].f = (GLfloat) u1;
+ n[3].f = (GLfloat) u2;
+ n[4].i = _mesa_evaluator_components(target); /* stride */
+ n[5].i = order;
+ n[6].data = (void *) pnts;
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_Map1d(ctx->Exec, (target, u1, u2, stride, order, points));
+ }
+}
+
+static void GLAPIENTRY
+save_Map1f(GLenum target, GLfloat u1, GLfloat u2, GLint stride,
+ GLint order, const GLfloat * points)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = alloc_instruction(ctx, OPCODE_MAP1, 6);
+ if (n) {
+ GLfloat *pnts = _mesa_copy_map_points1f(target, stride, order, points);
+ n[1].e = target;
+ n[2].f = u1;
+ n[3].f = u2;
+ n[4].i = _mesa_evaluator_components(target); /* stride */
+ n[5].i = order;
+ n[6].data = (void *) pnts;
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_Map1f(ctx->Exec, (target, u1, u2, stride, order, points));
+ }
+}
+
+
+static void GLAPIENTRY
+save_Map2d(GLenum target,
+ GLdouble u1, GLdouble u2, GLint ustride, GLint uorder,
+ GLdouble v1, GLdouble v2, GLint vstride, GLint vorder,
+ const GLdouble * points)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = alloc_instruction(ctx, OPCODE_MAP2, 10);
+ if (n) {
+ GLfloat *pnts = _mesa_copy_map_points2d(target, ustride, uorder,
+ vstride, vorder, points);
+ n[1].e = target;
+ n[2].f = (GLfloat) u1;
+ n[3].f = (GLfloat) u2;
+ n[4].f = (GLfloat) v1;
+ n[5].f = (GLfloat) v2;
+ /* XXX verify these strides are correct */
+ n[6].i = _mesa_evaluator_components(target) * vorder; /*ustride */
+ n[7].i = _mesa_evaluator_components(target); /*vstride */
+ n[8].i = uorder;
+ n[9].i = vorder;
+ n[10].data = (void *) pnts;
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_Map2d(ctx->Exec, (target,
+ u1, u2, ustride, uorder,
+ v1, v2, vstride, vorder, points));
+ }
+}
+
+
+static void GLAPIENTRY
+save_Map2f(GLenum target,
+ GLfloat u1, GLfloat u2, GLint ustride, GLint uorder,
+ GLfloat v1, GLfloat v2, GLint vstride, GLint vorder,
+ const GLfloat * points)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = alloc_instruction(ctx, OPCODE_MAP2, 10);
+ if (n) {
+ GLfloat *pnts = _mesa_copy_map_points2f(target, ustride, uorder,
+ vstride, vorder, points);
+ n[1].e = target;
+ n[2].f = u1;
+ n[3].f = u2;
+ n[4].f = v1;
+ n[5].f = v2;
+ /* XXX verify these strides are correct */
+ n[6].i = _mesa_evaluator_components(target) * vorder; /*ustride */
+ n[7].i = _mesa_evaluator_components(target); /*vstride */
+ n[8].i = uorder;
+ n[9].i = vorder;
+ n[10].data = (void *) pnts;
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_Map2f(ctx->Exec, (target, u1, u2, ustride, uorder,
+ v1, v2, vstride, vorder, points));
+ }
+}
+
+
+static void GLAPIENTRY
+save_MapGrid1f(GLint un, GLfloat u1, GLfloat u2)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = alloc_instruction(ctx, OPCODE_MAPGRID1, 3);
+ if (n) {
+ n[1].i = un;
+ n[2].f = u1;
+ n[3].f = u2;
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_MapGrid1f(ctx->Exec, (un, u1, u2));
+ }
+}
+
+
+static void GLAPIENTRY
+save_MapGrid1d(GLint un, GLdouble u1, GLdouble u2)
+{
+ save_MapGrid1f(un, (GLfloat) u1, (GLfloat) u2);
+}
+
+
+static void GLAPIENTRY
+save_MapGrid2f(GLint un, GLfloat u1, GLfloat u2,
+ GLint vn, GLfloat v1, GLfloat v2)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = alloc_instruction(ctx, OPCODE_MAPGRID2, 6);
+ if (n) {
+ n[1].i = un;
+ n[2].f = u1;
+ n[3].f = u2;
+ n[4].i = vn;
+ n[5].f = v1;
+ n[6].f = v2;
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_MapGrid2f(ctx->Exec, (un, u1, u2, vn, v1, v2));
+ }
+}
+
+
+
+static void GLAPIENTRY
+save_MapGrid2d(GLint un, GLdouble u1, GLdouble u2,
+ GLint vn, GLdouble v1, GLdouble v2)
+{
+ save_MapGrid2f(un, (GLfloat) u1, (GLfloat) u2,
+ vn, (GLfloat) v1, (GLfloat) v2);
+}
+
+
+static void GLAPIENTRY
+save_MatrixMode(GLenum mode)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = alloc_instruction(ctx, OPCODE_MATRIX_MODE, 1);
+ if (n) {
+ n[1].e = mode;
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_MatrixMode(ctx->Exec, (mode));
+ }
+}
+
+
+static void GLAPIENTRY
+save_Minmax(GLenum target, GLenum internalFormat, GLboolean sink)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = alloc_instruction(ctx, OPCODE_MIN_MAX, 3);
+ if (n) {
+ n[1].e = target;
+ n[2].e = internalFormat;
+ n[3].b = sink;
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_Minmax(ctx->Exec, (target, internalFormat, sink));
+ }
+}
+
+
+static void GLAPIENTRY
+save_MultMatrixf(const GLfloat * m)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = alloc_instruction(ctx, OPCODE_MULT_MATRIX, 16);
+ if (n) {
+ GLuint i;
+ for (i = 0; i < 16; i++) {
+ n[1 + i].f = m[i];
+ }
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_MultMatrixf(ctx->Exec, (m));
+ }
+}
+
+
+static void GLAPIENTRY
+save_MultMatrixd(const GLdouble * m)
+{
+ GLfloat f[16];
+ GLint i;
+ for (i = 0; i < 16; i++) {
+ f[i] = (GLfloat) m[i];
+ }
+ save_MultMatrixf(f);
+}
+
+
+static void GLAPIENTRY
+save_NewList(GLuint name, GLenum mode)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ /* It's an error to call this function while building a display list */
+ _mesa_error(ctx, GL_INVALID_OPERATION, "glNewList");
+ (void) name;
+ (void) mode;
+}
+
+
+
+static void GLAPIENTRY
+save_Ortho(GLdouble left, GLdouble right,
+ GLdouble bottom, GLdouble top, GLdouble nearval, GLdouble farval)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = alloc_instruction(ctx, OPCODE_ORTHO, 6);
+ if (n) {
+ n[1].f = (GLfloat) left;
+ n[2].f = (GLfloat) right;
+ n[3].f = (GLfloat) bottom;
+ n[4].f = (GLfloat) top;
+ n[5].f = (GLfloat) nearval;
+ n[6].f = (GLfloat) farval;
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_Ortho(ctx->Exec, (left, right, bottom, top, nearval, farval));
+ }
+}
+
+
+static void GLAPIENTRY
+save_PixelMapfv(GLenum map, GLint mapsize, const GLfloat *values)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = alloc_instruction(ctx, OPCODE_PIXEL_MAP, 3);
+ if (n) {
+ n[1].e = map;
+ n[2].i = mapsize;
+ n[3].data = (void *) malloc(mapsize * sizeof(GLfloat));
+ memcpy(n[3].data, (void *) values, mapsize * sizeof(GLfloat));
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_PixelMapfv(ctx->Exec, (map, mapsize, values));
+ }
+}
+
+
+static void GLAPIENTRY
+save_PixelMapuiv(GLenum map, GLint mapsize, const GLuint *values)
+{
+ GLfloat fvalues[MAX_PIXEL_MAP_TABLE];
+ GLint i;
+ if (map == GL_PIXEL_MAP_I_TO_I || map == GL_PIXEL_MAP_S_TO_S) {
+ for (i = 0; i < mapsize; i++) {
+ fvalues[i] = (GLfloat) values[i];
+ }
+ }
+ else {
+ for (i = 0; i < mapsize; i++) {
+ fvalues[i] = UINT_TO_FLOAT(values[i]);
+ }
+ }
+ save_PixelMapfv(map, mapsize, fvalues);
+}
+
+
+static void GLAPIENTRY
+save_PixelMapusv(GLenum map, GLint mapsize, const GLushort *values)
+{
+ GLfloat fvalues[MAX_PIXEL_MAP_TABLE];
+ GLint i;
+ if (map == GL_PIXEL_MAP_I_TO_I || map == GL_PIXEL_MAP_S_TO_S) {
+ for (i = 0; i < mapsize; i++) {
+ fvalues[i] = (GLfloat) values[i];
+ }
+ }
+ else {
+ for (i = 0; i < mapsize; i++) {
+ fvalues[i] = USHORT_TO_FLOAT(values[i]);
+ }
+ }
+ save_PixelMapfv(map, mapsize, fvalues);
+}
+
+
+static void GLAPIENTRY
+save_PixelTransferf(GLenum pname, GLfloat param)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = alloc_instruction(ctx, OPCODE_PIXEL_TRANSFER, 2);
+ if (n) {
+ n[1].e = pname;
+ n[2].f = param;
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_PixelTransferf(ctx->Exec, (pname, param));
+ }
+}
+
+
+static void GLAPIENTRY
+save_PixelTransferi(GLenum pname, GLint param)
+{
+ save_PixelTransferf(pname, (GLfloat) param);
+}
+
+
+static void GLAPIENTRY
+save_PixelZoom(GLfloat xfactor, GLfloat yfactor)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = alloc_instruction(ctx, OPCODE_PIXEL_ZOOM, 2);
+ if (n) {
+ n[1].f = xfactor;
+ n[2].f = yfactor;
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_PixelZoom(ctx->Exec, (xfactor, yfactor));
+ }
+}
+
+
+static void GLAPIENTRY
+save_PointParameterfvEXT(GLenum pname, const GLfloat *params)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = alloc_instruction(ctx, OPCODE_POINT_PARAMETERS, 4);
+ if (n) {
+ n[1].e = pname;
+ n[2].f = params[0];
+ n[3].f = params[1];
+ n[4].f = params[2];
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_PointParameterfvEXT(ctx->Exec, (pname, params));
+ }
+}
+
+
+static void GLAPIENTRY
+save_PointParameterfEXT(GLenum pname, GLfloat param)
+{
+ GLfloat parray[3];
+ parray[0] = param;
+ parray[1] = parray[2] = 0.0F;
+ save_PointParameterfvEXT(pname, parray);
+}
+
+static void GLAPIENTRY
+save_PointParameteriNV(GLenum pname, GLint param)
+{
+ GLfloat parray[3];
+ parray[0] = (GLfloat) param;
+ parray[1] = parray[2] = 0.0F;
+ save_PointParameterfvEXT(pname, parray);
+}
+
+static void GLAPIENTRY
+save_PointParameterivNV(GLenum pname, const GLint * param)
+{
+ GLfloat parray[3];
+ parray[0] = (GLfloat) param[0];
+ parray[1] = parray[2] = 0.0F;
+ save_PointParameterfvEXT(pname, parray);
+}
+
+
+static void GLAPIENTRY
+save_PointSize(GLfloat size)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = alloc_instruction(ctx, OPCODE_POINT_SIZE, 1);
+ if (n) {
+ n[1].f = size;
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_PointSize(ctx->Exec, (size));
+ }
+}
+
+
+static void GLAPIENTRY
+save_PolygonMode(GLenum face, GLenum mode)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = alloc_instruction(ctx, OPCODE_POLYGON_MODE, 2);
+ if (n) {
+ n[1].e = face;
+ n[2].e = mode;
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_PolygonMode(ctx->Exec, (face, mode));
+ }
+}
+
+
+static void GLAPIENTRY
+save_PolygonStipple(const GLubyte * pattern)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+
+ n = alloc_instruction(ctx, OPCODE_POLYGON_STIPPLE, 1);
+ if (n) {
+ n[1].data = unpack_image(ctx, 2, 32, 32, 1, GL_COLOR_INDEX, GL_BITMAP,
+ pattern, &ctx->Unpack);
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_PolygonStipple(ctx->Exec, ((GLubyte *) pattern));
+ }
+}
+
+
+static void GLAPIENTRY
+save_PolygonOffset(GLfloat factor, GLfloat units)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = alloc_instruction(ctx, OPCODE_POLYGON_OFFSET, 2);
+ if (n) {
+ n[1].f = factor;
+ n[2].f = units;
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_PolygonOffset(ctx->Exec, (factor, units));
+ }
+}
+
+
+static void GLAPIENTRY
+save_PolygonOffsetEXT(GLfloat factor, GLfloat bias)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ /* XXX mult by DepthMaxF here??? */
+ save_PolygonOffset(factor, ctx->DrawBuffer->_DepthMaxF * bias);
+}
+
+
+static void GLAPIENTRY
+save_PopAttrib(void)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ (void) alloc_instruction(ctx, OPCODE_POP_ATTRIB, 0);
+ if (ctx->ExecuteFlag) {
+ CALL_PopAttrib(ctx->Exec, ());
+ }
+}
+
+
+static void GLAPIENTRY
+save_PopMatrix(void)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ (void) alloc_instruction(ctx, OPCODE_POP_MATRIX, 0);
+ if (ctx->ExecuteFlag) {
+ CALL_PopMatrix(ctx->Exec, ());
+ }
+}
+
+
+static void GLAPIENTRY
+save_PopName(void)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ (void) alloc_instruction(ctx, OPCODE_POP_NAME, 0);
+ if (ctx->ExecuteFlag) {
+ CALL_PopName(ctx->Exec, ());
+ }
+}
+
+
+static void GLAPIENTRY
+save_PrioritizeTextures(GLsizei num, const GLuint * textures,
+ const GLclampf * priorities)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ GLint i;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+
+ for (i = 0; i < num; i++) {
+ Node *n;
+ n = alloc_instruction(ctx, OPCODE_PRIORITIZE_TEXTURE, 2);
+ if (n) {
+ n[1].ui = textures[i];
+ n[2].f = priorities[i];
+ }
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_PrioritizeTextures(ctx->Exec, (num, textures, priorities));
+ }
+}
+
+
+static void GLAPIENTRY
+save_PushAttrib(GLbitfield mask)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = alloc_instruction(ctx, OPCODE_PUSH_ATTRIB, 1);
+ if (n) {
+ n[1].bf = mask;
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_PushAttrib(ctx->Exec, (mask));
+ }
+}
+
+
+static void GLAPIENTRY
+save_PushMatrix(void)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ (void) alloc_instruction(ctx, OPCODE_PUSH_MATRIX, 0);
+ if (ctx->ExecuteFlag) {
+ CALL_PushMatrix(ctx->Exec, ());
+ }
+}
+
+
+static void GLAPIENTRY
+save_PushName(GLuint name)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = alloc_instruction(ctx, OPCODE_PUSH_NAME, 1);
+ if (n) {
+ n[1].ui = name;
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_PushName(ctx->Exec, (name));
+ }
+}
+
+
+static void GLAPIENTRY
+save_RasterPos4f(GLfloat x, GLfloat y, GLfloat z, GLfloat w)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = alloc_instruction(ctx, OPCODE_RASTER_POS, 4);
+ if (n) {
+ n[1].f = x;
+ n[2].f = y;
+ n[3].f = z;
+ n[4].f = w;
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_RasterPos4f(ctx->Exec, (x, y, z, w));
+ }
+}
+
+static void GLAPIENTRY
+save_RasterPos2d(GLdouble x, GLdouble y)
+{
+ save_RasterPos4f((GLfloat) x, (GLfloat) y, 0.0F, 1.0F);
+}
+
+static void GLAPIENTRY
+save_RasterPos2f(GLfloat x, GLfloat y)
+{
+ save_RasterPos4f(x, y, 0.0F, 1.0F);
+}
+
+static void GLAPIENTRY
+save_RasterPos2i(GLint x, GLint y)
+{
+ save_RasterPos4f((GLfloat) x, (GLfloat) y, 0.0F, 1.0F);
+}
+
+static void GLAPIENTRY
+save_RasterPos2s(GLshort x, GLshort y)
+{
+ save_RasterPos4f(x, y, 0.0F, 1.0F);
+}
+
+static void GLAPIENTRY
+save_RasterPos3d(GLdouble x, GLdouble y, GLdouble z)
+{
+ save_RasterPos4f((GLfloat) x, (GLfloat) y, (GLfloat) z, 1.0F);
+}
+
+static void GLAPIENTRY
+save_RasterPos3f(GLfloat x, GLfloat y, GLfloat z)
+{
+ save_RasterPos4f(x, y, z, 1.0F);
+}
+
+static void GLAPIENTRY
+save_RasterPos3i(GLint x, GLint y, GLint z)
+{
+ save_RasterPos4f((GLfloat) x, (GLfloat) y, (GLfloat) z, 1.0F);
+}
+
+static void GLAPIENTRY
+save_RasterPos3s(GLshort x, GLshort y, GLshort z)
+{
+ save_RasterPos4f(x, y, z, 1.0F);
+}
+
+static void GLAPIENTRY
+save_RasterPos4d(GLdouble x, GLdouble y, GLdouble z, GLdouble w)
+{
+ save_RasterPos4f((GLfloat) x, (GLfloat) y, (GLfloat) z, (GLfloat) w);
+}
+
+static void GLAPIENTRY
+save_RasterPos4i(GLint x, GLint y, GLint z, GLint w)
+{
+ save_RasterPos4f((GLfloat) x, (GLfloat) y, (GLfloat) z, (GLfloat) w);
+}
+
+static void GLAPIENTRY
+save_RasterPos4s(GLshort x, GLshort y, GLshort z, GLshort w)
+{
+ save_RasterPos4f(x, y, z, w);
+}
+
+static void GLAPIENTRY
+save_RasterPos2dv(const GLdouble * v)
+{
+ save_RasterPos4f((GLfloat) v[0], (GLfloat) v[1], 0.0F, 1.0F);
+}
+
+static void GLAPIENTRY
+save_RasterPos2fv(const GLfloat * v)
+{
+ save_RasterPos4f(v[0], v[1], 0.0F, 1.0F);
+}
+
+static void GLAPIENTRY
+save_RasterPos2iv(const GLint * v)
+{
+ save_RasterPos4f((GLfloat) v[0], (GLfloat) v[1], 0.0F, 1.0F);
+}
+
+static void GLAPIENTRY
+save_RasterPos2sv(const GLshort * v)
+{
+ save_RasterPos4f(v[0], v[1], 0.0F, 1.0F);
+}
+
+static void GLAPIENTRY
+save_RasterPos3dv(const GLdouble * v)
+{
+ save_RasterPos4f((GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2], 1.0F);
+}
+
+static void GLAPIENTRY
+save_RasterPos3fv(const GLfloat * v)
+{
+ save_RasterPos4f(v[0], v[1], v[2], 1.0F);
+}
+
+static void GLAPIENTRY
+save_RasterPos3iv(const GLint * v)
+{
+ save_RasterPos4f((GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2], 1.0F);
+}
+
+static void GLAPIENTRY
+save_RasterPos3sv(const GLshort * v)
+{
+ save_RasterPos4f(v[0], v[1], v[2], 1.0F);
+}
+
+static void GLAPIENTRY
+save_RasterPos4dv(const GLdouble * v)
+{
+ save_RasterPos4f((GLfloat) v[0], (GLfloat) v[1],
+ (GLfloat) v[2], (GLfloat) v[3]);
+}
+
+static void GLAPIENTRY
+save_RasterPos4fv(const GLfloat * v)
+{
+ save_RasterPos4f(v[0], v[1], v[2], v[3]);
+}
+
+static void GLAPIENTRY
+save_RasterPos4iv(const GLint * v)
+{
+ save_RasterPos4f((GLfloat) v[0], (GLfloat) v[1],
+ (GLfloat) v[2], (GLfloat) v[3]);
+}
+
+static void GLAPIENTRY
+save_RasterPos4sv(const GLshort * v)
+{
+ save_RasterPos4f(v[0], v[1], v[2], v[3]);
+}
+
+
+static void GLAPIENTRY
+save_PassThrough(GLfloat token)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = alloc_instruction(ctx, OPCODE_PASSTHROUGH, 1);
+ if (n) {
+ n[1].f = token;
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_PassThrough(ctx->Exec, (token));
+ }
+}
+
+
+static void GLAPIENTRY
+save_ReadBuffer(GLenum mode)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = alloc_instruction(ctx, OPCODE_READ_BUFFER, 1);
+ if (n) {
+ n[1].e = mode;
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_ReadBuffer(ctx->Exec, (mode));
+ }
+}
+
+
+static void GLAPIENTRY
+save_ResetHistogram(GLenum target)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = alloc_instruction(ctx, OPCODE_RESET_HISTOGRAM, 1);
+ if (n) {
+ n[1].e = target;
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_ResetHistogram(ctx->Exec, (target));
+ }
+}
+
+
+static void GLAPIENTRY
+save_ResetMinmax(GLenum target)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = alloc_instruction(ctx, OPCODE_RESET_MIN_MAX, 1);
+ if (n) {
+ n[1].e = target;
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_ResetMinmax(ctx->Exec, (target));
+ }
+}
+
+
+static void GLAPIENTRY
+save_Rotatef(GLfloat angle, GLfloat x, GLfloat y, GLfloat z)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = alloc_instruction(ctx, OPCODE_ROTATE, 4);
+ if (n) {
+ n[1].f = angle;
+ n[2].f = x;
+ n[3].f = y;
+ n[4].f = z;
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_Rotatef(ctx->Exec, (angle, x, y, z));
+ }
+}
+
+
+static void GLAPIENTRY
+save_Rotated(GLdouble angle, GLdouble x, GLdouble y, GLdouble z)
+{
+ save_Rotatef((GLfloat) angle, (GLfloat) x, (GLfloat) y, (GLfloat) z);
+}
+
+
+static void GLAPIENTRY
+save_Scalef(GLfloat x, GLfloat y, GLfloat z)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = alloc_instruction(ctx, OPCODE_SCALE, 3);
+ if (n) {
+ n[1].f = x;
+ n[2].f = y;
+ n[3].f = z;
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_Scalef(ctx->Exec, (x, y, z));
+ }
+}
+
+
+static void GLAPIENTRY
+save_Scaled(GLdouble x, GLdouble y, GLdouble z)
+{
+ save_Scalef((GLfloat) x, (GLfloat) y, (GLfloat) z);
+}
+
+
+static void GLAPIENTRY
+save_Scissor(GLint x, GLint y, GLsizei width, GLsizei height)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = alloc_instruction(ctx, OPCODE_SCISSOR, 4);
+ if (n) {
+ n[1].i = x;
+ n[2].i = y;
+ n[3].i = width;
+ n[4].i = height;
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_Scissor(ctx->Exec, (x, y, width, height));
+ }
+}
+
+
+static void GLAPIENTRY
+save_ShadeModel(GLenum mode)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END(ctx);
+
+ if (ctx->ExecuteFlag) {
+ CALL_ShadeModel(ctx->Exec, (mode));
+ }
+
+ if (ctx->ListState.Current.ShadeModel == mode)
+ return;
+
+ SAVE_FLUSH_VERTICES(ctx);
+
+ /* Only save the value if we know the statechange will take effect:
+ */
+ if (ctx->Driver.CurrentSavePrimitive == PRIM_OUTSIDE_BEGIN_END)
+ ctx->ListState.Current.ShadeModel = mode;
+
+ n = alloc_instruction(ctx, OPCODE_SHADE_MODEL, 1);
+ if (n) {
+ n[1].e = mode;
+ }
+}
+
+
+static void GLAPIENTRY
+save_StencilFunc(GLenum func, GLint ref, GLuint mask)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = alloc_instruction(ctx, OPCODE_STENCIL_FUNC, 3);
+ if (n) {
+ n[1].e = func;
+ n[2].i = ref;
+ n[3].ui = mask;
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_StencilFunc(ctx->Exec, (func, ref, mask));
+ }
+}
+
+
+static void GLAPIENTRY
+save_StencilMask(GLuint mask)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = alloc_instruction(ctx, OPCODE_STENCIL_MASK, 1);
+ if (n) {
+ n[1].ui = mask;
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_StencilMask(ctx->Exec, (mask));
+ }
+}
+
+
+static void GLAPIENTRY
+save_StencilOp(GLenum fail, GLenum zfail, GLenum zpass)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = alloc_instruction(ctx, OPCODE_STENCIL_OP, 3);
+ if (n) {
+ n[1].e = fail;
+ n[2].e = zfail;
+ n[3].e = zpass;
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_StencilOp(ctx->Exec, (fail, zfail, zpass));
+ }
+}
+
+
+static void GLAPIENTRY
+save_StencilFuncSeparate(GLenum face, GLenum func, GLint ref, GLuint mask)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = alloc_instruction(ctx, OPCODE_STENCIL_FUNC_SEPARATE, 4);
+ if (n) {
+ n[1].e = face;
+ n[2].e = func;
+ n[3].i = ref;
+ n[4].ui = mask;
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_StencilFuncSeparate(ctx->Exec, (face, func, ref, mask));
+ }
+}
+
+
+static void GLAPIENTRY
+save_StencilFuncSeparateATI(GLenum frontfunc, GLenum backfunc, GLint ref,
+ GLuint mask)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ /* GL_FRONT */
+ n = alloc_instruction(ctx, OPCODE_STENCIL_FUNC_SEPARATE, 4);
+ if (n) {
+ n[1].e = GL_FRONT;
+ n[2].e = frontfunc;
+ n[3].i = ref;
+ n[4].ui = mask;
+ }
+ /* GL_BACK */
+ n = alloc_instruction(ctx, OPCODE_STENCIL_FUNC_SEPARATE, 4);
+ if (n) {
+ n[1].e = GL_BACK;
+ n[2].e = backfunc;
+ n[3].i = ref;
+ n[4].ui = mask;
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_StencilFuncSeparate(ctx->Exec, (GL_FRONT, frontfunc, ref, mask));
+ CALL_StencilFuncSeparate(ctx->Exec, (GL_BACK, backfunc, ref, mask));
+ }
+}
+
+
+static void GLAPIENTRY
+save_StencilMaskSeparate(GLenum face, GLuint mask)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = alloc_instruction(ctx, OPCODE_STENCIL_MASK_SEPARATE, 2);
+ if (n) {
+ n[1].e = face;
+ n[2].ui = mask;
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_StencilMaskSeparate(ctx->Exec, (face, mask));
+ }
+}
+
+
+static void GLAPIENTRY
+save_StencilOpSeparate(GLenum face, GLenum fail, GLenum zfail, GLenum zpass)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = alloc_instruction(ctx, OPCODE_STENCIL_OP_SEPARATE, 4);
+ if (n) {
+ n[1].e = face;
+ n[2].e = fail;
+ n[3].e = zfail;
+ n[4].e = zpass;
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_StencilOpSeparate(ctx->Exec, (face, fail, zfail, zpass));
+ }
+}
+
+
+static void GLAPIENTRY
+save_TexEnvfv(GLenum target, GLenum pname, const GLfloat *params)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = alloc_instruction(ctx, OPCODE_TEXENV, 6);
+ if (n) {
+ n[1].e = target;
+ n[2].e = pname;
+ if (pname == GL_TEXTURE_ENV_COLOR) {
+ n[3].f = params[0];
+ n[4].f = params[1];
+ n[5].f = params[2];
+ n[6].f = params[3];
+ }
+ else {
+ n[3].f = params[0];
+ n[4].f = n[5].f = n[6].f = 0.0F;
+ }
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_TexEnvfv(ctx->Exec, (target, pname, params));
+ }
+}
+
+
+static void GLAPIENTRY
+save_TexEnvf(GLenum target, GLenum pname, GLfloat param)
+{
+ GLfloat parray[4];
+ parray[0] = (GLfloat) param;
+ parray[1] = parray[2] = parray[3] = 0.0F;
+ save_TexEnvfv(target, pname, parray);
+}
+
+
+static void GLAPIENTRY
+save_TexEnvi(GLenum target, GLenum pname, GLint param)
+{
+ GLfloat p[4];
+ p[0] = (GLfloat) param;
+ p[1] = p[2] = p[3] = 0.0F;
+ save_TexEnvfv(target, pname, p);
+}
+
+
+static void GLAPIENTRY
+save_TexEnviv(GLenum target, GLenum pname, const GLint * param)
+{
+ GLfloat p[4];
+ if (pname == GL_TEXTURE_ENV_COLOR) {
+ p[0] = INT_TO_FLOAT(param[0]);
+ p[1] = INT_TO_FLOAT(param[1]);
+ p[2] = INT_TO_FLOAT(param[2]);
+ p[3] = INT_TO_FLOAT(param[3]);
+ }
+ else {
+ p[0] = (GLfloat) param[0];
+ p[1] = p[2] = p[3] = 0.0F;
+ }
+ save_TexEnvfv(target, pname, p);
+}
+
+
+static void GLAPIENTRY
+save_TexGenfv(GLenum coord, GLenum pname, const GLfloat *params)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = alloc_instruction(ctx, OPCODE_TEXGEN, 6);
+ if (n) {
+ n[1].e = coord;
+ n[2].e = pname;
+ n[3].f = params[0];
+ n[4].f = params[1];
+ n[5].f = params[2];
+ n[6].f = params[3];
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_TexGenfv(ctx->Exec, (coord, pname, params));
+ }
+}
+
+
+static void GLAPIENTRY
+save_TexGeniv(GLenum coord, GLenum pname, const GLint *params)
+{
+ GLfloat p[4];
+ p[0] = (GLfloat) params[0];
+ p[1] = (GLfloat) params[1];
+ p[2] = (GLfloat) params[2];
+ p[3] = (GLfloat) params[3];
+ save_TexGenfv(coord, pname, p);
+}
+
+
+static void GLAPIENTRY
+save_TexGend(GLenum coord, GLenum pname, GLdouble param)
+{
+ GLfloat parray[4];
+ parray[0] = (GLfloat) param;
+ parray[1] = parray[2] = parray[3] = 0.0F;
+ save_TexGenfv(coord, pname, parray);
+}
+
+
+static void GLAPIENTRY
+save_TexGendv(GLenum coord, GLenum pname, const GLdouble *params)
+{
+ GLfloat p[4];
+ p[0] = (GLfloat) params[0];
+ p[1] = (GLfloat) params[1];
+ p[2] = (GLfloat) params[2];
+ p[3] = (GLfloat) params[3];
+ save_TexGenfv(coord, pname, p);
+}
+
+
+static void GLAPIENTRY
+save_TexGenf(GLenum coord, GLenum pname, GLfloat param)
+{
+ GLfloat parray[4];
+ parray[0] = param;
+ parray[1] = parray[2] = parray[3] = 0.0F;
+ save_TexGenfv(coord, pname, parray);
+}
+
+
+static void GLAPIENTRY
+save_TexGeni(GLenum coord, GLenum pname, GLint param)
+{
+ GLint parray[4];
+ parray[0] = param;
+ parray[1] = parray[2] = parray[3] = 0;
+ save_TexGeniv(coord, pname, parray);
+}
+
+
+static void GLAPIENTRY
+save_TexParameterfv(GLenum target, GLenum pname, const GLfloat *params)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = alloc_instruction(ctx, OPCODE_TEXPARAMETER, 6);
+ if (n) {
+ n[1].e = target;
+ n[2].e = pname;
+ n[3].f = params[0];
+ n[4].f = params[1];
+ n[5].f = params[2];
+ n[6].f = params[3];
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_TexParameterfv(ctx->Exec, (target, pname, params));
+ }
+}
+
+
+static void GLAPIENTRY
+save_TexParameterf(GLenum target, GLenum pname, GLfloat param)
+{
+ GLfloat parray[4];
+ parray[0] = param;
+ parray[1] = parray[2] = parray[3] = 0.0F;
+ save_TexParameterfv(target, pname, parray);
+}
+
+
+static void GLAPIENTRY
+save_TexParameteri(GLenum target, GLenum pname, GLint param)
+{
+ GLfloat fparam[4];
+ fparam[0] = (GLfloat) param;
+ fparam[1] = fparam[2] = fparam[3] = 0.0F;
+ save_TexParameterfv(target, pname, fparam);
+}
+
+
+static void GLAPIENTRY
+save_TexParameteriv(GLenum target, GLenum pname, const GLint *params)
+{
+ GLfloat fparam[4];
+ fparam[0] = (GLfloat) params[0];
+ fparam[1] = fparam[2] = fparam[3] = 0.0F;
+ save_TexParameterfv(target, pname, fparam);
+}
+
+
+static void GLAPIENTRY
+save_TexImage1D(GLenum target,
+ GLint level, GLint components,
+ GLsizei width, GLint border,
+ GLenum format, GLenum type, const GLvoid * pixels)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ if (target == GL_PROXY_TEXTURE_1D) {
+ /* don't compile, execute immediately */
+ CALL_TexImage1D(ctx->Exec, (target, level, components, width,
+ border, format, type, pixels));
+ }
+ else {
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = alloc_instruction(ctx, OPCODE_TEX_IMAGE1D, 8);
+ if (n) {
+ n[1].e = target;
+ n[2].i = level;
+ n[3].i = components;
+ n[4].i = (GLint) width;
+ n[5].i = border;
+ n[6].e = format;
+ n[7].e = type;
+ n[8].data = unpack_image(ctx, 1, width, 1, 1, format, type,
+ pixels, &ctx->Unpack);
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_TexImage1D(ctx->Exec, (target, level, components, width,
+ border, format, type, pixels));
+ }
+ }
+}
+
+
+static void GLAPIENTRY
+save_TexImage2D(GLenum target,
+ GLint level, GLint components,
+ GLsizei width, GLsizei height, GLint border,
+ GLenum format, GLenum type, const GLvoid * pixels)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ if (target == GL_PROXY_TEXTURE_2D) {
+ /* don't compile, execute immediately */
+ CALL_TexImage2D(ctx->Exec, (target, level, components, width,
+ height, border, format, type, pixels));
+ }
+ else {
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = alloc_instruction(ctx, OPCODE_TEX_IMAGE2D, 9);
+ if (n) {
+ n[1].e = target;
+ n[2].i = level;
+ n[3].i = components;
+ n[4].i = (GLint) width;
+ n[5].i = (GLint) height;
+ n[6].i = border;
+ n[7].e = format;
+ n[8].e = type;
+ n[9].data = unpack_image(ctx, 2, width, height, 1, format, type,
+ pixels, &ctx->Unpack);
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_TexImage2D(ctx->Exec, (target, level, components, width,
+ height, border, format, type, pixels));
+ }
+ }
+}
+
+
+static void GLAPIENTRY
+save_TexImage3D(GLenum target,
+ GLint level, GLint internalFormat,
+ GLsizei width, GLsizei height, GLsizei depth,
+ GLint border,
+ GLenum format, GLenum type, const GLvoid * pixels)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ if (target == GL_PROXY_TEXTURE_3D) {
+ /* don't compile, execute immediately */
+ CALL_TexImage3D(ctx->Exec, (target, level, internalFormat, width,
+ height, depth, border, format, type,
+ pixels));
+ }
+ else {
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = alloc_instruction(ctx, OPCODE_TEX_IMAGE3D, 10);
+ if (n) {
+ n[1].e = target;
+ n[2].i = level;
+ n[3].i = (GLint) internalFormat;
+ n[4].i = (GLint) width;
+ n[5].i = (GLint) height;
+ n[6].i = (GLint) depth;
+ n[7].i = border;
+ n[8].e = format;
+ n[9].e = type;
+ n[10].data = unpack_image(ctx, 3, width, height, depth, format, type,
+ pixels, &ctx->Unpack);
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_TexImage3D(ctx->Exec, (target, level, internalFormat, width,
+ height, depth, border, format, type,
+ pixels));
+ }
+ }
+}
+
+
+static void GLAPIENTRY
+save_TexSubImage1D(GLenum target, GLint level, GLint xoffset,
+ GLsizei width, GLenum format, GLenum type,
+ const GLvoid * pixels)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+
+ n = alloc_instruction(ctx, OPCODE_TEX_SUB_IMAGE1D, 7);
+ if (n) {
+ n[1].e = target;
+ n[2].i = level;
+ n[3].i = xoffset;
+ n[4].i = (GLint) width;
+ n[5].e = format;
+ n[6].e = type;
+ n[7].data = unpack_image(ctx, 1, width, 1, 1, format, type,
+ pixels, &ctx->Unpack);
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_TexSubImage1D(ctx->Exec, (target, level, xoffset, width,
+ format, type, pixels));
+ }
+}
+
+
+static void GLAPIENTRY
+save_TexSubImage2D(GLenum target, GLint level,
+ GLint xoffset, GLint yoffset,
+ GLsizei width, GLsizei height,
+ GLenum format, GLenum type, const GLvoid * pixels)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+
+ n = alloc_instruction(ctx, OPCODE_TEX_SUB_IMAGE2D, 9);
+ if (n) {
+ n[1].e = target;
+ n[2].i = level;
+ n[3].i = xoffset;
+ n[4].i = yoffset;
+ n[5].i = (GLint) width;
+ n[6].i = (GLint) height;
+ n[7].e = format;
+ n[8].e = type;
+ n[9].data = unpack_image(ctx, 2, width, height, 1, format, type,
+ pixels, &ctx->Unpack);
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_TexSubImage2D(ctx->Exec, (target, level, xoffset, yoffset,
+ width, height, format, type, pixels));
+ }
+}
+
+
+static void GLAPIENTRY
+save_TexSubImage3D(GLenum target, GLint level,
+ GLint xoffset, GLint yoffset, GLint zoffset,
+ GLsizei width, GLsizei height, GLsizei depth,
+ GLenum format, GLenum type, const GLvoid * pixels)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+
+ n = alloc_instruction(ctx, OPCODE_TEX_SUB_IMAGE3D, 11);
+ if (n) {
+ n[1].e = target;
+ n[2].i = level;
+ n[3].i = xoffset;
+ n[4].i = yoffset;
+ n[5].i = zoffset;
+ n[6].i = (GLint) width;
+ n[7].i = (GLint) height;
+ n[8].i = (GLint) depth;
+ n[9].e = format;
+ n[10].e = type;
+ n[11].data = unpack_image(ctx, 3, width, height, depth, format, type,
+ pixels, &ctx->Unpack);
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_TexSubImage3D(ctx->Exec, (target, level,
+ xoffset, yoffset, zoffset,
+ width, height, depth, format, type,
+ pixels));
+ }
+}
+
+
+static void GLAPIENTRY
+save_Translatef(GLfloat x, GLfloat y, GLfloat z)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = alloc_instruction(ctx, OPCODE_TRANSLATE, 3);
+ if (n) {
+ n[1].f = x;
+ n[2].f = y;
+ n[3].f = z;
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_Translatef(ctx->Exec, (x, y, z));
+ }
+}
+
+
+static void GLAPIENTRY
+save_Translated(GLdouble x, GLdouble y, GLdouble z)
+{
+ save_Translatef((GLfloat) x, (GLfloat) y, (GLfloat) z);
+}
+
+
+
+static void GLAPIENTRY
+save_Viewport(GLint x, GLint y, GLsizei width, GLsizei height)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = alloc_instruction(ctx, OPCODE_VIEWPORT, 4);
+ if (n) {
+ n[1].i = x;
+ n[2].i = y;
+ n[3].i = (GLint) width;
+ n[4].i = (GLint) height;
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_Viewport(ctx->Exec, (x, y, width, height));
+ }
+}
+
+
+static void GLAPIENTRY
+save_WindowPos4fMESA(GLfloat x, GLfloat y, GLfloat z, GLfloat w)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = alloc_instruction(ctx, OPCODE_WINDOW_POS, 4);
+ if (n) {
+ n[1].f = x;
+ n[2].f = y;
+ n[3].f = z;
+ n[4].f = w;
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_WindowPos4fMESA(ctx->Exec, (x, y, z, w));
+ }
+}
+
+static void GLAPIENTRY
+save_WindowPos2dMESA(GLdouble x, GLdouble y)
+{
+ save_WindowPos4fMESA((GLfloat) x, (GLfloat) y, 0.0F, 1.0F);
+}
+
+static void GLAPIENTRY
+save_WindowPos2fMESA(GLfloat x, GLfloat y)
+{
+ save_WindowPos4fMESA(x, y, 0.0F, 1.0F);
+}
+
+static void GLAPIENTRY
+save_WindowPos2iMESA(GLint x, GLint y)
+{
+ save_WindowPos4fMESA((GLfloat) x, (GLfloat) y, 0.0F, 1.0F);
+}
+
+static void GLAPIENTRY
+save_WindowPos2sMESA(GLshort x, GLshort y)
+{
+ save_WindowPos4fMESA(x, y, 0.0F, 1.0F);
+}
+
+static void GLAPIENTRY
+save_WindowPos3dMESA(GLdouble x, GLdouble y, GLdouble z)
+{
+ save_WindowPos4fMESA((GLfloat) x, (GLfloat) y, (GLfloat) z, 1.0F);
+}
+
+static void GLAPIENTRY
+save_WindowPos3fMESA(GLfloat x, GLfloat y, GLfloat z)
+{
+ save_WindowPos4fMESA(x, y, z, 1.0F);
+}
+
+static void GLAPIENTRY
+save_WindowPos3iMESA(GLint x, GLint y, GLint z)
+{
+ save_WindowPos4fMESA((GLfloat) x, (GLfloat) y, (GLfloat) z, 1.0F);
+}
+
+static void GLAPIENTRY
+save_WindowPos3sMESA(GLshort x, GLshort y, GLshort z)
+{
+ save_WindowPos4fMESA(x, y, z, 1.0F);
+}
+
+static void GLAPIENTRY
+save_WindowPos4dMESA(GLdouble x, GLdouble y, GLdouble z, GLdouble w)
+{
+ save_WindowPos4fMESA((GLfloat) x, (GLfloat) y, (GLfloat) z, (GLfloat) w);
+}
+
+static void GLAPIENTRY
+save_WindowPos4iMESA(GLint x, GLint y, GLint z, GLint w)
+{
+ save_WindowPos4fMESA((GLfloat) x, (GLfloat) y, (GLfloat) z, (GLfloat) w);
+}
+
+static void GLAPIENTRY
+save_WindowPos4sMESA(GLshort x, GLshort y, GLshort z, GLshort w)
+{
+ save_WindowPos4fMESA(x, y, z, w);
+}
+
+static void GLAPIENTRY
+save_WindowPos2dvMESA(const GLdouble * v)
+{
+ save_WindowPos4fMESA((GLfloat) v[0], (GLfloat) v[1], 0.0F, 1.0F);
+}
+
+static void GLAPIENTRY
+save_WindowPos2fvMESA(const GLfloat * v)
+{
+ save_WindowPos4fMESA(v[0], v[1], 0.0F, 1.0F);
+}
+
+static void GLAPIENTRY
+save_WindowPos2ivMESA(const GLint * v)
+{
+ save_WindowPos4fMESA((GLfloat) v[0], (GLfloat) v[1], 0.0F, 1.0F);
+}
+
+static void GLAPIENTRY
+save_WindowPos2svMESA(const GLshort * v)
+{
+ save_WindowPos4fMESA(v[0], v[1], 0.0F, 1.0F);
+}
+
+static void GLAPIENTRY
+save_WindowPos3dvMESA(const GLdouble * v)
+{
+ save_WindowPos4fMESA((GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2], 1.0F);
+}
+
+static void GLAPIENTRY
+save_WindowPos3fvMESA(const GLfloat * v)
+{
+ save_WindowPos4fMESA(v[0], v[1], v[2], 1.0F);
+}
+
+static void GLAPIENTRY
+save_WindowPos3ivMESA(const GLint * v)
+{
+ save_WindowPos4fMESA((GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2], 1.0F);
+}
+
+static void GLAPIENTRY
+save_WindowPos3svMESA(const GLshort * v)
+{
+ save_WindowPos4fMESA(v[0], v[1], v[2], 1.0F);
+}
+
+static void GLAPIENTRY
+save_WindowPos4dvMESA(const GLdouble * v)
+{
+ save_WindowPos4fMESA((GLfloat) v[0], (GLfloat) v[1],
+ (GLfloat) v[2], (GLfloat) v[3]);
+}
+
+static void GLAPIENTRY
+save_WindowPos4fvMESA(const GLfloat * v)
+{
+ save_WindowPos4fMESA(v[0], v[1], v[2], v[3]);
+}
+
+static void GLAPIENTRY
+save_WindowPos4ivMESA(const GLint * v)
+{
+ save_WindowPos4fMESA((GLfloat) v[0], (GLfloat) v[1],
+ (GLfloat) v[2], (GLfloat) v[3]);
+}
+
+static void GLAPIENTRY
+save_WindowPos4svMESA(const GLshort * v)
+{
+ save_WindowPos4fMESA(v[0], v[1], v[2], v[3]);
+}
+
+
+
+/* GL_ARB_multitexture */
+static void GLAPIENTRY
+save_ActiveTextureARB(GLenum target)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = alloc_instruction(ctx, OPCODE_ACTIVE_TEXTURE, 1);
+ if (n) {
+ n[1].e = target;
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_ActiveTextureARB(ctx->Exec, (target));
+ }
+}
+
+
+/* GL_ARB_transpose_matrix */
+
+static void GLAPIENTRY
+save_LoadTransposeMatrixdARB(const GLdouble m[16])
+{
+ GLfloat tm[16];
+ _math_transposefd(tm, m);
+ save_LoadMatrixf(tm);
+}
+
+
+static void GLAPIENTRY
+save_LoadTransposeMatrixfARB(const GLfloat m[16])
+{
+ GLfloat tm[16];
+ _math_transposef(tm, m);
+ save_LoadMatrixf(tm);
+}
+
+
+static void GLAPIENTRY
+save_MultTransposeMatrixdARB(const GLdouble m[16])
+{
+ GLfloat tm[16];
+ _math_transposefd(tm, m);
+ save_MultMatrixf(tm);
+}
+
+
+static void GLAPIENTRY
+save_MultTransposeMatrixfARB(const GLfloat m[16])
+{
+ GLfloat tm[16];
+ _math_transposef(tm, m);
+ save_MultMatrixf(tm);
+}
+
+
+/* GL_ARB_texture_compression */
+static void GLAPIENTRY
+save_CompressedTexImage1DARB(GLenum target, GLint level,
+ GLenum internalFormat, GLsizei width,
+ GLint border, GLsizei imageSize,
+ const GLvoid * data)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ if (target == GL_PROXY_TEXTURE_1D) {
+ /* don't compile, execute immediately */
+ CALL_CompressedTexImage1DARB(ctx->Exec, (target, level, internalFormat,
+ width, border, imageSize,
+ data));
+ }
+ else {
+ Node *n;
+ GLvoid *image;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ /* make copy of image */
+ image = malloc(imageSize);
+ if (!image) {
+ _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCompressedTexImage1DARB");
+ return;
+ }
+ memcpy(image, data, imageSize);
+ n = alloc_instruction(ctx, OPCODE_COMPRESSED_TEX_IMAGE_1D, 7);
+ if (n) {
+ n[1].e = target;
+ n[2].i = level;
+ n[3].e = internalFormat;
+ n[4].i = (GLint) width;
+ n[5].i = border;
+ n[6].i = imageSize;
+ n[7].data = image;
+ }
+ else if (image) {
+ free(image);
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_CompressedTexImage1DARB(ctx->Exec,
+ (target, level, internalFormat, width,
+ border, imageSize, data));
+ }
+ }
+}
+
+
+static void GLAPIENTRY
+save_CompressedTexImage2DARB(GLenum target, GLint level,
+ GLenum internalFormat, GLsizei width,
+ GLsizei height, GLint border, GLsizei imageSize,
+ const GLvoid * data)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ if (target == GL_PROXY_TEXTURE_2D) {
+ /* don't compile, execute immediately */
+ CALL_CompressedTexImage2DARB(ctx->Exec, (target, level, internalFormat,
+ width, height, border,
+ imageSize, data));
+ }
+ else {
+ Node *n;
+ GLvoid *image;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ /* make copy of image */
+ image = malloc(imageSize);
+ if (!image) {
+ _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCompressedTexImage2DARB");
+ return;
+ }
+ memcpy(image, data, imageSize);
+ n = alloc_instruction(ctx, OPCODE_COMPRESSED_TEX_IMAGE_2D, 8);
+ if (n) {
+ n[1].e = target;
+ n[2].i = level;
+ n[3].e = internalFormat;
+ n[4].i = (GLint) width;
+ n[5].i = (GLint) height;
+ n[6].i = border;
+ n[7].i = imageSize;
+ n[8].data = image;
+ }
+ else if (image) {
+ free(image);
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_CompressedTexImage2DARB(ctx->Exec,
+ (target, level, internalFormat, width,
+ height, border, imageSize, data));
+ }
+ }
+}
+
+
+static void GLAPIENTRY
+save_CompressedTexImage3DARB(GLenum target, GLint level,
+ GLenum internalFormat, GLsizei width,
+ GLsizei height, GLsizei depth, GLint border,
+ GLsizei imageSize, const GLvoid * data)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ if (target == GL_PROXY_TEXTURE_3D) {
+ /* don't compile, execute immediately */
+ CALL_CompressedTexImage3DARB(ctx->Exec, (target, level, internalFormat,
+ width, height, depth, border,
+ imageSize, data));
+ }
+ else {
+ Node *n;
+ GLvoid *image;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ /* make copy of image */
+ image = malloc(imageSize);
+ if (!image) {
+ _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCompressedTexImage3DARB");
+ return;
+ }
+ memcpy(image, data, imageSize);
+ n = alloc_instruction(ctx, OPCODE_COMPRESSED_TEX_IMAGE_3D, 9);
+ if (n) {
+ n[1].e = target;
+ n[2].i = level;
+ n[3].e = internalFormat;
+ n[4].i = (GLint) width;
+ n[5].i = (GLint) height;
+ n[6].i = (GLint) depth;
+ n[7].i = border;
+ n[8].i = imageSize;
+ n[9].data = image;
+ }
+ else if (image) {
+ free(image);
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_CompressedTexImage3DARB(ctx->Exec,
+ (target, level, internalFormat, width,
+ height, depth, border, imageSize,
+ data));
+ }
+ }
+}
+
+
+static void GLAPIENTRY
+save_CompressedTexSubImage1DARB(GLenum target, GLint level, GLint xoffset,
+ GLsizei width, GLenum format,
+ GLsizei imageSize, const GLvoid * data)
+{
+ Node *n;
+ GLvoid *image;
+
+ GET_CURRENT_CONTEXT(ctx);
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+
+ /* make copy of image */
+ image = malloc(imageSize);
+ if (!image) {
+ _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCompressedTexSubImage1DARB");
+ return;
+ }
+ memcpy(image, data, imageSize);
+ n = alloc_instruction(ctx, OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D, 7);
+ if (n) {
+ n[1].e = target;
+ n[2].i = level;
+ n[3].i = xoffset;
+ n[4].i = (GLint) width;
+ n[5].e = format;
+ n[6].i = imageSize;
+ n[7].data = image;
+ }
+ else if (image) {
+ free(image);
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_CompressedTexSubImage1DARB(ctx->Exec, (target, level, xoffset,
+ width, format, imageSize,
+ data));
+ }
+}
+
+
+static void GLAPIENTRY
+save_CompressedTexSubImage2DARB(GLenum target, GLint level, GLint xoffset,
+ GLint yoffset, GLsizei width, GLsizei height,
+ GLenum format, GLsizei imageSize,
+ const GLvoid * data)
+{
+ Node *n;
+ GLvoid *image;
+
+ GET_CURRENT_CONTEXT(ctx);
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+
+ /* make copy of image */
+ image = malloc(imageSize);
+ if (!image) {
+ _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCompressedTexSubImage2DARB");
+ return;
+ }
+ memcpy(image, data, imageSize);
+ n = alloc_instruction(ctx, OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D, 9);
+ if (n) {
+ n[1].e = target;
+ n[2].i = level;
+ n[3].i = xoffset;
+ n[4].i = yoffset;
+ n[5].i = (GLint) width;
+ n[6].i = (GLint) height;
+ n[7].e = format;
+ n[8].i = imageSize;
+ n[9].data = image;
+ }
+ else if (image) {
+ free(image);
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_CompressedTexSubImage2DARB(ctx->Exec,
+ (target, level, xoffset, yoffset, width,
+ height, format, imageSize, data));
+ }
+}
+
+
+static void GLAPIENTRY
+save_CompressedTexSubImage3DARB(GLenum target, GLint level, GLint xoffset,
+ GLint yoffset, GLint zoffset, GLsizei width,
+ GLsizei height, GLsizei depth, GLenum format,
+ GLsizei imageSize, const GLvoid * data)
+{
+ Node *n;
+ GLvoid *image;
+
+ GET_CURRENT_CONTEXT(ctx);
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+
+ /* make copy of image */
+ image = malloc(imageSize);
+ if (!image) {
+ _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCompressedTexSubImage3DARB");
+ return;
+ }
+ memcpy(image, data, imageSize);
+ n = alloc_instruction(ctx, OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D, 11);
+ if (n) {
+ n[1].e = target;
+ n[2].i = level;
+ n[3].i = xoffset;
+ n[4].i = yoffset;
+ n[5].i = zoffset;
+ n[6].i = (GLint) width;
+ n[7].i = (GLint) height;
+ n[8].i = (GLint) depth;
+ n[9].e = format;
+ n[10].i = imageSize;
+ n[11].data = image;
+ }
+ else if (image) {
+ free(image);
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_CompressedTexSubImage3DARB(ctx->Exec,
+ (target, level, xoffset, yoffset,
+ zoffset, width, height, depth, format,
+ imageSize, data));
+ }
+}
+
+
+/* GL_ARB_multisample */
+static void GLAPIENTRY
+save_SampleCoverageARB(GLclampf value, GLboolean invert)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = alloc_instruction(ctx, OPCODE_SAMPLE_COVERAGE, 2);
+ if (n) {
+ n[1].f = value;
+ n[2].b = invert;
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_SampleCoverageARB(ctx->Exec, (value, invert));
+ }
+}
+
+
+/*
+ * GL_NV_vertex_program
+ */
+#if FEATURE_NV_vertex_program || FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
+static void GLAPIENTRY
+save_BindProgramNV(GLenum target, GLuint id)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = alloc_instruction(ctx, OPCODE_BIND_PROGRAM_NV, 2);
+ if (n) {
+ n[1].e = target;
+ n[2].ui = id;
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_BindProgramNV(ctx->Exec, (target, id));
+ }
+}
+
+static void GLAPIENTRY
+save_ProgramEnvParameter4fARB(GLenum target, GLuint index,
+ GLfloat x, GLfloat y, GLfloat z, GLfloat w)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = alloc_instruction(ctx, OPCODE_PROGRAM_ENV_PARAMETER_ARB, 6);
+ if (n) {
+ n[1].e = target;
+ n[2].ui = index;
+ n[3].f = x;
+ n[4].f = y;
+ n[5].f = z;
+ n[6].f = w;
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_ProgramEnvParameter4fARB(ctx->Exec, (target, index, x, y, z, w));
+ }
+}
+
+
+static void GLAPIENTRY
+save_ProgramEnvParameter4fvARB(GLenum target, GLuint index,
+ const GLfloat *params)
+{
+ save_ProgramEnvParameter4fARB(target, index, params[0], params[1],
+ params[2], params[3]);
+}
+
+
+static void GLAPIENTRY
+save_ProgramEnvParameters4fvEXT(GLenum target, GLuint index, GLsizei count,
+ const GLfloat * params)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+
+ if (count > 0) {
+ GLint i;
+ const GLfloat * p = params;
+
+ for (i = 0 ; i < count ; i++) {
+ n = alloc_instruction(ctx, OPCODE_PROGRAM_ENV_PARAMETER_ARB, 6);
+ if (n) {
+ n[1].e = target;
+ n[2].ui = index;
+ n[3].f = p[0];
+ n[4].f = p[1];
+ n[5].f = p[2];
+ n[6].f = p[3];
+ p += 4;
+ }
+ }
+ }
+
+ if (ctx->ExecuteFlag) {
+ CALL_ProgramEnvParameters4fvEXT(ctx->Exec, (target, index, count, params));
+ }
+}
+
+
+static void GLAPIENTRY
+save_ProgramEnvParameter4dARB(GLenum target, GLuint index,
+ GLdouble x, GLdouble y, GLdouble z, GLdouble w)
+{
+ save_ProgramEnvParameter4fARB(target, index,
+ (GLfloat) x,
+ (GLfloat) y, (GLfloat) z, (GLfloat) w);
+}
+
+
+static void GLAPIENTRY
+save_ProgramEnvParameter4dvARB(GLenum target, GLuint index,
+ const GLdouble *params)
+{
+ save_ProgramEnvParameter4fARB(target, index,
+ (GLfloat) params[0],
+ (GLfloat) params[1],
+ (GLfloat) params[2], (GLfloat) params[3]);
+}
+
+#endif /* FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program || FEATURE_NV_vertex_program */
+
+#if FEATURE_NV_vertex_program
+static void GLAPIENTRY
+save_ExecuteProgramNV(GLenum target, GLuint id, const GLfloat *params)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = alloc_instruction(ctx, OPCODE_EXECUTE_PROGRAM_NV, 6);
+ if (n) {
+ n[1].e = target;
+ n[2].ui = id;
+ n[3].f = params[0];
+ n[4].f = params[1];
+ n[5].f = params[2];
+ n[6].f = params[3];
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_ExecuteProgramNV(ctx->Exec, (target, id, params));
+ }
+}
+
+
+static void GLAPIENTRY
+save_ProgramParameters4dvNV(GLenum target, GLuint index,
+ GLsizei num, const GLdouble *params)
+{
+ GLint i;
+ for (i = 0; i < num; i++) {
+ save_ProgramEnvParameter4dvARB(target, index + i, params + 4 * i);
+ }
+}
+
+
+static void GLAPIENTRY
+save_ProgramParameters4fvNV(GLenum target, GLuint index,
+ GLsizei num, const GLfloat *params)
+{
+ GLint i;
+ for (i = 0; i < num; i++) {
+ save_ProgramEnvParameter4fvARB(target, index + i, params + 4 * i);
+ }
+}
+
+
+static void GLAPIENTRY
+save_LoadProgramNV(GLenum target, GLuint id, GLsizei len,
+ const GLubyte * program)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+
+ n = alloc_instruction(ctx, OPCODE_LOAD_PROGRAM_NV, 4);
+ if (n) {
+ GLubyte *programCopy = (GLubyte *) malloc(len);
+ if (!programCopy) {
+ _mesa_error(ctx, GL_OUT_OF_MEMORY, "glLoadProgramNV");
+ return;
+ }
+ memcpy(programCopy, program, len);
+ n[1].e = target;
+ n[2].ui = id;
+ n[3].i = len;
+ n[4].data = programCopy;
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_LoadProgramNV(ctx->Exec, (target, id, len, program));
+ }
+}
+
+
+static void GLAPIENTRY
+save_RequestResidentProgramsNV(GLsizei num, const GLuint * ids)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+
+ n = alloc_instruction(ctx, OPCODE_TRACK_MATRIX_NV, 2);
+ if (n) {
+ GLuint *idCopy = (GLuint *) malloc(num * sizeof(GLuint));
+ if (!idCopy) {
+ _mesa_error(ctx, GL_OUT_OF_MEMORY, "glRequestResidentProgramsNV");
+ return;
+ }
+ memcpy(idCopy, ids, num * sizeof(GLuint));
+ n[1].i = num;
+ n[2].data = idCopy;
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_RequestResidentProgramsNV(ctx->Exec, (num, ids));
+ }
+}
+
+
+static void GLAPIENTRY
+save_TrackMatrixNV(GLenum target, GLuint address,
+ GLenum matrix, GLenum transform)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = alloc_instruction(ctx, OPCODE_TRACK_MATRIX_NV, 4);
+ if (n) {
+ n[1].e = target;
+ n[2].ui = address;
+ n[3].e = matrix;
+ n[4].e = transform;
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_TrackMatrixNV(ctx->Exec, (target, address, matrix, transform));
+ }
+}
+#endif /* FEATURE_NV_vertex_program */
+
+
+/*
+ * GL_NV_fragment_program
+ */
+#if FEATURE_NV_fragment_program
+static void GLAPIENTRY
+save_ProgramLocalParameter4fARB(GLenum target, GLuint index,
+ GLfloat x, GLfloat y, GLfloat z, GLfloat w)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = alloc_instruction(ctx, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB, 6);
+ if (n) {
+ n[1].e = target;
+ n[2].ui = index;
+ n[3].f = x;
+ n[4].f = y;
+ n[5].f = z;
+ n[6].f = w;
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_ProgramLocalParameter4fARB(ctx->Exec, (target, index, x, y, z, w));
+ }
+}
+
+
+static void GLAPIENTRY
+save_ProgramLocalParameter4fvARB(GLenum target, GLuint index,
+ const GLfloat *params)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = alloc_instruction(ctx, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB, 6);
+ if (n) {
+ n[1].e = target;
+ n[2].ui = index;
+ n[3].f = params[0];
+ n[4].f = params[1];
+ n[5].f = params[2];
+ n[6].f = params[3];
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_ProgramLocalParameter4fvARB(ctx->Exec, (target, index, params));
+ }
+}
+
+
+static void GLAPIENTRY
+save_ProgramLocalParameters4fvEXT(GLenum target, GLuint index, GLsizei count,
+ const GLfloat *params)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+
+ if (count > 0) {
+ GLint i;
+ const GLfloat * p = params;
+
+ for (i = 0 ; i < count ; i++) {
+ n = alloc_instruction(ctx, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB, 6);
+ if (n) {
+ n[1].e = target;
+ n[2].ui = index;
+ n[3].f = p[0];
+ n[4].f = p[1];
+ n[5].f = p[2];
+ n[6].f = p[3];
+ p += 4;
+ }
+ }
+ }
+
+ if (ctx->ExecuteFlag) {
+ CALL_ProgramLocalParameters4fvEXT(ctx->Exec, (target, index, count, params));
+ }
+}
+
+
+static void GLAPIENTRY
+save_ProgramLocalParameter4dARB(GLenum target, GLuint index,
+ GLdouble x, GLdouble y,
+ GLdouble z, GLdouble w)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = alloc_instruction(ctx, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB, 6);
+ if (n) {
+ n[1].e = target;
+ n[2].ui = index;
+ n[3].f = (GLfloat) x;
+ n[4].f = (GLfloat) y;
+ n[5].f = (GLfloat) z;
+ n[6].f = (GLfloat) w;
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_ProgramLocalParameter4dARB(ctx->Exec, (target, index, x, y, z, w));
+ }
+}
+
+
+static void GLAPIENTRY
+save_ProgramLocalParameter4dvARB(GLenum target, GLuint index,
+ const GLdouble *params)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = alloc_instruction(ctx, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB, 6);
+ if (n) {
+ n[1].e = target;
+ n[2].ui = index;
+ n[3].f = (GLfloat) params[0];
+ n[4].f = (GLfloat) params[1];
+ n[5].f = (GLfloat) params[2];
+ n[6].f = (GLfloat) params[3];
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_ProgramLocalParameter4dvARB(ctx->Exec, (target, index, params));
+ }
+}
+
+static void GLAPIENTRY
+save_ProgramNamedParameter4fNV(GLuint id, GLsizei len, const GLubyte * name,
+ GLfloat x, GLfloat y, GLfloat z, GLfloat w)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+
+ n = alloc_instruction(ctx, OPCODE_PROGRAM_NAMED_PARAMETER_NV, 6);
+ if (n) {
+ GLubyte *nameCopy = (GLubyte *) malloc(len);
+ if (!nameCopy) {
+ _mesa_error(ctx, GL_OUT_OF_MEMORY, "glProgramNamedParameter4fNV");
+ return;
+ }
+ memcpy(nameCopy, name, len);
+ n[1].ui = id;
+ n[2].i = len;
+ n[3].data = nameCopy;
+ n[4].f = x;
+ n[5].f = y;
+ n[6].f = z;
+ n[7].f = w;
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_ProgramNamedParameter4fNV(ctx->Exec, (id, len, name, x, y, z, w));
+ }
+}
+
+
+static void GLAPIENTRY
+save_ProgramNamedParameter4fvNV(GLuint id, GLsizei len, const GLubyte * name,
+ const float v[])
+{
+ save_ProgramNamedParameter4fNV(id, len, name, v[0], v[1], v[2], v[3]);
+}
+
+
+static void GLAPIENTRY
+save_ProgramNamedParameter4dNV(GLuint id, GLsizei len, const GLubyte * name,
+ GLdouble x, GLdouble y, GLdouble z, GLdouble w)
+{
+ save_ProgramNamedParameter4fNV(id, len, name, (GLfloat) x, (GLfloat) y,
+ (GLfloat) z, (GLfloat) w);
+}
+
+
+static void GLAPIENTRY
+save_ProgramNamedParameter4dvNV(GLuint id, GLsizei len, const GLubyte * name,
+ const double v[])
+{
+ save_ProgramNamedParameter4fNV(id, len, name, (GLfloat) v[0],
+ (GLfloat) v[1], (GLfloat) v[2],
+ (GLfloat) v[3]);
+}
+
+#endif /* FEATURE_NV_fragment_program */
+
+
+
+/* GL_EXT_stencil_two_side */
+static void GLAPIENTRY
+save_ActiveStencilFaceEXT(GLenum face)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = alloc_instruction(ctx, OPCODE_ACTIVE_STENCIL_FACE_EXT, 1);
+ if (n) {
+ n[1].e = face;
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_ActiveStencilFaceEXT(ctx->Exec, (face));
+ }
+}
+
+
+/* GL_EXT_depth_bounds_test */
+static void GLAPIENTRY
+save_DepthBoundsEXT(GLclampd zmin, GLclampd zmax)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = alloc_instruction(ctx, OPCODE_DEPTH_BOUNDS_EXT, 2);
+ if (n) {
+ n[1].f = (GLfloat) zmin;
+ n[2].f = (GLfloat) zmax;
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_DepthBoundsEXT(ctx->Exec, (zmin, zmax));
+ }
+}
+
+
+
+#if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
+
+static void GLAPIENTRY
+save_ProgramStringARB(GLenum target, GLenum format, GLsizei len,
+ const GLvoid * string)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+
+ n = alloc_instruction(ctx, OPCODE_PROGRAM_STRING_ARB, 4);
+ if (n) {
+ GLubyte *programCopy = (GLubyte *) malloc(len);
+ if (!programCopy) {
+ _mesa_error(ctx, GL_OUT_OF_MEMORY, "glProgramStringARB");
+ return;
+ }
+ memcpy(programCopy, string, len);
+ n[1].e = target;
+ n[2].e = format;
+ n[3].i = len;
+ n[4].data = programCopy;
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_ProgramStringARB(ctx->Exec, (target, format, len, string));
+ }
+}
+
+#endif /* FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program */
+
+
+#if FEATURE_queryobj
+
+static void GLAPIENTRY
+save_BeginQueryARB(GLenum target, GLuint id)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = alloc_instruction(ctx, OPCODE_BEGIN_QUERY_ARB, 2);
+ if (n) {
+ n[1].e = target;
+ n[2].ui = id;
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_BeginQueryARB(ctx->Exec, (target, id));
+ }
+}
+
+
+static void GLAPIENTRY
+save_EndQueryARB(GLenum target)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = alloc_instruction(ctx, OPCODE_END_QUERY_ARB, 1);
+ if (n) {
+ n[1].e = target;
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_EndQueryARB(ctx->Exec, (target));
+ }
+}
+
+#endif /* FEATURE_queryobj */
+
+
+static void GLAPIENTRY
+save_DrawBuffersARB(GLsizei count, const GLenum * buffers)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = alloc_instruction(ctx, OPCODE_DRAW_BUFFERS_ARB, 1 + MAX_DRAW_BUFFERS);
+ if (n) {
+ GLint i;
+ n[1].i = count;
+ if (count > MAX_DRAW_BUFFERS)
+ count = MAX_DRAW_BUFFERS;
+ for (i = 0; i < count; i++) {
+ n[2 + i].e = buffers[i];
+ }
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_DrawBuffersARB(ctx->Exec, (count, buffers));
+ }
+}
+
+static void GLAPIENTRY
+save_TexBumpParameterfvATI(GLenum pname, const GLfloat *param)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+
+ n = alloc_instruction(ctx, OPCODE_TEX_BUMP_PARAMETER_ATI, 5);
+ if (n) {
+ n[1].ui = pname;
+ n[2].f = param[0];
+ n[3].f = param[1];
+ n[4].f = param[2];
+ n[5].f = param[3];
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_TexBumpParameterfvATI(ctx->Exec, (pname, param));
+ }
+}
+
+static void GLAPIENTRY
+save_TexBumpParameterivATI(GLenum pname, const GLint *param)
+{
+ GLfloat p[4];
+ p[0] = INT_TO_FLOAT(param[0]);
+ p[1] = INT_TO_FLOAT(param[1]);
+ p[2] = INT_TO_FLOAT(param[2]);
+ p[3] = INT_TO_FLOAT(param[3]);
+ save_TexBumpParameterfvATI(pname, p);
+}
+
+#if FEATURE_ATI_fragment_shader
+static void GLAPIENTRY
+save_BindFragmentShaderATI(GLuint id)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+
+ n = alloc_instruction(ctx, OPCODE_BIND_FRAGMENT_SHADER_ATI, 1);
+ if (n) {
+ n[1].ui = id;
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_BindFragmentShaderATI(ctx->Exec, (id));
+ }
+}
+
+static void GLAPIENTRY
+save_SetFragmentShaderConstantATI(GLuint dst, const GLfloat *value)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+
+ n = alloc_instruction(ctx, OPCODE_SET_FRAGMENT_SHADER_CONSTANTS_ATI, 5);
+ if (n) {
+ n[1].ui = dst;
+ n[2].f = value[0];
+ n[3].f = value[1];
+ n[4].f = value[2];
+ n[5].f = value[3];
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_SetFragmentShaderConstantATI(ctx->Exec, (dst, value));
+ }
+}
+#endif
+
+static void GLAPIENTRY
+save_Attr1fNV(GLenum attr, GLfloat x)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ SAVE_FLUSH_VERTICES(ctx);
+ n = alloc_instruction(ctx, OPCODE_ATTR_1F_NV, 2);
+ if (n) {
+ n[1].e = attr;
+ n[2].f = x;
+ }
+
+ ASSERT(attr < MAX_VERTEX_GENERIC_ATTRIBS);
+ ctx->ListState.ActiveAttribSize[attr] = 1;
+ ASSIGN_4V(ctx->ListState.CurrentAttrib[attr], x, 0, 0, 1);
+
+ if (ctx->ExecuteFlag) {
+ CALL_VertexAttrib1fNV(ctx->Exec, (attr, x));
+ }
+}
+
+static void GLAPIENTRY
+save_Attr2fNV(GLenum attr, GLfloat x, GLfloat y)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ SAVE_FLUSH_VERTICES(ctx);
+ n = alloc_instruction(ctx, OPCODE_ATTR_2F_NV, 3);
+ if (n) {
+ n[1].e = attr;
+ n[2].f = x;
+ n[3].f = y;
+ }
+
+ ASSERT(attr < MAX_VERTEX_GENERIC_ATTRIBS);
+ ctx->ListState.ActiveAttribSize[attr] = 2;
+ ASSIGN_4V(ctx->ListState.CurrentAttrib[attr], x, y, 0, 1);
+
+ if (ctx->ExecuteFlag) {
+ CALL_VertexAttrib2fNV(ctx->Exec, (attr, x, y));
+ }
+}
+
+static void GLAPIENTRY
+save_Attr3fNV(GLenum attr, GLfloat x, GLfloat y, GLfloat z)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ SAVE_FLUSH_VERTICES(ctx);
+ n = alloc_instruction(ctx, OPCODE_ATTR_3F_NV, 4);
+ if (n) {
+ n[1].e = attr;
+ n[2].f = x;
+ n[3].f = y;
+ n[4].f = z;
+ }
+
+ ASSERT(attr < MAX_VERTEX_GENERIC_ATTRIBS);
+ ctx->ListState.ActiveAttribSize[attr] = 3;
+ ASSIGN_4V(ctx->ListState.CurrentAttrib[attr], x, y, z, 1);
+
+ if (ctx->ExecuteFlag) {
+ CALL_VertexAttrib3fNV(ctx->Exec, (attr, x, y, z));
+ }
+}
+
+static void GLAPIENTRY
+save_Attr4fNV(GLenum attr, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ SAVE_FLUSH_VERTICES(ctx);
+ n = alloc_instruction(ctx, OPCODE_ATTR_4F_NV, 5);
+ if (n) {
+ n[1].e = attr;
+ n[2].f = x;
+ n[3].f = y;
+ n[4].f = z;
+ n[5].f = w;
+ }
+
+ ASSERT(attr < MAX_VERTEX_GENERIC_ATTRIBS);
+ ctx->ListState.ActiveAttribSize[attr] = 4;
+ ASSIGN_4V(ctx->ListState.CurrentAttrib[attr], x, y, z, w);
+
+ if (ctx->ExecuteFlag) {
+ CALL_VertexAttrib4fNV(ctx->Exec, (attr, x, y, z, w));
+ }
+}
+
+
+static void GLAPIENTRY
+save_Attr1fARB(GLenum attr, GLfloat x)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ SAVE_FLUSH_VERTICES(ctx);
+ n = alloc_instruction(ctx, OPCODE_ATTR_1F_ARB, 2);
+ if (n) {
+ n[1].e = attr;
+ n[2].f = x;
+ }
+
+ ASSERT(attr < MAX_VERTEX_GENERIC_ATTRIBS);
+ ctx->ListState.ActiveAttribSize[attr] = 1;
+ ASSIGN_4V(ctx->ListState.CurrentAttrib[attr], x, 0, 0, 1);
+
+ if (ctx->ExecuteFlag) {
+ CALL_VertexAttrib1fARB(ctx->Exec, (attr, x));
+ }
+}
+
+static void GLAPIENTRY
+save_Attr2fARB(GLenum attr, GLfloat x, GLfloat y)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ SAVE_FLUSH_VERTICES(ctx);
+ n = alloc_instruction(ctx, OPCODE_ATTR_2F_ARB, 3);
+ if (n) {
+ n[1].e = attr;
+ n[2].f = x;
+ n[3].f = y;
+ }
+
+ ASSERT(attr < MAX_VERTEX_GENERIC_ATTRIBS);
+ ctx->ListState.ActiveAttribSize[attr] = 2;
+ ASSIGN_4V(ctx->ListState.CurrentAttrib[attr], x, y, 0, 1);
+
+ if (ctx->ExecuteFlag) {
+ CALL_VertexAttrib2fARB(ctx->Exec, (attr, x, y));
+ }
+}
+
+static void GLAPIENTRY
+save_Attr3fARB(GLenum attr, GLfloat x, GLfloat y, GLfloat z)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ SAVE_FLUSH_VERTICES(ctx);
+ n = alloc_instruction(ctx, OPCODE_ATTR_3F_ARB, 4);
+ if (n) {
+ n[1].e = attr;
+ n[2].f = x;
+ n[3].f = y;
+ n[4].f = z;
+ }
+
+ ASSERT(attr < MAX_VERTEX_GENERIC_ATTRIBS);
+ ctx->ListState.ActiveAttribSize[attr] = 3;
+ ASSIGN_4V(ctx->ListState.CurrentAttrib[attr], x, y, z, 1);
+
+ if (ctx->ExecuteFlag) {
+ CALL_VertexAttrib3fARB(ctx->Exec, (attr, x, y, z));
+ }
+}
+
+static void GLAPIENTRY
+save_Attr4fARB(GLenum attr, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ SAVE_FLUSH_VERTICES(ctx);
+ n = alloc_instruction(ctx, OPCODE_ATTR_4F_ARB, 5);
+ if (n) {
+ n[1].e = attr;
+ n[2].f = x;
+ n[3].f = y;
+ n[4].f = z;
+ n[5].f = w;
+ }
+
+ ASSERT(attr < MAX_VERTEX_GENERIC_ATTRIBS);
+ ctx->ListState.ActiveAttribSize[attr] = 4;
+ ASSIGN_4V(ctx->ListState.CurrentAttrib[attr], x, y, z, w);
+
+ if (ctx->ExecuteFlag) {
+ CALL_VertexAttrib4fARB(ctx->Exec, (attr, x, y, z, w));
+ }
+}
+
+
+static void GLAPIENTRY
+save_EvalCoord1f(GLfloat x)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ SAVE_FLUSH_VERTICES(ctx);
+ n = alloc_instruction(ctx, OPCODE_EVAL_C1, 1);
+ if (n) {
+ n[1].f = x;
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_EvalCoord1f(ctx->Exec, (x));
+ }
+}
+
+static void GLAPIENTRY
+save_EvalCoord1fv(const GLfloat * v)
+{
+ save_EvalCoord1f(v[0]);
+}
+
+static void GLAPIENTRY
+save_EvalCoord2f(GLfloat x, GLfloat y)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ SAVE_FLUSH_VERTICES(ctx);
+ n = alloc_instruction(ctx, OPCODE_EVAL_C2, 2);
+ if (n) {
+ n[1].f = x;
+ n[2].f = y;
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_EvalCoord2f(ctx->Exec, (x, y));
+ }
+}
+
+static void GLAPIENTRY
+save_EvalCoord2fv(const GLfloat * v)
+{
+ save_EvalCoord2f(v[0], v[1]);
+}
+
+
+static void GLAPIENTRY
+save_EvalPoint1(GLint x)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ SAVE_FLUSH_VERTICES(ctx);
+ n = alloc_instruction(ctx, OPCODE_EVAL_P1, 1);
+ if (n) {
+ n[1].i = x;
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_EvalPoint1(ctx->Exec, (x));
+ }
+}
+
+static void GLAPIENTRY
+save_EvalPoint2(GLint x, GLint y)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ SAVE_FLUSH_VERTICES(ctx);
+ n = alloc_instruction(ctx, OPCODE_EVAL_P2, 2);
+ if (n) {
+ n[1].i = x;
+ n[2].i = y;
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_EvalPoint2(ctx->Exec, (x, y));
+ }
+}
+
+static void GLAPIENTRY
+save_Indexf(GLfloat x)
+{
+ save_Attr1fNV(VERT_ATTRIB_COLOR_INDEX, x);
+}
+
+static void GLAPIENTRY
+save_Indexfv(const GLfloat * v)
+{
+ save_Attr1fNV(VERT_ATTRIB_COLOR_INDEX, v[0]);
+}
+
+static void GLAPIENTRY
+save_EdgeFlag(GLboolean x)
+{
+ save_Attr1fNV(VERT_ATTRIB_EDGEFLAG, x ? (GLfloat)1.0 : (GLfloat)0.0);
+}
+
+static INLINE GLboolean compare4fv( const GLfloat *a,
+ const GLfloat *b,
+ GLuint count )
+{
+ return memcmp( a, b, count * sizeof(GLfloat) ) == 0;
+}
+
+
+static void GLAPIENTRY
+save_Materialfv(GLenum face, GLenum pname, const GLfloat * param)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ int args, i;
+ GLuint bitmask;
+
+ switch (face) {
+ case GL_BACK:
+ case GL_FRONT:
+ case GL_FRONT_AND_BACK:
+ break;
+ default:
+ _mesa_compile_error(ctx, GL_INVALID_ENUM, "material(face)");
+ return;
+ }
+
+ switch (pname) {
+ case GL_EMISSION:
+ case GL_AMBIENT:
+ case GL_DIFFUSE:
+ case GL_SPECULAR:
+ case GL_AMBIENT_AND_DIFFUSE:
+ args = 4;
+ break;
+ case GL_SHININESS:
+ args = 1;
+ break;
+ case GL_COLOR_INDEXES:
+ args = 3;
+ break;
+ default:
+ _mesa_compile_error(ctx, GL_INVALID_ENUM, "material(pname)");
+ return;
+ }
+
+ if (ctx->ExecuteFlag) {
+ CALL_Materialfv(ctx->Exec, (face, pname, param));
+ }
+
+ bitmask = _mesa_material_bitmask(ctx, face, pname, ~0, NULL);
+
+ /* Try to eliminate redundant statechanges. Because it is legal to
+ * call glMaterial even inside begin/end calls, don't need to worry
+ * about ctx->Driver.CurrentSavePrimitive here.
+ */
+ for (i = 0; i < MAT_ATTRIB_MAX; i++) {
+ if (bitmask & (1 << i)) {
+ if (ctx->ListState.ActiveMaterialSize[i] == args &&
+ compare4fv(ctx->ListState.CurrentMaterial[i], param, args)) {
+ bitmask &= ~(1 << i);
+ }
+ else {
+ ctx->ListState.ActiveMaterialSize[i] = args;
+ COPY_SZ_4V(ctx->ListState.CurrentMaterial[i], args, param);
+ }
+ }
+ }
+
+ /* If this call has effect, return early:
+ */
+ if (bitmask == 0)
+ return;
+
+ SAVE_FLUSH_VERTICES(ctx);
+
+ n = alloc_instruction(ctx, OPCODE_MATERIAL, 6);
+ if (n) {
+ n[1].e = face;
+ n[2].e = pname;
+ for (i = 0; i < args; i++)
+ n[3 + i].f = param[i];
+ }
+}
+
+static void GLAPIENTRY
+save_Begin(GLenum mode)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ GLboolean error = GL_FALSE;
+
+ if ( /*mode < GL_POINTS || */ mode > GL_POLYGON) {
+ _mesa_compile_error(ctx, GL_INVALID_ENUM, "Begin (mode)");
+ error = GL_TRUE;
+ }
+ else if (ctx->Driver.CurrentSavePrimitive == PRIM_UNKNOWN) {
+ /* Typically the first begin. This may raise an error on
+ * playback, depending on whether CallList is issued from inside
+ * a begin/end or not.
+ */
+ ctx->Driver.CurrentSavePrimitive = PRIM_INSIDE_UNKNOWN_PRIM;
+ }
+ else if (ctx->Driver.CurrentSavePrimitive == PRIM_OUTSIDE_BEGIN_END) {
+ ctx->Driver.CurrentSavePrimitive = mode;
+ }
+ else {
+ _mesa_compile_error(ctx, GL_INVALID_OPERATION, "recursive begin");
+ error = GL_TRUE;
+ }
+
+ if (!error) {
+ /* Give the driver an opportunity to hook in an optimized
+ * display list compiler.
+ */
+ if (ctx->Driver.NotifySaveBegin(ctx, mode))
+ return;
+
+ SAVE_FLUSH_VERTICES(ctx);
+ n = alloc_instruction(ctx, OPCODE_BEGIN, 1);
+ if (n) {
+ n[1].e = mode;
+ }
+ }
+
+ if (ctx->ExecuteFlag) {
+ CALL_Begin(ctx->Exec, (mode));
+ }
+}
+
+static void GLAPIENTRY
+save_End(void)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ SAVE_FLUSH_VERTICES(ctx);
+ (void) alloc_instruction(ctx, OPCODE_END, 0);
+ ctx->Driver.CurrentSavePrimitive = PRIM_OUTSIDE_BEGIN_END;
+ if (ctx->ExecuteFlag) {
+ CALL_End(ctx->Exec, ());
+ }
+}
+
+static void GLAPIENTRY
+save_Rectf(GLfloat a, GLfloat b, GLfloat c, GLfloat d)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ SAVE_FLUSH_VERTICES(ctx);
+ n = alloc_instruction(ctx, OPCODE_RECTF, 4);
+ if (n) {
+ n[1].f = a;
+ n[2].f = b;
+ n[3].f = c;
+ n[4].f = d;
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_Rectf(ctx->Exec, (a, b, c, d));
+ }
+}
+
+
+static void GLAPIENTRY
+save_Vertex2f(GLfloat x, GLfloat y)
+{
+ save_Attr2fNV(VERT_ATTRIB_POS, x, y);
+}
+
+static void GLAPIENTRY
+save_Vertex2fv(const GLfloat * v)
+{
+ save_Attr2fNV(VERT_ATTRIB_POS, v[0], v[1]);
+}
+
+static void GLAPIENTRY
+save_Vertex3f(GLfloat x, GLfloat y, GLfloat z)
+{
+ save_Attr3fNV(VERT_ATTRIB_POS, x, y, z);
+}
+
+static void GLAPIENTRY
+save_Vertex3fv(const GLfloat * v)
+{
+ save_Attr3fNV(VERT_ATTRIB_POS, v[0], v[1], v[2]);
+}
+
+static void GLAPIENTRY
+save_Vertex4f(GLfloat x, GLfloat y, GLfloat z, GLfloat w)
+{
+ save_Attr4fNV(VERT_ATTRIB_POS, x, y, z, w);
+}
+
+static void GLAPIENTRY
+save_Vertex4fv(const GLfloat * v)
+{
+ save_Attr4fNV(VERT_ATTRIB_POS, v[0], v[1], v[2], v[3]);
+}
+
+static void GLAPIENTRY
+save_TexCoord1f(GLfloat x)
+{
+ save_Attr1fNV(VERT_ATTRIB_TEX0, x);
+}
+
+static void GLAPIENTRY
+save_TexCoord1fv(const GLfloat * v)
+{
+ save_Attr1fNV(VERT_ATTRIB_TEX0, v[0]);
+}
+
+static void GLAPIENTRY
+save_TexCoord2f(GLfloat x, GLfloat y)
+{
+ save_Attr2fNV(VERT_ATTRIB_TEX0, x, y);
+}
+
+static void GLAPIENTRY
+save_TexCoord2fv(const GLfloat * v)
+{
+ save_Attr2fNV(VERT_ATTRIB_TEX0, v[0], v[1]);
+}
+
+static void GLAPIENTRY
+save_TexCoord3f(GLfloat x, GLfloat y, GLfloat z)
+{
+ save_Attr3fNV(VERT_ATTRIB_TEX0, x, y, z);
+}
+
+static void GLAPIENTRY
+save_TexCoord3fv(const GLfloat * v)
+{
+ save_Attr3fNV(VERT_ATTRIB_TEX0, v[0], v[1], v[2]);
+}
+
+static void GLAPIENTRY
+save_TexCoord4f(GLfloat x, GLfloat y, GLfloat z, GLfloat w)
+{
+ save_Attr4fNV(VERT_ATTRIB_TEX0, x, y, z, w);
+}
+
+static void GLAPIENTRY
+save_TexCoord4fv(const GLfloat * v)
+{
+ save_Attr4fNV(VERT_ATTRIB_TEX0, v[0], v[1], v[2], v[3]);
+}
+
+static void GLAPIENTRY
+save_Normal3f(GLfloat x, GLfloat y, GLfloat z)
+{
+ save_Attr3fNV(VERT_ATTRIB_NORMAL, x, y, z);
+}
+
+static void GLAPIENTRY
+save_Normal3fv(const GLfloat * v)
+{
+ save_Attr3fNV(VERT_ATTRIB_NORMAL, v[0], v[1], v[2]);
+}
+
+static void GLAPIENTRY
+save_FogCoordfEXT(GLfloat x)
+{
+ save_Attr1fNV(VERT_ATTRIB_FOG, x);
+}
+
+static void GLAPIENTRY
+save_FogCoordfvEXT(const GLfloat * v)
+{
+ save_Attr1fNV(VERT_ATTRIB_FOG, v[0]);
+}
+
+static void GLAPIENTRY
+save_Color3f(GLfloat x, GLfloat y, GLfloat z)
+{
+ save_Attr3fNV(VERT_ATTRIB_COLOR0, x, y, z);
+}
+
+static void GLAPIENTRY
+save_Color3fv(const GLfloat * v)
+{
+ save_Attr3fNV(VERT_ATTRIB_COLOR0, v[0], v[1], v[2]);
+}
+
+static void GLAPIENTRY
+save_Color4f(GLfloat x, GLfloat y, GLfloat z, GLfloat w)
+{
+ save_Attr4fNV(VERT_ATTRIB_COLOR0, x, y, z, w);
+}
+
+static void GLAPIENTRY
+save_Color4fv(const GLfloat * v)
+{
+ save_Attr4fNV(VERT_ATTRIB_COLOR0, v[0], v[1], v[2], v[3]);
+}
+
+static void GLAPIENTRY
+save_SecondaryColor3fEXT(GLfloat x, GLfloat y, GLfloat z)
+{
+ save_Attr3fNV(VERT_ATTRIB_COLOR1, x, y, z);
+}
+
+static void GLAPIENTRY
+save_SecondaryColor3fvEXT(const GLfloat * v)
+{
+ save_Attr3fNV(VERT_ATTRIB_COLOR1, v[0], v[1], v[2]);
+}
+
+
+/* Just call the respective ATTR for texcoord
+ */
+static void GLAPIENTRY
+save_MultiTexCoord1f(GLenum target, GLfloat x)
+{
+ GLuint attr = (target & 0x7) + VERT_ATTRIB_TEX0;
+ save_Attr1fNV(attr, x);
+}
+
+static void GLAPIENTRY
+save_MultiTexCoord1fv(GLenum target, const GLfloat * v)
+{
+ GLuint attr = (target & 0x7) + VERT_ATTRIB_TEX0;
+ save_Attr1fNV(attr, v[0]);
+}
+
+static void GLAPIENTRY
+save_MultiTexCoord2f(GLenum target, GLfloat x, GLfloat y)
+{
+ GLuint attr = (target & 0x7) + VERT_ATTRIB_TEX0;
+ save_Attr2fNV(attr, x, y);
+}
+
+static void GLAPIENTRY
+save_MultiTexCoord2fv(GLenum target, const GLfloat * v)
+{
+ GLuint attr = (target & 0x7) + VERT_ATTRIB_TEX0;
+ save_Attr2fNV(attr, v[0], v[1]);
+}
+
+static void GLAPIENTRY
+save_MultiTexCoord3f(GLenum target, GLfloat x, GLfloat y, GLfloat z)
+{
+ GLuint attr = (target & 0x7) + VERT_ATTRIB_TEX0;
+ save_Attr3fNV(attr, x, y, z);
+}
+
+static void GLAPIENTRY
+save_MultiTexCoord3fv(GLenum target, const GLfloat * v)
+{
+ GLuint attr = (target & 0x7) + VERT_ATTRIB_TEX0;
+ save_Attr3fNV(attr, v[0], v[1], v[2]);
+}
+
+static void GLAPIENTRY
+save_MultiTexCoord4f(GLenum target, GLfloat x, GLfloat y,
+ GLfloat z, GLfloat w)
+{
+ GLuint attr = (target & 0x7) + VERT_ATTRIB_TEX0;
+ save_Attr4fNV(attr, x, y, z, w);
+}
+
+static void GLAPIENTRY
+save_MultiTexCoord4fv(GLenum target, const GLfloat * v)
+{
+ GLuint attr = (target & 0x7) + VERT_ATTRIB_TEX0;
+ save_Attr4fNV(attr, v[0], v[1], v[2], v[3]);
+}
+
+
+/**
+ * Record a GL_INVALID_VALUE error when a invalid vertex attribute
+ * index is found.
+ */
+static void
+index_error(void)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ _mesa_error(ctx, GL_INVALID_VALUE, "VertexAttribf(index)");
+}
+
+
+/* First level for NV_vertex_program:
+ *
+ * Check for errors at compile time?.
+ */
+static void GLAPIENTRY
+save_VertexAttrib1fNV(GLuint index, GLfloat x)
+{
+ if (index < MAX_NV_VERTEX_PROGRAM_INPUTS)
+ save_Attr1fNV(index, x);
+ else
+ index_error();
+}
+
+static void GLAPIENTRY
+save_VertexAttrib1fvNV(GLuint index, const GLfloat * v)
+{
+ if (index < MAX_NV_VERTEX_PROGRAM_INPUTS)
+ save_Attr1fNV(index, v[0]);
+ else
+ index_error();
+}
+
+static void GLAPIENTRY
+save_VertexAttrib2fNV(GLuint index, GLfloat x, GLfloat y)
+{
+ if (index < MAX_NV_VERTEX_PROGRAM_INPUTS)
+ save_Attr2fNV(index, x, y);
+ else
+ index_error();
+}
+
+static void GLAPIENTRY
+save_VertexAttrib2fvNV(GLuint index, const GLfloat * v)
+{
+ if (index < MAX_NV_VERTEX_PROGRAM_INPUTS)
+ save_Attr2fNV(index, v[0], v[1]);
+ else
+ index_error();
+}
+
+static void GLAPIENTRY
+save_VertexAttrib3fNV(GLuint index, GLfloat x, GLfloat y, GLfloat z)
+{
+ if (index < MAX_NV_VERTEX_PROGRAM_INPUTS)
+ save_Attr3fNV(index, x, y, z);
+ else
+ index_error();
+}
+
+static void GLAPIENTRY
+save_VertexAttrib3fvNV(GLuint index, const GLfloat * v)
+{
+ if (index < MAX_NV_VERTEX_PROGRAM_INPUTS)
+ save_Attr3fNV(index, v[0], v[1], v[2]);
+ else
+ index_error();
+}
+
+static void GLAPIENTRY
+save_VertexAttrib4fNV(GLuint index, GLfloat x, GLfloat y,
+ GLfloat z, GLfloat w)
+{
+ if (index < MAX_NV_VERTEX_PROGRAM_INPUTS)
+ save_Attr4fNV(index, x, y, z, w);
+ else
+ index_error();
+}
+
+static void GLAPIENTRY
+save_VertexAttrib4fvNV(GLuint index, const GLfloat * v)
+{
+ if (index < MAX_NV_VERTEX_PROGRAM_INPUTS)
+ save_Attr4fNV(index, v[0], v[1], v[2], v[3]);
+ else
+ index_error();
+}
+
+
+
+
+static void GLAPIENTRY
+save_VertexAttrib1fARB(GLuint index, GLfloat x)
+{
+ if (index < MAX_VERTEX_GENERIC_ATTRIBS)
+ save_Attr1fARB(index, x);
+ else
+ index_error();
+}
+
+static void GLAPIENTRY
+save_VertexAttrib1fvARB(GLuint index, const GLfloat * v)
+{
+ if (index < MAX_VERTEX_GENERIC_ATTRIBS)
+ save_Attr1fARB(index, v[0]);
+ else
+ index_error();
+}
+
+static void GLAPIENTRY
+save_VertexAttrib2fARB(GLuint index, GLfloat x, GLfloat y)
+{
+ if (index < MAX_VERTEX_GENERIC_ATTRIBS)
+ save_Attr2fARB(index, x, y);
+ else
+ index_error();
+}
+
+static void GLAPIENTRY
+save_VertexAttrib2fvARB(GLuint index, const GLfloat * v)
+{
+ if (index < MAX_VERTEX_GENERIC_ATTRIBS)
+ save_Attr2fARB(index, v[0], v[1]);
+ else
+ index_error();
+}
+
+static void GLAPIENTRY
+save_VertexAttrib3fARB(GLuint index, GLfloat x, GLfloat y, GLfloat z)
+{
+ if (index < MAX_VERTEX_GENERIC_ATTRIBS)
+ save_Attr3fARB(index, x, y, z);
+ else
+ index_error();
+}
+
+static void GLAPIENTRY
+save_VertexAttrib3fvARB(GLuint index, const GLfloat * v)
+{
+ if (index < MAX_VERTEX_GENERIC_ATTRIBS)
+ save_Attr3fARB(index, v[0], v[1], v[2]);
+ else
+ index_error();
+}
+
+static void GLAPIENTRY
+save_VertexAttrib4fARB(GLuint index, GLfloat x, GLfloat y, GLfloat z,
+ GLfloat w)
+{
+ if (index < MAX_VERTEX_GENERIC_ATTRIBS)
+ save_Attr4fARB(index, x, y, z, w);
+ else
+ index_error();
+}
+
+static void GLAPIENTRY
+save_VertexAttrib4fvARB(GLuint index, const GLfloat * v)
+{
+ if (index < MAX_VERTEX_GENERIC_ATTRIBS)
+ save_Attr4fARB(index, v[0], v[1], v[2], v[3]);
+ else
+ index_error();
+}
+
+
+/* GL_ARB_shader_objects, GL_ARB_vertex/fragment_shader */
+
+static void GLAPIENTRY
+exec_BindAttribLocationARB(GLuint program, GLuint index, const GLchar *name)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ FLUSH_VERTICES(ctx, 0);
+ CALL_BindAttribLocationARB(ctx->Exec, (program, index, name));
+}
+
+static GLint GLAPIENTRY
+exec_GetAttribLocationARB(GLuint program, const GLchar *name)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ FLUSH_VERTICES(ctx, 0);
+ return CALL_GetAttribLocationARB(ctx->Exec, (program, name));
+}
+
+static GLint GLAPIENTRY
+exec_GetUniformLocationARB(GLuint program, const GLchar *name)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ FLUSH_VERTICES(ctx, 0);
+ return CALL_GetUniformLocationARB(ctx->Exec, (program, name));
+}
+/* XXX more shader functions needed here */
+
+
+#if FEATURE_EXT_framebuffer_blit
+static void GLAPIENTRY
+save_BlitFramebufferEXT(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1,
+ GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1,
+ GLbitfield mask, GLenum filter)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = alloc_instruction(ctx, OPCODE_BLIT_FRAMEBUFFER, 10);
+ if (n) {
+ n[1].i = srcX0;
+ n[2].i = srcY0;
+ n[3].i = srcX1;
+ n[4].i = srcY1;
+ n[5].i = dstX0;
+ n[6].i = dstY0;
+ n[7].i = dstX1;
+ n[8].i = dstY1;
+ n[9].i = mask;
+ n[10].e = filter;
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_BlitFramebufferEXT(ctx->Exec, (srcX0, srcY0, srcX1, srcY1,
+ dstX0, dstY0, dstX1, dstY1,
+ mask, filter));
+ }
+}
+#endif
+
+
+/** GL_EXT_provoking_vertex */
+static void GLAPIENTRY
+save_ProvokingVertexEXT(GLenum mode)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = alloc_instruction(ctx, OPCODE_PROVOKING_VERTEX, 1);
+ if (n) {
+ n[1].e = mode;
+ }
+ if (ctx->ExecuteFlag) {
+ /*CALL_ProvokingVertexEXT(ctx->Exec, (mode));*/
+ _mesa_ProvokingVertexEXT(mode);
+ }
+}
+
+
+/** GL_EXT_transform_feedback */
+static void GLAPIENTRY
+save_BeginTransformFeedback(GLenum mode)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = alloc_instruction(ctx, OPCODE_BEGIN_TRANSFORM_FEEDBACK, 1);
+ if (n) {
+ n[1].e = mode;
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_BeginTransformFeedbackEXT(ctx->Exec, (mode));
+ }
+}
+
+
+/** GL_EXT_transform_feedback */
+static void GLAPIENTRY
+save_EndTransformFeedback(void)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ (void) alloc_instruction(ctx, OPCODE_END_TRANSFORM_FEEDBACK, 0);
+ if (ctx->ExecuteFlag) {
+ CALL_EndTransformFeedbackEXT(ctx->Exec, ());
+ }
+}
+
+
+/* aka UseProgram() */
+static void GLAPIENTRY
+save_UseProgramObjectARB(GLhandleARB program)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = alloc_instruction(ctx, OPCODE_USE_PROGRAM, 1);
+ if (n) {
+ n[1].ui = program;
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_UseProgramObjectARB(ctx->Exec, (program));
+ }
+}
+
+
+static void GLAPIENTRY
+save_Uniform1fARB(GLint location, GLfloat x)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = alloc_instruction(ctx, OPCODE_UNIFORM_1F, 2);
+ if (n) {
+ n[1].i = location;
+ n[2].f = x;
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_Uniform1fARB(ctx->Exec, (location, x));
+ }
+}
+
+
+static void GLAPIENTRY
+save_Uniform2fARB(GLint location, GLfloat x, GLfloat y)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = alloc_instruction(ctx, OPCODE_UNIFORM_2F, 3);
+ if (n) {
+ n[1].i = location;
+ n[2].f = x;
+ n[3].f = y;
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_Uniform2fARB(ctx->Exec, (location, x, y));
+ }
+}
+
+
+static void GLAPIENTRY
+save_Uniform3fARB(GLint location, GLfloat x, GLfloat y, GLfloat z)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = alloc_instruction(ctx, OPCODE_UNIFORM_3F, 4);
+ if (n) {
+ n[1].i = location;
+ n[2].f = x;
+ n[3].f = y;
+ n[4].f = z;
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_Uniform3fARB(ctx->Exec, (location, x, y, z));
+ }
+}
+
+
+static void GLAPIENTRY
+save_Uniform4fARB(GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = alloc_instruction(ctx, OPCODE_UNIFORM_4F, 5);
+ if (n) {
+ n[1].i = location;
+ n[2].f = x;
+ n[3].f = y;
+ n[4].f = z;
+ n[5].f = w;
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_Uniform4fARB(ctx->Exec, (location, x, y, z, w));
+ }
+}
+
+
+/** Return copy of memory */
+static void *
+memdup(const void *src, GLsizei bytes)
+{
+ void *b = bytes >= 0 ? malloc(bytes) : NULL;
+ if (b)
+ memcpy(b, src, bytes);
+ return b;
+}
+
+
+static void GLAPIENTRY
+save_Uniform1fvARB(GLint location, GLsizei count, const GLfloat *v)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = alloc_instruction(ctx, OPCODE_UNIFORM_1FV, 3);
+ if (n) {
+ n[1].i = location;
+ n[2].i = count;
+ n[3].data = memdup(v, count * 1 * sizeof(GLfloat));
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_Uniform1fvARB(ctx->Exec, (location, count, v));
+ }
+}
+
+static void GLAPIENTRY
+save_Uniform2fvARB(GLint location, GLsizei count, const GLfloat *v)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = alloc_instruction(ctx, OPCODE_UNIFORM_2FV, 3);
+ if (n) {
+ n[1].i = location;
+ n[2].i = count;
+ n[3].data = memdup(v, count * 2 * sizeof(GLfloat));
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_Uniform2fvARB(ctx->Exec, (location, count, v));
+ }
+}
+
+static void GLAPIENTRY
+save_Uniform3fvARB(GLint location, GLsizei count, const GLfloat *v)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = alloc_instruction(ctx, OPCODE_UNIFORM_3FV, 3);
+ if (n) {
+ n[1].i = location;
+ n[2].i = count;
+ n[3].data = memdup(v, count * 3 * sizeof(GLfloat));
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_Uniform3fvARB(ctx->Exec, (location, count, v));
+ }
+}
+
+static void GLAPIENTRY
+save_Uniform4fvARB(GLint location, GLsizei count, const GLfloat *v)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = alloc_instruction(ctx, OPCODE_UNIFORM_4FV, 3);
+ if (n) {
+ n[1].i = location;
+ n[2].i = count;
+ n[3].data = memdup(v, count * 4 * sizeof(GLfloat));
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_Uniform4fvARB(ctx->Exec, (location, count, v));
+ }
+}
+
+
+static void GLAPIENTRY
+save_Uniform1iARB(GLint location, GLint x)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = alloc_instruction(ctx, OPCODE_UNIFORM_1I, 2);
+ if (n) {
+ n[1].i = location;
+ n[2].i = x;
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_Uniform1iARB(ctx->Exec, (location, x));
+ }
+}
+
+static void GLAPIENTRY
+save_Uniform2iARB(GLint location, GLint x, GLint y)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = alloc_instruction(ctx, OPCODE_UNIFORM_2I, 3);
+ if (n) {
+ n[1].i = location;
+ n[2].i = x;
+ n[3].i = y;
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_Uniform2iARB(ctx->Exec, (location, x, y));
+ }
+}
+
+static void GLAPIENTRY
+save_Uniform3iARB(GLint location, GLint x, GLint y, GLint z)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = alloc_instruction(ctx, OPCODE_UNIFORM_3I, 4);
+ if (n) {
+ n[1].i = location;
+ n[2].i = x;
+ n[3].i = y;
+ n[4].i = z;
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_Uniform3iARB(ctx->Exec, (location, x, y, z));
+ }
+}
+
+static void GLAPIENTRY
+save_Uniform4iARB(GLint location, GLint x, GLint y, GLint z, GLint w)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = alloc_instruction(ctx, OPCODE_UNIFORM_4I, 5);
+ if (n) {
+ n[1].i = location;
+ n[2].i = x;
+ n[3].i = y;
+ n[4].i = z;
+ n[5].i = w;
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_Uniform4iARB(ctx->Exec, (location, x, y, z, w));
+ }
+}
+
+
+
+static void GLAPIENTRY
+save_Uniform1ivARB(GLint location, GLsizei count, const GLint *v)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = alloc_instruction(ctx, OPCODE_UNIFORM_1IV, 3);
+ if (n) {
+ n[1].i = location;
+ n[2].i = count;
+ n[3].data = memdup(v, count * 1 * sizeof(GLint));
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_Uniform1ivARB(ctx->Exec, (location, count, v));
+ }
+}
+
+static void GLAPIENTRY
+save_Uniform2ivARB(GLint location, GLsizei count, const GLint *v)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = alloc_instruction(ctx, OPCODE_UNIFORM_2IV, 3);
+ if (n) {
+ n[1].i = location;
+ n[2].i = count;
+ n[3].data = memdup(v, count * 2 * sizeof(GLint));
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_Uniform2ivARB(ctx->Exec, (location, count, v));
+ }
+}
+
+static void GLAPIENTRY
+save_Uniform3ivARB(GLint location, GLsizei count, const GLint *v)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = alloc_instruction(ctx, OPCODE_UNIFORM_3IV, 3);
+ if (n) {
+ n[1].i = location;
+ n[2].i = count;
+ n[3].data = memdup(v, count * 3 * sizeof(GLint));
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_Uniform3ivARB(ctx->Exec, (location, count, v));
+ }
+}
+
+static void GLAPIENTRY
+save_Uniform4ivARB(GLint location, GLsizei count, const GLint *v)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = alloc_instruction(ctx, OPCODE_UNIFORM_4IV, 3);
+ if (n) {
+ n[1].i = location;
+ n[2].i = count;
+ n[3].data = memdup(v, count * 4 * sizeof(GLfloat));
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_Uniform4ivARB(ctx->Exec, (location, count, v));
+ }
+}
+
+
+
+static void GLAPIENTRY
+save_Uniform1ui(GLint location, GLuint x)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = alloc_instruction(ctx, OPCODE_UNIFORM_1UI, 2);
+ if (n) {
+ n[1].i = location;
+ n[2].i = x;
+ }
+ if (ctx->ExecuteFlag) {
+ /*CALL_Uniform1ui(ctx->Exec, (location, x));*/
+ }
+}
+
+static void GLAPIENTRY
+save_Uniform2ui(GLint location, GLuint x, GLuint y)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = alloc_instruction(ctx, OPCODE_UNIFORM_2UI, 3);
+ if (n) {
+ n[1].i = location;
+ n[2].i = x;
+ n[3].i = y;
+ }
+ if (ctx->ExecuteFlag) {
+ /*CALL_Uniform2ui(ctx->Exec, (location, x, y));*/
+ }
+}
+
+static void GLAPIENTRY
+save_Uniform3ui(GLint location, GLuint x, GLuint y, GLuint z)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = alloc_instruction(ctx, OPCODE_UNIFORM_3UI, 4);
+ if (n) {
+ n[1].i = location;
+ n[2].i = x;
+ n[3].i = y;
+ n[4].i = z;
+ }
+ if (ctx->ExecuteFlag) {
+ /*CALL_Uniform3ui(ctx->Exec, (location, x, y, z));*/
+ }
+}
+
+static void GLAPIENTRY
+save_Uniform4ui(GLint location, GLuint x, GLuint y, GLuint z, GLuint w)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = alloc_instruction(ctx, OPCODE_UNIFORM_4UI, 5);
+ if (n) {
+ n[1].i = location;
+ n[2].i = x;
+ n[3].i = y;
+ n[4].i = z;
+ n[5].i = w;
+ }
+ if (ctx->ExecuteFlag) {
+ /*CALL_Uniform4ui(ctx->Exec, (location, x, y, z, w));*/
+ }
+}
+
+
+
+static void GLAPIENTRY
+save_Uniform1uiv(GLint location, GLsizei count, const GLuint *v)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = alloc_instruction(ctx, OPCODE_UNIFORM_1UIV, 3);
+ if (n) {
+ n[1].i = location;
+ n[2].i = count;
+ n[3].data = memdup(v, count * 1 * sizeof(*v));
+ }
+ if (ctx->ExecuteFlag) {
+ /*CALL_Uniform1uiv(ctx->Exec, (location, count, v));*/
+ }
+}
+
+static void GLAPIENTRY
+save_Uniform2uiv(GLint location, GLsizei count, const GLuint *v)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = alloc_instruction(ctx, OPCODE_UNIFORM_2UIV, 3);
+ if (n) {
+ n[1].i = location;
+ n[2].i = count;
+ n[3].data = memdup(v, count * 2 * sizeof(*v));
+ }
+ if (ctx->ExecuteFlag) {
+ /*CALL_Uniform2uiv(ctx->Exec, (location, count, v));*/
+ }
+}
+
+static void GLAPIENTRY
+save_Uniform3uiv(GLint location, GLsizei count, const GLuint *v)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = alloc_instruction(ctx, OPCODE_UNIFORM_3UIV, 3);
+ if (n) {
+ n[1].i = location;
+ n[2].i = count;
+ n[3].data = memdup(v, count * 3 * sizeof(*v));
+ }
+ if (ctx->ExecuteFlag) {
+ /*CALL_Uniform3uiv(ctx->Exec, (location, count, v));*/
+ }
+}
+
+static void GLAPIENTRY
+save_Uniform4uiv(GLint location, GLsizei count, const GLuint *v)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = alloc_instruction(ctx, OPCODE_UNIFORM_4UIV, 3);
+ if (n) {
+ n[1].i = location;
+ n[2].i = count;
+ n[3].data = memdup(v, count * 4 * sizeof(*v));
+ }
+ if (ctx->ExecuteFlag) {
+ /*CALL_Uniform4uiv(ctx->Exec, (location, count, v));*/
+ }
+}
+
+
+
+static void GLAPIENTRY
+save_UniformMatrix2fvARB(GLint location, GLsizei count, GLboolean transpose,
+ const GLfloat *m)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = alloc_instruction(ctx, OPCODE_UNIFORM_MATRIX22, 4);
+ if (n) {
+ n[1].i = location;
+ n[2].i = count;
+ n[3].b = transpose;
+ n[4].data = memdup(m, count * 2 * 2 * sizeof(GLfloat));
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_UniformMatrix2fvARB(ctx->Exec, (location, count, transpose, m));
+ }
+}
+
+static void GLAPIENTRY
+save_UniformMatrix3fvARB(GLint location, GLsizei count, GLboolean transpose,
+ const GLfloat *m)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = alloc_instruction(ctx, OPCODE_UNIFORM_MATRIX33, 4);
+ if (n) {
+ n[1].i = location;
+ n[2].i = count;
+ n[3].b = transpose;
+ n[4].data = memdup(m, count * 3 * 3 * sizeof(GLfloat));
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_UniformMatrix3fvARB(ctx->Exec, (location, count, transpose, m));
+ }
+}
+
+static void GLAPIENTRY
+save_UniformMatrix4fvARB(GLint location, GLsizei count, GLboolean transpose,
+ const GLfloat *m)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = alloc_instruction(ctx, OPCODE_UNIFORM_MATRIX44, 4);
+ if (n) {
+ n[1].i = location;
+ n[2].i = count;
+ n[3].b = transpose;
+ n[4].data = memdup(m, count * 4 * 4 * sizeof(GLfloat));
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_UniformMatrix4fvARB(ctx->Exec, (location, count, transpose, m));
+ }
+}
+
+
+static void GLAPIENTRY
+save_UniformMatrix2x3fv(GLint location, GLsizei count, GLboolean transpose,
+ const GLfloat *m)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = alloc_instruction(ctx, OPCODE_UNIFORM_MATRIX23, 4);
+ if (n) {
+ n[1].i = location;
+ n[2].i = count;
+ n[3].b = transpose;
+ n[4].data = memdup(m, count * 2 * 3 * sizeof(GLfloat));
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_UniformMatrix2x3fv(ctx->Exec, (location, count, transpose, m));
+ }
+}
+
+static void GLAPIENTRY
+save_UniformMatrix3x2fv(GLint location, GLsizei count, GLboolean transpose,
+ const GLfloat *m)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = alloc_instruction(ctx, OPCODE_UNIFORM_MATRIX32, 4);
+ if (n) {
+ n[1].i = location;
+ n[2].i = count;
+ n[3].b = transpose;
+ n[4].data = memdup(m, count * 3 * 2 * sizeof(GLfloat));
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_UniformMatrix3x2fv(ctx->Exec, (location, count, transpose, m));
+ }
+}
+
+
+static void GLAPIENTRY
+save_UniformMatrix2x4fv(GLint location, GLsizei count, GLboolean transpose,
+ const GLfloat *m)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = alloc_instruction(ctx, OPCODE_UNIFORM_MATRIX24, 4);
+ if (n) {
+ n[1].i = location;
+ n[2].i = count;
+ n[3].b = transpose;
+ n[4].data = memdup(m, count * 2 * 4 * sizeof(GLfloat));
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_UniformMatrix2x4fv(ctx->Exec, (location, count, transpose, m));
+ }
+}
+
+static void GLAPIENTRY
+save_UniformMatrix4x2fv(GLint location, GLsizei count, GLboolean transpose,
+ const GLfloat *m)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = alloc_instruction(ctx, OPCODE_UNIFORM_MATRIX42, 4);
+ if (n) {
+ n[1].i = location;
+ n[2].i = count;
+ n[3].b = transpose;
+ n[4].data = memdup(m, count * 4 * 2 * sizeof(GLfloat));
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_UniformMatrix4x2fv(ctx->Exec, (location, count, transpose, m));
+ }
+}
+
+
+static void GLAPIENTRY
+save_UniformMatrix3x4fv(GLint location, GLsizei count, GLboolean transpose,
+ const GLfloat *m)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = alloc_instruction(ctx, OPCODE_UNIFORM_MATRIX34, 4);
+ if (n) {
+ n[1].i = location;
+ n[2].i = count;
+ n[3].b = transpose;
+ n[4].data = memdup(m, count * 3 * 4 * sizeof(GLfloat));
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_UniformMatrix3x4fv(ctx->Exec, (location, count, transpose, m));
+ }
+}
+
+static void GLAPIENTRY
+save_UniformMatrix4x3fv(GLint location, GLsizei count, GLboolean transpose,
+ const GLfloat *m)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = alloc_instruction(ctx, OPCODE_UNIFORM_MATRIX43, 4);
+ if (n) {
+ n[1].i = location;
+ n[2].i = count;
+ n[3].b = transpose;
+ n[4].data = memdup(m, count * 4 * 3 * sizeof(GLfloat));
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_UniformMatrix4x3fv(ctx->Exec, (location, count, transpose, m));
+ }
+}
+
+static void GLAPIENTRY
+save_ClampColorARB(GLenum target, GLenum clamp)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = alloc_instruction(ctx, OPCODE_CLAMP_COLOR, 2);
+ if (n) {
+ n[1].e = target;
+ n[2].e = clamp;
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_ClampColorARB(ctx->Exec, (target, clamp));
+ }
+}
+
+static void GLAPIENTRY
+save_UseShaderProgramEXT(GLenum type, GLuint program)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = alloc_instruction(ctx, OPCODE_USE_SHADER_PROGRAM_EXT, 2);
+ if (n) {
+ n[1].ui = type;
+ n[2].ui = program;
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_UseShaderProgramEXT(ctx->Exec, (type, program));
+ }
+}
+
+static void GLAPIENTRY
+save_ActiveProgramEXT(GLuint program)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = alloc_instruction(ctx, OPCODE_ACTIVE_PROGRAM_EXT, 1);
+ if (n) {
+ n[1].ui = program;
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_ActiveProgramEXT(ctx->Exec, (program));
+ }
+}
+
+/** GL_EXT_texture_integer */
+static void GLAPIENTRY
+save_ClearColorIi(GLint red, GLint green, GLint blue, GLint alpha)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = alloc_instruction(ctx, OPCODE_CLEARCOLOR_I, 4);
+ if (n) {
+ n[1].i = red;
+ n[2].i = green;
+ n[3].i = blue;
+ n[4].i = alpha;
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_ClearColorIiEXT(ctx->Exec, (red, green, blue, alpha));
+ }
+}
+
+/** GL_EXT_texture_integer */
+static void GLAPIENTRY
+save_ClearColorIui(GLuint red, GLuint green, GLuint blue, GLuint alpha)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = alloc_instruction(ctx, OPCODE_CLEARCOLOR_UI, 4);
+ if (n) {
+ n[1].ui = red;
+ n[2].ui = green;
+ n[3].ui = blue;
+ n[4].ui = alpha;
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_ClearColorIuiEXT(ctx->Exec, (red, green, blue, alpha));
+ }
+}
+
+/** GL_EXT_texture_integer */
+static void GLAPIENTRY
+save_TexParameterIiv(GLenum target, GLenum pname, const GLint *params)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = alloc_instruction(ctx, OPCODE_TEXPARAMETER_I, 6);
+ if (n) {
+ n[1].e = target;
+ n[2].e = pname;
+ n[3].i = params[0];
+ n[4].i = params[1];
+ n[5].i = params[2];
+ n[6].i = params[3];
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_TexParameterIivEXT(ctx->Exec, (target, pname, params));
+ }
+}
+
+/** GL_EXT_texture_integer */
+static void GLAPIENTRY
+save_TexParameterIuiv(GLenum target, GLenum pname, const GLuint *params)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = alloc_instruction(ctx, OPCODE_TEXPARAMETER_UI, 6);
+ if (n) {
+ n[1].e = target;
+ n[2].e = pname;
+ n[3].ui = params[0];
+ n[4].ui = params[1];
+ n[5].ui = params[2];
+ n[6].ui = params[3];
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_TexParameterIuivEXT(ctx->Exec, (target, pname, params));
+ }
+}
+
+/** GL_EXT_texture_integer */
+static void GLAPIENTRY
+exec_GetTexParameterIiv(GLenum target, GLenum pname, GLint *params)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ FLUSH_VERTICES(ctx, 0);
+ CALL_GetTexParameterIivEXT(ctx->Exec, (target, pname, params));
+}
+
+/** GL_EXT_texture_integer */
+static void GLAPIENTRY
+exec_GetTexParameterIuiv(GLenum target, GLenum pname, GLuint *params)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ FLUSH_VERTICES(ctx, 0);
+ CALL_GetTexParameterIuivEXT(ctx->Exec, (target, pname, params));
+}
+
+
+/* GL_ARB_instanced_arrays */
+static void GLAPIENTRY
+save_VertexAttribDivisor(GLuint index, GLuint divisor)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = alloc_instruction(ctx, OPCODE_VERTEX_ATTRIB_DIVISOR, 2);
+ if (n) {
+ n[1].ui = index;
+ n[2].ui = divisor;
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_VertexAttribDivisorARB(ctx->Exec, (index, divisor));
+ }
+}
+
+
+/* GL_NV_texture_barrier */
+static void GLAPIENTRY
+save_TextureBarrierNV(void)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ alloc_instruction(ctx, OPCODE_TEXTURE_BARRIER_NV, 0);
+ if (ctx->ExecuteFlag) {
+ CALL_TextureBarrierNV(ctx->Exec, ());
+ }
+}
+
+
+/* GL_ARB_sampler_objects */
+static void GLAPIENTRY
+save_BindSampler(GLuint unit, GLuint sampler)
+{
+ Node *n;
+ GET_CURRENT_CONTEXT(ctx);
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = alloc_instruction(ctx, OPCODE_BIND_SAMPLER, 2);
+ if (n) {
+ n[1].ui = unit;
+ n[2].ui = sampler;
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_BindSampler(ctx->Exec, (unit, sampler));
+ }
+}
+
+
+/**
+ * Save an error-generating command into display list.
+ *
+ * KW: Will appear in the list before the vertex buffer containing the
+ * command that provoked the error. I don't see this as a problem.
+ */
+static void
+save_error(struct gl_context *ctx, GLenum error, const char *s)
+{
+ Node *n;
+ n = alloc_instruction(ctx, OPCODE_ERROR, 2);
+ if (n) {
+ n[1].e = error;
+ n[2].data = (void *) s;
+ }
+}
+
+
+/**
+ * Compile an error into current display list.
+ */
+void
+_mesa_compile_error(struct gl_context *ctx, GLenum error, const char *s)
+{
+ if (ctx->CompileFlag)
+ save_error(ctx, error, s);
+ if (ctx->ExecuteFlag)
+ _mesa_error(ctx, error, "%s", s);
+}
+
+
+/**
+ * Test if ID names a display list.
+ */
+static GLboolean
+islist(struct gl_context *ctx, GLuint list)
+{
+ if (list > 0 && lookup_list(ctx, list)) {
+ return GL_TRUE;
+ }
+ else {
+ return GL_FALSE;
+ }
+}
+
+
+
+/**********************************************************************/
+/* Display list execution */
+/**********************************************************************/
+
+
+/*
+ * Execute a display list. Note that the ListBase offset must have already
+ * been added before calling this function. I.e. the list argument is
+ * the absolute list number, not relative to ListBase.
+ * \param list - display list number
+ */
+static void
+execute_list(struct gl_context *ctx, GLuint list)
+{
+ struct gl_display_list *dlist;
+ Node *n;
+ GLboolean done;
+
+ if (list == 0 || !islist(ctx, list))
+ return;
+
+ if (ctx->ListState.CallDepth == MAX_LIST_NESTING) {
+ /* raise an error? */
+ return;
+ }
+
+ dlist = lookup_list(ctx, list);
+ if (!dlist)
+ return;
+
+ ctx->ListState.CallDepth++;
+
+ if (ctx->Driver.BeginCallList)
+ ctx->Driver.BeginCallList(ctx, dlist);
+
+ n = dlist->Head;
+
+ done = GL_FALSE;
+ while (!done) {
+ const OpCode opcode = n[0].opcode;
+
+ if (is_ext_opcode(opcode)) {
+ n += ext_opcode_execute(ctx, n);
+ }
+ else {
+ switch (opcode) {
+ case OPCODE_ERROR:
+ _mesa_error(ctx, n[1].e, "%s", (const char *) n[2].data);
+ break;
+ case OPCODE_ACCUM:
+ CALL_Accum(ctx->Exec, (n[1].e, n[2].f));
+ break;
+ case OPCODE_ALPHA_FUNC:
+ CALL_AlphaFunc(ctx->Exec, (n[1].e, n[2].f));
+ break;
+ case OPCODE_BIND_TEXTURE:
+ CALL_BindTexture(ctx->Exec, (n[1].e, n[2].ui));
+ break;
+ case OPCODE_BITMAP:
+ {
+ const struct gl_pixelstore_attrib save = ctx->Unpack;
+ ctx->Unpack = ctx->DefaultPacking;
+ CALL_Bitmap(ctx->Exec, ((GLsizei) n[1].i, (GLsizei) n[2].i,
+ n[3].f, n[4].f, n[5].f, n[6].f,
+ (const GLubyte *) n[7].data));
+ ctx->Unpack = save; /* restore */
+ }
+ break;
+ case OPCODE_BLEND_COLOR:
+ CALL_BlendColor(ctx->Exec, (n[1].f, n[2].f, n[3].f, n[4].f));
+ break;
+ case OPCODE_BLEND_EQUATION:
+ CALL_BlendEquation(ctx->Exec, (n[1].e));
+ break;
+ case OPCODE_BLEND_EQUATION_SEPARATE:
+ CALL_BlendEquationSeparateEXT(ctx->Exec, (n[1].e, n[2].e));
+ break;
+ case OPCODE_BLEND_FUNC_SEPARATE:
+ CALL_BlendFuncSeparateEXT(ctx->Exec,
+ (n[1].e, n[2].e, n[3].e, n[4].e));
+ break;
+
+ case OPCODE_BLEND_FUNC_I:
+ /* GL_ARB_draw_buffers_blend */
+ CALL_BlendFunciARB(ctx->Exec, (n[1].ui, n[2].e, n[3].e));
+ break;
+ case OPCODE_BLEND_FUNC_SEPARATE_I:
+ /* GL_ARB_draw_buffers_blend */
+ CALL_BlendFuncSeparateiARB(ctx->Exec, (n[1].ui, n[2].e, n[3].e,
+ n[4].e, n[5].e));
+ break;
+ case OPCODE_BLEND_EQUATION_I:
+ /* GL_ARB_draw_buffers_blend */
+ CALL_BlendEquationiARB(ctx->Exec, (n[1].ui, n[2].e));
+ break;
+ case OPCODE_BLEND_EQUATION_SEPARATE_I:
+ /* GL_ARB_draw_buffers_blend */
+ CALL_BlendEquationSeparateiARB(ctx->Exec,
+ (n[1].ui, n[2].e, n[3].e));
+ break;
+
+ case OPCODE_CALL_LIST:
+ /* Generated by glCallList(), don't add ListBase */
+ if (ctx->ListState.CallDepth < MAX_LIST_NESTING) {
+ execute_list(ctx, n[1].ui);
+ }
+ break;
+ case OPCODE_CALL_LIST_OFFSET:
+ /* Generated by glCallLists() so we must add ListBase */
+ if (n[2].b) {
+ /* user specified a bad data type at compile time */
+ _mesa_error(ctx, GL_INVALID_ENUM, "glCallLists(type)");
+ }
+ else if (ctx->ListState.CallDepth < MAX_LIST_NESTING) {
+ GLuint list = (GLuint) (ctx->List.ListBase + n[1].i);
+ execute_list(ctx, list);
+ }
+ break;
+ case OPCODE_CLEAR:
+ CALL_Clear(ctx->Exec, (n[1].bf));
+ break;
+ case OPCODE_CLEAR_BUFFER_IV:
+ {
+ GLint value[4];
+ value[0] = n[3].i;
+ value[1] = n[4].i;
+ value[2] = n[5].i;
+ value[3] = n[6].i;
+ /*CALL_ClearBufferiv(ctx->Exec, (n[1].e, n[2].i, value));*/
+ }
+ break;
+ case OPCODE_CLEAR_BUFFER_UIV:
+ {
+ GLuint value[4];
+ value[0] = n[3].ui;
+ value[1] = n[4].ui;
+ value[2] = n[5].ui;
+ value[3] = n[6].ui;
+ /*CALL_ClearBufferiv(ctx->Exec, (n[1].e, n[2].i, value));*/
+ }
+ break;
+ case OPCODE_CLEAR_BUFFER_FV:
+ {
+ GLfloat value[4];
+ value[0] = n[3].f;
+ value[1] = n[4].f;
+ value[2] = n[5].f;
+ value[3] = n[6].f;
+ /*CALL_ClearBufferfv(ctx->Exec, (n[1].e, n[2].i, value));*/
+ }
+ break;
+ case OPCODE_CLEAR_BUFFER_FI:
+ /*CALL_ClearBufferfi(ctx->Exec, (n[1].e, n[2].i, n[3].f, n[4].i));*/
+ break;
+ case OPCODE_CLEAR_COLOR:
+ CALL_ClearColor(ctx->Exec, (n[1].f, n[2].f, n[3].f, n[4].f));
+ break;
+ case OPCODE_CLEAR_ACCUM:
+ CALL_ClearAccum(ctx->Exec, (n[1].f, n[2].f, n[3].f, n[4].f));
+ break;
+ case OPCODE_CLEAR_DEPTH:
+ CALL_ClearDepth(ctx->Exec, ((GLclampd) n[1].f));
+ break;
+ case OPCODE_CLEAR_INDEX:
+ CALL_ClearIndex(ctx->Exec, ((GLfloat) n[1].ui));
+ break;
+ case OPCODE_CLEAR_STENCIL:
+ CALL_ClearStencil(ctx->Exec, (n[1].i));
+ break;
+ case OPCODE_CLIP_PLANE:
+ {
+ GLdouble eq[4];
+ eq[0] = n[2].f;
+ eq[1] = n[3].f;
+ eq[2] = n[4].f;
+ eq[3] = n[5].f;
+ CALL_ClipPlane(ctx->Exec, (n[1].e, eq));
+ }
+ break;
+ case OPCODE_COLOR_MASK:
+ CALL_ColorMask(ctx->Exec, (n[1].b, n[2].b, n[3].b, n[4].b));
+ break;
+ case OPCODE_COLOR_MASK_INDEXED:
+ CALL_ColorMaskIndexedEXT(ctx->Exec, (n[1].ui, n[2].b, n[3].b,
+ n[4].b, n[5].b));
+ break;
+ case OPCODE_COLOR_MATERIAL:
+ CALL_ColorMaterial(ctx->Exec, (n[1].e, n[2].e));
+ break;
+ case OPCODE_COLOR_TABLE:
+ {
+ const struct gl_pixelstore_attrib save = ctx->Unpack;
+ ctx->Unpack = ctx->DefaultPacking;
+ CALL_ColorTable(ctx->Exec, (n[1].e, n[2].e, n[3].i, n[4].e,
+ n[5].e, n[6].data));
+ ctx->Unpack = save; /* restore */
+ }
+ break;
+ case OPCODE_COLOR_TABLE_PARAMETER_FV:
+ {
+ GLfloat params[4];
+ params[0] = n[3].f;
+ params[1] = n[4].f;
+ params[2] = n[5].f;
+ params[3] = n[6].f;
+ CALL_ColorTableParameterfv(ctx->Exec,
+ (n[1].e, n[2].e, params));
+ }
+ break;
+ case OPCODE_COLOR_TABLE_PARAMETER_IV:
+ {
+ GLint params[4];
+ params[0] = n[3].i;
+ params[1] = n[4].i;
+ params[2] = n[5].i;
+ params[3] = n[6].i;
+ CALL_ColorTableParameteriv(ctx->Exec,
+ (n[1].e, n[2].e, params));
+ }
+ break;
+ case OPCODE_COLOR_SUB_TABLE:
+ {
+ const struct gl_pixelstore_attrib save = ctx->Unpack;
+ ctx->Unpack = ctx->DefaultPacking;
+ CALL_ColorSubTable(ctx->Exec, (n[1].e, n[2].i, n[3].i,
+ n[4].e, n[5].e, n[6].data));
+ ctx->Unpack = save; /* restore */
+ }
+ break;
+ case OPCODE_CONVOLUTION_FILTER_1D:
+ {
+ const struct gl_pixelstore_attrib save = ctx->Unpack;
+ ctx->Unpack = ctx->DefaultPacking;
+ CALL_ConvolutionFilter1D(ctx->Exec, (n[1].e, n[2].i, n[3].i,
+ n[4].e, n[5].e,
+ n[6].data));
+ ctx->Unpack = save; /* restore */
+ }
+ break;
+ case OPCODE_CONVOLUTION_FILTER_2D:
+ {
+ const struct gl_pixelstore_attrib save = ctx->Unpack;
+ ctx->Unpack = ctx->DefaultPacking;
+ CALL_ConvolutionFilter2D(ctx->Exec, (n[1].e, n[2].i, n[3].i,
+ n[4].i, n[5].e, n[6].e,
+ n[7].data));
+ ctx->Unpack = save; /* restore */
+ }
+ break;
+ case OPCODE_CONVOLUTION_PARAMETER_I:
+ CALL_ConvolutionParameteri(ctx->Exec, (n[1].e, n[2].e, n[3].i));
+ break;
+ case OPCODE_CONVOLUTION_PARAMETER_IV:
+ {
+ GLint params[4];
+ params[0] = n[3].i;
+ params[1] = n[4].i;
+ params[2] = n[5].i;
+ params[3] = n[6].i;
+ CALL_ConvolutionParameteriv(ctx->Exec,
+ (n[1].e, n[2].e, params));
+ }
+ break;
+ case OPCODE_CONVOLUTION_PARAMETER_F:
+ CALL_ConvolutionParameterf(ctx->Exec, (n[1].e, n[2].e, n[3].f));
+ break;
+ case OPCODE_CONVOLUTION_PARAMETER_FV:
+ {
+ GLfloat params[4];
+ params[0] = n[3].f;
+ params[1] = n[4].f;
+ params[2] = n[5].f;
+ params[3] = n[6].f;
+ CALL_ConvolutionParameterfv(ctx->Exec,
+ (n[1].e, n[2].e, params));
+ }
+ break;
+ case OPCODE_COPY_COLOR_SUB_TABLE:
+ CALL_CopyColorSubTable(ctx->Exec, (n[1].e, n[2].i,
+ n[3].i, n[4].i, n[5].i));
+ break;
+ case OPCODE_COPY_COLOR_TABLE:
+ CALL_CopyColorSubTable(ctx->Exec, (n[1].e, n[2].i,
+ n[3].i, n[4].i, n[5].i));
+ break;
+ case OPCODE_COPY_PIXELS:
+ CALL_CopyPixels(ctx->Exec, (n[1].i, n[2].i,
+ (GLsizei) n[3].i, (GLsizei) n[4].i,
+ n[5].e));
+ break;
+ case OPCODE_COPY_TEX_IMAGE1D:
+ CALL_CopyTexImage1D(ctx->Exec, (n[1].e, n[2].i, n[3].e, n[4].i,
+ n[5].i, n[6].i, n[7].i));
+ break;
+ case OPCODE_COPY_TEX_IMAGE2D:
+ CALL_CopyTexImage2D(ctx->Exec, (n[1].e, n[2].i, n[3].e, n[4].i,
+ n[5].i, n[6].i, n[7].i, n[8].i));
+ break;
+ case OPCODE_COPY_TEX_SUB_IMAGE1D:
+ CALL_CopyTexSubImage1D(ctx->Exec, (n[1].e, n[2].i, n[3].i,
+ n[4].i, n[5].i, n[6].i));
+ break;
+ case OPCODE_COPY_TEX_SUB_IMAGE2D:
+ CALL_CopyTexSubImage2D(ctx->Exec, (n[1].e, n[2].i, n[3].i,
+ n[4].i, n[5].i, n[6].i, n[7].i,
+ n[8].i));
+ break;
+ case OPCODE_COPY_TEX_SUB_IMAGE3D:
+ CALL_CopyTexSubImage3D(ctx->Exec, (n[1].e, n[2].i, n[3].i,
+ n[4].i, n[5].i, n[6].i, n[7].i,
+ n[8].i, n[9].i));
+ break;
+ case OPCODE_CULL_FACE:
+ CALL_CullFace(ctx->Exec, (n[1].e));
+ break;
+ case OPCODE_DEPTH_FUNC:
+ CALL_DepthFunc(ctx->Exec, (n[1].e));
+ break;
+ case OPCODE_DEPTH_MASK:
+ CALL_DepthMask(ctx->Exec, (n[1].b));
+ break;
+ case OPCODE_DEPTH_RANGE:
+ CALL_DepthRange(ctx->Exec,
+ ((GLclampd) n[1].f, (GLclampd) n[2].f));
+ break;
+ case OPCODE_DISABLE:
+ CALL_Disable(ctx->Exec, (n[1].e));
+ break;
+ case OPCODE_DISABLE_INDEXED:
+ CALL_DisableIndexedEXT(ctx->Exec, (n[1].ui, n[2].e));
+ break;
+ case OPCODE_DRAW_BUFFER:
+ CALL_DrawBuffer(ctx->Exec, (n[1].e));
+ break;
+ case OPCODE_DRAW_PIXELS:
+ {
+ const struct gl_pixelstore_attrib save = ctx->Unpack;
+ ctx->Unpack = ctx->DefaultPacking;
+ CALL_DrawPixels(ctx->Exec, (n[1].i, n[2].i, n[3].e, n[4].e,
+ n[5].data));
+ ctx->Unpack = save; /* restore */
+ }
+ break;
+ case OPCODE_ENABLE:
+ CALL_Enable(ctx->Exec, (n[1].e));
+ break;
+ case OPCODE_ENABLE_INDEXED:
+ CALL_EnableIndexedEXT(ctx->Exec, (n[1].ui, n[2].e));
+ break;
+ case OPCODE_EVALMESH1:
+ CALL_EvalMesh1(ctx->Exec, (n[1].e, n[2].i, n[3].i));
+ break;
+ case OPCODE_EVALMESH2:
+ CALL_EvalMesh2(ctx->Exec,
+ (n[1].e, n[2].i, n[3].i, n[4].i, n[5].i));
+ break;
+ case OPCODE_FOG:
+ {
+ GLfloat p[4];
+ p[0] = n[2].f;
+ p[1] = n[3].f;
+ p[2] = n[4].f;
+ p[3] = n[5].f;
+ CALL_Fogfv(ctx->Exec, (n[1].e, p));
+ }
+ break;
+ case OPCODE_FRONT_FACE:
+ CALL_FrontFace(ctx->Exec, (n[1].e));
+ break;
+ case OPCODE_FRUSTUM:
+ CALL_Frustum(ctx->Exec,
+ (n[1].f, n[2].f, n[3].f, n[4].f, n[5].f, n[6].f));
+ break;
+ case OPCODE_HINT:
+ CALL_Hint(ctx->Exec, (n[1].e, n[2].e));
+ break;
+ case OPCODE_HISTOGRAM:
+ CALL_Histogram(ctx->Exec, (n[1].e, n[2].i, n[3].e, n[4].b));
+ break;
+ case OPCODE_INDEX_MASK:
+ CALL_IndexMask(ctx->Exec, (n[1].ui));
+ break;
+ case OPCODE_INIT_NAMES:
+ CALL_InitNames(ctx->Exec, ());
+ break;
+ case OPCODE_LIGHT:
+ {
+ GLfloat p[4];
+ p[0] = n[3].f;
+ p[1] = n[4].f;
+ p[2] = n[5].f;
+ p[3] = n[6].f;
+ CALL_Lightfv(ctx->Exec, (n[1].e, n[2].e, p));
+ }
+ break;
+ case OPCODE_LIGHT_MODEL:
+ {
+ GLfloat p[4];
+ p[0] = n[2].f;
+ p[1] = n[3].f;
+ p[2] = n[4].f;
+ p[3] = n[5].f;
+ CALL_LightModelfv(ctx->Exec, (n[1].e, p));
+ }
+ break;
+ case OPCODE_LINE_STIPPLE:
+ CALL_LineStipple(ctx->Exec, (n[1].i, n[2].us));
+ break;
+ case OPCODE_LINE_WIDTH:
+ CALL_LineWidth(ctx->Exec, (n[1].f));
+ break;
+ case OPCODE_LIST_BASE:
+ CALL_ListBase(ctx->Exec, (n[1].ui));
+ break;
+ case OPCODE_LOAD_IDENTITY:
+ CALL_LoadIdentity(ctx->Exec, ());
+ break;
+ case OPCODE_LOAD_MATRIX:
+ if (sizeof(Node) == sizeof(GLfloat)) {
+ CALL_LoadMatrixf(ctx->Exec, (&n[1].f));
+ }
+ else {
+ GLfloat m[16];
+ GLuint i;
+ for (i = 0; i < 16; i++) {
+ m[i] = n[1 + i].f;
+ }
+ CALL_LoadMatrixf(ctx->Exec, (m));
+ }
+ break;
+ case OPCODE_LOAD_NAME:
+ CALL_LoadName(ctx->Exec, (n[1].ui));
+ break;
+ case OPCODE_LOGIC_OP:
+ CALL_LogicOp(ctx->Exec, (n[1].e));
+ break;
+ case OPCODE_MAP1:
+ {
+ GLenum target = n[1].e;
+ GLint ustride = _mesa_evaluator_components(target);
+ GLint uorder = n[5].i;
+ GLfloat u1 = n[2].f;
+ GLfloat u2 = n[3].f;
+ CALL_Map1f(ctx->Exec, (target, u1, u2, ustride, uorder,
+ (GLfloat *) n[6].data));
+ }
+ break;
+ case OPCODE_MAP2:
+ {
+ GLenum target = n[1].e;
+ GLfloat u1 = n[2].f;
+ GLfloat u2 = n[3].f;
+ GLfloat v1 = n[4].f;
+ GLfloat v2 = n[5].f;
+ GLint ustride = n[6].i;
+ GLint vstride = n[7].i;
+ GLint uorder = n[8].i;
+ GLint vorder = n[9].i;
+ CALL_Map2f(ctx->Exec, (target, u1, u2, ustride, uorder,
+ v1, v2, vstride, vorder,
+ (GLfloat *) n[10].data));
+ }
+ break;
+ case OPCODE_MAPGRID1:
+ CALL_MapGrid1f(ctx->Exec, (n[1].i, n[2].f, n[3].f));
+ break;
+ case OPCODE_MAPGRID2:
+ CALL_MapGrid2f(ctx->Exec,
+ (n[1].i, n[2].f, n[3].f, n[4].i, n[5].f, n[6].f));
+ break;
+ case OPCODE_MATRIX_MODE:
+ CALL_MatrixMode(ctx->Exec, (n[1].e));
+ break;
+ case OPCODE_MIN_MAX:
+ CALL_Minmax(ctx->Exec, (n[1].e, n[2].e, n[3].b));
+ break;
+ case OPCODE_MULT_MATRIX:
+ if (sizeof(Node) == sizeof(GLfloat)) {
+ CALL_MultMatrixf(ctx->Exec, (&n[1].f));
+ }
+ else {
+ GLfloat m[16];
+ GLuint i;
+ for (i = 0; i < 16; i++) {
+ m[i] = n[1 + i].f;
+ }
+ CALL_MultMatrixf(ctx->Exec, (m));
+ }
+ break;
+ case OPCODE_ORTHO:
+ CALL_Ortho(ctx->Exec,
+ (n[1].f, n[2].f, n[3].f, n[4].f, n[5].f, n[6].f));
+ break;
+ case OPCODE_PASSTHROUGH:
+ CALL_PassThrough(ctx->Exec, (n[1].f));
+ break;
+ case OPCODE_PIXEL_MAP:
+ CALL_PixelMapfv(ctx->Exec,
+ (n[1].e, n[2].i, (GLfloat *) n[3].data));
+ break;
+ case OPCODE_PIXEL_TRANSFER:
+ CALL_PixelTransferf(ctx->Exec, (n[1].e, n[2].f));
+ break;
+ case OPCODE_PIXEL_ZOOM:
+ CALL_PixelZoom(ctx->Exec, (n[1].f, n[2].f));
+ break;
+ case OPCODE_POINT_SIZE:
+ CALL_PointSize(ctx->Exec, (n[1].f));
+ break;
+ case OPCODE_POINT_PARAMETERS:
+ {
+ GLfloat params[3];
+ params[0] = n[2].f;
+ params[1] = n[3].f;
+ params[2] = n[4].f;
+ CALL_PointParameterfvEXT(ctx->Exec, (n[1].e, params));
+ }
+ break;
+ case OPCODE_POLYGON_MODE:
+ CALL_PolygonMode(ctx->Exec, (n[1].e, n[2].e));
+ break;
+ case OPCODE_POLYGON_STIPPLE:
+ {
+ const struct gl_pixelstore_attrib save = ctx->Unpack;
+ ctx->Unpack = ctx->DefaultPacking;
+ CALL_PolygonStipple(ctx->Exec, ((GLubyte *) n[1].data));
+ ctx->Unpack = save; /* restore */
+ }
+ break;
+ case OPCODE_POLYGON_OFFSET:
+ CALL_PolygonOffset(ctx->Exec, (n[1].f, n[2].f));
+ break;
+ case OPCODE_POP_ATTRIB:
+ CALL_PopAttrib(ctx->Exec, ());
+ break;
+ case OPCODE_POP_MATRIX:
+ CALL_PopMatrix(ctx->Exec, ());
+ break;
+ case OPCODE_POP_NAME:
+ CALL_PopName(ctx->Exec, ());
+ break;
+ case OPCODE_PRIORITIZE_TEXTURE:
+ CALL_PrioritizeTextures(ctx->Exec, (1, &n[1].ui, &n[2].f));
+ break;
+ case OPCODE_PUSH_ATTRIB:
+ CALL_PushAttrib(ctx->Exec, (n[1].bf));
+ break;
+ case OPCODE_PUSH_MATRIX:
+ CALL_PushMatrix(ctx->Exec, ());
+ break;
+ case OPCODE_PUSH_NAME:
+ CALL_PushName(ctx->Exec, (n[1].ui));
+ break;
+ case OPCODE_RASTER_POS:
+ CALL_RasterPos4f(ctx->Exec, (n[1].f, n[2].f, n[3].f, n[4].f));
+ break;
+ case OPCODE_READ_BUFFER:
+ CALL_ReadBuffer(ctx->Exec, (n[1].e));
+ break;
+ case OPCODE_RESET_HISTOGRAM:
+ CALL_ResetHistogram(ctx->Exec, (n[1].e));
+ break;
+ case OPCODE_RESET_MIN_MAX:
+ CALL_ResetMinmax(ctx->Exec, (n[1].e));
+ break;
+ case OPCODE_ROTATE:
+ CALL_Rotatef(ctx->Exec, (n[1].f, n[2].f, n[3].f, n[4].f));
+ break;
+ case OPCODE_SCALE:
+ CALL_Scalef(ctx->Exec, (n[1].f, n[2].f, n[3].f));
+ break;
+ case OPCODE_SCISSOR:
+ CALL_Scissor(ctx->Exec, (n[1].i, n[2].i, n[3].i, n[4].i));
+ break;
+ case OPCODE_SHADE_MODEL:
+ CALL_ShadeModel(ctx->Exec, (n[1].e));
+ break;
+ case OPCODE_PROVOKING_VERTEX:
+ CALL_ProvokingVertexEXT(ctx->Exec, (n[1].e));
+ break;
+ case OPCODE_BEGIN_TRANSFORM_FEEDBACK:
+ CALL_BeginTransformFeedbackEXT(ctx->Exec, (n[1].e));
+ break;
+ case OPCODE_END_TRANSFORM_FEEDBACK:
+ CALL_EndTransformFeedbackEXT(ctx->Exec, ());
+ break;
+ case OPCODE_STENCIL_FUNC:
+ CALL_StencilFunc(ctx->Exec, (n[1].e, n[2].i, n[3].ui));
+ break;
+ case OPCODE_STENCIL_MASK:
+ CALL_StencilMask(ctx->Exec, (n[1].ui));
+ break;
+ case OPCODE_STENCIL_OP:
+ CALL_StencilOp(ctx->Exec, (n[1].e, n[2].e, n[3].e));
+ break;
+ case OPCODE_STENCIL_FUNC_SEPARATE:
+ CALL_StencilFuncSeparate(ctx->Exec,
+ (n[1].e, n[2].e, n[3].i, n[4].ui));
+ break;
+ case OPCODE_STENCIL_MASK_SEPARATE:
+ CALL_StencilMaskSeparate(ctx->Exec, (n[1].e, n[2].ui));
+ break;
+ case OPCODE_STENCIL_OP_SEPARATE:
+ CALL_StencilOpSeparate(ctx->Exec,
+ (n[1].e, n[2].e, n[3].e, n[4].e));
+ break;
+ case OPCODE_TEXENV:
+ {
+ GLfloat params[4];
+ params[0] = n[3].f;
+ params[1] = n[4].f;
+ params[2] = n[5].f;
+ params[3] = n[6].f;
+ CALL_TexEnvfv(ctx->Exec, (n[1].e, n[2].e, params));
+ }
+ break;
+ case OPCODE_TEXGEN:
+ {
+ GLfloat params[4];
+ params[0] = n[3].f;
+ params[1] = n[4].f;
+ params[2] = n[5].f;
+ params[3] = n[6].f;
+ CALL_TexGenfv(ctx->Exec, (n[1].e, n[2].e, params));
+ }
+ break;
+ case OPCODE_TEXPARAMETER:
+ {
+ GLfloat params[4];
+ params[0] = n[3].f;
+ params[1] = n[4].f;
+ params[2] = n[5].f;
+ params[3] = n[6].f;
+ CALL_TexParameterfv(ctx->Exec, (n[1].e, n[2].e, params));
+ }
+ break;
+ case OPCODE_TEX_IMAGE1D:
+ {
+ const struct gl_pixelstore_attrib save = ctx->Unpack;
+ ctx->Unpack = ctx->DefaultPacking;
+ CALL_TexImage1D(ctx->Exec, (n[1].e, /* target */
+ n[2].i, /* level */
+ n[3].i, /* components */
+ n[4].i, /* width */
+ n[5].e, /* border */
+ n[6].e, /* format */
+ n[7].e, /* type */
+ n[8].data));
+ ctx->Unpack = save; /* restore */
+ }
+ break;
+ case OPCODE_TEX_IMAGE2D:
+ {
+ const struct gl_pixelstore_attrib save = ctx->Unpack;
+ ctx->Unpack = ctx->DefaultPacking;
+ CALL_TexImage2D(ctx->Exec, (n[1].e, /* target */
+ n[2].i, /* level */
+ n[3].i, /* components */
+ n[4].i, /* width */
+ n[5].i, /* height */
+ n[6].e, /* border */
+ n[7].e, /* format */
+ n[8].e, /* type */
+ n[9].data));
+ ctx->Unpack = save; /* restore */
+ }
+ break;
+ case OPCODE_TEX_IMAGE3D:
+ {
+ const struct gl_pixelstore_attrib save = ctx->Unpack;
+ ctx->Unpack = ctx->DefaultPacking;
+ CALL_TexImage3D(ctx->Exec, (n[1].e, /* target */
+ n[2].i, /* level */
+ n[3].i, /* components */
+ n[4].i, /* width */
+ n[5].i, /* height */
+ n[6].i, /* depth */
+ n[7].e, /* border */
+ n[8].e, /* format */
+ n[9].e, /* type */
+ n[10].data));
+ ctx->Unpack = save; /* restore */
+ }
+ break;
+ case OPCODE_TEX_SUB_IMAGE1D:
+ {
+ const struct gl_pixelstore_attrib save = ctx->Unpack;
+ ctx->Unpack = ctx->DefaultPacking;
+ CALL_TexSubImage1D(ctx->Exec, (n[1].e, n[2].i, n[3].i,
+ n[4].i, n[5].e,
+ n[6].e, n[7].data));
+ ctx->Unpack = save; /* restore */
+ }
+ break;
+ case OPCODE_TEX_SUB_IMAGE2D:
+ {
+ const struct gl_pixelstore_attrib save = ctx->Unpack;
+ ctx->Unpack = ctx->DefaultPacking;
+ CALL_TexSubImage2D(ctx->Exec, (n[1].e, n[2].i, n[3].i,
+ n[4].i, n[5].e,
+ n[6].i, n[7].e, n[8].e,
+ n[9].data));
+ ctx->Unpack = save; /* restore */
+ }
+ break;
+ case OPCODE_TEX_SUB_IMAGE3D:
+ {
+ const struct gl_pixelstore_attrib save = ctx->Unpack;
+ ctx->Unpack = ctx->DefaultPacking;
+ CALL_TexSubImage3D(ctx->Exec, (n[1].e, n[2].i, n[3].i,
+ n[4].i, n[5].i, n[6].i, n[7].i,
+ n[8].i, n[9].e, n[10].e,
+ n[11].data));
+ ctx->Unpack = save; /* restore */
+ }
+ break;
+ case OPCODE_TRANSLATE:
+ CALL_Translatef(ctx->Exec, (n[1].f, n[2].f, n[3].f));
+ break;
+ case OPCODE_VIEWPORT:
+ CALL_Viewport(ctx->Exec, (n[1].i, n[2].i,
+ (GLsizei) n[3].i, (GLsizei) n[4].i));
+ break;
+ case OPCODE_WINDOW_POS:
+ CALL_WindowPos4fMESA(ctx->Exec, (n[1].f, n[2].f, n[3].f, n[4].f));
+ break;
+ case OPCODE_ACTIVE_TEXTURE: /* GL_ARB_multitexture */
+ CALL_ActiveTextureARB(ctx->Exec, (n[1].e));
+ break;
+ case OPCODE_COMPRESSED_TEX_IMAGE_1D: /* GL_ARB_texture_compression */
+ CALL_CompressedTexImage1DARB(ctx->Exec, (n[1].e, n[2].i, n[3].e,
+ n[4].i, n[5].i, n[6].i,
+ n[7].data));
+ break;
+ case OPCODE_COMPRESSED_TEX_IMAGE_2D: /* GL_ARB_texture_compression */
+ CALL_CompressedTexImage2DARB(ctx->Exec, (n[1].e, n[2].i, n[3].e,
+ n[4].i, n[5].i, n[6].i,
+ n[7].i, n[8].data));
+ break;
+ case OPCODE_COMPRESSED_TEX_IMAGE_3D: /* GL_ARB_texture_compression */
+ CALL_CompressedTexImage3DARB(ctx->Exec, (n[1].e, n[2].i, n[3].e,
+ n[4].i, n[5].i, n[6].i,
+ n[7].i, n[8].i,
+ n[9].data));
+ break;
+ case OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D: /* GL_ARB_texture_compress */
+ CALL_CompressedTexSubImage1DARB(ctx->Exec,
+ (n[1].e, n[2].i, n[3].i, n[4].i,
+ n[5].e, n[6].i, n[7].data));
+ break;
+ case OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D: /* GL_ARB_texture_compress */
+ CALL_CompressedTexSubImage2DARB(ctx->Exec,
+ (n[1].e, n[2].i, n[3].i, n[4].i,
+ n[5].i, n[6].i, n[7].e, n[8].i,
+ n[9].data));
+ break;
+ case OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D: /* GL_ARB_texture_compress */
+ CALL_CompressedTexSubImage3DARB(ctx->Exec,
+ (n[1].e, n[2].i, n[3].i, n[4].i,
+ n[5].i, n[6].i, n[7].i, n[8].i,
+ n[9].e, n[10].i, n[11].data));
+ break;
+ case OPCODE_SAMPLE_COVERAGE: /* GL_ARB_multisample */
+ CALL_SampleCoverageARB(ctx->Exec, (n[1].f, n[2].b));
+ break;
+ case OPCODE_WINDOW_POS_ARB: /* GL_ARB_window_pos */
+ CALL_WindowPos3fMESA(ctx->Exec, (n[1].f, n[2].f, n[3].f));
+ break;
+#if FEATURE_NV_vertex_program || FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
+ case OPCODE_BIND_PROGRAM_NV: /* GL_NV_vertex_program */
+ CALL_BindProgramNV(ctx->Exec, (n[1].e, n[2].ui));
+ break;
+#endif
+#if FEATURE_NV_vertex_program
+ case OPCODE_EXECUTE_PROGRAM_NV:
+ {
+ GLfloat v[4];
+ v[0] = n[3].f;
+ v[1] = n[4].f;
+ v[2] = n[5].f;
+ v[3] = n[6].f;
+ CALL_ExecuteProgramNV(ctx->Exec, (n[1].e, n[2].ui, v));
+ }
+ break;
+ case OPCODE_REQUEST_RESIDENT_PROGRAMS_NV:
+ CALL_RequestResidentProgramsNV(ctx->Exec, (n[1].ui,
+ (GLuint *) n[2].data));
+ break;
+ case OPCODE_LOAD_PROGRAM_NV:
+ CALL_LoadProgramNV(ctx->Exec, (n[1].e, n[2].ui, n[3].i,
+ (const GLubyte *) n[4].data));
+ break;
+ case OPCODE_TRACK_MATRIX_NV:
+ CALL_TrackMatrixNV(ctx->Exec, (n[1].e, n[2].ui, n[3].e, n[4].e));
+ break;
+#endif
+
+#if FEATURE_NV_fragment_program
+ case OPCODE_PROGRAM_LOCAL_PARAMETER_ARB:
+ CALL_ProgramLocalParameter4fARB(ctx->Exec,
+ (n[1].e, n[2].ui, n[3].f, n[4].f,
+ n[5].f, n[6].f));
+ break;
+ case OPCODE_PROGRAM_NAMED_PARAMETER_NV:
+ CALL_ProgramNamedParameter4fNV(ctx->Exec, (n[1].ui, n[2].i,
+ (const GLubyte *) n[3].
+ data, n[4].f, n[5].f,
+ n[6].f, n[7].f));
+ break;
+#endif
+
+ case OPCODE_ACTIVE_STENCIL_FACE_EXT:
+ CALL_ActiveStencilFaceEXT(ctx->Exec, (n[1].e));
+ break;
+ case OPCODE_DEPTH_BOUNDS_EXT:
+ CALL_DepthBoundsEXT(ctx->Exec, (n[1].f, n[2].f));
+ break;
+#if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
+ case OPCODE_PROGRAM_STRING_ARB:
+ CALL_ProgramStringARB(ctx->Exec,
+ (n[1].e, n[2].e, n[3].i, n[4].data));
+ break;
+#endif
+#if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program || FEATURE_NV_vertex_program
+ case OPCODE_PROGRAM_ENV_PARAMETER_ARB:
+ CALL_ProgramEnvParameter4fARB(ctx->Exec, (n[1].e, n[2].ui, n[3].f,
+ n[4].f, n[5].f,
+ n[6].f));
+ break;
+#endif
+#if FEATURE_queryobj
+ case OPCODE_BEGIN_QUERY_ARB:
+ CALL_BeginQueryARB(ctx->Exec, (n[1].e, n[2].ui));
+ break;
+ case OPCODE_END_QUERY_ARB:
+ CALL_EndQueryARB(ctx->Exec, (n[1].e));
+ break;
+#endif
+ case OPCODE_DRAW_BUFFERS_ARB:
+ {
+ GLenum buffers[MAX_DRAW_BUFFERS];
+ GLint i, count = MIN2(n[1].i, MAX_DRAW_BUFFERS);
+ for (i = 0; i < count; i++)
+ buffers[i] = n[2 + i].e;
+ CALL_DrawBuffersARB(ctx->Exec, (n[1].i, buffers));
+ }
+ break;
+#if FEATURE_EXT_framebuffer_blit
+ case OPCODE_BLIT_FRAMEBUFFER:
+ CALL_BlitFramebufferEXT(ctx->Exec, (n[1].i, n[2].i, n[3].i, n[4].i,
+ n[5].i, n[6].i, n[7].i, n[8].i,
+ n[9].i, n[10].e));
+ break;
+#endif
+
+ case OPCODE_USE_PROGRAM:
+ CALL_UseProgramObjectARB(ctx->Exec, (n[1].ui));
+ break;
+ case OPCODE_USE_SHADER_PROGRAM_EXT:
+ CALL_UseShaderProgramEXT(ctx->Exec, (n[1].ui, n[2].ui));
+ break;
+ case OPCODE_ACTIVE_PROGRAM_EXT:
+ CALL_ActiveProgramEXT(ctx->Exec, (n[1].ui));
+ break;
+ case OPCODE_UNIFORM_1F:
+ CALL_Uniform1fARB(ctx->Exec, (n[1].i, n[2].f));
+ break;
+ case OPCODE_UNIFORM_2F:
+ CALL_Uniform2fARB(ctx->Exec, (n[1].i, n[2].f, n[3].f));
+ break;
+ case OPCODE_UNIFORM_3F:
+ CALL_Uniform3fARB(ctx->Exec, (n[1].i, n[2].f, n[3].f, n[4].f));
+ break;
+ case OPCODE_UNIFORM_4F:
+ CALL_Uniform4fARB(ctx->Exec,
+ (n[1].i, n[2].f, n[3].f, n[4].f, n[5].f));
+ break;
+ case OPCODE_UNIFORM_1FV:
+ CALL_Uniform1fvARB(ctx->Exec, (n[1].i, n[2].i, n[3].data));
+ break;
+ case OPCODE_UNIFORM_2FV:
+ CALL_Uniform2fvARB(ctx->Exec, (n[1].i, n[2].i, n[3].data));
+ break;
+ case OPCODE_UNIFORM_3FV:
+ CALL_Uniform3fvARB(ctx->Exec, (n[1].i, n[2].i, n[3].data));
+ break;
+ case OPCODE_UNIFORM_4FV:
+ CALL_Uniform4fvARB(ctx->Exec, (n[1].i, n[2].i, n[3].data));
+ break;
+ case OPCODE_UNIFORM_1I:
+ CALL_Uniform1iARB(ctx->Exec, (n[1].i, n[2].i));
+ break;
+ case OPCODE_UNIFORM_2I:
+ CALL_Uniform2iARB(ctx->Exec, (n[1].i, n[2].i, n[3].i));
+ break;
+ case OPCODE_UNIFORM_3I:
+ CALL_Uniform3iARB(ctx->Exec, (n[1].i, n[2].i, n[3].i, n[4].i));
+ break;
+ case OPCODE_UNIFORM_4I:
+ CALL_Uniform4iARB(ctx->Exec,
+ (n[1].i, n[2].i, n[3].i, n[4].i, n[5].i));
+ break;
+ case OPCODE_UNIFORM_1IV:
+ CALL_Uniform1ivARB(ctx->Exec, (n[1].i, n[2].i, n[3].data));
+ break;
+ case OPCODE_UNIFORM_2IV:
+ CALL_Uniform2ivARB(ctx->Exec, (n[1].i, n[2].i, n[3].data));
+ break;
+ case OPCODE_UNIFORM_3IV:
+ CALL_Uniform3ivARB(ctx->Exec, (n[1].i, n[2].i, n[3].data));
+ break;
+ case OPCODE_UNIFORM_4IV:
+ CALL_Uniform4ivARB(ctx->Exec, (n[1].i, n[2].i, n[3].data));
+ break;
+ case OPCODE_UNIFORM_1UI:
+ /*CALL_Uniform1uiARB(ctx->Exec, (n[1].i, n[2].i));*/
+ break;
+ case OPCODE_UNIFORM_2UI:
+ /*CALL_Uniform2uiARB(ctx->Exec, (n[1].i, n[2].i, n[3].i));*/
+ break;
+ case OPCODE_UNIFORM_3UI:
+ /*CALL_Uniform3uiARB(ctx->Exec, (n[1].i, n[2].i, n[3].i, n[4].i));*/
+ break;
+ case OPCODE_UNIFORM_4UI:
+ /*CALL_Uniform4uiARB(ctx->Exec,
+ (n[1].i, n[2].i, n[3].i, n[4].i, n[5].i));
+ */
+ break;
+ case OPCODE_UNIFORM_1UIV:
+ /*CALL_Uniform1uivARB(ctx->Exec, (n[1].i, n[2].i, n[3].data));*/
+ break;
+ case OPCODE_UNIFORM_2UIV:
+ /*CALL_Uniform2uivARB(ctx->Exec, (n[1].i, n[2].i, n[3].data));*/
+ break;
+ case OPCODE_UNIFORM_3UIV:
+ /*CALL_Uniform3uivARB(ctx->Exec, (n[1].i, n[2].i, n[3].data));*/
+ break;
+ case OPCODE_UNIFORM_4UIV:
+ /*CALL_Uniform4uivARB(ctx->Exec, (n[1].i, n[2].i, n[3].data));*/
+ break;
+ case OPCODE_UNIFORM_MATRIX22:
+ CALL_UniformMatrix2fvARB(ctx->Exec,
+ (n[1].i, n[2].i, n[3].b, n[4].data));
+ break;
+ case OPCODE_UNIFORM_MATRIX33:
+ CALL_UniformMatrix3fvARB(ctx->Exec,
+ (n[1].i, n[2].i, n[3].b, n[4].data));
+ break;
+ case OPCODE_UNIFORM_MATRIX44:
+ CALL_UniformMatrix4fvARB(ctx->Exec,
+ (n[1].i, n[2].i, n[3].b, n[4].data));
+ break;
+ case OPCODE_UNIFORM_MATRIX23:
+ CALL_UniformMatrix2x3fv(ctx->Exec,
+ (n[1].i, n[2].i, n[3].b, n[4].data));
+ break;
+ case OPCODE_UNIFORM_MATRIX32:
+ CALL_UniformMatrix3x2fv(ctx->Exec,
+ (n[1].i, n[2].i, n[3].b, n[4].data));
+ break;
+ case OPCODE_UNIFORM_MATRIX24:
+ CALL_UniformMatrix2x4fv(ctx->Exec,
+ (n[1].i, n[2].i, n[3].b, n[4].data));
+ break;
+ case OPCODE_UNIFORM_MATRIX42:
+ CALL_UniformMatrix4x2fv(ctx->Exec,
+ (n[1].i, n[2].i, n[3].b, n[4].data));
+ break;
+ case OPCODE_UNIFORM_MATRIX34:
+ CALL_UniformMatrix3x4fv(ctx->Exec,
+ (n[1].i, n[2].i, n[3].b, n[4].data));
+ break;
+ case OPCODE_UNIFORM_MATRIX43:
+ CALL_UniformMatrix4x3fv(ctx->Exec,
+ (n[1].i, n[2].i, n[3].b, n[4].data));
+ break;
+
+ case OPCODE_CLAMP_COLOR:
+ CALL_ClampColorARB(ctx->Exec, (n[1].e, n[2].e));
+ break;
+
+ case OPCODE_TEX_BUMP_PARAMETER_ATI:
+ {
+ GLfloat values[4];
+ GLuint i, pname = n[1].ui;
+
+ for (i = 0; i < 4; i++)
+ values[i] = n[1 + i].f;
+ CALL_TexBumpParameterfvATI(ctx->Exec, (pname, values));
+ }
+ break;
+#if FEATURE_ATI_fragment_shader
+ case OPCODE_BIND_FRAGMENT_SHADER_ATI:
+ CALL_BindFragmentShaderATI(ctx->Exec, (n[1].i));
+ break;
+ case OPCODE_SET_FRAGMENT_SHADER_CONSTANTS_ATI:
+ {
+ GLfloat values[4];
+ GLuint i, dst = n[1].ui;
+
+ for (i = 0; i < 4; i++)
+ values[i] = n[1 + i].f;
+ CALL_SetFragmentShaderConstantATI(ctx->Exec, (dst, values));
+ }
+ break;
+#endif
+ case OPCODE_ATTR_1F_NV:
+ CALL_VertexAttrib1fNV(ctx->Exec, (n[1].e, n[2].f));
+ break;
+ case OPCODE_ATTR_2F_NV:
+ /* Really shouldn't have to do this - the Node structure
+ * is convenient, but it would be better to store the data
+ * packed appropriately so that it can be sent directly
+ * on. With x86_64 becoming common, this will start to
+ * matter more.
+ */
+ if (sizeof(Node) == sizeof(GLfloat))
+ CALL_VertexAttrib2fvNV(ctx->Exec, (n[1].e, &n[2].f));
+ else
+ CALL_VertexAttrib2fNV(ctx->Exec, (n[1].e, n[2].f, n[3].f));
+ break;
+ case OPCODE_ATTR_3F_NV:
+ if (sizeof(Node) == sizeof(GLfloat))
+ CALL_VertexAttrib3fvNV(ctx->Exec, (n[1].e, &n[2].f));
+ else
+ CALL_VertexAttrib3fNV(ctx->Exec, (n[1].e, n[2].f, n[3].f,
+ n[4].f));
+ break;
+ case OPCODE_ATTR_4F_NV:
+ if (sizeof(Node) == sizeof(GLfloat))
+ CALL_VertexAttrib4fvNV(ctx->Exec, (n[1].e, &n[2].f));
+ else
+ CALL_VertexAttrib4fNV(ctx->Exec, (n[1].e, n[2].f, n[3].f,
+ n[4].f, n[5].f));
+ break;
+ case OPCODE_ATTR_1F_ARB:
+ CALL_VertexAttrib1fARB(ctx->Exec, (n[1].e, n[2].f));
+ break;
+ case OPCODE_ATTR_2F_ARB:
+ /* Really shouldn't have to do this - the Node structure
+ * is convenient, but it would be better to store the data
+ * packed appropriately so that it can be sent directly
+ * on. With x86_64 becoming common, this will start to
+ * matter more.
+ */
+ if (sizeof(Node) == sizeof(GLfloat))
+ CALL_VertexAttrib2fvARB(ctx->Exec, (n[1].e, &n[2].f));
+ else
+ CALL_VertexAttrib2fARB(ctx->Exec, (n[1].e, n[2].f, n[3].f));
+ break;
+ case OPCODE_ATTR_3F_ARB:
+ if (sizeof(Node) == sizeof(GLfloat))
+ CALL_VertexAttrib3fvARB(ctx->Exec, (n[1].e, &n[2].f));
+ else
+ CALL_VertexAttrib3fARB(ctx->Exec, (n[1].e, n[2].f, n[3].f,
+ n[4].f));
+ break;
+ case OPCODE_ATTR_4F_ARB:
+ if (sizeof(Node) == sizeof(GLfloat))
+ CALL_VertexAttrib4fvARB(ctx->Exec, (n[1].e, &n[2].f));
+ else
+ CALL_VertexAttrib4fARB(ctx->Exec, (n[1].e, n[2].f, n[3].f,
+ n[4].f, n[5].f));
+ break;
+ case OPCODE_MATERIAL:
+ if (sizeof(Node) == sizeof(GLfloat))
+ CALL_Materialfv(ctx->Exec, (n[1].e, n[2].e, &n[3].f));
+ else {
+ GLfloat f[4];
+ f[0] = n[3].f;
+ f[1] = n[4].f;
+ f[2] = n[5].f;
+ f[3] = n[6].f;
+ CALL_Materialfv(ctx->Exec, (n[1].e, n[2].e, f));
+ }
+ break;
+ case OPCODE_BEGIN:
+ CALL_Begin(ctx->Exec, (n[1].e));
+ break;
+ case OPCODE_END:
+ CALL_End(ctx->Exec, ());
+ break;
+ case OPCODE_RECTF:
+ CALL_Rectf(ctx->Exec, (n[1].f, n[2].f, n[3].f, n[4].f));
+ break;
+ case OPCODE_EVAL_C1:
+ CALL_EvalCoord1f(ctx->Exec, (n[1].f));
+ break;
+ case OPCODE_EVAL_C2:
+ CALL_EvalCoord2f(ctx->Exec, (n[1].f, n[2].f));
+ break;
+ case OPCODE_EVAL_P1:
+ CALL_EvalPoint1(ctx->Exec, (n[1].i));
+ break;
+ case OPCODE_EVAL_P2:
+ CALL_EvalPoint2(ctx->Exec, (n[1].i, n[2].i));
+ break;
+
+ /* GL_EXT_texture_integer */
+ case OPCODE_CLEARCOLOR_I:
+ CALL_ClearColorIiEXT(ctx->Exec, (n[1].i, n[2].i, n[3].i, n[4].i));
+ break;
+ case OPCODE_CLEARCOLOR_UI:
+ CALL_ClearColorIuiEXT(ctx->Exec,
+ (n[1].ui, n[2].ui, n[3].ui, n[4].ui));
+ break;
+ case OPCODE_TEXPARAMETER_I:
+ {
+ GLint params[4];
+ params[0] = n[3].i;
+ params[1] = n[4].i;
+ params[2] = n[5].i;
+ params[3] = n[6].i;
+ CALL_TexParameterIivEXT(ctx->Exec, (n[1].e, n[2].e, params));
+ }
+ break;
+ case OPCODE_TEXPARAMETER_UI:
+ {
+ GLuint params[4];
+ params[0] = n[3].ui;
+ params[1] = n[4].ui;
+ params[2] = n[5].ui;
+ params[3] = n[6].ui;
+ CALL_TexParameterIuivEXT(ctx->Exec, (n[1].e, n[2].e, params));
+ }
+ break;
+
+ case OPCODE_VERTEX_ATTRIB_DIVISOR:
+ /* GL_ARB_instanced_arrays */
+ CALL_VertexAttribDivisorARB(ctx->Exec, (n[1].ui, n[2].ui));
+ break;
+
+ case OPCODE_TEXTURE_BARRIER_NV:
+ CALL_TextureBarrierNV(ctx->Exec, ());
+ break;
+
+ case OPCODE_BIND_SAMPLER:
+ CALL_BindSampler(ctx->Exec, (n[1].ui, n[2].ui));
+ break;
+
+ case OPCODE_CONTINUE:
+ n = (Node *) n[1].next;
+ break;
+ case OPCODE_END_OF_LIST:
+ done = GL_TRUE;
+ break;
+ default:
+ {
+ char msg[1000];
+ _mesa_snprintf(msg, sizeof(msg), "Error in execute_list: opcode=%d",
+ (int) opcode);
+ _mesa_problem(ctx, "%s", msg);
+ }
+ done = GL_TRUE;
+ }
+
+ /* increment n to point to next compiled command */
+ if (opcode != OPCODE_CONTINUE) {
+ n += InstSize[opcode];
+ }
+ }
+ }
+
+ if (ctx->Driver.EndCallList)
+ ctx->Driver.EndCallList(ctx);
+
+ ctx->ListState.CallDepth--;
+}
+
+
+
+/**********************************************************************/
+/* GL functions */
+/**********************************************************************/
+
+/**
+ * Test if a display list number is valid.
+ */
+static GLboolean GLAPIENTRY
+_mesa_IsList(GLuint list)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ FLUSH_VERTICES(ctx, 0); /* must be called before assert */
+ ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, GL_FALSE);
+ return islist(ctx, list);
+}
+
+
+/**
+ * Delete a sequence of consecutive display lists.
+ */
+static void GLAPIENTRY
+_mesa_DeleteLists(GLuint list, GLsizei range)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ GLuint i;
+ FLUSH_VERTICES(ctx, 0); /* must be called before assert */
+ ASSERT_OUTSIDE_BEGIN_END(ctx);
+
+ if (range < 0) {
+ _mesa_error(ctx, GL_INVALID_VALUE, "glDeleteLists");
+ return;
+ }
+ for (i = list; i < list + range; i++) {
+ destroy_list(ctx, i);
+ }
+}
+
+
+/**
+ * Return a display list number, n, such that lists n through n+range-1
+ * are free.
+ */
+static GLuint GLAPIENTRY
+_mesa_GenLists(GLsizei range)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ GLuint base;
+ FLUSH_VERTICES(ctx, 0); /* must be called before assert */
+ ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, 0);
+
+ if (range < 0) {
+ _mesa_error(ctx, GL_INVALID_VALUE, "glGenLists");
+ return 0;
+ }
+ if (range == 0) {
+ return 0;
+ }
+
+ /*
+ * Make this an atomic operation
+ */
+ _glthread_LOCK_MUTEX(ctx->Shared->Mutex);
+
+ base = _mesa_HashFindFreeKeyBlock(ctx->Shared->DisplayList, range);
+ if (base) {
+ /* reserve the list IDs by with empty/dummy lists */
+ GLint i;
+ for (i = 0; i < range; i++) {
+ _mesa_HashInsert(ctx->Shared->DisplayList, base + i,
+ make_list(base + i, 1));
+ }
+ }
+
+ _glthread_UNLOCK_MUTEX(ctx->Shared->Mutex);
+
+ return base;
+}
+
+
+/**
+ * Begin a new display list.
+ */
+static void GLAPIENTRY
+_mesa_NewList(GLuint name, GLenum mode)
+{
+ GET_CURRENT_CONTEXT(ctx);
+
+ FLUSH_CURRENT(ctx, 0); /* must be called before assert */
+ ASSERT_OUTSIDE_BEGIN_END(ctx);
+
+ if (MESA_VERBOSE & VERBOSE_API)
+ _mesa_debug(ctx, "glNewList %u %s\n", name,
+ _mesa_lookup_enum_by_nr(mode));
+
+ if (name == 0) {
+ _mesa_error(ctx, GL_INVALID_VALUE, "glNewList");
+ return;
+ }
+
+ if (mode != GL_COMPILE && mode != GL_COMPILE_AND_EXECUTE) {
+ _mesa_error(ctx, GL_INVALID_ENUM, "glNewList");
+ return;
+ }
+
+ if (ctx->ListState.CurrentList) {
+ /* already compiling a display list */
+ _mesa_error(ctx, GL_INVALID_OPERATION, "glNewList");
+ return;
+ }
+
+ ctx->CompileFlag = GL_TRUE;
+ ctx->ExecuteFlag = (mode == GL_COMPILE_AND_EXECUTE);
+
+ /* Reset acumulated list state:
+ */
+ invalidate_saved_current_state( ctx );
+
+ /* Allocate new display list */
+ ctx->ListState.CurrentList = make_list(name, BLOCK_SIZE);
+ ctx->ListState.CurrentBlock = ctx->ListState.CurrentList->Head;
+ ctx->ListState.CurrentPos = 0;
+
+ ctx->Driver.NewList(ctx, name, mode);
+
+ ctx->CurrentDispatch = ctx->Save;
+ _glapi_set_dispatch(ctx->CurrentDispatch);
+}
+
+
+/**
+ * End definition of current display list.
+ */
+static void GLAPIENTRY
+_mesa_EndList(void)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ SAVE_FLUSH_VERTICES(ctx);
+ ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
+
+ if (MESA_VERBOSE & VERBOSE_API)
+ _mesa_debug(ctx, "glEndList\n");
+
+ /* Check that a list is under construction */
+ if (!ctx->ListState.CurrentList) {
+ _mesa_error(ctx, GL_INVALID_OPERATION, "glEndList");
+ return;
+ }
+
+ /* Call before emitting END_OF_LIST, in case the driver wants to
+ * emit opcodes itself.
+ */
+ ctx->Driver.EndList(ctx);
+
+ (void) alloc_instruction(ctx, OPCODE_END_OF_LIST, 0);
+
+ /* Destroy old list, if any */
+ destroy_list(ctx, ctx->ListState.CurrentList->Name);
+
+ /* Install the new list */
+ _mesa_HashInsert(ctx->Shared->DisplayList,
+ ctx->ListState.CurrentList->Name,
+ ctx->ListState.CurrentList);
+
+
+ if (MESA_VERBOSE & VERBOSE_DISPLAY_LIST)
+ mesa_print_display_list(ctx->ListState.CurrentList->Name);
+
+ ctx->ListState.CurrentList = NULL;
+ ctx->ExecuteFlag = GL_TRUE;
+ ctx->CompileFlag = GL_FALSE;
+
+ ctx->CurrentDispatch = ctx->Exec;
+ _glapi_set_dispatch(ctx->CurrentDispatch);
+}
+
+
+void GLAPIENTRY
+_mesa_CallList(GLuint list)
+{
+ GLboolean save_compile_flag;
+ GET_CURRENT_CONTEXT(ctx);
+ FLUSH_CURRENT(ctx, 0);
+
+ if (MESA_VERBOSE & VERBOSE_API)
+ _mesa_debug(ctx, "glCallList %d\n", list);
+
+ if (list == 0) {
+ _mesa_error(ctx, GL_INVALID_VALUE, "glCallList(list==0)");
+ return;
+ }
+
+ if (0)
+ mesa_print_display_list( list );
+
+ /* VERY IMPORTANT: Save the CompileFlag status, turn it off,
+ * execute the display list, and restore the CompileFlag.
+ */
+ save_compile_flag = ctx->CompileFlag;
+ if (save_compile_flag) {
+ ctx->CompileFlag = GL_FALSE;
+ }
+
+ execute_list(ctx, list);
+ ctx->CompileFlag = save_compile_flag;
+
+ /* also restore API function pointers to point to "save" versions */
+ if (save_compile_flag) {
+ ctx->CurrentDispatch = ctx->Save;
+ _glapi_set_dispatch(ctx->CurrentDispatch);
+ }
+}
+
+
+/**
+ * Execute glCallLists: call multiple display lists.
+ */
+void GLAPIENTRY
+_mesa_CallLists(GLsizei n, GLenum type, const GLvoid * lists)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ GLint i;
+ GLboolean save_compile_flag;
+
+ if (MESA_VERBOSE & VERBOSE_API)
+ _mesa_debug(ctx, "glCallLists %d\n", n);
+
+ switch (type) {
+ case GL_BYTE:
+ case GL_UNSIGNED_BYTE:
+ case GL_SHORT:
+ case GL_UNSIGNED_SHORT:
+ case GL_INT:
+ case GL_UNSIGNED_INT:
+ case GL_FLOAT:
+ case GL_2_BYTES:
+ case GL_3_BYTES:
+ case GL_4_BYTES:
+ /* OK */
+ break;
+ default:
+ _mesa_error(ctx, GL_INVALID_ENUM, "glCallLists(type)");
+ return;
+ }
+
+ /* Save the CompileFlag status, turn it off, execute display list,
+ * and restore the CompileFlag.
+ */
+ save_compile_flag = ctx->CompileFlag;
+ ctx->CompileFlag = GL_FALSE;
+
+ for (i = 0; i < n; i++) {
+ GLuint list = (GLuint) (ctx->List.ListBase + translate_id(i, type, lists));
+ execute_list(ctx, list);
+ }
+
+ ctx->CompileFlag = save_compile_flag;
+
+ /* also restore API function pointers to point to "save" versions */
+ if (save_compile_flag) {
+ ctx->CurrentDispatch = ctx->Save;
+ _glapi_set_dispatch(ctx->CurrentDispatch);
+ }
+}
+
+
+/**
+ * Set the offset added to list numbers in glCallLists.
+ */
+static void GLAPIENTRY
+_mesa_ListBase(GLuint base)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ FLUSH_VERTICES(ctx, 0); /* must be called before assert */
+ ASSERT_OUTSIDE_BEGIN_END(ctx);
+ ctx->List.ListBase = base;
+}
+
+
+/* Can no longer assume ctx->Exec->Func is equal to _mesa_Func.
+ */
+static void GLAPIENTRY
+exec_Finish(void)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ FLUSH_VERTICES(ctx, 0);
+ CALL_Finish(ctx->Exec, ());
+}
+
+static void GLAPIENTRY
+exec_Flush(void)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ FLUSH_VERTICES(ctx, 0);
+ CALL_Flush(ctx->Exec, ());
+}
+
+static void GLAPIENTRY
+exec_GetBooleanv(GLenum pname, GLboolean *params)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ FLUSH_VERTICES(ctx, 0);
+ CALL_GetBooleanv(ctx->Exec, (pname, params));
+}
+
+static void GLAPIENTRY
+exec_GetClipPlane(GLenum plane, GLdouble * equation)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ FLUSH_VERTICES(ctx, 0);
+ CALL_GetClipPlane(ctx->Exec, (plane, equation));
+}
+
+static void GLAPIENTRY
+exec_GetDoublev(GLenum pname, GLdouble *params)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ FLUSH_VERTICES(ctx, 0);
+ CALL_GetDoublev(ctx->Exec, (pname, params));
+}
+
+static GLenum GLAPIENTRY
+exec_GetError(void)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ FLUSH_VERTICES(ctx, 0);
+ return CALL_GetError(ctx->Exec, ());
+}
+
+static void GLAPIENTRY
+exec_GetFloatv(GLenum pname, GLfloat *params)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ FLUSH_VERTICES(ctx, 0);
+ CALL_GetFloatv(ctx->Exec, (pname, params));
+}
+
+static void GLAPIENTRY
+exec_GetIntegerv(GLenum pname, GLint *params)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ FLUSH_VERTICES(ctx, 0);
+ CALL_GetIntegerv(ctx->Exec, (pname, params));
+}
+
+static void GLAPIENTRY
+exec_GetLightfv(GLenum light, GLenum pname, GLfloat *params)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ FLUSH_VERTICES(ctx, 0);
+ CALL_GetLightfv(ctx->Exec, (light, pname, params));
+}
+
+static void GLAPIENTRY
+exec_GetLightiv(GLenum light, GLenum pname, GLint *params)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ FLUSH_VERTICES(ctx, 0);
+ CALL_GetLightiv(ctx->Exec, (light, pname, params));
+}
+
+static void GLAPIENTRY
+exec_GetMapdv(GLenum target, GLenum query, GLdouble * v)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ FLUSH_VERTICES(ctx, 0);
+ CALL_GetMapdv(ctx->Exec, (target, query, v));
+}
+
+static void GLAPIENTRY
+exec_GetMapfv(GLenum target, GLenum query, GLfloat * v)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ FLUSH_VERTICES(ctx, 0);
+ CALL_GetMapfv(ctx->Exec, (target, query, v));
+}
+
+static void GLAPIENTRY
+exec_GetMapiv(GLenum target, GLenum query, GLint * v)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ FLUSH_VERTICES(ctx, 0);
+ CALL_GetMapiv(ctx->Exec, (target, query, v));
+}
+
+static void GLAPIENTRY
+exec_GetMaterialfv(GLenum face, GLenum pname, GLfloat *params)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ FLUSH_VERTICES(ctx, 0);
+ CALL_GetMaterialfv(ctx->Exec, (face, pname, params));
+}
+
+static void GLAPIENTRY
+exec_GetMaterialiv(GLenum face, GLenum pname, GLint *params)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ FLUSH_VERTICES(ctx, 0);
+ CALL_GetMaterialiv(ctx->Exec, (face, pname, params));
+}
+
+static void GLAPIENTRY
+exec_GetPixelMapfv(GLenum map, GLfloat *values)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ FLUSH_VERTICES(ctx, 0);
+ CALL_GetPixelMapfv(ctx->Exec, (map, values));
+}
+
+static void GLAPIENTRY
+exec_GetPixelMapuiv(GLenum map, GLuint *values)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ FLUSH_VERTICES(ctx, 0);
+ CALL_GetPixelMapuiv(ctx->Exec, (map, values));
+}
+
+static void GLAPIENTRY
+exec_GetPixelMapusv(GLenum map, GLushort *values)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ FLUSH_VERTICES(ctx, 0);
+ CALL_GetPixelMapusv(ctx->Exec, (map, values));
+}
+
+static void GLAPIENTRY
+exec_GetPolygonStipple(GLubyte * dest)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ FLUSH_VERTICES(ctx, 0);
+ CALL_GetPolygonStipple(ctx->Exec, (dest));
+}
+
+static const GLubyte *GLAPIENTRY
+exec_GetString(GLenum name)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ FLUSH_VERTICES(ctx, 0);
+ return CALL_GetString(ctx->Exec, (name));
+}
+
+static void GLAPIENTRY
+exec_GetTexEnvfv(GLenum target, GLenum pname, GLfloat *params)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ FLUSH_VERTICES(ctx, 0);
+ CALL_GetTexEnvfv(ctx->Exec, (target, pname, params));
+}
+
+static void GLAPIENTRY
+exec_GetTexEnviv(GLenum target, GLenum pname, GLint *params)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ FLUSH_VERTICES(ctx, 0);
+ CALL_GetTexEnviv(ctx->Exec, (target, pname, params));
+}
+
+static void GLAPIENTRY
+exec_GetTexGendv(GLenum coord, GLenum pname, GLdouble *params)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ FLUSH_VERTICES(ctx, 0);
+ CALL_GetTexGendv(ctx->Exec, (coord, pname, params));
+}
+
+static void GLAPIENTRY
+exec_GetTexGenfv(GLenum coord, GLenum pname, GLfloat *params)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ FLUSH_VERTICES(ctx, 0);
+ CALL_GetTexGenfv(ctx->Exec, (coord, pname, params));
+}
+
+static void GLAPIENTRY
+exec_GetTexGeniv(GLenum coord, GLenum pname, GLint *params)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ FLUSH_VERTICES(ctx, 0);
+ CALL_GetTexGeniv(ctx->Exec, (coord, pname, params));
+}
+
+static void GLAPIENTRY
+exec_GetTexImage(GLenum target, GLint level, GLenum format,
+ GLenum type, GLvoid * pixels)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ FLUSH_VERTICES(ctx, 0);
+ CALL_GetTexImage(ctx->Exec, (target, level, format, type, pixels));
+}
+
+static void GLAPIENTRY
+exec_GetTexLevelParameterfv(GLenum target, GLint level,
+ GLenum pname, GLfloat *params)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ FLUSH_VERTICES(ctx, 0);
+ CALL_GetTexLevelParameterfv(ctx->Exec, (target, level, pname, params));
+}
+
+static void GLAPIENTRY
+exec_GetTexLevelParameteriv(GLenum target, GLint level,
+ GLenum pname, GLint *params)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ FLUSH_VERTICES(ctx, 0);
+ CALL_GetTexLevelParameteriv(ctx->Exec, (target, level, pname, params));
+}
+
+static void GLAPIENTRY
+exec_GetTexParameterfv(GLenum target, GLenum pname, GLfloat *params)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ FLUSH_VERTICES(ctx, 0);
+ CALL_GetTexParameterfv(ctx->Exec, (target, pname, params));
+}
+
+static void GLAPIENTRY
+exec_GetTexParameteriv(GLenum target, GLenum pname, GLint *params)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ FLUSH_VERTICES(ctx, 0);
+ CALL_GetTexParameteriv(ctx->Exec, (target, pname, params));
+}
+
+static GLboolean GLAPIENTRY
+exec_IsEnabled(GLenum cap)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ FLUSH_VERTICES(ctx, 0);
+ return CALL_IsEnabled(ctx->Exec, (cap));
+}
+
+static void GLAPIENTRY
+exec_PixelStoref(GLenum pname, GLfloat param)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ FLUSH_VERTICES(ctx, 0);
+ CALL_PixelStoref(ctx->Exec, (pname, param));
+}
+
+static void GLAPIENTRY
+exec_PixelStorei(GLenum pname, GLint param)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ FLUSH_VERTICES(ctx, 0);
+ CALL_PixelStorei(ctx->Exec, (pname, param));
+}
+
+static void GLAPIENTRY
+exec_ReadPixels(GLint x, GLint y, GLsizei width, GLsizei height,
+ GLenum format, GLenum type, GLvoid * pixels)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ FLUSH_VERTICES(ctx, 0);
+ CALL_ReadPixels(ctx->Exec, (x, y, width, height, format, type, pixels));
+}
+
+static GLint GLAPIENTRY
+exec_RenderMode(GLenum mode)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ FLUSH_VERTICES(ctx, 0);
+ return CALL_RenderMode(ctx->Exec, (mode));
+}
+
+static void GLAPIENTRY
+exec_FeedbackBuffer(GLsizei size, GLenum type, GLfloat * buffer)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ FLUSH_VERTICES(ctx, 0);
+ CALL_FeedbackBuffer(ctx->Exec, (size, type, buffer));
+}
+
+static void GLAPIENTRY
+exec_SelectBuffer(GLsizei size, GLuint * buffer)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ FLUSH_VERTICES(ctx, 0);
+ CALL_SelectBuffer(ctx->Exec, (size, buffer));
+}
+
+static GLboolean GLAPIENTRY
+exec_AreTexturesResident(GLsizei n, const GLuint * texName,
+ GLboolean * residences)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ FLUSH_VERTICES(ctx, 0);
+ return CALL_AreTexturesResident(ctx->Exec, (n, texName, residences));
+}
+
+static void GLAPIENTRY
+exec_ColorPointer(GLint size, GLenum type, GLsizei stride, const GLvoid *ptr)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ FLUSH_VERTICES(ctx, 0);
+ CALL_ColorPointer(ctx->Exec, (size, type, stride, ptr));
+}
+
+static void GLAPIENTRY
+exec_DeleteTextures(GLsizei n, const GLuint * texName)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ FLUSH_VERTICES(ctx, 0);
+ CALL_DeleteTextures(ctx->Exec, (n, texName));
+}
+
+static void GLAPIENTRY
+exec_DisableClientState(GLenum cap)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ FLUSH_VERTICES(ctx, 0);
+ CALL_DisableClientState(ctx->Exec, (cap));
+}
+
+static void GLAPIENTRY
+exec_EdgeFlagPointer(GLsizei stride, const GLvoid * vptr)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ FLUSH_VERTICES(ctx, 0);
+ CALL_EdgeFlagPointer(ctx->Exec, (stride, vptr));
+}
+
+static void GLAPIENTRY
+exec_EnableClientState(GLenum cap)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ FLUSH_VERTICES(ctx, 0);
+ CALL_EnableClientState(ctx->Exec, (cap));
+}
+
+static void GLAPIENTRY
+exec_GenTextures(GLsizei n, GLuint * texName)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ FLUSH_VERTICES(ctx, 0);
+ CALL_GenTextures(ctx->Exec, (n, texName));
+}
+
+static void GLAPIENTRY
+exec_GetPointerv(GLenum pname, GLvoid **params)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ FLUSH_VERTICES(ctx, 0);
+ CALL_GetPointerv(ctx->Exec, (pname, params));
+}
+
+static void GLAPIENTRY
+exec_IndexPointer(GLenum type, GLsizei stride, const GLvoid *ptr)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ FLUSH_VERTICES(ctx, 0);
+ CALL_IndexPointer(ctx->Exec, (type, stride, ptr));
+}
+
+static void GLAPIENTRY
+exec_InterleavedArrays(GLenum format, GLsizei stride, const GLvoid * pointer)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ FLUSH_VERTICES(ctx, 0);
+ CALL_InterleavedArrays(ctx->Exec, (format, stride, pointer));
+}
+
+static GLboolean GLAPIENTRY
+exec_IsTexture(GLuint texture)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ FLUSH_VERTICES(ctx, 0);
+ return CALL_IsTexture(ctx->Exec, (texture));
+}
+
+static void GLAPIENTRY
+exec_NormalPointer(GLenum type, GLsizei stride, const GLvoid *ptr)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ FLUSH_VERTICES(ctx, 0);
+ CALL_NormalPointer(ctx->Exec, (type, stride, ptr));
+}
+
+static void GLAPIENTRY
+exec_PopClientAttrib(void)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ FLUSH_VERTICES(ctx, 0);
+ CALL_PopClientAttrib(ctx->Exec, ());
+}
+
+static void GLAPIENTRY
+exec_PushClientAttrib(GLbitfield mask)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ FLUSH_VERTICES(ctx, 0);
+ CALL_PushClientAttrib(ctx->Exec, (mask));
+}
+
+static void GLAPIENTRY
+exec_TexCoordPointer(GLint size, GLenum type, GLsizei stride,
+ const GLvoid *ptr)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ FLUSH_VERTICES(ctx, 0);
+ CALL_TexCoordPointer(ctx->Exec, (size, type, stride, ptr));
+}
+
+static void GLAPIENTRY
+exec_GetCompressedTexImageARB(GLenum target, GLint level, GLvoid * img)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ FLUSH_VERTICES(ctx, 0);
+ CALL_GetCompressedTexImageARB(ctx->Exec, (target, level, img));
+}
+
+static void GLAPIENTRY
+exec_VertexPointer(GLint size, GLenum type, GLsizei stride,
+ const GLvoid *ptr)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ FLUSH_VERTICES(ctx, 0);
+ CALL_VertexPointer(ctx->Exec, (size, type, stride, ptr));
+}
+
+static void GLAPIENTRY
+exec_CopyConvolutionFilter1D(GLenum target, GLenum internalFormat,
+ GLint x, GLint y, GLsizei width)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ FLUSH_VERTICES(ctx, 0);
+ CALL_CopyConvolutionFilter1D(ctx->Exec,
+ (target, internalFormat, x, y, width));
+}
+
+static void GLAPIENTRY
+exec_CopyConvolutionFilter2D(GLenum target, GLenum internalFormat,
+ GLint x, GLint y, GLsizei width, GLsizei height)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ FLUSH_VERTICES(ctx, 0);
+ CALL_CopyConvolutionFilter2D(ctx->Exec,
+ (target, internalFormat, x, y, width,
+ height));
+}
+
+static void GLAPIENTRY
+exec_GetColorTable(GLenum target, GLenum format, GLenum type, GLvoid * data)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ FLUSH_VERTICES(ctx, 0);
+ CALL_GetColorTable(ctx->Exec, (target, format, type, data));
+}
+
+static void GLAPIENTRY
+exec_GetColorTableParameterfv(GLenum target, GLenum pname, GLfloat *params)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ FLUSH_VERTICES(ctx, 0);
+ CALL_GetColorTableParameterfv(ctx->Exec, (target, pname, params));
+}
+
+static void GLAPIENTRY
+exec_GetColorTableParameteriv(GLenum target, GLenum pname, GLint *params)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ FLUSH_VERTICES(ctx, 0);
+ CALL_GetColorTableParameteriv(ctx->Exec, (target, pname, params));
+}
+
+static void GLAPIENTRY
+exec_GetConvolutionFilter(GLenum target, GLenum format, GLenum type,
+ GLvoid * image)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ FLUSH_VERTICES(ctx, 0);
+ CALL_GetConvolutionFilter(ctx->Exec, (target, format, type, image));
+}
+
+static void GLAPIENTRY
+exec_GetConvolutionParameterfv(GLenum target, GLenum pname, GLfloat *params)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ FLUSH_VERTICES(ctx, 0);
+ CALL_GetConvolutionParameterfv(ctx->Exec, (target, pname, params));
+}
+
+static void GLAPIENTRY
+exec_GetConvolutionParameteriv(GLenum target, GLenum pname, GLint *params)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ FLUSH_VERTICES(ctx, 0);
+ CALL_GetConvolutionParameteriv(ctx->Exec, (target, pname, params));
+}
+
+static void GLAPIENTRY
+exec_GetHistogram(GLenum target, GLboolean reset, GLenum format,
+ GLenum type, GLvoid *values)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ FLUSH_VERTICES(ctx, 0);
+ CALL_GetHistogram(ctx->Exec, (target, reset, format, type, values));
+}
+
+static void GLAPIENTRY
+exec_GetHistogramParameterfv(GLenum target, GLenum pname, GLfloat *params)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ FLUSH_VERTICES(ctx, 0);
+ CALL_GetHistogramParameterfv(ctx->Exec, (target, pname, params));
+}
+
+static void GLAPIENTRY
+exec_GetHistogramParameteriv(GLenum target, GLenum pname, GLint *params)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ FLUSH_VERTICES(ctx, 0);
+ CALL_GetHistogramParameteriv(ctx->Exec, (target, pname, params));
+}
+
+static void GLAPIENTRY
+exec_GetMinmax(GLenum target, GLboolean reset, GLenum format,
+ GLenum type, GLvoid *values)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ FLUSH_VERTICES(ctx, 0);
+ CALL_GetMinmax(ctx->Exec, (target, reset, format, type, values));
+}
+
+static void GLAPIENTRY
+exec_GetMinmaxParameterfv(GLenum target, GLenum pname, GLfloat *params)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ FLUSH_VERTICES(ctx, 0);
+ CALL_GetMinmaxParameterfv(ctx->Exec, (target, pname, params));
+}
+
+static void GLAPIENTRY
+exec_GetMinmaxParameteriv(GLenum target, GLenum pname, GLint *params)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ FLUSH_VERTICES(ctx, 0);
+ CALL_GetMinmaxParameteriv(ctx->Exec, (target, pname, params));
+}
+
+static void GLAPIENTRY
+exec_GetSeparableFilter(GLenum target, GLenum format, GLenum type,
+ GLvoid *row, GLvoid *column, GLvoid *span)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ FLUSH_VERTICES(ctx, 0);
+ CALL_GetSeparableFilter(ctx->Exec,
+ (target, format, type, row, column, span));
+}
+
+static void GLAPIENTRY
+exec_SeparableFilter2D(GLenum target, GLenum internalFormat,
+ GLsizei width, GLsizei height, GLenum format,
+ GLenum type, const GLvoid *row, const GLvoid *column)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ FLUSH_VERTICES(ctx, 0);
+ CALL_SeparableFilter2D(ctx->Exec,
+ (target, internalFormat, width, height, format,
+ type, row, column));
+}
+
+static void GLAPIENTRY
+exec_ColorPointerEXT(GLint size, GLenum type, GLsizei stride,
+ GLsizei count, const GLvoid *ptr)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ FLUSH_VERTICES(ctx, 0);
+ CALL_ColorPointerEXT(ctx->Exec, (size, type, stride, count, ptr));
+}
+
+static void GLAPIENTRY
+exec_EdgeFlagPointerEXT(GLsizei stride, GLsizei count, const GLboolean *ptr)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ FLUSH_VERTICES(ctx, 0);
+ CALL_EdgeFlagPointerEXT(ctx->Exec, (stride, count, ptr));
+}
+
+static void GLAPIENTRY
+exec_IndexPointerEXT(GLenum type, GLsizei stride, GLsizei count,
+ const GLvoid *ptr)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ FLUSH_VERTICES(ctx, 0);
+ CALL_IndexPointerEXT(ctx->Exec, (type, stride, count, ptr));
+}
+
+static void GLAPIENTRY
+exec_NormalPointerEXT(GLenum type, GLsizei stride, GLsizei count,
+ const GLvoid *ptr)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ FLUSH_VERTICES(ctx, 0);
+ CALL_NormalPointerEXT(ctx->Exec, (type, stride, count, ptr));
+}
+
+static void GLAPIENTRY
+exec_TexCoordPointerEXT(GLint size, GLenum type, GLsizei stride,
+ GLsizei count, const GLvoid *ptr)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ FLUSH_VERTICES(ctx, 0);
+ CALL_TexCoordPointerEXT(ctx->Exec, (size, type, stride, count, ptr));
+}
+
+static void GLAPIENTRY
+exec_VertexPointerEXT(GLint size, GLenum type, GLsizei stride,
+ GLsizei count, const GLvoid *ptr)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ FLUSH_VERTICES(ctx, 0);
+ CALL_VertexPointerEXT(ctx->Exec, (size, type, stride, count, ptr));
+}
+
+static void GLAPIENTRY
+exec_LockArraysEXT(GLint first, GLsizei count)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ FLUSH_VERTICES(ctx, 0);
+ CALL_LockArraysEXT(ctx->Exec, (first, count));
+}
+
+static void GLAPIENTRY
+exec_UnlockArraysEXT(void)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ FLUSH_VERTICES(ctx, 0);
+ CALL_UnlockArraysEXT(ctx->Exec, ());
+}
+
+static void GLAPIENTRY
+exec_ClientActiveTextureARB(GLenum target)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ FLUSH_VERTICES(ctx, 0);
+ CALL_ClientActiveTextureARB(ctx->Exec, (target));
+}
+
+static void GLAPIENTRY
+exec_SecondaryColorPointerEXT(GLint size, GLenum type,
+ GLsizei stride, const GLvoid *ptr)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ FLUSH_VERTICES(ctx, 0);
+ CALL_SecondaryColorPointerEXT(ctx->Exec, (size, type, stride, ptr));
+}
+
+static void GLAPIENTRY
+exec_FogCoordPointerEXT(GLenum type, GLsizei stride, const GLvoid *ptr)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ FLUSH_VERTICES(ctx, 0);
+ CALL_FogCoordPointerEXT(ctx->Exec, (type, stride, ptr));
+}
+
+/* GL_EXT_multi_draw_arrays */
+static void GLAPIENTRY
+exec_MultiDrawArraysEXT(GLenum mode, const GLint *first,
+ const GLsizei *count, GLsizei primcount)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ FLUSH_VERTICES(ctx, 0);
+ CALL_MultiDrawArraysEXT(ctx->Exec, (mode, first, count, primcount));
+}
+
+/* GL_IBM_multimode_draw_arrays */
+static void GLAPIENTRY
+exec_MultiModeDrawArraysIBM(const GLenum * mode, const GLint * first,
+ const GLsizei * count, GLsizei primcount,
+ GLint modestride)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ FLUSH_VERTICES(ctx, 0);
+ CALL_MultiModeDrawArraysIBM(ctx->Exec,
+ (mode, first, count, primcount, modestride));
+}
+
+/* GL_IBM_multimode_draw_arrays */
+static void GLAPIENTRY
+exec_MultiModeDrawElementsIBM(const GLenum * mode,
+ const GLsizei * count,
+ GLenum type,
+ const GLvoid * const *indices,
+ GLsizei primcount, GLint modestride)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ FLUSH_VERTICES(ctx, 0);
+ CALL_MultiModeDrawElementsIBM(ctx->Exec,
+ (mode, count, type, indices, primcount,
+ modestride));
+}
+
+
+
+/**
+ * Setup the given dispatch table to point to Mesa's display list
+ * building functions.
+ *
+ * This does not include any of the tnl functions - they are
+ * initialized from _mesa_init_api_defaults and from the active vtxfmt
+ * struct.
+ */
+struct _glapi_table *
+_mesa_create_save_table(void)
+{
+ struct _glapi_table *table;
+
+ table = _mesa_alloc_dispatch_table(_gloffset_COUNT);
+ if (table == NULL)
+ return NULL;
+
+ _mesa_loopback_init_api_table(table);
+
+ /* GL 1.0 */
+ SET_Accum(table, save_Accum);
+ SET_AlphaFunc(table, save_AlphaFunc);
+ SET_Bitmap(table, save_Bitmap);
+ SET_BlendFunc(table, save_BlendFunc);
+ SET_CallList(table, save_CallList);
+ SET_CallLists(table, save_CallLists);
+ SET_Clear(table, save_Clear);
+ SET_ClearAccum(table, save_ClearAccum);
+ SET_ClearColor(table, save_ClearColor);
+ SET_ClearDepth(table, save_ClearDepth);
+ SET_ClearIndex(table, save_ClearIndex);
+ SET_ClearStencil(table, save_ClearStencil);
+ SET_ClipPlane(table, save_ClipPlane);
+ SET_ColorMask(table, save_ColorMask);
+ SET_ColorMaskIndexedEXT(table, save_ColorMaskIndexed);
+ SET_ColorMaterial(table, save_ColorMaterial);
+ SET_CopyPixels(table, save_CopyPixels);
+ SET_CullFace(table, save_CullFace);
+ SET_DeleteLists(table, _mesa_DeleteLists);
+ SET_DepthFunc(table, save_DepthFunc);
+ SET_DepthMask(table, save_DepthMask);
+ SET_DepthRange(table, save_DepthRange);
+ SET_Disable(table, save_Disable);
+ SET_DisableIndexedEXT(table, save_DisableIndexed);
+ SET_DrawBuffer(table, save_DrawBuffer);
+ SET_DrawPixels(table, save_DrawPixels);
+ SET_Enable(table, save_Enable);
+ SET_EnableIndexedEXT(table, save_EnableIndexed);
+ SET_EndList(table, _mesa_EndList);
+ SET_EvalMesh1(table, save_EvalMesh1);
+ SET_EvalMesh2(table, save_EvalMesh2);
+ SET_Finish(table, exec_Finish);
+ SET_Flush(table, exec_Flush);
+ SET_Fogf(table, save_Fogf);
+ SET_Fogfv(table, save_Fogfv);
+ SET_Fogi(table, save_Fogi);
+ SET_Fogiv(table, save_Fogiv);
+ SET_FrontFace(table, save_FrontFace);
+ SET_Frustum(table, save_Frustum);
+ SET_GenLists(table, _mesa_GenLists);
+ SET_GetBooleanv(table, exec_GetBooleanv);
+ SET_GetClipPlane(table, exec_GetClipPlane);
+ SET_GetDoublev(table, exec_GetDoublev);
+ SET_GetError(table, exec_GetError);
+ SET_GetFloatv(table, exec_GetFloatv);
+ SET_GetIntegerv(table, exec_GetIntegerv);
+ SET_GetLightfv(table, exec_GetLightfv);
+ SET_GetLightiv(table, exec_GetLightiv);
+ SET_GetMapdv(table, exec_GetMapdv);
+ SET_GetMapfv(table, exec_GetMapfv);
+ SET_GetMapiv(table, exec_GetMapiv);
+ SET_GetMaterialfv(table, exec_GetMaterialfv);
+ SET_GetMaterialiv(table, exec_GetMaterialiv);
+ SET_GetPixelMapfv(table, exec_GetPixelMapfv);
+ SET_GetPixelMapuiv(table, exec_GetPixelMapuiv);
+ SET_GetPixelMapusv(table, exec_GetPixelMapusv);
+ SET_GetPolygonStipple(table, exec_GetPolygonStipple);
+ SET_GetString(table, exec_GetString);
+ SET_GetTexEnvfv(table, exec_GetTexEnvfv);
+ SET_GetTexEnviv(table, exec_GetTexEnviv);
+ SET_GetTexGendv(table, exec_GetTexGendv);
+ SET_GetTexGenfv(table, exec_GetTexGenfv);
+ SET_GetTexGeniv(table, exec_GetTexGeniv);
+ SET_GetTexImage(table, exec_GetTexImage);
+ SET_GetTexLevelParameterfv(table, exec_GetTexLevelParameterfv);
+ SET_GetTexLevelParameteriv(table, exec_GetTexLevelParameteriv);
+ SET_GetTexParameterfv(table, exec_GetTexParameterfv);
+ SET_GetTexParameteriv(table, exec_GetTexParameteriv);
+ SET_Hint(table, save_Hint);
+ SET_IndexMask(table, save_IndexMask);
+ SET_InitNames(table, save_InitNames);
+ SET_IsEnabled(table, exec_IsEnabled);
+ SET_IsList(table, _mesa_IsList);
+ SET_LightModelf(table, save_LightModelf);
+ SET_LightModelfv(table, save_LightModelfv);
+ SET_LightModeli(table, save_LightModeli);
+ SET_LightModeliv(table, save_LightModeliv);
+ SET_Lightf(table, save_Lightf);
+ SET_Lightfv(table, save_Lightfv);
+ SET_Lighti(table, save_Lighti);
+ SET_Lightiv(table, save_Lightiv);
+ SET_LineStipple(table, save_LineStipple);
+ SET_LineWidth(table, save_LineWidth);
+ SET_ListBase(table, save_ListBase);
+ SET_LoadIdentity(table, save_LoadIdentity);
+ SET_LoadMatrixd(table, save_LoadMatrixd);
+ SET_LoadMatrixf(table, save_LoadMatrixf);
+ SET_LoadName(table, save_LoadName);
+ SET_LogicOp(table, save_LogicOp);
+ SET_Map1d(table, save_Map1d);
+ SET_Map1f(table, save_Map1f);
+ SET_Map2d(table, save_Map2d);
+ SET_Map2f(table, save_Map2f);
+ SET_MapGrid1d(table, save_MapGrid1d);
+ SET_MapGrid1f(table, save_MapGrid1f);
+ SET_MapGrid2d(table, save_MapGrid2d);
+ SET_MapGrid2f(table, save_MapGrid2f);
+ SET_MatrixMode(table, save_MatrixMode);
+ SET_MultMatrixd(table, save_MultMatrixd);
+ SET_MultMatrixf(table, save_MultMatrixf);
+ SET_NewList(table, save_NewList);
+ SET_Ortho(table, save_Ortho);
+ SET_PassThrough(table, save_PassThrough);
+ SET_PixelMapfv(table, save_PixelMapfv);
+ SET_PixelMapuiv(table, save_PixelMapuiv);
+ SET_PixelMapusv(table, save_PixelMapusv);
+ SET_PixelStoref(table, exec_PixelStoref);
+ SET_PixelStorei(table, exec_PixelStorei);
+ SET_PixelTransferf(table, save_PixelTransferf);
+ SET_PixelTransferi(table, save_PixelTransferi);
+ SET_PixelZoom(table, save_PixelZoom);
+ SET_PointSize(table, save_PointSize);
+ SET_PolygonMode(table, save_PolygonMode);
+ SET_PolygonOffset(table, save_PolygonOffset);
+ SET_PolygonStipple(table, save_PolygonStipple);
+ SET_PopAttrib(table, save_PopAttrib);
+ SET_PopMatrix(table, save_PopMatrix);
+ SET_PopName(table, save_PopName);
+ SET_PushAttrib(table, save_PushAttrib);
+ SET_PushMatrix(table, save_PushMatrix);
+ SET_PushName(table, save_PushName);
+ SET_RasterPos2d(table, save_RasterPos2d);
+ SET_RasterPos2dv(table, save_RasterPos2dv);
+ SET_RasterPos2f(table, save_RasterPos2f);
+ SET_RasterPos2fv(table, save_RasterPos2fv);
+ SET_RasterPos2i(table, save_RasterPos2i);
+ SET_RasterPos2iv(table, save_RasterPos2iv);
+ SET_RasterPos2s(table, save_RasterPos2s);
+ SET_RasterPos2sv(table, save_RasterPos2sv);
+ SET_RasterPos3d(table, save_RasterPos3d);
+ SET_RasterPos3dv(table, save_RasterPos3dv);
+ SET_RasterPos3f(table, save_RasterPos3f);
+ SET_RasterPos3fv(table, save_RasterPos3fv);
+ SET_RasterPos3i(table, save_RasterPos3i);
+ SET_RasterPos3iv(table, save_RasterPos3iv);
+ SET_RasterPos3s(table, save_RasterPos3s);
+ SET_RasterPos3sv(table, save_RasterPos3sv);
+ SET_RasterPos4d(table, save_RasterPos4d);
+ SET_RasterPos4dv(table, save_RasterPos4dv);
+ SET_RasterPos4f(table, save_RasterPos4f);
+ SET_RasterPos4fv(table, save_RasterPos4fv);
+ SET_RasterPos4i(table, save_RasterPos4i);
+ SET_RasterPos4iv(table, save_RasterPos4iv);
+ SET_RasterPos4s(table, save_RasterPos4s);
+ SET_RasterPos4sv(table, save_RasterPos4sv);
+ SET_ReadBuffer(table, save_ReadBuffer);
+ SET_ReadPixels(table, exec_ReadPixels);
+ SET_RenderMode(table, exec_RenderMode);
+ SET_Rotated(table, save_Rotated);
+ SET_Rotatef(table, save_Rotatef);
+ SET_Scaled(table, save_Scaled);
+ SET_Scalef(table, save_Scalef);
+ SET_Scissor(table, save_Scissor);
+ SET_FeedbackBuffer(table, exec_FeedbackBuffer);
+ SET_SelectBuffer(table, exec_SelectBuffer);
+ SET_ShadeModel(table, save_ShadeModel);
+ SET_StencilFunc(table, save_StencilFunc);
+ SET_StencilMask(table, save_StencilMask);
+ SET_StencilOp(table, save_StencilOp);
+ SET_TexEnvf(table, save_TexEnvf);
+ SET_TexEnvfv(table, save_TexEnvfv);
+ SET_TexEnvi(table, save_TexEnvi);
+ SET_TexEnviv(table, save_TexEnviv);
+ SET_TexGend(table, save_TexGend);
+ SET_TexGendv(table, save_TexGendv);
+ SET_TexGenf(table, save_TexGenf);
+ SET_TexGenfv(table, save_TexGenfv);
+ SET_TexGeni(table, save_TexGeni);
+ SET_TexGeniv(table, save_TexGeniv);
+ SET_TexImage1D(table, save_TexImage1D);
+ SET_TexImage2D(table, save_TexImage2D);
+ SET_TexParameterf(table, save_TexParameterf);
+ SET_TexParameterfv(table, save_TexParameterfv);
+ SET_TexParameteri(table, save_TexParameteri);
+ SET_TexParameteriv(table, save_TexParameteriv);
+ SET_Translated(table, save_Translated);
+ SET_Translatef(table, save_Translatef);
+ SET_Viewport(table, save_Viewport);
+
+ /* GL 1.1 */
+ SET_AreTexturesResident(table, exec_AreTexturesResident);
+ SET_BindTexture(table, save_BindTexture);
+ SET_ColorPointer(table, exec_ColorPointer);
+ SET_CopyTexImage1D(table, save_CopyTexImage1D);
+ SET_CopyTexImage2D(table, save_CopyTexImage2D);
+ SET_CopyTexSubImage1D(table, save_CopyTexSubImage1D);
+ SET_CopyTexSubImage2D(table, save_CopyTexSubImage2D);
+ SET_DeleteTextures(table, exec_DeleteTextures);
+ SET_DisableClientState(table, exec_DisableClientState);
+ SET_EdgeFlagPointer(table, exec_EdgeFlagPointer);
+ SET_EnableClientState(table, exec_EnableClientState);
+ SET_GenTextures(table, exec_GenTextures);
+ SET_GetPointerv(table, exec_GetPointerv);
+ SET_IndexPointer(table, exec_IndexPointer);
+ SET_InterleavedArrays(table, exec_InterleavedArrays);
+ SET_IsTexture(table, exec_IsTexture);
+ SET_NormalPointer(table, exec_NormalPointer);
+ SET_PopClientAttrib(table, exec_PopClientAttrib);
+ SET_PrioritizeTextures(table, save_PrioritizeTextures);
+ SET_PushClientAttrib(table, exec_PushClientAttrib);
+ SET_TexCoordPointer(table, exec_TexCoordPointer);
+ SET_TexSubImage1D(table, save_TexSubImage1D);
+ SET_TexSubImage2D(table, save_TexSubImage2D);
+ SET_VertexPointer(table, exec_VertexPointer);
+
+ /* GL 1.2 */
+ SET_CopyTexSubImage3D(table, save_CopyTexSubImage3D);
+ SET_TexImage3D(table, save_TexImage3D);
+ SET_TexSubImage3D(table, save_TexSubImage3D);
+
+ /* GL 2.0 */
+ SET_StencilFuncSeparate(table, save_StencilFuncSeparate);
+ SET_StencilMaskSeparate(table, save_StencilMaskSeparate);
+ SET_StencilOpSeparate(table, save_StencilOpSeparate);
+
+ /* ATI_separate_stencil */
+ SET_StencilFuncSeparateATI(table, save_StencilFuncSeparateATI);
+
+ /* GL_ARB_imaging */
+ /* Not all are supported */
+ SET_BlendColor(table, save_BlendColor);
+ SET_BlendEquation(table, save_BlendEquation);
+ SET_ColorSubTable(table, save_ColorSubTable);
+ SET_ColorTable(table, save_ColorTable);
+ SET_ColorTableParameterfv(table, save_ColorTableParameterfv);
+ SET_ColorTableParameteriv(table, save_ColorTableParameteriv);
+ SET_ConvolutionFilter1D(table, save_ConvolutionFilter1D);
+ SET_ConvolutionFilter2D(table, save_ConvolutionFilter2D);
+ SET_ConvolutionParameterf(table, save_ConvolutionParameterf);
+ SET_ConvolutionParameterfv(table, save_ConvolutionParameterfv);
+ SET_ConvolutionParameteri(table, save_ConvolutionParameteri);
+ SET_ConvolutionParameteriv(table, save_ConvolutionParameteriv);
+ SET_CopyColorSubTable(table, save_CopyColorSubTable);
+ SET_CopyColorTable(table, save_CopyColorTable);
+ SET_CopyConvolutionFilter1D(table, exec_CopyConvolutionFilter1D);
+ SET_CopyConvolutionFilter2D(table, exec_CopyConvolutionFilter2D);
+ SET_GetColorTable(table, exec_GetColorTable);
+ SET_GetColorTableParameterfv(table, exec_GetColorTableParameterfv);
+ SET_GetColorTableParameteriv(table, exec_GetColorTableParameteriv);
+ SET_GetConvolutionFilter(table, exec_GetConvolutionFilter);
+ SET_GetConvolutionParameterfv(table, exec_GetConvolutionParameterfv);
+ SET_GetConvolutionParameteriv(table, exec_GetConvolutionParameteriv);
+ SET_GetHistogram(table, exec_GetHistogram);
+ SET_GetHistogramParameterfv(table, exec_GetHistogramParameterfv);
+ SET_GetHistogramParameteriv(table, exec_GetHistogramParameteriv);
+ SET_GetMinmax(table, exec_GetMinmax);
+ SET_GetMinmaxParameterfv(table, exec_GetMinmaxParameterfv);
+ SET_GetMinmaxParameteriv(table, exec_GetMinmaxParameteriv);
+ SET_GetSeparableFilter(table, exec_GetSeparableFilter);
+ SET_Histogram(table, save_Histogram);
+ SET_Minmax(table, save_Minmax);
+ SET_ResetHistogram(table, save_ResetHistogram);
+ SET_ResetMinmax(table, save_ResetMinmax);
+ SET_SeparableFilter2D(table, exec_SeparableFilter2D);
+
+ /* 2. GL_EXT_blend_color */
+#if 0
+ SET_BlendColorEXT(table, save_BlendColorEXT);
+#endif
+
+ /* 3. GL_EXT_polygon_offset */
+ SET_PolygonOffsetEXT(table, save_PolygonOffsetEXT);
+
+ /* 6. GL_EXT_texture3d */
+#if 0
+ SET_CopyTexSubImage3DEXT(table, save_CopyTexSubImage3D);
+ SET_TexImage3DEXT(table, save_TexImage3DEXT);
+ SET_TexSubImage3DEXT(table, save_TexSubImage3D);
+#endif
+
+ /* 14. GL_SGI_color_table */
+#if 0
+ SET_ColorTableSGI(table, save_ColorTable);
+ SET_ColorSubTableSGI(table, save_ColorSubTable);
+ SET_GetColorTableSGI(table, exec_GetColorTable);
+ SET_GetColorTableParameterfvSGI(table, exec_GetColorTableParameterfv);
+ SET_GetColorTableParameterivSGI(table, exec_GetColorTableParameteriv);
+#endif
+
+ /* 30. GL_EXT_vertex_array */
+ SET_ColorPointerEXT(table, exec_ColorPointerEXT);
+ SET_EdgeFlagPointerEXT(table, exec_EdgeFlagPointerEXT);
+ SET_IndexPointerEXT(table, exec_IndexPointerEXT);
+ SET_NormalPointerEXT(table, exec_NormalPointerEXT);
+ SET_TexCoordPointerEXT(table, exec_TexCoordPointerEXT);
+ SET_VertexPointerEXT(table, exec_VertexPointerEXT);
+
+ /* 37. GL_EXT_blend_minmax */
+#if 0
+ SET_BlendEquationEXT(table, save_BlendEquationEXT);
+#endif
+
+ /* 54. GL_EXT_point_parameters */
+ SET_PointParameterfEXT(table, save_PointParameterfEXT);
+ SET_PointParameterfvEXT(table, save_PointParameterfvEXT);
+
+ /* 97. GL_EXT_compiled_vertex_array */
+ SET_LockArraysEXT(table, exec_LockArraysEXT);
+ SET_UnlockArraysEXT(table, exec_UnlockArraysEXT);
+
+ /* 145. GL_EXT_secondary_color */
+ SET_SecondaryColorPointerEXT(table, exec_SecondaryColorPointerEXT);
+
+ /* 148. GL_EXT_multi_draw_arrays */
+ SET_MultiDrawArraysEXT(table, exec_MultiDrawArraysEXT);
+
+ /* 149. GL_EXT_fog_coord */
+ SET_FogCoordPointerEXT(table, exec_FogCoordPointerEXT);
+
+ /* 173. GL_EXT_blend_func_separate */
+ SET_BlendFuncSeparateEXT(table, save_BlendFuncSeparateEXT);
+
+ /* 196. GL_MESA_resize_buffers */
+ SET_ResizeBuffersMESA(table, _mesa_ResizeBuffersMESA);
+
+ /* 197. GL_MESA_window_pos */
+ SET_WindowPos2dMESA(table, save_WindowPos2dMESA);
+ SET_WindowPos2dvMESA(table, save_WindowPos2dvMESA);
+ SET_WindowPos2fMESA(table, save_WindowPos2fMESA);
+ SET_WindowPos2fvMESA(table, save_WindowPos2fvMESA);
+ SET_WindowPos2iMESA(table, save_WindowPos2iMESA);
+ SET_WindowPos2ivMESA(table, save_WindowPos2ivMESA);
+ SET_WindowPos2sMESA(table, save_WindowPos2sMESA);
+ SET_WindowPos2svMESA(table, save_WindowPos2svMESA);
+ SET_WindowPos3dMESA(table, save_WindowPos3dMESA);
+ SET_WindowPos3dvMESA(table, save_WindowPos3dvMESA);
+ SET_WindowPos3fMESA(table, save_WindowPos3fMESA);
+ SET_WindowPos3fvMESA(table, save_WindowPos3fvMESA);
+ SET_WindowPos3iMESA(table, save_WindowPos3iMESA);
+ SET_WindowPos3ivMESA(table, save_WindowPos3ivMESA);
+ SET_WindowPos3sMESA(table, save_WindowPos3sMESA);
+ SET_WindowPos3svMESA(table, save_WindowPos3svMESA);
+ SET_WindowPos4dMESA(table, save_WindowPos4dMESA);
+ SET_WindowPos4dvMESA(table, save_WindowPos4dvMESA);
+ SET_WindowPos4fMESA(table, save_WindowPos4fMESA);
+ SET_WindowPos4fvMESA(table, save_WindowPos4fvMESA);
+ SET_WindowPos4iMESA(table, save_WindowPos4iMESA);
+ SET_WindowPos4ivMESA(table, save_WindowPos4ivMESA);
+ SET_WindowPos4sMESA(table, save_WindowPos4sMESA);
+ SET_WindowPos4svMESA(table, save_WindowPos4svMESA);
+
+ /* 200. GL_IBM_multimode_draw_arrays */
+ SET_MultiModeDrawArraysIBM(table, exec_MultiModeDrawArraysIBM);
+ SET_MultiModeDrawElementsIBM(table, exec_MultiModeDrawElementsIBM);
+
+#if FEATURE_NV_vertex_program
+ /* 233. GL_NV_vertex_program */
+ /* The following commands DO NOT go into display lists:
+ * AreProgramsResidentNV, IsProgramNV, GenProgramsNV, DeleteProgramsNV,
+ * VertexAttribPointerNV, GetProgram*, GetVertexAttrib*
+ */
+ SET_BindProgramNV(table, save_BindProgramNV);
+ SET_DeleteProgramsNV(table, _mesa_DeletePrograms);
+ SET_ExecuteProgramNV(table, save_ExecuteProgramNV);
+ SET_GenProgramsNV(table, _mesa_GenPrograms);
+ SET_AreProgramsResidentNV(table, _mesa_AreProgramsResidentNV);
+ SET_RequestResidentProgramsNV(table, save_RequestResidentProgramsNV);
+ SET_GetProgramParameterfvNV(table, _mesa_GetProgramParameterfvNV);
+ SET_GetProgramParameterdvNV(table, _mesa_GetProgramParameterdvNV);
+ SET_GetProgramivNV(table, _mesa_GetProgramivNV);
+ SET_GetProgramStringNV(table, _mesa_GetProgramStringNV);
+ SET_GetTrackMatrixivNV(table, _mesa_GetTrackMatrixivNV);
+ SET_GetVertexAttribdvNV(table, _mesa_GetVertexAttribdvNV);
+ SET_GetVertexAttribfvNV(table, _mesa_GetVertexAttribfvNV);
+ SET_GetVertexAttribivNV(table, _mesa_GetVertexAttribivNV);
+ SET_GetVertexAttribPointervNV(table, _mesa_GetVertexAttribPointervNV);
+ SET_IsProgramNV(table, _mesa_IsProgramARB);
+ SET_LoadProgramNV(table, save_LoadProgramNV);
+ SET_ProgramEnvParameter4dARB(table, save_ProgramEnvParameter4dARB);
+ SET_ProgramEnvParameter4dvARB(table, save_ProgramEnvParameter4dvARB);
+ SET_ProgramEnvParameter4fARB(table, save_ProgramEnvParameter4fARB);
+ SET_ProgramEnvParameter4fvARB(table, save_ProgramEnvParameter4fvARB);
+ SET_ProgramParameters4dvNV(table, save_ProgramParameters4dvNV);
+ SET_ProgramParameters4fvNV(table, save_ProgramParameters4fvNV);
+ SET_TrackMatrixNV(table, save_TrackMatrixNV);
+ SET_VertexAttribPointerNV(table, _mesa_VertexAttribPointerNV);
+#endif
+
+ /* 244. GL_ATI_envmap_bumpmap */
+ SET_TexBumpParameterivATI(table, save_TexBumpParameterivATI);
+ SET_TexBumpParameterfvATI(table, save_TexBumpParameterfvATI);
+
+ /* 245. GL_ATI_fragment_shader */
+#if FEATURE_ATI_fragment_shader
+ SET_BindFragmentShaderATI(table, save_BindFragmentShaderATI);
+ SET_SetFragmentShaderConstantATI(table, save_SetFragmentShaderConstantATI);
+#endif
+
+ /* 282. GL_NV_fragment_program */
+#if FEATURE_NV_fragment_program
+ SET_ProgramNamedParameter4fNV(table, save_ProgramNamedParameter4fNV);
+ SET_ProgramNamedParameter4dNV(table, save_ProgramNamedParameter4dNV);
+ SET_ProgramNamedParameter4fvNV(table, save_ProgramNamedParameter4fvNV);
+ SET_ProgramNamedParameter4dvNV(table, save_ProgramNamedParameter4dvNV);
+ SET_GetProgramNamedParameterfvNV(table,
+ _mesa_GetProgramNamedParameterfvNV);
+ SET_GetProgramNamedParameterdvNV(table,
+ _mesa_GetProgramNamedParameterdvNV);
+ SET_ProgramLocalParameter4dARB(table, save_ProgramLocalParameter4dARB);
+ SET_ProgramLocalParameter4dvARB(table, save_ProgramLocalParameter4dvARB);
+ SET_ProgramLocalParameter4fARB(table, save_ProgramLocalParameter4fARB);
+ SET_ProgramLocalParameter4fvARB(table, save_ProgramLocalParameter4fvARB);
+ SET_GetProgramLocalParameterdvARB(table,
+ _mesa_GetProgramLocalParameterdvARB);
+ SET_GetProgramLocalParameterfvARB(table,
+ _mesa_GetProgramLocalParameterfvARB);
+#endif
+
+ /* 262. GL_NV_point_sprite */
+ SET_PointParameteriNV(table, save_PointParameteriNV);
+ SET_PointParameterivNV(table, save_PointParameterivNV);
+
+ /* 268. GL_EXT_stencil_two_side */
+ SET_ActiveStencilFaceEXT(table, save_ActiveStencilFaceEXT);
+
+ /* 273. GL_APPLE_vertex_array_object */
+ SET_BindVertexArrayAPPLE(table, _mesa_BindVertexArrayAPPLE);
+ SET_DeleteVertexArraysAPPLE(table, _mesa_DeleteVertexArraysAPPLE);
+ SET_GenVertexArraysAPPLE(table, _mesa_GenVertexArraysAPPLE);
+ SET_IsVertexArrayAPPLE(table, _mesa_IsVertexArrayAPPLE);
+
+ /* ???. GL_EXT_depth_bounds_test */
+ SET_DepthBoundsEXT(table, save_DepthBoundsEXT);
+
+ /* ARB 1. GL_ARB_multitexture */
+ SET_ActiveTextureARB(table, save_ActiveTextureARB);
+ SET_ClientActiveTextureARB(table, exec_ClientActiveTextureARB);
+
+ /* ARB 3. GL_ARB_transpose_matrix */
+ SET_LoadTransposeMatrixdARB(table, save_LoadTransposeMatrixdARB);
+ SET_LoadTransposeMatrixfARB(table, save_LoadTransposeMatrixfARB);
+ SET_MultTransposeMatrixdARB(table, save_MultTransposeMatrixdARB);
+ SET_MultTransposeMatrixfARB(table, save_MultTransposeMatrixfARB);
+
+ /* ARB 5. GL_ARB_multisample */
+ SET_SampleCoverageARB(table, save_SampleCoverageARB);
+
+ /* ARB 12. GL_ARB_texture_compression */
+ SET_CompressedTexImage3DARB(table, save_CompressedTexImage3DARB);
+ SET_CompressedTexImage2DARB(table, save_CompressedTexImage2DARB);
+ SET_CompressedTexImage1DARB(table, save_CompressedTexImage1DARB);
+ SET_CompressedTexSubImage3DARB(table, save_CompressedTexSubImage3DARB);
+ SET_CompressedTexSubImage2DARB(table, save_CompressedTexSubImage2DARB);
+ SET_CompressedTexSubImage1DARB(table, save_CompressedTexSubImage1DARB);
+ SET_GetCompressedTexImageARB(table, exec_GetCompressedTexImageARB);
+
+ /* ARB 14. GL_ARB_point_parameters */
+ /* aliased with EXT_point_parameters functions */
+
+ /* ARB 25. GL_ARB_window_pos */
+ /* aliased with MESA_window_pos functions */
+
+ /* ARB 26. GL_ARB_vertex_program */
+ /* ARB 27. GL_ARB_fragment_program */
+#if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
+ /* glVertexAttrib* functions alias the NV ones, handled elsewhere */
+ SET_VertexAttribPointerARB(table, _mesa_VertexAttribPointerARB);
+ SET_EnableVertexAttribArrayARB(table, _mesa_EnableVertexAttribArrayARB);
+ SET_DisableVertexAttribArrayARB(table, _mesa_DisableVertexAttribArrayARB);
+ SET_ProgramStringARB(table, save_ProgramStringARB);
+ SET_BindProgramNV(table, save_BindProgramNV);
+ SET_DeleteProgramsNV(table, _mesa_DeletePrograms);
+ SET_GenProgramsNV(table, _mesa_GenPrograms);
+ SET_IsProgramNV(table, _mesa_IsProgramARB);
+ SET_GetVertexAttribdvARB(table, _mesa_GetVertexAttribdvARB);
+ SET_GetVertexAttribfvARB(table, _mesa_GetVertexAttribfvARB);
+ SET_GetVertexAttribivARB(table, _mesa_GetVertexAttribivARB);
+ SET_GetVertexAttribPointervNV(table, _mesa_GetVertexAttribPointervNV);
+ SET_ProgramEnvParameter4dARB(table, save_ProgramEnvParameter4dARB);
+ SET_ProgramEnvParameter4dvARB(table, save_ProgramEnvParameter4dvARB);
+ SET_ProgramEnvParameter4fARB(table, save_ProgramEnvParameter4fARB);
+ SET_ProgramEnvParameter4fvARB(table, save_ProgramEnvParameter4fvARB);
+ SET_ProgramLocalParameter4dARB(table, save_ProgramLocalParameter4dARB);
+ SET_ProgramLocalParameter4dvARB(table, save_ProgramLocalParameter4dvARB);
+ SET_ProgramLocalParameter4fARB(table, save_ProgramLocalParameter4fARB);
+ SET_ProgramLocalParameter4fvARB(table, save_ProgramLocalParameter4fvARB);
+ SET_GetProgramEnvParameterdvARB(table, _mesa_GetProgramEnvParameterdvARB);
+ SET_GetProgramEnvParameterfvARB(table, _mesa_GetProgramEnvParameterfvARB);
+ SET_GetProgramLocalParameterdvARB(table,
+ _mesa_GetProgramLocalParameterdvARB);
+ SET_GetProgramLocalParameterfvARB(table,
+ _mesa_GetProgramLocalParameterfvARB);
+ SET_GetProgramivARB(table, _mesa_GetProgramivARB);
+ SET_GetProgramStringARB(table, _mesa_GetProgramStringARB);
+#endif
+
+ /* ARB 28. GL_ARB_vertex_buffer_object */
+#if FEATURE_ARB_vertex_buffer_object
+ /* None of the extension's functions get compiled */
+ SET_BindBufferARB(table, _mesa_BindBufferARB);
+ SET_BufferDataARB(table, _mesa_BufferDataARB);
+ SET_BufferSubDataARB(table, _mesa_BufferSubDataARB);
+ SET_DeleteBuffersARB(table, _mesa_DeleteBuffersARB);
+ SET_GenBuffersARB(table, _mesa_GenBuffersARB);
+ SET_GetBufferParameterivARB(table, _mesa_GetBufferParameterivARB);
+ SET_GetBufferPointervARB(table, _mesa_GetBufferPointervARB);
+ SET_GetBufferSubDataARB(table, _mesa_GetBufferSubDataARB);
+ SET_IsBufferARB(table, _mesa_IsBufferARB);
+ SET_MapBufferARB(table, _mesa_MapBufferARB);
+ SET_UnmapBufferARB(table, _mesa_UnmapBufferARB);
+#endif
+
+#if FEATURE_queryobj
+ SET_BeginQueryARB(table, save_BeginQueryARB);
+ SET_EndQueryARB(table, save_EndQueryARB);
+ SET_GenQueriesARB(table, _mesa_GenQueriesARB);
+ SET_DeleteQueriesARB(table, _mesa_DeleteQueriesARB);
+ SET_IsQueryARB(table, _mesa_IsQueryARB);
+ SET_GetQueryivARB(table, _mesa_GetQueryivARB);
+ SET_GetQueryObjectivARB(table, _mesa_GetQueryObjectivARB);
+ SET_GetQueryObjectuivARB(table, _mesa_GetQueryObjectuivARB);
+#endif
+ SET_DrawBuffersARB(table, save_DrawBuffersARB);
+
+#if FEATURE_EXT_framebuffer_blit
+ SET_BlitFramebufferEXT(table, save_BlitFramebufferEXT);
+#endif
+
+ /* GL_ARB_shader_objects */
+ SET_UseProgramObjectARB(table, save_UseProgramObjectARB);
+ SET_Uniform1fARB(table, save_Uniform1fARB);
+ SET_Uniform2fARB(table, save_Uniform2fARB);
+ SET_Uniform3fARB(table, save_Uniform3fARB);
+ SET_Uniform4fARB(table, save_Uniform4fARB);
+ SET_Uniform1fvARB(table, save_Uniform1fvARB);
+ SET_Uniform2fvARB(table, save_Uniform2fvARB);
+ SET_Uniform3fvARB(table, save_Uniform3fvARB);
+ SET_Uniform4fvARB(table, save_Uniform4fvARB);
+ SET_Uniform1iARB(table, save_Uniform1iARB);
+ SET_Uniform2iARB(table, save_Uniform2iARB);
+ SET_Uniform3iARB(table, save_Uniform3iARB);
+ SET_Uniform4iARB(table, save_Uniform4iARB);
+ SET_Uniform1ivARB(table, save_Uniform1ivARB);
+ SET_Uniform2ivARB(table, save_Uniform2ivARB);
+ SET_Uniform3ivARB(table, save_Uniform3ivARB);
+ SET_Uniform4ivARB(table, save_Uniform4ivARB);
+ SET_UniformMatrix2fvARB(table, save_UniformMatrix2fvARB);
+ SET_UniformMatrix3fvARB(table, save_UniformMatrix3fvARB);
+ SET_UniformMatrix4fvARB(table, save_UniformMatrix4fvARB);
+ SET_UniformMatrix2x3fv(table, save_UniformMatrix2x3fv);
+ SET_UniformMatrix3x2fv(table, save_UniformMatrix3x2fv);
+ SET_UniformMatrix2x4fv(table, save_UniformMatrix2x4fv);
+ SET_UniformMatrix4x2fv(table, save_UniformMatrix4x2fv);
+ SET_UniformMatrix3x4fv(table, save_UniformMatrix3x4fv);
+ SET_UniformMatrix4x3fv(table, save_UniformMatrix4x3fv);
+
+ /* ARB 30/31/32. GL_ARB_shader_objects, GL_ARB_vertex/fragment_shader */
+ SET_BindAttribLocationARB(table, exec_BindAttribLocationARB);
+ SET_GetAttribLocationARB(table, exec_GetAttribLocationARB);
+ SET_GetUniformLocationARB(table, exec_GetUniformLocationARB);
+ /* XXX additional functions need to be implemented here! */
+
+ /* 299. GL_EXT_blend_equation_separate */
+ SET_BlendEquationSeparateEXT(table, save_BlendEquationSeparateEXT);
+
+ /* GL_EXT_gpu_program_parameters */
+#if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
+ SET_ProgramEnvParameters4fvEXT(table, save_ProgramEnvParameters4fvEXT);
+ SET_ProgramLocalParameters4fvEXT(table, save_ProgramLocalParameters4fvEXT);
+#endif
+
+ /* ARB 50. GL_ARB_map_buffer_range */
+#if FEATURE_ARB_map_buffer_range
+ SET_MapBufferRange(table, _mesa_MapBufferRange); /* no dlist save */
+ SET_FlushMappedBufferRange(table, _mesa_FlushMappedBufferRange); /* no dl */
+#endif
+
+ /* ARB 59. GL_ARB_copy_buffer */
+ SET_CopyBufferSubData(table, _mesa_CopyBufferSubData); /* no dlist save */
+
+ /* 352. GL_EXT_transform_feedback */
+#if FEATURE_EXT_transform_feedback
+ SET_BeginTransformFeedbackEXT(table, save_BeginTransformFeedback);
+ SET_EndTransformFeedbackEXT(table, save_EndTransformFeedback);
+#endif
+
+ /* 364. GL_EXT_provoking_vertex */
+ SET_ProvokingVertexEXT(table, save_ProvokingVertexEXT);
+
+ /* 371. GL_APPLE_object_purgeable */
+#if FEATURE_APPLE_object_purgeable
+ SET_ObjectPurgeableAPPLE(table, _mesa_ObjectPurgeableAPPLE);
+ SET_ObjectUnpurgeableAPPLE(table, _mesa_ObjectUnpurgeableAPPLE);
+#endif
+
+ /* GL_EXT_texture_integer */
+ SET_ClearColorIiEXT(table, save_ClearColorIi);
+ SET_ClearColorIuiEXT(table, save_ClearColorIui);
+ SET_TexParameterIivEXT(table, save_TexParameterIiv);
+ SET_TexParameterIuivEXT(table, save_TexParameterIuiv);
+ SET_GetTexParameterIivEXT(table, exec_GetTexParameterIiv);
+ SET_GetTexParameterIuivEXT(table, exec_GetTexParameterIuiv);
+
+ /* 377. GL_EXT_separate_shader_objects */
+ SET_UseShaderProgramEXT(table, save_UseShaderProgramEXT);
+ SET_ActiveProgramEXT(table, save_ActiveProgramEXT);
+
+ /* GL_ARB_color_buffer_float */
+ SET_ClampColorARB(table, save_ClampColorARB);
+ SET_ClampColor(table, save_ClampColorARB);
+
+ /* GL 3.0 */
+#if 0
+ SET_ClearBufferiv(table, save_ClearBufferiv);
+ SET_ClearBufferuiv(table, save_ClearBufferuiv);
+ SET_ClearBufferfv(table, save_ClearBufferfv);
+ SET_ClearBufferfi(table, save_ClearBufferfi);
+ SET_Uniform1ui(table, save_Uniform1ui);
+ SET_Uniform2ui(table, save_Uniform2ui);
+ SET_Uniform3ui(table, save_Uniform3ui);
+ SET_Uniform4ui(table, save_Uniform4ui);
+ SET_Uniform1uiv(table, save_Uniform1uiv);
+ SET_Uniform2uiv(table, save_Uniform2uiv);
+ SET_Uniform3uiv(table, save_Uniform3uiv);
+ SET_Uniform4uiv(table, save_Uniform4uiv);
+#else
+ (void) save_ClearBufferiv;
+ (void) save_ClearBufferuiv;
+ (void) save_ClearBufferfv;
+ (void) save_ClearBufferfi;
+ (void) save_Uniform1ui;
+ (void) save_Uniform2ui;
+ (void) save_Uniform3ui;
+ (void) save_Uniform4ui;
+ (void) save_Uniform1uiv;
+ (void) save_Uniform2uiv;
+ (void) save_Uniform3uiv;
+ (void) save_Uniform4uiv;
+#endif
+
+ /* GL_ARB_instanced_arrays */
+ SET_VertexAttribDivisorARB(table, save_VertexAttribDivisor);
+
+ /* GL_NV_texture_barrier */
+ SET_TextureBarrierNV(table, save_TextureBarrierNV);
+
+ /* GL_ARB_sampler_objects */
+ SET_BindSampler(table, save_BindSampler);
+
+ /* GL_ARB_draw_buffer_blend */
+ SET_BlendFunciARB(table, save_BlendFunci);
+ SET_BlendFuncSeparateiARB(table, save_BlendFuncSeparatei);
+ SET_BlendEquationiARB(table, save_BlendEquationi);
+ SET_BlendEquationSeparateiARB(table, save_BlendEquationSeparatei);
+
+ return table;
+}
+
+
+
+static const char *
+enum_string(GLenum k)
+{
+ return _mesa_lookup_enum_by_nr(k);
+}
+
+
+/**
+ * Print the commands in a display list. For debugging only.
+ * TODO: many commands aren't handled yet.
+ */
+static void GLAPIENTRY
+print_list(struct gl_context *ctx, GLuint list)
+{
+ struct gl_display_list *dlist;
+ Node *n;
+ GLboolean done;
+
+ if (!islist(ctx, list)) {
+ printf("%u is not a display list ID\n", list);
+ return;
+ }
+
+ dlist = lookup_list(ctx, list);
+ if (!dlist)
+ return;
+
+ n = dlist->Head;
+
+ printf("START-LIST %u, address %p\n", list, (void *) n);
+
+ done = n ? GL_FALSE : GL_TRUE;
+ while (!done) {
+ const OpCode opcode = n[0].opcode;
+
+ if (is_ext_opcode(opcode)) {
+ n += ext_opcode_print(ctx, n);
+ }
+ else {
+ switch (opcode) {
+ case OPCODE_ACCUM:
+ printf("Accum %s %g\n", enum_string(n[1].e), n[2].f);
+ break;
+ case OPCODE_BITMAP:
+ printf("Bitmap %d %d %g %g %g %g %p\n", n[1].i, n[2].i,
+ n[3].f, n[4].f, n[5].f, n[6].f, (void *) n[7].data);
+ break;
+ case OPCODE_CALL_LIST:
+ printf("CallList %d\n", (int) n[1].ui);
+ break;
+ case OPCODE_CALL_LIST_OFFSET:
+ printf("CallList %d + offset %u = %u\n", (int) n[1].ui,
+ ctx->List.ListBase, ctx->List.ListBase + n[1].ui);
+ break;
+ case OPCODE_COLOR_TABLE_PARAMETER_FV:
+ printf("ColorTableParameterfv %s %s %f %f %f %f\n",
+ enum_string(n[1].e), enum_string(n[2].e),
+ n[3].f, n[4].f, n[5].f, n[6].f);
+ break;
+ case OPCODE_COLOR_TABLE_PARAMETER_IV:
+ printf("ColorTableParameteriv %s %s %d %d %d %d\n",
+ enum_string(n[1].e), enum_string(n[2].e),
+ n[3].i, n[4].i, n[5].i, n[6].i);
+ break;
+ case OPCODE_DISABLE:
+ printf("Disable %s\n", enum_string(n[1].e));
+ break;
+ case OPCODE_ENABLE:
+ printf("Enable %s\n", enum_string(n[1].e));
+ break;
+ case OPCODE_FRUSTUM:
+ printf("Frustum %g %g %g %g %g %g\n",
+ n[1].f, n[2].f, n[3].f, n[4].f, n[5].f, n[6].f);
+ break;
+ case OPCODE_LINE_STIPPLE:
+ printf("LineStipple %d %x\n", n[1].i, (int) n[2].us);
+ break;
+ case OPCODE_LOAD_IDENTITY:
+ printf("LoadIdentity\n");
+ break;
+ case OPCODE_LOAD_MATRIX:
+ printf("LoadMatrix\n");
+ printf(" %8f %8f %8f %8f\n",
+ n[1].f, n[5].f, n[9].f, n[13].f);
+ printf(" %8f %8f %8f %8f\n",
+ n[2].f, n[6].f, n[10].f, n[14].f);
+ printf(" %8f %8f %8f %8f\n",
+ n[3].f, n[7].f, n[11].f, n[15].f);
+ printf(" %8f %8f %8f %8f\n",
+ n[4].f, n[8].f, n[12].f, n[16].f);
+ break;
+ case OPCODE_MULT_MATRIX:
+ printf("MultMatrix (or Rotate)\n");
+ printf(" %8f %8f %8f %8f\n",
+ n[1].f, n[5].f, n[9].f, n[13].f);
+ printf(" %8f %8f %8f %8f\n",
+ n[2].f, n[6].f, n[10].f, n[14].f);
+ printf(" %8f %8f %8f %8f\n",
+ n[3].f, n[7].f, n[11].f, n[15].f);
+ printf(" %8f %8f %8f %8f\n",
+ n[4].f, n[8].f, n[12].f, n[16].f);
+ break;
+ case OPCODE_ORTHO:
+ printf("Ortho %g %g %g %g %g %g\n",
+ n[1].f, n[2].f, n[3].f, n[4].f, n[5].f, n[6].f);
+ break;
+ case OPCODE_POP_ATTRIB:
+ printf("PopAttrib\n");
+ break;
+ case OPCODE_POP_MATRIX:
+ printf("PopMatrix\n");
+ break;
+ case OPCODE_POP_NAME:
+ printf("PopName\n");
+ break;
+ case OPCODE_PUSH_ATTRIB:
+ printf("PushAttrib %x\n", n[1].bf);
+ break;
+ case OPCODE_PUSH_MATRIX:
+ printf("PushMatrix\n");
+ break;
+ case OPCODE_PUSH_NAME:
+ printf("PushName %d\n", (int) n[1].ui);
+ break;
+ case OPCODE_RASTER_POS:
+ printf("RasterPos %g %g %g %g\n",
+ n[1].f, n[2].f, n[3].f, n[4].f);
+ break;
+ case OPCODE_ROTATE:
+ printf("Rotate %g %g %g %g\n",
+ n[1].f, n[2].f, n[3].f, n[4].f);
+ break;
+ case OPCODE_SCALE:
+ printf("Scale %g %g %g\n", n[1].f, n[2].f, n[3].f);
+ break;
+ case OPCODE_TRANSLATE:
+ printf("Translate %g %g %g\n", n[1].f, n[2].f, n[3].f);
+ break;
+ case OPCODE_BIND_TEXTURE:
+ printf("BindTexture %s %d\n",
+ _mesa_lookup_enum_by_nr(n[1].ui), n[2].ui);
+ break;
+ case OPCODE_SHADE_MODEL:
+ printf("ShadeModel %s\n", _mesa_lookup_enum_by_nr(n[1].ui));
+ break;
+ case OPCODE_MAP1:
+ printf("Map1 %s %.3f %.3f %d %d\n",
+ _mesa_lookup_enum_by_nr(n[1].ui),
+ n[2].f, n[3].f, n[4].i, n[5].i);
+ break;
+ case OPCODE_MAP2:
+ printf("Map2 %s %.3f %.3f %.3f %.3f %d %d %d %d\n",
+ _mesa_lookup_enum_by_nr(n[1].ui),
+ n[2].f, n[3].f, n[4].f, n[5].f,
+ n[6].i, n[7].i, n[8].i, n[9].i);
+ break;
+ case OPCODE_MAPGRID1:
+ printf("MapGrid1 %d %.3f %.3f\n", n[1].i, n[2].f, n[3].f);
+ break;
+ case OPCODE_MAPGRID2:
+ printf("MapGrid2 %d %.3f %.3f, %d %.3f %.3f\n",
+ n[1].i, n[2].f, n[3].f, n[4].i, n[5].f, n[6].f);
+ break;
+ case OPCODE_EVALMESH1:
+ printf("EvalMesh1 %d %d\n", n[1].i, n[2].i);
+ break;
+ case OPCODE_EVALMESH2:
+ printf("EvalMesh2 %d %d %d %d\n",
+ n[1].i, n[2].i, n[3].i, n[4].i);
+ break;
+
+ case OPCODE_ATTR_1F_NV:
+ printf("ATTR_1F_NV attr %d: %f\n", n[1].i, n[2].f);
+ break;
+ case OPCODE_ATTR_2F_NV:
+ printf("ATTR_2F_NV attr %d: %f %f\n",
+ n[1].i, n[2].f, n[3].f);
+ break;
+ case OPCODE_ATTR_3F_NV:
+ printf("ATTR_3F_NV attr %d: %f %f %f\n",
+ n[1].i, n[2].f, n[3].f, n[4].f);
+ break;
+ case OPCODE_ATTR_4F_NV:
+ printf("ATTR_4F_NV attr %d: %f %f %f %f\n",
+ n[1].i, n[2].f, n[3].f, n[4].f, n[5].f);
+ break;
+ case OPCODE_ATTR_1F_ARB:
+ printf("ATTR_1F_ARB attr %d: %f\n", n[1].i, n[2].f);
+ break;
+ case OPCODE_ATTR_2F_ARB:
+ printf("ATTR_2F_ARB attr %d: %f %f\n",
+ n[1].i, n[2].f, n[3].f);
+ break;
+ case OPCODE_ATTR_3F_ARB:
+ printf("ATTR_3F_ARB attr %d: %f %f %f\n",
+ n[1].i, n[2].f, n[3].f, n[4].f);
+ break;
+ case OPCODE_ATTR_4F_ARB:
+ printf("ATTR_4F_ARB attr %d: %f %f %f %f\n",
+ n[1].i, n[2].f, n[3].f, n[4].f, n[5].f);
+ break;
+
+ case OPCODE_MATERIAL:
+ printf("MATERIAL %x %x: %f %f %f %f\n",
+ n[1].i, n[2].i, n[3].f, n[4].f, n[5].f, n[6].f);
+ break;
+ case OPCODE_BEGIN:
+ printf("BEGIN %x\n", n[1].i);
+ break;
+ case OPCODE_END:
+ printf("END\n");
+ break;
+ case OPCODE_RECTF:
+ printf("RECTF %f %f %f %f\n", n[1].f, n[2].f, n[3].f,
+ n[4].f);
+ break;
+ case OPCODE_EVAL_C1:
+ printf("EVAL_C1 %f\n", n[1].f);
+ break;
+ case OPCODE_EVAL_C2:
+ printf("EVAL_C2 %f %f\n", n[1].f, n[2].f);
+ break;
+ case OPCODE_EVAL_P1:
+ printf("EVAL_P1 %d\n", n[1].i);
+ break;
+ case OPCODE_EVAL_P2:
+ printf("EVAL_P2 %d %d\n", n[1].i, n[2].i);
+ break;
+
+ case OPCODE_PROVOKING_VERTEX:
+ printf("ProvokingVertex %s\n",
+ _mesa_lookup_enum_by_nr(n[1].ui));
+ break;
+
+ /*
+ * meta opcodes/commands
+ */
+ case OPCODE_ERROR:
+ printf("Error: %s %s\n",
+ enum_string(n[1].e), (const char *) n[2].data);
+ break;
+ case OPCODE_CONTINUE:
+ printf("DISPLAY-LIST-CONTINUE\n");
+ n = (Node *) n[1].next;
+ break;
+ case OPCODE_END_OF_LIST:
+ printf("END-LIST %u\n", list);
+ done = GL_TRUE;
+ break;
+ default:
+ if (opcode < 0 || opcode > OPCODE_END_OF_LIST) {
+ printf
+ ("ERROR IN DISPLAY LIST: opcode = %d, address = %p\n",
+ opcode, (void *) n);
+ return;
+ }
+ else {
+ printf("command %d, %u operands\n", opcode,
+ InstSize[opcode]);
+ }
+ }
+ /* increment n to point to next compiled command */
+ if (opcode != OPCODE_CONTINUE) {
+ n += InstSize[opcode];
+ }
+ }
+ }
+}
+
+
+
+/**
+ * Clients may call this function to help debug display list problems.
+ * This function is _ONLY_FOR_DEBUGGING_PURPOSES_. It may be removed,
+ * changed, or break in the future without notice.
+ */
+void
+mesa_print_display_list(GLuint list)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ print_list(ctx, list);
+}
+
+
+/**********************************************************************/
+/***** Initialization *****/
+/**********************************************************************/
+
+void
+_mesa_save_vtxfmt_init(GLvertexformat * vfmt)
+{
+ _MESA_INIT_ARRAYELT_VTXFMT(vfmt, _ae_);
+
+ vfmt->Begin = save_Begin;
+
+ _MESA_INIT_DLIST_VTXFMT(vfmt, save_);
+
+ vfmt->Color3f = save_Color3f;
+ vfmt->Color3fv = save_Color3fv;
+ vfmt->Color4f = save_Color4f;
+ vfmt->Color4fv = save_Color4fv;
+ vfmt->EdgeFlag = save_EdgeFlag;
+ vfmt->End = save_End;
+
+ _MESA_INIT_EVAL_VTXFMT(vfmt, save_);
+
+ vfmt->FogCoordfEXT = save_FogCoordfEXT;
+ vfmt->FogCoordfvEXT = save_FogCoordfvEXT;
+ vfmt->Indexf = save_Indexf;
+ vfmt->Indexfv = save_Indexfv;
+ vfmt->Materialfv = save_Materialfv;
+ vfmt->MultiTexCoord1fARB = save_MultiTexCoord1f;
+ vfmt->MultiTexCoord1fvARB = save_MultiTexCoord1fv;
+ vfmt->MultiTexCoord2fARB = save_MultiTexCoord2f;
+ vfmt->MultiTexCoord2fvARB = save_MultiTexCoord2fv;
+ vfmt->MultiTexCoord3fARB = save_MultiTexCoord3f;
+ vfmt->MultiTexCoord3fvARB = save_MultiTexCoord3fv;
+ vfmt->MultiTexCoord4fARB = save_MultiTexCoord4f;
+ vfmt->MultiTexCoord4fvARB = save_MultiTexCoord4fv;
+ vfmt->Normal3f = save_Normal3f;
+ vfmt->Normal3fv = save_Normal3fv;
+ vfmt->SecondaryColor3fEXT = save_SecondaryColor3fEXT;
+ vfmt->SecondaryColor3fvEXT = save_SecondaryColor3fvEXT;
+ vfmt->TexCoord1f = save_TexCoord1f;
+ vfmt->TexCoord1fv = save_TexCoord1fv;
+ vfmt->TexCoord2f = save_TexCoord2f;
+ vfmt->TexCoord2fv = save_TexCoord2fv;
+ vfmt->TexCoord3f = save_TexCoord3f;
+ vfmt->TexCoord3fv = save_TexCoord3fv;
+ vfmt->TexCoord4f = save_TexCoord4f;
+ vfmt->TexCoord4fv = save_TexCoord4fv;
+ vfmt->Vertex2f = save_Vertex2f;
+ vfmt->Vertex2fv = save_Vertex2fv;
+ vfmt->Vertex3f = save_Vertex3f;
+ vfmt->Vertex3fv = save_Vertex3fv;
+ vfmt->Vertex4f = save_Vertex4f;
+ vfmt->Vertex4fv = save_Vertex4fv;
+ vfmt->VertexAttrib1fNV = save_VertexAttrib1fNV;
+ vfmt->VertexAttrib1fvNV = save_VertexAttrib1fvNV;
+ vfmt->VertexAttrib2fNV = save_VertexAttrib2fNV;
+ vfmt->VertexAttrib2fvNV = save_VertexAttrib2fvNV;
+ vfmt->VertexAttrib3fNV = save_VertexAttrib3fNV;
+ vfmt->VertexAttrib3fvNV = save_VertexAttrib3fvNV;
+ vfmt->VertexAttrib4fNV = save_VertexAttrib4fNV;
+ vfmt->VertexAttrib4fvNV = save_VertexAttrib4fvNV;
+ vfmt->VertexAttrib1fARB = save_VertexAttrib1fARB;
+ vfmt->VertexAttrib1fvARB = save_VertexAttrib1fvARB;
+ vfmt->VertexAttrib2fARB = save_VertexAttrib2fARB;
+ vfmt->VertexAttrib2fvARB = save_VertexAttrib2fvARB;
+ vfmt->VertexAttrib3fARB = save_VertexAttrib3fARB;
+ vfmt->VertexAttrib3fvARB = save_VertexAttrib3fvARB;
+ vfmt->VertexAttrib4fARB = save_VertexAttrib4fARB;
+ vfmt->VertexAttrib4fvARB = save_VertexAttrib4fvARB;
+
+ vfmt->Rectf = save_Rectf;
+
+ /* The driver is required to implement these as
+ * 1) They can probably do a better job.
+ * 2) A lot of new mechanisms would have to be added to this module
+ * to support it. That code would probably never get used,
+ * because of (1).
+ */
+#if 0
+ vfmt->DrawArrays = 0;
+ vfmt->DrawElements = 0;
+ vfmt->DrawRangeElements = 0;
+ vfmt->MultiDrawElemementsEXT = 0;
+ vfmt->DrawElementsBaseVertex = 0;
+ vfmt->DrawRangeElementsBaseVertex = 0;
+ vfmt->MultiDrawElemementsBaseVertex = 0;
+#endif
+}
+
+
+void
+_mesa_install_dlist_vtxfmt(struct _glapi_table *disp,
+ const GLvertexformat *vfmt)
+{
+ SET_CallList(disp, vfmt->CallList);
+ SET_CallLists(disp, vfmt->CallLists);
+}
+
+
+void _mesa_init_dlist_dispatch(struct _glapi_table *disp)
+{
+ SET_CallList(disp, _mesa_CallList);
+ SET_CallLists(disp, _mesa_CallLists);
+
+ SET_DeleteLists(disp, _mesa_DeleteLists);
+ SET_EndList(disp, _mesa_EndList);
+ SET_GenLists(disp, _mesa_GenLists);
+ SET_IsList(disp, _mesa_IsList);
+ SET_ListBase(disp, _mesa_ListBase);
+ SET_NewList(disp, _mesa_NewList);
+}
+
+
+#endif /* FEATURE_dlist */
+
+
+/**
+ * Initialize display list state for given context.
+ */
+void
+_mesa_init_display_list(struct gl_context *ctx)
+{
+ static GLboolean tableInitialized = GL_FALSE;
+
+ /* zero-out the instruction size table, just once */
+ if (!tableInitialized) {
+ memset(InstSize, 0, sizeof(InstSize));
+ tableInitialized = GL_TRUE;
+ }
+
+ /* extension info */
+ ctx->ListExt = CALLOC_STRUCT(gl_list_extensions);
+
+ /* Display list */
+ ctx->ListState.CallDepth = 0;
+ ctx->ExecuteFlag = GL_TRUE;
+ ctx->CompileFlag = GL_FALSE;
+ ctx->ListState.CurrentBlock = NULL;
+ ctx->ListState.CurrentPos = 0;
+
+ /* Display List group */
+ ctx->List.ListBase = 0;
+
+#if FEATURE_dlist
+ _mesa_save_vtxfmt_init(&ctx->ListState.ListVtxfmt);
+#endif
+}
+
+
+void
+_mesa_free_display_list_data(struct gl_context *ctx)
+{
+ free(ctx->ListExt);
+ ctx->ListExt = NULL;
+}
diff --git a/mesalib/src/mesa/main/dlopen.c b/mesalib/src/mesa/main/dlopen.c
index 57a33292e..62d9023a9 100644
--- a/mesalib/src/mesa/main/dlopen.c
+++ b/mesalib/src/mesa/main/dlopen.c
@@ -51,7 +51,7 @@ _mesa_dlopen(const char *libname, int flags)
#elif defined(_GNU_SOURCE)
flags = RTLD_LAZY | RTLD_GLOBAL; /* Overriding flags at this time */
return dlopen(libname, flags);
-#elif defined(__MINGW32__)
+#elif defined(__MINGW32__) | defined(_MSC_VER)
return LoadLibraryA(libname);
#else
return NULL;
@@ -82,7 +82,7 @@ _mesa_dlsym(void *handle, const char *fname)
u.v = dlsym(handle, fname2);
#elif defined(_GNU_SOURCE)
u.v = dlsym(handle, fname);
-#elif defined(__MINGW32__)
+#elif defined(__MINGW32__) | defined(_MSC_VER)
u.v = (void *) GetProcAddress(handle, fname);
#else
u.v = NULL;
@@ -101,7 +101,7 @@ _mesa_dlclose(void *handle)
(void) handle;
#elif defined(_GNU_SOURCE)
dlclose(handle);
-#elif defined(__MINGW32__)
+#elif defined(__MINGW32__) | defined(_MSC_VER)
FreeLibrary(handle);
#else
(void) handle;
diff --git a/mesalib/src/mesa/main/drawpix.c b/mesalib/src/mesa/main/drawpix.c
index 89c2b2697..cf54febe0 100644
--- a/mesalib/src/mesa/main/drawpix.c
+++ b/mesalib/src/mesa/main/drawpix.c
@@ -1,302 +1,302 @@
-/*
- * Mesa 3-D graphics library
- * Version: 7.1
- *
- * Copyright (C) 1999-2008 Brian Paul All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-#include "glheader.h"
-#include "imports.h"
-#include "bufferobj.h"
-#include "context.h"
-#include "drawpix.h"
-#include "enums.h"
-#include "feedback.h"
-#include "framebuffer.h"
-#include "mfeatures.h"
-#include "pbo.h"
-#include "readpix.h"
-#include "state.h"
-#include "dispatch.h"
-
-
-#if FEATURE_drawpix
-
-
-/*
- * Execute glDrawPixels
- */
-static void GLAPIENTRY
-_mesa_DrawPixels( GLsizei width, GLsizei height,
- GLenum format, GLenum type, const GLvoid *pixels )
-{
- GET_CURRENT_CONTEXT(ctx);
- ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
-
- if (MESA_VERBOSE & VERBOSE_API)
- _mesa_debug(ctx, "glDrawPixels(%d, %d, %s, %s, %p) // to %s at %d, %d\n",
- width, height,
- _mesa_lookup_enum_by_nr(format),
- _mesa_lookup_enum_by_nr(type),
- pixels,
- _mesa_lookup_enum_by_nr(ctx->DrawBuffer->ColorDrawBuffer[0]),
- IROUND(ctx->Current.RasterPos[0]),
- IROUND(ctx->Current.RasterPos[1]));
-
-
- if (width < 0 || height < 0) {
- _mesa_error( ctx, GL_INVALID_VALUE, "glDrawPixels(width or height < 0" );
- return;
- }
-
- /* We're not using the current vertex program, and the driver may install
- * its own. Note: this may dirty some state.
- */
- _mesa_set_vp_override(ctx, GL_TRUE);
-
- /* Note: this call does state validation */
- if (!_mesa_valid_to_render(ctx, "glDrawPixels")) {
- goto end; /* the error code was recorded */
- }
-
- if (_mesa_error_check_format_type(ctx, format, type, GL_TRUE)) {
- goto end; /* the error code was recorded */
- }
-
- if (!ctx->Current.RasterPosValid) {
- goto end; /* no-op, not an error */
- }
-
- if (ctx->RenderMode == GL_RENDER) {
- if (width > 0 && height > 0) {
- /* Round, to satisfy conformance tests (matches SGI's OpenGL) */
- GLint x = IROUND(ctx->Current.RasterPos[0]);
- GLint y = IROUND(ctx->Current.RasterPos[1]);
-
- if (_mesa_is_bufferobj(ctx->Unpack.BufferObj)) {
- /* unpack from PBO */
- if (!_mesa_validate_pbo_access(2, &ctx->Unpack, width, height,
- 1, format, type, INT_MAX, pixels)) {
- _mesa_error(ctx, GL_INVALID_OPERATION,
- "glDrawPixels(invalid PBO access)");
- goto end;
- }
- if (_mesa_bufferobj_mapped(ctx->Unpack.BufferObj)) {
- /* buffer is mapped - that's an error */
- _mesa_error(ctx, GL_INVALID_OPERATION,
- "glDrawPixels(PBO is mapped)");
- goto end;
- }
- }
-
- ctx->Driver.DrawPixels(ctx, x, y, width, height, format, type,
- &ctx->Unpack, pixels);
- }
- }
- else if (ctx->RenderMode == GL_FEEDBACK) {
- /* Feedback the current raster pos info */
- FLUSH_CURRENT( ctx, 0 );
- _mesa_feedback_token( ctx, (GLfloat) (GLint) GL_DRAW_PIXEL_TOKEN );
- _mesa_feedback_vertex( ctx,
- ctx->Current.RasterPos,
- ctx->Current.RasterColor,
- ctx->Current.RasterTexCoords[0] );
- }
- else {
- ASSERT(ctx->RenderMode == GL_SELECT);
- /* Do nothing. See OpenGL Spec, Appendix B, Corollary 6. */
- }
-
-end:
- _mesa_set_vp_override(ctx, GL_FALSE);
-}
-
-
-static void GLAPIENTRY
-_mesa_CopyPixels( GLint srcx, GLint srcy, GLsizei width, GLsizei height,
- GLenum type )
-{
- GET_CURRENT_CONTEXT(ctx);
- ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
-
- if (MESA_VERBOSE & VERBOSE_API)
- _mesa_debug(ctx,
- "glCopyPixels(%d, %d, %d, %d, %s) // from %s to %s at %d, %d\n",
- srcx, srcy, width, height,
- _mesa_lookup_enum_by_nr(type),
- _mesa_lookup_enum_by_nr(ctx->ReadBuffer->ColorReadBuffer),
- _mesa_lookup_enum_by_nr(ctx->DrawBuffer->ColorDrawBuffer[0]),
- IROUND(ctx->Current.RasterPos[0]),
- IROUND(ctx->Current.RasterPos[1]));
-
- if (width < 0 || height < 0) {
- _mesa_error(ctx, GL_INVALID_VALUE, "glCopyPixels(width or height < 0)");
- return;
- }
-
- /* Note: more detailed 'type' checking is done by the
- * _mesa_source/dest_buffer_exists() calls below. That's where we
- * check if the stencil buffer exists, etc.
- */
- if (type != GL_COLOR &&
- type != GL_DEPTH &&
- type != GL_STENCIL &&
- type != GL_DEPTH_STENCIL) {
- _mesa_error(ctx, GL_INVALID_ENUM, "glCopyPixels(type=%s)",
- _mesa_lookup_enum_by_nr(type));
- return;
- }
-
- /* We're not using the current vertex program, and the driver may install
- * it's own. Note: this may dirty some state.
- */
- _mesa_set_vp_override(ctx, GL_TRUE);
-
- /* Note: this call does state validation */
- if (!_mesa_valid_to_render(ctx, "glCopyPixels")) {
- goto end; /* the error code was recorded */
- }
-
- /* Check read buffer's status (draw buffer was already checked) */
- if (ctx->ReadBuffer->_Status != GL_FRAMEBUFFER_COMPLETE_EXT) {
- _mesa_error(ctx, GL_INVALID_FRAMEBUFFER_OPERATION_EXT,
- "glCopyPixels(incomplete framebuffer)" );
- goto end;
- }
-
- if (!_mesa_source_buffer_exists(ctx, type) ||
- !_mesa_dest_buffer_exists(ctx, type)) {
- _mesa_error(ctx, GL_INVALID_OPERATION,
- "glCopyPixels(missing source or dest buffer)");
- goto end;
- }
-
- if (!ctx->Current.RasterPosValid || width == 0 || height == 0) {
- goto end; /* no-op, not an error */
- }
-
- if (ctx->RenderMode == GL_RENDER) {
- /* Round to satisfy conformance tests (matches SGI's OpenGL) */
- if (width > 0 && height > 0) {
- GLint destx = IROUND(ctx->Current.RasterPos[0]);
- GLint desty = IROUND(ctx->Current.RasterPos[1]);
- ctx->Driver.CopyPixels( ctx, srcx, srcy, width, height, destx, desty,
- type );
- }
- }
- else if (ctx->RenderMode == GL_FEEDBACK) {
- FLUSH_CURRENT( ctx, 0 );
- _mesa_feedback_token( ctx, (GLfloat) (GLint) GL_COPY_PIXEL_TOKEN );
- _mesa_feedback_vertex( ctx,
- ctx->Current.RasterPos,
- ctx->Current.RasterColor,
- ctx->Current.RasterTexCoords[0] );
- }
- else {
- ASSERT(ctx->RenderMode == GL_SELECT);
- /* Do nothing. See OpenGL Spec, Appendix B, Corollary 6. */
- }
-
-end:
- _mesa_set_vp_override(ctx, GL_FALSE);
-}
-
-
-static void GLAPIENTRY
-_mesa_Bitmap( GLsizei width, GLsizei height,
- GLfloat xorig, GLfloat yorig, GLfloat xmove, GLfloat ymove,
- const GLubyte *bitmap )
-{
- GET_CURRENT_CONTEXT(ctx);
- ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
-
- if (width < 0 || height < 0) {
- _mesa_error( ctx, GL_INVALID_VALUE, "glBitmap(width or height < 0)" );
- return;
- }
-
- if (!ctx->Current.RasterPosValid) {
- return; /* do nothing */
- }
-
- /* Note: this call does state validation */
- if (!_mesa_valid_to_render(ctx, "glBitmap")) {
- /* the error code was recorded */
- return;
- }
-
- if (ctx->RenderMode == GL_RENDER) {
- /* Truncate, to satisfy conformance tests (matches SGI's OpenGL). */
- if (width > 0 && height > 0) {
- const GLfloat epsilon = 0.0001F;
- GLint x = IFLOOR(ctx->Current.RasterPos[0] + epsilon - xorig);
- GLint y = IFLOOR(ctx->Current.RasterPos[1] + epsilon - yorig);
-
- if (_mesa_is_bufferobj(ctx->Unpack.BufferObj)) {
- /* unpack from PBO */
- if (!_mesa_validate_pbo_access(2, &ctx->Unpack, width, height,
- 1, GL_COLOR_INDEX, GL_BITMAP,
- INT_MAX, (const GLvoid *) bitmap)) {
- _mesa_error(ctx, GL_INVALID_OPERATION,
- "glBitmap(invalid PBO access)");
- return;
- }
- if (_mesa_bufferobj_mapped(ctx->Unpack.BufferObj)) {
- /* buffer is mapped - that's an error */
- _mesa_error(ctx, GL_INVALID_OPERATION,
- "glBitmap(PBO is mapped)");
- return;
- }
- }
-
- ctx->Driver.Bitmap( ctx, x, y, width, height, &ctx->Unpack, bitmap );
- }
- }
-#if _HAVE_FULL_GL
- else if (ctx->RenderMode == GL_FEEDBACK) {
- FLUSH_CURRENT(ctx, 0);
- _mesa_feedback_token( ctx, (GLfloat) (GLint) GL_BITMAP_TOKEN );
- _mesa_feedback_vertex( ctx,
- ctx->Current.RasterPos,
- ctx->Current.RasterColor,
- ctx->Current.RasterTexCoords[0] );
- }
- else {
- ASSERT(ctx->RenderMode == GL_SELECT);
- /* Do nothing. See OpenGL Spec, Appendix B, Corollary 6. */
- }
-#endif
-
- /* update raster position */
- ctx->Current.RasterPos[0] += xmove;
- ctx->Current.RasterPos[1] += ymove;
-}
-
-
-void
-_mesa_init_drawpix_dispatch(struct _glapi_table *disp)
-{
- SET_Bitmap(disp, _mesa_Bitmap);
- SET_CopyPixels(disp, _mesa_CopyPixels);
- SET_DrawPixels(disp, _mesa_DrawPixels);
-}
-
-
-#endif /* FEATURE_drawpix */
+/*
+ * Mesa 3-D graphics library
+ * Version: 7.1
+ *
+ * Copyright (C) 1999-2008 Brian Paul All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+#include "glheader.h"
+#include "imports.h"
+#include "bufferobj.h"
+#include "context.h"
+#include "drawpix.h"
+#include "enums.h"
+#include "feedback.h"
+#include "framebuffer.h"
+#include "mfeatures.h"
+#include "pbo.h"
+#include "readpix.h"
+#include "state.h"
+#include "dispatch.h"
+
+
+#if FEATURE_drawpix
+
+
+/*
+ * Execute glDrawPixels
+ */
+static void GLAPIENTRY
+_mesa_DrawPixels( GLsizei width, GLsizei height,
+ GLenum format, GLenum type, const GLvoid *pixels )
+{
+ GET_CURRENT_CONTEXT(ctx);
+ ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
+
+ if (MESA_VERBOSE & VERBOSE_API)
+ _mesa_debug(ctx, "glDrawPixels(%d, %d, %s, %s, %p) // to %s at %d, %d\n",
+ width, height,
+ _mesa_lookup_enum_by_nr(format),
+ _mesa_lookup_enum_by_nr(type),
+ pixels,
+ _mesa_lookup_enum_by_nr(ctx->DrawBuffer->ColorDrawBuffer[0]),
+ IROUND(ctx->Current.RasterPos[0]),
+ IROUND(ctx->Current.RasterPos[1]));
+
+
+ if (width < 0 || height < 0) {
+ _mesa_error( ctx, GL_INVALID_VALUE, "glDrawPixels(width or height < 0" );
+ return;
+ }
+
+ /* We're not using the current vertex program, and the driver may install
+ * its own. Note: this may dirty some state.
+ */
+ _mesa_set_vp_override(ctx, GL_TRUE);
+
+ /* Note: this call does state validation */
+ if (!_mesa_valid_to_render(ctx, "glDrawPixels")) {
+ goto end; /* the error code was recorded */
+ }
+
+ if (_mesa_error_check_format_type(ctx, format, type, GL_TRUE)) {
+ goto end; /* the error code was recorded */
+ }
+
+ if (!ctx->Current.RasterPosValid) {
+ goto end; /* no-op, not an error */
+ }
+
+ if (ctx->RenderMode == GL_RENDER) {
+ if (width > 0 && height > 0) {
+ /* Round, to satisfy conformance tests (matches SGI's OpenGL) */
+ GLint x = IROUND(ctx->Current.RasterPos[0]);
+ GLint y = IROUND(ctx->Current.RasterPos[1]);
+
+ if (_mesa_is_bufferobj(ctx->Unpack.BufferObj)) {
+ /* unpack from PBO */
+ if (!_mesa_validate_pbo_access(2, &ctx->Unpack, width, height,
+ 1, format, type, INT_MAX, pixels)) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glDrawPixels(invalid PBO access)");
+ goto end;
+ }
+ if (_mesa_bufferobj_mapped(ctx->Unpack.BufferObj)) {
+ /* buffer is mapped - that's an error */
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glDrawPixels(PBO is mapped)");
+ goto end;
+ }
+ }
+
+ ctx->Driver.DrawPixels(ctx, x, y, width, height, format, type,
+ &ctx->Unpack, pixels);
+ }
+ }
+ else if (ctx->RenderMode == GL_FEEDBACK) {
+ /* Feedback the current raster pos info */
+ FLUSH_CURRENT( ctx, 0 );
+ _mesa_feedback_token( ctx, (GLfloat) (GLint) GL_DRAW_PIXEL_TOKEN );
+ _mesa_feedback_vertex( ctx,
+ ctx->Current.RasterPos,
+ ctx->Current.RasterColor,
+ ctx->Current.RasterTexCoords[0] );
+ }
+ else {
+ ASSERT(ctx->RenderMode == GL_SELECT);
+ /* Do nothing. See OpenGL Spec, Appendix B, Corollary 6. */
+ }
+
+end:
+ _mesa_set_vp_override(ctx, GL_FALSE);
+}
+
+
+static void GLAPIENTRY
+_mesa_CopyPixels( GLint srcx, GLint srcy, GLsizei width, GLsizei height,
+ GLenum type )
+{
+ GET_CURRENT_CONTEXT(ctx);
+ ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
+
+ if (MESA_VERBOSE & VERBOSE_API)
+ _mesa_debug(ctx,
+ "glCopyPixels(%d, %d, %d, %d, %s) // from %s to %s at %d, %d\n",
+ srcx, srcy, width, height,
+ _mesa_lookup_enum_by_nr(type),
+ _mesa_lookup_enum_by_nr(ctx->ReadBuffer->ColorReadBuffer),
+ _mesa_lookup_enum_by_nr(ctx->DrawBuffer->ColorDrawBuffer[0]),
+ IROUND(ctx->Current.RasterPos[0]),
+ IROUND(ctx->Current.RasterPos[1]));
+
+ if (width < 0 || height < 0) {
+ _mesa_error(ctx, GL_INVALID_VALUE, "glCopyPixels(width or height < 0)");
+ return;
+ }
+
+ /* Note: more detailed 'type' checking is done by the
+ * _mesa_source/dest_buffer_exists() calls below. That's where we
+ * check if the stencil buffer exists, etc.
+ */
+ if (type != GL_COLOR &&
+ type != GL_DEPTH &&
+ type != GL_STENCIL &&
+ type != GL_DEPTH_STENCIL) {
+ _mesa_error(ctx, GL_INVALID_ENUM, "glCopyPixels(type=%s)",
+ _mesa_lookup_enum_by_nr(type));
+ return;
+ }
+
+ /* We're not using the current vertex program, and the driver may install
+ * it's own. Note: this may dirty some state.
+ */
+ _mesa_set_vp_override(ctx, GL_TRUE);
+
+ /* Note: this call does state validation */
+ if (!_mesa_valid_to_render(ctx, "glCopyPixels")) {
+ goto end; /* the error code was recorded */
+ }
+
+ /* Check read buffer's status (draw buffer was already checked) */
+ if (ctx->ReadBuffer->_Status != GL_FRAMEBUFFER_COMPLETE_EXT) {
+ _mesa_error(ctx, GL_INVALID_FRAMEBUFFER_OPERATION_EXT,
+ "glCopyPixels(incomplete framebuffer)" );
+ goto end;
+ }
+
+ if (!_mesa_source_buffer_exists(ctx, type) ||
+ !_mesa_dest_buffer_exists(ctx, type)) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glCopyPixels(missing source or dest buffer)");
+ goto end;
+ }
+
+ if (!ctx->Current.RasterPosValid || width == 0 || height == 0) {
+ goto end; /* no-op, not an error */
+ }
+
+ if (ctx->RenderMode == GL_RENDER) {
+ /* Round to satisfy conformance tests (matches SGI's OpenGL) */
+ if (width > 0 && height > 0) {
+ GLint destx = IROUND(ctx->Current.RasterPos[0]);
+ GLint desty = IROUND(ctx->Current.RasterPos[1]);
+ ctx->Driver.CopyPixels( ctx, srcx, srcy, width, height, destx, desty,
+ type );
+ }
+ }
+ else if (ctx->RenderMode == GL_FEEDBACK) {
+ FLUSH_CURRENT( ctx, 0 );
+ _mesa_feedback_token( ctx, (GLfloat) (GLint) GL_COPY_PIXEL_TOKEN );
+ _mesa_feedback_vertex( ctx,
+ ctx->Current.RasterPos,
+ ctx->Current.RasterColor,
+ ctx->Current.RasterTexCoords[0] );
+ }
+ else {
+ ASSERT(ctx->RenderMode == GL_SELECT);
+ /* Do nothing. See OpenGL Spec, Appendix B, Corollary 6. */
+ }
+
+end:
+ _mesa_set_vp_override(ctx, GL_FALSE);
+}
+
+
+static void GLAPIENTRY
+_mesa_Bitmap( GLsizei width, GLsizei height,
+ GLfloat xorig, GLfloat yorig, GLfloat xmove, GLfloat ymove,
+ const GLubyte *bitmap )
+{
+ GET_CURRENT_CONTEXT(ctx);
+ ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
+
+ if (width < 0 || height < 0) {
+ _mesa_error( ctx, GL_INVALID_VALUE, "glBitmap(width or height < 0)" );
+ return;
+ }
+
+ if (!ctx->Current.RasterPosValid) {
+ return; /* do nothing */
+ }
+
+ /* Note: this call does state validation */
+ if (!_mesa_valid_to_render(ctx, "glBitmap")) {
+ /* the error code was recorded */
+ return;
+ }
+
+ if (ctx->RenderMode == GL_RENDER) {
+ /* Truncate, to satisfy conformance tests (matches SGI's OpenGL). */
+ if (width > 0 && height > 0) {
+ const GLfloat epsilon = 0.0001F;
+ GLint x = IFLOOR(ctx->Current.RasterPos[0] + epsilon - xorig);
+ GLint y = IFLOOR(ctx->Current.RasterPos[1] + epsilon - yorig);
+
+ if (_mesa_is_bufferobj(ctx->Unpack.BufferObj)) {
+ /* unpack from PBO */
+ if (!_mesa_validate_pbo_access(2, &ctx->Unpack, width, height,
+ 1, GL_COLOR_INDEX, GL_BITMAP,
+ INT_MAX, (const GLvoid *) bitmap)) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glBitmap(invalid PBO access)");
+ return;
+ }
+ if (_mesa_bufferobj_mapped(ctx->Unpack.BufferObj)) {
+ /* buffer is mapped - that's an error */
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glBitmap(PBO is mapped)");
+ return;
+ }
+ }
+
+ ctx->Driver.Bitmap( ctx, x, y, width, height, &ctx->Unpack, bitmap );
+ }
+ }
+#if _HAVE_FULL_GL
+ else if (ctx->RenderMode == GL_FEEDBACK) {
+ FLUSH_CURRENT(ctx, 0);
+ _mesa_feedback_token( ctx, (GLfloat) (GLint) GL_BITMAP_TOKEN );
+ _mesa_feedback_vertex( ctx,
+ ctx->Current.RasterPos,
+ ctx->Current.RasterColor,
+ ctx->Current.RasterTexCoords[0] );
+ }
+ else {
+ ASSERT(ctx->RenderMode == GL_SELECT);
+ /* Do nothing. See OpenGL Spec, Appendix B, Corollary 6. */
+ }
+#endif
+
+ /* update raster position */
+ ctx->Current.RasterPos[0] += xmove;
+ ctx->Current.RasterPos[1] += ymove;
+}
+
+
+void
+_mesa_init_drawpix_dispatch(struct _glapi_table *disp)
+{
+ SET_Bitmap(disp, _mesa_Bitmap);
+ SET_CopyPixels(disp, _mesa_CopyPixels);
+ SET_DrawPixels(disp, _mesa_DrawPixels);
+}
+
+
+#endif /* FEATURE_drawpix */
diff --git a/mesalib/src/mesa/main/enable.c b/mesalib/src/mesa/main/enable.c
index aac8b9c5e..bbf9153dc 100644
--- a/mesalib/src/mesa/main/enable.c
+++ b/mesalib/src/mesa/main/enable.c
@@ -1,1428 +1,1428 @@
-/**
- * \file enable.c
- * Enable/disable/query GL capabilities.
- */
-
-/*
- * Mesa 3-D graphics library
- * Version: 7.0.3
- *
- * Copyright (C) 1999-2007 Brian Paul All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-
-#include "glheader.h"
-#include "clip.h"
-#include "context.h"
-#include "enable.h"
-#include "light.h"
-#include "simple_list.h"
-#include "mfeatures.h"
-#include "mtypes.h"
-#include "enums.h"
-#include "api_arrayelt.h"
-#include "texstate.h"
-
-
-
-#define CHECK_EXTENSION(EXTNAME, CAP) \
- if (!ctx->Extensions.EXTNAME) { \
- goto invalid_enum_error; \
- }
-
-
-/**
- * Helper to enable/disable client-side state.
- */
-static void
-client_state(struct gl_context *ctx, GLenum cap, GLboolean state)
-{
- struct gl_array_object *arrayObj = ctx->Array.ArrayObj;
- GLuint flag;
- GLboolean *var;
-
- switch (cap) {
- case GL_VERTEX_ARRAY:
- var = &arrayObj->Vertex.Enabled;
- flag = _NEW_ARRAY_VERTEX;
- break;
- case GL_NORMAL_ARRAY:
- var = &arrayObj->Normal.Enabled;
- flag = _NEW_ARRAY_NORMAL;
- break;
- case GL_COLOR_ARRAY:
- var = &arrayObj->Color.Enabled;
- flag = _NEW_ARRAY_COLOR0;
- break;
- case GL_INDEX_ARRAY:
- var = &arrayObj->Index.Enabled;
- flag = _NEW_ARRAY_INDEX;
- break;
- case GL_TEXTURE_COORD_ARRAY:
- var = &arrayObj->TexCoord[ctx->Array.ActiveTexture].Enabled;
- flag = _NEW_ARRAY_TEXCOORD(ctx->Array.ActiveTexture);
- break;
- case GL_EDGE_FLAG_ARRAY:
- var = &arrayObj->EdgeFlag.Enabled;
- flag = _NEW_ARRAY_EDGEFLAG;
- break;
- case GL_FOG_COORDINATE_ARRAY_EXT:
- var = &arrayObj->FogCoord.Enabled;
- flag = _NEW_ARRAY_FOGCOORD;
- break;
- case GL_SECONDARY_COLOR_ARRAY_EXT:
- var = &arrayObj->SecondaryColor.Enabled;
- flag = _NEW_ARRAY_COLOR1;
- break;
-
-#if FEATURE_point_size_array
- case GL_POINT_SIZE_ARRAY_OES:
- var = &arrayObj->PointSize.Enabled;
- flag = _NEW_ARRAY_POINT_SIZE;
- break;
-#endif
-
-#if FEATURE_NV_vertex_program
- case GL_VERTEX_ATTRIB_ARRAY0_NV:
- case GL_VERTEX_ATTRIB_ARRAY1_NV:
- case GL_VERTEX_ATTRIB_ARRAY2_NV:
- case GL_VERTEX_ATTRIB_ARRAY3_NV:
- case GL_VERTEX_ATTRIB_ARRAY4_NV:
- case GL_VERTEX_ATTRIB_ARRAY5_NV:
- case GL_VERTEX_ATTRIB_ARRAY6_NV:
- case GL_VERTEX_ATTRIB_ARRAY7_NV:
- case GL_VERTEX_ATTRIB_ARRAY8_NV:
- case GL_VERTEX_ATTRIB_ARRAY9_NV:
- case GL_VERTEX_ATTRIB_ARRAY10_NV:
- case GL_VERTEX_ATTRIB_ARRAY11_NV:
- case GL_VERTEX_ATTRIB_ARRAY12_NV:
- case GL_VERTEX_ATTRIB_ARRAY13_NV:
- case GL_VERTEX_ATTRIB_ARRAY14_NV:
- case GL_VERTEX_ATTRIB_ARRAY15_NV:
- CHECK_EXTENSION(NV_vertex_program, cap);
- {
- GLint n = (GLint) cap - GL_VERTEX_ATTRIB_ARRAY0_NV;
- ASSERT(n < Elements(ctx->Array.ArrayObj->VertexAttrib));
- var = &arrayObj->VertexAttrib[n].Enabled;
- flag = _NEW_ARRAY_ATTRIB(n);
- }
- break;
-#endif /* FEATURE_NV_vertex_program */
-
- /* GL_NV_primitive_restart */
- case GL_PRIMITIVE_RESTART_NV:
- if (!ctx->Extensions.NV_primitive_restart) {
- goto invalid_enum_error;
- }
- var = &ctx->Array.PrimitiveRestart;
- flag = 0;
- break;
-
- default:
- goto invalid_enum_error;
- }
-
- if (*var == state)
- return;
-
- FLUSH_VERTICES(ctx, _NEW_ARRAY);
- ctx->Array.NewState |= flag;
-
- _ae_invalidate_state(ctx, _NEW_ARRAY);
-
- *var = state;
-
- if (state)
- ctx->Array.ArrayObj->_Enabled |= flag;
- else
- ctx->Array.ArrayObj->_Enabled &= ~flag;
-
- if (ctx->Driver.Enable) {
- ctx->Driver.Enable( ctx, cap, state );
- }
-
- return;
-
-invalid_enum_error:
- _mesa_error(ctx, GL_INVALID_ENUM, "gl%sClientState(0x%x)",
- state ? "Enable" : "Disable", cap);
-}
-
-
-/**
- * Enable GL capability.
- * \param cap state to enable/disable.
- *
- * Get's the current context, assures that we're outside glBegin()/glEnd() and
- * calls client_state().
- */
-void GLAPIENTRY
-_mesa_EnableClientState( GLenum cap )
-{
- GET_CURRENT_CONTEXT(ctx);
- ASSERT_OUTSIDE_BEGIN_END(ctx);
- client_state( ctx, cap, GL_TRUE );
-}
-
-
-/**
- * Disable GL capability.
- * \param cap state to enable/disable.
- *
- * Get's the current context, assures that we're outside glBegin()/glEnd() and
- * calls client_state().
- */
-void GLAPIENTRY
-_mesa_DisableClientState( GLenum cap )
-{
- GET_CURRENT_CONTEXT(ctx);
- ASSERT_OUTSIDE_BEGIN_END(ctx);
- client_state( ctx, cap, GL_FALSE );
-}
-
-
-#undef CHECK_EXTENSION
-#define CHECK_EXTENSION(EXTNAME, CAP) \
- if (!ctx->Extensions.EXTNAME) { \
- goto invalid_enum_error; \
- }
-
-#define CHECK_EXTENSION2(EXT1, EXT2, CAP) \
- if (!ctx->Extensions.EXT1 && !ctx->Extensions.EXT2) { \
- goto invalid_enum_error; \
- }
-
-
-
-/**
- * Return pointer to current texture unit for setting/getting coordinate
- * state.
- * Note that we'll set GL_INVALID_OPERATION and return NULL if the active
- * texture unit is higher than the number of supported coordinate units.
- */
-static struct gl_texture_unit *
-get_texcoord_unit(struct gl_context *ctx)
-{
- if (ctx->Texture.CurrentUnit >= ctx->Const.MaxTextureCoordUnits) {
- _mesa_error(ctx, GL_INVALID_OPERATION, "glEnable/Disable(texcoord unit)");
- return NULL;
- }
- else {
- return &ctx->Texture.Unit[ctx->Texture.CurrentUnit];
- }
-}
-
-
-/**
- * Helper function to enable or disable a texture target.
- * \param bit one of the TEXTURE_x_BIT values
- * \return GL_TRUE if state is changing or GL_FALSE if no change
- */
-static GLboolean
-enable_texture(struct gl_context *ctx, GLboolean state, GLbitfield texBit)
-{
- struct gl_texture_unit *texUnit = _mesa_get_current_tex_unit(ctx);
- const GLbitfield newenabled = state
- ? (texUnit->Enabled | texBit) : (texUnit->Enabled & ~texBit);
-
- if (texUnit->Enabled == newenabled)
- return GL_FALSE;
-
- FLUSH_VERTICES(ctx, _NEW_TEXTURE);
- texUnit->Enabled = newenabled;
- return GL_TRUE;
-}
-
-
-/**
- * Helper function to enable or disable state.
- *
- * \param ctx GL context.
- * \param cap the state to enable/disable
- * \param state whether to enable or disable the specified capability.
- *
- * Updates the current context and flushes the vertices as needed. For
- * capabilities associated with extensions it verifies that those extensions
- * are effectivly present before updating. Notifies the driver via
- * dd_function_table::Enable.
- */
-void
-_mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state)
-{
- if (MESA_VERBOSE & VERBOSE_API)
- _mesa_debug(ctx, "%s %s (newstate is %x)\n",
- state ? "glEnable" : "glDisable",
- _mesa_lookup_enum_by_nr(cap),
- ctx->NewState);
-
- switch (cap) {
- case GL_ALPHA_TEST:
- if (ctx->Color.AlphaEnabled == state)
- return;
- FLUSH_VERTICES(ctx, _NEW_COLOR);
- ctx->Color.AlphaEnabled = state;
- break;
- case GL_AUTO_NORMAL:
- if (ctx->Eval.AutoNormal == state)
- return;
- FLUSH_VERTICES(ctx, _NEW_EVAL);
- ctx->Eval.AutoNormal = state;
- break;
- case GL_BLEND:
- {
- GLbitfield newEnabled =
- state * ((1 << ctx->Const.MaxDrawBuffers) - 1);
- if (newEnabled != ctx->Color.BlendEnabled) {
- FLUSH_VERTICES(ctx, _NEW_COLOR);
- ctx->Color.BlendEnabled = newEnabled;
- }
- }
- break;
-#if FEATURE_userclip
- case GL_CLIP_PLANE0:
- case GL_CLIP_PLANE1:
- case GL_CLIP_PLANE2:
- case GL_CLIP_PLANE3:
- case GL_CLIP_PLANE4:
- case GL_CLIP_PLANE5:
- {
- const GLuint p = cap - GL_CLIP_PLANE0;
-
- if ((ctx->Transform.ClipPlanesEnabled & (1 << p))
- == ((GLuint) state << p))
- return;
-
- FLUSH_VERTICES(ctx, _NEW_TRANSFORM);
-
- if (state) {
- ctx->Transform.ClipPlanesEnabled |= (1 << p);
- _mesa_update_clip_plane(ctx, p);
- }
- else {
- ctx->Transform.ClipPlanesEnabled &= ~(1 << p);
- }
- }
- break;
-#endif
- case GL_COLOR_MATERIAL:
- if (ctx->Light.ColorMaterialEnabled == state)
- return;
- FLUSH_VERTICES(ctx, _NEW_LIGHT);
- FLUSH_CURRENT(ctx, 0);
- ctx->Light.ColorMaterialEnabled = state;
- if (state) {
- _mesa_update_color_material( ctx,
- ctx->Current.Attrib[VERT_ATTRIB_COLOR0] );
- }
- break;
- case GL_CULL_FACE:
- if (ctx->Polygon.CullFlag == state)
- return;
- FLUSH_VERTICES(ctx, _NEW_POLYGON);
- ctx->Polygon.CullFlag = state;
- break;
- case GL_DEPTH_TEST:
- if (ctx->Depth.Test == state)
- return;
- FLUSH_VERTICES(ctx, _NEW_DEPTH);
- ctx->Depth.Test = state;
- break;
- case GL_DITHER:
- if (ctx->Color.DitherFlag == state)
- return;
- FLUSH_VERTICES(ctx, _NEW_COLOR);
- ctx->Color.DitherFlag = state;
- break;
- case GL_FOG:
- if (ctx->Fog.Enabled == state)
- return;
- FLUSH_VERTICES(ctx, _NEW_FOG);
- ctx->Fog.Enabled = state;
- break;
- case GL_LIGHT0:
- case GL_LIGHT1:
- case GL_LIGHT2:
- case GL_LIGHT3:
- case GL_LIGHT4:
- case GL_LIGHT5:
- case GL_LIGHT6:
- case GL_LIGHT7:
- if (ctx->Light.Light[cap-GL_LIGHT0].Enabled == state)
- return;
- FLUSH_VERTICES(ctx, _NEW_LIGHT);
- ctx->Light.Light[cap-GL_LIGHT0].Enabled = state;
- if (state) {
- insert_at_tail(&ctx->Light.EnabledList,
- &ctx->Light.Light[cap-GL_LIGHT0]);
- }
- else {
- remove_from_list(&ctx->Light.Light[cap-GL_LIGHT0]);
- }
- break;
- case GL_LIGHTING:
- if (ctx->Light.Enabled == state)
- return;
- FLUSH_VERTICES(ctx, _NEW_LIGHT);
- ctx->Light.Enabled = state;
- if (ctx->Light.Enabled && ctx->Light.Model.TwoSide)
- ctx->_TriangleCaps |= DD_TRI_LIGHT_TWOSIDE;
- else
- ctx->_TriangleCaps &= ~DD_TRI_LIGHT_TWOSIDE;
- break;
- case GL_LINE_SMOOTH:
- if (ctx->Line.SmoothFlag == state)
- return;
- FLUSH_VERTICES(ctx, _NEW_LINE);
- ctx->Line.SmoothFlag = state;
- ctx->_TriangleCaps ^= DD_LINE_SMOOTH;
- break;
- case GL_LINE_STIPPLE:
- if (ctx->Line.StippleFlag == state)
- return;
- FLUSH_VERTICES(ctx, _NEW_LINE);
- ctx->Line.StippleFlag = state;
- ctx->_TriangleCaps ^= DD_LINE_STIPPLE;
- break;
- case GL_INDEX_LOGIC_OP:
- if (ctx->Color.IndexLogicOpEnabled == state)
- return;
- FLUSH_VERTICES(ctx, _NEW_COLOR);
- ctx->Color.IndexLogicOpEnabled = state;
- break;
- case GL_COLOR_LOGIC_OP:
- if (ctx->Color.ColorLogicOpEnabled == state)
- return;
- FLUSH_VERTICES(ctx, _NEW_COLOR);
- ctx->Color.ColorLogicOpEnabled = state;
- break;
- case GL_MAP1_COLOR_4:
- if (ctx->Eval.Map1Color4 == state)
- return;
- FLUSH_VERTICES(ctx, _NEW_EVAL);
- ctx->Eval.Map1Color4 = state;
- break;
- case GL_MAP1_INDEX:
- if (ctx->Eval.Map1Index == state)
- return;
- FLUSH_VERTICES(ctx, _NEW_EVAL);
- ctx->Eval.Map1Index = state;
- break;
- case GL_MAP1_NORMAL:
- if (ctx->Eval.Map1Normal == state)
- return;
- FLUSH_VERTICES(ctx, _NEW_EVAL);
- ctx->Eval.Map1Normal = state;
- break;
- case GL_MAP1_TEXTURE_COORD_1:
- if (ctx->Eval.Map1TextureCoord1 == state)
- return;
- FLUSH_VERTICES(ctx, _NEW_EVAL);
- ctx->Eval.Map1TextureCoord1 = state;
- break;
- case GL_MAP1_TEXTURE_COORD_2:
- if (ctx->Eval.Map1TextureCoord2 == state)
- return;
- FLUSH_VERTICES(ctx, _NEW_EVAL);
- ctx->Eval.Map1TextureCoord2 = state;
- break;
- case GL_MAP1_TEXTURE_COORD_3:
- if (ctx->Eval.Map1TextureCoord3 == state)
- return;
- FLUSH_VERTICES(ctx, _NEW_EVAL);
- ctx->Eval.Map1TextureCoord3 = state;
- break;
- case GL_MAP1_TEXTURE_COORD_4:
- if (ctx->Eval.Map1TextureCoord4 == state)
- return;
- FLUSH_VERTICES(ctx, _NEW_EVAL);
- ctx->Eval.Map1TextureCoord4 = state;
- break;
- case GL_MAP1_VERTEX_3:
- if (ctx->Eval.Map1Vertex3 == state)
- return;
- FLUSH_VERTICES(ctx, _NEW_EVAL);
- ctx->Eval.Map1Vertex3 = state;
- break;
- case GL_MAP1_VERTEX_4:
- if (ctx->Eval.Map1Vertex4 == state)
- return;
- FLUSH_VERTICES(ctx, _NEW_EVAL);
- ctx->Eval.Map1Vertex4 = state;
- break;
- case GL_MAP2_COLOR_4:
- if (ctx->Eval.Map2Color4 == state)
- return;
- FLUSH_VERTICES(ctx, _NEW_EVAL);
- ctx->Eval.Map2Color4 = state;
- break;
- case GL_MAP2_INDEX:
- if (ctx->Eval.Map2Index == state)
- return;
- FLUSH_VERTICES(ctx, _NEW_EVAL);
- ctx->Eval.Map2Index = state;
- break;
- case GL_MAP2_NORMAL:
- if (ctx->Eval.Map2Normal == state)
- return;
- FLUSH_VERTICES(ctx, _NEW_EVAL);
- ctx->Eval.Map2Normal = state;
- break;
- case GL_MAP2_TEXTURE_COORD_1:
- if (ctx->Eval.Map2TextureCoord1 == state)
- return;
- FLUSH_VERTICES(ctx, _NEW_EVAL);
- ctx->Eval.Map2TextureCoord1 = state;
- break;
- case GL_MAP2_TEXTURE_COORD_2:
- if (ctx->Eval.Map2TextureCoord2 == state)
- return;
- FLUSH_VERTICES(ctx, _NEW_EVAL);
- ctx->Eval.Map2TextureCoord2 = state;
- break;
- case GL_MAP2_TEXTURE_COORD_3:
- if (ctx->Eval.Map2TextureCoord3 == state)
- return;
- FLUSH_VERTICES(ctx, _NEW_EVAL);
- ctx->Eval.Map2TextureCoord3 = state;
- break;
- case GL_MAP2_TEXTURE_COORD_4:
- if (ctx->Eval.Map2TextureCoord4 == state)
- return;
- FLUSH_VERTICES(ctx, _NEW_EVAL);
- ctx->Eval.Map2TextureCoord4 = state;
- break;
- case GL_MAP2_VERTEX_3:
- if (ctx->Eval.Map2Vertex3 == state)
- return;
- FLUSH_VERTICES(ctx, _NEW_EVAL);
- ctx->Eval.Map2Vertex3 = state;
- break;
- case GL_MAP2_VERTEX_4:
- if (ctx->Eval.Map2Vertex4 == state)
- return;
- FLUSH_VERTICES(ctx, _NEW_EVAL);
- ctx->Eval.Map2Vertex4 = state;
- break;
- case GL_NORMALIZE:
- if (ctx->Transform.Normalize == state)
- return;
- FLUSH_VERTICES(ctx, _NEW_TRANSFORM);
- ctx->Transform.Normalize = state;
- break;
- case GL_POINT_SMOOTH:
- if (ctx->Point.SmoothFlag == state)
- return;
- FLUSH_VERTICES(ctx, _NEW_POINT);
- ctx->Point.SmoothFlag = state;
- ctx->_TriangleCaps ^= DD_POINT_SMOOTH;
- break;
- case GL_POLYGON_SMOOTH:
- if (ctx->Polygon.SmoothFlag == state)
- return;
- FLUSH_VERTICES(ctx, _NEW_POLYGON);
- ctx->Polygon.SmoothFlag = state;
- ctx->_TriangleCaps ^= DD_TRI_SMOOTH;
- break;
- case GL_POLYGON_STIPPLE:
- if (ctx->Polygon.StippleFlag == state)
- return;
- FLUSH_VERTICES(ctx, _NEW_POLYGON);
- ctx->Polygon.StippleFlag = state;
- ctx->_TriangleCaps ^= DD_TRI_STIPPLE;
- break;
- case GL_POLYGON_OFFSET_POINT:
- if (ctx->Polygon.OffsetPoint == state)
- return;
- FLUSH_VERTICES(ctx, _NEW_POLYGON);
- ctx->Polygon.OffsetPoint = state;
- break;
- case GL_POLYGON_OFFSET_LINE:
- if (ctx->Polygon.OffsetLine == state)
- return;
- FLUSH_VERTICES(ctx, _NEW_POLYGON);
- ctx->Polygon.OffsetLine = state;
- break;
- case GL_POLYGON_OFFSET_FILL:
- /*case GL_POLYGON_OFFSET_EXT:*/
- if (ctx->Polygon.OffsetFill == state)
- return;
- FLUSH_VERTICES(ctx, _NEW_POLYGON);
- ctx->Polygon.OffsetFill = state;
- break;
- case GL_RESCALE_NORMAL_EXT:
- if (ctx->Transform.RescaleNormals == state)
- return;
- FLUSH_VERTICES(ctx, _NEW_TRANSFORM);
- ctx->Transform.RescaleNormals = state;
- break;
- case GL_SCISSOR_TEST:
- if (ctx->Scissor.Enabled == state)
- return;
- FLUSH_VERTICES(ctx, _NEW_SCISSOR);
- ctx->Scissor.Enabled = state;
- break;
- case GL_SHARED_TEXTURE_PALETTE_EXT:
- if (ctx->Texture.SharedPalette == state)
- return;
- FLUSH_VERTICES(ctx, _NEW_TEXTURE);
- ctx->Texture.SharedPalette = state;
- break;
- case GL_STENCIL_TEST:
- if (ctx->Stencil.Enabled == state)
- return;
- FLUSH_VERTICES(ctx, _NEW_STENCIL);
- ctx->Stencil.Enabled = state;
- break;
- case GL_TEXTURE_1D:
- if (!enable_texture(ctx, state, TEXTURE_1D_BIT)) {
- return;
- }
- break;
- case GL_TEXTURE_2D:
- if (!enable_texture(ctx, state, TEXTURE_2D_BIT)) {
- return;
- }
- break;
- case GL_TEXTURE_3D:
- if (!enable_texture(ctx, state, TEXTURE_3D_BIT)) {
- return;
- }
- break;
- case GL_TEXTURE_GEN_S:
- case GL_TEXTURE_GEN_T:
- case GL_TEXTURE_GEN_R:
- case GL_TEXTURE_GEN_Q:
- {
- struct gl_texture_unit *texUnit = get_texcoord_unit(ctx);
- if (texUnit) {
- GLbitfield coordBit = S_BIT << (cap - GL_TEXTURE_GEN_S);
- GLbitfield newenabled = texUnit->TexGenEnabled & ~coordBit;
- if (state)
- newenabled |= coordBit;
- if (texUnit->TexGenEnabled == newenabled)
- return;
- FLUSH_VERTICES(ctx, _NEW_TEXTURE);
- texUnit->TexGenEnabled = newenabled;
- }
- }
- break;
-
-#if FEATURE_ES1
- case GL_TEXTURE_GEN_STR_OES:
- /* disable S, T, and R at the same time */
- {
- struct gl_texture_unit *texUnit = get_texcoord_unit(ctx);
- if (texUnit) {
- GLuint newenabled =
- texUnit->TexGenEnabled & ~STR_BITS;
- if (state)
- newenabled |= STR_BITS;
- if (texUnit->TexGenEnabled == newenabled)
- return;
- FLUSH_VERTICES(ctx, _NEW_TEXTURE);
- texUnit->TexGenEnabled = newenabled;
- }
- }
- break;
-#endif
-
- /*
- * CLIENT STATE!!!
- */
- case GL_VERTEX_ARRAY:
- case GL_NORMAL_ARRAY:
- case GL_COLOR_ARRAY:
- case GL_INDEX_ARRAY:
- case GL_TEXTURE_COORD_ARRAY:
- case GL_EDGE_FLAG_ARRAY:
- case GL_FOG_COORDINATE_ARRAY_EXT:
- case GL_SECONDARY_COLOR_ARRAY_EXT:
- case GL_POINT_SIZE_ARRAY_OES:
- client_state( ctx, cap, state );
- return;
-
- /* GL_ARB_texture_cube_map */
- case GL_TEXTURE_CUBE_MAP_ARB:
- CHECK_EXTENSION(ARB_texture_cube_map, cap);
- if (!enable_texture(ctx, state, TEXTURE_CUBE_BIT)) {
- return;
- }
- break;
-
- /* GL_EXT_secondary_color */
- case GL_COLOR_SUM_EXT:
- CHECK_EXTENSION2(EXT_secondary_color, ARB_vertex_program, cap);
- if (ctx->Fog.ColorSumEnabled == state)
- return;
- FLUSH_VERTICES(ctx, _NEW_FOG);
- ctx->Fog.ColorSumEnabled = state;
- break;
-
- /* GL_ARB_multisample */
- case GL_MULTISAMPLE_ARB:
- if (ctx->Multisample.Enabled == state)
- return;
- FLUSH_VERTICES(ctx, _NEW_MULTISAMPLE);
- ctx->Multisample.Enabled = state;
- break;
- case GL_SAMPLE_ALPHA_TO_COVERAGE_ARB:
- if (ctx->Multisample.SampleAlphaToCoverage == state)
- return;
- FLUSH_VERTICES(ctx, _NEW_MULTISAMPLE);
- ctx->Multisample.SampleAlphaToCoverage = state;
- break;
- case GL_SAMPLE_ALPHA_TO_ONE_ARB:
- if (ctx->Multisample.SampleAlphaToOne == state)
- return;
- FLUSH_VERTICES(ctx, _NEW_MULTISAMPLE);
- ctx->Multisample.SampleAlphaToOne = state;
- break;
- case GL_SAMPLE_COVERAGE_ARB:
- if (ctx->Multisample.SampleCoverage == state)
- return;
- FLUSH_VERTICES(ctx, _NEW_MULTISAMPLE);
- ctx->Multisample.SampleCoverage = state;
- break;
- case GL_SAMPLE_COVERAGE_INVERT_ARB:
- if (ctx->Multisample.SampleCoverageInvert == state)
- return;
- FLUSH_VERTICES(ctx, _NEW_MULTISAMPLE);
- ctx->Multisample.SampleCoverageInvert = state;
- break;
-
- /* GL_IBM_rasterpos_clip */
- case GL_RASTER_POSITION_UNCLIPPED_IBM:
- CHECK_EXTENSION(IBM_rasterpos_clip, cap);
- if (ctx->Transform.RasterPositionUnclipped == state)
- return;
- FLUSH_VERTICES(ctx, _NEW_TRANSFORM);
- ctx->Transform.RasterPositionUnclipped = state;
- break;
-
- /* GL_NV_point_sprite */
- case GL_POINT_SPRITE_NV:
- CHECK_EXTENSION2(NV_point_sprite, ARB_point_sprite, cap);
- if (ctx->Point.PointSprite == state)
- return;
- FLUSH_VERTICES(ctx, _NEW_POINT);
- ctx->Point.PointSprite = state;
- break;
-
-#if FEATURE_NV_vertex_program || FEATURE_ARB_vertex_program
- case GL_VERTEX_PROGRAM_ARB:
- CHECK_EXTENSION2(ARB_vertex_program, NV_vertex_program, cap);
- if (ctx->VertexProgram.Enabled == state)
- return;
- FLUSH_VERTICES(ctx, _NEW_PROGRAM);
- ctx->VertexProgram.Enabled = state;
- break;
- case GL_VERTEX_PROGRAM_POINT_SIZE_ARB:
- CHECK_EXTENSION2(ARB_vertex_program, NV_vertex_program, cap);
- if (ctx->VertexProgram.PointSizeEnabled == state)
- return;
- FLUSH_VERTICES(ctx, _NEW_PROGRAM);
- ctx->VertexProgram.PointSizeEnabled = state;
- break;
- case GL_VERTEX_PROGRAM_TWO_SIDE_ARB:
- CHECK_EXTENSION2(ARB_vertex_program, NV_vertex_program, cap);
- if (ctx->VertexProgram.TwoSideEnabled == state)
- return;
- FLUSH_VERTICES(ctx, _NEW_PROGRAM);
- ctx->VertexProgram.TwoSideEnabled = state;
- break;
-#endif
-#if FEATURE_NV_vertex_program
- case GL_MAP1_VERTEX_ATTRIB0_4_NV:
- case GL_MAP1_VERTEX_ATTRIB1_4_NV:
- case GL_MAP1_VERTEX_ATTRIB2_4_NV:
- case GL_MAP1_VERTEX_ATTRIB3_4_NV:
- case GL_MAP1_VERTEX_ATTRIB4_4_NV:
- case GL_MAP1_VERTEX_ATTRIB5_4_NV:
- case GL_MAP1_VERTEX_ATTRIB6_4_NV:
- case GL_MAP1_VERTEX_ATTRIB7_4_NV:
- case GL_MAP1_VERTEX_ATTRIB8_4_NV:
- case GL_MAP1_VERTEX_ATTRIB9_4_NV:
- case GL_MAP1_VERTEX_ATTRIB10_4_NV:
- case GL_MAP1_VERTEX_ATTRIB11_4_NV:
- case GL_MAP1_VERTEX_ATTRIB12_4_NV:
- case GL_MAP1_VERTEX_ATTRIB13_4_NV:
- case GL_MAP1_VERTEX_ATTRIB14_4_NV:
- case GL_MAP1_VERTEX_ATTRIB15_4_NV:
- CHECK_EXTENSION(NV_vertex_program, cap);
- {
- const GLuint map = (GLuint) (cap - GL_MAP1_VERTEX_ATTRIB0_4_NV);
- FLUSH_VERTICES(ctx, _NEW_EVAL);
- ctx->Eval.Map1Attrib[map] = state;
- }
- break;
- case GL_MAP2_VERTEX_ATTRIB0_4_NV:
- case GL_MAP2_VERTEX_ATTRIB1_4_NV:
- case GL_MAP2_VERTEX_ATTRIB2_4_NV:
- case GL_MAP2_VERTEX_ATTRIB3_4_NV:
- case GL_MAP2_VERTEX_ATTRIB4_4_NV:
- case GL_MAP2_VERTEX_ATTRIB5_4_NV:
- case GL_MAP2_VERTEX_ATTRIB6_4_NV:
- case GL_MAP2_VERTEX_ATTRIB7_4_NV:
- case GL_MAP2_VERTEX_ATTRIB8_4_NV:
- case GL_MAP2_VERTEX_ATTRIB9_4_NV:
- case GL_MAP2_VERTEX_ATTRIB10_4_NV:
- case GL_MAP2_VERTEX_ATTRIB11_4_NV:
- case GL_MAP2_VERTEX_ATTRIB12_4_NV:
- case GL_MAP2_VERTEX_ATTRIB13_4_NV:
- case GL_MAP2_VERTEX_ATTRIB14_4_NV:
- case GL_MAP2_VERTEX_ATTRIB15_4_NV:
- CHECK_EXTENSION(NV_vertex_program, cap);
- {
- const GLuint map = (GLuint) (cap - GL_MAP2_VERTEX_ATTRIB0_4_NV);
- FLUSH_VERTICES(ctx, _NEW_EVAL);
- ctx->Eval.Map2Attrib[map] = state;
- }
- break;
-#endif /* FEATURE_NV_vertex_program */
-
-#if FEATURE_NV_fragment_program
- case GL_FRAGMENT_PROGRAM_NV:
- CHECK_EXTENSION(NV_fragment_program, cap);
- if (ctx->FragmentProgram.Enabled == state)
- return;
- FLUSH_VERTICES(ctx, _NEW_PROGRAM);
- ctx->FragmentProgram.Enabled = state;
- break;
-#endif /* FEATURE_NV_fragment_program */
-
- /* GL_NV_texture_rectangle */
- case GL_TEXTURE_RECTANGLE_NV:
- CHECK_EXTENSION(NV_texture_rectangle, cap);
- if (!enable_texture(ctx, state, TEXTURE_RECT_BIT)) {
- return;
- }
- break;
-
- /* GL_EXT_stencil_two_side */
- case GL_STENCIL_TEST_TWO_SIDE_EXT:
- CHECK_EXTENSION(EXT_stencil_two_side, cap);
- if (ctx->Stencil.TestTwoSide == state)
- return;
- FLUSH_VERTICES(ctx, _NEW_STENCIL);
- ctx->Stencil.TestTwoSide = state;
- if (state) {
- ctx->Stencil._BackFace = 2;
- ctx->_TriangleCaps |= DD_TRI_TWOSTENCIL;
- } else {
- ctx->Stencil._BackFace = 1;
- ctx->_TriangleCaps &= ~DD_TRI_TWOSTENCIL;
- }
- break;
-
-#if FEATURE_ARB_fragment_program
- case GL_FRAGMENT_PROGRAM_ARB:
- CHECK_EXTENSION(ARB_fragment_program, cap);
- if (ctx->FragmentProgram.Enabled == state)
- return;
- FLUSH_VERTICES(ctx, _NEW_PROGRAM);
- ctx->FragmentProgram.Enabled = state;
- break;
-#endif /* FEATURE_ARB_fragment_program */
-
- /* GL_EXT_depth_bounds_test */
- case GL_DEPTH_BOUNDS_TEST_EXT:
- CHECK_EXTENSION(EXT_depth_bounds_test, cap);
- if (ctx->Depth.BoundsTest == state)
- return;
- FLUSH_VERTICES(ctx, _NEW_DEPTH);
- ctx->Depth.BoundsTest = state;
- break;
-
- case GL_DEPTH_CLAMP:
- if (ctx->Transform.DepthClamp == state)
- return;
- CHECK_EXTENSION(ARB_depth_clamp, cap);
- FLUSH_VERTICES(ctx, _NEW_TRANSFORM);
- ctx->Transform.DepthClamp = state;
- break;
-
-#if FEATURE_ATI_fragment_shader
- case GL_FRAGMENT_SHADER_ATI:
- CHECK_EXTENSION(ATI_fragment_shader, cap);
- if (ctx->ATIFragmentShader.Enabled == state)
- return;
- FLUSH_VERTICES(ctx, _NEW_PROGRAM);
- ctx->ATIFragmentShader.Enabled = state;
- break;
-#endif
-
- /* GL_MESA_texture_array */
- case GL_TEXTURE_1D_ARRAY_EXT:
- CHECK_EXTENSION(MESA_texture_array, cap);
- if (!enable_texture(ctx, state, TEXTURE_1D_ARRAY_BIT)) {
- return;
- }
- break;
-
- case GL_TEXTURE_2D_ARRAY_EXT:
- CHECK_EXTENSION(MESA_texture_array, cap);
- if (!enable_texture(ctx, state, TEXTURE_2D_ARRAY_BIT)) {
- return;
- }
- break;
-
- case GL_TEXTURE_CUBE_MAP_SEAMLESS:
- CHECK_EXTENSION(ARB_seamless_cube_map, cap);
- if (ctx->Texture.CubeMapSeamless != state) {
- FLUSH_VERTICES(ctx, _NEW_TEXTURE);
- ctx->Texture.CubeMapSeamless = state;
- }
- break;
-
-#if FEATURE_EXT_transform_feedback
- case GL_RASTERIZER_DISCARD:
- CHECK_EXTENSION(EXT_transform_feedback, cap);
- if (ctx->TransformFeedback.RasterDiscard != state) {
- FLUSH_VERTICES(ctx, _NEW_TRANSFORM);
- ctx->TransformFeedback.RasterDiscard = state;
- }
- break;
-#endif
-
- /* GL 3.1 primitive restart. Note: this enum is different from
- * GL_PRIMITIVE_RESTART_NV (which is client state).
- */
- case GL_PRIMITIVE_RESTART:
- if (ctx->VersionMajor * 10 + ctx->VersionMinor < 31) {
- goto invalid_enum_error;
- }
- if (ctx->Array.PrimitiveRestart != state) {
- FLUSH_VERTICES(ctx, _NEW_TRANSFORM);
- ctx->Array.PrimitiveRestart = state;
- }
- break;
-
- /* GL3.0 - GL_framebuffer_sRGB */
- case GL_FRAMEBUFFER_SRGB_EXT:
- CHECK_EXTENSION(EXT_framebuffer_sRGB, cap);
- FLUSH_VERTICES(ctx, _NEW_BUFFERS);
- ctx->Color.sRGBEnabled = state;
- break;
-
- default:
- goto invalid_enum_error;
- }
-
- if (ctx->Driver.Enable) {
- ctx->Driver.Enable( ctx, cap, state );
- }
-
- return;
-
-invalid_enum_error:
- _mesa_error(ctx, GL_INVALID_ENUM, "gl%s(0x%x)",
- state ? "Enable" : "Disable", cap);
-}
-
-
-/**
- * Enable GL capability. Called by glEnable()
- * \param cap state to enable.
- */
-void GLAPIENTRY
-_mesa_Enable( GLenum cap )
-{
- GET_CURRENT_CONTEXT(ctx);
- ASSERT_OUTSIDE_BEGIN_END(ctx);
-
- _mesa_set_enable( ctx, cap, GL_TRUE );
-}
-
-
-/**
- * Disable GL capability. Called by glDisable()
- * \param cap state to disable.
- */
-void GLAPIENTRY
-_mesa_Disable( GLenum cap )
-{
- GET_CURRENT_CONTEXT(ctx);
- ASSERT_OUTSIDE_BEGIN_END(ctx);
-
- _mesa_set_enable( ctx, cap, GL_FALSE );
-}
-
-
-
-/**
- * Enable/disable an indexed state var.
- */
-void
-_mesa_set_enablei(struct gl_context *ctx, GLenum cap,
- GLuint index, GLboolean state)
-{
- ASSERT(state == 0 || state == 1);
- switch (cap) {
- case GL_BLEND:
- if (!ctx->Extensions.EXT_draw_buffers2) {
- goto invalid_enum_error;
- }
- if (index >= ctx->Const.MaxDrawBuffers) {
- _mesa_error(ctx, GL_INVALID_VALUE, "%s(index=%u)",
- state ? "glEnableIndexed" : "glDisableIndexed", index);
- return;
- }
- if (((ctx->Color.BlendEnabled >> index) & 1) != state) {
- FLUSH_VERTICES(ctx, _NEW_COLOR);
- if (state)
- ctx->Color.BlendEnabled |= (1 << index);
- else
- ctx->Color.BlendEnabled &= ~(1 << index);
- }
- break;
- default:
- goto invalid_enum_error;
- }
- return;
-
-invalid_enum_error:
- _mesa_error(ctx, GL_INVALID_ENUM, "%s(cap=%s)",
- state ? "glEnablei" : "glDisablei",
- _mesa_lookup_enum_by_nr(cap));
-}
-
-
-void GLAPIENTRY
-_mesa_DisableIndexed( GLenum cap, GLuint index )
-{
- GET_CURRENT_CONTEXT(ctx);
- ASSERT_OUTSIDE_BEGIN_END(ctx);
- _mesa_set_enablei(ctx, cap, index, GL_FALSE);
-}
-
-
-void GLAPIENTRY
-_mesa_EnableIndexed( GLenum cap, GLuint index )
-{
- GET_CURRENT_CONTEXT(ctx);
- ASSERT_OUTSIDE_BEGIN_END(ctx);
- _mesa_set_enablei(ctx, cap, index, GL_TRUE);
-}
-
-
-GLboolean GLAPIENTRY
-_mesa_IsEnabledIndexed( GLenum cap, GLuint index )
-{
- GET_CURRENT_CONTEXT(ctx);
- switch (cap) {
- case GL_BLEND:
- if (index >= ctx->Const.MaxDrawBuffers) {
- _mesa_error(ctx, GL_INVALID_VALUE, "glIsEnabledIndexed(index=%u)",
- index);
- return GL_FALSE;
- }
- return (ctx->Color.BlendEnabled >> index) & 1;
- default:
- _mesa_error(ctx, GL_INVALID_ENUM, "glIsEnabledIndexed(cap=%s)",
- _mesa_lookup_enum_by_nr(cap));
- return GL_FALSE;
- }
-}
-
-
-
-
-#undef CHECK_EXTENSION
-#define CHECK_EXTENSION(EXTNAME) \
- if (!ctx->Extensions.EXTNAME) { \
- goto invalid_enum_error; \
- }
-
-#undef CHECK_EXTENSION2
-#define CHECK_EXTENSION2(EXT1, EXT2) \
- if (!ctx->Extensions.EXT1 && !ctx->Extensions.EXT2) { \
- goto invalid_enum_error; \
- }
-
-
-/**
- * Helper function to determine whether a texture target is enabled.
- */
-static GLboolean
-is_texture_enabled(struct gl_context *ctx, GLbitfield bit)
-{
- const struct gl_texture_unit *const texUnit =
- &ctx->Texture.Unit[ctx->Texture.CurrentUnit];
- return (texUnit->Enabled & bit) ? GL_TRUE : GL_FALSE;
-}
-
-
-/**
- * Return simple enable/disable state.
- *
- * \param cap state variable to query.
- *
- * Returns the state of the specified capability from the current GL context.
- * For the capabilities associated with extensions verifies that those
- * extensions are effectively present before reporting.
- */
-GLboolean GLAPIENTRY
-_mesa_IsEnabled( GLenum cap )
-{
- GET_CURRENT_CONTEXT(ctx);
- switch (cap) {
- case GL_ALPHA_TEST:
- return ctx->Color.AlphaEnabled;
- case GL_AUTO_NORMAL:
- return ctx->Eval.AutoNormal;
- case GL_BLEND:
- return ctx->Color.BlendEnabled & 1; /* return state for buffer[0] */
- case GL_CLIP_PLANE0:
- case GL_CLIP_PLANE1:
- case GL_CLIP_PLANE2:
- case GL_CLIP_PLANE3:
- case GL_CLIP_PLANE4:
- case GL_CLIP_PLANE5:
- return (ctx->Transform.ClipPlanesEnabled >> (cap - GL_CLIP_PLANE0)) & 1;
- case GL_COLOR_MATERIAL:
- return ctx->Light.ColorMaterialEnabled;
- case GL_CULL_FACE:
- return ctx->Polygon.CullFlag;
- case GL_DEPTH_TEST:
- return ctx->Depth.Test;
- case GL_DITHER:
- return ctx->Color.DitherFlag;
- case GL_FOG:
- return ctx->Fog.Enabled;
- case GL_LIGHTING:
- return ctx->Light.Enabled;
- case GL_LIGHT0:
- case GL_LIGHT1:
- case GL_LIGHT2:
- case GL_LIGHT3:
- case GL_LIGHT4:
- case GL_LIGHT5:
- case GL_LIGHT6:
- case GL_LIGHT7:
- return ctx->Light.Light[cap-GL_LIGHT0].Enabled;
- case GL_LINE_SMOOTH:
- return ctx->Line.SmoothFlag;
- case GL_LINE_STIPPLE:
- return ctx->Line.StippleFlag;
- case GL_INDEX_LOGIC_OP:
- return ctx->Color.IndexLogicOpEnabled;
- case GL_COLOR_LOGIC_OP:
- return ctx->Color.ColorLogicOpEnabled;
- case GL_MAP1_COLOR_4:
- return ctx->Eval.Map1Color4;
- case GL_MAP1_INDEX:
- return ctx->Eval.Map1Index;
- case GL_MAP1_NORMAL:
- return ctx->Eval.Map1Normal;
- case GL_MAP1_TEXTURE_COORD_1:
- return ctx->Eval.Map1TextureCoord1;
- case GL_MAP1_TEXTURE_COORD_2:
- return ctx->Eval.Map1TextureCoord2;
- case GL_MAP1_TEXTURE_COORD_3:
- return ctx->Eval.Map1TextureCoord3;
- case GL_MAP1_TEXTURE_COORD_4:
- return ctx->Eval.Map1TextureCoord4;
- case GL_MAP1_VERTEX_3:
- return ctx->Eval.Map1Vertex3;
- case GL_MAP1_VERTEX_4:
- return ctx->Eval.Map1Vertex4;
- case GL_MAP2_COLOR_4:
- return ctx->Eval.Map2Color4;
- case GL_MAP2_INDEX:
- return ctx->Eval.Map2Index;
- case GL_MAP2_NORMAL:
- return ctx->Eval.Map2Normal;
- case GL_MAP2_TEXTURE_COORD_1:
- return ctx->Eval.Map2TextureCoord1;
- case GL_MAP2_TEXTURE_COORD_2:
- return ctx->Eval.Map2TextureCoord2;
- case GL_MAP2_TEXTURE_COORD_3:
- return ctx->Eval.Map2TextureCoord3;
- case GL_MAP2_TEXTURE_COORD_4:
- return ctx->Eval.Map2TextureCoord4;
- case GL_MAP2_VERTEX_3:
- return ctx->Eval.Map2Vertex3;
- case GL_MAP2_VERTEX_4:
- return ctx->Eval.Map2Vertex4;
- case GL_NORMALIZE:
- return ctx->Transform.Normalize;
- case GL_POINT_SMOOTH:
- return ctx->Point.SmoothFlag;
- case GL_POLYGON_SMOOTH:
- return ctx->Polygon.SmoothFlag;
- case GL_POLYGON_STIPPLE:
- return ctx->Polygon.StippleFlag;
- case GL_POLYGON_OFFSET_POINT:
- return ctx->Polygon.OffsetPoint;
- case GL_POLYGON_OFFSET_LINE:
- return ctx->Polygon.OffsetLine;
- case GL_POLYGON_OFFSET_FILL:
- /*case GL_POLYGON_OFFSET_EXT:*/
- return ctx->Polygon.OffsetFill;
- case GL_RESCALE_NORMAL_EXT:
- return ctx->Transform.RescaleNormals;
- case GL_SCISSOR_TEST:
- return ctx->Scissor.Enabled;
- case GL_SHARED_TEXTURE_PALETTE_EXT:
- return ctx->Texture.SharedPalette;
- case GL_STENCIL_TEST:
- return ctx->Stencil.Enabled;
- case GL_TEXTURE_1D:
- return is_texture_enabled(ctx, TEXTURE_1D_BIT);
- case GL_TEXTURE_2D:
- return is_texture_enabled(ctx, TEXTURE_2D_BIT);
- case GL_TEXTURE_3D:
- return is_texture_enabled(ctx, TEXTURE_3D_BIT);
- case GL_TEXTURE_GEN_S:
- case GL_TEXTURE_GEN_T:
- case GL_TEXTURE_GEN_R:
- case GL_TEXTURE_GEN_Q:
- {
- const struct gl_texture_unit *texUnit = get_texcoord_unit(ctx);
- if (texUnit) {
- GLbitfield coordBit = S_BIT << (cap - GL_TEXTURE_GEN_S);
- return (texUnit->TexGenEnabled & coordBit) ? GL_TRUE : GL_FALSE;
- }
- }
- return GL_FALSE;
-#if FEATURE_ES1
- case GL_TEXTURE_GEN_STR_OES:
- {
- const struct gl_texture_unit *texUnit = get_texcoord_unit(ctx);
- if (texUnit) {
- return (texUnit->TexGenEnabled & STR_BITS) == STR_BITS
- ? GL_TRUE : GL_FALSE;
- }
- }
-#endif
-
- /*
- * CLIENT STATE!!!
- */
- case GL_VERTEX_ARRAY:
- return (ctx->Array.ArrayObj->Vertex.Enabled != 0);
- case GL_NORMAL_ARRAY:
- return (ctx->Array.ArrayObj->Normal.Enabled != 0);
- case GL_COLOR_ARRAY:
- return (ctx->Array.ArrayObj->Color.Enabled != 0);
- case GL_INDEX_ARRAY:
- return (ctx->Array.ArrayObj->Index.Enabled != 0);
- case GL_TEXTURE_COORD_ARRAY:
- return (ctx->Array.ArrayObj->TexCoord[ctx->Array.ActiveTexture]
- .Enabled != 0);
- case GL_EDGE_FLAG_ARRAY:
- return (ctx->Array.ArrayObj->EdgeFlag.Enabled != 0);
- case GL_FOG_COORDINATE_ARRAY_EXT:
- CHECK_EXTENSION(EXT_fog_coord);
- return (ctx->Array.ArrayObj->FogCoord.Enabled != 0);
- case GL_SECONDARY_COLOR_ARRAY_EXT:
- CHECK_EXTENSION(EXT_secondary_color);
- return (ctx->Array.ArrayObj->SecondaryColor.Enabled != 0);
-#if FEATURE_point_size_array
- case GL_POINT_SIZE_ARRAY_OES:
- return (ctx->Array.ArrayObj->PointSize.Enabled != 0);
-#endif
-
- /* GL_ARB_texture_cube_map */
- case GL_TEXTURE_CUBE_MAP_ARB:
- CHECK_EXTENSION(ARB_texture_cube_map);
- return is_texture_enabled(ctx, TEXTURE_CUBE_BIT);
-
- /* GL_EXT_secondary_color */
- case GL_COLOR_SUM_EXT:
- CHECK_EXTENSION2(EXT_secondary_color, ARB_vertex_program);
- return ctx->Fog.ColorSumEnabled;
-
- /* GL_ARB_multisample */
- case GL_MULTISAMPLE_ARB:
- return ctx->Multisample.Enabled;
- case GL_SAMPLE_ALPHA_TO_COVERAGE_ARB:
- return ctx->Multisample.SampleAlphaToCoverage;
- case GL_SAMPLE_ALPHA_TO_ONE_ARB:
- return ctx->Multisample.SampleAlphaToOne;
- case GL_SAMPLE_COVERAGE_ARB:
- return ctx->Multisample.SampleCoverage;
- case GL_SAMPLE_COVERAGE_INVERT_ARB:
- return ctx->Multisample.SampleCoverageInvert;
-
- /* GL_IBM_rasterpos_clip */
- case GL_RASTER_POSITION_UNCLIPPED_IBM:
- CHECK_EXTENSION(IBM_rasterpos_clip);
- return ctx->Transform.RasterPositionUnclipped;
-
- /* GL_NV_point_sprite */
- case GL_POINT_SPRITE_NV:
- CHECK_EXTENSION2(NV_point_sprite, ARB_point_sprite)
- return ctx->Point.PointSprite;
-
-#if FEATURE_NV_vertex_program || FEATURE_ARB_vertex_program
- case GL_VERTEX_PROGRAM_ARB:
- CHECK_EXTENSION2(ARB_vertex_program, NV_vertex_program);
- return ctx->VertexProgram.Enabled;
- case GL_VERTEX_PROGRAM_POINT_SIZE_ARB:
- CHECK_EXTENSION2(ARB_vertex_program, NV_vertex_program);
- return ctx->VertexProgram.PointSizeEnabled;
- case GL_VERTEX_PROGRAM_TWO_SIDE_ARB:
- CHECK_EXTENSION2(ARB_vertex_program, NV_vertex_program);
- return ctx->VertexProgram.TwoSideEnabled;
-#endif
-#if FEATURE_NV_vertex_program
- case GL_VERTEX_ATTRIB_ARRAY0_NV:
- case GL_VERTEX_ATTRIB_ARRAY1_NV:
- case GL_VERTEX_ATTRIB_ARRAY2_NV:
- case GL_VERTEX_ATTRIB_ARRAY3_NV:
- case GL_VERTEX_ATTRIB_ARRAY4_NV:
- case GL_VERTEX_ATTRIB_ARRAY5_NV:
- case GL_VERTEX_ATTRIB_ARRAY6_NV:
- case GL_VERTEX_ATTRIB_ARRAY7_NV:
- case GL_VERTEX_ATTRIB_ARRAY8_NV:
- case GL_VERTEX_ATTRIB_ARRAY9_NV:
- case GL_VERTEX_ATTRIB_ARRAY10_NV:
- case GL_VERTEX_ATTRIB_ARRAY11_NV:
- case GL_VERTEX_ATTRIB_ARRAY12_NV:
- case GL_VERTEX_ATTRIB_ARRAY13_NV:
- case GL_VERTEX_ATTRIB_ARRAY14_NV:
- case GL_VERTEX_ATTRIB_ARRAY15_NV:
- CHECK_EXTENSION(NV_vertex_program);
- {
- GLint n = (GLint) cap - GL_VERTEX_ATTRIB_ARRAY0_NV;
- ASSERT(n < Elements(ctx->Array.ArrayObj->VertexAttrib));
- return (ctx->Array.ArrayObj->VertexAttrib[n].Enabled != 0);
- }
- case GL_MAP1_VERTEX_ATTRIB0_4_NV:
- case GL_MAP1_VERTEX_ATTRIB1_4_NV:
- case GL_MAP1_VERTEX_ATTRIB2_4_NV:
- case GL_MAP1_VERTEX_ATTRIB3_4_NV:
- case GL_MAP1_VERTEX_ATTRIB4_4_NV:
- case GL_MAP1_VERTEX_ATTRIB5_4_NV:
- case GL_MAP1_VERTEX_ATTRIB6_4_NV:
- case GL_MAP1_VERTEX_ATTRIB7_4_NV:
- case GL_MAP1_VERTEX_ATTRIB8_4_NV:
- case GL_MAP1_VERTEX_ATTRIB9_4_NV:
- case GL_MAP1_VERTEX_ATTRIB10_4_NV:
- case GL_MAP1_VERTEX_ATTRIB11_4_NV:
- case GL_MAP1_VERTEX_ATTRIB12_4_NV:
- case GL_MAP1_VERTEX_ATTRIB13_4_NV:
- case GL_MAP1_VERTEX_ATTRIB14_4_NV:
- case GL_MAP1_VERTEX_ATTRIB15_4_NV:
- CHECK_EXTENSION(NV_vertex_program);
- {
- const GLuint map = (GLuint) (cap - GL_MAP1_VERTEX_ATTRIB0_4_NV);
- return ctx->Eval.Map1Attrib[map];
- }
- case GL_MAP2_VERTEX_ATTRIB0_4_NV:
- case GL_MAP2_VERTEX_ATTRIB1_4_NV:
- case GL_MAP2_VERTEX_ATTRIB2_4_NV:
- case GL_MAP2_VERTEX_ATTRIB3_4_NV:
- case GL_MAP2_VERTEX_ATTRIB4_4_NV:
- case GL_MAP2_VERTEX_ATTRIB5_4_NV:
- case GL_MAP2_VERTEX_ATTRIB6_4_NV:
- case GL_MAP2_VERTEX_ATTRIB7_4_NV:
- case GL_MAP2_VERTEX_ATTRIB8_4_NV:
- case GL_MAP2_VERTEX_ATTRIB9_4_NV:
- case GL_MAP2_VERTEX_ATTRIB10_4_NV:
- case GL_MAP2_VERTEX_ATTRIB11_4_NV:
- case GL_MAP2_VERTEX_ATTRIB12_4_NV:
- case GL_MAP2_VERTEX_ATTRIB13_4_NV:
- case GL_MAP2_VERTEX_ATTRIB14_4_NV:
- case GL_MAP2_VERTEX_ATTRIB15_4_NV:
- CHECK_EXTENSION(NV_vertex_program);
- {
- const GLuint map = (GLuint) (cap - GL_MAP2_VERTEX_ATTRIB0_4_NV);
- return ctx->Eval.Map2Attrib[map];
- }
-#endif /* FEATURE_NV_vertex_program */
-
-#if FEATURE_NV_fragment_program
- case GL_FRAGMENT_PROGRAM_NV:
- CHECK_EXTENSION(NV_fragment_program);
- return ctx->FragmentProgram.Enabled;
-#endif /* FEATURE_NV_fragment_program */
-
- /* GL_NV_texture_rectangle */
- case GL_TEXTURE_RECTANGLE_NV:
- CHECK_EXTENSION(NV_texture_rectangle);
- return is_texture_enabled(ctx, TEXTURE_RECT_BIT);
-
- /* GL_EXT_stencil_two_side */
- case GL_STENCIL_TEST_TWO_SIDE_EXT:
- CHECK_EXTENSION(EXT_stencil_two_side);
- return ctx->Stencil.TestTwoSide;
-
-#if FEATURE_ARB_fragment_program
- case GL_FRAGMENT_PROGRAM_ARB:
- return ctx->FragmentProgram.Enabled;
-#endif /* FEATURE_ARB_fragment_program */
-
- /* GL_EXT_depth_bounds_test */
- case GL_DEPTH_BOUNDS_TEST_EXT:
- CHECK_EXTENSION(EXT_depth_bounds_test);
- return ctx->Depth.BoundsTest;
-
- /* GL_ARB_depth_clamp */
- case GL_DEPTH_CLAMP:
- CHECK_EXTENSION(ARB_depth_clamp);
- return ctx->Transform.DepthClamp;
-
-#if FEATURE_ATI_fragment_shader
- case GL_FRAGMENT_SHADER_ATI:
- CHECK_EXTENSION(ATI_fragment_shader);
- return ctx->ATIFragmentShader.Enabled;
-#endif /* FEATURE_ATI_fragment_shader */
-
- case GL_TEXTURE_CUBE_MAP_SEAMLESS:
- CHECK_EXTENSION(ARB_seamless_cube_map);
- return ctx->Texture.CubeMapSeamless;
-
-#if FEATURE_EXT_transform_feedback
- case GL_RASTERIZER_DISCARD:
- CHECK_EXTENSION(EXT_transform_feedback);
- return ctx->TransformFeedback.RasterDiscard;
-#endif
-
- /* GL_NV_primitive_restart */
- case GL_PRIMITIVE_RESTART_NV:
- if (!ctx->Extensions.NV_primitive_restart) {
- goto invalid_enum_error;
- }
- return ctx->Array.PrimitiveRestart;
-
- /* GL 3.1 primitive restart */
- case GL_PRIMITIVE_RESTART:
- if (ctx->VersionMajor * 10 + ctx->VersionMinor < 31) {
- goto invalid_enum_error;
- }
- return ctx->Array.PrimitiveRestart;
-
- /* GL3.0 - GL_framebuffer_sRGB */
- case GL_FRAMEBUFFER_SRGB_EXT:
- CHECK_EXTENSION(EXT_framebuffer_sRGB);
- return ctx->Color.sRGBEnabled;
-
- default:
- goto invalid_enum_error;
- }
-
- return GL_FALSE;
-
-invalid_enum_error:
- _mesa_error(ctx, GL_INVALID_ENUM, "glIsEnabled(0x%x)", (int) cap);
- return GL_FALSE;
-}
+/**
+ * \file enable.c
+ * Enable/disable/query GL capabilities.
+ */
+
+/*
+ * Mesa 3-D graphics library
+ * Version: 7.0.3
+ *
+ * Copyright (C) 1999-2007 Brian Paul All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+
+#include "glheader.h"
+#include "clip.h"
+#include "context.h"
+#include "enable.h"
+#include "light.h"
+#include "simple_list.h"
+#include "mfeatures.h"
+#include "mtypes.h"
+#include "enums.h"
+#include "api_arrayelt.h"
+#include "texstate.h"
+
+
+
+#define CHECK_EXTENSION(EXTNAME, CAP) \
+ if (!ctx->Extensions.EXTNAME) { \
+ goto invalid_enum_error; \
+ }
+
+
+/**
+ * Helper to enable/disable client-side state.
+ */
+static void
+client_state(struct gl_context *ctx, GLenum cap, GLboolean state)
+{
+ struct gl_array_object *arrayObj = ctx->Array.ArrayObj;
+ GLuint flag;
+ GLboolean *var;
+
+ switch (cap) {
+ case GL_VERTEX_ARRAY:
+ var = &arrayObj->Vertex.Enabled;
+ flag = _NEW_ARRAY_VERTEX;
+ break;
+ case GL_NORMAL_ARRAY:
+ var = &arrayObj->Normal.Enabled;
+ flag = _NEW_ARRAY_NORMAL;
+ break;
+ case GL_COLOR_ARRAY:
+ var = &arrayObj->Color.Enabled;
+ flag = _NEW_ARRAY_COLOR0;
+ break;
+ case GL_INDEX_ARRAY:
+ var = &arrayObj->Index.Enabled;
+ flag = _NEW_ARRAY_INDEX;
+ break;
+ case GL_TEXTURE_COORD_ARRAY:
+ var = &arrayObj->TexCoord[ctx->Array.ActiveTexture].Enabled;
+ flag = _NEW_ARRAY_TEXCOORD(ctx->Array.ActiveTexture);
+ break;
+ case GL_EDGE_FLAG_ARRAY:
+ var = &arrayObj->EdgeFlag.Enabled;
+ flag = _NEW_ARRAY_EDGEFLAG;
+ break;
+ case GL_FOG_COORDINATE_ARRAY_EXT:
+ var = &arrayObj->FogCoord.Enabled;
+ flag = _NEW_ARRAY_FOGCOORD;
+ break;
+ case GL_SECONDARY_COLOR_ARRAY_EXT:
+ var = &arrayObj->SecondaryColor.Enabled;
+ flag = _NEW_ARRAY_COLOR1;
+ break;
+
+#if FEATURE_point_size_array
+ case GL_POINT_SIZE_ARRAY_OES:
+ var = &arrayObj->PointSize.Enabled;
+ flag = _NEW_ARRAY_POINT_SIZE;
+ break;
+#endif
+
+#if FEATURE_NV_vertex_program
+ case GL_VERTEX_ATTRIB_ARRAY0_NV:
+ case GL_VERTEX_ATTRIB_ARRAY1_NV:
+ case GL_VERTEX_ATTRIB_ARRAY2_NV:
+ case GL_VERTEX_ATTRIB_ARRAY3_NV:
+ case GL_VERTEX_ATTRIB_ARRAY4_NV:
+ case GL_VERTEX_ATTRIB_ARRAY5_NV:
+ case GL_VERTEX_ATTRIB_ARRAY6_NV:
+ case GL_VERTEX_ATTRIB_ARRAY7_NV:
+ case GL_VERTEX_ATTRIB_ARRAY8_NV:
+ case GL_VERTEX_ATTRIB_ARRAY9_NV:
+ case GL_VERTEX_ATTRIB_ARRAY10_NV:
+ case GL_VERTEX_ATTRIB_ARRAY11_NV:
+ case GL_VERTEX_ATTRIB_ARRAY12_NV:
+ case GL_VERTEX_ATTRIB_ARRAY13_NV:
+ case GL_VERTEX_ATTRIB_ARRAY14_NV:
+ case GL_VERTEX_ATTRIB_ARRAY15_NV:
+ CHECK_EXTENSION(NV_vertex_program, cap);
+ {
+ GLint n = (GLint) cap - GL_VERTEX_ATTRIB_ARRAY0_NV;
+ ASSERT(n < Elements(ctx->Array.ArrayObj->VertexAttrib));
+ var = &arrayObj->VertexAttrib[n].Enabled;
+ flag = _NEW_ARRAY_ATTRIB(n);
+ }
+ break;
+#endif /* FEATURE_NV_vertex_program */
+
+ /* GL_NV_primitive_restart */
+ case GL_PRIMITIVE_RESTART_NV:
+ if (!ctx->Extensions.NV_primitive_restart) {
+ goto invalid_enum_error;
+ }
+ var = &ctx->Array.PrimitiveRestart;
+ flag = 0;
+ break;
+
+ default:
+ goto invalid_enum_error;
+ }
+
+ if (*var == state)
+ return;
+
+ FLUSH_VERTICES(ctx, _NEW_ARRAY);
+ ctx->Array.NewState |= flag;
+
+ _ae_invalidate_state(ctx, _NEW_ARRAY);
+
+ *var = state;
+
+ if (state)
+ ctx->Array.ArrayObj->_Enabled |= flag;
+ else
+ ctx->Array.ArrayObj->_Enabled &= ~flag;
+
+ if (ctx->Driver.Enable) {
+ ctx->Driver.Enable( ctx, cap, state );
+ }
+
+ return;
+
+invalid_enum_error:
+ _mesa_error(ctx, GL_INVALID_ENUM, "gl%sClientState(0x%x)",
+ state ? "Enable" : "Disable", cap);
+}
+
+
+/**
+ * Enable GL capability.
+ * \param cap state to enable/disable.
+ *
+ * Get's the current context, assures that we're outside glBegin()/glEnd() and
+ * calls client_state().
+ */
+void GLAPIENTRY
+_mesa_EnableClientState( GLenum cap )
+{
+ GET_CURRENT_CONTEXT(ctx);
+ ASSERT_OUTSIDE_BEGIN_END(ctx);
+ client_state( ctx, cap, GL_TRUE );
+}
+
+
+/**
+ * Disable GL capability.
+ * \param cap state to enable/disable.
+ *
+ * Get's the current context, assures that we're outside glBegin()/glEnd() and
+ * calls client_state().
+ */
+void GLAPIENTRY
+_mesa_DisableClientState( GLenum cap )
+{
+ GET_CURRENT_CONTEXT(ctx);
+ ASSERT_OUTSIDE_BEGIN_END(ctx);
+ client_state( ctx, cap, GL_FALSE );
+}
+
+
+#undef CHECK_EXTENSION
+#define CHECK_EXTENSION(EXTNAME, CAP) \
+ if (!ctx->Extensions.EXTNAME) { \
+ goto invalid_enum_error; \
+ }
+
+#define CHECK_EXTENSION2(EXT1, EXT2, CAP) \
+ if (!ctx->Extensions.EXT1 && !ctx->Extensions.EXT2) { \
+ goto invalid_enum_error; \
+ }
+
+
+
+/**
+ * Return pointer to current texture unit for setting/getting coordinate
+ * state.
+ * Note that we'll set GL_INVALID_OPERATION and return NULL if the active
+ * texture unit is higher than the number of supported coordinate units.
+ */
+static struct gl_texture_unit *
+get_texcoord_unit(struct gl_context *ctx)
+{
+ if (ctx->Texture.CurrentUnit >= ctx->Const.MaxTextureCoordUnits) {
+ _mesa_error(ctx, GL_INVALID_OPERATION, "glEnable/Disable(texcoord unit)");
+ return NULL;
+ }
+ else {
+ return &ctx->Texture.Unit[ctx->Texture.CurrentUnit];
+ }
+}
+
+
+/**
+ * Helper function to enable or disable a texture target.
+ * \param bit one of the TEXTURE_x_BIT values
+ * \return GL_TRUE if state is changing or GL_FALSE if no change
+ */
+static GLboolean
+enable_texture(struct gl_context *ctx, GLboolean state, GLbitfield texBit)
+{
+ struct gl_texture_unit *texUnit = _mesa_get_current_tex_unit(ctx);
+ const GLbitfield newenabled = state
+ ? (texUnit->Enabled | texBit) : (texUnit->Enabled & ~texBit);
+
+ if (texUnit->Enabled == newenabled)
+ return GL_FALSE;
+
+ FLUSH_VERTICES(ctx, _NEW_TEXTURE);
+ texUnit->Enabled = newenabled;
+ return GL_TRUE;
+}
+
+
+/**
+ * Helper function to enable or disable state.
+ *
+ * \param ctx GL context.
+ * \param cap the state to enable/disable
+ * \param state whether to enable or disable the specified capability.
+ *
+ * Updates the current context and flushes the vertices as needed. For
+ * capabilities associated with extensions it verifies that those extensions
+ * are effectivly present before updating. Notifies the driver via
+ * dd_function_table::Enable.
+ */
+void
+_mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state)
+{
+ if (MESA_VERBOSE & VERBOSE_API)
+ _mesa_debug(ctx, "%s %s (newstate is %x)\n",
+ state ? "glEnable" : "glDisable",
+ _mesa_lookup_enum_by_nr(cap),
+ ctx->NewState);
+
+ switch (cap) {
+ case GL_ALPHA_TEST:
+ if (ctx->Color.AlphaEnabled == state)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_COLOR);
+ ctx->Color.AlphaEnabled = state;
+ break;
+ case GL_AUTO_NORMAL:
+ if (ctx->Eval.AutoNormal == state)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_EVAL);
+ ctx->Eval.AutoNormal = state;
+ break;
+ case GL_BLEND:
+ {
+ GLbitfield newEnabled =
+ state * ((1 << ctx->Const.MaxDrawBuffers) - 1);
+ if (newEnabled != ctx->Color.BlendEnabled) {
+ FLUSH_VERTICES(ctx, _NEW_COLOR);
+ ctx->Color.BlendEnabled = newEnabled;
+ }
+ }
+ break;
+#if FEATURE_userclip
+ case GL_CLIP_PLANE0:
+ case GL_CLIP_PLANE1:
+ case GL_CLIP_PLANE2:
+ case GL_CLIP_PLANE3:
+ case GL_CLIP_PLANE4:
+ case GL_CLIP_PLANE5:
+ {
+ const GLuint p = cap - GL_CLIP_PLANE0;
+
+ if ((ctx->Transform.ClipPlanesEnabled & (1 << p))
+ == ((GLuint) state << p))
+ return;
+
+ FLUSH_VERTICES(ctx, _NEW_TRANSFORM);
+
+ if (state) {
+ ctx->Transform.ClipPlanesEnabled |= (1 << p);
+ _mesa_update_clip_plane(ctx, p);
+ }
+ else {
+ ctx->Transform.ClipPlanesEnabled &= ~(1 << p);
+ }
+ }
+ break;
+#endif
+ case GL_COLOR_MATERIAL:
+ if (ctx->Light.ColorMaterialEnabled == state)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_LIGHT);
+ FLUSH_CURRENT(ctx, 0);
+ ctx->Light.ColorMaterialEnabled = state;
+ if (state) {
+ _mesa_update_color_material( ctx,
+ ctx->Current.Attrib[VERT_ATTRIB_COLOR0] );
+ }
+ break;
+ case GL_CULL_FACE:
+ if (ctx->Polygon.CullFlag == state)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_POLYGON);
+ ctx->Polygon.CullFlag = state;
+ break;
+ case GL_DEPTH_TEST:
+ if (ctx->Depth.Test == state)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_DEPTH);
+ ctx->Depth.Test = state;
+ break;
+ case GL_DITHER:
+ if (ctx->Color.DitherFlag == state)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_COLOR);
+ ctx->Color.DitherFlag = state;
+ break;
+ case GL_FOG:
+ if (ctx->Fog.Enabled == state)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_FOG);
+ ctx->Fog.Enabled = state;
+ break;
+ case GL_LIGHT0:
+ case GL_LIGHT1:
+ case GL_LIGHT2:
+ case GL_LIGHT3:
+ case GL_LIGHT4:
+ case GL_LIGHT5:
+ case GL_LIGHT6:
+ case GL_LIGHT7:
+ if (ctx->Light.Light[cap-GL_LIGHT0].Enabled == state)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_LIGHT);
+ ctx->Light.Light[cap-GL_LIGHT0].Enabled = state;
+ if (state) {
+ insert_at_tail(&ctx->Light.EnabledList,
+ &ctx->Light.Light[cap-GL_LIGHT0]);
+ }
+ else {
+ remove_from_list(&ctx->Light.Light[cap-GL_LIGHT0]);
+ }
+ break;
+ case GL_LIGHTING:
+ if (ctx->Light.Enabled == state)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_LIGHT);
+ ctx->Light.Enabled = state;
+ if (ctx->Light.Enabled && ctx->Light.Model.TwoSide)
+ ctx->_TriangleCaps |= DD_TRI_LIGHT_TWOSIDE;
+ else
+ ctx->_TriangleCaps &= ~DD_TRI_LIGHT_TWOSIDE;
+ break;
+ case GL_LINE_SMOOTH:
+ if (ctx->Line.SmoothFlag == state)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_LINE);
+ ctx->Line.SmoothFlag = state;
+ ctx->_TriangleCaps ^= DD_LINE_SMOOTH;
+ break;
+ case GL_LINE_STIPPLE:
+ if (ctx->Line.StippleFlag == state)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_LINE);
+ ctx->Line.StippleFlag = state;
+ ctx->_TriangleCaps ^= DD_LINE_STIPPLE;
+ break;
+ case GL_INDEX_LOGIC_OP:
+ if (ctx->Color.IndexLogicOpEnabled == state)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_COLOR);
+ ctx->Color.IndexLogicOpEnabled = state;
+ break;
+ case GL_COLOR_LOGIC_OP:
+ if (ctx->Color.ColorLogicOpEnabled == state)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_COLOR);
+ ctx->Color.ColorLogicOpEnabled = state;
+ break;
+ case GL_MAP1_COLOR_4:
+ if (ctx->Eval.Map1Color4 == state)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_EVAL);
+ ctx->Eval.Map1Color4 = state;
+ break;
+ case GL_MAP1_INDEX:
+ if (ctx->Eval.Map1Index == state)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_EVAL);
+ ctx->Eval.Map1Index = state;
+ break;
+ case GL_MAP1_NORMAL:
+ if (ctx->Eval.Map1Normal == state)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_EVAL);
+ ctx->Eval.Map1Normal = state;
+ break;
+ case GL_MAP1_TEXTURE_COORD_1:
+ if (ctx->Eval.Map1TextureCoord1 == state)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_EVAL);
+ ctx->Eval.Map1TextureCoord1 = state;
+ break;
+ case GL_MAP1_TEXTURE_COORD_2:
+ if (ctx->Eval.Map1TextureCoord2 == state)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_EVAL);
+ ctx->Eval.Map1TextureCoord2 = state;
+ break;
+ case GL_MAP1_TEXTURE_COORD_3:
+ if (ctx->Eval.Map1TextureCoord3 == state)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_EVAL);
+ ctx->Eval.Map1TextureCoord3 = state;
+ break;
+ case GL_MAP1_TEXTURE_COORD_4:
+ if (ctx->Eval.Map1TextureCoord4 == state)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_EVAL);
+ ctx->Eval.Map1TextureCoord4 = state;
+ break;
+ case GL_MAP1_VERTEX_3:
+ if (ctx->Eval.Map1Vertex3 == state)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_EVAL);
+ ctx->Eval.Map1Vertex3 = state;
+ break;
+ case GL_MAP1_VERTEX_4:
+ if (ctx->Eval.Map1Vertex4 == state)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_EVAL);
+ ctx->Eval.Map1Vertex4 = state;
+ break;
+ case GL_MAP2_COLOR_4:
+ if (ctx->Eval.Map2Color4 == state)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_EVAL);
+ ctx->Eval.Map2Color4 = state;
+ break;
+ case GL_MAP2_INDEX:
+ if (ctx->Eval.Map2Index == state)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_EVAL);
+ ctx->Eval.Map2Index = state;
+ break;
+ case GL_MAP2_NORMAL:
+ if (ctx->Eval.Map2Normal == state)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_EVAL);
+ ctx->Eval.Map2Normal = state;
+ break;
+ case GL_MAP2_TEXTURE_COORD_1:
+ if (ctx->Eval.Map2TextureCoord1 == state)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_EVAL);
+ ctx->Eval.Map2TextureCoord1 = state;
+ break;
+ case GL_MAP2_TEXTURE_COORD_2:
+ if (ctx->Eval.Map2TextureCoord2 == state)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_EVAL);
+ ctx->Eval.Map2TextureCoord2 = state;
+ break;
+ case GL_MAP2_TEXTURE_COORD_3:
+ if (ctx->Eval.Map2TextureCoord3 == state)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_EVAL);
+ ctx->Eval.Map2TextureCoord3 = state;
+ break;
+ case GL_MAP2_TEXTURE_COORD_4:
+ if (ctx->Eval.Map2TextureCoord4 == state)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_EVAL);
+ ctx->Eval.Map2TextureCoord4 = state;
+ break;
+ case GL_MAP2_VERTEX_3:
+ if (ctx->Eval.Map2Vertex3 == state)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_EVAL);
+ ctx->Eval.Map2Vertex3 = state;
+ break;
+ case GL_MAP2_VERTEX_4:
+ if (ctx->Eval.Map2Vertex4 == state)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_EVAL);
+ ctx->Eval.Map2Vertex4 = state;
+ break;
+ case GL_NORMALIZE:
+ if (ctx->Transform.Normalize == state)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_TRANSFORM);
+ ctx->Transform.Normalize = state;
+ break;
+ case GL_POINT_SMOOTH:
+ if (ctx->Point.SmoothFlag == state)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_POINT);
+ ctx->Point.SmoothFlag = state;
+ ctx->_TriangleCaps ^= DD_POINT_SMOOTH;
+ break;
+ case GL_POLYGON_SMOOTH:
+ if (ctx->Polygon.SmoothFlag == state)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_POLYGON);
+ ctx->Polygon.SmoothFlag = state;
+ ctx->_TriangleCaps ^= DD_TRI_SMOOTH;
+ break;
+ case GL_POLYGON_STIPPLE:
+ if (ctx->Polygon.StippleFlag == state)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_POLYGON);
+ ctx->Polygon.StippleFlag = state;
+ ctx->_TriangleCaps ^= DD_TRI_STIPPLE;
+ break;
+ case GL_POLYGON_OFFSET_POINT:
+ if (ctx->Polygon.OffsetPoint == state)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_POLYGON);
+ ctx->Polygon.OffsetPoint = state;
+ break;
+ case GL_POLYGON_OFFSET_LINE:
+ if (ctx->Polygon.OffsetLine == state)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_POLYGON);
+ ctx->Polygon.OffsetLine = state;
+ break;
+ case GL_POLYGON_OFFSET_FILL:
+ /*case GL_POLYGON_OFFSET_EXT:*/
+ if (ctx->Polygon.OffsetFill == state)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_POLYGON);
+ ctx->Polygon.OffsetFill = state;
+ break;
+ case GL_RESCALE_NORMAL_EXT:
+ if (ctx->Transform.RescaleNormals == state)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_TRANSFORM);
+ ctx->Transform.RescaleNormals = state;
+ break;
+ case GL_SCISSOR_TEST:
+ if (ctx->Scissor.Enabled == state)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_SCISSOR);
+ ctx->Scissor.Enabled = state;
+ break;
+ case GL_SHARED_TEXTURE_PALETTE_EXT:
+ if (ctx->Texture.SharedPalette == state)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_TEXTURE);
+ ctx->Texture.SharedPalette = state;
+ break;
+ case GL_STENCIL_TEST:
+ if (ctx->Stencil.Enabled == state)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_STENCIL);
+ ctx->Stencil.Enabled = state;
+ break;
+ case GL_TEXTURE_1D:
+ if (!enable_texture(ctx, state, TEXTURE_1D_BIT)) {
+ return;
+ }
+ break;
+ case GL_TEXTURE_2D:
+ if (!enable_texture(ctx, state, TEXTURE_2D_BIT)) {
+ return;
+ }
+ break;
+ case GL_TEXTURE_3D:
+ if (!enable_texture(ctx, state, TEXTURE_3D_BIT)) {
+ return;
+ }
+ break;
+ case GL_TEXTURE_GEN_S:
+ case GL_TEXTURE_GEN_T:
+ case GL_TEXTURE_GEN_R:
+ case GL_TEXTURE_GEN_Q:
+ {
+ struct gl_texture_unit *texUnit = get_texcoord_unit(ctx);
+ if (texUnit) {
+ GLbitfield coordBit = S_BIT << (cap - GL_TEXTURE_GEN_S);
+ GLbitfield newenabled = texUnit->TexGenEnabled & ~coordBit;
+ if (state)
+ newenabled |= coordBit;
+ if (texUnit->TexGenEnabled == newenabled)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_TEXTURE);
+ texUnit->TexGenEnabled = newenabled;
+ }
+ }
+ break;
+
+#if FEATURE_ES1
+ case GL_TEXTURE_GEN_STR_OES:
+ /* disable S, T, and R at the same time */
+ {
+ struct gl_texture_unit *texUnit = get_texcoord_unit(ctx);
+ if (texUnit) {
+ GLuint newenabled =
+ texUnit->TexGenEnabled & ~STR_BITS;
+ if (state)
+ newenabled |= STR_BITS;
+ if (texUnit->TexGenEnabled == newenabled)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_TEXTURE);
+ texUnit->TexGenEnabled = newenabled;
+ }
+ }
+ break;
+#endif
+
+ /*
+ * CLIENT STATE!!!
+ */
+ case GL_VERTEX_ARRAY:
+ case GL_NORMAL_ARRAY:
+ case GL_COLOR_ARRAY:
+ case GL_INDEX_ARRAY:
+ case GL_TEXTURE_COORD_ARRAY:
+ case GL_EDGE_FLAG_ARRAY:
+ case GL_FOG_COORDINATE_ARRAY_EXT:
+ case GL_SECONDARY_COLOR_ARRAY_EXT:
+ case GL_POINT_SIZE_ARRAY_OES:
+ client_state( ctx, cap, state );
+ return;
+
+ /* GL_ARB_texture_cube_map */
+ case GL_TEXTURE_CUBE_MAP_ARB:
+ CHECK_EXTENSION(ARB_texture_cube_map, cap);
+ if (!enable_texture(ctx, state, TEXTURE_CUBE_BIT)) {
+ return;
+ }
+ break;
+
+ /* GL_EXT_secondary_color */
+ case GL_COLOR_SUM_EXT:
+ CHECK_EXTENSION2(EXT_secondary_color, ARB_vertex_program, cap);
+ if (ctx->Fog.ColorSumEnabled == state)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_FOG);
+ ctx->Fog.ColorSumEnabled = state;
+ break;
+
+ /* GL_ARB_multisample */
+ case GL_MULTISAMPLE_ARB:
+ if (ctx->Multisample.Enabled == state)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_MULTISAMPLE);
+ ctx->Multisample.Enabled = state;
+ break;
+ case GL_SAMPLE_ALPHA_TO_COVERAGE_ARB:
+ if (ctx->Multisample.SampleAlphaToCoverage == state)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_MULTISAMPLE);
+ ctx->Multisample.SampleAlphaToCoverage = state;
+ break;
+ case GL_SAMPLE_ALPHA_TO_ONE_ARB:
+ if (ctx->Multisample.SampleAlphaToOne == state)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_MULTISAMPLE);
+ ctx->Multisample.SampleAlphaToOne = state;
+ break;
+ case GL_SAMPLE_COVERAGE_ARB:
+ if (ctx->Multisample.SampleCoverage == state)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_MULTISAMPLE);
+ ctx->Multisample.SampleCoverage = state;
+ break;
+ case GL_SAMPLE_COVERAGE_INVERT_ARB:
+ if (ctx->Multisample.SampleCoverageInvert == state)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_MULTISAMPLE);
+ ctx->Multisample.SampleCoverageInvert = state;
+ break;
+
+ /* GL_IBM_rasterpos_clip */
+ case GL_RASTER_POSITION_UNCLIPPED_IBM:
+ CHECK_EXTENSION(IBM_rasterpos_clip, cap);
+ if (ctx->Transform.RasterPositionUnclipped == state)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_TRANSFORM);
+ ctx->Transform.RasterPositionUnclipped = state;
+ break;
+
+ /* GL_NV_point_sprite */
+ case GL_POINT_SPRITE_NV:
+ CHECK_EXTENSION2(NV_point_sprite, ARB_point_sprite, cap);
+ if (ctx->Point.PointSprite == state)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_POINT);
+ ctx->Point.PointSprite = state;
+ break;
+
+#if FEATURE_NV_vertex_program || FEATURE_ARB_vertex_program
+ case GL_VERTEX_PROGRAM_ARB:
+ CHECK_EXTENSION2(ARB_vertex_program, NV_vertex_program, cap);
+ if (ctx->VertexProgram.Enabled == state)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_PROGRAM);
+ ctx->VertexProgram.Enabled = state;
+ break;
+ case GL_VERTEX_PROGRAM_POINT_SIZE_ARB:
+ CHECK_EXTENSION2(ARB_vertex_program, NV_vertex_program, cap);
+ if (ctx->VertexProgram.PointSizeEnabled == state)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_PROGRAM);
+ ctx->VertexProgram.PointSizeEnabled = state;
+ break;
+ case GL_VERTEX_PROGRAM_TWO_SIDE_ARB:
+ CHECK_EXTENSION2(ARB_vertex_program, NV_vertex_program, cap);
+ if (ctx->VertexProgram.TwoSideEnabled == state)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_PROGRAM);
+ ctx->VertexProgram.TwoSideEnabled = state;
+ break;
+#endif
+#if FEATURE_NV_vertex_program
+ case GL_MAP1_VERTEX_ATTRIB0_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB1_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB2_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB3_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB4_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB5_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB6_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB7_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB8_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB9_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB10_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB11_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB12_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB13_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB14_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB15_4_NV:
+ CHECK_EXTENSION(NV_vertex_program, cap);
+ {
+ const GLuint map = (GLuint) (cap - GL_MAP1_VERTEX_ATTRIB0_4_NV);
+ FLUSH_VERTICES(ctx, _NEW_EVAL);
+ ctx->Eval.Map1Attrib[map] = state;
+ }
+ break;
+ case GL_MAP2_VERTEX_ATTRIB0_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB1_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB2_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB3_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB4_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB5_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB6_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB7_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB8_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB9_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB10_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB11_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB12_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB13_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB14_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB15_4_NV:
+ CHECK_EXTENSION(NV_vertex_program, cap);
+ {
+ const GLuint map = (GLuint) (cap - GL_MAP2_VERTEX_ATTRIB0_4_NV);
+ FLUSH_VERTICES(ctx, _NEW_EVAL);
+ ctx->Eval.Map2Attrib[map] = state;
+ }
+ break;
+#endif /* FEATURE_NV_vertex_program */
+
+#if FEATURE_NV_fragment_program
+ case GL_FRAGMENT_PROGRAM_NV:
+ CHECK_EXTENSION(NV_fragment_program, cap);
+ if (ctx->FragmentProgram.Enabled == state)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_PROGRAM);
+ ctx->FragmentProgram.Enabled = state;
+ break;
+#endif /* FEATURE_NV_fragment_program */
+
+ /* GL_NV_texture_rectangle */
+ case GL_TEXTURE_RECTANGLE_NV:
+ CHECK_EXTENSION(NV_texture_rectangle, cap);
+ if (!enable_texture(ctx, state, TEXTURE_RECT_BIT)) {
+ return;
+ }
+ break;
+
+ /* GL_EXT_stencil_two_side */
+ case GL_STENCIL_TEST_TWO_SIDE_EXT:
+ CHECK_EXTENSION(EXT_stencil_two_side, cap);
+ if (ctx->Stencil.TestTwoSide == state)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_STENCIL);
+ ctx->Stencil.TestTwoSide = state;
+ if (state) {
+ ctx->Stencil._BackFace = 2;
+ ctx->_TriangleCaps |= DD_TRI_TWOSTENCIL;
+ } else {
+ ctx->Stencil._BackFace = 1;
+ ctx->_TriangleCaps &= ~DD_TRI_TWOSTENCIL;
+ }
+ break;
+
+#if FEATURE_ARB_fragment_program
+ case GL_FRAGMENT_PROGRAM_ARB:
+ CHECK_EXTENSION(ARB_fragment_program, cap);
+ if (ctx->FragmentProgram.Enabled == state)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_PROGRAM);
+ ctx->FragmentProgram.Enabled = state;
+ break;
+#endif /* FEATURE_ARB_fragment_program */
+
+ /* GL_EXT_depth_bounds_test */
+ case GL_DEPTH_BOUNDS_TEST_EXT:
+ CHECK_EXTENSION(EXT_depth_bounds_test, cap);
+ if (ctx->Depth.BoundsTest == state)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_DEPTH);
+ ctx->Depth.BoundsTest = state;
+ break;
+
+ case GL_DEPTH_CLAMP:
+ if (ctx->Transform.DepthClamp == state)
+ return;
+ CHECK_EXTENSION(ARB_depth_clamp, cap);
+ FLUSH_VERTICES(ctx, _NEW_TRANSFORM);
+ ctx->Transform.DepthClamp = state;
+ break;
+
+#if FEATURE_ATI_fragment_shader
+ case GL_FRAGMENT_SHADER_ATI:
+ CHECK_EXTENSION(ATI_fragment_shader, cap);
+ if (ctx->ATIFragmentShader.Enabled == state)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_PROGRAM);
+ ctx->ATIFragmentShader.Enabled = state;
+ break;
+#endif
+
+ /* GL_MESA_texture_array */
+ case GL_TEXTURE_1D_ARRAY_EXT:
+ CHECK_EXTENSION(MESA_texture_array, cap);
+ if (!enable_texture(ctx, state, TEXTURE_1D_ARRAY_BIT)) {
+ return;
+ }
+ break;
+
+ case GL_TEXTURE_2D_ARRAY_EXT:
+ CHECK_EXTENSION(MESA_texture_array, cap);
+ if (!enable_texture(ctx, state, TEXTURE_2D_ARRAY_BIT)) {
+ return;
+ }
+ break;
+
+ case GL_TEXTURE_CUBE_MAP_SEAMLESS:
+ CHECK_EXTENSION(ARB_seamless_cube_map, cap);
+ if (ctx->Texture.CubeMapSeamless != state) {
+ FLUSH_VERTICES(ctx, _NEW_TEXTURE);
+ ctx->Texture.CubeMapSeamless = state;
+ }
+ break;
+
+#if FEATURE_EXT_transform_feedback
+ case GL_RASTERIZER_DISCARD:
+ CHECK_EXTENSION(EXT_transform_feedback, cap);
+ if (ctx->TransformFeedback.RasterDiscard != state) {
+ FLUSH_VERTICES(ctx, _NEW_TRANSFORM);
+ ctx->TransformFeedback.RasterDiscard = state;
+ }
+ break;
+#endif
+
+ /* GL 3.1 primitive restart. Note: this enum is different from
+ * GL_PRIMITIVE_RESTART_NV (which is client state).
+ */
+ case GL_PRIMITIVE_RESTART:
+ if (ctx->VersionMajor * 10 + ctx->VersionMinor < 31) {
+ goto invalid_enum_error;
+ }
+ if (ctx->Array.PrimitiveRestart != state) {
+ FLUSH_VERTICES(ctx, _NEW_TRANSFORM);
+ ctx->Array.PrimitiveRestart = state;
+ }
+ break;
+
+ /* GL3.0 - GL_framebuffer_sRGB */
+ case GL_FRAMEBUFFER_SRGB_EXT:
+ CHECK_EXTENSION(EXT_framebuffer_sRGB, cap);
+ FLUSH_VERTICES(ctx, _NEW_BUFFERS);
+ ctx->Color.sRGBEnabled = state;
+ break;
+
+ default:
+ goto invalid_enum_error;
+ }
+
+ if (ctx->Driver.Enable) {
+ ctx->Driver.Enable( ctx, cap, state );
+ }
+
+ return;
+
+invalid_enum_error:
+ _mesa_error(ctx, GL_INVALID_ENUM, "gl%s(0x%x)",
+ state ? "Enable" : "Disable", cap);
+}
+
+
+/**
+ * Enable GL capability. Called by glEnable()
+ * \param cap state to enable.
+ */
+void GLAPIENTRY
+_mesa_Enable( GLenum cap )
+{
+ GET_CURRENT_CONTEXT(ctx);
+ ASSERT_OUTSIDE_BEGIN_END(ctx);
+
+ _mesa_set_enable( ctx, cap, GL_TRUE );
+}
+
+
+/**
+ * Disable GL capability. Called by glDisable()
+ * \param cap state to disable.
+ */
+void GLAPIENTRY
+_mesa_Disable( GLenum cap )
+{
+ GET_CURRENT_CONTEXT(ctx);
+ ASSERT_OUTSIDE_BEGIN_END(ctx);
+
+ _mesa_set_enable( ctx, cap, GL_FALSE );
+}
+
+
+
+/**
+ * Enable/disable an indexed state var.
+ */
+void
+_mesa_set_enablei(struct gl_context *ctx, GLenum cap,
+ GLuint index, GLboolean state)
+{
+ ASSERT(state == 0 || state == 1);
+ switch (cap) {
+ case GL_BLEND:
+ if (!ctx->Extensions.EXT_draw_buffers2) {
+ goto invalid_enum_error;
+ }
+ if (index >= ctx->Const.MaxDrawBuffers) {
+ _mesa_error(ctx, GL_INVALID_VALUE, "%s(index=%u)",
+ state ? "glEnableIndexed" : "glDisableIndexed", index);
+ return;
+ }
+ if (((ctx->Color.BlendEnabled >> index) & 1) != state) {
+ FLUSH_VERTICES(ctx, _NEW_COLOR);
+ if (state)
+ ctx->Color.BlendEnabled |= (1 << index);
+ else
+ ctx->Color.BlendEnabled &= ~(1 << index);
+ }
+ break;
+ default:
+ goto invalid_enum_error;
+ }
+ return;
+
+invalid_enum_error:
+ _mesa_error(ctx, GL_INVALID_ENUM, "%s(cap=%s)",
+ state ? "glEnablei" : "glDisablei",
+ _mesa_lookup_enum_by_nr(cap));
+}
+
+
+void GLAPIENTRY
+_mesa_DisableIndexed( GLenum cap, GLuint index )
+{
+ GET_CURRENT_CONTEXT(ctx);
+ ASSERT_OUTSIDE_BEGIN_END(ctx);
+ _mesa_set_enablei(ctx, cap, index, GL_FALSE);
+}
+
+
+void GLAPIENTRY
+_mesa_EnableIndexed( GLenum cap, GLuint index )
+{
+ GET_CURRENT_CONTEXT(ctx);
+ ASSERT_OUTSIDE_BEGIN_END(ctx);
+ _mesa_set_enablei(ctx, cap, index, GL_TRUE);
+}
+
+
+GLboolean GLAPIENTRY
+_mesa_IsEnabledIndexed( GLenum cap, GLuint index )
+{
+ GET_CURRENT_CONTEXT(ctx);
+ switch (cap) {
+ case GL_BLEND:
+ if (index >= ctx->Const.MaxDrawBuffers) {
+ _mesa_error(ctx, GL_INVALID_VALUE, "glIsEnabledIndexed(index=%u)",
+ index);
+ return GL_FALSE;
+ }
+ return (ctx->Color.BlendEnabled >> index) & 1;
+ default:
+ _mesa_error(ctx, GL_INVALID_ENUM, "glIsEnabledIndexed(cap=%s)",
+ _mesa_lookup_enum_by_nr(cap));
+ return GL_FALSE;
+ }
+}
+
+
+
+
+#undef CHECK_EXTENSION
+#define CHECK_EXTENSION(EXTNAME) \
+ if (!ctx->Extensions.EXTNAME) { \
+ goto invalid_enum_error; \
+ }
+
+#undef CHECK_EXTENSION2
+#define CHECK_EXTENSION2(EXT1, EXT2) \
+ if (!ctx->Extensions.EXT1 && !ctx->Extensions.EXT2) { \
+ goto invalid_enum_error; \
+ }
+
+
+/**
+ * Helper function to determine whether a texture target is enabled.
+ */
+static GLboolean
+is_texture_enabled(struct gl_context *ctx, GLbitfield bit)
+{
+ const struct gl_texture_unit *const texUnit =
+ &ctx->Texture.Unit[ctx->Texture.CurrentUnit];
+ return (texUnit->Enabled & bit) ? GL_TRUE : GL_FALSE;
+}
+
+
+/**
+ * Return simple enable/disable state.
+ *
+ * \param cap state variable to query.
+ *
+ * Returns the state of the specified capability from the current GL context.
+ * For the capabilities associated with extensions verifies that those
+ * extensions are effectively present before reporting.
+ */
+GLboolean GLAPIENTRY
+_mesa_IsEnabled( GLenum cap )
+{
+ GET_CURRENT_CONTEXT(ctx);
+ switch (cap) {
+ case GL_ALPHA_TEST:
+ return ctx->Color.AlphaEnabled;
+ case GL_AUTO_NORMAL:
+ return ctx->Eval.AutoNormal;
+ case GL_BLEND:
+ return ctx->Color.BlendEnabled & 1; /* return state for buffer[0] */
+ case GL_CLIP_PLANE0:
+ case GL_CLIP_PLANE1:
+ case GL_CLIP_PLANE2:
+ case GL_CLIP_PLANE3:
+ case GL_CLIP_PLANE4:
+ case GL_CLIP_PLANE5:
+ return (ctx->Transform.ClipPlanesEnabled >> (cap - GL_CLIP_PLANE0)) & 1;
+ case GL_COLOR_MATERIAL:
+ return ctx->Light.ColorMaterialEnabled;
+ case GL_CULL_FACE:
+ return ctx->Polygon.CullFlag;
+ case GL_DEPTH_TEST:
+ return ctx->Depth.Test;
+ case GL_DITHER:
+ return ctx->Color.DitherFlag;
+ case GL_FOG:
+ return ctx->Fog.Enabled;
+ case GL_LIGHTING:
+ return ctx->Light.Enabled;
+ case GL_LIGHT0:
+ case GL_LIGHT1:
+ case GL_LIGHT2:
+ case GL_LIGHT3:
+ case GL_LIGHT4:
+ case GL_LIGHT5:
+ case GL_LIGHT6:
+ case GL_LIGHT7:
+ return ctx->Light.Light[cap-GL_LIGHT0].Enabled;
+ case GL_LINE_SMOOTH:
+ return ctx->Line.SmoothFlag;
+ case GL_LINE_STIPPLE:
+ return ctx->Line.StippleFlag;
+ case GL_INDEX_LOGIC_OP:
+ return ctx->Color.IndexLogicOpEnabled;
+ case GL_COLOR_LOGIC_OP:
+ return ctx->Color.ColorLogicOpEnabled;
+ case GL_MAP1_COLOR_4:
+ return ctx->Eval.Map1Color4;
+ case GL_MAP1_INDEX:
+ return ctx->Eval.Map1Index;
+ case GL_MAP1_NORMAL:
+ return ctx->Eval.Map1Normal;
+ case GL_MAP1_TEXTURE_COORD_1:
+ return ctx->Eval.Map1TextureCoord1;
+ case GL_MAP1_TEXTURE_COORD_2:
+ return ctx->Eval.Map1TextureCoord2;
+ case GL_MAP1_TEXTURE_COORD_3:
+ return ctx->Eval.Map1TextureCoord3;
+ case GL_MAP1_TEXTURE_COORD_4:
+ return ctx->Eval.Map1TextureCoord4;
+ case GL_MAP1_VERTEX_3:
+ return ctx->Eval.Map1Vertex3;
+ case GL_MAP1_VERTEX_4:
+ return ctx->Eval.Map1Vertex4;
+ case GL_MAP2_COLOR_4:
+ return ctx->Eval.Map2Color4;
+ case GL_MAP2_INDEX:
+ return ctx->Eval.Map2Index;
+ case GL_MAP2_NORMAL:
+ return ctx->Eval.Map2Normal;
+ case GL_MAP2_TEXTURE_COORD_1:
+ return ctx->Eval.Map2TextureCoord1;
+ case GL_MAP2_TEXTURE_COORD_2:
+ return ctx->Eval.Map2TextureCoord2;
+ case GL_MAP2_TEXTURE_COORD_3:
+ return ctx->Eval.Map2TextureCoord3;
+ case GL_MAP2_TEXTURE_COORD_4:
+ return ctx->Eval.Map2TextureCoord4;
+ case GL_MAP2_VERTEX_3:
+ return ctx->Eval.Map2Vertex3;
+ case GL_MAP2_VERTEX_4:
+ return ctx->Eval.Map2Vertex4;
+ case GL_NORMALIZE:
+ return ctx->Transform.Normalize;
+ case GL_POINT_SMOOTH:
+ return ctx->Point.SmoothFlag;
+ case GL_POLYGON_SMOOTH:
+ return ctx->Polygon.SmoothFlag;
+ case GL_POLYGON_STIPPLE:
+ return ctx->Polygon.StippleFlag;
+ case GL_POLYGON_OFFSET_POINT:
+ return ctx->Polygon.OffsetPoint;
+ case GL_POLYGON_OFFSET_LINE:
+ return ctx->Polygon.OffsetLine;
+ case GL_POLYGON_OFFSET_FILL:
+ /*case GL_POLYGON_OFFSET_EXT:*/
+ return ctx->Polygon.OffsetFill;
+ case GL_RESCALE_NORMAL_EXT:
+ return ctx->Transform.RescaleNormals;
+ case GL_SCISSOR_TEST:
+ return ctx->Scissor.Enabled;
+ case GL_SHARED_TEXTURE_PALETTE_EXT:
+ return ctx->Texture.SharedPalette;
+ case GL_STENCIL_TEST:
+ return ctx->Stencil.Enabled;
+ case GL_TEXTURE_1D:
+ return is_texture_enabled(ctx, TEXTURE_1D_BIT);
+ case GL_TEXTURE_2D:
+ return is_texture_enabled(ctx, TEXTURE_2D_BIT);
+ case GL_TEXTURE_3D:
+ return is_texture_enabled(ctx, TEXTURE_3D_BIT);
+ case GL_TEXTURE_GEN_S:
+ case GL_TEXTURE_GEN_T:
+ case GL_TEXTURE_GEN_R:
+ case GL_TEXTURE_GEN_Q:
+ {
+ const struct gl_texture_unit *texUnit = get_texcoord_unit(ctx);
+ if (texUnit) {
+ GLbitfield coordBit = S_BIT << (cap - GL_TEXTURE_GEN_S);
+ return (texUnit->TexGenEnabled & coordBit) ? GL_TRUE : GL_FALSE;
+ }
+ }
+ return GL_FALSE;
+#if FEATURE_ES1
+ case GL_TEXTURE_GEN_STR_OES:
+ {
+ const struct gl_texture_unit *texUnit = get_texcoord_unit(ctx);
+ if (texUnit) {
+ return (texUnit->TexGenEnabled & STR_BITS) == STR_BITS
+ ? GL_TRUE : GL_FALSE;
+ }
+ }
+#endif
+
+ /*
+ * CLIENT STATE!!!
+ */
+ case GL_VERTEX_ARRAY:
+ return (ctx->Array.ArrayObj->Vertex.Enabled != 0);
+ case GL_NORMAL_ARRAY:
+ return (ctx->Array.ArrayObj->Normal.Enabled != 0);
+ case GL_COLOR_ARRAY:
+ return (ctx->Array.ArrayObj->Color.Enabled != 0);
+ case GL_INDEX_ARRAY:
+ return (ctx->Array.ArrayObj->Index.Enabled != 0);
+ case GL_TEXTURE_COORD_ARRAY:
+ return (ctx->Array.ArrayObj->TexCoord[ctx->Array.ActiveTexture]
+ .Enabled != 0);
+ case GL_EDGE_FLAG_ARRAY:
+ return (ctx->Array.ArrayObj->EdgeFlag.Enabled != 0);
+ case GL_FOG_COORDINATE_ARRAY_EXT:
+ CHECK_EXTENSION(EXT_fog_coord);
+ return (ctx->Array.ArrayObj->FogCoord.Enabled != 0);
+ case GL_SECONDARY_COLOR_ARRAY_EXT:
+ CHECK_EXTENSION(EXT_secondary_color);
+ return (ctx->Array.ArrayObj->SecondaryColor.Enabled != 0);
+#if FEATURE_point_size_array
+ case GL_POINT_SIZE_ARRAY_OES:
+ return (ctx->Array.ArrayObj->PointSize.Enabled != 0);
+#endif
+
+ /* GL_ARB_texture_cube_map */
+ case GL_TEXTURE_CUBE_MAP_ARB:
+ CHECK_EXTENSION(ARB_texture_cube_map);
+ return is_texture_enabled(ctx, TEXTURE_CUBE_BIT);
+
+ /* GL_EXT_secondary_color */
+ case GL_COLOR_SUM_EXT:
+ CHECK_EXTENSION2(EXT_secondary_color, ARB_vertex_program);
+ return ctx->Fog.ColorSumEnabled;
+
+ /* GL_ARB_multisample */
+ case GL_MULTISAMPLE_ARB:
+ return ctx->Multisample.Enabled;
+ case GL_SAMPLE_ALPHA_TO_COVERAGE_ARB:
+ return ctx->Multisample.SampleAlphaToCoverage;
+ case GL_SAMPLE_ALPHA_TO_ONE_ARB:
+ return ctx->Multisample.SampleAlphaToOne;
+ case GL_SAMPLE_COVERAGE_ARB:
+ return ctx->Multisample.SampleCoverage;
+ case GL_SAMPLE_COVERAGE_INVERT_ARB:
+ return ctx->Multisample.SampleCoverageInvert;
+
+ /* GL_IBM_rasterpos_clip */
+ case GL_RASTER_POSITION_UNCLIPPED_IBM:
+ CHECK_EXTENSION(IBM_rasterpos_clip);
+ return ctx->Transform.RasterPositionUnclipped;
+
+ /* GL_NV_point_sprite */
+ case GL_POINT_SPRITE_NV:
+ CHECK_EXTENSION2(NV_point_sprite, ARB_point_sprite)
+ return ctx->Point.PointSprite;
+
+#if FEATURE_NV_vertex_program || FEATURE_ARB_vertex_program
+ case GL_VERTEX_PROGRAM_ARB:
+ CHECK_EXTENSION2(ARB_vertex_program, NV_vertex_program);
+ return ctx->VertexProgram.Enabled;
+ case GL_VERTEX_PROGRAM_POINT_SIZE_ARB:
+ CHECK_EXTENSION2(ARB_vertex_program, NV_vertex_program);
+ return ctx->VertexProgram.PointSizeEnabled;
+ case GL_VERTEX_PROGRAM_TWO_SIDE_ARB:
+ CHECK_EXTENSION2(ARB_vertex_program, NV_vertex_program);
+ return ctx->VertexProgram.TwoSideEnabled;
+#endif
+#if FEATURE_NV_vertex_program
+ case GL_VERTEX_ATTRIB_ARRAY0_NV:
+ case GL_VERTEX_ATTRIB_ARRAY1_NV:
+ case GL_VERTEX_ATTRIB_ARRAY2_NV:
+ case GL_VERTEX_ATTRIB_ARRAY3_NV:
+ case GL_VERTEX_ATTRIB_ARRAY4_NV:
+ case GL_VERTEX_ATTRIB_ARRAY5_NV:
+ case GL_VERTEX_ATTRIB_ARRAY6_NV:
+ case GL_VERTEX_ATTRIB_ARRAY7_NV:
+ case GL_VERTEX_ATTRIB_ARRAY8_NV:
+ case GL_VERTEX_ATTRIB_ARRAY9_NV:
+ case GL_VERTEX_ATTRIB_ARRAY10_NV:
+ case GL_VERTEX_ATTRIB_ARRAY11_NV:
+ case GL_VERTEX_ATTRIB_ARRAY12_NV:
+ case GL_VERTEX_ATTRIB_ARRAY13_NV:
+ case GL_VERTEX_ATTRIB_ARRAY14_NV:
+ case GL_VERTEX_ATTRIB_ARRAY15_NV:
+ CHECK_EXTENSION(NV_vertex_program);
+ {
+ GLint n = (GLint) cap - GL_VERTEX_ATTRIB_ARRAY0_NV;
+ ASSERT(n < Elements(ctx->Array.ArrayObj->VertexAttrib));
+ return (ctx->Array.ArrayObj->VertexAttrib[n].Enabled != 0);
+ }
+ case GL_MAP1_VERTEX_ATTRIB0_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB1_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB2_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB3_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB4_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB5_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB6_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB7_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB8_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB9_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB10_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB11_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB12_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB13_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB14_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB15_4_NV:
+ CHECK_EXTENSION(NV_vertex_program);
+ {
+ const GLuint map = (GLuint) (cap - GL_MAP1_VERTEX_ATTRIB0_4_NV);
+ return ctx->Eval.Map1Attrib[map];
+ }
+ case GL_MAP2_VERTEX_ATTRIB0_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB1_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB2_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB3_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB4_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB5_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB6_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB7_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB8_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB9_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB10_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB11_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB12_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB13_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB14_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB15_4_NV:
+ CHECK_EXTENSION(NV_vertex_program);
+ {
+ const GLuint map = (GLuint) (cap - GL_MAP2_VERTEX_ATTRIB0_4_NV);
+ return ctx->Eval.Map2Attrib[map];
+ }
+#endif /* FEATURE_NV_vertex_program */
+
+#if FEATURE_NV_fragment_program
+ case GL_FRAGMENT_PROGRAM_NV:
+ CHECK_EXTENSION(NV_fragment_program);
+ return ctx->FragmentProgram.Enabled;
+#endif /* FEATURE_NV_fragment_program */
+
+ /* GL_NV_texture_rectangle */
+ case GL_TEXTURE_RECTANGLE_NV:
+ CHECK_EXTENSION(NV_texture_rectangle);
+ return is_texture_enabled(ctx, TEXTURE_RECT_BIT);
+
+ /* GL_EXT_stencil_two_side */
+ case GL_STENCIL_TEST_TWO_SIDE_EXT:
+ CHECK_EXTENSION(EXT_stencil_two_side);
+ return ctx->Stencil.TestTwoSide;
+
+#if FEATURE_ARB_fragment_program
+ case GL_FRAGMENT_PROGRAM_ARB:
+ return ctx->FragmentProgram.Enabled;
+#endif /* FEATURE_ARB_fragment_program */
+
+ /* GL_EXT_depth_bounds_test */
+ case GL_DEPTH_BOUNDS_TEST_EXT:
+ CHECK_EXTENSION(EXT_depth_bounds_test);
+ return ctx->Depth.BoundsTest;
+
+ /* GL_ARB_depth_clamp */
+ case GL_DEPTH_CLAMP:
+ CHECK_EXTENSION(ARB_depth_clamp);
+ return ctx->Transform.DepthClamp;
+
+#if FEATURE_ATI_fragment_shader
+ case GL_FRAGMENT_SHADER_ATI:
+ CHECK_EXTENSION(ATI_fragment_shader);
+ return ctx->ATIFragmentShader.Enabled;
+#endif /* FEATURE_ATI_fragment_shader */
+
+ case GL_TEXTURE_CUBE_MAP_SEAMLESS:
+ CHECK_EXTENSION(ARB_seamless_cube_map);
+ return ctx->Texture.CubeMapSeamless;
+
+#if FEATURE_EXT_transform_feedback
+ case GL_RASTERIZER_DISCARD:
+ CHECK_EXTENSION(EXT_transform_feedback);
+ return ctx->TransformFeedback.RasterDiscard;
+#endif
+
+ /* GL_NV_primitive_restart */
+ case GL_PRIMITIVE_RESTART_NV:
+ if (!ctx->Extensions.NV_primitive_restart) {
+ goto invalid_enum_error;
+ }
+ return ctx->Array.PrimitiveRestart;
+
+ /* GL 3.1 primitive restart */
+ case GL_PRIMITIVE_RESTART:
+ if (ctx->VersionMajor * 10 + ctx->VersionMinor < 31) {
+ goto invalid_enum_error;
+ }
+ return ctx->Array.PrimitiveRestart;
+
+ /* GL3.0 - GL_framebuffer_sRGB */
+ case GL_FRAMEBUFFER_SRGB_EXT:
+ CHECK_EXTENSION(EXT_framebuffer_sRGB);
+ return ctx->Color.sRGBEnabled;
+
+ default:
+ goto invalid_enum_error;
+ }
+
+ return GL_FALSE;
+
+invalid_enum_error:
+ _mesa_error(ctx, GL_INVALID_ENUM, "glIsEnabled(0x%x)", (int) cap);
+ return GL_FALSE;
+}
diff --git a/mesalib/src/mesa/main/enums.c b/mesalib/src/mesa/main/enums.c
index 8a50e2656..34b102e27 100644
--- a/mesalib/src/mesa/main/enums.c
+++ b/mesalib/src/mesa/main/enums.c
@@ -1,6340 +1,6340 @@
-/* DO NOT EDIT - This file generated automatically by gl_enums.py (from Mesa) script */
-
-/*
- * Copyright (C) 1999-2005 Brian Paul All Rights Reserved.
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sub license,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL,
- * AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
- * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-#include "main/glheader.h"
-#include "main/mfeatures.h"
-#include "main/enums.h"
-#include "main/imports.h"
-#include "main/mtypes.h"
-
-typedef struct {
- size_t offset;
- int n;
-} enum_elt;
-
-LONGSTRING static const char enum_string_table[] =
- "GL_2D\0"
- "GL_2_BYTES\0"
- "GL_3D\0"
- "GL_3D_COLOR\0"
- "GL_3D_COLOR_TEXTURE\0"
- "GL_3_BYTES\0"
- "GL_4D_COLOR_TEXTURE\0"
- "GL_4_BYTES\0"
- "GL_ACCUM\0"
- "GL_ACCUM_ALPHA_BITS\0"
- "GL_ACCUM_BLUE_BITS\0"
- "GL_ACCUM_BUFFER_BIT\0"
- "GL_ACCUM_CLEAR_VALUE\0"
- "GL_ACCUM_GREEN_BITS\0"
- "GL_ACCUM_RED_BITS\0"
- "GL_ACTIVE_ATTRIBUTES\0"
- "GL_ACTIVE_ATTRIBUTE_MAX_LENGTH\0"
- "GL_ACTIVE_PROGRAM_EXT\0"
- "GL_ACTIVE_STENCIL_FACE_EXT\0"
- "GL_ACTIVE_TEXTURE\0"
- "GL_ACTIVE_TEXTURE_ARB\0"
- "GL_ACTIVE_UNIFORMS\0"
- "GL_ACTIVE_UNIFORM_MAX_LENGTH\0"
- "GL_ACTIVE_VERTEX_UNITS_ARB\0"
- "GL_ADD\0"
- "GL_ADD_SIGNED\0"
- "GL_ADD_SIGNED_ARB\0"
- "GL_ADD_SIGNED_EXT\0"
- "GL_ALIASED_LINE_WIDTH_RANGE\0"
- "GL_ALIASED_POINT_SIZE_RANGE\0"
- "GL_ALL_ATTRIB_BITS\0"
- "GL_ALL_CLIENT_ATTRIB_BITS\0"
- "GL_ALPHA\0"
- "GL_ALPHA12\0"
- "GL_ALPHA12_EXT\0"
- "GL_ALPHA16\0"
- "GL_ALPHA16I_EXT\0"
- "GL_ALPHA16UI_EXT\0"
- "GL_ALPHA16_EXT\0"
- "GL_ALPHA32I_EXT\0"
- "GL_ALPHA32UI_EXT\0"
- "GL_ALPHA4\0"
- "GL_ALPHA4_EXT\0"
- "GL_ALPHA8\0"
- "GL_ALPHA8I_EXT\0"
- "GL_ALPHA8UI_EXT\0"
- "GL_ALPHA8_EXT\0"
- "GL_ALPHA_BIAS\0"
- "GL_ALPHA_BITS\0"
- "GL_ALPHA_INTEGER_EXT\0"
- "GL_ALPHA_SCALE\0"
- "GL_ALPHA_TEST\0"
- "GL_ALPHA_TEST_FUNC\0"
- "GL_ALPHA_TEST_REF\0"
- "GL_ALREADY_SIGNALED\0"
- "GL_ALWAYS\0"
- "GL_AMBIENT\0"
- "GL_AMBIENT_AND_DIFFUSE\0"
- "GL_AND\0"
- "GL_AND_INVERTED\0"
- "GL_AND_REVERSE\0"
- "GL_ARRAY_BUFFER\0"
- "GL_ARRAY_BUFFER_BINDING\0"
- "GL_ARRAY_BUFFER_BINDING_ARB\0"
- "GL_ATTACHED_SHADERS\0"
- "GL_ATTRIB_ARRAY_POINTER_NV\0"
- "GL_ATTRIB_ARRAY_SIZE_NV\0"
- "GL_ATTRIB_ARRAY_STRIDE_NV\0"
- "GL_ATTRIB_ARRAY_TYPE_NV\0"
- "GL_ATTRIB_STACK_DEPTH\0"
- "GL_AUTO_NORMAL\0"
- "GL_AUX0\0"
- "GL_AUX1\0"
- "GL_AUX2\0"
- "GL_AUX3\0"
- "GL_AUX_BUFFERS\0"
- "GL_BACK\0"
- "GL_BACK_LEFT\0"
- "GL_BACK_RIGHT\0"
- "GL_BGR\0"
- "GL_BGRA\0"
- "GL_BGRA_EXT\0"
- "GL_BGRA_INTEGER\0"
- "GL_BGRA_INTEGER_EXT\0"
- "GL_BGR_INTEGER\0"
- "GL_BGR_INTEGER_EXT\0"
- "GL_BITMAP\0"
- "GL_BITMAP_TOKEN\0"
- "GL_BLEND\0"
- "GL_BLEND_COLOR\0"
- "GL_BLEND_COLOR_EXT\0"
- "GL_BLEND_DST\0"
- "GL_BLEND_DST_ALPHA\0"
- "GL_BLEND_DST_ALPHA_OES\0"
- "GL_BLEND_DST_RGB\0"
- "GL_BLEND_DST_RGB_OES\0"
- "GL_BLEND_EQUATION\0"
- "GL_BLEND_EQUATION_ALPHA\0"
- "GL_BLEND_EQUATION_ALPHA_EXT\0"
- "GL_BLEND_EQUATION_ALPHA_OES\0"
- "GL_BLEND_EQUATION_EXT\0"
- "GL_BLEND_EQUATION_OES\0"
- "GL_BLEND_EQUATION_RGB\0"
- "GL_BLEND_EQUATION_RGB_EXT\0"
- "GL_BLEND_EQUATION_RGB_OES\0"
- "GL_BLEND_SRC\0"
- "GL_BLEND_SRC_ALPHA\0"
- "GL_BLEND_SRC_ALPHA_OES\0"
- "GL_BLEND_SRC_RGB\0"
- "GL_BLEND_SRC_RGB_OES\0"
- "GL_BLUE\0"
- "GL_BLUE_BIAS\0"
- "GL_BLUE_BITS\0"
- "GL_BLUE_INTEGER\0"
- "GL_BLUE_INTEGER_EXT\0"
- "GL_BLUE_SCALE\0"
- "GL_BOOL\0"
- "GL_BOOL_ARB\0"
- "GL_BOOL_VEC2\0"
- "GL_BOOL_VEC2_ARB\0"
- "GL_BOOL_VEC3\0"
- "GL_BOOL_VEC3_ARB\0"
- "GL_BOOL_VEC4\0"
- "GL_BOOL_VEC4_ARB\0"
- "GL_BUFFER_ACCESS\0"
- "GL_BUFFER_ACCESS_ARB\0"
- "GL_BUFFER_ACCESS_FLAGS\0"
- "GL_BUFFER_ACCESS_OES\0"
- "GL_BUFFER_FLUSHING_UNMAP_APPLE\0"
- "GL_BUFFER_MAPPED\0"
- "GL_BUFFER_MAPPED_ARB\0"
- "GL_BUFFER_MAPPED_OES\0"
- "GL_BUFFER_MAP_LENGTH\0"
- "GL_BUFFER_MAP_OFFSET\0"
- "GL_BUFFER_MAP_POINTER\0"
- "GL_BUFFER_MAP_POINTER_ARB\0"
- "GL_BUFFER_MAP_POINTER_OES\0"
- "GL_BUFFER_OBJECT_APPLE\0"
- "GL_BUFFER_SERIALIZED_MODIFY_APPLE\0"
- "GL_BUFFER_SIZE\0"
- "GL_BUFFER_SIZE_ARB\0"
- "GL_BUFFER_USAGE\0"
- "GL_BUFFER_USAGE_ARB\0"
- "GL_BUMP_ENVMAP_ATI\0"
- "GL_BUMP_NUM_TEX_UNITS_ATI\0"
- "GL_BUMP_ROT_MATRIX_ATI\0"
- "GL_BUMP_ROT_MATRIX_SIZE_ATI\0"
- "GL_BUMP_TARGET_ATI\0"
- "GL_BUMP_TEX_UNITS_ATI\0"
- "GL_BYTE\0"
- "GL_C3F_V3F\0"
- "GL_C4F_N3F_V3F\0"
- "GL_C4UB_V2F\0"
- "GL_C4UB_V3F\0"
- "GL_CCW\0"
- "GL_CLAMP\0"
- "GL_CLAMP_FRAGMENT_COLOR_ARB\0"
- "GL_CLAMP_READ_COLOR\0"
- "GL_CLAMP_READ_COLOR_ARB\0"
- "GL_CLAMP_TO_BORDER\0"
- "GL_CLAMP_TO_BORDER_ARB\0"
- "GL_CLAMP_TO_BORDER_SGIS\0"
- "GL_CLAMP_TO_EDGE\0"
- "GL_CLAMP_TO_EDGE_SGIS\0"
- "GL_CLAMP_VERTEX_COLOR_ARB\0"
- "GL_CLEAR\0"
- "GL_CLIENT_ACTIVE_TEXTURE\0"
- "GL_CLIENT_ACTIVE_TEXTURE_ARB\0"
- "GL_CLIENT_ALL_ATTRIB_BITS\0"
- "GL_CLIENT_ATTRIB_STACK_DEPTH\0"
- "GL_CLIENT_PIXEL_STORE_BIT\0"
- "GL_CLIENT_VERTEX_ARRAY_BIT\0"
- "GL_CLIP_DISTANCE0\0"
- "GL_CLIP_DISTANCE1\0"
- "GL_CLIP_DISTANCE2\0"
- "GL_CLIP_DISTANCE3\0"
- "GL_CLIP_DISTANCE4\0"
- "GL_CLIP_DISTANCE5\0"
- "GL_CLIP_DISTANCE6\0"
- "GL_CLIP_DISTANCE7\0"
- "GL_CLIP_PLANE0\0"
- "GL_CLIP_PLANE1\0"
- "GL_CLIP_PLANE2\0"
- "GL_CLIP_PLANE3\0"
- "GL_CLIP_PLANE4\0"
- "GL_CLIP_PLANE5\0"
- "GL_CLIP_VOLUME_CLIPPING_HINT_EXT\0"
- "GL_COEFF\0"
- "GL_COLOR\0"
- "GL_COLOR_ARRAY\0"
- "GL_COLOR_ARRAY_BUFFER_BINDING\0"
- "GL_COLOR_ARRAY_BUFFER_BINDING_ARB\0"
- "GL_COLOR_ARRAY_POINTER\0"
- "GL_COLOR_ARRAY_SIZE\0"
- "GL_COLOR_ARRAY_STRIDE\0"
- "GL_COLOR_ARRAY_TYPE\0"
- "GL_COLOR_ATTACHMENT0\0"
- "GL_COLOR_ATTACHMENT0_EXT\0"
- "GL_COLOR_ATTACHMENT0_OES\0"
- "GL_COLOR_ATTACHMENT1\0"
- "GL_COLOR_ATTACHMENT10\0"
- "GL_COLOR_ATTACHMENT10_EXT\0"
- "GL_COLOR_ATTACHMENT11\0"
- "GL_COLOR_ATTACHMENT11_EXT\0"
- "GL_COLOR_ATTACHMENT12\0"
- "GL_COLOR_ATTACHMENT12_EXT\0"
- "GL_COLOR_ATTACHMENT13\0"
- "GL_COLOR_ATTACHMENT13_EXT\0"
- "GL_COLOR_ATTACHMENT14\0"
- "GL_COLOR_ATTACHMENT14_EXT\0"
- "GL_COLOR_ATTACHMENT15\0"
- "GL_COLOR_ATTACHMENT15_EXT\0"
- "GL_COLOR_ATTACHMENT1_EXT\0"
- "GL_COLOR_ATTACHMENT2\0"
- "GL_COLOR_ATTACHMENT2_EXT\0"
- "GL_COLOR_ATTACHMENT3\0"
- "GL_COLOR_ATTACHMENT3_EXT\0"
- "GL_COLOR_ATTACHMENT4\0"
- "GL_COLOR_ATTACHMENT4_EXT\0"
- "GL_COLOR_ATTACHMENT5\0"
- "GL_COLOR_ATTACHMENT5_EXT\0"
- "GL_COLOR_ATTACHMENT6\0"
- "GL_COLOR_ATTACHMENT6_EXT\0"
- "GL_COLOR_ATTACHMENT7\0"
- "GL_COLOR_ATTACHMENT7_EXT\0"
- "GL_COLOR_ATTACHMENT8\0"
- "GL_COLOR_ATTACHMENT8_EXT\0"
- "GL_COLOR_ATTACHMENT9\0"
- "GL_COLOR_ATTACHMENT9_EXT\0"
- "GL_COLOR_BUFFER_BIT\0"
- "GL_COLOR_CLEAR_VALUE\0"
- "GL_COLOR_INDEX\0"
- "GL_COLOR_INDEXES\0"
- "GL_COLOR_LOGIC_OP\0"
- "GL_COLOR_MATERIAL\0"
- "GL_COLOR_MATERIAL_FACE\0"
- "GL_COLOR_MATERIAL_PARAMETER\0"
- "GL_COLOR_MATRIX\0"
- "GL_COLOR_MATRIX_SGI\0"
- "GL_COLOR_MATRIX_STACK_DEPTH\0"
- "GL_COLOR_MATRIX_STACK_DEPTH_SGI\0"
- "GL_COLOR_SUM\0"
- "GL_COLOR_SUM_ARB\0"
- "GL_COLOR_TABLE\0"
- "GL_COLOR_TABLE_ALPHA_SIZE\0"
- "GL_COLOR_TABLE_ALPHA_SIZE_EXT\0"
- "GL_COLOR_TABLE_ALPHA_SIZE_SGI\0"
- "GL_COLOR_TABLE_BIAS\0"
- "GL_COLOR_TABLE_BIAS_SGI\0"
- "GL_COLOR_TABLE_BLUE_SIZE\0"
- "GL_COLOR_TABLE_BLUE_SIZE_EXT\0"
- "GL_COLOR_TABLE_BLUE_SIZE_SGI\0"
- "GL_COLOR_TABLE_FORMAT\0"
- "GL_COLOR_TABLE_FORMAT_EXT\0"
- "GL_COLOR_TABLE_FORMAT_SGI\0"
- "GL_COLOR_TABLE_GREEN_SIZE\0"
- "GL_COLOR_TABLE_GREEN_SIZE_EXT\0"
- "GL_COLOR_TABLE_GREEN_SIZE_SGI\0"
- "GL_COLOR_TABLE_INTENSITY_SIZE\0"
- "GL_COLOR_TABLE_INTENSITY_SIZE_EXT\0"
- "GL_COLOR_TABLE_INTENSITY_SIZE_SGI\0"
- "GL_COLOR_TABLE_LUMINANCE_SIZE\0"
- "GL_COLOR_TABLE_LUMINANCE_SIZE_EXT\0"
- "GL_COLOR_TABLE_LUMINANCE_SIZE_SGI\0"
- "GL_COLOR_TABLE_RED_SIZE\0"
- "GL_COLOR_TABLE_RED_SIZE_EXT\0"
- "GL_COLOR_TABLE_RED_SIZE_SGI\0"
- "GL_COLOR_TABLE_SCALE\0"
- "GL_COLOR_TABLE_SCALE_SGI\0"
- "GL_COLOR_TABLE_WIDTH\0"
- "GL_COLOR_TABLE_WIDTH_EXT\0"
- "GL_COLOR_TABLE_WIDTH_SGI\0"
- "GL_COLOR_WRITEMASK\0"
- "GL_COMBINE\0"
- "GL_COMBINE4\0"
- "GL_COMBINE_ALPHA\0"
- "GL_COMBINE_ALPHA_ARB\0"
- "GL_COMBINE_ALPHA_EXT\0"
- "GL_COMBINE_ARB\0"
- "GL_COMBINE_EXT\0"
- "GL_COMBINE_RGB\0"
- "GL_COMBINE_RGB_ARB\0"
- "GL_COMBINE_RGB_EXT\0"
- "GL_COMPARE_REF_DEPTH_TO_TEXTURE_EXT\0"
- "GL_COMPARE_REF_TO_TEXTURE\0"
- "GL_COMPARE_R_TO_TEXTURE\0"
- "GL_COMPARE_R_TO_TEXTURE_ARB\0"
- "GL_COMPILE\0"
- "GL_COMPILE_AND_EXECUTE\0"
- "GL_COMPILE_STATUS\0"
- "GL_COMPRESSED_ALPHA\0"
- "GL_COMPRESSED_ALPHA_ARB\0"
- "GL_COMPRESSED_INTENSITY\0"
- "GL_COMPRESSED_INTENSITY_ARB\0"
- "GL_COMPRESSED_LUMINANCE\0"
- "GL_COMPRESSED_LUMINANCE_ALPHA\0"
- "GL_COMPRESSED_LUMINANCE_ALPHA_ARB\0"
- "GL_COMPRESSED_LUMINANCE_ARB\0"
- "GL_COMPRESSED_RED\0"
- "GL_COMPRESSED_RG\0"
- "GL_COMPRESSED_RGB\0"
- "GL_COMPRESSED_RGBA\0"
- "GL_COMPRESSED_RGBA_ARB\0"
- "GL_COMPRESSED_RGBA_FXT1_3DFX\0"
- "GL_COMPRESSED_RGBA_S3TC_DXT1_EXT\0"
- "GL_COMPRESSED_RGBA_S3TC_DXT3_EXT\0"
- "GL_COMPRESSED_RGBA_S3TC_DXT5_EXT\0"
- "GL_COMPRESSED_RGB_ARB\0"
- "GL_COMPRESSED_RGB_FXT1_3DFX\0"
- "GL_COMPRESSED_RGB_S3TC_DXT1_EXT\0"
- "GL_COMPRESSED_SLUMINANCE\0"
- "GL_COMPRESSED_SLUMINANCE_ALPHA\0"
- "GL_COMPRESSED_SRGB\0"
- "GL_COMPRESSED_SRGB_ALPHA\0"
- "GL_COMPRESSED_TEXTURE_FORMATS\0"
- "GL_CONDITION_SATISFIED\0"
- "GL_CONSTANT\0"
- "GL_CONSTANT_ALPHA\0"
- "GL_CONSTANT_ALPHA_EXT\0"
- "GL_CONSTANT_ARB\0"
- "GL_CONSTANT_ATTENUATION\0"
- "GL_CONSTANT_BORDER_HP\0"
- "GL_CONSTANT_COLOR\0"
- "GL_CONSTANT_COLOR_EXT\0"
- "GL_CONSTANT_EXT\0"
- "GL_CONTEXT_COMPATIBILITY_PROFILE_BIT\0"
- "GL_CONTEXT_CORE_PROFILE_BIT\0"
- "GL_CONTEXT_FLAGS\0"
- "GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT\0"
- "GL_CONTEXT_FLAG_ROBUST_ACCESS_BIT_ARB\0"
- "GL_CONTEXT_PROFILE_MASK\0"
- "GL_CONVOLUTION_1D\0"
- "GL_CONVOLUTION_2D\0"
- "GL_CONVOLUTION_BORDER_COLOR\0"
- "GL_CONVOLUTION_BORDER_COLOR_HP\0"
- "GL_CONVOLUTION_BORDER_MODE\0"
- "GL_CONVOLUTION_BORDER_MODE_EXT\0"
- "GL_CONVOLUTION_FILTER_BIAS\0"
- "GL_CONVOLUTION_FILTER_BIAS_EXT\0"
- "GL_CONVOLUTION_FILTER_SCALE\0"
- "GL_CONVOLUTION_FILTER_SCALE_EXT\0"
- "GL_CONVOLUTION_FORMAT\0"
- "GL_CONVOLUTION_FORMAT_EXT\0"
- "GL_CONVOLUTION_HEIGHT\0"
- "GL_CONVOLUTION_HEIGHT_EXT\0"
- "GL_CONVOLUTION_WIDTH\0"
- "GL_CONVOLUTION_WIDTH_EXT\0"
- "GL_COORD_REPLACE\0"
- "GL_COORD_REPLACE_ARB\0"
- "GL_COORD_REPLACE_NV\0"
- "GL_COORD_REPLACE_OES\0"
- "GL_COPY\0"
- "GL_COPY_INVERTED\0"
- "GL_COPY_PIXEL_TOKEN\0"
- "GL_COPY_READ_BUFFER\0"
- "GL_COPY_WRITE_BUFFER\0"
- "GL_CULL_FACE\0"
- "GL_CULL_FACE_MODE\0"
- "GL_CULL_VERTEX_EXT\0"
- "GL_CULL_VERTEX_EYE_POSITION_EXT\0"
- "GL_CULL_VERTEX_OBJECT_POSITION_EXT\0"
- "GL_CURRENT_ATTRIB_NV\0"
- "GL_CURRENT_BIT\0"
- "GL_CURRENT_COLOR\0"
- "GL_CURRENT_FOG_COORD\0"
- "GL_CURRENT_FOG_COORDINATE\0"
- "GL_CURRENT_INDEX\0"
- "GL_CURRENT_MATRIX_ARB\0"
- "GL_CURRENT_MATRIX_INDEX_ARB\0"
- "GL_CURRENT_MATRIX_NV\0"
- "GL_CURRENT_MATRIX_STACK_DEPTH_ARB\0"
- "GL_CURRENT_MATRIX_STACK_DEPTH_NV\0"
- "GL_CURRENT_NORMAL\0"
- "GL_CURRENT_PALETTE_MATRIX_ARB\0"
- "GL_CURRENT_PALETTE_MATRIX_OES\0"
- "GL_CURRENT_PROGRAM\0"
- "GL_CURRENT_QUERY\0"
- "GL_CURRENT_QUERY_ARB\0"
- "GL_CURRENT_RASTER_COLOR\0"
- "GL_CURRENT_RASTER_DISTANCE\0"
- "GL_CURRENT_RASTER_INDEX\0"
- "GL_CURRENT_RASTER_POSITION\0"
- "GL_CURRENT_RASTER_POSITION_VALID\0"
- "GL_CURRENT_RASTER_SECONDARY_COLOR\0"
- "GL_CURRENT_RASTER_TEXTURE_COORDS\0"
- "GL_CURRENT_SECONDARY_COLOR\0"
- "GL_CURRENT_TEXTURE_COORDS\0"
- "GL_CURRENT_VERTEX_ATTRIB\0"
- "GL_CURRENT_VERTEX_ATTRIB_ARB\0"
- "GL_CURRENT_WEIGHT_ARB\0"
- "GL_CW\0"
- "GL_DEBUG_ASSERT_MESA\0"
- "GL_DEBUG_OBJECT_MESA\0"
- "GL_DEBUG_PRINT_MESA\0"
- "GL_DECAL\0"
- "GL_DECR\0"
- "GL_DECR_WRAP\0"
- "GL_DECR_WRAP_EXT\0"
- "GL_DELETE_STATUS\0"
- "GL_DEPTH\0"
- "GL_DEPTH24_STENCIL8\0"
- "GL_DEPTH24_STENCIL8_EXT\0"
- "GL_DEPTH24_STENCIL8_OES\0"
- "GL_DEPTH_ATTACHMENT\0"
- "GL_DEPTH_ATTACHMENT_EXT\0"
- "GL_DEPTH_ATTACHMENT_OES\0"
- "GL_DEPTH_BIAS\0"
- "GL_DEPTH_BITS\0"
- "GL_DEPTH_BOUNDS_EXT\0"
- "GL_DEPTH_BOUNDS_TEST_EXT\0"
- "GL_DEPTH_BUFFER\0"
- "GL_DEPTH_BUFFER_BIT\0"
- "GL_DEPTH_CLAMP\0"
- "GL_DEPTH_CLAMP_NV\0"
- "GL_DEPTH_CLEAR_VALUE\0"
- "GL_DEPTH_COMPONENT\0"
- "GL_DEPTH_COMPONENT16\0"
- "GL_DEPTH_COMPONENT16_ARB\0"
- "GL_DEPTH_COMPONENT16_OES\0"
- "GL_DEPTH_COMPONENT16_SGIX\0"
- "GL_DEPTH_COMPONENT24\0"
- "GL_DEPTH_COMPONENT24_ARB\0"
- "GL_DEPTH_COMPONENT24_OES\0"
- "GL_DEPTH_COMPONENT24_SGIX\0"
- "GL_DEPTH_COMPONENT32\0"
- "GL_DEPTH_COMPONENT32_ARB\0"
- "GL_DEPTH_COMPONENT32_OES\0"
- "GL_DEPTH_COMPONENT32_SGIX\0"
- "GL_DEPTH_FUNC\0"
- "GL_DEPTH_RANGE\0"
- "GL_DEPTH_SCALE\0"
- "GL_DEPTH_STENCIL\0"
- "GL_DEPTH_STENCIL_ATTACHMENT\0"
- "GL_DEPTH_STENCIL_EXT\0"
- "GL_DEPTH_STENCIL_NV\0"
- "GL_DEPTH_STENCIL_OES\0"
- "GL_DEPTH_STENCIL_TO_BGRA_NV\0"
- "GL_DEPTH_STENCIL_TO_RGBA_NV\0"
- "GL_DEPTH_TEST\0"
- "GL_DEPTH_TEXTURE_MODE\0"
- "GL_DEPTH_TEXTURE_MODE_ARB\0"
- "GL_DEPTH_WRITEMASK\0"
- "GL_DIFFUSE\0"
- "GL_DITHER\0"
- "GL_DOMAIN\0"
- "GL_DONT_CARE\0"
- "GL_DOT3_RGB\0"
- "GL_DOT3_RGBA\0"
- "GL_DOT3_RGBA_ARB\0"
- "GL_DOT3_RGBA_EXT\0"
- "GL_DOT3_RGB_ARB\0"
- "GL_DOT3_RGB_EXT\0"
- "GL_DOUBLE\0"
- "GL_DOUBLEBUFFER\0"
- "GL_DRAW_BUFFER\0"
- "GL_DRAW_BUFFER0\0"
- "GL_DRAW_BUFFER0_ARB\0"
- "GL_DRAW_BUFFER0_ATI\0"
- "GL_DRAW_BUFFER1\0"
- "GL_DRAW_BUFFER10\0"
- "GL_DRAW_BUFFER10_ARB\0"
- "GL_DRAW_BUFFER10_ATI\0"
- "GL_DRAW_BUFFER11\0"
- "GL_DRAW_BUFFER11_ARB\0"
- "GL_DRAW_BUFFER11_ATI\0"
- "GL_DRAW_BUFFER12\0"
- "GL_DRAW_BUFFER12_ARB\0"
- "GL_DRAW_BUFFER12_ATI\0"
- "GL_DRAW_BUFFER13\0"
- "GL_DRAW_BUFFER13_ARB\0"
- "GL_DRAW_BUFFER13_ATI\0"
- "GL_DRAW_BUFFER14\0"
- "GL_DRAW_BUFFER14_ARB\0"
- "GL_DRAW_BUFFER14_ATI\0"
- "GL_DRAW_BUFFER15\0"
- "GL_DRAW_BUFFER15_ARB\0"
- "GL_DRAW_BUFFER15_ATI\0"
- "GL_DRAW_BUFFER1_ARB\0"
- "GL_DRAW_BUFFER1_ATI\0"
- "GL_DRAW_BUFFER2\0"
- "GL_DRAW_BUFFER2_ARB\0"
- "GL_DRAW_BUFFER2_ATI\0"
- "GL_DRAW_BUFFER3\0"
- "GL_DRAW_BUFFER3_ARB\0"
- "GL_DRAW_BUFFER3_ATI\0"
- "GL_DRAW_BUFFER4\0"
- "GL_DRAW_BUFFER4_ARB\0"
- "GL_DRAW_BUFFER4_ATI\0"
- "GL_DRAW_BUFFER5\0"
- "GL_DRAW_BUFFER5_ARB\0"
- "GL_DRAW_BUFFER5_ATI\0"
- "GL_DRAW_BUFFER6\0"
- "GL_DRAW_BUFFER6_ARB\0"
- "GL_DRAW_BUFFER6_ATI\0"
- "GL_DRAW_BUFFER7\0"
- "GL_DRAW_BUFFER7_ARB\0"
- "GL_DRAW_BUFFER7_ATI\0"
- "GL_DRAW_BUFFER8\0"
- "GL_DRAW_BUFFER8_ARB\0"
- "GL_DRAW_BUFFER8_ATI\0"
- "GL_DRAW_BUFFER9\0"
- "GL_DRAW_BUFFER9_ARB\0"
- "GL_DRAW_BUFFER9_ATI\0"
- "GL_DRAW_FRAMEBUFFER\0"
- "GL_DRAW_FRAMEBUFFER_BINDING\0"
- "GL_DRAW_FRAMEBUFFER_BINDING_EXT\0"
- "GL_DRAW_FRAMEBUFFER_EXT\0"
- "GL_DRAW_PIXEL_TOKEN\0"
- "GL_DST_ALPHA\0"
- "GL_DST_COLOR\0"
- "GL_DU8DV8_ATI\0"
- "GL_DUDV_ATI\0"
- "GL_DYNAMIC_COPY\0"
- "GL_DYNAMIC_COPY_ARB\0"
- "GL_DYNAMIC_DRAW\0"
- "GL_DYNAMIC_DRAW_ARB\0"
- "GL_DYNAMIC_READ\0"
- "GL_DYNAMIC_READ_ARB\0"
- "GL_EDGE_FLAG\0"
- "GL_EDGE_FLAG_ARRAY\0"
- "GL_EDGE_FLAG_ARRAY_BUFFER_BINDING\0"
- "GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB\0"
- "GL_EDGE_FLAG_ARRAY_POINTER\0"
- "GL_EDGE_FLAG_ARRAY_STRIDE\0"
- "GL_ELEMENT_ARRAY_BUFFER\0"
- "GL_ELEMENT_ARRAY_BUFFER_BINDING\0"
- "GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB\0"
- "GL_EMISSION\0"
- "GL_ENABLE_BIT\0"
- "GL_EQUAL\0"
- "GL_EQUIV\0"
- "GL_EVAL_BIT\0"
- "GL_EXP\0"
- "GL_EXP2\0"
- "GL_EXTENSIONS\0"
- "GL_EYE_LINEAR\0"
- "GL_EYE_PLANE\0"
- "GL_EYE_PLANE_ABSOLUTE_NV\0"
- "GL_EYE_RADIAL_NV\0"
- "GL_FALSE\0"
- "GL_FASTEST\0"
- "GL_FEEDBACK\0"
- "GL_FEEDBACK_BUFFER_POINTER\0"
- "GL_FEEDBACK_BUFFER_SIZE\0"
- "GL_FEEDBACK_BUFFER_TYPE\0"
- "GL_FILL\0"
- "GL_FIRST_VERTEX_CONVENTION\0"
- "GL_FIRST_VERTEX_CONVENTION_EXT\0"
- "GL_FIXED\0"
- "GL_FIXED_OES\0"
- "GL_FIXED_ONLY\0"
- "GL_FIXED_ONLY_ARB\0"
- "GL_FLAT\0"
- "GL_FLOAT\0"
- "GL_FLOAT_MAT2\0"
- "GL_FLOAT_MAT2_ARB\0"
- "GL_FLOAT_MAT2x3\0"
- "GL_FLOAT_MAT2x4\0"
- "GL_FLOAT_MAT3\0"
- "GL_FLOAT_MAT3_ARB\0"
- "GL_FLOAT_MAT3x2\0"
- "GL_FLOAT_MAT3x4\0"
- "GL_FLOAT_MAT4\0"
- "GL_FLOAT_MAT4_ARB\0"
- "GL_FLOAT_MAT4x2\0"
- "GL_FLOAT_MAT4x3\0"
- "GL_FLOAT_VEC2\0"
- "GL_FLOAT_VEC2_ARB\0"
- "GL_FLOAT_VEC3\0"
- "GL_FLOAT_VEC3_ARB\0"
- "GL_FLOAT_VEC4\0"
- "GL_FLOAT_VEC4_ARB\0"
- "GL_FOG\0"
- "GL_FOG_BIT\0"
- "GL_FOG_COLOR\0"
- "GL_FOG_COORD\0"
- "GL_FOG_COORDINATE\0"
- "GL_FOG_COORDINATE_ARRAY\0"
- "GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING\0"
- "GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB\0"
- "GL_FOG_COORDINATE_ARRAY_POINTER\0"
- "GL_FOG_COORDINATE_ARRAY_STRIDE\0"
- "GL_FOG_COORDINATE_ARRAY_TYPE\0"
- "GL_FOG_COORDINATE_SOURCE\0"
- "GL_FOG_COORD_ARRAY\0"
- "GL_FOG_COORD_ARRAY_BUFFER_BINDING\0"
- "GL_FOG_COORD_ARRAY_POINTER\0"
- "GL_FOG_COORD_ARRAY_STRIDE\0"
- "GL_FOG_COORD_ARRAY_TYPE\0"
- "GL_FOG_COORD_SRC\0"
- "GL_FOG_DENSITY\0"
- "GL_FOG_DISTANCE_MODE_NV\0"
- "GL_FOG_END\0"
- "GL_FOG_HINT\0"
- "GL_FOG_INDEX\0"
- "GL_FOG_MODE\0"
- "GL_FOG_OFFSET_SGIX\0"
- "GL_FOG_OFFSET_VALUE_SGIX\0"
- "GL_FOG_START\0"
- "GL_FRAGMENT_DEPTH\0"
- "GL_FRAGMENT_PROGRAM_ARB\0"
- "GL_FRAGMENT_SHADER\0"
- "GL_FRAGMENT_SHADER_ARB\0"
- "GL_FRAGMENT_SHADER_DERIVATIVE_HINT\0"
- "GL_FRAGMENT_SHADER_DERIVATIVE_HINT_OES\0"
- "GL_FRAMEBUFFER\0"
- "GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE\0"
- "GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE\0"
- "GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING\0"
- "GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE\0"
- "GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE\0"
- "GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE\0"
- "GL_FRAMEBUFFER_ATTACHMENT_LAYERED\0"
- "GL_FRAMEBUFFER_ATTACHMENT_LAYERED_ARB\0"
- "GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME\0"
- "GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT\0"
- "GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_OES\0"
- "GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE\0"
- "GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT\0"
- "GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_OES\0"
- "GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE\0"
- "GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE\0"
- "GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT\0"
- "GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_OES\0"
- "GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE\0"
- "GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_EXT\0"
- "GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_OES\0"
- "GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER\0"
- "GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT\0"
- "GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL\0"
- "GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT\0"
- "GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_OES\0"
- "GL_FRAMEBUFFER_BINDING\0"
- "GL_FRAMEBUFFER_BINDING_EXT\0"
- "GL_FRAMEBUFFER_BINDING_OES\0"
- "GL_FRAMEBUFFER_COMPLETE\0"
- "GL_FRAMEBUFFER_COMPLETE_EXT\0"
- "GL_FRAMEBUFFER_COMPLETE_OES\0"
- "GL_FRAMEBUFFER_DEFAULT\0"
- "GL_FRAMEBUFFER_EXT\0"
- "GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT\0"
- "GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT\0"
- "GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_OES\0"
- "GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS\0"
- "GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT\0"
- "GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_OES\0"
- "GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER\0"
- "GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT\0"
- "GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_OES\0"
- "GL_FRAMEBUFFER_INCOMPLETE_DUPLICATE_ATTACHMENT_EXT\0"
- "GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT\0"
- "GL_FRAMEBUFFER_INCOMPLETE_FORMATS_OES\0"
- "GL_FRAMEBUFFER_INCOMPLETE_LAYER_COUNT_ARB\0"
- "GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS\0"
- "GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_ARB\0"
- "GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT\0"
- "GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT\0"
- "GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_OES\0"
- "GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE\0"
- "GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_EXT\0"
- "GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER\0"
- "GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT\0"
- "GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_OES\0"
- "GL_FRAMEBUFFER_OES\0"
- "GL_FRAMEBUFFER_STATUS_ERROR_EXT\0"
- "GL_FRAMEBUFFER_UNDEFINED\0"
- "GL_FRAMEBUFFER_UNSUPPORTED\0"
- "GL_FRAMEBUFFER_UNSUPPORTED_EXT\0"
- "GL_FRAMEBUFFER_UNSUPPORTED_OES\0"
- "GL_FRONT\0"
- "GL_FRONT_AND_BACK\0"
- "GL_FRONT_FACE\0"
- "GL_FRONT_LEFT\0"
- "GL_FRONT_RIGHT\0"
- "GL_FUNC_ADD\0"
- "GL_FUNC_ADD_EXT\0"
- "GL_FUNC_ADD_OES\0"
- "GL_FUNC_REVERSE_SUBTRACT\0"
- "GL_FUNC_REVERSE_SUBTRACT_EXT\0"
- "GL_FUNC_REVERSE_SUBTRACT_OES\0"
- "GL_FUNC_SUBTRACT\0"
- "GL_FUNC_SUBTRACT_EXT\0"
- "GL_FUNC_SUBTRACT_OES\0"
- "GL_GENERATE_MIPMAP\0"
- "GL_GENERATE_MIPMAP_HINT\0"
- "GL_GENERATE_MIPMAP_HINT_SGIS\0"
- "GL_GENERATE_MIPMAP_SGIS\0"
- "GL_GEOMETRY_INPUT_TYPE\0"
- "GL_GEOMETRY_INPUT_TYPE_ARB\0"
- "GL_GEOMETRY_OUTPUT_TYPE\0"
- "GL_GEOMETRY_OUTPUT_TYPE_ARB\0"
- "GL_GEOMETRY_SHADER\0"
- "GL_GEOMETRY_SHADER_ARB\0"
- "GL_GEOMETRY_VERTICES_OUT\0"
- "GL_GEOMETRY_VERTICES_OUT_ARB\0"
- "GL_GEQUAL\0"
- "GL_GREATER\0"
- "GL_GREEN\0"
- "GL_GREEN_BIAS\0"
- "GL_GREEN_BITS\0"
- "GL_GREEN_INTEGER\0"
- "GL_GREEN_INTEGER_EXT\0"
- "GL_GREEN_SCALE\0"
- "GL_GUILTY_CONTEXT_RESET_ARB\0"
- "GL_HALF_FLOAT\0"
- "GL_HALF_FLOAT_OES\0"
- "GL_HIGH_FLOAT\0"
- "GL_HIGH_INT\0"
- "GL_HINT_BIT\0"
- "GL_HISTOGRAM\0"
- "GL_HISTOGRAM_ALPHA_SIZE\0"
- "GL_HISTOGRAM_ALPHA_SIZE_EXT\0"
- "GL_HISTOGRAM_BLUE_SIZE\0"
- "GL_HISTOGRAM_BLUE_SIZE_EXT\0"
- "GL_HISTOGRAM_EXT\0"
- "GL_HISTOGRAM_FORMAT\0"
- "GL_HISTOGRAM_FORMAT_EXT\0"
- "GL_HISTOGRAM_GREEN_SIZE\0"
- "GL_HISTOGRAM_GREEN_SIZE_EXT\0"
- "GL_HISTOGRAM_LUMINANCE_SIZE\0"
- "GL_HISTOGRAM_LUMINANCE_SIZE_EXT\0"
- "GL_HISTOGRAM_RED_SIZE\0"
- "GL_HISTOGRAM_RED_SIZE_EXT\0"
- "GL_HISTOGRAM_SINK\0"
- "GL_HISTOGRAM_SINK_EXT\0"
- "GL_HISTOGRAM_WIDTH\0"
- "GL_HISTOGRAM_WIDTH_EXT\0"
- "GL_IDENTITY_NV\0"
- "GL_IGNORE_BORDER_HP\0"
- "GL_IMPLEMENTATION_COLOR_READ_FORMAT\0"
- "GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES\0"
- "GL_IMPLEMENTATION_COLOR_READ_TYPE\0"
- "GL_IMPLEMENTATION_COLOR_READ_TYPE_OES\0"
- "GL_INCR\0"
- "GL_INCR_WRAP\0"
- "GL_INCR_WRAP_EXT\0"
- "GL_INDEX\0"
- "GL_INDEX_ARRAY\0"
- "GL_INDEX_ARRAY_BUFFER_BINDING\0"
- "GL_INDEX_ARRAY_BUFFER_BINDING_ARB\0"
- "GL_INDEX_ARRAY_POINTER\0"
- "GL_INDEX_ARRAY_STRIDE\0"
- "GL_INDEX_ARRAY_TYPE\0"
- "GL_INDEX_BITS\0"
- "GL_INDEX_CLEAR_VALUE\0"
- "GL_INDEX_LOGIC_OP\0"
- "GL_INDEX_MODE\0"
- "GL_INDEX_OFFSET\0"
- "GL_INDEX_SHIFT\0"
- "GL_INDEX_WRITEMASK\0"
- "GL_INFO_LOG_LENGTH\0"
- "GL_INNOCENT_CONTEXT_RESET_ARB\0"
- "GL_INT\0"
- "GL_INTENSITY\0"
- "GL_INTENSITY12\0"
- "GL_INTENSITY12_EXT\0"
- "GL_INTENSITY16\0"
- "GL_INTENSITY16I_EXT\0"
- "GL_INTENSITY16UI_EXT\0"
- "GL_INTENSITY16_EXT\0"
- "GL_INTENSITY32I_EXT\0"
- "GL_INTENSITY32UI_EXT\0"
- "GL_INTENSITY4\0"
- "GL_INTENSITY4_EXT\0"
- "GL_INTENSITY8\0"
- "GL_INTENSITY8I_EXT\0"
- "GL_INTENSITY8UI_EXT\0"
- "GL_INTENSITY8_EXT\0"
- "GL_INTENSITY_EXT\0"
- "GL_INTERLEAVED_ATTRIBS\0"
- "GL_INTERLEAVED_ATTRIBS_EXT\0"
- "GL_INTERPOLATE\0"
- "GL_INTERPOLATE_ARB\0"
- "GL_INTERPOLATE_EXT\0"
- "GL_INT_10_10_10_2_OES\0"
- "GL_INT_SAMPLER_1D\0"
- "GL_INT_SAMPLER_1D_ARRAY\0"
- "GL_INT_SAMPLER_1D_ARRAY_EXT\0"
- "GL_INT_SAMPLER_1D_EXT\0"
- "GL_INT_SAMPLER_2D\0"
- "GL_INT_SAMPLER_2D_ARRAY\0"
- "GL_INT_SAMPLER_2D_ARRAY_EXT\0"
- "GL_INT_SAMPLER_2D_EXT\0"
- "GL_INT_SAMPLER_2D_RECT\0"
- "GL_INT_SAMPLER_2D_RECT_EXT\0"
- "GL_INT_SAMPLER_3D\0"
- "GL_INT_SAMPLER_3D_EXT\0"
- "GL_INT_SAMPLER_BUFFER\0"
- "GL_INT_SAMPLER_BUFFER_EXT\0"
- "GL_INT_SAMPLER_CUBE\0"
- "GL_INT_SAMPLER_CUBE_EXT\0"
- "GL_INT_VEC2\0"
- "GL_INT_VEC2_ARB\0"
- "GL_INT_VEC3\0"
- "GL_INT_VEC3_ARB\0"
- "GL_INT_VEC4\0"
- "GL_INT_VEC4_ARB\0"
- "GL_INVALID_ENUM\0"
- "GL_INVALID_FRAMEBUFFER_OPERATION\0"
- "GL_INVALID_FRAMEBUFFER_OPERATION_EXT\0"
- "GL_INVALID_FRAMEBUFFER_OPERATION_OES\0"
- "GL_INVALID_OPERATION\0"
- "GL_INVALID_VALUE\0"
- "GL_INVERSE_NV\0"
- "GL_INVERSE_TRANSPOSE_NV\0"
- "GL_INVERT\0"
- "GL_KEEP\0"
- "GL_LAST_VERTEX_CONVENTION\0"
- "GL_LAST_VERTEX_CONVENTION_EXT\0"
- "GL_LEFT\0"
- "GL_LEQUAL\0"
- "GL_LESS\0"
- "GL_LIGHT0\0"
- "GL_LIGHT1\0"
- "GL_LIGHT2\0"
- "GL_LIGHT3\0"
- "GL_LIGHT4\0"
- "GL_LIGHT5\0"
- "GL_LIGHT6\0"
- "GL_LIGHT7\0"
- "GL_LIGHTING\0"
- "GL_LIGHTING_BIT\0"
- "GL_LIGHT_MODEL_AMBIENT\0"
- "GL_LIGHT_MODEL_COLOR_CONTROL\0"
- "GL_LIGHT_MODEL_COLOR_CONTROL_EXT\0"
- "GL_LIGHT_MODEL_LOCAL_VIEWER\0"
- "GL_LIGHT_MODEL_TWO_SIDE\0"
- "GL_LINE\0"
- "GL_LINEAR\0"
- "GL_LINEAR_ATTENUATION\0"
- "GL_LINEAR_CLIPMAP_LINEAR_SGIX\0"
- "GL_LINEAR_CLIPMAP_NEAREST_SGIX\0"
- "GL_LINEAR_MIPMAP_LINEAR\0"
- "GL_LINEAR_MIPMAP_NEAREST\0"
- "GL_LINES\0"
- "GL_LINES_ADJACENCY\0"
- "GL_LINES_ADJACENCY_ARB\0"
- "GL_LINE_BIT\0"
- "GL_LINE_LOOP\0"
- "GL_LINE_RESET_TOKEN\0"
- "GL_LINE_SMOOTH\0"
- "GL_LINE_SMOOTH_HINT\0"
- "GL_LINE_STIPPLE\0"
- "GL_LINE_STIPPLE_PATTERN\0"
- "GL_LINE_STIPPLE_REPEAT\0"
- "GL_LINE_STRIP\0"
- "GL_LINE_STRIP_ADJACENCY\0"
- "GL_LINE_STRIP_ADJACENCY_ARB\0"
- "GL_LINE_TOKEN\0"
- "GL_LINE_WIDTH\0"
- "GL_LINE_WIDTH_GRANULARITY\0"
- "GL_LINE_WIDTH_RANGE\0"
- "GL_LINK_STATUS\0"
- "GL_LIST_BASE\0"
- "GL_LIST_BIT\0"
- "GL_LIST_INDEX\0"
- "GL_LIST_MODE\0"
- "GL_LOAD\0"
- "GL_LOGIC_OP\0"
- "GL_LOGIC_OP_MODE\0"
- "GL_LOSE_CONTEXT_ON_RESET_ARB\0"
- "GL_LOWER_LEFT\0"
- "GL_LOW_FLOAT\0"
- "GL_LOW_INT\0"
- "GL_LUMINANCE\0"
- "GL_LUMINANCE12\0"
- "GL_LUMINANCE12_ALPHA12\0"
- "GL_LUMINANCE12_ALPHA12_EXT\0"
- "GL_LUMINANCE12_ALPHA4\0"
- "GL_LUMINANCE12_ALPHA4_EXT\0"
- "GL_LUMINANCE12_EXT\0"
- "GL_LUMINANCE16\0"
- "GL_LUMINANCE16I_EXT\0"
- "GL_LUMINANCE16UI_EXT\0"
- "GL_LUMINANCE16_ALPHA16\0"
- "GL_LUMINANCE16_ALPHA16_EXT\0"
- "GL_LUMINANCE16_EXT\0"
- "GL_LUMINANCE32I_EXT\0"
- "GL_LUMINANCE32UI_EXT\0"
- "GL_LUMINANCE4\0"
- "GL_LUMINANCE4_ALPHA4\0"
- "GL_LUMINANCE4_ALPHA4_EXT\0"
- "GL_LUMINANCE4_EXT\0"
- "GL_LUMINANCE6_ALPHA2\0"
- "GL_LUMINANCE6_ALPHA2_EXT\0"
- "GL_LUMINANCE8\0"
- "GL_LUMINANCE8I_EXT\0"
- "GL_LUMINANCE8UI_EXT\0"
- "GL_LUMINANCE8_ALPHA8\0"
- "GL_LUMINANCE8_ALPHA8_EXT\0"
- "GL_LUMINANCE8_EXT\0"
- "GL_LUMINANCE_ALPHA\0"
- "GL_LUMINANCE_ALPHA16I_EXT\0"
- "GL_LUMINANCE_ALPHA16UI_EXT\0"
- "GL_LUMINANCE_ALPHA32I_EXT\0"
- "GL_LUMINANCE_ALPHA32UI_EXT\0"
- "GL_LUMINANCE_ALPHA8I_EXT\0"
- "GL_LUMINANCE_ALPHA8UI_EXT\0"
- "GL_LUMINANCE_ALPHA_INTEGER_EXT\0"
- "GL_LUMINANCE_INTEGER_EXT\0"
- "GL_MAJOR_VERSION\0"
- "GL_MAP1_COLOR_4\0"
- "GL_MAP1_GRID_DOMAIN\0"
- "GL_MAP1_GRID_SEGMENTS\0"
- "GL_MAP1_INDEX\0"
- "GL_MAP1_NORMAL\0"
- "GL_MAP1_TEXTURE_COORD_1\0"
- "GL_MAP1_TEXTURE_COORD_2\0"
- "GL_MAP1_TEXTURE_COORD_3\0"
- "GL_MAP1_TEXTURE_COORD_4\0"
- "GL_MAP1_VERTEX_3\0"
- "GL_MAP1_VERTEX_4\0"
- "GL_MAP1_VERTEX_ATTRIB0_4_NV\0"
- "GL_MAP1_VERTEX_ATTRIB10_4_NV\0"
- "GL_MAP1_VERTEX_ATTRIB11_4_NV\0"
- "GL_MAP1_VERTEX_ATTRIB12_4_NV\0"
- "GL_MAP1_VERTEX_ATTRIB13_4_NV\0"
- "GL_MAP1_VERTEX_ATTRIB14_4_NV\0"
- "GL_MAP1_VERTEX_ATTRIB15_4_NV\0"
- "GL_MAP1_VERTEX_ATTRIB1_4_NV\0"
- "GL_MAP1_VERTEX_ATTRIB2_4_NV\0"
- "GL_MAP1_VERTEX_ATTRIB3_4_NV\0"
- "GL_MAP1_VERTEX_ATTRIB4_4_NV\0"
- "GL_MAP1_VERTEX_ATTRIB5_4_NV\0"
- "GL_MAP1_VERTEX_ATTRIB6_4_NV\0"
- "GL_MAP1_VERTEX_ATTRIB7_4_NV\0"
- "GL_MAP1_VERTEX_ATTRIB8_4_NV\0"
- "GL_MAP1_VERTEX_ATTRIB9_4_NV\0"
- "GL_MAP2_COLOR_4\0"
- "GL_MAP2_GRID_DOMAIN\0"
- "GL_MAP2_GRID_SEGMENTS\0"
- "GL_MAP2_INDEX\0"
- "GL_MAP2_NORMAL\0"
- "GL_MAP2_TEXTURE_COORD_1\0"
- "GL_MAP2_TEXTURE_COORD_2\0"
- "GL_MAP2_TEXTURE_COORD_3\0"
- "GL_MAP2_TEXTURE_COORD_4\0"
- "GL_MAP2_VERTEX_3\0"
- "GL_MAP2_VERTEX_4\0"
- "GL_MAP2_VERTEX_ATTRIB0_4_NV\0"
- "GL_MAP2_VERTEX_ATTRIB10_4_NV\0"
- "GL_MAP2_VERTEX_ATTRIB11_4_NV\0"
- "GL_MAP2_VERTEX_ATTRIB12_4_NV\0"
- "GL_MAP2_VERTEX_ATTRIB13_4_NV\0"
- "GL_MAP2_VERTEX_ATTRIB14_4_NV\0"
- "GL_MAP2_VERTEX_ATTRIB15_4_NV\0"
- "GL_MAP2_VERTEX_ATTRIB1_4_NV\0"
- "GL_MAP2_VERTEX_ATTRIB2_4_NV\0"
- "GL_MAP2_VERTEX_ATTRIB3_4_NV\0"
- "GL_MAP2_VERTEX_ATTRIB4_4_NV\0"
- "GL_MAP2_VERTEX_ATTRIB5_4_NV\0"
- "GL_MAP2_VERTEX_ATTRIB6_4_NV\0"
- "GL_MAP2_VERTEX_ATTRIB7_4_NV\0"
- "GL_MAP2_VERTEX_ATTRIB8_4_NV\0"
- "GL_MAP2_VERTEX_ATTRIB9_4_NV\0"
- "GL_MAP_COLOR\0"
- "GL_MAP_FLUSH_EXPLICIT_BIT\0"
- "GL_MAP_INVALIDATE_BUFFER_BIT\0"
- "GL_MAP_INVALIDATE_RANGE_BIT\0"
- "GL_MAP_READ_BIT\0"
- "GL_MAP_STENCIL\0"
- "GL_MAP_UNSYNCHRONIZED_BIT\0"
- "GL_MAP_WRITE_BIT\0"
- "GL_MATRIX0_ARB\0"
- "GL_MATRIX0_NV\0"
- "GL_MATRIX10_ARB\0"
- "GL_MATRIX11_ARB\0"
- "GL_MATRIX12_ARB\0"
- "GL_MATRIX13_ARB\0"
- "GL_MATRIX14_ARB\0"
- "GL_MATRIX15_ARB\0"
- "GL_MATRIX16_ARB\0"
- "GL_MATRIX17_ARB\0"
- "GL_MATRIX18_ARB\0"
- "GL_MATRIX19_ARB\0"
- "GL_MATRIX1_ARB\0"
- "GL_MATRIX1_NV\0"
- "GL_MATRIX20_ARB\0"
- "GL_MATRIX21_ARB\0"
- "GL_MATRIX22_ARB\0"
- "GL_MATRIX23_ARB\0"
- "GL_MATRIX24_ARB\0"
- "GL_MATRIX25_ARB\0"
- "GL_MATRIX26_ARB\0"
- "GL_MATRIX27_ARB\0"
- "GL_MATRIX28_ARB\0"
- "GL_MATRIX29_ARB\0"
- "GL_MATRIX2_ARB\0"
- "GL_MATRIX2_NV\0"
- "GL_MATRIX30_ARB\0"
- "GL_MATRIX31_ARB\0"
- "GL_MATRIX3_ARB\0"
- "GL_MATRIX3_NV\0"
- "GL_MATRIX4_ARB\0"
- "GL_MATRIX4_NV\0"
- "GL_MATRIX5_ARB\0"
- "GL_MATRIX5_NV\0"
- "GL_MATRIX6_ARB\0"
- "GL_MATRIX6_NV\0"
- "GL_MATRIX7_ARB\0"
- "GL_MATRIX7_NV\0"
- "GL_MATRIX8_ARB\0"
- "GL_MATRIX9_ARB\0"
- "GL_MATRIX_INDEX_ARRAY_ARB\0"
- "GL_MATRIX_INDEX_ARRAY_BUFFER_BINDING_OES\0"
- "GL_MATRIX_INDEX_ARRAY_OES\0"
- "GL_MATRIX_INDEX_ARRAY_POINTER_ARB\0"
- "GL_MATRIX_INDEX_ARRAY_POINTER_OES\0"
- "GL_MATRIX_INDEX_ARRAY_SIZE_ARB\0"
- "GL_MATRIX_INDEX_ARRAY_SIZE_OES\0"
- "GL_MATRIX_INDEX_ARRAY_STRIDE_ARB\0"
- "GL_MATRIX_INDEX_ARRAY_STRIDE_OES\0"
- "GL_MATRIX_INDEX_ARRAY_TYPE_ARB\0"
- "GL_MATRIX_INDEX_ARRAY_TYPE_OES\0"
- "GL_MATRIX_MODE\0"
- "GL_MATRIX_PALETTE_ARB\0"
- "GL_MATRIX_PALETTE_OES\0"
- "GL_MAX\0"
- "GL_MAX_3D_TEXTURE_SIZE\0"
- "GL_MAX_3D_TEXTURE_SIZE_OES\0"
- "GL_MAX_ARRAY_TEXTURE_LAYERS\0"
- "GL_MAX_ARRAY_TEXTURE_LAYERS_EXT\0"
- "GL_MAX_ATTRIB_STACK_DEPTH\0"
- "GL_MAX_CLIENT_ATTRIB_STACK_DEPTH\0"
- "GL_MAX_CLIPMAP_DEPTH_SGIX\0"
- "GL_MAX_CLIPMAP_VIRTUAL_DEPTH_SGIX\0"
- "GL_MAX_CLIP_DISTANCES\0"
- "GL_MAX_CLIP_PLANES\0"
- "GL_MAX_COLOR_ATTACHMENTS\0"
- "GL_MAX_COLOR_ATTACHMENTS_EXT\0"
- "GL_MAX_COLOR_MATRIX_STACK_DEPTH\0"
- "GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI\0"
- "GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS\0"
- "GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB\0"
- "GL_MAX_CONVOLUTION_HEIGHT\0"
- "GL_MAX_CONVOLUTION_HEIGHT_EXT\0"
- "GL_MAX_CONVOLUTION_WIDTH\0"
- "GL_MAX_CONVOLUTION_WIDTH_EXT\0"
- "GL_MAX_CUBE_MAP_TEXTURE_SIZE\0"
- "GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB\0"
- "GL_MAX_CUBE_MAP_TEXTURE_SIZE_OES\0"
- "GL_MAX_DRAW_BUFFERS\0"
- "GL_MAX_DRAW_BUFFERS_ARB\0"
- "GL_MAX_DRAW_BUFFERS_ATI\0"
- "GL_MAX_ELEMENTS_INDICES\0"
- "GL_MAX_ELEMENTS_VERTICES\0"
- "GL_MAX_EVAL_ORDER\0"
- "GL_MAX_EXT\0"
- "GL_MAX_FRAGMENT_INPUT_COMPONENTS\0"
- "GL_MAX_FRAGMENT_UNIFORM_COMPONENTS\0"
- "GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB\0"
- "GL_MAX_FRAGMENT_UNIFORM_VECTORS\0"
- "GL_MAX_GEOMETRY_INPUT_COMPONENTS\0"
- "GL_MAX_GEOMETRY_OUTPUT_COMPONENTS\0"
- "GL_MAX_GEOMETRY_OUTPUT_VERTICES\0"
- "GL_MAX_GEOMETRY_OUTPUT_VERTICES_ARB\0"
- "GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS\0"
- "GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_ARB\0"
- "GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS\0"
- "GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_ARB\0"
- "GL_MAX_GEOMETRY_UNIFORM_COMPONENTS\0"
- "GL_MAX_GEOMETRY_UNIFORM_COMPONENTS_ARB\0"
- "GL_MAX_GEOMETRY_VARYING_COMPONENTS_ARB\0"
- "GL_MAX_LIGHTS\0"
- "GL_MAX_LIST_NESTING\0"
- "GL_MAX_MATRIX_PALETTE_STACK_DEPTH_ARB\0"
- "GL_MAX_MODELVIEW_STACK_DEPTH\0"
- "GL_MAX_NAME_STACK_DEPTH\0"
- "GL_MAX_PALETTE_MATRICES_ARB\0"
- "GL_MAX_PALETTE_MATRICES_OES\0"
- "GL_MAX_PIXEL_MAP_TABLE\0"
- "GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB\0"
- "GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB\0"
- "GL_MAX_PROGRAM_ATTRIBS_ARB\0"
- "GL_MAX_PROGRAM_CALL_DEPTH_NV\0"
- "GL_MAX_PROGRAM_ENV_PARAMETERS_ARB\0"
- "GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV\0"
- "GL_MAX_PROGRAM_IF_DEPTH_NV\0"
- "GL_MAX_PROGRAM_INSTRUCTIONS_ARB\0"
- "GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB\0"
- "GL_MAX_PROGRAM_LOOP_COUNT_NV\0"
- "GL_MAX_PROGRAM_LOOP_DEPTH_NV\0"
- "GL_MAX_PROGRAM_MATRICES_ARB\0"
- "GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB\0"
- "GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB\0"
- "GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB\0"
- "GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB\0"
- "GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB\0"
- "GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB\0"
- "GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB\0"
- "GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB\0"
- "GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB\0"
- "GL_MAX_PROGRAM_PARAMETERS_ARB\0"
- "GL_MAX_PROGRAM_TEMPORARIES_ARB\0"
- "GL_MAX_PROGRAM_TEXEL_OFFSET\0"
- "GL_MAX_PROGRAM_TEXEL_OFFSET_EXT\0"
- "GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB\0"
- "GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB\0"
- "GL_MAX_PROJECTION_STACK_DEPTH\0"
- "GL_MAX_RECTANGLE_TEXTURE_SIZE\0"
- "GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB\0"
- "GL_MAX_RECTANGLE_TEXTURE_SIZE_NV\0"
- "GL_MAX_RENDERBUFFER_SIZE\0"
- "GL_MAX_RENDERBUFFER_SIZE_EXT\0"
- "GL_MAX_RENDERBUFFER_SIZE_OES\0"
- "GL_MAX_SAMPLES\0"
- "GL_MAX_SAMPLES_EXT\0"
- "GL_MAX_SERVER_WAIT_TIMEOUT\0"
- "GL_MAX_SHININESS_NV\0"
- "GL_MAX_SPOT_EXPONENT_NV\0"
- "GL_MAX_TEXTURE_BUFFER_SIZE\0"
- "GL_MAX_TEXTURE_BUFFER_SIZE_ARB\0"
- "GL_MAX_TEXTURE_COORDS\0"
- "GL_MAX_TEXTURE_COORDS_ARB\0"
- "GL_MAX_TEXTURE_IMAGE_UNITS\0"
- "GL_MAX_TEXTURE_IMAGE_UNITS_ARB\0"
- "GL_MAX_TEXTURE_LOD_BIAS\0"
- "GL_MAX_TEXTURE_LOD_BIAS_EXT\0"
- "GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT\0"
- "GL_MAX_TEXTURE_SIZE\0"
- "GL_MAX_TEXTURE_STACK_DEPTH\0"
- "GL_MAX_TEXTURE_UNITS\0"
- "GL_MAX_TEXTURE_UNITS_ARB\0"
- "GL_MAX_TRACK_MATRICES_NV\0"
- "GL_MAX_TRACK_MATRIX_STACK_DEPTH_NV\0"
- "GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS\0"
- "GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS_EXT\0"
- "GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS\0"
- "GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS_EXT\0"
- "GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS\0"
- "GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS_EXT\0"
- "GL_MAX_VARYING_COMPONENTS\0"
- "GL_MAX_VARYING_FLOATS\0"
- "GL_MAX_VARYING_FLOATS_ARB\0"
- "GL_MAX_VARYING_VECTORS\0"
- "GL_MAX_VERTEX_ATTRIBS\0"
- "GL_MAX_VERTEX_ATTRIBS_ARB\0"
- "GL_MAX_VERTEX_OUTPUT_COMPONENTS\0"
- "GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS\0"
- "GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB\0"
- "GL_MAX_VERTEX_UNIFORM_COMPONENTS\0"
- "GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB\0"
- "GL_MAX_VERTEX_UNIFORM_VECTORS\0"
- "GL_MAX_VERTEX_UNITS_ARB\0"
- "GL_MAX_VERTEX_UNITS_OES\0"
- "GL_MAX_VERTEX_VARYING_COMPONENTS_ARB\0"
- "GL_MAX_VIEWPORT_DIMS\0"
- "GL_MEDIUM_FLOAT\0"
- "GL_MEDIUM_INT\0"
- "GL_MIN\0"
- "GL_MINMAX\0"
- "GL_MINMAX_EXT\0"
- "GL_MINMAX_FORMAT\0"
- "GL_MINMAX_FORMAT_EXT\0"
- "GL_MINMAX_SINK\0"
- "GL_MINMAX_SINK_EXT\0"
- "GL_MINOR_VERSION\0"
- "GL_MIN_EXT\0"
- "GL_MIN_PROGRAM_TEXEL_OFFSET\0"
- "GL_MIN_PROGRAM_TEXEL_OFFSET_EXT\0"
- "GL_MIRRORED_REPEAT\0"
- "GL_MIRRORED_REPEAT_ARB\0"
- "GL_MIRRORED_REPEAT_IBM\0"
- "GL_MIRROR_CLAMP_ATI\0"
- "GL_MIRROR_CLAMP_EXT\0"
- "GL_MIRROR_CLAMP_TO_BORDER_EXT\0"
- "GL_MIRROR_CLAMP_TO_EDGE_ATI\0"
- "GL_MIRROR_CLAMP_TO_EDGE_EXT\0"
- "GL_MODELVIEW\0"
- "GL_MODELVIEW0_ARB\0"
- "GL_MODELVIEW10_ARB\0"
- "GL_MODELVIEW11_ARB\0"
- "GL_MODELVIEW12_ARB\0"
- "GL_MODELVIEW13_ARB\0"
- "GL_MODELVIEW14_ARB\0"
- "GL_MODELVIEW15_ARB\0"
- "GL_MODELVIEW16_ARB\0"
- "GL_MODELVIEW17_ARB\0"
- "GL_MODELVIEW18_ARB\0"
- "GL_MODELVIEW19_ARB\0"
- "GL_MODELVIEW1_ARB\0"
- "GL_MODELVIEW20_ARB\0"
- "GL_MODELVIEW21_ARB\0"
- "GL_MODELVIEW22_ARB\0"
- "GL_MODELVIEW23_ARB\0"
- "GL_MODELVIEW24_ARB\0"
- "GL_MODELVIEW25_ARB\0"
- "GL_MODELVIEW26_ARB\0"
- "GL_MODELVIEW27_ARB\0"
- "GL_MODELVIEW28_ARB\0"
- "GL_MODELVIEW29_ARB\0"
- "GL_MODELVIEW2_ARB\0"
- "GL_MODELVIEW30_ARB\0"
- "GL_MODELVIEW31_ARB\0"
- "GL_MODELVIEW3_ARB\0"
- "GL_MODELVIEW4_ARB\0"
- "GL_MODELVIEW5_ARB\0"
- "GL_MODELVIEW6_ARB\0"
- "GL_MODELVIEW7_ARB\0"
- "GL_MODELVIEW8_ARB\0"
- "GL_MODELVIEW9_ARB\0"
- "GL_MODELVIEW_MATRIX\0"
- "GL_MODELVIEW_MATRIX_FLOAT_AS_INT_BITS_OES\0"
- "GL_MODELVIEW_PROJECTION_NV\0"
- "GL_MODELVIEW_STACK_DEPTH\0"
- "GL_MODULATE\0"
- "GL_MODULATE_ADD_ATI\0"
- "GL_MODULATE_SIGNED_ADD_ATI\0"
- "GL_MODULATE_SUBTRACT_ATI\0"
- "GL_MULT\0"
- "GL_MULTISAMPLE\0"
- "GL_MULTISAMPLE_3DFX\0"
- "GL_MULTISAMPLE_ARB\0"
- "GL_MULTISAMPLE_BIT\0"
- "GL_MULTISAMPLE_BIT_3DFX\0"
- "GL_MULTISAMPLE_BIT_ARB\0"
- "GL_MULTISAMPLE_FILTER_HINT_NV\0"
- "GL_N3F_V3F\0"
- "GL_NAME_STACK_DEPTH\0"
- "GL_NAND\0"
- "GL_NEAREST\0"
- "GL_NEAREST_CLIPMAP_LINEAR_SGIX\0"
- "GL_NEAREST_CLIPMAP_NEAREST_SGIX\0"
- "GL_NEAREST_MIPMAP_LINEAR\0"
- "GL_NEAREST_MIPMAP_NEAREST\0"
- "GL_NEVER\0"
- "GL_NICEST\0"
- "GL_NONE\0"
- "GL_NONE_OES\0"
- "GL_NOOP\0"
- "GL_NOR\0"
- "GL_NORMALIZE\0"
- "GL_NORMAL_ARRAY\0"
- "GL_NORMAL_ARRAY_BUFFER_BINDING\0"
- "GL_NORMAL_ARRAY_BUFFER_BINDING_ARB\0"
- "GL_NORMAL_ARRAY_POINTER\0"
- "GL_NORMAL_ARRAY_STRIDE\0"
- "GL_NORMAL_ARRAY_TYPE\0"
- "GL_NORMAL_MAP\0"
- "GL_NORMAL_MAP_ARB\0"
- "GL_NORMAL_MAP_NV\0"
- "GL_NORMAL_MAP_OES\0"
- "GL_NOTEQUAL\0"
- "GL_NO_ERROR\0"
- "GL_NO_RESET_NOTIFICATION_ARB\0"
- "GL_NUM_COMPRESSED_TEXTURE_FORMATS\0"
- "GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB\0"
- "GL_NUM_EXTENSIONS\0"
- "GL_NUM_PROGRAM_BINARY_FORMATS_OES\0"
- "GL_NUM_SHADER_BINARY_FORMATS\0"
- "GL_OBJECT_ACTIVE_ATTRIBUTES_ARB\0"
- "GL_OBJECT_ACTIVE_ATTRIBUTE_MAX_LENGTH_ARB\0"
- "GL_OBJECT_ACTIVE_UNIFORMS_ARB\0"
- "GL_OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB\0"
- "GL_OBJECT_ATTACHED_OBJECTS_ARB\0"
- "GL_OBJECT_COMPILE_STATUS_ARB\0"
- "GL_OBJECT_DELETE_STATUS_ARB\0"
- "GL_OBJECT_INFO_LOG_LENGTH_ARB\0"
- "GL_OBJECT_LINEAR\0"
- "GL_OBJECT_LINK_STATUS_ARB\0"
- "GL_OBJECT_PLANE\0"
- "GL_OBJECT_SHADER_SOURCE_LENGTH_ARB\0"
- "GL_OBJECT_SUBTYPE_ARB\0"
- "GL_OBJECT_TYPE\0"
- "GL_OBJECT_TYPE_ARB\0"
- "GL_OBJECT_VALIDATE_STATUS_ARB\0"
- "GL_OCCLUSION_TEST_HP\0"
- "GL_OCCLUSION_TEST_RESULT_HP\0"
- "GL_ONE\0"
- "GL_ONE_MINUS_CONSTANT_ALPHA\0"
- "GL_ONE_MINUS_CONSTANT_ALPHA_EXT\0"
- "GL_ONE_MINUS_CONSTANT_COLOR\0"
- "GL_ONE_MINUS_CONSTANT_COLOR_EXT\0"
- "GL_ONE_MINUS_DST_ALPHA\0"
- "GL_ONE_MINUS_DST_COLOR\0"
- "GL_ONE_MINUS_SRC_ALPHA\0"
- "GL_ONE_MINUS_SRC_COLOR\0"
- "GL_OPERAND0_ALPHA\0"
- "GL_OPERAND0_ALPHA_ARB\0"
- "GL_OPERAND0_ALPHA_EXT\0"
- "GL_OPERAND0_RGB\0"
- "GL_OPERAND0_RGB_ARB\0"
- "GL_OPERAND0_RGB_EXT\0"
- "GL_OPERAND1_ALPHA\0"
- "GL_OPERAND1_ALPHA_ARB\0"
- "GL_OPERAND1_ALPHA_EXT\0"
- "GL_OPERAND1_RGB\0"
- "GL_OPERAND1_RGB_ARB\0"
- "GL_OPERAND1_RGB_EXT\0"
- "GL_OPERAND2_ALPHA\0"
- "GL_OPERAND2_ALPHA_ARB\0"
- "GL_OPERAND2_ALPHA_EXT\0"
- "GL_OPERAND2_RGB\0"
- "GL_OPERAND2_RGB_ARB\0"
- "GL_OPERAND2_RGB_EXT\0"
- "GL_OPERAND3_ALPHA_NV\0"
- "GL_OPERAND3_RGB_NV\0"
- "GL_OR\0"
- "GL_ORDER\0"
- "GL_OR_INVERTED\0"
- "GL_OR_REVERSE\0"
- "GL_OUT_OF_MEMORY\0"
- "GL_PACK_ALIGNMENT\0"
- "GL_PACK_IMAGE_HEIGHT\0"
- "GL_PACK_INVERT_MESA\0"
- "GL_PACK_LSB_FIRST\0"
- "GL_PACK_ROW_LENGTH\0"
- "GL_PACK_SKIP_IMAGES\0"
- "GL_PACK_SKIP_PIXELS\0"
- "GL_PACK_SKIP_ROWS\0"
- "GL_PACK_SWAP_BYTES\0"
- "GL_PALETTE4_R5_G6_B5_OES\0"
- "GL_PALETTE4_RGB5_A1_OES\0"
- "GL_PALETTE4_RGB8_OES\0"
- "GL_PALETTE4_RGBA4_OES\0"
- "GL_PALETTE4_RGBA8_OES\0"
- "GL_PALETTE8_R5_G6_B5_OES\0"
- "GL_PALETTE8_RGB5_A1_OES\0"
- "GL_PALETTE8_RGB8_OES\0"
- "GL_PALETTE8_RGBA4_OES\0"
- "GL_PALETTE8_RGBA8_OES\0"
- "GL_PASS_THROUGH_TOKEN\0"
- "GL_PERSPECTIVE_CORRECTION_HINT\0"
- "GL_PIXEL_MAP_A_TO_A\0"
- "GL_PIXEL_MAP_A_TO_A_SIZE\0"
- "GL_PIXEL_MAP_B_TO_B\0"
- "GL_PIXEL_MAP_B_TO_B_SIZE\0"
- "GL_PIXEL_MAP_G_TO_G\0"
- "GL_PIXEL_MAP_G_TO_G_SIZE\0"
- "GL_PIXEL_MAP_I_TO_A\0"
- "GL_PIXEL_MAP_I_TO_A_SIZE\0"
- "GL_PIXEL_MAP_I_TO_B\0"
- "GL_PIXEL_MAP_I_TO_B_SIZE\0"
- "GL_PIXEL_MAP_I_TO_G\0"
- "GL_PIXEL_MAP_I_TO_G_SIZE\0"
- "GL_PIXEL_MAP_I_TO_I\0"
- "GL_PIXEL_MAP_I_TO_I_SIZE\0"
- "GL_PIXEL_MAP_I_TO_R\0"
- "GL_PIXEL_MAP_I_TO_R_SIZE\0"
- "GL_PIXEL_MAP_R_TO_R\0"
- "GL_PIXEL_MAP_R_TO_R_SIZE\0"
- "GL_PIXEL_MAP_S_TO_S\0"
- "GL_PIXEL_MAP_S_TO_S_SIZE\0"
- "GL_PIXEL_MODE_BIT\0"
- "GL_PIXEL_PACK_BUFFER\0"
- "GL_PIXEL_PACK_BUFFER_BINDING\0"
- "GL_PIXEL_PACK_BUFFER_BINDING_EXT\0"
- "GL_PIXEL_PACK_BUFFER_EXT\0"
- "GL_PIXEL_UNPACK_BUFFER\0"
- "GL_PIXEL_UNPACK_BUFFER_BINDING\0"
- "GL_PIXEL_UNPACK_BUFFER_BINDING_EXT\0"
- "GL_PIXEL_UNPACK_BUFFER_EXT\0"
- "GL_POINT\0"
- "GL_POINTS\0"
- "GL_POINT_BIT\0"
- "GL_POINT_DISTANCE_ATTENUATION\0"
- "GL_POINT_DISTANCE_ATTENUATION_ARB\0"
- "GL_POINT_DISTANCE_ATTENUATION_EXT\0"
- "GL_POINT_DISTANCE_ATTENUATION_SGIS\0"
- "GL_POINT_FADE_THRESHOLD_SIZE\0"
- "GL_POINT_FADE_THRESHOLD_SIZE_ARB\0"
- "GL_POINT_FADE_THRESHOLD_SIZE_EXT\0"
- "GL_POINT_FADE_THRESHOLD_SIZE_SGIS\0"
- "GL_POINT_SIZE\0"
- "GL_POINT_SIZE_ARRAY_BUFFER_BINDING_OES\0"
- "GL_POINT_SIZE_ARRAY_OES\0"
- "GL_POINT_SIZE_ARRAY_POINTER_OES\0"
- "GL_POINT_SIZE_ARRAY_STRIDE_OES\0"
- "GL_POINT_SIZE_ARRAY_TYPE_OES\0"
- "GL_POINT_SIZE_GRANULARITY\0"
- "GL_POINT_SIZE_MAX\0"
- "GL_POINT_SIZE_MAX_ARB\0"
- "GL_POINT_SIZE_MAX_EXT\0"
- "GL_POINT_SIZE_MAX_SGIS\0"
- "GL_POINT_SIZE_MIN\0"
- "GL_POINT_SIZE_MIN_ARB\0"
- "GL_POINT_SIZE_MIN_EXT\0"
- "GL_POINT_SIZE_MIN_SGIS\0"
- "GL_POINT_SIZE_RANGE\0"
- "GL_POINT_SMOOTH\0"
- "GL_POINT_SMOOTH_HINT\0"
- "GL_POINT_SPRITE\0"
- "GL_POINT_SPRITE_ARB\0"
- "GL_POINT_SPRITE_COORD_ORIGIN\0"
- "GL_POINT_SPRITE_NV\0"
- "GL_POINT_SPRITE_OES\0"
- "GL_POINT_SPRITE_R_MODE_NV\0"
- "GL_POINT_TOKEN\0"
- "GL_POLYGON\0"
- "GL_POLYGON_BIT\0"
- "GL_POLYGON_MODE\0"
- "GL_POLYGON_OFFSET_BIAS\0"
- "GL_POLYGON_OFFSET_FACTOR\0"
- "GL_POLYGON_OFFSET_FILL\0"
- "GL_POLYGON_OFFSET_LINE\0"
- "GL_POLYGON_OFFSET_POINT\0"
- "GL_POLYGON_OFFSET_UNITS\0"
- "GL_POLYGON_SMOOTH\0"
- "GL_POLYGON_SMOOTH_HINT\0"
- "GL_POLYGON_STIPPLE\0"
- "GL_POLYGON_STIPPLE_BIT\0"
- "GL_POLYGON_TOKEN\0"
- "GL_POSITION\0"
- "GL_POST_COLOR_MATRIX_ALPHA_BIAS\0"
- "GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI\0"
- "GL_POST_COLOR_MATRIX_ALPHA_SCALE\0"
- "GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI\0"
- "GL_POST_COLOR_MATRIX_BLUE_BIAS\0"
- "GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI\0"
- "GL_POST_COLOR_MATRIX_BLUE_SCALE\0"
- "GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI\0"
- "GL_POST_COLOR_MATRIX_COLOR_TABLE\0"
- "GL_POST_COLOR_MATRIX_GREEN_BIAS\0"
- "GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI\0"
- "GL_POST_COLOR_MATRIX_GREEN_SCALE\0"
- "GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI\0"
- "GL_POST_COLOR_MATRIX_RED_BIAS\0"
- "GL_POST_COLOR_MATRIX_RED_BIAS_SGI\0"
- "GL_POST_COLOR_MATRIX_RED_SCALE\0"
- "GL_POST_COLOR_MATRIX_RED_SCALE_SGI\0"
- "GL_POST_CONVOLUTION_ALPHA_BIAS\0"
- "GL_POST_CONVOLUTION_ALPHA_BIAS_EXT\0"
- "GL_POST_CONVOLUTION_ALPHA_SCALE\0"
- "GL_POST_CONVOLUTION_ALPHA_SCALE_EXT\0"
- "GL_POST_CONVOLUTION_BLUE_BIAS\0"
- "GL_POST_CONVOLUTION_BLUE_BIAS_EXT\0"
- "GL_POST_CONVOLUTION_BLUE_SCALE\0"
- "GL_POST_CONVOLUTION_BLUE_SCALE_EXT\0"
- "GL_POST_CONVOLUTION_COLOR_TABLE\0"
- "GL_POST_CONVOLUTION_GREEN_BIAS\0"
- "GL_POST_CONVOLUTION_GREEN_BIAS_EXT\0"
- "GL_POST_CONVOLUTION_GREEN_SCALE\0"
- "GL_POST_CONVOLUTION_GREEN_SCALE_EXT\0"
- "GL_POST_CONVOLUTION_RED_BIAS\0"
- "GL_POST_CONVOLUTION_RED_BIAS_EXT\0"
- "GL_POST_CONVOLUTION_RED_SCALE\0"
- "GL_POST_CONVOLUTION_RED_SCALE_EXT\0"
- "GL_POST_TEXTURE_FILTER_BIAS_RANGE_SGIX\0"
- "GL_POST_TEXTURE_FILTER_BIAS_SGIX\0"
- "GL_POST_TEXTURE_FILTER_SCALE_RANGE_SGIX\0"
- "GL_POST_TEXTURE_FILTER_SCALE_SGIX\0"
- "GL_PREVIOUS\0"
- "GL_PREVIOUS_ARB\0"
- "GL_PREVIOUS_EXT\0"
- "GL_PRIMARY_COLOR\0"
- "GL_PRIMARY_COLOR_ARB\0"
- "GL_PRIMARY_COLOR_EXT\0"
- "GL_PRIMITIVES_GENERATED\0"
- "GL_PRIMITIVES_GENERATED_EXT\0"
- "GL_PRIMITIVE_RESTART\0"
- "GL_PRIMITIVE_RESTART_INDEX\0"
- "GL_PRIMITIVE_RESTART_INDEX_NV\0"
- "GL_PRIMITIVE_RESTART_NV\0"
- "GL_PROGRAM_ADDRESS_REGISTERS_ARB\0"
- "GL_PROGRAM_ALU_INSTRUCTIONS_ARB\0"
- "GL_PROGRAM_ATTRIBS_ARB\0"
- "GL_PROGRAM_BINARY_FORMATS_OES\0"
- "GL_PROGRAM_BINARY_LENGTH_OES\0"
- "GL_PROGRAM_BINDING_ARB\0"
- "GL_PROGRAM_ERROR_POSITION_ARB\0"
- "GL_PROGRAM_ERROR_POSITION_NV\0"
- "GL_PROGRAM_ERROR_STRING_ARB\0"
- "GL_PROGRAM_FORMAT_ARB\0"
- "GL_PROGRAM_FORMAT_ASCII_ARB\0"
- "GL_PROGRAM_INSTRUCTIONS_ARB\0"
- "GL_PROGRAM_LENGTH_ARB\0"
- "GL_PROGRAM_LENGTH_NV\0"
- "GL_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB\0"
- "GL_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB\0"
- "GL_PROGRAM_NATIVE_ATTRIBS_ARB\0"
- "GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB\0"
- "GL_PROGRAM_NATIVE_PARAMETERS_ARB\0"
- "GL_PROGRAM_NATIVE_TEMPORARIES_ARB\0"
- "GL_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB\0"
- "GL_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB\0"
- "GL_PROGRAM_OBJECT_ARB\0"
- "GL_PROGRAM_PARAMETERS_ARB\0"
- "GL_PROGRAM_PARAMETER_NV\0"
- "GL_PROGRAM_POINT_SIZE\0"
- "GL_PROGRAM_POINT_SIZE_ARB\0"
- "GL_PROGRAM_RESIDENT_NV\0"
- "GL_PROGRAM_STRING_ARB\0"
- "GL_PROGRAM_STRING_NV\0"
- "GL_PROGRAM_TARGET_NV\0"
- "GL_PROGRAM_TEMPORARIES_ARB\0"
- "GL_PROGRAM_TEX_INDIRECTIONS_ARB\0"
- "GL_PROGRAM_TEX_INSTRUCTIONS_ARB\0"
- "GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB\0"
- "GL_PROJECTION\0"
- "GL_PROJECTION_MATRIX\0"
- "GL_PROJECTION_MATRIX_FLOAT_AS_INT_BITS_OES\0"
- "GL_PROJECTION_STACK_DEPTH\0"
- "GL_PROVOKING_VERTEX\0"
- "GL_PROVOKING_VERTEX_EXT\0"
- "GL_PROXY_COLOR_TABLE\0"
- "GL_PROXY_HISTOGRAM\0"
- "GL_PROXY_HISTOGRAM_EXT\0"
- "GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE\0"
- "GL_PROXY_POST_CONVOLUTION_COLOR_TABLE\0"
- "GL_PROXY_TEXTURE_1D\0"
- "GL_PROXY_TEXTURE_1D_ARRAY\0"
- "GL_PROXY_TEXTURE_1D_ARRAY_EXT\0"
- "GL_PROXY_TEXTURE_1D_EXT\0"
- "GL_PROXY_TEXTURE_2D\0"
- "GL_PROXY_TEXTURE_2D_ARRAY\0"
- "GL_PROXY_TEXTURE_2D_ARRAY_EXT\0"
- "GL_PROXY_TEXTURE_2D_EXT\0"
- "GL_PROXY_TEXTURE_3D\0"
- "GL_PROXY_TEXTURE_COLOR_TABLE_SGI\0"
- "GL_PROXY_TEXTURE_CUBE_MAP\0"
- "GL_PROXY_TEXTURE_CUBE_MAP_ARB\0"
- "GL_PROXY_TEXTURE_RECTANGLE\0"
- "GL_PROXY_TEXTURE_RECTANGLE_ARB\0"
- "GL_PROXY_TEXTURE_RECTANGLE_NV\0"
- "GL_PURGEABLE_APPLE\0"
- "GL_Q\0"
- "GL_QUADRATIC_ATTENUATION\0"
- "GL_QUADS\0"
- "GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION\0"
- "GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION_EXT\0"
- "GL_QUAD_MESH_SUN\0"
- "GL_QUAD_STRIP\0"
- "GL_QUERY_BY_REGION_NO_WAIT\0"
- "GL_QUERY_BY_REGION_NO_WAIT_NV\0"
- "GL_QUERY_BY_REGION_WAIT\0"
- "GL_QUERY_BY_REGION_WAIT_NV\0"
- "GL_QUERY_COUNTER_BITS\0"
- "GL_QUERY_COUNTER_BITS_ARB\0"
- "GL_QUERY_NO_WAIT\0"
- "GL_QUERY_NO_WAIT_NV\0"
- "GL_QUERY_RESULT\0"
- "GL_QUERY_RESULT_ARB\0"
- "GL_QUERY_RESULT_AVAILABLE\0"
- "GL_QUERY_RESULT_AVAILABLE_ARB\0"
- "GL_QUERY_WAIT\0"
- "GL_QUERY_WAIT_NV\0"
- "GL_R\0"
- "GL_R11F_G11F_B10F\0"
- "GL_R16_SNORM\0"
- "GL_R3_G3_B2\0"
- "GL_R8_SNORM\0"
- "GL_RASTERIZER_DISCARD\0"
- "GL_RASTERIZER_DISCARD_EXT\0"
- "GL_RASTER_POSITION_UNCLIPPED_IBM\0"
- "GL_READ_BUFFER\0"
- "GL_READ_FRAMEBUFFER\0"
- "GL_READ_FRAMEBUFFER_BINDING\0"
- "GL_READ_FRAMEBUFFER_BINDING_EXT\0"
- "GL_READ_FRAMEBUFFER_EXT\0"
- "GL_READ_ONLY\0"
- "GL_READ_ONLY_ARB\0"
- "GL_READ_WRITE\0"
- "GL_READ_WRITE_ARB\0"
- "GL_RED\0"
- "GL_REDUCE\0"
- "GL_REDUCE_EXT\0"
- "GL_RED_BIAS\0"
- "GL_RED_BITS\0"
- "GL_RED_INTEGER\0"
- "GL_RED_INTEGER_EXT\0"
- "GL_RED_SCALE\0"
- "GL_RED_SNORM\0"
- "GL_REFLECTION_MAP\0"
- "GL_REFLECTION_MAP_ARB\0"
- "GL_REFLECTION_MAP_NV\0"
- "GL_REFLECTION_MAP_OES\0"
- "GL_RELEASED_APPLE\0"
- "GL_RENDER\0"
- "GL_RENDERBUFFER\0"
- "GL_RENDERBUFFER_ALPHA_SIZE\0"
- "GL_RENDERBUFFER_ALPHA_SIZE_OES\0"
- "GL_RENDERBUFFER_BINDING\0"
- "GL_RENDERBUFFER_BINDING_EXT\0"
- "GL_RENDERBUFFER_BINDING_OES\0"
- "GL_RENDERBUFFER_BLUE_SIZE\0"
- "GL_RENDERBUFFER_BLUE_SIZE_OES\0"
- "GL_RENDERBUFFER_DEPTH_SIZE\0"
- "GL_RENDERBUFFER_DEPTH_SIZE_OES\0"
- "GL_RENDERBUFFER_EXT\0"
- "GL_RENDERBUFFER_GREEN_SIZE\0"
- "GL_RENDERBUFFER_GREEN_SIZE_OES\0"
- "GL_RENDERBUFFER_HEIGHT\0"
- "GL_RENDERBUFFER_HEIGHT_EXT\0"
- "GL_RENDERBUFFER_HEIGHT_OES\0"
- "GL_RENDERBUFFER_INTERNAL_FORMAT\0"
- "GL_RENDERBUFFER_INTERNAL_FORMAT_EXT\0"
- "GL_RENDERBUFFER_INTERNAL_FORMAT_OES\0"
- "GL_RENDERBUFFER_OES\0"
- "GL_RENDERBUFFER_RED_SIZE\0"
- "GL_RENDERBUFFER_RED_SIZE_OES\0"
- "GL_RENDERBUFFER_SAMPLES\0"
- "GL_RENDERBUFFER_SAMPLES_EXT\0"
- "GL_RENDERBUFFER_STENCIL_SIZE\0"
- "GL_RENDERBUFFER_STENCIL_SIZE_OES\0"
- "GL_RENDERBUFFER_WIDTH\0"
- "GL_RENDERBUFFER_WIDTH_EXT\0"
- "GL_RENDERBUFFER_WIDTH_OES\0"
- "GL_RENDERER\0"
- "GL_RENDER_MODE\0"
- "GL_REPEAT\0"
- "GL_REPLACE\0"
- "GL_REPLACE_EXT\0"
- "GL_REPLICATE_BORDER_HP\0"
- "GL_RESCALE_NORMAL\0"
- "GL_RESCALE_NORMAL_EXT\0"
- "GL_RESET_NOTIFICATION_STRATEGY_ARB\0"
- "GL_RETAINED_APPLE\0"
- "GL_RETURN\0"
- "GL_RG16_SNORM\0"
- "GL_RG8_SNORM\0"
- "GL_RGB\0"
- "GL_RGB10\0"
- "GL_RGB10_A2\0"
- "GL_RGB10_A2_EXT\0"
- "GL_RGB10_EXT\0"
- "GL_RGB12\0"
- "GL_RGB12_EXT\0"
- "GL_RGB16\0"
- "GL_RGB16F\0"
- "GL_RGB16I\0"
- "GL_RGB16I_EXT\0"
- "GL_RGB16UI\0"
- "GL_RGB16UI_EXT\0"
- "GL_RGB16_EXT\0"
- "GL_RGB16_SNORM\0"
- "GL_RGB2_EXT\0"
- "GL_RGB32F\0"
- "GL_RGB32I\0"
- "GL_RGB32I_EXT\0"
- "GL_RGB32UI\0"
- "GL_RGB32UI_EXT\0"
- "GL_RGB4\0"
- "GL_RGB4_EXT\0"
- "GL_RGB4_S3TC\0"
- "GL_RGB5\0"
- "GL_RGB565\0"
- "GL_RGB565_OES\0"
- "GL_RGB5_A1\0"
- "GL_RGB5_A1_EXT\0"
- "GL_RGB5_A1_OES\0"
- "GL_RGB5_EXT\0"
- "GL_RGB8\0"
- "GL_RGB8I\0"
- "GL_RGB8I_EXT\0"
- "GL_RGB8UI\0"
- "GL_RGB8UI_EXT\0"
- "GL_RGB8_EXT\0"
- "GL_RGB8_OES\0"
- "GL_RGB8_SNORM\0"
- "GL_RGB9_E5\0"
- "GL_RGBA\0"
- "GL_RGBA12\0"
- "GL_RGBA12_EXT\0"
- "GL_RGBA16\0"
- "GL_RGBA16F\0"
- "GL_RGBA16I\0"
- "GL_RGBA16I_EXT\0"
- "GL_RGBA16UI\0"
- "GL_RGBA16UI_EXT\0"
- "GL_RGBA16_EXT\0"
- "GL_RGBA16_SNORM\0"
- "GL_RGBA2\0"
- "GL_RGBA2_EXT\0"
- "GL_RGBA32F\0"
- "GL_RGBA32I\0"
- "GL_RGBA32I_EXT\0"
- "GL_RGBA32UI\0"
- "GL_RGBA32UI_EXT\0"
- "GL_RGBA4\0"
- "GL_RGBA4_DXT5_S3TC\0"
- "GL_RGBA4_EXT\0"
- "GL_RGBA4_OES\0"
- "GL_RGBA4_S3TC\0"
- "GL_RGBA8\0"
- "GL_RGBA8I\0"
- "GL_RGBA8I_EXT\0"
- "GL_RGBA8UI\0"
- "GL_RGBA8UI_EXT\0"
- "GL_RGBA8_EXT\0"
- "GL_RGBA8_OES\0"
- "GL_RGBA8_SNORM\0"
- "GL_RGBA_DXT5_S3TC\0"
- "GL_RGBA_FLOAT_MODE_ARB\0"
- "GL_RGBA_INTEGER\0"
- "GL_RGBA_INTEGER_EXT\0"
- "GL_RGBA_INTEGER_MODE_EXT\0"
- "GL_RGBA_MODE\0"
- "GL_RGBA_S3TC\0"
- "GL_RGBA_SNORM\0"
- "GL_RGB_INTEGER\0"
- "GL_RGB_INTEGER_EXT\0"
- "GL_RGB_S3TC\0"
- "GL_RGB_SCALE\0"
- "GL_RGB_SCALE_ARB\0"
- "GL_RGB_SCALE_EXT\0"
- "GL_RGB_SNORM\0"
- "GL_RG_SNORM\0"
- "GL_RIGHT\0"
- "GL_S\0"
- "GL_SAMPLER_1D\0"
- "GL_SAMPLER_1D_ARRAY\0"
- "GL_SAMPLER_1D_ARRAY_EXT\0"
- "GL_SAMPLER_1D_ARRAY_SHADOW\0"
- "GL_SAMPLER_1D_ARRAY_SHADOW_EXT\0"
- "GL_SAMPLER_1D_SHADOW\0"
- "GL_SAMPLER_2D\0"
- "GL_SAMPLER_2D_ARRAY\0"
- "GL_SAMPLER_2D_ARRAY_EXT\0"
- "GL_SAMPLER_2D_ARRAY_SHADOW\0"
- "GL_SAMPLER_2D_ARRAY_SHADOW_EXT\0"
- "GL_SAMPLER_2D_RECT\0"
- "GL_SAMPLER_2D_RECT_SHADOW\0"
- "GL_SAMPLER_2D_SHADOW\0"
- "GL_SAMPLER_3D\0"
- "GL_SAMPLER_3D_OES\0"
- "GL_SAMPLER_BINDING\0"
- "GL_SAMPLER_BUFFER\0"
- "GL_SAMPLER_BUFFER_EXT\0"
- "GL_SAMPLER_CUBE\0"
- "GL_SAMPLER_CUBE_SHADOW\0"
- "GL_SAMPLER_CUBE_SHADOW_EXT\0"
- "GL_SAMPLES\0"
- "GL_SAMPLES_3DFX\0"
- "GL_SAMPLES_ARB\0"
- "GL_SAMPLES_PASSED\0"
- "GL_SAMPLES_PASSED_ARB\0"
- "GL_SAMPLE_ALPHA_TO_COVERAGE\0"
- "GL_SAMPLE_ALPHA_TO_COVERAGE_ARB\0"
- "GL_SAMPLE_ALPHA_TO_ONE\0"
- "GL_SAMPLE_ALPHA_TO_ONE_ARB\0"
- "GL_SAMPLE_BUFFERS\0"
- "GL_SAMPLE_BUFFERS_3DFX\0"
- "GL_SAMPLE_BUFFERS_ARB\0"
- "GL_SAMPLE_COVERAGE\0"
- "GL_SAMPLE_COVERAGE_ARB\0"
- "GL_SAMPLE_COVERAGE_INVERT\0"
- "GL_SAMPLE_COVERAGE_INVERT_ARB\0"
- "GL_SAMPLE_COVERAGE_VALUE\0"
- "GL_SAMPLE_COVERAGE_VALUE_ARB\0"
- "GL_SCISSOR_BIT\0"
- "GL_SCISSOR_BOX\0"
- "GL_SCISSOR_TEST\0"
- "GL_SECONDARY_COLOR_ARRAY\0"
- "GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING\0"
- "GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB\0"
- "GL_SECONDARY_COLOR_ARRAY_POINTER\0"
- "GL_SECONDARY_COLOR_ARRAY_SIZE\0"
- "GL_SECONDARY_COLOR_ARRAY_STRIDE\0"
- "GL_SECONDARY_COLOR_ARRAY_TYPE\0"
- "GL_SELECT\0"
- "GL_SELECTION_BUFFER_POINTER\0"
- "GL_SELECTION_BUFFER_SIZE\0"
- "GL_SEPARABLE_2D\0"
- "GL_SEPARATE_ATTRIBS\0"
- "GL_SEPARATE_ATTRIBS_EXT\0"
- "GL_SEPARATE_SPECULAR_COLOR\0"
- "GL_SEPARATE_SPECULAR_COLOR_EXT\0"
- "GL_SET\0"
- "GL_SHADER_BINARY_FORMATS\0"
- "GL_SHADER_COMPILER\0"
- "GL_SHADER_OBJECT_ARB\0"
- "GL_SHADER_SOURCE_LENGTH\0"
- "GL_SHADER_TYPE\0"
- "GL_SHADE_MODEL\0"
- "GL_SHADING_LANGUAGE_VERSION\0"
- "GL_SHADOW_AMBIENT_SGIX\0"
- "GL_SHARED_TEXTURE_PALETTE_EXT\0"
- "GL_SHININESS\0"
- "GL_SHORT\0"
- "GL_SIGNALED\0"
- "GL_SIGNED_NORMALIZED\0"
- "GL_SINGLE_COLOR\0"
- "GL_SINGLE_COLOR_EXT\0"
- "GL_SLICE_ACCUM_SUN\0"
- "GL_SLUMINANCE\0"
- "GL_SLUMINANCE8\0"
- "GL_SLUMINANCE8_ALPHA8\0"
- "GL_SLUMINANCE_ALPHA\0"
- "GL_SMOOTH\0"
- "GL_SMOOTH_LINE_WIDTH_GRANULARITY\0"
- "GL_SMOOTH_LINE_WIDTH_RANGE\0"
- "GL_SMOOTH_POINT_SIZE_GRANULARITY\0"
- "GL_SMOOTH_POINT_SIZE_RANGE\0"
- "GL_SOURCE0_ALPHA\0"
- "GL_SOURCE0_ALPHA_ARB\0"
- "GL_SOURCE0_ALPHA_EXT\0"
- "GL_SOURCE0_RGB\0"
- "GL_SOURCE0_RGB_ARB\0"
- "GL_SOURCE0_RGB_EXT\0"
- "GL_SOURCE1_ALPHA\0"
- "GL_SOURCE1_ALPHA_ARB\0"
- "GL_SOURCE1_ALPHA_EXT\0"
- "GL_SOURCE1_RGB\0"
- "GL_SOURCE1_RGB_ARB\0"
- "GL_SOURCE1_RGB_EXT\0"
- "GL_SOURCE2_ALPHA\0"
- "GL_SOURCE2_ALPHA_ARB\0"
- "GL_SOURCE2_ALPHA_EXT\0"
- "GL_SOURCE2_RGB\0"
- "GL_SOURCE2_RGB_ARB\0"
- "GL_SOURCE2_RGB_EXT\0"
- "GL_SOURCE3_ALPHA_NV\0"
- "GL_SOURCE3_RGB_NV\0"
- "GL_SPECULAR\0"
- "GL_SPHERE_MAP\0"
- "GL_SPOT_CUTOFF\0"
- "GL_SPOT_DIRECTION\0"
- "GL_SPOT_EXPONENT\0"
- "GL_SRC0_ALPHA\0"
- "GL_SRC0_RGB\0"
- "GL_SRC1_ALPHA\0"
- "GL_SRC1_RGB\0"
- "GL_SRC2_ALPHA\0"
- "GL_SRC2_RGB\0"
- "GL_SRC_ALPHA\0"
- "GL_SRC_ALPHA_SATURATE\0"
- "GL_SRC_COLOR\0"
- "GL_SRGB\0"
- "GL_SRGB8\0"
- "GL_SRGB8_ALPHA8\0"
- "GL_SRGB_ALPHA\0"
- "GL_STACK_OVERFLOW\0"
- "GL_STACK_UNDERFLOW\0"
- "GL_STATIC_COPY\0"
- "GL_STATIC_COPY_ARB\0"
- "GL_STATIC_DRAW\0"
- "GL_STATIC_DRAW_ARB\0"
- "GL_STATIC_READ\0"
- "GL_STATIC_READ_ARB\0"
- "GL_STENCIL\0"
- "GL_STENCIL_ATTACHMENT\0"
- "GL_STENCIL_ATTACHMENT_EXT\0"
- "GL_STENCIL_ATTACHMENT_OES\0"
- "GL_STENCIL_BACK_FAIL\0"
- "GL_STENCIL_BACK_FAIL_ATI\0"
- "GL_STENCIL_BACK_FUNC\0"
- "GL_STENCIL_BACK_FUNC_ATI\0"
- "GL_STENCIL_BACK_PASS_DEPTH_FAIL\0"
- "GL_STENCIL_BACK_PASS_DEPTH_FAIL_ATI\0"
- "GL_STENCIL_BACK_PASS_DEPTH_PASS\0"
- "GL_STENCIL_BACK_PASS_DEPTH_PASS_ATI\0"
- "GL_STENCIL_BACK_REF\0"
- "GL_STENCIL_BACK_VALUE_MASK\0"
- "GL_STENCIL_BACK_WRITEMASK\0"
- "GL_STENCIL_BITS\0"
- "GL_STENCIL_BUFFER\0"
- "GL_STENCIL_BUFFER_BIT\0"
- "GL_STENCIL_CLEAR_VALUE\0"
- "GL_STENCIL_FAIL\0"
- "GL_STENCIL_FUNC\0"
- "GL_STENCIL_INDEX\0"
- "GL_STENCIL_INDEX1\0"
- "GL_STENCIL_INDEX16\0"
- "GL_STENCIL_INDEX16_EXT\0"
- "GL_STENCIL_INDEX1_EXT\0"
- "GL_STENCIL_INDEX1_OES\0"
- "GL_STENCIL_INDEX4\0"
- "GL_STENCIL_INDEX4_EXT\0"
- "GL_STENCIL_INDEX4_OES\0"
- "GL_STENCIL_INDEX8\0"
- "GL_STENCIL_INDEX8_EXT\0"
- "GL_STENCIL_INDEX8_OES\0"
- "GL_STENCIL_INDEX_EXT\0"
- "GL_STENCIL_PASS_DEPTH_FAIL\0"
- "GL_STENCIL_PASS_DEPTH_PASS\0"
- "GL_STENCIL_REF\0"
- "GL_STENCIL_TEST\0"
- "GL_STENCIL_TEST_TWO_SIDE_EXT\0"
- "GL_STENCIL_VALUE_MASK\0"
- "GL_STENCIL_WRITEMASK\0"
- "GL_STEREO\0"
- "GL_STORAGE_CACHED_APPLE\0"
- "GL_STORAGE_PRIVATE_APPLE\0"
- "GL_STORAGE_SHARED_APPLE\0"
- "GL_STREAM_COPY\0"
- "GL_STREAM_COPY_ARB\0"
- "GL_STREAM_DRAW\0"
- "GL_STREAM_DRAW_ARB\0"
- "GL_STREAM_READ\0"
- "GL_STREAM_READ_ARB\0"
- "GL_SUBPIXEL_BITS\0"
- "GL_SUBTRACT\0"
- "GL_SUBTRACT_ARB\0"
- "GL_SYNC_CONDITION\0"
- "GL_SYNC_FENCE\0"
- "GL_SYNC_FLAGS\0"
- "GL_SYNC_FLUSH_COMMANDS_BIT\0"
- "GL_SYNC_GPU_COMMANDS_COMPLETE\0"
- "GL_SYNC_STATUS\0"
- "GL_T\0"
- "GL_T2F_C3F_V3F\0"
- "GL_T2F_C4F_N3F_V3F\0"
- "GL_T2F_C4UB_V3F\0"
- "GL_T2F_N3F_V3F\0"
- "GL_T2F_V3F\0"
- "GL_T4F_C4F_N3F_V4F\0"
- "GL_T4F_V4F\0"
- "GL_TABLE_TOO_LARGE_EXT\0"
- "GL_TEXTURE\0"
- "GL_TEXTURE0\0"
- "GL_TEXTURE0_ARB\0"
- "GL_TEXTURE1\0"
- "GL_TEXTURE10\0"
- "GL_TEXTURE10_ARB\0"
- "GL_TEXTURE11\0"
- "GL_TEXTURE11_ARB\0"
- "GL_TEXTURE12\0"
- "GL_TEXTURE12_ARB\0"
- "GL_TEXTURE13\0"
- "GL_TEXTURE13_ARB\0"
- "GL_TEXTURE14\0"
- "GL_TEXTURE14_ARB\0"
- "GL_TEXTURE15\0"
- "GL_TEXTURE15_ARB\0"
- "GL_TEXTURE16\0"
- "GL_TEXTURE16_ARB\0"
- "GL_TEXTURE17\0"
- "GL_TEXTURE17_ARB\0"
- "GL_TEXTURE18\0"
- "GL_TEXTURE18_ARB\0"
- "GL_TEXTURE19\0"
- "GL_TEXTURE19_ARB\0"
- "GL_TEXTURE1_ARB\0"
- "GL_TEXTURE2\0"
- "GL_TEXTURE20\0"
- "GL_TEXTURE20_ARB\0"
- "GL_TEXTURE21\0"
- "GL_TEXTURE21_ARB\0"
- "GL_TEXTURE22\0"
- "GL_TEXTURE22_ARB\0"
- "GL_TEXTURE23\0"
- "GL_TEXTURE23_ARB\0"
- "GL_TEXTURE24\0"
- "GL_TEXTURE24_ARB\0"
- "GL_TEXTURE25\0"
- "GL_TEXTURE25_ARB\0"
- "GL_TEXTURE26\0"
- "GL_TEXTURE26_ARB\0"
- "GL_TEXTURE27\0"
- "GL_TEXTURE27_ARB\0"
- "GL_TEXTURE28\0"
- "GL_TEXTURE28_ARB\0"
- "GL_TEXTURE29\0"
- "GL_TEXTURE29_ARB\0"
- "GL_TEXTURE2_ARB\0"
- "GL_TEXTURE3\0"
- "GL_TEXTURE30\0"
- "GL_TEXTURE30_ARB\0"
- "GL_TEXTURE31\0"
- "GL_TEXTURE31_ARB\0"
- "GL_TEXTURE3_ARB\0"
- "GL_TEXTURE4\0"
- "GL_TEXTURE4_ARB\0"
- "GL_TEXTURE5\0"
- "GL_TEXTURE5_ARB\0"
- "GL_TEXTURE6\0"
- "GL_TEXTURE6_ARB\0"
- "GL_TEXTURE7\0"
- "GL_TEXTURE7_ARB\0"
- "GL_TEXTURE8\0"
- "GL_TEXTURE8_ARB\0"
- "GL_TEXTURE9\0"
- "GL_TEXTURE9_ARB\0"
- "GL_TEXTURE_1D\0"
- "GL_TEXTURE_1D_ARRAY\0"
- "GL_TEXTURE_1D_ARRAY_EXT\0"
- "GL_TEXTURE_2D\0"
- "GL_TEXTURE_2D_ARRAY\0"
- "GL_TEXTURE_2D_ARRAY_EXT\0"
- "GL_TEXTURE_3D\0"
- "GL_TEXTURE_3D_OES\0"
- "GL_TEXTURE_ALPHA_SIZE\0"
- "GL_TEXTURE_ALPHA_SIZE_EXT\0"
- "GL_TEXTURE_BASE_LEVEL\0"
- "GL_TEXTURE_BINDING_1D\0"
- "GL_TEXTURE_BINDING_1D_ARRAY\0"
- "GL_TEXTURE_BINDING_1D_ARRAY_EXT\0"
- "GL_TEXTURE_BINDING_2D\0"
- "GL_TEXTURE_BINDING_2D_ARRAY\0"
- "GL_TEXTURE_BINDING_2D_ARRAY_EXT\0"
- "GL_TEXTURE_BINDING_3D\0"
- "GL_TEXTURE_BINDING_3D_OES\0"
- "GL_TEXTURE_BINDING_BUFFER\0"
- "GL_TEXTURE_BINDING_BUFFER_ARB\0"
- "GL_TEXTURE_BINDING_CUBE_MAP\0"
- "GL_TEXTURE_BINDING_CUBE_MAP_ARB\0"
- "GL_TEXTURE_BINDING_CUBE_MAP_OES\0"
- "GL_TEXTURE_BINDING_RECTANGLE\0"
- "GL_TEXTURE_BINDING_RECTANGLE_ARB\0"
- "GL_TEXTURE_BINDING_RECTANGLE_NV\0"
- "GL_TEXTURE_BIT\0"
- "GL_TEXTURE_BLUE_SIZE\0"
- "GL_TEXTURE_BLUE_SIZE_EXT\0"
- "GL_TEXTURE_BORDER\0"
- "GL_TEXTURE_BORDER_COLOR\0"
- "GL_TEXTURE_BUFFER\0"
- "GL_TEXTURE_BUFFER_ARB\0"
- "GL_TEXTURE_BUFFER_DATA_STORE_BINDING\0"
- "GL_TEXTURE_BUFFER_DATA_STORE_BINDING_ARB\0"
- "GL_TEXTURE_BUFFER_FORMAT\0"
- "GL_TEXTURE_BUFFER_FORMAT_ARB\0"
- "GL_TEXTURE_CLIPMAP_CENTER_SGIX\0"
- "GL_TEXTURE_CLIPMAP_DEPTH_SGIX\0"
- "GL_TEXTURE_CLIPMAP_FRAME_SGIX\0"
- "GL_TEXTURE_CLIPMAP_LOD_OFFSET_SGIX\0"
- "GL_TEXTURE_CLIPMAP_OFFSET_SGIX\0"
- "GL_TEXTURE_CLIPMAP_VIRTUAL_DEPTH_SGIX\0"
- "GL_TEXTURE_COLOR_TABLE_SGI\0"
- "GL_TEXTURE_COLOR_WRITEMASK_SGIS\0"
- "GL_TEXTURE_COMPARE_FAIL_VALUE_ARB\0"
- "GL_TEXTURE_COMPARE_FUNC\0"
- "GL_TEXTURE_COMPARE_FUNC_ARB\0"
- "GL_TEXTURE_COMPARE_MODE\0"
- "GL_TEXTURE_COMPARE_MODE_ARB\0"
- "GL_TEXTURE_COMPARE_OPERATOR_SGIX\0"
- "GL_TEXTURE_COMPARE_SGIX\0"
- "GL_TEXTURE_COMPONENTS\0"
- "GL_TEXTURE_COMPRESSED\0"
- "GL_TEXTURE_COMPRESSED_ARB\0"
- "GL_TEXTURE_COMPRESSED_FORMATS_ARB\0"
- "GL_TEXTURE_COMPRESSED_IMAGE_SIZE\0"
- "GL_TEXTURE_COMPRESSED_IMAGE_SIZE_ARB\0"
- "GL_TEXTURE_COMPRESSION_HINT\0"
- "GL_TEXTURE_COMPRESSION_HINT_ARB\0"
- "GL_TEXTURE_COORD_ARRAY\0"
- "GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING\0"
- "GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB\0"
- "GL_TEXTURE_COORD_ARRAY_POINTER\0"
- "GL_TEXTURE_COORD_ARRAY_SIZE\0"
- "GL_TEXTURE_COORD_ARRAY_STRIDE\0"
- "GL_TEXTURE_COORD_ARRAY_TYPE\0"
- "GL_TEXTURE_CROP_RECT_OES\0"
- "GL_TEXTURE_CUBE_MAP\0"
- "GL_TEXTURE_CUBE_MAP_ARB\0"
- "GL_TEXTURE_CUBE_MAP_NEGATIVE_X\0"
- "GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB\0"
- "GL_TEXTURE_CUBE_MAP_NEGATIVE_X_OES\0"
- "GL_TEXTURE_CUBE_MAP_NEGATIVE_Y\0"
- "GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB\0"
- "GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_OES\0"
- "GL_TEXTURE_CUBE_MAP_NEGATIVE_Z\0"
- "GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB\0"
- "GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_OES\0"
- "GL_TEXTURE_CUBE_MAP_OES\0"
- "GL_TEXTURE_CUBE_MAP_POSITIVE_X\0"
- "GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB\0"
- "GL_TEXTURE_CUBE_MAP_POSITIVE_X_OES\0"
- "GL_TEXTURE_CUBE_MAP_POSITIVE_Y\0"
- "GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB\0"
- "GL_TEXTURE_CUBE_MAP_POSITIVE_Y_OES\0"
- "GL_TEXTURE_CUBE_MAP_POSITIVE_Z\0"
- "GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB\0"
- "GL_TEXTURE_CUBE_MAP_POSITIVE_Z_OES\0"
- "GL_TEXTURE_CUBE_MAP_SEAMLESS\0"
- "GL_TEXTURE_DEPTH\0"
- "GL_TEXTURE_DEPTH_SIZE\0"
- "GL_TEXTURE_DEPTH_SIZE_ARB\0"
- "GL_TEXTURE_ENV\0"
- "GL_TEXTURE_ENV_COLOR\0"
- "GL_TEXTURE_ENV_MODE\0"
- "GL_TEXTURE_FILTER_CONTROL\0"
- "GL_TEXTURE_FILTER_CONTROL_EXT\0"
- "GL_TEXTURE_GEN_MODE\0"
- "GL_TEXTURE_GEN_MODE_OES\0"
- "GL_TEXTURE_GEN_Q\0"
- "GL_TEXTURE_GEN_R\0"
- "GL_TEXTURE_GEN_S\0"
- "GL_TEXTURE_GEN_STR_OES\0"
- "GL_TEXTURE_GEN_T\0"
- "GL_TEXTURE_GEQUAL_R_SGIX\0"
- "GL_TEXTURE_GREEN_SIZE\0"
- "GL_TEXTURE_GREEN_SIZE_EXT\0"
- "GL_TEXTURE_HEIGHT\0"
- "GL_TEXTURE_INDEX_SIZE_EXT\0"
- "GL_TEXTURE_INTENSITY_SIZE\0"
- "GL_TEXTURE_INTENSITY_SIZE_EXT\0"
- "GL_TEXTURE_INTERNAL_FORMAT\0"
- "GL_TEXTURE_LEQUAL_R_SGIX\0"
- "GL_TEXTURE_LOD_BIAS\0"
- "GL_TEXTURE_LOD_BIAS_EXT\0"
- "GL_TEXTURE_LOD_BIAS_R_SGIX\0"
- "GL_TEXTURE_LOD_BIAS_S_SGIX\0"
- "GL_TEXTURE_LOD_BIAS_T_SGIX\0"
- "GL_TEXTURE_LUMINANCE_SIZE\0"
- "GL_TEXTURE_LUMINANCE_SIZE_EXT\0"
- "GL_TEXTURE_MAG_FILTER\0"
- "GL_TEXTURE_MATRIX\0"
- "GL_TEXTURE_MATRIX_FLOAT_AS_INT_BITS_OES\0"
- "GL_TEXTURE_MAX_ANISOTROPY_EXT\0"
- "GL_TEXTURE_MAX_CLAMP_R_SGIX\0"
- "GL_TEXTURE_MAX_CLAMP_S_SGIX\0"
- "GL_TEXTURE_MAX_CLAMP_T_SGIX\0"
- "GL_TEXTURE_MAX_LEVEL\0"
- "GL_TEXTURE_MAX_LOD\0"
- "GL_TEXTURE_MIN_FILTER\0"
- "GL_TEXTURE_MIN_LOD\0"
- "GL_TEXTURE_PRIORITY\0"
- "GL_TEXTURE_RANGE_LENGTH_APPLE\0"
- "GL_TEXTURE_RANGE_POINTER_APPLE\0"
- "GL_TEXTURE_RECTANGLE\0"
- "GL_TEXTURE_RECTANGLE_ARB\0"
- "GL_TEXTURE_RECTANGLE_NV\0"
- "GL_TEXTURE_RED_SIZE\0"
- "GL_TEXTURE_RED_SIZE_EXT\0"
- "GL_TEXTURE_RESIDENT\0"
- "GL_TEXTURE_SHARED_SIZE\0"
- "GL_TEXTURE_STACK_DEPTH\0"
- "GL_TEXTURE_STENCIL_SIZE\0"
- "GL_TEXTURE_STENCIL_SIZE_EXT\0"
- "GL_TEXTURE_STORAGE_HINT_APPLE\0"
- "GL_TEXTURE_TOO_LARGE_EXT\0"
- "GL_TEXTURE_UNSIGNED_REMAP_MODE_NV\0"
- "GL_TEXTURE_WIDTH\0"
- "GL_TEXTURE_WRAP_R\0"
- "GL_TEXTURE_WRAP_R_OES\0"
- "GL_TEXTURE_WRAP_S\0"
- "GL_TEXTURE_WRAP_T\0"
- "GL_TIMEOUT_EXPIRED\0"
- "GL_TIME_ELAPSED_EXT\0"
- "GL_TRACK_MATRIX_NV\0"
- "GL_TRACK_MATRIX_TRANSFORM_NV\0"
- "GL_TRANSFORM_BIT\0"
- "GL_TRANSFORM_FEEDBACK\0"
- "GL_TRANSFORM_FEEDBACK_BINDING\0"
- "GL_TRANSFORM_FEEDBACK_BUFFER\0"
- "GL_TRANSFORM_FEEDBACK_BUFFER_ACTIVE\0"
- "GL_TRANSFORM_FEEDBACK_BUFFER_BINDING\0"
- "GL_TRANSFORM_FEEDBACK_BUFFER_BINDING_EXT\0"
- "GL_TRANSFORM_FEEDBACK_BUFFER_EXT\0"
- "GL_TRANSFORM_FEEDBACK_BUFFER_MODE\0"
- "GL_TRANSFORM_FEEDBACK_BUFFER_MODE_EXT\0"
- "GL_TRANSFORM_FEEDBACK_BUFFER_PAUSED\0"
- "GL_TRANSFORM_FEEDBACK_BUFFER_SIZE\0"
- "GL_TRANSFORM_FEEDBACK_BUFFER_SIZE_EXT\0"
- "GL_TRANSFORM_FEEDBACK_BUFFER_START\0"
- "GL_TRANSFORM_FEEDBACK_BUFFER_START_EXT\0"
- "GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN\0"
- "GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN_EXT\0"
- "GL_TRANSFORM_FEEDBACK_VARYINGS\0"
- "GL_TRANSFORM_FEEDBACK_VARYINGS_EXT\0"
- "GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH\0"
- "GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH_EXT\0"
- "GL_TRANSPOSE_COLOR_MATRIX\0"
- "GL_TRANSPOSE_COLOR_MATRIX_ARB\0"
- "GL_TRANSPOSE_CURRENT_MATRIX_ARB\0"
- "GL_TRANSPOSE_MODELVIEW_MATRIX\0"
- "GL_TRANSPOSE_MODELVIEW_MATRIX_ARB\0"
- "GL_TRANSPOSE_NV\0"
- "GL_TRANSPOSE_PROJECTION_MATRIX\0"
- "GL_TRANSPOSE_PROJECTION_MATRIX_ARB\0"
- "GL_TRANSPOSE_TEXTURE_MATRIX\0"
- "GL_TRANSPOSE_TEXTURE_MATRIX_ARB\0"
- "GL_TRIANGLES\0"
- "GL_TRIANGLES_ADJACENCY\0"
- "GL_TRIANGLES_ADJACENCY_ARB\0"
- "GL_TRIANGLE_FAN\0"
- "GL_TRIANGLE_MESH_SUN\0"
- "GL_TRIANGLE_STRIP\0"
- "GL_TRIANGLE_STRIP_ADJACENCY\0"
- "GL_TRIANGLE_STRIP_ADJACENCY_ARB\0"
- "GL_TRUE\0"
- "GL_UNDEFINED_APPLE\0"
- "GL_UNKNOWN_CONTEXT_RESET_ARB\0"
- "GL_UNPACK_ALIGNMENT\0"
- "GL_UNPACK_IMAGE_HEIGHT\0"
- "GL_UNPACK_LSB_FIRST\0"
- "GL_UNPACK_ROW_LENGTH\0"
- "GL_UNPACK_SKIP_IMAGES\0"
- "GL_UNPACK_SKIP_PIXELS\0"
- "GL_UNPACK_SKIP_ROWS\0"
- "GL_UNPACK_SWAP_BYTES\0"
- "GL_UNSIGNALED\0"
- "GL_UNSIGNED_BYTE\0"
- "GL_UNSIGNED_BYTE_2_3_3_REV\0"
- "GL_UNSIGNED_BYTE_3_3_2\0"
- "GL_UNSIGNED_INT\0"
- "GL_UNSIGNED_INT_10F_11F_11F_REV\0"
- "GL_UNSIGNED_INT_10_10_10_2\0"
- "GL_UNSIGNED_INT_10_10_10_2_OES\0"
- "GL_UNSIGNED_INT_24_8\0"
- "GL_UNSIGNED_INT_24_8_EXT\0"
- "GL_UNSIGNED_INT_24_8_NV\0"
- "GL_UNSIGNED_INT_24_8_OES\0"
- "GL_UNSIGNED_INT_2_10_10_10_REV\0"
- "GL_UNSIGNED_INT_2_10_10_10_REV_EXT\0"
- "GL_UNSIGNED_INT_5_9_9_9_REV\0"
- "GL_UNSIGNED_INT_8_8_8_8\0"
- "GL_UNSIGNED_INT_8_8_8_8_REV\0"
- "GL_UNSIGNED_INT_SAMPLER_1D\0"
- "GL_UNSIGNED_INT_SAMPLER_1D_ARRAY\0"
- "GL_UNSIGNED_INT_SAMPLER_1D_ARRAY_EXT\0"
- "GL_UNSIGNED_INT_SAMPLER_1D_EXT\0"
- "GL_UNSIGNED_INT_SAMPLER_2D\0"
- "GL_UNSIGNED_INT_SAMPLER_2D_ARRAY\0"
- "GL_UNSIGNED_INT_SAMPLER_2D_ARRAY_EXT\0"
- "GL_UNSIGNED_INT_SAMPLER_2D_EXT\0"
- "GL_UNSIGNED_INT_SAMPLER_2D_RECT\0"
- "GL_UNSIGNED_INT_SAMPLER_2D_RECT_EXT\0"
- "GL_UNSIGNED_INT_SAMPLER_3D\0"
- "GL_UNSIGNED_INT_SAMPLER_3D_EXT\0"
- "GL_UNSIGNED_INT_SAMPLER_BUFFER\0"
- "GL_UNSIGNED_INT_SAMPLER_BUFFER_EXT\0"
- "GL_UNSIGNED_INT_SAMPLER_CUBE\0"
- "GL_UNSIGNED_INT_SAMPLER_CUBE_EXT\0"
- "GL_UNSIGNED_INT_VEC2\0"
- "GL_UNSIGNED_INT_VEC2_EXT\0"
- "GL_UNSIGNED_INT_VEC3\0"
- "GL_UNSIGNED_INT_VEC3_EXT\0"
- "GL_UNSIGNED_INT_VEC4\0"
- "GL_UNSIGNED_INT_VEC4_EXT\0"
- "GL_UNSIGNED_NORMALIZED\0"
- "GL_UNSIGNED_SHORT\0"
- "GL_UNSIGNED_SHORT_1_5_5_5_REV\0"
- "GL_UNSIGNED_SHORT_1_5_5_5_REV_EXT\0"
- "GL_UNSIGNED_SHORT_4_4_4_4\0"
- "GL_UNSIGNED_SHORT_4_4_4_4_REV\0"
- "GL_UNSIGNED_SHORT_4_4_4_4_REV_EXT\0"
- "GL_UNSIGNED_SHORT_5_5_5_1\0"
- "GL_UNSIGNED_SHORT_5_6_5\0"
- "GL_UNSIGNED_SHORT_5_6_5_REV\0"
- "GL_UNSIGNED_SHORT_8_8_APPLE\0"
- "GL_UNSIGNED_SHORT_8_8_MESA\0"
- "GL_UNSIGNED_SHORT_8_8_REV_APPLE\0"
- "GL_UNSIGNED_SHORT_8_8_REV_MESA\0"
- "GL_UPPER_LEFT\0"
- "GL_V2F\0"
- "GL_V3F\0"
- "GL_VALIDATE_STATUS\0"
- "GL_VENDOR\0"
- "GL_VERSION\0"
- "GL_VERTEX_ARRAY\0"
- "GL_VERTEX_ARRAY_BINDING\0"
- "GL_VERTEX_ARRAY_BINDING_APPLE\0"
- "GL_VERTEX_ARRAY_BUFFER_BINDING\0"
- "GL_VERTEX_ARRAY_BUFFER_BINDING_ARB\0"
- "GL_VERTEX_ARRAY_POINTER\0"
- "GL_VERTEX_ARRAY_SIZE\0"
- "GL_VERTEX_ARRAY_STRIDE\0"
- "GL_VERTEX_ARRAY_TYPE\0"
- "GL_VERTEX_ATTRIB_ARRAY0_NV\0"
- "GL_VERTEX_ATTRIB_ARRAY10_NV\0"
- "GL_VERTEX_ATTRIB_ARRAY11_NV\0"
- "GL_VERTEX_ATTRIB_ARRAY12_NV\0"
- "GL_VERTEX_ATTRIB_ARRAY13_NV\0"
- "GL_VERTEX_ATTRIB_ARRAY14_NV\0"
- "GL_VERTEX_ATTRIB_ARRAY15_NV\0"
- "GL_VERTEX_ATTRIB_ARRAY1_NV\0"
- "GL_VERTEX_ATTRIB_ARRAY2_NV\0"
- "GL_VERTEX_ATTRIB_ARRAY3_NV\0"
- "GL_VERTEX_ATTRIB_ARRAY4_NV\0"
- "GL_VERTEX_ATTRIB_ARRAY5_NV\0"
- "GL_VERTEX_ATTRIB_ARRAY6_NV\0"
- "GL_VERTEX_ATTRIB_ARRAY7_NV\0"
- "GL_VERTEX_ATTRIB_ARRAY8_NV\0"
- "GL_VERTEX_ATTRIB_ARRAY9_NV\0"
- "GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING\0"
- "GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB\0"
- "GL_VERTEX_ATTRIB_ARRAY_DIVISOR_ARB\0"
- "GL_VERTEX_ATTRIB_ARRAY_ENABLED\0"
- "GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB\0"
- "GL_VERTEX_ATTRIB_ARRAY_INTEGER\0"
- "GL_VERTEX_ATTRIB_ARRAY_INTEGER_EXT\0"
- "GL_VERTEX_ATTRIB_ARRAY_NORMALIZED\0"
- "GL_VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB\0"
- "GL_VERTEX_ATTRIB_ARRAY_POINTER\0"
- "GL_VERTEX_ATTRIB_ARRAY_POINTER_ARB\0"
- "GL_VERTEX_ATTRIB_ARRAY_SIZE\0"
- "GL_VERTEX_ATTRIB_ARRAY_SIZE_ARB\0"
- "GL_VERTEX_ATTRIB_ARRAY_STRIDE\0"
- "GL_VERTEX_ATTRIB_ARRAY_STRIDE_ARB\0"
- "GL_VERTEX_ATTRIB_ARRAY_TYPE\0"
- "GL_VERTEX_ATTRIB_ARRAY_TYPE_ARB\0"
- "GL_VERTEX_BLEND_ARB\0"
- "GL_VERTEX_PROGRAM_ARB\0"
- "GL_VERTEX_PROGRAM_BINDING_NV\0"
- "GL_VERTEX_PROGRAM_NV\0"
- "GL_VERTEX_PROGRAM_POINT_SIZE\0"
- "GL_VERTEX_PROGRAM_POINT_SIZE_ARB\0"
- "GL_VERTEX_PROGRAM_POINT_SIZE_NV\0"
- "GL_VERTEX_PROGRAM_TWO_SIDE\0"
- "GL_VERTEX_PROGRAM_TWO_SIDE_ARB\0"
- "GL_VERTEX_PROGRAM_TWO_SIDE_NV\0"
- "GL_VERTEX_SHADER\0"
- "GL_VERTEX_SHADER_ARB\0"
- "GL_VERTEX_STATE_PROGRAM_NV\0"
- "GL_VIEWPORT\0"
- "GL_VIEWPORT_BIT\0"
- "GL_VOLATILE_APPLE\0"
- "GL_WAIT_FAILED\0"
- "GL_WEIGHT_ARRAY_ARB\0"
- "GL_WEIGHT_ARRAY_BUFFER_BINDING\0"
- "GL_WEIGHT_ARRAY_BUFFER_BINDING_ARB\0"
- "GL_WEIGHT_ARRAY_BUFFER_BINDING_OES\0"
- "GL_WEIGHT_ARRAY_OES\0"
- "GL_WEIGHT_ARRAY_POINTER_ARB\0"
- "GL_WEIGHT_ARRAY_POINTER_OES\0"
- "GL_WEIGHT_ARRAY_SIZE_ARB\0"
- "GL_WEIGHT_ARRAY_SIZE_OES\0"
- "GL_WEIGHT_ARRAY_STRIDE_ARB\0"
- "GL_WEIGHT_ARRAY_STRIDE_OES\0"
- "GL_WEIGHT_ARRAY_TYPE_ARB\0"
- "GL_WEIGHT_ARRAY_TYPE_OES\0"
- "GL_WEIGHT_SUM_UNITY_ARB\0"
- "GL_WRAP_BORDER_SUN\0"
- "GL_WRITE_ONLY\0"
- "GL_WRITE_ONLY_ARB\0"
- "GL_WRITE_ONLY_OES\0"
- "GL_XOR\0"
- "GL_YCBCR_422_APPLE\0"
- "GL_YCBCR_MESA\0"
- "GL_ZERO\0"
- "GL_ZOOM_X\0"
- "GL_ZOOM_Y\0"
- ;
-
-static const enum_elt all_enums[2313] =
-{
- { 0, 0x00000600 }, /* GL_2D */
- { 6, 0x00001407 }, /* GL_2_BYTES */
- { 17, 0x00000601 }, /* GL_3D */
- { 23, 0x00000602 }, /* GL_3D_COLOR */
- { 35, 0x00000603 }, /* GL_3D_COLOR_TEXTURE */
- { 55, 0x00001408 }, /* GL_3_BYTES */
- { 66, 0x00000604 }, /* GL_4D_COLOR_TEXTURE */
- { 86, 0x00001409 }, /* GL_4_BYTES */
- { 97, 0x00000100 }, /* GL_ACCUM */
- { 106, 0x00000D5B }, /* GL_ACCUM_ALPHA_BITS */
- { 126, 0x00000D5A }, /* GL_ACCUM_BLUE_BITS */
- { 145, 0x00000200 }, /* GL_ACCUM_BUFFER_BIT */
- { 165, 0x00000B80 }, /* GL_ACCUM_CLEAR_VALUE */
- { 186, 0x00000D59 }, /* GL_ACCUM_GREEN_BITS */
- { 206, 0x00000D58 }, /* GL_ACCUM_RED_BITS */
- { 224, 0x00008B89 }, /* GL_ACTIVE_ATTRIBUTES */
- { 245, 0x00008B8A }, /* GL_ACTIVE_ATTRIBUTE_MAX_LENGTH */
- { 276, 0x00008B8D }, /* GL_ACTIVE_PROGRAM_EXT */
- { 298, 0x00008911 }, /* GL_ACTIVE_STENCIL_FACE_EXT */
- { 325, 0x000084E0 }, /* GL_ACTIVE_TEXTURE */
- { 343, 0x000084E0 }, /* GL_ACTIVE_TEXTURE_ARB */
- { 365, 0x00008B86 }, /* GL_ACTIVE_UNIFORMS */
- { 384, 0x00008B87 }, /* GL_ACTIVE_UNIFORM_MAX_LENGTH */
- { 413, 0x000086A5 }, /* GL_ACTIVE_VERTEX_UNITS_ARB */
- { 440, 0x00000104 }, /* GL_ADD */
- { 447, 0x00008574 }, /* GL_ADD_SIGNED */
- { 461, 0x00008574 }, /* GL_ADD_SIGNED_ARB */
- { 479, 0x00008574 }, /* GL_ADD_SIGNED_EXT */
- { 497, 0x0000846E }, /* GL_ALIASED_LINE_WIDTH_RANGE */
- { 525, 0x0000846D }, /* GL_ALIASED_POINT_SIZE_RANGE */
- { 553, 0x000FFFFF }, /* GL_ALL_ATTRIB_BITS */
- { 572, 0xFFFFFFFF }, /* GL_ALL_CLIENT_ATTRIB_BITS */
- { 598, 0x00001906 }, /* GL_ALPHA */
- { 607, 0x0000803D }, /* GL_ALPHA12 */
- { 618, 0x0000803D }, /* GL_ALPHA12_EXT */
- { 633, 0x0000803E }, /* GL_ALPHA16 */
- { 644, 0x00008D8A }, /* GL_ALPHA16I_EXT */
- { 660, 0x00008D78 }, /* GL_ALPHA16UI_EXT */
- { 677, 0x0000803E }, /* GL_ALPHA16_EXT */
- { 692, 0x00008D84 }, /* GL_ALPHA32I_EXT */
- { 708, 0x00008D72 }, /* GL_ALPHA32UI_EXT */
- { 725, 0x0000803B }, /* GL_ALPHA4 */
- { 735, 0x0000803B }, /* GL_ALPHA4_EXT */
- { 749, 0x0000803C }, /* GL_ALPHA8 */
- { 759, 0x00008D90 }, /* GL_ALPHA8I_EXT */
- { 774, 0x00008D7E }, /* GL_ALPHA8UI_EXT */
- { 790, 0x0000803C }, /* GL_ALPHA8_EXT */
- { 804, 0x00000D1D }, /* GL_ALPHA_BIAS */
- { 818, 0x00000D55 }, /* GL_ALPHA_BITS */
- { 832, 0x00008D97 }, /* GL_ALPHA_INTEGER_EXT */
- { 853, 0x00000D1C }, /* GL_ALPHA_SCALE */
- { 868, 0x00000BC0 }, /* GL_ALPHA_TEST */
- { 882, 0x00000BC1 }, /* GL_ALPHA_TEST_FUNC */
- { 901, 0x00000BC2 }, /* GL_ALPHA_TEST_REF */
- { 919, 0x0000911A }, /* GL_ALREADY_SIGNALED */
- { 939, 0x00000207 }, /* GL_ALWAYS */
- { 949, 0x00001200 }, /* GL_AMBIENT */
- { 960, 0x00001602 }, /* GL_AMBIENT_AND_DIFFUSE */
- { 983, 0x00001501 }, /* GL_AND */
- { 990, 0x00001504 }, /* GL_AND_INVERTED */
- { 1006, 0x00001502 }, /* GL_AND_REVERSE */
- { 1021, 0x00008892 }, /* GL_ARRAY_BUFFER */
- { 1037, 0x00008894 }, /* GL_ARRAY_BUFFER_BINDING */
- { 1061, 0x00008894 }, /* GL_ARRAY_BUFFER_BINDING_ARB */
- { 1089, 0x00008B85 }, /* GL_ATTACHED_SHADERS */
- { 1109, 0x00008645 }, /* GL_ATTRIB_ARRAY_POINTER_NV */
- { 1136, 0x00008623 }, /* GL_ATTRIB_ARRAY_SIZE_NV */
- { 1160, 0x00008624 }, /* GL_ATTRIB_ARRAY_STRIDE_NV */
- { 1186, 0x00008625 }, /* GL_ATTRIB_ARRAY_TYPE_NV */
- { 1210, 0x00000BB0 }, /* GL_ATTRIB_STACK_DEPTH */
- { 1232, 0x00000D80 }, /* GL_AUTO_NORMAL */
- { 1247, 0x00000409 }, /* GL_AUX0 */
- { 1255, 0x0000040A }, /* GL_AUX1 */
- { 1263, 0x0000040B }, /* GL_AUX2 */
- { 1271, 0x0000040C }, /* GL_AUX3 */
- { 1279, 0x00000C00 }, /* GL_AUX_BUFFERS */
- { 1294, 0x00000405 }, /* GL_BACK */
- { 1302, 0x00000402 }, /* GL_BACK_LEFT */
- { 1315, 0x00000403 }, /* GL_BACK_RIGHT */
- { 1329, 0x000080E0 }, /* GL_BGR */
- { 1336, 0x000080E1 }, /* GL_BGRA */
- { 1344, 0x000080E1 }, /* GL_BGRA_EXT */
- { 1356, 0x00008D9B }, /* GL_BGRA_INTEGER */
- { 1372, 0x00008D9B }, /* GL_BGRA_INTEGER_EXT */
- { 1392, 0x00008D9A }, /* GL_BGR_INTEGER */
- { 1407, 0x00008D9A }, /* GL_BGR_INTEGER_EXT */
- { 1426, 0x00001A00 }, /* GL_BITMAP */
- { 1436, 0x00000704 }, /* GL_BITMAP_TOKEN */
- { 1452, 0x00000BE2 }, /* GL_BLEND */
- { 1461, 0x00008005 }, /* GL_BLEND_COLOR */
- { 1476, 0x00008005 }, /* GL_BLEND_COLOR_EXT */
- { 1495, 0x00000BE0 }, /* GL_BLEND_DST */
- { 1508, 0x000080CA }, /* GL_BLEND_DST_ALPHA */
- { 1527, 0x000080CA }, /* GL_BLEND_DST_ALPHA_OES */
- { 1550, 0x000080C8 }, /* GL_BLEND_DST_RGB */
- { 1567, 0x000080C8 }, /* GL_BLEND_DST_RGB_OES */
- { 1588, 0x00008009 }, /* GL_BLEND_EQUATION */
- { 1606, 0x0000883D }, /* GL_BLEND_EQUATION_ALPHA */
- { 1630, 0x0000883D }, /* GL_BLEND_EQUATION_ALPHA_EXT */
- { 1658, 0x0000883D }, /* GL_BLEND_EQUATION_ALPHA_OES */
- { 1686, 0x00008009 }, /* GL_BLEND_EQUATION_EXT */
- { 1708, 0x00008009 }, /* GL_BLEND_EQUATION_OES */
- { 1730, 0x00008009 }, /* GL_BLEND_EQUATION_RGB */
- { 1752, 0x00008009 }, /* GL_BLEND_EQUATION_RGB_EXT */
- { 1778, 0x00008009 }, /* GL_BLEND_EQUATION_RGB_OES */
- { 1804, 0x00000BE1 }, /* GL_BLEND_SRC */
- { 1817, 0x000080CB }, /* GL_BLEND_SRC_ALPHA */
- { 1836, 0x000080CB }, /* GL_BLEND_SRC_ALPHA_OES */
- { 1859, 0x000080C9 }, /* GL_BLEND_SRC_RGB */
- { 1876, 0x000080C9 }, /* GL_BLEND_SRC_RGB_OES */
- { 1897, 0x00001905 }, /* GL_BLUE */
- { 1905, 0x00000D1B }, /* GL_BLUE_BIAS */
- { 1918, 0x00000D54 }, /* GL_BLUE_BITS */
- { 1931, 0x00008D96 }, /* GL_BLUE_INTEGER */
- { 1947, 0x00008D96 }, /* GL_BLUE_INTEGER_EXT */
- { 1967, 0x00000D1A }, /* GL_BLUE_SCALE */
- { 1981, 0x00008B56 }, /* GL_BOOL */
- { 1989, 0x00008B56 }, /* GL_BOOL_ARB */
- { 2001, 0x00008B57 }, /* GL_BOOL_VEC2 */
- { 2014, 0x00008B57 }, /* GL_BOOL_VEC2_ARB */
- { 2031, 0x00008B58 }, /* GL_BOOL_VEC3 */
- { 2044, 0x00008B58 }, /* GL_BOOL_VEC3_ARB */
- { 2061, 0x00008B59 }, /* GL_BOOL_VEC4 */
- { 2074, 0x00008B59 }, /* GL_BOOL_VEC4_ARB */
- { 2091, 0x000088BB }, /* GL_BUFFER_ACCESS */
- { 2108, 0x000088BB }, /* GL_BUFFER_ACCESS_ARB */
- { 2129, 0x0000911F }, /* GL_BUFFER_ACCESS_FLAGS */
- { 2152, 0x000088BB }, /* GL_BUFFER_ACCESS_OES */
- { 2173, 0x00008A13 }, /* GL_BUFFER_FLUSHING_UNMAP_APPLE */
- { 2204, 0x000088BC }, /* GL_BUFFER_MAPPED */
- { 2221, 0x000088BC }, /* GL_BUFFER_MAPPED_ARB */
- { 2242, 0x000088BC }, /* GL_BUFFER_MAPPED_OES */
- { 2263, 0x00009120 }, /* GL_BUFFER_MAP_LENGTH */
- { 2284, 0x00009121 }, /* GL_BUFFER_MAP_OFFSET */
- { 2305, 0x000088BD }, /* GL_BUFFER_MAP_POINTER */
- { 2327, 0x000088BD }, /* GL_BUFFER_MAP_POINTER_ARB */
- { 2353, 0x000088BD }, /* GL_BUFFER_MAP_POINTER_OES */
- { 2379, 0x000085B3 }, /* GL_BUFFER_OBJECT_APPLE */
- { 2402, 0x00008A12 }, /* GL_BUFFER_SERIALIZED_MODIFY_APPLE */
- { 2436, 0x00008764 }, /* GL_BUFFER_SIZE */
- { 2451, 0x00008764 }, /* GL_BUFFER_SIZE_ARB */
- { 2470, 0x00008765 }, /* GL_BUFFER_USAGE */
- { 2486, 0x00008765 }, /* GL_BUFFER_USAGE_ARB */
- { 2506, 0x0000877B }, /* GL_BUMP_ENVMAP_ATI */
- { 2525, 0x00008777 }, /* GL_BUMP_NUM_TEX_UNITS_ATI */
- { 2551, 0x00008775 }, /* GL_BUMP_ROT_MATRIX_ATI */
- { 2574, 0x00008776 }, /* GL_BUMP_ROT_MATRIX_SIZE_ATI */
- { 2602, 0x0000877C }, /* GL_BUMP_TARGET_ATI */
- { 2621, 0x00008778 }, /* GL_BUMP_TEX_UNITS_ATI */
- { 2643, 0x00001400 }, /* GL_BYTE */
- { 2651, 0x00002A24 }, /* GL_C3F_V3F */
- { 2662, 0x00002A26 }, /* GL_C4F_N3F_V3F */
- { 2677, 0x00002A22 }, /* GL_C4UB_V2F */
- { 2689, 0x00002A23 }, /* GL_C4UB_V3F */
- { 2701, 0x00000901 }, /* GL_CCW */
- { 2708, 0x00002900 }, /* GL_CLAMP */
- { 2717, 0x0000891B }, /* GL_CLAMP_FRAGMENT_COLOR_ARB */
- { 2745, 0x0000891C }, /* GL_CLAMP_READ_COLOR */
- { 2765, 0x0000891C }, /* GL_CLAMP_READ_COLOR_ARB */
- { 2789, 0x0000812D }, /* GL_CLAMP_TO_BORDER */
- { 2808, 0x0000812D }, /* GL_CLAMP_TO_BORDER_ARB */
- { 2831, 0x0000812D }, /* GL_CLAMP_TO_BORDER_SGIS */
- { 2855, 0x0000812F }, /* GL_CLAMP_TO_EDGE */
- { 2872, 0x0000812F }, /* GL_CLAMP_TO_EDGE_SGIS */
- { 2894, 0x0000891A }, /* GL_CLAMP_VERTEX_COLOR_ARB */
- { 2920, 0x00001500 }, /* GL_CLEAR */
- { 2929, 0x000084E1 }, /* GL_CLIENT_ACTIVE_TEXTURE */
- { 2954, 0x000084E1 }, /* GL_CLIENT_ACTIVE_TEXTURE_ARB */
- { 2983, 0xFFFFFFFF }, /* GL_CLIENT_ALL_ATTRIB_BITS */
- { 3009, 0x00000BB1 }, /* GL_CLIENT_ATTRIB_STACK_DEPTH */
- { 3038, 0x00000001 }, /* GL_CLIENT_PIXEL_STORE_BIT */
- { 3064, 0x00000002 }, /* GL_CLIENT_VERTEX_ARRAY_BIT */
- { 3091, 0x00003000 }, /* GL_CLIP_DISTANCE0 */
- { 3109, 0x00003001 }, /* GL_CLIP_DISTANCE1 */
- { 3127, 0x00003002 }, /* GL_CLIP_DISTANCE2 */
- { 3145, 0x00003003 }, /* GL_CLIP_DISTANCE3 */
- { 3163, 0x00003004 }, /* GL_CLIP_DISTANCE4 */
- { 3181, 0x00003005 }, /* GL_CLIP_DISTANCE5 */
- { 3199, 0x00003006 }, /* GL_CLIP_DISTANCE6 */
- { 3217, 0x00003007 }, /* GL_CLIP_DISTANCE7 */
- { 3235, 0x00003000 }, /* GL_CLIP_PLANE0 */
- { 3250, 0x00003001 }, /* GL_CLIP_PLANE1 */
- { 3265, 0x00003002 }, /* GL_CLIP_PLANE2 */
- { 3280, 0x00003003 }, /* GL_CLIP_PLANE3 */
- { 3295, 0x00003004 }, /* GL_CLIP_PLANE4 */
- { 3310, 0x00003005 }, /* GL_CLIP_PLANE5 */
- { 3325, 0x000080F0 }, /* GL_CLIP_VOLUME_CLIPPING_HINT_EXT */
- { 3358, 0x00000A00 }, /* GL_COEFF */
- { 3367, 0x00001800 }, /* GL_COLOR */
- { 3376, 0x00008076 }, /* GL_COLOR_ARRAY */
- { 3391, 0x00008898 }, /* GL_COLOR_ARRAY_BUFFER_BINDING */
- { 3421, 0x00008898 }, /* GL_COLOR_ARRAY_BUFFER_BINDING_ARB */
- { 3455, 0x00008090 }, /* GL_COLOR_ARRAY_POINTER */
- { 3478, 0x00008081 }, /* GL_COLOR_ARRAY_SIZE */
- { 3498, 0x00008083 }, /* GL_COLOR_ARRAY_STRIDE */
- { 3520, 0x00008082 }, /* GL_COLOR_ARRAY_TYPE */
- { 3540, 0x00008CE0 }, /* GL_COLOR_ATTACHMENT0 */
- { 3561, 0x00008CE0 }, /* GL_COLOR_ATTACHMENT0_EXT */
- { 3586, 0x00008CE0 }, /* GL_COLOR_ATTACHMENT0_OES */
- { 3611, 0x00008CE1 }, /* GL_COLOR_ATTACHMENT1 */
- { 3632, 0x00008CEA }, /* GL_COLOR_ATTACHMENT10 */
- { 3654, 0x00008CEA }, /* GL_COLOR_ATTACHMENT10_EXT */
- { 3680, 0x00008CEB }, /* GL_COLOR_ATTACHMENT11 */
- { 3702, 0x00008CEB }, /* GL_COLOR_ATTACHMENT11_EXT */
- { 3728, 0x00008CEC }, /* GL_COLOR_ATTACHMENT12 */
- { 3750, 0x00008CEC }, /* GL_COLOR_ATTACHMENT12_EXT */
- { 3776, 0x00008CED }, /* GL_COLOR_ATTACHMENT13 */
- { 3798, 0x00008CED }, /* GL_COLOR_ATTACHMENT13_EXT */
- { 3824, 0x00008CEE }, /* GL_COLOR_ATTACHMENT14 */
- { 3846, 0x00008CEE }, /* GL_COLOR_ATTACHMENT14_EXT */
- { 3872, 0x00008CEF }, /* GL_COLOR_ATTACHMENT15 */
- { 3894, 0x00008CEF }, /* GL_COLOR_ATTACHMENT15_EXT */
- { 3920, 0x00008CE1 }, /* GL_COLOR_ATTACHMENT1_EXT */
- { 3945, 0x00008CE2 }, /* GL_COLOR_ATTACHMENT2 */
- { 3966, 0x00008CE2 }, /* GL_COLOR_ATTACHMENT2_EXT */
- { 3991, 0x00008CE3 }, /* GL_COLOR_ATTACHMENT3 */
- { 4012, 0x00008CE3 }, /* GL_COLOR_ATTACHMENT3_EXT */
- { 4037, 0x00008CE4 }, /* GL_COLOR_ATTACHMENT4 */
- { 4058, 0x00008CE4 }, /* GL_COLOR_ATTACHMENT4_EXT */
- { 4083, 0x00008CE5 }, /* GL_COLOR_ATTACHMENT5 */
- { 4104, 0x00008CE5 }, /* GL_COLOR_ATTACHMENT5_EXT */
- { 4129, 0x00008CE6 }, /* GL_COLOR_ATTACHMENT6 */
- { 4150, 0x00008CE6 }, /* GL_COLOR_ATTACHMENT6_EXT */
- { 4175, 0x00008CE7 }, /* GL_COLOR_ATTACHMENT7 */
- { 4196, 0x00008CE7 }, /* GL_COLOR_ATTACHMENT7_EXT */
- { 4221, 0x00008CE8 }, /* GL_COLOR_ATTACHMENT8 */
- { 4242, 0x00008CE8 }, /* GL_COLOR_ATTACHMENT8_EXT */
- { 4267, 0x00008CE9 }, /* GL_COLOR_ATTACHMENT9 */
- { 4288, 0x00008CE9 }, /* GL_COLOR_ATTACHMENT9_EXT */
- { 4313, 0x00004000 }, /* GL_COLOR_BUFFER_BIT */
- { 4333, 0x00000C22 }, /* GL_COLOR_CLEAR_VALUE */
- { 4354, 0x00001900 }, /* GL_COLOR_INDEX */
- { 4369, 0x00001603 }, /* GL_COLOR_INDEXES */
- { 4386, 0x00000BF2 }, /* GL_COLOR_LOGIC_OP */
- { 4404, 0x00000B57 }, /* GL_COLOR_MATERIAL */
- { 4422, 0x00000B55 }, /* GL_COLOR_MATERIAL_FACE */
- { 4445, 0x00000B56 }, /* GL_COLOR_MATERIAL_PARAMETER */
- { 4473, 0x000080B1 }, /* GL_COLOR_MATRIX */
- { 4489, 0x000080B1 }, /* GL_COLOR_MATRIX_SGI */
- { 4509, 0x000080B2 }, /* GL_COLOR_MATRIX_STACK_DEPTH */
- { 4537, 0x000080B2 }, /* GL_COLOR_MATRIX_STACK_DEPTH_SGI */
- { 4569, 0x00008458 }, /* GL_COLOR_SUM */
- { 4582, 0x00008458 }, /* GL_COLOR_SUM_ARB */
- { 4599, 0x000080D0 }, /* GL_COLOR_TABLE */
- { 4614, 0x000080DD }, /* GL_COLOR_TABLE_ALPHA_SIZE */
- { 4640, 0x000080DD }, /* GL_COLOR_TABLE_ALPHA_SIZE_EXT */
- { 4670, 0x000080DD }, /* GL_COLOR_TABLE_ALPHA_SIZE_SGI */
- { 4700, 0x000080D7 }, /* GL_COLOR_TABLE_BIAS */
- { 4720, 0x000080D7 }, /* GL_COLOR_TABLE_BIAS_SGI */
- { 4744, 0x000080DC }, /* GL_COLOR_TABLE_BLUE_SIZE */
- { 4769, 0x000080DC }, /* GL_COLOR_TABLE_BLUE_SIZE_EXT */
- { 4798, 0x000080DC }, /* GL_COLOR_TABLE_BLUE_SIZE_SGI */
- { 4827, 0x000080D8 }, /* GL_COLOR_TABLE_FORMAT */
- { 4849, 0x000080D8 }, /* GL_COLOR_TABLE_FORMAT_EXT */
- { 4875, 0x000080D8 }, /* GL_COLOR_TABLE_FORMAT_SGI */
- { 4901, 0x000080DB }, /* GL_COLOR_TABLE_GREEN_SIZE */
- { 4927, 0x000080DB }, /* GL_COLOR_TABLE_GREEN_SIZE_EXT */
- { 4957, 0x000080DB }, /* GL_COLOR_TABLE_GREEN_SIZE_SGI */
- { 4987, 0x000080DF }, /* GL_COLOR_TABLE_INTENSITY_SIZE */
- { 5017, 0x000080DF }, /* GL_COLOR_TABLE_INTENSITY_SIZE_EXT */
- { 5051, 0x000080DF }, /* GL_COLOR_TABLE_INTENSITY_SIZE_SGI */
- { 5085, 0x000080DE }, /* GL_COLOR_TABLE_LUMINANCE_SIZE */
- { 5115, 0x000080DE }, /* GL_COLOR_TABLE_LUMINANCE_SIZE_EXT */
- { 5149, 0x000080DE }, /* GL_COLOR_TABLE_LUMINANCE_SIZE_SGI */
- { 5183, 0x000080DA }, /* GL_COLOR_TABLE_RED_SIZE */
- { 5207, 0x000080DA }, /* GL_COLOR_TABLE_RED_SIZE_EXT */
- { 5235, 0x000080DA }, /* GL_COLOR_TABLE_RED_SIZE_SGI */
- { 5263, 0x000080D6 }, /* GL_COLOR_TABLE_SCALE */
- { 5284, 0x000080D6 }, /* GL_COLOR_TABLE_SCALE_SGI */
- { 5309, 0x000080D9 }, /* GL_COLOR_TABLE_WIDTH */
- { 5330, 0x000080D9 }, /* GL_COLOR_TABLE_WIDTH_EXT */
- { 5355, 0x000080D9 }, /* GL_COLOR_TABLE_WIDTH_SGI */
- { 5380, 0x00000C23 }, /* GL_COLOR_WRITEMASK */
- { 5399, 0x00008570 }, /* GL_COMBINE */
- { 5410, 0x00008503 }, /* GL_COMBINE4 */
- { 5422, 0x00008572 }, /* GL_COMBINE_ALPHA */
- { 5439, 0x00008572 }, /* GL_COMBINE_ALPHA_ARB */
- { 5460, 0x00008572 }, /* GL_COMBINE_ALPHA_EXT */
- { 5481, 0x00008570 }, /* GL_COMBINE_ARB */
- { 5496, 0x00008570 }, /* GL_COMBINE_EXT */
- { 5511, 0x00008571 }, /* GL_COMBINE_RGB */
- { 5526, 0x00008571 }, /* GL_COMBINE_RGB_ARB */
- { 5545, 0x00008571 }, /* GL_COMBINE_RGB_EXT */
- { 5564, 0x0000884E }, /* GL_COMPARE_REF_DEPTH_TO_TEXTURE_EXT */
- { 5600, 0x0000884E }, /* GL_COMPARE_REF_TO_TEXTURE */
- { 5626, 0x0000884E }, /* GL_COMPARE_R_TO_TEXTURE */
- { 5650, 0x0000884E }, /* GL_COMPARE_R_TO_TEXTURE_ARB */
- { 5678, 0x00001300 }, /* GL_COMPILE */
- { 5689, 0x00001301 }, /* GL_COMPILE_AND_EXECUTE */
- { 5712, 0x00008B81 }, /* GL_COMPILE_STATUS */
- { 5730, 0x000084E9 }, /* GL_COMPRESSED_ALPHA */
- { 5750, 0x000084E9 }, /* GL_COMPRESSED_ALPHA_ARB */
- { 5774, 0x000084EC }, /* GL_COMPRESSED_INTENSITY */
- { 5798, 0x000084EC }, /* GL_COMPRESSED_INTENSITY_ARB */
- { 5826, 0x000084EA }, /* GL_COMPRESSED_LUMINANCE */
- { 5850, 0x000084EB }, /* GL_COMPRESSED_LUMINANCE_ALPHA */
- { 5880, 0x000084EB }, /* GL_COMPRESSED_LUMINANCE_ALPHA_ARB */
- { 5914, 0x000084EA }, /* GL_COMPRESSED_LUMINANCE_ARB */
- { 5942, 0x00008225 }, /* GL_COMPRESSED_RED */
- { 5960, 0x00008226 }, /* GL_COMPRESSED_RG */
- { 5977, 0x000084ED }, /* GL_COMPRESSED_RGB */
- { 5995, 0x000084EE }, /* GL_COMPRESSED_RGBA */
- { 6014, 0x000084EE }, /* GL_COMPRESSED_RGBA_ARB */
- { 6037, 0x000086B1 }, /* GL_COMPRESSED_RGBA_FXT1_3DFX */
- { 6066, 0x000083F1 }, /* GL_COMPRESSED_RGBA_S3TC_DXT1_EXT */
- { 6099, 0x000083F2 }, /* GL_COMPRESSED_RGBA_S3TC_DXT3_EXT */
- { 6132, 0x000083F3 }, /* GL_COMPRESSED_RGBA_S3TC_DXT5_EXT */
- { 6165, 0x000084ED }, /* GL_COMPRESSED_RGB_ARB */
- { 6187, 0x000086B0 }, /* GL_COMPRESSED_RGB_FXT1_3DFX */
- { 6215, 0x000083F0 }, /* GL_COMPRESSED_RGB_S3TC_DXT1_EXT */
- { 6247, 0x00008C4A }, /* GL_COMPRESSED_SLUMINANCE */
- { 6272, 0x00008C4B }, /* GL_COMPRESSED_SLUMINANCE_ALPHA */
- { 6303, 0x00008C48 }, /* GL_COMPRESSED_SRGB */
- { 6322, 0x00008C49 }, /* GL_COMPRESSED_SRGB_ALPHA */
- { 6347, 0x000086A3 }, /* GL_COMPRESSED_TEXTURE_FORMATS */
- { 6377, 0x0000911C }, /* GL_CONDITION_SATISFIED */
- { 6400, 0x00008576 }, /* GL_CONSTANT */
- { 6412, 0x00008003 }, /* GL_CONSTANT_ALPHA */
- { 6430, 0x00008003 }, /* GL_CONSTANT_ALPHA_EXT */
- { 6452, 0x00008576 }, /* GL_CONSTANT_ARB */
- { 6468, 0x00001207 }, /* GL_CONSTANT_ATTENUATION */
- { 6492, 0x00008151 }, /* GL_CONSTANT_BORDER_HP */
- { 6514, 0x00008001 }, /* GL_CONSTANT_COLOR */
- { 6532, 0x00008001 }, /* GL_CONSTANT_COLOR_EXT */
- { 6554, 0x00008576 }, /* GL_CONSTANT_EXT */
- { 6570, 0x00000002 }, /* GL_CONTEXT_COMPATIBILITY_PROFILE_BIT */
- { 6607, 0x00000001 }, /* GL_CONTEXT_CORE_PROFILE_BIT */
- { 6635, 0x0000821E }, /* GL_CONTEXT_FLAGS */
- { 6652, 0x00000001 }, /* GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT */
- { 6691, 0x00000004 }, /* GL_CONTEXT_FLAG_ROBUST_ACCESS_BIT_ARB */
- { 6729, 0x00009126 }, /* GL_CONTEXT_PROFILE_MASK */
- { 6753, 0x00008010 }, /* GL_CONVOLUTION_1D */
- { 6771, 0x00008011 }, /* GL_CONVOLUTION_2D */
- { 6789, 0x00008154 }, /* GL_CONVOLUTION_BORDER_COLOR */
- { 6817, 0x00008154 }, /* GL_CONVOLUTION_BORDER_COLOR_HP */
- { 6848, 0x00008013 }, /* GL_CONVOLUTION_BORDER_MODE */
- { 6875, 0x00008013 }, /* GL_CONVOLUTION_BORDER_MODE_EXT */
- { 6906, 0x00008015 }, /* GL_CONVOLUTION_FILTER_BIAS */
- { 6933, 0x00008015 }, /* GL_CONVOLUTION_FILTER_BIAS_EXT */
- { 6964, 0x00008014 }, /* GL_CONVOLUTION_FILTER_SCALE */
- { 6992, 0x00008014 }, /* GL_CONVOLUTION_FILTER_SCALE_EXT */
- { 7024, 0x00008017 }, /* GL_CONVOLUTION_FORMAT */
- { 7046, 0x00008017 }, /* GL_CONVOLUTION_FORMAT_EXT */
- { 7072, 0x00008019 }, /* GL_CONVOLUTION_HEIGHT */
- { 7094, 0x00008019 }, /* GL_CONVOLUTION_HEIGHT_EXT */
- { 7120, 0x00008018 }, /* GL_CONVOLUTION_WIDTH */
- { 7141, 0x00008018 }, /* GL_CONVOLUTION_WIDTH_EXT */
- { 7166, 0x00008862 }, /* GL_COORD_REPLACE */
- { 7183, 0x00008862 }, /* GL_COORD_REPLACE_ARB */
- { 7204, 0x00008862 }, /* GL_COORD_REPLACE_NV */
- { 7224, 0x00008862 }, /* GL_COORD_REPLACE_OES */
- { 7245, 0x00001503 }, /* GL_COPY */
- { 7253, 0x0000150C }, /* GL_COPY_INVERTED */
- { 7270, 0x00000706 }, /* GL_COPY_PIXEL_TOKEN */
- { 7290, 0x00008F36 }, /* GL_COPY_READ_BUFFER */
- { 7310, 0x00008F37 }, /* GL_COPY_WRITE_BUFFER */
- { 7331, 0x00000B44 }, /* GL_CULL_FACE */
- { 7344, 0x00000B45 }, /* GL_CULL_FACE_MODE */
- { 7362, 0x000081AA }, /* GL_CULL_VERTEX_EXT */
- { 7381, 0x000081AC }, /* GL_CULL_VERTEX_EYE_POSITION_EXT */
- { 7413, 0x000081AB }, /* GL_CULL_VERTEX_OBJECT_POSITION_EXT */
- { 7448, 0x00008626 }, /* GL_CURRENT_ATTRIB_NV */
- { 7469, 0x00000001 }, /* GL_CURRENT_BIT */
- { 7484, 0x00000B00 }, /* GL_CURRENT_COLOR */
- { 7501, 0x00008453 }, /* GL_CURRENT_FOG_COORD */
- { 7522, 0x00008453 }, /* GL_CURRENT_FOG_COORDINATE */
- { 7548, 0x00000B01 }, /* GL_CURRENT_INDEX */
- { 7565, 0x00008641 }, /* GL_CURRENT_MATRIX_ARB */
- { 7587, 0x00008845 }, /* GL_CURRENT_MATRIX_INDEX_ARB */
- { 7615, 0x00008641 }, /* GL_CURRENT_MATRIX_NV */
- { 7636, 0x00008640 }, /* GL_CURRENT_MATRIX_STACK_DEPTH_ARB */
- { 7670, 0x00008640 }, /* GL_CURRENT_MATRIX_STACK_DEPTH_NV */
- { 7703, 0x00000B02 }, /* GL_CURRENT_NORMAL */
- { 7721, 0x00008843 }, /* GL_CURRENT_PALETTE_MATRIX_ARB */
- { 7751, 0x00008843 }, /* GL_CURRENT_PALETTE_MATRIX_OES */
- { 7781, 0x00008B8D }, /* GL_CURRENT_PROGRAM */
- { 7800, 0x00008865 }, /* GL_CURRENT_QUERY */
- { 7817, 0x00008865 }, /* GL_CURRENT_QUERY_ARB */
- { 7838, 0x00000B04 }, /* GL_CURRENT_RASTER_COLOR */
- { 7862, 0x00000B09 }, /* GL_CURRENT_RASTER_DISTANCE */
- { 7889, 0x00000B05 }, /* GL_CURRENT_RASTER_INDEX */
- { 7913, 0x00000B07 }, /* GL_CURRENT_RASTER_POSITION */
- { 7940, 0x00000B08 }, /* GL_CURRENT_RASTER_POSITION_VALID */
- { 7973, 0x0000845F }, /* GL_CURRENT_RASTER_SECONDARY_COLOR */
- { 8007, 0x00000B06 }, /* GL_CURRENT_RASTER_TEXTURE_COORDS */
- { 8040, 0x00008459 }, /* GL_CURRENT_SECONDARY_COLOR */
- { 8067, 0x00000B03 }, /* GL_CURRENT_TEXTURE_COORDS */
- { 8093, 0x00008626 }, /* GL_CURRENT_VERTEX_ATTRIB */
- { 8118, 0x00008626 }, /* GL_CURRENT_VERTEX_ATTRIB_ARB */
- { 8147, 0x000086A8 }, /* GL_CURRENT_WEIGHT_ARB */
- { 8169, 0x00000900 }, /* GL_CW */
- { 8175, 0x0000875B }, /* GL_DEBUG_ASSERT_MESA */
- { 8196, 0x00008759 }, /* GL_DEBUG_OBJECT_MESA */
- { 8217, 0x0000875A }, /* GL_DEBUG_PRINT_MESA */
- { 8237, 0x00002101 }, /* GL_DECAL */
- { 8246, 0x00001E03 }, /* GL_DECR */
- { 8254, 0x00008508 }, /* GL_DECR_WRAP */
- { 8267, 0x00008508 }, /* GL_DECR_WRAP_EXT */
- { 8284, 0x00008B80 }, /* GL_DELETE_STATUS */
- { 8301, 0x00001801 }, /* GL_DEPTH */
- { 8310, 0x000088F0 }, /* GL_DEPTH24_STENCIL8 */
- { 8330, 0x000088F0 }, /* GL_DEPTH24_STENCIL8_EXT */
- { 8354, 0x000088F0 }, /* GL_DEPTH24_STENCIL8_OES */
- { 8378, 0x00008D00 }, /* GL_DEPTH_ATTACHMENT */
- { 8398, 0x00008D00 }, /* GL_DEPTH_ATTACHMENT_EXT */
- { 8422, 0x00008D00 }, /* GL_DEPTH_ATTACHMENT_OES */
- { 8446, 0x00000D1F }, /* GL_DEPTH_BIAS */
- { 8460, 0x00000D56 }, /* GL_DEPTH_BITS */
- { 8474, 0x00008891 }, /* GL_DEPTH_BOUNDS_EXT */
- { 8494, 0x00008890 }, /* GL_DEPTH_BOUNDS_TEST_EXT */
- { 8519, 0x00008223 }, /* GL_DEPTH_BUFFER */
- { 8535, 0x00000100 }, /* GL_DEPTH_BUFFER_BIT */
- { 8555, 0x0000864F }, /* GL_DEPTH_CLAMP */
- { 8570, 0x0000864F }, /* GL_DEPTH_CLAMP_NV */
- { 8588, 0x00000B73 }, /* GL_DEPTH_CLEAR_VALUE */
- { 8609, 0x00001902 }, /* GL_DEPTH_COMPONENT */
- { 8628, 0x000081A5 }, /* GL_DEPTH_COMPONENT16 */
- { 8649, 0x000081A5 }, /* GL_DEPTH_COMPONENT16_ARB */
- { 8674, 0x000081A5 }, /* GL_DEPTH_COMPONENT16_OES */
- { 8699, 0x000081A5 }, /* GL_DEPTH_COMPONENT16_SGIX */
- { 8725, 0x000081A6 }, /* GL_DEPTH_COMPONENT24 */
- { 8746, 0x000081A6 }, /* GL_DEPTH_COMPONENT24_ARB */
- { 8771, 0x000081A6 }, /* GL_DEPTH_COMPONENT24_OES */
- { 8796, 0x000081A6 }, /* GL_DEPTH_COMPONENT24_SGIX */
- { 8822, 0x000081A7 }, /* GL_DEPTH_COMPONENT32 */
- { 8843, 0x000081A7 }, /* GL_DEPTH_COMPONENT32_ARB */
- { 8868, 0x000081A7 }, /* GL_DEPTH_COMPONENT32_OES */
- { 8893, 0x000081A7 }, /* GL_DEPTH_COMPONENT32_SGIX */
- { 8919, 0x00000B74 }, /* GL_DEPTH_FUNC */
- { 8933, 0x00000B70 }, /* GL_DEPTH_RANGE */
- { 8948, 0x00000D1E }, /* GL_DEPTH_SCALE */
- { 8963, 0x000084F9 }, /* GL_DEPTH_STENCIL */
- { 8980, 0x0000821A }, /* GL_DEPTH_STENCIL_ATTACHMENT */
- { 9008, 0x000084F9 }, /* GL_DEPTH_STENCIL_EXT */
- { 9029, 0x000084F9 }, /* GL_DEPTH_STENCIL_NV */
- { 9049, 0x000084F9 }, /* GL_DEPTH_STENCIL_OES */
- { 9070, 0x0000886F }, /* GL_DEPTH_STENCIL_TO_BGRA_NV */
- { 9098, 0x0000886E }, /* GL_DEPTH_STENCIL_TO_RGBA_NV */
- { 9126, 0x00000B71 }, /* GL_DEPTH_TEST */
- { 9140, 0x0000884B }, /* GL_DEPTH_TEXTURE_MODE */
- { 9162, 0x0000884B }, /* GL_DEPTH_TEXTURE_MODE_ARB */
- { 9188, 0x00000B72 }, /* GL_DEPTH_WRITEMASK */
- { 9207, 0x00001201 }, /* GL_DIFFUSE */
- { 9218, 0x00000BD0 }, /* GL_DITHER */
- { 9228, 0x00000A02 }, /* GL_DOMAIN */
- { 9238, 0x00001100 }, /* GL_DONT_CARE */
- { 9251, 0x000086AE }, /* GL_DOT3_RGB */
- { 9263, 0x000086AF }, /* GL_DOT3_RGBA */
- { 9276, 0x000086AF }, /* GL_DOT3_RGBA_ARB */
- { 9293, 0x00008741 }, /* GL_DOT3_RGBA_EXT */
- { 9310, 0x000086AE }, /* GL_DOT3_RGB_ARB */
- { 9326, 0x00008740 }, /* GL_DOT3_RGB_EXT */
- { 9342, 0x0000140A }, /* GL_DOUBLE */
- { 9352, 0x00000C32 }, /* GL_DOUBLEBUFFER */
- { 9368, 0x00000C01 }, /* GL_DRAW_BUFFER */
- { 9383, 0x00008825 }, /* GL_DRAW_BUFFER0 */
- { 9399, 0x00008825 }, /* GL_DRAW_BUFFER0_ARB */
- { 9419, 0x00008825 }, /* GL_DRAW_BUFFER0_ATI */
- { 9439, 0x00008826 }, /* GL_DRAW_BUFFER1 */
- { 9455, 0x0000882F }, /* GL_DRAW_BUFFER10 */
- { 9472, 0x0000882F }, /* GL_DRAW_BUFFER10_ARB */
- { 9493, 0x0000882F }, /* GL_DRAW_BUFFER10_ATI */
- { 9514, 0x00008830 }, /* GL_DRAW_BUFFER11 */
- { 9531, 0x00008830 }, /* GL_DRAW_BUFFER11_ARB */
- { 9552, 0x00008830 }, /* GL_DRAW_BUFFER11_ATI */
- { 9573, 0x00008831 }, /* GL_DRAW_BUFFER12 */
- { 9590, 0x00008831 }, /* GL_DRAW_BUFFER12_ARB */
- { 9611, 0x00008831 }, /* GL_DRAW_BUFFER12_ATI */
- { 9632, 0x00008832 }, /* GL_DRAW_BUFFER13 */
- { 9649, 0x00008832 }, /* GL_DRAW_BUFFER13_ARB */
- { 9670, 0x00008832 }, /* GL_DRAW_BUFFER13_ATI */
- { 9691, 0x00008833 }, /* GL_DRAW_BUFFER14 */
- { 9708, 0x00008833 }, /* GL_DRAW_BUFFER14_ARB */
- { 9729, 0x00008833 }, /* GL_DRAW_BUFFER14_ATI */
- { 9750, 0x00008834 }, /* GL_DRAW_BUFFER15 */
- { 9767, 0x00008834 }, /* GL_DRAW_BUFFER15_ARB */
- { 9788, 0x00008834 }, /* GL_DRAW_BUFFER15_ATI */
- { 9809, 0x00008826 }, /* GL_DRAW_BUFFER1_ARB */
- { 9829, 0x00008826 }, /* GL_DRAW_BUFFER1_ATI */
- { 9849, 0x00008827 }, /* GL_DRAW_BUFFER2 */
- { 9865, 0x00008827 }, /* GL_DRAW_BUFFER2_ARB */
- { 9885, 0x00008827 }, /* GL_DRAW_BUFFER2_ATI */
- { 9905, 0x00008828 }, /* GL_DRAW_BUFFER3 */
- { 9921, 0x00008828 }, /* GL_DRAW_BUFFER3_ARB */
- { 9941, 0x00008828 }, /* GL_DRAW_BUFFER3_ATI */
- { 9961, 0x00008829 }, /* GL_DRAW_BUFFER4 */
- { 9977, 0x00008829 }, /* GL_DRAW_BUFFER4_ARB */
- { 9997, 0x00008829 }, /* GL_DRAW_BUFFER4_ATI */
- { 10017, 0x0000882A }, /* GL_DRAW_BUFFER5 */
- { 10033, 0x0000882A }, /* GL_DRAW_BUFFER5_ARB */
- { 10053, 0x0000882A }, /* GL_DRAW_BUFFER5_ATI */
- { 10073, 0x0000882B }, /* GL_DRAW_BUFFER6 */
- { 10089, 0x0000882B }, /* GL_DRAW_BUFFER6_ARB */
- { 10109, 0x0000882B }, /* GL_DRAW_BUFFER6_ATI */
- { 10129, 0x0000882C }, /* GL_DRAW_BUFFER7 */
- { 10145, 0x0000882C }, /* GL_DRAW_BUFFER7_ARB */
- { 10165, 0x0000882C }, /* GL_DRAW_BUFFER7_ATI */
- { 10185, 0x0000882D }, /* GL_DRAW_BUFFER8 */
- { 10201, 0x0000882D }, /* GL_DRAW_BUFFER8_ARB */
- { 10221, 0x0000882D }, /* GL_DRAW_BUFFER8_ATI */
- { 10241, 0x0000882E }, /* GL_DRAW_BUFFER9 */
- { 10257, 0x0000882E }, /* GL_DRAW_BUFFER9_ARB */
- { 10277, 0x0000882E }, /* GL_DRAW_BUFFER9_ATI */
- { 10297, 0x00008CA9 }, /* GL_DRAW_FRAMEBUFFER */
- { 10317, 0x00008CA6 }, /* GL_DRAW_FRAMEBUFFER_BINDING */
- { 10345, 0x00008CA6 }, /* GL_DRAW_FRAMEBUFFER_BINDING_EXT */
- { 10377, 0x00008CA9 }, /* GL_DRAW_FRAMEBUFFER_EXT */
- { 10401, 0x00000705 }, /* GL_DRAW_PIXEL_TOKEN */
- { 10421, 0x00000304 }, /* GL_DST_ALPHA */
- { 10434, 0x00000306 }, /* GL_DST_COLOR */
- { 10447, 0x0000877A }, /* GL_DU8DV8_ATI */
- { 10461, 0x00008779 }, /* GL_DUDV_ATI */
- { 10473, 0x000088EA }, /* GL_DYNAMIC_COPY */
- { 10489, 0x000088EA }, /* GL_DYNAMIC_COPY_ARB */
- { 10509, 0x000088E8 }, /* GL_DYNAMIC_DRAW */
- { 10525, 0x000088E8 }, /* GL_DYNAMIC_DRAW_ARB */
- { 10545, 0x000088E9 }, /* GL_DYNAMIC_READ */
- { 10561, 0x000088E9 }, /* GL_DYNAMIC_READ_ARB */
- { 10581, 0x00000B43 }, /* GL_EDGE_FLAG */
- { 10594, 0x00008079 }, /* GL_EDGE_FLAG_ARRAY */
- { 10613, 0x0000889B }, /* GL_EDGE_FLAG_ARRAY_BUFFER_BINDING */
- { 10647, 0x0000889B }, /* GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB */
- { 10685, 0x00008093 }, /* GL_EDGE_FLAG_ARRAY_POINTER */
- { 10712, 0x0000808C }, /* GL_EDGE_FLAG_ARRAY_STRIDE */
- { 10738, 0x00008893 }, /* GL_ELEMENT_ARRAY_BUFFER */
- { 10762, 0x00008895 }, /* GL_ELEMENT_ARRAY_BUFFER_BINDING */
- { 10794, 0x00008895 }, /* GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB */
- { 10830, 0x00001600 }, /* GL_EMISSION */
- { 10842, 0x00002000 }, /* GL_ENABLE_BIT */
- { 10856, 0x00000202 }, /* GL_EQUAL */
- { 10865, 0x00001509 }, /* GL_EQUIV */
- { 10874, 0x00010000 }, /* GL_EVAL_BIT */
- { 10886, 0x00000800 }, /* GL_EXP */
- { 10893, 0x00000801 }, /* GL_EXP2 */
- { 10901, 0x00001F03 }, /* GL_EXTENSIONS */
- { 10915, 0x00002400 }, /* GL_EYE_LINEAR */
- { 10929, 0x00002502 }, /* GL_EYE_PLANE */
- { 10942, 0x0000855C }, /* GL_EYE_PLANE_ABSOLUTE_NV */
- { 10967, 0x0000855B }, /* GL_EYE_RADIAL_NV */
- { 10984, 0x00000000 }, /* GL_FALSE */
- { 10993, 0x00001101 }, /* GL_FASTEST */
- { 11004, 0x00001C01 }, /* GL_FEEDBACK */
- { 11016, 0x00000DF0 }, /* GL_FEEDBACK_BUFFER_POINTER */
- { 11043, 0x00000DF1 }, /* GL_FEEDBACK_BUFFER_SIZE */
- { 11067, 0x00000DF2 }, /* GL_FEEDBACK_BUFFER_TYPE */
- { 11091, 0x00001B02 }, /* GL_FILL */
- { 11099, 0x00008E4D }, /* GL_FIRST_VERTEX_CONVENTION */
- { 11126, 0x00008E4D }, /* GL_FIRST_VERTEX_CONVENTION_EXT */
- { 11157, 0x0000140C }, /* GL_FIXED */
- { 11166, 0x0000140C }, /* GL_FIXED_OES */
- { 11179, 0x0000891D }, /* GL_FIXED_ONLY */
- { 11193, 0x0000891D }, /* GL_FIXED_ONLY_ARB */
- { 11211, 0x00001D00 }, /* GL_FLAT */
- { 11219, 0x00001406 }, /* GL_FLOAT */
- { 11228, 0x00008B5A }, /* GL_FLOAT_MAT2 */
- { 11242, 0x00008B5A }, /* GL_FLOAT_MAT2_ARB */
- { 11260, 0x00008B65 }, /* GL_FLOAT_MAT2x3 */
- { 11276, 0x00008B66 }, /* GL_FLOAT_MAT2x4 */
- { 11292, 0x00008B5B }, /* GL_FLOAT_MAT3 */
- { 11306, 0x00008B5B }, /* GL_FLOAT_MAT3_ARB */
- { 11324, 0x00008B67 }, /* GL_FLOAT_MAT3x2 */
- { 11340, 0x00008B68 }, /* GL_FLOAT_MAT3x4 */
- { 11356, 0x00008B5C }, /* GL_FLOAT_MAT4 */
- { 11370, 0x00008B5C }, /* GL_FLOAT_MAT4_ARB */
- { 11388, 0x00008B69 }, /* GL_FLOAT_MAT4x2 */
- { 11404, 0x00008B6A }, /* GL_FLOAT_MAT4x3 */
- { 11420, 0x00008B50 }, /* GL_FLOAT_VEC2 */
- { 11434, 0x00008B50 }, /* GL_FLOAT_VEC2_ARB */
- { 11452, 0x00008B51 }, /* GL_FLOAT_VEC3 */
- { 11466, 0x00008B51 }, /* GL_FLOAT_VEC3_ARB */
- { 11484, 0x00008B52 }, /* GL_FLOAT_VEC4 */
- { 11498, 0x00008B52 }, /* GL_FLOAT_VEC4_ARB */
- { 11516, 0x00000B60 }, /* GL_FOG */
- { 11523, 0x00000080 }, /* GL_FOG_BIT */
- { 11534, 0x00000B66 }, /* GL_FOG_COLOR */
- { 11547, 0x00008451 }, /* GL_FOG_COORD */
- { 11560, 0x00008451 }, /* GL_FOG_COORDINATE */
- { 11578, 0x00008457 }, /* GL_FOG_COORDINATE_ARRAY */
- { 11602, 0x0000889D }, /* GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING */
- { 11641, 0x0000889D }, /* GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB */
- { 11684, 0x00008456 }, /* GL_FOG_COORDINATE_ARRAY_POINTER */
- { 11716, 0x00008455 }, /* GL_FOG_COORDINATE_ARRAY_STRIDE */
- { 11747, 0x00008454 }, /* GL_FOG_COORDINATE_ARRAY_TYPE */
- { 11776, 0x00008450 }, /* GL_FOG_COORDINATE_SOURCE */
- { 11801, 0x00008457 }, /* GL_FOG_COORD_ARRAY */
- { 11820, 0x0000889D }, /* GL_FOG_COORD_ARRAY_BUFFER_BINDING */
- { 11854, 0x00008456 }, /* GL_FOG_COORD_ARRAY_POINTER */
- { 11881, 0x00008455 }, /* GL_FOG_COORD_ARRAY_STRIDE */
- { 11907, 0x00008454 }, /* GL_FOG_COORD_ARRAY_TYPE */
- { 11931, 0x00008450 }, /* GL_FOG_COORD_SRC */
- { 11948, 0x00000B62 }, /* GL_FOG_DENSITY */
- { 11963, 0x0000855A }, /* GL_FOG_DISTANCE_MODE_NV */
- { 11987, 0x00000B64 }, /* GL_FOG_END */
- { 11998, 0x00000C54 }, /* GL_FOG_HINT */
- { 12010, 0x00000B61 }, /* GL_FOG_INDEX */
- { 12023, 0x00000B65 }, /* GL_FOG_MODE */
- { 12035, 0x00008198 }, /* GL_FOG_OFFSET_SGIX */
- { 12054, 0x00008199 }, /* GL_FOG_OFFSET_VALUE_SGIX */
- { 12079, 0x00000B63 }, /* GL_FOG_START */
- { 12092, 0x00008452 }, /* GL_FRAGMENT_DEPTH */
- { 12110, 0x00008804 }, /* GL_FRAGMENT_PROGRAM_ARB */
- { 12134, 0x00008B30 }, /* GL_FRAGMENT_SHADER */
- { 12153, 0x00008B30 }, /* GL_FRAGMENT_SHADER_ARB */
- { 12176, 0x00008B8B }, /* GL_FRAGMENT_SHADER_DERIVATIVE_HINT */
- { 12211, 0x00008B8B }, /* GL_FRAGMENT_SHADER_DERIVATIVE_HINT_OES */
- { 12250, 0x00008D40 }, /* GL_FRAMEBUFFER */
- { 12265, 0x00008215 }, /* GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE */
- { 12302, 0x00008214 }, /* GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE */
- { 12338, 0x00008210 }, /* GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING */
- { 12379, 0x00008211 }, /* GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE */
- { 12420, 0x00008216 }, /* GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE */
- { 12457, 0x00008213 }, /* GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE */
- { 12494, 0x00008DA7 }, /* GL_FRAMEBUFFER_ATTACHMENT_LAYERED */
- { 12528, 0x00008DA7 }, /* GL_FRAMEBUFFER_ATTACHMENT_LAYERED_ARB */
- { 12566, 0x00008CD1 }, /* GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME */
- { 12604, 0x00008CD1 }, /* GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT */
- { 12646, 0x00008CD1 }, /* GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_OES */
- { 12688, 0x00008CD0 }, /* GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE */
- { 12726, 0x00008CD0 }, /* GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT */
- { 12768, 0x00008CD0 }, /* GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_OES */
- { 12810, 0x00008212 }, /* GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE */
- { 12845, 0x00008217 }, /* GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE */
- { 12884, 0x00008CD4 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT */
- { 12933, 0x00008CD4 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_OES */
- { 12982, 0x00008CD3 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE */
- { 13030, 0x00008CD3 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_EXT */
- { 13082, 0x00008CD3 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_OES */
- { 13134, 0x00008CD4 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER */
- { 13174, 0x00008CD4 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT */
- { 13218, 0x00008CD2 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL */
- { 13258, 0x00008CD2 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT */
- { 13302, 0x00008CD2 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_OES */
- { 13346, 0x00008CA6 }, /* GL_FRAMEBUFFER_BINDING */
- { 13369, 0x00008CA6 }, /* GL_FRAMEBUFFER_BINDING_EXT */
- { 13396, 0x00008CA6 }, /* GL_FRAMEBUFFER_BINDING_OES */
- { 13423, 0x00008CD5 }, /* GL_FRAMEBUFFER_COMPLETE */
- { 13447, 0x00008CD5 }, /* GL_FRAMEBUFFER_COMPLETE_EXT */
- { 13475, 0x00008CD5 }, /* GL_FRAMEBUFFER_COMPLETE_OES */
- { 13503, 0x00008218 }, /* GL_FRAMEBUFFER_DEFAULT */
- { 13526, 0x00008D40 }, /* GL_FRAMEBUFFER_EXT */
- { 13545, 0x00008CD6 }, /* GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT */
- { 13582, 0x00008CD6 }, /* GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT */
- { 13623, 0x00008CD6 }, /* GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_OES */
- { 13664, 0x00008CD9 }, /* GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS */
- { 13701, 0x00008CD9 }, /* GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT */
- { 13742, 0x00008CD9 }, /* GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_OES */
- { 13783, 0x00008CDB }, /* GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER */
- { 13821, 0x00008CDB }, /* GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT */
- { 13863, 0x00008CDB }, /* GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_OES */
- { 13905, 0x00008CD8 }, /* GL_FRAMEBUFFER_INCOMPLETE_DUPLICATE_ATTACHMENT_EXT */
- { 13956, 0x00008CDA }, /* GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT */
- { 13994, 0x00008CDA }, /* GL_FRAMEBUFFER_INCOMPLETE_FORMATS_OES */
- { 14032, 0x00008DA9 }, /* GL_FRAMEBUFFER_INCOMPLETE_LAYER_COUNT_ARB */
- { 14074, 0x00008DA8 }, /* GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS */
- { 14114, 0x00008DA8 }, /* GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_ARB */
- { 14158, 0x00008CD7 }, /* GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT */
- { 14203, 0x00008CD7 }, /* GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT */
- { 14252, 0x00008CD7 }, /* GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_OES */
- { 14301, 0x00008D56 }, /* GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE */
- { 14339, 0x00008D56 }, /* GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_EXT */
- { 14381, 0x00008CDC }, /* GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER */
- { 14419, 0x00008CDC }, /* GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT */
- { 14461, 0x00008CDC }, /* GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_OES */
- { 14503, 0x00008D40 }, /* GL_FRAMEBUFFER_OES */
- { 14522, 0x00008CDE }, /* GL_FRAMEBUFFER_STATUS_ERROR_EXT */
- { 14554, 0x00008219 }, /* GL_FRAMEBUFFER_UNDEFINED */
- { 14579, 0x00008CDD }, /* GL_FRAMEBUFFER_UNSUPPORTED */
- { 14606, 0x00008CDD }, /* GL_FRAMEBUFFER_UNSUPPORTED_EXT */
- { 14637, 0x00008CDD }, /* GL_FRAMEBUFFER_UNSUPPORTED_OES */
- { 14668, 0x00000404 }, /* GL_FRONT */
- { 14677, 0x00000408 }, /* GL_FRONT_AND_BACK */
- { 14695, 0x00000B46 }, /* GL_FRONT_FACE */
- { 14709, 0x00000400 }, /* GL_FRONT_LEFT */
- { 14723, 0x00000401 }, /* GL_FRONT_RIGHT */
- { 14738, 0x00008006 }, /* GL_FUNC_ADD */
- { 14750, 0x00008006 }, /* GL_FUNC_ADD_EXT */
- { 14766, 0x00008006 }, /* GL_FUNC_ADD_OES */
- { 14782, 0x0000800B }, /* GL_FUNC_REVERSE_SUBTRACT */
- { 14807, 0x0000800B }, /* GL_FUNC_REVERSE_SUBTRACT_EXT */
- { 14836, 0x0000800B }, /* GL_FUNC_REVERSE_SUBTRACT_OES */
- { 14865, 0x0000800A }, /* GL_FUNC_SUBTRACT */
- { 14882, 0x0000800A }, /* GL_FUNC_SUBTRACT_EXT */
- { 14903, 0x0000800A }, /* GL_FUNC_SUBTRACT_OES */
- { 14924, 0x00008191 }, /* GL_GENERATE_MIPMAP */
- { 14943, 0x00008192 }, /* GL_GENERATE_MIPMAP_HINT */
- { 14967, 0x00008192 }, /* GL_GENERATE_MIPMAP_HINT_SGIS */
- { 14996, 0x00008191 }, /* GL_GENERATE_MIPMAP_SGIS */
- { 15020, 0x00008917 }, /* GL_GEOMETRY_INPUT_TYPE */
- { 15043, 0x00008DDB }, /* GL_GEOMETRY_INPUT_TYPE_ARB */
- { 15070, 0x00008918 }, /* GL_GEOMETRY_OUTPUT_TYPE */
- { 15094, 0x00008DDC }, /* GL_GEOMETRY_OUTPUT_TYPE_ARB */
- { 15122, 0x00008DD9 }, /* GL_GEOMETRY_SHADER */
- { 15141, 0x00008DD9 }, /* GL_GEOMETRY_SHADER_ARB */
- { 15164, 0x00008916 }, /* GL_GEOMETRY_VERTICES_OUT */
- { 15189, 0x00008DDA }, /* GL_GEOMETRY_VERTICES_OUT_ARB */
- { 15218, 0x00000206 }, /* GL_GEQUAL */
- { 15228, 0x00000204 }, /* GL_GREATER */
- { 15239, 0x00001904 }, /* GL_GREEN */
- { 15248, 0x00000D19 }, /* GL_GREEN_BIAS */
- { 15262, 0x00000D53 }, /* GL_GREEN_BITS */
- { 15276, 0x00008D95 }, /* GL_GREEN_INTEGER */
- { 15293, 0x00008D95 }, /* GL_GREEN_INTEGER_EXT */
- { 15314, 0x00000D18 }, /* GL_GREEN_SCALE */
- { 15329, 0x00008253 }, /* GL_GUILTY_CONTEXT_RESET_ARB */
- { 15357, 0x0000140B }, /* GL_HALF_FLOAT */
- { 15371, 0x00008D61 }, /* GL_HALF_FLOAT_OES */
- { 15389, 0x00008DF2 }, /* GL_HIGH_FLOAT */
- { 15403, 0x00008DF5 }, /* GL_HIGH_INT */
- { 15415, 0x00008000 }, /* GL_HINT_BIT */
- { 15427, 0x00008024 }, /* GL_HISTOGRAM */
- { 15440, 0x0000802B }, /* GL_HISTOGRAM_ALPHA_SIZE */
- { 15464, 0x0000802B }, /* GL_HISTOGRAM_ALPHA_SIZE_EXT */
- { 15492, 0x0000802A }, /* GL_HISTOGRAM_BLUE_SIZE */
- { 15515, 0x0000802A }, /* GL_HISTOGRAM_BLUE_SIZE_EXT */
- { 15542, 0x00008024 }, /* GL_HISTOGRAM_EXT */
- { 15559, 0x00008027 }, /* GL_HISTOGRAM_FORMAT */
- { 15579, 0x00008027 }, /* GL_HISTOGRAM_FORMAT_EXT */
- { 15603, 0x00008029 }, /* GL_HISTOGRAM_GREEN_SIZE */
- { 15627, 0x00008029 }, /* GL_HISTOGRAM_GREEN_SIZE_EXT */
- { 15655, 0x0000802C }, /* GL_HISTOGRAM_LUMINANCE_SIZE */
- { 15683, 0x0000802C }, /* GL_HISTOGRAM_LUMINANCE_SIZE_EXT */
- { 15715, 0x00008028 }, /* GL_HISTOGRAM_RED_SIZE */
- { 15737, 0x00008028 }, /* GL_HISTOGRAM_RED_SIZE_EXT */
- { 15763, 0x0000802D }, /* GL_HISTOGRAM_SINK */
- { 15781, 0x0000802D }, /* GL_HISTOGRAM_SINK_EXT */
- { 15803, 0x00008026 }, /* GL_HISTOGRAM_WIDTH */
- { 15822, 0x00008026 }, /* GL_HISTOGRAM_WIDTH_EXT */
- { 15845, 0x0000862A }, /* GL_IDENTITY_NV */
- { 15860, 0x00008150 }, /* GL_IGNORE_BORDER_HP */
- { 15880, 0x00008B9B }, /* GL_IMPLEMENTATION_COLOR_READ_FORMAT */
- { 15916, 0x00008B9B }, /* GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES */
- { 15956, 0x00008B9A }, /* GL_IMPLEMENTATION_COLOR_READ_TYPE */
- { 15990, 0x00008B9A }, /* GL_IMPLEMENTATION_COLOR_READ_TYPE_OES */
- { 16028, 0x00001E02 }, /* GL_INCR */
- { 16036, 0x00008507 }, /* GL_INCR_WRAP */
- { 16049, 0x00008507 }, /* GL_INCR_WRAP_EXT */
- { 16066, 0x00008222 }, /* GL_INDEX */
- { 16075, 0x00008077 }, /* GL_INDEX_ARRAY */
- { 16090, 0x00008899 }, /* GL_INDEX_ARRAY_BUFFER_BINDING */
- { 16120, 0x00008899 }, /* GL_INDEX_ARRAY_BUFFER_BINDING_ARB */
- { 16154, 0x00008091 }, /* GL_INDEX_ARRAY_POINTER */
- { 16177, 0x00008086 }, /* GL_INDEX_ARRAY_STRIDE */
- { 16199, 0x00008085 }, /* GL_INDEX_ARRAY_TYPE */
- { 16219, 0x00000D51 }, /* GL_INDEX_BITS */
- { 16233, 0x00000C20 }, /* GL_INDEX_CLEAR_VALUE */
- { 16254, 0x00000BF1 }, /* GL_INDEX_LOGIC_OP */
- { 16272, 0x00000C30 }, /* GL_INDEX_MODE */
- { 16286, 0x00000D13 }, /* GL_INDEX_OFFSET */
- { 16302, 0x00000D12 }, /* GL_INDEX_SHIFT */
- { 16317, 0x00000C21 }, /* GL_INDEX_WRITEMASK */
- { 16336, 0x00008B84 }, /* GL_INFO_LOG_LENGTH */
- { 16355, 0x00008254 }, /* GL_INNOCENT_CONTEXT_RESET_ARB */
- { 16385, 0x00001404 }, /* GL_INT */
- { 16392, 0x00008049 }, /* GL_INTENSITY */
- { 16405, 0x0000804C }, /* GL_INTENSITY12 */
- { 16420, 0x0000804C }, /* GL_INTENSITY12_EXT */
- { 16439, 0x0000804D }, /* GL_INTENSITY16 */
- { 16454, 0x00008D8B }, /* GL_INTENSITY16I_EXT */
- { 16474, 0x00008D79 }, /* GL_INTENSITY16UI_EXT */
- { 16495, 0x0000804D }, /* GL_INTENSITY16_EXT */
- { 16514, 0x00008D85 }, /* GL_INTENSITY32I_EXT */
- { 16534, 0x00008D73 }, /* GL_INTENSITY32UI_EXT */
- { 16555, 0x0000804A }, /* GL_INTENSITY4 */
- { 16569, 0x0000804A }, /* GL_INTENSITY4_EXT */
- { 16587, 0x0000804B }, /* GL_INTENSITY8 */
- { 16601, 0x00008D91 }, /* GL_INTENSITY8I_EXT */
- { 16620, 0x00008D7F }, /* GL_INTENSITY8UI_EXT */
- { 16640, 0x0000804B }, /* GL_INTENSITY8_EXT */
- { 16658, 0x00008049 }, /* GL_INTENSITY_EXT */
- { 16675, 0x00008C8C }, /* GL_INTERLEAVED_ATTRIBS */
- { 16698, 0x00008C8C }, /* GL_INTERLEAVED_ATTRIBS_EXT */
- { 16725, 0x00008575 }, /* GL_INTERPOLATE */
- { 16740, 0x00008575 }, /* GL_INTERPOLATE_ARB */
- { 16759, 0x00008575 }, /* GL_INTERPOLATE_EXT */
- { 16778, 0x00008DF7 }, /* GL_INT_10_10_10_2_OES */
- { 16800, 0x00008DC9 }, /* GL_INT_SAMPLER_1D */
- { 16818, 0x00008DCE }, /* GL_INT_SAMPLER_1D_ARRAY */
- { 16842, 0x00008DCE }, /* GL_INT_SAMPLER_1D_ARRAY_EXT */
- { 16870, 0x00008DC9 }, /* GL_INT_SAMPLER_1D_EXT */
- { 16892, 0x00008DCA }, /* GL_INT_SAMPLER_2D */
- { 16910, 0x00008DCF }, /* GL_INT_SAMPLER_2D_ARRAY */
- { 16934, 0x00008DCF }, /* GL_INT_SAMPLER_2D_ARRAY_EXT */
- { 16962, 0x00008DCA }, /* GL_INT_SAMPLER_2D_EXT */
- { 16984, 0x00008DCD }, /* GL_INT_SAMPLER_2D_RECT */
- { 17007, 0x00008DCD }, /* GL_INT_SAMPLER_2D_RECT_EXT */
- { 17034, 0x00008DCB }, /* GL_INT_SAMPLER_3D */
- { 17052, 0x00008DCB }, /* GL_INT_SAMPLER_3D_EXT */
- { 17074, 0x00008DD0 }, /* GL_INT_SAMPLER_BUFFER */
- { 17096, 0x00008DD0 }, /* GL_INT_SAMPLER_BUFFER_EXT */
- { 17122, 0x00008DCC }, /* GL_INT_SAMPLER_CUBE */
- { 17142, 0x00008DCC }, /* GL_INT_SAMPLER_CUBE_EXT */
- { 17166, 0x00008B53 }, /* GL_INT_VEC2 */
- { 17178, 0x00008B53 }, /* GL_INT_VEC2_ARB */
- { 17194, 0x00008B54 }, /* GL_INT_VEC3 */
- { 17206, 0x00008B54 }, /* GL_INT_VEC3_ARB */
- { 17222, 0x00008B55 }, /* GL_INT_VEC4 */
- { 17234, 0x00008B55 }, /* GL_INT_VEC4_ARB */
- { 17250, 0x00000500 }, /* GL_INVALID_ENUM */
- { 17266, 0x00000506 }, /* GL_INVALID_FRAMEBUFFER_OPERATION */
- { 17299, 0x00000506 }, /* GL_INVALID_FRAMEBUFFER_OPERATION_EXT */
- { 17336, 0x00000506 }, /* GL_INVALID_FRAMEBUFFER_OPERATION_OES */
- { 17373, 0x00000502 }, /* GL_INVALID_OPERATION */
- { 17394, 0x00000501 }, /* GL_INVALID_VALUE */
- { 17411, 0x0000862B }, /* GL_INVERSE_NV */
- { 17425, 0x0000862D }, /* GL_INVERSE_TRANSPOSE_NV */
- { 17449, 0x0000150A }, /* GL_INVERT */
- { 17459, 0x00001E00 }, /* GL_KEEP */
- { 17467, 0x00008E4E }, /* GL_LAST_VERTEX_CONVENTION */
- { 17493, 0x00008E4E }, /* GL_LAST_VERTEX_CONVENTION_EXT */
- { 17523, 0x00000406 }, /* GL_LEFT */
- { 17531, 0x00000203 }, /* GL_LEQUAL */
- { 17541, 0x00000201 }, /* GL_LESS */
- { 17549, 0x00004000 }, /* GL_LIGHT0 */
- { 17559, 0x00004001 }, /* GL_LIGHT1 */
- { 17569, 0x00004002 }, /* GL_LIGHT2 */
- { 17579, 0x00004003 }, /* GL_LIGHT3 */
- { 17589, 0x00004004 }, /* GL_LIGHT4 */
- { 17599, 0x00004005 }, /* GL_LIGHT5 */
- { 17609, 0x00004006 }, /* GL_LIGHT6 */
- { 17619, 0x00004007 }, /* GL_LIGHT7 */
- { 17629, 0x00000B50 }, /* GL_LIGHTING */
- { 17641, 0x00000040 }, /* GL_LIGHTING_BIT */
- { 17657, 0x00000B53 }, /* GL_LIGHT_MODEL_AMBIENT */
- { 17680, 0x000081F8 }, /* GL_LIGHT_MODEL_COLOR_CONTROL */
- { 17709, 0x000081F8 }, /* GL_LIGHT_MODEL_COLOR_CONTROL_EXT */
- { 17742, 0x00000B51 }, /* GL_LIGHT_MODEL_LOCAL_VIEWER */
- { 17770, 0x00000B52 }, /* GL_LIGHT_MODEL_TWO_SIDE */
- { 17794, 0x00001B01 }, /* GL_LINE */
- { 17802, 0x00002601 }, /* GL_LINEAR */
- { 17812, 0x00001208 }, /* GL_LINEAR_ATTENUATION */
- { 17834, 0x00008170 }, /* GL_LINEAR_CLIPMAP_LINEAR_SGIX */
- { 17864, 0x0000844F }, /* GL_LINEAR_CLIPMAP_NEAREST_SGIX */
- { 17895, 0x00002703 }, /* GL_LINEAR_MIPMAP_LINEAR */
- { 17919, 0x00002701 }, /* GL_LINEAR_MIPMAP_NEAREST */
- { 17944, 0x00000001 }, /* GL_LINES */
- { 17953, 0x0000000A }, /* GL_LINES_ADJACENCY */
- { 17972, 0x0000000A }, /* GL_LINES_ADJACENCY_ARB */
- { 17995, 0x00000004 }, /* GL_LINE_BIT */
- { 18007, 0x00000002 }, /* GL_LINE_LOOP */
- { 18020, 0x00000707 }, /* GL_LINE_RESET_TOKEN */
- { 18040, 0x00000B20 }, /* GL_LINE_SMOOTH */
- { 18055, 0x00000C52 }, /* GL_LINE_SMOOTH_HINT */
- { 18075, 0x00000B24 }, /* GL_LINE_STIPPLE */
- { 18091, 0x00000B25 }, /* GL_LINE_STIPPLE_PATTERN */
- { 18115, 0x00000B26 }, /* GL_LINE_STIPPLE_REPEAT */
- { 18138, 0x00000003 }, /* GL_LINE_STRIP */
- { 18152, 0x0000000B }, /* GL_LINE_STRIP_ADJACENCY */
- { 18176, 0x0000000B }, /* GL_LINE_STRIP_ADJACENCY_ARB */
- { 18204, 0x00000702 }, /* GL_LINE_TOKEN */
- { 18218, 0x00000B21 }, /* GL_LINE_WIDTH */
- { 18232, 0x00000B23 }, /* GL_LINE_WIDTH_GRANULARITY */
- { 18258, 0x00000B22 }, /* GL_LINE_WIDTH_RANGE */
- { 18278, 0x00008B82 }, /* GL_LINK_STATUS */
- { 18293, 0x00000B32 }, /* GL_LIST_BASE */
- { 18306, 0x00020000 }, /* GL_LIST_BIT */
- { 18318, 0x00000B33 }, /* GL_LIST_INDEX */
- { 18332, 0x00000B30 }, /* GL_LIST_MODE */
- { 18345, 0x00000101 }, /* GL_LOAD */
- { 18353, 0x00000BF1 }, /* GL_LOGIC_OP */
- { 18365, 0x00000BF0 }, /* GL_LOGIC_OP_MODE */
- { 18382, 0x00008252 }, /* GL_LOSE_CONTEXT_ON_RESET_ARB */
- { 18411, 0x00008CA1 }, /* GL_LOWER_LEFT */
- { 18425, 0x00008DF0 }, /* GL_LOW_FLOAT */
- { 18438, 0x00008DF3 }, /* GL_LOW_INT */
- { 18449, 0x00001909 }, /* GL_LUMINANCE */
- { 18462, 0x00008041 }, /* GL_LUMINANCE12 */
- { 18477, 0x00008047 }, /* GL_LUMINANCE12_ALPHA12 */
- { 18500, 0x00008047 }, /* GL_LUMINANCE12_ALPHA12_EXT */
- { 18527, 0x00008046 }, /* GL_LUMINANCE12_ALPHA4 */
- { 18549, 0x00008046 }, /* GL_LUMINANCE12_ALPHA4_EXT */
- { 18575, 0x00008041 }, /* GL_LUMINANCE12_EXT */
- { 18594, 0x00008042 }, /* GL_LUMINANCE16 */
- { 18609, 0x00008D8C }, /* GL_LUMINANCE16I_EXT */
- { 18629, 0x00008D7A }, /* GL_LUMINANCE16UI_EXT */
- { 18650, 0x00008048 }, /* GL_LUMINANCE16_ALPHA16 */
- { 18673, 0x00008048 }, /* GL_LUMINANCE16_ALPHA16_EXT */
- { 18700, 0x00008042 }, /* GL_LUMINANCE16_EXT */
- { 18719, 0x00008D86 }, /* GL_LUMINANCE32I_EXT */
- { 18739, 0x00008D74 }, /* GL_LUMINANCE32UI_EXT */
- { 18760, 0x0000803F }, /* GL_LUMINANCE4 */
- { 18774, 0x00008043 }, /* GL_LUMINANCE4_ALPHA4 */
- { 18795, 0x00008043 }, /* GL_LUMINANCE4_ALPHA4_EXT */
- { 18820, 0x0000803F }, /* GL_LUMINANCE4_EXT */
- { 18838, 0x00008044 }, /* GL_LUMINANCE6_ALPHA2 */
- { 18859, 0x00008044 }, /* GL_LUMINANCE6_ALPHA2_EXT */
- { 18884, 0x00008040 }, /* GL_LUMINANCE8 */
- { 18898, 0x00008D92 }, /* GL_LUMINANCE8I_EXT */
- { 18917, 0x00008D80 }, /* GL_LUMINANCE8UI_EXT */
- { 18937, 0x00008045 }, /* GL_LUMINANCE8_ALPHA8 */
- { 18958, 0x00008045 }, /* GL_LUMINANCE8_ALPHA8_EXT */
- { 18983, 0x00008040 }, /* GL_LUMINANCE8_EXT */
- { 19001, 0x0000190A }, /* GL_LUMINANCE_ALPHA */
- { 19020, 0x00008D8D }, /* GL_LUMINANCE_ALPHA16I_EXT */
- { 19046, 0x00008D7B }, /* GL_LUMINANCE_ALPHA16UI_EXT */
- { 19073, 0x00008D87 }, /* GL_LUMINANCE_ALPHA32I_EXT */
- { 19099, 0x00008D75 }, /* GL_LUMINANCE_ALPHA32UI_EXT */
- { 19126, 0x00008D93 }, /* GL_LUMINANCE_ALPHA8I_EXT */
- { 19151, 0x00008D81 }, /* GL_LUMINANCE_ALPHA8UI_EXT */
- { 19177, 0x00008D9D }, /* GL_LUMINANCE_ALPHA_INTEGER_EXT */
- { 19208, 0x00008D9C }, /* GL_LUMINANCE_INTEGER_EXT */
- { 19233, 0x0000821B }, /* GL_MAJOR_VERSION */
- { 19250, 0x00000D90 }, /* GL_MAP1_COLOR_4 */
- { 19266, 0x00000DD0 }, /* GL_MAP1_GRID_DOMAIN */
- { 19286, 0x00000DD1 }, /* GL_MAP1_GRID_SEGMENTS */
- { 19308, 0x00000D91 }, /* GL_MAP1_INDEX */
- { 19322, 0x00000D92 }, /* GL_MAP1_NORMAL */
- { 19337, 0x00000D93 }, /* GL_MAP1_TEXTURE_COORD_1 */
- { 19361, 0x00000D94 }, /* GL_MAP1_TEXTURE_COORD_2 */
- { 19385, 0x00000D95 }, /* GL_MAP1_TEXTURE_COORD_3 */
- { 19409, 0x00000D96 }, /* GL_MAP1_TEXTURE_COORD_4 */
- { 19433, 0x00000D97 }, /* GL_MAP1_VERTEX_3 */
- { 19450, 0x00000D98 }, /* GL_MAP1_VERTEX_4 */
- { 19467, 0x00008660 }, /* GL_MAP1_VERTEX_ATTRIB0_4_NV */
- { 19495, 0x0000866A }, /* GL_MAP1_VERTEX_ATTRIB10_4_NV */
- { 19524, 0x0000866B }, /* GL_MAP1_VERTEX_ATTRIB11_4_NV */
- { 19553, 0x0000866C }, /* GL_MAP1_VERTEX_ATTRIB12_4_NV */
- { 19582, 0x0000866D }, /* GL_MAP1_VERTEX_ATTRIB13_4_NV */
- { 19611, 0x0000866E }, /* GL_MAP1_VERTEX_ATTRIB14_4_NV */
- { 19640, 0x0000866F }, /* GL_MAP1_VERTEX_ATTRIB15_4_NV */
- { 19669, 0x00008661 }, /* GL_MAP1_VERTEX_ATTRIB1_4_NV */
- { 19697, 0x00008662 }, /* GL_MAP1_VERTEX_ATTRIB2_4_NV */
- { 19725, 0x00008663 }, /* GL_MAP1_VERTEX_ATTRIB3_4_NV */
- { 19753, 0x00008664 }, /* GL_MAP1_VERTEX_ATTRIB4_4_NV */
- { 19781, 0x00008665 }, /* GL_MAP1_VERTEX_ATTRIB5_4_NV */
- { 19809, 0x00008666 }, /* GL_MAP1_VERTEX_ATTRIB6_4_NV */
- { 19837, 0x00008667 }, /* GL_MAP1_VERTEX_ATTRIB7_4_NV */
- { 19865, 0x00008668 }, /* GL_MAP1_VERTEX_ATTRIB8_4_NV */
- { 19893, 0x00008669 }, /* GL_MAP1_VERTEX_ATTRIB9_4_NV */
- { 19921, 0x00000DB0 }, /* GL_MAP2_COLOR_4 */
- { 19937, 0x00000DD2 }, /* GL_MAP2_GRID_DOMAIN */
- { 19957, 0x00000DD3 }, /* GL_MAP2_GRID_SEGMENTS */
- { 19979, 0x00000DB1 }, /* GL_MAP2_INDEX */
- { 19993, 0x00000DB2 }, /* GL_MAP2_NORMAL */
- { 20008, 0x00000DB3 }, /* GL_MAP2_TEXTURE_COORD_1 */
- { 20032, 0x00000DB4 }, /* GL_MAP2_TEXTURE_COORD_2 */
- { 20056, 0x00000DB5 }, /* GL_MAP2_TEXTURE_COORD_3 */
- { 20080, 0x00000DB6 }, /* GL_MAP2_TEXTURE_COORD_4 */
- { 20104, 0x00000DB7 }, /* GL_MAP2_VERTEX_3 */
- { 20121, 0x00000DB8 }, /* GL_MAP2_VERTEX_4 */
- { 20138, 0x00008670 }, /* GL_MAP2_VERTEX_ATTRIB0_4_NV */
- { 20166, 0x0000867A }, /* GL_MAP2_VERTEX_ATTRIB10_4_NV */
- { 20195, 0x0000867B }, /* GL_MAP2_VERTEX_ATTRIB11_4_NV */
- { 20224, 0x0000867C }, /* GL_MAP2_VERTEX_ATTRIB12_4_NV */
- { 20253, 0x0000867D }, /* GL_MAP2_VERTEX_ATTRIB13_4_NV */
- { 20282, 0x0000867E }, /* GL_MAP2_VERTEX_ATTRIB14_4_NV */
- { 20311, 0x0000867F }, /* GL_MAP2_VERTEX_ATTRIB15_4_NV */
- { 20340, 0x00008671 }, /* GL_MAP2_VERTEX_ATTRIB1_4_NV */
- { 20368, 0x00008672 }, /* GL_MAP2_VERTEX_ATTRIB2_4_NV */
- { 20396, 0x00008673 }, /* GL_MAP2_VERTEX_ATTRIB3_4_NV */
- { 20424, 0x00008674 }, /* GL_MAP2_VERTEX_ATTRIB4_4_NV */
- { 20452, 0x00008675 }, /* GL_MAP2_VERTEX_ATTRIB5_4_NV */
- { 20480, 0x00008676 }, /* GL_MAP2_VERTEX_ATTRIB6_4_NV */
- { 20508, 0x00008677 }, /* GL_MAP2_VERTEX_ATTRIB7_4_NV */
- { 20536, 0x00008678 }, /* GL_MAP2_VERTEX_ATTRIB8_4_NV */
- { 20564, 0x00008679 }, /* GL_MAP2_VERTEX_ATTRIB9_4_NV */
- { 20592, 0x00000D10 }, /* GL_MAP_COLOR */
- { 20605, 0x00000010 }, /* GL_MAP_FLUSH_EXPLICIT_BIT */
- { 20631, 0x00000008 }, /* GL_MAP_INVALIDATE_BUFFER_BIT */
- { 20660, 0x00000004 }, /* GL_MAP_INVALIDATE_RANGE_BIT */
- { 20688, 0x00000001 }, /* GL_MAP_READ_BIT */
- { 20704, 0x00000D11 }, /* GL_MAP_STENCIL */
- { 20719, 0x00000020 }, /* GL_MAP_UNSYNCHRONIZED_BIT */
- { 20745, 0x00000002 }, /* GL_MAP_WRITE_BIT */
- { 20762, 0x000088C0 }, /* GL_MATRIX0_ARB */
- { 20777, 0x00008630 }, /* GL_MATRIX0_NV */
- { 20791, 0x000088CA }, /* GL_MATRIX10_ARB */
- { 20807, 0x000088CB }, /* GL_MATRIX11_ARB */
- { 20823, 0x000088CC }, /* GL_MATRIX12_ARB */
- { 20839, 0x000088CD }, /* GL_MATRIX13_ARB */
- { 20855, 0x000088CE }, /* GL_MATRIX14_ARB */
- { 20871, 0x000088CF }, /* GL_MATRIX15_ARB */
- { 20887, 0x000088D0 }, /* GL_MATRIX16_ARB */
- { 20903, 0x000088D1 }, /* GL_MATRIX17_ARB */
- { 20919, 0x000088D2 }, /* GL_MATRIX18_ARB */
- { 20935, 0x000088D3 }, /* GL_MATRIX19_ARB */
- { 20951, 0x000088C1 }, /* GL_MATRIX1_ARB */
- { 20966, 0x00008631 }, /* GL_MATRIX1_NV */
- { 20980, 0x000088D4 }, /* GL_MATRIX20_ARB */
- { 20996, 0x000088D5 }, /* GL_MATRIX21_ARB */
- { 21012, 0x000088D6 }, /* GL_MATRIX22_ARB */
- { 21028, 0x000088D7 }, /* GL_MATRIX23_ARB */
- { 21044, 0x000088D8 }, /* GL_MATRIX24_ARB */
- { 21060, 0x000088D9 }, /* GL_MATRIX25_ARB */
- { 21076, 0x000088DA }, /* GL_MATRIX26_ARB */
- { 21092, 0x000088DB }, /* GL_MATRIX27_ARB */
- { 21108, 0x000088DC }, /* GL_MATRIX28_ARB */
- { 21124, 0x000088DD }, /* GL_MATRIX29_ARB */
- { 21140, 0x000088C2 }, /* GL_MATRIX2_ARB */
- { 21155, 0x00008632 }, /* GL_MATRIX2_NV */
- { 21169, 0x000088DE }, /* GL_MATRIX30_ARB */
- { 21185, 0x000088DF }, /* GL_MATRIX31_ARB */
- { 21201, 0x000088C3 }, /* GL_MATRIX3_ARB */
- { 21216, 0x00008633 }, /* GL_MATRIX3_NV */
- { 21230, 0x000088C4 }, /* GL_MATRIX4_ARB */
- { 21245, 0x00008634 }, /* GL_MATRIX4_NV */
- { 21259, 0x000088C5 }, /* GL_MATRIX5_ARB */
- { 21274, 0x00008635 }, /* GL_MATRIX5_NV */
- { 21288, 0x000088C6 }, /* GL_MATRIX6_ARB */
- { 21303, 0x00008636 }, /* GL_MATRIX6_NV */
- { 21317, 0x000088C7 }, /* GL_MATRIX7_ARB */
- { 21332, 0x00008637 }, /* GL_MATRIX7_NV */
- { 21346, 0x000088C8 }, /* GL_MATRIX8_ARB */
- { 21361, 0x000088C9 }, /* GL_MATRIX9_ARB */
- { 21376, 0x00008844 }, /* GL_MATRIX_INDEX_ARRAY_ARB */
- { 21402, 0x00008B9E }, /* GL_MATRIX_INDEX_ARRAY_BUFFER_BINDING_OES */
- { 21443, 0x00008844 }, /* GL_MATRIX_INDEX_ARRAY_OES */
- { 21469, 0x00008849 }, /* GL_MATRIX_INDEX_ARRAY_POINTER_ARB */
- { 21503, 0x00008849 }, /* GL_MATRIX_INDEX_ARRAY_POINTER_OES */
- { 21537, 0x00008846 }, /* GL_MATRIX_INDEX_ARRAY_SIZE_ARB */
- { 21568, 0x00008846 }, /* GL_MATRIX_INDEX_ARRAY_SIZE_OES */
- { 21599, 0x00008848 }, /* GL_MATRIX_INDEX_ARRAY_STRIDE_ARB */
- { 21632, 0x00008848 }, /* GL_MATRIX_INDEX_ARRAY_STRIDE_OES */
- { 21665, 0x00008847 }, /* GL_MATRIX_INDEX_ARRAY_TYPE_ARB */
- { 21696, 0x00008847 }, /* GL_MATRIX_INDEX_ARRAY_TYPE_OES */
- { 21727, 0x00000BA0 }, /* GL_MATRIX_MODE */
- { 21742, 0x00008840 }, /* GL_MATRIX_PALETTE_ARB */
- { 21764, 0x00008840 }, /* GL_MATRIX_PALETTE_OES */
- { 21786, 0x00008008 }, /* GL_MAX */
- { 21793, 0x00008073 }, /* GL_MAX_3D_TEXTURE_SIZE */
- { 21816, 0x00008073 }, /* GL_MAX_3D_TEXTURE_SIZE_OES */
- { 21843, 0x000088FF }, /* GL_MAX_ARRAY_TEXTURE_LAYERS */
- { 21871, 0x000088FF }, /* GL_MAX_ARRAY_TEXTURE_LAYERS_EXT */
- { 21903, 0x00000D35 }, /* GL_MAX_ATTRIB_STACK_DEPTH */
- { 21929, 0x00000D3B }, /* GL_MAX_CLIENT_ATTRIB_STACK_DEPTH */
- { 21962, 0x00008177 }, /* GL_MAX_CLIPMAP_DEPTH_SGIX */
- { 21988, 0x00008178 }, /* GL_MAX_CLIPMAP_VIRTUAL_DEPTH_SGIX */
- { 22022, 0x00000D32 }, /* GL_MAX_CLIP_DISTANCES */
- { 22044, 0x00000D32 }, /* GL_MAX_CLIP_PLANES */
- { 22063, 0x00008CDF }, /* GL_MAX_COLOR_ATTACHMENTS */
- { 22088, 0x00008CDF }, /* GL_MAX_COLOR_ATTACHMENTS_EXT */
- { 22117, 0x000080B3 }, /* GL_MAX_COLOR_MATRIX_STACK_DEPTH */
- { 22149, 0x000080B3 }, /* GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI */
- { 22185, 0x00008B4D }, /* GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS */
- { 22221, 0x00008B4D }, /* GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB */
- { 22261, 0x0000801B }, /* GL_MAX_CONVOLUTION_HEIGHT */
- { 22287, 0x0000801B }, /* GL_MAX_CONVOLUTION_HEIGHT_EXT */
- { 22317, 0x0000801A }, /* GL_MAX_CONVOLUTION_WIDTH */
- { 22342, 0x0000801A }, /* GL_MAX_CONVOLUTION_WIDTH_EXT */
- { 22371, 0x0000851C }, /* GL_MAX_CUBE_MAP_TEXTURE_SIZE */
- { 22400, 0x0000851C }, /* GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB */
- { 22433, 0x0000851C }, /* GL_MAX_CUBE_MAP_TEXTURE_SIZE_OES */
- { 22466, 0x00008824 }, /* GL_MAX_DRAW_BUFFERS */
- { 22486, 0x00008824 }, /* GL_MAX_DRAW_BUFFERS_ARB */
- { 22510, 0x00008824 }, /* GL_MAX_DRAW_BUFFERS_ATI */
- { 22534, 0x000080E9 }, /* GL_MAX_ELEMENTS_INDICES */
- { 22558, 0x000080E8 }, /* GL_MAX_ELEMENTS_VERTICES */
- { 22583, 0x00000D30 }, /* GL_MAX_EVAL_ORDER */
- { 22601, 0x00008008 }, /* GL_MAX_EXT */
- { 22612, 0x00009125 }, /* GL_MAX_FRAGMENT_INPUT_COMPONENTS */
- { 22645, 0x00008B49 }, /* GL_MAX_FRAGMENT_UNIFORM_COMPONENTS */
- { 22680, 0x00008B49 }, /* GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB */
- { 22719, 0x00008DFD }, /* GL_MAX_FRAGMENT_UNIFORM_VECTORS */
- { 22751, 0x00009123 }, /* GL_MAX_GEOMETRY_INPUT_COMPONENTS */
- { 22784, 0x00009124 }, /* GL_MAX_GEOMETRY_OUTPUT_COMPONENTS */
- { 22818, 0x00008DE0 }, /* GL_MAX_GEOMETRY_OUTPUT_VERTICES */
- { 22850, 0x00008DE0 }, /* GL_MAX_GEOMETRY_OUTPUT_VERTICES_ARB */
- { 22886, 0x00008C29 }, /* GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS */
- { 22922, 0x00008C29 }, /* GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_ARB */
- { 22962, 0x00008DE1 }, /* GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS */
- { 23002, 0x00008DE1 }, /* GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_ARB */
- { 23046, 0x00008DDF }, /* GL_MAX_GEOMETRY_UNIFORM_COMPONENTS */
- { 23081, 0x00008DDF }, /* GL_MAX_GEOMETRY_UNIFORM_COMPONENTS_ARB */
- { 23120, 0x00008DDD }, /* GL_MAX_GEOMETRY_VARYING_COMPONENTS_ARB */
- { 23159, 0x00000D31 }, /* GL_MAX_LIGHTS */
- { 23173, 0x00000B31 }, /* GL_MAX_LIST_NESTING */
- { 23193, 0x00008841 }, /* GL_MAX_MATRIX_PALETTE_STACK_DEPTH_ARB */
- { 23231, 0x00000D36 }, /* GL_MAX_MODELVIEW_STACK_DEPTH */
- { 23260, 0x00000D37 }, /* GL_MAX_NAME_STACK_DEPTH */
- { 23284, 0x00008842 }, /* GL_MAX_PALETTE_MATRICES_ARB */
- { 23312, 0x00008842 }, /* GL_MAX_PALETTE_MATRICES_OES */
- { 23340, 0x00000D34 }, /* GL_MAX_PIXEL_MAP_TABLE */
- { 23363, 0x000088B1 }, /* GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB */
- { 23400, 0x0000880B }, /* GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB */
- { 23436, 0x000088AD }, /* GL_MAX_PROGRAM_ATTRIBS_ARB */
- { 23463, 0x000088F5 }, /* GL_MAX_PROGRAM_CALL_DEPTH_NV */
- { 23492, 0x000088B5 }, /* GL_MAX_PROGRAM_ENV_PARAMETERS_ARB */
- { 23526, 0x000088F4 }, /* GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV */
- { 23562, 0x000088F6 }, /* GL_MAX_PROGRAM_IF_DEPTH_NV */
- { 23589, 0x000088A1 }, /* GL_MAX_PROGRAM_INSTRUCTIONS_ARB */
- { 23621, 0x000088B4 }, /* GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB */
- { 23657, 0x000088F8 }, /* GL_MAX_PROGRAM_LOOP_COUNT_NV */
- { 23686, 0x000088F7 }, /* GL_MAX_PROGRAM_LOOP_DEPTH_NV */
- { 23715, 0x0000862F }, /* GL_MAX_PROGRAM_MATRICES_ARB */
- { 23743, 0x0000862E }, /* GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB */
- { 23781, 0x000088B3 }, /* GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB */
- { 23825, 0x0000880E }, /* GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB */
- { 23868, 0x000088AF }, /* GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB */
- { 23902, 0x000088A3 }, /* GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB */
- { 23941, 0x000088AB }, /* GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB */
- { 23978, 0x000088A7 }, /* GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB */
- { 24016, 0x00008810 }, /* GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB */
- { 24059, 0x0000880F }, /* GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB */
- { 24102, 0x000088A9 }, /* GL_MAX_PROGRAM_PARAMETERS_ARB */
- { 24132, 0x000088A5 }, /* GL_MAX_PROGRAM_TEMPORARIES_ARB */
- { 24163, 0x00008905 }, /* GL_MAX_PROGRAM_TEXEL_OFFSET */
- { 24191, 0x00008905 }, /* GL_MAX_PROGRAM_TEXEL_OFFSET_EXT */
- { 24223, 0x0000880D }, /* GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB */
- { 24259, 0x0000880C }, /* GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB */
- { 24295, 0x00000D38 }, /* GL_MAX_PROJECTION_STACK_DEPTH */
- { 24325, 0x000084F8 }, /* GL_MAX_RECTANGLE_TEXTURE_SIZE */
- { 24355, 0x000084F8 }, /* GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB */
- { 24389, 0x000084F8 }, /* GL_MAX_RECTANGLE_TEXTURE_SIZE_NV */
- { 24422, 0x000084E8 }, /* GL_MAX_RENDERBUFFER_SIZE */
- { 24447, 0x000084E8 }, /* GL_MAX_RENDERBUFFER_SIZE_EXT */
- { 24476, 0x000084E8 }, /* GL_MAX_RENDERBUFFER_SIZE_OES */
- { 24505, 0x00008D57 }, /* GL_MAX_SAMPLES */
- { 24520, 0x00008D57 }, /* GL_MAX_SAMPLES_EXT */
- { 24539, 0x00009111 }, /* GL_MAX_SERVER_WAIT_TIMEOUT */
- { 24566, 0x00008504 }, /* GL_MAX_SHININESS_NV */
- { 24586, 0x00008505 }, /* GL_MAX_SPOT_EXPONENT_NV */
- { 24610, 0x00008C2B }, /* GL_MAX_TEXTURE_BUFFER_SIZE */
- { 24637, 0x00008C2B }, /* GL_MAX_TEXTURE_BUFFER_SIZE_ARB */
- { 24668, 0x00008871 }, /* GL_MAX_TEXTURE_COORDS */
- { 24690, 0x00008871 }, /* GL_MAX_TEXTURE_COORDS_ARB */
- { 24716, 0x00008872 }, /* GL_MAX_TEXTURE_IMAGE_UNITS */
- { 24743, 0x00008872 }, /* GL_MAX_TEXTURE_IMAGE_UNITS_ARB */
- { 24774, 0x000084FD }, /* GL_MAX_TEXTURE_LOD_BIAS */
- { 24798, 0x000084FD }, /* GL_MAX_TEXTURE_LOD_BIAS_EXT */
- { 24826, 0x000084FF }, /* GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT */
- { 24860, 0x00000D33 }, /* GL_MAX_TEXTURE_SIZE */
- { 24880, 0x00000D39 }, /* GL_MAX_TEXTURE_STACK_DEPTH */
- { 24907, 0x000084E2 }, /* GL_MAX_TEXTURE_UNITS */
- { 24928, 0x000084E2 }, /* GL_MAX_TEXTURE_UNITS_ARB */
- { 24953, 0x0000862F }, /* GL_MAX_TRACK_MATRICES_NV */
- { 24978, 0x0000862E }, /* GL_MAX_TRACK_MATRIX_STACK_DEPTH_NV */
- { 25013, 0x00008C8A }, /* GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS */
- { 25062, 0x00008C8A }, /* GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS_EXT */
- { 25115, 0x00008C8B }, /* GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS */
- { 25158, 0x00008C8B }, /* GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS_EXT */
- { 25205, 0x00008C80 }, /* GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS */
- { 25251, 0x00008C80 }, /* GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS_EXT */
- { 25301, 0x00008B4B }, /* GL_MAX_VARYING_COMPONENTS */
- { 25327, 0x00008B4B }, /* GL_MAX_VARYING_FLOATS */
- { 25349, 0x00008B4B }, /* GL_MAX_VARYING_FLOATS_ARB */
- { 25375, 0x00008DFC }, /* GL_MAX_VARYING_VECTORS */
- { 25398, 0x00008869 }, /* GL_MAX_VERTEX_ATTRIBS */
- { 25420, 0x00008869 }, /* GL_MAX_VERTEX_ATTRIBS_ARB */
- { 25446, 0x00009122 }, /* GL_MAX_VERTEX_OUTPUT_COMPONENTS */
- { 25478, 0x00008B4C }, /* GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS */
- { 25512, 0x00008B4C }, /* GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB */
- { 25550, 0x00008B4A }, /* GL_MAX_VERTEX_UNIFORM_COMPONENTS */
- { 25583, 0x00008B4A }, /* GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB */
- { 25620, 0x00008DFB }, /* GL_MAX_VERTEX_UNIFORM_VECTORS */
- { 25650, 0x000086A4 }, /* GL_MAX_VERTEX_UNITS_ARB */
- { 25674, 0x000086A4 }, /* GL_MAX_VERTEX_UNITS_OES */
- { 25698, 0x00008DDE }, /* GL_MAX_VERTEX_VARYING_COMPONENTS_ARB */
- { 25735, 0x00000D3A }, /* GL_MAX_VIEWPORT_DIMS */
- { 25756, 0x00008DF1 }, /* GL_MEDIUM_FLOAT */
- { 25772, 0x00008DF4 }, /* GL_MEDIUM_INT */
- { 25786, 0x00008007 }, /* GL_MIN */
- { 25793, 0x0000802E }, /* GL_MINMAX */
- { 25803, 0x0000802E }, /* GL_MINMAX_EXT */
- { 25817, 0x0000802F }, /* GL_MINMAX_FORMAT */
- { 25834, 0x0000802F }, /* GL_MINMAX_FORMAT_EXT */
- { 25855, 0x00008030 }, /* GL_MINMAX_SINK */
- { 25870, 0x00008030 }, /* GL_MINMAX_SINK_EXT */
- { 25889, 0x0000821C }, /* GL_MINOR_VERSION */
- { 25906, 0x00008007 }, /* GL_MIN_EXT */
- { 25917, 0x00008904 }, /* GL_MIN_PROGRAM_TEXEL_OFFSET */
- { 25945, 0x00008904 }, /* GL_MIN_PROGRAM_TEXEL_OFFSET_EXT */
- { 25977, 0x00008370 }, /* GL_MIRRORED_REPEAT */
- { 25996, 0x00008370 }, /* GL_MIRRORED_REPEAT_ARB */
- { 26019, 0x00008370 }, /* GL_MIRRORED_REPEAT_IBM */
- { 26042, 0x00008742 }, /* GL_MIRROR_CLAMP_ATI */
- { 26062, 0x00008742 }, /* GL_MIRROR_CLAMP_EXT */
- { 26082, 0x00008912 }, /* GL_MIRROR_CLAMP_TO_BORDER_EXT */
- { 26112, 0x00008743 }, /* GL_MIRROR_CLAMP_TO_EDGE_ATI */
- { 26140, 0x00008743 }, /* GL_MIRROR_CLAMP_TO_EDGE_EXT */
- { 26168, 0x00001700 }, /* GL_MODELVIEW */
- { 26181, 0x00001700 }, /* GL_MODELVIEW0_ARB */
- { 26199, 0x0000872A }, /* GL_MODELVIEW10_ARB */
- { 26218, 0x0000872B }, /* GL_MODELVIEW11_ARB */
- { 26237, 0x0000872C }, /* GL_MODELVIEW12_ARB */
- { 26256, 0x0000872D }, /* GL_MODELVIEW13_ARB */
- { 26275, 0x0000872E }, /* GL_MODELVIEW14_ARB */
- { 26294, 0x0000872F }, /* GL_MODELVIEW15_ARB */
- { 26313, 0x00008730 }, /* GL_MODELVIEW16_ARB */
- { 26332, 0x00008731 }, /* GL_MODELVIEW17_ARB */
- { 26351, 0x00008732 }, /* GL_MODELVIEW18_ARB */
- { 26370, 0x00008733 }, /* GL_MODELVIEW19_ARB */
- { 26389, 0x0000850A }, /* GL_MODELVIEW1_ARB */
- { 26407, 0x00008734 }, /* GL_MODELVIEW20_ARB */
- { 26426, 0x00008735 }, /* GL_MODELVIEW21_ARB */
- { 26445, 0x00008736 }, /* GL_MODELVIEW22_ARB */
- { 26464, 0x00008737 }, /* GL_MODELVIEW23_ARB */
- { 26483, 0x00008738 }, /* GL_MODELVIEW24_ARB */
- { 26502, 0x00008739 }, /* GL_MODELVIEW25_ARB */
- { 26521, 0x0000873A }, /* GL_MODELVIEW26_ARB */
- { 26540, 0x0000873B }, /* GL_MODELVIEW27_ARB */
- { 26559, 0x0000873C }, /* GL_MODELVIEW28_ARB */
- { 26578, 0x0000873D }, /* GL_MODELVIEW29_ARB */
- { 26597, 0x00008722 }, /* GL_MODELVIEW2_ARB */
- { 26615, 0x0000873E }, /* GL_MODELVIEW30_ARB */
- { 26634, 0x0000873F }, /* GL_MODELVIEW31_ARB */
- { 26653, 0x00008723 }, /* GL_MODELVIEW3_ARB */
- { 26671, 0x00008724 }, /* GL_MODELVIEW4_ARB */
- { 26689, 0x00008725 }, /* GL_MODELVIEW5_ARB */
- { 26707, 0x00008726 }, /* GL_MODELVIEW6_ARB */
- { 26725, 0x00008727 }, /* GL_MODELVIEW7_ARB */
- { 26743, 0x00008728 }, /* GL_MODELVIEW8_ARB */
- { 26761, 0x00008729 }, /* GL_MODELVIEW9_ARB */
- { 26779, 0x00000BA6 }, /* GL_MODELVIEW_MATRIX */
- { 26799, 0x0000898D }, /* GL_MODELVIEW_MATRIX_FLOAT_AS_INT_BITS_OES */
- { 26841, 0x00008629 }, /* GL_MODELVIEW_PROJECTION_NV */
- { 26868, 0x00000BA3 }, /* GL_MODELVIEW_STACK_DEPTH */
- { 26893, 0x00002100 }, /* GL_MODULATE */
- { 26905, 0x00008744 }, /* GL_MODULATE_ADD_ATI */
- { 26925, 0x00008745 }, /* GL_MODULATE_SIGNED_ADD_ATI */
- { 26952, 0x00008746 }, /* GL_MODULATE_SUBTRACT_ATI */
- { 26977, 0x00000103 }, /* GL_MULT */
- { 26985, 0x0000809D }, /* GL_MULTISAMPLE */
- { 27000, 0x000086B2 }, /* GL_MULTISAMPLE_3DFX */
- { 27020, 0x0000809D }, /* GL_MULTISAMPLE_ARB */
- { 27039, 0x20000000 }, /* GL_MULTISAMPLE_BIT */
- { 27058, 0x20000000 }, /* GL_MULTISAMPLE_BIT_3DFX */
- { 27082, 0x20000000 }, /* GL_MULTISAMPLE_BIT_ARB */
- { 27105, 0x00008534 }, /* GL_MULTISAMPLE_FILTER_HINT_NV */
- { 27135, 0x00002A25 }, /* GL_N3F_V3F */
- { 27146, 0x00000D70 }, /* GL_NAME_STACK_DEPTH */
- { 27166, 0x0000150E }, /* GL_NAND */
- { 27174, 0x00002600 }, /* GL_NEAREST */
- { 27185, 0x0000844E }, /* GL_NEAREST_CLIPMAP_LINEAR_SGIX */
- { 27216, 0x0000844D }, /* GL_NEAREST_CLIPMAP_NEAREST_SGIX */
- { 27248, 0x00002702 }, /* GL_NEAREST_MIPMAP_LINEAR */
- { 27273, 0x00002700 }, /* GL_NEAREST_MIPMAP_NEAREST */
- { 27299, 0x00000200 }, /* GL_NEVER */
- { 27308, 0x00001102 }, /* GL_NICEST */
- { 27318, 0x00000000 }, /* GL_NONE */
- { 27326, 0x00000000 }, /* GL_NONE_OES */
- { 27338, 0x00001505 }, /* GL_NOOP */
- { 27346, 0x00001508 }, /* GL_NOR */
- { 27353, 0x00000BA1 }, /* GL_NORMALIZE */
- { 27366, 0x00008075 }, /* GL_NORMAL_ARRAY */
- { 27382, 0x00008897 }, /* GL_NORMAL_ARRAY_BUFFER_BINDING */
- { 27413, 0x00008897 }, /* GL_NORMAL_ARRAY_BUFFER_BINDING_ARB */
- { 27448, 0x0000808F }, /* GL_NORMAL_ARRAY_POINTER */
- { 27472, 0x0000807F }, /* GL_NORMAL_ARRAY_STRIDE */
- { 27495, 0x0000807E }, /* GL_NORMAL_ARRAY_TYPE */
- { 27516, 0x00008511 }, /* GL_NORMAL_MAP */
- { 27530, 0x00008511 }, /* GL_NORMAL_MAP_ARB */
- { 27548, 0x00008511 }, /* GL_NORMAL_MAP_NV */
- { 27565, 0x00008511 }, /* GL_NORMAL_MAP_OES */
- { 27583, 0x00000205 }, /* GL_NOTEQUAL */
- { 27595, 0x00000000 }, /* GL_NO_ERROR */
- { 27607, 0x00008261 }, /* GL_NO_RESET_NOTIFICATION_ARB */
- { 27636, 0x000086A2 }, /* GL_NUM_COMPRESSED_TEXTURE_FORMATS */
- { 27670, 0x000086A2 }, /* GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB */
- { 27708, 0x0000821D }, /* GL_NUM_EXTENSIONS */
- { 27726, 0x000087FE }, /* GL_NUM_PROGRAM_BINARY_FORMATS_OES */
- { 27760, 0x00008DF9 }, /* GL_NUM_SHADER_BINARY_FORMATS */
- { 27789, 0x00008B89 }, /* GL_OBJECT_ACTIVE_ATTRIBUTES_ARB */
- { 27821, 0x00008B8A }, /* GL_OBJECT_ACTIVE_ATTRIBUTE_MAX_LENGTH_ARB */
- { 27863, 0x00008B86 }, /* GL_OBJECT_ACTIVE_UNIFORMS_ARB */
- { 27893, 0x00008B87 }, /* GL_OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB */
- { 27933, 0x00008B85 }, /* GL_OBJECT_ATTACHED_OBJECTS_ARB */
- { 27964, 0x00008B81 }, /* GL_OBJECT_COMPILE_STATUS_ARB */
- { 27993, 0x00008B80 }, /* GL_OBJECT_DELETE_STATUS_ARB */
- { 28021, 0x00008B84 }, /* GL_OBJECT_INFO_LOG_LENGTH_ARB */
- { 28051, 0x00002401 }, /* GL_OBJECT_LINEAR */
- { 28068, 0x00008B82 }, /* GL_OBJECT_LINK_STATUS_ARB */
- { 28094, 0x00002501 }, /* GL_OBJECT_PLANE */
- { 28110, 0x00008B88 }, /* GL_OBJECT_SHADER_SOURCE_LENGTH_ARB */
- { 28145, 0x00008B4F }, /* GL_OBJECT_SUBTYPE_ARB */
- { 28167, 0x00009112 }, /* GL_OBJECT_TYPE */
- { 28182, 0x00008B4E }, /* GL_OBJECT_TYPE_ARB */
- { 28201, 0x00008B83 }, /* GL_OBJECT_VALIDATE_STATUS_ARB */
- { 28231, 0x00008165 }, /* GL_OCCLUSION_TEST_HP */
- { 28252, 0x00008166 }, /* GL_OCCLUSION_TEST_RESULT_HP */
- { 28280, 0x00000001 }, /* GL_ONE */
- { 28287, 0x00008004 }, /* GL_ONE_MINUS_CONSTANT_ALPHA */
- { 28315, 0x00008004 }, /* GL_ONE_MINUS_CONSTANT_ALPHA_EXT */
- { 28347, 0x00008002 }, /* GL_ONE_MINUS_CONSTANT_COLOR */
- { 28375, 0x00008002 }, /* GL_ONE_MINUS_CONSTANT_COLOR_EXT */
- { 28407, 0x00000305 }, /* GL_ONE_MINUS_DST_ALPHA */
- { 28430, 0x00000307 }, /* GL_ONE_MINUS_DST_COLOR */
- { 28453, 0x00000303 }, /* GL_ONE_MINUS_SRC_ALPHA */
- { 28476, 0x00000301 }, /* GL_ONE_MINUS_SRC_COLOR */
- { 28499, 0x00008598 }, /* GL_OPERAND0_ALPHA */
- { 28517, 0x00008598 }, /* GL_OPERAND0_ALPHA_ARB */
- { 28539, 0x00008598 }, /* GL_OPERAND0_ALPHA_EXT */
- { 28561, 0x00008590 }, /* GL_OPERAND0_RGB */
- { 28577, 0x00008590 }, /* GL_OPERAND0_RGB_ARB */
- { 28597, 0x00008590 }, /* GL_OPERAND0_RGB_EXT */
- { 28617, 0x00008599 }, /* GL_OPERAND1_ALPHA */
- { 28635, 0x00008599 }, /* GL_OPERAND1_ALPHA_ARB */
- { 28657, 0x00008599 }, /* GL_OPERAND1_ALPHA_EXT */
- { 28679, 0x00008591 }, /* GL_OPERAND1_RGB */
- { 28695, 0x00008591 }, /* GL_OPERAND1_RGB_ARB */
- { 28715, 0x00008591 }, /* GL_OPERAND1_RGB_EXT */
- { 28735, 0x0000859A }, /* GL_OPERAND2_ALPHA */
- { 28753, 0x0000859A }, /* GL_OPERAND2_ALPHA_ARB */
- { 28775, 0x0000859A }, /* GL_OPERAND2_ALPHA_EXT */
- { 28797, 0x00008592 }, /* GL_OPERAND2_RGB */
- { 28813, 0x00008592 }, /* GL_OPERAND2_RGB_ARB */
- { 28833, 0x00008592 }, /* GL_OPERAND2_RGB_EXT */
- { 28853, 0x0000859B }, /* GL_OPERAND3_ALPHA_NV */
- { 28874, 0x00008593 }, /* GL_OPERAND3_RGB_NV */
- { 28893, 0x00001507 }, /* GL_OR */
- { 28899, 0x00000A01 }, /* GL_ORDER */
- { 28908, 0x0000150D }, /* GL_OR_INVERTED */
- { 28923, 0x0000150B }, /* GL_OR_REVERSE */
- { 28937, 0x00000505 }, /* GL_OUT_OF_MEMORY */
- { 28954, 0x00000D05 }, /* GL_PACK_ALIGNMENT */
- { 28972, 0x0000806C }, /* GL_PACK_IMAGE_HEIGHT */
- { 28993, 0x00008758 }, /* GL_PACK_INVERT_MESA */
- { 29013, 0x00000D01 }, /* GL_PACK_LSB_FIRST */
- { 29031, 0x00000D02 }, /* GL_PACK_ROW_LENGTH */
- { 29050, 0x0000806B }, /* GL_PACK_SKIP_IMAGES */
- { 29070, 0x00000D04 }, /* GL_PACK_SKIP_PIXELS */
- { 29090, 0x00000D03 }, /* GL_PACK_SKIP_ROWS */
- { 29108, 0x00000D00 }, /* GL_PACK_SWAP_BYTES */
- { 29127, 0x00008B92 }, /* GL_PALETTE4_R5_G6_B5_OES */
- { 29152, 0x00008B94 }, /* GL_PALETTE4_RGB5_A1_OES */
- { 29176, 0x00008B90 }, /* GL_PALETTE4_RGB8_OES */
- { 29197, 0x00008B93 }, /* GL_PALETTE4_RGBA4_OES */
- { 29219, 0x00008B91 }, /* GL_PALETTE4_RGBA8_OES */
- { 29241, 0x00008B97 }, /* GL_PALETTE8_R5_G6_B5_OES */
- { 29266, 0x00008B99 }, /* GL_PALETTE8_RGB5_A1_OES */
- { 29290, 0x00008B95 }, /* GL_PALETTE8_RGB8_OES */
- { 29311, 0x00008B98 }, /* GL_PALETTE8_RGBA4_OES */
- { 29333, 0x00008B96 }, /* GL_PALETTE8_RGBA8_OES */
- { 29355, 0x00000700 }, /* GL_PASS_THROUGH_TOKEN */
- { 29377, 0x00000C50 }, /* GL_PERSPECTIVE_CORRECTION_HINT */
- { 29408, 0x00000C79 }, /* GL_PIXEL_MAP_A_TO_A */
- { 29428, 0x00000CB9 }, /* GL_PIXEL_MAP_A_TO_A_SIZE */
- { 29453, 0x00000C78 }, /* GL_PIXEL_MAP_B_TO_B */
- { 29473, 0x00000CB8 }, /* GL_PIXEL_MAP_B_TO_B_SIZE */
- { 29498, 0x00000C77 }, /* GL_PIXEL_MAP_G_TO_G */
- { 29518, 0x00000CB7 }, /* GL_PIXEL_MAP_G_TO_G_SIZE */
- { 29543, 0x00000C75 }, /* GL_PIXEL_MAP_I_TO_A */
- { 29563, 0x00000CB5 }, /* GL_PIXEL_MAP_I_TO_A_SIZE */
- { 29588, 0x00000C74 }, /* GL_PIXEL_MAP_I_TO_B */
- { 29608, 0x00000CB4 }, /* GL_PIXEL_MAP_I_TO_B_SIZE */
- { 29633, 0x00000C73 }, /* GL_PIXEL_MAP_I_TO_G */
- { 29653, 0x00000CB3 }, /* GL_PIXEL_MAP_I_TO_G_SIZE */
- { 29678, 0x00000C70 }, /* GL_PIXEL_MAP_I_TO_I */
- { 29698, 0x00000CB0 }, /* GL_PIXEL_MAP_I_TO_I_SIZE */
- { 29723, 0x00000C72 }, /* GL_PIXEL_MAP_I_TO_R */
- { 29743, 0x00000CB2 }, /* GL_PIXEL_MAP_I_TO_R_SIZE */
- { 29768, 0x00000C76 }, /* GL_PIXEL_MAP_R_TO_R */
- { 29788, 0x00000CB6 }, /* GL_PIXEL_MAP_R_TO_R_SIZE */
- { 29813, 0x00000C71 }, /* GL_PIXEL_MAP_S_TO_S */
- { 29833, 0x00000CB1 }, /* GL_PIXEL_MAP_S_TO_S_SIZE */
- { 29858, 0x00000020 }, /* GL_PIXEL_MODE_BIT */
- { 29876, 0x000088EB }, /* GL_PIXEL_PACK_BUFFER */
- { 29897, 0x000088ED }, /* GL_PIXEL_PACK_BUFFER_BINDING */
- { 29926, 0x000088ED }, /* GL_PIXEL_PACK_BUFFER_BINDING_EXT */
- { 29959, 0x000088EB }, /* GL_PIXEL_PACK_BUFFER_EXT */
- { 29984, 0x000088EC }, /* GL_PIXEL_UNPACK_BUFFER */
- { 30007, 0x000088EF }, /* GL_PIXEL_UNPACK_BUFFER_BINDING */
- { 30038, 0x000088EF }, /* GL_PIXEL_UNPACK_BUFFER_BINDING_EXT */
- { 30073, 0x000088EC }, /* GL_PIXEL_UNPACK_BUFFER_EXT */
- { 30100, 0x00001B00 }, /* GL_POINT */
- { 30109, 0x00000000 }, /* GL_POINTS */
- { 30119, 0x00000002 }, /* GL_POINT_BIT */
- { 30132, 0x00008129 }, /* GL_POINT_DISTANCE_ATTENUATION */
- { 30162, 0x00008129 }, /* GL_POINT_DISTANCE_ATTENUATION_ARB */
- { 30196, 0x00008129 }, /* GL_POINT_DISTANCE_ATTENUATION_EXT */
- { 30230, 0x00008129 }, /* GL_POINT_DISTANCE_ATTENUATION_SGIS */
- { 30265, 0x00008128 }, /* GL_POINT_FADE_THRESHOLD_SIZE */
- { 30294, 0x00008128 }, /* GL_POINT_FADE_THRESHOLD_SIZE_ARB */
- { 30327, 0x00008128 }, /* GL_POINT_FADE_THRESHOLD_SIZE_EXT */
- { 30360, 0x00008128 }, /* GL_POINT_FADE_THRESHOLD_SIZE_SGIS */
- { 30394, 0x00000B11 }, /* GL_POINT_SIZE */
- { 30408, 0x00008B9F }, /* GL_POINT_SIZE_ARRAY_BUFFER_BINDING_OES */
- { 30447, 0x00008B9C }, /* GL_POINT_SIZE_ARRAY_OES */
- { 30471, 0x0000898C }, /* GL_POINT_SIZE_ARRAY_POINTER_OES */
- { 30503, 0x0000898B }, /* GL_POINT_SIZE_ARRAY_STRIDE_OES */
- { 30534, 0x0000898A }, /* GL_POINT_SIZE_ARRAY_TYPE_OES */
- { 30563, 0x00000B13 }, /* GL_POINT_SIZE_GRANULARITY */
- { 30589, 0x00008127 }, /* GL_POINT_SIZE_MAX */
- { 30607, 0x00008127 }, /* GL_POINT_SIZE_MAX_ARB */
- { 30629, 0x00008127 }, /* GL_POINT_SIZE_MAX_EXT */
- { 30651, 0x00008127 }, /* GL_POINT_SIZE_MAX_SGIS */
- { 30674, 0x00008126 }, /* GL_POINT_SIZE_MIN */
- { 30692, 0x00008126 }, /* GL_POINT_SIZE_MIN_ARB */
- { 30714, 0x00008126 }, /* GL_POINT_SIZE_MIN_EXT */
- { 30736, 0x00008126 }, /* GL_POINT_SIZE_MIN_SGIS */
- { 30759, 0x00000B12 }, /* GL_POINT_SIZE_RANGE */
- { 30779, 0x00000B10 }, /* GL_POINT_SMOOTH */
- { 30795, 0x00000C51 }, /* GL_POINT_SMOOTH_HINT */
- { 30816, 0x00008861 }, /* GL_POINT_SPRITE */
- { 30832, 0x00008861 }, /* GL_POINT_SPRITE_ARB */
- { 30852, 0x00008CA0 }, /* GL_POINT_SPRITE_COORD_ORIGIN */
- { 30881, 0x00008861 }, /* GL_POINT_SPRITE_NV */
- { 30900, 0x00008861 }, /* GL_POINT_SPRITE_OES */
- { 30920, 0x00008863 }, /* GL_POINT_SPRITE_R_MODE_NV */
- { 30946, 0x00000701 }, /* GL_POINT_TOKEN */
- { 30961, 0x00000009 }, /* GL_POLYGON */
- { 30972, 0x00000008 }, /* GL_POLYGON_BIT */
- { 30987, 0x00000B40 }, /* GL_POLYGON_MODE */
- { 31003, 0x00008039 }, /* GL_POLYGON_OFFSET_BIAS */
- { 31026, 0x00008038 }, /* GL_POLYGON_OFFSET_FACTOR */
- { 31051, 0x00008037 }, /* GL_POLYGON_OFFSET_FILL */
- { 31074, 0x00002A02 }, /* GL_POLYGON_OFFSET_LINE */
- { 31097, 0x00002A01 }, /* GL_POLYGON_OFFSET_POINT */
- { 31121, 0x00002A00 }, /* GL_POLYGON_OFFSET_UNITS */
- { 31145, 0x00000B41 }, /* GL_POLYGON_SMOOTH */
- { 31163, 0x00000C53 }, /* GL_POLYGON_SMOOTH_HINT */
- { 31186, 0x00000B42 }, /* GL_POLYGON_STIPPLE */
- { 31205, 0x00000010 }, /* GL_POLYGON_STIPPLE_BIT */
- { 31228, 0x00000703 }, /* GL_POLYGON_TOKEN */
- { 31245, 0x00001203 }, /* GL_POSITION */
- { 31257, 0x000080BB }, /* GL_POST_COLOR_MATRIX_ALPHA_BIAS */
- { 31289, 0x000080BB }, /* GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI */
- { 31325, 0x000080B7 }, /* GL_POST_COLOR_MATRIX_ALPHA_SCALE */
- { 31358, 0x000080B7 }, /* GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI */
- { 31395, 0x000080BA }, /* GL_POST_COLOR_MATRIX_BLUE_BIAS */
- { 31426, 0x000080BA }, /* GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI */
- { 31461, 0x000080B6 }, /* GL_POST_COLOR_MATRIX_BLUE_SCALE */
- { 31493, 0x000080B6 }, /* GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI */
- { 31529, 0x000080D2 }, /* GL_POST_COLOR_MATRIX_COLOR_TABLE */
- { 31562, 0x000080B9 }, /* GL_POST_COLOR_MATRIX_GREEN_BIAS */
- { 31594, 0x000080B9 }, /* GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI */
- { 31630, 0x000080B5 }, /* GL_POST_COLOR_MATRIX_GREEN_SCALE */
- { 31663, 0x000080B5 }, /* GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI */
- { 31700, 0x000080B8 }, /* GL_POST_COLOR_MATRIX_RED_BIAS */
- { 31730, 0x000080B8 }, /* GL_POST_COLOR_MATRIX_RED_BIAS_SGI */
- { 31764, 0x000080B4 }, /* GL_POST_COLOR_MATRIX_RED_SCALE */
- { 31795, 0x000080B4 }, /* GL_POST_COLOR_MATRIX_RED_SCALE_SGI */
- { 31830, 0x00008023 }, /* GL_POST_CONVOLUTION_ALPHA_BIAS */
- { 31861, 0x00008023 }, /* GL_POST_CONVOLUTION_ALPHA_BIAS_EXT */
- { 31896, 0x0000801F }, /* GL_POST_CONVOLUTION_ALPHA_SCALE */
- { 31928, 0x0000801F }, /* GL_POST_CONVOLUTION_ALPHA_SCALE_EXT */
- { 31964, 0x00008022 }, /* GL_POST_CONVOLUTION_BLUE_BIAS */
- { 31994, 0x00008022 }, /* GL_POST_CONVOLUTION_BLUE_BIAS_EXT */
- { 32028, 0x0000801E }, /* GL_POST_CONVOLUTION_BLUE_SCALE */
- { 32059, 0x0000801E }, /* GL_POST_CONVOLUTION_BLUE_SCALE_EXT */
- { 32094, 0x000080D1 }, /* GL_POST_CONVOLUTION_COLOR_TABLE */
- { 32126, 0x00008021 }, /* GL_POST_CONVOLUTION_GREEN_BIAS */
- { 32157, 0x00008021 }, /* GL_POST_CONVOLUTION_GREEN_BIAS_EXT */
- { 32192, 0x0000801D }, /* GL_POST_CONVOLUTION_GREEN_SCALE */
- { 32224, 0x0000801D }, /* GL_POST_CONVOLUTION_GREEN_SCALE_EXT */
- { 32260, 0x00008020 }, /* GL_POST_CONVOLUTION_RED_BIAS */
- { 32289, 0x00008020 }, /* GL_POST_CONVOLUTION_RED_BIAS_EXT */
- { 32322, 0x0000801C }, /* GL_POST_CONVOLUTION_RED_SCALE */
- { 32352, 0x0000801C }, /* GL_POST_CONVOLUTION_RED_SCALE_EXT */
- { 32386, 0x0000817B }, /* GL_POST_TEXTURE_FILTER_BIAS_RANGE_SGIX */
- { 32425, 0x00008179 }, /* GL_POST_TEXTURE_FILTER_BIAS_SGIX */
- { 32458, 0x0000817C }, /* GL_POST_TEXTURE_FILTER_SCALE_RANGE_SGIX */
- { 32498, 0x0000817A }, /* GL_POST_TEXTURE_FILTER_SCALE_SGIX */
- { 32532, 0x00008578 }, /* GL_PREVIOUS */
- { 32544, 0x00008578 }, /* GL_PREVIOUS_ARB */
- { 32560, 0x00008578 }, /* GL_PREVIOUS_EXT */
- { 32576, 0x00008577 }, /* GL_PRIMARY_COLOR */
- { 32593, 0x00008577 }, /* GL_PRIMARY_COLOR_ARB */
- { 32614, 0x00008577 }, /* GL_PRIMARY_COLOR_EXT */
- { 32635, 0x00008C87 }, /* GL_PRIMITIVES_GENERATED */
- { 32659, 0x00008C87 }, /* GL_PRIMITIVES_GENERATED_EXT */
- { 32687, 0x00008F9D }, /* GL_PRIMITIVE_RESTART */
- { 32708, 0x00008F9E }, /* GL_PRIMITIVE_RESTART_INDEX */
- { 32735, 0x00008559 }, /* GL_PRIMITIVE_RESTART_INDEX_NV */
- { 32765, 0x00008558 }, /* GL_PRIMITIVE_RESTART_NV */
- { 32789, 0x000088B0 }, /* GL_PROGRAM_ADDRESS_REGISTERS_ARB */
- { 32822, 0x00008805 }, /* GL_PROGRAM_ALU_INSTRUCTIONS_ARB */
- { 32854, 0x000088AC }, /* GL_PROGRAM_ATTRIBS_ARB */
- { 32877, 0x000087FF }, /* GL_PROGRAM_BINARY_FORMATS_OES */
- { 32907, 0x00008741 }, /* GL_PROGRAM_BINARY_LENGTH_OES */
- { 32936, 0x00008677 }, /* GL_PROGRAM_BINDING_ARB */
- { 32959, 0x0000864B }, /* GL_PROGRAM_ERROR_POSITION_ARB */
- { 32989, 0x0000864B }, /* GL_PROGRAM_ERROR_POSITION_NV */
- { 33018, 0x00008874 }, /* GL_PROGRAM_ERROR_STRING_ARB */
- { 33046, 0x00008876 }, /* GL_PROGRAM_FORMAT_ARB */
- { 33068, 0x00008875 }, /* GL_PROGRAM_FORMAT_ASCII_ARB */
- { 33096, 0x000088A0 }, /* GL_PROGRAM_INSTRUCTIONS_ARB */
- { 33124, 0x00008627 }, /* GL_PROGRAM_LENGTH_ARB */
- { 33146, 0x00008627 }, /* GL_PROGRAM_LENGTH_NV */
- { 33167, 0x000088B2 }, /* GL_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB */
- { 33207, 0x00008808 }, /* GL_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB */
- { 33246, 0x000088AE }, /* GL_PROGRAM_NATIVE_ATTRIBS_ARB */
- { 33276, 0x000088A2 }, /* GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB */
- { 33311, 0x000088AA }, /* GL_PROGRAM_NATIVE_PARAMETERS_ARB */
- { 33344, 0x000088A6 }, /* GL_PROGRAM_NATIVE_TEMPORARIES_ARB */
- { 33378, 0x0000880A }, /* GL_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB */
- { 33417, 0x00008809 }, /* GL_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB */
- { 33456, 0x00008B40 }, /* GL_PROGRAM_OBJECT_ARB */
- { 33478, 0x000088A8 }, /* GL_PROGRAM_PARAMETERS_ARB */
- { 33504, 0x00008644 }, /* GL_PROGRAM_PARAMETER_NV */
- { 33528, 0x00008642 }, /* GL_PROGRAM_POINT_SIZE */
- { 33550, 0x00008642 }, /* GL_PROGRAM_POINT_SIZE_ARB */
- { 33576, 0x00008647 }, /* GL_PROGRAM_RESIDENT_NV */
- { 33599, 0x00008628 }, /* GL_PROGRAM_STRING_ARB */
- { 33621, 0x00008628 }, /* GL_PROGRAM_STRING_NV */
- { 33642, 0x00008646 }, /* GL_PROGRAM_TARGET_NV */
- { 33663, 0x000088A4 }, /* GL_PROGRAM_TEMPORARIES_ARB */
- { 33690, 0x00008807 }, /* GL_PROGRAM_TEX_INDIRECTIONS_ARB */
- { 33722, 0x00008806 }, /* GL_PROGRAM_TEX_INSTRUCTIONS_ARB */
- { 33754, 0x000088B6 }, /* GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB */
- { 33789, 0x00001701 }, /* GL_PROJECTION */
- { 33803, 0x00000BA7 }, /* GL_PROJECTION_MATRIX */
- { 33824, 0x0000898E }, /* GL_PROJECTION_MATRIX_FLOAT_AS_INT_BITS_OES */
- { 33867, 0x00000BA4 }, /* GL_PROJECTION_STACK_DEPTH */
- { 33893, 0x00008E4F }, /* GL_PROVOKING_VERTEX */
- { 33913, 0x00008E4F }, /* GL_PROVOKING_VERTEX_EXT */
- { 33937, 0x000080D3 }, /* GL_PROXY_COLOR_TABLE */
- { 33958, 0x00008025 }, /* GL_PROXY_HISTOGRAM */
- { 33977, 0x00008025 }, /* GL_PROXY_HISTOGRAM_EXT */
- { 34000, 0x000080D5 }, /* GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE */
- { 34039, 0x000080D4 }, /* GL_PROXY_POST_CONVOLUTION_COLOR_TABLE */
- { 34077, 0x00008063 }, /* GL_PROXY_TEXTURE_1D */
- { 34097, 0x00008C19 }, /* GL_PROXY_TEXTURE_1D_ARRAY */
- { 34123, 0x00008C19 }, /* GL_PROXY_TEXTURE_1D_ARRAY_EXT */
- { 34153, 0x00008063 }, /* GL_PROXY_TEXTURE_1D_EXT */
- { 34177, 0x00008064 }, /* GL_PROXY_TEXTURE_2D */
- { 34197, 0x00008C1B }, /* GL_PROXY_TEXTURE_2D_ARRAY */
- { 34223, 0x00008C1B }, /* GL_PROXY_TEXTURE_2D_ARRAY_EXT */
- { 34253, 0x00008064 }, /* GL_PROXY_TEXTURE_2D_EXT */
- { 34277, 0x00008070 }, /* GL_PROXY_TEXTURE_3D */
- { 34297, 0x000080BD }, /* GL_PROXY_TEXTURE_COLOR_TABLE_SGI */
- { 34330, 0x0000851B }, /* GL_PROXY_TEXTURE_CUBE_MAP */
- { 34356, 0x0000851B }, /* GL_PROXY_TEXTURE_CUBE_MAP_ARB */
- { 34386, 0x000084F7 }, /* GL_PROXY_TEXTURE_RECTANGLE */
- { 34413, 0x000084F7 }, /* GL_PROXY_TEXTURE_RECTANGLE_ARB */
- { 34444, 0x000084F7 }, /* GL_PROXY_TEXTURE_RECTANGLE_NV */
- { 34474, 0x00008A1D }, /* GL_PURGEABLE_APPLE */
- { 34493, 0x00002003 }, /* GL_Q */
- { 34498, 0x00001209 }, /* GL_QUADRATIC_ATTENUATION */
- { 34523, 0x00000007 }, /* GL_QUADS */
- { 34532, 0x00008E4C }, /* GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION */
- { 34576, 0x00008E4C }, /* GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION_EXT */
- { 34624, 0x00008614 }, /* GL_QUAD_MESH_SUN */
- { 34641, 0x00000008 }, /* GL_QUAD_STRIP */
- { 34655, 0x00008E16 }, /* GL_QUERY_BY_REGION_NO_WAIT */
- { 34682, 0x00008E16 }, /* GL_QUERY_BY_REGION_NO_WAIT_NV */
- { 34712, 0x00008E15 }, /* GL_QUERY_BY_REGION_WAIT */
- { 34736, 0x00008E15 }, /* GL_QUERY_BY_REGION_WAIT_NV */
- { 34763, 0x00008864 }, /* GL_QUERY_COUNTER_BITS */
- { 34785, 0x00008864 }, /* GL_QUERY_COUNTER_BITS_ARB */
- { 34811, 0x00008E14 }, /* GL_QUERY_NO_WAIT */
- { 34828, 0x00008E14 }, /* GL_QUERY_NO_WAIT_NV */
- { 34848, 0x00008866 }, /* GL_QUERY_RESULT */
- { 34864, 0x00008866 }, /* GL_QUERY_RESULT_ARB */
- { 34884, 0x00008867 }, /* GL_QUERY_RESULT_AVAILABLE */
- { 34910, 0x00008867 }, /* GL_QUERY_RESULT_AVAILABLE_ARB */
- { 34940, 0x00008E13 }, /* GL_QUERY_WAIT */
- { 34954, 0x00008E13 }, /* GL_QUERY_WAIT_NV */
- { 34971, 0x00002002 }, /* GL_R */
- { 34976, 0x00008C3A }, /* GL_R11F_G11F_B10F */
- { 34994, 0x00008F98 }, /* GL_R16_SNORM */
- { 35007, 0x00002A10 }, /* GL_R3_G3_B2 */
- { 35019, 0x00008F94 }, /* GL_R8_SNORM */
- { 35031, 0x00008C89 }, /* GL_RASTERIZER_DISCARD */
- { 35053, 0x00008C89 }, /* GL_RASTERIZER_DISCARD_EXT */
- { 35079, 0x00019262 }, /* GL_RASTER_POSITION_UNCLIPPED_IBM */
- { 35112, 0x00000C02 }, /* GL_READ_BUFFER */
- { 35127, 0x00008CA8 }, /* GL_READ_FRAMEBUFFER */
- { 35147, 0x00008CAA }, /* GL_READ_FRAMEBUFFER_BINDING */
- { 35175, 0x00008CAA }, /* GL_READ_FRAMEBUFFER_BINDING_EXT */
- { 35207, 0x00008CA8 }, /* GL_READ_FRAMEBUFFER_EXT */
- { 35231, 0x000088B8 }, /* GL_READ_ONLY */
- { 35244, 0x000088B8 }, /* GL_READ_ONLY_ARB */
- { 35261, 0x000088BA }, /* GL_READ_WRITE */
- { 35275, 0x000088BA }, /* GL_READ_WRITE_ARB */
- { 35293, 0x00001903 }, /* GL_RED */
- { 35300, 0x00008016 }, /* GL_REDUCE */
- { 35310, 0x00008016 }, /* GL_REDUCE_EXT */
- { 35324, 0x00000D15 }, /* GL_RED_BIAS */
- { 35336, 0x00000D52 }, /* GL_RED_BITS */
- { 35348, 0x00008D94 }, /* GL_RED_INTEGER */
- { 35363, 0x00008D94 }, /* GL_RED_INTEGER_EXT */
- { 35382, 0x00000D14 }, /* GL_RED_SCALE */
- { 35395, 0x00008F90 }, /* GL_RED_SNORM */
- { 35408, 0x00008512 }, /* GL_REFLECTION_MAP */
- { 35426, 0x00008512 }, /* GL_REFLECTION_MAP_ARB */
- { 35448, 0x00008512 }, /* GL_REFLECTION_MAP_NV */
- { 35469, 0x00008512 }, /* GL_REFLECTION_MAP_OES */
- { 35491, 0x00008A19 }, /* GL_RELEASED_APPLE */
- { 35509, 0x00001C00 }, /* GL_RENDER */
- { 35519, 0x00008D41 }, /* GL_RENDERBUFFER */
- { 35535, 0x00008D53 }, /* GL_RENDERBUFFER_ALPHA_SIZE */
- { 35562, 0x00008D53 }, /* GL_RENDERBUFFER_ALPHA_SIZE_OES */
- { 35593, 0x00008CA7 }, /* GL_RENDERBUFFER_BINDING */
- { 35617, 0x00008CA7 }, /* GL_RENDERBUFFER_BINDING_EXT */
- { 35645, 0x00008CA7 }, /* GL_RENDERBUFFER_BINDING_OES */
- { 35673, 0x00008D52 }, /* GL_RENDERBUFFER_BLUE_SIZE */
- { 35699, 0x00008D52 }, /* GL_RENDERBUFFER_BLUE_SIZE_OES */
- { 35729, 0x00008D54 }, /* GL_RENDERBUFFER_DEPTH_SIZE */
- { 35756, 0x00008D54 }, /* GL_RENDERBUFFER_DEPTH_SIZE_OES */
- { 35787, 0x00008D41 }, /* GL_RENDERBUFFER_EXT */
- { 35807, 0x00008D51 }, /* GL_RENDERBUFFER_GREEN_SIZE */
- { 35834, 0x00008D51 }, /* GL_RENDERBUFFER_GREEN_SIZE_OES */
- { 35865, 0x00008D43 }, /* GL_RENDERBUFFER_HEIGHT */
- { 35888, 0x00008D43 }, /* GL_RENDERBUFFER_HEIGHT_EXT */
- { 35915, 0x00008D43 }, /* GL_RENDERBUFFER_HEIGHT_OES */
- { 35942, 0x00008D44 }, /* GL_RENDERBUFFER_INTERNAL_FORMAT */
- { 35974, 0x00008D44 }, /* GL_RENDERBUFFER_INTERNAL_FORMAT_EXT */
- { 36010, 0x00008D44 }, /* GL_RENDERBUFFER_INTERNAL_FORMAT_OES */
- { 36046, 0x00008D41 }, /* GL_RENDERBUFFER_OES */
- { 36066, 0x00008D50 }, /* GL_RENDERBUFFER_RED_SIZE */
- { 36091, 0x00008D50 }, /* GL_RENDERBUFFER_RED_SIZE_OES */
- { 36120, 0x00008CAB }, /* GL_RENDERBUFFER_SAMPLES */
- { 36144, 0x00008CAB }, /* GL_RENDERBUFFER_SAMPLES_EXT */
- { 36172, 0x00008D55 }, /* GL_RENDERBUFFER_STENCIL_SIZE */
- { 36201, 0x00008D55 }, /* GL_RENDERBUFFER_STENCIL_SIZE_OES */
- { 36234, 0x00008D42 }, /* GL_RENDERBUFFER_WIDTH */
- { 36256, 0x00008D42 }, /* GL_RENDERBUFFER_WIDTH_EXT */
- { 36282, 0x00008D42 }, /* GL_RENDERBUFFER_WIDTH_OES */
- { 36308, 0x00001F01 }, /* GL_RENDERER */
- { 36320, 0x00000C40 }, /* GL_RENDER_MODE */
- { 36335, 0x00002901 }, /* GL_REPEAT */
- { 36345, 0x00001E01 }, /* GL_REPLACE */
- { 36356, 0x00008062 }, /* GL_REPLACE_EXT */
- { 36371, 0x00008153 }, /* GL_REPLICATE_BORDER_HP */
- { 36394, 0x0000803A }, /* GL_RESCALE_NORMAL */
- { 36412, 0x0000803A }, /* GL_RESCALE_NORMAL_EXT */
- { 36434, 0x00008256 }, /* GL_RESET_NOTIFICATION_STRATEGY_ARB */
- { 36469, 0x00008A1B }, /* GL_RETAINED_APPLE */
- { 36487, 0x00000102 }, /* GL_RETURN */
- { 36497, 0x00008F99 }, /* GL_RG16_SNORM */
- { 36511, 0x00008F95 }, /* GL_RG8_SNORM */
- { 36524, 0x00001907 }, /* GL_RGB */
- { 36531, 0x00008052 }, /* GL_RGB10 */
- { 36540, 0x00008059 }, /* GL_RGB10_A2 */
- { 36552, 0x00008059 }, /* GL_RGB10_A2_EXT */
- { 36568, 0x00008052 }, /* GL_RGB10_EXT */
- { 36581, 0x00008053 }, /* GL_RGB12 */
- { 36590, 0x00008053 }, /* GL_RGB12_EXT */
- { 36603, 0x00008054 }, /* GL_RGB16 */
- { 36612, 0x0000881B }, /* GL_RGB16F */
- { 36622, 0x00008D89 }, /* GL_RGB16I */
- { 36632, 0x00008D89 }, /* GL_RGB16I_EXT */
- { 36646, 0x00008D77 }, /* GL_RGB16UI */
- { 36657, 0x00008D77 }, /* GL_RGB16UI_EXT */
- { 36672, 0x00008054 }, /* GL_RGB16_EXT */
- { 36685, 0x00008F9A }, /* GL_RGB16_SNORM */
- { 36700, 0x0000804E }, /* GL_RGB2_EXT */
- { 36712, 0x00008815 }, /* GL_RGB32F */
- { 36722, 0x00008D83 }, /* GL_RGB32I */
- { 36732, 0x00008D83 }, /* GL_RGB32I_EXT */
- { 36746, 0x00008D71 }, /* GL_RGB32UI */
- { 36757, 0x00008D71 }, /* GL_RGB32UI_EXT */
- { 36772, 0x0000804F }, /* GL_RGB4 */
- { 36780, 0x0000804F }, /* GL_RGB4_EXT */
- { 36792, 0x000083A1 }, /* GL_RGB4_S3TC */
- { 36805, 0x00008050 }, /* GL_RGB5 */
- { 36813, 0x00008D62 }, /* GL_RGB565 */
- { 36823, 0x00008D62 }, /* GL_RGB565_OES */
- { 36837, 0x00008057 }, /* GL_RGB5_A1 */
- { 36848, 0x00008057 }, /* GL_RGB5_A1_EXT */
- { 36863, 0x00008057 }, /* GL_RGB5_A1_OES */
- { 36878, 0x00008050 }, /* GL_RGB5_EXT */
- { 36890, 0x00008051 }, /* GL_RGB8 */
- { 36898, 0x00008D8F }, /* GL_RGB8I */
- { 36907, 0x00008D8F }, /* GL_RGB8I_EXT */
- { 36920, 0x00008D7D }, /* GL_RGB8UI */
- { 36930, 0x00008D7D }, /* GL_RGB8UI_EXT */
- { 36944, 0x00008051 }, /* GL_RGB8_EXT */
- { 36956, 0x00008051 }, /* GL_RGB8_OES */
- { 36968, 0x00008F96 }, /* GL_RGB8_SNORM */
- { 36982, 0x00008C3D }, /* GL_RGB9_E5 */
- { 36993, 0x00001908 }, /* GL_RGBA */
- { 37001, 0x0000805A }, /* GL_RGBA12 */
- { 37011, 0x0000805A }, /* GL_RGBA12_EXT */
- { 37025, 0x0000805B }, /* GL_RGBA16 */
- { 37035, 0x0000881A }, /* GL_RGBA16F */
- { 37046, 0x00008D88 }, /* GL_RGBA16I */
- { 37057, 0x00008D88 }, /* GL_RGBA16I_EXT */
- { 37072, 0x00008D76 }, /* GL_RGBA16UI */
- { 37084, 0x00008D76 }, /* GL_RGBA16UI_EXT */
- { 37100, 0x0000805B }, /* GL_RGBA16_EXT */
- { 37114, 0x00008F9B }, /* GL_RGBA16_SNORM */
- { 37130, 0x00008055 }, /* GL_RGBA2 */
- { 37139, 0x00008055 }, /* GL_RGBA2_EXT */
- { 37152, 0x00008814 }, /* GL_RGBA32F */
- { 37163, 0x00008D82 }, /* GL_RGBA32I */
- { 37174, 0x00008D82 }, /* GL_RGBA32I_EXT */
- { 37189, 0x00008D70 }, /* GL_RGBA32UI */
- { 37201, 0x00008D70 }, /* GL_RGBA32UI_EXT */
- { 37217, 0x00008056 }, /* GL_RGBA4 */
- { 37226, 0x000083A5 }, /* GL_RGBA4_DXT5_S3TC */
- { 37245, 0x00008056 }, /* GL_RGBA4_EXT */
- { 37258, 0x00008056 }, /* GL_RGBA4_OES */
- { 37271, 0x000083A3 }, /* GL_RGBA4_S3TC */
- { 37285, 0x00008058 }, /* GL_RGBA8 */
- { 37294, 0x00008D8E }, /* GL_RGBA8I */
- { 37304, 0x00008D8E }, /* GL_RGBA8I_EXT */
- { 37318, 0x00008D7C }, /* GL_RGBA8UI */
- { 37329, 0x00008D7C }, /* GL_RGBA8UI_EXT */
- { 37344, 0x00008058 }, /* GL_RGBA8_EXT */
- { 37357, 0x00008058 }, /* GL_RGBA8_OES */
- { 37370, 0x00008F97 }, /* GL_RGBA8_SNORM */
- { 37385, 0x000083A4 }, /* GL_RGBA_DXT5_S3TC */
- { 37403, 0x00008820 }, /* GL_RGBA_FLOAT_MODE_ARB */
- { 37426, 0x00008D99 }, /* GL_RGBA_INTEGER */
- { 37442, 0x00008D99 }, /* GL_RGBA_INTEGER_EXT */
- { 37462, 0x00008D9E }, /* GL_RGBA_INTEGER_MODE_EXT */
- { 37487, 0x00000C31 }, /* GL_RGBA_MODE */
- { 37500, 0x000083A2 }, /* GL_RGBA_S3TC */
- { 37513, 0x00008F93 }, /* GL_RGBA_SNORM */
- { 37527, 0x00008D98 }, /* GL_RGB_INTEGER */
- { 37542, 0x00008D98 }, /* GL_RGB_INTEGER_EXT */
- { 37561, 0x000083A0 }, /* GL_RGB_S3TC */
- { 37573, 0x00008573 }, /* GL_RGB_SCALE */
- { 37586, 0x00008573 }, /* GL_RGB_SCALE_ARB */
- { 37603, 0x00008573 }, /* GL_RGB_SCALE_EXT */
- { 37620, 0x00008F92 }, /* GL_RGB_SNORM */
- { 37633, 0x00008F91 }, /* GL_RG_SNORM */
- { 37645, 0x00000407 }, /* GL_RIGHT */
- { 37654, 0x00002000 }, /* GL_S */
- { 37659, 0x00008B5D }, /* GL_SAMPLER_1D */
- { 37673, 0x00008DC0 }, /* GL_SAMPLER_1D_ARRAY */
- { 37693, 0x00008DC0 }, /* GL_SAMPLER_1D_ARRAY_EXT */
- { 37717, 0x00008DC3 }, /* GL_SAMPLER_1D_ARRAY_SHADOW */
- { 37744, 0x00008DC3 }, /* GL_SAMPLER_1D_ARRAY_SHADOW_EXT */
- { 37775, 0x00008B61 }, /* GL_SAMPLER_1D_SHADOW */
- { 37796, 0x00008B5E }, /* GL_SAMPLER_2D */
- { 37810, 0x00008DC1 }, /* GL_SAMPLER_2D_ARRAY */
- { 37830, 0x00008DC1 }, /* GL_SAMPLER_2D_ARRAY_EXT */
- { 37854, 0x00008DC4 }, /* GL_SAMPLER_2D_ARRAY_SHADOW */
- { 37881, 0x00008DC4 }, /* GL_SAMPLER_2D_ARRAY_SHADOW_EXT */
- { 37912, 0x00008B63 }, /* GL_SAMPLER_2D_RECT */
- { 37931, 0x00008B64 }, /* GL_SAMPLER_2D_RECT_SHADOW */
- { 37957, 0x00008B62 }, /* GL_SAMPLER_2D_SHADOW */
- { 37978, 0x00008B5F }, /* GL_SAMPLER_3D */
- { 37992, 0x00008B5F }, /* GL_SAMPLER_3D_OES */
- { 38010, 0x00008919 }, /* GL_SAMPLER_BINDING */
- { 38029, 0x00008DC2 }, /* GL_SAMPLER_BUFFER */
- { 38047, 0x00008DC2 }, /* GL_SAMPLER_BUFFER_EXT */
- { 38069, 0x00008B60 }, /* GL_SAMPLER_CUBE */
- { 38085, 0x00008DC5 }, /* GL_SAMPLER_CUBE_SHADOW */
- { 38108, 0x00008DC5 }, /* GL_SAMPLER_CUBE_SHADOW_EXT */
- { 38135, 0x000080A9 }, /* GL_SAMPLES */
- { 38146, 0x000086B4 }, /* GL_SAMPLES_3DFX */
- { 38162, 0x000080A9 }, /* GL_SAMPLES_ARB */
- { 38177, 0x00008914 }, /* GL_SAMPLES_PASSED */
- { 38195, 0x00008914 }, /* GL_SAMPLES_PASSED_ARB */
- { 38217, 0x0000809E }, /* GL_SAMPLE_ALPHA_TO_COVERAGE */
- { 38245, 0x0000809E }, /* GL_SAMPLE_ALPHA_TO_COVERAGE_ARB */
- { 38277, 0x0000809F }, /* GL_SAMPLE_ALPHA_TO_ONE */
- { 38300, 0x0000809F }, /* GL_SAMPLE_ALPHA_TO_ONE_ARB */
- { 38327, 0x000080A8 }, /* GL_SAMPLE_BUFFERS */
- { 38345, 0x000086B3 }, /* GL_SAMPLE_BUFFERS_3DFX */
- { 38368, 0x000080A8 }, /* GL_SAMPLE_BUFFERS_ARB */
- { 38390, 0x000080A0 }, /* GL_SAMPLE_COVERAGE */
- { 38409, 0x000080A0 }, /* GL_SAMPLE_COVERAGE_ARB */
- { 38432, 0x000080AB }, /* GL_SAMPLE_COVERAGE_INVERT */
- { 38458, 0x000080AB }, /* GL_SAMPLE_COVERAGE_INVERT_ARB */
- { 38488, 0x000080AA }, /* GL_SAMPLE_COVERAGE_VALUE */
- { 38513, 0x000080AA }, /* GL_SAMPLE_COVERAGE_VALUE_ARB */
- { 38542, 0x00080000 }, /* GL_SCISSOR_BIT */
- { 38557, 0x00000C10 }, /* GL_SCISSOR_BOX */
- { 38572, 0x00000C11 }, /* GL_SCISSOR_TEST */
- { 38588, 0x0000845E }, /* GL_SECONDARY_COLOR_ARRAY */
- { 38613, 0x0000889C }, /* GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING */
- { 38653, 0x0000889C }, /* GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB */
- { 38697, 0x0000845D }, /* GL_SECONDARY_COLOR_ARRAY_POINTER */
- { 38730, 0x0000845A }, /* GL_SECONDARY_COLOR_ARRAY_SIZE */
- { 38760, 0x0000845C }, /* GL_SECONDARY_COLOR_ARRAY_STRIDE */
- { 38792, 0x0000845B }, /* GL_SECONDARY_COLOR_ARRAY_TYPE */
- { 38822, 0x00001C02 }, /* GL_SELECT */
- { 38832, 0x00000DF3 }, /* GL_SELECTION_BUFFER_POINTER */
- { 38860, 0x00000DF4 }, /* GL_SELECTION_BUFFER_SIZE */
- { 38885, 0x00008012 }, /* GL_SEPARABLE_2D */
- { 38901, 0x00008C8D }, /* GL_SEPARATE_ATTRIBS */
- { 38921, 0x00008C8D }, /* GL_SEPARATE_ATTRIBS_EXT */
- { 38945, 0x000081FA }, /* GL_SEPARATE_SPECULAR_COLOR */
- { 38972, 0x000081FA }, /* GL_SEPARATE_SPECULAR_COLOR_EXT */
- { 39003, 0x0000150F }, /* GL_SET */
- { 39010, 0x00008DF8 }, /* GL_SHADER_BINARY_FORMATS */
- { 39035, 0x00008DFA }, /* GL_SHADER_COMPILER */
- { 39054, 0x00008B48 }, /* GL_SHADER_OBJECT_ARB */
- { 39075, 0x00008B88 }, /* GL_SHADER_SOURCE_LENGTH */
- { 39099, 0x00008B4F }, /* GL_SHADER_TYPE */
- { 39114, 0x00000B54 }, /* GL_SHADE_MODEL */
- { 39129, 0x00008B8C }, /* GL_SHADING_LANGUAGE_VERSION */
- { 39157, 0x000080BF }, /* GL_SHADOW_AMBIENT_SGIX */
- { 39180, 0x000081FB }, /* GL_SHARED_TEXTURE_PALETTE_EXT */
- { 39210, 0x00001601 }, /* GL_SHININESS */
- { 39223, 0x00001402 }, /* GL_SHORT */
- { 39232, 0x00009119 }, /* GL_SIGNALED */
- { 39244, 0x00008F9C }, /* GL_SIGNED_NORMALIZED */
- { 39265, 0x000081F9 }, /* GL_SINGLE_COLOR */
- { 39281, 0x000081F9 }, /* GL_SINGLE_COLOR_EXT */
- { 39301, 0x000085CC }, /* GL_SLICE_ACCUM_SUN */
- { 39320, 0x00008C46 }, /* GL_SLUMINANCE */
- { 39334, 0x00008C47 }, /* GL_SLUMINANCE8 */
- { 39349, 0x00008C45 }, /* GL_SLUMINANCE8_ALPHA8 */
- { 39371, 0x00008C44 }, /* GL_SLUMINANCE_ALPHA */
- { 39391, 0x00001D01 }, /* GL_SMOOTH */
- { 39401, 0x00000B23 }, /* GL_SMOOTH_LINE_WIDTH_GRANULARITY */
- { 39434, 0x00000B22 }, /* GL_SMOOTH_LINE_WIDTH_RANGE */
- { 39461, 0x00000B13 }, /* GL_SMOOTH_POINT_SIZE_GRANULARITY */
- { 39494, 0x00000B12 }, /* GL_SMOOTH_POINT_SIZE_RANGE */
- { 39521, 0x00008588 }, /* GL_SOURCE0_ALPHA */
- { 39538, 0x00008588 }, /* GL_SOURCE0_ALPHA_ARB */
- { 39559, 0x00008588 }, /* GL_SOURCE0_ALPHA_EXT */
- { 39580, 0x00008580 }, /* GL_SOURCE0_RGB */
- { 39595, 0x00008580 }, /* GL_SOURCE0_RGB_ARB */
- { 39614, 0x00008580 }, /* GL_SOURCE0_RGB_EXT */
- { 39633, 0x00008589 }, /* GL_SOURCE1_ALPHA */
- { 39650, 0x00008589 }, /* GL_SOURCE1_ALPHA_ARB */
- { 39671, 0x00008589 }, /* GL_SOURCE1_ALPHA_EXT */
- { 39692, 0x00008581 }, /* GL_SOURCE1_RGB */
- { 39707, 0x00008581 }, /* GL_SOURCE1_RGB_ARB */
- { 39726, 0x00008581 }, /* GL_SOURCE1_RGB_EXT */
- { 39745, 0x0000858A }, /* GL_SOURCE2_ALPHA */
- { 39762, 0x0000858A }, /* GL_SOURCE2_ALPHA_ARB */
- { 39783, 0x0000858A }, /* GL_SOURCE2_ALPHA_EXT */
- { 39804, 0x00008582 }, /* GL_SOURCE2_RGB */
- { 39819, 0x00008582 }, /* GL_SOURCE2_RGB_ARB */
- { 39838, 0x00008582 }, /* GL_SOURCE2_RGB_EXT */
- { 39857, 0x0000858B }, /* GL_SOURCE3_ALPHA_NV */
- { 39877, 0x00008583 }, /* GL_SOURCE3_RGB_NV */
- { 39895, 0x00001202 }, /* GL_SPECULAR */
- { 39907, 0x00002402 }, /* GL_SPHERE_MAP */
- { 39921, 0x00001206 }, /* GL_SPOT_CUTOFF */
- { 39936, 0x00001204 }, /* GL_SPOT_DIRECTION */
- { 39954, 0x00001205 }, /* GL_SPOT_EXPONENT */
- { 39971, 0x00008588 }, /* GL_SRC0_ALPHA */
- { 39985, 0x00008580 }, /* GL_SRC0_RGB */
- { 39997, 0x00008589 }, /* GL_SRC1_ALPHA */
- { 40011, 0x00008581 }, /* GL_SRC1_RGB */
- { 40023, 0x0000858A }, /* GL_SRC2_ALPHA */
- { 40037, 0x00008582 }, /* GL_SRC2_RGB */
- { 40049, 0x00000302 }, /* GL_SRC_ALPHA */
- { 40062, 0x00000308 }, /* GL_SRC_ALPHA_SATURATE */
- { 40084, 0x00000300 }, /* GL_SRC_COLOR */
- { 40097, 0x00008C40 }, /* GL_SRGB */
- { 40105, 0x00008C41 }, /* GL_SRGB8 */
- { 40114, 0x00008C43 }, /* GL_SRGB8_ALPHA8 */
- { 40130, 0x00008C42 }, /* GL_SRGB_ALPHA */
- { 40144, 0x00000503 }, /* GL_STACK_OVERFLOW */
- { 40162, 0x00000504 }, /* GL_STACK_UNDERFLOW */
- { 40181, 0x000088E6 }, /* GL_STATIC_COPY */
- { 40196, 0x000088E6 }, /* GL_STATIC_COPY_ARB */
- { 40215, 0x000088E4 }, /* GL_STATIC_DRAW */
- { 40230, 0x000088E4 }, /* GL_STATIC_DRAW_ARB */
- { 40249, 0x000088E5 }, /* GL_STATIC_READ */
- { 40264, 0x000088E5 }, /* GL_STATIC_READ_ARB */
- { 40283, 0x00001802 }, /* GL_STENCIL */
- { 40294, 0x00008D20 }, /* GL_STENCIL_ATTACHMENT */
- { 40316, 0x00008D20 }, /* GL_STENCIL_ATTACHMENT_EXT */
- { 40342, 0x00008D20 }, /* GL_STENCIL_ATTACHMENT_OES */
- { 40368, 0x00008801 }, /* GL_STENCIL_BACK_FAIL */
- { 40389, 0x00008801 }, /* GL_STENCIL_BACK_FAIL_ATI */
- { 40414, 0x00008800 }, /* GL_STENCIL_BACK_FUNC */
- { 40435, 0x00008800 }, /* GL_STENCIL_BACK_FUNC_ATI */
- { 40460, 0x00008802 }, /* GL_STENCIL_BACK_PASS_DEPTH_FAIL */
- { 40492, 0x00008802 }, /* GL_STENCIL_BACK_PASS_DEPTH_FAIL_ATI */
- { 40528, 0x00008803 }, /* GL_STENCIL_BACK_PASS_DEPTH_PASS */
- { 40560, 0x00008803 }, /* GL_STENCIL_BACK_PASS_DEPTH_PASS_ATI */
- { 40596, 0x00008CA3 }, /* GL_STENCIL_BACK_REF */
- { 40616, 0x00008CA4 }, /* GL_STENCIL_BACK_VALUE_MASK */
- { 40643, 0x00008CA5 }, /* GL_STENCIL_BACK_WRITEMASK */
- { 40669, 0x00000D57 }, /* GL_STENCIL_BITS */
- { 40685, 0x00008224 }, /* GL_STENCIL_BUFFER */
- { 40703, 0x00000400 }, /* GL_STENCIL_BUFFER_BIT */
- { 40725, 0x00000B91 }, /* GL_STENCIL_CLEAR_VALUE */
- { 40748, 0x00000B94 }, /* GL_STENCIL_FAIL */
- { 40764, 0x00000B92 }, /* GL_STENCIL_FUNC */
- { 40780, 0x00001901 }, /* GL_STENCIL_INDEX */
- { 40797, 0x00008D46 }, /* GL_STENCIL_INDEX1 */
- { 40815, 0x00008D49 }, /* GL_STENCIL_INDEX16 */
- { 40834, 0x00008D49 }, /* GL_STENCIL_INDEX16_EXT */
- { 40857, 0x00008D46 }, /* GL_STENCIL_INDEX1_EXT */
- { 40879, 0x00008D46 }, /* GL_STENCIL_INDEX1_OES */
- { 40901, 0x00008D47 }, /* GL_STENCIL_INDEX4 */
- { 40919, 0x00008D47 }, /* GL_STENCIL_INDEX4_EXT */
- { 40941, 0x00008D47 }, /* GL_STENCIL_INDEX4_OES */
- { 40963, 0x00008D48 }, /* GL_STENCIL_INDEX8 */
- { 40981, 0x00008D48 }, /* GL_STENCIL_INDEX8_EXT */
- { 41003, 0x00008D48 }, /* GL_STENCIL_INDEX8_OES */
- { 41025, 0x00008D45 }, /* GL_STENCIL_INDEX_EXT */
- { 41046, 0x00000B95 }, /* GL_STENCIL_PASS_DEPTH_FAIL */
- { 41073, 0x00000B96 }, /* GL_STENCIL_PASS_DEPTH_PASS */
- { 41100, 0x00000B97 }, /* GL_STENCIL_REF */
- { 41115, 0x00000B90 }, /* GL_STENCIL_TEST */
- { 41131, 0x00008910 }, /* GL_STENCIL_TEST_TWO_SIDE_EXT */
- { 41160, 0x00000B93 }, /* GL_STENCIL_VALUE_MASK */
- { 41182, 0x00000B98 }, /* GL_STENCIL_WRITEMASK */
- { 41203, 0x00000C33 }, /* GL_STEREO */
- { 41213, 0x000085BE }, /* GL_STORAGE_CACHED_APPLE */
- { 41237, 0x000085BD }, /* GL_STORAGE_PRIVATE_APPLE */
- { 41262, 0x000085BF }, /* GL_STORAGE_SHARED_APPLE */
- { 41286, 0x000088E2 }, /* GL_STREAM_COPY */
- { 41301, 0x000088E2 }, /* GL_STREAM_COPY_ARB */
- { 41320, 0x000088E0 }, /* GL_STREAM_DRAW */
- { 41335, 0x000088E0 }, /* GL_STREAM_DRAW_ARB */
- { 41354, 0x000088E1 }, /* GL_STREAM_READ */
- { 41369, 0x000088E1 }, /* GL_STREAM_READ_ARB */
- { 41388, 0x00000D50 }, /* GL_SUBPIXEL_BITS */
- { 41405, 0x000084E7 }, /* GL_SUBTRACT */
- { 41417, 0x000084E7 }, /* GL_SUBTRACT_ARB */
- { 41433, 0x00009113 }, /* GL_SYNC_CONDITION */
- { 41451, 0x00009116 }, /* GL_SYNC_FENCE */
- { 41465, 0x00009115 }, /* GL_SYNC_FLAGS */
- { 41479, 0x00000001 }, /* GL_SYNC_FLUSH_COMMANDS_BIT */
- { 41506, 0x00009117 }, /* GL_SYNC_GPU_COMMANDS_COMPLETE */
- { 41536, 0x00009114 }, /* GL_SYNC_STATUS */
- { 41551, 0x00002001 }, /* GL_T */
- { 41556, 0x00002A2A }, /* GL_T2F_C3F_V3F */
- { 41571, 0x00002A2C }, /* GL_T2F_C4F_N3F_V3F */
- { 41590, 0x00002A29 }, /* GL_T2F_C4UB_V3F */
- { 41606, 0x00002A2B }, /* GL_T2F_N3F_V3F */
- { 41621, 0x00002A27 }, /* GL_T2F_V3F */
- { 41632, 0x00002A2D }, /* GL_T4F_C4F_N3F_V4F */
- { 41651, 0x00002A28 }, /* GL_T4F_V4F */
- { 41662, 0x00008031 }, /* GL_TABLE_TOO_LARGE_EXT */
- { 41685, 0x00001702 }, /* GL_TEXTURE */
- { 41696, 0x000084C0 }, /* GL_TEXTURE0 */
- { 41708, 0x000084C0 }, /* GL_TEXTURE0_ARB */
- { 41724, 0x000084C1 }, /* GL_TEXTURE1 */
- { 41736, 0x000084CA }, /* GL_TEXTURE10 */
- { 41749, 0x000084CA }, /* GL_TEXTURE10_ARB */
- { 41766, 0x000084CB }, /* GL_TEXTURE11 */
- { 41779, 0x000084CB }, /* GL_TEXTURE11_ARB */
- { 41796, 0x000084CC }, /* GL_TEXTURE12 */
- { 41809, 0x000084CC }, /* GL_TEXTURE12_ARB */
- { 41826, 0x000084CD }, /* GL_TEXTURE13 */
- { 41839, 0x000084CD }, /* GL_TEXTURE13_ARB */
- { 41856, 0x000084CE }, /* GL_TEXTURE14 */
- { 41869, 0x000084CE }, /* GL_TEXTURE14_ARB */
- { 41886, 0x000084CF }, /* GL_TEXTURE15 */
- { 41899, 0x000084CF }, /* GL_TEXTURE15_ARB */
- { 41916, 0x000084D0 }, /* GL_TEXTURE16 */
- { 41929, 0x000084D0 }, /* GL_TEXTURE16_ARB */
- { 41946, 0x000084D1 }, /* GL_TEXTURE17 */
- { 41959, 0x000084D1 }, /* GL_TEXTURE17_ARB */
- { 41976, 0x000084D2 }, /* GL_TEXTURE18 */
- { 41989, 0x000084D2 }, /* GL_TEXTURE18_ARB */
- { 42006, 0x000084D3 }, /* GL_TEXTURE19 */
- { 42019, 0x000084D3 }, /* GL_TEXTURE19_ARB */
- { 42036, 0x000084C1 }, /* GL_TEXTURE1_ARB */
- { 42052, 0x000084C2 }, /* GL_TEXTURE2 */
- { 42064, 0x000084D4 }, /* GL_TEXTURE20 */
- { 42077, 0x000084D4 }, /* GL_TEXTURE20_ARB */
- { 42094, 0x000084D5 }, /* GL_TEXTURE21 */
- { 42107, 0x000084D5 }, /* GL_TEXTURE21_ARB */
- { 42124, 0x000084D6 }, /* GL_TEXTURE22 */
- { 42137, 0x000084D6 }, /* GL_TEXTURE22_ARB */
- { 42154, 0x000084D7 }, /* GL_TEXTURE23 */
- { 42167, 0x000084D7 }, /* GL_TEXTURE23_ARB */
- { 42184, 0x000084D8 }, /* GL_TEXTURE24 */
- { 42197, 0x000084D8 }, /* GL_TEXTURE24_ARB */
- { 42214, 0x000084D9 }, /* GL_TEXTURE25 */
- { 42227, 0x000084D9 }, /* GL_TEXTURE25_ARB */
- { 42244, 0x000084DA }, /* GL_TEXTURE26 */
- { 42257, 0x000084DA }, /* GL_TEXTURE26_ARB */
- { 42274, 0x000084DB }, /* GL_TEXTURE27 */
- { 42287, 0x000084DB }, /* GL_TEXTURE27_ARB */
- { 42304, 0x000084DC }, /* GL_TEXTURE28 */
- { 42317, 0x000084DC }, /* GL_TEXTURE28_ARB */
- { 42334, 0x000084DD }, /* GL_TEXTURE29 */
- { 42347, 0x000084DD }, /* GL_TEXTURE29_ARB */
- { 42364, 0x000084C2 }, /* GL_TEXTURE2_ARB */
- { 42380, 0x000084C3 }, /* GL_TEXTURE3 */
- { 42392, 0x000084DE }, /* GL_TEXTURE30 */
- { 42405, 0x000084DE }, /* GL_TEXTURE30_ARB */
- { 42422, 0x000084DF }, /* GL_TEXTURE31 */
- { 42435, 0x000084DF }, /* GL_TEXTURE31_ARB */
- { 42452, 0x000084C3 }, /* GL_TEXTURE3_ARB */
- { 42468, 0x000084C4 }, /* GL_TEXTURE4 */
- { 42480, 0x000084C4 }, /* GL_TEXTURE4_ARB */
- { 42496, 0x000084C5 }, /* GL_TEXTURE5 */
- { 42508, 0x000084C5 }, /* GL_TEXTURE5_ARB */
- { 42524, 0x000084C6 }, /* GL_TEXTURE6 */
- { 42536, 0x000084C6 }, /* GL_TEXTURE6_ARB */
- { 42552, 0x000084C7 }, /* GL_TEXTURE7 */
- { 42564, 0x000084C7 }, /* GL_TEXTURE7_ARB */
- { 42580, 0x000084C8 }, /* GL_TEXTURE8 */
- { 42592, 0x000084C8 }, /* GL_TEXTURE8_ARB */
- { 42608, 0x000084C9 }, /* GL_TEXTURE9 */
- { 42620, 0x000084C9 }, /* GL_TEXTURE9_ARB */
- { 42636, 0x00000DE0 }, /* GL_TEXTURE_1D */
- { 42650, 0x00008C18 }, /* GL_TEXTURE_1D_ARRAY */
- { 42670, 0x00008C18 }, /* GL_TEXTURE_1D_ARRAY_EXT */
- { 42694, 0x00000DE1 }, /* GL_TEXTURE_2D */
- { 42708, 0x00008C1A }, /* GL_TEXTURE_2D_ARRAY */
- { 42728, 0x00008C1A }, /* GL_TEXTURE_2D_ARRAY_EXT */
- { 42752, 0x0000806F }, /* GL_TEXTURE_3D */
- { 42766, 0x0000806F }, /* GL_TEXTURE_3D_OES */
- { 42784, 0x0000805F }, /* GL_TEXTURE_ALPHA_SIZE */
- { 42806, 0x0000805F }, /* GL_TEXTURE_ALPHA_SIZE_EXT */
- { 42832, 0x0000813C }, /* GL_TEXTURE_BASE_LEVEL */
- { 42854, 0x00008068 }, /* GL_TEXTURE_BINDING_1D */
- { 42876, 0x00008C1C }, /* GL_TEXTURE_BINDING_1D_ARRAY */
- { 42904, 0x00008C1C }, /* GL_TEXTURE_BINDING_1D_ARRAY_EXT */
- { 42936, 0x00008069 }, /* GL_TEXTURE_BINDING_2D */
- { 42958, 0x00008C1D }, /* GL_TEXTURE_BINDING_2D_ARRAY */
- { 42986, 0x00008C1D }, /* GL_TEXTURE_BINDING_2D_ARRAY_EXT */
- { 43018, 0x0000806A }, /* GL_TEXTURE_BINDING_3D */
- { 43040, 0x0000806A }, /* GL_TEXTURE_BINDING_3D_OES */
- { 43066, 0x00008C2C }, /* GL_TEXTURE_BINDING_BUFFER */
- { 43092, 0x00008C2C }, /* GL_TEXTURE_BINDING_BUFFER_ARB */
- { 43122, 0x00008514 }, /* GL_TEXTURE_BINDING_CUBE_MAP */
- { 43150, 0x00008514 }, /* GL_TEXTURE_BINDING_CUBE_MAP_ARB */
- { 43182, 0x00008514 }, /* GL_TEXTURE_BINDING_CUBE_MAP_OES */
- { 43214, 0x000084F6 }, /* GL_TEXTURE_BINDING_RECTANGLE */
- { 43243, 0x000084F6 }, /* GL_TEXTURE_BINDING_RECTANGLE_ARB */
- { 43276, 0x000084F6 }, /* GL_TEXTURE_BINDING_RECTANGLE_NV */
- { 43308, 0x00040000 }, /* GL_TEXTURE_BIT */
- { 43323, 0x0000805E }, /* GL_TEXTURE_BLUE_SIZE */
- { 43344, 0x0000805E }, /* GL_TEXTURE_BLUE_SIZE_EXT */
- { 43369, 0x00001005 }, /* GL_TEXTURE_BORDER */
- { 43387, 0x00001004 }, /* GL_TEXTURE_BORDER_COLOR */
- { 43411, 0x00008C2A }, /* GL_TEXTURE_BUFFER */
- { 43429, 0x00008C2A }, /* GL_TEXTURE_BUFFER_ARB */
- { 43451, 0x00008C2D }, /* GL_TEXTURE_BUFFER_DATA_STORE_BINDING */
- { 43488, 0x00008C2D }, /* GL_TEXTURE_BUFFER_DATA_STORE_BINDING_ARB */
- { 43529, 0x00008C2E }, /* GL_TEXTURE_BUFFER_FORMAT */
- { 43554, 0x00008C2E }, /* GL_TEXTURE_BUFFER_FORMAT_ARB */
- { 43583, 0x00008171 }, /* GL_TEXTURE_CLIPMAP_CENTER_SGIX */
- { 43614, 0x00008176 }, /* GL_TEXTURE_CLIPMAP_DEPTH_SGIX */
- { 43644, 0x00008172 }, /* GL_TEXTURE_CLIPMAP_FRAME_SGIX */
- { 43674, 0x00008175 }, /* GL_TEXTURE_CLIPMAP_LOD_OFFSET_SGIX */
- { 43709, 0x00008173 }, /* GL_TEXTURE_CLIPMAP_OFFSET_SGIX */
- { 43740, 0x00008174 }, /* GL_TEXTURE_CLIPMAP_VIRTUAL_DEPTH_SGIX */
- { 43778, 0x000080BC }, /* GL_TEXTURE_COLOR_TABLE_SGI */
- { 43805, 0x000081EF }, /* GL_TEXTURE_COLOR_WRITEMASK_SGIS */
- { 43837, 0x000080BF }, /* GL_TEXTURE_COMPARE_FAIL_VALUE_ARB */
- { 43871, 0x0000884D }, /* GL_TEXTURE_COMPARE_FUNC */
- { 43895, 0x0000884D }, /* GL_TEXTURE_COMPARE_FUNC_ARB */
- { 43923, 0x0000884C }, /* GL_TEXTURE_COMPARE_MODE */
- { 43947, 0x0000884C }, /* GL_TEXTURE_COMPARE_MODE_ARB */
- { 43975, 0x0000819B }, /* GL_TEXTURE_COMPARE_OPERATOR_SGIX */
- { 44008, 0x0000819A }, /* GL_TEXTURE_COMPARE_SGIX */
- { 44032, 0x00001003 }, /* GL_TEXTURE_COMPONENTS */
- { 44054, 0x000086A1 }, /* GL_TEXTURE_COMPRESSED */
- { 44076, 0x000086A1 }, /* GL_TEXTURE_COMPRESSED_ARB */
- { 44102, 0x000086A3 }, /* GL_TEXTURE_COMPRESSED_FORMATS_ARB */
- { 44136, 0x000086A0 }, /* GL_TEXTURE_COMPRESSED_IMAGE_SIZE */
- { 44169, 0x000086A0 }, /* GL_TEXTURE_COMPRESSED_IMAGE_SIZE_ARB */
- { 44206, 0x000084EF }, /* GL_TEXTURE_COMPRESSION_HINT */
- { 44234, 0x000084EF }, /* GL_TEXTURE_COMPRESSION_HINT_ARB */
- { 44266, 0x00008078 }, /* GL_TEXTURE_COORD_ARRAY */
- { 44289, 0x0000889A }, /* GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING */
- { 44327, 0x0000889A }, /* GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB */
- { 44369, 0x00008092 }, /* GL_TEXTURE_COORD_ARRAY_POINTER */
- { 44400, 0x00008088 }, /* GL_TEXTURE_COORD_ARRAY_SIZE */
- { 44428, 0x0000808A }, /* GL_TEXTURE_COORD_ARRAY_STRIDE */
- { 44458, 0x00008089 }, /* GL_TEXTURE_COORD_ARRAY_TYPE */
- { 44486, 0x00008B9D }, /* GL_TEXTURE_CROP_RECT_OES */
- { 44511, 0x00008513 }, /* GL_TEXTURE_CUBE_MAP */
- { 44531, 0x00008513 }, /* GL_TEXTURE_CUBE_MAP_ARB */
- { 44555, 0x00008516 }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_X */
- { 44586, 0x00008516 }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB */
- { 44621, 0x00008516 }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_X_OES */
- { 44656, 0x00008518 }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Y */
- { 44687, 0x00008518 }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB */
- { 44722, 0x00008518 }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_OES */
- { 44757, 0x0000851A }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Z */
- { 44788, 0x0000851A }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB */
- { 44823, 0x0000851A }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_OES */
- { 44858, 0x00008513 }, /* GL_TEXTURE_CUBE_MAP_OES */
- { 44882, 0x00008515 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_X */
- { 44913, 0x00008515 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB */
- { 44948, 0x00008515 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_X_OES */
- { 44983, 0x00008517 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Y */
- { 45014, 0x00008517 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB */
- { 45049, 0x00008517 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Y_OES */
- { 45084, 0x00008519 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Z */
- { 45115, 0x00008519 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB */
- { 45150, 0x00008519 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Z_OES */
- { 45185, 0x000088F4 }, /* GL_TEXTURE_CUBE_MAP_SEAMLESS */
- { 45214, 0x00008071 }, /* GL_TEXTURE_DEPTH */
- { 45231, 0x0000884A }, /* GL_TEXTURE_DEPTH_SIZE */
- { 45253, 0x0000884A }, /* GL_TEXTURE_DEPTH_SIZE_ARB */
- { 45279, 0x00002300 }, /* GL_TEXTURE_ENV */
- { 45294, 0x00002201 }, /* GL_TEXTURE_ENV_COLOR */
- { 45315, 0x00002200 }, /* GL_TEXTURE_ENV_MODE */
- { 45335, 0x00008500 }, /* GL_TEXTURE_FILTER_CONTROL */
- { 45361, 0x00008500 }, /* GL_TEXTURE_FILTER_CONTROL_EXT */
- { 45391, 0x00002500 }, /* GL_TEXTURE_GEN_MODE */
- { 45411, 0x00002500 }, /* GL_TEXTURE_GEN_MODE_OES */
- { 45435, 0x00000C63 }, /* GL_TEXTURE_GEN_Q */
- { 45452, 0x00000C62 }, /* GL_TEXTURE_GEN_R */
- { 45469, 0x00000C60 }, /* GL_TEXTURE_GEN_S */
- { 45486, 0x00008D60 }, /* GL_TEXTURE_GEN_STR_OES */
- { 45509, 0x00000C61 }, /* GL_TEXTURE_GEN_T */
- { 45526, 0x0000819D }, /* GL_TEXTURE_GEQUAL_R_SGIX */
- { 45551, 0x0000805D }, /* GL_TEXTURE_GREEN_SIZE */
- { 45573, 0x0000805D }, /* GL_TEXTURE_GREEN_SIZE_EXT */
- { 45599, 0x00001001 }, /* GL_TEXTURE_HEIGHT */
- { 45617, 0x000080ED }, /* GL_TEXTURE_INDEX_SIZE_EXT */
- { 45643, 0x00008061 }, /* GL_TEXTURE_INTENSITY_SIZE */
- { 45669, 0x00008061 }, /* GL_TEXTURE_INTENSITY_SIZE_EXT */
- { 45699, 0x00001003 }, /* GL_TEXTURE_INTERNAL_FORMAT */
- { 45726, 0x0000819C }, /* GL_TEXTURE_LEQUAL_R_SGIX */
- { 45751, 0x00008501 }, /* GL_TEXTURE_LOD_BIAS */
- { 45771, 0x00008501 }, /* GL_TEXTURE_LOD_BIAS_EXT */
- { 45795, 0x00008190 }, /* GL_TEXTURE_LOD_BIAS_R_SGIX */
- { 45822, 0x0000818E }, /* GL_TEXTURE_LOD_BIAS_S_SGIX */
- { 45849, 0x0000818F }, /* GL_TEXTURE_LOD_BIAS_T_SGIX */
- { 45876, 0x00008060 }, /* GL_TEXTURE_LUMINANCE_SIZE */
- { 45902, 0x00008060 }, /* GL_TEXTURE_LUMINANCE_SIZE_EXT */
- { 45932, 0x00002800 }, /* GL_TEXTURE_MAG_FILTER */
- { 45954, 0x00000BA8 }, /* GL_TEXTURE_MATRIX */
- { 45972, 0x0000898F }, /* GL_TEXTURE_MATRIX_FLOAT_AS_INT_BITS_OES */
- { 46012, 0x000084FE }, /* GL_TEXTURE_MAX_ANISOTROPY_EXT */
- { 46042, 0x0000836B }, /* GL_TEXTURE_MAX_CLAMP_R_SGIX */
- { 46070, 0x00008369 }, /* GL_TEXTURE_MAX_CLAMP_S_SGIX */
- { 46098, 0x0000836A }, /* GL_TEXTURE_MAX_CLAMP_T_SGIX */
- { 46126, 0x0000813D }, /* GL_TEXTURE_MAX_LEVEL */
- { 46147, 0x0000813B }, /* GL_TEXTURE_MAX_LOD */
- { 46166, 0x00002801 }, /* GL_TEXTURE_MIN_FILTER */
- { 46188, 0x0000813A }, /* GL_TEXTURE_MIN_LOD */
- { 46207, 0x00008066 }, /* GL_TEXTURE_PRIORITY */
- { 46227, 0x000085B7 }, /* GL_TEXTURE_RANGE_LENGTH_APPLE */
- { 46257, 0x000085B8 }, /* GL_TEXTURE_RANGE_POINTER_APPLE */
- { 46288, 0x000084F5 }, /* GL_TEXTURE_RECTANGLE */
- { 46309, 0x000084F5 }, /* GL_TEXTURE_RECTANGLE_ARB */
- { 46334, 0x000084F5 }, /* GL_TEXTURE_RECTANGLE_NV */
- { 46358, 0x0000805C }, /* GL_TEXTURE_RED_SIZE */
- { 46378, 0x0000805C }, /* GL_TEXTURE_RED_SIZE_EXT */
- { 46402, 0x00008067 }, /* GL_TEXTURE_RESIDENT */
- { 46422, 0x00008C3F }, /* GL_TEXTURE_SHARED_SIZE */
- { 46445, 0x00000BA5 }, /* GL_TEXTURE_STACK_DEPTH */
- { 46468, 0x000088F1 }, /* GL_TEXTURE_STENCIL_SIZE */
- { 46492, 0x000088F1 }, /* GL_TEXTURE_STENCIL_SIZE_EXT */
- { 46520, 0x000085BC }, /* GL_TEXTURE_STORAGE_HINT_APPLE */
- { 46550, 0x00008065 }, /* GL_TEXTURE_TOO_LARGE_EXT */
- { 46575, 0x0000888F }, /* GL_TEXTURE_UNSIGNED_REMAP_MODE_NV */
- { 46609, 0x00001000 }, /* GL_TEXTURE_WIDTH */
- { 46626, 0x00008072 }, /* GL_TEXTURE_WRAP_R */
- { 46644, 0x00008072 }, /* GL_TEXTURE_WRAP_R_OES */
- { 46666, 0x00002802 }, /* GL_TEXTURE_WRAP_S */
- { 46684, 0x00002803 }, /* GL_TEXTURE_WRAP_T */
- { 46702, 0x0000911B }, /* GL_TIMEOUT_EXPIRED */
- { 46721, 0x000088BF }, /* GL_TIME_ELAPSED_EXT */
- { 46741, 0x00008648 }, /* GL_TRACK_MATRIX_NV */
- { 46760, 0x00008649 }, /* GL_TRACK_MATRIX_TRANSFORM_NV */
- { 46789, 0x00001000 }, /* GL_TRANSFORM_BIT */
- { 46806, 0x00008E22 }, /* GL_TRANSFORM_FEEDBACK */
- { 46828, 0x00008E25 }, /* GL_TRANSFORM_FEEDBACK_BINDING */
- { 46858, 0x00008C8E }, /* GL_TRANSFORM_FEEDBACK_BUFFER */
- { 46887, 0x00008E24 }, /* GL_TRANSFORM_FEEDBACK_BUFFER_ACTIVE */
- { 46923, 0x00008C8F }, /* GL_TRANSFORM_FEEDBACK_BUFFER_BINDING */
- { 46960, 0x00008C8F }, /* GL_TRANSFORM_FEEDBACK_BUFFER_BINDING_EXT */
- { 47001, 0x00008C8E }, /* GL_TRANSFORM_FEEDBACK_BUFFER_EXT */
- { 47034, 0x00008C7F }, /* GL_TRANSFORM_FEEDBACK_BUFFER_MODE */
- { 47068, 0x00008C7F }, /* GL_TRANSFORM_FEEDBACK_BUFFER_MODE_EXT */
- { 47106, 0x00008E23 }, /* GL_TRANSFORM_FEEDBACK_BUFFER_PAUSED */
- { 47142, 0x00008C85 }, /* GL_TRANSFORM_FEEDBACK_BUFFER_SIZE */
- { 47176, 0x00008C85 }, /* GL_TRANSFORM_FEEDBACK_BUFFER_SIZE_EXT */
- { 47214, 0x00008C84 }, /* GL_TRANSFORM_FEEDBACK_BUFFER_START */
- { 47249, 0x00008C84 }, /* GL_TRANSFORM_FEEDBACK_BUFFER_START_EXT */
- { 47288, 0x00008C88 }, /* GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN */
- { 47329, 0x00008C88 }, /* GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN_EXT */
- { 47374, 0x00008C83 }, /* GL_TRANSFORM_FEEDBACK_VARYINGS */
- { 47405, 0x00008C83 }, /* GL_TRANSFORM_FEEDBACK_VARYINGS_EXT */
- { 47440, 0x00008C76 }, /* GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH */
- { 47481, 0x00008C76 }, /* GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH_EXT */
- { 47526, 0x000084E6 }, /* GL_TRANSPOSE_COLOR_MATRIX */
- { 47552, 0x000084E6 }, /* GL_TRANSPOSE_COLOR_MATRIX_ARB */
- { 47582, 0x000088B7 }, /* GL_TRANSPOSE_CURRENT_MATRIX_ARB */
- { 47614, 0x000084E3 }, /* GL_TRANSPOSE_MODELVIEW_MATRIX */
- { 47644, 0x000084E3 }, /* GL_TRANSPOSE_MODELVIEW_MATRIX_ARB */
- { 47678, 0x0000862C }, /* GL_TRANSPOSE_NV */
- { 47694, 0x000084E4 }, /* GL_TRANSPOSE_PROJECTION_MATRIX */
- { 47725, 0x000084E4 }, /* GL_TRANSPOSE_PROJECTION_MATRIX_ARB */
- { 47760, 0x000084E5 }, /* GL_TRANSPOSE_TEXTURE_MATRIX */
- { 47788, 0x000084E5 }, /* GL_TRANSPOSE_TEXTURE_MATRIX_ARB */
- { 47820, 0x00000004 }, /* GL_TRIANGLES */
- { 47833, 0x0000000C }, /* GL_TRIANGLES_ADJACENCY */
- { 47856, 0x0000000C }, /* GL_TRIANGLES_ADJACENCY_ARB */
- { 47883, 0x00000006 }, /* GL_TRIANGLE_FAN */
- { 47899, 0x00008615 }, /* GL_TRIANGLE_MESH_SUN */
- { 47920, 0x00000005 }, /* GL_TRIANGLE_STRIP */
- { 47938, 0x0000000D }, /* GL_TRIANGLE_STRIP_ADJACENCY */
- { 47966, 0x0000000D }, /* GL_TRIANGLE_STRIP_ADJACENCY_ARB */
- { 47998, 0x00000001 }, /* GL_TRUE */
- { 48006, 0x00008A1C }, /* GL_UNDEFINED_APPLE */
- { 48025, 0x00008255 }, /* GL_UNKNOWN_CONTEXT_RESET_ARB */
- { 48054, 0x00000CF5 }, /* GL_UNPACK_ALIGNMENT */
- { 48074, 0x0000806E }, /* GL_UNPACK_IMAGE_HEIGHT */
- { 48097, 0x00000CF1 }, /* GL_UNPACK_LSB_FIRST */
- { 48117, 0x00000CF2 }, /* GL_UNPACK_ROW_LENGTH */
- { 48138, 0x0000806D }, /* GL_UNPACK_SKIP_IMAGES */
- { 48160, 0x00000CF4 }, /* GL_UNPACK_SKIP_PIXELS */
- { 48182, 0x00000CF3 }, /* GL_UNPACK_SKIP_ROWS */
- { 48202, 0x00000CF0 }, /* GL_UNPACK_SWAP_BYTES */
- { 48223, 0x00009118 }, /* GL_UNSIGNALED */
- { 48237, 0x00001401 }, /* GL_UNSIGNED_BYTE */
- { 48254, 0x00008362 }, /* GL_UNSIGNED_BYTE_2_3_3_REV */
- { 48281, 0x00008032 }, /* GL_UNSIGNED_BYTE_3_3_2 */
- { 48304, 0x00001405 }, /* GL_UNSIGNED_INT */
- { 48320, 0x00008C3B }, /* GL_UNSIGNED_INT_10F_11F_11F_REV */
- { 48352, 0x00008036 }, /* GL_UNSIGNED_INT_10_10_10_2 */
- { 48379, 0x00008DF6 }, /* GL_UNSIGNED_INT_10_10_10_2_OES */
- { 48410, 0x000084FA }, /* GL_UNSIGNED_INT_24_8 */
- { 48431, 0x000084FA }, /* GL_UNSIGNED_INT_24_8_EXT */
- { 48456, 0x000084FA }, /* GL_UNSIGNED_INT_24_8_NV */
- { 48480, 0x000084FA }, /* GL_UNSIGNED_INT_24_8_OES */
- { 48505, 0x00008368 }, /* GL_UNSIGNED_INT_2_10_10_10_REV */
- { 48536, 0x00008368 }, /* GL_UNSIGNED_INT_2_10_10_10_REV_EXT */
- { 48571, 0x00008C3E }, /* GL_UNSIGNED_INT_5_9_9_9_REV */
- { 48599, 0x00008035 }, /* GL_UNSIGNED_INT_8_8_8_8 */
- { 48623, 0x00008367 }, /* GL_UNSIGNED_INT_8_8_8_8_REV */
- { 48651, 0x00008DD1 }, /* GL_UNSIGNED_INT_SAMPLER_1D */
- { 48678, 0x00008DD6 }, /* GL_UNSIGNED_INT_SAMPLER_1D_ARRAY */
- { 48711, 0x00008DD6 }, /* GL_UNSIGNED_INT_SAMPLER_1D_ARRAY_EXT */
- { 48748, 0x00008DD1 }, /* GL_UNSIGNED_INT_SAMPLER_1D_EXT */
- { 48779, 0x00008DD2 }, /* GL_UNSIGNED_INT_SAMPLER_2D */
- { 48806, 0x00008DD7 }, /* GL_UNSIGNED_INT_SAMPLER_2D_ARRAY */
- { 48839, 0x00008DD7 }, /* GL_UNSIGNED_INT_SAMPLER_2D_ARRAY_EXT */
- { 48876, 0x00008DD2 }, /* GL_UNSIGNED_INT_SAMPLER_2D_EXT */
- { 48907, 0x00008DD5 }, /* GL_UNSIGNED_INT_SAMPLER_2D_RECT */
- { 48939, 0x00008DD5 }, /* GL_UNSIGNED_INT_SAMPLER_2D_RECT_EXT */
- { 48975, 0x00008DD3 }, /* GL_UNSIGNED_INT_SAMPLER_3D */
- { 49002, 0x00008DD3 }, /* GL_UNSIGNED_INT_SAMPLER_3D_EXT */
- { 49033, 0x00008DD8 }, /* GL_UNSIGNED_INT_SAMPLER_BUFFER */
- { 49064, 0x00008DD8 }, /* GL_UNSIGNED_INT_SAMPLER_BUFFER_EXT */
- { 49099, 0x00008DD4 }, /* GL_UNSIGNED_INT_SAMPLER_CUBE */
- { 49128, 0x00008DD4 }, /* GL_UNSIGNED_INT_SAMPLER_CUBE_EXT */
- { 49161, 0x00008DC6 }, /* GL_UNSIGNED_INT_VEC2 */
- { 49182, 0x00008DC6 }, /* GL_UNSIGNED_INT_VEC2_EXT */
- { 49207, 0x00008DC7 }, /* GL_UNSIGNED_INT_VEC3 */
- { 49228, 0x00008DC7 }, /* GL_UNSIGNED_INT_VEC3_EXT */
- { 49253, 0x00008DC8 }, /* GL_UNSIGNED_INT_VEC4 */
- { 49274, 0x00008DC8 }, /* GL_UNSIGNED_INT_VEC4_EXT */
- { 49299, 0x00008C17 }, /* GL_UNSIGNED_NORMALIZED */
- { 49322, 0x00001403 }, /* GL_UNSIGNED_SHORT */
- { 49340, 0x00008366 }, /* GL_UNSIGNED_SHORT_1_5_5_5_REV */
- { 49370, 0x00008366 }, /* GL_UNSIGNED_SHORT_1_5_5_5_REV_EXT */
- { 49404, 0x00008033 }, /* GL_UNSIGNED_SHORT_4_4_4_4 */
- { 49430, 0x00008365 }, /* GL_UNSIGNED_SHORT_4_4_4_4_REV */
- { 49460, 0x00008365 }, /* GL_UNSIGNED_SHORT_4_4_4_4_REV_EXT */
- { 49494, 0x00008034 }, /* GL_UNSIGNED_SHORT_5_5_5_1 */
- { 49520, 0x00008363 }, /* GL_UNSIGNED_SHORT_5_6_5 */
- { 49544, 0x00008364 }, /* GL_UNSIGNED_SHORT_5_6_5_REV */
- { 49572, 0x000085BA }, /* GL_UNSIGNED_SHORT_8_8_APPLE */
- { 49600, 0x000085BA }, /* GL_UNSIGNED_SHORT_8_8_MESA */
- { 49627, 0x000085BB }, /* GL_UNSIGNED_SHORT_8_8_REV_APPLE */
- { 49659, 0x000085BB }, /* GL_UNSIGNED_SHORT_8_8_REV_MESA */
- { 49690, 0x00008CA2 }, /* GL_UPPER_LEFT */
- { 49704, 0x00002A20 }, /* GL_V2F */
- { 49711, 0x00002A21 }, /* GL_V3F */
- { 49718, 0x00008B83 }, /* GL_VALIDATE_STATUS */
- { 49737, 0x00001F00 }, /* GL_VENDOR */
- { 49747, 0x00001F02 }, /* GL_VERSION */
- { 49758, 0x00008074 }, /* GL_VERTEX_ARRAY */
- { 49774, 0x000085B5 }, /* GL_VERTEX_ARRAY_BINDING */
- { 49798, 0x000085B5 }, /* GL_VERTEX_ARRAY_BINDING_APPLE */
- { 49828, 0x00008896 }, /* GL_VERTEX_ARRAY_BUFFER_BINDING */
- { 49859, 0x00008896 }, /* GL_VERTEX_ARRAY_BUFFER_BINDING_ARB */
- { 49894, 0x0000808E }, /* GL_VERTEX_ARRAY_POINTER */
- { 49918, 0x0000807A }, /* GL_VERTEX_ARRAY_SIZE */
- { 49939, 0x0000807C }, /* GL_VERTEX_ARRAY_STRIDE */
- { 49962, 0x0000807B }, /* GL_VERTEX_ARRAY_TYPE */
- { 49983, 0x00008650 }, /* GL_VERTEX_ATTRIB_ARRAY0_NV */
- { 50010, 0x0000865A }, /* GL_VERTEX_ATTRIB_ARRAY10_NV */
- { 50038, 0x0000865B }, /* GL_VERTEX_ATTRIB_ARRAY11_NV */
- { 50066, 0x0000865C }, /* GL_VERTEX_ATTRIB_ARRAY12_NV */
- { 50094, 0x0000865D }, /* GL_VERTEX_ATTRIB_ARRAY13_NV */
- { 50122, 0x0000865E }, /* GL_VERTEX_ATTRIB_ARRAY14_NV */
- { 50150, 0x0000865F }, /* GL_VERTEX_ATTRIB_ARRAY15_NV */
- { 50178, 0x00008651 }, /* GL_VERTEX_ATTRIB_ARRAY1_NV */
- { 50205, 0x00008652 }, /* GL_VERTEX_ATTRIB_ARRAY2_NV */
- { 50232, 0x00008653 }, /* GL_VERTEX_ATTRIB_ARRAY3_NV */
- { 50259, 0x00008654 }, /* GL_VERTEX_ATTRIB_ARRAY4_NV */
- { 50286, 0x00008655 }, /* GL_VERTEX_ATTRIB_ARRAY5_NV */
- { 50313, 0x00008656 }, /* GL_VERTEX_ATTRIB_ARRAY6_NV */
- { 50340, 0x00008657 }, /* GL_VERTEX_ATTRIB_ARRAY7_NV */
- { 50367, 0x00008658 }, /* GL_VERTEX_ATTRIB_ARRAY8_NV */
- { 50394, 0x00008659 }, /* GL_VERTEX_ATTRIB_ARRAY9_NV */
- { 50421, 0x0000889F }, /* GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING */
- { 50459, 0x0000889F }, /* GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB */
- { 50501, 0x000088FE }, /* GL_VERTEX_ATTRIB_ARRAY_DIVISOR_ARB */
- { 50536, 0x00008622 }, /* GL_VERTEX_ATTRIB_ARRAY_ENABLED */
- { 50567, 0x00008622 }, /* GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB */
- { 50602, 0x000088FD }, /* GL_VERTEX_ATTRIB_ARRAY_INTEGER */
- { 50633, 0x000088FD }, /* GL_VERTEX_ATTRIB_ARRAY_INTEGER_EXT */
- { 50668, 0x0000886A }, /* GL_VERTEX_ATTRIB_ARRAY_NORMALIZED */
- { 50702, 0x0000886A }, /* GL_VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB */
- { 50740, 0x00008645 }, /* GL_VERTEX_ATTRIB_ARRAY_POINTER */
- { 50771, 0x00008645 }, /* GL_VERTEX_ATTRIB_ARRAY_POINTER_ARB */
- { 50806, 0x00008623 }, /* GL_VERTEX_ATTRIB_ARRAY_SIZE */
- { 50834, 0x00008623 }, /* GL_VERTEX_ATTRIB_ARRAY_SIZE_ARB */
- { 50866, 0x00008624 }, /* GL_VERTEX_ATTRIB_ARRAY_STRIDE */
- { 50896, 0x00008624 }, /* GL_VERTEX_ATTRIB_ARRAY_STRIDE_ARB */
- { 50930, 0x00008625 }, /* GL_VERTEX_ATTRIB_ARRAY_TYPE */
- { 50958, 0x00008625 }, /* GL_VERTEX_ATTRIB_ARRAY_TYPE_ARB */
- { 50990, 0x000086A7 }, /* GL_VERTEX_BLEND_ARB */
- { 51010, 0x00008620 }, /* GL_VERTEX_PROGRAM_ARB */
- { 51032, 0x0000864A }, /* GL_VERTEX_PROGRAM_BINDING_NV */
- { 51061, 0x00008620 }, /* GL_VERTEX_PROGRAM_NV */
- { 51082, 0x00008642 }, /* GL_VERTEX_PROGRAM_POINT_SIZE */
- { 51111, 0x00008642 }, /* GL_VERTEX_PROGRAM_POINT_SIZE_ARB */
- { 51144, 0x00008642 }, /* GL_VERTEX_PROGRAM_POINT_SIZE_NV */
- { 51176, 0x00008643 }, /* GL_VERTEX_PROGRAM_TWO_SIDE */
- { 51203, 0x00008643 }, /* GL_VERTEX_PROGRAM_TWO_SIDE_ARB */
- { 51234, 0x00008643 }, /* GL_VERTEX_PROGRAM_TWO_SIDE_NV */
- { 51264, 0x00008B31 }, /* GL_VERTEX_SHADER */
- { 51281, 0x00008B31 }, /* GL_VERTEX_SHADER_ARB */
- { 51302, 0x00008621 }, /* GL_VERTEX_STATE_PROGRAM_NV */
- { 51329, 0x00000BA2 }, /* GL_VIEWPORT */
- { 51341, 0x00000800 }, /* GL_VIEWPORT_BIT */
- { 51357, 0x00008A1A }, /* GL_VOLATILE_APPLE */
- { 51375, 0x0000911D }, /* GL_WAIT_FAILED */
- { 51390, 0x000086AD }, /* GL_WEIGHT_ARRAY_ARB */
- { 51410, 0x0000889E }, /* GL_WEIGHT_ARRAY_BUFFER_BINDING */
- { 51441, 0x0000889E }, /* GL_WEIGHT_ARRAY_BUFFER_BINDING_ARB */
- { 51476, 0x0000889E }, /* GL_WEIGHT_ARRAY_BUFFER_BINDING_OES */
- { 51511, 0x000086AD }, /* GL_WEIGHT_ARRAY_OES */
- { 51531, 0x000086AC }, /* GL_WEIGHT_ARRAY_POINTER_ARB */
- { 51559, 0x000086AC }, /* GL_WEIGHT_ARRAY_POINTER_OES */
- { 51587, 0x000086AB }, /* GL_WEIGHT_ARRAY_SIZE_ARB */
- { 51612, 0x000086AB }, /* GL_WEIGHT_ARRAY_SIZE_OES */
- { 51637, 0x000086AA }, /* GL_WEIGHT_ARRAY_STRIDE_ARB */
- { 51664, 0x000086AA }, /* GL_WEIGHT_ARRAY_STRIDE_OES */
- { 51691, 0x000086A9 }, /* GL_WEIGHT_ARRAY_TYPE_ARB */
- { 51716, 0x000086A9 }, /* GL_WEIGHT_ARRAY_TYPE_OES */
- { 51741, 0x000086A6 }, /* GL_WEIGHT_SUM_UNITY_ARB */
- { 51765, 0x000081D4 }, /* GL_WRAP_BORDER_SUN */
- { 51784, 0x000088B9 }, /* GL_WRITE_ONLY */
- { 51798, 0x000088B9 }, /* GL_WRITE_ONLY_ARB */
- { 51816, 0x000088B9 }, /* GL_WRITE_ONLY_OES */
- { 51834, 0x00001506 }, /* GL_XOR */
- { 51841, 0x000085B9 }, /* GL_YCBCR_422_APPLE */
- { 51860, 0x00008757 }, /* GL_YCBCR_MESA */
- { 51874, 0x00000000 }, /* GL_ZERO */
- { 51882, 0x00000D16 }, /* GL_ZOOM_X */
- { 51892, 0x00000D17 }, /* GL_ZOOM_Y */
-};
-
-static const unsigned reduced_enums[1562] =
-{
- 539, /* GL_FALSE */
- 834, /* GL_LINES */
- 838, /* GL_LINE_LOOP */
- 845, /* GL_LINE_STRIP */
- 2152, /* GL_TRIANGLES */
- 2157, /* GL_TRIANGLE_STRIP */
- 2155, /* GL_TRIANGLE_FAN */
- 1517, /* GL_QUADS */
- 1521, /* GL_QUAD_STRIP */
- 1388, /* GL_POLYGON */
- 835, /* GL_LINES_ADJACENCY */
- 846, /* GL_LINE_STRIP_ADJACENCY */
- 2153, /* GL_TRIANGLES_ADJACENCY */
- 2158, /* GL_TRIANGLE_STRIP_ADJACENCY */
- 1400, /* GL_POLYGON_STIPPLE_BIT */
- 1343, /* GL_PIXEL_MODE_BIT */
- 821, /* GL_LIGHTING_BIT */
- 573, /* GL_FOG_BIT */
- 8, /* GL_ACCUM */
- 857, /* GL_LOAD */
- 1607, /* GL_RETURN */
- 1209, /* GL_MULT */
- 24, /* GL_ADD */
- 1225, /* GL_NEVER */
- 811, /* GL_LESS */
- 529, /* GL_EQUAL */
- 810, /* GL_LEQUAL */
- 696, /* GL_GREATER */
- 1242, /* GL_NOTEQUAL */
- 695, /* GL_GEQUAL */
- 55, /* GL_ALWAYS */
- 1816, /* GL_SRC_COLOR */
- 1276, /* GL_ONE_MINUS_SRC_COLOR */
- 1814, /* GL_SRC_ALPHA */
- 1275, /* GL_ONE_MINUS_SRC_ALPHA */
- 508, /* GL_DST_ALPHA */
- 1273, /* GL_ONE_MINUS_DST_ALPHA */
- 509, /* GL_DST_COLOR */
- 1274, /* GL_ONE_MINUS_DST_COLOR */
- 1815, /* GL_SRC_ALPHA_SATURATE */
- 672, /* GL_FRONT_LEFT */
- 673, /* GL_FRONT_RIGHT */
- 77, /* GL_BACK_LEFT */
- 78, /* GL_BACK_RIGHT */
- 669, /* GL_FRONT */
- 76, /* GL_BACK */
- 809, /* GL_LEFT */
- 1697, /* GL_RIGHT */
- 670, /* GL_FRONT_AND_BACK */
- 71, /* GL_AUX0 */
- 72, /* GL_AUX1 */
- 73, /* GL_AUX2 */
- 74, /* GL_AUX3 */
- 797, /* GL_INVALID_ENUM */
- 802, /* GL_INVALID_VALUE */
- 801, /* GL_INVALID_OPERATION */
- 1821, /* GL_STACK_OVERFLOW */
- 1822, /* GL_STACK_UNDERFLOW */
- 1301, /* GL_OUT_OF_MEMORY */
- 798, /* GL_INVALID_FRAMEBUFFER_OPERATION */
- 0, /* GL_2D */
- 2, /* GL_3D */
- 3, /* GL_3D_COLOR */
- 4, /* GL_3D_COLOR_TEXTURE */
- 6, /* GL_4D_COLOR_TEXTURE */
- 1321, /* GL_PASS_THROUGH_TOKEN */
- 1387, /* GL_POINT_TOKEN */
- 848, /* GL_LINE_TOKEN */
- 1401, /* GL_POLYGON_TOKEN */
- 87, /* GL_BITMAP_TOKEN */
- 507, /* GL_DRAW_PIXEL_TOKEN */
- 353, /* GL_COPY_PIXEL_TOKEN */
- 839, /* GL_LINE_RESET_TOKEN */
- 532, /* GL_EXP */
- 533, /* GL_EXP2 */
- 390, /* GL_CW */
- 154, /* GL_CCW */
- 187, /* GL_COEFF */
- 1298, /* GL_ORDER */
- 444, /* GL_DOMAIN */
- 363, /* GL_CURRENT_COLOR */
- 366, /* GL_CURRENT_INDEX */
- 372, /* GL_CURRENT_NORMAL */
- 386, /* GL_CURRENT_TEXTURE_COORDS */
- 378, /* GL_CURRENT_RASTER_COLOR */
- 380, /* GL_CURRENT_RASTER_INDEX */
- 384, /* GL_CURRENT_RASTER_TEXTURE_COORDS */
- 381, /* GL_CURRENT_RASTER_POSITION */
- 382, /* GL_CURRENT_RASTER_POSITION_VALID */
- 379, /* GL_CURRENT_RASTER_DISTANCE */
- 1379, /* GL_POINT_SMOOTH */
- 1363, /* GL_POINT_SIZE */
- 1378, /* GL_POINT_SIZE_RANGE */
- 1369, /* GL_POINT_SIZE_GRANULARITY */
- 840, /* GL_LINE_SMOOTH */
- 849, /* GL_LINE_WIDTH */
- 851, /* GL_LINE_WIDTH_RANGE */
- 850, /* GL_LINE_WIDTH_GRANULARITY */
- 842, /* GL_LINE_STIPPLE */
- 843, /* GL_LINE_STIPPLE_PATTERN */
- 844, /* GL_LINE_STIPPLE_REPEAT */
- 856, /* GL_LIST_MODE */
- 1064, /* GL_MAX_LIST_NESTING */
- 853, /* GL_LIST_BASE */
- 855, /* GL_LIST_INDEX */
- 1390, /* GL_POLYGON_MODE */
- 1397, /* GL_POLYGON_SMOOTH */
- 1399, /* GL_POLYGON_STIPPLE */
- 518, /* GL_EDGE_FLAG */
- 356, /* GL_CULL_FACE */
- 357, /* GL_CULL_FACE_MODE */
- 671, /* GL_FRONT_FACE */
- 820, /* GL_LIGHTING */
- 825, /* GL_LIGHT_MODEL_LOCAL_VIEWER */
- 826, /* GL_LIGHT_MODEL_TWO_SIDE */
- 822, /* GL_LIGHT_MODEL_AMBIENT */
- 1763, /* GL_SHADE_MODEL */
- 235, /* GL_COLOR_MATERIAL_FACE */
- 236, /* GL_COLOR_MATERIAL_PARAMETER */
- 234, /* GL_COLOR_MATERIAL */
- 572, /* GL_FOG */
- 594, /* GL_FOG_INDEX */
- 590, /* GL_FOG_DENSITY */
- 598, /* GL_FOG_START */
- 592, /* GL_FOG_END */
- 595, /* GL_FOG_MODE */
- 574, /* GL_FOG_COLOR */
- 429, /* GL_DEPTH_RANGE */
- 438, /* GL_DEPTH_TEST */
- 441, /* GL_DEPTH_WRITEMASK */
- 414, /* GL_DEPTH_CLEAR_VALUE */
- 428, /* GL_DEPTH_FUNC */
- 12, /* GL_ACCUM_CLEAR_VALUE */
- 1866, /* GL_STENCIL_TEST */
- 1847, /* GL_STENCIL_CLEAR_VALUE */
- 1849, /* GL_STENCIL_FUNC */
- 1868, /* GL_STENCIL_VALUE_MASK */
- 1848, /* GL_STENCIL_FAIL */
- 1863, /* GL_STENCIL_PASS_DEPTH_FAIL */
- 1864, /* GL_STENCIL_PASS_DEPTH_PASS */
- 1865, /* GL_STENCIL_REF */
- 1869, /* GL_STENCIL_WRITEMASK */
- 1014, /* GL_MATRIX_MODE */
- 1231, /* GL_NORMALIZE */
- 2285, /* GL_VIEWPORT */
- 1204, /* GL_MODELVIEW_STACK_DEPTH */
- 1491, /* GL_PROJECTION_STACK_DEPTH */
- 2106, /* GL_TEXTURE_STACK_DEPTH */
- 1201, /* GL_MODELVIEW_MATRIX */
- 1489, /* GL_PROJECTION_MATRIX */
- 2086, /* GL_TEXTURE_MATRIX */
- 69, /* GL_ATTRIB_STACK_DEPTH */
- 169, /* GL_CLIENT_ATTRIB_STACK_DEPTH */
- 51, /* GL_ALPHA_TEST */
- 52, /* GL_ALPHA_TEST_FUNC */
- 53, /* GL_ALPHA_TEST_REF */
- 443, /* GL_DITHER */
- 91, /* GL_BLEND_DST */
- 105, /* GL_BLEND_SRC */
- 88, /* GL_BLEND */
- 859, /* GL_LOGIC_OP_MODE */
- 745, /* GL_INDEX_LOGIC_OP */
- 233, /* GL_COLOR_LOGIC_OP */
- 75, /* GL_AUX_BUFFERS */
- 454, /* GL_DRAW_BUFFER */
- 1544, /* GL_READ_BUFFER */
- 1740, /* GL_SCISSOR_BOX */
- 1741, /* GL_SCISSOR_TEST */
- 744, /* GL_INDEX_CLEAR_VALUE */
- 749, /* GL_INDEX_WRITEMASK */
- 230, /* GL_COLOR_CLEAR_VALUE */
- 272, /* GL_COLOR_WRITEMASK */
- 746, /* GL_INDEX_MODE */
- 1686, /* GL_RGBA_MODE */
- 453, /* GL_DOUBLEBUFFER */
- 1870, /* GL_STEREO */
- 1598, /* GL_RENDER_MODE */
- 1322, /* GL_PERSPECTIVE_CORRECTION_HINT */
- 1380, /* GL_POINT_SMOOTH_HINT */
- 841, /* GL_LINE_SMOOTH_HINT */
- 1398, /* GL_POLYGON_SMOOTH_HINT */
- 593, /* GL_FOG_HINT */
- 2066, /* GL_TEXTURE_GEN_S */
- 2068, /* GL_TEXTURE_GEN_T */
- 2065, /* GL_TEXTURE_GEN_R */
- 2064, /* GL_TEXTURE_GEN_Q */
- 1335, /* GL_PIXEL_MAP_I_TO_I */
- 1341, /* GL_PIXEL_MAP_S_TO_S */
- 1337, /* GL_PIXEL_MAP_I_TO_R */
- 1333, /* GL_PIXEL_MAP_I_TO_G */
- 1331, /* GL_PIXEL_MAP_I_TO_B */
- 1329, /* GL_PIXEL_MAP_I_TO_A */
- 1339, /* GL_PIXEL_MAP_R_TO_R */
- 1327, /* GL_PIXEL_MAP_G_TO_G */
- 1325, /* GL_PIXEL_MAP_B_TO_B */
- 1323, /* GL_PIXEL_MAP_A_TO_A */
- 1336, /* GL_PIXEL_MAP_I_TO_I_SIZE */
- 1342, /* GL_PIXEL_MAP_S_TO_S_SIZE */
- 1338, /* GL_PIXEL_MAP_I_TO_R_SIZE */
- 1334, /* GL_PIXEL_MAP_I_TO_G_SIZE */
- 1332, /* GL_PIXEL_MAP_I_TO_B_SIZE */
- 1330, /* GL_PIXEL_MAP_I_TO_A_SIZE */
- 1340, /* GL_PIXEL_MAP_R_TO_R_SIZE */
- 1328, /* GL_PIXEL_MAP_G_TO_G_SIZE */
- 1326, /* GL_PIXEL_MAP_B_TO_B_SIZE */
- 1324, /* GL_PIXEL_MAP_A_TO_A_SIZE */
- 2170, /* GL_UNPACK_SWAP_BYTES */
- 2165, /* GL_UNPACK_LSB_FIRST */
- 2166, /* GL_UNPACK_ROW_LENGTH */
- 2169, /* GL_UNPACK_SKIP_ROWS */
- 2168, /* GL_UNPACK_SKIP_PIXELS */
- 2163, /* GL_UNPACK_ALIGNMENT */
- 1310, /* GL_PACK_SWAP_BYTES */
- 1305, /* GL_PACK_LSB_FIRST */
- 1306, /* GL_PACK_ROW_LENGTH */
- 1309, /* GL_PACK_SKIP_ROWS */
- 1308, /* GL_PACK_SKIP_PIXELS */
- 1302, /* GL_PACK_ALIGNMENT */
- 955, /* GL_MAP_COLOR */
- 960, /* GL_MAP_STENCIL */
- 748, /* GL_INDEX_SHIFT */
- 747, /* GL_INDEX_OFFSET */
- 1560, /* GL_RED_SCALE */
- 1556, /* GL_RED_BIAS */
- 2311, /* GL_ZOOM_X */
- 2312, /* GL_ZOOM_Y */
- 702, /* GL_GREEN_SCALE */
- 698, /* GL_GREEN_BIAS */
- 115, /* GL_BLUE_SCALE */
- 111, /* GL_BLUE_BIAS */
- 50, /* GL_ALPHA_SCALE */
- 47, /* GL_ALPHA_BIAS */
- 430, /* GL_DEPTH_SCALE */
- 406, /* GL_DEPTH_BIAS */
- 1046, /* GL_MAX_EVAL_ORDER */
- 1063, /* GL_MAX_LIGHTS */
- 1026, /* GL_MAX_CLIP_DISTANCES */
- 1119, /* GL_MAX_TEXTURE_SIZE */
- 1070, /* GL_MAX_PIXEL_MAP_TABLE */
- 1022, /* GL_MAX_ATTRIB_STACK_DEPTH */
- 1066, /* GL_MAX_MODELVIEW_STACK_DEPTH */
- 1067, /* GL_MAX_NAME_STACK_DEPTH */
- 1098, /* GL_MAX_PROJECTION_STACK_DEPTH */
- 1120, /* GL_MAX_TEXTURE_STACK_DEPTH */
- 1146, /* GL_MAX_VIEWPORT_DIMS */
- 1023, /* GL_MAX_CLIENT_ATTRIB_STACK_DEPTH */
- 1880, /* GL_SUBPIXEL_BITS */
- 743, /* GL_INDEX_BITS */
- 1557, /* GL_RED_BITS */
- 699, /* GL_GREEN_BITS */
- 112, /* GL_BLUE_BITS */
- 48, /* GL_ALPHA_BITS */
- 407, /* GL_DEPTH_BITS */
- 1844, /* GL_STENCIL_BITS */
- 14, /* GL_ACCUM_RED_BITS */
- 13, /* GL_ACCUM_GREEN_BITS */
- 10, /* GL_ACCUM_BLUE_BITS */
- 9, /* GL_ACCUM_ALPHA_BITS */
- 1218, /* GL_NAME_STACK_DEPTH */
- 70, /* GL_AUTO_NORMAL */
- 901, /* GL_MAP1_COLOR_4 */
- 904, /* GL_MAP1_INDEX */
- 905, /* GL_MAP1_NORMAL */
- 906, /* GL_MAP1_TEXTURE_COORD_1 */
- 907, /* GL_MAP1_TEXTURE_COORD_2 */
- 908, /* GL_MAP1_TEXTURE_COORD_3 */
- 909, /* GL_MAP1_TEXTURE_COORD_4 */
- 910, /* GL_MAP1_VERTEX_3 */
- 911, /* GL_MAP1_VERTEX_4 */
- 928, /* GL_MAP2_COLOR_4 */
- 931, /* GL_MAP2_INDEX */
- 932, /* GL_MAP2_NORMAL */
- 933, /* GL_MAP2_TEXTURE_COORD_1 */
- 934, /* GL_MAP2_TEXTURE_COORD_2 */
- 935, /* GL_MAP2_TEXTURE_COORD_3 */
- 936, /* GL_MAP2_TEXTURE_COORD_4 */
- 937, /* GL_MAP2_VERTEX_3 */
- 938, /* GL_MAP2_VERTEX_4 */
- 902, /* GL_MAP1_GRID_DOMAIN */
- 903, /* GL_MAP1_GRID_SEGMENTS */
- 929, /* GL_MAP2_GRID_DOMAIN */
- 930, /* GL_MAP2_GRID_SEGMENTS */
- 1963, /* GL_TEXTURE_1D */
- 1966, /* GL_TEXTURE_2D */
- 542, /* GL_FEEDBACK_BUFFER_POINTER */
- 543, /* GL_FEEDBACK_BUFFER_SIZE */
- 544, /* GL_FEEDBACK_BUFFER_TYPE */
- 1750, /* GL_SELECTION_BUFFER_POINTER */
- 1751, /* GL_SELECTION_BUFFER_SIZE */
- 2112, /* GL_TEXTURE_WIDTH */
- 2072, /* GL_TEXTURE_HEIGHT */
- 2016, /* GL_TEXTURE_COMPONENTS */
- 1994, /* GL_TEXTURE_BORDER_COLOR */
- 1993, /* GL_TEXTURE_BORDER */
- 445, /* GL_DONT_CARE */
- 540, /* GL_FASTEST */
- 1226, /* GL_NICEST */
- 56, /* GL_AMBIENT */
- 442, /* GL_DIFFUSE */
- 1803, /* GL_SPECULAR */
- 1402, /* GL_POSITION */
- 1806, /* GL_SPOT_DIRECTION */
- 1807, /* GL_SPOT_EXPONENT */
- 1805, /* GL_SPOT_CUTOFF */
- 320, /* GL_CONSTANT_ATTENUATION */
- 829, /* GL_LINEAR_ATTENUATION */
- 1516, /* GL_QUADRATIC_ATTENUATION */
- 287, /* GL_COMPILE */
- 288, /* GL_COMPILE_AND_EXECUTE */
- 149, /* GL_BYTE */
- 2172, /* GL_UNSIGNED_BYTE */
- 1768, /* GL_SHORT */
- 2211, /* GL_UNSIGNED_SHORT */
- 752, /* GL_INT */
- 2175, /* GL_UNSIGNED_INT */
- 553, /* GL_FLOAT */
- 1, /* GL_2_BYTES */
- 5, /* GL_3_BYTES */
- 7, /* GL_4_BYTES */
- 452, /* GL_DOUBLE */
- 704, /* GL_HALF_FLOAT */
- 548, /* GL_FIXED */
- 165, /* GL_CLEAR */
- 58, /* GL_AND */
- 60, /* GL_AND_REVERSE */
- 351, /* GL_COPY */
- 59, /* GL_AND_INVERTED */
- 1229, /* GL_NOOP */
- 2307, /* GL_XOR */
- 1297, /* GL_OR */
- 1230, /* GL_NOR */
- 530, /* GL_EQUIV */
- 805, /* GL_INVERT */
- 1300, /* GL_OR_REVERSE */
- 352, /* GL_COPY_INVERTED */
- 1299, /* GL_OR_INVERTED */
- 1219, /* GL_NAND */
- 1757, /* GL_SET */
- 527, /* GL_EMISSION */
- 1767, /* GL_SHININESS */
- 57, /* GL_AMBIENT_AND_DIFFUSE */
- 232, /* GL_COLOR_INDEXES */
- 1168, /* GL_MODELVIEW */
- 1488, /* GL_PROJECTION */
- 1898, /* GL_TEXTURE */
- 188, /* GL_COLOR */
- 399, /* GL_DEPTH */
- 1829, /* GL_STENCIL */
- 231, /* GL_COLOR_INDEX */
- 1850, /* GL_STENCIL_INDEX */
- 415, /* GL_DEPTH_COMPONENT */
- 1553, /* GL_RED */
- 697, /* GL_GREEN */
- 110, /* GL_BLUE */
- 32, /* GL_ALPHA */
- 1610, /* GL_RGB */
- 1650, /* GL_RGBA */
- 864, /* GL_LUMINANCE */
- 891, /* GL_LUMINANCE_ALPHA */
- 86, /* GL_BITMAP */
- 1352, /* GL_POINT */
- 827, /* GL_LINE */
- 545, /* GL_FILL */
- 1567, /* GL_RENDER */
- 541, /* GL_FEEDBACK */
- 1749, /* GL_SELECT */
- 552, /* GL_FLAT */
- 1778, /* GL_SMOOTH */
- 806, /* GL_KEEP */
- 1600, /* GL_REPLACE */
- 733, /* GL_INCR */
- 395, /* GL_DECR */
- 2228, /* GL_VENDOR */
- 1597, /* GL_RENDERER */
- 2229, /* GL_VERSION */
- 534, /* GL_EXTENSIONS */
- 1698, /* GL_S */
- 1889, /* GL_T */
- 1536, /* GL_R */
- 1515, /* GL_Q */
- 1205, /* GL_MODULATE */
- 394, /* GL_DECAL */
- 2059, /* GL_TEXTURE_ENV_MODE */
- 2058, /* GL_TEXTURE_ENV_COLOR */
- 2057, /* GL_TEXTURE_ENV */
- 535, /* GL_EYE_LINEAR */
- 1258, /* GL_OBJECT_LINEAR */
- 1804, /* GL_SPHERE_MAP */
- 2062, /* GL_TEXTURE_GEN_MODE */
- 1260, /* GL_OBJECT_PLANE */
- 536, /* GL_EYE_PLANE */
- 1220, /* GL_NEAREST */
- 828, /* GL_LINEAR */
- 1224, /* GL_NEAREST_MIPMAP_NEAREST */
- 833, /* GL_LINEAR_MIPMAP_NEAREST */
- 1223, /* GL_NEAREST_MIPMAP_LINEAR */
- 832, /* GL_LINEAR_MIPMAP_LINEAR */
- 2085, /* GL_TEXTURE_MAG_FILTER */
- 2094, /* GL_TEXTURE_MIN_FILTER */
- 2115, /* GL_TEXTURE_WRAP_S */
- 2116, /* GL_TEXTURE_WRAP_T */
- 155, /* GL_CLAMP */
- 1599, /* GL_REPEAT */
- 1396, /* GL_POLYGON_OFFSET_UNITS */
- 1395, /* GL_POLYGON_OFFSET_POINT */
- 1394, /* GL_POLYGON_OFFSET_LINE */
- 1539, /* GL_R3_G3_B2 */
- 2225, /* GL_V2F */
- 2226, /* GL_V3F */
- 152, /* GL_C4UB_V2F */
- 153, /* GL_C4UB_V3F */
- 150, /* GL_C3F_V3F */
- 1217, /* GL_N3F_V3F */
- 151, /* GL_C4F_N3F_V3F */
- 1894, /* GL_T2F_V3F */
- 1896, /* GL_T4F_V4F */
- 1892, /* GL_T2F_C4UB_V3F */
- 1890, /* GL_T2F_C3F_V3F */
- 1893, /* GL_T2F_N3F_V3F */
- 1891, /* GL_T2F_C4F_N3F_V3F */
- 1895, /* GL_T4F_C4F_N3F_V4F */
- 172, /* GL_CLIP_DISTANCE0 */
- 173, /* GL_CLIP_DISTANCE1 */
- 174, /* GL_CLIP_DISTANCE2 */
- 175, /* GL_CLIP_DISTANCE3 */
- 176, /* GL_CLIP_DISTANCE4 */
- 177, /* GL_CLIP_DISTANCE5 */
- 178, /* GL_CLIP_DISTANCE6 */
- 179, /* GL_CLIP_DISTANCE7 */
- 812, /* GL_LIGHT0 */
- 813, /* GL_LIGHT1 */
- 814, /* GL_LIGHT2 */
- 815, /* GL_LIGHT3 */
- 816, /* GL_LIGHT4 */
- 817, /* GL_LIGHT5 */
- 818, /* GL_LIGHT6 */
- 819, /* GL_LIGHT7 */
- 708, /* GL_HINT_BIT */
- 322, /* GL_CONSTANT_COLOR */
- 1271, /* GL_ONE_MINUS_CONSTANT_COLOR */
- 317, /* GL_CONSTANT_ALPHA */
- 1269, /* GL_ONE_MINUS_CONSTANT_ALPHA */
- 89, /* GL_BLEND_COLOR */
- 674, /* GL_FUNC_ADD */
- 1149, /* GL_MIN */
- 1017, /* GL_MAX */
- 96, /* GL_BLEND_EQUATION */
- 680, /* GL_FUNC_SUBTRACT */
- 677, /* GL_FUNC_REVERSE_SUBTRACT */
- 331, /* GL_CONVOLUTION_1D */
- 332, /* GL_CONVOLUTION_2D */
- 1752, /* GL_SEPARABLE_2D */
- 335, /* GL_CONVOLUTION_BORDER_MODE */
- 339, /* GL_CONVOLUTION_FILTER_SCALE */
- 337, /* GL_CONVOLUTION_FILTER_BIAS */
- 1554, /* GL_REDUCE */
- 341, /* GL_CONVOLUTION_FORMAT */
- 345, /* GL_CONVOLUTION_WIDTH */
- 343, /* GL_CONVOLUTION_HEIGHT */
- 1036, /* GL_MAX_CONVOLUTION_WIDTH */
- 1034, /* GL_MAX_CONVOLUTION_HEIGHT */
- 1435, /* GL_POST_CONVOLUTION_RED_SCALE */
- 1431, /* GL_POST_CONVOLUTION_GREEN_SCALE */
- 1426, /* GL_POST_CONVOLUTION_BLUE_SCALE */
- 1422, /* GL_POST_CONVOLUTION_ALPHA_SCALE */
- 1433, /* GL_POST_CONVOLUTION_RED_BIAS */
- 1429, /* GL_POST_CONVOLUTION_GREEN_BIAS */
- 1424, /* GL_POST_CONVOLUTION_BLUE_BIAS */
- 1420, /* GL_POST_CONVOLUTION_ALPHA_BIAS */
- 709, /* GL_HISTOGRAM */
- 1495, /* GL_PROXY_HISTOGRAM */
- 725, /* GL_HISTOGRAM_WIDTH */
- 715, /* GL_HISTOGRAM_FORMAT */
- 721, /* GL_HISTOGRAM_RED_SIZE */
- 717, /* GL_HISTOGRAM_GREEN_SIZE */
- 712, /* GL_HISTOGRAM_BLUE_SIZE */
- 710, /* GL_HISTOGRAM_ALPHA_SIZE */
- 719, /* GL_HISTOGRAM_LUMINANCE_SIZE */
- 723, /* GL_HISTOGRAM_SINK */
- 1150, /* GL_MINMAX */
- 1152, /* GL_MINMAX_FORMAT */
- 1154, /* GL_MINMAX_SINK */
- 1897, /* GL_TABLE_TOO_LARGE_EXT */
- 2174, /* GL_UNSIGNED_BYTE_3_3_2 */
- 2214, /* GL_UNSIGNED_SHORT_4_4_4_4 */
- 2217, /* GL_UNSIGNED_SHORT_5_5_5_1 */
- 2186, /* GL_UNSIGNED_INT_8_8_8_8 */
- 2177, /* GL_UNSIGNED_INT_10_10_10_2 */
- 1393, /* GL_POLYGON_OFFSET_FILL */
- 1392, /* GL_POLYGON_OFFSET_FACTOR */
- 1391, /* GL_POLYGON_OFFSET_BIAS */
- 1603, /* GL_RESCALE_NORMAL */
- 41, /* GL_ALPHA4 */
- 43, /* GL_ALPHA8 */
- 33, /* GL_ALPHA12 */
- 35, /* GL_ALPHA16 */
- 879, /* GL_LUMINANCE4 */
- 885, /* GL_LUMINANCE8 */
- 865, /* GL_LUMINANCE12 */
- 871, /* GL_LUMINANCE16 */
- 880, /* GL_LUMINANCE4_ALPHA4 */
- 883, /* GL_LUMINANCE6_ALPHA2 */
- 888, /* GL_LUMINANCE8_ALPHA8 */
- 868, /* GL_LUMINANCE12_ALPHA4 */
- 866, /* GL_LUMINANCE12_ALPHA12 */
- 874, /* GL_LUMINANCE16_ALPHA16 */
- 753, /* GL_INTENSITY */
- 762, /* GL_INTENSITY4 */
- 764, /* GL_INTENSITY8 */
- 754, /* GL_INTENSITY12 */
- 756, /* GL_INTENSITY16 */
- 1625, /* GL_RGB2_EXT */
- 1631, /* GL_RGB4 */
- 1634, /* GL_RGB5 */
- 1641, /* GL_RGB8 */
- 1611, /* GL_RGB10 */
- 1615, /* GL_RGB12 */
- 1617, /* GL_RGB16 */
- 1661, /* GL_RGBA2 */
- 1668, /* GL_RGBA4 */
- 1637, /* GL_RGB5_A1 */
- 1673, /* GL_RGBA8 */
- 1612, /* GL_RGB10_A2 */
- 1651, /* GL_RGBA12 */
- 1653, /* GL_RGBA16 */
- 2102, /* GL_TEXTURE_RED_SIZE */
- 2070, /* GL_TEXTURE_GREEN_SIZE */
- 1991, /* GL_TEXTURE_BLUE_SIZE */
- 1971, /* GL_TEXTURE_ALPHA_SIZE */
- 2083, /* GL_TEXTURE_LUMINANCE_SIZE */
- 2074, /* GL_TEXTURE_INTENSITY_SIZE */
- 1601, /* GL_REPLACE_EXT */
- 1499, /* GL_PROXY_TEXTURE_1D */
- 1503, /* GL_PROXY_TEXTURE_2D */
- 2110, /* GL_TEXTURE_TOO_LARGE_EXT */
- 2096, /* GL_TEXTURE_PRIORITY */
- 2104, /* GL_TEXTURE_RESIDENT */
- 1974, /* GL_TEXTURE_BINDING_1D */
- 1977, /* GL_TEXTURE_BINDING_2D */
- 1980, /* GL_TEXTURE_BINDING_3D */
- 1307, /* GL_PACK_SKIP_IMAGES */
- 1303, /* GL_PACK_IMAGE_HEIGHT */
- 2167, /* GL_UNPACK_SKIP_IMAGES */
- 2164, /* GL_UNPACK_IMAGE_HEIGHT */
- 1969, /* GL_TEXTURE_3D */
- 1507, /* GL_PROXY_TEXTURE_3D */
- 2054, /* GL_TEXTURE_DEPTH */
- 2113, /* GL_TEXTURE_WRAP_R */
- 1018, /* GL_MAX_3D_TEXTURE_SIZE */
- 2230, /* GL_VERTEX_ARRAY */
- 1232, /* GL_NORMAL_ARRAY */
- 189, /* GL_COLOR_ARRAY */
- 737, /* GL_INDEX_ARRAY */
- 2024, /* GL_TEXTURE_COORD_ARRAY */
- 519, /* GL_EDGE_FLAG_ARRAY */
- 2236, /* GL_VERTEX_ARRAY_SIZE */
- 2238, /* GL_VERTEX_ARRAY_TYPE */
- 2237, /* GL_VERTEX_ARRAY_STRIDE */
- 1237, /* GL_NORMAL_ARRAY_TYPE */
- 1236, /* GL_NORMAL_ARRAY_STRIDE */
- 193, /* GL_COLOR_ARRAY_SIZE */
- 195, /* GL_COLOR_ARRAY_TYPE */
- 194, /* GL_COLOR_ARRAY_STRIDE */
- 742, /* GL_INDEX_ARRAY_TYPE */
- 741, /* GL_INDEX_ARRAY_STRIDE */
- 2028, /* GL_TEXTURE_COORD_ARRAY_SIZE */
- 2030, /* GL_TEXTURE_COORD_ARRAY_TYPE */
- 2029, /* GL_TEXTURE_COORD_ARRAY_STRIDE */
- 523, /* GL_EDGE_FLAG_ARRAY_STRIDE */
- 2235, /* GL_VERTEX_ARRAY_POINTER */
- 1235, /* GL_NORMAL_ARRAY_POINTER */
- 192, /* GL_COLOR_ARRAY_POINTER */
- 740, /* GL_INDEX_ARRAY_POINTER */
- 2027, /* GL_TEXTURE_COORD_ARRAY_POINTER */
- 522, /* GL_EDGE_FLAG_ARRAY_POINTER */
- 1210, /* GL_MULTISAMPLE */
- 1726, /* GL_SAMPLE_ALPHA_TO_COVERAGE */
- 1728, /* GL_SAMPLE_ALPHA_TO_ONE */
- 1733, /* GL_SAMPLE_COVERAGE */
- 1730, /* GL_SAMPLE_BUFFERS */
- 1721, /* GL_SAMPLES */
- 1737, /* GL_SAMPLE_COVERAGE_VALUE */
- 1735, /* GL_SAMPLE_COVERAGE_INVERT */
- 237, /* GL_COLOR_MATRIX */
- 239, /* GL_COLOR_MATRIX_STACK_DEPTH */
- 1030, /* GL_MAX_COLOR_MATRIX_STACK_DEPTH */
- 1418, /* GL_POST_COLOR_MATRIX_RED_SCALE */
- 1414, /* GL_POST_COLOR_MATRIX_GREEN_SCALE */
- 1409, /* GL_POST_COLOR_MATRIX_BLUE_SCALE */
- 1405, /* GL_POST_COLOR_MATRIX_ALPHA_SCALE */
- 1416, /* GL_POST_COLOR_MATRIX_RED_BIAS */
- 1412, /* GL_POST_COLOR_MATRIX_GREEN_BIAS */
- 1407, /* GL_POST_COLOR_MATRIX_BLUE_BIAS */
- 1403, /* GL_POST_COLOR_MATRIX_ALPHA_BIAS */
- 2007, /* GL_TEXTURE_COLOR_TABLE_SGI */
- 1508, /* GL_PROXY_TEXTURE_COLOR_TABLE_SGI */
- 2009, /* GL_TEXTURE_COMPARE_FAIL_VALUE_ARB */
- 94, /* GL_BLEND_DST_RGB */
- 108, /* GL_BLEND_SRC_RGB */
- 92, /* GL_BLEND_DST_ALPHA */
- 106, /* GL_BLEND_SRC_ALPHA */
- 243, /* GL_COLOR_TABLE */
- 1428, /* GL_POST_CONVOLUTION_COLOR_TABLE */
- 1411, /* GL_POST_COLOR_MATRIX_COLOR_TABLE */
- 1494, /* GL_PROXY_COLOR_TABLE */
- 1498, /* GL_PROXY_POST_CONVOLUTION_COLOR_TABLE */
- 1497, /* GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE */
- 267, /* GL_COLOR_TABLE_SCALE */
- 247, /* GL_COLOR_TABLE_BIAS */
- 252, /* GL_COLOR_TABLE_FORMAT */
- 269, /* GL_COLOR_TABLE_WIDTH */
- 264, /* GL_COLOR_TABLE_RED_SIZE */
- 255, /* GL_COLOR_TABLE_GREEN_SIZE */
- 249, /* GL_COLOR_TABLE_BLUE_SIZE */
- 244, /* GL_COLOR_TABLE_ALPHA_SIZE */
- 261, /* GL_COLOR_TABLE_LUMINANCE_SIZE */
- 258, /* GL_COLOR_TABLE_INTENSITY_SIZE */
- 79, /* GL_BGR */
- 80, /* GL_BGRA */
- 1045, /* GL_MAX_ELEMENTS_VERTICES */
- 1044, /* GL_MAX_ELEMENTS_INDICES */
- 2073, /* GL_TEXTURE_INDEX_SIZE_EXT */
- 186, /* GL_CLIP_VOLUME_CLIPPING_HINT_EXT */
- 1374, /* GL_POINT_SIZE_MIN */
- 1370, /* GL_POINT_SIZE_MAX */
- 1359, /* GL_POINT_FADE_THRESHOLD_SIZE */
- 1355, /* GL_POINT_DISTANCE_ATTENUATION */
- 159, /* GL_CLAMP_TO_BORDER */
- 162, /* GL_CLAMP_TO_EDGE */
- 2095, /* GL_TEXTURE_MIN_LOD */
- 2093, /* GL_TEXTURE_MAX_LOD */
- 1973, /* GL_TEXTURE_BASE_LEVEL */
- 2092, /* GL_TEXTURE_MAX_LEVEL */
- 728, /* GL_IGNORE_BORDER_HP */
- 321, /* GL_CONSTANT_BORDER_HP */
- 1602, /* GL_REPLICATE_BORDER_HP */
- 333, /* GL_CONVOLUTION_BORDER_COLOR */
- 1266, /* GL_OCCLUSION_TEST_HP */
- 1267, /* GL_OCCLUSION_TEST_RESULT_HP */
- 830, /* GL_LINEAR_CLIPMAP_LINEAR_SGIX */
- 2001, /* GL_TEXTURE_CLIPMAP_CENTER_SGIX */
- 2003, /* GL_TEXTURE_CLIPMAP_FRAME_SGIX */
- 2005, /* GL_TEXTURE_CLIPMAP_OFFSET_SGIX */
- 2006, /* GL_TEXTURE_CLIPMAP_VIRTUAL_DEPTH_SGIX */
- 2004, /* GL_TEXTURE_CLIPMAP_LOD_OFFSET_SGIX */
- 2002, /* GL_TEXTURE_CLIPMAP_DEPTH_SGIX */
- 1024, /* GL_MAX_CLIPMAP_DEPTH_SGIX */
- 1025, /* GL_MAX_CLIPMAP_VIRTUAL_DEPTH_SGIX */
- 1438, /* GL_POST_TEXTURE_FILTER_BIAS_SGIX */
- 1440, /* GL_POST_TEXTURE_FILTER_SCALE_SGIX */
- 1437, /* GL_POST_TEXTURE_FILTER_BIAS_RANGE_SGIX */
- 1439, /* GL_POST_TEXTURE_FILTER_SCALE_RANGE_SGIX */
- 2081, /* GL_TEXTURE_LOD_BIAS_S_SGIX */
- 2082, /* GL_TEXTURE_LOD_BIAS_T_SGIX */
- 2080, /* GL_TEXTURE_LOD_BIAS_R_SGIX */
- 683, /* GL_GENERATE_MIPMAP */
- 684, /* GL_GENERATE_MIPMAP_HINT */
- 596, /* GL_FOG_OFFSET_SGIX */
- 597, /* GL_FOG_OFFSET_VALUE_SGIX */
- 2015, /* GL_TEXTURE_COMPARE_SGIX */
- 2014, /* GL_TEXTURE_COMPARE_OPERATOR_SGIX */
- 2077, /* GL_TEXTURE_LEQUAL_R_SGIX */
- 2069, /* GL_TEXTURE_GEQUAL_R_SGIX */
- 416, /* GL_DEPTH_COMPONENT16 */
- 420, /* GL_DEPTH_COMPONENT24 */
- 424, /* GL_DEPTH_COMPONENT32 */
- 358, /* GL_CULL_VERTEX_EXT */
- 360, /* GL_CULL_VERTEX_OBJECT_POSITION_EXT */
- 359, /* GL_CULL_VERTEX_EYE_POSITION_EXT */
- 2303, /* GL_WRAP_BORDER_SUN */
- 2008, /* GL_TEXTURE_COLOR_WRITEMASK_SGIS */
- 823, /* GL_LIGHT_MODEL_COLOR_CONTROL */
- 1771, /* GL_SINGLE_COLOR */
- 1755, /* GL_SEPARATE_SPECULAR_COLOR */
- 1766, /* GL_SHARED_TEXTURE_PALETTE_EXT */
- 608, /* GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING */
- 609, /* GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE */
- 620, /* GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE */
- 611, /* GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE */
- 607, /* GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE */
- 606, /* GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE */
- 610, /* GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE */
- 621, /* GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE */
- 638, /* GL_FRAMEBUFFER_DEFAULT */
- 665, /* GL_FRAMEBUFFER_UNDEFINED */
- 432, /* GL_DEPTH_STENCIL_ATTACHMENT */
- 900, /* GL_MAJOR_VERSION */
- 1156, /* GL_MINOR_VERSION */
- 1247, /* GL_NUM_EXTENSIONS */
- 327, /* GL_CONTEXT_FLAGS */
- 736, /* GL_INDEX */
- 410, /* GL_DEPTH_BUFFER */
- 1845, /* GL_STENCIL_BUFFER */
- 298, /* GL_COMPRESSED_RED */
- 299, /* GL_COMPRESSED_RG */
- 860, /* GL_LOSE_CONTEXT_ON_RESET_ARB */
- 703, /* GL_GUILTY_CONTEXT_RESET_ARB */
- 751, /* GL_INNOCENT_CONTEXT_RESET_ARB */
- 2162, /* GL_UNKNOWN_CONTEXT_RESET_ARB */
- 1605, /* GL_RESET_NOTIFICATION_STRATEGY_ARB */
- 1244, /* GL_NO_RESET_NOTIFICATION_ARB */
- 2173, /* GL_UNSIGNED_BYTE_2_3_3_REV */
- 2218, /* GL_UNSIGNED_SHORT_5_6_5 */
- 2219, /* GL_UNSIGNED_SHORT_5_6_5_REV */
- 2215, /* GL_UNSIGNED_SHORT_4_4_4_4_REV */
- 2212, /* GL_UNSIGNED_SHORT_1_5_5_5_REV */
- 2187, /* GL_UNSIGNED_INT_8_8_8_8_REV */
- 2183, /* GL_UNSIGNED_INT_2_10_10_10_REV */
- 2090, /* GL_TEXTURE_MAX_CLAMP_S_SGIX */
- 2091, /* GL_TEXTURE_MAX_CLAMP_T_SGIX */
- 2089, /* GL_TEXTURE_MAX_CLAMP_R_SGIX */
- 1160, /* GL_MIRRORED_REPEAT */
- 1691, /* GL_RGB_S3TC */
- 1633, /* GL_RGB4_S3TC */
- 1687, /* GL_RGBA_S3TC */
- 1672, /* GL_RGBA4_S3TC */
- 1681, /* GL_RGBA_DXT5_S3TC */
- 1669, /* GL_RGBA4_DXT5_S3TC */
- 309, /* GL_COMPRESSED_RGB_S3TC_DXT1_EXT */
- 304, /* GL_COMPRESSED_RGBA_S3TC_DXT1_EXT */
- 305, /* GL_COMPRESSED_RGBA_S3TC_DXT3_EXT */
- 306, /* GL_COMPRESSED_RGBA_S3TC_DXT5_EXT */
- 1222, /* GL_NEAREST_CLIPMAP_NEAREST_SGIX */
- 1221, /* GL_NEAREST_CLIPMAP_LINEAR_SGIX */
- 831, /* GL_LINEAR_CLIPMAP_NEAREST_SGIX */
- 583, /* GL_FOG_COORDINATE_SOURCE */
- 575, /* GL_FOG_COORD */
- 599, /* GL_FRAGMENT_DEPTH */
- 364, /* GL_CURRENT_FOG_COORD */
- 582, /* GL_FOG_COORDINATE_ARRAY_TYPE */
- 581, /* GL_FOG_COORDINATE_ARRAY_STRIDE */
- 580, /* GL_FOG_COORDINATE_ARRAY_POINTER */
- 577, /* GL_FOG_COORDINATE_ARRAY */
- 241, /* GL_COLOR_SUM */
- 385, /* GL_CURRENT_SECONDARY_COLOR */
- 1746, /* GL_SECONDARY_COLOR_ARRAY_SIZE */
- 1748, /* GL_SECONDARY_COLOR_ARRAY_TYPE */
- 1747, /* GL_SECONDARY_COLOR_ARRAY_STRIDE */
- 1745, /* GL_SECONDARY_COLOR_ARRAY_POINTER */
- 1742, /* GL_SECONDARY_COLOR_ARRAY */
- 383, /* GL_CURRENT_RASTER_SECONDARY_COLOR */
- 29, /* GL_ALIASED_POINT_SIZE_RANGE */
- 28, /* GL_ALIASED_LINE_WIDTH_RANGE */
- 1899, /* GL_TEXTURE0 */
- 1901, /* GL_TEXTURE1 */
- 1923, /* GL_TEXTURE2 */
- 1945, /* GL_TEXTURE3 */
- 1951, /* GL_TEXTURE4 */
- 1953, /* GL_TEXTURE5 */
- 1955, /* GL_TEXTURE6 */
- 1957, /* GL_TEXTURE7 */
- 1959, /* GL_TEXTURE8 */
- 1961, /* GL_TEXTURE9 */
- 1902, /* GL_TEXTURE10 */
- 1904, /* GL_TEXTURE11 */
- 1906, /* GL_TEXTURE12 */
- 1908, /* GL_TEXTURE13 */
- 1910, /* GL_TEXTURE14 */
- 1912, /* GL_TEXTURE15 */
- 1914, /* GL_TEXTURE16 */
- 1916, /* GL_TEXTURE17 */
- 1918, /* GL_TEXTURE18 */
- 1920, /* GL_TEXTURE19 */
- 1924, /* GL_TEXTURE20 */
- 1926, /* GL_TEXTURE21 */
- 1928, /* GL_TEXTURE22 */
- 1930, /* GL_TEXTURE23 */
- 1932, /* GL_TEXTURE24 */
- 1934, /* GL_TEXTURE25 */
- 1936, /* GL_TEXTURE26 */
- 1938, /* GL_TEXTURE27 */
- 1940, /* GL_TEXTURE28 */
- 1942, /* GL_TEXTURE29 */
- 1946, /* GL_TEXTURE30 */
- 1948, /* GL_TEXTURE31 */
- 19, /* GL_ACTIVE_TEXTURE */
- 166, /* GL_CLIENT_ACTIVE_TEXTURE */
- 1121, /* GL_MAX_TEXTURE_UNITS */
- 2145, /* GL_TRANSPOSE_MODELVIEW_MATRIX */
- 2148, /* GL_TRANSPOSE_PROJECTION_MATRIX */
- 2150, /* GL_TRANSPOSE_TEXTURE_MATRIX */
- 2142, /* GL_TRANSPOSE_COLOR_MATRIX */
- 1881, /* GL_SUBTRACT */
- 1102, /* GL_MAX_RENDERBUFFER_SIZE */
- 290, /* GL_COMPRESSED_ALPHA */
- 294, /* GL_COMPRESSED_LUMINANCE */
- 295, /* GL_COMPRESSED_LUMINANCE_ALPHA */
- 292, /* GL_COMPRESSED_INTENSITY */
- 300, /* GL_COMPRESSED_RGB */
- 301, /* GL_COMPRESSED_RGBA */
- 2022, /* GL_TEXTURE_COMPRESSION_HINT */
- 2099, /* GL_TEXTURE_RECTANGLE */
- 1987, /* GL_TEXTURE_BINDING_RECTANGLE */
- 1511, /* GL_PROXY_TEXTURE_RECTANGLE */
- 1099, /* GL_MAX_RECTANGLE_TEXTURE_SIZE */
- 431, /* GL_DEPTH_STENCIL */
- 2179, /* GL_UNSIGNED_INT_24_8 */
- 1116, /* GL_MAX_TEXTURE_LOD_BIAS */
- 2088, /* GL_TEXTURE_MAX_ANISOTROPY_EXT */
- 1118, /* GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT */
- 2060, /* GL_TEXTURE_FILTER_CONTROL */
- 2078, /* GL_TEXTURE_LOD_BIAS */
- 274, /* GL_COMBINE4 */
- 1108, /* GL_MAX_SHININESS_NV */
- 1109, /* GL_MAX_SPOT_EXPONENT_NV */
- 734, /* GL_INCR_WRAP */
- 396, /* GL_DECR_WRAP */
- 1180, /* GL_MODELVIEW1_ARB */
- 1238, /* GL_NORMAL_MAP */
- 1562, /* GL_REFLECTION_MAP */
- 2032, /* GL_TEXTURE_CUBE_MAP */
- 1984, /* GL_TEXTURE_BINDING_CUBE_MAP */
- 2044, /* GL_TEXTURE_CUBE_MAP_POSITIVE_X */
- 2034, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_X */
- 2047, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Y */
- 2037, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Y */
- 2050, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Z */
- 2040, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Z */
- 1509, /* GL_PROXY_TEXTURE_CUBE_MAP */
- 1038, /* GL_MAX_CUBE_MAP_TEXTURE_SIZE */
- 1216, /* GL_MULTISAMPLE_FILTER_HINT_NV */
- 1452, /* GL_PRIMITIVE_RESTART_NV */
- 1451, /* GL_PRIMITIVE_RESTART_INDEX_NV */
- 591, /* GL_FOG_DISTANCE_MODE_NV */
- 538, /* GL_EYE_RADIAL_NV */
- 537, /* GL_EYE_PLANE_ABSOLUTE_NV */
- 273, /* GL_COMBINE */
- 280, /* GL_COMBINE_RGB */
- 275, /* GL_COMBINE_ALPHA */
- 1692, /* GL_RGB_SCALE */
- 25, /* GL_ADD_SIGNED */
- 771, /* GL_INTERPOLATE */
- 316, /* GL_CONSTANT */
- 1444, /* GL_PRIMARY_COLOR */
- 1441, /* GL_PREVIOUS */
- 1786, /* GL_SOURCE0_RGB */
- 1792, /* GL_SOURCE1_RGB */
- 1798, /* GL_SOURCE2_RGB */
- 1802, /* GL_SOURCE3_RGB_NV */
- 1783, /* GL_SOURCE0_ALPHA */
- 1789, /* GL_SOURCE1_ALPHA */
- 1795, /* GL_SOURCE2_ALPHA */
- 1801, /* GL_SOURCE3_ALPHA_NV */
- 1280, /* GL_OPERAND0_RGB */
- 1286, /* GL_OPERAND1_RGB */
- 1292, /* GL_OPERAND2_RGB */
- 1296, /* GL_OPERAND3_RGB_NV */
- 1277, /* GL_OPERAND0_ALPHA */
- 1283, /* GL_OPERAND1_ALPHA */
- 1289, /* GL_OPERAND2_ALPHA */
- 1295, /* GL_OPERAND3_ALPHA_NV */
- 137, /* GL_BUFFER_OBJECT_APPLE */
- 2231, /* GL_VERTEX_ARRAY_BINDING */
- 2097, /* GL_TEXTURE_RANGE_LENGTH_APPLE */
- 2098, /* GL_TEXTURE_RANGE_POINTER_APPLE */
- 2308, /* GL_YCBCR_422_APPLE */
- 2220, /* GL_UNSIGNED_SHORT_8_8_APPLE */
- 2222, /* GL_UNSIGNED_SHORT_8_8_REV_APPLE */
- 2109, /* GL_TEXTURE_STORAGE_HINT_APPLE */
- 1872, /* GL_STORAGE_PRIVATE_APPLE */
- 1871, /* GL_STORAGE_CACHED_APPLE */
- 1873, /* GL_STORAGE_SHARED_APPLE */
- 1773, /* GL_SLICE_ACCUM_SUN */
- 1520, /* GL_QUAD_MESH_SUN */
- 2156, /* GL_TRIANGLE_MESH_SUN */
- 2273, /* GL_VERTEX_PROGRAM_ARB */
- 2284, /* GL_VERTEX_STATE_PROGRAM_NV */
- 2258, /* GL_VERTEX_ATTRIB_ARRAY_ENABLED */
- 2266, /* GL_VERTEX_ATTRIB_ARRAY_SIZE */
- 2268, /* GL_VERTEX_ATTRIB_ARRAY_STRIDE */
- 2270, /* GL_VERTEX_ATTRIB_ARRAY_TYPE */
- 387, /* GL_CURRENT_VERTEX_ATTRIB */
- 1465, /* GL_PROGRAM_LENGTH_ARB */
- 1481, /* GL_PROGRAM_STRING_ARB */
- 1203, /* GL_MODELVIEW_PROJECTION_NV */
- 727, /* GL_IDENTITY_NV */
- 803, /* GL_INVERSE_NV */
- 2147, /* GL_TRANSPOSE_NV */
- 804, /* GL_INVERSE_TRANSPOSE_NV */
- 1083, /* GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB */
- 1082, /* GL_MAX_PROGRAM_MATRICES_ARB */
- 964, /* GL_MATRIX0_NV */
- 976, /* GL_MATRIX1_NV */
- 988, /* GL_MATRIX2_NV */
- 992, /* GL_MATRIX3_NV */
- 994, /* GL_MATRIX4_NV */
- 996, /* GL_MATRIX5_NV */
- 998, /* GL_MATRIX6_NV */
- 1000, /* GL_MATRIX7_NV */
- 370, /* GL_CURRENT_MATRIX_STACK_DEPTH_ARB */
- 367, /* GL_CURRENT_MATRIX_ARB */
- 1478, /* GL_PROGRAM_POINT_SIZE */
- 2279, /* GL_VERTEX_PROGRAM_TWO_SIDE */
- 1477, /* GL_PROGRAM_PARAMETER_NV */
- 2264, /* GL_VERTEX_ATTRIB_ARRAY_POINTER */
- 1483, /* GL_PROGRAM_TARGET_NV */
- 1480, /* GL_PROGRAM_RESIDENT_NV */
- 2119, /* GL_TRACK_MATRIX_NV */
- 2120, /* GL_TRACK_MATRIX_TRANSFORM_NV */
- 2274, /* GL_VERTEX_PROGRAM_BINDING_NV */
- 1459, /* GL_PROGRAM_ERROR_POSITION_ARB */
- 412, /* GL_DEPTH_CLAMP */
- 2239, /* GL_VERTEX_ATTRIB_ARRAY0_NV */
- 2246, /* GL_VERTEX_ATTRIB_ARRAY1_NV */
- 2247, /* GL_VERTEX_ATTRIB_ARRAY2_NV */
- 2248, /* GL_VERTEX_ATTRIB_ARRAY3_NV */
- 2249, /* GL_VERTEX_ATTRIB_ARRAY4_NV */
- 2250, /* GL_VERTEX_ATTRIB_ARRAY5_NV */
- 2251, /* GL_VERTEX_ATTRIB_ARRAY6_NV */
- 2252, /* GL_VERTEX_ATTRIB_ARRAY7_NV */
- 2253, /* GL_VERTEX_ATTRIB_ARRAY8_NV */
- 2254, /* GL_VERTEX_ATTRIB_ARRAY9_NV */
- 2240, /* GL_VERTEX_ATTRIB_ARRAY10_NV */
- 2241, /* GL_VERTEX_ATTRIB_ARRAY11_NV */
- 2242, /* GL_VERTEX_ATTRIB_ARRAY12_NV */
- 2243, /* GL_VERTEX_ATTRIB_ARRAY13_NV */
- 2244, /* GL_VERTEX_ATTRIB_ARRAY14_NV */
- 2245, /* GL_VERTEX_ATTRIB_ARRAY15_NV */
- 912, /* GL_MAP1_VERTEX_ATTRIB0_4_NV */
- 919, /* GL_MAP1_VERTEX_ATTRIB1_4_NV */
- 920, /* GL_MAP1_VERTEX_ATTRIB2_4_NV */
- 921, /* GL_MAP1_VERTEX_ATTRIB3_4_NV */
- 922, /* GL_MAP1_VERTEX_ATTRIB4_4_NV */
- 923, /* GL_MAP1_VERTEX_ATTRIB5_4_NV */
- 924, /* GL_MAP1_VERTEX_ATTRIB6_4_NV */
- 925, /* GL_MAP1_VERTEX_ATTRIB7_4_NV */
- 926, /* GL_MAP1_VERTEX_ATTRIB8_4_NV */
- 927, /* GL_MAP1_VERTEX_ATTRIB9_4_NV */
- 913, /* GL_MAP1_VERTEX_ATTRIB10_4_NV */
- 914, /* GL_MAP1_VERTEX_ATTRIB11_4_NV */
- 915, /* GL_MAP1_VERTEX_ATTRIB12_4_NV */
- 916, /* GL_MAP1_VERTEX_ATTRIB13_4_NV */
- 917, /* GL_MAP1_VERTEX_ATTRIB14_4_NV */
- 918, /* GL_MAP1_VERTEX_ATTRIB15_4_NV */
- 939, /* GL_MAP2_VERTEX_ATTRIB0_4_NV */
- 946, /* GL_MAP2_VERTEX_ATTRIB1_4_NV */
- 947, /* GL_MAP2_VERTEX_ATTRIB2_4_NV */
- 948, /* GL_MAP2_VERTEX_ATTRIB3_4_NV */
- 949, /* GL_MAP2_VERTEX_ATTRIB4_4_NV */
- 950, /* GL_MAP2_VERTEX_ATTRIB5_4_NV */
- 951, /* GL_MAP2_VERTEX_ATTRIB6_4_NV */
- 1458, /* GL_PROGRAM_BINDING_ARB */
- 953, /* GL_MAP2_VERTEX_ATTRIB8_4_NV */
- 954, /* GL_MAP2_VERTEX_ATTRIB9_4_NV */
- 940, /* GL_MAP2_VERTEX_ATTRIB10_4_NV */
- 941, /* GL_MAP2_VERTEX_ATTRIB11_4_NV */
- 942, /* GL_MAP2_VERTEX_ATTRIB12_4_NV */
- 943, /* GL_MAP2_VERTEX_ATTRIB13_4_NV */
- 944, /* GL_MAP2_VERTEX_ATTRIB14_4_NV */
- 945, /* GL_MAP2_VERTEX_ATTRIB15_4_NV */
- 2020, /* GL_TEXTURE_COMPRESSED_IMAGE_SIZE */
- 2017, /* GL_TEXTURE_COMPRESSED */
- 1245, /* GL_NUM_COMPRESSED_TEXTURE_FORMATS */
- 314, /* GL_COMPRESSED_TEXTURE_FORMATS */
- 1143, /* GL_MAX_VERTEX_UNITS_ARB */
- 23, /* GL_ACTIVE_VERTEX_UNITS_ARB */
- 2302, /* GL_WEIGHT_SUM_UNITY_ARB */
- 2272, /* GL_VERTEX_BLEND_ARB */
- 389, /* GL_CURRENT_WEIGHT_ARB */
- 2300, /* GL_WEIGHT_ARRAY_TYPE_ARB */
- 2298, /* GL_WEIGHT_ARRAY_STRIDE_ARB */
- 2296, /* GL_WEIGHT_ARRAY_SIZE_ARB */
- 2294, /* GL_WEIGHT_ARRAY_POINTER_ARB */
- 2289, /* GL_WEIGHT_ARRAY_ARB */
- 446, /* GL_DOT3_RGB */
- 447, /* GL_DOT3_RGBA */
- 308, /* GL_COMPRESSED_RGB_FXT1_3DFX */
- 303, /* GL_COMPRESSED_RGBA_FXT1_3DFX */
- 1211, /* GL_MULTISAMPLE_3DFX */
- 1731, /* GL_SAMPLE_BUFFERS_3DFX */
- 1722, /* GL_SAMPLES_3DFX */
- 1191, /* GL_MODELVIEW2_ARB */
- 1194, /* GL_MODELVIEW3_ARB */
- 1195, /* GL_MODELVIEW4_ARB */
- 1196, /* GL_MODELVIEW5_ARB */
- 1197, /* GL_MODELVIEW6_ARB */
- 1198, /* GL_MODELVIEW7_ARB */
- 1199, /* GL_MODELVIEW8_ARB */
- 1200, /* GL_MODELVIEW9_ARB */
- 1170, /* GL_MODELVIEW10_ARB */
- 1171, /* GL_MODELVIEW11_ARB */
- 1172, /* GL_MODELVIEW12_ARB */
- 1173, /* GL_MODELVIEW13_ARB */
- 1174, /* GL_MODELVIEW14_ARB */
- 1175, /* GL_MODELVIEW15_ARB */
- 1176, /* GL_MODELVIEW16_ARB */
- 1177, /* GL_MODELVIEW17_ARB */
- 1178, /* GL_MODELVIEW18_ARB */
- 1179, /* GL_MODELVIEW19_ARB */
- 1181, /* GL_MODELVIEW20_ARB */
- 1182, /* GL_MODELVIEW21_ARB */
- 1183, /* GL_MODELVIEW22_ARB */
- 1184, /* GL_MODELVIEW23_ARB */
- 1185, /* GL_MODELVIEW24_ARB */
- 1186, /* GL_MODELVIEW25_ARB */
- 1187, /* GL_MODELVIEW26_ARB */
- 1188, /* GL_MODELVIEW27_ARB */
- 1189, /* GL_MODELVIEW28_ARB */
- 1190, /* GL_MODELVIEW29_ARB */
- 1192, /* GL_MODELVIEW30_ARB */
- 1193, /* GL_MODELVIEW31_ARB */
- 451, /* GL_DOT3_RGB_EXT */
- 449, /* GL_DOT3_RGBA_EXT */
- 1164, /* GL_MIRROR_CLAMP_EXT */
- 1167, /* GL_MIRROR_CLAMP_TO_EDGE_EXT */
- 1206, /* GL_MODULATE_ADD_ATI */
- 1207, /* GL_MODULATE_SIGNED_ADD_ATI */
- 1208, /* GL_MODULATE_SUBTRACT_ATI */
- 2309, /* GL_YCBCR_MESA */
- 1304, /* GL_PACK_INVERT_MESA */
- 392, /* GL_DEBUG_OBJECT_MESA */
- 393, /* GL_DEBUG_PRINT_MESA */
- 391, /* GL_DEBUG_ASSERT_MESA */
- 139, /* GL_BUFFER_SIZE */
- 141, /* GL_BUFFER_USAGE */
- 145, /* GL_BUMP_ROT_MATRIX_ATI */
- 146, /* GL_BUMP_ROT_MATRIX_SIZE_ATI */
- 144, /* GL_BUMP_NUM_TEX_UNITS_ATI */
- 148, /* GL_BUMP_TEX_UNITS_ATI */
- 511, /* GL_DUDV_ATI */
- 510, /* GL_DU8DV8_ATI */
- 143, /* GL_BUMP_ENVMAP_ATI */
- 147, /* GL_BUMP_TARGET_ATI */
- 1248, /* GL_NUM_PROGRAM_BINARY_FORMATS_OES */
- 1456, /* GL_PROGRAM_BINARY_FORMATS_OES */
- 1835, /* GL_STENCIL_BACK_FUNC */
- 1833, /* GL_STENCIL_BACK_FAIL */
- 1837, /* GL_STENCIL_BACK_PASS_DEPTH_FAIL */
- 1839, /* GL_STENCIL_BACK_PASS_DEPTH_PASS */
- 600, /* GL_FRAGMENT_PROGRAM_ARB */
- 1454, /* GL_PROGRAM_ALU_INSTRUCTIONS_ARB */
- 1486, /* GL_PROGRAM_TEX_INSTRUCTIONS_ARB */
- 1485, /* GL_PROGRAM_TEX_INDIRECTIONS_ARB */
- 1468, /* GL_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB */
- 1474, /* GL_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB */
- 1473, /* GL_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB */
- 1072, /* GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB */
- 1097, /* GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB */
- 1096, /* GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB */
- 1085, /* GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB */
- 1091, /* GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB */
- 1090, /* GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB */
- 1663, /* GL_RGBA32F */
- 1626, /* GL_RGB32F */
- 1654, /* GL_RGBA16F */
- 1618, /* GL_RGB16F */
- 1682, /* GL_RGBA_FLOAT_MODE_ARB */
- 1041, /* GL_MAX_DRAW_BUFFERS */
- 455, /* GL_DRAW_BUFFER0 */
- 458, /* GL_DRAW_BUFFER1 */
- 479, /* GL_DRAW_BUFFER2 */
- 482, /* GL_DRAW_BUFFER3 */
- 485, /* GL_DRAW_BUFFER4 */
- 488, /* GL_DRAW_BUFFER5 */
- 491, /* GL_DRAW_BUFFER6 */
- 494, /* GL_DRAW_BUFFER7 */
- 497, /* GL_DRAW_BUFFER8 */
- 500, /* GL_DRAW_BUFFER9 */
- 459, /* GL_DRAW_BUFFER10 */
- 462, /* GL_DRAW_BUFFER11 */
- 465, /* GL_DRAW_BUFFER12 */
- 468, /* GL_DRAW_BUFFER13 */
- 471, /* GL_DRAW_BUFFER14 */
- 474, /* GL_DRAW_BUFFER15 */
- 97, /* GL_BLEND_EQUATION_ALPHA */
- 1015, /* GL_MATRIX_PALETTE_ARB */
- 1065, /* GL_MAX_MATRIX_PALETTE_STACK_DEPTH_ARB */
- 1068, /* GL_MAX_PALETTE_MATRICES_ARB */
- 373, /* GL_CURRENT_PALETTE_MATRIX_ARB */
- 1003, /* GL_MATRIX_INDEX_ARRAY_ARB */
- 368, /* GL_CURRENT_MATRIX_INDEX_ARB */
- 1008, /* GL_MATRIX_INDEX_ARRAY_SIZE_ARB */
- 1012, /* GL_MATRIX_INDEX_ARRAY_TYPE_ARB */
- 1010, /* GL_MATRIX_INDEX_ARRAY_STRIDE_ARB */
- 1006, /* GL_MATRIX_INDEX_ARRAY_POINTER_ARB */
- 2055, /* GL_TEXTURE_DEPTH_SIZE */
- 439, /* GL_DEPTH_TEXTURE_MODE */
- 2012, /* GL_TEXTURE_COMPARE_MODE */
- 2010, /* GL_TEXTURE_COMPARE_FUNC */
- 284, /* GL_COMPARE_REF_TO_TEXTURE */
- 1381, /* GL_POINT_SPRITE */
- 347, /* GL_COORD_REPLACE */
- 1386, /* GL_POINT_SPRITE_R_MODE_NV */
- 1526, /* GL_QUERY_COUNTER_BITS */
- 376, /* GL_CURRENT_QUERY */
- 1530, /* GL_QUERY_RESULT */
- 1532, /* GL_QUERY_RESULT_AVAILABLE */
- 1135, /* GL_MAX_VERTEX_ATTRIBS */
- 2262, /* GL_VERTEX_ATTRIB_ARRAY_NORMALIZED */
- 437, /* GL_DEPTH_STENCIL_TO_RGBA_NV */
- 436, /* GL_DEPTH_STENCIL_TO_BGRA_NV */
- 1112, /* GL_MAX_TEXTURE_COORDS */
- 1114, /* GL_MAX_TEXTURE_IMAGE_UNITS */
- 1461, /* GL_PROGRAM_ERROR_STRING_ARB */
- 1463, /* GL_PROGRAM_FORMAT_ASCII_ARB */
- 1462, /* GL_PROGRAM_FORMAT_ARB */
- 2111, /* GL_TEXTURE_UNSIGNED_REMAP_MODE_NV */
- 409, /* GL_DEPTH_BOUNDS_TEST_EXT */
- 408, /* GL_DEPTH_BOUNDS_EXT */
- 61, /* GL_ARRAY_BUFFER */
- 524, /* GL_ELEMENT_ARRAY_BUFFER */
- 62, /* GL_ARRAY_BUFFER_BINDING */
- 525, /* GL_ELEMENT_ARRAY_BUFFER_BINDING */
- 2233, /* GL_VERTEX_ARRAY_BUFFER_BINDING */
- 1233, /* GL_NORMAL_ARRAY_BUFFER_BINDING */
- 190, /* GL_COLOR_ARRAY_BUFFER_BINDING */
- 738, /* GL_INDEX_ARRAY_BUFFER_BINDING */
- 2025, /* GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING */
- 520, /* GL_EDGE_FLAG_ARRAY_BUFFER_BINDING */
- 1743, /* GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING */
- 578, /* GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING */
- 2290, /* GL_WEIGHT_ARRAY_BUFFER_BINDING */
- 2255, /* GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING */
- 1464, /* GL_PROGRAM_INSTRUCTIONS_ARB */
- 1078, /* GL_MAX_PROGRAM_INSTRUCTIONS_ARB */
- 1470, /* GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB */
- 1087, /* GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB */
- 1484, /* GL_PROGRAM_TEMPORARIES_ARB */
- 1093, /* GL_MAX_PROGRAM_TEMPORARIES_ARB */
- 1472, /* GL_PROGRAM_NATIVE_TEMPORARIES_ARB */
- 1089, /* GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB */
- 1476, /* GL_PROGRAM_PARAMETERS_ARB */
- 1092, /* GL_MAX_PROGRAM_PARAMETERS_ARB */
- 1471, /* GL_PROGRAM_NATIVE_PARAMETERS_ARB */
- 1088, /* GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB */
- 1455, /* GL_PROGRAM_ATTRIBS_ARB */
- 1073, /* GL_MAX_PROGRAM_ATTRIBS_ARB */
- 1469, /* GL_PROGRAM_NATIVE_ATTRIBS_ARB */
- 1086, /* GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB */
- 1453, /* GL_PROGRAM_ADDRESS_REGISTERS_ARB */
- 1071, /* GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB */
- 1467, /* GL_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB */
- 1084, /* GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB */
- 1079, /* GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB */
- 1075, /* GL_MAX_PROGRAM_ENV_PARAMETERS_ARB */
- 1487, /* GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB */
- 2144, /* GL_TRANSPOSE_CURRENT_MATRIX_ARB */
- 1549, /* GL_READ_ONLY */
- 2304, /* GL_WRITE_ONLY */
- 1551, /* GL_READ_WRITE */
- 124, /* GL_BUFFER_ACCESS */
- 129, /* GL_BUFFER_MAPPED */
- 134, /* GL_BUFFER_MAP_POINTER */
- 2118, /* GL_TIME_ELAPSED_EXT */
- 963, /* GL_MATRIX0_ARB */
- 975, /* GL_MATRIX1_ARB */
- 987, /* GL_MATRIX2_ARB */
- 991, /* GL_MATRIX3_ARB */
- 993, /* GL_MATRIX4_ARB */
- 995, /* GL_MATRIX5_ARB */
- 997, /* GL_MATRIX6_ARB */
- 999, /* GL_MATRIX7_ARB */
- 1001, /* GL_MATRIX8_ARB */
- 1002, /* GL_MATRIX9_ARB */
- 965, /* GL_MATRIX10_ARB */
- 966, /* GL_MATRIX11_ARB */
- 967, /* GL_MATRIX12_ARB */
- 968, /* GL_MATRIX13_ARB */
- 969, /* GL_MATRIX14_ARB */
- 970, /* GL_MATRIX15_ARB */
- 971, /* GL_MATRIX16_ARB */
- 972, /* GL_MATRIX17_ARB */
- 973, /* GL_MATRIX18_ARB */
- 974, /* GL_MATRIX19_ARB */
- 977, /* GL_MATRIX20_ARB */
- 978, /* GL_MATRIX21_ARB */
- 979, /* GL_MATRIX22_ARB */
- 980, /* GL_MATRIX23_ARB */
- 981, /* GL_MATRIX24_ARB */
- 982, /* GL_MATRIX25_ARB */
- 983, /* GL_MATRIX26_ARB */
- 984, /* GL_MATRIX27_ARB */
- 985, /* GL_MATRIX28_ARB */
- 986, /* GL_MATRIX29_ARB */
- 989, /* GL_MATRIX30_ARB */
- 990, /* GL_MATRIX31_ARB */
- 1876, /* GL_STREAM_DRAW */
- 1878, /* GL_STREAM_READ */
- 1874, /* GL_STREAM_COPY */
- 1825, /* GL_STATIC_DRAW */
- 1827, /* GL_STATIC_READ */
- 1823, /* GL_STATIC_COPY */
- 514, /* GL_DYNAMIC_DRAW */
- 516, /* GL_DYNAMIC_READ */
- 512, /* GL_DYNAMIC_COPY */
- 1344, /* GL_PIXEL_PACK_BUFFER */
- 1348, /* GL_PIXEL_UNPACK_BUFFER */
- 1345, /* GL_PIXEL_PACK_BUFFER_BINDING */
- 1349, /* GL_PIXEL_UNPACK_BUFFER_BINDING */
- 400, /* GL_DEPTH24_STENCIL8 */
- 2107, /* GL_TEXTURE_STENCIL_SIZE */
- 2053, /* GL_TEXTURE_CUBE_MAP_SEAMLESS */
- 1074, /* GL_MAX_PROGRAM_CALL_DEPTH_NV */
- 1077, /* GL_MAX_PROGRAM_IF_DEPTH_NV */
- 1081, /* GL_MAX_PROGRAM_LOOP_DEPTH_NV */
- 1080, /* GL_MAX_PROGRAM_LOOP_COUNT_NV */
- 2260, /* GL_VERTEX_ATTRIB_ARRAY_INTEGER */
- 2257, /* GL_VERTEX_ATTRIB_ARRAY_DIVISOR_ARB */
- 1020, /* GL_MAX_ARRAY_TEXTURE_LAYERS */
- 1158, /* GL_MIN_PROGRAM_TEXEL_OFFSET */
- 1094, /* GL_MAX_PROGRAM_TEXEL_OFFSET */
- 1867, /* GL_STENCIL_TEST_TWO_SIDE_EXT */
- 18, /* GL_ACTIVE_STENCIL_FACE_EXT */
- 1165, /* GL_MIRROR_CLAMP_TO_BORDER_EXT */
- 1724, /* GL_SAMPLES_PASSED */
- 693, /* GL_GEOMETRY_VERTICES_OUT */
- 687, /* GL_GEOMETRY_INPUT_TYPE */
- 689, /* GL_GEOMETRY_OUTPUT_TYPE */
- 1715, /* GL_SAMPLER_BINDING */
- 164, /* GL_CLAMP_VERTEX_COLOR_ARB */
- 156, /* GL_CLAMP_FRAGMENT_COLOR_ARB */
- 157, /* GL_CLAMP_READ_COLOR */
- 550, /* GL_FIXED_ONLY */
- 1368, /* GL_POINT_SIZE_ARRAY_TYPE_OES */
- 1367, /* GL_POINT_SIZE_ARRAY_STRIDE_OES */
- 1366, /* GL_POINT_SIZE_ARRAY_POINTER_OES */
- 1202, /* GL_MODELVIEW_MATRIX_FLOAT_AS_INT_BITS_OES */
- 1490, /* GL_PROJECTION_MATRIX_FLOAT_AS_INT_BITS_OES */
- 2087, /* GL_TEXTURE_MATRIX_FLOAT_AS_INT_BITS_OES */
- 138, /* GL_BUFFER_SERIALIZED_MODIFY_APPLE */
- 128, /* GL_BUFFER_FLUSHING_UNMAP_APPLE */
- 1566, /* GL_RELEASED_APPLE */
- 2287, /* GL_VOLATILE_APPLE */
- 1606, /* GL_RETAINED_APPLE */
- 2161, /* GL_UNDEFINED_APPLE */
- 1514, /* GL_PURGEABLE_APPLE */
- 601, /* GL_FRAGMENT_SHADER */
- 2282, /* GL_VERTEX_SHADER */
- 1475, /* GL_PROGRAM_OBJECT_ARB */
- 1760, /* GL_SHADER_OBJECT_ARB */
- 1049, /* GL_MAX_FRAGMENT_UNIFORM_COMPONENTS */
- 1140, /* GL_MAX_VERTEX_UNIFORM_COMPONENTS */
- 1131, /* GL_MAX_VARYING_COMPONENTS */
- 1138, /* GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS */
- 1032, /* GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS */
- 1264, /* GL_OBJECT_TYPE_ARB */
- 1762, /* GL_SHADER_TYPE */
- 566, /* GL_FLOAT_VEC2 */
- 568, /* GL_FLOAT_VEC3 */
- 570, /* GL_FLOAT_VEC4 */
- 791, /* GL_INT_VEC2 */
- 793, /* GL_INT_VEC3 */
- 795, /* GL_INT_VEC4 */
- 116, /* GL_BOOL */
- 118, /* GL_BOOL_VEC2 */
- 120, /* GL_BOOL_VEC3 */
- 122, /* GL_BOOL_VEC4 */
- 554, /* GL_FLOAT_MAT2 */
- 558, /* GL_FLOAT_MAT3 */
- 562, /* GL_FLOAT_MAT4 */
- 1699, /* GL_SAMPLER_1D */
- 1705, /* GL_SAMPLER_2D */
- 1713, /* GL_SAMPLER_3D */
- 1718, /* GL_SAMPLER_CUBE */
- 1704, /* GL_SAMPLER_1D_SHADOW */
- 1712, /* GL_SAMPLER_2D_SHADOW */
- 1710, /* GL_SAMPLER_2D_RECT */
- 1711, /* GL_SAMPLER_2D_RECT_SHADOW */
- 556, /* GL_FLOAT_MAT2x3 */
- 557, /* GL_FLOAT_MAT2x4 */
- 560, /* GL_FLOAT_MAT3x2 */
- 561, /* GL_FLOAT_MAT3x4 */
- 564, /* GL_FLOAT_MAT4x2 */
- 565, /* GL_FLOAT_MAT4x3 */
- 398, /* GL_DELETE_STATUS */
- 289, /* GL_COMPILE_STATUS */
- 852, /* GL_LINK_STATUS */
- 2227, /* GL_VALIDATE_STATUS */
- 750, /* GL_INFO_LOG_LENGTH */
- 64, /* GL_ATTACHED_SHADERS */
- 21, /* GL_ACTIVE_UNIFORMS */
- 22, /* GL_ACTIVE_UNIFORM_MAX_LENGTH */
- 1761, /* GL_SHADER_SOURCE_LENGTH */
- 15, /* GL_ACTIVE_ATTRIBUTES */
- 16, /* GL_ACTIVE_ATTRIBUTE_MAX_LENGTH */
- 603, /* GL_FRAGMENT_SHADER_DERIVATIVE_HINT */
- 1764, /* GL_SHADING_LANGUAGE_VERSION */
- 375, /* GL_CURRENT_PROGRAM */
- 1313, /* GL_PALETTE4_RGB8_OES */
- 1315, /* GL_PALETTE4_RGBA8_OES */
- 1311, /* GL_PALETTE4_R5_G6_B5_OES */
- 1314, /* GL_PALETTE4_RGBA4_OES */
- 1312, /* GL_PALETTE4_RGB5_A1_OES */
- 1318, /* GL_PALETTE8_RGB8_OES */
- 1320, /* GL_PALETTE8_RGBA8_OES */
- 1316, /* GL_PALETTE8_R5_G6_B5_OES */
- 1319, /* GL_PALETTE8_RGBA4_OES */
- 1317, /* GL_PALETTE8_RGB5_A1_OES */
- 731, /* GL_IMPLEMENTATION_COLOR_READ_TYPE */
- 729, /* GL_IMPLEMENTATION_COLOR_READ_FORMAT */
- 1365, /* GL_POINT_SIZE_ARRAY_OES */
- 2031, /* GL_TEXTURE_CROP_RECT_OES */
- 1004, /* GL_MATRIX_INDEX_ARRAY_BUFFER_BINDING_OES */
- 1364, /* GL_POINT_SIZE_ARRAY_BUFFER_BINDING_OES */
- 2210, /* GL_UNSIGNED_NORMALIZED */
- 1964, /* GL_TEXTURE_1D_ARRAY */
- 1500, /* GL_PROXY_TEXTURE_1D_ARRAY */
- 1967, /* GL_TEXTURE_2D_ARRAY */
- 1504, /* GL_PROXY_TEXTURE_2D_ARRAY */
- 1975, /* GL_TEXTURE_BINDING_1D_ARRAY */
- 1978, /* GL_TEXTURE_BINDING_2D_ARRAY */
- 1056, /* GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS */
- 1995, /* GL_TEXTURE_BUFFER */
- 1110, /* GL_MAX_TEXTURE_BUFFER_SIZE */
- 1982, /* GL_TEXTURE_BINDING_BUFFER */
- 1997, /* GL_TEXTURE_BUFFER_DATA_STORE_BINDING */
- 1999, /* GL_TEXTURE_BUFFER_FORMAT */
- 1537, /* GL_R11F_G11F_B10F */
- 2176, /* GL_UNSIGNED_INT_10F_11F_11F_REV */
- 1649, /* GL_RGB9_E5 */
- 2185, /* GL_UNSIGNED_INT_5_9_9_9_REV */
- 2105, /* GL_TEXTURE_SHARED_SIZE */
- 1817, /* GL_SRGB */
- 1818, /* GL_SRGB8 */
- 1820, /* GL_SRGB_ALPHA */
- 1819, /* GL_SRGB8_ALPHA8 */
- 1777, /* GL_SLUMINANCE_ALPHA */
- 1776, /* GL_SLUMINANCE8_ALPHA8 */
- 1774, /* GL_SLUMINANCE */
- 1775, /* GL_SLUMINANCE8 */
- 312, /* GL_COMPRESSED_SRGB */
- 313, /* GL_COMPRESSED_SRGB_ALPHA */
- 310, /* GL_COMPRESSED_SLUMINANCE */
- 311, /* GL_COMPRESSED_SLUMINANCE_ALPHA */
- 2140, /* GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH */
- 2129, /* GL_TRANSFORM_FEEDBACK_BUFFER_MODE */
- 1129, /* GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS */
- 2138, /* GL_TRANSFORM_FEEDBACK_VARYINGS */
- 2134, /* GL_TRANSFORM_FEEDBACK_BUFFER_START */
- 2132, /* GL_TRANSFORM_FEEDBACK_BUFFER_SIZE */
- 1447, /* GL_PRIMITIVES_GENERATED */
- 2136, /* GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN */
- 1541, /* GL_RASTERIZER_DISCARD */
- 1125, /* GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS */
- 1127, /* GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS */
- 769, /* GL_INTERLEAVED_ATTRIBS */
- 1753, /* GL_SEPARATE_ATTRIBS */
- 2124, /* GL_TRANSFORM_FEEDBACK_BUFFER */
- 2126, /* GL_TRANSFORM_FEEDBACK_BUFFER_BINDING */
- 1383, /* GL_POINT_SPRITE_COORD_ORIGIN */
- 861, /* GL_LOWER_LEFT */
- 2224, /* GL_UPPER_LEFT */
- 1841, /* GL_STENCIL_BACK_REF */
- 1842, /* GL_STENCIL_BACK_VALUE_MASK */
- 1843, /* GL_STENCIL_BACK_WRITEMASK */
- 504, /* GL_DRAW_FRAMEBUFFER_BINDING */
- 1571, /* GL_RENDERBUFFER_BINDING */
- 1545, /* GL_READ_FRAMEBUFFER */
- 503, /* GL_DRAW_FRAMEBUFFER */
- 1546, /* GL_READ_FRAMEBUFFER_BINDING */
- 1590, /* GL_RENDERBUFFER_SAMPLES */
- 617, /* GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE */
- 614, /* GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME */
- 629, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL */
- 624, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE */
- 627, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER */
- 635, /* GL_FRAMEBUFFER_COMPLETE */
- 640, /* GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT */
- 655, /* GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT */
- 649, /* GL_FRAMEBUFFER_INCOMPLETE_DUPLICATE_ATTACHMENT_EXT */
- 644, /* GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT */
- 650, /* GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT */
- 646, /* GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER */
- 660, /* GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER */
- 666, /* GL_FRAMEBUFFER_UNSUPPORTED */
- 664, /* GL_FRAMEBUFFER_STATUS_ERROR_EXT */
- 1028, /* GL_MAX_COLOR_ATTACHMENTS */
- 196, /* GL_COLOR_ATTACHMENT0 */
- 199, /* GL_COLOR_ATTACHMENT1 */
- 213, /* GL_COLOR_ATTACHMENT2 */
- 215, /* GL_COLOR_ATTACHMENT3 */
- 217, /* GL_COLOR_ATTACHMENT4 */
- 219, /* GL_COLOR_ATTACHMENT5 */
- 221, /* GL_COLOR_ATTACHMENT6 */
- 223, /* GL_COLOR_ATTACHMENT7 */
- 225, /* GL_COLOR_ATTACHMENT8 */
- 227, /* GL_COLOR_ATTACHMENT9 */
- 200, /* GL_COLOR_ATTACHMENT10 */
- 202, /* GL_COLOR_ATTACHMENT11 */
- 204, /* GL_COLOR_ATTACHMENT12 */
- 206, /* GL_COLOR_ATTACHMENT13 */
- 208, /* GL_COLOR_ATTACHMENT14 */
- 210, /* GL_COLOR_ATTACHMENT15 */
- 403, /* GL_DEPTH_ATTACHMENT */
- 1830, /* GL_STENCIL_ATTACHMENT */
- 605, /* GL_FRAMEBUFFER */
- 1568, /* GL_RENDERBUFFER */
- 1594, /* GL_RENDERBUFFER_WIDTH */
- 1581, /* GL_RENDERBUFFER_HEIGHT */
- 1584, /* GL_RENDERBUFFER_INTERNAL_FORMAT */
- 1862, /* GL_STENCIL_INDEX_EXT */
- 1851, /* GL_STENCIL_INDEX1 */
- 1856, /* GL_STENCIL_INDEX4 */
- 1859, /* GL_STENCIL_INDEX8 */
- 1852, /* GL_STENCIL_INDEX16 */
- 1588, /* GL_RENDERBUFFER_RED_SIZE */
- 1579, /* GL_RENDERBUFFER_GREEN_SIZE */
- 1574, /* GL_RENDERBUFFER_BLUE_SIZE */
- 1569, /* GL_RENDERBUFFER_ALPHA_SIZE */
- 1576, /* GL_RENDERBUFFER_DEPTH_SIZE */
- 1592, /* GL_RENDERBUFFER_STENCIL_SIZE */
- 658, /* GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE */
- 1105, /* GL_MAX_SAMPLES */
- 2067, /* GL_TEXTURE_GEN_STR_OES */
- 705, /* GL_HALF_FLOAT_OES */
- 1636, /* GL_RGB565_OES */
- 1666, /* GL_RGBA32UI */
- 1629, /* GL_RGB32UI */
- 40, /* GL_ALPHA32UI_EXT */
- 761, /* GL_INTENSITY32UI_EXT */
- 878, /* GL_LUMINANCE32UI_EXT */
- 895, /* GL_LUMINANCE_ALPHA32UI_EXT */
- 1657, /* GL_RGBA16UI */
- 1621, /* GL_RGB16UI */
- 37, /* GL_ALPHA16UI_EXT */
- 758, /* GL_INTENSITY16UI_EXT */
- 873, /* GL_LUMINANCE16UI_EXT */
- 893, /* GL_LUMINANCE_ALPHA16UI_EXT */
- 1676, /* GL_RGBA8UI */
- 1644, /* GL_RGB8UI */
- 45, /* GL_ALPHA8UI_EXT */
- 766, /* GL_INTENSITY8UI_EXT */
- 887, /* GL_LUMINANCE8UI_EXT */
- 897, /* GL_LUMINANCE_ALPHA8UI_EXT */
- 1664, /* GL_RGBA32I */
- 1627, /* GL_RGB32I */
- 39, /* GL_ALPHA32I_EXT */
- 760, /* GL_INTENSITY32I_EXT */
- 877, /* GL_LUMINANCE32I_EXT */
- 894, /* GL_LUMINANCE_ALPHA32I_EXT */
- 1655, /* GL_RGBA16I */
- 1619, /* GL_RGB16I */
- 36, /* GL_ALPHA16I_EXT */
- 757, /* GL_INTENSITY16I_EXT */
- 872, /* GL_LUMINANCE16I_EXT */
- 892, /* GL_LUMINANCE_ALPHA16I_EXT */
- 1674, /* GL_RGBA8I */
- 1642, /* GL_RGB8I */
- 44, /* GL_ALPHA8I_EXT */
- 765, /* GL_INTENSITY8I_EXT */
- 886, /* GL_LUMINANCE8I_EXT */
- 896, /* GL_LUMINANCE_ALPHA8I_EXT */
- 1558, /* GL_RED_INTEGER */
- 700, /* GL_GREEN_INTEGER */
- 113, /* GL_BLUE_INTEGER */
- 49, /* GL_ALPHA_INTEGER_EXT */
- 1689, /* GL_RGB_INTEGER */
- 1683, /* GL_RGBA_INTEGER */
- 84, /* GL_BGR_INTEGER */
- 82, /* GL_BGRA_INTEGER */
- 899, /* GL_LUMINANCE_INTEGER_EXT */
- 898, /* GL_LUMINANCE_ALPHA_INTEGER_EXT */
- 1685, /* GL_RGBA_INTEGER_MODE_EXT */
- 612, /* GL_FRAMEBUFFER_ATTACHMENT_LAYERED */
- 653, /* GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS */
- 652, /* GL_FRAMEBUFFER_INCOMPLETE_LAYER_COUNT_ARB */
- 1700, /* GL_SAMPLER_1D_ARRAY */
- 1706, /* GL_SAMPLER_2D_ARRAY */
- 1716, /* GL_SAMPLER_BUFFER */
- 1702, /* GL_SAMPLER_1D_ARRAY_SHADOW */
- 1708, /* GL_SAMPLER_2D_ARRAY_SHADOW */
- 1719, /* GL_SAMPLER_CUBE_SHADOW */
- 2204, /* GL_UNSIGNED_INT_VEC2 */
- 2206, /* GL_UNSIGNED_INT_VEC3 */
- 2208, /* GL_UNSIGNED_INT_VEC4 */
- 775, /* GL_INT_SAMPLER_1D */
- 779, /* GL_INT_SAMPLER_2D */
- 785, /* GL_INT_SAMPLER_3D */
- 789, /* GL_INT_SAMPLER_CUBE */
- 783, /* GL_INT_SAMPLER_2D_RECT */
- 776, /* GL_INT_SAMPLER_1D_ARRAY */
- 780, /* GL_INT_SAMPLER_2D_ARRAY */
- 787, /* GL_INT_SAMPLER_BUFFER */
- 2188, /* GL_UNSIGNED_INT_SAMPLER_1D */
- 2192, /* GL_UNSIGNED_INT_SAMPLER_2D */
- 2198, /* GL_UNSIGNED_INT_SAMPLER_3D */
- 2202, /* GL_UNSIGNED_INT_SAMPLER_CUBE */
- 2196, /* GL_UNSIGNED_INT_SAMPLER_2D_RECT */
- 2189, /* GL_UNSIGNED_INT_SAMPLER_1D_ARRAY */
- 2193, /* GL_UNSIGNED_INT_SAMPLER_2D_ARRAY */
- 2200, /* GL_UNSIGNED_INT_SAMPLER_BUFFER */
- 691, /* GL_GEOMETRY_SHADER */
- 694, /* GL_GEOMETRY_VERTICES_OUT_ARB */
- 688, /* GL_GEOMETRY_INPUT_TYPE_ARB */
- 690, /* GL_GEOMETRY_OUTPUT_TYPE_ARB */
- 1062, /* GL_MAX_GEOMETRY_VARYING_COMPONENTS_ARB */
- 1145, /* GL_MAX_VERTEX_VARYING_COMPONENTS_ARB */
- 1060, /* GL_MAX_GEOMETRY_UNIFORM_COMPONENTS */
- 1054, /* GL_MAX_GEOMETRY_OUTPUT_VERTICES */
- 1058, /* GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS */
- 862, /* GL_LOW_FLOAT */
- 1147, /* GL_MEDIUM_FLOAT */
- 706, /* GL_HIGH_FLOAT */
- 863, /* GL_LOW_INT */
- 1148, /* GL_MEDIUM_INT */
- 707, /* GL_HIGH_INT */
- 2178, /* GL_UNSIGNED_INT_10_10_10_2_OES */
- 774, /* GL_INT_10_10_10_2_OES */
- 1758, /* GL_SHADER_BINARY_FORMATS */
- 1249, /* GL_NUM_SHADER_BINARY_FORMATS */
- 1759, /* GL_SHADER_COMPILER */
- 1142, /* GL_MAX_VERTEX_UNIFORM_VECTORS */
- 1134, /* GL_MAX_VARYING_VECTORS */
- 1051, /* GL_MAX_FRAGMENT_UNIFORM_VECTORS */
- 1534, /* GL_QUERY_WAIT */
- 1528, /* GL_QUERY_NO_WAIT */
- 1524, /* GL_QUERY_BY_REGION_WAIT */
- 1522, /* GL_QUERY_BY_REGION_NO_WAIT */
- 2122, /* GL_TRANSFORM_FEEDBACK */
- 2131, /* GL_TRANSFORM_FEEDBACK_BUFFER_PAUSED */
- 2125, /* GL_TRANSFORM_FEEDBACK_BUFFER_ACTIVE */
- 2123, /* GL_TRANSFORM_FEEDBACK_BINDING */
- 1518, /* GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION */
- 546, /* GL_FIRST_VERTEX_CONVENTION */
- 807, /* GL_LAST_VERTEX_CONVENTION */
- 1492, /* GL_PROVOKING_VERTEX */
- 354, /* GL_COPY_READ_BUFFER */
- 355, /* GL_COPY_WRITE_BUFFER */
- 1561, /* GL_RED_SNORM */
- 1696, /* GL_RG_SNORM */
- 1695, /* GL_RGB_SNORM */
- 1688, /* GL_RGBA_SNORM */
- 1540, /* GL_R8_SNORM */
- 1609, /* GL_RG8_SNORM */
- 1648, /* GL_RGB8_SNORM */
- 1680, /* GL_RGBA8_SNORM */
- 1538, /* GL_R16_SNORM */
- 1608, /* GL_RG16_SNORM */
- 1624, /* GL_RGB16_SNORM */
- 1660, /* GL_RGBA16_SNORM */
- 1770, /* GL_SIGNED_NORMALIZED */
- 1449, /* GL_PRIMITIVE_RESTART */
- 1450, /* GL_PRIMITIVE_RESTART_INDEX */
- 1107, /* GL_MAX_SERVER_WAIT_TIMEOUT */
- 1263, /* GL_OBJECT_TYPE */
- 1883, /* GL_SYNC_CONDITION */
- 1888, /* GL_SYNC_STATUS */
- 1885, /* GL_SYNC_FLAGS */
- 1884, /* GL_SYNC_FENCE */
- 1887, /* GL_SYNC_GPU_COMMANDS_COMPLETE */
- 2171, /* GL_UNSIGNALED */
- 1769, /* GL_SIGNALED */
- 54, /* GL_ALREADY_SIGNALED */
- 2117, /* GL_TIMEOUT_EXPIRED */
- 315, /* GL_CONDITION_SATISFIED */
- 2288, /* GL_WAIT_FAILED */
- 126, /* GL_BUFFER_ACCESS_FLAGS */
- 132, /* GL_BUFFER_MAP_LENGTH */
- 133, /* GL_BUFFER_MAP_OFFSET */
- 1137, /* GL_MAX_VERTEX_OUTPUT_COMPONENTS */
- 1052, /* GL_MAX_GEOMETRY_INPUT_COMPONENTS */
- 1053, /* GL_MAX_GEOMETRY_OUTPUT_COMPONENTS */
- 1048, /* GL_MAX_FRAGMENT_INPUT_COMPONENTS */
- 330, /* GL_CONTEXT_PROFILE_MASK */
- 531, /* GL_EVAL_BIT */
- 1543, /* GL_RASTER_POSITION_UNCLIPPED_IBM */
- 854, /* GL_LIST_BIT */
- 1990, /* GL_TEXTURE_BIT */
- 1739, /* GL_SCISSOR_BIT */
- 30, /* GL_ALL_ATTRIB_BITS */
- 1213, /* GL_MULTISAMPLE_BIT */
- 31, /* GL_ALL_CLIENT_ATTRIB_BITS */
-};
-
-typedef int (*cfunc)(const void *, const void *);
-
-/**
- * Compare a key name to an element in the \c all_enums array.
- *
- * \c bsearch always passes the key as the first parameter and the pointer
- * to the array element as the second parameter. We can elimiate some
- * extra work by taking advantage of that fact.
- *
- * \param a Pointer to the desired enum name.
- * \param b Pointer to an element of the \c all_enums array.
- */
-static int compar_name( const char *a, const enum_elt *b )
-{
- return strcmp( a, & enum_string_table[ b->offset ] );
-}
-
-/**
- * Compare a key enum value to an element in the \c all_enums array.
- *
- * \c bsearch always passes the key as the first parameter and the pointer
- * to the array element as the second parameter. We can elimiate some
- * extra work by taking advantage of that fact.
- *
- * \param a Pointer to the desired enum name.
- * \param b Pointer to an index into the \c all_enums array.
- */
-static int compar_nr( const int *a, const unsigned *b )
-{
- return a[0] - all_enums[*b].n;
-}
-
-
-static char token_tmp[20];
-
-const char *_mesa_lookup_enum_by_nr( int nr )
-{
- unsigned * i;
-
- i = (unsigned *) _mesa_bsearch(& nr, reduced_enums,
- Elements(reduced_enums),
- sizeof(reduced_enums[0]),
- (cfunc) compar_nr);
-
- if ( i != NULL ) {
- return & enum_string_table[ all_enums[ *i ].offset ];
- }
- else {
- /* this is not re-entrant safe, no big deal here */
- _mesa_snprintf(token_tmp, sizeof(token_tmp) - 1, "0x%x", nr);
- token_tmp[sizeof(token_tmp) - 1] = '\0';
- return token_tmp;
- }
-}
-
-/**
- * Primitive names
- */
-static const char *prim_names[PRIM_UNKNOWN + 1] = {
- "GL_POINTS",
- "GL_LINES",
- "GL_LINE_LOOP",
- "GL_LINE_STRIP",
- "GL_TRIANGLES",
- "GL_TRIANGLE_STRIP",
- "GL_TRIANGLE_FAN",
- "GL_QUADS",
- "GL_QUAD_STRIP",
- "GL_POLYGON",
- "outside begin/end",
- "inside unknown primitive",
- "unknown state"
-};
-
-
-/* Get the name of an enum given that it is a primitive type. Avoids
- * GL_FALSE/GL_POINTS ambiguity and others.
- */
-const char *
-_mesa_lookup_prim_by_nr(GLuint nr)
-{
- if (nr < Elements(prim_names))
- return prim_names[nr];
- else
- return "invalid mode";
-}
-
-
-int _mesa_lookup_enum_by_name( const char *symbol )
-{
- enum_elt * f = NULL;
-
- if ( symbol != NULL ) {
- f = (enum_elt *) _mesa_bsearch(symbol, all_enums,
- Elements(all_enums),
- sizeof( enum_elt ),
- (cfunc) compar_name);
- }
-
- return (f != NULL) ? f->n : -1;
-}
-
-
+/* DO NOT EDIT - This file generated automatically by gl_enums.py (from Mesa) script */
+
+/*
+ * Copyright (C) 1999-2005 Brian Paul All Rights Reserved.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sub license,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL,
+ * AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
+ * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+#include "main/glheader.h"
+#include "main/mfeatures.h"
+#include "main/enums.h"
+#include "main/imports.h"
+#include "main/mtypes.h"
+
+typedef struct {
+ size_t offset;
+ int n;
+} enum_elt;
+
+LONGSTRING static const char enum_string_table[] =
+ "GL_2D\0"
+ "GL_2_BYTES\0"
+ "GL_3D\0"
+ "GL_3D_COLOR\0"
+ "GL_3D_COLOR_TEXTURE\0"
+ "GL_3_BYTES\0"
+ "GL_4D_COLOR_TEXTURE\0"
+ "GL_4_BYTES\0"
+ "GL_ACCUM\0"
+ "GL_ACCUM_ALPHA_BITS\0"
+ "GL_ACCUM_BLUE_BITS\0"
+ "GL_ACCUM_BUFFER_BIT\0"
+ "GL_ACCUM_CLEAR_VALUE\0"
+ "GL_ACCUM_GREEN_BITS\0"
+ "GL_ACCUM_RED_BITS\0"
+ "GL_ACTIVE_ATTRIBUTES\0"
+ "GL_ACTIVE_ATTRIBUTE_MAX_LENGTH\0"
+ "GL_ACTIVE_PROGRAM_EXT\0"
+ "GL_ACTIVE_STENCIL_FACE_EXT\0"
+ "GL_ACTIVE_TEXTURE\0"
+ "GL_ACTIVE_TEXTURE_ARB\0"
+ "GL_ACTIVE_UNIFORMS\0"
+ "GL_ACTIVE_UNIFORM_MAX_LENGTH\0"
+ "GL_ACTIVE_VERTEX_UNITS_ARB\0"
+ "GL_ADD\0"
+ "GL_ADD_SIGNED\0"
+ "GL_ADD_SIGNED_ARB\0"
+ "GL_ADD_SIGNED_EXT\0"
+ "GL_ALIASED_LINE_WIDTH_RANGE\0"
+ "GL_ALIASED_POINT_SIZE_RANGE\0"
+ "GL_ALL_ATTRIB_BITS\0"
+ "GL_ALL_CLIENT_ATTRIB_BITS\0"
+ "GL_ALPHA\0"
+ "GL_ALPHA12\0"
+ "GL_ALPHA12_EXT\0"
+ "GL_ALPHA16\0"
+ "GL_ALPHA16I_EXT\0"
+ "GL_ALPHA16UI_EXT\0"
+ "GL_ALPHA16_EXT\0"
+ "GL_ALPHA32I_EXT\0"
+ "GL_ALPHA32UI_EXT\0"
+ "GL_ALPHA4\0"
+ "GL_ALPHA4_EXT\0"
+ "GL_ALPHA8\0"
+ "GL_ALPHA8I_EXT\0"
+ "GL_ALPHA8UI_EXT\0"
+ "GL_ALPHA8_EXT\0"
+ "GL_ALPHA_BIAS\0"
+ "GL_ALPHA_BITS\0"
+ "GL_ALPHA_INTEGER_EXT\0"
+ "GL_ALPHA_SCALE\0"
+ "GL_ALPHA_TEST\0"
+ "GL_ALPHA_TEST_FUNC\0"
+ "GL_ALPHA_TEST_REF\0"
+ "GL_ALREADY_SIGNALED\0"
+ "GL_ALWAYS\0"
+ "GL_AMBIENT\0"
+ "GL_AMBIENT_AND_DIFFUSE\0"
+ "GL_AND\0"
+ "GL_AND_INVERTED\0"
+ "GL_AND_REVERSE\0"
+ "GL_ARRAY_BUFFER\0"
+ "GL_ARRAY_BUFFER_BINDING\0"
+ "GL_ARRAY_BUFFER_BINDING_ARB\0"
+ "GL_ATTACHED_SHADERS\0"
+ "GL_ATTRIB_ARRAY_POINTER_NV\0"
+ "GL_ATTRIB_ARRAY_SIZE_NV\0"
+ "GL_ATTRIB_ARRAY_STRIDE_NV\0"
+ "GL_ATTRIB_ARRAY_TYPE_NV\0"
+ "GL_ATTRIB_STACK_DEPTH\0"
+ "GL_AUTO_NORMAL\0"
+ "GL_AUX0\0"
+ "GL_AUX1\0"
+ "GL_AUX2\0"
+ "GL_AUX3\0"
+ "GL_AUX_BUFFERS\0"
+ "GL_BACK\0"
+ "GL_BACK_LEFT\0"
+ "GL_BACK_RIGHT\0"
+ "GL_BGR\0"
+ "GL_BGRA\0"
+ "GL_BGRA_EXT\0"
+ "GL_BGRA_INTEGER\0"
+ "GL_BGRA_INTEGER_EXT\0"
+ "GL_BGR_INTEGER\0"
+ "GL_BGR_INTEGER_EXT\0"
+ "GL_BITMAP\0"
+ "GL_BITMAP_TOKEN\0"
+ "GL_BLEND\0"
+ "GL_BLEND_COLOR\0"
+ "GL_BLEND_COLOR_EXT\0"
+ "GL_BLEND_DST\0"
+ "GL_BLEND_DST_ALPHA\0"
+ "GL_BLEND_DST_ALPHA_OES\0"
+ "GL_BLEND_DST_RGB\0"
+ "GL_BLEND_DST_RGB_OES\0"
+ "GL_BLEND_EQUATION\0"
+ "GL_BLEND_EQUATION_ALPHA\0"
+ "GL_BLEND_EQUATION_ALPHA_EXT\0"
+ "GL_BLEND_EQUATION_ALPHA_OES\0"
+ "GL_BLEND_EQUATION_EXT\0"
+ "GL_BLEND_EQUATION_OES\0"
+ "GL_BLEND_EQUATION_RGB\0"
+ "GL_BLEND_EQUATION_RGB_EXT\0"
+ "GL_BLEND_EQUATION_RGB_OES\0"
+ "GL_BLEND_SRC\0"
+ "GL_BLEND_SRC_ALPHA\0"
+ "GL_BLEND_SRC_ALPHA_OES\0"
+ "GL_BLEND_SRC_RGB\0"
+ "GL_BLEND_SRC_RGB_OES\0"
+ "GL_BLUE\0"
+ "GL_BLUE_BIAS\0"
+ "GL_BLUE_BITS\0"
+ "GL_BLUE_INTEGER\0"
+ "GL_BLUE_INTEGER_EXT\0"
+ "GL_BLUE_SCALE\0"
+ "GL_BOOL\0"
+ "GL_BOOL_ARB\0"
+ "GL_BOOL_VEC2\0"
+ "GL_BOOL_VEC2_ARB\0"
+ "GL_BOOL_VEC3\0"
+ "GL_BOOL_VEC3_ARB\0"
+ "GL_BOOL_VEC4\0"
+ "GL_BOOL_VEC4_ARB\0"
+ "GL_BUFFER_ACCESS\0"
+ "GL_BUFFER_ACCESS_ARB\0"
+ "GL_BUFFER_ACCESS_FLAGS\0"
+ "GL_BUFFER_ACCESS_OES\0"
+ "GL_BUFFER_FLUSHING_UNMAP_APPLE\0"
+ "GL_BUFFER_MAPPED\0"
+ "GL_BUFFER_MAPPED_ARB\0"
+ "GL_BUFFER_MAPPED_OES\0"
+ "GL_BUFFER_MAP_LENGTH\0"
+ "GL_BUFFER_MAP_OFFSET\0"
+ "GL_BUFFER_MAP_POINTER\0"
+ "GL_BUFFER_MAP_POINTER_ARB\0"
+ "GL_BUFFER_MAP_POINTER_OES\0"
+ "GL_BUFFER_OBJECT_APPLE\0"
+ "GL_BUFFER_SERIALIZED_MODIFY_APPLE\0"
+ "GL_BUFFER_SIZE\0"
+ "GL_BUFFER_SIZE_ARB\0"
+ "GL_BUFFER_USAGE\0"
+ "GL_BUFFER_USAGE_ARB\0"
+ "GL_BUMP_ENVMAP_ATI\0"
+ "GL_BUMP_NUM_TEX_UNITS_ATI\0"
+ "GL_BUMP_ROT_MATRIX_ATI\0"
+ "GL_BUMP_ROT_MATRIX_SIZE_ATI\0"
+ "GL_BUMP_TARGET_ATI\0"
+ "GL_BUMP_TEX_UNITS_ATI\0"
+ "GL_BYTE\0"
+ "GL_C3F_V3F\0"
+ "GL_C4F_N3F_V3F\0"
+ "GL_C4UB_V2F\0"
+ "GL_C4UB_V3F\0"
+ "GL_CCW\0"
+ "GL_CLAMP\0"
+ "GL_CLAMP_FRAGMENT_COLOR_ARB\0"
+ "GL_CLAMP_READ_COLOR\0"
+ "GL_CLAMP_READ_COLOR_ARB\0"
+ "GL_CLAMP_TO_BORDER\0"
+ "GL_CLAMP_TO_BORDER_ARB\0"
+ "GL_CLAMP_TO_BORDER_SGIS\0"
+ "GL_CLAMP_TO_EDGE\0"
+ "GL_CLAMP_TO_EDGE_SGIS\0"
+ "GL_CLAMP_VERTEX_COLOR_ARB\0"
+ "GL_CLEAR\0"
+ "GL_CLIENT_ACTIVE_TEXTURE\0"
+ "GL_CLIENT_ACTIVE_TEXTURE_ARB\0"
+ "GL_CLIENT_ALL_ATTRIB_BITS\0"
+ "GL_CLIENT_ATTRIB_STACK_DEPTH\0"
+ "GL_CLIENT_PIXEL_STORE_BIT\0"
+ "GL_CLIENT_VERTEX_ARRAY_BIT\0"
+ "GL_CLIP_DISTANCE0\0"
+ "GL_CLIP_DISTANCE1\0"
+ "GL_CLIP_DISTANCE2\0"
+ "GL_CLIP_DISTANCE3\0"
+ "GL_CLIP_DISTANCE4\0"
+ "GL_CLIP_DISTANCE5\0"
+ "GL_CLIP_DISTANCE6\0"
+ "GL_CLIP_DISTANCE7\0"
+ "GL_CLIP_PLANE0\0"
+ "GL_CLIP_PLANE1\0"
+ "GL_CLIP_PLANE2\0"
+ "GL_CLIP_PLANE3\0"
+ "GL_CLIP_PLANE4\0"
+ "GL_CLIP_PLANE5\0"
+ "GL_CLIP_VOLUME_CLIPPING_HINT_EXT\0"
+ "GL_COEFF\0"
+ "GL_COLOR\0"
+ "GL_COLOR_ARRAY\0"
+ "GL_COLOR_ARRAY_BUFFER_BINDING\0"
+ "GL_COLOR_ARRAY_BUFFER_BINDING_ARB\0"
+ "GL_COLOR_ARRAY_POINTER\0"
+ "GL_COLOR_ARRAY_SIZE\0"
+ "GL_COLOR_ARRAY_STRIDE\0"
+ "GL_COLOR_ARRAY_TYPE\0"
+ "GL_COLOR_ATTACHMENT0\0"
+ "GL_COLOR_ATTACHMENT0_EXT\0"
+ "GL_COLOR_ATTACHMENT0_OES\0"
+ "GL_COLOR_ATTACHMENT1\0"
+ "GL_COLOR_ATTACHMENT10\0"
+ "GL_COLOR_ATTACHMENT10_EXT\0"
+ "GL_COLOR_ATTACHMENT11\0"
+ "GL_COLOR_ATTACHMENT11_EXT\0"
+ "GL_COLOR_ATTACHMENT12\0"
+ "GL_COLOR_ATTACHMENT12_EXT\0"
+ "GL_COLOR_ATTACHMENT13\0"
+ "GL_COLOR_ATTACHMENT13_EXT\0"
+ "GL_COLOR_ATTACHMENT14\0"
+ "GL_COLOR_ATTACHMENT14_EXT\0"
+ "GL_COLOR_ATTACHMENT15\0"
+ "GL_COLOR_ATTACHMENT15_EXT\0"
+ "GL_COLOR_ATTACHMENT1_EXT\0"
+ "GL_COLOR_ATTACHMENT2\0"
+ "GL_COLOR_ATTACHMENT2_EXT\0"
+ "GL_COLOR_ATTACHMENT3\0"
+ "GL_COLOR_ATTACHMENT3_EXT\0"
+ "GL_COLOR_ATTACHMENT4\0"
+ "GL_COLOR_ATTACHMENT4_EXT\0"
+ "GL_COLOR_ATTACHMENT5\0"
+ "GL_COLOR_ATTACHMENT5_EXT\0"
+ "GL_COLOR_ATTACHMENT6\0"
+ "GL_COLOR_ATTACHMENT6_EXT\0"
+ "GL_COLOR_ATTACHMENT7\0"
+ "GL_COLOR_ATTACHMENT7_EXT\0"
+ "GL_COLOR_ATTACHMENT8\0"
+ "GL_COLOR_ATTACHMENT8_EXT\0"
+ "GL_COLOR_ATTACHMENT9\0"
+ "GL_COLOR_ATTACHMENT9_EXT\0"
+ "GL_COLOR_BUFFER_BIT\0"
+ "GL_COLOR_CLEAR_VALUE\0"
+ "GL_COLOR_INDEX\0"
+ "GL_COLOR_INDEXES\0"
+ "GL_COLOR_LOGIC_OP\0"
+ "GL_COLOR_MATERIAL\0"
+ "GL_COLOR_MATERIAL_FACE\0"
+ "GL_COLOR_MATERIAL_PARAMETER\0"
+ "GL_COLOR_MATRIX\0"
+ "GL_COLOR_MATRIX_SGI\0"
+ "GL_COLOR_MATRIX_STACK_DEPTH\0"
+ "GL_COLOR_MATRIX_STACK_DEPTH_SGI\0"
+ "GL_COLOR_SUM\0"
+ "GL_COLOR_SUM_ARB\0"
+ "GL_COLOR_TABLE\0"
+ "GL_COLOR_TABLE_ALPHA_SIZE\0"
+ "GL_COLOR_TABLE_ALPHA_SIZE_EXT\0"
+ "GL_COLOR_TABLE_ALPHA_SIZE_SGI\0"
+ "GL_COLOR_TABLE_BIAS\0"
+ "GL_COLOR_TABLE_BIAS_SGI\0"
+ "GL_COLOR_TABLE_BLUE_SIZE\0"
+ "GL_COLOR_TABLE_BLUE_SIZE_EXT\0"
+ "GL_COLOR_TABLE_BLUE_SIZE_SGI\0"
+ "GL_COLOR_TABLE_FORMAT\0"
+ "GL_COLOR_TABLE_FORMAT_EXT\0"
+ "GL_COLOR_TABLE_FORMAT_SGI\0"
+ "GL_COLOR_TABLE_GREEN_SIZE\0"
+ "GL_COLOR_TABLE_GREEN_SIZE_EXT\0"
+ "GL_COLOR_TABLE_GREEN_SIZE_SGI\0"
+ "GL_COLOR_TABLE_INTENSITY_SIZE\0"
+ "GL_COLOR_TABLE_INTENSITY_SIZE_EXT\0"
+ "GL_COLOR_TABLE_INTENSITY_SIZE_SGI\0"
+ "GL_COLOR_TABLE_LUMINANCE_SIZE\0"
+ "GL_COLOR_TABLE_LUMINANCE_SIZE_EXT\0"
+ "GL_COLOR_TABLE_LUMINANCE_SIZE_SGI\0"
+ "GL_COLOR_TABLE_RED_SIZE\0"
+ "GL_COLOR_TABLE_RED_SIZE_EXT\0"
+ "GL_COLOR_TABLE_RED_SIZE_SGI\0"
+ "GL_COLOR_TABLE_SCALE\0"
+ "GL_COLOR_TABLE_SCALE_SGI\0"
+ "GL_COLOR_TABLE_WIDTH\0"
+ "GL_COLOR_TABLE_WIDTH_EXT\0"
+ "GL_COLOR_TABLE_WIDTH_SGI\0"
+ "GL_COLOR_WRITEMASK\0"
+ "GL_COMBINE\0"
+ "GL_COMBINE4\0"
+ "GL_COMBINE_ALPHA\0"
+ "GL_COMBINE_ALPHA_ARB\0"
+ "GL_COMBINE_ALPHA_EXT\0"
+ "GL_COMBINE_ARB\0"
+ "GL_COMBINE_EXT\0"
+ "GL_COMBINE_RGB\0"
+ "GL_COMBINE_RGB_ARB\0"
+ "GL_COMBINE_RGB_EXT\0"
+ "GL_COMPARE_REF_DEPTH_TO_TEXTURE_EXT\0"
+ "GL_COMPARE_REF_TO_TEXTURE\0"
+ "GL_COMPARE_R_TO_TEXTURE\0"
+ "GL_COMPARE_R_TO_TEXTURE_ARB\0"
+ "GL_COMPILE\0"
+ "GL_COMPILE_AND_EXECUTE\0"
+ "GL_COMPILE_STATUS\0"
+ "GL_COMPRESSED_ALPHA\0"
+ "GL_COMPRESSED_ALPHA_ARB\0"
+ "GL_COMPRESSED_INTENSITY\0"
+ "GL_COMPRESSED_INTENSITY_ARB\0"
+ "GL_COMPRESSED_LUMINANCE\0"
+ "GL_COMPRESSED_LUMINANCE_ALPHA\0"
+ "GL_COMPRESSED_LUMINANCE_ALPHA_ARB\0"
+ "GL_COMPRESSED_LUMINANCE_ARB\0"
+ "GL_COMPRESSED_RED\0"
+ "GL_COMPRESSED_RG\0"
+ "GL_COMPRESSED_RGB\0"
+ "GL_COMPRESSED_RGBA\0"
+ "GL_COMPRESSED_RGBA_ARB\0"
+ "GL_COMPRESSED_RGBA_FXT1_3DFX\0"
+ "GL_COMPRESSED_RGBA_S3TC_DXT1_EXT\0"
+ "GL_COMPRESSED_RGBA_S3TC_DXT3_EXT\0"
+ "GL_COMPRESSED_RGBA_S3TC_DXT5_EXT\0"
+ "GL_COMPRESSED_RGB_ARB\0"
+ "GL_COMPRESSED_RGB_FXT1_3DFX\0"
+ "GL_COMPRESSED_RGB_S3TC_DXT1_EXT\0"
+ "GL_COMPRESSED_SLUMINANCE\0"
+ "GL_COMPRESSED_SLUMINANCE_ALPHA\0"
+ "GL_COMPRESSED_SRGB\0"
+ "GL_COMPRESSED_SRGB_ALPHA\0"
+ "GL_COMPRESSED_TEXTURE_FORMATS\0"
+ "GL_CONDITION_SATISFIED\0"
+ "GL_CONSTANT\0"
+ "GL_CONSTANT_ALPHA\0"
+ "GL_CONSTANT_ALPHA_EXT\0"
+ "GL_CONSTANT_ARB\0"
+ "GL_CONSTANT_ATTENUATION\0"
+ "GL_CONSTANT_BORDER_HP\0"
+ "GL_CONSTANT_COLOR\0"
+ "GL_CONSTANT_COLOR_EXT\0"
+ "GL_CONSTANT_EXT\0"
+ "GL_CONTEXT_COMPATIBILITY_PROFILE_BIT\0"
+ "GL_CONTEXT_CORE_PROFILE_BIT\0"
+ "GL_CONTEXT_FLAGS\0"
+ "GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT\0"
+ "GL_CONTEXT_FLAG_ROBUST_ACCESS_BIT_ARB\0"
+ "GL_CONTEXT_PROFILE_MASK\0"
+ "GL_CONVOLUTION_1D\0"
+ "GL_CONVOLUTION_2D\0"
+ "GL_CONVOLUTION_BORDER_COLOR\0"
+ "GL_CONVOLUTION_BORDER_COLOR_HP\0"
+ "GL_CONVOLUTION_BORDER_MODE\0"
+ "GL_CONVOLUTION_BORDER_MODE_EXT\0"
+ "GL_CONVOLUTION_FILTER_BIAS\0"
+ "GL_CONVOLUTION_FILTER_BIAS_EXT\0"
+ "GL_CONVOLUTION_FILTER_SCALE\0"
+ "GL_CONVOLUTION_FILTER_SCALE_EXT\0"
+ "GL_CONVOLUTION_FORMAT\0"
+ "GL_CONVOLUTION_FORMAT_EXT\0"
+ "GL_CONVOLUTION_HEIGHT\0"
+ "GL_CONVOLUTION_HEIGHT_EXT\0"
+ "GL_CONVOLUTION_WIDTH\0"
+ "GL_CONVOLUTION_WIDTH_EXT\0"
+ "GL_COORD_REPLACE\0"
+ "GL_COORD_REPLACE_ARB\0"
+ "GL_COORD_REPLACE_NV\0"
+ "GL_COORD_REPLACE_OES\0"
+ "GL_COPY\0"
+ "GL_COPY_INVERTED\0"
+ "GL_COPY_PIXEL_TOKEN\0"
+ "GL_COPY_READ_BUFFER\0"
+ "GL_COPY_WRITE_BUFFER\0"
+ "GL_CULL_FACE\0"
+ "GL_CULL_FACE_MODE\0"
+ "GL_CULL_VERTEX_EXT\0"
+ "GL_CULL_VERTEX_EYE_POSITION_EXT\0"
+ "GL_CULL_VERTEX_OBJECT_POSITION_EXT\0"
+ "GL_CURRENT_ATTRIB_NV\0"
+ "GL_CURRENT_BIT\0"
+ "GL_CURRENT_COLOR\0"
+ "GL_CURRENT_FOG_COORD\0"
+ "GL_CURRENT_FOG_COORDINATE\0"
+ "GL_CURRENT_INDEX\0"
+ "GL_CURRENT_MATRIX_ARB\0"
+ "GL_CURRENT_MATRIX_INDEX_ARB\0"
+ "GL_CURRENT_MATRIX_NV\0"
+ "GL_CURRENT_MATRIX_STACK_DEPTH_ARB\0"
+ "GL_CURRENT_MATRIX_STACK_DEPTH_NV\0"
+ "GL_CURRENT_NORMAL\0"
+ "GL_CURRENT_PALETTE_MATRIX_ARB\0"
+ "GL_CURRENT_PALETTE_MATRIX_OES\0"
+ "GL_CURRENT_PROGRAM\0"
+ "GL_CURRENT_QUERY\0"
+ "GL_CURRENT_QUERY_ARB\0"
+ "GL_CURRENT_RASTER_COLOR\0"
+ "GL_CURRENT_RASTER_DISTANCE\0"
+ "GL_CURRENT_RASTER_INDEX\0"
+ "GL_CURRENT_RASTER_POSITION\0"
+ "GL_CURRENT_RASTER_POSITION_VALID\0"
+ "GL_CURRENT_RASTER_SECONDARY_COLOR\0"
+ "GL_CURRENT_RASTER_TEXTURE_COORDS\0"
+ "GL_CURRENT_SECONDARY_COLOR\0"
+ "GL_CURRENT_TEXTURE_COORDS\0"
+ "GL_CURRENT_VERTEX_ATTRIB\0"
+ "GL_CURRENT_VERTEX_ATTRIB_ARB\0"
+ "GL_CURRENT_WEIGHT_ARB\0"
+ "GL_CW\0"
+ "GL_DEBUG_ASSERT_MESA\0"
+ "GL_DEBUG_OBJECT_MESA\0"
+ "GL_DEBUG_PRINT_MESA\0"
+ "GL_DECAL\0"
+ "GL_DECR\0"
+ "GL_DECR_WRAP\0"
+ "GL_DECR_WRAP_EXT\0"
+ "GL_DELETE_STATUS\0"
+ "GL_DEPTH\0"
+ "GL_DEPTH24_STENCIL8\0"
+ "GL_DEPTH24_STENCIL8_EXT\0"
+ "GL_DEPTH24_STENCIL8_OES\0"
+ "GL_DEPTH_ATTACHMENT\0"
+ "GL_DEPTH_ATTACHMENT_EXT\0"
+ "GL_DEPTH_ATTACHMENT_OES\0"
+ "GL_DEPTH_BIAS\0"
+ "GL_DEPTH_BITS\0"
+ "GL_DEPTH_BOUNDS_EXT\0"
+ "GL_DEPTH_BOUNDS_TEST_EXT\0"
+ "GL_DEPTH_BUFFER\0"
+ "GL_DEPTH_BUFFER_BIT\0"
+ "GL_DEPTH_CLAMP\0"
+ "GL_DEPTH_CLAMP_NV\0"
+ "GL_DEPTH_CLEAR_VALUE\0"
+ "GL_DEPTH_COMPONENT\0"
+ "GL_DEPTH_COMPONENT16\0"
+ "GL_DEPTH_COMPONENT16_ARB\0"
+ "GL_DEPTH_COMPONENT16_OES\0"
+ "GL_DEPTH_COMPONENT16_SGIX\0"
+ "GL_DEPTH_COMPONENT24\0"
+ "GL_DEPTH_COMPONENT24_ARB\0"
+ "GL_DEPTH_COMPONENT24_OES\0"
+ "GL_DEPTH_COMPONENT24_SGIX\0"
+ "GL_DEPTH_COMPONENT32\0"
+ "GL_DEPTH_COMPONENT32_ARB\0"
+ "GL_DEPTH_COMPONENT32_OES\0"
+ "GL_DEPTH_COMPONENT32_SGIX\0"
+ "GL_DEPTH_FUNC\0"
+ "GL_DEPTH_RANGE\0"
+ "GL_DEPTH_SCALE\0"
+ "GL_DEPTH_STENCIL\0"
+ "GL_DEPTH_STENCIL_ATTACHMENT\0"
+ "GL_DEPTH_STENCIL_EXT\0"
+ "GL_DEPTH_STENCIL_NV\0"
+ "GL_DEPTH_STENCIL_OES\0"
+ "GL_DEPTH_STENCIL_TO_BGRA_NV\0"
+ "GL_DEPTH_STENCIL_TO_RGBA_NV\0"
+ "GL_DEPTH_TEST\0"
+ "GL_DEPTH_TEXTURE_MODE\0"
+ "GL_DEPTH_TEXTURE_MODE_ARB\0"
+ "GL_DEPTH_WRITEMASK\0"
+ "GL_DIFFUSE\0"
+ "GL_DITHER\0"
+ "GL_DOMAIN\0"
+ "GL_DONT_CARE\0"
+ "GL_DOT3_RGB\0"
+ "GL_DOT3_RGBA\0"
+ "GL_DOT3_RGBA_ARB\0"
+ "GL_DOT3_RGBA_EXT\0"
+ "GL_DOT3_RGB_ARB\0"
+ "GL_DOT3_RGB_EXT\0"
+ "GL_DOUBLE\0"
+ "GL_DOUBLEBUFFER\0"
+ "GL_DRAW_BUFFER\0"
+ "GL_DRAW_BUFFER0\0"
+ "GL_DRAW_BUFFER0_ARB\0"
+ "GL_DRAW_BUFFER0_ATI\0"
+ "GL_DRAW_BUFFER1\0"
+ "GL_DRAW_BUFFER10\0"
+ "GL_DRAW_BUFFER10_ARB\0"
+ "GL_DRAW_BUFFER10_ATI\0"
+ "GL_DRAW_BUFFER11\0"
+ "GL_DRAW_BUFFER11_ARB\0"
+ "GL_DRAW_BUFFER11_ATI\0"
+ "GL_DRAW_BUFFER12\0"
+ "GL_DRAW_BUFFER12_ARB\0"
+ "GL_DRAW_BUFFER12_ATI\0"
+ "GL_DRAW_BUFFER13\0"
+ "GL_DRAW_BUFFER13_ARB\0"
+ "GL_DRAW_BUFFER13_ATI\0"
+ "GL_DRAW_BUFFER14\0"
+ "GL_DRAW_BUFFER14_ARB\0"
+ "GL_DRAW_BUFFER14_ATI\0"
+ "GL_DRAW_BUFFER15\0"
+ "GL_DRAW_BUFFER15_ARB\0"
+ "GL_DRAW_BUFFER15_ATI\0"
+ "GL_DRAW_BUFFER1_ARB\0"
+ "GL_DRAW_BUFFER1_ATI\0"
+ "GL_DRAW_BUFFER2\0"
+ "GL_DRAW_BUFFER2_ARB\0"
+ "GL_DRAW_BUFFER2_ATI\0"
+ "GL_DRAW_BUFFER3\0"
+ "GL_DRAW_BUFFER3_ARB\0"
+ "GL_DRAW_BUFFER3_ATI\0"
+ "GL_DRAW_BUFFER4\0"
+ "GL_DRAW_BUFFER4_ARB\0"
+ "GL_DRAW_BUFFER4_ATI\0"
+ "GL_DRAW_BUFFER5\0"
+ "GL_DRAW_BUFFER5_ARB\0"
+ "GL_DRAW_BUFFER5_ATI\0"
+ "GL_DRAW_BUFFER6\0"
+ "GL_DRAW_BUFFER6_ARB\0"
+ "GL_DRAW_BUFFER6_ATI\0"
+ "GL_DRAW_BUFFER7\0"
+ "GL_DRAW_BUFFER7_ARB\0"
+ "GL_DRAW_BUFFER7_ATI\0"
+ "GL_DRAW_BUFFER8\0"
+ "GL_DRAW_BUFFER8_ARB\0"
+ "GL_DRAW_BUFFER8_ATI\0"
+ "GL_DRAW_BUFFER9\0"
+ "GL_DRAW_BUFFER9_ARB\0"
+ "GL_DRAW_BUFFER9_ATI\0"
+ "GL_DRAW_FRAMEBUFFER\0"
+ "GL_DRAW_FRAMEBUFFER_BINDING\0"
+ "GL_DRAW_FRAMEBUFFER_BINDING_EXT\0"
+ "GL_DRAW_FRAMEBUFFER_EXT\0"
+ "GL_DRAW_PIXEL_TOKEN\0"
+ "GL_DST_ALPHA\0"
+ "GL_DST_COLOR\0"
+ "GL_DU8DV8_ATI\0"
+ "GL_DUDV_ATI\0"
+ "GL_DYNAMIC_COPY\0"
+ "GL_DYNAMIC_COPY_ARB\0"
+ "GL_DYNAMIC_DRAW\0"
+ "GL_DYNAMIC_DRAW_ARB\0"
+ "GL_DYNAMIC_READ\0"
+ "GL_DYNAMIC_READ_ARB\0"
+ "GL_EDGE_FLAG\0"
+ "GL_EDGE_FLAG_ARRAY\0"
+ "GL_EDGE_FLAG_ARRAY_BUFFER_BINDING\0"
+ "GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB\0"
+ "GL_EDGE_FLAG_ARRAY_POINTER\0"
+ "GL_EDGE_FLAG_ARRAY_STRIDE\0"
+ "GL_ELEMENT_ARRAY_BUFFER\0"
+ "GL_ELEMENT_ARRAY_BUFFER_BINDING\0"
+ "GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB\0"
+ "GL_EMISSION\0"
+ "GL_ENABLE_BIT\0"
+ "GL_EQUAL\0"
+ "GL_EQUIV\0"
+ "GL_EVAL_BIT\0"
+ "GL_EXP\0"
+ "GL_EXP2\0"
+ "GL_EXTENSIONS\0"
+ "GL_EYE_LINEAR\0"
+ "GL_EYE_PLANE\0"
+ "GL_EYE_PLANE_ABSOLUTE_NV\0"
+ "GL_EYE_RADIAL_NV\0"
+ "GL_FALSE\0"
+ "GL_FASTEST\0"
+ "GL_FEEDBACK\0"
+ "GL_FEEDBACK_BUFFER_POINTER\0"
+ "GL_FEEDBACK_BUFFER_SIZE\0"
+ "GL_FEEDBACK_BUFFER_TYPE\0"
+ "GL_FILL\0"
+ "GL_FIRST_VERTEX_CONVENTION\0"
+ "GL_FIRST_VERTEX_CONVENTION_EXT\0"
+ "GL_FIXED\0"
+ "GL_FIXED_OES\0"
+ "GL_FIXED_ONLY\0"
+ "GL_FIXED_ONLY_ARB\0"
+ "GL_FLAT\0"
+ "GL_FLOAT\0"
+ "GL_FLOAT_MAT2\0"
+ "GL_FLOAT_MAT2_ARB\0"
+ "GL_FLOAT_MAT2x3\0"
+ "GL_FLOAT_MAT2x4\0"
+ "GL_FLOAT_MAT3\0"
+ "GL_FLOAT_MAT3_ARB\0"
+ "GL_FLOAT_MAT3x2\0"
+ "GL_FLOAT_MAT3x4\0"
+ "GL_FLOAT_MAT4\0"
+ "GL_FLOAT_MAT4_ARB\0"
+ "GL_FLOAT_MAT4x2\0"
+ "GL_FLOAT_MAT4x3\0"
+ "GL_FLOAT_VEC2\0"
+ "GL_FLOAT_VEC2_ARB\0"
+ "GL_FLOAT_VEC3\0"
+ "GL_FLOAT_VEC3_ARB\0"
+ "GL_FLOAT_VEC4\0"
+ "GL_FLOAT_VEC4_ARB\0"
+ "GL_FOG\0"
+ "GL_FOG_BIT\0"
+ "GL_FOG_COLOR\0"
+ "GL_FOG_COORD\0"
+ "GL_FOG_COORDINATE\0"
+ "GL_FOG_COORDINATE_ARRAY\0"
+ "GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING\0"
+ "GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB\0"
+ "GL_FOG_COORDINATE_ARRAY_POINTER\0"
+ "GL_FOG_COORDINATE_ARRAY_STRIDE\0"
+ "GL_FOG_COORDINATE_ARRAY_TYPE\0"
+ "GL_FOG_COORDINATE_SOURCE\0"
+ "GL_FOG_COORD_ARRAY\0"
+ "GL_FOG_COORD_ARRAY_BUFFER_BINDING\0"
+ "GL_FOG_COORD_ARRAY_POINTER\0"
+ "GL_FOG_COORD_ARRAY_STRIDE\0"
+ "GL_FOG_COORD_ARRAY_TYPE\0"
+ "GL_FOG_COORD_SRC\0"
+ "GL_FOG_DENSITY\0"
+ "GL_FOG_DISTANCE_MODE_NV\0"
+ "GL_FOG_END\0"
+ "GL_FOG_HINT\0"
+ "GL_FOG_INDEX\0"
+ "GL_FOG_MODE\0"
+ "GL_FOG_OFFSET_SGIX\0"
+ "GL_FOG_OFFSET_VALUE_SGIX\0"
+ "GL_FOG_START\0"
+ "GL_FRAGMENT_DEPTH\0"
+ "GL_FRAGMENT_PROGRAM_ARB\0"
+ "GL_FRAGMENT_SHADER\0"
+ "GL_FRAGMENT_SHADER_ARB\0"
+ "GL_FRAGMENT_SHADER_DERIVATIVE_HINT\0"
+ "GL_FRAGMENT_SHADER_DERIVATIVE_HINT_OES\0"
+ "GL_FRAMEBUFFER\0"
+ "GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE\0"
+ "GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE\0"
+ "GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING\0"
+ "GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE\0"
+ "GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE\0"
+ "GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE\0"
+ "GL_FRAMEBUFFER_ATTACHMENT_LAYERED\0"
+ "GL_FRAMEBUFFER_ATTACHMENT_LAYERED_ARB\0"
+ "GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME\0"
+ "GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT\0"
+ "GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_OES\0"
+ "GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE\0"
+ "GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT\0"
+ "GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_OES\0"
+ "GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE\0"
+ "GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE\0"
+ "GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT\0"
+ "GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_OES\0"
+ "GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE\0"
+ "GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_EXT\0"
+ "GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_OES\0"
+ "GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER\0"
+ "GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT\0"
+ "GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL\0"
+ "GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT\0"
+ "GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_OES\0"
+ "GL_FRAMEBUFFER_BINDING\0"
+ "GL_FRAMEBUFFER_BINDING_EXT\0"
+ "GL_FRAMEBUFFER_BINDING_OES\0"
+ "GL_FRAMEBUFFER_COMPLETE\0"
+ "GL_FRAMEBUFFER_COMPLETE_EXT\0"
+ "GL_FRAMEBUFFER_COMPLETE_OES\0"
+ "GL_FRAMEBUFFER_DEFAULT\0"
+ "GL_FRAMEBUFFER_EXT\0"
+ "GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT\0"
+ "GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT\0"
+ "GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_OES\0"
+ "GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS\0"
+ "GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT\0"
+ "GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_OES\0"
+ "GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER\0"
+ "GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT\0"
+ "GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_OES\0"
+ "GL_FRAMEBUFFER_INCOMPLETE_DUPLICATE_ATTACHMENT_EXT\0"
+ "GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT\0"
+ "GL_FRAMEBUFFER_INCOMPLETE_FORMATS_OES\0"
+ "GL_FRAMEBUFFER_INCOMPLETE_LAYER_COUNT_ARB\0"
+ "GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS\0"
+ "GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_ARB\0"
+ "GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT\0"
+ "GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT\0"
+ "GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_OES\0"
+ "GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE\0"
+ "GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_EXT\0"
+ "GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER\0"
+ "GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT\0"
+ "GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_OES\0"
+ "GL_FRAMEBUFFER_OES\0"
+ "GL_FRAMEBUFFER_STATUS_ERROR_EXT\0"
+ "GL_FRAMEBUFFER_UNDEFINED\0"
+ "GL_FRAMEBUFFER_UNSUPPORTED\0"
+ "GL_FRAMEBUFFER_UNSUPPORTED_EXT\0"
+ "GL_FRAMEBUFFER_UNSUPPORTED_OES\0"
+ "GL_FRONT\0"
+ "GL_FRONT_AND_BACK\0"
+ "GL_FRONT_FACE\0"
+ "GL_FRONT_LEFT\0"
+ "GL_FRONT_RIGHT\0"
+ "GL_FUNC_ADD\0"
+ "GL_FUNC_ADD_EXT\0"
+ "GL_FUNC_ADD_OES\0"
+ "GL_FUNC_REVERSE_SUBTRACT\0"
+ "GL_FUNC_REVERSE_SUBTRACT_EXT\0"
+ "GL_FUNC_REVERSE_SUBTRACT_OES\0"
+ "GL_FUNC_SUBTRACT\0"
+ "GL_FUNC_SUBTRACT_EXT\0"
+ "GL_FUNC_SUBTRACT_OES\0"
+ "GL_GENERATE_MIPMAP\0"
+ "GL_GENERATE_MIPMAP_HINT\0"
+ "GL_GENERATE_MIPMAP_HINT_SGIS\0"
+ "GL_GENERATE_MIPMAP_SGIS\0"
+ "GL_GEOMETRY_INPUT_TYPE\0"
+ "GL_GEOMETRY_INPUT_TYPE_ARB\0"
+ "GL_GEOMETRY_OUTPUT_TYPE\0"
+ "GL_GEOMETRY_OUTPUT_TYPE_ARB\0"
+ "GL_GEOMETRY_SHADER\0"
+ "GL_GEOMETRY_SHADER_ARB\0"
+ "GL_GEOMETRY_VERTICES_OUT\0"
+ "GL_GEOMETRY_VERTICES_OUT_ARB\0"
+ "GL_GEQUAL\0"
+ "GL_GREATER\0"
+ "GL_GREEN\0"
+ "GL_GREEN_BIAS\0"
+ "GL_GREEN_BITS\0"
+ "GL_GREEN_INTEGER\0"
+ "GL_GREEN_INTEGER_EXT\0"
+ "GL_GREEN_SCALE\0"
+ "GL_GUILTY_CONTEXT_RESET_ARB\0"
+ "GL_HALF_FLOAT\0"
+ "GL_HALF_FLOAT_OES\0"
+ "GL_HIGH_FLOAT\0"
+ "GL_HIGH_INT\0"
+ "GL_HINT_BIT\0"
+ "GL_HISTOGRAM\0"
+ "GL_HISTOGRAM_ALPHA_SIZE\0"
+ "GL_HISTOGRAM_ALPHA_SIZE_EXT\0"
+ "GL_HISTOGRAM_BLUE_SIZE\0"
+ "GL_HISTOGRAM_BLUE_SIZE_EXT\0"
+ "GL_HISTOGRAM_EXT\0"
+ "GL_HISTOGRAM_FORMAT\0"
+ "GL_HISTOGRAM_FORMAT_EXT\0"
+ "GL_HISTOGRAM_GREEN_SIZE\0"
+ "GL_HISTOGRAM_GREEN_SIZE_EXT\0"
+ "GL_HISTOGRAM_LUMINANCE_SIZE\0"
+ "GL_HISTOGRAM_LUMINANCE_SIZE_EXT\0"
+ "GL_HISTOGRAM_RED_SIZE\0"
+ "GL_HISTOGRAM_RED_SIZE_EXT\0"
+ "GL_HISTOGRAM_SINK\0"
+ "GL_HISTOGRAM_SINK_EXT\0"
+ "GL_HISTOGRAM_WIDTH\0"
+ "GL_HISTOGRAM_WIDTH_EXT\0"
+ "GL_IDENTITY_NV\0"
+ "GL_IGNORE_BORDER_HP\0"
+ "GL_IMPLEMENTATION_COLOR_READ_FORMAT\0"
+ "GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES\0"
+ "GL_IMPLEMENTATION_COLOR_READ_TYPE\0"
+ "GL_IMPLEMENTATION_COLOR_READ_TYPE_OES\0"
+ "GL_INCR\0"
+ "GL_INCR_WRAP\0"
+ "GL_INCR_WRAP_EXT\0"
+ "GL_INDEX\0"
+ "GL_INDEX_ARRAY\0"
+ "GL_INDEX_ARRAY_BUFFER_BINDING\0"
+ "GL_INDEX_ARRAY_BUFFER_BINDING_ARB\0"
+ "GL_INDEX_ARRAY_POINTER\0"
+ "GL_INDEX_ARRAY_STRIDE\0"
+ "GL_INDEX_ARRAY_TYPE\0"
+ "GL_INDEX_BITS\0"
+ "GL_INDEX_CLEAR_VALUE\0"
+ "GL_INDEX_LOGIC_OP\0"
+ "GL_INDEX_MODE\0"
+ "GL_INDEX_OFFSET\0"
+ "GL_INDEX_SHIFT\0"
+ "GL_INDEX_WRITEMASK\0"
+ "GL_INFO_LOG_LENGTH\0"
+ "GL_INNOCENT_CONTEXT_RESET_ARB\0"
+ "GL_INT\0"
+ "GL_INTENSITY\0"
+ "GL_INTENSITY12\0"
+ "GL_INTENSITY12_EXT\0"
+ "GL_INTENSITY16\0"
+ "GL_INTENSITY16I_EXT\0"
+ "GL_INTENSITY16UI_EXT\0"
+ "GL_INTENSITY16_EXT\0"
+ "GL_INTENSITY32I_EXT\0"
+ "GL_INTENSITY32UI_EXT\0"
+ "GL_INTENSITY4\0"
+ "GL_INTENSITY4_EXT\0"
+ "GL_INTENSITY8\0"
+ "GL_INTENSITY8I_EXT\0"
+ "GL_INTENSITY8UI_EXT\0"
+ "GL_INTENSITY8_EXT\0"
+ "GL_INTENSITY_EXT\0"
+ "GL_INTERLEAVED_ATTRIBS\0"
+ "GL_INTERLEAVED_ATTRIBS_EXT\0"
+ "GL_INTERPOLATE\0"
+ "GL_INTERPOLATE_ARB\0"
+ "GL_INTERPOLATE_EXT\0"
+ "GL_INT_10_10_10_2_OES\0"
+ "GL_INT_SAMPLER_1D\0"
+ "GL_INT_SAMPLER_1D_ARRAY\0"
+ "GL_INT_SAMPLER_1D_ARRAY_EXT\0"
+ "GL_INT_SAMPLER_1D_EXT\0"
+ "GL_INT_SAMPLER_2D\0"
+ "GL_INT_SAMPLER_2D_ARRAY\0"
+ "GL_INT_SAMPLER_2D_ARRAY_EXT\0"
+ "GL_INT_SAMPLER_2D_EXT\0"
+ "GL_INT_SAMPLER_2D_RECT\0"
+ "GL_INT_SAMPLER_2D_RECT_EXT\0"
+ "GL_INT_SAMPLER_3D\0"
+ "GL_INT_SAMPLER_3D_EXT\0"
+ "GL_INT_SAMPLER_BUFFER\0"
+ "GL_INT_SAMPLER_BUFFER_EXT\0"
+ "GL_INT_SAMPLER_CUBE\0"
+ "GL_INT_SAMPLER_CUBE_EXT\0"
+ "GL_INT_VEC2\0"
+ "GL_INT_VEC2_ARB\0"
+ "GL_INT_VEC3\0"
+ "GL_INT_VEC3_ARB\0"
+ "GL_INT_VEC4\0"
+ "GL_INT_VEC4_ARB\0"
+ "GL_INVALID_ENUM\0"
+ "GL_INVALID_FRAMEBUFFER_OPERATION\0"
+ "GL_INVALID_FRAMEBUFFER_OPERATION_EXT\0"
+ "GL_INVALID_FRAMEBUFFER_OPERATION_OES\0"
+ "GL_INVALID_OPERATION\0"
+ "GL_INVALID_VALUE\0"
+ "GL_INVERSE_NV\0"
+ "GL_INVERSE_TRANSPOSE_NV\0"
+ "GL_INVERT\0"
+ "GL_KEEP\0"
+ "GL_LAST_VERTEX_CONVENTION\0"
+ "GL_LAST_VERTEX_CONVENTION_EXT\0"
+ "GL_LEFT\0"
+ "GL_LEQUAL\0"
+ "GL_LESS\0"
+ "GL_LIGHT0\0"
+ "GL_LIGHT1\0"
+ "GL_LIGHT2\0"
+ "GL_LIGHT3\0"
+ "GL_LIGHT4\0"
+ "GL_LIGHT5\0"
+ "GL_LIGHT6\0"
+ "GL_LIGHT7\0"
+ "GL_LIGHTING\0"
+ "GL_LIGHTING_BIT\0"
+ "GL_LIGHT_MODEL_AMBIENT\0"
+ "GL_LIGHT_MODEL_COLOR_CONTROL\0"
+ "GL_LIGHT_MODEL_COLOR_CONTROL_EXT\0"
+ "GL_LIGHT_MODEL_LOCAL_VIEWER\0"
+ "GL_LIGHT_MODEL_TWO_SIDE\0"
+ "GL_LINE\0"
+ "GL_LINEAR\0"
+ "GL_LINEAR_ATTENUATION\0"
+ "GL_LINEAR_CLIPMAP_LINEAR_SGIX\0"
+ "GL_LINEAR_CLIPMAP_NEAREST_SGIX\0"
+ "GL_LINEAR_MIPMAP_LINEAR\0"
+ "GL_LINEAR_MIPMAP_NEAREST\0"
+ "GL_LINES\0"
+ "GL_LINES_ADJACENCY\0"
+ "GL_LINES_ADJACENCY_ARB\0"
+ "GL_LINE_BIT\0"
+ "GL_LINE_LOOP\0"
+ "GL_LINE_RESET_TOKEN\0"
+ "GL_LINE_SMOOTH\0"
+ "GL_LINE_SMOOTH_HINT\0"
+ "GL_LINE_STIPPLE\0"
+ "GL_LINE_STIPPLE_PATTERN\0"
+ "GL_LINE_STIPPLE_REPEAT\0"
+ "GL_LINE_STRIP\0"
+ "GL_LINE_STRIP_ADJACENCY\0"
+ "GL_LINE_STRIP_ADJACENCY_ARB\0"
+ "GL_LINE_TOKEN\0"
+ "GL_LINE_WIDTH\0"
+ "GL_LINE_WIDTH_GRANULARITY\0"
+ "GL_LINE_WIDTH_RANGE\0"
+ "GL_LINK_STATUS\0"
+ "GL_LIST_BASE\0"
+ "GL_LIST_BIT\0"
+ "GL_LIST_INDEX\0"
+ "GL_LIST_MODE\0"
+ "GL_LOAD\0"
+ "GL_LOGIC_OP\0"
+ "GL_LOGIC_OP_MODE\0"
+ "GL_LOSE_CONTEXT_ON_RESET_ARB\0"
+ "GL_LOWER_LEFT\0"
+ "GL_LOW_FLOAT\0"
+ "GL_LOW_INT\0"
+ "GL_LUMINANCE\0"
+ "GL_LUMINANCE12\0"
+ "GL_LUMINANCE12_ALPHA12\0"
+ "GL_LUMINANCE12_ALPHA12_EXT\0"
+ "GL_LUMINANCE12_ALPHA4\0"
+ "GL_LUMINANCE12_ALPHA4_EXT\0"
+ "GL_LUMINANCE12_EXT\0"
+ "GL_LUMINANCE16\0"
+ "GL_LUMINANCE16I_EXT\0"
+ "GL_LUMINANCE16UI_EXT\0"
+ "GL_LUMINANCE16_ALPHA16\0"
+ "GL_LUMINANCE16_ALPHA16_EXT\0"
+ "GL_LUMINANCE16_EXT\0"
+ "GL_LUMINANCE32I_EXT\0"
+ "GL_LUMINANCE32UI_EXT\0"
+ "GL_LUMINANCE4\0"
+ "GL_LUMINANCE4_ALPHA4\0"
+ "GL_LUMINANCE4_ALPHA4_EXT\0"
+ "GL_LUMINANCE4_EXT\0"
+ "GL_LUMINANCE6_ALPHA2\0"
+ "GL_LUMINANCE6_ALPHA2_EXT\0"
+ "GL_LUMINANCE8\0"
+ "GL_LUMINANCE8I_EXT\0"
+ "GL_LUMINANCE8UI_EXT\0"
+ "GL_LUMINANCE8_ALPHA8\0"
+ "GL_LUMINANCE8_ALPHA8_EXT\0"
+ "GL_LUMINANCE8_EXT\0"
+ "GL_LUMINANCE_ALPHA\0"
+ "GL_LUMINANCE_ALPHA16I_EXT\0"
+ "GL_LUMINANCE_ALPHA16UI_EXT\0"
+ "GL_LUMINANCE_ALPHA32I_EXT\0"
+ "GL_LUMINANCE_ALPHA32UI_EXT\0"
+ "GL_LUMINANCE_ALPHA8I_EXT\0"
+ "GL_LUMINANCE_ALPHA8UI_EXT\0"
+ "GL_LUMINANCE_ALPHA_INTEGER_EXT\0"
+ "GL_LUMINANCE_INTEGER_EXT\0"
+ "GL_MAJOR_VERSION\0"
+ "GL_MAP1_COLOR_4\0"
+ "GL_MAP1_GRID_DOMAIN\0"
+ "GL_MAP1_GRID_SEGMENTS\0"
+ "GL_MAP1_INDEX\0"
+ "GL_MAP1_NORMAL\0"
+ "GL_MAP1_TEXTURE_COORD_1\0"
+ "GL_MAP1_TEXTURE_COORD_2\0"
+ "GL_MAP1_TEXTURE_COORD_3\0"
+ "GL_MAP1_TEXTURE_COORD_4\0"
+ "GL_MAP1_VERTEX_3\0"
+ "GL_MAP1_VERTEX_4\0"
+ "GL_MAP1_VERTEX_ATTRIB0_4_NV\0"
+ "GL_MAP1_VERTEX_ATTRIB10_4_NV\0"
+ "GL_MAP1_VERTEX_ATTRIB11_4_NV\0"
+ "GL_MAP1_VERTEX_ATTRIB12_4_NV\0"
+ "GL_MAP1_VERTEX_ATTRIB13_4_NV\0"
+ "GL_MAP1_VERTEX_ATTRIB14_4_NV\0"
+ "GL_MAP1_VERTEX_ATTRIB15_4_NV\0"
+ "GL_MAP1_VERTEX_ATTRIB1_4_NV\0"
+ "GL_MAP1_VERTEX_ATTRIB2_4_NV\0"
+ "GL_MAP1_VERTEX_ATTRIB3_4_NV\0"
+ "GL_MAP1_VERTEX_ATTRIB4_4_NV\0"
+ "GL_MAP1_VERTEX_ATTRIB5_4_NV\0"
+ "GL_MAP1_VERTEX_ATTRIB6_4_NV\0"
+ "GL_MAP1_VERTEX_ATTRIB7_4_NV\0"
+ "GL_MAP1_VERTEX_ATTRIB8_4_NV\0"
+ "GL_MAP1_VERTEX_ATTRIB9_4_NV\0"
+ "GL_MAP2_COLOR_4\0"
+ "GL_MAP2_GRID_DOMAIN\0"
+ "GL_MAP2_GRID_SEGMENTS\0"
+ "GL_MAP2_INDEX\0"
+ "GL_MAP2_NORMAL\0"
+ "GL_MAP2_TEXTURE_COORD_1\0"
+ "GL_MAP2_TEXTURE_COORD_2\0"
+ "GL_MAP2_TEXTURE_COORD_3\0"
+ "GL_MAP2_TEXTURE_COORD_4\0"
+ "GL_MAP2_VERTEX_3\0"
+ "GL_MAP2_VERTEX_4\0"
+ "GL_MAP2_VERTEX_ATTRIB0_4_NV\0"
+ "GL_MAP2_VERTEX_ATTRIB10_4_NV\0"
+ "GL_MAP2_VERTEX_ATTRIB11_4_NV\0"
+ "GL_MAP2_VERTEX_ATTRIB12_4_NV\0"
+ "GL_MAP2_VERTEX_ATTRIB13_4_NV\0"
+ "GL_MAP2_VERTEX_ATTRIB14_4_NV\0"
+ "GL_MAP2_VERTEX_ATTRIB15_4_NV\0"
+ "GL_MAP2_VERTEX_ATTRIB1_4_NV\0"
+ "GL_MAP2_VERTEX_ATTRIB2_4_NV\0"
+ "GL_MAP2_VERTEX_ATTRIB3_4_NV\0"
+ "GL_MAP2_VERTEX_ATTRIB4_4_NV\0"
+ "GL_MAP2_VERTEX_ATTRIB5_4_NV\0"
+ "GL_MAP2_VERTEX_ATTRIB6_4_NV\0"
+ "GL_MAP2_VERTEX_ATTRIB7_4_NV\0"
+ "GL_MAP2_VERTEX_ATTRIB8_4_NV\0"
+ "GL_MAP2_VERTEX_ATTRIB9_4_NV\0"
+ "GL_MAP_COLOR\0"
+ "GL_MAP_FLUSH_EXPLICIT_BIT\0"
+ "GL_MAP_INVALIDATE_BUFFER_BIT\0"
+ "GL_MAP_INVALIDATE_RANGE_BIT\0"
+ "GL_MAP_READ_BIT\0"
+ "GL_MAP_STENCIL\0"
+ "GL_MAP_UNSYNCHRONIZED_BIT\0"
+ "GL_MAP_WRITE_BIT\0"
+ "GL_MATRIX0_ARB\0"
+ "GL_MATRIX0_NV\0"
+ "GL_MATRIX10_ARB\0"
+ "GL_MATRIX11_ARB\0"
+ "GL_MATRIX12_ARB\0"
+ "GL_MATRIX13_ARB\0"
+ "GL_MATRIX14_ARB\0"
+ "GL_MATRIX15_ARB\0"
+ "GL_MATRIX16_ARB\0"
+ "GL_MATRIX17_ARB\0"
+ "GL_MATRIX18_ARB\0"
+ "GL_MATRIX19_ARB\0"
+ "GL_MATRIX1_ARB\0"
+ "GL_MATRIX1_NV\0"
+ "GL_MATRIX20_ARB\0"
+ "GL_MATRIX21_ARB\0"
+ "GL_MATRIX22_ARB\0"
+ "GL_MATRIX23_ARB\0"
+ "GL_MATRIX24_ARB\0"
+ "GL_MATRIX25_ARB\0"
+ "GL_MATRIX26_ARB\0"
+ "GL_MATRIX27_ARB\0"
+ "GL_MATRIX28_ARB\0"
+ "GL_MATRIX29_ARB\0"
+ "GL_MATRIX2_ARB\0"
+ "GL_MATRIX2_NV\0"
+ "GL_MATRIX30_ARB\0"
+ "GL_MATRIX31_ARB\0"
+ "GL_MATRIX3_ARB\0"
+ "GL_MATRIX3_NV\0"
+ "GL_MATRIX4_ARB\0"
+ "GL_MATRIX4_NV\0"
+ "GL_MATRIX5_ARB\0"
+ "GL_MATRIX5_NV\0"
+ "GL_MATRIX6_ARB\0"
+ "GL_MATRIX6_NV\0"
+ "GL_MATRIX7_ARB\0"
+ "GL_MATRIX7_NV\0"
+ "GL_MATRIX8_ARB\0"
+ "GL_MATRIX9_ARB\0"
+ "GL_MATRIX_INDEX_ARRAY_ARB\0"
+ "GL_MATRIX_INDEX_ARRAY_BUFFER_BINDING_OES\0"
+ "GL_MATRIX_INDEX_ARRAY_OES\0"
+ "GL_MATRIX_INDEX_ARRAY_POINTER_ARB\0"
+ "GL_MATRIX_INDEX_ARRAY_POINTER_OES\0"
+ "GL_MATRIX_INDEX_ARRAY_SIZE_ARB\0"
+ "GL_MATRIX_INDEX_ARRAY_SIZE_OES\0"
+ "GL_MATRIX_INDEX_ARRAY_STRIDE_ARB\0"
+ "GL_MATRIX_INDEX_ARRAY_STRIDE_OES\0"
+ "GL_MATRIX_INDEX_ARRAY_TYPE_ARB\0"
+ "GL_MATRIX_INDEX_ARRAY_TYPE_OES\0"
+ "GL_MATRIX_MODE\0"
+ "GL_MATRIX_PALETTE_ARB\0"
+ "GL_MATRIX_PALETTE_OES\0"
+ "GL_MAX\0"
+ "GL_MAX_3D_TEXTURE_SIZE\0"
+ "GL_MAX_3D_TEXTURE_SIZE_OES\0"
+ "GL_MAX_ARRAY_TEXTURE_LAYERS\0"
+ "GL_MAX_ARRAY_TEXTURE_LAYERS_EXT\0"
+ "GL_MAX_ATTRIB_STACK_DEPTH\0"
+ "GL_MAX_CLIENT_ATTRIB_STACK_DEPTH\0"
+ "GL_MAX_CLIPMAP_DEPTH_SGIX\0"
+ "GL_MAX_CLIPMAP_VIRTUAL_DEPTH_SGIX\0"
+ "GL_MAX_CLIP_DISTANCES\0"
+ "GL_MAX_CLIP_PLANES\0"
+ "GL_MAX_COLOR_ATTACHMENTS\0"
+ "GL_MAX_COLOR_ATTACHMENTS_EXT\0"
+ "GL_MAX_COLOR_MATRIX_STACK_DEPTH\0"
+ "GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI\0"
+ "GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS\0"
+ "GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB\0"
+ "GL_MAX_CONVOLUTION_HEIGHT\0"
+ "GL_MAX_CONVOLUTION_HEIGHT_EXT\0"
+ "GL_MAX_CONVOLUTION_WIDTH\0"
+ "GL_MAX_CONVOLUTION_WIDTH_EXT\0"
+ "GL_MAX_CUBE_MAP_TEXTURE_SIZE\0"
+ "GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB\0"
+ "GL_MAX_CUBE_MAP_TEXTURE_SIZE_OES\0"
+ "GL_MAX_DRAW_BUFFERS\0"
+ "GL_MAX_DRAW_BUFFERS_ARB\0"
+ "GL_MAX_DRAW_BUFFERS_ATI\0"
+ "GL_MAX_ELEMENTS_INDICES\0"
+ "GL_MAX_ELEMENTS_VERTICES\0"
+ "GL_MAX_EVAL_ORDER\0"
+ "GL_MAX_EXT\0"
+ "GL_MAX_FRAGMENT_INPUT_COMPONENTS\0"
+ "GL_MAX_FRAGMENT_UNIFORM_COMPONENTS\0"
+ "GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB\0"
+ "GL_MAX_FRAGMENT_UNIFORM_VECTORS\0"
+ "GL_MAX_GEOMETRY_INPUT_COMPONENTS\0"
+ "GL_MAX_GEOMETRY_OUTPUT_COMPONENTS\0"
+ "GL_MAX_GEOMETRY_OUTPUT_VERTICES\0"
+ "GL_MAX_GEOMETRY_OUTPUT_VERTICES_ARB\0"
+ "GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS\0"
+ "GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_ARB\0"
+ "GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS\0"
+ "GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_ARB\0"
+ "GL_MAX_GEOMETRY_UNIFORM_COMPONENTS\0"
+ "GL_MAX_GEOMETRY_UNIFORM_COMPONENTS_ARB\0"
+ "GL_MAX_GEOMETRY_VARYING_COMPONENTS_ARB\0"
+ "GL_MAX_LIGHTS\0"
+ "GL_MAX_LIST_NESTING\0"
+ "GL_MAX_MATRIX_PALETTE_STACK_DEPTH_ARB\0"
+ "GL_MAX_MODELVIEW_STACK_DEPTH\0"
+ "GL_MAX_NAME_STACK_DEPTH\0"
+ "GL_MAX_PALETTE_MATRICES_ARB\0"
+ "GL_MAX_PALETTE_MATRICES_OES\0"
+ "GL_MAX_PIXEL_MAP_TABLE\0"
+ "GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB\0"
+ "GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB\0"
+ "GL_MAX_PROGRAM_ATTRIBS_ARB\0"
+ "GL_MAX_PROGRAM_CALL_DEPTH_NV\0"
+ "GL_MAX_PROGRAM_ENV_PARAMETERS_ARB\0"
+ "GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV\0"
+ "GL_MAX_PROGRAM_IF_DEPTH_NV\0"
+ "GL_MAX_PROGRAM_INSTRUCTIONS_ARB\0"
+ "GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB\0"
+ "GL_MAX_PROGRAM_LOOP_COUNT_NV\0"
+ "GL_MAX_PROGRAM_LOOP_DEPTH_NV\0"
+ "GL_MAX_PROGRAM_MATRICES_ARB\0"
+ "GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB\0"
+ "GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB\0"
+ "GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB\0"
+ "GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB\0"
+ "GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB\0"
+ "GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB\0"
+ "GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB\0"
+ "GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB\0"
+ "GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB\0"
+ "GL_MAX_PROGRAM_PARAMETERS_ARB\0"
+ "GL_MAX_PROGRAM_TEMPORARIES_ARB\0"
+ "GL_MAX_PROGRAM_TEXEL_OFFSET\0"
+ "GL_MAX_PROGRAM_TEXEL_OFFSET_EXT\0"
+ "GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB\0"
+ "GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB\0"
+ "GL_MAX_PROJECTION_STACK_DEPTH\0"
+ "GL_MAX_RECTANGLE_TEXTURE_SIZE\0"
+ "GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB\0"
+ "GL_MAX_RECTANGLE_TEXTURE_SIZE_NV\0"
+ "GL_MAX_RENDERBUFFER_SIZE\0"
+ "GL_MAX_RENDERBUFFER_SIZE_EXT\0"
+ "GL_MAX_RENDERBUFFER_SIZE_OES\0"
+ "GL_MAX_SAMPLES\0"
+ "GL_MAX_SAMPLES_EXT\0"
+ "GL_MAX_SERVER_WAIT_TIMEOUT\0"
+ "GL_MAX_SHININESS_NV\0"
+ "GL_MAX_SPOT_EXPONENT_NV\0"
+ "GL_MAX_TEXTURE_BUFFER_SIZE\0"
+ "GL_MAX_TEXTURE_BUFFER_SIZE_ARB\0"
+ "GL_MAX_TEXTURE_COORDS\0"
+ "GL_MAX_TEXTURE_COORDS_ARB\0"
+ "GL_MAX_TEXTURE_IMAGE_UNITS\0"
+ "GL_MAX_TEXTURE_IMAGE_UNITS_ARB\0"
+ "GL_MAX_TEXTURE_LOD_BIAS\0"
+ "GL_MAX_TEXTURE_LOD_BIAS_EXT\0"
+ "GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT\0"
+ "GL_MAX_TEXTURE_SIZE\0"
+ "GL_MAX_TEXTURE_STACK_DEPTH\0"
+ "GL_MAX_TEXTURE_UNITS\0"
+ "GL_MAX_TEXTURE_UNITS_ARB\0"
+ "GL_MAX_TRACK_MATRICES_NV\0"
+ "GL_MAX_TRACK_MATRIX_STACK_DEPTH_NV\0"
+ "GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS\0"
+ "GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS_EXT\0"
+ "GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS\0"
+ "GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS_EXT\0"
+ "GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS\0"
+ "GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS_EXT\0"
+ "GL_MAX_VARYING_COMPONENTS\0"
+ "GL_MAX_VARYING_FLOATS\0"
+ "GL_MAX_VARYING_FLOATS_ARB\0"
+ "GL_MAX_VARYING_VECTORS\0"
+ "GL_MAX_VERTEX_ATTRIBS\0"
+ "GL_MAX_VERTEX_ATTRIBS_ARB\0"
+ "GL_MAX_VERTEX_OUTPUT_COMPONENTS\0"
+ "GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS\0"
+ "GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB\0"
+ "GL_MAX_VERTEX_UNIFORM_COMPONENTS\0"
+ "GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB\0"
+ "GL_MAX_VERTEX_UNIFORM_VECTORS\0"
+ "GL_MAX_VERTEX_UNITS_ARB\0"
+ "GL_MAX_VERTEX_UNITS_OES\0"
+ "GL_MAX_VERTEX_VARYING_COMPONENTS_ARB\0"
+ "GL_MAX_VIEWPORT_DIMS\0"
+ "GL_MEDIUM_FLOAT\0"
+ "GL_MEDIUM_INT\0"
+ "GL_MIN\0"
+ "GL_MINMAX\0"
+ "GL_MINMAX_EXT\0"
+ "GL_MINMAX_FORMAT\0"
+ "GL_MINMAX_FORMAT_EXT\0"
+ "GL_MINMAX_SINK\0"
+ "GL_MINMAX_SINK_EXT\0"
+ "GL_MINOR_VERSION\0"
+ "GL_MIN_EXT\0"
+ "GL_MIN_PROGRAM_TEXEL_OFFSET\0"
+ "GL_MIN_PROGRAM_TEXEL_OFFSET_EXT\0"
+ "GL_MIRRORED_REPEAT\0"
+ "GL_MIRRORED_REPEAT_ARB\0"
+ "GL_MIRRORED_REPEAT_IBM\0"
+ "GL_MIRROR_CLAMP_ATI\0"
+ "GL_MIRROR_CLAMP_EXT\0"
+ "GL_MIRROR_CLAMP_TO_BORDER_EXT\0"
+ "GL_MIRROR_CLAMP_TO_EDGE_ATI\0"
+ "GL_MIRROR_CLAMP_TO_EDGE_EXT\0"
+ "GL_MODELVIEW\0"
+ "GL_MODELVIEW0_ARB\0"
+ "GL_MODELVIEW10_ARB\0"
+ "GL_MODELVIEW11_ARB\0"
+ "GL_MODELVIEW12_ARB\0"
+ "GL_MODELVIEW13_ARB\0"
+ "GL_MODELVIEW14_ARB\0"
+ "GL_MODELVIEW15_ARB\0"
+ "GL_MODELVIEW16_ARB\0"
+ "GL_MODELVIEW17_ARB\0"
+ "GL_MODELVIEW18_ARB\0"
+ "GL_MODELVIEW19_ARB\0"
+ "GL_MODELVIEW1_ARB\0"
+ "GL_MODELVIEW20_ARB\0"
+ "GL_MODELVIEW21_ARB\0"
+ "GL_MODELVIEW22_ARB\0"
+ "GL_MODELVIEW23_ARB\0"
+ "GL_MODELVIEW24_ARB\0"
+ "GL_MODELVIEW25_ARB\0"
+ "GL_MODELVIEW26_ARB\0"
+ "GL_MODELVIEW27_ARB\0"
+ "GL_MODELVIEW28_ARB\0"
+ "GL_MODELVIEW29_ARB\0"
+ "GL_MODELVIEW2_ARB\0"
+ "GL_MODELVIEW30_ARB\0"
+ "GL_MODELVIEW31_ARB\0"
+ "GL_MODELVIEW3_ARB\0"
+ "GL_MODELVIEW4_ARB\0"
+ "GL_MODELVIEW5_ARB\0"
+ "GL_MODELVIEW6_ARB\0"
+ "GL_MODELVIEW7_ARB\0"
+ "GL_MODELVIEW8_ARB\0"
+ "GL_MODELVIEW9_ARB\0"
+ "GL_MODELVIEW_MATRIX\0"
+ "GL_MODELVIEW_MATRIX_FLOAT_AS_INT_BITS_OES\0"
+ "GL_MODELVIEW_PROJECTION_NV\0"
+ "GL_MODELVIEW_STACK_DEPTH\0"
+ "GL_MODULATE\0"
+ "GL_MODULATE_ADD_ATI\0"
+ "GL_MODULATE_SIGNED_ADD_ATI\0"
+ "GL_MODULATE_SUBTRACT_ATI\0"
+ "GL_MULT\0"
+ "GL_MULTISAMPLE\0"
+ "GL_MULTISAMPLE_3DFX\0"
+ "GL_MULTISAMPLE_ARB\0"
+ "GL_MULTISAMPLE_BIT\0"
+ "GL_MULTISAMPLE_BIT_3DFX\0"
+ "GL_MULTISAMPLE_BIT_ARB\0"
+ "GL_MULTISAMPLE_FILTER_HINT_NV\0"
+ "GL_N3F_V3F\0"
+ "GL_NAME_STACK_DEPTH\0"
+ "GL_NAND\0"
+ "GL_NEAREST\0"
+ "GL_NEAREST_CLIPMAP_LINEAR_SGIX\0"
+ "GL_NEAREST_CLIPMAP_NEAREST_SGIX\0"
+ "GL_NEAREST_MIPMAP_LINEAR\0"
+ "GL_NEAREST_MIPMAP_NEAREST\0"
+ "GL_NEVER\0"
+ "GL_NICEST\0"
+ "GL_NONE\0"
+ "GL_NONE_OES\0"
+ "GL_NOOP\0"
+ "GL_NOR\0"
+ "GL_NORMALIZE\0"
+ "GL_NORMAL_ARRAY\0"
+ "GL_NORMAL_ARRAY_BUFFER_BINDING\0"
+ "GL_NORMAL_ARRAY_BUFFER_BINDING_ARB\0"
+ "GL_NORMAL_ARRAY_POINTER\0"
+ "GL_NORMAL_ARRAY_STRIDE\0"
+ "GL_NORMAL_ARRAY_TYPE\0"
+ "GL_NORMAL_MAP\0"
+ "GL_NORMAL_MAP_ARB\0"
+ "GL_NORMAL_MAP_NV\0"
+ "GL_NORMAL_MAP_OES\0"
+ "GL_NOTEQUAL\0"
+ "GL_NO_ERROR\0"
+ "GL_NO_RESET_NOTIFICATION_ARB\0"
+ "GL_NUM_COMPRESSED_TEXTURE_FORMATS\0"
+ "GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB\0"
+ "GL_NUM_EXTENSIONS\0"
+ "GL_NUM_PROGRAM_BINARY_FORMATS_OES\0"
+ "GL_NUM_SHADER_BINARY_FORMATS\0"
+ "GL_OBJECT_ACTIVE_ATTRIBUTES_ARB\0"
+ "GL_OBJECT_ACTIVE_ATTRIBUTE_MAX_LENGTH_ARB\0"
+ "GL_OBJECT_ACTIVE_UNIFORMS_ARB\0"
+ "GL_OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB\0"
+ "GL_OBJECT_ATTACHED_OBJECTS_ARB\0"
+ "GL_OBJECT_COMPILE_STATUS_ARB\0"
+ "GL_OBJECT_DELETE_STATUS_ARB\0"
+ "GL_OBJECT_INFO_LOG_LENGTH_ARB\0"
+ "GL_OBJECT_LINEAR\0"
+ "GL_OBJECT_LINK_STATUS_ARB\0"
+ "GL_OBJECT_PLANE\0"
+ "GL_OBJECT_SHADER_SOURCE_LENGTH_ARB\0"
+ "GL_OBJECT_SUBTYPE_ARB\0"
+ "GL_OBJECT_TYPE\0"
+ "GL_OBJECT_TYPE_ARB\0"
+ "GL_OBJECT_VALIDATE_STATUS_ARB\0"
+ "GL_OCCLUSION_TEST_HP\0"
+ "GL_OCCLUSION_TEST_RESULT_HP\0"
+ "GL_ONE\0"
+ "GL_ONE_MINUS_CONSTANT_ALPHA\0"
+ "GL_ONE_MINUS_CONSTANT_ALPHA_EXT\0"
+ "GL_ONE_MINUS_CONSTANT_COLOR\0"
+ "GL_ONE_MINUS_CONSTANT_COLOR_EXT\0"
+ "GL_ONE_MINUS_DST_ALPHA\0"
+ "GL_ONE_MINUS_DST_COLOR\0"
+ "GL_ONE_MINUS_SRC_ALPHA\0"
+ "GL_ONE_MINUS_SRC_COLOR\0"
+ "GL_OPERAND0_ALPHA\0"
+ "GL_OPERAND0_ALPHA_ARB\0"
+ "GL_OPERAND0_ALPHA_EXT\0"
+ "GL_OPERAND0_RGB\0"
+ "GL_OPERAND0_RGB_ARB\0"
+ "GL_OPERAND0_RGB_EXT\0"
+ "GL_OPERAND1_ALPHA\0"
+ "GL_OPERAND1_ALPHA_ARB\0"
+ "GL_OPERAND1_ALPHA_EXT\0"
+ "GL_OPERAND1_RGB\0"
+ "GL_OPERAND1_RGB_ARB\0"
+ "GL_OPERAND1_RGB_EXT\0"
+ "GL_OPERAND2_ALPHA\0"
+ "GL_OPERAND2_ALPHA_ARB\0"
+ "GL_OPERAND2_ALPHA_EXT\0"
+ "GL_OPERAND2_RGB\0"
+ "GL_OPERAND2_RGB_ARB\0"
+ "GL_OPERAND2_RGB_EXT\0"
+ "GL_OPERAND3_ALPHA_NV\0"
+ "GL_OPERAND3_RGB_NV\0"
+ "GL_OR\0"
+ "GL_ORDER\0"
+ "GL_OR_INVERTED\0"
+ "GL_OR_REVERSE\0"
+ "GL_OUT_OF_MEMORY\0"
+ "GL_PACK_ALIGNMENT\0"
+ "GL_PACK_IMAGE_HEIGHT\0"
+ "GL_PACK_INVERT_MESA\0"
+ "GL_PACK_LSB_FIRST\0"
+ "GL_PACK_ROW_LENGTH\0"
+ "GL_PACK_SKIP_IMAGES\0"
+ "GL_PACK_SKIP_PIXELS\0"
+ "GL_PACK_SKIP_ROWS\0"
+ "GL_PACK_SWAP_BYTES\0"
+ "GL_PALETTE4_R5_G6_B5_OES\0"
+ "GL_PALETTE4_RGB5_A1_OES\0"
+ "GL_PALETTE4_RGB8_OES\0"
+ "GL_PALETTE4_RGBA4_OES\0"
+ "GL_PALETTE4_RGBA8_OES\0"
+ "GL_PALETTE8_R5_G6_B5_OES\0"
+ "GL_PALETTE8_RGB5_A1_OES\0"
+ "GL_PALETTE8_RGB8_OES\0"
+ "GL_PALETTE8_RGBA4_OES\0"
+ "GL_PALETTE8_RGBA8_OES\0"
+ "GL_PASS_THROUGH_TOKEN\0"
+ "GL_PERSPECTIVE_CORRECTION_HINT\0"
+ "GL_PIXEL_MAP_A_TO_A\0"
+ "GL_PIXEL_MAP_A_TO_A_SIZE\0"
+ "GL_PIXEL_MAP_B_TO_B\0"
+ "GL_PIXEL_MAP_B_TO_B_SIZE\0"
+ "GL_PIXEL_MAP_G_TO_G\0"
+ "GL_PIXEL_MAP_G_TO_G_SIZE\0"
+ "GL_PIXEL_MAP_I_TO_A\0"
+ "GL_PIXEL_MAP_I_TO_A_SIZE\0"
+ "GL_PIXEL_MAP_I_TO_B\0"
+ "GL_PIXEL_MAP_I_TO_B_SIZE\0"
+ "GL_PIXEL_MAP_I_TO_G\0"
+ "GL_PIXEL_MAP_I_TO_G_SIZE\0"
+ "GL_PIXEL_MAP_I_TO_I\0"
+ "GL_PIXEL_MAP_I_TO_I_SIZE\0"
+ "GL_PIXEL_MAP_I_TO_R\0"
+ "GL_PIXEL_MAP_I_TO_R_SIZE\0"
+ "GL_PIXEL_MAP_R_TO_R\0"
+ "GL_PIXEL_MAP_R_TO_R_SIZE\0"
+ "GL_PIXEL_MAP_S_TO_S\0"
+ "GL_PIXEL_MAP_S_TO_S_SIZE\0"
+ "GL_PIXEL_MODE_BIT\0"
+ "GL_PIXEL_PACK_BUFFER\0"
+ "GL_PIXEL_PACK_BUFFER_BINDING\0"
+ "GL_PIXEL_PACK_BUFFER_BINDING_EXT\0"
+ "GL_PIXEL_PACK_BUFFER_EXT\0"
+ "GL_PIXEL_UNPACK_BUFFER\0"
+ "GL_PIXEL_UNPACK_BUFFER_BINDING\0"
+ "GL_PIXEL_UNPACK_BUFFER_BINDING_EXT\0"
+ "GL_PIXEL_UNPACK_BUFFER_EXT\0"
+ "GL_POINT\0"
+ "GL_POINTS\0"
+ "GL_POINT_BIT\0"
+ "GL_POINT_DISTANCE_ATTENUATION\0"
+ "GL_POINT_DISTANCE_ATTENUATION_ARB\0"
+ "GL_POINT_DISTANCE_ATTENUATION_EXT\0"
+ "GL_POINT_DISTANCE_ATTENUATION_SGIS\0"
+ "GL_POINT_FADE_THRESHOLD_SIZE\0"
+ "GL_POINT_FADE_THRESHOLD_SIZE_ARB\0"
+ "GL_POINT_FADE_THRESHOLD_SIZE_EXT\0"
+ "GL_POINT_FADE_THRESHOLD_SIZE_SGIS\0"
+ "GL_POINT_SIZE\0"
+ "GL_POINT_SIZE_ARRAY_BUFFER_BINDING_OES\0"
+ "GL_POINT_SIZE_ARRAY_OES\0"
+ "GL_POINT_SIZE_ARRAY_POINTER_OES\0"
+ "GL_POINT_SIZE_ARRAY_STRIDE_OES\0"
+ "GL_POINT_SIZE_ARRAY_TYPE_OES\0"
+ "GL_POINT_SIZE_GRANULARITY\0"
+ "GL_POINT_SIZE_MAX\0"
+ "GL_POINT_SIZE_MAX_ARB\0"
+ "GL_POINT_SIZE_MAX_EXT\0"
+ "GL_POINT_SIZE_MAX_SGIS\0"
+ "GL_POINT_SIZE_MIN\0"
+ "GL_POINT_SIZE_MIN_ARB\0"
+ "GL_POINT_SIZE_MIN_EXT\0"
+ "GL_POINT_SIZE_MIN_SGIS\0"
+ "GL_POINT_SIZE_RANGE\0"
+ "GL_POINT_SMOOTH\0"
+ "GL_POINT_SMOOTH_HINT\0"
+ "GL_POINT_SPRITE\0"
+ "GL_POINT_SPRITE_ARB\0"
+ "GL_POINT_SPRITE_COORD_ORIGIN\0"
+ "GL_POINT_SPRITE_NV\0"
+ "GL_POINT_SPRITE_OES\0"
+ "GL_POINT_SPRITE_R_MODE_NV\0"
+ "GL_POINT_TOKEN\0"
+ "GL_POLYGON\0"
+ "GL_POLYGON_BIT\0"
+ "GL_POLYGON_MODE\0"
+ "GL_POLYGON_OFFSET_BIAS\0"
+ "GL_POLYGON_OFFSET_FACTOR\0"
+ "GL_POLYGON_OFFSET_FILL\0"
+ "GL_POLYGON_OFFSET_LINE\0"
+ "GL_POLYGON_OFFSET_POINT\0"
+ "GL_POLYGON_OFFSET_UNITS\0"
+ "GL_POLYGON_SMOOTH\0"
+ "GL_POLYGON_SMOOTH_HINT\0"
+ "GL_POLYGON_STIPPLE\0"
+ "GL_POLYGON_STIPPLE_BIT\0"
+ "GL_POLYGON_TOKEN\0"
+ "GL_POSITION\0"
+ "GL_POST_COLOR_MATRIX_ALPHA_BIAS\0"
+ "GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI\0"
+ "GL_POST_COLOR_MATRIX_ALPHA_SCALE\0"
+ "GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI\0"
+ "GL_POST_COLOR_MATRIX_BLUE_BIAS\0"
+ "GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI\0"
+ "GL_POST_COLOR_MATRIX_BLUE_SCALE\0"
+ "GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI\0"
+ "GL_POST_COLOR_MATRIX_COLOR_TABLE\0"
+ "GL_POST_COLOR_MATRIX_GREEN_BIAS\0"
+ "GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI\0"
+ "GL_POST_COLOR_MATRIX_GREEN_SCALE\0"
+ "GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI\0"
+ "GL_POST_COLOR_MATRIX_RED_BIAS\0"
+ "GL_POST_COLOR_MATRIX_RED_BIAS_SGI\0"
+ "GL_POST_COLOR_MATRIX_RED_SCALE\0"
+ "GL_POST_COLOR_MATRIX_RED_SCALE_SGI\0"
+ "GL_POST_CONVOLUTION_ALPHA_BIAS\0"
+ "GL_POST_CONVOLUTION_ALPHA_BIAS_EXT\0"
+ "GL_POST_CONVOLUTION_ALPHA_SCALE\0"
+ "GL_POST_CONVOLUTION_ALPHA_SCALE_EXT\0"
+ "GL_POST_CONVOLUTION_BLUE_BIAS\0"
+ "GL_POST_CONVOLUTION_BLUE_BIAS_EXT\0"
+ "GL_POST_CONVOLUTION_BLUE_SCALE\0"
+ "GL_POST_CONVOLUTION_BLUE_SCALE_EXT\0"
+ "GL_POST_CONVOLUTION_COLOR_TABLE\0"
+ "GL_POST_CONVOLUTION_GREEN_BIAS\0"
+ "GL_POST_CONVOLUTION_GREEN_BIAS_EXT\0"
+ "GL_POST_CONVOLUTION_GREEN_SCALE\0"
+ "GL_POST_CONVOLUTION_GREEN_SCALE_EXT\0"
+ "GL_POST_CONVOLUTION_RED_BIAS\0"
+ "GL_POST_CONVOLUTION_RED_BIAS_EXT\0"
+ "GL_POST_CONVOLUTION_RED_SCALE\0"
+ "GL_POST_CONVOLUTION_RED_SCALE_EXT\0"
+ "GL_POST_TEXTURE_FILTER_BIAS_RANGE_SGIX\0"
+ "GL_POST_TEXTURE_FILTER_BIAS_SGIX\0"
+ "GL_POST_TEXTURE_FILTER_SCALE_RANGE_SGIX\0"
+ "GL_POST_TEXTURE_FILTER_SCALE_SGIX\0"
+ "GL_PREVIOUS\0"
+ "GL_PREVIOUS_ARB\0"
+ "GL_PREVIOUS_EXT\0"
+ "GL_PRIMARY_COLOR\0"
+ "GL_PRIMARY_COLOR_ARB\0"
+ "GL_PRIMARY_COLOR_EXT\0"
+ "GL_PRIMITIVES_GENERATED\0"
+ "GL_PRIMITIVES_GENERATED_EXT\0"
+ "GL_PRIMITIVE_RESTART\0"
+ "GL_PRIMITIVE_RESTART_INDEX\0"
+ "GL_PRIMITIVE_RESTART_INDEX_NV\0"
+ "GL_PRIMITIVE_RESTART_NV\0"
+ "GL_PROGRAM_ADDRESS_REGISTERS_ARB\0"
+ "GL_PROGRAM_ALU_INSTRUCTIONS_ARB\0"
+ "GL_PROGRAM_ATTRIBS_ARB\0"
+ "GL_PROGRAM_BINARY_FORMATS_OES\0"
+ "GL_PROGRAM_BINARY_LENGTH_OES\0"
+ "GL_PROGRAM_BINDING_ARB\0"
+ "GL_PROGRAM_ERROR_POSITION_ARB\0"
+ "GL_PROGRAM_ERROR_POSITION_NV\0"
+ "GL_PROGRAM_ERROR_STRING_ARB\0"
+ "GL_PROGRAM_FORMAT_ARB\0"
+ "GL_PROGRAM_FORMAT_ASCII_ARB\0"
+ "GL_PROGRAM_INSTRUCTIONS_ARB\0"
+ "GL_PROGRAM_LENGTH_ARB\0"
+ "GL_PROGRAM_LENGTH_NV\0"
+ "GL_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB\0"
+ "GL_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB\0"
+ "GL_PROGRAM_NATIVE_ATTRIBS_ARB\0"
+ "GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB\0"
+ "GL_PROGRAM_NATIVE_PARAMETERS_ARB\0"
+ "GL_PROGRAM_NATIVE_TEMPORARIES_ARB\0"
+ "GL_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB\0"
+ "GL_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB\0"
+ "GL_PROGRAM_OBJECT_ARB\0"
+ "GL_PROGRAM_PARAMETERS_ARB\0"
+ "GL_PROGRAM_PARAMETER_NV\0"
+ "GL_PROGRAM_POINT_SIZE\0"
+ "GL_PROGRAM_POINT_SIZE_ARB\0"
+ "GL_PROGRAM_RESIDENT_NV\0"
+ "GL_PROGRAM_STRING_ARB\0"
+ "GL_PROGRAM_STRING_NV\0"
+ "GL_PROGRAM_TARGET_NV\0"
+ "GL_PROGRAM_TEMPORARIES_ARB\0"
+ "GL_PROGRAM_TEX_INDIRECTIONS_ARB\0"
+ "GL_PROGRAM_TEX_INSTRUCTIONS_ARB\0"
+ "GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB\0"
+ "GL_PROJECTION\0"
+ "GL_PROJECTION_MATRIX\0"
+ "GL_PROJECTION_MATRIX_FLOAT_AS_INT_BITS_OES\0"
+ "GL_PROJECTION_STACK_DEPTH\0"
+ "GL_PROVOKING_VERTEX\0"
+ "GL_PROVOKING_VERTEX_EXT\0"
+ "GL_PROXY_COLOR_TABLE\0"
+ "GL_PROXY_HISTOGRAM\0"
+ "GL_PROXY_HISTOGRAM_EXT\0"
+ "GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE\0"
+ "GL_PROXY_POST_CONVOLUTION_COLOR_TABLE\0"
+ "GL_PROXY_TEXTURE_1D\0"
+ "GL_PROXY_TEXTURE_1D_ARRAY\0"
+ "GL_PROXY_TEXTURE_1D_ARRAY_EXT\0"
+ "GL_PROXY_TEXTURE_1D_EXT\0"
+ "GL_PROXY_TEXTURE_2D\0"
+ "GL_PROXY_TEXTURE_2D_ARRAY\0"
+ "GL_PROXY_TEXTURE_2D_ARRAY_EXT\0"
+ "GL_PROXY_TEXTURE_2D_EXT\0"
+ "GL_PROXY_TEXTURE_3D\0"
+ "GL_PROXY_TEXTURE_COLOR_TABLE_SGI\0"
+ "GL_PROXY_TEXTURE_CUBE_MAP\0"
+ "GL_PROXY_TEXTURE_CUBE_MAP_ARB\0"
+ "GL_PROXY_TEXTURE_RECTANGLE\0"
+ "GL_PROXY_TEXTURE_RECTANGLE_ARB\0"
+ "GL_PROXY_TEXTURE_RECTANGLE_NV\0"
+ "GL_PURGEABLE_APPLE\0"
+ "GL_Q\0"
+ "GL_QUADRATIC_ATTENUATION\0"
+ "GL_QUADS\0"
+ "GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION\0"
+ "GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION_EXT\0"
+ "GL_QUAD_MESH_SUN\0"
+ "GL_QUAD_STRIP\0"
+ "GL_QUERY_BY_REGION_NO_WAIT\0"
+ "GL_QUERY_BY_REGION_NO_WAIT_NV\0"
+ "GL_QUERY_BY_REGION_WAIT\0"
+ "GL_QUERY_BY_REGION_WAIT_NV\0"
+ "GL_QUERY_COUNTER_BITS\0"
+ "GL_QUERY_COUNTER_BITS_ARB\0"
+ "GL_QUERY_NO_WAIT\0"
+ "GL_QUERY_NO_WAIT_NV\0"
+ "GL_QUERY_RESULT\0"
+ "GL_QUERY_RESULT_ARB\0"
+ "GL_QUERY_RESULT_AVAILABLE\0"
+ "GL_QUERY_RESULT_AVAILABLE_ARB\0"
+ "GL_QUERY_WAIT\0"
+ "GL_QUERY_WAIT_NV\0"
+ "GL_R\0"
+ "GL_R11F_G11F_B10F\0"
+ "GL_R16_SNORM\0"
+ "GL_R3_G3_B2\0"
+ "GL_R8_SNORM\0"
+ "GL_RASTERIZER_DISCARD\0"
+ "GL_RASTERIZER_DISCARD_EXT\0"
+ "GL_RASTER_POSITION_UNCLIPPED_IBM\0"
+ "GL_READ_BUFFER\0"
+ "GL_READ_FRAMEBUFFER\0"
+ "GL_READ_FRAMEBUFFER_BINDING\0"
+ "GL_READ_FRAMEBUFFER_BINDING_EXT\0"
+ "GL_READ_FRAMEBUFFER_EXT\0"
+ "GL_READ_ONLY\0"
+ "GL_READ_ONLY_ARB\0"
+ "GL_READ_WRITE\0"
+ "GL_READ_WRITE_ARB\0"
+ "GL_RED\0"
+ "GL_REDUCE\0"
+ "GL_REDUCE_EXT\0"
+ "GL_RED_BIAS\0"
+ "GL_RED_BITS\0"
+ "GL_RED_INTEGER\0"
+ "GL_RED_INTEGER_EXT\0"
+ "GL_RED_SCALE\0"
+ "GL_RED_SNORM\0"
+ "GL_REFLECTION_MAP\0"
+ "GL_REFLECTION_MAP_ARB\0"
+ "GL_REFLECTION_MAP_NV\0"
+ "GL_REFLECTION_MAP_OES\0"
+ "GL_RELEASED_APPLE\0"
+ "GL_RENDER\0"
+ "GL_RENDERBUFFER\0"
+ "GL_RENDERBUFFER_ALPHA_SIZE\0"
+ "GL_RENDERBUFFER_ALPHA_SIZE_OES\0"
+ "GL_RENDERBUFFER_BINDING\0"
+ "GL_RENDERBUFFER_BINDING_EXT\0"
+ "GL_RENDERBUFFER_BINDING_OES\0"
+ "GL_RENDERBUFFER_BLUE_SIZE\0"
+ "GL_RENDERBUFFER_BLUE_SIZE_OES\0"
+ "GL_RENDERBUFFER_DEPTH_SIZE\0"
+ "GL_RENDERBUFFER_DEPTH_SIZE_OES\0"
+ "GL_RENDERBUFFER_EXT\0"
+ "GL_RENDERBUFFER_GREEN_SIZE\0"
+ "GL_RENDERBUFFER_GREEN_SIZE_OES\0"
+ "GL_RENDERBUFFER_HEIGHT\0"
+ "GL_RENDERBUFFER_HEIGHT_EXT\0"
+ "GL_RENDERBUFFER_HEIGHT_OES\0"
+ "GL_RENDERBUFFER_INTERNAL_FORMAT\0"
+ "GL_RENDERBUFFER_INTERNAL_FORMAT_EXT\0"
+ "GL_RENDERBUFFER_INTERNAL_FORMAT_OES\0"
+ "GL_RENDERBUFFER_OES\0"
+ "GL_RENDERBUFFER_RED_SIZE\0"
+ "GL_RENDERBUFFER_RED_SIZE_OES\0"
+ "GL_RENDERBUFFER_SAMPLES\0"
+ "GL_RENDERBUFFER_SAMPLES_EXT\0"
+ "GL_RENDERBUFFER_STENCIL_SIZE\0"
+ "GL_RENDERBUFFER_STENCIL_SIZE_OES\0"
+ "GL_RENDERBUFFER_WIDTH\0"
+ "GL_RENDERBUFFER_WIDTH_EXT\0"
+ "GL_RENDERBUFFER_WIDTH_OES\0"
+ "GL_RENDERER\0"
+ "GL_RENDER_MODE\0"
+ "GL_REPEAT\0"
+ "GL_REPLACE\0"
+ "GL_REPLACE_EXT\0"
+ "GL_REPLICATE_BORDER_HP\0"
+ "GL_RESCALE_NORMAL\0"
+ "GL_RESCALE_NORMAL_EXT\0"
+ "GL_RESET_NOTIFICATION_STRATEGY_ARB\0"
+ "GL_RETAINED_APPLE\0"
+ "GL_RETURN\0"
+ "GL_RG16_SNORM\0"
+ "GL_RG8_SNORM\0"
+ "GL_RGB\0"
+ "GL_RGB10\0"
+ "GL_RGB10_A2\0"
+ "GL_RGB10_A2_EXT\0"
+ "GL_RGB10_EXT\0"
+ "GL_RGB12\0"
+ "GL_RGB12_EXT\0"
+ "GL_RGB16\0"
+ "GL_RGB16F\0"
+ "GL_RGB16I\0"
+ "GL_RGB16I_EXT\0"
+ "GL_RGB16UI\0"
+ "GL_RGB16UI_EXT\0"
+ "GL_RGB16_EXT\0"
+ "GL_RGB16_SNORM\0"
+ "GL_RGB2_EXT\0"
+ "GL_RGB32F\0"
+ "GL_RGB32I\0"
+ "GL_RGB32I_EXT\0"
+ "GL_RGB32UI\0"
+ "GL_RGB32UI_EXT\0"
+ "GL_RGB4\0"
+ "GL_RGB4_EXT\0"
+ "GL_RGB4_S3TC\0"
+ "GL_RGB5\0"
+ "GL_RGB565\0"
+ "GL_RGB565_OES\0"
+ "GL_RGB5_A1\0"
+ "GL_RGB5_A1_EXT\0"
+ "GL_RGB5_A1_OES\0"
+ "GL_RGB5_EXT\0"
+ "GL_RGB8\0"
+ "GL_RGB8I\0"
+ "GL_RGB8I_EXT\0"
+ "GL_RGB8UI\0"
+ "GL_RGB8UI_EXT\0"
+ "GL_RGB8_EXT\0"
+ "GL_RGB8_OES\0"
+ "GL_RGB8_SNORM\0"
+ "GL_RGB9_E5\0"
+ "GL_RGBA\0"
+ "GL_RGBA12\0"
+ "GL_RGBA12_EXT\0"
+ "GL_RGBA16\0"
+ "GL_RGBA16F\0"
+ "GL_RGBA16I\0"
+ "GL_RGBA16I_EXT\0"
+ "GL_RGBA16UI\0"
+ "GL_RGBA16UI_EXT\0"
+ "GL_RGBA16_EXT\0"
+ "GL_RGBA16_SNORM\0"
+ "GL_RGBA2\0"
+ "GL_RGBA2_EXT\0"
+ "GL_RGBA32F\0"
+ "GL_RGBA32I\0"
+ "GL_RGBA32I_EXT\0"
+ "GL_RGBA32UI\0"
+ "GL_RGBA32UI_EXT\0"
+ "GL_RGBA4\0"
+ "GL_RGBA4_DXT5_S3TC\0"
+ "GL_RGBA4_EXT\0"
+ "GL_RGBA4_OES\0"
+ "GL_RGBA4_S3TC\0"
+ "GL_RGBA8\0"
+ "GL_RGBA8I\0"
+ "GL_RGBA8I_EXT\0"
+ "GL_RGBA8UI\0"
+ "GL_RGBA8UI_EXT\0"
+ "GL_RGBA8_EXT\0"
+ "GL_RGBA8_OES\0"
+ "GL_RGBA8_SNORM\0"
+ "GL_RGBA_DXT5_S3TC\0"
+ "GL_RGBA_FLOAT_MODE_ARB\0"
+ "GL_RGBA_INTEGER\0"
+ "GL_RGBA_INTEGER_EXT\0"
+ "GL_RGBA_INTEGER_MODE_EXT\0"
+ "GL_RGBA_MODE\0"
+ "GL_RGBA_S3TC\0"
+ "GL_RGBA_SNORM\0"
+ "GL_RGB_INTEGER\0"
+ "GL_RGB_INTEGER_EXT\0"
+ "GL_RGB_S3TC\0"
+ "GL_RGB_SCALE\0"
+ "GL_RGB_SCALE_ARB\0"
+ "GL_RGB_SCALE_EXT\0"
+ "GL_RGB_SNORM\0"
+ "GL_RG_SNORM\0"
+ "GL_RIGHT\0"
+ "GL_S\0"
+ "GL_SAMPLER_1D\0"
+ "GL_SAMPLER_1D_ARRAY\0"
+ "GL_SAMPLER_1D_ARRAY_EXT\0"
+ "GL_SAMPLER_1D_ARRAY_SHADOW\0"
+ "GL_SAMPLER_1D_ARRAY_SHADOW_EXT\0"
+ "GL_SAMPLER_1D_SHADOW\0"
+ "GL_SAMPLER_2D\0"
+ "GL_SAMPLER_2D_ARRAY\0"
+ "GL_SAMPLER_2D_ARRAY_EXT\0"
+ "GL_SAMPLER_2D_ARRAY_SHADOW\0"
+ "GL_SAMPLER_2D_ARRAY_SHADOW_EXT\0"
+ "GL_SAMPLER_2D_RECT\0"
+ "GL_SAMPLER_2D_RECT_SHADOW\0"
+ "GL_SAMPLER_2D_SHADOW\0"
+ "GL_SAMPLER_3D\0"
+ "GL_SAMPLER_3D_OES\0"
+ "GL_SAMPLER_BINDING\0"
+ "GL_SAMPLER_BUFFER\0"
+ "GL_SAMPLER_BUFFER_EXT\0"
+ "GL_SAMPLER_CUBE\0"
+ "GL_SAMPLER_CUBE_SHADOW\0"
+ "GL_SAMPLER_CUBE_SHADOW_EXT\0"
+ "GL_SAMPLES\0"
+ "GL_SAMPLES_3DFX\0"
+ "GL_SAMPLES_ARB\0"
+ "GL_SAMPLES_PASSED\0"
+ "GL_SAMPLES_PASSED_ARB\0"
+ "GL_SAMPLE_ALPHA_TO_COVERAGE\0"
+ "GL_SAMPLE_ALPHA_TO_COVERAGE_ARB\0"
+ "GL_SAMPLE_ALPHA_TO_ONE\0"
+ "GL_SAMPLE_ALPHA_TO_ONE_ARB\0"
+ "GL_SAMPLE_BUFFERS\0"
+ "GL_SAMPLE_BUFFERS_3DFX\0"
+ "GL_SAMPLE_BUFFERS_ARB\0"
+ "GL_SAMPLE_COVERAGE\0"
+ "GL_SAMPLE_COVERAGE_ARB\0"
+ "GL_SAMPLE_COVERAGE_INVERT\0"
+ "GL_SAMPLE_COVERAGE_INVERT_ARB\0"
+ "GL_SAMPLE_COVERAGE_VALUE\0"
+ "GL_SAMPLE_COVERAGE_VALUE_ARB\0"
+ "GL_SCISSOR_BIT\0"
+ "GL_SCISSOR_BOX\0"
+ "GL_SCISSOR_TEST\0"
+ "GL_SECONDARY_COLOR_ARRAY\0"
+ "GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING\0"
+ "GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB\0"
+ "GL_SECONDARY_COLOR_ARRAY_POINTER\0"
+ "GL_SECONDARY_COLOR_ARRAY_SIZE\0"
+ "GL_SECONDARY_COLOR_ARRAY_STRIDE\0"
+ "GL_SECONDARY_COLOR_ARRAY_TYPE\0"
+ "GL_SELECT\0"
+ "GL_SELECTION_BUFFER_POINTER\0"
+ "GL_SELECTION_BUFFER_SIZE\0"
+ "GL_SEPARABLE_2D\0"
+ "GL_SEPARATE_ATTRIBS\0"
+ "GL_SEPARATE_ATTRIBS_EXT\0"
+ "GL_SEPARATE_SPECULAR_COLOR\0"
+ "GL_SEPARATE_SPECULAR_COLOR_EXT\0"
+ "GL_SET\0"
+ "GL_SHADER_BINARY_FORMATS\0"
+ "GL_SHADER_COMPILER\0"
+ "GL_SHADER_OBJECT_ARB\0"
+ "GL_SHADER_SOURCE_LENGTH\0"
+ "GL_SHADER_TYPE\0"
+ "GL_SHADE_MODEL\0"
+ "GL_SHADING_LANGUAGE_VERSION\0"
+ "GL_SHADOW_AMBIENT_SGIX\0"
+ "GL_SHARED_TEXTURE_PALETTE_EXT\0"
+ "GL_SHININESS\0"
+ "GL_SHORT\0"
+ "GL_SIGNALED\0"
+ "GL_SIGNED_NORMALIZED\0"
+ "GL_SINGLE_COLOR\0"
+ "GL_SINGLE_COLOR_EXT\0"
+ "GL_SLICE_ACCUM_SUN\0"
+ "GL_SLUMINANCE\0"
+ "GL_SLUMINANCE8\0"
+ "GL_SLUMINANCE8_ALPHA8\0"
+ "GL_SLUMINANCE_ALPHA\0"
+ "GL_SMOOTH\0"
+ "GL_SMOOTH_LINE_WIDTH_GRANULARITY\0"
+ "GL_SMOOTH_LINE_WIDTH_RANGE\0"
+ "GL_SMOOTH_POINT_SIZE_GRANULARITY\0"
+ "GL_SMOOTH_POINT_SIZE_RANGE\0"
+ "GL_SOURCE0_ALPHA\0"
+ "GL_SOURCE0_ALPHA_ARB\0"
+ "GL_SOURCE0_ALPHA_EXT\0"
+ "GL_SOURCE0_RGB\0"
+ "GL_SOURCE0_RGB_ARB\0"
+ "GL_SOURCE0_RGB_EXT\0"
+ "GL_SOURCE1_ALPHA\0"
+ "GL_SOURCE1_ALPHA_ARB\0"
+ "GL_SOURCE1_ALPHA_EXT\0"
+ "GL_SOURCE1_RGB\0"
+ "GL_SOURCE1_RGB_ARB\0"
+ "GL_SOURCE1_RGB_EXT\0"
+ "GL_SOURCE2_ALPHA\0"
+ "GL_SOURCE2_ALPHA_ARB\0"
+ "GL_SOURCE2_ALPHA_EXT\0"
+ "GL_SOURCE2_RGB\0"
+ "GL_SOURCE2_RGB_ARB\0"
+ "GL_SOURCE2_RGB_EXT\0"
+ "GL_SOURCE3_ALPHA_NV\0"
+ "GL_SOURCE3_RGB_NV\0"
+ "GL_SPECULAR\0"
+ "GL_SPHERE_MAP\0"
+ "GL_SPOT_CUTOFF\0"
+ "GL_SPOT_DIRECTION\0"
+ "GL_SPOT_EXPONENT\0"
+ "GL_SRC0_ALPHA\0"
+ "GL_SRC0_RGB\0"
+ "GL_SRC1_ALPHA\0"
+ "GL_SRC1_RGB\0"
+ "GL_SRC2_ALPHA\0"
+ "GL_SRC2_RGB\0"
+ "GL_SRC_ALPHA\0"
+ "GL_SRC_ALPHA_SATURATE\0"
+ "GL_SRC_COLOR\0"
+ "GL_SRGB\0"
+ "GL_SRGB8\0"
+ "GL_SRGB8_ALPHA8\0"
+ "GL_SRGB_ALPHA\0"
+ "GL_STACK_OVERFLOW\0"
+ "GL_STACK_UNDERFLOW\0"
+ "GL_STATIC_COPY\0"
+ "GL_STATIC_COPY_ARB\0"
+ "GL_STATIC_DRAW\0"
+ "GL_STATIC_DRAW_ARB\0"
+ "GL_STATIC_READ\0"
+ "GL_STATIC_READ_ARB\0"
+ "GL_STENCIL\0"
+ "GL_STENCIL_ATTACHMENT\0"
+ "GL_STENCIL_ATTACHMENT_EXT\0"
+ "GL_STENCIL_ATTACHMENT_OES\0"
+ "GL_STENCIL_BACK_FAIL\0"
+ "GL_STENCIL_BACK_FAIL_ATI\0"
+ "GL_STENCIL_BACK_FUNC\0"
+ "GL_STENCIL_BACK_FUNC_ATI\0"
+ "GL_STENCIL_BACK_PASS_DEPTH_FAIL\0"
+ "GL_STENCIL_BACK_PASS_DEPTH_FAIL_ATI\0"
+ "GL_STENCIL_BACK_PASS_DEPTH_PASS\0"
+ "GL_STENCIL_BACK_PASS_DEPTH_PASS_ATI\0"
+ "GL_STENCIL_BACK_REF\0"
+ "GL_STENCIL_BACK_VALUE_MASK\0"
+ "GL_STENCIL_BACK_WRITEMASK\0"
+ "GL_STENCIL_BITS\0"
+ "GL_STENCIL_BUFFER\0"
+ "GL_STENCIL_BUFFER_BIT\0"
+ "GL_STENCIL_CLEAR_VALUE\0"
+ "GL_STENCIL_FAIL\0"
+ "GL_STENCIL_FUNC\0"
+ "GL_STENCIL_INDEX\0"
+ "GL_STENCIL_INDEX1\0"
+ "GL_STENCIL_INDEX16\0"
+ "GL_STENCIL_INDEX16_EXT\0"
+ "GL_STENCIL_INDEX1_EXT\0"
+ "GL_STENCIL_INDEX1_OES\0"
+ "GL_STENCIL_INDEX4\0"
+ "GL_STENCIL_INDEX4_EXT\0"
+ "GL_STENCIL_INDEX4_OES\0"
+ "GL_STENCIL_INDEX8\0"
+ "GL_STENCIL_INDEX8_EXT\0"
+ "GL_STENCIL_INDEX8_OES\0"
+ "GL_STENCIL_INDEX_EXT\0"
+ "GL_STENCIL_PASS_DEPTH_FAIL\0"
+ "GL_STENCIL_PASS_DEPTH_PASS\0"
+ "GL_STENCIL_REF\0"
+ "GL_STENCIL_TEST\0"
+ "GL_STENCIL_TEST_TWO_SIDE_EXT\0"
+ "GL_STENCIL_VALUE_MASK\0"
+ "GL_STENCIL_WRITEMASK\0"
+ "GL_STEREO\0"
+ "GL_STORAGE_CACHED_APPLE\0"
+ "GL_STORAGE_PRIVATE_APPLE\0"
+ "GL_STORAGE_SHARED_APPLE\0"
+ "GL_STREAM_COPY\0"
+ "GL_STREAM_COPY_ARB\0"
+ "GL_STREAM_DRAW\0"
+ "GL_STREAM_DRAW_ARB\0"
+ "GL_STREAM_READ\0"
+ "GL_STREAM_READ_ARB\0"
+ "GL_SUBPIXEL_BITS\0"
+ "GL_SUBTRACT\0"
+ "GL_SUBTRACT_ARB\0"
+ "GL_SYNC_CONDITION\0"
+ "GL_SYNC_FENCE\0"
+ "GL_SYNC_FLAGS\0"
+ "GL_SYNC_FLUSH_COMMANDS_BIT\0"
+ "GL_SYNC_GPU_COMMANDS_COMPLETE\0"
+ "GL_SYNC_STATUS\0"
+ "GL_T\0"
+ "GL_T2F_C3F_V3F\0"
+ "GL_T2F_C4F_N3F_V3F\0"
+ "GL_T2F_C4UB_V3F\0"
+ "GL_T2F_N3F_V3F\0"
+ "GL_T2F_V3F\0"
+ "GL_T4F_C4F_N3F_V4F\0"
+ "GL_T4F_V4F\0"
+ "GL_TABLE_TOO_LARGE_EXT\0"
+ "GL_TEXTURE\0"
+ "GL_TEXTURE0\0"
+ "GL_TEXTURE0_ARB\0"
+ "GL_TEXTURE1\0"
+ "GL_TEXTURE10\0"
+ "GL_TEXTURE10_ARB\0"
+ "GL_TEXTURE11\0"
+ "GL_TEXTURE11_ARB\0"
+ "GL_TEXTURE12\0"
+ "GL_TEXTURE12_ARB\0"
+ "GL_TEXTURE13\0"
+ "GL_TEXTURE13_ARB\0"
+ "GL_TEXTURE14\0"
+ "GL_TEXTURE14_ARB\0"
+ "GL_TEXTURE15\0"
+ "GL_TEXTURE15_ARB\0"
+ "GL_TEXTURE16\0"
+ "GL_TEXTURE16_ARB\0"
+ "GL_TEXTURE17\0"
+ "GL_TEXTURE17_ARB\0"
+ "GL_TEXTURE18\0"
+ "GL_TEXTURE18_ARB\0"
+ "GL_TEXTURE19\0"
+ "GL_TEXTURE19_ARB\0"
+ "GL_TEXTURE1_ARB\0"
+ "GL_TEXTURE2\0"
+ "GL_TEXTURE20\0"
+ "GL_TEXTURE20_ARB\0"
+ "GL_TEXTURE21\0"
+ "GL_TEXTURE21_ARB\0"
+ "GL_TEXTURE22\0"
+ "GL_TEXTURE22_ARB\0"
+ "GL_TEXTURE23\0"
+ "GL_TEXTURE23_ARB\0"
+ "GL_TEXTURE24\0"
+ "GL_TEXTURE24_ARB\0"
+ "GL_TEXTURE25\0"
+ "GL_TEXTURE25_ARB\0"
+ "GL_TEXTURE26\0"
+ "GL_TEXTURE26_ARB\0"
+ "GL_TEXTURE27\0"
+ "GL_TEXTURE27_ARB\0"
+ "GL_TEXTURE28\0"
+ "GL_TEXTURE28_ARB\0"
+ "GL_TEXTURE29\0"
+ "GL_TEXTURE29_ARB\0"
+ "GL_TEXTURE2_ARB\0"
+ "GL_TEXTURE3\0"
+ "GL_TEXTURE30\0"
+ "GL_TEXTURE30_ARB\0"
+ "GL_TEXTURE31\0"
+ "GL_TEXTURE31_ARB\0"
+ "GL_TEXTURE3_ARB\0"
+ "GL_TEXTURE4\0"
+ "GL_TEXTURE4_ARB\0"
+ "GL_TEXTURE5\0"
+ "GL_TEXTURE5_ARB\0"
+ "GL_TEXTURE6\0"
+ "GL_TEXTURE6_ARB\0"
+ "GL_TEXTURE7\0"
+ "GL_TEXTURE7_ARB\0"
+ "GL_TEXTURE8\0"
+ "GL_TEXTURE8_ARB\0"
+ "GL_TEXTURE9\0"
+ "GL_TEXTURE9_ARB\0"
+ "GL_TEXTURE_1D\0"
+ "GL_TEXTURE_1D_ARRAY\0"
+ "GL_TEXTURE_1D_ARRAY_EXT\0"
+ "GL_TEXTURE_2D\0"
+ "GL_TEXTURE_2D_ARRAY\0"
+ "GL_TEXTURE_2D_ARRAY_EXT\0"
+ "GL_TEXTURE_3D\0"
+ "GL_TEXTURE_3D_OES\0"
+ "GL_TEXTURE_ALPHA_SIZE\0"
+ "GL_TEXTURE_ALPHA_SIZE_EXT\0"
+ "GL_TEXTURE_BASE_LEVEL\0"
+ "GL_TEXTURE_BINDING_1D\0"
+ "GL_TEXTURE_BINDING_1D_ARRAY\0"
+ "GL_TEXTURE_BINDING_1D_ARRAY_EXT\0"
+ "GL_TEXTURE_BINDING_2D\0"
+ "GL_TEXTURE_BINDING_2D_ARRAY\0"
+ "GL_TEXTURE_BINDING_2D_ARRAY_EXT\0"
+ "GL_TEXTURE_BINDING_3D\0"
+ "GL_TEXTURE_BINDING_3D_OES\0"
+ "GL_TEXTURE_BINDING_BUFFER\0"
+ "GL_TEXTURE_BINDING_BUFFER_ARB\0"
+ "GL_TEXTURE_BINDING_CUBE_MAP\0"
+ "GL_TEXTURE_BINDING_CUBE_MAP_ARB\0"
+ "GL_TEXTURE_BINDING_CUBE_MAP_OES\0"
+ "GL_TEXTURE_BINDING_RECTANGLE\0"
+ "GL_TEXTURE_BINDING_RECTANGLE_ARB\0"
+ "GL_TEXTURE_BINDING_RECTANGLE_NV\0"
+ "GL_TEXTURE_BIT\0"
+ "GL_TEXTURE_BLUE_SIZE\0"
+ "GL_TEXTURE_BLUE_SIZE_EXT\0"
+ "GL_TEXTURE_BORDER\0"
+ "GL_TEXTURE_BORDER_COLOR\0"
+ "GL_TEXTURE_BUFFER\0"
+ "GL_TEXTURE_BUFFER_ARB\0"
+ "GL_TEXTURE_BUFFER_DATA_STORE_BINDING\0"
+ "GL_TEXTURE_BUFFER_DATA_STORE_BINDING_ARB\0"
+ "GL_TEXTURE_BUFFER_FORMAT\0"
+ "GL_TEXTURE_BUFFER_FORMAT_ARB\0"
+ "GL_TEXTURE_CLIPMAP_CENTER_SGIX\0"
+ "GL_TEXTURE_CLIPMAP_DEPTH_SGIX\0"
+ "GL_TEXTURE_CLIPMAP_FRAME_SGIX\0"
+ "GL_TEXTURE_CLIPMAP_LOD_OFFSET_SGIX\0"
+ "GL_TEXTURE_CLIPMAP_OFFSET_SGIX\0"
+ "GL_TEXTURE_CLIPMAP_VIRTUAL_DEPTH_SGIX\0"
+ "GL_TEXTURE_COLOR_TABLE_SGI\0"
+ "GL_TEXTURE_COLOR_WRITEMASK_SGIS\0"
+ "GL_TEXTURE_COMPARE_FAIL_VALUE_ARB\0"
+ "GL_TEXTURE_COMPARE_FUNC\0"
+ "GL_TEXTURE_COMPARE_FUNC_ARB\0"
+ "GL_TEXTURE_COMPARE_MODE\0"
+ "GL_TEXTURE_COMPARE_MODE_ARB\0"
+ "GL_TEXTURE_COMPARE_OPERATOR_SGIX\0"
+ "GL_TEXTURE_COMPARE_SGIX\0"
+ "GL_TEXTURE_COMPONENTS\0"
+ "GL_TEXTURE_COMPRESSED\0"
+ "GL_TEXTURE_COMPRESSED_ARB\0"
+ "GL_TEXTURE_COMPRESSED_FORMATS_ARB\0"
+ "GL_TEXTURE_COMPRESSED_IMAGE_SIZE\0"
+ "GL_TEXTURE_COMPRESSED_IMAGE_SIZE_ARB\0"
+ "GL_TEXTURE_COMPRESSION_HINT\0"
+ "GL_TEXTURE_COMPRESSION_HINT_ARB\0"
+ "GL_TEXTURE_COORD_ARRAY\0"
+ "GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING\0"
+ "GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB\0"
+ "GL_TEXTURE_COORD_ARRAY_POINTER\0"
+ "GL_TEXTURE_COORD_ARRAY_SIZE\0"
+ "GL_TEXTURE_COORD_ARRAY_STRIDE\0"
+ "GL_TEXTURE_COORD_ARRAY_TYPE\0"
+ "GL_TEXTURE_CROP_RECT_OES\0"
+ "GL_TEXTURE_CUBE_MAP\0"
+ "GL_TEXTURE_CUBE_MAP_ARB\0"
+ "GL_TEXTURE_CUBE_MAP_NEGATIVE_X\0"
+ "GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB\0"
+ "GL_TEXTURE_CUBE_MAP_NEGATIVE_X_OES\0"
+ "GL_TEXTURE_CUBE_MAP_NEGATIVE_Y\0"
+ "GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB\0"
+ "GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_OES\0"
+ "GL_TEXTURE_CUBE_MAP_NEGATIVE_Z\0"
+ "GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB\0"
+ "GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_OES\0"
+ "GL_TEXTURE_CUBE_MAP_OES\0"
+ "GL_TEXTURE_CUBE_MAP_POSITIVE_X\0"
+ "GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB\0"
+ "GL_TEXTURE_CUBE_MAP_POSITIVE_X_OES\0"
+ "GL_TEXTURE_CUBE_MAP_POSITIVE_Y\0"
+ "GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB\0"
+ "GL_TEXTURE_CUBE_MAP_POSITIVE_Y_OES\0"
+ "GL_TEXTURE_CUBE_MAP_POSITIVE_Z\0"
+ "GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB\0"
+ "GL_TEXTURE_CUBE_MAP_POSITIVE_Z_OES\0"
+ "GL_TEXTURE_CUBE_MAP_SEAMLESS\0"
+ "GL_TEXTURE_DEPTH\0"
+ "GL_TEXTURE_DEPTH_SIZE\0"
+ "GL_TEXTURE_DEPTH_SIZE_ARB\0"
+ "GL_TEXTURE_ENV\0"
+ "GL_TEXTURE_ENV_COLOR\0"
+ "GL_TEXTURE_ENV_MODE\0"
+ "GL_TEXTURE_FILTER_CONTROL\0"
+ "GL_TEXTURE_FILTER_CONTROL_EXT\0"
+ "GL_TEXTURE_GEN_MODE\0"
+ "GL_TEXTURE_GEN_MODE_OES\0"
+ "GL_TEXTURE_GEN_Q\0"
+ "GL_TEXTURE_GEN_R\0"
+ "GL_TEXTURE_GEN_S\0"
+ "GL_TEXTURE_GEN_STR_OES\0"
+ "GL_TEXTURE_GEN_T\0"
+ "GL_TEXTURE_GEQUAL_R_SGIX\0"
+ "GL_TEXTURE_GREEN_SIZE\0"
+ "GL_TEXTURE_GREEN_SIZE_EXT\0"
+ "GL_TEXTURE_HEIGHT\0"
+ "GL_TEXTURE_INDEX_SIZE_EXT\0"
+ "GL_TEXTURE_INTENSITY_SIZE\0"
+ "GL_TEXTURE_INTENSITY_SIZE_EXT\0"
+ "GL_TEXTURE_INTERNAL_FORMAT\0"
+ "GL_TEXTURE_LEQUAL_R_SGIX\0"
+ "GL_TEXTURE_LOD_BIAS\0"
+ "GL_TEXTURE_LOD_BIAS_EXT\0"
+ "GL_TEXTURE_LOD_BIAS_R_SGIX\0"
+ "GL_TEXTURE_LOD_BIAS_S_SGIX\0"
+ "GL_TEXTURE_LOD_BIAS_T_SGIX\0"
+ "GL_TEXTURE_LUMINANCE_SIZE\0"
+ "GL_TEXTURE_LUMINANCE_SIZE_EXT\0"
+ "GL_TEXTURE_MAG_FILTER\0"
+ "GL_TEXTURE_MATRIX\0"
+ "GL_TEXTURE_MATRIX_FLOAT_AS_INT_BITS_OES\0"
+ "GL_TEXTURE_MAX_ANISOTROPY_EXT\0"
+ "GL_TEXTURE_MAX_CLAMP_R_SGIX\0"
+ "GL_TEXTURE_MAX_CLAMP_S_SGIX\0"
+ "GL_TEXTURE_MAX_CLAMP_T_SGIX\0"
+ "GL_TEXTURE_MAX_LEVEL\0"
+ "GL_TEXTURE_MAX_LOD\0"
+ "GL_TEXTURE_MIN_FILTER\0"
+ "GL_TEXTURE_MIN_LOD\0"
+ "GL_TEXTURE_PRIORITY\0"
+ "GL_TEXTURE_RANGE_LENGTH_APPLE\0"
+ "GL_TEXTURE_RANGE_POINTER_APPLE\0"
+ "GL_TEXTURE_RECTANGLE\0"
+ "GL_TEXTURE_RECTANGLE_ARB\0"
+ "GL_TEXTURE_RECTANGLE_NV\0"
+ "GL_TEXTURE_RED_SIZE\0"
+ "GL_TEXTURE_RED_SIZE_EXT\0"
+ "GL_TEXTURE_RESIDENT\0"
+ "GL_TEXTURE_SHARED_SIZE\0"
+ "GL_TEXTURE_STACK_DEPTH\0"
+ "GL_TEXTURE_STENCIL_SIZE\0"
+ "GL_TEXTURE_STENCIL_SIZE_EXT\0"
+ "GL_TEXTURE_STORAGE_HINT_APPLE\0"
+ "GL_TEXTURE_TOO_LARGE_EXT\0"
+ "GL_TEXTURE_UNSIGNED_REMAP_MODE_NV\0"
+ "GL_TEXTURE_WIDTH\0"
+ "GL_TEXTURE_WRAP_R\0"
+ "GL_TEXTURE_WRAP_R_OES\0"
+ "GL_TEXTURE_WRAP_S\0"
+ "GL_TEXTURE_WRAP_T\0"
+ "GL_TIMEOUT_EXPIRED\0"
+ "GL_TIME_ELAPSED_EXT\0"
+ "GL_TRACK_MATRIX_NV\0"
+ "GL_TRACK_MATRIX_TRANSFORM_NV\0"
+ "GL_TRANSFORM_BIT\0"
+ "GL_TRANSFORM_FEEDBACK\0"
+ "GL_TRANSFORM_FEEDBACK_BINDING\0"
+ "GL_TRANSFORM_FEEDBACK_BUFFER\0"
+ "GL_TRANSFORM_FEEDBACK_BUFFER_ACTIVE\0"
+ "GL_TRANSFORM_FEEDBACK_BUFFER_BINDING\0"
+ "GL_TRANSFORM_FEEDBACK_BUFFER_BINDING_EXT\0"
+ "GL_TRANSFORM_FEEDBACK_BUFFER_EXT\0"
+ "GL_TRANSFORM_FEEDBACK_BUFFER_MODE\0"
+ "GL_TRANSFORM_FEEDBACK_BUFFER_MODE_EXT\0"
+ "GL_TRANSFORM_FEEDBACK_BUFFER_PAUSED\0"
+ "GL_TRANSFORM_FEEDBACK_BUFFER_SIZE\0"
+ "GL_TRANSFORM_FEEDBACK_BUFFER_SIZE_EXT\0"
+ "GL_TRANSFORM_FEEDBACK_BUFFER_START\0"
+ "GL_TRANSFORM_FEEDBACK_BUFFER_START_EXT\0"
+ "GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN\0"
+ "GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN_EXT\0"
+ "GL_TRANSFORM_FEEDBACK_VARYINGS\0"
+ "GL_TRANSFORM_FEEDBACK_VARYINGS_EXT\0"
+ "GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH\0"
+ "GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH_EXT\0"
+ "GL_TRANSPOSE_COLOR_MATRIX\0"
+ "GL_TRANSPOSE_COLOR_MATRIX_ARB\0"
+ "GL_TRANSPOSE_CURRENT_MATRIX_ARB\0"
+ "GL_TRANSPOSE_MODELVIEW_MATRIX\0"
+ "GL_TRANSPOSE_MODELVIEW_MATRIX_ARB\0"
+ "GL_TRANSPOSE_NV\0"
+ "GL_TRANSPOSE_PROJECTION_MATRIX\0"
+ "GL_TRANSPOSE_PROJECTION_MATRIX_ARB\0"
+ "GL_TRANSPOSE_TEXTURE_MATRIX\0"
+ "GL_TRANSPOSE_TEXTURE_MATRIX_ARB\0"
+ "GL_TRIANGLES\0"
+ "GL_TRIANGLES_ADJACENCY\0"
+ "GL_TRIANGLES_ADJACENCY_ARB\0"
+ "GL_TRIANGLE_FAN\0"
+ "GL_TRIANGLE_MESH_SUN\0"
+ "GL_TRIANGLE_STRIP\0"
+ "GL_TRIANGLE_STRIP_ADJACENCY\0"
+ "GL_TRIANGLE_STRIP_ADJACENCY_ARB\0"
+ "GL_TRUE\0"
+ "GL_UNDEFINED_APPLE\0"
+ "GL_UNKNOWN_CONTEXT_RESET_ARB\0"
+ "GL_UNPACK_ALIGNMENT\0"
+ "GL_UNPACK_IMAGE_HEIGHT\0"
+ "GL_UNPACK_LSB_FIRST\0"
+ "GL_UNPACK_ROW_LENGTH\0"
+ "GL_UNPACK_SKIP_IMAGES\0"
+ "GL_UNPACK_SKIP_PIXELS\0"
+ "GL_UNPACK_SKIP_ROWS\0"
+ "GL_UNPACK_SWAP_BYTES\0"
+ "GL_UNSIGNALED\0"
+ "GL_UNSIGNED_BYTE\0"
+ "GL_UNSIGNED_BYTE_2_3_3_REV\0"
+ "GL_UNSIGNED_BYTE_3_3_2\0"
+ "GL_UNSIGNED_INT\0"
+ "GL_UNSIGNED_INT_10F_11F_11F_REV\0"
+ "GL_UNSIGNED_INT_10_10_10_2\0"
+ "GL_UNSIGNED_INT_10_10_10_2_OES\0"
+ "GL_UNSIGNED_INT_24_8\0"
+ "GL_UNSIGNED_INT_24_8_EXT\0"
+ "GL_UNSIGNED_INT_24_8_NV\0"
+ "GL_UNSIGNED_INT_24_8_OES\0"
+ "GL_UNSIGNED_INT_2_10_10_10_REV\0"
+ "GL_UNSIGNED_INT_2_10_10_10_REV_EXT\0"
+ "GL_UNSIGNED_INT_5_9_9_9_REV\0"
+ "GL_UNSIGNED_INT_8_8_8_8\0"
+ "GL_UNSIGNED_INT_8_8_8_8_REV\0"
+ "GL_UNSIGNED_INT_SAMPLER_1D\0"
+ "GL_UNSIGNED_INT_SAMPLER_1D_ARRAY\0"
+ "GL_UNSIGNED_INT_SAMPLER_1D_ARRAY_EXT\0"
+ "GL_UNSIGNED_INT_SAMPLER_1D_EXT\0"
+ "GL_UNSIGNED_INT_SAMPLER_2D\0"
+ "GL_UNSIGNED_INT_SAMPLER_2D_ARRAY\0"
+ "GL_UNSIGNED_INT_SAMPLER_2D_ARRAY_EXT\0"
+ "GL_UNSIGNED_INT_SAMPLER_2D_EXT\0"
+ "GL_UNSIGNED_INT_SAMPLER_2D_RECT\0"
+ "GL_UNSIGNED_INT_SAMPLER_2D_RECT_EXT\0"
+ "GL_UNSIGNED_INT_SAMPLER_3D\0"
+ "GL_UNSIGNED_INT_SAMPLER_3D_EXT\0"
+ "GL_UNSIGNED_INT_SAMPLER_BUFFER\0"
+ "GL_UNSIGNED_INT_SAMPLER_BUFFER_EXT\0"
+ "GL_UNSIGNED_INT_SAMPLER_CUBE\0"
+ "GL_UNSIGNED_INT_SAMPLER_CUBE_EXT\0"
+ "GL_UNSIGNED_INT_VEC2\0"
+ "GL_UNSIGNED_INT_VEC2_EXT\0"
+ "GL_UNSIGNED_INT_VEC3\0"
+ "GL_UNSIGNED_INT_VEC3_EXT\0"
+ "GL_UNSIGNED_INT_VEC4\0"
+ "GL_UNSIGNED_INT_VEC4_EXT\0"
+ "GL_UNSIGNED_NORMALIZED\0"
+ "GL_UNSIGNED_SHORT\0"
+ "GL_UNSIGNED_SHORT_1_5_5_5_REV\0"
+ "GL_UNSIGNED_SHORT_1_5_5_5_REV_EXT\0"
+ "GL_UNSIGNED_SHORT_4_4_4_4\0"
+ "GL_UNSIGNED_SHORT_4_4_4_4_REV\0"
+ "GL_UNSIGNED_SHORT_4_4_4_4_REV_EXT\0"
+ "GL_UNSIGNED_SHORT_5_5_5_1\0"
+ "GL_UNSIGNED_SHORT_5_6_5\0"
+ "GL_UNSIGNED_SHORT_5_6_5_REV\0"
+ "GL_UNSIGNED_SHORT_8_8_APPLE\0"
+ "GL_UNSIGNED_SHORT_8_8_MESA\0"
+ "GL_UNSIGNED_SHORT_8_8_REV_APPLE\0"
+ "GL_UNSIGNED_SHORT_8_8_REV_MESA\0"
+ "GL_UPPER_LEFT\0"
+ "GL_V2F\0"
+ "GL_V3F\0"
+ "GL_VALIDATE_STATUS\0"
+ "GL_VENDOR\0"
+ "GL_VERSION\0"
+ "GL_VERTEX_ARRAY\0"
+ "GL_VERTEX_ARRAY_BINDING\0"
+ "GL_VERTEX_ARRAY_BINDING_APPLE\0"
+ "GL_VERTEX_ARRAY_BUFFER_BINDING\0"
+ "GL_VERTEX_ARRAY_BUFFER_BINDING_ARB\0"
+ "GL_VERTEX_ARRAY_POINTER\0"
+ "GL_VERTEX_ARRAY_SIZE\0"
+ "GL_VERTEX_ARRAY_STRIDE\0"
+ "GL_VERTEX_ARRAY_TYPE\0"
+ "GL_VERTEX_ATTRIB_ARRAY0_NV\0"
+ "GL_VERTEX_ATTRIB_ARRAY10_NV\0"
+ "GL_VERTEX_ATTRIB_ARRAY11_NV\0"
+ "GL_VERTEX_ATTRIB_ARRAY12_NV\0"
+ "GL_VERTEX_ATTRIB_ARRAY13_NV\0"
+ "GL_VERTEX_ATTRIB_ARRAY14_NV\0"
+ "GL_VERTEX_ATTRIB_ARRAY15_NV\0"
+ "GL_VERTEX_ATTRIB_ARRAY1_NV\0"
+ "GL_VERTEX_ATTRIB_ARRAY2_NV\0"
+ "GL_VERTEX_ATTRIB_ARRAY3_NV\0"
+ "GL_VERTEX_ATTRIB_ARRAY4_NV\0"
+ "GL_VERTEX_ATTRIB_ARRAY5_NV\0"
+ "GL_VERTEX_ATTRIB_ARRAY6_NV\0"
+ "GL_VERTEX_ATTRIB_ARRAY7_NV\0"
+ "GL_VERTEX_ATTRIB_ARRAY8_NV\0"
+ "GL_VERTEX_ATTRIB_ARRAY9_NV\0"
+ "GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING\0"
+ "GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB\0"
+ "GL_VERTEX_ATTRIB_ARRAY_DIVISOR_ARB\0"
+ "GL_VERTEX_ATTRIB_ARRAY_ENABLED\0"
+ "GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB\0"
+ "GL_VERTEX_ATTRIB_ARRAY_INTEGER\0"
+ "GL_VERTEX_ATTRIB_ARRAY_INTEGER_EXT\0"
+ "GL_VERTEX_ATTRIB_ARRAY_NORMALIZED\0"
+ "GL_VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB\0"
+ "GL_VERTEX_ATTRIB_ARRAY_POINTER\0"
+ "GL_VERTEX_ATTRIB_ARRAY_POINTER_ARB\0"
+ "GL_VERTEX_ATTRIB_ARRAY_SIZE\0"
+ "GL_VERTEX_ATTRIB_ARRAY_SIZE_ARB\0"
+ "GL_VERTEX_ATTRIB_ARRAY_STRIDE\0"
+ "GL_VERTEX_ATTRIB_ARRAY_STRIDE_ARB\0"
+ "GL_VERTEX_ATTRIB_ARRAY_TYPE\0"
+ "GL_VERTEX_ATTRIB_ARRAY_TYPE_ARB\0"
+ "GL_VERTEX_BLEND_ARB\0"
+ "GL_VERTEX_PROGRAM_ARB\0"
+ "GL_VERTEX_PROGRAM_BINDING_NV\0"
+ "GL_VERTEX_PROGRAM_NV\0"
+ "GL_VERTEX_PROGRAM_POINT_SIZE\0"
+ "GL_VERTEX_PROGRAM_POINT_SIZE_ARB\0"
+ "GL_VERTEX_PROGRAM_POINT_SIZE_NV\0"
+ "GL_VERTEX_PROGRAM_TWO_SIDE\0"
+ "GL_VERTEX_PROGRAM_TWO_SIDE_ARB\0"
+ "GL_VERTEX_PROGRAM_TWO_SIDE_NV\0"
+ "GL_VERTEX_SHADER\0"
+ "GL_VERTEX_SHADER_ARB\0"
+ "GL_VERTEX_STATE_PROGRAM_NV\0"
+ "GL_VIEWPORT\0"
+ "GL_VIEWPORT_BIT\0"
+ "GL_VOLATILE_APPLE\0"
+ "GL_WAIT_FAILED\0"
+ "GL_WEIGHT_ARRAY_ARB\0"
+ "GL_WEIGHT_ARRAY_BUFFER_BINDING\0"
+ "GL_WEIGHT_ARRAY_BUFFER_BINDING_ARB\0"
+ "GL_WEIGHT_ARRAY_BUFFER_BINDING_OES\0"
+ "GL_WEIGHT_ARRAY_OES\0"
+ "GL_WEIGHT_ARRAY_POINTER_ARB\0"
+ "GL_WEIGHT_ARRAY_POINTER_OES\0"
+ "GL_WEIGHT_ARRAY_SIZE_ARB\0"
+ "GL_WEIGHT_ARRAY_SIZE_OES\0"
+ "GL_WEIGHT_ARRAY_STRIDE_ARB\0"
+ "GL_WEIGHT_ARRAY_STRIDE_OES\0"
+ "GL_WEIGHT_ARRAY_TYPE_ARB\0"
+ "GL_WEIGHT_ARRAY_TYPE_OES\0"
+ "GL_WEIGHT_SUM_UNITY_ARB\0"
+ "GL_WRAP_BORDER_SUN\0"
+ "GL_WRITE_ONLY\0"
+ "GL_WRITE_ONLY_ARB\0"
+ "GL_WRITE_ONLY_OES\0"
+ "GL_XOR\0"
+ "GL_YCBCR_422_APPLE\0"
+ "GL_YCBCR_MESA\0"
+ "GL_ZERO\0"
+ "GL_ZOOM_X\0"
+ "GL_ZOOM_Y\0"
+ ;
+
+static const enum_elt all_enums[2313] =
+{
+ { 0, 0x00000600 }, /* GL_2D */
+ { 6, 0x00001407 }, /* GL_2_BYTES */
+ { 17, 0x00000601 }, /* GL_3D */
+ { 23, 0x00000602 }, /* GL_3D_COLOR */
+ { 35, 0x00000603 }, /* GL_3D_COLOR_TEXTURE */
+ { 55, 0x00001408 }, /* GL_3_BYTES */
+ { 66, 0x00000604 }, /* GL_4D_COLOR_TEXTURE */
+ { 86, 0x00001409 }, /* GL_4_BYTES */
+ { 97, 0x00000100 }, /* GL_ACCUM */
+ { 106, 0x00000D5B }, /* GL_ACCUM_ALPHA_BITS */
+ { 126, 0x00000D5A }, /* GL_ACCUM_BLUE_BITS */
+ { 145, 0x00000200 }, /* GL_ACCUM_BUFFER_BIT */
+ { 165, 0x00000B80 }, /* GL_ACCUM_CLEAR_VALUE */
+ { 186, 0x00000D59 }, /* GL_ACCUM_GREEN_BITS */
+ { 206, 0x00000D58 }, /* GL_ACCUM_RED_BITS */
+ { 224, 0x00008B89 }, /* GL_ACTIVE_ATTRIBUTES */
+ { 245, 0x00008B8A }, /* GL_ACTIVE_ATTRIBUTE_MAX_LENGTH */
+ { 276, 0x00008B8D }, /* GL_ACTIVE_PROGRAM_EXT */
+ { 298, 0x00008911 }, /* GL_ACTIVE_STENCIL_FACE_EXT */
+ { 325, 0x000084E0 }, /* GL_ACTIVE_TEXTURE */
+ { 343, 0x000084E0 }, /* GL_ACTIVE_TEXTURE_ARB */
+ { 365, 0x00008B86 }, /* GL_ACTIVE_UNIFORMS */
+ { 384, 0x00008B87 }, /* GL_ACTIVE_UNIFORM_MAX_LENGTH */
+ { 413, 0x000086A5 }, /* GL_ACTIVE_VERTEX_UNITS_ARB */
+ { 440, 0x00000104 }, /* GL_ADD */
+ { 447, 0x00008574 }, /* GL_ADD_SIGNED */
+ { 461, 0x00008574 }, /* GL_ADD_SIGNED_ARB */
+ { 479, 0x00008574 }, /* GL_ADD_SIGNED_EXT */
+ { 497, 0x0000846E }, /* GL_ALIASED_LINE_WIDTH_RANGE */
+ { 525, 0x0000846D }, /* GL_ALIASED_POINT_SIZE_RANGE */
+ { 553, 0x000FFFFF }, /* GL_ALL_ATTRIB_BITS */
+ { 572, 0xFFFFFFFF }, /* GL_ALL_CLIENT_ATTRIB_BITS */
+ { 598, 0x00001906 }, /* GL_ALPHA */
+ { 607, 0x0000803D }, /* GL_ALPHA12 */
+ { 618, 0x0000803D }, /* GL_ALPHA12_EXT */
+ { 633, 0x0000803E }, /* GL_ALPHA16 */
+ { 644, 0x00008D8A }, /* GL_ALPHA16I_EXT */
+ { 660, 0x00008D78 }, /* GL_ALPHA16UI_EXT */
+ { 677, 0x0000803E }, /* GL_ALPHA16_EXT */
+ { 692, 0x00008D84 }, /* GL_ALPHA32I_EXT */
+ { 708, 0x00008D72 }, /* GL_ALPHA32UI_EXT */
+ { 725, 0x0000803B }, /* GL_ALPHA4 */
+ { 735, 0x0000803B }, /* GL_ALPHA4_EXT */
+ { 749, 0x0000803C }, /* GL_ALPHA8 */
+ { 759, 0x00008D90 }, /* GL_ALPHA8I_EXT */
+ { 774, 0x00008D7E }, /* GL_ALPHA8UI_EXT */
+ { 790, 0x0000803C }, /* GL_ALPHA8_EXT */
+ { 804, 0x00000D1D }, /* GL_ALPHA_BIAS */
+ { 818, 0x00000D55 }, /* GL_ALPHA_BITS */
+ { 832, 0x00008D97 }, /* GL_ALPHA_INTEGER_EXT */
+ { 853, 0x00000D1C }, /* GL_ALPHA_SCALE */
+ { 868, 0x00000BC0 }, /* GL_ALPHA_TEST */
+ { 882, 0x00000BC1 }, /* GL_ALPHA_TEST_FUNC */
+ { 901, 0x00000BC2 }, /* GL_ALPHA_TEST_REF */
+ { 919, 0x0000911A }, /* GL_ALREADY_SIGNALED */
+ { 939, 0x00000207 }, /* GL_ALWAYS */
+ { 949, 0x00001200 }, /* GL_AMBIENT */
+ { 960, 0x00001602 }, /* GL_AMBIENT_AND_DIFFUSE */
+ { 983, 0x00001501 }, /* GL_AND */
+ { 990, 0x00001504 }, /* GL_AND_INVERTED */
+ { 1006, 0x00001502 }, /* GL_AND_REVERSE */
+ { 1021, 0x00008892 }, /* GL_ARRAY_BUFFER */
+ { 1037, 0x00008894 }, /* GL_ARRAY_BUFFER_BINDING */
+ { 1061, 0x00008894 }, /* GL_ARRAY_BUFFER_BINDING_ARB */
+ { 1089, 0x00008B85 }, /* GL_ATTACHED_SHADERS */
+ { 1109, 0x00008645 }, /* GL_ATTRIB_ARRAY_POINTER_NV */
+ { 1136, 0x00008623 }, /* GL_ATTRIB_ARRAY_SIZE_NV */
+ { 1160, 0x00008624 }, /* GL_ATTRIB_ARRAY_STRIDE_NV */
+ { 1186, 0x00008625 }, /* GL_ATTRIB_ARRAY_TYPE_NV */
+ { 1210, 0x00000BB0 }, /* GL_ATTRIB_STACK_DEPTH */
+ { 1232, 0x00000D80 }, /* GL_AUTO_NORMAL */
+ { 1247, 0x00000409 }, /* GL_AUX0 */
+ { 1255, 0x0000040A }, /* GL_AUX1 */
+ { 1263, 0x0000040B }, /* GL_AUX2 */
+ { 1271, 0x0000040C }, /* GL_AUX3 */
+ { 1279, 0x00000C00 }, /* GL_AUX_BUFFERS */
+ { 1294, 0x00000405 }, /* GL_BACK */
+ { 1302, 0x00000402 }, /* GL_BACK_LEFT */
+ { 1315, 0x00000403 }, /* GL_BACK_RIGHT */
+ { 1329, 0x000080E0 }, /* GL_BGR */
+ { 1336, 0x000080E1 }, /* GL_BGRA */
+ { 1344, 0x000080E1 }, /* GL_BGRA_EXT */
+ { 1356, 0x00008D9B }, /* GL_BGRA_INTEGER */
+ { 1372, 0x00008D9B }, /* GL_BGRA_INTEGER_EXT */
+ { 1392, 0x00008D9A }, /* GL_BGR_INTEGER */
+ { 1407, 0x00008D9A }, /* GL_BGR_INTEGER_EXT */
+ { 1426, 0x00001A00 }, /* GL_BITMAP */
+ { 1436, 0x00000704 }, /* GL_BITMAP_TOKEN */
+ { 1452, 0x00000BE2 }, /* GL_BLEND */
+ { 1461, 0x00008005 }, /* GL_BLEND_COLOR */
+ { 1476, 0x00008005 }, /* GL_BLEND_COLOR_EXT */
+ { 1495, 0x00000BE0 }, /* GL_BLEND_DST */
+ { 1508, 0x000080CA }, /* GL_BLEND_DST_ALPHA */
+ { 1527, 0x000080CA }, /* GL_BLEND_DST_ALPHA_OES */
+ { 1550, 0x000080C8 }, /* GL_BLEND_DST_RGB */
+ { 1567, 0x000080C8 }, /* GL_BLEND_DST_RGB_OES */
+ { 1588, 0x00008009 }, /* GL_BLEND_EQUATION */
+ { 1606, 0x0000883D }, /* GL_BLEND_EQUATION_ALPHA */
+ { 1630, 0x0000883D }, /* GL_BLEND_EQUATION_ALPHA_EXT */
+ { 1658, 0x0000883D }, /* GL_BLEND_EQUATION_ALPHA_OES */
+ { 1686, 0x00008009 }, /* GL_BLEND_EQUATION_EXT */
+ { 1708, 0x00008009 }, /* GL_BLEND_EQUATION_OES */
+ { 1730, 0x00008009 }, /* GL_BLEND_EQUATION_RGB */
+ { 1752, 0x00008009 }, /* GL_BLEND_EQUATION_RGB_EXT */
+ { 1778, 0x00008009 }, /* GL_BLEND_EQUATION_RGB_OES */
+ { 1804, 0x00000BE1 }, /* GL_BLEND_SRC */
+ { 1817, 0x000080CB }, /* GL_BLEND_SRC_ALPHA */
+ { 1836, 0x000080CB }, /* GL_BLEND_SRC_ALPHA_OES */
+ { 1859, 0x000080C9 }, /* GL_BLEND_SRC_RGB */
+ { 1876, 0x000080C9 }, /* GL_BLEND_SRC_RGB_OES */
+ { 1897, 0x00001905 }, /* GL_BLUE */
+ { 1905, 0x00000D1B }, /* GL_BLUE_BIAS */
+ { 1918, 0x00000D54 }, /* GL_BLUE_BITS */
+ { 1931, 0x00008D96 }, /* GL_BLUE_INTEGER */
+ { 1947, 0x00008D96 }, /* GL_BLUE_INTEGER_EXT */
+ { 1967, 0x00000D1A }, /* GL_BLUE_SCALE */
+ { 1981, 0x00008B56 }, /* GL_BOOL */
+ { 1989, 0x00008B56 }, /* GL_BOOL_ARB */
+ { 2001, 0x00008B57 }, /* GL_BOOL_VEC2 */
+ { 2014, 0x00008B57 }, /* GL_BOOL_VEC2_ARB */
+ { 2031, 0x00008B58 }, /* GL_BOOL_VEC3 */
+ { 2044, 0x00008B58 }, /* GL_BOOL_VEC3_ARB */
+ { 2061, 0x00008B59 }, /* GL_BOOL_VEC4 */
+ { 2074, 0x00008B59 }, /* GL_BOOL_VEC4_ARB */
+ { 2091, 0x000088BB }, /* GL_BUFFER_ACCESS */
+ { 2108, 0x000088BB }, /* GL_BUFFER_ACCESS_ARB */
+ { 2129, 0x0000911F }, /* GL_BUFFER_ACCESS_FLAGS */
+ { 2152, 0x000088BB }, /* GL_BUFFER_ACCESS_OES */
+ { 2173, 0x00008A13 }, /* GL_BUFFER_FLUSHING_UNMAP_APPLE */
+ { 2204, 0x000088BC }, /* GL_BUFFER_MAPPED */
+ { 2221, 0x000088BC }, /* GL_BUFFER_MAPPED_ARB */
+ { 2242, 0x000088BC }, /* GL_BUFFER_MAPPED_OES */
+ { 2263, 0x00009120 }, /* GL_BUFFER_MAP_LENGTH */
+ { 2284, 0x00009121 }, /* GL_BUFFER_MAP_OFFSET */
+ { 2305, 0x000088BD }, /* GL_BUFFER_MAP_POINTER */
+ { 2327, 0x000088BD }, /* GL_BUFFER_MAP_POINTER_ARB */
+ { 2353, 0x000088BD }, /* GL_BUFFER_MAP_POINTER_OES */
+ { 2379, 0x000085B3 }, /* GL_BUFFER_OBJECT_APPLE */
+ { 2402, 0x00008A12 }, /* GL_BUFFER_SERIALIZED_MODIFY_APPLE */
+ { 2436, 0x00008764 }, /* GL_BUFFER_SIZE */
+ { 2451, 0x00008764 }, /* GL_BUFFER_SIZE_ARB */
+ { 2470, 0x00008765 }, /* GL_BUFFER_USAGE */
+ { 2486, 0x00008765 }, /* GL_BUFFER_USAGE_ARB */
+ { 2506, 0x0000877B }, /* GL_BUMP_ENVMAP_ATI */
+ { 2525, 0x00008777 }, /* GL_BUMP_NUM_TEX_UNITS_ATI */
+ { 2551, 0x00008775 }, /* GL_BUMP_ROT_MATRIX_ATI */
+ { 2574, 0x00008776 }, /* GL_BUMP_ROT_MATRIX_SIZE_ATI */
+ { 2602, 0x0000877C }, /* GL_BUMP_TARGET_ATI */
+ { 2621, 0x00008778 }, /* GL_BUMP_TEX_UNITS_ATI */
+ { 2643, 0x00001400 }, /* GL_BYTE */
+ { 2651, 0x00002A24 }, /* GL_C3F_V3F */
+ { 2662, 0x00002A26 }, /* GL_C4F_N3F_V3F */
+ { 2677, 0x00002A22 }, /* GL_C4UB_V2F */
+ { 2689, 0x00002A23 }, /* GL_C4UB_V3F */
+ { 2701, 0x00000901 }, /* GL_CCW */
+ { 2708, 0x00002900 }, /* GL_CLAMP */
+ { 2717, 0x0000891B }, /* GL_CLAMP_FRAGMENT_COLOR_ARB */
+ { 2745, 0x0000891C }, /* GL_CLAMP_READ_COLOR */
+ { 2765, 0x0000891C }, /* GL_CLAMP_READ_COLOR_ARB */
+ { 2789, 0x0000812D }, /* GL_CLAMP_TO_BORDER */
+ { 2808, 0x0000812D }, /* GL_CLAMP_TO_BORDER_ARB */
+ { 2831, 0x0000812D }, /* GL_CLAMP_TO_BORDER_SGIS */
+ { 2855, 0x0000812F }, /* GL_CLAMP_TO_EDGE */
+ { 2872, 0x0000812F }, /* GL_CLAMP_TO_EDGE_SGIS */
+ { 2894, 0x0000891A }, /* GL_CLAMP_VERTEX_COLOR_ARB */
+ { 2920, 0x00001500 }, /* GL_CLEAR */
+ { 2929, 0x000084E1 }, /* GL_CLIENT_ACTIVE_TEXTURE */
+ { 2954, 0x000084E1 }, /* GL_CLIENT_ACTIVE_TEXTURE_ARB */
+ { 2983, 0xFFFFFFFF }, /* GL_CLIENT_ALL_ATTRIB_BITS */
+ { 3009, 0x00000BB1 }, /* GL_CLIENT_ATTRIB_STACK_DEPTH */
+ { 3038, 0x00000001 }, /* GL_CLIENT_PIXEL_STORE_BIT */
+ { 3064, 0x00000002 }, /* GL_CLIENT_VERTEX_ARRAY_BIT */
+ { 3091, 0x00003000 }, /* GL_CLIP_DISTANCE0 */
+ { 3109, 0x00003001 }, /* GL_CLIP_DISTANCE1 */
+ { 3127, 0x00003002 }, /* GL_CLIP_DISTANCE2 */
+ { 3145, 0x00003003 }, /* GL_CLIP_DISTANCE3 */
+ { 3163, 0x00003004 }, /* GL_CLIP_DISTANCE4 */
+ { 3181, 0x00003005 }, /* GL_CLIP_DISTANCE5 */
+ { 3199, 0x00003006 }, /* GL_CLIP_DISTANCE6 */
+ { 3217, 0x00003007 }, /* GL_CLIP_DISTANCE7 */
+ { 3235, 0x00003000 }, /* GL_CLIP_PLANE0 */
+ { 3250, 0x00003001 }, /* GL_CLIP_PLANE1 */
+ { 3265, 0x00003002 }, /* GL_CLIP_PLANE2 */
+ { 3280, 0x00003003 }, /* GL_CLIP_PLANE3 */
+ { 3295, 0x00003004 }, /* GL_CLIP_PLANE4 */
+ { 3310, 0x00003005 }, /* GL_CLIP_PLANE5 */
+ { 3325, 0x000080F0 }, /* GL_CLIP_VOLUME_CLIPPING_HINT_EXT */
+ { 3358, 0x00000A00 }, /* GL_COEFF */
+ { 3367, 0x00001800 }, /* GL_COLOR */
+ { 3376, 0x00008076 }, /* GL_COLOR_ARRAY */
+ { 3391, 0x00008898 }, /* GL_COLOR_ARRAY_BUFFER_BINDING */
+ { 3421, 0x00008898 }, /* GL_COLOR_ARRAY_BUFFER_BINDING_ARB */
+ { 3455, 0x00008090 }, /* GL_COLOR_ARRAY_POINTER */
+ { 3478, 0x00008081 }, /* GL_COLOR_ARRAY_SIZE */
+ { 3498, 0x00008083 }, /* GL_COLOR_ARRAY_STRIDE */
+ { 3520, 0x00008082 }, /* GL_COLOR_ARRAY_TYPE */
+ { 3540, 0x00008CE0 }, /* GL_COLOR_ATTACHMENT0 */
+ { 3561, 0x00008CE0 }, /* GL_COLOR_ATTACHMENT0_EXT */
+ { 3586, 0x00008CE0 }, /* GL_COLOR_ATTACHMENT0_OES */
+ { 3611, 0x00008CE1 }, /* GL_COLOR_ATTACHMENT1 */
+ { 3632, 0x00008CEA }, /* GL_COLOR_ATTACHMENT10 */
+ { 3654, 0x00008CEA }, /* GL_COLOR_ATTACHMENT10_EXT */
+ { 3680, 0x00008CEB }, /* GL_COLOR_ATTACHMENT11 */
+ { 3702, 0x00008CEB }, /* GL_COLOR_ATTACHMENT11_EXT */
+ { 3728, 0x00008CEC }, /* GL_COLOR_ATTACHMENT12 */
+ { 3750, 0x00008CEC }, /* GL_COLOR_ATTACHMENT12_EXT */
+ { 3776, 0x00008CED }, /* GL_COLOR_ATTACHMENT13 */
+ { 3798, 0x00008CED }, /* GL_COLOR_ATTACHMENT13_EXT */
+ { 3824, 0x00008CEE }, /* GL_COLOR_ATTACHMENT14 */
+ { 3846, 0x00008CEE }, /* GL_COLOR_ATTACHMENT14_EXT */
+ { 3872, 0x00008CEF }, /* GL_COLOR_ATTACHMENT15 */
+ { 3894, 0x00008CEF }, /* GL_COLOR_ATTACHMENT15_EXT */
+ { 3920, 0x00008CE1 }, /* GL_COLOR_ATTACHMENT1_EXT */
+ { 3945, 0x00008CE2 }, /* GL_COLOR_ATTACHMENT2 */
+ { 3966, 0x00008CE2 }, /* GL_COLOR_ATTACHMENT2_EXT */
+ { 3991, 0x00008CE3 }, /* GL_COLOR_ATTACHMENT3 */
+ { 4012, 0x00008CE3 }, /* GL_COLOR_ATTACHMENT3_EXT */
+ { 4037, 0x00008CE4 }, /* GL_COLOR_ATTACHMENT4 */
+ { 4058, 0x00008CE4 }, /* GL_COLOR_ATTACHMENT4_EXT */
+ { 4083, 0x00008CE5 }, /* GL_COLOR_ATTACHMENT5 */
+ { 4104, 0x00008CE5 }, /* GL_COLOR_ATTACHMENT5_EXT */
+ { 4129, 0x00008CE6 }, /* GL_COLOR_ATTACHMENT6 */
+ { 4150, 0x00008CE6 }, /* GL_COLOR_ATTACHMENT6_EXT */
+ { 4175, 0x00008CE7 }, /* GL_COLOR_ATTACHMENT7 */
+ { 4196, 0x00008CE7 }, /* GL_COLOR_ATTACHMENT7_EXT */
+ { 4221, 0x00008CE8 }, /* GL_COLOR_ATTACHMENT8 */
+ { 4242, 0x00008CE8 }, /* GL_COLOR_ATTACHMENT8_EXT */
+ { 4267, 0x00008CE9 }, /* GL_COLOR_ATTACHMENT9 */
+ { 4288, 0x00008CE9 }, /* GL_COLOR_ATTACHMENT9_EXT */
+ { 4313, 0x00004000 }, /* GL_COLOR_BUFFER_BIT */
+ { 4333, 0x00000C22 }, /* GL_COLOR_CLEAR_VALUE */
+ { 4354, 0x00001900 }, /* GL_COLOR_INDEX */
+ { 4369, 0x00001603 }, /* GL_COLOR_INDEXES */
+ { 4386, 0x00000BF2 }, /* GL_COLOR_LOGIC_OP */
+ { 4404, 0x00000B57 }, /* GL_COLOR_MATERIAL */
+ { 4422, 0x00000B55 }, /* GL_COLOR_MATERIAL_FACE */
+ { 4445, 0x00000B56 }, /* GL_COLOR_MATERIAL_PARAMETER */
+ { 4473, 0x000080B1 }, /* GL_COLOR_MATRIX */
+ { 4489, 0x000080B1 }, /* GL_COLOR_MATRIX_SGI */
+ { 4509, 0x000080B2 }, /* GL_COLOR_MATRIX_STACK_DEPTH */
+ { 4537, 0x000080B2 }, /* GL_COLOR_MATRIX_STACK_DEPTH_SGI */
+ { 4569, 0x00008458 }, /* GL_COLOR_SUM */
+ { 4582, 0x00008458 }, /* GL_COLOR_SUM_ARB */
+ { 4599, 0x000080D0 }, /* GL_COLOR_TABLE */
+ { 4614, 0x000080DD }, /* GL_COLOR_TABLE_ALPHA_SIZE */
+ { 4640, 0x000080DD }, /* GL_COLOR_TABLE_ALPHA_SIZE_EXT */
+ { 4670, 0x000080DD }, /* GL_COLOR_TABLE_ALPHA_SIZE_SGI */
+ { 4700, 0x000080D7 }, /* GL_COLOR_TABLE_BIAS */
+ { 4720, 0x000080D7 }, /* GL_COLOR_TABLE_BIAS_SGI */
+ { 4744, 0x000080DC }, /* GL_COLOR_TABLE_BLUE_SIZE */
+ { 4769, 0x000080DC }, /* GL_COLOR_TABLE_BLUE_SIZE_EXT */
+ { 4798, 0x000080DC }, /* GL_COLOR_TABLE_BLUE_SIZE_SGI */
+ { 4827, 0x000080D8 }, /* GL_COLOR_TABLE_FORMAT */
+ { 4849, 0x000080D8 }, /* GL_COLOR_TABLE_FORMAT_EXT */
+ { 4875, 0x000080D8 }, /* GL_COLOR_TABLE_FORMAT_SGI */
+ { 4901, 0x000080DB }, /* GL_COLOR_TABLE_GREEN_SIZE */
+ { 4927, 0x000080DB }, /* GL_COLOR_TABLE_GREEN_SIZE_EXT */
+ { 4957, 0x000080DB }, /* GL_COLOR_TABLE_GREEN_SIZE_SGI */
+ { 4987, 0x000080DF }, /* GL_COLOR_TABLE_INTENSITY_SIZE */
+ { 5017, 0x000080DF }, /* GL_COLOR_TABLE_INTENSITY_SIZE_EXT */
+ { 5051, 0x000080DF }, /* GL_COLOR_TABLE_INTENSITY_SIZE_SGI */
+ { 5085, 0x000080DE }, /* GL_COLOR_TABLE_LUMINANCE_SIZE */
+ { 5115, 0x000080DE }, /* GL_COLOR_TABLE_LUMINANCE_SIZE_EXT */
+ { 5149, 0x000080DE }, /* GL_COLOR_TABLE_LUMINANCE_SIZE_SGI */
+ { 5183, 0x000080DA }, /* GL_COLOR_TABLE_RED_SIZE */
+ { 5207, 0x000080DA }, /* GL_COLOR_TABLE_RED_SIZE_EXT */
+ { 5235, 0x000080DA }, /* GL_COLOR_TABLE_RED_SIZE_SGI */
+ { 5263, 0x000080D6 }, /* GL_COLOR_TABLE_SCALE */
+ { 5284, 0x000080D6 }, /* GL_COLOR_TABLE_SCALE_SGI */
+ { 5309, 0x000080D9 }, /* GL_COLOR_TABLE_WIDTH */
+ { 5330, 0x000080D9 }, /* GL_COLOR_TABLE_WIDTH_EXT */
+ { 5355, 0x000080D9 }, /* GL_COLOR_TABLE_WIDTH_SGI */
+ { 5380, 0x00000C23 }, /* GL_COLOR_WRITEMASK */
+ { 5399, 0x00008570 }, /* GL_COMBINE */
+ { 5410, 0x00008503 }, /* GL_COMBINE4 */
+ { 5422, 0x00008572 }, /* GL_COMBINE_ALPHA */
+ { 5439, 0x00008572 }, /* GL_COMBINE_ALPHA_ARB */
+ { 5460, 0x00008572 }, /* GL_COMBINE_ALPHA_EXT */
+ { 5481, 0x00008570 }, /* GL_COMBINE_ARB */
+ { 5496, 0x00008570 }, /* GL_COMBINE_EXT */
+ { 5511, 0x00008571 }, /* GL_COMBINE_RGB */
+ { 5526, 0x00008571 }, /* GL_COMBINE_RGB_ARB */
+ { 5545, 0x00008571 }, /* GL_COMBINE_RGB_EXT */
+ { 5564, 0x0000884E }, /* GL_COMPARE_REF_DEPTH_TO_TEXTURE_EXT */
+ { 5600, 0x0000884E }, /* GL_COMPARE_REF_TO_TEXTURE */
+ { 5626, 0x0000884E }, /* GL_COMPARE_R_TO_TEXTURE */
+ { 5650, 0x0000884E }, /* GL_COMPARE_R_TO_TEXTURE_ARB */
+ { 5678, 0x00001300 }, /* GL_COMPILE */
+ { 5689, 0x00001301 }, /* GL_COMPILE_AND_EXECUTE */
+ { 5712, 0x00008B81 }, /* GL_COMPILE_STATUS */
+ { 5730, 0x000084E9 }, /* GL_COMPRESSED_ALPHA */
+ { 5750, 0x000084E9 }, /* GL_COMPRESSED_ALPHA_ARB */
+ { 5774, 0x000084EC }, /* GL_COMPRESSED_INTENSITY */
+ { 5798, 0x000084EC }, /* GL_COMPRESSED_INTENSITY_ARB */
+ { 5826, 0x000084EA }, /* GL_COMPRESSED_LUMINANCE */
+ { 5850, 0x000084EB }, /* GL_COMPRESSED_LUMINANCE_ALPHA */
+ { 5880, 0x000084EB }, /* GL_COMPRESSED_LUMINANCE_ALPHA_ARB */
+ { 5914, 0x000084EA }, /* GL_COMPRESSED_LUMINANCE_ARB */
+ { 5942, 0x00008225 }, /* GL_COMPRESSED_RED */
+ { 5960, 0x00008226 }, /* GL_COMPRESSED_RG */
+ { 5977, 0x000084ED }, /* GL_COMPRESSED_RGB */
+ { 5995, 0x000084EE }, /* GL_COMPRESSED_RGBA */
+ { 6014, 0x000084EE }, /* GL_COMPRESSED_RGBA_ARB */
+ { 6037, 0x000086B1 }, /* GL_COMPRESSED_RGBA_FXT1_3DFX */
+ { 6066, 0x000083F1 }, /* GL_COMPRESSED_RGBA_S3TC_DXT1_EXT */
+ { 6099, 0x000083F2 }, /* GL_COMPRESSED_RGBA_S3TC_DXT3_EXT */
+ { 6132, 0x000083F3 }, /* GL_COMPRESSED_RGBA_S3TC_DXT5_EXT */
+ { 6165, 0x000084ED }, /* GL_COMPRESSED_RGB_ARB */
+ { 6187, 0x000086B0 }, /* GL_COMPRESSED_RGB_FXT1_3DFX */
+ { 6215, 0x000083F0 }, /* GL_COMPRESSED_RGB_S3TC_DXT1_EXT */
+ { 6247, 0x00008C4A }, /* GL_COMPRESSED_SLUMINANCE */
+ { 6272, 0x00008C4B }, /* GL_COMPRESSED_SLUMINANCE_ALPHA */
+ { 6303, 0x00008C48 }, /* GL_COMPRESSED_SRGB */
+ { 6322, 0x00008C49 }, /* GL_COMPRESSED_SRGB_ALPHA */
+ { 6347, 0x000086A3 }, /* GL_COMPRESSED_TEXTURE_FORMATS */
+ { 6377, 0x0000911C }, /* GL_CONDITION_SATISFIED */
+ { 6400, 0x00008576 }, /* GL_CONSTANT */
+ { 6412, 0x00008003 }, /* GL_CONSTANT_ALPHA */
+ { 6430, 0x00008003 }, /* GL_CONSTANT_ALPHA_EXT */
+ { 6452, 0x00008576 }, /* GL_CONSTANT_ARB */
+ { 6468, 0x00001207 }, /* GL_CONSTANT_ATTENUATION */
+ { 6492, 0x00008151 }, /* GL_CONSTANT_BORDER_HP */
+ { 6514, 0x00008001 }, /* GL_CONSTANT_COLOR */
+ { 6532, 0x00008001 }, /* GL_CONSTANT_COLOR_EXT */
+ { 6554, 0x00008576 }, /* GL_CONSTANT_EXT */
+ { 6570, 0x00000002 }, /* GL_CONTEXT_COMPATIBILITY_PROFILE_BIT */
+ { 6607, 0x00000001 }, /* GL_CONTEXT_CORE_PROFILE_BIT */
+ { 6635, 0x0000821E }, /* GL_CONTEXT_FLAGS */
+ { 6652, 0x00000001 }, /* GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT */
+ { 6691, 0x00000004 }, /* GL_CONTEXT_FLAG_ROBUST_ACCESS_BIT_ARB */
+ { 6729, 0x00009126 }, /* GL_CONTEXT_PROFILE_MASK */
+ { 6753, 0x00008010 }, /* GL_CONVOLUTION_1D */
+ { 6771, 0x00008011 }, /* GL_CONVOLUTION_2D */
+ { 6789, 0x00008154 }, /* GL_CONVOLUTION_BORDER_COLOR */
+ { 6817, 0x00008154 }, /* GL_CONVOLUTION_BORDER_COLOR_HP */
+ { 6848, 0x00008013 }, /* GL_CONVOLUTION_BORDER_MODE */
+ { 6875, 0x00008013 }, /* GL_CONVOLUTION_BORDER_MODE_EXT */
+ { 6906, 0x00008015 }, /* GL_CONVOLUTION_FILTER_BIAS */
+ { 6933, 0x00008015 }, /* GL_CONVOLUTION_FILTER_BIAS_EXT */
+ { 6964, 0x00008014 }, /* GL_CONVOLUTION_FILTER_SCALE */
+ { 6992, 0x00008014 }, /* GL_CONVOLUTION_FILTER_SCALE_EXT */
+ { 7024, 0x00008017 }, /* GL_CONVOLUTION_FORMAT */
+ { 7046, 0x00008017 }, /* GL_CONVOLUTION_FORMAT_EXT */
+ { 7072, 0x00008019 }, /* GL_CONVOLUTION_HEIGHT */
+ { 7094, 0x00008019 }, /* GL_CONVOLUTION_HEIGHT_EXT */
+ { 7120, 0x00008018 }, /* GL_CONVOLUTION_WIDTH */
+ { 7141, 0x00008018 }, /* GL_CONVOLUTION_WIDTH_EXT */
+ { 7166, 0x00008862 }, /* GL_COORD_REPLACE */
+ { 7183, 0x00008862 }, /* GL_COORD_REPLACE_ARB */
+ { 7204, 0x00008862 }, /* GL_COORD_REPLACE_NV */
+ { 7224, 0x00008862 }, /* GL_COORD_REPLACE_OES */
+ { 7245, 0x00001503 }, /* GL_COPY */
+ { 7253, 0x0000150C }, /* GL_COPY_INVERTED */
+ { 7270, 0x00000706 }, /* GL_COPY_PIXEL_TOKEN */
+ { 7290, 0x00008F36 }, /* GL_COPY_READ_BUFFER */
+ { 7310, 0x00008F37 }, /* GL_COPY_WRITE_BUFFER */
+ { 7331, 0x00000B44 }, /* GL_CULL_FACE */
+ { 7344, 0x00000B45 }, /* GL_CULL_FACE_MODE */
+ { 7362, 0x000081AA }, /* GL_CULL_VERTEX_EXT */
+ { 7381, 0x000081AC }, /* GL_CULL_VERTEX_EYE_POSITION_EXT */
+ { 7413, 0x000081AB }, /* GL_CULL_VERTEX_OBJECT_POSITION_EXT */
+ { 7448, 0x00008626 }, /* GL_CURRENT_ATTRIB_NV */
+ { 7469, 0x00000001 }, /* GL_CURRENT_BIT */
+ { 7484, 0x00000B00 }, /* GL_CURRENT_COLOR */
+ { 7501, 0x00008453 }, /* GL_CURRENT_FOG_COORD */
+ { 7522, 0x00008453 }, /* GL_CURRENT_FOG_COORDINATE */
+ { 7548, 0x00000B01 }, /* GL_CURRENT_INDEX */
+ { 7565, 0x00008641 }, /* GL_CURRENT_MATRIX_ARB */
+ { 7587, 0x00008845 }, /* GL_CURRENT_MATRIX_INDEX_ARB */
+ { 7615, 0x00008641 }, /* GL_CURRENT_MATRIX_NV */
+ { 7636, 0x00008640 }, /* GL_CURRENT_MATRIX_STACK_DEPTH_ARB */
+ { 7670, 0x00008640 }, /* GL_CURRENT_MATRIX_STACK_DEPTH_NV */
+ { 7703, 0x00000B02 }, /* GL_CURRENT_NORMAL */
+ { 7721, 0x00008843 }, /* GL_CURRENT_PALETTE_MATRIX_ARB */
+ { 7751, 0x00008843 }, /* GL_CURRENT_PALETTE_MATRIX_OES */
+ { 7781, 0x00008B8D }, /* GL_CURRENT_PROGRAM */
+ { 7800, 0x00008865 }, /* GL_CURRENT_QUERY */
+ { 7817, 0x00008865 }, /* GL_CURRENT_QUERY_ARB */
+ { 7838, 0x00000B04 }, /* GL_CURRENT_RASTER_COLOR */
+ { 7862, 0x00000B09 }, /* GL_CURRENT_RASTER_DISTANCE */
+ { 7889, 0x00000B05 }, /* GL_CURRENT_RASTER_INDEX */
+ { 7913, 0x00000B07 }, /* GL_CURRENT_RASTER_POSITION */
+ { 7940, 0x00000B08 }, /* GL_CURRENT_RASTER_POSITION_VALID */
+ { 7973, 0x0000845F }, /* GL_CURRENT_RASTER_SECONDARY_COLOR */
+ { 8007, 0x00000B06 }, /* GL_CURRENT_RASTER_TEXTURE_COORDS */
+ { 8040, 0x00008459 }, /* GL_CURRENT_SECONDARY_COLOR */
+ { 8067, 0x00000B03 }, /* GL_CURRENT_TEXTURE_COORDS */
+ { 8093, 0x00008626 }, /* GL_CURRENT_VERTEX_ATTRIB */
+ { 8118, 0x00008626 }, /* GL_CURRENT_VERTEX_ATTRIB_ARB */
+ { 8147, 0x000086A8 }, /* GL_CURRENT_WEIGHT_ARB */
+ { 8169, 0x00000900 }, /* GL_CW */
+ { 8175, 0x0000875B }, /* GL_DEBUG_ASSERT_MESA */
+ { 8196, 0x00008759 }, /* GL_DEBUG_OBJECT_MESA */
+ { 8217, 0x0000875A }, /* GL_DEBUG_PRINT_MESA */
+ { 8237, 0x00002101 }, /* GL_DECAL */
+ { 8246, 0x00001E03 }, /* GL_DECR */
+ { 8254, 0x00008508 }, /* GL_DECR_WRAP */
+ { 8267, 0x00008508 }, /* GL_DECR_WRAP_EXT */
+ { 8284, 0x00008B80 }, /* GL_DELETE_STATUS */
+ { 8301, 0x00001801 }, /* GL_DEPTH */
+ { 8310, 0x000088F0 }, /* GL_DEPTH24_STENCIL8 */
+ { 8330, 0x000088F0 }, /* GL_DEPTH24_STENCIL8_EXT */
+ { 8354, 0x000088F0 }, /* GL_DEPTH24_STENCIL8_OES */
+ { 8378, 0x00008D00 }, /* GL_DEPTH_ATTACHMENT */
+ { 8398, 0x00008D00 }, /* GL_DEPTH_ATTACHMENT_EXT */
+ { 8422, 0x00008D00 }, /* GL_DEPTH_ATTACHMENT_OES */
+ { 8446, 0x00000D1F }, /* GL_DEPTH_BIAS */
+ { 8460, 0x00000D56 }, /* GL_DEPTH_BITS */
+ { 8474, 0x00008891 }, /* GL_DEPTH_BOUNDS_EXT */
+ { 8494, 0x00008890 }, /* GL_DEPTH_BOUNDS_TEST_EXT */
+ { 8519, 0x00008223 }, /* GL_DEPTH_BUFFER */
+ { 8535, 0x00000100 }, /* GL_DEPTH_BUFFER_BIT */
+ { 8555, 0x0000864F }, /* GL_DEPTH_CLAMP */
+ { 8570, 0x0000864F }, /* GL_DEPTH_CLAMP_NV */
+ { 8588, 0x00000B73 }, /* GL_DEPTH_CLEAR_VALUE */
+ { 8609, 0x00001902 }, /* GL_DEPTH_COMPONENT */
+ { 8628, 0x000081A5 }, /* GL_DEPTH_COMPONENT16 */
+ { 8649, 0x000081A5 }, /* GL_DEPTH_COMPONENT16_ARB */
+ { 8674, 0x000081A5 }, /* GL_DEPTH_COMPONENT16_OES */
+ { 8699, 0x000081A5 }, /* GL_DEPTH_COMPONENT16_SGIX */
+ { 8725, 0x000081A6 }, /* GL_DEPTH_COMPONENT24 */
+ { 8746, 0x000081A6 }, /* GL_DEPTH_COMPONENT24_ARB */
+ { 8771, 0x000081A6 }, /* GL_DEPTH_COMPONENT24_OES */
+ { 8796, 0x000081A6 }, /* GL_DEPTH_COMPONENT24_SGIX */
+ { 8822, 0x000081A7 }, /* GL_DEPTH_COMPONENT32 */
+ { 8843, 0x000081A7 }, /* GL_DEPTH_COMPONENT32_ARB */
+ { 8868, 0x000081A7 }, /* GL_DEPTH_COMPONENT32_OES */
+ { 8893, 0x000081A7 }, /* GL_DEPTH_COMPONENT32_SGIX */
+ { 8919, 0x00000B74 }, /* GL_DEPTH_FUNC */
+ { 8933, 0x00000B70 }, /* GL_DEPTH_RANGE */
+ { 8948, 0x00000D1E }, /* GL_DEPTH_SCALE */
+ { 8963, 0x000084F9 }, /* GL_DEPTH_STENCIL */
+ { 8980, 0x0000821A }, /* GL_DEPTH_STENCIL_ATTACHMENT */
+ { 9008, 0x000084F9 }, /* GL_DEPTH_STENCIL_EXT */
+ { 9029, 0x000084F9 }, /* GL_DEPTH_STENCIL_NV */
+ { 9049, 0x000084F9 }, /* GL_DEPTH_STENCIL_OES */
+ { 9070, 0x0000886F }, /* GL_DEPTH_STENCIL_TO_BGRA_NV */
+ { 9098, 0x0000886E }, /* GL_DEPTH_STENCIL_TO_RGBA_NV */
+ { 9126, 0x00000B71 }, /* GL_DEPTH_TEST */
+ { 9140, 0x0000884B }, /* GL_DEPTH_TEXTURE_MODE */
+ { 9162, 0x0000884B }, /* GL_DEPTH_TEXTURE_MODE_ARB */
+ { 9188, 0x00000B72 }, /* GL_DEPTH_WRITEMASK */
+ { 9207, 0x00001201 }, /* GL_DIFFUSE */
+ { 9218, 0x00000BD0 }, /* GL_DITHER */
+ { 9228, 0x00000A02 }, /* GL_DOMAIN */
+ { 9238, 0x00001100 }, /* GL_DONT_CARE */
+ { 9251, 0x000086AE }, /* GL_DOT3_RGB */
+ { 9263, 0x000086AF }, /* GL_DOT3_RGBA */
+ { 9276, 0x000086AF }, /* GL_DOT3_RGBA_ARB */
+ { 9293, 0x00008741 }, /* GL_DOT3_RGBA_EXT */
+ { 9310, 0x000086AE }, /* GL_DOT3_RGB_ARB */
+ { 9326, 0x00008740 }, /* GL_DOT3_RGB_EXT */
+ { 9342, 0x0000140A }, /* GL_DOUBLE */
+ { 9352, 0x00000C32 }, /* GL_DOUBLEBUFFER */
+ { 9368, 0x00000C01 }, /* GL_DRAW_BUFFER */
+ { 9383, 0x00008825 }, /* GL_DRAW_BUFFER0 */
+ { 9399, 0x00008825 }, /* GL_DRAW_BUFFER0_ARB */
+ { 9419, 0x00008825 }, /* GL_DRAW_BUFFER0_ATI */
+ { 9439, 0x00008826 }, /* GL_DRAW_BUFFER1 */
+ { 9455, 0x0000882F }, /* GL_DRAW_BUFFER10 */
+ { 9472, 0x0000882F }, /* GL_DRAW_BUFFER10_ARB */
+ { 9493, 0x0000882F }, /* GL_DRAW_BUFFER10_ATI */
+ { 9514, 0x00008830 }, /* GL_DRAW_BUFFER11 */
+ { 9531, 0x00008830 }, /* GL_DRAW_BUFFER11_ARB */
+ { 9552, 0x00008830 }, /* GL_DRAW_BUFFER11_ATI */
+ { 9573, 0x00008831 }, /* GL_DRAW_BUFFER12 */
+ { 9590, 0x00008831 }, /* GL_DRAW_BUFFER12_ARB */
+ { 9611, 0x00008831 }, /* GL_DRAW_BUFFER12_ATI */
+ { 9632, 0x00008832 }, /* GL_DRAW_BUFFER13 */
+ { 9649, 0x00008832 }, /* GL_DRAW_BUFFER13_ARB */
+ { 9670, 0x00008832 }, /* GL_DRAW_BUFFER13_ATI */
+ { 9691, 0x00008833 }, /* GL_DRAW_BUFFER14 */
+ { 9708, 0x00008833 }, /* GL_DRAW_BUFFER14_ARB */
+ { 9729, 0x00008833 }, /* GL_DRAW_BUFFER14_ATI */
+ { 9750, 0x00008834 }, /* GL_DRAW_BUFFER15 */
+ { 9767, 0x00008834 }, /* GL_DRAW_BUFFER15_ARB */
+ { 9788, 0x00008834 }, /* GL_DRAW_BUFFER15_ATI */
+ { 9809, 0x00008826 }, /* GL_DRAW_BUFFER1_ARB */
+ { 9829, 0x00008826 }, /* GL_DRAW_BUFFER1_ATI */
+ { 9849, 0x00008827 }, /* GL_DRAW_BUFFER2 */
+ { 9865, 0x00008827 }, /* GL_DRAW_BUFFER2_ARB */
+ { 9885, 0x00008827 }, /* GL_DRAW_BUFFER2_ATI */
+ { 9905, 0x00008828 }, /* GL_DRAW_BUFFER3 */
+ { 9921, 0x00008828 }, /* GL_DRAW_BUFFER3_ARB */
+ { 9941, 0x00008828 }, /* GL_DRAW_BUFFER3_ATI */
+ { 9961, 0x00008829 }, /* GL_DRAW_BUFFER4 */
+ { 9977, 0x00008829 }, /* GL_DRAW_BUFFER4_ARB */
+ { 9997, 0x00008829 }, /* GL_DRAW_BUFFER4_ATI */
+ { 10017, 0x0000882A }, /* GL_DRAW_BUFFER5 */
+ { 10033, 0x0000882A }, /* GL_DRAW_BUFFER5_ARB */
+ { 10053, 0x0000882A }, /* GL_DRAW_BUFFER5_ATI */
+ { 10073, 0x0000882B }, /* GL_DRAW_BUFFER6 */
+ { 10089, 0x0000882B }, /* GL_DRAW_BUFFER6_ARB */
+ { 10109, 0x0000882B }, /* GL_DRAW_BUFFER6_ATI */
+ { 10129, 0x0000882C }, /* GL_DRAW_BUFFER7 */
+ { 10145, 0x0000882C }, /* GL_DRAW_BUFFER7_ARB */
+ { 10165, 0x0000882C }, /* GL_DRAW_BUFFER7_ATI */
+ { 10185, 0x0000882D }, /* GL_DRAW_BUFFER8 */
+ { 10201, 0x0000882D }, /* GL_DRAW_BUFFER8_ARB */
+ { 10221, 0x0000882D }, /* GL_DRAW_BUFFER8_ATI */
+ { 10241, 0x0000882E }, /* GL_DRAW_BUFFER9 */
+ { 10257, 0x0000882E }, /* GL_DRAW_BUFFER9_ARB */
+ { 10277, 0x0000882E }, /* GL_DRAW_BUFFER9_ATI */
+ { 10297, 0x00008CA9 }, /* GL_DRAW_FRAMEBUFFER */
+ { 10317, 0x00008CA6 }, /* GL_DRAW_FRAMEBUFFER_BINDING */
+ { 10345, 0x00008CA6 }, /* GL_DRAW_FRAMEBUFFER_BINDING_EXT */
+ { 10377, 0x00008CA9 }, /* GL_DRAW_FRAMEBUFFER_EXT */
+ { 10401, 0x00000705 }, /* GL_DRAW_PIXEL_TOKEN */
+ { 10421, 0x00000304 }, /* GL_DST_ALPHA */
+ { 10434, 0x00000306 }, /* GL_DST_COLOR */
+ { 10447, 0x0000877A }, /* GL_DU8DV8_ATI */
+ { 10461, 0x00008779 }, /* GL_DUDV_ATI */
+ { 10473, 0x000088EA }, /* GL_DYNAMIC_COPY */
+ { 10489, 0x000088EA }, /* GL_DYNAMIC_COPY_ARB */
+ { 10509, 0x000088E8 }, /* GL_DYNAMIC_DRAW */
+ { 10525, 0x000088E8 }, /* GL_DYNAMIC_DRAW_ARB */
+ { 10545, 0x000088E9 }, /* GL_DYNAMIC_READ */
+ { 10561, 0x000088E9 }, /* GL_DYNAMIC_READ_ARB */
+ { 10581, 0x00000B43 }, /* GL_EDGE_FLAG */
+ { 10594, 0x00008079 }, /* GL_EDGE_FLAG_ARRAY */
+ { 10613, 0x0000889B }, /* GL_EDGE_FLAG_ARRAY_BUFFER_BINDING */
+ { 10647, 0x0000889B }, /* GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB */
+ { 10685, 0x00008093 }, /* GL_EDGE_FLAG_ARRAY_POINTER */
+ { 10712, 0x0000808C }, /* GL_EDGE_FLAG_ARRAY_STRIDE */
+ { 10738, 0x00008893 }, /* GL_ELEMENT_ARRAY_BUFFER */
+ { 10762, 0x00008895 }, /* GL_ELEMENT_ARRAY_BUFFER_BINDING */
+ { 10794, 0x00008895 }, /* GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB */
+ { 10830, 0x00001600 }, /* GL_EMISSION */
+ { 10842, 0x00002000 }, /* GL_ENABLE_BIT */
+ { 10856, 0x00000202 }, /* GL_EQUAL */
+ { 10865, 0x00001509 }, /* GL_EQUIV */
+ { 10874, 0x00010000 }, /* GL_EVAL_BIT */
+ { 10886, 0x00000800 }, /* GL_EXP */
+ { 10893, 0x00000801 }, /* GL_EXP2 */
+ { 10901, 0x00001F03 }, /* GL_EXTENSIONS */
+ { 10915, 0x00002400 }, /* GL_EYE_LINEAR */
+ { 10929, 0x00002502 }, /* GL_EYE_PLANE */
+ { 10942, 0x0000855C }, /* GL_EYE_PLANE_ABSOLUTE_NV */
+ { 10967, 0x0000855B }, /* GL_EYE_RADIAL_NV */
+ { 10984, 0x00000000 }, /* GL_FALSE */
+ { 10993, 0x00001101 }, /* GL_FASTEST */
+ { 11004, 0x00001C01 }, /* GL_FEEDBACK */
+ { 11016, 0x00000DF0 }, /* GL_FEEDBACK_BUFFER_POINTER */
+ { 11043, 0x00000DF1 }, /* GL_FEEDBACK_BUFFER_SIZE */
+ { 11067, 0x00000DF2 }, /* GL_FEEDBACK_BUFFER_TYPE */
+ { 11091, 0x00001B02 }, /* GL_FILL */
+ { 11099, 0x00008E4D }, /* GL_FIRST_VERTEX_CONVENTION */
+ { 11126, 0x00008E4D }, /* GL_FIRST_VERTEX_CONVENTION_EXT */
+ { 11157, 0x0000140C }, /* GL_FIXED */
+ { 11166, 0x0000140C }, /* GL_FIXED_OES */
+ { 11179, 0x0000891D }, /* GL_FIXED_ONLY */
+ { 11193, 0x0000891D }, /* GL_FIXED_ONLY_ARB */
+ { 11211, 0x00001D00 }, /* GL_FLAT */
+ { 11219, 0x00001406 }, /* GL_FLOAT */
+ { 11228, 0x00008B5A }, /* GL_FLOAT_MAT2 */
+ { 11242, 0x00008B5A }, /* GL_FLOAT_MAT2_ARB */
+ { 11260, 0x00008B65 }, /* GL_FLOAT_MAT2x3 */
+ { 11276, 0x00008B66 }, /* GL_FLOAT_MAT2x4 */
+ { 11292, 0x00008B5B }, /* GL_FLOAT_MAT3 */
+ { 11306, 0x00008B5B }, /* GL_FLOAT_MAT3_ARB */
+ { 11324, 0x00008B67 }, /* GL_FLOAT_MAT3x2 */
+ { 11340, 0x00008B68 }, /* GL_FLOAT_MAT3x4 */
+ { 11356, 0x00008B5C }, /* GL_FLOAT_MAT4 */
+ { 11370, 0x00008B5C }, /* GL_FLOAT_MAT4_ARB */
+ { 11388, 0x00008B69 }, /* GL_FLOAT_MAT4x2 */
+ { 11404, 0x00008B6A }, /* GL_FLOAT_MAT4x3 */
+ { 11420, 0x00008B50 }, /* GL_FLOAT_VEC2 */
+ { 11434, 0x00008B50 }, /* GL_FLOAT_VEC2_ARB */
+ { 11452, 0x00008B51 }, /* GL_FLOAT_VEC3 */
+ { 11466, 0x00008B51 }, /* GL_FLOAT_VEC3_ARB */
+ { 11484, 0x00008B52 }, /* GL_FLOAT_VEC4 */
+ { 11498, 0x00008B52 }, /* GL_FLOAT_VEC4_ARB */
+ { 11516, 0x00000B60 }, /* GL_FOG */
+ { 11523, 0x00000080 }, /* GL_FOG_BIT */
+ { 11534, 0x00000B66 }, /* GL_FOG_COLOR */
+ { 11547, 0x00008451 }, /* GL_FOG_COORD */
+ { 11560, 0x00008451 }, /* GL_FOG_COORDINATE */
+ { 11578, 0x00008457 }, /* GL_FOG_COORDINATE_ARRAY */
+ { 11602, 0x0000889D }, /* GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING */
+ { 11641, 0x0000889D }, /* GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB */
+ { 11684, 0x00008456 }, /* GL_FOG_COORDINATE_ARRAY_POINTER */
+ { 11716, 0x00008455 }, /* GL_FOG_COORDINATE_ARRAY_STRIDE */
+ { 11747, 0x00008454 }, /* GL_FOG_COORDINATE_ARRAY_TYPE */
+ { 11776, 0x00008450 }, /* GL_FOG_COORDINATE_SOURCE */
+ { 11801, 0x00008457 }, /* GL_FOG_COORD_ARRAY */
+ { 11820, 0x0000889D }, /* GL_FOG_COORD_ARRAY_BUFFER_BINDING */
+ { 11854, 0x00008456 }, /* GL_FOG_COORD_ARRAY_POINTER */
+ { 11881, 0x00008455 }, /* GL_FOG_COORD_ARRAY_STRIDE */
+ { 11907, 0x00008454 }, /* GL_FOG_COORD_ARRAY_TYPE */
+ { 11931, 0x00008450 }, /* GL_FOG_COORD_SRC */
+ { 11948, 0x00000B62 }, /* GL_FOG_DENSITY */
+ { 11963, 0x0000855A }, /* GL_FOG_DISTANCE_MODE_NV */
+ { 11987, 0x00000B64 }, /* GL_FOG_END */
+ { 11998, 0x00000C54 }, /* GL_FOG_HINT */
+ { 12010, 0x00000B61 }, /* GL_FOG_INDEX */
+ { 12023, 0x00000B65 }, /* GL_FOG_MODE */
+ { 12035, 0x00008198 }, /* GL_FOG_OFFSET_SGIX */
+ { 12054, 0x00008199 }, /* GL_FOG_OFFSET_VALUE_SGIX */
+ { 12079, 0x00000B63 }, /* GL_FOG_START */
+ { 12092, 0x00008452 }, /* GL_FRAGMENT_DEPTH */
+ { 12110, 0x00008804 }, /* GL_FRAGMENT_PROGRAM_ARB */
+ { 12134, 0x00008B30 }, /* GL_FRAGMENT_SHADER */
+ { 12153, 0x00008B30 }, /* GL_FRAGMENT_SHADER_ARB */
+ { 12176, 0x00008B8B }, /* GL_FRAGMENT_SHADER_DERIVATIVE_HINT */
+ { 12211, 0x00008B8B }, /* GL_FRAGMENT_SHADER_DERIVATIVE_HINT_OES */
+ { 12250, 0x00008D40 }, /* GL_FRAMEBUFFER */
+ { 12265, 0x00008215 }, /* GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE */
+ { 12302, 0x00008214 }, /* GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE */
+ { 12338, 0x00008210 }, /* GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING */
+ { 12379, 0x00008211 }, /* GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE */
+ { 12420, 0x00008216 }, /* GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE */
+ { 12457, 0x00008213 }, /* GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE */
+ { 12494, 0x00008DA7 }, /* GL_FRAMEBUFFER_ATTACHMENT_LAYERED */
+ { 12528, 0x00008DA7 }, /* GL_FRAMEBUFFER_ATTACHMENT_LAYERED_ARB */
+ { 12566, 0x00008CD1 }, /* GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME */
+ { 12604, 0x00008CD1 }, /* GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT */
+ { 12646, 0x00008CD1 }, /* GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_OES */
+ { 12688, 0x00008CD0 }, /* GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE */
+ { 12726, 0x00008CD0 }, /* GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT */
+ { 12768, 0x00008CD0 }, /* GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_OES */
+ { 12810, 0x00008212 }, /* GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE */
+ { 12845, 0x00008217 }, /* GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE */
+ { 12884, 0x00008CD4 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT */
+ { 12933, 0x00008CD4 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_OES */
+ { 12982, 0x00008CD3 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE */
+ { 13030, 0x00008CD3 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_EXT */
+ { 13082, 0x00008CD3 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_OES */
+ { 13134, 0x00008CD4 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER */
+ { 13174, 0x00008CD4 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT */
+ { 13218, 0x00008CD2 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL */
+ { 13258, 0x00008CD2 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT */
+ { 13302, 0x00008CD2 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_OES */
+ { 13346, 0x00008CA6 }, /* GL_FRAMEBUFFER_BINDING */
+ { 13369, 0x00008CA6 }, /* GL_FRAMEBUFFER_BINDING_EXT */
+ { 13396, 0x00008CA6 }, /* GL_FRAMEBUFFER_BINDING_OES */
+ { 13423, 0x00008CD5 }, /* GL_FRAMEBUFFER_COMPLETE */
+ { 13447, 0x00008CD5 }, /* GL_FRAMEBUFFER_COMPLETE_EXT */
+ { 13475, 0x00008CD5 }, /* GL_FRAMEBUFFER_COMPLETE_OES */
+ { 13503, 0x00008218 }, /* GL_FRAMEBUFFER_DEFAULT */
+ { 13526, 0x00008D40 }, /* GL_FRAMEBUFFER_EXT */
+ { 13545, 0x00008CD6 }, /* GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT */
+ { 13582, 0x00008CD6 }, /* GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT */
+ { 13623, 0x00008CD6 }, /* GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_OES */
+ { 13664, 0x00008CD9 }, /* GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS */
+ { 13701, 0x00008CD9 }, /* GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT */
+ { 13742, 0x00008CD9 }, /* GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_OES */
+ { 13783, 0x00008CDB }, /* GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER */
+ { 13821, 0x00008CDB }, /* GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT */
+ { 13863, 0x00008CDB }, /* GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_OES */
+ { 13905, 0x00008CD8 }, /* GL_FRAMEBUFFER_INCOMPLETE_DUPLICATE_ATTACHMENT_EXT */
+ { 13956, 0x00008CDA }, /* GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT */
+ { 13994, 0x00008CDA }, /* GL_FRAMEBUFFER_INCOMPLETE_FORMATS_OES */
+ { 14032, 0x00008DA9 }, /* GL_FRAMEBUFFER_INCOMPLETE_LAYER_COUNT_ARB */
+ { 14074, 0x00008DA8 }, /* GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS */
+ { 14114, 0x00008DA8 }, /* GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_ARB */
+ { 14158, 0x00008CD7 }, /* GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT */
+ { 14203, 0x00008CD7 }, /* GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT */
+ { 14252, 0x00008CD7 }, /* GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_OES */
+ { 14301, 0x00008D56 }, /* GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE */
+ { 14339, 0x00008D56 }, /* GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_EXT */
+ { 14381, 0x00008CDC }, /* GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER */
+ { 14419, 0x00008CDC }, /* GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT */
+ { 14461, 0x00008CDC }, /* GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_OES */
+ { 14503, 0x00008D40 }, /* GL_FRAMEBUFFER_OES */
+ { 14522, 0x00008CDE }, /* GL_FRAMEBUFFER_STATUS_ERROR_EXT */
+ { 14554, 0x00008219 }, /* GL_FRAMEBUFFER_UNDEFINED */
+ { 14579, 0x00008CDD }, /* GL_FRAMEBUFFER_UNSUPPORTED */
+ { 14606, 0x00008CDD }, /* GL_FRAMEBUFFER_UNSUPPORTED_EXT */
+ { 14637, 0x00008CDD }, /* GL_FRAMEBUFFER_UNSUPPORTED_OES */
+ { 14668, 0x00000404 }, /* GL_FRONT */
+ { 14677, 0x00000408 }, /* GL_FRONT_AND_BACK */
+ { 14695, 0x00000B46 }, /* GL_FRONT_FACE */
+ { 14709, 0x00000400 }, /* GL_FRONT_LEFT */
+ { 14723, 0x00000401 }, /* GL_FRONT_RIGHT */
+ { 14738, 0x00008006 }, /* GL_FUNC_ADD */
+ { 14750, 0x00008006 }, /* GL_FUNC_ADD_EXT */
+ { 14766, 0x00008006 }, /* GL_FUNC_ADD_OES */
+ { 14782, 0x0000800B }, /* GL_FUNC_REVERSE_SUBTRACT */
+ { 14807, 0x0000800B }, /* GL_FUNC_REVERSE_SUBTRACT_EXT */
+ { 14836, 0x0000800B }, /* GL_FUNC_REVERSE_SUBTRACT_OES */
+ { 14865, 0x0000800A }, /* GL_FUNC_SUBTRACT */
+ { 14882, 0x0000800A }, /* GL_FUNC_SUBTRACT_EXT */
+ { 14903, 0x0000800A }, /* GL_FUNC_SUBTRACT_OES */
+ { 14924, 0x00008191 }, /* GL_GENERATE_MIPMAP */
+ { 14943, 0x00008192 }, /* GL_GENERATE_MIPMAP_HINT */
+ { 14967, 0x00008192 }, /* GL_GENERATE_MIPMAP_HINT_SGIS */
+ { 14996, 0x00008191 }, /* GL_GENERATE_MIPMAP_SGIS */
+ { 15020, 0x00008917 }, /* GL_GEOMETRY_INPUT_TYPE */
+ { 15043, 0x00008DDB }, /* GL_GEOMETRY_INPUT_TYPE_ARB */
+ { 15070, 0x00008918 }, /* GL_GEOMETRY_OUTPUT_TYPE */
+ { 15094, 0x00008DDC }, /* GL_GEOMETRY_OUTPUT_TYPE_ARB */
+ { 15122, 0x00008DD9 }, /* GL_GEOMETRY_SHADER */
+ { 15141, 0x00008DD9 }, /* GL_GEOMETRY_SHADER_ARB */
+ { 15164, 0x00008916 }, /* GL_GEOMETRY_VERTICES_OUT */
+ { 15189, 0x00008DDA }, /* GL_GEOMETRY_VERTICES_OUT_ARB */
+ { 15218, 0x00000206 }, /* GL_GEQUAL */
+ { 15228, 0x00000204 }, /* GL_GREATER */
+ { 15239, 0x00001904 }, /* GL_GREEN */
+ { 15248, 0x00000D19 }, /* GL_GREEN_BIAS */
+ { 15262, 0x00000D53 }, /* GL_GREEN_BITS */
+ { 15276, 0x00008D95 }, /* GL_GREEN_INTEGER */
+ { 15293, 0x00008D95 }, /* GL_GREEN_INTEGER_EXT */
+ { 15314, 0x00000D18 }, /* GL_GREEN_SCALE */
+ { 15329, 0x00008253 }, /* GL_GUILTY_CONTEXT_RESET_ARB */
+ { 15357, 0x0000140B }, /* GL_HALF_FLOAT */
+ { 15371, 0x00008D61 }, /* GL_HALF_FLOAT_OES */
+ { 15389, 0x00008DF2 }, /* GL_HIGH_FLOAT */
+ { 15403, 0x00008DF5 }, /* GL_HIGH_INT */
+ { 15415, 0x00008000 }, /* GL_HINT_BIT */
+ { 15427, 0x00008024 }, /* GL_HISTOGRAM */
+ { 15440, 0x0000802B }, /* GL_HISTOGRAM_ALPHA_SIZE */
+ { 15464, 0x0000802B }, /* GL_HISTOGRAM_ALPHA_SIZE_EXT */
+ { 15492, 0x0000802A }, /* GL_HISTOGRAM_BLUE_SIZE */
+ { 15515, 0x0000802A }, /* GL_HISTOGRAM_BLUE_SIZE_EXT */
+ { 15542, 0x00008024 }, /* GL_HISTOGRAM_EXT */
+ { 15559, 0x00008027 }, /* GL_HISTOGRAM_FORMAT */
+ { 15579, 0x00008027 }, /* GL_HISTOGRAM_FORMAT_EXT */
+ { 15603, 0x00008029 }, /* GL_HISTOGRAM_GREEN_SIZE */
+ { 15627, 0x00008029 }, /* GL_HISTOGRAM_GREEN_SIZE_EXT */
+ { 15655, 0x0000802C }, /* GL_HISTOGRAM_LUMINANCE_SIZE */
+ { 15683, 0x0000802C }, /* GL_HISTOGRAM_LUMINANCE_SIZE_EXT */
+ { 15715, 0x00008028 }, /* GL_HISTOGRAM_RED_SIZE */
+ { 15737, 0x00008028 }, /* GL_HISTOGRAM_RED_SIZE_EXT */
+ { 15763, 0x0000802D }, /* GL_HISTOGRAM_SINK */
+ { 15781, 0x0000802D }, /* GL_HISTOGRAM_SINK_EXT */
+ { 15803, 0x00008026 }, /* GL_HISTOGRAM_WIDTH */
+ { 15822, 0x00008026 }, /* GL_HISTOGRAM_WIDTH_EXT */
+ { 15845, 0x0000862A }, /* GL_IDENTITY_NV */
+ { 15860, 0x00008150 }, /* GL_IGNORE_BORDER_HP */
+ { 15880, 0x00008B9B }, /* GL_IMPLEMENTATION_COLOR_READ_FORMAT */
+ { 15916, 0x00008B9B }, /* GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES */
+ { 15956, 0x00008B9A }, /* GL_IMPLEMENTATION_COLOR_READ_TYPE */
+ { 15990, 0x00008B9A }, /* GL_IMPLEMENTATION_COLOR_READ_TYPE_OES */
+ { 16028, 0x00001E02 }, /* GL_INCR */
+ { 16036, 0x00008507 }, /* GL_INCR_WRAP */
+ { 16049, 0x00008507 }, /* GL_INCR_WRAP_EXT */
+ { 16066, 0x00008222 }, /* GL_INDEX */
+ { 16075, 0x00008077 }, /* GL_INDEX_ARRAY */
+ { 16090, 0x00008899 }, /* GL_INDEX_ARRAY_BUFFER_BINDING */
+ { 16120, 0x00008899 }, /* GL_INDEX_ARRAY_BUFFER_BINDING_ARB */
+ { 16154, 0x00008091 }, /* GL_INDEX_ARRAY_POINTER */
+ { 16177, 0x00008086 }, /* GL_INDEX_ARRAY_STRIDE */
+ { 16199, 0x00008085 }, /* GL_INDEX_ARRAY_TYPE */
+ { 16219, 0x00000D51 }, /* GL_INDEX_BITS */
+ { 16233, 0x00000C20 }, /* GL_INDEX_CLEAR_VALUE */
+ { 16254, 0x00000BF1 }, /* GL_INDEX_LOGIC_OP */
+ { 16272, 0x00000C30 }, /* GL_INDEX_MODE */
+ { 16286, 0x00000D13 }, /* GL_INDEX_OFFSET */
+ { 16302, 0x00000D12 }, /* GL_INDEX_SHIFT */
+ { 16317, 0x00000C21 }, /* GL_INDEX_WRITEMASK */
+ { 16336, 0x00008B84 }, /* GL_INFO_LOG_LENGTH */
+ { 16355, 0x00008254 }, /* GL_INNOCENT_CONTEXT_RESET_ARB */
+ { 16385, 0x00001404 }, /* GL_INT */
+ { 16392, 0x00008049 }, /* GL_INTENSITY */
+ { 16405, 0x0000804C }, /* GL_INTENSITY12 */
+ { 16420, 0x0000804C }, /* GL_INTENSITY12_EXT */
+ { 16439, 0x0000804D }, /* GL_INTENSITY16 */
+ { 16454, 0x00008D8B }, /* GL_INTENSITY16I_EXT */
+ { 16474, 0x00008D79 }, /* GL_INTENSITY16UI_EXT */
+ { 16495, 0x0000804D }, /* GL_INTENSITY16_EXT */
+ { 16514, 0x00008D85 }, /* GL_INTENSITY32I_EXT */
+ { 16534, 0x00008D73 }, /* GL_INTENSITY32UI_EXT */
+ { 16555, 0x0000804A }, /* GL_INTENSITY4 */
+ { 16569, 0x0000804A }, /* GL_INTENSITY4_EXT */
+ { 16587, 0x0000804B }, /* GL_INTENSITY8 */
+ { 16601, 0x00008D91 }, /* GL_INTENSITY8I_EXT */
+ { 16620, 0x00008D7F }, /* GL_INTENSITY8UI_EXT */
+ { 16640, 0x0000804B }, /* GL_INTENSITY8_EXT */
+ { 16658, 0x00008049 }, /* GL_INTENSITY_EXT */
+ { 16675, 0x00008C8C }, /* GL_INTERLEAVED_ATTRIBS */
+ { 16698, 0x00008C8C }, /* GL_INTERLEAVED_ATTRIBS_EXT */
+ { 16725, 0x00008575 }, /* GL_INTERPOLATE */
+ { 16740, 0x00008575 }, /* GL_INTERPOLATE_ARB */
+ { 16759, 0x00008575 }, /* GL_INTERPOLATE_EXT */
+ { 16778, 0x00008DF7 }, /* GL_INT_10_10_10_2_OES */
+ { 16800, 0x00008DC9 }, /* GL_INT_SAMPLER_1D */
+ { 16818, 0x00008DCE }, /* GL_INT_SAMPLER_1D_ARRAY */
+ { 16842, 0x00008DCE }, /* GL_INT_SAMPLER_1D_ARRAY_EXT */
+ { 16870, 0x00008DC9 }, /* GL_INT_SAMPLER_1D_EXT */
+ { 16892, 0x00008DCA }, /* GL_INT_SAMPLER_2D */
+ { 16910, 0x00008DCF }, /* GL_INT_SAMPLER_2D_ARRAY */
+ { 16934, 0x00008DCF }, /* GL_INT_SAMPLER_2D_ARRAY_EXT */
+ { 16962, 0x00008DCA }, /* GL_INT_SAMPLER_2D_EXT */
+ { 16984, 0x00008DCD }, /* GL_INT_SAMPLER_2D_RECT */
+ { 17007, 0x00008DCD }, /* GL_INT_SAMPLER_2D_RECT_EXT */
+ { 17034, 0x00008DCB }, /* GL_INT_SAMPLER_3D */
+ { 17052, 0x00008DCB }, /* GL_INT_SAMPLER_3D_EXT */
+ { 17074, 0x00008DD0 }, /* GL_INT_SAMPLER_BUFFER */
+ { 17096, 0x00008DD0 }, /* GL_INT_SAMPLER_BUFFER_EXT */
+ { 17122, 0x00008DCC }, /* GL_INT_SAMPLER_CUBE */
+ { 17142, 0x00008DCC }, /* GL_INT_SAMPLER_CUBE_EXT */
+ { 17166, 0x00008B53 }, /* GL_INT_VEC2 */
+ { 17178, 0x00008B53 }, /* GL_INT_VEC2_ARB */
+ { 17194, 0x00008B54 }, /* GL_INT_VEC3 */
+ { 17206, 0x00008B54 }, /* GL_INT_VEC3_ARB */
+ { 17222, 0x00008B55 }, /* GL_INT_VEC4 */
+ { 17234, 0x00008B55 }, /* GL_INT_VEC4_ARB */
+ { 17250, 0x00000500 }, /* GL_INVALID_ENUM */
+ { 17266, 0x00000506 }, /* GL_INVALID_FRAMEBUFFER_OPERATION */
+ { 17299, 0x00000506 }, /* GL_INVALID_FRAMEBUFFER_OPERATION_EXT */
+ { 17336, 0x00000506 }, /* GL_INVALID_FRAMEBUFFER_OPERATION_OES */
+ { 17373, 0x00000502 }, /* GL_INVALID_OPERATION */
+ { 17394, 0x00000501 }, /* GL_INVALID_VALUE */
+ { 17411, 0x0000862B }, /* GL_INVERSE_NV */
+ { 17425, 0x0000862D }, /* GL_INVERSE_TRANSPOSE_NV */
+ { 17449, 0x0000150A }, /* GL_INVERT */
+ { 17459, 0x00001E00 }, /* GL_KEEP */
+ { 17467, 0x00008E4E }, /* GL_LAST_VERTEX_CONVENTION */
+ { 17493, 0x00008E4E }, /* GL_LAST_VERTEX_CONVENTION_EXT */
+ { 17523, 0x00000406 }, /* GL_LEFT */
+ { 17531, 0x00000203 }, /* GL_LEQUAL */
+ { 17541, 0x00000201 }, /* GL_LESS */
+ { 17549, 0x00004000 }, /* GL_LIGHT0 */
+ { 17559, 0x00004001 }, /* GL_LIGHT1 */
+ { 17569, 0x00004002 }, /* GL_LIGHT2 */
+ { 17579, 0x00004003 }, /* GL_LIGHT3 */
+ { 17589, 0x00004004 }, /* GL_LIGHT4 */
+ { 17599, 0x00004005 }, /* GL_LIGHT5 */
+ { 17609, 0x00004006 }, /* GL_LIGHT6 */
+ { 17619, 0x00004007 }, /* GL_LIGHT7 */
+ { 17629, 0x00000B50 }, /* GL_LIGHTING */
+ { 17641, 0x00000040 }, /* GL_LIGHTING_BIT */
+ { 17657, 0x00000B53 }, /* GL_LIGHT_MODEL_AMBIENT */
+ { 17680, 0x000081F8 }, /* GL_LIGHT_MODEL_COLOR_CONTROL */
+ { 17709, 0x000081F8 }, /* GL_LIGHT_MODEL_COLOR_CONTROL_EXT */
+ { 17742, 0x00000B51 }, /* GL_LIGHT_MODEL_LOCAL_VIEWER */
+ { 17770, 0x00000B52 }, /* GL_LIGHT_MODEL_TWO_SIDE */
+ { 17794, 0x00001B01 }, /* GL_LINE */
+ { 17802, 0x00002601 }, /* GL_LINEAR */
+ { 17812, 0x00001208 }, /* GL_LINEAR_ATTENUATION */
+ { 17834, 0x00008170 }, /* GL_LINEAR_CLIPMAP_LINEAR_SGIX */
+ { 17864, 0x0000844F }, /* GL_LINEAR_CLIPMAP_NEAREST_SGIX */
+ { 17895, 0x00002703 }, /* GL_LINEAR_MIPMAP_LINEAR */
+ { 17919, 0x00002701 }, /* GL_LINEAR_MIPMAP_NEAREST */
+ { 17944, 0x00000001 }, /* GL_LINES */
+ { 17953, 0x0000000A }, /* GL_LINES_ADJACENCY */
+ { 17972, 0x0000000A }, /* GL_LINES_ADJACENCY_ARB */
+ { 17995, 0x00000004 }, /* GL_LINE_BIT */
+ { 18007, 0x00000002 }, /* GL_LINE_LOOP */
+ { 18020, 0x00000707 }, /* GL_LINE_RESET_TOKEN */
+ { 18040, 0x00000B20 }, /* GL_LINE_SMOOTH */
+ { 18055, 0x00000C52 }, /* GL_LINE_SMOOTH_HINT */
+ { 18075, 0x00000B24 }, /* GL_LINE_STIPPLE */
+ { 18091, 0x00000B25 }, /* GL_LINE_STIPPLE_PATTERN */
+ { 18115, 0x00000B26 }, /* GL_LINE_STIPPLE_REPEAT */
+ { 18138, 0x00000003 }, /* GL_LINE_STRIP */
+ { 18152, 0x0000000B }, /* GL_LINE_STRIP_ADJACENCY */
+ { 18176, 0x0000000B }, /* GL_LINE_STRIP_ADJACENCY_ARB */
+ { 18204, 0x00000702 }, /* GL_LINE_TOKEN */
+ { 18218, 0x00000B21 }, /* GL_LINE_WIDTH */
+ { 18232, 0x00000B23 }, /* GL_LINE_WIDTH_GRANULARITY */
+ { 18258, 0x00000B22 }, /* GL_LINE_WIDTH_RANGE */
+ { 18278, 0x00008B82 }, /* GL_LINK_STATUS */
+ { 18293, 0x00000B32 }, /* GL_LIST_BASE */
+ { 18306, 0x00020000 }, /* GL_LIST_BIT */
+ { 18318, 0x00000B33 }, /* GL_LIST_INDEX */
+ { 18332, 0x00000B30 }, /* GL_LIST_MODE */
+ { 18345, 0x00000101 }, /* GL_LOAD */
+ { 18353, 0x00000BF1 }, /* GL_LOGIC_OP */
+ { 18365, 0x00000BF0 }, /* GL_LOGIC_OP_MODE */
+ { 18382, 0x00008252 }, /* GL_LOSE_CONTEXT_ON_RESET_ARB */
+ { 18411, 0x00008CA1 }, /* GL_LOWER_LEFT */
+ { 18425, 0x00008DF0 }, /* GL_LOW_FLOAT */
+ { 18438, 0x00008DF3 }, /* GL_LOW_INT */
+ { 18449, 0x00001909 }, /* GL_LUMINANCE */
+ { 18462, 0x00008041 }, /* GL_LUMINANCE12 */
+ { 18477, 0x00008047 }, /* GL_LUMINANCE12_ALPHA12 */
+ { 18500, 0x00008047 }, /* GL_LUMINANCE12_ALPHA12_EXT */
+ { 18527, 0x00008046 }, /* GL_LUMINANCE12_ALPHA4 */
+ { 18549, 0x00008046 }, /* GL_LUMINANCE12_ALPHA4_EXT */
+ { 18575, 0x00008041 }, /* GL_LUMINANCE12_EXT */
+ { 18594, 0x00008042 }, /* GL_LUMINANCE16 */
+ { 18609, 0x00008D8C }, /* GL_LUMINANCE16I_EXT */
+ { 18629, 0x00008D7A }, /* GL_LUMINANCE16UI_EXT */
+ { 18650, 0x00008048 }, /* GL_LUMINANCE16_ALPHA16 */
+ { 18673, 0x00008048 }, /* GL_LUMINANCE16_ALPHA16_EXT */
+ { 18700, 0x00008042 }, /* GL_LUMINANCE16_EXT */
+ { 18719, 0x00008D86 }, /* GL_LUMINANCE32I_EXT */
+ { 18739, 0x00008D74 }, /* GL_LUMINANCE32UI_EXT */
+ { 18760, 0x0000803F }, /* GL_LUMINANCE4 */
+ { 18774, 0x00008043 }, /* GL_LUMINANCE4_ALPHA4 */
+ { 18795, 0x00008043 }, /* GL_LUMINANCE4_ALPHA4_EXT */
+ { 18820, 0x0000803F }, /* GL_LUMINANCE4_EXT */
+ { 18838, 0x00008044 }, /* GL_LUMINANCE6_ALPHA2 */
+ { 18859, 0x00008044 }, /* GL_LUMINANCE6_ALPHA2_EXT */
+ { 18884, 0x00008040 }, /* GL_LUMINANCE8 */
+ { 18898, 0x00008D92 }, /* GL_LUMINANCE8I_EXT */
+ { 18917, 0x00008D80 }, /* GL_LUMINANCE8UI_EXT */
+ { 18937, 0x00008045 }, /* GL_LUMINANCE8_ALPHA8 */
+ { 18958, 0x00008045 }, /* GL_LUMINANCE8_ALPHA8_EXT */
+ { 18983, 0x00008040 }, /* GL_LUMINANCE8_EXT */
+ { 19001, 0x0000190A }, /* GL_LUMINANCE_ALPHA */
+ { 19020, 0x00008D8D }, /* GL_LUMINANCE_ALPHA16I_EXT */
+ { 19046, 0x00008D7B }, /* GL_LUMINANCE_ALPHA16UI_EXT */
+ { 19073, 0x00008D87 }, /* GL_LUMINANCE_ALPHA32I_EXT */
+ { 19099, 0x00008D75 }, /* GL_LUMINANCE_ALPHA32UI_EXT */
+ { 19126, 0x00008D93 }, /* GL_LUMINANCE_ALPHA8I_EXT */
+ { 19151, 0x00008D81 }, /* GL_LUMINANCE_ALPHA8UI_EXT */
+ { 19177, 0x00008D9D }, /* GL_LUMINANCE_ALPHA_INTEGER_EXT */
+ { 19208, 0x00008D9C }, /* GL_LUMINANCE_INTEGER_EXT */
+ { 19233, 0x0000821B }, /* GL_MAJOR_VERSION */
+ { 19250, 0x00000D90 }, /* GL_MAP1_COLOR_4 */
+ { 19266, 0x00000DD0 }, /* GL_MAP1_GRID_DOMAIN */
+ { 19286, 0x00000DD1 }, /* GL_MAP1_GRID_SEGMENTS */
+ { 19308, 0x00000D91 }, /* GL_MAP1_INDEX */
+ { 19322, 0x00000D92 }, /* GL_MAP1_NORMAL */
+ { 19337, 0x00000D93 }, /* GL_MAP1_TEXTURE_COORD_1 */
+ { 19361, 0x00000D94 }, /* GL_MAP1_TEXTURE_COORD_2 */
+ { 19385, 0x00000D95 }, /* GL_MAP1_TEXTURE_COORD_3 */
+ { 19409, 0x00000D96 }, /* GL_MAP1_TEXTURE_COORD_4 */
+ { 19433, 0x00000D97 }, /* GL_MAP1_VERTEX_3 */
+ { 19450, 0x00000D98 }, /* GL_MAP1_VERTEX_4 */
+ { 19467, 0x00008660 }, /* GL_MAP1_VERTEX_ATTRIB0_4_NV */
+ { 19495, 0x0000866A }, /* GL_MAP1_VERTEX_ATTRIB10_4_NV */
+ { 19524, 0x0000866B }, /* GL_MAP1_VERTEX_ATTRIB11_4_NV */
+ { 19553, 0x0000866C }, /* GL_MAP1_VERTEX_ATTRIB12_4_NV */
+ { 19582, 0x0000866D }, /* GL_MAP1_VERTEX_ATTRIB13_4_NV */
+ { 19611, 0x0000866E }, /* GL_MAP1_VERTEX_ATTRIB14_4_NV */
+ { 19640, 0x0000866F }, /* GL_MAP1_VERTEX_ATTRIB15_4_NV */
+ { 19669, 0x00008661 }, /* GL_MAP1_VERTEX_ATTRIB1_4_NV */
+ { 19697, 0x00008662 }, /* GL_MAP1_VERTEX_ATTRIB2_4_NV */
+ { 19725, 0x00008663 }, /* GL_MAP1_VERTEX_ATTRIB3_4_NV */
+ { 19753, 0x00008664 }, /* GL_MAP1_VERTEX_ATTRIB4_4_NV */
+ { 19781, 0x00008665 }, /* GL_MAP1_VERTEX_ATTRIB5_4_NV */
+ { 19809, 0x00008666 }, /* GL_MAP1_VERTEX_ATTRIB6_4_NV */
+ { 19837, 0x00008667 }, /* GL_MAP1_VERTEX_ATTRIB7_4_NV */
+ { 19865, 0x00008668 }, /* GL_MAP1_VERTEX_ATTRIB8_4_NV */
+ { 19893, 0x00008669 }, /* GL_MAP1_VERTEX_ATTRIB9_4_NV */
+ { 19921, 0x00000DB0 }, /* GL_MAP2_COLOR_4 */
+ { 19937, 0x00000DD2 }, /* GL_MAP2_GRID_DOMAIN */
+ { 19957, 0x00000DD3 }, /* GL_MAP2_GRID_SEGMENTS */
+ { 19979, 0x00000DB1 }, /* GL_MAP2_INDEX */
+ { 19993, 0x00000DB2 }, /* GL_MAP2_NORMAL */
+ { 20008, 0x00000DB3 }, /* GL_MAP2_TEXTURE_COORD_1 */
+ { 20032, 0x00000DB4 }, /* GL_MAP2_TEXTURE_COORD_2 */
+ { 20056, 0x00000DB5 }, /* GL_MAP2_TEXTURE_COORD_3 */
+ { 20080, 0x00000DB6 }, /* GL_MAP2_TEXTURE_COORD_4 */
+ { 20104, 0x00000DB7 }, /* GL_MAP2_VERTEX_3 */
+ { 20121, 0x00000DB8 }, /* GL_MAP2_VERTEX_4 */
+ { 20138, 0x00008670 }, /* GL_MAP2_VERTEX_ATTRIB0_4_NV */
+ { 20166, 0x0000867A }, /* GL_MAP2_VERTEX_ATTRIB10_4_NV */
+ { 20195, 0x0000867B }, /* GL_MAP2_VERTEX_ATTRIB11_4_NV */
+ { 20224, 0x0000867C }, /* GL_MAP2_VERTEX_ATTRIB12_4_NV */
+ { 20253, 0x0000867D }, /* GL_MAP2_VERTEX_ATTRIB13_4_NV */
+ { 20282, 0x0000867E }, /* GL_MAP2_VERTEX_ATTRIB14_4_NV */
+ { 20311, 0x0000867F }, /* GL_MAP2_VERTEX_ATTRIB15_4_NV */
+ { 20340, 0x00008671 }, /* GL_MAP2_VERTEX_ATTRIB1_4_NV */
+ { 20368, 0x00008672 }, /* GL_MAP2_VERTEX_ATTRIB2_4_NV */
+ { 20396, 0x00008673 }, /* GL_MAP2_VERTEX_ATTRIB3_4_NV */
+ { 20424, 0x00008674 }, /* GL_MAP2_VERTEX_ATTRIB4_4_NV */
+ { 20452, 0x00008675 }, /* GL_MAP2_VERTEX_ATTRIB5_4_NV */
+ { 20480, 0x00008676 }, /* GL_MAP2_VERTEX_ATTRIB6_4_NV */
+ { 20508, 0x00008677 }, /* GL_MAP2_VERTEX_ATTRIB7_4_NV */
+ { 20536, 0x00008678 }, /* GL_MAP2_VERTEX_ATTRIB8_4_NV */
+ { 20564, 0x00008679 }, /* GL_MAP2_VERTEX_ATTRIB9_4_NV */
+ { 20592, 0x00000D10 }, /* GL_MAP_COLOR */
+ { 20605, 0x00000010 }, /* GL_MAP_FLUSH_EXPLICIT_BIT */
+ { 20631, 0x00000008 }, /* GL_MAP_INVALIDATE_BUFFER_BIT */
+ { 20660, 0x00000004 }, /* GL_MAP_INVALIDATE_RANGE_BIT */
+ { 20688, 0x00000001 }, /* GL_MAP_READ_BIT */
+ { 20704, 0x00000D11 }, /* GL_MAP_STENCIL */
+ { 20719, 0x00000020 }, /* GL_MAP_UNSYNCHRONIZED_BIT */
+ { 20745, 0x00000002 }, /* GL_MAP_WRITE_BIT */
+ { 20762, 0x000088C0 }, /* GL_MATRIX0_ARB */
+ { 20777, 0x00008630 }, /* GL_MATRIX0_NV */
+ { 20791, 0x000088CA }, /* GL_MATRIX10_ARB */
+ { 20807, 0x000088CB }, /* GL_MATRIX11_ARB */
+ { 20823, 0x000088CC }, /* GL_MATRIX12_ARB */
+ { 20839, 0x000088CD }, /* GL_MATRIX13_ARB */
+ { 20855, 0x000088CE }, /* GL_MATRIX14_ARB */
+ { 20871, 0x000088CF }, /* GL_MATRIX15_ARB */
+ { 20887, 0x000088D0 }, /* GL_MATRIX16_ARB */
+ { 20903, 0x000088D1 }, /* GL_MATRIX17_ARB */
+ { 20919, 0x000088D2 }, /* GL_MATRIX18_ARB */
+ { 20935, 0x000088D3 }, /* GL_MATRIX19_ARB */
+ { 20951, 0x000088C1 }, /* GL_MATRIX1_ARB */
+ { 20966, 0x00008631 }, /* GL_MATRIX1_NV */
+ { 20980, 0x000088D4 }, /* GL_MATRIX20_ARB */
+ { 20996, 0x000088D5 }, /* GL_MATRIX21_ARB */
+ { 21012, 0x000088D6 }, /* GL_MATRIX22_ARB */
+ { 21028, 0x000088D7 }, /* GL_MATRIX23_ARB */
+ { 21044, 0x000088D8 }, /* GL_MATRIX24_ARB */
+ { 21060, 0x000088D9 }, /* GL_MATRIX25_ARB */
+ { 21076, 0x000088DA }, /* GL_MATRIX26_ARB */
+ { 21092, 0x000088DB }, /* GL_MATRIX27_ARB */
+ { 21108, 0x000088DC }, /* GL_MATRIX28_ARB */
+ { 21124, 0x000088DD }, /* GL_MATRIX29_ARB */
+ { 21140, 0x000088C2 }, /* GL_MATRIX2_ARB */
+ { 21155, 0x00008632 }, /* GL_MATRIX2_NV */
+ { 21169, 0x000088DE }, /* GL_MATRIX30_ARB */
+ { 21185, 0x000088DF }, /* GL_MATRIX31_ARB */
+ { 21201, 0x000088C3 }, /* GL_MATRIX3_ARB */
+ { 21216, 0x00008633 }, /* GL_MATRIX3_NV */
+ { 21230, 0x000088C4 }, /* GL_MATRIX4_ARB */
+ { 21245, 0x00008634 }, /* GL_MATRIX4_NV */
+ { 21259, 0x000088C5 }, /* GL_MATRIX5_ARB */
+ { 21274, 0x00008635 }, /* GL_MATRIX5_NV */
+ { 21288, 0x000088C6 }, /* GL_MATRIX6_ARB */
+ { 21303, 0x00008636 }, /* GL_MATRIX6_NV */
+ { 21317, 0x000088C7 }, /* GL_MATRIX7_ARB */
+ { 21332, 0x00008637 }, /* GL_MATRIX7_NV */
+ { 21346, 0x000088C8 }, /* GL_MATRIX8_ARB */
+ { 21361, 0x000088C9 }, /* GL_MATRIX9_ARB */
+ { 21376, 0x00008844 }, /* GL_MATRIX_INDEX_ARRAY_ARB */
+ { 21402, 0x00008B9E }, /* GL_MATRIX_INDEX_ARRAY_BUFFER_BINDING_OES */
+ { 21443, 0x00008844 }, /* GL_MATRIX_INDEX_ARRAY_OES */
+ { 21469, 0x00008849 }, /* GL_MATRIX_INDEX_ARRAY_POINTER_ARB */
+ { 21503, 0x00008849 }, /* GL_MATRIX_INDEX_ARRAY_POINTER_OES */
+ { 21537, 0x00008846 }, /* GL_MATRIX_INDEX_ARRAY_SIZE_ARB */
+ { 21568, 0x00008846 }, /* GL_MATRIX_INDEX_ARRAY_SIZE_OES */
+ { 21599, 0x00008848 }, /* GL_MATRIX_INDEX_ARRAY_STRIDE_ARB */
+ { 21632, 0x00008848 }, /* GL_MATRIX_INDEX_ARRAY_STRIDE_OES */
+ { 21665, 0x00008847 }, /* GL_MATRIX_INDEX_ARRAY_TYPE_ARB */
+ { 21696, 0x00008847 }, /* GL_MATRIX_INDEX_ARRAY_TYPE_OES */
+ { 21727, 0x00000BA0 }, /* GL_MATRIX_MODE */
+ { 21742, 0x00008840 }, /* GL_MATRIX_PALETTE_ARB */
+ { 21764, 0x00008840 }, /* GL_MATRIX_PALETTE_OES */
+ { 21786, 0x00008008 }, /* GL_MAX */
+ { 21793, 0x00008073 }, /* GL_MAX_3D_TEXTURE_SIZE */
+ { 21816, 0x00008073 }, /* GL_MAX_3D_TEXTURE_SIZE_OES */
+ { 21843, 0x000088FF }, /* GL_MAX_ARRAY_TEXTURE_LAYERS */
+ { 21871, 0x000088FF }, /* GL_MAX_ARRAY_TEXTURE_LAYERS_EXT */
+ { 21903, 0x00000D35 }, /* GL_MAX_ATTRIB_STACK_DEPTH */
+ { 21929, 0x00000D3B }, /* GL_MAX_CLIENT_ATTRIB_STACK_DEPTH */
+ { 21962, 0x00008177 }, /* GL_MAX_CLIPMAP_DEPTH_SGIX */
+ { 21988, 0x00008178 }, /* GL_MAX_CLIPMAP_VIRTUAL_DEPTH_SGIX */
+ { 22022, 0x00000D32 }, /* GL_MAX_CLIP_DISTANCES */
+ { 22044, 0x00000D32 }, /* GL_MAX_CLIP_PLANES */
+ { 22063, 0x00008CDF }, /* GL_MAX_COLOR_ATTACHMENTS */
+ { 22088, 0x00008CDF }, /* GL_MAX_COLOR_ATTACHMENTS_EXT */
+ { 22117, 0x000080B3 }, /* GL_MAX_COLOR_MATRIX_STACK_DEPTH */
+ { 22149, 0x000080B3 }, /* GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI */
+ { 22185, 0x00008B4D }, /* GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS */
+ { 22221, 0x00008B4D }, /* GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB */
+ { 22261, 0x0000801B }, /* GL_MAX_CONVOLUTION_HEIGHT */
+ { 22287, 0x0000801B }, /* GL_MAX_CONVOLUTION_HEIGHT_EXT */
+ { 22317, 0x0000801A }, /* GL_MAX_CONVOLUTION_WIDTH */
+ { 22342, 0x0000801A }, /* GL_MAX_CONVOLUTION_WIDTH_EXT */
+ { 22371, 0x0000851C }, /* GL_MAX_CUBE_MAP_TEXTURE_SIZE */
+ { 22400, 0x0000851C }, /* GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB */
+ { 22433, 0x0000851C }, /* GL_MAX_CUBE_MAP_TEXTURE_SIZE_OES */
+ { 22466, 0x00008824 }, /* GL_MAX_DRAW_BUFFERS */
+ { 22486, 0x00008824 }, /* GL_MAX_DRAW_BUFFERS_ARB */
+ { 22510, 0x00008824 }, /* GL_MAX_DRAW_BUFFERS_ATI */
+ { 22534, 0x000080E9 }, /* GL_MAX_ELEMENTS_INDICES */
+ { 22558, 0x000080E8 }, /* GL_MAX_ELEMENTS_VERTICES */
+ { 22583, 0x00000D30 }, /* GL_MAX_EVAL_ORDER */
+ { 22601, 0x00008008 }, /* GL_MAX_EXT */
+ { 22612, 0x00009125 }, /* GL_MAX_FRAGMENT_INPUT_COMPONENTS */
+ { 22645, 0x00008B49 }, /* GL_MAX_FRAGMENT_UNIFORM_COMPONENTS */
+ { 22680, 0x00008B49 }, /* GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB */
+ { 22719, 0x00008DFD }, /* GL_MAX_FRAGMENT_UNIFORM_VECTORS */
+ { 22751, 0x00009123 }, /* GL_MAX_GEOMETRY_INPUT_COMPONENTS */
+ { 22784, 0x00009124 }, /* GL_MAX_GEOMETRY_OUTPUT_COMPONENTS */
+ { 22818, 0x00008DE0 }, /* GL_MAX_GEOMETRY_OUTPUT_VERTICES */
+ { 22850, 0x00008DE0 }, /* GL_MAX_GEOMETRY_OUTPUT_VERTICES_ARB */
+ { 22886, 0x00008C29 }, /* GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS */
+ { 22922, 0x00008C29 }, /* GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_ARB */
+ { 22962, 0x00008DE1 }, /* GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS */
+ { 23002, 0x00008DE1 }, /* GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_ARB */
+ { 23046, 0x00008DDF }, /* GL_MAX_GEOMETRY_UNIFORM_COMPONENTS */
+ { 23081, 0x00008DDF }, /* GL_MAX_GEOMETRY_UNIFORM_COMPONENTS_ARB */
+ { 23120, 0x00008DDD }, /* GL_MAX_GEOMETRY_VARYING_COMPONENTS_ARB */
+ { 23159, 0x00000D31 }, /* GL_MAX_LIGHTS */
+ { 23173, 0x00000B31 }, /* GL_MAX_LIST_NESTING */
+ { 23193, 0x00008841 }, /* GL_MAX_MATRIX_PALETTE_STACK_DEPTH_ARB */
+ { 23231, 0x00000D36 }, /* GL_MAX_MODELVIEW_STACK_DEPTH */
+ { 23260, 0x00000D37 }, /* GL_MAX_NAME_STACK_DEPTH */
+ { 23284, 0x00008842 }, /* GL_MAX_PALETTE_MATRICES_ARB */
+ { 23312, 0x00008842 }, /* GL_MAX_PALETTE_MATRICES_OES */
+ { 23340, 0x00000D34 }, /* GL_MAX_PIXEL_MAP_TABLE */
+ { 23363, 0x000088B1 }, /* GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB */
+ { 23400, 0x0000880B }, /* GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB */
+ { 23436, 0x000088AD }, /* GL_MAX_PROGRAM_ATTRIBS_ARB */
+ { 23463, 0x000088F5 }, /* GL_MAX_PROGRAM_CALL_DEPTH_NV */
+ { 23492, 0x000088B5 }, /* GL_MAX_PROGRAM_ENV_PARAMETERS_ARB */
+ { 23526, 0x000088F4 }, /* GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV */
+ { 23562, 0x000088F6 }, /* GL_MAX_PROGRAM_IF_DEPTH_NV */
+ { 23589, 0x000088A1 }, /* GL_MAX_PROGRAM_INSTRUCTIONS_ARB */
+ { 23621, 0x000088B4 }, /* GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB */
+ { 23657, 0x000088F8 }, /* GL_MAX_PROGRAM_LOOP_COUNT_NV */
+ { 23686, 0x000088F7 }, /* GL_MAX_PROGRAM_LOOP_DEPTH_NV */
+ { 23715, 0x0000862F }, /* GL_MAX_PROGRAM_MATRICES_ARB */
+ { 23743, 0x0000862E }, /* GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB */
+ { 23781, 0x000088B3 }, /* GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB */
+ { 23825, 0x0000880E }, /* GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB */
+ { 23868, 0x000088AF }, /* GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB */
+ { 23902, 0x000088A3 }, /* GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB */
+ { 23941, 0x000088AB }, /* GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB */
+ { 23978, 0x000088A7 }, /* GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB */
+ { 24016, 0x00008810 }, /* GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB */
+ { 24059, 0x0000880F }, /* GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB */
+ { 24102, 0x000088A9 }, /* GL_MAX_PROGRAM_PARAMETERS_ARB */
+ { 24132, 0x000088A5 }, /* GL_MAX_PROGRAM_TEMPORARIES_ARB */
+ { 24163, 0x00008905 }, /* GL_MAX_PROGRAM_TEXEL_OFFSET */
+ { 24191, 0x00008905 }, /* GL_MAX_PROGRAM_TEXEL_OFFSET_EXT */
+ { 24223, 0x0000880D }, /* GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB */
+ { 24259, 0x0000880C }, /* GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB */
+ { 24295, 0x00000D38 }, /* GL_MAX_PROJECTION_STACK_DEPTH */
+ { 24325, 0x000084F8 }, /* GL_MAX_RECTANGLE_TEXTURE_SIZE */
+ { 24355, 0x000084F8 }, /* GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB */
+ { 24389, 0x000084F8 }, /* GL_MAX_RECTANGLE_TEXTURE_SIZE_NV */
+ { 24422, 0x000084E8 }, /* GL_MAX_RENDERBUFFER_SIZE */
+ { 24447, 0x000084E8 }, /* GL_MAX_RENDERBUFFER_SIZE_EXT */
+ { 24476, 0x000084E8 }, /* GL_MAX_RENDERBUFFER_SIZE_OES */
+ { 24505, 0x00008D57 }, /* GL_MAX_SAMPLES */
+ { 24520, 0x00008D57 }, /* GL_MAX_SAMPLES_EXT */
+ { 24539, 0x00009111 }, /* GL_MAX_SERVER_WAIT_TIMEOUT */
+ { 24566, 0x00008504 }, /* GL_MAX_SHININESS_NV */
+ { 24586, 0x00008505 }, /* GL_MAX_SPOT_EXPONENT_NV */
+ { 24610, 0x00008C2B }, /* GL_MAX_TEXTURE_BUFFER_SIZE */
+ { 24637, 0x00008C2B }, /* GL_MAX_TEXTURE_BUFFER_SIZE_ARB */
+ { 24668, 0x00008871 }, /* GL_MAX_TEXTURE_COORDS */
+ { 24690, 0x00008871 }, /* GL_MAX_TEXTURE_COORDS_ARB */
+ { 24716, 0x00008872 }, /* GL_MAX_TEXTURE_IMAGE_UNITS */
+ { 24743, 0x00008872 }, /* GL_MAX_TEXTURE_IMAGE_UNITS_ARB */
+ { 24774, 0x000084FD }, /* GL_MAX_TEXTURE_LOD_BIAS */
+ { 24798, 0x000084FD }, /* GL_MAX_TEXTURE_LOD_BIAS_EXT */
+ { 24826, 0x000084FF }, /* GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT */
+ { 24860, 0x00000D33 }, /* GL_MAX_TEXTURE_SIZE */
+ { 24880, 0x00000D39 }, /* GL_MAX_TEXTURE_STACK_DEPTH */
+ { 24907, 0x000084E2 }, /* GL_MAX_TEXTURE_UNITS */
+ { 24928, 0x000084E2 }, /* GL_MAX_TEXTURE_UNITS_ARB */
+ { 24953, 0x0000862F }, /* GL_MAX_TRACK_MATRICES_NV */
+ { 24978, 0x0000862E }, /* GL_MAX_TRACK_MATRIX_STACK_DEPTH_NV */
+ { 25013, 0x00008C8A }, /* GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS */
+ { 25062, 0x00008C8A }, /* GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS_EXT */
+ { 25115, 0x00008C8B }, /* GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS */
+ { 25158, 0x00008C8B }, /* GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS_EXT */
+ { 25205, 0x00008C80 }, /* GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS */
+ { 25251, 0x00008C80 }, /* GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS_EXT */
+ { 25301, 0x00008B4B }, /* GL_MAX_VARYING_COMPONENTS */
+ { 25327, 0x00008B4B }, /* GL_MAX_VARYING_FLOATS */
+ { 25349, 0x00008B4B }, /* GL_MAX_VARYING_FLOATS_ARB */
+ { 25375, 0x00008DFC }, /* GL_MAX_VARYING_VECTORS */
+ { 25398, 0x00008869 }, /* GL_MAX_VERTEX_ATTRIBS */
+ { 25420, 0x00008869 }, /* GL_MAX_VERTEX_ATTRIBS_ARB */
+ { 25446, 0x00009122 }, /* GL_MAX_VERTEX_OUTPUT_COMPONENTS */
+ { 25478, 0x00008B4C }, /* GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS */
+ { 25512, 0x00008B4C }, /* GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB */
+ { 25550, 0x00008B4A }, /* GL_MAX_VERTEX_UNIFORM_COMPONENTS */
+ { 25583, 0x00008B4A }, /* GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB */
+ { 25620, 0x00008DFB }, /* GL_MAX_VERTEX_UNIFORM_VECTORS */
+ { 25650, 0x000086A4 }, /* GL_MAX_VERTEX_UNITS_ARB */
+ { 25674, 0x000086A4 }, /* GL_MAX_VERTEX_UNITS_OES */
+ { 25698, 0x00008DDE }, /* GL_MAX_VERTEX_VARYING_COMPONENTS_ARB */
+ { 25735, 0x00000D3A }, /* GL_MAX_VIEWPORT_DIMS */
+ { 25756, 0x00008DF1 }, /* GL_MEDIUM_FLOAT */
+ { 25772, 0x00008DF4 }, /* GL_MEDIUM_INT */
+ { 25786, 0x00008007 }, /* GL_MIN */
+ { 25793, 0x0000802E }, /* GL_MINMAX */
+ { 25803, 0x0000802E }, /* GL_MINMAX_EXT */
+ { 25817, 0x0000802F }, /* GL_MINMAX_FORMAT */
+ { 25834, 0x0000802F }, /* GL_MINMAX_FORMAT_EXT */
+ { 25855, 0x00008030 }, /* GL_MINMAX_SINK */
+ { 25870, 0x00008030 }, /* GL_MINMAX_SINK_EXT */
+ { 25889, 0x0000821C }, /* GL_MINOR_VERSION */
+ { 25906, 0x00008007 }, /* GL_MIN_EXT */
+ { 25917, 0x00008904 }, /* GL_MIN_PROGRAM_TEXEL_OFFSET */
+ { 25945, 0x00008904 }, /* GL_MIN_PROGRAM_TEXEL_OFFSET_EXT */
+ { 25977, 0x00008370 }, /* GL_MIRRORED_REPEAT */
+ { 25996, 0x00008370 }, /* GL_MIRRORED_REPEAT_ARB */
+ { 26019, 0x00008370 }, /* GL_MIRRORED_REPEAT_IBM */
+ { 26042, 0x00008742 }, /* GL_MIRROR_CLAMP_ATI */
+ { 26062, 0x00008742 }, /* GL_MIRROR_CLAMP_EXT */
+ { 26082, 0x00008912 }, /* GL_MIRROR_CLAMP_TO_BORDER_EXT */
+ { 26112, 0x00008743 }, /* GL_MIRROR_CLAMP_TO_EDGE_ATI */
+ { 26140, 0x00008743 }, /* GL_MIRROR_CLAMP_TO_EDGE_EXT */
+ { 26168, 0x00001700 }, /* GL_MODELVIEW */
+ { 26181, 0x00001700 }, /* GL_MODELVIEW0_ARB */
+ { 26199, 0x0000872A }, /* GL_MODELVIEW10_ARB */
+ { 26218, 0x0000872B }, /* GL_MODELVIEW11_ARB */
+ { 26237, 0x0000872C }, /* GL_MODELVIEW12_ARB */
+ { 26256, 0x0000872D }, /* GL_MODELVIEW13_ARB */
+ { 26275, 0x0000872E }, /* GL_MODELVIEW14_ARB */
+ { 26294, 0x0000872F }, /* GL_MODELVIEW15_ARB */
+ { 26313, 0x00008730 }, /* GL_MODELVIEW16_ARB */
+ { 26332, 0x00008731 }, /* GL_MODELVIEW17_ARB */
+ { 26351, 0x00008732 }, /* GL_MODELVIEW18_ARB */
+ { 26370, 0x00008733 }, /* GL_MODELVIEW19_ARB */
+ { 26389, 0x0000850A }, /* GL_MODELVIEW1_ARB */
+ { 26407, 0x00008734 }, /* GL_MODELVIEW20_ARB */
+ { 26426, 0x00008735 }, /* GL_MODELVIEW21_ARB */
+ { 26445, 0x00008736 }, /* GL_MODELVIEW22_ARB */
+ { 26464, 0x00008737 }, /* GL_MODELVIEW23_ARB */
+ { 26483, 0x00008738 }, /* GL_MODELVIEW24_ARB */
+ { 26502, 0x00008739 }, /* GL_MODELVIEW25_ARB */
+ { 26521, 0x0000873A }, /* GL_MODELVIEW26_ARB */
+ { 26540, 0x0000873B }, /* GL_MODELVIEW27_ARB */
+ { 26559, 0x0000873C }, /* GL_MODELVIEW28_ARB */
+ { 26578, 0x0000873D }, /* GL_MODELVIEW29_ARB */
+ { 26597, 0x00008722 }, /* GL_MODELVIEW2_ARB */
+ { 26615, 0x0000873E }, /* GL_MODELVIEW30_ARB */
+ { 26634, 0x0000873F }, /* GL_MODELVIEW31_ARB */
+ { 26653, 0x00008723 }, /* GL_MODELVIEW3_ARB */
+ { 26671, 0x00008724 }, /* GL_MODELVIEW4_ARB */
+ { 26689, 0x00008725 }, /* GL_MODELVIEW5_ARB */
+ { 26707, 0x00008726 }, /* GL_MODELVIEW6_ARB */
+ { 26725, 0x00008727 }, /* GL_MODELVIEW7_ARB */
+ { 26743, 0x00008728 }, /* GL_MODELVIEW8_ARB */
+ { 26761, 0x00008729 }, /* GL_MODELVIEW9_ARB */
+ { 26779, 0x00000BA6 }, /* GL_MODELVIEW_MATRIX */
+ { 26799, 0x0000898D }, /* GL_MODELVIEW_MATRIX_FLOAT_AS_INT_BITS_OES */
+ { 26841, 0x00008629 }, /* GL_MODELVIEW_PROJECTION_NV */
+ { 26868, 0x00000BA3 }, /* GL_MODELVIEW_STACK_DEPTH */
+ { 26893, 0x00002100 }, /* GL_MODULATE */
+ { 26905, 0x00008744 }, /* GL_MODULATE_ADD_ATI */
+ { 26925, 0x00008745 }, /* GL_MODULATE_SIGNED_ADD_ATI */
+ { 26952, 0x00008746 }, /* GL_MODULATE_SUBTRACT_ATI */
+ { 26977, 0x00000103 }, /* GL_MULT */
+ { 26985, 0x0000809D }, /* GL_MULTISAMPLE */
+ { 27000, 0x000086B2 }, /* GL_MULTISAMPLE_3DFX */
+ { 27020, 0x0000809D }, /* GL_MULTISAMPLE_ARB */
+ { 27039, 0x20000000 }, /* GL_MULTISAMPLE_BIT */
+ { 27058, 0x20000000 }, /* GL_MULTISAMPLE_BIT_3DFX */
+ { 27082, 0x20000000 }, /* GL_MULTISAMPLE_BIT_ARB */
+ { 27105, 0x00008534 }, /* GL_MULTISAMPLE_FILTER_HINT_NV */
+ { 27135, 0x00002A25 }, /* GL_N3F_V3F */
+ { 27146, 0x00000D70 }, /* GL_NAME_STACK_DEPTH */
+ { 27166, 0x0000150E }, /* GL_NAND */
+ { 27174, 0x00002600 }, /* GL_NEAREST */
+ { 27185, 0x0000844E }, /* GL_NEAREST_CLIPMAP_LINEAR_SGIX */
+ { 27216, 0x0000844D }, /* GL_NEAREST_CLIPMAP_NEAREST_SGIX */
+ { 27248, 0x00002702 }, /* GL_NEAREST_MIPMAP_LINEAR */
+ { 27273, 0x00002700 }, /* GL_NEAREST_MIPMAP_NEAREST */
+ { 27299, 0x00000200 }, /* GL_NEVER */
+ { 27308, 0x00001102 }, /* GL_NICEST */
+ { 27318, 0x00000000 }, /* GL_NONE */
+ { 27326, 0x00000000 }, /* GL_NONE_OES */
+ { 27338, 0x00001505 }, /* GL_NOOP */
+ { 27346, 0x00001508 }, /* GL_NOR */
+ { 27353, 0x00000BA1 }, /* GL_NORMALIZE */
+ { 27366, 0x00008075 }, /* GL_NORMAL_ARRAY */
+ { 27382, 0x00008897 }, /* GL_NORMAL_ARRAY_BUFFER_BINDING */
+ { 27413, 0x00008897 }, /* GL_NORMAL_ARRAY_BUFFER_BINDING_ARB */
+ { 27448, 0x0000808F }, /* GL_NORMAL_ARRAY_POINTER */
+ { 27472, 0x0000807F }, /* GL_NORMAL_ARRAY_STRIDE */
+ { 27495, 0x0000807E }, /* GL_NORMAL_ARRAY_TYPE */
+ { 27516, 0x00008511 }, /* GL_NORMAL_MAP */
+ { 27530, 0x00008511 }, /* GL_NORMAL_MAP_ARB */
+ { 27548, 0x00008511 }, /* GL_NORMAL_MAP_NV */
+ { 27565, 0x00008511 }, /* GL_NORMAL_MAP_OES */
+ { 27583, 0x00000205 }, /* GL_NOTEQUAL */
+ { 27595, 0x00000000 }, /* GL_NO_ERROR */
+ { 27607, 0x00008261 }, /* GL_NO_RESET_NOTIFICATION_ARB */
+ { 27636, 0x000086A2 }, /* GL_NUM_COMPRESSED_TEXTURE_FORMATS */
+ { 27670, 0x000086A2 }, /* GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB */
+ { 27708, 0x0000821D }, /* GL_NUM_EXTENSIONS */
+ { 27726, 0x000087FE }, /* GL_NUM_PROGRAM_BINARY_FORMATS_OES */
+ { 27760, 0x00008DF9 }, /* GL_NUM_SHADER_BINARY_FORMATS */
+ { 27789, 0x00008B89 }, /* GL_OBJECT_ACTIVE_ATTRIBUTES_ARB */
+ { 27821, 0x00008B8A }, /* GL_OBJECT_ACTIVE_ATTRIBUTE_MAX_LENGTH_ARB */
+ { 27863, 0x00008B86 }, /* GL_OBJECT_ACTIVE_UNIFORMS_ARB */
+ { 27893, 0x00008B87 }, /* GL_OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB */
+ { 27933, 0x00008B85 }, /* GL_OBJECT_ATTACHED_OBJECTS_ARB */
+ { 27964, 0x00008B81 }, /* GL_OBJECT_COMPILE_STATUS_ARB */
+ { 27993, 0x00008B80 }, /* GL_OBJECT_DELETE_STATUS_ARB */
+ { 28021, 0x00008B84 }, /* GL_OBJECT_INFO_LOG_LENGTH_ARB */
+ { 28051, 0x00002401 }, /* GL_OBJECT_LINEAR */
+ { 28068, 0x00008B82 }, /* GL_OBJECT_LINK_STATUS_ARB */
+ { 28094, 0x00002501 }, /* GL_OBJECT_PLANE */
+ { 28110, 0x00008B88 }, /* GL_OBJECT_SHADER_SOURCE_LENGTH_ARB */
+ { 28145, 0x00008B4F }, /* GL_OBJECT_SUBTYPE_ARB */
+ { 28167, 0x00009112 }, /* GL_OBJECT_TYPE */
+ { 28182, 0x00008B4E }, /* GL_OBJECT_TYPE_ARB */
+ { 28201, 0x00008B83 }, /* GL_OBJECT_VALIDATE_STATUS_ARB */
+ { 28231, 0x00008165 }, /* GL_OCCLUSION_TEST_HP */
+ { 28252, 0x00008166 }, /* GL_OCCLUSION_TEST_RESULT_HP */
+ { 28280, 0x00000001 }, /* GL_ONE */
+ { 28287, 0x00008004 }, /* GL_ONE_MINUS_CONSTANT_ALPHA */
+ { 28315, 0x00008004 }, /* GL_ONE_MINUS_CONSTANT_ALPHA_EXT */
+ { 28347, 0x00008002 }, /* GL_ONE_MINUS_CONSTANT_COLOR */
+ { 28375, 0x00008002 }, /* GL_ONE_MINUS_CONSTANT_COLOR_EXT */
+ { 28407, 0x00000305 }, /* GL_ONE_MINUS_DST_ALPHA */
+ { 28430, 0x00000307 }, /* GL_ONE_MINUS_DST_COLOR */
+ { 28453, 0x00000303 }, /* GL_ONE_MINUS_SRC_ALPHA */
+ { 28476, 0x00000301 }, /* GL_ONE_MINUS_SRC_COLOR */
+ { 28499, 0x00008598 }, /* GL_OPERAND0_ALPHA */
+ { 28517, 0x00008598 }, /* GL_OPERAND0_ALPHA_ARB */
+ { 28539, 0x00008598 }, /* GL_OPERAND0_ALPHA_EXT */
+ { 28561, 0x00008590 }, /* GL_OPERAND0_RGB */
+ { 28577, 0x00008590 }, /* GL_OPERAND0_RGB_ARB */
+ { 28597, 0x00008590 }, /* GL_OPERAND0_RGB_EXT */
+ { 28617, 0x00008599 }, /* GL_OPERAND1_ALPHA */
+ { 28635, 0x00008599 }, /* GL_OPERAND1_ALPHA_ARB */
+ { 28657, 0x00008599 }, /* GL_OPERAND1_ALPHA_EXT */
+ { 28679, 0x00008591 }, /* GL_OPERAND1_RGB */
+ { 28695, 0x00008591 }, /* GL_OPERAND1_RGB_ARB */
+ { 28715, 0x00008591 }, /* GL_OPERAND1_RGB_EXT */
+ { 28735, 0x0000859A }, /* GL_OPERAND2_ALPHA */
+ { 28753, 0x0000859A }, /* GL_OPERAND2_ALPHA_ARB */
+ { 28775, 0x0000859A }, /* GL_OPERAND2_ALPHA_EXT */
+ { 28797, 0x00008592 }, /* GL_OPERAND2_RGB */
+ { 28813, 0x00008592 }, /* GL_OPERAND2_RGB_ARB */
+ { 28833, 0x00008592 }, /* GL_OPERAND2_RGB_EXT */
+ { 28853, 0x0000859B }, /* GL_OPERAND3_ALPHA_NV */
+ { 28874, 0x00008593 }, /* GL_OPERAND3_RGB_NV */
+ { 28893, 0x00001507 }, /* GL_OR */
+ { 28899, 0x00000A01 }, /* GL_ORDER */
+ { 28908, 0x0000150D }, /* GL_OR_INVERTED */
+ { 28923, 0x0000150B }, /* GL_OR_REVERSE */
+ { 28937, 0x00000505 }, /* GL_OUT_OF_MEMORY */
+ { 28954, 0x00000D05 }, /* GL_PACK_ALIGNMENT */
+ { 28972, 0x0000806C }, /* GL_PACK_IMAGE_HEIGHT */
+ { 28993, 0x00008758 }, /* GL_PACK_INVERT_MESA */
+ { 29013, 0x00000D01 }, /* GL_PACK_LSB_FIRST */
+ { 29031, 0x00000D02 }, /* GL_PACK_ROW_LENGTH */
+ { 29050, 0x0000806B }, /* GL_PACK_SKIP_IMAGES */
+ { 29070, 0x00000D04 }, /* GL_PACK_SKIP_PIXELS */
+ { 29090, 0x00000D03 }, /* GL_PACK_SKIP_ROWS */
+ { 29108, 0x00000D00 }, /* GL_PACK_SWAP_BYTES */
+ { 29127, 0x00008B92 }, /* GL_PALETTE4_R5_G6_B5_OES */
+ { 29152, 0x00008B94 }, /* GL_PALETTE4_RGB5_A1_OES */
+ { 29176, 0x00008B90 }, /* GL_PALETTE4_RGB8_OES */
+ { 29197, 0x00008B93 }, /* GL_PALETTE4_RGBA4_OES */
+ { 29219, 0x00008B91 }, /* GL_PALETTE4_RGBA8_OES */
+ { 29241, 0x00008B97 }, /* GL_PALETTE8_R5_G6_B5_OES */
+ { 29266, 0x00008B99 }, /* GL_PALETTE8_RGB5_A1_OES */
+ { 29290, 0x00008B95 }, /* GL_PALETTE8_RGB8_OES */
+ { 29311, 0x00008B98 }, /* GL_PALETTE8_RGBA4_OES */
+ { 29333, 0x00008B96 }, /* GL_PALETTE8_RGBA8_OES */
+ { 29355, 0x00000700 }, /* GL_PASS_THROUGH_TOKEN */
+ { 29377, 0x00000C50 }, /* GL_PERSPECTIVE_CORRECTION_HINT */
+ { 29408, 0x00000C79 }, /* GL_PIXEL_MAP_A_TO_A */
+ { 29428, 0x00000CB9 }, /* GL_PIXEL_MAP_A_TO_A_SIZE */
+ { 29453, 0x00000C78 }, /* GL_PIXEL_MAP_B_TO_B */
+ { 29473, 0x00000CB8 }, /* GL_PIXEL_MAP_B_TO_B_SIZE */
+ { 29498, 0x00000C77 }, /* GL_PIXEL_MAP_G_TO_G */
+ { 29518, 0x00000CB7 }, /* GL_PIXEL_MAP_G_TO_G_SIZE */
+ { 29543, 0x00000C75 }, /* GL_PIXEL_MAP_I_TO_A */
+ { 29563, 0x00000CB5 }, /* GL_PIXEL_MAP_I_TO_A_SIZE */
+ { 29588, 0x00000C74 }, /* GL_PIXEL_MAP_I_TO_B */
+ { 29608, 0x00000CB4 }, /* GL_PIXEL_MAP_I_TO_B_SIZE */
+ { 29633, 0x00000C73 }, /* GL_PIXEL_MAP_I_TO_G */
+ { 29653, 0x00000CB3 }, /* GL_PIXEL_MAP_I_TO_G_SIZE */
+ { 29678, 0x00000C70 }, /* GL_PIXEL_MAP_I_TO_I */
+ { 29698, 0x00000CB0 }, /* GL_PIXEL_MAP_I_TO_I_SIZE */
+ { 29723, 0x00000C72 }, /* GL_PIXEL_MAP_I_TO_R */
+ { 29743, 0x00000CB2 }, /* GL_PIXEL_MAP_I_TO_R_SIZE */
+ { 29768, 0x00000C76 }, /* GL_PIXEL_MAP_R_TO_R */
+ { 29788, 0x00000CB6 }, /* GL_PIXEL_MAP_R_TO_R_SIZE */
+ { 29813, 0x00000C71 }, /* GL_PIXEL_MAP_S_TO_S */
+ { 29833, 0x00000CB1 }, /* GL_PIXEL_MAP_S_TO_S_SIZE */
+ { 29858, 0x00000020 }, /* GL_PIXEL_MODE_BIT */
+ { 29876, 0x000088EB }, /* GL_PIXEL_PACK_BUFFER */
+ { 29897, 0x000088ED }, /* GL_PIXEL_PACK_BUFFER_BINDING */
+ { 29926, 0x000088ED }, /* GL_PIXEL_PACK_BUFFER_BINDING_EXT */
+ { 29959, 0x000088EB }, /* GL_PIXEL_PACK_BUFFER_EXT */
+ { 29984, 0x000088EC }, /* GL_PIXEL_UNPACK_BUFFER */
+ { 30007, 0x000088EF }, /* GL_PIXEL_UNPACK_BUFFER_BINDING */
+ { 30038, 0x000088EF }, /* GL_PIXEL_UNPACK_BUFFER_BINDING_EXT */
+ { 30073, 0x000088EC }, /* GL_PIXEL_UNPACK_BUFFER_EXT */
+ { 30100, 0x00001B00 }, /* GL_POINT */
+ { 30109, 0x00000000 }, /* GL_POINTS */
+ { 30119, 0x00000002 }, /* GL_POINT_BIT */
+ { 30132, 0x00008129 }, /* GL_POINT_DISTANCE_ATTENUATION */
+ { 30162, 0x00008129 }, /* GL_POINT_DISTANCE_ATTENUATION_ARB */
+ { 30196, 0x00008129 }, /* GL_POINT_DISTANCE_ATTENUATION_EXT */
+ { 30230, 0x00008129 }, /* GL_POINT_DISTANCE_ATTENUATION_SGIS */
+ { 30265, 0x00008128 }, /* GL_POINT_FADE_THRESHOLD_SIZE */
+ { 30294, 0x00008128 }, /* GL_POINT_FADE_THRESHOLD_SIZE_ARB */
+ { 30327, 0x00008128 }, /* GL_POINT_FADE_THRESHOLD_SIZE_EXT */
+ { 30360, 0x00008128 }, /* GL_POINT_FADE_THRESHOLD_SIZE_SGIS */
+ { 30394, 0x00000B11 }, /* GL_POINT_SIZE */
+ { 30408, 0x00008B9F }, /* GL_POINT_SIZE_ARRAY_BUFFER_BINDING_OES */
+ { 30447, 0x00008B9C }, /* GL_POINT_SIZE_ARRAY_OES */
+ { 30471, 0x0000898C }, /* GL_POINT_SIZE_ARRAY_POINTER_OES */
+ { 30503, 0x0000898B }, /* GL_POINT_SIZE_ARRAY_STRIDE_OES */
+ { 30534, 0x0000898A }, /* GL_POINT_SIZE_ARRAY_TYPE_OES */
+ { 30563, 0x00000B13 }, /* GL_POINT_SIZE_GRANULARITY */
+ { 30589, 0x00008127 }, /* GL_POINT_SIZE_MAX */
+ { 30607, 0x00008127 }, /* GL_POINT_SIZE_MAX_ARB */
+ { 30629, 0x00008127 }, /* GL_POINT_SIZE_MAX_EXT */
+ { 30651, 0x00008127 }, /* GL_POINT_SIZE_MAX_SGIS */
+ { 30674, 0x00008126 }, /* GL_POINT_SIZE_MIN */
+ { 30692, 0x00008126 }, /* GL_POINT_SIZE_MIN_ARB */
+ { 30714, 0x00008126 }, /* GL_POINT_SIZE_MIN_EXT */
+ { 30736, 0x00008126 }, /* GL_POINT_SIZE_MIN_SGIS */
+ { 30759, 0x00000B12 }, /* GL_POINT_SIZE_RANGE */
+ { 30779, 0x00000B10 }, /* GL_POINT_SMOOTH */
+ { 30795, 0x00000C51 }, /* GL_POINT_SMOOTH_HINT */
+ { 30816, 0x00008861 }, /* GL_POINT_SPRITE */
+ { 30832, 0x00008861 }, /* GL_POINT_SPRITE_ARB */
+ { 30852, 0x00008CA0 }, /* GL_POINT_SPRITE_COORD_ORIGIN */
+ { 30881, 0x00008861 }, /* GL_POINT_SPRITE_NV */
+ { 30900, 0x00008861 }, /* GL_POINT_SPRITE_OES */
+ { 30920, 0x00008863 }, /* GL_POINT_SPRITE_R_MODE_NV */
+ { 30946, 0x00000701 }, /* GL_POINT_TOKEN */
+ { 30961, 0x00000009 }, /* GL_POLYGON */
+ { 30972, 0x00000008 }, /* GL_POLYGON_BIT */
+ { 30987, 0x00000B40 }, /* GL_POLYGON_MODE */
+ { 31003, 0x00008039 }, /* GL_POLYGON_OFFSET_BIAS */
+ { 31026, 0x00008038 }, /* GL_POLYGON_OFFSET_FACTOR */
+ { 31051, 0x00008037 }, /* GL_POLYGON_OFFSET_FILL */
+ { 31074, 0x00002A02 }, /* GL_POLYGON_OFFSET_LINE */
+ { 31097, 0x00002A01 }, /* GL_POLYGON_OFFSET_POINT */
+ { 31121, 0x00002A00 }, /* GL_POLYGON_OFFSET_UNITS */
+ { 31145, 0x00000B41 }, /* GL_POLYGON_SMOOTH */
+ { 31163, 0x00000C53 }, /* GL_POLYGON_SMOOTH_HINT */
+ { 31186, 0x00000B42 }, /* GL_POLYGON_STIPPLE */
+ { 31205, 0x00000010 }, /* GL_POLYGON_STIPPLE_BIT */
+ { 31228, 0x00000703 }, /* GL_POLYGON_TOKEN */
+ { 31245, 0x00001203 }, /* GL_POSITION */
+ { 31257, 0x000080BB }, /* GL_POST_COLOR_MATRIX_ALPHA_BIAS */
+ { 31289, 0x000080BB }, /* GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI */
+ { 31325, 0x000080B7 }, /* GL_POST_COLOR_MATRIX_ALPHA_SCALE */
+ { 31358, 0x000080B7 }, /* GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI */
+ { 31395, 0x000080BA }, /* GL_POST_COLOR_MATRIX_BLUE_BIAS */
+ { 31426, 0x000080BA }, /* GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI */
+ { 31461, 0x000080B6 }, /* GL_POST_COLOR_MATRIX_BLUE_SCALE */
+ { 31493, 0x000080B6 }, /* GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI */
+ { 31529, 0x000080D2 }, /* GL_POST_COLOR_MATRIX_COLOR_TABLE */
+ { 31562, 0x000080B9 }, /* GL_POST_COLOR_MATRIX_GREEN_BIAS */
+ { 31594, 0x000080B9 }, /* GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI */
+ { 31630, 0x000080B5 }, /* GL_POST_COLOR_MATRIX_GREEN_SCALE */
+ { 31663, 0x000080B5 }, /* GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI */
+ { 31700, 0x000080B8 }, /* GL_POST_COLOR_MATRIX_RED_BIAS */
+ { 31730, 0x000080B8 }, /* GL_POST_COLOR_MATRIX_RED_BIAS_SGI */
+ { 31764, 0x000080B4 }, /* GL_POST_COLOR_MATRIX_RED_SCALE */
+ { 31795, 0x000080B4 }, /* GL_POST_COLOR_MATRIX_RED_SCALE_SGI */
+ { 31830, 0x00008023 }, /* GL_POST_CONVOLUTION_ALPHA_BIAS */
+ { 31861, 0x00008023 }, /* GL_POST_CONVOLUTION_ALPHA_BIAS_EXT */
+ { 31896, 0x0000801F }, /* GL_POST_CONVOLUTION_ALPHA_SCALE */
+ { 31928, 0x0000801F }, /* GL_POST_CONVOLUTION_ALPHA_SCALE_EXT */
+ { 31964, 0x00008022 }, /* GL_POST_CONVOLUTION_BLUE_BIAS */
+ { 31994, 0x00008022 }, /* GL_POST_CONVOLUTION_BLUE_BIAS_EXT */
+ { 32028, 0x0000801E }, /* GL_POST_CONVOLUTION_BLUE_SCALE */
+ { 32059, 0x0000801E }, /* GL_POST_CONVOLUTION_BLUE_SCALE_EXT */
+ { 32094, 0x000080D1 }, /* GL_POST_CONVOLUTION_COLOR_TABLE */
+ { 32126, 0x00008021 }, /* GL_POST_CONVOLUTION_GREEN_BIAS */
+ { 32157, 0x00008021 }, /* GL_POST_CONVOLUTION_GREEN_BIAS_EXT */
+ { 32192, 0x0000801D }, /* GL_POST_CONVOLUTION_GREEN_SCALE */
+ { 32224, 0x0000801D }, /* GL_POST_CONVOLUTION_GREEN_SCALE_EXT */
+ { 32260, 0x00008020 }, /* GL_POST_CONVOLUTION_RED_BIAS */
+ { 32289, 0x00008020 }, /* GL_POST_CONVOLUTION_RED_BIAS_EXT */
+ { 32322, 0x0000801C }, /* GL_POST_CONVOLUTION_RED_SCALE */
+ { 32352, 0x0000801C }, /* GL_POST_CONVOLUTION_RED_SCALE_EXT */
+ { 32386, 0x0000817B }, /* GL_POST_TEXTURE_FILTER_BIAS_RANGE_SGIX */
+ { 32425, 0x00008179 }, /* GL_POST_TEXTURE_FILTER_BIAS_SGIX */
+ { 32458, 0x0000817C }, /* GL_POST_TEXTURE_FILTER_SCALE_RANGE_SGIX */
+ { 32498, 0x0000817A }, /* GL_POST_TEXTURE_FILTER_SCALE_SGIX */
+ { 32532, 0x00008578 }, /* GL_PREVIOUS */
+ { 32544, 0x00008578 }, /* GL_PREVIOUS_ARB */
+ { 32560, 0x00008578 }, /* GL_PREVIOUS_EXT */
+ { 32576, 0x00008577 }, /* GL_PRIMARY_COLOR */
+ { 32593, 0x00008577 }, /* GL_PRIMARY_COLOR_ARB */
+ { 32614, 0x00008577 }, /* GL_PRIMARY_COLOR_EXT */
+ { 32635, 0x00008C87 }, /* GL_PRIMITIVES_GENERATED */
+ { 32659, 0x00008C87 }, /* GL_PRIMITIVES_GENERATED_EXT */
+ { 32687, 0x00008F9D }, /* GL_PRIMITIVE_RESTART */
+ { 32708, 0x00008F9E }, /* GL_PRIMITIVE_RESTART_INDEX */
+ { 32735, 0x00008559 }, /* GL_PRIMITIVE_RESTART_INDEX_NV */
+ { 32765, 0x00008558 }, /* GL_PRIMITIVE_RESTART_NV */
+ { 32789, 0x000088B0 }, /* GL_PROGRAM_ADDRESS_REGISTERS_ARB */
+ { 32822, 0x00008805 }, /* GL_PROGRAM_ALU_INSTRUCTIONS_ARB */
+ { 32854, 0x000088AC }, /* GL_PROGRAM_ATTRIBS_ARB */
+ { 32877, 0x000087FF }, /* GL_PROGRAM_BINARY_FORMATS_OES */
+ { 32907, 0x00008741 }, /* GL_PROGRAM_BINARY_LENGTH_OES */
+ { 32936, 0x00008677 }, /* GL_PROGRAM_BINDING_ARB */
+ { 32959, 0x0000864B }, /* GL_PROGRAM_ERROR_POSITION_ARB */
+ { 32989, 0x0000864B }, /* GL_PROGRAM_ERROR_POSITION_NV */
+ { 33018, 0x00008874 }, /* GL_PROGRAM_ERROR_STRING_ARB */
+ { 33046, 0x00008876 }, /* GL_PROGRAM_FORMAT_ARB */
+ { 33068, 0x00008875 }, /* GL_PROGRAM_FORMAT_ASCII_ARB */
+ { 33096, 0x000088A0 }, /* GL_PROGRAM_INSTRUCTIONS_ARB */
+ { 33124, 0x00008627 }, /* GL_PROGRAM_LENGTH_ARB */
+ { 33146, 0x00008627 }, /* GL_PROGRAM_LENGTH_NV */
+ { 33167, 0x000088B2 }, /* GL_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB */
+ { 33207, 0x00008808 }, /* GL_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB */
+ { 33246, 0x000088AE }, /* GL_PROGRAM_NATIVE_ATTRIBS_ARB */
+ { 33276, 0x000088A2 }, /* GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB */
+ { 33311, 0x000088AA }, /* GL_PROGRAM_NATIVE_PARAMETERS_ARB */
+ { 33344, 0x000088A6 }, /* GL_PROGRAM_NATIVE_TEMPORARIES_ARB */
+ { 33378, 0x0000880A }, /* GL_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB */
+ { 33417, 0x00008809 }, /* GL_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB */
+ { 33456, 0x00008B40 }, /* GL_PROGRAM_OBJECT_ARB */
+ { 33478, 0x000088A8 }, /* GL_PROGRAM_PARAMETERS_ARB */
+ { 33504, 0x00008644 }, /* GL_PROGRAM_PARAMETER_NV */
+ { 33528, 0x00008642 }, /* GL_PROGRAM_POINT_SIZE */
+ { 33550, 0x00008642 }, /* GL_PROGRAM_POINT_SIZE_ARB */
+ { 33576, 0x00008647 }, /* GL_PROGRAM_RESIDENT_NV */
+ { 33599, 0x00008628 }, /* GL_PROGRAM_STRING_ARB */
+ { 33621, 0x00008628 }, /* GL_PROGRAM_STRING_NV */
+ { 33642, 0x00008646 }, /* GL_PROGRAM_TARGET_NV */
+ { 33663, 0x000088A4 }, /* GL_PROGRAM_TEMPORARIES_ARB */
+ { 33690, 0x00008807 }, /* GL_PROGRAM_TEX_INDIRECTIONS_ARB */
+ { 33722, 0x00008806 }, /* GL_PROGRAM_TEX_INSTRUCTIONS_ARB */
+ { 33754, 0x000088B6 }, /* GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB */
+ { 33789, 0x00001701 }, /* GL_PROJECTION */
+ { 33803, 0x00000BA7 }, /* GL_PROJECTION_MATRIX */
+ { 33824, 0x0000898E }, /* GL_PROJECTION_MATRIX_FLOAT_AS_INT_BITS_OES */
+ { 33867, 0x00000BA4 }, /* GL_PROJECTION_STACK_DEPTH */
+ { 33893, 0x00008E4F }, /* GL_PROVOKING_VERTEX */
+ { 33913, 0x00008E4F }, /* GL_PROVOKING_VERTEX_EXT */
+ { 33937, 0x000080D3 }, /* GL_PROXY_COLOR_TABLE */
+ { 33958, 0x00008025 }, /* GL_PROXY_HISTOGRAM */
+ { 33977, 0x00008025 }, /* GL_PROXY_HISTOGRAM_EXT */
+ { 34000, 0x000080D5 }, /* GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE */
+ { 34039, 0x000080D4 }, /* GL_PROXY_POST_CONVOLUTION_COLOR_TABLE */
+ { 34077, 0x00008063 }, /* GL_PROXY_TEXTURE_1D */
+ { 34097, 0x00008C19 }, /* GL_PROXY_TEXTURE_1D_ARRAY */
+ { 34123, 0x00008C19 }, /* GL_PROXY_TEXTURE_1D_ARRAY_EXT */
+ { 34153, 0x00008063 }, /* GL_PROXY_TEXTURE_1D_EXT */
+ { 34177, 0x00008064 }, /* GL_PROXY_TEXTURE_2D */
+ { 34197, 0x00008C1B }, /* GL_PROXY_TEXTURE_2D_ARRAY */
+ { 34223, 0x00008C1B }, /* GL_PROXY_TEXTURE_2D_ARRAY_EXT */
+ { 34253, 0x00008064 }, /* GL_PROXY_TEXTURE_2D_EXT */
+ { 34277, 0x00008070 }, /* GL_PROXY_TEXTURE_3D */
+ { 34297, 0x000080BD }, /* GL_PROXY_TEXTURE_COLOR_TABLE_SGI */
+ { 34330, 0x0000851B }, /* GL_PROXY_TEXTURE_CUBE_MAP */
+ { 34356, 0x0000851B }, /* GL_PROXY_TEXTURE_CUBE_MAP_ARB */
+ { 34386, 0x000084F7 }, /* GL_PROXY_TEXTURE_RECTANGLE */
+ { 34413, 0x000084F7 }, /* GL_PROXY_TEXTURE_RECTANGLE_ARB */
+ { 34444, 0x000084F7 }, /* GL_PROXY_TEXTURE_RECTANGLE_NV */
+ { 34474, 0x00008A1D }, /* GL_PURGEABLE_APPLE */
+ { 34493, 0x00002003 }, /* GL_Q */
+ { 34498, 0x00001209 }, /* GL_QUADRATIC_ATTENUATION */
+ { 34523, 0x00000007 }, /* GL_QUADS */
+ { 34532, 0x00008E4C }, /* GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION */
+ { 34576, 0x00008E4C }, /* GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION_EXT */
+ { 34624, 0x00008614 }, /* GL_QUAD_MESH_SUN */
+ { 34641, 0x00000008 }, /* GL_QUAD_STRIP */
+ { 34655, 0x00008E16 }, /* GL_QUERY_BY_REGION_NO_WAIT */
+ { 34682, 0x00008E16 }, /* GL_QUERY_BY_REGION_NO_WAIT_NV */
+ { 34712, 0x00008E15 }, /* GL_QUERY_BY_REGION_WAIT */
+ { 34736, 0x00008E15 }, /* GL_QUERY_BY_REGION_WAIT_NV */
+ { 34763, 0x00008864 }, /* GL_QUERY_COUNTER_BITS */
+ { 34785, 0x00008864 }, /* GL_QUERY_COUNTER_BITS_ARB */
+ { 34811, 0x00008E14 }, /* GL_QUERY_NO_WAIT */
+ { 34828, 0x00008E14 }, /* GL_QUERY_NO_WAIT_NV */
+ { 34848, 0x00008866 }, /* GL_QUERY_RESULT */
+ { 34864, 0x00008866 }, /* GL_QUERY_RESULT_ARB */
+ { 34884, 0x00008867 }, /* GL_QUERY_RESULT_AVAILABLE */
+ { 34910, 0x00008867 }, /* GL_QUERY_RESULT_AVAILABLE_ARB */
+ { 34940, 0x00008E13 }, /* GL_QUERY_WAIT */
+ { 34954, 0x00008E13 }, /* GL_QUERY_WAIT_NV */
+ { 34971, 0x00002002 }, /* GL_R */
+ { 34976, 0x00008C3A }, /* GL_R11F_G11F_B10F */
+ { 34994, 0x00008F98 }, /* GL_R16_SNORM */
+ { 35007, 0x00002A10 }, /* GL_R3_G3_B2 */
+ { 35019, 0x00008F94 }, /* GL_R8_SNORM */
+ { 35031, 0x00008C89 }, /* GL_RASTERIZER_DISCARD */
+ { 35053, 0x00008C89 }, /* GL_RASTERIZER_DISCARD_EXT */
+ { 35079, 0x00019262 }, /* GL_RASTER_POSITION_UNCLIPPED_IBM */
+ { 35112, 0x00000C02 }, /* GL_READ_BUFFER */
+ { 35127, 0x00008CA8 }, /* GL_READ_FRAMEBUFFER */
+ { 35147, 0x00008CAA }, /* GL_READ_FRAMEBUFFER_BINDING */
+ { 35175, 0x00008CAA }, /* GL_READ_FRAMEBUFFER_BINDING_EXT */
+ { 35207, 0x00008CA8 }, /* GL_READ_FRAMEBUFFER_EXT */
+ { 35231, 0x000088B8 }, /* GL_READ_ONLY */
+ { 35244, 0x000088B8 }, /* GL_READ_ONLY_ARB */
+ { 35261, 0x000088BA }, /* GL_READ_WRITE */
+ { 35275, 0x000088BA }, /* GL_READ_WRITE_ARB */
+ { 35293, 0x00001903 }, /* GL_RED */
+ { 35300, 0x00008016 }, /* GL_REDUCE */
+ { 35310, 0x00008016 }, /* GL_REDUCE_EXT */
+ { 35324, 0x00000D15 }, /* GL_RED_BIAS */
+ { 35336, 0x00000D52 }, /* GL_RED_BITS */
+ { 35348, 0x00008D94 }, /* GL_RED_INTEGER */
+ { 35363, 0x00008D94 }, /* GL_RED_INTEGER_EXT */
+ { 35382, 0x00000D14 }, /* GL_RED_SCALE */
+ { 35395, 0x00008F90 }, /* GL_RED_SNORM */
+ { 35408, 0x00008512 }, /* GL_REFLECTION_MAP */
+ { 35426, 0x00008512 }, /* GL_REFLECTION_MAP_ARB */
+ { 35448, 0x00008512 }, /* GL_REFLECTION_MAP_NV */
+ { 35469, 0x00008512 }, /* GL_REFLECTION_MAP_OES */
+ { 35491, 0x00008A19 }, /* GL_RELEASED_APPLE */
+ { 35509, 0x00001C00 }, /* GL_RENDER */
+ { 35519, 0x00008D41 }, /* GL_RENDERBUFFER */
+ { 35535, 0x00008D53 }, /* GL_RENDERBUFFER_ALPHA_SIZE */
+ { 35562, 0x00008D53 }, /* GL_RENDERBUFFER_ALPHA_SIZE_OES */
+ { 35593, 0x00008CA7 }, /* GL_RENDERBUFFER_BINDING */
+ { 35617, 0x00008CA7 }, /* GL_RENDERBUFFER_BINDING_EXT */
+ { 35645, 0x00008CA7 }, /* GL_RENDERBUFFER_BINDING_OES */
+ { 35673, 0x00008D52 }, /* GL_RENDERBUFFER_BLUE_SIZE */
+ { 35699, 0x00008D52 }, /* GL_RENDERBUFFER_BLUE_SIZE_OES */
+ { 35729, 0x00008D54 }, /* GL_RENDERBUFFER_DEPTH_SIZE */
+ { 35756, 0x00008D54 }, /* GL_RENDERBUFFER_DEPTH_SIZE_OES */
+ { 35787, 0x00008D41 }, /* GL_RENDERBUFFER_EXT */
+ { 35807, 0x00008D51 }, /* GL_RENDERBUFFER_GREEN_SIZE */
+ { 35834, 0x00008D51 }, /* GL_RENDERBUFFER_GREEN_SIZE_OES */
+ { 35865, 0x00008D43 }, /* GL_RENDERBUFFER_HEIGHT */
+ { 35888, 0x00008D43 }, /* GL_RENDERBUFFER_HEIGHT_EXT */
+ { 35915, 0x00008D43 }, /* GL_RENDERBUFFER_HEIGHT_OES */
+ { 35942, 0x00008D44 }, /* GL_RENDERBUFFER_INTERNAL_FORMAT */
+ { 35974, 0x00008D44 }, /* GL_RENDERBUFFER_INTERNAL_FORMAT_EXT */
+ { 36010, 0x00008D44 }, /* GL_RENDERBUFFER_INTERNAL_FORMAT_OES */
+ { 36046, 0x00008D41 }, /* GL_RENDERBUFFER_OES */
+ { 36066, 0x00008D50 }, /* GL_RENDERBUFFER_RED_SIZE */
+ { 36091, 0x00008D50 }, /* GL_RENDERBUFFER_RED_SIZE_OES */
+ { 36120, 0x00008CAB }, /* GL_RENDERBUFFER_SAMPLES */
+ { 36144, 0x00008CAB }, /* GL_RENDERBUFFER_SAMPLES_EXT */
+ { 36172, 0x00008D55 }, /* GL_RENDERBUFFER_STENCIL_SIZE */
+ { 36201, 0x00008D55 }, /* GL_RENDERBUFFER_STENCIL_SIZE_OES */
+ { 36234, 0x00008D42 }, /* GL_RENDERBUFFER_WIDTH */
+ { 36256, 0x00008D42 }, /* GL_RENDERBUFFER_WIDTH_EXT */
+ { 36282, 0x00008D42 }, /* GL_RENDERBUFFER_WIDTH_OES */
+ { 36308, 0x00001F01 }, /* GL_RENDERER */
+ { 36320, 0x00000C40 }, /* GL_RENDER_MODE */
+ { 36335, 0x00002901 }, /* GL_REPEAT */
+ { 36345, 0x00001E01 }, /* GL_REPLACE */
+ { 36356, 0x00008062 }, /* GL_REPLACE_EXT */
+ { 36371, 0x00008153 }, /* GL_REPLICATE_BORDER_HP */
+ { 36394, 0x0000803A }, /* GL_RESCALE_NORMAL */
+ { 36412, 0x0000803A }, /* GL_RESCALE_NORMAL_EXT */
+ { 36434, 0x00008256 }, /* GL_RESET_NOTIFICATION_STRATEGY_ARB */
+ { 36469, 0x00008A1B }, /* GL_RETAINED_APPLE */
+ { 36487, 0x00000102 }, /* GL_RETURN */
+ { 36497, 0x00008F99 }, /* GL_RG16_SNORM */
+ { 36511, 0x00008F95 }, /* GL_RG8_SNORM */
+ { 36524, 0x00001907 }, /* GL_RGB */
+ { 36531, 0x00008052 }, /* GL_RGB10 */
+ { 36540, 0x00008059 }, /* GL_RGB10_A2 */
+ { 36552, 0x00008059 }, /* GL_RGB10_A2_EXT */
+ { 36568, 0x00008052 }, /* GL_RGB10_EXT */
+ { 36581, 0x00008053 }, /* GL_RGB12 */
+ { 36590, 0x00008053 }, /* GL_RGB12_EXT */
+ { 36603, 0x00008054 }, /* GL_RGB16 */
+ { 36612, 0x0000881B }, /* GL_RGB16F */
+ { 36622, 0x00008D89 }, /* GL_RGB16I */
+ { 36632, 0x00008D89 }, /* GL_RGB16I_EXT */
+ { 36646, 0x00008D77 }, /* GL_RGB16UI */
+ { 36657, 0x00008D77 }, /* GL_RGB16UI_EXT */
+ { 36672, 0x00008054 }, /* GL_RGB16_EXT */
+ { 36685, 0x00008F9A }, /* GL_RGB16_SNORM */
+ { 36700, 0x0000804E }, /* GL_RGB2_EXT */
+ { 36712, 0x00008815 }, /* GL_RGB32F */
+ { 36722, 0x00008D83 }, /* GL_RGB32I */
+ { 36732, 0x00008D83 }, /* GL_RGB32I_EXT */
+ { 36746, 0x00008D71 }, /* GL_RGB32UI */
+ { 36757, 0x00008D71 }, /* GL_RGB32UI_EXT */
+ { 36772, 0x0000804F }, /* GL_RGB4 */
+ { 36780, 0x0000804F }, /* GL_RGB4_EXT */
+ { 36792, 0x000083A1 }, /* GL_RGB4_S3TC */
+ { 36805, 0x00008050 }, /* GL_RGB5 */
+ { 36813, 0x00008D62 }, /* GL_RGB565 */
+ { 36823, 0x00008D62 }, /* GL_RGB565_OES */
+ { 36837, 0x00008057 }, /* GL_RGB5_A1 */
+ { 36848, 0x00008057 }, /* GL_RGB5_A1_EXT */
+ { 36863, 0x00008057 }, /* GL_RGB5_A1_OES */
+ { 36878, 0x00008050 }, /* GL_RGB5_EXT */
+ { 36890, 0x00008051 }, /* GL_RGB8 */
+ { 36898, 0x00008D8F }, /* GL_RGB8I */
+ { 36907, 0x00008D8F }, /* GL_RGB8I_EXT */
+ { 36920, 0x00008D7D }, /* GL_RGB8UI */
+ { 36930, 0x00008D7D }, /* GL_RGB8UI_EXT */
+ { 36944, 0x00008051 }, /* GL_RGB8_EXT */
+ { 36956, 0x00008051 }, /* GL_RGB8_OES */
+ { 36968, 0x00008F96 }, /* GL_RGB8_SNORM */
+ { 36982, 0x00008C3D }, /* GL_RGB9_E5 */
+ { 36993, 0x00001908 }, /* GL_RGBA */
+ { 37001, 0x0000805A }, /* GL_RGBA12 */
+ { 37011, 0x0000805A }, /* GL_RGBA12_EXT */
+ { 37025, 0x0000805B }, /* GL_RGBA16 */
+ { 37035, 0x0000881A }, /* GL_RGBA16F */
+ { 37046, 0x00008D88 }, /* GL_RGBA16I */
+ { 37057, 0x00008D88 }, /* GL_RGBA16I_EXT */
+ { 37072, 0x00008D76 }, /* GL_RGBA16UI */
+ { 37084, 0x00008D76 }, /* GL_RGBA16UI_EXT */
+ { 37100, 0x0000805B }, /* GL_RGBA16_EXT */
+ { 37114, 0x00008F9B }, /* GL_RGBA16_SNORM */
+ { 37130, 0x00008055 }, /* GL_RGBA2 */
+ { 37139, 0x00008055 }, /* GL_RGBA2_EXT */
+ { 37152, 0x00008814 }, /* GL_RGBA32F */
+ { 37163, 0x00008D82 }, /* GL_RGBA32I */
+ { 37174, 0x00008D82 }, /* GL_RGBA32I_EXT */
+ { 37189, 0x00008D70 }, /* GL_RGBA32UI */
+ { 37201, 0x00008D70 }, /* GL_RGBA32UI_EXT */
+ { 37217, 0x00008056 }, /* GL_RGBA4 */
+ { 37226, 0x000083A5 }, /* GL_RGBA4_DXT5_S3TC */
+ { 37245, 0x00008056 }, /* GL_RGBA4_EXT */
+ { 37258, 0x00008056 }, /* GL_RGBA4_OES */
+ { 37271, 0x000083A3 }, /* GL_RGBA4_S3TC */
+ { 37285, 0x00008058 }, /* GL_RGBA8 */
+ { 37294, 0x00008D8E }, /* GL_RGBA8I */
+ { 37304, 0x00008D8E }, /* GL_RGBA8I_EXT */
+ { 37318, 0x00008D7C }, /* GL_RGBA8UI */
+ { 37329, 0x00008D7C }, /* GL_RGBA8UI_EXT */
+ { 37344, 0x00008058 }, /* GL_RGBA8_EXT */
+ { 37357, 0x00008058 }, /* GL_RGBA8_OES */
+ { 37370, 0x00008F97 }, /* GL_RGBA8_SNORM */
+ { 37385, 0x000083A4 }, /* GL_RGBA_DXT5_S3TC */
+ { 37403, 0x00008820 }, /* GL_RGBA_FLOAT_MODE_ARB */
+ { 37426, 0x00008D99 }, /* GL_RGBA_INTEGER */
+ { 37442, 0x00008D99 }, /* GL_RGBA_INTEGER_EXT */
+ { 37462, 0x00008D9E }, /* GL_RGBA_INTEGER_MODE_EXT */
+ { 37487, 0x00000C31 }, /* GL_RGBA_MODE */
+ { 37500, 0x000083A2 }, /* GL_RGBA_S3TC */
+ { 37513, 0x00008F93 }, /* GL_RGBA_SNORM */
+ { 37527, 0x00008D98 }, /* GL_RGB_INTEGER */
+ { 37542, 0x00008D98 }, /* GL_RGB_INTEGER_EXT */
+ { 37561, 0x000083A0 }, /* GL_RGB_S3TC */
+ { 37573, 0x00008573 }, /* GL_RGB_SCALE */
+ { 37586, 0x00008573 }, /* GL_RGB_SCALE_ARB */
+ { 37603, 0x00008573 }, /* GL_RGB_SCALE_EXT */
+ { 37620, 0x00008F92 }, /* GL_RGB_SNORM */
+ { 37633, 0x00008F91 }, /* GL_RG_SNORM */
+ { 37645, 0x00000407 }, /* GL_RIGHT */
+ { 37654, 0x00002000 }, /* GL_S */
+ { 37659, 0x00008B5D }, /* GL_SAMPLER_1D */
+ { 37673, 0x00008DC0 }, /* GL_SAMPLER_1D_ARRAY */
+ { 37693, 0x00008DC0 }, /* GL_SAMPLER_1D_ARRAY_EXT */
+ { 37717, 0x00008DC3 }, /* GL_SAMPLER_1D_ARRAY_SHADOW */
+ { 37744, 0x00008DC3 }, /* GL_SAMPLER_1D_ARRAY_SHADOW_EXT */
+ { 37775, 0x00008B61 }, /* GL_SAMPLER_1D_SHADOW */
+ { 37796, 0x00008B5E }, /* GL_SAMPLER_2D */
+ { 37810, 0x00008DC1 }, /* GL_SAMPLER_2D_ARRAY */
+ { 37830, 0x00008DC1 }, /* GL_SAMPLER_2D_ARRAY_EXT */
+ { 37854, 0x00008DC4 }, /* GL_SAMPLER_2D_ARRAY_SHADOW */
+ { 37881, 0x00008DC4 }, /* GL_SAMPLER_2D_ARRAY_SHADOW_EXT */
+ { 37912, 0x00008B63 }, /* GL_SAMPLER_2D_RECT */
+ { 37931, 0x00008B64 }, /* GL_SAMPLER_2D_RECT_SHADOW */
+ { 37957, 0x00008B62 }, /* GL_SAMPLER_2D_SHADOW */
+ { 37978, 0x00008B5F }, /* GL_SAMPLER_3D */
+ { 37992, 0x00008B5F }, /* GL_SAMPLER_3D_OES */
+ { 38010, 0x00008919 }, /* GL_SAMPLER_BINDING */
+ { 38029, 0x00008DC2 }, /* GL_SAMPLER_BUFFER */
+ { 38047, 0x00008DC2 }, /* GL_SAMPLER_BUFFER_EXT */
+ { 38069, 0x00008B60 }, /* GL_SAMPLER_CUBE */
+ { 38085, 0x00008DC5 }, /* GL_SAMPLER_CUBE_SHADOW */
+ { 38108, 0x00008DC5 }, /* GL_SAMPLER_CUBE_SHADOW_EXT */
+ { 38135, 0x000080A9 }, /* GL_SAMPLES */
+ { 38146, 0x000086B4 }, /* GL_SAMPLES_3DFX */
+ { 38162, 0x000080A9 }, /* GL_SAMPLES_ARB */
+ { 38177, 0x00008914 }, /* GL_SAMPLES_PASSED */
+ { 38195, 0x00008914 }, /* GL_SAMPLES_PASSED_ARB */
+ { 38217, 0x0000809E }, /* GL_SAMPLE_ALPHA_TO_COVERAGE */
+ { 38245, 0x0000809E }, /* GL_SAMPLE_ALPHA_TO_COVERAGE_ARB */
+ { 38277, 0x0000809F }, /* GL_SAMPLE_ALPHA_TO_ONE */
+ { 38300, 0x0000809F }, /* GL_SAMPLE_ALPHA_TO_ONE_ARB */
+ { 38327, 0x000080A8 }, /* GL_SAMPLE_BUFFERS */
+ { 38345, 0x000086B3 }, /* GL_SAMPLE_BUFFERS_3DFX */
+ { 38368, 0x000080A8 }, /* GL_SAMPLE_BUFFERS_ARB */
+ { 38390, 0x000080A0 }, /* GL_SAMPLE_COVERAGE */
+ { 38409, 0x000080A0 }, /* GL_SAMPLE_COVERAGE_ARB */
+ { 38432, 0x000080AB }, /* GL_SAMPLE_COVERAGE_INVERT */
+ { 38458, 0x000080AB }, /* GL_SAMPLE_COVERAGE_INVERT_ARB */
+ { 38488, 0x000080AA }, /* GL_SAMPLE_COVERAGE_VALUE */
+ { 38513, 0x000080AA }, /* GL_SAMPLE_COVERAGE_VALUE_ARB */
+ { 38542, 0x00080000 }, /* GL_SCISSOR_BIT */
+ { 38557, 0x00000C10 }, /* GL_SCISSOR_BOX */
+ { 38572, 0x00000C11 }, /* GL_SCISSOR_TEST */
+ { 38588, 0x0000845E }, /* GL_SECONDARY_COLOR_ARRAY */
+ { 38613, 0x0000889C }, /* GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING */
+ { 38653, 0x0000889C }, /* GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB */
+ { 38697, 0x0000845D }, /* GL_SECONDARY_COLOR_ARRAY_POINTER */
+ { 38730, 0x0000845A }, /* GL_SECONDARY_COLOR_ARRAY_SIZE */
+ { 38760, 0x0000845C }, /* GL_SECONDARY_COLOR_ARRAY_STRIDE */
+ { 38792, 0x0000845B }, /* GL_SECONDARY_COLOR_ARRAY_TYPE */
+ { 38822, 0x00001C02 }, /* GL_SELECT */
+ { 38832, 0x00000DF3 }, /* GL_SELECTION_BUFFER_POINTER */
+ { 38860, 0x00000DF4 }, /* GL_SELECTION_BUFFER_SIZE */
+ { 38885, 0x00008012 }, /* GL_SEPARABLE_2D */
+ { 38901, 0x00008C8D }, /* GL_SEPARATE_ATTRIBS */
+ { 38921, 0x00008C8D }, /* GL_SEPARATE_ATTRIBS_EXT */
+ { 38945, 0x000081FA }, /* GL_SEPARATE_SPECULAR_COLOR */
+ { 38972, 0x000081FA }, /* GL_SEPARATE_SPECULAR_COLOR_EXT */
+ { 39003, 0x0000150F }, /* GL_SET */
+ { 39010, 0x00008DF8 }, /* GL_SHADER_BINARY_FORMATS */
+ { 39035, 0x00008DFA }, /* GL_SHADER_COMPILER */
+ { 39054, 0x00008B48 }, /* GL_SHADER_OBJECT_ARB */
+ { 39075, 0x00008B88 }, /* GL_SHADER_SOURCE_LENGTH */
+ { 39099, 0x00008B4F }, /* GL_SHADER_TYPE */
+ { 39114, 0x00000B54 }, /* GL_SHADE_MODEL */
+ { 39129, 0x00008B8C }, /* GL_SHADING_LANGUAGE_VERSION */
+ { 39157, 0x000080BF }, /* GL_SHADOW_AMBIENT_SGIX */
+ { 39180, 0x000081FB }, /* GL_SHARED_TEXTURE_PALETTE_EXT */
+ { 39210, 0x00001601 }, /* GL_SHININESS */
+ { 39223, 0x00001402 }, /* GL_SHORT */
+ { 39232, 0x00009119 }, /* GL_SIGNALED */
+ { 39244, 0x00008F9C }, /* GL_SIGNED_NORMALIZED */
+ { 39265, 0x000081F9 }, /* GL_SINGLE_COLOR */
+ { 39281, 0x000081F9 }, /* GL_SINGLE_COLOR_EXT */
+ { 39301, 0x000085CC }, /* GL_SLICE_ACCUM_SUN */
+ { 39320, 0x00008C46 }, /* GL_SLUMINANCE */
+ { 39334, 0x00008C47 }, /* GL_SLUMINANCE8 */
+ { 39349, 0x00008C45 }, /* GL_SLUMINANCE8_ALPHA8 */
+ { 39371, 0x00008C44 }, /* GL_SLUMINANCE_ALPHA */
+ { 39391, 0x00001D01 }, /* GL_SMOOTH */
+ { 39401, 0x00000B23 }, /* GL_SMOOTH_LINE_WIDTH_GRANULARITY */
+ { 39434, 0x00000B22 }, /* GL_SMOOTH_LINE_WIDTH_RANGE */
+ { 39461, 0x00000B13 }, /* GL_SMOOTH_POINT_SIZE_GRANULARITY */
+ { 39494, 0x00000B12 }, /* GL_SMOOTH_POINT_SIZE_RANGE */
+ { 39521, 0x00008588 }, /* GL_SOURCE0_ALPHA */
+ { 39538, 0x00008588 }, /* GL_SOURCE0_ALPHA_ARB */
+ { 39559, 0x00008588 }, /* GL_SOURCE0_ALPHA_EXT */
+ { 39580, 0x00008580 }, /* GL_SOURCE0_RGB */
+ { 39595, 0x00008580 }, /* GL_SOURCE0_RGB_ARB */
+ { 39614, 0x00008580 }, /* GL_SOURCE0_RGB_EXT */
+ { 39633, 0x00008589 }, /* GL_SOURCE1_ALPHA */
+ { 39650, 0x00008589 }, /* GL_SOURCE1_ALPHA_ARB */
+ { 39671, 0x00008589 }, /* GL_SOURCE1_ALPHA_EXT */
+ { 39692, 0x00008581 }, /* GL_SOURCE1_RGB */
+ { 39707, 0x00008581 }, /* GL_SOURCE1_RGB_ARB */
+ { 39726, 0x00008581 }, /* GL_SOURCE1_RGB_EXT */
+ { 39745, 0x0000858A }, /* GL_SOURCE2_ALPHA */
+ { 39762, 0x0000858A }, /* GL_SOURCE2_ALPHA_ARB */
+ { 39783, 0x0000858A }, /* GL_SOURCE2_ALPHA_EXT */
+ { 39804, 0x00008582 }, /* GL_SOURCE2_RGB */
+ { 39819, 0x00008582 }, /* GL_SOURCE2_RGB_ARB */
+ { 39838, 0x00008582 }, /* GL_SOURCE2_RGB_EXT */
+ { 39857, 0x0000858B }, /* GL_SOURCE3_ALPHA_NV */
+ { 39877, 0x00008583 }, /* GL_SOURCE3_RGB_NV */
+ { 39895, 0x00001202 }, /* GL_SPECULAR */
+ { 39907, 0x00002402 }, /* GL_SPHERE_MAP */
+ { 39921, 0x00001206 }, /* GL_SPOT_CUTOFF */
+ { 39936, 0x00001204 }, /* GL_SPOT_DIRECTION */
+ { 39954, 0x00001205 }, /* GL_SPOT_EXPONENT */
+ { 39971, 0x00008588 }, /* GL_SRC0_ALPHA */
+ { 39985, 0x00008580 }, /* GL_SRC0_RGB */
+ { 39997, 0x00008589 }, /* GL_SRC1_ALPHA */
+ { 40011, 0x00008581 }, /* GL_SRC1_RGB */
+ { 40023, 0x0000858A }, /* GL_SRC2_ALPHA */
+ { 40037, 0x00008582 }, /* GL_SRC2_RGB */
+ { 40049, 0x00000302 }, /* GL_SRC_ALPHA */
+ { 40062, 0x00000308 }, /* GL_SRC_ALPHA_SATURATE */
+ { 40084, 0x00000300 }, /* GL_SRC_COLOR */
+ { 40097, 0x00008C40 }, /* GL_SRGB */
+ { 40105, 0x00008C41 }, /* GL_SRGB8 */
+ { 40114, 0x00008C43 }, /* GL_SRGB8_ALPHA8 */
+ { 40130, 0x00008C42 }, /* GL_SRGB_ALPHA */
+ { 40144, 0x00000503 }, /* GL_STACK_OVERFLOW */
+ { 40162, 0x00000504 }, /* GL_STACK_UNDERFLOW */
+ { 40181, 0x000088E6 }, /* GL_STATIC_COPY */
+ { 40196, 0x000088E6 }, /* GL_STATIC_COPY_ARB */
+ { 40215, 0x000088E4 }, /* GL_STATIC_DRAW */
+ { 40230, 0x000088E4 }, /* GL_STATIC_DRAW_ARB */
+ { 40249, 0x000088E5 }, /* GL_STATIC_READ */
+ { 40264, 0x000088E5 }, /* GL_STATIC_READ_ARB */
+ { 40283, 0x00001802 }, /* GL_STENCIL */
+ { 40294, 0x00008D20 }, /* GL_STENCIL_ATTACHMENT */
+ { 40316, 0x00008D20 }, /* GL_STENCIL_ATTACHMENT_EXT */
+ { 40342, 0x00008D20 }, /* GL_STENCIL_ATTACHMENT_OES */
+ { 40368, 0x00008801 }, /* GL_STENCIL_BACK_FAIL */
+ { 40389, 0x00008801 }, /* GL_STENCIL_BACK_FAIL_ATI */
+ { 40414, 0x00008800 }, /* GL_STENCIL_BACK_FUNC */
+ { 40435, 0x00008800 }, /* GL_STENCIL_BACK_FUNC_ATI */
+ { 40460, 0x00008802 }, /* GL_STENCIL_BACK_PASS_DEPTH_FAIL */
+ { 40492, 0x00008802 }, /* GL_STENCIL_BACK_PASS_DEPTH_FAIL_ATI */
+ { 40528, 0x00008803 }, /* GL_STENCIL_BACK_PASS_DEPTH_PASS */
+ { 40560, 0x00008803 }, /* GL_STENCIL_BACK_PASS_DEPTH_PASS_ATI */
+ { 40596, 0x00008CA3 }, /* GL_STENCIL_BACK_REF */
+ { 40616, 0x00008CA4 }, /* GL_STENCIL_BACK_VALUE_MASK */
+ { 40643, 0x00008CA5 }, /* GL_STENCIL_BACK_WRITEMASK */
+ { 40669, 0x00000D57 }, /* GL_STENCIL_BITS */
+ { 40685, 0x00008224 }, /* GL_STENCIL_BUFFER */
+ { 40703, 0x00000400 }, /* GL_STENCIL_BUFFER_BIT */
+ { 40725, 0x00000B91 }, /* GL_STENCIL_CLEAR_VALUE */
+ { 40748, 0x00000B94 }, /* GL_STENCIL_FAIL */
+ { 40764, 0x00000B92 }, /* GL_STENCIL_FUNC */
+ { 40780, 0x00001901 }, /* GL_STENCIL_INDEX */
+ { 40797, 0x00008D46 }, /* GL_STENCIL_INDEX1 */
+ { 40815, 0x00008D49 }, /* GL_STENCIL_INDEX16 */
+ { 40834, 0x00008D49 }, /* GL_STENCIL_INDEX16_EXT */
+ { 40857, 0x00008D46 }, /* GL_STENCIL_INDEX1_EXT */
+ { 40879, 0x00008D46 }, /* GL_STENCIL_INDEX1_OES */
+ { 40901, 0x00008D47 }, /* GL_STENCIL_INDEX4 */
+ { 40919, 0x00008D47 }, /* GL_STENCIL_INDEX4_EXT */
+ { 40941, 0x00008D47 }, /* GL_STENCIL_INDEX4_OES */
+ { 40963, 0x00008D48 }, /* GL_STENCIL_INDEX8 */
+ { 40981, 0x00008D48 }, /* GL_STENCIL_INDEX8_EXT */
+ { 41003, 0x00008D48 }, /* GL_STENCIL_INDEX8_OES */
+ { 41025, 0x00008D45 }, /* GL_STENCIL_INDEX_EXT */
+ { 41046, 0x00000B95 }, /* GL_STENCIL_PASS_DEPTH_FAIL */
+ { 41073, 0x00000B96 }, /* GL_STENCIL_PASS_DEPTH_PASS */
+ { 41100, 0x00000B97 }, /* GL_STENCIL_REF */
+ { 41115, 0x00000B90 }, /* GL_STENCIL_TEST */
+ { 41131, 0x00008910 }, /* GL_STENCIL_TEST_TWO_SIDE_EXT */
+ { 41160, 0x00000B93 }, /* GL_STENCIL_VALUE_MASK */
+ { 41182, 0x00000B98 }, /* GL_STENCIL_WRITEMASK */
+ { 41203, 0x00000C33 }, /* GL_STEREO */
+ { 41213, 0x000085BE }, /* GL_STORAGE_CACHED_APPLE */
+ { 41237, 0x000085BD }, /* GL_STORAGE_PRIVATE_APPLE */
+ { 41262, 0x000085BF }, /* GL_STORAGE_SHARED_APPLE */
+ { 41286, 0x000088E2 }, /* GL_STREAM_COPY */
+ { 41301, 0x000088E2 }, /* GL_STREAM_COPY_ARB */
+ { 41320, 0x000088E0 }, /* GL_STREAM_DRAW */
+ { 41335, 0x000088E0 }, /* GL_STREAM_DRAW_ARB */
+ { 41354, 0x000088E1 }, /* GL_STREAM_READ */
+ { 41369, 0x000088E1 }, /* GL_STREAM_READ_ARB */
+ { 41388, 0x00000D50 }, /* GL_SUBPIXEL_BITS */
+ { 41405, 0x000084E7 }, /* GL_SUBTRACT */
+ { 41417, 0x000084E7 }, /* GL_SUBTRACT_ARB */
+ { 41433, 0x00009113 }, /* GL_SYNC_CONDITION */
+ { 41451, 0x00009116 }, /* GL_SYNC_FENCE */
+ { 41465, 0x00009115 }, /* GL_SYNC_FLAGS */
+ { 41479, 0x00000001 }, /* GL_SYNC_FLUSH_COMMANDS_BIT */
+ { 41506, 0x00009117 }, /* GL_SYNC_GPU_COMMANDS_COMPLETE */
+ { 41536, 0x00009114 }, /* GL_SYNC_STATUS */
+ { 41551, 0x00002001 }, /* GL_T */
+ { 41556, 0x00002A2A }, /* GL_T2F_C3F_V3F */
+ { 41571, 0x00002A2C }, /* GL_T2F_C4F_N3F_V3F */
+ { 41590, 0x00002A29 }, /* GL_T2F_C4UB_V3F */
+ { 41606, 0x00002A2B }, /* GL_T2F_N3F_V3F */
+ { 41621, 0x00002A27 }, /* GL_T2F_V3F */
+ { 41632, 0x00002A2D }, /* GL_T4F_C4F_N3F_V4F */
+ { 41651, 0x00002A28 }, /* GL_T4F_V4F */
+ { 41662, 0x00008031 }, /* GL_TABLE_TOO_LARGE_EXT */
+ { 41685, 0x00001702 }, /* GL_TEXTURE */
+ { 41696, 0x000084C0 }, /* GL_TEXTURE0 */
+ { 41708, 0x000084C0 }, /* GL_TEXTURE0_ARB */
+ { 41724, 0x000084C1 }, /* GL_TEXTURE1 */
+ { 41736, 0x000084CA }, /* GL_TEXTURE10 */
+ { 41749, 0x000084CA }, /* GL_TEXTURE10_ARB */
+ { 41766, 0x000084CB }, /* GL_TEXTURE11 */
+ { 41779, 0x000084CB }, /* GL_TEXTURE11_ARB */
+ { 41796, 0x000084CC }, /* GL_TEXTURE12 */
+ { 41809, 0x000084CC }, /* GL_TEXTURE12_ARB */
+ { 41826, 0x000084CD }, /* GL_TEXTURE13 */
+ { 41839, 0x000084CD }, /* GL_TEXTURE13_ARB */
+ { 41856, 0x000084CE }, /* GL_TEXTURE14 */
+ { 41869, 0x000084CE }, /* GL_TEXTURE14_ARB */
+ { 41886, 0x000084CF }, /* GL_TEXTURE15 */
+ { 41899, 0x000084CF }, /* GL_TEXTURE15_ARB */
+ { 41916, 0x000084D0 }, /* GL_TEXTURE16 */
+ { 41929, 0x000084D0 }, /* GL_TEXTURE16_ARB */
+ { 41946, 0x000084D1 }, /* GL_TEXTURE17 */
+ { 41959, 0x000084D1 }, /* GL_TEXTURE17_ARB */
+ { 41976, 0x000084D2 }, /* GL_TEXTURE18 */
+ { 41989, 0x000084D2 }, /* GL_TEXTURE18_ARB */
+ { 42006, 0x000084D3 }, /* GL_TEXTURE19 */
+ { 42019, 0x000084D3 }, /* GL_TEXTURE19_ARB */
+ { 42036, 0x000084C1 }, /* GL_TEXTURE1_ARB */
+ { 42052, 0x000084C2 }, /* GL_TEXTURE2 */
+ { 42064, 0x000084D4 }, /* GL_TEXTURE20 */
+ { 42077, 0x000084D4 }, /* GL_TEXTURE20_ARB */
+ { 42094, 0x000084D5 }, /* GL_TEXTURE21 */
+ { 42107, 0x000084D5 }, /* GL_TEXTURE21_ARB */
+ { 42124, 0x000084D6 }, /* GL_TEXTURE22 */
+ { 42137, 0x000084D6 }, /* GL_TEXTURE22_ARB */
+ { 42154, 0x000084D7 }, /* GL_TEXTURE23 */
+ { 42167, 0x000084D7 }, /* GL_TEXTURE23_ARB */
+ { 42184, 0x000084D8 }, /* GL_TEXTURE24 */
+ { 42197, 0x000084D8 }, /* GL_TEXTURE24_ARB */
+ { 42214, 0x000084D9 }, /* GL_TEXTURE25 */
+ { 42227, 0x000084D9 }, /* GL_TEXTURE25_ARB */
+ { 42244, 0x000084DA }, /* GL_TEXTURE26 */
+ { 42257, 0x000084DA }, /* GL_TEXTURE26_ARB */
+ { 42274, 0x000084DB }, /* GL_TEXTURE27 */
+ { 42287, 0x000084DB }, /* GL_TEXTURE27_ARB */
+ { 42304, 0x000084DC }, /* GL_TEXTURE28 */
+ { 42317, 0x000084DC }, /* GL_TEXTURE28_ARB */
+ { 42334, 0x000084DD }, /* GL_TEXTURE29 */
+ { 42347, 0x000084DD }, /* GL_TEXTURE29_ARB */
+ { 42364, 0x000084C2 }, /* GL_TEXTURE2_ARB */
+ { 42380, 0x000084C3 }, /* GL_TEXTURE3 */
+ { 42392, 0x000084DE }, /* GL_TEXTURE30 */
+ { 42405, 0x000084DE }, /* GL_TEXTURE30_ARB */
+ { 42422, 0x000084DF }, /* GL_TEXTURE31 */
+ { 42435, 0x000084DF }, /* GL_TEXTURE31_ARB */
+ { 42452, 0x000084C3 }, /* GL_TEXTURE3_ARB */
+ { 42468, 0x000084C4 }, /* GL_TEXTURE4 */
+ { 42480, 0x000084C4 }, /* GL_TEXTURE4_ARB */
+ { 42496, 0x000084C5 }, /* GL_TEXTURE5 */
+ { 42508, 0x000084C5 }, /* GL_TEXTURE5_ARB */
+ { 42524, 0x000084C6 }, /* GL_TEXTURE6 */
+ { 42536, 0x000084C6 }, /* GL_TEXTURE6_ARB */
+ { 42552, 0x000084C7 }, /* GL_TEXTURE7 */
+ { 42564, 0x000084C7 }, /* GL_TEXTURE7_ARB */
+ { 42580, 0x000084C8 }, /* GL_TEXTURE8 */
+ { 42592, 0x000084C8 }, /* GL_TEXTURE8_ARB */
+ { 42608, 0x000084C9 }, /* GL_TEXTURE9 */
+ { 42620, 0x000084C9 }, /* GL_TEXTURE9_ARB */
+ { 42636, 0x00000DE0 }, /* GL_TEXTURE_1D */
+ { 42650, 0x00008C18 }, /* GL_TEXTURE_1D_ARRAY */
+ { 42670, 0x00008C18 }, /* GL_TEXTURE_1D_ARRAY_EXT */
+ { 42694, 0x00000DE1 }, /* GL_TEXTURE_2D */
+ { 42708, 0x00008C1A }, /* GL_TEXTURE_2D_ARRAY */
+ { 42728, 0x00008C1A }, /* GL_TEXTURE_2D_ARRAY_EXT */
+ { 42752, 0x0000806F }, /* GL_TEXTURE_3D */
+ { 42766, 0x0000806F }, /* GL_TEXTURE_3D_OES */
+ { 42784, 0x0000805F }, /* GL_TEXTURE_ALPHA_SIZE */
+ { 42806, 0x0000805F }, /* GL_TEXTURE_ALPHA_SIZE_EXT */
+ { 42832, 0x0000813C }, /* GL_TEXTURE_BASE_LEVEL */
+ { 42854, 0x00008068 }, /* GL_TEXTURE_BINDING_1D */
+ { 42876, 0x00008C1C }, /* GL_TEXTURE_BINDING_1D_ARRAY */
+ { 42904, 0x00008C1C }, /* GL_TEXTURE_BINDING_1D_ARRAY_EXT */
+ { 42936, 0x00008069 }, /* GL_TEXTURE_BINDING_2D */
+ { 42958, 0x00008C1D }, /* GL_TEXTURE_BINDING_2D_ARRAY */
+ { 42986, 0x00008C1D }, /* GL_TEXTURE_BINDING_2D_ARRAY_EXT */
+ { 43018, 0x0000806A }, /* GL_TEXTURE_BINDING_3D */
+ { 43040, 0x0000806A }, /* GL_TEXTURE_BINDING_3D_OES */
+ { 43066, 0x00008C2C }, /* GL_TEXTURE_BINDING_BUFFER */
+ { 43092, 0x00008C2C }, /* GL_TEXTURE_BINDING_BUFFER_ARB */
+ { 43122, 0x00008514 }, /* GL_TEXTURE_BINDING_CUBE_MAP */
+ { 43150, 0x00008514 }, /* GL_TEXTURE_BINDING_CUBE_MAP_ARB */
+ { 43182, 0x00008514 }, /* GL_TEXTURE_BINDING_CUBE_MAP_OES */
+ { 43214, 0x000084F6 }, /* GL_TEXTURE_BINDING_RECTANGLE */
+ { 43243, 0x000084F6 }, /* GL_TEXTURE_BINDING_RECTANGLE_ARB */
+ { 43276, 0x000084F6 }, /* GL_TEXTURE_BINDING_RECTANGLE_NV */
+ { 43308, 0x00040000 }, /* GL_TEXTURE_BIT */
+ { 43323, 0x0000805E }, /* GL_TEXTURE_BLUE_SIZE */
+ { 43344, 0x0000805E }, /* GL_TEXTURE_BLUE_SIZE_EXT */
+ { 43369, 0x00001005 }, /* GL_TEXTURE_BORDER */
+ { 43387, 0x00001004 }, /* GL_TEXTURE_BORDER_COLOR */
+ { 43411, 0x00008C2A }, /* GL_TEXTURE_BUFFER */
+ { 43429, 0x00008C2A }, /* GL_TEXTURE_BUFFER_ARB */
+ { 43451, 0x00008C2D }, /* GL_TEXTURE_BUFFER_DATA_STORE_BINDING */
+ { 43488, 0x00008C2D }, /* GL_TEXTURE_BUFFER_DATA_STORE_BINDING_ARB */
+ { 43529, 0x00008C2E }, /* GL_TEXTURE_BUFFER_FORMAT */
+ { 43554, 0x00008C2E }, /* GL_TEXTURE_BUFFER_FORMAT_ARB */
+ { 43583, 0x00008171 }, /* GL_TEXTURE_CLIPMAP_CENTER_SGIX */
+ { 43614, 0x00008176 }, /* GL_TEXTURE_CLIPMAP_DEPTH_SGIX */
+ { 43644, 0x00008172 }, /* GL_TEXTURE_CLIPMAP_FRAME_SGIX */
+ { 43674, 0x00008175 }, /* GL_TEXTURE_CLIPMAP_LOD_OFFSET_SGIX */
+ { 43709, 0x00008173 }, /* GL_TEXTURE_CLIPMAP_OFFSET_SGIX */
+ { 43740, 0x00008174 }, /* GL_TEXTURE_CLIPMAP_VIRTUAL_DEPTH_SGIX */
+ { 43778, 0x000080BC }, /* GL_TEXTURE_COLOR_TABLE_SGI */
+ { 43805, 0x000081EF }, /* GL_TEXTURE_COLOR_WRITEMASK_SGIS */
+ { 43837, 0x000080BF }, /* GL_TEXTURE_COMPARE_FAIL_VALUE_ARB */
+ { 43871, 0x0000884D }, /* GL_TEXTURE_COMPARE_FUNC */
+ { 43895, 0x0000884D }, /* GL_TEXTURE_COMPARE_FUNC_ARB */
+ { 43923, 0x0000884C }, /* GL_TEXTURE_COMPARE_MODE */
+ { 43947, 0x0000884C }, /* GL_TEXTURE_COMPARE_MODE_ARB */
+ { 43975, 0x0000819B }, /* GL_TEXTURE_COMPARE_OPERATOR_SGIX */
+ { 44008, 0x0000819A }, /* GL_TEXTURE_COMPARE_SGIX */
+ { 44032, 0x00001003 }, /* GL_TEXTURE_COMPONENTS */
+ { 44054, 0x000086A1 }, /* GL_TEXTURE_COMPRESSED */
+ { 44076, 0x000086A1 }, /* GL_TEXTURE_COMPRESSED_ARB */
+ { 44102, 0x000086A3 }, /* GL_TEXTURE_COMPRESSED_FORMATS_ARB */
+ { 44136, 0x000086A0 }, /* GL_TEXTURE_COMPRESSED_IMAGE_SIZE */
+ { 44169, 0x000086A0 }, /* GL_TEXTURE_COMPRESSED_IMAGE_SIZE_ARB */
+ { 44206, 0x000084EF }, /* GL_TEXTURE_COMPRESSION_HINT */
+ { 44234, 0x000084EF }, /* GL_TEXTURE_COMPRESSION_HINT_ARB */
+ { 44266, 0x00008078 }, /* GL_TEXTURE_COORD_ARRAY */
+ { 44289, 0x0000889A }, /* GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING */
+ { 44327, 0x0000889A }, /* GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB */
+ { 44369, 0x00008092 }, /* GL_TEXTURE_COORD_ARRAY_POINTER */
+ { 44400, 0x00008088 }, /* GL_TEXTURE_COORD_ARRAY_SIZE */
+ { 44428, 0x0000808A }, /* GL_TEXTURE_COORD_ARRAY_STRIDE */
+ { 44458, 0x00008089 }, /* GL_TEXTURE_COORD_ARRAY_TYPE */
+ { 44486, 0x00008B9D }, /* GL_TEXTURE_CROP_RECT_OES */
+ { 44511, 0x00008513 }, /* GL_TEXTURE_CUBE_MAP */
+ { 44531, 0x00008513 }, /* GL_TEXTURE_CUBE_MAP_ARB */
+ { 44555, 0x00008516 }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_X */
+ { 44586, 0x00008516 }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB */
+ { 44621, 0x00008516 }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_X_OES */
+ { 44656, 0x00008518 }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Y */
+ { 44687, 0x00008518 }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB */
+ { 44722, 0x00008518 }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_OES */
+ { 44757, 0x0000851A }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Z */
+ { 44788, 0x0000851A }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB */
+ { 44823, 0x0000851A }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_OES */
+ { 44858, 0x00008513 }, /* GL_TEXTURE_CUBE_MAP_OES */
+ { 44882, 0x00008515 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_X */
+ { 44913, 0x00008515 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB */
+ { 44948, 0x00008515 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_X_OES */
+ { 44983, 0x00008517 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Y */
+ { 45014, 0x00008517 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB */
+ { 45049, 0x00008517 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Y_OES */
+ { 45084, 0x00008519 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Z */
+ { 45115, 0x00008519 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB */
+ { 45150, 0x00008519 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Z_OES */
+ { 45185, 0x000088F4 }, /* GL_TEXTURE_CUBE_MAP_SEAMLESS */
+ { 45214, 0x00008071 }, /* GL_TEXTURE_DEPTH */
+ { 45231, 0x0000884A }, /* GL_TEXTURE_DEPTH_SIZE */
+ { 45253, 0x0000884A }, /* GL_TEXTURE_DEPTH_SIZE_ARB */
+ { 45279, 0x00002300 }, /* GL_TEXTURE_ENV */
+ { 45294, 0x00002201 }, /* GL_TEXTURE_ENV_COLOR */
+ { 45315, 0x00002200 }, /* GL_TEXTURE_ENV_MODE */
+ { 45335, 0x00008500 }, /* GL_TEXTURE_FILTER_CONTROL */
+ { 45361, 0x00008500 }, /* GL_TEXTURE_FILTER_CONTROL_EXT */
+ { 45391, 0x00002500 }, /* GL_TEXTURE_GEN_MODE */
+ { 45411, 0x00002500 }, /* GL_TEXTURE_GEN_MODE_OES */
+ { 45435, 0x00000C63 }, /* GL_TEXTURE_GEN_Q */
+ { 45452, 0x00000C62 }, /* GL_TEXTURE_GEN_R */
+ { 45469, 0x00000C60 }, /* GL_TEXTURE_GEN_S */
+ { 45486, 0x00008D60 }, /* GL_TEXTURE_GEN_STR_OES */
+ { 45509, 0x00000C61 }, /* GL_TEXTURE_GEN_T */
+ { 45526, 0x0000819D }, /* GL_TEXTURE_GEQUAL_R_SGIX */
+ { 45551, 0x0000805D }, /* GL_TEXTURE_GREEN_SIZE */
+ { 45573, 0x0000805D }, /* GL_TEXTURE_GREEN_SIZE_EXT */
+ { 45599, 0x00001001 }, /* GL_TEXTURE_HEIGHT */
+ { 45617, 0x000080ED }, /* GL_TEXTURE_INDEX_SIZE_EXT */
+ { 45643, 0x00008061 }, /* GL_TEXTURE_INTENSITY_SIZE */
+ { 45669, 0x00008061 }, /* GL_TEXTURE_INTENSITY_SIZE_EXT */
+ { 45699, 0x00001003 }, /* GL_TEXTURE_INTERNAL_FORMAT */
+ { 45726, 0x0000819C }, /* GL_TEXTURE_LEQUAL_R_SGIX */
+ { 45751, 0x00008501 }, /* GL_TEXTURE_LOD_BIAS */
+ { 45771, 0x00008501 }, /* GL_TEXTURE_LOD_BIAS_EXT */
+ { 45795, 0x00008190 }, /* GL_TEXTURE_LOD_BIAS_R_SGIX */
+ { 45822, 0x0000818E }, /* GL_TEXTURE_LOD_BIAS_S_SGIX */
+ { 45849, 0x0000818F }, /* GL_TEXTURE_LOD_BIAS_T_SGIX */
+ { 45876, 0x00008060 }, /* GL_TEXTURE_LUMINANCE_SIZE */
+ { 45902, 0x00008060 }, /* GL_TEXTURE_LUMINANCE_SIZE_EXT */
+ { 45932, 0x00002800 }, /* GL_TEXTURE_MAG_FILTER */
+ { 45954, 0x00000BA8 }, /* GL_TEXTURE_MATRIX */
+ { 45972, 0x0000898F }, /* GL_TEXTURE_MATRIX_FLOAT_AS_INT_BITS_OES */
+ { 46012, 0x000084FE }, /* GL_TEXTURE_MAX_ANISOTROPY_EXT */
+ { 46042, 0x0000836B }, /* GL_TEXTURE_MAX_CLAMP_R_SGIX */
+ { 46070, 0x00008369 }, /* GL_TEXTURE_MAX_CLAMP_S_SGIX */
+ { 46098, 0x0000836A }, /* GL_TEXTURE_MAX_CLAMP_T_SGIX */
+ { 46126, 0x0000813D }, /* GL_TEXTURE_MAX_LEVEL */
+ { 46147, 0x0000813B }, /* GL_TEXTURE_MAX_LOD */
+ { 46166, 0x00002801 }, /* GL_TEXTURE_MIN_FILTER */
+ { 46188, 0x0000813A }, /* GL_TEXTURE_MIN_LOD */
+ { 46207, 0x00008066 }, /* GL_TEXTURE_PRIORITY */
+ { 46227, 0x000085B7 }, /* GL_TEXTURE_RANGE_LENGTH_APPLE */
+ { 46257, 0x000085B8 }, /* GL_TEXTURE_RANGE_POINTER_APPLE */
+ { 46288, 0x000084F5 }, /* GL_TEXTURE_RECTANGLE */
+ { 46309, 0x000084F5 }, /* GL_TEXTURE_RECTANGLE_ARB */
+ { 46334, 0x000084F5 }, /* GL_TEXTURE_RECTANGLE_NV */
+ { 46358, 0x0000805C }, /* GL_TEXTURE_RED_SIZE */
+ { 46378, 0x0000805C }, /* GL_TEXTURE_RED_SIZE_EXT */
+ { 46402, 0x00008067 }, /* GL_TEXTURE_RESIDENT */
+ { 46422, 0x00008C3F }, /* GL_TEXTURE_SHARED_SIZE */
+ { 46445, 0x00000BA5 }, /* GL_TEXTURE_STACK_DEPTH */
+ { 46468, 0x000088F1 }, /* GL_TEXTURE_STENCIL_SIZE */
+ { 46492, 0x000088F1 }, /* GL_TEXTURE_STENCIL_SIZE_EXT */
+ { 46520, 0x000085BC }, /* GL_TEXTURE_STORAGE_HINT_APPLE */
+ { 46550, 0x00008065 }, /* GL_TEXTURE_TOO_LARGE_EXT */
+ { 46575, 0x0000888F }, /* GL_TEXTURE_UNSIGNED_REMAP_MODE_NV */
+ { 46609, 0x00001000 }, /* GL_TEXTURE_WIDTH */
+ { 46626, 0x00008072 }, /* GL_TEXTURE_WRAP_R */
+ { 46644, 0x00008072 }, /* GL_TEXTURE_WRAP_R_OES */
+ { 46666, 0x00002802 }, /* GL_TEXTURE_WRAP_S */
+ { 46684, 0x00002803 }, /* GL_TEXTURE_WRAP_T */
+ { 46702, 0x0000911B }, /* GL_TIMEOUT_EXPIRED */
+ { 46721, 0x000088BF }, /* GL_TIME_ELAPSED_EXT */
+ { 46741, 0x00008648 }, /* GL_TRACK_MATRIX_NV */
+ { 46760, 0x00008649 }, /* GL_TRACK_MATRIX_TRANSFORM_NV */
+ { 46789, 0x00001000 }, /* GL_TRANSFORM_BIT */
+ { 46806, 0x00008E22 }, /* GL_TRANSFORM_FEEDBACK */
+ { 46828, 0x00008E25 }, /* GL_TRANSFORM_FEEDBACK_BINDING */
+ { 46858, 0x00008C8E }, /* GL_TRANSFORM_FEEDBACK_BUFFER */
+ { 46887, 0x00008E24 }, /* GL_TRANSFORM_FEEDBACK_BUFFER_ACTIVE */
+ { 46923, 0x00008C8F }, /* GL_TRANSFORM_FEEDBACK_BUFFER_BINDING */
+ { 46960, 0x00008C8F }, /* GL_TRANSFORM_FEEDBACK_BUFFER_BINDING_EXT */
+ { 47001, 0x00008C8E }, /* GL_TRANSFORM_FEEDBACK_BUFFER_EXT */
+ { 47034, 0x00008C7F }, /* GL_TRANSFORM_FEEDBACK_BUFFER_MODE */
+ { 47068, 0x00008C7F }, /* GL_TRANSFORM_FEEDBACK_BUFFER_MODE_EXT */
+ { 47106, 0x00008E23 }, /* GL_TRANSFORM_FEEDBACK_BUFFER_PAUSED */
+ { 47142, 0x00008C85 }, /* GL_TRANSFORM_FEEDBACK_BUFFER_SIZE */
+ { 47176, 0x00008C85 }, /* GL_TRANSFORM_FEEDBACK_BUFFER_SIZE_EXT */
+ { 47214, 0x00008C84 }, /* GL_TRANSFORM_FEEDBACK_BUFFER_START */
+ { 47249, 0x00008C84 }, /* GL_TRANSFORM_FEEDBACK_BUFFER_START_EXT */
+ { 47288, 0x00008C88 }, /* GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN */
+ { 47329, 0x00008C88 }, /* GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN_EXT */
+ { 47374, 0x00008C83 }, /* GL_TRANSFORM_FEEDBACK_VARYINGS */
+ { 47405, 0x00008C83 }, /* GL_TRANSFORM_FEEDBACK_VARYINGS_EXT */
+ { 47440, 0x00008C76 }, /* GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH */
+ { 47481, 0x00008C76 }, /* GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH_EXT */
+ { 47526, 0x000084E6 }, /* GL_TRANSPOSE_COLOR_MATRIX */
+ { 47552, 0x000084E6 }, /* GL_TRANSPOSE_COLOR_MATRIX_ARB */
+ { 47582, 0x000088B7 }, /* GL_TRANSPOSE_CURRENT_MATRIX_ARB */
+ { 47614, 0x000084E3 }, /* GL_TRANSPOSE_MODELVIEW_MATRIX */
+ { 47644, 0x000084E3 }, /* GL_TRANSPOSE_MODELVIEW_MATRIX_ARB */
+ { 47678, 0x0000862C }, /* GL_TRANSPOSE_NV */
+ { 47694, 0x000084E4 }, /* GL_TRANSPOSE_PROJECTION_MATRIX */
+ { 47725, 0x000084E4 }, /* GL_TRANSPOSE_PROJECTION_MATRIX_ARB */
+ { 47760, 0x000084E5 }, /* GL_TRANSPOSE_TEXTURE_MATRIX */
+ { 47788, 0x000084E5 }, /* GL_TRANSPOSE_TEXTURE_MATRIX_ARB */
+ { 47820, 0x00000004 }, /* GL_TRIANGLES */
+ { 47833, 0x0000000C }, /* GL_TRIANGLES_ADJACENCY */
+ { 47856, 0x0000000C }, /* GL_TRIANGLES_ADJACENCY_ARB */
+ { 47883, 0x00000006 }, /* GL_TRIANGLE_FAN */
+ { 47899, 0x00008615 }, /* GL_TRIANGLE_MESH_SUN */
+ { 47920, 0x00000005 }, /* GL_TRIANGLE_STRIP */
+ { 47938, 0x0000000D }, /* GL_TRIANGLE_STRIP_ADJACENCY */
+ { 47966, 0x0000000D }, /* GL_TRIANGLE_STRIP_ADJACENCY_ARB */
+ { 47998, 0x00000001 }, /* GL_TRUE */
+ { 48006, 0x00008A1C }, /* GL_UNDEFINED_APPLE */
+ { 48025, 0x00008255 }, /* GL_UNKNOWN_CONTEXT_RESET_ARB */
+ { 48054, 0x00000CF5 }, /* GL_UNPACK_ALIGNMENT */
+ { 48074, 0x0000806E }, /* GL_UNPACK_IMAGE_HEIGHT */
+ { 48097, 0x00000CF1 }, /* GL_UNPACK_LSB_FIRST */
+ { 48117, 0x00000CF2 }, /* GL_UNPACK_ROW_LENGTH */
+ { 48138, 0x0000806D }, /* GL_UNPACK_SKIP_IMAGES */
+ { 48160, 0x00000CF4 }, /* GL_UNPACK_SKIP_PIXELS */
+ { 48182, 0x00000CF3 }, /* GL_UNPACK_SKIP_ROWS */
+ { 48202, 0x00000CF0 }, /* GL_UNPACK_SWAP_BYTES */
+ { 48223, 0x00009118 }, /* GL_UNSIGNALED */
+ { 48237, 0x00001401 }, /* GL_UNSIGNED_BYTE */
+ { 48254, 0x00008362 }, /* GL_UNSIGNED_BYTE_2_3_3_REV */
+ { 48281, 0x00008032 }, /* GL_UNSIGNED_BYTE_3_3_2 */
+ { 48304, 0x00001405 }, /* GL_UNSIGNED_INT */
+ { 48320, 0x00008C3B }, /* GL_UNSIGNED_INT_10F_11F_11F_REV */
+ { 48352, 0x00008036 }, /* GL_UNSIGNED_INT_10_10_10_2 */
+ { 48379, 0x00008DF6 }, /* GL_UNSIGNED_INT_10_10_10_2_OES */
+ { 48410, 0x000084FA }, /* GL_UNSIGNED_INT_24_8 */
+ { 48431, 0x000084FA }, /* GL_UNSIGNED_INT_24_8_EXT */
+ { 48456, 0x000084FA }, /* GL_UNSIGNED_INT_24_8_NV */
+ { 48480, 0x000084FA }, /* GL_UNSIGNED_INT_24_8_OES */
+ { 48505, 0x00008368 }, /* GL_UNSIGNED_INT_2_10_10_10_REV */
+ { 48536, 0x00008368 }, /* GL_UNSIGNED_INT_2_10_10_10_REV_EXT */
+ { 48571, 0x00008C3E }, /* GL_UNSIGNED_INT_5_9_9_9_REV */
+ { 48599, 0x00008035 }, /* GL_UNSIGNED_INT_8_8_8_8 */
+ { 48623, 0x00008367 }, /* GL_UNSIGNED_INT_8_8_8_8_REV */
+ { 48651, 0x00008DD1 }, /* GL_UNSIGNED_INT_SAMPLER_1D */
+ { 48678, 0x00008DD6 }, /* GL_UNSIGNED_INT_SAMPLER_1D_ARRAY */
+ { 48711, 0x00008DD6 }, /* GL_UNSIGNED_INT_SAMPLER_1D_ARRAY_EXT */
+ { 48748, 0x00008DD1 }, /* GL_UNSIGNED_INT_SAMPLER_1D_EXT */
+ { 48779, 0x00008DD2 }, /* GL_UNSIGNED_INT_SAMPLER_2D */
+ { 48806, 0x00008DD7 }, /* GL_UNSIGNED_INT_SAMPLER_2D_ARRAY */
+ { 48839, 0x00008DD7 }, /* GL_UNSIGNED_INT_SAMPLER_2D_ARRAY_EXT */
+ { 48876, 0x00008DD2 }, /* GL_UNSIGNED_INT_SAMPLER_2D_EXT */
+ { 48907, 0x00008DD5 }, /* GL_UNSIGNED_INT_SAMPLER_2D_RECT */
+ { 48939, 0x00008DD5 }, /* GL_UNSIGNED_INT_SAMPLER_2D_RECT_EXT */
+ { 48975, 0x00008DD3 }, /* GL_UNSIGNED_INT_SAMPLER_3D */
+ { 49002, 0x00008DD3 }, /* GL_UNSIGNED_INT_SAMPLER_3D_EXT */
+ { 49033, 0x00008DD8 }, /* GL_UNSIGNED_INT_SAMPLER_BUFFER */
+ { 49064, 0x00008DD8 }, /* GL_UNSIGNED_INT_SAMPLER_BUFFER_EXT */
+ { 49099, 0x00008DD4 }, /* GL_UNSIGNED_INT_SAMPLER_CUBE */
+ { 49128, 0x00008DD4 }, /* GL_UNSIGNED_INT_SAMPLER_CUBE_EXT */
+ { 49161, 0x00008DC6 }, /* GL_UNSIGNED_INT_VEC2 */
+ { 49182, 0x00008DC6 }, /* GL_UNSIGNED_INT_VEC2_EXT */
+ { 49207, 0x00008DC7 }, /* GL_UNSIGNED_INT_VEC3 */
+ { 49228, 0x00008DC7 }, /* GL_UNSIGNED_INT_VEC3_EXT */
+ { 49253, 0x00008DC8 }, /* GL_UNSIGNED_INT_VEC4 */
+ { 49274, 0x00008DC8 }, /* GL_UNSIGNED_INT_VEC4_EXT */
+ { 49299, 0x00008C17 }, /* GL_UNSIGNED_NORMALIZED */
+ { 49322, 0x00001403 }, /* GL_UNSIGNED_SHORT */
+ { 49340, 0x00008366 }, /* GL_UNSIGNED_SHORT_1_5_5_5_REV */
+ { 49370, 0x00008366 }, /* GL_UNSIGNED_SHORT_1_5_5_5_REV_EXT */
+ { 49404, 0x00008033 }, /* GL_UNSIGNED_SHORT_4_4_4_4 */
+ { 49430, 0x00008365 }, /* GL_UNSIGNED_SHORT_4_4_4_4_REV */
+ { 49460, 0x00008365 }, /* GL_UNSIGNED_SHORT_4_4_4_4_REV_EXT */
+ { 49494, 0x00008034 }, /* GL_UNSIGNED_SHORT_5_5_5_1 */
+ { 49520, 0x00008363 }, /* GL_UNSIGNED_SHORT_5_6_5 */
+ { 49544, 0x00008364 }, /* GL_UNSIGNED_SHORT_5_6_5_REV */
+ { 49572, 0x000085BA }, /* GL_UNSIGNED_SHORT_8_8_APPLE */
+ { 49600, 0x000085BA }, /* GL_UNSIGNED_SHORT_8_8_MESA */
+ { 49627, 0x000085BB }, /* GL_UNSIGNED_SHORT_8_8_REV_APPLE */
+ { 49659, 0x000085BB }, /* GL_UNSIGNED_SHORT_8_8_REV_MESA */
+ { 49690, 0x00008CA2 }, /* GL_UPPER_LEFT */
+ { 49704, 0x00002A20 }, /* GL_V2F */
+ { 49711, 0x00002A21 }, /* GL_V3F */
+ { 49718, 0x00008B83 }, /* GL_VALIDATE_STATUS */
+ { 49737, 0x00001F00 }, /* GL_VENDOR */
+ { 49747, 0x00001F02 }, /* GL_VERSION */
+ { 49758, 0x00008074 }, /* GL_VERTEX_ARRAY */
+ { 49774, 0x000085B5 }, /* GL_VERTEX_ARRAY_BINDING */
+ { 49798, 0x000085B5 }, /* GL_VERTEX_ARRAY_BINDING_APPLE */
+ { 49828, 0x00008896 }, /* GL_VERTEX_ARRAY_BUFFER_BINDING */
+ { 49859, 0x00008896 }, /* GL_VERTEX_ARRAY_BUFFER_BINDING_ARB */
+ { 49894, 0x0000808E }, /* GL_VERTEX_ARRAY_POINTER */
+ { 49918, 0x0000807A }, /* GL_VERTEX_ARRAY_SIZE */
+ { 49939, 0x0000807C }, /* GL_VERTEX_ARRAY_STRIDE */
+ { 49962, 0x0000807B }, /* GL_VERTEX_ARRAY_TYPE */
+ { 49983, 0x00008650 }, /* GL_VERTEX_ATTRIB_ARRAY0_NV */
+ { 50010, 0x0000865A }, /* GL_VERTEX_ATTRIB_ARRAY10_NV */
+ { 50038, 0x0000865B }, /* GL_VERTEX_ATTRIB_ARRAY11_NV */
+ { 50066, 0x0000865C }, /* GL_VERTEX_ATTRIB_ARRAY12_NV */
+ { 50094, 0x0000865D }, /* GL_VERTEX_ATTRIB_ARRAY13_NV */
+ { 50122, 0x0000865E }, /* GL_VERTEX_ATTRIB_ARRAY14_NV */
+ { 50150, 0x0000865F }, /* GL_VERTEX_ATTRIB_ARRAY15_NV */
+ { 50178, 0x00008651 }, /* GL_VERTEX_ATTRIB_ARRAY1_NV */
+ { 50205, 0x00008652 }, /* GL_VERTEX_ATTRIB_ARRAY2_NV */
+ { 50232, 0x00008653 }, /* GL_VERTEX_ATTRIB_ARRAY3_NV */
+ { 50259, 0x00008654 }, /* GL_VERTEX_ATTRIB_ARRAY4_NV */
+ { 50286, 0x00008655 }, /* GL_VERTEX_ATTRIB_ARRAY5_NV */
+ { 50313, 0x00008656 }, /* GL_VERTEX_ATTRIB_ARRAY6_NV */
+ { 50340, 0x00008657 }, /* GL_VERTEX_ATTRIB_ARRAY7_NV */
+ { 50367, 0x00008658 }, /* GL_VERTEX_ATTRIB_ARRAY8_NV */
+ { 50394, 0x00008659 }, /* GL_VERTEX_ATTRIB_ARRAY9_NV */
+ { 50421, 0x0000889F }, /* GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING */
+ { 50459, 0x0000889F }, /* GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB */
+ { 50501, 0x000088FE }, /* GL_VERTEX_ATTRIB_ARRAY_DIVISOR_ARB */
+ { 50536, 0x00008622 }, /* GL_VERTEX_ATTRIB_ARRAY_ENABLED */
+ { 50567, 0x00008622 }, /* GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB */
+ { 50602, 0x000088FD }, /* GL_VERTEX_ATTRIB_ARRAY_INTEGER */
+ { 50633, 0x000088FD }, /* GL_VERTEX_ATTRIB_ARRAY_INTEGER_EXT */
+ { 50668, 0x0000886A }, /* GL_VERTEX_ATTRIB_ARRAY_NORMALIZED */
+ { 50702, 0x0000886A }, /* GL_VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB */
+ { 50740, 0x00008645 }, /* GL_VERTEX_ATTRIB_ARRAY_POINTER */
+ { 50771, 0x00008645 }, /* GL_VERTEX_ATTRIB_ARRAY_POINTER_ARB */
+ { 50806, 0x00008623 }, /* GL_VERTEX_ATTRIB_ARRAY_SIZE */
+ { 50834, 0x00008623 }, /* GL_VERTEX_ATTRIB_ARRAY_SIZE_ARB */
+ { 50866, 0x00008624 }, /* GL_VERTEX_ATTRIB_ARRAY_STRIDE */
+ { 50896, 0x00008624 }, /* GL_VERTEX_ATTRIB_ARRAY_STRIDE_ARB */
+ { 50930, 0x00008625 }, /* GL_VERTEX_ATTRIB_ARRAY_TYPE */
+ { 50958, 0x00008625 }, /* GL_VERTEX_ATTRIB_ARRAY_TYPE_ARB */
+ { 50990, 0x000086A7 }, /* GL_VERTEX_BLEND_ARB */
+ { 51010, 0x00008620 }, /* GL_VERTEX_PROGRAM_ARB */
+ { 51032, 0x0000864A }, /* GL_VERTEX_PROGRAM_BINDING_NV */
+ { 51061, 0x00008620 }, /* GL_VERTEX_PROGRAM_NV */
+ { 51082, 0x00008642 }, /* GL_VERTEX_PROGRAM_POINT_SIZE */
+ { 51111, 0x00008642 }, /* GL_VERTEX_PROGRAM_POINT_SIZE_ARB */
+ { 51144, 0x00008642 }, /* GL_VERTEX_PROGRAM_POINT_SIZE_NV */
+ { 51176, 0x00008643 }, /* GL_VERTEX_PROGRAM_TWO_SIDE */
+ { 51203, 0x00008643 }, /* GL_VERTEX_PROGRAM_TWO_SIDE_ARB */
+ { 51234, 0x00008643 }, /* GL_VERTEX_PROGRAM_TWO_SIDE_NV */
+ { 51264, 0x00008B31 }, /* GL_VERTEX_SHADER */
+ { 51281, 0x00008B31 }, /* GL_VERTEX_SHADER_ARB */
+ { 51302, 0x00008621 }, /* GL_VERTEX_STATE_PROGRAM_NV */
+ { 51329, 0x00000BA2 }, /* GL_VIEWPORT */
+ { 51341, 0x00000800 }, /* GL_VIEWPORT_BIT */
+ { 51357, 0x00008A1A }, /* GL_VOLATILE_APPLE */
+ { 51375, 0x0000911D }, /* GL_WAIT_FAILED */
+ { 51390, 0x000086AD }, /* GL_WEIGHT_ARRAY_ARB */
+ { 51410, 0x0000889E }, /* GL_WEIGHT_ARRAY_BUFFER_BINDING */
+ { 51441, 0x0000889E }, /* GL_WEIGHT_ARRAY_BUFFER_BINDING_ARB */
+ { 51476, 0x0000889E }, /* GL_WEIGHT_ARRAY_BUFFER_BINDING_OES */
+ { 51511, 0x000086AD }, /* GL_WEIGHT_ARRAY_OES */
+ { 51531, 0x000086AC }, /* GL_WEIGHT_ARRAY_POINTER_ARB */
+ { 51559, 0x000086AC }, /* GL_WEIGHT_ARRAY_POINTER_OES */
+ { 51587, 0x000086AB }, /* GL_WEIGHT_ARRAY_SIZE_ARB */
+ { 51612, 0x000086AB }, /* GL_WEIGHT_ARRAY_SIZE_OES */
+ { 51637, 0x000086AA }, /* GL_WEIGHT_ARRAY_STRIDE_ARB */
+ { 51664, 0x000086AA }, /* GL_WEIGHT_ARRAY_STRIDE_OES */
+ { 51691, 0x000086A9 }, /* GL_WEIGHT_ARRAY_TYPE_ARB */
+ { 51716, 0x000086A9 }, /* GL_WEIGHT_ARRAY_TYPE_OES */
+ { 51741, 0x000086A6 }, /* GL_WEIGHT_SUM_UNITY_ARB */
+ { 51765, 0x000081D4 }, /* GL_WRAP_BORDER_SUN */
+ { 51784, 0x000088B9 }, /* GL_WRITE_ONLY */
+ { 51798, 0x000088B9 }, /* GL_WRITE_ONLY_ARB */
+ { 51816, 0x000088B9 }, /* GL_WRITE_ONLY_OES */
+ { 51834, 0x00001506 }, /* GL_XOR */
+ { 51841, 0x000085B9 }, /* GL_YCBCR_422_APPLE */
+ { 51860, 0x00008757 }, /* GL_YCBCR_MESA */
+ { 51874, 0x00000000 }, /* GL_ZERO */
+ { 51882, 0x00000D16 }, /* GL_ZOOM_X */
+ { 51892, 0x00000D17 }, /* GL_ZOOM_Y */
+};
+
+static const unsigned reduced_enums[1562] =
+{
+ 539, /* GL_FALSE */
+ 834, /* GL_LINES */
+ 838, /* GL_LINE_LOOP */
+ 845, /* GL_LINE_STRIP */
+ 2152, /* GL_TRIANGLES */
+ 2157, /* GL_TRIANGLE_STRIP */
+ 2155, /* GL_TRIANGLE_FAN */
+ 1517, /* GL_QUADS */
+ 1521, /* GL_QUAD_STRIP */
+ 1388, /* GL_POLYGON */
+ 835, /* GL_LINES_ADJACENCY */
+ 846, /* GL_LINE_STRIP_ADJACENCY */
+ 2153, /* GL_TRIANGLES_ADJACENCY */
+ 2158, /* GL_TRIANGLE_STRIP_ADJACENCY */
+ 1400, /* GL_POLYGON_STIPPLE_BIT */
+ 1343, /* GL_PIXEL_MODE_BIT */
+ 821, /* GL_LIGHTING_BIT */
+ 573, /* GL_FOG_BIT */
+ 8, /* GL_ACCUM */
+ 857, /* GL_LOAD */
+ 1607, /* GL_RETURN */
+ 1209, /* GL_MULT */
+ 24, /* GL_ADD */
+ 1225, /* GL_NEVER */
+ 811, /* GL_LESS */
+ 529, /* GL_EQUAL */
+ 810, /* GL_LEQUAL */
+ 696, /* GL_GREATER */
+ 1242, /* GL_NOTEQUAL */
+ 695, /* GL_GEQUAL */
+ 55, /* GL_ALWAYS */
+ 1816, /* GL_SRC_COLOR */
+ 1276, /* GL_ONE_MINUS_SRC_COLOR */
+ 1814, /* GL_SRC_ALPHA */
+ 1275, /* GL_ONE_MINUS_SRC_ALPHA */
+ 508, /* GL_DST_ALPHA */
+ 1273, /* GL_ONE_MINUS_DST_ALPHA */
+ 509, /* GL_DST_COLOR */
+ 1274, /* GL_ONE_MINUS_DST_COLOR */
+ 1815, /* GL_SRC_ALPHA_SATURATE */
+ 672, /* GL_FRONT_LEFT */
+ 673, /* GL_FRONT_RIGHT */
+ 77, /* GL_BACK_LEFT */
+ 78, /* GL_BACK_RIGHT */
+ 669, /* GL_FRONT */
+ 76, /* GL_BACK */
+ 809, /* GL_LEFT */
+ 1697, /* GL_RIGHT */
+ 670, /* GL_FRONT_AND_BACK */
+ 71, /* GL_AUX0 */
+ 72, /* GL_AUX1 */
+ 73, /* GL_AUX2 */
+ 74, /* GL_AUX3 */
+ 797, /* GL_INVALID_ENUM */
+ 802, /* GL_INVALID_VALUE */
+ 801, /* GL_INVALID_OPERATION */
+ 1821, /* GL_STACK_OVERFLOW */
+ 1822, /* GL_STACK_UNDERFLOW */
+ 1301, /* GL_OUT_OF_MEMORY */
+ 798, /* GL_INVALID_FRAMEBUFFER_OPERATION */
+ 0, /* GL_2D */
+ 2, /* GL_3D */
+ 3, /* GL_3D_COLOR */
+ 4, /* GL_3D_COLOR_TEXTURE */
+ 6, /* GL_4D_COLOR_TEXTURE */
+ 1321, /* GL_PASS_THROUGH_TOKEN */
+ 1387, /* GL_POINT_TOKEN */
+ 848, /* GL_LINE_TOKEN */
+ 1401, /* GL_POLYGON_TOKEN */
+ 87, /* GL_BITMAP_TOKEN */
+ 507, /* GL_DRAW_PIXEL_TOKEN */
+ 353, /* GL_COPY_PIXEL_TOKEN */
+ 839, /* GL_LINE_RESET_TOKEN */
+ 532, /* GL_EXP */
+ 533, /* GL_EXP2 */
+ 390, /* GL_CW */
+ 154, /* GL_CCW */
+ 187, /* GL_COEFF */
+ 1298, /* GL_ORDER */
+ 444, /* GL_DOMAIN */
+ 363, /* GL_CURRENT_COLOR */
+ 366, /* GL_CURRENT_INDEX */
+ 372, /* GL_CURRENT_NORMAL */
+ 386, /* GL_CURRENT_TEXTURE_COORDS */
+ 378, /* GL_CURRENT_RASTER_COLOR */
+ 380, /* GL_CURRENT_RASTER_INDEX */
+ 384, /* GL_CURRENT_RASTER_TEXTURE_COORDS */
+ 381, /* GL_CURRENT_RASTER_POSITION */
+ 382, /* GL_CURRENT_RASTER_POSITION_VALID */
+ 379, /* GL_CURRENT_RASTER_DISTANCE */
+ 1379, /* GL_POINT_SMOOTH */
+ 1363, /* GL_POINT_SIZE */
+ 1378, /* GL_POINT_SIZE_RANGE */
+ 1369, /* GL_POINT_SIZE_GRANULARITY */
+ 840, /* GL_LINE_SMOOTH */
+ 849, /* GL_LINE_WIDTH */
+ 851, /* GL_LINE_WIDTH_RANGE */
+ 850, /* GL_LINE_WIDTH_GRANULARITY */
+ 842, /* GL_LINE_STIPPLE */
+ 843, /* GL_LINE_STIPPLE_PATTERN */
+ 844, /* GL_LINE_STIPPLE_REPEAT */
+ 856, /* GL_LIST_MODE */
+ 1064, /* GL_MAX_LIST_NESTING */
+ 853, /* GL_LIST_BASE */
+ 855, /* GL_LIST_INDEX */
+ 1390, /* GL_POLYGON_MODE */
+ 1397, /* GL_POLYGON_SMOOTH */
+ 1399, /* GL_POLYGON_STIPPLE */
+ 518, /* GL_EDGE_FLAG */
+ 356, /* GL_CULL_FACE */
+ 357, /* GL_CULL_FACE_MODE */
+ 671, /* GL_FRONT_FACE */
+ 820, /* GL_LIGHTING */
+ 825, /* GL_LIGHT_MODEL_LOCAL_VIEWER */
+ 826, /* GL_LIGHT_MODEL_TWO_SIDE */
+ 822, /* GL_LIGHT_MODEL_AMBIENT */
+ 1763, /* GL_SHADE_MODEL */
+ 235, /* GL_COLOR_MATERIAL_FACE */
+ 236, /* GL_COLOR_MATERIAL_PARAMETER */
+ 234, /* GL_COLOR_MATERIAL */
+ 572, /* GL_FOG */
+ 594, /* GL_FOG_INDEX */
+ 590, /* GL_FOG_DENSITY */
+ 598, /* GL_FOG_START */
+ 592, /* GL_FOG_END */
+ 595, /* GL_FOG_MODE */
+ 574, /* GL_FOG_COLOR */
+ 429, /* GL_DEPTH_RANGE */
+ 438, /* GL_DEPTH_TEST */
+ 441, /* GL_DEPTH_WRITEMASK */
+ 414, /* GL_DEPTH_CLEAR_VALUE */
+ 428, /* GL_DEPTH_FUNC */
+ 12, /* GL_ACCUM_CLEAR_VALUE */
+ 1866, /* GL_STENCIL_TEST */
+ 1847, /* GL_STENCIL_CLEAR_VALUE */
+ 1849, /* GL_STENCIL_FUNC */
+ 1868, /* GL_STENCIL_VALUE_MASK */
+ 1848, /* GL_STENCIL_FAIL */
+ 1863, /* GL_STENCIL_PASS_DEPTH_FAIL */
+ 1864, /* GL_STENCIL_PASS_DEPTH_PASS */
+ 1865, /* GL_STENCIL_REF */
+ 1869, /* GL_STENCIL_WRITEMASK */
+ 1014, /* GL_MATRIX_MODE */
+ 1231, /* GL_NORMALIZE */
+ 2285, /* GL_VIEWPORT */
+ 1204, /* GL_MODELVIEW_STACK_DEPTH */
+ 1491, /* GL_PROJECTION_STACK_DEPTH */
+ 2106, /* GL_TEXTURE_STACK_DEPTH */
+ 1201, /* GL_MODELVIEW_MATRIX */
+ 1489, /* GL_PROJECTION_MATRIX */
+ 2086, /* GL_TEXTURE_MATRIX */
+ 69, /* GL_ATTRIB_STACK_DEPTH */
+ 169, /* GL_CLIENT_ATTRIB_STACK_DEPTH */
+ 51, /* GL_ALPHA_TEST */
+ 52, /* GL_ALPHA_TEST_FUNC */
+ 53, /* GL_ALPHA_TEST_REF */
+ 443, /* GL_DITHER */
+ 91, /* GL_BLEND_DST */
+ 105, /* GL_BLEND_SRC */
+ 88, /* GL_BLEND */
+ 859, /* GL_LOGIC_OP_MODE */
+ 745, /* GL_INDEX_LOGIC_OP */
+ 233, /* GL_COLOR_LOGIC_OP */
+ 75, /* GL_AUX_BUFFERS */
+ 454, /* GL_DRAW_BUFFER */
+ 1544, /* GL_READ_BUFFER */
+ 1740, /* GL_SCISSOR_BOX */
+ 1741, /* GL_SCISSOR_TEST */
+ 744, /* GL_INDEX_CLEAR_VALUE */
+ 749, /* GL_INDEX_WRITEMASK */
+ 230, /* GL_COLOR_CLEAR_VALUE */
+ 272, /* GL_COLOR_WRITEMASK */
+ 746, /* GL_INDEX_MODE */
+ 1686, /* GL_RGBA_MODE */
+ 453, /* GL_DOUBLEBUFFER */
+ 1870, /* GL_STEREO */
+ 1598, /* GL_RENDER_MODE */
+ 1322, /* GL_PERSPECTIVE_CORRECTION_HINT */
+ 1380, /* GL_POINT_SMOOTH_HINT */
+ 841, /* GL_LINE_SMOOTH_HINT */
+ 1398, /* GL_POLYGON_SMOOTH_HINT */
+ 593, /* GL_FOG_HINT */
+ 2066, /* GL_TEXTURE_GEN_S */
+ 2068, /* GL_TEXTURE_GEN_T */
+ 2065, /* GL_TEXTURE_GEN_R */
+ 2064, /* GL_TEXTURE_GEN_Q */
+ 1335, /* GL_PIXEL_MAP_I_TO_I */
+ 1341, /* GL_PIXEL_MAP_S_TO_S */
+ 1337, /* GL_PIXEL_MAP_I_TO_R */
+ 1333, /* GL_PIXEL_MAP_I_TO_G */
+ 1331, /* GL_PIXEL_MAP_I_TO_B */
+ 1329, /* GL_PIXEL_MAP_I_TO_A */
+ 1339, /* GL_PIXEL_MAP_R_TO_R */
+ 1327, /* GL_PIXEL_MAP_G_TO_G */
+ 1325, /* GL_PIXEL_MAP_B_TO_B */
+ 1323, /* GL_PIXEL_MAP_A_TO_A */
+ 1336, /* GL_PIXEL_MAP_I_TO_I_SIZE */
+ 1342, /* GL_PIXEL_MAP_S_TO_S_SIZE */
+ 1338, /* GL_PIXEL_MAP_I_TO_R_SIZE */
+ 1334, /* GL_PIXEL_MAP_I_TO_G_SIZE */
+ 1332, /* GL_PIXEL_MAP_I_TO_B_SIZE */
+ 1330, /* GL_PIXEL_MAP_I_TO_A_SIZE */
+ 1340, /* GL_PIXEL_MAP_R_TO_R_SIZE */
+ 1328, /* GL_PIXEL_MAP_G_TO_G_SIZE */
+ 1326, /* GL_PIXEL_MAP_B_TO_B_SIZE */
+ 1324, /* GL_PIXEL_MAP_A_TO_A_SIZE */
+ 2170, /* GL_UNPACK_SWAP_BYTES */
+ 2165, /* GL_UNPACK_LSB_FIRST */
+ 2166, /* GL_UNPACK_ROW_LENGTH */
+ 2169, /* GL_UNPACK_SKIP_ROWS */
+ 2168, /* GL_UNPACK_SKIP_PIXELS */
+ 2163, /* GL_UNPACK_ALIGNMENT */
+ 1310, /* GL_PACK_SWAP_BYTES */
+ 1305, /* GL_PACK_LSB_FIRST */
+ 1306, /* GL_PACK_ROW_LENGTH */
+ 1309, /* GL_PACK_SKIP_ROWS */
+ 1308, /* GL_PACK_SKIP_PIXELS */
+ 1302, /* GL_PACK_ALIGNMENT */
+ 955, /* GL_MAP_COLOR */
+ 960, /* GL_MAP_STENCIL */
+ 748, /* GL_INDEX_SHIFT */
+ 747, /* GL_INDEX_OFFSET */
+ 1560, /* GL_RED_SCALE */
+ 1556, /* GL_RED_BIAS */
+ 2311, /* GL_ZOOM_X */
+ 2312, /* GL_ZOOM_Y */
+ 702, /* GL_GREEN_SCALE */
+ 698, /* GL_GREEN_BIAS */
+ 115, /* GL_BLUE_SCALE */
+ 111, /* GL_BLUE_BIAS */
+ 50, /* GL_ALPHA_SCALE */
+ 47, /* GL_ALPHA_BIAS */
+ 430, /* GL_DEPTH_SCALE */
+ 406, /* GL_DEPTH_BIAS */
+ 1046, /* GL_MAX_EVAL_ORDER */
+ 1063, /* GL_MAX_LIGHTS */
+ 1026, /* GL_MAX_CLIP_DISTANCES */
+ 1119, /* GL_MAX_TEXTURE_SIZE */
+ 1070, /* GL_MAX_PIXEL_MAP_TABLE */
+ 1022, /* GL_MAX_ATTRIB_STACK_DEPTH */
+ 1066, /* GL_MAX_MODELVIEW_STACK_DEPTH */
+ 1067, /* GL_MAX_NAME_STACK_DEPTH */
+ 1098, /* GL_MAX_PROJECTION_STACK_DEPTH */
+ 1120, /* GL_MAX_TEXTURE_STACK_DEPTH */
+ 1146, /* GL_MAX_VIEWPORT_DIMS */
+ 1023, /* GL_MAX_CLIENT_ATTRIB_STACK_DEPTH */
+ 1880, /* GL_SUBPIXEL_BITS */
+ 743, /* GL_INDEX_BITS */
+ 1557, /* GL_RED_BITS */
+ 699, /* GL_GREEN_BITS */
+ 112, /* GL_BLUE_BITS */
+ 48, /* GL_ALPHA_BITS */
+ 407, /* GL_DEPTH_BITS */
+ 1844, /* GL_STENCIL_BITS */
+ 14, /* GL_ACCUM_RED_BITS */
+ 13, /* GL_ACCUM_GREEN_BITS */
+ 10, /* GL_ACCUM_BLUE_BITS */
+ 9, /* GL_ACCUM_ALPHA_BITS */
+ 1218, /* GL_NAME_STACK_DEPTH */
+ 70, /* GL_AUTO_NORMAL */
+ 901, /* GL_MAP1_COLOR_4 */
+ 904, /* GL_MAP1_INDEX */
+ 905, /* GL_MAP1_NORMAL */
+ 906, /* GL_MAP1_TEXTURE_COORD_1 */
+ 907, /* GL_MAP1_TEXTURE_COORD_2 */
+ 908, /* GL_MAP1_TEXTURE_COORD_3 */
+ 909, /* GL_MAP1_TEXTURE_COORD_4 */
+ 910, /* GL_MAP1_VERTEX_3 */
+ 911, /* GL_MAP1_VERTEX_4 */
+ 928, /* GL_MAP2_COLOR_4 */
+ 931, /* GL_MAP2_INDEX */
+ 932, /* GL_MAP2_NORMAL */
+ 933, /* GL_MAP2_TEXTURE_COORD_1 */
+ 934, /* GL_MAP2_TEXTURE_COORD_2 */
+ 935, /* GL_MAP2_TEXTURE_COORD_3 */
+ 936, /* GL_MAP2_TEXTURE_COORD_4 */
+ 937, /* GL_MAP2_VERTEX_3 */
+ 938, /* GL_MAP2_VERTEX_4 */
+ 902, /* GL_MAP1_GRID_DOMAIN */
+ 903, /* GL_MAP1_GRID_SEGMENTS */
+ 929, /* GL_MAP2_GRID_DOMAIN */
+ 930, /* GL_MAP2_GRID_SEGMENTS */
+ 1963, /* GL_TEXTURE_1D */
+ 1966, /* GL_TEXTURE_2D */
+ 542, /* GL_FEEDBACK_BUFFER_POINTER */
+ 543, /* GL_FEEDBACK_BUFFER_SIZE */
+ 544, /* GL_FEEDBACK_BUFFER_TYPE */
+ 1750, /* GL_SELECTION_BUFFER_POINTER */
+ 1751, /* GL_SELECTION_BUFFER_SIZE */
+ 2112, /* GL_TEXTURE_WIDTH */
+ 2072, /* GL_TEXTURE_HEIGHT */
+ 2016, /* GL_TEXTURE_COMPONENTS */
+ 1994, /* GL_TEXTURE_BORDER_COLOR */
+ 1993, /* GL_TEXTURE_BORDER */
+ 445, /* GL_DONT_CARE */
+ 540, /* GL_FASTEST */
+ 1226, /* GL_NICEST */
+ 56, /* GL_AMBIENT */
+ 442, /* GL_DIFFUSE */
+ 1803, /* GL_SPECULAR */
+ 1402, /* GL_POSITION */
+ 1806, /* GL_SPOT_DIRECTION */
+ 1807, /* GL_SPOT_EXPONENT */
+ 1805, /* GL_SPOT_CUTOFF */
+ 320, /* GL_CONSTANT_ATTENUATION */
+ 829, /* GL_LINEAR_ATTENUATION */
+ 1516, /* GL_QUADRATIC_ATTENUATION */
+ 287, /* GL_COMPILE */
+ 288, /* GL_COMPILE_AND_EXECUTE */
+ 149, /* GL_BYTE */
+ 2172, /* GL_UNSIGNED_BYTE */
+ 1768, /* GL_SHORT */
+ 2211, /* GL_UNSIGNED_SHORT */
+ 752, /* GL_INT */
+ 2175, /* GL_UNSIGNED_INT */
+ 553, /* GL_FLOAT */
+ 1, /* GL_2_BYTES */
+ 5, /* GL_3_BYTES */
+ 7, /* GL_4_BYTES */
+ 452, /* GL_DOUBLE */
+ 704, /* GL_HALF_FLOAT */
+ 548, /* GL_FIXED */
+ 165, /* GL_CLEAR */
+ 58, /* GL_AND */
+ 60, /* GL_AND_REVERSE */
+ 351, /* GL_COPY */
+ 59, /* GL_AND_INVERTED */
+ 1229, /* GL_NOOP */
+ 2307, /* GL_XOR */
+ 1297, /* GL_OR */
+ 1230, /* GL_NOR */
+ 530, /* GL_EQUIV */
+ 805, /* GL_INVERT */
+ 1300, /* GL_OR_REVERSE */
+ 352, /* GL_COPY_INVERTED */
+ 1299, /* GL_OR_INVERTED */
+ 1219, /* GL_NAND */
+ 1757, /* GL_SET */
+ 527, /* GL_EMISSION */
+ 1767, /* GL_SHININESS */
+ 57, /* GL_AMBIENT_AND_DIFFUSE */
+ 232, /* GL_COLOR_INDEXES */
+ 1168, /* GL_MODELVIEW */
+ 1488, /* GL_PROJECTION */
+ 1898, /* GL_TEXTURE */
+ 188, /* GL_COLOR */
+ 399, /* GL_DEPTH */
+ 1829, /* GL_STENCIL */
+ 231, /* GL_COLOR_INDEX */
+ 1850, /* GL_STENCIL_INDEX */
+ 415, /* GL_DEPTH_COMPONENT */
+ 1553, /* GL_RED */
+ 697, /* GL_GREEN */
+ 110, /* GL_BLUE */
+ 32, /* GL_ALPHA */
+ 1610, /* GL_RGB */
+ 1650, /* GL_RGBA */
+ 864, /* GL_LUMINANCE */
+ 891, /* GL_LUMINANCE_ALPHA */
+ 86, /* GL_BITMAP */
+ 1352, /* GL_POINT */
+ 827, /* GL_LINE */
+ 545, /* GL_FILL */
+ 1567, /* GL_RENDER */
+ 541, /* GL_FEEDBACK */
+ 1749, /* GL_SELECT */
+ 552, /* GL_FLAT */
+ 1778, /* GL_SMOOTH */
+ 806, /* GL_KEEP */
+ 1600, /* GL_REPLACE */
+ 733, /* GL_INCR */
+ 395, /* GL_DECR */
+ 2228, /* GL_VENDOR */
+ 1597, /* GL_RENDERER */
+ 2229, /* GL_VERSION */
+ 534, /* GL_EXTENSIONS */
+ 1698, /* GL_S */
+ 1889, /* GL_T */
+ 1536, /* GL_R */
+ 1515, /* GL_Q */
+ 1205, /* GL_MODULATE */
+ 394, /* GL_DECAL */
+ 2059, /* GL_TEXTURE_ENV_MODE */
+ 2058, /* GL_TEXTURE_ENV_COLOR */
+ 2057, /* GL_TEXTURE_ENV */
+ 535, /* GL_EYE_LINEAR */
+ 1258, /* GL_OBJECT_LINEAR */
+ 1804, /* GL_SPHERE_MAP */
+ 2062, /* GL_TEXTURE_GEN_MODE */
+ 1260, /* GL_OBJECT_PLANE */
+ 536, /* GL_EYE_PLANE */
+ 1220, /* GL_NEAREST */
+ 828, /* GL_LINEAR */
+ 1224, /* GL_NEAREST_MIPMAP_NEAREST */
+ 833, /* GL_LINEAR_MIPMAP_NEAREST */
+ 1223, /* GL_NEAREST_MIPMAP_LINEAR */
+ 832, /* GL_LINEAR_MIPMAP_LINEAR */
+ 2085, /* GL_TEXTURE_MAG_FILTER */
+ 2094, /* GL_TEXTURE_MIN_FILTER */
+ 2115, /* GL_TEXTURE_WRAP_S */
+ 2116, /* GL_TEXTURE_WRAP_T */
+ 155, /* GL_CLAMP */
+ 1599, /* GL_REPEAT */
+ 1396, /* GL_POLYGON_OFFSET_UNITS */
+ 1395, /* GL_POLYGON_OFFSET_POINT */
+ 1394, /* GL_POLYGON_OFFSET_LINE */
+ 1539, /* GL_R3_G3_B2 */
+ 2225, /* GL_V2F */
+ 2226, /* GL_V3F */
+ 152, /* GL_C4UB_V2F */
+ 153, /* GL_C4UB_V3F */
+ 150, /* GL_C3F_V3F */
+ 1217, /* GL_N3F_V3F */
+ 151, /* GL_C4F_N3F_V3F */
+ 1894, /* GL_T2F_V3F */
+ 1896, /* GL_T4F_V4F */
+ 1892, /* GL_T2F_C4UB_V3F */
+ 1890, /* GL_T2F_C3F_V3F */
+ 1893, /* GL_T2F_N3F_V3F */
+ 1891, /* GL_T2F_C4F_N3F_V3F */
+ 1895, /* GL_T4F_C4F_N3F_V4F */
+ 172, /* GL_CLIP_DISTANCE0 */
+ 173, /* GL_CLIP_DISTANCE1 */
+ 174, /* GL_CLIP_DISTANCE2 */
+ 175, /* GL_CLIP_DISTANCE3 */
+ 176, /* GL_CLIP_DISTANCE4 */
+ 177, /* GL_CLIP_DISTANCE5 */
+ 178, /* GL_CLIP_DISTANCE6 */
+ 179, /* GL_CLIP_DISTANCE7 */
+ 812, /* GL_LIGHT0 */
+ 813, /* GL_LIGHT1 */
+ 814, /* GL_LIGHT2 */
+ 815, /* GL_LIGHT3 */
+ 816, /* GL_LIGHT4 */
+ 817, /* GL_LIGHT5 */
+ 818, /* GL_LIGHT6 */
+ 819, /* GL_LIGHT7 */
+ 708, /* GL_HINT_BIT */
+ 322, /* GL_CONSTANT_COLOR */
+ 1271, /* GL_ONE_MINUS_CONSTANT_COLOR */
+ 317, /* GL_CONSTANT_ALPHA */
+ 1269, /* GL_ONE_MINUS_CONSTANT_ALPHA */
+ 89, /* GL_BLEND_COLOR */
+ 674, /* GL_FUNC_ADD */
+ 1149, /* GL_MIN */
+ 1017, /* GL_MAX */
+ 96, /* GL_BLEND_EQUATION */
+ 680, /* GL_FUNC_SUBTRACT */
+ 677, /* GL_FUNC_REVERSE_SUBTRACT */
+ 331, /* GL_CONVOLUTION_1D */
+ 332, /* GL_CONVOLUTION_2D */
+ 1752, /* GL_SEPARABLE_2D */
+ 335, /* GL_CONVOLUTION_BORDER_MODE */
+ 339, /* GL_CONVOLUTION_FILTER_SCALE */
+ 337, /* GL_CONVOLUTION_FILTER_BIAS */
+ 1554, /* GL_REDUCE */
+ 341, /* GL_CONVOLUTION_FORMAT */
+ 345, /* GL_CONVOLUTION_WIDTH */
+ 343, /* GL_CONVOLUTION_HEIGHT */
+ 1036, /* GL_MAX_CONVOLUTION_WIDTH */
+ 1034, /* GL_MAX_CONVOLUTION_HEIGHT */
+ 1435, /* GL_POST_CONVOLUTION_RED_SCALE */
+ 1431, /* GL_POST_CONVOLUTION_GREEN_SCALE */
+ 1426, /* GL_POST_CONVOLUTION_BLUE_SCALE */
+ 1422, /* GL_POST_CONVOLUTION_ALPHA_SCALE */
+ 1433, /* GL_POST_CONVOLUTION_RED_BIAS */
+ 1429, /* GL_POST_CONVOLUTION_GREEN_BIAS */
+ 1424, /* GL_POST_CONVOLUTION_BLUE_BIAS */
+ 1420, /* GL_POST_CONVOLUTION_ALPHA_BIAS */
+ 709, /* GL_HISTOGRAM */
+ 1495, /* GL_PROXY_HISTOGRAM */
+ 725, /* GL_HISTOGRAM_WIDTH */
+ 715, /* GL_HISTOGRAM_FORMAT */
+ 721, /* GL_HISTOGRAM_RED_SIZE */
+ 717, /* GL_HISTOGRAM_GREEN_SIZE */
+ 712, /* GL_HISTOGRAM_BLUE_SIZE */
+ 710, /* GL_HISTOGRAM_ALPHA_SIZE */
+ 719, /* GL_HISTOGRAM_LUMINANCE_SIZE */
+ 723, /* GL_HISTOGRAM_SINK */
+ 1150, /* GL_MINMAX */
+ 1152, /* GL_MINMAX_FORMAT */
+ 1154, /* GL_MINMAX_SINK */
+ 1897, /* GL_TABLE_TOO_LARGE_EXT */
+ 2174, /* GL_UNSIGNED_BYTE_3_3_2 */
+ 2214, /* GL_UNSIGNED_SHORT_4_4_4_4 */
+ 2217, /* GL_UNSIGNED_SHORT_5_5_5_1 */
+ 2186, /* GL_UNSIGNED_INT_8_8_8_8 */
+ 2177, /* GL_UNSIGNED_INT_10_10_10_2 */
+ 1393, /* GL_POLYGON_OFFSET_FILL */
+ 1392, /* GL_POLYGON_OFFSET_FACTOR */
+ 1391, /* GL_POLYGON_OFFSET_BIAS */
+ 1603, /* GL_RESCALE_NORMAL */
+ 41, /* GL_ALPHA4 */
+ 43, /* GL_ALPHA8 */
+ 33, /* GL_ALPHA12 */
+ 35, /* GL_ALPHA16 */
+ 879, /* GL_LUMINANCE4 */
+ 885, /* GL_LUMINANCE8 */
+ 865, /* GL_LUMINANCE12 */
+ 871, /* GL_LUMINANCE16 */
+ 880, /* GL_LUMINANCE4_ALPHA4 */
+ 883, /* GL_LUMINANCE6_ALPHA2 */
+ 888, /* GL_LUMINANCE8_ALPHA8 */
+ 868, /* GL_LUMINANCE12_ALPHA4 */
+ 866, /* GL_LUMINANCE12_ALPHA12 */
+ 874, /* GL_LUMINANCE16_ALPHA16 */
+ 753, /* GL_INTENSITY */
+ 762, /* GL_INTENSITY4 */
+ 764, /* GL_INTENSITY8 */
+ 754, /* GL_INTENSITY12 */
+ 756, /* GL_INTENSITY16 */
+ 1625, /* GL_RGB2_EXT */
+ 1631, /* GL_RGB4 */
+ 1634, /* GL_RGB5 */
+ 1641, /* GL_RGB8 */
+ 1611, /* GL_RGB10 */
+ 1615, /* GL_RGB12 */
+ 1617, /* GL_RGB16 */
+ 1661, /* GL_RGBA2 */
+ 1668, /* GL_RGBA4 */
+ 1637, /* GL_RGB5_A1 */
+ 1673, /* GL_RGBA8 */
+ 1612, /* GL_RGB10_A2 */
+ 1651, /* GL_RGBA12 */
+ 1653, /* GL_RGBA16 */
+ 2102, /* GL_TEXTURE_RED_SIZE */
+ 2070, /* GL_TEXTURE_GREEN_SIZE */
+ 1991, /* GL_TEXTURE_BLUE_SIZE */
+ 1971, /* GL_TEXTURE_ALPHA_SIZE */
+ 2083, /* GL_TEXTURE_LUMINANCE_SIZE */
+ 2074, /* GL_TEXTURE_INTENSITY_SIZE */
+ 1601, /* GL_REPLACE_EXT */
+ 1499, /* GL_PROXY_TEXTURE_1D */
+ 1503, /* GL_PROXY_TEXTURE_2D */
+ 2110, /* GL_TEXTURE_TOO_LARGE_EXT */
+ 2096, /* GL_TEXTURE_PRIORITY */
+ 2104, /* GL_TEXTURE_RESIDENT */
+ 1974, /* GL_TEXTURE_BINDING_1D */
+ 1977, /* GL_TEXTURE_BINDING_2D */
+ 1980, /* GL_TEXTURE_BINDING_3D */
+ 1307, /* GL_PACK_SKIP_IMAGES */
+ 1303, /* GL_PACK_IMAGE_HEIGHT */
+ 2167, /* GL_UNPACK_SKIP_IMAGES */
+ 2164, /* GL_UNPACK_IMAGE_HEIGHT */
+ 1969, /* GL_TEXTURE_3D */
+ 1507, /* GL_PROXY_TEXTURE_3D */
+ 2054, /* GL_TEXTURE_DEPTH */
+ 2113, /* GL_TEXTURE_WRAP_R */
+ 1018, /* GL_MAX_3D_TEXTURE_SIZE */
+ 2230, /* GL_VERTEX_ARRAY */
+ 1232, /* GL_NORMAL_ARRAY */
+ 189, /* GL_COLOR_ARRAY */
+ 737, /* GL_INDEX_ARRAY */
+ 2024, /* GL_TEXTURE_COORD_ARRAY */
+ 519, /* GL_EDGE_FLAG_ARRAY */
+ 2236, /* GL_VERTEX_ARRAY_SIZE */
+ 2238, /* GL_VERTEX_ARRAY_TYPE */
+ 2237, /* GL_VERTEX_ARRAY_STRIDE */
+ 1237, /* GL_NORMAL_ARRAY_TYPE */
+ 1236, /* GL_NORMAL_ARRAY_STRIDE */
+ 193, /* GL_COLOR_ARRAY_SIZE */
+ 195, /* GL_COLOR_ARRAY_TYPE */
+ 194, /* GL_COLOR_ARRAY_STRIDE */
+ 742, /* GL_INDEX_ARRAY_TYPE */
+ 741, /* GL_INDEX_ARRAY_STRIDE */
+ 2028, /* GL_TEXTURE_COORD_ARRAY_SIZE */
+ 2030, /* GL_TEXTURE_COORD_ARRAY_TYPE */
+ 2029, /* GL_TEXTURE_COORD_ARRAY_STRIDE */
+ 523, /* GL_EDGE_FLAG_ARRAY_STRIDE */
+ 2235, /* GL_VERTEX_ARRAY_POINTER */
+ 1235, /* GL_NORMAL_ARRAY_POINTER */
+ 192, /* GL_COLOR_ARRAY_POINTER */
+ 740, /* GL_INDEX_ARRAY_POINTER */
+ 2027, /* GL_TEXTURE_COORD_ARRAY_POINTER */
+ 522, /* GL_EDGE_FLAG_ARRAY_POINTER */
+ 1210, /* GL_MULTISAMPLE */
+ 1726, /* GL_SAMPLE_ALPHA_TO_COVERAGE */
+ 1728, /* GL_SAMPLE_ALPHA_TO_ONE */
+ 1733, /* GL_SAMPLE_COVERAGE */
+ 1730, /* GL_SAMPLE_BUFFERS */
+ 1721, /* GL_SAMPLES */
+ 1737, /* GL_SAMPLE_COVERAGE_VALUE */
+ 1735, /* GL_SAMPLE_COVERAGE_INVERT */
+ 237, /* GL_COLOR_MATRIX */
+ 239, /* GL_COLOR_MATRIX_STACK_DEPTH */
+ 1030, /* GL_MAX_COLOR_MATRIX_STACK_DEPTH */
+ 1418, /* GL_POST_COLOR_MATRIX_RED_SCALE */
+ 1414, /* GL_POST_COLOR_MATRIX_GREEN_SCALE */
+ 1409, /* GL_POST_COLOR_MATRIX_BLUE_SCALE */
+ 1405, /* GL_POST_COLOR_MATRIX_ALPHA_SCALE */
+ 1416, /* GL_POST_COLOR_MATRIX_RED_BIAS */
+ 1412, /* GL_POST_COLOR_MATRIX_GREEN_BIAS */
+ 1407, /* GL_POST_COLOR_MATRIX_BLUE_BIAS */
+ 1403, /* GL_POST_COLOR_MATRIX_ALPHA_BIAS */
+ 2007, /* GL_TEXTURE_COLOR_TABLE_SGI */
+ 1508, /* GL_PROXY_TEXTURE_COLOR_TABLE_SGI */
+ 2009, /* GL_TEXTURE_COMPARE_FAIL_VALUE_ARB */
+ 94, /* GL_BLEND_DST_RGB */
+ 108, /* GL_BLEND_SRC_RGB */
+ 92, /* GL_BLEND_DST_ALPHA */
+ 106, /* GL_BLEND_SRC_ALPHA */
+ 243, /* GL_COLOR_TABLE */
+ 1428, /* GL_POST_CONVOLUTION_COLOR_TABLE */
+ 1411, /* GL_POST_COLOR_MATRIX_COLOR_TABLE */
+ 1494, /* GL_PROXY_COLOR_TABLE */
+ 1498, /* GL_PROXY_POST_CONVOLUTION_COLOR_TABLE */
+ 1497, /* GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE */
+ 267, /* GL_COLOR_TABLE_SCALE */
+ 247, /* GL_COLOR_TABLE_BIAS */
+ 252, /* GL_COLOR_TABLE_FORMAT */
+ 269, /* GL_COLOR_TABLE_WIDTH */
+ 264, /* GL_COLOR_TABLE_RED_SIZE */
+ 255, /* GL_COLOR_TABLE_GREEN_SIZE */
+ 249, /* GL_COLOR_TABLE_BLUE_SIZE */
+ 244, /* GL_COLOR_TABLE_ALPHA_SIZE */
+ 261, /* GL_COLOR_TABLE_LUMINANCE_SIZE */
+ 258, /* GL_COLOR_TABLE_INTENSITY_SIZE */
+ 79, /* GL_BGR */
+ 80, /* GL_BGRA */
+ 1045, /* GL_MAX_ELEMENTS_VERTICES */
+ 1044, /* GL_MAX_ELEMENTS_INDICES */
+ 2073, /* GL_TEXTURE_INDEX_SIZE_EXT */
+ 186, /* GL_CLIP_VOLUME_CLIPPING_HINT_EXT */
+ 1374, /* GL_POINT_SIZE_MIN */
+ 1370, /* GL_POINT_SIZE_MAX */
+ 1359, /* GL_POINT_FADE_THRESHOLD_SIZE */
+ 1355, /* GL_POINT_DISTANCE_ATTENUATION */
+ 159, /* GL_CLAMP_TO_BORDER */
+ 162, /* GL_CLAMP_TO_EDGE */
+ 2095, /* GL_TEXTURE_MIN_LOD */
+ 2093, /* GL_TEXTURE_MAX_LOD */
+ 1973, /* GL_TEXTURE_BASE_LEVEL */
+ 2092, /* GL_TEXTURE_MAX_LEVEL */
+ 728, /* GL_IGNORE_BORDER_HP */
+ 321, /* GL_CONSTANT_BORDER_HP */
+ 1602, /* GL_REPLICATE_BORDER_HP */
+ 333, /* GL_CONVOLUTION_BORDER_COLOR */
+ 1266, /* GL_OCCLUSION_TEST_HP */
+ 1267, /* GL_OCCLUSION_TEST_RESULT_HP */
+ 830, /* GL_LINEAR_CLIPMAP_LINEAR_SGIX */
+ 2001, /* GL_TEXTURE_CLIPMAP_CENTER_SGIX */
+ 2003, /* GL_TEXTURE_CLIPMAP_FRAME_SGIX */
+ 2005, /* GL_TEXTURE_CLIPMAP_OFFSET_SGIX */
+ 2006, /* GL_TEXTURE_CLIPMAP_VIRTUAL_DEPTH_SGIX */
+ 2004, /* GL_TEXTURE_CLIPMAP_LOD_OFFSET_SGIX */
+ 2002, /* GL_TEXTURE_CLIPMAP_DEPTH_SGIX */
+ 1024, /* GL_MAX_CLIPMAP_DEPTH_SGIX */
+ 1025, /* GL_MAX_CLIPMAP_VIRTUAL_DEPTH_SGIX */
+ 1438, /* GL_POST_TEXTURE_FILTER_BIAS_SGIX */
+ 1440, /* GL_POST_TEXTURE_FILTER_SCALE_SGIX */
+ 1437, /* GL_POST_TEXTURE_FILTER_BIAS_RANGE_SGIX */
+ 1439, /* GL_POST_TEXTURE_FILTER_SCALE_RANGE_SGIX */
+ 2081, /* GL_TEXTURE_LOD_BIAS_S_SGIX */
+ 2082, /* GL_TEXTURE_LOD_BIAS_T_SGIX */
+ 2080, /* GL_TEXTURE_LOD_BIAS_R_SGIX */
+ 683, /* GL_GENERATE_MIPMAP */
+ 684, /* GL_GENERATE_MIPMAP_HINT */
+ 596, /* GL_FOG_OFFSET_SGIX */
+ 597, /* GL_FOG_OFFSET_VALUE_SGIX */
+ 2015, /* GL_TEXTURE_COMPARE_SGIX */
+ 2014, /* GL_TEXTURE_COMPARE_OPERATOR_SGIX */
+ 2077, /* GL_TEXTURE_LEQUAL_R_SGIX */
+ 2069, /* GL_TEXTURE_GEQUAL_R_SGIX */
+ 416, /* GL_DEPTH_COMPONENT16 */
+ 420, /* GL_DEPTH_COMPONENT24 */
+ 424, /* GL_DEPTH_COMPONENT32 */
+ 358, /* GL_CULL_VERTEX_EXT */
+ 360, /* GL_CULL_VERTEX_OBJECT_POSITION_EXT */
+ 359, /* GL_CULL_VERTEX_EYE_POSITION_EXT */
+ 2303, /* GL_WRAP_BORDER_SUN */
+ 2008, /* GL_TEXTURE_COLOR_WRITEMASK_SGIS */
+ 823, /* GL_LIGHT_MODEL_COLOR_CONTROL */
+ 1771, /* GL_SINGLE_COLOR */
+ 1755, /* GL_SEPARATE_SPECULAR_COLOR */
+ 1766, /* GL_SHARED_TEXTURE_PALETTE_EXT */
+ 608, /* GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING */
+ 609, /* GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE */
+ 620, /* GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE */
+ 611, /* GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE */
+ 607, /* GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE */
+ 606, /* GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE */
+ 610, /* GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE */
+ 621, /* GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE */
+ 638, /* GL_FRAMEBUFFER_DEFAULT */
+ 665, /* GL_FRAMEBUFFER_UNDEFINED */
+ 432, /* GL_DEPTH_STENCIL_ATTACHMENT */
+ 900, /* GL_MAJOR_VERSION */
+ 1156, /* GL_MINOR_VERSION */
+ 1247, /* GL_NUM_EXTENSIONS */
+ 327, /* GL_CONTEXT_FLAGS */
+ 736, /* GL_INDEX */
+ 410, /* GL_DEPTH_BUFFER */
+ 1845, /* GL_STENCIL_BUFFER */
+ 298, /* GL_COMPRESSED_RED */
+ 299, /* GL_COMPRESSED_RG */
+ 860, /* GL_LOSE_CONTEXT_ON_RESET_ARB */
+ 703, /* GL_GUILTY_CONTEXT_RESET_ARB */
+ 751, /* GL_INNOCENT_CONTEXT_RESET_ARB */
+ 2162, /* GL_UNKNOWN_CONTEXT_RESET_ARB */
+ 1605, /* GL_RESET_NOTIFICATION_STRATEGY_ARB */
+ 1244, /* GL_NO_RESET_NOTIFICATION_ARB */
+ 2173, /* GL_UNSIGNED_BYTE_2_3_3_REV */
+ 2218, /* GL_UNSIGNED_SHORT_5_6_5 */
+ 2219, /* GL_UNSIGNED_SHORT_5_6_5_REV */
+ 2215, /* GL_UNSIGNED_SHORT_4_4_4_4_REV */
+ 2212, /* GL_UNSIGNED_SHORT_1_5_5_5_REV */
+ 2187, /* GL_UNSIGNED_INT_8_8_8_8_REV */
+ 2183, /* GL_UNSIGNED_INT_2_10_10_10_REV */
+ 2090, /* GL_TEXTURE_MAX_CLAMP_S_SGIX */
+ 2091, /* GL_TEXTURE_MAX_CLAMP_T_SGIX */
+ 2089, /* GL_TEXTURE_MAX_CLAMP_R_SGIX */
+ 1160, /* GL_MIRRORED_REPEAT */
+ 1691, /* GL_RGB_S3TC */
+ 1633, /* GL_RGB4_S3TC */
+ 1687, /* GL_RGBA_S3TC */
+ 1672, /* GL_RGBA4_S3TC */
+ 1681, /* GL_RGBA_DXT5_S3TC */
+ 1669, /* GL_RGBA4_DXT5_S3TC */
+ 309, /* GL_COMPRESSED_RGB_S3TC_DXT1_EXT */
+ 304, /* GL_COMPRESSED_RGBA_S3TC_DXT1_EXT */
+ 305, /* GL_COMPRESSED_RGBA_S3TC_DXT3_EXT */
+ 306, /* GL_COMPRESSED_RGBA_S3TC_DXT5_EXT */
+ 1222, /* GL_NEAREST_CLIPMAP_NEAREST_SGIX */
+ 1221, /* GL_NEAREST_CLIPMAP_LINEAR_SGIX */
+ 831, /* GL_LINEAR_CLIPMAP_NEAREST_SGIX */
+ 583, /* GL_FOG_COORDINATE_SOURCE */
+ 575, /* GL_FOG_COORD */
+ 599, /* GL_FRAGMENT_DEPTH */
+ 364, /* GL_CURRENT_FOG_COORD */
+ 582, /* GL_FOG_COORDINATE_ARRAY_TYPE */
+ 581, /* GL_FOG_COORDINATE_ARRAY_STRIDE */
+ 580, /* GL_FOG_COORDINATE_ARRAY_POINTER */
+ 577, /* GL_FOG_COORDINATE_ARRAY */
+ 241, /* GL_COLOR_SUM */
+ 385, /* GL_CURRENT_SECONDARY_COLOR */
+ 1746, /* GL_SECONDARY_COLOR_ARRAY_SIZE */
+ 1748, /* GL_SECONDARY_COLOR_ARRAY_TYPE */
+ 1747, /* GL_SECONDARY_COLOR_ARRAY_STRIDE */
+ 1745, /* GL_SECONDARY_COLOR_ARRAY_POINTER */
+ 1742, /* GL_SECONDARY_COLOR_ARRAY */
+ 383, /* GL_CURRENT_RASTER_SECONDARY_COLOR */
+ 29, /* GL_ALIASED_POINT_SIZE_RANGE */
+ 28, /* GL_ALIASED_LINE_WIDTH_RANGE */
+ 1899, /* GL_TEXTURE0 */
+ 1901, /* GL_TEXTURE1 */
+ 1923, /* GL_TEXTURE2 */
+ 1945, /* GL_TEXTURE3 */
+ 1951, /* GL_TEXTURE4 */
+ 1953, /* GL_TEXTURE5 */
+ 1955, /* GL_TEXTURE6 */
+ 1957, /* GL_TEXTURE7 */
+ 1959, /* GL_TEXTURE8 */
+ 1961, /* GL_TEXTURE9 */
+ 1902, /* GL_TEXTURE10 */
+ 1904, /* GL_TEXTURE11 */
+ 1906, /* GL_TEXTURE12 */
+ 1908, /* GL_TEXTURE13 */
+ 1910, /* GL_TEXTURE14 */
+ 1912, /* GL_TEXTURE15 */
+ 1914, /* GL_TEXTURE16 */
+ 1916, /* GL_TEXTURE17 */
+ 1918, /* GL_TEXTURE18 */
+ 1920, /* GL_TEXTURE19 */
+ 1924, /* GL_TEXTURE20 */
+ 1926, /* GL_TEXTURE21 */
+ 1928, /* GL_TEXTURE22 */
+ 1930, /* GL_TEXTURE23 */
+ 1932, /* GL_TEXTURE24 */
+ 1934, /* GL_TEXTURE25 */
+ 1936, /* GL_TEXTURE26 */
+ 1938, /* GL_TEXTURE27 */
+ 1940, /* GL_TEXTURE28 */
+ 1942, /* GL_TEXTURE29 */
+ 1946, /* GL_TEXTURE30 */
+ 1948, /* GL_TEXTURE31 */
+ 19, /* GL_ACTIVE_TEXTURE */
+ 166, /* GL_CLIENT_ACTIVE_TEXTURE */
+ 1121, /* GL_MAX_TEXTURE_UNITS */
+ 2145, /* GL_TRANSPOSE_MODELVIEW_MATRIX */
+ 2148, /* GL_TRANSPOSE_PROJECTION_MATRIX */
+ 2150, /* GL_TRANSPOSE_TEXTURE_MATRIX */
+ 2142, /* GL_TRANSPOSE_COLOR_MATRIX */
+ 1881, /* GL_SUBTRACT */
+ 1102, /* GL_MAX_RENDERBUFFER_SIZE */
+ 290, /* GL_COMPRESSED_ALPHA */
+ 294, /* GL_COMPRESSED_LUMINANCE */
+ 295, /* GL_COMPRESSED_LUMINANCE_ALPHA */
+ 292, /* GL_COMPRESSED_INTENSITY */
+ 300, /* GL_COMPRESSED_RGB */
+ 301, /* GL_COMPRESSED_RGBA */
+ 2022, /* GL_TEXTURE_COMPRESSION_HINT */
+ 2099, /* GL_TEXTURE_RECTANGLE */
+ 1987, /* GL_TEXTURE_BINDING_RECTANGLE */
+ 1511, /* GL_PROXY_TEXTURE_RECTANGLE */
+ 1099, /* GL_MAX_RECTANGLE_TEXTURE_SIZE */
+ 431, /* GL_DEPTH_STENCIL */
+ 2179, /* GL_UNSIGNED_INT_24_8 */
+ 1116, /* GL_MAX_TEXTURE_LOD_BIAS */
+ 2088, /* GL_TEXTURE_MAX_ANISOTROPY_EXT */
+ 1118, /* GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT */
+ 2060, /* GL_TEXTURE_FILTER_CONTROL */
+ 2078, /* GL_TEXTURE_LOD_BIAS */
+ 274, /* GL_COMBINE4 */
+ 1108, /* GL_MAX_SHININESS_NV */
+ 1109, /* GL_MAX_SPOT_EXPONENT_NV */
+ 734, /* GL_INCR_WRAP */
+ 396, /* GL_DECR_WRAP */
+ 1180, /* GL_MODELVIEW1_ARB */
+ 1238, /* GL_NORMAL_MAP */
+ 1562, /* GL_REFLECTION_MAP */
+ 2032, /* GL_TEXTURE_CUBE_MAP */
+ 1984, /* GL_TEXTURE_BINDING_CUBE_MAP */
+ 2044, /* GL_TEXTURE_CUBE_MAP_POSITIVE_X */
+ 2034, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_X */
+ 2047, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Y */
+ 2037, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Y */
+ 2050, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Z */
+ 2040, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Z */
+ 1509, /* GL_PROXY_TEXTURE_CUBE_MAP */
+ 1038, /* GL_MAX_CUBE_MAP_TEXTURE_SIZE */
+ 1216, /* GL_MULTISAMPLE_FILTER_HINT_NV */
+ 1452, /* GL_PRIMITIVE_RESTART_NV */
+ 1451, /* GL_PRIMITIVE_RESTART_INDEX_NV */
+ 591, /* GL_FOG_DISTANCE_MODE_NV */
+ 538, /* GL_EYE_RADIAL_NV */
+ 537, /* GL_EYE_PLANE_ABSOLUTE_NV */
+ 273, /* GL_COMBINE */
+ 280, /* GL_COMBINE_RGB */
+ 275, /* GL_COMBINE_ALPHA */
+ 1692, /* GL_RGB_SCALE */
+ 25, /* GL_ADD_SIGNED */
+ 771, /* GL_INTERPOLATE */
+ 316, /* GL_CONSTANT */
+ 1444, /* GL_PRIMARY_COLOR */
+ 1441, /* GL_PREVIOUS */
+ 1786, /* GL_SOURCE0_RGB */
+ 1792, /* GL_SOURCE1_RGB */
+ 1798, /* GL_SOURCE2_RGB */
+ 1802, /* GL_SOURCE3_RGB_NV */
+ 1783, /* GL_SOURCE0_ALPHA */
+ 1789, /* GL_SOURCE1_ALPHA */
+ 1795, /* GL_SOURCE2_ALPHA */
+ 1801, /* GL_SOURCE3_ALPHA_NV */
+ 1280, /* GL_OPERAND0_RGB */
+ 1286, /* GL_OPERAND1_RGB */
+ 1292, /* GL_OPERAND2_RGB */
+ 1296, /* GL_OPERAND3_RGB_NV */
+ 1277, /* GL_OPERAND0_ALPHA */
+ 1283, /* GL_OPERAND1_ALPHA */
+ 1289, /* GL_OPERAND2_ALPHA */
+ 1295, /* GL_OPERAND3_ALPHA_NV */
+ 137, /* GL_BUFFER_OBJECT_APPLE */
+ 2231, /* GL_VERTEX_ARRAY_BINDING */
+ 2097, /* GL_TEXTURE_RANGE_LENGTH_APPLE */
+ 2098, /* GL_TEXTURE_RANGE_POINTER_APPLE */
+ 2308, /* GL_YCBCR_422_APPLE */
+ 2220, /* GL_UNSIGNED_SHORT_8_8_APPLE */
+ 2222, /* GL_UNSIGNED_SHORT_8_8_REV_APPLE */
+ 2109, /* GL_TEXTURE_STORAGE_HINT_APPLE */
+ 1872, /* GL_STORAGE_PRIVATE_APPLE */
+ 1871, /* GL_STORAGE_CACHED_APPLE */
+ 1873, /* GL_STORAGE_SHARED_APPLE */
+ 1773, /* GL_SLICE_ACCUM_SUN */
+ 1520, /* GL_QUAD_MESH_SUN */
+ 2156, /* GL_TRIANGLE_MESH_SUN */
+ 2273, /* GL_VERTEX_PROGRAM_ARB */
+ 2284, /* GL_VERTEX_STATE_PROGRAM_NV */
+ 2258, /* GL_VERTEX_ATTRIB_ARRAY_ENABLED */
+ 2266, /* GL_VERTEX_ATTRIB_ARRAY_SIZE */
+ 2268, /* GL_VERTEX_ATTRIB_ARRAY_STRIDE */
+ 2270, /* GL_VERTEX_ATTRIB_ARRAY_TYPE */
+ 387, /* GL_CURRENT_VERTEX_ATTRIB */
+ 1465, /* GL_PROGRAM_LENGTH_ARB */
+ 1481, /* GL_PROGRAM_STRING_ARB */
+ 1203, /* GL_MODELVIEW_PROJECTION_NV */
+ 727, /* GL_IDENTITY_NV */
+ 803, /* GL_INVERSE_NV */
+ 2147, /* GL_TRANSPOSE_NV */
+ 804, /* GL_INVERSE_TRANSPOSE_NV */
+ 1083, /* GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB */
+ 1082, /* GL_MAX_PROGRAM_MATRICES_ARB */
+ 964, /* GL_MATRIX0_NV */
+ 976, /* GL_MATRIX1_NV */
+ 988, /* GL_MATRIX2_NV */
+ 992, /* GL_MATRIX3_NV */
+ 994, /* GL_MATRIX4_NV */
+ 996, /* GL_MATRIX5_NV */
+ 998, /* GL_MATRIX6_NV */
+ 1000, /* GL_MATRIX7_NV */
+ 370, /* GL_CURRENT_MATRIX_STACK_DEPTH_ARB */
+ 367, /* GL_CURRENT_MATRIX_ARB */
+ 1478, /* GL_PROGRAM_POINT_SIZE */
+ 2279, /* GL_VERTEX_PROGRAM_TWO_SIDE */
+ 1477, /* GL_PROGRAM_PARAMETER_NV */
+ 2264, /* GL_VERTEX_ATTRIB_ARRAY_POINTER */
+ 1483, /* GL_PROGRAM_TARGET_NV */
+ 1480, /* GL_PROGRAM_RESIDENT_NV */
+ 2119, /* GL_TRACK_MATRIX_NV */
+ 2120, /* GL_TRACK_MATRIX_TRANSFORM_NV */
+ 2274, /* GL_VERTEX_PROGRAM_BINDING_NV */
+ 1459, /* GL_PROGRAM_ERROR_POSITION_ARB */
+ 412, /* GL_DEPTH_CLAMP */
+ 2239, /* GL_VERTEX_ATTRIB_ARRAY0_NV */
+ 2246, /* GL_VERTEX_ATTRIB_ARRAY1_NV */
+ 2247, /* GL_VERTEX_ATTRIB_ARRAY2_NV */
+ 2248, /* GL_VERTEX_ATTRIB_ARRAY3_NV */
+ 2249, /* GL_VERTEX_ATTRIB_ARRAY4_NV */
+ 2250, /* GL_VERTEX_ATTRIB_ARRAY5_NV */
+ 2251, /* GL_VERTEX_ATTRIB_ARRAY6_NV */
+ 2252, /* GL_VERTEX_ATTRIB_ARRAY7_NV */
+ 2253, /* GL_VERTEX_ATTRIB_ARRAY8_NV */
+ 2254, /* GL_VERTEX_ATTRIB_ARRAY9_NV */
+ 2240, /* GL_VERTEX_ATTRIB_ARRAY10_NV */
+ 2241, /* GL_VERTEX_ATTRIB_ARRAY11_NV */
+ 2242, /* GL_VERTEX_ATTRIB_ARRAY12_NV */
+ 2243, /* GL_VERTEX_ATTRIB_ARRAY13_NV */
+ 2244, /* GL_VERTEX_ATTRIB_ARRAY14_NV */
+ 2245, /* GL_VERTEX_ATTRIB_ARRAY15_NV */
+ 912, /* GL_MAP1_VERTEX_ATTRIB0_4_NV */
+ 919, /* GL_MAP1_VERTEX_ATTRIB1_4_NV */
+ 920, /* GL_MAP1_VERTEX_ATTRIB2_4_NV */
+ 921, /* GL_MAP1_VERTEX_ATTRIB3_4_NV */
+ 922, /* GL_MAP1_VERTEX_ATTRIB4_4_NV */
+ 923, /* GL_MAP1_VERTEX_ATTRIB5_4_NV */
+ 924, /* GL_MAP1_VERTEX_ATTRIB6_4_NV */
+ 925, /* GL_MAP1_VERTEX_ATTRIB7_4_NV */
+ 926, /* GL_MAP1_VERTEX_ATTRIB8_4_NV */
+ 927, /* GL_MAP1_VERTEX_ATTRIB9_4_NV */
+ 913, /* GL_MAP1_VERTEX_ATTRIB10_4_NV */
+ 914, /* GL_MAP1_VERTEX_ATTRIB11_4_NV */
+ 915, /* GL_MAP1_VERTEX_ATTRIB12_4_NV */
+ 916, /* GL_MAP1_VERTEX_ATTRIB13_4_NV */
+ 917, /* GL_MAP1_VERTEX_ATTRIB14_4_NV */
+ 918, /* GL_MAP1_VERTEX_ATTRIB15_4_NV */
+ 939, /* GL_MAP2_VERTEX_ATTRIB0_4_NV */
+ 946, /* GL_MAP2_VERTEX_ATTRIB1_4_NV */
+ 947, /* GL_MAP2_VERTEX_ATTRIB2_4_NV */
+ 948, /* GL_MAP2_VERTEX_ATTRIB3_4_NV */
+ 949, /* GL_MAP2_VERTEX_ATTRIB4_4_NV */
+ 950, /* GL_MAP2_VERTEX_ATTRIB5_4_NV */
+ 951, /* GL_MAP2_VERTEX_ATTRIB6_4_NV */
+ 1458, /* GL_PROGRAM_BINDING_ARB */
+ 953, /* GL_MAP2_VERTEX_ATTRIB8_4_NV */
+ 954, /* GL_MAP2_VERTEX_ATTRIB9_4_NV */
+ 940, /* GL_MAP2_VERTEX_ATTRIB10_4_NV */
+ 941, /* GL_MAP2_VERTEX_ATTRIB11_4_NV */
+ 942, /* GL_MAP2_VERTEX_ATTRIB12_4_NV */
+ 943, /* GL_MAP2_VERTEX_ATTRIB13_4_NV */
+ 944, /* GL_MAP2_VERTEX_ATTRIB14_4_NV */
+ 945, /* GL_MAP2_VERTEX_ATTRIB15_4_NV */
+ 2020, /* GL_TEXTURE_COMPRESSED_IMAGE_SIZE */
+ 2017, /* GL_TEXTURE_COMPRESSED */
+ 1245, /* GL_NUM_COMPRESSED_TEXTURE_FORMATS */
+ 314, /* GL_COMPRESSED_TEXTURE_FORMATS */
+ 1143, /* GL_MAX_VERTEX_UNITS_ARB */
+ 23, /* GL_ACTIVE_VERTEX_UNITS_ARB */
+ 2302, /* GL_WEIGHT_SUM_UNITY_ARB */
+ 2272, /* GL_VERTEX_BLEND_ARB */
+ 389, /* GL_CURRENT_WEIGHT_ARB */
+ 2300, /* GL_WEIGHT_ARRAY_TYPE_ARB */
+ 2298, /* GL_WEIGHT_ARRAY_STRIDE_ARB */
+ 2296, /* GL_WEIGHT_ARRAY_SIZE_ARB */
+ 2294, /* GL_WEIGHT_ARRAY_POINTER_ARB */
+ 2289, /* GL_WEIGHT_ARRAY_ARB */
+ 446, /* GL_DOT3_RGB */
+ 447, /* GL_DOT3_RGBA */
+ 308, /* GL_COMPRESSED_RGB_FXT1_3DFX */
+ 303, /* GL_COMPRESSED_RGBA_FXT1_3DFX */
+ 1211, /* GL_MULTISAMPLE_3DFX */
+ 1731, /* GL_SAMPLE_BUFFERS_3DFX */
+ 1722, /* GL_SAMPLES_3DFX */
+ 1191, /* GL_MODELVIEW2_ARB */
+ 1194, /* GL_MODELVIEW3_ARB */
+ 1195, /* GL_MODELVIEW4_ARB */
+ 1196, /* GL_MODELVIEW5_ARB */
+ 1197, /* GL_MODELVIEW6_ARB */
+ 1198, /* GL_MODELVIEW7_ARB */
+ 1199, /* GL_MODELVIEW8_ARB */
+ 1200, /* GL_MODELVIEW9_ARB */
+ 1170, /* GL_MODELVIEW10_ARB */
+ 1171, /* GL_MODELVIEW11_ARB */
+ 1172, /* GL_MODELVIEW12_ARB */
+ 1173, /* GL_MODELVIEW13_ARB */
+ 1174, /* GL_MODELVIEW14_ARB */
+ 1175, /* GL_MODELVIEW15_ARB */
+ 1176, /* GL_MODELVIEW16_ARB */
+ 1177, /* GL_MODELVIEW17_ARB */
+ 1178, /* GL_MODELVIEW18_ARB */
+ 1179, /* GL_MODELVIEW19_ARB */
+ 1181, /* GL_MODELVIEW20_ARB */
+ 1182, /* GL_MODELVIEW21_ARB */
+ 1183, /* GL_MODELVIEW22_ARB */
+ 1184, /* GL_MODELVIEW23_ARB */
+ 1185, /* GL_MODELVIEW24_ARB */
+ 1186, /* GL_MODELVIEW25_ARB */
+ 1187, /* GL_MODELVIEW26_ARB */
+ 1188, /* GL_MODELVIEW27_ARB */
+ 1189, /* GL_MODELVIEW28_ARB */
+ 1190, /* GL_MODELVIEW29_ARB */
+ 1192, /* GL_MODELVIEW30_ARB */
+ 1193, /* GL_MODELVIEW31_ARB */
+ 451, /* GL_DOT3_RGB_EXT */
+ 449, /* GL_DOT3_RGBA_EXT */
+ 1164, /* GL_MIRROR_CLAMP_EXT */
+ 1167, /* GL_MIRROR_CLAMP_TO_EDGE_EXT */
+ 1206, /* GL_MODULATE_ADD_ATI */
+ 1207, /* GL_MODULATE_SIGNED_ADD_ATI */
+ 1208, /* GL_MODULATE_SUBTRACT_ATI */
+ 2309, /* GL_YCBCR_MESA */
+ 1304, /* GL_PACK_INVERT_MESA */
+ 392, /* GL_DEBUG_OBJECT_MESA */
+ 393, /* GL_DEBUG_PRINT_MESA */
+ 391, /* GL_DEBUG_ASSERT_MESA */
+ 139, /* GL_BUFFER_SIZE */
+ 141, /* GL_BUFFER_USAGE */
+ 145, /* GL_BUMP_ROT_MATRIX_ATI */
+ 146, /* GL_BUMP_ROT_MATRIX_SIZE_ATI */
+ 144, /* GL_BUMP_NUM_TEX_UNITS_ATI */
+ 148, /* GL_BUMP_TEX_UNITS_ATI */
+ 511, /* GL_DUDV_ATI */
+ 510, /* GL_DU8DV8_ATI */
+ 143, /* GL_BUMP_ENVMAP_ATI */
+ 147, /* GL_BUMP_TARGET_ATI */
+ 1248, /* GL_NUM_PROGRAM_BINARY_FORMATS_OES */
+ 1456, /* GL_PROGRAM_BINARY_FORMATS_OES */
+ 1835, /* GL_STENCIL_BACK_FUNC */
+ 1833, /* GL_STENCIL_BACK_FAIL */
+ 1837, /* GL_STENCIL_BACK_PASS_DEPTH_FAIL */
+ 1839, /* GL_STENCIL_BACK_PASS_DEPTH_PASS */
+ 600, /* GL_FRAGMENT_PROGRAM_ARB */
+ 1454, /* GL_PROGRAM_ALU_INSTRUCTIONS_ARB */
+ 1486, /* GL_PROGRAM_TEX_INSTRUCTIONS_ARB */
+ 1485, /* GL_PROGRAM_TEX_INDIRECTIONS_ARB */
+ 1468, /* GL_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB */
+ 1474, /* GL_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB */
+ 1473, /* GL_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB */
+ 1072, /* GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB */
+ 1097, /* GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB */
+ 1096, /* GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB */
+ 1085, /* GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB */
+ 1091, /* GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB */
+ 1090, /* GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB */
+ 1663, /* GL_RGBA32F */
+ 1626, /* GL_RGB32F */
+ 1654, /* GL_RGBA16F */
+ 1618, /* GL_RGB16F */
+ 1682, /* GL_RGBA_FLOAT_MODE_ARB */
+ 1041, /* GL_MAX_DRAW_BUFFERS */
+ 455, /* GL_DRAW_BUFFER0 */
+ 458, /* GL_DRAW_BUFFER1 */
+ 479, /* GL_DRAW_BUFFER2 */
+ 482, /* GL_DRAW_BUFFER3 */
+ 485, /* GL_DRAW_BUFFER4 */
+ 488, /* GL_DRAW_BUFFER5 */
+ 491, /* GL_DRAW_BUFFER6 */
+ 494, /* GL_DRAW_BUFFER7 */
+ 497, /* GL_DRAW_BUFFER8 */
+ 500, /* GL_DRAW_BUFFER9 */
+ 459, /* GL_DRAW_BUFFER10 */
+ 462, /* GL_DRAW_BUFFER11 */
+ 465, /* GL_DRAW_BUFFER12 */
+ 468, /* GL_DRAW_BUFFER13 */
+ 471, /* GL_DRAW_BUFFER14 */
+ 474, /* GL_DRAW_BUFFER15 */
+ 97, /* GL_BLEND_EQUATION_ALPHA */
+ 1015, /* GL_MATRIX_PALETTE_ARB */
+ 1065, /* GL_MAX_MATRIX_PALETTE_STACK_DEPTH_ARB */
+ 1068, /* GL_MAX_PALETTE_MATRICES_ARB */
+ 373, /* GL_CURRENT_PALETTE_MATRIX_ARB */
+ 1003, /* GL_MATRIX_INDEX_ARRAY_ARB */
+ 368, /* GL_CURRENT_MATRIX_INDEX_ARB */
+ 1008, /* GL_MATRIX_INDEX_ARRAY_SIZE_ARB */
+ 1012, /* GL_MATRIX_INDEX_ARRAY_TYPE_ARB */
+ 1010, /* GL_MATRIX_INDEX_ARRAY_STRIDE_ARB */
+ 1006, /* GL_MATRIX_INDEX_ARRAY_POINTER_ARB */
+ 2055, /* GL_TEXTURE_DEPTH_SIZE */
+ 439, /* GL_DEPTH_TEXTURE_MODE */
+ 2012, /* GL_TEXTURE_COMPARE_MODE */
+ 2010, /* GL_TEXTURE_COMPARE_FUNC */
+ 284, /* GL_COMPARE_REF_TO_TEXTURE */
+ 1381, /* GL_POINT_SPRITE */
+ 347, /* GL_COORD_REPLACE */
+ 1386, /* GL_POINT_SPRITE_R_MODE_NV */
+ 1526, /* GL_QUERY_COUNTER_BITS */
+ 376, /* GL_CURRENT_QUERY */
+ 1530, /* GL_QUERY_RESULT */
+ 1532, /* GL_QUERY_RESULT_AVAILABLE */
+ 1135, /* GL_MAX_VERTEX_ATTRIBS */
+ 2262, /* GL_VERTEX_ATTRIB_ARRAY_NORMALIZED */
+ 437, /* GL_DEPTH_STENCIL_TO_RGBA_NV */
+ 436, /* GL_DEPTH_STENCIL_TO_BGRA_NV */
+ 1112, /* GL_MAX_TEXTURE_COORDS */
+ 1114, /* GL_MAX_TEXTURE_IMAGE_UNITS */
+ 1461, /* GL_PROGRAM_ERROR_STRING_ARB */
+ 1463, /* GL_PROGRAM_FORMAT_ASCII_ARB */
+ 1462, /* GL_PROGRAM_FORMAT_ARB */
+ 2111, /* GL_TEXTURE_UNSIGNED_REMAP_MODE_NV */
+ 409, /* GL_DEPTH_BOUNDS_TEST_EXT */
+ 408, /* GL_DEPTH_BOUNDS_EXT */
+ 61, /* GL_ARRAY_BUFFER */
+ 524, /* GL_ELEMENT_ARRAY_BUFFER */
+ 62, /* GL_ARRAY_BUFFER_BINDING */
+ 525, /* GL_ELEMENT_ARRAY_BUFFER_BINDING */
+ 2233, /* GL_VERTEX_ARRAY_BUFFER_BINDING */
+ 1233, /* GL_NORMAL_ARRAY_BUFFER_BINDING */
+ 190, /* GL_COLOR_ARRAY_BUFFER_BINDING */
+ 738, /* GL_INDEX_ARRAY_BUFFER_BINDING */
+ 2025, /* GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING */
+ 520, /* GL_EDGE_FLAG_ARRAY_BUFFER_BINDING */
+ 1743, /* GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING */
+ 578, /* GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING */
+ 2290, /* GL_WEIGHT_ARRAY_BUFFER_BINDING */
+ 2255, /* GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING */
+ 1464, /* GL_PROGRAM_INSTRUCTIONS_ARB */
+ 1078, /* GL_MAX_PROGRAM_INSTRUCTIONS_ARB */
+ 1470, /* GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB */
+ 1087, /* GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB */
+ 1484, /* GL_PROGRAM_TEMPORARIES_ARB */
+ 1093, /* GL_MAX_PROGRAM_TEMPORARIES_ARB */
+ 1472, /* GL_PROGRAM_NATIVE_TEMPORARIES_ARB */
+ 1089, /* GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB */
+ 1476, /* GL_PROGRAM_PARAMETERS_ARB */
+ 1092, /* GL_MAX_PROGRAM_PARAMETERS_ARB */
+ 1471, /* GL_PROGRAM_NATIVE_PARAMETERS_ARB */
+ 1088, /* GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB */
+ 1455, /* GL_PROGRAM_ATTRIBS_ARB */
+ 1073, /* GL_MAX_PROGRAM_ATTRIBS_ARB */
+ 1469, /* GL_PROGRAM_NATIVE_ATTRIBS_ARB */
+ 1086, /* GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB */
+ 1453, /* GL_PROGRAM_ADDRESS_REGISTERS_ARB */
+ 1071, /* GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB */
+ 1467, /* GL_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB */
+ 1084, /* GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB */
+ 1079, /* GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB */
+ 1075, /* GL_MAX_PROGRAM_ENV_PARAMETERS_ARB */
+ 1487, /* GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB */
+ 2144, /* GL_TRANSPOSE_CURRENT_MATRIX_ARB */
+ 1549, /* GL_READ_ONLY */
+ 2304, /* GL_WRITE_ONLY */
+ 1551, /* GL_READ_WRITE */
+ 124, /* GL_BUFFER_ACCESS */
+ 129, /* GL_BUFFER_MAPPED */
+ 134, /* GL_BUFFER_MAP_POINTER */
+ 2118, /* GL_TIME_ELAPSED_EXT */
+ 963, /* GL_MATRIX0_ARB */
+ 975, /* GL_MATRIX1_ARB */
+ 987, /* GL_MATRIX2_ARB */
+ 991, /* GL_MATRIX3_ARB */
+ 993, /* GL_MATRIX4_ARB */
+ 995, /* GL_MATRIX5_ARB */
+ 997, /* GL_MATRIX6_ARB */
+ 999, /* GL_MATRIX7_ARB */
+ 1001, /* GL_MATRIX8_ARB */
+ 1002, /* GL_MATRIX9_ARB */
+ 965, /* GL_MATRIX10_ARB */
+ 966, /* GL_MATRIX11_ARB */
+ 967, /* GL_MATRIX12_ARB */
+ 968, /* GL_MATRIX13_ARB */
+ 969, /* GL_MATRIX14_ARB */
+ 970, /* GL_MATRIX15_ARB */
+ 971, /* GL_MATRIX16_ARB */
+ 972, /* GL_MATRIX17_ARB */
+ 973, /* GL_MATRIX18_ARB */
+ 974, /* GL_MATRIX19_ARB */
+ 977, /* GL_MATRIX20_ARB */
+ 978, /* GL_MATRIX21_ARB */
+ 979, /* GL_MATRIX22_ARB */
+ 980, /* GL_MATRIX23_ARB */
+ 981, /* GL_MATRIX24_ARB */
+ 982, /* GL_MATRIX25_ARB */
+ 983, /* GL_MATRIX26_ARB */
+ 984, /* GL_MATRIX27_ARB */
+ 985, /* GL_MATRIX28_ARB */
+ 986, /* GL_MATRIX29_ARB */
+ 989, /* GL_MATRIX30_ARB */
+ 990, /* GL_MATRIX31_ARB */
+ 1876, /* GL_STREAM_DRAW */
+ 1878, /* GL_STREAM_READ */
+ 1874, /* GL_STREAM_COPY */
+ 1825, /* GL_STATIC_DRAW */
+ 1827, /* GL_STATIC_READ */
+ 1823, /* GL_STATIC_COPY */
+ 514, /* GL_DYNAMIC_DRAW */
+ 516, /* GL_DYNAMIC_READ */
+ 512, /* GL_DYNAMIC_COPY */
+ 1344, /* GL_PIXEL_PACK_BUFFER */
+ 1348, /* GL_PIXEL_UNPACK_BUFFER */
+ 1345, /* GL_PIXEL_PACK_BUFFER_BINDING */
+ 1349, /* GL_PIXEL_UNPACK_BUFFER_BINDING */
+ 400, /* GL_DEPTH24_STENCIL8 */
+ 2107, /* GL_TEXTURE_STENCIL_SIZE */
+ 2053, /* GL_TEXTURE_CUBE_MAP_SEAMLESS */
+ 1074, /* GL_MAX_PROGRAM_CALL_DEPTH_NV */
+ 1077, /* GL_MAX_PROGRAM_IF_DEPTH_NV */
+ 1081, /* GL_MAX_PROGRAM_LOOP_DEPTH_NV */
+ 1080, /* GL_MAX_PROGRAM_LOOP_COUNT_NV */
+ 2260, /* GL_VERTEX_ATTRIB_ARRAY_INTEGER */
+ 2257, /* GL_VERTEX_ATTRIB_ARRAY_DIVISOR_ARB */
+ 1020, /* GL_MAX_ARRAY_TEXTURE_LAYERS */
+ 1158, /* GL_MIN_PROGRAM_TEXEL_OFFSET */
+ 1094, /* GL_MAX_PROGRAM_TEXEL_OFFSET */
+ 1867, /* GL_STENCIL_TEST_TWO_SIDE_EXT */
+ 18, /* GL_ACTIVE_STENCIL_FACE_EXT */
+ 1165, /* GL_MIRROR_CLAMP_TO_BORDER_EXT */
+ 1724, /* GL_SAMPLES_PASSED */
+ 693, /* GL_GEOMETRY_VERTICES_OUT */
+ 687, /* GL_GEOMETRY_INPUT_TYPE */
+ 689, /* GL_GEOMETRY_OUTPUT_TYPE */
+ 1715, /* GL_SAMPLER_BINDING */
+ 164, /* GL_CLAMP_VERTEX_COLOR_ARB */
+ 156, /* GL_CLAMP_FRAGMENT_COLOR_ARB */
+ 157, /* GL_CLAMP_READ_COLOR */
+ 550, /* GL_FIXED_ONLY */
+ 1368, /* GL_POINT_SIZE_ARRAY_TYPE_OES */
+ 1367, /* GL_POINT_SIZE_ARRAY_STRIDE_OES */
+ 1366, /* GL_POINT_SIZE_ARRAY_POINTER_OES */
+ 1202, /* GL_MODELVIEW_MATRIX_FLOAT_AS_INT_BITS_OES */
+ 1490, /* GL_PROJECTION_MATRIX_FLOAT_AS_INT_BITS_OES */
+ 2087, /* GL_TEXTURE_MATRIX_FLOAT_AS_INT_BITS_OES */
+ 138, /* GL_BUFFER_SERIALIZED_MODIFY_APPLE */
+ 128, /* GL_BUFFER_FLUSHING_UNMAP_APPLE */
+ 1566, /* GL_RELEASED_APPLE */
+ 2287, /* GL_VOLATILE_APPLE */
+ 1606, /* GL_RETAINED_APPLE */
+ 2161, /* GL_UNDEFINED_APPLE */
+ 1514, /* GL_PURGEABLE_APPLE */
+ 601, /* GL_FRAGMENT_SHADER */
+ 2282, /* GL_VERTEX_SHADER */
+ 1475, /* GL_PROGRAM_OBJECT_ARB */
+ 1760, /* GL_SHADER_OBJECT_ARB */
+ 1049, /* GL_MAX_FRAGMENT_UNIFORM_COMPONENTS */
+ 1140, /* GL_MAX_VERTEX_UNIFORM_COMPONENTS */
+ 1131, /* GL_MAX_VARYING_COMPONENTS */
+ 1138, /* GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS */
+ 1032, /* GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS */
+ 1264, /* GL_OBJECT_TYPE_ARB */
+ 1762, /* GL_SHADER_TYPE */
+ 566, /* GL_FLOAT_VEC2 */
+ 568, /* GL_FLOAT_VEC3 */
+ 570, /* GL_FLOAT_VEC4 */
+ 791, /* GL_INT_VEC2 */
+ 793, /* GL_INT_VEC3 */
+ 795, /* GL_INT_VEC4 */
+ 116, /* GL_BOOL */
+ 118, /* GL_BOOL_VEC2 */
+ 120, /* GL_BOOL_VEC3 */
+ 122, /* GL_BOOL_VEC4 */
+ 554, /* GL_FLOAT_MAT2 */
+ 558, /* GL_FLOAT_MAT3 */
+ 562, /* GL_FLOAT_MAT4 */
+ 1699, /* GL_SAMPLER_1D */
+ 1705, /* GL_SAMPLER_2D */
+ 1713, /* GL_SAMPLER_3D */
+ 1718, /* GL_SAMPLER_CUBE */
+ 1704, /* GL_SAMPLER_1D_SHADOW */
+ 1712, /* GL_SAMPLER_2D_SHADOW */
+ 1710, /* GL_SAMPLER_2D_RECT */
+ 1711, /* GL_SAMPLER_2D_RECT_SHADOW */
+ 556, /* GL_FLOAT_MAT2x3 */
+ 557, /* GL_FLOAT_MAT2x4 */
+ 560, /* GL_FLOAT_MAT3x2 */
+ 561, /* GL_FLOAT_MAT3x4 */
+ 564, /* GL_FLOAT_MAT4x2 */
+ 565, /* GL_FLOAT_MAT4x3 */
+ 398, /* GL_DELETE_STATUS */
+ 289, /* GL_COMPILE_STATUS */
+ 852, /* GL_LINK_STATUS */
+ 2227, /* GL_VALIDATE_STATUS */
+ 750, /* GL_INFO_LOG_LENGTH */
+ 64, /* GL_ATTACHED_SHADERS */
+ 21, /* GL_ACTIVE_UNIFORMS */
+ 22, /* GL_ACTIVE_UNIFORM_MAX_LENGTH */
+ 1761, /* GL_SHADER_SOURCE_LENGTH */
+ 15, /* GL_ACTIVE_ATTRIBUTES */
+ 16, /* GL_ACTIVE_ATTRIBUTE_MAX_LENGTH */
+ 603, /* GL_FRAGMENT_SHADER_DERIVATIVE_HINT */
+ 1764, /* GL_SHADING_LANGUAGE_VERSION */
+ 375, /* GL_CURRENT_PROGRAM */
+ 1313, /* GL_PALETTE4_RGB8_OES */
+ 1315, /* GL_PALETTE4_RGBA8_OES */
+ 1311, /* GL_PALETTE4_R5_G6_B5_OES */
+ 1314, /* GL_PALETTE4_RGBA4_OES */
+ 1312, /* GL_PALETTE4_RGB5_A1_OES */
+ 1318, /* GL_PALETTE8_RGB8_OES */
+ 1320, /* GL_PALETTE8_RGBA8_OES */
+ 1316, /* GL_PALETTE8_R5_G6_B5_OES */
+ 1319, /* GL_PALETTE8_RGBA4_OES */
+ 1317, /* GL_PALETTE8_RGB5_A1_OES */
+ 731, /* GL_IMPLEMENTATION_COLOR_READ_TYPE */
+ 729, /* GL_IMPLEMENTATION_COLOR_READ_FORMAT */
+ 1365, /* GL_POINT_SIZE_ARRAY_OES */
+ 2031, /* GL_TEXTURE_CROP_RECT_OES */
+ 1004, /* GL_MATRIX_INDEX_ARRAY_BUFFER_BINDING_OES */
+ 1364, /* GL_POINT_SIZE_ARRAY_BUFFER_BINDING_OES */
+ 2210, /* GL_UNSIGNED_NORMALIZED */
+ 1964, /* GL_TEXTURE_1D_ARRAY */
+ 1500, /* GL_PROXY_TEXTURE_1D_ARRAY */
+ 1967, /* GL_TEXTURE_2D_ARRAY */
+ 1504, /* GL_PROXY_TEXTURE_2D_ARRAY */
+ 1975, /* GL_TEXTURE_BINDING_1D_ARRAY */
+ 1978, /* GL_TEXTURE_BINDING_2D_ARRAY */
+ 1056, /* GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS */
+ 1995, /* GL_TEXTURE_BUFFER */
+ 1110, /* GL_MAX_TEXTURE_BUFFER_SIZE */
+ 1982, /* GL_TEXTURE_BINDING_BUFFER */
+ 1997, /* GL_TEXTURE_BUFFER_DATA_STORE_BINDING */
+ 1999, /* GL_TEXTURE_BUFFER_FORMAT */
+ 1537, /* GL_R11F_G11F_B10F */
+ 2176, /* GL_UNSIGNED_INT_10F_11F_11F_REV */
+ 1649, /* GL_RGB9_E5 */
+ 2185, /* GL_UNSIGNED_INT_5_9_9_9_REV */
+ 2105, /* GL_TEXTURE_SHARED_SIZE */
+ 1817, /* GL_SRGB */
+ 1818, /* GL_SRGB8 */
+ 1820, /* GL_SRGB_ALPHA */
+ 1819, /* GL_SRGB8_ALPHA8 */
+ 1777, /* GL_SLUMINANCE_ALPHA */
+ 1776, /* GL_SLUMINANCE8_ALPHA8 */
+ 1774, /* GL_SLUMINANCE */
+ 1775, /* GL_SLUMINANCE8 */
+ 312, /* GL_COMPRESSED_SRGB */
+ 313, /* GL_COMPRESSED_SRGB_ALPHA */
+ 310, /* GL_COMPRESSED_SLUMINANCE */
+ 311, /* GL_COMPRESSED_SLUMINANCE_ALPHA */
+ 2140, /* GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH */
+ 2129, /* GL_TRANSFORM_FEEDBACK_BUFFER_MODE */
+ 1129, /* GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS */
+ 2138, /* GL_TRANSFORM_FEEDBACK_VARYINGS */
+ 2134, /* GL_TRANSFORM_FEEDBACK_BUFFER_START */
+ 2132, /* GL_TRANSFORM_FEEDBACK_BUFFER_SIZE */
+ 1447, /* GL_PRIMITIVES_GENERATED */
+ 2136, /* GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN */
+ 1541, /* GL_RASTERIZER_DISCARD */
+ 1125, /* GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS */
+ 1127, /* GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS */
+ 769, /* GL_INTERLEAVED_ATTRIBS */
+ 1753, /* GL_SEPARATE_ATTRIBS */
+ 2124, /* GL_TRANSFORM_FEEDBACK_BUFFER */
+ 2126, /* GL_TRANSFORM_FEEDBACK_BUFFER_BINDING */
+ 1383, /* GL_POINT_SPRITE_COORD_ORIGIN */
+ 861, /* GL_LOWER_LEFT */
+ 2224, /* GL_UPPER_LEFT */
+ 1841, /* GL_STENCIL_BACK_REF */
+ 1842, /* GL_STENCIL_BACK_VALUE_MASK */
+ 1843, /* GL_STENCIL_BACK_WRITEMASK */
+ 504, /* GL_DRAW_FRAMEBUFFER_BINDING */
+ 1571, /* GL_RENDERBUFFER_BINDING */
+ 1545, /* GL_READ_FRAMEBUFFER */
+ 503, /* GL_DRAW_FRAMEBUFFER */
+ 1546, /* GL_READ_FRAMEBUFFER_BINDING */
+ 1590, /* GL_RENDERBUFFER_SAMPLES */
+ 617, /* GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE */
+ 614, /* GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME */
+ 629, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL */
+ 624, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE */
+ 627, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER */
+ 635, /* GL_FRAMEBUFFER_COMPLETE */
+ 640, /* GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT */
+ 655, /* GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT */
+ 649, /* GL_FRAMEBUFFER_INCOMPLETE_DUPLICATE_ATTACHMENT_EXT */
+ 644, /* GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT */
+ 650, /* GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT */
+ 646, /* GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER */
+ 660, /* GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER */
+ 666, /* GL_FRAMEBUFFER_UNSUPPORTED */
+ 664, /* GL_FRAMEBUFFER_STATUS_ERROR_EXT */
+ 1028, /* GL_MAX_COLOR_ATTACHMENTS */
+ 196, /* GL_COLOR_ATTACHMENT0 */
+ 199, /* GL_COLOR_ATTACHMENT1 */
+ 213, /* GL_COLOR_ATTACHMENT2 */
+ 215, /* GL_COLOR_ATTACHMENT3 */
+ 217, /* GL_COLOR_ATTACHMENT4 */
+ 219, /* GL_COLOR_ATTACHMENT5 */
+ 221, /* GL_COLOR_ATTACHMENT6 */
+ 223, /* GL_COLOR_ATTACHMENT7 */
+ 225, /* GL_COLOR_ATTACHMENT8 */
+ 227, /* GL_COLOR_ATTACHMENT9 */
+ 200, /* GL_COLOR_ATTACHMENT10 */
+ 202, /* GL_COLOR_ATTACHMENT11 */
+ 204, /* GL_COLOR_ATTACHMENT12 */
+ 206, /* GL_COLOR_ATTACHMENT13 */
+ 208, /* GL_COLOR_ATTACHMENT14 */
+ 210, /* GL_COLOR_ATTACHMENT15 */
+ 403, /* GL_DEPTH_ATTACHMENT */
+ 1830, /* GL_STENCIL_ATTACHMENT */
+ 605, /* GL_FRAMEBUFFER */
+ 1568, /* GL_RENDERBUFFER */
+ 1594, /* GL_RENDERBUFFER_WIDTH */
+ 1581, /* GL_RENDERBUFFER_HEIGHT */
+ 1584, /* GL_RENDERBUFFER_INTERNAL_FORMAT */
+ 1862, /* GL_STENCIL_INDEX_EXT */
+ 1851, /* GL_STENCIL_INDEX1 */
+ 1856, /* GL_STENCIL_INDEX4 */
+ 1859, /* GL_STENCIL_INDEX8 */
+ 1852, /* GL_STENCIL_INDEX16 */
+ 1588, /* GL_RENDERBUFFER_RED_SIZE */
+ 1579, /* GL_RENDERBUFFER_GREEN_SIZE */
+ 1574, /* GL_RENDERBUFFER_BLUE_SIZE */
+ 1569, /* GL_RENDERBUFFER_ALPHA_SIZE */
+ 1576, /* GL_RENDERBUFFER_DEPTH_SIZE */
+ 1592, /* GL_RENDERBUFFER_STENCIL_SIZE */
+ 658, /* GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE */
+ 1105, /* GL_MAX_SAMPLES */
+ 2067, /* GL_TEXTURE_GEN_STR_OES */
+ 705, /* GL_HALF_FLOAT_OES */
+ 1636, /* GL_RGB565_OES */
+ 1666, /* GL_RGBA32UI */
+ 1629, /* GL_RGB32UI */
+ 40, /* GL_ALPHA32UI_EXT */
+ 761, /* GL_INTENSITY32UI_EXT */
+ 878, /* GL_LUMINANCE32UI_EXT */
+ 895, /* GL_LUMINANCE_ALPHA32UI_EXT */
+ 1657, /* GL_RGBA16UI */
+ 1621, /* GL_RGB16UI */
+ 37, /* GL_ALPHA16UI_EXT */
+ 758, /* GL_INTENSITY16UI_EXT */
+ 873, /* GL_LUMINANCE16UI_EXT */
+ 893, /* GL_LUMINANCE_ALPHA16UI_EXT */
+ 1676, /* GL_RGBA8UI */
+ 1644, /* GL_RGB8UI */
+ 45, /* GL_ALPHA8UI_EXT */
+ 766, /* GL_INTENSITY8UI_EXT */
+ 887, /* GL_LUMINANCE8UI_EXT */
+ 897, /* GL_LUMINANCE_ALPHA8UI_EXT */
+ 1664, /* GL_RGBA32I */
+ 1627, /* GL_RGB32I */
+ 39, /* GL_ALPHA32I_EXT */
+ 760, /* GL_INTENSITY32I_EXT */
+ 877, /* GL_LUMINANCE32I_EXT */
+ 894, /* GL_LUMINANCE_ALPHA32I_EXT */
+ 1655, /* GL_RGBA16I */
+ 1619, /* GL_RGB16I */
+ 36, /* GL_ALPHA16I_EXT */
+ 757, /* GL_INTENSITY16I_EXT */
+ 872, /* GL_LUMINANCE16I_EXT */
+ 892, /* GL_LUMINANCE_ALPHA16I_EXT */
+ 1674, /* GL_RGBA8I */
+ 1642, /* GL_RGB8I */
+ 44, /* GL_ALPHA8I_EXT */
+ 765, /* GL_INTENSITY8I_EXT */
+ 886, /* GL_LUMINANCE8I_EXT */
+ 896, /* GL_LUMINANCE_ALPHA8I_EXT */
+ 1558, /* GL_RED_INTEGER */
+ 700, /* GL_GREEN_INTEGER */
+ 113, /* GL_BLUE_INTEGER */
+ 49, /* GL_ALPHA_INTEGER_EXT */
+ 1689, /* GL_RGB_INTEGER */
+ 1683, /* GL_RGBA_INTEGER */
+ 84, /* GL_BGR_INTEGER */
+ 82, /* GL_BGRA_INTEGER */
+ 899, /* GL_LUMINANCE_INTEGER_EXT */
+ 898, /* GL_LUMINANCE_ALPHA_INTEGER_EXT */
+ 1685, /* GL_RGBA_INTEGER_MODE_EXT */
+ 612, /* GL_FRAMEBUFFER_ATTACHMENT_LAYERED */
+ 653, /* GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS */
+ 652, /* GL_FRAMEBUFFER_INCOMPLETE_LAYER_COUNT_ARB */
+ 1700, /* GL_SAMPLER_1D_ARRAY */
+ 1706, /* GL_SAMPLER_2D_ARRAY */
+ 1716, /* GL_SAMPLER_BUFFER */
+ 1702, /* GL_SAMPLER_1D_ARRAY_SHADOW */
+ 1708, /* GL_SAMPLER_2D_ARRAY_SHADOW */
+ 1719, /* GL_SAMPLER_CUBE_SHADOW */
+ 2204, /* GL_UNSIGNED_INT_VEC2 */
+ 2206, /* GL_UNSIGNED_INT_VEC3 */
+ 2208, /* GL_UNSIGNED_INT_VEC4 */
+ 775, /* GL_INT_SAMPLER_1D */
+ 779, /* GL_INT_SAMPLER_2D */
+ 785, /* GL_INT_SAMPLER_3D */
+ 789, /* GL_INT_SAMPLER_CUBE */
+ 783, /* GL_INT_SAMPLER_2D_RECT */
+ 776, /* GL_INT_SAMPLER_1D_ARRAY */
+ 780, /* GL_INT_SAMPLER_2D_ARRAY */
+ 787, /* GL_INT_SAMPLER_BUFFER */
+ 2188, /* GL_UNSIGNED_INT_SAMPLER_1D */
+ 2192, /* GL_UNSIGNED_INT_SAMPLER_2D */
+ 2198, /* GL_UNSIGNED_INT_SAMPLER_3D */
+ 2202, /* GL_UNSIGNED_INT_SAMPLER_CUBE */
+ 2196, /* GL_UNSIGNED_INT_SAMPLER_2D_RECT */
+ 2189, /* GL_UNSIGNED_INT_SAMPLER_1D_ARRAY */
+ 2193, /* GL_UNSIGNED_INT_SAMPLER_2D_ARRAY */
+ 2200, /* GL_UNSIGNED_INT_SAMPLER_BUFFER */
+ 691, /* GL_GEOMETRY_SHADER */
+ 694, /* GL_GEOMETRY_VERTICES_OUT_ARB */
+ 688, /* GL_GEOMETRY_INPUT_TYPE_ARB */
+ 690, /* GL_GEOMETRY_OUTPUT_TYPE_ARB */
+ 1062, /* GL_MAX_GEOMETRY_VARYING_COMPONENTS_ARB */
+ 1145, /* GL_MAX_VERTEX_VARYING_COMPONENTS_ARB */
+ 1060, /* GL_MAX_GEOMETRY_UNIFORM_COMPONENTS */
+ 1054, /* GL_MAX_GEOMETRY_OUTPUT_VERTICES */
+ 1058, /* GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS */
+ 862, /* GL_LOW_FLOAT */
+ 1147, /* GL_MEDIUM_FLOAT */
+ 706, /* GL_HIGH_FLOAT */
+ 863, /* GL_LOW_INT */
+ 1148, /* GL_MEDIUM_INT */
+ 707, /* GL_HIGH_INT */
+ 2178, /* GL_UNSIGNED_INT_10_10_10_2_OES */
+ 774, /* GL_INT_10_10_10_2_OES */
+ 1758, /* GL_SHADER_BINARY_FORMATS */
+ 1249, /* GL_NUM_SHADER_BINARY_FORMATS */
+ 1759, /* GL_SHADER_COMPILER */
+ 1142, /* GL_MAX_VERTEX_UNIFORM_VECTORS */
+ 1134, /* GL_MAX_VARYING_VECTORS */
+ 1051, /* GL_MAX_FRAGMENT_UNIFORM_VECTORS */
+ 1534, /* GL_QUERY_WAIT */
+ 1528, /* GL_QUERY_NO_WAIT */
+ 1524, /* GL_QUERY_BY_REGION_WAIT */
+ 1522, /* GL_QUERY_BY_REGION_NO_WAIT */
+ 2122, /* GL_TRANSFORM_FEEDBACK */
+ 2131, /* GL_TRANSFORM_FEEDBACK_BUFFER_PAUSED */
+ 2125, /* GL_TRANSFORM_FEEDBACK_BUFFER_ACTIVE */
+ 2123, /* GL_TRANSFORM_FEEDBACK_BINDING */
+ 1518, /* GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION */
+ 546, /* GL_FIRST_VERTEX_CONVENTION */
+ 807, /* GL_LAST_VERTEX_CONVENTION */
+ 1492, /* GL_PROVOKING_VERTEX */
+ 354, /* GL_COPY_READ_BUFFER */
+ 355, /* GL_COPY_WRITE_BUFFER */
+ 1561, /* GL_RED_SNORM */
+ 1696, /* GL_RG_SNORM */
+ 1695, /* GL_RGB_SNORM */
+ 1688, /* GL_RGBA_SNORM */
+ 1540, /* GL_R8_SNORM */
+ 1609, /* GL_RG8_SNORM */
+ 1648, /* GL_RGB8_SNORM */
+ 1680, /* GL_RGBA8_SNORM */
+ 1538, /* GL_R16_SNORM */
+ 1608, /* GL_RG16_SNORM */
+ 1624, /* GL_RGB16_SNORM */
+ 1660, /* GL_RGBA16_SNORM */
+ 1770, /* GL_SIGNED_NORMALIZED */
+ 1449, /* GL_PRIMITIVE_RESTART */
+ 1450, /* GL_PRIMITIVE_RESTART_INDEX */
+ 1107, /* GL_MAX_SERVER_WAIT_TIMEOUT */
+ 1263, /* GL_OBJECT_TYPE */
+ 1883, /* GL_SYNC_CONDITION */
+ 1888, /* GL_SYNC_STATUS */
+ 1885, /* GL_SYNC_FLAGS */
+ 1884, /* GL_SYNC_FENCE */
+ 1887, /* GL_SYNC_GPU_COMMANDS_COMPLETE */
+ 2171, /* GL_UNSIGNALED */
+ 1769, /* GL_SIGNALED */
+ 54, /* GL_ALREADY_SIGNALED */
+ 2117, /* GL_TIMEOUT_EXPIRED */
+ 315, /* GL_CONDITION_SATISFIED */
+ 2288, /* GL_WAIT_FAILED */
+ 126, /* GL_BUFFER_ACCESS_FLAGS */
+ 132, /* GL_BUFFER_MAP_LENGTH */
+ 133, /* GL_BUFFER_MAP_OFFSET */
+ 1137, /* GL_MAX_VERTEX_OUTPUT_COMPONENTS */
+ 1052, /* GL_MAX_GEOMETRY_INPUT_COMPONENTS */
+ 1053, /* GL_MAX_GEOMETRY_OUTPUT_COMPONENTS */
+ 1048, /* GL_MAX_FRAGMENT_INPUT_COMPONENTS */
+ 330, /* GL_CONTEXT_PROFILE_MASK */
+ 531, /* GL_EVAL_BIT */
+ 1543, /* GL_RASTER_POSITION_UNCLIPPED_IBM */
+ 854, /* GL_LIST_BIT */
+ 1990, /* GL_TEXTURE_BIT */
+ 1739, /* GL_SCISSOR_BIT */
+ 30, /* GL_ALL_ATTRIB_BITS */
+ 1213, /* GL_MULTISAMPLE_BIT */
+ 31, /* GL_ALL_CLIENT_ATTRIB_BITS */
+};
+
+typedef int (*cfunc)(const void *, const void *);
+
+/**
+ * Compare a key name to an element in the \c all_enums array.
+ *
+ * \c bsearch always passes the key as the first parameter and the pointer
+ * to the array element as the second parameter. We can elimiate some
+ * extra work by taking advantage of that fact.
+ *
+ * \param a Pointer to the desired enum name.
+ * \param b Pointer to an element of the \c all_enums array.
+ */
+static int compar_name( const char *a, const enum_elt *b )
+{
+ return strcmp( a, & enum_string_table[ b->offset ] );
+}
+
+/**
+ * Compare a key enum value to an element in the \c all_enums array.
+ *
+ * \c bsearch always passes the key as the first parameter and the pointer
+ * to the array element as the second parameter. We can elimiate some
+ * extra work by taking advantage of that fact.
+ *
+ * \param a Pointer to the desired enum name.
+ * \param b Pointer to an index into the \c all_enums array.
+ */
+static int compar_nr( const int *a, const unsigned *b )
+{
+ return a[0] - all_enums[*b].n;
+}
+
+
+static char token_tmp[20];
+
+const char *_mesa_lookup_enum_by_nr( int nr )
+{
+ unsigned * i;
+
+ i = (unsigned *) _mesa_bsearch(& nr, reduced_enums,
+ Elements(reduced_enums),
+ sizeof(reduced_enums[0]),
+ (cfunc) compar_nr);
+
+ if ( i != NULL ) {
+ return & enum_string_table[ all_enums[ *i ].offset ];
+ }
+ else {
+ /* this is not re-entrant safe, no big deal here */
+ _mesa_snprintf(token_tmp, sizeof(token_tmp) - 1, "0x%x", nr);
+ token_tmp[sizeof(token_tmp) - 1] = '\0';
+ return token_tmp;
+ }
+}
+
+/**
+ * Primitive names
+ */
+static const char *prim_names[PRIM_UNKNOWN + 1] = {
+ "GL_POINTS",
+ "GL_LINES",
+ "GL_LINE_LOOP",
+ "GL_LINE_STRIP",
+ "GL_TRIANGLES",
+ "GL_TRIANGLE_STRIP",
+ "GL_TRIANGLE_FAN",
+ "GL_QUADS",
+ "GL_QUAD_STRIP",
+ "GL_POLYGON",
+ "outside begin/end",
+ "inside unknown primitive",
+ "unknown state"
+};
+
+
+/* Get the name of an enum given that it is a primitive type. Avoids
+ * GL_FALSE/GL_POINTS ambiguity and others.
+ */
+const char *
+_mesa_lookup_prim_by_nr(GLuint nr)
+{
+ if (nr < Elements(prim_names))
+ return prim_names[nr];
+ else
+ return "invalid mode";
+}
+
+
+int _mesa_lookup_enum_by_name( const char *symbol )
+{
+ enum_elt * f = NULL;
+
+ if ( symbol != NULL ) {
+ f = (enum_elt *) _mesa_bsearch(symbol, all_enums,
+ Elements(all_enums),
+ sizeof( enum_elt ),
+ (cfunc) compar_name);
+ }
+
+ return (f != NULL) ? f->n : -1;
+}
+
+
diff --git a/mesalib/src/mesa/main/eval.c b/mesalib/src/mesa/main/eval.c
index e651715f7..2deaddc19 100644
--- a/mesalib/src/mesa/main/eval.c
+++ b/mesalib/src/mesa/main/eval.c
@@ -1,1091 +1,1091 @@
-
-/*
- * Mesa 3-D graphics library
- * Version: 5.1
- *
- * Copyright (C) 1999-2003 Brian Paul All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-
-/*
- * eval.c was written by
- * Bernd Barsuhn (bdbarsuh@cip.informatik.uni-erlangen.de) and
- * Volker Weiss (vrweiss@cip.informatik.uni-erlangen.de).
- *
- * My original implementation of evaluators was simplistic and didn't
- * compute surface normal vectors properly. Bernd and Volker applied
- * used more sophisticated methods to get better results.
- *
- * Thanks guys!
- */
-
-
-#include "glheader.h"
-#include "imports.h"
-#include "colormac.h"
-#include "context.h"
-#include "eval.h"
-#include "macros.h"
-#include "mfeatures.h"
-#include "mtypes.h"
-#include "main/dispatch.h"
-
-
-#if FEATURE_evaluators
-
-
-/*
- * Return the number of components per control point for any type of
- * evaluator. Return 0 if bad target.
- * See table 5.1 in the OpenGL 1.2 spec.
- */
-GLuint _mesa_evaluator_components( GLenum target )
-{
- switch (target) {
- case GL_MAP1_VERTEX_3: return 3;
- case GL_MAP1_VERTEX_4: return 4;
- case GL_MAP1_INDEX: return 1;
- case GL_MAP1_COLOR_4: return 4;
- case GL_MAP1_NORMAL: return 3;
- case GL_MAP1_TEXTURE_COORD_1: return 1;
- case GL_MAP1_TEXTURE_COORD_2: return 2;
- case GL_MAP1_TEXTURE_COORD_3: return 3;
- case GL_MAP1_TEXTURE_COORD_4: return 4;
- case GL_MAP2_VERTEX_3: return 3;
- case GL_MAP2_VERTEX_4: return 4;
- case GL_MAP2_INDEX: return 1;
- case GL_MAP2_COLOR_4: return 4;
- case GL_MAP2_NORMAL: return 3;
- case GL_MAP2_TEXTURE_COORD_1: return 1;
- case GL_MAP2_TEXTURE_COORD_2: return 2;
- case GL_MAP2_TEXTURE_COORD_3: return 3;
- case GL_MAP2_TEXTURE_COORD_4: return 4;
- default: break;
- }
-
- /* XXX need to check for the vertex program extension
- if (!ctx->Extensions.NV_vertex_program)
- return 0;
- */
-
- if (target >= GL_MAP1_VERTEX_ATTRIB0_4_NV &&
- target <= GL_MAP1_VERTEX_ATTRIB15_4_NV)
- return 4;
-
- if (target >= GL_MAP2_VERTEX_ATTRIB0_4_NV &&
- target <= GL_MAP2_VERTEX_ATTRIB15_4_NV)
- return 4;
-
- return 0;
-}
-
-
-/*
- * Return pointer to the gl_1d_map struct for the named target.
- */
-static struct gl_1d_map *
-get_1d_map( struct gl_context *ctx, GLenum target )
-{
- switch (target) {
- case GL_MAP1_VERTEX_3:
- return &ctx->EvalMap.Map1Vertex3;
- case GL_MAP1_VERTEX_4:
- return &ctx->EvalMap.Map1Vertex4;
- case GL_MAP1_INDEX:
- return &ctx->EvalMap.Map1Index;
- case GL_MAP1_COLOR_4:
- return &ctx->EvalMap.Map1Color4;
- case GL_MAP1_NORMAL:
- return &ctx->EvalMap.Map1Normal;
- case GL_MAP1_TEXTURE_COORD_1:
- return &ctx->EvalMap.Map1Texture1;
- case GL_MAP1_TEXTURE_COORD_2:
- return &ctx->EvalMap.Map1Texture2;
- case GL_MAP1_TEXTURE_COORD_3:
- return &ctx->EvalMap.Map1Texture3;
- case GL_MAP1_TEXTURE_COORD_4:
- return &ctx->EvalMap.Map1Texture4;
- case GL_MAP1_VERTEX_ATTRIB0_4_NV:
- case GL_MAP1_VERTEX_ATTRIB1_4_NV:
- case GL_MAP1_VERTEX_ATTRIB2_4_NV:
- case GL_MAP1_VERTEX_ATTRIB3_4_NV:
- case GL_MAP1_VERTEX_ATTRIB4_4_NV:
- case GL_MAP1_VERTEX_ATTRIB5_4_NV:
- case GL_MAP1_VERTEX_ATTRIB6_4_NV:
- case GL_MAP1_VERTEX_ATTRIB7_4_NV:
- case GL_MAP1_VERTEX_ATTRIB8_4_NV:
- case GL_MAP1_VERTEX_ATTRIB9_4_NV:
- case GL_MAP1_VERTEX_ATTRIB10_4_NV:
- case GL_MAP1_VERTEX_ATTRIB11_4_NV:
- case GL_MAP1_VERTEX_ATTRIB12_4_NV:
- case GL_MAP1_VERTEX_ATTRIB13_4_NV:
- case GL_MAP1_VERTEX_ATTRIB14_4_NV:
- case GL_MAP1_VERTEX_ATTRIB15_4_NV:
- if (!ctx->Extensions.NV_vertex_program)
- return NULL;
- return &ctx->EvalMap.Map1Attrib[target - GL_MAP1_VERTEX_ATTRIB0_4_NV];
- default:
- return NULL;
- }
-}
-
-
-/*
- * Return pointer to the gl_2d_map struct for the named target.
- */
-static struct gl_2d_map *
-get_2d_map( struct gl_context *ctx, GLenum target )
-{
- switch (target) {
- case GL_MAP2_VERTEX_3:
- return &ctx->EvalMap.Map2Vertex3;
- case GL_MAP2_VERTEX_4:
- return &ctx->EvalMap.Map2Vertex4;
- case GL_MAP2_INDEX:
- return &ctx->EvalMap.Map2Index;
- case GL_MAP2_COLOR_4:
- return &ctx->EvalMap.Map2Color4;
- case GL_MAP2_NORMAL:
- return &ctx->EvalMap.Map2Normal;
- case GL_MAP2_TEXTURE_COORD_1:
- return &ctx->EvalMap.Map2Texture1;
- case GL_MAP2_TEXTURE_COORD_2:
- return &ctx->EvalMap.Map2Texture2;
- case GL_MAP2_TEXTURE_COORD_3:
- return &ctx->EvalMap.Map2Texture3;
- case GL_MAP2_TEXTURE_COORD_4:
- return &ctx->EvalMap.Map2Texture4;
- case GL_MAP2_VERTEX_ATTRIB0_4_NV:
- case GL_MAP2_VERTEX_ATTRIB1_4_NV:
- case GL_MAP2_VERTEX_ATTRIB2_4_NV:
- case GL_MAP2_VERTEX_ATTRIB3_4_NV:
- case GL_MAP2_VERTEX_ATTRIB4_4_NV:
- case GL_MAP2_VERTEX_ATTRIB5_4_NV:
- case GL_MAP2_VERTEX_ATTRIB6_4_NV:
- case GL_MAP2_VERTEX_ATTRIB7_4_NV:
- case GL_MAP2_VERTEX_ATTRIB8_4_NV:
- case GL_MAP2_VERTEX_ATTRIB9_4_NV:
- case GL_MAP2_VERTEX_ATTRIB10_4_NV:
- case GL_MAP2_VERTEX_ATTRIB11_4_NV:
- case GL_MAP2_VERTEX_ATTRIB12_4_NV:
- case GL_MAP2_VERTEX_ATTRIB13_4_NV:
- case GL_MAP2_VERTEX_ATTRIB14_4_NV:
- case GL_MAP2_VERTEX_ATTRIB15_4_NV:
- if (!ctx->Extensions.NV_vertex_program)
- return NULL;
- return &ctx->EvalMap.Map2Attrib[target - GL_MAP2_VERTEX_ATTRIB0_4_NV];
- default:
- return NULL;
- }
-}
-
-
-/**********************************************************************/
-/*** Copy and deallocate control points ***/
-/**********************************************************************/
-
-
-/*
- * Copy 1-parametric evaluator control points from user-specified
- * memory space to a buffer of contiguous control points.
- * \param see glMap1f for details
- * \return pointer to buffer of contiguous control points or NULL if out
- * of memory.
- */
-GLfloat *_mesa_copy_map_points1f( GLenum target, GLint ustride, GLint uorder,
- const GLfloat *points )
-{
- GLfloat *buffer, *p;
- GLint i, k, size = _mesa_evaluator_components(target);
-
- if (!points || !size)
- return NULL;
-
- buffer = (GLfloat *) MALLOC(uorder * size * sizeof(GLfloat));
-
- if (buffer)
- for (i = 0, p = buffer; i < uorder; i++, points += ustride)
- for (k = 0; k < size; k++)
- *p++ = points[k];
-
- return buffer;
-}
-
-
-
-/*
- * Same as above but convert doubles to floats.
- */
-GLfloat *_mesa_copy_map_points1d( GLenum target, GLint ustride, GLint uorder,
- const GLdouble *points )
-{
- GLfloat *buffer, *p;
- GLint i, k, size = _mesa_evaluator_components(target);
-
- if (!points || !size)
- return NULL;
-
- buffer = (GLfloat *) MALLOC(uorder * size * sizeof(GLfloat));
-
- if (buffer)
- for (i = 0, p = buffer; i < uorder; i++, points += ustride)
- for (k = 0; k < size; k++)
- *p++ = (GLfloat) points[k];
-
- return buffer;
-}
-
-
-
-/*
- * Copy 2-parametric evaluator control points from user-specified
- * memory space to a buffer of contiguous control points.
- * Additional memory is allocated to be used by the horner and
- * de Casteljau evaluation schemes.
- *
- * \param see glMap2f for details
- * \return pointer to buffer of contiguous control points or NULL if out
- * of memory.
- */
-GLfloat *_mesa_copy_map_points2f( GLenum target,
- GLint ustride, GLint uorder,
- GLint vstride, GLint vorder,
- const GLfloat *points )
-{
- GLfloat *buffer, *p;
- GLint i, j, k, size, dsize, hsize;
- GLint uinc;
-
- size = _mesa_evaluator_components(target);
-
- if (!points || size==0) {
- return NULL;
- }
-
- /* max(uorder, vorder) additional points are used in */
- /* horner evaluation and uorder*vorder additional */
- /* values are needed for de Casteljau */
- dsize = (uorder == 2 && vorder == 2)? 0 : uorder*vorder;
- hsize = (uorder > vorder ? uorder : vorder)*size;
-
- if(hsize>dsize)
- buffer = (GLfloat *) MALLOC((uorder*vorder*size+hsize)*sizeof(GLfloat));
- else
- buffer = (GLfloat *) MALLOC((uorder*vorder*size+dsize)*sizeof(GLfloat));
-
- /* compute the increment value for the u-loop */
- uinc = ustride - vorder*vstride;
-
- if (buffer)
- for (i=0, p=buffer; i<uorder; i++, points += uinc)
- for (j=0; j<vorder; j++, points += vstride)
- for (k=0; k<size; k++)
- *p++ = points[k];
-
- return buffer;
-}
-
-
-
-/*
- * Same as above but convert doubles to floats.
- */
-GLfloat *_mesa_copy_map_points2d(GLenum target,
- GLint ustride, GLint uorder,
- GLint vstride, GLint vorder,
- const GLdouble *points )
-{
- GLfloat *buffer, *p;
- GLint i, j, k, size, hsize, dsize;
- GLint uinc;
-
- size = _mesa_evaluator_components(target);
-
- if (!points || size==0) {
- return NULL;
- }
-
- /* max(uorder, vorder) additional points are used in */
- /* horner evaluation and uorder*vorder additional */
- /* values are needed for de Casteljau */
- dsize = (uorder == 2 && vorder == 2)? 0 : uorder*vorder;
- hsize = (uorder > vorder ? uorder : vorder)*size;
-
- if(hsize>dsize)
- buffer = (GLfloat *) MALLOC((uorder*vorder*size+hsize)*sizeof(GLfloat));
- else
- buffer = (GLfloat *) MALLOC((uorder*vorder*size+dsize)*sizeof(GLfloat));
-
- /* compute the increment value for the u-loop */
- uinc = ustride - vorder*vstride;
-
- if (buffer)
- for (i=0, p=buffer; i<uorder; i++, points += uinc)
- for (j=0; j<vorder; j++, points += vstride)
- for (k=0; k<size; k++)
- *p++ = (GLfloat) points[k];
-
- return buffer;
-}
-
-
-
-
-/**********************************************************************/
-/*** API entry points ***/
-/**********************************************************************/
-
-
-/*
- * This does the work of glMap1[fd].
- */
-static void
-map1(GLenum target, GLfloat u1, GLfloat u2, GLint ustride,
- GLint uorder, const GLvoid *points, GLenum type )
-{
- GET_CURRENT_CONTEXT(ctx);
- GLint k;
- GLfloat *pnts;
- struct gl_1d_map *map = NULL;
-
- ASSERT_OUTSIDE_BEGIN_END(ctx);
- ASSERT(type == GL_FLOAT || type == GL_DOUBLE);
-
- if (u1 == u2) {
- _mesa_error( ctx, GL_INVALID_VALUE, "glMap1(u1,u2)" );
- return;
- }
- if (uorder < 1 || uorder > MAX_EVAL_ORDER) {
- _mesa_error( ctx, GL_INVALID_VALUE, "glMap1(order)" );
- return;
- }
- if (!points) {
- _mesa_error( ctx, GL_INVALID_VALUE, "glMap1(points)" );
- return;
- }
-
- k = _mesa_evaluator_components( target );
- if (k == 0) {
- _mesa_error( ctx, GL_INVALID_ENUM, "glMap1(target)" );
- }
-
- if (ustride < k) {
- _mesa_error( ctx, GL_INVALID_VALUE, "glMap1(stride)" );
- return;
- }
-
- if (ctx->Texture.CurrentUnit != 0) {
- /* See OpenGL 1.2.1 spec, section F.2.13 */
- _mesa_error( ctx, GL_INVALID_OPERATION, "glMap2(ACTIVE_TEXTURE != 0)" );
- return;
- }
-
- map = get_1d_map(ctx, target);
- if (!map) {
- _mesa_error( ctx, GL_INVALID_ENUM, "glMap1(target)" );
- return;
- }
-
- /* make copy of the control points */
- if (type == GL_FLOAT)
- pnts = _mesa_copy_map_points1f(target, ustride, uorder, (GLfloat*) points);
- else
- pnts = _mesa_copy_map_points1d(target, ustride, uorder, (GLdouble*) points);
-
-
- FLUSH_VERTICES(ctx, _NEW_EVAL);
- map->Order = uorder;
- map->u1 = u1;
- map->u2 = u2;
- map->du = 1.0F / (u2 - u1);
- if (map->Points)
- FREE( map->Points );
- map->Points = pnts;
-}
-
-
-
-static void GLAPIENTRY
-_mesa_Map1f( GLenum target, GLfloat u1, GLfloat u2, GLint stride,
- GLint order, const GLfloat *points )
-{
- map1(target, u1, u2, stride, order, points, GL_FLOAT);
-}
-
-
-static void GLAPIENTRY
-_mesa_Map1d( GLenum target, GLdouble u1, GLdouble u2, GLint stride,
- GLint order, const GLdouble *points )
-{
- map1(target, (GLfloat) u1, (GLfloat) u2, stride, order, points, GL_DOUBLE);
-}
-
-
-static void
-map2( GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder,
- GLfloat v1, GLfloat v2, GLint vstride, GLint vorder,
- const GLvoid *points, GLenum type )
-{
- GET_CURRENT_CONTEXT(ctx);
- GLint k;
- GLfloat *pnts;
- struct gl_2d_map *map = NULL;
-
- ASSERT_OUTSIDE_BEGIN_END(ctx);
- ASSERT(type == GL_FLOAT || type == GL_DOUBLE);
-
- if (u1==u2) {
- _mesa_error( ctx, GL_INVALID_VALUE, "glMap2(u1,u2)" );
- return;
- }
-
- if (v1==v2) {
- _mesa_error( ctx, GL_INVALID_VALUE, "glMap2(v1,v2)" );
- return;
- }
-
- if (uorder<1 || uorder>MAX_EVAL_ORDER) {
- _mesa_error( ctx, GL_INVALID_VALUE, "glMap2(uorder)" );
- return;
- }
-
- if (vorder<1 || vorder>MAX_EVAL_ORDER) {
- _mesa_error( ctx, GL_INVALID_VALUE, "glMap2(vorder)" );
- return;
- }
-
- k = _mesa_evaluator_components( target );
- if (k==0) {
- _mesa_error( ctx, GL_INVALID_ENUM, "glMap2(target)" );
- }
-
- if (ustride < k) {
- _mesa_error( ctx, GL_INVALID_VALUE, "glMap2(ustride)" );
- return;
- }
- if (vstride < k) {
- _mesa_error( ctx, GL_INVALID_VALUE, "glMap2(vstride)" );
- return;
- }
-
- if (ctx->Texture.CurrentUnit != 0) {
- /* See OpenGL 1.2.1 spec, section F.2.13 */
- _mesa_error( ctx, GL_INVALID_OPERATION, "glMap2(ACTIVE_TEXTURE != 0)" );
- return;
- }
-
- map = get_2d_map(ctx, target);
- if (!map) {
- _mesa_error( ctx, GL_INVALID_ENUM, "glMap2(target)" );
- return;
- }
-
- /* make copy of the control points */
- if (type == GL_FLOAT)
- pnts = _mesa_copy_map_points2f(target, ustride, uorder,
- vstride, vorder, (GLfloat*) points);
- else
- pnts = _mesa_copy_map_points2d(target, ustride, uorder,
- vstride, vorder, (GLdouble*) points);
-
-
- FLUSH_VERTICES(ctx, _NEW_EVAL);
- map->Uorder = uorder;
- map->u1 = u1;
- map->u2 = u2;
- map->du = 1.0F / (u2 - u1);
- map->Vorder = vorder;
- map->v1 = v1;
- map->v2 = v2;
- map->dv = 1.0F / (v2 - v1);
- if (map->Points)
- FREE( map->Points );
- map->Points = pnts;
-}
-
-
-static void GLAPIENTRY
-_mesa_Map2f( GLenum target,
- GLfloat u1, GLfloat u2, GLint ustride, GLint uorder,
- GLfloat v1, GLfloat v2, GLint vstride, GLint vorder,
- const GLfloat *points)
-{
- map2(target, u1, u2, ustride, uorder, v1, v2, vstride, vorder,
- points, GL_FLOAT);
-}
-
-
-static void GLAPIENTRY
-_mesa_Map2d( GLenum target,
- GLdouble u1, GLdouble u2, GLint ustride, GLint uorder,
- GLdouble v1, GLdouble v2, GLint vstride, GLint vorder,
- const GLdouble *points )
-{
- map2(target, (GLfloat) u1, (GLfloat) u2, ustride, uorder,
- (GLfloat) v1, (GLfloat) v2, vstride, vorder, points, GL_DOUBLE);
-}
-
-
-
-static void GLAPIENTRY
-_mesa_GetnMapdvARB( GLenum target, GLenum query, GLsizei bufSize, GLdouble *v )
-{
- GET_CURRENT_CONTEXT(ctx);
- struct gl_1d_map *map1d;
- struct gl_2d_map *map2d;
- GLint i, n;
- GLfloat *data;
- GLuint comps;
- GLsizei numBytes;
-
- ASSERT_OUTSIDE_BEGIN_END(ctx);
-
- comps = _mesa_evaluator_components(target);
- if (!comps) {
- _mesa_error( ctx, GL_INVALID_ENUM, "glGetMapdv(target)" );
- return;
- }
-
- map1d = get_1d_map(ctx, target);
- map2d = get_2d_map(ctx, target);
- ASSERT(map1d || map2d);
-
- switch (query) {
- case GL_COEFF:
- if (map1d) {
- data = map1d->Points;
- n = map1d->Order * comps;
- }
- else {
- data = map2d->Points;
- n = map2d->Uorder * map2d->Vorder * comps;
- }
- if (data) {
- numBytes = n * sizeof *v;
- if (bufSize < numBytes)
- goto overflow;
- for (i=0;i<n;i++) {
- v[i] = data[i];
- }
- }
- break;
- case GL_ORDER:
- if (map1d) {
- numBytes = 1 * sizeof *v;
- if (bufSize < numBytes)
- goto overflow;
- v[0] = (GLdouble) map1d->Order;
- }
- else {
- numBytes = 2 * sizeof *v;
- if (bufSize < numBytes)
- goto overflow;
- v[0] = (GLdouble) map2d->Uorder;
- v[1] = (GLdouble) map2d->Vorder;
- }
- break;
- case GL_DOMAIN:
- if (map1d) {
- numBytes = 2 * sizeof *v;
- if (bufSize < numBytes)
- goto overflow;
- v[0] = (GLdouble) map1d->u1;
- v[1] = (GLdouble) map1d->u2;
- }
- else {
- numBytes = 4 * sizeof *v;
- if (bufSize < numBytes)
- goto overflow;
- v[0] = (GLdouble) map2d->u1;
- v[1] = (GLdouble) map2d->u2;
- v[2] = (GLdouble) map2d->v1;
- v[3] = (GLdouble) map2d->v2;
- }
- break;
- default:
- _mesa_error( ctx, GL_INVALID_ENUM, "glGetMapdv(query)" );
- }
- return;
-
-overflow:
- _mesa_error( ctx, GL_INVALID_OPERATION,
- "glGetnMapdvARB(out of bounds: bufSize is %d,"
- " but %d bytes are required)", bufSize, numBytes );
-}
-
-static void GLAPIENTRY
-_mesa_GetMapdv( GLenum target, GLenum query, GLdouble *v )
-{
- _mesa_GetnMapdvARB(target, query, INT_MAX, v);
-}
-
-static void GLAPIENTRY
-_mesa_GetnMapfvARB( GLenum target, GLenum query, GLsizei bufSize, GLfloat *v )
-{
- GET_CURRENT_CONTEXT(ctx);
- struct gl_1d_map *map1d;
- struct gl_2d_map *map2d;
- GLint i, n;
- GLfloat *data;
- GLuint comps;
- GLsizei numBytes;
-
- ASSERT_OUTSIDE_BEGIN_END(ctx);
-
- comps = _mesa_evaluator_components(target);
- if (!comps) {
- _mesa_error( ctx, GL_INVALID_ENUM, "glGetMapfv(target)" );
- return;
- }
-
- map1d = get_1d_map(ctx, target);
- map2d = get_2d_map(ctx, target);
- ASSERT(map1d || map2d);
-
- switch (query) {
- case GL_COEFF:
- if (map1d) {
- data = map1d->Points;
- n = map1d->Order * comps;
- }
- else {
- data = map2d->Points;
- n = map2d->Uorder * map2d->Vorder * comps;
- }
- if (data) {
- numBytes = n * sizeof *v;
- if (bufSize < numBytes)
- goto overflow;
- for (i=0;i<n;i++) {
- v[i] = data[i];
- }
- }
- break;
- case GL_ORDER:
- if (map1d) {
- numBytes = 1 * sizeof *v;
- if (bufSize < numBytes)
- goto overflow;
- v[0] = (GLfloat) map1d->Order;
- }
- else {
- numBytes = 2 * sizeof *v;
- if (bufSize < numBytes)
- goto overflow;
- v[0] = (GLfloat) map2d->Uorder;
- v[1] = (GLfloat) map2d->Vorder;
- }
- break;
- case GL_DOMAIN:
- if (map1d) {
- numBytes = 2 * sizeof *v;
- if (bufSize < numBytes)
- goto overflow;
- v[0] = map1d->u1;
- v[1] = map1d->u2;
- }
- else {
- numBytes = 4 * sizeof *v;
- if (bufSize < numBytes)
- goto overflow;
- v[0] = map2d->u1;
- v[1] = map2d->u2;
- v[2] = map2d->v1;
- v[3] = map2d->v2;
- }
- break;
- default:
- _mesa_error( ctx, GL_INVALID_ENUM, "glGetMapfv(query)" );
- }
- return;
-
-overflow:
- _mesa_error( ctx, GL_INVALID_OPERATION,
- "glGetnMapfvARB(out of bounds: bufSize is %d,"
- " but %d bytes are required)", bufSize, numBytes );
-}
-
-
-static void GLAPIENTRY
-_mesa_GetMapfv( GLenum target, GLenum query, GLfloat *v )
-{
- _mesa_GetnMapfvARB(target, query, INT_MAX, v);
-}
-
-
-static void GLAPIENTRY
-_mesa_GetnMapivARB( GLenum target, GLenum query, GLsizei bufSize, GLint *v )
-{
- GET_CURRENT_CONTEXT(ctx);
- struct gl_1d_map *map1d;
- struct gl_2d_map *map2d;
- GLuint i, n;
- GLfloat *data;
- GLuint comps;
- GLsizei numBytes;
-
- ASSERT_OUTSIDE_BEGIN_END(ctx);
-
- comps = _mesa_evaluator_components(target);
- if (!comps) {
- _mesa_error( ctx, GL_INVALID_ENUM, "glGetMapiv(target)" );
- return;
- }
-
- map1d = get_1d_map(ctx, target);
- map2d = get_2d_map(ctx, target);
- ASSERT(map1d || map2d);
-
- switch (query) {
- case GL_COEFF:
- if (map1d) {
- data = map1d->Points;
- n = map1d->Order * comps;
- }
- else {
- data = map2d->Points;
- n = map2d->Uorder * map2d->Vorder * comps;
- }
- if (data) {
- numBytes = n * sizeof *v;
- if (bufSize < numBytes)
- goto overflow;
- for (i=0;i<n;i++) {
- v[i] = IROUND(data[i]);
- }
- }
- break;
- case GL_ORDER:
- if (map1d) {
- numBytes = 1 * sizeof *v;
- if (bufSize < numBytes)
- goto overflow;
- v[0] = map1d->Order;
- }
- else {
- numBytes = 2 * sizeof *v;
- if (bufSize < numBytes)
- goto overflow;
- v[0] = map2d->Uorder;
- v[1] = map2d->Vorder;
- }
- break;
- case GL_DOMAIN:
- if (map1d) {
- numBytes = 2 * sizeof *v;
- if (bufSize < numBytes)
- goto overflow;
- v[0] = IROUND(map1d->u1);
- v[1] = IROUND(map1d->u2);
- }
- else {
- numBytes = 4 * sizeof *v;
- if (bufSize < numBytes)
- goto overflow;
- v[0] = IROUND(map2d->u1);
- v[1] = IROUND(map2d->u2);
- v[2] = IROUND(map2d->v1);
- v[3] = IROUND(map2d->v2);
- }
- break;
- default:
- _mesa_error( ctx, GL_INVALID_ENUM, "glGetMapiv(query)" );
- }
- return;
-
-overflow:
- _mesa_error( ctx, GL_INVALID_OPERATION,
- "glGetnMapivARB(out of bounds: bufSize is %d,"
- " but %d bytes are required)", bufSize, numBytes );
-}
-
-
-static void GLAPIENTRY
-_mesa_GetMapiv( GLenum target, GLenum query, GLint *v )
-{
- _mesa_GetnMapivARB(target, query, INT_MAX, v);
-}
-
-
-static void GLAPIENTRY
-_mesa_MapGrid1f( GLint un, GLfloat u1, GLfloat u2 )
-{
- GET_CURRENT_CONTEXT(ctx);
- ASSERT_OUTSIDE_BEGIN_END(ctx);
-
- if (un<1) {
- _mesa_error( ctx, GL_INVALID_VALUE, "glMapGrid1f" );
- return;
- }
- FLUSH_VERTICES(ctx, _NEW_EVAL);
- ctx->Eval.MapGrid1un = un;
- ctx->Eval.MapGrid1u1 = u1;
- ctx->Eval.MapGrid1u2 = u2;
- ctx->Eval.MapGrid1du = (u2 - u1) / (GLfloat) un;
-}
-
-
-static void GLAPIENTRY
-_mesa_MapGrid1d( GLint un, GLdouble u1, GLdouble u2 )
-{
- _mesa_MapGrid1f( un, (GLfloat) u1, (GLfloat) u2 );
-}
-
-
-static void GLAPIENTRY
-_mesa_MapGrid2f( GLint un, GLfloat u1, GLfloat u2,
- GLint vn, GLfloat v1, GLfloat v2 )
-{
- GET_CURRENT_CONTEXT(ctx);
- ASSERT_OUTSIDE_BEGIN_END(ctx);
-
- if (un<1) {
- _mesa_error( ctx, GL_INVALID_VALUE, "glMapGrid2f(un)" );
- return;
- }
- if (vn<1) {
- _mesa_error( ctx, GL_INVALID_VALUE, "glMapGrid2f(vn)" );
- return;
- }
-
- FLUSH_VERTICES(ctx, _NEW_EVAL);
- ctx->Eval.MapGrid2un = un;
- ctx->Eval.MapGrid2u1 = u1;
- ctx->Eval.MapGrid2u2 = u2;
- ctx->Eval.MapGrid2du = (u2 - u1) / (GLfloat) un;
- ctx->Eval.MapGrid2vn = vn;
- ctx->Eval.MapGrid2v1 = v1;
- ctx->Eval.MapGrid2v2 = v2;
- ctx->Eval.MapGrid2dv = (v2 - v1) / (GLfloat) vn;
-}
-
-
-static void GLAPIENTRY
-_mesa_MapGrid2d( GLint un, GLdouble u1, GLdouble u2,
- GLint vn, GLdouble v1, GLdouble v2 )
-{
- _mesa_MapGrid2f( un, (GLfloat) u1, (GLfloat) u2,
- vn, (GLfloat) v1, (GLfloat) v2 );
-}
-
-
-void
-_mesa_install_eval_vtxfmt(struct _glapi_table *disp,
- const GLvertexformat *vfmt)
-{
- SET_EvalCoord1f(disp, vfmt->EvalCoord1f);
- SET_EvalCoord1fv(disp, vfmt->EvalCoord1fv);
- SET_EvalCoord2f(disp, vfmt->EvalCoord2f);
- SET_EvalCoord2fv(disp, vfmt->EvalCoord2fv);
- SET_EvalPoint1(disp, vfmt->EvalPoint1);
- SET_EvalPoint2(disp, vfmt->EvalPoint2);
-
- SET_EvalMesh1(disp, vfmt->EvalMesh1);
- SET_EvalMesh2(disp, vfmt->EvalMesh2);
-}
-
-
-void
-_mesa_init_eval_dispatch(struct _glapi_table *disp)
-{
- SET_GetMapdv(disp, _mesa_GetMapdv);
- SET_GetMapfv(disp, _mesa_GetMapfv);
- SET_GetMapiv(disp, _mesa_GetMapiv);
- SET_Map1d(disp, _mesa_Map1d);
- SET_Map1f(disp, _mesa_Map1f);
- SET_Map2d(disp, _mesa_Map2d);
- SET_Map2f(disp, _mesa_Map2f);
- SET_MapGrid1d(disp, _mesa_MapGrid1d);
- SET_MapGrid1f(disp, _mesa_MapGrid1f);
- SET_MapGrid2d(disp, _mesa_MapGrid2d);
- SET_MapGrid2f(disp, _mesa_MapGrid2f);
-
- /* GL_ARB_robustness */
- SET_GetnMapdvARB(disp, _mesa_GetnMapdvARB);
- SET_GetnMapfvARB(disp, _mesa_GetnMapfvARB);
- SET_GetnMapivARB(disp, _mesa_GetnMapivARB);
-}
-
-
-#endif /* FEATURE_evaluators */
-
-
-/**********************************************************************/
-/***** Initialization *****/
-/**********************************************************************/
-
-/**
- * Initialize a 1-D evaluator map.
- */
-static void
-init_1d_map( struct gl_1d_map *map, int n, const float *initial )
-{
- map->Order = 1;
- map->u1 = 0.0;
- map->u2 = 1.0;
- map->Points = (GLfloat *) MALLOC(n * sizeof(GLfloat));
- if (map->Points) {
- GLint i;
- for (i=0;i<n;i++)
- map->Points[i] = initial[i];
- }
-}
-
-
-/**
- * Initialize a 2-D evaluator map
- */
-static void
-init_2d_map( struct gl_2d_map *map, int n, const float *initial )
-{
- map->Uorder = 1;
- map->Vorder = 1;
- map->u1 = 0.0;
- map->u2 = 1.0;
- map->v1 = 0.0;
- map->v2 = 1.0;
- map->Points = (GLfloat *) MALLOC(n * sizeof(GLfloat));
- if (map->Points) {
- GLint i;
- for (i=0;i<n;i++)
- map->Points[i] = initial[i];
- }
-}
-
-
-void _mesa_init_eval( struct gl_context *ctx )
-{
- int i;
-
- /* Evaluators group */
- ctx->Eval.Map1Color4 = GL_FALSE;
- ctx->Eval.Map1Index = GL_FALSE;
- ctx->Eval.Map1Normal = GL_FALSE;
- ctx->Eval.Map1TextureCoord1 = GL_FALSE;
- ctx->Eval.Map1TextureCoord2 = GL_FALSE;
- ctx->Eval.Map1TextureCoord3 = GL_FALSE;
- ctx->Eval.Map1TextureCoord4 = GL_FALSE;
- ctx->Eval.Map1Vertex3 = GL_FALSE;
- ctx->Eval.Map1Vertex4 = GL_FALSE;
- memset(ctx->Eval.Map1Attrib, 0, sizeof(ctx->Eval.Map1Attrib));
- ctx->Eval.Map2Color4 = GL_FALSE;
- ctx->Eval.Map2Index = GL_FALSE;
- ctx->Eval.Map2Normal = GL_FALSE;
- ctx->Eval.Map2TextureCoord1 = GL_FALSE;
- ctx->Eval.Map2TextureCoord2 = GL_FALSE;
- ctx->Eval.Map2TextureCoord3 = GL_FALSE;
- ctx->Eval.Map2TextureCoord4 = GL_FALSE;
- ctx->Eval.Map2Vertex3 = GL_FALSE;
- ctx->Eval.Map2Vertex4 = GL_FALSE;
- memset(ctx->Eval.Map2Attrib, 0, sizeof(ctx->Eval.Map2Attrib));
- ctx->Eval.AutoNormal = GL_FALSE;
- ctx->Eval.MapGrid1un = 1;
- ctx->Eval.MapGrid1u1 = 0.0;
- ctx->Eval.MapGrid1u2 = 1.0;
- ctx->Eval.MapGrid2un = 1;
- ctx->Eval.MapGrid2vn = 1;
- ctx->Eval.MapGrid2u1 = 0.0;
- ctx->Eval.MapGrid2u2 = 1.0;
- ctx->Eval.MapGrid2v1 = 0.0;
- ctx->Eval.MapGrid2v2 = 1.0;
-
- /* Evaluator data */
- {
- static GLfloat vertex[4] = { 0.0, 0.0, 0.0, 1.0 };
- static GLfloat normal[3] = { 0.0, 0.0, 1.0 };
- static GLfloat index[1] = { 1.0 };
- static GLfloat color[4] = { 1.0, 1.0, 1.0, 1.0 };
- static GLfloat texcoord[4] = { 0.0, 0.0, 0.0, 1.0 };
- static GLfloat attrib[4] = { 0.0, 0.0, 0.0, 1.0 };
-
- init_1d_map( &ctx->EvalMap.Map1Vertex3, 3, vertex );
- init_1d_map( &ctx->EvalMap.Map1Vertex4, 4, vertex );
- init_1d_map( &ctx->EvalMap.Map1Index, 1, index );
- init_1d_map( &ctx->EvalMap.Map1Color4, 4, color );
- init_1d_map( &ctx->EvalMap.Map1Normal, 3, normal );
- init_1d_map( &ctx->EvalMap.Map1Texture1, 1, texcoord );
- init_1d_map( &ctx->EvalMap.Map1Texture2, 2, texcoord );
- init_1d_map( &ctx->EvalMap.Map1Texture3, 3, texcoord );
- init_1d_map( &ctx->EvalMap.Map1Texture4, 4, texcoord );
- for (i = 0; i < 16; i++)
- init_1d_map( ctx->EvalMap.Map1Attrib + i, 4, attrib );
-
- init_2d_map( &ctx->EvalMap.Map2Vertex3, 3, vertex );
- init_2d_map( &ctx->EvalMap.Map2Vertex4, 4, vertex );
- init_2d_map( &ctx->EvalMap.Map2Index, 1, index );
- init_2d_map( &ctx->EvalMap.Map2Color4, 4, color );
- init_2d_map( &ctx->EvalMap.Map2Normal, 3, normal );
- init_2d_map( &ctx->EvalMap.Map2Texture1, 1, texcoord );
- init_2d_map( &ctx->EvalMap.Map2Texture2, 2, texcoord );
- init_2d_map( &ctx->EvalMap.Map2Texture3, 3, texcoord );
- init_2d_map( &ctx->EvalMap.Map2Texture4, 4, texcoord );
- for (i = 0; i < 16; i++)
- init_2d_map( ctx->EvalMap.Map2Attrib + i, 4, attrib );
- }
-}
-
-
-void _mesa_free_eval_data( struct gl_context *ctx )
-{
- int i;
-
- /* Free evaluator data */
- if (ctx->EvalMap.Map1Vertex3.Points)
- FREE( ctx->EvalMap.Map1Vertex3.Points );
- if (ctx->EvalMap.Map1Vertex4.Points)
- FREE( ctx->EvalMap.Map1Vertex4.Points );
- if (ctx->EvalMap.Map1Index.Points)
- FREE( ctx->EvalMap.Map1Index.Points );
- if (ctx->EvalMap.Map1Color4.Points)
- FREE( ctx->EvalMap.Map1Color4.Points );
- if (ctx->EvalMap.Map1Normal.Points)
- FREE( ctx->EvalMap.Map1Normal.Points );
- if (ctx->EvalMap.Map1Texture1.Points)
- FREE( ctx->EvalMap.Map1Texture1.Points );
- if (ctx->EvalMap.Map1Texture2.Points)
- FREE( ctx->EvalMap.Map1Texture2.Points );
- if (ctx->EvalMap.Map1Texture3.Points)
- FREE( ctx->EvalMap.Map1Texture3.Points );
- if (ctx->EvalMap.Map1Texture4.Points)
- FREE( ctx->EvalMap.Map1Texture4.Points );
- for (i = 0; i < 16; i++)
- FREE((ctx->EvalMap.Map1Attrib[i].Points));
-
- if (ctx->EvalMap.Map2Vertex3.Points)
- FREE( ctx->EvalMap.Map2Vertex3.Points );
- if (ctx->EvalMap.Map2Vertex4.Points)
- FREE( ctx->EvalMap.Map2Vertex4.Points );
- if (ctx->EvalMap.Map2Index.Points)
- FREE( ctx->EvalMap.Map2Index.Points );
- if (ctx->EvalMap.Map2Color4.Points)
- FREE( ctx->EvalMap.Map2Color4.Points );
- if (ctx->EvalMap.Map2Normal.Points)
- FREE( ctx->EvalMap.Map2Normal.Points );
- if (ctx->EvalMap.Map2Texture1.Points)
- FREE( ctx->EvalMap.Map2Texture1.Points );
- if (ctx->EvalMap.Map2Texture2.Points)
- FREE( ctx->EvalMap.Map2Texture2.Points );
- if (ctx->EvalMap.Map2Texture3.Points)
- FREE( ctx->EvalMap.Map2Texture3.Points );
- if (ctx->EvalMap.Map2Texture4.Points)
- FREE( ctx->EvalMap.Map2Texture4.Points );
- for (i = 0; i < 16; i++)
- FREE((ctx->EvalMap.Map2Attrib[i].Points));
-}
+
+/*
+ * Mesa 3-D graphics library
+ * Version: 5.1
+ *
+ * Copyright (C) 1999-2003 Brian Paul All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+
+/*
+ * eval.c was written by
+ * Bernd Barsuhn (bdbarsuh@cip.informatik.uni-erlangen.de) and
+ * Volker Weiss (vrweiss@cip.informatik.uni-erlangen.de).
+ *
+ * My original implementation of evaluators was simplistic and didn't
+ * compute surface normal vectors properly. Bernd and Volker applied
+ * used more sophisticated methods to get better results.
+ *
+ * Thanks guys!
+ */
+
+
+#include "glheader.h"
+#include "imports.h"
+#include "colormac.h"
+#include "context.h"
+#include "eval.h"
+#include "macros.h"
+#include "mfeatures.h"
+#include "mtypes.h"
+#include "main/dispatch.h"
+
+
+#if FEATURE_evaluators
+
+
+/*
+ * Return the number of components per control point for any type of
+ * evaluator. Return 0 if bad target.
+ * See table 5.1 in the OpenGL 1.2 spec.
+ */
+GLuint _mesa_evaluator_components( GLenum target )
+{
+ switch (target) {
+ case GL_MAP1_VERTEX_3: return 3;
+ case GL_MAP1_VERTEX_4: return 4;
+ case GL_MAP1_INDEX: return 1;
+ case GL_MAP1_COLOR_4: return 4;
+ case GL_MAP1_NORMAL: return 3;
+ case GL_MAP1_TEXTURE_COORD_1: return 1;
+ case GL_MAP1_TEXTURE_COORD_2: return 2;
+ case GL_MAP1_TEXTURE_COORD_3: return 3;
+ case GL_MAP1_TEXTURE_COORD_4: return 4;
+ case GL_MAP2_VERTEX_3: return 3;
+ case GL_MAP2_VERTEX_4: return 4;
+ case GL_MAP2_INDEX: return 1;
+ case GL_MAP2_COLOR_4: return 4;
+ case GL_MAP2_NORMAL: return 3;
+ case GL_MAP2_TEXTURE_COORD_1: return 1;
+ case GL_MAP2_TEXTURE_COORD_2: return 2;
+ case GL_MAP2_TEXTURE_COORD_3: return 3;
+ case GL_MAP2_TEXTURE_COORD_4: return 4;
+ default: break;
+ }
+
+ /* XXX need to check for the vertex program extension
+ if (!ctx->Extensions.NV_vertex_program)
+ return 0;
+ */
+
+ if (target >= GL_MAP1_VERTEX_ATTRIB0_4_NV &&
+ target <= GL_MAP1_VERTEX_ATTRIB15_4_NV)
+ return 4;
+
+ if (target >= GL_MAP2_VERTEX_ATTRIB0_4_NV &&
+ target <= GL_MAP2_VERTEX_ATTRIB15_4_NV)
+ return 4;
+
+ return 0;
+}
+
+
+/*
+ * Return pointer to the gl_1d_map struct for the named target.
+ */
+static struct gl_1d_map *
+get_1d_map( struct gl_context *ctx, GLenum target )
+{
+ switch (target) {
+ case GL_MAP1_VERTEX_3:
+ return &ctx->EvalMap.Map1Vertex3;
+ case GL_MAP1_VERTEX_4:
+ return &ctx->EvalMap.Map1Vertex4;
+ case GL_MAP1_INDEX:
+ return &ctx->EvalMap.Map1Index;
+ case GL_MAP1_COLOR_4:
+ return &ctx->EvalMap.Map1Color4;
+ case GL_MAP1_NORMAL:
+ return &ctx->EvalMap.Map1Normal;
+ case GL_MAP1_TEXTURE_COORD_1:
+ return &ctx->EvalMap.Map1Texture1;
+ case GL_MAP1_TEXTURE_COORD_2:
+ return &ctx->EvalMap.Map1Texture2;
+ case GL_MAP1_TEXTURE_COORD_3:
+ return &ctx->EvalMap.Map1Texture3;
+ case GL_MAP1_TEXTURE_COORD_4:
+ return &ctx->EvalMap.Map1Texture4;
+ case GL_MAP1_VERTEX_ATTRIB0_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB1_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB2_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB3_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB4_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB5_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB6_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB7_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB8_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB9_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB10_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB11_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB12_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB13_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB14_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB15_4_NV:
+ if (!ctx->Extensions.NV_vertex_program)
+ return NULL;
+ return &ctx->EvalMap.Map1Attrib[target - GL_MAP1_VERTEX_ATTRIB0_4_NV];
+ default:
+ return NULL;
+ }
+}
+
+
+/*
+ * Return pointer to the gl_2d_map struct for the named target.
+ */
+static struct gl_2d_map *
+get_2d_map( struct gl_context *ctx, GLenum target )
+{
+ switch (target) {
+ case GL_MAP2_VERTEX_3:
+ return &ctx->EvalMap.Map2Vertex3;
+ case GL_MAP2_VERTEX_4:
+ return &ctx->EvalMap.Map2Vertex4;
+ case GL_MAP2_INDEX:
+ return &ctx->EvalMap.Map2Index;
+ case GL_MAP2_COLOR_4:
+ return &ctx->EvalMap.Map2Color4;
+ case GL_MAP2_NORMAL:
+ return &ctx->EvalMap.Map2Normal;
+ case GL_MAP2_TEXTURE_COORD_1:
+ return &ctx->EvalMap.Map2Texture1;
+ case GL_MAP2_TEXTURE_COORD_2:
+ return &ctx->EvalMap.Map2Texture2;
+ case GL_MAP2_TEXTURE_COORD_3:
+ return &ctx->EvalMap.Map2Texture3;
+ case GL_MAP2_TEXTURE_COORD_4:
+ return &ctx->EvalMap.Map2Texture4;
+ case GL_MAP2_VERTEX_ATTRIB0_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB1_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB2_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB3_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB4_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB5_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB6_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB7_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB8_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB9_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB10_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB11_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB12_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB13_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB14_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB15_4_NV:
+ if (!ctx->Extensions.NV_vertex_program)
+ return NULL;
+ return &ctx->EvalMap.Map2Attrib[target - GL_MAP2_VERTEX_ATTRIB0_4_NV];
+ default:
+ return NULL;
+ }
+}
+
+
+/**********************************************************************/
+/*** Copy and deallocate control points ***/
+/**********************************************************************/
+
+
+/*
+ * Copy 1-parametric evaluator control points from user-specified
+ * memory space to a buffer of contiguous control points.
+ * \param see glMap1f for details
+ * \return pointer to buffer of contiguous control points or NULL if out
+ * of memory.
+ */
+GLfloat *_mesa_copy_map_points1f( GLenum target, GLint ustride, GLint uorder,
+ const GLfloat *points )
+{
+ GLfloat *buffer, *p;
+ GLint i, k, size = _mesa_evaluator_components(target);
+
+ if (!points || !size)
+ return NULL;
+
+ buffer = (GLfloat *) MALLOC(uorder * size * sizeof(GLfloat));
+
+ if (buffer)
+ for (i = 0, p = buffer; i < uorder; i++, points += ustride)
+ for (k = 0; k < size; k++)
+ *p++ = points[k];
+
+ return buffer;
+}
+
+
+
+/*
+ * Same as above but convert doubles to floats.
+ */
+GLfloat *_mesa_copy_map_points1d( GLenum target, GLint ustride, GLint uorder,
+ const GLdouble *points )
+{
+ GLfloat *buffer, *p;
+ GLint i, k, size = _mesa_evaluator_components(target);
+
+ if (!points || !size)
+ return NULL;
+
+ buffer = (GLfloat *) MALLOC(uorder * size * sizeof(GLfloat));
+
+ if (buffer)
+ for (i = 0, p = buffer; i < uorder; i++, points += ustride)
+ for (k = 0; k < size; k++)
+ *p++ = (GLfloat) points[k];
+
+ return buffer;
+}
+
+
+
+/*
+ * Copy 2-parametric evaluator control points from user-specified
+ * memory space to a buffer of contiguous control points.
+ * Additional memory is allocated to be used by the horner and
+ * de Casteljau evaluation schemes.
+ *
+ * \param see glMap2f for details
+ * \return pointer to buffer of contiguous control points or NULL if out
+ * of memory.
+ */
+GLfloat *_mesa_copy_map_points2f( GLenum target,
+ GLint ustride, GLint uorder,
+ GLint vstride, GLint vorder,
+ const GLfloat *points )
+{
+ GLfloat *buffer, *p;
+ GLint i, j, k, size, dsize, hsize;
+ GLint uinc;
+
+ size = _mesa_evaluator_components(target);
+
+ if (!points || size==0) {
+ return NULL;
+ }
+
+ /* max(uorder, vorder) additional points are used in */
+ /* horner evaluation and uorder*vorder additional */
+ /* values are needed for de Casteljau */
+ dsize = (uorder == 2 && vorder == 2)? 0 : uorder*vorder;
+ hsize = (uorder > vorder ? uorder : vorder)*size;
+
+ if(hsize>dsize)
+ buffer = (GLfloat *) MALLOC((uorder*vorder*size+hsize)*sizeof(GLfloat));
+ else
+ buffer = (GLfloat *) MALLOC((uorder*vorder*size+dsize)*sizeof(GLfloat));
+
+ /* compute the increment value for the u-loop */
+ uinc = ustride - vorder*vstride;
+
+ if (buffer)
+ for (i=0, p=buffer; i<uorder; i++, points += uinc)
+ for (j=0; j<vorder; j++, points += vstride)
+ for (k=0; k<size; k++)
+ *p++ = points[k];
+
+ return buffer;
+}
+
+
+
+/*
+ * Same as above but convert doubles to floats.
+ */
+GLfloat *_mesa_copy_map_points2d(GLenum target,
+ GLint ustride, GLint uorder,
+ GLint vstride, GLint vorder,
+ const GLdouble *points )
+{
+ GLfloat *buffer, *p;
+ GLint i, j, k, size, hsize, dsize;
+ GLint uinc;
+
+ size = _mesa_evaluator_components(target);
+
+ if (!points || size==0) {
+ return NULL;
+ }
+
+ /* max(uorder, vorder) additional points are used in */
+ /* horner evaluation and uorder*vorder additional */
+ /* values are needed for de Casteljau */
+ dsize = (uorder == 2 && vorder == 2)? 0 : uorder*vorder;
+ hsize = (uorder > vorder ? uorder : vorder)*size;
+
+ if(hsize>dsize)
+ buffer = (GLfloat *) MALLOC((uorder*vorder*size+hsize)*sizeof(GLfloat));
+ else
+ buffer = (GLfloat *) MALLOC((uorder*vorder*size+dsize)*sizeof(GLfloat));
+
+ /* compute the increment value for the u-loop */
+ uinc = ustride - vorder*vstride;
+
+ if (buffer)
+ for (i=0, p=buffer; i<uorder; i++, points += uinc)
+ for (j=0; j<vorder; j++, points += vstride)
+ for (k=0; k<size; k++)
+ *p++ = (GLfloat) points[k];
+
+ return buffer;
+}
+
+
+
+
+/**********************************************************************/
+/*** API entry points ***/
+/**********************************************************************/
+
+
+/*
+ * This does the work of glMap1[fd].
+ */
+static void
+map1(GLenum target, GLfloat u1, GLfloat u2, GLint ustride,
+ GLint uorder, const GLvoid *points, GLenum type )
+{
+ GET_CURRENT_CONTEXT(ctx);
+ GLint k;
+ GLfloat *pnts;
+ struct gl_1d_map *map = NULL;
+
+ ASSERT_OUTSIDE_BEGIN_END(ctx);
+ ASSERT(type == GL_FLOAT || type == GL_DOUBLE);
+
+ if (u1 == u2) {
+ _mesa_error( ctx, GL_INVALID_VALUE, "glMap1(u1,u2)" );
+ return;
+ }
+ if (uorder < 1 || uorder > MAX_EVAL_ORDER) {
+ _mesa_error( ctx, GL_INVALID_VALUE, "glMap1(order)" );
+ return;
+ }
+ if (!points) {
+ _mesa_error( ctx, GL_INVALID_VALUE, "glMap1(points)" );
+ return;
+ }
+
+ k = _mesa_evaluator_components( target );
+ if (k == 0) {
+ _mesa_error( ctx, GL_INVALID_ENUM, "glMap1(target)" );
+ }
+
+ if (ustride < k) {
+ _mesa_error( ctx, GL_INVALID_VALUE, "glMap1(stride)" );
+ return;
+ }
+
+ if (ctx->Texture.CurrentUnit != 0) {
+ /* See OpenGL 1.2.1 spec, section F.2.13 */
+ _mesa_error( ctx, GL_INVALID_OPERATION, "glMap2(ACTIVE_TEXTURE != 0)" );
+ return;
+ }
+
+ map = get_1d_map(ctx, target);
+ if (!map) {
+ _mesa_error( ctx, GL_INVALID_ENUM, "glMap1(target)" );
+ return;
+ }
+
+ /* make copy of the control points */
+ if (type == GL_FLOAT)
+ pnts = _mesa_copy_map_points1f(target, ustride, uorder, (GLfloat*) points);
+ else
+ pnts = _mesa_copy_map_points1d(target, ustride, uorder, (GLdouble*) points);
+
+
+ FLUSH_VERTICES(ctx, _NEW_EVAL);
+ map->Order = uorder;
+ map->u1 = u1;
+ map->u2 = u2;
+ map->du = 1.0F / (u2 - u1);
+ if (map->Points)
+ FREE( map->Points );
+ map->Points = pnts;
+}
+
+
+
+static void GLAPIENTRY
+_mesa_Map1f( GLenum target, GLfloat u1, GLfloat u2, GLint stride,
+ GLint order, const GLfloat *points )
+{
+ map1(target, u1, u2, stride, order, points, GL_FLOAT);
+}
+
+
+static void GLAPIENTRY
+_mesa_Map1d( GLenum target, GLdouble u1, GLdouble u2, GLint stride,
+ GLint order, const GLdouble *points )
+{
+ map1(target, (GLfloat) u1, (GLfloat) u2, stride, order, points, GL_DOUBLE);
+}
+
+
+static void
+map2( GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder,
+ GLfloat v1, GLfloat v2, GLint vstride, GLint vorder,
+ const GLvoid *points, GLenum type )
+{
+ GET_CURRENT_CONTEXT(ctx);
+ GLint k;
+ GLfloat *pnts;
+ struct gl_2d_map *map = NULL;
+
+ ASSERT_OUTSIDE_BEGIN_END(ctx);
+ ASSERT(type == GL_FLOAT || type == GL_DOUBLE);
+
+ if (u1==u2) {
+ _mesa_error( ctx, GL_INVALID_VALUE, "glMap2(u1,u2)" );
+ return;
+ }
+
+ if (v1==v2) {
+ _mesa_error( ctx, GL_INVALID_VALUE, "glMap2(v1,v2)" );
+ return;
+ }
+
+ if (uorder<1 || uorder>MAX_EVAL_ORDER) {
+ _mesa_error( ctx, GL_INVALID_VALUE, "glMap2(uorder)" );
+ return;
+ }
+
+ if (vorder<1 || vorder>MAX_EVAL_ORDER) {
+ _mesa_error( ctx, GL_INVALID_VALUE, "glMap2(vorder)" );
+ return;
+ }
+
+ k = _mesa_evaluator_components( target );
+ if (k==0) {
+ _mesa_error( ctx, GL_INVALID_ENUM, "glMap2(target)" );
+ }
+
+ if (ustride < k) {
+ _mesa_error( ctx, GL_INVALID_VALUE, "glMap2(ustride)" );
+ return;
+ }
+ if (vstride < k) {
+ _mesa_error( ctx, GL_INVALID_VALUE, "glMap2(vstride)" );
+ return;
+ }
+
+ if (ctx->Texture.CurrentUnit != 0) {
+ /* See OpenGL 1.2.1 spec, section F.2.13 */
+ _mesa_error( ctx, GL_INVALID_OPERATION, "glMap2(ACTIVE_TEXTURE != 0)" );
+ return;
+ }
+
+ map = get_2d_map(ctx, target);
+ if (!map) {
+ _mesa_error( ctx, GL_INVALID_ENUM, "glMap2(target)" );
+ return;
+ }
+
+ /* make copy of the control points */
+ if (type == GL_FLOAT)
+ pnts = _mesa_copy_map_points2f(target, ustride, uorder,
+ vstride, vorder, (GLfloat*) points);
+ else
+ pnts = _mesa_copy_map_points2d(target, ustride, uorder,
+ vstride, vorder, (GLdouble*) points);
+
+
+ FLUSH_VERTICES(ctx, _NEW_EVAL);
+ map->Uorder = uorder;
+ map->u1 = u1;
+ map->u2 = u2;
+ map->du = 1.0F / (u2 - u1);
+ map->Vorder = vorder;
+ map->v1 = v1;
+ map->v2 = v2;
+ map->dv = 1.0F / (v2 - v1);
+ if (map->Points)
+ FREE( map->Points );
+ map->Points = pnts;
+}
+
+
+static void GLAPIENTRY
+_mesa_Map2f( GLenum target,
+ GLfloat u1, GLfloat u2, GLint ustride, GLint uorder,
+ GLfloat v1, GLfloat v2, GLint vstride, GLint vorder,
+ const GLfloat *points)
+{
+ map2(target, u1, u2, ustride, uorder, v1, v2, vstride, vorder,
+ points, GL_FLOAT);
+}
+
+
+static void GLAPIENTRY
+_mesa_Map2d( GLenum target,
+ GLdouble u1, GLdouble u2, GLint ustride, GLint uorder,
+ GLdouble v1, GLdouble v2, GLint vstride, GLint vorder,
+ const GLdouble *points )
+{
+ map2(target, (GLfloat) u1, (GLfloat) u2, ustride, uorder,
+ (GLfloat) v1, (GLfloat) v2, vstride, vorder, points, GL_DOUBLE);
+}
+
+
+
+static void GLAPIENTRY
+_mesa_GetnMapdvARB( GLenum target, GLenum query, GLsizei bufSize, GLdouble *v )
+{
+ GET_CURRENT_CONTEXT(ctx);
+ struct gl_1d_map *map1d;
+ struct gl_2d_map *map2d;
+ GLint i, n;
+ GLfloat *data;
+ GLuint comps;
+ GLsizei numBytes;
+
+ ASSERT_OUTSIDE_BEGIN_END(ctx);
+
+ comps = _mesa_evaluator_components(target);
+ if (!comps) {
+ _mesa_error( ctx, GL_INVALID_ENUM, "glGetMapdv(target)" );
+ return;
+ }
+
+ map1d = get_1d_map(ctx, target);
+ map2d = get_2d_map(ctx, target);
+ ASSERT(map1d || map2d);
+
+ switch (query) {
+ case GL_COEFF:
+ if (map1d) {
+ data = map1d->Points;
+ n = map1d->Order * comps;
+ }
+ else {
+ data = map2d->Points;
+ n = map2d->Uorder * map2d->Vorder * comps;
+ }
+ if (data) {
+ numBytes = n * sizeof *v;
+ if (bufSize < numBytes)
+ goto overflow;
+ for (i=0;i<n;i++) {
+ v[i] = data[i];
+ }
+ }
+ break;
+ case GL_ORDER:
+ if (map1d) {
+ numBytes = 1 * sizeof *v;
+ if (bufSize < numBytes)
+ goto overflow;
+ v[0] = (GLdouble) map1d->Order;
+ }
+ else {
+ numBytes = 2 * sizeof *v;
+ if (bufSize < numBytes)
+ goto overflow;
+ v[0] = (GLdouble) map2d->Uorder;
+ v[1] = (GLdouble) map2d->Vorder;
+ }
+ break;
+ case GL_DOMAIN:
+ if (map1d) {
+ numBytes = 2 * sizeof *v;
+ if (bufSize < numBytes)
+ goto overflow;
+ v[0] = (GLdouble) map1d->u1;
+ v[1] = (GLdouble) map1d->u2;
+ }
+ else {
+ numBytes = 4 * sizeof *v;
+ if (bufSize < numBytes)
+ goto overflow;
+ v[0] = (GLdouble) map2d->u1;
+ v[1] = (GLdouble) map2d->u2;
+ v[2] = (GLdouble) map2d->v1;
+ v[3] = (GLdouble) map2d->v2;
+ }
+ break;
+ default:
+ _mesa_error( ctx, GL_INVALID_ENUM, "glGetMapdv(query)" );
+ }
+ return;
+
+overflow:
+ _mesa_error( ctx, GL_INVALID_OPERATION,
+ "glGetnMapdvARB(out of bounds: bufSize is %d,"
+ " but %d bytes are required)", bufSize, numBytes );
+}
+
+static void GLAPIENTRY
+_mesa_GetMapdv( GLenum target, GLenum query, GLdouble *v )
+{
+ _mesa_GetnMapdvARB(target, query, INT_MAX, v);
+}
+
+static void GLAPIENTRY
+_mesa_GetnMapfvARB( GLenum target, GLenum query, GLsizei bufSize, GLfloat *v )
+{
+ GET_CURRENT_CONTEXT(ctx);
+ struct gl_1d_map *map1d;
+ struct gl_2d_map *map2d;
+ GLint i, n;
+ GLfloat *data;
+ GLuint comps;
+ GLsizei numBytes;
+
+ ASSERT_OUTSIDE_BEGIN_END(ctx);
+
+ comps = _mesa_evaluator_components(target);
+ if (!comps) {
+ _mesa_error( ctx, GL_INVALID_ENUM, "glGetMapfv(target)" );
+ return;
+ }
+
+ map1d = get_1d_map(ctx, target);
+ map2d = get_2d_map(ctx, target);
+ ASSERT(map1d || map2d);
+
+ switch (query) {
+ case GL_COEFF:
+ if (map1d) {
+ data = map1d->Points;
+ n = map1d->Order * comps;
+ }
+ else {
+ data = map2d->Points;
+ n = map2d->Uorder * map2d->Vorder * comps;
+ }
+ if (data) {
+ numBytes = n * sizeof *v;
+ if (bufSize < numBytes)
+ goto overflow;
+ for (i=0;i<n;i++) {
+ v[i] = data[i];
+ }
+ }
+ break;
+ case GL_ORDER:
+ if (map1d) {
+ numBytes = 1 * sizeof *v;
+ if (bufSize < numBytes)
+ goto overflow;
+ v[0] = (GLfloat) map1d->Order;
+ }
+ else {
+ numBytes = 2 * sizeof *v;
+ if (bufSize < numBytes)
+ goto overflow;
+ v[0] = (GLfloat) map2d->Uorder;
+ v[1] = (GLfloat) map2d->Vorder;
+ }
+ break;
+ case GL_DOMAIN:
+ if (map1d) {
+ numBytes = 2 * sizeof *v;
+ if (bufSize < numBytes)
+ goto overflow;
+ v[0] = map1d->u1;
+ v[1] = map1d->u2;
+ }
+ else {
+ numBytes = 4 * sizeof *v;
+ if (bufSize < numBytes)
+ goto overflow;
+ v[0] = map2d->u1;
+ v[1] = map2d->u2;
+ v[2] = map2d->v1;
+ v[3] = map2d->v2;
+ }
+ break;
+ default:
+ _mesa_error( ctx, GL_INVALID_ENUM, "glGetMapfv(query)" );
+ }
+ return;
+
+overflow:
+ _mesa_error( ctx, GL_INVALID_OPERATION,
+ "glGetnMapfvARB(out of bounds: bufSize is %d,"
+ " but %d bytes are required)", bufSize, numBytes );
+}
+
+
+static void GLAPIENTRY
+_mesa_GetMapfv( GLenum target, GLenum query, GLfloat *v )
+{
+ _mesa_GetnMapfvARB(target, query, INT_MAX, v);
+}
+
+
+static void GLAPIENTRY
+_mesa_GetnMapivARB( GLenum target, GLenum query, GLsizei bufSize, GLint *v )
+{
+ GET_CURRENT_CONTEXT(ctx);
+ struct gl_1d_map *map1d;
+ struct gl_2d_map *map2d;
+ GLuint i, n;
+ GLfloat *data;
+ GLuint comps;
+ GLsizei numBytes;
+
+ ASSERT_OUTSIDE_BEGIN_END(ctx);
+
+ comps = _mesa_evaluator_components(target);
+ if (!comps) {
+ _mesa_error( ctx, GL_INVALID_ENUM, "glGetMapiv(target)" );
+ return;
+ }
+
+ map1d = get_1d_map(ctx, target);
+ map2d = get_2d_map(ctx, target);
+ ASSERT(map1d || map2d);
+
+ switch (query) {
+ case GL_COEFF:
+ if (map1d) {
+ data = map1d->Points;
+ n = map1d->Order * comps;
+ }
+ else {
+ data = map2d->Points;
+ n = map2d->Uorder * map2d->Vorder * comps;
+ }
+ if (data) {
+ numBytes = n * sizeof *v;
+ if (bufSize < numBytes)
+ goto overflow;
+ for (i=0;i<n;i++) {
+ v[i] = IROUND(data[i]);
+ }
+ }
+ break;
+ case GL_ORDER:
+ if (map1d) {
+ numBytes = 1 * sizeof *v;
+ if (bufSize < numBytes)
+ goto overflow;
+ v[0] = map1d->Order;
+ }
+ else {
+ numBytes = 2 * sizeof *v;
+ if (bufSize < numBytes)
+ goto overflow;
+ v[0] = map2d->Uorder;
+ v[1] = map2d->Vorder;
+ }
+ break;
+ case GL_DOMAIN:
+ if (map1d) {
+ numBytes = 2 * sizeof *v;
+ if (bufSize < numBytes)
+ goto overflow;
+ v[0] = IROUND(map1d->u1);
+ v[1] = IROUND(map1d->u2);
+ }
+ else {
+ numBytes = 4 * sizeof *v;
+ if (bufSize < numBytes)
+ goto overflow;
+ v[0] = IROUND(map2d->u1);
+ v[1] = IROUND(map2d->u2);
+ v[2] = IROUND(map2d->v1);
+ v[3] = IROUND(map2d->v2);
+ }
+ break;
+ default:
+ _mesa_error( ctx, GL_INVALID_ENUM, "glGetMapiv(query)" );
+ }
+ return;
+
+overflow:
+ _mesa_error( ctx, GL_INVALID_OPERATION,
+ "glGetnMapivARB(out of bounds: bufSize is %d,"
+ " but %d bytes are required)", bufSize, numBytes );
+}
+
+
+static void GLAPIENTRY
+_mesa_GetMapiv( GLenum target, GLenum query, GLint *v )
+{
+ _mesa_GetnMapivARB(target, query, INT_MAX, v);
+}
+
+
+static void GLAPIENTRY
+_mesa_MapGrid1f( GLint un, GLfloat u1, GLfloat u2 )
+{
+ GET_CURRENT_CONTEXT(ctx);
+ ASSERT_OUTSIDE_BEGIN_END(ctx);
+
+ if (un<1) {
+ _mesa_error( ctx, GL_INVALID_VALUE, "glMapGrid1f" );
+ return;
+ }
+ FLUSH_VERTICES(ctx, _NEW_EVAL);
+ ctx->Eval.MapGrid1un = un;
+ ctx->Eval.MapGrid1u1 = u1;
+ ctx->Eval.MapGrid1u2 = u2;
+ ctx->Eval.MapGrid1du = (u2 - u1) / (GLfloat) un;
+}
+
+
+static void GLAPIENTRY
+_mesa_MapGrid1d( GLint un, GLdouble u1, GLdouble u2 )
+{
+ _mesa_MapGrid1f( un, (GLfloat) u1, (GLfloat) u2 );
+}
+
+
+static void GLAPIENTRY
+_mesa_MapGrid2f( GLint un, GLfloat u1, GLfloat u2,
+ GLint vn, GLfloat v1, GLfloat v2 )
+{
+ GET_CURRENT_CONTEXT(ctx);
+ ASSERT_OUTSIDE_BEGIN_END(ctx);
+
+ if (un<1) {
+ _mesa_error( ctx, GL_INVALID_VALUE, "glMapGrid2f(un)" );
+ return;
+ }
+ if (vn<1) {
+ _mesa_error( ctx, GL_INVALID_VALUE, "glMapGrid2f(vn)" );
+ return;
+ }
+
+ FLUSH_VERTICES(ctx, _NEW_EVAL);
+ ctx->Eval.MapGrid2un = un;
+ ctx->Eval.MapGrid2u1 = u1;
+ ctx->Eval.MapGrid2u2 = u2;
+ ctx->Eval.MapGrid2du = (u2 - u1) / (GLfloat) un;
+ ctx->Eval.MapGrid2vn = vn;
+ ctx->Eval.MapGrid2v1 = v1;
+ ctx->Eval.MapGrid2v2 = v2;
+ ctx->Eval.MapGrid2dv = (v2 - v1) / (GLfloat) vn;
+}
+
+
+static void GLAPIENTRY
+_mesa_MapGrid2d( GLint un, GLdouble u1, GLdouble u2,
+ GLint vn, GLdouble v1, GLdouble v2 )
+{
+ _mesa_MapGrid2f( un, (GLfloat) u1, (GLfloat) u2,
+ vn, (GLfloat) v1, (GLfloat) v2 );
+}
+
+
+void
+_mesa_install_eval_vtxfmt(struct _glapi_table *disp,
+ const GLvertexformat *vfmt)
+{
+ SET_EvalCoord1f(disp, vfmt->EvalCoord1f);
+ SET_EvalCoord1fv(disp, vfmt->EvalCoord1fv);
+ SET_EvalCoord2f(disp, vfmt->EvalCoord2f);
+ SET_EvalCoord2fv(disp, vfmt->EvalCoord2fv);
+ SET_EvalPoint1(disp, vfmt->EvalPoint1);
+ SET_EvalPoint2(disp, vfmt->EvalPoint2);
+
+ SET_EvalMesh1(disp, vfmt->EvalMesh1);
+ SET_EvalMesh2(disp, vfmt->EvalMesh2);
+}
+
+
+void
+_mesa_init_eval_dispatch(struct _glapi_table *disp)
+{
+ SET_GetMapdv(disp, _mesa_GetMapdv);
+ SET_GetMapfv(disp, _mesa_GetMapfv);
+ SET_GetMapiv(disp, _mesa_GetMapiv);
+ SET_Map1d(disp, _mesa_Map1d);
+ SET_Map1f(disp, _mesa_Map1f);
+ SET_Map2d(disp, _mesa_Map2d);
+ SET_Map2f(disp, _mesa_Map2f);
+ SET_MapGrid1d(disp, _mesa_MapGrid1d);
+ SET_MapGrid1f(disp, _mesa_MapGrid1f);
+ SET_MapGrid2d(disp, _mesa_MapGrid2d);
+ SET_MapGrid2f(disp, _mesa_MapGrid2f);
+
+ /* GL_ARB_robustness */
+ SET_GetnMapdvARB(disp, _mesa_GetnMapdvARB);
+ SET_GetnMapfvARB(disp, _mesa_GetnMapfvARB);
+ SET_GetnMapivARB(disp, _mesa_GetnMapivARB);
+}
+
+
+#endif /* FEATURE_evaluators */
+
+
+/**********************************************************************/
+/***** Initialization *****/
+/**********************************************************************/
+
+/**
+ * Initialize a 1-D evaluator map.
+ */
+static void
+init_1d_map( struct gl_1d_map *map, int n, const float *initial )
+{
+ map->Order = 1;
+ map->u1 = 0.0;
+ map->u2 = 1.0;
+ map->Points = (GLfloat *) MALLOC(n * sizeof(GLfloat));
+ if (map->Points) {
+ GLint i;
+ for (i=0;i<n;i++)
+ map->Points[i] = initial[i];
+ }
+}
+
+
+/**
+ * Initialize a 2-D evaluator map
+ */
+static void
+init_2d_map( struct gl_2d_map *map, int n, const float *initial )
+{
+ map->Uorder = 1;
+ map->Vorder = 1;
+ map->u1 = 0.0;
+ map->u2 = 1.0;
+ map->v1 = 0.0;
+ map->v2 = 1.0;
+ map->Points = (GLfloat *) MALLOC(n * sizeof(GLfloat));
+ if (map->Points) {
+ GLint i;
+ for (i=0;i<n;i++)
+ map->Points[i] = initial[i];
+ }
+}
+
+
+void _mesa_init_eval( struct gl_context *ctx )
+{
+ int i;
+
+ /* Evaluators group */
+ ctx->Eval.Map1Color4 = GL_FALSE;
+ ctx->Eval.Map1Index = GL_FALSE;
+ ctx->Eval.Map1Normal = GL_FALSE;
+ ctx->Eval.Map1TextureCoord1 = GL_FALSE;
+ ctx->Eval.Map1TextureCoord2 = GL_FALSE;
+ ctx->Eval.Map1TextureCoord3 = GL_FALSE;
+ ctx->Eval.Map1TextureCoord4 = GL_FALSE;
+ ctx->Eval.Map1Vertex3 = GL_FALSE;
+ ctx->Eval.Map1Vertex4 = GL_FALSE;
+ memset(ctx->Eval.Map1Attrib, 0, sizeof(ctx->Eval.Map1Attrib));
+ ctx->Eval.Map2Color4 = GL_FALSE;
+ ctx->Eval.Map2Index = GL_FALSE;
+ ctx->Eval.Map2Normal = GL_FALSE;
+ ctx->Eval.Map2TextureCoord1 = GL_FALSE;
+ ctx->Eval.Map2TextureCoord2 = GL_FALSE;
+ ctx->Eval.Map2TextureCoord3 = GL_FALSE;
+ ctx->Eval.Map2TextureCoord4 = GL_FALSE;
+ ctx->Eval.Map2Vertex3 = GL_FALSE;
+ ctx->Eval.Map2Vertex4 = GL_FALSE;
+ memset(ctx->Eval.Map2Attrib, 0, sizeof(ctx->Eval.Map2Attrib));
+ ctx->Eval.AutoNormal = GL_FALSE;
+ ctx->Eval.MapGrid1un = 1;
+ ctx->Eval.MapGrid1u1 = 0.0;
+ ctx->Eval.MapGrid1u2 = 1.0;
+ ctx->Eval.MapGrid2un = 1;
+ ctx->Eval.MapGrid2vn = 1;
+ ctx->Eval.MapGrid2u1 = 0.0;
+ ctx->Eval.MapGrid2u2 = 1.0;
+ ctx->Eval.MapGrid2v1 = 0.0;
+ ctx->Eval.MapGrid2v2 = 1.0;
+
+ /* Evaluator data */
+ {
+ static GLfloat vertex[4] = { 0.0, 0.0, 0.0, 1.0 };
+ static GLfloat normal[3] = { 0.0, 0.0, 1.0 };
+ static GLfloat index[1] = { 1.0 };
+ static GLfloat color[4] = { 1.0, 1.0, 1.0, 1.0 };
+ static GLfloat texcoord[4] = { 0.0, 0.0, 0.0, 1.0 };
+ static GLfloat attrib[4] = { 0.0, 0.0, 0.0, 1.0 };
+
+ init_1d_map( &ctx->EvalMap.Map1Vertex3, 3, vertex );
+ init_1d_map( &ctx->EvalMap.Map1Vertex4, 4, vertex );
+ init_1d_map( &ctx->EvalMap.Map1Index, 1, index );
+ init_1d_map( &ctx->EvalMap.Map1Color4, 4, color );
+ init_1d_map( &ctx->EvalMap.Map1Normal, 3, normal );
+ init_1d_map( &ctx->EvalMap.Map1Texture1, 1, texcoord );
+ init_1d_map( &ctx->EvalMap.Map1Texture2, 2, texcoord );
+ init_1d_map( &ctx->EvalMap.Map1Texture3, 3, texcoord );
+ init_1d_map( &ctx->EvalMap.Map1Texture4, 4, texcoord );
+ for (i = 0; i < 16; i++)
+ init_1d_map( ctx->EvalMap.Map1Attrib + i, 4, attrib );
+
+ init_2d_map( &ctx->EvalMap.Map2Vertex3, 3, vertex );
+ init_2d_map( &ctx->EvalMap.Map2Vertex4, 4, vertex );
+ init_2d_map( &ctx->EvalMap.Map2Index, 1, index );
+ init_2d_map( &ctx->EvalMap.Map2Color4, 4, color );
+ init_2d_map( &ctx->EvalMap.Map2Normal, 3, normal );
+ init_2d_map( &ctx->EvalMap.Map2Texture1, 1, texcoord );
+ init_2d_map( &ctx->EvalMap.Map2Texture2, 2, texcoord );
+ init_2d_map( &ctx->EvalMap.Map2Texture3, 3, texcoord );
+ init_2d_map( &ctx->EvalMap.Map2Texture4, 4, texcoord );
+ for (i = 0; i < 16; i++)
+ init_2d_map( ctx->EvalMap.Map2Attrib + i, 4, attrib );
+ }
+}
+
+
+void _mesa_free_eval_data( struct gl_context *ctx )
+{
+ int i;
+
+ /* Free evaluator data */
+ if (ctx->EvalMap.Map1Vertex3.Points)
+ FREE( ctx->EvalMap.Map1Vertex3.Points );
+ if (ctx->EvalMap.Map1Vertex4.Points)
+ FREE( ctx->EvalMap.Map1Vertex4.Points );
+ if (ctx->EvalMap.Map1Index.Points)
+ FREE( ctx->EvalMap.Map1Index.Points );
+ if (ctx->EvalMap.Map1Color4.Points)
+ FREE( ctx->EvalMap.Map1Color4.Points );
+ if (ctx->EvalMap.Map1Normal.Points)
+ FREE( ctx->EvalMap.Map1Normal.Points );
+ if (ctx->EvalMap.Map1Texture1.Points)
+ FREE( ctx->EvalMap.Map1Texture1.Points );
+ if (ctx->EvalMap.Map1Texture2.Points)
+ FREE( ctx->EvalMap.Map1Texture2.Points );
+ if (ctx->EvalMap.Map1Texture3.Points)
+ FREE( ctx->EvalMap.Map1Texture3.Points );
+ if (ctx->EvalMap.Map1Texture4.Points)
+ FREE( ctx->EvalMap.Map1Texture4.Points );
+ for (i = 0; i < 16; i++)
+ FREE((ctx->EvalMap.Map1Attrib[i].Points));
+
+ if (ctx->EvalMap.Map2Vertex3.Points)
+ FREE( ctx->EvalMap.Map2Vertex3.Points );
+ if (ctx->EvalMap.Map2Vertex4.Points)
+ FREE( ctx->EvalMap.Map2Vertex4.Points );
+ if (ctx->EvalMap.Map2Index.Points)
+ FREE( ctx->EvalMap.Map2Index.Points );
+ if (ctx->EvalMap.Map2Color4.Points)
+ FREE( ctx->EvalMap.Map2Color4.Points );
+ if (ctx->EvalMap.Map2Normal.Points)
+ FREE( ctx->EvalMap.Map2Normal.Points );
+ if (ctx->EvalMap.Map2Texture1.Points)
+ FREE( ctx->EvalMap.Map2Texture1.Points );
+ if (ctx->EvalMap.Map2Texture2.Points)
+ FREE( ctx->EvalMap.Map2Texture2.Points );
+ if (ctx->EvalMap.Map2Texture3.Points)
+ FREE( ctx->EvalMap.Map2Texture3.Points );
+ if (ctx->EvalMap.Map2Texture4.Points)
+ FREE( ctx->EvalMap.Map2Texture4.Points );
+ for (i = 0; i < 16; i++)
+ FREE((ctx->EvalMap.Map2Attrib[i].Points));
+}
diff --git a/mesalib/src/mesa/main/fbobject.c b/mesalib/src/mesa/main/fbobject.c
index 67df53b88..5e54bbdf3 100644
--- a/mesalib/src/mesa/main/fbobject.c
+++ b/mesalib/src/mesa/main/fbobject.c
@@ -1,2537 +1,2537 @@
-/*
- * Mesa 3-D graphics library
- * Version: 7.1
- *
- * Copyright (C) 1999-2008 Brian Paul All Rights Reserved.
- * Copyright (C) 1999-2009 VMware, Inc. All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-
-/*
- * GL_EXT/ARB_framebuffer_object extensions
- *
- * Authors:
- * Brian Paul
- */
-
-
-#include "buffers.h"
-#include "context.h"
-#include "enums.h"
-#include "fbobject.h"
-#include "formats.h"
-#include "framebuffer.h"
-#include "hash.h"
-#include "macros.h"
-#include "mfeatures.h"
-#include "mtypes.h"
-#include "renderbuffer.h"
-#include "state.h"
-#include "teximage.h"
-#include "texobj.h"
-
-
-/** Set this to 1 to help debug FBO incompleteness problems */
-#define DEBUG_FBO 0
-
-/** Set this to 1 to debug/log glBlitFramebuffer() calls */
-#define DEBUG_BLIT 0
-
-
-/**
- * Notes:
- *
- * None of the GL_EXT_framebuffer_object functions are compiled into
- * display lists.
- */
-
-
-
-/*
- * When glGenRender/FramebuffersEXT() is called we insert pointers to
- * these placeholder objects into the hash table.
- * Later, when the object ID is first bound, we replace the placeholder
- * with the real frame/renderbuffer.
- */
-static struct gl_framebuffer DummyFramebuffer;
-static struct gl_renderbuffer DummyRenderbuffer;
-
-/* We bind this framebuffer when applications pass a NULL
- * drawable/surface in make current. */
-static struct gl_framebuffer IncompleteFramebuffer;
-
-
-#define IS_CUBE_FACE(TARGET) \
- ((TARGET) >= GL_TEXTURE_CUBE_MAP_POSITIVE_X && \
- (TARGET) <= GL_TEXTURE_CUBE_MAP_NEGATIVE_Z)
-
-
-static void
-delete_dummy_renderbuffer(struct gl_renderbuffer *rb)
-{
- /* no op */
-}
-
-static void
-delete_dummy_framebuffer(struct gl_framebuffer *fb)
-{
- /* no op */
-}
-
-
-void
-_mesa_init_fbobjects(struct gl_context *ctx)
-{
- _glthread_INIT_MUTEX(DummyFramebuffer.Mutex);
- _glthread_INIT_MUTEX(DummyRenderbuffer.Mutex);
- _glthread_INIT_MUTEX(IncompleteFramebuffer.Mutex);
- DummyFramebuffer.Delete = delete_dummy_framebuffer;
- DummyRenderbuffer.Delete = delete_dummy_renderbuffer;
- IncompleteFramebuffer.Delete = delete_dummy_framebuffer;
-}
-
-struct gl_framebuffer *
-_mesa_get_incomplete_framebuffer(void)
-{
- return &IncompleteFramebuffer;
-}
-
-/**
- * Helper routine for getting a gl_renderbuffer.
- */
-struct gl_renderbuffer *
-_mesa_lookup_renderbuffer(struct gl_context *ctx, GLuint id)
-{
- struct gl_renderbuffer *rb;
-
- if (id == 0)
- return NULL;
-
- rb = (struct gl_renderbuffer *)
- _mesa_HashLookup(ctx->Shared->RenderBuffers, id);
- return rb;
-}
-
-
-/**
- * Helper routine for getting a gl_framebuffer.
- */
-struct gl_framebuffer *
-_mesa_lookup_framebuffer(struct gl_context *ctx, GLuint id)
-{
- struct gl_framebuffer *fb;
-
- if (id == 0)
- return NULL;
-
- fb = (struct gl_framebuffer *)
- _mesa_HashLookup(ctx->Shared->FrameBuffers, id);
- return fb;
-}
-
-
-/**
- * Mark the given framebuffer as invalid. This will force the
- * test for framebuffer completeness to be done before the framebuffer
- * is used.
- */
-static void
-invalidate_framebuffer(struct gl_framebuffer *fb)
-{
- fb->_Status = 0; /* "indeterminate" */
-}
-
-
-/**
- * Return the gl_framebuffer object which corresponds to the given
- * framebuffer target, such as GL_DRAW_FRAMEBUFFER.
- * Check support for GL_EXT_framebuffer_blit to determine if certain
- * targets are legal.
- * \return gl_framebuffer pointer or NULL if target is illegal
- */
-static struct gl_framebuffer *
-get_framebuffer_target(struct gl_context *ctx, GLenum target)
-{
- switch (target) {
- case GL_DRAW_FRAMEBUFFER:
- return ctx->Extensions.EXT_framebuffer_blit ? ctx->DrawBuffer : NULL;
- case GL_READ_FRAMEBUFFER:
- return ctx->Extensions.EXT_framebuffer_blit ? ctx->ReadBuffer : NULL;
- case GL_FRAMEBUFFER_EXT:
- return ctx->DrawBuffer;
- default:
- return NULL;
- }
-}
-
-
-/**
- * Given a GL_*_ATTACHMENTn token, return a pointer to the corresponding
- * gl_renderbuffer_attachment object.
- * This function is only used for user-created FB objects, not the
- * default / window-system FB object.
- * If \p attachment is GL_DEPTH_STENCIL_ATTACHMENT, return a pointer to
- * the depth buffer attachment point.
- */
-struct gl_renderbuffer_attachment *
-_mesa_get_attachment(struct gl_context *ctx, struct gl_framebuffer *fb,
- GLenum attachment)
-{
- GLuint i;
-
- assert(fb->Name > 0);
-
- switch (attachment) {
- case GL_COLOR_ATTACHMENT0_EXT:
- case GL_COLOR_ATTACHMENT1_EXT:
- case GL_COLOR_ATTACHMENT2_EXT:
- case GL_COLOR_ATTACHMENT3_EXT:
- case GL_COLOR_ATTACHMENT4_EXT:
- case GL_COLOR_ATTACHMENT5_EXT:
- case GL_COLOR_ATTACHMENT6_EXT:
- case GL_COLOR_ATTACHMENT7_EXT:
- case GL_COLOR_ATTACHMENT8_EXT:
- case GL_COLOR_ATTACHMENT9_EXT:
- case GL_COLOR_ATTACHMENT10_EXT:
- case GL_COLOR_ATTACHMENT11_EXT:
- case GL_COLOR_ATTACHMENT12_EXT:
- case GL_COLOR_ATTACHMENT13_EXT:
- case GL_COLOR_ATTACHMENT14_EXT:
- case GL_COLOR_ATTACHMENT15_EXT:
- i = attachment - GL_COLOR_ATTACHMENT0_EXT;
- if (i >= ctx->Const.MaxColorAttachments) {
- return NULL;
- }
- return &fb->Attachment[BUFFER_COLOR0 + i];
- case GL_DEPTH_STENCIL_ATTACHMENT:
- /* fall-through */
- case GL_DEPTH_BUFFER:
- /* fall-through / new in GL 3.0 */
- case GL_DEPTH_ATTACHMENT_EXT:
- return &fb->Attachment[BUFFER_DEPTH];
- case GL_STENCIL_BUFFER:
- /* fall-through / new in GL 3.0 */
- case GL_STENCIL_ATTACHMENT_EXT:
- return &fb->Attachment[BUFFER_STENCIL];
- default:
- return NULL;
- }
-}
-
-
-/**
- * As above, but only used for getting attachments of the default /
- * window-system framebuffer (not user-created framebuffer objects).
- */
-static struct gl_renderbuffer_attachment *
-_mesa_get_fb0_attachment(struct gl_context *ctx, struct gl_framebuffer *fb,
- GLenum attachment)
-{
- assert(fb->Name == 0);
-
- switch (attachment) {
- case GL_FRONT_LEFT:
- return &fb->Attachment[BUFFER_FRONT_LEFT];
- case GL_FRONT_RIGHT:
- return &fb->Attachment[BUFFER_FRONT_RIGHT];
- case GL_BACK_LEFT:
- return &fb->Attachment[BUFFER_BACK_LEFT];
- case GL_BACK_RIGHT:
- return &fb->Attachment[BUFFER_BACK_RIGHT];
- case GL_AUX0:
- if (fb->Visual.numAuxBuffers == 1) {
- return &fb->Attachment[BUFFER_AUX0];
- }
- return NULL;
- case GL_DEPTH_BUFFER:
- /* fall-through / new in GL 3.0 */
- case GL_DEPTH_ATTACHMENT_EXT:
- return &fb->Attachment[BUFFER_DEPTH];
- case GL_STENCIL_BUFFER:
- /* fall-through / new in GL 3.0 */
- case GL_STENCIL_ATTACHMENT_EXT:
- return &fb->Attachment[BUFFER_STENCIL];
- default:
- return NULL;
- }
-}
-
-
-
-/**
- * Remove any texture or renderbuffer attached to the given attachment
- * point. Update reference counts, etc.
- */
-void
-_mesa_remove_attachment(struct gl_context *ctx,
- struct gl_renderbuffer_attachment *att)
-{
- if (att->Type == GL_TEXTURE) {
- ASSERT(att->Texture);
- if (ctx->Driver.FinishRenderTexture) {
- /* tell driver that we're done rendering to this texture. */
- ctx->Driver.FinishRenderTexture(ctx, att);
- }
- _mesa_reference_texobj(&att->Texture, NULL); /* unbind */
- ASSERT(!att->Texture);
- }
- if (att->Type == GL_TEXTURE || att->Type == GL_RENDERBUFFER_EXT) {
- ASSERT(!att->Texture);
- _mesa_reference_renderbuffer(&att->Renderbuffer, NULL); /* unbind */
- ASSERT(!att->Renderbuffer);
- }
- att->Type = GL_NONE;
- att->Complete = GL_TRUE;
-}
-
-
-/**
- * Bind a texture object to an attachment point.
- * The previous binding, if any, will be removed first.
- */
-void
-_mesa_set_texture_attachment(struct gl_context *ctx,
- struct gl_framebuffer *fb,
- struct gl_renderbuffer_attachment *att,
- struct gl_texture_object *texObj,
- GLenum texTarget, GLuint level, GLuint zoffset)
-{
- if (att->Texture == texObj) {
- /* re-attaching same texture */
- ASSERT(att->Type == GL_TEXTURE);
- if (ctx->Driver.FinishRenderTexture)
- ctx->Driver.FinishRenderTexture(ctx, att);
- }
- else {
- /* new attachment */
- if (ctx->Driver.FinishRenderTexture && att->Texture)
- ctx->Driver.FinishRenderTexture(ctx, att);
- _mesa_remove_attachment(ctx, att);
- att->Type = GL_TEXTURE;
- assert(!att->Texture);
- _mesa_reference_texobj(&att->Texture, texObj);
- }
-
- /* always update these fields */
- att->TextureLevel = level;
- att->CubeMapFace = _mesa_tex_target_to_face(texTarget);
- att->Zoffset = zoffset;
- att->Complete = GL_FALSE;
-
- if (_mesa_get_attachment_teximage(att)) {
- ctx->Driver.RenderTexture(ctx, fb, att);
- }
-
- invalidate_framebuffer(fb);
-}
-
-
-/**
- * Bind a renderbuffer to an attachment point.
- * The previous binding, if any, will be removed first.
- */
-void
-_mesa_set_renderbuffer_attachment(struct gl_context *ctx,
- struct gl_renderbuffer_attachment *att,
- struct gl_renderbuffer *rb)
-{
- /* XXX check if re-doing same attachment, exit early */
- _mesa_remove_attachment(ctx, att);
- att->Type = GL_RENDERBUFFER_EXT;
- att->Texture = NULL; /* just to be safe */
- att->Complete = GL_FALSE;
- _mesa_reference_renderbuffer(&att->Renderbuffer, rb);
-}
-
-
-/**
- * Fallback for ctx->Driver.FramebufferRenderbuffer()
- * Attach a renderbuffer object to a framebuffer object.
- */
-void
-_mesa_framebuffer_renderbuffer(struct gl_context *ctx,
- struct gl_framebuffer *fb,
- GLenum attachment, struct gl_renderbuffer *rb)
-{
- struct gl_renderbuffer_attachment *att;
-
- _glthread_LOCK_MUTEX(fb->Mutex);
-
- att = _mesa_get_attachment(ctx, fb, attachment);
- ASSERT(att);
- if (rb) {
- _mesa_set_renderbuffer_attachment(ctx, att, rb);
- if (attachment == GL_DEPTH_STENCIL_ATTACHMENT) {
- /* do stencil attachment here (depth already done above) */
- att = _mesa_get_attachment(ctx, fb, GL_STENCIL_ATTACHMENT_EXT);
- assert(att);
- _mesa_set_renderbuffer_attachment(ctx, att, rb);
- }
- rb->AttachedAnytime = GL_TRUE;
- }
- else {
- _mesa_remove_attachment(ctx, att);
- }
-
- invalidate_framebuffer(fb);
-
- _glthread_UNLOCK_MUTEX(fb->Mutex);
-}
-
-
-/**
- * Fallback for ctx->Driver.ValidateFramebuffer()
- * Check if the renderbuffer's formats are supported by the software
- * renderer.
- * Drivers should probably override this.
- */
-void
-_mesa_validate_framebuffer(struct gl_context *ctx, struct gl_framebuffer *fb)
-{
- gl_buffer_index buf;
- for (buf = 0; buf < BUFFER_COUNT; buf++) {
- const struct gl_renderbuffer *rb = fb->Attachment[buf].Renderbuffer;
- if (rb) {
- switch (rb->_BaseFormat) {
- case GL_ALPHA:
- case GL_LUMINANCE_ALPHA:
- case GL_LUMINANCE:
- case GL_INTENSITY:
- case GL_RED:
- case GL_RG:
- fb->_Status = GL_FRAMEBUFFER_UNSUPPORTED;
- return;
-
- default:
- switch (rb->Format) {
- /* XXX This list is likely incomplete. */
- case MESA_FORMAT_RGB9_E5_FLOAT:
- fb->_Status = GL_FRAMEBUFFER_UNSUPPORTED;
- return;
- default:;
- /* render buffer format is supported by software rendering */
- }
- }
- }
- }
-}
-
-
-/**
- * For debug only.
- */
-static void
-att_incomplete(const char *msg)
-{
-#if DEBUG_FBO
- _mesa_debug(NULL, "attachment incomplete: %s\n", msg);
-#else
- (void) msg;
-#endif
-}
-
-
-/**
- * For debug only.
- */
-static void
-fbo_incomplete(const char *msg, int index)
-{
-#if DEBUG_FBO
- _mesa_debug(NULL, "FBO Incomplete: %s [%d]\n", msg, index);
-#else
- (void) msg;
- (void) index;
-#endif
-}
-
-
-/**
- * Is the given base format a legal format for a color renderbuffer?
- */
-GLboolean
-_mesa_is_legal_color_format(const struct gl_context *ctx, GLenum baseFormat)
-{
- switch (baseFormat) {
- case GL_RGB:
- case GL_RGBA:
- return GL_TRUE;
- case GL_LUMINANCE:
- case GL_LUMINANCE_ALPHA:
- case GL_INTENSITY:
- case GL_ALPHA:
- return ctx->Extensions.ARB_framebuffer_object;
- case GL_RED:
- case GL_RG:
- return ctx->Extensions.ARB_texture_rg;
- default:
- return GL_FALSE;
- }
-}
-
-
-/**
- * Is the given base format a legal format for a depth/stencil renderbuffer?
- */
-static GLboolean
-is_legal_depth_format(const struct gl_context *ctx, GLenum baseFormat)
-{
- switch (baseFormat) {
- case GL_DEPTH_COMPONENT:
- case GL_DEPTH_STENCIL_EXT:
- return GL_TRUE;
- default:
- return GL_FALSE;
- }
-}
-
-
-/**
- * Test if an attachment point is complete and update its Complete field.
- * \param format if GL_COLOR, this is a color attachment point,
- * if GL_DEPTH, this is a depth component attachment point,
- * if GL_STENCIL, this is a stencil component attachment point.
- */
-static void
-test_attachment_completeness(const struct gl_context *ctx, GLenum format,
- struct gl_renderbuffer_attachment *att)
-{
- assert(format == GL_COLOR || format == GL_DEPTH || format == GL_STENCIL);
-
- /* assume complete */
- att->Complete = GL_TRUE;
-
- /* Look for reasons why the attachment might be incomplete */
- if (att->Type == GL_TEXTURE) {
- const struct gl_texture_object *texObj = att->Texture;
- struct gl_texture_image *texImage;
- GLenum baseFormat;
-
- if (!texObj) {
- att_incomplete("no texobj");
- att->Complete = GL_FALSE;
- return;
- }
-
- texImage = texObj->Image[att->CubeMapFace][att->TextureLevel];
- if (!texImage) {
- att_incomplete("no teximage");
- att->Complete = GL_FALSE;
- return;
- }
- if (texImage->Width < 1 || texImage->Height < 1) {
- att_incomplete("teximage width/height=0");
- printf("texobj = %u\n", texObj->Name);
- printf("level = %d\n", att->TextureLevel);
- att->Complete = GL_FALSE;
- return;
- }
- if (texObj->Target == GL_TEXTURE_3D && att->Zoffset >= texImage->Depth) {
- att_incomplete("bad z offset");
- att->Complete = GL_FALSE;
- return;
- }
-
- baseFormat = _mesa_get_format_base_format(texImage->TexFormat);
-
- if (format == GL_COLOR) {
- if (!_mesa_is_legal_color_format(ctx, baseFormat)) {
- att_incomplete("bad format");
- att->Complete = GL_FALSE;
- return;
- }
- if (_mesa_is_format_compressed(texImage->TexFormat)) {
- att_incomplete("compressed internalformat");
- att->Complete = GL_FALSE;
- return;
- }
- }
- else if (format == GL_DEPTH) {
- if (baseFormat == GL_DEPTH_COMPONENT) {
- /* OK */
- }
- else if (ctx->Extensions.EXT_packed_depth_stencil &&
- ctx->Extensions.ARB_depth_texture &&
- baseFormat == GL_DEPTH_STENCIL_EXT) {
- /* OK */
- }
- else {
- att->Complete = GL_FALSE;
- att_incomplete("bad depth format");
- return;
- }
- }
- else {
- ASSERT(format == GL_STENCIL);
- if (ctx->Extensions.EXT_packed_depth_stencil &&
- ctx->Extensions.ARB_depth_texture &&
- baseFormat == GL_DEPTH_STENCIL_EXT) {
- /* OK */
- }
- else {
- /* no such thing as stencil-only textures */
- att_incomplete("illegal stencil texture");
- att->Complete = GL_FALSE;
- return;
- }
- }
- }
- else if (att->Type == GL_RENDERBUFFER_EXT) {
- const GLenum baseFormat =
- _mesa_get_format_base_format(att->Renderbuffer->Format);
-
- ASSERT(att->Renderbuffer);
- if (!att->Renderbuffer->InternalFormat ||
- att->Renderbuffer->Width < 1 ||
- att->Renderbuffer->Height < 1) {
- att_incomplete("0x0 renderbuffer");
- att->Complete = GL_FALSE;
- return;
- }
- if (format == GL_COLOR) {
- if (!_mesa_is_legal_color_format(ctx, baseFormat)) {
- att_incomplete("bad renderbuffer color format");
- att->Complete = GL_FALSE;
- return;
- }
- }
- else if (format == GL_DEPTH) {
- if (baseFormat == GL_DEPTH_COMPONENT) {
- /* OK */
- }
- else if (ctx->Extensions.EXT_packed_depth_stencil &&
- baseFormat == GL_DEPTH_STENCIL_EXT) {
- /* OK */
- }
- else {
- att_incomplete("bad renderbuffer depth format");
- att->Complete = GL_FALSE;
- return;
- }
- }
- else {
- assert(format == GL_STENCIL);
- if (baseFormat == GL_STENCIL_INDEX) {
- /* OK */
- }
- else if (ctx->Extensions.EXT_packed_depth_stencil &&
- baseFormat == GL_DEPTH_STENCIL_EXT) {
- /* OK */
- }
- else {
- att->Complete = GL_FALSE;
- att_incomplete("bad renderbuffer stencil format");
- return;
- }
- }
- }
- else {
- ASSERT(att->Type == GL_NONE);
- /* complete */
- return;
- }
-}
-
-
-/**
- * Test if the given framebuffer object is complete and update its
- * Status field with the results.
- * Calls the ctx->Driver.ValidateFramebuffer() function to allow the
- * driver to make hardware-specific validation/completeness checks.
- * Also update the framebuffer's Width and Height fields if the
- * framebuffer is complete.
- */
-void
-_mesa_test_framebuffer_completeness(struct gl_context *ctx,
- struct gl_framebuffer *fb)
-{
- GLuint numImages;
- GLenum intFormat = GL_NONE; /* color buffers' internal format */
- GLuint minWidth = ~0, minHeight = ~0, maxWidth = 0, maxHeight = 0;
- GLint numSamples = -1;
- GLint i;
- GLuint j;
-
- assert(fb->Name != 0);
-
- numImages = 0;
- fb->Width = 0;
- fb->Height = 0;
-
- /* Start at -2 to more easily loop over all attachment points.
- * -2: depth buffer
- * -1: stencil buffer
- * >=0: color buffer
- */
- for (i = -2; i < (GLint) ctx->Const.MaxColorAttachments; i++) {
- struct gl_renderbuffer_attachment *att;
- GLenum f;
- gl_format attFormat;
-
- /*
- * XXX for ARB_fbo, only check color buffers that are named by
- * GL_READ_BUFFER and GL_DRAW_BUFFERi.
- */
-
- /* check for attachment completeness
- */
- if (i == -2) {
- att = &fb->Attachment[BUFFER_DEPTH];
- test_attachment_completeness(ctx, GL_DEPTH, att);
- if (!att->Complete) {
- fb->_Status = GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT;
- fbo_incomplete("depth attachment incomplete", -1);
- return;
- }
- }
- else if (i == -1) {
- att = &fb->Attachment[BUFFER_STENCIL];
- test_attachment_completeness(ctx, GL_STENCIL, att);
- if (!att->Complete) {
- fb->_Status = GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT;
- fbo_incomplete("stencil attachment incomplete", -1);
- return;
- }
- }
- else {
- att = &fb->Attachment[BUFFER_COLOR0 + i];
- test_attachment_completeness(ctx, GL_COLOR, att);
- if (!att->Complete) {
- fb->_Status = GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT;
- fbo_incomplete("color attachment incomplete", i);
- return;
- }
- }
-
- /* get width, height, format of the renderbuffer/texture
- */
- if (att->Type == GL_TEXTURE) {
- const struct gl_texture_image *texImg =
- _mesa_get_attachment_teximage(att);
- minWidth = MIN2(minWidth, texImg->Width);
- maxWidth = MAX2(maxWidth, texImg->Width);
- minHeight = MIN2(minHeight, texImg->Height);
- maxHeight = MAX2(maxHeight, texImg->Height);
- f = texImg->_BaseFormat;
- attFormat = texImg->TexFormat;
- numImages++;
- if (!_mesa_is_legal_color_format(ctx, f) &&
- !is_legal_depth_format(ctx, f)) {
- fb->_Status = GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT;
- fbo_incomplete("texture attachment incomplete", -1);
- return;
- }
- }
- else if (att->Type == GL_RENDERBUFFER_EXT) {
- minWidth = MIN2(minWidth, att->Renderbuffer->Width);
- maxWidth = MAX2(minWidth, att->Renderbuffer->Width);
- minHeight = MIN2(minHeight, att->Renderbuffer->Height);
- maxHeight = MAX2(minHeight, att->Renderbuffer->Height);
- f = att->Renderbuffer->InternalFormat;
- attFormat = att->Renderbuffer->Format;
- numImages++;
- }
- else {
- assert(att->Type == GL_NONE);
- continue;
- }
-
- if (att->Renderbuffer && numSamples < 0) {
- /* first buffer */
- numSamples = att->Renderbuffer->NumSamples;
- }
-
- /* check if integer color */
- fb->_IntegerColor = _mesa_is_format_integer_color(attFormat);
-
- /* Error-check width, height, format, samples
- */
- if (numImages == 1) {
- /* save format, num samples */
- if (i >= 0) {
- intFormat = f;
- }
- }
- else {
- if (!ctx->Extensions.ARB_framebuffer_object) {
- /* check that width, height, format are same */
- if (minWidth != maxWidth || minHeight != maxHeight) {
- fb->_Status = GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT;
- fbo_incomplete("width or height mismatch", -1);
- return;
- }
- /* check that all color buffer have same format */
- if (intFormat != GL_NONE && f != intFormat) {
- fb->_Status = GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT;
- fbo_incomplete("format mismatch", -1);
- return;
- }
- }
- if (att->Renderbuffer &&
- att->Renderbuffer->NumSamples != numSamples) {
- fb->_Status = GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE;
- fbo_incomplete("inconsistant number of samples", i);
- return;
- }
-
- }
- }
-
-#if FEATURE_GL
- if (ctx->API == API_OPENGL) {
- /* Check that all DrawBuffers are present */
- for (j = 0; j < ctx->Const.MaxDrawBuffers; j++) {
- if (fb->ColorDrawBuffer[j] != GL_NONE) {
- const struct gl_renderbuffer_attachment *att
- = _mesa_get_attachment(ctx, fb, fb->ColorDrawBuffer[j]);
- assert(att);
- if (att->Type == GL_NONE) {
- fb->_Status = GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT;
- fbo_incomplete("missing drawbuffer", j);
- return;
- }
- }
- }
-
- /* Check that the ReadBuffer is present */
- if (fb->ColorReadBuffer != GL_NONE) {
- const struct gl_renderbuffer_attachment *att
- = _mesa_get_attachment(ctx, fb, fb->ColorReadBuffer);
- assert(att);
- if (att->Type == GL_NONE) {
- fb->_Status = GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT;
- fbo_incomplete("missing readbuffer", -1);
- return;
- }
- }
- }
-#else
- (void) j;
-#endif
-
- if (numImages == 0) {
- fb->_Status = GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT;
- fbo_incomplete("no attachments", -1);
- return;
- }
-
- /* Provisionally set status = COMPLETE ... */
- fb->_Status = GL_FRAMEBUFFER_COMPLETE_EXT;
-
- /* ... but the driver may say the FB is incomplete.
- * Drivers will most likely set the status to GL_FRAMEBUFFER_UNSUPPORTED
- * if anything.
- */
- if (ctx->Driver.ValidateFramebuffer) {
- ctx->Driver.ValidateFramebuffer(ctx, fb);
- if (fb->_Status != GL_FRAMEBUFFER_COMPLETE_EXT) {
- fbo_incomplete("driver marked FBO as incomplete", -1);
- }
- }
-
- if (fb->_Status == GL_FRAMEBUFFER_COMPLETE_EXT) {
- /*
- * Note that if ARB_framebuffer_object is supported and the attached
- * renderbuffers/textures are different sizes, the framebuffer
- * width/height will be set to the smallest width/height.
- */
- fb->Width = minWidth;
- fb->Height = minHeight;
-
- /* finally, update the visual info for the framebuffer */
- _mesa_update_framebuffer_visual(ctx, fb);
- }
-}
-
-
-GLboolean GLAPIENTRY
-_mesa_IsRenderbufferEXT(GLuint renderbuffer)
-{
- GET_CURRENT_CONTEXT(ctx);
- ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, GL_FALSE);
- if (renderbuffer) {
- struct gl_renderbuffer *rb = _mesa_lookup_renderbuffer(ctx, renderbuffer);
- if (rb != NULL && rb != &DummyRenderbuffer)
- return GL_TRUE;
- }
- return GL_FALSE;
-}
-
-
-void GLAPIENTRY
-_mesa_BindRenderbufferEXT(GLenum target, GLuint renderbuffer)
-{
- struct gl_renderbuffer *newRb;
- GET_CURRENT_CONTEXT(ctx);
-
- ASSERT_OUTSIDE_BEGIN_END(ctx);
-
- if (target != GL_RENDERBUFFER_EXT) {
- _mesa_error(ctx, GL_INVALID_ENUM, "glBindRenderbufferEXT(target)");
- return;
- }
-
- /* No need to flush here since the render buffer binding has no
- * effect on rendering state.
- */
-
- if (renderbuffer) {
- newRb = _mesa_lookup_renderbuffer(ctx, renderbuffer);
- if (newRb == &DummyRenderbuffer) {
- /* ID was reserved, but no real renderbuffer object made yet */
- newRb = NULL;
- }
- else if (!newRb && ctx->Extensions.ARB_framebuffer_object) {
- /* All RB IDs must be Gen'd */
- _mesa_error(ctx, GL_INVALID_OPERATION, "glBindRenderbuffer(buffer)");
- return;
- }
-
- if (!newRb) {
- /* create new renderbuffer object */
- newRb = ctx->Driver.NewRenderbuffer(ctx, renderbuffer);
- if (!newRb) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "glBindRenderbufferEXT");
- return;
- }
- ASSERT(newRb->AllocStorage);
- _mesa_HashInsert(ctx->Shared->RenderBuffers, renderbuffer, newRb);
- newRb->RefCount = 1; /* referenced by hash table */
- }
- }
- else {
- newRb = NULL;
- }
-
- ASSERT(newRb != &DummyRenderbuffer);
-
- _mesa_reference_renderbuffer(&ctx->CurrentRenderbuffer, newRb);
-}
-
-
-/**
- * If the given renderbuffer is anywhere attached to the framebuffer, detach
- * the renderbuffer.
- * This is used when a renderbuffer object is deleted.
- * The spec calls for unbinding.
- */
-static void
-detach_renderbuffer(struct gl_context *ctx,
- struct gl_framebuffer *fb,
- struct gl_renderbuffer *rb)
-{
- GLuint i;
- for (i = 0; i < BUFFER_COUNT; i++) {
- if (fb->Attachment[i].Renderbuffer == rb) {
- _mesa_remove_attachment(ctx, &fb->Attachment[i]);
- }
- }
- invalidate_framebuffer(fb);
-}
-
-
-void GLAPIENTRY
-_mesa_DeleteRenderbuffersEXT(GLsizei n, const GLuint *renderbuffers)
-{
- GLint i;
- GET_CURRENT_CONTEXT(ctx);
-
- ASSERT_OUTSIDE_BEGIN_END(ctx);
- FLUSH_VERTICES(ctx, _NEW_BUFFERS);
-
- for (i = 0; i < n; i++) {
- if (renderbuffers[i] > 0) {
- struct gl_renderbuffer *rb;
- rb = _mesa_lookup_renderbuffer(ctx, renderbuffers[i]);
- if (rb) {
- /* check if deleting currently bound renderbuffer object */
- if (rb == ctx->CurrentRenderbuffer) {
- /* bind default */
- ASSERT(rb->RefCount >= 2);
- _mesa_BindRenderbufferEXT(GL_RENDERBUFFER_EXT, 0);
- }
-
- if (ctx->DrawBuffer->Name) {
- detach_renderbuffer(ctx, ctx->DrawBuffer, rb);
- }
- if (ctx->ReadBuffer->Name && ctx->ReadBuffer != ctx->DrawBuffer) {
- detach_renderbuffer(ctx, ctx->ReadBuffer, rb);
- }
-
- /* Remove from hash table immediately, to free the ID.
- * But the object will not be freed until it's no longer
- * referenced anywhere else.
- */
- _mesa_HashRemove(ctx->Shared->RenderBuffers, renderbuffers[i]);
-
- if (rb != &DummyRenderbuffer) {
- /* no longer referenced by hash table */
- _mesa_reference_renderbuffer(&rb, NULL);
- }
- }
- }
- }
-}
-
-
-void GLAPIENTRY
-_mesa_GenRenderbuffersEXT(GLsizei n, GLuint *renderbuffers)
-{
- GET_CURRENT_CONTEXT(ctx);
- GLuint first;
- GLint i;
-
- ASSERT_OUTSIDE_BEGIN_END(ctx);
-
- if (n < 0) {
- _mesa_error(ctx, GL_INVALID_VALUE, "glGenRenderbuffersEXT(n)");
- return;
- }
-
- if (!renderbuffers)
- return;
-
- first = _mesa_HashFindFreeKeyBlock(ctx->Shared->RenderBuffers, n);
-
- for (i = 0; i < n; i++) {
- GLuint name = first + i;
- renderbuffers[i] = name;
- /* insert dummy placeholder into hash table */
- _glthread_LOCK_MUTEX(ctx->Shared->Mutex);
- _mesa_HashInsert(ctx->Shared->RenderBuffers, name, &DummyRenderbuffer);
- _glthread_UNLOCK_MUTEX(ctx->Shared->Mutex);
- }
-}
-
-
-/**
- * Given an internal format token for a render buffer, return the
- * corresponding base format (one of GL_RGB, GL_RGBA, GL_STENCIL_INDEX,
- * GL_DEPTH_COMPONENT, GL_DEPTH_STENCIL_EXT, GL_ALPHA, GL_LUMINANCE,
- * GL_LUMINANCE_ALPHA, GL_INTENSITY, etc).
- *
- * This is similar to _mesa_base_tex_format() but the set of valid
- * internal formats is different.
- *
- * Note that even if a format is determined to be legal here, validation
- * of the FBO may fail if the format is not supported by the driver/GPU.
- *
- * \param internalFormat as passed to glRenderbufferStorage()
- * \return the base internal format, or 0 if internalFormat is illegal
- */
-GLenum
-_mesa_base_fbo_format(struct gl_context *ctx, GLenum internalFormat)
-{
- /*
- * Notes: some formats such as alpha, luminance, etc. were added
- * with GL_ARB_framebuffer_object.
- */
- switch (internalFormat) {
- case GL_ALPHA:
- case GL_ALPHA4:
- case GL_ALPHA8:
- case GL_ALPHA12:
- case GL_ALPHA16:
- return ctx->Extensions.ARB_framebuffer_object ? GL_ALPHA : 0;
- case GL_LUMINANCE:
- case GL_LUMINANCE4:
- case GL_LUMINANCE8:
- case GL_LUMINANCE12:
- case GL_LUMINANCE16:
- return ctx->Extensions.ARB_framebuffer_object ? GL_LUMINANCE : 0;
- case GL_LUMINANCE_ALPHA:
- case GL_LUMINANCE4_ALPHA4:
- case GL_LUMINANCE6_ALPHA2:
- case GL_LUMINANCE8_ALPHA8:
- case GL_LUMINANCE12_ALPHA4:
- case GL_LUMINANCE12_ALPHA12:
- case GL_LUMINANCE16_ALPHA16:
- return ctx->Extensions.ARB_framebuffer_object ? GL_LUMINANCE_ALPHA : 0;
- case GL_INTENSITY:
- case GL_INTENSITY4:
- case GL_INTENSITY8:
- case GL_INTENSITY12:
- case GL_INTENSITY16:
- return ctx->Extensions.ARB_framebuffer_object ? GL_INTENSITY : 0;
- case GL_RGB:
- case GL_R3_G3_B2:
- case GL_RGB4:
- case GL_RGB5:
- case GL_RGB8:
- case GL_RGB10:
- case GL_RGB12:
- case GL_RGB16:
- case GL_SRGB8_EXT:
- return GL_RGB;
- case GL_RGBA:
- case GL_RGBA2:
- case GL_RGBA4:
- case GL_RGB5_A1:
- case GL_RGBA8:
- case GL_RGB10_A2:
- case GL_RGBA12:
- case GL_RGBA16:
- case GL_SRGB8_ALPHA8_EXT:
- return GL_RGBA;
- case GL_STENCIL_INDEX:
- case GL_STENCIL_INDEX1_EXT:
- case GL_STENCIL_INDEX4_EXT:
- case GL_STENCIL_INDEX8_EXT:
- case GL_STENCIL_INDEX16_EXT:
- return GL_STENCIL_INDEX;
- case GL_DEPTH_COMPONENT:
- case GL_DEPTH_COMPONENT16:
- case GL_DEPTH_COMPONENT24:
- case GL_DEPTH_COMPONENT32:
- return GL_DEPTH_COMPONENT;
- case GL_DEPTH_STENCIL_EXT:
- case GL_DEPTH24_STENCIL8_EXT:
- if (ctx->Extensions.EXT_packed_depth_stencil)
- return GL_DEPTH_STENCIL_EXT;
- else
- return 0;
- case GL_RED:
- case GL_R8:
- case GL_R16:
- return ctx->Extensions.ARB_texture_rg ? GL_RED : 0;
- case GL_RG:
- case GL_RG8:
- case GL_RG16:
- return ctx->Extensions.ARB_texture_rg ? GL_RG : 0;
- /* signed normalized texture formats */
- case GL_RED_SNORM:
- case GL_R8_SNORM:
- case GL_R16_SNORM:
- return ctx->Extensions.EXT_texture_snorm ? GL_RED : 0;
- case GL_RG_SNORM:
- case GL_RG8_SNORM:
- case GL_RG16_SNORM:
- return ctx->Extensions.EXT_texture_snorm ? GL_RG : 0;
- case GL_RGB_SNORM:
- case GL_RGB8_SNORM:
- case GL_RGB16_SNORM:
- return ctx->Extensions.EXT_texture_snorm ? GL_RGB : 0;
- case GL_RGBA_SNORM:
- case GL_RGBA8_SNORM:
- case GL_RGBA16_SNORM:
- return ctx->Extensions.EXT_texture_snorm ? GL_RGBA : 0;
- case GL_ALPHA_SNORM:
- case GL_ALPHA8_SNORM:
- case GL_ALPHA16_SNORM:
- return ctx->Extensions.EXT_texture_snorm &&
- ctx->Extensions.ARB_framebuffer_object ? GL_ALPHA : 0;
- case GL_LUMINANCE_SNORM:
- case GL_LUMINANCE8_SNORM:
- case GL_LUMINANCE16_SNORM:
- return ctx->Extensions.EXT_texture_snorm &&
- ctx->Extensions.ARB_framebuffer_object ? GL_LUMINANCE : 0;
- case GL_LUMINANCE_ALPHA_SNORM:
- case GL_LUMINANCE8_ALPHA8_SNORM:
- case GL_LUMINANCE16_ALPHA16_SNORM:
- return ctx->Extensions.EXT_texture_snorm &&
- ctx->Extensions.ARB_framebuffer_object ? GL_LUMINANCE_ALPHA : 0;
- case GL_INTENSITY_SNORM:
- case GL_INTENSITY8_SNORM:
- case GL_INTENSITY16_SNORM:
- return ctx->Extensions.EXT_texture_snorm &&
- ctx->Extensions.ARB_framebuffer_object ? GL_INTENSITY : 0;
- case GL_R16F:
- case GL_R32F:
- return ctx->Extensions.ARB_texture_rg &&
- ctx->Extensions.ARB_texture_float ? GL_RED : 0;
- case GL_RG16F:
- case GL_RG32F:
- return ctx->Extensions.ARB_texture_rg &&
- ctx->Extensions.ARB_texture_float ? GL_RG : 0;
- case GL_RGB16F:
- case GL_RGB32F:
- return ctx->Extensions.ARB_texture_float ? GL_RGB : 0;
- case GL_RGBA16F:
- case GL_RGBA32F:
- return ctx->Extensions.ARB_texture_float ? GL_RGBA : 0;
- case GL_ALPHA16F_ARB:
- case GL_ALPHA32F_ARB:
- return ctx->Extensions.ARB_texture_float &&
- ctx->Extensions.ARB_framebuffer_object ? GL_ALPHA : 0;
- case GL_LUMINANCE16F_ARB:
- case GL_LUMINANCE32F_ARB:
- return ctx->Extensions.ARB_texture_float &&
- ctx->Extensions.ARB_framebuffer_object ? GL_LUMINANCE : 0;
- case GL_LUMINANCE_ALPHA16F_ARB:
- case GL_LUMINANCE_ALPHA32F_ARB:
- return ctx->Extensions.ARB_texture_float &&
- ctx->Extensions.ARB_framebuffer_object ? GL_LUMINANCE_ALPHA : 0;
- case GL_INTENSITY16F_ARB:
- case GL_INTENSITY32F_ARB:
- return ctx->Extensions.ARB_texture_float &&
- ctx->Extensions.ARB_framebuffer_object ? GL_INTENSITY : 0;
- case GL_RGB9_E5:
- return ctx->Extensions.EXT_texture_shared_exponent ? GL_RGB : 0;
- case GL_R11F_G11F_B10F:
- return ctx->Extensions.EXT_packed_float ? GL_RGB : 0;
- /* XXX add integer formats eventually */
- default:
- return 0;
- }
-}
-
-
-/**
- * Invalidate a renderbuffer attachment. Called from _mesa_HashWalk().
- */
-static void
-invalidate_rb(GLuint key, void *data, void *userData)
-{
- struct gl_framebuffer *fb = (struct gl_framebuffer *) data;
- struct gl_renderbuffer *rb = (struct gl_renderbuffer *) userData;
-
- /* If this is a user-created FBO */
- if (fb->Name) {
- GLuint i;
- for (i = 0; i < BUFFER_COUNT; i++) {
- struct gl_renderbuffer_attachment *att = fb->Attachment + i;
- if (att->Type == GL_RENDERBUFFER &&
- att->Renderbuffer == rb) {
- /* Mark fb status as indeterminate to force re-validation */
- fb->_Status = 0;
- return;
- }
- }
- }
-}
-
-
-/** sentinal value, see below */
-#define NO_SAMPLES 1000
-
-
-/**
- * Helper function used by _mesa_RenderbufferStorageEXT() and
- * _mesa_RenderbufferStorageMultisample().
- * samples will be NO_SAMPLES if called by _mesa_RenderbufferStorageEXT().
- */
-static void
-renderbuffer_storage(GLenum target, GLenum internalFormat,
- GLsizei width, GLsizei height, GLsizei samples)
-{
- const char *func = samples == NO_SAMPLES ?
- "glRenderbufferStorage" : "RenderbufferStorageMultisample";
- struct gl_renderbuffer *rb;
- GLenum baseFormat;
- GET_CURRENT_CONTEXT(ctx);
-
- ASSERT_OUTSIDE_BEGIN_END(ctx);
-
- if (target != GL_RENDERBUFFER_EXT) {
- _mesa_error(ctx, GL_INVALID_ENUM, "%s(target)", func);
- return;
- }
-
- baseFormat = _mesa_base_fbo_format(ctx, internalFormat);
- if (baseFormat == 0) {
- _mesa_error(ctx, GL_INVALID_ENUM, "%s(internalFormat)", func);
- return;
- }
-
- if (width < 1 || width > (GLsizei) ctx->Const.MaxRenderbufferSize) {
- _mesa_error(ctx, GL_INVALID_VALUE, "%s(width)", func);
- return;
- }
-
- if (height < 1 || height > (GLsizei) ctx->Const.MaxRenderbufferSize) {
- _mesa_error(ctx, GL_INVALID_VALUE, "%s(height)", func);
- return;
- }
-
- if (samples == NO_SAMPLES) {
- /* NumSamples == 0 indicates non-multisampling */
- samples = 0;
- }
- else if (samples > (GLsizei) ctx->Const.MaxSamples) {
- /* note: driver may choose to use more samples than what's requested */
- _mesa_error(ctx, GL_INVALID_VALUE, "%s(samples)", func);
- return;
- }
-
- rb = ctx->CurrentRenderbuffer;
- if (!rb) {
- _mesa_error(ctx, GL_INVALID_OPERATION, "%s", func);
- return;
- }
-
- FLUSH_VERTICES(ctx, _NEW_BUFFERS);
-
- if (rb->InternalFormat == internalFormat &&
- rb->Width == (GLuint) width &&
- rb->Height == (GLuint) height) {
- /* no change in allocation needed */
- return;
- }
-
- /* These MUST get set by the AllocStorage func */
- rb->Format = MESA_FORMAT_NONE;
- rb->NumSamples = samples;
-
- /* Now allocate the storage */
- ASSERT(rb->AllocStorage);
- if (rb->AllocStorage(ctx, rb, internalFormat, width, height)) {
- /* No error - check/set fields now */
- assert(rb->Format != MESA_FORMAT_NONE);
- assert(rb->Width == (GLuint) width);
- assert(rb->Height == (GLuint) height);
- rb->InternalFormat = internalFormat;
- rb->_BaseFormat = baseFormat;
- assert(rb->_BaseFormat != 0);
- }
- else {
- /* Probably ran out of memory - clear the fields */
- rb->Width = 0;
- rb->Height = 0;
- rb->Format = MESA_FORMAT_NONE;
- rb->InternalFormat = GL_NONE;
- rb->_BaseFormat = GL_NONE;
- rb->NumSamples = 0;
- }
-
- /* Invalidate the framebuffers the renderbuffer is attached in. */
- if (rb->AttachedAnytime) {
- _mesa_HashWalk(ctx->Shared->FrameBuffers, invalidate_rb, rb);
- }
-}
-
-
-#if FEATURE_OES_EGL_image
-void GLAPIENTRY
-_mesa_EGLImageTargetRenderbufferStorageOES(GLenum target, GLeglImageOES image)
-{
- struct gl_renderbuffer *rb;
- GET_CURRENT_CONTEXT(ctx);
- ASSERT_OUTSIDE_BEGIN_END(ctx);
-
- if (!ctx->Extensions.OES_EGL_image) {
- _mesa_error(ctx, GL_INVALID_OPERATION,
- "glEGLImageTargetRenderbufferStorageOES(unsupported)");
- return;
- }
-
- if (target != GL_RENDERBUFFER) {
- _mesa_error(ctx, GL_INVALID_ENUM,
- "EGLImageTargetRenderbufferStorageOES");
- return;
- }
-
- rb = ctx->CurrentRenderbuffer;
- if (!rb) {
- _mesa_error(ctx, GL_INVALID_OPERATION,
- "EGLImageTargetRenderbufferStorageOES");
- return;
- }
-
- FLUSH_VERTICES(ctx, _NEW_BUFFERS);
-
- ctx->Driver.EGLImageTargetRenderbufferStorage(ctx, rb, image);
-}
-#endif
-
-
-/**
- * Helper function for _mesa_GetRenderbufferParameterivEXT() and
- * _mesa_GetFramebufferAttachmentParameterivEXT()
- * We have to be careful to respect the base format. For example, if a
- * renderbuffer/texture was created with internalFormat=GL_RGB but the
- * driver actually chose a GL_RGBA format, when the user queries ALPHA_SIZE
- * we need to return zero.
- */
-static GLint
-get_component_bits(GLenum pname, GLenum baseFormat, gl_format format)
-{
- switch (pname) {
- case GL_RENDERBUFFER_RED_SIZE_EXT:
- case GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE:
- if (baseFormat == GL_RGB || baseFormat == GL_RGBA ||
- baseFormat == GL_RG || baseFormat == GL_RED)
- return _mesa_get_format_bits(format, pname);
- else
- return 0;
- case GL_RENDERBUFFER_GREEN_SIZE_EXT:
- case GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE:
- if (baseFormat == GL_RGB || baseFormat == GL_RGBA || baseFormat == GL_RG)
- return _mesa_get_format_bits(format, pname);
- else
- return 0;
- case GL_RENDERBUFFER_BLUE_SIZE_EXT:
- case GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE:
- if (baseFormat == GL_RGB || baseFormat == GL_RGBA)
- return _mesa_get_format_bits(format, pname);
- else
- return 0;
- case GL_RENDERBUFFER_ALPHA_SIZE_EXT:
- case GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE:
- if (baseFormat == GL_RGBA || baseFormat == GL_ALPHA ||
- baseFormat == GL_LUMINANCE_ALPHA)
- return _mesa_get_format_bits(format, pname);
- else
- return 0;
- case GL_RENDERBUFFER_DEPTH_SIZE_EXT:
- case GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE:
- if (baseFormat == GL_DEPTH_COMPONENT || baseFormat == GL_DEPTH_STENCIL)
- return _mesa_get_format_bits(format, pname);
- else
- return 0;
- case GL_RENDERBUFFER_STENCIL_SIZE_EXT:
- case GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE:
- if (baseFormat == GL_STENCIL_INDEX || baseFormat == GL_DEPTH_STENCIL)
- return _mesa_get_format_bits(format, pname);
- else
- return 0;
- default:
- return 0;
- }
-}
-
-
-
-void GLAPIENTRY
-_mesa_RenderbufferStorageEXT(GLenum target, GLenum internalFormat,
- GLsizei width, GLsizei height)
-{
- /* GL_ARB_fbo says calling this function is equivalent to calling
- * glRenderbufferStorageMultisample() with samples=0. We pass in
- * a token value here just for error reporting purposes.
- */
- renderbuffer_storage(target, internalFormat, width, height, NO_SAMPLES);
-}
-
-
-void GLAPIENTRY
-_mesa_RenderbufferStorageMultisample(GLenum target, GLsizei samples,
- GLenum internalFormat,
- GLsizei width, GLsizei height)
-{
- renderbuffer_storage(target, internalFormat, width, height, samples);
-}
-
-
-/**
- * OpenGL ES version of glRenderBufferStorage.
- */
-void GLAPIENTRY
-_es_RenderbufferStorageEXT(GLenum target, GLenum internalFormat,
- GLsizei width, GLsizei height)
-{
- switch (internalFormat) {
- case GL_RGB565:
- /* XXX this confuses GL_RENDERBUFFER_INTERNAL_FORMAT_OES */
- /* choose a closest format */
- internalFormat = GL_RGB5;
- break;
- default:
- break;
- }
-
- renderbuffer_storage(target, internalFormat, width, height, 0);
-}
-
-
-void GLAPIENTRY
-_mesa_GetRenderbufferParameterivEXT(GLenum target, GLenum pname, GLint *params)
-{
- struct gl_renderbuffer *rb;
- GET_CURRENT_CONTEXT(ctx);
-
- ASSERT_OUTSIDE_BEGIN_END(ctx);
-
- if (target != GL_RENDERBUFFER_EXT) {
- _mesa_error(ctx, GL_INVALID_ENUM,
- "glGetRenderbufferParameterivEXT(target)");
- return;
- }
-
- rb = ctx->CurrentRenderbuffer;
- if (!rb) {
- _mesa_error(ctx, GL_INVALID_OPERATION,
- "glGetRenderbufferParameterivEXT");
- return;
- }
-
- /* No need to flush here since we're just quering state which is
- * not effected by rendering.
- */
-
- switch (pname) {
- case GL_RENDERBUFFER_WIDTH_EXT:
- *params = rb->Width;
- return;
- case GL_RENDERBUFFER_HEIGHT_EXT:
- *params = rb->Height;
- return;
- case GL_RENDERBUFFER_INTERNAL_FORMAT_EXT:
- *params = rb->InternalFormat;
- return;
- case GL_RENDERBUFFER_RED_SIZE_EXT:
- case GL_RENDERBUFFER_GREEN_SIZE_EXT:
- case GL_RENDERBUFFER_BLUE_SIZE_EXT:
- case GL_RENDERBUFFER_ALPHA_SIZE_EXT:
- case GL_RENDERBUFFER_DEPTH_SIZE_EXT:
- case GL_RENDERBUFFER_STENCIL_SIZE_EXT:
- *params = get_component_bits(pname, rb->_BaseFormat, rb->Format);
- break;
- case GL_RENDERBUFFER_SAMPLES:
- if (ctx->Extensions.ARB_framebuffer_object) {
- *params = rb->NumSamples;
- break;
- }
- /* fallthrough */
- default:
- _mesa_error(ctx, GL_INVALID_ENUM,
- "glGetRenderbufferParameterivEXT(target)");
- return;
- }
-}
-
-
-GLboolean GLAPIENTRY
-_mesa_IsFramebufferEXT(GLuint framebuffer)
-{
- GET_CURRENT_CONTEXT(ctx);
- ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, GL_FALSE);
- if (framebuffer) {
- struct gl_framebuffer *rb = _mesa_lookup_framebuffer(ctx, framebuffer);
- if (rb != NULL && rb != &DummyFramebuffer)
- return GL_TRUE;
- }
- return GL_FALSE;
-}
-
-
-/**
- * Check if any of the attachments of the given framebuffer are textures
- * (render to texture). Call ctx->Driver.RenderTexture() for such
- * attachments.
- */
-static void
-check_begin_texture_render(struct gl_context *ctx, struct gl_framebuffer *fb)
-{
- GLuint i;
- ASSERT(ctx->Driver.RenderTexture);
-
- if (fb->Name == 0)
- return; /* can't render to texture with winsys framebuffers */
-
- for (i = 0; i < BUFFER_COUNT; i++) {
- struct gl_renderbuffer_attachment *att = fb->Attachment + i;
- if (att->Texture && _mesa_get_attachment_teximage(att)) {
- ctx->Driver.RenderTexture(ctx, fb, att);
- }
- }
-}
-
-
-/**
- * Examine all the framebuffer's attachments to see if any are textures.
- * If so, call ctx->Driver.FinishRenderTexture() for each texture to
- * notify the device driver that the texture image may have changed.
- */
-static void
-check_end_texture_render(struct gl_context *ctx, struct gl_framebuffer *fb)
-{
- if (fb->Name == 0)
- return; /* can't render to texture with winsys framebuffers */
-
- if (ctx->Driver.FinishRenderTexture) {
- GLuint i;
- for (i = 0; i < BUFFER_COUNT; i++) {
- struct gl_renderbuffer_attachment *att = fb->Attachment + i;
- if (att->Texture && att->Renderbuffer) {
- ctx->Driver.FinishRenderTexture(ctx, att);
- }
- }
- }
-}
-
-
-void GLAPIENTRY
-_mesa_BindFramebufferEXT(GLenum target, GLuint framebuffer)
-{
- struct gl_framebuffer *newDrawFb, *newReadFb;
- struct gl_framebuffer *oldDrawFb, *oldReadFb;
- GLboolean bindReadBuf, bindDrawBuf;
- GET_CURRENT_CONTEXT(ctx);
-
-#ifdef DEBUG
- if (ctx->Extensions.ARB_framebuffer_object) {
- ASSERT(ctx->Extensions.EXT_framebuffer_object);
- ASSERT(ctx->Extensions.EXT_framebuffer_blit);
- }
-#endif
-
- ASSERT_OUTSIDE_BEGIN_END(ctx);
-
- if (!ctx->Extensions.EXT_framebuffer_object) {
- _mesa_error(ctx, GL_INVALID_OPERATION,
- "glBindFramebufferEXT(unsupported)");
- return;
- }
-
- switch (target) {
-#if FEATURE_EXT_framebuffer_blit
- case GL_DRAW_FRAMEBUFFER_EXT:
- if (!ctx->Extensions.EXT_framebuffer_blit) {
- _mesa_error(ctx, GL_INVALID_ENUM, "glBindFramebufferEXT(target)");
- return;
- }
- bindDrawBuf = GL_TRUE;
- bindReadBuf = GL_FALSE;
- break;
- case GL_READ_FRAMEBUFFER_EXT:
- if (!ctx->Extensions.EXT_framebuffer_blit) {
- _mesa_error(ctx, GL_INVALID_ENUM, "glBindFramebufferEXT(target)");
- return;
- }
- bindDrawBuf = GL_FALSE;
- bindReadBuf = GL_TRUE;
- break;
-#endif
- case GL_FRAMEBUFFER_EXT:
- bindDrawBuf = GL_TRUE;
- bindReadBuf = GL_TRUE;
- break;
- default:
- _mesa_error(ctx, GL_INVALID_ENUM, "glBindFramebufferEXT(target)");
- return;
- }
-
- if (framebuffer) {
- /* Binding a user-created framebuffer object */
- newDrawFb = _mesa_lookup_framebuffer(ctx, framebuffer);
- if (newDrawFb == &DummyFramebuffer) {
- /* ID was reserved, but no real framebuffer object made yet */
- newDrawFb = NULL;
- }
- else if (!newDrawFb && ctx->Extensions.ARB_framebuffer_object) {
- /* All FBO IDs must be Gen'd */
- _mesa_error(ctx, GL_INVALID_OPERATION, "glBindFramebuffer(buffer)");
- return;
- }
-
- if (!newDrawFb) {
- /* create new framebuffer object */
- newDrawFb = ctx->Driver.NewFramebuffer(ctx, framebuffer);
- if (!newDrawFb) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "glBindFramebufferEXT");
- return;
- }
- _mesa_HashInsert(ctx->Shared->FrameBuffers, framebuffer, newDrawFb);
- }
- newReadFb = newDrawFb;
- }
- else {
- /* Binding the window system framebuffer (which was originally set
- * with MakeCurrent).
- */
- newDrawFb = ctx->WinSysDrawBuffer;
- newReadFb = ctx->WinSysReadBuffer;
- }
-
- ASSERT(newDrawFb);
- ASSERT(newDrawFb != &DummyFramebuffer);
-
- /* save pointers to current/old framebuffers */
- oldDrawFb = ctx->DrawBuffer;
- oldReadFb = ctx->ReadBuffer;
-
- /* check if really changing bindings */
- if (oldDrawFb == newDrawFb)
- bindDrawBuf = GL_FALSE;
- if (oldReadFb == newReadFb)
- bindReadBuf = GL_FALSE;
-
- /*
- * OK, now bind the new Draw/Read framebuffers, if they're changing.
- *
- * We also check if we're beginning and/or ending render-to-texture.
- * When a framebuffer with texture attachments is unbound, call
- * ctx->Driver.FinishRenderTexture().
- * When a framebuffer with texture attachments is bound, call
- * ctx->Driver.RenderTexture().
- *
- * Note that if the ReadBuffer has texture attachments we don't consider
- * that a render-to-texture case.
- */
- if (bindReadBuf) {
- FLUSH_VERTICES(ctx, _NEW_BUFFERS);
-
- /* check if old readbuffer was render-to-texture */
- check_end_texture_render(ctx, oldReadFb);
-
- _mesa_reference_framebuffer(&ctx->ReadBuffer, newReadFb);
- }
-
- if (bindDrawBuf) {
- FLUSH_VERTICES(ctx, _NEW_BUFFERS);
-
- /* check if old read/draw buffers were render-to-texture */
- if (!bindReadBuf)
- check_end_texture_render(ctx, oldReadFb);
-
- if (oldDrawFb != oldReadFb)
- check_end_texture_render(ctx, oldDrawFb);
-
- /* check if newly bound framebuffer has any texture attachments */
- check_begin_texture_render(ctx, newDrawFb);
-
- _mesa_reference_framebuffer(&ctx->DrawBuffer, newDrawFb);
- }
-
- if ((bindDrawBuf || bindReadBuf) && ctx->Driver.BindFramebuffer) {
- ctx->Driver.BindFramebuffer(ctx, target, newDrawFb, newReadFb);
- }
-}
-
-
-void GLAPIENTRY
-_mesa_DeleteFramebuffersEXT(GLsizei n, const GLuint *framebuffers)
-{
- GLint i;
- GET_CURRENT_CONTEXT(ctx);
-
- ASSERT_OUTSIDE_BEGIN_END(ctx);
- FLUSH_VERTICES(ctx, _NEW_BUFFERS);
-
- for (i = 0; i < n; i++) {
- if (framebuffers[i] > 0) {
- struct gl_framebuffer *fb;
- fb = _mesa_lookup_framebuffer(ctx, framebuffers[i]);
- if (fb) {
- ASSERT(fb == &DummyFramebuffer || fb->Name == framebuffers[i]);
-
- /* check if deleting currently bound framebuffer object */
- if (ctx->Extensions.EXT_framebuffer_blit) {
- /* separate draw/read binding points */
- if (fb == ctx->DrawBuffer) {
- /* bind default */
- ASSERT(fb->RefCount >= 2);
- _mesa_BindFramebufferEXT(GL_DRAW_FRAMEBUFFER_EXT, 0);
- }
- if (fb == ctx->ReadBuffer) {
- /* bind default */
- ASSERT(fb->RefCount >= 2);
- _mesa_BindFramebufferEXT(GL_READ_FRAMEBUFFER_EXT, 0);
- }
- }
- else {
- /* only one binding point for read/draw buffers */
- if (fb == ctx->DrawBuffer || fb == ctx->ReadBuffer) {
- /* bind default */
- ASSERT(fb->RefCount >= 2);
- _mesa_BindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
- }
- }
-
- /* remove from hash table immediately, to free the ID */
- _mesa_HashRemove(ctx->Shared->FrameBuffers, framebuffers[i]);
-
- if (fb != &DummyFramebuffer) {
- /* But the object will not be freed until it's no longer
- * bound in any context.
- */
- _mesa_reference_framebuffer(&fb, NULL);
- }
- }
- }
- }
-}
-
-
-void GLAPIENTRY
-_mesa_GenFramebuffersEXT(GLsizei n, GLuint *framebuffers)
-{
- GET_CURRENT_CONTEXT(ctx);
- GLuint first;
- GLint i;
-
- ASSERT_OUTSIDE_BEGIN_END(ctx);
-
- if (n < 0) {
- _mesa_error(ctx, GL_INVALID_VALUE, "glGenFramebuffersEXT(n)");
- return;
- }
-
- if (!framebuffers)
- return;
-
- first = _mesa_HashFindFreeKeyBlock(ctx->Shared->FrameBuffers, n);
-
- for (i = 0; i < n; i++) {
- GLuint name = first + i;
- framebuffers[i] = name;
- /* insert dummy placeholder into hash table */
- _glthread_LOCK_MUTEX(ctx->Shared->Mutex);
- _mesa_HashInsert(ctx->Shared->FrameBuffers, name, &DummyFramebuffer);
- _glthread_UNLOCK_MUTEX(ctx->Shared->Mutex);
- }
-}
-
-
-
-GLenum GLAPIENTRY
-_mesa_CheckFramebufferStatusEXT(GLenum target)
-{
- struct gl_framebuffer *buffer;
- GET_CURRENT_CONTEXT(ctx);
-
- ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, 0);
-
- buffer = get_framebuffer_target(ctx, target);
- if (!buffer) {
- _mesa_error(ctx, GL_INVALID_ENUM, "glCheckFramebufferStatus(target)");
- return 0;
- }
-
- if (buffer->Name == 0) {
- /* The window system / default framebuffer is always complete */
- return GL_FRAMEBUFFER_COMPLETE_EXT;
- }
-
- /* No need to flush here */
-
- if (buffer->_Status != GL_FRAMEBUFFER_COMPLETE) {
- _mesa_test_framebuffer_completeness(ctx, buffer);
- }
-
- return buffer->_Status;
-}
-
-
-
-/**
- * Common code called by glFramebufferTexture1D/2D/3DEXT().
- */
-static void
-framebuffer_texture(struct gl_context *ctx, const char *caller, GLenum target,
- GLenum attachment, GLenum textarget, GLuint texture,
- GLint level, GLint zoffset)
-{
- struct gl_renderbuffer_attachment *att;
- struct gl_texture_object *texObj = NULL;
- struct gl_framebuffer *fb;
-
- ASSERT_OUTSIDE_BEGIN_END(ctx);
-
- fb = get_framebuffer_target(ctx, target);
- if (!fb) {
- _mesa_error(ctx, GL_INVALID_ENUM,
- "glFramebufferTexture%sEXT(target=0x%x)", caller, target);
- return;
- }
-
- /* check framebuffer binding */
- if (fb->Name == 0) {
- _mesa_error(ctx, GL_INVALID_OPERATION,
- "glFramebufferTexture%sEXT", caller);
- return;
- }
-
-
- /* The textarget, level, and zoffset parameters are only validated if
- * texture is non-zero.
- */
- if (texture) {
- GLboolean err = GL_TRUE;
-
- texObj = _mesa_lookup_texture(ctx, texture);
- if (texObj != NULL) {
- if (textarget == 0) {
- /* XXX what's the purpose of this? */
- err = (texObj->Target != GL_TEXTURE_3D) &&
- (texObj->Target != GL_TEXTURE_1D_ARRAY_EXT) &&
- (texObj->Target != GL_TEXTURE_2D_ARRAY_EXT);
- }
- else {
- err = (texObj->Target == GL_TEXTURE_CUBE_MAP)
- ? !IS_CUBE_FACE(textarget)
- : (texObj->Target != textarget);
- }
- }
- else {
- /* can't render to a non-existant texture */
- _mesa_error(ctx, GL_INVALID_OPERATION,
- "glFramebufferTexture%sEXT(non existant texture)",
- caller);
- return;
- }
-
- if (err) {
- _mesa_error(ctx, GL_INVALID_OPERATION,
- "glFramebufferTexture%sEXT(texture target mismatch)",
- caller);
- return;
- }
-
- if (texObj->Target == GL_TEXTURE_3D) {
- const GLint maxSize = 1 << (ctx->Const.Max3DTextureLevels - 1);
- if (zoffset < 0 || zoffset >= maxSize) {
- _mesa_error(ctx, GL_INVALID_VALUE,
- "glFramebufferTexture%sEXT(zoffset)", caller);
- return;
- }
- }
- else if ((texObj->Target == GL_TEXTURE_1D_ARRAY_EXT) ||
- (texObj->Target == GL_TEXTURE_2D_ARRAY_EXT)) {
- if (zoffset < 0 || zoffset >= ctx->Const.MaxArrayTextureLayers) {
- _mesa_error(ctx, GL_INVALID_VALUE,
- "glFramebufferTexture%sEXT(layer)", caller);
- return;
- }
- }
-
- if ((level < 0) ||
- (level >= _mesa_max_texture_levels(ctx, texObj->Target))) {
- _mesa_error(ctx, GL_INVALID_VALUE,
- "glFramebufferTexture%sEXT(level)", caller);
- return;
- }
- }
-
- att = _mesa_get_attachment(ctx, fb, attachment);
- if (att == NULL) {
- _mesa_error(ctx, GL_INVALID_ENUM,
- "glFramebufferTexture%sEXT(attachment)", caller);
- return;
- }
-
- FLUSH_VERTICES(ctx, _NEW_BUFFERS);
-
- _glthread_LOCK_MUTEX(fb->Mutex);
- if (texObj) {
- _mesa_set_texture_attachment(ctx, fb, att, texObj, textarget,
- level, zoffset);
- /* Set the render-to-texture flag. We'll check this flag in
- * glTexImage() and friends to determine if we need to revalidate
- * any FBOs that might be rendering into this texture.
- * This flag never gets cleared since it's non-trivial to determine
- * when all FBOs might be done rendering to this texture. That's OK
- * though since it's uncommon to render to a texture then repeatedly
- * call glTexImage() to change images in the texture.
- */
- texObj->_RenderToTexture = GL_TRUE;
- }
- else {
- _mesa_remove_attachment(ctx, att);
- }
-
- invalidate_framebuffer(fb);
-
- _glthread_UNLOCK_MUTEX(fb->Mutex);
-}
-
-
-
-void GLAPIENTRY
-_mesa_FramebufferTexture1DEXT(GLenum target, GLenum attachment,
- GLenum textarget, GLuint texture, GLint level)
-{
- GET_CURRENT_CONTEXT(ctx);
-
- if ((texture != 0) && (textarget != GL_TEXTURE_1D)) {
- _mesa_error(ctx, GL_INVALID_ENUM,
- "glFramebufferTexture1DEXT(textarget)");
- return;
- }
-
- framebuffer_texture(ctx, "1D", target, attachment, textarget, texture,
- level, 0);
-}
-
-
-void GLAPIENTRY
-_mesa_FramebufferTexture2DEXT(GLenum target, GLenum attachment,
- GLenum textarget, GLuint texture, GLint level)
-{
- GET_CURRENT_CONTEXT(ctx);
-
- if ((texture != 0) &&
- (textarget != GL_TEXTURE_2D) &&
- (textarget != GL_TEXTURE_RECTANGLE_ARB) &&
- (!IS_CUBE_FACE(textarget))) {
- _mesa_error(ctx, GL_INVALID_OPERATION,
- "glFramebufferTexture2DEXT(textarget=0x%x)", textarget);
- return;
- }
-
- framebuffer_texture(ctx, "2D", target, attachment, textarget, texture,
- level, 0);
-}
-
-
-void GLAPIENTRY
-_mesa_FramebufferTexture3DEXT(GLenum target, GLenum attachment,
- GLenum textarget, GLuint texture,
- GLint level, GLint zoffset)
-{
- GET_CURRENT_CONTEXT(ctx);
-
- if ((texture != 0) && (textarget != GL_TEXTURE_3D)) {
- _mesa_error(ctx, GL_INVALID_ENUM,
- "glFramebufferTexture3DEXT(textarget)");
- return;
- }
-
- framebuffer_texture(ctx, "3D", target, attachment, textarget, texture,
- level, zoffset);
-}
-
-
-void GLAPIENTRY
-_mesa_FramebufferTextureLayerEXT(GLenum target, GLenum attachment,
- GLuint texture, GLint level, GLint layer)
-{
- GET_CURRENT_CONTEXT(ctx);
-
- framebuffer_texture(ctx, "Layer", target, attachment, 0, texture,
- level, layer);
-}
-
-
-void GLAPIENTRY
-_mesa_FramebufferRenderbufferEXT(GLenum target, GLenum attachment,
- GLenum renderbufferTarget,
- GLuint renderbuffer)
-{
- struct gl_renderbuffer_attachment *att;
- struct gl_framebuffer *fb;
- struct gl_renderbuffer *rb;
- GET_CURRENT_CONTEXT(ctx);
-
- ASSERT_OUTSIDE_BEGIN_END(ctx);
-
- fb = get_framebuffer_target(ctx, target);
- if (!fb) {
- _mesa_error(ctx, GL_INVALID_ENUM, "glFramebufferRenderbufferEXT(target)");
- return;
- }
-
- if (renderbufferTarget != GL_RENDERBUFFER_EXT) {
- _mesa_error(ctx, GL_INVALID_ENUM,
- "glFramebufferRenderbufferEXT(renderbufferTarget)");
- return;
- }
-
- if (fb->Name == 0) {
- /* Can't attach new renderbuffers to a window system framebuffer */
- _mesa_error(ctx, GL_INVALID_OPERATION, "glFramebufferRenderbufferEXT");
- return;
- }
-
- att = _mesa_get_attachment(ctx, fb, attachment);
- if (att == NULL) {
- _mesa_error(ctx, GL_INVALID_ENUM,
- "glFramebufferRenderbufferEXT(invalid attachment %s)",
- _mesa_lookup_enum_by_nr(attachment));
- return;
- }
-
- if (renderbuffer) {
- rb = _mesa_lookup_renderbuffer(ctx, renderbuffer);
- if (!rb) {
- _mesa_error(ctx, GL_INVALID_OPERATION,
- "glFramebufferRenderbufferEXT(non-existant"
- " renderbuffer %u)", renderbuffer);
- return;
- }
- else if (rb == &DummyRenderbuffer) {
- /* This is what NVIDIA does */
- _mesa_error(ctx, GL_INVALID_VALUE,
- "glFramebufferRenderbufferEXT(renderbuffer %u)",
- renderbuffer);
- return;
- }
- }
- else {
- /* remove renderbuffer attachment */
- rb = NULL;
- }
-
- if (attachment == GL_DEPTH_STENCIL_ATTACHMENT &&
- rb && rb->Format != MESA_FORMAT_NONE) {
- /* make sure the renderbuffer is a depth/stencil format */
- const GLenum baseFormat = _mesa_get_format_base_format(rb->Format);
- if (baseFormat != GL_DEPTH_STENCIL) {
- _mesa_error(ctx, GL_INVALID_OPERATION,
- "glFramebufferRenderbufferEXT(renderbuffer"
- " is not DEPTH_STENCIL format)");
- return;
- }
- }
-
-
- FLUSH_VERTICES(ctx, _NEW_BUFFERS);
-
- assert(ctx->Driver.FramebufferRenderbuffer);
- ctx->Driver.FramebufferRenderbuffer(ctx, fb, attachment, rb);
-
- /* Some subsequent GL commands may depend on the framebuffer's visual
- * after the binding is updated. Update visual info now.
- */
- _mesa_update_framebuffer_visual(ctx, fb);
-}
-
-
-void GLAPIENTRY
-_mesa_GetFramebufferAttachmentParameterivEXT(GLenum target, GLenum attachment,
- GLenum pname, GLint *params)
-{
- const struct gl_renderbuffer_attachment *att;
- struct gl_framebuffer *buffer;
- GET_CURRENT_CONTEXT(ctx);
-
- ASSERT_OUTSIDE_BEGIN_END(ctx);
-
- buffer = get_framebuffer_target(ctx, target);
- if (!buffer) {
- _mesa_error(ctx, GL_INVALID_ENUM,
- "glGetFramebufferAttachmentParameterivEXT(target)");
- return;
- }
-
- if (buffer->Name == 0) {
- /* the default / window-system FBO */
- att = _mesa_get_fb0_attachment(ctx, buffer, attachment);
- }
- else {
- /* user-created framebuffer FBO */
- att = _mesa_get_attachment(ctx, buffer, attachment);
- }
-
- if (att == NULL) {
- _mesa_error(ctx, GL_INVALID_ENUM,
- "glGetFramebufferAttachmentParameterivEXT(attachment)");
- return;
- }
-
- if (attachment == GL_DEPTH_STENCIL_ATTACHMENT) {
- /* the depth and stencil attachments must point to the same buffer */
- const struct gl_renderbuffer_attachment *depthAtt, *stencilAtt;
- depthAtt = _mesa_get_attachment(ctx, buffer, GL_DEPTH_ATTACHMENT);
- stencilAtt = _mesa_get_attachment(ctx, buffer, GL_STENCIL_ATTACHMENT);
- if (depthAtt->Renderbuffer != stencilAtt->Renderbuffer) {
- _mesa_error(ctx, GL_INVALID_OPERATION,
- "glGetFramebufferAttachmentParameterivEXT(DEPTH/STENCIL"
- " attachments differ)");
- return;
- }
- }
-
- /* No need to flush here */
-
- switch (pname) {
- case GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT:
- *params = buffer->Name == 0 ? GL_FRAMEBUFFER_DEFAULT : att->Type;
- return;
- case GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT:
- if (att->Type == GL_RENDERBUFFER_EXT) {
- *params = att->Renderbuffer->Name;
- }
- else if (att->Type == GL_TEXTURE) {
- *params = att->Texture->Name;
- }
- else {
- assert(att->Type == GL_NONE);
- *params = 0;
- }
- return;
- case GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT:
- if (att->Type == GL_TEXTURE) {
- *params = att->TextureLevel;
- }
- else {
- _mesa_error(ctx, GL_INVALID_ENUM,
- "glGetFramebufferAttachmentParameterivEXT(pname)");
- }
- return;
- case GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_EXT:
- if (att->Type == GL_TEXTURE) {
- if (att->Texture && att->Texture->Target == GL_TEXTURE_CUBE_MAP) {
- *params = GL_TEXTURE_CUBE_MAP_POSITIVE_X + att->CubeMapFace;
- }
- else {
- *params = 0;
- }
- }
- else {
- _mesa_error(ctx, GL_INVALID_ENUM,
- "glGetFramebufferAttachmentParameterivEXT(pname)");
- }
- return;
- case GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT:
- if (att->Type == GL_TEXTURE) {
- if (att->Texture && att->Texture->Target == GL_TEXTURE_3D) {
- *params = att->Zoffset;
- }
- else {
- *params = 0;
- }
- }
- else {
- _mesa_error(ctx, GL_INVALID_ENUM,
- "glGetFramebufferAttachmentParameterivEXT(pname)");
- }
- return;
- case GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING:
- if (!ctx->Extensions.ARB_framebuffer_object) {
- _mesa_error(ctx, GL_INVALID_ENUM,
- "glGetFramebufferAttachmentParameterivEXT(pname)");
- }
- else {
- if (ctx->Extensions.EXT_framebuffer_sRGB && ctx->Const.sRGBCapable) {
- *params = _mesa_get_format_color_encoding(att->Renderbuffer->Format);
- }
- else {
- /* According to ARB_framebuffer_sRGB, we should return LINEAR
- * if the sRGB conversion is unsupported. */
- *params = GL_LINEAR;
- }
- }
- return;
- case GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE:
- if (!ctx->Extensions.ARB_framebuffer_object) {
- _mesa_error(ctx, GL_INVALID_ENUM,
- "glGetFramebufferAttachmentParameterivEXT(pname)");
- return;
- }
- else {
- gl_format format = att->Renderbuffer->Format;
- if (format == MESA_FORMAT_CI8 || format == MESA_FORMAT_S8) {
- /* special cases */
- *params = GL_INDEX;
- }
- else {
- *params = _mesa_get_format_datatype(format);
- }
- }
- return;
- case GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE:
- case GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE:
- case GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE:
- case GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE:
- case GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE:
- case GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE:
- if (!ctx->Extensions.ARB_framebuffer_object) {
- _mesa_error(ctx, GL_INVALID_ENUM,
- "glGetFramebufferAttachmentParameterivEXT(pname)");
- }
- else if (att->Texture) {
- const struct gl_texture_image *texImage =
- _mesa_select_tex_image(ctx, att->Texture, att->Texture->Target,
- att->TextureLevel);
- if (texImage) {
- *params = get_component_bits(pname, texImage->_BaseFormat,
- texImage->TexFormat);
- }
- else {
- *params = 0;
- }
- }
- else if (att->Renderbuffer) {
- *params = get_component_bits(pname, att->Renderbuffer->_BaseFormat,
- att->Renderbuffer->Format);
- }
- else {
- *params = 0;
- }
- return;
- default:
- _mesa_error(ctx, GL_INVALID_ENUM,
- "glGetFramebufferAttachmentParameterivEXT(pname)");
- return;
- }
-}
-
-
-void GLAPIENTRY
-_mesa_GenerateMipmapEXT(GLenum target)
-{
- struct gl_texture_object *texObj;
- GET_CURRENT_CONTEXT(ctx);
-
- ASSERT_OUTSIDE_BEGIN_END(ctx);
- FLUSH_VERTICES(ctx, _NEW_BUFFERS);
-
- switch (target) {
- case GL_TEXTURE_1D:
- case GL_TEXTURE_2D:
- case GL_TEXTURE_3D:
- case GL_TEXTURE_CUBE_MAP:
- /* OK, legal value */
- break;
- default:
- /* XXX need to implement GL_TEXTURE_1D_ARRAY and GL_TEXTURE_2D_ARRAY */
- _mesa_error(ctx, GL_INVALID_ENUM, "glGenerateMipmapEXT(target)");
- return;
- }
-
- texObj = _mesa_get_current_tex_object(ctx, target);
-
- if (texObj->BaseLevel >= texObj->MaxLevel) {
- /* nothing to do */
- return;
- }
-
- if (texObj->Target == GL_TEXTURE_CUBE_MAP &&
- !_mesa_cube_complete(texObj)) {
- _mesa_error(ctx, GL_INVALID_OPERATION,
- "glGenerateMipmap(incomplete cube map)");
- return;
- }
-
- _mesa_lock_texture(ctx, texObj);
- if (target == GL_TEXTURE_CUBE_MAP) {
- GLuint face;
- for (face = 0; face < 6; face++)
- ctx->Driver.GenerateMipmap(ctx,
- GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB + face,
- texObj);
- }
- else {
- ctx->Driver.GenerateMipmap(ctx, target, texObj);
- }
- _mesa_unlock_texture(ctx, texObj);
-}
-
-
-#if FEATURE_EXT_framebuffer_blit
-
-static const struct gl_renderbuffer_attachment *
-find_attachment(const struct gl_framebuffer *fb,
- const struct gl_renderbuffer *rb)
-{
- GLuint i;
- for (i = 0; i < Elements(fb->Attachment); i++) {
- if (fb->Attachment[i].Renderbuffer == rb)
- return &fb->Attachment[i];
- }
- return NULL;
-}
-
-
-
-/**
- * Blit rectangular region, optionally from one framebuffer to another.
- *
- * Note, if the src buffer is multisampled and the dest is not, this is
- * when the samples must be resolved to a single color.
- */
-void GLAPIENTRY
-_mesa_BlitFramebufferEXT(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1,
- GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1,
- GLbitfield mask, GLenum filter)
-{
- const GLbitfield legalMaskBits = (GL_COLOR_BUFFER_BIT |
- GL_DEPTH_BUFFER_BIT |
- GL_STENCIL_BUFFER_BIT);
- const struct gl_framebuffer *readFb, *drawFb;
- const struct gl_renderbuffer *colorReadRb, *colorDrawRb;
- GET_CURRENT_CONTEXT(ctx);
-
- ASSERT_OUTSIDE_BEGIN_END(ctx);
- FLUSH_VERTICES(ctx, _NEW_BUFFERS);
-
- if (MESA_VERBOSE & VERBOSE_API)
- _mesa_debug(ctx,
- "glBlitFramebuffer(%d, %d, %d, %d, %d, %d, %d, %d, 0x%x, %s)\n",
- srcX0, srcY0, srcX1, srcY1,
- dstX0, dstY0, dstX1, dstY1,
- mask, _mesa_lookup_enum_by_nr(filter));
-
- if (ctx->NewState) {
- _mesa_update_state(ctx);
- }
-
- readFb = ctx->ReadBuffer;
- drawFb = ctx->DrawBuffer;
-
- if (!readFb || !drawFb) {
- /* This will normally never happen but someday we may want to
- * support MakeCurrent() with no drawables.
- */
- return;
- }
-
- /* check for complete framebuffers */
- if (drawFb->_Status != GL_FRAMEBUFFER_COMPLETE_EXT ||
- readFb->_Status != GL_FRAMEBUFFER_COMPLETE_EXT) {
- _mesa_error(ctx, GL_INVALID_FRAMEBUFFER_OPERATION_EXT,
- "glBlitFramebufferEXT(incomplete draw/read buffers)");
- return;
- }
-
- if (filter != GL_NEAREST && filter != GL_LINEAR) {
- _mesa_error(ctx, GL_INVALID_ENUM, "glBlitFramebufferEXT(filter)");
- return;
- }
-
- if (mask & ~legalMaskBits) {
- _mesa_error( ctx, GL_INVALID_VALUE, "glBlitFramebufferEXT(mask)");
- return;
- }
-
- /* depth/stencil must be blitted with nearest filtering */
- if ((mask & (GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT))
- && filter != GL_NEAREST) {
- _mesa_error(ctx, GL_INVALID_OPERATION,
- "glBlitFramebufferEXT(depth/stencil requires GL_NEAREST filter)");
- return;
- }
-
- /* get color read/draw renderbuffers */
- if (mask & GL_COLOR_BUFFER_BIT) {
- colorReadRb = readFb->_ColorReadBuffer;
- colorDrawRb = drawFb->_ColorDrawBuffers[0];
- }
- else {
- colorReadRb = colorDrawRb = NULL;
- }
-
- if (mask & GL_STENCIL_BUFFER_BIT) {
- struct gl_renderbuffer *readRb = readFb->_StencilBuffer;
- struct gl_renderbuffer *drawRb = drawFb->_StencilBuffer;
- if (!readRb ||
- !drawRb ||
- _mesa_get_format_bits(readRb->Format, GL_STENCIL_BITS) !=
- _mesa_get_format_bits(drawRb->Format, GL_STENCIL_BITS)) {
- _mesa_error(ctx, GL_INVALID_OPERATION,
- "glBlitFramebufferEXT(stencil buffer size mismatch)");
- return;
- }
- }
-
- if (mask & GL_DEPTH_BUFFER_BIT) {
- struct gl_renderbuffer *readRb = readFb->_DepthBuffer;
- struct gl_renderbuffer *drawRb = drawFb->_DepthBuffer;
- if (!readRb ||
- !drawRb ||
- _mesa_get_format_bits(readRb->Format, GL_DEPTH_BITS) !=
- _mesa_get_format_bits(drawRb->Format, GL_DEPTH_BITS)) {
- _mesa_error(ctx, GL_INVALID_OPERATION,
- "glBlitFramebufferEXT(depth buffer size mismatch)");
- return;
- }
- }
-
- if (readFb->Visual.samples > 0 &&
- drawFb->Visual.samples > 0 &&
- readFb->Visual.samples != drawFb->Visual.samples) {
- _mesa_error(ctx, GL_INVALID_OPERATION,
- "glBlitFramebufferEXT(mismatched samples");
- return;
- }
-
- /* extra checks for multisample copies... */
- if (readFb->Visual.samples > 0 || drawFb->Visual.samples > 0) {
- /* src and dest region sizes must be the same */
- if (srcX1 - srcX0 != dstX1 - dstX0 ||
- srcY1 - srcY0 != dstY1 - dstY0) {
- _mesa_error(ctx, GL_INVALID_OPERATION,
- "glBlitFramebufferEXT(bad src/dst multisample region sizes)");
- return;
- }
-
- /* color formats must match */
- if (colorReadRb &&
- colorDrawRb &&
- colorReadRb->Format != colorDrawRb->Format) {
- _mesa_error(ctx, GL_INVALID_OPERATION,
- "glBlitFramebufferEXT(bad src/dst multisample pixel formats)");
- return;
- }
- }
-
- if (!ctx->Extensions.EXT_framebuffer_blit) {
- _mesa_error(ctx, GL_INVALID_OPERATION, "glBlitFramebufferEXT");
- return;
- }
-
- /* Debug code */
- if (DEBUG_BLIT) {
- printf("glBlitFramebuffer(%d, %d, %d, %d, %d, %d, %d, %d,"
- " 0x%x, 0x%x)\n",
- srcX0, srcY0, srcX1, srcY1,
- dstX0, dstY0, dstX1, dstY1,
- mask, filter);
- if (colorReadRb) {
- const struct gl_renderbuffer_attachment *att;
-
- att = find_attachment(readFb, colorReadRb);
- printf(" Src FBO %u RB %u (%dx%d) ",
- readFb->Name, colorReadRb->Name,
- colorReadRb->Width, colorReadRb->Height);
- if (att && att->Texture) {
- printf("Tex %u tgt 0x%x level %u face %u",
- att->Texture->Name,
- att->Texture->Target,
- att->TextureLevel,
- att->CubeMapFace);
- }
- printf("\n");
-
- att = find_attachment(drawFb, colorDrawRb);
- printf(" Dst FBO %u RB %u (%dx%d) ",
- drawFb->Name, colorDrawRb->Name,
- colorDrawRb->Width, colorDrawRb->Height);
- if (att && att->Texture) {
- printf("Tex %u tgt 0x%x level %u face %u",
- att->Texture->Name,
- att->Texture->Target,
- att->TextureLevel,
- att->CubeMapFace);
- }
- printf("\n");
- }
- }
-
- ASSERT(ctx->Driver.BlitFramebuffer);
- ctx->Driver.BlitFramebuffer(ctx,
- srcX0, srcY0, srcX1, srcY1,
- dstX0, dstY0, dstX1, dstY1,
- mask, filter);
-}
-#endif /* FEATURE_EXT_framebuffer_blit */
-
-#if FEATURE_ARB_geometry_shader4
-void GLAPIENTRY
-_mesa_FramebufferTextureARB(GLenum target, GLenum attachment,
- GLuint texture, GLint level)
-{
- GET_CURRENT_CONTEXT(ctx);
- _mesa_error(ctx, GL_INVALID_OPERATION,
- "glFramebufferTextureARB "
- "not implemented!");
-}
-
-void GLAPIENTRY
-_mesa_FramebufferTextureFaceARB(GLenum target, GLenum attachment,
- GLuint texture, GLint level, GLenum face)
-{
- GET_CURRENT_CONTEXT(ctx);
- _mesa_error(ctx, GL_INVALID_OPERATION,
- "glFramebufferTextureFaceARB "
- "not implemented!");
-}
-#endif /* FEATURE_ARB_geometry_shader4 */
+/*
+ * Mesa 3-D graphics library
+ * Version: 7.1
+ *
+ * Copyright (C) 1999-2008 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2009 VMware, Inc. All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+
+/*
+ * GL_EXT/ARB_framebuffer_object extensions
+ *
+ * Authors:
+ * Brian Paul
+ */
+
+
+#include "buffers.h"
+#include "context.h"
+#include "enums.h"
+#include "fbobject.h"
+#include "formats.h"
+#include "framebuffer.h"
+#include "hash.h"
+#include "macros.h"
+#include "mfeatures.h"
+#include "mtypes.h"
+#include "renderbuffer.h"
+#include "state.h"
+#include "teximage.h"
+#include "texobj.h"
+
+
+/** Set this to 1 to help debug FBO incompleteness problems */
+#define DEBUG_FBO 0
+
+/** Set this to 1 to debug/log glBlitFramebuffer() calls */
+#define DEBUG_BLIT 0
+
+
+/**
+ * Notes:
+ *
+ * None of the GL_EXT_framebuffer_object functions are compiled into
+ * display lists.
+ */
+
+
+
+/*
+ * When glGenRender/FramebuffersEXT() is called we insert pointers to
+ * these placeholder objects into the hash table.
+ * Later, when the object ID is first bound, we replace the placeholder
+ * with the real frame/renderbuffer.
+ */
+static struct gl_framebuffer DummyFramebuffer;
+static struct gl_renderbuffer DummyRenderbuffer;
+
+/* We bind this framebuffer when applications pass a NULL
+ * drawable/surface in make current. */
+static struct gl_framebuffer IncompleteFramebuffer;
+
+
+#define IS_CUBE_FACE(TARGET) \
+ ((TARGET) >= GL_TEXTURE_CUBE_MAP_POSITIVE_X && \
+ (TARGET) <= GL_TEXTURE_CUBE_MAP_NEGATIVE_Z)
+
+
+static void
+delete_dummy_renderbuffer(struct gl_renderbuffer *rb)
+{
+ /* no op */
+}
+
+static void
+delete_dummy_framebuffer(struct gl_framebuffer *fb)
+{
+ /* no op */
+}
+
+
+void
+_mesa_init_fbobjects(struct gl_context *ctx)
+{
+ _glthread_INIT_MUTEX(DummyFramebuffer.Mutex);
+ _glthread_INIT_MUTEX(DummyRenderbuffer.Mutex);
+ _glthread_INIT_MUTEX(IncompleteFramebuffer.Mutex);
+ DummyFramebuffer.Delete = delete_dummy_framebuffer;
+ DummyRenderbuffer.Delete = delete_dummy_renderbuffer;
+ IncompleteFramebuffer.Delete = delete_dummy_framebuffer;
+}
+
+struct gl_framebuffer *
+_mesa_get_incomplete_framebuffer(void)
+{
+ return &IncompleteFramebuffer;
+}
+
+/**
+ * Helper routine for getting a gl_renderbuffer.
+ */
+struct gl_renderbuffer *
+_mesa_lookup_renderbuffer(struct gl_context *ctx, GLuint id)
+{
+ struct gl_renderbuffer *rb;
+
+ if (id == 0)
+ return NULL;
+
+ rb = (struct gl_renderbuffer *)
+ _mesa_HashLookup(ctx->Shared->RenderBuffers, id);
+ return rb;
+}
+
+
+/**
+ * Helper routine for getting a gl_framebuffer.
+ */
+struct gl_framebuffer *
+_mesa_lookup_framebuffer(struct gl_context *ctx, GLuint id)
+{
+ struct gl_framebuffer *fb;
+
+ if (id == 0)
+ return NULL;
+
+ fb = (struct gl_framebuffer *)
+ _mesa_HashLookup(ctx->Shared->FrameBuffers, id);
+ return fb;
+}
+
+
+/**
+ * Mark the given framebuffer as invalid. This will force the
+ * test for framebuffer completeness to be done before the framebuffer
+ * is used.
+ */
+static void
+invalidate_framebuffer(struct gl_framebuffer *fb)
+{
+ fb->_Status = 0; /* "indeterminate" */
+}
+
+
+/**
+ * Return the gl_framebuffer object which corresponds to the given
+ * framebuffer target, such as GL_DRAW_FRAMEBUFFER.
+ * Check support for GL_EXT_framebuffer_blit to determine if certain
+ * targets are legal.
+ * \return gl_framebuffer pointer or NULL if target is illegal
+ */
+static struct gl_framebuffer *
+get_framebuffer_target(struct gl_context *ctx, GLenum target)
+{
+ switch (target) {
+ case GL_DRAW_FRAMEBUFFER:
+ return ctx->Extensions.EXT_framebuffer_blit ? ctx->DrawBuffer : NULL;
+ case GL_READ_FRAMEBUFFER:
+ return ctx->Extensions.EXT_framebuffer_blit ? ctx->ReadBuffer : NULL;
+ case GL_FRAMEBUFFER_EXT:
+ return ctx->DrawBuffer;
+ default:
+ return NULL;
+ }
+}
+
+
+/**
+ * Given a GL_*_ATTACHMENTn token, return a pointer to the corresponding
+ * gl_renderbuffer_attachment object.
+ * This function is only used for user-created FB objects, not the
+ * default / window-system FB object.
+ * If \p attachment is GL_DEPTH_STENCIL_ATTACHMENT, return a pointer to
+ * the depth buffer attachment point.
+ */
+struct gl_renderbuffer_attachment *
+_mesa_get_attachment(struct gl_context *ctx, struct gl_framebuffer *fb,
+ GLenum attachment)
+{
+ GLuint i;
+
+ assert(fb->Name > 0);
+
+ switch (attachment) {
+ case GL_COLOR_ATTACHMENT0_EXT:
+ case GL_COLOR_ATTACHMENT1_EXT:
+ case GL_COLOR_ATTACHMENT2_EXT:
+ case GL_COLOR_ATTACHMENT3_EXT:
+ case GL_COLOR_ATTACHMENT4_EXT:
+ case GL_COLOR_ATTACHMENT5_EXT:
+ case GL_COLOR_ATTACHMENT6_EXT:
+ case GL_COLOR_ATTACHMENT7_EXT:
+ case GL_COLOR_ATTACHMENT8_EXT:
+ case GL_COLOR_ATTACHMENT9_EXT:
+ case GL_COLOR_ATTACHMENT10_EXT:
+ case GL_COLOR_ATTACHMENT11_EXT:
+ case GL_COLOR_ATTACHMENT12_EXT:
+ case GL_COLOR_ATTACHMENT13_EXT:
+ case GL_COLOR_ATTACHMENT14_EXT:
+ case GL_COLOR_ATTACHMENT15_EXT:
+ i = attachment - GL_COLOR_ATTACHMENT0_EXT;
+ if (i >= ctx->Const.MaxColorAttachments) {
+ return NULL;
+ }
+ return &fb->Attachment[BUFFER_COLOR0 + i];
+ case GL_DEPTH_STENCIL_ATTACHMENT:
+ /* fall-through */
+ case GL_DEPTH_BUFFER:
+ /* fall-through / new in GL 3.0 */
+ case GL_DEPTH_ATTACHMENT_EXT:
+ return &fb->Attachment[BUFFER_DEPTH];
+ case GL_STENCIL_BUFFER:
+ /* fall-through / new in GL 3.0 */
+ case GL_STENCIL_ATTACHMENT_EXT:
+ return &fb->Attachment[BUFFER_STENCIL];
+ default:
+ return NULL;
+ }
+}
+
+
+/**
+ * As above, but only used for getting attachments of the default /
+ * window-system framebuffer (not user-created framebuffer objects).
+ */
+static struct gl_renderbuffer_attachment *
+_mesa_get_fb0_attachment(struct gl_context *ctx, struct gl_framebuffer *fb,
+ GLenum attachment)
+{
+ assert(fb->Name == 0);
+
+ switch (attachment) {
+ case GL_FRONT_LEFT:
+ return &fb->Attachment[BUFFER_FRONT_LEFT];
+ case GL_FRONT_RIGHT:
+ return &fb->Attachment[BUFFER_FRONT_RIGHT];
+ case GL_BACK_LEFT:
+ return &fb->Attachment[BUFFER_BACK_LEFT];
+ case GL_BACK_RIGHT:
+ return &fb->Attachment[BUFFER_BACK_RIGHT];
+ case GL_AUX0:
+ if (fb->Visual.numAuxBuffers == 1) {
+ return &fb->Attachment[BUFFER_AUX0];
+ }
+ return NULL;
+ case GL_DEPTH_BUFFER:
+ /* fall-through / new in GL 3.0 */
+ case GL_DEPTH_ATTACHMENT_EXT:
+ return &fb->Attachment[BUFFER_DEPTH];
+ case GL_STENCIL_BUFFER:
+ /* fall-through / new in GL 3.0 */
+ case GL_STENCIL_ATTACHMENT_EXT:
+ return &fb->Attachment[BUFFER_STENCIL];
+ default:
+ return NULL;
+ }
+}
+
+
+
+/**
+ * Remove any texture or renderbuffer attached to the given attachment
+ * point. Update reference counts, etc.
+ */
+void
+_mesa_remove_attachment(struct gl_context *ctx,
+ struct gl_renderbuffer_attachment *att)
+{
+ if (att->Type == GL_TEXTURE) {
+ ASSERT(att->Texture);
+ if (ctx->Driver.FinishRenderTexture) {
+ /* tell driver that we're done rendering to this texture. */
+ ctx->Driver.FinishRenderTexture(ctx, att);
+ }
+ _mesa_reference_texobj(&att->Texture, NULL); /* unbind */
+ ASSERT(!att->Texture);
+ }
+ if (att->Type == GL_TEXTURE || att->Type == GL_RENDERBUFFER_EXT) {
+ ASSERT(!att->Texture);
+ _mesa_reference_renderbuffer(&att->Renderbuffer, NULL); /* unbind */
+ ASSERT(!att->Renderbuffer);
+ }
+ att->Type = GL_NONE;
+ att->Complete = GL_TRUE;
+}
+
+
+/**
+ * Bind a texture object to an attachment point.
+ * The previous binding, if any, will be removed first.
+ */
+void
+_mesa_set_texture_attachment(struct gl_context *ctx,
+ struct gl_framebuffer *fb,
+ struct gl_renderbuffer_attachment *att,
+ struct gl_texture_object *texObj,
+ GLenum texTarget, GLuint level, GLuint zoffset)
+{
+ if (att->Texture == texObj) {
+ /* re-attaching same texture */
+ ASSERT(att->Type == GL_TEXTURE);
+ if (ctx->Driver.FinishRenderTexture)
+ ctx->Driver.FinishRenderTexture(ctx, att);
+ }
+ else {
+ /* new attachment */
+ if (ctx->Driver.FinishRenderTexture && att->Texture)
+ ctx->Driver.FinishRenderTexture(ctx, att);
+ _mesa_remove_attachment(ctx, att);
+ att->Type = GL_TEXTURE;
+ assert(!att->Texture);
+ _mesa_reference_texobj(&att->Texture, texObj);
+ }
+
+ /* always update these fields */
+ att->TextureLevel = level;
+ att->CubeMapFace = _mesa_tex_target_to_face(texTarget);
+ att->Zoffset = zoffset;
+ att->Complete = GL_FALSE;
+
+ if (_mesa_get_attachment_teximage(att)) {
+ ctx->Driver.RenderTexture(ctx, fb, att);
+ }
+
+ invalidate_framebuffer(fb);
+}
+
+
+/**
+ * Bind a renderbuffer to an attachment point.
+ * The previous binding, if any, will be removed first.
+ */
+void
+_mesa_set_renderbuffer_attachment(struct gl_context *ctx,
+ struct gl_renderbuffer_attachment *att,
+ struct gl_renderbuffer *rb)
+{
+ /* XXX check if re-doing same attachment, exit early */
+ _mesa_remove_attachment(ctx, att);
+ att->Type = GL_RENDERBUFFER_EXT;
+ att->Texture = NULL; /* just to be safe */
+ att->Complete = GL_FALSE;
+ _mesa_reference_renderbuffer(&att->Renderbuffer, rb);
+}
+
+
+/**
+ * Fallback for ctx->Driver.FramebufferRenderbuffer()
+ * Attach a renderbuffer object to a framebuffer object.
+ */
+void
+_mesa_framebuffer_renderbuffer(struct gl_context *ctx,
+ struct gl_framebuffer *fb,
+ GLenum attachment, struct gl_renderbuffer *rb)
+{
+ struct gl_renderbuffer_attachment *att;
+
+ _glthread_LOCK_MUTEX(fb->Mutex);
+
+ att = _mesa_get_attachment(ctx, fb, attachment);
+ ASSERT(att);
+ if (rb) {
+ _mesa_set_renderbuffer_attachment(ctx, att, rb);
+ if (attachment == GL_DEPTH_STENCIL_ATTACHMENT) {
+ /* do stencil attachment here (depth already done above) */
+ att = _mesa_get_attachment(ctx, fb, GL_STENCIL_ATTACHMENT_EXT);
+ assert(att);
+ _mesa_set_renderbuffer_attachment(ctx, att, rb);
+ }
+ rb->AttachedAnytime = GL_TRUE;
+ }
+ else {
+ _mesa_remove_attachment(ctx, att);
+ }
+
+ invalidate_framebuffer(fb);
+
+ _glthread_UNLOCK_MUTEX(fb->Mutex);
+}
+
+
+/**
+ * Fallback for ctx->Driver.ValidateFramebuffer()
+ * Check if the renderbuffer's formats are supported by the software
+ * renderer.
+ * Drivers should probably override this.
+ */
+void
+_mesa_validate_framebuffer(struct gl_context *ctx, struct gl_framebuffer *fb)
+{
+ gl_buffer_index buf;
+ for (buf = 0; buf < BUFFER_COUNT; buf++) {
+ const struct gl_renderbuffer *rb = fb->Attachment[buf].Renderbuffer;
+ if (rb) {
+ switch (rb->_BaseFormat) {
+ case GL_ALPHA:
+ case GL_LUMINANCE_ALPHA:
+ case GL_LUMINANCE:
+ case GL_INTENSITY:
+ case GL_RED:
+ case GL_RG:
+ fb->_Status = GL_FRAMEBUFFER_UNSUPPORTED;
+ return;
+
+ default:
+ switch (rb->Format) {
+ /* XXX This list is likely incomplete. */
+ case MESA_FORMAT_RGB9_E5_FLOAT:
+ fb->_Status = GL_FRAMEBUFFER_UNSUPPORTED;
+ return;
+ default:;
+ /* render buffer format is supported by software rendering */
+ }
+ }
+ }
+ }
+}
+
+
+/**
+ * For debug only.
+ */
+static void
+att_incomplete(const char *msg)
+{
+#if DEBUG_FBO
+ _mesa_debug(NULL, "attachment incomplete: %s\n", msg);
+#else
+ (void) msg;
+#endif
+}
+
+
+/**
+ * For debug only.
+ */
+static void
+fbo_incomplete(const char *msg, int index)
+{
+#if DEBUG_FBO
+ _mesa_debug(NULL, "FBO Incomplete: %s [%d]\n", msg, index);
+#else
+ (void) msg;
+ (void) index;
+#endif
+}
+
+
+/**
+ * Is the given base format a legal format for a color renderbuffer?
+ */
+GLboolean
+_mesa_is_legal_color_format(const struct gl_context *ctx, GLenum baseFormat)
+{
+ switch (baseFormat) {
+ case GL_RGB:
+ case GL_RGBA:
+ return GL_TRUE;
+ case GL_LUMINANCE:
+ case GL_LUMINANCE_ALPHA:
+ case GL_INTENSITY:
+ case GL_ALPHA:
+ return ctx->Extensions.ARB_framebuffer_object;
+ case GL_RED:
+ case GL_RG:
+ return ctx->Extensions.ARB_texture_rg;
+ default:
+ return GL_FALSE;
+ }
+}
+
+
+/**
+ * Is the given base format a legal format for a depth/stencil renderbuffer?
+ */
+static GLboolean
+is_legal_depth_format(const struct gl_context *ctx, GLenum baseFormat)
+{
+ switch (baseFormat) {
+ case GL_DEPTH_COMPONENT:
+ case GL_DEPTH_STENCIL_EXT:
+ return GL_TRUE;
+ default:
+ return GL_FALSE;
+ }
+}
+
+
+/**
+ * Test if an attachment point is complete and update its Complete field.
+ * \param format if GL_COLOR, this is a color attachment point,
+ * if GL_DEPTH, this is a depth component attachment point,
+ * if GL_STENCIL, this is a stencil component attachment point.
+ */
+static void
+test_attachment_completeness(const struct gl_context *ctx, GLenum format,
+ struct gl_renderbuffer_attachment *att)
+{
+ assert(format == GL_COLOR || format == GL_DEPTH || format == GL_STENCIL);
+
+ /* assume complete */
+ att->Complete = GL_TRUE;
+
+ /* Look for reasons why the attachment might be incomplete */
+ if (att->Type == GL_TEXTURE) {
+ const struct gl_texture_object *texObj = att->Texture;
+ struct gl_texture_image *texImage;
+ GLenum baseFormat;
+
+ if (!texObj) {
+ att_incomplete("no texobj");
+ att->Complete = GL_FALSE;
+ return;
+ }
+
+ texImage = texObj->Image[att->CubeMapFace][att->TextureLevel];
+ if (!texImage) {
+ att_incomplete("no teximage");
+ att->Complete = GL_FALSE;
+ return;
+ }
+ if (texImage->Width < 1 || texImage->Height < 1) {
+ att_incomplete("teximage width/height=0");
+ printf("texobj = %u\n", texObj->Name);
+ printf("level = %d\n", att->TextureLevel);
+ att->Complete = GL_FALSE;
+ return;
+ }
+ if (texObj->Target == GL_TEXTURE_3D && att->Zoffset >= texImage->Depth) {
+ att_incomplete("bad z offset");
+ att->Complete = GL_FALSE;
+ return;
+ }
+
+ baseFormat = _mesa_get_format_base_format(texImage->TexFormat);
+
+ if (format == GL_COLOR) {
+ if (!_mesa_is_legal_color_format(ctx, baseFormat)) {
+ att_incomplete("bad format");
+ att->Complete = GL_FALSE;
+ return;
+ }
+ if (_mesa_is_format_compressed(texImage->TexFormat)) {
+ att_incomplete("compressed internalformat");
+ att->Complete = GL_FALSE;
+ return;
+ }
+ }
+ else if (format == GL_DEPTH) {
+ if (baseFormat == GL_DEPTH_COMPONENT) {
+ /* OK */
+ }
+ else if (ctx->Extensions.EXT_packed_depth_stencil &&
+ ctx->Extensions.ARB_depth_texture &&
+ baseFormat == GL_DEPTH_STENCIL_EXT) {
+ /* OK */
+ }
+ else {
+ att->Complete = GL_FALSE;
+ att_incomplete("bad depth format");
+ return;
+ }
+ }
+ else {
+ ASSERT(format == GL_STENCIL);
+ if (ctx->Extensions.EXT_packed_depth_stencil &&
+ ctx->Extensions.ARB_depth_texture &&
+ baseFormat == GL_DEPTH_STENCIL_EXT) {
+ /* OK */
+ }
+ else {
+ /* no such thing as stencil-only textures */
+ att_incomplete("illegal stencil texture");
+ att->Complete = GL_FALSE;
+ return;
+ }
+ }
+ }
+ else if (att->Type == GL_RENDERBUFFER_EXT) {
+ const GLenum baseFormat =
+ _mesa_get_format_base_format(att->Renderbuffer->Format);
+
+ ASSERT(att->Renderbuffer);
+ if (!att->Renderbuffer->InternalFormat ||
+ att->Renderbuffer->Width < 1 ||
+ att->Renderbuffer->Height < 1) {
+ att_incomplete("0x0 renderbuffer");
+ att->Complete = GL_FALSE;
+ return;
+ }
+ if (format == GL_COLOR) {
+ if (!_mesa_is_legal_color_format(ctx, baseFormat)) {
+ att_incomplete("bad renderbuffer color format");
+ att->Complete = GL_FALSE;
+ return;
+ }
+ }
+ else if (format == GL_DEPTH) {
+ if (baseFormat == GL_DEPTH_COMPONENT) {
+ /* OK */
+ }
+ else if (ctx->Extensions.EXT_packed_depth_stencil &&
+ baseFormat == GL_DEPTH_STENCIL_EXT) {
+ /* OK */
+ }
+ else {
+ att_incomplete("bad renderbuffer depth format");
+ att->Complete = GL_FALSE;
+ return;
+ }
+ }
+ else {
+ assert(format == GL_STENCIL);
+ if (baseFormat == GL_STENCIL_INDEX) {
+ /* OK */
+ }
+ else if (ctx->Extensions.EXT_packed_depth_stencil &&
+ baseFormat == GL_DEPTH_STENCIL_EXT) {
+ /* OK */
+ }
+ else {
+ att->Complete = GL_FALSE;
+ att_incomplete("bad renderbuffer stencil format");
+ return;
+ }
+ }
+ }
+ else {
+ ASSERT(att->Type == GL_NONE);
+ /* complete */
+ return;
+ }
+}
+
+
+/**
+ * Test if the given framebuffer object is complete and update its
+ * Status field with the results.
+ * Calls the ctx->Driver.ValidateFramebuffer() function to allow the
+ * driver to make hardware-specific validation/completeness checks.
+ * Also update the framebuffer's Width and Height fields if the
+ * framebuffer is complete.
+ */
+void
+_mesa_test_framebuffer_completeness(struct gl_context *ctx,
+ struct gl_framebuffer *fb)
+{
+ GLuint numImages;
+ GLenum intFormat = GL_NONE; /* color buffers' internal format */
+ GLuint minWidth = ~0, minHeight = ~0, maxWidth = 0, maxHeight = 0;
+ GLint numSamples = -1;
+ GLint i;
+ GLuint j;
+
+ assert(fb->Name != 0);
+
+ numImages = 0;
+ fb->Width = 0;
+ fb->Height = 0;
+
+ /* Start at -2 to more easily loop over all attachment points.
+ * -2: depth buffer
+ * -1: stencil buffer
+ * >=0: color buffer
+ */
+ for (i = -2; i < (GLint) ctx->Const.MaxColorAttachments; i++) {
+ struct gl_renderbuffer_attachment *att;
+ GLenum f;
+ gl_format attFormat;
+
+ /*
+ * XXX for ARB_fbo, only check color buffers that are named by
+ * GL_READ_BUFFER and GL_DRAW_BUFFERi.
+ */
+
+ /* check for attachment completeness
+ */
+ if (i == -2) {
+ att = &fb->Attachment[BUFFER_DEPTH];
+ test_attachment_completeness(ctx, GL_DEPTH, att);
+ if (!att->Complete) {
+ fb->_Status = GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT;
+ fbo_incomplete("depth attachment incomplete", -1);
+ return;
+ }
+ }
+ else if (i == -1) {
+ att = &fb->Attachment[BUFFER_STENCIL];
+ test_attachment_completeness(ctx, GL_STENCIL, att);
+ if (!att->Complete) {
+ fb->_Status = GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT;
+ fbo_incomplete("stencil attachment incomplete", -1);
+ return;
+ }
+ }
+ else {
+ att = &fb->Attachment[BUFFER_COLOR0 + i];
+ test_attachment_completeness(ctx, GL_COLOR, att);
+ if (!att->Complete) {
+ fb->_Status = GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT;
+ fbo_incomplete("color attachment incomplete", i);
+ return;
+ }
+ }
+
+ /* get width, height, format of the renderbuffer/texture
+ */
+ if (att->Type == GL_TEXTURE) {
+ const struct gl_texture_image *texImg =
+ _mesa_get_attachment_teximage(att);
+ minWidth = MIN2(minWidth, texImg->Width);
+ maxWidth = MAX2(maxWidth, texImg->Width);
+ minHeight = MIN2(minHeight, texImg->Height);
+ maxHeight = MAX2(maxHeight, texImg->Height);
+ f = texImg->_BaseFormat;
+ attFormat = texImg->TexFormat;
+ numImages++;
+ if (!_mesa_is_legal_color_format(ctx, f) &&
+ !is_legal_depth_format(ctx, f)) {
+ fb->_Status = GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT;
+ fbo_incomplete("texture attachment incomplete", -1);
+ return;
+ }
+ }
+ else if (att->Type == GL_RENDERBUFFER_EXT) {
+ minWidth = MIN2(minWidth, att->Renderbuffer->Width);
+ maxWidth = MAX2(minWidth, att->Renderbuffer->Width);
+ minHeight = MIN2(minHeight, att->Renderbuffer->Height);
+ maxHeight = MAX2(minHeight, att->Renderbuffer->Height);
+ f = att->Renderbuffer->InternalFormat;
+ attFormat = att->Renderbuffer->Format;
+ numImages++;
+ }
+ else {
+ assert(att->Type == GL_NONE);
+ continue;
+ }
+
+ if (att->Renderbuffer && numSamples < 0) {
+ /* first buffer */
+ numSamples = att->Renderbuffer->NumSamples;
+ }
+
+ /* check if integer color */
+ fb->_IntegerColor = _mesa_is_format_integer_color(attFormat);
+
+ /* Error-check width, height, format, samples
+ */
+ if (numImages == 1) {
+ /* save format, num samples */
+ if (i >= 0) {
+ intFormat = f;
+ }
+ }
+ else {
+ if (!ctx->Extensions.ARB_framebuffer_object) {
+ /* check that width, height, format are same */
+ if (minWidth != maxWidth || minHeight != maxHeight) {
+ fb->_Status = GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT;
+ fbo_incomplete("width or height mismatch", -1);
+ return;
+ }
+ /* check that all color buffer have same format */
+ if (intFormat != GL_NONE && f != intFormat) {
+ fb->_Status = GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT;
+ fbo_incomplete("format mismatch", -1);
+ return;
+ }
+ }
+ if (att->Renderbuffer &&
+ att->Renderbuffer->NumSamples != numSamples) {
+ fb->_Status = GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE;
+ fbo_incomplete("inconsistant number of samples", i);
+ return;
+ }
+
+ }
+ }
+
+#if FEATURE_GL
+ if (ctx->API == API_OPENGL) {
+ /* Check that all DrawBuffers are present */
+ for (j = 0; j < ctx->Const.MaxDrawBuffers; j++) {
+ if (fb->ColorDrawBuffer[j] != GL_NONE) {
+ const struct gl_renderbuffer_attachment *att
+ = _mesa_get_attachment(ctx, fb, fb->ColorDrawBuffer[j]);
+ assert(att);
+ if (att->Type == GL_NONE) {
+ fb->_Status = GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT;
+ fbo_incomplete("missing drawbuffer", j);
+ return;
+ }
+ }
+ }
+
+ /* Check that the ReadBuffer is present */
+ if (fb->ColorReadBuffer != GL_NONE) {
+ const struct gl_renderbuffer_attachment *att
+ = _mesa_get_attachment(ctx, fb, fb->ColorReadBuffer);
+ assert(att);
+ if (att->Type == GL_NONE) {
+ fb->_Status = GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT;
+ fbo_incomplete("missing readbuffer", -1);
+ return;
+ }
+ }
+ }
+#else
+ (void) j;
+#endif
+
+ if (numImages == 0) {
+ fb->_Status = GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT;
+ fbo_incomplete("no attachments", -1);
+ return;
+ }
+
+ /* Provisionally set status = COMPLETE ... */
+ fb->_Status = GL_FRAMEBUFFER_COMPLETE_EXT;
+
+ /* ... but the driver may say the FB is incomplete.
+ * Drivers will most likely set the status to GL_FRAMEBUFFER_UNSUPPORTED
+ * if anything.
+ */
+ if (ctx->Driver.ValidateFramebuffer) {
+ ctx->Driver.ValidateFramebuffer(ctx, fb);
+ if (fb->_Status != GL_FRAMEBUFFER_COMPLETE_EXT) {
+ fbo_incomplete("driver marked FBO as incomplete", -1);
+ }
+ }
+
+ if (fb->_Status == GL_FRAMEBUFFER_COMPLETE_EXT) {
+ /*
+ * Note that if ARB_framebuffer_object is supported and the attached
+ * renderbuffers/textures are different sizes, the framebuffer
+ * width/height will be set to the smallest width/height.
+ */
+ fb->Width = minWidth;
+ fb->Height = minHeight;
+
+ /* finally, update the visual info for the framebuffer */
+ _mesa_update_framebuffer_visual(ctx, fb);
+ }
+}
+
+
+GLboolean GLAPIENTRY
+_mesa_IsRenderbufferEXT(GLuint renderbuffer)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, GL_FALSE);
+ if (renderbuffer) {
+ struct gl_renderbuffer *rb = _mesa_lookup_renderbuffer(ctx, renderbuffer);
+ if (rb != NULL && rb != &DummyRenderbuffer)
+ return GL_TRUE;
+ }
+ return GL_FALSE;
+}
+
+
+void GLAPIENTRY
+_mesa_BindRenderbufferEXT(GLenum target, GLuint renderbuffer)
+{
+ struct gl_renderbuffer *newRb;
+ GET_CURRENT_CONTEXT(ctx);
+
+ ASSERT_OUTSIDE_BEGIN_END(ctx);
+
+ if (target != GL_RENDERBUFFER_EXT) {
+ _mesa_error(ctx, GL_INVALID_ENUM, "glBindRenderbufferEXT(target)");
+ return;
+ }
+
+ /* No need to flush here since the render buffer binding has no
+ * effect on rendering state.
+ */
+
+ if (renderbuffer) {
+ newRb = _mesa_lookup_renderbuffer(ctx, renderbuffer);
+ if (newRb == &DummyRenderbuffer) {
+ /* ID was reserved, but no real renderbuffer object made yet */
+ newRb = NULL;
+ }
+ else if (!newRb && ctx->Extensions.ARB_framebuffer_object) {
+ /* All RB IDs must be Gen'd */
+ _mesa_error(ctx, GL_INVALID_OPERATION, "glBindRenderbuffer(buffer)");
+ return;
+ }
+
+ if (!newRb) {
+ /* create new renderbuffer object */
+ newRb = ctx->Driver.NewRenderbuffer(ctx, renderbuffer);
+ if (!newRb) {
+ _mesa_error(ctx, GL_OUT_OF_MEMORY, "glBindRenderbufferEXT");
+ return;
+ }
+ ASSERT(newRb->AllocStorage);
+ _mesa_HashInsert(ctx->Shared->RenderBuffers, renderbuffer, newRb);
+ newRb->RefCount = 1; /* referenced by hash table */
+ }
+ }
+ else {
+ newRb = NULL;
+ }
+
+ ASSERT(newRb != &DummyRenderbuffer);
+
+ _mesa_reference_renderbuffer(&ctx->CurrentRenderbuffer, newRb);
+}
+
+
+/**
+ * If the given renderbuffer is anywhere attached to the framebuffer, detach
+ * the renderbuffer.
+ * This is used when a renderbuffer object is deleted.
+ * The spec calls for unbinding.
+ */
+static void
+detach_renderbuffer(struct gl_context *ctx,
+ struct gl_framebuffer *fb,
+ struct gl_renderbuffer *rb)
+{
+ GLuint i;
+ for (i = 0; i < BUFFER_COUNT; i++) {
+ if (fb->Attachment[i].Renderbuffer == rb) {
+ _mesa_remove_attachment(ctx, &fb->Attachment[i]);
+ }
+ }
+ invalidate_framebuffer(fb);
+}
+
+
+void GLAPIENTRY
+_mesa_DeleteRenderbuffersEXT(GLsizei n, const GLuint *renderbuffers)
+{
+ GLint i;
+ GET_CURRENT_CONTEXT(ctx);
+
+ ASSERT_OUTSIDE_BEGIN_END(ctx);
+ FLUSH_VERTICES(ctx, _NEW_BUFFERS);
+
+ for (i = 0; i < n; i++) {
+ if (renderbuffers[i] > 0) {
+ struct gl_renderbuffer *rb;
+ rb = _mesa_lookup_renderbuffer(ctx, renderbuffers[i]);
+ if (rb) {
+ /* check if deleting currently bound renderbuffer object */
+ if (rb == ctx->CurrentRenderbuffer) {
+ /* bind default */
+ ASSERT(rb->RefCount >= 2);
+ _mesa_BindRenderbufferEXT(GL_RENDERBUFFER_EXT, 0);
+ }
+
+ if (ctx->DrawBuffer->Name) {
+ detach_renderbuffer(ctx, ctx->DrawBuffer, rb);
+ }
+ if (ctx->ReadBuffer->Name && ctx->ReadBuffer != ctx->DrawBuffer) {
+ detach_renderbuffer(ctx, ctx->ReadBuffer, rb);
+ }
+
+ /* Remove from hash table immediately, to free the ID.
+ * But the object will not be freed until it's no longer
+ * referenced anywhere else.
+ */
+ _mesa_HashRemove(ctx->Shared->RenderBuffers, renderbuffers[i]);
+
+ if (rb != &DummyRenderbuffer) {
+ /* no longer referenced by hash table */
+ _mesa_reference_renderbuffer(&rb, NULL);
+ }
+ }
+ }
+ }
+}
+
+
+void GLAPIENTRY
+_mesa_GenRenderbuffersEXT(GLsizei n, GLuint *renderbuffers)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ GLuint first;
+ GLint i;
+
+ ASSERT_OUTSIDE_BEGIN_END(ctx);
+
+ if (n < 0) {
+ _mesa_error(ctx, GL_INVALID_VALUE, "glGenRenderbuffersEXT(n)");
+ return;
+ }
+
+ if (!renderbuffers)
+ return;
+
+ first = _mesa_HashFindFreeKeyBlock(ctx->Shared->RenderBuffers, n);
+
+ for (i = 0; i < n; i++) {
+ GLuint name = first + i;
+ renderbuffers[i] = name;
+ /* insert dummy placeholder into hash table */
+ _glthread_LOCK_MUTEX(ctx->Shared->Mutex);
+ _mesa_HashInsert(ctx->Shared->RenderBuffers, name, &DummyRenderbuffer);
+ _glthread_UNLOCK_MUTEX(ctx->Shared->Mutex);
+ }
+}
+
+
+/**
+ * Given an internal format token for a render buffer, return the
+ * corresponding base format (one of GL_RGB, GL_RGBA, GL_STENCIL_INDEX,
+ * GL_DEPTH_COMPONENT, GL_DEPTH_STENCIL_EXT, GL_ALPHA, GL_LUMINANCE,
+ * GL_LUMINANCE_ALPHA, GL_INTENSITY, etc).
+ *
+ * This is similar to _mesa_base_tex_format() but the set of valid
+ * internal formats is different.
+ *
+ * Note that even if a format is determined to be legal here, validation
+ * of the FBO may fail if the format is not supported by the driver/GPU.
+ *
+ * \param internalFormat as passed to glRenderbufferStorage()
+ * \return the base internal format, or 0 if internalFormat is illegal
+ */
+GLenum
+_mesa_base_fbo_format(struct gl_context *ctx, GLenum internalFormat)
+{
+ /*
+ * Notes: some formats such as alpha, luminance, etc. were added
+ * with GL_ARB_framebuffer_object.
+ */
+ switch (internalFormat) {
+ case GL_ALPHA:
+ case GL_ALPHA4:
+ case GL_ALPHA8:
+ case GL_ALPHA12:
+ case GL_ALPHA16:
+ return ctx->Extensions.ARB_framebuffer_object ? GL_ALPHA : 0;
+ case GL_LUMINANCE:
+ case GL_LUMINANCE4:
+ case GL_LUMINANCE8:
+ case GL_LUMINANCE12:
+ case GL_LUMINANCE16:
+ return ctx->Extensions.ARB_framebuffer_object ? GL_LUMINANCE : 0;
+ case GL_LUMINANCE_ALPHA:
+ case GL_LUMINANCE4_ALPHA4:
+ case GL_LUMINANCE6_ALPHA2:
+ case GL_LUMINANCE8_ALPHA8:
+ case GL_LUMINANCE12_ALPHA4:
+ case GL_LUMINANCE12_ALPHA12:
+ case GL_LUMINANCE16_ALPHA16:
+ return ctx->Extensions.ARB_framebuffer_object ? GL_LUMINANCE_ALPHA : 0;
+ case GL_INTENSITY:
+ case GL_INTENSITY4:
+ case GL_INTENSITY8:
+ case GL_INTENSITY12:
+ case GL_INTENSITY16:
+ return ctx->Extensions.ARB_framebuffer_object ? GL_INTENSITY : 0;
+ case GL_RGB:
+ case GL_R3_G3_B2:
+ case GL_RGB4:
+ case GL_RGB5:
+ case GL_RGB8:
+ case GL_RGB10:
+ case GL_RGB12:
+ case GL_RGB16:
+ case GL_SRGB8_EXT:
+ return GL_RGB;
+ case GL_RGBA:
+ case GL_RGBA2:
+ case GL_RGBA4:
+ case GL_RGB5_A1:
+ case GL_RGBA8:
+ case GL_RGB10_A2:
+ case GL_RGBA12:
+ case GL_RGBA16:
+ case GL_SRGB8_ALPHA8_EXT:
+ return GL_RGBA;
+ case GL_STENCIL_INDEX:
+ case GL_STENCIL_INDEX1_EXT:
+ case GL_STENCIL_INDEX4_EXT:
+ case GL_STENCIL_INDEX8_EXT:
+ case GL_STENCIL_INDEX16_EXT:
+ return GL_STENCIL_INDEX;
+ case GL_DEPTH_COMPONENT:
+ case GL_DEPTH_COMPONENT16:
+ case GL_DEPTH_COMPONENT24:
+ case GL_DEPTH_COMPONENT32:
+ return GL_DEPTH_COMPONENT;
+ case GL_DEPTH_STENCIL_EXT:
+ case GL_DEPTH24_STENCIL8_EXT:
+ if (ctx->Extensions.EXT_packed_depth_stencil)
+ return GL_DEPTH_STENCIL_EXT;
+ else
+ return 0;
+ case GL_RED:
+ case GL_R8:
+ case GL_R16:
+ return ctx->Extensions.ARB_texture_rg ? GL_RED : 0;
+ case GL_RG:
+ case GL_RG8:
+ case GL_RG16:
+ return ctx->Extensions.ARB_texture_rg ? GL_RG : 0;
+ /* signed normalized texture formats */
+ case GL_RED_SNORM:
+ case GL_R8_SNORM:
+ case GL_R16_SNORM:
+ return ctx->Extensions.EXT_texture_snorm ? GL_RED : 0;
+ case GL_RG_SNORM:
+ case GL_RG8_SNORM:
+ case GL_RG16_SNORM:
+ return ctx->Extensions.EXT_texture_snorm ? GL_RG : 0;
+ case GL_RGB_SNORM:
+ case GL_RGB8_SNORM:
+ case GL_RGB16_SNORM:
+ return ctx->Extensions.EXT_texture_snorm ? GL_RGB : 0;
+ case GL_RGBA_SNORM:
+ case GL_RGBA8_SNORM:
+ case GL_RGBA16_SNORM:
+ return ctx->Extensions.EXT_texture_snorm ? GL_RGBA : 0;
+ case GL_ALPHA_SNORM:
+ case GL_ALPHA8_SNORM:
+ case GL_ALPHA16_SNORM:
+ return ctx->Extensions.EXT_texture_snorm &&
+ ctx->Extensions.ARB_framebuffer_object ? GL_ALPHA : 0;
+ case GL_LUMINANCE_SNORM:
+ case GL_LUMINANCE8_SNORM:
+ case GL_LUMINANCE16_SNORM:
+ return ctx->Extensions.EXT_texture_snorm &&
+ ctx->Extensions.ARB_framebuffer_object ? GL_LUMINANCE : 0;
+ case GL_LUMINANCE_ALPHA_SNORM:
+ case GL_LUMINANCE8_ALPHA8_SNORM:
+ case GL_LUMINANCE16_ALPHA16_SNORM:
+ return ctx->Extensions.EXT_texture_snorm &&
+ ctx->Extensions.ARB_framebuffer_object ? GL_LUMINANCE_ALPHA : 0;
+ case GL_INTENSITY_SNORM:
+ case GL_INTENSITY8_SNORM:
+ case GL_INTENSITY16_SNORM:
+ return ctx->Extensions.EXT_texture_snorm &&
+ ctx->Extensions.ARB_framebuffer_object ? GL_INTENSITY : 0;
+ case GL_R16F:
+ case GL_R32F:
+ return ctx->Extensions.ARB_texture_rg &&
+ ctx->Extensions.ARB_texture_float ? GL_RED : 0;
+ case GL_RG16F:
+ case GL_RG32F:
+ return ctx->Extensions.ARB_texture_rg &&
+ ctx->Extensions.ARB_texture_float ? GL_RG : 0;
+ case GL_RGB16F:
+ case GL_RGB32F:
+ return ctx->Extensions.ARB_texture_float ? GL_RGB : 0;
+ case GL_RGBA16F:
+ case GL_RGBA32F:
+ return ctx->Extensions.ARB_texture_float ? GL_RGBA : 0;
+ case GL_ALPHA16F_ARB:
+ case GL_ALPHA32F_ARB:
+ return ctx->Extensions.ARB_texture_float &&
+ ctx->Extensions.ARB_framebuffer_object ? GL_ALPHA : 0;
+ case GL_LUMINANCE16F_ARB:
+ case GL_LUMINANCE32F_ARB:
+ return ctx->Extensions.ARB_texture_float &&
+ ctx->Extensions.ARB_framebuffer_object ? GL_LUMINANCE : 0;
+ case GL_LUMINANCE_ALPHA16F_ARB:
+ case GL_LUMINANCE_ALPHA32F_ARB:
+ return ctx->Extensions.ARB_texture_float &&
+ ctx->Extensions.ARB_framebuffer_object ? GL_LUMINANCE_ALPHA : 0;
+ case GL_INTENSITY16F_ARB:
+ case GL_INTENSITY32F_ARB:
+ return ctx->Extensions.ARB_texture_float &&
+ ctx->Extensions.ARB_framebuffer_object ? GL_INTENSITY : 0;
+ case GL_RGB9_E5:
+ return ctx->Extensions.EXT_texture_shared_exponent ? GL_RGB : 0;
+ case GL_R11F_G11F_B10F:
+ return ctx->Extensions.EXT_packed_float ? GL_RGB : 0;
+ /* XXX add integer formats eventually */
+ default:
+ return 0;
+ }
+}
+
+
+/**
+ * Invalidate a renderbuffer attachment. Called from _mesa_HashWalk().
+ */
+static void
+invalidate_rb(GLuint key, void *data, void *userData)
+{
+ struct gl_framebuffer *fb = (struct gl_framebuffer *) data;
+ struct gl_renderbuffer *rb = (struct gl_renderbuffer *) userData;
+
+ /* If this is a user-created FBO */
+ if (fb->Name) {
+ GLuint i;
+ for (i = 0; i < BUFFER_COUNT; i++) {
+ struct gl_renderbuffer_attachment *att = fb->Attachment + i;
+ if (att->Type == GL_RENDERBUFFER &&
+ att->Renderbuffer == rb) {
+ /* Mark fb status as indeterminate to force re-validation */
+ fb->_Status = 0;
+ return;
+ }
+ }
+ }
+}
+
+
+/** sentinal value, see below */
+#define NO_SAMPLES 1000
+
+
+/**
+ * Helper function used by _mesa_RenderbufferStorageEXT() and
+ * _mesa_RenderbufferStorageMultisample().
+ * samples will be NO_SAMPLES if called by _mesa_RenderbufferStorageEXT().
+ */
+static void
+renderbuffer_storage(GLenum target, GLenum internalFormat,
+ GLsizei width, GLsizei height, GLsizei samples)
+{
+ const char *func = samples == NO_SAMPLES ?
+ "glRenderbufferStorage" : "RenderbufferStorageMultisample";
+ struct gl_renderbuffer *rb;
+ GLenum baseFormat;
+ GET_CURRENT_CONTEXT(ctx);
+
+ ASSERT_OUTSIDE_BEGIN_END(ctx);
+
+ if (target != GL_RENDERBUFFER_EXT) {
+ _mesa_error(ctx, GL_INVALID_ENUM, "%s(target)", func);
+ return;
+ }
+
+ baseFormat = _mesa_base_fbo_format(ctx, internalFormat);
+ if (baseFormat == 0) {
+ _mesa_error(ctx, GL_INVALID_ENUM, "%s(internalFormat)", func);
+ return;
+ }
+
+ if (width < 1 || width > (GLsizei) ctx->Const.MaxRenderbufferSize) {
+ _mesa_error(ctx, GL_INVALID_VALUE, "%s(width)", func);
+ return;
+ }
+
+ if (height < 1 || height > (GLsizei) ctx->Const.MaxRenderbufferSize) {
+ _mesa_error(ctx, GL_INVALID_VALUE, "%s(height)", func);
+ return;
+ }
+
+ if (samples == NO_SAMPLES) {
+ /* NumSamples == 0 indicates non-multisampling */
+ samples = 0;
+ }
+ else if (samples > (GLsizei) ctx->Const.MaxSamples) {
+ /* note: driver may choose to use more samples than what's requested */
+ _mesa_error(ctx, GL_INVALID_VALUE, "%s(samples)", func);
+ return;
+ }
+
+ rb = ctx->CurrentRenderbuffer;
+ if (!rb) {
+ _mesa_error(ctx, GL_INVALID_OPERATION, "%s", func);
+ return;
+ }
+
+ FLUSH_VERTICES(ctx, _NEW_BUFFERS);
+
+ if (rb->InternalFormat == internalFormat &&
+ rb->Width == (GLuint) width &&
+ rb->Height == (GLuint) height) {
+ /* no change in allocation needed */
+ return;
+ }
+
+ /* These MUST get set by the AllocStorage func */
+ rb->Format = MESA_FORMAT_NONE;
+ rb->NumSamples = samples;
+
+ /* Now allocate the storage */
+ ASSERT(rb->AllocStorage);
+ if (rb->AllocStorage(ctx, rb, internalFormat, width, height)) {
+ /* No error - check/set fields now */
+ assert(rb->Format != MESA_FORMAT_NONE);
+ assert(rb->Width == (GLuint) width);
+ assert(rb->Height == (GLuint) height);
+ rb->InternalFormat = internalFormat;
+ rb->_BaseFormat = baseFormat;
+ assert(rb->_BaseFormat != 0);
+ }
+ else {
+ /* Probably ran out of memory - clear the fields */
+ rb->Width = 0;
+ rb->Height = 0;
+ rb->Format = MESA_FORMAT_NONE;
+ rb->InternalFormat = GL_NONE;
+ rb->_BaseFormat = GL_NONE;
+ rb->NumSamples = 0;
+ }
+
+ /* Invalidate the framebuffers the renderbuffer is attached in. */
+ if (rb->AttachedAnytime) {
+ _mesa_HashWalk(ctx->Shared->FrameBuffers, invalidate_rb, rb);
+ }
+}
+
+
+#if FEATURE_OES_EGL_image
+void GLAPIENTRY
+_mesa_EGLImageTargetRenderbufferStorageOES(GLenum target, GLeglImageOES image)
+{
+ struct gl_renderbuffer *rb;
+ GET_CURRENT_CONTEXT(ctx);
+ ASSERT_OUTSIDE_BEGIN_END(ctx);
+
+ if (!ctx->Extensions.OES_EGL_image) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glEGLImageTargetRenderbufferStorageOES(unsupported)");
+ return;
+ }
+
+ if (target != GL_RENDERBUFFER) {
+ _mesa_error(ctx, GL_INVALID_ENUM,
+ "EGLImageTargetRenderbufferStorageOES");
+ return;
+ }
+
+ rb = ctx->CurrentRenderbuffer;
+ if (!rb) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "EGLImageTargetRenderbufferStorageOES");
+ return;
+ }
+
+ FLUSH_VERTICES(ctx, _NEW_BUFFERS);
+
+ ctx->Driver.EGLImageTargetRenderbufferStorage(ctx, rb, image);
+}
+#endif
+
+
+/**
+ * Helper function for _mesa_GetRenderbufferParameterivEXT() and
+ * _mesa_GetFramebufferAttachmentParameterivEXT()
+ * We have to be careful to respect the base format. For example, if a
+ * renderbuffer/texture was created with internalFormat=GL_RGB but the
+ * driver actually chose a GL_RGBA format, when the user queries ALPHA_SIZE
+ * we need to return zero.
+ */
+static GLint
+get_component_bits(GLenum pname, GLenum baseFormat, gl_format format)
+{
+ switch (pname) {
+ case GL_RENDERBUFFER_RED_SIZE_EXT:
+ case GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE:
+ if (baseFormat == GL_RGB || baseFormat == GL_RGBA ||
+ baseFormat == GL_RG || baseFormat == GL_RED)
+ return _mesa_get_format_bits(format, pname);
+ else
+ return 0;
+ case GL_RENDERBUFFER_GREEN_SIZE_EXT:
+ case GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE:
+ if (baseFormat == GL_RGB || baseFormat == GL_RGBA || baseFormat == GL_RG)
+ return _mesa_get_format_bits(format, pname);
+ else
+ return 0;
+ case GL_RENDERBUFFER_BLUE_SIZE_EXT:
+ case GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE:
+ if (baseFormat == GL_RGB || baseFormat == GL_RGBA)
+ return _mesa_get_format_bits(format, pname);
+ else
+ return 0;
+ case GL_RENDERBUFFER_ALPHA_SIZE_EXT:
+ case GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE:
+ if (baseFormat == GL_RGBA || baseFormat == GL_ALPHA ||
+ baseFormat == GL_LUMINANCE_ALPHA)
+ return _mesa_get_format_bits(format, pname);
+ else
+ return 0;
+ case GL_RENDERBUFFER_DEPTH_SIZE_EXT:
+ case GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE:
+ if (baseFormat == GL_DEPTH_COMPONENT || baseFormat == GL_DEPTH_STENCIL)
+ return _mesa_get_format_bits(format, pname);
+ else
+ return 0;
+ case GL_RENDERBUFFER_STENCIL_SIZE_EXT:
+ case GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE:
+ if (baseFormat == GL_STENCIL_INDEX || baseFormat == GL_DEPTH_STENCIL)
+ return _mesa_get_format_bits(format, pname);
+ else
+ return 0;
+ default:
+ return 0;
+ }
+}
+
+
+
+void GLAPIENTRY
+_mesa_RenderbufferStorageEXT(GLenum target, GLenum internalFormat,
+ GLsizei width, GLsizei height)
+{
+ /* GL_ARB_fbo says calling this function is equivalent to calling
+ * glRenderbufferStorageMultisample() with samples=0. We pass in
+ * a token value here just for error reporting purposes.
+ */
+ renderbuffer_storage(target, internalFormat, width, height, NO_SAMPLES);
+}
+
+
+void GLAPIENTRY
+_mesa_RenderbufferStorageMultisample(GLenum target, GLsizei samples,
+ GLenum internalFormat,
+ GLsizei width, GLsizei height)
+{
+ renderbuffer_storage(target, internalFormat, width, height, samples);
+}
+
+
+/**
+ * OpenGL ES version of glRenderBufferStorage.
+ */
+void GLAPIENTRY
+_es_RenderbufferStorageEXT(GLenum target, GLenum internalFormat,
+ GLsizei width, GLsizei height)
+{
+ switch (internalFormat) {
+ case GL_RGB565:
+ /* XXX this confuses GL_RENDERBUFFER_INTERNAL_FORMAT_OES */
+ /* choose a closest format */
+ internalFormat = GL_RGB5;
+ break;
+ default:
+ break;
+ }
+
+ renderbuffer_storage(target, internalFormat, width, height, 0);
+}
+
+
+void GLAPIENTRY
+_mesa_GetRenderbufferParameterivEXT(GLenum target, GLenum pname, GLint *params)
+{
+ struct gl_renderbuffer *rb;
+ GET_CURRENT_CONTEXT(ctx);
+
+ ASSERT_OUTSIDE_BEGIN_END(ctx);
+
+ if (target != GL_RENDERBUFFER_EXT) {
+ _mesa_error(ctx, GL_INVALID_ENUM,
+ "glGetRenderbufferParameterivEXT(target)");
+ return;
+ }
+
+ rb = ctx->CurrentRenderbuffer;
+ if (!rb) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glGetRenderbufferParameterivEXT");
+ return;
+ }
+
+ /* No need to flush here since we're just quering state which is
+ * not effected by rendering.
+ */
+
+ switch (pname) {
+ case GL_RENDERBUFFER_WIDTH_EXT:
+ *params = rb->Width;
+ return;
+ case GL_RENDERBUFFER_HEIGHT_EXT:
+ *params = rb->Height;
+ return;
+ case GL_RENDERBUFFER_INTERNAL_FORMAT_EXT:
+ *params = rb->InternalFormat;
+ return;
+ case GL_RENDERBUFFER_RED_SIZE_EXT:
+ case GL_RENDERBUFFER_GREEN_SIZE_EXT:
+ case GL_RENDERBUFFER_BLUE_SIZE_EXT:
+ case GL_RENDERBUFFER_ALPHA_SIZE_EXT:
+ case GL_RENDERBUFFER_DEPTH_SIZE_EXT:
+ case GL_RENDERBUFFER_STENCIL_SIZE_EXT:
+ *params = get_component_bits(pname, rb->_BaseFormat, rb->Format);
+ break;
+ case GL_RENDERBUFFER_SAMPLES:
+ if (ctx->Extensions.ARB_framebuffer_object) {
+ *params = rb->NumSamples;
+ break;
+ }
+ /* fallthrough */
+ default:
+ _mesa_error(ctx, GL_INVALID_ENUM,
+ "glGetRenderbufferParameterivEXT(target)");
+ return;
+ }
+}
+
+
+GLboolean GLAPIENTRY
+_mesa_IsFramebufferEXT(GLuint framebuffer)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, GL_FALSE);
+ if (framebuffer) {
+ struct gl_framebuffer *rb = _mesa_lookup_framebuffer(ctx, framebuffer);
+ if (rb != NULL && rb != &DummyFramebuffer)
+ return GL_TRUE;
+ }
+ return GL_FALSE;
+}
+
+
+/**
+ * Check if any of the attachments of the given framebuffer are textures
+ * (render to texture). Call ctx->Driver.RenderTexture() for such
+ * attachments.
+ */
+static void
+check_begin_texture_render(struct gl_context *ctx, struct gl_framebuffer *fb)
+{
+ GLuint i;
+ ASSERT(ctx->Driver.RenderTexture);
+
+ if (fb->Name == 0)
+ return; /* can't render to texture with winsys framebuffers */
+
+ for (i = 0; i < BUFFER_COUNT; i++) {
+ struct gl_renderbuffer_attachment *att = fb->Attachment + i;
+ if (att->Texture && _mesa_get_attachment_teximage(att)) {
+ ctx->Driver.RenderTexture(ctx, fb, att);
+ }
+ }
+}
+
+
+/**
+ * Examine all the framebuffer's attachments to see if any are textures.
+ * If so, call ctx->Driver.FinishRenderTexture() for each texture to
+ * notify the device driver that the texture image may have changed.
+ */
+static void
+check_end_texture_render(struct gl_context *ctx, struct gl_framebuffer *fb)
+{
+ if (fb->Name == 0)
+ return; /* can't render to texture with winsys framebuffers */
+
+ if (ctx->Driver.FinishRenderTexture) {
+ GLuint i;
+ for (i = 0; i < BUFFER_COUNT; i++) {
+ struct gl_renderbuffer_attachment *att = fb->Attachment + i;
+ if (att->Texture && att->Renderbuffer) {
+ ctx->Driver.FinishRenderTexture(ctx, att);
+ }
+ }
+ }
+}
+
+
+void GLAPIENTRY
+_mesa_BindFramebufferEXT(GLenum target, GLuint framebuffer)
+{
+ struct gl_framebuffer *newDrawFb, *newReadFb;
+ struct gl_framebuffer *oldDrawFb, *oldReadFb;
+ GLboolean bindReadBuf, bindDrawBuf;
+ GET_CURRENT_CONTEXT(ctx);
+
+#ifdef DEBUG
+ if (ctx->Extensions.ARB_framebuffer_object) {
+ ASSERT(ctx->Extensions.EXT_framebuffer_object);
+ ASSERT(ctx->Extensions.EXT_framebuffer_blit);
+ }
+#endif
+
+ ASSERT_OUTSIDE_BEGIN_END(ctx);
+
+ if (!ctx->Extensions.EXT_framebuffer_object) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glBindFramebufferEXT(unsupported)");
+ return;
+ }
+
+ switch (target) {
+#if FEATURE_EXT_framebuffer_blit
+ case GL_DRAW_FRAMEBUFFER_EXT:
+ if (!ctx->Extensions.EXT_framebuffer_blit) {
+ _mesa_error(ctx, GL_INVALID_ENUM, "glBindFramebufferEXT(target)");
+ return;
+ }
+ bindDrawBuf = GL_TRUE;
+ bindReadBuf = GL_FALSE;
+ break;
+ case GL_READ_FRAMEBUFFER_EXT:
+ if (!ctx->Extensions.EXT_framebuffer_blit) {
+ _mesa_error(ctx, GL_INVALID_ENUM, "glBindFramebufferEXT(target)");
+ return;
+ }
+ bindDrawBuf = GL_FALSE;
+ bindReadBuf = GL_TRUE;
+ break;
+#endif
+ case GL_FRAMEBUFFER_EXT:
+ bindDrawBuf = GL_TRUE;
+ bindReadBuf = GL_TRUE;
+ break;
+ default:
+ _mesa_error(ctx, GL_INVALID_ENUM, "glBindFramebufferEXT(target)");
+ return;
+ }
+
+ if (framebuffer) {
+ /* Binding a user-created framebuffer object */
+ newDrawFb = _mesa_lookup_framebuffer(ctx, framebuffer);
+ if (newDrawFb == &DummyFramebuffer) {
+ /* ID was reserved, but no real framebuffer object made yet */
+ newDrawFb = NULL;
+ }
+ else if (!newDrawFb && ctx->Extensions.ARB_framebuffer_object) {
+ /* All FBO IDs must be Gen'd */
+ _mesa_error(ctx, GL_INVALID_OPERATION, "glBindFramebuffer(buffer)");
+ return;
+ }
+
+ if (!newDrawFb) {
+ /* create new framebuffer object */
+ newDrawFb = ctx->Driver.NewFramebuffer(ctx, framebuffer);
+ if (!newDrawFb) {
+ _mesa_error(ctx, GL_OUT_OF_MEMORY, "glBindFramebufferEXT");
+ return;
+ }
+ _mesa_HashInsert(ctx->Shared->FrameBuffers, framebuffer, newDrawFb);
+ }
+ newReadFb = newDrawFb;
+ }
+ else {
+ /* Binding the window system framebuffer (which was originally set
+ * with MakeCurrent).
+ */
+ newDrawFb = ctx->WinSysDrawBuffer;
+ newReadFb = ctx->WinSysReadBuffer;
+ }
+
+ ASSERT(newDrawFb);
+ ASSERT(newDrawFb != &DummyFramebuffer);
+
+ /* save pointers to current/old framebuffers */
+ oldDrawFb = ctx->DrawBuffer;
+ oldReadFb = ctx->ReadBuffer;
+
+ /* check if really changing bindings */
+ if (oldDrawFb == newDrawFb)
+ bindDrawBuf = GL_FALSE;
+ if (oldReadFb == newReadFb)
+ bindReadBuf = GL_FALSE;
+
+ /*
+ * OK, now bind the new Draw/Read framebuffers, if they're changing.
+ *
+ * We also check if we're beginning and/or ending render-to-texture.
+ * When a framebuffer with texture attachments is unbound, call
+ * ctx->Driver.FinishRenderTexture().
+ * When a framebuffer with texture attachments is bound, call
+ * ctx->Driver.RenderTexture().
+ *
+ * Note that if the ReadBuffer has texture attachments we don't consider
+ * that a render-to-texture case.
+ */
+ if (bindReadBuf) {
+ FLUSH_VERTICES(ctx, _NEW_BUFFERS);
+
+ /* check if old readbuffer was render-to-texture */
+ check_end_texture_render(ctx, oldReadFb);
+
+ _mesa_reference_framebuffer(&ctx->ReadBuffer, newReadFb);
+ }
+
+ if (bindDrawBuf) {
+ FLUSH_VERTICES(ctx, _NEW_BUFFERS);
+
+ /* check if old read/draw buffers were render-to-texture */
+ if (!bindReadBuf)
+ check_end_texture_render(ctx, oldReadFb);
+
+ if (oldDrawFb != oldReadFb)
+ check_end_texture_render(ctx, oldDrawFb);
+
+ /* check if newly bound framebuffer has any texture attachments */
+ check_begin_texture_render(ctx, newDrawFb);
+
+ _mesa_reference_framebuffer(&ctx->DrawBuffer, newDrawFb);
+ }
+
+ if ((bindDrawBuf || bindReadBuf) && ctx->Driver.BindFramebuffer) {
+ ctx->Driver.BindFramebuffer(ctx, target, newDrawFb, newReadFb);
+ }
+}
+
+
+void GLAPIENTRY
+_mesa_DeleteFramebuffersEXT(GLsizei n, const GLuint *framebuffers)
+{
+ GLint i;
+ GET_CURRENT_CONTEXT(ctx);
+
+ ASSERT_OUTSIDE_BEGIN_END(ctx);
+ FLUSH_VERTICES(ctx, _NEW_BUFFERS);
+
+ for (i = 0; i < n; i++) {
+ if (framebuffers[i] > 0) {
+ struct gl_framebuffer *fb;
+ fb = _mesa_lookup_framebuffer(ctx, framebuffers[i]);
+ if (fb) {
+ ASSERT(fb == &DummyFramebuffer || fb->Name == framebuffers[i]);
+
+ /* check if deleting currently bound framebuffer object */
+ if (ctx->Extensions.EXT_framebuffer_blit) {
+ /* separate draw/read binding points */
+ if (fb == ctx->DrawBuffer) {
+ /* bind default */
+ ASSERT(fb->RefCount >= 2);
+ _mesa_BindFramebufferEXT(GL_DRAW_FRAMEBUFFER_EXT, 0);
+ }
+ if (fb == ctx->ReadBuffer) {
+ /* bind default */
+ ASSERT(fb->RefCount >= 2);
+ _mesa_BindFramebufferEXT(GL_READ_FRAMEBUFFER_EXT, 0);
+ }
+ }
+ else {
+ /* only one binding point for read/draw buffers */
+ if (fb == ctx->DrawBuffer || fb == ctx->ReadBuffer) {
+ /* bind default */
+ ASSERT(fb->RefCount >= 2);
+ _mesa_BindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
+ }
+ }
+
+ /* remove from hash table immediately, to free the ID */
+ _mesa_HashRemove(ctx->Shared->FrameBuffers, framebuffers[i]);
+
+ if (fb != &DummyFramebuffer) {
+ /* But the object will not be freed until it's no longer
+ * bound in any context.
+ */
+ _mesa_reference_framebuffer(&fb, NULL);
+ }
+ }
+ }
+ }
+}
+
+
+void GLAPIENTRY
+_mesa_GenFramebuffersEXT(GLsizei n, GLuint *framebuffers)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ GLuint first;
+ GLint i;
+
+ ASSERT_OUTSIDE_BEGIN_END(ctx);
+
+ if (n < 0) {
+ _mesa_error(ctx, GL_INVALID_VALUE, "glGenFramebuffersEXT(n)");
+ return;
+ }
+
+ if (!framebuffers)
+ return;
+
+ first = _mesa_HashFindFreeKeyBlock(ctx->Shared->FrameBuffers, n);
+
+ for (i = 0; i < n; i++) {
+ GLuint name = first + i;
+ framebuffers[i] = name;
+ /* insert dummy placeholder into hash table */
+ _glthread_LOCK_MUTEX(ctx->Shared->Mutex);
+ _mesa_HashInsert(ctx->Shared->FrameBuffers, name, &DummyFramebuffer);
+ _glthread_UNLOCK_MUTEX(ctx->Shared->Mutex);
+ }
+}
+
+
+
+GLenum GLAPIENTRY
+_mesa_CheckFramebufferStatusEXT(GLenum target)
+{
+ struct gl_framebuffer *buffer;
+ GET_CURRENT_CONTEXT(ctx);
+
+ ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, 0);
+
+ buffer = get_framebuffer_target(ctx, target);
+ if (!buffer) {
+ _mesa_error(ctx, GL_INVALID_ENUM, "glCheckFramebufferStatus(target)");
+ return 0;
+ }
+
+ if (buffer->Name == 0) {
+ /* The window system / default framebuffer is always complete */
+ return GL_FRAMEBUFFER_COMPLETE_EXT;
+ }
+
+ /* No need to flush here */
+
+ if (buffer->_Status != GL_FRAMEBUFFER_COMPLETE) {
+ _mesa_test_framebuffer_completeness(ctx, buffer);
+ }
+
+ return buffer->_Status;
+}
+
+
+
+/**
+ * Common code called by glFramebufferTexture1D/2D/3DEXT().
+ */
+static void
+framebuffer_texture(struct gl_context *ctx, const char *caller, GLenum target,
+ GLenum attachment, GLenum textarget, GLuint texture,
+ GLint level, GLint zoffset)
+{
+ struct gl_renderbuffer_attachment *att;
+ struct gl_texture_object *texObj = NULL;
+ struct gl_framebuffer *fb;
+
+ ASSERT_OUTSIDE_BEGIN_END(ctx);
+
+ fb = get_framebuffer_target(ctx, target);
+ if (!fb) {
+ _mesa_error(ctx, GL_INVALID_ENUM,
+ "glFramebufferTexture%sEXT(target=0x%x)", caller, target);
+ return;
+ }
+
+ /* check framebuffer binding */
+ if (fb->Name == 0) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glFramebufferTexture%sEXT", caller);
+ return;
+ }
+
+
+ /* The textarget, level, and zoffset parameters are only validated if
+ * texture is non-zero.
+ */
+ if (texture) {
+ GLboolean err = GL_TRUE;
+
+ texObj = _mesa_lookup_texture(ctx, texture);
+ if (texObj != NULL) {
+ if (textarget == 0) {
+ /* XXX what's the purpose of this? */
+ err = (texObj->Target != GL_TEXTURE_3D) &&
+ (texObj->Target != GL_TEXTURE_1D_ARRAY_EXT) &&
+ (texObj->Target != GL_TEXTURE_2D_ARRAY_EXT);
+ }
+ else {
+ err = (texObj->Target == GL_TEXTURE_CUBE_MAP)
+ ? !IS_CUBE_FACE(textarget)
+ : (texObj->Target != textarget);
+ }
+ }
+ else {
+ /* can't render to a non-existant texture */
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glFramebufferTexture%sEXT(non existant texture)",
+ caller);
+ return;
+ }
+
+ if (err) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glFramebufferTexture%sEXT(texture target mismatch)",
+ caller);
+ return;
+ }
+
+ if (texObj->Target == GL_TEXTURE_3D) {
+ const GLint maxSize = 1 << (ctx->Const.Max3DTextureLevels - 1);
+ if (zoffset < 0 || zoffset >= maxSize) {
+ _mesa_error(ctx, GL_INVALID_VALUE,
+ "glFramebufferTexture%sEXT(zoffset)", caller);
+ return;
+ }
+ }
+ else if ((texObj->Target == GL_TEXTURE_1D_ARRAY_EXT) ||
+ (texObj->Target == GL_TEXTURE_2D_ARRAY_EXT)) {
+ if (zoffset < 0 || zoffset >= ctx->Const.MaxArrayTextureLayers) {
+ _mesa_error(ctx, GL_INVALID_VALUE,
+ "glFramebufferTexture%sEXT(layer)", caller);
+ return;
+ }
+ }
+
+ if ((level < 0) ||
+ (level >= _mesa_max_texture_levels(ctx, texObj->Target))) {
+ _mesa_error(ctx, GL_INVALID_VALUE,
+ "glFramebufferTexture%sEXT(level)", caller);
+ return;
+ }
+ }
+
+ att = _mesa_get_attachment(ctx, fb, attachment);
+ if (att == NULL) {
+ _mesa_error(ctx, GL_INVALID_ENUM,
+ "glFramebufferTexture%sEXT(attachment)", caller);
+ return;
+ }
+
+ FLUSH_VERTICES(ctx, _NEW_BUFFERS);
+
+ _glthread_LOCK_MUTEX(fb->Mutex);
+ if (texObj) {
+ _mesa_set_texture_attachment(ctx, fb, att, texObj, textarget,
+ level, zoffset);
+ /* Set the render-to-texture flag. We'll check this flag in
+ * glTexImage() and friends to determine if we need to revalidate
+ * any FBOs that might be rendering into this texture.
+ * This flag never gets cleared since it's non-trivial to determine
+ * when all FBOs might be done rendering to this texture. That's OK
+ * though since it's uncommon to render to a texture then repeatedly
+ * call glTexImage() to change images in the texture.
+ */
+ texObj->_RenderToTexture = GL_TRUE;
+ }
+ else {
+ _mesa_remove_attachment(ctx, att);
+ }
+
+ invalidate_framebuffer(fb);
+
+ _glthread_UNLOCK_MUTEX(fb->Mutex);
+}
+
+
+
+void GLAPIENTRY
+_mesa_FramebufferTexture1DEXT(GLenum target, GLenum attachment,
+ GLenum textarget, GLuint texture, GLint level)
+{
+ GET_CURRENT_CONTEXT(ctx);
+
+ if ((texture != 0) && (textarget != GL_TEXTURE_1D)) {
+ _mesa_error(ctx, GL_INVALID_ENUM,
+ "glFramebufferTexture1DEXT(textarget)");
+ return;
+ }
+
+ framebuffer_texture(ctx, "1D", target, attachment, textarget, texture,
+ level, 0);
+}
+
+
+void GLAPIENTRY
+_mesa_FramebufferTexture2DEXT(GLenum target, GLenum attachment,
+ GLenum textarget, GLuint texture, GLint level)
+{
+ GET_CURRENT_CONTEXT(ctx);
+
+ if ((texture != 0) &&
+ (textarget != GL_TEXTURE_2D) &&
+ (textarget != GL_TEXTURE_RECTANGLE_ARB) &&
+ (!IS_CUBE_FACE(textarget))) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glFramebufferTexture2DEXT(textarget=0x%x)", textarget);
+ return;
+ }
+
+ framebuffer_texture(ctx, "2D", target, attachment, textarget, texture,
+ level, 0);
+}
+
+
+void GLAPIENTRY
+_mesa_FramebufferTexture3DEXT(GLenum target, GLenum attachment,
+ GLenum textarget, GLuint texture,
+ GLint level, GLint zoffset)
+{
+ GET_CURRENT_CONTEXT(ctx);
+
+ if ((texture != 0) && (textarget != GL_TEXTURE_3D)) {
+ _mesa_error(ctx, GL_INVALID_ENUM,
+ "glFramebufferTexture3DEXT(textarget)");
+ return;
+ }
+
+ framebuffer_texture(ctx, "3D", target, attachment, textarget, texture,
+ level, zoffset);
+}
+
+
+void GLAPIENTRY
+_mesa_FramebufferTextureLayerEXT(GLenum target, GLenum attachment,
+ GLuint texture, GLint level, GLint layer)
+{
+ GET_CURRENT_CONTEXT(ctx);
+
+ framebuffer_texture(ctx, "Layer", target, attachment, 0, texture,
+ level, layer);
+}
+
+
+void GLAPIENTRY
+_mesa_FramebufferRenderbufferEXT(GLenum target, GLenum attachment,
+ GLenum renderbufferTarget,
+ GLuint renderbuffer)
+{
+ struct gl_renderbuffer_attachment *att;
+ struct gl_framebuffer *fb;
+ struct gl_renderbuffer *rb;
+ GET_CURRENT_CONTEXT(ctx);
+
+ ASSERT_OUTSIDE_BEGIN_END(ctx);
+
+ fb = get_framebuffer_target(ctx, target);
+ if (!fb) {
+ _mesa_error(ctx, GL_INVALID_ENUM, "glFramebufferRenderbufferEXT(target)");
+ return;
+ }
+
+ if (renderbufferTarget != GL_RENDERBUFFER_EXT) {
+ _mesa_error(ctx, GL_INVALID_ENUM,
+ "glFramebufferRenderbufferEXT(renderbufferTarget)");
+ return;
+ }
+
+ if (fb->Name == 0) {
+ /* Can't attach new renderbuffers to a window system framebuffer */
+ _mesa_error(ctx, GL_INVALID_OPERATION, "glFramebufferRenderbufferEXT");
+ return;
+ }
+
+ att = _mesa_get_attachment(ctx, fb, attachment);
+ if (att == NULL) {
+ _mesa_error(ctx, GL_INVALID_ENUM,
+ "glFramebufferRenderbufferEXT(invalid attachment %s)",
+ _mesa_lookup_enum_by_nr(attachment));
+ return;
+ }
+
+ if (renderbuffer) {
+ rb = _mesa_lookup_renderbuffer(ctx, renderbuffer);
+ if (!rb) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glFramebufferRenderbufferEXT(non-existant"
+ " renderbuffer %u)", renderbuffer);
+ return;
+ }
+ else if (rb == &DummyRenderbuffer) {
+ /* This is what NVIDIA does */
+ _mesa_error(ctx, GL_INVALID_VALUE,
+ "glFramebufferRenderbufferEXT(renderbuffer %u)",
+ renderbuffer);
+ return;
+ }
+ }
+ else {
+ /* remove renderbuffer attachment */
+ rb = NULL;
+ }
+
+ if (attachment == GL_DEPTH_STENCIL_ATTACHMENT &&
+ rb && rb->Format != MESA_FORMAT_NONE) {
+ /* make sure the renderbuffer is a depth/stencil format */
+ const GLenum baseFormat = _mesa_get_format_base_format(rb->Format);
+ if (baseFormat != GL_DEPTH_STENCIL) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glFramebufferRenderbufferEXT(renderbuffer"
+ " is not DEPTH_STENCIL format)");
+ return;
+ }
+ }
+
+
+ FLUSH_VERTICES(ctx, _NEW_BUFFERS);
+
+ assert(ctx->Driver.FramebufferRenderbuffer);
+ ctx->Driver.FramebufferRenderbuffer(ctx, fb, attachment, rb);
+
+ /* Some subsequent GL commands may depend on the framebuffer's visual
+ * after the binding is updated. Update visual info now.
+ */
+ _mesa_update_framebuffer_visual(ctx, fb);
+}
+
+
+void GLAPIENTRY
+_mesa_GetFramebufferAttachmentParameterivEXT(GLenum target, GLenum attachment,
+ GLenum pname, GLint *params)
+{
+ const struct gl_renderbuffer_attachment *att;
+ struct gl_framebuffer *buffer;
+ GET_CURRENT_CONTEXT(ctx);
+
+ ASSERT_OUTSIDE_BEGIN_END(ctx);
+
+ buffer = get_framebuffer_target(ctx, target);
+ if (!buffer) {
+ _mesa_error(ctx, GL_INVALID_ENUM,
+ "glGetFramebufferAttachmentParameterivEXT(target)");
+ return;
+ }
+
+ if (buffer->Name == 0) {
+ /* the default / window-system FBO */
+ att = _mesa_get_fb0_attachment(ctx, buffer, attachment);
+ }
+ else {
+ /* user-created framebuffer FBO */
+ att = _mesa_get_attachment(ctx, buffer, attachment);
+ }
+
+ if (att == NULL) {
+ _mesa_error(ctx, GL_INVALID_ENUM,
+ "glGetFramebufferAttachmentParameterivEXT(attachment)");
+ return;
+ }
+
+ if (attachment == GL_DEPTH_STENCIL_ATTACHMENT) {
+ /* the depth and stencil attachments must point to the same buffer */
+ const struct gl_renderbuffer_attachment *depthAtt, *stencilAtt;
+ depthAtt = _mesa_get_attachment(ctx, buffer, GL_DEPTH_ATTACHMENT);
+ stencilAtt = _mesa_get_attachment(ctx, buffer, GL_STENCIL_ATTACHMENT);
+ if (depthAtt->Renderbuffer != stencilAtt->Renderbuffer) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glGetFramebufferAttachmentParameterivEXT(DEPTH/STENCIL"
+ " attachments differ)");
+ return;
+ }
+ }
+
+ /* No need to flush here */
+
+ switch (pname) {
+ case GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT:
+ *params = buffer->Name == 0 ? GL_FRAMEBUFFER_DEFAULT : att->Type;
+ return;
+ case GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT:
+ if (att->Type == GL_RENDERBUFFER_EXT) {
+ *params = att->Renderbuffer->Name;
+ }
+ else if (att->Type == GL_TEXTURE) {
+ *params = att->Texture->Name;
+ }
+ else {
+ assert(att->Type == GL_NONE);
+ *params = 0;
+ }
+ return;
+ case GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT:
+ if (att->Type == GL_TEXTURE) {
+ *params = att->TextureLevel;
+ }
+ else {
+ _mesa_error(ctx, GL_INVALID_ENUM,
+ "glGetFramebufferAttachmentParameterivEXT(pname)");
+ }
+ return;
+ case GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_EXT:
+ if (att->Type == GL_TEXTURE) {
+ if (att->Texture && att->Texture->Target == GL_TEXTURE_CUBE_MAP) {
+ *params = GL_TEXTURE_CUBE_MAP_POSITIVE_X + att->CubeMapFace;
+ }
+ else {
+ *params = 0;
+ }
+ }
+ else {
+ _mesa_error(ctx, GL_INVALID_ENUM,
+ "glGetFramebufferAttachmentParameterivEXT(pname)");
+ }
+ return;
+ case GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT:
+ if (att->Type == GL_TEXTURE) {
+ if (att->Texture && att->Texture->Target == GL_TEXTURE_3D) {
+ *params = att->Zoffset;
+ }
+ else {
+ *params = 0;
+ }
+ }
+ else {
+ _mesa_error(ctx, GL_INVALID_ENUM,
+ "glGetFramebufferAttachmentParameterivEXT(pname)");
+ }
+ return;
+ case GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING:
+ if (!ctx->Extensions.ARB_framebuffer_object) {
+ _mesa_error(ctx, GL_INVALID_ENUM,
+ "glGetFramebufferAttachmentParameterivEXT(pname)");
+ }
+ else {
+ if (ctx->Extensions.EXT_framebuffer_sRGB && ctx->Const.sRGBCapable) {
+ *params = _mesa_get_format_color_encoding(att->Renderbuffer->Format);
+ }
+ else {
+ /* According to ARB_framebuffer_sRGB, we should return LINEAR
+ * if the sRGB conversion is unsupported. */
+ *params = GL_LINEAR;
+ }
+ }
+ return;
+ case GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE:
+ if (!ctx->Extensions.ARB_framebuffer_object) {
+ _mesa_error(ctx, GL_INVALID_ENUM,
+ "glGetFramebufferAttachmentParameterivEXT(pname)");
+ return;
+ }
+ else {
+ gl_format format = att->Renderbuffer->Format;
+ if (format == MESA_FORMAT_CI8 || format == MESA_FORMAT_S8) {
+ /* special cases */
+ *params = GL_INDEX;
+ }
+ else {
+ *params = _mesa_get_format_datatype(format);
+ }
+ }
+ return;
+ case GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE:
+ case GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE:
+ case GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE:
+ case GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE:
+ case GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE:
+ case GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE:
+ if (!ctx->Extensions.ARB_framebuffer_object) {
+ _mesa_error(ctx, GL_INVALID_ENUM,
+ "glGetFramebufferAttachmentParameterivEXT(pname)");
+ }
+ else if (att->Texture) {
+ const struct gl_texture_image *texImage =
+ _mesa_select_tex_image(ctx, att->Texture, att->Texture->Target,
+ att->TextureLevel);
+ if (texImage) {
+ *params = get_component_bits(pname, texImage->_BaseFormat,
+ texImage->TexFormat);
+ }
+ else {
+ *params = 0;
+ }
+ }
+ else if (att->Renderbuffer) {
+ *params = get_component_bits(pname, att->Renderbuffer->_BaseFormat,
+ att->Renderbuffer->Format);
+ }
+ else {
+ *params = 0;
+ }
+ return;
+ default:
+ _mesa_error(ctx, GL_INVALID_ENUM,
+ "glGetFramebufferAttachmentParameterivEXT(pname)");
+ return;
+ }
+}
+
+
+void GLAPIENTRY
+_mesa_GenerateMipmapEXT(GLenum target)
+{
+ struct gl_texture_object *texObj;
+ GET_CURRENT_CONTEXT(ctx);
+
+ ASSERT_OUTSIDE_BEGIN_END(ctx);
+ FLUSH_VERTICES(ctx, _NEW_BUFFERS);
+
+ switch (target) {
+ case GL_TEXTURE_1D:
+ case GL_TEXTURE_2D:
+ case GL_TEXTURE_3D:
+ case GL_TEXTURE_CUBE_MAP:
+ /* OK, legal value */
+ break;
+ default:
+ /* XXX need to implement GL_TEXTURE_1D_ARRAY and GL_TEXTURE_2D_ARRAY */
+ _mesa_error(ctx, GL_INVALID_ENUM, "glGenerateMipmapEXT(target)");
+ return;
+ }
+
+ texObj = _mesa_get_current_tex_object(ctx, target);
+
+ if (texObj->BaseLevel >= texObj->MaxLevel) {
+ /* nothing to do */
+ return;
+ }
+
+ if (texObj->Target == GL_TEXTURE_CUBE_MAP &&
+ !_mesa_cube_complete(texObj)) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glGenerateMipmap(incomplete cube map)");
+ return;
+ }
+
+ _mesa_lock_texture(ctx, texObj);
+ if (target == GL_TEXTURE_CUBE_MAP) {
+ GLuint face;
+ for (face = 0; face < 6; face++)
+ ctx->Driver.GenerateMipmap(ctx,
+ GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB + face,
+ texObj);
+ }
+ else {
+ ctx->Driver.GenerateMipmap(ctx, target, texObj);
+ }
+ _mesa_unlock_texture(ctx, texObj);
+}
+
+
+#if FEATURE_EXT_framebuffer_blit
+
+static const struct gl_renderbuffer_attachment *
+find_attachment(const struct gl_framebuffer *fb,
+ const struct gl_renderbuffer *rb)
+{
+ GLuint i;
+ for (i = 0; i < Elements(fb->Attachment); i++) {
+ if (fb->Attachment[i].Renderbuffer == rb)
+ return &fb->Attachment[i];
+ }
+ return NULL;
+}
+
+
+
+/**
+ * Blit rectangular region, optionally from one framebuffer to another.
+ *
+ * Note, if the src buffer is multisampled and the dest is not, this is
+ * when the samples must be resolved to a single color.
+ */
+void GLAPIENTRY
+_mesa_BlitFramebufferEXT(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1,
+ GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1,
+ GLbitfield mask, GLenum filter)
+{
+ const GLbitfield legalMaskBits = (GL_COLOR_BUFFER_BIT |
+ GL_DEPTH_BUFFER_BIT |
+ GL_STENCIL_BUFFER_BIT);
+ const struct gl_framebuffer *readFb, *drawFb;
+ const struct gl_renderbuffer *colorReadRb, *colorDrawRb;
+ GET_CURRENT_CONTEXT(ctx);
+
+ ASSERT_OUTSIDE_BEGIN_END(ctx);
+ FLUSH_VERTICES(ctx, _NEW_BUFFERS);
+
+ if (MESA_VERBOSE & VERBOSE_API)
+ _mesa_debug(ctx,
+ "glBlitFramebuffer(%d, %d, %d, %d, %d, %d, %d, %d, 0x%x, %s)\n",
+ srcX0, srcY0, srcX1, srcY1,
+ dstX0, dstY0, dstX1, dstY1,
+ mask, _mesa_lookup_enum_by_nr(filter));
+
+ if (ctx->NewState) {
+ _mesa_update_state(ctx);
+ }
+
+ readFb = ctx->ReadBuffer;
+ drawFb = ctx->DrawBuffer;
+
+ if (!readFb || !drawFb) {
+ /* This will normally never happen but someday we may want to
+ * support MakeCurrent() with no drawables.
+ */
+ return;
+ }
+
+ /* check for complete framebuffers */
+ if (drawFb->_Status != GL_FRAMEBUFFER_COMPLETE_EXT ||
+ readFb->_Status != GL_FRAMEBUFFER_COMPLETE_EXT) {
+ _mesa_error(ctx, GL_INVALID_FRAMEBUFFER_OPERATION_EXT,
+ "glBlitFramebufferEXT(incomplete draw/read buffers)");
+ return;
+ }
+
+ if (filter != GL_NEAREST && filter != GL_LINEAR) {
+ _mesa_error(ctx, GL_INVALID_ENUM, "glBlitFramebufferEXT(filter)");
+ return;
+ }
+
+ if (mask & ~legalMaskBits) {
+ _mesa_error( ctx, GL_INVALID_VALUE, "glBlitFramebufferEXT(mask)");
+ return;
+ }
+
+ /* depth/stencil must be blitted with nearest filtering */
+ if ((mask & (GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT))
+ && filter != GL_NEAREST) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glBlitFramebufferEXT(depth/stencil requires GL_NEAREST filter)");
+ return;
+ }
+
+ /* get color read/draw renderbuffers */
+ if (mask & GL_COLOR_BUFFER_BIT) {
+ colorReadRb = readFb->_ColorReadBuffer;
+ colorDrawRb = drawFb->_ColorDrawBuffers[0];
+ }
+ else {
+ colorReadRb = colorDrawRb = NULL;
+ }
+
+ if (mask & GL_STENCIL_BUFFER_BIT) {
+ struct gl_renderbuffer *readRb = readFb->_StencilBuffer;
+ struct gl_renderbuffer *drawRb = drawFb->_StencilBuffer;
+ if (!readRb ||
+ !drawRb ||
+ _mesa_get_format_bits(readRb->Format, GL_STENCIL_BITS) !=
+ _mesa_get_format_bits(drawRb->Format, GL_STENCIL_BITS)) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glBlitFramebufferEXT(stencil buffer size mismatch)");
+ return;
+ }
+ }
+
+ if (mask & GL_DEPTH_BUFFER_BIT) {
+ struct gl_renderbuffer *readRb = readFb->_DepthBuffer;
+ struct gl_renderbuffer *drawRb = drawFb->_DepthBuffer;
+ if (!readRb ||
+ !drawRb ||
+ _mesa_get_format_bits(readRb->Format, GL_DEPTH_BITS) !=
+ _mesa_get_format_bits(drawRb->Format, GL_DEPTH_BITS)) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glBlitFramebufferEXT(depth buffer size mismatch)");
+ return;
+ }
+ }
+
+ if (readFb->Visual.samples > 0 &&
+ drawFb->Visual.samples > 0 &&
+ readFb->Visual.samples != drawFb->Visual.samples) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glBlitFramebufferEXT(mismatched samples");
+ return;
+ }
+
+ /* extra checks for multisample copies... */
+ if (readFb->Visual.samples > 0 || drawFb->Visual.samples > 0) {
+ /* src and dest region sizes must be the same */
+ if (srcX1 - srcX0 != dstX1 - dstX0 ||
+ srcY1 - srcY0 != dstY1 - dstY0) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glBlitFramebufferEXT(bad src/dst multisample region sizes)");
+ return;
+ }
+
+ /* color formats must match */
+ if (colorReadRb &&
+ colorDrawRb &&
+ colorReadRb->Format != colorDrawRb->Format) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glBlitFramebufferEXT(bad src/dst multisample pixel formats)");
+ return;
+ }
+ }
+
+ if (!ctx->Extensions.EXT_framebuffer_blit) {
+ _mesa_error(ctx, GL_INVALID_OPERATION, "glBlitFramebufferEXT");
+ return;
+ }
+
+ /* Debug code */
+ if (DEBUG_BLIT) {
+ printf("glBlitFramebuffer(%d, %d, %d, %d, %d, %d, %d, %d,"
+ " 0x%x, 0x%x)\n",
+ srcX0, srcY0, srcX1, srcY1,
+ dstX0, dstY0, dstX1, dstY1,
+ mask, filter);
+ if (colorReadRb) {
+ const struct gl_renderbuffer_attachment *att;
+
+ att = find_attachment(readFb, colorReadRb);
+ printf(" Src FBO %u RB %u (%dx%d) ",
+ readFb->Name, colorReadRb->Name,
+ colorReadRb->Width, colorReadRb->Height);
+ if (att && att->Texture) {
+ printf("Tex %u tgt 0x%x level %u face %u",
+ att->Texture->Name,
+ att->Texture->Target,
+ att->TextureLevel,
+ att->CubeMapFace);
+ }
+ printf("\n");
+
+ att = find_attachment(drawFb, colorDrawRb);
+ printf(" Dst FBO %u RB %u (%dx%d) ",
+ drawFb->Name, colorDrawRb->Name,
+ colorDrawRb->Width, colorDrawRb->Height);
+ if (att && att->Texture) {
+ printf("Tex %u tgt 0x%x level %u face %u",
+ att->Texture->Name,
+ att->Texture->Target,
+ att->TextureLevel,
+ att->CubeMapFace);
+ }
+ printf("\n");
+ }
+ }
+
+ ASSERT(ctx->Driver.BlitFramebuffer);
+ ctx->Driver.BlitFramebuffer(ctx,
+ srcX0, srcY0, srcX1, srcY1,
+ dstX0, dstY0, dstX1, dstY1,
+ mask, filter);
+}
+#endif /* FEATURE_EXT_framebuffer_blit */
+
+#if FEATURE_ARB_geometry_shader4
+void GLAPIENTRY
+_mesa_FramebufferTextureARB(GLenum target, GLenum attachment,
+ GLuint texture, GLint level)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glFramebufferTextureARB "
+ "not implemented!");
+}
+
+void GLAPIENTRY
+_mesa_FramebufferTextureFaceARB(GLenum target, GLenum attachment,
+ GLuint texture, GLint level, GLenum face)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glFramebufferTextureFaceARB "
+ "not implemented!");
+}
+#endif /* FEATURE_ARB_geometry_shader4 */
diff --git a/mesalib/src/mesa/main/ff_fragment_shader.cpp b/mesalib/src/mesa/main/ff_fragment_shader.cpp
index 0b53c28f7..562a37b81 100644
--- a/mesalib/src/mesa/main/ff_fragment_shader.cpp
+++ b/mesalib/src/mesa/main/ff_fragment_shader.cpp
@@ -1,1618 +1,1618 @@
-/**************************************************************************
- *
- * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas.
- * All Rights Reserved.
- * Copyright 2009 VMware, Inc. All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sub license, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice (including the
- * next paragraph) shall be included in all copies or substantial portions
- * of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
- * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
- * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- **************************************************************************/
-
-extern "C" {
-#include "glheader.h"
-#include "imports.h"
-#include "mtypes.h"
-#include "program/program.h"
-#include "program/prog_parameter.h"
-#include "program/prog_cache.h"
-#include "program/prog_instruction.h"
-#include "program/prog_print.h"
-#include "program/prog_statevars.h"
-#include "program/programopt.h"
-#include "texenvprogram.h"
-}
-
-/*
- * Note on texture units:
- *
- * The number of texture units supported by fixed-function fragment
- * processing is MAX_TEXTURE_COORD_UNITS, not MAX_TEXTURE_IMAGE_UNITS.
- * That's because there's a one-to-one correspondence between texture
- * coordinates and samplers in fixed-function processing.
- *
- * Since fixed-function vertex processing is limited to MAX_TEXTURE_COORD_UNITS
- * sets of texcoords, so is fixed-function fragment processing.
- *
- * We can safely use ctx->Const.MaxTextureUnits for loop bounds.
- */
-
-
-struct texenvprog_cache_item
-{
- GLuint hash;
- void *key;
- struct gl_fragment_program *data;
- struct texenvprog_cache_item *next;
-};
-
-static GLboolean
-texenv_doing_secondary_color(struct gl_context *ctx)
-{
- if (ctx->Light.Enabled &&
- (ctx->Light.Model.ColorControl == GL_SEPARATE_SPECULAR_COLOR))
- return GL_TRUE;
-
- if (ctx->Fog.ColorSumEnabled)
- return GL_TRUE;
-
- return GL_FALSE;
-}
-
-/**
- * Up to nine instructions per tex unit, plus fog, specular color.
- */
-#define MAX_INSTRUCTIONS ((MAX_TEXTURE_COORD_UNITS * 9) + 12)
-
-#define DISASSEM (MESA_VERBOSE & VERBOSE_DISASSEM)
-
-struct mode_opt {
-#ifdef __GNUC__
- __extension__ GLubyte Source:4; /**< SRC_x */
- __extension__ GLubyte Operand:3; /**< OPR_x */
-#else
- GLubyte Source; /**< SRC_x */
- GLubyte Operand; /**< OPR_x */
-#endif
-};
-
-struct state_key {
- GLuint nr_enabled_units:8;
- GLuint enabled_units:8;
- GLuint separate_specular:1;
- GLuint fog_enabled:1;
- GLuint fog_mode:2; /**< FOG_x */
- GLuint inputs_available:12;
- GLuint num_draw_buffers:4;
-
- /* NOTE: This array of structs must be last! (see "keySize" below) */
- struct {
- GLuint enabled:1;
- GLuint source_index:3; /**< TEXTURE_x_INDEX */
- GLuint shadow:1;
- GLuint ScaleShiftRGB:2;
- GLuint ScaleShiftA:2;
-
- GLuint NumArgsRGB:3; /**< up to MAX_COMBINER_TERMS */
- GLuint ModeRGB:5; /**< MODE_x */
-
- GLuint NumArgsA:3; /**< up to MAX_COMBINER_TERMS */
- GLuint ModeA:5; /**< MODE_x */
-
- GLuint texture_cyl_wrap:1; /**< For gallium test/debug only */
-
- struct mode_opt OptRGB[MAX_COMBINER_TERMS];
- struct mode_opt OptA[MAX_COMBINER_TERMS];
- } unit[MAX_TEXTURE_UNITS];
-};
-
-#define FOG_LINEAR 0
-#define FOG_EXP 1
-#define FOG_EXP2 2
-#define FOG_UNKNOWN 3
-
-static GLuint translate_fog_mode( GLenum mode )
-{
- switch (mode) {
- case GL_LINEAR: return FOG_LINEAR;
- case GL_EXP: return FOG_EXP;
- case GL_EXP2: return FOG_EXP2;
- default: return FOG_UNKNOWN;
- }
-}
-
-#define OPR_SRC_COLOR 0
-#define OPR_ONE_MINUS_SRC_COLOR 1
-#define OPR_SRC_ALPHA 2
-#define OPR_ONE_MINUS_SRC_ALPHA 3
-#define OPR_ZERO 4
-#define OPR_ONE 5
-#define OPR_UNKNOWN 7
-
-static GLuint translate_operand( GLenum operand )
-{
- switch (operand) {
- case GL_SRC_COLOR: return OPR_SRC_COLOR;
- case GL_ONE_MINUS_SRC_COLOR: return OPR_ONE_MINUS_SRC_COLOR;
- case GL_SRC_ALPHA: return OPR_SRC_ALPHA;
- case GL_ONE_MINUS_SRC_ALPHA: return OPR_ONE_MINUS_SRC_ALPHA;
- case GL_ZERO: return OPR_ZERO;
- case GL_ONE: return OPR_ONE;
- default:
- assert(0);
- return OPR_UNKNOWN;
- }
-}
-
-#define SRC_TEXTURE 0
-#define SRC_TEXTURE0 1
-#define SRC_TEXTURE1 2
-#define SRC_TEXTURE2 3
-#define SRC_TEXTURE3 4
-#define SRC_TEXTURE4 5
-#define SRC_TEXTURE5 6
-#define SRC_TEXTURE6 7
-#define SRC_TEXTURE7 8
-#define SRC_CONSTANT 9
-#define SRC_PRIMARY_COLOR 10
-#define SRC_PREVIOUS 11
-#define SRC_ZERO 12
-#define SRC_UNKNOWN 15
-
-static GLuint translate_source( GLenum src )
-{
- switch (src) {
- case GL_TEXTURE: return SRC_TEXTURE;
- case GL_TEXTURE0:
- case GL_TEXTURE1:
- case GL_TEXTURE2:
- case GL_TEXTURE3:
- case GL_TEXTURE4:
- case GL_TEXTURE5:
- case GL_TEXTURE6:
- case GL_TEXTURE7: return SRC_TEXTURE0 + (src - GL_TEXTURE0);
- case GL_CONSTANT: return SRC_CONSTANT;
- case GL_PRIMARY_COLOR: return SRC_PRIMARY_COLOR;
- case GL_PREVIOUS: return SRC_PREVIOUS;
- case GL_ZERO:
- return SRC_ZERO;
- default:
- assert(0);
- return SRC_UNKNOWN;
- }
-}
-
-#define MODE_REPLACE 0 /* r = a0 */
-#define MODE_MODULATE 1 /* r = a0 * a1 */
-#define MODE_ADD 2 /* r = a0 + a1 */
-#define MODE_ADD_SIGNED 3 /* r = a0 + a1 - 0.5 */
-#define MODE_INTERPOLATE 4 /* r = a0 * a2 + a1 * (1 - a2) */
-#define MODE_SUBTRACT 5 /* r = a0 - a1 */
-#define MODE_DOT3_RGB 6 /* r = a0 . a1 */
-#define MODE_DOT3_RGB_EXT 7 /* r = a0 . a1 */
-#define MODE_DOT3_RGBA 8 /* r = a0 . a1 */
-#define MODE_DOT3_RGBA_EXT 9 /* r = a0 . a1 */
-#define MODE_MODULATE_ADD_ATI 10 /* r = a0 * a2 + a1 */
-#define MODE_MODULATE_SIGNED_ADD_ATI 11 /* r = a0 * a2 + a1 - 0.5 */
-#define MODE_MODULATE_SUBTRACT_ATI 12 /* r = a0 * a2 - a1 */
-#define MODE_ADD_PRODUCTS 13 /* r = a0 * a1 + a2 * a3 */
-#define MODE_ADD_PRODUCTS_SIGNED 14 /* r = a0 * a1 + a2 * a3 - 0.5 */
-#define MODE_BUMP_ENVMAP_ATI 15 /* special */
-#define MODE_UNKNOWN 16
-
-/**
- * Translate GL combiner state into a MODE_x value
- */
-static GLuint translate_mode( GLenum envMode, GLenum mode )
-{
- switch (mode) {
- case GL_REPLACE: return MODE_REPLACE;
- case GL_MODULATE: return MODE_MODULATE;
- case GL_ADD:
- if (envMode == GL_COMBINE4_NV)
- return MODE_ADD_PRODUCTS;
- else
- return MODE_ADD;
- case GL_ADD_SIGNED:
- if (envMode == GL_COMBINE4_NV)
- return MODE_ADD_PRODUCTS_SIGNED;
- else
- return MODE_ADD_SIGNED;
- case GL_INTERPOLATE: return MODE_INTERPOLATE;
- case GL_SUBTRACT: return MODE_SUBTRACT;
- case GL_DOT3_RGB: return MODE_DOT3_RGB;
- case GL_DOT3_RGB_EXT: return MODE_DOT3_RGB_EXT;
- case GL_DOT3_RGBA: return MODE_DOT3_RGBA;
- case GL_DOT3_RGBA_EXT: return MODE_DOT3_RGBA_EXT;
- case GL_MODULATE_ADD_ATI: return MODE_MODULATE_ADD_ATI;
- case GL_MODULATE_SIGNED_ADD_ATI: return MODE_MODULATE_SIGNED_ADD_ATI;
- case GL_MODULATE_SUBTRACT_ATI: return MODE_MODULATE_SUBTRACT_ATI;
- case GL_BUMP_ENVMAP_ATI: return MODE_BUMP_ENVMAP_ATI;
- default:
- assert(0);
- return MODE_UNKNOWN;
- }
-}
-
-
-/**
- * Do we need to clamp the results of the given texture env/combine mode?
- * If the inputs to the mode are in [0,1] we don't always have to clamp
- * the results.
- */
-static GLboolean
-need_saturate( GLuint mode )
-{
- switch (mode) {
- case MODE_REPLACE:
- case MODE_MODULATE:
- case MODE_INTERPOLATE:
- return GL_FALSE;
- case MODE_ADD:
- case MODE_ADD_SIGNED:
- case MODE_SUBTRACT:
- case MODE_DOT3_RGB:
- case MODE_DOT3_RGB_EXT:
- case MODE_DOT3_RGBA:
- case MODE_DOT3_RGBA_EXT:
- case MODE_MODULATE_ADD_ATI:
- case MODE_MODULATE_SIGNED_ADD_ATI:
- case MODE_MODULATE_SUBTRACT_ATI:
- case MODE_ADD_PRODUCTS:
- case MODE_ADD_PRODUCTS_SIGNED:
- case MODE_BUMP_ENVMAP_ATI:
- return GL_TRUE;
- default:
- assert(0);
- return GL_FALSE;
- }
-}
-
-
-
-/**
- * Translate TEXTURE_x_BIT to TEXTURE_x_INDEX.
- */
-static GLuint translate_tex_src_bit( GLbitfield bit )
-{
- ASSERT(bit);
- return _mesa_ffs(bit) - 1;
-}
-
-
-#define VERT_BIT_TEX_ANY (0xff << VERT_ATTRIB_TEX0)
-#define VERT_RESULT_TEX_ANY (0xff << VERT_RESULT_TEX0)
-
-/**
- * Identify all possible varying inputs. The fragment program will
- * never reference non-varying inputs, but will track them via state
- * constants instead.
- *
- * This function figures out all the inputs that the fragment program
- * has access to. The bitmask is later reduced to just those which
- * are actually referenced.
- */
-static GLbitfield get_fp_input_mask( struct gl_context *ctx )
-{
- /* _NEW_PROGRAM */
- const GLboolean vertexShader =
- (ctx->Shader.CurrentVertexProgram &&
- ctx->Shader.CurrentVertexProgram->LinkStatus &&
- ctx->Shader.CurrentVertexProgram->VertexProgram);
- const GLboolean vertexProgram = ctx->VertexProgram._Enabled;
- GLbitfield fp_inputs = 0x0;
-
- if (ctx->VertexProgram._Overriden) {
- /* Somebody's messing with the vertex program and we don't have
- * a clue what's happening. Assume that it could be producing
- * all possible outputs.
- */
- fp_inputs = ~0;
- }
- else if (ctx->RenderMode == GL_FEEDBACK) {
- /* _NEW_RENDERMODE */
- fp_inputs = (FRAG_BIT_COL0 | FRAG_BIT_TEX0);
- }
- else if (!(vertexProgram || vertexShader) ||
- !ctx->VertexProgram._Current) {
- /* Fixed function vertex logic */
- /* _NEW_ARRAY */
- GLbitfield varying_inputs = ctx->varying_vp_inputs;
-
- /* These get generated in the setup routine regardless of the
- * vertex program:
- */
- /* _NEW_POINT */
- if (ctx->Point.PointSprite)
- varying_inputs |= FRAG_BITS_TEX_ANY;
-
- /* First look at what values may be computed by the generated
- * vertex program:
- */
- /* _NEW_LIGHT */
- if (ctx->Light.Enabled) {
- fp_inputs |= FRAG_BIT_COL0;
-
- if (texenv_doing_secondary_color(ctx))
- fp_inputs |= FRAG_BIT_COL1;
- }
-
- /* _NEW_TEXTURE */
- fp_inputs |= (ctx->Texture._TexGenEnabled |
- ctx->Texture._TexMatEnabled) << FRAG_ATTRIB_TEX0;
-
- /* Then look at what might be varying as a result of enabled
- * arrays, etc:
- */
- if (varying_inputs & VERT_BIT_COLOR0)
- fp_inputs |= FRAG_BIT_COL0;
- if (varying_inputs & VERT_BIT_COLOR1)
- fp_inputs |= FRAG_BIT_COL1;
-
- fp_inputs |= (((varying_inputs & VERT_BIT_TEX_ANY) >> VERT_ATTRIB_TEX0)
- << FRAG_ATTRIB_TEX0);
-
- }
- else {
- /* calculate from vp->outputs */
- struct gl_vertex_program *vprog;
- GLbitfield64 vp_outputs;
-
- /* Choose GLSL vertex shader over ARB vertex program. Need this
- * since vertex shader state validation comes after fragment state
- * validation (see additional comments in state.c).
- */
- if (vertexShader)
- vprog = ctx->Shader.CurrentVertexProgram->VertexProgram;
- else
- vprog = ctx->VertexProgram.Current;
-
- vp_outputs = vprog->Base.OutputsWritten;
-
- /* These get generated in the setup routine regardless of the
- * vertex program:
- */
- /* _NEW_POINT */
- if (ctx->Point.PointSprite)
- vp_outputs |= FRAG_BITS_TEX_ANY;
-
- if (vp_outputs & (1 << VERT_RESULT_COL0))
- fp_inputs |= FRAG_BIT_COL0;
- if (vp_outputs & (1 << VERT_RESULT_COL1))
- fp_inputs |= FRAG_BIT_COL1;
-
- fp_inputs |= (((vp_outputs & VERT_RESULT_TEX_ANY) >> VERT_RESULT_TEX0)
- << FRAG_ATTRIB_TEX0);
- }
-
- return fp_inputs;
-}
-
-
-/**
- * Examine current texture environment state and generate a unique
- * key to identify it.
- */
-static GLuint make_state_key( struct gl_context *ctx, struct state_key *key )
-{
- GLuint i, j;
- GLbitfield inputs_referenced = FRAG_BIT_COL0;
- const GLbitfield inputs_available = get_fp_input_mask( ctx );
- GLuint keySize;
-
- memset(key, 0, sizeof(*key));
-
- /* _NEW_TEXTURE */
- for (i = 0; i < ctx->Const.MaxTextureUnits; i++) {
- const struct gl_texture_unit *texUnit = &ctx->Texture.Unit[i];
- const struct gl_texture_object *texObj = texUnit->_Current;
- const struct gl_tex_env_combine_state *comb = texUnit->_CurrentCombine;
- GLenum format;
-
- if (!texUnit->_ReallyEnabled || !texUnit->Enabled)
- continue;
-
- format = texObj->Image[0][texObj->BaseLevel]->_BaseFormat;
-
- key->unit[i].enabled = 1;
- key->enabled_units |= (1<<i);
- key->nr_enabled_units = i + 1;
- inputs_referenced |= FRAG_BIT_TEX(i);
-
- key->unit[i].source_index =
- translate_tex_src_bit(texUnit->_ReallyEnabled);
-
- key->unit[i].shadow =
- ((texObj->Sampler.CompareMode == GL_COMPARE_R_TO_TEXTURE) &&
- ((format == GL_DEPTH_COMPONENT) ||
- (format == GL_DEPTH_STENCIL_EXT)));
-
- key->unit[i].NumArgsRGB = comb->_NumArgsRGB;
- key->unit[i].NumArgsA = comb->_NumArgsA;
-
- key->unit[i].ModeRGB =
- translate_mode(texUnit->EnvMode, comb->ModeRGB);
- key->unit[i].ModeA =
- translate_mode(texUnit->EnvMode, comb->ModeA);
-
- key->unit[i].ScaleShiftRGB = comb->ScaleShiftRGB;
- key->unit[i].ScaleShiftA = comb->ScaleShiftA;
-
- for (j = 0; j < MAX_COMBINER_TERMS; j++) {
- key->unit[i].OptRGB[j].Operand = translate_operand(comb->OperandRGB[j]);
- key->unit[i].OptA[j].Operand = translate_operand(comb->OperandA[j]);
- key->unit[i].OptRGB[j].Source = translate_source(comb->SourceRGB[j]);
- key->unit[i].OptA[j].Source = translate_source(comb->SourceA[j]);
- }
-
- if (key->unit[i].ModeRGB == MODE_BUMP_ENVMAP_ATI) {
- /* requires some special translation */
- key->unit[i].NumArgsRGB = 2;
- key->unit[i].ScaleShiftRGB = 0;
- key->unit[i].OptRGB[0].Operand = OPR_SRC_COLOR;
- key->unit[i].OptRGB[0].Source = SRC_TEXTURE;
- key->unit[i].OptRGB[1].Operand = OPR_SRC_COLOR;
- key->unit[i].OptRGB[1].Source = texUnit->BumpTarget - GL_TEXTURE0 + SRC_TEXTURE0;
- }
-
- /* this is a back-door for enabling cylindrical texture wrap mode */
- if (texObj->Priority == 0.125)
- key->unit[i].texture_cyl_wrap = 1;
- }
-
- /* _NEW_LIGHT | _NEW_FOG */
- if (texenv_doing_secondary_color(ctx)) {
- key->separate_specular = 1;
- inputs_referenced |= FRAG_BIT_COL1;
- }
-
- /* _NEW_FOG */
- if (ctx->Fog.Enabled) {
- key->fog_enabled = 1;
- key->fog_mode = translate_fog_mode(ctx->Fog.Mode);
- inputs_referenced |= FRAG_BIT_FOGC; /* maybe */
- }
-
- /* _NEW_BUFFERS */
- key->num_draw_buffers = ctx->DrawBuffer->_NumColorDrawBuffers;
-
- key->inputs_available = (inputs_available & inputs_referenced);
-
- /* compute size of state key, ignoring unused texture units */
- keySize = sizeof(*key) - sizeof(key->unit)
- + key->nr_enabled_units * sizeof(key->unit[0]);
-
- return keySize;
-}
-
-
-/**
- * Use uregs to represent registers internally, translate to Mesa's
- * expected formats on emit.
- *
- * NOTE: These are passed by value extensively in this file rather
- * than as usual by pointer reference. If this disturbs you, try
- * remembering they are just 32bits in size.
- *
- * GCC is smart enough to deal with these dword-sized structures in
- * much the same way as if I had defined them as dwords and was using
- * macros to access and set the fields. This is much nicer and easier
- * to evolve.
- */
-struct ureg {
- GLuint file:4;
- GLuint idx:8;
- GLuint negatebase:1;
- GLuint swz:12;
- GLuint pad:7;
-};
-
-static const struct ureg undef = {
- PROGRAM_UNDEFINED,
- 255,
- 0,
- 0,
- 0
-};
-
-
-/** State used to build the fragment program:
- */
-struct texenv_fragment_program {
- struct gl_fragment_program *program;
- struct state_key *state;
-
- GLbitfield alu_temps; /**< Track texture indirections, see spec. */
- GLbitfield temps_output; /**< Track texture indirections, see spec. */
- GLbitfield temp_in_use; /**< Tracks temporary regs which are in use. */
- GLboolean error;
-
- struct ureg src_texture[MAX_TEXTURE_COORD_UNITS];
- /* Reg containing each texture unit's sampled texture color,
- * else undef.
- */
-
- struct ureg texcoord_tex[MAX_TEXTURE_COORD_UNITS];
- /* Reg containing texcoord for a texture unit,
- * needed for bump mapping, else undef.
- */
-
- struct ureg src_previous; /**< Reg containing color from previous
- * stage. May need to be decl'd.
- */
-
- GLuint last_tex_stage; /**< Number of last enabled texture unit */
-
- struct ureg half;
- struct ureg one;
- struct ureg zero;
-};
-
-
-
-static struct ureg make_ureg(GLuint file, GLuint idx)
-{
- struct ureg reg;
- reg.file = file;
- reg.idx = idx;
- reg.negatebase = 0;
- reg.swz = SWIZZLE_NOOP;
- reg.pad = 0;
- return reg;
-}
-
-static struct ureg swizzle( struct ureg reg, int x, int y, int z, int w )
-{
- reg.swz = MAKE_SWIZZLE4(GET_SWZ(reg.swz, x),
- GET_SWZ(reg.swz, y),
- GET_SWZ(reg.swz, z),
- GET_SWZ(reg.swz, w));
-
- return reg;
-}
-
-static struct ureg swizzle1( struct ureg reg, int x )
-{
- return swizzle(reg, x, x, x, x);
-}
-
-static struct ureg negate( struct ureg reg )
-{
- reg.negatebase ^= 1;
- return reg;
-}
-
-static GLboolean is_undef( struct ureg reg )
-{
- return reg.file == PROGRAM_UNDEFINED;
-}
-
-
-static struct ureg get_temp( struct texenv_fragment_program *p )
-{
- GLint bit;
-
- /* First try and reuse temps which have been used already:
- */
- bit = _mesa_ffs( ~p->temp_in_use & p->alu_temps );
-
- /* Then any unused temporary:
- */
- if (!bit)
- bit = _mesa_ffs( ~p->temp_in_use );
-
- if (!bit) {
- _mesa_problem(NULL, "%s: out of temporaries\n", __FILE__);
- exit(1);
- }
-
- if ((GLuint) bit > p->program->Base.NumTemporaries)
- p->program->Base.NumTemporaries = bit;
-
- p->temp_in_use |= 1<<(bit-1);
- return make_ureg(PROGRAM_TEMPORARY, (bit-1));
-}
-
-static struct ureg get_tex_temp( struct texenv_fragment_program *p )
-{
- int bit;
-
- /* First try to find available temp not previously used (to avoid
- * starting a new texture indirection). According to the spec, the
- * ~p->temps_output isn't necessary, but will keep it there for
- * now:
- */
- bit = _mesa_ffs( ~p->temp_in_use & ~p->alu_temps & ~p->temps_output );
-
- /* Then any unused temporary:
- */
- if (!bit)
- bit = _mesa_ffs( ~p->temp_in_use );
-
- if (!bit) {
- _mesa_problem(NULL, "%s: out of temporaries\n", __FILE__);
- exit(1);
- }
-
- if ((GLuint) bit > p->program->Base.NumTemporaries)
- p->program->Base.NumTemporaries = bit;
-
- p->temp_in_use |= 1<<(bit-1);
- return make_ureg(PROGRAM_TEMPORARY, (bit-1));
-}
-
-
-/** Mark a temp reg as being no longer allocatable. */
-static void reserve_temp( struct texenv_fragment_program *p, struct ureg r )
-{
- if (r.file == PROGRAM_TEMPORARY)
- p->temps_output |= (1 << r.idx);
-}
-
-
-static void release_temps(struct gl_context *ctx, struct texenv_fragment_program *p )
-{
- GLuint max_temp = ctx->Const.FragmentProgram.MaxTemps;
-
- /* KW: To support tex_env_crossbar, don't release the registers in
- * temps_output.
- */
- if (max_temp >= sizeof(int) * 8)
- p->temp_in_use = p->temps_output;
- else
- p->temp_in_use = ~((1<<max_temp)-1) | p->temps_output;
-}
-
-
-static struct ureg register_param5( struct texenv_fragment_program *p,
- GLint s0,
- GLint s1,
- GLint s2,
- GLint s3,
- GLint s4)
-{
- int tokens[STATE_LENGTH];
- GLuint idx;
- tokens[0] = s0;
- tokens[1] = s1;
- tokens[2] = s2;
- tokens[3] = s3;
- tokens[4] = s4;
- idx = _mesa_add_state_reference(p->program->Base.Parameters,
- (gl_state_index *)tokens);
- return make_ureg(PROGRAM_STATE_VAR, idx);
-}
-
-
-#define register_param1(p,s0) register_param5(p,s0,0,0,0,0)
-#define register_param2(p,s0,s1) register_param5(p,s0,s1,0,0,0)
-#define register_param3(p,s0,s1,s2) register_param5(p,s0,s1,s2,0,0)
-#define register_param4(p,s0,s1,s2,s3) register_param5(p,s0,s1,s2,s3,0)
-
-static GLuint frag_to_vert_attrib( GLuint attrib )
-{
- switch (attrib) {
- case FRAG_ATTRIB_COL0: return VERT_ATTRIB_COLOR0;
- case FRAG_ATTRIB_COL1: return VERT_ATTRIB_COLOR1;
- default:
- assert(attrib >= FRAG_ATTRIB_TEX0);
- assert(attrib <= FRAG_ATTRIB_TEX7);
- return attrib - FRAG_ATTRIB_TEX0 + VERT_ATTRIB_TEX0;
- }
-}
-
-
-static struct ureg register_input( struct texenv_fragment_program *p, GLuint input )
-{
- if (p->state->inputs_available & (1<<input)) {
- p->program->Base.InputsRead |= (1 << input);
- return make_ureg(PROGRAM_INPUT, input);
- }
- else {
- GLuint idx = frag_to_vert_attrib( input );
- return register_param3( p, STATE_INTERNAL, STATE_CURRENT_ATTRIB_MAYBE_VP_CLAMPED, idx );
- }
-}
-
-
-static void emit_arg( struct prog_src_register *reg,
- struct ureg ureg )
-{
- reg->File = ureg.file;
- reg->Index = ureg.idx;
- reg->Swizzle = ureg.swz;
- reg->Negate = ureg.negatebase ? NEGATE_XYZW : NEGATE_NONE;
- reg->Abs = GL_FALSE;
-}
-
-static void emit_dst( struct prog_dst_register *dst,
- struct ureg ureg, GLuint mask )
-{
- dst->File = ureg.file;
- dst->Index = ureg.idx;
- dst->WriteMask = mask;
- dst->CondMask = COND_TR; /* always pass cond test */
- dst->CondSwizzle = SWIZZLE_NOOP;
-}
-
-static struct prog_instruction *
-emit_op(struct texenv_fragment_program *p,
- enum prog_opcode op,
- struct ureg dest,
- GLuint mask,
- GLboolean saturate,
- struct ureg src0,
- struct ureg src1,
- struct ureg src2 )
-{
- const GLuint nr = p->program->Base.NumInstructions++;
- struct prog_instruction *inst = &p->program->Base.Instructions[nr];
-
- assert(nr < MAX_INSTRUCTIONS);
-
- _mesa_init_instructions(inst, 1);
- inst->Opcode = op;
-
- emit_arg( &inst->SrcReg[0], src0 );
- emit_arg( &inst->SrcReg[1], src1 );
- emit_arg( &inst->SrcReg[2], src2 );
-
- inst->SaturateMode = saturate ? SATURATE_ZERO_ONE : SATURATE_OFF;
-
- emit_dst( &inst->DstReg, dest, mask );
-
-#if 0
- /* Accounting for indirection tracking:
- */
- if (dest.file == PROGRAM_TEMPORARY)
- p->temps_output |= 1 << dest.idx;
-#endif
-
- return inst;
-}
-
-
-static struct ureg emit_arith( struct texenv_fragment_program *p,
- enum prog_opcode op,
- struct ureg dest,
- GLuint mask,
- GLboolean saturate,
- struct ureg src0,
- struct ureg src1,
- struct ureg src2 )
-{
- emit_op(p, op, dest, mask, saturate, src0, src1, src2);
-
- /* Accounting for indirection tracking:
- */
- if (src0.file == PROGRAM_TEMPORARY)
- p->alu_temps |= 1 << src0.idx;
-
- if (!is_undef(src1) && src1.file == PROGRAM_TEMPORARY)
- p->alu_temps |= 1 << src1.idx;
-
- if (!is_undef(src2) && src2.file == PROGRAM_TEMPORARY)
- p->alu_temps |= 1 << src2.idx;
-
- if (dest.file == PROGRAM_TEMPORARY)
- p->alu_temps |= 1 << dest.idx;
-
- p->program->Base.NumAluInstructions++;
- return dest;
-}
-
-static struct ureg emit_texld( struct texenv_fragment_program *p,
- enum prog_opcode op,
- struct ureg dest,
- GLuint destmask,
- GLuint tex_unit,
- GLuint tex_idx,
- GLuint tex_shadow,
- struct ureg coord )
-{
- struct prog_instruction *inst = emit_op( p, op,
- dest, destmask,
- GL_FALSE, /* don't saturate? */
- coord, /* arg 0? */
- undef,
- undef);
-
- inst->TexSrcTarget = tex_idx;
- inst->TexSrcUnit = tex_unit;
- inst->TexShadow = tex_shadow;
-
- p->program->Base.NumTexInstructions++;
-
- /* Accounting for indirection tracking:
- */
- reserve_temp(p, dest);
-
-#if 0
- /* Is this a texture indirection?
- */
- if ((coord.file == PROGRAM_TEMPORARY &&
- (p->temps_output & (1<<coord.idx))) ||
- (dest.file == PROGRAM_TEMPORARY &&
- (p->alu_temps & (1<<dest.idx)))) {
- p->program->Base.NumTexIndirections++;
- p->temps_output = 1<<coord.idx;
- p->alu_temps = 0;
- assert(0); /* KW: texture env crossbar */
- }
-#endif
-
- return dest;
-}
-
-
-static struct ureg register_const4f( struct texenv_fragment_program *p,
- GLfloat s0,
- GLfloat s1,
- GLfloat s2,
- GLfloat s3)
-{
- GLfloat values[4];
- GLuint idx, swizzle;
- struct ureg r;
- values[0] = s0;
- values[1] = s1;
- values[2] = s2;
- values[3] = s3;
- idx = _mesa_add_unnamed_constant( p->program->Base.Parameters, values, 4,
- &swizzle );
- r = make_ureg(PROGRAM_CONSTANT, idx);
- r.swz = swizzle;
- return r;
-}
-
-#define register_scalar_const(p, s0) register_const4f(p, s0, s0, s0, s0)
-#define register_const1f(p, s0) register_const4f(p, s0, 0, 0, 1)
-#define register_const2f(p, s0, s1) register_const4f(p, s0, s1, 0, 1)
-#define register_const3f(p, s0, s1, s2) register_const4f(p, s0, s1, s2, 1)
-
-
-static struct ureg get_one( struct texenv_fragment_program *p )
-{
- if (is_undef(p->one))
- p->one = register_scalar_const(p, 1.0);
- return p->one;
-}
-
-static struct ureg get_half( struct texenv_fragment_program *p )
-{
- if (is_undef(p->half))
- p->half = register_scalar_const(p, 0.5);
- return p->half;
-}
-
-static struct ureg get_zero( struct texenv_fragment_program *p )
-{
- if (is_undef(p->zero))
- p->zero = register_scalar_const(p, 0.0);
- return p->zero;
-}
-
-
-static void program_error( struct texenv_fragment_program *p, const char *msg )
-{
- _mesa_problem(NULL, "%s", msg);
- p->error = 1;
-}
-
-static struct ureg get_source( struct texenv_fragment_program *p,
- GLuint src, GLuint unit )
-{
- switch (src) {
- case SRC_TEXTURE:
- assert(!is_undef(p->src_texture[unit]));
- return p->src_texture[unit];
-
- case SRC_TEXTURE0:
- case SRC_TEXTURE1:
- case SRC_TEXTURE2:
- case SRC_TEXTURE3:
- case SRC_TEXTURE4:
- case SRC_TEXTURE5:
- case SRC_TEXTURE6:
- case SRC_TEXTURE7:
- assert(!is_undef(p->src_texture[src - SRC_TEXTURE0]));
- return p->src_texture[src - SRC_TEXTURE0];
-
- case SRC_CONSTANT:
- return register_param2(p, STATE_TEXENV_COLOR, unit);
-
- case SRC_PRIMARY_COLOR:
- return register_input(p, FRAG_ATTRIB_COL0);
-
- case SRC_ZERO:
- return get_zero(p);
-
- case SRC_PREVIOUS:
- if (is_undef(p->src_previous))
- return register_input(p, FRAG_ATTRIB_COL0);
- else
- return p->src_previous;
-
- default:
- assert(0);
- return undef;
- }
-}
-
-static struct ureg emit_combine_source( struct texenv_fragment_program *p,
- GLuint mask,
- GLuint unit,
- GLuint source,
- GLuint operand )
-{
- struct ureg arg, src, one;
-
- src = get_source(p, source, unit);
-
- switch (operand) {
- case OPR_ONE_MINUS_SRC_COLOR:
- /* Get unused tmp,
- * Emit tmp = 1.0 - arg.xyzw
- */
- arg = get_temp( p );
- one = get_one( p );
- return emit_arith( p, OPCODE_SUB, arg, mask, 0, one, src, undef);
-
- case OPR_SRC_ALPHA:
- if (mask == WRITEMASK_W)
- return src;
- else
- return swizzle1( src, SWIZZLE_W );
- case OPR_ONE_MINUS_SRC_ALPHA:
- /* Get unused tmp,
- * Emit tmp = 1.0 - arg.wwww
- */
- arg = get_temp(p);
- one = get_one(p);
- return emit_arith(p, OPCODE_SUB, arg, mask, 0,
- one, swizzle1(src, SWIZZLE_W), undef);
- case OPR_ZERO:
- return get_zero(p);
- case OPR_ONE:
- return get_one(p);
- case OPR_SRC_COLOR:
- return src;
- default:
- assert(0);
- return src;
- }
-}
-
-/**
- * Check if the RGB and Alpha sources and operands match for the given
- * texture unit's combinder state. When the RGB and A sources and
- * operands match, we can emit fewer instructions.
- */
-static GLboolean args_match( const struct state_key *key, GLuint unit )
-{
- GLuint i, numArgs = key->unit[unit].NumArgsRGB;
-
- for (i = 0; i < numArgs; i++) {
- if (key->unit[unit].OptA[i].Source != key->unit[unit].OptRGB[i].Source)
- return GL_FALSE;
-
- switch (key->unit[unit].OptA[i].Operand) {
- case OPR_SRC_ALPHA:
- switch (key->unit[unit].OptRGB[i].Operand) {
- case OPR_SRC_COLOR:
- case OPR_SRC_ALPHA:
- break;
- default:
- return GL_FALSE;
- }
- break;
- case OPR_ONE_MINUS_SRC_ALPHA:
- switch (key->unit[unit].OptRGB[i].Operand) {
- case OPR_ONE_MINUS_SRC_COLOR:
- case OPR_ONE_MINUS_SRC_ALPHA:
- break;
- default:
- return GL_FALSE;
- }
- break;
- default:
- return GL_FALSE; /* impossible */
- }
- }
-
- return GL_TRUE;
-}
-
-static struct ureg emit_combine( struct texenv_fragment_program *p,
- struct ureg dest,
- GLuint mask,
- GLboolean saturate,
- GLuint unit,
- GLuint nr,
- GLuint mode,
- const struct mode_opt *opt)
-{
- struct ureg src[MAX_COMBINER_TERMS];
- struct ureg tmp, half;
- GLuint i;
-
- assert(nr <= MAX_COMBINER_TERMS);
-
- for (i = 0; i < nr; i++)
- src[i] = emit_combine_source( p, mask, unit, opt[i].Source, opt[i].Operand );
-
- switch (mode) {
- case MODE_REPLACE:
- if (mask == WRITEMASK_XYZW && !saturate)
- return src[0];
- else
- return emit_arith( p, OPCODE_MOV, dest, mask, saturate, src[0], undef, undef );
- case MODE_MODULATE:
- return emit_arith( p, OPCODE_MUL, dest, mask, saturate,
- src[0], src[1], undef );
- case MODE_ADD:
- return emit_arith( p, OPCODE_ADD, dest, mask, saturate,
- src[0], src[1], undef );
- case MODE_ADD_SIGNED:
- /* tmp = arg0 + arg1
- * result = tmp - .5
- */
- half = get_half(p);
- tmp = get_temp( p );
- emit_arith( p, OPCODE_ADD, tmp, mask, 0, src[0], src[1], undef );
- emit_arith( p, OPCODE_SUB, dest, mask, saturate, tmp, half, undef );
- return dest;
- case MODE_INTERPOLATE:
- /* Arg0 * (Arg2) + Arg1 * (1-Arg2) -- note arguments are reordered:
- */
- return emit_arith( p, OPCODE_LRP, dest, mask, saturate, src[2], src[0], src[1] );
-
- case MODE_SUBTRACT:
- return emit_arith( p, OPCODE_SUB, dest, mask, saturate, src[0], src[1], undef );
-
- case MODE_DOT3_RGBA:
- case MODE_DOT3_RGBA_EXT:
- case MODE_DOT3_RGB_EXT:
- case MODE_DOT3_RGB: {
- struct ureg tmp0 = get_temp( p );
- struct ureg tmp1 = get_temp( p );
- struct ureg neg1 = register_scalar_const(p, -1);
- struct ureg two = register_scalar_const(p, 2);
-
- /* tmp0 = 2*src0 - 1
- * tmp1 = 2*src1 - 1
- *
- * dst = tmp0 dot3 tmp1
- */
- emit_arith( p, OPCODE_MAD, tmp0, WRITEMASK_XYZW, 0,
- two, src[0], neg1);
-
- if (memcmp(&src[0], &src[1], sizeof(struct ureg)) == 0)
- tmp1 = tmp0;
- else
- emit_arith( p, OPCODE_MAD, tmp1, WRITEMASK_XYZW, 0,
- two, src[1], neg1);
- emit_arith( p, OPCODE_DP3, dest, mask, saturate, tmp0, tmp1, undef);
- return dest;
- }
- case MODE_MODULATE_ADD_ATI:
- /* Arg0 * Arg2 + Arg1 */
- return emit_arith( p, OPCODE_MAD, dest, mask, saturate,
- src[0], src[2], src[1] );
- case MODE_MODULATE_SIGNED_ADD_ATI: {
- /* Arg0 * Arg2 + Arg1 - 0.5 */
- struct ureg tmp0 = get_temp(p);
- half = get_half(p);
- emit_arith( p, OPCODE_MAD, tmp0, mask, 0, src[0], src[2], src[1] );
- emit_arith( p, OPCODE_SUB, dest, mask, saturate, tmp0, half, undef );
- return dest;
- }
- case MODE_MODULATE_SUBTRACT_ATI:
- /* Arg0 * Arg2 - Arg1 */
- emit_arith( p, OPCODE_MAD, dest, mask, 0, src[0], src[2], negate(src[1]) );
- return dest;
- case MODE_ADD_PRODUCTS:
- /* Arg0 * Arg1 + Arg2 * Arg3 */
- {
- struct ureg tmp0 = get_temp(p);
- emit_arith( p, OPCODE_MUL, tmp0, mask, 0, src[0], src[1], undef );
- emit_arith( p, OPCODE_MAD, dest, mask, saturate, src[2], src[3], tmp0 );
- }
- return dest;
- case MODE_ADD_PRODUCTS_SIGNED:
- /* Arg0 * Arg1 + Arg2 * Arg3 - 0.5 */
- {
- struct ureg tmp0 = get_temp(p);
- half = get_half(p);
- emit_arith( p, OPCODE_MUL, tmp0, mask, 0, src[0], src[1], undef );
- emit_arith( p, OPCODE_MAD, tmp0, mask, 0, src[2], src[3], tmp0 );
- emit_arith( p, OPCODE_SUB, dest, mask, saturate, tmp0, half, undef );
- }
- return dest;
- case MODE_BUMP_ENVMAP_ATI:
- /* special - not handled here */
- assert(0);
- return src[0];
- default:
- assert(0);
- return src[0];
- }
-}
-
-
-/**
- * Generate instructions for one texture unit's env/combiner mode.
- */
-static struct ureg
-emit_texenv(struct texenv_fragment_program *p, GLuint unit)
-{
- const struct state_key *key = p->state;
- GLboolean rgb_saturate, alpha_saturate;
- GLuint rgb_shift, alpha_shift;
- struct ureg out, dest;
-
- if (!key->unit[unit].enabled) {
- return get_source(p, SRC_PREVIOUS, 0);
- }
- if (key->unit[unit].ModeRGB == MODE_BUMP_ENVMAP_ATI) {
- /* this isn't really a env stage delivering a color and handled elsewhere */
- return get_source(p, SRC_PREVIOUS, 0);
- }
-
- switch (key->unit[unit].ModeRGB) {
- case MODE_DOT3_RGB_EXT:
- alpha_shift = key->unit[unit].ScaleShiftA;
- rgb_shift = 0;
- break;
- case MODE_DOT3_RGBA_EXT:
- alpha_shift = 0;
- rgb_shift = 0;
- break;
- default:
- rgb_shift = key->unit[unit].ScaleShiftRGB;
- alpha_shift = key->unit[unit].ScaleShiftA;
- break;
- }
-
- /* If we'll do rgb/alpha shifting don't saturate in emit_combine().
- * We don't want to clamp twice.
- */
- if (rgb_shift)
- rgb_saturate = GL_FALSE; /* saturate after rgb shift */
- else if (need_saturate(key->unit[unit].ModeRGB))
- rgb_saturate = GL_TRUE;
- else
- rgb_saturate = GL_FALSE;
-
- if (alpha_shift)
- alpha_saturate = GL_FALSE; /* saturate after alpha shift */
- else if (need_saturate(key->unit[unit].ModeA))
- alpha_saturate = GL_TRUE;
- else
- alpha_saturate = GL_FALSE;
-
- /* If this is the very last calculation (and various other conditions
- * are met), emit directly to the color output register. Otherwise,
- * emit to a temporary register.
- */
- if (key->separate_specular ||
- unit != p->last_tex_stage ||
- alpha_shift ||
- key->num_draw_buffers != 1 ||
- rgb_shift)
- dest = get_temp( p );
- else
- dest = make_ureg(PROGRAM_OUTPUT, FRAG_RESULT_COLOR);
-
- /* Emit the RGB and A combine ops
- */
- if (key->unit[unit].ModeRGB == key->unit[unit].ModeA &&
- args_match(key, unit)) {
- out = emit_combine( p, dest, WRITEMASK_XYZW, rgb_saturate,
- unit,
- key->unit[unit].NumArgsRGB,
- key->unit[unit].ModeRGB,
- key->unit[unit].OptRGB);
- }
- else if (key->unit[unit].ModeRGB == MODE_DOT3_RGBA_EXT ||
- key->unit[unit].ModeRGB == MODE_DOT3_RGBA) {
- out = emit_combine( p, dest, WRITEMASK_XYZW, rgb_saturate,
- unit,
- key->unit[unit].NumArgsRGB,
- key->unit[unit].ModeRGB,
- key->unit[unit].OptRGB);
- }
- else {
- /* Need to do something to stop from re-emitting identical
- * argument calculations here:
- */
- out = emit_combine( p, dest, WRITEMASK_XYZ, rgb_saturate,
- unit,
- key->unit[unit].NumArgsRGB,
- key->unit[unit].ModeRGB,
- key->unit[unit].OptRGB);
- out = emit_combine( p, dest, WRITEMASK_W, alpha_saturate,
- unit,
- key->unit[unit].NumArgsA,
- key->unit[unit].ModeA,
- key->unit[unit].OptA);
- }
-
- /* Deal with the final shift:
- */
- if (alpha_shift || rgb_shift) {
- struct ureg shift;
- GLboolean saturate = GL_TRUE; /* always saturate at this point */
-
- if (rgb_shift == alpha_shift) {
- shift = register_scalar_const(p, (GLfloat)(1<<rgb_shift));
- }
- else {
- shift = register_const4f(p,
- (GLfloat)(1<<rgb_shift),
- (GLfloat)(1<<rgb_shift),
- (GLfloat)(1<<rgb_shift),
- (GLfloat)(1<<alpha_shift));
- }
- return emit_arith( p, OPCODE_MUL, dest, WRITEMASK_XYZW,
- saturate, out, shift, undef );
- }
- else
- return out;
-}
-
-
-/**
- * Generate instruction for getting a texture source term.
- */
-static void load_texture( struct texenv_fragment_program *p, GLuint unit )
-{
- if (is_undef(p->src_texture[unit])) {
- const GLuint texTarget = p->state->unit[unit].source_index;
- struct ureg texcoord;
- struct ureg tmp = get_tex_temp( p );
-
- if (is_undef(p->texcoord_tex[unit])) {
- texcoord = register_input(p, FRAG_ATTRIB_TEX0+unit);
- }
- else {
- /* might want to reuse this reg for tex output actually */
- texcoord = p->texcoord_tex[unit];
- }
-
- /* TODO: Use D0_MASK_XY where possible.
- */
- if (p->state->unit[unit].enabled) {
- GLboolean shadow = GL_FALSE;
-
- if (p->state->unit[unit].shadow) {
- p->program->Base.ShadowSamplers |= 1 << unit;
- shadow = GL_TRUE;
- }
-
- p->src_texture[unit] = emit_texld( p, OPCODE_TXP,
- tmp, WRITEMASK_XYZW,
- unit, texTarget, shadow,
- texcoord );
-
- p->program->Base.SamplersUsed |= (1 << unit);
- /* This identity mapping should already be in place
- * (see _mesa_init_program_struct()) but let's be safe.
- */
- p->program->Base.SamplerUnits[unit] = unit;
- }
- else
- p->src_texture[unit] = get_zero(p);
-
- if (p->state->unit[unit].texture_cyl_wrap) {
- /* set flag which is checked by Mesa->Gallium program translation */
- p->program->Base.InputFlags[0] |= PROG_PARAM_BIT_CYL_WRAP;
- }
-
- }
-}
-
-static GLboolean load_texenv_source( struct texenv_fragment_program *p,
- GLuint src, GLuint unit )
-{
- switch (src) {
- case SRC_TEXTURE:
- load_texture(p, unit);
- break;
-
- case SRC_TEXTURE0:
- case SRC_TEXTURE1:
- case SRC_TEXTURE2:
- case SRC_TEXTURE3:
- case SRC_TEXTURE4:
- case SRC_TEXTURE5:
- case SRC_TEXTURE6:
- case SRC_TEXTURE7:
- load_texture(p, src - SRC_TEXTURE0);
- break;
-
- default:
- /* not a texture src - do nothing */
- break;
- }
-
- return GL_TRUE;
-}
-
-
-/**
- * Generate instructions for loading all texture source terms.
- */
-static GLboolean
-load_texunit_sources( struct texenv_fragment_program *p, GLuint unit )
-{
- const struct state_key *key = p->state;
- GLuint i;
-
- for (i = 0; i < key->unit[unit].NumArgsRGB; i++) {
- load_texenv_source( p, key->unit[unit].OptRGB[i].Source, unit );
- }
-
- for (i = 0; i < key->unit[unit].NumArgsA; i++) {
- load_texenv_source( p, key->unit[unit].OptA[i].Source, unit );
- }
-
- return GL_TRUE;
-}
-
-/**
- * Generate instructions for loading bump map textures.
- */
-static GLboolean
-load_texunit_bumpmap( struct texenv_fragment_program *p, GLuint unit )
-{
- const struct state_key *key = p->state;
- GLuint bumpedUnitNr = key->unit[unit].OptRGB[1].Source - SRC_TEXTURE0;
- struct ureg texcDst, bumpMapRes;
- struct ureg constdudvcolor = register_const4f(p, 0.0, 0.0, 0.0, 1.0);
- struct ureg texcSrc = register_input(p, FRAG_ATTRIB_TEX0 + bumpedUnitNr);
- struct ureg rotMat0 = register_param3( p, STATE_INTERNAL, STATE_ROT_MATRIX_0, unit );
- struct ureg rotMat1 = register_param3( p, STATE_INTERNAL, STATE_ROT_MATRIX_1, unit );
-
- load_texenv_source( p, unit + SRC_TEXTURE0, unit );
-
- bumpMapRes = get_source(p, key->unit[unit].OptRGB[0].Source, unit);
- texcDst = get_tex_temp( p );
- p->texcoord_tex[bumpedUnitNr] = texcDst;
-
- /* Apply rot matrix and add coords to be available in next phase.
- * dest = (Arg0.xxxx * rotMat0 + Arg1) + (Arg0.yyyy * rotMat1)
- * note only 2 coords are affected the rest are left unchanged (mul by 0)
- */
- emit_arith( p, OPCODE_MAD, texcDst, WRITEMASK_XYZW, 0,
- swizzle1(bumpMapRes, SWIZZLE_X), rotMat0, texcSrc );
- emit_arith( p, OPCODE_MAD, texcDst, WRITEMASK_XYZW, 0,
- swizzle1(bumpMapRes, SWIZZLE_Y), rotMat1, texcDst );
-
- /* Move 0,0,0,1 into bumpmap src if someone (crossbar) is foolish
- * enough to access this later, should optimize away.
- */
- emit_arith( p, OPCODE_MOV, bumpMapRes, WRITEMASK_XYZW, 0,
- constdudvcolor, undef, undef );
-
- return GL_TRUE;
-}
-
-/**
- * Generate a new fragment program which implements the context's
- * current texture env/combine mode.
- */
-static void
-create_new_program(struct gl_context *ctx, struct state_key *key,
- struct gl_fragment_program *program)
-{
- struct prog_instruction instBuffer[MAX_INSTRUCTIONS];
- struct texenv_fragment_program p;
- GLuint unit;
- struct ureg cf, out;
- int i;
-
- memset(&p, 0, sizeof(p));
- p.state = key;
- p.program = program;
-
- /* During code generation, use locally-allocated instruction buffer,
- * then alloc dynamic storage below.
- */
- p.program->Base.Instructions = instBuffer;
- p.program->Base.Target = GL_FRAGMENT_PROGRAM_ARB;
- p.program->Base.String = NULL;
- p.program->Base.NumTexIndirections = 1; /* is this right? */
- p.program->Base.NumTexInstructions = 0;
- p.program->Base.NumAluInstructions = 0;
- p.program->Base.NumInstructions = 0;
- p.program->Base.NumTemporaries = 0;
- p.program->Base.NumParameters = 0;
- p.program->Base.NumAttributes = 0;
- p.program->Base.NumAddressRegs = 0;
- p.program->Base.Parameters = _mesa_new_parameter_list();
- p.program->Base.InputsRead = 0x0;
-
- if (key->num_draw_buffers == 1)
- p.program->Base.OutputsWritten = 1 << FRAG_RESULT_COLOR;
- else {
- for (i = 0; i < key->num_draw_buffers; i++)
- p.program->Base.OutputsWritten |= (1 << (FRAG_RESULT_DATA0 + i));
- }
-
- for (unit = 0; unit < ctx->Const.MaxTextureUnits; unit++) {
- p.src_texture[unit] = undef;
- p.texcoord_tex[unit] = undef;
- }
-
- p.src_previous = undef;
- p.half = undef;
- p.zero = undef;
- p.one = undef;
-
- p.last_tex_stage = 0;
- release_temps(ctx, &p);
-
- if (key->enabled_units && key->num_draw_buffers) {
- GLboolean needbumpstage = GL_FALSE;
-
- /* Zeroth pass - bump map textures first */
- for (unit = 0; unit < key->nr_enabled_units; unit++)
- if (key->unit[unit].enabled &&
- key->unit[unit].ModeRGB == MODE_BUMP_ENVMAP_ATI) {
- needbumpstage = GL_TRUE;
- load_texunit_bumpmap( &p, unit );
- }
- if (needbumpstage)
- p.program->Base.NumTexIndirections++;
-
- /* First pass - to support texture_env_crossbar, first identify
- * all referenced texture sources and emit texld instructions
- * for each:
- */
- for (unit = 0; unit < key->nr_enabled_units; unit++)
- if (key->unit[unit].enabled) {
- load_texunit_sources( &p, unit );
- p.last_tex_stage = unit;
- }
-
- /* Second pass - emit combine instructions to build final color:
- */
- for (unit = 0; unit < key->nr_enabled_units; unit++)
- if (key->unit[unit].enabled) {
- p.src_previous = emit_texenv( &p, unit );
- reserve_temp(&p, p.src_previous); /* don't re-use this temp reg */
- release_temps(ctx, &p); /* release all temps */
- }
- }
-
- cf = get_source( &p, SRC_PREVIOUS, 0 );
-
- for (i = 0; i < key->num_draw_buffers; i++) {
- if (key->num_draw_buffers == 1)
- out = make_ureg( PROGRAM_OUTPUT, FRAG_RESULT_COLOR );
- else {
- out = make_ureg( PROGRAM_OUTPUT, FRAG_RESULT_DATA0 + i );
- }
-
- if (key->separate_specular) {
- /* Emit specular add.
- */
- struct ureg s = register_input(&p, FRAG_ATTRIB_COL1);
- emit_arith( &p, OPCODE_ADD, out, WRITEMASK_XYZ, 0, cf, s, undef );
- emit_arith( &p, OPCODE_MOV, out, WRITEMASK_W, 0, cf, undef, undef );
- }
- else if (memcmp(&cf, &out, sizeof(cf)) != 0) {
- /* Will wind up in here if no texture enabled or a couple of
- * other scenarios (GL_REPLACE for instance).
- */
- emit_arith( &p, OPCODE_MOV, out, WRITEMASK_XYZW, 0, cf, undef, undef );
- }
- }
- /* Finish up:
- */
- emit_arith( &p, OPCODE_END, undef, WRITEMASK_XYZW, 0, undef, undef, undef);
-
- /* Allocate final instruction array. This has to be done before calling
- * _mesa_append_fog_code because that function frees the Base.Instructions.
- * At this point, Base.Instructions points to stack data, so it's a really
- * bad idea to free it.
- */
- p.program->Base.Instructions
- = _mesa_alloc_instructions(p.program->Base.NumInstructions);
- if (!p.program->Base.Instructions) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY,
- "generating tex env program");
- return;
- }
- _mesa_copy_instructions(p.program->Base.Instructions, instBuffer,
- p.program->Base.NumInstructions);
-
- /* Append fog code. This must be done before checking the program against
- * the limits becuase it will potentially add some instructions.
- */
- if (key->fog_enabled) {
- _mesa_append_fog_code(ctx, p.program, ctx->Fog.Mode, GL_FALSE);
- }
-
- if (p.program->Base.NumTexIndirections > ctx->Const.FragmentProgram.MaxTexIndirections)
- program_error(&p, "Exceeded max nr indirect texture lookups");
-
- if (p.program->Base.NumTexInstructions > ctx->Const.FragmentProgram.MaxTexInstructions)
- program_error(&p, "Exceeded max TEX instructions");
-
- if (p.program->Base.NumAluInstructions > ctx->Const.FragmentProgram.MaxAluInstructions)
- program_error(&p, "Exceeded max ALU instructions");
-
- ASSERT(p.program->Base.NumInstructions <= MAX_INSTRUCTIONS);
-
- /* Notify driver the fragment program has (actually) changed.
- */
- if (ctx->Driver.ProgramStringNotify) {
- GLboolean ok = ctx->Driver.ProgramStringNotify(ctx,
- GL_FRAGMENT_PROGRAM_ARB,
- &p.program->Base);
- /* Driver should be able to handle any texenv programs as long as
- * the driver correctly reported max number of texture units correctly,
- * etc.
- */
- ASSERT(ok);
- (void) ok; /* silence unused var warning */
- }
-
- if (DISASSEM) {
- _mesa_print_program(&p.program->Base);
- printf("\n");
- }
-}
-
-extern "C" {
-
-/**
- * Return a fragment program which implements the current
- * fixed-function texture, fog and color-sum operations.
- */
-struct gl_fragment_program *
-_mesa_get_fixed_func_fragment_program(struct gl_context *ctx)
-{
- struct gl_fragment_program *prog;
- struct state_key key;
- GLuint keySize;
-
- keySize = make_state_key(ctx, &key);
-
- prog = (struct gl_fragment_program *)
- _mesa_search_program_cache(ctx->FragmentProgram.Cache,
- &key, keySize);
-
- if (!prog) {
- prog = (struct gl_fragment_program *)
- ctx->Driver.NewProgram(ctx, GL_FRAGMENT_PROGRAM_ARB, 0);
-
- create_new_program(ctx, &key, prog);
-
- _mesa_program_cache_insert(ctx, ctx->FragmentProgram.Cache,
- &key, keySize, &prog->Base);
- }
-
- return prog;
-}
-
-}
+/**************************************************************************
+ *
+ * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas.
+ * All Rights Reserved.
+ * Copyright 2009 VMware, Inc. All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ **************************************************************************/
+
+extern "C" {
+#include "glheader.h"
+#include "imports.h"
+#include "mtypes.h"
+#include "program/program.h"
+#include "program/prog_parameter.h"
+#include "program/prog_cache.h"
+#include "program/prog_instruction.h"
+#include "program/prog_print.h"
+#include "program/prog_statevars.h"
+#include "program/programopt.h"
+#include "texenvprogram.h"
+}
+
+/*
+ * Note on texture units:
+ *
+ * The number of texture units supported by fixed-function fragment
+ * processing is MAX_TEXTURE_COORD_UNITS, not MAX_TEXTURE_IMAGE_UNITS.
+ * That's because there's a one-to-one correspondence between texture
+ * coordinates and samplers in fixed-function processing.
+ *
+ * Since fixed-function vertex processing is limited to MAX_TEXTURE_COORD_UNITS
+ * sets of texcoords, so is fixed-function fragment processing.
+ *
+ * We can safely use ctx->Const.MaxTextureUnits for loop bounds.
+ */
+
+
+struct texenvprog_cache_item
+{
+ GLuint hash;
+ void *key;
+ struct gl_fragment_program *data;
+ struct texenvprog_cache_item *next;
+};
+
+static GLboolean
+texenv_doing_secondary_color(struct gl_context *ctx)
+{
+ if (ctx->Light.Enabled &&
+ (ctx->Light.Model.ColorControl == GL_SEPARATE_SPECULAR_COLOR))
+ return GL_TRUE;
+
+ if (ctx->Fog.ColorSumEnabled)
+ return GL_TRUE;
+
+ return GL_FALSE;
+}
+
+/**
+ * Up to nine instructions per tex unit, plus fog, specular color.
+ */
+#define MAX_INSTRUCTIONS ((MAX_TEXTURE_COORD_UNITS * 9) + 12)
+
+#define DISASSEM (MESA_VERBOSE & VERBOSE_DISASSEM)
+
+struct mode_opt {
+#ifdef __GNUC__
+ __extension__ GLubyte Source:4; /**< SRC_x */
+ __extension__ GLubyte Operand:3; /**< OPR_x */
+#else
+ GLubyte Source; /**< SRC_x */
+ GLubyte Operand; /**< OPR_x */
+#endif
+};
+
+struct state_key {
+ GLuint nr_enabled_units:8;
+ GLuint enabled_units:8;
+ GLuint separate_specular:1;
+ GLuint fog_enabled:1;
+ GLuint fog_mode:2; /**< FOG_x */
+ GLuint inputs_available:12;
+ GLuint num_draw_buffers:4;
+
+ /* NOTE: This array of structs must be last! (see "keySize" below) */
+ struct {
+ GLuint enabled:1;
+ GLuint source_index:3; /**< TEXTURE_x_INDEX */
+ GLuint shadow:1;
+ GLuint ScaleShiftRGB:2;
+ GLuint ScaleShiftA:2;
+
+ GLuint NumArgsRGB:3; /**< up to MAX_COMBINER_TERMS */
+ GLuint ModeRGB:5; /**< MODE_x */
+
+ GLuint NumArgsA:3; /**< up to MAX_COMBINER_TERMS */
+ GLuint ModeA:5; /**< MODE_x */
+
+ GLuint texture_cyl_wrap:1; /**< For gallium test/debug only */
+
+ struct mode_opt OptRGB[MAX_COMBINER_TERMS];
+ struct mode_opt OptA[MAX_COMBINER_TERMS];
+ } unit[MAX_TEXTURE_UNITS];
+};
+
+#define FOG_LINEAR 0
+#define FOG_EXP 1
+#define FOG_EXP2 2
+#define FOG_UNKNOWN 3
+
+static GLuint translate_fog_mode( GLenum mode )
+{
+ switch (mode) {
+ case GL_LINEAR: return FOG_LINEAR;
+ case GL_EXP: return FOG_EXP;
+ case GL_EXP2: return FOG_EXP2;
+ default: return FOG_UNKNOWN;
+ }
+}
+
+#define OPR_SRC_COLOR 0
+#define OPR_ONE_MINUS_SRC_COLOR 1
+#define OPR_SRC_ALPHA 2
+#define OPR_ONE_MINUS_SRC_ALPHA 3
+#define OPR_ZERO 4
+#define OPR_ONE 5
+#define OPR_UNKNOWN 7
+
+static GLuint translate_operand( GLenum operand )
+{
+ switch (operand) {
+ case GL_SRC_COLOR: return OPR_SRC_COLOR;
+ case GL_ONE_MINUS_SRC_COLOR: return OPR_ONE_MINUS_SRC_COLOR;
+ case GL_SRC_ALPHA: return OPR_SRC_ALPHA;
+ case GL_ONE_MINUS_SRC_ALPHA: return OPR_ONE_MINUS_SRC_ALPHA;
+ case GL_ZERO: return OPR_ZERO;
+ case GL_ONE: return OPR_ONE;
+ default:
+ assert(0);
+ return OPR_UNKNOWN;
+ }
+}
+
+#define SRC_TEXTURE 0
+#define SRC_TEXTURE0 1
+#define SRC_TEXTURE1 2
+#define SRC_TEXTURE2 3
+#define SRC_TEXTURE3 4
+#define SRC_TEXTURE4 5
+#define SRC_TEXTURE5 6
+#define SRC_TEXTURE6 7
+#define SRC_TEXTURE7 8
+#define SRC_CONSTANT 9
+#define SRC_PRIMARY_COLOR 10
+#define SRC_PREVIOUS 11
+#define SRC_ZERO 12
+#define SRC_UNKNOWN 15
+
+static GLuint translate_source( GLenum src )
+{
+ switch (src) {
+ case GL_TEXTURE: return SRC_TEXTURE;
+ case GL_TEXTURE0:
+ case GL_TEXTURE1:
+ case GL_TEXTURE2:
+ case GL_TEXTURE3:
+ case GL_TEXTURE4:
+ case GL_TEXTURE5:
+ case GL_TEXTURE6:
+ case GL_TEXTURE7: return SRC_TEXTURE0 + (src - GL_TEXTURE0);
+ case GL_CONSTANT: return SRC_CONSTANT;
+ case GL_PRIMARY_COLOR: return SRC_PRIMARY_COLOR;
+ case GL_PREVIOUS: return SRC_PREVIOUS;
+ case GL_ZERO:
+ return SRC_ZERO;
+ default:
+ assert(0);
+ return SRC_UNKNOWN;
+ }
+}
+
+#define MODE_REPLACE 0 /* r = a0 */
+#define MODE_MODULATE 1 /* r = a0 * a1 */
+#define MODE_ADD 2 /* r = a0 + a1 */
+#define MODE_ADD_SIGNED 3 /* r = a0 + a1 - 0.5 */
+#define MODE_INTERPOLATE 4 /* r = a0 * a2 + a1 * (1 - a2) */
+#define MODE_SUBTRACT 5 /* r = a0 - a1 */
+#define MODE_DOT3_RGB 6 /* r = a0 . a1 */
+#define MODE_DOT3_RGB_EXT 7 /* r = a0 . a1 */
+#define MODE_DOT3_RGBA 8 /* r = a0 . a1 */
+#define MODE_DOT3_RGBA_EXT 9 /* r = a0 . a1 */
+#define MODE_MODULATE_ADD_ATI 10 /* r = a0 * a2 + a1 */
+#define MODE_MODULATE_SIGNED_ADD_ATI 11 /* r = a0 * a2 + a1 - 0.5 */
+#define MODE_MODULATE_SUBTRACT_ATI 12 /* r = a0 * a2 - a1 */
+#define MODE_ADD_PRODUCTS 13 /* r = a0 * a1 + a2 * a3 */
+#define MODE_ADD_PRODUCTS_SIGNED 14 /* r = a0 * a1 + a2 * a3 - 0.5 */
+#define MODE_BUMP_ENVMAP_ATI 15 /* special */
+#define MODE_UNKNOWN 16
+
+/**
+ * Translate GL combiner state into a MODE_x value
+ */
+static GLuint translate_mode( GLenum envMode, GLenum mode )
+{
+ switch (mode) {
+ case GL_REPLACE: return MODE_REPLACE;
+ case GL_MODULATE: return MODE_MODULATE;
+ case GL_ADD:
+ if (envMode == GL_COMBINE4_NV)
+ return MODE_ADD_PRODUCTS;
+ else
+ return MODE_ADD;
+ case GL_ADD_SIGNED:
+ if (envMode == GL_COMBINE4_NV)
+ return MODE_ADD_PRODUCTS_SIGNED;
+ else
+ return MODE_ADD_SIGNED;
+ case GL_INTERPOLATE: return MODE_INTERPOLATE;
+ case GL_SUBTRACT: return MODE_SUBTRACT;
+ case GL_DOT3_RGB: return MODE_DOT3_RGB;
+ case GL_DOT3_RGB_EXT: return MODE_DOT3_RGB_EXT;
+ case GL_DOT3_RGBA: return MODE_DOT3_RGBA;
+ case GL_DOT3_RGBA_EXT: return MODE_DOT3_RGBA_EXT;
+ case GL_MODULATE_ADD_ATI: return MODE_MODULATE_ADD_ATI;
+ case GL_MODULATE_SIGNED_ADD_ATI: return MODE_MODULATE_SIGNED_ADD_ATI;
+ case GL_MODULATE_SUBTRACT_ATI: return MODE_MODULATE_SUBTRACT_ATI;
+ case GL_BUMP_ENVMAP_ATI: return MODE_BUMP_ENVMAP_ATI;
+ default:
+ assert(0);
+ return MODE_UNKNOWN;
+ }
+}
+
+
+/**
+ * Do we need to clamp the results of the given texture env/combine mode?
+ * If the inputs to the mode are in [0,1] we don't always have to clamp
+ * the results.
+ */
+static GLboolean
+need_saturate( GLuint mode )
+{
+ switch (mode) {
+ case MODE_REPLACE:
+ case MODE_MODULATE:
+ case MODE_INTERPOLATE:
+ return GL_FALSE;
+ case MODE_ADD:
+ case MODE_ADD_SIGNED:
+ case MODE_SUBTRACT:
+ case MODE_DOT3_RGB:
+ case MODE_DOT3_RGB_EXT:
+ case MODE_DOT3_RGBA:
+ case MODE_DOT3_RGBA_EXT:
+ case MODE_MODULATE_ADD_ATI:
+ case MODE_MODULATE_SIGNED_ADD_ATI:
+ case MODE_MODULATE_SUBTRACT_ATI:
+ case MODE_ADD_PRODUCTS:
+ case MODE_ADD_PRODUCTS_SIGNED:
+ case MODE_BUMP_ENVMAP_ATI:
+ return GL_TRUE;
+ default:
+ assert(0);
+ return GL_FALSE;
+ }
+}
+
+
+
+/**
+ * Translate TEXTURE_x_BIT to TEXTURE_x_INDEX.
+ */
+static GLuint translate_tex_src_bit( GLbitfield bit )
+{
+ ASSERT(bit);
+ return _mesa_ffs(bit) - 1;
+}
+
+
+#define VERT_BIT_TEX_ANY (0xff << VERT_ATTRIB_TEX0)
+#define VERT_RESULT_TEX_ANY (0xff << VERT_RESULT_TEX0)
+
+/**
+ * Identify all possible varying inputs. The fragment program will
+ * never reference non-varying inputs, but will track them via state
+ * constants instead.
+ *
+ * This function figures out all the inputs that the fragment program
+ * has access to. The bitmask is later reduced to just those which
+ * are actually referenced.
+ */
+static GLbitfield get_fp_input_mask( struct gl_context *ctx )
+{
+ /* _NEW_PROGRAM */
+ const GLboolean vertexShader =
+ (ctx->Shader.CurrentVertexProgram &&
+ ctx->Shader.CurrentVertexProgram->LinkStatus &&
+ ctx->Shader.CurrentVertexProgram->VertexProgram);
+ const GLboolean vertexProgram = ctx->VertexProgram._Enabled;
+ GLbitfield fp_inputs = 0x0;
+
+ if (ctx->VertexProgram._Overriden) {
+ /* Somebody's messing with the vertex program and we don't have
+ * a clue what's happening. Assume that it could be producing
+ * all possible outputs.
+ */
+ fp_inputs = ~0;
+ }
+ else if (ctx->RenderMode == GL_FEEDBACK) {
+ /* _NEW_RENDERMODE */
+ fp_inputs = (FRAG_BIT_COL0 | FRAG_BIT_TEX0);
+ }
+ else if (!(vertexProgram || vertexShader) ||
+ !ctx->VertexProgram._Current) {
+ /* Fixed function vertex logic */
+ /* _NEW_ARRAY */
+ GLbitfield varying_inputs = ctx->varying_vp_inputs;
+
+ /* These get generated in the setup routine regardless of the
+ * vertex program:
+ */
+ /* _NEW_POINT */
+ if (ctx->Point.PointSprite)
+ varying_inputs |= FRAG_BITS_TEX_ANY;
+
+ /* First look at what values may be computed by the generated
+ * vertex program:
+ */
+ /* _NEW_LIGHT */
+ if (ctx->Light.Enabled) {
+ fp_inputs |= FRAG_BIT_COL0;
+
+ if (texenv_doing_secondary_color(ctx))
+ fp_inputs |= FRAG_BIT_COL1;
+ }
+
+ /* _NEW_TEXTURE */
+ fp_inputs |= (ctx->Texture._TexGenEnabled |
+ ctx->Texture._TexMatEnabled) << FRAG_ATTRIB_TEX0;
+
+ /* Then look at what might be varying as a result of enabled
+ * arrays, etc:
+ */
+ if (varying_inputs & VERT_BIT_COLOR0)
+ fp_inputs |= FRAG_BIT_COL0;
+ if (varying_inputs & VERT_BIT_COLOR1)
+ fp_inputs |= FRAG_BIT_COL1;
+
+ fp_inputs |= (((varying_inputs & VERT_BIT_TEX_ANY) >> VERT_ATTRIB_TEX0)
+ << FRAG_ATTRIB_TEX0);
+
+ }
+ else {
+ /* calculate from vp->outputs */
+ struct gl_vertex_program *vprog;
+ GLbitfield64 vp_outputs;
+
+ /* Choose GLSL vertex shader over ARB vertex program. Need this
+ * since vertex shader state validation comes after fragment state
+ * validation (see additional comments in state.c).
+ */
+ if (vertexShader)
+ vprog = ctx->Shader.CurrentVertexProgram->VertexProgram;
+ else
+ vprog = ctx->VertexProgram.Current;
+
+ vp_outputs = vprog->Base.OutputsWritten;
+
+ /* These get generated in the setup routine regardless of the
+ * vertex program:
+ */
+ /* _NEW_POINT */
+ if (ctx->Point.PointSprite)
+ vp_outputs |= FRAG_BITS_TEX_ANY;
+
+ if (vp_outputs & (1 << VERT_RESULT_COL0))
+ fp_inputs |= FRAG_BIT_COL0;
+ if (vp_outputs & (1 << VERT_RESULT_COL1))
+ fp_inputs |= FRAG_BIT_COL1;
+
+ fp_inputs |= (((vp_outputs & VERT_RESULT_TEX_ANY) >> VERT_RESULT_TEX0)
+ << FRAG_ATTRIB_TEX0);
+ }
+
+ return fp_inputs;
+}
+
+
+/**
+ * Examine current texture environment state and generate a unique
+ * key to identify it.
+ */
+static GLuint make_state_key( struct gl_context *ctx, struct state_key *key )
+{
+ GLuint i, j;
+ GLbitfield inputs_referenced = FRAG_BIT_COL0;
+ const GLbitfield inputs_available = get_fp_input_mask( ctx );
+ GLuint keySize;
+
+ memset(key, 0, sizeof(*key));
+
+ /* _NEW_TEXTURE */
+ for (i = 0; i < ctx->Const.MaxTextureUnits; i++) {
+ const struct gl_texture_unit *texUnit = &ctx->Texture.Unit[i];
+ const struct gl_texture_object *texObj = texUnit->_Current;
+ const struct gl_tex_env_combine_state *comb = texUnit->_CurrentCombine;
+ GLenum format;
+
+ if (!texUnit->_ReallyEnabled || !texUnit->Enabled)
+ continue;
+
+ format = texObj->Image[0][texObj->BaseLevel]->_BaseFormat;
+
+ key->unit[i].enabled = 1;
+ key->enabled_units |= (1<<i);
+ key->nr_enabled_units = i + 1;
+ inputs_referenced |= FRAG_BIT_TEX(i);
+
+ key->unit[i].source_index =
+ translate_tex_src_bit(texUnit->_ReallyEnabled);
+
+ key->unit[i].shadow =
+ ((texObj->Sampler.CompareMode == GL_COMPARE_R_TO_TEXTURE) &&
+ ((format == GL_DEPTH_COMPONENT) ||
+ (format == GL_DEPTH_STENCIL_EXT)));
+
+ key->unit[i].NumArgsRGB = comb->_NumArgsRGB;
+ key->unit[i].NumArgsA = comb->_NumArgsA;
+
+ key->unit[i].ModeRGB =
+ translate_mode(texUnit->EnvMode, comb->ModeRGB);
+ key->unit[i].ModeA =
+ translate_mode(texUnit->EnvMode, comb->ModeA);
+
+ key->unit[i].ScaleShiftRGB = comb->ScaleShiftRGB;
+ key->unit[i].ScaleShiftA = comb->ScaleShiftA;
+
+ for (j = 0; j < MAX_COMBINER_TERMS; j++) {
+ key->unit[i].OptRGB[j].Operand = translate_operand(comb->OperandRGB[j]);
+ key->unit[i].OptA[j].Operand = translate_operand(comb->OperandA[j]);
+ key->unit[i].OptRGB[j].Source = translate_source(comb->SourceRGB[j]);
+ key->unit[i].OptA[j].Source = translate_source(comb->SourceA[j]);
+ }
+
+ if (key->unit[i].ModeRGB == MODE_BUMP_ENVMAP_ATI) {
+ /* requires some special translation */
+ key->unit[i].NumArgsRGB = 2;
+ key->unit[i].ScaleShiftRGB = 0;
+ key->unit[i].OptRGB[0].Operand = OPR_SRC_COLOR;
+ key->unit[i].OptRGB[0].Source = SRC_TEXTURE;
+ key->unit[i].OptRGB[1].Operand = OPR_SRC_COLOR;
+ key->unit[i].OptRGB[1].Source = texUnit->BumpTarget - GL_TEXTURE0 + SRC_TEXTURE0;
+ }
+
+ /* this is a back-door for enabling cylindrical texture wrap mode */
+ if (texObj->Priority == 0.125)
+ key->unit[i].texture_cyl_wrap = 1;
+ }
+
+ /* _NEW_LIGHT | _NEW_FOG */
+ if (texenv_doing_secondary_color(ctx)) {
+ key->separate_specular = 1;
+ inputs_referenced |= FRAG_BIT_COL1;
+ }
+
+ /* _NEW_FOG */
+ if (ctx->Fog.Enabled) {
+ key->fog_enabled = 1;
+ key->fog_mode = translate_fog_mode(ctx->Fog.Mode);
+ inputs_referenced |= FRAG_BIT_FOGC; /* maybe */
+ }
+
+ /* _NEW_BUFFERS */
+ key->num_draw_buffers = ctx->DrawBuffer->_NumColorDrawBuffers;
+
+ key->inputs_available = (inputs_available & inputs_referenced);
+
+ /* compute size of state key, ignoring unused texture units */
+ keySize = sizeof(*key) - sizeof(key->unit)
+ + key->nr_enabled_units * sizeof(key->unit[0]);
+
+ return keySize;
+}
+
+
+/**
+ * Use uregs to represent registers internally, translate to Mesa's
+ * expected formats on emit.
+ *
+ * NOTE: These are passed by value extensively in this file rather
+ * than as usual by pointer reference. If this disturbs you, try
+ * remembering they are just 32bits in size.
+ *
+ * GCC is smart enough to deal with these dword-sized structures in
+ * much the same way as if I had defined them as dwords and was using
+ * macros to access and set the fields. This is much nicer and easier
+ * to evolve.
+ */
+struct ureg {
+ GLuint file:4;
+ GLuint idx:8;
+ GLuint negatebase:1;
+ GLuint swz:12;
+ GLuint pad:7;
+};
+
+static const struct ureg undef = {
+ PROGRAM_UNDEFINED,
+ 255,
+ 0,
+ 0,
+ 0
+};
+
+
+/** State used to build the fragment program:
+ */
+struct texenv_fragment_program {
+ struct gl_fragment_program *program;
+ struct state_key *state;
+
+ GLbitfield alu_temps; /**< Track texture indirections, see spec. */
+ GLbitfield temps_output; /**< Track texture indirections, see spec. */
+ GLbitfield temp_in_use; /**< Tracks temporary regs which are in use. */
+ GLboolean error;
+
+ struct ureg src_texture[MAX_TEXTURE_COORD_UNITS];
+ /* Reg containing each texture unit's sampled texture color,
+ * else undef.
+ */
+
+ struct ureg texcoord_tex[MAX_TEXTURE_COORD_UNITS];
+ /* Reg containing texcoord for a texture unit,
+ * needed for bump mapping, else undef.
+ */
+
+ struct ureg src_previous; /**< Reg containing color from previous
+ * stage. May need to be decl'd.
+ */
+
+ GLuint last_tex_stage; /**< Number of last enabled texture unit */
+
+ struct ureg half;
+ struct ureg one;
+ struct ureg zero;
+};
+
+
+
+static struct ureg make_ureg(GLuint file, GLuint idx)
+{
+ struct ureg reg;
+ reg.file = file;
+ reg.idx = idx;
+ reg.negatebase = 0;
+ reg.swz = SWIZZLE_NOOP;
+ reg.pad = 0;
+ return reg;
+}
+
+static struct ureg swizzle( struct ureg reg, int x, int y, int z, int w )
+{
+ reg.swz = MAKE_SWIZZLE4(GET_SWZ(reg.swz, x),
+ GET_SWZ(reg.swz, y),
+ GET_SWZ(reg.swz, z),
+ GET_SWZ(reg.swz, w));
+
+ return reg;
+}
+
+static struct ureg swizzle1( struct ureg reg, int x )
+{
+ return swizzle(reg, x, x, x, x);
+}
+
+static struct ureg negate( struct ureg reg )
+{
+ reg.negatebase ^= 1;
+ return reg;
+}
+
+static GLboolean is_undef( struct ureg reg )
+{
+ return reg.file == PROGRAM_UNDEFINED;
+}
+
+
+static struct ureg get_temp( struct texenv_fragment_program *p )
+{
+ GLint bit;
+
+ /* First try and reuse temps which have been used already:
+ */
+ bit = _mesa_ffs( ~p->temp_in_use & p->alu_temps );
+
+ /* Then any unused temporary:
+ */
+ if (!bit)
+ bit = _mesa_ffs( ~p->temp_in_use );
+
+ if (!bit) {
+ _mesa_problem(NULL, "%s: out of temporaries\n", __FILE__);
+ exit(1);
+ }
+
+ if ((GLuint) bit > p->program->Base.NumTemporaries)
+ p->program->Base.NumTemporaries = bit;
+
+ p->temp_in_use |= 1<<(bit-1);
+ return make_ureg(PROGRAM_TEMPORARY, (bit-1));
+}
+
+static struct ureg get_tex_temp( struct texenv_fragment_program *p )
+{
+ int bit;
+
+ /* First try to find available temp not previously used (to avoid
+ * starting a new texture indirection). According to the spec, the
+ * ~p->temps_output isn't necessary, but will keep it there for
+ * now:
+ */
+ bit = _mesa_ffs( ~p->temp_in_use & ~p->alu_temps & ~p->temps_output );
+
+ /* Then any unused temporary:
+ */
+ if (!bit)
+ bit = _mesa_ffs( ~p->temp_in_use );
+
+ if (!bit) {
+ _mesa_problem(NULL, "%s: out of temporaries\n", __FILE__);
+ exit(1);
+ }
+
+ if ((GLuint) bit > p->program->Base.NumTemporaries)
+ p->program->Base.NumTemporaries = bit;
+
+ p->temp_in_use |= 1<<(bit-1);
+ return make_ureg(PROGRAM_TEMPORARY, (bit-1));
+}
+
+
+/** Mark a temp reg as being no longer allocatable. */
+static void reserve_temp( struct texenv_fragment_program *p, struct ureg r )
+{
+ if (r.file == PROGRAM_TEMPORARY)
+ p->temps_output |= (1 << r.idx);
+}
+
+
+static void release_temps(struct gl_context *ctx, struct texenv_fragment_program *p )
+{
+ GLuint max_temp = ctx->Const.FragmentProgram.MaxTemps;
+
+ /* KW: To support tex_env_crossbar, don't release the registers in
+ * temps_output.
+ */
+ if (max_temp >= sizeof(int) * 8)
+ p->temp_in_use = p->temps_output;
+ else
+ p->temp_in_use = ~((1<<max_temp)-1) | p->temps_output;
+}
+
+
+static struct ureg register_param5( struct texenv_fragment_program *p,
+ GLint s0,
+ GLint s1,
+ GLint s2,
+ GLint s3,
+ GLint s4)
+{
+ int tokens[STATE_LENGTH];
+ GLuint idx;
+ tokens[0] = s0;
+ tokens[1] = s1;
+ tokens[2] = s2;
+ tokens[3] = s3;
+ tokens[4] = s4;
+ idx = _mesa_add_state_reference(p->program->Base.Parameters,
+ (gl_state_index *)tokens);
+ return make_ureg(PROGRAM_STATE_VAR, idx);
+}
+
+
+#define register_param1(p,s0) register_param5(p,s0,0,0,0,0)
+#define register_param2(p,s0,s1) register_param5(p,s0,s1,0,0,0)
+#define register_param3(p,s0,s1,s2) register_param5(p,s0,s1,s2,0,0)
+#define register_param4(p,s0,s1,s2,s3) register_param5(p,s0,s1,s2,s3,0)
+
+static GLuint frag_to_vert_attrib( GLuint attrib )
+{
+ switch (attrib) {
+ case FRAG_ATTRIB_COL0: return VERT_ATTRIB_COLOR0;
+ case FRAG_ATTRIB_COL1: return VERT_ATTRIB_COLOR1;
+ default:
+ assert(attrib >= FRAG_ATTRIB_TEX0);
+ assert(attrib <= FRAG_ATTRIB_TEX7);
+ return attrib - FRAG_ATTRIB_TEX0 + VERT_ATTRIB_TEX0;
+ }
+}
+
+
+static struct ureg register_input( struct texenv_fragment_program *p, GLuint input )
+{
+ if (p->state->inputs_available & (1<<input)) {
+ p->program->Base.InputsRead |= (1 << input);
+ return make_ureg(PROGRAM_INPUT, input);
+ }
+ else {
+ GLuint idx = frag_to_vert_attrib( input );
+ return register_param3( p, STATE_INTERNAL, STATE_CURRENT_ATTRIB_MAYBE_VP_CLAMPED, idx );
+ }
+}
+
+
+static void emit_arg( struct prog_src_register *reg,
+ struct ureg ureg )
+{
+ reg->File = ureg.file;
+ reg->Index = ureg.idx;
+ reg->Swizzle = ureg.swz;
+ reg->Negate = ureg.negatebase ? NEGATE_XYZW : NEGATE_NONE;
+ reg->Abs = GL_FALSE;
+}
+
+static void emit_dst( struct prog_dst_register *dst,
+ struct ureg ureg, GLuint mask )
+{
+ dst->File = ureg.file;
+ dst->Index = ureg.idx;
+ dst->WriteMask = mask;
+ dst->CondMask = COND_TR; /* always pass cond test */
+ dst->CondSwizzle = SWIZZLE_NOOP;
+}
+
+static struct prog_instruction *
+emit_op(struct texenv_fragment_program *p,
+ enum prog_opcode op,
+ struct ureg dest,
+ GLuint mask,
+ GLboolean saturate,
+ struct ureg src0,
+ struct ureg src1,
+ struct ureg src2 )
+{
+ const GLuint nr = p->program->Base.NumInstructions++;
+ struct prog_instruction *inst = &p->program->Base.Instructions[nr];
+
+ assert(nr < MAX_INSTRUCTIONS);
+
+ _mesa_init_instructions(inst, 1);
+ inst->Opcode = op;
+
+ emit_arg( &inst->SrcReg[0], src0 );
+ emit_arg( &inst->SrcReg[1], src1 );
+ emit_arg( &inst->SrcReg[2], src2 );
+
+ inst->SaturateMode = saturate ? SATURATE_ZERO_ONE : SATURATE_OFF;
+
+ emit_dst( &inst->DstReg, dest, mask );
+
+#if 0
+ /* Accounting for indirection tracking:
+ */
+ if (dest.file == PROGRAM_TEMPORARY)
+ p->temps_output |= 1 << dest.idx;
+#endif
+
+ return inst;
+}
+
+
+static struct ureg emit_arith( struct texenv_fragment_program *p,
+ enum prog_opcode op,
+ struct ureg dest,
+ GLuint mask,
+ GLboolean saturate,
+ struct ureg src0,
+ struct ureg src1,
+ struct ureg src2 )
+{
+ emit_op(p, op, dest, mask, saturate, src0, src1, src2);
+
+ /* Accounting for indirection tracking:
+ */
+ if (src0.file == PROGRAM_TEMPORARY)
+ p->alu_temps |= 1 << src0.idx;
+
+ if (!is_undef(src1) && src1.file == PROGRAM_TEMPORARY)
+ p->alu_temps |= 1 << src1.idx;
+
+ if (!is_undef(src2) && src2.file == PROGRAM_TEMPORARY)
+ p->alu_temps |= 1 << src2.idx;
+
+ if (dest.file == PROGRAM_TEMPORARY)
+ p->alu_temps |= 1 << dest.idx;
+
+ p->program->Base.NumAluInstructions++;
+ return dest;
+}
+
+static struct ureg emit_texld( struct texenv_fragment_program *p,
+ enum prog_opcode op,
+ struct ureg dest,
+ GLuint destmask,
+ GLuint tex_unit,
+ GLuint tex_idx,
+ GLuint tex_shadow,
+ struct ureg coord )
+{
+ struct prog_instruction *inst = emit_op( p, op,
+ dest, destmask,
+ GL_FALSE, /* don't saturate? */
+ coord, /* arg 0? */
+ undef,
+ undef);
+
+ inst->TexSrcTarget = tex_idx;
+ inst->TexSrcUnit = tex_unit;
+ inst->TexShadow = tex_shadow;
+
+ p->program->Base.NumTexInstructions++;
+
+ /* Accounting for indirection tracking:
+ */
+ reserve_temp(p, dest);
+
+#if 0
+ /* Is this a texture indirection?
+ */
+ if ((coord.file == PROGRAM_TEMPORARY &&
+ (p->temps_output & (1<<coord.idx))) ||
+ (dest.file == PROGRAM_TEMPORARY &&
+ (p->alu_temps & (1<<dest.idx)))) {
+ p->program->Base.NumTexIndirections++;
+ p->temps_output = 1<<coord.idx;
+ p->alu_temps = 0;
+ assert(0); /* KW: texture env crossbar */
+ }
+#endif
+
+ return dest;
+}
+
+
+static struct ureg register_const4f( struct texenv_fragment_program *p,
+ GLfloat s0,
+ GLfloat s1,
+ GLfloat s2,
+ GLfloat s3)
+{
+ GLfloat values[4];
+ GLuint idx, swizzle;
+ struct ureg r;
+ values[0] = s0;
+ values[1] = s1;
+ values[2] = s2;
+ values[3] = s3;
+ idx = _mesa_add_unnamed_constant( p->program->Base.Parameters, values, 4,
+ &swizzle );
+ r = make_ureg(PROGRAM_CONSTANT, idx);
+ r.swz = swizzle;
+ return r;
+}
+
+#define register_scalar_const(p, s0) register_const4f(p, s0, s0, s0, s0)
+#define register_const1f(p, s0) register_const4f(p, s0, 0, 0, 1)
+#define register_const2f(p, s0, s1) register_const4f(p, s0, s1, 0, 1)
+#define register_const3f(p, s0, s1, s2) register_const4f(p, s0, s1, s2, 1)
+
+
+static struct ureg get_one( struct texenv_fragment_program *p )
+{
+ if (is_undef(p->one))
+ p->one = register_scalar_const(p, 1.0);
+ return p->one;
+}
+
+static struct ureg get_half( struct texenv_fragment_program *p )
+{
+ if (is_undef(p->half))
+ p->half = register_scalar_const(p, 0.5);
+ return p->half;
+}
+
+static struct ureg get_zero( struct texenv_fragment_program *p )
+{
+ if (is_undef(p->zero))
+ p->zero = register_scalar_const(p, 0.0);
+ return p->zero;
+}
+
+
+static void program_error( struct texenv_fragment_program *p, const char *msg )
+{
+ _mesa_problem(NULL, "%s", msg);
+ p->error = 1;
+}
+
+static struct ureg get_source( struct texenv_fragment_program *p,
+ GLuint src, GLuint unit )
+{
+ switch (src) {
+ case SRC_TEXTURE:
+ assert(!is_undef(p->src_texture[unit]));
+ return p->src_texture[unit];
+
+ case SRC_TEXTURE0:
+ case SRC_TEXTURE1:
+ case SRC_TEXTURE2:
+ case SRC_TEXTURE3:
+ case SRC_TEXTURE4:
+ case SRC_TEXTURE5:
+ case SRC_TEXTURE6:
+ case SRC_TEXTURE7:
+ assert(!is_undef(p->src_texture[src - SRC_TEXTURE0]));
+ return p->src_texture[src - SRC_TEXTURE0];
+
+ case SRC_CONSTANT:
+ return register_param2(p, STATE_TEXENV_COLOR, unit);
+
+ case SRC_PRIMARY_COLOR:
+ return register_input(p, FRAG_ATTRIB_COL0);
+
+ case SRC_ZERO:
+ return get_zero(p);
+
+ case SRC_PREVIOUS:
+ if (is_undef(p->src_previous))
+ return register_input(p, FRAG_ATTRIB_COL0);
+ else
+ return p->src_previous;
+
+ default:
+ assert(0);
+ return undef;
+ }
+}
+
+static struct ureg emit_combine_source( struct texenv_fragment_program *p,
+ GLuint mask,
+ GLuint unit,
+ GLuint source,
+ GLuint operand )
+{
+ struct ureg arg, src, one;
+
+ src = get_source(p, source, unit);
+
+ switch (operand) {
+ case OPR_ONE_MINUS_SRC_COLOR:
+ /* Get unused tmp,
+ * Emit tmp = 1.0 - arg.xyzw
+ */
+ arg = get_temp( p );
+ one = get_one( p );
+ return emit_arith( p, OPCODE_SUB, arg, mask, 0, one, src, undef);
+
+ case OPR_SRC_ALPHA:
+ if (mask == WRITEMASK_W)
+ return src;
+ else
+ return swizzle1( src, SWIZZLE_W );
+ case OPR_ONE_MINUS_SRC_ALPHA:
+ /* Get unused tmp,
+ * Emit tmp = 1.0 - arg.wwww
+ */
+ arg = get_temp(p);
+ one = get_one(p);
+ return emit_arith(p, OPCODE_SUB, arg, mask, 0,
+ one, swizzle1(src, SWIZZLE_W), undef);
+ case OPR_ZERO:
+ return get_zero(p);
+ case OPR_ONE:
+ return get_one(p);
+ case OPR_SRC_COLOR:
+ return src;
+ default:
+ assert(0);
+ return src;
+ }
+}
+
+/**
+ * Check if the RGB and Alpha sources and operands match for the given
+ * texture unit's combinder state. When the RGB and A sources and
+ * operands match, we can emit fewer instructions.
+ */
+static GLboolean args_match( const struct state_key *key, GLuint unit )
+{
+ GLuint i, numArgs = key->unit[unit].NumArgsRGB;
+
+ for (i = 0; i < numArgs; i++) {
+ if (key->unit[unit].OptA[i].Source != key->unit[unit].OptRGB[i].Source)
+ return GL_FALSE;
+
+ switch (key->unit[unit].OptA[i].Operand) {
+ case OPR_SRC_ALPHA:
+ switch (key->unit[unit].OptRGB[i].Operand) {
+ case OPR_SRC_COLOR:
+ case OPR_SRC_ALPHA:
+ break;
+ default:
+ return GL_FALSE;
+ }
+ break;
+ case OPR_ONE_MINUS_SRC_ALPHA:
+ switch (key->unit[unit].OptRGB[i].Operand) {
+ case OPR_ONE_MINUS_SRC_COLOR:
+ case OPR_ONE_MINUS_SRC_ALPHA:
+ break;
+ default:
+ return GL_FALSE;
+ }
+ break;
+ default:
+ return GL_FALSE; /* impossible */
+ }
+ }
+
+ return GL_TRUE;
+}
+
+static struct ureg emit_combine( struct texenv_fragment_program *p,
+ struct ureg dest,
+ GLuint mask,
+ GLboolean saturate,
+ GLuint unit,
+ GLuint nr,
+ GLuint mode,
+ const struct mode_opt *opt)
+{
+ struct ureg src[MAX_COMBINER_TERMS];
+ struct ureg tmp, half;
+ GLuint i;
+
+ assert(nr <= MAX_COMBINER_TERMS);
+
+ for (i = 0; i < nr; i++)
+ src[i] = emit_combine_source( p, mask, unit, opt[i].Source, opt[i].Operand );
+
+ switch (mode) {
+ case MODE_REPLACE:
+ if (mask == WRITEMASK_XYZW && !saturate)
+ return src[0];
+ else
+ return emit_arith( p, OPCODE_MOV, dest, mask, saturate, src[0], undef, undef );
+ case MODE_MODULATE:
+ return emit_arith( p, OPCODE_MUL, dest, mask, saturate,
+ src[0], src[1], undef );
+ case MODE_ADD:
+ return emit_arith( p, OPCODE_ADD, dest, mask, saturate,
+ src[0], src[1], undef );
+ case MODE_ADD_SIGNED:
+ /* tmp = arg0 + arg1
+ * result = tmp - .5
+ */
+ half = get_half(p);
+ tmp = get_temp( p );
+ emit_arith( p, OPCODE_ADD, tmp, mask, 0, src[0], src[1], undef );
+ emit_arith( p, OPCODE_SUB, dest, mask, saturate, tmp, half, undef );
+ return dest;
+ case MODE_INTERPOLATE:
+ /* Arg0 * (Arg2) + Arg1 * (1-Arg2) -- note arguments are reordered:
+ */
+ return emit_arith( p, OPCODE_LRP, dest, mask, saturate, src[2], src[0], src[1] );
+
+ case MODE_SUBTRACT:
+ return emit_arith( p, OPCODE_SUB, dest, mask, saturate, src[0], src[1], undef );
+
+ case MODE_DOT3_RGBA:
+ case MODE_DOT3_RGBA_EXT:
+ case MODE_DOT3_RGB_EXT:
+ case MODE_DOT3_RGB: {
+ struct ureg tmp0 = get_temp( p );
+ struct ureg tmp1 = get_temp( p );
+ struct ureg neg1 = register_scalar_const(p, -1);
+ struct ureg two = register_scalar_const(p, 2);
+
+ /* tmp0 = 2*src0 - 1
+ * tmp1 = 2*src1 - 1
+ *
+ * dst = tmp0 dot3 tmp1
+ */
+ emit_arith( p, OPCODE_MAD, tmp0, WRITEMASK_XYZW, 0,
+ two, src[0], neg1);
+
+ if (memcmp(&src[0], &src[1], sizeof(struct ureg)) == 0)
+ tmp1 = tmp0;
+ else
+ emit_arith( p, OPCODE_MAD, tmp1, WRITEMASK_XYZW, 0,
+ two, src[1], neg1);
+ emit_arith( p, OPCODE_DP3, dest, mask, saturate, tmp0, tmp1, undef);
+ return dest;
+ }
+ case MODE_MODULATE_ADD_ATI:
+ /* Arg0 * Arg2 + Arg1 */
+ return emit_arith( p, OPCODE_MAD, dest, mask, saturate,
+ src[0], src[2], src[1] );
+ case MODE_MODULATE_SIGNED_ADD_ATI: {
+ /* Arg0 * Arg2 + Arg1 - 0.5 */
+ struct ureg tmp0 = get_temp(p);
+ half = get_half(p);
+ emit_arith( p, OPCODE_MAD, tmp0, mask, 0, src[0], src[2], src[1] );
+ emit_arith( p, OPCODE_SUB, dest, mask, saturate, tmp0, half, undef );
+ return dest;
+ }
+ case MODE_MODULATE_SUBTRACT_ATI:
+ /* Arg0 * Arg2 - Arg1 */
+ emit_arith( p, OPCODE_MAD, dest, mask, 0, src[0], src[2], negate(src[1]) );
+ return dest;
+ case MODE_ADD_PRODUCTS:
+ /* Arg0 * Arg1 + Arg2 * Arg3 */
+ {
+ struct ureg tmp0 = get_temp(p);
+ emit_arith( p, OPCODE_MUL, tmp0, mask, 0, src[0], src[1], undef );
+ emit_arith( p, OPCODE_MAD, dest, mask, saturate, src[2], src[3], tmp0 );
+ }
+ return dest;
+ case MODE_ADD_PRODUCTS_SIGNED:
+ /* Arg0 * Arg1 + Arg2 * Arg3 - 0.5 */
+ {
+ struct ureg tmp0 = get_temp(p);
+ half = get_half(p);
+ emit_arith( p, OPCODE_MUL, tmp0, mask, 0, src[0], src[1], undef );
+ emit_arith( p, OPCODE_MAD, tmp0, mask, 0, src[2], src[3], tmp0 );
+ emit_arith( p, OPCODE_SUB, dest, mask, saturate, tmp0, half, undef );
+ }
+ return dest;
+ case MODE_BUMP_ENVMAP_ATI:
+ /* special - not handled here */
+ assert(0);
+ return src[0];
+ default:
+ assert(0);
+ return src[0];
+ }
+}
+
+
+/**
+ * Generate instructions for one texture unit's env/combiner mode.
+ */
+static struct ureg
+emit_texenv(struct texenv_fragment_program *p, GLuint unit)
+{
+ const struct state_key *key = p->state;
+ GLboolean rgb_saturate, alpha_saturate;
+ GLuint rgb_shift, alpha_shift;
+ struct ureg out, dest;
+
+ if (!key->unit[unit].enabled) {
+ return get_source(p, SRC_PREVIOUS, 0);
+ }
+ if (key->unit[unit].ModeRGB == MODE_BUMP_ENVMAP_ATI) {
+ /* this isn't really a env stage delivering a color and handled elsewhere */
+ return get_source(p, SRC_PREVIOUS, 0);
+ }
+
+ switch (key->unit[unit].ModeRGB) {
+ case MODE_DOT3_RGB_EXT:
+ alpha_shift = key->unit[unit].ScaleShiftA;
+ rgb_shift = 0;
+ break;
+ case MODE_DOT3_RGBA_EXT:
+ alpha_shift = 0;
+ rgb_shift = 0;
+ break;
+ default:
+ rgb_shift = key->unit[unit].ScaleShiftRGB;
+ alpha_shift = key->unit[unit].ScaleShiftA;
+ break;
+ }
+
+ /* If we'll do rgb/alpha shifting don't saturate in emit_combine().
+ * We don't want to clamp twice.
+ */
+ if (rgb_shift)
+ rgb_saturate = GL_FALSE; /* saturate after rgb shift */
+ else if (need_saturate(key->unit[unit].ModeRGB))
+ rgb_saturate = GL_TRUE;
+ else
+ rgb_saturate = GL_FALSE;
+
+ if (alpha_shift)
+ alpha_saturate = GL_FALSE; /* saturate after alpha shift */
+ else if (need_saturate(key->unit[unit].ModeA))
+ alpha_saturate = GL_TRUE;
+ else
+ alpha_saturate = GL_FALSE;
+
+ /* If this is the very last calculation (and various other conditions
+ * are met), emit directly to the color output register. Otherwise,
+ * emit to a temporary register.
+ */
+ if (key->separate_specular ||
+ unit != p->last_tex_stage ||
+ alpha_shift ||
+ key->num_draw_buffers != 1 ||
+ rgb_shift)
+ dest = get_temp( p );
+ else
+ dest = make_ureg(PROGRAM_OUTPUT, FRAG_RESULT_COLOR);
+
+ /* Emit the RGB and A combine ops
+ */
+ if (key->unit[unit].ModeRGB == key->unit[unit].ModeA &&
+ args_match(key, unit)) {
+ out = emit_combine( p, dest, WRITEMASK_XYZW, rgb_saturate,
+ unit,
+ key->unit[unit].NumArgsRGB,
+ key->unit[unit].ModeRGB,
+ key->unit[unit].OptRGB);
+ }
+ else if (key->unit[unit].ModeRGB == MODE_DOT3_RGBA_EXT ||
+ key->unit[unit].ModeRGB == MODE_DOT3_RGBA) {
+ out = emit_combine( p, dest, WRITEMASK_XYZW, rgb_saturate,
+ unit,
+ key->unit[unit].NumArgsRGB,
+ key->unit[unit].ModeRGB,
+ key->unit[unit].OptRGB);
+ }
+ else {
+ /* Need to do something to stop from re-emitting identical
+ * argument calculations here:
+ */
+ out = emit_combine( p, dest, WRITEMASK_XYZ, rgb_saturate,
+ unit,
+ key->unit[unit].NumArgsRGB,
+ key->unit[unit].ModeRGB,
+ key->unit[unit].OptRGB);
+ out = emit_combine( p, dest, WRITEMASK_W, alpha_saturate,
+ unit,
+ key->unit[unit].NumArgsA,
+ key->unit[unit].ModeA,
+ key->unit[unit].OptA);
+ }
+
+ /* Deal with the final shift:
+ */
+ if (alpha_shift || rgb_shift) {
+ struct ureg shift;
+ GLboolean saturate = GL_TRUE; /* always saturate at this point */
+
+ if (rgb_shift == alpha_shift) {
+ shift = register_scalar_const(p, (GLfloat)(1<<rgb_shift));
+ }
+ else {
+ shift = register_const4f(p,
+ (GLfloat)(1<<rgb_shift),
+ (GLfloat)(1<<rgb_shift),
+ (GLfloat)(1<<rgb_shift),
+ (GLfloat)(1<<alpha_shift));
+ }
+ return emit_arith( p, OPCODE_MUL, dest, WRITEMASK_XYZW,
+ saturate, out, shift, undef );
+ }
+ else
+ return out;
+}
+
+
+/**
+ * Generate instruction for getting a texture source term.
+ */
+static void load_texture( struct texenv_fragment_program *p, GLuint unit )
+{
+ if (is_undef(p->src_texture[unit])) {
+ const GLuint texTarget = p->state->unit[unit].source_index;
+ struct ureg texcoord;
+ struct ureg tmp = get_tex_temp( p );
+
+ if (is_undef(p->texcoord_tex[unit])) {
+ texcoord = register_input(p, FRAG_ATTRIB_TEX0+unit);
+ }
+ else {
+ /* might want to reuse this reg for tex output actually */
+ texcoord = p->texcoord_tex[unit];
+ }
+
+ /* TODO: Use D0_MASK_XY where possible.
+ */
+ if (p->state->unit[unit].enabled) {
+ GLboolean shadow = GL_FALSE;
+
+ if (p->state->unit[unit].shadow) {
+ p->program->Base.ShadowSamplers |= 1 << unit;
+ shadow = GL_TRUE;
+ }
+
+ p->src_texture[unit] = emit_texld( p, OPCODE_TXP,
+ tmp, WRITEMASK_XYZW,
+ unit, texTarget, shadow,
+ texcoord );
+
+ p->program->Base.SamplersUsed |= (1 << unit);
+ /* This identity mapping should already be in place
+ * (see _mesa_init_program_struct()) but let's be safe.
+ */
+ p->program->Base.SamplerUnits[unit] = unit;
+ }
+ else
+ p->src_texture[unit] = get_zero(p);
+
+ if (p->state->unit[unit].texture_cyl_wrap) {
+ /* set flag which is checked by Mesa->Gallium program translation */
+ p->program->Base.InputFlags[0] |= PROG_PARAM_BIT_CYL_WRAP;
+ }
+
+ }
+}
+
+static GLboolean load_texenv_source( struct texenv_fragment_program *p,
+ GLuint src, GLuint unit )
+{
+ switch (src) {
+ case SRC_TEXTURE:
+ load_texture(p, unit);
+ break;
+
+ case SRC_TEXTURE0:
+ case SRC_TEXTURE1:
+ case SRC_TEXTURE2:
+ case SRC_TEXTURE3:
+ case SRC_TEXTURE4:
+ case SRC_TEXTURE5:
+ case SRC_TEXTURE6:
+ case SRC_TEXTURE7:
+ load_texture(p, src - SRC_TEXTURE0);
+ break;
+
+ default:
+ /* not a texture src - do nothing */
+ break;
+ }
+
+ return GL_TRUE;
+}
+
+
+/**
+ * Generate instructions for loading all texture source terms.
+ */
+static GLboolean
+load_texunit_sources( struct texenv_fragment_program *p, GLuint unit )
+{
+ const struct state_key *key = p->state;
+ GLuint i;
+
+ for (i = 0; i < key->unit[unit].NumArgsRGB; i++) {
+ load_texenv_source( p, key->unit[unit].OptRGB[i].Source, unit );
+ }
+
+ for (i = 0; i < key->unit[unit].NumArgsA; i++) {
+ load_texenv_source( p, key->unit[unit].OptA[i].Source, unit );
+ }
+
+ return GL_TRUE;
+}
+
+/**
+ * Generate instructions for loading bump map textures.
+ */
+static GLboolean
+load_texunit_bumpmap( struct texenv_fragment_program *p, GLuint unit )
+{
+ const struct state_key *key = p->state;
+ GLuint bumpedUnitNr = key->unit[unit].OptRGB[1].Source - SRC_TEXTURE0;
+ struct ureg texcDst, bumpMapRes;
+ struct ureg constdudvcolor = register_const4f(p, 0.0, 0.0, 0.0, 1.0);
+ struct ureg texcSrc = register_input(p, FRAG_ATTRIB_TEX0 + bumpedUnitNr);
+ struct ureg rotMat0 = register_param3( p, STATE_INTERNAL, STATE_ROT_MATRIX_0, unit );
+ struct ureg rotMat1 = register_param3( p, STATE_INTERNAL, STATE_ROT_MATRIX_1, unit );
+
+ load_texenv_source( p, unit + SRC_TEXTURE0, unit );
+
+ bumpMapRes = get_source(p, key->unit[unit].OptRGB[0].Source, unit);
+ texcDst = get_tex_temp( p );
+ p->texcoord_tex[bumpedUnitNr] = texcDst;
+
+ /* Apply rot matrix and add coords to be available in next phase.
+ * dest = (Arg0.xxxx * rotMat0 + Arg1) + (Arg0.yyyy * rotMat1)
+ * note only 2 coords are affected the rest are left unchanged (mul by 0)
+ */
+ emit_arith( p, OPCODE_MAD, texcDst, WRITEMASK_XYZW, 0,
+ swizzle1(bumpMapRes, SWIZZLE_X), rotMat0, texcSrc );
+ emit_arith( p, OPCODE_MAD, texcDst, WRITEMASK_XYZW, 0,
+ swizzle1(bumpMapRes, SWIZZLE_Y), rotMat1, texcDst );
+
+ /* Move 0,0,0,1 into bumpmap src if someone (crossbar) is foolish
+ * enough to access this later, should optimize away.
+ */
+ emit_arith( p, OPCODE_MOV, bumpMapRes, WRITEMASK_XYZW, 0,
+ constdudvcolor, undef, undef );
+
+ return GL_TRUE;
+}
+
+/**
+ * Generate a new fragment program which implements the context's
+ * current texture env/combine mode.
+ */
+static void
+create_new_program(struct gl_context *ctx, struct state_key *key,
+ struct gl_fragment_program *program)
+{
+ struct prog_instruction instBuffer[MAX_INSTRUCTIONS];
+ struct texenv_fragment_program p;
+ GLuint unit;
+ struct ureg cf, out;
+ int i;
+
+ memset(&p, 0, sizeof(p));
+ p.state = key;
+ p.program = program;
+
+ /* During code generation, use locally-allocated instruction buffer,
+ * then alloc dynamic storage below.
+ */
+ p.program->Base.Instructions = instBuffer;
+ p.program->Base.Target = GL_FRAGMENT_PROGRAM_ARB;
+ p.program->Base.String = NULL;
+ p.program->Base.NumTexIndirections = 1; /* is this right? */
+ p.program->Base.NumTexInstructions = 0;
+ p.program->Base.NumAluInstructions = 0;
+ p.program->Base.NumInstructions = 0;
+ p.program->Base.NumTemporaries = 0;
+ p.program->Base.NumParameters = 0;
+ p.program->Base.NumAttributes = 0;
+ p.program->Base.NumAddressRegs = 0;
+ p.program->Base.Parameters = _mesa_new_parameter_list();
+ p.program->Base.InputsRead = 0x0;
+
+ if (key->num_draw_buffers == 1)
+ p.program->Base.OutputsWritten = 1 << FRAG_RESULT_COLOR;
+ else {
+ for (i = 0; i < key->num_draw_buffers; i++)
+ p.program->Base.OutputsWritten |= (1 << (FRAG_RESULT_DATA0 + i));
+ }
+
+ for (unit = 0; unit < ctx->Const.MaxTextureUnits; unit++) {
+ p.src_texture[unit] = undef;
+ p.texcoord_tex[unit] = undef;
+ }
+
+ p.src_previous = undef;
+ p.half = undef;
+ p.zero = undef;
+ p.one = undef;
+
+ p.last_tex_stage = 0;
+ release_temps(ctx, &p);
+
+ if (key->enabled_units && key->num_draw_buffers) {
+ GLboolean needbumpstage = GL_FALSE;
+
+ /* Zeroth pass - bump map textures first */
+ for (unit = 0; unit < key->nr_enabled_units; unit++)
+ if (key->unit[unit].enabled &&
+ key->unit[unit].ModeRGB == MODE_BUMP_ENVMAP_ATI) {
+ needbumpstage = GL_TRUE;
+ load_texunit_bumpmap( &p, unit );
+ }
+ if (needbumpstage)
+ p.program->Base.NumTexIndirections++;
+
+ /* First pass - to support texture_env_crossbar, first identify
+ * all referenced texture sources and emit texld instructions
+ * for each:
+ */
+ for (unit = 0; unit < key->nr_enabled_units; unit++)
+ if (key->unit[unit].enabled) {
+ load_texunit_sources( &p, unit );
+ p.last_tex_stage = unit;
+ }
+
+ /* Second pass - emit combine instructions to build final color:
+ */
+ for (unit = 0; unit < key->nr_enabled_units; unit++)
+ if (key->unit[unit].enabled) {
+ p.src_previous = emit_texenv( &p, unit );
+ reserve_temp(&p, p.src_previous); /* don't re-use this temp reg */
+ release_temps(ctx, &p); /* release all temps */
+ }
+ }
+
+ cf = get_source( &p, SRC_PREVIOUS, 0 );
+
+ for (i = 0; i < key->num_draw_buffers; i++) {
+ if (key->num_draw_buffers == 1)
+ out = make_ureg( PROGRAM_OUTPUT, FRAG_RESULT_COLOR );
+ else {
+ out = make_ureg( PROGRAM_OUTPUT, FRAG_RESULT_DATA0 + i );
+ }
+
+ if (key->separate_specular) {
+ /* Emit specular add.
+ */
+ struct ureg s = register_input(&p, FRAG_ATTRIB_COL1);
+ emit_arith( &p, OPCODE_ADD, out, WRITEMASK_XYZ, 0, cf, s, undef );
+ emit_arith( &p, OPCODE_MOV, out, WRITEMASK_W, 0, cf, undef, undef );
+ }
+ else if (memcmp(&cf, &out, sizeof(cf)) != 0) {
+ /* Will wind up in here if no texture enabled or a couple of
+ * other scenarios (GL_REPLACE for instance).
+ */
+ emit_arith( &p, OPCODE_MOV, out, WRITEMASK_XYZW, 0, cf, undef, undef );
+ }
+ }
+ /* Finish up:
+ */
+ emit_arith( &p, OPCODE_END, undef, WRITEMASK_XYZW, 0, undef, undef, undef);
+
+ /* Allocate final instruction array. This has to be done before calling
+ * _mesa_append_fog_code because that function frees the Base.Instructions.
+ * At this point, Base.Instructions points to stack data, so it's a really
+ * bad idea to free it.
+ */
+ p.program->Base.Instructions
+ = _mesa_alloc_instructions(p.program->Base.NumInstructions);
+ if (!p.program->Base.Instructions) {
+ _mesa_error(ctx, GL_OUT_OF_MEMORY,
+ "generating tex env program");
+ return;
+ }
+ _mesa_copy_instructions(p.program->Base.Instructions, instBuffer,
+ p.program->Base.NumInstructions);
+
+ /* Append fog code. This must be done before checking the program against
+ * the limits becuase it will potentially add some instructions.
+ */
+ if (key->fog_enabled) {
+ _mesa_append_fog_code(ctx, p.program, ctx->Fog.Mode, GL_FALSE);
+ }
+
+ if (p.program->Base.NumTexIndirections > ctx->Const.FragmentProgram.MaxTexIndirections)
+ program_error(&p, "Exceeded max nr indirect texture lookups");
+
+ if (p.program->Base.NumTexInstructions > ctx->Const.FragmentProgram.MaxTexInstructions)
+ program_error(&p, "Exceeded max TEX instructions");
+
+ if (p.program->Base.NumAluInstructions > ctx->Const.FragmentProgram.MaxAluInstructions)
+ program_error(&p, "Exceeded max ALU instructions");
+
+ ASSERT(p.program->Base.NumInstructions <= MAX_INSTRUCTIONS);
+
+ /* Notify driver the fragment program has (actually) changed.
+ */
+ if (ctx->Driver.ProgramStringNotify) {
+ GLboolean ok = ctx->Driver.ProgramStringNotify(ctx,
+ GL_FRAGMENT_PROGRAM_ARB,
+ &p.program->Base);
+ /* Driver should be able to handle any texenv programs as long as
+ * the driver correctly reported max number of texture units correctly,
+ * etc.
+ */
+ ASSERT(ok);
+ (void) ok; /* silence unused var warning */
+ }
+
+ if (DISASSEM) {
+ _mesa_print_program(&p.program->Base);
+ printf("\n");
+ }
+}
+
+extern "C" {
+
+/**
+ * Return a fragment program which implements the current
+ * fixed-function texture, fog and color-sum operations.
+ */
+struct gl_fragment_program *
+_mesa_get_fixed_func_fragment_program(struct gl_context *ctx)
+{
+ struct gl_fragment_program *prog;
+ struct state_key key;
+ GLuint keySize;
+
+ keySize = make_state_key(ctx, &key);
+
+ prog = (struct gl_fragment_program *)
+ _mesa_search_program_cache(ctx->FragmentProgram.Cache,
+ &key, keySize);
+
+ if (!prog) {
+ prog = (struct gl_fragment_program *)
+ ctx->Driver.NewProgram(ctx, GL_FRAGMENT_PROGRAM_ARB, 0);
+
+ create_new_program(ctx, &key, prog);
+
+ _mesa_program_cache_insert(ctx, ctx->FragmentProgram.Cache,
+ &key, keySize, &prog->Base);
+ }
+
+ return prog;
+}
+
+}
diff --git a/mesalib/src/mesa/main/fog.c b/mesalib/src/mesa/main/fog.c
index 88aa31a7f..cc3c9d12f 100644
--- a/mesalib/src/mesa/main/fog.c
+++ b/mesalib/src/mesa/main/fog.c
@@ -1,204 +1,204 @@
-/*
- * Mesa 3-D graphics library
- * Version: 5.1
- *
- * Copyright (C) 1999-2003 Brian Paul All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-
-#include "glheader.h"
-#include "colormac.h"
-#include "context.h"
-#include "fog.h"
-#include "macros.h"
-#include "mtypes.h"
-
-
-
-void GLAPIENTRY
-_mesa_Fogf(GLenum pname, GLfloat param)
-{
- GLfloat fparam[4];
- fparam[0] = param;
- fparam[1] = fparam[2] = fparam[3] = 0.0F;
- _mesa_Fogfv(pname, fparam);
-}
-
-
-void GLAPIENTRY
-_mesa_Fogi(GLenum pname, GLint param )
-{
- GLfloat fparam[4];
- fparam[0] = (GLfloat) param;
- fparam[1] = fparam[2] = fparam[3] = 0.0F;
- _mesa_Fogfv(pname, fparam);
-}
-
-
-void GLAPIENTRY
-_mesa_Fogiv(GLenum pname, const GLint *params )
-{
- GLfloat p[4];
- switch (pname) {
- case GL_FOG_MODE:
- case GL_FOG_DENSITY:
- case GL_FOG_START:
- case GL_FOG_END:
- case GL_FOG_INDEX:
- case GL_FOG_COORDINATE_SOURCE_EXT:
- p[0] = (GLfloat) *params;
- break;
- case GL_FOG_COLOR:
- p[0] = INT_TO_FLOAT( params[0] );
- p[1] = INT_TO_FLOAT( params[1] );
- p[2] = INT_TO_FLOAT( params[2] );
- p[3] = INT_TO_FLOAT( params[3] );
- break;
- default:
- /* Error will be caught later in _mesa_Fogfv */
- ASSIGN_4V(p, 0.0F, 0.0F, 0.0F, 0.0F);
- }
- _mesa_Fogfv(pname, p);
-}
-
-
-/**
- * Update the gl_fog_attrib::_Scale field.
- */
-static void
-update_fog_scale(struct gl_context *ctx)
-{
- if (ctx->Fog.End == ctx->Fog.Start)
- ctx->Fog._Scale = 1.0f;
- else
- ctx->Fog._Scale = 1.0f / (ctx->Fog.End - ctx->Fog.Start);
-}
-
-
-void GLAPIENTRY
-_mesa_Fogfv( GLenum pname, const GLfloat *params )
-{
- GET_CURRENT_CONTEXT(ctx);
- GLenum m;
- ASSERT_OUTSIDE_BEGIN_END(ctx);
-
- switch (pname) {
- case GL_FOG_MODE:
- m = (GLenum) (GLint) *params;
- switch (m) {
- case GL_LINEAR:
- case GL_EXP:
- case GL_EXP2:
- break;
- default:
- _mesa_error( ctx, GL_INVALID_ENUM, "glFog" );
- return;
- }
- if (ctx->Fog.Mode == m)
- return;
- FLUSH_VERTICES(ctx, _NEW_FOG);
- ctx->Fog.Mode = m;
- break;
- case GL_FOG_DENSITY:
- if (*params<0.0) {
- _mesa_error( ctx, GL_INVALID_VALUE, "glFog" );
- return;
- }
- if (ctx->Fog.Density == *params)
- return;
- FLUSH_VERTICES(ctx, _NEW_FOG);
- ctx->Fog.Density = *params;
- break;
- case GL_FOG_START:
- if (ctx->Fog.Start == *params)
- return;
- FLUSH_VERTICES(ctx, _NEW_FOG);
- ctx->Fog.Start = *params;
- update_fog_scale(ctx);
- break;
- case GL_FOG_END:
- if (ctx->Fog.End == *params)
- return;
- FLUSH_VERTICES(ctx, _NEW_FOG);
- ctx->Fog.End = *params;
- update_fog_scale(ctx);
- break;
- case GL_FOG_INDEX:
- if (ctx->Fog.Index == *params)
- return;
- FLUSH_VERTICES(ctx, _NEW_FOG);
- ctx->Fog.Index = *params;
- break;
- case GL_FOG_COLOR:
- if (TEST_EQ_4V(ctx->Fog.Color, params))
- return;
- FLUSH_VERTICES(ctx, _NEW_FOG);
- ctx->Fog.ColorUnclamped[0] = params[0];
- ctx->Fog.ColorUnclamped[1] = params[1];
- ctx->Fog.ColorUnclamped[2] = params[2];
- ctx->Fog.ColorUnclamped[3] = params[3];
- ctx->Fog.Color[0] = CLAMP(params[0], 0.0F, 1.0F);
- ctx->Fog.Color[1] = CLAMP(params[1], 0.0F, 1.0F);
- ctx->Fog.Color[2] = CLAMP(params[2], 0.0F, 1.0F);
- ctx->Fog.Color[3] = CLAMP(params[3], 0.0F, 1.0F);
- break;
- case GL_FOG_COORDINATE_SOURCE_EXT: {
- GLenum p = (GLenum) (GLint) *params;
- if (!ctx->Extensions.EXT_fog_coord ||
- (p != GL_FOG_COORDINATE_EXT && p != GL_FRAGMENT_DEPTH_EXT)) {
- _mesa_error(ctx, GL_INVALID_ENUM, "glFog");
- return;
- }
- if (ctx->Fog.FogCoordinateSource == p)
- return;
- FLUSH_VERTICES(ctx, _NEW_FOG);
- ctx->Fog.FogCoordinateSource = p;
- break;
- }
- default:
- _mesa_error( ctx, GL_INVALID_ENUM, "glFog" );
- return;
- }
-
- if (ctx->Driver.Fogfv) {
- (*ctx->Driver.Fogfv)( ctx, pname, params );
- }
-}
-
-
-/**********************************************************************/
-/***** Initialization *****/
-/**********************************************************************/
-
-void _mesa_init_fog( struct gl_context * ctx )
-{
- /* Fog group */
- ctx->Fog.Enabled = GL_FALSE;
- ctx->Fog.Mode = GL_EXP;
- ASSIGN_4V( ctx->Fog.Color, 0.0, 0.0, 0.0, 0.0 );
- ASSIGN_4V( ctx->Fog.ColorUnclamped, 0.0, 0.0, 0.0, 0.0 );
- ctx->Fog.Index = 0.0;
- ctx->Fog.Density = 1.0;
- ctx->Fog.Start = 0.0;
- ctx->Fog.End = 1.0;
- ctx->Fog.ColorSumEnabled = GL_FALSE;
- ctx->Fog.FogCoordinateSource = GL_FRAGMENT_DEPTH_EXT;
- ctx->Fog._Scale = 1.0f;
-}
+/*
+ * Mesa 3-D graphics library
+ * Version: 5.1
+ *
+ * Copyright (C) 1999-2003 Brian Paul All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+
+#include "glheader.h"
+#include "colormac.h"
+#include "context.h"
+#include "fog.h"
+#include "macros.h"
+#include "mtypes.h"
+
+
+
+void GLAPIENTRY
+_mesa_Fogf(GLenum pname, GLfloat param)
+{
+ GLfloat fparam[4];
+ fparam[0] = param;
+ fparam[1] = fparam[2] = fparam[3] = 0.0F;
+ _mesa_Fogfv(pname, fparam);
+}
+
+
+void GLAPIENTRY
+_mesa_Fogi(GLenum pname, GLint param )
+{
+ GLfloat fparam[4];
+ fparam[0] = (GLfloat) param;
+ fparam[1] = fparam[2] = fparam[3] = 0.0F;
+ _mesa_Fogfv(pname, fparam);
+}
+
+
+void GLAPIENTRY
+_mesa_Fogiv(GLenum pname, const GLint *params )
+{
+ GLfloat p[4];
+ switch (pname) {
+ case GL_FOG_MODE:
+ case GL_FOG_DENSITY:
+ case GL_FOG_START:
+ case GL_FOG_END:
+ case GL_FOG_INDEX:
+ case GL_FOG_COORDINATE_SOURCE_EXT:
+ p[0] = (GLfloat) *params;
+ break;
+ case GL_FOG_COLOR:
+ p[0] = INT_TO_FLOAT( params[0] );
+ p[1] = INT_TO_FLOAT( params[1] );
+ p[2] = INT_TO_FLOAT( params[2] );
+ p[3] = INT_TO_FLOAT( params[3] );
+ break;
+ default:
+ /* Error will be caught later in _mesa_Fogfv */
+ ASSIGN_4V(p, 0.0F, 0.0F, 0.0F, 0.0F);
+ }
+ _mesa_Fogfv(pname, p);
+}
+
+
+/**
+ * Update the gl_fog_attrib::_Scale field.
+ */
+static void
+update_fog_scale(struct gl_context *ctx)
+{
+ if (ctx->Fog.End == ctx->Fog.Start)
+ ctx->Fog._Scale = 1.0f;
+ else
+ ctx->Fog._Scale = 1.0f / (ctx->Fog.End - ctx->Fog.Start);
+}
+
+
+void GLAPIENTRY
+_mesa_Fogfv( GLenum pname, const GLfloat *params )
+{
+ GET_CURRENT_CONTEXT(ctx);
+ GLenum m;
+ ASSERT_OUTSIDE_BEGIN_END(ctx);
+
+ switch (pname) {
+ case GL_FOG_MODE:
+ m = (GLenum) (GLint) *params;
+ switch (m) {
+ case GL_LINEAR:
+ case GL_EXP:
+ case GL_EXP2:
+ break;
+ default:
+ _mesa_error( ctx, GL_INVALID_ENUM, "glFog" );
+ return;
+ }
+ if (ctx->Fog.Mode == m)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_FOG);
+ ctx->Fog.Mode = m;
+ break;
+ case GL_FOG_DENSITY:
+ if (*params<0.0) {
+ _mesa_error( ctx, GL_INVALID_VALUE, "glFog" );
+ return;
+ }
+ if (ctx->Fog.Density == *params)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_FOG);
+ ctx->Fog.Density = *params;
+ break;
+ case GL_FOG_START:
+ if (ctx->Fog.Start == *params)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_FOG);
+ ctx->Fog.Start = *params;
+ update_fog_scale(ctx);
+ break;
+ case GL_FOG_END:
+ if (ctx->Fog.End == *params)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_FOG);
+ ctx->Fog.End = *params;
+ update_fog_scale(ctx);
+ break;
+ case GL_FOG_INDEX:
+ if (ctx->Fog.Index == *params)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_FOG);
+ ctx->Fog.Index = *params;
+ break;
+ case GL_FOG_COLOR:
+ if (TEST_EQ_4V(ctx->Fog.Color, params))
+ return;
+ FLUSH_VERTICES(ctx, _NEW_FOG);
+ ctx->Fog.ColorUnclamped[0] = params[0];
+ ctx->Fog.ColorUnclamped[1] = params[1];
+ ctx->Fog.ColorUnclamped[2] = params[2];
+ ctx->Fog.ColorUnclamped[3] = params[3];
+ ctx->Fog.Color[0] = CLAMP(params[0], 0.0F, 1.0F);
+ ctx->Fog.Color[1] = CLAMP(params[1], 0.0F, 1.0F);
+ ctx->Fog.Color[2] = CLAMP(params[2], 0.0F, 1.0F);
+ ctx->Fog.Color[3] = CLAMP(params[3], 0.0F, 1.0F);
+ break;
+ case GL_FOG_COORDINATE_SOURCE_EXT: {
+ GLenum p = (GLenum) (GLint) *params;
+ if (!ctx->Extensions.EXT_fog_coord ||
+ (p != GL_FOG_COORDINATE_EXT && p != GL_FRAGMENT_DEPTH_EXT)) {
+ _mesa_error(ctx, GL_INVALID_ENUM, "glFog");
+ return;
+ }
+ if (ctx->Fog.FogCoordinateSource == p)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_FOG);
+ ctx->Fog.FogCoordinateSource = p;
+ break;
+ }
+ default:
+ _mesa_error( ctx, GL_INVALID_ENUM, "glFog" );
+ return;
+ }
+
+ if (ctx->Driver.Fogfv) {
+ (*ctx->Driver.Fogfv)( ctx, pname, params );
+ }
+}
+
+
+/**********************************************************************/
+/***** Initialization *****/
+/**********************************************************************/
+
+void _mesa_init_fog( struct gl_context * ctx )
+{
+ /* Fog group */
+ ctx->Fog.Enabled = GL_FALSE;
+ ctx->Fog.Mode = GL_EXP;
+ ASSIGN_4V( ctx->Fog.Color, 0.0, 0.0, 0.0, 0.0 );
+ ASSIGN_4V( ctx->Fog.ColorUnclamped, 0.0, 0.0, 0.0, 0.0 );
+ ctx->Fog.Index = 0.0;
+ ctx->Fog.Density = 1.0;
+ ctx->Fog.Start = 0.0;
+ ctx->Fog.End = 1.0;
+ ctx->Fog.ColorSumEnabled = GL_FALSE;
+ ctx->Fog.FogCoordinateSource = GL_FRAGMENT_DEPTH_EXT;
+ ctx->Fog._Scale = 1.0f;
+}
diff --git a/mesalib/src/mesa/main/framebuffer.c b/mesalib/src/mesa/main/framebuffer.c
index 66c9bd910..6acfa7660 100644
--- a/mesalib/src/mesa/main/framebuffer.c
+++ b/mesalib/src/mesa/main/framebuffer.c
@@ -1,1097 +1,1097 @@
-/*
- * Mesa 3-D graphics library
- * Version: 7.2
- *
- * Copyright (C) 1999-2008 Brian Paul All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-
-/**
- * Functions for allocating/managing framebuffers and renderbuffers.
- * Also, routines for reading/writing renderbuffer data as ubytes,
- * ushorts, uints, etc.
- */
-
-
-#include "glheader.h"
-#include "imports.h"
-#include "buffers.h"
-#include "context.h"
-#include "depthstencil.h"
-#include "enums.h"
-#include "formats.h"
-#include "macros.h"
-#include "mtypes.h"
-#include "fbobject.h"
-#include "framebuffer.h"
-#include "renderbuffer.h"
-#include "texobj.h"
-
-
-
-/**
- * Compute/set the _DepthMax field for the given framebuffer.
- * This value depends on the Z buffer resolution.
- */
-static void
-compute_depth_max(struct gl_framebuffer *fb)
-{
- if (fb->Visual.depthBits == 0) {
- /* Special case. Even if we don't have a depth buffer we need
- * good values for DepthMax for Z vertex transformation purposes
- * and for per-fragment fog computation.
- */
- fb->_DepthMax = (1 << 16) - 1;
- }
- else if (fb->Visual.depthBits < 32) {
- fb->_DepthMax = (1 << fb->Visual.depthBits) - 1;
- }
- else {
- /* Special case since shift values greater than or equal to the
- * number of bits in the left hand expression's type are undefined.
- */
- fb->_DepthMax = 0xffffffff;
- }
- fb->_DepthMaxF = (GLfloat) fb->_DepthMax;
-
- /* Minimum resolvable depth value, for polygon offset */
- fb->_MRD = (GLfloat)1.0 / fb->_DepthMaxF;
-}
-
-/**
- * Create and initialize a gl_framebuffer object.
- * This is intended for creating _window_system_ framebuffers, not generic
- * framebuffer objects ala GL_EXT_framebuffer_object.
- *
- * \sa _mesa_new_framebuffer
- */
-struct gl_framebuffer *
-_mesa_create_framebuffer(const struct gl_config *visual)
-{
- struct gl_framebuffer *fb = CALLOC_STRUCT(gl_framebuffer);
- assert(visual);
- if (fb) {
- _mesa_initialize_window_framebuffer(fb, visual);
- }
- return fb;
-}
-
-
-/**
- * Allocate a new gl_framebuffer object.
- * This is the default function for ctx->Driver.NewFramebuffer().
- * This is for allocating user-created framebuffers, not window-system
- * framebuffers!
- * \sa _mesa_create_framebuffer
- */
-struct gl_framebuffer *
-_mesa_new_framebuffer(struct gl_context *ctx, GLuint name)
-{
- struct gl_framebuffer *fb;
- (void) ctx;
- assert(name != 0);
- fb = CALLOC_STRUCT(gl_framebuffer);
- if (fb) {
- _mesa_initialize_user_framebuffer(fb, name);
- }
- return fb;
-}
-
-
-/**
- * Initialize a gl_framebuffer object. Typically used to initialize
- * window system-created framebuffers, not user-created framebuffers.
- * \sa _mesa_initialize_user_framebuffer
- */
-void
-_mesa_initialize_window_framebuffer(struct gl_framebuffer *fb,
- const struct gl_config *visual)
-{
- assert(fb);
- assert(visual);
-
- memset(fb, 0, sizeof(struct gl_framebuffer));
-
- _glthread_INIT_MUTEX(fb->Mutex);
-
- fb->RefCount = 1;
-
- /* save the visual */
- fb->Visual = *visual;
-
- /* Init read/draw renderbuffer state */
- if (visual->doubleBufferMode) {
- fb->_NumColorDrawBuffers = 1;
- fb->ColorDrawBuffer[0] = GL_BACK;
- fb->_ColorDrawBufferIndexes[0] = BUFFER_BACK_LEFT;
- fb->ColorReadBuffer = GL_BACK;
- fb->_ColorReadBufferIndex = BUFFER_BACK_LEFT;
- }
- else {
- fb->_NumColorDrawBuffers = 1;
- fb->ColorDrawBuffer[0] = GL_FRONT;
- fb->_ColorDrawBufferIndexes[0] = BUFFER_FRONT_LEFT;
- fb->ColorReadBuffer = GL_FRONT;
- fb->_ColorReadBufferIndex = BUFFER_FRONT_LEFT;
- }
-
- fb->Delete = _mesa_destroy_framebuffer;
- fb->_Status = GL_FRAMEBUFFER_COMPLETE_EXT;
-
- compute_depth_max(fb);
-}
-
-
-/**
- * Initialize a user-created gl_framebuffer object.
- * \sa _mesa_initialize_window_framebuffer
- */
-void
-_mesa_initialize_user_framebuffer(struct gl_framebuffer *fb, GLuint name)
-{
- assert(fb);
- assert(name);
-
- memset(fb, 0, sizeof(struct gl_framebuffer));
-
- fb->Name = name;
- fb->RefCount = 1;
- fb->_NumColorDrawBuffers = 1;
- fb->ColorDrawBuffer[0] = GL_COLOR_ATTACHMENT0_EXT;
- fb->_ColorDrawBufferIndexes[0] = BUFFER_COLOR0;
- fb->ColorReadBuffer = GL_COLOR_ATTACHMENT0_EXT;
- fb->_ColorReadBufferIndex = BUFFER_COLOR0;
- fb->Delete = _mesa_destroy_framebuffer;
- _glthread_INIT_MUTEX(fb->Mutex);
-}
-
-
-/**
- * Deallocate buffer and everything attached to it.
- * Typically called via the gl_framebuffer->Delete() method.
- */
-void
-_mesa_destroy_framebuffer(struct gl_framebuffer *fb)
-{
- if (fb) {
- _mesa_free_framebuffer_data(fb);
- free(fb);
- }
-}
-
-
-/**
- * Free all the data hanging off the given gl_framebuffer, but don't free
- * the gl_framebuffer object itself.
- */
-void
-_mesa_free_framebuffer_data(struct gl_framebuffer *fb)
-{
- GLuint i;
-
- assert(fb);
- assert(fb->RefCount == 0);
-
- _glthread_DESTROY_MUTEX(fb->Mutex);
-
- for (i = 0; i < BUFFER_COUNT; i++) {
- struct gl_renderbuffer_attachment *att = &fb->Attachment[i];
- if (att->Renderbuffer) {
- _mesa_reference_renderbuffer(&att->Renderbuffer, NULL);
- }
- if (att->Texture) {
- _mesa_reference_texobj(&att->Texture, NULL);
- }
- ASSERT(!att->Renderbuffer);
- ASSERT(!att->Texture);
- att->Type = GL_NONE;
- }
-
- /* unbind _Depth/_StencilBuffer to decr ref counts */
- _mesa_reference_renderbuffer(&fb->_DepthBuffer, NULL);
- _mesa_reference_renderbuffer(&fb->_StencilBuffer, NULL);
-}
-
-
-/**
- * Set *ptr to point to fb, with refcounting and locking.
- */
-void
-_mesa_reference_framebuffer(struct gl_framebuffer **ptr,
- struct gl_framebuffer *fb)
-{
- assert(ptr);
- if (*ptr == fb) {
- /* no change */
- return;
- }
-
- if (*ptr) {
- /* unreference old renderbuffer */
- GLboolean deleteFlag = GL_FALSE;
- struct gl_framebuffer *oldFb = *ptr;
-
- _glthread_LOCK_MUTEX(oldFb->Mutex);
- ASSERT(oldFb->RefCount > 0);
- oldFb->RefCount--;
- deleteFlag = (oldFb->RefCount == 0);
- _glthread_UNLOCK_MUTEX(oldFb->Mutex);
-
- if (deleteFlag)
- oldFb->Delete(oldFb);
-
- *ptr = NULL;
- }
- assert(!*ptr);
-
- if (fb) {
- _glthread_LOCK_MUTEX(fb->Mutex);
- fb->RefCount++;
- _glthread_UNLOCK_MUTEX(fb->Mutex);
- *ptr = fb;
- }
-}
-
-
-/**
- * Resize the given framebuffer's renderbuffers to the new width and height.
- * This should only be used for window-system framebuffers, not
- * user-created renderbuffers (i.e. made with GL_EXT_framebuffer_object).
- * This will typically be called via ctx->Driver.ResizeBuffers() or directly
- * from a device driver.
- *
- * \note it's possible for ctx to be null since a window can be resized
- * without a currently bound rendering context.
- */
-void
-_mesa_resize_framebuffer(struct gl_context *ctx, struct gl_framebuffer *fb,
- GLuint width, GLuint height)
-{
- GLuint i;
-
- /* XXX I think we could check if the size is not changing
- * and return early.
- */
-
- /* For window system framebuffers, Name is zero */
- assert(fb->Name == 0);
-
- for (i = 0; i < BUFFER_COUNT; i++) {
- struct gl_renderbuffer_attachment *att = &fb->Attachment[i];
- if (att->Type == GL_RENDERBUFFER_EXT && att->Renderbuffer) {
- struct gl_renderbuffer *rb = att->Renderbuffer;
- /* only resize if size is changing */
- if (rb->Width != width || rb->Height != height) {
- if (rb->AllocStorage(ctx, rb, rb->InternalFormat, width, height)) {
- ASSERT(rb->Width == width);
- ASSERT(rb->Height == height);
- }
- else {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "Resizing framebuffer");
- /* no return */
- }
- }
- }
- }
-
- if (fb->_DepthBuffer) {
- struct gl_renderbuffer *rb = fb->_DepthBuffer;
- if (rb->Width != width || rb->Height != height) {
- if (!rb->AllocStorage(ctx, rb, rb->InternalFormat, width, height)) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "Resizing framebuffer");
- }
- }
- }
-
- if (fb->_StencilBuffer) {
- struct gl_renderbuffer *rb = fb->_StencilBuffer;
- if (rb->Width != width || rb->Height != height) {
- if (!rb->AllocStorage(ctx, rb, rb->InternalFormat, width, height)) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "Resizing framebuffer");
- }
- }
- }
-
- fb->Width = width;
- fb->Height = height;
-
- if (ctx) {
- /* update scissor / window bounds */
- _mesa_update_draw_buffer_bounds(ctx);
- /* Signal new buffer state so that swrast will update its clipping
- * info (the CLIP_BIT flag).
- */
- ctx->NewState |= _NEW_BUFFERS;
- }
-}
-
-
-
-/**
- * XXX THIS IS OBSOLETE - drivers should take care of detecting window
- * size changes and act accordingly, likely calling _mesa_resize_framebuffer().
- *
- * GL_MESA_resize_buffers extension.
- *
- * When this function is called, we'll ask the window system how large
- * the current window is. If it's a new size, we'll call the driver's
- * ResizeBuffers function. The driver will then resize its color buffers
- * as needed, and maybe call the swrast's routine for reallocating
- * swrast-managed depth/stencil/accum/etc buffers.
- * \note This function should only be called through the GL API, not
- * from device drivers (as was done in the past).
- */
-void
-_mesa_resizebuffers( struct gl_context *ctx )
-{
- ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH( ctx );
-
- if (MESA_VERBOSE & VERBOSE_API)
- _mesa_debug(ctx, "glResizeBuffersMESA\n");
-
- if (!ctx->Driver.GetBufferSize) {
- return;
- }
-
- if (ctx->WinSysDrawBuffer) {
- GLuint newWidth, newHeight;
- struct gl_framebuffer *buffer = ctx->WinSysDrawBuffer;
-
- assert(buffer->Name == 0);
-
- /* ask device driver for size of output buffer */
- ctx->Driver.GetBufferSize( buffer, &newWidth, &newHeight );
-
- /* see if size of device driver's color buffer (window) has changed */
- if (buffer->Width != newWidth || buffer->Height != newHeight) {
- if (ctx->Driver.ResizeBuffers)
- ctx->Driver.ResizeBuffers(ctx, buffer, newWidth, newHeight );
- }
- }
-
- if (ctx->WinSysReadBuffer
- && ctx->WinSysReadBuffer != ctx->WinSysDrawBuffer) {
- GLuint newWidth, newHeight;
- struct gl_framebuffer *buffer = ctx->WinSysReadBuffer;
-
- assert(buffer->Name == 0);
-
- /* ask device driver for size of read buffer */
- ctx->Driver.GetBufferSize( buffer, &newWidth, &newHeight );
-
- /* see if size of device driver's color buffer (window) has changed */
- if (buffer->Width != newWidth || buffer->Height != newHeight) {
- if (ctx->Driver.ResizeBuffers)
- ctx->Driver.ResizeBuffers(ctx, buffer, newWidth, newHeight );
- }
- }
-
- ctx->NewState |= _NEW_BUFFERS; /* to update scissor / window bounds */
-}
-
-
-/*
- * XXX THIS IS OBSOLETE
- */
-void GLAPIENTRY
-_mesa_ResizeBuffersMESA( void )
-{
- GET_CURRENT_CONTEXT(ctx);
-
- if (ctx->Extensions.MESA_resize_buffers)
- _mesa_resizebuffers( ctx );
-}
-
-
-
-/**
- * Examine all the framebuffer's renderbuffers to update the Width/Height
- * fields of the framebuffer. If we have renderbuffers with different
- * sizes, set the framebuffer's width and height to the min size.
- * Note: this is only intended for user-created framebuffers, not
- * window-system framebuffes.
- */
-static void
-update_framebuffer_size(struct gl_context *ctx, struct gl_framebuffer *fb)
-{
- GLuint minWidth = ~0, minHeight = ~0;
- GLuint i;
-
- /* user-created framebuffers only */
- assert(fb->Name);
-
- for (i = 0; i < BUFFER_COUNT; i++) {
- struct gl_renderbuffer_attachment *att = &fb->Attachment[i];
- const struct gl_renderbuffer *rb = att->Renderbuffer;
- if (rb) {
- minWidth = MIN2(minWidth, rb->Width);
- minHeight = MIN2(minHeight, rb->Height);
- }
- }
-
- if (minWidth != ~0) {
- fb->Width = minWidth;
- fb->Height = minHeight;
- }
- else {
- fb->Width = 0;
- fb->Height = 0;
- }
-}
-
-
-/**
- * Update the context's current drawing buffer's Xmin, Xmax, Ymin, Ymax fields.
- * These values are computed from the buffer's width and height and
- * the scissor box, if it's enabled.
- * \param ctx the GL context.
- */
-void
-_mesa_update_draw_buffer_bounds(struct gl_context *ctx)
-{
- struct gl_framebuffer *buffer = ctx->DrawBuffer;
-
- if (!buffer)
- return;
-
- if (buffer->Name) {
- /* user-created framebuffer size depends on the renderbuffers */
- update_framebuffer_size(ctx, buffer);
- }
-
- buffer->_Xmin = 0;
- buffer->_Ymin = 0;
- buffer->_Xmax = buffer->Width;
- buffer->_Ymax = buffer->Height;
-
- if (ctx->Scissor.Enabled) {
- if (ctx->Scissor.X > buffer->_Xmin) {
- buffer->_Xmin = ctx->Scissor.X;
- }
- if (ctx->Scissor.Y > buffer->_Ymin) {
- buffer->_Ymin = ctx->Scissor.Y;
- }
- if (ctx->Scissor.X + ctx->Scissor.Width < buffer->_Xmax) {
- buffer->_Xmax = ctx->Scissor.X + ctx->Scissor.Width;
- }
- if (ctx->Scissor.Y + ctx->Scissor.Height < buffer->_Ymax) {
- buffer->_Ymax = ctx->Scissor.Y + ctx->Scissor.Height;
- }
- /* finally, check for empty region */
- if (buffer->_Xmin > buffer->_Xmax) {
- buffer->_Xmin = buffer->_Xmax;
- }
- if (buffer->_Ymin > buffer->_Ymax) {
- buffer->_Ymin = buffer->_Ymax;
- }
- }
-
- ASSERT(buffer->_Xmin <= buffer->_Xmax);
- ASSERT(buffer->_Ymin <= buffer->_Ymax);
-}
-
-
-/**
- * The glGet queries of the framebuffer red/green/blue size, stencil size,
- * etc. are satisfied by the fields of ctx->DrawBuffer->Visual. These can
- * change depending on the renderbuffer bindings. This function updates
- * the given framebuffer's Visual from the current renderbuffer bindings.
- *
- * This may apply to user-created framebuffers or window system framebuffers.
- *
- * Also note: ctx->DrawBuffer->Visual.depthBits might not equal
- * ctx->DrawBuffer->Attachment[BUFFER_DEPTH].Renderbuffer.DepthBits.
- * The former one is used to convert floating point depth values into
- * integer Z values.
- */
-void
-_mesa_update_framebuffer_visual(struct gl_context *ctx,
- struct gl_framebuffer *fb)
-{
- GLuint i;
-
- memset(&fb->Visual, 0, sizeof(fb->Visual));
- fb->Visual.rgbMode = GL_TRUE; /* assume this */
-
-#if 0 /* this _might_ be needed */
- if (fb->_Status != GL_FRAMEBUFFER_COMPLETE_EXT) {
- /* leave visual fields zero'd */
- return;
- }
-#endif
-
- /* find first RGB renderbuffer */
- for (i = 0; i < BUFFER_COUNT; i++) {
- if (fb->Attachment[i].Renderbuffer) {
- const struct gl_renderbuffer *rb = fb->Attachment[i].Renderbuffer;
- const GLenum baseFormat = _mesa_get_format_base_format(rb->Format);
- const gl_format fmt = rb->Format;
-
- if (_mesa_is_legal_color_format(ctx, baseFormat)) {
- fb->Visual.redBits = _mesa_get_format_bits(fmt, GL_RED_BITS);
- fb->Visual.greenBits = _mesa_get_format_bits(fmt, GL_GREEN_BITS);
- fb->Visual.blueBits = _mesa_get_format_bits(fmt, GL_BLUE_BITS);
- fb->Visual.alphaBits = _mesa_get_format_bits(fmt, GL_ALPHA_BITS);
- fb->Visual.rgbBits = fb->Visual.redBits
- + fb->Visual.greenBits + fb->Visual.blueBits;
- fb->Visual.samples = rb->NumSamples;
- if (_mesa_get_format_color_encoding(fmt) == GL_SRGB)
- fb->Visual.sRGBCapable = ctx->Const.sRGBCapable;
- break;
- }
- }
- }
-
- fb->Visual.floatMode = GL_FALSE;
- for (i = 0; i < BUFFER_COUNT; i++) {
- if (fb->Attachment[i].Renderbuffer) {
- const struct gl_renderbuffer *rb = fb->Attachment[i].Renderbuffer;
- const gl_format fmt = rb->Format;
-
- if (_mesa_get_format_datatype(fmt) == GL_FLOAT) {
- fb->Visual.floatMode = GL_TRUE;
- break;
- }
- }
- }
-
- if (fb->Attachment[BUFFER_DEPTH].Renderbuffer) {
- const struct gl_renderbuffer *rb =
- fb->Attachment[BUFFER_DEPTH].Renderbuffer;
- const gl_format fmt = rb->Format;
- fb->Visual.haveDepthBuffer = GL_TRUE;
- fb->Visual.depthBits = _mesa_get_format_bits(fmt, GL_DEPTH_BITS);
- }
-
- if (fb->Attachment[BUFFER_STENCIL].Renderbuffer) {
- const struct gl_renderbuffer *rb =
- fb->Attachment[BUFFER_STENCIL].Renderbuffer;
- const gl_format fmt = rb->Format;
- fb->Visual.haveStencilBuffer = GL_TRUE;
- fb->Visual.stencilBits = _mesa_get_format_bits(fmt, GL_STENCIL_BITS);
- }
-
- if (fb->Attachment[BUFFER_ACCUM].Renderbuffer) {
- const struct gl_renderbuffer *rb =
- fb->Attachment[BUFFER_ACCUM].Renderbuffer;
- const gl_format fmt = rb->Format;
- fb->Visual.haveAccumBuffer = GL_TRUE;
- fb->Visual.accumRedBits = _mesa_get_format_bits(fmt, GL_RED_BITS);
- fb->Visual.accumGreenBits = _mesa_get_format_bits(fmt, GL_GREEN_BITS);
- fb->Visual.accumBlueBits = _mesa_get_format_bits(fmt, GL_BLUE_BITS);
- fb->Visual.accumAlphaBits = _mesa_get_format_bits(fmt, GL_ALPHA_BITS);
- }
-
- compute_depth_max(fb);
-}
-
-
-/**
- * Update the framebuffer's _DepthBuffer field using the renderbuffer
- * found at the given attachment index.
- *
- * If that attachment points to a combined GL_DEPTH_STENCIL renderbuffer,
- * create and install a depth wrapper/adaptor.
- *
- * \param fb the framebuffer whose _DepthBuffer field to update
- * \param attIndex indicates the renderbuffer to possibly wrap
- */
-void
-_mesa_update_depth_buffer(struct gl_context *ctx,
- struct gl_framebuffer *fb,
- GLuint attIndex)
-{
- struct gl_renderbuffer *depthRb;
-
- /* only one possiblity for now */
- ASSERT(attIndex == BUFFER_DEPTH);
-
- depthRb = fb->Attachment[attIndex].Renderbuffer;
-
- if (depthRb && _mesa_is_format_packed_depth_stencil(depthRb->Format)) {
- /* The attached depth buffer is a GL_DEPTH_STENCIL renderbuffer */
- if (!fb->_DepthBuffer
- || fb->_DepthBuffer->Wrapped != depthRb
- || _mesa_get_format_base_format(fb->_DepthBuffer->Format) != GL_DEPTH_COMPONENT) {
- /* need to update wrapper */
- struct gl_renderbuffer *wrapper
- = _mesa_new_z24_renderbuffer_wrapper(ctx, depthRb);
- _mesa_reference_renderbuffer(&fb->_DepthBuffer, wrapper);
- ASSERT(fb->_DepthBuffer->Wrapped == depthRb);
- }
- }
- else {
- /* depthRb may be null */
- _mesa_reference_renderbuffer(&fb->_DepthBuffer, depthRb);
- }
-}
-
-
-/**
- * Update the framebuffer's _StencilBuffer field using the renderbuffer
- * found at the given attachment index.
- *
- * If that attachment points to a combined GL_DEPTH_STENCIL renderbuffer,
- * create and install a stencil wrapper/adaptor.
- *
- * \param fb the framebuffer whose _StencilBuffer field to update
- * \param attIndex indicates the renderbuffer to possibly wrap
- */
-void
-_mesa_update_stencil_buffer(struct gl_context *ctx,
- struct gl_framebuffer *fb,
- GLuint attIndex)
-{
- struct gl_renderbuffer *stencilRb;
-
- ASSERT(attIndex == BUFFER_DEPTH ||
- attIndex == BUFFER_STENCIL);
-
- stencilRb = fb->Attachment[attIndex].Renderbuffer;
-
- if (stencilRb && _mesa_is_format_packed_depth_stencil(stencilRb->Format)) {
- /* The attached stencil buffer is a GL_DEPTH_STENCIL renderbuffer */
- if (!fb->_StencilBuffer
- || fb->_StencilBuffer->Wrapped != stencilRb
- || _mesa_get_format_base_format(fb->_StencilBuffer->Format) != GL_STENCIL_INDEX) {
- /* need to update wrapper */
- struct gl_renderbuffer *wrapper
- = _mesa_new_s8_renderbuffer_wrapper(ctx, stencilRb);
- _mesa_reference_renderbuffer(&fb->_StencilBuffer, wrapper);
- ASSERT(fb->_StencilBuffer->Wrapped == stencilRb);
- }
- }
- else {
- /* stencilRb may be null */
- _mesa_reference_renderbuffer(&fb->_StencilBuffer, stencilRb);
- }
-}
-
-
-/*
- * Example DrawBuffers scenarios:
- *
- * 1. glDrawBuffer(GL_FRONT_AND_BACK), fixed-func or shader writes to
- * "gl_FragColor" or program writes to the "result.color" register:
- *
- * fragment color output renderbuffer
- * --------------------- ---------------
- * color[0] Front, Back
- *
- *
- * 2. glDrawBuffers(3, [GL_FRONT, GL_AUX0, GL_AUX1]), shader writes to
- * gl_FragData[i] or program writes to result.color[i] registers:
- *
- * fragment color output renderbuffer
- * --------------------- ---------------
- * color[0] Front
- * color[1] Aux0
- * color[3] Aux1
- *
- *
- * 3. glDrawBuffers(3, [GL_FRONT, GL_AUX0, GL_AUX1]) and shader writes to
- * gl_FragColor, or fixed function:
- *
- * fragment color output renderbuffer
- * --------------------- ---------------
- * color[0] Front, Aux0, Aux1
- *
- *
- * In either case, the list of renderbuffers is stored in the
- * framebuffer->_ColorDrawBuffers[] array and
- * framebuffer->_NumColorDrawBuffers indicates the number of buffers.
- * The renderer (like swrast) has to look at the current fragment shader
- * to see if it writes to gl_FragColor vs. gl_FragData[i] to determine
- * how to map color outputs to renderbuffers.
- *
- * Note that these two calls are equivalent (for fixed function fragment
- * shading anyway):
- * a) glDrawBuffer(GL_FRONT_AND_BACK); (assuming non-stereo framebuffer)
- * b) glDrawBuffers(2, [GL_FRONT_LEFT, GL_BACK_LEFT]);
- */
-
-
-
-
-/**
- * Update the (derived) list of color drawing renderbuffer pointers.
- * Later, when we're rendering we'll loop from 0 to _NumColorDrawBuffers
- * writing colors.
- */
-static void
-update_color_draw_buffers(struct gl_context *ctx, struct gl_framebuffer *fb)
-{
- GLuint output;
-
- /* set 0th buffer to NULL now in case _NumColorDrawBuffers is zero */
- fb->_ColorDrawBuffers[0] = NULL;
-
- for (output = 0; output < fb->_NumColorDrawBuffers; output++) {
- GLint buf = fb->_ColorDrawBufferIndexes[output];
- if (buf >= 0) {
- fb->_ColorDrawBuffers[output] = fb->Attachment[buf].Renderbuffer;
- }
- else {
- fb->_ColorDrawBuffers[output] = NULL;
- }
- }
-}
-
-
-/**
- * Update the (derived) color read renderbuffer pointer.
- * Unlike the DrawBuffer, we can only read from one (or zero) color buffers.
- */
-static void
-update_color_read_buffer(struct gl_context *ctx, struct gl_framebuffer *fb)
-{
- (void) ctx;
- if (fb->_ColorReadBufferIndex == -1 ||
- fb->DeletePending ||
- fb->Width == 0 ||
- fb->Height == 0) {
- fb->_ColorReadBuffer = NULL; /* legal! */
- }
- else {
- ASSERT(fb->_ColorReadBufferIndex >= 0);
- ASSERT(fb->_ColorReadBufferIndex < BUFFER_COUNT);
- fb->_ColorReadBuffer
- = fb->Attachment[fb->_ColorReadBufferIndex].Renderbuffer;
- }
-}
-
-
-/**
- * Update a gl_framebuffer's derived state.
- *
- * Specifically, update these framebuffer fields:
- * _ColorDrawBuffers
- * _NumColorDrawBuffers
- * _ColorReadBuffer
- * _DepthBuffer
- * _StencilBuffer
- *
- * If the framebuffer is user-created, make sure it's complete.
- *
- * The following functions (at least) can effect framebuffer state:
- * glReadBuffer, glDrawBuffer, glDrawBuffersARB, glFramebufferRenderbufferEXT,
- * glRenderbufferStorageEXT.
- */
-static void
-update_framebuffer(struct gl_context *ctx, struct gl_framebuffer *fb)
-{
- if (fb->Name == 0) {
- /* This is a window-system framebuffer */
- /* Need to update the FB's GL_DRAW_BUFFER state to match the
- * context state (GL_READ_BUFFER too).
- */
- if (fb->ColorDrawBuffer[0] != ctx->Color.DrawBuffer[0]) {
- _mesa_drawbuffers(ctx, ctx->Const.MaxDrawBuffers,
- ctx->Color.DrawBuffer, NULL);
- }
- }
- else {
- /* This is a user-created framebuffer.
- * Completeness only matters for user-created framebuffers.
- */
- if (fb->_Status != GL_FRAMEBUFFER_COMPLETE) {
- _mesa_test_framebuffer_completeness(ctx, fb);
- }
- }
-
- /* Strictly speaking, we don't need to update the draw-state
- * if this FB is bound as ctx->ReadBuffer (and conversely, the
- * read-state if this FB is bound as ctx->DrawBuffer), but no
- * harm.
- */
- update_color_draw_buffers(ctx, fb);
- update_color_read_buffer(ctx, fb);
- _mesa_update_depth_buffer(ctx, fb, BUFFER_DEPTH);
- _mesa_update_stencil_buffer(ctx, fb, BUFFER_STENCIL);
-
- compute_depth_max(fb);
-}
-
-
-/**
- * Update state related to the current draw/read framebuffers.
- */
-void
-_mesa_update_framebuffer(struct gl_context *ctx)
-{
- struct gl_framebuffer *drawFb;
- struct gl_framebuffer *readFb;
-
- assert(ctx);
- drawFb = ctx->DrawBuffer;
- readFb = ctx->ReadBuffer;
-
- update_framebuffer(ctx, drawFb);
- if (readFb != drawFb)
- update_framebuffer(ctx, readFb);
-}
-
-
-/**
- * Check if the renderbuffer for a read operation (glReadPixels, glCopyPixels,
- * glCopyTex[Sub]Image, etc) exists.
- * \param format a basic image format such as GL_RGB, GL_RGBA, GL_ALPHA,
- * GL_DEPTH_COMPONENT, etc. or GL_COLOR, GL_DEPTH, GL_STENCIL.
- * \return GL_TRUE if buffer exists, GL_FALSE otherwise
- */
-GLboolean
-_mesa_source_buffer_exists(struct gl_context *ctx, GLenum format)
-{
- const struct gl_renderbuffer_attachment *att = ctx->ReadBuffer->Attachment;
-
- /* If we don't know the framebuffer status, update it now */
- if (ctx->ReadBuffer->_Status == 0) {
- _mesa_test_framebuffer_completeness(ctx, ctx->ReadBuffer);
- }
-
- if (ctx->ReadBuffer->_Status != GL_FRAMEBUFFER_COMPLETE_EXT) {
- return GL_FALSE;
- }
-
- switch (format) {
- case GL_COLOR:
- case GL_RED:
- case GL_GREEN:
- case GL_BLUE:
- case GL_ALPHA:
- case GL_LUMINANCE:
- case GL_LUMINANCE_ALPHA:
- case GL_INTENSITY:
- case GL_RG:
- case GL_RGB:
- case GL_BGR:
- case GL_RGBA:
- case GL_BGRA:
- case GL_ABGR_EXT:
- case GL_COLOR_INDEX:
- case GL_RED_INTEGER_EXT:
- case GL_GREEN_INTEGER_EXT:
- case GL_BLUE_INTEGER_EXT:
- case GL_ALPHA_INTEGER_EXT:
- case GL_RGB_INTEGER_EXT:
- case GL_RGBA_INTEGER_EXT:
- case GL_BGR_INTEGER_EXT:
- case GL_BGRA_INTEGER_EXT:
- case GL_LUMINANCE_INTEGER_EXT:
- case GL_LUMINANCE_ALPHA_INTEGER_EXT:
- if (ctx->ReadBuffer->_ColorReadBuffer == NULL) {
- return GL_FALSE;
- }
- ASSERT(_mesa_get_format_bits(ctx->ReadBuffer->_ColorReadBuffer->Format, GL_RED_BITS) > 0 ||
- _mesa_get_format_bits(ctx->ReadBuffer->_ColorReadBuffer->Format, GL_ALPHA_BITS) > 0 ||
- _mesa_get_format_bits(ctx->ReadBuffer->_ColorReadBuffer->Format, GL_TEXTURE_LUMINANCE_SIZE) > 0 ||
- _mesa_get_format_bits(ctx->ReadBuffer->_ColorReadBuffer->Format, GL_TEXTURE_INTENSITY_SIZE) > 0 ||
- _mesa_get_format_bits(ctx->ReadBuffer->_ColorReadBuffer->Format, GL_INDEX_BITS) > 0);
- break;
- case GL_DEPTH:
- case GL_DEPTH_COMPONENT:
- if (!att[BUFFER_DEPTH].Renderbuffer) {
- return GL_FALSE;
- }
- /*ASSERT(att[BUFFER_DEPTH].Renderbuffer->DepthBits > 0);*/
- break;
- case GL_STENCIL:
- case GL_STENCIL_INDEX:
- if (!att[BUFFER_STENCIL].Renderbuffer) {
- return GL_FALSE;
- }
- /*ASSERT(att[BUFFER_STENCIL].Renderbuffer->StencilBits > 0);*/
- break;
- case GL_DEPTH_STENCIL_EXT:
- if (!att[BUFFER_DEPTH].Renderbuffer ||
- !att[BUFFER_STENCIL].Renderbuffer) {
- return GL_FALSE;
- }
- /*
- ASSERT(att[BUFFER_DEPTH].Renderbuffer->DepthBits > 0);
- ASSERT(att[BUFFER_STENCIL].Renderbuffer->StencilBits > 0);
- */
- break;
- default:
- _mesa_problem(ctx,
- "Unexpected format 0x%x in _mesa_source_buffer_exists",
- format);
- return GL_FALSE;
- }
-
- /* OK */
- return GL_TRUE;
-}
-
-
-/**
- * As above, but for drawing operations.
- * XXX could do some code merging w/ above function.
- */
-GLboolean
-_mesa_dest_buffer_exists(struct gl_context *ctx, GLenum format)
-{
- const struct gl_renderbuffer_attachment *att = ctx->DrawBuffer->Attachment;
-
- /* If we don't know the framebuffer status, update it now */
- if (ctx->DrawBuffer->_Status == 0) {
- _mesa_test_framebuffer_completeness(ctx, ctx->DrawBuffer);
- }
-
- if (ctx->DrawBuffer->_Status != GL_FRAMEBUFFER_COMPLETE_EXT) {
- return GL_FALSE;
- }
-
- switch (format) {
- case GL_COLOR:
- case GL_RED:
- case GL_GREEN:
- case GL_BLUE:
- case GL_ALPHA:
- case GL_LUMINANCE:
- case GL_LUMINANCE_ALPHA:
- case GL_INTENSITY:
- case GL_RGB:
- case GL_BGR:
- case GL_RGBA:
- case GL_BGRA:
- case GL_ABGR_EXT:
- case GL_COLOR_INDEX:
- case GL_RED_INTEGER_EXT:
- case GL_GREEN_INTEGER_EXT:
- case GL_BLUE_INTEGER_EXT:
- case GL_ALPHA_INTEGER_EXT:
- case GL_RGB_INTEGER_EXT:
- case GL_RGBA_INTEGER_EXT:
- case GL_BGR_INTEGER_EXT:
- case GL_BGRA_INTEGER_EXT:
- case GL_LUMINANCE_INTEGER_EXT:
- case GL_LUMINANCE_ALPHA_INTEGER_EXT:
- /* Nothing special since GL_DRAW_BUFFER could be GL_NONE. */
- /* Could assert that colorbuffer has RedBits > 0 */
- break;
- case GL_DEPTH:
- case GL_DEPTH_COMPONENT:
- if (!att[BUFFER_DEPTH].Renderbuffer) {
- return GL_FALSE;
- }
- /*ASSERT(att[BUFFER_DEPTH].Renderbuffer->DepthBits > 0);*/
- break;
- case GL_STENCIL:
- case GL_STENCIL_INDEX:
- if (!att[BUFFER_STENCIL].Renderbuffer) {
- return GL_FALSE;
- }
- /*ASSERT(att[BUFFER_STENCIL].Renderbuffer->StencilBits > 0);*/
- break;
- case GL_DEPTH_STENCIL_EXT:
- if (!att[BUFFER_DEPTH].Renderbuffer ||
- !att[BUFFER_STENCIL].Renderbuffer) {
- return GL_FALSE;
- }
- /*
- ASSERT(att[BUFFER_DEPTH].Renderbuffer->DepthBits > 0);
- ASSERT(att[BUFFER_STENCIL].Renderbuffer->StencilBits > 0);
- */
- break;
- default:
- _mesa_problem(ctx,
- "Unexpected format 0x%x in _mesa_dest_buffer_exists",
- format);
- return GL_FALSE;
- }
-
- /* OK */
- return GL_TRUE;
-}
-
-
-/**
- * Used to answer the GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES query.
- */
-GLenum
-_mesa_get_color_read_format(struct gl_context *ctx)
-{
- switch (ctx->ReadBuffer->_ColorReadBuffer->Format) {
- case MESA_FORMAT_ARGB8888:
- return GL_BGRA;
- case MESA_FORMAT_RGB565:
- return GL_BGR;
- default:
- return GL_RGBA;
- }
-}
-
-
-/**
- * Used to answer the GL_IMPLEMENTATION_COLOR_READ_TYPE_OES query.
- */
-GLenum
-_mesa_get_color_read_type(struct gl_context *ctx)
-{
- switch (ctx->ReadBuffer->_ColorReadBuffer->Format) {
- case MESA_FORMAT_ARGB8888:
- return GL_UNSIGNED_BYTE;
- case MESA_FORMAT_RGB565:
- return GL_UNSIGNED_SHORT_5_6_5_REV;
- default:
- return GL_UNSIGNED_BYTE;
- }
-}
-
-
-/**
- * Print framebuffer info to stderr, for debugging.
- */
-void
-_mesa_print_framebuffer(const struct gl_framebuffer *fb)
-{
- GLuint i;
-
- fprintf(stderr, "Mesa Framebuffer %u at %p\n", fb->Name, (void *) fb);
- fprintf(stderr, " Size: %u x %u Status: %s\n", fb->Width, fb->Height,
- _mesa_lookup_enum_by_nr(fb->_Status));
- fprintf(stderr, " Attachments:\n");
-
- for (i = 0; i < BUFFER_COUNT; i++) {
- const struct gl_renderbuffer_attachment *att = &fb->Attachment[i];
- if (att->Type == GL_TEXTURE) {
- const struct gl_texture_image *texImage =
- _mesa_get_attachment_teximage_const(att);
- fprintf(stderr,
- " %2d: Texture %u, level %u, face %u, slice %u, complete %d\n",
- i, att->Texture->Name, att->TextureLevel, att->CubeMapFace,
- att->Zoffset, att->Complete);
- fprintf(stderr, " Size: %u x %u x %u Format %s\n",
- texImage->Width, texImage->Height, texImage->Depth,
- _mesa_get_format_name(texImage->TexFormat));
- }
- else if (att->Type == GL_RENDERBUFFER) {
- fprintf(stderr, " %2d: Renderbuffer %u, complete %d\n",
- i, att->Renderbuffer->Name, att->Complete);
- fprintf(stderr, " Size: %u x %u Format %s\n",
- att->Renderbuffer->Width, att->Renderbuffer->Height,
- _mesa_get_format_name(att->Renderbuffer->Format));
- }
- else {
- fprintf(stderr, " %2d: none\n", i);
- }
- }
-}
+/*
+ * Mesa 3-D graphics library
+ * Version: 7.2
+ *
+ * Copyright (C) 1999-2008 Brian Paul All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+
+/**
+ * Functions for allocating/managing framebuffers and renderbuffers.
+ * Also, routines for reading/writing renderbuffer data as ubytes,
+ * ushorts, uints, etc.
+ */
+
+
+#include "glheader.h"
+#include "imports.h"
+#include "buffers.h"
+#include "context.h"
+#include "depthstencil.h"
+#include "enums.h"
+#include "formats.h"
+#include "macros.h"
+#include "mtypes.h"
+#include "fbobject.h"
+#include "framebuffer.h"
+#include "renderbuffer.h"
+#include "texobj.h"
+
+
+
+/**
+ * Compute/set the _DepthMax field for the given framebuffer.
+ * This value depends on the Z buffer resolution.
+ */
+static void
+compute_depth_max(struct gl_framebuffer *fb)
+{
+ if (fb->Visual.depthBits == 0) {
+ /* Special case. Even if we don't have a depth buffer we need
+ * good values for DepthMax for Z vertex transformation purposes
+ * and for per-fragment fog computation.
+ */
+ fb->_DepthMax = (1 << 16) - 1;
+ }
+ else if (fb->Visual.depthBits < 32) {
+ fb->_DepthMax = (1 << fb->Visual.depthBits) - 1;
+ }
+ else {
+ /* Special case since shift values greater than or equal to the
+ * number of bits in the left hand expression's type are undefined.
+ */
+ fb->_DepthMax = 0xffffffff;
+ }
+ fb->_DepthMaxF = (GLfloat) fb->_DepthMax;
+
+ /* Minimum resolvable depth value, for polygon offset */
+ fb->_MRD = (GLfloat)1.0 / fb->_DepthMaxF;
+}
+
+/**
+ * Create and initialize a gl_framebuffer object.
+ * This is intended for creating _window_system_ framebuffers, not generic
+ * framebuffer objects ala GL_EXT_framebuffer_object.
+ *
+ * \sa _mesa_new_framebuffer
+ */
+struct gl_framebuffer *
+_mesa_create_framebuffer(const struct gl_config *visual)
+{
+ struct gl_framebuffer *fb = CALLOC_STRUCT(gl_framebuffer);
+ assert(visual);
+ if (fb) {
+ _mesa_initialize_window_framebuffer(fb, visual);
+ }
+ return fb;
+}
+
+
+/**
+ * Allocate a new gl_framebuffer object.
+ * This is the default function for ctx->Driver.NewFramebuffer().
+ * This is for allocating user-created framebuffers, not window-system
+ * framebuffers!
+ * \sa _mesa_create_framebuffer
+ */
+struct gl_framebuffer *
+_mesa_new_framebuffer(struct gl_context *ctx, GLuint name)
+{
+ struct gl_framebuffer *fb;
+ (void) ctx;
+ assert(name != 0);
+ fb = CALLOC_STRUCT(gl_framebuffer);
+ if (fb) {
+ _mesa_initialize_user_framebuffer(fb, name);
+ }
+ return fb;
+}
+
+
+/**
+ * Initialize a gl_framebuffer object. Typically used to initialize
+ * window system-created framebuffers, not user-created framebuffers.
+ * \sa _mesa_initialize_user_framebuffer
+ */
+void
+_mesa_initialize_window_framebuffer(struct gl_framebuffer *fb,
+ const struct gl_config *visual)
+{
+ assert(fb);
+ assert(visual);
+
+ memset(fb, 0, sizeof(struct gl_framebuffer));
+
+ _glthread_INIT_MUTEX(fb->Mutex);
+
+ fb->RefCount = 1;
+
+ /* save the visual */
+ fb->Visual = *visual;
+
+ /* Init read/draw renderbuffer state */
+ if (visual->doubleBufferMode) {
+ fb->_NumColorDrawBuffers = 1;
+ fb->ColorDrawBuffer[0] = GL_BACK;
+ fb->_ColorDrawBufferIndexes[0] = BUFFER_BACK_LEFT;
+ fb->ColorReadBuffer = GL_BACK;
+ fb->_ColorReadBufferIndex = BUFFER_BACK_LEFT;
+ }
+ else {
+ fb->_NumColorDrawBuffers = 1;
+ fb->ColorDrawBuffer[0] = GL_FRONT;
+ fb->_ColorDrawBufferIndexes[0] = BUFFER_FRONT_LEFT;
+ fb->ColorReadBuffer = GL_FRONT;
+ fb->_ColorReadBufferIndex = BUFFER_FRONT_LEFT;
+ }
+
+ fb->Delete = _mesa_destroy_framebuffer;
+ fb->_Status = GL_FRAMEBUFFER_COMPLETE_EXT;
+
+ compute_depth_max(fb);
+}
+
+
+/**
+ * Initialize a user-created gl_framebuffer object.
+ * \sa _mesa_initialize_window_framebuffer
+ */
+void
+_mesa_initialize_user_framebuffer(struct gl_framebuffer *fb, GLuint name)
+{
+ assert(fb);
+ assert(name);
+
+ memset(fb, 0, sizeof(struct gl_framebuffer));
+
+ fb->Name = name;
+ fb->RefCount = 1;
+ fb->_NumColorDrawBuffers = 1;
+ fb->ColorDrawBuffer[0] = GL_COLOR_ATTACHMENT0_EXT;
+ fb->_ColorDrawBufferIndexes[0] = BUFFER_COLOR0;
+ fb->ColorReadBuffer = GL_COLOR_ATTACHMENT0_EXT;
+ fb->_ColorReadBufferIndex = BUFFER_COLOR0;
+ fb->Delete = _mesa_destroy_framebuffer;
+ _glthread_INIT_MUTEX(fb->Mutex);
+}
+
+
+/**
+ * Deallocate buffer and everything attached to it.
+ * Typically called via the gl_framebuffer->Delete() method.
+ */
+void
+_mesa_destroy_framebuffer(struct gl_framebuffer *fb)
+{
+ if (fb) {
+ _mesa_free_framebuffer_data(fb);
+ free(fb);
+ }
+}
+
+
+/**
+ * Free all the data hanging off the given gl_framebuffer, but don't free
+ * the gl_framebuffer object itself.
+ */
+void
+_mesa_free_framebuffer_data(struct gl_framebuffer *fb)
+{
+ GLuint i;
+
+ assert(fb);
+ assert(fb->RefCount == 0);
+
+ _glthread_DESTROY_MUTEX(fb->Mutex);
+
+ for (i = 0; i < BUFFER_COUNT; i++) {
+ struct gl_renderbuffer_attachment *att = &fb->Attachment[i];
+ if (att->Renderbuffer) {
+ _mesa_reference_renderbuffer(&att->Renderbuffer, NULL);
+ }
+ if (att->Texture) {
+ _mesa_reference_texobj(&att->Texture, NULL);
+ }
+ ASSERT(!att->Renderbuffer);
+ ASSERT(!att->Texture);
+ att->Type = GL_NONE;
+ }
+
+ /* unbind _Depth/_StencilBuffer to decr ref counts */
+ _mesa_reference_renderbuffer(&fb->_DepthBuffer, NULL);
+ _mesa_reference_renderbuffer(&fb->_StencilBuffer, NULL);
+}
+
+
+/**
+ * Set *ptr to point to fb, with refcounting and locking.
+ */
+void
+_mesa_reference_framebuffer(struct gl_framebuffer **ptr,
+ struct gl_framebuffer *fb)
+{
+ assert(ptr);
+ if (*ptr == fb) {
+ /* no change */
+ return;
+ }
+
+ if (*ptr) {
+ /* unreference old renderbuffer */
+ GLboolean deleteFlag = GL_FALSE;
+ struct gl_framebuffer *oldFb = *ptr;
+
+ _glthread_LOCK_MUTEX(oldFb->Mutex);
+ ASSERT(oldFb->RefCount > 0);
+ oldFb->RefCount--;
+ deleteFlag = (oldFb->RefCount == 0);
+ _glthread_UNLOCK_MUTEX(oldFb->Mutex);
+
+ if (deleteFlag)
+ oldFb->Delete(oldFb);
+
+ *ptr = NULL;
+ }
+ assert(!*ptr);
+
+ if (fb) {
+ _glthread_LOCK_MUTEX(fb->Mutex);
+ fb->RefCount++;
+ _glthread_UNLOCK_MUTEX(fb->Mutex);
+ *ptr = fb;
+ }
+}
+
+
+/**
+ * Resize the given framebuffer's renderbuffers to the new width and height.
+ * This should only be used for window-system framebuffers, not
+ * user-created renderbuffers (i.e. made with GL_EXT_framebuffer_object).
+ * This will typically be called via ctx->Driver.ResizeBuffers() or directly
+ * from a device driver.
+ *
+ * \note it's possible for ctx to be null since a window can be resized
+ * without a currently bound rendering context.
+ */
+void
+_mesa_resize_framebuffer(struct gl_context *ctx, struct gl_framebuffer *fb,
+ GLuint width, GLuint height)
+{
+ GLuint i;
+
+ /* XXX I think we could check if the size is not changing
+ * and return early.
+ */
+
+ /* For window system framebuffers, Name is zero */
+ assert(fb->Name == 0);
+
+ for (i = 0; i < BUFFER_COUNT; i++) {
+ struct gl_renderbuffer_attachment *att = &fb->Attachment[i];
+ if (att->Type == GL_RENDERBUFFER_EXT && att->Renderbuffer) {
+ struct gl_renderbuffer *rb = att->Renderbuffer;
+ /* only resize if size is changing */
+ if (rb->Width != width || rb->Height != height) {
+ if (rb->AllocStorage(ctx, rb, rb->InternalFormat, width, height)) {
+ ASSERT(rb->Width == width);
+ ASSERT(rb->Height == height);
+ }
+ else {
+ _mesa_error(ctx, GL_OUT_OF_MEMORY, "Resizing framebuffer");
+ /* no return */
+ }
+ }
+ }
+ }
+
+ if (fb->_DepthBuffer) {
+ struct gl_renderbuffer *rb = fb->_DepthBuffer;
+ if (rb->Width != width || rb->Height != height) {
+ if (!rb->AllocStorage(ctx, rb, rb->InternalFormat, width, height)) {
+ _mesa_error(ctx, GL_OUT_OF_MEMORY, "Resizing framebuffer");
+ }
+ }
+ }
+
+ if (fb->_StencilBuffer) {
+ struct gl_renderbuffer *rb = fb->_StencilBuffer;
+ if (rb->Width != width || rb->Height != height) {
+ if (!rb->AllocStorage(ctx, rb, rb->InternalFormat, width, height)) {
+ _mesa_error(ctx, GL_OUT_OF_MEMORY, "Resizing framebuffer");
+ }
+ }
+ }
+
+ fb->Width = width;
+ fb->Height = height;
+
+ if (ctx) {
+ /* update scissor / window bounds */
+ _mesa_update_draw_buffer_bounds(ctx);
+ /* Signal new buffer state so that swrast will update its clipping
+ * info (the CLIP_BIT flag).
+ */
+ ctx->NewState |= _NEW_BUFFERS;
+ }
+}
+
+
+
+/**
+ * XXX THIS IS OBSOLETE - drivers should take care of detecting window
+ * size changes and act accordingly, likely calling _mesa_resize_framebuffer().
+ *
+ * GL_MESA_resize_buffers extension.
+ *
+ * When this function is called, we'll ask the window system how large
+ * the current window is. If it's a new size, we'll call the driver's
+ * ResizeBuffers function. The driver will then resize its color buffers
+ * as needed, and maybe call the swrast's routine for reallocating
+ * swrast-managed depth/stencil/accum/etc buffers.
+ * \note This function should only be called through the GL API, not
+ * from device drivers (as was done in the past).
+ */
+void
+_mesa_resizebuffers( struct gl_context *ctx )
+{
+ ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH( ctx );
+
+ if (MESA_VERBOSE & VERBOSE_API)
+ _mesa_debug(ctx, "glResizeBuffersMESA\n");
+
+ if (!ctx->Driver.GetBufferSize) {
+ return;
+ }
+
+ if (ctx->WinSysDrawBuffer) {
+ GLuint newWidth, newHeight;
+ struct gl_framebuffer *buffer = ctx->WinSysDrawBuffer;
+
+ assert(buffer->Name == 0);
+
+ /* ask device driver for size of output buffer */
+ ctx->Driver.GetBufferSize( buffer, &newWidth, &newHeight );
+
+ /* see if size of device driver's color buffer (window) has changed */
+ if (buffer->Width != newWidth || buffer->Height != newHeight) {
+ if (ctx->Driver.ResizeBuffers)
+ ctx->Driver.ResizeBuffers(ctx, buffer, newWidth, newHeight );
+ }
+ }
+
+ if (ctx->WinSysReadBuffer
+ && ctx->WinSysReadBuffer != ctx->WinSysDrawBuffer) {
+ GLuint newWidth, newHeight;
+ struct gl_framebuffer *buffer = ctx->WinSysReadBuffer;
+
+ assert(buffer->Name == 0);
+
+ /* ask device driver for size of read buffer */
+ ctx->Driver.GetBufferSize( buffer, &newWidth, &newHeight );
+
+ /* see if size of device driver's color buffer (window) has changed */
+ if (buffer->Width != newWidth || buffer->Height != newHeight) {
+ if (ctx->Driver.ResizeBuffers)
+ ctx->Driver.ResizeBuffers(ctx, buffer, newWidth, newHeight );
+ }
+ }
+
+ ctx->NewState |= _NEW_BUFFERS; /* to update scissor / window bounds */
+}
+
+
+/*
+ * XXX THIS IS OBSOLETE
+ */
+void GLAPIENTRY
+_mesa_ResizeBuffersMESA( void )
+{
+ GET_CURRENT_CONTEXT(ctx);
+
+ if (ctx->Extensions.MESA_resize_buffers)
+ _mesa_resizebuffers( ctx );
+}
+
+
+
+/**
+ * Examine all the framebuffer's renderbuffers to update the Width/Height
+ * fields of the framebuffer. If we have renderbuffers with different
+ * sizes, set the framebuffer's width and height to the min size.
+ * Note: this is only intended for user-created framebuffers, not
+ * window-system framebuffes.
+ */
+static void
+update_framebuffer_size(struct gl_context *ctx, struct gl_framebuffer *fb)
+{
+ GLuint minWidth = ~0, minHeight = ~0;
+ GLuint i;
+
+ /* user-created framebuffers only */
+ assert(fb->Name);
+
+ for (i = 0; i < BUFFER_COUNT; i++) {
+ struct gl_renderbuffer_attachment *att = &fb->Attachment[i];
+ const struct gl_renderbuffer *rb = att->Renderbuffer;
+ if (rb) {
+ minWidth = MIN2(minWidth, rb->Width);
+ minHeight = MIN2(minHeight, rb->Height);
+ }
+ }
+
+ if (minWidth != ~0) {
+ fb->Width = minWidth;
+ fb->Height = minHeight;
+ }
+ else {
+ fb->Width = 0;
+ fb->Height = 0;
+ }
+}
+
+
+/**
+ * Update the context's current drawing buffer's Xmin, Xmax, Ymin, Ymax fields.
+ * These values are computed from the buffer's width and height and
+ * the scissor box, if it's enabled.
+ * \param ctx the GL context.
+ */
+void
+_mesa_update_draw_buffer_bounds(struct gl_context *ctx)
+{
+ struct gl_framebuffer *buffer = ctx->DrawBuffer;
+
+ if (!buffer)
+ return;
+
+ if (buffer->Name) {
+ /* user-created framebuffer size depends on the renderbuffers */
+ update_framebuffer_size(ctx, buffer);
+ }
+
+ buffer->_Xmin = 0;
+ buffer->_Ymin = 0;
+ buffer->_Xmax = buffer->Width;
+ buffer->_Ymax = buffer->Height;
+
+ if (ctx->Scissor.Enabled) {
+ if (ctx->Scissor.X > buffer->_Xmin) {
+ buffer->_Xmin = ctx->Scissor.X;
+ }
+ if (ctx->Scissor.Y > buffer->_Ymin) {
+ buffer->_Ymin = ctx->Scissor.Y;
+ }
+ if (ctx->Scissor.X + ctx->Scissor.Width < buffer->_Xmax) {
+ buffer->_Xmax = ctx->Scissor.X + ctx->Scissor.Width;
+ }
+ if (ctx->Scissor.Y + ctx->Scissor.Height < buffer->_Ymax) {
+ buffer->_Ymax = ctx->Scissor.Y + ctx->Scissor.Height;
+ }
+ /* finally, check for empty region */
+ if (buffer->_Xmin > buffer->_Xmax) {
+ buffer->_Xmin = buffer->_Xmax;
+ }
+ if (buffer->_Ymin > buffer->_Ymax) {
+ buffer->_Ymin = buffer->_Ymax;
+ }
+ }
+
+ ASSERT(buffer->_Xmin <= buffer->_Xmax);
+ ASSERT(buffer->_Ymin <= buffer->_Ymax);
+}
+
+
+/**
+ * The glGet queries of the framebuffer red/green/blue size, stencil size,
+ * etc. are satisfied by the fields of ctx->DrawBuffer->Visual. These can
+ * change depending on the renderbuffer bindings. This function updates
+ * the given framebuffer's Visual from the current renderbuffer bindings.
+ *
+ * This may apply to user-created framebuffers or window system framebuffers.
+ *
+ * Also note: ctx->DrawBuffer->Visual.depthBits might not equal
+ * ctx->DrawBuffer->Attachment[BUFFER_DEPTH].Renderbuffer.DepthBits.
+ * The former one is used to convert floating point depth values into
+ * integer Z values.
+ */
+void
+_mesa_update_framebuffer_visual(struct gl_context *ctx,
+ struct gl_framebuffer *fb)
+{
+ GLuint i;
+
+ memset(&fb->Visual, 0, sizeof(fb->Visual));
+ fb->Visual.rgbMode = GL_TRUE; /* assume this */
+
+#if 0 /* this _might_ be needed */
+ if (fb->_Status != GL_FRAMEBUFFER_COMPLETE_EXT) {
+ /* leave visual fields zero'd */
+ return;
+ }
+#endif
+
+ /* find first RGB renderbuffer */
+ for (i = 0; i < BUFFER_COUNT; i++) {
+ if (fb->Attachment[i].Renderbuffer) {
+ const struct gl_renderbuffer *rb = fb->Attachment[i].Renderbuffer;
+ const GLenum baseFormat = _mesa_get_format_base_format(rb->Format);
+ const gl_format fmt = rb->Format;
+
+ if (_mesa_is_legal_color_format(ctx, baseFormat)) {
+ fb->Visual.redBits = _mesa_get_format_bits(fmt, GL_RED_BITS);
+ fb->Visual.greenBits = _mesa_get_format_bits(fmt, GL_GREEN_BITS);
+ fb->Visual.blueBits = _mesa_get_format_bits(fmt, GL_BLUE_BITS);
+ fb->Visual.alphaBits = _mesa_get_format_bits(fmt, GL_ALPHA_BITS);
+ fb->Visual.rgbBits = fb->Visual.redBits
+ + fb->Visual.greenBits + fb->Visual.blueBits;
+ fb->Visual.samples = rb->NumSamples;
+ if (_mesa_get_format_color_encoding(fmt) == GL_SRGB)
+ fb->Visual.sRGBCapable = ctx->Const.sRGBCapable;
+ break;
+ }
+ }
+ }
+
+ fb->Visual.floatMode = GL_FALSE;
+ for (i = 0; i < BUFFER_COUNT; i++) {
+ if (fb->Attachment[i].Renderbuffer) {
+ const struct gl_renderbuffer *rb = fb->Attachment[i].Renderbuffer;
+ const gl_format fmt = rb->Format;
+
+ if (_mesa_get_format_datatype(fmt) == GL_FLOAT) {
+ fb->Visual.floatMode = GL_TRUE;
+ break;
+ }
+ }
+ }
+
+ if (fb->Attachment[BUFFER_DEPTH].Renderbuffer) {
+ const struct gl_renderbuffer *rb =
+ fb->Attachment[BUFFER_DEPTH].Renderbuffer;
+ const gl_format fmt = rb->Format;
+ fb->Visual.haveDepthBuffer = GL_TRUE;
+ fb->Visual.depthBits = _mesa_get_format_bits(fmt, GL_DEPTH_BITS);
+ }
+
+ if (fb->Attachment[BUFFER_STENCIL].Renderbuffer) {
+ const struct gl_renderbuffer *rb =
+ fb->Attachment[BUFFER_STENCIL].Renderbuffer;
+ const gl_format fmt = rb->Format;
+ fb->Visual.haveStencilBuffer = GL_TRUE;
+ fb->Visual.stencilBits = _mesa_get_format_bits(fmt, GL_STENCIL_BITS);
+ }
+
+ if (fb->Attachment[BUFFER_ACCUM].Renderbuffer) {
+ const struct gl_renderbuffer *rb =
+ fb->Attachment[BUFFER_ACCUM].Renderbuffer;
+ const gl_format fmt = rb->Format;
+ fb->Visual.haveAccumBuffer = GL_TRUE;
+ fb->Visual.accumRedBits = _mesa_get_format_bits(fmt, GL_RED_BITS);
+ fb->Visual.accumGreenBits = _mesa_get_format_bits(fmt, GL_GREEN_BITS);
+ fb->Visual.accumBlueBits = _mesa_get_format_bits(fmt, GL_BLUE_BITS);
+ fb->Visual.accumAlphaBits = _mesa_get_format_bits(fmt, GL_ALPHA_BITS);
+ }
+
+ compute_depth_max(fb);
+}
+
+
+/**
+ * Update the framebuffer's _DepthBuffer field using the renderbuffer
+ * found at the given attachment index.
+ *
+ * If that attachment points to a combined GL_DEPTH_STENCIL renderbuffer,
+ * create and install a depth wrapper/adaptor.
+ *
+ * \param fb the framebuffer whose _DepthBuffer field to update
+ * \param attIndex indicates the renderbuffer to possibly wrap
+ */
+void
+_mesa_update_depth_buffer(struct gl_context *ctx,
+ struct gl_framebuffer *fb,
+ GLuint attIndex)
+{
+ struct gl_renderbuffer *depthRb;
+
+ /* only one possiblity for now */
+ ASSERT(attIndex == BUFFER_DEPTH);
+
+ depthRb = fb->Attachment[attIndex].Renderbuffer;
+
+ if (depthRb && _mesa_is_format_packed_depth_stencil(depthRb->Format)) {
+ /* The attached depth buffer is a GL_DEPTH_STENCIL renderbuffer */
+ if (!fb->_DepthBuffer
+ || fb->_DepthBuffer->Wrapped != depthRb
+ || _mesa_get_format_base_format(fb->_DepthBuffer->Format) != GL_DEPTH_COMPONENT) {
+ /* need to update wrapper */
+ struct gl_renderbuffer *wrapper
+ = _mesa_new_z24_renderbuffer_wrapper(ctx, depthRb);
+ _mesa_reference_renderbuffer(&fb->_DepthBuffer, wrapper);
+ ASSERT(fb->_DepthBuffer->Wrapped == depthRb);
+ }
+ }
+ else {
+ /* depthRb may be null */
+ _mesa_reference_renderbuffer(&fb->_DepthBuffer, depthRb);
+ }
+}
+
+
+/**
+ * Update the framebuffer's _StencilBuffer field using the renderbuffer
+ * found at the given attachment index.
+ *
+ * If that attachment points to a combined GL_DEPTH_STENCIL renderbuffer,
+ * create and install a stencil wrapper/adaptor.
+ *
+ * \param fb the framebuffer whose _StencilBuffer field to update
+ * \param attIndex indicates the renderbuffer to possibly wrap
+ */
+void
+_mesa_update_stencil_buffer(struct gl_context *ctx,
+ struct gl_framebuffer *fb,
+ GLuint attIndex)
+{
+ struct gl_renderbuffer *stencilRb;
+
+ ASSERT(attIndex == BUFFER_DEPTH ||
+ attIndex == BUFFER_STENCIL);
+
+ stencilRb = fb->Attachment[attIndex].Renderbuffer;
+
+ if (stencilRb && _mesa_is_format_packed_depth_stencil(stencilRb->Format)) {
+ /* The attached stencil buffer is a GL_DEPTH_STENCIL renderbuffer */
+ if (!fb->_StencilBuffer
+ || fb->_StencilBuffer->Wrapped != stencilRb
+ || _mesa_get_format_base_format(fb->_StencilBuffer->Format) != GL_STENCIL_INDEX) {
+ /* need to update wrapper */
+ struct gl_renderbuffer *wrapper
+ = _mesa_new_s8_renderbuffer_wrapper(ctx, stencilRb);
+ _mesa_reference_renderbuffer(&fb->_StencilBuffer, wrapper);
+ ASSERT(fb->_StencilBuffer->Wrapped == stencilRb);
+ }
+ }
+ else {
+ /* stencilRb may be null */
+ _mesa_reference_renderbuffer(&fb->_StencilBuffer, stencilRb);
+ }
+}
+
+
+/*
+ * Example DrawBuffers scenarios:
+ *
+ * 1. glDrawBuffer(GL_FRONT_AND_BACK), fixed-func or shader writes to
+ * "gl_FragColor" or program writes to the "result.color" register:
+ *
+ * fragment color output renderbuffer
+ * --------------------- ---------------
+ * color[0] Front, Back
+ *
+ *
+ * 2. glDrawBuffers(3, [GL_FRONT, GL_AUX0, GL_AUX1]), shader writes to
+ * gl_FragData[i] or program writes to result.color[i] registers:
+ *
+ * fragment color output renderbuffer
+ * --------------------- ---------------
+ * color[0] Front
+ * color[1] Aux0
+ * color[3] Aux1
+ *
+ *
+ * 3. glDrawBuffers(3, [GL_FRONT, GL_AUX0, GL_AUX1]) and shader writes to
+ * gl_FragColor, or fixed function:
+ *
+ * fragment color output renderbuffer
+ * --------------------- ---------------
+ * color[0] Front, Aux0, Aux1
+ *
+ *
+ * In either case, the list of renderbuffers is stored in the
+ * framebuffer->_ColorDrawBuffers[] array and
+ * framebuffer->_NumColorDrawBuffers indicates the number of buffers.
+ * The renderer (like swrast) has to look at the current fragment shader
+ * to see if it writes to gl_FragColor vs. gl_FragData[i] to determine
+ * how to map color outputs to renderbuffers.
+ *
+ * Note that these two calls are equivalent (for fixed function fragment
+ * shading anyway):
+ * a) glDrawBuffer(GL_FRONT_AND_BACK); (assuming non-stereo framebuffer)
+ * b) glDrawBuffers(2, [GL_FRONT_LEFT, GL_BACK_LEFT]);
+ */
+
+
+
+
+/**
+ * Update the (derived) list of color drawing renderbuffer pointers.
+ * Later, when we're rendering we'll loop from 0 to _NumColorDrawBuffers
+ * writing colors.
+ */
+static void
+update_color_draw_buffers(struct gl_context *ctx, struct gl_framebuffer *fb)
+{
+ GLuint output;
+
+ /* set 0th buffer to NULL now in case _NumColorDrawBuffers is zero */
+ fb->_ColorDrawBuffers[0] = NULL;
+
+ for (output = 0; output < fb->_NumColorDrawBuffers; output++) {
+ GLint buf = fb->_ColorDrawBufferIndexes[output];
+ if (buf >= 0) {
+ fb->_ColorDrawBuffers[output] = fb->Attachment[buf].Renderbuffer;
+ }
+ else {
+ fb->_ColorDrawBuffers[output] = NULL;
+ }
+ }
+}
+
+
+/**
+ * Update the (derived) color read renderbuffer pointer.
+ * Unlike the DrawBuffer, we can only read from one (or zero) color buffers.
+ */
+static void
+update_color_read_buffer(struct gl_context *ctx, struct gl_framebuffer *fb)
+{
+ (void) ctx;
+ if (fb->_ColorReadBufferIndex == -1 ||
+ fb->DeletePending ||
+ fb->Width == 0 ||
+ fb->Height == 0) {
+ fb->_ColorReadBuffer = NULL; /* legal! */
+ }
+ else {
+ ASSERT(fb->_ColorReadBufferIndex >= 0);
+ ASSERT(fb->_ColorReadBufferIndex < BUFFER_COUNT);
+ fb->_ColorReadBuffer
+ = fb->Attachment[fb->_ColorReadBufferIndex].Renderbuffer;
+ }
+}
+
+
+/**
+ * Update a gl_framebuffer's derived state.
+ *
+ * Specifically, update these framebuffer fields:
+ * _ColorDrawBuffers
+ * _NumColorDrawBuffers
+ * _ColorReadBuffer
+ * _DepthBuffer
+ * _StencilBuffer
+ *
+ * If the framebuffer is user-created, make sure it's complete.
+ *
+ * The following functions (at least) can effect framebuffer state:
+ * glReadBuffer, glDrawBuffer, glDrawBuffersARB, glFramebufferRenderbufferEXT,
+ * glRenderbufferStorageEXT.
+ */
+static void
+update_framebuffer(struct gl_context *ctx, struct gl_framebuffer *fb)
+{
+ if (fb->Name == 0) {
+ /* This is a window-system framebuffer */
+ /* Need to update the FB's GL_DRAW_BUFFER state to match the
+ * context state (GL_READ_BUFFER too).
+ */
+ if (fb->ColorDrawBuffer[0] != ctx->Color.DrawBuffer[0]) {
+ _mesa_drawbuffers(ctx, ctx->Const.MaxDrawBuffers,
+ ctx->Color.DrawBuffer, NULL);
+ }
+ }
+ else {
+ /* This is a user-created framebuffer.
+ * Completeness only matters for user-created framebuffers.
+ */
+ if (fb->_Status != GL_FRAMEBUFFER_COMPLETE) {
+ _mesa_test_framebuffer_completeness(ctx, fb);
+ }
+ }
+
+ /* Strictly speaking, we don't need to update the draw-state
+ * if this FB is bound as ctx->ReadBuffer (and conversely, the
+ * read-state if this FB is bound as ctx->DrawBuffer), but no
+ * harm.
+ */
+ update_color_draw_buffers(ctx, fb);
+ update_color_read_buffer(ctx, fb);
+ _mesa_update_depth_buffer(ctx, fb, BUFFER_DEPTH);
+ _mesa_update_stencil_buffer(ctx, fb, BUFFER_STENCIL);
+
+ compute_depth_max(fb);
+}
+
+
+/**
+ * Update state related to the current draw/read framebuffers.
+ */
+void
+_mesa_update_framebuffer(struct gl_context *ctx)
+{
+ struct gl_framebuffer *drawFb;
+ struct gl_framebuffer *readFb;
+
+ assert(ctx);
+ drawFb = ctx->DrawBuffer;
+ readFb = ctx->ReadBuffer;
+
+ update_framebuffer(ctx, drawFb);
+ if (readFb != drawFb)
+ update_framebuffer(ctx, readFb);
+}
+
+
+/**
+ * Check if the renderbuffer for a read operation (glReadPixels, glCopyPixels,
+ * glCopyTex[Sub]Image, etc) exists.
+ * \param format a basic image format such as GL_RGB, GL_RGBA, GL_ALPHA,
+ * GL_DEPTH_COMPONENT, etc. or GL_COLOR, GL_DEPTH, GL_STENCIL.
+ * \return GL_TRUE if buffer exists, GL_FALSE otherwise
+ */
+GLboolean
+_mesa_source_buffer_exists(struct gl_context *ctx, GLenum format)
+{
+ const struct gl_renderbuffer_attachment *att = ctx->ReadBuffer->Attachment;
+
+ /* If we don't know the framebuffer status, update it now */
+ if (ctx->ReadBuffer->_Status == 0) {
+ _mesa_test_framebuffer_completeness(ctx, ctx->ReadBuffer);
+ }
+
+ if (ctx->ReadBuffer->_Status != GL_FRAMEBUFFER_COMPLETE_EXT) {
+ return GL_FALSE;
+ }
+
+ switch (format) {
+ case GL_COLOR:
+ case GL_RED:
+ case GL_GREEN:
+ case GL_BLUE:
+ case GL_ALPHA:
+ case GL_LUMINANCE:
+ case GL_LUMINANCE_ALPHA:
+ case GL_INTENSITY:
+ case GL_RG:
+ case GL_RGB:
+ case GL_BGR:
+ case GL_RGBA:
+ case GL_BGRA:
+ case GL_ABGR_EXT:
+ case GL_COLOR_INDEX:
+ case GL_RED_INTEGER_EXT:
+ case GL_GREEN_INTEGER_EXT:
+ case GL_BLUE_INTEGER_EXT:
+ case GL_ALPHA_INTEGER_EXT:
+ case GL_RGB_INTEGER_EXT:
+ case GL_RGBA_INTEGER_EXT:
+ case GL_BGR_INTEGER_EXT:
+ case GL_BGRA_INTEGER_EXT:
+ case GL_LUMINANCE_INTEGER_EXT:
+ case GL_LUMINANCE_ALPHA_INTEGER_EXT:
+ if (ctx->ReadBuffer->_ColorReadBuffer == NULL) {
+ return GL_FALSE;
+ }
+ ASSERT(_mesa_get_format_bits(ctx->ReadBuffer->_ColorReadBuffer->Format, GL_RED_BITS) > 0 ||
+ _mesa_get_format_bits(ctx->ReadBuffer->_ColorReadBuffer->Format, GL_ALPHA_BITS) > 0 ||
+ _mesa_get_format_bits(ctx->ReadBuffer->_ColorReadBuffer->Format, GL_TEXTURE_LUMINANCE_SIZE) > 0 ||
+ _mesa_get_format_bits(ctx->ReadBuffer->_ColorReadBuffer->Format, GL_TEXTURE_INTENSITY_SIZE) > 0 ||
+ _mesa_get_format_bits(ctx->ReadBuffer->_ColorReadBuffer->Format, GL_INDEX_BITS) > 0);
+ break;
+ case GL_DEPTH:
+ case GL_DEPTH_COMPONENT:
+ if (!att[BUFFER_DEPTH].Renderbuffer) {
+ return GL_FALSE;
+ }
+ /*ASSERT(att[BUFFER_DEPTH].Renderbuffer->DepthBits > 0);*/
+ break;
+ case GL_STENCIL:
+ case GL_STENCIL_INDEX:
+ if (!att[BUFFER_STENCIL].Renderbuffer) {
+ return GL_FALSE;
+ }
+ /*ASSERT(att[BUFFER_STENCIL].Renderbuffer->StencilBits > 0);*/
+ break;
+ case GL_DEPTH_STENCIL_EXT:
+ if (!att[BUFFER_DEPTH].Renderbuffer ||
+ !att[BUFFER_STENCIL].Renderbuffer) {
+ return GL_FALSE;
+ }
+ /*
+ ASSERT(att[BUFFER_DEPTH].Renderbuffer->DepthBits > 0);
+ ASSERT(att[BUFFER_STENCIL].Renderbuffer->StencilBits > 0);
+ */
+ break;
+ default:
+ _mesa_problem(ctx,
+ "Unexpected format 0x%x in _mesa_source_buffer_exists",
+ format);
+ return GL_FALSE;
+ }
+
+ /* OK */
+ return GL_TRUE;
+}
+
+
+/**
+ * As above, but for drawing operations.
+ * XXX could do some code merging w/ above function.
+ */
+GLboolean
+_mesa_dest_buffer_exists(struct gl_context *ctx, GLenum format)
+{
+ const struct gl_renderbuffer_attachment *att = ctx->DrawBuffer->Attachment;
+
+ /* If we don't know the framebuffer status, update it now */
+ if (ctx->DrawBuffer->_Status == 0) {
+ _mesa_test_framebuffer_completeness(ctx, ctx->DrawBuffer);
+ }
+
+ if (ctx->DrawBuffer->_Status != GL_FRAMEBUFFER_COMPLETE_EXT) {
+ return GL_FALSE;
+ }
+
+ switch (format) {
+ case GL_COLOR:
+ case GL_RED:
+ case GL_GREEN:
+ case GL_BLUE:
+ case GL_ALPHA:
+ case GL_LUMINANCE:
+ case GL_LUMINANCE_ALPHA:
+ case GL_INTENSITY:
+ case GL_RGB:
+ case GL_BGR:
+ case GL_RGBA:
+ case GL_BGRA:
+ case GL_ABGR_EXT:
+ case GL_COLOR_INDEX:
+ case GL_RED_INTEGER_EXT:
+ case GL_GREEN_INTEGER_EXT:
+ case GL_BLUE_INTEGER_EXT:
+ case GL_ALPHA_INTEGER_EXT:
+ case GL_RGB_INTEGER_EXT:
+ case GL_RGBA_INTEGER_EXT:
+ case GL_BGR_INTEGER_EXT:
+ case GL_BGRA_INTEGER_EXT:
+ case GL_LUMINANCE_INTEGER_EXT:
+ case GL_LUMINANCE_ALPHA_INTEGER_EXT:
+ /* Nothing special since GL_DRAW_BUFFER could be GL_NONE. */
+ /* Could assert that colorbuffer has RedBits > 0 */
+ break;
+ case GL_DEPTH:
+ case GL_DEPTH_COMPONENT:
+ if (!att[BUFFER_DEPTH].Renderbuffer) {
+ return GL_FALSE;
+ }
+ /*ASSERT(att[BUFFER_DEPTH].Renderbuffer->DepthBits > 0);*/
+ break;
+ case GL_STENCIL:
+ case GL_STENCIL_INDEX:
+ if (!att[BUFFER_STENCIL].Renderbuffer) {
+ return GL_FALSE;
+ }
+ /*ASSERT(att[BUFFER_STENCIL].Renderbuffer->StencilBits > 0);*/
+ break;
+ case GL_DEPTH_STENCIL_EXT:
+ if (!att[BUFFER_DEPTH].Renderbuffer ||
+ !att[BUFFER_STENCIL].Renderbuffer) {
+ return GL_FALSE;
+ }
+ /*
+ ASSERT(att[BUFFER_DEPTH].Renderbuffer->DepthBits > 0);
+ ASSERT(att[BUFFER_STENCIL].Renderbuffer->StencilBits > 0);
+ */
+ break;
+ default:
+ _mesa_problem(ctx,
+ "Unexpected format 0x%x in _mesa_dest_buffer_exists",
+ format);
+ return GL_FALSE;
+ }
+
+ /* OK */
+ return GL_TRUE;
+}
+
+
+/**
+ * Used to answer the GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES query.
+ */
+GLenum
+_mesa_get_color_read_format(struct gl_context *ctx)
+{
+ switch (ctx->ReadBuffer->_ColorReadBuffer->Format) {
+ case MESA_FORMAT_ARGB8888:
+ return GL_BGRA;
+ case MESA_FORMAT_RGB565:
+ return GL_BGR;
+ default:
+ return GL_RGBA;
+ }
+}
+
+
+/**
+ * Used to answer the GL_IMPLEMENTATION_COLOR_READ_TYPE_OES query.
+ */
+GLenum
+_mesa_get_color_read_type(struct gl_context *ctx)
+{
+ switch (ctx->ReadBuffer->_ColorReadBuffer->Format) {
+ case MESA_FORMAT_ARGB8888:
+ return GL_UNSIGNED_BYTE;
+ case MESA_FORMAT_RGB565:
+ return GL_UNSIGNED_SHORT_5_6_5_REV;
+ default:
+ return GL_UNSIGNED_BYTE;
+ }
+}
+
+
+/**
+ * Print framebuffer info to stderr, for debugging.
+ */
+void
+_mesa_print_framebuffer(const struct gl_framebuffer *fb)
+{
+ GLuint i;
+
+ fprintf(stderr, "Mesa Framebuffer %u at %p\n", fb->Name, (void *) fb);
+ fprintf(stderr, " Size: %u x %u Status: %s\n", fb->Width, fb->Height,
+ _mesa_lookup_enum_by_nr(fb->_Status));
+ fprintf(stderr, " Attachments:\n");
+
+ for (i = 0; i < BUFFER_COUNT; i++) {
+ const struct gl_renderbuffer_attachment *att = &fb->Attachment[i];
+ if (att->Type == GL_TEXTURE) {
+ const struct gl_texture_image *texImage =
+ _mesa_get_attachment_teximage_const(att);
+ fprintf(stderr,
+ " %2d: Texture %u, level %u, face %u, slice %u, complete %d\n",
+ i, att->Texture->Name, att->TextureLevel, att->CubeMapFace,
+ att->Zoffset, att->Complete);
+ fprintf(stderr, " Size: %u x %u x %u Format %s\n",
+ texImage->Width, texImage->Height, texImage->Depth,
+ _mesa_get_format_name(texImage->TexFormat));
+ }
+ else if (att->Type == GL_RENDERBUFFER) {
+ fprintf(stderr, " %2d: Renderbuffer %u, complete %d\n",
+ i, att->Renderbuffer->Name, att->Complete);
+ fprintf(stderr, " Size: %u x %u Format %s\n",
+ att->Renderbuffer->Width, att->Renderbuffer->Height,
+ _mesa_get_format_name(att->Renderbuffer->Format));
+ }
+ else {
+ fprintf(stderr, " %2d: none\n", i);
+ }
+ }
+}
diff --git a/mesalib/src/mesa/main/get.c b/mesalib/src/mesa/main/get.c
index 0492e1585..15c808194 100644
--- a/mesalib/src/mesa/main/get.c
+++ b/mesalib/src/mesa/main/get.c
@@ -1,2620 +1,2620 @@
-/*
- * Copyright (C) 2010 Brian Paul All Rights Reserved.
- * Copyright (C) 2010 Intel Corporation
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- * Author: Kristian Høgsberg <krh@bitplanet.net>
- */
-
-#include "glheader.h"
-#include "context.h"
-#include "enable.h"
-#include "enums.h"
-#include "extensions.h"
-#include "get.h"
-#include "macros.h"
-#include "mfeatures.h"
-#include "mtypes.h"
-#include "state.h"
-#include "texcompress.h"
-#include "framebuffer.h"
-
-/* This is a table driven implemetation of the glGet*v() functions.
- * The basic idea is that most getters just look up an int somewhere
- * in struct gl_context and then convert it to a bool or float according to
- * which of glGetIntegerv() glGetBooleanv() etc is being called.
- * Instead of generating code to do this, we can just record the enum
- * value and the offset into struct gl_context in an array of structs. Then
- * in glGet*(), we lookup the struct for the enum in question, and use
- * the offset to get the int we need.
- *
- * Sometimes we need to look up a float, a boolean, a bit in a
- * bitfield, a matrix or other types instead, so we need to track the
- * type of the value in struct gl_context. And sometimes the value isn't in
- * struct gl_context but in the drawbuffer, the array object, current texture
- * unit, or maybe it's a computed value. So we need to also track
- * where or how to find the value. Finally, we sometimes need to
- * check that one of a number of extensions are enabled, the GL
- * version or flush or call _mesa_update_state(). This is done by
- * attaching optional extra information to the value description
- * struct, it's sort of like an array of opcodes that describe extra
- * checks or actions.
- *
- * Putting all this together we end up with struct value_desc below,
- * and with a couple of macros to help, the table of struct value_desc
- * is about as concise as the specification in the old python script.
- */
-
-#undef CONST
-
-#define FLOAT_TO_BOOLEAN(X) ( (X) ? GL_TRUE : GL_FALSE )
-#define FLOAT_TO_FIXED(F) ( ((F) * 65536.0f > INT_MAX) ? INT_MAX : \
- ((F) * 65536.0f < INT_MIN) ? INT_MIN : \
- (GLint) ((F) * 65536.0f) )
-
-#define INT_TO_BOOLEAN(I) ( (I) ? GL_TRUE : GL_FALSE )
-#define INT_TO_FIXED(I) ( ((I) > SHRT_MAX) ? INT_MAX : \
- ((I) < SHRT_MIN) ? INT_MIN : \
- (GLint) ((I) * 65536) )
-
-#define INT64_TO_BOOLEAN(I) ( (I) ? GL_TRUE : GL_FALSE )
-#define INT64_TO_INT(I) ( (GLint)((I > INT_MAX) ? INT_MAX : ((I < INT_MIN) ? INT_MIN : (I))) )
-
-#define BOOLEAN_TO_INT(B) ( (GLint) (B) )
-#define BOOLEAN_TO_INT64(B) ( (GLint64) (B) )
-#define BOOLEAN_TO_FLOAT(B) ( (B) ? 1.0F : 0.0F )
-#define BOOLEAN_TO_FIXED(B) ( (GLint) ((B) ? 1 : 0) << 16 )
-
-#define ENUM_TO_INT64(E) ( (GLint64) (E) )
-#define ENUM_TO_FIXED(E) (E)
-
-enum value_type {
- TYPE_INVALID,
- TYPE_API_MASK,
- TYPE_INT,
- TYPE_INT_2,
- TYPE_INT_3,
- TYPE_INT_4,
- TYPE_INT_N,
- TYPE_INT64,
- TYPE_ENUM,
- TYPE_ENUM_2,
- TYPE_BOOLEAN,
- TYPE_BIT_0,
- TYPE_BIT_1,
- TYPE_BIT_2,
- TYPE_BIT_3,
- TYPE_BIT_4,
- TYPE_BIT_5,
- TYPE_FLOAT,
- TYPE_FLOAT_2,
- TYPE_FLOAT_3,
- TYPE_FLOAT_4,
- TYPE_FLOATN,
- TYPE_FLOATN_2,
- TYPE_FLOATN_3,
- TYPE_FLOATN_4,
- TYPE_DOUBLEN,
- TYPE_MATRIX,
- TYPE_MATRIX_T,
- TYPE_CONST
-};
-
-enum value_location {
- LOC_BUFFER,
- LOC_CONTEXT,
- LOC_ARRAY,
- LOC_TEXUNIT,
- LOC_CUSTOM
-};
-
-enum value_extra {
- EXTRA_END = 0x8000,
- EXTRA_VERSION_30,
- EXTRA_VERSION_31,
- EXTRA_VERSION_32,
- EXTRA_VERSION_ES2,
- EXTRA_NEW_BUFFERS,
- EXTRA_NEW_FRAG_CLAMP,
- EXTRA_VALID_DRAW_BUFFER,
- EXTRA_VALID_TEXTURE_UNIT,
- EXTRA_FLUSH_CURRENT,
-};
-
-#define NO_EXTRA NULL
-#define NO_OFFSET 0
-
-struct value_desc {
- GLenum pname;
- GLubyte location; /**< enum value_location */
- GLubyte type; /**< enum value_type */
- int offset;
- const int *extra;
-};
-
-union value {
- GLfloat value_float;
- GLfloat value_float_4[4];
- GLmatrix *value_matrix;
- GLint value_int;
- GLint value_int_4[4];
- GLint64 value_int64;
- GLenum value_enum;
-
- /* Sigh, see GL_COMPRESSED_TEXTURE_FORMATS_ARB handling */
- struct {
- GLint n, ints[100];
- } value_int_n;
- GLboolean value_bool;
-};
-
-#define BUFFER_FIELD(field, type) \
- LOC_BUFFER, type, offsetof(struct gl_framebuffer, field)
-#define CONTEXT_FIELD(field, type) \
- LOC_CONTEXT, type, offsetof(struct gl_context, field)
-#define ARRAY_FIELD(field, type) \
- LOC_ARRAY, type, offsetof(struct gl_array_object, field)
-#define CONST(value) \
- LOC_CONTEXT, TYPE_CONST, value
-
-#define BUFFER_INT(field) BUFFER_FIELD(field, TYPE_INT)
-#define BUFFER_ENUM(field) BUFFER_FIELD(field, TYPE_ENUM)
-#define BUFFER_BOOL(field) BUFFER_FIELD(field, TYPE_BOOLEAN)
-
-#define CONTEXT_INT(field) CONTEXT_FIELD(field, TYPE_INT)
-#define CONTEXT_INT2(field) CONTEXT_FIELD(field, TYPE_INT_2)
-#define CONTEXT_INT64(field) CONTEXT_FIELD(field, TYPE_INT64)
-#define CONTEXT_ENUM(field) CONTEXT_FIELD(field, TYPE_ENUM)
-#define CONTEXT_ENUM2(field) CONTEXT_FIELD(field, TYPE_ENUM_2)
-#define CONTEXT_BOOL(field) CONTEXT_FIELD(field, TYPE_BOOLEAN)
-#define CONTEXT_BIT0(field) CONTEXT_FIELD(field, TYPE_BIT_0)
-#define CONTEXT_BIT1(field) CONTEXT_FIELD(field, TYPE_BIT_1)
-#define CONTEXT_BIT2(field) CONTEXT_FIELD(field, TYPE_BIT_2)
-#define CONTEXT_BIT3(field) CONTEXT_FIELD(field, TYPE_BIT_3)
-#define CONTEXT_BIT4(field) CONTEXT_FIELD(field, TYPE_BIT_4)
-#define CONTEXT_BIT5(field) CONTEXT_FIELD(field, TYPE_BIT_5)
-#define CONTEXT_FLOAT(field) CONTEXT_FIELD(field, TYPE_FLOAT)
-#define CONTEXT_FLOAT2(field) CONTEXT_FIELD(field, TYPE_FLOAT_2)
-#define CONTEXT_FLOAT3(field) CONTEXT_FIELD(field, TYPE_FLOAT_3)
-#define CONTEXT_FLOAT4(field) CONTEXT_FIELD(field, TYPE_FLOAT_4)
-#define CONTEXT_MATRIX(field) CONTEXT_FIELD(field, TYPE_MATRIX)
-#define CONTEXT_MATRIX_T(field) CONTEXT_FIELD(field, TYPE_MATRIX_T)
-
-#define ARRAY_INT(field) ARRAY_FIELD(field, TYPE_INT)
-#define ARRAY_ENUM(field) ARRAY_FIELD(field, TYPE_ENUM)
-#define ARRAY_BOOL(field) ARRAY_FIELD(field, TYPE_BOOLEAN)
-
-#define EXT(f) \
- offsetof(struct gl_extensions, f)
-
-#define EXTRA_EXT(e) \
- static const int extra_##e[] = { \
- EXT(e), EXTRA_END \
- }
-
-#define EXTRA_EXT2(e1, e2) \
- static const int extra_##e1##_##e2[] = { \
- EXT(e1), EXT(e2), EXTRA_END \
- }
-
-/* The 'extra' mechanism is a way to specify extra checks (such as
- * extensions or specific gl versions) or actions (flush current, new
- * buffers) that we need to do before looking up an enum. We need to
- * declare them all up front so we can refer to them in the value_desc
- * structs below. */
-
-static const int extra_new_buffers[] = {
- EXTRA_NEW_BUFFERS,
- EXTRA_END
-};
-
-static const int extra_new_frag_clamp[] = {
- EXTRA_NEW_FRAG_CLAMP,
- EXTRA_END
-};
-
-static const int extra_valid_draw_buffer[] = {
- EXTRA_VALID_DRAW_BUFFER,
- EXTRA_END
-};
-
-static const int extra_valid_texture_unit[] = {
- EXTRA_VALID_TEXTURE_UNIT,
- EXTRA_END
-};
-
-static const int extra_flush_current_valid_texture_unit[] = {
- EXTRA_FLUSH_CURRENT,
- EXTRA_VALID_TEXTURE_UNIT,
- EXTRA_END
-};
-
-static const int extra_flush_current[] = {
- EXTRA_FLUSH_CURRENT,
- EXTRA_END
-};
-
-static const int extra_new_buffers_OES_read_format[] = {
- EXTRA_NEW_BUFFERS,
- EXT(OES_read_format),
- EXTRA_END
-};
-
-static const int extra_EXT_secondary_color_flush_current[] = {
- EXT(EXT_secondary_color),
- EXTRA_FLUSH_CURRENT,
- EXTRA_END
-};
-
-static const int extra_EXT_fog_coord_flush_current[] = {
- EXT(EXT_fog_coord),
- EXTRA_FLUSH_CURRENT,
- EXTRA_END
-};
-
-static const int extra_EXT_texture_integer[] = {
- EXT(EXT_texture_integer),
- EXTRA_END
-};
-
-static const int extra_EXT_gpu_shader4[] = {
- EXT(EXT_gpu_shader4),
- EXTRA_END
-};
-
-static const int extra_ARB_sampler_objects[] = {
- EXT(ARB_sampler_objects),
- EXTRA_END
-};
-
-
-EXTRA_EXT(ARB_ES2_compatibility);
-EXTRA_EXT(ARB_multitexture);
-EXTRA_EXT(ARB_texture_cube_map);
-EXTRA_EXT(MESA_texture_array);
-EXTRA_EXT2(EXT_secondary_color, ARB_vertex_program);
-EXTRA_EXT(EXT_secondary_color);
-EXTRA_EXT(EXT_fog_coord);
-EXTRA_EXT(EXT_texture_lod_bias);
-EXTRA_EXT(EXT_texture_filter_anisotropic);
-EXTRA_EXT(IBM_rasterpos_clip);
-EXTRA_EXT(NV_point_sprite);
-EXTRA_EXT(SGIS_generate_mipmap);
-EXTRA_EXT(NV_vertex_program);
-EXTRA_EXT(NV_fragment_program);
-EXTRA_EXT(NV_texture_rectangle);
-EXTRA_EXT(EXT_stencil_two_side);
-EXTRA_EXT(NV_light_max_exponent);
-EXTRA_EXT(EXT_depth_bounds_test);
-EXTRA_EXT(ARB_depth_clamp);
-EXTRA_EXT(ATI_fragment_shader);
-EXTRA_EXT(EXT_framebuffer_blit);
-EXTRA_EXT(ARB_shader_objects);
-EXTRA_EXT(EXT_provoking_vertex);
-EXTRA_EXT(ARB_fragment_shader);
-EXTRA_EXT(ARB_fragment_program);
-EXTRA_EXT2(ARB_framebuffer_object, EXT_framebuffer_multisample);
-EXTRA_EXT(EXT_framebuffer_object);
-EXTRA_EXT(APPLE_vertex_array_object);
-EXTRA_EXT(ARB_seamless_cube_map);
-EXTRA_EXT(EXT_compiled_vertex_array);
-EXTRA_EXT(ARB_sync);
-EXTRA_EXT(ARB_vertex_shader);
-EXTRA_EXT(EXT_transform_feedback);
-EXTRA_EXT(ARB_transform_feedback2);
-EXTRA_EXT(EXT_pixel_buffer_object);
-EXTRA_EXT(ARB_vertex_program);
-EXTRA_EXT2(NV_point_sprite, ARB_point_sprite);
-EXTRA_EXT2(ARB_fragment_program, NV_fragment_program);
-EXTRA_EXT2(ARB_vertex_program, NV_vertex_program);
-EXTRA_EXT2(ARB_vertex_program, ARB_fragment_program);
-EXTRA_EXT(ARB_vertex_buffer_object);
-EXTRA_EXT(ARB_geometry_shader4);
-EXTRA_EXT(ARB_copy_buffer);
-EXTRA_EXT(EXT_framebuffer_sRGB);
-EXTRA_EXT(ARB_texture_buffer_object);
-
-static const int
-extra_ARB_vertex_program_ARB_fragment_program_NV_vertex_program[] = {
- EXT(ARB_vertex_program),
- EXT(ARB_fragment_program),
- EXT(NV_vertex_program),
- EXTRA_END
-};
-
-static const int
-extra_NV_vertex_program_ARB_vertex_program_ARB_fragment_program_NV_vertex_program[] = {
- EXT(NV_vertex_program),
- EXT(ARB_vertex_program),
- EXT(ARB_fragment_program),
- EXT(NV_vertex_program),
- EXTRA_END
-};
-
-static const int
-extra_NV_primitive_restart[] = {
- EXT(NV_primitive_restart),
- EXTRA_END
-};
-
-static const int extra_version_30[] = { EXTRA_VERSION_30, EXTRA_END };
-static const int extra_version_31[] = { EXTRA_VERSION_31, EXTRA_END };
-static const int extra_version_32[] = { EXTRA_VERSION_32, EXTRA_END };
-
-static const int
-extra_ARB_vertex_program_version_es2[] = {
- EXT(ARB_vertex_program),
- EXTRA_VERSION_ES2,
- EXTRA_END
-};
-
-#define API_OPENGL_BIT (1 << API_OPENGL)
-#define API_OPENGLES_BIT (1 << API_OPENGLES)
-#define API_OPENGLES2_BIT (1 << API_OPENGLES2)
-
-/* This is the big table describing all the enums we accept in
- * glGet*v(). The table is partitioned into six parts: enums
- * understood by all GL APIs (OpenGL, GLES and GLES2), enums shared
- * between OpenGL and GLES, enums exclusive to GLES, etc for the
- * remaining combinations. When we add the enums to the hash table in
- * _mesa_init_get_hash(), we only add the enums for the API we're
- * instantiating and the different sections are guarded by #if
- * FEATURE_GL etc to make sure we only compile in the enums we may
- * need. */
-
-static const struct value_desc values[] = {
- /* Enums shared between OpenGL, GLES1 and GLES2 */
- { 0, 0, TYPE_API_MASK,
- API_OPENGL_BIT | API_OPENGLES_BIT | API_OPENGLES2_BIT, NO_EXTRA},
- { GL_ALPHA_BITS, BUFFER_INT(Visual.alphaBits), extra_new_buffers },
- { GL_BLEND, CONTEXT_BIT0(Color.BlendEnabled), NO_EXTRA },
- { GL_BLEND_SRC, CONTEXT_ENUM(Color.Blend[0].SrcRGB), NO_EXTRA },
- { GL_BLUE_BITS, BUFFER_INT(Visual.blueBits), extra_new_buffers },
- { GL_COLOR_CLEAR_VALUE, LOC_CUSTOM, TYPE_FLOATN_4, 0, extra_new_frag_clamp },
- { GL_COLOR_WRITEMASK, LOC_CUSTOM, TYPE_INT_4, 0, NO_EXTRA },
- { GL_CULL_FACE, CONTEXT_BOOL(Polygon.CullFlag), NO_EXTRA },
- { GL_CULL_FACE_MODE, CONTEXT_ENUM(Polygon.CullFaceMode), NO_EXTRA },
- { GL_DEPTH_BITS, BUFFER_INT(Visual.depthBits), NO_EXTRA },
- { GL_DEPTH_CLEAR_VALUE, CONTEXT_FIELD(Depth.Clear, TYPE_DOUBLEN), NO_EXTRA },
- { GL_DEPTH_FUNC, CONTEXT_ENUM(Depth.Func), NO_EXTRA },
- { GL_DEPTH_RANGE, CONTEXT_FIELD(Viewport.Near, TYPE_FLOATN_2), NO_EXTRA },
- { GL_DEPTH_TEST, CONTEXT_BOOL(Depth.Test), NO_EXTRA },
- { GL_DEPTH_WRITEMASK, CONTEXT_BOOL(Depth.Mask), NO_EXTRA },
- { GL_DITHER, CONTEXT_BOOL(Color.DitherFlag), NO_EXTRA },
- { GL_FRONT_FACE, CONTEXT_ENUM(Polygon.FrontFace), NO_EXTRA },
- { GL_GREEN_BITS, BUFFER_INT(Visual.greenBits), extra_new_buffers },
- { GL_LINE_WIDTH, CONTEXT_FLOAT(Line.Width), NO_EXTRA },
- { GL_ALIASED_LINE_WIDTH_RANGE, CONTEXT_FLOAT2(Const.MinLineWidth), NO_EXTRA },
- { GL_MAX_ELEMENTS_VERTICES, CONTEXT_INT(Const.MaxArrayLockSize), NO_EXTRA },
- { GL_MAX_ELEMENTS_INDICES, CONTEXT_INT(Const.MaxArrayLockSize), NO_EXTRA },
- { GL_MAX_TEXTURE_SIZE, LOC_CUSTOM, TYPE_INT,
- offsetof(struct gl_context, Const.MaxTextureLevels), NO_EXTRA },
- { GL_MAX_VIEWPORT_DIMS, CONTEXT_INT2(Const.MaxViewportWidth), NO_EXTRA },
- { GL_PACK_ALIGNMENT, CONTEXT_INT(Pack.Alignment), NO_EXTRA },
- { GL_ALIASED_POINT_SIZE_RANGE, CONTEXT_FLOAT2(Const.MinPointSize), NO_EXTRA },
- { GL_POLYGON_OFFSET_FACTOR, CONTEXT_FLOAT(Polygon.OffsetFactor ), NO_EXTRA },
- { GL_POLYGON_OFFSET_UNITS, CONTEXT_FLOAT(Polygon.OffsetUnits ), NO_EXTRA },
- { GL_POLYGON_OFFSET_FILL, CONTEXT_BOOL(Polygon.OffsetFill), NO_EXTRA },
- { GL_RED_BITS, BUFFER_INT(Visual.redBits), extra_new_buffers },
- { GL_SCISSOR_BOX, LOC_CUSTOM, TYPE_INT_4, 0, NO_EXTRA },
- { GL_SCISSOR_TEST, CONTEXT_BOOL(Scissor.Enabled), NO_EXTRA },
- { GL_STENCIL_BITS, BUFFER_INT(Visual.stencilBits), NO_EXTRA },
- { GL_STENCIL_CLEAR_VALUE, CONTEXT_INT(Stencil.Clear), NO_EXTRA },
- { GL_STENCIL_FAIL, LOC_CUSTOM, TYPE_ENUM, NO_OFFSET, NO_EXTRA },
- { GL_STENCIL_FUNC, LOC_CUSTOM, TYPE_ENUM, NO_OFFSET, NO_EXTRA },
- { GL_STENCIL_PASS_DEPTH_FAIL, LOC_CUSTOM, TYPE_ENUM, NO_OFFSET, NO_EXTRA },
- { GL_STENCIL_PASS_DEPTH_PASS, LOC_CUSTOM, TYPE_ENUM, NO_OFFSET, NO_EXTRA },
- { GL_STENCIL_REF, LOC_CUSTOM, TYPE_INT, NO_OFFSET, NO_EXTRA },
- { GL_STENCIL_TEST, CONTEXT_BOOL(Stencil.Enabled), NO_EXTRA },
- { GL_STENCIL_VALUE_MASK, LOC_CUSTOM, TYPE_INT, NO_OFFSET, NO_EXTRA },
- { GL_STENCIL_WRITEMASK, LOC_CUSTOM, TYPE_INT, NO_OFFSET, NO_EXTRA },
- { GL_SUBPIXEL_BITS, CONTEXT_INT(Const.SubPixelBits), NO_EXTRA },
- { GL_TEXTURE_BINDING_2D, LOC_CUSTOM, TYPE_INT, TEXTURE_2D_INDEX, NO_EXTRA },
- { GL_UNPACK_ALIGNMENT, CONTEXT_INT(Unpack.Alignment), NO_EXTRA },
- { GL_VIEWPORT, LOC_CUSTOM, TYPE_INT_4, 0, NO_EXTRA },
-
- /* GL_ARB_multitexture */
- { GL_ACTIVE_TEXTURE_ARB,
- LOC_CUSTOM, TYPE_INT, 0, extra_ARB_multitexture },
-
- /* Note that all the OES_* extensions require that the Mesa "struct
- * gl_extensions" include a member with the name of the extension.
- * That structure does not yet include OES extensions (and we're
- * not sure whether it will). If it does, all the OES_*
- * extensions below should mark the dependency. */
-
- /* GL_ARB_texture_cube_map */
- { GL_TEXTURE_BINDING_CUBE_MAP_ARB, LOC_CUSTOM, TYPE_INT,
- TEXTURE_CUBE_INDEX, extra_ARB_texture_cube_map },
- { GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB, LOC_CUSTOM, TYPE_INT,
- offsetof(struct gl_context, Const.MaxCubeTextureLevels),
- extra_ARB_texture_cube_map }, /* XXX: OES_texture_cube_map */
-
- /* XXX: OES_blend_subtract */
- { GL_BLEND_SRC_RGB_EXT, CONTEXT_ENUM(Color.Blend[0].SrcRGB), NO_EXTRA },
- { GL_BLEND_DST_RGB_EXT, CONTEXT_ENUM(Color.Blend[0].DstRGB), NO_EXTRA },
- { GL_BLEND_SRC_ALPHA_EXT, CONTEXT_ENUM(Color.Blend[0].SrcA), NO_EXTRA },
- { GL_BLEND_DST_ALPHA_EXT, CONTEXT_ENUM(Color.Blend[0].DstA), NO_EXTRA },
-
- /* GL_BLEND_EQUATION_RGB, which is what we're really after, is
- * defined identically to GL_BLEND_EQUATION. */
- { GL_BLEND_EQUATION, CONTEXT_ENUM(Color.Blend[0].EquationRGB), NO_EXTRA },
- { GL_BLEND_EQUATION_ALPHA_EXT, CONTEXT_ENUM(Color.Blend[0].EquationA), NO_EXTRA },
-
- /* GL_ARB_texture_compression */
- { GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB, LOC_CUSTOM, TYPE_INT, 0, NO_EXTRA },
- { GL_COMPRESSED_TEXTURE_FORMATS_ARB, LOC_CUSTOM, TYPE_INT_N, 0, NO_EXTRA },
-
- /* GL_ARB_multisample */
- { GL_SAMPLE_ALPHA_TO_COVERAGE_ARB,
- CONTEXT_BOOL(Multisample.SampleAlphaToCoverage), NO_EXTRA },
- { GL_SAMPLE_COVERAGE_ARB, CONTEXT_BOOL(Multisample.SampleCoverage), NO_EXTRA },
- { GL_SAMPLE_COVERAGE_VALUE_ARB,
- CONTEXT_FLOAT(Multisample.SampleCoverageValue), NO_EXTRA },
- { GL_SAMPLE_COVERAGE_INVERT_ARB,
- CONTEXT_BOOL(Multisample.SampleCoverageInvert), NO_EXTRA },
- { GL_SAMPLE_BUFFERS_ARB, BUFFER_INT(Visual.sampleBuffers), NO_EXTRA },
- { GL_SAMPLES_ARB, BUFFER_INT(Visual.samples), NO_EXTRA },
-
- /* GL_SGIS_generate_mipmap */
- { GL_GENERATE_MIPMAP_HINT_SGIS, CONTEXT_ENUM(Hint.GenerateMipmap),
- extra_SGIS_generate_mipmap },
-
- /* GL_ARB_vertex_buffer_object */
- { GL_ARRAY_BUFFER_BINDING_ARB, LOC_CUSTOM, TYPE_INT, 0, NO_EXTRA },
-
- /* GL_ARB_vertex_buffer_object */
- /* GL_WEIGHT_ARRAY_BUFFER_BINDING_ARB - not supported */
- { GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB, LOC_CUSTOM, TYPE_INT, 0,
- extra_ARB_vertex_buffer_object },
-
- /* GL_ARB_copy_buffer */
- { GL_COPY_READ_BUFFER, LOC_CUSTOM, TYPE_INT, 0, extra_ARB_copy_buffer },
- { GL_COPY_WRITE_BUFFER, LOC_CUSTOM, TYPE_INT, 0, extra_ARB_copy_buffer },
-
- /* GL_OES_read_format */
- { GL_IMPLEMENTATION_COLOR_READ_TYPE_OES, LOC_CUSTOM, TYPE_INT, 0,
- extra_new_buffers_OES_read_format },
- { GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES, LOC_CUSTOM, TYPE_INT, 0,
- extra_new_buffers_OES_read_format },
-
- /* GL_EXT_framebuffer_object */
- { GL_FRAMEBUFFER_BINDING_EXT, BUFFER_INT(Name),
- extra_EXT_framebuffer_object },
- { GL_RENDERBUFFER_BINDING_EXT, LOC_CUSTOM, TYPE_INT, 0,
- extra_EXT_framebuffer_object },
- { GL_MAX_RENDERBUFFER_SIZE_EXT, CONTEXT_INT(Const.MaxRenderbufferSize),
- extra_EXT_framebuffer_object },
-
- /* This entry isn't spec'ed for GLES 2, but is needed for Mesa's
- * GLSL: */
- { GL_MAX_CLIP_PLANES, CONTEXT_INT(Const.MaxClipPlanes), NO_EXTRA },
-
-#if FEATURE_GL || FEATURE_ES1
- /* Enums in OpenGL and GLES1 */
- { 0, 0, TYPE_API_MASK, API_OPENGL_BIT | API_OPENGLES_BIT, NO_EXTRA },
- { GL_LIGHT0, CONTEXT_BOOL(Light.Light[0].Enabled), NO_EXTRA },
- { GL_LIGHT1, CONTEXT_BOOL(Light.Light[1].Enabled), NO_EXTRA },
- { GL_LIGHT2, CONTEXT_BOOL(Light.Light[2].Enabled), NO_EXTRA },
- { GL_LIGHT3, CONTEXT_BOOL(Light.Light[3].Enabled), NO_EXTRA },
- { GL_LIGHT4, CONTEXT_BOOL(Light.Light[4].Enabled), NO_EXTRA },
- { GL_LIGHT5, CONTEXT_BOOL(Light.Light[5].Enabled), NO_EXTRA },
- { GL_LIGHT6, CONTEXT_BOOL(Light.Light[6].Enabled), NO_EXTRA },
- { GL_LIGHT7, CONTEXT_BOOL(Light.Light[7].Enabled), NO_EXTRA },
- { GL_LIGHTING, CONTEXT_BOOL(Light.Enabled), NO_EXTRA },
- { GL_LIGHT_MODEL_AMBIENT,
- CONTEXT_FIELD(Light.Model.Ambient[0], TYPE_FLOATN_4), NO_EXTRA },
- { GL_LIGHT_MODEL_TWO_SIDE, CONTEXT_BOOL(Light.Model.TwoSide), NO_EXTRA },
- { GL_ALPHA_TEST, CONTEXT_BOOL(Color.AlphaEnabled), NO_EXTRA },
- { GL_ALPHA_TEST_FUNC, CONTEXT_ENUM(Color.AlphaFunc), NO_EXTRA },
- { GL_ALPHA_TEST_REF, LOC_CUSTOM, TYPE_FLOATN, 0, extra_new_frag_clamp },
- { GL_BLEND_DST, CONTEXT_ENUM(Color.Blend[0].DstRGB), NO_EXTRA },
- { GL_CLIP_PLANE0, CONTEXT_BIT0(Transform.ClipPlanesEnabled), NO_EXTRA },
- { GL_CLIP_PLANE1, CONTEXT_BIT1(Transform.ClipPlanesEnabled), NO_EXTRA },
- { GL_CLIP_PLANE2, CONTEXT_BIT2(Transform.ClipPlanesEnabled), NO_EXTRA },
- { GL_CLIP_PLANE3, CONTEXT_BIT3(Transform.ClipPlanesEnabled), NO_EXTRA },
- { GL_CLIP_PLANE4, CONTEXT_BIT4(Transform.ClipPlanesEnabled), NO_EXTRA },
- { GL_CLIP_PLANE5, CONTEXT_BIT5(Transform.ClipPlanesEnabled), NO_EXTRA },
- { GL_COLOR_MATERIAL, CONTEXT_BOOL(Light.ColorMaterialEnabled), NO_EXTRA },
- { GL_CURRENT_COLOR,
- CONTEXT_FIELD(Current.Attrib[VERT_ATTRIB_COLOR0][0], TYPE_FLOATN_4),
- extra_flush_current },
- { GL_CURRENT_NORMAL,
- CONTEXT_FIELD(Current.Attrib[VERT_ATTRIB_NORMAL][0], TYPE_FLOATN_3),
- extra_flush_current },
- { GL_CURRENT_TEXTURE_COORDS, LOC_CUSTOM, TYPE_FLOAT_4, 0,
- extra_flush_current_valid_texture_unit },
- { GL_DISTANCE_ATTENUATION_EXT, CONTEXT_FLOAT3(Point.Params[0]), NO_EXTRA },
- { GL_FOG, CONTEXT_BOOL(Fog.Enabled), NO_EXTRA },
- { GL_FOG_COLOR, LOC_CUSTOM, TYPE_FLOATN_4, 0, extra_new_frag_clamp },
- { GL_FOG_DENSITY, CONTEXT_FLOAT(Fog.Density), NO_EXTRA },
- { GL_FOG_END, CONTEXT_FLOAT(Fog.End), NO_EXTRA },
- { GL_FOG_HINT, CONTEXT_ENUM(Hint.Fog), NO_EXTRA },
- { GL_FOG_MODE, CONTEXT_ENUM(Fog.Mode), NO_EXTRA },
- { GL_FOG_START, CONTEXT_FLOAT(Fog.Start), NO_EXTRA },
- { GL_LINE_SMOOTH, CONTEXT_BOOL(Line.SmoothFlag), NO_EXTRA },
- { GL_LINE_SMOOTH_HINT, CONTEXT_ENUM(Hint.LineSmooth), NO_EXTRA },
- { GL_LINE_WIDTH_RANGE, CONTEXT_FLOAT2(Const.MinLineWidthAA), NO_EXTRA },
- { GL_COLOR_LOGIC_OP, CONTEXT_BOOL(Color.ColorLogicOpEnabled), NO_EXTRA },
- { GL_LOGIC_OP_MODE, CONTEXT_ENUM(Color.LogicOp), NO_EXTRA },
- { GL_MATRIX_MODE, CONTEXT_ENUM(Transform.MatrixMode), NO_EXTRA },
- { GL_MAX_MODELVIEW_STACK_DEPTH, CONST(MAX_MODELVIEW_STACK_DEPTH), NO_EXTRA },
- { GL_MAX_PROJECTION_STACK_DEPTH, CONST(MAX_PROJECTION_STACK_DEPTH), NO_EXTRA },
- { GL_MAX_TEXTURE_STACK_DEPTH, CONST(MAX_TEXTURE_STACK_DEPTH), NO_EXTRA },
- { GL_MODELVIEW_MATRIX, CONTEXT_MATRIX(ModelviewMatrixStack.Top), NO_EXTRA },
- { GL_MODELVIEW_STACK_DEPTH, LOC_CUSTOM, TYPE_INT,
- offsetof(struct gl_context, ModelviewMatrixStack.Depth), NO_EXTRA },
- { GL_NORMALIZE, CONTEXT_BOOL(Transform.Normalize), NO_EXTRA },
- { GL_PACK_SKIP_IMAGES_EXT, CONTEXT_INT(Pack.SkipImages), NO_EXTRA },
- { GL_PERSPECTIVE_CORRECTION_HINT, CONTEXT_ENUM(Hint.PerspectiveCorrection), NO_EXTRA },
- { GL_POINT_SIZE, CONTEXT_FLOAT(Point.Size), NO_EXTRA },
- { GL_POINT_SIZE_RANGE, CONTEXT_FLOAT2(Const.MinPointSizeAA), NO_EXTRA },
- { GL_POINT_SMOOTH, CONTEXT_BOOL(Point.SmoothFlag), NO_EXTRA },
- { GL_POINT_SMOOTH_HINT, CONTEXT_ENUM(Hint.PointSmooth), NO_EXTRA },
- { GL_POINT_SIZE_MIN_EXT, CONTEXT_FLOAT(Point.MinSize), NO_EXTRA },
- { GL_POINT_SIZE_MAX_EXT, CONTEXT_FLOAT(Point.MaxSize), NO_EXTRA },
- { GL_POINT_FADE_THRESHOLD_SIZE_EXT, CONTEXT_FLOAT(Point.Threshold), NO_EXTRA },
- { GL_PROJECTION_MATRIX, CONTEXT_MATRIX(ProjectionMatrixStack.Top), NO_EXTRA },
- { GL_PROJECTION_STACK_DEPTH, LOC_CUSTOM, TYPE_INT,
- offsetof(struct gl_context, ProjectionMatrixStack.Depth), NO_EXTRA },
- { GL_RESCALE_NORMAL, CONTEXT_BOOL(Transform.RescaleNormals), NO_EXTRA },
- { GL_SHADE_MODEL, CONTEXT_ENUM(Light.ShadeModel), NO_EXTRA },
- { GL_TEXTURE_2D, LOC_CUSTOM, TYPE_BOOLEAN, 0, NO_EXTRA },
- { GL_TEXTURE_MATRIX, LOC_CUSTOM, TYPE_MATRIX, 0, extra_valid_texture_unit },
- { GL_TEXTURE_STACK_DEPTH, LOC_CUSTOM, TYPE_INT, 0,
- extra_valid_texture_unit },
-
- { GL_VERTEX_ARRAY, ARRAY_BOOL(Vertex.Enabled), NO_EXTRA },
- { GL_VERTEX_ARRAY_SIZE, ARRAY_INT(Vertex.Size), NO_EXTRA },
- { GL_VERTEX_ARRAY_TYPE, ARRAY_ENUM(Vertex.Type), NO_EXTRA },
- { GL_VERTEX_ARRAY_STRIDE, ARRAY_INT(Vertex.Stride), NO_EXTRA },
- { GL_NORMAL_ARRAY, ARRAY_BOOL(Normal.Enabled), NO_EXTRA },
- { GL_NORMAL_ARRAY_TYPE, ARRAY_ENUM(Normal.Type), NO_EXTRA },
- { GL_NORMAL_ARRAY_STRIDE, ARRAY_INT(Normal.Stride), NO_EXTRA },
- { GL_COLOR_ARRAY, ARRAY_BOOL(Color.Enabled), NO_EXTRA },
- { GL_COLOR_ARRAY_SIZE, ARRAY_INT(Color.Size), NO_EXTRA },
- { GL_COLOR_ARRAY_TYPE, ARRAY_ENUM(Color.Type), NO_EXTRA },
- { GL_COLOR_ARRAY_STRIDE, ARRAY_INT(Color.Stride), NO_EXTRA },
- { GL_TEXTURE_COORD_ARRAY,
- LOC_CUSTOM, TYPE_BOOLEAN, offsetof(struct gl_client_array, Enabled), NO_EXTRA },
- { GL_TEXTURE_COORD_ARRAY_SIZE,
- LOC_CUSTOM, TYPE_INT, offsetof(struct gl_client_array, Size), NO_EXTRA },
- { GL_TEXTURE_COORD_ARRAY_TYPE,
- LOC_CUSTOM, TYPE_ENUM, offsetof(struct gl_client_array, Type), NO_EXTRA },
- { GL_TEXTURE_COORD_ARRAY_STRIDE,
- LOC_CUSTOM, TYPE_INT, offsetof(struct gl_client_array, Stride), NO_EXTRA },
-
- /* GL_ARB_ES2_compatibility */
- { GL_SHADER_COMPILER, CONST(1), extra_ARB_ES2_compatibility },
- { GL_MAX_VARYING_VECTORS, CONTEXT_INT(Const.MaxVarying),
- extra_ARB_ES2_compatibility },
- { GL_MAX_VERTEX_UNIFORM_VECTORS, LOC_CUSTOM, TYPE_INT, 0,
- extra_ARB_ES2_compatibility },
- { GL_MAX_FRAGMENT_UNIFORM_VECTORS, LOC_CUSTOM, TYPE_INT, 0,
- extra_ARB_ES2_compatibility },
-
- /* GL_ARB_multitexture */
- { GL_MAX_TEXTURE_UNITS_ARB,
- CONTEXT_INT(Const.MaxTextureUnits), extra_ARB_multitexture },
- { GL_CLIENT_ACTIVE_TEXTURE_ARB,
- LOC_CUSTOM, TYPE_INT, 0, extra_ARB_multitexture },
-
- /* GL_ARB_texture_cube_map */
- { GL_TEXTURE_CUBE_MAP_ARB, LOC_CUSTOM, TYPE_BOOLEAN, 0, NO_EXTRA },
- /* S, T, and R are always set at the same time */
- { GL_TEXTURE_GEN_STR_OES, LOC_TEXUNIT, TYPE_BIT_0,
- offsetof(struct gl_texture_unit, TexGenEnabled), NO_EXTRA },
-
- /* GL_ARB_multisample */
- { GL_MULTISAMPLE_ARB, CONTEXT_BOOL(Multisample.Enabled), NO_EXTRA },
- { GL_SAMPLE_ALPHA_TO_ONE_ARB, CONTEXT_BOOL(Multisample.SampleAlphaToOne), NO_EXTRA },
-
- /* GL_ARB_vertex_buffer_object */
- { GL_VERTEX_ARRAY_BUFFER_BINDING_ARB, LOC_CUSTOM, TYPE_INT,
- offsetof(struct gl_array_object, Vertex.BufferObj), NO_EXTRA },
- { GL_NORMAL_ARRAY_BUFFER_BINDING_ARB, LOC_CUSTOM, TYPE_INT,
- offsetof(struct gl_array_object, Normal.BufferObj), NO_EXTRA },
- { GL_COLOR_ARRAY_BUFFER_BINDING_ARB, LOC_CUSTOM, TYPE_INT,
- offsetof(struct gl_array_object, Color.BufferObj), NO_EXTRA },
- { GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB, LOC_CUSTOM, TYPE_INT, NO_OFFSET, NO_EXTRA },
-
- /* GL_OES_point_sprite */
- { GL_POINT_SPRITE_NV,
- CONTEXT_BOOL(Point.PointSprite),
- extra_NV_point_sprite_ARB_point_sprite },
-
- /* GL_ARB_fragment_shader */
- { GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB,
- CONTEXT_INT(Const.FragmentProgram.MaxUniformComponents),
- extra_ARB_fragment_shader },
-
- /* GL_ARB_vertex_shader */
- { GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB,
- CONTEXT_INT(Const.VertexProgram.MaxUniformComponents),
- extra_ARB_vertex_shader },
- { GL_MAX_VARYING_FLOATS_ARB, LOC_CUSTOM, TYPE_INT, 0,
- extra_ARB_vertex_shader },
-
- /* GL_EXT_texture_lod_bias */
- { GL_MAX_TEXTURE_LOD_BIAS_EXT, CONTEXT_FLOAT(Const.MaxTextureLodBias),
- extra_EXT_texture_lod_bias },
-
- /* GL_EXT_texture_filter_anisotropic */
- { GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT,
- CONTEXT_FLOAT(Const.MaxTextureMaxAnisotropy),
- extra_EXT_texture_filter_anisotropic },
-#endif /* FEATURE_GL || FEATURE_ES1 */
-
-#if FEATURE_ES1
- { 0, 0, TYPE_API_MASK, API_OPENGLES_BIT },
- /* XXX: OES_matrix_get */
- { GL_MODELVIEW_MATRIX_FLOAT_AS_INT_BITS_OES },
- { GL_PROJECTION_MATRIX_FLOAT_AS_INT_BITS_OES },
- { GL_TEXTURE_MATRIX_FLOAT_AS_INT_BITS_OES },
-
- /* OES_point_size_array */
- { GL_POINT_SIZE_ARRAY_OES, ARRAY_FIELD(PointSize.Enabled, TYPE_BOOLEAN) },
- { GL_POINT_SIZE_ARRAY_TYPE_OES, ARRAY_FIELD(PointSize.Type, TYPE_ENUM) },
- { GL_POINT_SIZE_ARRAY_STRIDE_OES, ARRAY_FIELD(PointSize.Stride, TYPE_INT) },
- { GL_POINT_SIZE_ARRAY_BUFFER_BINDING_OES, LOC_CUSTOM, TYPE_INT, 0 },
-#endif /* FEATURE_ES1 */
-
-#if FEATURE_GL || FEATURE_ES2
- { 0, 0, TYPE_API_MASK, API_OPENGL_BIT | API_OPENGLES2_BIT, NO_EXTRA },
- /* This entry isn't spec'ed for GLES 2, but is needed for Mesa's GLSL: */
- { GL_MAX_LIGHTS, CONTEXT_INT(Const.MaxLights), NO_EXTRA },
- { GL_MAX_TEXTURE_COORDS_ARB, /* == GL_MAX_TEXTURE_COORDS_NV */
- CONTEXT_INT(Const.MaxTextureCoordUnits),
- extra_ARB_fragment_program_NV_fragment_program },
-
- /* GL_ARB_draw_buffers */
- { GL_MAX_DRAW_BUFFERS_ARB, CONTEXT_INT(Const.MaxDrawBuffers), NO_EXTRA },
-
- { GL_BLEND_COLOR_EXT, LOC_CUSTOM, TYPE_FLOATN_4, 0, extra_new_frag_clamp },
- /* GL_ARB_fragment_program */
- { GL_MAX_TEXTURE_IMAGE_UNITS_ARB, /* == GL_MAX_TEXTURE_IMAGE_UNITS_NV */
- CONTEXT_INT(Const.MaxTextureImageUnits),
- extra_ARB_fragment_program_NV_fragment_program },
- { GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB,
- CONTEXT_INT(Const.MaxVertexTextureImageUnits), extra_ARB_vertex_shader },
- { GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB,
- CONTEXT_INT(Const.MaxCombinedTextureImageUnits),
- extra_ARB_vertex_shader },
-
- /* GL_ARB_shader_objects
- * Actually, this token isn't part of GL_ARB_shader_objects, but is
- * close enough for now. */
- { GL_CURRENT_PROGRAM, LOC_CUSTOM, TYPE_INT, 0, extra_ARB_shader_objects },
-
- /* OpenGL 2.0 */
- { GL_STENCIL_BACK_FUNC, CONTEXT_ENUM(Stencil.Function[1]), NO_EXTRA },
- { GL_STENCIL_BACK_VALUE_MASK, CONTEXT_INT(Stencil.ValueMask[1]), NO_EXTRA },
- { GL_STENCIL_BACK_WRITEMASK, CONTEXT_INT(Stencil.WriteMask[1]), NO_EXTRA },
- { GL_STENCIL_BACK_REF, CONTEXT_INT(Stencil.Ref[1]), NO_EXTRA },
- { GL_STENCIL_BACK_FAIL, CONTEXT_ENUM(Stencil.FailFunc[1]), NO_EXTRA },
- { GL_STENCIL_BACK_PASS_DEPTH_FAIL, CONTEXT_ENUM(Stencil.ZFailFunc[1]), NO_EXTRA },
- { GL_STENCIL_BACK_PASS_DEPTH_PASS, CONTEXT_ENUM(Stencil.ZPassFunc[1]), NO_EXTRA },
-
- { GL_MAX_VERTEX_ATTRIBS_ARB,
- CONTEXT_INT(Const.VertexProgram.MaxAttribs),
- extra_ARB_vertex_program_version_es2 },
-
- /* OES_texture_3D */
- { GL_TEXTURE_BINDING_3D, LOC_CUSTOM, TYPE_INT, TEXTURE_3D_INDEX, NO_EXTRA },
- { GL_MAX_3D_TEXTURE_SIZE, LOC_CUSTOM, TYPE_INT,
- offsetof(struct gl_context, Const.Max3DTextureLevels), NO_EXTRA },
-
- /* GL_ARB_fragment_program/OES_standard_derivatives */
- { GL_FRAGMENT_SHADER_DERIVATIVE_HINT_ARB,
- CONTEXT_ENUM(Hint.FragmentShaderDerivative), extra_ARB_fragment_shader },
-#endif /* FEATURE_GL || FEATURE_ES2 */
-
-#if FEATURE_ES2
- /* Enums unique to OpenGL ES 2.0 */
- { 0, 0, TYPE_API_MASK, API_OPENGLES2_BIT, NO_EXTRA },
- { GL_MAX_FRAGMENT_UNIFORM_VECTORS, LOC_CUSTOM, TYPE_INT, 0, NO_EXTRA },
- { GL_MAX_VARYING_VECTORS, CONTEXT_INT(Const.MaxVarying), NO_EXTRA },
- { GL_MAX_VERTEX_UNIFORM_VECTORS, LOC_CUSTOM, TYPE_INT, 0, NO_EXTRA },
- { GL_SHADER_COMPILER, CONST(1), NO_EXTRA },
- /* OES_get_program_binary */
- { GL_NUM_SHADER_BINARY_FORMATS, CONST(0), NO_EXTRA },
- { GL_SHADER_BINARY_FORMATS, CONST(0), NO_EXTRA },
-#endif /* FEATURE_ES2 */
-
-#if FEATURE_GL
- /* Remaining enums are only in OpenGL */
- { 0, 0, TYPE_API_MASK, API_OPENGL_BIT, NO_EXTRA },
- { GL_ACCUM_RED_BITS, BUFFER_INT(Visual.accumRedBits), NO_EXTRA },
- { GL_ACCUM_GREEN_BITS, BUFFER_INT(Visual.accumGreenBits), NO_EXTRA },
- { GL_ACCUM_BLUE_BITS, BUFFER_INT(Visual.accumBlueBits), NO_EXTRA },
- { GL_ACCUM_ALPHA_BITS, BUFFER_INT(Visual.accumAlphaBits), NO_EXTRA },
- { GL_ACCUM_CLEAR_VALUE, CONTEXT_FIELD(Accum.ClearColor[0], TYPE_FLOATN_4), NO_EXTRA },
- { GL_ALPHA_BIAS, CONTEXT_FLOAT(Pixel.AlphaBias), NO_EXTRA },
- { GL_ALPHA_SCALE, CONTEXT_FLOAT(Pixel.AlphaScale), NO_EXTRA },
- { GL_ATTRIB_STACK_DEPTH, CONTEXT_INT(AttribStackDepth), NO_EXTRA },
- { GL_AUTO_NORMAL, CONTEXT_BOOL(Eval.AutoNormal), NO_EXTRA },
- { GL_AUX_BUFFERS, BUFFER_INT(Visual.numAuxBuffers), NO_EXTRA },
- { GL_BLUE_BIAS, CONTEXT_FLOAT(Pixel.BlueBias), NO_EXTRA },
- { GL_BLUE_SCALE, CONTEXT_FLOAT(Pixel.BlueScale), NO_EXTRA },
- { GL_CLIENT_ATTRIB_STACK_DEPTH, CONTEXT_INT(ClientAttribStackDepth), NO_EXTRA },
- { GL_COLOR_MATERIAL_FACE, CONTEXT_ENUM(Light.ColorMaterialFace), NO_EXTRA },
- { GL_COLOR_MATERIAL_PARAMETER, CONTEXT_ENUM(Light.ColorMaterialMode), NO_EXTRA },
- { GL_CURRENT_INDEX,
- CONTEXT_FLOAT(Current.Attrib[VERT_ATTRIB_COLOR_INDEX][0]),
- extra_flush_current },
- { GL_CURRENT_RASTER_COLOR,
- CONTEXT_FIELD(Current.RasterColor[0], TYPE_FLOATN_4), NO_EXTRA },
- { GL_CURRENT_RASTER_DISTANCE, CONTEXT_FLOAT(Current.RasterDistance), NO_EXTRA },
- { GL_CURRENT_RASTER_INDEX, CONST(1), NO_EXTRA },
- { GL_CURRENT_RASTER_POSITION, CONTEXT_FLOAT4(Current.RasterPos[0]), NO_EXTRA },
- { GL_CURRENT_RASTER_SECONDARY_COLOR,
- CONTEXT_FIELD(Current.RasterSecondaryColor[0], TYPE_FLOATN_4), NO_EXTRA },
- { GL_CURRENT_RASTER_TEXTURE_COORDS, LOC_CUSTOM, TYPE_FLOAT_4, 0,
- extra_valid_texture_unit },
- { GL_CURRENT_RASTER_POSITION_VALID, CONTEXT_BOOL(Current.RasterPosValid), NO_EXTRA },
- { GL_DEPTH_BIAS, CONTEXT_FLOAT(Pixel.DepthBias), NO_EXTRA },
- { GL_DEPTH_SCALE, CONTEXT_FLOAT(Pixel.DepthScale), NO_EXTRA },
- { GL_DOUBLEBUFFER, BUFFER_INT(Visual.doubleBufferMode), NO_EXTRA },
- { GL_DRAW_BUFFER, BUFFER_ENUM(ColorDrawBuffer[0]), NO_EXTRA },
- { GL_EDGE_FLAG, LOC_CUSTOM, TYPE_BOOLEAN, 0, NO_EXTRA },
- { GL_FEEDBACK_BUFFER_SIZE, CONTEXT_INT(Feedback.BufferSize), NO_EXTRA },
- { GL_FEEDBACK_BUFFER_TYPE, CONTEXT_ENUM(Feedback.Type), NO_EXTRA },
- { GL_FOG_INDEX, CONTEXT_FLOAT(Fog.Index), NO_EXTRA },
- { GL_GREEN_BIAS, CONTEXT_FLOAT(Pixel.GreenBias), NO_EXTRA },
- { GL_GREEN_SCALE, CONTEXT_FLOAT(Pixel.GreenScale), NO_EXTRA },
- { GL_INDEX_BITS, BUFFER_INT(Visual.indexBits), extra_new_buffers },
- { GL_INDEX_CLEAR_VALUE, CONTEXT_INT(Color.ClearIndex), NO_EXTRA },
- { GL_INDEX_MODE, CONST(0) , NO_EXTRA},
- { GL_INDEX_OFFSET, CONTEXT_INT(Pixel.IndexOffset), NO_EXTRA },
- { GL_INDEX_SHIFT, CONTEXT_INT(Pixel.IndexShift), NO_EXTRA },
- { GL_INDEX_WRITEMASK, CONTEXT_INT(Color.IndexMask), NO_EXTRA },
- { GL_LIGHT_MODEL_COLOR_CONTROL, CONTEXT_ENUM(Light.Model.ColorControl), NO_EXTRA },
- { GL_LIGHT_MODEL_LOCAL_VIEWER, CONTEXT_BOOL(Light.Model.LocalViewer), NO_EXTRA },
- { GL_LINE_STIPPLE, CONTEXT_BOOL(Line.StippleFlag), NO_EXTRA },
- { GL_LINE_STIPPLE_PATTERN, LOC_CUSTOM, TYPE_INT, 0, NO_EXTRA },
- { GL_LINE_STIPPLE_REPEAT, CONTEXT_INT(Line.StippleFactor), NO_EXTRA },
- { GL_LINE_WIDTH_GRANULARITY, CONTEXT_FLOAT(Const.LineWidthGranularity), NO_EXTRA },
- { GL_LIST_BASE, CONTEXT_INT(List.ListBase), NO_EXTRA },
- { GL_LIST_INDEX, LOC_CUSTOM, TYPE_INT, 0, NO_EXTRA },
- { GL_LIST_MODE, LOC_CUSTOM, TYPE_ENUM, 0, NO_EXTRA },
- { GL_INDEX_LOGIC_OP, CONTEXT_BOOL(Color.IndexLogicOpEnabled), NO_EXTRA },
- { GL_MAP1_COLOR_4, CONTEXT_BOOL(Eval.Map1Color4), NO_EXTRA },
- { GL_MAP1_GRID_DOMAIN, CONTEXT_FLOAT2(Eval.MapGrid1u1), NO_EXTRA },
- { GL_MAP1_GRID_SEGMENTS, CONTEXT_INT(Eval.MapGrid1un), NO_EXTRA },
- { GL_MAP1_INDEX, CONTEXT_BOOL(Eval.Map1Index), NO_EXTRA },
- { GL_MAP1_NORMAL, CONTEXT_BOOL(Eval.Map1Normal), NO_EXTRA },
- { GL_MAP1_TEXTURE_COORD_1, CONTEXT_BOOL(Eval.Map1TextureCoord1), NO_EXTRA },
- { GL_MAP1_TEXTURE_COORD_2, CONTEXT_BOOL(Eval.Map1TextureCoord2), NO_EXTRA },
- { GL_MAP1_TEXTURE_COORD_3, CONTEXT_BOOL(Eval.Map1TextureCoord3), NO_EXTRA },
- { GL_MAP1_TEXTURE_COORD_4, CONTEXT_BOOL(Eval.Map1TextureCoord4), NO_EXTRA },
- { GL_MAP1_VERTEX_3, CONTEXT_BOOL(Eval.Map1Vertex3), NO_EXTRA },
- { GL_MAP1_VERTEX_4, CONTEXT_BOOL(Eval.Map1Vertex4), NO_EXTRA },
- { GL_MAP2_COLOR_4, CONTEXT_BOOL(Eval.Map2Color4), NO_EXTRA },
- { GL_MAP2_GRID_DOMAIN, LOC_CUSTOM, TYPE_FLOAT_4, 0, NO_EXTRA },
- { GL_MAP2_GRID_SEGMENTS, CONTEXT_INT2(Eval.MapGrid2un), NO_EXTRA },
- { GL_MAP2_INDEX, CONTEXT_BOOL(Eval.Map2Index), NO_EXTRA },
- { GL_MAP2_NORMAL, CONTEXT_BOOL(Eval.Map2Normal), NO_EXTRA },
- { GL_MAP2_TEXTURE_COORD_1, CONTEXT_BOOL(Eval.Map2TextureCoord1), NO_EXTRA },
- { GL_MAP2_TEXTURE_COORD_2, CONTEXT_BOOL(Eval.Map2TextureCoord2), NO_EXTRA },
- { GL_MAP2_TEXTURE_COORD_3, CONTEXT_BOOL(Eval.Map2TextureCoord3), NO_EXTRA },
- { GL_MAP2_TEXTURE_COORD_4, CONTEXT_BOOL(Eval.Map2TextureCoord4), NO_EXTRA },
- { GL_MAP2_VERTEX_3, CONTEXT_BOOL(Eval.Map2Vertex3), NO_EXTRA },
- { GL_MAP2_VERTEX_4, CONTEXT_BOOL(Eval.Map2Vertex4), NO_EXTRA },
- { GL_MAP_COLOR, CONTEXT_BOOL(Pixel.MapColorFlag), NO_EXTRA },
- { GL_MAP_STENCIL, CONTEXT_BOOL(Pixel.MapStencilFlag), NO_EXTRA },
- { GL_MAX_ATTRIB_STACK_DEPTH, CONST(MAX_ATTRIB_STACK_DEPTH), NO_EXTRA },
- { GL_MAX_CLIENT_ATTRIB_STACK_DEPTH, CONST(MAX_CLIENT_ATTRIB_STACK_DEPTH), NO_EXTRA },
-
- { GL_MAX_EVAL_ORDER, CONST(MAX_EVAL_ORDER), NO_EXTRA },
- { GL_MAX_LIST_NESTING, CONST(MAX_LIST_NESTING), NO_EXTRA },
- { GL_MAX_NAME_STACK_DEPTH, CONST(MAX_NAME_STACK_DEPTH), NO_EXTRA },
- { GL_MAX_PIXEL_MAP_TABLE, CONST(MAX_PIXEL_MAP_TABLE), NO_EXTRA },
- { GL_NAME_STACK_DEPTH, CONTEXT_INT(Select.NameStackDepth), NO_EXTRA },
- { GL_PACK_LSB_FIRST, CONTEXT_BOOL(Pack.LsbFirst), NO_EXTRA },
- { GL_PACK_ROW_LENGTH, CONTEXT_INT(Pack.RowLength), NO_EXTRA },
- { GL_PACK_SKIP_PIXELS, CONTEXT_INT(Pack.SkipPixels), NO_EXTRA },
- { GL_PACK_SKIP_ROWS, CONTEXT_INT(Pack.SkipRows), NO_EXTRA },
- { GL_PACK_SWAP_BYTES, CONTEXT_BOOL(Pack.SwapBytes), NO_EXTRA },
- { GL_PACK_IMAGE_HEIGHT_EXT, CONTEXT_INT(Pack.ImageHeight), NO_EXTRA },
- { GL_PACK_INVERT_MESA, CONTEXT_BOOL(Pack.Invert), NO_EXTRA },
- { GL_PIXEL_MAP_A_TO_A_SIZE, CONTEXT_INT(PixelMaps.AtoA.Size), NO_EXTRA },
- { GL_PIXEL_MAP_B_TO_B_SIZE, CONTEXT_INT(PixelMaps.BtoB.Size), NO_EXTRA },
- { GL_PIXEL_MAP_G_TO_G_SIZE, CONTEXT_INT(PixelMaps.GtoG.Size), NO_EXTRA },
- { GL_PIXEL_MAP_I_TO_A_SIZE, CONTEXT_INT(PixelMaps.ItoA.Size), NO_EXTRA },
- { GL_PIXEL_MAP_I_TO_B_SIZE, CONTEXT_INT(PixelMaps.ItoB.Size), NO_EXTRA },
- { GL_PIXEL_MAP_I_TO_G_SIZE, CONTEXT_INT(PixelMaps.ItoG.Size), NO_EXTRA },
- { GL_PIXEL_MAP_I_TO_I_SIZE, CONTEXT_INT(PixelMaps.ItoI.Size), NO_EXTRA },
- { GL_PIXEL_MAP_I_TO_R_SIZE, CONTEXT_INT(PixelMaps.ItoR.Size), NO_EXTRA },
- { GL_PIXEL_MAP_R_TO_R_SIZE, CONTEXT_INT(PixelMaps.RtoR.Size), NO_EXTRA },
- { GL_PIXEL_MAP_S_TO_S_SIZE, CONTEXT_INT(PixelMaps.StoS.Size), NO_EXTRA },
- { GL_POINT_SIZE_GRANULARITY, CONTEXT_FLOAT(Const.PointSizeGranularity), NO_EXTRA },
- { GL_POLYGON_MODE, CONTEXT_ENUM2(Polygon.FrontMode), NO_EXTRA },
- { GL_POLYGON_OFFSET_BIAS_EXT, CONTEXT_FLOAT(Polygon.OffsetUnits), NO_EXTRA },
- { GL_POLYGON_OFFSET_POINT, CONTEXT_BOOL(Polygon.OffsetPoint), NO_EXTRA },
- { GL_POLYGON_OFFSET_LINE, CONTEXT_BOOL(Polygon.OffsetLine), NO_EXTRA },
- { GL_POLYGON_SMOOTH, CONTEXT_BOOL(Polygon.SmoothFlag), NO_EXTRA },
- { GL_POLYGON_SMOOTH_HINT, CONTEXT_ENUM(Hint.PolygonSmooth), NO_EXTRA },
- { GL_POLYGON_STIPPLE, CONTEXT_BOOL(Polygon.StippleFlag), NO_EXTRA },
- { GL_READ_BUFFER, LOC_CUSTOM, TYPE_ENUM, NO_OFFSET, NO_EXTRA },
- { GL_RED_BIAS, CONTEXT_FLOAT(Pixel.RedBias), NO_EXTRA },
- { GL_RED_SCALE, CONTEXT_FLOAT(Pixel.RedScale), NO_EXTRA },
- { GL_RENDER_MODE, CONTEXT_ENUM(RenderMode), NO_EXTRA },
- { GL_RGBA_MODE, CONST(1), NO_EXTRA },
- { GL_SELECTION_BUFFER_SIZE, CONTEXT_INT(Select.BufferSize), NO_EXTRA },
- { GL_SHARED_TEXTURE_PALETTE_EXT, CONTEXT_BOOL(Texture.SharedPalette), NO_EXTRA },
-
- { GL_STEREO, BUFFER_INT(Visual.stereoMode), NO_EXTRA },
-
- { GL_TEXTURE_1D, LOC_CUSTOM, TYPE_BOOLEAN, NO_OFFSET, NO_EXTRA },
- { GL_TEXTURE_3D, LOC_CUSTOM, TYPE_BOOLEAN, NO_OFFSET, NO_EXTRA },
- { GL_TEXTURE_1D_ARRAY_EXT, LOC_CUSTOM, TYPE_BOOLEAN, NO_OFFSET, NO_EXTRA },
- { GL_TEXTURE_2D_ARRAY_EXT, LOC_CUSTOM, TYPE_BOOLEAN, NO_OFFSET, NO_EXTRA },
-
- { GL_TEXTURE_BINDING_1D, LOC_CUSTOM, TYPE_INT, TEXTURE_1D_INDEX, NO_EXTRA },
- { GL_TEXTURE_BINDING_1D_ARRAY, LOC_CUSTOM, TYPE_INT,
- TEXTURE_1D_ARRAY_INDEX, extra_MESA_texture_array },
- { GL_TEXTURE_BINDING_2D_ARRAY, LOC_CUSTOM, TYPE_INT,
- TEXTURE_1D_ARRAY_INDEX, extra_MESA_texture_array },
- { GL_MAX_ARRAY_TEXTURE_LAYERS_EXT,
- CONTEXT_INT(Const.MaxArrayTextureLayers), extra_MESA_texture_array },
-
- { GL_TEXTURE_GEN_S, LOC_TEXUNIT, TYPE_BIT_0,
- offsetof(struct gl_texture_unit, TexGenEnabled), NO_EXTRA },
- { GL_TEXTURE_GEN_T, LOC_TEXUNIT, TYPE_BIT_1,
- offsetof(struct gl_texture_unit, TexGenEnabled), NO_EXTRA },
- { GL_TEXTURE_GEN_R, LOC_TEXUNIT, TYPE_BIT_2,
- offsetof(struct gl_texture_unit, TexGenEnabled), NO_EXTRA },
- { GL_TEXTURE_GEN_Q, LOC_TEXUNIT, TYPE_BIT_3,
- offsetof(struct gl_texture_unit, TexGenEnabled), NO_EXTRA },
- { GL_UNPACK_LSB_FIRST, CONTEXT_BOOL(Unpack.LsbFirst), NO_EXTRA },
- { GL_UNPACK_ROW_LENGTH, CONTEXT_INT(Unpack.RowLength), NO_EXTRA },
- { GL_UNPACK_SKIP_PIXELS, CONTEXT_INT(Unpack.SkipPixels), NO_EXTRA },
- { GL_UNPACK_SKIP_ROWS, CONTEXT_INT(Unpack.SkipRows), NO_EXTRA },
- { GL_UNPACK_SWAP_BYTES, CONTEXT_BOOL(Unpack.SwapBytes), NO_EXTRA },
- { GL_UNPACK_SKIP_IMAGES_EXT, CONTEXT_INT(Unpack.SkipImages), NO_EXTRA },
- { GL_UNPACK_IMAGE_HEIGHT_EXT, CONTEXT_INT(Unpack.ImageHeight), NO_EXTRA },
- { GL_UNPACK_CLIENT_STORAGE_APPLE, CONTEXT_BOOL(Unpack.ClientStorage), NO_EXTRA },
- { GL_ZOOM_X, CONTEXT_FLOAT(Pixel.ZoomX), NO_EXTRA },
- { GL_ZOOM_Y, CONTEXT_FLOAT(Pixel.ZoomY), NO_EXTRA },
-
- /* Vertex arrays */
- { GL_VERTEX_ARRAY_COUNT_EXT, CONST(0), NO_EXTRA },
- { GL_NORMAL_ARRAY_COUNT_EXT, CONST(0), NO_EXTRA },
- { GL_COLOR_ARRAY_COUNT_EXT, CONST(0), NO_EXTRA },
- { GL_INDEX_ARRAY, ARRAY_BOOL(Index.Enabled), NO_EXTRA },
- { GL_INDEX_ARRAY_TYPE, ARRAY_ENUM(Index.Type), NO_EXTRA },
- { GL_INDEX_ARRAY_STRIDE, ARRAY_INT(Index.Stride), NO_EXTRA },
- { GL_INDEX_ARRAY_COUNT_EXT, CONST(0), NO_EXTRA },
- { GL_TEXTURE_COORD_ARRAY_COUNT_EXT, CONST(0), NO_EXTRA },
- { GL_EDGE_FLAG_ARRAY, ARRAY_BOOL(EdgeFlag.Enabled), NO_EXTRA },
- { GL_EDGE_FLAG_ARRAY_STRIDE, ARRAY_INT(EdgeFlag.Stride), NO_EXTRA },
- { GL_EDGE_FLAG_ARRAY_COUNT_EXT, CONST(0), NO_EXTRA },
-
- /* GL_ARB_texture_compression */
- { GL_TEXTURE_COMPRESSION_HINT_ARB, CONTEXT_INT(Hint.TextureCompression), NO_EXTRA },
-
- /* GL_EXT_compiled_vertex_array */
- { GL_ARRAY_ELEMENT_LOCK_FIRST_EXT, CONTEXT_INT(Array.LockFirst),
- extra_EXT_compiled_vertex_array },
- { GL_ARRAY_ELEMENT_LOCK_COUNT_EXT, CONTEXT_INT(Array.LockCount),
- extra_EXT_compiled_vertex_array },
-
- /* GL_ARB_transpose_matrix */
- { GL_TRANSPOSE_MODELVIEW_MATRIX_ARB,
- CONTEXT_MATRIX_T(ModelviewMatrixStack), NO_EXTRA },
- { GL_TRANSPOSE_PROJECTION_MATRIX_ARB,
- CONTEXT_MATRIX_T(ProjectionMatrixStack.Top), NO_EXTRA },
- { GL_TRANSPOSE_TEXTURE_MATRIX_ARB, CONTEXT_MATRIX_T(TextureMatrixStack), NO_EXTRA },
-
- /* GL_EXT_secondary_color */
- { GL_COLOR_SUM_EXT, CONTEXT_BOOL(Fog.ColorSumEnabled),
- extra_EXT_secondary_color_ARB_vertex_program },
- { GL_CURRENT_SECONDARY_COLOR_EXT,
- CONTEXT_FIELD(Current.Attrib[VERT_ATTRIB_COLOR1][0], TYPE_FLOATN_4),
- extra_EXT_secondary_color_flush_current },
- { GL_SECONDARY_COLOR_ARRAY_EXT, ARRAY_BOOL(SecondaryColor.Enabled),
- extra_EXT_secondary_color },
- { GL_SECONDARY_COLOR_ARRAY_TYPE_EXT, ARRAY_ENUM(SecondaryColor.Type),
- extra_EXT_secondary_color },
- { GL_SECONDARY_COLOR_ARRAY_STRIDE_EXT, ARRAY_INT(SecondaryColor.Stride),
- extra_EXT_secondary_color },
- { GL_SECONDARY_COLOR_ARRAY_SIZE_EXT, ARRAY_INT(SecondaryColor.Size),
- extra_EXT_secondary_color },
-
- /* GL_EXT_fog_coord */
- { GL_CURRENT_FOG_COORDINATE_EXT,
- CONTEXT_FLOAT(Current.Attrib[VERT_ATTRIB_FOG][0]),
- extra_EXT_fog_coord_flush_current },
- { GL_FOG_COORDINATE_ARRAY_EXT, ARRAY_BOOL(FogCoord.Enabled),
- extra_EXT_fog_coord },
- { GL_FOG_COORDINATE_ARRAY_TYPE_EXT, ARRAY_ENUM(FogCoord.Type),
- extra_EXT_fog_coord },
- { GL_FOG_COORDINATE_ARRAY_STRIDE_EXT, ARRAY_INT(FogCoord.Stride),
- extra_EXT_fog_coord },
- { GL_FOG_COORDINATE_SOURCE_EXT, CONTEXT_ENUM(Fog.FogCoordinateSource),
- extra_EXT_fog_coord },
-
- /* GL_IBM_rasterpos_clip */
- { GL_RASTER_POSITION_UNCLIPPED_IBM,
- CONTEXT_BOOL(Transform.RasterPositionUnclipped),
- extra_IBM_rasterpos_clip },
-
- /* GL_NV_point_sprite */
- { GL_POINT_SPRITE_R_MODE_NV,
- CONTEXT_ENUM(Point.SpriteRMode), extra_NV_point_sprite },
- { GL_POINT_SPRITE_COORD_ORIGIN, CONTEXT_ENUM(Point.SpriteOrigin),
- extra_NV_point_sprite_ARB_point_sprite },
-
- /* GL_NV_vertex_program */
- { GL_VERTEX_PROGRAM_BINDING_NV, LOC_CUSTOM, TYPE_INT, 0,
- extra_NV_vertex_program },
- { GL_VERTEX_ATTRIB_ARRAY0_NV, ARRAY_BOOL(VertexAttrib[0].Enabled),
- extra_NV_vertex_program },
- { GL_VERTEX_ATTRIB_ARRAY1_NV, ARRAY_BOOL(VertexAttrib[1].Enabled),
- extra_NV_vertex_program },
- { GL_VERTEX_ATTRIB_ARRAY2_NV, ARRAY_BOOL(VertexAttrib[2].Enabled),
- extra_NV_vertex_program },
- { GL_VERTEX_ATTRIB_ARRAY3_NV, ARRAY_BOOL(VertexAttrib[3].Enabled),
- extra_NV_vertex_program },
- { GL_VERTEX_ATTRIB_ARRAY4_NV, ARRAY_BOOL(VertexAttrib[4].Enabled),
- extra_NV_vertex_program },
- { GL_VERTEX_ATTRIB_ARRAY5_NV, ARRAY_BOOL(VertexAttrib[5].Enabled),
- extra_NV_vertex_program },
- { GL_VERTEX_ATTRIB_ARRAY6_NV, ARRAY_BOOL(VertexAttrib[6].Enabled),
- extra_NV_vertex_program },
- { GL_VERTEX_ATTRIB_ARRAY7_NV, ARRAY_BOOL(VertexAttrib[7].Enabled),
- extra_NV_vertex_program },
- { GL_VERTEX_ATTRIB_ARRAY8_NV, ARRAY_BOOL(VertexAttrib[8].Enabled),
- extra_NV_vertex_program },
- { GL_VERTEX_ATTRIB_ARRAY9_NV, ARRAY_BOOL(VertexAttrib[9].Enabled),
- extra_NV_vertex_program },
- { GL_VERTEX_ATTRIB_ARRAY10_NV, ARRAY_BOOL(VertexAttrib[10].Enabled),
- extra_NV_vertex_program },
- { GL_VERTEX_ATTRIB_ARRAY11_NV, ARRAY_BOOL(VertexAttrib[11].Enabled),
- extra_NV_vertex_program },
- { GL_VERTEX_ATTRIB_ARRAY12_NV, ARRAY_BOOL(VertexAttrib[12].Enabled),
- extra_NV_vertex_program },
- { GL_VERTEX_ATTRIB_ARRAY13_NV, ARRAY_BOOL(VertexAttrib[13].Enabled),
- extra_NV_vertex_program },
- { GL_VERTEX_ATTRIB_ARRAY14_NV, ARRAY_BOOL(VertexAttrib[14].Enabled),
- extra_NV_vertex_program },
- { GL_VERTEX_ATTRIB_ARRAY15_NV, ARRAY_BOOL(VertexAttrib[15].Enabled),
- extra_NV_vertex_program },
- { GL_MAP1_VERTEX_ATTRIB0_4_NV, CONTEXT_BOOL(Eval.Map1Attrib[0]),
- extra_NV_vertex_program },
- { GL_MAP1_VERTEX_ATTRIB1_4_NV, CONTEXT_BOOL(Eval.Map1Attrib[1]),
- extra_NV_vertex_program },
- { GL_MAP1_VERTEX_ATTRIB2_4_NV, CONTEXT_BOOL(Eval.Map1Attrib[2]),
- extra_NV_vertex_program },
- { GL_MAP1_VERTEX_ATTRIB3_4_NV, CONTEXT_BOOL(Eval.Map1Attrib[3]),
- extra_NV_vertex_program },
- { GL_MAP1_VERTEX_ATTRIB4_4_NV, CONTEXT_BOOL(Eval.Map1Attrib[4]),
- extra_NV_vertex_program },
- { GL_MAP1_VERTEX_ATTRIB5_4_NV, CONTEXT_BOOL(Eval.Map1Attrib[5]),
- extra_NV_vertex_program },
- { GL_MAP1_VERTEX_ATTRIB6_4_NV, CONTEXT_BOOL(Eval.Map1Attrib[6]),
- extra_NV_vertex_program },
- { GL_MAP1_VERTEX_ATTRIB7_4_NV, CONTEXT_BOOL(Eval.Map1Attrib[7]),
- extra_NV_vertex_program },
- { GL_MAP1_VERTEX_ATTRIB8_4_NV, CONTEXT_BOOL(Eval.Map1Attrib[8]),
- extra_NV_vertex_program },
- { GL_MAP1_VERTEX_ATTRIB9_4_NV, CONTEXT_BOOL(Eval.Map1Attrib[9]),
- extra_NV_vertex_program },
- { GL_MAP1_VERTEX_ATTRIB10_4_NV, CONTEXT_BOOL(Eval.Map1Attrib[10]),
- extra_NV_vertex_program },
- { GL_MAP1_VERTEX_ATTRIB11_4_NV, CONTEXT_BOOL(Eval.Map1Attrib[11]),
- extra_NV_vertex_program },
- { GL_MAP1_VERTEX_ATTRIB12_4_NV, CONTEXT_BOOL(Eval.Map1Attrib[12]),
- extra_NV_vertex_program },
- { GL_MAP1_VERTEX_ATTRIB13_4_NV, CONTEXT_BOOL(Eval.Map1Attrib[13]),
- extra_NV_vertex_program },
- { GL_MAP1_VERTEX_ATTRIB14_4_NV, CONTEXT_BOOL(Eval.Map1Attrib[14]),
- extra_NV_vertex_program },
- { GL_MAP1_VERTEX_ATTRIB15_4_NV, CONTEXT_BOOL(Eval.Map1Attrib[15]),
- extra_NV_vertex_program },
-
- /* GL_NV_fragment_program */
- { GL_FRAGMENT_PROGRAM_NV, CONTEXT_BOOL(FragmentProgram.Enabled),
- extra_NV_fragment_program },
- { GL_FRAGMENT_PROGRAM_BINDING_NV, LOC_CUSTOM, TYPE_INT, 0,
- extra_NV_fragment_program },
- { GL_MAX_FRAGMENT_PROGRAM_LOCAL_PARAMETERS_NV,
- CONST(MAX_NV_FRAGMENT_PROGRAM_PARAMS),
- extra_NV_fragment_program },
-
- /* GL_NV_texture_rectangle */
- { GL_TEXTURE_RECTANGLE_NV,
- LOC_CUSTOM, TYPE_BOOLEAN, 0, extra_NV_texture_rectangle },
- { GL_TEXTURE_BINDING_RECTANGLE_NV,
- LOC_CUSTOM, TYPE_INT, TEXTURE_RECT_INDEX, extra_NV_texture_rectangle },
- { GL_MAX_RECTANGLE_TEXTURE_SIZE_NV,
- CONTEXT_INT(Const.MaxTextureRectSize), extra_NV_texture_rectangle },
-
- /* GL_EXT_stencil_two_side */
- { GL_STENCIL_TEST_TWO_SIDE_EXT, CONTEXT_BOOL(Stencil.TestTwoSide),
- extra_EXT_stencil_two_side },
- { GL_ACTIVE_STENCIL_FACE_EXT, LOC_CUSTOM, TYPE_ENUM, NO_OFFSET, NO_EXTRA },
-
- /* GL_NV_light_max_exponent */
- { GL_MAX_SHININESS_NV, CONTEXT_FLOAT(Const.MaxShininess),
- extra_NV_light_max_exponent },
- { GL_MAX_SPOT_EXPONENT_NV, CONTEXT_FLOAT(Const.MaxSpotExponent),
- extra_NV_light_max_exponent },
-
- /* GL_NV_primitive_restart */
- { GL_PRIMITIVE_RESTART_NV, CONTEXT_BOOL(Array.PrimitiveRestart),
- extra_NV_primitive_restart },
- { GL_PRIMITIVE_RESTART_INDEX_NV, CONTEXT_INT(Array.RestartIndex),
- extra_NV_primitive_restart },
-
- /* GL_ARB_vertex_buffer_object */
- { GL_INDEX_ARRAY_BUFFER_BINDING_ARB, LOC_CUSTOM, TYPE_INT,
- offsetof(struct gl_array_object, Index.BufferObj), NO_EXTRA },
- { GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB, LOC_CUSTOM, TYPE_INT,
- offsetof(struct gl_array_object, EdgeFlag.BufferObj), NO_EXTRA },
- { GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB, LOC_CUSTOM, TYPE_INT,
- offsetof(struct gl_array_object, SecondaryColor.BufferObj), NO_EXTRA },
- { GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB, LOC_CUSTOM, TYPE_INT,
- offsetof(struct gl_array_object, FogCoord.BufferObj), NO_EXTRA },
-
- /* GL_EXT_pixel_buffer_object */
- { GL_PIXEL_PACK_BUFFER_BINDING_EXT, LOC_CUSTOM, TYPE_INT, 0,
- extra_EXT_pixel_buffer_object },
- { GL_PIXEL_UNPACK_BUFFER_BINDING_EXT, LOC_CUSTOM, TYPE_INT, 0,
- extra_EXT_pixel_buffer_object },
-
- /* GL_ARB_vertex_program */
- { GL_VERTEX_PROGRAM_ARB, /* == GL_VERTEX_PROGRAM_NV */
- CONTEXT_BOOL(VertexProgram.Enabled),
- extra_ARB_vertex_program_NV_vertex_program },
- { GL_VERTEX_PROGRAM_POINT_SIZE_ARB, /* == GL_VERTEX_PROGRAM_POINT_SIZE_NV*/
- CONTEXT_BOOL(VertexProgram.PointSizeEnabled),
- extra_ARB_vertex_program_NV_vertex_program },
- { GL_VERTEX_PROGRAM_TWO_SIDE_ARB, /* == GL_VERTEX_PROGRAM_TWO_SIDE_NV */
- CONTEXT_BOOL(VertexProgram.TwoSideEnabled),
- extra_ARB_vertex_program_NV_vertex_program },
- { GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB, /* == GL_MAX_TRACK_MATRIX_STACK_DEPTH_NV */
- CONTEXT_INT(Const.MaxProgramMatrixStackDepth),
- extra_ARB_vertex_program_ARB_fragment_program_NV_vertex_program },
- { GL_MAX_PROGRAM_MATRICES_ARB, /* == GL_MAX_TRACK_MATRICES_NV */
- CONTEXT_INT(Const.MaxProgramMatrices),
- extra_ARB_vertex_program_ARB_fragment_program_NV_vertex_program },
- { GL_CURRENT_MATRIX_STACK_DEPTH_ARB, /* == GL_CURRENT_MATRIX_STACK_DEPTH_NV */
- LOC_CUSTOM, TYPE_INT, 0,
- extra_ARB_vertex_program_ARB_fragment_program_NV_vertex_program },
-
- { GL_CURRENT_MATRIX_ARB, /* == GL_CURRENT_MATRIX_NV */
- LOC_CUSTOM, TYPE_MATRIX, 0,
- extra_ARB_vertex_program_ARB_fragment_program_NV_vertex_program },
- { GL_TRANSPOSE_CURRENT_MATRIX_ARB, /* == GL_CURRENT_MATRIX_NV */
- LOC_CUSTOM, TYPE_MATRIX, 0,
- extra_ARB_vertex_program_ARB_fragment_program },
-
- { GL_PROGRAM_ERROR_POSITION_ARB, /* == GL_PROGRAM_ERROR_POSITION_NV */
- CONTEXT_INT(Program.ErrorPos),
- extra_NV_vertex_program_ARB_vertex_program_ARB_fragment_program_NV_vertex_program },
-
- /* GL_ARB_fragment_program */
- { GL_FRAGMENT_PROGRAM_ARB, CONTEXT_BOOL(FragmentProgram.Enabled),
- extra_ARB_fragment_program },
-
- /* GL_EXT_depth_bounds_test */
- { GL_DEPTH_BOUNDS_TEST_EXT, CONTEXT_BOOL(Depth.BoundsTest),
- extra_EXT_depth_bounds_test },
- { GL_DEPTH_BOUNDS_EXT, CONTEXT_FLOAT2(Depth.BoundsMin),
- extra_EXT_depth_bounds_test },
-
- /* GL_ARB_depth_clamp*/
- { GL_DEPTH_CLAMP, CONTEXT_BOOL(Transform.DepthClamp),
- extra_ARB_depth_clamp },
-
- /* GL_ARB_draw_buffers */
- { GL_DRAW_BUFFER0_ARB, BUFFER_ENUM(ColorDrawBuffer[0]), NO_EXTRA },
- { GL_DRAW_BUFFER1_ARB, BUFFER_ENUM(ColorDrawBuffer[1]),
- extra_valid_draw_buffer },
- { GL_DRAW_BUFFER2_ARB, BUFFER_ENUM(ColorDrawBuffer[2]),
- extra_valid_draw_buffer },
- { GL_DRAW_BUFFER3_ARB, BUFFER_ENUM(ColorDrawBuffer[3]),
- extra_valid_draw_buffer },
- { GL_DRAW_BUFFER4_ARB, BUFFER_ENUM(ColorDrawBuffer[4]),
- extra_valid_draw_buffer },
- { GL_DRAW_BUFFER5_ARB, BUFFER_ENUM(ColorDrawBuffer[5]),
- extra_valid_draw_buffer },
- { GL_DRAW_BUFFER6_ARB, BUFFER_ENUM(ColorDrawBuffer[6]),
- extra_valid_draw_buffer },
- { GL_DRAW_BUFFER7_ARB, BUFFER_ENUM(ColorDrawBuffer[7]),
- extra_valid_draw_buffer },
-
- /* GL_ATI_fragment_shader */
- { GL_NUM_FRAGMENT_REGISTERS_ATI, CONST(6), extra_ATI_fragment_shader },
- { GL_NUM_FRAGMENT_CONSTANTS_ATI, CONST(8), extra_ATI_fragment_shader },
- { GL_NUM_PASSES_ATI, CONST(2), extra_ATI_fragment_shader },
- { GL_NUM_INSTRUCTIONS_PER_PASS_ATI, CONST(8), extra_ATI_fragment_shader },
- { GL_NUM_INSTRUCTIONS_TOTAL_ATI, CONST(16), extra_ATI_fragment_shader },
- { GL_COLOR_ALPHA_PAIRING_ATI, CONST(GL_TRUE), extra_ATI_fragment_shader },
- { GL_NUM_LOOPBACK_COMPONENTS_ATI, CONST(3), extra_ATI_fragment_shader },
- { GL_NUM_INPUT_INTERPOLATOR_COMPONENTS_ATI,
- CONST(3), extra_ATI_fragment_shader },
-
- /* GL_EXT_framebuffer_object */
- { GL_MAX_COLOR_ATTACHMENTS_EXT, CONTEXT_INT(Const.MaxColorAttachments),
- extra_EXT_framebuffer_object },
-
- /* GL_EXT_framebuffer_blit
- * NOTE: GL_DRAW_FRAMEBUFFER_BINDING_EXT == GL_FRAMEBUFFER_BINDING_EXT */
- { GL_READ_FRAMEBUFFER_BINDING_EXT, LOC_CUSTOM, TYPE_INT, 0,
- extra_EXT_framebuffer_blit },
-
- /* GL_EXT_provoking_vertex */
- { GL_PROVOKING_VERTEX_EXT,
- CONTEXT_ENUM(Light.ProvokingVertex), extra_EXT_provoking_vertex },
- { GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION_EXT,
- CONTEXT_BOOL(Const.QuadsFollowProvokingVertexConvention),
- extra_EXT_provoking_vertex },
-
- /* GL_ARB_framebuffer_object */
- { GL_MAX_SAMPLES, CONTEXT_INT(Const.MaxSamples),
- extra_ARB_framebuffer_object_EXT_framebuffer_multisample },
-
- /* GL_APPLE_vertex_array_object */
- { GL_VERTEX_ARRAY_BINDING_APPLE, ARRAY_INT(Name),
- extra_APPLE_vertex_array_object },
-
- /* GL_ARB_seamless_cube_map */
- { GL_TEXTURE_CUBE_MAP_SEAMLESS,
- CONTEXT_BOOL(Texture.CubeMapSeamless), extra_ARB_seamless_cube_map },
-
- /* GL_ARB_sync */
- { GL_MAX_SERVER_WAIT_TIMEOUT,
- CONTEXT_INT64(Const.MaxServerWaitTimeout), extra_ARB_sync },
-
- /* GL_EXT_texture_integer */
- { GL_RGBA_INTEGER_MODE_EXT, BUFFER_BOOL(_IntegerColor),
- extra_EXT_texture_integer },
-
- /* GL_EXT_transform_feedback */
- { GL_TRANSFORM_FEEDBACK_BUFFER_BINDING, LOC_CUSTOM, TYPE_INT, 0,
- extra_EXT_transform_feedback },
- { GL_RASTERIZER_DISCARD, CONTEXT_BOOL(TransformFeedback.RasterDiscard),
- extra_EXT_transform_feedback },
- { GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS,
- CONTEXT_INT(Const.MaxTransformFeedbackInterleavedComponents),
- extra_EXT_transform_feedback },
- { GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS,
- CONTEXT_INT(Const.MaxTransformFeedbackSeparateAttribs),
- extra_EXT_transform_feedback },
- { GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS,
- CONTEXT_INT(Const.MaxTransformFeedbackSeparateComponents),
- extra_EXT_transform_feedback },
-
- /* GL_ARB_transform_feedback2 */
- { GL_TRANSFORM_FEEDBACK_BUFFER_PAUSED, LOC_CUSTOM, TYPE_BOOLEAN, 0,
- extra_ARB_transform_feedback2 },
- { GL_TRANSFORM_FEEDBACK_BUFFER_ACTIVE, LOC_CUSTOM, TYPE_BOOLEAN, 0,
- extra_ARB_transform_feedback2 },
- { GL_TRANSFORM_FEEDBACK_BINDING, LOC_CUSTOM, TYPE_INT, 0,
- extra_ARB_transform_feedback2 },
-
- /* GL_ARB_geometry_shader4 */
- { GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_ARB,
- CONTEXT_INT(Const.MaxGeometryTextureImageUnits),
- extra_ARB_geometry_shader4 },
- { GL_MAX_GEOMETRY_OUTPUT_VERTICES_ARB,
- CONTEXT_INT(Const.MaxGeometryOutputVertices),
- extra_ARB_geometry_shader4 },
- { GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_ARB,
- CONTEXT_INT(Const.MaxGeometryTotalOutputComponents),
- extra_ARB_geometry_shader4 },
- { GL_MAX_GEOMETRY_UNIFORM_COMPONENTS_ARB,
- CONTEXT_INT(Const.GeometryProgram.MaxUniformComponents),
- extra_ARB_geometry_shader4 },
- { GL_MAX_GEOMETRY_VARYING_COMPONENTS_ARB,
- CONTEXT_INT(Const.MaxGeometryVaryingComponents),
- extra_ARB_geometry_shader4 },
- { GL_MAX_VERTEX_VARYING_COMPONENTS_ARB,
- CONTEXT_INT(Const.MaxVertexVaryingComponents),
- extra_ARB_geometry_shader4 },
-
- /* GL_ARB_color_buffer_float */
- { GL_RGBA_FLOAT_MODE_ARB, BUFFER_FIELD(Visual.floatMode, TYPE_BOOLEAN), 0 },
-
- /* GL_EXT_gpu_shader4 / GL 3.0 */
- { GL_MIN_PROGRAM_TEXEL_OFFSET,
- CONTEXT_INT(Const.MinProgramTexelOffset),
- extra_EXT_gpu_shader4 },
- { GL_MAX_PROGRAM_TEXEL_OFFSET,
- CONTEXT_INT(Const.MaxProgramTexelOffset),
- extra_EXT_gpu_shader4 },
-
- /* GL_ARB_texture_buffer_object */
- { GL_MAX_TEXTURE_BUFFER_SIZE_ARB, CONTEXT_INT(Const.MaxTextureBufferSize),
- extra_ARB_texture_buffer_object },
- { GL_TEXTURE_BINDING_BUFFER_ARB, LOC_CUSTOM, TYPE_INT, 0,
- extra_ARB_texture_buffer_object },
- { GL_TEXTURE_BUFFER_DATA_STORE_BINDING_ARB, LOC_CUSTOM, TYPE_INT,
- TEXTURE_BUFFER_INDEX, extra_ARB_texture_buffer_object },
- { GL_TEXTURE_BUFFER_FORMAT_ARB, LOC_CUSTOM, TYPE_INT, 0,
- extra_ARB_texture_buffer_object },
- { GL_TEXTURE_BUFFER_ARB, LOC_CUSTOM, TYPE_INT, 0,
- extra_ARB_texture_buffer_object },
-
- /* GL_ARB_sampler_objects / GL 3.3 */
- { GL_SAMPLER_BINDING,
- LOC_CUSTOM, TYPE_INT, GL_SAMPLER_BINDING, extra_ARB_sampler_objects },
-
- /* GL 3.0 */
- { GL_NUM_EXTENSIONS, LOC_CUSTOM, TYPE_INT, 0, extra_version_30 },
- { GL_MAJOR_VERSION, CONTEXT_INT(VersionMajor), extra_version_30 },
- { GL_MINOR_VERSION, CONTEXT_INT(VersionMinor), extra_version_30 },
- { GL_CONTEXT_FLAGS, CONTEXT_INT(Const.ContextFlags), extra_version_30 },
-
- /* GL3.0 / GL_EXT_framebuffer_sRGB */
- { GL_FRAMEBUFFER_SRGB_EXT, CONTEXT_BOOL(Color.sRGBEnabled), extra_EXT_framebuffer_sRGB },
- { GL_FRAMEBUFFER_SRGB_CAPABLE_EXT, BUFFER_INT(Visual.sRGBCapable), extra_EXT_framebuffer_sRGB },
-
- /* GL 3.1 */
- /* NOTE: different enum values for GL_PRIMITIVE_RESTART_NV
- * vs. GL_PRIMITIVE_RESTART!
- */
- { GL_PRIMITIVE_RESTART, CONTEXT_BOOL(Array.PrimitiveRestart),
- extra_version_31 },
- { GL_PRIMITIVE_RESTART_INDEX, CONTEXT_INT(Array.RestartIndex),
- extra_version_31 },
-
-
- /* GL 3.2 */
- { GL_CONTEXT_PROFILE_MASK, CONTEXT_INT(Const.ProfileMask),
- extra_version_32 },
-
- /* GL_ARB_robustness */
- { GL_RESET_NOTIFICATION_STRATEGY_ARB, CONTEXT_ENUM(Const.ResetStrategy), NO_EXTRA },
-#endif /* FEATURE_GL */
-};
-
-/* All we need now is a way to look up the value struct from the enum.
- * The code generated by gcc for the old generated big switch
- * statement is a big, balanced, open coded if/else tree, essentially
- * an unrolled binary search. It would be natural to sort the new
- * enum table and use bsearch(), but we will use a read-only hash
- * table instead. bsearch() has a nice guaranteed worst case
- * performance, but we're also guaranteed to hit that worst case
- * (log2(n) iterations) for about half the enums. Instead, using an
- * open addressing hash table, we can find the enum on the first try
- * for 80% of the enums, 1 collision for 10% and never more than 5
- * collisions for any enum (typical numbers). And the code is very
- * simple, even though it feels a little magic. */
-
-static unsigned short table[1024];
-static const int prime_factor = 89, prime_step = 281;
-
-#ifdef GET_DEBUG
-static void
-print_table_stats(void)
-{
- int i, j, collisions[11], count, hash, mask;
- const struct value_desc *d;
-
- count = 0;
- mask = Elements(table) - 1;
- memset(collisions, 0, sizeof collisions);
-
- for (i = 0; i < Elements(table); i++) {
- if (!table[i])
- continue;
- count++;
- d = &values[table[i]];
- hash = (d->pname * prime_factor);
- j = 0;
- while (1) {
- if (values[table[hash & mask]].pname == d->pname)
- break;
- hash += prime_step;
- j++;
- }
-
- if (j < 10)
- collisions[j]++;
- else
- collisions[10]++;
- }
-
- printf("number of enums: %d (total %d)\n", count, Elements(values));
- for (i = 0; i < Elements(collisions) - 1; i++)
- if (collisions[i] > 0)
- printf(" %d enums with %d %scollisions\n",
- collisions[i], i, i == 10 ? "or more " : "");
-}
-#endif
-
-/**
- * Initialize the enum hash for a given API
- *
- * This is called from one_time_init() to insert the enum values that
- * are valid for the API in question into the enum hash table.
- *
- * \param the current context, for determining the API in question
- */
-void _mesa_init_get_hash(struct gl_context *ctx)
-{
- int i, hash, index, mask;
- int api_mask = 0, api_bit;
-
- mask = Elements(table) - 1;
- api_bit = 1 << ctx->API;
-
- for (i = 0; i < Elements(values); i++) {
- if (values[i].type == TYPE_API_MASK) {
- api_mask = values[i].offset;
- continue;
- }
- if (!(api_mask & api_bit))
- continue;
-
- hash = (values[i].pname * prime_factor) & mask;
- while (1) {
- index = hash & mask;
- if (!table[index]) {
- table[index] = i;
- break;
- }
- hash += prime_step;
- }
- }
-
-#ifdef GET_DEBUG
- print_table_stats();
-#endif
-}
-
-/**
- * Handle irregular enums
- *
- * Some values don't conform to the "well-known type at context
- * pointer + offset" pattern, so we have this function to catch all
- * the corner cases. Typically, it's a computed value or a one-off
- * pointer to a custom struct or something.
- *
- * In this case we can't return a pointer to the value, so we'll have
- * to use the temporary variable 'v' declared back in the calling
- * glGet*v() function to store the result.
- *
- * \param ctx the current context
- * \param d the struct value_desc that describes the enum
- * \param v pointer to the tmp declared in the calling glGet*v() function
- */
-static void
-find_custom_value(struct gl_context *ctx, const struct value_desc *d, union value *v)
-{
- struct gl_buffer_object **buffer_obj;
- struct gl_client_array *array;
- GLuint unit, *p;
-
- switch (d->pname) {
- case GL_TEXTURE_1D:
- case GL_TEXTURE_2D:
- case GL_TEXTURE_3D:
- case GL_TEXTURE_1D_ARRAY_EXT:
- case GL_TEXTURE_2D_ARRAY_EXT:
- case GL_TEXTURE_CUBE_MAP_ARB:
- case GL_TEXTURE_RECTANGLE_NV:
- v->value_bool = _mesa_IsEnabled(d->pname);
- break;
-
- case GL_LINE_STIPPLE_PATTERN:
- /* This is the only GLushort, special case it here by promoting
- * to an int rather than introducing a new type. */
- v->value_int = ctx->Line.StipplePattern;
- break;
-
- case GL_CURRENT_RASTER_TEXTURE_COORDS:
- unit = ctx->Texture.CurrentUnit;
- v->value_float_4[0] = ctx->Current.RasterTexCoords[unit][0];
- v->value_float_4[1] = ctx->Current.RasterTexCoords[unit][1];
- v->value_float_4[2] = ctx->Current.RasterTexCoords[unit][2];
- v->value_float_4[3] = ctx->Current.RasterTexCoords[unit][3];
- break;
-
- case GL_CURRENT_TEXTURE_COORDS:
- unit = ctx->Texture.CurrentUnit;
- v->value_float_4[0] = ctx->Current.Attrib[VERT_ATTRIB_TEX0 + unit][0];
- v->value_float_4[1] = ctx->Current.Attrib[VERT_ATTRIB_TEX0 + unit][1];
- v->value_float_4[2] = ctx->Current.Attrib[VERT_ATTRIB_TEX0 + unit][2];
- v->value_float_4[3] = ctx->Current.Attrib[VERT_ATTRIB_TEX0 + unit][3];
- break;
-
- case GL_COLOR_WRITEMASK:
- v->value_int_4[0] = ctx->Color.ColorMask[0][RCOMP] ? 1 : 0;
- v->value_int_4[1] = ctx->Color.ColorMask[0][GCOMP] ? 1 : 0;
- v->value_int_4[2] = ctx->Color.ColorMask[0][BCOMP] ? 1 : 0;
- v->value_int_4[3] = ctx->Color.ColorMask[0][ACOMP] ? 1 : 0;
- break;
-
- case GL_EDGE_FLAG:
- v->value_bool = ctx->Current.Attrib[VERT_ATTRIB_EDGEFLAG][0] == 1.0;
- break;
-
- case GL_READ_BUFFER:
- v->value_enum = ctx->ReadBuffer->ColorReadBuffer;
- break;
-
- case GL_MAP2_GRID_DOMAIN:
- v->value_float_4[0] = ctx->Eval.MapGrid2u1;
- v->value_float_4[1] = ctx->Eval.MapGrid2u2;
- v->value_float_4[2] = ctx->Eval.MapGrid2v1;
- v->value_float_4[3] = ctx->Eval.MapGrid2v2;
- break;
-
- case GL_TEXTURE_STACK_DEPTH:
- unit = ctx->Texture.CurrentUnit;
- v->value_int = ctx->TextureMatrixStack[unit].Depth + 1;
- break;
- case GL_TEXTURE_MATRIX:
- unit = ctx->Texture.CurrentUnit;
- v->value_matrix = ctx->TextureMatrixStack[unit].Top;
- break;
-
- case GL_TEXTURE_COORD_ARRAY:
- case GL_TEXTURE_COORD_ARRAY_SIZE:
- case GL_TEXTURE_COORD_ARRAY_TYPE:
- case GL_TEXTURE_COORD_ARRAY_STRIDE:
- array = &ctx->Array.ArrayObj->TexCoord[ctx->Array.ActiveTexture];
- v->value_int = *(GLuint *) ((char *) array + d->offset);
- break;
-
- case GL_ACTIVE_TEXTURE_ARB:
- v->value_int = GL_TEXTURE0_ARB + ctx->Texture.CurrentUnit;
- break;
- case GL_CLIENT_ACTIVE_TEXTURE_ARB:
- v->value_int = GL_TEXTURE0_ARB + ctx->Array.ActiveTexture;
- break;
-
- case GL_MODELVIEW_STACK_DEPTH:
- case GL_PROJECTION_STACK_DEPTH:
- v->value_int = *(GLint *) ((char *) ctx + d->offset) + 1;
- break;
-
- case GL_MAX_TEXTURE_SIZE:
- case GL_MAX_3D_TEXTURE_SIZE:
- case GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB:
- p = (GLuint *) ((char *) ctx + d->offset);
- v->value_int = 1 << (*p - 1);
- break;
-
- case GL_SCISSOR_BOX:
- v->value_int_4[0] = ctx->Scissor.X;
- v->value_int_4[1] = ctx->Scissor.Y;
- v->value_int_4[2] = ctx->Scissor.Width;
- v->value_int_4[3] = ctx->Scissor.Height;
- break;
-
- case GL_LIST_INDEX:
- v->value_int =
- ctx->ListState.CurrentList ? ctx->ListState.CurrentList->Name : 0;
- break;
- case GL_LIST_MODE:
- if (!ctx->CompileFlag)
- v->value_enum = 0;
- else if (ctx->ExecuteFlag)
- v->value_enum = GL_COMPILE_AND_EXECUTE;
- else
- v->value_enum = GL_COMPILE;
- break;
-
- case GL_VIEWPORT:
- v->value_int_4[0] = ctx->Viewport.X;
- v->value_int_4[1] = ctx->Viewport.Y;
- v->value_int_4[2] = ctx->Viewport.Width;
- v->value_int_4[3] = ctx->Viewport.Height;
- break;
-
- case GL_ACTIVE_STENCIL_FACE_EXT:
- v->value_enum = ctx->Stencil.ActiveFace ? GL_BACK : GL_FRONT;
- break;
-
- case GL_STENCIL_FAIL:
- v->value_enum = ctx->Stencil.FailFunc[ctx->Stencil.ActiveFace];
- break;
- case GL_STENCIL_FUNC:
- v->value_enum = ctx->Stencil.Function[ctx->Stencil.ActiveFace];
- break;
- case GL_STENCIL_PASS_DEPTH_FAIL:
- v->value_enum = ctx->Stencil.ZFailFunc[ctx->Stencil.ActiveFace];
- break;
- case GL_STENCIL_PASS_DEPTH_PASS:
- v->value_enum = ctx->Stencil.ZPassFunc[ctx->Stencil.ActiveFace];
- break;
- case GL_STENCIL_REF:
- v->value_int = ctx->Stencil.Ref[ctx->Stencil.ActiveFace];
- break;
- case GL_STENCIL_VALUE_MASK:
- v->value_int = ctx->Stencil.ValueMask[ctx->Stencil.ActiveFace];
- break;
- case GL_STENCIL_WRITEMASK:
- v->value_int = ctx->Stencil.WriteMask[ctx->Stencil.ActiveFace];
- break;
-
- case GL_NUM_EXTENSIONS:
- v->value_int = _mesa_get_extension_count(ctx);
- break;
-
- case GL_IMPLEMENTATION_COLOR_READ_TYPE_OES:
- v->value_int = _mesa_get_color_read_type(ctx);
- break;
- case GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES:
- v->value_int = _mesa_get_color_read_format(ctx);
- break;
-
- case GL_CURRENT_MATRIX_STACK_DEPTH_ARB:
- v->value_int = ctx->CurrentStack->Depth + 1;
- break;
- case GL_CURRENT_MATRIX_ARB:
- case GL_TRANSPOSE_CURRENT_MATRIX_ARB:
- v->value_matrix = ctx->CurrentStack->Top;
- break;
-
- case GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB:
- v->value_int = _mesa_get_compressed_formats(ctx, NULL, GL_FALSE);
- break;
- case GL_COMPRESSED_TEXTURE_FORMATS_ARB:
- v->value_int_n.n =
- _mesa_get_compressed_formats(ctx, v->value_int_n.ints, GL_FALSE);
- ASSERT(v->value_int_n.n <= 100);
- break;
-
- case GL_MAX_VARYING_FLOATS_ARB:
- v->value_int = ctx->Const.MaxVarying * 4;
- break;
-
- /* Various object names */
-
- case GL_TEXTURE_BINDING_1D:
- case GL_TEXTURE_BINDING_2D:
- case GL_TEXTURE_BINDING_3D:
- case GL_TEXTURE_BINDING_1D_ARRAY_EXT:
- case GL_TEXTURE_BINDING_2D_ARRAY_EXT:
- case GL_TEXTURE_BINDING_CUBE_MAP_ARB:
- case GL_TEXTURE_BINDING_RECTANGLE_NV:
- unit = ctx->Texture.CurrentUnit;
- v->value_int =
- ctx->Texture.Unit[unit].CurrentTex[d->offset]->Name;
- break;
-
- /* GL_ARB_vertex_buffer_object */
- case GL_VERTEX_ARRAY_BUFFER_BINDING_ARB:
- case GL_NORMAL_ARRAY_BUFFER_BINDING_ARB:
- case GL_COLOR_ARRAY_BUFFER_BINDING_ARB:
- case GL_INDEX_ARRAY_BUFFER_BINDING_ARB:
- case GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB:
- case GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB:
- case GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB:
- buffer_obj = (struct gl_buffer_object **)
- ((char *) ctx->Array.ArrayObj + d->offset);
- v->value_int = (*buffer_obj)->Name;
- break;
- case GL_ARRAY_BUFFER_BINDING_ARB:
- v->value_int = ctx->Array.ArrayBufferObj->Name;
- break;
- case GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB:
- v->value_int =
- ctx->Array.ArrayObj->TexCoord[ctx->Array.ActiveTexture].BufferObj->Name;
- break;
- case GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB:
- v->value_int = ctx->Array.ElementArrayBufferObj->Name;
- break;
-
- /* ARB_copy_buffer */
- case GL_COPY_READ_BUFFER:
- v->value_int = ctx->CopyReadBuffer->Name;
- break;
- case GL_COPY_WRITE_BUFFER:
- v->value_int = ctx->CopyWriteBuffer->Name;
- break;
-
- case GL_FRAGMENT_PROGRAM_BINDING_NV:
- v->value_int =
- ctx->FragmentProgram.Current ? ctx->FragmentProgram.Current->Base.Id : 0;
- break;
- case GL_VERTEX_PROGRAM_BINDING_NV:
- v->value_int =
- ctx->VertexProgram.Current ? ctx->VertexProgram.Current->Base.Id : 0;
- break;
- case GL_PIXEL_PACK_BUFFER_BINDING_EXT:
- v->value_int = ctx->Pack.BufferObj->Name;
- break;
- case GL_PIXEL_UNPACK_BUFFER_BINDING_EXT:
- v->value_int = ctx->Unpack.BufferObj->Name;
- break;
- case GL_TRANSFORM_FEEDBACK_BUFFER_BINDING:
- v->value_int = ctx->TransformFeedback.CurrentBuffer->Name;
- break;
- case GL_TRANSFORM_FEEDBACK_BUFFER_PAUSED:
- v->value_int = ctx->TransformFeedback.CurrentObject->Paused;
- break;
- case GL_TRANSFORM_FEEDBACK_BUFFER_ACTIVE:
- v->value_int = ctx->TransformFeedback.CurrentObject->Active;
- break;
- case GL_TRANSFORM_FEEDBACK_BINDING:
- v->value_int = ctx->TransformFeedback.CurrentObject->Name;
- break;
- case GL_CURRENT_PROGRAM:
- v->value_int =
- ctx->Shader.ActiveProgram ? ctx->Shader.ActiveProgram->Name : 0;
- break;
- case GL_READ_FRAMEBUFFER_BINDING_EXT:
- v->value_int = ctx->ReadBuffer->Name;
- break;
- case GL_RENDERBUFFER_BINDING_EXT:
- v->value_int =
- ctx->CurrentRenderbuffer ? ctx->CurrentRenderbuffer->Name : 0;
- break;
- case GL_POINT_SIZE_ARRAY_BUFFER_BINDING_OES:
- v->value_int = ctx->Array.ArrayObj->PointSize.BufferObj->Name;
- break;
-
- case GL_FOG_COLOR:
- if(ctx->Color._ClampFragmentColor)
- COPY_4FV(v->value_float_4, ctx->Fog.Color);
- else
- COPY_4FV(v->value_float_4, ctx->Fog.ColorUnclamped);
- break;
- case GL_COLOR_CLEAR_VALUE:
- if(ctx->Color._ClampFragmentColor)
- COPY_4FV(v->value_float_4, ctx->Color.ClearColor);
- else
- COPY_4FV(v->value_float_4, ctx->Color.ClearColorUnclamped);
- break;
- case GL_BLEND_COLOR_EXT:
- if(ctx->Color._ClampFragmentColor)
- COPY_4FV(v->value_float_4, ctx->Color.BlendColor);
- else
- COPY_4FV(v->value_float_4, ctx->Color.BlendColorUnclamped);
- break;
- case GL_ALPHA_TEST_REF:
- if(ctx->Color._ClampFragmentColor)
- v->value_float = ctx->Color.AlphaRef;
- else
- v->value_float = ctx->Color.AlphaRefUnclamped;
- break;
- case GL_MAX_VERTEX_UNIFORM_VECTORS:
- v->value_int = ctx->Const.VertexProgram.MaxUniformComponents / 4;
- break;
-
- case GL_MAX_FRAGMENT_UNIFORM_VECTORS:
- v->value_int = ctx->Const.FragmentProgram.MaxUniformComponents / 4;
- break;
-
- /* GL_ARB_texture_buffer_object */
- case GL_TEXTURE_BUFFER_ARB:
- v->value_int = ctx->Texture.BufferObject->Name;
- break;
- case GL_TEXTURE_BINDING_BUFFER_ARB:
- unit = ctx->Texture.CurrentUnit;
- v->value_int =
- ctx->Texture.Unit[unit].CurrentTex[TEXTURE_BUFFER_INDEX]->Name;
- break;
- case GL_TEXTURE_BUFFER_DATA_STORE_BINDING_ARB:
- {
- struct gl_buffer_object *buf =
- ctx->Texture.Unit[ctx->Texture.CurrentUnit]
- .CurrentTex[TEXTURE_BUFFER_INDEX]->BufferObject;
- v->value_int = buf ? buf->Name : 0;
- }
- break;
- case GL_TEXTURE_BUFFER_FORMAT_ARB:
- v->value_int = ctx->Texture.Unit[ctx->Texture.CurrentUnit]
- .CurrentTex[TEXTURE_BUFFER_INDEX]->BufferObjectFormat;
- break;
-
- /* GL_ARB_sampler_objects */
- case GL_SAMPLER_BINDING:
- {
- struct gl_sampler_object *samp =
- ctx->Texture.Unit[ctx->Texture.CurrentUnit].Sampler;
- v->value_int = samp ? samp->Name : 0;
- }
- break;
- }
-}
-
-/**
- * Check extra constraints on a struct value_desc descriptor
- *
- * If a struct value_desc has a non-NULL extra pointer, it means that
- * there are a number of extra constraints to check or actions to
- * perform. The extras is just an integer array where each integer
- * encode different constraints or actions.
- *
- * \param ctx current context
- * \param func name of calling glGet*v() function for error reporting
- * \param d the struct value_desc that has the extra constraints
- *
- * \return GL_FALSE if one of the constraints was not satisfied,
- * otherwise GL_TRUE.
- */
-static GLboolean
-check_extra(struct gl_context *ctx, const char *func, const struct value_desc *d)
-{
- const GLuint version = ctx->VersionMajor * 10 + ctx->VersionMinor;
- int total, enabled;
- const int *e;
-
- total = 0;
- enabled = 0;
- for (e = d->extra; *e != EXTRA_END; e++)
- switch (*e) {
- case EXTRA_VERSION_30:
- if (version >= 30) {
- total++;
- enabled++;
- }
- break;
- case EXTRA_VERSION_31:
- if (version >= 31) {
- total++;
- enabled++;
- }
- break;
- case EXTRA_VERSION_32:
- if (version >= 32) {
- total++;
- enabled++;
- }
- break;
- case EXTRA_NEW_FRAG_CLAMP:
- if (ctx->NewState & (_NEW_BUFFERS | _NEW_FRAG_CLAMP))
- _mesa_update_state(ctx);
- break;
- case EXTRA_VERSION_ES2:
- if (ctx->API == API_OPENGLES2) {
- total++;
- enabled++;
- }
- break;
- case EXTRA_NEW_BUFFERS:
- if (ctx->NewState & _NEW_BUFFERS)
- _mesa_update_state(ctx);
- break;
- case EXTRA_FLUSH_CURRENT:
- FLUSH_CURRENT(ctx, 0);
- break;
- case EXTRA_VALID_DRAW_BUFFER:
- if (d->pname - GL_DRAW_BUFFER0_ARB >= ctx->Const.MaxDrawBuffers) {
- _mesa_error(ctx, GL_INVALID_OPERATION, "%s(draw buffer %u)",
- func, d->pname - GL_DRAW_BUFFER0_ARB);
- return GL_FALSE;
- }
- break;
- case EXTRA_VALID_TEXTURE_UNIT:
- if (ctx->Texture.CurrentUnit >= ctx->Const.MaxTextureCoordUnits) {
- _mesa_error(ctx, GL_INVALID_OPERATION, "%s(texture %u)",
- func, ctx->Texture.CurrentUnit);
- return GL_FALSE;
- }
- break;
- case EXTRA_END:
- break;
- default: /* *e is a offset into the extension struct */
- total++;
- if (*(GLboolean *) ((char *) &ctx->Extensions + *e))
- enabled++;
- break;
- }
-
- if (total > 0 && enabled == 0) {
- _mesa_error(ctx, GL_INVALID_ENUM, "%s(pname=%s)", func,
- _mesa_lookup_enum_by_nr(d->pname));
- return GL_FALSE;
- }
-
- return GL_TRUE;
-}
-
-static const struct value_desc error_value =
- { 0, 0, TYPE_INVALID, NO_OFFSET, NO_EXTRA };
-
-/**
- * Find the struct value_desc corresponding to the enum 'pname'.
- *
- * We hash the enum value to get an index into the 'table' array,
- * which holds the index in the 'values' array of struct value_desc.
- * Once we've found the entry, we do the extra checks, if any, then
- * look up the value and return a pointer to it.
- *
- * If the value has to be computed (for example, it's the result of a
- * function call or we need to add 1 to it), we use the tmp 'v' to
- * store the result.
- *
- * \param func name of glGet*v() func for error reporting
- * \param pname the enum value we're looking up
- * \param p is were we return the pointer to the value
- * \param v a tmp union value variable in the calling glGet*v() function
- *
- * \return the struct value_desc corresponding to the enum or a struct
- * value_desc of TYPE_INVALID if not found. This lets the calling
- * glGet*v() function jump right into a switch statement and
- * handle errors there instead of having to check for NULL.
- */
-static const struct value_desc *
-find_value(const char *func, GLenum pname, void **p, union value *v)
-{
- GET_CURRENT_CONTEXT(ctx);
- struct gl_texture_unit *unit;
- int mask, hash;
- const struct value_desc *d;
-
- mask = Elements(table) - 1;
- hash = (pname * prime_factor);
- while (1) {
- d = &values[table[hash & mask]];
-
- /* If the enum isn't valid, the hash walk ends with index 0,
- * which is the API mask entry at the beginning of values[]. */
- if (unlikely(d->type == TYPE_API_MASK)) {
- _mesa_error(ctx, GL_INVALID_ENUM, "%s(pname=%s)", func,
- _mesa_lookup_enum_by_nr(pname));
- return &error_value;
- }
-
- if (likely(d->pname == pname))
- break;
-
- hash += prime_step;
- }
-
- if (unlikely(d->extra && !check_extra(ctx, func, d)))
- return &error_value;
-
- switch (d->location) {
- case LOC_BUFFER:
- *p = ((char *) ctx->DrawBuffer + d->offset);
- return d;
- case LOC_CONTEXT:
- *p = ((char *) ctx + d->offset);
- return d;
- case LOC_ARRAY:
- *p = ((char *) ctx->Array.ArrayObj + d->offset);
- return d;
- case LOC_TEXUNIT:
- unit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit];
- *p = ((char *) unit + d->offset);
- return d;
- case LOC_CUSTOM:
- find_custom_value(ctx, d, v);
- *p = v;
- return d;
- default:
- assert(0);
- break;
- }
-
- /* silence warning */
- return &error_value;
-}
-
-static const int transpose[] = {
- 0, 4, 8, 12,
- 1, 5, 9, 13,
- 2, 6, 10, 14,
- 3, 7, 11, 15
-};
-
-void GLAPIENTRY
-_mesa_GetBooleanv(GLenum pname, GLboolean *params)
-{
- const struct value_desc *d;
- union value v;
- GLmatrix *m;
- int shift, i;
- void *p;
-
- d = find_value("glGetBooleanv", pname, &p, &v);
- switch (d->type) {
- case TYPE_INVALID:
- break;
- case TYPE_CONST:
- params[0] = INT_TO_BOOLEAN(d->offset);
- break;
-
- case TYPE_FLOAT_4:
- case TYPE_FLOATN_4:
- params[3] = FLOAT_TO_BOOLEAN(((GLfloat *) p)[3]);
- case TYPE_FLOAT_3:
- case TYPE_FLOATN_3:
- params[2] = FLOAT_TO_BOOLEAN(((GLfloat *) p)[2]);
- case TYPE_FLOAT_2:
- case TYPE_FLOATN_2:
- params[1] = FLOAT_TO_BOOLEAN(((GLfloat *) p)[1]);
- case TYPE_FLOAT:
- case TYPE_FLOATN:
- params[0] = FLOAT_TO_BOOLEAN(((GLfloat *) p)[0]);
- break;
-
- case TYPE_DOUBLEN:
- params[0] = FLOAT_TO_BOOLEAN(((GLdouble *) p)[0]);
- break;
-
- case TYPE_INT_4:
- params[3] = INT_TO_BOOLEAN(((GLint *) p)[3]);
- case TYPE_INT_3:
- params[2] = INT_TO_BOOLEAN(((GLint *) p)[2]);
- case TYPE_INT_2:
- case TYPE_ENUM_2:
- params[1] = INT_TO_BOOLEAN(((GLint *) p)[1]);
- case TYPE_INT:
- case TYPE_ENUM:
- params[0] = INT_TO_BOOLEAN(((GLint *) p)[0]);
- break;
-
- case TYPE_INT_N:
- for (i = 0; i < v.value_int_n.n; i++)
- params[i] = INT_TO_BOOLEAN(v.value_int_n.ints[i]);
- break;
-
- case TYPE_INT64:
- params[0] = INT64_TO_BOOLEAN(((GLint64 *) p)[0]);
- break;
-
- case TYPE_BOOLEAN:
- params[0] = ((GLboolean*) p)[0];
- break;
-
- case TYPE_MATRIX:
- m = *(GLmatrix **) p;
- for (i = 0; i < 16; i++)
- params[i] = FLOAT_TO_BOOLEAN(m->m[i]);
- break;
-
- case TYPE_MATRIX_T:
- m = *(GLmatrix **) p;
- for (i = 0; i < 16; i++)
- params[i] = FLOAT_TO_BOOLEAN(m->m[transpose[i]]);
- break;
-
- case TYPE_BIT_0:
- case TYPE_BIT_1:
- case TYPE_BIT_2:
- case TYPE_BIT_3:
- case TYPE_BIT_4:
- case TYPE_BIT_5:
- shift = d->type - TYPE_BIT_0;
- params[0] = (*(GLbitfield *) p >> shift) & 1;
- break;
- }
-}
-
-void GLAPIENTRY
-_mesa_GetFloatv(GLenum pname, GLfloat *params)
-{
- const struct value_desc *d;
- union value v;
- GLmatrix *m;
- int shift, i;
- void *p;
-
- d = find_value("glGetFloatv", pname, &p, &v);
- switch (d->type) {
- case TYPE_INVALID:
- break;
- case TYPE_CONST:
- params[0] = (GLfloat) d->offset;
- break;
-
- case TYPE_FLOAT_4:
- case TYPE_FLOATN_4:
- params[3] = ((GLfloat *) p)[3];
- case TYPE_FLOAT_3:
- case TYPE_FLOATN_3:
- params[2] = ((GLfloat *) p)[2];
- case TYPE_FLOAT_2:
- case TYPE_FLOATN_2:
- params[1] = ((GLfloat *) p)[1];
- case TYPE_FLOAT:
- case TYPE_FLOATN:
- params[0] = ((GLfloat *) p)[0];
- break;
-
- case TYPE_DOUBLEN:
- params[0] = ((GLdouble *) p)[0];
- break;
-
- case TYPE_INT_4:
- params[3] = (GLfloat) (((GLint *) p)[3]);
- case TYPE_INT_3:
- params[2] = (GLfloat) (((GLint *) p)[2]);
- case TYPE_INT_2:
- case TYPE_ENUM_2:
- params[1] = (GLfloat) (((GLint *) p)[1]);
- case TYPE_INT:
- case TYPE_ENUM:
- params[0] = (GLfloat) (((GLint *) p)[0]);
- break;
-
- case TYPE_INT_N:
- for (i = 0; i < v.value_int_n.n; i++)
- params[i] = INT_TO_FLOAT(v.value_int_n.ints[i]);
- break;
-
- case TYPE_INT64:
- params[0] = ((GLint64 *) p)[0];
- break;
-
- case TYPE_BOOLEAN:
- params[0] = BOOLEAN_TO_FLOAT(*(GLboolean*) p);
- break;
-
- case TYPE_MATRIX:
- m = *(GLmatrix **) p;
- for (i = 0; i < 16; i++)
- params[i] = m->m[i];
- break;
-
- case TYPE_MATRIX_T:
- m = *(GLmatrix **) p;
- for (i = 0; i < 16; i++)
- params[i] = m->m[transpose[i]];
- break;
-
- case TYPE_BIT_0:
- case TYPE_BIT_1:
- case TYPE_BIT_2:
- case TYPE_BIT_3:
- case TYPE_BIT_4:
- case TYPE_BIT_5:
- shift = d->type - TYPE_BIT_0;
- params[0] = BOOLEAN_TO_FLOAT((*(GLbitfield *) p >> shift) & 1);
- break;
- }
-}
-
-void GLAPIENTRY
-_mesa_GetIntegerv(GLenum pname, GLint *params)
-{
- const struct value_desc *d;
- union value v;
- GLmatrix *m;
- int shift, i;
- void *p;
-
- d = find_value("glGetIntegerv", pname, &p, &v);
- switch (d->type) {
- case TYPE_INVALID:
- break;
- case TYPE_CONST:
- params[0] = d->offset;
- break;
-
- case TYPE_FLOAT_4:
- params[3] = IROUND(((GLfloat *) p)[3]);
- case TYPE_FLOAT_3:
- params[2] = IROUND(((GLfloat *) p)[2]);
- case TYPE_FLOAT_2:
- params[1] = IROUND(((GLfloat *) p)[1]);
- case TYPE_FLOAT:
- params[0] = IROUND(((GLfloat *) p)[0]);
- break;
-
- case TYPE_FLOATN_4:
- params[3] = FLOAT_TO_INT(((GLfloat *) p)[3]);
- case TYPE_FLOATN_3:
- params[2] = FLOAT_TO_INT(((GLfloat *) p)[2]);
- case TYPE_FLOATN_2:
- params[1] = FLOAT_TO_INT(((GLfloat *) p)[1]);
- case TYPE_FLOATN:
- params[0] = FLOAT_TO_INT(((GLfloat *) p)[0]);
- break;
-
- case TYPE_DOUBLEN:
- params[0] = FLOAT_TO_INT(((GLdouble *) p)[0]);
- break;
-
- case TYPE_INT_4:
- params[3] = ((GLint *) p)[3];
- case TYPE_INT_3:
- params[2] = ((GLint *) p)[2];
- case TYPE_INT_2:
- case TYPE_ENUM_2:
- params[1] = ((GLint *) p)[1];
- case TYPE_INT:
- case TYPE_ENUM:
- params[0] = ((GLint *) p)[0];
- break;
-
- case TYPE_INT_N:
- for (i = 0; i < v.value_int_n.n; i++)
- params[i] = v.value_int_n.ints[i];
- break;
-
- case TYPE_INT64:
- params[0] = INT64_TO_INT(((GLint64 *) p)[0]);
- break;
-
- case TYPE_BOOLEAN:
- params[0] = BOOLEAN_TO_INT(*(GLboolean*) p);
- break;
-
- case TYPE_MATRIX:
- m = *(GLmatrix **) p;
- for (i = 0; i < 16; i++)
- params[i] = FLOAT_TO_INT(m->m[i]);
- break;
-
- case TYPE_MATRIX_T:
- m = *(GLmatrix **) p;
- for (i = 0; i < 16; i++)
- params[i] = FLOAT_TO_INT(m->m[transpose[i]]);
- break;
-
- case TYPE_BIT_0:
- case TYPE_BIT_1:
- case TYPE_BIT_2:
- case TYPE_BIT_3:
- case TYPE_BIT_4:
- case TYPE_BIT_5:
- shift = d->type - TYPE_BIT_0;
- params[0] = (*(GLbitfield *) p >> shift) & 1;
- break;
- }
-}
-
-#if FEATURE_ARB_sync
-void GLAPIENTRY
-_mesa_GetInteger64v(GLenum pname, GLint64 *params)
-{
- const struct value_desc *d;
- union value v;
- GLmatrix *m;
- int shift, i;
- void *p;
-
- d = find_value("glGetInteger64v", pname, &p, &v);
- switch (d->type) {
- case TYPE_INVALID:
- break;
- case TYPE_CONST:
- params[0] = d->offset;
- break;
-
- case TYPE_FLOAT_4:
- params[3] = IROUND64(((GLfloat *) p)[3]);
- case TYPE_FLOAT_3:
- params[2] = IROUND64(((GLfloat *) p)[2]);
- case TYPE_FLOAT_2:
- params[1] = IROUND64(((GLfloat *) p)[1]);
- case TYPE_FLOAT:
- params[0] = IROUND64(((GLfloat *) p)[0]);
- break;
-
- case TYPE_FLOATN_4:
- params[3] = FLOAT_TO_INT64(((GLfloat *) p)[3]);
- case TYPE_FLOATN_3:
- params[2] = FLOAT_TO_INT64(((GLfloat *) p)[2]);
- case TYPE_FLOATN_2:
- params[1] = FLOAT_TO_INT64(((GLfloat *) p)[1]);
- case TYPE_FLOATN:
- params[0] = FLOAT_TO_INT64(((GLfloat *) p)[0]);
- break;
-
- case TYPE_DOUBLEN:
- params[0] = FLOAT_TO_INT64(((GLdouble *) p)[0]);
- break;
-
- case TYPE_INT_4:
- params[3] = ((GLint *) p)[3];
- case TYPE_INT_3:
- params[2] = ((GLint *) p)[2];
- case TYPE_INT_2:
- case TYPE_ENUM_2:
- params[1] = ((GLint *) p)[1];
- case TYPE_INT:
- case TYPE_ENUM:
- params[0] = ((GLint *) p)[0];
- break;
-
- case TYPE_INT_N:
- for (i = 0; i < v.value_int_n.n; i++)
- params[i] = INT_TO_BOOLEAN(v.value_int_n.ints[i]);
- break;
-
- case TYPE_INT64:
- params[0] = ((GLint64 *) p)[0];
- break;
-
- case TYPE_BOOLEAN:
- params[0] = ((GLboolean*) p)[0];
- break;
-
- case TYPE_MATRIX:
- m = *(GLmatrix **) p;
- for (i = 0; i < 16; i++)
- params[i] = FLOAT_TO_INT64(m->m[i]);
- break;
-
- case TYPE_MATRIX_T:
- m = *(GLmatrix **) p;
- for (i = 0; i < 16; i++)
- params[i] = FLOAT_TO_INT64(m->m[transpose[i]]);
- break;
-
- case TYPE_BIT_0:
- case TYPE_BIT_1:
- case TYPE_BIT_2:
- case TYPE_BIT_3:
- case TYPE_BIT_4:
- case TYPE_BIT_5:
- shift = d->type - TYPE_BIT_0;
- params[0] = (*(GLbitfield *) p >> shift) & 1;
- break;
- }
-}
-#endif /* FEATURE_ARB_sync */
-
-void GLAPIENTRY
-_mesa_GetDoublev(GLenum pname, GLdouble *params)
-{
- const struct value_desc *d;
- union value v;
- GLmatrix *m;
- int shift, i;
- void *p;
-
- d = find_value("glGetDoublev", pname, &p, &v);
- switch (d->type) {
- case TYPE_INVALID:
- break;
- case TYPE_CONST:
- params[0] = d->offset;
- break;
-
- case TYPE_FLOAT_4:
- case TYPE_FLOATN_4:
- params[3] = ((GLfloat *) p)[3];
- case TYPE_FLOAT_3:
- case TYPE_FLOATN_3:
- params[2] = ((GLfloat *) p)[2];
- case TYPE_FLOAT_2:
- case TYPE_FLOATN_2:
- params[1] = ((GLfloat *) p)[1];
- case TYPE_FLOAT:
- case TYPE_FLOATN:
- params[0] = ((GLfloat *) p)[0];
- break;
-
- case TYPE_DOUBLEN:
- params[0] = ((GLdouble *) p)[0];
- break;
-
- case TYPE_INT_4:
- params[3] = ((GLint *) p)[3];
- case TYPE_INT_3:
- params[2] = ((GLint *) p)[2];
- case TYPE_INT_2:
- case TYPE_ENUM_2:
- params[1] = ((GLint *) p)[1];
- case TYPE_INT:
- case TYPE_ENUM:
- params[0] = ((GLint *) p)[0];
- break;
-
- case TYPE_INT_N:
- for (i = 0; i < v.value_int_n.n; i++)
- params[i] = v.value_int_n.ints[i];
- break;
-
- case TYPE_INT64:
- params[0] = ((GLint64 *) p)[0];
- break;
-
- case TYPE_BOOLEAN:
- params[0] = *(GLboolean*) p;
- break;
-
- case TYPE_MATRIX:
- m = *(GLmatrix **) p;
- for (i = 0; i < 16; i++)
- params[i] = m->m[i];
- break;
-
- case TYPE_MATRIX_T:
- m = *(GLmatrix **) p;
- for (i = 0; i < 16; i++)
- params[i] = m->m[transpose[i]];
- break;
-
- case TYPE_BIT_0:
- case TYPE_BIT_1:
- case TYPE_BIT_2:
- case TYPE_BIT_3:
- case TYPE_BIT_4:
- case TYPE_BIT_5:
- shift = d->type - TYPE_BIT_0;
- params[0] = (*(GLbitfield *) p >> shift) & 1;
- break;
- }
-}
-
-static enum value_type
-find_value_indexed(const char *func, GLenum pname, int index, union value *v)
-{
- GET_CURRENT_CONTEXT(ctx);
-
- switch (pname) {
-
- case GL_BLEND:
- if (index >= ctx->Const.MaxDrawBuffers)
- goto invalid_value;
- if (!ctx->Extensions.EXT_draw_buffers2)
- goto invalid_enum;
- v->value_int = (ctx->Color.BlendEnabled >> index) & 1;
- return TYPE_INT;
-
- case GL_BLEND_SRC:
- /* fall-through */
- case GL_BLEND_SRC_RGB:
- if (index >= ctx->Const.MaxDrawBuffers)
- goto invalid_value;
- if (!ctx->Extensions.ARB_draw_buffers_blend)
- goto invalid_enum;
- v->value_int = ctx->Color.Blend[index].SrcRGB;
- return TYPE_INT;
- case GL_BLEND_SRC_ALPHA:
- if (index >= ctx->Const.MaxDrawBuffers)
- goto invalid_value;
- if (!ctx->Extensions.ARB_draw_buffers_blend)
- goto invalid_enum;
- v->value_int = ctx->Color.Blend[index].SrcA;
- return TYPE_INT;
- case GL_BLEND_DST:
- /* fall-through */
- case GL_BLEND_DST_RGB:
- if (index >= ctx->Const.MaxDrawBuffers)
- goto invalid_value;
- if (!ctx->Extensions.ARB_draw_buffers_blend)
- goto invalid_enum;
- v->value_int = ctx->Color.Blend[index].DstRGB;
- return TYPE_INT;
- case GL_BLEND_DST_ALPHA:
- if (index >= ctx->Const.MaxDrawBuffers)
- goto invalid_value;
- if (!ctx->Extensions.ARB_draw_buffers_blend)
- goto invalid_enum;
- v->value_int = ctx->Color.Blend[index].DstA;
- return TYPE_INT;
- case GL_BLEND_EQUATION_RGB:
- if (index >= ctx->Const.MaxDrawBuffers)
- goto invalid_value;
- if (!ctx->Extensions.ARB_draw_buffers_blend)
- goto invalid_enum;
- v->value_int = ctx->Color.Blend[index].EquationRGB;
- return TYPE_INT;
- case GL_BLEND_EQUATION_ALPHA:
- if (index >= ctx->Const.MaxDrawBuffers)
- goto invalid_value;
- if (!ctx->Extensions.ARB_draw_buffers_blend)
- goto invalid_enum;
- v->value_int = ctx->Color.Blend[index].EquationA;
- return TYPE_INT;
-
- case GL_COLOR_WRITEMASK:
- if (index >= ctx->Const.MaxDrawBuffers)
- goto invalid_value;
- if (!ctx->Extensions.EXT_draw_buffers2)
- goto invalid_enum;
- v->value_int_4[0] = ctx->Color.ColorMask[index][RCOMP] ? 1 : 0;
- v->value_int_4[1] = ctx->Color.ColorMask[index][GCOMP] ? 1 : 0;
- v->value_int_4[2] = ctx->Color.ColorMask[index][BCOMP] ? 1 : 0;
- v->value_int_4[3] = ctx->Color.ColorMask[index][ACOMP] ? 1 : 0;
- return TYPE_INT_4;
-
- case GL_TRANSFORM_FEEDBACK_BUFFER_START:
- if (index >= ctx->Const.MaxTransformFeedbackSeparateAttribs)
- goto invalid_value;
- if (!ctx->Extensions.EXT_transform_feedback)
- goto invalid_enum;
- v->value_int64 = ctx->TransformFeedback.CurrentObject->Offset[index];
- return TYPE_INT64;
-
- case GL_TRANSFORM_FEEDBACK_BUFFER_SIZE:
- if (index >= ctx->Const.MaxTransformFeedbackSeparateAttribs)
- goto invalid_value;
- if (!ctx->Extensions.EXT_transform_feedback)
- goto invalid_enum;
- v->value_int64 = ctx->TransformFeedback.CurrentObject->Size[index];
- return TYPE_INT64;
-
- case GL_TRANSFORM_FEEDBACK_BUFFER_BINDING:
- if (index >= ctx->Const.MaxTransformFeedbackSeparateAttribs)
- goto invalid_value;
- if (!ctx->Extensions.EXT_transform_feedback)
- goto invalid_enum;
- v->value_int = ctx->TransformFeedback.CurrentObject->Buffers[index]->Name;
- return TYPE_INT;
- }
-
- invalid_enum:
- _mesa_error(ctx, GL_INVALID_ENUM, "%s(pname=%s)", func,
- _mesa_lookup_enum_by_nr(pname));
- return TYPE_INVALID;
- invalid_value:
- _mesa_error(ctx, GL_INVALID_VALUE, "%s(pname=%s)", func,
- _mesa_lookup_enum_by_nr(pname));
- return TYPE_INVALID;
-}
-
-void GLAPIENTRY
-_mesa_GetBooleanIndexedv( GLenum pname, GLuint index, GLboolean *params )
-{
- union value v;
- enum value_type type =
- find_value_indexed("glGetBooleanIndexedv", pname, index, &v);
-
- switch (type) {
- case TYPE_INT:
- params[0] = INT_TO_BOOLEAN(v.value_int);
- break;
- case TYPE_INT_4:
- params[0] = INT_TO_BOOLEAN(v.value_int_4[0]);
- params[1] = INT_TO_BOOLEAN(v.value_int_4[1]);
- params[2] = INT_TO_BOOLEAN(v.value_int_4[2]);
- params[3] = INT_TO_BOOLEAN(v.value_int_4[3]);
- break;
- case TYPE_INT64:
- params[0] = INT64_TO_BOOLEAN(v.value_int);
- break;
- default:
- ; /* nothing - GL error was recorded */
- }
-}
-
-void GLAPIENTRY
-_mesa_GetIntegerIndexedv( GLenum pname, GLuint index, GLint *params )
-{
- union value v;
- enum value_type type =
- find_value_indexed("glGetIntegerIndexedv", pname, index, &v);
-
- switch (type) {
- case TYPE_INT:
- params[0] = v.value_int;
- break;
- case TYPE_INT_4:
- params[0] = v.value_int_4[0];
- params[1] = v.value_int_4[1];
- params[2] = v.value_int_4[2];
- params[3] = v.value_int_4[3];
- break;
- case TYPE_INT64:
- params[0] = INT64_TO_INT(v.value_int);
- break;
- default:
- ; /* nothing - GL error was recorded */
- }
-}
-
-#if FEATURE_ARB_sync
-void GLAPIENTRY
-_mesa_GetInteger64Indexedv( GLenum pname, GLuint index, GLint64 *params )
-{
- union value v;
- enum value_type type =
- find_value_indexed("glGetIntegerIndexedv", pname, index, &v);
-
- switch (type) {
- case TYPE_INT:
- params[0] = v.value_int;
- break;
- case TYPE_INT_4:
- params[0] = v.value_int_4[0];
- params[1] = v.value_int_4[1];
- params[2] = v.value_int_4[2];
- params[3] = v.value_int_4[3];
- break;
- case TYPE_INT64:
- params[0] = v.value_int;
- break;
- default:
- ; /* nothing - GL error was recorded */
- }
-}
-#endif /* FEATURE_ARB_sync */
-
-#if FEATURE_ES1
-void GLAPIENTRY
-_mesa_GetFixedv(GLenum pname, GLfixed *params)
-{
- const struct value_desc *d;
- union value v;
- GLmatrix *m;
- int shift, i;
- void *p;
-
- d = find_value("glGetDoublev", pname, &p, &v);
- switch (d->type) {
- case TYPE_INVALID:
- break;
- case TYPE_CONST:
- params[0] = INT_TO_FIXED(d->offset);
- break;
-
- case TYPE_FLOAT_4:
- case TYPE_FLOATN_4:
- params[3] = FLOAT_TO_FIXED(((GLfloat *) p)[3]);
- case TYPE_FLOAT_3:
- case TYPE_FLOATN_3:
- params[2] = FLOAT_TO_FIXED(((GLfloat *) p)[2]);
- case TYPE_FLOAT_2:
- case TYPE_FLOATN_2:
- params[1] = FLOAT_TO_FIXED(((GLfloat *) p)[1]);
- case TYPE_FLOAT:
- case TYPE_FLOATN:
- params[0] = FLOAT_TO_FIXED(((GLfloat *) p)[0]);
- break;
-
- case TYPE_DOUBLEN:
- params[0] = FLOAT_TO_FIXED(((GLdouble *) p)[0]);
- break;
-
- case TYPE_INT_4:
- params[3] = INT_TO_FIXED(((GLint *) p)[3]);
- case TYPE_INT_3:
- params[2] = INT_TO_FIXED(((GLint *) p)[2]);
- case TYPE_INT_2:
- case TYPE_ENUM_2:
- params[1] = INT_TO_FIXED(((GLint *) p)[1]);
- case TYPE_INT:
- case TYPE_ENUM:
- params[0] = INT_TO_FIXED(((GLint *) p)[0]);
- break;
-
- case TYPE_INT_N:
- for (i = 0; i < v.value_int_n.n; i++)
- params[i] = INT_TO_FIXED(v.value_int_n.ints[i]);
- break;
-
- case TYPE_INT64:
- params[0] = ((GLint64 *) p)[0];
- break;
-
- case TYPE_BOOLEAN:
- params[0] = BOOLEAN_TO_FIXED(((GLboolean*) p)[0]);
- break;
-
- case TYPE_MATRIX:
- m = *(GLmatrix **) p;
- for (i = 0; i < 16; i++)
- params[i] = FLOAT_TO_FIXED(m->m[i]);
- break;
-
- case TYPE_MATRIX_T:
- m = *(GLmatrix **) p;
- for (i = 0; i < 16; i++)
- params[i] = FLOAT_TO_FIXED(m->m[transpose[i]]);
- break;
-
- case TYPE_BIT_0:
- case TYPE_BIT_1:
- case TYPE_BIT_2:
- case TYPE_BIT_3:
- case TYPE_BIT_4:
- case TYPE_BIT_5:
- shift = d->type - TYPE_BIT_0;
- params[0] = BOOLEAN_TO_FIXED((*(GLbitfield *) p >> shift) & 1);
- break;
- }
-}
-#endif
+/*
+ * Copyright (C) 2010 Brian Paul All Rights Reserved.
+ * Copyright (C) 2010 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * Author: Kristian Høgsberg <krh@bitplanet.net>
+ */
+
+#include "glheader.h"
+#include "context.h"
+#include "enable.h"
+#include "enums.h"
+#include "extensions.h"
+#include "get.h"
+#include "macros.h"
+#include "mfeatures.h"
+#include "mtypes.h"
+#include "state.h"
+#include "texcompress.h"
+#include "framebuffer.h"
+
+/* This is a table driven implemetation of the glGet*v() functions.
+ * The basic idea is that most getters just look up an int somewhere
+ * in struct gl_context and then convert it to a bool or float according to
+ * which of glGetIntegerv() glGetBooleanv() etc is being called.
+ * Instead of generating code to do this, we can just record the enum
+ * value and the offset into struct gl_context in an array of structs. Then
+ * in glGet*(), we lookup the struct for the enum in question, and use
+ * the offset to get the int we need.
+ *
+ * Sometimes we need to look up a float, a boolean, a bit in a
+ * bitfield, a matrix or other types instead, so we need to track the
+ * type of the value in struct gl_context. And sometimes the value isn't in
+ * struct gl_context but in the drawbuffer, the array object, current texture
+ * unit, or maybe it's a computed value. So we need to also track
+ * where or how to find the value. Finally, we sometimes need to
+ * check that one of a number of extensions are enabled, the GL
+ * version or flush or call _mesa_update_state(). This is done by
+ * attaching optional extra information to the value description
+ * struct, it's sort of like an array of opcodes that describe extra
+ * checks or actions.
+ *
+ * Putting all this together we end up with struct value_desc below,
+ * and with a couple of macros to help, the table of struct value_desc
+ * is about as concise as the specification in the old python script.
+ */
+
+#undef CONST
+
+#define FLOAT_TO_BOOLEAN(X) ( (X) ? GL_TRUE : GL_FALSE )
+#define FLOAT_TO_FIXED(F) ( ((F) * 65536.0f > INT_MAX) ? INT_MAX : \
+ ((F) * 65536.0f < INT_MIN) ? INT_MIN : \
+ (GLint) ((F) * 65536.0f) )
+
+#define INT_TO_BOOLEAN(I) ( (I) ? GL_TRUE : GL_FALSE )
+#define INT_TO_FIXED(I) ( ((I) > SHRT_MAX) ? INT_MAX : \
+ ((I) < SHRT_MIN) ? INT_MIN : \
+ (GLint) ((I) * 65536) )
+
+#define INT64_TO_BOOLEAN(I) ( (I) ? GL_TRUE : GL_FALSE )
+#define INT64_TO_INT(I) ( (GLint)((I > INT_MAX) ? INT_MAX : ((I < INT_MIN) ? INT_MIN : (I))) )
+
+#define BOOLEAN_TO_INT(B) ( (GLint) (B) )
+#define BOOLEAN_TO_INT64(B) ( (GLint64) (B) )
+#define BOOLEAN_TO_FLOAT(B) ( (B) ? 1.0F : 0.0F )
+#define BOOLEAN_TO_FIXED(B) ( (GLint) ((B) ? 1 : 0) << 16 )
+
+#define ENUM_TO_INT64(E) ( (GLint64) (E) )
+#define ENUM_TO_FIXED(E) (E)
+
+enum value_type {
+ TYPE_INVALID,
+ TYPE_API_MASK,
+ TYPE_INT,
+ TYPE_INT_2,
+ TYPE_INT_3,
+ TYPE_INT_4,
+ TYPE_INT_N,
+ TYPE_INT64,
+ TYPE_ENUM,
+ TYPE_ENUM_2,
+ TYPE_BOOLEAN,
+ TYPE_BIT_0,
+ TYPE_BIT_1,
+ TYPE_BIT_2,
+ TYPE_BIT_3,
+ TYPE_BIT_4,
+ TYPE_BIT_5,
+ TYPE_FLOAT,
+ TYPE_FLOAT_2,
+ TYPE_FLOAT_3,
+ TYPE_FLOAT_4,
+ TYPE_FLOATN,
+ TYPE_FLOATN_2,
+ TYPE_FLOATN_3,
+ TYPE_FLOATN_4,
+ TYPE_DOUBLEN,
+ TYPE_MATRIX,
+ TYPE_MATRIX_T,
+ TYPE_CONST
+};
+
+enum value_location {
+ LOC_BUFFER,
+ LOC_CONTEXT,
+ LOC_ARRAY,
+ LOC_TEXUNIT,
+ LOC_CUSTOM
+};
+
+enum value_extra {
+ EXTRA_END = 0x8000,
+ EXTRA_VERSION_30,
+ EXTRA_VERSION_31,
+ EXTRA_VERSION_32,
+ EXTRA_VERSION_ES2,
+ EXTRA_NEW_BUFFERS,
+ EXTRA_NEW_FRAG_CLAMP,
+ EXTRA_VALID_DRAW_BUFFER,
+ EXTRA_VALID_TEXTURE_UNIT,
+ EXTRA_FLUSH_CURRENT,
+};
+
+#define NO_EXTRA NULL
+#define NO_OFFSET 0
+
+struct value_desc {
+ GLenum pname;
+ GLubyte location; /**< enum value_location */
+ GLubyte type; /**< enum value_type */
+ int offset;
+ const int *extra;
+};
+
+union value {
+ GLfloat value_float;
+ GLfloat value_float_4[4];
+ GLmatrix *value_matrix;
+ GLint value_int;
+ GLint value_int_4[4];
+ GLint64 value_int64;
+ GLenum value_enum;
+
+ /* Sigh, see GL_COMPRESSED_TEXTURE_FORMATS_ARB handling */
+ struct {
+ GLint n, ints[100];
+ } value_int_n;
+ GLboolean value_bool;
+};
+
+#define BUFFER_FIELD(field, type) \
+ LOC_BUFFER, type, offsetof(struct gl_framebuffer, field)
+#define CONTEXT_FIELD(field, type) \
+ LOC_CONTEXT, type, offsetof(struct gl_context, field)
+#define ARRAY_FIELD(field, type) \
+ LOC_ARRAY, type, offsetof(struct gl_array_object, field)
+#define CONST(value) \
+ LOC_CONTEXT, TYPE_CONST, value
+
+#define BUFFER_INT(field) BUFFER_FIELD(field, TYPE_INT)
+#define BUFFER_ENUM(field) BUFFER_FIELD(field, TYPE_ENUM)
+#define BUFFER_BOOL(field) BUFFER_FIELD(field, TYPE_BOOLEAN)
+
+#define CONTEXT_INT(field) CONTEXT_FIELD(field, TYPE_INT)
+#define CONTEXT_INT2(field) CONTEXT_FIELD(field, TYPE_INT_2)
+#define CONTEXT_INT64(field) CONTEXT_FIELD(field, TYPE_INT64)
+#define CONTEXT_ENUM(field) CONTEXT_FIELD(field, TYPE_ENUM)
+#define CONTEXT_ENUM2(field) CONTEXT_FIELD(field, TYPE_ENUM_2)
+#define CONTEXT_BOOL(field) CONTEXT_FIELD(field, TYPE_BOOLEAN)
+#define CONTEXT_BIT0(field) CONTEXT_FIELD(field, TYPE_BIT_0)
+#define CONTEXT_BIT1(field) CONTEXT_FIELD(field, TYPE_BIT_1)
+#define CONTEXT_BIT2(field) CONTEXT_FIELD(field, TYPE_BIT_2)
+#define CONTEXT_BIT3(field) CONTEXT_FIELD(field, TYPE_BIT_3)
+#define CONTEXT_BIT4(field) CONTEXT_FIELD(field, TYPE_BIT_4)
+#define CONTEXT_BIT5(field) CONTEXT_FIELD(field, TYPE_BIT_5)
+#define CONTEXT_FLOAT(field) CONTEXT_FIELD(field, TYPE_FLOAT)
+#define CONTEXT_FLOAT2(field) CONTEXT_FIELD(field, TYPE_FLOAT_2)
+#define CONTEXT_FLOAT3(field) CONTEXT_FIELD(field, TYPE_FLOAT_3)
+#define CONTEXT_FLOAT4(field) CONTEXT_FIELD(field, TYPE_FLOAT_4)
+#define CONTEXT_MATRIX(field) CONTEXT_FIELD(field, TYPE_MATRIX)
+#define CONTEXT_MATRIX_T(field) CONTEXT_FIELD(field, TYPE_MATRIX_T)
+
+#define ARRAY_INT(field) ARRAY_FIELD(field, TYPE_INT)
+#define ARRAY_ENUM(field) ARRAY_FIELD(field, TYPE_ENUM)
+#define ARRAY_BOOL(field) ARRAY_FIELD(field, TYPE_BOOLEAN)
+
+#define EXT(f) \
+ offsetof(struct gl_extensions, f)
+
+#define EXTRA_EXT(e) \
+ static const int extra_##e[] = { \
+ EXT(e), EXTRA_END \
+ }
+
+#define EXTRA_EXT2(e1, e2) \
+ static const int extra_##e1##_##e2[] = { \
+ EXT(e1), EXT(e2), EXTRA_END \
+ }
+
+/* The 'extra' mechanism is a way to specify extra checks (such as
+ * extensions or specific gl versions) or actions (flush current, new
+ * buffers) that we need to do before looking up an enum. We need to
+ * declare them all up front so we can refer to them in the value_desc
+ * structs below. */
+
+static const int extra_new_buffers[] = {
+ EXTRA_NEW_BUFFERS,
+ EXTRA_END
+};
+
+static const int extra_new_frag_clamp[] = {
+ EXTRA_NEW_FRAG_CLAMP,
+ EXTRA_END
+};
+
+static const int extra_valid_draw_buffer[] = {
+ EXTRA_VALID_DRAW_BUFFER,
+ EXTRA_END
+};
+
+static const int extra_valid_texture_unit[] = {
+ EXTRA_VALID_TEXTURE_UNIT,
+ EXTRA_END
+};
+
+static const int extra_flush_current_valid_texture_unit[] = {
+ EXTRA_FLUSH_CURRENT,
+ EXTRA_VALID_TEXTURE_UNIT,
+ EXTRA_END
+};
+
+static const int extra_flush_current[] = {
+ EXTRA_FLUSH_CURRENT,
+ EXTRA_END
+};
+
+static const int extra_new_buffers_OES_read_format[] = {
+ EXTRA_NEW_BUFFERS,
+ EXT(OES_read_format),
+ EXTRA_END
+};
+
+static const int extra_EXT_secondary_color_flush_current[] = {
+ EXT(EXT_secondary_color),
+ EXTRA_FLUSH_CURRENT,
+ EXTRA_END
+};
+
+static const int extra_EXT_fog_coord_flush_current[] = {
+ EXT(EXT_fog_coord),
+ EXTRA_FLUSH_CURRENT,
+ EXTRA_END
+};
+
+static const int extra_EXT_texture_integer[] = {
+ EXT(EXT_texture_integer),
+ EXTRA_END
+};
+
+static const int extra_EXT_gpu_shader4[] = {
+ EXT(EXT_gpu_shader4),
+ EXTRA_END
+};
+
+static const int extra_ARB_sampler_objects[] = {
+ EXT(ARB_sampler_objects),
+ EXTRA_END
+};
+
+
+EXTRA_EXT(ARB_ES2_compatibility);
+EXTRA_EXT(ARB_multitexture);
+EXTRA_EXT(ARB_texture_cube_map);
+EXTRA_EXT(MESA_texture_array);
+EXTRA_EXT2(EXT_secondary_color, ARB_vertex_program);
+EXTRA_EXT(EXT_secondary_color);
+EXTRA_EXT(EXT_fog_coord);
+EXTRA_EXT(EXT_texture_lod_bias);
+EXTRA_EXT(EXT_texture_filter_anisotropic);
+EXTRA_EXT(IBM_rasterpos_clip);
+EXTRA_EXT(NV_point_sprite);
+EXTRA_EXT(SGIS_generate_mipmap);
+EXTRA_EXT(NV_vertex_program);
+EXTRA_EXT(NV_fragment_program);
+EXTRA_EXT(NV_texture_rectangle);
+EXTRA_EXT(EXT_stencil_two_side);
+EXTRA_EXT(NV_light_max_exponent);
+EXTRA_EXT(EXT_depth_bounds_test);
+EXTRA_EXT(ARB_depth_clamp);
+EXTRA_EXT(ATI_fragment_shader);
+EXTRA_EXT(EXT_framebuffer_blit);
+EXTRA_EXT(ARB_shader_objects);
+EXTRA_EXT(EXT_provoking_vertex);
+EXTRA_EXT(ARB_fragment_shader);
+EXTRA_EXT(ARB_fragment_program);
+EXTRA_EXT2(ARB_framebuffer_object, EXT_framebuffer_multisample);
+EXTRA_EXT(EXT_framebuffer_object);
+EXTRA_EXT(APPLE_vertex_array_object);
+EXTRA_EXT(ARB_seamless_cube_map);
+EXTRA_EXT(EXT_compiled_vertex_array);
+EXTRA_EXT(ARB_sync);
+EXTRA_EXT(ARB_vertex_shader);
+EXTRA_EXT(EXT_transform_feedback);
+EXTRA_EXT(ARB_transform_feedback2);
+EXTRA_EXT(EXT_pixel_buffer_object);
+EXTRA_EXT(ARB_vertex_program);
+EXTRA_EXT2(NV_point_sprite, ARB_point_sprite);
+EXTRA_EXT2(ARB_fragment_program, NV_fragment_program);
+EXTRA_EXT2(ARB_vertex_program, NV_vertex_program);
+EXTRA_EXT2(ARB_vertex_program, ARB_fragment_program);
+EXTRA_EXT(ARB_vertex_buffer_object);
+EXTRA_EXT(ARB_geometry_shader4);
+EXTRA_EXT(ARB_copy_buffer);
+EXTRA_EXT(EXT_framebuffer_sRGB);
+EXTRA_EXT(ARB_texture_buffer_object);
+
+static const int
+extra_ARB_vertex_program_ARB_fragment_program_NV_vertex_program[] = {
+ EXT(ARB_vertex_program),
+ EXT(ARB_fragment_program),
+ EXT(NV_vertex_program),
+ EXTRA_END
+};
+
+static const int
+extra_NV_vertex_program_ARB_vertex_program_ARB_fragment_program_NV_vertex_program[] = {
+ EXT(NV_vertex_program),
+ EXT(ARB_vertex_program),
+ EXT(ARB_fragment_program),
+ EXT(NV_vertex_program),
+ EXTRA_END
+};
+
+static const int
+extra_NV_primitive_restart[] = {
+ EXT(NV_primitive_restart),
+ EXTRA_END
+};
+
+static const int extra_version_30[] = { EXTRA_VERSION_30, EXTRA_END };
+static const int extra_version_31[] = { EXTRA_VERSION_31, EXTRA_END };
+static const int extra_version_32[] = { EXTRA_VERSION_32, EXTRA_END };
+
+static const int
+extra_ARB_vertex_program_version_es2[] = {
+ EXT(ARB_vertex_program),
+ EXTRA_VERSION_ES2,
+ EXTRA_END
+};
+
+#define API_OPENGL_BIT (1 << API_OPENGL)
+#define API_OPENGLES_BIT (1 << API_OPENGLES)
+#define API_OPENGLES2_BIT (1 << API_OPENGLES2)
+
+/* This is the big table describing all the enums we accept in
+ * glGet*v(). The table is partitioned into six parts: enums
+ * understood by all GL APIs (OpenGL, GLES and GLES2), enums shared
+ * between OpenGL and GLES, enums exclusive to GLES, etc for the
+ * remaining combinations. When we add the enums to the hash table in
+ * _mesa_init_get_hash(), we only add the enums for the API we're
+ * instantiating and the different sections are guarded by #if
+ * FEATURE_GL etc to make sure we only compile in the enums we may
+ * need. */
+
+static const struct value_desc values[] = {
+ /* Enums shared between OpenGL, GLES1 and GLES2 */
+ { 0, 0, TYPE_API_MASK,
+ API_OPENGL_BIT | API_OPENGLES_BIT | API_OPENGLES2_BIT, NO_EXTRA},
+ { GL_ALPHA_BITS, BUFFER_INT(Visual.alphaBits), extra_new_buffers },
+ { GL_BLEND, CONTEXT_BIT0(Color.BlendEnabled), NO_EXTRA },
+ { GL_BLEND_SRC, CONTEXT_ENUM(Color.Blend[0].SrcRGB), NO_EXTRA },
+ { GL_BLUE_BITS, BUFFER_INT(Visual.blueBits), extra_new_buffers },
+ { GL_COLOR_CLEAR_VALUE, LOC_CUSTOM, TYPE_FLOATN_4, 0, extra_new_frag_clamp },
+ { GL_COLOR_WRITEMASK, LOC_CUSTOM, TYPE_INT_4, 0, NO_EXTRA },
+ { GL_CULL_FACE, CONTEXT_BOOL(Polygon.CullFlag), NO_EXTRA },
+ { GL_CULL_FACE_MODE, CONTEXT_ENUM(Polygon.CullFaceMode), NO_EXTRA },
+ { GL_DEPTH_BITS, BUFFER_INT(Visual.depthBits), NO_EXTRA },
+ { GL_DEPTH_CLEAR_VALUE, CONTEXT_FIELD(Depth.Clear, TYPE_DOUBLEN), NO_EXTRA },
+ { GL_DEPTH_FUNC, CONTEXT_ENUM(Depth.Func), NO_EXTRA },
+ { GL_DEPTH_RANGE, CONTEXT_FIELD(Viewport.Near, TYPE_FLOATN_2), NO_EXTRA },
+ { GL_DEPTH_TEST, CONTEXT_BOOL(Depth.Test), NO_EXTRA },
+ { GL_DEPTH_WRITEMASK, CONTEXT_BOOL(Depth.Mask), NO_EXTRA },
+ { GL_DITHER, CONTEXT_BOOL(Color.DitherFlag), NO_EXTRA },
+ { GL_FRONT_FACE, CONTEXT_ENUM(Polygon.FrontFace), NO_EXTRA },
+ { GL_GREEN_BITS, BUFFER_INT(Visual.greenBits), extra_new_buffers },
+ { GL_LINE_WIDTH, CONTEXT_FLOAT(Line.Width), NO_EXTRA },
+ { GL_ALIASED_LINE_WIDTH_RANGE, CONTEXT_FLOAT2(Const.MinLineWidth), NO_EXTRA },
+ { GL_MAX_ELEMENTS_VERTICES, CONTEXT_INT(Const.MaxArrayLockSize), NO_EXTRA },
+ { GL_MAX_ELEMENTS_INDICES, CONTEXT_INT(Const.MaxArrayLockSize), NO_EXTRA },
+ { GL_MAX_TEXTURE_SIZE, LOC_CUSTOM, TYPE_INT,
+ offsetof(struct gl_context, Const.MaxTextureLevels), NO_EXTRA },
+ { GL_MAX_VIEWPORT_DIMS, CONTEXT_INT2(Const.MaxViewportWidth), NO_EXTRA },
+ { GL_PACK_ALIGNMENT, CONTEXT_INT(Pack.Alignment), NO_EXTRA },
+ { GL_ALIASED_POINT_SIZE_RANGE, CONTEXT_FLOAT2(Const.MinPointSize), NO_EXTRA },
+ { GL_POLYGON_OFFSET_FACTOR, CONTEXT_FLOAT(Polygon.OffsetFactor ), NO_EXTRA },
+ { GL_POLYGON_OFFSET_UNITS, CONTEXT_FLOAT(Polygon.OffsetUnits ), NO_EXTRA },
+ { GL_POLYGON_OFFSET_FILL, CONTEXT_BOOL(Polygon.OffsetFill), NO_EXTRA },
+ { GL_RED_BITS, BUFFER_INT(Visual.redBits), extra_new_buffers },
+ { GL_SCISSOR_BOX, LOC_CUSTOM, TYPE_INT_4, 0, NO_EXTRA },
+ { GL_SCISSOR_TEST, CONTEXT_BOOL(Scissor.Enabled), NO_EXTRA },
+ { GL_STENCIL_BITS, BUFFER_INT(Visual.stencilBits), NO_EXTRA },
+ { GL_STENCIL_CLEAR_VALUE, CONTEXT_INT(Stencil.Clear), NO_EXTRA },
+ { GL_STENCIL_FAIL, LOC_CUSTOM, TYPE_ENUM, NO_OFFSET, NO_EXTRA },
+ { GL_STENCIL_FUNC, LOC_CUSTOM, TYPE_ENUM, NO_OFFSET, NO_EXTRA },
+ { GL_STENCIL_PASS_DEPTH_FAIL, LOC_CUSTOM, TYPE_ENUM, NO_OFFSET, NO_EXTRA },
+ { GL_STENCIL_PASS_DEPTH_PASS, LOC_CUSTOM, TYPE_ENUM, NO_OFFSET, NO_EXTRA },
+ { GL_STENCIL_REF, LOC_CUSTOM, TYPE_INT, NO_OFFSET, NO_EXTRA },
+ { GL_STENCIL_TEST, CONTEXT_BOOL(Stencil.Enabled), NO_EXTRA },
+ { GL_STENCIL_VALUE_MASK, LOC_CUSTOM, TYPE_INT, NO_OFFSET, NO_EXTRA },
+ { GL_STENCIL_WRITEMASK, LOC_CUSTOM, TYPE_INT, NO_OFFSET, NO_EXTRA },
+ { GL_SUBPIXEL_BITS, CONTEXT_INT(Const.SubPixelBits), NO_EXTRA },
+ { GL_TEXTURE_BINDING_2D, LOC_CUSTOM, TYPE_INT, TEXTURE_2D_INDEX, NO_EXTRA },
+ { GL_UNPACK_ALIGNMENT, CONTEXT_INT(Unpack.Alignment), NO_EXTRA },
+ { GL_VIEWPORT, LOC_CUSTOM, TYPE_INT_4, 0, NO_EXTRA },
+
+ /* GL_ARB_multitexture */
+ { GL_ACTIVE_TEXTURE_ARB,
+ LOC_CUSTOM, TYPE_INT, 0, extra_ARB_multitexture },
+
+ /* Note that all the OES_* extensions require that the Mesa "struct
+ * gl_extensions" include a member with the name of the extension.
+ * That structure does not yet include OES extensions (and we're
+ * not sure whether it will). If it does, all the OES_*
+ * extensions below should mark the dependency. */
+
+ /* GL_ARB_texture_cube_map */
+ { GL_TEXTURE_BINDING_CUBE_MAP_ARB, LOC_CUSTOM, TYPE_INT,
+ TEXTURE_CUBE_INDEX, extra_ARB_texture_cube_map },
+ { GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB, LOC_CUSTOM, TYPE_INT,
+ offsetof(struct gl_context, Const.MaxCubeTextureLevels),
+ extra_ARB_texture_cube_map }, /* XXX: OES_texture_cube_map */
+
+ /* XXX: OES_blend_subtract */
+ { GL_BLEND_SRC_RGB_EXT, CONTEXT_ENUM(Color.Blend[0].SrcRGB), NO_EXTRA },
+ { GL_BLEND_DST_RGB_EXT, CONTEXT_ENUM(Color.Blend[0].DstRGB), NO_EXTRA },
+ { GL_BLEND_SRC_ALPHA_EXT, CONTEXT_ENUM(Color.Blend[0].SrcA), NO_EXTRA },
+ { GL_BLEND_DST_ALPHA_EXT, CONTEXT_ENUM(Color.Blend[0].DstA), NO_EXTRA },
+
+ /* GL_BLEND_EQUATION_RGB, which is what we're really after, is
+ * defined identically to GL_BLEND_EQUATION. */
+ { GL_BLEND_EQUATION, CONTEXT_ENUM(Color.Blend[0].EquationRGB), NO_EXTRA },
+ { GL_BLEND_EQUATION_ALPHA_EXT, CONTEXT_ENUM(Color.Blend[0].EquationA), NO_EXTRA },
+
+ /* GL_ARB_texture_compression */
+ { GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB, LOC_CUSTOM, TYPE_INT, 0, NO_EXTRA },
+ { GL_COMPRESSED_TEXTURE_FORMATS_ARB, LOC_CUSTOM, TYPE_INT_N, 0, NO_EXTRA },
+
+ /* GL_ARB_multisample */
+ { GL_SAMPLE_ALPHA_TO_COVERAGE_ARB,
+ CONTEXT_BOOL(Multisample.SampleAlphaToCoverage), NO_EXTRA },
+ { GL_SAMPLE_COVERAGE_ARB, CONTEXT_BOOL(Multisample.SampleCoverage), NO_EXTRA },
+ { GL_SAMPLE_COVERAGE_VALUE_ARB,
+ CONTEXT_FLOAT(Multisample.SampleCoverageValue), NO_EXTRA },
+ { GL_SAMPLE_COVERAGE_INVERT_ARB,
+ CONTEXT_BOOL(Multisample.SampleCoverageInvert), NO_EXTRA },
+ { GL_SAMPLE_BUFFERS_ARB, BUFFER_INT(Visual.sampleBuffers), NO_EXTRA },
+ { GL_SAMPLES_ARB, BUFFER_INT(Visual.samples), NO_EXTRA },
+
+ /* GL_SGIS_generate_mipmap */
+ { GL_GENERATE_MIPMAP_HINT_SGIS, CONTEXT_ENUM(Hint.GenerateMipmap),
+ extra_SGIS_generate_mipmap },
+
+ /* GL_ARB_vertex_buffer_object */
+ { GL_ARRAY_BUFFER_BINDING_ARB, LOC_CUSTOM, TYPE_INT, 0, NO_EXTRA },
+
+ /* GL_ARB_vertex_buffer_object */
+ /* GL_WEIGHT_ARRAY_BUFFER_BINDING_ARB - not supported */
+ { GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB, LOC_CUSTOM, TYPE_INT, 0,
+ extra_ARB_vertex_buffer_object },
+
+ /* GL_ARB_copy_buffer */
+ { GL_COPY_READ_BUFFER, LOC_CUSTOM, TYPE_INT, 0, extra_ARB_copy_buffer },
+ { GL_COPY_WRITE_BUFFER, LOC_CUSTOM, TYPE_INT, 0, extra_ARB_copy_buffer },
+
+ /* GL_OES_read_format */
+ { GL_IMPLEMENTATION_COLOR_READ_TYPE_OES, LOC_CUSTOM, TYPE_INT, 0,
+ extra_new_buffers_OES_read_format },
+ { GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES, LOC_CUSTOM, TYPE_INT, 0,
+ extra_new_buffers_OES_read_format },
+
+ /* GL_EXT_framebuffer_object */
+ { GL_FRAMEBUFFER_BINDING_EXT, BUFFER_INT(Name),
+ extra_EXT_framebuffer_object },
+ { GL_RENDERBUFFER_BINDING_EXT, LOC_CUSTOM, TYPE_INT, 0,
+ extra_EXT_framebuffer_object },
+ { GL_MAX_RENDERBUFFER_SIZE_EXT, CONTEXT_INT(Const.MaxRenderbufferSize),
+ extra_EXT_framebuffer_object },
+
+ /* This entry isn't spec'ed for GLES 2, but is needed for Mesa's
+ * GLSL: */
+ { GL_MAX_CLIP_PLANES, CONTEXT_INT(Const.MaxClipPlanes), NO_EXTRA },
+
+#if FEATURE_GL || FEATURE_ES1
+ /* Enums in OpenGL and GLES1 */
+ { 0, 0, TYPE_API_MASK, API_OPENGL_BIT | API_OPENGLES_BIT, NO_EXTRA },
+ { GL_LIGHT0, CONTEXT_BOOL(Light.Light[0].Enabled), NO_EXTRA },
+ { GL_LIGHT1, CONTEXT_BOOL(Light.Light[1].Enabled), NO_EXTRA },
+ { GL_LIGHT2, CONTEXT_BOOL(Light.Light[2].Enabled), NO_EXTRA },
+ { GL_LIGHT3, CONTEXT_BOOL(Light.Light[3].Enabled), NO_EXTRA },
+ { GL_LIGHT4, CONTEXT_BOOL(Light.Light[4].Enabled), NO_EXTRA },
+ { GL_LIGHT5, CONTEXT_BOOL(Light.Light[5].Enabled), NO_EXTRA },
+ { GL_LIGHT6, CONTEXT_BOOL(Light.Light[6].Enabled), NO_EXTRA },
+ { GL_LIGHT7, CONTEXT_BOOL(Light.Light[7].Enabled), NO_EXTRA },
+ { GL_LIGHTING, CONTEXT_BOOL(Light.Enabled), NO_EXTRA },
+ { GL_LIGHT_MODEL_AMBIENT,
+ CONTEXT_FIELD(Light.Model.Ambient[0], TYPE_FLOATN_4), NO_EXTRA },
+ { GL_LIGHT_MODEL_TWO_SIDE, CONTEXT_BOOL(Light.Model.TwoSide), NO_EXTRA },
+ { GL_ALPHA_TEST, CONTEXT_BOOL(Color.AlphaEnabled), NO_EXTRA },
+ { GL_ALPHA_TEST_FUNC, CONTEXT_ENUM(Color.AlphaFunc), NO_EXTRA },
+ { GL_ALPHA_TEST_REF, LOC_CUSTOM, TYPE_FLOATN, 0, extra_new_frag_clamp },
+ { GL_BLEND_DST, CONTEXT_ENUM(Color.Blend[0].DstRGB), NO_EXTRA },
+ { GL_CLIP_PLANE0, CONTEXT_BIT0(Transform.ClipPlanesEnabled), NO_EXTRA },
+ { GL_CLIP_PLANE1, CONTEXT_BIT1(Transform.ClipPlanesEnabled), NO_EXTRA },
+ { GL_CLIP_PLANE2, CONTEXT_BIT2(Transform.ClipPlanesEnabled), NO_EXTRA },
+ { GL_CLIP_PLANE3, CONTEXT_BIT3(Transform.ClipPlanesEnabled), NO_EXTRA },
+ { GL_CLIP_PLANE4, CONTEXT_BIT4(Transform.ClipPlanesEnabled), NO_EXTRA },
+ { GL_CLIP_PLANE5, CONTEXT_BIT5(Transform.ClipPlanesEnabled), NO_EXTRA },
+ { GL_COLOR_MATERIAL, CONTEXT_BOOL(Light.ColorMaterialEnabled), NO_EXTRA },
+ { GL_CURRENT_COLOR,
+ CONTEXT_FIELD(Current.Attrib[VERT_ATTRIB_COLOR0][0], TYPE_FLOATN_4),
+ extra_flush_current },
+ { GL_CURRENT_NORMAL,
+ CONTEXT_FIELD(Current.Attrib[VERT_ATTRIB_NORMAL][0], TYPE_FLOATN_3),
+ extra_flush_current },
+ { GL_CURRENT_TEXTURE_COORDS, LOC_CUSTOM, TYPE_FLOAT_4, 0,
+ extra_flush_current_valid_texture_unit },
+ { GL_DISTANCE_ATTENUATION_EXT, CONTEXT_FLOAT3(Point.Params[0]), NO_EXTRA },
+ { GL_FOG, CONTEXT_BOOL(Fog.Enabled), NO_EXTRA },
+ { GL_FOG_COLOR, LOC_CUSTOM, TYPE_FLOATN_4, 0, extra_new_frag_clamp },
+ { GL_FOG_DENSITY, CONTEXT_FLOAT(Fog.Density), NO_EXTRA },
+ { GL_FOG_END, CONTEXT_FLOAT(Fog.End), NO_EXTRA },
+ { GL_FOG_HINT, CONTEXT_ENUM(Hint.Fog), NO_EXTRA },
+ { GL_FOG_MODE, CONTEXT_ENUM(Fog.Mode), NO_EXTRA },
+ { GL_FOG_START, CONTEXT_FLOAT(Fog.Start), NO_EXTRA },
+ { GL_LINE_SMOOTH, CONTEXT_BOOL(Line.SmoothFlag), NO_EXTRA },
+ { GL_LINE_SMOOTH_HINT, CONTEXT_ENUM(Hint.LineSmooth), NO_EXTRA },
+ { GL_LINE_WIDTH_RANGE, CONTEXT_FLOAT2(Const.MinLineWidthAA), NO_EXTRA },
+ { GL_COLOR_LOGIC_OP, CONTEXT_BOOL(Color.ColorLogicOpEnabled), NO_EXTRA },
+ { GL_LOGIC_OP_MODE, CONTEXT_ENUM(Color.LogicOp), NO_EXTRA },
+ { GL_MATRIX_MODE, CONTEXT_ENUM(Transform.MatrixMode), NO_EXTRA },
+ { GL_MAX_MODELVIEW_STACK_DEPTH, CONST(MAX_MODELVIEW_STACK_DEPTH), NO_EXTRA },
+ { GL_MAX_PROJECTION_STACK_DEPTH, CONST(MAX_PROJECTION_STACK_DEPTH), NO_EXTRA },
+ { GL_MAX_TEXTURE_STACK_DEPTH, CONST(MAX_TEXTURE_STACK_DEPTH), NO_EXTRA },
+ { GL_MODELVIEW_MATRIX, CONTEXT_MATRIX(ModelviewMatrixStack.Top), NO_EXTRA },
+ { GL_MODELVIEW_STACK_DEPTH, LOC_CUSTOM, TYPE_INT,
+ offsetof(struct gl_context, ModelviewMatrixStack.Depth), NO_EXTRA },
+ { GL_NORMALIZE, CONTEXT_BOOL(Transform.Normalize), NO_EXTRA },
+ { GL_PACK_SKIP_IMAGES_EXT, CONTEXT_INT(Pack.SkipImages), NO_EXTRA },
+ { GL_PERSPECTIVE_CORRECTION_HINT, CONTEXT_ENUM(Hint.PerspectiveCorrection), NO_EXTRA },
+ { GL_POINT_SIZE, CONTEXT_FLOAT(Point.Size), NO_EXTRA },
+ { GL_POINT_SIZE_RANGE, CONTEXT_FLOAT2(Const.MinPointSizeAA), NO_EXTRA },
+ { GL_POINT_SMOOTH, CONTEXT_BOOL(Point.SmoothFlag), NO_EXTRA },
+ { GL_POINT_SMOOTH_HINT, CONTEXT_ENUM(Hint.PointSmooth), NO_EXTRA },
+ { GL_POINT_SIZE_MIN_EXT, CONTEXT_FLOAT(Point.MinSize), NO_EXTRA },
+ { GL_POINT_SIZE_MAX_EXT, CONTEXT_FLOAT(Point.MaxSize), NO_EXTRA },
+ { GL_POINT_FADE_THRESHOLD_SIZE_EXT, CONTEXT_FLOAT(Point.Threshold), NO_EXTRA },
+ { GL_PROJECTION_MATRIX, CONTEXT_MATRIX(ProjectionMatrixStack.Top), NO_EXTRA },
+ { GL_PROJECTION_STACK_DEPTH, LOC_CUSTOM, TYPE_INT,
+ offsetof(struct gl_context, ProjectionMatrixStack.Depth), NO_EXTRA },
+ { GL_RESCALE_NORMAL, CONTEXT_BOOL(Transform.RescaleNormals), NO_EXTRA },
+ { GL_SHADE_MODEL, CONTEXT_ENUM(Light.ShadeModel), NO_EXTRA },
+ { GL_TEXTURE_2D, LOC_CUSTOM, TYPE_BOOLEAN, 0, NO_EXTRA },
+ { GL_TEXTURE_MATRIX, LOC_CUSTOM, TYPE_MATRIX, 0, extra_valid_texture_unit },
+ { GL_TEXTURE_STACK_DEPTH, LOC_CUSTOM, TYPE_INT, 0,
+ extra_valid_texture_unit },
+
+ { GL_VERTEX_ARRAY, ARRAY_BOOL(Vertex.Enabled), NO_EXTRA },
+ { GL_VERTEX_ARRAY_SIZE, ARRAY_INT(Vertex.Size), NO_EXTRA },
+ { GL_VERTEX_ARRAY_TYPE, ARRAY_ENUM(Vertex.Type), NO_EXTRA },
+ { GL_VERTEX_ARRAY_STRIDE, ARRAY_INT(Vertex.Stride), NO_EXTRA },
+ { GL_NORMAL_ARRAY, ARRAY_BOOL(Normal.Enabled), NO_EXTRA },
+ { GL_NORMAL_ARRAY_TYPE, ARRAY_ENUM(Normal.Type), NO_EXTRA },
+ { GL_NORMAL_ARRAY_STRIDE, ARRAY_INT(Normal.Stride), NO_EXTRA },
+ { GL_COLOR_ARRAY, ARRAY_BOOL(Color.Enabled), NO_EXTRA },
+ { GL_COLOR_ARRAY_SIZE, ARRAY_INT(Color.Size), NO_EXTRA },
+ { GL_COLOR_ARRAY_TYPE, ARRAY_ENUM(Color.Type), NO_EXTRA },
+ { GL_COLOR_ARRAY_STRIDE, ARRAY_INT(Color.Stride), NO_EXTRA },
+ { GL_TEXTURE_COORD_ARRAY,
+ LOC_CUSTOM, TYPE_BOOLEAN, offsetof(struct gl_client_array, Enabled), NO_EXTRA },
+ { GL_TEXTURE_COORD_ARRAY_SIZE,
+ LOC_CUSTOM, TYPE_INT, offsetof(struct gl_client_array, Size), NO_EXTRA },
+ { GL_TEXTURE_COORD_ARRAY_TYPE,
+ LOC_CUSTOM, TYPE_ENUM, offsetof(struct gl_client_array, Type), NO_EXTRA },
+ { GL_TEXTURE_COORD_ARRAY_STRIDE,
+ LOC_CUSTOM, TYPE_INT, offsetof(struct gl_client_array, Stride), NO_EXTRA },
+
+ /* GL_ARB_ES2_compatibility */
+ { GL_SHADER_COMPILER, CONST(1), extra_ARB_ES2_compatibility },
+ { GL_MAX_VARYING_VECTORS, CONTEXT_INT(Const.MaxVarying),
+ extra_ARB_ES2_compatibility },
+ { GL_MAX_VERTEX_UNIFORM_VECTORS, LOC_CUSTOM, TYPE_INT, 0,
+ extra_ARB_ES2_compatibility },
+ { GL_MAX_FRAGMENT_UNIFORM_VECTORS, LOC_CUSTOM, TYPE_INT, 0,
+ extra_ARB_ES2_compatibility },
+
+ /* GL_ARB_multitexture */
+ { GL_MAX_TEXTURE_UNITS_ARB,
+ CONTEXT_INT(Const.MaxTextureUnits), extra_ARB_multitexture },
+ { GL_CLIENT_ACTIVE_TEXTURE_ARB,
+ LOC_CUSTOM, TYPE_INT, 0, extra_ARB_multitexture },
+
+ /* GL_ARB_texture_cube_map */
+ { GL_TEXTURE_CUBE_MAP_ARB, LOC_CUSTOM, TYPE_BOOLEAN, 0, NO_EXTRA },
+ /* S, T, and R are always set at the same time */
+ { GL_TEXTURE_GEN_STR_OES, LOC_TEXUNIT, TYPE_BIT_0,
+ offsetof(struct gl_texture_unit, TexGenEnabled), NO_EXTRA },
+
+ /* GL_ARB_multisample */
+ { GL_MULTISAMPLE_ARB, CONTEXT_BOOL(Multisample.Enabled), NO_EXTRA },
+ { GL_SAMPLE_ALPHA_TO_ONE_ARB, CONTEXT_BOOL(Multisample.SampleAlphaToOne), NO_EXTRA },
+
+ /* GL_ARB_vertex_buffer_object */
+ { GL_VERTEX_ARRAY_BUFFER_BINDING_ARB, LOC_CUSTOM, TYPE_INT,
+ offsetof(struct gl_array_object, Vertex.BufferObj), NO_EXTRA },
+ { GL_NORMAL_ARRAY_BUFFER_BINDING_ARB, LOC_CUSTOM, TYPE_INT,
+ offsetof(struct gl_array_object, Normal.BufferObj), NO_EXTRA },
+ { GL_COLOR_ARRAY_BUFFER_BINDING_ARB, LOC_CUSTOM, TYPE_INT,
+ offsetof(struct gl_array_object, Color.BufferObj), NO_EXTRA },
+ { GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB, LOC_CUSTOM, TYPE_INT, NO_OFFSET, NO_EXTRA },
+
+ /* GL_OES_point_sprite */
+ { GL_POINT_SPRITE_NV,
+ CONTEXT_BOOL(Point.PointSprite),
+ extra_NV_point_sprite_ARB_point_sprite },
+
+ /* GL_ARB_fragment_shader */
+ { GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB,
+ CONTEXT_INT(Const.FragmentProgram.MaxUniformComponents),
+ extra_ARB_fragment_shader },
+
+ /* GL_ARB_vertex_shader */
+ { GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB,
+ CONTEXT_INT(Const.VertexProgram.MaxUniformComponents),
+ extra_ARB_vertex_shader },
+ { GL_MAX_VARYING_FLOATS_ARB, LOC_CUSTOM, TYPE_INT, 0,
+ extra_ARB_vertex_shader },
+
+ /* GL_EXT_texture_lod_bias */
+ { GL_MAX_TEXTURE_LOD_BIAS_EXT, CONTEXT_FLOAT(Const.MaxTextureLodBias),
+ extra_EXT_texture_lod_bias },
+
+ /* GL_EXT_texture_filter_anisotropic */
+ { GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT,
+ CONTEXT_FLOAT(Const.MaxTextureMaxAnisotropy),
+ extra_EXT_texture_filter_anisotropic },
+#endif /* FEATURE_GL || FEATURE_ES1 */
+
+#if FEATURE_ES1
+ { 0, 0, TYPE_API_MASK, API_OPENGLES_BIT },
+ /* XXX: OES_matrix_get */
+ { GL_MODELVIEW_MATRIX_FLOAT_AS_INT_BITS_OES },
+ { GL_PROJECTION_MATRIX_FLOAT_AS_INT_BITS_OES },
+ { GL_TEXTURE_MATRIX_FLOAT_AS_INT_BITS_OES },
+
+ /* OES_point_size_array */
+ { GL_POINT_SIZE_ARRAY_OES, ARRAY_FIELD(PointSize.Enabled, TYPE_BOOLEAN) },
+ { GL_POINT_SIZE_ARRAY_TYPE_OES, ARRAY_FIELD(PointSize.Type, TYPE_ENUM) },
+ { GL_POINT_SIZE_ARRAY_STRIDE_OES, ARRAY_FIELD(PointSize.Stride, TYPE_INT) },
+ { GL_POINT_SIZE_ARRAY_BUFFER_BINDING_OES, LOC_CUSTOM, TYPE_INT, 0 },
+#endif /* FEATURE_ES1 */
+
+#if FEATURE_GL || FEATURE_ES2
+ { 0, 0, TYPE_API_MASK, API_OPENGL_BIT | API_OPENGLES2_BIT, NO_EXTRA },
+ /* This entry isn't spec'ed for GLES 2, but is needed for Mesa's GLSL: */
+ { GL_MAX_LIGHTS, CONTEXT_INT(Const.MaxLights), NO_EXTRA },
+ { GL_MAX_TEXTURE_COORDS_ARB, /* == GL_MAX_TEXTURE_COORDS_NV */
+ CONTEXT_INT(Const.MaxTextureCoordUnits),
+ extra_ARB_fragment_program_NV_fragment_program },
+
+ /* GL_ARB_draw_buffers */
+ { GL_MAX_DRAW_BUFFERS_ARB, CONTEXT_INT(Const.MaxDrawBuffers), NO_EXTRA },
+
+ { GL_BLEND_COLOR_EXT, LOC_CUSTOM, TYPE_FLOATN_4, 0, extra_new_frag_clamp },
+ /* GL_ARB_fragment_program */
+ { GL_MAX_TEXTURE_IMAGE_UNITS_ARB, /* == GL_MAX_TEXTURE_IMAGE_UNITS_NV */
+ CONTEXT_INT(Const.MaxTextureImageUnits),
+ extra_ARB_fragment_program_NV_fragment_program },
+ { GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB,
+ CONTEXT_INT(Const.MaxVertexTextureImageUnits), extra_ARB_vertex_shader },
+ { GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB,
+ CONTEXT_INT(Const.MaxCombinedTextureImageUnits),
+ extra_ARB_vertex_shader },
+
+ /* GL_ARB_shader_objects
+ * Actually, this token isn't part of GL_ARB_shader_objects, but is
+ * close enough for now. */
+ { GL_CURRENT_PROGRAM, LOC_CUSTOM, TYPE_INT, 0, extra_ARB_shader_objects },
+
+ /* OpenGL 2.0 */
+ { GL_STENCIL_BACK_FUNC, CONTEXT_ENUM(Stencil.Function[1]), NO_EXTRA },
+ { GL_STENCIL_BACK_VALUE_MASK, CONTEXT_INT(Stencil.ValueMask[1]), NO_EXTRA },
+ { GL_STENCIL_BACK_WRITEMASK, CONTEXT_INT(Stencil.WriteMask[1]), NO_EXTRA },
+ { GL_STENCIL_BACK_REF, CONTEXT_INT(Stencil.Ref[1]), NO_EXTRA },
+ { GL_STENCIL_BACK_FAIL, CONTEXT_ENUM(Stencil.FailFunc[1]), NO_EXTRA },
+ { GL_STENCIL_BACK_PASS_DEPTH_FAIL, CONTEXT_ENUM(Stencil.ZFailFunc[1]), NO_EXTRA },
+ { GL_STENCIL_BACK_PASS_DEPTH_PASS, CONTEXT_ENUM(Stencil.ZPassFunc[1]), NO_EXTRA },
+
+ { GL_MAX_VERTEX_ATTRIBS_ARB,
+ CONTEXT_INT(Const.VertexProgram.MaxAttribs),
+ extra_ARB_vertex_program_version_es2 },
+
+ /* OES_texture_3D */
+ { GL_TEXTURE_BINDING_3D, LOC_CUSTOM, TYPE_INT, TEXTURE_3D_INDEX, NO_EXTRA },
+ { GL_MAX_3D_TEXTURE_SIZE, LOC_CUSTOM, TYPE_INT,
+ offsetof(struct gl_context, Const.Max3DTextureLevels), NO_EXTRA },
+
+ /* GL_ARB_fragment_program/OES_standard_derivatives */
+ { GL_FRAGMENT_SHADER_DERIVATIVE_HINT_ARB,
+ CONTEXT_ENUM(Hint.FragmentShaderDerivative), extra_ARB_fragment_shader },
+#endif /* FEATURE_GL || FEATURE_ES2 */
+
+#if FEATURE_ES2
+ /* Enums unique to OpenGL ES 2.0 */
+ { 0, 0, TYPE_API_MASK, API_OPENGLES2_BIT, NO_EXTRA },
+ { GL_MAX_FRAGMENT_UNIFORM_VECTORS, LOC_CUSTOM, TYPE_INT, 0, NO_EXTRA },
+ { GL_MAX_VARYING_VECTORS, CONTEXT_INT(Const.MaxVarying), NO_EXTRA },
+ { GL_MAX_VERTEX_UNIFORM_VECTORS, LOC_CUSTOM, TYPE_INT, 0, NO_EXTRA },
+ { GL_SHADER_COMPILER, CONST(1), NO_EXTRA },
+ /* OES_get_program_binary */
+ { GL_NUM_SHADER_BINARY_FORMATS, CONST(0), NO_EXTRA },
+ { GL_SHADER_BINARY_FORMATS, CONST(0), NO_EXTRA },
+#endif /* FEATURE_ES2 */
+
+#if FEATURE_GL
+ /* Remaining enums are only in OpenGL */
+ { 0, 0, TYPE_API_MASK, API_OPENGL_BIT, NO_EXTRA },
+ { GL_ACCUM_RED_BITS, BUFFER_INT(Visual.accumRedBits), NO_EXTRA },
+ { GL_ACCUM_GREEN_BITS, BUFFER_INT(Visual.accumGreenBits), NO_EXTRA },
+ { GL_ACCUM_BLUE_BITS, BUFFER_INT(Visual.accumBlueBits), NO_EXTRA },
+ { GL_ACCUM_ALPHA_BITS, BUFFER_INT(Visual.accumAlphaBits), NO_EXTRA },
+ { GL_ACCUM_CLEAR_VALUE, CONTEXT_FIELD(Accum.ClearColor[0], TYPE_FLOATN_4), NO_EXTRA },
+ { GL_ALPHA_BIAS, CONTEXT_FLOAT(Pixel.AlphaBias), NO_EXTRA },
+ { GL_ALPHA_SCALE, CONTEXT_FLOAT(Pixel.AlphaScale), NO_EXTRA },
+ { GL_ATTRIB_STACK_DEPTH, CONTEXT_INT(AttribStackDepth), NO_EXTRA },
+ { GL_AUTO_NORMAL, CONTEXT_BOOL(Eval.AutoNormal), NO_EXTRA },
+ { GL_AUX_BUFFERS, BUFFER_INT(Visual.numAuxBuffers), NO_EXTRA },
+ { GL_BLUE_BIAS, CONTEXT_FLOAT(Pixel.BlueBias), NO_EXTRA },
+ { GL_BLUE_SCALE, CONTEXT_FLOAT(Pixel.BlueScale), NO_EXTRA },
+ { GL_CLIENT_ATTRIB_STACK_DEPTH, CONTEXT_INT(ClientAttribStackDepth), NO_EXTRA },
+ { GL_COLOR_MATERIAL_FACE, CONTEXT_ENUM(Light.ColorMaterialFace), NO_EXTRA },
+ { GL_COLOR_MATERIAL_PARAMETER, CONTEXT_ENUM(Light.ColorMaterialMode), NO_EXTRA },
+ { GL_CURRENT_INDEX,
+ CONTEXT_FLOAT(Current.Attrib[VERT_ATTRIB_COLOR_INDEX][0]),
+ extra_flush_current },
+ { GL_CURRENT_RASTER_COLOR,
+ CONTEXT_FIELD(Current.RasterColor[0], TYPE_FLOATN_4), NO_EXTRA },
+ { GL_CURRENT_RASTER_DISTANCE, CONTEXT_FLOAT(Current.RasterDistance), NO_EXTRA },
+ { GL_CURRENT_RASTER_INDEX, CONST(1), NO_EXTRA },
+ { GL_CURRENT_RASTER_POSITION, CONTEXT_FLOAT4(Current.RasterPos[0]), NO_EXTRA },
+ { GL_CURRENT_RASTER_SECONDARY_COLOR,
+ CONTEXT_FIELD(Current.RasterSecondaryColor[0], TYPE_FLOATN_4), NO_EXTRA },
+ { GL_CURRENT_RASTER_TEXTURE_COORDS, LOC_CUSTOM, TYPE_FLOAT_4, 0,
+ extra_valid_texture_unit },
+ { GL_CURRENT_RASTER_POSITION_VALID, CONTEXT_BOOL(Current.RasterPosValid), NO_EXTRA },
+ { GL_DEPTH_BIAS, CONTEXT_FLOAT(Pixel.DepthBias), NO_EXTRA },
+ { GL_DEPTH_SCALE, CONTEXT_FLOAT(Pixel.DepthScale), NO_EXTRA },
+ { GL_DOUBLEBUFFER, BUFFER_INT(Visual.doubleBufferMode), NO_EXTRA },
+ { GL_DRAW_BUFFER, BUFFER_ENUM(ColorDrawBuffer[0]), NO_EXTRA },
+ { GL_EDGE_FLAG, LOC_CUSTOM, TYPE_BOOLEAN, 0, NO_EXTRA },
+ { GL_FEEDBACK_BUFFER_SIZE, CONTEXT_INT(Feedback.BufferSize), NO_EXTRA },
+ { GL_FEEDBACK_BUFFER_TYPE, CONTEXT_ENUM(Feedback.Type), NO_EXTRA },
+ { GL_FOG_INDEX, CONTEXT_FLOAT(Fog.Index), NO_EXTRA },
+ { GL_GREEN_BIAS, CONTEXT_FLOAT(Pixel.GreenBias), NO_EXTRA },
+ { GL_GREEN_SCALE, CONTEXT_FLOAT(Pixel.GreenScale), NO_EXTRA },
+ { GL_INDEX_BITS, BUFFER_INT(Visual.indexBits), extra_new_buffers },
+ { GL_INDEX_CLEAR_VALUE, CONTEXT_INT(Color.ClearIndex), NO_EXTRA },
+ { GL_INDEX_MODE, CONST(0) , NO_EXTRA},
+ { GL_INDEX_OFFSET, CONTEXT_INT(Pixel.IndexOffset), NO_EXTRA },
+ { GL_INDEX_SHIFT, CONTEXT_INT(Pixel.IndexShift), NO_EXTRA },
+ { GL_INDEX_WRITEMASK, CONTEXT_INT(Color.IndexMask), NO_EXTRA },
+ { GL_LIGHT_MODEL_COLOR_CONTROL, CONTEXT_ENUM(Light.Model.ColorControl), NO_EXTRA },
+ { GL_LIGHT_MODEL_LOCAL_VIEWER, CONTEXT_BOOL(Light.Model.LocalViewer), NO_EXTRA },
+ { GL_LINE_STIPPLE, CONTEXT_BOOL(Line.StippleFlag), NO_EXTRA },
+ { GL_LINE_STIPPLE_PATTERN, LOC_CUSTOM, TYPE_INT, 0, NO_EXTRA },
+ { GL_LINE_STIPPLE_REPEAT, CONTEXT_INT(Line.StippleFactor), NO_EXTRA },
+ { GL_LINE_WIDTH_GRANULARITY, CONTEXT_FLOAT(Const.LineWidthGranularity), NO_EXTRA },
+ { GL_LIST_BASE, CONTEXT_INT(List.ListBase), NO_EXTRA },
+ { GL_LIST_INDEX, LOC_CUSTOM, TYPE_INT, 0, NO_EXTRA },
+ { GL_LIST_MODE, LOC_CUSTOM, TYPE_ENUM, 0, NO_EXTRA },
+ { GL_INDEX_LOGIC_OP, CONTEXT_BOOL(Color.IndexLogicOpEnabled), NO_EXTRA },
+ { GL_MAP1_COLOR_4, CONTEXT_BOOL(Eval.Map1Color4), NO_EXTRA },
+ { GL_MAP1_GRID_DOMAIN, CONTEXT_FLOAT2(Eval.MapGrid1u1), NO_EXTRA },
+ { GL_MAP1_GRID_SEGMENTS, CONTEXT_INT(Eval.MapGrid1un), NO_EXTRA },
+ { GL_MAP1_INDEX, CONTEXT_BOOL(Eval.Map1Index), NO_EXTRA },
+ { GL_MAP1_NORMAL, CONTEXT_BOOL(Eval.Map1Normal), NO_EXTRA },
+ { GL_MAP1_TEXTURE_COORD_1, CONTEXT_BOOL(Eval.Map1TextureCoord1), NO_EXTRA },
+ { GL_MAP1_TEXTURE_COORD_2, CONTEXT_BOOL(Eval.Map1TextureCoord2), NO_EXTRA },
+ { GL_MAP1_TEXTURE_COORD_3, CONTEXT_BOOL(Eval.Map1TextureCoord3), NO_EXTRA },
+ { GL_MAP1_TEXTURE_COORD_4, CONTEXT_BOOL(Eval.Map1TextureCoord4), NO_EXTRA },
+ { GL_MAP1_VERTEX_3, CONTEXT_BOOL(Eval.Map1Vertex3), NO_EXTRA },
+ { GL_MAP1_VERTEX_4, CONTEXT_BOOL(Eval.Map1Vertex4), NO_EXTRA },
+ { GL_MAP2_COLOR_4, CONTEXT_BOOL(Eval.Map2Color4), NO_EXTRA },
+ { GL_MAP2_GRID_DOMAIN, LOC_CUSTOM, TYPE_FLOAT_4, 0, NO_EXTRA },
+ { GL_MAP2_GRID_SEGMENTS, CONTEXT_INT2(Eval.MapGrid2un), NO_EXTRA },
+ { GL_MAP2_INDEX, CONTEXT_BOOL(Eval.Map2Index), NO_EXTRA },
+ { GL_MAP2_NORMAL, CONTEXT_BOOL(Eval.Map2Normal), NO_EXTRA },
+ { GL_MAP2_TEXTURE_COORD_1, CONTEXT_BOOL(Eval.Map2TextureCoord1), NO_EXTRA },
+ { GL_MAP2_TEXTURE_COORD_2, CONTEXT_BOOL(Eval.Map2TextureCoord2), NO_EXTRA },
+ { GL_MAP2_TEXTURE_COORD_3, CONTEXT_BOOL(Eval.Map2TextureCoord3), NO_EXTRA },
+ { GL_MAP2_TEXTURE_COORD_4, CONTEXT_BOOL(Eval.Map2TextureCoord4), NO_EXTRA },
+ { GL_MAP2_VERTEX_3, CONTEXT_BOOL(Eval.Map2Vertex3), NO_EXTRA },
+ { GL_MAP2_VERTEX_4, CONTEXT_BOOL(Eval.Map2Vertex4), NO_EXTRA },
+ { GL_MAP_COLOR, CONTEXT_BOOL(Pixel.MapColorFlag), NO_EXTRA },
+ { GL_MAP_STENCIL, CONTEXT_BOOL(Pixel.MapStencilFlag), NO_EXTRA },
+ { GL_MAX_ATTRIB_STACK_DEPTH, CONST(MAX_ATTRIB_STACK_DEPTH), NO_EXTRA },
+ { GL_MAX_CLIENT_ATTRIB_STACK_DEPTH, CONST(MAX_CLIENT_ATTRIB_STACK_DEPTH), NO_EXTRA },
+
+ { GL_MAX_EVAL_ORDER, CONST(MAX_EVAL_ORDER), NO_EXTRA },
+ { GL_MAX_LIST_NESTING, CONST(MAX_LIST_NESTING), NO_EXTRA },
+ { GL_MAX_NAME_STACK_DEPTH, CONST(MAX_NAME_STACK_DEPTH), NO_EXTRA },
+ { GL_MAX_PIXEL_MAP_TABLE, CONST(MAX_PIXEL_MAP_TABLE), NO_EXTRA },
+ { GL_NAME_STACK_DEPTH, CONTEXT_INT(Select.NameStackDepth), NO_EXTRA },
+ { GL_PACK_LSB_FIRST, CONTEXT_BOOL(Pack.LsbFirst), NO_EXTRA },
+ { GL_PACK_ROW_LENGTH, CONTEXT_INT(Pack.RowLength), NO_EXTRA },
+ { GL_PACK_SKIP_PIXELS, CONTEXT_INT(Pack.SkipPixels), NO_EXTRA },
+ { GL_PACK_SKIP_ROWS, CONTEXT_INT(Pack.SkipRows), NO_EXTRA },
+ { GL_PACK_SWAP_BYTES, CONTEXT_BOOL(Pack.SwapBytes), NO_EXTRA },
+ { GL_PACK_IMAGE_HEIGHT_EXT, CONTEXT_INT(Pack.ImageHeight), NO_EXTRA },
+ { GL_PACK_INVERT_MESA, CONTEXT_BOOL(Pack.Invert), NO_EXTRA },
+ { GL_PIXEL_MAP_A_TO_A_SIZE, CONTEXT_INT(PixelMaps.AtoA.Size), NO_EXTRA },
+ { GL_PIXEL_MAP_B_TO_B_SIZE, CONTEXT_INT(PixelMaps.BtoB.Size), NO_EXTRA },
+ { GL_PIXEL_MAP_G_TO_G_SIZE, CONTEXT_INT(PixelMaps.GtoG.Size), NO_EXTRA },
+ { GL_PIXEL_MAP_I_TO_A_SIZE, CONTEXT_INT(PixelMaps.ItoA.Size), NO_EXTRA },
+ { GL_PIXEL_MAP_I_TO_B_SIZE, CONTEXT_INT(PixelMaps.ItoB.Size), NO_EXTRA },
+ { GL_PIXEL_MAP_I_TO_G_SIZE, CONTEXT_INT(PixelMaps.ItoG.Size), NO_EXTRA },
+ { GL_PIXEL_MAP_I_TO_I_SIZE, CONTEXT_INT(PixelMaps.ItoI.Size), NO_EXTRA },
+ { GL_PIXEL_MAP_I_TO_R_SIZE, CONTEXT_INT(PixelMaps.ItoR.Size), NO_EXTRA },
+ { GL_PIXEL_MAP_R_TO_R_SIZE, CONTEXT_INT(PixelMaps.RtoR.Size), NO_EXTRA },
+ { GL_PIXEL_MAP_S_TO_S_SIZE, CONTEXT_INT(PixelMaps.StoS.Size), NO_EXTRA },
+ { GL_POINT_SIZE_GRANULARITY, CONTEXT_FLOAT(Const.PointSizeGranularity), NO_EXTRA },
+ { GL_POLYGON_MODE, CONTEXT_ENUM2(Polygon.FrontMode), NO_EXTRA },
+ { GL_POLYGON_OFFSET_BIAS_EXT, CONTEXT_FLOAT(Polygon.OffsetUnits), NO_EXTRA },
+ { GL_POLYGON_OFFSET_POINT, CONTEXT_BOOL(Polygon.OffsetPoint), NO_EXTRA },
+ { GL_POLYGON_OFFSET_LINE, CONTEXT_BOOL(Polygon.OffsetLine), NO_EXTRA },
+ { GL_POLYGON_SMOOTH, CONTEXT_BOOL(Polygon.SmoothFlag), NO_EXTRA },
+ { GL_POLYGON_SMOOTH_HINT, CONTEXT_ENUM(Hint.PolygonSmooth), NO_EXTRA },
+ { GL_POLYGON_STIPPLE, CONTEXT_BOOL(Polygon.StippleFlag), NO_EXTRA },
+ { GL_READ_BUFFER, LOC_CUSTOM, TYPE_ENUM, NO_OFFSET, NO_EXTRA },
+ { GL_RED_BIAS, CONTEXT_FLOAT(Pixel.RedBias), NO_EXTRA },
+ { GL_RED_SCALE, CONTEXT_FLOAT(Pixel.RedScale), NO_EXTRA },
+ { GL_RENDER_MODE, CONTEXT_ENUM(RenderMode), NO_EXTRA },
+ { GL_RGBA_MODE, CONST(1), NO_EXTRA },
+ { GL_SELECTION_BUFFER_SIZE, CONTEXT_INT(Select.BufferSize), NO_EXTRA },
+ { GL_SHARED_TEXTURE_PALETTE_EXT, CONTEXT_BOOL(Texture.SharedPalette), NO_EXTRA },
+
+ { GL_STEREO, BUFFER_INT(Visual.stereoMode), NO_EXTRA },
+
+ { GL_TEXTURE_1D, LOC_CUSTOM, TYPE_BOOLEAN, NO_OFFSET, NO_EXTRA },
+ { GL_TEXTURE_3D, LOC_CUSTOM, TYPE_BOOLEAN, NO_OFFSET, NO_EXTRA },
+ { GL_TEXTURE_1D_ARRAY_EXT, LOC_CUSTOM, TYPE_BOOLEAN, NO_OFFSET, NO_EXTRA },
+ { GL_TEXTURE_2D_ARRAY_EXT, LOC_CUSTOM, TYPE_BOOLEAN, NO_OFFSET, NO_EXTRA },
+
+ { GL_TEXTURE_BINDING_1D, LOC_CUSTOM, TYPE_INT, TEXTURE_1D_INDEX, NO_EXTRA },
+ { GL_TEXTURE_BINDING_1D_ARRAY, LOC_CUSTOM, TYPE_INT,
+ TEXTURE_1D_ARRAY_INDEX, extra_MESA_texture_array },
+ { GL_TEXTURE_BINDING_2D_ARRAY, LOC_CUSTOM, TYPE_INT,
+ TEXTURE_1D_ARRAY_INDEX, extra_MESA_texture_array },
+ { GL_MAX_ARRAY_TEXTURE_LAYERS_EXT,
+ CONTEXT_INT(Const.MaxArrayTextureLayers), extra_MESA_texture_array },
+
+ { GL_TEXTURE_GEN_S, LOC_TEXUNIT, TYPE_BIT_0,
+ offsetof(struct gl_texture_unit, TexGenEnabled), NO_EXTRA },
+ { GL_TEXTURE_GEN_T, LOC_TEXUNIT, TYPE_BIT_1,
+ offsetof(struct gl_texture_unit, TexGenEnabled), NO_EXTRA },
+ { GL_TEXTURE_GEN_R, LOC_TEXUNIT, TYPE_BIT_2,
+ offsetof(struct gl_texture_unit, TexGenEnabled), NO_EXTRA },
+ { GL_TEXTURE_GEN_Q, LOC_TEXUNIT, TYPE_BIT_3,
+ offsetof(struct gl_texture_unit, TexGenEnabled), NO_EXTRA },
+ { GL_UNPACK_LSB_FIRST, CONTEXT_BOOL(Unpack.LsbFirst), NO_EXTRA },
+ { GL_UNPACK_ROW_LENGTH, CONTEXT_INT(Unpack.RowLength), NO_EXTRA },
+ { GL_UNPACK_SKIP_PIXELS, CONTEXT_INT(Unpack.SkipPixels), NO_EXTRA },
+ { GL_UNPACK_SKIP_ROWS, CONTEXT_INT(Unpack.SkipRows), NO_EXTRA },
+ { GL_UNPACK_SWAP_BYTES, CONTEXT_BOOL(Unpack.SwapBytes), NO_EXTRA },
+ { GL_UNPACK_SKIP_IMAGES_EXT, CONTEXT_INT(Unpack.SkipImages), NO_EXTRA },
+ { GL_UNPACK_IMAGE_HEIGHT_EXT, CONTEXT_INT(Unpack.ImageHeight), NO_EXTRA },
+ { GL_UNPACK_CLIENT_STORAGE_APPLE, CONTEXT_BOOL(Unpack.ClientStorage), NO_EXTRA },
+ { GL_ZOOM_X, CONTEXT_FLOAT(Pixel.ZoomX), NO_EXTRA },
+ { GL_ZOOM_Y, CONTEXT_FLOAT(Pixel.ZoomY), NO_EXTRA },
+
+ /* Vertex arrays */
+ { GL_VERTEX_ARRAY_COUNT_EXT, CONST(0), NO_EXTRA },
+ { GL_NORMAL_ARRAY_COUNT_EXT, CONST(0), NO_EXTRA },
+ { GL_COLOR_ARRAY_COUNT_EXT, CONST(0), NO_EXTRA },
+ { GL_INDEX_ARRAY, ARRAY_BOOL(Index.Enabled), NO_EXTRA },
+ { GL_INDEX_ARRAY_TYPE, ARRAY_ENUM(Index.Type), NO_EXTRA },
+ { GL_INDEX_ARRAY_STRIDE, ARRAY_INT(Index.Stride), NO_EXTRA },
+ { GL_INDEX_ARRAY_COUNT_EXT, CONST(0), NO_EXTRA },
+ { GL_TEXTURE_COORD_ARRAY_COUNT_EXT, CONST(0), NO_EXTRA },
+ { GL_EDGE_FLAG_ARRAY, ARRAY_BOOL(EdgeFlag.Enabled), NO_EXTRA },
+ { GL_EDGE_FLAG_ARRAY_STRIDE, ARRAY_INT(EdgeFlag.Stride), NO_EXTRA },
+ { GL_EDGE_FLAG_ARRAY_COUNT_EXT, CONST(0), NO_EXTRA },
+
+ /* GL_ARB_texture_compression */
+ { GL_TEXTURE_COMPRESSION_HINT_ARB, CONTEXT_INT(Hint.TextureCompression), NO_EXTRA },
+
+ /* GL_EXT_compiled_vertex_array */
+ { GL_ARRAY_ELEMENT_LOCK_FIRST_EXT, CONTEXT_INT(Array.LockFirst),
+ extra_EXT_compiled_vertex_array },
+ { GL_ARRAY_ELEMENT_LOCK_COUNT_EXT, CONTEXT_INT(Array.LockCount),
+ extra_EXT_compiled_vertex_array },
+
+ /* GL_ARB_transpose_matrix */
+ { GL_TRANSPOSE_MODELVIEW_MATRIX_ARB,
+ CONTEXT_MATRIX_T(ModelviewMatrixStack), NO_EXTRA },
+ { GL_TRANSPOSE_PROJECTION_MATRIX_ARB,
+ CONTEXT_MATRIX_T(ProjectionMatrixStack.Top), NO_EXTRA },
+ { GL_TRANSPOSE_TEXTURE_MATRIX_ARB, CONTEXT_MATRIX_T(TextureMatrixStack), NO_EXTRA },
+
+ /* GL_EXT_secondary_color */
+ { GL_COLOR_SUM_EXT, CONTEXT_BOOL(Fog.ColorSumEnabled),
+ extra_EXT_secondary_color_ARB_vertex_program },
+ { GL_CURRENT_SECONDARY_COLOR_EXT,
+ CONTEXT_FIELD(Current.Attrib[VERT_ATTRIB_COLOR1][0], TYPE_FLOATN_4),
+ extra_EXT_secondary_color_flush_current },
+ { GL_SECONDARY_COLOR_ARRAY_EXT, ARRAY_BOOL(SecondaryColor.Enabled),
+ extra_EXT_secondary_color },
+ { GL_SECONDARY_COLOR_ARRAY_TYPE_EXT, ARRAY_ENUM(SecondaryColor.Type),
+ extra_EXT_secondary_color },
+ { GL_SECONDARY_COLOR_ARRAY_STRIDE_EXT, ARRAY_INT(SecondaryColor.Stride),
+ extra_EXT_secondary_color },
+ { GL_SECONDARY_COLOR_ARRAY_SIZE_EXT, ARRAY_INT(SecondaryColor.Size),
+ extra_EXT_secondary_color },
+
+ /* GL_EXT_fog_coord */
+ { GL_CURRENT_FOG_COORDINATE_EXT,
+ CONTEXT_FLOAT(Current.Attrib[VERT_ATTRIB_FOG][0]),
+ extra_EXT_fog_coord_flush_current },
+ { GL_FOG_COORDINATE_ARRAY_EXT, ARRAY_BOOL(FogCoord.Enabled),
+ extra_EXT_fog_coord },
+ { GL_FOG_COORDINATE_ARRAY_TYPE_EXT, ARRAY_ENUM(FogCoord.Type),
+ extra_EXT_fog_coord },
+ { GL_FOG_COORDINATE_ARRAY_STRIDE_EXT, ARRAY_INT(FogCoord.Stride),
+ extra_EXT_fog_coord },
+ { GL_FOG_COORDINATE_SOURCE_EXT, CONTEXT_ENUM(Fog.FogCoordinateSource),
+ extra_EXT_fog_coord },
+
+ /* GL_IBM_rasterpos_clip */
+ { GL_RASTER_POSITION_UNCLIPPED_IBM,
+ CONTEXT_BOOL(Transform.RasterPositionUnclipped),
+ extra_IBM_rasterpos_clip },
+
+ /* GL_NV_point_sprite */
+ { GL_POINT_SPRITE_R_MODE_NV,
+ CONTEXT_ENUM(Point.SpriteRMode), extra_NV_point_sprite },
+ { GL_POINT_SPRITE_COORD_ORIGIN, CONTEXT_ENUM(Point.SpriteOrigin),
+ extra_NV_point_sprite_ARB_point_sprite },
+
+ /* GL_NV_vertex_program */
+ { GL_VERTEX_PROGRAM_BINDING_NV, LOC_CUSTOM, TYPE_INT, 0,
+ extra_NV_vertex_program },
+ { GL_VERTEX_ATTRIB_ARRAY0_NV, ARRAY_BOOL(VertexAttrib[0].Enabled),
+ extra_NV_vertex_program },
+ { GL_VERTEX_ATTRIB_ARRAY1_NV, ARRAY_BOOL(VertexAttrib[1].Enabled),
+ extra_NV_vertex_program },
+ { GL_VERTEX_ATTRIB_ARRAY2_NV, ARRAY_BOOL(VertexAttrib[2].Enabled),
+ extra_NV_vertex_program },
+ { GL_VERTEX_ATTRIB_ARRAY3_NV, ARRAY_BOOL(VertexAttrib[3].Enabled),
+ extra_NV_vertex_program },
+ { GL_VERTEX_ATTRIB_ARRAY4_NV, ARRAY_BOOL(VertexAttrib[4].Enabled),
+ extra_NV_vertex_program },
+ { GL_VERTEX_ATTRIB_ARRAY5_NV, ARRAY_BOOL(VertexAttrib[5].Enabled),
+ extra_NV_vertex_program },
+ { GL_VERTEX_ATTRIB_ARRAY6_NV, ARRAY_BOOL(VertexAttrib[6].Enabled),
+ extra_NV_vertex_program },
+ { GL_VERTEX_ATTRIB_ARRAY7_NV, ARRAY_BOOL(VertexAttrib[7].Enabled),
+ extra_NV_vertex_program },
+ { GL_VERTEX_ATTRIB_ARRAY8_NV, ARRAY_BOOL(VertexAttrib[8].Enabled),
+ extra_NV_vertex_program },
+ { GL_VERTEX_ATTRIB_ARRAY9_NV, ARRAY_BOOL(VertexAttrib[9].Enabled),
+ extra_NV_vertex_program },
+ { GL_VERTEX_ATTRIB_ARRAY10_NV, ARRAY_BOOL(VertexAttrib[10].Enabled),
+ extra_NV_vertex_program },
+ { GL_VERTEX_ATTRIB_ARRAY11_NV, ARRAY_BOOL(VertexAttrib[11].Enabled),
+ extra_NV_vertex_program },
+ { GL_VERTEX_ATTRIB_ARRAY12_NV, ARRAY_BOOL(VertexAttrib[12].Enabled),
+ extra_NV_vertex_program },
+ { GL_VERTEX_ATTRIB_ARRAY13_NV, ARRAY_BOOL(VertexAttrib[13].Enabled),
+ extra_NV_vertex_program },
+ { GL_VERTEX_ATTRIB_ARRAY14_NV, ARRAY_BOOL(VertexAttrib[14].Enabled),
+ extra_NV_vertex_program },
+ { GL_VERTEX_ATTRIB_ARRAY15_NV, ARRAY_BOOL(VertexAttrib[15].Enabled),
+ extra_NV_vertex_program },
+ { GL_MAP1_VERTEX_ATTRIB0_4_NV, CONTEXT_BOOL(Eval.Map1Attrib[0]),
+ extra_NV_vertex_program },
+ { GL_MAP1_VERTEX_ATTRIB1_4_NV, CONTEXT_BOOL(Eval.Map1Attrib[1]),
+ extra_NV_vertex_program },
+ { GL_MAP1_VERTEX_ATTRIB2_4_NV, CONTEXT_BOOL(Eval.Map1Attrib[2]),
+ extra_NV_vertex_program },
+ { GL_MAP1_VERTEX_ATTRIB3_4_NV, CONTEXT_BOOL(Eval.Map1Attrib[3]),
+ extra_NV_vertex_program },
+ { GL_MAP1_VERTEX_ATTRIB4_4_NV, CONTEXT_BOOL(Eval.Map1Attrib[4]),
+ extra_NV_vertex_program },
+ { GL_MAP1_VERTEX_ATTRIB5_4_NV, CONTEXT_BOOL(Eval.Map1Attrib[5]),
+ extra_NV_vertex_program },
+ { GL_MAP1_VERTEX_ATTRIB6_4_NV, CONTEXT_BOOL(Eval.Map1Attrib[6]),
+ extra_NV_vertex_program },
+ { GL_MAP1_VERTEX_ATTRIB7_4_NV, CONTEXT_BOOL(Eval.Map1Attrib[7]),
+ extra_NV_vertex_program },
+ { GL_MAP1_VERTEX_ATTRIB8_4_NV, CONTEXT_BOOL(Eval.Map1Attrib[8]),
+ extra_NV_vertex_program },
+ { GL_MAP1_VERTEX_ATTRIB9_4_NV, CONTEXT_BOOL(Eval.Map1Attrib[9]),
+ extra_NV_vertex_program },
+ { GL_MAP1_VERTEX_ATTRIB10_4_NV, CONTEXT_BOOL(Eval.Map1Attrib[10]),
+ extra_NV_vertex_program },
+ { GL_MAP1_VERTEX_ATTRIB11_4_NV, CONTEXT_BOOL(Eval.Map1Attrib[11]),
+ extra_NV_vertex_program },
+ { GL_MAP1_VERTEX_ATTRIB12_4_NV, CONTEXT_BOOL(Eval.Map1Attrib[12]),
+ extra_NV_vertex_program },
+ { GL_MAP1_VERTEX_ATTRIB13_4_NV, CONTEXT_BOOL(Eval.Map1Attrib[13]),
+ extra_NV_vertex_program },
+ { GL_MAP1_VERTEX_ATTRIB14_4_NV, CONTEXT_BOOL(Eval.Map1Attrib[14]),
+ extra_NV_vertex_program },
+ { GL_MAP1_VERTEX_ATTRIB15_4_NV, CONTEXT_BOOL(Eval.Map1Attrib[15]),
+ extra_NV_vertex_program },
+
+ /* GL_NV_fragment_program */
+ { GL_FRAGMENT_PROGRAM_NV, CONTEXT_BOOL(FragmentProgram.Enabled),
+ extra_NV_fragment_program },
+ { GL_FRAGMENT_PROGRAM_BINDING_NV, LOC_CUSTOM, TYPE_INT, 0,
+ extra_NV_fragment_program },
+ { GL_MAX_FRAGMENT_PROGRAM_LOCAL_PARAMETERS_NV,
+ CONST(MAX_NV_FRAGMENT_PROGRAM_PARAMS),
+ extra_NV_fragment_program },
+
+ /* GL_NV_texture_rectangle */
+ { GL_TEXTURE_RECTANGLE_NV,
+ LOC_CUSTOM, TYPE_BOOLEAN, 0, extra_NV_texture_rectangle },
+ { GL_TEXTURE_BINDING_RECTANGLE_NV,
+ LOC_CUSTOM, TYPE_INT, TEXTURE_RECT_INDEX, extra_NV_texture_rectangle },
+ { GL_MAX_RECTANGLE_TEXTURE_SIZE_NV,
+ CONTEXT_INT(Const.MaxTextureRectSize), extra_NV_texture_rectangle },
+
+ /* GL_EXT_stencil_two_side */
+ { GL_STENCIL_TEST_TWO_SIDE_EXT, CONTEXT_BOOL(Stencil.TestTwoSide),
+ extra_EXT_stencil_two_side },
+ { GL_ACTIVE_STENCIL_FACE_EXT, LOC_CUSTOM, TYPE_ENUM, NO_OFFSET, NO_EXTRA },
+
+ /* GL_NV_light_max_exponent */
+ { GL_MAX_SHININESS_NV, CONTEXT_FLOAT(Const.MaxShininess),
+ extra_NV_light_max_exponent },
+ { GL_MAX_SPOT_EXPONENT_NV, CONTEXT_FLOAT(Const.MaxSpotExponent),
+ extra_NV_light_max_exponent },
+
+ /* GL_NV_primitive_restart */
+ { GL_PRIMITIVE_RESTART_NV, CONTEXT_BOOL(Array.PrimitiveRestart),
+ extra_NV_primitive_restart },
+ { GL_PRIMITIVE_RESTART_INDEX_NV, CONTEXT_INT(Array.RestartIndex),
+ extra_NV_primitive_restart },
+
+ /* GL_ARB_vertex_buffer_object */
+ { GL_INDEX_ARRAY_BUFFER_BINDING_ARB, LOC_CUSTOM, TYPE_INT,
+ offsetof(struct gl_array_object, Index.BufferObj), NO_EXTRA },
+ { GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB, LOC_CUSTOM, TYPE_INT,
+ offsetof(struct gl_array_object, EdgeFlag.BufferObj), NO_EXTRA },
+ { GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB, LOC_CUSTOM, TYPE_INT,
+ offsetof(struct gl_array_object, SecondaryColor.BufferObj), NO_EXTRA },
+ { GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB, LOC_CUSTOM, TYPE_INT,
+ offsetof(struct gl_array_object, FogCoord.BufferObj), NO_EXTRA },
+
+ /* GL_EXT_pixel_buffer_object */
+ { GL_PIXEL_PACK_BUFFER_BINDING_EXT, LOC_CUSTOM, TYPE_INT, 0,
+ extra_EXT_pixel_buffer_object },
+ { GL_PIXEL_UNPACK_BUFFER_BINDING_EXT, LOC_CUSTOM, TYPE_INT, 0,
+ extra_EXT_pixel_buffer_object },
+
+ /* GL_ARB_vertex_program */
+ { GL_VERTEX_PROGRAM_ARB, /* == GL_VERTEX_PROGRAM_NV */
+ CONTEXT_BOOL(VertexProgram.Enabled),
+ extra_ARB_vertex_program_NV_vertex_program },
+ { GL_VERTEX_PROGRAM_POINT_SIZE_ARB, /* == GL_VERTEX_PROGRAM_POINT_SIZE_NV*/
+ CONTEXT_BOOL(VertexProgram.PointSizeEnabled),
+ extra_ARB_vertex_program_NV_vertex_program },
+ { GL_VERTEX_PROGRAM_TWO_SIDE_ARB, /* == GL_VERTEX_PROGRAM_TWO_SIDE_NV */
+ CONTEXT_BOOL(VertexProgram.TwoSideEnabled),
+ extra_ARB_vertex_program_NV_vertex_program },
+ { GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB, /* == GL_MAX_TRACK_MATRIX_STACK_DEPTH_NV */
+ CONTEXT_INT(Const.MaxProgramMatrixStackDepth),
+ extra_ARB_vertex_program_ARB_fragment_program_NV_vertex_program },
+ { GL_MAX_PROGRAM_MATRICES_ARB, /* == GL_MAX_TRACK_MATRICES_NV */
+ CONTEXT_INT(Const.MaxProgramMatrices),
+ extra_ARB_vertex_program_ARB_fragment_program_NV_vertex_program },
+ { GL_CURRENT_MATRIX_STACK_DEPTH_ARB, /* == GL_CURRENT_MATRIX_STACK_DEPTH_NV */
+ LOC_CUSTOM, TYPE_INT, 0,
+ extra_ARB_vertex_program_ARB_fragment_program_NV_vertex_program },
+
+ { GL_CURRENT_MATRIX_ARB, /* == GL_CURRENT_MATRIX_NV */
+ LOC_CUSTOM, TYPE_MATRIX, 0,
+ extra_ARB_vertex_program_ARB_fragment_program_NV_vertex_program },
+ { GL_TRANSPOSE_CURRENT_MATRIX_ARB, /* == GL_CURRENT_MATRIX_NV */
+ LOC_CUSTOM, TYPE_MATRIX, 0,
+ extra_ARB_vertex_program_ARB_fragment_program },
+
+ { GL_PROGRAM_ERROR_POSITION_ARB, /* == GL_PROGRAM_ERROR_POSITION_NV */
+ CONTEXT_INT(Program.ErrorPos),
+ extra_NV_vertex_program_ARB_vertex_program_ARB_fragment_program_NV_vertex_program },
+
+ /* GL_ARB_fragment_program */
+ { GL_FRAGMENT_PROGRAM_ARB, CONTEXT_BOOL(FragmentProgram.Enabled),
+ extra_ARB_fragment_program },
+
+ /* GL_EXT_depth_bounds_test */
+ { GL_DEPTH_BOUNDS_TEST_EXT, CONTEXT_BOOL(Depth.BoundsTest),
+ extra_EXT_depth_bounds_test },
+ { GL_DEPTH_BOUNDS_EXT, CONTEXT_FLOAT2(Depth.BoundsMin),
+ extra_EXT_depth_bounds_test },
+
+ /* GL_ARB_depth_clamp*/
+ { GL_DEPTH_CLAMP, CONTEXT_BOOL(Transform.DepthClamp),
+ extra_ARB_depth_clamp },
+
+ /* GL_ARB_draw_buffers */
+ { GL_DRAW_BUFFER0_ARB, BUFFER_ENUM(ColorDrawBuffer[0]), NO_EXTRA },
+ { GL_DRAW_BUFFER1_ARB, BUFFER_ENUM(ColorDrawBuffer[1]),
+ extra_valid_draw_buffer },
+ { GL_DRAW_BUFFER2_ARB, BUFFER_ENUM(ColorDrawBuffer[2]),
+ extra_valid_draw_buffer },
+ { GL_DRAW_BUFFER3_ARB, BUFFER_ENUM(ColorDrawBuffer[3]),
+ extra_valid_draw_buffer },
+ { GL_DRAW_BUFFER4_ARB, BUFFER_ENUM(ColorDrawBuffer[4]),
+ extra_valid_draw_buffer },
+ { GL_DRAW_BUFFER5_ARB, BUFFER_ENUM(ColorDrawBuffer[5]),
+ extra_valid_draw_buffer },
+ { GL_DRAW_BUFFER6_ARB, BUFFER_ENUM(ColorDrawBuffer[6]),
+ extra_valid_draw_buffer },
+ { GL_DRAW_BUFFER7_ARB, BUFFER_ENUM(ColorDrawBuffer[7]),
+ extra_valid_draw_buffer },
+
+ /* GL_ATI_fragment_shader */
+ { GL_NUM_FRAGMENT_REGISTERS_ATI, CONST(6), extra_ATI_fragment_shader },
+ { GL_NUM_FRAGMENT_CONSTANTS_ATI, CONST(8), extra_ATI_fragment_shader },
+ { GL_NUM_PASSES_ATI, CONST(2), extra_ATI_fragment_shader },
+ { GL_NUM_INSTRUCTIONS_PER_PASS_ATI, CONST(8), extra_ATI_fragment_shader },
+ { GL_NUM_INSTRUCTIONS_TOTAL_ATI, CONST(16), extra_ATI_fragment_shader },
+ { GL_COLOR_ALPHA_PAIRING_ATI, CONST(GL_TRUE), extra_ATI_fragment_shader },
+ { GL_NUM_LOOPBACK_COMPONENTS_ATI, CONST(3), extra_ATI_fragment_shader },
+ { GL_NUM_INPUT_INTERPOLATOR_COMPONENTS_ATI,
+ CONST(3), extra_ATI_fragment_shader },
+
+ /* GL_EXT_framebuffer_object */
+ { GL_MAX_COLOR_ATTACHMENTS_EXT, CONTEXT_INT(Const.MaxColorAttachments),
+ extra_EXT_framebuffer_object },
+
+ /* GL_EXT_framebuffer_blit
+ * NOTE: GL_DRAW_FRAMEBUFFER_BINDING_EXT == GL_FRAMEBUFFER_BINDING_EXT */
+ { GL_READ_FRAMEBUFFER_BINDING_EXT, LOC_CUSTOM, TYPE_INT, 0,
+ extra_EXT_framebuffer_blit },
+
+ /* GL_EXT_provoking_vertex */
+ { GL_PROVOKING_VERTEX_EXT,
+ CONTEXT_ENUM(Light.ProvokingVertex), extra_EXT_provoking_vertex },
+ { GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION_EXT,
+ CONTEXT_BOOL(Const.QuadsFollowProvokingVertexConvention),
+ extra_EXT_provoking_vertex },
+
+ /* GL_ARB_framebuffer_object */
+ { GL_MAX_SAMPLES, CONTEXT_INT(Const.MaxSamples),
+ extra_ARB_framebuffer_object_EXT_framebuffer_multisample },
+
+ /* GL_APPLE_vertex_array_object */
+ { GL_VERTEX_ARRAY_BINDING_APPLE, ARRAY_INT(Name),
+ extra_APPLE_vertex_array_object },
+
+ /* GL_ARB_seamless_cube_map */
+ { GL_TEXTURE_CUBE_MAP_SEAMLESS,
+ CONTEXT_BOOL(Texture.CubeMapSeamless), extra_ARB_seamless_cube_map },
+
+ /* GL_ARB_sync */
+ { GL_MAX_SERVER_WAIT_TIMEOUT,
+ CONTEXT_INT64(Const.MaxServerWaitTimeout), extra_ARB_sync },
+
+ /* GL_EXT_texture_integer */
+ { GL_RGBA_INTEGER_MODE_EXT, BUFFER_BOOL(_IntegerColor),
+ extra_EXT_texture_integer },
+
+ /* GL_EXT_transform_feedback */
+ { GL_TRANSFORM_FEEDBACK_BUFFER_BINDING, LOC_CUSTOM, TYPE_INT, 0,
+ extra_EXT_transform_feedback },
+ { GL_RASTERIZER_DISCARD, CONTEXT_BOOL(TransformFeedback.RasterDiscard),
+ extra_EXT_transform_feedback },
+ { GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS,
+ CONTEXT_INT(Const.MaxTransformFeedbackInterleavedComponents),
+ extra_EXT_transform_feedback },
+ { GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS,
+ CONTEXT_INT(Const.MaxTransformFeedbackSeparateAttribs),
+ extra_EXT_transform_feedback },
+ { GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS,
+ CONTEXT_INT(Const.MaxTransformFeedbackSeparateComponents),
+ extra_EXT_transform_feedback },
+
+ /* GL_ARB_transform_feedback2 */
+ { GL_TRANSFORM_FEEDBACK_BUFFER_PAUSED, LOC_CUSTOM, TYPE_BOOLEAN, 0,
+ extra_ARB_transform_feedback2 },
+ { GL_TRANSFORM_FEEDBACK_BUFFER_ACTIVE, LOC_CUSTOM, TYPE_BOOLEAN, 0,
+ extra_ARB_transform_feedback2 },
+ { GL_TRANSFORM_FEEDBACK_BINDING, LOC_CUSTOM, TYPE_INT, 0,
+ extra_ARB_transform_feedback2 },
+
+ /* GL_ARB_geometry_shader4 */
+ { GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_ARB,
+ CONTEXT_INT(Const.MaxGeometryTextureImageUnits),
+ extra_ARB_geometry_shader4 },
+ { GL_MAX_GEOMETRY_OUTPUT_VERTICES_ARB,
+ CONTEXT_INT(Const.MaxGeometryOutputVertices),
+ extra_ARB_geometry_shader4 },
+ { GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_ARB,
+ CONTEXT_INT(Const.MaxGeometryTotalOutputComponents),
+ extra_ARB_geometry_shader4 },
+ { GL_MAX_GEOMETRY_UNIFORM_COMPONENTS_ARB,
+ CONTEXT_INT(Const.GeometryProgram.MaxUniformComponents),
+ extra_ARB_geometry_shader4 },
+ { GL_MAX_GEOMETRY_VARYING_COMPONENTS_ARB,
+ CONTEXT_INT(Const.MaxGeometryVaryingComponents),
+ extra_ARB_geometry_shader4 },
+ { GL_MAX_VERTEX_VARYING_COMPONENTS_ARB,
+ CONTEXT_INT(Const.MaxVertexVaryingComponents),
+ extra_ARB_geometry_shader4 },
+
+ /* GL_ARB_color_buffer_float */
+ { GL_RGBA_FLOAT_MODE_ARB, BUFFER_FIELD(Visual.floatMode, TYPE_BOOLEAN), 0 },
+
+ /* GL_EXT_gpu_shader4 / GL 3.0 */
+ { GL_MIN_PROGRAM_TEXEL_OFFSET,
+ CONTEXT_INT(Const.MinProgramTexelOffset),
+ extra_EXT_gpu_shader4 },
+ { GL_MAX_PROGRAM_TEXEL_OFFSET,
+ CONTEXT_INT(Const.MaxProgramTexelOffset),
+ extra_EXT_gpu_shader4 },
+
+ /* GL_ARB_texture_buffer_object */
+ { GL_MAX_TEXTURE_BUFFER_SIZE_ARB, CONTEXT_INT(Const.MaxTextureBufferSize),
+ extra_ARB_texture_buffer_object },
+ { GL_TEXTURE_BINDING_BUFFER_ARB, LOC_CUSTOM, TYPE_INT, 0,
+ extra_ARB_texture_buffer_object },
+ { GL_TEXTURE_BUFFER_DATA_STORE_BINDING_ARB, LOC_CUSTOM, TYPE_INT,
+ TEXTURE_BUFFER_INDEX, extra_ARB_texture_buffer_object },
+ { GL_TEXTURE_BUFFER_FORMAT_ARB, LOC_CUSTOM, TYPE_INT, 0,
+ extra_ARB_texture_buffer_object },
+ { GL_TEXTURE_BUFFER_ARB, LOC_CUSTOM, TYPE_INT, 0,
+ extra_ARB_texture_buffer_object },
+
+ /* GL_ARB_sampler_objects / GL 3.3 */
+ { GL_SAMPLER_BINDING,
+ LOC_CUSTOM, TYPE_INT, GL_SAMPLER_BINDING, extra_ARB_sampler_objects },
+
+ /* GL 3.0 */
+ { GL_NUM_EXTENSIONS, LOC_CUSTOM, TYPE_INT, 0, extra_version_30 },
+ { GL_MAJOR_VERSION, CONTEXT_INT(VersionMajor), extra_version_30 },
+ { GL_MINOR_VERSION, CONTEXT_INT(VersionMinor), extra_version_30 },
+ { GL_CONTEXT_FLAGS, CONTEXT_INT(Const.ContextFlags), extra_version_30 },
+
+ /* GL3.0 / GL_EXT_framebuffer_sRGB */
+ { GL_FRAMEBUFFER_SRGB_EXT, CONTEXT_BOOL(Color.sRGBEnabled), extra_EXT_framebuffer_sRGB },
+ { GL_FRAMEBUFFER_SRGB_CAPABLE_EXT, BUFFER_INT(Visual.sRGBCapable), extra_EXT_framebuffer_sRGB },
+
+ /* GL 3.1 */
+ /* NOTE: different enum values for GL_PRIMITIVE_RESTART_NV
+ * vs. GL_PRIMITIVE_RESTART!
+ */
+ { GL_PRIMITIVE_RESTART, CONTEXT_BOOL(Array.PrimitiveRestart),
+ extra_version_31 },
+ { GL_PRIMITIVE_RESTART_INDEX, CONTEXT_INT(Array.RestartIndex),
+ extra_version_31 },
+
+
+ /* GL 3.2 */
+ { GL_CONTEXT_PROFILE_MASK, CONTEXT_INT(Const.ProfileMask),
+ extra_version_32 },
+
+ /* GL_ARB_robustness */
+ { GL_RESET_NOTIFICATION_STRATEGY_ARB, CONTEXT_ENUM(Const.ResetStrategy), NO_EXTRA },
+#endif /* FEATURE_GL */
+};
+
+/* All we need now is a way to look up the value struct from the enum.
+ * The code generated by gcc for the old generated big switch
+ * statement is a big, balanced, open coded if/else tree, essentially
+ * an unrolled binary search. It would be natural to sort the new
+ * enum table and use bsearch(), but we will use a read-only hash
+ * table instead. bsearch() has a nice guaranteed worst case
+ * performance, but we're also guaranteed to hit that worst case
+ * (log2(n) iterations) for about half the enums. Instead, using an
+ * open addressing hash table, we can find the enum on the first try
+ * for 80% of the enums, 1 collision for 10% and never more than 5
+ * collisions for any enum (typical numbers). And the code is very
+ * simple, even though it feels a little magic. */
+
+static unsigned short table[1024];
+static const int prime_factor = 89, prime_step = 281;
+
+#ifdef GET_DEBUG
+static void
+print_table_stats(void)
+{
+ int i, j, collisions[11], count, hash, mask;
+ const struct value_desc *d;
+
+ count = 0;
+ mask = Elements(table) - 1;
+ memset(collisions, 0, sizeof collisions);
+
+ for (i = 0; i < Elements(table); i++) {
+ if (!table[i])
+ continue;
+ count++;
+ d = &values[table[i]];
+ hash = (d->pname * prime_factor);
+ j = 0;
+ while (1) {
+ if (values[table[hash & mask]].pname == d->pname)
+ break;
+ hash += prime_step;
+ j++;
+ }
+
+ if (j < 10)
+ collisions[j]++;
+ else
+ collisions[10]++;
+ }
+
+ printf("number of enums: %d (total %d)\n", count, Elements(values));
+ for (i = 0; i < Elements(collisions) - 1; i++)
+ if (collisions[i] > 0)
+ printf(" %d enums with %d %scollisions\n",
+ collisions[i], i, i == 10 ? "or more " : "");
+}
+#endif
+
+/**
+ * Initialize the enum hash for a given API
+ *
+ * This is called from one_time_init() to insert the enum values that
+ * are valid for the API in question into the enum hash table.
+ *
+ * \param the current context, for determining the API in question
+ */
+void _mesa_init_get_hash(struct gl_context *ctx)
+{
+ int i, hash, index, mask;
+ int api_mask = 0, api_bit;
+
+ mask = Elements(table) - 1;
+ api_bit = 1 << ctx->API;
+
+ for (i = 0; i < Elements(values); i++) {
+ if (values[i].type == TYPE_API_MASK) {
+ api_mask = values[i].offset;
+ continue;
+ }
+ if (!(api_mask & api_bit))
+ continue;
+
+ hash = (values[i].pname * prime_factor) & mask;
+ while (1) {
+ index = hash & mask;
+ if (!table[index]) {
+ table[index] = i;
+ break;
+ }
+ hash += prime_step;
+ }
+ }
+
+#ifdef GET_DEBUG
+ print_table_stats();
+#endif
+}
+
+/**
+ * Handle irregular enums
+ *
+ * Some values don't conform to the "well-known type at context
+ * pointer + offset" pattern, so we have this function to catch all
+ * the corner cases. Typically, it's a computed value or a one-off
+ * pointer to a custom struct or something.
+ *
+ * In this case we can't return a pointer to the value, so we'll have
+ * to use the temporary variable 'v' declared back in the calling
+ * glGet*v() function to store the result.
+ *
+ * \param ctx the current context
+ * \param d the struct value_desc that describes the enum
+ * \param v pointer to the tmp declared in the calling glGet*v() function
+ */
+static void
+find_custom_value(struct gl_context *ctx, const struct value_desc *d, union value *v)
+{
+ struct gl_buffer_object **buffer_obj;
+ struct gl_client_array *array;
+ GLuint unit, *p;
+
+ switch (d->pname) {
+ case GL_TEXTURE_1D:
+ case GL_TEXTURE_2D:
+ case GL_TEXTURE_3D:
+ case GL_TEXTURE_1D_ARRAY_EXT:
+ case GL_TEXTURE_2D_ARRAY_EXT:
+ case GL_TEXTURE_CUBE_MAP_ARB:
+ case GL_TEXTURE_RECTANGLE_NV:
+ v->value_bool = _mesa_IsEnabled(d->pname);
+ break;
+
+ case GL_LINE_STIPPLE_PATTERN:
+ /* This is the only GLushort, special case it here by promoting
+ * to an int rather than introducing a new type. */
+ v->value_int = ctx->Line.StipplePattern;
+ break;
+
+ case GL_CURRENT_RASTER_TEXTURE_COORDS:
+ unit = ctx->Texture.CurrentUnit;
+ v->value_float_4[0] = ctx->Current.RasterTexCoords[unit][0];
+ v->value_float_4[1] = ctx->Current.RasterTexCoords[unit][1];
+ v->value_float_4[2] = ctx->Current.RasterTexCoords[unit][2];
+ v->value_float_4[3] = ctx->Current.RasterTexCoords[unit][3];
+ break;
+
+ case GL_CURRENT_TEXTURE_COORDS:
+ unit = ctx->Texture.CurrentUnit;
+ v->value_float_4[0] = ctx->Current.Attrib[VERT_ATTRIB_TEX0 + unit][0];
+ v->value_float_4[1] = ctx->Current.Attrib[VERT_ATTRIB_TEX0 + unit][1];
+ v->value_float_4[2] = ctx->Current.Attrib[VERT_ATTRIB_TEX0 + unit][2];
+ v->value_float_4[3] = ctx->Current.Attrib[VERT_ATTRIB_TEX0 + unit][3];
+ break;
+
+ case GL_COLOR_WRITEMASK:
+ v->value_int_4[0] = ctx->Color.ColorMask[0][RCOMP] ? 1 : 0;
+ v->value_int_4[1] = ctx->Color.ColorMask[0][GCOMP] ? 1 : 0;
+ v->value_int_4[2] = ctx->Color.ColorMask[0][BCOMP] ? 1 : 0;
+ v->value_int_4[3] = ctx->Color.ColorMask[0][ACOMP] ? 1 : 0;
+ break;
+
+ case GL_EDGE_FLAG:
+ v->value_bool = ctx->Current.Attrib[VERT_ATTRIB_EDGEFLAG][0] == 1.0;
+ break;
+
+ case GL_READ_BUFFER:
+ v->value_enum = ctx->ReadBuffer->ColorReadBuffer;
+ break;
+
+ case GL_MAP2_GRID_DOMAIN:
+ v->value_float_4[0] = ctx->Eval.MapGrid2u1;
+ v->value_float_4[1] = ctx->Eval.MapGrid2u2;
+ v->value_float_4[2] = ctx->Eval.MapGrid2v1;
+ v->value_float_4[3] = ctx->Eval.MapGrid2v2;
+ break;
+
+ case GL_TEXTURE_STACK_DEPTH:
+ unit = ctx->Texture.CurrentUnit;
+ v->value_int = ctx->TextureMatrixStack[unit].Depth + 1;
+ break;
+ case GL_TEXTURE_MATRIX:
+ unit = ctx->Texture.CurrentUnit;
+ v->value_matrix = ctx->TextureMatrixStack[unit].Top;
+ break;
+
+ case GL_TEXTURE_COORD_ARRAY:
+ case GL_TEXTURE_COORD_ARRAY_SIZE:
+ case GL_TEXTURE_COORD_ARRAY_TYPE:
+ case GL_TEXTURE_COORD_ARRAY_STRIDE:
+ array = &ctx->Array.ArrayObj->TexCoord[ctx->Array.ActiveTexture];
+ v->value_int = *(GLuint *) ((char *) array + d->offset);
+ break;
+
+ case GL_ACTIVE_TEXTURE_ARB:
+ v->value_int = GL_TEXTURE0_ARB + ctx->Texture.CurrentUnit;
+ break;
+ case GL_CLIENT_ACTIVE_TEXTURE_ARB:
+ v->value_int = GL_TEXTURE0_ARB + ctx->Array.ActiveTexture;
+ break;
+
+ case GL_MODELVIEW_STACK_DEPTH:
+ case GL_PROJECTION_STACK_DEPTH:
+ v->value_int = *(GLint *) ((char *) ctx + d->offset) + 1;
+ break;
+
+ case GL_MAX_TEXTURE_SIZE:
+ case GL_MAX_3D_TEXTURE_SIZE:
+ case GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB:
+ p = (GLuint *) ((char *) ctx + d->offset);
+ v->value_int = 1 << (*p - 1);
+ break;
+
+ case GL_SCISSOR_BOX:
+ v->value_int_4[0] = ctx->Scissor.X;
+ v->value_int_4[1] = ctx->Scissor.Y;
+ v->value_int_4[2] = ctx->Scissor.Width;
+ v->value_int_4[3] = ctx->Scissor.Height;
+ break;
+
+ case GL_LIST_INDEX:
+ v->value_int =
+ ctx->ListState.CurrentList ? ctx->ListState.CurrentList->Name : 0;
+ break;
+ case GL_LIST_MODE:
+ if (!ctx->CompileFlag)
+ v->value_enum = 0;
+ else if (ctx->ExecuteFlag)
+ v->value_enum = GL_COMPILE_AND_EXECUTE;
+ else
+ v->value_enum = GL_COMPILE;
+ break;
+
+ case GL_VIEWPORT:
+ v->value_int_4[0] = ctx->Viewport.X;
+ v->value_int_4[1] = ctx->Viewport.Y;
+ v->value_int_4[2] = ctx->Viewport.Width;
+ v->value_int_4[3] = ctx->Viewport.Height;
+ break;
+
+ case GL_ACTIVE_STENCIL_FACE_EXT:
+ v->value_enum = ctx->Stencil.ActiveFace ? GL_BACK : GL_FRONT;
+ break;
+
+ case GL_STENCIL_FAIL:
+ v->value_enum = ctx->Stencil.FailFunc[ctx->Stencil.ActiveFace];
+ break;
+ case GL_STENCIL_FUNC:
+ v->value_enum = ctx->Stencil.Function[ctx->Stencil.ActiveFace];
+ break;
+ case GL_STENCIL_PASS_DEPTH_FAIL:
+ v->value_enum = ctx->Stencil.ZFailFunc[ctx->Stencil.ActiveFace];
+ break;
+ case GL_STENCIL_PASS_DEPTH_PASS:
+ v->value_enum = ctx->Stencil.ZPassFunc[ctx->Stencil.ActiveFace];
+ break;
+ case GL_STENCIL_REF:
+ v->value_int = ctx->Stencil.Ref[ctx->Stencil.ActiveFace];
+ break;
+ case GL_STENCIL_VALUE_MASK:
+ v->value_int = ctx->Stencil.ValueMask[ctx->Stencil.ActiveFace];
+ break;
+ case GL_STENCIL_WRITEMASK:
+ v->value_int = ctx->Stencil.WriteMask[ctx->Stencil.ActiveFace];
+ break;
+
+ case GL_NUM_EXTENSIONS:
+ v->value_int = _mesa_get_extension_count(ctx);
+ break;
+
+ case GL_IMPLEMENTATION_COLOR_READ_TYPE_OES:
+ v->value_int = _mesa_get_color_read_type(ctx);
+ break;
+ case GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES:
+ v->value_int = _mesa_get_color_read_format(ctx);
+ break;
+
+ case GL_CURRENT_MATRIX_STACK_DEPTH_ARB:
+ v->value_int = ctx->CurrentStack->Depth + 1;
+ break;
+ case GL_CURRENT_MATRIX_ARB:
+ case GL_TRANSPOSE_CURRENT_MATRIX_ARB:
+ v->value_matrix = ctx->CurrentStack->Top;
+ break;
+
+ case GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB:
+ v->value_int = _mesa_get_compressed_formats(ctx, NULL, GL_FALSE);
+ break;
+ case GL_COMPRESSED_TEXTURE_FORMATS_ARB:
+ v->value_int_n.n =
+ _mesa_get_compressed_formats(ctx, v->value_int_n.ints, GL_FALSE);
+ ASSERT(v->value_int_n.n <= 100);
+ break;
+
+ case GL_MAX_VARYING_FLOATS_ARB:
+ v->value_int = ctx->Const.MaxVarying * 4;
+ break;
+
+ /* Various object names */
+
+ case GL_TEXTURE_BINDING_1D:
+ case GL_TEXTURE_BINDING_2D:
+ case GL_TEXTURE_BINDING_3D:
+ case GL_TEXTURE_BINDING_1D_ARRAY_EXT:
+ case GL_TEXTURE_BINDING_2D_ARRAY_EXT:
+ case GL_TEXTURE_BINDING_CUBE_MAP_ARB:
+ case GL_TEXTURE_BINDING_RECTANGLE_NV:
+ unit = ctx->Texture.CurrentUnit;
+ v->value_int =
+ ctx->Texture.Unit[unit].CurrentTex[d->offset]->Name;
+ break;
+
+ /* GL_ARB_vertex_buffer_object */
+ case GL_VERTEX_ARRAY_BUFFER_BINDING_ARB:
+ case GL_NORMAL_ARRAY_BUFFER_BINDING_ARB:
+ case GL_COLOR_ARRAY_BUFFER_BINDING_ARB:
+ case GL_INDEX_ARRAY_BUFFER_BINDING_ARB:
+ case GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB:
+ case GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB:
+ case GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB:
+ buffer_obj = (struct gl_buffer_object **)
+ ((char *) ctx->Array.ArrayObj + d->offset);
+ v->value_int = (*buffer_obj)->Name;
+ break;
+ case GL_ARRAY_BUFFER_BINDING_ARB:
+ v->value_int = ctx->Array.ArrayBufferObj->Name;
+ break;
+ case GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB:
+ v->value_int =
+ ctx->Array.ArrayObj->TexCoord[ctx->Array.ActiveTexture].BufferObj->Name;
+ break;
+ case GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB:
+ v->value_int = ctx->Array.ElementArrayBufferObj->Name;
+ break;
+
+ /* ARB_copy_buffer */
+ case GL_COPY_READ_BUFFER:
+ v->value_int = ctx->CopyReadBuffer->Name;
+ break;
+ case GL_COPY_WRITE_BUFFER:
+ v->value_int = ctx->CopyWriteBuffer->Name;
+ break;
+
+ case GL_FRAGMENT_PROGRAM_BINDING_NV:
+ v->value_int =
+ ctx->FragmentProgram.Current ? ctx->FragmentProgram.Current->Base.Id : 0;
+ break;
+ case GL_VERTEX_PROGRAM_BINDING_NV:
+ v->value_int =
+ ctx->VertexProgram.Current ? ctx->VertexProgram.Current->Base.Id : 0;
+ break;
+ case GL_PIXEL_PACK_BUFFER_BINDING_EXT:
+ v->value_int = ctx->Pack.BufferObj->Name;
+ break;
+ case GL_PIXEL_UNPACK_BUFFER_BINDING_EXT:
+ v->value_int = ctx->Unpack.BufferObj->Name;
+ break;
+ case GL_TRANSFORM_FEEDBACK_BUFFER_BINDING:
+ v->value_int = ctx->TransformFeedback.CurrentBuffer->Name;
+ break;
+ case GL_TRANSFORM_FEEDBACK_BUFFER_PAUSED:
+ v->value_int = ctx->TransformFeedback.CurrentObject->Paused;
+ break;
+ case GL_TRANSFORM_FEEDBACK_BUFFER_ACTIVE:
+ v->value_int = ctx->TransformFeedback.CurrentObject->Active;
+ break;
+ case GL_TRANSFORM_FEEDBACK_BINDING:
+ v->value_int = ctx->TransformFeedback.CurrentObject->Name;
+ break;
+ case GL_CURRENT_PROGRAM:
+ v->value_int =
+ ctx->Shader.ActiveProgram ? ctx->Shader.ActiveProgram->Name : 0;
+ break;
+ case GL_READ_FRAMEBUFFER_BINDING_EXT:
+ v->value_int = ctx->ReadBuffer->Name;
+ break;
+ case GL_RENDERBUFFER_BINDING_EXT:
+ v->value_int =
+ ctx->CurrentRenderbuffer ? ctx->CurrentRenderbuffer->Name : 0;
+ break;
+ case GL_POINT_SIZE_ARRAY_BUFFER_BINDING_OES:
+ v->value_int = ctx->Array.ArrayObj->PointSize.BufferObj->Name;
+ break;
+
+ case GL_FOG_COLOR:
+ if(ctx->Color._ClampFragmentColor)
+ COPY_4FV(v->value_float_4, ctx->Fog.Color);
+ else
+ COPY_4FV(v->value_float_4, ctx->Fog.ColorUnclamped);
+ break;
+ case GL_COLOR_CLEAR_VALUE:
+ if(ctx->Color._ClampFragmentColor)
+ COPY_4FV(v->value_float_4, ctx->Color.ClearColor);
+ else
+ COPY_4FV(v->value_float_4, ctx->Color.ClearColorUnclamped);
+ break;
+ case GL_BLEND_COLOR_EXT:
+ if(ctx->Color._ClampFragmentColor)
+ COPY_4FV(v->value_float_4, ctx->Color.BlendColor);
+ else
+ COPY_4FV(v->value_float_4, ctx->Color.BlendColorUnclamped);
+ break;
+ case GL_ALPHA_TEST_REF:
+ if(ctx->Color._ClampFragmentColor)
+ v->value_float = ctx->Color.AlphaRef;
+ else
+ v->value_float = ctx->Color.AlphaRefUnclamped;
+ break;
+ case GL_MAX_VERTEX_UNIFORM_VECTORS:
+ v->value_int = ctx->Const.VertexProgram.MaxUniformComponents / 4;
+ break;
+
+ case GL_MAX_FRAGMENT_UNIFORM_VECTORS:
+ v->value_int = ctx->Const.FragmentProgram.MaxUniformComponents / 4;
+ break;
+
+ /* GL_ARB_texture_buffer_object */
+ case GL_TEXTURE_BUFFER_ARB:
+ v->value_int = ctx->Texture.BufferObject->Name;
+ break;
+ case GL_TEXTURE_BINDING_BUFFER_ARB:
+ unit = ctx->Texture.CurrentUnit;
+ v->value_int =
+ ctx->Texture.Unit[unit].CurrentTex[TEXTURE_BUFFER_INDEX]->Name;
+ break;
+ case GL_TEXTURE_BUFFER_DATA_STORE_BINDING_ARB:
+ {
+ struct gl_buffer_object *buf =
+ ctx->Texture.Unit[ctx->Texture.CurrentUnit]
+ .CurrentTex[TEXTURE_BUFFER_INDEX]->BufferObject;
+ v->value_int = buf ? buf->Name : 0;
+ }
+ break;
+ case GL_TEXTURE_BUFFER_FORMAT_ARB:
+ v->value_int = ctx->Texture.Unit[ctx->Texture.CurrentUnit]
+ .CurrentTex[TEXTURE_BUFFER_INDEX]->BufferObjectFormat;
+ break;
+
+ /* GL_ARB_sampler_objects */
+ case GL_SAMPLER_BINDING:
+ {
+ struct gl_sampler_object *samp =
+ ctx->Texture.Unit[ctx->Texture.CurrentUnit].Sampler;
+ v->value_int = samp ? samp->Name : 0;
+ }
+ break;
+ }
+}
+
+/**
+ * Check extra constraints on a struct value_desc descriptor
+ *
+ * If a struct value_desc has a non-NULL extra pointer, it means that
+ * there are a number of extra constraints to check or actions to
+ * perform. The extras is just an integer array where each integer
+ * encode different constraints or actions.
+ *
+ * \param ctx current context
+ * \param func name of calling glGet*v() function for error reporting
+ * \param d the struct value_desc that has the extra constraints
+ *
+ * \return GL_FALSE if one of the constraints was not satisfied,
+ * otherwise GL_TRUE.
+ */
+static GLboolean
+check_extra(struct gl_context *ctx, const char *func, const struct value_desc *d)
+{
+ const GLuint version = ctx->VersionMajor * 10 + ctx->VersionMinor;
+ int total, enabled;
+ const int *e;
+
+ total = 0;
+ enabled = 0;
+ for (e = d->extra; *e != EXTRA_END; e++)
+ switch (*e) {
+ case EXTRA_VERSION_30:
+ if (version >= 30) {
+ total++;
+ enabled++;
+ }
+ break;
+ case EXTRA_VERSION_31:
+ if (version >= 31) {
+ total++;
+ enabled++;
+ }
+ break;
+ case EXTRA_VERSION_32:
+ if (version >= 32) {
+ total++;
+ enabled++;
+ }
+ break;
+ case EXTRA_NEW_FRAG_CLAMP:
+ if (ctx->NewState & (_NEW_BUFFERS | _NEW_FRAG_CLAMP))
+ _mesa_update_state(ctx);
+ break;
+ case EXTRA_VERSION_ES2:
+ if (ctx->API == API_OPENGLES2) {
+ total++;
+ enabled++;
+ }
+ break;
+ case EXTRA_NEW_BUFFERS:
+ if (ctx->NewState & _NEW_BUFFERS)
+ _mesa_update_state(ctx);
+ break;
+ case EXTRA_FLUSH_CURRENT:
+ FLUSH_CURRENT(ctx, 0);
+ break;
+ case EXTRA_VALID_DRAW_BUFFER:
+ if (d->pname - GL_DRAW_BUFFER0_ARB >= ctx->Const.MaxDrawBuffers) {
+ _mesa_error(ctx, GL_INVALID_OPERATION, "%s(draw buffer %u)",
+ func, d->pname - GL_DRAW_BUFFER0_ARB);
+ return GL_FALSE;
+ }
+ break;
+ case EXTRA_VALID_TEXTURE_UNIT:
+ if (ctx->Texture.CurrentUnit >= ctx->Const.MaxTextureCoordUnits) {
+ _mesa_error(ctx, GL_INVALID_OPERATION, "%s(texture %u)",
+ func, ctx->Texture.CurrentUnit);
+ return GL_FALSE;
+ }
+ break;
+ case EXTRA_END:
+ break;
+ default: /* *e is a offset into the extension struct */
+ total++;
+ if (*(GLboolean *) ((char *) &ctx->Extensions + *e))
+ enabled++;
+ break;
+ }
+
+ if (total > 0 && enabled == 0) {
+ _mesa_error(ctx, GL_INVALID_ENUM, "%s(pname=%s)", func,
+ _mesa_lookup_enum_by_nr(d->pname));
+ return GL_FALSE;
+ }
+
+ return GL_TRUE;
+}
+
+static const struct value_desc error_value =
+ { 0, 0, TYPE_INVALID, NO_OFFSET, NO_EXTRA };
+
+/**
+ * Find the struct value_desc corresponding to the enum 'pname'.
+ *
+ * We hash the enum value to get an index into the 'table' array,
+ * which holds the index in the 'values' array of struct value_desc.
+ * Once we've found the entry, we do the extra checks, if any, then
+ * look up the value and return a pointer to it.
+ *
+ * If the value has to be computed (for example, it's the result of a
+ * function call or we need to add 1 to it), we use the tmp 'v' to
+ * store the result.
+ *
+ * \param func name of glGet*v() func for error reporting
+ * \param pname the enum value we're looking up
+ * \param p is were we return the pointer to the value
+ * \param v a tmp union value variable in the calling glGet*v() function
+ *
+ * \return the struct value_desc corresponding to the enum or a struct
+ * value_desc of TYPE_INVALID if not found. This lets the calling
+ * glGet*v() function jump right into a switch statement and
+ * handle errors there instead of having to check for NULL.
+ */
+static const struct value_desc *
+find_value(const char *func, GLenum pname, void **p, union value *v)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ struct gl_texture_unit *unit;
+ int mask, hash;
+ const struct value_desc *d;
+
+ mask = Elements(table) - 1;
+ hash = (pname * prime_factor);
+ while (1) {
+ d = &values[table[hash & mask]];
+
+ /* If the enum isn't valid, the hash walk ends with index 0,
+ * which is the API mask entry at the beginning of values[]. */
+ if (unlikely(d->type == TYPE_API_MASK)) {
+ _mesa_error(ctx, GL_INVALID_ENUM, "%s(pname=%s)", func,
+ _mesa_lookup_enum_by_nr(pname));
+ return &error_value;
+ }
+
+ if (likely(d->pname == pname))
+ break;
+
+ hash += prime_step;
+ }
+
+ if (unlikely(d->extra && !check_extra(ctx, func, d)))
+ return &error_value;
+
+ switch (d->location) {
+ case LOC_BUFFER:
+ *p = ((char *) ctx->DrawBuffer + d->offset);
+ return d;
+ case LOC_CONTEXT:
+ *p = ((char *) ctx + d->offset);
+ return d;
+ case LOC_ARRAY:
+ *p = ((char *) ctx->Array.ArrayObj + d->offset);
+ return d;
+ case LOC_TEXUNIT:
+ unit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit];
+ *p = ((char *) unit + d->offset);
+ return d;
+ case LOC_CUSTOM:
+ find_custom_value(ctx, d, v);
+ *p = v;
+ return d;
+ default:
+ assert(0);
+ break;
+ }
+
+ /* silence warning */
+ return &error_value;
+}
+
+static const int transpose[] = {
+ 0, 4, 8, 12,
+ 1, 5, 9, 13,
+ 2, 6, 10, 14,
+ 3, 7, 11, 15
+};
+
+void GLAPIENTRY
+_mesa_GetBooleanv(GLenum pname, GLboolean *params)
+{
+ const struct value_desc *d;
+ union value v;
+ GLmatrix *m;
+ int shift, i;
+ void *p;
+
+ d = find_value("glGetBooleanv", pname, &p, &v);
+ switch (d->type) {
+ case TYPE_INVALID:
+ break;
+ case TYPE_CONST:
+ params[0] = INT_TO_BOOLEAN(d->offset);
+ break;
+
+ case TYPE_FLOAT_4:
+ case TYPE_FLOATN_4:
+ params[3] = FLOAT_TO_BOOLEAN(((GLfloat *) p)[3]);
+ case TYPE_FLOAT_3:
+ case TYPE_FLOATN_3:
+ params[2] = FLOAT_TO_BOOLEAN(((GLfloat *) p)[2]);
+ case TYPE_FLOAT_2:
+ case TYPE_FLOATN_2:
+ params[1] = FLOAT_TO_BOOLEAN(((GLfloat *) p)[1]);
+ case TYPE_FLOAT:
+ case TYPE_FLOATN:
+ params[0] = FLOAT_TO_BOOLEAN(((GLfloat *) p)[0]);
+ break;
+
+ case TYPE_DOUBLEN:
+ params[0] = FLOAT_TO_BOOLEAN(((GLdouble *) p)[0]);
+ break;
+
+ case TYPE_INT_4:
+ params[3] = INT_TO_BOOLEAN(((GLint *) p)[3]);
+ case TYPE_INT_3:
+ params[2] = INT_TO_BOOLEAN(((GLint *) p)[2]);
+ case TYPE_INT_2:
+ case TYPE_ENUM_2:
+ params[1] = INT_TO_BOOLEAN(((GLint *) p)[1]);
+ case TYPE_INT:
+ case TYPE_ENUM:
+ params[0] = INT_TO_BOOLEAN(((GLint *) p)[0]);
+ break;
+
+ case TYPE_INT_N:
+ for (i = 0; i < v.value_int_n.n; i++)
+ params[i] = INT_TO_BOOLEAN(v.value_int_n.ints[i]);
+ break;
+
+ case TYPE_INT64:
+ params[0] = INT64_TO_BOOLEAN(((GLint64 *) p)[0]);
+ break;
+
+ case TYPE_BOOLEAN:
+ params[0] = ((GLboolean*) p)[0];
+ break;
+
+ case TYPE_MATRIX:
+ m = *(GLmatrix **) p;
+ for (i = 0; i < 16; i++)
+ params[i] = FLOAT_TO_BOOLEAN(m->m[i]);
+ break;
+
+ case TYPE_MATRIX_T:
+ m = *(GLmatrix **) p;
+ for (i = 0; i < 16; i++)
+ params[i] = FLOAT_TO_BOOLEAN(m->m[transpose[i]]);
+ break;
+
+ case TYPE_BIT_0:
+ case TYPE_BIT_1:
+ case TYPE_BIT_2:
+ case TYPE_BIT_3:
+ case TYPE_BIT_4:
+ case TYPE_BIT_5:
+ shift = d->type - TYPE_BIT_0;
+ params[0] = (*(GLbitfield *) p >> shift) & 1;
+ break;
+ }
+}
+
+void GLAPIENTRY
+_mesa_GetFloatv(GLenum pname, GLfloat *params)
+{
+ const struct value_desc *d;
+ union value v;
+ GLmatrix *m;
+ int shift, i;
+ void *p;
+
+ d = find_value("glGetFloatv", pname, &p, &v);
+ switch (d->type) {
+ case TYPE_INVALID:
+ break;
+ case TYPE_CONST:
+ params[0] = (GLfloat) d->offset;
+ break;
+
+ case TYPE_FLOAT_4:
+ case TYPE_FLOATN_4:
+ params[3] = ((GLfloat *) p)[3];
+ case TYPE_FLOAT_3:
+ case TYPE_FLOATN_3:
+ params[2] = ((GLfloat *) p)[2];
+ case TYPE_FLOAT_2:
+ case TYPE_FLOATN_2:
+ params[1] = ((GLfloat *) p)[1];
+ case TYPE_FLOAT:
+ case TYPE_FLOATN:
+ params[0] = ((GLfloat *) p)[0];
+ break;
+
+ case TYPE_DOUBLEN:
+ params[0] = ((GLdouble *) p)[0];
+ break;
+
+ case TYPE_INT_4:
+ params[3] = (GLfloat) (((GLint *) p)[3]);
+ case TYPE_INT_3:
+ params[2] = (GLfloat) (((GLint *) p)[2]);
+ case TYPE_INT_2:
+ case TYPE_ENUM_2:
+ params[1] = (GLfloat) (((GLint *) p)[1]);
+ case TYPE_INT:
+ case TYPE_ENUM:
+ params[0] = (GLfloat) (((GLint *) p)[0]);
+ break;
+
+ case TYPE_INT_N:
+ for (i = 0; i < v.value_int_n.n; i++)
+ params[i] = INT_TO_FLOAT(v.value_int_n.ints[i]);
+ break;
+
+ case TYPE_INT64:
+ params[0] = ((GLint64 *) p)[0];
+ break;
+
+ case TYPE_BOOLEAN:
+ params[0] = BOOLEAN_TO_FLOAT(*(GLboolean*) p);
+ break;
+
+ case TYPE_MATRIX:
+ m = *(GLmatrix **) p;
+ for (i = 0; i < 16; i++)
+ params[i] = m->m[i];
+ break;
+
+ case TYPE_MATRIX_T:
+ m = *(GLmatrix **) p;
+ for (i = 0; i < 16; i++)
+ params[i] = m->m[transpose[i]];
+ break;
+
+ case TYPE_BIT_0:
+ case TYPE_BIT_1:
+ case TYPE_BIT_2:
+ case TYPE_BIT_3:
+ case TYPE_BIT_4:
+ case TYPE_BIT_5:
+ shift = d->type - TYPE_BIT_0;
+ params[0] = BOOLEAN_TO_FLOAT((*(GLbitfield *) p >> shift) & 1);
+ break;
+ }
+}
+
+void GLAPIENTRY
+_mesa_GetIntegerv(GLenum pname, GLint *params)
+{
+ const struct value_desc *d;
+ union value v;
+ GLmatrix *m;
+ int shift, i;
+ void *p;
+
+ d = find_value("glGetIntegerv", pname, &p, &v);
+ switch (d->type) {
+ case TYPE_INVALID:
+ break;
+ case TYPE_CONST:
+ params[0] = d->offset;
+ break;
+
+ case TYPE_FLOAT_4:
+ params[3] = IROUND(((GLfloat *) p)[3]);
+ case TYPE_FLOAT_3:
+ params[2] = IROUND(((GLfloat *) p)[2]);
+ case TYPE_FLOAT_2:
+ params[1] = IROUND(((GLfloat *) p)[1]);
+ case TYPE_FLOAT:
+ params[0] = IROUND(((GLfloat *) p)[0]);
+ break;
+
+ case TYPE_FLOATN_4:
+ params[3] = FLOAT_TO_INT(((GLfloat *) p)[3]);
+ case TYPE_FLOATN_3:
+ params[2] = FLOAT_TO_INT(((GLfloat *) p)[2]);
+ case TYPE_FLOATN_2:
+ params[1] = FLOAT_TO_INT(((GLfloat *) p)[1]);
+ case TYPE_FLOATN:
+ params[0] = FLOAT_TO_INT(((GLfloat *) p)[0]);
+ break;
+
+ case TYPE_DOUBLEN:
+ params[0] = FLOAT_TO_INT(((GLdouble *) p)[0]);
+ break;
+
+ case TYPE_INT_4:
+ params[3] = ((GLint *) p)[3];
+ case TYPE_INT_3:
+ params[2] = ((GLint *) p)[2];
+ case TYPE_INT_2:
+ case TYPE_ENUM_2:
+ params[1] = ((GLint *) p)[1];
+ case TYPE_INT:
+ case TYPE_ENUM:
+ params[0] = ((GLint *) p)[0];
+ break;
+
+ case TYPE_INT_N:
+ for (i = 0; i < v.value_int_n.n; i++)
+ params[i] = v.value_int_n.ints[i];
+ break;
+
+ case TYPE_INT64:
+ params[0] = INT64_TO_INT(((GLint64 *) p)[0]);
+ break;
+
+ case TYPE_BOOLEAN:
+ params[0] = BOOLEAN_TO_INT(*(GLboolean*) p);
+ break;
+
+ case TYPE_MATRIX:
+ m = *(GLmatrix **) p;
+ for (i = 0; i < 16; i++)
+ params[i] = FLOAT_TO_INT(m->m[i]);
+ break;
+
+ case TYPE_MATRIX_T:
+ m = *(GLmatrix **) p;
+ for (i = 0; i < 16; i++)
+ params[i] = FLOAT_TO_INT(m->m[transpose[i]]);
+ break;
+
+ case TYPE_BIT_0:
+ case TYPE_BIT_1:
+ case TYPE_BIT_2:
+ case TYPE_BIT_3:
+ case TYPE_BIT_4:
+ case TYPE_BIT_5:
+ shift = d->type - TYPE_BIT_0;
+ params[0] = (*(GLbitfield *) p >> shift) & 1;
+ break;
+ }
+}
+
+#if FEATURE_ARB_sync
+void GLAPIENTRY
+_mesa_GetInteger64v(GLenum pname, GLint64 *params)
+{
+ const struct value_desc *d;
+ union value v;
+ GLmatrix *m;
+ int shift, i;
+ void *p;
+
+ d = find_value("glGetInteger64v", pname, &p, &v);
+ switch (d->type) {
+ case TYPE_INVALID:
+ break;
+ case TYPE_CONST:
+ params[0] = d->offset;
+ break;
+
+ case TYPE_FLOAT_4:
+ params[3] = IROUND64(((GLfloat *) p)[3]);
+ case TYPE_FLOAT_3:
+ params[2] = IROUND64(((GLfloat *) p)[2]);
+ case TYPE_FLOAT_2:
+ params[1] = IROUND64(((GLfloat *) p)[1]);
+ case TYPE_FLOAT:
+ params[0] = IROUND64(((GLfloat *) p)[0]);
+ break;
+
+ case TYPE_FLOATN_4:
+ params[3] = FLOAT_TO_INT64(((GLfloat *) p)[3]);
+ case TYPE_FLOATN_3:
+ params[2] = FLOAT_TO_INT64(((GLfloat *) p)[2]);
+ case TYPE_FLOATN_2:
+ params[1] = FLOAT_TO_INT64(((GLfloat *) p)[1]);
+ case TYPE_FLOATN:
+ params[0] = FLOAT_TO_INT64(((GLfloat *) p)[0]);
+ break;
+
+ case TYPE_DOUBLEN:
+ params[0] = FLOAT_TO_INT64(((GLdouble *) p)[0]);
+ break;
+
+ case TYPE_INT_4:
+ params[3] = ((GLint *) p)[3];
+ case TYPE_INT_3:
+ params[2] = ((GLint *) p)[2];
+ case TYPE_INT_2:
+ case TYPE_ENUM_2:
+ params[1] = ((GLint *) p)[1];
+ case TYPE_INT:
+ case TYPE_ENUM:
+ params[0] = ((GLint *) p)[0];
+ break;
+
+ case TYPE_INT_N:
+ for (i = 0; i < v.value_int_n.n; i++)
+ params[i] = INT_TO_BOOLEAN(v.value_int_n.ints[i]);
+ break;
+
+ case TYPE_INT64:
+ params[0] = ((GLint64 *) p)[0];
+ break;
+
+ case TYPE_BOOLEAN:
+ params[0] = ((GLboolean*) p)[0];
+ break;
+
+ case TYPE_MATRIX:
+ m = *(GLmatrix **) p;
+ for (i = 0; i < 16; i++)
+ params[i] = FLOAT_TO_INT64(m->m[i]);
+ break;
+
+ case TYPE_MATRIX_T:
+ m = *(GLmatrix **) p;
+ for (i = 0; i < 16; i++)
+ params[i] = FLOAT_TO_INT64(m->m[transpose[i]]);
+ break;
+
+ case TYPE_BIT_0:
+ case TYPE_BIT_1:
+ case TYPE_BIT_2:
+ case TYPE_BIT_3:
+ case TYPE_BIT_4:
+ case TYPE_BIT_5:
+ shift = d->type - TYPE_BIT_0;
+ params[0] = (*(GLbitfield *) p >> shift) & 1;
+ break;
+ }
+}
+#endif /* FEATURE_ARB_sync */
+
+void GLAPIENTRY
+_mesa_GetDoublev(GLenum pname, GLdouble *params)
+{
+ const struct value_desc *d;
+ union value v;
+ GLmatrix *m;
+ int shift, i;
+ void *p;
+
+ d = find_value("glGetDoublev", pname, &p, &v);
+ switch (d->type) {
+ case TYPE_INVALID:
+ break;
+ case TYPE_CONST:
+ params[0] = d->offset;
+ break;
+
+ case TYPE_FLOAT_4:
+ case TYPE_FLOATN_4:
+ params[3] = ((GLfloat *) p)[3];
+ case TYPE_FLOAT_3:
+ case TYPE_FLOATN_3:
+ params[2] = ((GLfloat *) p)[2];
+ case TYPE_FLOAT_2:
+ case TYPE_FLOATN_2:
+ params[1] = ((GLfloat *) p)[1];
+ case TYPE_FLOAT:
+ case TYPE_FLOATN:
+ params[0] = ((GLfloat *) p)[0];
+ break;
+
+ case TYPE_DOUBLEN:
+ params[0] = ((GLdouble *) p)[0];
+ break;
+
+ case TYPE_INT_4:
+ params[3] = ((GLint *) p)[3];
+ case TYPE_INT_3:
+ params[2] = ((GLint *) p)[2];
+ case TYPE_INT_2:
+ case TYPE_ENUM_2:
+ params[1] = ((GLint *) p)[1];
+ case TYPE_INT:
+ case TYPE_ENUM:
+ params[0] = ((GLint *) p)[0];
+ break;
+
+ case TYPE_INT_N:
+ for (i = 0; i < v.value_int_n.n; i++)
+ params[i] = v.value_int_n.ints[i];
+ break;
+
+ case TYPE_INT64:
+ params[0] = ((GLint64 *) p)[0];
+ break;
+
+ case TYPE_BOOLEAN:
+ params[0] = *(GLboolean*) p;
+ break;
+
+ case TYPE_MATRIX:
+ m = *(GLmatrix **) p;
+ for (i = 0; i < 16; i++)
+ params[i] = m->m[i];
+ break;
+
+ case TYPE_MATRIX_T:
+ m = *(GLmatrix **) p;
+ for (i = 0; i < 16; i++)
+ params[i] = m->m[transpose[i]];
+ break;
+
+ case TYPE_BIT_0:
+ case TYPE_BIT_1:
+ case TYPE_BIT_2:
+ case TYPE_BIT_3:
+ case TYPE_BIT_4:
+ case TYPE_BIT_5:
+ shift = d->type - TYPE_BIT_0;
+ params[0] = (*(GLbitfield *) p >> shift) & 1;
+ break;
+ }
+}
+
+static enum value_type
+find_value_indexed(const char *func, GLenum pname, int index, union value *v)
+{
+ GET_CURRENT_CONTEXT(ctx);
+
+ switch (pname) {
+
+ case GL_BLEND:
+ if (index >= ctx->Const.MaxDrawBuffers)
+ goto invalid_value;
+ if (!ctx->Extensions.EXT_draw_buffers2)
+ goto invalid_enum;
+ v->value_int = (ctx->Color.BlendEnabled >> index) & 1;
+ return TYPE_INT;
+
+ case GL_BLEND_SRC:
+ /* fall-through */
+ case GL_BLEND_SRC_RGB:
+ if (index >= ctx->Const.MaxDrawBuffers)
+ goto invalid_value;
+ if (!ctx->Extensions.ARB_draw_buffers_blend)
+ goto invalid_enum;
+ v->value_int = ctx->Color.Blend[index].SrcRGB;
+ return TYPE_INT;
+ case GL_BLEND_SRC_ALPHA:
+ if (index >= ctx->Const.MaxDrawBuffers)
+ goto invalid_value;
+ if (!ctx->Extensions.ARB_draw_buffers_blend)
+ goto invalid_enum;
+ v->value_int = ctx->Color.Blend[index].SrcA;
+ return TYPE_INT;
+ case GL_BLEND_DST:
+ /* fall-through */
+ case GL_BLEND_DST_RGB:
+ if (index >= ctx->Const.MaxDrawBuffers)
+ goto invalid_value;
+ if (!ctx->Extensions.ARB_draw_buffers_blend)
+ goto invalid_enum;
+ v->value_int = ctx->Color.Blend[index].DstRGB;
+ return TYPE_INT;
+ case GL_BLEND_DST_ALPHA:
+ if (index >= ctx->Const.MaxDrawBuffers)
+ goto invalid_value;
+ if (!ctx->Extensions.ARB_draw_buffers_blend)
+ goto invalid_enum;
+ v->value_int = ctx->Color.Blend[index].DstA;
+ return TYPE_INT;
+ case GL_BLEND_EQUATION_RGB:
+ if (index >= ctx->Const.MaxDrawBuffers)
+ goto invalid_value;
+ if (!ctx->Extensions.ARB_draw_buffers_blend)
+ goto invalid_enum;
+ v->value_int = ctx->Color.Blend[index].EquationRGB;
+ return TYPE_INT;
+ case GL_BLEND_EQUATION_ALPHA:
+ if (index >= ctx->Const.MaxDrawBuffers)
+ goto invalid_value;
+ if (!ctx->Extensions.ARB_draw_buffers_blend)
+ goto invalid_enum;
+ v->value_int = ctx->Color.Blend[index].EquationA;
+ return TYPE_INT;
+
+ case GL_COLOR_WRITEMASK:
+ if (index >= ctx->Const.MaxDrawBuffers)
+ goto invalid_value;
+ if (!ctx->Extensions.EXT_draw_buffers2)
+ goto invalid_enum;
+ v->value_int_4[0] = ctx->Color.ColorMask[index][RCOMP] ? 1 : 0;
+ v->value_int_4[1] = ctx->Color.ColorMask[index][GCOMP] ? 1 : 0;
+ v->value_int_4[2] = ctx->Color.ColorMask[index][BCOMP] ? 1 : 0;
+ v->value_int_4[3] = ctx->Color.ColorMask[index][ACOMP] ? 1 : 0;
+ return TYPE_INT_4;
+
+ case GL_TRANSFORM_FEEDBACK_BUFFER_START:
+ if (index >= ctx->Const.MaxTransformFeedbackSeparateAttribs)
+ goto invalid_value;
+ if (!ctx->Extensions.EXT_transform_feedback)
+ goto invalid_enum;
+ v->value_int64 = ctx->TransformFeedback.CurrentObject->Offset[index];
+ return TYPE_INT64;
+
+ case GL_TRANSFORM_FEEDBACK_BUFFER_SIZE:
+ if (index >= ctx->Const.MaxTransformFeedbackSeparateAttribs)
+ goto invalid_value;
+ if (!ctx->Extensions.EXT_transform_feedback)
+ goto invalid_enum;
+ v->value_int64 = ctx->TransformFeedback.CurrentObject->Size[index];
+ return TYPE_INT64;
+
+ case GL_TRANSFORM_FEEDBACK_BUFFER_BINDING:
+ if (index >= ctx->Const.MaxTransformFeedbackSeparateAttribs)
+ goto invalid_value;
+ if (!ctx->Extensions.EXT_transform_feedback)
+ goto invalid_enum;
+ v->value_int = ctx->TransformFeedback.CurrentObject->Buffers[index]->Name;
+ return TYPE_INT;
+ }
+
+ invalid_enum:
+ _mesa_error(ctx, GL_INVALID_ENUM, "%s(pname=%s)", func,
+ _mesa_lookup_enum_by_nr(pname));
+ return TYPE_INVALID;
+ invalid_value:
+ _mesa_error(ctx, GL_INVALID_VALUE, "%s(pname=%s)", func,
+ _mesa_lookup_enum_by_nr(pname));
+ return TYPE_INVALID;
+}
+
+void GLAPIENTRY
+_mesa_GetBooleanIndexedv( GLenum pname, GLuint index, GLboolean *params )
+{
+ union value v;
+ enum value_type type =
+ find_value_indexed("glGetBooleanIndexedv", pname, index, &v);
+
+ switch (type) {
+ case TYPE_INT:
+ params[0] = INT_TO_BOOLEAN(v.value_int);
+ break;
+ case TYPE_INT_4:
+ params[0] = INT_TO_BOOLEAN(v.value_int_4[0]);
+ params[1] = INT_TO_BOOLEAN(v.value_int_4[1]);
+ params[2] = INT_TO_BOOLEAN(v.value_int_4[2]);
+ params[3] = INT_TO_BOOLEAN(v.value_int_4[3]);
+ break;
+ case TYPE_INT64:
+ params[0] = INT64_TO_BOOLEAN(v.value_int);
+ break;
+ default:
+ ; /* nothing - GL error was recorded */
+ }
+}
+
+void GLAPIENTRY
+_mesa_GetIntegerIndexedv( GLenum pname, GLuint index, GLint *params )
+{
+ union value v;
+ enum value_type type =
+ find_value_indexed("glGetIntegerIndexedv", pname, index, &v);
+
+ switch (type) {
+ case TYPE_INT:
+ params[0] = v.value_int;
+ break;
+ case TYPE_INT_4:
+ params[0] = v.value_int_4[0];
+ params[1] = v.value_int_4[1];
+ params[2] = v.value_int_4[2];
+ params[3] = v.value_int_4[3];
+ break;
+ case TYPE_INT64:
+ params[0] = INT64_TO_INT(v.value_int);
+ break;
+ default:
+ ; /* nothing - GL error was recorded */
+ }
+}
+
+#if FEATURE_ARB_sync
+void GLAPIENTRY
+_mesa_GetInteger64Indexedv( GLenum pname, GLuint index, GLint64 *params )
+{
+ union value v;
+ enum value_type type =
+ find_value_indexed("glGetIntegerIndexedv", pname, index, &v);
+
+ switch (type) {
+ case TYPE_INT:
+ params[0] = v.value_int;
+ break;
+ case TYPE_INT_4:
+ params[0] = v.value_int_4[0];
+ params[1] = v.value_int_4[1];
+ params[2] = v.value_int_4[2];
+ params[3] = v.value_int_4[3];
+ break;
+ case TYPE_INT64:
+ params[0] = v.value_int;
+ break;
+ default:
+ ; /* nothing - GL error was recorded */
+ }
+}
+#endif /* FEATURE_ARB_sync */
+
+#if FEATURE_ES1
+void GLAPIENTRY
+_mesa_GetFixedv(GLenum pname, GLfixed *params)
+{
+ const struct value_desc *d;
+ union value v;
+ GLmatrix *m;
+ int shift, i;
+ void *p;
+
+ d = find_value("glGetDoublev", pname, &p, &v);
+ switch (d->type) {
+ case TYPE_INVALID:
+ break;
+ case TYPE_CONST:
+ params[0] = INT_TO_FIXED(d->offset);
+ break;
+
+ case TYPE_FLOAT_4:
+ case TYPE_FLOATN_4:
+ params[3] = FLOAT_TO_FIXED(((GLfloat *) p)[3]);
+ case TYPE_FLOAT_3:
+ case TYPE_FLOATN_3:
+ params[2] = FLOAT_TO_FIXED(((GLfloat *) p)[2]);
+ case TYPE_FLOAT_2:
+ case TYPE_FLOATN_2:
+ params[1] = FLOAT_TO_FIXED(((GLfloat *) p)[1]);
+ case TYPE_FLOAT:
+ case TYPE_FLOATN:
+ params[0] = FLOAT_TO_FIXED(((GLfloat *) p)[0]);
+ break;
+
+ case TYPE_DOUBLEN:
+ params[0] = FLOAT_TO_FIXED(((GLdouble *) p)[0]);
+ break;
+
+ case TYPE_INT_4:
+ params[3] = INT_TO_FIXED(((GLint *) p)[3]);
+ case TYPE_INT_3:
+ params[2] = INT_TO_FIXED(((GLint *) p)[2]);
+ case TYPE_INT_2:
+ case TYPE_ENUM_2:
+ params[1] = INT_TO_FIXED(((GLint *) p)[1]);
+ case TYPE_INT:
+ case TYPE_ENUM:
+ params[0] = INT_TO_FIXED(((GLint *) p)[0]);
+ break;
+
+ case TYPE_INT_N:
+ for (i = 0; i < v.value_int_n.n; i++)
+ params[i] = INT_TO_FIXED(v.value_int_n.ints[i]);
+ break;
+
+ case TYPE_INT64:
+ params[0] = ((GLint64 *) p)[0];
+ break;
+
+ case TYPE_BOOLEAN:
+ params[0] = BOOLEAN_TO_FIXED(((GLboolean*) p)[0]);
+ break;
+
+ case TYPE_MATRIX:
+ m = *(GLmatrix **) p;
+ for (i = 0; i < 16; i++)
+ params[i] = FLOAT_TO_FIXED(m->m[i]);
+ break;
+
+ case TYPE_MATRIX_T:
+ m = *(GLmatrix **) p;
+ for (i = 0; i < 16; i++)
+ params[i] = FLOAT_TO_FIXED(m->m[transpose[i]]);
+ break;
+
+ case TYPE_BIT_0:
+ case TYPE_BIT_1:
+ case TYPE_BIT_2:
+ case TYPE_BIT_3:
+ case TYPE_BIT_4:
+ case TYPE_BIT_5:
+ shift = d->type - TYPE_BIT_0;
+ params[0] = BOOLEAN_TO_FIXED((*(GLbitfield *) p >> shift) & 1);
+ break;
+ }
+}
+#endif
diff --git a/mesalib/src/mesa/main/get.h b/mesalib/src/mesa/main/get.h
index 9422efec5..3907e176b 100644
--- a/mesalib/src/mesa/main/get.h
+++ b/mesalib/src/mesa/main/get.h
@@ -1,81 +1,81 @@
-/**
- * \file get.h
- * State query functions.
- */
-
-/*
- * Mesa 3-D graphics library
- * Version: 3.5
- *
- * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-
-#ifndef GET_H
-#define GET_H
-
-
-#include "glheader.h"
-
-
-extern void GLAPIENTRY
-_mesa_GetBooleanv( GLenum pname, GLboolean *params );
-
-extern void GLAPIENTRY
-_mesa_GetDoublev( GLenum pname, GLdouble *params );
-
-extern void GLAPIENTRY
-_mesa_GetFloatv( GLenum pname, GLfloat *params );
-
-extern void GLAPIENTRY
-_mesa_GetIntegerv( GLenum pname, GLint *params );
-
-extern void GLAPIENTRY
-_mesa_GetInteger64v( GLenum pname, GLint64 *params );
-
-extern void GLAPIENTRY
-_mesa_GetFixedv(GLenum pname, GLfixed *params);
-
-extern void GLAPIENTRY
-_mesa_GetBooleanIndexedv( GLenum pname, GLuint index, GLboolean *params );
-
-extern void GLAPIENTRY
-_mesa_GetIntegerIndexedv( GLenum pname, GLuint index, GLint *params );
-
-extern void GLAPIENTRY
-_mesa_GetInteger64Indexedv( GLenum pname, GLuint index, GLint64 *params );
-
-extern void GLAPIENTRY
-_mesa_GetPointerv( GLenum pname, GLvoid **params );
-
-extern const GLubyte * GLAPIENTRY
-_mesa_GetString( GLenum name );
-
-extern const GLubyte * GLAPIENTRY
-_mesa_GetStringi(GLenum name, GLuint index);
-
-extern GLenum GLAPIENTRY
-_mesa_GetError( void );
-
-/* GL_ARB_robustness */
-extern GLenum GLAPIENTRY
-_mesa_GetGraphicsResetStatusARB( void );
-
-#endif
+/**
+ * \file get.h
+ * State query functions.
+ */
+
+/*
+ * Mesa 3-D graphics library
+ * Version: 3.5
+ *
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+
+#ifndef GET_H
+#define GET_H
+
+
+#include "glheader.h"
+
+
+extern void GLAPIENTRY
+_mesa_GetBooleanv( GLenum pname, GLboolean *params );
+
+extern void GLAPIENTRY
+_mesa_GetDoublev( GLenum pname, GLdouble *params );
+
+extern void GLAPIENTRY
+_mesa_GetFloatv( GLenum pname, GLfloat *params );
+
+extern void GLAPIENTRY
+_mesa_GetIntegerv( GLenum pname, GLint *params );
+
+extern void GLAPIENTRY
+_mesa_GetInteger64v( GLenum pname, GLint64 *params );
+
+extern void GLAPIENTRY
+_mesa_GetFixedv(GLenum pname, GLfixed *params);
+
+extern void GLAPIENTRY
+_mesa_GetBooleanIndexedv( GLenum pname, GLuint index, GLboolean *params );
+
+extern void GLAPIENTRY
+_mesa_GetIntegerIndexedv( GLenum pname, GLuint index, GLint *params );
+
+extern void GLAPIENTRY
+_mesa_GetInteger64Indexedv( GLenum pname, GLuint index, GLint64 *params );
+
+extern void GLAPIENTRY
+_mesa_GetPointerv( GLenum pname, GLvoid **params );
+
+extern const GLubyte * GLAPIENTRY
+_mesa_GetString( GLenum name );
+
+extern const GLubyte * GLAPIENTRY
+_mesa_GetStringi(GLenum name, GLuint index);
+
+extern GLenum GLAPIENTRY
+_mesa_GetError( void );
+
+/* GL_ARB_robustness */
+extern GLenum GLAPIENTRY
+_mesa_GetGraphicsResetStatusARB( void );
+
+#endif
diff --git a/mesalib/src/mesa/main/getstring.c b/mesalib/src/mesa/main/getstring.c
index c381fb2df..2052cbc6c 100644
--- a/mesalib/src/mesa/main/getstring.c
+++ b/mesalib/src/mesa/main/getstring.c
@@ -1,270 +1,270 @@
-/*
- * Mesa 3-D graphics library
- * Version: 7.1
- *
- * Copyright (C) 1999-2008 Brian Paul All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-
-
-#include "glheader.h"
-#include "context.h"
-#include "get.h"
-#include "enums.h"
-#include "extensions.h"
-#include "mfeatures.h"
-#include "mtypes.h"
-
-
-/**
- * Return the string for a glGetString(GL_SHADING_LANGUAGE_VERSION) query.
- */
-static const GLubyte *
-shading_language_version(struct gl_context *ctx)
-{
- switch (ctx->API) {
- case API_OPENGL:
- if (!ctx->Extensions.ARB_shader_objects) {
- _mesa_error(ctx, GL_INVALID_ENUM, "glGetString");
- return (const GLubyte *) 0;
- }
-
- switch (ctx->Const.GLSLVersion) {
- case 110:
- return (const GLubyte *) "1.10";
- case 120:
- return (const GLubyte *) "1.20";
- case 130:
- return (const GLubyte *) "1.30";
- default:
- _mesa_problem(ctx,
- "Invalid GLSL version in shading_language_version()");
- return (const GLubyte *) 0;
- }
- break;
-
- case API_OPENGLES2:
- return (const GLubyte *) "OpenGL ES GLSL ES 1.0.16";
-
- case API_OPENGLES:
- /* fall-through */
-
- default:
- _mesa_problem(ctx, "Unexpected API value in shading_language_version()");
- return (const GLubyte *) 0;
- }
-}
-
-
-/**
- * Query string-valued state. The return value should _not_ be freed by
- * the caller.
- *
- * \param name the state variable to query.
- *
- * \sa glGetString().
- *
- * Tries to get the string from dd_function_table::GetString, otherwise returns
- * the hardcoded strings.
- */
-const GLubyte * GLAPIENTRY
-_mesa_GetString( GLenum name )
-{
- GET_CURRENT_CONTEXT(ctx);
- static const char *vendor = "Brian Paul";
- static const char *renderer = "Mesa";
-
- if (!ctx)
- return NULL;
-
- ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, NULL);
-
- /* this is a required driver function */
- assert(ctx->Driver.GetString);
- {
- /* Give the driver the chance to handle this query */
- const GLubyte *str = (*ctx->Driver.GetString)(ctx, name);
- if (str)
- return str;
- }
-
- switch (name) {
- case GL_VENDOR:
- return (const GLubyte *) vendor;
- case GL_RENDERER:
- return (const GLubyte *) renderer;
- case GL_VERSION:
- return (const GLubyte *) ctx->VersionString;
- case GL_EXTENSIONS:
- return (const GLubyte *) ctx->Extensions.String;
-#if FEATURE_ARB_shading_language_100 || FEATURE_ES2
- case GL_SHADING_LANGUAGE_VERSION:
- return shading_language_version(ctx);
-#endif
-#if FEATURE_NV_fragment_program || FEATURE_ARB_fragment_program || \
- FEATURE_NV_vertex_program || FEATURE_ARB_vertex_program
- case GL_PROGRAM_ERROR_STRING_NV:
- if (ctx->Extensions.NV_fragment_program ||
- ctx->Extensions.ARB_fragment_program ||
- ctx->Extensions.NV_vertex_program ||
- ctx->Extensions.ARB_vertex_program) {
- return (const GLubyte *) ctx->Program.ErrorString;
- }
- /* FALL-THROUGH */
-#endif
- default:
- _mesa_error( ctx, GL_INVALID_ENUM, "glGetString" );
- return (const GLubyte *) 0;
- }
-}
-
-
-/**
- * GL3
- */
-const GLubyte * GLAPIENTRY
-_mesa_GetStringi(GLenum name, GLuint index)
-{
- GET_CURRENT_CONTEXT(ctx);
-
- if (!ctx)
- return NULL;
-
- ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, NULL);
-
- switch (name) {
- case GL_EXTENSIONS:
- if (index >= _mesa_get_extension_count(ctx)) {
- _mesa_error(ctx, GL_INVALID_VALUE, "glGetStringi(index=%u)", index);
- return (const GLubyte *) 0;
- }
- return _mesa_get_enabled_extension(ctx, index);
- default:
- _mesa_error( ctx, GL_INVALID_ENUM, "glGetString" );
- return (const GLubyte *) 0;
- }
-}
-
-
-
-/**
- * Return pointer-valued state, such as a vertex array pointer.
- *
- * \param pname names state to be queried
- * \param params returns the pointer value
- *
- * \sa glGetPointerv().
- *
- * Tries to get the specified pointer via dd_function_table::GetPointerv,
- * otherwise gets the specified pointer from the current context.
- */
-void GLAPIENTRY
-_mesa_GetPointerv( GLenum pname, GLvoid **params )
-{
- GET_CURRENT_CONTEXT(ctx);
- const GLuint clientUnit = ctx->Array.ActiveTexture;
- ASSERT_OUTSIDE_BEGIN_END(ctx);
-
- if (!params)
- return;
-
- if (MESA_VERBOSE & VERBOSE_API)
- _mesa_debug(ctx, "glGetPointerv %s\n", _mesa_lookup_enum_by_nr(pname));
-
- switch (pname) {
- case GL_VERTEX_ARRAY_POINTER:
- *params = (GLvoid *) ctx->Array.ArrayObj->Vertex.Ptr;
- break;
- case GL_NORMAL_ARRAY_POINTER:
- *params = (GLvoid *) ctx->Array.ArrayObj->Normal.Ptr;
- break;
- case GL_COLOR_ARRAY_POINTER:
- *params = (GLvoid *) ctx->Array.ArrayObj->Color.Ptr;
- break;
- case GL_SECONDARY_COLOR_ARRAY_POINTER_EXT:
- *params = (GLvoid *) ctx->Array.ArrayObj->SecondaryColor.Ptr;
- break;
- case GL_FOG_COORDINATE_ARRAY_POINTER_EXT:
- *params = (GLvoid *) ctx->Array.ArrayObj->FogCoord.Ptr;
- break;
- case GL_INDEX_ARRAY_POINTER:
- *params = (GLvoid *) ctx->Array.ArrayObj->Index.Ptr;
- break;
- case GL_TEXTURE_COORD_ARRAY_POINTER:
- *params = (GLvoid *) ctx->Array.ArrayObj->TexCoord[clientUnit].Ptr;
- break;
- case GL_EDGE_FLAG_ARRAY_POINTER:
- *params = (GLvoid *) ctx->Array.ArrayObj->EdgeFlag.Ptr;
- break;
- case GL_FEEDBACK_BUFFER_POINTER:
- *params = ctx->Feedback.Buffer;
- break;
- case GL_SELECTION_BUFFER_POINTER:
- *params = ctx->Select.Buffer;
- break;
-#if FEATURE_point_size_array
- case GL_POINT_SIZE_ARRAY_POINTER_OES:
- *params = (GLvoid *) ctx->Array.ArrayObj->PointSize.Ptr;
- break;
-#endif
- default:
- _mesa_error( ctx, GL_INVALID_ENUM, "glGetPointerv" );
- return;
- }
-}
-
-
-/**
- * Returns the current GL error code, or GL_NO_ERROR.
- * \return current error code
- *
- * Returns __struct gl_contextRec::ErrorValue.
- */
-GLenum GLAPIENTRY
-_mesa_GetError( void )
-{
- GET_CURRENT_CONTEXT(ctx);
- GLenum e = ctx->ErrorValue;
- ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, 0);
-
- if (MESA_VERBOSE & VERBOSE_API)
- _mesa_debug(ctx, "glGetError <-- %s\n", _mesa_lookup_enum_by_nr(e));
-
- ctx->ErrorValue = (GLenum) GL_NO_ERROR;
- ctx->ErrorDebugCount = 0;
- return e;
-}
-
-/**
- * Returns an error code specified by GL_ARB_robustness, or GL_NO_ERROR.
- * \return current context status
- */
-GLenum GLAPIENTRY
-_mesa_GetGraphicsResetStatusARB( void )
-{
- GET_CURRENT_CONTEXT(ctx);
- GLenum status = ctx->ResetStatus;
-
- if (MESA_VERBOSE & VERBOSE_API)
- _mesa_debug(ctx, "glGetGraphicsResetStatusARB"
- "(always returns GL_NO_ERROR)\n");
-
- return status;
-}
+/*
+ * Mesa 3-D graphics library
+ * Version: 7.1
+ *
+ * Copyright (C) 1999-2008 Brian Paul All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+
+
+#include "glheader.h"
+#include "context.h"
+#include "get.h"
+#include "enums.h"
+#include "extensions.h"
+#include "mfeatures.h"
+#include "mtypes.h"
+
+
+/**
+ * Return the string for a glGetString(GL_SHADING_LANGUAGE_VERSION) query.
+ */
+static const GLubyte *
+shading_language_version(struct gl_context *ctx)
+{
+ switch (ctx->API) {
+ case API_OPENGL:
+ if (!ctx->Extensions.ARB_shader_objects) {
+ _mesa_error(ctx, GL_INVALID_ENUM, "glGetString");
+ return (const GLubyte *) 0;
+ }
+
+ switch (ctx->Const.GLSLVersion) {
+ case 110:
+ return (const GLubyte *) "1.10";
+ case 120:
+ return (const GLubyte *) "1.20";
+ case 130:
+ return (const GLubyte *) "1.30";
+ default:
+ _mesa_problem(ctx,
+ "Invalid GLSL version in shading_language_version()");
+ return (const GLubyte *) 0;
+ }
+ break;
+
+ case API_OPENGLES2:
+ return (const GLubyte *) "OpenGL ES GLSL ES 1.0.16";
+
+ case API_OPENGLES:
+ /* fall-through */
+
+ default:
+ _mesa_problem(ctx, "Unexpected API value in shading_language_version()");
+ return (const GLubyte *) 0;
+ }
+}
+
+
+/**
+ * Query string-valued state. The return value should _not_ be freed by
+ * the caller.
+ *
+ * \param name the state variable to query.
+ *
+ * \sa glGetString().
+ *
+ * Tries to get the string from dd_function_table::GetString, otherwise returns
+ * the hardcoded strings.
+ */
+const GLubyte * GLAPIENTRY
+_mesa_GetString( GLenum name )
+{
+ GET_CURRENT_CONTEXT(ctx);
+ static const char *vendor = "Brian Paul";
+ static const char *renderer = "Mesa";
+
+ if (!ctx)
+ return NULL;
+
+ ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, NULL);
+
+ /* this is a required driver function */
+ assert(ctx->Driver.GetString);
+ {
+ /* Give the driver the chance to handle this query */
+ const GLubyte *str = (*ctx->Driver.GetString)(ctx, name);
+ if (str)
+ return str;
+ }
+
+ switch (name) {
+ case GL_VENDOR:
+ return (const GLubyte *) vendor;
+ case GL_RENDERER:
+ return (const GLubyte *) renderer;
+ case GL_VERSION:
+ return (const GLubyte *) ctx->VersionString;
+ case GL_EXTENSIONS:
+ return (const GLubyte *) ctx->Extensions.String;
+#if FEATURE_ARB_shading_language_100 || FEATURE_ES2
+ case GL_SHADING_LANGUAGE_VERSION:
+ return shading_language_version(ctx);
+#endif
+#if FEATURE_NV_fragment_program || FEATURE_ARB_fragment_program || \
+ FEATURE_NV_vertex_program || FEATURE_ARB_vertex_program
+ case GL_PROGRAM_ERROR_STRING_NV:
+ if (ctx->Extensions.NV_fragment_program ||
+ ctx->Extensions.ARB_fragment_program ||
+ ctx->Extensions.NV_vertex_program ||
+ ctx->Extensions.ARB_vertex_program) {
+ return (const GLubyte *) ctx->Program.ErrorString;
+ }
+ /* FALL-THROUGH */
+#endif
+ default:
+ _mesa_error( ctx, GL_INVALID_ENUM, "glGetString" );
+ return (const GLubyte *) 0;
+ }
+}
+
+
+/**
+ * GL3
+ */
+const GLubyte * GLAPIENTRY
+_mesa_GetStringi(GLenum name, GLuint index)
+{
+ GET_CURRENT_CONTEXT(ctx);
+
+ if (!ctx)
+ return NULL;
+
+ ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, NULL);
+
+ switch (name) {
+ case GL_EXTENSIONS:
+ if (index >= _mesa_get_extension_count(ctx)) {
+ _mesa_error(ctx, GL_INVALID_VALUE, "glGetStringi(index=%u)", index);
+ return (const GLubyte *) 0;
+ }
+ return _mesa_get_enabled_extension(ctx, index);
+ default:
+ _mesa_error( ctx, GL_INVALID_ENUM, "glGetString" );
+ return (const GLubyte *) 0;
+ }
+}
+
+
+
+/**
+ * Return pointer-valued state, such as a vertex array pointer.
+ *
+ * \param pname names state to be queried
+ * \param params returns the pointer value
+ *
+ * \sa glGetPointerv().
+ *
+ * Tries to get the specified pointer via dd_function_table::GetPointerv,
+ * otherwise gets the specified pointer from the current context.
+ */
+void GLAPIENTRY
+_mesa_GetPointerv( GLenum pname, GLvoid **params )
+{
+ GET_CURRENT_CONTEXT(ctx);
+ const GLuint clientUnit = ctx->Array.ActiveTexture;
+ ASSERT_OUTSIDE_BEGIN_END(ctx);
+
+ if (!params)
+ return;
+
+ if (MESA_VERBOSE & VERBOSE_API)
+ _mesa_debug(ctx, "glGetPointerv %s\n", _mesa_lookup_enum_by_nr(pname));
+
+ switch (pname) {
+ case GL_VERTEX_ARRAY_POINTER:
+ *params = (GLvoid *) ctx->Array.ArrayObj->Vertex.Ptr;
+ break;
+ case GL_NORMAL_ARRAY_POINTER:
+ *params = (GLvoid *) ctx->Array.ArrayObj->Normal.Ptr;
+ break;
+ case GL_COLOR_ARRAY_POINTER:
+ *params = (GLvoid *) ctx->Array.ArrayObj->Color.Ptr;
+ break;
+ case GL_SECONDARY_COLOR_ARRAY_POINTER_EXT:
+ *params = (GLvoid *) ctx->Array.ArrayObj->SecondaryColor.Ptr;
+ break;
+ case GL_FOG_COORDINATE_ARRAY_POINTER_EXT:
+ *params = (GLvoid *) ctx->Array.ArrayObj->FogCoord.Ptr;
+ break;
+ case GL_INDEX_ARRAY_POINTER:
+ *params = (GLvoid *) ctx->Array.ArrayObj->Index.Ptr;
+ break;
+ case GL_TEXTURE_COORD_ARRAY_POINTER:
+ *params = (GLvoid *) ctx->Array.ArrayObj->TexCoord[clientUnit].Ptr;
+ break;
+ case GL_EDGE_FLAG_ARRAY_POINTER:
+ *params = (GLvoid *) ctx->Array.ArrayObj->EdgeFlag.Ptr;
+ break;
+ case GL_FEEDBACK_BUFFER_POINTER:
+ *params = ctx->Feedback.Buffer;
+ break;
+ case GL_SELECTION_BUFFER_POINTER:
+ *params = ctx->Select.Buffer;
+ break;
+#if FEATURE_point_size_array
+ case GL_POINT_SIZE_ARRAY_POINTER_OES:
+ *params = (GLvoid *) ctx->Array.ArrayObj->PointSize.Ptr;
+ break;
+#endif
+ default:
+ _mesa_error( ctx, GL_INVALID_ENUM, "glGetPointerv" );
+ return;
+ }
+}
+
+
+/**
+ * Returns the current GL error code, or GL_NO_ERROR.
+ * \return current error code
+ *
+ * Returns __struct gl_contextRec::ErrorValue.
+ */
+GLenum GLAPIENTRY
+_mesa_GetError( void )
+{
+ GET_CURRENT_CONTEXT(ctx);
+ GLenum e = ctx->ErrorValue;
+ ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, 0);
+
+ if (MESA_VERBOSE & VERBOSE_API)
+ _mesa_debug(ctx, "glGetError <-- %s\n", _mesa_lookup_enum_by_nr(e));
+
+ ctx->ErrorValue = (GLenum) GL_NO_ERROR;
+ ctx->ErrorDebugCount = 0;
+ return e;
+}
+
+/**
+ * Returns an error code specified by GL_ARB_robustness, or GL_NO_ERROR.
+ * \return current context status
+ */
+GLenum GLAPIENTRY
+_mesa_GetGraphicsResetStatusARB( void )
+{
+ GET_CURRENT_CONTEXT(ctx);
+ GLenum status = ctx->ResetStatus;
+
+ if (MESA_VERBOSE & VERBOSE_API)
+ _mesa_debug(ctx, "glGetGraphicsResetStatusARB"
+ "(always returns GL_NO_ERROR)\n");
+
+ return status;
+}
diff --git a/mesalib/src/mesa/main/glheader.h b/mesalib/src/mesa/main/glheader.h
index 0df811986..dc78ccbf6 100644
--- a/mesalib/src/mesa/main/glheader.h
+++ b/mesalib/src/mesa/main/glheader.h
@@ -1,167 +1,167 @@
-/*
- * Mesa 3-D graphics library
- * Version: 7.5
- *
- * Copyright (C) 1999-2008 Brian Paul All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-
-/**
- * \file glheader.h
- * Wrapper for GL/gl.h and GL/glext.h
- */
-
-
-#ifndef GLHEADER_H
-#define GLHEADER_H
-
-
-#ifdef WGLAPI
-#undef WGLAPI
-#endif
-
-
-#if !defined(OPENSTEP) && (defined(__WIN32__) && !defined(__CYGWIN__)) && !defined(BUILD_FOR_SNAP)
-# if (defined(_MSC_VER) || defined(__MINGW32__)) && defined(BUILD_GL32) /* tag specify we're building mesa as a DLL */
-# define WGLAPI __declspec(dllexport)
-# elif (defined(_MSC_VER) || defined(__MINGW32__)) && defined(_DLL) /* tag specifying we're building for DLL runtime support */
-# define WGLAPI __declspec(dllimport)
-# else /* for use with static link lib build of Win32 edition only */
-# define WGLAPI __declspec(dllimport)
-# endif /* _STATIC_MESA support */
-#endif /* WIN32 / CYGWIN bracket */
-
-
-#define GL_GLEXT_PROTOTYPES
-#include "GL/gl.h"
-#include "GL/glext.h"
-
-
-/**
- * GL_FIXED is defined in glext.h version 64 but these typedefs aren't (yet).
- */
-typedef int GLfixed;
-typedef int GLclampx;
-
-
-#ifndef GL_OES_EGL_image
-typedef void *GLeglImageOES;
-#endif
-
-
-#ifndef GL_OES_point_size_array
-#define GL_POINT_SIZE_ARRAY_OES 0x8B9C
-#define GL_POINT_SIZE_ARRAY_TYPE_OES 0x898A
-#define GL_POINT_SIZE_ARRAY_STRIDE_OES 0x898B
-#define GL_POINT_SIZE_ARRAY_POINTER_OES 0x898C
-#define GL_POINT_SIZE_ARRAY_BUFFER_BINDING_OES 0x8B9F
-#endif
-
-
-#ifndef GL_OES_draw_texture
-#define GL_TEXTURE_CROP_RECT_OES 0x8B9D
-#endif
-
-
-#ifndef GL_PROGRAM_BINARY_LENGTH_OES
-#define GL_PROGRAM_BINARY_LENGTH_OES 0x8741
-#endif
-
-/* GLES 2.0 tokens */
-#ifndef GL_RGB565
-#define GL_RGB565 0x8D62
-#endif
-
-#ifndef GL_TEXTURE_GEN_STR_OES
-#define GL_TEXTURE_GEN_STR_OES 0x8D60
-#endif
-
-#ifndef GL_OES_compressed_paletted_texture
-#define GL_PALETTE4_RGB8_OES 0x8B90
-#define GL_PALETTE4_RGBA8_OES 0x8B91
-#define GL_PALETTE4_R5_G6_B5_OES 0x8B92
-#define GL_PALETTE4_RGBA4_OES 0x8B93
-#define GL_PALETTE4_RGB5_A1_OES 0x8B94
-#define GL_PALETTE8_RGB8_OES 0x8B95
-#define GL_PALETTE8_RGBA8_OES 0x8B96
-#define GL_PALETTE8_R5_G6_B5_OES 0x8B97
-#define GL_PALETTE8_RGBA4_OES 0x8B98
-#define GL_PALETTE8_RGB5_A1_OES 0x8B99
-#endif
-
-#ifndef GL_OES_matrix_get
-#define GL_MODELVIEW_MATRIX_FLOAT_AS_INT_BITS_OES 0x898D
-#define GL_PROJECTION_MATRIX_FLOAT_AS_INT_BITS_OES 0x898E
-#define GL_TEXTURE_MATRIX_FLOAT_AS_INT_BITS_OES 0x898F
-#endif
-
-#ifndef GL_ES_VERSION_2_0
-#define GL_SHADER_BINARY_FORMATS 0x8DF8
-#define GL_NUM_SHADER_BINARY_FORMATS 0x8DF9
-#define GL_SHADER_COMPILER 0x8DFA
-#define GL_MAX_VERTEX_UNIFORM_VECTORS 0x8DFB
-#define GL_MAX_VARYING_VECTORS 0x8DFC
-#define GL_MAX_FRAGMENT_UNIFORM_VECTORS 0x8DFD
-#endif
-
-#ifndef GL_ATI_texture_compression_3dc
-#define GL_ATI_texture_compression_3dc 1
-#define GL_COMPRESSED_LUMINANCE_ALPHA_3DC_ATI 0x8837
-#endif
-
-
-/**
- * Internal token to represent a GLSL shader program (a collection of
- * one or more shaders that get linked together). Note that GLSL
- * shaders and shader programs share one name space (one hash table)
- * so we need a value that's different from any of the
- * GL_VERTEX/FRAGMENT/GEOMETRY_PROGRAM tokens.
- */
-#define GL_SHADER_PROGRAM_MESA 0x9999
-
-
-/**
- * Internal token for geometry programs.
- * Use the value for GL_GEOMETRY_PROGRAM_NV for now.
- */
-#define MESA_GEOMETRY_PROGRAM 0x8c26
-
-/* Several fields of struct gl_config can take these as values. Since
- * GLX header files may not be available everywhere they need to be used,
- * redefine them here.
- */
-#define GLX_NONE 0x8000
-#define GLX_SLOW_CONFIG 0x8001
-#define GLX_TRUE_COLOR 0x8002
-#define GLX_DIRECT_COLOR 0x8003
-#define GLX_PSEUDO_COLOR 0x8004
-#define GLX_STATIC_COLOR 0x8005
-#define GLX_GRAY_SCALE 0x8006
-#define GLX_STATIC_GRAY 0x8007
-#define GLX_TRANSPARENT_RGB 0x8008
-#define GLX_TRANSPARENT_INDEX 0x8009
-#define GLX_NON_CONFORMANT_CONFIG 0x800D
-#define GLX_SWAP_EXCHANGE_OML 0x8061
-#define GLX_SWAP_COPY_OML 0x8062
-#define GLX_SWAP_UNDEFINED_OML 0x8063
-
-#define GLX_DONT_CARE 0xFFFFFFFF
-
-#endif /* GLHEADER_H */
+/*
+ * Mesa 3-D graphics library
+ * Version: 7.5
+ *
+ * Copyright (C) 1999-2008 Brian Paul All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+
+/**
+ * \file glheader.h
+ * Wrapper for GL/gl.h and GL/glext.h
+ */
+
+
+#ifndef GLHEADER_H
+#define GLHEADER_H
+
+
+#ifdef WGLAPI
+#undef WGLAPI
+#endif
+
+
+#if !defined(OPENSTEP) && (defined(__WIN32__) && !defined(__CYGWIN__)) && !defined(BUILD_FOR_SNAP)
+# if (defined(_MSC_VER) || defined(__MINGW32__)) && defined(BUILD_GL32) /* tag specify we're building mesa as a DLL */
+# define WGLAPI __declspec(dllexport)
+# elif (defined(_MSC_VER) || defined(__MINGW32__)) && defined(_DLL) /* tag specifying we're building for DLL runtime support */
+# define WGLAPI __declspec(dllimport)
+# else /* for use with static link lib build of Win32 edition only */
+# define WGLAPI __declspec(dllimport)
+# endif /* _STATIC_MESA support */
+#endif /* WIN32 / CYGWIN bracket */
+
+
+#define GL_GLEXT_PROTOTYPES
+#include "GL/gl.h"
+#include "GL/glext.h"
+
+
+/**
+ * GL_FIXED is defined in glext.h version 64 but these typedefs aren't (yet).
+ */
+typedef int GLfixed;
+typedef int GLclampx;
+
+
+#ifndef GL_OES_EGL_image
+typedef void *GLeglImageOES;
+#endif
+
+
+#ifndef GL_OES_point_size_array
+#define GL_POINT_SIZE_ARRAY_OES 0x8B9C
+#define GL_POINT_SIZE_ARRAY_TYPE_OES 0x898A
+#define GL_POINT_SIZE_ARRAY_STRIDE_OES 0x898B
+#define GL_POINT_SIZE_ARRAY_POINTER_OES 0x898C
+#define GL_POINT_SIZE_ARRAY_BUFFER_BINDING_OES 0x8B9F
+#endif
+
+
+#ifndef GL_OES_draw_texture
+#define GL_TEXTURE_CROP_RECT_OES 0x8B9D
+#endif
+
+
+#ifndef GL_PROGRAM_BINARY_LENGTH_OES
+#define GL_PROGRAM_BINARY_LENGTH_OES 0x8741
+#endif
+
+/* GLES 2.0 tokens */
+#ifndef GL_RGB565
+#define GL_RGB565 0x8D62
+#endif
+
+#ifndef GL_TEXTURE_GEN_STR_OES
+#define GL_TEXTURE_GEN_STR_OES 0x8D60
+#endif
+
+#ifndef GL_OES_compressed_paletted_texture
+#define GL_PALETTE4_RGB8_OES 0x8B90
+#define GL_PALETTE4_RGBA8_OES 0x8B91
+#define GL_PALETTE4_R5_G6_B5_OES 0x8B92
+#define GL_PALETTE4_RGBA4_OES 0x8B93
+#define GL_PALETTE4_RGB5_A1_OES 0x8B94
+#define GL_PALETTE8_RGB8_OES 0x8B95
+#define GL_PALETTE8_RGBA8_OES 0x8B96
+#define GL_PALETTE8_R5_G6_B5_OES 0x8B97
+#define GL_PALETTE8_RGBA4_OES 0x8B98
+#define GL_PALETTE8_RGB5_A1_OES 0x8B99
+#endif
+
+#ifndef GL_OES_matrix_get
+#define GL_MODELVIEW_MATRIX_FLOAT_AS_INT_BITS_OES 0x898D
+#define GL_PROJECTION_MATRIX_FLOAT_AS_INT_BITS_OES 0x898E
+#define GL_TEXTURE_MATRIX_FLOAT_AS_INT_BITS_OES 0x898F
+#endif
+
+#ifndef GL_ES_VERSION_2_0
+#define GL_SHADER_BINARY_FORMATS 0x8DF8
+#define GL_NUM_SHADER_BINARY_FORMATS 0x8DF9
+#define GL_SHADER_COMPILER 0x8DFA
+#define GL_MAX_VERTEX_UNIFORM_VECTORS 0x8DFB
+#define GL_MAX_VARYING_VECTORS 0x8DFC
+#define GL_MAX_FRAGMENT_UNIFORM_VECTORS 0x8DFD
+#endif
+
+#ifndef GL_ATI_texture_compression_3dc
+#define GL_ATI_texture_compression_3dc 1
+#define GL_COMPRESSED_LUMINANCE_ALPHA_3DC_ATI 0x8837
+#endif
+
+
+/**
+ * Internal token to represent a GLSL shader program (a collection of
+ * one or more shaders that get linked together). Note that GLSL
+ * shaders and shader programs share one name space (one hash table)
+ * so we need a value that's different from any of the
+ * GL_VERTEX/FRAGMENT/GEOMETRY_PROGRAM tokens.
+ */
+#define GL_SHADER_PROGRAM_MESA 0x9999
+
+
+/**
+ * Internal token for geometry programs.
+ * Use the value for GL_GEOMETRY_PROGRAM_NV for now.
+ */
+#define MESA_GEOMETRY_PROGRAM 0x8c26
+
+/* Several fields of struct gl_config can take these as values. Since
+ * GLX header files may not be available everywhere they need to be used,
+ * redefine them here.
+ */
+#define GLX_NONE 0x8000
+#define GLX_SLOW_CONFIG 0x8001
+#define GLX_TRUE_COLOR 0x8002
+#define GLX_DIRECT_COLOR 0x8003
+#define GLX_PSEUDO_COLOR 0x8004
+#define GLX_STATIC_COLOR 0x8005
+#define GLX_GRAY_SCALE 0x8006
+#define GLX_STATIC_GRAY 0x8007
+#define GLX_TRANSPARENT_RGB 0x8008
+#define GLX_TRANSPARENT_INDEX 0x8009
+#define GLX_NON_CONFORMANT_CONFIG 0x800D
+#define GLX_SWAP_EXCHANGE_OML 0x8061
+#define GLX_SWAP_COPY_OML 0x8062
+#define GLX_SWAP_UNDEFINED_OML 0x8063
+
+#define GLX_DONT_CARE 0xFFFFFFFF
+
+#endif /* GLHEADER_H */
diff --git a/mesalib/src/mesa/main/hint.c b/mesalib/src/mesa/main/hint.c
index ff8d88fff..aea0d7022 100644
--- a/mesalib/src/mesa/main/hint.c
+++ b/mesalib/src/mesa/main/hint.c
@@ -1,147 +1,147 @@
-
-/*
- * Mesa 3-D graphics library
- * Version: 4.1
- *
- * Copyright (C) 1999-2002 Brian Paul All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-
-#include "glheader.h"
-#include "enums.h"
-#include "context.h"
-#include "hint.h"
-#include "imports.h"
-#include "mtypes.h"
-
-
-
-void GLAPIENTRY
-_mesa_Hint( GLenum target, GLenum mode )
-{
- GET_CURRENT_CONTEXT(ctx);
- ASSERT_OUTSIDE_BEGIN_END(ctx);
-
- if (MESA_VERBOSE & VERBOSE_API)
- _mesa_debug(ctx, "glHint %s %s\n",
- _mesa_lookup_enum_by_nr(target),
- _mesa_lookup_enum_by_nr(mode));
-
- if (mode != GL_NICEST && mode != GL_FASTEST && mode != GL_DONT_CARE) {
- _mesa_error(ctx, GL_INVALID_ENUM, "glHint(mode)");
- return;
- }
-
- switch (target) {
- case GL_FOG_HINT:
- if (ctx->Hint.Fog == mode)
- return;
- FLUSH_VERTICES(ctx, _NEW_HINT);
- ctx->Hint.Fog = mode;
- break;
- case GL_LINE_SMOOTH_HINT:
- if (ctx->Hint.LineSmooth == mode)
- return;
- FLUSH_VERTICES(ctx, _NEW_HINT);
- ctx->Hint.LineSmooth = mode;
- break;
- case GL_PERSPECTIVE_CORRECTION_HINT:
- if (ctx->Hint.PerspectiveCorrection == mode)
- return;
- FLUSH_VERTICES(ctx, _NEW_HINT);
- ctx->Hint.PerspectiveCorrection = mode;
- break;
- case GL_POINT_SMOOTH_HINT:
- if (ctx->Hint.PointSmooth == mode)
- return;
- FLUSH_VERTICES(ctx, _NEW_HINT);
- ctx->Hint.PointSmooth = mode;
- break;
- case GL_POLYGON_SMOOTH_HINT:
- if (ctx->Hint.PolygonSmooth == mode)
- return;
- FLUSH_VERTICES(ctx, _NEW_HINT);
- ctx->Hint.PolygonSmooth = mode;
- break;
-
- /* GL_EXT_clip_volume_hint */
- case GL_CLIP_VOLUME_CLIPPING_HINT_EXT:
- if (ctx->Hint.ClipVolumeClipping == mode)
- return;
- FLUSH_VERTICES(ctx, _NEW_HINT);
- ctx->Hint.ClipVolumeClipping = mode;
- break;
-
- /* GL_ARB_texture_compression */
- case GL_TEXTURE_COMPRESSION_HINT_ARB:
- if (ctx->Hint.TextureCompression == mode)
- return;
- FLUSH_VERTICES(ctx, _NEW_HINT);
- ctx->Hint.TextureCompression = mode;
- break;
-
- /* GL_SGIS_generate_mipmap */
- case GL_GENERATE_MIPMAP_HINT_SGIS:
- if (ctx->Hint.GenerateMipmap == mode)
- return;
- FLUSH_VERTICES(ctx, _NEW_HINT);
- ctx->Hint.GenerateMipmap = mode;
- break;
-
- /* GL_ARB_fragment_shader */
- case GL_FRAGMENT_SHADER_DERIVATIVE_HINT_ARB:
- if (!ctx->Extensions.ARB_fragment_shader) {
- _mesa_error(ctx, GL_INVALID_ENUM, "glHint(target)");
- return;
- }
- if (ctx->Hint.FragmentShaderDerivative == mode)
- return;
- FLUSH_VERTICES(ctx, _NEW_HINT);
- ctx->Hint.FragmentShaderDerivative = mode;
- break;
-
- default:
- _mesa_error(ctx, GL_INVALID_ENUM, "glHint(target)");
- return;
- }
-
- if (ctx->Driver.Hint) {
- (*ctx->Driver.Hint)( ctx, target, mode );
- }
-}
-
-
-/**********************************************************************/
-/***** Initialization *****/
-/**********************************************************************/
-
-void _mesa_init_hint( struct gl_context * ctx )
-{
- /* Hint group */
- ctx->Hint.PerspectiveCorrection = GL_DONT_CARE;
- ctx->Hint.PointSmooth = GL_DONT_CARE;
- ctx->Hint.LineSmooth = GL_DONT_CARE;
- ctx->Hint.PolygonSmooth = GL_DONT_CARE;
- ctx->Hint.Fog = GL_DONT_CARE;
- ctx->Hint.ClipVolumeClipping = GL_DONT_CARE;
- ctx->Hint.TextureCompression = GL_DONT_CARE;
- ctx->Hint.GenerateMipmap = GL_DONT_CARE;
- ctx->Hint.FragmentShaderDerivative = GL_DONT_CARE;
-}
+
+/*
+ * Mesa 3-D graphics library
+ * Version: 4.1
+ *
+ * Copyright (C) 1999-2002 Brian Paul All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+
+#include "glheader.h"
+#include "enums.h"
+#include "context.h"
+#include "hint.h"
+#include "imports.h"
+#include "mtypes.h"
+
+
+
+void GLAPIENTRY
+_mesa_Hint( GLenum target, GLenum mode )
+{
+ GET_CURRENT_CONTEXT(ctx);
+ ASSERT_OUTSIDE_BEGIN_END(ctx);
+
+ if (MESA_VERBOSE & VERBOSE_API)
+ _mesa_debug(ctx, "glHint %s %s\n",
+ _mesa_lookup_enum_by_nr(target),
+ _mesa_lookup_enum_by_nr(mode));
+
+ if (mode != GL_NICEST && mode != GL_FASTEST && mode != GL_DONT_CARE) {
+ _mesa_error(ctx, GL_INVALID_ENUM, "glHint(mode)");
+ return;
+ }
+
+ switch (target) {
+ case GL_FOG_HINT:
+ if (ctx->Hint.Fog == mode)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_HINT);
+ ctx->Hint.Fog = mode;
+ break;
+ case GL_LINE_SMOOTH_HINT:
+ if (ctx->Hint.LineSmooth == mode)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_HINT);
+ ctx->Hint.LineSmooth = mode;
+ break;
+ case GL_PERSPECTIVE_CORRECTION_HINT:
+ if (ctx->Hint.PerspectiveCorrection == mode)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_HINT);
+ ctx->Hint.PerspectiveCorrection = mode;
+ break;
+ case GL_POINT_SMOOTH_HINT:
+ if (ctx->Hint.PointSmooth == mode)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_HINT);
+ ctx->Hint.PointSmooth = mode;
+ break;
+ case GL_POLYGON_SMOOTH_HINT:
+ if (ctx->Hint.PolygonSmooth == mode)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_HINT);
+ ctx->Hint.PolygonSmooth = mode;
+ break;
+
+ /* GL_EXT_clip_volume_hint */
+ case GL_CLIP_VOLUME_CLIPPING_HINT_EXT:
+ if (ctx->Hint.ClipVolumeClipping == mode)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_HINT);
+ ctx->Hint.ClipVolumeClipping = mode;
+ break;
+
+ /* GL_ARB_texture_compression */
+ case GL_TEXTURE_COMPRESSION_HINT_ARB:
+ if (ctx->Hint.TextureCompression == mode)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_HINT);
+ ctx->Hint.TextureCompression = mode;
+ break;
+
+ /* GL_SGIS_generate_mipmap */
+ case GL_GENERATE_MIPMAP_HINT_SGIS:
+ if (ctx->Hint.GenerateMipmap == mode)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_HINT);
+ ctx->Hint.GenerateMipmap = mode;
+ break;
+
+ /* GL_ARB_fragment_shader */
+ case GL_FRAGMENT_SHADER_DERIVATIVE_HINT_ARB:
+ if (!ctx->Extensions.ARB_fragment_shader) {
+ _mesa_error(ctx, GL_INVALID_ENUM, "glHint(target)");
+ return;
+ }
+ if (ctx->Hint.FragmentShaderDerivative == mode)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_HINT);
+ ctx->Hint.FragmentShaderDerivative = mode;
+ break;
+
+ default:
+ _mesa_error(ctx, GL_INVALID_ENUM, "glHint(target)");
+ return;
+ }
+
+ if (ctx->Driver.Hint) {
+ (*ctx->Driver.Hint)( ctx, target, mode );
+ }
+}
+
+
+/**********************************************************************/
+/***** Initialization *****/
+/**********************************************************************/
+
+void _mesa_init_hint( struct gl_context * ctx )
+{
+ /* Hint group */
+ ctx->Hint.PerspectiveCorrection = GL_DONT_CARE;
+ ctx->Hint.PointSmooth = GL_DONT_CARE;
+ ctx->Hint.LineSmooth = GL_DONT_CARE;
+ ctx->Hint.PolygonSmooth = GL_DONT_CARE;
+ ctx->Hint.Fog = GL_DONT_CARE;
+ ctx->Hint.ClipVolumeClipping = GL_DONT_CARE;
+ ctx->Hint.TextureCompression = GL_DONT_CARE;
+ ctx->Hint.GenerateMipmap = GL_DONT_CARE;
+ ctx->Hint.FragmentShaderDerivative = GL_DONT_CARE;
+}
diff --git a/mesalib/src/mesa/main/histogram.c b/mesalib/src/mesa/main/histogram.c
index 44fc1325c..feef59dd0 100644
--- a/mesalib/src/mesa/main/histogram.c
+++ b/mesalib/src/mesa/main/histogram.c
@@ -1,173 +1,173 @@
-/*
- * Mesa 3-D graphics library
- * Version: 6.3
- *
- * Copyright (C) 1999-2004 Brian Paul All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-
-#include "glheader.h"
-#include "bufferobj.h"
-#include "colormac.h"
-#include "histogram.h"
-#include "macros.h"
-#include "mfeatures.h"
-#include "main/dispatch.h"
-
-
-#if FEATURE_histogram
-
-/**********************************************************************
- * API functions
- */
-
-
-/* this is defined below */
-static void GLAPIENTRY _mesa_ResetMinmax(GLenum target);
-
-
-static void GLAPIENTRY
-_mesa_GetnMinmaxARB(GLenum target, GLboolean reset, GLenum format,
- GLenum type, GLsizei bufSize, GLvoid *values)
-{
- GET_CURRENT_CONTEXT(ctx);
-
- _mesa_error(ctx, GL_INVALID_OPERATION, "glGetMinmax");
-}
-
-
-static void GLAPIENTRY
-_mesa_GetMinmax(GLenum target, GLboolean reset, GLenum format, GLenum type,
- GLvoid *values)
-{
- _mesa_GetnMinmaxARB(target, reset, format, type, INT_MAX, values);
-}
-
-
-static void GLAPIENTRY
-_mesa_GetnHistogramARB(GLenum target, GLboolean reset, GLenum format,
- GLenum type, GLsizei bufSize, GLvoid *values)
-{
- GET_CURRENT_CONTEXT(ctx);
-
- _mesa_error(ctx, GL_INVALID_OPERATION, "glGetHistogram");
-}
-
-
-static void GLAPIENTRY
-_mesa_GetHistogram(GLenum target, GLboolean reset, GLenum format, GLenum type,
- GLvoid *values)
-{
- _mesa_GetnHistogramARB(target, reset, format, type, INT_MAX, values);
-}
-
-
-static void GLAPIENTRY
-_mesa_GetHistogramParameterfv(GLenum target, GLenum pname, GLfloat *params)
-{
- GET_CURRENT_CONTEXT(ctx);
-
- _mesa_error(ctx, GL_INVALID_OPERATION, "glGetHistogramParameterfv");
-}
-
-
-static void GLAPIENTRY
-_mesa_GetHistogramParameteriv(GLenum target, GLenum pname, GLint *params)
-{
- GET_CURRENT_CONTEXT(ctx);
-
- _mesa_error(ctx, GL_INVALID_OPERATION, "glGetHistogramParameteriv");
-}
-
-
-static void GLAPIENTRY
-_mesa_GetMinmaxParameterfv(GLenum target, GLenum pname, GLfloat *params)
-{
- GET_CURRENT_CONTEXT(ctx);
-
- _mesa_error(ctx, GL_INVALID_OPERATION, "glGetMinmaxParameterfv");
-}
-
-
-static void GLAPIENTRY
-_mesa_GetMinmaxParameteriv(GLenum target, GLenum pname, GLint *params)
-{
- GET_CURRENT_CONTEXT(ctx);
-
- _mesa_error(ctx, GL_INVALID_OPERATION, "glGetMinmaxParameteriv");
-}
-
-
-static void GLAPIENTRY
-_mesa_Histogram(GLenum target, GLsizei width, GLenum internalFormat, GLboolean sink)
-{
- GET_CURRENT_CONTEXT(ctx);
-
- _mesa_error(ctx, GL_INVALID_OPERATION, "glHistogram");
-}
-
-
-static void GLAPIENTRY
-_mesa_Minmax(GLenum target, GLenum internalFormat, GLboolean sink)
-{
- GET_CURRENT_CONTEXT(ctx);
-
- _mesa_error(ctx, GL_INVALID_OPERATION, "glMinmax");
-}
-
-
-static void GLAPIENTRY
-_mesa_ResetHistogram(GLenum target)
-{
- GET_CURRENT_CONTEXT(ctx);
-
- _mesa_error(ctx, GL_INVALID_OPERATION, "glResetHistogram");
-}
-
-
-static void GLAPIENTRY
-_mesa_ResetMinmax(GLenum target)
-{
- GET_CURRENT_CONTEXT(ctx);
-
- _mesa_error(ctx, GL_INVALID_OPERATION, "glResetMinmax");
-}
-
-
-void
-_mesa_init_histogram_dispatch(struct _glapi_table *disp)
-{
- SET_GetHistogram(disp, _mesa_GetHistogram);
- SET_GetHistogramParameterfv(disp, _mesa_GetHistogramParameterfv);
- SET_GetHistogramParameteriv(disp, _mesa_GetHistogramParameteriv);
- SET_GetMinmax(disp, _mesa_GetMinmax);
- SET_GetMinmaxParameterfv(disp, _mesa_GetMinmaxParameterfv);
- SET_GetMinmaxParameteriv(disp, _mesa_GetMinmaxParameteriv);
- SET_Histogram(disp, _mesa_Histogram);
- SET_Minmax(disp, _mesa_Minmax);
- SET_ResetHistogram(disp, _mesa_ResetHistogram);
- SET_ResetMinmax(disp, _mesa_ResetMinmax);
-
- /* GL_ARB_robustness */
- SET_GetnHistogramARB(disp, _mesa_GetnHistogramARB);
- SET_GetnMinmaxARB(disp, _mesa_GetnMinmaxARB);
-}
-
-#endif /* FEATURE_histogram */
+/*
+ * Mesa 3-D graphics library
+ * Version: 6.3
+ *
+ * Copyright (C) 1999-2004 Brian Paul All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+
+#include "glheader.h"
+#include "bufferobj.h"
+#include "colormac.h"
+#include "histogram.h"
+#include "macros.h"
+#include "mfeatures.h"
+#include "main/dispatch.h"
+
+
+#if FEATURE_histogram
+
+/**********************************************************************
+ * API functions
+ */
+
+
+/* this is defined below */
+static void GLAPIENTRY _mesa_ResetMinmax(GLenum target);
+
+
+static void GLAPIENTRY
+_mesa_GetnMinmaxARB(GLenum target, GLboolean reset, GLenum format,
+ GLenum type, GLsizei bufSize, GLvoid *values)
+{
+ GET_CURRENT_CONTEXT(ctx);
+
+ _mesa_error(ctx, GL_INVALID_OPERATION, "glGetMinmax");
+}
+
+
+static void GLAPIENTRY
+_mesa_GetMinmax(GLenum target, GLboolean reset, GLenum format, GLenum type,
+ GLvoid *values)
+{
+ _mesa_GetnMinmaxARB(target, reset, format, type, INT_MAX, values);
+}
+
+
+static void GLAPIENTRY
+_mesa_GetnHistogramARB(GLenum target, GLboolean reset, GLenum format,
+ GLenum type, GLsizei bufSize, GLvoid *values)
+{
+ GET_CURRENT_CONTEXT(ctx);
+
+ _mesa_error(ctx, GL_INVALID_OPERATION, "glGetHistogram");
+}
+
+
+static void GLAPIENTRY
+_mesa_GetHistogram(GLenum target, GLboolean reset, GLenum format, GLenum type,
+ GLvoid *values)
+{
+ _mesa_GetnHistogramARB(target, reset, format, type, INT_MAX, values);
+}
+
+
+static void GLAPIENTRY
+_mesa_GetHistogramParameterfv(GLenum target, GLenum pname, GLfloat *params)
+{
+ GET_CURRENT_CONTEXT(ctx);
+
+ _mesa_error(ctx, GL_INVALID_OPERATION, "glGetHistogramParameterfv");
+}
+
+
+static void GLAPIENTRY
+_mesa_GetHistogramParameteriv(GLenum target, GLenum pname, GLint *params)
+{
+ GET_CURRENT_CONTEXT(ctx);
+
+ _mesa_error(ctx, GL_INVALID_OPERATION, "glGetHistogramParameteriv");
+}
+
+
+static void GLAPIENTRY
+_mesa_GetMinmaxParameterfv(GLenum target, GLenum pname, GLfloat *params)
+{
+ GET_CURRENT_CONTEXT(ctx);
+
+ _mesa_error(ctx, GL_INVALID_OPERATION, "glGetMinmaxParameterfv");
+}
+
+
+static void GLAPIENTRY
+_mesa_GetMinmaxParameteriv(GLenum target, GLenum pname, GLint *params)
+{
+ GET_CURRENT_CONTEXT(ctx);
+
+ _mesa_error(ctx, GL_INVALID_OPERATION, "glGetMinmaxParameteriv");
+}
+
+
+static void GLAPIENTRY
+_mesa_Histogram(GLenum target, GLsizei width, GLenum internalFormat, GLboolean sink)
+{
+ GET_CURRENT_CONTEXT(ctx);
+
+ _mesa_error(ctx, GL_INVALID_OPERATION, "glHistogram");
+}
+
+
+static void GLAPIENTRY
+_mesa_Minmax(GLenum target, GLenum internalFormat, GLboolean sink)
+{
+ GET_CURRENT_CONTEXT(ctx);
+
+ _mesa_error(ctx, GL_INVALID_OPERATION, "glMinmax");
+}
+
+
+static void GLAPIENTRY
+_mesa_ResetHistogram(GLenum target)
+{
+ GET_CURRENT_CONTEXT(ctx);
+
+ _mesa_error(ctx, GL_INVALID_OPERATION, "glResetHistogram");
+}
+
+
+static void GLAPIENTRY
+_mesa_ResetMinmax(GLenum target)
+{
+ GET_CURRENT_CONTEXT(ctx);
+
+ _mesa_error(ctx, GL_INVALID_OPERATION, "glResetMinmax");
+}
+
+
+void
+_mesa_init_histogram_dispatch(struct _glapi_table *disp)
+{
+ SET_GetHistogram(disp, _mesa_GetHistogram);
+ SET_GetHistogramParameterfv(disp, _mesa_GetHistogramParameterfv);
+ SET_GetHistogramParameteriv(disp, _mesa_GetHistogramParameteriv);
+ SET_GetMinmax(disp, _mesa_GetMinmax);
+ SET_GetMinmaxParameterfv(disp, _mesa_GetMinmaxParameterfv);
+ SET_GetMinmaxParameteriv(disp, _mesa_GetMinmaxParameteriv);
+ SET_Histogram(disp, _mesa_Histogram);
+ SET_Minmax(disp, _mesa_Minmax);
+ SET_ResetHistogram(disp, _mesa_ResetHistogram);
+ SET_ResetMinmax(disp, _mesa_ResetMinmax);
+
+ /* GL_ARB_robustness */
+ SET_GetnHistogramARB(disp, _mesa_GetnHistogramARB);
+ SET_GetnMinmaxARB(disp, _mesa_GetnMinmaxARB);
+}
+
+#endif /* FEATURE_histogram */
diff --git a/mesalib/src/mesa/main/imports.h b/mesalib/src/mesa/main/imports.h
index ce7baabe2..315c4119d 100644
--- a/mesalib/src/mesa/main/imports.h
+++ b/mesalib/src/mesa/main/imports.h
@@ -1,621 +1,621 @@
-/*
- * Mesa 3-D graphics library
- * Version: 7.5
- *
- * Copyright (C) 1999-2008 Brian Paul All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-
-/**
- * \file imports.h
- * Standard C library function wrappers.
- *
- * This file provides wrappers for all the standard C library functions
- * like malloc(), free(), printf(), getenv(), etc.
- */
-
-
-#ifndef IMPORTS_H
-#define IMPORTS_H
-
-
-#include "compiler.h"
-#include "glheader.h"
-
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/**********************************************************************/
-/** Memory macros */
-/*@{*/
-
-/** Allocate \p BYTES bytes */
-#define MALLOC(BYTES) malloc(BYTES)
-/** Allocate and zero \p BYTES bytes */
-#define CALLOC(BYTES) calloc(1, BYTES)
-/** Allocate a structure of type \p T */
-#define MALLOC_STRUCT(T) (struct T *) malloc(sizeof(struct T))
-/** Allocate and zero a structure of type \p T */
-#define CALLOC_STRUCT(T) (struct T *) calloc(1, sizeof(struct T))
-/** Free memory */
-#define FREE(PTR) free(PTR)
-
-/*@}*/
-
-
-/*
- * For GL_ARB_vertex_buffer_object we need to treat vertex array pointers
- * as offsets into buffer stores. Since the vertex array pointer and
- * buffer store pointer are both pointers and we need to add them, we use
- * this macro.
- * Both pointers/offsets are expressed in bytes.
- */
-#define ADD_POINTERS(A, B) ( (GLubyte *) (A) + (uintptr_t) (B) )
-
-
-/**
- * Sometimes we treat GLfloats as GLints. On x86 systems, moving a float
- * as a int (thereby using integer registers instead of FP registers) is
- * a performance win. Typically, this can be done with ordinary casts.
- * But with gcc's -fstrict-aliasing flag (which defaults to on in gcc 3.0)
- * these casts generate warnings.
- * The following union typedef is used to solve that.
- */
-typedef union { GLfloat f; GLint i; } fi_type;
-
-
-
-/**********************************************************************
- * Math macros
- */
-
-#define MAX_GLUSHORT 0xffff
-#define MAX_GLUINT 0xffffffff
-
-/* Degrees to radians conversion: */
-#define DEG2RAD (M_PI/180.0)
-
-
-/***
- *** SQRTF: single-precision square root
- ***/
-#if 0 /* _mesa_sqrtf() not accurate enough - temporarily disabled */
-# define SQRTF(X) _mesa_sqrtf(X)
-#else
-# define SQRTF(X) (float) sqrt((float) (X))
-#endif
-
-
-/***
- *** INV_SQRTF: single-precision inverse square root
- ***/
-#if 0
-#define INV_SQRTF(X) _mesa_inv_sqrt(X)
-#else
-#define INV_SQRTF(X) (1.0F / SQRTF(X)) /* this is faster on a P4 */
-#endif
-
-
-/**
- * \name Work-arounds for platforms that lack C99 math functions
- */
-/*@{*/
-#if (!defined(_XOPEN_SOURCE) || (_XOPEN_SOURCE < 600)) && !defined(_ISOC99_SOURCE) \
- && (!defined(__STDC_VERSION__) || (__STDC_VERSION__ < 199901L)) \
- && (!defined(_MSC_VER) || (_MSC_VER < 1400))
-#define acosf(f) ((float) acos(f))
-#define asinf(f) ((float) asin(f))
-#define atan2f(x,y) ((float) atan2(x,y))
-#define atanf(f) ((float) atan(f))
-#define cielf(f) ((float) ciel(f))
-#define cosf(f) ((float) cos(f))
-#define coshf(f) ((float) cosh(f))
-#define expf(f) ((float) exp(f))
-#define exp2f(f) ((float) exp2(f))
-#define floorf(f) ((float) floor(f))
-#define logf(f) ((float) log(f))
-#define log2f(f) ((float) log2(f))
-#define powf(x,y) ((float) pow(x,y))
-#define sinf(f) ((float) sin(f))
-#define sinhf(f) ((float) sinh(f))
-#define sqrtf(f) ((float) sqrt(f))
-#define tanf(f) ((float) tan(f))
-#define tanhf(f) ((float) tanh(f))
-#define acoshf(f) ((float) acosh(f))
-#define asinhf(f) ((float) asinh(f))
-#define atanhf(f) ((float) atanh(f))
-#endif
-
-#if defined(_MSC_VER)
-static INLINE float truncf(float x) { return x < 0.0f ? ceilf(x) : floorf(x); }
-static INLINE float exp2f(float x) { return powf(2.0f, x); }
-static INLINE float log2f(float x) { return logf(x) * 1.442695041f; }
-static INLINE float asinhf(float x) { return logf(x + sqrtf(x * x + 1.0f)); }
-static INLINE float acoshf(float x) { return logf(x + sqrtf(x * x - 1.0f)); }
-static INLINE float atanhf(float x) { return (logf(1.0f + x) - logf(1.0f - x)) / 2.0f; }
-static INLINE int isblank(int ch) { return ch == ' ' || ch == '\t'; }
-#define strtoll(p, e, b) _strtoi64(p, e, b)
-#endif
-/*@}*/
-
-/***
- *** LOG2: Log base 2 of float
- ***/
-#ifdef USE_IEEE
-#if 0
-/* This is pretty fast, but not accurate enough (only 2 fractional bits).
- * Based on code from http://www.stereopsis.com/log2.html
- */
-static INLINE GLfloat LOG2(GLfloat x)
-{
- const GLfloat y = x * x * x * x;
- const GLuint ix = *((GLuint *) &y);
- const GLuint exp = (ix >> 23) & 0xFF;
- const GLint log2 = ((GLint) exp) - 127;
- return (GLfloat) log2 * (1.0 / 4.0); /* 4, because of x^4 above */
-}
-#endif
-/* Pretty fast, and accurate.
- * Based on code from http://www.flipcode.com/totd/
- */
-static INLINE GLfloat LOG2(GLfloat val)
-{
- fi_type num;
- GLint log_2;
- num.f = val;
- log_2 = ((num.i >> 23) & 255) - 128;
- num.i &= ~(255 << 23);
- num.i += 127 << 23;
- num.f = ((-1.0f/3) * num.f + 2) * num.f - 2.0f/3;
- return num.f + log_2;
-}
-#else
-/*
- * NOTE: log_base_2(x) = log(x) / log(2)
- * NOTE: 1.442695 = 1/log(2).
- */
-#define LOG2(x) ((GLfloat) (log(x) * 1.442695F))
-#endif
-
-
-/***
- *** IS_INF_OR_NAN: test if float is infinite or NaN
- ***/
-#ifdef USE_IEEE
-static INLINE int IS_INF_OR_NAN( float x )
-{
- fi_type tmp;
- tmp.f = x;
- return !(int)((unsigned int)((tmp.i & 0x7fffffff)-0x7f800000) >> 31);
-}
-#elif defined(isfinite)
-#define IS_INF_OR_NAN(x) (!isfinite(x))
-#elif defined(finite)
-#define IS_INF_OR_NAN(x) (!finite(x))
-#elif defined(__VMS)
-#define IS_INF_OR_NAN(x) (!finite(x))
-#elif defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
-#define IS_INF_OR_NAN(x) (!isfinite(x))
-#else
-#define IS_INF_OR_NAN(x) (!finite(x))
-#endif
-
-
-/***
- *** IS_NEGATIVE: test if float is negative
- ***/
-#if defined(USE_IEEE)
-static INLINE int GET_FLOAT_BITS( float x )
-{
- fi_type fi;
- fi.f = x;
- return fi.i;
-}
-#define IS_NEGATIVE(x) (GET_FLOAT_BITS(x) < 0)
-#else
-#define IS_NEGATIVE(x) (x < 0.0F)
-#endif
-
-
-/***
- *** DIFFERENT_SIGNS: test if two floats have opposite signs
- ***/
-#if defined(USE_IEEE)
-#define DIFFERENT_SIGNS(x,y) ((GET_FLOAT_BITS(x) ^ GET_FLOAT_BITS(y)) & (1<<31))
-#else
-/* Could just use (x*y<0) except for the flatshading requirements.
- * Maybe there's a better way?
- */
-#define DIFFERENT_SIGNS(x,y) ((x) * (y) <= 0.0F && (x) - (y) != 0.0F)
-#endif
-
-
-/***
- *** CEILF: ceiling of float
- *** FLOORF: floor of float
- *** FABSF: absolute value of float
- *** LOGF: the natural logarithm (base e) of the value
- *** EXPF: raise e to the value
- *** LDEXPF: multiply value by an integral power of two
- *** FREXPF: extract mantissa and exponent from value
- ***/
-#if defined(__gnu_linux__)
-/* C99 functions */
-#define CEILF(x) ceilf(x)
-#define FLOORF(x) floorf(x)
-#define FABSF(x) fabsf(x)
-#define LOGF(x) logf(x)
-#define EXPF(x) expf(x)
-#define LDEXPF(x,y) ldexpf(x,y)
-#define FREXPF(x,y) frexpf(x,y)
-#else
-#define CEILF(x) ((GLfloat) ceil(x))
-#define FLOORF(x) ((GLfloat) floor(x))
-#define FABSF(x) ((GLfloat) fabs(x))
-#define LOGF(x) ((GLfloat) log(x))
-#define EXPF(x) ((GLfloat) exp(x))
-#define LDEXPF(x,y) ((GLfloat) ldexp(x,y))
-#define FREXPF(x,y) ((GLfloat) frexp(x,y))
-#endif
-
-
-/***
- *** IROUND: return (as an integer) float rounded to nearest integer
- ***/
-#if defined(USE_X86_ASM) && defined(__GNUC__) && defined(__i386__)
-static INLINE int iround(float f)
-{
- int r;
- __asm__ ("fistpl %0" : "=m" (r) : "t" (f) : "st");
- return r;
-}
-#define IROUND(x) iround(x)
-#elif defined(USE_X86_ASM) && defined(_MSC_VER)
-static INLINE int iround(float f)
-{
- int r;
- _asm {
- fld f
- fistp r
- }
- return r;
-}
-#define IROUND(x) iround(x)
-#elif defined(__WATCOMC__) && defined(__386__)
-long iround(float f);
-#pragma aux iround = \
- "push eax" \
- "fistp dword ptr [esp]" \
- "pop eax" \
- parm [8087] \
- value [eax] \
- modify exact [eax];
-#define IROUND(x) iround(x)
-#else
-#define IROUND(f) ((int) (((f) >= 0.0F) ? ((f) + 0.5F) : ((f) - 0.5F)))
-#endif
-
-#define IROUND64(f) ((GLint64) (((f) >= 0.0F) ? ((f) + 0.5F) : ((f) - 0.5F)))
-
-/***
- *** IROUND_POS: return (as an integer) positive float rounded to nearest int
- ***/
-#ifdef DEBUG
-#define IROUND_POS(f) (assert((f) >= 0.0F), IROUND(f))
-#else
-#define IROUND_POS(f) (IROUND(f))
-#endif
-
-
-/***
- *** IFLOOR: return (as an integer) floor of float
- ***/
-#if defined(USE_X86_ASM) && defined(__GNUC__) && defined(__i386__)
-/*
- * IEEE floor for computers that round to nearest or even.
- * 'f' must be between -4194304 and 4194303.
- * This floor operation is done by "(iround(f + .5) + iround(f - .5)) >> 1",
- * but uses some IEEE specific tricks for better speed.
- * Contributed by Josh Vanderhoof
- */
-static INLINE int ifloor(float f)
-{
- int ai, bi;
- double af, bf;
- af = (3 << 22) + 0.5 + (double)f;
- bf = (3 << 22) + 0.5 - (double)f;
- /* GCC generates an extra fstp/fld without this. */
- __asm__ ("fstps %0" : "=m" (ai) : "t" (af) : "st");
- __asm__ ("fstps %0" : "=m" (bi) : "t" (bf) : "st");
- return (ai - bi) >> 1;
-}
-#define IFLOOR(x) ifloor(x)
-#elif defined(USE_IEEE)
-static INLINE int ifloor(float f)
-{
- int ai, bi;
- double af, bf;
- fi_type u;
-
- af = (3 << 22) + 0.5 + (double)f;
- bf = (3 << 22) + 0.5 - (double)f;
- u.f = (float) af; ai = u.i;
- u.f = (float) bf; bi = u.i;
- return (ai - bi) >> 1;
-}
-#define IFLOOR(x) ifloor(x)
-#else
-static INLINE int ifloor(float f)
-{
- int i = IROUND(f);
- return (i > f) ? i - 1 : i;
-}
-#define IFLOOR(x) ifloor(x)
-#endif
-
-
-/***
- *** ICEIL: return (as an integer) ceiling of float
- ***/
-#if defined(USE_X86_ASM) && defined(__GNUC__) && defined(__i386__)
-/*
- * IEEE ceil for computers that round to nearest or even.
- * 'f' must be between -4194304 and 4194303.
- * This ceil operation is done by "(iround(f + .5) + iround(f - .5) + 1) >> 1",
- * but uses some IEEE specific tricks for better speed.
- * Contributed by Josh Vanderhoof
- */
-static INLINE int iceil(float f)
-{
- int ai, bi;
- double af, bf;
- af = (3 << 22) + 0.5 + (double)f;
- bf = (3 << 22) + 0.5 - (double)f;
- /* GCC generates an extra fstp/fld without this. */
- __asm__ ("fstps %0" : "=m" (ai) : "t" (af) : "st");
- __asm__ ("fstps %0" : "=m" (bi) : "t" (bf) : "st");
- return (ai - bi + 1) >> 1;
-}
-#define ICEIL(x) iceil(x)
-#elif defined(USE_IEEE)
-static INLINE int iceil(float f)
-{
- int ai, bi;
- double af, bf;
- fi_type u;
- af = (3 << 22) + 0.5 + (double)f;
- bf = (3 << 22) + 0.5 - (double)f;
- u.f = (float) af; ai = u.i;
- u.f = (float) bf; bi = u.i;
- return (ai - bi + 1) >> 1;
-}
-#define ICEIL(x) iceil(x)
-#else
-static INLINE int iceil(float f)
-{
- int i = IROUND(f);
- return (i < f) ? i + 1 : i;
-}
-#define ICEIL(x) iceil(x)
-#endif
-
-
-/**
- * Is x a power of two?
- */
-static INLINE int
-_mesa_is_pow_two(int x)
-{
- return !(x & (x - 1));
-}
-
-/**
- * Round given integer to next higer power of two
- * If X is zero result is undefined.
- *
- * Source for the fallback implementation is
- * Sean Eron Anderson's webpage "Bit Twiddling Hacks"
- * http://graphics.stanford.edu/~seander/bithacks.html
- *
- * When using builtin function have to do some work
- * for case when passed values 1 to prevent hiting
- * undefined result from __builtin_clz. Undefined
- * results would be different depending on optimization
- * level used for build.
- */
-static INLINE int32_t
-_mesa_next_pow_two_32(uint32_t x)
-{
-#if defined(__GNUC__) && \
- ((__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || __GNUC__ >= 4)
- uint32_t y = (x != 1);
- return (1 + y) << ((__builtin_clz(x - y) ^ 31) );
-#else
- x--;
- x |= x >> 1;
- x |= x >> 2;
- x |= x >> 4;
- x |= x >> 8;
- x |= x >> 16;
- x++;
- return x;
-#endif
-}
-
-static INLINE int64_t
-_mesa_next_pow_two_64(uint64_t x)
-{
-#if defined(__GNUC__) && \
- ((__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || __GNUC__ >= 4)
- uint64_t y = (x != 1);
- if (sizeof(x) == sizeof(long))
- return (1 + y) << ((__builtin_clzl(x - y) ^ 63));
- else
- return (1 + y) << ((__builtin_clzll(x - y) ^ 63));
-#else
- x--;
- x |= x >> 1;
- x |= x >> 2;
- x |= x >> 4;
- x |= x >> 8;
- x |= x >> 16;
- x |= x >> 32;
- x++;
- return x;
-#endif
-}
-
-
-/**
- * Return 1 if this is a little endian machine, 0 if big endian.
- */
-static INLINE GLboolean
-_mesa_little_endian(void)
-{
- const GLuint ui = 1; /* intentionally not static */
- return *((const GLubyte *) &ui);
-}
-
-
-
-/**********************************************************************
- * Functions
- */
-
-extern void *
-_mesa_align_malloc( size_t bytes, unsigned long alignment );
-
-extern void *
-_mesa_align_calloc( size_t bytes, unsigned long alignment );
-
-extern void
-_mesa_align_free( void *ptr );
-
-extern void *
-_mesa_align_realloc(void *oldBuffer, size_t oldSize, size_t newSize,
- unsigned long alignment);
-
-extern void *
-_mesa_exec_malloc( GLuint size );
-
-extern void
-_mesa_exec_free( void *addr );
-
-extern void *
-_mesa_realloc( void *oldBuffer, size_t oldSize, size_t newSize );
-
-extern void
-_mesa_memset16( unsigned short *dst, unsigned short val, size_t n );
-
-extern double
-_mesa_sqrtd(double x);
-
-extern float
-_mesa_sqrtf(float x);
-
-extern float
-_mesa_inv_sqrtf(float x);
-
-extern void
-_mesa_init_sqrt_table(void);
-
-#ifdef __GNUC__
-
-#ifdef __MINGW32__
-#define ffs __builtin_ffs
-#define ffsll __builtin_ffsll
-#endif
-
-#define _mesa_ffs(i) ffs(i)
-#define _mesa_ffsll(i) ffsll(i)
-
-#if ((_GNUC__ == 3 && __GNUC_MINOR__ >= 4) || __GNUC__ >= 4)
-#define _mesa_bitcount(i) __builtin_popcount(i)
-#else
-extern unsigned int
-_mesa_bitcount(unsigned int n);
-#endif
-
-#else
-extern int
-_mesa_ffs(int32_t i);
-
-extern int
-_mesa_ffsll(int64_t i);
-
-extern unsigned int
-_mesa_bitcount(unsigned int n);
-#endif
-
-extern GLhalfARB
-_mesa_float_to_half(float f);
-
-extern float
-_mesa_half_to_float(GLhalfARB h);
-
-
-extern void *
-_mesa_bsearch( const void *key, const void *base, size_t nmemb, size_t size,
- int (*compar)(const void *, const void *) );
-
-extern char *
-_mesa_getenv( const char *var );
-
-extern char *
-_mesa_strdup( const char *s );
-
-extern float
-_mesa_strtof( const char *s, char **end );
-
-extern unsigned int
-_mesa_str_checksum(const char *str);
-
-extern int
-_mesa_snprintf( char *str, size_t size, const char *fmt, ... ) PRINTFLIKE(3, 4);
-
-struct gl_context;
-
-extern void
-_mesa_warning( struct gl_context *gc, const char *fmtString, ... ) PRINTFLIKE(2, 3);
-
-extern void
-_mesa_problem( const struct gl_context *ctx, const char *fmtString, ... ) PRINTFLIKE(2, 3);
-
-extern void
-_mesa_error( struct gl_context *ctx, GLenum error, const char *fmtString, ... ) PRINTFLIKE(3, 4);
-
-extern void
-_mesa_debug( const struct gl_context *ctx, const char *fmtString, ... ) PRINTFLIKE(2, 3);
-
-
-#if defined(_MSC_VER) && !defined(snprintf)
-#define snprintf _snprintf
-#endif
-
-
-#ifdef __cplusplus
-}
-#endif
-
-
-#endif /* IMPORTS_H */
+/*
+ * Mesa 3-D graphics library
+ * Version: 7.5
+ *
+ * Copyright (C) 1999-2008 Brian Paul All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+
+/**
+ * \file imports.h
+ * Standard C library function wrappers.
+ *
+ * This file provides wrappers for all the standard C library functions
+ * like malloc(), free(), printf(), getenv(), etc.
+ */
+
+
+#ifndef IMPORTS_H
+#define IMPORTS_H
+
+
+#include "compiler.h"
+#include "glheader.h"
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/**********************************************************************/
+/** Memory macros */
+/*@{*/
+
+/** Allocate \p BYTES bytes */
+#define MALLOC(BYTES) malloc(BYTES)
+/** Allocate and zero \p BYTES bytes */
+#define CALLOC(BYTES) calloc(1, BYTES)
+/** Allocate a structure of type \p T */
+#define MALLOC_STRUCT(T) (struct T *) malloc(sizeof(struct T))
+/** Allocate and zero a structure of type \p T */
+#define CALLOC_STRUCT(T) (struct T *) calloc(1, sizeof(struct T))
+/** Free memory */
+#define FREE(PTR) free(PTR)
+
+/*@}*/
+
+
+/*
+ * For GL_ARB_vertex_buffer_object we need to treat vertex array pointers
+ * as offsets into buffer stores. Since the vertex array pointer and
+ * buffer store pointer are both pointers and we need to add them, we use
+ * this macro.
+ * Both pointers/offsets are expressed in bytes.
+ */
+#define ADD_POINTERS(A, B) ( (GLubyte *) (A) + (uintptr_t) (B) )
+
+
+/**
+ * Sometimes we treat GLfloats as GLints. On x86 systems, moving a float
+ * as a int (thereby using integer registers instead of FP registers) is
+ * a performance win. Typically, this can be done with ordinary casts.
+ * But with gcc's -fstrict-aliasing flag (which defaults to on in gcc 3.0)
+ * these casts generate warnings.
+ * The following union typedef is used to solve that.
+ */
+typedef union { GLfloat f; GLint i; } fi_type;
+
+
+
+/**********************************************************************
+ * Math macros
+ */
+
+#define MAX_GLUSHORT 0xffff
+#define MAX_GLUINT 0xffffffff
+
+/* Degrees to radians conversion: */
+#define DEG2RAD (M_PI/180.0)
+
+
+/***
+ *** SQRTF: single-precision square root
+ ***/
+#if 0 /* _mesa_sqrtf() not accurate enough - temporarily disabled */
+# define SQRTF(X) _mesa_sqrtf(X)
+#else
+# define SQRTF(X) (float) sqrt((float) (X))
+#endif
+
+
+/***
+ *** INV_SQRTF: single-precision inverse square root
+ ***/
+#if 0
+#define INV_SQRTF(X) _mesa_inv_sqrt(X)
+#else
+#define INV_SQRTF(X) (1.0F / SQRTF(X)) /* this is faster on a P4 */
+#endif
+
+
+/**
+ * \name Work-arounds for platforms that lack C99 math functions
+ */
+/*@{*/
+#if (!defined(_XOPEN_SOURCE) || (_XOPEN_SOURCE < 600)) && !defined(_ISOC99_SOURCE) \
+ && (!defined(__STDC_VERSION__) || (__STDC_VERSION__ < 199901L)) \
+ && (!defined(_MSC_VER) || (_MSC_VER < 1400))
+#define acosf(f) ((float) acos(f))
+#define asinf(f) ((float) asin(f))
+#define atan2f(x,y) ((float) atan2(x,y))
+#define atanf(f) ((float) atan(f))
+#define cielf(f) ((float) ciel(f))
+#define cosf(f) ((float) cos(f))
+#define coshf(f) ((float) cosh(f))
+#define expf(f) ((float) exp(f))
+#define exp2f(f) ((float) exp2(f))
+#define floorf(f) ((float) floor(f))
+#define logf(f) ((float) log(f))
+#define log2f(f) ((float) log2(f))
+#define powf(x,y) ((float) pow(x,y))
+#define sinf(f) ((float) sin(f))
+#define sinhf(f) ((float) sinh(f))
+#define sqrtf(f) ((float) sqrt(f))
+#define tanf(f) ((float) tan(f))
+#define tanhf(f) ((float) tanh(f))
+#define acoshf(f) ((float) acosh(f))
+#define asinhf(f) ((float) asinh(f))
+#define atanhf(f) ((float) atanh(f))
+#endif
+
+#if defined(_MSC_VER)
+static INLINE float truncf(float x) { return x < 0.0f ? ceilf(x) : floorf(x); }
+static INLINE float exp2f(float x) { return powf(2.0f, x); }
+static INLINE float log2f(float x) { return logf(x) * 1.442695041f; }
+static INLINE float asinhf(float x) { return logf(x + sqrtf(x * x + 1.0f)); }
+static INLINE float acoshf(float x) { return logf(x + sqrtf(x * x - 1.0f)); }
+static INLINE float atanhf(float x) { return (logf(1.0f + x) - logf(1.0f - x)) / 2.0f; }
+static INLINE int isblank(int ch) { return ch == ' ' || ch == '\t'; }
+#define strtoll(p, e, b) _strtoi64(p, e, b)
+#endif
+/*@}*/
+
+/***
+ *** LOG2: Log base 2 of float
+ ***/
+#ifdef USE_IEEE
+#if 0
+/* This is pretty fast, but not accurate enough (only 2 fractional bits).
+ * Based on code from http://www.stereopsis.com/log2.html
+ */
+static INLINE GLfloat LOG2(GLfloat x)
+{
+ const GLfloat y = x * x * x * x;
+ const GLuint ix = *((GLuint *) &y);
+ const GLuint exp = (ix >> 23) & 0xFF;
+ const GLint log2 = ((GLint) exp) - 127;
+ return (GLfloat) log2 * (1.0 / 4.0); /* 4, because of x^4 above */
+}
+#endif
+/* Pretty fast, and accurate.
+ * Based on code from http://www.flipcode.com/totd/
+ */
+static INLINE GLfloat LOG2(GLfloat val)
+{
+ fi_type num;
+ GLint log_2;
+ num.f = val;
+ log_2 = ((num.i >> 23) & 255) - 128;
+ num.i &= ~(255 << 23);
+ num.i += 127 << 23;
+ num.f = ((-1.0f/3) * num.f + 2) * num.f - 2.0f/3;
+ return num.f + log_2;
+}
+#else
+/*
+ * NOTE: log_base_2(x) = log(x) / log(2)
+ * NOTE: 1.442695 = 1/log(2).
+ */
+#define LOG2(x) ((GLfloat) (log(x) * 1.442695F))
+#endif
+
+
+/***
+ *** IS_INF_OR_NAN: test if float is infinite or NaN
+ ***/
+#ifdef USE_IEEE
+static INLINE int IS_INF_OR_NAN( float x )
+{
+ fi_type tmp;
+ tmp.f = x;
+ return !(int)((unsigned int)((tmp.i & 0x7fffffff)-0x7f800000) >> 31);
+}
+#elif defined(isfinite)
+#define IS_INF_OR_NAN(x) (!isfinite(x))
+#elif defined(finite)
+#define IS_INF_OR_NAN(x) (!finite(x))
+#elif defined(__VMS)
+#define IS_INF_OR_NAN(x) (!finite(x))
+#elif defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
+#define IS_INF_OR_NAN(x) (!isfinite(x))
+#else
+#define IS_INF_OR_NAN(x) (!finite(x))
+#endif
+
+
+/***
+ *** IS_NEGATIVE: test if float is negative
+ ***/
+#if defined(USE_IEEE)
+static INLINE int GET_FLOAT_BITS( float x )
+{
+ fi_type fi;
+ fi.f = x;
+ return fi.i;
+}
+#define IS_NEGATIVE(x) (GET_FLOAT_BITS(x) < 0)
+#else
+#define IS_NEGATIVE(x) (x < 0.0F)
+#endif
+
+
+/***
+ *** DIFFERENT_SIGNS: test if two floats have opposite signs
+ ***/
+#if defined(USE_IEEE)
+#define DIFFERENT_SIGNS(x,y) ((GET_FLOAT_BITS(x) ^ GET_FLOAT_BITS(y)) & (1<<31))
+#else
+/* Could just use (x*y<0) except for the flatshading requirements.
+ * Maybe there's a better way?
+ */
+#define DIFFERENT_SIGNS(x,y) ((x) * (y) <= 0.0F && (x) - (y) != 0.0F)
+#endif
+
+
+/***
+ *** CEILF: ceiling of float
+ *** FLOORF: floor of float
+ *** FABSF: absolute value of float
+ *** LOGF: the natural logarithm (base e) of the value
+ *** EXPF: raise e to the value
+ *** LDEXPF: multiply value by an integral power of two
+ *** FREXPF: extract mantissa and exponent from value
+ ***/
+#if defined(__gnu_linux__)
+/* C99 functions */
+#define CEILF(x) ceilf(x)
+#define FLOORF(x) floorf(x)
+#define FABSF(x) fabsf(x)
+#define LOGF(x) logf(x)
+#define EXPF(x) expf(x)
+#define LDEXPF(x,y) ldexpf(x,y)
+#define FREXPF(x,y) frexpf(x,y)
+#else
+#define CEILF(x) ((GLfloat) ceil(x))
+#define FLOORF(x) ((GLfloat) floor(x))
+#define FABSF(x) ((GLfloat) fabs(x))
+#define LOGF(x) ((GLfloat) log(x))
+#define EXPF(x) ((GLfloat) exp(x))
+#define LDEXPF(x,y) ((GLfloat) ldexp(x,y))
+#define FREXPF(x,y) ((GLfloat) frexp(x,y))
+#endif
+
+
+/***
+ *** IROUND: return (as an integer) float rounded to nearest integer
+ ***/
+#if defined(USE_X86_ASM) && defined(__GNUC__) && defined(__i386__)
+static INLINE int iround(float f)
+{
+ int r;
+ __asm__ ("fistpl %0" : "=m" (r) : "t" (f) : "st");
+ return r;
+}
+#define IROUND(x) iround(x)
+#elif defined(USE_X86_ASM) && defined(_MSC_VER)
+static INLINE int iround(float f)
+{
+ int r;
+ _asm {
+ fld f
+ fistp r
+ }
+ return r;
+}
+#define IROUND(x) iround(x)
+#elif defined(__WATCOMC__) && defined(__386__)
+long iround(float f);
+#pragma aux iround = \
+ "push eax" \
+ "fistp dword ptr [esp]" \
+ "pop eax" \
+ parm [8087] \
+ value [eax] \
+ modify exact [eax];
+#define IROUND(x) iround(x)
+#else
+#define IROUND(f) ((int) (((f) >= 0.0F) ? ((f) + 0.5F) : ((f) - 0.5F)))
+#endif
+
+#define IROUND64(f) ((GLint64) (((f) >= 0.0F) ? ((f) + 0.5F) : ((f) - 0.5F)))
+
+/***
+ *** IROUND_POS: return (as an integer) positive float rounded to nearest int
+ ***/
+#ifdef DEBUG
+#define IROUND_POS(f) (assert((f) >= 0.0F), IROUND(f))
+#else
+#define IROUND_POS(f) (IROUND(f))
+#endif
+
+
+/***
+ *** IFLOOR: return (as an integer) floor of float
+ ***/
+#if defined(USE_X86_ASM) && defined(__GNUC__) && defined(__i386__)
+/*
+ * IEEE floor for computers that round to nearest or even.
+ * 'f' must be between -4194304 and 4194303.
+ * This floor operation is done by "(iround(f + .5) + iround(f - .5)) >> 1",
+ * but uses some IEEE specific tricks for better speed.
+ * Contributed by Josh Vanderhoof
+ */
+static INLINE int ifloor(float f)
+{
+ int ai, bi;
+ double af, bf;
+ af = (3 << 22) + 0.5 + (double)f;
+ bf = (3 << 22) + 0.5 - (double)f;
+ /* GCC generates an extra fstp/fld without this. */
+ __asm__ ("fstps %0" : "=m" (ai) : "t" (af) : "st");
+ __asm__ ("fstps %0" : "=m" (bi) : "t" (bf) : "st");
+ return (ai - bi) >> 1;
+}
+#define IFLOOR(x) ifloor(x)
+#elif defined(USE_IEEE)
+static INLINE int ifloor(float f)
+{
+ int ai, bi;
+ double af, bf;
+ fi_type u;
+
+ af = (3 << 22) + 0.5 + (double)f;
+ bf = (3 << 22) + 0.5 - (double)f;
+ u.f = (float) af; ai = u.i;
+ u.f = (float) bf; bi = u.i;
+ return (ai - bi) >> 1;
+}
+#define IFLOOR(x) ifloor(x)
+#else
+static INLINE int ifloor(float f)
+{
+ int i = IROUND(f);
+ return (i > f) ? i - 1 : i;
+}
+#define IFLOOR(x) ifloor(x)
+#endif
+
+
+/***
+ *** ICEIL: return (as an integer) ceiling of float
+ ***/
+#if defined(USE_X86_ASM) && defined(__GNUC__) && defined(__i386__)
+/*
+ * IEEE ceil for computers that round to nearest or even.
+ * 'f' must be between -4194304 and 4194303.
+ * This ceil operation is done by "(iround(f + .5) + iround(f - .5) + 1) >> 1",
+ * but uses some IEEE specific tricks for better speed.
+ * Contributed by Josh Vanderhoof
+ */
+static INLINE int iceil(float f)
+{
+ int ai, bi;
+ double af, bf;
+ af = (3 << 22) + 0.5 + (double)f;
+ bf = (3 << 22) + 0.5 - (double)f;
+ /* GCC generates an extra fstp/fld without this. */
+ __asm__ ("fstps %0" : "=m" (ai) : "t" (af) : "st");
+ __asm__ ("fstps %0" : "=m" (bi) : "t" (bf) : "st");
+ return (ai - bi + 1) >> 1;
+}
+#define ICEIL(x) iceil(x)
+#elif defined(USE_IEEE)
+static INLINE int iceil(float f)
+{
+ int ai, bi;
+ double af, bf;
+ fi_type u;
+ af = (3 << 22) + 0.5 + (double)f;
+ bf = (3 << 22) + 0.5 - (double)f;
+ u.f = (float) af; ai = u.i;
+ u.f = (float) bf; bi = u.i;
+ return (ai - bi + 1) >> 1;
+}
+#define ICEIL(x) iceil(x)
+#else
+static INLINE int iceil(float f)
+{
+ int i = IROUND(f);
+ return (i < f) ? i + 1 : i;
+}
+#define ICEIL(x) iceil(x)
+#endif
+
+
+/**
+ * Is x a power of two?
+ */
+static INLINE int
+_mesa_is_pow_two(int x)
+{
+ return !(x & (x - 1));
+}
+
+/**
+ * Round given integer to next higer power of two
+ * If X is zero result is undefined.
+ *
+ * Source for the fallback implementation is
+ * Sean Eron Anderson's webpage "Bit Twiddling Hacks"
+ * http://graphics.stanford.edu/~seander/bithacks.html
+ *
+ * When using builtin function have to do some work
+ * for case when passed values 1 to prevent hiting
+ * undefined result from __builtin_clz. Undefined
+ * results would be different depending on optimization
+ * level used for build.
+ */
+static INLINE int32_t
+_mesa_next_pow_two_32(uint32_t x)
+{
+#if defined(__GNUC__) && \
+ ((__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || __GNUC__ >= 4)
+ uint32_t y = (x != 1);
+ return (1 + y) << ((__builtin_clz(x - y) ^ 31) );
+#else
+ x--;
+ x |= x >> 1;
+ x |= x >> 2;
+ x |= x >> 4;
+ x |= x >> 8;
+ x |= x >> 16;
+ x++;
+ return x;
+#endif
+}
+
+static INLINE int64_t
+_mesa_next_pow_two_64(uint64_t x)
+{
+#if defined(__GNUC__) && \
+ ((__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || __GNUC__ >= 4)
+ uint64_t y = (x != 1);
+ if (sizeof(x) == sizeof(long))
+ return (1 + y) << ((__builtin_clzl(x - y) ^ 63));
+ else
+ return (1 + y) << ((__builtin_clzll(x - y) ^ 63));
+#else
+ x--;
+ x |= x >> 1;
+ x |= x >> 2;
+ x |= x >> 4;
+ x |= x >> 8;
+ x |= x >> 16;
+ x |= x >> 32;
+ x++;
+ return x;
+#endif
+}
+
+
+/**
+ * Return 1 if this is a little endian machine, 0 if big endian.
+ */
+static INLINE GLboolean
+_mesa_little_endian(void)
+{
+ const GLuint ui = 1; /* intentionally not static */
+ return *((const GLubyte *) &ui);
+}
+
+
+
+/**********************************************************************
+ * Functions
+ */
+
+extern void *
+_mesa_align_malloc( size_t bytes, unsigned long alignment );
+
+extern void *
+_mesa_align_calloc( size_t bytes, unsigned long alignment );
+
+extern void
+_mesa_align_free( void *ptr );
+
+extern void *
+_mesa_align_realloc(void *oldBuffer, size_t oldSize, size_t newSize,
+ unsigned long alignment);
+
+extern void *
+_mesa_exec_malloc( GLuint size );
+
+extern void
+_mesa_exec_free( void *addr );
+
+extern void *
+_mesa_realloc( void *oldBuffer, size_t oldSize, size_t newSize );
+
+extern void
+_mesa_memset16( unsigned short *dst, unsigned short val, size_t n );
+
+extern double
+_mesa_sqrtd(double x);
+
+extern float
+_mesa_sqrtf(float x);
+
+extern float
+_mesa_inv_sqrtf(float x);
+
+extern void
+_mesa_init_sqrt_table(void);
+
+#ifdef __GNUC__
+
+#ifdef __MINGW32__
+#define ffs __builtin_ffs
+#define ffsll __builtin_ffsll
+#endif
+
+#define _mesa_ffs(i) ffs(i)
+#define _mesa_ffsll(i) ffsll(i)
+
+#if ((_GNUC__ == 3 && __GNUC_MINOR__ >= 4) || __GNUC__ >= 4)
+#define _mesa_bitcount(i) __builtin_popcount(i)
+#else
+extern unsigned int
+_mesa_bitcount(unsigned int n);
+#endif
+
+#else
+extern int
+_mesa_ffs(int32_t i);
+
+extern int
+_mesa_ffsll(int64_t i);
+
+extern unsigned int
+_mesa_bitcount(unsigned int n);
+#endif
+
+extern GLhalfARB
+_mesa_float_to_half(float f);
+
+extern float
+_mesa_half_to_float(GLhalfARB h);
+
+
+extern void *
+_mesa_bsearch( const void *key, const void *base, size_t nmemb, size_t size,
+ int (*compar)(const void *, const void *) );
+
+extern char *
+_mesa_getenv( const char *var );
+
+extern char *
+_mesa_strdup( const char *s );
+
+extern float
+_mesa_strtof( const char *s, char **end );
+
+extern unsigned int
+_mesa_str_checksum(const char *str);
+
+extern int
+_mesa_snprintf( char *str, size_t size, const char *fmt, ... ) PRINTFLIKE(3, 4);
+
+struct gl_context;
+
+extern void
+_mesa_warning( struct gl_context *gc, const char *fmtString, ... ) PRINTFLIKE(2, 3);
+
+extern void
+_mesa_problem( const struct gl_context *ctx, const char *fmtString, ... ) PRINTFLIKE(2, 3);
+
+extern void
+_mesa_error( struct gl_context *ctx, GLenum error, const char *fmtString, ... ) PRINTFLIKE(3, 4);
+
+extern void
+_mesa_debug( const struct gl_context *ctx, const char *fmtString, ... ) PRINTFLIKE(2, 3);
+
+
+#if defined(_MSC_VER) && !defined(snprintf)
+#define snprintf _snprintf
+#endif
+
+
+#ifdef __cplusplus
+}
+#endif
+
+
+#endif /* IMPORTS_H */
diff --git a/mesalib/src/mesa/main/lines.c b/mesalib/src/mesa/main/lines.c
index 79bf5679d..1df409f45 100644
--- a/mesalib/src/mesa/main/lines.c
+++ b/mesalib/src/mesa/main/lines.c
@@ -1,117 +1,117 @@
-/*
- * Mesa 3-D graphics library
- * Version: 6.5.3
- *
- * Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-
-#include "glheader.h"
-#include "context.h"
-#include "lines.h"
-#include "macros.h"
-#include "mtypes.h"
-
-
-/**
- * Set the line width.
- *
- * \param width line width in pixels.
- *
- * \sa glLineWidth().
- */
-void GLAPIENTRY
-_mesa_LineWidth( GLfloat width )
-{
- GET_CURRENT_CONTEXT(ctx);
- ASSERT_OUTSIDE_BEGIN_END(ctx);
-
- if (MESA_VERBOSE & VERBOSE_API)
- _mesa_debug(ctx, "glLineWidth %f\n", width);
-
- if (width<=0.0) {
- _mesa_error( ctx, GL_INVALID_VALUE, "glLineWidth" );
- return;
- }
-
- if (ctx->Line.Width == width)
- return;
-
- FLUSH_VERTICES(ctx, _NEW_LINE);
- ctx->Line.Width = width;
-
- if (ctx->Driver.LineWidth)
- ctx->Driver.LineWidth(ctx, width);
-}
-
-
-/**
- * Set the line stipple pattern.
- *
- * \param factor pattern scale factor.
- * \param pattern bit pattern.
- *
- * \sa glLineStipple().
- *
- * Updates gl_line_attrib::StippleFactor and gl_line_attrib::StipplePattern. On
- * change flushes the vertices and notifies the driver via
- * the dd_function_table::LineStipple callback.
- */
-void GLAPIENTRY
-_mesa_LineStipple( GLint factor, GLushort pattern )
-{
- GET_CURRENT_CONTEXT(ctx);
- ASSERT_OUTSIDE_BEGIN_END(ctx);
-
- if (MESA_VERBOSE & VERBOSE_API)
- _mesa_debug(ctx, "glLineStipple %d %u\n", factor, pattern);
-
- factor = CLAMP( factor, 1, 256 );
-
- if (ctx->Line.StippleFactor == factor &&
- ctx->Line.StipplePattern == pattern)
- return;
-
- FLUSH_VERTICES(ctx, _NEW_LINE);
- ctx->Line.StippleFactor = factor;
- ctx->Line.StipplePattern = pattern;
-
- if (ctx->Driver.LineStipple)
- ctx->Driver.LineStipple( ctx, factor, pattern );
-}
-
-
-/**
- * Initialize the context line state.
- *
- * \param ctx GL context.
- *
- * Initializes __struct gl_contextRec::Line and line related constants in
- * __struct gl_contextRec::Const.
- */
-void GLAPIENTRY
-_mesa_init_line( struct gl_context * ctx )
-{
- ctx->Line.SmoothFlag = GL_FALSE;
- ctx->Line.StippleFlag = GL_FALSE;
- ctx->Line.Width = 1.0;
- ctx->Line.StipplePattern = 0xffff;
- ctx->Line.StippleFactor = 1;
-}
+/*
+ * Mesa 3-D graphics library
+ * Version: 6.5.3
+ *
+ * Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+
+#include "glheader.h"
+#include "context.h"
+#include "lines.h"
+#include "macros.h"
+#include "mtypes.h"
+
+
+/**
+ * Set the line width.
+ *
+ * \param width line width in pixels.
+ *
+ * \sa glLineWidth().
+ */
+void GLAPIENTRY
+_mesa_LineWidth( GLfloat width )
+{
+ GET_CURRENT_CONTEXT(ctx);
+ ASSERT_OUTSIDE_BEGIN_END(ctx);
+
+ if (MESA_VERBOSE & VERBOSE_API)
+ _mesa_debug(ctx, "glLineWidth %f\n", width);
+
+ if (width<=0.0) {
+ _mesa_error( ctx, GL_INVALID_VALUE, "glLineWidth" );
+ return;
+ }
+
+ if (ctx->Line.Width == width)
+ return;
+
+ FLUSH_VERTICES(ctx, _NEW_LINE);
+ ctx->Line.Width = width;
+
+ if (ctx->Driver.LineWidth)
+ ctx->Driver.LineWidth(ctx, width);
+}
+
+
+/**
+ * Set the line stipple pattern.
+ *
+ * \param factor pattern scale factor.
+ * \param pattern bit pattern.
+ *
+ * \sa glLineStipple().
+ *
+ * Updates gl_line_attrib::StippleFactor and gl_line_attrib::StipplePattern. On
+ * change flushes the vertices and notifies the driver via
+ * the dd_function_table::LineStipple callback.
+ */
+void GLAPIENTRY
+_mesa_LineStipple( GLint factor, GLushort pattern )
+{
+ GET_CURRENT_CONTEXT(ctx);
+ ASSERT_OUTSIDE_BEGIN_END(ctx);
+
+ if (MESA_VERBOSE & VERBOSE_API)
+ _mesa_debug(ctx, "glLineStipple %d %u\n", factor, pattern);
+
+ factor = CLAMP( factor, 1, 256 );
+
+ if (ctx->Line.StippleFactor == factor &&
+ ctx->Line.StipplePattern == pattern)
+ return;
+
+ FLUSH_VERTICES(ctx, _NEW_LINE);
+ ctx->Line.StippleFactor = factor;
+ ctx->Line.StipplePattern = pattern;
+
+ if (ctx->Driver.LineStipple)
+ ctx->Driver.LineStipple( ctx, factor, pattern );
+}
+
+
+/**
+ * Initialize the context line state.
+ *
+ * \param ctx GL context.
+ *
+ * Initializes __struct gl_contextRec::Line and line related constants in
+ * __struct gl_contextRec::Const.
+ */
+void GLAPIENTRY
+_mesa_init_line( struct gl_context * ctx )
+{
+ ctx->Line.SmoothFlag = GL_FALSE;
+ ctx->Line.StippleFlag = GL_FALSE;
+ ctx->Line.Width = 1.0;
+ ctx->Line.StipplePattern = 0xffff;
+ ctx->Line.StippleFactor = 1;
+}
diff --git a/mesalib/src/mesa/main/macros.h b/mesalib/src/mesa/main/macros.h
index 01e4d20af..1d5d7f346 100644
--- a/mesalib/src/mesa/main/macros.h
+++ b/mesalib/src/mesa/main/macros.h
@@ -1,725 +1,725 @@
-/**
- * \file macros.h
- * A collection of useful macros.
- */
-
-/*
- * Mesa 3-D graphics library
- * Version: 6.5.2
- *
- * Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-
-#ifndef MACROS_H
-#define MACROS_H
-
-#include "imports.h"
-
-
-/**
- * \name Integer / float conversion for colors, normals, etc.
- */
-/*@{*/
-
-/** Convert GLubyte in [0,255] to GLfloat in [0.0,1.0] */
-extern GLfloat _mesa_ubyte_to_float_color_tab[256];
-#define UBYTE_TO_FLOAT(u) _mesa_ubyte_to_float_color_tab[(unsigned int)(u)]
-
-/** Convert GLfloat in [0.0,1.0] to GLubyte in [0,255] */
-#define FLOAT_TO_UBYTE(X) ((GLubyte) (GLint) ((X) * 255.0F))
-
-
-/** Convert GLbyte in [-128,127] to GLfloat in [-1.0,1.0] */
-#define BYTE_TO_FLOAT(B) ((2.0F * (B) + 1.0F) * (1.0F/255.0F))
-
-/** Convert GLfloat in [-1.0,1.0] to GLbyte in [-128,127] */
-#define FLOAT_TO_BYTE(X) ( (((GLint) (255.0F * (X))) - 1) / 2 )
-
-
-/** Convert GLbyte in [-128,127] to GLfloat in [-1.0,1.0], texture/fb data */
-#define BYTE_TO_FLOAT_TEX(B) ((B) == -128 ? -1.0F : (B) * (1.0F/127.0F))
-
-/** Convert GLfloat in [-1.0,1.0] to GLbyte in [-128,127], texture/fb data */
-#define FLOAT_TO_BYTE_TEX(X) CLAMP( (GLint) (127.0F * (X)), -128, 127 )
-
-/** Convert GLushort in [0,65535] to GLfloat in [0.0,1.0] */
-#define USHORT_TO_FLOAT(S) ((GLfloat) (S) * (1.0F / 65535.0F))
-
-/** Convert GLfloat in [0.0,1.0] to GLushort in [0, 65535] */
-#define FLOAT_TO_USHORT(X) ((GLuint) ((X) * 65535.0F))
-
-
-/** Convert GLshort in [-32768,32767] to GLfloat in [-1.0,1.0] */
-#define SHORT_TO_FLOAT(S) ((2.0F * (S) + 1.0F) * (1.0F/65535.0F))
-
-/** Convert GLfloat in [-1.0,1.0] to GLshort in [-32768,32767] */
-#define FLOAT_TO_SHORT(X) ( (((GLint) (65535.0F * (X))) - 1) / 2 )
-
-
-/** Convert GLshort in [-32768,32767] to GLfloat in [-1.0,1.0], texture/fb data */
-#define SHORT_TO_FLOAT_TEX(S) ((S) == -32768 ? -1.0F : (S) * (1.0F/32767.0F))
-
-/** Convert GLfloat in [-1.0,1.0] to GLshort in [-32768,32767], texture/fb data */
-#define FLOAT_TO_SHORT_TEX(X) ( (GLint) (32767.0F * (X)) )
-
-
-/** Convert GLuint in [0,4294967295] to GLfloat in [0.0,1.0] */
-#define UINT_TO_FLOAT(U) ((GLfloat) ((U) * (1.0F / 4294967295.0)))
-
-/** Convert GLfloat in [0.0,1.0] to GLuint in [0,4294967295] */
-#define FLOAT_TO_UINT(X) ((GLuint) ((X) * 4294967295.0))
-
-
-/** Convert GLint in [-2147483648,2147483647] to GLfloat in [-1.0,1.0] */
-#define INT_TO_FLOAT(I) ((GLfloat) ((2.0F * (I) + 1.0F) * (1.0F/4294967294.0)))
-
-/** Convert GLfloat in [-1.0,1.0] to GLint in [-2147483648,2147483647] */
-/* causes overflow:
-#define FLOAT_TO_INT(X) ( (((GLint) (4294967294.0 * (X))) - 1) / 2 )
-*/
-/* a close approximation: */
-#define FLOAT_TO_INT(X) ( (GLint) (2147483647.0 * (X)) )
-
-/** Convert GLfloat in [-1.0,1.0] to GLint64 in [-(1<<63),(1 << 63) -1] */
-#define FLOAT_TO_INT64(X) ( (GLint64) (9223372036854775807.0 * (double)(X)) )
-
-
-/** Convert GLint in [-2147483648,2147483647] to GLfloat in [-1.0,1.0], texture/fb data */
-#define INT_TO_FLOAT_TEX(I) ((I) == -2147483648 ? -1.0F : (I) * (1.0F/2147483647.0))
-
-/** Convert GLfloat in [-1.0,1.0] to GLint in [-2147483648,2147483647], texture/fb data */
-#define FLOAT_TO_INT_TEX(X) ( (GLint) (2147483647.0 * (X)) )
-
-
-#define BYTE_TO_UBYTE(b) ((GLubyte) ((b) < 0 ? 0 : (GLubyte) (b)))
-#define SHORT_TO_UBYTE(s) ((GLubyte) ((s) < 0 ? 0 : (GLubyte) ((s) >> 7)))
-#define USHORT_TO_UBYTE(s) ((GLubyte) ((s) >> 8))
-#define INT_TO_UBYTE(i) ((GLubyte) ((i) < 0 ? 0 : (GLubyte) ((i) >> 23)))
-#define UINT_TO_UBYTE(i) ((GLubyte) ((i) >> 24))
-
-
-#define BYTE_TO_USHORT(b) ((b) < 0 ? 0 : ((GLushort) (((b) * 65535) / 255)))
-#define UBYTE_TO_USHORT(b) (((GLushort) (b) << 8) | (GLushort) (b))
-#define SHORT_TO_USHORT(s) ((s) < 0 ? 0 : ((GLushort) (((s) * 65535 / 32767))))
-#define INT_TO_USHORT(i) ((i) < 0 ? 0 : ((GLushort) ((i) >> 15)))
-#define UINT_TO_USHORT(i) ((i) < 0 ? 0 : ((GLushort) ((i) >> 16)))
-#define UNCLAMPED_FLOAT_TO_USHORT(us, f) \
- us = ( (GLushort) IROUND( CLAMP((f), 0.0F, 1.0F) * 65535.0F) )
-#define CLAMPED_FLOAT_TO_USHORT(us, f) \
- us = ( (GLushort) IROUND( (f) * 65535.0F) )
-
-#define UNCLAMPED_FLOAT_TO_SHORT(s, f) \
- s = ( (GLshort) IROUND( CLAMP((f), -1.0F, 1.0F) * 32767.0F) )
-
-/***
- *** UNCLAMPED_FLOAT_TO_UBYTE: clamp float to [0,1] and map to ubyte in [0,255]
- *** CLAMPED_FLOAT_TO_UBYTE: map float known to be in [0,1] to ubyte in [0,255]
- ***/
-#if defined(USE_IEEE) && !defined(DEBUG)
-#define IEEE_0996 0x3f7f0000 /* 0.996 or so */
-/* This function/macro is sensitive to precision. Test very carefully
- * if you change it!
- */
-#define UNCLAMPED_FLOAT_TO_UBYTE(UB, F) \
- do { \
- fi_type __tmp; \
- __tmp.f = (F); \
- if (__tmp.i < 0) \
- UB = (GLubyte) 0; \
- else if (__tmp.i >= IEEE_0996) \
- UB = (GLubyte) 255; \
- else { \
- __tmp.f = __tmp.f * (255.0F/256.0F) + 32768.0F; \
- UB = (GLubyte) __tmp.i; \
- } \
- } while (0)
-#define CLAMPED_FLOAT_TO_UBYTE(UB, F) \
- do { \
- fi_type __tmp; \
- __tmp.f = (F) * (255.0F/256.0F) + 32768.0F; \
- UB = (GLubyte) __tmp.i; \
- } while (0)
-#else
-#define UNCLAMPED_FLOAT_TO_UBYTE(ub, f) \
- ub = ((GLubyte) IROUND(CLAMP((f), 0.0F, 1.0F) * 255.0F))
-#define CLAMPED_FLOAT_TO_UBYTE(ub, f) \
- ub = ((GLubyte) IROUND((f) * 255.0F))
-#endif
-
-/*@}*/
-
-
-/** Stepping a GLfloat pointer by a byte stride */
-#define STRIDE_F(p, i) (p = (GLfloat *)((GLubyte *)p + i))
-/** Stepping a GLuint pointer by a byte stride */
-#define STRIDE_UI(p, i) (p = (GLuint *)((GLubyte *)p + i))
-/** Stepping a GLubyte[4] pointer by a byte stride */
-#define STRIDE_4UB(p, i) (p = (GLubyte (*)[4])((GLubyte *)p + i))
-/** Stepping a GLfloat[4] pointer by a byte stride */
-#define STRIDE_4F(p, i) (p = (GLfloat (*)[4])((GLubyte *)p + i))
-/** Stepping a GLchan[4] pointer by a byte stride */
-#define STRIDE_4CHAN(p, i) (p = (GLchan (*)[4])((GLubyte *)p + i))
-/** Stepping a GLchan pointer by a byte stride */
-#define STRIDE_CHAN(p, i) (p = (GLchan *)((GLubyte *)p + i))
-/** Stepping a \p t pointer by a byte stride */
-#define STRIDE_T(p, t, i) (p = (t)((GLubyte *)p + i))
-
-
-/**********************************************************************/
-/** \name 4-element vector operations */
-/*@{*/
-
-/** Zero */
-#define ZERO_4V( DST ) (DST)[0] = (DST)[1] = (DST)[2] = (DST)[3] = 0
-
-/** Test for equality */
-#define TEST_EQ_4V(a,b) ((a)[0] == (b)[0] && \
- (a)[1] == (b)[1] && \
- (a)[2] == (b)[2] && \
- (a)[3] == (b)[3])
-
-/** Test for equality (unsigned bytes) */
-#if defined(__i386__)
-#define TEST_EQ_4UBV(DST, SRC) *((GLuint*)(DST)) == *((GLuint*)(SRC))
-#else
-#define TEST_EQ_4UBV(DST, SRC) TEST_EQ_4V(DST, SRC)
-#endif
-
-/** Copy a 4-element vector */
-#define COPY_4V( DST, SRC ) \
-do { \
- (DST)[0] = (SRC)[0]; \
- (DST)[1] = (SRC)[1]; \
- (DST)[2] = (SRC)[2]; \
- (DST)[3] = (SRC)[3]; \
-} while (0)
-
-/** Copy a 4-element vector with cast */
-#define COPY_4V_CAST( DST, SRC, CAST ) \
-do { \
- (DST)[0] = (CAST)(SRC)[0]; \
- (DST)[1] = (CAST)(SRC)[1]; \
- (DST)[2] = (CAST)(SRC)[2]; \
- (DST)[3] = (CAST)(SRC)[3]; \
-} while (0)
-
-/** Copy a 4-element unsigned byte vector */
-#if defined(__i386__)
-#define COPY_4UBV(DST, SRC) \
-do { \
- *((GLuint*)(DST)) = *((GLuint*)(SRC)); \
-} while (0)
-#else
-/* The GLuint cast might fail if DST or SRC are not dword-aligned (RISC) */
-#define COPY_4UBV(DST, SRC) \
-do { \
- (DST)[0] = (SRC)[0]; \
- (DST)[1] = (SRC)[1]; \
- (DST)[2] = (SRC)[2]; \
- (DST)[3] = (SRC)[3]; \
-} while (0)
-#endif
-
-/**
- * Copy a 4-element float vector
- * memcpy seems to be most efficient
- */
-#define COPY_4FV( DST, SRC ) \
-do { \
- memcpy(DST, SRC, sizeof(GLfloat) * 4); \
-} while (0)
-
-/** Copy \p SZ elements into a 4-element vector */
-#define COPY_SZ_4V(DST, SZ, SRC) \
-do { \
- switch (SZ) { \
- case 4: (DST)[3] = (SRC)[3]; \
- case 3: (DST)[2] = (SRC)[2]; \
- case 2: (DST)[1] = (SRC)[1]; \
- case 1: (DST)[0] = (SRC)[0]; \
- } \
-} while(0)
-
-/** Copy \p SZ elements into a homegeneous (4-element) vector, giving
- * default values to the remaining */
-#define COPY_CLEAN_4V(DST, SZ, SRC) \
-do { \
- ASSIGN_4V( DST, 0, 0, 0, 1 ); \
- COPY_SZ_4V( DST, SZ, SRC ); \
-} while (0)
-
-/** Subtraction */
-#define SUB_4V( DST, SRCA, SRCB ) \
-do { \
- (DST)[0] = (SRCA)[0] - (SRCB)[0]; \
- (DST)[1] = (SRCA)[1] - (SRCB)[1]; \
- (DST)[2] = (SRCA)[2] - (SRCB)[2]; \
- (DST)[3] = (SRCA)[3] - (SRCB)[3]; \
-} while (0)
-
-/** Addition */
-#define ADD_4V( DST, SRCA, SRCB ) \
-do { \
- (DST)[0] = (SRCA)[0] + (SRCB)[0]; \
- (DST)[1] = (SRCA)[1] + (SRCB)[1]; \
- (DST)[2] = (SRCA)[2] + (SRCB)[2]; \
- (DST)[3] = (SRCA)[3] + (SRCB)[3]; \
-} while (0)
-
-/** Element-wise multiplication */
-#define SCALE_4V( DST, SRCA, SRCB ) \
-do { \
- (DST)[0] = (SRCA)[0] * (SRCB)[0]; \
- (DST)[1] = (SRCA)[1] * (SRCB)[1]; \
- (DST)[2] = (SRCA)[2] * (SRCB)[2]; \
- (DST)[3] = (SRCA)[3] * (SRCB)[3]; \
-} while (0)
-
-/** In-place addition */
-#define ACC_4V( DST, SRC ) \
-do { \
- (DST)[0] += (SRC)[0]; \
- (DST)[1] += (SRC)[1]; \
- (DST)[2] += (SRC)[2]; \
- (DST)[3] += (SRC)[3]; \
-} while (0)
-
-/** Element-wise multiplication and addition */
-#define ACC_SCALE_4V( DST, SRCA, SRCB ) \
-do { \
- (DST)[0] += (SRCA)[0] * (SRCB)[0]; \
- (DST)[1] += (SRCA)[1] * (SRCB)[1]; \
- (DST)[2] += (SRCA)[2] * (SRCB)[2]; \
- (DST)[3] += (SRCA)[3] * (SRCB)[3]; \
-} while (0)
-
-/** In-place scalar multiplication and addition */
-#define ACC_SCALE_SCALAR_4V( DST, S, SRCB ) \
-do { \
- (DST)[0] += S * (SRCB)[0]; \
- (DST)[1] += S * (SRCB)[1]; \
- (DST)[2] += S * (SRCB)[2]; \
- (DST)[3] += S * (SRCB)[3]; \
-} while (0)
-
-/** Scalar multiplication */
-#define SCALE_SCALAR_4V( DST, S, SRCB ) \
-do { \
- (DST)[0] = S * (SRCB)[0]; \
- (DST)[1] = S * (SRCB)[1]; \
- (DST)[2] = S * (SRCB)[2]; \
- (DST)[3] = S * (SRCB)[3]; \
-} while (0)
-
-/** In-place scalar multiplication */
-#define SELF_SCALE_SCALAR_4V( DST, S ) \
-do { \
- (DST)[0] *= S; \
- (DST)[1] *= S; \
- (DST)[2] *= S; \
- (DST)[3] *= S; \
-} while (0)
-
-/** Assignment */
-#define ASSIGN_4V( V, V0, V1, V2, V3 ) \
-do { \
- V[0] = V0; \
- V[1] = V1; \
- V[2] = V2; \
- V[3] = V3; \
-} while(0)
-
-/*@}*/
-
-
-/**********************************************************************/
-/** \name 3-element vector operations*/
-/*@{*/
-
-/** Zero */
-#define ZERO_3V( DST ) (DST)[0] = (DST)[1] = (DST)[2] = 0
-
-/** Test for equality */
-#define TEST_EQ_3V(a,b) \
- ((a)[0] == (b)[0] && \
- (a)[1] == (b)[1] && \
- (a)[2] == (b)[2])
-
-/** Copy a 3-element vector */
-#define COPY_3V( DST, SRC ) \
-do { \
- (DST)[0] = (SRC)[0]; \
- (DST)[1] = (SRC)[1]; \
- (DST)[2] = (SRC)[2]; \
-} while (0)
-
-/** Copy a 3-element vector with cast */
-#define COPY_3V_CAST( DST, SRC, CAST ) \
-do { \
- (DST)[0] = (CAST)(SRC)[0]; \
- (DST)[1] = (CAST)(SRC)[1]; \
- (DST)[2] = (CAST)(SRC)[2]; \
-} while (0)
-
-/** Copy a 3-element float vector */
-#define COPY_3FV( DST, SRC ) \
-do { \
- const GLfloat *_tmp = (SRC); \
- (DST)[0] = _tmp[0]; \
- (DST)[1] = _tmp[1]; \
- (DST)[2] = _tmp[2]; \
-} while (0)
-
-/** Subtraction */
-#define SUB_3V( DST, SRCA, SRCB ) \
-do { \
- (DST)[0] = (SRCA)[0] - (SRCB)[0]; \
- (DST)[1] = (SRCA)[1] - (SRCB)[1]; \
- (DST)[2] = (SRCA)[2] - (SRCB)[2]; \
-} while (0)
-
-/** Addition */
-#define ADD_3V( DST, SRCA, SRCB ) \
-do { \
- (DST)[0] = (SRCA)[0] + (SRCB)[0]; \
- (DST)[1] = (SRCA)[1] + (SRCB)[1]; \
- (DST)[2] = (SRCA)[2] + (SRCB)[2]; \
-} while (0)
-
-/** In-place scalar multiplication */
-#define SCALE_3V( DST, SRCA, SRCB ) \
-do { \
- (DST)[0] = (SRCA)[0] * (SRCB)[0]; \
- (DST)[1] = (SRCA)[1] * (SRCB)[1]; \
- (DST)[2] = (SRCA)[2] * (SRCB)[2]; \
-} while (0)
-
-/** In-place element-wise multiplication */
-#define SELF_SCALE_3V( DST, SRC ) \
-do { \
- (DST)[0] *= (SRC)[0]; \
- (DST)[1] *= (SRC)[1]; \
- (DST)[2] *= (SRC)[2]; \
-} while (0)
-
-/** In-place addition */
-#define ACC_3V( DST, SRC ) \
-do { \
- (DST)[0] += (SRC)[0]; \
- (DST)[1] += (SRC)[1]; \
- (DST)[2] += (SRC)[2]; \
-} while (0)
-
-/** Element-wise multiplication and addition */
-#define ACC_SCALE_3V( DST, SRCA, SRCB ) \
-do { \
- (DST)[0] += (SRCA)[0] * (SRCB)[0]; \
- (DST)[1] += (SRCA)[1] * (SRCB)[1]; \
- (DST)[2] += (SRCA)[2] * (SRCB)[2]; \
-} while (0)
-
-/** Scalar multiplication */
-#define SCALE_SCALAR_3V( DST, S, SRCB ) \
-do { \
- (DST)[0] = S * (SRCB)[0]; \
- (DST)[1] = S * (SRCB)[1]; \
- (DST)[2] = S * (SRCB)[2]; \
-} while (0)
-
-/** In-place scalar multiplication and addition */
-#define ACC_SCALE_SCALAR_3V( DST, S, SRCB ) \
-do { \
- (DST)[0] += S * (SRCB)[0]; \
- (DST)[1] += S * (SRCB)[1]; \
- (DST)[2] += S * (SRCB)[2]; \
-} while (0)
-
-/** In-place scalar multiplication */
-#define SELF_SCALE_SCALAR_3V( DST, S ) \
-do { \
- (DST)[0] *= S; \
- (DST)[1] *= S; \
- (DST)[2] *= S; \
-} while (0)
-
-/** In-place scalar addition */
-#define ACC_SCALAR_3V( DST, S ) \
-do { \
- (DST)[0] += S; \
- (DST)[1] += S; \
- (DST)[2] += S; \
-} while (0)
-
-/** Assignment */
-#define ASSIGN_3V( V, V0, V1, V2 ) \
-do { \
- V[0] = V0; \
- V[1] = V1; \
- V[2] = V2; \
-} while(0)
-
-/*@}*/
-
-
-/**********************************************************************/
-/** \name 2-element vector operations*/
-/*@{*/
-
-/** Zero */
-#define ZERO_2V( DST ) (DST)[0] = (DST)[1] = 0
-
-/** Copy a 2-element vector */
-#define COPY_2V( DST, SRC ) \
-do { \
- (DST)[0] = (SRC)[0]; \
- (DST)[1] = (SRC)[1]; \
-} while (0)
-
-/** Copy a 2-element vector with cast */
-#define COPY_2V_CAST( DST, SRC, CAST ) \
-do { \
- (DST)[0] = (CAST)(SRC)[0]; \
- (DST)[1] = (CAST)(SRC)[1]; \
-} while (0)
-
-/** Copy a 2-element float vector */
-#define COPY_2FV( DST, SRC ) \
-do { \
- const GLfloat *_tmp = (SRC); \
- (DST)[0] = _tmp[0]; \
- (DST)[1] = _tmp[1]; \
-} while (0)
-
-/** Subtraction */
-#define SUB_2V( DST, SRCA, SRCB ) \
-do { \
- (DST)[0] = (SRCA)[0] - (SRCB)[0]; \
- (DST)[1] = (SRCA)[1] - (SRCB)[1]; \
-} while (0)
-
-/** Addition */
-#define ADD_2V( DST, SRCA, SRCB ) \
-do { \
- (DST)[0] = (SRCA)[0] + (SRCB)[0]; \
- (DST)[1] = (SRCA)[1] + (SRCB)[1]; \
-} while (0)
-
-/** In-place scalar multiplication */
-#define SCALE_2V( DST, SRCA, SRCB ) \
-do { \
- (DST)[0] = (SRCA)[0] * (SRCB)[0]; \
- (DST)[1] = (SRCA)[1] * (SRCB)[1]; \
-} while (0)
-
-/** In-place addition */
-#define ACC_2V( DST, SRC ) \
-do { \
- (DST)[0] += (SRC)[0]; \
- (DST)[1] += (SRC)[1]; \
-} while (0)
-
-/** Element-wise multiplication and addition */
-#define ACC_SCALE_2V( DST, SRCA, SRCB ) \
-do { \
- (DST)[0] += (SRCA)[0] * (SRCB)[0]; \
- (DST)[1] += (SRCA)[1] * (SRCB)[1]; \
-} while (0)
-
-/** Scalar multiplication */
-#define SCALE_SCALAR_2V( DST, S, SRCB ) \
-do { \
- (DST)[0] = S * (SRCB)[0]; \
- (DST)[1] = S * (SRCB)[1]; \
-} while (0)
-
-/** In-place scalar multiplication and addition */
-#define ACC_SCALE_SCALAR_2V( DST, S, SRCB ) \
-do { \
- (DST)[0] += S * (SRCB)[0]; \
- (DST)[1] += S * (SRCB)[1]; \
-} while (0)
-
-/** In-place scalar multiplication */
-#define SELF_SCALE_SCALAR_2V( DST, S ) \
-do { \
- (DST)[0] *= S; \
- (DST)[1] *= S; \
-} while (0)
-
-/** In-place scalar addition */
-#define ACC_SCALAR_2V( DST, S ) \
-do { \
- (DST)[0] += S; \
- (DST)[1] += S; \
-} while (0)
-
-/** Assign scalers to short vectors */
-#define ASSIGN_2V( V, V0, V1 ) \
-do { \
- V[0] = V0; \
- V[1] = V1; \
-} while(0)
-
-/*@}*/
-
-
-/** \name Linear interpolation macros */
-/*@{*/
-
-/**
- * Linear interpolation
- *
- * \note \p OUT argument is evaluated twice!
- * \note Be wary of using *coord++ as an argument to any of these macros!
- */
-#define LINTERP(T, OUT, IN) ((OUT) + (T) * ((IN) - (OUT)))
-
-/* Can do better with integer math
- */
-#define INTERP_UB( t, dstub, outub, inub ) \
-do { \
- GLfloat inf = UBYTE_TO_FLOAT( inub ); \
- GLfloat outf = UBYTE_TO_FLOAT( outub ); \
- GLfloat dstf = LINTERP( t, outf, inf ); \
- UNCLAMPED_FLOAT_TO_UBYTE( dstub, dstf ); \
-} while (0)
-
-#define INTERP_CHAN( t, dstc, outc, inc ) \
-do { \
- GLfloat inf = CHAN_TO_FLOAT( inc ); \
- GLfloat outf = CHAN_TO_FLOAT( outc ); \
- GLfloat dstf = LINTERP( t, outf, inf ); \
- UNCLAMPED_FLOAT_TO_CHAN( dstc, dstf ); \
-} while (0)
-
-#define INTERP_UI( t, dstui, outui, inui ) \
- dstui = (GLuint) (GLint) LINTERP( (t), (GLfloat) (outui), (GLfloat) (inui) )
-
-#define INTERP_F( t, dstf, outf, inf ) \
- dstf = LINTERP( t, outf, inf )
-
-#define INTERP_4F( t, dst, out, in ) \
-do { \
- dst[0] = LINTERP( (t), (out)[0], (in)[0] ); \
- dst[1] = LINTERP( (t), (out)[1], (in)[1] ); \
- dst[2] = LINTERP( (t), (out)[2], (in)[2] ); \
- dst[3] = LINTERP( (t), (out)[3], (in)[3] ); \
-} while (0)
-
-#define INTERP_3F( t, dst, out, in ) \
-do { \
- dst[0] = LINTERP( (t), (out)[0], (in)[0] ); \
- dst[1] = LINTERP( (t), (out)[1], (in)[1] ); \
- dst[2] = LINTERP( (t), (out)[2], (in)[2] ); \
-} while (0)
-
-#define INTERP_4CHAN( t, dst, out, in ) \
-do { \
- INTERP_CHAN( (t), (dst)[0], (out)[0], (in)[0] ); \
- INTERP_CHAN( (t), (dst)[1], (out)[1], (in)[1] ); \
- INTERP_CHAN( (t), (dst)[2], (out)[2], (in)[2] ); \
- INTERP_CHAN( (t), (dst)[3], (out)[3], (in)[3] ); \
-} while (0)
-
-#define INTERP_3CHAN( t, dst, out, in ) \
-do { \
- INTERP_CHAN( (t), (dst)[0], (out)[0], (in)[0] ); \
- INTERP_CHAN( (t), (dst)[1], (out)[1], (in)[1] ); \
- INTERP_CHAN( (t), (dst)[2], (out)[2], (in)[2] ); \
-} while (0)
-
-#define INTERP_SZ( t, vec, to, out, in, sz ) \
-do { \
- switch (sz) { \
- case 4: vec[to][3] = LINTERP( (t), (vec)[out][3], (vec)[in][3] ); \
- case 3: vec[to][2] = LINTERP( (t), (vec)[out][2], (vec)[in][2] ); \
- case 2: vec[to][1] = LINTERP( (t), (vec)[out][1], (vec)[in][1] ); \
- case 1: vec[to][0] = LINTERP( (t), (vec)[out][0], (vec)[in][0] ); \
- } \
-} while(0)
-
-/*@}*/
-
-
-
-/** Clamp X to [MIN,MAX] */
-#define CLAMP( X, MIN, MAX ) ( (X)<(MIN) ? (MIN) : ((X)>(MAX) ? (MAX) : (X)) )
-
-/** Minimum of two values: */
-#define MIN2( A, B ) ( (A)<(B) ? (A) : (B) )
-
-/** Maximum of two values: */
-#define MAX2( A, B ) ( (A)>(B) ? (A) : (B) )
-
-/** Minimum and maximum of three values: */
-#define MIN3( A, B, C ) ((A) < (B) ? MIN2(A, C) : MIN2(B, C))
-#define MAX3( A, B, C ) ((A) > (B) ? MAX2(A, C) : MAX2(B, C))
-
-/** Dot product of two 2-element vectors */
-#define DOT2( a, b ) ( (a)[0]*(b)[0] + (a)[1]*(b)[1] )
-
-/** Dot product of two 3-element vectors */
-#define DOT3( a, b ) ( (a)[0]*(b)[0] + (a)[1]*(b)[1] + (a)[2]*(b)[2] )
-
-/** Dot product of two 4-element vectors */
-#define DOT4( a, b ) ( (a)[0]*(b)[0] + (a)[1]*(b)[1] + \
- (a)[2]*(b)[2] + (a)[3]*(b)[3] )
-
-/** Dot product of two 4-element vectors */
-#define DOT4V(v,a,b,c,d) (v[0]*(a) + v[1]*(b) + v[2]*(c) + v[3]*(d))
-
-
-/** Cross product of two 3-element vectors */
-#define CROSS3(n, u, v) \
-do { \
- (n)[0] = (u)[1]*(v)[2] - (u)[2]*(v)[1]; \
- (n)[1] = (u)[2]*(v)[0] - (u)[0]*(v)[2]; \
- (n)[2] = (u)[0]*(v)[1] - (u)[1]*(v)[0]; \
-} while (0)
-
-
-/* Normalize a 3-element vector to unit length. */
-#define NORMALIZE_3FV( V ) \
-do { \
- GLfloat len = (GLfloat) LEN_SQUARED_3FV(V); \
- if (len) { \
- len = INV_SQRTF(len); \
- (V)[0] = (GLfloat) ((V)[0] * len); \
- (V)[1] = (GLfloat) ((V)[1] * len); \
- (V)[2] = (GLfloat) ((V)[2] * len); \
- } \
-} while(0)
-
-#define LEN_3FV( V ) (SQRTF((V)[0]*(V)[0]+(V)[1]*(V)[1]+(V)[2]*(V)[2]))
-#define LEN_2FV( V ) (SQRTF((V)[0]*(V)[0]+(V)[1]*(V)[1]))
-
-#define LEN_SQUARED_3FV( V ) ((V)[0]*(V)[0]+(V)[1]*(V)[1]+(V)[2]*(V)[2])
-#define LEN_SQUARED_2FV( V ) ((V)[0]*(V)[0]+(V)[1]*(V)[1])
-
-
-/** casts to silence warnings with some compilers */
-#define ENUM_TO_INT(E) ((GLint)(E))
-#define ENUM_TO_FLOAT(E) ((GLfloat)(GLint)(E))
-#define ENUM_TO_DOUBLE(E) ((GLdouble)(GLint)(E))
-#define ENUM_TO_BOOLEAN(E) ((E) ? GL_TRUE : GL_FALSE)
-
-
-#endif
+/**
+ * \file macros.h
+ * A collection of useful macros.
+ */
+
+/*
+ * Mesa 3-D graphics library
+ * Version: 6.5.2
+ *
+ * Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+
+#ifndef MACROS_H
+#define MACROS_H
+
+#include "imports.h"
+
+
+/**
+ * \name Integer / float conversion for colors, normals, etc.
+ */
+/*@{*/
+
+/** Convert GLubyte in [0,255] to GLfloat in [0.0,1.0] */
+extern GLfloat _mesa_ubyte_to_float_color_tab[256];
+#define UBYTE_TO_FLOAT(u) _mesa_ubyte_to_float_color_tab[(unsigned int)(u)]
+
+/** Convert GLfloat in [0.0,1.0] to GLubyte in [0,255] */
+#define FLOAT_TO_UBYTE(X) ((GLubyte) (GLint) ((X) * 255.0F))
+
+
+/** Convert GLbyte in [-128,127] to GLfloat in [-1.0,1.0] */
+#define BYTE_TO_FLOAT(B) ((2.0F * (B) + 1.0F) * (1.0F/255.0F))
+
+/** Convert GLfloat in [-1.0,1.0] to GLbyte in [-128,127] */
+#define FLOAT_TO_BYTE(X) ( (((GLint) (255.0F * (X))) - 1) / 2 )
+
+
+/** Convert GLbyte in [-128,127] to GLfloat in [-1.0,1.0], texture/fb data */
+#define BYTE_TO_FLOAT_TEX(B) ((B) == -128 ? -1.0F : (B) * (1.0F/127.0F))
+
+/** Convert GLfloat in [-1.0,1.0] to GLbyte in [-128,127], texture/fb data */
+#define FLOAT_TO_BYTE_TEX(X) CLAMP( (GLint) (127.0F * (X)), -128, 127 )
+
+/** Convert GLushort in [0,65535] to GLfloat in [0.0,1.0] */
+#define USHORT_TO_FLOAT(S) ((GLfloat) (S) * (1.0F / 65535.0F))
+
+/** Convert GLfloat in [0.0,1.0] to GLushort in [0, 65535] */
+#define FLOAT_TO_USHORT(X) ((GLuint) ((X) * 65535.0F))
+
+
+/** Convert GLshort in [-32768,32767] to GLfloat in [-1.0,1.0] */
+#define SHORT_TO_FLOAT(S) ((2.0F * (S) + 1.0F) * (1.0F/65535.0F))
+
+/** Convert GLfloat in [-1.0,1.0] to GLshort in [-32768,32767] */
+#define FLOAT_TO_SHORT(X) ( (((GLint) (65535.0F * (X))) - 1) / 2 )
+
+
+/** Convert GLshort in [-32768,32767] to GLfloat in [-1.0,1.0], texture/fb data */
+#define SHORT_TO_FLOAT_TEX(S) ((S) == -32768 ? -1.0F : (S) * (1.0F/32767.0F))
+
+/** Convert GLfloat in [-1.0,1.0] to GLshort in [-32768,32767], texture/fb data */
+#define FLOAT_TO_SHORT_TEX(X) ( (GLint) (32767.0F * (X)) )
+
+
+/** Convert GLuint in [0,4294967295] to GLfloat in [0.0,1.0] */
+#define UINT_TO_FLOAT(U) ((GLfloat) ((U) * (1.0F / 4294967295.0)))
+
+/** Convert GLfloat in [0.0,1.0] to GLuint in [0,4294967295] */
+#define FLOAT_TO_UINT(X) ((GLuint) ((X) * 4294967295.0))
+
+
+/** Convert GLint in [-2147483648,2147483647] to GLfloat in [-1.0,1.0] */
+#define INT_TO_FLOAT(I) ((GLfloat) ((2.0F * (I) + 1.0F) * (1.0F/4294967294.0)))
+
+/** Convert GLfloat in [-1.0,1.0] to GLint in [-2147483648,2147483647] */
+/* causes overflow:
+#define FLOAT_TO_INT(X) ( (((GLint) (4294967294.0 * (X))) - 1) / 2 )
+*/
+/* a close approximation: */
+#define FLOAT_TO_INT(X) ( (GLint) (2147483647.0 * (X)) )
+
+/** Convert GLfloat in [-1.0,1.0] to GLint64 in [-(1<<63),(1 << 63) -1] */
+#define FLOAT_TO_INT64(X) ( (GLint64) (9223372036854775807.0 * (double)(X)) )
+
+
+/** Convert GLint in [-2147483648,2147483647] to GLfloat in [-1.0,1.0], texture/fb data */
+#define INT_TO_FLOAT_TEX(I) ((I) == -2147483648 ? -1.0F : (I) * (1.0F/2147483647.0))
+
+/** Convert GLfloat in [-1.0,1.0] to GLint in [-2147483648,2147483647], texture/fb data */
+#define FLOAT_TO_INT_TEX(X) ( (GLint) (2147483647.0 * (X)) )
+
+
+#define BYTE_TO_UBYTE(b) ((GLubyte) ((b) < 0 ? 0 : (GLubyte) (b)))
+#define SHORT_TO_UBYTE(s) ((GLubyte) ((s) < 0 ? 0 : (GLubyte) ((s) >> 7)))
+#define USHORT_TO_UBYTE(s) ((GLubyte) ((s) >> 8))
+#define INT_TO_UBYTE(i) ((GLubyte) ((i) < 0 ? 0 : (GLubyte) ((i) >> 23)))
+#define UINT_TO_UBYTE(i) ((GLubyte) ((i) >> 24))
+
+
+#define BYTE_TO_USHORT(b) ((b) < 0 ? 0 : ((GLushort) (((b) * 65535) / 255)))
+#define UBYTE_TO_USHORT(b) (((GLushort) (b) << 8) | (GLushort) (b))
+#define SHORT_TO_USHORT(s) ((s) < 0 ? 0 : ((GLushort) (((s) * 65535 / 32767))))
+#define INT_TO_USHORT(i) ((i) < 0 ? 0 : ((GLushort) ((i) >> 15)))
+#define UINT_TO_USHORT(i) ((i) < 0 ? 0 : ((GLushort) ((i) >> 16)))
+#define UNCLAMPED_FLOAT_TO_USHORT(us, f) \
+ us = ( (GLushort) IROUND( CLAMP((f), 0.0F, 1.0F) * 65535.0F) )
+#define CLAMPED_FLOAT_TO_USHORT(us, f) \
+ us = ( (GLushort) IROUND( (f) * 65535.0F) )
+
+#define UNCLAMPED_FLOAT_TO_SHORT(s, f) \
+ s = ( (GLshort) IROUND( CLAMP((f), -1.0F, 1.0F) * 32767.0F) )
+
+/***
+ *** UNCLAMPED_FLOAT_TO_UBYTE: clamp float to [0,1] and map to ubyte in [0,255]
+ *** CLAMPED_FLOAT_TO_UBYTE: map float known to be in [0,1] to ubyte in [0,255]
+ ***/
+#if defined(USE_IEEE) && !defined(DEBUG)
+#define IEEE_0996 0x3f7f0000 /* 0.996 or so */
+/* This function/macro is sensitive to precision. Test very carefully
+ * if you change it!
+ */
+#define UNCLAMPED_FLOAT_TO_UBYTE(UB, F) \
+ do { \
+ fi_type __tmp; \
+ __tmp.f = (F); \
+ if (__tmp.i < 0) \
+ UB = (GLubyte) 0; \
+ else if (__tmp.i >= IEEE_0996) \
+ UB = (GLubyte) 255; \
+ else { \
+ __tmp.f = __tmp.f * (255.0F/256.0F) + 32768.0F; \
+ UB = (GLubyte) __tmp.i; \
+ } \
+ } while (0)
+#define CLAMPED_FLOAT_TO_UBYTE(UB, F) \
+ do { \
+ fi_type __tmp; \
+ __tmp.f = (F) * (255.0F/256.0F) + 32768.0F; \
+ UB = (GLubyte) __tmp.i; \
+ } while (0)
+#else
+#define UNCLAMPED_FLOAT_TO_UBYTE(ub, f) \
+ ub = ((GLubyte) IROUND(CLAMP((f), 0.0F, 1.0F) * 255.0F))
+#define CLAMPED_FLOAT_TO_UBYTE(ub, f) \
+ ub = ((GLubyte) IROUND((f) * 255.0F))
+#endif
+
+/*@}*/
+
+
+/** Stepping a GLfloat pointer by a byte stride */
+#define STRIDE_F(p, i) (p = (GLfloat *)((GLubyte *)p + i))
+/** Stepping a GLuint pointer by a byte stride */
+#define STRIDE_UI(p, i) (p = (GLuint *)((GLubyte *)p + i))
+/** Stepping a GLubyte[4] pointer by a byte stride */
+#define STRIDE_4UB(p, i) (p = (GLubyte (*)[4])((GLubyte *)p + i))
+/** Stepping a GLfloat[4] pointer by a byte stride */
+#define STRIDE_4F(p, i) (p = (GLfloat (*)[4])((GLubyte *)p + i))
+/** Stepping a GLchan[4] pointer by a byte stride */
+#define STRIDE_4CHAN(p, i) (p = (GLchan (*)[4])((GLubyte *)p + i))
+/** Stepping a GLchan pointer by a byte stride */
+#define STRIDE_CHAN(p, i) (p = (GLchan *)((GLubyte *)p + i))
+/** Stepping a \p t pointer by a byte stride */
+#define STRIDE_T(p, t, i) (p = (t)((GLubyte *)p + i))
+
+
+/**********************************************************************/
+/** \name 4-element vector operations */
+/*@{*/
+
+/** Zero */
+#define ZERO_4V( DST ) (DST)[0] = (DST)[1] = (DST)[2] = (DST)[3] = 0
+
+/** Test for equality */
+#define TEST_EQ_4V(a,b) ((a)[0] == (b)[0] && \
+ (a)[1] == (b)[1] && \
+ (a)[2] == (b)[2] && \
+ (a)[3] == (b)[3])
+
+/** Test for equality (unsigned bytes) */
+#if defined(__i386__)
+#define TEST_EQ_4UBV(DST, SRC) *((GLuint*)(DST)) == *((GLuint*)(SRC))
+#else
+#define TEST_EQ_4UBV(DST, SRC) TEST_EQ_4V(DST, SRC)
+#endif
+
+/** Copy a 4-element vector */
+#define COPY_4V( DST, SRC ) \
+do { \
+ (DST)[0] = (SRC)[0]; \
+ (DST)[1] = (SRC)[1]; \
+ (DST)[2] = (SRC)[2]; \
+ (DST)[3] = (SRC)[3]; \
+} while (0)
+
+/** Copy a 4-element vector with cast */
+#define COPY_4V_CAST( DST, SRC, CAST ) \
+do { \
+ (DST)[0] = (CAST)(SRC)[0]; \
+ (DST)[1] = (CAST)(SRC)[1]; \
+ (DST)[2] = (CAST)(SRC)[2]; \
+ (DST)[3] = (CAST)(SRC)[3]; \
+} while (0)
+
+/** Copy a 4-element unsigned byte vector */
+#if defined(__i386__)
+#define COPY_4UBV(DST, SRC) \
+do { \
+ *((GLuint*)(DST)) = *((GLuint*)(SRC)); \
+} while (0)
+#else
+/* The GLuint cast might fail if DST or SRC are not dword-aligned (RISC) */
+#define COPY_4UBV(DST, SRC) \
+do { \
+ (DST)[0] = (SRC)[0]; \
+ (DST)[1] = (SRC)[1]; \
+ (DST)[2] = (SRC)[2]; \
+ (DST)[3] = (SRC)[3]; \
+} while (0)
+#endif
+
+/**
+ * Copy a 4-element float vector
+ * memcpy seems to be most efficient
+ */
+#define COPY_4FV( DST, SRC ) \
+do { \
+ memcpy(DST, SRC, sizeof(GLfloat) * 4); \
+} while (0)
+
+/** Copy \p SZ elements into a 4-element vector */
+#define COPY_SZ_4V(DST, SZ, SRC) \
+do { \
+ switch (SZ) { \
+ case 4: (DST)[3] = (SRC)[3]; \
+ case 3: (DST)[2] = (SRC)[2]; \
+ case 2: (DST)[1] = (SRC)[1]; \
+ case 1: (DST)[0] = (SRC)[0]; \
+ } \
+} while(0)
+
+/** Copy \p SZ elements into a homegeneous (4-element) vector, giving
+ * default values to the remaining */
+#define COPY_CLEAN_4V(DST, SZ, SRC) \
+do { \
+ ASSIGN_4V( DST, 0, 0, 0, 1 ); \
+ COPY_SZ_4V( DST, SZ, SRC ); \
+} while (0)
+
+/** Subtraction */
+#define SUB_4V( DST, SRCA, SRCB ) \
+do { \
+ (DST)[0] = (SRCA)[0] - (SRCB)[0]; \
+ (DST)[1] = (SRCA)[1] - (SRCB)[1]; \
+ (DST)[2] = (SRCA)[2] - (SRCB)[2]; \
+ (DST)[3] = (SRCA)[3] - (SRCB)[3]; \
+} while (0)
+
+/** Addition */
+#define ADD_4V( DST, SRCA, SRCB ) \
+do { \
+ (DST)[0] = (SRCA)[0] + (SRCB)[0]; \
+ (DST)[1] = (SRCA)[1] + (SRCB)[1]; \
+ (DST)[2] = (SRCA)[2] + (SRCB)[2]; \
+ (DST)[3] = (SRCA)[3] + (SRCB)[3]; \
+} while (0)
+
+/** Element-wise multiplication */
+#define SCALE_4V( DST, SRCA, SRCB ) \
+do { \
+ (DST)[0] = (SRCA)[0] * (SRCB)[0]; \
+ (DST)[1] = (SRCA)[1] * (SRCB)[1]; \
+ (DST)[2] = (SRCA)[2] * (SRCB)[2]; \
+ (DST)[3] = (SRCA)[3] * (SRCB)[3]; \
+} while (0)
+
+/** In-place addition */
+#define ACC_4V( DST, SRC ) \
+do { \
+ (DST)[0] += (SRC)[0]; \
+ (DST)[1] += (SRC)[1]; \
+ (DST)[2] += (SRC)[2]; \
+ (DST)[3] += (SRC)[3]; \
+} while (0)
+
+/** Element-wise multiplication and addition */
+#define ACC_SCALE_4V( DST, SRCA, SRCB ) \
+do { \
+ (DST)[0] += (SRCA)[0] * (SRCB)[0]; \
+ (DST)[1] += (SRCA)[1] * (SRCB)[1]; \
+ (DST)[2] += (SRCA)[2] * (SRCB)[2]; \
+ (DST)[3] += (SRCA)[3] * (SRCB)[3]; \
+} while (0)
+
+/** In-place scalar multiplication and addition */
+#define ACC_SCALE_SCALAR_4V( DST, S, SRCB ) \
+do { \
+ (DST)[0] += S * (SRCB)[0]; \
+ (DST)[1] += S * (SRCB)[1]; \
+ (DST)[2] += S * (SRCB)[2]; \
+ (DST)[3] += S * (SRCB)[3]; \
+} while (0)
+
+/** Scalar multiplication */
+#define SCALE_SCALAR_4V( DST, S, SRCB ) \
+do { \
+ (DST)[0] = S * (SRCB)[0]; \
+ (DST)[1] = S * (SRCB)[1]; \
+ (DST)[2] = S * (SRCB)[2]; \
+ (DST)[3] = S * (SRCB)[3]; \
+} while (0)
+
+/** In-place scalar multiplication */
+#define SELF_SCALE_SCALAR_4V( DST, S ) \
+do { \
+ (DST)[0] *= S; \
+ (DST)[1] *= S; \
+ (DST)[2] *= S; \
+ (DST)[3] *= S; \
+} while (0)
+
+/** Assignment */
+#define ASSIGN_4V( V, V0, V1, V2, V3 ) \
+do { \
+ V[0] = V0; \
+ V[1] = V1; \
+ V[2] = V2; \
+ V[3] = V3; \
+} while(0)
+
+/*@}*/
+
+
+/**********************************************************************/
+/** \name 3-element vector operations*/
+/*@{*/
+
+/** Zero */
+#define ZERO_3V( DST ) (DST)[0] = (DST)[1] = (DST)[2] = 0
+
+/** Test for equality */
+#define TEST_EQ_3V(a,b) \
+ ((a)[0] == (b)[0] && \
+ (a)[1] == (b)[1] && \
+ (a)[2] == (b)[2])
+
+/** Copy a 3-element vector */
+#define COPY_3V( DST, SRC ) \
+do { \
+ (DST)[0] = (SRC)[0]; \
+ (DST)[1] = (SRC)[1]; \
+ (DST)[2] = (SRC)[2]; \
+} while (0)
+
+/** Copy a 3-element vector with cast */
+#define COPY_3V_CAST( DST, SRC, CAST ) \
+do { \
+ (DST)[0] = (CAST)(SRC)[0]; \
+ (DST)[1] = (CAST)(SRC)[1]; \
+ (DST)[2] = (CAST)(SRC)[2]; \
+} while (0)
+
+/** Copy a 3-element float vector */
+#define COPY_3FV( DST, SRC ) \
+do { \
+ const GLfloat *_tmp = (SRC); \
+ (DST)[0] = _tmp[0]; \
+ (DST)[1] = _tmp[1]; \
+ (DST)[2] = _tmp[2]; \
+} while (0)
+
+/** Subtraction */
+#define SUB_3V( DST, SRCA, SRCB ) \
+do { \
+ (DST)[0] = (SRCA)[0] - (SRCB)[0]; \
+ (DST)[1] = (SRCA)[1] - (SRCB)[1]; \
+ (DST)[2] = (SRCA)[2] - (SRCB)[2]; \
+} while (0)
+
+/** Addition */
+#define ADD_3V( DST, SRCA, SRCB ) \
+do { \
+ (DST)[0] = (SRCA)[0] + (SRCB)[0]; \
+ (DST)[1] = (SRCA)[1] + (SRCB)[1]; \
+ (DST)[2] = (SRCA)[2] + (SRCB)[2]; \
+} while (0)
+
+/** In-place scalar multiplication */
+#define SCALE_3V( DST, SRCA, SRCB ) \
+do { \
+ (DST)[0] = (SRCA)[0] * (SRCB)[0]; \
+ (DST)[1] = (SRCA)[1] * (SRCB)[1]; \
+ (DST)[2] = (SRCA)[2] * (SRCB)[2]; \
+} while (0)
+
+/** In-place element-wise multiplication */
+#define SELF_SCALE_3V( DST, SRC ) \
+do { \
+ (DST)[0] *= (SRC)[0]; \
+ (DST)[1] *= (SRC)[1]; \
+ (DST)[2] *= (SRC)[2]; \
+} while (0)
+
+/** In-place addition */
+#define ACC_3V( DST, SRC ) \
+do { \
+ (DST)[0] += (SRC)[0]; \
+ (DST)[1] += (SRC)[1]; \
+ (DST)[2] += (SRC)[2]; \
+} while (0)
+
+/** Element-wise multiplication and addition */
+#define ACC_SCALE_3V( DST, SRCA, SRCB ) \
+do { \
+ (DST)[0] += (SRCA)[0] * (SRCB)[0]; \
+ (DST)[1] += (SRCA)[1] * (SRCB)[1]; \
+ (DST)[2] += (SRCA)[2] * (SRCB)[2]; \
+} while (0)
+
+/** Scalar multiplication */
+#define SCALE_SCALAR_3V( DST, S, SRCB ) \
+do { \
+ (DST)[0] = S * (SRCB)[0]; \
+ (DST)[1] = S * (SRCB)[1]; \
+ (DST)[2] = S * (SRCB)[2]; \
+} while (0)
+
+/** In-place scalar multiplication and addition */
+#define ACC_SCALE_SCALAR_3V( DST, S, SRCB ) \
+do { \
+ (DST)[0] += S * (SRCB)[0]; \
+ (DST)[1] += S * (SRCB)[1]; \
+ (DST)[2] += S * (SRCB)[2]; \
+} while (0)
+
+/** In-place scalar multiplication */
+#define SELF_SCALE_SCALAR_3V( DST, S ) \
+do { \
+ (DST)[0] *= S; \
+ (DST)[1] *= S; \
+ (DST)[2] *= S; \
+} while (0)
+
+/** In-place scalar addition */
+#define ACC_SCALAR_3V( DST, S ) \
+do { \
+ (DST)[0] += S; \
+ (DST)[1] += S; \
+ (DST)[2] += S; \
+} while (0)
+
+/** Assignment */
+#define ASSIGN_3V( V, V0, V1, V2 ) \
+do { \
+ V[0] = V0; \
+ V[1] = V1; \
+ V[2] = V2; \
+} while(0)
+
+/*@}*/
+
+
+/**********************************************************************/
+/** \name 2-element vector operations*/
+/*@{*/
+
+/** Zero */
+#define ZERO_2V( DST ) (DST)[0] = (DST)[1] = 0
+
+/** Copy a 2-element vector */
+#define COPY_2V( DST, SRC ) \
+do { \
+ (DST)[0] = (SRC)[0]; \
+ (DST)[1] = (SRC)[1]; \
+} while (0)
+
+/** Copy a 2-element vector with cast */
+#define COPY_2V_CAST( DST, SRC, CAST ) \
+do { \
+ (DST)[0] = (CAST)(SRC)[0]; \
+ (DST)[1] = (CAST)(SRC)[1]; \
+} while (0)
+
+/** Copy a 2-element float vector */
+#define COPY_2FV( DST, SRC ) \
+do { \
+ const GLfloat *_tmp = (SRC); \
+ (DST)[0] = _tmp[0]; \
+ (DST)[1] = _tmp[1]; \
+} while (0)
+
+/** Subtraction */
+#define SUB_2V( DST, SRCA, SRCB ) \
+do { \
+ (DST)[0] = (SRCA)[0] - (SRCB)[0]; \
+ (DST)[1] = (SRCA)[1] - (SRCB)[1]; \
+} while (0)
+
+/** Addition */
+#define ADD_2V( DST, SRCA, SRCB ) \
+do { \
+ (DST)[0] = (SRCA)[0] + (SRCB)[0]; \
+ (DST)[1] = (SRCA)[1] + (SRCB)[1]; \
+} while (0)
+
+/** In-place scalar multiplication */
+#define SCALE_2V( DST, SRCA, SRCB ) \
+do { \
+ (DST)[0] = (SRCA)[0] * (SRCB)[0]; \
+ (DST)[1] = (SRCA)[1] * (SRCB)[1]; \
+} while (0)
+
+/** In-place addition */
+#define ACC_2V( DST, SRC ) \
+do { \
+ (DST)[0] += (SRC)[0]; \
+ (DST)[1] += (SRC)[1]; \
+} while (0)
+
+/** Element-wise multiplication and addition */
+#define ACC_SCALE_2V( DST, SRCA, SRCB ) \
+do { \
+ (DST)[0] += (SRCA)[0] * (SRCB)[0]; \
+ (DST)[1] += (SRCA)[1] * (SRCB)[1]; \
+} while (0)
+
+/** Scalar multiplication */
+#define SCALE_SCALAR_2V( DST, S, SRCB ) \
+do { \
+ (DST)[0] = S * (SRCB)[0]; \
+ (DST)[1] = S * (SRCB)[1]; \
+} while (0)
+
+/** In-place scalar multiplication and addition */
+#define ACC_SCALE_SCALAR_2V( DST, S, SRCB ) \
+do { \
+ (DST)[0] += S * (SRCB)[0]; \
+ (DST)[1] += S * (SRCB)[1]; \
+} while (0)
+
+/** In-place scalar multiplication */
+#define SELF_SCALE_SCALAR_2V( DST, S ) \
+do { \
+ (DST)[0] *= S; \
+ (DST)[1] *= S; \
+} while (0)
+
+/** In-place scalar addition */
+#define ACC_SCALAR_2V( DST, S ) \
+do { \
+ (DST)[0] += S; \
+ (DST)[1] += S; \
+} while (0)
+
+/** Assign scalers to short vectors */
+#define ASSIGN_2V( V, V0, V1 ) \
+do { \
+ V[0] = V0; \
+ V[1] = V1; \
+} while(0)
+
+/*@}*/
+
+
+/** \name Linear interpolation macros */
+/*@{*/
+
+/**
+ * Linear interpolation
+ *
+ * \note \p OUT argument is evaluated twice!
+ * \note Be wary of using *coord++ as an argument to any of these macros!
+ */
+#define LINTERP(T, OUT, IN) ((OUT) + (T) * ((IN) - (OUT)))
+
+/* Can do better with integer math
+ */
+#define INTERP_UB( t, dstub, outub, inub ) \
+do { \
+ GLfloat inf = UBYTE_TO_FLOAT( inub ); \
+ GLfloat outf = UBYTE_TO_FLOAT( outub ); \
+ GLfloat dstf = LINTERP( t, outf, inf ); \
+ UNCLAMPED_FLOAT_TO_UBYTE( dstub, dstf ); \
+} while (0)
+
+#define INTERP_CHAN( t, dstc, outc, inc ) \
+do { \
+ GLfloat inf = CHAN_TO_FLOAT( inc ); \
+ GLfloat outf = CHAN_TO_FLOAT( outc ); \
+ GLfloat dstf = LINTERP( t, outf, inf ); \
+ UNCLAMPED_FLOAT_TO_CHAN( dstc, dstf ); \
+} while (0)
+
+#define INTERP_UI( t, dstui, outui, inui ) \
+ dstui = (GLuint) (GLint) LINTERP( (t), (GLfloat) (outui), (GLfloat) (inui) )
+
+#define INTERP_F( t, dstf, outf, inf ) \
+ dstf = LINTERP( t, outf, inf )
+
+#define INTERP_4F( t, dst, out, in ) \
+do { \
+ dst[0] = LINTERP( (t), (out)[0], (in)[0] ); \
+ dst[1] = LINTERP( (t), (out)[1], (in)[1] ); \
+ dst[2] = LINTERP( (t), (out)[2], (in)[2] ); \
+ dst[3] = LINTERP( (t), (out)[3], (in)[3] ); \
+} while (0)
+
+#define INTERP_3F( t, dst, out, in ) \
+do { \
+ dst[0] = LINTERP( (t), (out)[0], (in)[0] ); \
+ dst[1] = LINTERP( (t), (out)[1], (in)[1] ); \
+ dst[2] = LINTERP( (t), (out)[2], (in)[2] ); \
+} while (0)
+
+#define INTERP_4CHAN( t, dst, out, in ) \
+do { \
+ INTERP_CHAN( (t), (dst)[0], (out)[0], (in)[0] ); \
+ INTERP_CHAN( (t), (dst)[1], (out)[1], (in)[1] ); \
+ INTERP_CHAN( (t), (dst)[2], (out)[2], (in)[2] ); \
+ INTERP_CHAN( (t), (dst)[3], (out)[3], (in)[3] ); \
+} while (0)
+
+#define INTERP_3CHAN( t, dst, out, in ) \
+do { \
+ INTERP_CHAN( (t), (dst)[0], (out)[0], (in)[0] ); \
+ INTERP_CHAN( (t), (dst)[1], (out)[1], (in)[1] ); \
+ INTERP_CHAN( (t), (dst)[2], (out)[2], (in)[2] ); \
+} while (0)
+
+#define INTERP_SZ( t, vec, to, out, in, sz ) \
+do { \
+ switch (sz) { \
+ case 4: vec[to][3] = LINTERP( (t), (vec)[out][3], (vec)[in][3] ); \
+ case 3: vec[to][2] = LINTERP( (t), (vec)[out][2], (vec)[in][2] ); \
+ case 2: vec[to][1] = LINTERP( (t), (vec)[out][1], (vec)[in][1] ); \
+ case 1: vec[to][0] = LINTERP( (t), (vec)[out][0], (vec)[in][0] ); \
+ } \
+} while(0)
+
+/*@}*/
+
+
+
+/** Clamp X to [MIN,MAX] */
+#define CLAMP( X, MIN, MAX ) ( (X)<(MIN) ? (MIN) : ((X)>(MAX) ? (MAX) : (X)) )
+
+/** Minimum of two values: */
+#define MIN2( A, B ) ( (A)<(B) ? (A) : (B) )
+
+/** Maximum of two values: */
+#define MAX2( A, B ) ( (A)>(B) ? (A) : (B) )
+
+/** Minimum and maximum of three values: */
+#define MIN3( A, B, C ) ((A) < (B) ? MIN2(A, C) : MIN2(B, C))
+#define MAX3( A, B, C ) ((A) > (B) ? MAX2(A, C) : MAX2(B, C))
+
+/** Dot product of two 2-element vectors */
+#define DOT2( a, b ) ( (a)[0]*(b)[0] + (a)[1]*(b)[1] )
+
+/** Dot product of two 3-element vectors */
+#define DOT3( a, b ) ( (a)[0]*(b)[0] + (a)[1]*(b)[1] + (a)[2]*(b)[2] )
+
+/** Dot product of two 4-element vectors */
+#define DOT4( a, b ) ( (a)[0]*(b)[0] + (a)[1]*(b)[1] + \
+ (a)[2]*(b)[2] + (a)[3]*(b)[3] )
+
+/** Dot product of two 4-element vectors */
+#define DOT4V(v,a,b,c,d) (v[0]*(a) + v[1]*(b) + v[2]*(c) + v[3]*(d))
+
+
+/** Cross product of two 3-element vectors */
+#define CROSS3(n, u, v) \
+do { \
+ (n)[0] = (u)[1]*(v)[2] - (u)[2]*(v)[1]; \
+ (n)[1] = (u)[2]*(v)[0] - (u)[0]*(v)[2]; \
+ (n)[2] = (u)[0]*(v)[1] - (u)[1]*(v)[0]; \
+} while (0)
+
+
+/* Normalize a 3-element vector to unit length. */
+#define NORMALIZE_3FV( V ) \
+do { \
+ GLfloat len = (GLfloat) LEN_SQUARED_3FV(V); \
+ if (len) { \
+ len = INV_SQRTF(len); \
+ (V)[0] = (GLfloat) ((V)[0] * len); \
+ (V)[1] = (GLfloat) ((V)[1] * len); \
+ (V)[2] = (GLfloat) ((V)[2] * len); \
+ } \
+} while(0)
+
+#define LEN_3FV( V ) (SQRTF((V)[0]*(V)[0]+(V)[1]*(V)[1]+(V)[2]*(V)[2]))
+#define LEN_2FV( V ) (SQRTF((V)[0]*(V)[0]+(V)[1]*(V)[1]))
+
+#define LEN_SQUARED_3FV( V ) ((V)[0]*(V)[0]+(V)[1]*(V)[1]+(V)[2]*(V)[2])
+#define LEN_SQUARED_2FV( V ) ((V)[0]*(V)[0]+(V)[1]*(V)[1])
+
+
+/** casts to silence warnings with some compilers */
+#define ENUM_TO_INT(E) ((GLint)(E))
+#define ENUM_TO_FLOAT(E) ((GLfloat)(GLint)(E))
+#define ENUM_TO_DOUBLE(E) ((GLdouble)(GLint)(E))
+#define ENUM_TO_BOOLEAN(E) ((E) ? GL_TRUE : GL_FALSE)
+
+
+#endif
diff --git a/mesalib/src/mesa/main/mfeatures.h b/mesalib/src/mesa/main/mfeatures.h
index 33db50814..cdd6145ad 100644
--- a/mesalib/src/mesa/main/mfeatures.h
+++ b/mesalib/src/mesa/main/mfeatures.h
@@ -1,146 +1,146 @@
-/*
- * Mesa 3-D graphics library
- * Version: 7.1
- *
- * Copyright (C) 1999-2008 Brian Paul All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-
-/**
- * \file mfeatures.h
- * Flags to enable/disable specific parts of the API.
- */
-
-#ifndef FEATURES_H
-#define FEATURES_H
-
-
-#ifndef _HAVE_FULL_GL
-#define _HAVE_FULL_GL 1
-#endif
-
-/* assert that a feature is disabled and should never be used */
-#define ASSERT_NO_FEATURE() ASSERT(0)
-
-/**
- * A feature can be anything. But most of them share certain characteristics.
- *
- * When a feature defines vtxfmt entries, they can be initialized and
- * installed by
- * _MESA_INIT_<FEATURE>_VTXFMT
- * _mesa_install_<feature>_vtxfmt
- *
- * When a feature defines dispatch entries, they are initialized by
- * _mesa_init_<feature>_dispatch
- *
- * When a feature has states, they are initialized and freed by
- * _mesa_init_<feature>
- * _mesa_free_<feature>_data
- *
- * Except for states, the others compile to no-op when a feature is disabled.
- *
- * The GLAPIENTRYs and helper functions defined by a feature should also
- * compile to no-op when it is disabled. But to save typings and to catch
- * bugs, some of them may be unavailable, or compile to ASSERT_NO_FEATURE()
- * when the feature is disabled.
- *
- * A feature following the conventions may be used without knowing if it is
- * enabled or not.
- */
-
-#ifndef FEATURE_ES1
-#define FEATURE_ES1 0
-#endif
-#ifndef FEATURE_ES2
-#define FEATURE_ES2 0
-#endif
-
-#define FEATURE_ES (FEATURE_ES1 || FEATURE_ES2)
-
-#ifndef FEATURE_GL
-#define FEATURE_GL !FEATURE_ES
-#endif
-
-#if defined(IN_DRI_DRIVER) || (FEATURE_GL + FEATURE_ES1 + FEATURE_ES2 > 1)
-#define FEATURE_remap_table 1
-#else
-#define FEATURE_remap_table 0
-#endif
-
-#define FEATURE_dispatch 1
-#define FEATURE_texgen 1
-#define FEATURE_userclip 1
-
-#define FEATURE_accum FEATURE_GL
-#define FEATURE_arrayelt FEATURE_GL
-#define FEATURE_attrib_stack FEATURE_GL
-/* this disables vtxfmt, api_loopback, and api_noop completely */
-#define FEATURE_beginend FEATURE_GL
-#define FEATURE_colortable FEATURE_GL
-#define FEATURE_convolve FEATURE_GL
-#define FEATURE_dlist (FEATURE_GL && FEATURE_arrayelt && FEATURE_beginend)
-#define FEATURE_draw_read_buffer FEATURE_GL
-#define FEATURE_drawpix FEATURE_GL
-#define FEATURE_evaluators FEATURE_GL
-#define FEATURE_feedback FEATURE_GL
-#define FEATURE_pixel_transfer FEATURE_GL
-#define FEATURE_queryobj FEATURE_GL
-#define FEATURE_rastpos FEATURE_GL
-#define FEATURE_texture_fxt1 FEATURE_GL
-#define FEATURE_texture_s3tc FEATURE_GL
-
-#define FEATURE_extra_context_init FEATURE_ES
-#define FEATURE_point_size_array FEATURE_ES
-
-#define FEATURE_es2_glsl FEATURE_ES2
-
-#define FEATURE_ARB_fragment_program 1
-#define FEATURE_ARB_vertex_program 1
-#define FEATURE_ARB_vertex_shader 1
-#define FEATURE_ARB_fragment_shader 1
-#define FEATURE_ARB_shader_objects (FEATURE_ARB_vertex_shader || FEATURE_ARB_fragment_shader)
-#define FEATURE_ARB_shading_language_100 FEATURE_ARB_shader_objects
-#define FEATURE_ARB_geometry_shader4 FEATURE_ARB_shader_objects
-
-#define FEATURE_ARB_framebuffer_object (FEATURE_GL && FEATURE_EXT_framebuffer_object)
-#define FEATURE_ARB_map_buffer_range FEATURE_GL
-#define FEATURE_ARB_pixel_buffer_object (FEATURE_GL && FEATURE_EXT_pixel_buffer_object)
-#define FEATURE_ARB_sampler_objects FEATURE_GL
-#define FEATURE_ARB_sync FEATURE_GL
-#define FEATURE_ARB_vertex_buffer_object 1
-
-#define FEATURE_EXT_framebuffer_blit FEATURE_GL
-#define FEATURE_EXT_framebuffer_object 1
-#define FEATURE_EXT_pixel_buffer_object 1
-#define FEATURE_EXT_texture_sRGB FEATURE_GL
-#define FEATURE_EXT_transform_feedback FEATURE_GL
-
-#define FEATURE_APPLE_object_purgeable FEATURE_GL
-#define FEATURE_ATI_fragment_shader FEATURE_GL
-#define FEATURE_NV_fence FEATURE_GL
-#define FEATURE_NV_fragment_program FEATURE_GL
-#define FEATURE_NV_vertex_program FEATURE_GL
-
-#define FEATURE_OES_EGL_image 1
-#define FEATURE_OES_draw_texture FEATURE_ES1
-#define FEATURE_OES_framebuffer_object FEATURE_ES
-#define FEATURE_OES_mapbuffer FEATURE_ES
-
-#endif /* FEATURES_H */
+/*
+ * Mesa 3-D graphics library
+ * Version: 7.1
+ *
+ * Copyright (C) 1999-2008 Brian Paul All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+
+/**
+ * \file mfeatures.h
+ * Flags to enable/disable specific parts of the API.
+ */
+
+#ifndef FEATURES_H
+#define FEATURES_H
+
+
+#ifndef _HAVE_FULL_GL
+#define _HAVE_FULL_GL 1
+#endif
+
+/* assert that a feature is disabled and should never be used */
+#define ASSERT_NO_FEATURE() ASSERT(0)
+
+/**
+ * A feature can be anything. But most of them share certain characteristics.
+ *
+ * When a feature defines vtxfmt entries, they can be initialized and
+ * installed by
+ * _MESA_INIT_<FEATURE>_VTXFMT
+ * _mesa_install_<feature>_vtxfmt
+ *
+ * When a feature defines dispatch entries, they are initialized by
+ * _mesa_init_<feature>_dispatch
+ *
+ * When a feature has states, they are initialized and freed by
+ * _mesa_init_<feature>
+ * _mesa_free_<feature>_data
+ *
+ * Except for states, the others compile to no-op when a feature is disabled.
+ *
+ * The GLAPIENTRYs and helper functions defined by a feature should also
+ * compile to no-op when it is disabled. But to save typings and to catch
+ * bugs, some of them may be unavailable, or compile to ASSERT_NO_FEATURE()
+ * when the feature is disabled.
+ *
+ * A feature following the conventions may be used without knowing if it is
+ * enabled or not.
+ */
+
+#ifndef FEATURE_ES1
+#define FEATURE_ES1 0
+#endif
+#ifndef FEATURE_ES2
+#define FEATURE_ES2 0
+#endif
+
+#define FEATURE_ES (FEATURE_ES1 || FEATURE_ES2)
+
+#ifndef FEATURE_GL
+#define FEATURE_GL !FEATURE_ES
+#endif
+
+#if defined(IN_DRI_DRIVER) || (FEATURE_GL + FEATURE_ES1 + FEATURE_ES2 > 1)
+#define FEATURE_remap_table 1
+#else
+#define FEATURE_remap_table 0
+#endif
+
+#define FEATURE_dispatch 1
+#define FEATURE_texgen 1
+#define FEATURE_userclip 1
+
+#define FEATURE_accum FEATURE_GL
+#define FEATURE_arrayelt FEATURE_GL
+#define FEATURE_attrib_stack FEATURE_GL
+/* this disables vtxfmt, api_loopback, and api_noop completely */
+#define FEATURE_beginend FEATURE_GL
+#define FEATURE_colortable FEATURE_GL
+#define FEATURE_convolve FEATURE_GL
+#define FEATURE_dlist (FEATURE_GL && FEATURE_arrayelt && FEATURE_beginend)
+#define FEATURE_draw_read_buffer FEATURE_GL
+#define FEATURE_drawpix FEATURE_GL
+#define FEATURE_evaluators FEATURE_GL
+#define FEATURE_feedback FEATURE_GL
+#define FEATURE_pixel_transfer FEATURE_GL
+#define FEATURE_queryobj FEATURE_GL
+#define FEATURE_rastpos FEATURE_GL
+#define FEATURE_texture_fxt1 FEATURE_GL
+#define FEATURE_texture_s3tc FEATURE_GL
+
+#define FEATURE_extra_context_init FEATURE_ES
+#define FEATURE_point_size_array FEATURE_ES
+
+#define FEATURE_es2_glsl FEATURE_ES2
+
+#define FEATURE_ARB_fragment_program 1
+#define FEATURE_ARB_vertex_program 1
+#define FEATURE_ARB_vertex_shader 1
+#define FEATURE_ARB_fragment_shader 1
+#define FEATURE_ARB_shader_objects (FEATURE_ARB_vertex_shader || FEATURE_ARB_fragment_shader)
+#define FEATURE_ARB_shading_language_100 FEATURE_ARB_shader_objects
+#define FEATURE_ARB_geometry_shader4 FEATURE_ARB_shader_objects
+
+#define FEATURE_ARB_framebuffer_object (FEATURE_GL && FEATURE_EXT_framebuffer_object)
+#define FEATURE_ARB_map_buffer_range FEATURE_GL
+#define FEATURE_ARB_pixel_buffer_object (FEATURE_GL && FEATURE_EXT_pixel_buffer_object)
+#define FEATURE_ARB_sampler_objects FEATURE_GL
+#define FEATURE_ARB_sync FEATURE_GL
+#define FEATURE_ARB_vertex_buffer_object 1
+
+#define FEATURE_EXT_framebuffer_blit FEATURE_GL
+#define FEATURE_EXT_framebuffer_object 1
+#define FEATURE_EXT_pixel_buffer_object 1
+#define FEATURE_EXT_texture_sRGB FEATURE_GL
+#define FEATURE_EXT_transform_feedback FEATURE_GL
+
+#define FEATURE_APPLE_object_purgeable FEATURE_GL
+#define FEATURE_ATI_fragment_shader FEATURE_GL
+#define FEATURE_NV_fence FEATURE_GL
+#define FEATURE_NV_fragment_program FEATURE_GL
+#define FEATURE_NV_vertex_program FEATURE_GL
+
+#define FEATURE_OES_EGL_image 1
+#define FEATURE_OES_draw_texture FEATURE_ES1
+#define FEATURE_OES_framebuffer_object FEATURE_ES
+#define FEATURE_OES_mapbuffer FEATURE_ES
+
+#endif /* FEATURES_H */
diff --git a/mesalib/src/mesa/main/mtypes.h b/mesalib/src/mesa/main/mtypes.h
index eb2efc89a..acf95c81a 100644
--- a/mesalib/src/mesa/main/mtypes.h
+++ b/mesalib/src/mesa/main/mtypes.h
@@ -1,3424 +1,3424 @@
-/*
- * Mesa 3-D graphics library
- * Version: 7.7
- *
- * Copyright (C) 1999-2008 Brian Paul All Rights Reserved.
- * Copyright (C) 2009 VMware, Inc. All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-/**
- * \file mtypes.h
- * Main Mesa data structures.
- *
- * Please try to mark derived values with a leading underscore ('_').
- */
-
-#ifndef MTYPES_H
-#define MTYPES_H
-
-
-#include "main/glheader.h"
-#include "main/config.h"
-#include "main/mfeatures.h"
-#include "glapi/glapi.h"
-#include "math/m_matrix.h" /* GLmatrix */
-#include "main/simple_list.h" /* struct simple_node */
-#include "main/formats.h" /* MESA_FORMAT_COUNT */
-
-
-/**
- * Color channel data type.
- */
-#if CHAN_BITS == 8
- typedef GLubyte GLchan;
-#define CHAN_MAX 255
-#define CHAN_MAXF 255.0F
-#define CHAN_TYPE GL_UNSIGNED_BYTE
-#elif CHAN_BITS == 16
- typedef GLushort GLchan;
-#define CHAN_MAX 65535
-#define CHAN_MAXF 65535.0F
-#define CHAN_TYPE GL_UNSIGNED_SHORT
-#elif CHAN_BITS == 32
- typedef GLfloat GLchan;
-#define CHAN_MAX 1.0
-#define CHAN_MAXF 1.0F
-#define CHAN_TYPE GL_FLOAT
-#else
-#error "illegal number of color channel bits"
-#endif
-
-
-/**
- * Stencil buffer data type.
- */
-#if STENCIL_BITS==8
- typedef GLubyte GLstencil;
-#elif STENCIL_BITS==16
- typedef GLushort GLstencil;
-#else
-# error "illegal number of stencil bits"
-#endif
-
-
-/**
- * \name 64-bit extension of GLbitfield.
- */
-/*@{*/
-typedef GLuint64 GLbitfield64;
-
-/** Set a single bit */
-#define BITFIELD64_BIT(b) ((GLbitfield64)1 << (b))
-
-
-/**
- * \name Some forward type declarations
- */
-/*@{*/
-struct _mesa_HashTable;
-struct gl_attrib_node;
-struct gl_list_extensions;
-struct gl_meta_state;
-struct gl_pixelstore_attrib;
-struct gl_program_cache;
-struct gl_texture_format;
-struct gl_texture_image;
-struct gl_texture_object;
-struct gl_context;
-struct st_context;
-/*@}*/
-
-
-/** Extra draw modes beyond GL_POINTS, GL_TRIANGLE_FAN, etc */
-#define PRIM_OUTSIDE_BEGIN_END (GL_POLYGON+1)
-#define PRIM_INSIDE_UNKNOWN_PRIM (GL_POLYGON+2)
-#define PRIM_UNKNOWN (GL_POLYGON+3)
-
-
-/**
- * Shader stages. Note that these will become 5 with tessellation.
- * These MUST have the same values as gallium's PIPE_SHADER_*
- */
-typedef enum
-{
- MESA_SHADER_VERTEX = 0,
- MESA_SHADER_FRAGMENT = 1,
- MESA_SHADER_GEOMETRY = 2,
- MESA_SHADER_TYPES = 3
-} gl_shader_type;
-
-
-
-/**
- * Indexes for vertex program attributes.
- * GL_NV_vertex_program aliases generic attributes over the conventional
- * attributes. In GL_ARB_vertex_program shader the aliasing is optional.
- * In GL_ARB_vertex_shader / OpenGL 2.0 the aliasing is disallowed (the
- * generic attributes are distinct/separate).
- */
-typedef enum
-{
- VERT_ATTRIB_POS = 0,
- VERT_ATTRIB_WEIGHT = 1,
- VERT_ATTRIB_NORMAL = 2,
- VERT_ATTRIB_COLOR0 = 3,
- VERT_ATTRIB_COLOR1 = 4,
- VERT_ATTRIB_FOG = 5,
- VERT_ATTRIB_COLOR_INDEX = 6,
- VERT_ATTRIB_POINT_SIZE = 6, /*alias*/
- VERT_ATTRIB_EDGEFLAG = 7,
- VERT_ATTRIB_TEX0 = 8,
- VERT_ATTRIB_TEX1 = 9,
- VERT_ATTRIB_TEX2 = 10,
- VERT_ATTRIB_TEX3 = 11,
- VERT_ATTRIB_TEX4 = 12,
- VERT_ATTRIB_TEX5 = 13,
- VERT_ATTRIB_TEX6 = 14,
- VERT_ATTRIB_TEX7 = 15,
- VERT_ATTRIB_GENERIC0 = 16,
- VERT_ATTRIB_GENERIC1 = 17,
- VERT_ATTRIB_GENERIC2 = 18,
- VERT_ATTRIB_GENERIC3 = 19,
- VERT_ATTRIB_GENERIC4 = 20,
- VERT_ATTRIB_GENERIC5 = 21,
- VERT_ATTRIB_GENERIC6 = 22,
- VERT_ATTRIB_GENERIC7 = 23,
- VERT_ATTRIB_GENERIC8 = 24,
- VERT_ATTRIB_GENERIC9 = 25,
- VERT_ATTRIB_GENERIC10 = 26,
- VERT_ATTRIB_GENERIC11 = 27,
- VERT_ATTRIB_GENERIC12 = 28,
- VERT_ATTRIB_GENERIC13 = 29,
- VERT_ATTRIB_GENERIC14 = 30,
- VERT_ATTRIB_GENERIC15 = 31,
- VERT_ATTRIB_MAX = 32
-} gl_vert_attrib;
-
-/**
- * Bitflags for vertex attributes.
- * These are used in bitfields in many places.
- */
-/*@{*/
-#define VERT_BIT_POS (1 << VERT_ATTRIB_POS)
-#define VERT_BIT_WEIGHT (1 << VERT_ATTRIB_WEIGHT)
-#define VERT_BIT_NORMAL (1 << VERT_ATTRIB_NORMAL)
-#define VERT_BIT_COLOR0 (1 << VERT_ATTRIB_COLOR0)
-#define VERT_BIT_COLOR1 (1 << VERT_ATTRIB_COLOR1)
-#define VERT_BIT_FOG (1 << VERT_ATTRIB_FOG)
-#define VERT_BIT_COLOR_INDEX (1 << VERT_ATTRIB_COLOR_INDEX)
-#define VERT_BIT_EDGEFLAG (1 << VERT_ATTRIB_EDGEFLAG)
-#define VERT_BIT_TEX0 (1 << VERT_ATTRIB_TEX0)
-#define VERT_BIT_TEX1 (1 << VERT_ATTRIB_TEX1)
-#define VERT_BIT_TEX2 (1 << VERT_ATTRIB_TEX2)
-#define VERT_BIT_TEX3 (1 << VERT_ATTRIB_TEX3)
-#define VERT_BIT_TEX4 (1 << VERT_ATTRIB_TEX4)
-#define VERT_BIT_TEX5 (1 << VERT_ATTRIB_TEX5)
-#define VERT_BIT_TEX6 (1 << VERT_ATTRIB_TEX6)
-#define VERT_BIT_TEX7 (1 << VERT_ATTRIB_TEX7)
-#define VERT_BIT_GENERIC0 (1 << VERT_ATTRIB_GENERIC0)
-#define VERT_BIT_GENERIC1 (1 << VERT_ATTRIB_GENERIC1)
-#define VERT_BIT_GENERIC2 (1 << VERT_ATTRIB_GENERIC2)
-#define VERT_BIT_GENERIC3 (1 << VERT_ATTRIB_GENERIC3)
-#define VERT_BIT_GENERIC4 (1 << VERT_ATTRIB_GENERIC4)
-#define VERT_BIT_GENERIC5 (1 << VERT_ATTRIB_GENERIC5)
-#define VERT_BIT_GENERIC6 (1 << VERT_ATTRIB_GENERIC6)
-#define VERT_BIT_GENERIC7 (1 << VERT_ATTRIB_GENERIC7)
-#define VERT_BIT_GENERIC8 (1 << VERT_ATTRIB_GENERIC8)
-#define VERT_BIT_GENERIC9 (1 << VERT_ATTRIB_GENERIC9)
-#define VERT_BIT_GENERIC10 (1 << VERT_ATTRIB_GENERIC10)
-#define VERT_BIT_GENERIC11 (1 << VERT_ATTRIB_GENERIC11)
-#define VERT_BIT_GENERIC12 (1 << VERT_ATTRIB_GENERIC12)
-#define VERT_BIT_GENERIC13 (1 << VERT_ATTRIB_GENERIC13)
-#define VERT_BIT_GENERIC14 (1 << VERT_ATTRIB_GENERIC14)
-#define VERT_BIT_GENERIC15 (1 << VERT_ATTRIB_GENERIC15)
-
-#define VERT_BIT_TEX(u) (1 << (VERT_ATTRIB_TEX0 + (u)))
-#define VERT_BIT_GENERIC(g) (1 << (VERT_ATTRIB_GENERIC0 + (g)))
-/*@}*/
-
-
-/**
- * Indexes for vertex program result attributes
- */
-typedef enum
-{
- VERT_RESULT_HPOS = 0,
- VERT_RESULT_COL0 = 1,
- VERT_RESULT_COL1 = 2,
- VERT_RESULT_FOGC = 3,
- VERT_RESULT_TEX0 = 4,
- VERT_RESULT_TEX1 = 5,
- VERT_RESULT_TEX2 = 6,
- VERT_RESULT_TEX3 = 7,
- VERT_RESULT_TEX4 = 8,
- VERT_RESULT_TEX5 = 9,
- VERT_RESULT_TEX6 = 10,
- VERT_RESULT_TEX7 = 11,
- VERT_RESULT_PSIZ = 12,
- VERT_RESULT_BFC0 = 13,
- VERT_RESULT_BFC1 = 14,
- VERT_RESULT_EDGE = 15,
- VERT_RESULT_VAR0 = 16, /**< shader varying */
- VERT_RESULT_MAX = (VERT_RESULT_VAR0 + MAX_VARYING)
-} gl_vert_result;
-
-
-/*********************************************/
-
-/**
- * Indexes for geometry program attributes.
- */
-typedef enum
-{
- GEOM_ATTRIB_POSITION = 0,
- GEOM_ATTRIB_COLOR0 = 1,
- GEOM_ATTRIB_COLOR1 = 2,
- GEOM_ATTRIB_SECONDARY_COLOR0 = 3,
- GEOM_ATTRIB_SECONDARY_COLOR1 = 4,
- GEOM_ATTRIB_FOG_FRAG_COORD = 5,
- GEOM_ATTRIB_POINT_SIZE = 6,
- GEOM_ATTRIB_CLIP_VERTEX = 7,
- GEOM_ATTRIB_PRIMITIVE_ID = 8,
- GEOM_ATTRIB_TEX_COORD = 9,
-
- GEOM_ATTRIB_VAR0 = 16,
- GEOM_ATTRIB_MAX = (GEOM_ATTRIB_VAR0 + MAX_VARYING)
-} gl_geom_attrib;
-
-/**
- * Bitflags for geometry attributes.
- * These are used in bitfields in many places.
- */
-/*@{*/
-#define GEOM_BIT_COLOR0 (1 << GEOM_ATTRIB_COLOR0)
-#define GEOM_BIT_COLOR1 (1 << GEOM_ATTRIB_COLOR1)
-#define GEOM_BIT_SCOLOR0 (1 << GEOM_ATTRIB_SECONDARY_COLOR0)
-#define GEOM_BIT_SCOLOR1 (1 << GEOM_ATTRIB_SECONDARY_COLOR1)
-#define GEOM_BIT_TEX_COORD (1 << GEOM_ATTRIB_TEX_COORD)
-#define GEOM_BIT_FOG_COORD (1 << GEOM_ATTRIB_FOG_FRAG_COORD)
-#define GEOM_BIT_POSITION (1 << GEOM_ATTRIB_POSITION)
-#define GEOM_BIT_POINT_SIDE (1 << GEOM_ATTRIB_POINT_SIZE)
-#define GEOM_BIT_CLIP_VERTEX (1 << GEOM_ATTRIB_CLIP_VERTEX)
-#define GEOM_BIT_PRIM_ID (1 << GEOM_ATTRIB_PRIMITIVE_ID)
-#define GEOM_BIT_VAR0 (1 << GEOM_ATTRIB_VAR0)
-
-#define GEOM_BIT_VAR(g) (1 << (GEOM_BIT_VAR0 + (g)))
-/*@}*/
-
-
-/**
- * Indexes for geometry program result attributes
- */
-typedef enum
-{
- GEOM_RESULT_POS = 0,
- GEOM_RESULT_COL0 = 1,
- GEOM_RESULT_COL1 = 2,
- GEOM_RESULT_SCOL0 = 3,
- GEOM_RESULT_SCOL1 = 4,
- GEOM_RESULT_FOGC = 5,
- GEOM_RESULT_TEX0 = 6,
- GEOM_RESULT_TEX1 = 7,
- GEOM_RESULT_TEX2 = 8,
- GEOM_RESULT_TEX3 = 9,
- GEOM_RESULT_TEX4 = 10,
- GEOM_RESULT_TEX5 = 11,
- GEOM_RESULT_TEX6 = 12,
- GEOM_RESULT_TEX7 = 13,
- GEOM_RESULT_PSIZ = 14,
- GEOM_RESULT_CLPV = 15,
- GEOM_RESULT_PRID = 16,
- GEOM_RESULT_LAYR = 17,
- GEOM_RESULT_VAR0 = 18, /**< shader varying, should really be 16 */
- /* ### we need to -2 because var0 is 18 instead 16 like in the others */
- GEOM_RESULT_MAX = (GEOM_RESULT_VAR0 + MAX_VARYING - 2)
-} gl_geom_result;
-
-
-/**
- * Indexes for fragment program input attributes.
- */
-typedef enum
-{
- FRAG_ATTRIB_WPOS = 0,
- FRAG_ATTRIB_COL0 = 1,
- FRAG_ATTRIB_COL1 = 2,
- FRAG_ATTRIB_FOGC = 3,
- FRAG_ATTRIB_TEX0 = 4,
- FRAG_ATTRIB_TEX1 = 5,
- FRAG_ATTRIB_TEX2 = 6,
- FRAG_ATTRIB_TEX3 = 7,
- FRAG_ATTRIB_TEX4 = 8,
- FRAG_ATTRIB_TEX5 = 9,
- FRAG_ATTRIB_TEX6 = 10,
- FRAG_ATTRIB_TEX7 = 11,
- FRAG_ATTRIB_FACE = 12, /**< front/back face */
- FRAG_ATTRIB_PNTC = 13, /**< sprite/point coord */
- FRAG_ATTRIB_VAR0 = 14, /**< shader varying */
- FRAG_ATTRIB_MAX = (FRAG_ATTRIB_VAR0 + MAX_VARYING)
-} gl_frag_attrib;
-
-/**
- * Bitflags for fragment program input attributes.
- */
-/*@{*/
-#define FRAG_BIT_WPOS (1 << FRAG_ATTRIB_WPOS)
-#define FRAG_BIT_COL0 (1 << FRAG_ATTRIB_COL0)
-#define FRAG_BIT_COL1 (1 << FRAG_ATTRIB_COL1)
-#define FRAG_BIT_FOGC (1 << FRAG_ATTRIB_FOGC)
-#define FRAG_BIT_FACE (1 << FRAG_ATTRIB_FACE)
-#define FRAG_BIT_PNTC (1 << FRAG_ATTRIB_PNTC)
-#define FRAG_BIT_TEX0 (1 << FRAG_ATTRIB_TEX0)
-#define FRAG_BIT_TEX1 (1 << FRAG_ATTRIB_TEX1)
-#define FRAG_BIT_TEX2 (1 << FRAG_ATTRIB_TEX2)
-#define FRAG_BIT_TEX3 (1 << FRAG_ATTRIB_TEX3)
-#define FRAG_BIT_TEX4 (1 << FRAG_ATTRIB_TEX4)
-#define FRAG_BIT_TEX5 (1 << FRAG_ATTRIB_TEX5)
-#define FRAG_BIT_TEX6 (1 << FRAG_ATTRIB_TEX6)
-#define FRAG_BIT_TEX7 (1 << FRAG_ATTRIB_TEX7)
-#define FRAG_BIT_VAR0 (1 << FRAG_ATTRIB_VAR0)
-
-#define FRAG_BIT_TEX(U) (FRAG_BIT_TEX0 << (U))
-#define FRAG_BIT_VAR(V) (FRAG_BIT_VAR0 << (V))
-
-#define FRAG_BITS_TEX_ANY (FRAG_BIT_TEX0| \
- FRAG_BIT_TEX1| \
- FRAG_BIT_TEX2| \
- FRAG_BIT_TEX3| \
- FRAG_BIT_TEX4| \
- FRAG_BIT_TEX5| \
- FRAG_BIT_TEX6| \
- FRAG_BIT_TEX7)
-/*@}*/
-
-
-/**
- * Fragment program results
- */
-typedef enum
-{
- FRAG_RESULT_DEPTH = 0,
- FRAG_RESULT_STENCIL = 1,
- /* If a single color should be written to all render targets, this
- * register is written. No FRAG_RESULT_DATAn will be written.
- */
- FRAG_RESULT_COLOR = 2,
-
- /* FRAG_RESULT_DATAn are the per-render-target (GLSL gl_FragData[n]
- * or ARB_fragment_program fragment.color[n]) color results. If
- * any are written, FRAG_RESULT_COLOR will not be written.
- */
- FRAG_RESULT_DATA0 = 3,
- FRAG_RESULT_MAX = (FRAG_RESULT_DATA0 + MAX_DRAW_BUFFERS)
-} gl_frag_result;
-
-
-/**
- * Indexes for all renderbuffers
- */
-typedef enum
-{
- /* the four standard color buffers */
- BUFFER_FRONT_LEFT,
- BUFFER_BACK_LEFT,
- BUFFER_FRONT_RIGHT,
- BUFFER_BACK_RIGHT,
- BUFFER_DEPTH,
- BUFFER_STENCIL,
- BUFFER_ACCUM,
- /* optional aux buffer */
- BUFFER_AUX0,
- /* generic renderbuffers */
- BUFFER_COLOR0,
- BUFFER_COLOR1,
- BUFFER_COLOR2,
- BUFFER_COLOR3,
- BUFFER_COLOR4,
- BUFFER_COLOR5,
- BUFFER_COLOR6,
- BUFFER_COLOR7,
- BUFFER_COUNT
-} gl_buffer_index;
-
-/**
- * Bit flags for all renderbuffers
- */
-#define BUFFER_BIT_FRONT_LEFT (1 << BUFFER_FRONT_LEFT)
-#define BUFFER_BIT_BACK_LEFT (1 << BUFFER_BACK_LEFT)
-#define BUFFER_BIT_FRONT_RIGHT (1 << BUFFER_FRONT_RIGHT)
-#define BUFFER_BIT_BACK_RIGHT (1 << BUFFER_BACK_RIGHT)
-#define BUFFER_BIT_AUX0 (1 << BUFFER_AUX0)
-#define BUFFER_BIT_AUX1 (1 << BUFFER_AUX1)
-#define BUFFER_BIT_AUX2 (1 << BUFFER_AUX2)
-#define BUFFER_BIT_AUX3 (1 << BUFFER_AUX3)
-#define BUFFER_BIT_DEPTH (1 << BUFFER_DEPTH)
-#define BUFFER_BIT_STENCIL (1 << BUFFER_STENCIL)
-#define BUFFER_BIT_ACCUM (1 << BUFFER_ACCUM)
-#define BUFFER_BIT_COLOR0 (1 << BUFFER_COLOR0)
-#define BUFFER_BIT_COLOR1 (1 << BUFFER_COLOR1)
-#define BUFFER_BIT_COLOR2 (1 << BUFFER_COLOR2)
-#define BUFFER_BIT_COLOR3 (1 << BUFFER_COLOR3)
-#define BUFFER_BIT_COLOR4 (1 << BUFFER_COLOR4)
-#define BUFFER_BIT_COLOR5 (1 << BUFFER_COLOR5)
-#define BUFFER_BIT_COLOR6 (1 << BUFFER_COLOR6)
-#define BUFFER_BIT_COLOR7 (1 << BUFFER_COLOR7)
-
-/**
- * Mask of all the color buffer bits (but not accum).
- */
-#define BUFFER_BITS_COLOR (BUFFER_BIT_FRONT_LEFT | \
- BUFFER_BIT_BACK_LEFT | \
- BUFFER_BIT_FRONT_RIGHT | \
- BUFFER_BIT_BACK_RIGHT | \
- BUFFER_BIT_AUX0 | \
- BUFFER_BIT_COLOR0 | \
- BUFFER_BIT_COLOR1 | \
- BUFFER_BIT_COLOR2 | \
- BUFFER_BIT_COLOR3 | \
- BUFFER_BIT_COLOR4 | \
- BUFFER_BIT_COLOR5 | \
- BUFFER_BIT_COLOR6 | \
- BUFFER_BIT_COLOR7)
-
-
-/**
- * Framebuffer configuration (aka visual / pixelformat)
- * Note: some of these fields should be boolean, but it appears that
- * code in drivers/dri/common/util.c requires int-sized fields.
- */
-struct gl_config
-{
- GLboolean rgbMode;
- GLboolean floatMode;
- GLboolean colorIndexMode; /* XXX is this used anywhere? */
- GLuint doubleBufferMode;
- GLuint stereoMode;
-
- GLboolean haveAccumBuffer;
- GLboolean haveDepthBuffer;
- GLboolean haveStencilBuffer;
-
- GLint redBits, greenBits, blueBits, alphaBits; /* bits per comp */
- GLuint redMask, greenMask, blueMask, alphaMask;
- GLint rgbBits; /* total bits for rgb */
- GLint indexBits; /* total bits for colorindex */
-
- GLint accumRedBits, accumGreenBits, accumBlueBits, accumAlphaBits;
- GLint depthBits;
- GLint stencilBits;
-
- GLint numAuxBuffers;
-
- GLint level;
-
- /* EXT_visual_rating / GLX 1.2 */
- GLint visualRating;
-
- /* EXT_visual_info / GLX 1.2 */
- GLint transparentPixel;
- /* colors are floats scaled to ints */
- GLint transparentRed, transparentGreen, transparentBlue, transparentAlpha;
- GLint transparentIndex;
-
- /* ARB_multisample / SGIS_multisample */
- GLint sampleBuffers;
- GLint samples;
-
- /* SGIX_pbuffer / GLX 1.3 */
- GLint maxPbufferWidth;
- GLint maxPbufferHeight;
- GLint maxPbufferPixels;
- GLint optimalPbufferWidth; /* Only for SGIX_pbuffer. */
- GLint optimalPbufferHeight; /* Only for SGIX_pbuffer. */
-
- /* OML_swap_method */
- GLint swapMethod;
-
- /* EXT_texture_from_pixmap */
- GLint bindToTextureRgb;
- GLint bindToTextureRgba;
- GLint bindToMipmapTexture;
- GLint bindToTextureTargets;
- GLint yInverted;
-
- /* EXT_framebuffer_sRGB */
- GLint sRGBCapable;
-};
-
-
-/**
- * Data structure for color tables
- */
-struct gl_color_table
-{
- GLenum InternalFormat; /**< The user-specified format */
- GLenum _BaseFormat; /**< GL_ALPHA, GL_RGBA, GL_RGB, etc */
- GLuint Size; /**< number of entries in table */
- GLfloat *TableF; /**< Color table, floating point values */
- GLubyte *TableUB; /**< Color table, ubyte values */
- GLubyte RedSize;
- GLubyte GreenSize;
- GLubyte BlueSize;
- GLubyte AlphaSize;
- GLubyte LuminanceSize;
- GLubyte IntensitySize;
-};
-
-
-/**
- * \name Bit flags used for updating material values.
- */
-/*@{*/
-#define MAT_ATTRIB_FRONT_AMBIENT 0
-#define MAT_ATTRIB_BACK_AMBIENT 1
-#define MAT_ATTRIB_FRONT_DIFFUSE 2
-#define MAT_ATTRIB_BACK_DIFFUSE 3
-#define MAT_ATTRIB_FRONT_SPECULAR 4
-#define MAT_ATTRIB_BACK_SPECULAR 5
-#define MAT_ATTRIB_FRONT_EMISSION 6
-#define MAT_ATTRIB_BACK_EMISSION 7
-#define MAT_ATTRIB_FRONT_SHININESS 8
-#define MAT_ATTRIB_BACK_SHININESS 9
-#define MAT_ATTRIB_FRONT_INDEXES 10
-#define MAT_ATTRIB_BACK_INDEXES 11
-#define MAT_ATTRIB_MAX 12
-
-#define MAT_ATTRIB_AMBIENT(f) (MAT_ATTRIB_FRONT_AMBIENT+(f))
-#define MAT_ATTRIB_DIFFUSE(f) (MAT_ATTRIB_FRONT_DIFFUSE+(f))
-#define MAT_ATTRIB_SPECULAR(f) (MAT_ATTRIB_FRONT_SPECULAR+(f))
-#define MAT_ATTRIB_EMISSION(f) (MAT_ATTRIB_FRONT_EMISSION+(f))
-#define MAT_ATTRIB_SHININESS(f)(MAT_ATTRIB_FRONT_SHININESS+(f))
-#define MAT_ATTRIB_INDEXES(f) (MAT_ATTRIB_FRONT_INDEXES+(f))
-
-#define MAT_INDEX_AMBIENT 0
-#define MAT_INDEX_DIFFUSE 1
-#define MAT_INDEX_SPECULAR 2
-
-#define MAT_BIT_FRONT_AMBIENT (1<<MAT_ATTRIB_FRONT_AMBIENT)
-#define MAT_BIT_BACK_AMBIENT (1<<MAT_ATTRIB_BACK_AMBIENT)
-#define MAT_BIT_FRONT_DIFFUSE (1<<MAT_ATTRIB_FRONT_DIFFUSE)
-#define MAT_BIT_BACK_DIFFUSE (1<<MAT_ATTRIB_BACK_DIFFUSE)
-#define MAT_BIT_FRONT_SPECULAR (1<<MAT_ATTRIB_FRONT_SPECULAR)
-#define MAT_BIT_BACK_SPECULAR (1<<MAT_ATTRIB_BACK_SPECULAR)
-#define MAT_BIT_FRONT_EMISSION (1<<MAT_ATTRIB_FRONT_EMISSION)
-#define MAT_BIT_BACK_EMISSION (1<<MAT_ATTRIB_BACK_EMISSION)
-#define MAT_BIT_FRONT_SHININESS (1<<MAT_ATTRIB_FRONT_SHININESS)
-#define MAT_BIT_BACK_SHININESS (1<<MAT_ATTRIB_BACK_SHININESS)
-#define MAT_BIT_FRONT_INDEXES (1<<MAT_ATTRIB_FRONT_INDEXES)
-#define MAT_BIT_BACK_INDEXES (1<<MAT_ATTRIB_BACK_INDEXES)
-
-
-#define FRONT_MATERIAL_BITS (MAT_BIT_FRONT_EMISSION | \
- MAT_BIT_FRONT_AMBIENT | \
- MAT_BIT_FRONT_DIFFUSE | \
- MAT_BIT_FRONT_SPECULAR | \
- MAT_BIT_FRONT_SHININESS | \
- MAT_BIT_FRONT_INDEXES)
-
-#define BACK_MATERIAL_BITS (MAT_BIT_BACK_EMISSION | \
- MAT_BIT_BACK_AMBIENT | \
- MAT_BIT_BACK_DIFFUSE | \
- MAT_BIT_BACK_SPECULAR | \
- MAT_BIT_BACK_SHININESS | \
- MAT_BIT_BACK_INDEXES)
-
-#define ALL_MATERIAL_BITS (FRONT_MATERIAL_BITS | BACK_MATERIAL_BITS)
-/*@}*/
-
-
-#define EXP_TABLE_SIZE 512 /**< Specular exponent lookup table sizes */
-#define SHINE_TABLE_SIZE 256 /**< Material shininess lookup table sizes */
-
-/**
- * Material shininess lookup table.
- */
-struct gl_shine_tab
-{
- struct gl_shine_tab *next, *prev;
- GLfloat tab[SHINE_TABLE_SIZE+1];
- GLfloat shininess;
- GLuint refcount;
-};
-
-
-/**
- * Light source state.
- */
-struct gl_light
-{
- struct gl_light *next; /**< double linked list with sentinel */
- struct gl_light *prev;
-
- GLfloat Ambient[4]; /**< ambient color */
- GLfloat Diffuse[4]; /**< diffuse color */
- GLfloat Specular[4]; /**< specular color */
- GLfloat EyePosition[4]; /**< position in eye coordinates */
- GLfloat SpotDirection[4]; /**< spotlight direction in eye coordinates */
- GLfloat SpotExponent;
- GLfloat SpotCutoff; /**< in degrees */
- GLfloat _CosCutoffNeg; /**< = cos(SpotCutoff) */
- GLfloat _CosCutoff; /**< = MAX(0, cos(SpotCutoff)) */
- GLfloat ConstantAttenuation;
- GLfloat LinearAttenuation;
- GLfloat QuadraticAttenuation;
- GLboolean Enabled; /**< On/off flag */
-
- /**
- * \name Derived fields
- */
- /*@{*/
- GLbitfield _Flags; /**< State */
-
- GLfloat _Position[4]; /**< position in eye/obj coordinates */
- GLfloat _VP_inf_norm[3]; /**< Norm direction to infinite light */
- GLfloat _h_inf_norm[3]; /**< Norm( _VP_inf_norm + <0,0,1> ) */
- GLfloat _NormSpotDirection[4]; /**< normalized spotlight direction */
- GLfloat _VP_inf_spot_attenuation;
-
- GLfloat _SpotExpTable[EXP_TABLE_SIZE][2]; /**< to replace a pow() call */
- GLfloat _MatAmbient[2][3]; /**< material ambient * light ambient */
- GLfloat _MatDiffuse[2][3]; /**< material diffuse * light diffuse */
- GLfloat _MatSpecular[2][3]; /**< material spec * light specular */
- GLfloat _dli; /**< CI diffuse light intensity */
- GLfloat _sli; /**< CI specular light intensity */
- /*@}*/
-};
-
-
-/**
- * Light model state.
- */
-struct gl_lightmodel
-{
- GLfloat Ambient[4]; /**< ambient color */
- GLboolean LocalViewer; /**< Local (or infinite) view point? */
- GLboolean TwoSide; /**< Two (or one) sided lighting? */
- GLenum ColorControl; /**< either GL_SINGLE_COLOR
- * or GL_SEPARATE_SPECULAR_COLOR */
-};
-
-
-/**
- * Material state.
- */
-struct gl_material
-{
- GLfloat Attrib[MAT_ATTRIB_MAX][4];
-};
-
-
-/**
- * Accumulation buffer attribute group (GL_ACCUM_BUFFER_BIT)
- */
-struct gl_accum_attrib
-{
- GLfloat ClearColor[4]; /**< Accumulation buffer clear color */
-};
-
-
-/**
- * Color buffer attribute group (GL_COLOR_BUFFER_BIT).
- */
-struct gl_colorbuffer_attrib
-{
- GLuint ClearIndex; /**< Index to use for glClear */
- GLfloat ClearColorUnclamped[4]; /**< Color to use for glClear*/
- GLclampf ClearColor[4]; /**< Color to use for glClear */
-
- GLuint IndexMask; /**< Color index write mask */
- GLubyte ColorMask[MAX_DRAW_BUFFERS][4];/**< Each flag is 0xff or 0x0 */
-
- GLenum DrawBuffer[MAX_DRAW_BUFFERS]; /**< Which buffer to draw into */
-
- /**
- * \name alpha testing
- */
- /*@{*/
- GLboolean AlphaEnabled; /**< Alpha test enabled flag */
- GLenum AlphaFunc; /**< Alpha test function */
- GLfloat AlphaRefUnclamped;
- GLclampf AlphaRef; /**< Alpha reference value */
- /*@}*/
-
- /**
- * \name Blending
- */
- /*@{*/
- GLbitfield BlendEnabled; /**< Per-buffer blend enable flags */
-
- /* NOTE: this does _not_ depend on fragment clamping or any other clamping control,
- * only on the fixed-pointness of the render target.
- * The query does however depend on fragment color clamping.
- */
- GLfloat BlendColorUnclamped[4]; /**< Blending color */
- GLfloat BlendColor[4]; /**< Blending color */
-
- struct
- {
- GLenum SrcRGB; /**< RGB blend source term */
- GLenum DstRGB; /**< RGB blend dest term */
- GLenum SrcA; /**< Alpha blend source term */
- GLenum DstA; /**< Alpha blend dest term */
- GLenum EquationRGB; /**< GL_ADD, GL_SUBTRACT, etc. */
- GLenum EquationA; /**< GL_ADD, GL_SUBTRACT, etc. */
- } Blend[MAX_DRAW_BUFFERS];
- /** Are the blend func terms currently different for each buffer/target? */
- GLboolean _BlendFuncPerBuffer;
- /** Are the blend equations currently different for each buffer/target? */
- GLboolean _BlendEquationPerBuffer;
- /*@}*/
-
- /**
- * \name Logic op
- */
- /*@{*/
- GLenum LogicOp; /**< Logic operator */
- GLboolean IndexLogicOpEnabled; /**< Color index logic op enabled flag */
- GLboolean ColorLogicOpEnabled; /**< RGBA logic op enabled flag */
- GLboolean _LogicOpEnabled; /**< RGBA logic op + EXT_blend_logic_op enabled flag */
- /*@}*/
-
- GLboolean DitherFlag; /**< Dither enable flag */
-
- GLenum ClampFragmentColor; /**< GL_TRUE, GL_FALSE or GL_FIXED_ONLY_ARB */
- GLboolean _ClampFragmentColor; /** < with GL_FIXED_ONLY_ARB resolved */
- GLenum ClampReadColor; /**< GL_TRUE, GL_FALSE or GL_FIXED_ONLY_ARB */
- GLboolean _ClampReadColor; /** < with GL_FIXED_ONLY_ARB resolved */
-
- GLboolean sRGBEnabled; /**< Framebuffer sRGB blending/updating requested */
-};
-
-
-/**
- * Current attribute group (GL_CURRENT_BIT).
- */
-struct gl_current_attrib
-{
- /**
- * \name Current vertex attributes.
- * \note Values are valid only after FLUSH_VERTICES has been called.
- * \note Index and Edgeflag current values are stored as floats in the
- * SIX and SEVEN attribute slots.
- */
- GLfloat Attrib[VERT_ATTRIB_MAX][4]; /**< Position, color, texcoords, etc */
-
- /**
- * \name Current raster position attributes (always valid).
- * \note This set of attributes is very similar to the SWvertex struct.
- */
- /*@{*/
- GLfloat RasterPos[4];
- GLfloat RasterDistance;
- GLfloat RasterColor[4];
- GLfloat RasterSecondaryColor[4];
- GLfloat RasterTexCoords[MAX_TEXTURE_COORD_UNITS][4];
- GLboolean RasterPosValid;
- /*@}*/
-};
-
-
-/**
- * Depth buffer attribute group (GL_DEPTH_BUFFER_BIT).
- */
-struct gl_depthbuffer_attrib
-{
- GLenum Func; /**< Function for depth buffer compare */
- GLclampd Clear; /**< Value to clear depth buffer to */
- GLboolean Test; /**< Depth buffering enabled flag */
- GLboolean Mask; /**< Depth buffer writable? */
- GLboolean BoundsTest; /**< GL_EXT_depth_bounds_test */
- GLfloat BoundsMin, BoundsMax;/**< GL_EXT_depth_bounds_test */
-};
-
-
-/**
- * Evaluator attribute group (GL_EVAL_BIT).
- */
-struct gl_eval_attrib
-{
- /**
- * \name Enable bits
- */
- /*@{*/
- GLboolean Map1Color4;
- GLboolean Map1Index;
- GLboolean Map1Normal;
- GLboolean Map1TextureCoord1;
- GLboolean Map1TextureCoord2;
- GLboolean Map1TextureCoord3;
- GLboolean Map1TextureCoord4;
- GLboolean Map1Vertex3;
- GLboolean Map1Vertex4;
- GLboolean Map1Attrib[16]; /* GL_NV_vertex_program */
- GLboolean Map2Color4;
- GLboolean Map2Index;
- GLboolean Map2Normal;
- GLboolean Map2TextureCoord1;
- GLboolean Map2TextureCoord2;
- GLboolean Map2TextureCoord3;
- GLboolean Map2TextureCoord4;
- GLboolean Map2Vertex3;
- GLboolean Map2Vertex4;
- GLboolean Map2Attrib[16]; /* GL_NV_vertex_program */
- GLboolean AutoNormal;
- /*@}*/
-
- /**
- * \name Map Grid endpoints and divisions and calculated du values
- */
- /*@{*/
- GLint MapGrid1un;
- GLfloat MapGrid1u1, MapGrid1u2, MapGrid1du;
- GLint MapGrid2un, MapGrid2vn;
- GLfloat MapGrid2u1, MapGrid2u2, MapGrid2du;
- GLfloat MapGrid2v1, MapGrid2v2, MapGrid2dv;
- /*@}*/
-};
-
-
-/**
- * Fog attribute group (GL_FOG_BIT).
- */
-struct gl_fog_attrib
-{
- GLboolean Enabled; /**< Fog enabled flag */
- GLfloat ColorUnclamped[4]; /**< Fog color */
- GLfloat Color[4]; /**< Fog color */
- GLfloat Density; /**< Density >= 0.0 */
- GLfloat Start; /**< Start distance in eye coords */
- GLfloat End; /**< End distance in eye coords */
- GLfloat Index; /**< Fog index */
- GLenum Mode; /**< Fog mode */
- GLboolean ColorSumEnabled;
- GLenum FogCoordinateSource; /**< GL_EXT_fog_coord */
- GLfloat _Scale; /**< (End == Start) ? 1.0 : 1.0 / (End - Start) */
-};
-
-
-/**
- * \brief Layout qualifiers for gl_FragDepth.
- *
- * Extension AMD_conservative_depth allows gl_FragDepth to be redeclared with
- * a layout qualifier.
- *
- * \see enum ir_depth_layout
- */
-enum gl_frag_depth_layout {
- FRAG_DEPTH_LAYOUT_NONE, /**< No layout is specified. */
- FRAG_DEPTH_LAYOUT_ANY,
- FRAG_DEPTH_LAYOUT_GREATER,
- FRAG_DEPTH_LAYOUT_LESS,
- FRAG_DEPTH_LAYOUT_UNCHANGED
-};
-
-
-/**
- * Hint attribute group (GL_HINT_BIT).
- *
- * Values are always one of GL_FASTEST, GL_NICEST, or GL_DONT_CARE.
- */
-struct gl_hint_attrib
-{
- GLenum PerspectiveCorrection;
- GLenum PointSmooth;
- GLenum LineSmooth;
- GLenum PolygonSmooth;
- GLenum Fog;
- GLenum ClipVolumeClipping; /**< GL_EXT_clip_volume_hint */
- GLenum TextureCompression; /**< GL_ARB_texture_compression */
- GLenum GenerateMipmap; /**< GL_SGIS_generate_mipmap */
- GLenum FragmentShaderDerivative; /**< GL_ARB_fragment_shader */
-};
-
-/**
- * Light state flags.
- */
-/*@{*/
-#define LIGHT_SPOT 0x1
-#define LIGHT_LOCAL_VIEWER 0x2
-#define LIGHT_POSITIONAL 0x4
-#define LIGHT_NEED_VERTICES (LIGHT_POSITIONAL|LIGHT_LOCAL_VIEWER)
-/*@}*/
-
-
-/**
- * Lighting attribute group (GL_LIGHT_BIT).
- */
-struct gl_light_attrib
-{
- struct gl_light Light[MAX_LIGHTS]; /**< Array of light sources */
- struct gl_lightmodel Model; /**< Lighting model */
-
- /**
- * Must flush FLUSH_VERTICES before referencing:
- */
- /*@{*/
- struct gl_material Material; /**< Includes front & back values */
- /*@}*/
-
- GLboolean Enabled; /**< Lighting enabled flag */
- GLenum ShadeModel; /**< GL_FLAT or GL_SMOOTH */
- GLenum ProvokingVertex; /**< GL_EXT_provoking_vertex */
- GLenum ColorMaterialFace; /**< GL_FRONT, BACK or FRONT_AND_BACK */
- GLenum ColorMaterialMode; /**< GL_AMBIENT, GL_DIFFUSE, etc */
- GLbitfield ColorMaterialBitmask; /**< bitmask formed from Face and Mode */
- GLboolean ColorMaterialEnabled;
- GLenum ClampVertexColor;
- GLboolean _ClampVertexColor;
-
- struct gl_light EnabledList; /**< List sentinel */
-
- /**
- * Derived state for optimizations:
- */
- /*@{*/
- GLboolean _NeedEyeCoords;
- GLboolean _NeedVertices; /**< Use fast shader? */
- GLbitfield _Flags; /**< LIGHT_* flags, see above */
- GLfloat _BaseColor[2][3];
- /*@}*/
-};
-
-
-/**
- * Line attribute group (GL_LINE_BIT).
- */
-struct gl_line_attrib
-{
- GLboolean SmoothFlag; /**< GL_LINE_SMOOTH enabled? */
- GLboolean StippleFlag; /**< GL_LINE_STIPPLE enabled? */
- GLushort StipplePattern; /**< Stipple pattern */
- GLint StippleFactor; /**< Stipple repeat factor */
- GLfloat Width; /**< Line width */
-};
-
-
-/**
- * Display list attribute group (GL_LIST_BIT).
- */
-struct gl_list_attrib
-{
- GLuint ListBase;
-};
-
-
-/**
- * Multisample attribute group (GL_MULTISAMPLE_BIT).
- */
-struct gl_multisample_attrib
-{
- GLboolean Enabled;
- GLboolean _Enabled; /**< true if Enabled and multisample buffer */
- GLboolean SampleAlphaToCoverage;
- GLboolean SampleAlphaToOne;
- GLboolean SampleCoverage;
- GLfloat SampleCoverageValue;
- GLboolean SampleCoverageInvert;
-};
-
-
-/**
- * A pixelmap (see glPixelMap)
- */
-struct gl_pixelmap
-{
- GLint Size;
- GLfloat Map[MAX_PIXEL_MAP_TABLE];
- GLubyte Map8[MAX_PIXEL_MAP_TABLE]; /**< converted to 8-bit color */
-};
-
-
-/**
- * Collection of all pixelmaps
- */
-struct gl_pixelmaps
-{
- struct gl_pixelmap RtoR; /**< i.e. GL_PIXEL_MAP_R_TO_R */
- struct gl_pixelmap GtoG;
- struct gl_pixelmap BtoB;
- struct gl_pixelmap AtoA;
- struct gl_pixelmap ItoR;
- struct gl_pixelmap ItoG;
- struct gl_pixelmap ItoB;
- struct gl_pixelmap ItoA;
- struct gl_pixelmap ItoI;
- struct gl_pixelmap StoS;
-};
-
-
-/**
- * Pixel attribute group (GL_PIXEL_MODE_BIT).
- */
-struct gl_pixel_attrib
-{
- GLenum ReadBuffer; /**< source buffer for glRead/CopyPixels() */
-
- /*--- Begin Pixel Transfer State ---*/
- /* Fields are in the order in which they're applied... */
-
- /** Scale & Bias (index shift, offset) */
- /*@{*/
- GLfloat RedBias, RedScale;
- GLfloat GreenBias, GreenScale;
- GLfloat BlueBias, BlueScale;
- GLfloat AlphaBias, AlphaScale;
- GLfloat DepthBias, DepthScale;
- GLint IndexShift, IndexOffset;
- /*@}*/
-
- /* Pixel Maps */
- /* Note: actual pixel maps are not part of this attrib group */
- GLboolean MapColorFlag;
- GLboolean MapStencilFlag;
-
- /*--- End Pixel Transfer State ---*/
-
- /** glPixelZoom */
- GLfloat ZoomX, ZoomY;
-};
-
-
-/**
- * Point attribute group (GL_POINT_BIT).
- */
-struct gl_point_attrib
-{
- GLboolean SmoothFlag; /**< True if GL_POINT_SMOOTH is enabled */
- GLfloat Size; /**< User-specified point size */
- GLfloat Params[3]; /**< GL_EXT_point_parameters */
- GLfloat MinSize, MaxSize; /**< GL_EXT_point_parameters */
- GLfloat Threshold; /**< GL_EXT_point_parameters */
- GLboolean _Attenuated; /**< True if Params != [1, 0, 0] */
- GLboolean PointSprite; /**< GL_NV/ARB_point_sprite */
- GLboolean CoordReplace[MAX_TEXTURE_COORD_UNITS]; /**< GL_ARB_point_sprite*/
- GLenum SpriteRMode; /**< GL_NV_point_sprite (only!) */
- GLenum SpriteOrigin; /**< GL_ARB_point_sprite */
-};
-
-
-/**
- * Polygon attribute group (GL_POLYGON_BIT).
- */
-struct gl_polygon_attrib
-{
- GLenum FrontFace; /**< Either GL_CW or GL_CCW */
- GLenum FrontMode; /**< Either GL_POINT, GL_LINE or GL_FILL */
- GLenum BackMode; /**< Either GL_POINT, GL_LINE or GL_FILL */
- GLboolean _FrontBit; /**< 0=GL_CCW, 1=GL_CW */
- GLboolean CullFlag; /**< Culling on/off flag */
- GLboolean SmoothFlag; /**< True if GL_POLYGON_SMOOTH is enabled */
- GLboolean StippleFlag; /**< True if GL_POLYGON_STIPPLE is enabled */
- GLenum CullFaceMode; /**< Culling mode GL_FRONT or GL_BACK */
- GLfloat OffsetFactor; /**< Polygon offset factor, from user */
- GLfloat OffsetUnits; /**< Polygon offset units, from user */
- GLboolean OffsetPoint; /**< Offset in GL_POINT mode */
- GLboolean OffsetLine; /**< Offset in GL_LINE mode */
- GLboolean OffsetFill; /**< Offset in GL_FILL mode */
-};
-
-
-/**
- * Scissor attributes (GL_SCISSOR_BIT).
- */
-struct gl_scissor_attrib
-{
- GLboolean Enabled; /**< Scissor test enabled? */
- GLint X, Y; /**< Lower left corner of box */
- GLsizei Width, Height; /**< Size of box */
-};
-
-
-/**
- * Stencil attribute group (GL_STENCIL_BUFFER_BIT).
- *
- * Three sets of stencil data are tracked so that OpenGL 2.0,
- * GL_EXT_stencil_two_side, and GL_ATI_separate_stencil can all be supported
- * simultaneously. In each of the stencil state arrays, element 0 corresponds
- * to GL_FRONT. Element 1 corresponds to the OpenGL 2.0 /
- * GL_ATI_separate_stencil GL_BACK state. Element 2 corresponds to the
- * GL_EXT_stencil_two_side GL_BACK state.
- *
- * The derived value \c _BackFace is either 1 or 2 depending on whether or
- * not GL_STENCIL_TEST_TWO_SIDE_EXT is enabled.
- *
- * The derived value \c _TestTwoSide is set when the front-face and back-face
- * stencil state are different.
- */
-struct gl_stencil_attrib
-{
- GLboolean Enabled; /**< Enabled flag */
- GLboolean TestTwoSide; /**< GL_EXT_stencil_two_side */
- GLubyte ActiveFace; /**< GL_EXT_stencil_two_side (0 or 2) */
- GLboolean _Enabled; /**< Enabled and stencil buffer present */
- GLboolean _TestTwoSide;
- GLubyte _BackFace; /**< Current back stencil state (1 or 2) */
- GLenum Function[3]; /**< Stencil function */
- GLenum FailFunc[3]; /**< Fail function */
- GLenum ZPassFunc[3]; /**< Depth buffer pass function */
- GLenum ZFailFunc[3]; /**< Depth buffer fail function */
- GLint Ref[3]; /**< Reference value */
- GLuint ValueMask[3]; /**< Value mask */
- GLuint WriteMask[3]; /**< Write mask */
- GLuint Clear; /**< Clear value */
-};
-
-
-/**
- * An index for each type of texture object. These correspond to the GL
- * texture target enums, such as GL_TEXTURE_2D, GL_TEXTURE_CUBE_MAP, etc.
- * Note: the order is from highest priority to lowest priority.
- */
-typedef enum
-{
- TEXTURE_BUFFER_INDEX,
- TEXTURE_2D_ARRAY_INDEX,
- TEXTURE_1D_ARRAY_INDEX,
- TEXTURE_CUBE_INDEX,
- TEXTURE_3D_INDEX,
- TEXTURE_RECT_INDEX,
- TEXTURE_2D_INDEX,
- TEXTURE_1D_INDEX,
- NUM_TEXTURE_TARGETS
-} gl_texture_index;
-
-
-/**
- * Bit flags for each type of texture object
- * Used for Texture.Unit[]._ReallyEnabled flags.
- */
-/*@{*/
-#define TEXTURE_BUFFER_BIT (1 << TEXTURE_BUFFER_INDEX)
-#define TEXTURE_2D_ARRAY_BIT (1 << TEXTURE_2D_ARRAY_INDEX)
-#define TEXTURE_1D_ARRAY_BIT (1 << TEXTURE_1D_ARRAY_INDEX)
-#define TEXTURE_CUBE_BIT (1 << TEXTURE_CUBE_INDEX)
-#define TEXTURE_3D_BIT (1 << TEXTURE_3D_INDEX)
-#define TEXTURE_RECT_BIT (1 << TEXTURE_RECT_INDEX)
-#define TEXTURE_2D_BIT (1 << TEXTURE_2D_INDEX)
-#define TEXTURE_1D_BIT (1 << TEXTURE_1D_INDEX)
-/*@}*/
-
-
-/**
- * TexGenEnabled flags.
- */
-/*@{*/
-#define S_BIT 1
-#define T_BIT 2
-#define R_BIT 4
-#define Q_BIT 8
-#define STR_BITS (S_BIT | T_BIT | R_BIT)
-/*@}*/
-
-
-/**
- * Bit flag versions of the corresponding GL_ constants.
- */
-/*@{*/
-#define TEXGEN_SPHERE_MAP 0x1
-#define TEXGEN_OBJ_LINEAR 0x2
-#define TEXGEN_EYE_LINEAR 0x4
-#define TEXGEN_REFLECTION_MAP_NV 0x8
-#define TEXGEN_NORMAL_MAP_NV 0x10
-
-#define TEXGEN_NEED_NORMALS (TEXGEN_SPHERE_MAP | \
- TEXGEN_REFLECTION_MAP_NV | \
- TEXGEN_NORMAL_MAP_NV)
-#define TEXGEN_NEED_EYE_COORD (TEXGEN_SPHERE_MAP | \
- TEXGEN_REFLECTION_MAP_NV | \
- TEXGEN_NORMAL_MAP_NV | \
- TEXGEN_EYE_LINEAR)
-/*@}*/
-
-
-
-/** Tex-gen enabled for texture unit? */
-#define ENABLE_TEXGEN(unit) (1 << (unit))
-
-/** Non-identity texture matrix for texture unit? */
-#define ENABLE_TEXMAT(unit) (1 << (unit))
-
-
-/**
- * Texel fetch function prototype. We use texel fetch functions to
- * extract RGBA, color indexes and depth components out of 1D, 2D and 3D
- * texture images. These functions help to isolate us from the gritty
- * details of all the various texture image encodings.
- *
- * \param texImage texture image.
- * \param col texel column.
- * \param row texel row.
- * \param img texel image level/layer.
- * \param texelOut output texel (up to 4 GLchans)
- */
-typedef void (*FetchTexelFuncC)( const struct gl_texture_image *texImage,
- GLint col, GLint row, GLint img,
- GLchan *texelOut );
-
-/**
- * As above, but returns floats.
- * Used for depth component images and for upcoming signed/float
- * texture images.
- */
-typedef void (*FetchTexelFuncF)( const struct gl_texture_image *texImage,
- GLint col, GLint row, GLint img,
- GLfloat *texelOut );
-
-
-typedef void (*StoreTexelFunc)(struct gl_texture_image *texImage,
- GLint col, GLint row, GLint img,
- const void *texel);
-
-
-/**
- * Texture image state. Describes the dimensions of a texture image,
- * the texel format and pointers to Texel Fetch functions.
- */
-struct gl_texture_image
-{
- GLint InternalFormat; /**< Internal format as given by the user */
- GLenum _BaseFormat; /**< Either GL_RGB, GL_RGBA, GL_ALPHA,
- * GL_LUMINANCE, GL_LUMINANCE_ALPHA,
- * GL_INTENSITY, GL_COLOR_INDEX,
- * GL_DEPTH_COMPONENT or GL_DEPTH_STENCIL_EXT
- * only. Used for choosing TexEnv arithmetic.
- */
- gl_format TexFormat; /**< The actual texture memory format */
-
- GLuint Border; /**< 0 or 1 */
- GLuint Width; /**< = 2^WidthLog2 + 2*Border */
- GLuint Height; /**< = 2^HeightLog2 + 2*Border */
- GLuint Depth; /**< = 2^DepthLog2 + 2*Border */
- GLuint Width2; /**< = Width - 2*Border */
- GLuint Height2; /**< = Height - 2*Border */
- GLuint Depth2; /**< = Depth - 2*Border */
- GLuint WidthLog2; /**< = log2(Width2) */
- GLuint HeightLog2; /**< = log2(Height2) */
- GLuint DepthLog2; /**< = log2(Depth2) */
- GLuint MaxLog2; /**< = MAX(WidthLog2, HeightLog2) */
- GLfloat WidthScale; /**< used for mipmap LOD computation */
- GLfloat HeightScale; /**< used for mipmap LOD computation */
- GLfloat DepthScale; /**< used for mipmap LOD computation */
- GLboolean IsClientData; /**< Data owned by client? */
- GLboolean _IsPowerOfTwo; /**< Are all dimensions powers of two? */
-
- struct gl_texture_object *TexObject; /**< Pointer back to parent object */
-
- FetchTexelFuncC FetchTexelc; /**< GLchan texel fetch function pointer */
- FetchTexelFuncF FetchTexelf; /**< Float texel fetch function pointer */
-
- GLuint RowStride; /**< Padded width in units of texels */
- GLuint *ImageOffsets; /**< if 3D texture: array [Depth] of offsets to
- each 2D slice in 'Data', in texels */
- GLvoid *Data; /**< Image data, accessed via FetchTexel() */
-
- /**
- * \name For device driver:
- */
- /*@{*/
- void *DriverData; /**< Arbitrary device driver data */
- /*@}*/
-};
-
-
-/**
- * Indexes for cube map faces.
- */
-typedef enum
-{
- FACE_POS_X = 0,
- FACE_NEG_X = 1,
- FACE_POS_Y = 2,
- FACE_NEG_Y = 3,
- FACE_POS_Z = 4,
- FACE_NEG_Z = 5,
- MAX_FACES = 6
-} gl_face_index;
-
-
-/**
- * Sampler object state. These objects are new with GL_ARB_sampler_objects
- * and OpenGL 3.3. Legacy texture objects also contain a sampler object.
- */
-struct gl_sampler_object
-{
- GLuint Name;
- GLint RefCount;
-
- GLenum WrapS; /**< S-axis texture image wrap mode */
- GLenum WrapT; /**< T-axis texture image wrap mode */
- GLenum WrapR; /**< R-axis texture image wrap mode */
- GLenum MinFilter; /**< minification filter */
- GLenum MagFilter; /**< magnification filter */
- union {
- GLfloat f[4];
- GLuint ui[4];
- GLint i[4];
- } BorderColor; /**< Interpreted according to texture format */
- GLfloat MinLod; /**< min lambda, OpenGL 1.2 */
- GLfloat MaxLod; /**< max lambda, OpenGL 1.2 */
- GLfloat LodBias; /**< OpenGL 1.4 */
- GLfloat MaxAnisotropy; /**< GL_EXT_texture_filter_anisotropic */
- GLenum CompareMode; /**< GL_ARB_shadow */
- GLenum CompareFunc; /**< GL_ARB_shadow */
- GLfloat CompareFailValue; /**< GL_ARB_shadow_ambient */
- GLenum sRGBDecode; /**< GL_DECODE_EXT or GL_SKIP_DECODE_EXT */
- GLboolean CubeMapSeamless; /**< GL_AMD_seamless_cubemap_per_texture */
-
- /* deprecated sampler state */
- GLenum DepthMode; /**< GL_ARB_depth_texture */
-
- /** Is the texture object complete with respect to this sampler? */
- GLboolean _CompleteTexture;
-};
-
-
-/**
- * Texture object state. Contains the array of mipmap images, border color,
- * wrap modes, filter modes, shadow/texcompare state, and the per-texture
- * color palette.
- */
-struct gl_texture_object
-{
- _glthread_Mutex Mutex; /**< for thread safety */
- GLint RefCount; /**< reference count */
- GLuint Name; /**< the user-visible texture object ID */
- GLenum Target; /**< GL_TEXTURE_1D, GL_TEXTURE_2D, etc. */
-
- struct gl_sampler_object Sampler;
-
- GLfloat Priority; /**< in [0,1] */
- GLint BaseLevel; /**< min mipmap level, OpenGL 1.2 */
- GLint MaxLevel; /**< max mipmap level, OpenGL 1.2 */
- GLint _MaxLevel; /**< actual max mipmap level (q in the spec) */
- GLfloat _MaxLambda; /**< = _MaxLevel - BaseLevel (q - b in spec) */
- GLint CropRect[4]; /**< GL_OES_draw_texture */
- GLenum Swizzle[4]; /**< GL_EXT_texture_swizzle */
- GLuint _Swizzle; /**< same as Swizzle, but SWIZZLE_* format */
- GLboolean GenerateMipmap; /**< GL_SGIS_generate_mipmap */
- GLboolean _Complete; /**< Is texture object complete? */
- GLboolean _RenderToTexture; /**< Any rendering to this texture? */
- GLboolean Purgeable; /**< Is the buffer purgeable under memory pressure? */
-
- /** Actual texture images, indexed by [cube face] and [mipmap level] */
- struct gl_texture_image *Image[MAX_FACES][MAX_TEXTURE_LEVELS];
-
- /** GL_ARB_texture_buffer_object */
- struct gl_buffer_object *BufferObject;
- GLenum BufferObjectFormat;
-
- /** GL_EXT_paletted_texture */
- struct gl_color_table Palette;
-
- /**
- * \name For device driver.
- * Note: instead of attaching driver data to this pointer, it's preferable
- * to instead use this struct as a base class for your own texture object
- * class. Driver->NewTextureObject() can be used to implement the
- * allocation.
- */
- void *DriverData; /**< Arbitrary device driver data */
-};
-
-
-/** Up to four combiner sources are possible with GL_NV_texture_env_combine4 */
-#define MAX_COMBINER_TERMS 4
-
-
-/**
- * Texture combine environment state.
- */
-struct gl_tex_env_combine_state
-{
- GLenum ModeRGB; /**< GL_REPLACE, GL_DECAL, GL_ADD, etc. */
- GLenum ModeA; /**< GL_REPLACE, GL_DECAL, GL_ADD, etc. */
- /** Source terms: GL_PRIMARY_COLOR, GL_TEXTURE, etc */
- GLenum SourceRGB[MAX_COMBINER_TERMS];
- GLenum SourceA[MAX_COMBINER_TERMS];
- /** Source operands: GL_SRC_COLOR, GL_ONE_MINUS_SRC_COLOR, etc */
- GLenum OperandRGB[MAX_COMBINER_TERMS];
- GLenum OperandA[MAX_COMBINER_TERMS];
- GLuint ScaleShiftRGB; /**< 0, 1 or 2 */
- GLuint ScaleShiftA; /**< 0, 1 or 2 */
- GLuint _NumArgsRGB; /**< Number of inputs used for the RGB combiner */
- GLuint _NumArgsA; /**< Number of inputs used for the A combiner */
-};
-
-
-/**
- * Texture coord generation state.
- */
-struct gl_texgen
-{
- GLenum Mode; /**< GL_EYE_LINEAR, GL_SPHERE_MAP, etc */
- GLbitfield _ModeBit; /**< TEXGEN_x bit corresponding to Mode */
- GLfloat ObjectPlane[4];
- GLfloat EyePlane[4];
-};
-
-
-/**
- * Texture unit state. Contains enable flags, texture environment/function/
- * combiners, texgen state, pointers to current texture objects and
- * post-filter color tables.
- */
-struct gl_texture_unit
-{
- GLbitfield Enabled; /**< bitmask of TEXTURE_*_BIT flags */
- GLbitfield _ReallyEnabled; /**< 0 or exactly one of TEXTURE_*_BIT flags */
-
- GLenum EnvMode; /**< GL_MODULATE, GL_DECAL, GL_BLEND, etc. */
- GLclampf EnvColor[4];
- GLfloat EnvColorUnclamped[4];
-
- struct gl_texgen GenS;
- struct gl_texgen GenT;
- struct gl_texgen GenR;
- struct gl_texgen GenQ;
- GLbitfield TexGenEnabled; /**< Bitwise-OR of [STRQ]_BIT values */
- GLbitfield _GenFlags; /**< Bitwise-OR of Gen[STRQ]._ModeBit */
-
- GLfloat LodBias; /**< for biasing mipmap levels */
- GLenum BumpTarget;
- GLfloat RotMatrix[4]; /* 2x2 matrix */
-
- /** Current sampler object (GL_ARB_sampler_objects) */
- struct gl_sampler_object *Sampler;
-
- /**
- * \name GL_EXT_texture_env_combine
- */
- struct gl_tex_env_combine_state Combine;
-
- /**
- * Derived state based on \c EnvMode and the \c BaseFormat of the
- * currently enabled texture.
- */
- struct gl_tex_env_combine_state _EnvMode;
-
- /**
- * Currently enabled combiner state. This will point to either
- * \c Combine or \c _EnvMode.
- */
- struct gl_tex_env_combine_state *_CurrentCombine;
-
- /** Current texture object pointers */
- struct gl_texture_object *CurrentTex[NUM_TEXTURE_TARGETS];
-
- /** Points to highest priority, complete and enabled texture object */
- struct gl_texture_object *_Current;
-};
-
-
-/**
- * Texture attribute group (GL_TEXTURE_BIT).
- */
-struct gl_texture_attrib
-{
- GLuint CurrentUnit; /**< GL_ACTIVE_TEXTURE */
- struct gl_texture_unit Unit[MAX_COMBINED_TEXTURE_IMAGE_UNITS];
-
- struct gl_texture_object *ProxyTex[NUM_TEXTURE_TARGETS];
-
- /** GL_ARB_texture_buffer_object */
- struct gl_buffer_object *BufferObject;
-
- /** GL_ARB_seamless_cubemap */
- GLboolean CubeMapSeamless;
-
- /** GL_EXT_shared_texture_palette */
- GLboolean SharedPalette;
- struct gl_color_table Palette;
-
- /** Texture units/samplers used by vertex or fragment texturing */
- GLbitfield _EnabledUnits;
-
- /** Texture coord units/sets used for fragment texturing */
- GLbitfield _EnabledCoordUnits;
-
- /** Texture coord units that have texgen enabled */
- GLbitfield _TexGenEnabled;
-
- /** Texture coord units that have non-identity matrices */
- GLbitfield _TexMatEnabled;
-
- /** Bitwise-OR of all Texture.Unit[i]._GenFlags */
- GLbitfield _GenFlags;
-};
-
-
-/**
- * Transformation attribute group (GL_TRANSFORM_BIT).
- */
-struct gl_transform_attrib
-{
- GLenum MatrixMode; /**< Matrix mode */
- GLfloat EyeUserPlane[MAX_CLIP_PLANES][4]; /**< User clip planes */
- GLfloat _ClipUserPlane[MAX_CLIP_PLANES][4]; /**< derived */
- GLbitfield ClipPlanesEnabled; /**< on/off bitmask */
- GLboolean Normalize; /**< Normalize all normals? */
- GLboolean RescaleNormals; /**< GL_EXT_rescale_normal */
- GLboolean RasterPositionUnclipped; /**< GL_IBM_rasterpos_clip */
- GLboolean DepthClamp; /**< GL_ARB_depth_clamp */
-
- GLfloat CullEyePos[4];
- GLfloat CullObjPos[4];
-};
-
-
-/**
- * Viewport attribute group (GL_VIEWPORT_BIT).
- */
-struct gl_viewport_attrib
-{
- GLint X, Y; /**< position */
- GLsizei Width, Height; /**< size */
- GLfloat Near, Far; /**< Depth buffer range */
- GLmatrix _WindowMap; /**< Mapping transformation as a matrix. */
-};
-
-
-/**
- * GL_ARB_vertex/pixel_buffer_object buffer object
- */
-struct gl_buffer_object
-{
- _glthread_Mutex Mutex;
- GLint RefCount;
- GLuint Name;
- GLenum Usage; /**< GL_STREAM_DRAW_ARB, GL_STREAM_READ_ARB, etc. */
- GLsizeiptrARB Size; /**< Size of buffer storage in bytes */
- GLubyte *Data; /**< Location of storage either in RAM or VRAM. */
- /** Fields describing a mapped buffer */
- /*@{*/
- GLbitfield AccessFlags; /**< Mask of GL_MAP_x_BIT flags */
- GLvoid *Pointer; /**< User-space address of mapping */
- GLintptr Offset; /**< Mapped offset */
- GLsizeiptr Length; /**< Mapped length */
- /*@}*/
- GLboolean Written; /**< Ever written to? (for debugging) */
- GLboolean Purgeable; /**< Is the buffer purgeable under memory pressure? */
-};
-
-
-/**
- * Client pixel packing/unpacking attributes
- */
-struct gl_pixelstore_attrib
-{
- GLint Alignment;
- GLint RowLength;
- GLint SkipPixels;
- GLint SkipRows;
- GLint ImageHeight;
- GLint SkipImages;
- GLboolean SwapBytes;
- GLboolean LsbFirst;
- GLboolean ClientStorage; /**< GL_APPLE_client_storage */
- GLboolean Invert; /**< GL_MESA_pack_invert */
- struct gl_buffer_object *BufferObj; /**< GL_ARB_pixel_buffer_object */
-};
-
-
-/**
- * Client vertex array attributes
- */
-struct gl_client_array
-{
- GLint Size; /**< components per element (1,2,3,4) */
- GLenum Type; /**< datatype: GL_FLOAT, GL_INT, etc */
- GLenum Format; /**< default: GL_RGBA, but may be GL_BGRA */
- GLsizei Stride; /**< user-specified stride */
- GLsizei StrideB; /**< actual stride in bytes */
- const GLubyte *Ptr; /**< Points to array data */
- GLboolean Enabled; /**< Enabled flag is a boolean */
- GLboolean Normalized; /**< GL_ARB_vertex_program */
- GLboolean Integer; /**< Integer-valued? */
- GLuint InstanceDivisor; /**< GL_ARB_instanced_arrays */
- GLuint _ElementSize; /**< size of each element in bytes */
-
- struct gl_buffer_object *BufferObj;/**< GL_ARB_vertex_buffer_object */
- GLuint _MaxElement; /**< max element index into array buffer + 1 */
-};
-
-
-/**
- * Collection of vertex arrays. Defined by the GL_APPLE_vertex_array_object
- * extension, but a nice encapsulation in any case.
- */
-struct gl_array_object
-{
- /** Name of the array object as received from glGenVertexArrayAPPLE. */
- GLuint Name;
-
- GLint RefCount;
- _glthread_Mutex Mutex;
- GLboolean VBOonly; /**< require all arrays to live in VBOs? */
-
- /** Conventional vertex arrays */
- /*@{*/
- struct gl_client_array Vertex;
- struct gl_client_array Weight;
- struct gl_client_array Normal;
- struct gl_client_array Color;
- struct gl_client_array SecondaryColor;
- struct gl_client_array FogCoord;
- struct gl_client_array Index;
- struct gl_client_array EdgeFlag;
- struct gl_client_array TexCoord[MAX_TEXTURE_COORD_UNITS];
- struct gl_client_array PointSize;
- /*@}*/
-
- /**
- * Generic arrays for vertex programs/shaders.
- * For NV vertex programs, these attributes alias and take priority
- * over the conventional attribs above. For ARB vertex programs and
- * GLSL vertex shaders, these attributes are separate.
- */
- struct gl_client_array VertexAttrib[MAX_VERTEX_GENERIC_ATTRIBS];
-
- /** Mask of _NEW_ARRAY_* values indicating which arrays are enabled */
- GLbitfield _Enabled;
-
- /**
- * Min of all enabled arrays' _MaxElement. When arrays reside inside VBOs
- * we can determine the max legal (in bounds) glDrawElements array index.
- */
- GLuint _MaxElement;
-};
-
-
-/**
- * Vertex array state
- */
-struct gl_array_attrib
-{
- /** Currently bound array object. See _mesa_BindVertexArrayAPPLE() */
- struct gl_array_object *ArrayObj;
-
- /** The default vertex array object */
- struct gl_array_object *DefaultArrayObj;
-
- /** Array objects (GL_ARB/APPLE_vertex_array_object) */
- struct _mesa_HashTable *Objects;
-
- GLint ActiveTexture; /**< Client Active Texture */
- GLuint LockFirst; /**< GL_EXT_compiled_vertex_array */
- GLuint LockCount; /**< GL_EXT_compiled_vertex_array */
-
- /** GL 3.1 (slightly different from GL_NV_primitive_restart) */
- GLboolean PrimitiveRestart;
- GLuint RestartIndex;
-
- GLbitfield NewState; /**< mask of _NEW_ARRAY_* values */
- GLboolean RebindArrays; /**< whether the VBO module should rebind arrays */
-
- /* GL_ARB_vertex_buffer_object */
- struct gl_buffer_object *ArrayBufferObj;
- struct gl_buffer_object *ElementArrayBufferObj;
-};
-
-
-/**
- * Feedback buffer state
- */
-struct gl_feedback
-{
- GLenum Type;
- GLbitfield _Mask; /**< FB_* bits */
- GLfloat *Buffer;
- GLuint BufferSize;
- GLuint Count;
-};
-
-
-/**
- * Selection buffer state
- */
-struct gl_selection
-{
- GLuint *Buffer; /**< selection buffer */
- GLuint BufferSize; /**< size of the selection buffer */
- GLuint BufferCount; /**< number of values in the selection buffer */
- GLuint Hits; /**< number of records in the selection buffer */
- GLuint NameStackDepth; /**< name stack depth */
- GLuint NameStack[MAX_NAME_STACK_DEPTH]; /**< name stack */
- GLboolean HitFlag; /**< hit flag */
- GLfloat HitMinZ; /**< minimum hit depth */
- GLfloat HitMaxZ; /**< maximum hit depth */
-};
-
-
-/**
- * 1-D Evaluator control points
- */
-struct gl_1d_map
-{
- GLuint Order; /**< Number of control points */
- GLfloat u1, u2, du; /**< u1, u2, 1.0/(u2-u1) */
- GLfloat *Points; /**< Points to contiguous control points */
-};
-
-
-/**
- * 2-D Evaluator control points
- */
-struct gl_2d_map
-{
- GLuint Uorder; /**< Number of control points in U dimension */
- GLuint Vorder; /**< Number of control points in V dimension */
- GLfloat u1, u2, du;
- GLfloat v1, v2, dv;
- GLfloat *Points; /**< Points to contiguous control points */
-};
-
-
-/**
- * All evaluator control point state
- */
-struct gl_evaluators
-{
- /**
- * \name 1-D maps
- */
- /*@{*/
- struct gl_1d_map Map1Vertex3;
- struct gl_1d_map Map1Vertex4;
- struct gl_1d_map Map1Index;
- struct gl_1d_map Map1Color4;
- struct gl_1d_map Map1Normal;
- struct gl_1d_map Map1Texture1;
- struct gl_1d_map Map1Texture2;
- struct gl_1d_map Map1Texture3;
- struct gl_1d_map Map1Texture4;
- struct gl_1d_map Map1Attrib[16]; /**< GL_NV_vertex_program */
- /*@}*/
-
- /**
- * \name 2-D maps
- */
- /*@{*/
- struct gl_2d_map Map2Vertex3;
- struct gl_2d_map Map2Vertex4;
- struct gl_2d_map Map2Index;
- struct gl_2d_map Map2Color4;
- struct gl_2d_map Map2Normal;
- struct gl_2d_map Map2Texture1;
- struct gl_2d_map Map2Texture2;
- struct gl_2d_map Map2Texture3;
- struct gl_2d_map Map2Texture4;
- struct gl_2d_map Map2Attrib[16]; /**< GL_NV_vertex_program */
- /*@}*/
-};
-
-
-/**
- * Names of the various vertex/fragment program register files, etc.
- *
- * NOTE: first four tokens must fit into 2 bits (see t_vb_arbprogram.c)
- * All values should fit in a 4-bit field.
- *
- * NOTE: PROGRAM_ENV_PARAM, PROGRAM_STATE_VAR, PROGRAM_NAMED_PARAM,
- * PROGRAM_CONSTANT, and PROGRAM_UNIFORM can all be considered to
- * be "uniform" variables since they can only be set outside glBegin/End.
- * They're also all stored in the same Parameters array.
- */
-typedef enum
-{
- PROGRAM_TEMPORARY, /**< machine->Temporary[] */
- PROGRAM_INPUT, /**< machine->Inputs[] */
- PROGRAM_OUTPUT, /**< machine->Outputs[] */
- PROGRAM_VARYING, /**< machine->Inputs[]/Outputs[] */
- PROGRAM_LOCAL_PARAM, /**< gl_program->LocalParams[] */
- PROGRAM_ENV_PARAM, /**< gl_program->Parameters[] */
- PROGRAM_STATE_VAR, /**< gl_program->Parameters[] */
- PROGRAM_NAMED_PARAM, /**< gl_program->Parameters[] */
- PROGRAM_CONSTANT, /**< gl_program->Parameters[] */
- PROGRAM_UNIFORM, /**< gl_program->Parameters[] */
- PROGRAM_WRITE_ONLY, /**< A dummy, write-only register */
- PROGRAM_ADDRESS, /**< machine->AddressReg */
- PROGRAM_SAMPLER, /**< for shader samplers, compile-time only */
- PROGRAM_SYSTEM_VALUE,/**< InstanceId, PrimitiveID, etc. */
- PROGRAM_UNDEFINED, /**< Invalid/TBD value */
- PROGRAM_FILE_MAX
-} gl_register_file;
-
-
-/**
- * If the register file is PROGRAM_SYSTEM_VALUE, the register index will be
- * one of these values.
- */
-typedef enum
-{
- SYSTEM_VALUE_FRONT_FACE, /**< Fragment shader only (not done yet) */
- SYSTEM_VALUE_INSTANCE_ID, /**< Vertex shader only */
- SYSTEM_VALUE_MAX /**< Number of values */
-} gl_system_value;
-
-
-/** Vertex and fragment instructions */
-struct prog_instruction;
-struct gl_program_parameter_list;
-struct gl_uniform_list;
-
-
-/**
- * Base class for any kind of program object
- */
-struct gl_program
-{
- GLuint Id;
- GLubyte *String; /**< Null-terminated program text */
- GLint RefCount;
- GLenum Target; /**< GL_VERTEX/FRAGMENT_PROGRAM_ARB, GL_FRAGMENT_PROGRAM_NV */
- GLenum Format; /**< String encoding format */
- GLboolean Resident;
-
- struct prog_instruction *Instructions;
-
- GLbitfield InputsRead; /**< Bitmask of which input regs are read */
- GLbitfield64 OutputsWritten; /**< Bitmask of which output regs are written */
- GLbitfield SystemValuesRead; /**< Bitmask of SYSTEM_VALUE_x inputs used */
- GLbitfield InputFlags[MAX_PROGRAM_INPUTS]; /**< PROG_PARAM_BIT_x flags */
- GLbitfield OutputFlags[MAX_PROGRAM_OUTPUTS]; /**< PROG_PARAM_BIT_x flags */
- GLbitfield TexturesUsed[MAX_TEXTURE_UNITS]; /**< TEXTURE_x_BIT bitmask */
- GLbitfield SamplersUsed; /**< Bitfield of which samplers are used */
- GLbitfield ShadowSamplers; /**< Texture units used for shadow sampling. */
-
-
- /** Named parameters, constants, etc. from program text */
- struct gl_program_parameter_list *Parameters;
- /** Numbered local parameters */
- GLfloat LocalParams[MAX_PROGRAM_LOCAL_PARAMS][4];
-
- /** Vertex/fragment shader varying vars */
- struct gl_program_parameter_list *Varying;
- /** Vertex program user-defined attributes */
- struct gl_program_parameter_list *Attributes;
-
- /** Map from sampler unit to texture unit (set by glUniform1i()) */
- GLubyte SamplerUnits[MAX_SAMPLERS];
- /** Which texture target is being sampled (TEXTURE_1D/2D/3D/etc_INDEX) */
- gl_texture_index SamplerTargets[MAX_SAMPLERS];
-
- /** Bitmask of which register files are read/written with indirect
- * addressing. Mask of (1 << PROGRAM_x) bits.
- */
- GLbitfield IndirectRegisterFiles;
-
- /** Logical counts */
- /*@{*/
- GLuint NumInstructions;
- GLuint NumTemporaries;
- GLuint NumParameters;
- GLuint NumAttributes;
- GLuint NumAddressRegs;
- GLuint NumAluInstructions;
- GLuint NumTexInstructions;
- GLuint NumTexIndirections;
- /*@}*/
- /** Native, actual h/w counts */
- /*@{*/
- GLuint NumNativeInstructions;
- GLuint NumNativeTemporaries;
- GLuint NumNativeParameters;
- GLuint NumNativeAttributes;
- GLuint NumNativeAddressRegs;
- GLuint NumNativeAluInstructions;
- GLuint NumNativeTexInstructions;
- GLuint NumNativeTexIndirections;
- /*@}*/
-};
-
-
-/** Vertex program object */
-struct gl_vertex_program
-{
- struct gl_program Base; /**< base class */
- GLboolean IsNVProgram; /**< is this a GL_NV_vertex_program program? */
- GLboolean IsPositionInvariant;
-};
-
-
-/** Geometry program object */
-struct gl_geometry_program
-{
- struct gl_program Base; /**< base class */
-
- GLint VerticesOut;
- GLenum InputType; /**< GL_POINTS, GL_LINES, GL_LINES_ADJACENCY_ARB,
- GL_TRIANGLES, or GL_TRIANGLES_ADJACENCY_ARB */
- GLenum OutputType; /**< GL_POINTS, GL_LINE_STRIP or GL_TRIANGLE_STRIP */
-};
-
-
-/** Fragment program object */
-struct gl_fragment_program
-{
- struct gl_program Base; /**< base class */
- GLboolean UsesKill; /**< shader uses KIL instruction */
- GLboolean OriginUpperLeft;
- GLboolean PixelCenterInteger;
- enum gl_frag_depth_layout FragDepthLayout;
-};
-
-
-/**
- * State common to vertex and fragment programs.
- */
-struct gl_program_state
-{
- GLint ErrorPos; /* GL_PROGRAM_ERROR_POSITION_ARB/NV */
- const char *ErrorString; /* GL_PROGRAM_ERROR_STRING_ARB/NV */
-};
-
-
-/**
- * Context state for vertex programs.
- */
-struct gl_vertex_program_state
-{
- GLboolean Enabled; /**< User-set GL_VERTEX_PROGRAM_ARB/NV flag */
- GLboolean _Enabled; /**< Enabled and _valid_ user program? */
- GLboolean PointSizeEnabled; /**< GL_VERTEX_PROGRAM_POINT_SIZE_ARB/NV */
- GLboolean TwoSideEnabled; /**< GL_VERTEX_PROGRAM_TWO_SIDE_ARB/NV */
- struct gl_vertex_program *Current; /**< User-bound vertex program */
-
- /** Currently enabled and valid vertex program (including internal
- * programs, user-defined vertex programs and GLSL vertex shaders).
- * This is the program we must use when rendering.
- */
- struct gl_vertex_program *_Current;
-
- GLfloat Parameters[MAX_PROGRAM_ENV_PARAMS][4]; /**< Env params */
-
- /* For GL_NV_vertex_program only: */
- GLenum TrackMatrix[MAX_PROGRAM_ENV_PARAMS / 4];
- GLenum TrackMatrixTransform[MAX_PROGRAM_ENV_PARAMS / 4];
-
- /** Should fixed-function T&L be implemented with a vertex prog? */
- GLboolean _MaintainTnlProgram;
-
- /** Program to emulate fixed-function T&L (see above) */
- struct gl_vertex_program *_TnlProgram;
-
- /** Cache of fixed-function programs */
- struct gl_program_cache *Cache;
-
- GLboolean _Overriden;
-};
-
-
-/**
- * Context state for geometry programs.
- */
-struct gl_geometry_program_state
-{
- GLboolean Enabled; /**< GL_ARB_GEOMETRY_SHADER4 */
- GLboolean _Enabled; /**< Enabled and valid program? */
- struct gl_geometry_program *Current; /**< user-bound geometry program */
-
- /** Currently enabled and valid program (including internal programs
- * and compiled shader programs).
- */
- struct gl_geometry_program *_Current;
-
- GLfloat Parameters[MAX_PROGRAM_ENV_PARAMS][4]; /**< Env params */
-
- /** Cache of fixed-function programs */
- struct gl_program_cache *Cache;
-};
-
-/**
- * Context state for fragment programs.
- */
-struct gl_fragment_program_state
-{
- GLboolean Enabled; /**< User-set fragment program enable flag */
- GLboolean _Enabled; /**< Enabled and _valid_ user program? */
- struct gl_fragment_program *Current; /**< User-bound fragment program */
-
- /** Currently enabled and valid fragment program (including internal
- * programs, user-defined fragment programs and GLSL fragment shaders).
- * This is the program we must use when rendering.
- */
- struct gl_fragment_program *_Current;
-
- GLfloat Parameters[MAX_PROGRAM_ENV_PARAMS][4]; /**< Env params */
-
- /** Should fixed-function texturing be implemented with a fragment prog? */
- GLboolean _MaintainTexEnvProgram;
-
- /** Program to emulate fixed-function texture env/combine (see above) */
- struct gl_fragment_program *_TexEnvProgram;
-
- /** Cache of fixed-function programs */
- struct gl_program_cache *Cache;
-};
-
-
-/**
- * ATI_fragment_shader runtime state
- */
-#define ATI_FS_INPUT_PRIMARY 0
-#define ATI_FS_INPUT_SECONDARY 1
-
-struct atifs_instruction;
-struct atifs_setupinst;
-
-/**
- * ATI fragment shader
- */
-struct ati_fragment_shader
-{
- GLuint Id;
- GLint RefCount;
- struct atifs_instruction *Instructions[2];
- struct atifs_setupinst *SetupInst[2];
- GLfloat Constants[8][4];
- GLbitfield LocalConstDef; /**< Indicates which constants have been set */
- GLubyte numArithInstr[2];
- GLubyte regsAssigned[2];
- GLubyte NumPasses; /**< 1 or 2 */
- GLubyte cur_pass;
- GLubyte last_optype;
- GLboolean interpinp1;
- GLboolean isValid;
- GLuint swizzlerq;
-};
-
-/**
- * Context state for GL_ATI_fragment_shader
- */
-struct gl_ati_fragment_shader_state
-{
- GLboolean Enabled;
- GLboolean _Enabled; /**< enabled and valid shader? */
- GLboolean Compiling;
- GLfloat GlobalConstants[8][4];
- struct ati_fragment_shader *Current;
-};
-
-
-/**
- * Occlusion/timer query object.
- */
-struct gl_query_object
-{
- GLenum Target; /**< The query target, when active */
- GLuint Id; /**< hash table ID/name */
- GLuint64EXT Result; /**< the counter */
- GLboolean Active; /**< inside Begin/EndQuery */
- GLboolean Ready; /**< result is ready? */
-};
-
-
-/**
- * Context state for query objects.
- */
-struct gl_query_state
-{
- struct _mesa_HashTable *QueryObjects;
- struct gl_query_object *CurrentOcclusionObject; /* GL_ARB_occlusion_query */
- struct gl_query_object *CurrentTimerObject; /* GL_EXT_timer_query */
-
- /** GL_NV_conditional_render */
- struct gl_query_object *CondRenderQuery;
-
- /** GL_EXT_transform_feedback */
- struct gl_query_object *PrimitivesGenerated;
- struct gl_query_object *PrimitivesWritten;
-
- /** GL_ARB_timer_query */
- struct gl_query_object *TimeElapsed;
-
- GLenum CondRenderMode;
-};
-
-
-/** Sync object state */
-struct gl_sync_object {
- struct simple_node link;
- GLenum Type; /**< GL_SYNC_FENCE */
- GLuint Name; /**< Fence name */
- GLint RefCount; /**< Reference count */
- GLboolean DeletePending; /**< Object was deleted while there were still
- * live references (e.g., sync not yet finished)
- */
- GLenum SyncCondition;
- GLbitfield Flags; /**< Flags passed to glFenceSync */
- GLuint StatusFlag:1; /**< Has the sync object been signaled? */
-};
-
-
-/** Set by #pragma directives */
-struct gl_sl_pragmas
-{
- GLboolean IgnoreOptimize; /**< ignore #pragma optimize(on/off) ? */
- GLboolean IgnoreDebug; /**< ignore #pragma debug(on/off) ? */
- GLboolean Optimize; /**< defaults on */
- GLboolean Debug; /**< defaults off */
-};
-
-
-/**
- * A GLSL vertex or fragment shader object.
- */
-struct gl_shader
-{
- GLenum Type; /**< GL_FRAGMENT_SHADER || GL_VERTEX_SHADER || GL_GEOMETRY_SHADER_ARB (first field!) */
- GLuint Name; /**< AKA the handle */
- GLint RefCount; /**< Reference count */
- GLboolean DeletePending;
- GLboolean CompileStatus;
- const GLchar *Source; /**< Source code string */
- GLuint SourceChecksum; /**< for debug/logging purposes */
- struct gl_program *Program; /**< Post-compile assembly code */
- GLchar *InfoLog;
- struct gl_sl_pragmas Pragmas;
-
- unsigned Version; /**< GLSL version used for linking */
-
- struct exec_list *ir;
- struct glsl_symbol_table *symbols;
-
- /** Shaders containing built-in functions that are used for linking. */
- struct gl_shader *builtins_to_link[16];
- unsigned num_builtins_to_link;
-};
-
-
-/**
- * A GLSL program object.
- * Basically a linked collection of vertex and fragment shaders.
- */
-struct gl_shader_program
-{
- GLenum Type; /**< Always GL_SHADER_PROGRAM (internal token) */
- GLuint Name; /**< aka handle or ID */
- GLint RefCount; /**< Reference count */
- GLboolean DeletePending;
-
- GLuint NumShaders; /**< number of attached shaders */
- struct gl_shader **Shaders; /**< List of attached the shaders */
-
- /** User-defined attribute bindings (glBindAttribLocation) */
- struct gl_program_parameter_list *Attributes;
-
- /** Transform feedback varyings */
- struct {
- GLenum BufferMode;
- GLuint NumVarying;
- GLchar **VaryingNames; /**< Array [NumVarying] of char * */
- } TransformFeedback;
-
- /** Geometry shader state - copied into gl_geometry_program at link time */
- struct {
- GLint VerticesOut;
- GLenum InputType; /**< GL_POINTS, GL_LINES, GL_LINES_ADJACENCY_ARB,
- GL_TRIANGLES, or GL_TRIANGLES_ADJACENCY_ARB */
- GLenum OutputType; /**< GL_POINTS, GL_LINE_STRIP or GL_TRIANGLE_STRIP */
- } Geom;
-
- /* post-link info: */
- struct gl_vertex_program *VertexProgram; /**< Linked vertex program */
- struct gl_fragment_program *FragmentProgram; /**< Linked fragment prog */
- struct gl_geometry_program *GeometryProgram; /**< Linked geometry prog */
- struct gl_uniform_list *Uniforms;
- struct gl_program_parameter_list *Varying;
- GLboolean LinkStatus; /**< GL_LINK_STATUS */
- GLboolean Validated;
- GLboolean _Used; /**< Ever used for drawing? */
- GLchar *InfoLog;
-
- unsigned Version; /**< GLSL version used for linking */
-
- /**
- * Per-stage shaders resulting from the first stage of linking.
- *
- * Set of linked shaders for this program. The array is accessed using the
- * \c MESA_SHADER_* defines. Entries for non-existent stages will be
- * \c NULL.
- */
- struct gl_shader *_LinkedShaders[MESA_SHADER_TYPES];
-};
-
-
-#define GLSL_DUMP 0x1 /**< Dump shaders to stdout */
-#define GLSL_LOG 0x2 /**< Write shaders to files */
-#define GLSL_OPT 0x4 /**< Force optimizations (override pragmas) */
-#define GLSL_NO_OPT 0x8 /**< Force no optimizations (override pragmas) */
-#define GLSL_UNIFORMS 0x10 /**< Print glUniform calls */
-#define GLSL_NOP_VERT 0x20 /**< Force no-op vertex shaders */
-#define GLSL_NOP_FRAG 0x40 /**< Force no-op fragment shaders */
-#define GLSL_USE_PROG 0x80 /**< Log glUseProgram calls */
-
-
-/**
- * Context state for GLSL vertex/fragment shaders.
- */
-struct gl_shader_state
-{
- /**
- * Programs used for rendering
- *
- * There is a separate program set for each shader stage. If
- * GL_EXT_separate_shader_objects is not supported, each of these must point
- * to \c NULL or to the same program.
- */
- struct gl_shader_program *CurrentVertexProgram;
- struct gl_shader_program *CurrentGeometryProgram;
- struct gl_shader_program *CurrentFragmentProgram;
-
- /**
- * Program used by glUniform calls.
- *
- * Explicitly set by \c glUseProgram and \c glActiveProgramEXT.
- */
- struct gl_shader_program *ActiveProgram;
-
- void *MemPool;
-
- GLbitfield Flags; /**< Mask of GLSL_x flags */
-};
-
-/**
- * Compiler options for a single GLSL shaders type
- */
-struct gl_shader_compiler_options
-{
- /** Driver-selectable options: */
- GLboolean EmitCondCodes; /**< Use condition codes? */
- GLboolean EmitNVTempInitialization; /**< 0-fill NV temp registers */
- /**
- * Attempts to flatten all ir_if (OPCODE_IF) for GPUs that can't
- * support control flow.
- */
- GLboolean EmitNoIfs;
- GLboolean EmitNoLoops;
- GLboolean EmitNoFunctions;
- GLboolean EmitNoCont; /**< Emit CONT opcode? */
- GLboolean EmitNoMainReturn; /**< Emit CONT/RET opcodes? */
- GLboolean EmitNoNoise; /**< Emit NOISE opcodes? */
- GLboolean EmitNoPow; /**< Emit POW opcodes? */
-
- /**
- * \name Forms of indirect addressing the driver cannot do.
- */
- /*@{*/
- GLboolean EmitNoIndirectInput; /**< No indirect addressing of inputs */
- GLboolean EmitNoIndirectOutput; /**< No indirect addressing of outputs */
- GLboolean EmitNoIndirectTemp; /**< No indirect addressing of temps */
- GLboolean EmitNoIndirectUniform; /**< No indirect addressing of constants */
- /*@}*/
-
- GLuint MaxUnrollIterations;
-
- struct gl_sl_pragmas DefaultPragmas; /**< Default #pragma settings */
-};
-
-/**
- * Transform feedback object state
- */
-struct gl_transform_feedback_object
-{
- GLuint Name; /**< AKA the object ID */
- GLint RefCount;
- GLboolean Active; /**< Is transform feedback enabled? */
- GLboolean Paused; /**< Is transform feedback paused? */
-
- /** The feedback buffers */
- GLuint BufferNames[MAX_FEEDBACK_ATTRIBS];
- struct gl_buffer_object *Buffers[MAX_FEEDBACK_ATTRIBS];
-
- /** Start of feedback data in dest buffer */
- GLintptr Offset[MAX_FEEDBACK_ATTRIBS];
- /** Max data to put into dest buffer (in bytes) */
- GLsizeiptr Size[MAX_FEEDBACK_ATTRIBS];
-};
-
-
-/**
- * Context state for transform feedback.
- */
-struct gl_transform_feedback
-{
- GLenum Mode; /**< GL_POINTS, GL_LINES or GL_TRIANGLES */
-
- GLboolean RasterDiscard; /**< GL_RASTERIZER_DISCARD */
-
- /** The general binding point (GL_TRANSFORM_FEEDBACK_BUFFER) */
- struct gl_buffer_object *CurrentBuffer;
-
- /** The table of all transform feedback objects */
- struct _mesa_HashTable *Objects;
-
- /** The current xform-fb object (GL_TRANSFORM_FEEDBACK_BINDING) */
- struct gl_transform_feedback_object *CurrentObject;
-
- /** The default xform-fb object (Name==0) */
- struct gl_transform_feedback_object *DefaultObject;
-};
-
-
-
-/**
- * State which can be shared by multiple contexts:
- */
-struct gl_shared_state
-{
- _glthread_Mutex Mutex; /**< for thread safety */
- GLint RefCount; /**< Reference count */
- struct _mesa_HashTable *DisplayList; /**< Display lists hash table */
- struct _mesa_HashTable *TexObjects; /**< Texture objects hash table */
-
- /** Default texture objects (shared by all texture units) */
- struct gl_texture_object *DefaultTex[NUM_TEXTURE_TARGETS];
-
- /** Fallback texture used when a bound texture is incomplete */
- struct gl_texture_object *FallbackTex;
-
- /**
- * \name Thread safety and statechange notification for texture
- * objects.
- *
- * \todo Improve the granularity of locking.
- */
- /*@{*/
- _glthread_Mutex TexMutex; /**< texobj thread safety */
- GLuint TextureStateStamp; /**< state notification for shared tex */
- /*@}*/
-
- /** Default buffer object for vertex arrays that aren't in VBOs */
- struct gl_buffer_object *NullBufferObj;
-
- /**
- * \name Vertex/geometry/fragment programs
- */
- /*@{*/
- struct _mesa_HashTable *Programs; /**< All vertex/fragment programs */
- struct gl_vertex_program *DefaultVertexProgram;
- struct gl_fragment_program *DefaultFragmentProgram;
- struct gl_geometry_program *DefaultGeometryProgram;
- /*@}*/
-
- /* GL_ATI_fragment_shader */
- struct _mesa_HashTable *ATIShaders;
- struct ati_fragment_shader *DefaultFragmentShader;
-
- struct _mesa_HashTable *BufferObjects;
-
- /** Table of both gl_shader and gl_shader_program objects */
- struct _mesa_HashTable *ShaderObjects;
-
- /* GL_EXT_framebuffer_object */
- struct _mesa_HashTable *RenderBuffers;
- struct _mesa_HashTable *FrameBuffers;
-
- /* GL_ARB_sync */
- struct simple_node SyncObjects;
-
- /** GL_ARB_sampler_objects */
- struct _mesa_HashTable *SamplerObjects;
-
- void *DriverData; /**< Device driver shared state */
-};
-
-
-
-
-/**
- * A renderbuffer stores colors or depth values or stencil values.
- * A framebuffer object will have a collection of these.
- * Data are read/written to the buffer with a handful of Get/Put functions.
- *
- * Instances of this object are allocated with the Driver's NewRenderbuffer
- * hook. Drivers will likely wrap this class inside a driver-specific
- * class to simulate inheritance.
- */
-struct gl_renderbuffer
-{
- _glthread_Mutex Mutex; /**< for thread safety */
- GLuint ClassID; /**< Useful for drivers */
- GLuint Name;
- GLint RefCount;
- GLuint Width, Height;
- GLint RowStride; /**< Padded width in units of pixels */
- GLboolean Purgeable; /**< Is the buffer purgeable under memory pressure? */
-
- GLboolean AttachedAnytime; /**< TRUE if it was attached to a framebuffer */
-
- GLubyte NumSamples;
-
- GLenum InternalFormat; /**< The user-specified format */
- GLenum _BaseFormat; /**< Either GL_RGB, GL_RGBA, GL_DEPTH_COMPONENT or
- GL_STENCIL_INDEX. */
- gl_format Format; /**< The actual renderbuffer memory format */
-
- GLenum DataType; /**< Type of values passed to the Get/Put functions */
- GLvoid *Data; /**< This may not be used by some kinds of RBs */
-
- /* Used to wrap one renderbuffer around another: */
- struct gl_renderbuffer *Wrapped;
-
- /* Delete this renderbuffer */
- void (*Delete)(struct gl_renderbuffer *rb);
-
- /* Allocate new storage for this renderbuffer */
- GLboolean (*AllocStorage)(struct gl_context *ctx, struct gl_renderbuffer *rb,
- GLenum internalFormat,
- GLuint width, GLuint height);
-
- /* Lock/Unlock are called before/after calling the Get/Put functions.
- * Not sure this is the right place for these yet.
- void (*Lock)(struct gl_context *ctx, struct gl_renderbuffer *rb);
- void (*Unlock)(struct gl_context *ctx, struct gl_renderbuffer *rb);
- */
-
- /* Return a pointer to the element/pixel at (x,y).
- * Should return NULL if the buffer memory can't be directly addressed.
- */
- void *(*GetPointer)(struct gl_context *ctx, struct gl_renderbuffer *rb,
- GLint x, GLint y);
-
- /* Get/Read a row of values.
- * The values will be of format _BaseFormat and type DataType.
- */
- void (*GetRow)(struct gl_context *ctx, struct gl_renderbuffer *rb, GLuint count,
- GLint x, GLint y, void *values);
-
- /* Get/Read values at arbitrary locations.
- * The values will be of format _BaseFormat and type DataType.
- */
- void (*GetValues)(struct gl_context *ctx, struct gl_renderbuffer *rb, GLuint count,
- const GLint x[], const GLint y[], void *values);
-
- /* Put/Write a row of values.
- * The values will be of format _BaseFormat and type DataType.
- */
- void (*PutRow)(struct gl_context *ctx, struct gl_renderbuffer *rb, GLuint count,
- GLint x, GLint y, const void *values, const GLubyte *mask);
-
- /* Put/Write a row of RGB values. This is a special-case routine that's
- * only used for RGBA renderbuffers when the source data is GL_RGB. That's
- * a common case for glDrawPixels and some triangle routines.
- * The values will be of format GL_RGB and type DataType.
- */
- void (*PutRowRGB)(struct gl_context *ctx, struct gl_renderbuffer *rb, GLuint count,
- GLint x, GLint y, const void *values, const GLubyte *mask);
-
-
- /* Put/Write a row of identical values.
- * The values will be of format _BaseFormat and type DataType.
- */
- void (*PutMonoRow)(struct gl_context *ctx, struct gl_renderbuffer *rb, GLuint count,
- GLint x, GLint y, const void *value, const GLubyte *mask);
-
- /* Put/Write values at arbitrary locations.
- * The values will be of format _BaseFormat and type DataType.
- */
- void (*PutValues)(struct gl_context *ctx, struct gl_renderbuffer *rb, GLuint count,
- const GLint x[], const GLint y[], const void *values,
- const GLubyte *mask);
- /* Put/Write identical values at arbitrary locations.
- * The values will be of format _BaseFormat and type DataType.
- */
- void (*PutMonoValues)(struct gl_context *ctx, struct gl_renderbuffer *rb,
- GLuint count, const GLint x[], const GLint y[],
- const void *value, const GLubyte *mask);
-};
-
-
-/**
- * A renderbuffer attachment points to either a texture object (and specifies
- * a mipmap level, cube face or 3D texture slice) or points to a renderbuffer.
- */
-struct gl_renderbuffer_attachment
-{
- GLenum Type; /**< \c GL_NONE or \c GL_TEXTURE or \c GL_RENDERBUFFER_EXT */
- GLboolean Complete;
-
- /**
- * If \c Type is \c GL_RENDERBUFFER_EXT, this stores a pointer to the
- * application supplied renderbuffer object.
- */
- struct gl_renderbuffer *Renderbuffer;
-
- /**
- * If \c Type is \c GL_TEXTURE, this stores a pointer to the application
- * supplied texture object.
- */
- struct gl_texture_object *Texture;
- GLuint TextureLevel; /**< Attached mipmap level. */
- GLuint CubeMapFace; /**< 0 .. 5, for cube map textures. */
- GLuint Zoffset; /**< Slice for 3D textures, or layer for both 1D
- * and 2D array textures */
-};
-
-
-/**
- * A framebuffer is a collection of renderbuffers (color, depth, stencil, etc).
- * In C++ terms, think of this as a base class from which device drivers
- * will make derived classes.
- */
-struct gl_framebuffer
-{
- _glthread_Mutex Mutex; /**< for thread safety */
- /**
- * If zero, this is a window system framebuffer. If non-zero, this
- * is a FBO framebuffer; note that for some devices (i.e. those with
- * a natural pixel coordinate system for FBOs that differs from the
- * OpenGL/Mesa coordinate system), this means that the viewport,
- * polygon face orientation, and polygon stipple will have to be inverted.
- */
- GLuint Name;
-
- GLint RefCount;
- GLboolean DeletePending;
-
- /**
- * The framebuffer's visual. Immutable if this is a window system buffer.
- * Computed from attachments if user-made FBO.
- */
- struct gl_config Visual;
-
- GLboolean Initialized;
-
- GLuint Width, Height; /**< size of frame buffer in pixels */
-
- /** \name Drawing bounds (Intersection of buffer size and scissor box) */
- /*@{*/
- GLint _Xmin, _Xmax; /**< inclusive */
- GLint _Ymin, _Ymax; /**< exclusive */
- /*@}*/
-
- /** \name Derived Z buffer stuff */
- /*@{*/
- GLuint _DepthMax; /**< Max depth buffer value */
- GLfloat _DepthMaxF; /**< Float max depth buffer value */
- GLfloat _MRD; /**< minimum resolvable difference in Z values */
- /*@}*/
-
- /** One of the GL_FRAMEBUFFER_(IN)COMPLETE_* tokens */
- GLenum _Status;
-
- /** Integer color values */
- GLboolean _IntegerColor;
-
- /** Array of all renderbuffer attachments, indexed by BUFFER_* tokens. */
- struct gl_renderbuffer_attachment Attachment[BUFFER_COUNT];
-
- /* In unextended OpenGL these vars are part of the GL_COLOR_BUFFER
- * attribute group and GL_PIXEL attribute group, respectively.
- */
- GLenum ColorDrawBuffer[MAX_DRAW_BUFFERS];
- GLenum ColorReadBuffer;
-
- /** Computed from ColorDraw/ReadBuffer above */
- GLuint _NumColorDrawBuffers;
- GLint _ColorDrawBufferIndexes[MAX_DRAW_BUFFERS]; /**< BUFFER_x or -1 */
- GLint _ColorReadBufferIndex; /* -1 = None */
- struct gl_renderbuffer *_ColorDrawBuffers[MAX_DRAW_BUFFERS];
- struct gl_renderbuffer *_ColorReadBuffer;
-
- /** The Actual depth/stencil buffers to use. May be wrappers around the
- * depth/stencil buffers attached above. */
- struct gl_renderbuffer *_DepthBuffer;
- struct gl_renderbuffer *_StencilBuffer;
-
- /** Delete this framebuffer */
- void (*Delete)(struct gl_framebuffer *fb);
-};
-
-
-/**
- * Precision info for shader datatypes. See glGetShaderPrecisionFormat().
- */
-struct gl_precision
-{
- GLushort RangeMin; /**< min value exponent */
- GLushort RangeMax; /**< max value exponent */
- GLushort Precision; /**< number of mantissa bits */
-};
-
-
-/**
- * Limits for vertex, geometry and fragment programs/shaders.
- */
-struct gl_program_constants
-{
- /* logical limits */
- GLuint MaxInstructions;
- GLuint MaxAluInstructions;
- GLuint MaxTexInstructions;
- GLuint MaxTexIndirections;
- GLuint MaxAttribs;
- GLuint MaxTemps;
- GLuint MaxAddressRegs;
- GLuint MaxAddressOffset; /**< [-MaxAddressOffset, MaxAddressOffset-1] */
- GLuint MaxParameters;
- GLuint MaxLocalParams;
- GLuint MaxEnvParams;
- /* native/hardware limits */
- GLuint MaxNativeInstructions;
- GLuint MaxNativeAluInstructions;
- GLuint MaxNativeTexInstructions;
- GLuint MaxNativeTexIndirections;
- GLuint MaxNativeAttribs;
- GLuint MaxNativeTemps;
- GLuint MaxNativeAddressRegs;
- GLuint MaxNativeParameters;
- /* For shaders */
- GLuint MaxUniformComponents; /**< Usually == MaxParameters * 4 */
- /* ES 2.0 and GL_ARB_ES2_compatibility */
- struct gl_precision LowFloat, MediumFloat, HighFloat;
- struct gl_precision LowInt, MediumInt, HighInt;
-};
-
-
-/**
- * Constants which may be overridden by device driver during context creation
- * but are never changed after that.
- */
-struct gl_constants
-{
- GLint MaxTextureMbytes; /**< Max memory per image, in MB */
- GLint MaxTextureLevels; /**< Max mipmap levels. */
- GLint Max3DTextureLevels; /**< Max mipmap levels for 3D textures */
- GLint MaxCubeTextureLevels; /**< Max mipmap levels for cube textures */
- GLint MaxArrayTextureLayers; /**< Max layers in array textures */
- GLint MaxTextureRectSize; /**< Max rectangle texture size, in pixes */
- GLuint MaxTextureCoordUnits;
- GLuint MaxTextureImageUnits;
- GLuint MaxVertexTextureImageUnits;
- GLuint MaxCombinedTextureImageUnits;
- GLuint MaxGeometryTextureImageUnits;
- GLuint MaxTextureUnits; /**< = MIN(CoordUnits, ImageUnits) */
- GLfloat MaxTextureMaxAnisotropy; /**< GL_EXT_texture_filter_anisotropic */
- GLfloat MaxTextureLodBias; /**< GL_EXT_texture_lod_bias */
- GLuint MaxTextureBufferSize; /**< GL_ARB_texture_buffer_object */
-
- GLuint MaxArrayLockSize;
-
- GLint SubPixelBits;
-
- GLfloat MinPointSize, MaxPointSize; /**< aliased */
- GLfloat MinPointSizeAA, MaxPointSizeAA; /**< antialiased */
- GLfloat PointSizeGranularity;
- GLfloat MinLineWidth, MaxLineWidth; /**< aliased */
- GLfloat MinLineWidthAA, MaxLineWidthAA; /**< antialiased */
- GLfloat LineWidthGranularity;
-
- GLuint MaxColorTableSize;
-
- GLuint MaxClipPlanes;
- GLuint MaxLights;
- GLfloat MaxShininess; /**< GL_NV_light_max_exponent */
- GLfloat MaxSpotExponent; /**< GL_NV_light_max_exponent */
-
- GLuint MaxViewportWidth, MaxViewportHeight;
-
- struct gl_program_constants VertexProgram; /**< GL_ARB_vertex_program */
- struct gl_program_constants FragmentProgram; /**< GL_ARB_fragment_program */
- struct gl_program_constants GeometryProgram; /**< GL_ARB_geometry_shader4 */
- GLuint MaxProgramMatrices;
- GLuint MaxProgramMatrixStackDepth;
-
- /** vertex array / buffer object bounds checking */
- GLboolean CheckArrayBounds;
-
- GLuint MaxDrawBuffers; /**< GL_ARB_draw_buffers */
-
- GLuint MaxColorAttachments; /**< GL_EXT_framebuffer_object */
- GLuint MaxRenderbufferSize; /**< GL_EXT_framebuffer_object */
- GLuint MaxSamples; /**< GL_ARB_framebuffer_object */
-
- /** Number of varying vectors between vertex and fragment shaders */
- GLuint MaxVarying;
- GLuint MaxVertexVaryingComponents; /**< Between vert and geom shader */
- GLuint MaxGeometryVaryingComponents; /**< Between geom and frag shader */
-
- /** GL_ARB_geometry_shader4 */
- GLuint MaxGeometryOutputVertices;
- GLuint MaxGeometryTotalOutputComponents;
-
- GLuint GLSLVersion; /**< GLSL version supported (ex: 120 = 1.20) */
-
- /** Which texture units support GL_ATI_envmap_bumpmap as targets */
- GLbitfield SupportedBumpUnits;
-
- /**
- * Maximum amount of time, measured in nanseconds, that the server can wait.
- */
- GLuint64 MaxServerWaitTimeout;
-
- /** GL_EXT_provoking_vertex */
- GLboolean QuadsFollowProvokingVertexConvention;
-
- /** OpenGL version 3.0 */
- GLbitfield ContextFlags; /**< Ex: GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT */
-
- /** OpenGL version 3.2 */
- GLbitfield ProfileMask; /**< Mask of CONTEXT_x_PROFILE_BIT */
-
- /** GL_EXT_transform_feedback */
- GLuint MaxTransformFeedbackSeparateAttribs;
- GLuint MaxTransformFeedbackSeparateComponents;
- GLuint MaxTransformFeedbackInterleavedComponents;
-
- /** GL_EXT_gpu_shader4 */
- GLint MinProgramTexelOffset, MaxProgramTexelOffset;
-
- /* GL_EXT_framebuffer_sRGB */
- GLboolean sRGBCapable; /* can enable sRGB blend/update on FBOs */
-
- /* GL_ARB_robustness */
- GLenum ResetStrategy;
-};
-
-
-/**
- * Enable flag for each OpenGL extension. Different device drivers will
- * enable different extensions at runtime.
- */
-struct gl_extensions
-{
- GLboolean dummy; /* don't remove this! */
- GLboolean dummy_true; /* Set true by _mesa_init_extensions(). */
- GLboolean dummy_false; /* Set false by _mesa_init_extensions(). */
- GLboolean ARB_ES2_compatibility;
- GLboolean ARB_blend_func_extended;
- GLboolean ARB_color_buffer_float;
- GLboolean ARB_copy_buffer;
- GLboolean ARB_depth_buffer_float;
- GLboolean ARB_depth_clamp;
- GLboolean ARB_depth_texture;
- GLboolean ARB_draw_buffers;
- GLboolean ARB_draw_buffers_blend;
- GLboolean ARB_draw_elements_base_vertex;
- GLboolean ARB_draw_instanced;
- GLboolean ARB_fragment_coord_conventions;
- GLboolean ARB_fragment_program;
- GLboolean ARB_fragment_program_shadow;
- GLboolean ARB_fragment_shader;
- GLboolean ARB_framebuffer_object;
- GLboolean ARB_explicit_attrib_location;
- GLboolean ARB_geometry_shader4;
- GLboolean ARB_half_float_pixel;
- GLboolean ARB_half_float_vertex;
- GLboolean ARB_instanced_arrays;
- GLboolean ARB_map_buffer_range;
- GLboolean ARB_multisample;
- GLboolean ARB_multitexture;
- GLboolean ARB_occlusion_query;
- GLboolean ARB_occlusion_query2;
- GLboolean ARB_point_sprite;
- GLboolean ARB_sampler_objects;
- GLboolean ARB_seamless_cube_map;
- GLboolean ARB_shader_objects;
- GLboolean ARB_shader_stencil_export;
- GLboolean ARB_shader_texture_lod;
- GLboolean ARB_shading_language_100;
- GLboolean ARB_shadow;
- GLboolean ARB_shadow_ambient;
- GLboolean ARB_sync;
- GLboolean ARB_texture_border_clamp;
- GLboolean ARB_texture_buffer_object;
- GLboolean ARB_texture_compression;
- GLboolean ARB_texture_compression_rgtc;
- GLboolean ARB_texture_cube_map;
- GLboolean ARB_texture_env_combine;
- GLboolean ARB_texture_env_crossbar;
- GLboolean ARB_texture_env_dot3;
- GLboolean ARB_texture_float;
- GLboolean ARB_texture_mirrored_repeat;
- GLboolean ARB_texture_multisample;
- GLboolean ARB_texture_non_power_of_two;
- GLboolean ARB_texture_rg;
- GLboolean ARB_texture_rgb10_a2ui;
- GLboolean ARB_timer_query;
- GLboolean ARB_transform_feedback2;
- GLboolean ARB_transpose_matrix;
- GLboolean ARB_uniform_buffer_object;
- GLboolean ARB_vertex_array_object;
- GLboolean ARB_vertex_buffer_object;
- GLboolean ARB_vertex_program;
- GLboolean ARB_vertex_shader;
- GLboolean ARB_vertex_type_2_10_10_10_rev;
- GLboolean ARB_window_pos;
- GLboolean EXT_abgr;
- GLboolean EXT_bgra;
- GLboolean EXT_blend_color;
- GLboolean EXT_blend_equation_separate;
- GLboolean EXT_blend_func_separate;
- GLboolean EXT_blend_logic_op;
- GLboolean EXT_blend_minmax;
- GLboolean EXT_blend_subtract;
- GLboolean EXT_clip_volume_hint;
- GLboolean EXT_compiled_vertex_array;
- GLboolean EXT_copy_texture;
- GLboolean EXT_depth_bounds_test;
- GLboolean EXT_draw_buffers2;
- GLboolean EXT_draw_range_elements;
- GLboolean EXT_fog_coord;
- GLboolean EXT_framebuffer_blit;
- GLboolean EXT_framebuffer_multisample;
- GLboolean EXT_framebuffer_object;
- GLboolean EXT_framebuffer_sRGB;
- GLboolean EXT_gpu_program_parameters;
- GLboolean EXT_gpu_shader4;
- GLboolean EXT_multi_draw_arrays;
- GLboolean EXT_paletted_texture;
- GLboolean EXT_packed_depth_stencil;
- GLboolean EXT_packed_float;
- GLboolean EXT_packed_pixels;
- GLboolean EXT_pixel_buffer_object;
- GLboolean EXT_point_parameters;
- GLboolean EXT_polygon_offset;
- GLboolean EXT_provoking_vertex;
- GLboolean EXT_rescale_normal;
- GLboolean EXT_shadow_funcs;
- GLboolean EXT_secondary_color;
- GLboolean EXT_separate_shader_objects;
- GLboolean EXT_separate_specular_color;
- GLboolean EXT_shared_texture_palette;
- GLboolean EXT_stencil_wrap;
- GLboolean EXT_stencil_two_side;
- GLboolean EXT_subtexture;
- GLboolean EXT_texture;
- GLboolean EXT_texture_object;
- GLboolean EXT_texture3D;
- GLboolean EXT_texture_array;
- GLboolean EXT_texture_compression_latc;
- GLboolean EXT_texture_compression_s3tc;
- GLboolean EXT_texture_env_add;
- GLboolean EXT_texture_env_combine;
- GLboolean EXT_texture_env_dot3;
- GLboolean EXT_texture_filter_anisotropic;
- GLboolean EXT_texture_integer;
- GLboolean EXT_texture_lod_bias;
- GLboolean EXT_texture_mirror_clamp;
- GLboolean EXT_texture_shared_exponent;
- GLboolean EXT_texture_snorm;
- GLboolean EXT_texture_sRGB;
- GLboolean EXT_texture_sRGB_decode;
- GLboolean EXT_texture_swizzle;
- GLboolean EXT_transform_feedback;
- GLboolean EXT_timer_query;
- GLboolean EXT_vertex_array;
- GLboolean EXT_vertex_array_bgra;
- GLboolean EXT_vertex_array_set;
- GLboolean OES_standard_derivatives;
- /* vendor extensions */
- GLboolean AMD_conservative_depth;
- GLboolean AMD_seamless_cubemap_per_texture;
- GLboolean APPLE_client_storage;
- GLboolean APPLE_packed_pixels;
- GLboolean APPLE_vertex_array_object;
- GLboolean APPLE_object_purgeable;
- GLboolean ATI_envmap_bumpmap;
- GLboolean ATI_texture_compression_3dc;
- GLboolean ATI_texture_mirror_once;
- GLboolean ATI_texture_env_combine3;
- GLboolean ATI_fragment_shader;
- GLboolean ATI_separate_stencil;
- GLboolean IBM_rasterpos_clip;
- GLboolean IBM_multimode_draw_arrays;
- GLboolean MESA_pack_invert;
- GLboolean MESA_resize_buffers;
- GLboolean MESA_ycbcr_texture;
- GLboolean MESA_texture_array;
- GLboolean NV_blend_square;
- GLboolean NV_conditional_render;
- GLboolean NV_fragment_program;
- GLboolean NV_fragment_program_option;
- GLboolean NV_light_max_exponent;
- GLboolean NV_point_sprite;
- GLboolean NV_primitive_restart;
- GLboolean NV_texture_barrier;
- GLboolean NV_texgen_reflection;
- GLboolean NV_texture_env_combine4;
- GLboolean NV_texture_rectangle;
- GLboolean NV_vertex_program;
- GLboolean NV_vertex_program1_1;
- GLboolean OES_read_format;
- GLboolean SGIS_generate_mipmap;
- GLboolean SGIS_texture_edge_clamp;
- GLboolean SGIS_texture_lod;
- GLboolean TDFX_texture_compression_FXT1;
- GLboolean S3_s3tc;
- GLboolean OES_EGL_image;
- GLboolean OES_draw_texture;
- GLboolean EXT_texture_format_BGRA8888;
- GLboolean extension_sentinel;
- /** The extension string */
- const GLubyte *String;
- /** Number of supported extensions */
- GLuint Count;
-};
-
-
-/**
- * A stack of matrices (projection, modelview, color, texture, etc).
- */
-struct gl_matrix_stack
-{
- GLmatrix *Top; /**< points into Stack */
- GLmatrix *Stack; /**< array [MaxDepth] of GLmatrix */
- GLuint Depth; /**< 0 <= Depth < MaxDepth */
- GLuint MaxDepth; /**< size of Stack[] array */
- GLuint DirtyFlag; /**< _NEW_MODELVIEW or _NEW_PROJECTION, for example */
-};
-
-
-/**
- * \name Bits for image transfer operations
- * \sa __struct gl_contextRec::ImageTransferState.
- */
-/*@{*/
-#define IMAGE_SCALE_BIAS_BIT 0x1
-#define IMAGE_SHIFT_OFFSET_BIT 0x2
-#define IMAGE_MAP_COLOR_BIT 0x4
-#define IMAGE_CLAMP_BIT 0x800
-
-
-/** Pixel Transfer ops */
-#define IMAGE_BITS (IMAGE_SCALE_BIAS_BIT | \
- IMAGE_SHIFT_OFFSET_BIT | \
- IMAGE_MAP_COLOR_BIT)
-
-/**
- * \name Bits to indicate what state has changed.
- */
-/*@{*/
-#define _NEW_MODELVIEW (1 << 0) /**< gl_context::ModelView */
-#define _NEW_PROJECTION (1 << 1) /**< gl_context::Projection */
-#define _NEW_TEXTURE_MATRIX (1 << 2) /**< gl_context::TextureMatrix */
-#define _NEW_COLOR (1 << 3) /**< gl_context::Color */
-#define _NEW_DEPTH (1 << 4) /**< gl_context::Depth */
-#define _NEW_EVAL (1 << 5) /**< gl_context::Eval, EvalMap */
-#define _NEW_FOG (1 << 6) /**< gl_context::Fog */
-#define _NEW_HINT (1 << 7) /**< gl_context::Hint */
-#define _NEW_LIGHT (1 << 8) /**< gl_context::Light */
-#define _NEW_LINE (1 << 9) /**< gl_context::Line */
-#define _NEW_PIXEL (1 << 10) /**< gl_context::Pixel */
-#define _NEW_POINT (1 << 11) /**< gl_context::Point */
-#define _NEW_POLYGON (1 << 12) /**< gl_context::Polygon */
-#define _NEW_POLYGONSTIPPLE (1 << 13) /**< gl_context::PolygonStipple */
-#define _NEW_SCISSOR (1 << 14) /**< gl_context::Scissor */
-#define _NEW_STENCIL (1 << 15) /**< gl_context::Stencil */
-#define _NEW_TEXTURE (1 << 16) /**< gl_context::Texture */
-#define _NEW_TRANSFORM (1 << 17) /**< gl_context::Transform */
-#define _NEW_VIEWPORT (1 << 18) /**< gl_context::Viewport */
-#define _NEW_PACKUNPACK (1 << 19) /**< gl_context::Pack, Unpack */
-#define _NEW_ARRAY (1 << 20) /**< gl_context::Array */
-#define _NEW_RENDERMODE (1 << 21) /**< gl_context::RenderMode, etc */
-#define _NEW_BUFFERS (1 << 22) /**< gl_context::Visual, DrawBuffer, */
-#define _NEW_CURRENT_ATTRIB (1 << 23) /**< gl_context::Current */
-#define _NEW_MULTISAMPLE (1 << 24) /**< gl_context::Multisample */
-#define _NEW_TRACK_MATRIX (1 << 25) /**< gl_context::VertexProgram */
-#define _NEW_PROGRAM (1 << 26) /**< New program/shader state */
-#define _NEW_PROGRAM_CONSTANTS (1 << 27)
-#define _NEW_BUFFER_OBJECT (1 << 28)
-#define _NEW_FRAG_CLAMP (1 << 29)
-#define _NEW_ALL ~0
-/*@}*/
-
-
-/**
- * \name Bits to track array state changes
- *
- * Also used to summarize array enabled.
- */
-/*@{*/
-#define _NEW_ARRAY_VERTEX VERT_BIT_POS
-#define _NEW_ARRAY_WEIGHT VERT_BIT_WEIGHT
-#define _NEW_ARRAY_NORMAL VERT_BIT_NORMAL
-#define _NEW_ARRAY_COLOR0 VERT_BIT_COLOR0
-#define _NEW_ARRAY_COLOR1 VERT_BIT_COLOR1
-#define _NEW_ARRAY_FOGCOORD VERT_BIT_FOG
-#define _NEW_ARRAY_INDEX VERT_BIT_COLOR_INDEX
-#define _NEW_ARRAY_EDGEFLAG VERT_BIT_EDGEFLAG
-#define _NEW_ARRAY_POINT_SIZE VERT_BIT_COLOR_INDEX /* aliased */
-#define _NEW_ARRAY_TEXCOORD_0 VERT_BIT_TEX0
-#define _NEW_ARRAY_TEXCOORD_1 VERT_BIT_TEX1
-#define _NEW_ARRAY_TEXCOORD_2 VERT_BIT_TEX2
-#define _NEW_ARRAY_TEXCOORD_3 VERT_BIT_TEX3
-#define _NEW_ARRAY_TEXCOORD_4 VERT_BIT_TEX4
-#define _NEW_ARRAY_TEXCOORD_5 VERT_BIT_TEX5
-#define _NEW_ARRAY_TEXCOORD_6 VERT_BIT_TEX6
-#define _NEW_ARRAY_TEXCOORD_7 VERT_BIT_TEX7
-#define _NEW_ARRAY_ATTRIB_0 VERT_BIT_GENERIC0 /* start at bit 16 */
-#define _NEW_ARRAY_ALL 0xffffffff
-
-
-#define _NEW_ARRAY_TEXCOORD(i) (_NEW_ARRAY_TEXCOORD_0 << (i))
-#define _NEW_ARRAY_ATTRIB(i) (_NEW_ARRAY_ATTRIB_0 << (i))
-/*@}*/
-
-
-
-/**
- * \name A bunch of flags that we think might be useful to drivers.
- *
- * Set in the __struct gl_contextRec::_TriangleCaps bitfield.
- */
-/*@{*/
-#define DD_FLATSHADE 0x1
-#define DD_SEPARATE_SPECULAR 0x2
-#define DD_TRI_CULL_FRONT_BACK 0x4 /* special case on some hw */
-#define DD_TRI_LIGHT_TWOSIDE 0x8
-#define DD_TRI_UNFILLED 0x10
-#define DD_TRI_SMOOTH 0x20
-#define DD_TRI_STIPPLE 0x40
-#define DD_TRI_OFFSET 0x80
-#define DD_LINE_SMOOTH 0x100
-#define DD_LINE_STIPPLE 0x200
-#define DD_POINT_SMOOTH 0x400
-#define DD_POINT_ATTEN 0x800
-#define DD_TRI_TWOSTENCIL 0x1000
-/*@}*/
-
-
-/**
- * \name Define the state changes under which each of these bits might change
- */
-/*@{*/
-#define _DD_NEW_FLATSHADE _NEW_LIGHT
-#define _DD_NEW_SEPARATE_SPECULAR (_NEW_LIGHT | _NEW_FOG | _NEW_PROGRAM)
-#define _DD_NEW_TRI_CULL_FRONT_BACK _NEW_POLYGON
-#define _DD_NEW_TRI_LIGHT_TWOSIDE _NEW_LIGHT
-#define _DD_NEW_TRI_UNFILLED _NEW_POLYGON
-#define _DD_NEW_TRI_SMOOTH _NEW_POLYGON
-#define _DD_NEW_TRI_STIPPLE _NEW_POLYGON
-#define _DD_NEW_TRI_OFFSET _NEW_POLYGON
-#define _DD_NEW_LINE_SMOOTH _NEW_LINE
-#define _DD_NEW_LINE_STIPPLE _NEW_LINE
-#define _DD_NEW_LINE_WIDTH _NEW_LINE
-#define _DD_NEW_POINT_SMOOTH _NEW_POINT
-#define _DD_NEW_POINT_SIZE _NEW_POINT
-#define _DD_NEW_POINT_ATTEN _NEW_POINT
-/*@}*/
-
-
-/**
- * Composite state flags
- */
-/*@{*/
-#define _MESA_NEW_NEED_EYE_COORDS (_NEW_LIGHT | \
- _NEW_TEXTURE | \
- _NEW_POINT | \
- _NEW_PROGRAM | \
- _NEW_MODELVIEW)
-/*@}*/
-
-
-
-
-/* This has to be included here. */
-#include "dd.h"
-
-
-/**
- * Display list flags.
- * Strictly this is a tnl-private concept, but it doesn't seem
- * worthwhile adding a tnl private structure just to hold this one bit
- * of information:
- */
-#define DLIST_DANGLING_REFS 0x1
-
-
-/** Opaque declaration of display list payload data type */
-union gl_dlist_node;
-
-
-/**
- * Provide a location where information about a display list can be
- * collected. Could be extended with driverPrivate structures,
- * etc. in the future.
- */
-struct gl_display_list
-{
- GLuint Name;
- GLbitfield Flags; /**< DLIST_x flags */
- /** The dlist commands are in a linked list of nodes */
- union gl_dlist_node *Head;
-};
-
-
-/**
- * State used during display list compilation and execution.
- */
-struct gl_dlist_state
-{
- GLuint CallDepth; /**< Current recursion calling depth */
-
- struct gl_display_list *CurrentList; /**< List currently being compiled */
- union gl_dlist_node *CurrentBlock; /**< Pointer to current block of nodes */
- GLuint CurrentPos; /**< Index into current block of nodes */
-
- GLvertexformat ListVtxfmt;
-
- GLubyte ActiveAttribSize[VERT_ATTRIB_MAX];
- GLfloat CurrentAttrib[VERT_ATTRIB_MAX][4];
-
- GLubyte ActiveMaterialSize[MAT_ATTRIB_MAX];
- GLfloat CurrentMaterial[MAT_ATTRIB_MAX][4];
-
- GLubyte ActiveIndex;
- GLfloat CurrentIndex;
-
- GLubyte ActiveEdgeFlag;
- GLboolean CurrentEdgeFlag;
-
- struct {
- /* State known to have been set by the currently-compiling display
- * list. Used to eliminate some redundant state changes.
- */
- GLenum ShadeModel;
- } Current;
-};
-
-
-/**
- * Enum for the OpenGL APIs we know about and may support.
- */
-typedef enum
-{
- API_OPENGL,
- API_OPENGLES,
- API_OPENGLES2
-} gl_api;
-
-
-/**
- * Mesa rendering context.
- *
- * This is the central context data structure for Mesa. Almost all
- * OpenGL state is contained in this structure.
- * Think of this as a base class from which device drivers will derive
- * sub classes.
- *
- * The struct gl_context typedef names this structure.
- */
-struct gl_context
-{
- /** State possibly shared with other contexts in the address space */
- struct gl_shared_state *Shared;
-
- /** \name API function pointer tables */
- /*@{*/
- gl_api API;
- struct _glapi_table *Save; /**< Display list save functions */
- struct _glapi_table *Exec; /**< Execute functions */
- struct _glapi_table *CurrentDispatch; /**< == Save or Exec !! */
- /*@}*/
-
- struct gl_config Visual;
- struct gl_framebuffer *DrawBuffer; /**< buffer for writing */
- struct gl_framebuffer *ReadBuffer; /**< buffer for reading */
- struct gl_framebuffer *WinSysDrawBuffer; /**< set with MakeCurrent */
- struct gl_framebuffer *WinSysReadBuffer; /**< set with MakeCurrent */
-
- /**
- * Device driver function pointer table
- */
- struct dd_function_table Driver;
-
- void *DriverCtx; /**< Points to device driver context/state */
-
- /** Core/Driver constants */
- struct gl_constants Const;
-
- /** \name The various 4x4 matrix stacks */
- /*@{*/
- struct gl_matrix_stack ModelviewMatrixStack;
- struct gl_matrix_stack ProjectionMatrixStack;
- struct gl_matrix_stack TextureMatrixStack[MAX_TEXTURE_UNITS];
- struct gl_matrix_stack ProgramMatrixStack[MAX_PROGRAM_MATRICES];
- struct gl_matrix_stack *CurrentStack; /**< Points to one of the above stacks */
- /*@}*/
-
- /** Combined modelview and projection matrix */
- GLmatrix _ModelProjectMatrix;
-
- /** \name Display lists */
- struct gl_dlist_state ListState;
-
- GLboolean ExecuteFlag; /**< Execute GL commands? */
- GLboolean CompileFlag; /**< Compile GL commands into display list? */
-
- /** Extension information */
- struct gl_extensions Extensions;
-
- /** Version info */
- GLuint VersionMajor, VersionMinor;
- char *VersionString;
-
- /** \name State attribute stack (for glPush/PopAttrib) */
- /*@{*/
- GLuint AttribStackDepth;
- struct gl_attrib_node *AttribStack[MAX_ATTRIB_STACK_DEPTH];
- /*@}*/
-
- /** \name Renderer attribute groups
- *
- * We define a struct for each attribute group to make pushing and popping
- * attributes easy. Also it's a good organization.
- */
- /*@{*/
- struct gl_accum_attrib Accum; /**< Accum buffer attributes */
- struct gl_colorbuffer_attrib Color; /**< Color buffer attributes */
- struct gl_current_attrib Current; /**< Current attributes */
- struct gl_depthbuffer_attrib Depth; /**< Depth buffer attributes */
- struct gl_eval_attrib Eval; /**< Eval attributes */
- struct gl_fog_attrib Fog; /**< Fog attributes */
- struct gl_hint_attrib Hint; /**< Hint attributes */
- struct gl_light_attrib Light; /**< Light attributes */
- struct gl_line_attrib Line; /**< Line attributes */
- struct gl_list_attrib List; /**< List attributes */
- struct gl_multisample_attrib Multisample;
- struct gl_pixel_attrib Pixel; /**< Pixel attributes */
- struct gl_point_attrib Point; /**< Point attributes */
- struct gl_polygon_attrib Polygon; /**< Polygon attributes */
- GLuint PolygonStipple[32]; /**< Polygon stipple */
- struct gl_scissor_attrib Scissor; /**< Scissor attributes */
- struct gl_stencil_attrib Stencil; /**< Stencil buffer attributes */
- struct gl_texture_attrib Texture; /**< Texture attributes */
- struct gl_transform_attrib Transform; /**< Transformation attributes */
- struct gl_viewport_attrib Viewport; /**< Viewport attributes */
- /*@}*/
-
- /** \name Client attribute stack */
- /*@{*/
- GLuint ClientAttribStackDepth;
- struct gl_attrib_node *ClientAttribStack[MAX_CLIENT_ATTRIB_STACK_DEPTH];
- /*@}*/
-
- /** \name Client attribute groups */
- /*@{*/
- struct gl_array_attrib Array; /**< Vertex arrays */
- struct gl_pixelstore_attrib Pack; /**< Pixel packing */
- struct gl_pixelstore_attrib Unpack; /**< Pixel unpacking */
- struct gl_pixelstore_attrib DefaultPacking; /**< Default params */
- /*@}*/
-
- /** \name Other assorted state (not pushed/popped on attribute stack) */
- /*@{*/
- struct gl_pixelmaps PixelMaps;
-
- struct gl_evaluators EvalMap; /**< All evaluators */
- struct gl_feedback Feedback; /**< Feedback */
- struct gl_selection Select; /**< Selection */
-
- struct gl_program_state Program; /**< general program state */
- struct gl_vertex_program_state VertexProgram;
- struct gl_fragment_program_state FragmentProgram;
- struct gl_geometry_program_state GeometryProgram;
- struct gl_ati_fragment_shader_state ATIFragmentShader;
-
- struct gl_shader_state Shader; /**< GLSL shader object state */
- struct gl_shader_compiler_options ShaderCompilerOptions[MESA_SHADER_TYPES];
-
- struct gl_query_state Query; /**< occlusion, timer queries */
-
- struct gl_transform_feedback TransformFeedback;
-
- struct gl_buffer_object *CopyReadBuffer; /**< GL_ARB_copy_buffer */
- struct gl_buffer_object *CopyWriteBuffer; /**< GL_ARB_copy_buffer */
- /*@}*/
-
- struct gl_meta_state *Meta; /**< for "meta" operations */
-
- /* GL_EXT_framebuffer_object */
- struct gl_renderbuffer *CurrentRenderbuffer;
-
- GLenum ErrorValue; /**< Last error code */
-
- /* GL_ARB_robustness */
- GLenum ResetStatus;
-
- /**
- * Recognize and silence repeated error debug messages in buggy apps.
- */
- const char *ErrorDebugFmtString;
- GLuint ErrorDebugCount;
-
- GLenum RenderMode; /**< either GL_RENDER, GL_SELECT, GL_FEEDBACK */
- GLbitfield NewState; /**< bitwise-or of _NEW_* flags */
-
- GLboolean ViewportInitialized; /**< has viewport size been initialized? */
-
- GLbitfield varying_vp_inputs; /**< mask of VERT_BIT_* flags */
-
- /** \name Derived state */
- /*@{*/
- /** Bitwise-or of DD_* flags. Note that this bitfield may be used before
- * state validation so they need to always be current.
- */
- GLbitfield _TriangleCaps;
- GLbitfield _ImageTransferState;/**< bitwise-or of IMAGE_*_BIT flags */
- GLfloat _EyeZDir[3];
- GLfloat _ModelViewInvScale;
- GLboolean _NeedEyeCoords;
- GLboolean _ForceEyeCoords;
-
- GLuint TextureStateTimestamp; /**< detect changes to shared state */
-
- struct gl_shine_tab *_ShineTable[2]; /**< Active shine tables */
- struct gl_shine_tab *_ShineTabList; /**< MRU list of inactive shine tables */
- /**@}*/
-
- struct gl_list_extensions *ListExt; /**< driver dlist extensions */
-
- /** \name For debugging/development only */
- /*@{*/
- GLboolean FirstTimeCurrent;
- /*@}*/
-
- /** software compression/decompression supported or not */
- GLboolean Mesa_DXTn;
-
- GLboolean TextureFormatSupported[MESA_FORMAT_COUNT];
-
- /**
- * Use dp4 (rather than mul/mad) instructions for position
- * transformation?
- */
- GLboolean mvp_with_dp4;
-
- /**
- * \name Hooks for module contexts.
- *
- * These will eventually live in the driver or elsewhere.
- */
- /*@{*/
- void *swrast_context;
- void *swsetup_context;
- void *swtnl_context;
- void *swtnl_im;
- struct st_context *st;
- void *aelt_context;
- /*@}*/
-};
-
-
-#ifdef DEBUG
-extern int MESA_VERBOSE;
-extern int MESA_DEBUG_FLAGS;
-# define MESA_FUNCTION __FUNCTION__
-#else
-# define MESA_VERBOSE 0
-# define MESA_DEBUG_FLAGS 0
-# define MESA_FUNCTION "a function"
-# ifndef NDEBUG
-# define NDEBUG
-# endif
-#endif
-
-
-/** The MESA_VERBOSE var is a bitmask of these flags */
-enum _verbose
-{
- VERBOSE_VARRAY = 0x0001,
- VERBOSE_TEXTURE = 0x0002,
- VERBOSE_MATERIAL = 0x0004,
- VERBOSE_PIPELINE = 0x0008,
- VERBOSE_DRIVER = 0x0010,
- VERBOSE_STATE = 0x0020,
- VERBOSE_API = 0x0040,
- VERBOSE_DISPLAY_LIST = 0x0100,
- VERBOSE_LIGHTING = 0x0200,
- VERBOSE_PRIMS = 0x0400,
- VERBOSE_VERTS = 0x0800,
- VERBOSE_DISASSEM = 0x1000,
- VERBOSE_DRAW = 0x2000,
- VERBOSE_SWAPBUFFERS = 0x4000
-};
-
-
-/** The MESA_DEBUG_FLAGS var is a bitmask of these flags */
-enum _debug
-{
- DEBUG_ALWAYS_FLUSH = 0x1
-};
-
-
-
-#endif /* MTYPES_H */
+/*
+ * Mesa 3-D graphics library
+ * Version: 7.7
+ *
+ * Copyright (C) 1999-2008 Brian Paul All Rights Reserved.
+ * Copyright (C) 2009 VMware, Inc. All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+/**
+ * \file mtypes.h
+ * Main Mesa data structures.
+ *
+ * Please try to mark derived values with a leading underscore ('_').
+ */
+
+#ifndef MTYPES_H
+#define MTYPES_H
+
+
+#include "main/glheader.h"
+#include "main/config.h"
+#include "main/mfeatures.h"
+#include "glapi/glapi.h"
+#include "math/m_matrix.h" /* GLmatrix */
+#include "main/simple_list.h" /* struct simple_node */
+#include "main/formats.h" /* MESA_FORMAT_COUNT */
+
+
+/**
+ * Color channel data type.
+ */
+#if CHAN_BITS == 8
+ typedef GLubyte GLchan;
+#define CHAN_MAX 255
+#define CHAN_MAXF 255.0F
+#define CHAN_TYPE GL_UNSIGNED_BYTE
+#elif CHAN_BITS == 16
+ typedef GLushort GLchan;
+#define CHAN_MAX 65535
+#define CHAN_MAXF 65535.0F
+#define CHAN_TYPE GL_UNSIGNED_SHORT
+#elif CHAN_BITS == 32
+ typedef GLfloat GLchan;
+#define CHAN_MAX 1.0
+#define CHAN_MAXF 1.0F
+#define CHAN_TYPE GL_FLOAT
+#else
+#error "illegal number of color channel bits"
+#endif
+
+
+/**
+ * Stencil buffer data type.
+ */
+#if STENCIL_BITS==8
+ typedef GLubyte GLstencil;
+#elif STENCIL_BITS==16
+ typedef GLushort GLstencil;
+#else
+# error "illegal number of stencil bits"
+#endif
+
+
+/**
+ * \name 64-bit extension of GLbitfield.
+ */
+/*@{*/
+typedef GLuint64 GLbitfield64;
+
+/** Set a single bit */
+#define BITFIELD64_BIT(b) ((GLbitfield64)1 << (b))
+
+
+/**
+ * \name Some forward type declarations
+ */
+/*@{*/
+struct _mesa_HashTable;
+struct gl_attrib_node;
+struct gl_list_extensions;
+struct gl_meta_state;
+struct gl_pixelstore_attrib;
+struct gl_program_cache;
+struct gl_texture_format;
+struct gl_texture_image;
+struct gl_texture_object;
+struct gl_context;
+struct st_context;
+/*@}*/
+
+
+/** Extra draw modes beyond GL_POINTS, GL_TRIANGLE_FAN, etc */
+#define PRIM_OUTSIDE_BEGIN_END (GL_POLYGON+1)
+#define PRIM_INSIDE_UNKNOWN_PRIM (GL_POLYGON+2)
+#define PRIM_UNKNOWN (GL_POLYGON+3)
+
+
+/**
+ * Shader stages. Note that these will become 5 with tessellation.
+ * These MUST have the same values as gallium's PIPE_SHADER_*
+ */
+typedef enum
+{
+ MESA_SHADER_VERTEX = 0,
+ MESA_SHADER_FRAGMENT = 1,
+ MESA_SHADER_GEOMETRY = 2,
+ MESA_SHADER_TYPES = 3
+} gl_shader_type;
+
+
+
+/**
+ * Indexes for vertex program attributes.
+ * GL_NV_vertex_program aliases generic attributes over the conventional
+ * attributes. In GL_ARB_vertex_program shader the aliasing is optional.
+ * In GL_ARB_vertex_shader / OpenGL 2.0 the aliasing is disallowed (the
+ * generic attributes are distinct/separate).
+ */
+typedef enum
+{
+ VERT_ATTRIB_POS = 0,
+ VERT_ATTRIB_WEIGHT = 1,
+ VERT_ATTRIB_NORMAL = 2,
+ VERT_ATTRIB_COLOR0 = 3,
+ VERT_ATTRIB_COLOR1 = 4,
+ VERT_ATTRIB_FOG = 5,
+ VERT_ATTRIB_COLOR_INDEX = 6,
+ VERT_ATTRIB_POINT_SIZE = 6, /*alias*/
+ VERT_ATTRIB_EDGEFLAG = 7,
+ VERT_ATTRIB_TEX0 = 8,
+ VERT_ATTRIB_TEX1 = 9,
+ VERT_ATTRIB_TEX2 = 10,
+ VERT_ATTRIB_TEX3 = 11,
+ VERT_ATTRIB_TEX4 = 12,
+ VERT_ATTRIB_TEX5 = 13,
+ VERT_ATTRIB_TEX6 = 14,
+ VERT_ATTRIB_TEX7 = 15,
+ VERT_ATTRIB_GENERIC0 = 16,
+ VERT_ATTRIB_GENERIC1 = 17,
+ VERT_ATTRIB_GENERIC2 = 18,
+ VERT_ATTRIB_GENERIC3 = 19,
+ VERT_ATTRIB_GENERIC4 = 20,
+ VERT_ATTRIB_GENERIC5 = 21,
+ VERT_ATTRIB_GENERIC6 = 22,
+ VERT_ATTRIB_GENERIC7 = 23,
+ VERT_ATTRIB_GENERIC8 = 24,
+ VERT_ATTRIB_GENERIC9 = 25,
+ VERT_ATTRIB_GENERIC10 = 26,
+ VERT_ATTRIB_GENERIC11 = 27,
+ VERT_ATTRIB_GENERIC12 = 28,
+ VERT_ATTRIB_GENERIC13 = 29,
+ VERT_ATTRIB_GENERIC14 = 30,
+ VERT_ATTRIB_GENERIC15 = 31,
+ VERT_ATTRIB_MAX = 32
+} gl_vert_attrib;
+
+/**
+ * Bitflags for vertex attributes.
+ * These are used in bitfields in many places.
+ */
+/*@{*/
+#define VERT_BIT_POS (1 << VERT_ATTRIB_POS)
+#define VERT_BIT_WEIGHT (1 << VERT_ATTRIB_WEIGHT)
+#define VERT_BIT_NORMAL (1 << VERT_ATTRIB_NORMAL)
+#define VERT_BIT_COLOR0 (1 << VERT_ATTRIB_COLOR0)
+#define VERT_BIT_COLOR1 (1 << VERT_ATTRIB_COLOR1)
+#define VERT_BIT_FOG (1 << VERT_ATTRIB_FOG)
+#define VERT_BIT_COLOR_INDEX (1 << VERT_ATTRIB_COLOR_INDEX)
+#define VERT_BIT_EDGEFLAG (1 << VERT_ATTRIB_EDGEFLAG)
+#define VERT_BIT_TEX0 (1 << VERT_ATTRIB_TEX0)
+#define VERT_BIT_TEX1 (1 << VERT_ATTRIB_TEX1)
+#define VERT_BIT_TEX2 (1 << VERT_ATTRIB_TEX2)
+#define VERT_BIT_TEX3 (1 << VERT_ATTRIB_TEX3)
+#define VERT_BIT_TEX4 (1 << VERT_ATTRIB_TEX4)
+#define VERT_BIT_TEX5 (1 << VERT_ATTRIB_TEX5)
+#define VERT_BIT_TEX6 (1 << VERT_ATTRIB_TEX6)
+#define VERT_BIT_TEX7 (1 << VERT_ATTRIB_TEX7)
+#define VERT_BIT_GENERIC0 (1 << VERT_ATTRIB_GENERIC0)
+#define VERT_BIT_GENERIC1 (1 << VERT_ATTRIB_GENERIC1)
+#define VERT_BIT_GENERIC2 (1 << VERT_ATTRIB_GENERIC2)
+#define VERT_BIT_GENERIC3 (1 << VERT_ATTRIB_GENERIC3)
+#define VERT_BIT_GENERIC4 (1 << VERT_ATTRIB_GENERIC4)
+#define VERT_BIT_GENERIC5 (1 << VERT_ATTRIB_GENERIC5)
+#define VERT_BIT_GENERIC6 (1 << VERT_ATTRIB_GENERIC6)
+#define VERT_BIT_GENERIC7 (1 << VERT_ATTRIB_GENERIC7)
+#define VERT_BIT_GENERIC8 (1 << VERT_ATTRIB_GENERIC8)
+#define VERT_BIT_GENERIC9 (1 << VERT_ATTRIB_GENERIC9)
+#define VERT_BIT_GENERIC10 (1 << VERT_ATTRIB_GENERIC10)
+#define VERT_BIT_GENERIC11 (1 << VERT_ATTRIB_GENERIC11)
+#define VERT_BIT_GENERIC12 (1 << VERT_ATTRIB_GENERIC12)
+#define VERT_BIT_GENERIC13 (1 << VERT_ATTRIB_GENERIC13)
+#define VERT_BIT_GENERIC14 (1 << VERT_ATTRIB_GENERIC14)
+#define VERT_BIT_GENERIC15 (1 << VERT_ATTRIB_GENERIC15)
+
+#define VERT_BIT_TEX(u) (1 << (VERT_ATTRIB_TEX0 + (u)))
+#define VERT_BIT_GENERIC(g) (1 << (VERT_ATTRIB_GENERIC0 + (g)))
+/*@}*/
+
+
+/**
+ * Indexes for vertex program result attributes
+ */
+typedef enum
+{
+ VERT_RESULT_HPOS = 0,
+ VERT_RESULT_COL0 = 1,
+ VERT_RESULT_COL1 = 2,
+ VERT_RESULT_FOGC = 3,
+ VERT_RESULT_TEX0 = 4,
+ VERT_RESULT_TEX1 = 5,
+ VERT_RESULT_TEX2 = 6,
+ VERT_RESULT_TEX3 = 7,
+ VERT_RESULT_TEX4 = 8,
+ VERT_RESULT_TEX5 = 9,
+ VERT_RESULT_TEX6 = 10,
+ VERT_RESULT_TEX7 = 11,
+ VERT_RESULT_PSIZ = 12,
+ VERT_RESULT_BFC0 = 13,
+ VERT_RESULT_BFC1 = 14,
+ VERT_RESULT_EDGE = 15,
+ VERT_RESULT_VAR0 = 16, /**< shader varying */
+ VERT_RESULT_MAX = (VERT_RESULT_VAR0 + MAX_VARYING)
+} gl_vert_result;
+
+
+/*********************************************/
+
+/**
+ * Indexes for geometry program attributes.
+ */
+typedef enum
+{
+ GEOM_ATTRIB_POSITION = 0,
+ GEOM_ATTRIB_COLOR0 = 1,
+ GEOM_ATTRIB_COLOR1 = 2,
+ GEOM_ATTRIB_SECONDARY_COLOR0 = 3,
+ GEOM_ATTRIB_SECONDARY_COLOR1 = 4,
+ GEOM_ATTRIB_FOG_FRAG_COORD = 5,
+ GEOM_ATTRIB_POINT_SIZE = 6,
+ GEOM_ATTRIB_CLIP_VERTEX = 7,
+ GEOM_ATTRIB_PRIMITIVE_ID = 8,
+ GEOM_ATTRIB_TEX_COORD = 9,
+
+ GEOM_ATTRIB_VAR0 = 16,
+ GEOM_ATTRIB_MAX = (GEOM_ATTRIB_VAR0 + MAX_VARYING)
+} gl_geom_attrib;
+
+/**
+ * Bitflags for geometry attributes.
+ * These are used in bitfields in many places.
+ */
+/*@{*/
+#define GEOM_BIT_COLOR0 (1 << GEOM_ATTRIB_COLOR0)
+#define GEOM_BIT_COLOR1 (1 << GEOM_ATTRIB_COLOR1)
+#define GEOM_BIT_SCOLOR0 (1 << GEOM_ATTRIB_SECONDARY_COLOR0)
+#define GEOM_BIT_SCOLOR1 (1 << GEOM_ATTRIB_SECONDARY_COLOR1)
+#define GEOM_BIT_TEX_COORD (1 << GEOM_ATTRIB_TEX_COORD)
+#define GEOM_BIT_FOG_COORD (1 << GEOM_ATTRIB_FOG_FRAG_COORD)
+#define GEOM_BIT_POSITION (1 << GEOM_ATTRIB_POSITION)
+#define GEOM_BIT_POINT_SIDE (1 << GEOM_ATTRIB_POINT_SIZE)
+#define GEOM_BIT_CLIP_VERTEX (1 << GEOM_ATTRIB_CLIP_VERTEX)
+#define GEOM_BIT_PRIM_ID (1 << GEOM_ATTRIB_PRIMITIVE_ID)
+#define GEOM_BIT_VAR0 (1 << GEOM_ATTRIB_VAR0)
+
+#define GEOM_BIT_VAR(g) (1 << (GEOM_BIT_VAR0 + (g)))
+/*@}*/
+
+
+/**
+ * Indexes for geometry program result attributes
+ */
+typedef enum
+{
+ GEOM_RESULT_POS = 0,
+ GEOM_RESULT_COL0 = 1,
+ GEOM_RESULT_COL1 = 2,
+ GEOM_RESULT_SCOL0 = 3,
+ GEOM_RESULT_SCOL1 = 4,
+ GEOM_RESULT_FOGC = 5,
+ GEOM_RESULT_TEX0 = 6,
+ GEOM_RESULT_TEX1 = 7,
+ GEOM_RESULT_TEX2 = 8,
+ GEOM_RESULT_TEX3 = 9,
+ GEOM_RESULT_TEX4 = 10,
+ GEOM_RESULT_TEX5 = 11,
+ GEOM_RESULT_TEX6 = 12,
+ GEOM_RESULT_TEX7 = 13,
+ GEOM_RESULT_PSIZ = 14,
+ GEOM_RESULT_CLPV = 15,
+ GEOM_RESULT_PRID = 16,
+ GEOM_RESULT_LAYR = 17,
+ GEOM_RESULT_VAR0 = 18, /**< shader varying, should really be 16 */
+ /* ### we need to -2 because var0 is 18 instead 16 like in the others */
+ GEOM_RESULT_MAX = (GEOM_RESULT_VAR0 + MAX_VARYING - 2)
+} gl_geom_result;
+
+
+/**
+ * Indexes for fragment program input attributes.
+ */
+typedef enum
+{
+ FRAG_ATTRIB_WPOS = 0,
+ FRAG_ATTRIB_COL0 = 1,
+ FRAG_ATTRIB_COL1 = 2,
+ FRAG_ATTRIB_FOGC = 3,
+ FRAG_ATTRIB_TEX0 = 4,
+ FRAG_ATTRIB_TEX1 = 5,
+ FRAG_ATTRIB_TEX2 = 6,
+ FRAG_ATTRIB_TEX3 = 7,
+ FRAG_ATTRIB_TEX4 = 8,
+ FRAG_ATTRIB_TEX5 = 9,
+ FRAG_ATTRIB_TEX6 = 10,
+ FRAG_ATTRIB_TEX7 = 11,
+ FRAG_ATTRIB_FACE = 12, /**< front/back face */
+ FRAG_ATTRIB_PNTC = 13, /**< sprite/point coord */
+ FRAG_ATTRIB_VAR0 = 14, /**< shader varying */
+ FRAG_ATTRIB_MAX = (FRAG_ATTRIB_VAR0 + MAX_VARYING)
+} gl_frag_attrib;
+
+/**
+ * Bitflags for fragment program input attributes.
+ */
+/*@{*/
+#define FRAG_BIT_WPOS (1 << FRAG_ATTRIB_WPOS)
+#define FRAG_BIT_COL0 (1 << FRAG_ATTRIB_COL0)
+#define FRAG_BIT_COL1 (1 << FRAG_ATTRIB_COL1)
+#define FRAG_BIT_FOGC (1 << FRAG_ATTRIB_FOGC)
+#define FRAG_BIT_FACE (1 << FRAG_ATTRIB_FACE)
+#define FRAG_BIT_PNTC (1 << FRAG_ATTRIB_PNTC)
+#define FRAG_BIT_TEX0 (1 << FRAG_ATTRIB_TEX0)
+#define FRAG_BIT_TEX1 (1 << FRAG_ATTRIB_TEX1)
+#define FRAG_BIT_TEX2 (1 << FRAG_ATTRIB_TEX2)
+#define FRAG_BIT_TEX3 (1 << FRAG_ATTRIB_TEX3)
+#define FRAG_BIT_TEX4 (1 << FRAG_ATTRIB_TEX4)
+#define FRAG_BIT_TEX5 (1 << FRAG_ATTRIB_TEX5)
+#define FRAG_BIT_TEX6 (1 << FRAG_ATTRIB_TEX6)
+#define FRAG_BIT_TEX7 (1 << FRAG_ATTRIB_TEX7)
+#define FRAG_BIT_VAR0 (1 << FRAG_ATTRIB_VAR0)
+
+#define FRAG_BIT_TEX(U) (FRAG_BIT_TEX0 << (U))
+#define FRAG_BIT_VAR(V) (FRAG_BIT_VAR0 << (V))
+
+#define FRAG_BITS_TEX_ANY (FRAG_BIT_TEX0| \
+ FRAG_BIT_TEX1| \
+ FRAG_BIT_TEX2| \
+ FRAG_BIT_TEX3| \
+ FRAG_BIT_TEX4| \
+ FRAG_BIT_TEX5| \
+ FRAG_BIT_TEX6| \
+ FRAG_BIT_TEX7)
+/*@}*/
+
+
+/**
+ * Fragment program results
+ */
+typedef enum
+{
+ FRAG_RESULT_DEPTH = 0,
+ FRAG_RESULT_STENCIL = 1,
+ /* If a single color should be written to all render targets, this
+ * register is written. No FRAG_RESULT_DATAn will be written.
+ */
+ FRAG_RESULT_COLOR = 2,
+
+ /* FRAG_RESULT_DATAn are the per-render-target (GLSL gl_FragData[n]
+ * or ARB_fragment_program fragment.color[n]) color results. If
+ * any are written, FRAG_RESULT_COLOR will not be written.
+ */
+ FRAG_RESULT_DATA0 = 3,
+ FRAG_RESULT_MAX = (FRAG_RESULT_DATA0 + MAX_DRAW_BUFFERS)
+} gl_frag_result;
+
+
+/**
+ * Indexes for all renderbuffers
+ */
+typedef enum
+{
+ /* the four standard color buffers */
+ BUFFER_FRONT_LEFT,
+ BUFFER_BACK_LEFT,
+ BUFFER_FRONT_RIGHT,
+ BUFFER_BACK_RIGHT,
+ BUFFER_DEPTH,
+ BUFFER_STENCIL,
+ BUFFER_ACCUM,
+ /* optional aux buffer */
+ BUFFER_AUX0,
+ /* generic renderbuffers */
+ BUFFER_COLOR0,
+ BUFFER_COLOR1,
+ BUFFER_COLOR2,
+ BUFFER_COLOR3,
+ BUFFER_COLOR4,
+ BUFFER_COLOR5,
+ BUFFER_COLOR6,
+ BUFFER_COLOR7,
+ BUFFER_COUNT
+} gl_buffer_index;
+
+/**
+ * Bit flags for all renderbuffers
+ */
+#define BUFFER_BIT_FRONT_LEFT (1 << BUFFER_FRONT_LEFT)
+#define BUFFER_BIT_BACK_LEFT (1 << BUFFER_BACK_LEFT)
+#define BUFFER_BIT_FRONT_RIGHT (1 << BUFFER_FRONT_RIGHT)
+#define BUFFER_BIT_BACK_RIGHT (1 << BUFFER_BACK_RIGHT)
+#define BUFFER_BIT_AUX0 (1 << BUFFER_AUX0)
+#define BUFFER_BIT_AUX1 (1 << BUFFER_AUX1)
+#define BUFFER_BIT_AUX2 (1 << BUFFER_AUX2)
+#define BUFFER_BIT_AUX3 (1 << BUFFER_AUX3)
+#define BUFFER_BIT_DEPTH (1 << BUFFER_DEPTH)
+#define BUFFER_BIT_STENCIL (1 << BUFFER_STENCIL)
+#define BUFFER_BIT_ACCUM (1 << BUFFER_ACCUM)
+#define BUFFER_BIT_COLOR0 (1 << BUFFER_COLOR0)
+#define BUFFER_BIT_COLOR1 (1 << BUFFER_COLOR1)
+#define BUFFER_BIT_COLOR2 (1 << BUFFER_COLOR2)
+#define BUFFER_BIT_COLOR3 (1 << BUFFER_COLOR3)
+#define BUFFER_BIT_COLOR4 (1 << BUFFER_COLOR4)
+#define BUFFER_BIT_COLOR5 (1 << BUFFER_COLOR5)
+#define BUFFER_BIT_COLOR6 (1 << BUFFER_COLOR6)
+#define BUFFER_BIT_COLOR7 (1 << BUFFER_COLOR7)
+
+/**
+ * Mask of all the color buffer bits (but not accum).
+ */
+#define BUFFER_BITS_COLOR (BUFFER_BIT_FRONT_LEFT | \
+ BUFFER_BIT_BACK_LEFT | \
+ BUFFER_BIT_FRONT_RIGHT | \
+ BUFFER_BIT_BACK_RIGHT | \
+ BUFFER_BIT_AUX0 | \
+ BUFFER_BIT_COLOR0 | \
+ BUFFER_BIT_COLOR1 | \
+ BUFFER_BIT_COLOR2 | \
+ BUFFER_BIT_COLOR3 | \
+ BUFFER_BIT_COLOR4 | \
+ BUFFER_BIT_COLOR5 | \
+ BUFFER_BIT_COLOR6 | \
+ BUFFER_BIT_COLOR7)
+
+
+/**
+ * Framebuffer configuration (aka visual / pixelformat)
+ * Note: some of these fields should be boolean, but it appears that
+ * code in drivers/dri/common/util.c requires int-sized fields.
+ */
+struct gl_config
+{
+ GLboolean rgbMode;
+ GLboolean floatMode;
+ GLboolean colorIndexMode; /* XXX is this used anywhere? */
+ GLuint doubleBufferMode;
+ GLuint stereoMode;
+
+ GLboolean haveAccumBuffer;
+ GLboolean haveDepthBuffer;
+ GLboolean haveStencilBuffer;
+
+ GLint redBits, greenBits, blueBits, alphaBits; /* bits per comp */
+ GLuint redMask, greenMask, blueMask, alphaMask;
+ GLint rgbBits; /* total bits for rgb */
+ GLint indexBits; /* total bits for colorindex */
+
+ GLint accumRedBits, accumGreenBits, accumBlueBits, accumAlphaBits;
+ GLint depthBits;
+ GLint stencilBits;
+
+ GLint numAuxBuffers;
+
+ GLint level;
+
+ /* EXT_visual_rating / GLX 1.2 */
+ GLint visualRating;
+
+ /* EXT_visual_info / GLX 1.2 */
+ GLint transparentPixel;
+ /* colors are floats scaled to ints */
+ GLint transparentRed, transparentGreen, transparentBlue, transparentAlpha;
+ GLint transparentIndex;
+
+ /* ARB_multisample / SGIS_multisample */
+ GLint sampleBuffers;
+ GLint samples;
+
+ /* SGIX_pbuffer / GLX 1.3 */
+ GLint maxPbufferWidth;
+ GLint maxPbufferHeight;
+ GLint maxPbufferPixels;
+ GLint optimalPbufferWidth; /* Only for SGIX_pbuffer. */
+ GLint optimalPbufferHeight; /* Only for SGIX_pbuffer. */
+
+ /* OML_swap_method */
+ GLint swapMethod;
+
+ /* EXT_texture_from_pixmap */
+ GLint bindToTextureRgb;
+ GLint bindToTextureRgba;
+ GLint bindToMipmapTexture;
+ GLint bindToTextureTargets;
+ GLint yInverted;
+
+ /* EXT_framebuffer_sRGB */
+ GLint sRGBCapable;
+};
+
+
+/**
+ * Data structure for color tables
+ */
+struct gl_color_table
+{
+ GLenum InternalFormat; /**< The user-specified format */
+ GLenum _BaseFormat; /**< GL_ALPHA, GL_RGBA, GL_RGB, etc */
+ GLuint Size; /**< number of entries in table */
+ GLfloat *TableF; /**< Color table, floating point values */
+ GLubyte *TableUB; /**< Color table, ubyte values */
+ GLubyte RedSize;
+ GLubyte GreenSize;
+ GLubyte BlueSize;
+ GLubyte AlphaSize;
+ GLubyte LuminanceSize;
+ GLubyte IntensitySize;
+};
+
+
+/**
+ * \name Bit flags used for updating material values.
+ */
+/*@{*/
+#define MAT_ATTRIB_FRONT_AMBIENT 0
+#define MAT_ATTRIB_BACK_AMBIENT 1
+#define MAT_ATTRIB_FRONT_DIFFUSE 2
+#define MAT_ATTRIB_BACK_DIFFUSE 3
+#define MAT_ATTRIB_FRONT_SPECULAR 4
+#define MAT_ATTRIB_BACK_SPECULAR 5
+#define MAT_ATTRIB_FRONT_EMISSION 6
+#define MAT_ATTRIB_BACK_EMISSION 7
+#define MAT_ATTRIB_FRONT_SHININESS 8
+#define MAT_ATTRIB_BACK_SHININESS 9
+#define MAT_ATTRIB_FRONT_INDEXES 10
+#define MAT_ATTRIB_BACK_INDEXES 11
+#define MAT_ATTRIB_MAX 12
+
+#define MAT_ATTRIB_AMBIENT(f) (MAT_ATTRIB_FRONT_AMBIENT+(f))
+#define MAT_ATTRIB_DIFFUSE(f) (MAT_ATTRIB_FRONT_DIFFUSE+(f))
+#define MAT_ATTRIB_SPECULAR(f) (MAT_ATTRIB_FRONT_SPECULAR+(f))
+#define MAT_ATTRIB_EMISSION(f) (MAT_ATTRIB_FRONT_EMISSION+(f))
+#define MAT_ATTRIB_SHININESS(f)(MAT_ATTRIB_FRONT_SHININESS+(f))
+#define MAT_ATTRIB_INDEXES(f) (MAT_ATTRIB_FRONT_INDEXES+(f))
+
+#define MAT_INDEX_AMBIENT 0
+#define MAT_INDEX_DIFFUSE 1
+#define MAT_INDEX_SPECULAR 2
+
+#define MAT_BIT_FRONT_AMBIENT (1<<MAT_ATTRIB_FRONT_AMBIENT)
+#define MAT_BIT_BACK_AMBIENT (1<<MAT_ATTRIB_BACK_AMBIENT)
+#define MAT_BIT_FRONT_DIFFUSE (1<<MAT_ATTRIB_FRONT_DIFFUSE)
+#define MAT_BIT_BACK_DIFFUSE (1<<MAT_ATTRIB_BACK_DIFFUSE)
+#define MAT_BIT_FRONT_SPECULAR (1<<MAT_ATTRIB_FRONT_SPECULAR)
+#define MAT_BIT_BACK_SPECULAR (1<<MAT_ATTRIB_BACK_SPECULAR)
+#define MAT_BIT_FRONT_EMISSION (1<<MAT_ATTRIB_FRONT_EMISSION)
+#define MAT_BIT_BACK_EMISSION (1<<MAT_ATTRIB_BACK_EMISSION)
+#define MAT_BIT_FRONT_SHININESS (1<<MAT_ATTRIB_FRONT_SHININESS)
+#define MAT_BIT_BACK_SHININESS (1<<MAT_ATTRIB_BACK_SHININESS)
+#define MAT_BIT_FRONT_INDEXES (1<<MAT_ATTRIB_FRONT_INDEXES)
+#define MAT_BIT_BACK_INDEXES (1<<MAT_ATTRIB_BACK_INDEXES)
+
+
+#define FRONT_MATERIAL_BITS (MAT_BIT_FRONT_EMISSION | \
+ MAT_BIT_FRONT_AMBIENT | \
+ MAT_BIT_FRONT_DIFFUSE | \
+ MAT_BIT_FRONT_SPECULAR | \
+ MAT_BIT_FRONT_SHININESS | \
+ MAT_BIT_FRONT_INDEXES)
+
+#define BACK_MATERIAL_BITS (MAT_BIT_BACK_EMISSION | \
+ MAT_BIT_BACK_AMBIENT | \
+ MAT_BIT_BACK_DIFFUSE | \
+ MAT_BIT_BACK_SPECULAR | \
+ MAT_BIT_BACK_SHININESS | \
+ MAT_BIT_BACK_INDEXES)
+
+#define ALL_MATERIAL_BITS (FRONT_MATERIAL_BITS | BACK_MATERIAL_BITS)
+/*@}*/
+
+
+#define EXP_TABLE_SIZE 512 /**< Specular exponent lookup table sizes */
+#define SHINE_TABLE_SIZE 256 /**< Material shininess lookup table sizes */
+
+/**
+ * Material shininess lookup table.
+ */
+struct gl_shine_tab
+{
+ struct gl_shine_tab *next, *prev;
+ GLfloat tab[SHINE_TABLE_SIZE+1];
+ GLfloat shininess;
+ GLuint refcount;
+};
+
+
+/**
+ * Light source state.
+ */
+struct gl_light
+{
+ struct gl_light *next; /**< double linked list with sentinel */
+ struct gl_light *prev;
+
+ GLfloat Ambient[4]; /**< ambient color */
+ GLfloat Diffuse[4]; /**< diffuse color */
+ GLfloat Specular[4]; /**< specular color */
+ GLfloat EyePosition[4]; /**< position in eye coordinates */
+ GLfloat SpotDirection[4]; /**< spotlight direction in eye coordinates */
+ GLfloat SpotExponent;
+ GLfloat SpotCutoff; /**< in degrees */
+ GLfloat _CosCutoffNeg; /**< = cos(SpotCutoff) */
+ GLfloat _CosCutoff; /**< = MAX(0, cos(SpotCutoff)) */
+ GLfloat ConstantAttenuation;
+ GLfloat LinearAttenuation;
+ GLfloat QuadraticAttenuation;
+ GLboolean Enabled; /**< On/off flag */
+
+ /**
+ * \name Derived fields
+ */
+ /*@{*/
+ GLbitfield _Flags; /**< State */
+
+ GLfloat _Position[4]; /**< position in eye/obj coordinates */
+ GLfloat _VP_inf_norm[3]; /**< Norm direction to infinite light */
+ GLfloat _h_inf_norm[3]; /**< Norm( _VP_inf_norm + <0,0,1> ) */
+ GLfloat _NormSpotDirection[4]; /**< normalized spotlight direction */
+ GLfloat _VP_inf_spot_attenuation;
+
+ GLfloat _SpotExpTable[EXP_TABLE_SIZE][2]; /**< to replace a pow() call */
+ GLfloat _MatAmbient[2][3]; /**< material ambient * light ambient */
+ GLfloat _MatDiffuse[2][3]; /**< material diffuse * light diffuse */
+ GLfloat _MatSpecular[2][3]; /**< material spec * light specular */
+ GLfloat _dli; /**< CI diffuse light intensity */
+ GLfloat _sli; /**< CI specular light intensity */
+ /*@}*/
+};
+
+
+/**
+ * Light model state.
+ */
+struct gl_lightmodel
+{
+ GLfloat Ambient[4]; /**< ambient color */
+ GLboolean LocalViewer; /**< Local (or infinite) view point? */
+ GLboolean TwoSide; /**< Two (or one) sided lighting? */
+ GLenum ColorControl; /**< either GL_SINGLE_COLOR
+ * or GL_SEPARATE_SPECULAR_COLOR */
+};
+
+
+/**
+ * Material state.
+ */
+struct gl_material
+{
+ GLfloat Attrib[MAT_ATTRIB_MAX][4];
+};
+
+
+/**
+ * Accumulation buffer attribute group (GL_ACCUM_BUFFER_BIT)
+ */
+struct gl_accum_attrib
+{
+ GLfloat ClearColor[4]; /**< Accumulation buffer clear color */
+};
+
+
+/**
+ * Color buffer attribute group (GL_COLOR_BUFFER_BIT).
+ */
+struct gl_colorbuffer_attrib
+{
+ GLuint ClearIndex; /**< Index to use for glClear */
+ GLfloat ClearColorUnclamped[4]; /**< Color to use for glClear*/
+ GLclampf ClearColor[4]; /**< Color to use for glClear */
+
+ GLuint IndexMask; /**< Color index write mask */
+ GLubyte ColorMask[MAX_DRAW_BUFFERS][4];/**< Each flag is 0xff or 0x0 */
+
+ GLenum DrawBuffer[MAX_DRAW_BUFFERS]; /**< Which buffer to draw into */
+
+ /**
+ * \name alpha testing
+ */
+ /*@{*/
+ GLboolean AlphaEnabled; /**< Alpha test enabled flag */
+ GLenum AlphaFunc; /**< Alpha test function */
+ GLfloat AlphaRefUnclamped;
+ GLclampf AlphaRef; /**< Alpha reference value */
+ /*@}*/
+
+ /**
+ * \name Blending
+ */
+ /*@{*/
+ GLbitfield BlendEnabled; /**< Per-buffer blend enable flags */
+
+ /* NOTE: this does _not_ depend on fragment clamping or any other clamping control,
+ * only on the fixed-pointness of the render target.
+ * The query does however depend on fragment color clamping.
+ */
+ GLfloat BlendColorUnclamped[4]; /**< Blending color */
+ GLfloat BlendColor[4]; /**< Blending color */
+
+ struct
+ {
+ GLenum SrcRGB; /**< RGB blend source term */
+ GLenum DstRGB; /**< RGB blend dest term */
+ GLenum SrcA; /**< Alpha blend source term */
+ GLenum DstA; /**< Alpha blend dest term */
+ GLenum EquationRGB; /**< GL_ADD, GL_SUBTRACT, etc. */
+ GLenum EquationA; /**< GL_ADD, GL_SUBTRACT, etc. */
+ } Blend[MAX_DRAW_BUFFERS];
+ /** Are the blend func terms currently different for each buffer/target? */
+ GLboolean _BlendFuncPerBuffer;
+ /** Are the blend equations currently different for each buffer/target? */
+ GLboolean _BlendEquationPerBuffer;
+ /*@}*/
+
+ /**
+ * \name Logic op
+ */
+ /*@{*/
+ GLenum LogicOp; /**< Logic operator */
+ GLboolean IndexLogicOpEnabled; /**< Color index logic op enabled flag */
+ GLboolean ColorLogicOpEnabled; /**< RGBA logic op enabled flag */
+ GLboolean _LogicOpEnabled; /**< RGBA logic op + EXT_blend_logic_op enabled flag */
+ /*@}*/
+
+ GLboolean DitherFlag; /**< Dither enable flag */
+
+ GLenum ClampFragmentColor; /**< GL_TRUE, GL_FALSE or GL_FIXED_ONLY_ARB */
+ GLboolean _ClampFragmentColor; /** < with GL_FIXED_ONLY_ARB resolved */
+ GLenum ClampReadColor; /**< GL_TRUE, GL_FALSE or GL_FIXED_ONLY_ARB */
+ GLboolean _ClampReadColor; /** < with GL_FIXED_ONLY_ARB resolved */
+
+ GLboolean sRGBEnabled; /**< Framebuffer sRGB blending/updating requested */
+};
+
+
+/**
+ * Current attribute group (GL_CURRENT_BIT).
+ */
+struct gl_current_attrib
+{
+ /**
+ * \name Current vertex attributes.
+ * \note Values are valid only after FLUSH_VERTICES has been called.
+ * \note Index and Edgeflag current values are stored as floats in the
+ * SIX and SEVEN attribute slots.
+ */
+ GLfloat Attrib[VERT_ATTRIB_MAX][4]; /**< Position, color, texcoords, etc */
+
+ /**
+ * \name Current raster position attributes (always valid).
+ * \note This set of attributes is very similar to the SWvertex struct.
+ */
+ /*@{*/
+ GLfloat RasterPos[4];
+ GLfloat RasterDistance;
+ GLfloat RasterColor[4];
+ GLfloat RasterSecondaryColor[4];
+ GLfloat RasterTexCoords[MAX_TEXTURE_COORD_UNITS][4];
+ GLboolean RasterPosValid;
+ /*@}*/
+};
+
+
+/**
+ * Depth buffer attribute group (GL_DEPTH_BUFFER_BIT).
+ */
+struct gl_depthbuffer_attrib
+{
+ GLenum Func; /**< Function for depth buffer compare */
+ GLclampd Clear; /**< Value to clear depth buffer to */
+ GLboolean Test; /**< Depth buffering enabled flag */
+ GLboolean Mask; /**< Depth buffer writable? */
+ GLboolean BoundsTest; /**< GL_EXT_depth_bounds_test */
+ GLfloat BoundsMin, BoundsMax;/**< GL_EXT_depth_bounds_test */
+};
+
+
+/**
+ * Evaluator attribute group (GL_EVAL_BIT).
+ */
+struct gl_eval_attrib
+{
+ /**
+ * \name Enable bits
+ */
+ /*@{*/
+ GLboolean Map1Color4;
+ GLboolean Map1Index;
+ GLboolean Map1Normal;
+ GLboolean Map1TextureCoord1;
+ GLboolean Map1TextureCoord2;
+ GLboolean Map1TextureCoord3;
+ GLboolean Map1TextureCoord4;
+ GLboolean Map1Vertex3;
+ GLboolean Map1Vertex4;
+ GLboolean Map1Attrib[16]; /* GL_NV_vertex_program */
+ GLboolean Map2Color4;
+ GLboolean Map2Index;
+ GLboolean Map2Normal;
+ GLboolean Map2TextureCoord1;
+ GLboolean Map2TextureCoord2;
+ GLboolean Map2TextureCoord3;
+ GLboolean Map2TextureCoord4;
+ GLboolean Map2Vertex3;
+ GLboolean Map2Vertex4;
+ GLboolean Map2Attrib[16]; /* GL_NV_vertex_program */
+ GLboolean AutoNormal;
+ /*@}*/
+
+ /**
+ * \name Map Grid endpoints and divisions and calculated du values
+ */
+ /*@{*/
+ GLint MapGrid1un;
+ GLfloat MapGrid1u1, MapGrid1u2, MapGrid1du;
+ GLint MapGrid2un, MapGrid2vn;
+ GLfloat MapGrid2u1, MapGrid2u2, MapGrid2du;
+ GLfloat MapGrid2v1, MapGrid2v2, MapGrid2dv;
+ /*@}*/
+};
+
+
+/**
+ * Fog attribute group (GL_FOG_BIT).
+ */
+struct gl_fog_attrib
+{
+ GLboolean Enabled; /**< Fog enabled flag */
+ GLfloat ColorUnclamped[4]; /**< Fog color */
+ GLfloat Color[4]; /**< Fog color */
+ GLfloat Density; /**< Density >= 0.0 */
+ GLfloat Start; /**< Start distance in eye coords */
+ GLfloat End; /**< End distance in eye coords */
+ GLfloat Index; /**< Fog index */
+ GLenum Mode; /**< Fog mode */
+ GLboolean ColorSumEnabled;
+ GLenum FogCoordinateSource; /**< GL_EXT_fog_coord */
+ GLfloat _Scale; /**< (End == Start) ? 1.0 : 1.0 / (End - Start) */
+};
+
+
+/**
+ * \brief Layout qualifiers for gl_FragDepth.
+ *
+ * Extension AMD_conservative_depth allows gl_FragDepth to be redeclared with
+ * a layout qualifier.
+ *
+ * \see enum ir_depth_layout
+ */
+enum gl_frag_depth_layout {
+ FRAG_DEPTH_LAYOUT_NONE, /**< No layout is specified. */
+ FRAG_DEPTH_LAYOUT_ANY,
+ FRAG_DEPTH_LAYOUT_GREATER,
+ FRAG_DEPTH_LAYOUT_LESS,
+ FRAG_DEPTH_LAYOUT_UNCHANGED
+};
+
+
+/**
+ * Hint attribute group (GL_HINT_BIT).
+ *
+ * Values are always one of GL_FASTEST, GL_NICEST, or GL_DONT_CARE.
+ */
+struct gl_hint_attrib
+{
+ GLenum PerspectiveCorrection;
+ GLenum PointSmooth;
+ GLenum LineSmooth;
+ GLenum PolygonSmooth;
+ GLenum Fog;
+ GLenum ClipVolumeClipping; /**< GL_EXT_clip_volume_hint */
+ GLenum TextureCompression; /**< GL_ARB_texture_compression */
+ GLenum GenerateMipmap; /**< GL_SGIS_generate_mipmap */
+ GLenum FragmentShaderDerivative; /**< GL_ARB_fragment_shader */
+};
+
+/**
+ * Light state flags.
+ */
+/*@{*/
+#define LIGHT_SPOT 0x1
+#define LIGHT_LOCAL_VIEWER 0x2
+#define LIGHT_POSITIONAL 0x4
+#define LIGHT_NEED_VERTICES (LIGHT_POSITIONAL|LIGHT_LOCAL_VIEWER)
+/*@}*/
+
+
+/**
+ * Lighting attribute group (GL_LIGHT_BIT).
+ */
+struct gl_light_attrib
+{
+ struct gl_light Light[MAX_LIGHTS]; /**< Array of light sources */
+ struct gl_lightmodel Model; /**< Lighting model */
+
+ /**
+ * Must flush FLUSH_VERTICES before referencing:
+ */
+ /*@{*/
+ struct gl_material Material; /**< Includes front & back values */
+ /*@}*/
+
+ GLboolean Enabled; /**< Lighting enabled flag */
+ GLenum ShadeModel; /**< GL_FLAT or GL_SMOOTH */
+ GLenum ProvokingVertex; /**< GL_EXT_provoking_vertex */
+ GLenum ColorMaterialFace; /**< GL_FRONT, BACK or FRONT_AND_BACK */
+ GLenum ColorMaterialMode; /**< GL_AMBIENT, GL_DIFFUSE, etc */
+ GLbitfield ColorMaterialBitmask; /**< bitmask formed from Face and Mode */
+ GLboolean ColorMaterialEnabled;
+ GLenum ClampVertexColor;
+ GLboolean _ClampVertexColor;
+
+ struct gl_light EnabledList; /**< List sentinel */
+
+ /**
+ * Derived state for optimizations:
+ */
+ /*@{*/
+ GLboolean _NeedEyeCoords;
+ GLboolean _NeedVertices; /**< Use fast shader? */
+ GLbitfield _Flags; /**< LIGHT_* flags, see above */
+ GLfloat _BaseColor[2][3];
+ /*@}*/
+};
+
+
+/**
+ * Line attribute group (GL_LINE_BIT).
+ */
+struct gl_line_attrib
+{
+ GLboolean SmoothFlag; /**< GL_LINE_SMOOTH enabled? */
+ GLboolean StippleFlag; /**< GL_LINE_STIPPLE enabled? */
+ GLushort StipplePattern; /**< Stipple pattern */
+ GLint StippleFactor; /**< Stipple repeat factor */
+ GLfloat Width; /**< Line width */
+};
+
+
+/**
+ * Display list attribute group (GL_LIST_BIT).
+ */
+struct gl_list_attrib
+{
+ GLuint ListBase;
+};
+
+
+/**
+ * Multisample attribute group (GL_MULTISAMPLE_BIT).
+ */
+struct gl_multisample_attrib
+{
+ GLboolean Enabled;
+ GLboolean _Enabled; /**< true if Enabled and multisample buffer */
+ GLboolean SampleAlphaToCoverage;
+ GLboolean SampleAlphaToOne;
+ GLboolean SampleCoverage;
+ GLfloat SampleCoverageValue;
+ GLboolean SampleCoverageInvert;
+};
+
+
+/**
+ * A pixelmap (see glPixelMap)
+ */
+struct gl_pixelmap
+{
+ GLint Size;
+ GLfloat Map[MAX_PIXEL_MAP_TABLE];
+ GLubyte Map8[MAX_PIXEL_MAP_TABLE]; /**< converted to 8-bit color */
+};
+
+
+/**
+ * Collection of all pixelmaps
+ */
+struct gl_pixelmaps
+{
+ struct gl_pixelmap RtoR; /**< i.e. GL_PIXEL_MAP_R_TO_R */
+ struct gl_pixelmap GtoG;
+ struct gl_pixelmap BtoB;
+ struct gl_pixelmap AtoA;
+ struct gl_pixelmap ItoR;
+ struct gl_pixelmap ItoG;
+ struct gl_pixelmap ItoB;
+ struct gl_pixelmap ItoA;
+ struct gl_pixelmap ItoI;
+ struct gl_pixelmap StoS;
+};
+
+
+/**
+ * Pixel attribute group (GL_PIXEL_MODE_BIT).
+ */
+struct gl_pixel_attrib
+{
+ GLenum ReadBuffer; /**< source buffer for glRead/CopyPixels() */
+
+ /*--- Begin Pixel Transfer State ---*/
+ /* Fields are in the order in which they're applied... */
+
+ /** Scale & Bias (index shift, offset) */
+ /*@{*/
+ GLfloat RedBias, RedScale;
+ GLfloat GreenBias, GreenScale;
+ GLfloat BlueBias, BlueScale;
+ GLfloat AlphaBias, AlphaScale;
+ GLfloat DepthBias, DepthScale;
+ GLint IndexShift, IndexOffset;
+ /*@}*/
+
+ /* Pixel Maps */
+ /* Note: actual pixel maps are not part of this attrib group */
+ GLboolean MapColorFlag;
+ GLboolean MapStencilFlag;
+
+ /*--- End Pixel Transfer State ---*/
+
+ /** glPixelZoom */
+ GLfloat ZoomX, ZoomY;
+};
+
+
+/**
+ * Point attribute group (GL_POINT_BIT).
+ */
+struct gl_point_attrib
+{
+ GLboolean SmoothFlag; /**< True if GL_POINT_SMOOTH is enabled */
+ GLfloat Size; /**< User-specified point size */
+ GLfloat Params[3]; /**< GL_EXT_point_parameters */
+ GLfloat MinSize, MaxSize; /**< GL_EXT_point_parameters */
+ GLfloat Threshold; /**< GL_EXT_point_parameters */
+ GLboolean _Attenuated; /**< True if Params != [1, 0, 0] */
+ GLboolean PointSprite; /**< GL_NV/ARB_point_sprite */
+ GLboolean CoordReplace[MAX_TEXTURE_COORD_UNITS]; /**< GL_ARB_point_sprite*/
+ GLenum SpriteRMode; /**< GL_NV_point_sprite (only!) */
+ GLenum SpriteOrigin; /**< GL_ARB_point_sprite */
+};
+
+
+/**
+ * Polygon attribute group (GL_POLYGON_BIT).
+ */
+struct gl_polygon_attrib
+{
+ GLenum FrontFace; /**< Either GL_CW or GL_CCW */
+ GLenum FrontMode; /**< Either GL_POINT, GL_LINE or GL_FILL */
+ GLenum BackMode; /**< Either GL_POINT, GL_LINE or GL_FILL */
+ GLboolean _FrontBit; /**< 0=GL_CCW, 1=GL_CW */
+ GLboolean CullFlag; /**< Culling on/off flag */
+ GLboolean SmoothFlag; /**< True if GL_POLYGON_SMOOTH is enabled */
+ GLboolean StippleFlag; /**< True if GL_POLYGON_STIPPLE is enabled */
+ GLenum CullFaceMode; /**< Culling mode GL_FRONT or GL_BACK */
+ GLfloat OffsetFactor; /**< Polygon offset factor, from user */
+ GLfloat OffsetUnits; /**< Polygon offset units, from user */
+ GLboolean OffsetPoint; /**< Offset in GL_POINT mode */
+ GLboolean OffsetLine; /**< Offset in GL_LINE mode */
+ GLboolean OffsetFill; /**< Offset in GL_FILL mode */
+};
+
+
+/**
+ * Scissor attributes (GL_SCISSOR_BIT).
+ */
+struct gl_scissor_attrib
+{
+ GLboolean Enabled; /**< Scissor test enabled? */
+ GLint X, Y; /**< Lower left corner of box */
+ GLsizei Width, Height; /**< Size of box */
+};
+
+
+/**
+ * Stencil attribute group (GL_STENCIL_BUFFER_BIT).
+ *
+ * Three sets of stencil data are tracked so that OpenGL 2.0,
+ * GL_EXT_stencil_two_side, and GL_ATI_separate_stencil can all be supported
+ * simultaneously. In each of the stencil state arrays, element 0 corresponds
+ * to GL_FRONT. Element 1 corresponds to the OpenGL 2.0 /
+ * GL_ATI_separate_stencil GL_BACK state. Element 2 corresponds to the
+ * GL_EXT_stencil_two_side GL_BACK state.
+ *
+ * The derived value \c _BackFace is either 1 or 2 depending on whether or
+ * not GL_STENCIL_TEST_TWO_SIDE_EXT is enabled.
+ *
+ * The derived value \c _TestTwoSide is set when the front-face and back-face
+ * stencil state are different.
+ */
+struct gl_stencil_attrib
+{
+ GLboolean Enabled; /**< Enabled flag */
+ GLboolean TestTwoSide; /**< GL_EXT_stencil_two_side */
+ GLubyte ActiveFace; /**< GL_EXT_stencil_two_side (0 or 2) */
+ GLboolean _Enabled; /**< Enabled and stencil buffer present */
+ GLboolean _TestTwoSide;
+ GLubyte _BackFace; /**< Current back stencil state (1 or 2) */
+ GLenum Function[3]; /**< Stencil function */
+ GLenum FailFunc[3]; /**< Fail function */
+ GLenum ZPassFunc[3]; /**< Depth buffer pass function */
+ GLenum ZFailFunc[3]; /**< Depth buffer fail function */
+ GLint Ref[3]; /**< Reference value */
+ GLuint ValueMask[3]; /**< Value mask */
+ GLuint WriteMask[3]; /**< Write mask */
+ GLuint Clear; /**< Clear value */
+};
+
+
+/**
+ * An index for each type of texture object. These correspond to the GL
+ * texture target enums, such as GL_TEXTURE_2D, GL_TEXTURE_CUBE_MAP, etc.
+ * Note: the order is from highest priority to lowest priority.
+ */
+typedef enum
+{
+ TEXTURE_BUFFER_INDEX,
+ TEXTURE_2D_ARRAY_INDEX,
+ TEXTURE_1D_ARRAY_INDEX,
+ TEXTURE_CUBE_INDEX,
+ TEXTURE_3D_INDEX,
+ TEXTURE_RECT_INDEX,
+ TEXTURE_2D_INDEX,
+ TEXTURE_1D_INDEX,
+ NUM_TEXTURE_TARGETS
+} gl_texture_index;
+
+
+/**
+ * Bit flags for each type of texture object
+ * Used for Texture.Unit[]._ReallyEnabled flags.
+ */
+/*@{*/
+#define TEXTURE_BUFFER_BIT (1 << TEXTURE_BUFFER_INDEX)
+#define TEXTURE_2D_ARRAY_BIT (1 << TEXTURE_2D_ARRAY_INDEX)
+#define TEXTURE_1D_ARRAY_BIT (1 << TEXTURE_1D_ARRAY_INDEX)
+#define TEXTURE_CUBE_BIT (1 << TEXTURE_CUBE_INDEX)
+#define TEXTURE_3D_BIT (1 << TEXTURE_3D_INDEX)
+#define TEXTURE_RECT_BIT (1 << TEXTURE_RECT_INDEX)
+#define TEXTURE_2D_BIT (1 << TEXTURE_2D_INDEX)
+#define TEXTURE_1D_BIT (1 << TEXTURE_1D_INDEX)
+/*@}*/
+
+
+/**
+ * TexGenEnabled flags.
+ */
+/*@{*/
+#define S_BIT 1
+#define T_BIT 2
+#define R_BIT 4
+#define Q_BIT 8
+#define STR_BITS (S_BIT | T_BIT | R_BIT)
+/*@}*/
+
+
+/**
+ * Bit flag versions of the corresponding GL_ constants.
+ */
+/*@{*/
+#define TEXGEN_SPHERE_MAP 0x1
+#define TEXGEN_OBJ_LINEAR 0x2
+#define TEXGEN_EYE_LINEAR 0x4
+#define TEXGEN_REFLECTION_MAP_NV 0x8
+#define TEXGEN_NORMAL_MAP_NV 0x10
+
+#define TEXGEN_NEED_NORMALS (TEXGEN_SPHERE_MAP | \
+ TEXGEN_REFLECTION_MAP_NV | \
+ TEXGEN_NORMAL_MAP_NV)
+#define TEXGEN_NEED_EYE_COORD (TEXGEN_SPHERE_MAP | \
+ TEXGEN_REFLECTION_MAP_NV | \
+ TEXGEN_NORMAL_MAP_NV | \
+ TEXGEN_EYE_LINEAR)
+/*@}*/
+
+
+
+/** Tex-gen enabled for texture unit? */
+#define ENABLE_TEXGEN(unit) (1 << (unit))
+
+/** Non-identity texture matrix for texture unit? */
+#define ENABLE_TEXMAT(unit) (1 << (unit))
+
+
+/**
+ * Texel fetch function prototype. We use texel fetch functions to
+ * extract RGBA, color indexes and depth components out of 1D, 2D and 3D
+ * texture images. These functions help to isolate us from the gritty
+ * details of all the various texture image encodings.
+ *
+ * \param texImage texture image.
+ * \param col texel column.
+ * \param row texel row.
+ * \param img texel image level/layer.
+ * \param texelOut output texel (up to 4 GLchans)
+ */
+typedef void (*FetchTexelFuncC)( const struct gl_texture_image *texImage,
+ GLint col, GLint row, GLint img,
+ GLchan *texelOut );
+
+/**
+ * As above, but returns floats.
+ * Used for depth component images and for upcoming signed/float
+ * texture images.
+ */
+typedef void (*FetchTexelFuncF)( const struct gl_texture_image *texImage,
+ GLint col, GLint row, GLint img,
+ GLfloat *texelOut );
+
+
+typedef void (*StoreTexelFunc)(struct gl_texture_image *texImage,
+ GLint col, GLint row, GLint img,
+ const void *texel);
+
+
+/**
+ * Texture image state. Describes the dimensions of a texture image,
+ * the texel format and pointers to Texel Fetch functions.
+ */
+struct gl_texture_image
+{
+ GLint InternalFormat; /**< Internal format as given by the user */
+ GLenum _BaseFormat; /**< Either GL_RGB, GL_RGBA, GL_ALPHA,
+ * GL_LUMINANCE, GL_LUMINANCE_ALPHA,
+ * GL_INTENSITY, GL_COLOR_INDEX,
+ * GL_DEPTH_COMPONENT or GL_DEPTH_STENCIL_EXT
+ * only. Used for choosing TexEnv arithmetic.
+ */
+ gl_format TexFormat; /**< The actual texture memory format */
+
+ GLuint Border; /**< 0 or 1 */
+ GLuint Width; /**< = 2^WidthLog2 + 2*Border */
+ GLuint Height; /**< = 2^HeightLog2 + 2*Border */
+ GLuint Depth; /**< = 2^DepthLog2 + 2*Border */
+ GLuint Width2; /**< = Width - 2*Border */
+ GLuint Height2; /**< = Height - 2*Border */
+ GLuint Depth2; /**< = Depth - 2*Border */
+ GLuint WidthLog2; /**< = log2(Width2) */
+ GLuint HeightLog2; /**< = log2(Height2) */
+ GLuint DepthLog2; /**< = log2(Depth2) */
+ GLuint MaxLog2; /**< = MAX(WidthLog2, HeightLog2) */
+ GLfloat WidthScale; /**< used for mipmap LOD computation */
+ GLfloat HeightScale; /**< used for mipmap LOD computation */
+ GLfloat DepthScale; /**< used for mipmap LOD computation */
+ GLboolean IsClientData; /**< Data owned by client? */
+ GLboolean _IsPowerOfTwo; /**< Are all dimensions powers of two? */
+
+ struct gl_texture_object *TexObject; /**< Pointer back to parent object */
+
+ FetchTexelFuncC FetchTexelc; /**< GLchan texel fetch function pointer */
+ FetchTexelFuncF FetchTexelf; /**< Float texel fetch function pointer */
+
+ GLuint RowStride; /**< Padded width in units of texels */
+ GLuint *ImageOffsets; /**< if 3D texture: array [Depth] of offsets to
+ each 2D slice in 'Data', in texels */
+ GLvoid *Data; /**< Image data, accessed via FetchTexel() */
+
+ /**
+ * \name For device driver:
+ */
+ /*@{*/
+ void *DriverData; /**< Arbitrary device driver data */
+ /*@}*/
+};
+
+
+/**
+ * Indexes for cube map faces.
+ */
+typedef enum
+{
+ FACE_POS_X = 0,
+ FACE_NEG_X = 1,
+ FACE_POS_Y = 2,
+ FACE_NEG_Y = 3,
+ FACE_POS_Z = 4,
+ FACE_NEG_Z = 5,
+ MAX_FACES = 6
+} gl_face_index;
+
+
+/**
+ * Sampler object state. These objects are new with GL_ARB_sampler_objects
+ * and OpenGL 3.3. Legacy texture objects also contain a sampler object.
+ */
+struct gl_sampler_object
+{
+ GLuint Name;
+ GLint RefCount;
+
+ GLenum WrapS; /**< S-axis texture image wrap mode */
+ GLenum WrapT; /**< T-axis texture image wrap mode */
+ GLenum WrapR; /**< R-axis texture image wrap mode */
+ GLenum MinFilter; /**< minification filter */
+ GLenum MagFilter; /**< magnification filter */
+ union {
+ GLfloat f[4];
+ GLuint ui[4];
+ GLint i[4];
+ } BorderColor; /**< Interpreted according to texture format */
+ GLfloat MinLod; /**< min lambda, OpenGL 1.2 */
+ GLfloat MaxLod; /**< max lambda, OpenGL 1.2 */
+ GLfloat LodBias; /**< OpenGL 1.4 */
+ GLfloat MaxAnisotropy; /**< GL_EXT_texture_filter_anisotropic */
+ GLenum CompareMode; /**< GL_ARB_shadow */
+ GLenum CompareFunc; /**< GL_ARB_shadow */
+ GLfloat CompareFailValue; /**< GL_ARB_shadow_ambient */
+ GLenum sRGBDecode; /**< GL_DECODE_EXT or GL_SKIP_DECODE_EXT */
+ GLboolean CubeMapSeamless; /**< GL_AMD_seamless_cubemap_per_texture */
+
+ /* deprecated sampler state */
+ GLenum DepthMode; /**< GL_ARB_depth_texture */
+
+ /** Is the texture object complete with respect to this sampler? */
+ GLboolean _CompleteTexture;
+};
+
+
+/**
+ * Texture object state. Contains the array of mipmap images, border color,
+ * wrap modes, filter modes, shadow/texcompare state, and the per-texture
+ * color palette.
+ */
+struct gl_texture_object
+{
+ _glthread_Mutex Mutex; /**< for thread safety */
+ GLint RefCount; /**< reference count */
+ GLuint Name; /**< the user-visible texture object ID */
+ GLenum Target; /**< GL_TEXTURE_1D, GL_TEXTURE_2D, etc. */
+
+ struct gl_sampler_object Sampler;
+
+ GLfloat Priority; /**< in [0,1] */
+ GLint BaseLevel; /**< min mipmap level, OpenGL 1.2 */
+ GLint MaxLevel; /**< max mipmap level, OpenGL 1.2 */
+ GLint _MaxLevel; /**< actual max mipmap level (q in the spec) */
+ GLfloat _MaxLambda; /**< = _MaxLevel - BaseLevel (q - b in spec) */
+ GLint CropRect[4]; /**< GL_OES_draw_texture */
+ GLenum Swizzle[4]; /**< GL_EXT_texture_swizzle */
+ GLuint _Swizzle; /**< same as Swizzle, but SWIZZLE_* format */
+ GLboolean GenerateMipmap; /**< GL_SGIS_generate_mipmap */
+ GLboolean _Complete; /**< Is texture object complete? */
+ GLboolean _RenderToTexture; /**< Any rendering to this texture? */
+ GLboolean Purgeable; /**< Is the buffer purgeable under memory pressure? */
+
+ /** Actual texture images, indexed by [cube face] and [mipmap level] */
+ struct gl_texture_image *Image[MAX_FACES][MAX_TEXTURE_LEVELS];
+
+ /** GL_ARB_texture_buffer_object */
+ struct gl_buffer_object *BufferObject;
+ GLenum BufferObjectFormat;
+
+ /** GL_EXT_paletted_texture */
+ struct gl_color_table Palette;
+
+ /**
+ * \name For device driver.
+ * Note: instead of attaching driver data to this pointer, it's preferable
+ * to instead use this struct as a base class for your own texture object
+ * class. Driver->NewTextureObject() can be used to implement the
+ * allocation.
+ */
+ void *DriverData; /**< Arbitrary device driver data */
+};
+
+
+/** Up to four combiner sources are possible with GL_NV_texture_env_combine4 */
+#define MAX_COMBINER_TERMS 4
+
+
+/**
+ * Texture combine environment state.
+ */
+struct gl_tex_env_combine_state
+{
+ GLenum ModeRGB; /**< GL_REPLACE, GL_DECAL, GL_ADD, etc. */
+ GLenum ModeA; /**< GL_REPLACE, GL_DECAL, GL_ADD, etc. */
+ /** Source terms: GL_PRIMARY_COLOR, GL_TEXTURE, etc */
+ GLenum SourceRGB[MAX_COMBINER_TERMS];
+ GLenum SourceA[MAX_COMBINER_TERMS];
+ /** Source operands: GL_SRC_COLOR, GL_ONE_MINUS_SRC_COLOR, etc */
+ GLenum OperandRGB[MAX_COMBINER_TERMS];
+ GLenum OperandA[MAX_COMBINER_TERMS];
+ GLuint ScaleShiftRGB; /**< 0, 1 or 2 */
+ GLuint ScaleShiftA; /**< 0, 1 or 2 */
+ GLuint _NumArgsRGB; /**< Number of inputs used for the RGB combiner */
+ GLuint _NumArgsA; /**< Number of inputs used for the A combiner */
+};
+
+
+/**
+ * Texture coord generation state.
+ */
+struct gl_texgen
+{
+ GLenum Mode; /**< GL_EYE_LINEAR, GL_SPHERE_MAP, etc */
+ GLbitfield _ModeBit; /**< TEXGEN_x bit corresponding to Mode */
+ GLfloat ObjectPlane[4];
+ GLfloat EyePlane[4];
+};
+
+
+/**
+ * Texture unit state. Contains enable flags, texture environment/function/
+ * combiners, texgen state, pointers to current texture objects and
+ * post-filter color tables.
+ */
+struct gl_texture_unit
+{
+ GLbitfield Enabled; /**< bitmask of TEXTURE_*_BIT flags */
+ GLbitfield _ReallyEnabled; /**< 0 or exactly one of TEXTURE_*_BIT flags */
+
+ GLenum EnvMode; /**< GL_MODULATE, GL_DECAL, GL_BLEND, etc. */
+ GLclampf EnvColor[4];
+ GLfloat EnvColorUnclamped[4];
+
+ struct gl_texgen GenS;
+ struct gl_texgen GenT;
+ struct gl_texgen GenR;
+ struct gl_texgen GenQ;
+ GLbitfield TexGenEnabled; /**< Bitwise-OR of [STRQ]_BIT values */
+ GLbitfield _GenFlags; /**< Bitwise-OR of Gen[STRQ]._ModeBit */
+
+ GLfloat LodBias; /**< for biasing mipmap levels */
+ GLenum BumpTarget;
+ GLfloat RotMatrix[4]; /* 2x2 matrix */
+
+ /** Current sampler object (GL_ARB_sampler_objects) */
+ struct gl_sampler_object *Sampler;
+
+ /**
+ * \name GL_EXT_texture_env_combine
+ */
+ struct gl_tex_env_combine_state Combine;
+
+ /**
+ * Derived state based on \c EnvMode and the \c BaseFormat of the
+ * currently enabled texture.
+ */
+ struct gl_tex_env_combine_state _EnvMode;
+
+ /**
+ * Currently enabled combiner state. This will point to either
+ * \c Combine or \c _EnvMode.
+ */
+ struct gl_tex_env_combine_state *_CurrentCombine;
+
+ /** Current texture object pointers */
+ struct gl_texture_object *CurrentTex[NUM_TEXTURE_TARGETS];
+
+ /** Points to highest priority, complete and enabled texture object */
+ struct gl_texture_object *_Current;
+};
+
+
+/**
+ * Texture attribute group (GL_TEXTURE_BIT).
+ */
+struct gl_texture_attrib
+{
+ GLuint CurrentUnit; /**< GL_ACTIVE_TEXTURE */
+ struct gl_texture_unit Unit[MAX_COMBINED_TEXTURE_IMAGE_UNITS];
+
+ struct gl_texture_object *ProxyTex[NUM_TEXTURE_TARGETS];
+
+ /** GL_ARB_texture_buffer_object */
+ struct gl_buffer_object *BufferObject;
+
+ /** GL_ARB_seamless_cubemap */
+ GLboolean CubeMapSeamless;
+
+ /** GL_EXT_shared_texture_palette */
+ GLboolean SharedPalette;
+ struct gl_color_table Palette;
+
+ /** Texture units/samplers used by vertex or fragment texturing */
+ GLbitfield _EnabledUnits;
+
+ /** Texture coord units/sets used for fragment texturing */
+ GLbitfield _EnabledCoordUnits;
+
+ /** Texture coord units that have texgen enabled */
+ GLbitfield _TexGenEnabled;
+
+ /** Texture coord units that have non-identity matrices */
+ GLbitfield _TexMatEnabled;
+
+ /** Bitwise-OR of all Texture.Unit[i]._GenFlags */
+ GLbitfield _GenFlags;
+};
+
+
+/**
+ * Transformation attribute group (GL_TRANSFORM_BIT).
+ */
+struct gl_transform_attrib
+{
+ GLenum MatrixMode; /**< Matrix mode */
+ GLfloat EyeUserPlane[MAX_CLIP_PLANES][4]; /**< User clip planes */
+ GLfloat _ClipUserPlane[MAX_CLIP_PLANES][4]; /**< derived */
+ GLbitfield ClipPlanesEnabled; /**< on/off bitmask */
+ GLboolean Normalize; /**< Normalize all normals? */
+ GLboolean RescaleNormals; /**< GL_EXT_rescale_normal */
+ GLboolean RasterPositionUnclipped; /**< GL_IBM_rasterpos_clip */
+ GLboolean DepthClamp; /**< GL_ARB_depth_clamp */
+
+ GLfloat CullEyePos[4];
+ GLfloat CullObjPos[4];
+};
+
+
+/**
+ * Viewport attribute group (GL_VIEWPORT_BIT).
+ */
+struct gl_viewport_attrib
+{
+ GLint X, Y; /**< position */
+ GLsizei Width, Height; /**< size */
+ GLfloat Near, Far; /**< Depth buffer range */
+ GLmatrix _WindowMap; /**< Mapping transformation as a matrix. */
+};
+
+
+/**
+ * GL_ARB_vertex/pixel_buffer_object buffer object
+ */
+struct gl_buffer_object
+{
+ _glthread_Mutex Mutex;
+ GLint RefCount;
+ GLuint Name;
+ GLenum Usage; /**< GL_STREAM_DRAW_ARB, GL_STREAM_READ_ARB, etc. */
+ GLsizeiptrARB Size; /**< Size of buffer storage in bytes */
+ GLubyte *Data; /**< Location of storage either in RAM or VRAM. */
+ /** Fields describing a mapped buffer */
+ /*@{*/
+ GLbitfield AccessFlags; /**< Mask of GL_MAP_x_BIT flags */
+ GLvoid *Pointer; /**< User-space address of mapping */
+ GLintptr Offset; /**< Mapped offset */
+ GLsizeiptr Length; /**< Mapped length */
+ /*@}*/
+ GLboolean Written; /**< Ever written to? (for debugging) */
+ GLboolean Purgeable; /**< Is the buffer purgeable under memory pressure? */
+};
+
+
+/**
+ * Client pixel packing/unpacking attributes
+ */
+struct gl_pixelstore_attrib
+{
+ GLint Alignment;
+ GLint RowLength;
+ GLint SkipPixels;
+ GLint SkipRows;
+ GLint ImageHeight;
+ GLint SkipImages;
+ GLboolean SwapBytes;
+ GLboolean LsbFirst;
+ GLboolean ClientStorage; /**< GL_APPLE_client_storage */
+ GLboolean Invert; /**< GL_MESA_pack_invert */
+ struct gl_buffer_object *BufferObj; /**< GL_ARB_pixel_buffer_object */
+};
+
+
+/**
+ * Client vertex array attributes
+ */
+struct gl_client_array
+{
+ GLint Size; /**< components per element (1,2,3,4) */
+ GLenum Type; /**< datatype: GL_FLOAT, GL_INT, etc */
+ GLenum Format; /**< default: GL_RGBA, but may be GL_BGRA */
+ GLsizei Stride; /**< user-specified stride */
+ GLsizei StrideB; /**< actual stride in bytes */
+ const GLubyte *Ptr; /**< Points to array data */
+ GLboolean Enabled; /**< Enabled flag is a boolean */
+ GLboolean Normalized; /**< GL_ARB_vertex_program */
+ GLboolean Integer; /**< Integer-valued? */
+ GLuint InstanceDivisor; /**< GL_ARB_instanced_arrays */
+ GLuint _ElementSize; /**< size of each element in bytes */
+
+ struct gl_buffer_object *BufferObj;/**< GL_ARB_vertex_buffer_object */
+ GLuint _MaxElement; /**< max element index into array buffer + 1 */
+};
+
+
+/**
+ * Collection of vertex arrays. Defined by the GL_APPLE_vertex_array_object
+ * extension, but a nice encapsulation in any case.
+ */
+struct gl_array_object
+{
+ /** Name of the array object as received from glGenVertexArrayAPPLE. */
+ GLuint Name;
+
+ GLint RefCount;
+ _glthread_Mutex Mutex;
+ GLboolean VBOonly; /**< require all arrays to live in VBOs? */
+
+ /** Conventional vertex arrays */
+ /*@{*/
+ struct gl_client_array Vertex;
+ struct gl_client_array Weight;
+ struct gl_client_array Normal;
+ struct gl_client_array Color;
+ struct gl_client_array SecondaryColor;
+ struct gl_client_array FogCoord;
+ struct gl_client_array Index;
+ struct gl_client_array EdgeFlag;
+ struct gl_client_array TexCoord[MAX_TEXTURE_COORD_UNITS];
+ struct gl_client_array PointSize;
+ /*@}*/
+
+ /**
+ * Generic arrays for vertex programs/shaders.
+ * For NV vertex programs, these attributes alias and take priority
+ * over the conventional attribs above. For ARB vertex programs and
+ * GLSL vertex shaders, these attributes are separate.
+ */
+ struct gl_client_array VertexAttrib[MAX_VERTEX_GENERIC_ATTRIBS];
+
+ /** Mask of _NEW_ARRAY_* values indicating which arrays are enabled */
+ GLbitfield _Enabled;
+
+ /**
+ * Min of all enabled arrays' _MaxElement. When arrays reside inside VBOs
+ * we can determine the max legal (in bounds) glDrawElements array index.
+ */
+ GLuint _MaxElement;
+};
+
+
+/**
+ * Vertex array state
+ */
+struct gl_array_attrib
+{
+ /** Currently bound array object. See _mesa_BindVertexArrayAPPLE() */
+ struct gl_array_object *ArrayObj;
+
+ /** The default vertex array object */
+ struct gl_array_object *DefaultArrayObj;
+
+ /** Array objects (GL_ARB/APPLE_vertex_array_object) */
+ struct _mesa_HashTable *Objects;
+
+ GLint ActiveTexture; /**< Client Active Texture */
+ GLuint LockFirst; /**< GL_EXT_compiled_vertex_array */
+ GLuint LockCount; /**< GL_EXT_compiled_vertex_array */
+
+ /** GL 3.1 (slightly different from GL_NV_primitive_restart) */
+ GLboolean PrimitiveRestart;
+ GLuint RestartIndex;
+
+ GLbitfield NewState; /**< mask of _NEW_ARRAY_* values */
+ GLboolean RebindArrays; /**< whether the VBO module should rebind arrays */
+
+ /* GL_ARB_vertex_buffer_object */
+ struct gl_buffer_object *ArrayBufferObj;
+ struct gl_buffer_object *ElementArrayBufferObj;
+};
+
+
+/**
+ * Feedback buffer state
+ */
+struct gl_feedback
+{
+ GLenum Type;
+ GLbitfield _Mask; /**< FB_* bits */
+ GLfloat *Buffer;
+ GLuint BufferSize;
+ GLuint Count;
+};
+
+
+/**
+ * Selection buffer state
+ */
+struct gl_selection
+{
+ GLuint *Buffer; /**< selection buffer */
+ GLuint BufferSize; /**< size of the selection buffer */
+ GLuint BufferCount; /**< number of values in the selection buffer */
+ GLuint Hits; /**< number of records in the selection buffer */
+ GLuint NameStackDepth; /**< name stack depth */
+ GLuint NameStack[MAX_NAME_STACK_DEPTH]; /**< name stack */
+ GLboolean HitFlag; /**< hit flag */
+ GLfloat HitMinZ; /**< minimum hit depth */
+ GLfloat HitMaxZ; /**< maximum hit depth */
+};
+
+
+/**
+ * 1-D Evaluator control points
+ */
+struct gl_1d_map
+{
+ GLuint Order; /**< Number of control points */
+ GLfloat u1, u2, du; /**< u1, u2, 1.0/(u2-u1) */
+ GLfloat *Points; /**< Points to contiguous control points */
+};
+
+
+/**
+ * 2-D Evaluator control points
+ */
+struct gl_2d_map
+{
+ GLuint Uorder; /**< Number of control points in U dimension */
+ GLuint Vorder; /**< Number of control points in V dimension */
+ GLfloat u1, u2, du;
+ GLfloat v1, v2, dv;
+ GLfloat *Points; /**< Points to contiguous control points */
+};
+
+
+/**
+ * All evaluator control point state
+ */
+struct gl_evaluators
+{
+ /**
+ * \name 1-D maps
+ */
+ /*@{*/
+ struct gl_1d_map Map1Vertex3;
+ struct gl_1d_map Map1Vertex4;
+ struct gl_1d_map Map1Index;
+ struct gl_1d_map Map1Color4;
+ struct gl_1d_map Map1Normal;
+ struct gl_1d_map Map1Texture1;
+ struct gl_1d_map Map1Texture2;
+ struct gl_1d_map Map1Texture3;
+ struct gl_1d_map Map1Texture4;
+ struct gl_1d_map Map1Attrib[16]; /**< GL_NV_vertex_program */
+ /*@}*/
+
+ /**
+ * \name 2-D maps
+ */
+ /*@{*/
+ struct gl_2d_map Map2Vertex3;
+ struct gl_2d_map Map2Vertex4;
+ struct gl_2d_map Map2Index;
+ struct gl_2d_map Map2Color4;
+ struct gl_2d_map Map2Normal;
+ struct gl_2d_map Map2Texture1;
+ struct gl_2d_map Map2Texture2;
+ struct gl_2d_map Map2Texture3;
+ struct gl_2d_map Map2Texture4;
+ struct gl_2d_map Map2Attrib[16]; /**< GL_NV_vertex_program */
+ /*@}*/
+};
+
+
+/**
+ * Names of the various vertex/fragment program register files, etc.
+ *
+ * NOTE: first four tokens must fit into 2 bits (see t_vb_arbprogram.c)
+ * All values should fit in a 4-bit field.
+ *
+ * NOTE: PROGRAM_ENV_PARAM, PROGRAM_STATE_VAR, PROGRAM_NAMED_PARAM,
+ * PROGRAM_CONSTANT, and PROGRAM_UNIFORM can all be considered to
+ * be "uniform" variables since they can only be set outside glBegin/End.
+ * They're also all stored in the same Parameters array.
+ */
+typedef enum
+{
+ PROGRAM_TEMPORARY, /**< machine->Temporary[] */
+ PROGRAM_INPUT, /**< machine->Inputs[] */
+ PROGRAM_OUTPUT, /**< machine->Outputs[] */
+ PROGRAM_VARYING, /**< machine->Inputs[]/Outputs[] */
+ PROGRAM_LOCAL_PARAM, /**< gl_program->LocalParams[] */
+ PROGRAM_ENV_PARAM, /**< gl_program->Parameters[] */
+ PROGRAM_STATE_VAR, /**< gl_program->Parameters[] */
+ PROGRAM_NAMED_PARAM, /**< gl_program->Parameters[] */
+ PROGRAM_CONSTANT, /**< gl_program->Parameters[] */
+ PROGRAM_UNIFORM, /**< gl_program->Parameters[] */
+ PROGRAM_WRITE_ONLY, /**< A dummy, write-only register */
+ PROGRAM_ADDRESS, /**< machine->AddressReg */
+ PROGRAM_SAMPLER, /**< for shader samplers, compile-time only */
+ PROGRAM_SYSTEM_VALUE,/**< InstanceId, PrimitiveID, etc. */
+ PROGRAM_UNDEFINED, /**< Invalid/TBD value */
+ PROGRAM_FILE_MAX
+} gl_register_file;
+
+
+/**
+ * If the register file is PROGRAM_SYSTEM_VALUE, the register index will be
+ * one of these values.
+ */
+typedef enum
+{
+ SYSTEM_VALUE_FRONT_FACE, /**< Fragment shader only (not done yet) */
+ SYSTEM_VALUE_INSTANCE_ID, /**< Vertex shader only */
+ SYSTEM_VALUE_MAX /**< Number of values */
+} gl_system_value;
+
+
+/** Vertex and fragment instructions */
+struct prog_instruction;
+struct gl_program_parameter_list;
+struct gl_uniform_list;
+
+
+/**
+ * Base class for any kind of program object
+ */
+struct gl_program
+{
+ GLuint Id;
+ GLubyte *String; /**< Null-terminated program text */
+ GLint RefCount;
+ GLenum Target; /**< GL_VERTEX/FRAGMENT_PROGRAM_ARB, GL_FRAGMENT_PROGRAM_NV */
+ GLenum Format; /**< String encoding format */
+ GLboolean Resident;
+
+ struct prog_instruction *Instructions;
+
+ GLbitfield InputsRead; /**< Bitmask of which input regs are read */
+ GLbitfield64 OutputsWritten; /**< Bitmask of which output regs are written */
+ GLbitfield SystemValuesRead; /**< Bitmask of SYSTEM_VALUE_x inputs used */
+ GLbitfield InputFlags[MAX_PROGRAM_INPUTS]; /**< PROG_PARAM_BIT_x flags */
+ GLbitfield OutputFlags[MAX_PROGRAM_OUTPUTS]; /**< PROG_PARAM_BIT_x flags */
+ GLbitfield TexturesUsed[MAX_TEXTURE_UNITS]; /**< TEXTURE_x_BIT bitmask */
+ GLbitfield SamplersUsed; /**< Bitfield of which samplers are used */
+ GLbitfield ShadowSamplers; /**< Texture units used for shadow sampling. */
+
+
+ /** Named parameters, constants, etc. from program text */
+ struct gl_program_parameter_list *Parameters;
+ /** Numbered local parameters */
+ GLfloat LocalParams[MAX_PROGRAM_LOCAL_PARAMS][4];
+
+ /** Vertex/fragment shader varying vars */
+ struct gl_program_parameter_list *Varying;
+ /** Vertex program user-defined attributes */
+ struct gl_program_parameter_list *Attributes;
+
+ /** Map from sampler unit to texture unit (set by glUniform1i()) */
+ GLubyte SamplerUnits[MAX_SAMPLERS];
+ /** Which texture target is being sampled (TEXTURE_1D/2D/3D/etc_INDEX) */
+ gl_texture_index SamplerTargets[MAX_SAMPLERS];
+
+ /** Bitmask of which register files are read/written with indirect
+ * addressing. Mask of (1 << PROGRAM_x) bits.
+ */
+ GLbitfield IndirectRegisterFiles;
+
+ /** Logical counts */
+ /*@{*/
+ GLuint NumInstructions;
+ GLuint NumTemporaries;
+ GLuint NumParameters;
+ GLuint NumAttributes;
+ GLuint NumAddressRegs;
+ GLuint NumAluInstructions;
+ GLuint NumTexInstructions;
+ GLuint NumTexIndirections;
+ /*@}*/
+ /** Native, actual h/w counts */
+ /*@{*/
+ GLuint NumNativeInstructions;
+ GLuint NumNativeTemporaries;
+ GLuint NumNativeParameters;
+ GLuint NumNativeAttributes;
+ GLuint NumNativeAddressRegs;
+ GLuint NumNativeAluInstructions;
+ GLuint NumNativeTexInstructions;
+ GLuint NumNativeTexIndirections;
+ /*@}*/
+};
+
+
+/** Vertex program object */
+struct gl_vertex_program
+{
+ struct gl_program Base; /**< base class */
+ GLboolean IsNVProgram; /**< is this a GL_NV_vertex_program program? */
+ GLboolean IsPositionInvariant;
+};
+
+
+/** Geometry program object */
+struct gl_geometry_program
+{
+ struct gl_program Base; /**< base class */
+
+ GLint VerticesOut;
+ GLenum InputType; /**< GL_POINTS, GL_LINES, GL_LINES_ADJACENCY_ARB,
+ GL_TRIANGLES, or GL_TRIANGLES_ADJACENCY_ARB */
+ GLenum OutputType; /**< GL_POINTS, GL_LINE_STRIP or GL_TRIANGLE_STRIP */
+};
+
+
+/** Fragment program object */
+struct gl_fragment_program
+{
+ struct gl_program Base; /**< base class */
+ GLboolean UsesKill; /**< shader uses KIL instruction */
+ GLboolean OriginUpperLeft;
+ GLboolean PixelCenterInteger;
+ enum gl_frag_depth_layout FragDepthLayout;
+};
+
+
+/**
+ * State common to vertex and fragment programs.
+ */
+struct gl_program_state
+{
+ GLint ErrorPos; /* GL_PROGRAM_ERROR_POSITION_ARB/NV */
+ const char *ErrorString; /* GL_PROGRAM_ERROR_STRING_ARB/NV */
+};
+
+
+/**
+ * Context state for vertex programs.
+ */
+struct gl_vertex_program_state
+{
+ GLboolean Enabled; /**< User-set GL_VERTEX_PROGRAM_ARB/NV flag */
+ GLboolean _Enabled; /**< Enabled and _valid_ user program? */
+ GLboolean PointSizeEnabled; /**< GL_VERTEX_PROGRAM_POINT_SIZE_ARB/NV */
+ GLboolean TwoSideEnabled; /**< GL_VERTEX_PROGRAM_TWO_SIDE_ARB/NV */
+ struct gl_vertex_program *Current; /**< User-bound vertex program */
+
+ /** Currently enabled and valid vertex program (including internal
+ * programs, user-defined vertex programs and GLSL vertex shaders).
+ * This is the program we must use when rendering.
+ */
+ struct gl_vertex_program *_Current;
+
+ GLfloat Parameters[MAX_PROGRAM_ENV_PARAMS][4]; /**< Env params */
+
+ /* For GL_NV_vertex_program only: */
+ GLenum TrackMatrix[MAX_PROGRAM_ENV_PARAMS / 4];
+ GLenum TrackMatrixTransform[MAX_PROGRAM_ENV_PARAMS / 4];
+
+ /** Should fixed-function T&L be implemented with a vertex prog? */
+ GLboolean _MaintainTnlProgram;
+
+ /** Program to emulate fixed-function T&L (see above) */
+ struct gl_vertex_program *_TnlProgram;
+
+ /** Cache of fixed-function programs */
+ struct gl_program_cache *Cache;
+
+ GLboolean _Overriden;
+};
+
+
+/**
+ * Context state for geometry programs.
+ */
+struct gl_geometry_program_state
+{
+ GLboolean Enabled; /**< GL_ARB_GEOMETRY_SHADER4 */
+ GLboolean _Enabled; /**< Enabled and valid program? */
+ struct gl_geometry_program *Current; /**< user-bound geometry program */
+
+ /** Currently enabled and valid program (including internal programs
+ * and compiled shader programs).
+ */
+ struct gl_geometry_program *_Current;
+
+ GLfloat Parameters[MAX_PROGRAM_ENV_PARAMS][4]; /**< Env params */
+
+ /** Cache of fixed-function programs */
+ struct gl_program_cache *Cache;
+};
+
+/**
+ * Context state for fragment programs.
+ */
+struct gl_fragment_program_state
+{
+ GLboolean Enabled; /**< User-set fragment program enable flag */
+ GLboolean _Enabled; /**< Enabled and _valid_ user program? */
+ struct gl_fragment_program *Current; /**< User-bound fragment program */
+
+ /** Currently enabled and valid fragment program (including internal
+ * programs, user-defined fragment programs and GLSL fragment shaders).
+ * This is the program we must use when rendering.
+ */
+ struct gl_fragment_program *_Current;
+
+ GLfloat Parameters[MAX_PROGRAM_ENV_PARAMS][4]; /**< Env params */
+
+ /** Should fixed-function texturing be implemented with a fragment prog? */
+ GLboolean _MaintainTexEnvProgram;
+
+ /** Program to emulate fixed-function texture env/combine (see above) */
+ struct gl_fragment_program *_TexEnvProgram;
+
+ /** Cache of fixed-function programs */
+ struct gl_program_cache *Cache;
+};
+
+
+/**
+ * ATI_fragment_shader runtime state
+ */
+#define ATI_FS_INPUT_PRIMARY 0
+#define ATI_FS_INPUT_SECONDARY 1
+
+struct atifs_instruction;
+struct atifs_setupinst;
+
+/**
+ * ATI fragment shader
+ */
+struct ati_fragment_shader
+{
+ GLuint Id;
+ GLint RefCount;
+ struct atifs_instruction *Instructions[2];
+ struct atifs_setupinst *SetupInst[2];
+ GLfloat Constants[8][4];
+ GLbitfield LocalConstDef; /**< Indicates which constants have been set */
+ GLubyte numArithInstr[2];
+ GLubyte regsAssigned[2];
+ GLubyte NumPasses; /**< 1 or 2 */
+ GLubyte cur_pass;
+ GLubyte last_optype;
+ GLboolean interpinp1;
+ GLboolean isValid;
+ GLuint swizzlerq;
+};
+
+/**
+ * Context state for GL_ATI_fragment_shader
+ */
+struct gl_ati_fragment_shader_state
+{
+ GLboolean Enabled;
+ GLboolean _Enabled; /**< enabled and valid shader? */
+ GLboolean Compiling;
+ GLfloat GlobalConstants[8][4];
+ struct ati_fragment_shader *Current;
+};
+
+
+/**
+ * Occlusion/timer query object.
+ */
+struct gl_query_object
+{
+ GLenum Target; /**< The query target, when active */
+ GLuint Id; /**< hash table ID/name */
+ GLuint64EXT Result; /**< the counter */
+ GLboolean Active; /**< inside Begin/EndQuery */
+ GLboolean Ready; /**< result is ready? */
+};
+
+
+/**
+ * Context state for query objects.
+ */
+struct gl_query_state
+{
+ struct _mesa_HashTable *QueryObjects;
+ struct gl_query_object *CurrentOcclusionObject; /* GL_ARB_occlusion_query */
+ struct gl_query_object *CurrentTimerObject; /* GL_EXT_timer_query */
+
+ /** GL_NV_conditional_render */
+ struct gl_query_object *CondRenderQuery;
+
+ /** GL_EXT_transform_feedback */
+ struct gl_query_object *PrimitivesGenerated;
+ struct gl_query_object *PrimitivesWritten;
+
+ /** GL_ARB_timer_query */
+ struct gl_query_object *TimeElapsed;
+
+ GLenum CondRenderMode;
+};
+
+
+/** Sync object state */
+struct gl_sync_object {
+ struct simple_node link;
+ GLenum Type; /**< GL_SYNC_FENCE */
+ GLuint Name; /**< Fence name */
+ GLint RefCount; /**< Reference count */
+ GLboolean DeletePending; /**< Object was deleted while there were still
+ * live references (e.g., sync not yet finished)
+ */
+ GLenum SyncCondition;
+ GLbitfield Flags; /**< Flags passed to glFenceSync */
+ GLuint StatusFlag:1; /**< Has the sync object been signaled? */
+};
+
+
+/** Set by #pragma directives */
+struct gl_sl_pragmas
+{
+ GLboolean IgnoreOptimize; /**< ignore #pragma optimize(on/off) ? */
+ GLboolean IgnoreDebug; /**< ignore #pragma debug(on/off) ? */
+ GLboolean Optimize; /**< defaults on */
+ GLboolean Debug; /**< defaults off */
+};
+
+
+/**
+ * A GLSL vertex or fragment shader object.
+ */
+struct gl_shader
+{
+ GLenum Type; /**< GL_FRAGMENT_SHADER || GL_VERTEX_SHADER || GL_GEOMETRY_SHADER_ARB (first field!) */
+ GLuint Name; /**< AKA the handle */
+ GLint RefCount; /**< Reference count */
+ GLboolean DeletePending;
+ GLboolean CompileStatus;
+ const GLchar *Source; /**< Source code string */
+ GLuint SourceChecksum; /**< for debug/logging purposes */
+ struct gl_program *Program; /**< Post-compile assembly code */
+ GLchar *InfoLog;
+ struct gl_sl_pragmas Pragmas;
+
+ unsigned Version; /**< GLSL version used for linking */
+
+ struct exec_list *ir;
+ struct glsl_symbol_table *symbols;
+
+ /** Shaders containing built-in functions that are used for linking. */
+ struct gl_shader *builtins_to_link[16];
+ unsigned num_builtins_to_link;
+};
+
+
+/**
+ * A GLSL program object.
+ * Basically a linked collection of vertex and fragment shaders.
+ */
+struct gl_shader_program
+{
+ GLenum Type; /**< Always GL_SHADER_PROGRAM (internal token) */
+ GLuint Name; /**< aka handle or ID */
+ GLint RefCount; /**< Reference count */
+ GLboolean DeletePending;
+
+ GLuint NumShaders; /**< number of attached shaders */
+ struct gl_shader **Shaders; /**< List of attached the shaders */
+
+ /** User-defined attribute bindings (glBindAttribLocation) */
+ struct gl_program_parameter_list *Attributes;
+
+ /** Transform feedback varyings */
+ struct {
+ GLenum BufferMode;
+ GLuint NumVarying;
+ GLchar **VaryingNames; /**< Array [NumVarying] of char * */
+ } TransformFeedback;
+
+ /** Geometry shader state - copied into gl_geometry_program at link time */
+ struct {
+ GLint VerticesOut;
+ GLenum InputType; /**< GL_POINTS, GL_LINES, GL_LINES_ADJACENCY_ARB,
+ GL_TRIANGLES, or GL_TRIANGLES_ADJACENCY_ARB */
+ GLenum OutputType; /**< GL_POINTS, GL_LINE_STRIP or GL_TRIANGLE_STRIP */
+ } Geom;
+
+ /* post-link info: */
+ struct gl_vertex_program *VertexProgram; /**< Linked vertex program */
+ struct gl_fragment_program *FragmentProgram; /**< Linked fragment prog */
+ struct gl_geometry_program *GeometryProgram; /**< Linked geometry prog */
+ struct gl_uniform_list *Uniforms;
+ struct gl_program_parameter_list *Varying;
+ GLboolean LinkStatus; /**< GL_LINK_STATUS */
+ GLboolean Validated;
+ GLboolean _Used; /**< Ever used for drawing? */
+ GLchar *InfoLog;
+
+ unsigned Version; /**< GLSL version used for linking */
+
+ /**
+ * Per-stage shaders resulting from the first stage of linking.
+ *
+ * Set of linked shaders for this program. The array is accessed using the
+ * \c MESA_SHADER_* defines. Entries for non-existent stages will be
+ * \c NULL.
+ */
+ struct gl_shader *_LinkedShaders[MESA_SHADER_TYPES];
+};
+
+
+#define GLSL_DUMP 0x1 /**< Dump shaders to stdout */
+#define GLSL_LOG 0x2 /**< Write shaders to files */
+#define GLSL_OPT 0x4 /**< Force optimizations (override pragmas) */
+#define GLSL_NO_OPT 0x8 /**< Force no optimizations (override pragmas) */
+#define GLSL_UNIFORMS 0x10 /**< Print glUniform calls */
+#define GLSL_NOP_VERT 0x20 /**< Force no-op vertex shaders */
+#define GLSL_NOP_FRAG 0x40 /**< Force no-op fragment shaders */
+#define GLSL_USE_PROG 0x80 /**< Log glUseProgram calls */
+
+
+/**
+ * Context state for GLSL vertex/fragment shaders.
+ */
+struct gl_shader_state
+{
+ /**
+ * Programs used for rendering
+ *
+ * There is a separate program set for each shader stage. If
+ * GL_EXT_separate_shader_objects is not supported, each of these must point
+ * to \c NULL or to the same program.
+ */
+ struct gl_shader_program *CurrentVertexProgram;
+ struct gl_shader_program *CurrentGeometryProgram;
+ struct gl_shader_program *CurrentFragmentProgram;
+
+ /**
+ * Program used by glUniform calls.
+ *
+ * Explicitly set by \c glUseProgram and \c glActiveProgramEXT.
+ */
+ struct gl_shader_program *ActiveProgram;
+
+ void *MemPool;
+
+ GLbitfield Flags; /**< Mask of GLSL_x flags */
+};
+
+/**
+ * Compiler options for a single GLSL shaders type
+ */
+struct gl_shader_compiler_options
+{
+ /** Driver-selectable options: */
+ GLboolean EmitCondCodes; /**< Use condition codes? */
+ GLboolean EmitNVTempInitialization; /**< 0-fill NV temp registers */
+ /**
+ * Attempts to flatten all ir_if (OPCODE_IF) for GPUs that can't
+ * support control flow.
+ */
+ GLboolean EmitNoIfs;
+ GLboolean EmitNoLoops;
+ GLboolean EmitNoFunctions;
+ GLboolean EmitNoCont; /**< Emit CONT opcode? */
+ GLboolean EmitNoMainReturn; /**< Emit CONT/RET opcodes? */
+ GLboolean EmitNoNoise; /**< Emit NOISE opcodes? */
+ GLboolean EmitNoPow; /**< Emit POW opcodes? */
+
+ /**
+ * \name Forms of indirect addressing the driver cannot do.
+ */
+ /*@{*/
+ GLboolean EmitNoIndirectInput; /**< No indirect addressing of inputs */
+ GLboolean EmitNoIndirectOutput; /**< No indirect addressing of outputs */
+ GLboolean EmitNoIndirectTemp; /**< No indirect addressing of temps */
+ GLboolean EmitNoIndirectUniform; /**< No indirect addressing of constants */
+ /*@}*/
+
+ GLuint MaxUnrollIterations;
+
+ struct gl_sl_pragmas DefaultPragmas; /**< Default #pragma settings */
+};
+
+/**
+ * Transform feedback object state
+ */
+struct gl_transform_feedback_object
+{
+ GLuint Name; /**< AKA the object ID */
+ GLint RefCount;
+ GLboolean Active; /**< Is transform feedback enabled? */
+ GLboolean Paused; /**< Is transform feedback paused? */
+
+ /** The feedback buffers */
+ GLuint BufferNames[MAX_FEEDBACK_ATTRIBS];
+ struct gl_buffer_object *Buffers[MAX_FEEDBACK_ATTRIBS];
+
+ /** Start of feedback data in dest buffer */
+ GLintptr Offset[MAX_FEEDBACK_ATTRIBS];
+ /** Max data to put into dest buffer (in bytes) */
+ GLsizeiptr Size[MAX_FEEDBACK_ATTRIBS];
+};
+
+
+/**
+ * Context state for transform feedback.
+ */
+struct gl_transform_feedback
+{
+ GLenum Mode; /**< GL_POINTS, GL_LINES or GL_TRIANGLES */
+
+ GLboolean RasterDiscard; /**< GL_RASTERIZER_DISCARD */
+
+ /** The general binding point (GL_TRANSFORM_FEEDBACK_BUFFER) */
+ struct gl_buffer_object *CurrentBuffer;
+
+ /** The table of all transform feedback objects */
+ struct _mesa_HashTable *Objects;
+
+ /** The current xform-fb object (GL_TRANSFORM_FEEDBACK_BINDING) */
+ struct gl_transform_feedback_object *CurrentObject;
+
+ /** The default xform-fb object (Name==0) */
+ struct gl_transform_feedback_object *DefaultObject;
+};
+
+
+
+/**
+ * State which can be shared by multiple contexts:
+ */
+struct gl_shared_state
+{
+ _glthread_Mutex Mutex; /**< for thread safety */
+ GLint RefCount; /**< Reference count */
+ struct _mesa_HashTable *DisplayList; /**< Display lists hash table */
+ struct _mesa_HashTable *TexObjects; /**< Texture objects hash table */
+
+ /** Default texture objects (shared by all texture units) */
+ struct gl_texture_object *DefaultTex[NUM_TEXTURE_TARGETS];
+
+ /** Fallback texture used when a bound texture is incomplete */
+ struct gl_texture_object *FallbackTex;
+
+ /**
+ * \name Thread safety and statechange notification for texture
+ * objects.
+ *
+ * \todo Improve the granularity of locking.
+ */
+ /*@{*/
+ _glthread_Mutex TexMutex; /**< texobj thread safety */
+ GLuint TextureStateStamp; /**< state notification for shared tex */
+ /*@}*/
+
+ /** Default buffer object for vertex arrays that aren't in VBOs */
+ struct gl_buffer_object *NullBufferObj;
+
+ /**
+ * \name Vertex/geometry/fragment programs
+ */
+ /*@{*/
+ struct _mesa_HashTable *Programs; /**< All vertex/fragment programs */
+ struct gl_vertex_program *DefaultVertexProgram;
+ struct gl_fragment_program *DefaultFragmentProgram;
+ struct gl_geometry_program *DefaultGeometryProgram;
+ /*@}*/
+
+ /* GL_ATI_fragment_shader */
+ struct _mesa_HashTable *ATIShaders;
+ struct ati_fragment_shader *DefaultFragmentShader;
+
+ struct _mesa_HashTable *BufferObjects;
+
+ /** Table of both gl_shader and gl_shader_program objects */
+ struct _mesa_HashTable *ShaderObjects;
+
+ /* GL_EXT_framebuffer_object */
+ struct _mesa_HashTable *RenderBuffers;
+ struct _mesa_HashTable *FrameBuffers;
+
+ /* GL_ARB_sync */
+ struct simple_node SyncObjects;
+
+ /** GL_ARB_sampler_objects */
+ struct _mesa_HashTable *SamplerObjects;
+
+ void *DriverData; /**< Device driver shared state */
+};
+
+
+
+
+/**
+ * A renderbuffer stores colors or depth values or stencil values.
+ * A framebuffer object will have a collection of these.
+ * Data are read/written to the buffer with a handful of Get/Put functions.
+ *
+ * Instances of this object are allocated with the Driver's NewRenderbuffer
+ * hook. Drivers will likely wrap this class inside a driver-specific
+ * class to simulate inheritance.
+ */
+struct gl_renderbuffer
+{
+ _glthread_Mutex Mutex; /**< for thread safety */
+ GLuint ClassID; /**< Useful for drivers */
+ GLuint Name;
+ GLint RefCount;
+ GLuint Width, Height;
+ GLint RowStride; /**< Padded width in units of pixels */
+ GLboolean Purgeable; /**< Is the buffer purgeable under memory pressure? */
+
+ GLboolean AttachedAnytime; /**< TRUE if it was attached to a framebuffer */
+
+ GLubyte NumSamples;
+
+ GLenum InternalFormat; /**< The user-specified format */
+ GLenum _BaseFormat; /**< Either GL_RGB, GL_RGBA, GL_DEPTH_COMPONENT or
+ GL_STENCIL_INDEX. */
+ gl_format Format; /**< The actual renderbuffer memory format */
+
+ GLenum DataType; /**< Type of values passed to the Get/Put functions */
+ GLvoid *Data; /**< This may not be used by some kinds of RBs */
+
+ /* Used to wrap one renderbuffer around another: */
+ struct gl_renderbuffer *Wrapped;
+
+ /* Delete this renderbuffer */
+ void (*Delete)(struct gl_renderbuffer *rb);
+
+ /* Allocate new storage for this renderbuffer */
+ GLboolean (*AllocStorage)(struct gl_context *ctx, struct gl_renderbuffer *rb,
+ GLenum internalFormat,
+ GLuint width, GLuint height);
+
+ /* Lock/Unlock are called before/after calling the Get/Put functions.
+ * Not sure this is the right place for these yet.
+ void (*Lock)(struct gl_context *ctx, struct gl_renderbuffer *rb);
+ void (*Unlock)(struct gl_context *ctx, struct gl_renderbuffer *rb);
+ */
+
+ /* Return a pointer to the element/pixel at (x,y).
+ * Should return NULL if the buffer memory can't be directly addressed.
+ */
+ void *(*GetPointer)(struct gl_context *ctx, struct gl_renderbuffer *rb,
+ GLint x, GLint y);
+
+ /* Get/Read a row of values.
+ * The values will be of format _BaseFormat and type DataType.
+ */
+ void (*GetRow)(struct gl_context *ctx, struct gl_renderbuffer *rb, GLuint count,
+ GLint x, GLint y, void *values);
+
+ /* Get/Read values at arbitrary locations.
+ * The values will be of format _BaseFormat and type DataType.
+ */
+ void (*GetValues)(struct gl_context *ctx, struct gl_renderbuffer *rb, GLuint count,
+ const GLint x[], const GLint y[], void *values);
+
+ /* Put/Write a row of values.
+ * The values will be of format _BaseFormat and type DataType.
+ */
+ void (*PutRow)(struct gl_context *ctx, struct gl_renderbuffer *rb, GLuint count,
+ GLint x, GLint y, const void *values, const GLubyte *mask);
+
+ /* Put/Write a row of RGB values. This is a special-case routine that's
+ * only used for RGBA renderbuffers when the source data is GL_RGB. That's
+ * a common case for glDrawPixels and some triangle routines.
+ * The values will be of format GL_RGB and type DataType.
+ */
+ void (*PutRowRGB)(struct gl_context *ctx, struct gl_renderbuffer *rb, GLuint count,
+ GLint x, GLint y, const void *values, const GLubyte *mask);
+
+
+ /* Put/Write a row of identical values.
+ * The values will be of format _BaseFormat and type DataType.
+ */
+ void (*PutMonoRow)(struct gl_context *ctx, struct gl_renderbuffer *rb, GLuint count,
+ GLint x, GLint y, const void *value, const GLubyte *mask);
+
+ /* Put/Write values at arbitrary locations.
+ * The values will be of format _BaseFormat and type DataType.
+ */
+ void (*PutValues)(struct gl_context *ctx, struct gl_renderbuffer *rb, GLuint count,
+ const GLint x[], const GLint y[], const void *values,
+ const GLubyte *mask);
+ /* Put/Write identical values at arbitrary locations.
+ * The values will be of format _BaseFormat and type DataType.
+ */
+ void (*PutMonoValues)(struct gl_context *ctx, struct gl_renderbuffer *rb,
+ GLuint count, const GLint x[], const GLint y[],
+ const void *value, const GLubyte *mask);
+};
+
+
+/**
+ * A renderbuffer attachment points to either a texture object (and specifies
+ * a mipmap level, cube face or 3D texture slice) or points to a renderbuffer.
+ */
+struct gl_renderbuffer_attachment
+{
+ GLenum Type; /**< \c GL_NONE or \c GL_TEXTURE or \c GL_RENDERBUFFER_EXT */
+ GLboolean Complete;
+
+ /**
+ * If \c Type is \c GL_RENDERBUFFER_EXT, this stores a pointer to the
+ * application supplied renderbuffer object.
+ */
+ struct gl_renderbuffer *Renderbuffer;
+
+ /**
+ * If \c Type is \c GL_TEXTURE, this stores a pointer to the application
+ * supplied texture object.
+ */
+ struct gl_texture_object *Texture;
+ GLuint TextureLevel; /**< Attached mipmap level. */
+ GLuint CubeMapFace; /**< 0 .. 5, for cube map textures. */
+ GLuint Zoffset; /**< Slice for 3D textures, or layer for both 1D
+ * and 2D array textures */
+};
+
+
+/**
+ * A framebuffer is a collection of renderbuffers (color, depth, stencil, etc).
+ * In C++ terms, think of this as a base class from which device drivers
+ * will make derived classes.
+ */
+struct gl_framebuffer
+{
+ _glthread_Mutex Mutex; /**< for thread safety */
+ /**
+ * If zero, this is a window system framebuffer. If non-zero, this
+ * is a FBO framebuffer; note that for some devices (i.e. those with
+ * a natural pixel coordinate system for FBOs that differs from the
+ * OpenGL/Mesa coordinate system), this means that the viewport,
+ * polygon face orientation, and polygon stipple will have to be inverted.
+ */
+ GLuint Name;
+
+ GLint RefCount;
+ GLboolean DeletePending;
+
+ /**
+ * The framebuffer's visual. Immutable if this is a window system buffer.
+ * Computed from attachments if user-made FBO.
+ */
+ struct gl_config Visual;
+
+ GLboolean Initialized;
+
+ GLuint Width, Height; /**< size of frame buffer in pixels */
+
+ /** \name Drawing bounds (Intersection of buffer size and scissor box) */
+ /*@{*/
+ GLint _Xmin, _Xmax; /**< inclusive */
+ GLint _Ymin, _Ymax; /**< exclusive */
+ /*@}*/
+
+ /** \name Derived Z buffer stuff */
+ /*@{*/
+ GLuint _DepthMax; /**< Max depth buffer value */
+ GLfloat _DepthMaxF; /**< Float max depth buffer value */
+ GLfloat _MRD; /**< minimum resolvable difference in Z values */
+ /*@}*/
+
+ /** One of the GL_FRAMEBUFFER_(IN)COMPLETE_* tokens */
+ GLenum _Status;
+
+ /** Integer color values */
+ GLboolean _IntegerColor;
+
+ /** Array of all renderbuffer attachments, indexed by BUFFER_* tokens. */
+ struct gl_renderbuffer_attachment Attachment[BUFFER_COUNT];
+
+ /* In unextended OpenGL these vars are part of the GL_COLOR_BUFFER
+ * attribute group and GL_PIXEL attribute group, respectively.
+ */
+ GLenum ColorDrawBuffer[MAX_DRAW_BUFFERS];
+ GLenum ColorReadBuffer;
+
+ /** Computed from ColorDraw/ReadBuffer above */
+ GLuint _NumColorDrawBuffers;
+ GLint _ColorDrawBufferIndexes[MAX_DRAW_BUFFERS]; /**< BUFFER_x or -1 */
+ GLint _ColorReadBufferIndex; /* -1 = None */
+ struct gl_renderbuffer *_ColorDrawBuffers[MAX_DRAW_BUFFERS];
+ struct gl_renderbuffer *_ColorReadBuffer;
+
+ /** The Actual depth/stencil buffers to use. May be wrappers around the
+ * depth/stencil buffers attached above. */
+ struct gl_renderbuffer *_DepthBuffer;
+ struct gl_renderbuffer *_StencilBuffer;
+
+ /** Delete this framebuffer */
+ void (*Delete)(struct gl_framebuffer *fb);
+};
+
+
+/**
+ * Precision info for shader datatypes. See glGetShaderPrecisionFormat().
+ */
+struct gl_precision
+{
+ GLushort RangeMin; /**< min value exponent */
+ GLushort RangeMax; /**< max value exponent */
+ GLushort Precision; /**< number of mantissa bits */
+};
+
+
+/**
+ * Limits for vertex, geometry and fragment programs/shaders.
+ */
+struct gl_program_constants
+{
+ /* logical limits */
+ GLuint MaxInstructions;
+ GLuint MaxAluInstructions;
+ GLuint MaxTexInstructions;
+ GLuint MaxTexIndirections;
+ GLuint MaxAttribs;
+ GLuint MaxTemps;
+ GLuint MaxAddressRegs;
+ GLuint MaxAddressOffset; /**< [-MaxAddressOffset, MaxAddressOffset-1] */
+ GLuint MaxParameters;
+ GLuint MaxLocalParams;
+ GLuint MaxEnvParams;
+ /* native/hardware limits */
+ GLuint MaxNativeInstructions;
+ GLuint MaxNativeAluInstructions;
+ GLuint MaxNativeTexInstructions;
+ GLuint MaxNativeTexIndirections;
+ GLuint MaxNativeAttribs;
+ GLuint MaxNativeTemps;
+ GLuint MaxNativeAddressRegs;
+ GLuint MaxNativeParameters;
+ /* For shaders */
+ GLuint MaxUniformComponents; /**< Usually == MaxParameters * 4 */
+ /* ES 2.0 and GL_ARB_ES2_compatibility */
+ struct gl_precision LowFloat, MediumFloat, HighFloat;
+ struct gl_precision LowInt, MediumInt, HighInt;
+};
+
+
+/**
+ * Constants which may be overridden by device driver during context creation
+ * but are never changed after that.
+ */
+struct gl_constants
+{
+ GLint MaxTextureMbytes; /**< Max memory per image, in MB */
+ GLint MaxTextureLevels; /**< Max mipmap levels. */
+ GLint Max3DTextureLevels; /**< Max mipmap levels for 3D textures */
+ GLint MaxCubeTextureLevels; /**< Max mipmap levels for cube textures */
+ GLint MaxArrayTextureLayers; /**< Max layers in array textures */
+ GLint MaxTextureRectSize; /**< Max rectangle texture size, in pixes */
+ GLuint MaxTextureCoordUnits;
+ GLuint MaxTextureImageUnits;
+ GLuint MaxVertexTextureImageUnits;
+ GLuint MaxCombinedTextureImageUnits;
+ GLuint MaxGeometryTextureImageUnits;
+ GLuint MaxTextureUnits; /**< = MIN(CoordUnits, ImageUnits) */
+ GLfloat MaxTextureMaxAnisotropy; /**< GL_EXT_texture_filter_anisotropic */
+ GLfloat MaxTextureLodBias; /**< GL_EXT_texture_lod_bias */
+ GLuint MaxTextureBufferSize; /**< GL_ARB_texture_buffer_object */
+
+ GLuint MaxArrayLockSize;
+
+ GLint SubPixelBits;
+
+ GLfloat MinPointSize, MaxPointSize; /**< aliased */
+ GLfloat MinPointSizeAA, MaxPointSizeAA; /**< antialiased */
+ GLfloat PointSizeGranularity;
+ GLfloat MinLineWidth, MaxLineWidth; /**< aliased */
+ GLfloat MinLineWidthAA, MaxLineWidthAA; /**< antialiased */
+ GLfloat LineWidthGranularity;
+
+ GLuint MaxColorTableSize;
+
+ GLuint MaxClipPlanes;
+ GLuint MaxLights;
+ GLfloat MaxShininess; /**< GL_NV_light_max_exponent */
+ GLfloat MaxSpotExponent; /**< GL_NV_light_max_exponent */
+
+ GLuint MaxViewportWidth, MaxViewportHeight;
+
+ struct gl_program_constants VertexProgram; /**< GL_ARB_vertex_program */
+ struct gl_program_constants FragmentProgram; /**< GL_ARB_fragment_program */
+ struct gl_program_constants GeometryProgram; /**< GL_ARB_geometry_shader4 */
+ GLuint MaxProgramMatrices;
+ GLuint MaxProgramMatrixStackDepth;
+
+ /** vertex array / buffer object bounds checking */
+ GLboolean CheckArrayBounds;
+
+ GLuint MaxDrawBuffers; /**< GL_ARB_draw_buffers */
+
+ GLuint MaxColorAttachments; /**< GL_EXT_framebuffer_object */
+ GLuint MaxRenderbufferSize; /**< GL_EXT_framebuffer_object */
+ GLuint MaxSamples; /**< GL_ARB_framebuffer_object */
+
+ /** Number of varying vectors between vertex and fragment shaders */
+ GLuint MaxVarying;
+ GLuint MaxVertexVaryingComponents; /**< Between vert and geom shader */
+ GLuint MaxGeometryVaryingComponents; /**< Between geom and frag shader */
+
+ /** GL_ARB_geometry_shader4 */
+ GLuint MaxGeometryOutputVertices;
+ GLuint MaxGeometryTotalOutputComponents;
+
+ GLuint GLSLVersion; /**< GLSL version supported (ex: 120 = 1.20) */
+
+ /** Which texture units support GL_ATI_envmap_bumpmap as targets */
+ GLbitfield SupportedBumpUnits;
+
+ /**
+ * Maximum amount of time, measured in nanseconds, that the server can wait.
+ */
+ GLuint64 MaxServerWaitTimeout;
+
+ /** GL_EXT_provoking_vertex */
+ GLboolean QuadsFollowProvokingVertexConvention;
+
+ /** OpenGL version 3.0 */
+ GLbitfield ContextFlags; /**< Ex: GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT */
+
+ /** OpenGL version 3.2 */
+ GLbitfield ProfileMask; /**< Mask of CONTEXT_x_PROFILE_BIT */
+
+ /** GL_EXT_transform_feedback */
+ GLuint MaxTransformFeedbackSeparateAttribs;
+ GLuint MaxTransformFeedbackSeparateComponents;
+ GLuint MaxTransformFeedbackInterleavedComponents;
+
+ /** GL_EXT_gpu_shader4 */
+ GLint MinProgramTexelOffset, MaxProgramTexelOffset;
+
+ /* GL_EXT_framebuffer_sRGB */
+ GLboolean sRGBCapable; /* can enable sRGB blend/update on FBOs */
+
+ /* GL_ARB_robustness */
+ GLenum ResetStrategy;
+};
+
+
+/**
+ * Enable flag for each OpenGL extension. Different device drivers will
+ * enable different extensions at runtime.
+ */
+struct gl_extensions
+{
+ GLboolean dummy; /* don't remove this! */
+ GLboolean dummy_true; /* Set true by _mesa_init_extensions(). */
+ GLboolean dummy_false; /* Set false by _mesa_init_extensions(). */
+ GLboolean ARB_ES2_compatibility;
+ GLboolean ARB_blend_func_extended;
+ GLboolean ARB_color_buffer_float;
+ GLboolean ARB_copy_buffer;
+ GLboolean ARB_depth_buffer_float;
+ GLboolean ARB_depth_clamp;
+ GLboolean ARB_depth_texture;
+ GLboolean ARB_draw_buffers;
+ GLboolean ARB_draw_buffers_blend;
+ GLboolean ARB_draw_elements_base_vertex;
+ GLboolean ARB_draw_instanced;
+ GLboolean ARB_fragment_coord_conventions;
+ GLboolean ARB_fragment_program;
+ GLboolean ARB_fragment_program_shadow;
+ GLboolean ARB_fragment_shader;
+ GLboolean ARB_framebuffer_object;
+ GLboolean ARB_explicit_attrib_location;
+ GLboolean ARB_geometry_shader4;
+ GLboolean ARB_half_float_pixel;
+ GLboolean ARB_half_float_vertex;
+ GLboolean ARB_instanced_arrays;
+ GLboolean ARB_map_buffer_range;
+ GLboolean ARB_multisample;
+ GLboolean ARB_multitexture;
+ GLboolean ARB_occlusion_query;
+ GLboolean ARB_occlusion_query2;
+ GLboolean ARB_point_sprite;
+ GLboolean ARB_sampler_objects;
+ GLboolean ARB_seamless_cube_map;
+ GLboolean ARB_shader_objects;
+ GLboolean ARB_shader_stencil_export;
+ GLboolean ARB_shader_texture_lod;
+ GLboolean ARB_shading_language_100;
+ GLboolean ARB_shadow;
+ GLboolean ARB_shadow_ambient;
+ GLboolean ARB_sync;
+ GLboolean ARB_texture_border_clamp;
+ GLboolean ARB_texture_buffer_object;
+ GLboolean ARB_texture_compression;
+ GLboolean ARB_texture_compression_rgtc;
+ GLboolean ARB_texture_cube_map;
+ GLboolean ARB_texture_env_combine;
+ GLboolean ARB_texture_env_crossbar;
+ GLboolean ARB_texture_env_dot3;
+ GLboolean ARB_texture_float;
+ GLboolean ARB_texture_mirrored_repeat;
+ GLboolean ARB_texture_multisample;
+ GLboolean ARB_texture_non_power_of_two;
+ GLboolean ARB_texture_rg;
+ GLboolean ARB_texture_rgb10_a2ui;
+ GLboolean ARB_timer_query;
+ GLboolean ARB_transform_feedback2;
+ GLboolean ARB_transpose_matrix;
+ GLboolean ARB_uniform_buffer_object;
+ GLboolean ARB_vertex_array_object;
+ GLboolean ARB_vertex_buffer_object;
+ GLboolean ARB_vertex_program;
+ GLboolean ARB_vertex_shader;
+ GLboolean ARB_vertex_type_2_10_10_10_rev;
+ GLboolean ARB_window_pos;
+ GLboolean EXT_abgr;
+ GLboolean EXT_bgra;
+ GLboolean EXT_blend_color;
+ GLboolean EXT_blend_equation_separate;
+ GLboolean EXT_blend_func_separate;
+ GLboolean EXT_blend_logic_op;
+ GLboolean EXT_blend_minmax;
+ GLboolean EXT_blend_subtract;
+ GLboolean EXT_clip_volume_hint;
+ GLboolean EXT_compiled_vertex_array;
+ GLboolean EXT_copy_texture;
+ GLboolean EXT_depth_bounds_test;
+ GLboolean EXT_draw_buffers2;
+ GLboolean EXT_draw_range_elements;
+ GLboolean EXT_fog_coord;
+ GLboolean EXT_framebuffer_blit;
+ GLboolean EXT_framebuffer_multisample;
+ GLboolean EXT_framebuffer_object;
+ GLboolean EXT_framebuffer_sRGB;
+ GLboolean EXT_gpu_program_parameters;
+ GLboolean EXT_gpu_shader4;
+ GLboolean EXT_multi_draw_arrays;
+ GLboolean EXT_paletted_texture;
+ GLboolean EXT_packed_depth_stencil;
+ GLboolean EXT_packed_float;
+ GLboolean EXT_packed_pixels;
+ GLboolean EXT_pixel_buffer_object;
+ GLboolean EXT_point_parameters;
+ GLboolean EXT_polygon_offset;
+ GLboolean EXT_provoking_vertex;
+ GLboolean EXT_rescale_normal;
+ GLboolean EXT_shadow_funcs;
+ GLboolean EXT_secondary_color;
+ GLboolean EXT_separate_shader_objects;
+ GLboolean EXT_separate_specular_color;
+ GLboolean EXT_shared_texture_palette;
+ GLboolean EXT_stencil_wrap;
+ GLboolean EXT_stencil_two_side;
+ GLboolean EXT_subtexture;
+ GLboolean EXT_texture;
+ GLboolean EXT_texture_object;
+ GLboolean EXT_texture3D;
+ GLboolean EXT_texture_array;
+ GLboolean EXT_texture_compression_latc;
+ GLboolean EXT_texture_compression_s3tc;
+ GLboolean EXT_texture_env_add;
+ GLboolean EXT_texture_env_combine;
+ GLboolean EXT_texture_env_dot3;
+ GLboolean EXT_texture_filter_anisotropic;
+ GLboolean EXT_texture_integer;
+ GLboolean EXT_texture_lod_bias;
+ GLboolean EXT_texture_mirror_clamp;
+ GLboolean EXT_texture_shared_exponent;
+ GLboolean EXT_texture_snorm;
+ GLboolean EXT_texture_sRGB;
+ GLboolean EXT_texture_sRGB_decode;
+ GLboolean EXT_texture_swizzle;
+ GLboolean EXT_transform_feedback;
+ GLboolean EXT_timer_query;
+ GLboolean EXT_vertex_array;
+ GLboolean EXT_vertex_array_bgra;
+ GLboolean EXT_vertex_array_set;
+ GLboolean OES_standard_derivatives;
+ /* vendor extensions */
+ GLboolean AMD_conservative_depth;
+ GLboolean AMD_seamless_cubemap_per_texture;
+ GLboolean APPLE_client_storage;
+ GLboolean APPLE_packed_pixels;
+ GLboolean APPLE_vertex_array_object;
+ GLboolean APPLE_object_purgeable;
+ GLboolean ATI_envmap_bumpmap;
+ GLboolean ATI_texture_compression_3dc;
+ GLboolean ATI_texture_mirror_once;
+ GLboolean ATI_texture_env_combine3;
+ GLboolean ATI_fragment_shader;
+ GLboolean ATI_separate_stencil;
+ GLboolean IBM_rasterpos_clip;
+ GLboolean IBM_multimode_draw_arrays;
+ GLboolean MESA_pack_invert;
+ GLboolean MESA_resize_buffers;
+ GLboolean MESA_ycbcr_texture;
+ GLboolean MESA_texture_array;
+ GLboolean NV_blend_square;
+ GLboolean NV_conditional_render;
+ GLboolean NV_fragment_program;
+ GLboolean NV_fragment_program_option;
+ GLboolean NV_light_max_exponent;
+ GLboolean NV_point_sprite;
+ GLboolean NV_primitive_restart;
+ GLboolean NV_texture_barrier;
+ GLboolean NV_texgen_reflection;
+ GLboolean NV_texture_env_combine4;
+ GLboolean NV_texture_rectangle;
+ GLboolean NV_vertex_program;
+ GLboolean NV_vertex_program1_1;
+ GLboolean OES_read_format;
+ GLboolean SGIS_generate_mipmap;
+ GLboolean SGIS_texture_edge_clamp;
+ GLboolean SGIS_texture_lod;
+ GLboolean TDFX_texture_compression_FXT1;
+ GLboolean S3_s3tc;
+ GLboolean OES_EGL_image;
+ GLboolean OES_draw_texture;
+ GLboolean EXT_texture_format_BGRA8888;
+ GLboolean extension_sentinel;
+ /** The extension string */
+ const GLubyte *String;
+ /** Number of supported extensions */
+ GLuint Count;
+};
+
+
+/**
+ * A stack of matrices (projection, modelview, color, texture, etc).
+ */
+struct gl_matrix_stack
+{
+ GLmatrix *Top; /**< points into Stack */
+ GLmatrix *Stack; /**< array [MaxDepth] of GLmatrix */
+ GLuint Depth; /**< 0 <= Depth < MaxDepth */
+ GLuint MaxDepth; /**< size of Stack[] array */
+ GLuint DirtyFlag; /**< _NEW_MODELVIEW or _NEW_PROJECTION, for example */
+};
+
+
+/**
+ * \name Bits for image transfer operations
+ * \sa __struct gl_contextRec::ImageTransferState.
+ */
+/*@{*/
+#define IMAGE_SCALE_BIAS_BIT 0x1
+#define IMAGE_SHIFT_OFFSET_BIT 0x2
+#define IMAGE_MAP_COLOR_BIT 0x4
+#define IMAGE_CLAMP_BIT 0x800
+
+
+/** Pixel Transfer ops */
+#define IMAGE_BITS (IMAGE_SCALE_BIAS_BIT | \
+ IMAGE_SHIFT_OFFSET_BIT | \
+ IMAGE_MAP_COLOR_BIT)
+
+/**
+ * \name Bits to indicate what state has changed.
+ */
+/*@{*/
+#define _NEW_MODELVIEW (1 << 0) /**< gl_context::ModelView */
+#define _NEW_PROJECTION (1 << 1) /**< gl_context::Projection */
+#define _NEW_TEXTURE_MATRIX (1 << 2) /**< gl_context::TextureMatrix */
+#define _NEW_COLOR (1 << 3) /**< gl_context::Color */
+#define _NEW_DEPTH (1 << 4) /**< gl_context::Depth */
+#define _NEW_EVAL (1 << 5) /**< gl_context::Eval, EvalMap */
+#define _NEW_FOG (1 << 6) /**< gl_context::Fog */
+#define _NEW_HINT (1 << 7) /**< gl_context::Hint */
+#define _NEW_LIGHT (1 << 8) /**< gl_context::Light */
+#define _NEW_LINE (1 << 9) /**< gl_context::Line */
+#define _NEW_PIXEL (1 << 10) /**< gl_context::Pixel */
+#define _NEW_POINT (1 << 11) /**< gl_context::Point */
+#define _NEW_POLYGON (1 << 12) /**< gl_context::Polygon */
+#define _NEW_POLYGONSTIPPLE (1 << 13) /**< gl_context::PolygonStipple */
+#define _NEW_SCISSOR (1 << 14) /**< gl_context::Scissor */
+#define _NEW_STENCIL (1 << 15) /**< gl_context::Stencil */
+#define _NEW_TEXTURE (1 << 16) /**< gl_context::Texture */
+#define _NEW_TRANSFORM (1 << 17) /**< gl_context::Transform */
+#define _NEW_VIEWPORT (1 << 18) /**< gl_context::Viewport */
+#define _NEW_PACKUNPACK (1 << 19) /**< gl_context::Pack, Unpack */
+#define _NEW_ARRAY (1 << 20) /**< gl_context::Array */
+#define _NEW_RENDERMODE (1 << 21) /**< gl_context::RenderMode, etc */
+#define _NEW_BUFFERS (1 << 22) /**< gl_context::Visual, DrawBuffer, */
+#define _NEW_CURRENT_ATTRIB (1 << 23) /**< gl_context::Current */
+#define _NEW_MULTISAMPLE (1 << 24) /**< gl_context::Multisample */
+#define _NEW_TRACK_MATRIX (1 << 25) /**< gl_context::VertexProgram */
+#define _NEW_PROGRAM (1 << 26) /**< New program/shader state */
+#define _NEW_PROGRAM_CONSTANTS (1 << 27)
+#define _NEW_BUFFER_OBJECT (1 << 28)
+#define _NEW_FRAG_CLAMP (1 << 29)
+#define _NEW_ALL ~0
+/*@}*/
+
+
+/**
+ * \name Bits to track array state changes
+ *
+ * Also used to summarize array enabled.
+ */
+/*@{*/
+#define _NEW_ARRAY_VERTEX VERT_BIT_POS
+#define _NEW_ARRAY_WEIGHT VERT_BIT_WEIGHT
+#define _NEW_ARRAY_NORMAL VERT_BIT_NORMAL
+#define _NEW_ARRAY_COLOR0 VERT_BIT_COLOR0
+#define _NEW_ARRAY_COLOR1 VERT_BIT_COLOR1
+#define _NEW_ARRAY_FOGCOORD VERT_BIT_FOG
+#define _NEW_ARRAY_INDEX VERT_BIT_COLOR_INDEX
+#define _NEW_ARRAY_EDGEFLAG VERT_BIT_EDGEFLAG
+#define _NEW_ARRAY_POINT_SIZE VERT_BIT_COLOR_INDEX /* aliased */
+#define _NEW_ARRAY_TEXCOORD_0 VERT_BIT_TEX0
+#define _NEW_ARRAY_TEXCOORD_1 VERT_BIT_TEX1
+#define _NEW_ARRAY_TEXCOORD_2 VERT_BIT_TEX2
+#define _NEW_ARRAY_TEXCOORD_3 VERT_BIT_TEX3
+#define _NEW_ARRAY_TEXCOORD_4 VERT_BIT_TEX4
+#define _NEW_ARRAY_TEXCOORD_5 VERT_BIT_TEX5
+#define _NEW_ARRAY_TEXCOORD_6 VERT_BIT_TEX6
+#define _NEW_ARRAY_TEXCOORD_7 VERT_BIT_TEX7
+#define _NEW_ARRAY_ATTRIB_0 VERT_BIT_GENERIC0 /* start at bit 16 */
+#define _NEW_ARRAY_ALL 0xffffffff
+
+
+#define _NEW_ARRAY_TEXCOORD(i) (_NEW_ARRAY_TEXCOORD_0 << (i))
+#define _NEW_ARRAY_ATTRIB(i) (_NEW_ARRAY_ATTRIB_0 << (i))
+/*@}*/
+
+
+
+/**
+ * \name A bunch of flags that we think might be useful to drivers.
+ *
+ * Set in the __struct gl_contextRec::_TriangleCaps bitfield.
+ */
+/*@{*/
+#define DD_FLATSHADE 0x1
+#define DD_SEPARATE_SPECULAR 0x2
+#define DD_TRI_CULL_FRONT_BACK 0x4 /* special case on some hw */
+#define DD_TRI_LIGHT_TWOSIDE 0x8
+#define DD_TRI_UNFILLED 0x10
+#define DD_TRI_SMOOTH 0x20
+#define DD_TRI_STIPPLE 0x40
+#define DD_TRI_OFFSET 0x80
+#define DD_LINE_SMOOTH 0x100
+#define DD_LINE_STIPPLE 0x200
+#define DD_POINT_SMOOTH 0x400
+#define DD_POINT_ATTEN 0x800
+#define DD_TRI_TWOSTENCIL 0x1000
+/*@}*/
+
+
+/**
+ * \name Define the state changes under which each of these bits might change
+ */
+/*@{*/
+#define _DD_NEW_FLATSHADE _NEW_LIGHT
+#define _DD_NEW_SEPARATE_SPECULAR (_NEW_LIGHT | _NEW_FOG | _NEW_PROGRAM)
+#define _DD_NEW_TRI_CULL_FRONT_BACK _NEW_POLYGON
+#define _DD_NEW_TRI_LIGHT_TWOSIDE _NEW_LIGHT
+#define _DD_NEW_TRI_UNFILLED _NEW_POLYGON
+#define _DD_NEW_TRI_SMOOTH _NEW_POLYGON
+#define _DD_NEW_TRI_STIPPLE _NEW_POLYGON
+#define _DD_NEW_TRI_OFFSET _NEW_POLYGON
+#define _DD_NEW_LINE_SMOOTH _NEW_LINE
+#define _DD_NEW_LINE_STIPPLE _NEW_LINE
+#define _DD_NEW_LINE_WIDTH _NEW_LINE
+#define _DD_NEW_POINT_SMOOTH _NEW_POINT
+#define _DD_NEW_POINT_SIZE _NEW_POINT
+#define _DD_NEW_POINT_ATTEN _NEW_POINT
+/*@}*/
+
+
+/**
+ * Composite state flags
+ */
+/*@{*/
+#define _MESA_NEW_NEED_EYE_COORDS (_NEW_LIGHT | \
+ _NEW_TEXTURE | \
+ _NEW_POINT | \
+ _NEW_PROGRAM | \
+ _NEW_MODELVIEW)
+/*@}*/
+
+
+
+
+/* This has to be included here. */
+#include "dd.h"
+
+
+/**
+ * Display list flags.
+ * Strictly this is a tnl-private concept, but it doesn't seem
+ * worthwhile adding a tnl private structure just to hold this one bit
+ * of information:
+ */
+#define DLIST_DANGLING_REFS 0x1
+
+
+/** Opaque declaration of display list payload data type */
+union gl_dlist_node;
+
+
+/**
+ * Provide a location where information about a display list can be
+ * collected. Could be extended with driverPrivate structures,
+ * etc. in the future.
+ */
+struct gl_display_list
+{
+ GLuint Name;
+ GLbitfield Flags; /**< DLIST_x flags */
+ /** The dlist commands are in a linked list of nodes */
+ union gl_dlist_node *Head;
+};
+
+
+/**
+ * State used during display list compilation and execution.
+ */
+struct gl_dlist_state
+{
+ GLuint CallDepth; /**< Current recursion calling depth */
+
+ struct gl_display_list *CurrentList; /**< List currently being compiled */
+ union gl_dlist_node *CurrentBlock; /**< Pointer to current block of nodes */
+ GLuint CurrentPos; /**< Index into current block of nodes */
+
+ GLvertexformat ListVtxfmt;
+
+ GLubyte ActiveAttribSize[VERT_ATTRIB_MAX];
+ GLfloat CurrentAttrib[VERT_ATTRIB_MAX][4];
+
+ GLubyte ActiveMaterialSize[MAT_ATTRIB_MAX];
+ GLfloat CurrentMaterial[MAT_ATTRIB_MAX][4];
+
+ GLubyte ActiveIndex;
+ GLfloat CurrentIndex;
+
+ GLubyte ActiveEdgeFlag;
+ GLboolean CurrentEdgeFlag;
+
+ struct {
+ /* State known to have been set by the currently-compiling display
+ * list. Used to eliminate some redundant state changes.
+ */
+ GLenum ShadeModel;
+ } Current;
+};
+
+
+/**
+ * Enum for the OpenGL APIs we know about and may support.
+ */
+typedef enum
+{
+ API_OPENGL,
+ API_OPENGLES,
+ API_OPENGLES2
+} gl_api;
+
+
+/**
+ * Mesa rendering context.
+ *
+ * This is the central context data structure for Mesa. Almost all
+ * OpenGL state is contained in this structure.
+ * Think of this as a base class from which device drivers will derive
+ * sub classes.
+ *
+ * The struct gl_context typedef names this structure.
+ */
+struct gl_context
+{
+ /** State possibly shared with other contexts in the address space */
+ struct gl_shared_state *Shared;
+
+ /** \name API function pointer tables */
+ /*@{*/
+ gl_api API;
+ struct _glapi_table *Save; /**< Display list save functions */
+ struct _glapi_table *Exec; /**< Execute functions */
+ struct _glapi_table *CurrentDispatch; /**< == Save or Exec !! */
+ /*@}*/
+
+ struct gl_config Visual;
+ struct gl_framebuffer *DrawBuffer; /**< buffer for writing */
+ struct gl_framebuffer *ReadBuffer; /**< buffer for reading */
+ struct gl_framebuffer *WinSysDrawBuffer; /**< set with MakeCurrent */
+ struct gl_framebuffer *WinSysReadBuffer; /**< set with MakeCurrent */
+
+ /**
+ * Device driver function pointer table
+ */
+ struct dd_function_table Driver;
+
+ void *DriverCtx; /**< Points to device driver context/state */
+
+ /** Core/Driver constants */
+ struct gl_constants Const;
+
+ /** \name The various 4x4 matrix stacks */
+ /*@{*/
+ struct gl_matrix_stack ModelviewMatrixStack;
+ struct gl_matrix_stack ProjectionMatrixStack;
+ struct gl_matrix_stack TextureMatrixStack[MAX_TEXTURE_UNITS];
+ struct gl_matrix_stack ProgramMatrixStack[MAX_PROGRAM_MATRICES];
+ struct gl_matrix_stack *CurrentStack; /**< Points to one of the above stacks */
+ /*@}*/
+
+ /** Combined modelview and projection matrix */
+ GLmatrix _ModelProjectMatrix;
+
+ /** \name Display lists */
+ struct gl_dlist_state ListState;
+
+ GLboolean ExecuteFlag; /**< Execute GL commands? */
+ GLboolean CompileFlag; /**< Compile GL commands into display list? */
+
+ /** Extension information */
+ struct gl_extensions Extensions;
+
+ /** Version info */
+ GLuint VersionMajor, VersionMinor;
+ char *VersionString;
+
+ /** \name State attribute stack (for glPush/PopAttrib) */
+ /*@{*/
+ GLuint AttribStackDepth;
+ struct gl_attrib_node *AttribStack[MAX_ATTRIB_STACK_DEPTH];
+ /*@}*/
+
+ /** \name Renderer attribute groups
+ *
+ * We define a struct for each attribute group to make pushing and popping
+ * attributes easy. Also it's a good organization.
+ */
+ /*@{*/
+ struct gl_accum_attrib Accum; /**< Accum buffer attributes */
+ struct gl_colorbuffer_attrib Color; /**< Color buffer attributes */
+ struct gl_current_attrib Current; /**< Current attributes */
+ struct gl_depthbuffer_attrib Depth; /**< Depth buffer attributes */
+ struct gl_eval_attrib Eval; /**< Eval attributes */
+ struct gl_fog_attrib Fog; /**< Fog attributes */
+ struct gl_hint_attrib Hint; /**< Hint attributes */
+ struct gl_light_attrib Light; /**< Light attributes */
+ struct gl_line_attrib Line; /**< Line attributes */
+ struct gl_list_attrib List; /**< List attributes */
+ struct gl_multisample_attrib Multisample;
+ struct gl_pixel_attrib Pixel; /**< Pixel attributes */
+ struct gl_point_attrib Point; /**< Point attributes */
+ struct gl_polygon_attrib Polygon; /**< Polygon attributes */
+ GLuint PolygonStipple[32]; /**< Polygon stipple */
+ struct gl_scissor_attrib Scissor; /**< Scissor attributes */
+ struct gl_stencil_attrib Stencil; /**< Stencil buffer attributes */
+ struct gl_texture_attrib Texture; /**< Texture attributes */
+ struct gl_transform_attrib Transform; /**< Transformation attributes */
+ struct gl_viewport_attrib Viewport; /**< Viewport attributes */
+ /*@}*/
+
+ /** \name Client attribute stack */
+ /*@{*/
+ GLuint ClientAttribStackDepth;
+ struct gl_attrib_node *ClientAttribStack[MAX_CLIENT_ATTRIB_STACK_DEPTH];
+ /*@}*/
+
+ /** \name Client attribute groups */
+ /*@{*/
+ struct gl_array_attrib Array; /**< Vertex arrays */
+ struct gl_pixelstore_attrib Pack; /**< Pixel packing */
+ struct gl_pixelstore_attrib Unpack; /**< Pixel unpacking */
+ struct gl_pixelstore_attrib DefaultPacking; /**< Default params */
+ /*@}*/
+
+ /** \name Other assorted state (not pushed/popped on attribute stack) */
+ /*@{*/
+ struct gl_pixelmaps PixelMaps;
+
+ struct gl_evaluators EvalMap; /**< All evaluators */
+ struct gl_feedback Feedback; /**< Feedback */
+ struct gl_selection Select; /**< Selection */
+
+ struct gl_program_state Program; /**< general program state */
+ struct gl_vertex_program_state VertexProgram;
+ struct gl_fragment_program_state FragmentProgram;
+ struct gl_geometry_program_state GeometryProgram;
+ struct gl_ati_fragment_shader_state ATIFragmentShader;
+
+ struct gl_shader_state Shader; /**< GLSL shader object state */
+ struct gl_shader_compiler_options ShaderCompilerOptions[MESA_SHADER_TYPES];
+
+ struct gl_query_state Query; /**< occlusion, timer queries */
+
+ struct gl_transform_feedback TransformFeedback;
+
+ struct gl_buffer_object *CopyReadBuffer; /**< GL_ARB_copy_buffer */
+ struct gl_buffer_object *CopyWriteBuffer; /**< GL_ARB_copy_buffer */
+ /*@}*/
+
+ struct gl_meta_state *Meta; /**< for "meta" operations */
+
+ /* GL_EXT_framebuffer_object */
+ struct gl_renderbuffer *CurrentRenderbuffer;
+
+ GLenum ErrorValue; /**< Last error code */
+
+ /* GL_ARB_robustness */
+ GLenum ResetStatus;
+
+ /**
+ * Recognize and silence repeated error debug messages in buggy apps.
+ */
+ const char *ErrorDebugFmtString;
+ GLuint ErrorDebugCount;
+
+ GLenum RenderMode; /**< either GL_RENDER, GL_SELECT, GL_FEEDBACK */
+ GLbitfield NewState; /**< bitwise-or of _NEW_* flags */
+
+ GLboolean ViewportInitialized; /**< has viewport size been initialized? */
+
+ GLbitfield varying_vp_inputs; /**< mask of VERT_BIT_* flags */
+
+ /** \name Derived state */
+ /*@{*/
+ /** Bitwise-or of DD_* flags. Note that this bitfield may be used before
+ * state validation so they need to always be current.
+ */
+ GLbitfield _TriangleCaps;
+ GLbitfield _ImageTransferState;/**< bitwise-or of IMAGE_*_BIT flags */
+ GLfloat _EyeZDir[3];
+ GLfloat _ModelViewInvScale;
+ GLboolean _NeedEyeCoords;
+ GLboolean _ForceEyeCoords;
+
+ GLuint TextureStateTimestamp; /**< detect changes to shared state */
+
+ struct gl_shine_tab *_ShineTable[2]; /**< Active shine tables */
+ struct gl_shine_tab *_ShineTabList; /**< MRU list of inactive shine tables */
+ /**@}*/
+
+ struct gl_list_extensions *ListExt; /**< driver dlist extensions */
+
+ /** \name For debugging/development only */
+ /*@{*/
+ GLboolean FirstTimeCurrent;
+ /*@}*/
+
+ /** software compression/decompression supported or not */
+ GLboolean Mesa_DXTn;
+
+ GLboolean TextureFormatSupported[MESA_FORMAT_COUNT];
+
+ /**
+ * Use dp4 (rather than mul/mad) instructions for position
+ * transformation?
+ */
+ GLboolean mvp_with_dp4;
+
+ /**
+ * \name Hooks for module contexts.
+ *
+ * These will eventually live in the driver or elsewhere.
+ */
+ /*@{*/
+ void *swrast_context;
+ void *swsetup_context;
+ void *swtnl_context;
+ void *swtnl_im;
+ struct st_context *st;
+ void *aelt_context;
+ /*@}*/
+};
+
+
+#ifdef DEBUG
+extern int MESA_VERBOSE;
+extern int MESA_DEBUG_FLAGS;
+# define MESA_FUNCTION __FUNCTION__
+#else
+# define MESA_VERBOSE 0
+# define MESA_DEBUG_FLAGS 0
+# define MESA_FUNCTION "a function"
+# ifndef NDEBUG
+# define NDEBUG
+# endif
+#endif
+
+
+/** The MESA_VERBOSE var is a bitmask of these flags */
+enum _verbose
+{
+ VERBOSE_VARRAY = 0x0001,
+ VERBOSE_TEXTURE = 0x0002,
+ VERBOSE_MATERIAL = 0x0004,
+ VERBOSE_PIPELINE = 0x0008,
+ VERBOSE_DRIVER = 0x0010,
+ VERBOSE_STATE = 0x0020,
+ VERBOSE_API = 0x0040,
+ VERBOSE_DISPLAY_LIST = 0x0100,
+ VERBOSE_LIGHTING = 0x0200,
+ VERBOSE_PRIMS = 0x0400,
+ VERBOSE_VERTS = 0x0800,
+ VERBOSE_DISASSEM = 0x1000,
+ VERBOSE_DRAW = 0x2000,
+ VERBOSE_SWAPBUFFERS = 0x4000
+};
+
+
+/** The MESA_DEBUG_FLAGS var is a bitmask of these flags */
+enum _debug
+{
+ DEBUG_ALWAYS_FLUSH = 0x1
+};
+
+
+
+#endif /* MTYPES_H */
diff --git a/mesalib/src/mesa/main/pack.c b/mesalib/src/mesa/main/pack.c
index d6470e351..fcf0f9f53 100644
--- a/mesalib/src/mesa/main/pack.c
+++ b/mesalib/src/mesa/main/pack.c
@@ -1,5193 +1,5193 @@
-/*
- * Mesa 3-D graphics library
- *
- * Copyright (C) 1999-2008 Brian Paul All Rights Reserved.
- * Copyright (C) 2009-2010 VMware, Inc. All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THEA AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-
-/**
- * \file pack.c
- * Image and pixel span packing and unpacking.
- */
-
-
-#include "glheader.h"
-#include "colormac.h"
-#include "enums.h"
-#include "image.h"
-#include "imports.h"
-#include "mtypes.h"
-#include "pack.h"
-#include "pixeltransfer.h"
-#include "imports.h"
-#include "../../gallium/auxiliary/util/u_format_rgb9e5.h"
-#include "../../gallium/auxiliary/util/u_format_r11g11b10f.h"
-
-
-/**
- * NOTE:
- * Normally, BYTE_TO_FLOAT(0) returns 0.00392 That causes problems when
- * we later convert the float to a packed integer value (such as for
- * GL_RGB5_A1) because we'll wind up with a non-zero value.
- *
- * We redefine the macros here so zero is handled correctly.
- */
-#undef BYTE_TO_FLOAT
-#define BYTE_TO_FLOAT(B) ((B) == 0 ? 0.0F : ((2.0F * (B) + 1.0F) * (1.0F/255.0F)))
-
-#undef SHORT_TO_FLOAT
-#define SHORT_TO_FLOAT(S) ((S) == 0 ? 0.0F : ((2.0F * (S) + 1.0F) * (1.0F/65535.0F)))
-
-
-
-/** Compute ceiling of integer quotient of A divided by B. */
-#define CEILING( A, B ) ( (A) % (B) == 0 ? (A)/(B) : (A)/(B)+1 )
-
-
-/**
- * Flip the 8 bits in each byte of the given array.
- *
- * \param p array.
- * \param n number of bytes.
- *
- * \todo try this trick to flip bytes someday:
- * \code
- * v = ((v & 0x55555555) << 1) | ((v >> 1) & 0x55555555);
- * v = ((v & 0x33333333) << 2) | ((v >> 2) & 0x33333333);
- * v = ((v & 0x0f0f0f0f) << 4) | ((v >> 4) & 0x0f0f0f0f);
- * \endcode
- */
-static void
-flip_bytes( GLubyte *p, GLuint n )
-{
- GLuint i, a, b;
- for (i = 0; i < n; i++) {
- b = (GLuint) p[i]; /* words are often faster than bytes */
- a = ((b & 0x01) << 7) |
- ((b & 0x02) << 5) |
- ((b & 0x04) << 3) |
- ((b & 0x08) << 1) |
- ((b & 0x10) >> 1) |
- ((b & 0x20) >> 3) |
- ((b & 0x40) >> 5) |
- ((b & 0x80) >> 7);
- p[i] = (GLubyte) a;
- }
-}
-
-
-
-/*
- * Unpack a 32x32 pixel polygon stipple from user memory using the
- * current pixel unpack settings.
- */
-void
-_mesa_unpack_polygon_stipple( const GLubyte *pattern, GLuint dest[32],
- const struct gl_pixelstore_attrib *unpacking )
-{
- GLubyte *ptrn = (GLubyte *) _mesa_unpack_bitmap(32, 32, pattern, unpacking);
- if (ptrn) {
- /* Convert pattern from GLubytes to GLuints and handle big/little
- * endian differences
- */
- GLubyte *p = ptrn;
- GLint i;
- for (i = 0; i < 32; i++) {
- dest[i] = (p[0] << 24)
- | (p[1] << 16)
- | (p[2] << 8)
- | (p[3] );
- p += 4;
- }
- free(ptrn);
- }
-}
-
-
-/*
- * Pack polygon stipple into user memory given current pixel packing
- * settings.
- */
-void
-_mesa_pack_polygon_stipple( const GLuint pattern[32], GLubyte *dest,
- const struct gl_pixelstore_attrib *packing )
-{
- /* Convert pattern from GLuints to GLubytes to handle big/little
- * endian differences.
- */
- GLubyte ptrn[32*4];
- GLint i;
- for (i = 0; i < 32; i++) {
- ptrn[i * 4 + 0] = (GLubyte) ((pattern[i] >> 24) & 0xff);
- ptrn[i * 4 + 1] = (GLubyte) ((pattern[i] >> 16) & 0xff);
- ptrn[i * 4 + 2] = (GLubyte) ((pattern[i] >> 8 ) & 0xff);
- ptrn[i * 4 + 3] = (GLubyte) ((pattern[i] ) & 0xff);
- }
-
- _mesa_pack_bitmap(32, 32, ptrn, dest, packing);
-}
-
-
-/*
- * Unpack bitmap data. Resulting data will be in most-significant-bit-first
- * order with row alignment = 1 byte.
- */
-GLvoid *
-_mesa_unpack_bitmap( GLint width, GLint height, const GLubyte *pixels,
- const struct gl_pixelstore_attrib *packing )
-{
- GLint bytes, row, width_in_bytes;
- GLubyte *buffer, *dst;
-
- if (!pixels)
- return NULL;
-
- /* Alloc dest storage */
- bytes = ((width + 7) / 8 * height);
- buffer = (GLubyte *) malloc( bytes );
- if (!buffer)
- return NULL;
-
- width_in_bytes = CEILING( width, 8 );
- dst = buffer;
- for (row = 0; row < height; row++) {
- const GLubyte *src = (const GLubyte *)
- _mesa_image_address2d(packing, pixels, width, height,
- GL_COLOR_INDEX, GL_BITMAP, row, 0);
- if (!src) {
- free(buffer);
- return NULL;
- }
-
- if ((packing->SkipPixels & 7) == 0) {
- memcpy( dst, src, width_in_bytes );
- if (packing->LsbFirst) {
- flip_bytes( dst, width_in_bytes );
- }
- }
- else {
- /* handling SkipPixels is a bit tricky (no pun intended!) */
- GLint i;
- if (packing->LsbFirst) {
- GLubyte srcMask = 1 << (packing->SkipPixels & 0x7);
- GLubyte dstMask = 128;
- const GLubyte *s = src;
- GLubyte *d = dst;
- *d = 0;
- for (i = 0; i < width; i++) {
- if (*s & srcMask) {
- *d |= dstMask;
- }
- if (srcMask == 128) {
- srcMask = 1;
- s++;
- }
- else {
- srcMask = srcMask << 1;
- }
- if (dstMask == 1) {
- dstMask = 128;
- d++;
- *d = 0;
- }
- else {
- dstMask = dstMask >> 1;
- }
- }
- }
- else {
- GLubyte srcMask = 128 >> (packing->SkipPixels & 0x7);
- GLubyte dstMask = 128;
- const GLubyte *s = src;
- GLubyte *d = dst;
- *d = 0;
- for (i = 0; i < width; i++) {
- if (*s & srcMask) {
- *d |= dstMask;
- }
- if (srcMask == 1) {
- srcMask = 128;
- s++;
- }
- else {
- srcMask = srcMask >> 1;
- }
- if (dstMask == 1) {
- dstMask = 128;
- d++;
- *d = 0;
- }
- else {
- dstMask = dstMask >> 1;
- }
- }
- }
- }
- dst += width_in_bytes;
- }
-
- return buffer;
-}
-
-
-/*
- * Pack bitmap data.
- */
-void
-_mesa_pack_bitmap( GLint width, GLint height, const GLubyte *source,
- GLubyte *dest, const struct gl_pixelstore_attrib *packing )
-{
- GLint row, width_in_bytes;
- const GLubyte *src;
-
- if (!source)
- return;
-
- width_in_bytes = CEILING( width, 8 );
- src = source;
- for (row = 0; row < height; row++) {
- GLubyte *dst = (GLubyte *) _mesa_image_address2d(packing, dest,
- width, height, GL_COLOR_INDEX, GL_BITMAP, row, 0);
- if (!dst)
- return;
-
- if ((packing->SkipPixels & 7) == 0) {
- memcpy( dst, src, width_in_bytes );
- if (packing->LsbFirst) {
- flip_bytes( dst, width_in_bytes );
- }
- }
- else {
- /* handling SkipPixels is a bit tricky (no pun intended!) */
- GLint i;
- if (packing->LsbFirst) {
- GLubyte srcMask = 128;
- GLubyte dstMask = 1 << (packing->SkipPixels & 0x7);
- const GLubyte *s = src;
- GLubyte *d = dst;
- *d = 0;
- for (i = 0; i < width; i++) {
- if (*s & srcMask) {
- *d |= dstMask;
- }
- if (srcMask == 1) {
- srcMask = 128;
- s++;
- }
- else {
- srcMask = srcMask >> 1;
- }
- if (dstMask == 128) {
- dstMask = 1;
- d++;
- *d = 0;
- }
- else {
- dstMask = dstMask << 1;
- }
- }
- }
- else {
- GLubyte srcMask = 128;
- GLubyte dstMask = 128 >> (packing->SkipPixels & 0x7);
- const GLubyte *s = src;
- GLubyte *d = dst;
- *d = 0;
- for (i = 0; i < width; i++) {
- if (*s & srcMask) {
- *d |= dstMask;
- }
- if (srcMask == 1) {
- srcMask = 128;
- s++;
- }
- else {
- srcMask = srcMask >> 1;
- }
- if (dstMask == 1) {
- dstMask = 128;
- d++;
- *d = 0;
- }
- else {
- dstMask = dstMask >> 1;
- }
- }
- }
- }
- src += width_in_bytes;
- }
-}
-
-
-/**
- * Get indexes of color components for a basic color format, such as
- * GL_RGBA, GL_RED, GL_LUMINANCE_ALPHA, etc. Return -1 for indexes
- * that do not apply.
- */
-static void
-get_component_indexes(GLenum format,
- GLint *redIndex,
- GLint *greenIndex,
- GLint *blueIndex,
- GLint *alphaIndex,
- GLint *luminanceIndex,
- GLint *intensityIndex)
-{
- *redIndex = -1;
- *greenIndex = -1;
- *blueIndex = -1;
- *alphaIndex = -1;
- *luminanceIndex = -1;
- *intensityIndex = -1;
-
- switch (format) {
- case GL_LUMINANCE:
- case GL_LUMINANCE_INTEGER_EXT:
- *luminanceIndex = 0;
- break;
- case GL_LUMINANCE_ALPHA:
- case GL_LUMINANCE_ALPHA_INTEGER_EXT:
- *luminanceIndex = 0;
- *alphaIndex = 1;
- break;
- case GL_INTENSITY:
- *intensityIndex = 0;
- break;
- case GL_RED:
- case GL_RED_INTEGER_EXT:
- *redIndex = 0;
- break;
- case GL_GREEN:
- case GL_GREEN_INTEGER_EXT:
- *greenIndex = 0;
- break;
- case GL_BLUE:
- case GL_BLUE_INTEGER_EXT:
- *blueIndex = 0;
- break;
- case GL_ALPHA:
- case GL_ALPHA_INTEGER_EXT:
- *alphaIndex = 0;
- break;
- case GL_RG:
- case GL_RG_INTEGER:
- *redIndex = 0;
- *greenIndex = 1;
- break;
- case GL_RGB:
- case GL_RGB_INTEGER_EXT:
- *redIndex = 0;
- *greenIndex = 1;
- *blueIndex = 2;
- break;
- case GL_BGR:
- case GL_BGR_INTEGER_EXT:
- *blueIndex = 0;
- *greenIndex = 1;
- *redIndex = 2;
- break;
- case GL_RGBA:
- case GL_RGBA_INTEGER_EXT:
- *redIndex = 0;
- *greenIndex = 1;
- *blueIndex = 2;
- *alphaIndex = 3;
- break;
- case GL_BGRA:
- case GL_BGRA_INTEGER:
- *redIndex = 2;
- *greenIndex = 1;
- *blueIndex = 0;
- *alphaIndex = 3;
- break;
- case GL_ABGR_EXT:
- *redIndex = 3;
- *greenIndex = 2;
- *blueIndex = 1;
- *alphaIndex = 0;
- break;
- case GL_DU8DV8_ATI:
- case GL_DUDV_ATI:
- *redIndex = 0;
- *greenIndex = 1;
- break;
- default:
- assert(0 && "bad format in get_component_indexes()");
- }
-}
-
-
-
-/**
- * For small integer types, return the min and max possible values.
- * Used for clamping floats to unscaled integer types.
- * \return GL_TRUE if type is handled, GL_FALSE otherwise.
- */
-static GLboolean
-get_type_min_max(GLenum type, GLfloat *min, GLfloat *max)
-{
- switch (type) {
- case GL_BYTE:
- *min = -128.0;
- *max = 127.0;
- return GL_TRUE;
- case GL_UNSIGNED_BYTE:
- *min = 0.0;
- *max = 255.0;
- return GL_TRUE;
- case GL_SHORT:
- *min = -32768.0;
- *max = 32767.0;
- return GL_TRUE;
- case GL_UNSIGNED_SHORT:
- *min = 0.0;
- *max = 65535.0;
- return GL_TRUE;
- default:
- return GL_FALSE;
- }
-}
-
-
-
-/**
- * Used to pack an array [][4] of RGBA float colors as specified
- * by the dstFormat, dstType and dstPacking. Used by glReadPixels.
- * Historically, the RGBA values were in [0,1] and rescaled to fit
- * into GLubytes, etc. But with new integer formats, the RGBA values
- * may have any value and we don't always rescale when converting to
- * integers.
- *
- * Note: the rgba values will be modified by this function when any pixel
- * transfer ops are enabled.
- */
-void
-_mesa_pack_rgba_span_float(struct gl_context *ctx, GLuint n, GLfloat rgba[][4],
- GLenum dstFormat, GLenum dstType,
- GLvoid *dstAddr,
- const struct gl_pixelstore_attrib *dstPacking,
- GLbitfield transferOps)
-{
- GLfloat *luminance;
- const GLint comps = _mesa_components_in_format(dstFormat);
- const GLboolean intDstFormat = _mesa_is_integer_format(dstFormat);
- GLuint i;
-
- if (dstFormat == GL_LUMINANCE ||
- dstFormat == GL_LUMINANCE_ALPHA ||
- dstFormat == GL_LUMINANCE_INTEGER_EXT ||
- dstFormat == GL_LUMINANCE_ALPHA_INTEGER_EXT) {
- luminance = (GLfloat *) malloc(n * sizeof(GLfloat));
- if (!luminance) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "pixel packing");
- return;
- }
- }
- else {
- luminance = NULL;
- }
-
- if (transferOps) {
- _mesa_apply_rgba_transfer_ops(ctx, transferOps, n, rgba);
- }
-
- /*
- * Component clamping (besides clamping to [0,1] in
- * _mesa_apply_rgba_transfer_ops()).
- */
- if (intDstFormat) {
- /* clamping to dest type's min/max values */
- GLfloat min, max;
- if (get_type_min_max(dstType, &min, &max)) {
- for (i = 0; i < n; i++) {
- rgba[i][RCOMP] = CLAMP(rgba[i][RCOMP], min, max);
- rgba[i][GCOMP] = CLAMP(rgba[i][GCOMP], min, max);
- rgba[i][BCOMP] = CLAMP(rgba[i][BCOMP], min, max);
- rgba[i][ACOMP] = CLAMP(rgba[i][ACOMP], min, max);
- }
- }
- }
- else if (dstFormat == GL_LUMINANCE || dstFormat == GL_LUMINANCE_ALPHA) {
- /* compute luminance values */
- if (transferOps & IMAGE_CLAMP_BIT) {
- for (i = 0; i < n; i++) {
- GLfloat sum = rgba[i][RCOMP] + rgba[i][GCOMP] + rgba[i][BCOMP];
- luminance[i] = CLAMP(sum, 0.0F, 1.0F);
- }
- }
- else {
- for (i = 0; i < n; i++) {
- luminance[i] = rgba[i][RCOMP] + rgba[i][GCOMP] + rgba[i][BCOMP];
- }
- }
- }
-
- /*
- * Pack/store the pixels. Ugh! Lots of cases!!!
- */
- switch (dstType) {
- case GL_UNSIGNED_BYTE:
- {
- GLubyte *dst = (GLubyte *) dstAddr;
- switch (dstFormat) {
- case GL_RED:
- for (i=0;i<n;i++)
- dst[i] = FLOAT_TO_UBYTE(rgba[i][RCOMP]);
- break;
- case GL_GREEN:
- for (i=0;i<n;i++)
- dst[i] = FLOAT_TO_UBYTE(rgba[i][GCOMP]);
- break;
- case GL_BLUE:
- for (i=0;i<n;i++)
- dst[i] = FLOAT_TO_UBYTE(rgba[i][BCOMP]);
- break;
- case GL_ALPHA:
- for (i=0;i<n;i++)
- dst[i] = FLOAT_TO_UBYTE(rgba[i][ACOMP]);
- break;
- case GL_LUMINANCE:
- for (i=0;i<n;i++)
- dst[i] = FLOAT_TO_UBYTE(luminance[i]);
- break;
- case GL_LUMINANCE_ALPHA:
- for (i=0;i<n;i++) {
- dst[i*2+0] = FLOAT_TO_UBYTE(luminance[i]);
- dst[i*2+1] = FLOAT_TO_UBYTE(rgba[i][ACOMP]);
- }
- break;
- case GL_RG:
- for (i=0;i<n;i++) {
- dst[i*2+0] = FLOAT_TO_UBYTE(rgba[i][RCOMP]);
- dst[i*2+1] = FLOAT_TO_UBYTE(rgba[i][GCOMP]);
- }
- break;
- case GL_RGB:
- for (i=0;i<n;i++) {
- dst[i*3+0] = FLOAT_TO_UBYTE(rgba[i][RCOMP]);
- dst[i*3+1] = FLOAT_TO_UBYTE(rgba[i][GCOMP]);
- dst[i*3+2] = FLOAT_TO_UBYTE(rgba[i][BCOMP]);
- }
- break;
- case GL_RGBA:
- for (i=0;i<n;i++) {
- dst[i*4+0] = FLOAT_TO_UBYTE(rgba[i][RCOMP]);
- dst[i*4+1] = FLOAT_TO_UBYTE(rgba[i][GCOMP]);
- dst[i*4+2] = FLOAT_TO_UBYTE(rgba[i][BCOMP]);
- dst[i*4+3] = FLOAT_TO_UBYTE(rgba[i][ACOMP]);
- }
- break;
- case GL_BGR:
- for (i=0;i<n;i++) {
- dst[i*3+0] = FLOAT_TO_UBYTE(rgba[i][BCOMP]);
- dst[i*3+1] = FLOAT_TO_UBYTE(rgba[i][GCOMP]);
- dst[i*3+2] = FLOAT_TO_UBYTE(rgba[i][RCOMP]);
- }
- break;
- case GL_BGRA:
- for (i=0;i<n;i++) {
- dst[i*4+0] = FLOAT_TO_UBYTE(rgba[i][BCOMP]);
- dst[i*4+1] = FLOAT_TO_UBYTE(rgba[i][GCOMP]);
- dst[i*4+2] = FLOAT_TO_UBYTE(rgba[i][RCOMP]);
- dst[i*4+3] = FLOAT_TO_UBYTE(rgba[i][ACOMP]);
- }
- break;
- case GL_ABGR_EXT:
- for (i=0;i<n;i++) {
- dst[i*4+0] = FLOAT_TO_UBYTE(rgba[i][ACOMP]);
- dst[i*4+1] = FLOAT_TO_UBYTE(rgba[i][BCOMP]);
- dst[i*4+2] = FLOAT_TO_UBYTE(rgba[i][GCOMP]);
- dst[i*4+3] = FLOAT_TO_UBYTE(rgba[i][RCOMP]);
- }
- break;
- case GL_RED_INTEGER_EXT:
- for (i=0;i<n;i++) {
- dst[i] = (GLubyte) rgba[i][RCOMP];
- }
- break;
- case GL_GREEN_INTEGER_EXT:
- for (i=0;i<n;i++) {
- dst[i] = (GLubyte) rgba[i][GCOMP];
- }
- break;
- case GL_BLUE_INTEGER_EXT:
- for (i=0;i<n;i++) {
- dst[i] = (GLubyte) rgba[i][BCOMP];
- }
- break;
- case GL_ALPHA_INTEGER_EXT:
- for (i=0;i<n;i++) {
- dst[i] = (GLubyte) rgba[i][ACOMP];
- }
- break;
- case GL_RGB_INTEGER_EXT:
- for (i=0;i<n;i++) {
- dst[i*3+0] = (GLubyte) rgba[i][RCOMP];
- dst[i*3+1] = (GLubyte) rgba[i][GCOMP];
- dst[i*3+2] = (GLubyte) rgba[i][BCOMP];
- }
- break;
- case GL_RGBA_INTEGER_EXT:
- for (i=0;i<n;i++) {
- dst[i*4+0] = (GLubyte) rgba[i][RCOMP];
- dst[i*4+1] = (GLubyte) rgba[i][GCOMP];
- dst[i*4+2] = (GLubyte) rgba[i][BCOMP];
- dst[i*4+3] = (GLubyte) rgba[i][ACOMP];
- }
- break;
- case GL_BGR_INTEGER_EXT:
- for (i=0;i<n;i++) {
- dst[i*3+0] = (GLubyte) rgba[i][BCOMP];
- dst[i*3+1] = (GLubyte) rgba[i][GCOMP];
- dst[i*3+2] = (GLubyte) rgba[i][RCOMP];
- }
- break;
- case GL_BGRA_INTEGER_EXT:
- for (i=0;i<n;i++) {
- dst[i*4+0] = (GLubyte) rgba[i][BCOMP];
- dst[i*4+1] = (GLubyte) rgba[i][GCOMP];
- dst[i*4+2] = (GLubyte) rgba[i][RCOMP];
- dst[i*4+3] = (GLubyte) rgba[i][ACOMP];
- }
- break;
- case GL_LUMINANCE_INTEGER_EXT:
- for (i=0;i<n;i++) {
- dst[i*2+0] = (GLubyte) (rgba[i][RCOMP] +
- rgba[i][GCOMP] +
- rgba[i][BCOMP]);
- dst[i*2+1] = (GLubyte) rgba[i][ACOMP];
- }
- break;
- case GL_LUMINANCE_ALPHA_INTEGER_EXT:
- for (i=0;i<n;i++) {
- dst[i] = (GLubyte) (rgba[i][RCOMP] +
- rgba[i][GCOMP] +
- rgba[i][BCOMP]);
- }
- break;
- case GL_DUDV_ATI:
- case GL_DU8DV8_ATI:
- for (i=0;i<n;i++) {
- dst[i*2+0] = FLOAT_TO_UBYTE(rgba[i][RCOMP]);
- dst[i*2+1] = FLOAT_TO_UBYTE(rgba[i][GCOMP]);
- }
- break;
- default:
- _mesa_problem(ctx, "bad format in _mesa_pack_rgba_span\n");
- }
- }
- break;
- case GL_BYTE:
- {
- GLbyte *dst = (GLbyte *) dstAddr;
- switch (dstFormat) {
- case GL_RED:
- for (i=0;i<n;i++)
- dst[i] = FLOAT_TO_BYTE(rgba[i][RCOMP]);
- break;
- case GL_GREEN:
- for (i=0;i<n;i++)
- dst[i] = FLOAT_TO_BYTE(rgba[i][GCOMP]);
- break;
- case GL_BLUE:
- for (i=0;i<n;i++)
- dst[i] = FLOAT_TO_BYTE(rgba[i][BCOMP]);
- break;
- case GL_ALPHA:
- for (i=0;i<n;i++)
- dst[i] = FLOAT_TO_BYTE(rgba[i][ACOMP]);
- break;
- case GL_LUMINANCE:
- for (i=0;i<n;i++)
- dst[i] = FLOAT_TO_BYTE(luminance[i]);
- break;
- case GL_LUMINANCE_ALPHA:
- for (i=0;i<n;i++) {
- dst[i*2+0] = FLOAT_TO_BYTE(luminance[i]);
- dst[i*2+1] = FLOAT_TO_BYTE(rgba[i][ACOMP]);
- }
- break;
- case GL_RG:
- for (i=0;i<n;i++) {
- dst[i*2+0] = FLOAT_TO_BYTE(rgba[i][RCOMP]);
- dst[i*2+1] = FLOAT_TO_BYTE(rgba[i][GCOMP]);
- }
- break;
- case GL_RGB:
- for (i=0;i<n;i++) {
- dst[i*3+0] = FLOAT_TO_BYTE(rgba[i][RCOMP]);
- dst[i*3+1] = FLOAT_TO_BYTE(rgba[i][GCOMP]);
- dst[i*3+2] = FLOAT_TO_BYTE(rgba[i][BCOMP]);
- }
- break;
- case GL_RGBA:
- for (i=0;i<n;i++) {
- dst[i*4+0] = FLOAT_TO_BYTE(rgba[i][RCOMP]);
- dst[i*4+1] = FLOAT_TO_BYTE(rgba[i][GCOMP]);
- dst[i*4+2] = FLOAT_TO_BYTE(rgba[i][BCOMP]);
- dst[i*4+3] = FLOAT_TO_BYTE(rgba[i][ACOMP]);
- }
- break;
- case GL_BGR:
- for (i=0;i<n;i++) {
- dst[i*3+0] = FLOAT_TO_BYTE(rgba[i][BCOMP]);
- dst[i*3+1] = FLOAT_TO_BYTE(rgba[i][GCOMP]);
- dst[i*3+2] = FLOAT_TO_BYTE(rgba[i][RCOMP]);
- }
- break;
- case GL_BGRA:
- for (i=0;i<n;i++) {
- dst[i*4+0] = FLOAT_TO_BYTE(rgba[i][BCOMP]);
- dst[i*4+1] = FLOAT_TO_BYTE(rgba[i][GCOMP]);
- dst[i*4+2] = FLOAT_TO_BYTE(rgba[i][RCOMP]);
- dst[i*4+3] = FLOAT_TO_BYTE(rgba[i][ACOMP]);
- }
- break;
- case GL_ABGR_EXT:
- for (i=0;i<n;i++) {
- dst[i*4+0] = FLOAT_TO_BYTE(rgba[i][ACOMP]);
- dst[i*4+1] = FLOAT_TO_BYTE(rgba[i][BCOMP]);
- dst[i*4+2] = FLOAT_TO_BYTE(rgba[i][GCOMP]);
- dst[i*4+3] = FLOAT_TO_BYTE(rgba[i][RCOMP]);
- }
- break;
- case GL_RED_INTEGER_EXT:
- for (i=0;i<n;i++) {
- dst[i] = (GLbyte) rgba[i][RCOMP];
- }
- break;
- case GL_GREEN_INTEGER_EXT:
- for (i=0;i<n;i++) {
- dst[i] = (GLbyte) rgba[i][GCOMP];
- }
- break;
- case GL_BLUE_INTEGER_EXT:
- for (i=0;i<n;i++) {
- dst[i] = (GLbyte) rgba[i][BCOMP];
- }
- break;
- case GL_ALPHA_INTEGER_EXT:
- for (i=0;i<n;i++) {
- dst[i] = (GLbyte) rgba[i][ACOMP];
- }
- break;
- case GL_RGB_INTEGER_EXT:
- for (i=0;i<n;i++) {
- dst[i*3+0] = (GLbyte) rgba[i][RCOMP];
- dst[i*3+1] = (GLbyte) rgba[i][GCOMP];
- dst[i*3+2] = (GLbyte) rgba[i][BCOMP];
- }
- break;
- case GL_RGBA_INTEGER_EXT:
- for (i=0;i<n;i++) {
- dst[i*4+0] = (GLbyte) rgba[i][RCOMP];
- dst[i*4+1] = (GLbyte) rgba[i][GCOMP];
- dst[i*4+2] = (GLbyte) rgba[i][BCOMP];
- dst[i*4+3] = (GLbyte) rgba[i][ACOMP];
- }
- break;
- case GL_BGR_INTEGER_EXT:
- for (i=0;i<n;i++) {
- dst[i*3+0] = (GLbyte) rgba[i][BCOMP];
- dst[i*3+1] = (GLbyte) rgba[i][GCOMP];
- dst[i*3+2] = (GLbyte) rgba[i][RCOMP];
- }
- break;
- case GL_BGRA_INTEGER_EXT:
- for (i=0;i<n;i++) {
- dst[i*4+0] = (GLbyte) rgba[i][BCOMP];
- dst[i*4+1] = (GLbyte) rgba[i][GCOMP];
- dst[i*4+2] = (GLbyte) rgba[i][RCOMP];
- dst[i*4+3] = (GLbyte) rgba[i][ACOMP];
- }
- break;
- case GL_LUMINANCE_INTEGER_EXT:
- for (i=0;i<n;i++) {
- dst[i*2+0] = (GLbyte) (rgba[i][RCOMP] +
- rgba[i][GCOMP] +
- rgba[i][BCOMP]);
- dst[i*2+1] = (GLbyte) rgba[i][ACOMP];
- }
- break;
- case GL_LUMINANCE_ALPHA_INTEGER_EXT:
- for (i=0;i<n;i++) {
- dst[i] = (GLbyte) (rgba[i][RCOMP] +
- rgba[i][GCOMP] +
- rgba[i][BCOMP]);
- }
- break;
- case GL_DUDV_ATI:
- case GL_DU8DV8_ATI:
- for (i=0;i<n;i++) {
- dst[i*2+0] = FLOAT_TO_BYTE(rgba[i][RCOMP]);
- dst[i*2+1] = FLOAT_TO_BYTE(rgba[i][GCOMP]);
- }
- break;
- default:
- _mesa_problem(ctx, "bad format in _mesa_pack_rgba_span\n");
- }
- }
- break;
- case GL_UNSIGNED_SHORT:
- {
- GLushort *dst = (GLushort *) dstAddr;
- switch (dstFormat) {
- case GL_RED:
- for (i=0;i<n;i++)
- CLAMPED_FLOAT_TO_USHORT(dst[i], rgba[i][RCOMP]);
- break;
- case GL_GREEN:
- for (i=0;i<n;i++)
- CLAMPED_FLOAT_TO_USHORT(dst[i], rgba[i][GCOMP]);
- break;
- case GL_BLUE:
- for (i=0;i<n;i++)
- CLAMPED_FLOAT_TO_USHORT(dst[i], rgba[i][BCOMP]);
- break;
- case GL_ALPHA:
- for (i=0;i<n;i++)
- CLAMPED_FLOAT_TO_USHORT(dst[i], rgba[i][ACOMP]);
- break;
- case GL_LUMINANCE:
- for (i=0;i<n;i++)
- UNCLAMPED_FLOAT_TO_USHORT(dst[i], luminance[i]);
- break;
- case GL_LUMINANCE_ALPHA:
- for (i=0;i<n;i++) {
- UNCLAMPED_FLOAT_TO_USHORT(dst[i*2+0], luminance[i]);
- CLAMPED_FLOAT_TO_USHORT(dst[i*2+1], rgba[i][ACOMP]);
- }
- break;
- case GL_RG:
- for (i=0;i<n;i++) {
- CLAMPED_FLOAT_TO_USHORT(dst[i*2+0], rgba[i][RCOMP]);
- CLAMPED_FLOAT_TO_USHORT(dst[i*2+1], rgba[i][GCOMP]);
- }
- break;
- case GL_RGB:
- for (i=0;i<n;i++) {
- CLAMPED_FLOAT_TO_USHORT(dst[i*3+0], rgba[i][RCOMP]);
- CLAMPED_FLOAT_TO_USHORT(dst[i*3+1], rgba[i][GCOMP]);
- CLAMPED_FLOAT_TO_USHORT(dst[i*3+2], rgba[i][BCOMP]);
- }
- break;
- case GL_RGBA:
- for (i=0;i<n;i++) {
- CLAMPED_FLOAT_TO_USHORT(dst[i*4+0], rgba[i][RCOMP]);
- CLAMPED_FLOAT_TO_USHORT(dst[i*4+1], rgba[i][GCOMP]);
- CLAMPED_FLOAT_TO_USHORT(dst[i*4+2], rgba[i][BCOMP]);
- CLAMPED_FLOAT_TO_USHORT(dst[i*4+3], rgba[i][ACOMP]);
- }
- break;
- case GL_BGR:
- for (i=0;i<n;i++) {
- CLAMPED_FLOAT_TO_USHORT(dst[i*3+0], rgba[i][BCOMP]);
- CLAMPED_FLOAT_TO_USHORT(dst[i*3+1], rgba[i][GCOMP]);
- CLAMPED_FLOAT_TO_USHORT(dst[i*3+2], rgba[i][RCOMP]);
- }
- break;
- case GL_BGRA:
- for (i=0;i<n;i++) {
- CLAMPED_FLOAT_TO_USHORT(dst[i*4+0], rgba[i][BCOMP]);
- CLAMPED_FLOAT_TO_USHORT(dst[i*4+1], rgba[i][GCOMP]);
- CLAMPED_FLOAT_TO_USHORT(dst[i*4+2], rgba[i][RCOMP]);
- CLAMPED_FLOAT_TO_USHORT(dst[i*4+3], rgba[i][ACOMP]);
- }
- break;
- case GL_ABGR_EXT:
- for (i=0;i<n;i++) {
- CLAMPED_FLOAT_TO_USHORT(dst[i*4+0], rgba[i][ACOMP]);
- CLAMPED_FLOAT_TO_USHORT(dst[i*4+1], rgba[i][BCOMP]);
- CLAMPED_FLOAT_TO_USHORT(dst[i*4+2], rgba[i][GCOMP]);
- CLAMPED_FLOAT_TO_USHORT(dst[i*4+3], rgba[i][RCOMP]);
- }
- break;
- case GL_RED_INTEGER_EXT:
- for (i=0;i<n;i++) {
- dst[i] = (GLushort) rgba[i][RCOMP];
- }
- break;
- case GL_GREEN_INTEGER_EXT:
- for (i=0;i<n;i++) {
- dst[i] = (GLushort) rgba[i][GCOMP];
- }
- break;
- case GL_BLUE_INTEGER_EXT:
- for (i=0;i<n;i++) {
- dst[i] = (GLushort) rgba[i][BCOMP];
- }
- break;
- case GL_ALPHA_INTEGER_EXT:
- for (i=0;i<n;i++) {
- dst[i] = (GLushort) rgba[i][ACOMP];
- }
- break;
- case GL_RGB_INTEGER_EXT:
- for (i=0;i<n;i++) {
- dst[i*3+0] = (GLushort) rgba[i][RCOMP];
- dst[i*3+1] = (GLushort) rgba[i][GCOMP];
- dst[i*3+2] = (GLushort) rgba[i][BCOMP];
- }
- break;
- case GL_RGBA_INTEGER_EXT:
- for (i=0;i<n;i++) {
- dst[i*4+0] = (GLushort) rgba[i][RCOMP];
- dst[i*4+1] = (GLushort) rgba[i][GCOMP];
- dst[i*4+2] = (GLushort) rgba[i][BCOMP];
- dst[i*4+3] = (GLushort) rgba[i][ACOMP];
- }
- break;
- case GL_BGR_INTEGER_EXT:
- for (i=0;i<n;i++) {
- dst[i*3+0] = (GLushort) rgba[i][BCOMP];
- dst[i*3+1] = (GLushort) rgba[i][GCOMP];
- dst[i*3+2] = (GLushort) rgba[i][RCOMP];
- }
- break;
- case GL_BGRA_INTEGER_EXT:
- for (i=0;i<n;i++) {
- dst[i*4+0] = (GLushort) rgba[i][BCOMP];
- dst[i*4+1] = (GLushort) rgba[i][GCOMP];
- dst[i*4+2] = (GLushort) rgba[i][RCOMP];
- dst[i*4+3] = (GLushort) rgba[i][ACOMP];
- }
- break;
- case GL_LUMINANCE_INTEGER_EXT:
- for (i=0;i<n;i++) {
- dst[i*2+0] = (GLushort) (rgba[i][RCOMP] +
- rgba[i][GCOMP] +
- rgba[i][BCOMP]);
- dst[i*2+1] = (GLushort) rgba[i][ACOMP];
- }
- break;
- case GL_LUMINANCE_ALPHA_INTEGER_EXT:
- for (i=0;i<n;i++) {
- dst[i] = (GLushort) (rgba[i][RCOMP] +
- rgba[i][GCOMP] +
- rgba[i][BCOMP]);
- }
- break;
- case GL_DUDV_ATI:
- case GL_DU8DV8_ATI:
- for (i=0;i<n;i++) {
- dst[i*2+0] = FLOAT_TO_USHORT(rgba[i][RCOMP]);
- dst[i*2+1] = FLOAT_TO_USHORT(rgba[i][GCOMP]);
- }
- break;
- default:
- _mesa_problem(ctx, "bad format in _mesa_pack_rgba_span\n");
- }
- }
- break;
- case GL_SHORT:
- {
- GLshort *dst = (GLshort *) dstAddr;
- switch (dstFormat) {
- case GL_RED:
- for (i=0;i<n;i++)
- dst[i] = FLOAT_TO_SHORT(rgba[i][RCOMP]);
- break;
- case GL_GREEN:
- for (i=0;i<n;i++)
- dst[i] = FLOAT_TO_SHORT(rgba[i][GCOMP]);
- break;
- case GL_BLUE:
- for (i=0;i<n;i++)
- dst[i] = FLOAT_TO_SHORT(rgba[i][BCOMP]);
- break;
- case GL_ALPHA:
- for (i=0;i<n;i++)
- dst[i] = FLOAT_TO_SHORT(rgba[i][ACOMP]);
- break;
- case GL_LUMINANCE:
- for (i=0;i<n;i++)
- dst[i] = FLOAT_TO_SHORT(luminance[i]);
- break;
- case GL_LUMINANCE_ALPHA:
- for (i=0;i<n;i++) {
- dst[i*2+0] = FLOAT_TO_SHORT(luminance[i]);
- dst[i*2+1] = FLOAT_TO_SHORT(rgba[i][ACOMP]);
- }
- break;
- case GL_RG:
- for (i=0;i<n;i++) {
- dst[i*2+0] = FLOAT_TO_SHORT(rgba[i][RCOMP]);
- dst[i*2+1] = FLOAT_TO_SHORT(rgba[i][GCOMP]);
- }
- break;
- case GL_RGB:
- for (i=0;i<n;i++) {
- dst[i*3+0] = FLOAT_TO_SHORT(rgba[i][RCOMP]);
- dst[i*3+1] = FLOAT_TO_SHORT(rgba[i][GCOMP]);
- dst[i*3+2] = FLOAT_TO_SHORT(rgba[i][BCOMP]);
- }
- break;
- case GL_RGBA:
- for (i=0;i<n;i++) {
- dst[i*4+0] = FLOAT_TO_SHORT(rgba[i][RCOMP]);
- dst[i*4+1] = FLOAT_TO_SHORT(rgba[i][GCOMP]);
- dst[i*4+2] = FLOAT_TO_SHORT(rgba[i][BCOMP]);
- dst[i*4+3] = FLOAT_TO_SHORT(rgba[i][ACOMP]);
- }
- break;
- case GL_BGR:
- for (i=0;i<n;i++) {
- dst[i*3+0] = FLOAT_TO_SHORT(rgba[i][BCOMP]);
- dst[i*3+1] = FLOAT_TO_SHORT(rgba[i][GCOMP]);
- dst[i*3+2] = FLOAT_TO_SHORT(rgba[i][RCOMP]);
- }
- break;
- case GL_BGRA:
- for (i=0;i<n;i++) {
- dst[i*4+0] = FLOAT_TO_SHORT(rgba[i][BCOMP]);
- dst[i*4+1] = FLOAT_TO_SHORT(rgba[i][GCOMP]);
- dst[i*4+2] = FLOAT_TO_SHORT(rgba[i][RCOMP]);
- dst[i*4+3] = FLOAT_TO_SHORT(rgba[i][ACOMP]);
- }
- break;
- case GL_ABGR_EXT:
- for (i=0;i<n;i++) {
- dst[i*4+0] = FLOAT_TO_SHORT(rgba[i][ACOMP]);
- dst[i*4+1] = FLOAT_TO_SHORT(rgba[i][BCOMP]);
- dst[i*4+2] = FLOAT_TO_SHORT(rgba[i][GCOMP]);
- dst[i*4+3] = FLOAT_TO_SHORT(rgba[i][RCOMP]);
- }
- break;
- case GL_RED_INTEGER_EXT:
- for (i=0;i<n;i++) {
- dst[i] = (GLshort) rgba[i][RCOMP];
- }
- break;
- case GL_GREEN_INTEGER_EXT:
- for (i=0;i<n;i++) {
- dst[i] = (GLshort) rgba[i][GCOMP];
- }
- break;
- case GL_BLUE_INTEGER_EXT:
- for (i=0;i<n;i++) {
- dst[i] = (GLshort) rgba[i][BCOMP];
- }
- break;
- case GL_ALPHA_INTEGER_EXT:
- for (i=0;i<n;i++) {
- dst[i] = (GLshort) rgba[i][ACOMP];
- }
- break;
- case GL_RGB_INTEGER_EXT:
- for (i=0;i<n;i++) {
- dst[i*3+0] = (GLshort) rgba[i][RCOMP];
- dst[i*3+1] = (GLshort) rgba[i][GCOMP];
- dst[i*3+2] = (GLshort) rgba[i][BCOMP];
- }
- break;
- case GL_RGBA_INTEGER_EXT:
- for (i=0;i<n;i++) {
- dst[i*4+0] = (GLshort) rgba[i][RCOMP];
- dst[i*4+1] = (GLshort) rgba[i][GCOMP];
- dst[i*4+2] = (GLshort) rgba[i][BCOMP];
- dst[i*4+3] = (GLshort) rgba[i][ACOMP];
- }
- break;
- case GL_BGR_INTEGER_EXT:
- for (i=0;i<n;i++) {
- dst[i*3+0] = (GLshort) rgba[i][BCOMP];
- dst[i*3+1] = (GLshort) rgba[i][GCOMP];
- dst[i*3+2] = (GLshort) rgba[i][RCOMP];
- }
- break;
- case GL_BGRA_INTEGER_EXT:
- for (i=0;i<n;i++) {
- dst[i*4+0] = (GLshort) rgba[i][BCOMP];
- dst[i*4+1] = (GLshort) rgba[i][GCOMP];
- dst[i*4+2] = (GLshort) rgba[i][RCOMP];
- dst[i*4+3] = (GLshort) rgba[i][ACOMP];
- }
- break;
- case GL_LUMINANCE_INTEGER_EXT:
- for (i=0;i<n;i++) {
- dst[i*2+0] = (GLshort) (rgba[i][RCOMP] +
- rgba[i][GCOMP] +
- rgba[i][BCOMP]);
- dst[i*2+1] = (GLshort) rgba[i][ACOMP];
- }
- break;
- case GL_LUMINANCE_ALPHA_INTEGER_EXT:
- for (i=0;i<n;i++) {
- dst[i] = (GLshort) (rgba[i][RCOMP] +
- rgba[i][GCOMP] +
- rgba[i][BCOMP]);
- }
- break;
- case GL_DUDV_ATI:
- case GL_DU8DV8_ATI:
- for (i=0;i<n;i++) {
- dst[i*2+0] = FLOAT_TO_SHORT(rgba[i][RCOMP]);
- dst[i*2+1] = FLOAT_TO_SHORT(rgba[i][GCOMP]);
- }
- break;
- default:
- _mesa_problem(ctx, "bad format in _mesa_pack_rgba_span\n");
- }
- }
- break;
- case GL_UNSIGNED_INT:
- {
- GLuint *dst = (GLuint *) dstAddr;
- switch (dstFormat) {
- case GL_RED:
- for (i=0;i<n;i++)
- dst[i] = FLOAT_TO_UINT(rgba[i][RCOMP]);
- break;
- case GL_GREEN:
- for (i=0;i<n;i++)
- dst[i] = FLOAT_TO_UINT(rgba[i][GCOMP]);
- break;
- case GL_BLUE:
- for (i=0;i<n;i++)
- dst[i] = FLOAT_TO_UINT(rgba[i][BCOMP]);
- break;
- case GL_ALPHA:
- for (i=0;i<n;i++)
- dst[i] = FLOAT_TO_UINT(rgba[i][ACOMP]);
- break;
- case GL_LUMINANCE:
- for (i=0;i<n;i++)
- dst[i] = FLOAT_TO_UINT(luminance[i]);
- break;
- case GL_LUMINANCE_ALPHA:
- for (i=0;i<n;i++) {
- dst[i*2+0] = FLOAT_TO_UINT(luminance[i]);
- dst[i*2+1] = FLOAT_TO_UINT(rgba[i][ACOMP]);
- }
- break;
- case GL_RG:
- for (i=0;i<n;i++) {
- dst[i*2+0] = FLOAT_TO_UINT(rgba[i][RCOMP]);
- dst[i*2+1] = FLOAT_TO_UINT(rgba[i][GCOMP]);
- }
- break;
- case GL_RGB:
- for (i=0;i<n;i++) {
- dst[i*3+0] = FLOAT_TO_UINT(rgba[i][RCOMP]);
- dst[i*3+1] = FLOAT_TO_UINT(rgba[i][GCOMP]);
- dst[i*3+2] = FLOAT_TO_UINT(rgba[i][BCOMP]);
- }
- break;
- case GL_RGBA:
- for (i=0;i<n;i++) {
- dst[i*4+0] = FLOAT_TO_UINT(rgba[i][RCOMP]);
- dst[i*4+1] = FLOAT_TO_UINT(rgba[i][GCOMP]);
- dst[i*4+2] = FLOAT_TO_UINT(rgba[i][BCOMP]);
- dst[i*4+3] = FLOAT_TO_UINT(rgba[i][ACOMP]);
- }
- break;
- case GL_BGR:
- for (i=0;i<n;i++) {
- dst[i*3+0] = FLOAT_TO_UINT(rgba[i][BCOMP]);
- dst[i*3+1] = FLOAT_TO_UINT(rgba[i][GCOMP]);
- dst[i*3+2] = FLOAT_TO_UINT(rgba[i][RCOMP]);
- }
- break;
- case GL_BGRA:
- for (i=0;i<n;i++) {
- dst[i*4+0] = FLOAT_TO_UINT(rgba[i][BCOMP]);
- dst[i*4+1] = FLOAT_TO_UINT(rgba[i][GCOMP]);
- dst[i*4+2] = FLOAT_TO_UINT(rgba[i][RCOMP]);
- dst[i*4+3] = FLOAT_TO_UINT(rgba[i][ACOMP]);
- }
- break;
- case GL_ABGR_EXT:
- for (i=0;i<n;i++) {
- dst[i*4+0] = FLOAT_TO_UINT(rgba[i][ACOMP]);
- dst[i*4+1] = FLOAT_TO_UINT(rgba[i][BCOMP]);
- dst[i*4+2] = FLOAT_TO_UINT(rgba[i][GCOMP]);
- dst[i*4+3] = FLOAT_TO_UINT(rgba[i][RCOMP]);
- }
- break;
- case GL_RED_INTEGER_EXT:
- for (i=0;i<n;i++) {
- dst[i] = (GLuint) rgba[i][RCOMP];
- }
- break;
- case GL_GREEN_INTEGER_EXT:
- for (i=0;i<n;i++) {
- dst[i] = (GLuint) rgba[i][GCOMP];
- }
- break;
- case GL_BLUE_INTEGER_EXT:
- for (i=0;i<n;i++) {
- dst[i] = (GLuint) rgba[i][BCOMP];
- }
- break;
- case GL_ALPHA_INTEGER_EXT:
- for (i=0;i<n;i++) {
- dst[i] = (GLuint) rgba[i][ACOMP];
- }
- break;
- case GL_RGB_INTEGER_EXT:
- for (i=0;i<n;i++) {
- dst[i*3+0] = (GLuint) rgba[i][RCOMP];
- dst[i*3+1] = (GLuint) rgba[i][GCOMP];
- dst[i*3+2] = (GLuint) rgba[i][BCOMP];
- }
- break;
- case GL_RGBA_INTEGER_EXT:
- for (i=0;i<n;i++) {
- dst[i*4+0] = (GLuint) rgba[i][RCOMP];
- dst[i*4+1] = (GLuint) rgba[i][GCOMP];
- dst[i*4+2] = (GLuint) rgba[i][BCOMP];
- dst[i*4+3] = (GLuint) rgba[i][ACOMP];
- }
- break;
- case GL_BGR_INTEGER_EXT:
- for (i=0;i<n;i++) {
- dst[i*3+0] = (GLuint) rgba[i][BCOMP];
- dst[i*3+1] = (GLuint) rgba[i][GCOMP];
- dst[i*3+2] = (GLuint) rgba[i][RCOMP];
- }
- break;
- case GL_BGRA_INTEGER_EXT:
- for (i=0;i<n;i++) {
- dst[i*4+0] = (GLuint) rgba[i][BCOMP];
- dst[i*4+1] = (GLuint) rgba[i][GCOMP];
- dst[i*4+2] = (GLuint) rgba[i][RCOMP];
- dst[i*4+3] = (GLuint) rgba[i][ACOMP];
- }
- break;
- case GL_LUMINANCE_INTEGER_EXT:
- for (i=0;i<n;i++) {
- dst[i*2+0] = (GLuint) (rgba[i][RCOMP] +
- rgba[i][GCOMP] +
- rgba[i][BCOMP]);
- dst[i*2+1] = (GLuint) rgba[i][ACOMP];
- }
- break;
- case GL_LUMINANCE_ALPHA_INTEGER_EXT:
- for (i=0;i<n;i++) {
- dst[i] = (GLuint) (rgba[i][RCOMP] +
- rgba[i][GCOMP] +
- rgba[i][BCOMP]);
- }
- break;
- case GL_DUDV_ATI:
- case GL_DU8DV8_ATI:
- for (i=0;i<n;i++) {
- dst[i*2+0] = FLOAT_TO_UINT(rgba[i][RCOMP]);
- dst[i*2+1] = FLOAT_TO_UINT(rgba[i][GCOMP]);
- }
- break;
- default:
- _mesa_problem(ctx, "bad format in _mesa_pack_rgba_span\n");
- }
- }
- break;
- case GL_INT:
- {
- GLint *dst = (GLint *) dstAddr;
- switch (dstFormat) {
- case GL_RED:
- for (i=0;i<n;i++)
- dst[i] = FLOAT_TO_INT(rgba[i][RCOMP]);
- break;
- case GL_GREEN:
- for (i=0;i<n;i++)
- dst[i] = FLOAT_TO_INT(rgba[i][GCOMP]);
- break;
- case GL_BLUE:
- for (i=0;i<n;i++)
- dst[i] = FLOAT_TO_INT(rgba[i][BCOMP]);
- break;
- case GL_ALPHA:
- for (i=0;i<n;i++)
- dst[i] = FLOAT_TO_INT(rgba[i][ACOMP]);
- break;
- case GL_LUMINANCE:
- for (i=0;i<n;i++)
- dst[i] = FLOAT_TO_INT(luminance[i]);
- break;
- case GL_LUMINANCE_ALPHA:
- for (i=0;i<n;i++) {
- dst[i*2+0] = FLOAT_TO_INT(luminance[i]);
- dst[i*2+1] = FLOAT_TO_INT(rgba[i][ACOMP]);
- }
- break;
- case GL_RG:
- for (i=0;i<n;i++) {
- dst[i*2+0] = FLOAT_TO_INT(rgba[i][RCOMP]);
- dst[i*2+1] = FLOAT_TO_INT(rgba[i][GCOMP]);
- }
- break;
- case GL_RGB:
- for (i=0;i<n;i++) {
- dst[i*3+0] = FLOAT_TO_INT(rgba[i][RCOMP]);
- dst[i*3+1] = FLOAT_TO_INT(rgba[i][GCOMP]);
- dst[i*3+2] = FLOAT_TO_INT(rgba[i][BCOMP]);
- }
- break;
- case GL_RGBA:
- for (i=0;i<n;i++) {
- dst[i*4+0] = FLOAT_TO_INT(rgba[i][RCOMP]);
- dst[i*4+1] = FLOAT_TO_INT(rgba[i][GCOMP]);
- dst[i*4+2] = FLOAT_TO_INT(rgba[i][BCOMP]);
- dst[i*4+3] = FLOAT_TO_INT(rgba[i][ACOMP]);
- }
- break;
- case GL_BGR:
- for (i=0;i<n;i++) {
- dst[i*3+0] = FLOAT_TO_INT(rgba[i][BCOMP]);
- dst[i*3+1] = FLOAT_TO_INT(rgba[i][GCOMP]);
- dst[i*3+2] = FLOAT_TO_INT(rgba[i][RCOMP]);
- }
- break;
- case GL_BGRA:
- for (i=0;i<n;i++) {
- dst[i*4+0] = FLOAT_TO_INT(rgba[i][BCOMP]);
- dst[i*4+1] = FLOAT_TO_INT(rgba[i][GCOMP]);
- dst[i*4+2] = FLOAT_TO_INT(rgba[i][RCOMP]);
- dst[i*4+3] = FLOAT_TO_INT(rgba[i][ACOMP]);
- }
- break;
- case GL_ABGR_EXT:
- for (i=0;i<n;i++) {
- dst[i*4+0] = FLOAT_TO_INT(rgba[i][ACOMP]);
- dst[i*4+1] = FLOAT_TO_INT(rgba[i][BCOMP]);
- dst[i*4+2] = FLOAT_TO_INT(rgba[i][GCOMP]);
- dst[i*4+3] = FLOAT_TO_INT(rgba[i][RCOMP]);
- }
- break;
- case GL_DUDV_ATI:
- case GL_DU8DV8_ATI:
- for (i=0;i<n;i++) {
- dst[i*2+0] = FLOAT_TO_INT(rgba[i][RCOMP]);
- dst[i*2+1] = FLOAT_TO_INT(rgba[i][GCOMP]);
- }
- break;
- case GL_RED_INTEGER_EXT:
- for (i=0;i<n;i++) {
- dst[i] = (GLint) rgba[i][RCOMP];
- }
- break;
- case GL_GREEN_INTEGER_EXT:
- for (i=0;i<n;i++) {
- dst[i] = (GLint) rgba[i][GCOMP];
- }
- break;
- case GL_BLUE_INTEGER_EXT:
- for (i=0;i<n;i++) {
- dst[i] = (GLint) rgba[i][BCOMP];
- }
- break;
- case GL_ALPHA_INTEGER_EXT:
- for (i=0;i<n;i++) {
- dst[i] = (GLint) rgba[i][ACOMP];
- }
- break;
- case GL_RGB_INTEGER_EXT:
- for (i=0;i<n;i++) {
- dst[i*3+0] = (GLint) rgba[i][RCOMP];
- dst[i*3+1] = (GLint) rgba[i][GCOMP];
- dst[i*3+2] = (GLint) rgba[i][BCOMP];
- }
- break;
- case GL_RGBA_INTEGER_EXT:
- for (i=0;i<n;i++) {
- dst[i*4+0] = (GLint) rgba[i][RCOMP];
- dst[i*4+1] = (GLint) rgba[i][GCOMP];
- dst[i*4+2] = (GLint) rgba[i][BCOMP];
- dst[i*4+3] = (GLint) rgba[i][ACOMP];
- }
- break;
- case GL_BGR_INTEGER_EXT:
- for (i=0;i<n;i++) {
- dst[i*3+0] = (GLint) rgba[i][BCOMP];
- dst[i*3+1] = (GLint) rgba[i][GCOMP];
- dst[i*3+2] = (GLint) rgba[i][RCOMP];
- }
- break;
- case GL_BGRA_INTEGER_EXT:
- for (i=0;i<n;i++) {
- dst[i*4+0] = (GLint) rgba[i][BCOMP];
- dst[i*4+1] = (GLint) rgba[i][GCOMP];
- dst[i*4+2] = (GLint) rgba[i][RCOMP];
- dst[i*4+3] = (GLint) rgba[i][ACOMP];
- }
- break;
- case GL_LUMINANCE_INTEGER_EXT:
- for (i=0;i<n;i++) {
- dst[i*2+0] = (GLint) (rgba[i][RCOMP] +
- rgba[i][GCOMP] +
- rgba[i][BCOMP]);
- dst[i*2+1] = (GLint) rgba[i][ACOMP];
- }
- break;
- case GL_LUMINANCE_ALPHA_INTEGER_EXT:
- for (i=0;i<n;i++) {
- dst[i] = (GLint) (rgba[i][RCOMP] +
- rgba[i][GCOMP] +
- rgba[i][BCOMP]);
- }
- break;
- default:
- _mesa_problem(ctx, "bad format in _mesa_pack_rgba_span\n");
- }
- }
- break;
- case GL_FLOAT:
- {
- GLfloat *dst = (GLfloat *) dstAddr;
- switch (dstFormat) {
- case GL_RED:
- for (i=0;i<n;i++)
- dst[i] = rgba[i][RCOMP];
- break;
- case GL_GREEN:
- for (i=0;i<n;i++)
- dst[i] = rgba[i][GCOMP];
- break;
- case GL_BLUE:
- for (i=0;i<n;i++)
- dst[i] = rgba[i][BCOMP];
- break;
- case GL_ALPHA:
- for (i=0;i<n;i++)
- dst[i] = rgba[i][ACOMP];
- break;
- case GL_LUMINANCE:
- for (i=0;i<n;i++)
- dst[i] = luminance[i];
- break;
- case GL_LUMINANCE_ALPHA:
- for (i=0;i<n;i++) {
- dst[i*2+0] = luminance[i];
- dst[i*2+1] = rgba[i][ACOMP];
- }
- break;
- case GL_RG:
- for (i=0;i<n;i++) {
- dst[i*2+0] = rgba[i][RCOMP];
- dst[i*2+1] = rgba[i][GCOMP];
- }
- break;
- case GL_RGB:
- for (i=0;i<n;i++) {
- dst[i*3+0] = rgba[i][RCOMP];
- dst[i*3+1] = rgba[i][GCOMP];
- dst[i*3+2] = rgba[i][BCOMP];
- }
- break;
- case GL_RGBA:
- for (i=0;i<n;i++) {
- dst[i*4+0] = rgba[i][RCOMP];
- dst[i*4+1] = rgba[i][GCOMP];
- dst[i*4+2] = rgba[i][BCOMP];
- dst[i*4+3] = rgba[i][ACOMP];
- }
- break;
- case GL_BGR:
- for (i=0;i<n;i++) {
- dst[i*3+0] = rgba[i][BCOMP];
- dst[i*3+1] = rgba[i][GCOMP];
- dst[i*3+2] = rgba[i][RCOMP];
- }
- break;
- case GL_BGRA:
- for (i=0;i<n;i++) {
- dst[i*4+0] = rgba[i][BCOMP];
- dst[i*4+1] = rgba[i][GCOMP];
- dst[i*4+2] = rgba[i][RCOMP];
- dst[i*4+3] = rgba[i][ACOMP];
- }
- break;
- case GL_ABGR_EXT:
- for (i=0;i<n;i++) {
- dst[i*4+0] = rgba[i][ACOMP];
- dst[i*4+1] = rgba[i][BCOMP];
- dst[i*4+2] = rgba[i][GCOMP];
- dst[i*4+3] = rgba[i][RCOMP];
- }
- break;
- case GL_DUDV_ATI:
- case GL_DU8DV8_ATI:
- for (i=0;i<n;i++) {
- dst[i*2+0] = rgba[i][RCOMP];
- dst[i*2+1] = rgba[i][GCOMP];
- }
- break;
- default:
- _mesa_problem(ctx, "bad format in _mesa_pack_rgba_span\n");
- }
- }
- break;
- case GL_HALF_FLOAT_ARB:
- {
- GLhalfARB *dst = (GLhalfARB *) dstAddr;
- switch (dstFormat) {
- case GL_RED:
- for (i=0;i<n;i++)
- dst[i] = _mesa_float_to_half(rgba[i][RCOMP]);
- break;
- case GL_GREEN:
- for (i=0;i<n;i++)
- dst[i] = _mesa_float_to_half(rgba[i][GCOMP]);
- break;
- case GL_BLUE:
- for (i=0;i<n;i++)
- dst[i] = _mesa_float_to_half(rgba[i][BCOMP]);
- break;
- case GL_ALPHA:
- for (i=0;i<n;i++)
- dst[i] = _mesa_float_to_half(rgba[i][ACOMP]);
- break;
- case GL_LUMINANCE:
- for (i=0;i<n;i++)
- dst[i] = _mesa_float_to_half(luminance[i]);
- break;
- case GL_LUMINANCE_ALPHA:
- for (i=0;i<n;i++) {
- dst[i*2+0] = _mesa_float_to_half(luminance[i]);
- dst[i*2+1] = _mesa_float_to_half(rgba[i][ACOMP]);
- }
- break;
- case GL_RG:
- for (i=0;i<n;i++) {
- dst[i*2+0] = _mesa_float_to_half(rgba[i][RCOMP]);
- dst[i*2+1] = _mesa_float_to_half(rgba[i][GCOMP]);
- }
- break;
- case GL_RGB:
- for (i=0;i<n;i++) {
- dst[i*3+0] = _mesa_float_to_half(rgba[i][RCOMP]);
- dst[i*3+1] = _mesa_float_to_half(rgba[i][GCOMP]);
- dst[i*3+2] = _mesa_float_to_half(rgba[i][BCOMP]);
- }
- break;
- case GL_RGBA:
- for (i=0;i<n;i++) {
- dst[i*4+0] = _mesa_float_to_half(rgba[i][RCOMP]);
- dst[i*4+1] = _mesa_float_to_half(rgba[i][GCOMP]);
- dst[i*4+2] = _mesa_float_to_half(rgba[i][BCOMP]);
- dst[i*4+3] = _mesa_float_to_half(rgba[i][ACOMP]);
- }
- break;
- case GL_BGR:
- for (i=0;i<n;i++) {
- dst[i*3+0] = _mesa_float_to_half(rgba[i][BCOMP]);
- dst[i*3+1] = _mesa_float_to_half(rgba[i][GCOMP]);
- dst[i*3+2] = _mesa_float_to_half(rgba[i][RCOMP]);
- }
- break;
- case GL_BGRA:
- for (i=0;i<n;i++) {
- dst[i*4+0] = _mesa_float_to_half(rgba[i][BCOMP]);
- dst[i*4+1] = _mesa_float_to_half(rgba[i][GCOMP]);
- dst[i*4+2] = _mesa_float_to_half(rgba[i][RCOMP]);
- dst[i*4+3] = _mesa_float_to_half(rgba[i][ACOMP]);
- }
- break;
- case GL_ABGR_EXT:
- for (i=0;i<n;i++) {
- dst[i*4+0] = _mesa_float_to_half(rgba[i][ACOMP]);
- dst[i*4+1] = _mesa_float_to_half(rgba[i][BCOMP]);
- dst[i*4+2] = _mesa_float_to_half(rgba[i][GCOMP]);
- dst[i*4+3] = _mesa_float_to_half(rgba[i][RCOMP]);
- }
- break;
- case GL_DUDV_ATI:
- case GL_DU8DV8_ATI:
- for (i=0;i<n;i++) {
- dst[i*2+0] = _mesa_float_to_half(rgba[i][RCOMP]);
- dst[i*2+1] = _mesa_float_to_half(rgba[i][GCOMP]);
- }
- break;
- default:
- _mesa_problem(ctx, "bad format in _mesa_pack_rgba_span\n");
- }
- }
- break;
- case GL_UNSIGNED_BYTE_3_3_2:
- if (dstFormat == GL_RGB) {
- GLubyte *dst = (GLubyte *) dstAddr;
- for (i=0;i<n;i++) {
- dst[i] = (IROUND(rgba[i][RCOMP] * 7.0F) << 5)
- | (IROUND(rgba[i][GCOMP] * 7.0F) << 2)
- | (IROUND(rgba[i][BCOMP] * 3.0F) );
- }
- }
- break;
- case GL_UNSIGNED_BYTE_2_3_3_REV:
- if (dstFormat == GL_RGB) {
- GLubyte *dst = (GLubyte *) dstAddr;
- for (i=0;i<n;i++) {
- dst[i] = (IROUND(rgba[i][RCOMP] * 7.0F) )
- | (IROUND(rgba[i][GCOMP] * 7.0F) << 3)
- | (IROUND(rgba[i][BCOMP] * 3.0F) << 6);
- }
- }
- break;
- case GL_UNSIGNED_SHORT_5_6_5:
- if (dstFormat == GL_RGB) {
- GLushort *dst = (GLushort *) dstAddr;
- for (i=0;i<n;i++) {
- dst[i] = (IROUND(rgba[i][RCOMP] * 31.0F) << 11)
- | (IROUND(rgba[i][GCOMP] * 63.0F) << 5)
- | (IROUND(rgba[i][BCOMP] * 31.0F) );
- }
- }
- break;
- case GL_UNSIGNED_SHORT_5_6_5_REV:
- if (dstFormat == GL_RGB) {
- GLushort *dst = (GLushort *) dstAddr;
- for (i=0;i<n;i++) {
- dst[i] = (IROUND(rgba[i][RCOMP] * 31.0F) )
- | (IROUND(rgba[i][GCOMP] * 63.0F) << 5)
- | (IROUND(rgba[i][BCOMP] * 31.0F) << 11);
- }
- }
- break;
- case GL_UNSIGNED_SHORT_4_4_4_4:
- if (dstFormat == GL_RGBA) {
- GLushort *dst = (GLushort *) dstAddr;
- for (i=0;i<n;i++) {
- dst[i] = (IROUND(rgba[i][RCOMP] * 15.0F) << 12)
- | (IROUND(rgba[i][GCOMP] * 15.0F) << 8)
- | (IROUND(rgba[i][BCOMP] * 15.0F) << 4)
- | (IROUND(rgba[i][ACOMP] * 15.0F) );
- }
- }
- else if (dstFormat == GL_BGRA) {
- GLushort *dst = (GLushort *) dstAddr;
- for (i=0;i<n;i++) {
- dst[i] = (IROUND(rgba[i][BCOMP] * 15.0F) << 12)
- | (IROUND(rgba[i][GCOMP] * 15.0F) << 8)
- | (IROUND(rgba[i][RCOMP] * 15.0F) << 4)
- | (IROUND(rgba[i][ACOMP] * 15.0F) );
- }
- }
- else if (dstFormat == GL_ABGR_EXT) {
- GLushort *dst = (GLushort *) dstAddr;
- for (i=0;i<n;i++) {
- dst[i] = (IROUND(rgba[i][ACOMP] * 15.0F) << 12)
- | (IROUND(rgba[i][BCOMP] * 15.0F) << 8)
- | (IROUND(rgba[i][GCOMP] * 15.0F) << 4)
- | (IROUND(rgba[i][RCOMP] * 15.0F) );
- }
- }
- break;
- case GL_UNSIGNED_SHORT_4_4_4_4_REV:
- if (dstFormat == GL_RGBA) {
- GLushort *dst = (GLushort *) dstAddr;
- for (i=0;i<n;i++) {
- dst[i] = (IROUND(rgba[i][RCOMP] * 15.0F) )
- | (IROUND(rgba[i][GCOMP] * 15.0F) << 4)
- | (IROUND(rgba[i][BCOMP] * 15.0F) << 8)
- | (IROUND(rgba[i][ACOMP] * 15.0F) << 12);
- }
- }
- else if (dstFormat == GL_BGRA) {
- GLushort *dst = (GLushort *) dstAddr;
- for (i=0;i<n;i++) {
- dst[i] = (IROUND(rgba[i][BCOMP] * 15.0F) )
- | (IROUND(rgba[i][GCOMP] * 15.0F) << 4)
- | (IROUND(rgba[i][RCOMP] * 15.0F) << 8)
- | (IROUND(rgba[i][ACOMP] * 15.0F) << 12);
- }
- }
- else if (dstFormat == GL_ABGR_EXT) {
- GLushort *dst = (GLushort *) dstAddr;
- for (i=0;i<n;i++) {
- dst[i] = (IROUND(rgba[i][ACOMP] * 15.0F) )
- | (IROUND(rgba[i][BCOMP] * 15.0F) << 4)
- | (IROUND(rgba[i][GCOMP] * 15.0F) << 8)
- | (IROUND(rgba[i][RCOMP] * 15.0F) << 12);
- }
- }
- break;
- case GL_UNSIGNED_SHORT_5_5_5_1:
- if (dstFormat == GL_RGBA) {
- GLushort *dst = (GLushort *) dstAddr;
- for (i=0;i<n;i++) {
- dst[i] = (IROUND(rgba[i][RCOMP] * 31.0F) << 11)
- | (IROUND(rgba[i][GCOMP] * 31.0F) << 6)
- | (IROUND(rgba[i][BCOMP] * 31.0F) << 1)
- | (IROUND(rgba[i][ACOMP] * 1.0F) );
- }
- }
- else if (dstFormat == GL_BGRA) {
- GLushort *dst = (GLushort *) dstAddr;
- for (i=0;i<n;i++) {
- dst[i] = (IROUND(rgba[i][BCOMP] * 31.0F) << 11)
- | (IROUND(rgba[i][GCOMP] * 31.0F) << 6)
- | (IROUND(rgba[i][RCOMP] * 31.0F) << 1)
- | (IROUND(rgba[i][ACOMP] * 1.0F) );
- }
- }
- else if (dstFormat == GL_ABGR_EXT) {
- GLushort *dst = (GLushort *) dstAddr;
- for (i=0;i<n;i++) {
- dst[i] = (IROUND(rgba[i][ACOMP] * 31.0F) << 11)
- | (IROUND(rgba[i][BCOMP] * 31.0F) << 6)
- | (IROUND(rgba[i][GCOMP] * 31.0F) << 1)
- | (IROUND(rgba[i][RCOMP] * 1.0F) );
- }
- }
- break;
- case GL_UNSIGNED_SHORT_1_5_5_5_REV:
- if (dstFormat == GL_RGBA) {
- GLushort *dst = (GLushort *) dstAddr;
- for (i=0;i<n;i++) {
- dst[i] = (IROUND(rgba[i][RCOMP] * 31.0F) )
- | (IROUND(rgba[i][GCOMP] * 31.0F) << 5)
- | (IROUND(rgba[i][BCOMP] * 31.0F) << 10)
- | (IROUND(rgba[i][ACOMP] * 1.0F) << 15);
- }
- }
- else if (dstFormat == GL_BGRA) {
- GLushort *dst = (GLushort *) dstAddr;
- for (i=0;i<n;i++) {
- dst[i] = (IROUND(rgba[i][BCOMP] * 31.0F) )
- | (IROUND(rgba[i][GCOMP] * 31.0F) << 5)
- | (IROUND(rgba[i][RCOMP] * 31.0F) << 10)
- | (IROUND(rgba[i][ACOMP] * 1.0F) << 15);
- }
- }
- else if (dstFormat == GL_ABGR_EXT) {
- GLushort *dst = (GLushort *) dstAddr;
- for (i=0;i<n;i++) {
- dst[i] = (IROUND(rgba[i][ACOMP] * 31.0F) )
- | (IROUND(rgba[i][BCOMP] * 31.0F) << 5)
- | (IROUND(rgba[i][GCOMP] * 31.0F) << 10)
- | (IROUND(rgba[i][RCOMP] * 1.0F) << 15);
- }
- }
- break;
- case GL_UNSIGNED_INT_8_8_8_8:
- if (dstFormat == GL_RGBA) {
- GLuint *dst = (GLuint *) dstAddr;
- for (i=0;i<n;i++) {
- dst[i] = (IROUND(rgba[i][RCOMP] * 255.F) << 24)
- | (IROUND(rgba[i][GCOMP] * 255.F) << 16)
- | (IROUND(rgba[i][BCOMP] * 255.F) << 8)
- | (IROUND(rgba[i][ACOMP] * 255.F) );
- }
- }
- else if (dstFormat == GL_BGRA) {
- GLuint *dst = (GLuint *) dstAddr;
- for (i=0;i<n;i++) {
- dst[i] = (IROUND(rgba[i][BCOMP] * 255.F) << 24)
- | (IROUND(rgba[i][GCOMP] * 255.F) << 16)
- | (IROUND(rgba[i][RCOMP] * 255.F) << 8)
- | (IROUND(rgba[i][ACOMP] * 255.F) );
- }
- }
- else if (dstFormat == GL_ABGR_EXT) {
- GLuint *dst = (GLuint *) dstAddr;
- for (i=0;i<n;i++) {
- dst[i] = (IROUND(rgba[i][ACOMP] * 255.F) << 24)
- | (IROUND(rgba[i][BCOMP] * 255.F) << 16)
- | (IROUND(rgba[i][GCOMP] * 255.F) << 8)
- | (IROUND(rgba[i][RCOMP] * 255.F) );
- }
- }
- break;
- case GL_UNSIGNED_INT_8_8_8_8_REV:
- if (dstFormat == GL_RGBA) {
- GLuint *dst = (GLuint *) dstAddr;
- for (i=0;i<n;i++) {
- dst[i] = (IROUND(rgba[i][RCOMP] * 255.0F) )
- | (IROUND(rgba[i][GCOMP] * 255.0F) << 8)
- | (IROUND(rgba[i][BCOMP] * 255.0F) << 16)
- | (IROUND(rgba[i][ACOMP] * 255.0F) << 24);
- }
- }
- else if (dstFormat == GL_BGRA) {
- GLuint *dst = (GLuint *) dstAddr;
- for (i=0;i<n;i++) {
- dst[i] = (IROUND(rgba[i][BCOMP] * 255.0F) )
- | (IROUND(rgba[i][GCOMP] * 255.0F) << 8)
- | (IROUND(rgba[i][RCOMP] * 255.0F) << 16)
- | (IROUND(rgba[i][ACOMP] * 255.0F) << 24);
- }
- }
- else if (dstFormat == GL_ABGR_EXT) {
- GLuint *dst = (GLuint *) dstAddr;
- for (i=0;i<n;i++) {
- dst[i] = (IROUND(rgba[i][ACOMP] * 255.0F) )
- | (IROUND(rgba[i][BCOMP] * 255.0F) << 8)
- | (IROUND(rgba[i][GCOMP] * 255.0F) << 16)
- | (IROUND(rgba[i][RCOMP] * 255.0F) << 24);
- }
- }
- break;
- case GL_UNSIGNED_INT_10_10_10_2:
- if (dstFormat == GL_RGBA) {
- GLuint *dst = (GLuint *) dstAddr;
- for (i=0;i<n;i++) {
- dst[i] = (IROUND(rgba[i][RCOMP] * 1023.0F) << 22)
- | (IROUND(rgba[i][GCOMP] * 1023.0F) << 12)
- | (IROUND(rgba[i][BCOMP] * 1023.0F) << 2)
- | (IROUND(rgba[i][ACOMP] * 3.0F) );
- }
- }
- else if (dstFormat == GL_BGRA) {
- GLuint *dst = (GLuint *) dstAddr;
- for (i=0;i<n;i++) {
- dst[i] = (IROUND(rgba[i][BCOMP] * 1023.0F) << 22)
- | (IROUND(rgba[i][GCOMP] * 1023.0F) << 12)
- | (IROUND(rgba[i][RCOMP] * 1023.0F) << 2)
- | (IROUND(rgba[i][ACOMP] * 3.0F) );
- }
- }
- else if (dstFormat == GL_ABGR_EXT) {
- GLuint *dst = (GLuint *) dstAddr;
- for (i=0;i<n;i++) {
- dst[i] = (IROUND(rgba[i][ACOMP] * 1023.0F) << 22)
- | (IROUND(rgba[i][BCOMP] * 1023.0F) << 12)
- | (IROUND(rgba[i][GCOMP] * 1023.0F) << 2)
- | (IROUND(rgba[i][RCOMP] * 3.0F) );
- }
- }
- break;
- case GL_UNSIGNED_INT_2_10_10_10_REV:
- if (dstFormat == GL_RGBA) {
- GLuint *dst = (GLuint *) dstAddr;
- for (i=0;i<n;i++) {
- dst[i] = (IROUND(rgba[i][RCOMP] * 1023.0F) )
- | (IROUND(rgba[i][GCOMP] * 1023.0F) << 10)
- | (IROUND(rgba[i][BCOMP] * 1023.0F) << 20)
- | (IROUND(rgba[i][ACOMP] * 3.0F) << 30);
- }
- }
- else if (dstFormat == GL_BGRA) {
- GLuint *dst = (GLuint *) dstAddr;
- for (i=0;i<n;i++) {
- dst[i] = (IROUND(rgba[i][BCOMP] * 1023.0F) )
- | (IROUND(rgba[i][GCOMP] * 1023.0F) << 10)
- | (IROUND(rgba[i][RCOMP] * 1023.0F) << 20)
- | (IROUND(rgba[i][ACOMP] * 3.0F) << 30);
- }
- }
- else if (dstFormat == GL_ABGR_EXT) {
- GLuint *dst = (GLuint *) dstAddr;
- for (i=0;i<n;i++) {
- dst[i] = (IROUND(rgba[i][ACOMP] * 1023.0F) )
- | (IROUND(rgba[i][BCOMP] * 1023.0F) << 10)
- | (IROUND(rgba[i][GCOMP] * 1023.0F) << 20)
- | (IROUND(rgba[i][RCOMP] * 3.0F) << 30);
- }
- }
- break;
- case GL_UNSIGNED_INT_5_9_9_9_REV:
- {
- GLuint *dst = (GLuint *) dstAddr;
- for (i = 0; i < n; i++) {
- dst[i] = float3_to_rgb9e5(rgba[i]);
- }
- }
- break;
- case GL_UNSIGNED_INT_10F_11F_11F_REV:
- {
- GLuint *dst = (GLuint *) dstAddr;
- for (i = 0; i < n; i++) {
- dst[i] = float3_to_r11g11b10f(rgba[i]);
- }
- }
- break;
- default:
- _mesa_problem(ctx, "bad type in _mesa_pack_rgba_span_float");
- return;
- }
-
- if (dstPacking->SwapBytes) {
- GLint swapSize = _mesa_sizeof_packed_type(dstType);
- if (swapSize == 2) {
- if (dstPacking->SwapBytes) {
- _mesa_swap2((GLushort *) dstAddr, n * comps);
- }
- }
- else if (swapSize == 4) {
- if (dstPacking->SwapBytes) {
- _mesa_swap4((GLuint *) dstAddr, n * comps);
- }
- }
- }
-
- free(luminance);
-}
-
-
-
-#define SWAP2BYTE(VALUE) \
- { \
- GLubyte *bytes = (GLubyte *) &(VALUE); \
- GLubyte tmp = bytes[0]; \
- bytes[0] = bytes[1]; \
- bytes[1] = tmp; \
- }
-
-#define SWAP4BYTE(VALUE) \
- { \
- GLubyte *bytes = (GLubyte *) &(VALUE); \
- GLubyte tmp = bytes[0]; \
- bytes[0] = bytes[3]; \
- bytes[3] = tmp; \
- tmp = bytes[1]; \
- bytes[1] = bytes[2]; \
- bytes[2] = tmp; \
- }
-
-
-static void
-extract_uint_indexes(GLuint n, GLuint indexes[],
- GLenum srcFormat, GLenum srcType, const GLvoid *src,
- const struct gl_pixelstore_attrib *unpack )
-{
- ASSERT(srcFormat == GL_COLOR_INDEX || srcFormat == GL_STENCIL_INDEX);
-
- ASSERT(srcType == GL_BITMAP ||
- srcType == GL_UNSIGNED_BYTE ||
- srcType == GL_BYTE ||
- srcType == GL_UNSIGNED_SHORT ||
- srcType == GL_SHORT ||
- srcType == GL_UNSIGNED_INT ||
- srcType == GL_INT ||
- srcType == GL_UNSIGNED_INT_24_8_EXT ||
- srcType == GL_HALF_FLOAT_ARB ||
- srcType == GL_FLOAT);
-
- switch (srcType) {
- case GL_BITMAP:
- {
- GLubyte *ubsrc = (GLubyte *) src;
- if (unpack->LsbFirst) {
- GLubyte mask = 1 << (unpack->SkipPixels & 0x7);
- GLuint i;
- for (i = 0; i < n; i++) {
- indexes[i] = (*ubsrc & mask) ? 1 : 0;
- if (mask == 128) {
- mask = 1;
- ubsrc++;
- }
- else {
- mask = mask << 1;
- }
- }
- }
- else {
- GLubyte mask = 128 >> (unpack->SkipPixels & 0x7);
- GLuint i;
- for (i = 0; i < n; i++) {
- indexes[i] = (*ubsrc & mask) ? 1 : 0;
- if (mask == 1) {
- mask = 128;
- ubsrc++;
- }
- else {
- mask = mask >> 1;
- }
- }
- }
- }
- break;
- case GL_UNSIGNED_BYTE:
- {
- GLuint i;
- const GLubyte *s = (const GLubyte *) src;
- for (i = 0; i < n; i++)
- indexes[i] = s[i];
- }
- break;
- case GL_BYTE:
- {
- GLuint i;
- const GLbyte *s = (const GLbyte *) src;
- for (i = 0; i < n; i++)
- indexes[i] = s[i];
- }
- break;
- case GL_UNSIGNED_SHORT:
- {
- GLuint i;
- const GLushort *s = (const GLushort *) src;
- if (unpack->SwapBytes) {
- for (i = 0; i < n; i++) {
- GLushort value = s[i];
- SWAP2BYTE(value);
- indexes[i] = value;
- }
- }
- else {
- for (i = 0; i < n; i++)
- indexes[i] = s[i];
- }
- }
- break;
- case GL_SHORT:
- {
- GLuint i;
- const GLshort *s = (const GLshort *) src;
- if (unpack->SwapBytes) {
- for (i = 0; i < n; i++) {
- GLshort value = s[i];
- SWAP2BYTE(value);
- indexes[i] = value;
- }
- }
- else {
- for (i = 0; i < n; i++)
- indexes[i] = s[i];
- }
- }
- break;
- case GL_UNSIGNED_INT:
- {
- GLuint i;
- const GLuint *s = (const GLuint *) src;
- if (unpack->SwapBytes) {
- for (i = 0; i < n; i++) {
- GLuint value = s[i];
- SWAP4BYTE(value);
- indexes[i] = value;
- }
- }
- else {
- for (i = 0; i < n; i++)
- indexes[i] = s[i];
- }
- }
- break;
- case GL_INT:
- {
- GLuint i;
- const GLint *s = (const GLint *) src;
- if (unpack->SwapBytes) {
- for (i = 0; i < n; i++) {
- GLint value = s[i];
- SWAP4BYTE(value);
- indexes[i] = value;
- }
- }
- else {
- for (i = 0; i < n; i++)
- indexes[i] = s[i];
- }
- }
- break;
- case GL_FLOAT:
- {
- GLuint i;
- const GLfloat *s = (const GLfloat *) src;
- if (unpack->SwapBytes) {
- for (i = 0; i < n; i++) {
- GLfloat value = s[i];
- SWAP4BYTE(value);
- indexes[i] = (GLuint) value;
- }
- }
- else {
- for (i = 0; i < n; i++)
- indexes[i] = (GLuint) s[i];
- }
- }
- break;
- case GL_HALF_FLOAT_ARB:
- {
- GLuint i;
- const GLhalfARB *s = (const GLhalfARB *) src;
- if (unpack->SwapBytes) {
- for (i = 0; i < n; i++) {
- GLhalfARB value = s[i];
- SWAP2BYTE(value);
- indexes[i] = (GLuint) _mesa_half_to_float(value);
- }
- }
- else {
- for (i = 0; i < n; i++)
- indexes[i] = (GLuint) _mesa_half_to_float(s[i]);
- }
- }
- break;
- case GL_UNSIGNED_INT_24_8_EXT:
- {
- GLuint i;
- const GLuint *s = (const GLuint *) src;
- if (unpack->SwapBytes) {
- for (i = 0; i < n; i++) {
- GLuint value = s[i];
- SWAP4BYTE(value);
- indexes[i] = value & 0xff; /* lower 8 bits */
- }
- }
- else {
- for (i = 0; i < n; i++)
- indexes[i] = s[i] & 0xff; /* lower 8 bits */
- }
- }
- break;
-
- default:
- _mesa_problem(NULL, "bad srcType in extract_uint_indexes");
- return;
- }
-}
-
-
-/**
- * Return source/dest RGBA indexes for unpacking pixels.
- */
-static void
-get_component_mapping(GLenum format,
- GLint *rSrc,
- GLint *gSrc,
- GLint *bSrc,
- GLint *aSrc,
- GLint *rDst,
- GLint *gDst,
- GLint *bDst,
- GLint *aDst)
-{
- switch (format) {
- case GL_RED:
- case GL_RED_INTEGER_EXT:
- *rSrc = 0;
- *gSrc = *bSrc = *aSrc = -1;
- break;
- case GL_GREEN:
- case GL_GREEN_INTEGER_EXT:
- *gSrc = 0;
- *rSrc = *bSrc = *aSrc = -1;
- break;
- case GL_BLUE:
- case GL_BLUE_INTEGER_EXT:
- *bSrc = 0;
- *rSrc = *gSrc = *aSrc = -1;
- break;
- case GL_ALPHA:
- case GL_ALPHA_INTEGER_EXT:
- *rSrc = *gSrc = *bSrc = -1;
- *aSrc = 0;
- break;
- case GL_LUMINANCE:
- case GL_LUMINANCE_INTEGER_EXT:
- *rSrc = *gSrc = *bSrc = 0;
- *aSrc = -1;
- break;
- case GL_LUMINANCE_ALPHA:
- case GL_LUMINANCE_ALPHA_INTEGER_EXT:
- *rSrc = *gSrc = *bSrc = 0;
- *aSrc = 1;
- break;
- case GL_INTENSITY:
- *rSrc = *gSrc = *bSrc = *aSrc = 0;
- break;
- case GL_RG:
- case GL_RG_INTEGER:
- *rSrc = 0;
- *gSrc = 1;
- *bSrc = -1;
- *aSrc = -1;
- *rDst = 0;
- *gDst = 1;
- *bDst = 2;
- *aDst = 3;
- break;
- case GL_RGB:
- case GL_RGB_INTEGER:
- *rSrc = 0;
- *gSrc = 1;
- *bSrc = 2;
- *aSrc = -1;
- *rDst = 0;
- *gDst = 1;
- *bDst = 2;
- *aDst = 3;
- break;
- case GL_BGR:
- *rSrc = 2;
- *gSrc = 1;
- *bSrc = 0;
- *aSrc = -1;
- *rDst = 2;
- *gDst = 1;
- *bDst = 0;
- *aDst = 3;
- break;
- case GL_RGBA:
- case GL_RGBA_INTEGER:
- *rSrc = 0;
- *gSrc = 1;
- *bSrc = 2;
- *aSrc = 3;
- *rDst = 0;
- *gDst = 1;
- *bDst = 2;
- *aDst = 3;
- break;
- case GL_BGRA:
- *rSrc = 2;
- *gSrc = 1;
- *bSrc = 0;
- *aSrc = 3;
- *rDst = 2;
- *gDst = 1;
- *bDst = 0;
- *aDst = 3;
- break;
- case GL_ABGR_EXT:
- *rSrc = 3;
- *gSrc = 2;
- *bSrc = 1;
- *aSrc = 0;
- *rDst = 3;
- *gDst = 2;
- *bDst = 1;
- *aDst = 0;
- break;
- case GL_DU8DV8_ATI:
- case GL_DUDV_ATI:
- *rSrc = 0;
- *gSrc = 1;
- *bSrc = -1;
- *aSrc = -1;
- break;
- default:
- _mesa_problem(NULL, "bad srcFormat %s in get_component_mapping",
- _mesa_lookup_enum_by_nr(format));
- return;
- }
-}
-
-
-
-/*
- * This function extracts floating point RGBA values from arbitrary
- * image data. srcFormat and srcType are the format and type parameters
- * passed to glDrawPixels, glTexImage[123]D, glTexSubImage[123]D, etc.
- *
- * Refering to section 3.6.4 of the OpenGL 1.2 spec, this function
- * implements the "Conversion to floating point", "Conversion to RGB",
- * and "Final Expansion to RGBA" operations.
- *
- * Args: n - number of pixels
- * rgba - output colors
- * srcFormat - format of incoming data
- * srcType - data type of incoming data
- * src - source data pointer
- * swapBytes - perform byteswapping of incoming data?
- */
-static void
-extract_float_rgba(GLuint n, GLfloat rgba[][4],
- GLenum srcFormat, GLenum srcType, const GLvoid *src,
- GLboolean swapBytes)
-{
- GLint rSrc, gSrc, bSrc, aSrc;
- GLint stride;
- GLint rDst, bDst, gDst, aDst;
- GLboolean intFormat;
- GLfloat rs = 1.0f, gs = 1.0f, bs = 1.0f, as = 1.0f; /* scale factors */
-
- ASSERT(srcFormat == GL_RED ||
- srcFormat == GL_GREEN ||
- srcFormat == GL_BLUE ||
- srcFormat == GL_ALPHA ||
- srcFormat == GL_LUMINANCE ||
- srcFormat == GL_LUMINANCE_ALPHA ||
- srcFormat == GL_INTENSITY ||
- srcFormat == GL_RG ||
- srcFormat == GL_RGB ||
- srcFormat == GL_BGR ||
- srcFormat == GL_RGBA ||
- srcFormat == GL_BGRA ||
- srcFormat == GL_ABGR_EXT ||
- srcFormat == GL_DU8DV8_ATI ||
- srcFormat == GL_DUDV_ATI ||
- srcFormat == GL_RED_INTEGER_EXT ||
- srcFormat == GL_GREEN_INTEGER_EXT ||
- srcFormat == GL_BLUE_INTEGER_EXT ||
- srcFormat == GL_ALPHA_INTEGER_EXT ||
- srcFormat == GL_RGB_INTEGER_EXT ||
- srcFormat == GL_RGBA_INTEGER_EXT ||
- srcFormat == GL_BGR_INTEGER_EXT ||
- srcFormat == GL_BGRA_INTEGER_EXT ||
- srcFormat == GL_LUMINANCE_INTEGER_EXT ||
- srcFormat == GL_LUMINANCE_ALPHA_INTEGER_EXT);
-
- ASSERT(srcType == GL_UNSIGNED_BYTE ||
- srcType == GL_BYTE ||
- srcType == GL_UNSIGNED_SHORT ||
- srcType == GL_SHORT ||
- srcType == GL_UNSIGNED_INT ||
- srcType == GL_INT ||
- srcType == GL_HALF_FLOAT_ARB ||
- srcType == GL_FLOAT ||
- srcType == GL_UNSIGNED_BYTE_3_3_2 ||
- srcType == GL_UNSIGNED_BYTE_2_3_3_REV ||
- srcType == GL_UNSIGNED_SHORT_5_6_5 ||
- srcType == GL_UNSIGNED_SHORT_5_6_5_REV ||
- srcType == GL_UNSIGNED_SHORT_4_4_4_4 ||
- srcType == GL_UNSIGNED_SHORT_4_4_4_4_REV ||
- srcType == GL_UNSIGNED_SHORT_5_5_5_1 ||
- srcType == GL_UNSIGNED_SHORT_1_5_5_5_REV ||
- srcType == GL_UNSIGNED_INT_8_8_8_8 ||
- srcType == GL_UNSIGNED_INT_8_8_8_8_REV ||
- srcType == GL_UNSIGNED_INT_10_10_10_2 ||
- srcType == GL_UNSIGNED_INT_2_10_10_10_REV ||
- srcType == GL_UNSIGNED_INT_5_9_9_9_REV ||
- srcType == GL_UNSIGNED_INT_10F_11F_11F_REV);
-
- get_component_mapping(srcFormat,
- &rSrc, &gSrc, &bSrc, &aSrc,
- &rDst, &gDst, &bDst, &aDst);
-
- stride = _mesa_components_in_format(srcFormat);
-
- intFormat = _mesa_is_integer_format(srcFormat);
-
-#define PROCESS(SRC_INDEX, DST_INDEX, DEFAULT_FLT, DEFAULT_INT, TYPE, CONVERSION) \
- if ((SRC_INDEX) < 0) { \
- GLuint i; \
- if (intFormat) { \
- for (i = 0; i < n; i++) { \
- rgba[i][DST_INDEX] = DEFAULT_INT; \
- } \
- } \
- else { \
- for (i = 0; i < n; i++) { \
- rgba[i][DST_INDEX] = DEFAULT_FLT; \
- } \
- } \
- } \
- else if (swapBytes) { \
- const TYPE *s = (const TYPE *) src; \
- GLuint i; \
- for (i = 0; i < n; i++) { \
- TYPE value = s[SRC_INDEX]; \
- if (sizeof(TYPE) == 2) { \
- SWAP2BYTE(value); \
- } \
- else if (sizeof(TYPE) == 4) { \
- SWAP4BYTE(value); \
- } \
- if (intFormat) \
- rgba[i][DST_INDEX] = (GLfloat) value; \
- else \
- rgba[i][DST_INDEX] = (GLfloat) CONVERSION(value); \
- s += stride; \
- } \
- } \
- else { \
- const TYPE *s = (const TYPE *) src; \
- GLuint i; \
- if (intFormat) { \
- for (i = 0; i < n; i++) { \
- rgba[i][DST_INDEX] = (GLfloat) s[SRC_INDEX]; \
- s += stride; \
- } \
- } \
- else { \
- for (i = 0; i < n; i++) { \
- rgba[i][DST_INDEX] = (GLfloat) CONVERSION(s[SRC_INDEX]); \
- s += stride; \
- } \
- } \
- }
-
- switch (srcType) {
- case GL_UNSIGNED_BYTE:
- PROCESS(rSrc, RCOMP, 0.0F, 0, GLubyte, UBYTE_TO_FLOAT);
- PROCESS(gSrc, GCOMP, 0.0F, 0, GLubyte, UBYTE_TO_FLOAT);
- PROCESS(bSrc, BCOMP, 0.0F, 0, GLubyte, UBYTE_TO_FLOAT);
- PROCESS(aSrc, ACOMP, 1.0F, 255, GLubyte, UBYTE_TO_FLOAT);
- break;
- case GL_BYTE:
- PROCESS(rSrc, RCOMP, 0.0F, 0, GLbyte, BYTE_TO_FLOAT);
- PROCESS(gSrc, GCOMP, 0.0F, 0, GLbyte, BYTE_TO_FLOAT);
- PROCESS(bSrc, BCOMP, 0.0F, 0, GLbyte, BYTE_TO_FLOAT);
- PROCESS(aSrc, ACOMP, 1.0F, 127, GLbyte, BYTE_TO_FLOAT);
- break;
- case GL_UNSIGNED_SHORT:
- PROCESS(rSrc, RCOMP, 0.0F, 0, GLushort, USHORT_TO_FLOAT);
- PROCESS(gSrc, GCOMP, 0.0F, 0, GLushort, USHORT_TO_FLOAT);
- PROCESS(bSrc, BCOMP, 0.0F, 0, GLushort, USHORT_TO_FLOAT);
- PROCESS(aSrc, ACOMP, 1.0F, 0xffff, GLushort, USHORT_TO_FLOAT);
- break;
- case GL_SHORT:
- PROCESS(rSrc, RCOMP, 0.0F, 0, GLshort, SHORT_TO_FLOAT);
- PROCESS(gSrc, GCOMP, 0.0F, 0, GLshort, SHORT_TO_FLOAT);
- PROCESS(bSrc, BCOMP, 0.0F, 0, GLshort, SHORT_TO_FLOAT);
- PROCESS(aSrc, ACOMP, 1.0F, 32767, GLshort, SHORT_TO_FLOAT);
- break;
- case GL_UNSIGNED_INT:
- PROCESS(rSrc, RCOMP, 0.0F, 0, GLuint, UINT_TO_FLOAT);
- PROCESS(gSrc, GCOMP, 0.0F, 0, GLuint, UINT_TO_FLOAT);
- PROCESS(bSrc, BCOMP, 0.0F, 0, GLuint, UINT_TO_FLOAT);
- PROCESS(aSrc, ACOMP, 1.0F, 0xffffffff, GLuint, UINT_TO_FLOAT);
- break;
- case GL_INT:
- PROCESS(rSrc, RCOMP, 0.0F, 0, GLint, INT_TO_FLOAT);
- PROCESS(gSrc, GCOMP, 0.0F, 0, GLint, INT_TO_FLOAT);
- PROCESS(bSrc, BCOMP, 0.0F, 0, GLint, INT_TO_FLOAT);
- PROCESS(aSrc, ACOMP, 1.0F, 2147483647, GLint, INT_TO_FLOAT);
- break;
- case GL_FLOAT:
- PROCESS(rSrc, RCOMP, 0.0F, 0.0F, GLfloat, (GLfloat));
- PROCESS(gSrc, GCOMP, 0.0F, 0.0F, GLfloat, (GLfloat));
- PROCESS(bSrc, BCOMP, 0.0F, 0.0F, GLfloat, (GLfloat));
- PROCESS(aSrc, ACOMP, 1.0F, 1.0F, GLfloat, (GLfloat));
- break;
- case GL_HALF_FLOAT_ARB:
- PROCESS(rSrc, RCOMP, 0.0F, 0.0F, GLhalfARB, _mesa_half_to_float);
- PROCESS(gSrc, GCOMP, 0.0F, 0.0F, GLhalfARB, _mesa_half_to_float);
- PROCESS(bSrc, BCOMP, 0.0F, 0.0F, GLhalfARB, _mesa_half_to_float);
- PROCESS(aSrc, ACOMP, 1.0F, 1.0F, GLhalfARB, _mesa_half_to_float);
- break;
- case GL_UNSIGNED_BYTE_3_3_2:
- {
- const GLubyte *ubsrc = (const GLubyte *) src;
- GLuint i;
- if (!intFormat) {
- rs = 1.0F / 7.0F;
- gs = 1.0F / 7.0F;
- bs = 1.0F / 3.0F;
- }
- for (i = 0; i < n; i ++) {
- GLubyte p = ubsrc[i];
- rgba[i][rDst] = ((p >> 5) ) * rs;
- rgba[i][gDst] = ((p >> 2) & 0x7) * gs;
- rgba[i][bDst] = ((p ) & 0x3) * bs;
- rgba[i][aDst] = 1.0F;
- }
- }
- break;
- case GL_UNSIGNED_BYTE_2_3_3_REV:
- {
- const GLubyte *ubsrc = (const GLubyte *) src;
- GLuint i;
- if (!intFormat) {
- rs = 1.0F / 7.0F;
- gs = 1.0F / 7.0F;
- bs = 1.0F / 3.0F;
- }
- for (i = 0; i < n; i ++) {
- GLubyte p = ubsrc[i];
- rgba[i][rDst] = ((p ) & 0x7) * rs;
- rgba[i][gDst] = ((p >> 3) & 0x7) * gs;
- rgba[i][bDst] = ((p >> 6) ) * bs;
- rgba[i][aDst] = 1.0F;
- }
- }
- break;
- case GL_UNSIGNED_SHORT_5_6_5:
- if (!intFormat) {
- rs = 1.0F / 31.0F;
- gs = 1.0F / 63.0F;
- bs = 1.0F / 31.0F;
- }
- if (swapBytes) {
- const GLushort *ussrc = (const GLushort *) src;
- GLuint i;
- for (i = 0; i < n; i ++) {
- GLushort p = ussrc[i];
- SWAP2BYTE(p);
- rgba[i][rDst] = ((p >> 11) ) * rs;
- rgba[i][gDst] = ((p >> 5) & 0x3f) * gs;
- rgba[i][bDst] = ((p ) & 0x1f) * bs;
- rgba[i][aDst] = 1.0F;
- }
- }
- else {
- const GLushort *ussrc = (const GLushort *) src;
- GLuint i;
- for (i = 0; i < n; i ++) {
- GLushort p = ussrc[i];
- rgba[i][rDst] = ((p >> 11) ) * rs;
- rgba[i][gDst] = ((p >> 5) & 0x3f) * gs;
- rgba[i][bDst] = ((p ) & 0x1f) * bs;
- rgba[i][aDst] = 1.0F;
- }
- }
- break;
- case GL_UNSIGNED_SHORT_5_6_5_REV:
- if (!intFormat) {
- rs = 1.0F / 31.0F;
- gs = 1.0F / 63.0F;
- bs = 1.0F / 31.0F;
- }
- if (swapBytes) {
- const GLushort *ussrc = (const GLushort *) src;
- GLuint i;
- for (i = 0; i < n; i ++) {
- GLushort p = ussrc[i];
- SWAP2BYTE(p);
- rgba[i][rDst] = ((p ) & 0x1f) * rs;
- rgba[i][gDst] = ((p >> 5) & 0x3f) * gs;
- rgba[i][bDst] = ((p >> 11) ) * bs;
- rgba[i][aDst] = 1.0F;
- }
- }
- else {
- const GLushort *ussrc = (const GLushort *) src;
- GLuint i;
- for (i = 0; i < n; i ++) {
- GLushort p = ussrc[i];
- rgba[i][rDst] = ((p ) & 0x1f) * rs;
- rgba[i][gDst] = ((p >> 5) & 0x3f) * gs;
- rgba[i][bDst] = ((p >> 11) ) * bs;
- rgba[i][aDst] = 1.0F;
- }
- }
- break;
- case GL_UNSIGNED_SHORT_4_4_4_4:
- if (!intFormat) {
- rs = gs = bs = as = 1.0F / 15.0F;
- }
- if (swapBytes) {
- const GLushort *ussrc = (const GLushort *) src;
- GLuint i;
- for (i = 0; i < n; i ++) {
- GLushort p = ussrc[i];
- SWAP2BYTE(p);
- rgba[i][rDst] = ((p >> 12) ) * rs;
- rgba[i][gDst] = ((p >> 8) & 0xf) * gs;
- rgba[i][bDst] = ((p >> 4) & 0xf) * bs;
- rgba[i][aDst] = ((p ) & 0xf) * as;
- }
- }
- else {
- const GLushort *ussrc = (const GLushort *) src;
- GLuint i;
- for (i = 0; i < n; i ++) {
- GLushort p = ussrc[i];
- rgba[i][rDst] = ((p >> 12) ) * rs;
- rgba[i][gDst] = ((p >> 8) & 0xf) * gs;
- rgba[i][bDst] = ((p >> 4) & 0xf) * bs;
- rgba[i][aDst] = ((p ) & 0xf) * as;
- }
- }
- break;
- case GL_UNSIGNED_SHORT_4_4_4_4_REV:
- if (!intFormat) {
- rs = gs = bs = as = 1.0F / 15.0F;
- }
- if (swapBytes) {
- const GLushort *ussrc = (const GLushort *) src;
- GLuint i;
- for (i = 0; i < n; i ++) {
- GLushort p = ussrc[i];
- SWAP2BYTE(p);
- rgba[i][rDst] = ((p ) & 0xf) * rs;
- rgba[i][gDst] = ((p >> 4) & 0xf) * gs;
- rgba[i][bDst] = ((p >> 8) & 0xf) * bs;
- rgba[i][aDst] = ((p >> 12) ) * as;
- }
- }
- else {
- const GLushort *ussrc = (const GLushort *) src;
- GLuint i;
- for (i = 0; i < n; i ++) {
- GLushort p = ussrc[i];
- rgba[i][rDst] = ((p ) & 0xf) * rs;
- rgba[i][gDst] = ((p >> 4) & 0xf) * gs;
- rgba[i][bDst] = ((p >> 8) & 0xf) * bs;
- rgba[i][aDst] = ((p >> 12) ) * as;
- }
- }
- break;
- case GL_UNSIGNED_SHORT_5_5_5_1:
- if (!intFormat) {
- rs = gs = bs = 1.0F / 31.0F;
- }
- if (swapBytes) {
- const GLushort *ussrc = (const GLushort *) src;
- GLuint i;
- for (i = 0; i < n; i ++) {
- GLushort p = ussrc[i];
- SWAP2BYTE(p);
- rgba[i][rDst] = ((p >> 11) ) * rs;
- rgba[i][gDst] = ((p >> 6) & 0x1f) * gs;
- rgba[i][bDst] = ((p >> 1) & 0x1f) * bs;
- rgba[i][aDst] = ((p ) & 0x1) * as;
- }
- }
- else {
- const GLushort *ussrc = (const GLushort *) src;
- GLuint i;
- for (i = 0; i < n; i ++) {
- GLushort p = ussrc[i];
- rgba[i][rDst] = ((p >> 11) ) * rs;
- rgba[i][gDst] = ((p >> 6) & 0x1f) * gs;
- rgba[i][bDst] = ((p >> 1) & 0x1f) * bs;
- rgba[i][aDst] = ((p ) & 0x1) * as;
- }
- }
- break;
- case GL_UNSIGNED_SHORT_1_5_5_5_REV:
- if (!intFormat) {
- rs = gs = bs = 1.0F / 31.0F;
- }
- if (swapBytes) {
- const GLushort *ussrc = (const GLushort *) src;
- GLuint i;
- for (i = 0; i < n; i ++) {
- GLushort p = ussrc[i];
- SWAP2BYTE(p);
- rgba[i][rDst] = ((p ) & 0x1f) * rs;
- rgba[i][gDst] = ((p >> 5) & 0x1f) * gs;
- rgba[i][bDst] = ((p >> 10) & 0x1f) * bs;
- rgba[i][aDst] = ((p >> 15) ) * as;
- }
- }
- else {
- const GLushort *ussrc = (const GLushort *) src;
- GLuint i;
- for (i = 0; i < n; i ++) {
- GLushort p = ussrc[i];
- rgba[i][rDst] = ((p ) & 0x1f) * rs;
- rgba[i][gDst] = ((p >> 5) & 0x1f) * gs;
- rgba[i][bDst] = ((p >> 10) & 0x1f) * bs;
- rgba[i][aDst] = ((p >> 15) ) * as;
- }
- }
- break;
- case GL_UNSIGNED_INT_8_8_8_8:
- if (swapBytes) {
- const GLuint *uisrc = (const GLuint *) src;
- GLuint i;
- if (intFormat) {
- for (i = 0; i < n; i ++) {
- GLuint p = uisrc[i];
- rgba[i][rDst] = (GLfloat) ((p ) & 0xff);
- rgba[i][gDst] = (GLfloat) ((p >> 8) & 0xff);
- rgba[i][bDst] = (GLfloat) ((p >> 16) & 0xff);
- rgba[i][aDst] = (GLfloat) ((p >> 24) );
- }
- }
- else {
- for (i = 0; i < n; i ++) {
- GLuint p = uisrc[i];
- rgba[i][rDst] = UBYTE_TO_FLOAT((p ) & 0xff);
- rgba[i][gDst] = UBYTE_TO_FLOAT((p >> 8) & 0xff);
- rgba[i][bDst] = UBYTE_TO_FLOAT((p >> 16) & 0xff);
- rgba[i][aDst] = UBYTE_TO_FLOAT((p >> 24) );
- }
- }
- }
- else {
- const GLuint *uisrc = (const GLuint *) src;
- GLuint i;
- if (intFormat) {
- for (i = 0; i < n; i ++) {
- GLuint p = uisrc[i];
- rgba[i][rDst] = (GLfloat) ((p >> 24) );
- rgba[i][gDst] = (GLfloat) ((p >> 16) & 0xff);
- rgba[i][bDst] = (GLfloat) ((p >> 8) & 0xff);
- rgba[i][aDst] = (GLfloat) ((p ) & 0xff);
- }
- }
- else {
- for (i = 0; i < n; i ++) {
- GLuint p = uisrc[i];
- rgba[i][rDst] = UBYTE_TO_FLOAT((p >> 24) );
- rgba[i][gDst] = UBYTE_TO_FLOAT((p >> 16) & 0xff);
- rgba[i][bDst] = UBYTE_TO_FLOAT((p >> 8) & 0xff);
- rgba[i][aDst] = UBYTE_TO_FLOAT((p ) & 0xff);
- }
- }
- }
- break;
- case GL_UNSIGNED_INT_8_8_8_8_REV:
- if (swapBytes) {
- const GLuint *uisrc = (const GLuint *) src;
- GLuint i;
- if (intFormat) {
- for (i = 0; i < n; i ++) {
- GLuint p = uisrc[i];
- rgba[i][rDst] = (GLfloat) ((p >> 24) );
- rgba[i][gDst] = (GLfloat) ((p >> 16) & 0xff);
- rgba[i][bDst] = (GLfloat) ((p >> 8) & 0xff);
- rgba[i][aDst] = (GLfloat) ((p ) & 0xff);
- }
- }
- else {
- for (i = 0; i < n; i ++) {
- GLuint p = uisrc[i];
- rgba[i][rDst] = UBYTE_TO_FLOAT((p >> 24) );
- rgba[i][gDst] = UBYTE_TO_FLOAT((p >> 16) & 0xff);
- rgba[i][bDst] = UBYTE_TO_FLOAT((p >> 8) & 0xff);
- rgba[i][aDst] = UBYTE_TO_FLOAT((p ) & 0xff);
- }
- }
- }
- else {
- const GLuint *uisrc = (const GLuint *) src;
- GLuint i;
- if (intFormat) {
- for (i = 0; i < n; i ++) {
- GLuint p = uisrc[i];
- rgba[i][rDst] = (GLfloat) ((p ) & 0xff);
- rgba[i][gDst] = (GLfloat) ((p >> 8) & 0xff);
- rgba[i][bDst] = (GLfloat) ((p >> 16) & 0xff);
- rgba[i][aDst] = (GLfloat) ((p >> 24) );
- }
- }
- else {
- for (i = 0; i < n; i ++) {
- GLuint p = uisrc[i];
- rgba[i][rDst] = UBYTE_TO_FLOAT((p ) & 0xff);
- rgba[i][gDst] = UBYTE_TO_FLOAT((p >> 8) & 0xff);
- rgba[i][bDst] = UBYTE_TO_FLOAT((p >> 16) & 0xff);
- rgba[i][aDst] = UBYTE_TO_FLOAT((p >> 24) );
- }
- }
- }
- break;
- case GL_UNSIGNED_INT_10_10_10_2:
- if (!intFormat) {
- rs = 1.0F / 1023.0F;
- gs = 1.0F / 1023.0F;
- bs = 1.0F / 1023.0F;
- as = 1.0F / 3.0F;
- }
- if (swapBytes) {
- const GLuint *uisrc = (const GLuint *) src;
- GLuint i;
- for (i = 0; i < n; i ++) {
- GLuint p = uisrc[i];
- SWAP4BYTE(p);
- rgba[i][rDst] = ((p >> 22) ) * rs;
- rgba[i][gDst] = ((p >> 12) & 0x3ff) * gs;
- rgba[i][bDst] = ((p >> 2) & 0x3ff) * bs;
- rgba[i][aDst] = ((p ) & 0x3 ) * as;
- }
- }
- else {
- const GLuint *uisrc = (const GLuint *) src;
- GLuint i;
- for (i = 0; i < n; i ++) {
- GLuint p = uisrc[i];
- rgba[i][rDst] = ((p >> 22) ) * rs;
- rgba[i][gDst] = ((p >> 12) & 0x3ff) * gs;
- rgba[i][bDst] = ((p >> 2) & 0x3ff) * bs;
- rgba[i][aDst] = ((p ) & 0x3 ) * as;
- }
- }
- break;
- case GL_UNSIGNED_INT_2_10_10_10_REV:
- if (!intFormat) {
- rs = 1.0F / 1023.0F;
- gs = 1.0F / 1023.0F;
- bs = 1.0F / 1023.0F;
- as = 1.0F / 3.0F;
- }
- if (swapBytes) {
- const GLuint *uisrc = (const GLuint *) src;
- GLuint i;
- for (i = 0; i < n; i ++) {
- GLuint p = uisrc[i];
- SWAP4BYTE(p);
- rgba[i][rDst] = ((p ) & 0x3ff) * rs;
- rgba[i][gDst] = ((p >> 10) & 0x3ff) * gs;
- rgba[i][bDst] = ((p >> 20) & 0x3ff) * bs;
- rgba[i][aDst] = ((p >> 30) ) * as;
- }
- }
- else {
- const GLuint *uisrc = (const GLuint *) src;
- GLuint i;
- for (i = 0; i < n; i ++) {
- GLuint p = uisrc[i];
- rgba[i][rDst] = ((p ) & 0x3ff) * rs;
- rgba[i][gDst] = ((p >> 10) & 0x3ff) * gs;
- rgba[i][bDst] = ((p >> 20) & 0x3ff) * bs;
- rgba[i][aDst] = ((p >> 30) ) * as;
- }
- }
- break;
- case GL_UNSIGNED_INT_5_9_9_9_REV:
- if (swapBytes) {
- const GLuint *uisrc = (const GLuint *) src;
- GLuint i;
- GLfloat f[3];
- for (i = 0; i < n; i ++) {
- GLuint p = uisrc[i];
- SWAP4BYTE(p);
- rgb9e5_to_float3(p, f);
- rgba[i][rDst] = f[0];
- rgba[i][gDst] = f[1];
- rgba[i][bDst] = f[2];
- rgba[i][aDst] = 1.0F;
- }
- }
- else {
- const GLuint *uisrc = (const GLuint *) src;
- GLuint i;
- GLfloat f[3];
- for (i = 0; i < n; i ++) {
- rgb9e5_to_float3(uisrc[i], f);
- rgba[i][rDst] = f[0];
- rgba[i][gDst] = f[1];
- rgba[i][bDst] = f[2];
- rgba[i][aDst] = 1.0F;
- }
- }
- break;
- case GL_UNSIGNED_INT_10F_11F_11F_REV:
- if (swapBytes) {
- const GLuint *uisrc = (const GLuint *) src;
- GLuint i;
- GLfloat f[3];
- for (i = 0; i < n; i ++) {
- GLuint p = uisrc[i];
- SWAP4BYTE(p);
- r11g11b10f_to_float3(p, f);
- rgba[i][rDst] = f[0];
- rgba[i][gDst] = f[1];
- rgba[i][bDst] = f[2];
- rgba[i][aDst] = 1.0F;
- }
- }
- else {
- const GLuint *uisrc = (const GLuint *) src;
- GLuint i;
- GLfloat f[3];
- for (i = 0; i < n; i ++) {
- r11g11b10f_to_float3(uisrc[i], f);
- rgba[i][rDst] = f[0];
- rgba[i][gDst] = f[1];
- rgba[i][bDst] = f[2];
- rgba[i][aDst] = 1.0F;
- }
- }
- break;
- default:
- _mesa_problem(NULL, "bad srcType in extract float data");
- break;
- }
-#undef PROCESS
-}
-
-
-static INLINE GLuint
-clamp_byte_to_uint(GLbyte b)
-{
- return b < 0 ? 0 : b;
-}
-
-
-static INLINE GLuint
-clamp_short_to_uint(GLshort s)
-{
- return s < 0 ? 0 : s;
-}
-
-
-static INLINE GLuint
-clamp_int_to_uint(GLint i)
-{
- return i < 0 ? 0 : i;
-}
-
-
-static INLINE GLuint
-clamp_float_to_uint(GLfloat f)
-{
- return f < 0.0F ? 0 : IROUND(f);
-}
-
-
-static INLINE GLuint
-clamp_half_to_uint(GLhalfARB h)
-{
- GLfloat f = _mesa_half_to_float(h);
- return f < 0.0F ? 0 : IROUND(f);
-}
-
-
-/**
- * \sa extract_float_rgba()
- */
-static void
-extract_uint_rgba(GLuint n, GLuint rgba[][4],
- GLenum srcFormat, GLenum srcType, const GLvoid *src,
- GLboolean swapBytes)
-{
- GLint rSrc, gSrc, bSrc, aSrc;
- GLint stride;
- GLint rDst, bDst, gDst, aDst;
-
- ASSERT(srcFormat == GL_RED ||
- srcFormat == GL_GREEN ||
- srcFormat == GL_BLUE ||
- srcFormat == GL_ALPHA ||
- srcFormat == GL_LUMINANCE ||
- srcFormat == GL_LUMINANCE_ALPHA ||
- srcFormat == GL_INTENSITY ||
- srcFormat == GL_RG ||
- srcFormat == GL_RGB ||
- srcFormat == GL_BGR ||
- srcFormat == GL_RGBA ||
- srcFormat == GL_BGRA ||
- srcFormat == GL_ABGR_EXT ||
- srcFormat == GL_DU8DV8_ATI ||
- srcFormat == GL_DUDV_ATI ||
- srcFormat == GL_RED_INTEGER_EXT ||
- srcFormat == GL_GREEN_INTEGER_EXT ||
- srcFormat == GL_BLUE_INTEGER_EXT ||
- srcFormat == GL_ALPHA_INTEGER_EXT ||
- srcFormat == GL_RGB_INTEGER_EXT ||
- srcFormat == GL_RGBA_INTEGER_EXT ||
- srcFormat == GL_BGR_INTEGER_EXT ||
- srcFormat == GL_BGRA_INTEGER_EXT ||
- srcFormat == GL_LUMINANCE_INTEGER_EXT ||
- srcFormat == GL_LUMINANCE_ALPHA_INTEGER_EXT);
-
- ASSERT(srcType == GL_UNSIGNED_BYTE ||
- srcType == GL_BYTE ||
- srcType == GL_UNSIGNED_SHORT ||
- srcType == GL_SHORT ||
- srcType == GL_UNSIGNED_INT ||
- srcType == GL_INT ||
- srcType == GL_HALF_FLOAT_ARB ||
- srcType == GL_FLOAT ||
- srcType == GL_UNSIGNED_BYTE_3_3_2 ||
- srcType == GL_UNSIGNED_BYTE_2_3_3_REV ||
- srcType == GL_UNSIGNED_SHORT_5_6_5 ||
- srcType == GL_UNSIGNED_SHORT_5_6_5_REV ||
- srcType == GL_UNSIGNED_SHORT_4_4_4_4 ||
- srcType == GL_UNSIGNED_SHORT_4_4_4_4_REV ||
- srcType == GL_UNSIGNED_SHORT_5_5_5_1 ||
- srcType == GL_UNSIGNED_SHORT_1_5_5_5_REV ||
- srcType == GL_UNSIGNED_INT_8_8_8_8 ||
- srcType == GL_UNSIGNED_INT_8_8_8_8_REV ||
- srcType == GL_UNSIGNED_INT_10_10_10_2 ||
- srcType == GL_UNSIGNED_INT_2_10_10_10_REV ||
- srcType == GL_UNSIGNED_INT_5_9_9_9_REV ||
- srcType == GL_UNSIGNED_INT_10F_11F_11F_REV);
-
- get_component_mapping(srcFormat,
- &rSrc, &gSrc, &bSrc, &aSrc,
- &rDst, &gDst, &bDst, &aDst);
-
- stride = _mesa_components_in_format(srcFormat);
-
-#define PROCESS(SRC_INDEX, DST_INDEX, DEFAULT, TYPE, CONVERSION) \
- if ((SRC_INDEX) < 0) { \
- GLuint i; \
- for (i = 0; i < n; i++) { \
- rgba[i][DST_INDEX] = DEFAULT; \
- } \
- } \
- else if (swapBytes) { \
- const TYPE *s = (const TYPE *) src; \
- GLuint i; \
- for (i = 0; i < n; i++) { \
- TYPE value = s[SRC_INDEX]; \
- if (sizeof(TYPE) == 2) { \
- SWAP2BYTE(value); \
- } \
- else if (sizeof(TYPE) == 4) { \
- SWAP4BYTE(value); \
- } \
- rgba[i][DST_INDEX] = CONVERSION(value); \
- s += stride; \
- } \
- } \
- else { \
- const TYPE *s = (const TYPE *) src; \
- GLuint i; \
- for (i = 0; i < n; i++) { \
- rgba[i][DST_INDEX] = CONVERSION(s[SRC_INDEX]); \
- s += stride; \
- } \
- }
-
- switch (srcType) {
- case GL_UNSIGNED_BYTE:
- PROCESS(rSrc, RCOMP, 0, GLubyte, (GLuint));
- PROCESS(gSrc, GCOMP, 0, GLubyte, (GLuint));
- PROCESS(bSrc, BCOMP, 0, GLubyte, (GLuint));
- PROCESS(aSrc, ACOMP, 1, GLubyte, (GLuint));
- break;
- case GL_BYTE:
- PROCESS(rSrc, RCOMP, 0, GLbyte, clamp_byte_to_uint);
- PROCESS(gSrc, GCOMP, 0, GLbyte, clamp_byte_to_uint);
- PROCESS(bSrc, BCOMP, 0, GLbyte, clamp_byte_to_uint);
- PROCESS(aSrc, ACOMP, 1, GLbyte, clamp_byte_to_uint);
- break;
- case GL_UNSIGNED_SHORT:
- PROCESS(rSrc, RCOMP, 0, GLushort, (GLuint));
- PROCESS(gSrc, GCOMP, 0, GLushort, (GLuint));
- PROCESS(bSrc, BCOMP, 0, GLushort, (GLuint));
- PROCESS(aSrc, ACOMP, 1, GLushort, (GLuint));
- break;
- case GL_SHORT:
- PROCESS(rSrc, RCOMP, 0, GLshort, clamp_short_to_uint);
- PROCESS(gSrc, GCOMP, 0, GLshort, clamp_short_to_uint);
- PROCESS(bSrc, BCOMP, 0, GLshort, clamp_short_to_uint);
- PROCESS(aSrc, ACOMP, 1, GLshort, clamp_short_to_uint);
- break;
- case GL_UNSIGNED_INT:
- PROCESS(rSrc, RCOMP, 0, GLuint, (GLuint));
- PROCESS(gSrc, GCOMP, 0, GLuint, (GLuint));
- PROCESS(bSrc, BCOMP, 0, GLuint, (GLuint));
- PROCESS(aSrc, ACOMP, 1, GLuint, (GLuint));
- break;
- case GL_INT:
- PROCESS(rSrc, RCOMP, 0, GLint, clamp_int_to_uint);
- PROCESS(gSrc, GCOMP, 0, GLint, clamp_int_to_uint);
- PROCESS(bSrc, BCOMP, 0, GLint, clamp_int_to_uint);
- PROCESS(aSrc, ACOMP, 1, GLint, clamp_int_to_uint);
- break;
- case GL_FLOAT:
- PROCESS(rSrc, RCOMP, 0, GLfloat, clamp_float_to_uint);
- PROCESS(gSrc, GCOMP, 0, GLfloat, clamp_float_to_uint);
- PROCESS(bSrc, BCOMP, 0, GLfloat, clamp_float_to_uint);
- PROCESS(aSrc, ACOMP, 1, GLfloat, clamp_float_to_uint);
- break;
- case GL_HALF_FLOAT_ARB:
- PROCESS(rSrc, RCOMP, 0, GLhalfARB, clamp_half_to_uint);
- PROCESS(gSrc, GCOMP, 0, GLhalfARB, clamp_half_to_uint);
- PROCESS(bSrc, BCOMP, 0, GLhalfARB, clamp_half_to_uint);
- PROCESS(aSrc, ACOMP, 1, GLhalfARB, clamp_half_to_uint);
- break;
- case GL_UNSIGNED_BYTE_3_3_2:
- {
- const GLubyte *ubsrc = (const GLubyte *) src;
- GLuint i;
- for (i = 0; i < n; i ++) {
- GLubyte p = ubsrc[i];
- rgba[i][rDst] = ((p >> 5) );
- rgba[i][gDst] = ((p >> 2) & 0x7);
- rgba[i][bDst] = ((p ) & 0x3);
- rgba[i][aDst] = 1;
- }
- }
- break;
- case GL_UNSIGNED_BYTE_2_3_3_REV:
- {
- const GLubyte *ubsrc = (const GLubyte *) src;
- GLuint i;
- for (i = 0; i < n; i ++) {
- GLubyte p = ubsrc[i];
- rgba[i][rDst] = ((p ) & 0x7);
- rgba[i][gDst] = ((p >> 3) & 0x7);
- rgba[i][bDst] = ((p >> 6) );
- rgba[i][aDst] = 1;
- }
- }
- break;
- case GL_UNSIGNED_SHORT_5_6_5:
- if (swapBytes) {
- const GLushort *ussrc = (const GLushort *) src;
- GLuint i;
- for (i = 0; i < n; i ++) {
- GLushort p = ussrc[i];
- SWAP2BYTE(p);
- rgba[i][rDst] = ((p >> 11) );
- rgba[i][gDst] = ((p >> 5) & 0x3f);
- rgba[i][bDst] = ((p ) & 0x1f);
- rgba[i][aDst] = 1;
- }
- }
- else {
- const GLushort *ussrc = (const GLushort *) src;
- GLuint i;
- for (i = 0; i < n; i ++) {
- GLushort p = ussrc[i];
- rgba[i][rDst] = ((p >> 11) );
- rgba[i][gDst] = ((p >> 5) & 0x3f);
- rgba[i][bDst] = ((p ) & 0x1f);
- rgba[i][aDst] = 1;
- }
- }
- break;
- case GL_UNSIGNED_SHORT_5_6_5_REV:
- if (swapBytes) {
- const GLushort *ussrc = (const GLushort *) src;
- GLuint i;
- for (i = 0; i < n; i ++) {
- GLushort p = ussrc[i];
- SWAP2BYTE(p);
- rgba[i][rDst] = ((p ) & 0x1f);
- rgba[i][gDst] = ((p >> 5) & 0x3f);
- rgba[i][bDst] = ((p >> 11) );
- rgba[i][aDst] = 1;
- }
- }
- else {
- const GLushort *ussrc = (const GLushort *) src;
- GLuint i;
- for (i = 0; i < n; i ++) {
- GLushort p = ussrc[i];
- rgba[i][rDst] = ((p ) & 0x1f);
- rgba[i][gDst] = ((p >> 5) & 0x3f);
- rgba[i][bDst] = ((p >> 11) );
- rgba[i][aDst] = 1;
- }
- }
- break;
- case GL_UNSIGNED_SHORT_4_4_4_4:
- if (swapBytes) {
- const GLushort *ussrc = (const GLushort *) src;
- GLuint i;
- for (i = 0; i < n; i ++) {
- GLushort p = ussrc[i];
- SWAP2BYTE(p);
- rgba[i][rDst] = ((p >> 12) );
- rgba[i][gDst] = ((p >> 8) & 0xf);
- rgba[i][bDst] = ((p >> 4) & 0xf);
- rgba[i][aDst] = ((p ) & 0xf);
- }
- }
- else {
- const GLushort *ussrc = (const GLushort *) src;
- GLuint i;
- for (i = 0; i < n; i ++) {
- GLushort p = ussrc[i];
- rgba[i][rDst] = ((p >> 12) );
- rgba[i][gDst] = ((p >> 8) & 0xf);
- rgba[i][bDst] = ((p >> 4) & 0xf);
- rgba[i][aDst] = ((p ) & 0xf);
- }
- }
- break;
- case GL_UNSIGNED_SHORT_4_4_4_4_REV:
- if (swapBytes) {
- const GLushort *ussrc = (const GLushort *) src;
- GLuint i;
- for (i = 0; i < n; i ++) {
- GLushort p = ussrc[i];
- SWAP2BYTE(p);
- rgba[i][rDst] = ((p ) & 0xf);
- rgba[i][gDst] = ((p >> 4) & 0xf);
- rgba[i][bDst] = ((p >> 8) & 0xf);
- rgba[i][aDst] = ((p >> 12) );
- }
- }
- else {
- const GLushort *ussrc = (const GLushort *) src;
- GLuint i;
- for (i = 0; i < n; i ++) {
- GLushort p = ussrc[i];
- rgba[i][rDst] = ((p ) & 0xf);
- rgba[i][gDst] = ((p >> 4) & 0xf);
- rgba[i][bDst] = ((p >> 8) & 0xf);
- rgba[i][aDst] = ((p >> 12) );
- }
- }
- break;
- case GL_UNSIGNED_SHORT_5_5_5_1:
- if (swapBytes) {
- const GLushort *ussrc = (const GLushort *) src;
- GLuint i;
- for (i = 0; i < n; i ++) {
- GLushort p = ussrc[i];
- SWAP2BYTE(p);
- rgba[i][rDst] = ((p >> 11) );
- rgba[i][gDst] = ((p >> 6) & 0x1f);
- rgba[i][bDst] = ((p >> 1) & 0x1f);
- rgba[i][aDst] = ((p ) & 0x1 );
- }
- }
- else {
- const GLushort *ussrc = (const GLushort *) src;
- GLuint i;
- for (i = 0; i < n; i ++) {
- GLushort p = ussrc[i];
- rgba[i][rDst] = ((p >> 11) );
- rgba[i][gDst] = ((p >> 6) & 0x1f);
- rgba[i][bDst] = ((p >> 1) & 0x1f);
- rgba[i][aDst] = ((p ) & 0x1 );
- }
- }
- break;
- case GL_UNSIGNED_SHORT_1_5_5_5_REV:
- if (swapBytes) {
- const GLushort *ussrc = (const GLushort *) src;
- GLuint i;
- for (i = 0; i < n; i ++) {
- GLushort p = ussrc[i];
- SWAP2BYTE(p);
- rgba[i][rDst] = ((p ) & 0x1f);
- rgba[i][gDst] = ((p >> 5) & 0x1f);
- rgba[i][bDst] = ((p >> 10) & 0x1f);
- rgba[i][aDst] = ((p >> 15) );
- }
- }
- else {
- const GLushort *ussrc = (const GLushort *) src;
- GLuint i;
- for (i = 0; i < n; i ++) {
- GLushort p = ussrc[i];
- rgba[i][rDst] = ((p ) & 0x1f);
- rgba[i][gDst] = ((p >> 5) & 0x1f);
- rgba[i][bDst] = ((p >> 10) & 0x1f);
- rgba[i][aDst] = ((p >> 15) );
- }
- }
- break;
- case GL_UNSIGNED_INT_8_8_8_8:
- if (swapBytes) {
- const GLuint *uisrc = (const GLuint *) src;
- GLuint i;
- for (i = 0; i < n; i ++) {
- GLuint p = uisrc[i];
- rgba[i][rDst] = ((p ) & 0xff);
- rgba[i][gDst] = ((p >> 8) & 0xff);
- rgba[i][bDst] = ((p >> 16) & 0xff);
- rgba[i][aDst] = ((p >> 24) );
- }
- }
- else {
- const GLuint *uisrc = (const GLuint *) src;
- GLuint i;
- for (i = 0; i < n; i ++) {
- GLuint p = uisrc[i];
- rgba[i][rDst] = ((p >> 24) );
- rgba[i][gDst] = ((p >> 16) & 0xff);
- rgba[i][bDst] = ((p >> 8) & 0xff);
- rgba[i][aDst] = ((p ) & 0xff);
- }
- }
- break;
- case GL_UNSIGNED_INT_8_8_8_8_REV:
- if (swapBytes) {
- const GLuint *uisrc = (const GLuint *) src;
- GLuint i;
- for (i = 0; i < n; i ++) {
- GLuint p = uisrc[i];
- rgba[i][rDst] = ((p >> 24) );
- rgba[i][gDst] = ((p >> 16) & 0xff);
- rgba[i][bDst] = ((p >> 8) & 0xff);
- rgba[i][aDst] = ((p ) & 0xff);
- }
- }
- else {
- const GLuint *uisrc = (const GLuint *) src;
- GLuint i;
- for (i = 0; i < n; i ++) {
- GLuint p = uisrc[i];
- rgba[i][rDst] = ((p ) & 0xff);
- rgba[i][gDst] = ((p >> 8) & 0xff);
- rgba[i][bDst] = ((p >> 16) & 0xff);
- rgba[i][aDst] = ((p >> 24) );
- }
- }
- break;
- case GL_UNSIGNED_INT_10_10_10_2:
- if (swapBytes) {
- const GLuint *uisrc = (const GLuint *) src;
- GLuint i;
- for (i = 0; i < n; i ++) {
- GLuint p = uisrc[i];
- SWAP4BYTE(p);
- rgba[i][rDst] = ((p >> 22) );
- rgba[i][gDst] = ((p >> 12) & 0x3ff);
- rgba[i][bDst] = ((p >> 2) & 0x3ff);
- rgba[i][aDst] = ((p ) & 0x3 );
- }
- }
- else {
- const GLuint *uisrc = (const GLuint *) src;
- GLuint i;
- for (i = 0; i < n; i ++) {
- GLuint p = uisrc[i];
- rgba[i][rDst] = ((p >> 22) );
- rgba[i][gDst] = ((p >> 12) & 0x3ff);
- rgba[i][bDst] = ((p >> 2) & 0x3ff);
- rgba[i][aDst] = ((p ) & 0x3 );
- }
- }
- break;
- case GL_UNSIGNED_INT_2_10_10_10_REV:
- if (swapBytes) {
- const GLuint *uisrc = (const GLuint *) src;
- GLuint i;
- for (i = 0; i < n; i ++) {
- GLuint p = uisrc[i];
- SWAP4BYTE(p);
- rgba[i][rDst] = ((p ) & 0x3ff);
- rgba[i][gDst] = ((p >> 10) & 0x3ff);
- rgba[i][bDst] = ((p >> 20) & 0x3ff);
- rgba[i][aDst] = ((p >> 30) );
- }
- }
- else {
- const GLuint *uisrc = (const GLuint *) src;
- GLuint i;
- for (i = 0; i < n; i ++) {
- GLuint p = uisrc[i];
- rgba[i][rDst] = ((p ) & 0x3ff);
- rgba[i][gDst] = ((p >> 10) & 0x3ff);
- rgba[i][bDst] = ((p >> 20) & 0x3ff);
- rgba[i][aDst] = ((p >> 30) );
- }
- }
- break;
- case GL_UNSIGNED_INT_5_9_9_9_REV:
- if (swapBytes) {
- const GLuint *uisrc = (const GLuint *) src;
- GLuint i;
- float f[3];
- for (i = 0; i < n; i ++) {
- GLuint p = uisrc[i];
- SWAP4BYTE(p);
- rgb9e5_to_float3(p, f);
- rgba[i][rDst] = clamp_float_to_uint(f[0]);
- rgba[i][gDst] = clamp_float_to_uint(f[1]);
- rgba[i][bDst] = clamp_float_to_uint(f[2]);
- rgba[i][aDst] = 1;
- }
- }
- else {
- const GLuint *uisrc = (const GLuint *) src;
- GLuint i;
- float f[3];
- for (i = 0; i < n; i ++) {
- GLuint p = uisrc[i];
- rgb9e5_to_float3(p, f);
- rgba[i][rDst] = clamp_float_to_uint(f[0]);
- rgba[i][gDst] = clamp_float_to_uint(f[1]);
- rgba[i][bDst] = clamp_float_to_uint(f[2]);
- rgba[i][aDst] = 1;
- }
- }
- break;
- case GL_UNSIGNED_INT_10F_11F_11F_REV:
- if (swapBytes) {
- const GLuint *uisrc = (const GLuint *) src;
- GLuint i;
- float f[3];
- for (i = 0; i < n; i ++) {
- GLuint p = uisrc[i];
- SWAP4BYTE(p);
- r11g11b10f_to_float3(p, f);
- rgba[i][rDst] = clamp_float_to_uint(f[0]);
- rgba[i][gDst] = clamp_float_to_uint(f[1]);
- rgba[i][bDst] = clamp_float_to_uint(f[2]);
- rgba[i][aDst] = 1;
- }
- }
- else {
- const GLuint *uisrc = (const GLuint *) src;
- GLuint i;
- float f[3];
- for (i = 0; i < n; i ++) {
- GLuint p = uisrc[i];
- r11g11b10f_to_float3(p, f);
- rgba[i][rDst] = clamp_float_to_uint(f[0]);
- rgba[i][gDst] = clamp_float_to_uint(f[1]);
- rgba[i][bDst] = clamp_float_to_uint(f[2]);
- rgba[i][aDst] = 1;
- }
- }
- break;
- default:
- _mesa_problem(NULL, "bad srcType in extract uint data");
- break;
- }
-#undef PROCESS
-}
-
-
-
-/*
- * Unpack a row of color image data from a client buffer according to
- * the pixel unpacking parameters.
- * Return GLchan values in the specified dest image format.
- * This is used by glDrawPixels and glTexImage?D().
- * \param ctx - the context
- * n - number of pixels in the span
- * dstFormat - format of destination color array
- * dest - the destination color array
- * srcFormat - source image format
- * srcType - source image data type
- * source - source image pointer
- * srcPacking - pixel unpacking parameters
- * transferOps - bitmask of IMAGE_*_BIT values of operations to apply
- *
- * XXX perhaps expand this to process whole images someday.
- */
-void
-_mesa_unpack_color_span_chan( struct gl_context *ctx,
- GLuint n, GLenum dstFormat, GLchan dest[],
- GLenum srcFormat, GLenum srcType,
- const GLvoid *source,
- const struct gl_pixelstore_attrib *srcPacking,
- GLbitfield transferOps )
-{
- ASSERT(dstFormat == GL_ALPHA ||
- dstFormat == GL_LUMINANCE ||
- dstFormat == GL_LUMINANCE_ALPHA ||
- dstFormat == GL_INTENSITY ||
- dstFormat == GL_RED ||
- dstFormat == GL_RG ||
- dstFormat == GL_RGB ||
- dstFormat == GL_RGBA ||
- dstFormat == GL_COLOR_INDEX);
-
- ASSERT(srcFormat == GL_RED ||
- srcFormat == GL_GREEN ||
- srcFormat == GL_BLUE ||
- srcFormat == GL_ALPHA ||
- srcFormat == GL_LUMINANCE ||
- srcFormat == GL_LUMINANCE_ALPHA ||
- srcFormat == GL_INTENSITY ||
- srcFormat == GL_RG ||
- srcFormat == GL_RGB ||
- srcFormat == GL_BGR ||
- srcFormat == GL_RGBA ||
- srcFormat == GL_BGRA ||
- srcFormat == GL_ABGR_EXT ||
- srcFormat == GL_COLOR_INDEX);
-
- ASSERT(srcType == GL_BITMAP ||
- srcType == GL_UNSIGNED_BYTE ||
- srcType == GL_BYTE ||
- srcType == GL_UNSIGNED_SHORT ||
- srcType == GL_SHORT ||
- srcType == GL_UNSIGNED_INT ||
- srcType == GL_INT ||
- srcType == GL_HALF_FLOAT_ARB ||
- srcType == GL_FLOAT ||
- srcType == GL_UNSIGNED_BYTE_3_3_2 ||
- srcType == GL_UNSIGNED_BYTE_2_3_3_REV ||
- srcType == GL_UNSIGNED_SHORT_5_6_5 ||
- srcType == GL_UNSIGNED_SHORT_5_6_5_REV ||
- srcType == GL_UNSIGNED_SHORT_4_4_4_4 ||
- srcType == GL_UNSIGNED_SHORT_4_4_4_4_REV ||
- srcType == GL_UNSIGNED_SHORT_5_5_5_1 ||
- srcType == GL_UNSIGNED_SHORT_1_5_5_5_REV ||
- srcType == GL_UNSIGNED_INT_8_8_8_8 ||
- srcType == GL_UNSIGNED_INT_8_8_8_8_REV ||
- srcType == GL_UNSIGNED_INT_10_10_10_2 ||
- srcType == GL_UNSIGNED_INT_2_10_10_10_REV ||
- srcType == GL_UNSIGNED_INT_5_9_9_9_REV ||
- srcType == GL_UNSIGNED_INT_10F_11F_11F_REV);
-
- /* Try simple cases first */
- if (transferOps == 0) {
- if (srcType == CHAN_TYPE) {
- if (dstFormat == GL_RGBA) {
- if (srcFormat == GL_RGBA) {
- memcpy( dest, source, n * 4 * sizeof(GLchan) );
- return;
- }
- else if (srcFormat == GL_RGB) {
- GLuint i;
- const GLchan *src = (const GLchan *) source;
- GLchan *dst = dest;
- for (i = 0; i < n; i++) {
- dst[0] = src[0];
- dst[1] = src[1];
- dst[2] = src[2];
- dst[3] = CHAN_MAX;
- src += 3;
- dst += 4;
- }
- return;
- }
- }
- else if (dstFormat == GL_RGB) {
- if (srcFormat == GL_RGB) {
- memcpy( dest, source, n * 3 * sizeof(GLchan) );
- return;
- }
- else if (srcFormat == GL_RGBA) {
- GLuint i;
- const GLchan *src = (const GLchan *) source;
- GLchan *dst = dest;
- for (i = 0; i < n; i++) {
- dst[0] = src[0];
- dst[1] = src[1];
- dst[2] = src[2];
- src += 4;
- dst += 3;
- }
- return;
- }
- }
- else if (dstFormat == srcFormat) {
- GLint comps = _mesa_components_in_format(srcFormat);
- assert(comps > 0);
- memcpy( dest, source, n * comps * sizeof(GLchan) );
- return;
- }
- }
- /*
- * Common situation, loading 8bit RGBA/RGB source images
- * into 16/32 bit destination. (OSMesa16/32)
- */
- else if (srcType == GL_UNSIGNED_BYTE) {
- if (dstFormat == GL_RGBA) {
- if (srcFormat == GL_RGB) {
- GLuint i;
- const GLubyte *src = (const GLubyte *) source;
- GLchan *dst = dest;
- for (i = 0; i < n; i++) {
- dst[0] = UBYTE_TO_CHAN(src[0]);
- dst[1] = UBYTE_TO_CHAN(src[1]);
- dst[2] = UBYTE_TO_CHAN(src[2]);
- dst[3] = CHAN_MAX;
- src += 3;
- dst += 4;
- }
- return;
- }
- else if (srcFormat == GL_RGBA) {
- GLuint i;
- const GLubyte *src = (const GLubyte *) source;
- GLchan *dst = dest;
- for (i = 0; i < n; i++) {
- dst[0] = UBYTE_TO_CHAN(src[0]);
- dst[1] = UBYTE_TO_CHAN(src[1]);
- dst[2] = UBYTE_TO_CHAN(src[2]);
- dst[3] = UBYTE_TO_CHAN(src[3]);
- src += 4;
- dst += 4;
- }
- return;
- }
- }
- else if (dstFormat == GL_RGB) {
- if (srcFormat == GL_RGB) {
- GLuint i;
- const GLubyte *src = (const GLubyte *) source;
- GLchan *dst = dest;
- for (i = 0; i < n; i++) {
- dst[0] = UBYTE_TO_CHAN(src[0]);
- dst[1] = UBYTE_TO_CHAN(src[1]);
- dst[2] = UBYTE_TO_CHAN(src[2]);
- src += 3;
- dst += 3;
- }
- return;
- }
- else if (srcFormat == GL_RGBA) {
- GLuint i;
- const GLubyte *src = (const GLubyte *) source;
- GLchan *dst = dest;
- for (i = 0; i < n; i++) {
- dst[0] = UBYTE_TO_CHAN(src[0]);
- dst[1] = UBYTE_TO_CHAN(src[1]);
- dst[2] = UBYTE_TO_CHAN(src[2]);
- src += 4;
- dst += 3;
- }
- return;
- }
- }
- }
- }
-
-
- /* general solution begins here */
- {
- GLint dstComponents;
- GLint rDst, gDst, bDst, aDst, lDst, iDst;
- GLfloat (*rgba)[4] = (GLfloat (*)[4]) malloc(4 * n * sizeof(GLfloat));
-
- if (!rgba) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "pixel unpacking");
- return;
- }
-
- dstComponents = _mesa_components_in_format( dstFormat );
- /* source & dest image formats should have been error checked by now */
- assert(dstComponents > 0);
-
- /*
- * Extract image data and convert to RGBA floats
- */
- if (srcFormat == GL_COLOR_INDEX) {
- GLuint *indexes = (GLuint *) malloc(n * sizeof(GLuint));
-
- if (!indexes) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "pixel unpacking");
- return;
- }
-
- extract_uint_indexes(n, indexes, srcFormat, srcType, source,
- srcPacking);
-
- if (dstFormat == GL_COLOR_INDEX) {
- GLuint i;
- _mesa_apply_ci_transfer_ops(ctx, transferOps, n, indexes);
- /* convert to GLchan and return */
- for (i = 0; i < n; i++) {
- dest[i] = (GLchan) (indexes[i] & 0xff);
- }
- free(indexes);
- free(rgba);
- return;
- }
- else {
- /* Convert indexes to RGBA */
- if (transferOps & IMAGE_SHIFT_OFFSET_BIT) {
- _mesa_shift_and_offset_ci(ctx, n, indexes);
- }
- _mesa_map_ci_to_rgba(ctx, n, indexes, rgba);
- }
-
- /* Don't do RGBA scale/bias or RGBA->RGBA mapping if starting
- * with color indexes.
- */
- transferOps &= ~(IMAGE_SCALE_BIAS_BIT | IMAGE_MAP_COLOR_BIT);
-
- free(indexes);
- }
- else {
- /* non-color index data */
- extract_float_rgba(n, rgba, srcFormat, srcType, source,
- srcPacking->SwapBytes);
- }
-
- /* Need to clamp if returning GLubytes or GLushorts */
-#if CHAN_TYPE != GL_FLOAT
- transferOps |= IMAGE_CLAMP_BIT;
-#endif
-
- if (transferOps) {
- _mesa_apply_rgba_transfer_ops(ctx, transferOps, n, rgba);
- }
-
- get_component_indexes(dstFormat,
- &rDst, &gDst, &bDst, &aDst, &lDst, &iDst);
-
- /* Now return the GLchan data in the requested dstFormat */
- if (rDst >= 0) {
- GLchan *dst = dest;
- GLuint i;
- for (i = 0; i < n; i++) {
- CLAMPED_FLOAT_TO_CHAN(dst[rDst], rgba[i][RCOMP]);
- dst += dstComponents;
- }
- }
-
- if (gDst >= 0) {
- GLchan *dst = dest;
- GLuint i;
- for (i = 0; i < n; i++) {
- CLAMPED_FLOAT_TO_CHAN(dst[gDst], rgba[i][GCOMP]);
- dst += dstComponents;
- }
- }
-
- if (bDst >= 0) {
- GLchan *dst = dest;
- GLuint i;
- for (i = 0; i < n; i++) {
- CLAMPED_FLOAT_TO_CHAN(dst[bDst], rgba[i][BCOMP]);
- dst += dstComponents;
- }
- }
-
- if (aDst >= 0) {
- GLchan *dst = dest;
- GLuint i;
- for (i = 0; i < n; i++) {
- CLAMPED_FLOAT_TO_CHAN(dst[aDst], rgba[i][ACOMP]);
- dst += dstComponents;
- }
- }
-
- if (iDst >= 0) {
- GLchan *dst = dest;
- GLuint i;
- assert(iDst == 0);
- assert(dstComponents == 1);
- for (i = 0; i < n; i++) {
- /* Intensity comes from red channel */
- CLAMPED_FLOAT_TO_CHAN(dst[i], rgba[i][RCOMP]);
- }
- }
-
- if (lDst >= 0) {
- GLchan *dst = dest;
- GLuint i;
- assert(lDst == 0);
- for (i = 0; i < n; i++) {
- /* Luminance comes from red channel */
- CLAMPED_FLOAT_TO_CHAN(dst[0], rgba[i][RCOMP]);
- dst += dstComponents;
- }
- }
-
- free(rgba);
- }
-}
-
-
-/**
- * Same as _mesa_unpack_color_span_chan(), but return GLfloat data
- * instead of GLchan.
- */
-void
-_mesa_unpack_color_span_float( struct gl_context *ctx,
- GLuint n, GLenum dstFormat, GLfloat dest[],
- GLenum srcFormat, GLenum srcType,
- const GLvoid *source,
- const struct gl_pixelstore_attrib *srcPacking,
- GLbitfield transferOps )
-{
- ASSERT(dstFormat == GL_ALPHA ||
- dstFormat == GL_LUMINANCE ||
- dstFormat == GL_LUMINANCE_ALPHA ||
- dstFormat == GL_INTENSITY ||
- dstFormat == GL_RED ||
- dstFormat == GL_RG ||
- dstFormat == GL_RGB ||
- dstFormat == GL_RGBA ||
- dstFormat == GL_COLOR_INDEX);
-
- ASSERT(srcFormat == GL_RED ||
- srcFormat == GL_GREEN ||
- srcFormat == GL_BLUE ||
- srcFormat == GL_ALPHA ||
- srcFormat == GL_LUMINANCE ||
- srcFormat == GL_LUMINANCE_ALPHA ||
- srcFormat == GL_INTENSITY ||
- srcFormat == GL_RG ||
- srcFormat == GL_RGB ||
- srcFormat == GL_BGR ||
- srcFormat == GL_RGBA ||
- srcFormat == GL_BGRA ||
- srcFormat == GL_ABGR_EXT ||
- srcFormat == GL_RED_INTEGER_EXT ||
- srcFormat == GL_GREEN_INTEGER_EXT ||
- srcFormat == GL_BLUE_INTEGER_EXT ||
- srcFormat == GL_ALPHA_INTEGER_EXT ||
- srcFormat == GL_RGB_INTEGER_EXT ||
- srcFormat == GL_RGBA_INTEGER_EXT ||
- srcFormat == GL_BGR_INTEGER_EXT ||
- srcFormat == GL_BGRA_INTEGER_EXT ||
- srcFormat == GL_LUMINANCE_INTEGER_EXT ||
- srcFormat == GL_LUMINANCE_ALPHA_INTEGER_EXT ||
- srcFormat == GL_COLOR_INDEX);
-
- ASSERT(srcType == GL_BITMAP ||
- srcType == GL_UNSIGNED_BYTE ||
- srcType == GL_BYTE ||
- srcType == GL_UNSIGNED_SHORT ||
- srcType == GL_SHORT ||
- srcType == GL_UNSIGNED_INT ||
- srcType == GL_INT ||
- srcType == GL_HALF_FLOAT_ARB ||
- srcType == GL_FLOAT ||
- srcType == GL_UNSIGNED_BYTE_3_3_2 ||
- srcType == GL_UNSIGNED_BYTE_2_3_3_REV ||
- srcType == GL_UNSIGNED_SHORT_5_6_5 ||
- srcType == GL_UNSIGNED_SHORT_5_6_5_REV ||
- srcType == GL_UNSIGNED_SHORT_4_4_4_4 ||
- srcType == GL_UNSIGNED_SHORT_4_4_4_4_REV ||
- srcType == GL_UNSIGNED_SHORT_5_5_5_1 ||
- srcType == GL_UNSIGNED_SHORT_1_5_5_5_REV ||
- srcType == GL_UNSIGNED_INT_8_8_8_8 ||
- srcType == GL_UNSIGNED_INT_8_8_8_8_REV ||
- srcType == GL_UNSIGNED_INT_10_10_10_2 ||
- srcType == GL_UNSIGNED_INT_2_10_10_10_REV ||
- srcType == GL_UNSIGNED_INT_5_9_9_9_REV ||
- srcType == GL_UNSIGNED_INT_10F_11F_11F_REV);
-
- /* general solution, no special cases, yet */
- {
- GLint dstComponents;
- GLint rDst, gDst, bDst, aDst, lDst, iDst;
- GLfloat (*rgba)[4] = (GLfloat (*)[4]) malloc(4 * n * sizeof(GLfloat));
-
- if (!rgba) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "pixel unpacking");
- return;
- }
-
- dstComponents = _mesa_components_in_format( dstFormat );
- /* source & dest image formats should have been error checked by now */
- assert(dstComponents > 0);
-
- /*
- * Extract image data and convert to RGBA floats
- */
- if (srcFormat == GL_COLOR_INDEX) {
- GLuint *indexes = (GLuint *) malloc(n * sizeof(GLuint));
-
- if (!indexes) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "pixel unpacking");
- free(rgba);
- return;
- }
-
- extract_uint_indexes(n, indexes, srcFormat, srcType, source,
- srcPacking);
-
- if (dstFormat == GL_COLOR_INDEX) {
- GLuint i;
- _mesa_apply_ci_transfer_ops(ctx, transferOps, n, indexes);
- /* convert to GLchan and return */
- for (i = 0; i < n; i++) {
- dest[i] = (GLchan) (indexes[i] & 0xff);
- }
- free(indexes);
- free(rgba);
- return;
- }
- else {
- /* Convert indexes to RGBA */
- if (transferOps & IMAGE_SHIFT_OFFSET_BIT) {
- _mesa_shift_and_offset_ci(ctx, n, indexes);
- }
- _mesa_map_ci_to_rgba(ctx, n, indexes, rgba);
- }
-
- /* Don't do RGBA scale/bias or RGBA->RGBA mapping if starting
- * with color indexes.
- */
- transferOps &= ~(IMAGE_SCALE_BIAS_BIT | IMAGE_MAP_COLOR_BIT);
-
- free(indexes);
- }
- else {
- /* non-color index data */
- extract_float_rgba(n, rgba, srcFormat, srcType, source,
- srcPacking->SwapBytes);
- }
-
- if (transferOps) {
- _mesa_apply_rgba_transfer_ops(ctx, transferOps, n, rgba);
- }
-
- get_component_indexes(dstFormat,
- &rDst, &gDst, &bDst, &aDst, &lDst, &iDst);
-
- /* Now pack results in the requested dstFormat */
- if (rDst >= 0) {
- GLfloat *dst = dest;
- GLuint i;
- for (i = 0; i < n; i++) {
- dst[rDst] = rgba[i][RCOMP];
- dst += dstComponents;
- }
- }
-
- if (gDst >= 0) {
- GLfloat *dst = dest;
- GLuint i;
- for (i = 0; i < n; i++) {
- dst[gDst] = rgba[i][GCOMP];
- dst += dstComponents;
- }
- }
-
- if (bDst >= 0) {
- GLfloat *dst = dest;
- GLuint i;
- for (i = 0; i < n; i++) {
- dst[bDst] = rgba[i][BCOMP];
- dst += dstComponents;
- }
- }
-
- if (aDst >= 0) {
- GLfloat *dst = dest;
- GLuint i;
- for (i = 0; i < n; i++) {
- dst[aDst] = rgba[i][ACOMP];
- dst += dstComponents;
- }
- }
-
- if (iDst >= 0) {
- GLfloat *dst = dest;
- GLuint i;
- assert(iDst == 0);
- assert(dstComponents == 1);
- for (i = 0; i < n; i++) {
- /* Intensity comes from red channel */
- dst[i] = rgba[i][RCOMP];
- }
- }
-
- if (lDst >= 0) {
- GLfloat *dst = dest;
- GLuint i;
- assert(lDst == 0);
- for (i = 0; i < n; i++) {
- /* Luminance comes from red channel */
- dst[0] = rgba[i][RCOMP];
- dst += dstComponents;
- }
- }
-
- free(rgba);
- }
-}
-
-
-/**
- * Same as _mesa_unpack_color_span_chan(), but return GLuint data
- * instead of GLchan.
- * No pixel transfer ops are applied.
- */
-void
-_mesa_unpack_color_span_uint(struct gl_context *ctx,
- GLuint n, GLenum dstFormat, GLuint *dest,
- GLenum srcFormat, GLenum srcType,
- const GLvoid *source,
- const struct gl_pixelstore_attrib *srcPacking)
-{
- GLuint (*rgba)[4] = (GLuint (*)[4]) malloc(n * 4 * sizeof(GLfloat));
-
- if (!rgba) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "pixel unpacking");
- return;
- }
-
- ASSERT(dstFormat == GL_ALPHA ||
- dstFormat == GL_LUMINANCE ||
- dstFormat == GL_LUMINANCE_ALPHA ||
- dstFormat == GL_INTENSITY ||
- dstFormat == GL_RED ||
- dstFormat == GL_RG ||
- dstFormat == GL_RGB ||
- dstFormat == GL_RGBA);
-
- ASSERT(srcFormat == GL_RED ||
- srcFormat == GL_GREEN ||
- srcFormat == GL_BLUE ||
- srcFormat == GL_ALPHA ||
- srcFormat == GL_LUMINANCE ||
- srcFormat == GL_LUMINANCE_ALPHA ||
- srcFormat == GL_INTENSITY ||
- srcFormat == GL_RG ||
- srcFormat == GL_RGB ||
- srcFormat == GL_BGR ||
- srcFormat == GL_RGBA ||
- srcFormat == GL_BGRA ||
- srcFormat == GL_ABGR_EXT ||
- srcFormat == GL_RED_INTEGER_EXT ||
- srcFormat == GL_GREEN_INTEGER_EXT ||
- srcFormat == GL_BLUE_INTEGER_EXT ||
- srcFormat == GL_ALPHA_INTEGER_EXT ||
- srcFormat == GL_RGB_INTEGER_EXT ||
- srcFormat == GL_RGBA_INTEGER_EXT ||
- srcFormat == GL_BGR_INTEGER_EXT ||
- srcFormat == GL_BGRA_INTEGER_EXT ||
- srcFormat == GL_LUMINANCE_INTEGER_EXT ||
- srcFormat == GL_LUMINANCE_ALPHA_INTEGER_EXT);
-
- ASSERT(srcType == GL_UNSIGNED_BYTE ||
- srcType == GL_BYTE ||
- srcType == GL_UNSIGNED_SHORT ||
- srcType == GL_SHORT ||
- srcType == GL_UNSIGNED_INT ||
- srcType == GL_INT ||
- srcType == GL_HALF_FLOAT_ARB ||
- srcType == GL_FLOAT ||
- srcType == GL_UNSIGNED_BYTE_3_3_2 ||
- srcType == GL_UNSIGNED_BYTE_2_3_3_REV ||
- srcType == GL_UNSIGNED_SHORT_5_6_5 ||
- srcType == GL_UNSIGNED_SHORT_5_6_5_REV ||
- srcType == GL_UNSIGNED_SHORT_4_4_4_4 ||
- srcType == GL_UNSIGNED_SHORT_4_4_4_4_REV ||
- srcType == GL_UNSIGNED_SHORT_5_5_5_1 ||
- srcType == GL_UNSIGNED_SHORT_1_5_5_5_REV ||
- srcType == GL_UNSIGNED_INT_8_8_8_8 ||
- srcType == GL_UNSIGNED_INT_8_8_8_8_REV ||
- srcType == GL_UNSIGNED_INT_10_10_10_2 ||
- srcType == GL_UNSIGNED_INT_2_10_10_10_REV ||
- srcType == GL_UNSIGNED_INT_5_9_9_9_REV ||
- srcType == GL_UNSIGNED_INT_10F_11F_11F_REV);
-
-
- /* Extract image data as uint[4] pixels */
- extract_uint_rgba(n, rgba, srcFormat, srcType, source,
- srcPacking->SwapBytes);
-
- if (dstFormat == GL_RGBA) {
- /* simple case */
- memcpy(dest, rgba, 4 * sizeof(GLuint) * n);
- }
- else {
- /* general case */
- GLint rDst, gDst, bDst, aDst, lDst, iDst;
- GLint dstComponents = _mesa_components_in_format( dstFormat );
-
- assert(dstComponents > 0);
-
- get_component_indexes(dstFormat,
- &rDst, &gDst, &bDst, &aDst, &lDst, &iDst);
-
- /* Now pack values in the requested dest format */
- if (rDst >= 0) {
- GLuint *dst = dest;
- GLuint i;
- for (i = 0; i < n; i++) {
- dst[rDst] = rgba[i][RCOMP];
- dst += dstComponents;
- }
- }
-
- if (gDst >= 0) {
- GLuint *dst = dest;
- GLuint i;
- for (i = 0; i < n; i++) {
- dst[gDst] = rgba[i][GCOMP];
- dst += dstComponents;
- }
- }
-
- if (bDst >= 0) {
- GLuint *dst = dest;
- GLuint i;
- for (i = 0; i < n; i++) {
- dst[bDst] = rgba[i][BCOMP];
- dst += dstComponents;
- }
- }
-
- if (aDst >= 0) {
- GLuint *dst = dest;
- GLuint i;
- for (i = 0; i < n; i++) {
- dst[aDst] = rgba[i][ACOMP];
- dst += dstComponents;
- }
- }
-
- if (iDst >= 0) {
- GLuint *dst = dest;
- GLuint i;
- assert(iDst == 0);
- assert(dstComponents == 1);
- for (i = 0; i < n; i++) {
- /* Intensity comes from red channel */
- dst[i] = rgba[i][RCOMP];
- }
- }
-
- if (lDst >= 0) {
- GLuint *dst = dest;
- GLuint i;
- assert(lDst == 0);
- for (i = 0; i < n; i++) {
- /* Luminance comes from red channel */
- dst[0] = rgba[i][RCOMP];
- dst += dstComponents;
- }
- }
- }
-
- free(rgba);
-}
-
-
-
-/**
- * Similar to _mesa_unpack_color_span_float(), but for dudv data instead of rgba,
- * directly return GLbyte data, no transfer ops apply.
- */
-void
-_mesa_unpack_dudv_span_byte( struct gl_context *ctx,
- GLuint n, GLenum dstFormat, GLbyte dest[],
- GLenum srcFormat, GLenum srcType,
- const GLvoid *source,
- const struct gl_pixelstore_attrib *srcPacking,
- GLbitfield transferOps )
-{
- ASSERT(dstFormat == GL_DUDV_ATI);
- ASSERT(srcFormat == GL_DUDV_ATI ||
- srcFormat == GL_DU8DV8_ATI);
-
- ASSERT(srcType == GL_UNSIGNED_BYTE ||
- srcType == GL_BYTE ||
- srcType == GL_UNSIGNED_SHORT ||
- srcType == GL_SHORT ||
- srcType == GL_UNSIGNED_INT ||
- srcType == GL_INT ||
- srcType == GL_HALF_FLOAT_ARB ||
- srcType == GL_FLOAT);
-
- /* general solution */
- {
- GLint dstComponents;
- GLbyte *dst = dest;
- GLuint i;
- GLfloat (*rgba)[4] = (GLfloat (*)[4]) malloc(4 * n * sizeof(GLfloat));
-
- if (!rgba) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "pixel unpacking");
- return;
- }
-
- dstComponents = _mesa_components_in_format( dstFormat );
- /* source & dest image formats should have been error checked by now */
- assert(dstComponents > 0);
-
- /*
- * Extract image data and convert to RGBA floats
- */
- extract_float_rgba(n, rgba, srcFormat, srcType, source,
- srcPacking->SwapBytes);
-
-
- /* Now determine which color channels we need to produce.
- * And determine the dest index (offset) within each color tuple.
- */
-
- /* Now pack results in the requested dstFormat */
- for (i = 0; i < n; i++) {
- /* not sure - need clamp[-1,1] here? */
- dst[0] = FLOAT_TO_BYTE(rgba[i][RCOMP]);
- dst[1] = FLOAT_TO_BYTE(rgba[i][GCOMP]);
- dst += dstComponents;
- }
-
- free(rgba);
- }
-}
-
-/*
- * Unpack a row of color index data from a client buffer according to
- * the pixel unpacking parameters.
- * This is (or will be) used by glDrawPixels, glTexImage[123]D, etc.
- *
- * Args: ctx - the context
- * n - number of pixels
- * dstType - destination data type
- * dest - destination array
- * srcType - source pixel type
- * source - source data pointer
- * srcPacking - pixel unpacking parameters
- * transferOps - the pixel transfer operations to apply
- */
-void
-_mesa_unpack_index_span( struct gl_context *ctx, GLuint n,
- GLenum dstType, GLvoid *dest,
- GLenum srcType, const GLvoid *source,
- const struct gl_pixelstore_attrib *srcPacking,
- GLbitfield transferOps )
-{
- ASSERT(srcType == GL_BITMAP ||
- srcType == GL_UNSIGNED_BYTE ||
- srcType == GL_BYTE ||
- srcType == GL_UNSIGNED_SHORT ||
- srcType == GL_SHORT ||
- srcType == GL_UNSIGNED_INT ||
- srcType == GL_INT ||
- srcType == GL_HALF_FLOAT_ARB ||
- srcType == GL_FLOAT);
-
- ASSERT(dstType == GL_UNSIGNED_BYTE ||
- dstType == GL_UNSIGNED_SHORT ||
- dstType == GL_UNSIGNED_INT);
-
-
- transferOps &= (IMAGE_MAP_COLOR_BIT | IMAGE_SHIFT_OFFSET_BIT);
-
- /*
- * Try simple cases first
- */
- if (transferOps == 0 && srcType == GL_UNSIGNED_BYTE
- && dstType == GL_UNSIGNED_BYTE) {
- memcpy(dest, source, n * sizeof(GLubyte));
- }
- else if (transferOps == 0 && srcType == GL_UNSIGNED_INT
- && dstType == GL_UNSIGNED_INT && !srcPacking->SwapBytes) {
- memcpy(dest, source, n * sizeof(GLuint));
- }
- else {
- /*
- * general solution
- */
- GLuint *indexes = (GLuint *) malloc(n * sizeof(GLuint));
-
- if (!indexes) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "pixel unpacking");
- return;
- }
-
- extract_uint_indexes(n, indexes, GL_COLOR_INDEX, srcType, source,
- srcPacking);
-
- if (transferOps)
- _mesa_apply_ci_transfer_ops(ctx, transferOps, n, indexes);
-
- /* convert to dest type */
- switch (dstType) {
- case GL_UNSIGNED_BYTE:
- {
- GLubyte *dst = (GLubyte *) dest;
- GLuint i;
- for (i = 0; i < n; i++) {
- dst[i] = (GLubyte) (indexes[i] & 0xff);
- }
- }
- break;
- case GL_UNSIGNED_SHORT:
- {
- GLuint *dst = (GLuint *) dest;
- GLuint i;
- for (i = 0; i < n; i++) {
- dst[i] = (GLushort) (indexes[i] & 0xffff);
- }
- }
- break;
- case GL_UNSIGNED_INT:
- memcpy(dest, indexes, n * sizeof(GLuint));
- break;
- default:
- _mesa_problem(ctx, "bad dstType in _mesa_unpack_index_span");
- }
-
- free(indexes);
- }
-}
-
-
-void
-_mesa_pack_index_span( struct gl_context *ctx, GLuint n,
- GLenum dstType, GLvoid *dest, const GLuint *source,
- const struct gl_pixelstore_attrib *dstPacking,
- GLbitfield transferOps )
-{
- GLuint *indexes = (GLuint *) malloc(n * sizeof(GLuint));
-
- if (!indexes) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "pixel packing");
- return;
- }
-
- transferOps &= (IMAGE_MAP_COLOR_BIT | IMAGE_SHIFT_OFFSET_BIT);
-
- if (transferOps & (IMAGE_MAP_COLOR_BIT | IMAGE_SHIFT_OFFSET_BIT)) {
- /* make a copy of input */
- memcpy(indexes, source, n * sizeof(GLuint));
- _mesa_apply_ci_transfer_ops(ctx, transferOps, n, indexes);
- source = indexes;
- }
-
- switch (dstType) {
- case GL_UNSIGNED_BYTE:
- {
- GLubyte *dst = (GLubyte *) dest;
- GLuint i;
- for (i = 0; i < n; i++) {
- *dst++ = (GLubyte) source[i];
- }
- }
- break;
- case GL_BYTE:
- {
- GLbyte *dst = (GLbyte *) dest;
- GLuint i;
- for (i = 0; i < n; i++) {
- dst[i] = (GLbyte) source[i];
- }
- }
- break;
- case GL_UNSIGNED_SHORT:
- {
- GLushort *dst = (GLushort *) dest;
- GLuint i;
- for (i = 0; i < n; i++) {
- dst[i] = (GLushort) source[i];
- }
- if (dstPacking->SwapBytes) {
- _mesa_swap2( (GLushort *) dst, n );
- }
- }
- break;
- case GL_SHORT:
- {
- GLshort *dst = (GLshort *) dest;
- GLuint i;
- for (i = 0; i < n; i++) {
- dst[i] = (GLshort) source[i];
- }
- if (dstPacking->SwapBytes) {
- _mesa_swap2( (GLushort *) dst, n );
- }
- }
- break;
- case GL_UNSIGNED_INT:
- {
- GLuint *dst = (GLuint *) dest;
- GLuint i;
- for (i = 0; i < n; i++) {
- dst[i] = (GLuint) source[i];
- }
- if (dstPacking->SwapBytes) {
- _mesa_swap4( (GLuint *) dst, n );
- }
- }
- break;
- case GL_INT:
- {
- GLint *dst = (GLint *) dest;
- GLuint i;
- for (i = 0; i < n; i++) {
- dst[i] = (GLint) source[i];
- }
- if (dstPacking->SwapBytes) {
- _mesa_swap4( (GLuint *) dst, n );
- }
- }
- break;
- case GL_FLOAT:
- {
- GLfloat *dst = (GLfloat *) dest;
- GLuint i;
- for (i = 0; i < n; i++) {
- dst[i] = (GLfloat) source[i];
- }
- if (dstPacking->SwapBytes) {
- _mesa_swap4( (GLuint *) dst, n );
- }
- }
- break;
- case GL_HALF_FLOAT_ARB:
- {
- GLhalfARB *dst = (GLhalfARB *) dest;
- GLuint i;
- for (i = 0; i < n; i++) {
- dst[i] = _mesa_float_to_half((GLfloat) source[i]);
- }
- if (dstPacking->SwapBytes) {
- _mesa_swap2( (GLushort *) dst, n );
- }
- }
- break;
- default:
- _mesa_problem(ctx, "bad type in _mesa_pack_index_span");
- }
-
- free(indexes);
-}
-
-
-/*
- * Unpack a row of stencil data from a client buffer according to
- * the pixel unpacking parameters.
- * This is (or will be) used by glDrawPixels
- *
- * Args: ctx - the context
- * n - number of pixels
- * dstType - destination data type
- * dest - destination array
- * srcType - source pixel type
- * source - source data pointer
- * srcPacking - pixel unpacking parameters
- * transferOps - apply offset/bias/lookup ops?
- */
-void
-_mesa_unpack_stencil_span( struct gl_context *ctx, GLuint n,
- GLenum dstType, GLvoid *dest,
- GLenum srcType, const GLvoid *source,
- const struct gl_pixelstore_attrib *srcPacking,
- GLbitfield transferOps )
-{
- ASSERT(srcType == GL_BITMAP ||
- srcType == GL_UNSIGNED_BYTE ||
- srcType == GL_BYTE ||
- srcType == GL_UNSIGNED_SHORT ||
- srcType == GL_SHORT ||
- srcType == GL_UNSIGNED_INT ||
- srcType == GL_INT ||
- srcType == GL_UNSIGNED_INT_24_8_EXT ||
- srcType == GL_HALF_FLOAT_ARB ||
- srcType == GL_FLOAT);
-
- ASSERT(dstType == GL_UNSIGNED_BYTE ||
- dstType == GL_UNSIGNED_SHORT ||
- dstType == GL_UNSIGNED_INT);
-
- /* only shift and offset apply to stencil */
- transferOps &= IMAGE_SHIFT_OFFSET_BIT;
-
- /*
- * Try simple cases first
- */
- if (transferOps == 0 &&
- !ctx->Pixel.MapStencilFlag &&
- srcType == GL_UNSIGNED_BYTE &&
- dstType == GL_UNSIGNED_BYTE) {
- memcpy(dest, source, n * sizeof(GLubyte));
- }
- else if (transferOps == 0 &&
- !ctx->Pixel.MapStencilFlag &&
- srcType == GL_UNSIGNED_INT &&
- dstType == GL_UNSIGNED_INT &&
- !srcPacking->SwapBytes) {
- memcpy(dest, source, n * sizeof(GLuint));
- }
- else {
- /*
- * general solution
- */
- GLuint *indexes = (GLuint *) malloc(n * sizeof(GLuint));
-
- if (!indexes) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "stencil unpacking");
- return;
- }
-
- extract_uint_indexes(n, indexes, GL_STENCIL_INDEX, srcType, source,
- srcPacking);
-
- if (transferOps & IMAGE_SHIFT_OFFSET_BIT) {
- /* shift and offset indexes */
- _mesa_shift_and_offset_ci(ctx, n, indexes);
- }
-
- if (ctx->Pixel.MapStencilFlag) {
- /* Apply stencil lookup table */
- const GLuint mask = ctx->PixelMaps.StoS.Size - 1;
- GLuint i;
- for (i = 0; i < n; i++) {
- indexes[i] = (GLuint)ctx->PixelMaps.StoS.Map[ indexes[i] & mask ];
- }
- }
-
- /* convert to dest type */
- switch (dstType) {
- case GL_UNSIGNED_BYTE:
- {
- GLubyte *dst = (GLubyte *) dest;
- GLuint i;
- for (i = 0; i < n; i++) {
- dst[i] = (GLubyte) (indexes[i] & 0xff);
- }
- }
- break;
- case GL_UNSIGNED_SHORT:
- {
- GLuint *dst = (GLuint *) dest;
- GLuint i;
- for (i = 0; i < n; i++) {
- dst[i] = (GLushort) (indexes[i] & 0xffff);
- }
- }
- break;
- case GL_UNSIGNED_INT:
- memcpy(dest, indexes, n * sizeof(GLuint));
- break;
- default:
- _mesa_problem(ctx, "bad dstType in _mesa_unpack_stencil_span");
- }
-
- free(indexes);
- }
-}
-
-
-void
-_mesa_pack_stencil_span( struct gl_context *ctx, GLuint n,
- GLenum dstType, GLvoid *dest, const GLstencil *source,
- const struct gl_pixelstore_attrib *dstPacking )
-{
- GLstencil *stencil = (GLstencil *) malloc(n * sizeof(GLstencil));
-
- if (!stencil) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "stencil packing");
- return;
- }
-
- if (ctx->Pixel.IndexShift || ctx->Pixel.IndexOffset ||
- ctx->Pixel.MapStencilFlag) {
- /* make a copy of input */
- memcpy(stencil, source, n * sizeof(GLstencil));
- _mesa_apply_stencil_transfer_ops(ctx, n, stencil);
- source = stencil;
- }
-
- switch (dstType) {
- case GL_UNSIGNED_BYTE:
- if (sizeof(GLstencil) == 1) {
- memcpy( dest, source, n );
- }
- else {
- GLubyte *dst = (GLubyte *) dest;
- GLuint i;
- for (i=0;i<n;i++) {
- dst[i] = (GLubyte) source[i];
- }
- }
- break;
- case GL_BYTE:
- {
- GLbyte *dst = (GLbyte *) dest;
- GLuint i;
- for (i=0;i<n;i++) {
- dst[i] = (GLbyte) (source[i] & 0x7f);
- }
- }
- break;
- case GL_UNSIGNED_SHORT:
- {
- GLushort *dst = (GLushort *) dest;
- GLuint i;
- for (i=0;i<n;i++) {
- dst[i] = (GLushort) source[i];
- }
- if (dstPacking->SwapBytes) {
- _mesa_swap2( (GLushort *) dst, n );
- }
- }
- break;
- case GL_SHORT:
- {
- GLshort *dst = (GLshort *) dest;
- GLuint i;
- for (i=0;i<n;i++) {
- dst[i] = (GLshort) source[i];
- }
- if (dstPacking->SwapBytes) {
- _mesa_swap2( (GLushort *) dst, n );
- }
- }
- break;
- case GL_UNSIGNED_INT:
- {
- GLuint *dst = (GLuint *) dest;
- GLuint i;
- for (i=0;i<n;i++) {
- dst[i] = (GLuint) source[i];
- }
- if (dstPacking->SwapBytes) {
- _mesa_swap4( (GLuint *) dst, n );
- }
- }
- break;
- case GL_INT:
- {
- GLint *dst = (GLint *) dest;
- GLuint i;
- for (i=0;i<n;i++) {
- dst[i] = (GLint) source[i];
- }
- if (dstPacking->SwapBytes) {
- _mesa_swap4( (GLuint *) dst, n );
- }
- }
- break;
- case GL_FLOAT:
- {
- GLfloat *dst = (GLfloat *) dest;
- GLuint i;
- for (i=0;i<n;i++) {
- dst[i] = (GLfloat) source[i];
- }
- if (dstPacking->SwapBytes) {
- _mesa_swap4( (GLuint *) dst, n );
- }
- }
- break;
- case GL_HALF_FLOAT_ARB:
- {
- GLhalfARB *dst = (GLhalfARB *) dest;
- GLuint i;
- for (i=0;i<n;i++) {
- dst[i] = _mesa_float_to_half( (float) source[i] );
- }
- if (dstPacking->SwapBytes) {
- _mesa_swap2( (GLushort *) dst, n );
- }
- }
- break;
- case GL_BITMAP:
- if (dstPacking->LsbFirst) {
- GLubyte *dst = (GLubyte *) dest;
- GLint shift = 0;
- GLuint i;
- for (i = 0; i < n; i++) {
- if (shift == 0)
- *dst = 0;
- *dst |= ((source[i] != 0) << shift);
- shift++;
- if (shift == 8) {
- shift = 0;
- dst++;
- }
- }
- }
- else {
- GLubyte *dst = (GLubyte *) dest;
- GLint shift = 7;
- GLuint i;
- for (i = 0; i < n; i++) {
- if (shift == 7)
- *dst = 0;
- *dst |= ((source[i] != 0) << shift);
- shift--;
- if (shift < 0) {
- shift = 7;
- dst++;
- }
- }
- }
- break;
- default:
- _mesa_problem(ctx, "bad type in _mesa_pack_index_span");
- }
-
- free(stencil);
-}
-
-#define DEPTH_VALUES(GLTYPE, GLTYPE2FLOAT) \
- do { \
- GLuint i; \
- const GLTYPE *src = (const GLTYPE *)source; \
- for (i = 0; i < n; i++) { \
- GLTYPE value = src[i]; \
- if (srcPacking->SwapBytes) { \
- if (sizeof(GLTYPE) == 2) { \
- SWAP2BYTE(value); \
- } else if (sizeof(GLTYPE) == 4) { \
- SWAP4BYTE(value); \
- } \
- } \
- depthValues[i] = GLTYPE2FLOAT(value); \
- } \
- } while (0)
-
-
-/**
- * Unpack a row of depth/z values from memory, returning GLushort, GLuint
- * or GLfloat values.
- * The glPixelTransfer (scale/bias) params will be applied.
- *
- * \param dstType one of GL_UNSIGNED_SHORT, GL_UNSIGNED_INT, GL_FLOAT
- * \param depthMax max value for returned GLushort or GLuint values
- * (ignored for GLfloat).
- */
-void
-_mesa_unpack_depth_span( struct gl_context *ctx, GLuint n,
- GLenum dstType, GLvoid *dest, GLuint depthMax,
- GLenum srcType, const GLvoid *source,
- const struct gl_pixelstore_attrib *srcPacking )
-{
- GLfloat *depthTemp, *depthValues;
- GLboolean needClamp = GL_FALSE;
-
- /* Look for special cases first.
- * Not only are these faster, they're less prone to numeric conversion
- * problems. Otherwise, converting from an int type to a float then
- * back to an int type can introduce errors that will show up as
- * artifacts in things like depth peeling which uses glCopyTexImage.
- */
- if (ctx->Pixel.DepthScale == 1.0 && ctx->Pixel.DepthBias == 0.0) {
- if (srcType == GL_UNSIGNED_INT && dstType == GL_UNSIGNED_SHORT) {
- const GLuint *src = (const GLuint *) source;
- GLushort *dst = (GLushort *) dest;
- GLuint i;
- for (i = 0; i < n; i++) {
- dst[i] = src[i] >> 16;
- }
- return;
- }
- if (srcType == GL_UNSIGNED_SHORT
- && dstType == GL_UNSIGNED_INT
- && depthMax == 0xffffffff) {
- const GLushort *src = (const GLushort *) source;
- GLuint *dst = (GLuint *) dest;
- GLuint i;
- for (i = 0; i < n; i++) {
- dst[i] = src[i] | (src[i] << 16);
- }
- return;
- }
- if (srcType == GL_UNSIGNED_INT_24_8
- && dstType == GL_UNSIGNED_INT
- && depthMax == 0xffffff) {
- const GLuint *src = (const GLuint *) source;
- GLuint *dst = (GLuint *) dest;
- GLuint i;
- for (i = 0; i < n; i++) {
- dst[i] = src[i] >> 8;
- }
- return;
- }
- /* XXX may want to add additional cases here someday */
- }
-
- /* general case path follows */
-
- depthTemp = (GLfloat *) malloc(n * sizeof(GLfloat));
- if (!depthTemp) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "pixel unpacking");
- return;
- }
-
- if (dstType == GL_FLOAT) {
- depthValues = (GLfloat *) dest;
- }
- else {
- depthValues = depthTemp;
- }
-
- /* Convert incoming values to GLfloat. Some conversions will require
- * clamping, below.
- */
- switch (srcType) {
- case GL_BYTE:
- DEPTH_VALUES(GLbyte, BYTE_TO_FLOAT);
- needClamp = GL_TRUE;
- break;
- case GL_UNSIGNED_BYTE:
- DEPTH_VALUES(GLubyte, UBYTE_TO_FLOAT);
- break;
- case GL_SHORT:
- DEPTH_VALUES(GLshort, SHORT_TO_FLOAT);
- needClamp = GL_TRUE;
- break;
- case GL_UNSIGNED_SHORT:
- DEPTH_VALUES(GLushort, USHORT_TO_FLOAT);
- break;
- case GL_INT:
- DEPTH_VALUES(GLint, INT_TO_FLOAT);
- needClamp = GL_TRUE;
- break;
- case GL_UNSIGNED_INT:
- DEPTH_VALUES(GLuint, UINT_TO_FLOAT);
- break;
- case GL_UNSIGNED_INT_24_8_EXT: /* GL_EXT_packed_depth_stencil */
- if (dstType == GL_UNSIGNED_INT_24_8_EXT &&
- depthMax == 0xffffff &&
- ctx->Pixel.DepthScale == 1.0 &&
- ctx->Pixel.DepthBias == 0.0) {
- const GLuint *src = (const GLuint *) source;
- GLuint *zValues = (GLuint *) dest;
- GLuint i;
- for (i = 0; i < n; i++) {
- GLuint value = src[i];
- if (srcPacking->SwapBytes) {
- SWAP4BYTE(value);
- }
- zValues[i] = value & 0xffffff00;
- }
- return;
- }
- else {
- const GLuint *src = (const GLuint *) source;
- const GLfloat scale = 1.0f / 0xffffff;
- GLuint i;
- for (i = 0; i < n; i++) {
- GLuint value = src[i];
- if (srcPacking->SwapBytes) {
- SWAP4BYTE(value);
- }
- depthValues[i] = (value >> 8) * scale;
- }
- }
- break;
- case GL_FLOAT:
- DEPTH_VALUES(GLfloat, 1*);
- needClamp = GL_TRUE;
- break;
- case GL_HALF_FLOAT_ARB:
- {
- GLuint i;
- const GLhalfARB *src = (const GLhalfARB *) source;
- for (i = 0; i < n; i++) {
- GLhalfARB value = src[i];
- if (srcPacking->SwapBytes) {
- SWAP2BYTE(value);
- }
- depthValues[i] = _mesa_half_to_float(value);
- }
- needClamp = GL_TRUE;
- }
- break;
- default:
- _mesa_problem(NULL, "bad type in _mesa_unpack_depth_span()");
- free(depthTemp);
- return;
- }
-
- /* apply depth scale and bias */
- {
- const GLfloat scale = ctx->Pixel.DepthScale;
- const GLfloat bias = ctx->Pixel.DepthBias;
- if (scale != 1.0 || bias != 0.0) {
- GLuint i;
- for (i = 0; i < n; i++) {
- depthValues[i] = depthValues[i] * scale + bias;
- }
- needClamp = GL_TRUE;
- }
- }
-
- /* clamp to [0, 1] */
- if (needClamp) {
- GLuint i;
- for (i = 0; i < n; i++) {
- depthValues[i] = (GLfloat)CLAMP(depthValues[i], 0.0, 1.0);
- }
- }
-
- /*
- * Convert values to dstType
- */
- if (dstType == GL_UNSIGNED_INT) {
- GLuint *zValues = (GLuint *) dest;
- GLuint i;
- if (depthMax <= 0xffffff) {
- /* no overflow worries */
- for (i = 0; i < n; i++) {
- zValues[i] = (GLuint) (depthValues[i] * (GLfloat) depthMax);
- }
- }
- else {
- /* need to use double precision to prevent overflow problems */
- for (i = 0; i < n; i++) {
- GLdouble z = depthValues[i] * (GLfloat) depthMax;
- if (z >= (GLdouble) 0xffffffff)
- zValues[i] = 0xffffffff;
- else
- zValues[i] = (GLuint) z;
- }
- }
- }
- else if (dstType == GL_UNSIGNED_SHORT) {
- GLushort *zValues = (GLushort *) dest;
- GLuint i;
- ASSERT(depthMax <= 0xffff);
- for (i = 0; i < n; i++) {
- zValues[i] = (GLushort) (depthValues[i] * (GLfloat) depthMax);
- }
- }
- else {
- ASSERT(dstType == GL_FLOAT);
- /*ASSERT(depthMax == 1.0F);*/
- }
-
- free(depthTemp);
-}
-
-
-/*
- * Pack an array of depth values. The values are floats in [0,1].
- */
-void
-_mesa_pack_depth_span( struct gl_context *ctx, GLuint n, GLvoid *dest,
- GLenum dstType, const GLfloat *depthSpan,
- const struct gl_pixelstore_attrib *dstPacking )
-{
- GLfloat *depthCopy = (GLfloat *) malloc(n * sizeof(GLfloat));
- if (!depthCopy) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "pixel packing");
- return;
- }
-
- if (ctx->Pixel.DepthScale != 1.0 || ctx->Pixel.DepthBias != 0.0) {
- memcpy(depthCopy, depthSpan, n * sizeof(GLfloat));
- _mesa_scale_and_bias_depth(ctx, n, depthCopy);
- depthSpan = depthCopy;
- }
-
- switch (dstType) {
- case GL_UNSIGNED_BYTE:
- {
- GLubyte *dst = (GLubyte *) dest;
- GLuint i;
- for (i = 0; i < n; i++) {
- dst[i] = FLOAT_TO_UBYTE( depthSpan[i] );
- }
- }
- break;
- case GL_BYTE:
- {
- GLbyte *dst = (GLbyte *) dest;
- GLuint i;
- for (i = 0; i < n; i++) {
- dst[i] = FLOAT_TO_BYTE( depthSpan[i] );
- }
- }
- break;
- case GL_UNSIGNED_SHORT:
- {
- GLushort *dst = (GLushort *) dest;
- GLuint i;
- for (i = 0; i < n; i++) {
- CLAMPED_FLOAT_TO_USHORT(dst[i], depthSpan[i]);
- }
- if (dstPacking->SwapBytes) {
- _mesa_swap2( (GLushort *) dst, n );
- }
- }
- break;
- case GL_SHORT:
- {
- GLshort *dst = (GLshort *) dest;
- GLuint i;
- for (i = 0; i < n; i++) {
- dst[i] = FLOAT_TO_SHORT( depthSpan[i] );
- }
- if (dstPacking->SwapBytes) {
- _mesa_swap2( (GLushort *) dst, n );
- }
- }
- break;
- case GL_UNSIGNED_INT:
- {
- GLuint *dst = (GLuint *) dest;
- GLuint i;
- for (i = 0; i < n; i++) {
- dst[i] = FLOAT_TO_UINT( depthSpan[i] );
- }
- if (dstPacking->SwapBytes) {
- _mesa_swap4( (GLuint *) dst, n );
- }
- }
- break;
- case GL_INT:
- {
- GLint *dst = (GLint *) dest;
- GLuint i;
- for (i = 0; i < n; i++) {
- dst[i] = FLOAT_TO_INT( depthSpan[i] );
- }
- if (dstPacking->SwapBytes) {
- _mesa_swap4( (GLuint *) dst, n );
- }
- }
- break;
- case GL_FLOAT:
- {
- GLfloat *dst = (GLfloat *) dest;
- GLuint i;
- for (i = 0; i < n; i++) {
- dst[i] = depthSpan[i];
- }
- if (dstPacking->SwapBytes) {
- _mesa_swap4( (GLuint *) dst, n );
- }
- }
- break;
- case GL_HALF_FLOAT_ARB:
- {
- GLhalfARB *dst = (GLhalfARB *) dest;
- GLuint i;
- for (i = 0; i < n; i++) {
- dst[i] = _mesa_float_to_half(depthSpan[i]);
- }
- if (dstPacking->SwapBytes) {
- _mesa_swap2( (GLushort *) dst, n );
- }
- }
- break;
- default:
- _mesa_problem(ctx, "bad type in _mesa_pack_depth_span");
- }
-
- free(depthCopy);
-}
-
-
-
-/**
- * Pack depth and stencil values as GL_DEPTH_STENCIL/GL_UNSIGNED_INT_24_8.
- */
-void
-_mesa_pack_depth_stencil_span(struct gl_context *ctx, GLuint n, GLuint *dest,
- const GLfloat *depthVals,
- const GLstencil *stencilVals,
- const struct gl_pixelstore_attrib *dstPacking)
-{
- GLfloat *depthCopy = (GLfloat *) malloc(n * sizeof(GLfloat));
- GLstencil *stencilCopy = (GLstencil *) malloc(n * sizeof(GLstencil));
- GLuint i;
-
- if (!depthCopy || !stencilCopy) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "pixel packing");
- free(depthCopy);
- free(stencilCopy);
- return;
- }
-
- if (ctx->Pixel.DepthScale != 1.0 || ctx->Pixel.DepthBias != 0.0) {
- memcpy(depthCopy, depthVals, n * sizeof(GLfloat));
- _mesa_scale_and_bias_depth(ctx, n, depthCopy);
- depthVals = depthCopy;
- }
-
- if (ctx->Pixel.IndexShift ||
- ctx->Pixel.IndexOffset ||
- ctx->Pixel.MapStencilFlag) {
- memcpy(stencilCopy, stencilVals, n * sizeof(GLstencil));
- _mesa_apply_stencil_transfer_ops(ctx, n, stencilCopy);
- stencilVals = stencilCopy;
- }
-
- for (i = 0; i < n; i++) {
- GLuint z = (GLuint) (depthVals[i] * 0xffffff);
- dest[i] = (z << 8) | (stencilVals[i] & 0xff);
- }
-
- if (dstPacking->SwapBytes) {
- _mesa_swap4(dest, n);
- }
-
- free(depthCopy);
- free(stencilCopy);
-}
-
-
-
-
-/**
- * Unpack image data. Apply byte swapping, byte flipping (bitmap).
- * Return all image data in a contiguous block. This is used when we
- * compile glDrawPixels, glTexImage, etc into a display list. We
- * need a copy of the data in a standard format.
- */
-void *
-_mesa_unpack_image( GLuint dimensions,
- GLsizei width, GLsizei height, GLsizei depth,
- GLenum format, GLenum type, const GLvoid *pixels,
- const struct gl_pixelstore_attrib *unpack )
-{
- GLint bytesPerRow, compsPerRow;
- GLboolean flipBytes, swap2, swap4;
-
- if (!pixels)
- return NULL; /* not necessarily an error */
-
- if (width <= 0 || height <= 0 || depth <= 0)
- return NULL; /* generate error later */
-
- if (type == GL_BITMAP) {
- bytesPerRow = (width + 7) >> 3;
- flipBytes = unpack->LsbFirst;
- swap2 = swap4 = GL_FALSE;
- compsPerRow = 0;
- }
- else {
- const GLint bytesPerPixel = _mesa_bytes_per_pixel(format, type);
- GLint components = _mesa_components_in_format(format);
- GLint bytesPerComp;
-
- if (_mesa_type_is_packed(type))
- components = 1;
-
- if (bytesPerPixel <= 0 || components <= 0)
- return NULL; /* bad format or type. generate error later */
- bytesPerRow = bytesPerPixel * width;
- bytesPerComp = bytesPerPixel / components;
- flipBytes = GL_FALSE;
- swap2 = (bytesPerComp == 2) && unpack->SwapBytes;
- swap4 = (bytesPerComp == 4) && unpack->SwapBytes;
- compsPerRow = components * width;
- assert(compsPerRow >= width);
- }
-
- {
- GLubyte *destBuffer
- = (GLubyte *) malloc(bytesPerRow * height * depth);
- GLubyte *dst;
- GLint img, row;
- if (!destBuffer)
- return NULL; /* generate GL_OUT_OF_MEMORY later */
-
- dst = destBuffer;
- for (img = 0; img < depth; img++) {
- for (row = 0; row < height; row++) {
- const GLvoid *src = _mesa_image_address(dimensions, unpack, pixels,
- width, height, format, type, img, row, 0);
-
- if ((type == GL_BITMAP) && (unpack->SkipPixels & 0x7)) {
- GLint i;
- flipBytes = GL_FALSE;
- if (unpack->LsbFirst) {
- GLubyte srcMask = 1 << (unpack->SkipPixels & 0x7);
- GLubyte dstMask = 128;
- const GLubyte *s = src;
- GLubyte *d = dst;
- *d = 0;
- for (i = 0; i < width; i++) {
- if (*s & srcMask) {
- *d |= dstMask;
- }
- if (srcMask == 128) {
- srcMask = 1;
- s++;
- }
- else {
- srcMask = srcMask << 1;
- }
- if (dstMask == 1) {
- dstMask = 128;
- d++;
- *d = 0;
- }
- else {
- dstMask = dstMask >> 1;
- }
- }
- }
- else {
- GLubyte srcMask = 128 >> (unpack->SkipPixels & 0x7);
- GLubyte dstMask = 128;
- const GLubyte *s = src;
- GLubyte *d = dst;
- *d = 0;
- for (i = 0; i < width; i++) {
- if (*s & srcMask) {
- *d |= dstMask;
- }
- if (srcMask == 1) {
- srcMask = 128;
- s++;
- }
- else {
- srcMask = srcMask >> 1;
- }
- if (dstMask == 1) {
- dstMask = 128;
- d++;
- *d = 0;
- }
- else {
- dstMask = dstMask >> 1;
- }
- }
- }
- }
- else {
- memcpy(dst, src, bytesPerRow);
- }
-
- /* byte flipping/swapping */
- if (flipBytes) {
- flip_bytes((GLubyte *) dst, bytesPerRow);
- }
- else if (swap2) {
- _mesa_swap2((GLushort*) dst, compsPerRow);
- }
- else if (swap4) {
- _mesa_swap4((GLuint*) dst, compsPerRow);
- }
- dst += bytesPerRow;
- }
- }
- return destBuffer;
- }
-}
-
+/*
+ * Mesa 3-D graphics library
+ *
+ * Copyright (C) 1999-2008 Brian Paul All Rights Reserved.
+ * Copyright (C) 2009-2010 VMware, Inc. All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THEA AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+
+/**
+ * \file pack.c
+ * Image and pixel span packing and unpacking.
+ */
+
+
+#include "glheader.h"
+#include "colormac.h"
+#include "enums.h"
+#include "image.h"
+#include "imports.h"
+#include "mtypes.h"
+#include "pack.h"
+#include "pixeltransfer.h"
+#include "imports.h"
+#include "../../gallium/auxiliary/util/u_format_rgb9e5.h"
+#include "../../gallium/auxiliary/util/u_format_r11g11b10f.h"
+
+
+/**
+ * NOTE:
+ * Normally, BYTE_TO_FLOAT(0) returns 0.00392 That causes problems when
+ * we later convert the float to a packed integer value (such as for
+ * GL_RGB5_A1) because we'll wind up with a non-zero value.
+ *
+ * We redefine the macros here so zero is handled correctly.
+ */
+#undef BYTE_TO_FLOAT
+#define BYTE_TO_FLOAT(B) ((B) == 0 ? 0.0F : ((2.0F * (B) + 1.0F) * (1.0F/255.0F)))
+
+#undef SHORT_TO_FLOAT
+#define SHORT_TO_FLOAT(S) ((S) == 0 ? 0.0F : ((2.0F * (S) + 1.0F) * (1.0F/65535.0F)))
+
+
+
+/** Compute ceiling of integer quotient of A divided by B. */
+#define CEILING( A, B ) ( (A) % (B) == 0 ? (A)/(B) : (A)/(B)+1 )
+
+
+/**
+ * Flip the 8 bits in each byte of the given array.
+ *
+ * \param p array.
+ * \param n number of bytes.
+ *
+ * \todo try this trick to flip bytes someday:
+ * \code
+ * v = ((v & 0x55555555) << 1) | ((v >> 1) & 0x55555555);
+ * v = ((v & 0x33333333) << 2) | ((v >> 2) & 0x33333333);
+ * v = ((v & 0x0f0f0f0f) << 4) | ((v >> 4) & 0x0f0f0f0f);
+ * \endcode
+ */
+static void
+flip_bytes( GLubyte *p, GLuint n )
+{
+ GLuint i, a, b;
+ for (i = 0; i < n; i++) {
+ b = (GLuint) p[i]; /* words are often faster than bytes */
+ a = ((b & 0x01) << 7) |
+ ((b & 0x02) << 5) |
+ ((b & 0x04) << 3) |
+ ((b & 0x08) << 1) |
+ ((b & 0x10) >> 1) |
+ ((b & 0x20) >> 3) |
+ ((b & 0x40) >> 5) |
+ ((b & 0x80) >> 7);
+ p[i] = (GLubyte) a;
+ }
+}
+
+
+
+/*
+ * Unpack a 32x32 pixel polygon stipple from user memory using the
+ * current pixel unpack settings.
+ */
+void
+_mesa_unpack_polygon_stipple( const GLubyte *pattern, GLuint dest[32],
+ const struct gl_pixelstore_attrib *unpacking )
+{
+ GLubyte *ptrn = (GLubyte *) _mesa_unpack_bitmap(32, 32, pattern, unpacking);
+ if (ptrn) {
+ /* Convert pattern from GLubytes to GLuints and handle big/little
+ * endian differences
+ */
+ GLubyte *p = ptrn;
+ GLint i;
+ for (i = 0; i < 32; i++) {
+ dest[i] = (p[0] << 24)
+ | (p[1] << 16)
+ | (p[2] << 8)
+ | (p[3] );
+ p += 4;
+ }
+ free(ptrn);
+ }
+}
+
+
+/*
+ * Pack polygon stipple into user memory given current pixel packing
+ * settings.
+ */
+void
+_mesa_pack_polygon_stipple( const GLuint pattern[32], GLubyte *dest,
+ const struct gl_pixelstore_attrib *packing )
+{
+ /* Convert pattern from GLuints to GLubytes to handle big/little
+ * endian differences.
+ */
+ GLubyte ptrn[32*4];
+ GLint i;
+ for (i = 0; i < 32; i++) {
+ ptrn[i * 4 + 0] = (GLubyte) ((pattern[i] >> 24) & 0xff);
+ ptrn[i * 4 + 1] = (GLubyte) ((pattern[i] >> 16) & 0xff);
+ ptrn[i * 4 + 2] = (GLubyte) ((pattern[i] >> 8 ) & 0xff);
+ ptrn[i * 4 + 3] = (GLubyte) ((pattern[i] ) & 0xff);
+ }
+
+ _mesa_pack_bitmap(32, 32, ptrn, dest, packing);
+}
+
+
+/*
+ * Unpack bitmap data. Resulting data will be in most-significant-bit-first
+ * order with row alignment = 1 byte.
+ */
+GLvoid *
+_mesa_unpack_bitmap( GLint width, GLint height, const GLubyte *pixels,
+ const struct gl_pixelstore_attrib *packing )
+{
+ GLint bytes, row, width_in_bytes;
+ GLubyte *buffer, *dst;
+
+ if (!pixels)
+ return NULL;
+
+ /* Alloc dest storage */
+ bytes = ((width + 7) / 8 * height);
+ buffer = (GLubyte *) malloc( bytes );
+ if (!buffer)
+ return NULL;
+
+ width_in_bytes = CEILING( width, 8 );
+ dst = buffer;
+ for (row = 0; row < height; row++) {
+ const GLubyte *src = (const GLubyte *)
+ _mesa_image_address2d(packing, pixels, width, height,
+ GL_COLOR_INDEX, GL_BITMAP, row, 0);
+ if (!src) {
+ free(buffer);
+ return NULL;
+ }
+
+ if ((packing->SkipPixels & 7) == 0) {
+ memcpy( dst, src, width_in_bytes );
+ if (packing->LsbFirst) {
+ flip_bytes( dst, width_in_bytes );
+ }
+ }
+ else {
+ /* handling SkipPixels is a bit tricky (no pun intended!) */
+ GLint i;
+ if (packing->LsbFirst) {
+ GLubyte srcMask = 1 << (packing->SkipPixels & 0x7);
+ GLubyte dstMask = 128;
+ const GLubyte *s = src;
+ GLubyte *d = dst;
+ *d = 0;
+ for (i = 0; i < width; i++) {
+ if (*s & srcMask) {
+ *d |= dstMask;
+ }
+ if (srcMask == 128) {
+ srcMask = 1;
+ s++;
+ }
+ else {
+ srcMask = srcMask << 1;
+ }
+ if (dstMask == 1) {
+ dstMask = 128;
+ d++;
+ *d = 0;
+ }
+ else {
+ dstMask = dstMask >> 1;
+ }
+ }
+ }
+ else {
+ GLubyte srcMask = 128 >> (packing->SkipPixels & 0x7);
+ GLubyte dstMask = 128;
+ const GLubyte *s = src;
+ GLubyte *d = dst;
+ *d = 0;
+ for (i = 0; i < width; i++) {
+ if (*s & srcMask) {
+ *d |= dstMask;
+ }
+ if (srcMask == 1) {
+ srcMask = 128;
+ s++;
+ }
+ else {
+ srcMask = srcMask >> 1;
+ }
+ if (dstMask == 1) {
+ dstMask = 128;
+ d++;
+ *d = 0;
+ }
+ else {
+ dstMask = dstMask >> 1;
+ }
+ }
+ }
+ }
+ dst += width_in_bytes;
+ }
+
+ return buffer;
+}
+
+
+/*
+ * Pack bitmap data.
+ */
+void
+_mesa_pack_bitmap( GLint width, GLint height, const GLubyte *source,
+ GLubyte *dest, const struct gl_pixelstore_attrib *packing )
+{
+ GLint row, width_in_bytes;
+ const GLubyte *src;
+
+ if (!source)
+ return;
+
+ width_in_bytes = CEILING( width, 8 );
+ src = source;
+ for (row = 0; row < height; row++) {
+ GLubyte *dst = (GLubyte *) _mesa_image_address2d(packing, dest,
+ width, height, GL_COLOR_INDEX, GL_BITMAP, row, 0);
+ if (!dst)
+ return;
+
+ if ((packing->SkipPixels & 7) == 0) {
+ memcpy( dst, src, width_in_bytes );
+ if (packing->LsbFirst) {
+ flip_bytes( dst, width_in_bytes );
+ }
+ }
+ else {
+ /* handling SkipPixels is a bit tricky (no pun intended!) */
+ GLint i;
+ if (packing->LsbFirst) {
+ GLubyte srcMask = 128;
+ GLubyte dstMask = 1 << (packing->SkipPixels & 0x7);
+ const GLubyte *s = src;
+ GLubyte *d = dst;
+ *d = 0;
+ for (i = 0; i < width; i++) {
+ if (*s & srcMask) {
+ *d |= dstMask;
+ }
+ if (srcMask == 1) {
+ srcMask = 128;
+ s++;
+ }
+ else {
+ srcMask = srcMask >> 1;
+ }
+ if (dstMask == 128) {
+ dstMask = 1;
+ d++;
+ *d = 0;
+ }
+ else {
+ dstMask = dstMask << 1;
+ }
+ }
+ }
+ else {
+ GLubyte srcMask = 128;
+ GLubyte dstMask = 128 >> (packing->SkipPixels & 0x7);
+ const GLubyte *s = src;
+ GLubyte *d = dst;
+ *d = 0;
+ for (i = 0; i < width; i++) {
+ if (*s & srcMask) {
+ *d |= dstMask;
+ }
+ if (srcMask == 1) {
+ srcMask = 128;
+ s++;
+ }
+ else {
+ srcMask = srcMask >> 1;
+ }
+ if (dstMask == 1) {
+ dstMask = 128;
+ d++;
+ *d = 0;
+ }
+ else {
+ dstMask = dstMask >> 1;
+ }
+ }
+ }
+ }
+ src += width_in_bytes;
+ }
+}
+
+
+/**
+ * Get indexes of color components for a basic color format, such as
+ * GL_RGBA, GL_RED, GL_LUMINANCE_ALPHA, etc. Return -1 for indexes
+ * that do not apply.
+ */
+static void
+get_component_indexes(GLenum format,
+ GLint *redIndex,
+ GLint *greenIndex,
+ GLint *blueIndex,
+ GLint *alphaIndex,
+ GLint *luminanceIndex,
+ GLint *intensityIndex)
+{
+ *redIndex = -1;
+ *greenIndex = -1;
+ *blueIndex = -1;
+ *alphaIndex = -1;
+ *luminanceIndex = -1;
+ *intensityIndex = -1;
+
+ switch (format) {
+ case GL_LUMINANCE:
+ case GL_LUMINANCE_INTEGER_EXT:
+ *luminanceIndex = 0;
+ break;
+ case GL_LUMINANCE_ALPHA:
+ case GL_LUMINANCE_ALPHA_INTEGER_EXT:
+ *luminanceIndex = 0;
+ *alphaIndex = 1;
+ break;
+ case GL_INTENSITY:
+ *intensityIndex = 0;
+ break;
+ case GL_RED:
+ case GL_RED_INTEGER_EXT:
+ *redIndex = 0;
+ break;
+ case GL_GREEN:
+ case GL_GREEN_INTEGER_EXT:
+ *greenIndex = 0;
+ break;
+ case GL_BLUE:
+ case GL_BLUE_INTEGER_EXT:
+ *blueIndex = 0;
+ break;
+ case GL_ALPHA:
+ case GL_ALPHA_INTEGER_EXT:
+ *alphaIndex = 0;
+ break;
+ case GL_RG:
+ case GL_RG_INTEGER:
+ *redIndex = 0;
+ *greenIndex = 1;
+ break;
+ case GL_RGB:
+ case GL_RGB_INTEGER_EXT:
+ *redIndex = 0;
+ *greenIndex = 1;
+ *blueIndex = 2;
+ break;
+ case GL_BGR:
+ case GL_BGR_INTEGER_EXT:
+ *blueIndex = 0;
+ *greenIndex = 1;
+ *redIndex = 2;
+ break;
+ case GL_RGBA:
+ case GL_RGBA_INTEGER_EXT:
+ *redIndex = 0;
+ *greenIndex = 1;
+ *blueIndex = 2;
+ *alphaIndex = 3;
+ break;
+ case GL_BGRA:
+ case GL_BGRA_INTEGER:
+ *redIndex = 2;
+ *greenIndex = 1;
+ *blueIndex = 0;
+ *alphaIndex = 3;
+ break;
+ case GL_ABGR_EXT:
+ *redIndex = 3;
+ *greenIndex = 2;
+ *blueIndex = 1;
+ *alphaIndex = 0;
+ break;
+ case GL_DU8DV8_ATI:
+ case GL_DUDV_ATI:
+ *redIndex = 0;
+ *greenIndex = 1;
+ break;
+ default:
+ assert(0 && "bad format in get_component_indexes()");
+ }
+}
+
+
+
+/**
+ * For small integer types, return the min and max possible values.
+ * Used for clamping floats to unscaled integer types.
+ * \return GL_TRUE if type is handled, GL_FALSE otherwise.
+ */
+static GLboolean
+get_type_min_max(GLenum type, GLfloat *min, GLfloat *max)
+{
+ switch (type) {
+ case GL_BYTE:
+ *min = -128.0;
+ *max = 127.0;
+ return GL_TRUE;
+ case GL_UNSIGNED_BYTE:
+ *min = 0.0;
+ *max = 255.0;
+ return GL_TRUE;
+ case GL_SHORT:
+ *min = -32768.0;
+ *max = 32767.0;
+ return GL_TRUE;
+ case GL_UNSIGNED_SHORT:
+ *min = 0.0;
+ *max = 65535.0;
+ return GL_TRUE;
+ default:
+ return GL_FALSE;
+ }
+}
+
+
+
+/**
+ * Used to pack an array [][4] of RGBA float colors as specified
+ * by the dstFormat, dstType and dstPacking. Used by glReadPixels.
+ * Historically, the RGBA values were in [0,1] and rescaled to fit
+ * into GLubytes, etc. But with new integer formats, the RGBA values
+ * may have any value and we don't always rescale when converting to
+ * integers.
+ *
+ * Note: the rgba values will be modified by this function when any pixel
+ * transfer ops are enabled.
+ */
+void
+_mesa_pack_rgba_span_float(struct gl_context *ctx, GLuint n, GLfloat rgba[][4],
+ GLenum dstFormat, GLenum dstType,
+ GLvoid *dstAddr,
+ const struct gl_pixelstore_attrib *dstPacking,
+ GLbitfield transferOps)
+{
+ GLfloat *luminance;
+ const GLint comps = _mesa_components_in_format(dstFormat);
+ const GLboolean intDstFormat = _mesa_is_integer_format(dstFormat);
+ GLuint i;
+
+ if (dstFormat == GL_LUMINANCE ||
+ dstFormat == GL_LUMINANCE_ALPHA ||
+ dstFormat == GL_LUMINANCE_INTEGER_EXT ||
+ dstFormat == GL_LUMINANCE_ALPHA_INTEGER_EXT) {
+ luminance = (GLfloat *) malloc(n * sizeof(GLfloat));
+ if (!luminance) {
+ _mesa_error(ctx, GL_OUT_OF_MEMORY, "pixel packing");
+ return;
+ }
+ }
+ else {
+ luminance = NULL;
+ }
+
+ if (transferOps) {
+ _mesa_apply_rgba_transfer_ops(ctx, transferOps, n, rgba);
+ }
+
+ /*
+ * Component clamping (besides clamping to [0,1] in
+ * _mesa_apply_rgba_transfer_ops()).
+ */
+ if (intDstFormat) {
+ /* clamping to dest type's min/max values */
+ GLfloat min, max;
+ if (get_type_min_max(dstType, &min, &max)) {
+ for (i = 0; i < n; i++) {
+ rgba[i][RCOMP] = CLAMP(rgba[i][RCOMP], min, max);
+ rgba[i][GCOMP] = CLAMP(rgba[i][GCOMP], min, max);
+ rgba[i][BCOMP] = CLAMP(rgba[i][BCOMP], min, max);
+ rgba[i][ACOMP] = CLAMP(rgba[i][ACOMP], min, max);
+ }
+ }
+ }
+ else if (dstFormat == GL_LUMINANCE || dstFormat == GL_LUMINANCE_ALPHA) {
+ /* compute luminance values */
+ if (transferOps & IMAGE_CLAMP_BIT) {
+ for (i = 0; i < n; i++) {
+ GLfloat sum = rgba[i][RCOMP] + rgba[i][GCOMP] + rgba[i][BCOMP];
+ luminance[i] = CLAMP(sum, 0.0F, 1.0F);
+ }
+ }
+ else {
+ for (i = 0; i < n; i++) {
+ luminance[i] = rgba[i][RCOMP] + rgba[i][GCOMP] + rgba[i][BCOMP];
+ }
+ }
+ }
+
+ /*
+ * Pack/store the pixels. Ugh! Lots of cases!!!
+ */
+ switch (dstType) {
+ case GL_UNSIGNED_BYTE:
+ {
+ GLubyte *dst = (GLubyte *) dstAddr;
+ switch (dstFormat) {
+ case GL_RED:
+ for (i=0;i<n;i++)
+ dst[i] = FLOAT_TO_UBYTE(rgba[i][RCOMP]);
+ break;
+ case GL_GREEN:
+ for (i=0;i<n;i++)
+ dst[i] = FLOAT_TO_UBYTE(rgba[i][GCOMP]);
+ break;
+ case GL_BLUE:
+ for (i=0;i<n;i++)
+ dst[i] = FLOAT_TO_UBYTE(rgba[i][BCOMP]);
+ break;
+ case GL_ALPHA:
+ for (i=0;i<n;i++)
+ dst[i] = FLOAT_TO_UBYTE(rgba[i][ACOMP]);
+ break;
+ case GL_LUMINANCE:
+ for (i=0;i<n;i++)
+ dst[i] = FLOAT_TO_UBYTE(luminance[i]);
+ break;
+ case GL_LUMINANCE_ALPHA:
+ for (i=0;i<n;i++) {
+ dst[i*2+0] = FLOAT_TO_UBYTE(luminance[i]);
+ dst[i*2+1] = FLOAT_TO_UBYTE(rgba[i][ACOMP]);
+ }
+ break;
+ case GL_RG:
+ for (i=0;i<n;i++) {
+ dst[i*2+0] = FLOAT_TO_UBYTE(rgba[i][RCOMP]);
+ dst[i*2+1] = FLOAT_TO_UBYTE(rgba[i][GCOMP]);
+ }
+ break;
+ case GL_RGB:
+ for (i=0;i<n;i++) {
+ dst[i*3+0] = FLOAT_TO_UBYTE(rgba[i][RCOMP]);
+ dst[i*3+1] = FLOAT_TO_UBYTE(rgba[i][GCOMP]);
+ dst[i*3+2] = FLOAT_TO_UBYTE(rgba[i][BCOMP]);
+ }
+ break;
+ case GL_RGBA:
+ for (i=0;i<n;i++) {
+ dst[i*4+0] = FLOAT_TO_UBYTE(rgba[i][RCOMP]);
+ dst[i*4+1] = FLOAT_TO_UBYTE(rgba[i][GCOMP]);
+ dst[i*4+2] = FLOAT_TO_UBYTE(rgba[i][BCOMP]);
+ dst[i*4+3] = FLOAT_TO_UBYTE(rgba[i][ACOMP]);
+ }
+ break;
+ case GL_BGR:
+ for (i=0;i<n;i++) {
+ dst[i*3+0] = FLOAT_TO_UBYTE(rgba[i][BCOMP]);
+ dst[i*3+1] = FLOAT_TO_UBYTE(rgba[i][GCOMP]);
+ dst[i*3+2] = FLOAT_TO_UBYTE(rgba[i][RCOMP]);
+ }
+ break;
+ case GL_BGRA:
+ for (i=0;i<n;i++) {
+ dst[i*4+0] = FLOAT_TO_UBYTE(rgba[i][BCOMP]);
+ dst[i*4+1] = FLOAT_TO_UBYTE(rgba[i][GCOMP]);
+ dst[i*4+2] = FLOAT_TO_UBYTE(rgba[i][RCOMP]);
+ dst[i*4+3] = FLOAT_TO_UBYTE(rgba[i][ACOMP]);
+ }
+ break;
+ case GL_ABGR_EXT:
+ for (i=0;i<n;i++) {
+ dst[i*4+0] = FLOAT_TO_UBYTE(rgba[i][ACOMP]);
+ dst[i*4+1] = FLOAT_TO_UBYTE(rgba[i][BCOMP]);
+ dst[i*4+2] = FLOAT_TO_UBYTE(rgba[i][GCOMP]);
+ dst[i*4+3] = FLOAT_TO_UBYTE(rgba[i][RCOMP]);
+ }
+ break;
+ case GL_RED_INTEGER_EXT:
+ for (i=0;i<n;i++) {
+ dst[i] = (GLubyte) rgba[i][RCOMP];
+ }
+ break;
+ case GL_GREEN_INTEGER_EXT:
+ for (i=0;i<n;i++) {
+ dst[i] = (GLubyte) rgba[i][GCOMP];
+ }
+ break;
+ case GL_BLUE_INTEGER_EXT:
+ for (i=0;i<n;i++) {
+ dst[i] = (GLubyte) rgba[i][BCOMP];
+ }
+ break;
+ case GL_ALPHA_INTEGER_EXT:
+ for (i=0;i<n;i++) {
+ dst[i] = (GLubyte) rgba[i][ACOMP];
+ }
+ break;
+ case GL_RGB_INTEGER_EXT:
+ for (i=0;i<n;i++) {
+ dst[i*3+0] = (GLubyte) rgba[i][RCOMP];
+ dst[i*3+1] = (GLubyte) rgba[i][GCOMP];
+ dst[i*3+2] = (GLubyte) rgba[i][BCOMP];
+ }
+ break;
+ case GL_RGBA_INTEGER_EXT:
+ for (i=0;i<n;i++) {
+ dst[i*4+0] = (GLubyte) rgba[i][RCOMP];
+ dst[i*4+1] = (GLubyte) rgba[i][GCOMP];
+ dst[i*4+2] = (GLubyte) rgba[i][BCOMP];
+ dst[i*4+3] = (GLubyte) rgba[i][ACOMP];
+ }
+ break;
+ case GL_BGR_INTEGER_EXT:
+ for (i=0;i<n;i++) {
+ dst[i*3+0] = (GLubyte) rgba[i][BCOMP];
+ dst[i*3+1] = (GLubyte) rgba[i][GCOMP];
+ dst[i*3+2] = (GLubyte) rgba[i][RCOMP];
+ }
+ break;
+ case GL_BGRA_INTEGER_EXT:
+ for (i=0;i<n;i++) {
+ dst[i*4+0] = (GLubyte) rgba[i][BCOMP];
+ dst[i*4+1] = (GLubyte) rgba[i][GCOMP];
+ dst[i*4+2] = (GLubyte) rgba[i][RCOMP];
+ dst[i*4+3] = (GLubyte) rgba[i][ACOMP];
+ }
+ break;
+ case GL_LUMINANCE_INTEGER_EXT:
+ for (i=0;i<n;i++) {
+ dst[i*2+0] = (GLubyte) (rgba[i][RCOMP] +
+ rgba[i][GCOMP] +
+ rgba[i][BCOMP]);
+ dst[i*2+1] = (GLubyte) rgba[i][ACOMP];
+ }
+ break;
+ case GL_LUMINANCE_ALPHA_INTEGER_EXT:
+ for (i=0;i<n;i++) {
+ dst[i] = (GLubyte) (rgba[i][RCOMP] +
+ rgba[i][GCOMP] +
+ rgba[i][BCOMP]);
+ }
+ break;
+ case GL_DUDV_ATI:
+ case GL_DU8DV8_ATI:
+ for (i=0;i<n;i++) {
+ dst[i*2+0] = FLOAT_TO_UBYTE(rgba[i][RCOMP]);
+ dst[i*2+1] = FLOAT_TO_UBYTE(rgba[i][GCOMP]);
+ }
+ break;
+ default:
+ _mesa_problem(ctx, "bad format in _mesa_pack_rgba_span\n");
+ }
+ }
+ break;
+ case GL_BYTE:
+ {
+ GLbyte *dst = (GLbyte *) dstAddr;
+ switch (dstFormat) {
+ case GL_RED:
+ for (i=0;i<n;i++)
+ dst[i] = FLOAT_TO_BYTE(rgba[i][RCOMP]);
+ break;
+ case GL_GREEN:
+ for (i=0;i<n;i++)
+ dst[i] = FLOAT_TO_BYTE(rgba[i][GCOMP]);
+ break;
+ case GL_BLUE:
+ for (i=0;i<n;i++)
+ dst[i] = FLOAT_TO_BYTE(rgba[i][BCOMP]);
+ break;
+ case GL_ALPHA:
+ for (i=0;i<n;i++)
+ dst[i] = FLOAT_TO_BYTE(rgba[i][ACOMP]);
+ break;
+ case GL_LUMINANCE:
+ for (i=0;i<n;i++)
+ dst[i] = FLOAT_TO_BYTE(luminance[i]);
+ break;
+ case GL_LUMINANCE_ALPHA:
+ for (i=0;i<n;i++) {
+ dst[i*2+0] = FLOAT_TO_BYTE(luminance[i]);
+ dst[i*2+1] = FLOAT_TO_BYTE(rgba[i][ACOMP]);
+ }
+ break;
+ case GL_RG:
+ for (i=0;i<n;i++) {
+ dst[i*2+0] = FLOAT_TO_BYTE(rgba[i][RCOMP]);
+ dst[i*2+1] = FLOAT_TO_BYTE(rgba[i][GCOMP]);
+ }
+ break;
+ case GL_RGB:
+ for (i=0;i<n;i++) {
+ dst[i*3+0] = FLOAT_TO_BYTE(rgba[i][RCOMP]);
+ dst[i*3+1] = FLOAT_TO_BYTE(rgba[i][GCOMP]);
+ dst[i*3+2] = FLOAT_TO_BYTE(rgba[i][BCOMP]);
+ }
+ break;
+ case GL_RGBA:
+ for (i=0;i<n;i++) {
+ dst[i*4+0] = FLOAT_TO_BYTE(rgba[i][RCOMP]);
+ dst[i*4+1] = FLOAT_TO_BYTE(rgba[i][GCOMP]);
+ dst[i*4+2] = FLOAT_TO_BYTE(rgba[i][BCOMP]);
+ dst[i*4+3] = FLOAT_TO_BYTE(rgba[i][ACOMP]);
+ }
+ break;
+ case GL_BGR:
+ for (i=0;i<n;i++) {
+ dst[i*3+0] = FLOAT_TO_BYTE(rgba[i][BCOMP]);
+ dst[i*3+1] = FLOAT_TO_BYTE(rgba[i][GCOMP]);
+ dst[i*3+2] = FLOAT_TO_BYTE(rgba[i][RCOMP]);
+ }
+ break;
+ case GL_BGRA:
+ for (i=0;i<n;i++) {
+ dst[i*4+0] = FLOAT_TO_BYTE(rgba[i][BCOMP]);
+ dst[i*4+1] = FLOAT_TO_BYTE(rgba[i][GCOMP]);
+ dst[i*4+2] = FLOAT_TO_BYTE(rgba[i][RCOMP]);
+ dst[i*4+3] = FLOAT_TO_BYTE(rgba[i][ACOMP]);
+ }
+ break;
+ case GL_ABGR_EXT:
+ for (i=0;i<n;i++) {
+ dst[i*4+0] = FLOAT_TO_BYTE(rgba[i][ACOMP]);
+ dst[i*4+1] = FLOAT_TO_BYTE(rgba[i][BCOMP]);
+ dst[i*4+2] = FLOAT_TO_BYTE(rgba[i][GCOMP]);
+ dst[i*4+3] = FLOAT_TO_BYTE(rgba[i][RCOMP]);
+ }
+ break;
+ case GL_RED_INTEGER_EXT:
+ for (i=0;i<n;i++) {
+ dst[i] = (GLbyte) rgba[i][RCOMP];
+ }
+ break;
+ case GL_GREEN_INTEGER_EXT:
+ for (i=0;i<n;i++) {
+ dst[i] = (GLbyte) rgba[i][GCOMP];
+ }
+ break;
+ case GL_BLUE_INTEGER_EXT:
+ for (i=0;i<n;i++) {
+ dst[i] = (GLbyte) rgba[i][BCOMP];
+ }
+ break;
+ case GL_ALPHA_INTEGER_EXT:
+ for (i=0;i<n;i++) {
+ dst[i] = (GLbyte) rgba[i][ACOMP];
+ }
+ break;
+ case GL_RGB_INTEGER_EXT:
+ for (i=0;i<n;i++) {
+ dst[i*3+0] = (GLbyte) rgba[i][RCOMP];
+ dst[i*3+1] = (GLbyte) rgba[i][GCOMP];
+ dst[i*3+2] = (GLbyte) rgba[i][BCOMP];
+ }
+ break;
+ case GL_RGBA_INTEGER_EXT:
+ for (i=0;i<n;i++) {
+ dst[i*4+0] = (GLbyte) rgba[i][RCOMP];
+ dst[i*4+1] = (GLbyte) rgba[i][GCOMP];
+ dst[i*4+2] = (GLbyte) rgba[i][BCOMP];
+ dst[i*4+3] = (GLbyte) rgba[i][ACOMP];
+ }
+ break;
+ case GL_BGR_INTEGER_EXT:
+ for (i=0;i<n;i++) {
+ dst[i*3+0] = (GLbyte) rgba[i][BCOMP];
+ dst[i*3+1] = (GLbyte) rgba[i][GCOMP];
+ dst[i*3+2] = (GLbyte) rgba[i][RCOMP];
+ }
+ break;
+ case GL_BGRA_INTEGER_EXT:
+ for (i=0;i<n;i++) {
+ dst[i*4+0] = (GLbyte) rgba[i][BCOMP];
+ dst[i*4+1] = (GLbyte) rgba[i][GCOMP];
+ dst[i*4+2] = (GLbyte) rgba[i][RCOMP];
+ dst[i*4+3] = (GLbyte) rgba[i][ACOMP];
+ }
+ break;
+ case GL_LUMINANCE_INTEGER_EXT:
+ for (i=0;i<n;i++) {
+ dst[i*2+0] = (GLbyte) (rgba[i][RCOMP] +
+ rgba[i][GCOMP] +
+ rgba[i][BCOMP]);
+ dst[i*2+1] = (GLbyte) rgba[i][ACOMP];
+ }
+ break;
+ case GL_LUMINANCE_ALPHA_INTEGER_EXT:
+ for (i=0;i<n;i++) {
+ dst[i] = (GLbyte) (rgba[i][RCOMP] +
+ rgba[i][GCOMP] +
+ rgba[i][BCOMP]);
+ }
+ break;
+ case GL_DUDV_ATI:
+ case GL_DU8DV8_ATI:
+ for (i=0;i<n;i++) {
+ dst[i*2+0] = FLOAT_TO_BYTE(rgba[i][RCOMP]);
+ dst[i*2+1] = FLOAT_TO_BYTE(rgba[i][GCOMP]);
+ }
+ break;
+ default:
+ _mesa_problem(ctx, "bad format in _mesa_pack_rgba_span\n");
+ }
+ }
+ break;
+ case GL_UNSIGNED_SHORT:
+ {
+ GLushort *dst = (GLushort *) dstAddr;
+ switch (dstFormat) {
+ case GL_RED:
+ for (i=0;i<n;i++)
+ CLAMPED_FLOAT_TO_USHORT(dst[i], rgba[i][RCOMP]);
+ break;
+ case GL_GREEN:
+ for (i=0;i<n;i++)
+ CLAMPED_FLOAT_TO_USHORT(dst[i], rgba[i][GCOMP]);
+ break;
+ case GL_BLUE:
+ for (i=0;i<n;i++)
+ CLAMPED_FLOAT_TO_USHORT(dst[i], rgba[i][BCOMP]);
+ break;
+ case GL_ALPHA:
+ for (i=0;i<n;i++)
+ CLAMPED_FLOAT_TO_USHORT(dst[i], rgba[i][ACOMP]);
+ break;
+ case GL_LUMINANCE:
+ for (i=0;i<n;i++)
+ UNCLAMPED_FLOAT_TO_USHORT(dst[i], luminance[i]);
+ break;
+ case GL_LUMINANCE_ALPHA:
+ for (i=0;i<n;i++) {
+ UNCLAMPED_FLOAT_TO_USHORT(dst[i*2+0], luminance[i]);
+ CLAMPED_FLOAT_TO_USHORT(dst[i*2+1], rgba[i][ACOMP]);
+ }
+ break;
+ case GL_RG:
+ for (i=0;i<n;i++) {
+ CLAMPED_FLOAT_TO_USHORT(dst[i*2+0], rgba[i][RCOMP]);
+ CLAMPED_FLOAT_TO_USHORT(dst[i*2+1], rgba[i][GCOMP]);
+ }
+ break;
+ case GL_RGB:
+ for (i=0;i<n;i++) {
+ CLAMPED_FLOAT_TO_USHORT(dst[i*3+0], rgba[i][RCOMP]);
+ CLAMPED_FLOAT_TO_USHORT(dst[i*3+1], rgba[i][GCOMP]);
+ CLAMPED_FLOAT_TO_USHORT(dst[i*3+2], rgba[i][BCOMP]);
+ }
+ break;
+ case GL_RGBA:
+ for (i=0;i<n;i++) {
+ CLAMPED_FLOAT_TO_USHORT(dst[i*4+0], rgba[i][RCOMP]);
+ CLAMPED_FLOAT_TO_USHORT(dst[i*4+1], rgba[i][GCOMP]);
+ CLAMPED_FLOAT_TO_USHORT(dst[i*4+2], rgba[i][BCOMP]);
+ CLAMPED_FLOAT_TO_USHORT(dst[i*4+3], rgba[i][ACOMP]);
+ }
+ break;
+ case GL_BGR:
+ for (i=0;i<n;i++) {
+ CLAMPED_FLOAT_TO_USHORT(dst[i*3+0], rgba[i][BCOMP]);
+ CLAMPED_FLOAT_TO_USHORT(dst[i*3+1], rgba[i][GCOMP]);
+ CLAMPED_FLOAT_TO_USHORT(dst[i*3+2], rgba[i][RCOMP]);
+ }
+ break;
+ case GL_BGRA:
+ for (i=0;i<n;i++) {
+ CLAMPED_FLOAT_TO_USHORT(dst[i*4+0], rgba[i][BCOMP]);
+ CLAMPED_FLOAT_TO_USHORT(dst[i*4+1], rgba[i][GCOMP]);
+ CLAMPED_FLOAT_TO_USHORT(dst[i*4+2], rgba[i][RCOMP]);
+ CLAMPED_FLOAT_TO_USHORT(dst[i*4+3], rgba[i][ACOMP]);
+ }
+ break;
+ case GL_ABGR_EXT:
+ for (i=0;i<n;i++) {
+ CLAMPED_FLOAT_TO_USHORT(dst[i*4+0], rgba[i][ACOMP]);
+ CLAMPED_FLOAT_TO_USHORT(dst[i*4+1], rgba[i][BCOMP]);
+ CLAMPED_FLOAT_TO_USHORT(dst[i*4+2], rgba[i][GCOMP]);
+ CLAMPED_FLOAT_TO_USHORT(dst[i*4+3], rgba[i][RCOMP]);
+ }
+ break;
+ case GL_RED_INTEGER_EXT:
+ for (i=0;i<n;i++) {
+ dst[i] = (GLushort) rgba[i][RCOMP];
+ }
+ break;
+ case GL_GREEN_INTEGER_EXT:
+ for (i=0;i<n;i++) {
+ dst[i] = (GLushort) rgba[i][GCOMP];
+ }
+ break;
+ case GL_BLUE_INTEGER_EXT:
+ for (i=0;i<n;i++) {
+ dst[i] = (GLushort) rgba[i][BCOMP];
+ }
+ break;
+ case GL_ALPHA_INTEGER_EXT:
+ for (i=0;i<n;i++) {
+ dst[i] = (GLushort) rgba[i][ACOMP];
+ }
+ break;
+ case GL_RGB_INTEGER_EXT:
+ for (i=0;i<n;i++) {
+ dst[i*3+0] = (GLushort) rgba[i][RCOMP];
+ dst[i*3+1] = (GLushort) rgba[i][GCOMP];
+ dst[i*3+2] = (GLushort) rgba[i][BCOMP];
+ }
+ break;
+ case GL_RGBA_INTEGER_EXT:
+ for (i=0;i<n;i++) {
+ dst[i*4+0] = (GLushort) rgba[i][RCOMP];
+ dst[i*4+1] = (GLushort) rgba[i][GCOMP];
+ dst[i*4+2] = (GLushort) rgba[i][BCOMP];
+ dst[i*4+3] = (GLushort) rgba[i][ACOMP];
+ }
+ break;
+ case GL_BGR_INTEGER_EXT:
+ for (i=0;i<n;i++) {
+ dst[i*3+0] = (GLushort) rgba[i][BCOMP];
+ dst[i*3+1] = (GLushort) rgba[i][GCOMP];
+ dst[i*3+2] = (GLushort) rgba[i][RCOMP];
+ }
+ break;
+ case GL_BGRA_INTEGER_EXT:
+ for (i=0;i<n;i++) {
+ dst[i*4+0] = (GLushort) rgba[i][BCOMP];
+ dst[i*4+1] = (GLushort) rgba[i][GCOMP];
+ dst[i*4+2] = (GLushort) rgba[i][RCOMP];
+ dst[i*4+3] = (GLushort) rgba[i][ACOMP];
+ }
+ break;
+ case GL_LUMINANCE_INTEGER_EXT:
+ for (i=0;i<n;i++) {
+ dst[i*2+0] = (GLushort) (rgba[i][RCOMP] +
+ rgba[i][GCOMP] +
+ rgba[i][BCOMP]);
+ dst[i*2+1] = (GLushort) rgba[i][ACOMP];
+ }
+ break;
+ case GL_LUMINANCE_ALPHA_INTEGER_EXT:
+ for (i=0;i<n;i++) {
+ dst[i] = (GLushort) (rgba[i][RCOMP] +
+ rgba[i][GCOMP] +
+ rgba[i][BCOMP]);
+ }
+ break;
+ case GL_DUDV_ATI:
+ case GL_DU8DV8_ATI:
+ for (i=0;i<n;i++) {
+ dst[i*2+0] = FLOAT_TO_USHORT(rgba[i][RCOMP]);
+ dst[i*2+1] = FLOAT_TO_USHORT(rgba[i][GCOMP]);
+ }
+ break;
+ default:
+ _mesa_problem(ctx, "bad format in _mesa_pack_rgba_span\n");
+ }
+ }
+ break;
+ case GL_SHORT:
+ {
+ GLshort *dst = (GLshort *) dstAddr;
+ switch (dstFormat) {
+ case GL_RED:
+ for (i=0;i<n;i++)
+ dst[i] = FLOAT_TO_SHORT(rgba[i][RCOMP]);
+ break;
+ case GL_GREEN:
+ for (i=0;i<n;i++)
+ dst[i] = FLOAT_TO_SHORT(rgba[i][GCOMP]);
+ break;
+ case GL_BLUE:
+ for (i=0;i<n;i++)
+ dst[i] = FLOAT_TO_SHORT(rgba[i][BCOMP]);
+ break;
+ case GL_ALPHA:
+ for (i=0;i<n;i++)
+ dst[i] = FLOAT_TO_SHORT(rgba[i][ACOMP]);
+ break;
+ case GL_LUMINANCE:
+ for (i=0;i<n;i++)
+ dst[i] = FLOAT_TO_SHORT(luminance[i]);
+ break;
+ case GL_LUMINANCE_ALPHA:
+ for (i=0;i<n;i++) {
+ dst[i*2+0] = FLOAT_TO_SHORT(luminance[i]);
+ dst[i*2+1] = FLOAT_TO_SHORT(rgba[i][ACOMP]);
+ }
+ break;
+ case GL_RG:
+ for (i=0;i<n;i++) {
+ dst[i*2+0] = FLOAT_TO_SHORT(rgba[i][RCOMP]);
+ dst[i*2+1] = FLOAT_TO_SHORT(rgba[i][GCOMP]);
+ }
+ break;
+ case GL_RGB:
+ for (i=0;i<n;i++) {
+ dst[i*3+0] = FLOAT_TO_SHORT(rgba[i][RCOMP]);
+ dst[i*3+1] = FLOAT_TO_SHORT(rgba[i][GCOMP]);
+ dst[i*3+2] = FLOAT_TO_SHORT(rgba[i][BCOMP]);
+ }
+ break;
+ case GL_RGBA:
+ for (i=0;i<n;i++) {
+ dst[i*4+0] = FLOAT_TO_SHORT(rgba[i][RCOMP]);
+ dst[i*4+1] = FLOAT_TO_SHORT(rgba[i][GCOMP]);
+ dst[i*4+2] = FLOAT_TO_SHORT(rgba[i][BCOMP]);
+ dst[i*4+3] = FLOAT_TO_SHORT(rgba[i][ACOMP]);
+ }
+ break;
+ case GL_BGR:
+ for (i=0;i<n;i++) {
+ dst[i*3+0] = FLOAT_TO_SHORT(rgba[i][BCOMP]);
+ dst[i*3+1] = FLOAT_TO_SHORT(rgba[i][GCOMP]);
+ dst[i*3+2] = FLOAT_TO_SHORT(rgba[i][RCOMP]);
+ }
+ break;
+ case GL_BGRA:
+ for (i=0;i<n;i++) {
+ dst[i*4+0] = FLOAT_TO_SHORT(rgba[i][BCOMP]);
+ dst[i*4+1] = FLOAT_TO_SHORT(rgba[i][GCOMP]);
+ dst[i*4+2] = FLOAT_TO_SHORT(rgba[i][RCOMP]);
+ dst[i*4+3] = FLOAT_TO_SHORT(rgba[i][ACOMP]);
+ }
+ break;
+ case GL_ABGR_EXT:
+ for (i=0;i<n;i++) {
+ dst[i*4+0] = FLOAT_TO_SHORT(rgba[i][ACOMP]);
+ dst[i*4+1] = FLOAT_TO_SHORT(rgba[i][BCOMP]);
+ dst[i*4+2] = FLOAT_TO_SHORT(rgba[i][GCOMP]);
+ dst[i*4+3] = FLOAT_TO_SHORT(rgba[i][RCOMP]);
+ }
+ break;
+ case GL_RED_INTEGER_EXT:
+ for (i=0;i<n;i++) {
+ dst[i] = (GLshort) rgba[i][RCOMP];
+ }
+ break;
+ case GL_GREEN_INTEGER_EXT:
+ for (i=0;i<n;i++) {
+ dst[i] = (GLshort) rgba[i][GCOMP];
+ }
+ break;
+ case GL_BLUE_INTEGER_EXT:
+ for (i=0;i<n;i++) {
+ dst[i] = (GLshort) rgba[i][BCOMP];
+ }
+ break;
+ case GL_ALPHA_INTEGER_EXT:
+ for (i=0;i<n;i++) {
+ dst[i] = (GLshort) rgba[i][ACOMP];
+ }
+ break;
+ case GL_RGB_INTEGER_EXT:
+ for (i=0;i<n;i++) {
+ dst[i*3+0] = (GLshort) rgba[i][RCOMP];
+ dst[i*3+1] = (GLshort) rgba[i][GCOMP];
+ dst[i*3+2] = (GLshort) rgba[i][BCOMP];
+ }
+ break;
+ case GL_RGBA_INTEGER_EXT:
+ for (i=0;i<n;i++) {
+ dst[i*4+0] = (GLshort) rgba[i][RCOMP];
+ dst[i*4+1] = (GLshort) rgba[i][GCOMP];
+ dst[i*4+2] = (GLshort) rgba[i][BCOMP];
+ dst[i*4+3] = (GLshort) rgba[i][ACOMP];
+ }
+ break;
+ case GL_BGR_INTEGER_EXT:
+ for (i=0;i<n;i++) {
+ dst[i*3+0] = (GLshort) rgba[i][BCOMP];
+ dst[i*3+1] = (GLshort) rgba[i][GCOMP];
+ dst[i*3+2] = (GLshort) rgba[i][RCOMP];
+ }
+ break;
+ case GL_BGRA_INTEGER_EXT:
+ for (i=0;i<n;i++) {
+ dst[i*4+0] = (GLshort) rgba[i][BCOMP];
+ dst[i*4+1] = (GLshort) rgba[i][GCOMP];
+ dst[i*4+2] = (GLshort) rgba[i][RCOMP];
+ dst[i*4+3] = (GLshort) rgba[i][ACOMP];
+ }
+ break;
+ case GL_LUMINANCE_INTEGER_EXT:
+ for (i=0;i<n;i++) {
+ dst[i*2+0] = (GLshort) (rgba[i][RCOMP] +
+ rgba[i][GCOMP] +
+ rgba[i][BCOMP]);
+ dst[i*2+1] = (GLshort) rgba[i][ACOMP];
+ }
+ break;
+ case GL_LUMINANCE_ALPHA_INTEGER_EXT:
+ for (i=0;i<n;i++) {
+ dst[i] = (GLshort) (rgba[i][RCOMP] +
+ rgba[i][GCOMP] +
+ rgba[i][BCOMP]);
+ }
+ break;
+ case GL_DUDV_ATI:
+ case GL_DU8DV8_ATI:
+ for (i=0;i<n;i++) {
+ dst[i*2+0] = FLOAT_TO_SHORT(rgba[i][RCOMP]);
+ dst[i*2+1] = FLOAT_TO_SHORT(rgba[i][GCOMP]);
+ }
+ break;
+ default:
+ _mesa_problem(ctx, "bad format in _mesa_pack_rgba_span\n");
+ }
+ }
+ break;
+ case GL_UNSIGNED_INT:
+ {
+ GLuint *dst = (GLuint *) dstAddr;
+ switch (dstFormat) {
+ case GL_RED:
+ for (i=0;i<n;i++)
+ dst[i] = FLOAT_TO_UINT(rgba[i][RCOMP]);
+ break;
+ case GL_GREEN:
+ for (i=0;i<n;i++)
+ dst[i] = FLOAT_TO_UINT(rgba[i][GCOMP]);
+ break;
+ case GL_BLUE:
+ for (i=0;i<n;i++)
+ dst[i] = FLOAT_TO_UINT(rgba[i][BCOMP]);
+ break;
+ case GL_ALPHA:
+ for (i=0;i<n;i++)
+ dst[i] = FLOAT_TO_UINT(rgba[i][ACOMP]);
+ break;
+ case GL_LUMINANCE:
+ for (i=0;i<n;i++)
+ dst[i] = FLOAT_TO_UINT(luminance[i]);
+ break;
+ case GL_LUMINANCE_ALPHA:
+ for (i=0;i<n;i++) {
+ dst[i*2+0] = FLOAT_TO_UINT(luminance[i]);
+ dst[i*2+1] = FLOAT_TO_UINT(rgba[i][ACOMP]);
+ }
+ break;
+ case GL_RG:
+ for (i=0;i<n;i++) {
+ dst[i*2+0] = FLOAT_TO_UINT(rgba[i][RCOMP]);
+ dst[i*2+1] = FLOAT_TO_UINT(rgba[i][GCOMP]);
+ }
+ break;
+ case GL_RGB:
+ for (i=0;i<n;i++) {
+ dst[i*3+0] = FLOAT_TO_UINT(rgba[i][RCOMP]);
+ dst[i*3+1] = FLOAT_TO_UINT(rgba[i][GCOMP]);
+ dst[i*3+2] = FLOAT_TO_UINT(rgba[i][BCOMP]);
+ }
+ break;
+ case GL_RGBA:
+ for (i=0;i<n;i++) {
+ dst[i*4+0] = FLOAT_TO_UINT(rgba[i][RCOMP]);
+ dst[i*4+1] = FLOAT_TO_UINT(rgba[i][GCOMP]);
+ dst[i*4+2] = FLOAT_TO_UINT(rgba[i][BCOMP]);
+ dst[i*4+3] = FLOAT_TO_UINT(rgba[i][ACOMP]);
+ }
+ break;
+ case GL_BGR:
+ for (i=0;i<n;i++) {
+ dst[i*3+0] = FLOAT_TO_UINT(rgba[i][BCOMP]);
+ dst[i*3+1] = FLOAT_TO_UINT(rgba[i][GCOMP]);
+ dst[i*3+2] = FLOAT_TO_UINT(rgba[i][RCOMP]);
+ }
+ break;
+ case GL_BGRA:
+ for (i=0;i<n;i++) {
+ dst[i*4+0] = FLOAT_TO_UINT(rgba[i][BCOMP]);
+ dst[i*4+1] = FLOAT_TO_UINT(rgba[i][GCOMP]);
+ dst[i*4+2] = FLOAT_TO_UINT(rgba[i][RCOMP]);
+ dst[i*4+3] = FLOAT_TO_UINT(rgba[i][ACOMP]);
+ }
+ break;
+ case GL_ABGR_EXT:
+ for (i=0;i<n;i++) {
+ dst[i*4+0] = FLOAT_TO_UINT(rgba[i][ACOMP]);
+ dst[i*4+1] = FLOAT_TO_UINT(rgba[i][BCOMP]);
+ dst[i*4+2] = FLOAT_TO_UINT(rgba[i][GCOMP]);
+ dst[i*4+3] = FLOAT_TO_UINT(rgba[i][RCOMP]);
+ }
+ break;
+ case GL_RED_INTEGER_EXT:
+ for (i=0;i<n;i++) {
+ dst[i] = (GLuint) rgba[i][RCOMP];
+ }
+ break;
+ case GL_GREEN_INTEGER_EXT:
+ for (i=0;i<n;i++) {
+ dst[i] = (GLuint) rgba[i][GCOMP];
+ }
+ break;
+ case GL_BLUE_INTEGER_EXT:
+ for (i=0;i<n;i++) {
+ dst[i] = (GLuint) rgba[i][BCOMP];
+ }
+ break;
+ case GL_ALPHA_INTEGER_EXT:
+ for (i=0;i<n;i++) {
+ dst[i] = (GLuint) rgba[i][ACOMP];
+ }
+ break;
+ case GL_RGB_INTEGER_EXT:
+ for (i=0;i<n;i++) {
+ dst[i*3+0] = (GLuint) rgba[i][RCOMP];
+ dst[i*3+1] = (GLuint) rgba[i][GCOMP];
+ dst[i*3+2] = (GLuint) rgba[i][BCOMP];
+ }
+ break;
+ case GL_RGBA_INTEGER_EXT:
+ for (i=0;i<n;i++) {
+ dst[i*4+0] = (GLuint) rgba[i][RCOMP];
+ dst[i*4+1] = (GLuint) rgba[i][GCOMP];
+ dst[i*4+2] = (GLuint) rgba[i][BCOMP];
+ dst[i*4+3] = (GLuint) rgba[i][ACOMP];
+ }
+ break;
+ case GL_BGR_INTEGER_EXT:
+ for (i=0;i<n;i++) {
+ dst[i*3+0] = (GLuint) rgba[i][BCOMP];
+ dst[i*3+1] = (GLuint) rgba[i][GCOMP];
+ dst[i*3+2] = (GLuint) rgba[i][RCOMP];
+ }
+ break;
+ case GL_BGRA_INTEGER_EXT:
+ for (i=0;i<n;i++) {
+ dst[i*4+0] = (GLuint) rgba[i][BCOMP];
+ dst[i*4+1] = (GLuint) rgba[i][GCOMP];
+ dst[i*4+2] = (GLuint) rgba[i][RCOMP];
+ dst[i*4+3] = (GLuint) rgba[i][ACOMP];
+ }
+ break;
+ case GL_LUMINANCE_INTEGER_EXT:
+ for (i=0;i<n;i++) {
+ dst[i*2+0] = (GLuint) (rgba[i][RCOMP] +
+ rgba[i][GCOMP] +
+ rgba[i][BCOMP]);
+ dst[i*2+1] = (GLuint) rgba[i][ACOMP];
+ }
+ break;
+ case GL_LUMINANCE_ALPHA_INTEGER_EXT:
+ for (i=0;i<n;i++) {
+ dst[i] = (GLuint) (rgba[i][RCOMP] +
+ rgba[i][GCOMP] +
+ rgba[i][BCOMP]);
+ }
+ break;
+ case GL_DUDV_ATI:
+ case GL_DU8DV8_ATI:
+ for (i=0;i<n;i++) {
+ dst[i*2+0] = FLOAT_TO_UINT(rgba[i][RCOMP]);
+ dst[i*2+1] = FLOAT_TO_UINT(rgba[i][GCOMP]);
+ }
+ break;
+ default:
+ _mesa_problem(ctx, "bad format in _mesa_pack_rgba_span\n");
+ }
+ }
+ break;
+ case GL_INT:
+ {
+ GLint *dst = (GLint *) dstAddr;
+ switch (dstFormat) {
+ case GL_RED:
+ for (i=0;i<n;i++)
+ dst[i] = FLOAT_TO_INT(rgba[i][RCOMP]);
+ break;
+ case GL_GREEN:
+ for (i=0;i<n;i++)
+ dst[i] = FLOAT_TO_INT(rgba[i][GCOMP]);
+ break;
+ case GL_BLUE:
+ for (i=0;i<n;i++)
+ dst[i] = FLOAT_TO_INT(rgba[i][BCOMP]);
+ break;
+ case GL_ALPHA:
+ for (i=0;i<n;i++)
+ dst[i] = FLOAT_TO_INT(rgba[i][ACOMP]);
+ break;
+ case GL_LUMINANCE:
+ for (i=0;i<n;i++)
+ dst[i] = FLOAT_TO_INT(luminance[i]);
+ break;
+ case GL_LUMINANCE_ALPHA:
+ for (i=0;i<n;i++) {
+ dst[i*2+0] = FLOAT_TO_INT(luminance[i]);
+ dst[i*2+1] = FLOAT_TO_INT(rgba[i][ACOMP]);
+ }
+ break;
+ case GL_RG:
+ for (i=0;i<n;i++) {
+ dst[i*2+0] = FLOAT_TO_INT(rgba[i][RCOMP]);
+ dst[i*2+1] = FLOAT_TO_INT(rgba[i][GCOMP]);
+ }
+ break;
+ case GL_RGB:
+ for (i=0;i<n;i++) {
+ dst[i*3+0] = FLOAT_TO_INT(rgba[i][RCOMP]);
+ dst[i*3+1] = FLOAT_TO_INT(rgba[i][GCOMP]);
+ dst[i*3+2] = FLOAT_TO_INT(rgba[i][BCOMP]);
+ }
+ break;
+ case GL_RGBA:
+ for (i=0;i<n;i++) {
+ dst[i*4+0] = FLOAT_TO_INT(rgba[i][RCOMP]);
+ dst[i*4+1] = FLOAT_TO_INT(rgba[i][GCOMP]);
+ dst[i*4+2] = FLOAT_TO_INT(rgba[i][BCOMP]);
+ dst[i*4+3] = FLOAT_TO_INT(rgba[i][ACOMP]);
+ }
+ break;
+ case GL_BGR:
+ for (i=0;i<n;i++) {
+ dst[i*3+0] = FLOAT_TO_INT(rgba[i][BCOMP]);
+ dst[i*3+1] = FLOAT_TO_INT(rgba[i][GCOMP]);
+ dst[i*3+2] = FLOAT_TO_INT(rgba[i][RCOMP]);
+ }
+ break;
+ case GL_BGRA:
+ for (i=0;i<n;i++) {
+ dst[i*4+0] = FLOAT_TO_INT(rgba[i][BCOMP]);
+ dst[i*4+1] = FLOAT_TO_INT(rgba[i][GCOMP]);
+ dst[i*4+2] = FLOAT_TO_INT(rgba[i][RCOMP]);
+ dst[i*4+3] = FLOAT_TO_INT(rgba[i][ACOMP]);
+ }
+ break;
+ case GL_ABGR_EXT:
+ for (i=0;i<n;i++) {
+ dst[i*4+0] = FLOAT_TO_INT(rgba[i][ACOMP]);
+ dst[i*4+1] = FLOAT_TO_INT(rgba[i][BCOMP]);
+ dst[i*4+2] = FLOAT_TO_INT(rgba[i][GCOMP]);
+ dst[i*4+3] = FLOAT_TO_INT(rgba[i][RCOMP]);
+ }
+ break;
+ case GL_DUDV_ATI:
+ case GL_DU8DV8_ATI:
+ for (i=0;i<n;i++) {
+ dst[i*2+0] = FLOAT_TO_INT(rgba[i][RCOMP]);
+ dst[i*2+1] = FLOAT_TO_INT(rgba[i][GCOMP]);
+ }
+ break;
+ case GL_RED_INTEGER_EXT:
+ for (i=0;i<n;i++) {
+ dst[i] = (GLint) rgba[i][RCOMP];
+ }
+ break;
+ case GL_GREEN_INTEGER_EXT:
+ for (i=0;i<n;i++) {
+ dst[i] = (GLint) rgba[i][GCOMP];
+ }
+ break;
+ case GL_BLUE_INTEGER_EXT:
+ for (i=0;i<n;i++) {
+ dst[i] = (GLint) rgba[i][BCOMP];
+ }
+ break;
+ case GL_ALPHA_INTEGER_EXT:
+ for (i=0;i<n;i++) {
+ dst[i] = (GLint) rgba[i][ACOMP];
+ }
+ break;
+ case GL_RGB_INTEGER_EXT:
+ for (i=0;i<n;i++) {
+ dst[i*3+0] = (GLint) rgba[i][RCOMP];
+ dst[i*3+1] = (GLint) rgba[i][GCOMP];
+ dst[i*3+2] = (GLint) rgba[i][BCOMP];
+ }
+ break;
+ case GL_RGBA_INTEGER_EXT:
+ for (i=0;i<n;i++) {
+ dst[i*4+0] = (GLint) rgba[i][RCOMP];
+ dst[i*4+1] = (GLint) rgba[i][GCOMP];
+ dst[i*4+2] = (GLint) rgba[i][BCOMP];
+ dst[i*4+3] = (GLint) rgba[i][ACOMP];
+ }
+ break;
+ case GL_BGR_INTEGER_EXT:
+ for (i=0;i<n;i++) {
+ dst[i*3+0] = (GLint) rgba[i][BCOMP];
+ dst[i*3+1] = (GLint) rgba[i][GCOMP];
+ dst[i*3+2] = (GLint) rgba[i][RCOMP];
+ }
+ break;
+ case GL_BGRA_INTEGER_EXT:
+ for (i=0;i<n;i++) {
+ dst[i*4+0] = (GLint) rgba[i][BCOMP];
+ dst[i*4+1] = (GLint) rgba[i][GCOMP];
+ dst[i*4+2] = (GLint) rgba[i][RCOMP];
+ dst[i*4+3] = (GLint) rgba[i][ACOMP];
+ }
+ break;
+ case GL_LUMINANCE_INTEGER_EXT:
+ for (i=0;i<n;i++) {
+ dst[i*2+0] = (GLint) (rgba[i][RCOMP] +
+ rgba[i][GCOMP] +
+ rgba[i][BCOMP]);
+ dst[i*2+1] = (GLint) rgba[i][ACOMP];
+ }
+ break;
+ case GL_LUMINANCE_ALPHA_INTEGER_EXT:
+ for (i=0;i<n;i++) {
+ dst[i] = (GLint) (rgba[i][RCOMP] +
+ rgba[i][GCOMP] +
+ rgba[i][BCOMP]);
+ }
+ break;
+ default:
+ _mesa_problem(ctx, "bad format in _mesa_pack_rgba_span\n");
+ }
+ }
+ break;
+ case GL_FLOAT:
+ {
+ GLfloat *dst = (GLfloat *) dstAddr;
+ switch (dstFormat) {
+ case GL_RED:
+ for (i=0;i<n;i++)
+ dst[i] = rgba[i][RCOMP];
+ break;
+ case GL_GREEN:
+ for (i=0;i<n;i++)
+ dst[i] = rgba[i][GCOMP];
+ break;
+ case GL_BLUE:
+ for (i=0;i<n;i++)
+ dst[i] = rgba[i][BCOMP];
+ break;
+ case GL_ALPHA:
+ for (i=0;i<n;i++)
+ dst[i] = rgba[i][ACOMP];
+ break;
+ case GL_LUMINANCE:
+ for (i=0;i<n;i++)
+ dst[i] = luminance[i];
+ break;
+ case GL_LUMINANCE_ALPHA:
+ for (i=0;i<n;i++) {
+ dst[i*2+0] = luminance[i];
+ dst[i*2+1] = rgba[i][ACOMP];
+ }
+ break;
+ case GL_RG:
+ for (i=0;i<n;i++) {
+ dst[i*2+0] = rgba[i][RCOMP];
+ dst[i*2+1] = rgba[i][GCOMP];
+ }
+ break;
+ case GL_RGB:
+ for (i=0;i<n;i++) {
+ dst[i*3+0] = rgba[i][RCOMP];
+ dst[i*3+1] = rgba[i][GCOMP];
+ dst[i*3+2] = rgba[i][BCOMP];
+ }
+ break;
+ case GL_RGBA:
+ for (i=0;i<n;i++) {
+ dst[i*4+0] = rgba[i][RCOMP];
+ dst[i*4+1] = rgba[i][GCOMP];
+ dst[i*4+2] = rgba[i][BCOMP];
+ dst[i*4+3] = rgba[i][ACOMP];
+ }
+ break;
+ case GL_BGR:
+ for (i=0;i<n;i++) {
+ dst[i*3+0] = rgba[i][BCOMP];
+ dst[i*3+1] = rgba[i][GCOMP];
+ dst[i*3+2] = rgba[i][RCOMP];
+ }
+ break;
+ case GL_BGRA:
+ for (i=0;i<n;i++) {
+ dst[i*4+0] = rgba[i][BCOMP];
+ dst[i*4+1] = rgba[i][GCOMP];
+ dst[i*4+2] = rgba[i][RCOMP];
+ dst[i*4+3] = rgba[i][ACOMP];
+ }
+ break;
+ case GL_ABGR_EXT:
+ for (i=0;i<n;i++) {
+ dst[i*4+0] = rgba[i][ACOMP];
+ dst[i*4+1] = rgba[i][BCOMP];
+ dst[i*4+2] = rgba[i][GCOMP];
+ dst[i*4+3] = rgba[i][RCOMP];
+ }
+ break;
+ case GL_DUDV_ATI:
+ case GL_DU8DV8_ATI:
+ for (i=0;i<n;i++) {
+ dst[i*2+0] = rgba[i][RCOMP];
+ dst[i*2+1] = rgba[i][GCOMP];
+ }
+ break;
+ default:
+ _mesa_problem(ctx, "bad format in _mesa_pack_rgba_span\n");
+ }
+ }
+ break;
+ case GL_HALF_FLOAT_ARB:
+ {
+ GLhalfARB *dst = (GLhalfARB *) dstAddr;
+ switch (dstFormat) {
+ case GL_RED:
+ for (i=0;i<n;i++)
+ dst[i] = _mesa_float_to_half(rgba[i][RCOMP]);
+ break;
+ case GL_GREEN:
+ for (i=0;i<n;i++)
+ dst[i] = _mesa_float_to_half(rgba[i][GCOMP]);
+ break;
+ case GL_BLUE:
+ for (i=0;i<n;i++)
+ dst[i] = _mesa_float_to_half(rgba[i][BCOMP]);
+ break;
+ case GL_ALPHA:
+ for (i=0;i<n;i++)
+ dst[i] = _mesa_float_to_half(rgba[i][ACOMP]);
+ break;
+ case GL_LUMINANCE:
+ for (i=0;i<n;i++)
+ dst[i] = _mesa_float_to_half(luminance[i]);
+ break;
+ case GL_LUMINANCE_ALPHA:
+ for (i=0;i<n;i++) {
+ dst[i*2+0] = _mesa_float_to_half(luminance[i]);
+ dst[i*2+1] = _mesa_float_to_half(rgba[i][ACOMP]);
+ }
+ break;
+ case GL_RG:
+ for (i=0;i<n;i++) {
+ dst[i*2+0] = _mesa_float_to_half(rgba[i][RCOMP]);
+ dst[i*2+1] = _mesa_float_to_half(rgba[i][GCOMP]);
+ }
+ break;
+ case GL_RGB:
+ for (i=0;i<n;i++) {
+ dst[i*3+0] = _mesa_float_to_half(rgba[i][RCOMP]);
+ dst[i*3+1] = _mesa_float_to_half(rgba[i][GCOMP]);
+ dst[i*3+2] = _mesa_float_to_half(rgba[i][BCOMP]);
+ }
+ break;
+ case GL_RGBA:
+ for (i=0;i<n;i++) {
+ dst[i*4+0] = _mesa_float_to_half(rgba[i][RCOMP]);
+ dst[i*4+1] = _mesa_float_to_half(rgba[i][GCOMP]);
+ dst[i*4+2] = _mesa_float_to_half(rgba[i][BCOMP]);
+ dst[i*4+3] = _mesa_float_to_half(rgba[i][ACOMP]);
+ }
+ break;
+ case GL_BGR:
+ for (i=0;i<n;i++) {
+ dst[i*3+0] = _mesa_float_to_half(rgba[i][BCOMP]);
+ dst[i*3+1] = _mesa_float_to_half(rgba[i][GCOMP]);
+ dst[i*3+2] = _mesa_float_to_half(rgba[i][RCOMP]);
+ }
+ break;
+ case GL_BGRA:
+ for (i=0;i<n;i++) {
+ dst[i*4+0] = _mesa_float_to_half(rgba[i][BCOMP]);
+ dst[i*4+1] = _mesa_float_to_half(rgba[i][GCOMP]);
+ dst[i*4+2] = _mesa_float_to_half(rgba[i][RCOMP]);
+ dst[i*4+3] = _mesa_float_to_half(rgba[i][ACOMP]);
+ }
+ break;
+ case GL_ABGR_EXT:
+ for (i=0;i<n;i++) {
+ dst[i*4+0] = _mesa_float_to_half(rgba[i][ACOMP]);
+ dst[i*4+1] = _mesa_float_to_half(rgba[i][BCOMP]);
+ dst[i*4+2] = _mesa_float_to_half(rgba[i][GCOMP]);
+ dst[i*4+3] = _mesa_float_to_half(rgba[i][RCOMP]);
+ }
+ break;
+ case GL_DUDV_ATI:
+ case GL_DU8DV8_ATI:
+ for (i=0;i<n;i++) {
+ dst[i*2+0] = _mesa_float_to_half(rgba[i][RCOMP]);
+ dst[i*2+1] = _mesa_float_to_half(rgba[i][GCOMP]);
+ }
+ break;
+ default:
+ _mesa_problem(ctx, "bad format in _mesa_pack_rgba_span\n");
+ }
+ }
+ break;
+ case GL_UNSIGNED_BYTE_3_3_2:
+ if (dstFormat == GL_RGB) {
+ GLubyte *dst = (GLubyte *) dstAddr;
+ for (i=0;i<n;i++) {
+ dst[i] = (IROUND(rgba[i][RCOMP] * 7.0F) << 5)
+ | (IROUND(rgba[i][GCOMP] * 7.0F) << 2)
+ | (IROUND(rgba[i][BCOMP] * 3.0F) );
+ }
+ }
+ break;
+ case GL_UNSIGNED_BYTE_2_3_3_REV:
+ if (dstFormat == GL_RGB) {
+ GLubyte *dst = (GLubyte *) dstAddr;
+ for (i=0;i<n;i++) {
+ dst[i] = (IROUND(rgba[i][RCOMP] * 7.0F) )
+ | (IROUND(rgba[i][GCOMP] * 7.0F) << 3)
+ | (IROUND(rgba[i][BCOMP] * 3.0F) << 6);
+ }
+ }
+ break;
+ case GL_UNSIGNED_SHORT_5_6_5:
+ if (dstFormat == GL_RGB) {
+ GLushort *dst = (GLushort *) dstAddr;
+ for (i=0;i<n;i++) {
+ dst[i] = (IROUND(rgba[i][RCOMP] * 31.0F) << 11)
+ | (IROUND(rgba[i][GCOMP] * 63.0F) << 5)
+ | (IROUND(rgba[i][BCOMP] * 31.0F) );
+ }
+ }
+ break;
+ case GL_UNSIGNED_SHORT_5_6_5_REV:
+ if (dstFormat == GL_RGB) {
+ GLushort *dst = (GLushort *) dstAddr;
+ for (i=0;i<n;i++) {
+ dst[i] = (IROUND(rgba[i][RCOMP] * 31.0F) )
+ | (IROUND(rgba[i][GCOMP] * 63.0F) << 5)
+ | (IROUND(rgba[i][BCOMP] * 31.0F) << 11);
+ }
+ }
+ break;
+ case GL_UNSIGNED_SHORT_4_4_4_4:
+ if (dstFormat == GL_RGBA) {
+ GLushort *dst = (GLushort *) dstAddr;
+ for (i=0;i<n;i++) {
+ dst[i] = (IROUND(rgba[i][RCOMP] * 15.0F) << 12)
+ | (IROUND(rgba[i][GCOMP] * 15.0F) << 8)
+ | (IROUND(rgba[i][BCOMP] * 15.0F) << 4)
+ | (IROUND(rgba[i][ACOMP] * 15.0F) );
+ }
+ }
+ else if (dstFormat == GL_BGRA) {
+ GLushort *dst = (GLushort *) dstAddr;
+ for (i=0;i<n;i++) {
+ dst[i] = (IROUND(rgba[i][BCOMP] * 15.0F) << 12)
+ | (IROUND(rgba[i][GCOMP] * 15.0F) << 8)
+ | (IROUND(rgba[i][RCOMP] * 15.0F) << 4)
+ | (IROUND(rgba[i][ACOMP] * 15.0F) );
+ }
+ }
+ else if (dstFormat == GL_ABGR_EXT) {
+ GLushort *dst = (GLushort *) dstAddr;
+ for (i=0;i<n;i++) {
+ dst[i] = (IROUND(rgba[i][ACOMP] * 15.0F) << 12)
+ | (IROUND(rgba[i][BCOMP] * 15.0F) << 8)
+ | (IROUND(rgba[i][GCOMP] * 15.0F) << 4)
+ | (IROUND(rgba[i][RCOMP] * 15.0F) );
+ }
+ }
+ break;
+ case GL_UNSIGNED_SHORT_4_4_4_4_REV:
+ if (dstFormat == GL_RGBA) {
+ GLushort *dst = (GLushort *) dstAddr;
+ for (i=0;i<n;i++) {
+ dst[i] = (IROUND(rgba[i][RCOMP] * 15.0F) )
+ | (IROUND(rgba[i][GCOMP] * 15.0F) << 4)
+ | (IROUND(rgba[i][BCOMP] * 15.0F) << 8)
+ | (IROUND(rgba[i][ACOMP] * 15.0F) << 12);
+ }
+ }
+ else if (dstFormat == GL_BGRA) {
+ GLushort *dst = (GLushort *) dstAddr;
+ for (i=0;i<n;i++) {
+ dst[i] = (IROUND(rgba[i][BCOMP] * 15.0F) )
+ | (IROUND(rgba[i][GCOMP] * 15.0F) << 4)
+ | (IROUND(rgba[i][RCOMP] * 15.0F) << 8)
+ | (IROUND(rgba[i][ACOMP] * 15.0F) << 12);
+ }
+ }
+ else if (dstFormat == GL_ABGR_EXT) {
+ GLushort *dst = (GLushort *) dstAddr;
+ for (i=0;i<n;i++) {
+ dst[i] = (IROUND(rgba[i][ACOMP] * 15.0F) )
+ | (IROUND(rgba[i][BCOMP] * 15.0F) << 4)
+ | (IROUND(rgba[i][GCOMP] * 15.0F) << 8)
+ | (IROUND(rgba[i][RCOMP] * 15.0F) << 12);
+ }
+ }
+ break;
+ case GL_UNSIGNED_SHORT_5_5_5_1:
+ if (dstFormat == GL_RGBA) {
+ GLushort *dst = (GLushort *) dstAddr;
+ for (i=0;i<n;i++) {
+ dst[i] = (IROUND(rgba[i][RCOMP] * 31.0F) << 11)
+ | (IROUND(rgba[i][GCOMP] * 31.0F) << 6)
+ | (IROUND(rgba[i][BCOMP] * 31.0F) << 1)
+ | (IROUND(rgba[i][ACOMP] * 1.0F) );
+ }
+ }
+ else if (dstFormat == GL_BGRA) {
+ GLushort *dst = (GLushort *) dstAddr;
+ for (i=0;i<n;i++) {
+ dst[i] = (IROUND(rgba[i][BCOMP] * 31.0F) << 11)
+ | (IROUND(rgba[i][GCOMP] * 31.0F) << 6)
+ | (IROUND(rgba[i][RCOMP] * 31.0F) << 1)
+ | (IROUND(rgba[i][ACOMP] * 1.0F) );
+ }
+ }
+ else if (dstFormat == GL_ABGR_EXT) {
+ GLushort *dst = (GLushort *) dstAddr;
+ for (i=0;i<n;i++) {
+ dst[i] = (IROUND(rgba[i][ACOMP] * 31.0F) << 11)
+ | (IROUND(rgba[i][BCOMP] * 31.0F) << 6)
+ | (IROUND(rgba[i][GCOMP] * 31.0F) << 1)
+ | (IROUND(rgba[i][RCOMP] * 1.0F) );
+ }
+ }
+ break;
+ case GL_UNSIGNED_SHORT_1_5_5_5_REV:
+ if (dstFormat == GL_RGBA) {
+ GLushort *dst = (GLushort *) dstAddr;
+ for (i=0;i<n;i++) {
+ dst[i] = (IROUND(rgba[i][RCOMP] * 31.0F) )
+ | (IROUND(rgba[i][GCOMP] * 31.0F) << 5)
+ | (IROUND(rgba[i][BCOMP] * 31.0F) << 10)
+ | (IROUND(rgba[i][ACOMP] * 1.0F) << 15);
+ }
+ }
+ else if (dstFormat == GL_BGRA) {
+ GLushort *dst = (GLushort *) dstAddr;
+ for (i=0;i<n;i++) {
+ dst[i] = (IROUND(rgba[i][BCOMP] * 31.0F) )
+ | (IROUND(rgba[i][GCOMP] * 31.0F) << 5)
+ | (IROUND(rgba[i][RCOMP] * 31.0F) << 10)
+ | (IROUND(rgba[i][ACOMP] * 1.0F) << 15);
+ }
+ }
+ else if (dstFormat == GL_ABGR_EXT) {
+ GLushort *dst = (GLushort *) dstAddr;
+ for (i=0;i<n;i++) {
+ dst[i] = (IROUND(rgba[i][ACOMP] * 31.0F) )
+ | (IROUND(rgba[i][BCOMP] * 31.0F) << 5)
+ | (IROUND(rgba[i][GCOMP] * 31.0F) << 10)
+ | (IROUND(rgba[i][RCOMP] * 1.0F) << 15);
+ }
+ }
+ break;
+ case GL_UNSIGNED_INT_8_8_8_8:
+ if (dstFormat == GL_RGBA) {
+ GLuint *dst = (GLuint *) dstAddr;
+ for (i=0;i<n;i++) {
+ dst[i] = (IROUND(rgba[i][RCOMP] * 255.F) << 24)
+ | (IROUND(rgba[i][GCOMP] * 255.F) << 16)
+ | (IROUND(rgba[i][BCOMP] * 255.F) << 8)
+ | (IROUND(rgba[i][ACOMP] * 255.F) );
+ }
+ }
+ else if (dstFormat == GL_BGRA) {
+ GLuint *dst = (GLuint *) dstAddr;
+ for (i=0;i<n;i++) {
+ dst[i] = (IROUND(rgba[i][BCOMP] * 255.F) << 24)
+ | (IROUND(rgba[i][GCOMP] * 255.F) << 16)
+ | (IROUND(rgba[i][RCOMP] * 255.F) << 8)
+ | (IROUND(rgba[i][ACOMP] * 255.F) );
+ }
+ }
+ else if (dstFormat == GL_ABGR_EXT) {
+ GLuint *dst = (GLuint *) dstAddr;
+ for (i=0;i<n;i++) {
+ dst[i] = (IROUND(rgba[i][ACOMP] * 255.F) << 24)
+ | (IROUND(rgba[i][BCOMP] * 255.F) << 16)
+ | (IROUND(rgba[i][GCOMP] * 255.F) << 8)
+ | (IROUND(rgba[i][RCOMP] * 255.F) );
+ }
+ }
+ break;
+ case GL_UNSIGNED_INT_8_8_8_8_REV:
+ if (dstFormat == GL_RGBA) {
+ GLuint *dst = (GLuint *) dstAddr;
+ for (i=0;i<n;i++) {
+ dst[i] = (IROUND(rgba[i][RCOMP] * 255.0F) )
+ | (IROUND(rgba[i][GCOMP] * 255.0F) << 8)
+ | (IROUND(rgba[i][BCOMP] * 255.0F) << 16)
+ | (IROUND(rgba[i][ACOMP] * 255.0F) << 24);
+ }
+ }
+ else if (dstFormat == GL_BGRA) {
+ GLuint *dst = (GLuint *) dstAddr;
+ for (i=0;i<n;i++) {
+ dst[i] = (IROUND(rgba[i][BCOMP] * 255.0F) )
+ | (IROUND(rgba[i][GCOMP] * 255.0F) << 8)
+ | (IROUND(rgba[i][RCOMP] * 255.0F) << 16)
+ | (IROUND(rgba[i][ACOMP] * 255.0F) << 24);
+ }
+ }
+ else if (dstFormat == GL_ABGR_EXT) {
+ GLuint *dst = (GLuint *) dstAddr;
+ for (i=0;i<n;i++) {
+ dst[i] = (IROUND(rgba[i][ACOMP] * 255.0F) )
+ | (IROUND(rgba[i][BCOMP] * 255.0F) << 8)
+ | (IROUND(rgba[i][GCOMP] * 255.0F) << 16)
+ | (IROUND(rgba[i][RCOMP] * 255.0F) << 24);
+ }
+ }
+ break;
+ case GL_UNSIGNED_INT_10_10_10_2:
+ if (dstFormat == GL_RGBA) {
+ GLuint *dst = (GLuint *) dstAddr;
+ for (i=0;i<n;i++) {
+ dst[i] = (IROUND(rgba[i][RCOMP] * 1023.0F) << 22)
+ | (IROUND(rgba[i][GCOMP] * 1023.0F) << 12)
+ | (IROUND(rgba[i][BCOMP] * 1023.0F) << 2)
+ | (IROUND(rgba[i][ACOMP] * 3.0F) );
+ }
+ }
+ else if (dstFormat == GL_BGRA) {
+ GLuint *dst = (GLuint *) dstAddr;
+ for (i=0;i<n;i++) {
+ dst[i] = (IROUND(rgba[i][BCOMP] * 1023.0F) << 22)
+ | (IROUND(rgba[i][GCOMP] * 1023.0F) << 12)
+ | (IROUND(rgba[i][RCOMP] * 1023.0F) << 2)
+ | (IROUND(rgba[i][ACOMP] * 3.0F) );
+ }
+ }
+ else if (dstFormat == GL_ABGR_EXT) {
+ GLuint *dst = (GLuint *) dstAddr;
+ for (i=0;i<n;i++) {
+ dst[i] = (IROUND(rgba[i][ACOMP] * 1023.0F) << 22)
+ | (IROUND(rgba[i][BCOMP] * 1023.0F) << 12)
+ | (IROUND(rgba[i][GCOMP] * 1023.0F) << 2)
+ | (IROUND(rgba[i][RCOMP] * 3.0F) );
+ }
+ }
+ break;
+ case GL_UNSIGNED_INT_2_10_10_10_REV:
+ if (dstFormat == GL_RGBA) {
+ GLuint *dst = (GLuint *) dstAddr;
+ for (i=0;i<n;i++) {
+ dst[i] = (IROUND(rgba[i][RCOMP] * 1023.0F) )
+ | (IROUND(rgba[i][GCOMP] * 1023.0F) << 10)
+ | (IROUND(rgba[i][BCOMP] * 1023.0F) << 20)
+ | (IROUND(rgba[i][ACOMP] * 3.0F) << 30);
+ }
+ }
+ else if (dstFormat == GL_BGRA) {
+ GLuint *dst = (GLuint *) dstAddr;
+ for (i=0;i<n;i++) {
+ dst[i] = (IROUND(rgba[i][BCOMP] * 1023.0F) )
+ | (IROUND(rgba[i][GCOMP] * 1023.0F) << 10)
+ | (IROUND(rgba[i][RCOMP] * 1023.0F) << 20)
+ | (IROUND(rgba[i][ACOMP] * 3.0F) << 30);
+ }
+ }
+ else if (dstFormat == GL_ABGR_EXT) {
+ GLuint *dst = (GLuint *) dstAddr;
+ for (i=0;i<n;i++) {
+ dst[i] = (IROUND(rgba[i][ACOMP] * 1023.0F) )
+ | (IROUND(rgba[i][BCOMP] * 1023.0F) << 10)
+ | (IROUND(rgba[i][GCOMP] * 1023.0F) << 20)
+ | (IROUND(rgba[i][RCOMP] * 3.0F) << 30);
+ }
+ }
+ break;
+ case GL_UNSIGNED_INT_5_9_9_9_REV:
+ {
+ GLuint *dst = (GLuint *) dstAddr;
+ for (i = 0; i < n; i++) {
+ dst[i] = float3_to_rgb9e5(rgba[i]);
+ }
+ }
+ break;
+ case GL_UNSIGNED_INT_10F_11F_11F_REV:
+ {
+ GLuint *dst = (GLuint *) dstAddr;
+ for (i = 0; i < n; i++) {
+ dst[i] = float3_to_r11g11b10f(rgba[i]);
+ }
+ }
+ break;
+ default:
+ _mesa_problem(ctx, "bad type in _mesa_pack_rgba_span_float");
+ return;
+ }
+
+ if (dstPacking->SwapBytes) {
+ GLint swapSize = _mesa_sizeof_packed_type(dstType);
+ if (swapSize == 2) {
+ if (dstPacking->SwapBytes) {
+ _mesa_swap2((GLushort *) dstAddr, n * comps);
+ }
+ }
+ else if (swapSize == 4) {
+ if (dstPacking->SwapBytes) {
+ _mesa_swap4((GLuint *) dstAddr, n * comps);
+ }
+ }
+ }
+
+ free(luminance);
+}
+
+
+
+#define SWAP2BYTE(VALUE) \
+ { \
+ GLubyte *bytes = (GLubyte *) &(VALUE); \
+ GLubyte tmp = bytes[0]; \
+ bytes[0] = bytes[1]; \
+ bytes[1] = tmp; \
+ }
+
+#define SWAP4BYTE(VALUE) \
+ { \
+ GLubyte *bytes = (GLubyte *) &(VALUE); \
+ GLubyte tmp = bytes[0]; \
+ bytes[0] = bytes[3]; \
+ bytes[3] = tmp; \
+ tmp = bytes[1]; \
+ bytes[1] = bytes[2]; \
+ bytes[2] = tmp; \
+ }
+
+
+static void
+extract_uint_indexes(GLuint n, GLuint indexes[],
+ GLenum srcFormat, GLenum srcType, const GLvoid *src,
+ const struct gl_pixelstore_attrib *unpack )
+{
+ ASSERT(srcFormat == GL_COLOR_INDEX || srcFormat == GL_STENCIL_INDEX);
+
+ ASSERT(srcType == GL_BITMAP ||
+ srcType == GL_UNSIGNED_BYTE ||
+ srcType == GL_BYTE ||
+ srcType == GL_UNSIGNED_SHORT ||
+ srcType == GL_SHORT ||
+ srcType == GL_UNSIGNED_INT ||
+ srcType == GL_INT ||
+ srcType == GL_UNSIGNED_INT_24_8_EXT ||
+ srcType == GL_HALF_FLOAT_ARB ||
+ srcType == GL_FLOAT);
+
+ switch (srcType) {
+ case GL_BITMAP:
+ {
+ GLubyte *ubsrc = (GLubyte *) src;
+ if (unpack->LsbFirst) {
+ GLubyte mask = 1 << (unpack->SkipPixels & 0x7);
+ GLuint i;
+ for (i = 0; i < n; i++) {
+ indexes[i] = (*ubsrc & mask) ? 1 : 0;
+ if (mask == 128) {
+ mask = 1;
+ ubsrc++;
+ }
+ else {
+ mask = mask << 1;
+ }
+ }
+ }
+ else {
+ GLubyte mask = 128 >> (unpack->SkipPixels & 0x7);
+ GLuint i;
+ for (i = 0; i < n; i++) {
+ indexes[i] = (*ubsrc & mask) ? 1 : 0;
+ if (mask == 1) {
+ mask = 128;
+ ubsrc++;
+ }
+ else {
+ mask = mask >> 1;
+ }
+ }
+ }
+ }
+ break;
+ case GL_UNSIGNED_BYTE:
+ {
+ GLuint i;
+ const GLubyte *s = (const GLubyte *) src;
+ for (i = 0; i < n; i++)
+ indexes[i] = s[i];
+ }
+ break;
+ case GL_BYTE:
+ {
+ GLuint i;
+ const GLbyte *s = (const GLbyte *) src;
+ for (i = 0; i < n; i++)
+ indexes[i] = s[i];
+ }
+ break;
+ case GL_UNSIGNED_SHORT:
+ {
+ GLuint i;
+ const GLushort *s = (const GLushort *) src;
+ if (unpack->SwapBytes) {
+ for (i = 0; i < n; i++) {
+ GLushort value = s[i];
+ SWAP2BYTE(value);
+ indexes[i] = value;
+ }
+ }
+ else {
+ for (i = 0; i < n; i++)
+ indexes[i] = s[i];
+ }
+ }
+ break;
+ case GL_SHORT:
+ {
+ GLuint i;
+ const GLshort *s = (const GLshort *) src;
+ if (unpack->SwapBytes) {
+ for (i = 0; i < n; i++) {
+ GLshort value = s[i];
+ SWAP2BYTE(value);
+ indexes[i] = value;
+ }
+ }
+ else {
+ for (i = 0; i < n; i++)
+ indexes[i] = s[i];
+ }
+ }
+ break;
+ case GL_UNSIGNED_INT:
+ {
+ GLuint i;
+ const GLuint *s = (const GLuint *) src;
+ if (unpack->SwapBytes) {
+ for (i = 0; i < n; i++) {
+ GLuint value = s[i];
+ SWAP4BYTE(value);
+ indexes[i] = value;
+ }
+ }
+ else {
+ for (i = 0; i < n; i++)
+ indexes[i] = s[i];
+ }
+ }
+ break;
+ case GL_INT:
+ {
+ GLuint i;
+ const GLint *s = (const GLint *) src;
+ if (unpack->SwapBytes) {
+ for (i = 0; i < n; i++) {
+ GLint value = s[i];
+ SWAP4BYTE(value);
+ indexes[i] = value;
+ }
+ }
+ else {
+ for (i = 0; i < n; i++)
+ indexes[i] = s[i];
+ }
+ }
+ break;
+ case GL_FLOAT:
+ {
+ GLuint i;
+ const GLfloat *s = (const GLfloat *) src;
+ if (unpack->SwapBytes) {
+ for (i = 0; i < n; i++) {
+ GLfloat value = s[i];
+ SWAP4BYTE(value);
+ indexes[i] = (GLuint) value;
+ }
+ }
+ else {
+ for (i = 0; i < n; i++)
+ indexes[i] = (GLuint) s[i];
+ }
+ }
+ break;
+ case GL_HALF_FLOAT_ARB:
+ {
+ GLuint i;
+ const GLhalfARB *s = (const GLhalfARB *) src;
+ if (unpack->SwapBytes) {
+ for (i = 0; i < n; i++) {
+ GLhalfARB value = s[i];
+ SWAP2BYTE(value);
+ indexes[i] = (GLuint) _mesa_half_to_float(value);
+ }
+ }
+ else {
+ for (i = 0; i < n; i++)
+ indexes[i] = (GLuint) _mesa_half_to_float(s[i]);
+ }
+ }
+ break;
+ case GL_UNSIGNED_INT_24_8_EXT:
+ {
+ GLuint i;
+ const GLuint *s = (const GLuint *) src;
+ if (unpack->SwapBytes) {
+ for (i = 0; i < n; i++) {
+ GLuint value = s[i];
+ SWAP4BYTE(value);
+ indexes[i] = value & 0xff; /* lower 8 bits */
+ }
+ }
+ else {
+ for (i = 0; i < n; i++)
+ indexes[i] = s[i] & 0xff; /* lower 8 bits */
+ }
+ }
+ break;
+
+ default:
+ _mesa_problem(NULL, "bad srcType in extract_uint_indexes");
+ return;
+ }
+}
+
+
+/**
+ * Return source/dest RGBA indexes for unpacking pixels.
+ */
+static void
+get_component_mapping(GLenum format,
+ GLint *rSrc,
+ GLint *gSrc,
+ GLint *bSrc,
+ GLint *aSrc,
+ GLint *rDst,
+ GLint *gDst,
+ GLint *bDst,
+ GLint *aDst)
+{
+ switch (format) {
+ case GL_RED:
+ case GL_RED_INTEGER_EXT:
+ *rSrc = 0;
+ *gSrc = *bSrc = *aSrc = -1;
+ break;
+ case GL_GREEN:
+ case GL_GREEN_INTEGER_EXT:
+ *gSrc = 0;
+ *rSrc = *bSrc = *aSrc = -1;
+ break;
+ case GL_BLUE:
+ case GL_BLUE_INTEGER_EXT:
+ *bSrc = 0;
+ *rSrc = *gSrc = *aSrc = -1;
+ break;
+ case GL_ALPHA:
+ case GL_ALPHA_INTEGER_EXT:
+ *rSrc = *gSrc = *bSrc = -1;
+ *aSrc = 0;
+ break;
+ case GL_LUMINANCE:
+ case GL_LUMINANCE_INTEGER_EXT:
+ *rSrc = *gSrc = *bSrc = 0;
+ *aSrc = -1;
+ break;
+ case GL_LUMINANCE_ALPHA:
+ case GL_LUMINANCE_ALPHA_INTEGER_EXT:
+ *rSrc = *gSrc = *bSrc = 0;
+ *aSrc = 1;
+ break;
+ case GL_INTENSITY:
+ *rSrc = *gSrc = *bSrc = *aSrc = 0;
+ break;
+ case GL_RG:
+ case GL_RG_INTEGER:
+ *rSrc = 0;
+ *gSrc = 1;
+ *bSrc = -1;
+ *aSrc = -1;
+ *rDst = 0;
+ *gDst = 1;
+ *bDst = 2;
+ *aDst = 3;
+ break;
+ case GL_RGB:
+ case GL_RGB_INTEGER:
+ *rSrc = 0;
+ *gSrc = 1;
+ *bSrc = 2;
+ *aSrc = -1;
+ *rDst = 0;
+ *gDst = 1;
+ *bDst = 2;
+ *aDst = 3;
+ break;
+ case GL_BGR:
+ *rSrc = 2;
+ *gSrc = 1;
+ *bSrc = 0;
+ *aSrc = -1;
+ *rDst = 2;
+ *gDst = 1;
+ *bDst = 0;
+ *aDst = 3;
+ break;
+ case GL_RGBA:
+ case GL_RGBA_INTEGER:
+ *rSrc = 0;
+ *gSrc = 1;
+ *bSrc = 2;
+ *aSrc = 3;
+ *rDst = 0;
+ *gDst = 1;
+ *bDst = 2;
+ *aDst = 3;
+ break;
+ case GL_BGRA:
+ *rSrc = 2;
+ *gSrc = 1;
+ *bSrc = 0;
+ *aSrc = 3;
+ *rDst = 2;
+ *gDst = 1;
+ *bDst = 0;
+ *aDst = 3;
+ break;
+ case GL_ABGR_EXT:
+ *rSrc = 3;
+ *gSrc = 2;
+ *bSrc = 1;
+ *aSrc = 0;
+ *rDst = 3;
+ *gDst = 2;
+ *bDst = 1;
+ *aDst = 0;
+ break;
+ case GL_DU8DV8_ATI:
+ case GL_DUDV_ATI:
+ *rSrc = 0;
+ *gSrc = 1;
+ *bSrc = -1;
+ *aSrc = -1;
+ break;
+ default:
+ _mesa_problem(NULL, "bad srcFormat %s in get_component_mapping",
+ _mesa_lookup_enum_by_nr(format));
+ return;
+ }
+}
+
+
+
+/*
+ * This function extracts floating point RGBA values from arbitrary
+ * image data. srcFormat and srcType are the format and type parameters
+ * passed to glDrawPixels, glTexImage[123]D, glTexSubImage[123]D, etc.
+ *
+ * Refering to section 3.6.4 of the OpenGL 1.2 spec, this function
+ * implements the "Conversion to floating point", "Conversion to RGB",
+ * and "Final Expansion to RGBA" operations.
+ *
+ * Args: n - number of pixels
+ * rgba - output colors
+ * srcFormat - format of incoming data
+ * srcType - data type of incoming data
+ * src - source data pointer
+ * swapBytes - perform byteswapping of incoming data?
+ */
+static void
+extract_float_rgba(GLuint n, GLfloat rgba[][4],
+ GLenum srcFormat, GLenum srcType, const GLvoid *src,
+ GLboolean swapBytes)
+{
+ GLint rSrc, gSrc, bSrc, aSrc;
+ GLint stride;
+ GLint rDst, bDst, gDst, aDst;
+ GLboolean intFormat;
+ GLfloat rs = 1.0f, gs = 1.0f, bs = 1.0f, as = 1.0f; /* scale factors */
+
+ ASSERT(srcFormat == GL_RED ||
+ srcFormat == GL_GREEN ||
+ srcFormat == GL_BLUE ||
+ srcFormat == GL_ALPHA ||
+ srcFormat == GL_LUMINANCE ||
+ srcFormat == GL_LUMINANCE_ALPHA ||
+ srcFormat == GL_INTENSITY ||
+ srcFormat == GL_RG ||
+ srcFormat == GL_RGB ||
+ srcFormat == GL_BGR ||
+ srcFormat == GL_RGBA ||
+ srcFormat == GL_BGRA ||
+ srcFormat == GL_ABGR_EXT ||
+ srcFormat == GL_DU8DV8_ATI ||
+ srcFormat == GL_DUDV_ATI ||
+ srcFormat == GL_RED_INTEGER_EXT ||
+ srcFormat == GL_GREEN_INTEGER_EXT ||
+ srcFormat == GL_BLUE_INTEGER_EXT ||
+ srcFormat == GL_ALPHA_INTEGER_EXT ||
+ srcFormat == GL_RGB_INTEGER_EXT ||
+ srcFormat == GL_RGBA_INTEGER_EXT ||
+ srcFormat == GL_BGR_INTEGER_EXT ||
+ srcFormat == GL_BGRA_INTEGER_EXT ||
+ srcFormat == GL_LUMINANCE_INTEGER_EXT ||
+ srcFormat == GL_LUMINANCE_ALPHA_INTEGER_EXT);
+
+ ASSERT(srcType == GL_UNSIGNED_BYTE ||
+ srcType == GL_BYTE ||
+ srcType == GL_UNSIGNED_SHORT ||
+ srcType == GL_SHORT ||
+ srcType == GL_UNSIGNED_INT ||
+ srcType == GL_INT ||
+ srcType == GL_HALF_FLOAT_ARB ||
+ srcType == GL_FLOAT ||
+ srcType == GL_UNSIGNED_BYTE_3_3_2 ||
+ srcType == GL_UNSIGNED_BYTE_2_3_3_REV ||
+ srcType == GL_UNSIGNED_SHORT_5_6_5 ||
+ srcType == GL_UNSIGNED_SHORT_5_6_5_REV ||
+ srcType == GL_UNSIGNED_SHORT_4_4_4_4 ||
+ srcType == GL_UNSIGNED_SHORT_4_4_4_4_REV ||
+ srcType == GL_UNSIGNED_SHORT_5_5_5_1 ||
+ srcType == GL_UNSIGNED_SHORT_1_5_5_5_REV ||
+ srcType == GL_UNSIGNED_INT_8_8_8_8 ||
+ srcType == GL_UNSIGNED_INT_8_8_8_8_REV ||
+ srcType == GL_UNSIGNED_INT_10_10_10_2 ||
+ srcType == GL_UNSIGNED_INT_2_10_10_10_REV ||
+ srcType == GL_UNSIGNED_INT_5_9_9_9_REV ||
+ srcType == GL_UNSIGNED_INT_10F_11F_11F_REV);
+
+ get_component_mapping(srcFormat,
+ &rSrc, &gSrc, &bSrc, &aSrc,
+ &rDst, &gDst, &bDst, &aDst);
+
+ stride = _mesa_components_in_format(srcFormat);
+
+ intFormat = _mesa_is_integer_format(srcFormat);
+
+#define PROCESS(SRC_INDEX, DST_INDEX, DEFAULT_FLT, DEFAULT_INT, TYPE, CONVERSION) \
+ if ((SRC_INDEX) < 0) { \
+ GLuint i; \
+ if (intFormat) { \
+ for (i = 0; i < n; i++) { \
+ rgba[i][DST_INDEX] = DEFAULT_INT; \
+ } \
+ } \
+ else { \
+ for (i = 0; i < n; i++) { \
+ rgba[i][DST_INDEX] = DEFAULT_FLT; \
+ } \
+ } \
+ } \
+ else if (swapBytes) { \
+ const TYPE *s = (const TYPE *) src; \
+ GLuint i; \
+ for (i = 0; i < n; i++) { \
+ TYPE value = s[SRC_INDEX]; \
+ if (sizeof(TYPE) == 2) { \
+ SWAP2BYTE(value); \
+ } \
+ else if (sizeof(TYPE) == 4) { \
+ SWAP4BYTE(value); \
+ } \
+ if (intFormat) \
+ rgba[i][DST_INDEX] = (GLfloat) value; \
+ else \
+ rgba[i][DST_INDEX] = (GLfloat) CONVERSION(value); \
+ s += stride; \
+ } \
+ } \
+ else { \
+ const TYPE *s = (const TYPE *) src; \
+ GLuint i; \
+ if (intFormat) { \
+ for (i = 0; i < n; i++) { \
+ rgba[i][DST_INDEX] = (GLfloat) s[SRC_INDEX]; \
+ s += stride; \
+ } \
+ } \
+ else { \
+ for (i = 0; i < n; i++) { \
+ rgba[i][DST_INDEX] = (GLfloat) CONVERSION(s[SRC_INDEX]); \
+ s += stride; \
+ } \
+ } \
+ }
+
+ switch (srcType) {
+ case GL_UNSIGNED_BYTE:
+ PROCESS(rSrc, RCOMP, 0.0F, 0, GLubyte, UBYTE_TO_FLOAT);
+ PROCESS(gSrc, GCOMP, 0.0F, 0, GLubyte, UBYTE_TO_FLOAT);
+ PROCESS(bSrc, BCOMP, 0.0F, 0, GLubyte, UBYTE_TO_FLOAT);
+ PROCESS(aSrc, ACOMP, 1.0F, 255, GLubyte, UBYTE_TO_FLOAT);
+ break;
+ case GL_BYTE:
+ PROCESS(rSrc, RCOMP, 0.0F, 0, GLbyte, BYTE_TO_FLOAT);
+ PROCESS(gSrc, GCOMP, 0.0F, 0, GLbyte, BYTE_TO_FLOAT);
+ PROCESS(bSrc, BCOMP, 0.0F, 0, GLbyte, BYTE_TO_FLOAT);
+ PROCESS(aSrc, ACOMP, 1.0F, 127, GLbyte, BYTE_TO_FLOAT);
+ break;
+ case GL_UNSIGNED_SHORT:
+ PROCESS(rSrc, RCOMP, 0.0F, 0, GLushort, USHORT_TO_FLOAT);
+ PROCESS(gSrc, GCOMP, 0.0F, 0, GLushort, USHORT_TO_FLOAT);
+ PROCESS(bSrc, BCOMP, 0.0F, 0, GLushort, USHORT_TO_FLOAT);
+ PROCESS(aSrc, ACOMP, 1.0F, 0xffff, GLushort, USHORT_TO_FLOAT);
+ break;
+ case GL_SHORT:
+ PROCESS(rSrc, RCOMP, 0.0F, 0, GLshort, SHORT_TO_FLOAT);
+ PROCESS(gSrc, GCOMP, 0.0F, 0, GLshort, SHORT_TO_FLOAT);
+ PROCESS(bSrc, BCOMP, 0.0F, 0, GLshort, SHORT_TO_FLOAT);
+ PROCESS(aSrc, ACOMP, 1.0F, 32767, GLshort, SHORT_TO_FLOAT);
+ break;
+ case GL_UNSIGNED_INT:
+ PROCESS(rSrc, RCOMP, 0.0F, 0, GLuint, UINT_TO_FLOAT);
+ PROCESS(gSrc, GCOMP, 0.0F, 0, GLuint, UINT_TO_FLOAT);
+ PROCESS(bSrc, BCOMP, 0.0F, 0, GLuint, UINT_TO_FLOAT);
+ PROCESS(aSrc, ACOMP, 1.0F, 0xffffffff, GLuint, UINT_TO_FLOAT);
+ break;
+ case GL_INT:
+ PROCESS(rSrc, RCOMP, 0.0F, 0, GLint, INT_TO_FLOAT);
+ PROCESS(gSrc, GCOMP, 0.0F, 0, GLint, INT_TO_FLOAT);
+ PROCESS(bSrc, BCOMP, 0.0F, 0, GLint, INT_TO_FLOAT);
+ PROCESS(aSrc, ACOMP, 1.0F, 2147483647, GLint, INT_TO_FLOAT);
+ break;
+ case GL_FLOAT:
+ PROCESS(rSrc, RCOMP, 0.0F, 0.0F, GLfloat, (GLfloat));
+ PROCESS(gSrc, GCOMP, 0.0F, 0.0F, GLfloat, (GLfloat));
+ PROCESS(bSrc, BCOMP, 0.0F, 0.0F, GLfloat, (GLfloat));
+ PROCESS(aSrc, ACOMP, 1.0F, 1.0F, GLfloat, (GLfloat));
+ break;
+ case GL_HALF_FLOAT_ARB:
+ PROCESS(rSrc, RCOMP, 0.0F, 0.0F, GLhalfARB, _mesa_half_to_float);
+ PROCESS(gSrc, GCOMP, 0.0F, 0.0F, GLhalfARB, _mesa_half_to_float);
+ PROCESS(bSrc, BCOMP, 0.0F, 0.0F, GLhalfARB, _mesa_half_to_float);
+ PROCESS(aSrc, ACOMP, 1.0F, 1.0F, GLhalfARB, _mesa_half_to_float);
+ break;
+ case GL_UNSIGNED_BYTE_3_3_2:
+ {
+ const GLubyte *ubsrc = (const GLubyte *) src;
+ GLuint i;
+ if (!intFormat) {
+ rs = 1.0F / 7.0F;
+ gs = 1.0F / 7.0F;
+ bs = 1.0F / 3.0F;
+ }
+ for (i = 0; i < n; i ++) {
+ GLubyte p = ubsrc[i];
+ rgba[i][rDst] = ((p >> 5) ) * rs;
+ rgba[i][gDst] = ((p >> 2) & 0x7) * gs;
+ rgba[i][bDst] = ((p ) & 0x3) * bs;
+ rgba[i][aDst] = 1.0F;
+ }
+ }
+ break;
+ case GL_UNSIGNED_BYTE_2_3_3_REV:
+ {
+ const GLubyte *ubsrc = (const GLubyte *) src;
+ GLuint i;
+ if (!intFormat) {
+ rs = 1.0F / 7.0F;
+ gs = 1.0F / 7.0F;
+ bs = 1.0F / 3.0F;
+ }
+ for (i = 0; i < n; i ++) {
+ GLubyte p = ubsrc[i];
+ rgba[i][rDst] = ((p ) & 0x7) * rs;
+ rgba[i][gDst] = ((p >> 3) & 0x7) * gs;
+ rgba[i][bDst] = ((p >> 6) ) * bs;
+ rgba[i][aDst] = 1.0F;
+ }
+ }
+ break;
+ case GL_UNSIGNED_SHORT_5_6_5:
+ if (!intFormat) {
+ rs = 1.0F / 31.0F;
+ gs = 1.0F / 63.0F;
+ bs = 1.0F / 31.0F;
+ }
+ if (swapBytes) {
+ const GLushort *ussrc = (const GLushort *) src;
+ GLuint i;
+ for (i = 0; i < n; i ++) {
+ GLushort p = ussrc[i];
+ SWAP2BYTE(p);
+ rgba[i][rDst] = ((p >> 11) ) * rs;
+ rgba[i][gDst] = ((p >> 5) & 0x3f) * gs;
+ rgba[i][bDst] = ((p ) & 0x1f) * bs;
+ rgba[i][aDst] = 1.0F;
+ }
+ }
+ else {
+ const GLushort *ussrc = (const GLushort *) src;
+ GLuint i;
+ for (i = 0; i < n; i ++) {
+ GLushort p = ussrc[i];
+ rgba[i][rDst] = ((p >> 11) ) * rs;
+ rgba[i][gDst] = ((p >> 5) & 0x3f) * gs;
+ rgba[i][bDst] = ((p ) & 0x1f) * bs;
+ rgba[i][aDst] = 1.0F;
+ }
+ }
+ break;
+ case GL_UNSIGNED_SHORT_5_6_5_REV:
+ if (!intFormat) {
+ rs = 1.0F / 31.0F;
+ gs = 1.0F / 63.0F;
+ bs = 1.0F / 31.0F;
+ }
+ if (swapBytes) {
+ const GLushort *ussrc = (const GLushort *) src;
+ GLuint i;
+ for (i = 0; i < n; i ++) {
+ GLushort p = ussrc[i];
+ SWAP2BYTE(p);
+ rgba[i][rDst] = ((p ) & 0x1f) * rs;
+ rgba[i][gDst] = ((p >> 5) & 0x3f) * gs;
+ rgba[i][bDst] = ((p >> 11) ) * bs;
+ rgba[i][aDst] = 1.0F;
+ }
+ }
+ else {
+ const GLushort *ussrc = (const GLushort *) src;
+ GLuint i;
+ for (i = 0; i < n; i ++) {
+ GLushort p = ussrc[i];
+ rgba[i][rDst] = ((p ) & 0x1f) * rs;
+ rgba[i][gDst] = ((p >> 5) & 0x3f) * gs;
+ rgba[i][bDst] = ((p >> 11) ) * bs;
+ rgba[i][aDst] = 1.0F;
+ }
+ }
+ break;
+ case GL_UNSIGNED_SHORT_4_4_4_4:
+ if (!intFormat) {
+ rs = gs = bs = as = 1.0F / 15.0F;
+ }
+ if (swapBytes) {
+ const GLushort *ussrc = (const GLushort *) src;
+ GLuint i;
+ for (i = 0; i < n; i ++) {
+ GLushort p = ussrc[i];
+ SWAP2BYTE(p);
+ rgba[i][rDst] = ((p >> 12) ) * rs;
+ rgba[i][gDst] = ((p >> 8) & 0xf) * gs;
+ rgba[i][bDst] = ((p >> 4) & 0xf) * bs;
+ rgba[i][aDst] = ((p ) & 0xf) * as;
+ }
+ }
+ else {
+ const GLushort *ussrc = (const GLushort *) src;
+ GLuint i;
+ for (i = 0; i < n; i ++) {
+ GLushort p = ussrc[i];
+ rgba[i][rDst] = ((p >> 12) ) * rs;
+ rgba[i][gDst] = ((p >> 8) & 0xf) * gs;
+ rgba[i][bDst] = ((p >> 4) & 0xf) * bs;
+ rgba[i][aDst] = ((p ) & 0xf) * as;
+ }
+ }
+ break;
+ case GL_UNSIGNED_SHORT_4_4_4_4_REV:
+ if (!intFormat) {
+ rs = gs = bs = as = 1.0F / 15.0F;
+ }
+ if (swapBytes) {
+ const GLushort *ussrc = (const GLushort *) src;
+ GLuint i;
+ for (i = 0; i < n; i ++) {
+ GLushort p = ussrc[i];
+ SWAP2BYTE(p);
+ rgba[i][rDst] = ((p ) & 0xf) * rs;
+ rgba[i][gDst] = ((p >> 4) & 0xf) * gs;
+ rgba[i][bDst] = ((p >> 8) & 0xf) * bs;
+ rgba[i][aDst] = ((p >> 12) ) * as;
+ }
+ }
+ else {
+ const GLushort *ussrc = (const GLushort *) src;
+ GLuint i;
+ for (i = 0; i < n; i ++) {
+ GLushort p = ussrc[i];
+ rgba[i][rDst] = ((p ) & 0xf) * rs;
+ rgba[i][gDst] = ((p >> 4) & 0xf) * gs;
+ rgba[i][bDst] = ((p >> 8) & 0xf) * bs;
+ rgba[i][aDst] = ((p >> 12) ) * as;
+ }
+ }
+ break;
+ case GL_UNSIGNED_SHORT_5_5_5_1:
+ if (!intFormat) {
+ rs = gs = bs = 1.0F / 31.0F;
+ }
+ if (swapBytes) {
+ const GLushort *ussrc = (const GLushort *) src;
+ GLuint i;
+ for (i = 0; i < n; i ++) {
+ GLushort p = ussrc[i];
+ SWAP2BYTE(p);
+ rgba[i][rDst] = ((p >> 11) ) * rs;
+ rgba[i][gDst] = ((p >> 6) & 0x1f) * gs;
+ rgba[i][bDst] = ((p >> 1) & 0x1f) * bs;
+ rgba[i][aDst] = ((p ) & 0x1) * as;
+ }
+ }
+ else {
+ const GLushort *ussrc = (const GLushort *) src;
+ GLuint i;
+ for (i = 0; i < n; i ++) {
+ GLushort p = ussrc[i];
+ rgba[i][rDst] = ((p >> 11) ) * rs;
+ rgba[i][gDst] = ((p >> 6) & 0x1f) * gs;
+ rgba[i][bDst] = ((p >> 1) & 0x1f) * bs;
+ rgba[i][aDst] = ((p ) & 0x1) * as;
+ }
+ }
+ break;
+ case GL_UNSIGNED_SHORT_1_5_5_5_REV:
+ if (!intFormat) {
+ rs = gs = bs = 1.0F / 31.0F;
+ }
+ if (swapBytes) {
+ const GLushort *ussrc = (const GLushort *) src;
+ GLuint i;
+ for (i = 0; i < n; i ++) {
+ GLushort p = ussrc[i];
+ SWAP2BYTE(p);
+ rgba[i][rDst] = ((p ) & 0x1f) * rs;
+ rgba[i][gDst] = ((p >> 5) & 0x1f) * gs;
+ rgba[i][bDst] = ((p >> 10) & 0x1f) * bs;
+ rgba[i][aDst] = ((p >> 15) ) * as;
+ }
+ }
+ else {
+ const GLushort *ussrc = (const GLushort *) src;
+ GLuint i;
+ for (i = 0; i < n; i ++) {
+ GLushort p = ussrc[i];
+ rgba[i][rDst] = ((p ) & 0x1f) * rs;
+ rgba[i][gDst] = ((p >> 5) & 0x1f) * gs;
+ rgba[i][bDst] = ((p >> 10) & 0x1f) * bs;
+ rgba[i][aDst] = ((p >> 15) ) * as;
+ }
+ }
+ break;
+ case GL_UNSIGNED_INT_8_8_8_8:
+ if (swapBytes) {
+ const GLuint *uisrc = (const GLuint *) src;
+ GLuint i;
+ if (intFormat) {
+ for (i = 0; i < n; i ++) {
+ GLuint p = uisrc[i];
+ rgba[i][rDst] = (GLfloat) ((p ) & 0xff);
+ rgba[i][gDst] = (GLfloat) ((p >> 8) & 0xff);
+ rgba[i][bDst] = (GLfloat) ((p >> 16) & 0xff);
+ rgba[i][aDst] = (GLfloat) ((p >> 24) );
+ }
+ }
+ else {
+ for (i = 0; i < n; i ++) {
+ GLuint p = uisrc[i];
+ rgba[i][rDst] = UBYTE_TO_FLOAT((p ) & 0xff);
+ rgba[i][gDst] = UBYTE_TO_FLOAT((p >> 8) & 0xff);
+ rgba[i][bDst] = UBYTE_TO_FLOAT((p >> 16) & 0xff);
+ rgba[i][aDst] = UBYTE_TO_FLOAT((p >> 24) );
+ }
+ }
+ }
+ else {
+ const GLuint *uisrc = (const GLuint *) src;
+ GLuint i;
+ if (intFormat) {
+ for (i = 0; i < n; i ++) {
+ GLuint p = uisrc[i];
+ rgba[i][rDst] = (GLfloat) ((p >> 24) );
+ rgba[i][gDst] = (GLfloat) ((p >> 16) & 0xff);
+ rgba[i][bDst] = (GLfloat) ((p >> 8) & 0xff);
+ rgba[i][aDst] = (GLfloat) ((p ) & 0xff);
+ }
+ }
+ else {
+ for (i = 0; i < n; i ++) {
+ GLuint p = uisrc[i];
+ rgba[i][rDst] = UBYTE_TO_FLOAT((p >> 24) );
+ rgba[i][gDst] = UBYTE_TO_FLOAT((p >> 16) & 0xff);
+ rgba[i][bDst] = UBYTE_TO_FLOAT((p >> 8) & 0xff);
+ rgba[i][aDst] = UBYTE_TO_FLOAT((p ) & 0xff);
+ }
+ }
+ }
+ break;
+ case GL_UNSIGNED_INT_8_8_8_8_REV:
+ if (swapBytes) {
+ const GLuint *uisrc = (const GLuint *) src;
+ GLuint i;
+ if (intFormat) {
+ for (i = 0; i < n; i ++) {
+ GLuint p = uisrc[i];
+ rgba[i][rDst] = (GLfloat) ((p >> 24) );
+ rgba[i][gDst] = (GLfloat) ((p >> 16) & 0xff);
+ rgba[i][bDst] = (GLfloat) ((p >> 8) & 0xff);
+ rgba[i][aDst] = (GLfloat) ((p ) & 0xff);
+ }
+ }
+ else {
+ for (i = 0; i < n; i ++) {
+ GLuint p = uisrc[i];
+ rgba[i][rDst] = UBYTE_TO_FLOAT((p >> 24) );
+ rgba[i][gDst] = UBYTE_TO_FLOAT((p >> 16) & 0xff);
+ rgba[i][bDst] = UBYTE_TO_FLOAT((p >> 8) & 0xff);
+ rgba[i][aDst] = UBYTE_TO_FLOAT((p ) & 0xff);
+ }
+ }
+ }
+ else {
+ const GLuint *uisrc = (const GLuint *) src;
+ GLuint i;
+ if (intFormat) {
+ for (i = 0; i < n; i ++) {
+ GLuint p = uisrc[i];
+ rgba[i][rDst] = (GLfloat) ((p ) & 0xff);
+ rgba[i][gDst] = (GLfloat) ((p >> 8) & 0xff);
+ rgba[i][bDst] = (GLfloat) ((p >> 16) & 0xff);
+ rgba[i][aDst] = (GLfloat) ((p >> 24) );
+ }
+ }
+ else {
+ for (i = 0; i < n; i ++) {
+ GLuint p = uisrc[i];
+ rgba[i][rDst] = UBYTE_TO_FLOAT((p ) & 0xff);
+ rgba[i][gDst] = UBYTE_TO_FLOAT((p >> 8) & 0xff);
+ rgba[i][bDst] = UBYTE_TO_FLOAT((p >> 16) & 0xff);
+ rgba[i][aDst] = UBYTE_TO_FLOAT((p >> 24) );
+ }
+ }
+ }
+ break;
+ case GL_UNSIGNED_INT_10_10_10_2:
+ if (!intFormat) {
+ rs = 1.0F / 1023.0F;
+ gs = 1.0F / 1023.0F;
+ bs = 1.0F / 1023.0F;
+ as = 1.0F / 3.0F;
+ }
+ if (swapBytes) {
+ const GLuint *uisrc = (const GLuint *) src;
+ GLuint i;
+ for (i = 0; i < n; i ++) {
+ GLuint p = uisrc[i];
+ SWAP4BYTE(p);
+ rgba[i][rDst] = ((p >> 22) ) * rs;
+ rgba[i][gDst] = ((p >> 12) & 0x3ff) * gs;
+ rgba[i][bDst] = ((p >> 2) & 0x3ff) * bs;
+ rgba[i][aDst] = ((p ) & 0x3 ) * as;
+ }
+ }
+ else {
+ const GLuint *uisrc = (const GLuint *) src;
+ GLuint i;
+ for (i = 0; i < n; i ++) {
+ GLuint p = uisrc[i];
+ rgba[i][rDst] = ((p >> 22) ) * rs;
+ rgba[i][gDst] = ((p >> 12) & 0x3ff) * gs;
+ rgba[i][bDst] = ((p >> 2) & 0x3ff) * bs;
+ rgba[i][aDst] = ((p ) & 0x3 ) * as;
+ }
+ }
+ break;
+ case GL_UNSIGNED_INT_2_10_10_10_REV:
+ if (!intFormat) {
+ rs = 1.0F / 1023.0F;
+ gs = 1.0F / 1023.0F;
+ bs = 1.0F / 1023.0F;
+ as = 1.0F / 3.0F;
+ }
+ if (swapBytes) {
+ const GLuint *uisrc = (const GLuint *) src;
+ GLuint i;
+ for (i = 0; i < n; i ++) {
+ GLuint p = uisrc[i];
+ SWAP4BYTE(p);
+ rgba[i][rDst] = ((p ) & 0x3ff) * rs;
+ rgba[i][gDst] = ((p >> 10) & 0x3ff) * gs;
+ rgba[i][bDst] = ((p >> 20) & 0x3ff) * bs;
+ rgba[i][aDst] = ((p >> 30) ) * as;
+ }
+ }
+ else {
+ const GLuint *uisrc = (const GLuint *) src;
+ GLuint i;
+ for (i = 0; i < n; i ++) {
+ GLuint p = uisrc[i];
+ rgba[i][rDst] = ((p ) & 0x3ff) * rs;
+ rgba[i][gDst] = ((p >> 10) & 0x3ff) * gs;
+ rgba[i][bDst] = ((p >> 20) & 0x3ff) * bs;
+ rgba[i][aDst] = ((p >> 30) ) * as;
+ }
+ }
+ break;
+ case GL_UNSIGNED_INT_5_9_9_9_REV:
+ if (swapBytes) {
+ const GLuint *uisrc = (const GLuint *) src;
+ GLuint i;
+ GLfloat f[3];
+ for (i = 0; i < n; i ++) {
+ GLuint p = uisrc[i];
+ SWAP4BYTE(p);
+ rgb9e5_to_float3(p, f);
+ rgba[i][rDst] = f[0];
+ rgba[i][gDst] = f[1];
+ rgba[i][bDst] = f[2];
+ rgba[i][aDst] = 1.0F;
+ }
+ }
+ else {
+ const GLuint *uisrc = (const GLuint *) src;
+ GLuint i;
+ GLfloat f[3];
+ for (i = 0; i < n; i ++) {
+ rgb9e5_to_float3(uisrc[i], f);
+ rgba[i][rDst] = f[0];
+ rgba[i][gDst] = f[1];
+ rgba[i][bDst] = f[2];
+ rgba[i][aDst] = 1.0F;
+ }
+ }
+ break;
+ case GL_UNSIGNED_INT_10F_11F_11F_REV:
+ if (swapBytes) {
+ const GLuint *uisrc = (const GLuint *) src;
+ GLuint i;
+ GLfloat f[3];
+ for (i = 0; i < n; i ++) {
+ GLuint p = uisrc[i];
+ SWAP4BYTE(p);
+ r11g11b10f_to_float3(p, f);
+ rgba[i][rDst] = f[0];
+ rgba[i][gDst] = f[1];
+ rgba[i][bDst] = f[2];
+ rgba[i][aDst] = 1.0F;
+ }
+ }
+ else {
+ const GLuint *uisrc = (const GLuint *) src;
+ GLuint i;
+ GLfloat f[3];
+ for (i = 0; i < n; i ++) {
+ r11g11b10f_to_float3(uisrc[i], f);
+ rgba[i][rDst] = f[0];
+ rgba[i][gDst] = f[1];
+ rgba[i][bDst] = f[2];
+ rgba[i][aDst] = 1.0F;
+ }
+ }
+ break;
+ default:
+ _mesa_problem(NULL, "bad srcType in extract float data");
+ break;
+ }
+#undef PROCESS
+}
+
+
+static INLINE GLuint
+clamp_byte_to_uint(GLbyte b)
+{
+ return b < 0 ? 0 : b;
+}
+
+
+static INLINE GLuint
+clamp_short_to_uint(GLshort s)
+{
+ return s < 0 ? 0 : s;
+}
+
+
+static INLINE GLuint
+clamp_int_to_uint(GLint i)
+{
+ return i < 0 ? 0 : i;
+}
+
+
+static INLINE GLuint
+clamp_float_to_uint(GLfloat f)
+{
+ return f < 0.0F ? 0 : IROUND(f);
+}
+
+
+static INLINE GLuint
+clamp_half_to_uint(GLhalfARB h)
+{
+ GLfloat f = _mesa_half_to_float(h);
+ return f < 0.0F ? 0 : IROUND(f);
+}
+
+
+/**
+ * \sa extract_float_rgba()
+ */
+static void
+extract_uint_rgba(GLuint n, GLuint rgba[][4],
+ GLenum srcFormat, GLenum srcType, const GLvoid *src,
+ GLboolean swapBytes)
+{
+ GLint rSrc, gSrc, bSrc, aSrc;
+ GLint stride;
+ GLint rDst, bDst, gDst, aDst;
+
+ ASSERT(srcFormat == GL_RED ||
+ srcFormat == GL_GREEN ||
+ srcFormat == GL_BLUE ||
+ srcFormat == GL_ALPHA ||
+ srcFormat == GL_LUMINANCE ||
+ srcFormat == GL_LUMINANCE_ALPHA ||
+ srcFormat == GL_INTENSITY ||
+ srcFormat == GL_RG ||
+ srcFormat == GL_RGB ||
+ srcFormat == GL_BGR ||
+ srcFormat == GL_RGBA ||
+ srcFormat == GL_BGRA ||
+ srcFormat == GL_ABGR_EXT ||
+ srcFormat == GL_DU8DV8_ATI ||
+ srcFormat == GL_DUDV_ATI ||
+ srcFormat == GL_RED_INTEGER_EXT ||
+ srcFormat == GL_GREEN_INTEGER_EXT ||
+ srcFormat == GL_BLUE_INTEGER_EXT ||
+ srcFormat == GL_ALPHA_INTEGER_EXT ||
+ srcFormat == GL_RGB_INTEGER_EXT ||
+ srcFormat == GL_RGBA_INTEGER_EXT ||
+ srcFormat == GL_BGR_INTEGER_EXT ||
+ srcFormat == GL_BGRA_INTEGER_EXT ||
+ srcFormat == GL_LUMINANCE_INTEGER_EXT ||
+ srcFormat == GL_LUMINANCE_ALPHA_INTEGER_EXT);
+
+ ASSERT(srcType == GL_UNSIGNED_BYTE ||
+ srcType == GL_BYTE ||
+ srcType == GL_UNSIGNED_SHORT ||
+ srcType == GL_SHORT ||
+ srcType == GL_UNSIGNED_INT ||
+ srcType == GL_INT ||
+ srcType == GL_HALF_FLOAT_ARB ||
+ srcType == GL_FLOAT ||
+ srcType == GL_UNSIGNED_BYTE_3_3_2 ||
+ srcType == GL_UNSIGNED_BYTE_2_3_3_REV ||
+ srcType == GL_UNSIGNED_SHORT_5_6_5 ||
+ srcType == GL_UNSIGNED_SHORT_5_6_5_REV ||
+ srcType == GL_UNSIGNED_SHORT_4_4_4_4 ||
+ srcType == GL_UNSIGNED_SHORT_4_4_4_4_REV ||
+ srcType == GL_UNSIGNED_SHORT_5_5_5_1 ||
+ srcType == GL_UNSIGNED_SHORT_1_5_5_5_REV ||
+ srcType == GL_UNSIGNED_INT_8_8_8_8 ||
+ srcType == GL_UNSIGNED_INT_8_8_8_8_REV ||
+ srcType == GL_UNSIGNED_INT_10_10_10_2 ||
+ srcType == GL_UNSIGNED_INT_2_10_10_10_REV ||
+ srcType == GL_UNSIGNED_INT_5_9_9_9_REV ||
+ srcType == GL_UNSIGNED_INT_10F_11F_11F_REV);
+
+ get_component_mapping(srcFormat,
+ &rSrc, &gSrc, &bSrc, &aSrc,
+ &rDst, &gDst, &bDst, &aDst);
+
+ stride = _mesa_components_in_format(srcFormat);
+
+#define PROCESS(SRC_INDEX, DST_INDEX, DEFAULT, TYPE, CONVERSION) \
+ if ((SRC_INDEX) < 0) { \
+ GLuint i; \
+ for (i = 0; i < n; i++) { \
+ rgba[i][DST_INDEX] = DEFAULT; \
+ } \
+ } \
+ else if (swapBytes) { \
+ const TYPE *s = (const TYPE *) src; \
+ GLuint i; \
+ for (i = 0; i < n; i++) { \
+ TYPE value = s[SRC_INDEX]; \
+ if (sizeof(TYPE) == 2) { \
+ SWAP2BYTE(value); \
+ } \
+ else if (sizeof(TYPE) == 4) { \
+ SWAP4BYTE(value); \
+ } \
+ rgba[i][DST_INDEX] = CONVERSION(value); \
+ s += stride; \
+ } \
+ } \
+ else { \
+ const TYPE *s = (const TYPE *) src; \
+ GLuint i; \
+ for (i = 0; i < n; i++) { \
+ rgba[i][DST_INDEX] = CONVERSION(s[SRC_INDEX]); \
+ s += stride; \
+ } \
+ }
+
+ switch (srcType) {
+ case GL_UNSIGNED_BYTE:
+ PROCESS(rSrc, RCOMP, 0, GLubyte, (GLuint));
+ PROCESS(gSrc, GCOMP, 0, GLubyte, (GLuint));
+ PROCESS(bSrc, BCOMP, 0, GLubyte, (GLuint));
+ PROCESS(aSrc, ACOMP, 1, GLubyte, (GLuint));
+ break;
+ case GL_BYTE:
+ PROCESS(rSrc, RCOMP, 0, GLbyte, clamp_byte_to_uint);
+ PROCESS(gSrc, GCOMP, 0, GLbyte, clamp_byte_to_uint);
+ PROCESS(bSrc, BCOMP, 0, GLbyte, clamp_byte_to_uint);
+ PROCESS(aSrc, ACOMP, 1, GLbyte, clamp_byte_to_uint);
+ break;
+ case GL_UNSIGNED_SHORT:
+ PROCESS(rSrc, RCOMP, 0, GLushort, (GLuint));
+ PROCESS(gSrc, GCOMP, 0, GLushort, (GLuint));
+ PROCESS(bSrc, BCOMP, 0, GLushort, (GLuint));
+ PROCESS(aSrc, ACOMP, 1, GLushort, (GLuint));
+ break;
+ case GL_SHORT:
+ PROCESS(rSrc, RCOMP, 0, GLshort, clamp_short_to_uint);
+ PROCESS(gSrc, GCOMP, 0, GLshort, clamp_short_to_uint);
+ PROCESS(bSrc, BCOMP, 0, GLshort, clamp_short_to_uint);
+ PROCESS(aSrc, ACOMP, 1, GLshort, clamp_short_to_uint);
+ break;
+ case GL_UNSIGNED_INT:
+ PROCESS(rSrc, RCOMP, 0, GLuint, (GLuint));
+ PROCESS(gSrc, GCOMP, 0, GLuint, (GLuint));
+ PROCESS(bSrc, BCOMP, 0, GLuint, (GLuint));
+ PROCESS(aSrc, ACOMP, 1, GLuint, (GLuint));
+ break;
+ case GL_INT:
+ PROCESS(rSrc, RCOMP, 0, GLint, clamp_int_to_uint);
+ PROCESS(gSrc, GCOMP, 0, GLint, clamp_int_to_uint);
+ PROCESS(bSrc, BCOMP, 0, GLint, clamp_int_to_uint);
+ PROCESS(aSrc, ACOMP, 1, GLint, clamp_int_to_uint);
+ break;
+ case GL_FLOAT:
+ PROCESS(rSrc, RCOMP, 0, GLfloat, clamp_float_to_uint);
+ PROCESS(gSrc, GCOMP, 0, GLfloat, clamp_float_to_uint);
+ PROCESS(bSrc, BCOMP, 0, GLfloat, clamp_float_to_uint);
+ PROCESS(aSrc, ACOMP, 1, GLfloat, clamp_float_to_uint);
+ break;
+ case GL_HALF_FLOAT_ARB:
+ PROCESS(rSrc, RCOMP, 0, GLhalfARB, clamp_half_to_uint);
+ PROCESS(gSrc, GCOMP, 0, GLhalfARB, clamp_half_to_uint);
+ PROCESS(bSrc, BCOMP, 0, GLhalfARB, clamp_half_to_uint);
+ PROCESS(aSrc, ACOMP, 1, GLhalfARB, clamp_half_to_uint);
+ break;
+ case GL_UNSIGNED_BYTE_3_3_2:
+ {
+ const GLubyte *ubsrc = (const GLubyte *) src;
+ GLuint i;
+ for (i = 0; i < n; i ++) {
+ GLubyte p = ubsrc[i];
+ rgba[i][rDst] = ((p >> 5) );
+ rgba[i][gDst] = ((p >> 2) & 0x7);
+ rgba[i][bDst] = ((p ) & 0x3);
+ rgba[i][aDst] = 1;
+ }
+ }
+ break;
+ case GL_UNSIGNED_BYTE_2_3_3_REV:
+ {
+ const GLubyte *ubsrc = (const GLubyte *) src;
+ GLuint i;
+ for (i = 0; i < n; i ++) {
+ GLubyte p = ubsrc[i];
+ rgba[i][rDst] = ((p ) & 0x7);
+ rgba[i][gDst] = ((p >> 3) & 0x7);
+ rgba[i][bDst] = ((p >> 6) );
+ rgba[i][aDst] = 1;
+ }
+ }
+ break;
+ case GL_UNSIGNED_SHORT_5_6_5:
+ if (swapBytes) {
+ const GLushort *ussrc = (const GLushort *) src;
+ GLuint i;
+ for (i = 0; i < n; i ++) {
+ GLushort p = ussrc[i];
+ SWAP2BYTE(p);
+ rgba[i][rDst] = ((p >> 11) );
+ rgba[i][gDst] = ((p >> 5) & 0x3f);
+ rgba[i][bDst] = ((p ) & 0x1f);
+ rgba[i][aDst] = 1;
+ }
+ }
+ else {
+ const GLushort *ussrc = (const GLushort *) src;
+ GLuint i;
+ for (i = 0; i < n; i ++) {
+ GLushort p = ussrc[i];
+ rgba[i][rDst] = ((p >> 11) );
+ rgba[i][gDst] = ((p >> 5) & 0x3f);
+ rgba[i][bDst] = ((p ) & 0x1f);
+ rgba[i][aDst] = 1;
+ }
+ }
+ break;
+ case GL_UNSIGNED_SHORT_5_6_5_REV:
+ if (swapBytes) {
+ const GLushort *ussrc = (const GLushort *) src;
+ GLuint i;
+ for (i = 0; i < n; i ++) {
+ GLushort p = ussrc[i];
+ SWAP2BYTE(p);
+ rgba[i][rDst] = ((p ) & 0x1f);
+ rgba[i][gDst] = ((p >> 5) & 0x3f);
+ rgba[i][bDst] = ((p >> 11) );
+ rgba[i][aDst] = 1;
+ }
+ }
+ else {
+ const GLushort *ussrc = (const GLushort *) src;
+ GLuint i;
+ for (i = 0; i < n; i ++) {
+ GLushort p = ussrc[i];
+ rgba[i][rDst] = ((p ) & 0x1f);
+ rgba[i][gDst] = ((p >> 5) & 0x3f);
+ rgba[i][bDst] = ((p >> 11) );
+ rgba[i][aDst] = 1;
+ }
+ }
+ break;
+ case GL_UNSIGNED_SHORT_4_4_4_4:
+ if (swapBytes) {
+ const GLushort *ussrc = (const GLushort *) src;
+ GLuint i;
+ for (i = 0; i < n; i ++) {
+ GLushort p = ussrc[i];
+ SWAP2BYTE(p);
+ rgba[i][rDst] = ((p >> 12) );
+ rgba[i][gDst] = ((p >> 8) & 0xf);
+ rgba[i][bDst] = ((p >> 4) & 0xf);
+ rgba[i][aDst] = ((p ) & 0xf);
+ }
+ }
+ else {
+ const GLushort *ussrc = (const GLushort *) src;
+ GLuint i;
+ for (i = 0; i < n; i ++) {
+ GLushort p = ussrc[i];
+ rgba[i][rDst] = ((p >> 12) );
+ rgba[i][gDst] = ((p >> 8) & 0xf);
+ rgba[i][bDst] = ((p >> 4) & 0xf);
+ rgba[i][aDst] = ((p ) & 0xf);
+ }
+ }
+ break;
+ case GL_UNSIGNED_SHORT_4_4_4_4_REV:
+ if (swapBytes) {
+ const GLushort *ussrc = (const GLushort *) src;
+ GLuint i;
+ for (i = 0; i < n; i ++) {
+ GLushort p = ussrc[i];
+ SWAP2BYTE(p);
+ rgba[i][rDst] = ((p ) & 0xf);
+ rgba[i][gDst] = ((p >> 4) & 0xf);
+ rgba[i][bDst] = ((p >> 8) & 0xf);
+ rgba[i][aDst] = ((p >> 12) );
+ }
+ }
+ else {
+ const GLushort *ussrc = (const GLushort *) src;
+ GLuint i;
+ for (i = 0; i < n; i ++) {
+ GLushort p = ussrc[i];
+ rgba[i][rDst] = ((p ) & 0xf);
+ rgba[i][gDst] = ((p >> 4) & 0xf);
+ rgba[i][bDst] = ((p >> 8) & 0xf);
+ rgba[i][aDst] = ((p >> 12) );
+ }
+ }
+ break;
+ case GL_UNSIGNED_SHORT_5_5_5_1:
+ if (swapBytes) {
+ const GLushort *ussrc = (const GLushort *) src;
+ GLuint i;
+ for (i = 0; i < n; i ++) {
+ GLushort p = ussrc[i];
+ SWAP2BYTE(p);
+ rgba[i][rDst] = ((p >> 11) );
+ rgba[i][gDst] = ((p >> 6) & 0x1f);
+ rgba[i][bDst] = ((p >> 1) & 0x1f);
+ rgba[i][aDst] = ((p ) & 0x1 );
+ }
+ }
+ else {
+ const GLushort *ussrc = (const GLushort *) src;
+ GLuint i;
+ for (i = 0; i < n; i ++) {
+ GLushort p = ussrc[i];
+ rgba[i][rDst] = ((p >> 11) );
+ rgba[i][gDst] = ((p >> 6) & 0x1f);
+ rgba[i][bDst] = ((p >> 1) & 0x1f);
+ rgba[i][aDst] = ((p ) & 0x1 );
+ }
+ }
+ break;
+ case GL_UNSIGNED_SHORT_1_5_5_5_REV:
+ if (swapBytes) {
+ const GLushort *ussrc = (const GLushort *) src;
+ GLuint i;
+ for (i = 0; i < n; i ++) {
+ GLushort p = ussrc[i];
+ SWAP2BYTE(p);
+ rgba[i][rDst] = ((p ) & 0x1f);
+ rgba[i][gDst] = ((p >> 5) & 0x1f);
+ rgba[i][bDst] = ((p >> 10) & 0x1f);
+ rgba[i][aDst] = ((p >> 15) );
+ }
+ }
+ else {
+ const GLushort *ussrc = (const GLushort *) src;
+ GLuint i;
+ for (i = 0; i < n; i ++) {
+ GLushort p = ussrc[i];
+ rgba[i][rDst] = ((p ) & 0x1f);
+ rgba[i][gDst] = ((p >> 5) & 0x1f);
+ rgba[i][bDst] = ((p >> 10) & 0x1f);
+ rgba[i][aDst] = ((p >> 15) );
+ }
+ }
+ break;
+ case GL_UNSIGNED_INT_8_8_8_8:
+ if (swapBytes) {
+ const GLuint *uisrc = (const GLuint *) src;
+ GLuint i;
+ for (i = 0; i < n; i ++) {
+ GLuint p = uisrc[i];
+ rgba[i][rDst] = ((p ) & 0xff);
+ rgba[i][gDst] = ((p >> 8) & 0xff);
+ rgba[i][bDst] = ((p >> 16) & 0xff);
+ rgba[i][aDst] = ((p >> 24) );
+ }
+ }
+ else {
+ const GLuint *uisrc = (const GLuint *) src;
+ GLuint i;
+ for (i = 0; i < n; i ++) {
+ GLuint p = uisrc[i];
+ rgba[i][rDst] = ((p >> 24) );
+ rgba[i][gDst] = ((p >> 16) & 0xff);
+ rgba[i][bDst] = ((p >> 8) & 0xff);
+ rgba[i][aDst] = ((p ) & 0xff);
+ }
+ }
+ break;
+ case GL_UNSIGNED_INT_8_8_8_8_REV:
+ if (swapBytes) {
+ const GLuint *uisrc = (const GLuint *) src;
+ GLuint i;
+ for (i = 0; i < n; i ++) {
+ GLuint p = uisrc[i];
+ rgba[i][rDst] = ((p >> 24) );
+ rgba[i][gDst] = ((p >> 16) & 0xff);
+ rgba[i][bDst] = ((p >> 8) & 0xff);
+ rgba[i][aDst] = ((p ) & 0xff);
+ }
+ }
+ else {
+ const GLuint *uisrc = (const GLuint *) src;
+ GLuint i;
+ for (i = 0; i < n; i ++) {
+ GLuint p = uisrc[i];
+ rgba[i][rDst] = ((p ) & 0xff);
+ rgba[i][gDst] = ((p >> 8) & 0xff);
+ rgba[i][bDst] = ((p >> 16) & 0xff);
+ rgba[i][aDst] = ((p >> 24) );
+ }
+ }
+ break;
+ case GL_UNSIGNED_INT_10_10_10_2:
+ if (swapBytes) {
+ const GLuint *uisrc = (const GLuint *) src;
+ GLuint i;
+ for (i = 0; i < n; i ++) {
+ GLuint p = uisrc[i];
+ SWAP4BYTE(p);
+ rgba[i][rDst] = ((p >> 22) );
+ rgba[i][gDst] = ((p >> 12) & 0x3ff);
+ rgba[i][bDst] = ((p >> 2) & 0x3ff);
+ rgba[i][aDst] = ((p ) & 0x3 );
+ }
+ }
+ else {
+ const GLuint *uisrc = (const GLuint *) src;
+ GLuint i;
+ for (i = 0; i < n; i ++) {
+ GLuint p = uisrc[i];
+ rgba[i][rDst] = ((p >> 22) );
+ rgba[i][gDst] = ((p >> 12) & 0x3ff);
+ rgba[i][bDst] = ((p >> 2) & 0x3ff);
+ rgba[i][aDst] = ((p ) & 0x3 );
+ }
+ }
+ break;
+ case GL_UNSIGNED_INT_2_10_10_10_REV:
+ if (swapBytes) {
+ const GLuint *uisrc = (const GLuint *) src;
+ GLuint i;
+ for (i = 0; i < n; i ++) {
+ GLuint p = uisrc[i];
+ SWAP4BYTE(p);
+ rgba[i][rDst] = ((p ) & 0x3ff);
+ rgba[i][gDst] = ((p >> 10) & 0x3ff);
+ rgba[i][bDst] = ((p >> 20) & 0x3ff);
+ rgba[i][aDst] = ((p >> 30) );
+ }
+ }
+ else {
+ const GLuint *uisrc = (const GLuint *) src;
+ GLuint i;
+ for (i = 0; i < n; i ++) {
+ GLuint p = uisrc[i];
+ rgba[i][rDst] = ((p ) & 0x3ff);
+ rgba[i][gDst] = ((p >> 10) & 0x3ff);
+ rgba[i][bDst] = ((p >> 20) & 0x3ff);
+ rgba[i][aDst] = ((p >> 30) );
+ }
+ }
+ break;
+ case GL_UNSIGNED_INT_5_9_9_9_REV:
+ if (swapBytes) {
+ const GLuint *uisrc = (const GLuint *) src;
+ GLuint i;
+ float f[3];
+ for (i = 0; i < n; i ++) {
+ GLuint p = uisrc[i];
+ SWAP4BYTE(p);
+ rgb9e5_to_float3(p, f);
+ rgba[i][rDst] = clamp_float_to_uint(f[0]);
+ rgba[i][gDst] = clamp_float_to_uint(f[1]);
+ rgba[i][bDst] = clamp_float_to_uint(f[2]);
+ rgba[i][aDst] = 1;
+ }
+ }
+ else {
+ const GLuint *uisrc = (const GLuint *) src;
+ GLuint i;
+ float f[3];
+ for (i = 0; i < n; i ++) {
+ GLuint p = uisrc[i];
+ rgb9e5_to_float3(p, f);
+ rgba[i][rDst] = clamp_float_to_uint(f[0]);
+ rgba[i][gDst] = clamp_float_to_uint(f[1]);
+ rgba[i][bDst] = clamp_float_to_uint(f[2]);
+ rgba[i][aDst] = 1;
+ }
+ }
+ break;
+ case GL_UNSIGNED_INT_10F_11F_11F_REV:
+ if (swapBytes) {
+ const GLuint *uisrc = (const GLuint *) src;
+ GLuint i;
+ float f[3];
+ for (i = 0; i < n; i ++) {
+ GLuint p = uisrc[i];
+ SWAP4BYTE(p);
+ r11g11b10f_to_float3(p, f);
+ rgba[i][rDst] = clamp_float_to_uint(f[0]);
+ rgba[i][gDst] = clamp_float_to_uint(f[1]);
+ rgba[i][bDst] = clamp_float_to_uint(f[2]);
+ rgba[i][aDst] = 1;
+ }
+ }
+ else {
+ const GLuint *uisrc = (const GLuint *) src;
+ GLuint i;
+ float f[3];
+ for (i = 0; i < n; i ++) {
+ GLuint p = uisrc[i];
+ r11g11b10f_to_float3(p, f);
+ rgba[i][rDst] = clamp_float_to_uint(f[0]);
+ rgba[i][gDst] = clamp_float_to_uint(f[1]);
+ rgba[i][bDst] = clamp_float_to_uint(f[2]);
+ rgba[i][aDst] = 1;
+ }
+ }
+ break;
+ default:
+ _mesa_problem(NULL, "bad srcType in extract uint data");
+ break;
+ }
+#undef PROCESS
+}
+
+
+
+/*
+ * Unpack a row of color image data from a client buffer according to
+ * the pixel unpacking parameters.
+ * Return GLchan values in the specified dest image format.
+ * This is used by glDrawPixels and glTexImage?D().
+ * \param ctx - the context
+ * n - number of pixels in the span
+ * dstFormat - format of destination color array
+ * dest - the destination color array
+ * srcFormat - source image format
+ * srcType - source image data type
+ * source - source image pointer
+ * srcPacking - pixel unpacking parameters
+ * transferOps - bitmask of IMAGE_*_BIT values of operations to apply
+ *
+ * XXX perhaps expand this to process whole images someday.
+ */
+void
+_mesa_unpack_color_span_chan( struct gl_context *ctx,
+ GLuint n, GLenum dstFormat, GLchan dest[],
+ GLenum srcFormat, GLenum srcType,
+ const GLvoid *source,
+ const struct gl_pixelstore_attrib *srcPacking,
+ GLbitfield transferOps )
+{
+ ASSERT(dstFormat == GL_ALPHA ||
+ dstFormat == GL_LUMINANCE ||
+ dstFormat == GL_LUMINANCE_ALPHA ||
+ dstFormat == GL_INTENSITY ||
+ dstFormat == GL_RED ||
+ dstFormat == GL_RG ||
+ dstFormat == GL_RGB ||
+ dstFormat == GL_RGBA ||
+ dstFormat == GL_COLOR_INDEX);
+
+ ASSERT(srcFormat == GL_RED ||
+ srcFormat == GL_GREEN ||
+ srcFormat == GL_BLUE ||
+ srcFormat == GL_ALPHA ||
+ srcFormat == GL_LUMINANCE ||
+ srcFormat == GL_LUMINANCE_ALPHA ||
+ srcFormat == GL_INTENSITY ||
+ srcFormat == GL_RG ||
+ srcFormat == GL_RGB ||
+ srcFormat == GL_BGR ||
+ srcFormat == GL_RGBA ||
+ srcFormat == GL_BGRA ||
+ srcFormat == GL_ABGR_EXT ||
+ srcFormat == GL_COLOR_INDEX);
+
+ ASSERT(srcType == GL_BITMAP ||
+ srcType == GL_UNSIGNED_BYTE ||
+ srcType == GL_BYTE ||
+ srcType == GL_UNSIGNED_SHORT ||
+ srcType == GL_SHORT ||
+ srcType == GL_UNSIGNED_INT ||
+ srcType == GL_INT ||
+ srcType == GL_HALF_FLOAT_ARB ||
+ srcType == GL_FLOAT ||
+ srcType == GL_UNSIGNED_BYTE_3_3_2 ||
+ srcType == GL_UNSIGNED_BYTE_2_3_3_REV ||
+ srcType == GL_UNSIGNED_SHORT_5_6_5 ||
+ srcType == GL_UNSIGNED_SHORT_5_6_5_REV ||
+ srcType == GL_UNSIGNED_SHORT_4_4_4_4 ||
+ srcType == GL_UNSIGNED_SHORT_4_4_4_4_REV ||
+ srcType == GL_UNSIGNED_SHORT_5_5_5_1 ||
+ srcType == GL_UNSIGNED_SHORT_1_5_5_5_REV ||
+ srcType == GL_UNSIGNED_INT_8_8_8_8 ||
+ srcType == GL_UNSIGNED_INT_8_8_8_8_REV ||
+ srcType == GL_UNSIGNED_INT_10_10_10_2 ||
+ srcType == GL_UNSIGNED_INT_2_10_10_10_REV ||
+ srcType == GL_UNSIGNED_INT_5_9_9_9_REV ||
+ srcType == GL_UNSIGNED_INT_10F_11F_11F_REV);
+
+ /* Try simple cases first */
+ if (transferOps == 0) {
+ if (srcType == CHAN_TYPE) {
+ if (dstFormat == GL_RGBA) {
+ if (srcFormat == GL_RGBA) {
+ memcpy( dest, source, n * 4 * sizeof(GLchan) );
+ return;
+ }
+ else if (srcFormat == GL_RGB) {
+ GLuint i;
+ const GLchan *src = (const GLchan *) source;
+ GLchan *dst = dest;
+ for (i = 0; i < n; i++) {
+ dst[0] = src[0];
+ dst[1] = src[1];
+ dst[2] = src[2];
+ dst[3] = CHAN_MAX;
+ src += 3;
+ dst += 4;
+ }
+ return;
+ }
+ }
+ else if (dstFormat == GL_RGB) {
+ if (srcFormat == GL_RGB) {
+ memcpy( dest, source, n * 3 * sizeof(GLchan) );
+ return;
+ }
+ else if (srcFormat == GL_RGBA) {
+ GLuint i;
+ const GLchan *src = (const GLchan *) source;
+ GLchan *dst = dest;
+ for (i = 0; i < n; i++) {
+ dst[0] = src[0];
+ dst[1] = src[1];
+ dst[2] = src[2];
+ src += 4;
+ dst += 3;
+ }
+ return;
+ }
+ }
+ else if (dstFormat == srcFormat) {
+ GLint comps = _mesa_components_in_format(srcFormat);
+ assert(comps > 0);
+ memcpy( dest, source, n * comps * sizeof(GLchan) );
+ return;
+ }
+ }
+ /*
+ * Common situation, loading 8bit RGBA/RGB source images
+ * into 16/32 bit destination. (OSMesa16/32)
+ */
+ else if (srcType == GL_UNSIGNED_BYTE) {
+ if (dstFormat == GL_RGBA) {
+ if (srcFormat == GL_RGB) {
+ GLuint i;
+ const GLubyte *src = (const GLubyte *) source;
+ GLchan *dst = dest;
+ for (i = 0; i < n; i++) {
+ dst[0] = UBYTE_TO_CHAN(src[0]);
+ dst[1] = UBYTE_TO_CHAN(src[1]);
+ dst[2] = UBYTE_TO_CHAN(src[2]);
+ dst[3] = CHAN_MAX;
+ src += 3;
+ dst += 4;
+ }
+ return;
+ }
+ else if (srcFormat == GL_RGBA) {
+ GLuint i;
+ const GLubyte *src = (const GLubyte *) source;
+ GLchan *dst = dest;
+ for (i = 0; i < n; i++) {
+ dst[0] = UBYTE_TO_CHAN(src[0]);
+ dst[1] = UBYTE_TO_CHAN(src[1]);
+ dst[2] = UBYTE_TO_CHAN(src[2]);
+ dst[3] = UBYTE_TO_CHAN(src[3]);
+ src += 4;
+ dst += 4;
+ }
+ return;
+ }
+ }
+ else if (dstFormat == GL_RGB) {
+ if (srcFormat == GL_RGB) {
+ GLuint i;
+ const GLubyte *src = (const GLubyte *) source;
+ GLchan *dst = dest;
+ for (i = 0; i < n; i++) {
+ dst[0] = UBYTE_TO_CHAN(src[0]);
+ dst[1] = UBYTE_TO_CHAN(src[1]);
+ dst[2] = UBYTE_TO_CHAN(src[2]);
+ src += 3;
+ dst += 3;
+ }
+ return;
+ }
+ else if (srcFormat == GL_RGBA) {
+ GLuint i;
+ const GLubyte *src = (const GLubyte *) source;
+ GLchan *dst = dest;
+ for (i = 0; i < n; i++) {
+ dst[0] = UBYTE_TO_CHAN(src[0]);
+ dst[1] = UBYTE_TO_CHAN(src[1]);
+ dst[2] = UBYTE_TO_CHAN(src[2]);
+ src += 4;
+ dst += 3;
+ }
+ return;
+ }
+ }
+ }
+ }
+
+
+ /* general solution begins here */
+ {
+ GLint dstComponents;
+ GLint rDst, gDst, bDst, aDst, lDst, iDst;
+ GLfloat (*rgba)[4] = (GLfloat (*)[4]) malloc(4 * n * sizeof(GLfloat));
+
+ if (!rgba) {
+ _mesa_error(ctx, GL_OUT_OF_MEMORY, "pixel unpacking");
+ return;
+ }
+
+ dstComponents = _mesa_components_in_format( dstFormat );
+ /* source & dest image formats should have been error checked by now */
+ assert(dstComponents > 0);
+
+ /*
+ * Extract image data and convert to RGBA floats
+ */
+ if (srcFormat == GL_COLOR_INDEX) {
+ GLuint *indexes = (GLuint *) malloc(n * sizeof(GLuint));
+
+ if (!indexes) {
+ _mesa_error(ctx, GL_OUT_OF_MEMORY, "pixel unpacking");
+ return;
+ }
+
+ extract_uint_indexes(n, indexes, srcFormat, srcType, source,
+ srcPacking);
+
+ if (dstFormat == GL_COLOR_INDEX) {
+ GLuint i;
+ _mesa_apply_ci_transfer_ops(ctx, transferOps, n, indexes);
+ /* convert to GLchan and return */
+ for (i = 0; i < n; i++) {
+ dest[i] = (GLchan) (indexes[i] & 0xff);
+ }
+ free(indexes);
+ free(rgba);
+ return;
+ }
+ else {
+ /* Convert indexes to RGBA */
+ if (transferOps & IMAGE_SHIFT_OFFSET_BIT) {
+ _mesa_shift_and_offset_ci(ctx, n, indexes);
+ }
+ _mesa_map_ci_to_rgba(ctx, n, indexes, rgba);
+ }
+
+ /* Don't do RGBA scale/bias or RGBA->RGBA mapping if starting
+ * with color indexes.
+ */
+ transferOps &= ~(IMAGE_SCALE_BIAS_BIT | IMAGE_MAP_COLOR_BIT);
+
+ free(indexes);
+ }
+ else {
+ /* non-color index data */
+ extract_float_rgba(n, rgba, srcFormat, srcType, source,
+ srcPacking->SwapBytes);
+ }
+
+ /* Need to clamp if returning GLubytes or GLushorts */
+#if CHAN_TYPE != GL_FLOAT
+ transferOps |= IMAGE_CLAMP_BIT;
+#endif
+
+ if (transferOps) {
+ _mesa_apply_rgba_transfer_ops(ctx, transferOps, n, rgba);
+ }
+
+ get_component_indexes(dstFormat,
+ &rDst, &gDst, &bDst, &aDst, &lDst, &iDst);
+
+ /* Now return the GLchan data in the requested dstFormat */
+ if (rDst >= 0) {
+ GLchan *dst = dest;
+ GLuint i;
+ for (i = 0; i < n; i++) {
+ CLAMPED_FLOAT_TO_CHAN(dst[rDst], rgba[i][RCOMP]);
+ dst += dstComponents;
+ }
+ }
+
+ if (gDst >= 0) {
+ GLchan *dst = dest;
+ GLuint i;
+ for (i = 0; i < n; i++) {
+ CLAMPED_FLOAT_TO_CHAN(dst[gDst], rgba[i][GCOMP]);
+ dst += dstComponents;
+ }
+ }
+
+ if (bDst >= 0) {
+ GLchan *dst = dest;
+ GLuint i;
+ for (i = 0; i < n; i++) {
+ CLAMPED_FLOAT_TO_CHAN(dst[bDst], rgba[i][BCOMP]);
+ dst += dstComponents;
+ }
+ }
+
+ if (aDst >= 0) {
+ GLchan *dst = dest;
+ GLuint i;
+ for (i = 0; i < n; i++) {
+ CLAMPED_FLOAT_TO_CHAN(dst[aDst], rgba[i][ACOMP]);
+ dst += dstComponents;
+ }
+ }
+
+ if (iDst >= 0) {
+ GLchan *dst = dest;
+ GLuint i;
+ assert(iDst == 0);
+ assert(dstComponents == 1);
+ for (i = 0; i < n; i++) {
+ /* Intensity comes from red channel */
+ CLAMPED_FLOAT_TO_CHAN(dst[i], rgba[i][RCOMP]);
+ }
+ }
+
+ if (lDst >= 0) {
+ GLchan *dst = dest;
+ GLuint i;
+ assert(lDst == 0);
+ for (i = 0; i < n; i++) {
+ /* Luminance comes from red channel */
+ CLAMPED_FLOAT_TO_CHAN(dst[0], rgba[i][RCOMP]);
+ dst += dstComponents;
+ }
+ }
+
+ free(rgba);
+ }
+}
+
+
+/**
+ * Same as _mesa_unpack_color_span_chan(), but return GLfloat data
+ * instead of GLchan.
+ */
+void
+_mesa_unpack_color_span_float( struct gl_context *ctx,
+ GLuint n, GLenum dstFormat, GLfloat dest[],
+ GLenum srcFormat, GLenum srcType,
+ const GLvoid *source,
+ const struct gl_pixelstore_attrib *srcPacking,
+ GLbitfield transferOps )
+{
+ ASSERT(dstFormat == GL_ALPHA ||
+ dstFormat == GL_LUMINANCE ||
+ dstFormat == GL_LUMINANCE_ALPHA ||
+ dstFormat == GL_INTENSITY ||
+ dstFormat == GL_RED ||
+ dstFormat == GL_RG ||
+ dstFormat == GL_RGB ||
+ dstFormat == GL_RGBA ||
+ dstFormat == GL_COLOR_INDEX);
+
+ ASSERT(srcFormat == GL_RED ||
+ srcFormat == GL_GREEN ||
+ srcFormat == GL_BLUE ||
+ srcFormat == GL_ALPHA ||
+ srcFormat == GL_LUMINANCE ||
+ srcFormat == GL_LUMINANCE_ALPHA ||
+ srcFormat == GL_INTENSITY ||
+ srcFormat == GL_RG ||
+ srcFormat == GL_RGB ||
+ srcFormat == GL_BGR ||
+ srcFormat == GL_RGBA ||
+ srcFormat == GL_BGRA ||
+ srcFormat == GL_ABGR_EXT ||
+ srcFormat == GL_RED_INTEGER_EXT ||
+ srcFormat == GL_GREEN_INTEGER_EXT ||
+ srcFormat == GL_BLUE_INTEGER_EXT ||
+ srcFormat == GL_ALPHA_INTEGER_EXT ||
+ srcFormat == GL_RGB_INTEGER_EXT ||
+ srcFormat == GL_RGBA_INTEGER_EXT ||
+ srcFormat == GL_BGR_INTEGER_EXT ||
+ srcFormat == GL_BGRA_INTEGER_EXT ||
+ srcFormat == GL_LUMINANCE_INTEGER_EXT ||
+ srcFormat == GL_LUMINANCE_ALPHA_INTEGER_EXT ||
+ srcFormat == GL_COLOR_INDEX);
+
+ ASSERT(srcType == GL_BITMAP ||
+ srcType == GL_UNSIGNED_BYTE ||
+ srcType == GL_BYTE ||
+ srcType == GL_UNSIGNED_SHORT ||
+ srcType == GL_SHORT ||
+ srcType == GL_UNSIGNED_INT ||
+ srcType == GL_INT ||
+ srcType == GL_HALF_FLOAT_ARB ||
+ srcType == GL_FLOAT ||
+ srcType == GL_UNSIGNED_BYTE_3_3_2 ||
+ srcType == GL_UNSIGNED_BYTE_2_3_3_REV ||
+ srcType == GL_UNSIGNED_SHORT_5_6_5 ||
+ srcType == GL_UNSIGNED_SHORT_5_6_5_REV ||
+ srcType == GL_UNSIGNED_SHORT_4_4_4_4 ||
+ srcType == GL_UNSIGNED_SHORT_4_4_4_4_REV ||
+ srcType == GL_UNSIGNED_SHORT_5_5_5_1 ||
+ srcType == GL_UNSIGNED_SHORT_1_5_5_5_REV ||
+ srcType == GL_UNSIGNED_INT_8_8_8_8 ||
+ srcType == GL_UNSIGNED_INT_8_8_8_8_REV ||
+ srcType == GL_UNSIGNED_INT_10_10_10_2 ||
+ srcType == GL_UNSIGNED_INT_2_10_10_10_REV ||
+ srcType == GL_UNSIGNED_INT_5_9_9_9_REV ||
+ srcType == GL_UNSIGNED_INT_10F_11F_11F_REV);
+
+ /* general solution, no special cases, yet */
+ {
+ GLint dstComponents;
+ GLint rDst, gDst, bDst, aDst, lDst, iDst;
+ GLfloat (*rgba)[4] = (GLfloat (*)[4]) malloc(4 * n * sizeof(GLfloat));
+
+ if (!rgba) {
+ _mesa_error(ctx, GL_OUT_OF_MEMORY, "pixel unpacking");
+ return;
+ }
+
+ dstComponents = _mesa_components_in_format( dstFormat );
+ /* source & dest image formats should have been error checked by now */
+ assert(dstComponents > 0);
+
+ /*
+ * Extract image data and convert to RGBA floats
+ */
+ if (srcFormat == GL_COLOR_INDEX) {
+ GLuint *indexes = (GLuint *) malloc(n * sizeof(GLuint));
+
+ if (!indexes) {
+ _mesa_error(ctx, GL_OUT_OF_MEMORY, "pixel unpacking");
+ free(rgba);
+ return;
+ }
+
+ extract_uint_indexes(n, indexes, srcFormat, srcType, source,
+ srcPacking);
+
+ if (dstFormat == GL_COLOR_INDEX) {
+ GLuint i;
+ _mesa_apply_ci_transfer_ops(ctx, transferOps, n, indexes);
+ /* convert to GLchan and return */
+ for (i = 0; i < n; i++) {
+ dest[i] = (GLchan) (indexes[i] & 0xff);
+ }
+ free(indexes);
+ free(rgba);
+ return;
+ }
+ else {
+ /* Convert indexes to RGBA */
+ if (transferOps & IMAGE_SHIFT_OFFSET_BIT) {
+ _mesa_shift_and_offset_ci(ctx, n, indexes);
+ }
+ _mesa_map_ci_to_rgba(ctx, n, indexes, rgba);
+ }
+
+ /* Don't do RGBA scale/bias or RGBA->RGBA mapping if starting
+ * with color indexes.
+ */
+ transferOps &= ~(IMAGE_SCALE_BIAS_BIT | IMAGE_MAP_COLOR_BIT);
+
+ free(indexes);
+ }
+ else {
+ /* non-color index data */
+ extract_float_rgba(n, rgba, srcFormat, srcType, source,
+ srcPacking->SwapBytes);
+ }
+
+ if (transferOps) {
+ _mesa_apply_rgba_transfer_ops(ctx, transferOps, n, rgba);
+ }
+
+ get_component_indexes(dstFormat,
+ &rDst, &gDst, &bDst, &aDst, &lDst, &iDst);
+
+ /* Now pack results in the requested dstFormat */
+ if (rDst >= 0) {
+ GLfloat *dst = dest;
+ GLuint i;
+ for (i = 0; i < n; i++) {
+ dst[rDst] = rgba[i][RCOMP];
+ dst += dstComponents;
+ }
+ }
+
+ if (gDst >= 0) {
+ GLfloat *dst = dest;
+ GLuint i;
+ for (i = 0; i < n; i++) {
+ dst[gDst] = rgba[i][GCOMP];
+ dst += dstComponents;
+ }
+ }
+
+ if (bDst >= 0) {
+ GLfloat *dst = dest;
+ GLuint i;
+ for (i = 0; i < n; i++) {
+ dst[bDst] = rgba[i][BCOMP];
+ dst += dstComponents;
+ }
+ }
+
+ if (aDst >= 0) {
+ GLfloat *dst = dest;
+ GLuint i;
+ for (i = 0; i < n; i++) {
+ dst[aDst] = rgba[i][ACOMP];
+ dst += dstComponents;
+ }
+ }
+
+ if (iDst >= 0) {
+ GLfloat *dst = dest;
+ GLuint i;
+ assert(iDst == 0);
+ assert(dstComponents == 1);
+ for (i = 0; i < n; i++) {
+ /* Intensity comes from red channel */
+ dst[i] = rgba[i][RCOMP];
+ }
+ }
+
+ if (lDst >= 0) {
+ GLfloat *dst = dest;
+ GLuint i;
+ assert(lDst == 0);
+ for (i = 0; i < n; i++) {
+ /* Luminance comes from red channel */
+ dst[0] = rgba[i][RCOMP];
+ dst += dstComponents;
+ }
+ }
+
+ free(rgba);
+ }
+}
+
+
+/**
+ * Same as _mesa_unpack_color_span_chan(), but return GLuint data
+ * instead of GLchan.
+ * No pixel transfer ops are applied.
+ */
+void
+_mesa_unpack_color_span_uint(struct gl_context *ctx,
+ GLuint n, GLenum dstFormat, GLuint *dest,
+ GLenum srcFormat, GLenum srcType,
+ const GLvoid *source,
+ const struct gl_pixelstore_attrib *srcPacking)
+{
+ GLuint (*rgba)[4] = (GLuint (*)[4]) malloc(n * 4 * sizeof(GLfloat));
+
+ if (!rgba) {
+ _mesa_error(ctx, GL_OUT_OF_MEMORY, "pixel unpacking");
+ return;
+ }
+
+ ASSERT(dstFormat == GL_ALPHA ||
+ dstFormat == GL_LUMINANCE ||
+ dstFormat == GL_LUMINANCE_ALPHA ||
+ dstFormat == GL_INTENSITY ||
+ dstFormat == GL_RED ||
+ dstFormat == GL_RG ||
+ dstFormat == GL_RGB ||
+ dstFormat == GL_RGBA);
+
+ ASSERT(srcFormat == GL_RED ||
+ srcFormat == GL_GREEN ||
+ srcFormat == GL_BLUE ||
+ srcFormat == GL_ALPHA ||
+ srcFormat == GL_LUMINANCE ||
+ srcFormat == GL_LUMINANCE_ALPHA ||
+ srcFormat == GL_INTENSITY ||
+ srcFormat == GL_RG ||
+ srcFormat == GL_RGB ||
+ srcFormat == GL_BGR ||
+ srcFormat == GL_RGBA ||
+ srcFormat == GL_BGRA ||
+ srcFormat == GL_ABGR_EXT ||
+ srcFormat == GL_RED_INTEGER_EXT ||
+ srcFormat == GL_GREEN_INTEGER_EXT ||
+ srcFormat == GL_BLUE_INTEGER_EXT ||
+ srcFormat == GL_ALPHA_INTEGER_EXT ||
+ srcFormat == GL_RGB_INTEGER_EXT ||
+ srcFormat == GL_RGBA_INTEGER_EXT ||
+ srcFormat == GL_BGR_INTEGER_EXT ||
+ srcFormat == GL_BGRA_INTEGER_EXT ||
+ srcFormat == GL_LUMINANCE_INTEGER_EXT ||
+ srcFormat == GL_LUMINANCE_ALPHA_INTEGER_EXT);
+
+ ASSERT(srcType == GL_UNSIGNED_BYTE ||
+ srcType == GL_BYTE ||
+ srcType == GL_UNSIGNED_SHORT ||
+ srcType == GL_SHORT ||
+ srcType == GL_UNSIGNED_INT ||
+ srcType == GL_INT ||
+ srcType == GL_HALF_FLOAT_ARB ||
+ srcType == GL_FLOAT ||
+ srcType == GL_UNSIGNED_BYTE_3_3_2 ||
+ srcType == GL_UNSIGNED_BYTE_2_3_3_REV ||
+ srcType == GL_UNSIGNED_SHORT_5_6_5 ||
+ srcType == GL_UNSIGNED_SHORT_5_6_5_REV ||
+ srcType == GL_UNSIGNED_SHORT_4_4_4_4 ||
+ srcType == GL_UNSIGNED_SHORT_4_4_4_4_REV ||
+ srcType == GL_UNSIGNED_SHORT_5_5_5_1 ||
+ srcType == GL_UNSIGNED_SHORT_1_5_5_5_REV ||
+ srcType == GL_UNSIGNED_INT_8_8_8_8 ||
+ srcType == GL_UNSIGNED_INT_8_8_8_8_REV ||
+ srcType == GL_UNSIGNED_INT_10_10_10_2 ||
+ srcType == GL_UNSIGNED_INT_2_10_10_10_REV ||
+ srcType == GL_UNSIGNED_INT_5_9_9_9_REV ||
+ srcType == GL_UNSIGNED_INT_10F_11F_11F_REV);
+
+
+ /* Extract image data as uint[4] pixels */
+ extract_uint_rgba(n, rgba, srcFormat, srcType, source,
+ srcPacking->SwapBytes);
+
+ if (dstFormat == GL_RGBA) {
+ /* simple case */
+ memcpy(dest, rgba, 4 * sizeof(GLuint) * n);
+ }
+ else {
+ /* general case */
+ GLint rDst, gDst, bDst, aDst, lDst, iDst;
+ GLint dstComponents = _mesa_components_in_format( dstFormat );
+
+ assert(dstComponents > 0);
+
+ get_component_indexes(dstFormat,
+ &rDst, &gDst, &bDst, &aDst, &lDst, &iDst);
+
+ /* Now pack values in the requested dest format */
+ if (rDst >= 0) {
+ GLuint *dst = dest;
+ GLuint i;
+ for (i = 0; i < n; i++) {
+ dst[rDst] = rgba[i][RCOMP];
+ dst += dstComponents;
+ }
+ }
+
+ if (gDst >= 0) {
+ GLuint *dst = dest;
+ GLuint i;
+ for (i = 0; i < n; i++) {
+ dst[gDst] = rgba[i][GCOMP];
+ dst += dstComponents;
+ }
+ }
+
+ if (bDst >= 0) {
+ GLuint *dst = dest;
+ GLuint i;
+ for (i = 0; i < n; i++) {
+ dst[bDst] = rgba[i][BCOMP];
+ dst += dstComponents;
+ }
+ }
+
+ if (aDst >= 0) {
+ GLuint *dst = dest;
+ GLuint i;
+ for (i = 0; i < n; i++) {
+ dst[aDst] = rgba[i][ACOMP];
+ dst += dstComponents;
+ }
+ }
+
+ if (iDst >= 0) {
+ GLuint *dst = dest;
+ GLuint i;
+ assert(iDst == 0);
+ assert(dstComponents == 1);
+ for (i = 0; i < n; i++) {
+ /* Intensity comes from red channel */
+ dst[i] = rgba[i][RCOMP];
+ }
+ }
+
+ if (lDst >= 0) {
+ GLuint *dst = dest;
+ GLuint i;
+ assert(lDst == 0);
+ for (i = 0; i < n; i++) {
+ /* Luminance comes from red channel */
+ dst[0] = rgba[i][RCOMP];
+ dst += dstComponents;
+ }
+ }
+ }
+
+ free(rgba);
+}
+
+
+
+/**
+ * Similar to _mesa_unpack_color_span_float(), but for dudv data instead of rgba,
+ * directly return GLbyte data, no transfer ops apply.
+ */
+void
+_mesa_unpack_dudv_span_byte( struct gl_context *ctx,
+ GLuint n, GLenum dstFormat, GLbyte dest[],
+ GLenum srcFormat, GLenum srcType,
+ const GLvoid *source,
+ const struct gl_pixelstore_attrib *srcPacking,
+ GLbitfield transferOps )
+{
+ ASSERT(dstFormat == GL_DUDV_ATI);
+ ASSERT(srcFormat == GL_DUDV_ATI ||
+ srcFormat == GL_DU8DV8_ATI);
+
+ ASSERT(srcType == GL_UNSIGNED_BYTE ||
+ srcType == GL_BYTE ||
+ srcType == GL_UNSIGNED_SHORT ||
+ srcType == GL_SHORT ||
+ srcType == GL_UNSIGNED_INT ||
+ srcType == GL_INT ||
+ srcType == GL_HALF_FLOAT_ARB ||
+ srcType == GL_FLOAT);
+
+ /* general solution */
+ {
+ GLint dstComponents;
+ GLbyte *dst = dest;
+ GLuint i;
+ GLfloat (*rgba)[4] = (GLfloat (*)[4]) malloc(4 * n * sizeof(GLfloat));
+
+ if (!rgba) {
+ _mesa_error(ctx, GL_OUT_OF_MEMORY, "pixel unpacking");
+ return;
+ }
+
+ dstComponents = _mesa_components_in_format( dstFormat );
+ /* source & dest image formats should have been error checked by now */
+ assert(dstComponents > 0);
+
+ /*
+ * Extract image data and convert to RGBA floats
+ */
+ extract_float_rgba(n, rgba, srcFormat, srcType, source,
+ srcPacking->SwapBytes);
+
+
+ /* Now determine which color channels we need to produce.
+ * And determine the dest index (offset) within each color tuple.
+ */
+
+ /* Now pack results in the requested dstFormat */
+ for (i = 0; i < n; i++) {
+ /* not sure - need clamp[-1,1] here? */
+ dst[0] = FLOAT_TO_BYTE(rgba[i][RCOMP]);
+ dst[1] = FLOAT_TO_BYTE(rgba[i][GCOMP]);
+ dst += dstComponents;
+ }
+
+ free(rgba);
+ }
+}
+
+/*
+ * Unpack a row of color index data from a client buffer according to
+ * the pixel unpacking parameters.
+ * This is (or will be) used by glDrawPixels, glTexImage[123]D, etc.
+ *
+ * Args: ctx - the context
+ * n - number of pixels
+ * dstType - destination data type
+ * dest - destination array
+ * srcType - source pixel type
+ * source - source data pointer
+ * srcPacking - pixel unpacking parameters
+ * transferOps - the pixel transfer operations to apply
+ */
+void
+_mesa_unpack_index_span( struct gl_context *ctx, GLuint n,
+ GLenum dstType, GLvoid *dest,
+ GLenum srcType, const GLvoid *source,
+ const struct gl_pixelstore_attrib *srcPacking,
+ GLbitfield transferOps )
+{
+ ASSERT(srcType == GL_BITMAP ||
+ srcType == GL_UNSIGNED_BYTE ||
+ srcType == GL_BYTE ||
+ srcType == GL_UNSIGNED_SHORT ||
+ srcType == GL_SHORT ||
+ srcType == GL_UNSIGNED_INT ||
+ srcType == GL_INT ||
+ srcType == GL_HALF_FLOAT_ARB ||
+ srcType == GL_FLOAT);
+
+ ASSERT(dstType == GL_UNSIGNED_BYTE ||
+ dstType == GL_UNSIGNED_SHORT ||
+ dstType == GL_UNSIGNED_INT);
+
+
+ transferOps &= (IMAGE_MAP_COLOR_BIT | IMAGE_SHIFT_OFFSET_BIT);
+
+ /*
+ * Try simple cases first
+ */
+ if (transferOps == 0 && srcType == GL_UNSIGNED_BYTE
+ && dstType == GL_UNSIGNED_BYTE) {
+ memcpy(dest, source, n * sizeof(GLubyte));
+ }
+ else if (transferOps == 0 && srcType == GL_UNSIGNED_INT
+ && dstType == GL_UNSIGNED_INT && !srcPacking->SwapBytes) {
+ memcpy(dest, source, n * sizeof(GLuint));
+ }
+ else {
+ /*
+ * general solution
+ */
+ GLuint *indexes = (GLuint *) malloc(n * sizeof(GLuint));
+
+ if (!indexes) {
+ _mesa_error(ctx, GL_OUT_OF_MEMORY, "pixel unpacking");
+ return;
+ }
+
+ extract_uint_indexes(n, indexes, GL_COLOR_INDEX, srcType, source,
+ srcPacking);
+
+ if (transferOps)
+ _mesa_apply_ci_transfer_ops(ctx, transferOps, n, indexes);
+
+ /* convert to dest type */
+ switch (dstType) {
+ case GL_UNSIGNED_BYTE:
+ {
+ GLubyte *dst = (GLubyte *) dest;
+ GLuint i;
+ for (i = 0; i < n; i++) {
+ dst[i] = (GLubyte) (indexes[i] & 0xff);
+ }
+ }
+ break;
+ case GL_UNSIGNED_SHORT:
+ {
+ GLuint *dst = (GLuint *) dest;
+ GLuint i;
+ for (i = 0; i < n; i++) {
+ dst[i] = (GLushort) (indexes[i] & 0xffff);
+ }
+ }
+ break;
+ case GL_UNSIGNED_INT:
+ memcpy(dest, indexes, n * sizeof(GLuint));
+ break;
+ default:
+ _mesa_problem(ctx, "bad dstType in _mesa_unpack_index_span");
+ }
+
+ free(indexes);
+ }
+}
+
+
+void
+_mesa_pack_index_span( struct gl_context *ctx, GLuint n,
+ GLenum dstType, GLvoid *dest, const GLuint *source,
+ const struct gl_pixelstore_attrib *dstPacking,
+ GLbitfield transferOps )
+{
+ GLuint *indexes = (GLuint *) malloc(n * sizeof(GLuint));
+
+ if (!indexes) {
+ _mesa_error(ctx, GL_OUT_OF_MEMORY, "pixel packing");
+ return;
+ }
+
+ transferOps &= (IMAGE_MAP_COLOR_BIT | IMAGE_SHIFT_OFFSET_BIT);
+
+ if (transferOps & (IMAGE_MAP_COLOR_BIT | IMAGE_SHIFT_OFFSET_BIT)) {
+ /* make a copy of input */
+ memcpy(indexes, source, n * sizeof(GLuint));
+ _mesa_apply_ci_transfer_ops(ctx, transferOps, n, indexes);
+ source = indexes;
+ }
+
+ switch (dstType) {
+ case GL_UNSIGNED_BYTE:
+ {
+ GLubyte *dst = (GLubyte *) dest;
+ GLuint i;
+ for (i = 0; i < n; i++) {
+ *dst++ = (GLubyte) source[i];
+ }
+ }
+ break;
+ case GL_BYTE:
+ {
+ GLbyte *dst = (GLbyte *) dest;
+ GLuint i;
+ for (i = 0; i < n; i++) {
+ dst[i] = (GLbyte) source[i];
+ }
+ }
+ break;
+ case GL_UNSIGNED_SHORT:
+ {
+ GLushort *dst = (GLushort *) dest;
+ GLuint i;
+ for (i = 0; i < n; i++) {
+ dst[i] = (GLushort) source[i];
+ }
+ if (dstPacking->SwapBytes) {
+ _mesa_swap2( (GLushort *) dst, n );
+ }
+ }
+ break;
+ case GL_SHORT:
+ {
+ GLshort *dst = (GLshort *) dest;
+ GLuint i;
+ for (i = 0; i < n; i++) {
+ dst[i] = (GLshort) source[i];
+ }
+ if (dstPacking->SwapBytes) {
+ _mesa_swap2( (GLushort *) dst, n );
+ }
+ }
+ break;
+ case GL_UNSIGNED_INT:
+ {
+ GLuint *dst = (GLuint *) dest;
+ GLuint i;
+ for (i = 0; i < n; i++) {
+ dst[i] = (GLuint) source[i];
+ }
+ if (dstPacking->SwapBytes) {
+ _mesa_swap4( (GLuint *) dst, n );
+ }
+ }
+ break;
+ case GL_INT:
+ {
+ GLint *dst = (GLint *) dest;
+ GLuint i;
+ for (i = 0; i < n; i++) {
+ dst[i] = (GLint) source[i];
+ }
+ if (dstPacking->SwapBytes) {
+ _mesa_swap4( (GLuint *) dst, n );
+ }
+ }
+ break;
+ case GL_FLOAT:
+ {
+ GLfloat *dst = (GLfloat *) dest;
+ GLuint i;
+ for (i = 0; i < n; i++) {
+ dst[i] = (GLfloat) source[i];
+ }
+ if (dstPacking->SwapBytes) {
+ _mesa_swap4( (GLuint *) dst, n );
+ }
+ }
+ break;
+ case GL_HALF_FLOAT_ARB:
+ {
+ GLhalfARB *dst = (GLhalfARB *) dest;
+ GLuint i;
+ for (i = 0; i < n; i++) {
+ dst[i] = _mesa_float_to_half((GLfloat) source[i]);
+ }
+ if (dstPacking->SwapBytes) {
+ _mesa_swap2( (GLushort *) dst, n );
+ }
+ }
+ break;
+ default:
+ _mesa_problem(ctx, "bad type in _mesa_pack_index_span");
+ }
+
+ free(indexes);
+}
+
+
+/*
+ * Unpack a row of stencil data from a client buffer according to
+ * the pixel unpacking parameters.
+ * This is (or will be) used by glDrawPixels
+ *
+ * Args: ctx - the context
+ * n - number of pixels
+ * dstType - destination data type
+ * dest - destination array
+ * srcType - source pixel type
+ * source - source data pointer
+ * srcPacking - pixel unpacking parameters
+ * transferOps - apply offset/bias/lookup ops?
+ */
+void
+_mesa_unpack_stencil_span( struct gl_context *ctx, GLuint n,
+ GLenum dstType, GLvoid *dest,
+ GLenum srcType, const GLvoid *source,
+ const struct gl_pixelstore_attrib *srcPacking,
+ GLbitfield transferOps )
+{
+ ASSERT(srcType == GL_BITMAP ||
+ srcType == GL_UNSIGNED_BYTE ||
+ srcType == GL_BYTE ||
+ srcType == GL_UNSIGNED_SHORT ||
+ srcType == GL_SHORT ||
+ srcType == GL_UNSIGNED_INT ||
+ srcType == GL_INT ||
+ srcType == GL_UNSIGNED_INT_24_8_EXT ||
+ srcType == GL_HALF_FLOAT_ARB ||
+ srcType == GL_FLOAT);
+
+ ASSERT(dstType == GL_UNSIGNED_BYTE ||
+ dstType == GL_UNSIGNED_SHORT ||
+ dstType == GL_UNSIGNED_INT);
+
+ /* only shift and offset apply to stencil */
+ transferOps &= IMAGE_SHIFT_OFFSET_BIT;
+
+ /*
+ * Try simple cases first
+ */
+ if (transferOps == 0 &&
+ !ctx->Pixel.MapStencilFlag &&
+ srcType == GL_UNSIGNED_BYTE &&
+ dstType == GL_UNSIGNED_BYTE) {
+ memcpy(dest, source, n * sizeof(GLubyte));
+ }
+ else if (transferOps == 0 &&
+ !ctx->Pixel.MapStencilFlag &&
+ srcType == GL_UNSIGNED_INT &&
+ dstType == GL_UNSIGNED_INT &&
+ !srcPacking->SwapBytes) {
+ memcpy(dest, source, n * sizeof(GLuint));
+ }
+ else {
+ /*
+ * general solution
+ */
+ GLuint *indexes = (GLuint *) malloc(n * sizeof(GLuint));
+
+ if (!indexes) {
+ _mesa_error(ctx, GL_OUT_OF_MEMORY, "stencil unpacking");
+ return;
+ }
+
+ extract_uint_indexes(n, indexes, GL_STENCIL_INDEX, srcType, source,
+ srcPacking);
+
+ if (transferOps & IMAGE_SHIFT_OFFSET_BIT) {
+ /* shift and offset indexes */
+ _mesa_shift_and_offset_ci(ctx, n, indexes);
+ }
+
+ if (ctx->Pixel.MapStencilFlag) {
+ /* Apply stencil lookup table */
+ const GLuint mask = ctx->PixelMaps.StoS.Size - 1;
+ GLuint i;
+ for (i = 0; i < n; i++) {
+ indexes[i] = (GLuint)ctx->PixelMaps.StoS.Map[ indexes[i] & mask ];
+ }
+ }
+
+ /* convert to dest type */
+ switch (dstType) {
+ case GL_UNSIGNED_BYTE:
+ {
+ GLubyte *dst = (GLubyte *) dest;
+ GLuint i;
+ for (i = 0; i < n; i++) {
+ dst[i] = (GLubyte) (indexes[i] & 0xff);
+ }
+ }
+ break;
+ case GL_UNSIGNED_SHORT:
+ {
+ GLuint *dst = (GLuint *) dest;
+ GLuint i;
+ for (i = 0; i < n; i++) {
+ dst[i] = (GLushort) (indexes[i] & 0xffff);
+ }
+ }
+ break;
+ case GL_UNSIGNED_INT:
+ memcpy(dest, indexes, n * sizeof(GLuint));
+ break;
+ default:
+ _mesa_problem(ctx, "bad dstType in _mesa_unpack_stencil_span");
+ }
+
+ free(indexes);
+ }
+}
+
+
+void
+_mesa_pack_stencil_span( struct gl_context *ctx, GLuint n,
+ GLenum dstType, GLvoid *dest, const GLstencil *source,
+ const struct gl_pixelstore_attrib *dstPacking )
+{
+ GLstencil *stencil = (GLstencil *) malloc(n * sizeof(GLstencil));
+
+ if (!stencil) {
+ _mesa_error(ctx, GL_OUT_OF_MEMORY, "stencil packing");
+ return;
+ }
+
+ if (ctx->Pixel.IndexShift || ctx->Pixel.IndexOffset ||
+ ctx->Pixel.MapStencilFlag) {
+ /* make a copy of input */
+ memcpy(stencil, source, n * sizeof(GLstencil));
+ _mesa_apply_stencil_transfer_ops(ctx, n, stencil);
+ source = stencil;
+ }
+
+ switch (dstType) {
+ case GL_UNSIGNED_BYTE:
+ if (sizeof(GLstencil) == 1) {
+ memcpy( dest, source, n );
+ }
+ else {
+ GLubyte *dst = (GLubyte *) dest;
+ GLuint i;
+ for (i=0;i<n;i++) {
+ dst[i] = (GLubyte) source[i];
+ }
+ }
+ break;
+ case GL_BYTE:
+ {
+ GLbyte *dst = (GLbyte *) dest;
+ GLuint i;
+ for (i=0;i<n;i++) {
+ dst[i] = (GLbyte) (source[i] & 0x7f);
+ }
+ }
+ break;
+ case GL_UNSIGNED_SHORT:
+ {
+ GLushort *dst = (GLushort *) dest;
+ GLuint i;
+ for (i=0;i<n;i++) {
+ dst[i] = (GLushort) source[i];
+ }
+ if (dstPacking->SwapBytes) {
+ _mesa_swap2( (GLushort *) dst, n );
+ }
+ }
+ break;
+ case GL_SHORT:
+ {
+ GLshort *dst = (GLshort *) dest;
+ GLuint i;
+ for (i=0;i<n;i++) {
+ dst[i] = (GLshort) source[i];
+ }
+ if (dstPacking->SwapBytes) {
+ _mesa_swap2( (GLushort *) dst, n );
+ }
+ }
+ break;
+ case GL_UNSIGNED_INT:
+ {
+ GLuint *dst = (GLuint *) dest;
+ GLuint i;
+ for (i=0;i<n;i++) {
+ dst[i] = (GLuint) source[i];
+ }
+ if (dstPacking->SwapBytes) {
+ _mesa_swap4( (GLuint *) dst, n );
+ }
+ }
+ break;
+ case GL_INT:
+ {
+ GLint *dst = (GLint *) dest;
+ GLuint i;
+ for (i=0;i<n;i++) {
+ dst[i] = (GLint) source[i];
+ }
+ if (dstPacking->SwapBytes) {
+ _mesa_swap4( (GLuint *) dst, n );
+ }
+ }
+ break;
+ case GL_FLOAT:
+ {
+ GLfloat *dst = (GLfloat *) dest;
+ GLuint i;
+ for (i=0;i<n;i++) {
+ dst[i] = (GLfloat) source[i];
+ }
+ if (dstPacking->SwapBytes) {
+ _mesa_swap4( (GLuint *) dst, n );
+ }
+ }
+ break;
+ case GL_HALF_FLOAT_ARB:
+ {
+ GLhalfARB *dst = (GLhalfARB *) dest;
+ GLuint i;
+ for (i=0;i<n;i++) {
+ dst[i] = _mesa_float_to_half( (float) source[i] );
+ }
+ if (dstPacking->SwapBytes) {
+ _mesa_swap2( (GLushort *) dst, n );
+ }
+ }
+ break;
+ case GL_BITMAP:
+ if (dstPacking->LsbFirst) {
+ GLubyte *dst = (GLubyte *) dest;
+ GLint shift = 0;
+ GLuint i;
+ for (i = 0; i < n; i++) {
+ if (shift == 0)
+ *dst = 0;
+ *dst |= ((source[i] != 0) << shift);
+ shift++;
+ if (shift == 8) {
+ shift = 0;
+ dst++;
+ }
+ }
+ }
+ else {
+ GLubyte *dst = (GLubyte *) dest;
+ GLint shift = 7;
+ GLuint i;
+ for (i = 0; i < n; i++) {
+ if (shift == 7)
+ *dst = 0;
+ *dst |= ((source[i] != 0) << shift);
+ shift--;
+ if (shift < 0) {
+ shift = 7;
+ dst++;
+ }
+ }
+ }
+ break;
+ default:
+ _mesa_problem(ctx, "bad type in _mesa_pack_index_span");
+ }
+
+ free(stencil);
+}
+
+#define DEPTH_VALUES(GLTYPE, GLTYPE2FLOAT) \
+ do { \
+ GLuint i; \
+ const GLTYPE *src = (const GLTYPE *)source; \
+ for (i = 0; i < n; i++) { \
+ GLTYPE value = src[i]; \
+ if (srcPacking->SwapBytes) { \
+ if (sizeof(GLTYPE) == 2) { \
+ SWAP2BYTE(value); \
+ } else if (sizeof(GLTYPE) == 4) { \
+ SWAP4BYTE(value); \
+ } \
+ } \
+ depthValues[i] = GLTYPE2FLOAT(value); \
+ } \
+ } while (0)
+
+
+/**
+ * Unpack a row of depth/z values from memory, returning GLushort, GLuint
+ * or GLfloat values.
+ * The glPixelTransfer (scale/bias) params will be applied.
+ *
+ * \param dstType one of GL_UNSIGNED_SHORT, GL_UNSIGNED_INT, GL_FLOAT
+ * \param depthMax max value for returned GLushort or GLuint values
+ * (ignored for GLfloat).
+ */
+void
+_mesa_unpack_depth_span( struct gl_context *ctx, GLuint n,
+ GLenum dstType, GLvoid *dest, GLuint depthMax,
+ GLenum srcType, const GLvoid *source,
+ const struct gl_pixelstore_attrib *srcPacking )
+{
+ GLfloat *depthTemp, *depthValues;
+ GLboolean needClamp = GL_FALSE;
+
+ /* Look for special cases first.
+ * Not only are these faster, they're less prone to numeric conversion
+ * problems. Otherwise, converting from an int type to a float then
+ * back to an int type can introduce errors that will show up as
+ * artifacts in things like depth peeling which uses glCopyTexImage.
+ */
+ if (ctx->Pixel.DepthScale == 1.0 && ctx->Pixel.DepthBias == 0.0) {
+ if (srcType == GL_UNSIGNED_INT && dstType == GL_UNSIGNED_SHORT) {
+ const GLuint *src = (const GLuint *) source;
+ GLushort *dst = (GLushort *) dest;
+ GLuint i;
+ for (i = 0; i < n; i++) {
+ dst[i] = src[i] >> 16;
+ }
+ return;
+ }
+ if (srcType == GL_UNSIGNED_SHORT
+ && dstType == GL_UNSIGNED_INT
+ && depthMax == 0xffffffff) {
+ const GLushort *src = (const GLushort *) source;
+ GLuint *dst = (GLuint *) dest;
+ GLuint i;
+ for (i = 0; i < n; i++) {
+ dst[i] = src[i] | (src[i] << 16);
+ }
+ return;
+ }
+ if (srcType == GL_UNSIGNED_INT_24_8
+ && dstType == GL_UNSIGNED_INT
+ && depthMax == 0xffffff) {
+ const GLuint *src = (const GLuint *) source;
+ GLuint *dst = (GLuint *) dest;
+ GLuint i;
+ for (i = 0; i < n; i++) {
+ dst[i] = src[i] >> 8;
+ }
+ return;
+ }
+ /* XXX may want to add additional cases here someday */
+ }
+
+ /* general case path follows */
+
+ depthTemp = (GLfloat *) malloc(n * sizeof(GLfloat));
+ if (!depthTemp) {
+ _mesa_error(ctx, GL_OUT_OF_MEMORY, "pixel unpacking");
+ return;
+ }
+
+ if (dstType == GL_FLOAT) {
+ depthValues = (GLfloat *) dest;
+ }
+ else {
+ depthValues = depthTemp;
+ }
+
+ /* Convert incoming values to GLfloat. Some conversions will require
+ * clamping, below.
+ */
+ switch (srcType) {
+ case GL_BYTE:
+ DEPTH_VALUES(GLbyte, BYTE_TO_FLOAT);
+ needClamp = GL_TRUE;
+ break;
+ case GL_UNSIGNED_BYTE:
+ DEPTH_VALUES(GLubyte, UBYTE_TO_FLOAT);
+ break;
+ case GL_SHORT:
+ DEPTH_VALUES(GLshort, SHORT_TO_FLOAT);
+ needClamp = GL_TRUE;
+ break;
+ case GL_UNSIGNED_SHORT:
+ DEPTH_VALUES(GLushort, USHORT_TO_FLOAT);
+ break;
+ case GL_INT:
+ DEPTH_VALUES(GLint, INT_TO_FLOAT);
+ needClamp = GL_TRUE;
+ break;
+ case GL_UNSIGNED_INT:
+ DEPTH_VALUES(GLuint, UINT_TO_FLOAT);
+ break;
+ case GL_UNSIGNED_INT_24_8_EXT: /* GL_EXT_packed_depth_stencil */
+ if (dstType == GL_UNSIGNED_INT_24_8_EXT &&
+ depthMax == 0xffffff &&
+ ctx->Pixel.DepthScale == 1.0 &&
+ ctx->Pixel.DepthBias == 0.0) {
+ const GLuint *src = (const GLuint *) source;
+ GLuint *zValues = (GLuint *) dest;
+ GLuint i;
+ for (i = 0; i < n; i++) {
+ GLuint value = src[i];
+ if (srcPacking->SwapBytes) {
+ SWAP4BYTE(value);
+ }
+ zValues[i] = value & 0xffffff00;
+ }
+ return;
+ }
+ else {
+ const GLuint *src = (const GLuint *) source;
+ const GLfloat scale = 1.0f / 0xffffff;
+ GLuint i;
+ for (i = 0; i < n; i++) {
+ GLuint value = src[i];
+ if (srcPacking->SwapBytes) {
+ SWAP4BYTE(value);
+ }
+ depthValues[i] = (value >> 8) * scale;
+ }
+ }
+ break;
+ case GL_FLOAT:
+ DEPTH_VALUES(GLfloat, 1*);
+ needClamp = GL_TRUE;
+ break;
+ case GL_HALF_FLOAT_ARB:
+ {
+ GLuint i;
+ const GLhalfARB *src = (const GLhalfARB *) source;
+ for (i = 0; i < n; i++) {
+ GLhalfARB value = src[i];
+ if (srcPacking->SwapBytes) {
+ SWAP2BYTE(value);
+ }
+ depthValues[i] = _mesa_half_to_float(value);
+ }
+ needClamp = GL_TRUE;
+ }
+ break;
+ default:
+ _mesa_problem(NULL, "bad type in _mesa_unpack_depth_span()");
+ free(depthTemp);
+ return;
+ }
+
+ /* apply depth scale and bias */
+ {
+ const GLfloat scale = ctx->Pixel.DepthScale;
+ const GLfloat bias = ctx->Pixel.DepthBias;
+ if (scale != 1.0 || bias != 0.0) {
+ GLuint i;
+ for (i = 0; i < n; i++) {
+ depthValues[i] = depthValues[i] * scale + bias;
+ }
+ needClamp = GL_TRUE;
+ }
+ }
+
+ /* clamp to [0, 1] */
+ if (needClamp) {
+ GLuint i;
+ for (i = 0; i < n; i++) {
+ depthValues[i] = (GLfloat)CLAMP(depthValues[i], 0.0, 1.0);
+ }
+ }
+
+ /*
+ * Convert values to dstType
+ */
+ if (dstType == GL_UNSIGNED_INT) {
+ GLuint *zValues = (GLuint *) dest;
+ GLuint i;
+ if (depthMax <= 0xffffff) {
+ /* no overflow worries */
+ for (i = 0; i < n; i++) {
+ zValues[i] = (GLuint) (depthValues[i] * (GLfloat) depthMax);
+ }
+ }
+ else {
+ /* need to use double precision to prevent overflow problems */
+ for (i = 0; i < n; i++) {
+ GLdouble z = depthValues[i] * (GLfloat) depthMax;
+ if (z >= (GLdouble) 0xffffffff)
+ zValues[i] = 0xffffffff;
+ else
+ zValues[i] = (GLuint) z;
+ }
+ }
+ }
+ else if (dstType == GL_UNSIGNED_SHORT) {
+ GLushort *zValues = (GLushort *) dest;
+ GLuint i;
+ ASSERT(depthMax <= 0xffff);
+ for (i = 0; i < n; i++) {
+ zValues[i] = (GLushort) (depthValues[i] * (GLfloat) depthMax);
+ }
+ }
+ else {
+ ASSERT(dstType == GL_FLOAT);
+ /*ASSERT(depthMax == 1.0F);*/
+ }
+
+ free(depthTemp);
+}
+
+
+/*
+ * Pack an array of depth values. The values are floats in [0,1].
+ */
+void
+_mesa_pack_depth_span( struct gl_context *ctx, GLuint n, GLvoid *dest,
+ GLenum dstType, const GLfloat *depthSpan,
+ const struct gl_pixelstore_attrib *dstPacking )
+{
+ GLfloat *depthCopy = (GLfloat *) malloc(n * sizeof(GLfloat));
+ if (!depthCopy) {
+ _mesa_error(ctx, GL_OUT_OF_MEMORY, "pixel packing");
+ return;
+ }
+
+ if (ctx->Pixel.DepthScale != 1.0 || ctx->Pixel.DepthBias != 0.0) {
+ memcpy(depthCopy, depthSpan, n * sizeof(GLfloat));
+ _mesa_scale_and_bias_depth(ctx, n, depthCopy);
+ depthSpan = depthCopy;
+ }
+
+ switch (dstType) {
+ case GL_UNSIGNED_BYTE:
+ {
+ GLubyte *dst = (GLubyte *) dest;
+ GLuint i;
+ for (i = 0; i < n; i++) {
+ dst[i] = FLOAT_TO_UBYTE( depthSpan[i] );
+ }
+ }
+ break;
+ case GL_BYTE:
+ {
+ GLbyte *dst = (GLbyte *) dest;
+ GLuint i;
+ for (i = 0; i < n; i++) {
+ dst[i] = FLOAT_TO_BYTE( depthSpan[i] );
+ }
+ }
+ break;
+ case GL_UNSIGNED_SHORT:
+ {
+ GLushort *dst = (GLushort *) dest;
+ GLuint i;
+ for (i = 0; i < n; i++) {
+ CLAMPED_FLOAT_TO_USHORT(dst[i], depthSpan[i]);
+ }
+ if (dstPacking->SwapBytes) {
+ _mesa_swap2( (GLushort *) dst, n );
+ }
+ }
+ break;
+ case GL_SHORT:
+ {
+ GLshort *dst = (GLshort *) dest;
+ GLuint i;
+ for (i = 0; i < n; i++) {
+ dst[i] = FLOAT_TO_SHORT( depthSpan[i] );
+ }
+ if (dstPacking->SwapBytes) {
+ _mesa_swap2( (GLushort *) dst, n );
+ }
+ }
+ break;
+ case GL_UNSIGNED_INT:
+ {
+ GLuint *dst = (GLuint *) dest;
+ GLuint i;
+ for (i = 0; i < n; i++) {
+ dst[i] = FLOAT_TO_UINT( depthSpan[i] );
+ }
+ if (dstPacking->SwapBytes) {
+ _mesa_swap4( (GLuint *) dst, n );
+ }
+ }
+ break;
+ case GL_INT:
+ {
+ GLint *dst = (GLint *) dest;
+ GLuint i;
+ for (i = 0; i < n; i++) {
+ dst[i] = FLOAT_TO_INT( depthSpan[i] );
+ }
+ if (dstPacking->SwapBytes) {
+ _mesa_swap4( (GLuint *) dst, n );
+ }
+ }
+ break;
+ case GL_FLOAT:
+ {
+ GLfloat *dst = (GLfloat *) dest;
+ GLuint i;
+ for (i = 0; i < n; i++) {
+ dst[i] = depthSpan[i];
+ }
+ if (dstPacking->SwapBytes) {
+ _mesa_swap4( (GLuint *) dst, n );
+ }
+ }
+ break;
+ case GL_HALF_FLOAT_ARB:
+ {
+ GLhalfARB *dst = (GLhalfARB *) dest;
+ GLuint i;
+ for (i = 0; i < n; i++) {
+ dst[i] = _mesa_float_to_half(depthSpan[i]);
+ }
+ if (dstPacking->SwapBytes) {
+ _mesa_swap2( (GLushort *) dst, n );
+ }
+ }
+ break;
+ default:
+ _mesa_problem(ctx, "bad type in _mesa_pack_depth_span");
+ }
+
+ free(depthCopy);
+}
+
+
+
+/**
+ * Pack depth and stencil values as GL_DEPTH_STENCIL/GL_UNSIGNED_INT_24_8.
+ */
+void
+_mesa_pack_depth_stencil_span(struct gl_context *ctx, GLuint n, GLuint *dest,
+ const GLfloat *depthVals,
+ const GLstencil *stencilVals,
+ const struct gl_pixelstore_attrib *dstPacking)
+{
+ GLfloat *depthCopy = (GLfloat *) malloc(n * sizeof(GLfloat));
+ GLstencil *stencilCopy = (GLstencil *) malloc(n * sizeof(GLstencil));
+ GLuint i;
+
+ if (!depthCopy || !stencilCopy) {
+ _mesa_error(ctx, GL_OUT_OF_MEMORY, "pixel packing");
+ free(depthCopy);
+ free(stencilCopy);
+ return;
+ }
+
+ if (ctx->Pixel.DepthScale != 1.0 || ctx->Pixel.DepthBias != 0.0) {
+ memcpy(depthCopy, depthVals, n * sizeof(GLfloat));
+ _mesa_scale_and_bias_depth(ctx, n, depthCopy);
+ depthVals = depthCopy;
+ }
+
+ if (ctx->Pixel.IndexShift ||
+ ctx->Pixel.IndexOffset ||
+ ctx->Pixel.MapStencilFlag) {
+ memcpy(stencilCopy, stencilVals, n * sizeof(GLstencil));
+ _mesa_apply_stencil_transfer_ops(ctx, n, stencilCopy);
+ stencilVals = stencilCopy;
+ }
+
+ for (i = 0; i < n; i++) {
+ GLuint z = (GLuint) (depthVals[i] * 0xffffff);
+ dest[i] = (z << 8) | (stencilVals[i] & 0xff);
+ }
+
+ if (dstPacking->SwapBytes) {
+ _mesa_swap4(dest, n);
+ }
+
+ free(depthCopy);
+ free(stencilCopy);
+}
+
+
+
+
+/**
+ * Unpack image data. Apply byte swapping, byte flipping (bitmap).
+ * Return all image data in a contiguous block. This is used when we
+ * compile glDrawPixels, glTexImage, etc into a display list. We
+ * need a copy of the data in a standard format.
+ */
+void *
+_mesa_unpack_image( GLuint dimensions,
+ GLsizei width, GLsizei height, GLsizei depth,
+ GLenum format, GLenum type, const GLvoid *pixels,
+ const struct gl_pixelstore_attrib *unpack )
+{
+ GLint bytesPerRow, compsPerRow;
+ GLboolean flipBytes, swap2, swap4;
+
+ if (!pixels)
+ return NULL; /* not necessarily an error */
+
+ if (width <= 0 || height <= 0 || depth <= 0)
+ return NULL; /* generate error later */
+
+ if (type == GL_BITMAP) {
+ bytesPerRow = (width + 7) >> 3;
+ flipBytes = unpack->LsbFirst;
+ swap2 = swap4 = GL_FALSE;
+ compsPerRow = 0;
+ }
+ else {
+ const GLint bytesPerPixel = _mesa_bytes_per_pixel(format, type);
+ GLint components = _mesa_components_in_format(format);
+ GLint bytesPerComp;
+
+ if (_mesa_type_is_packed(type))
+ components = 1;
+
+ if (bytesPerPixel <= 0 || components <= 0)
+ return NULL; /* bad format or type. generate error later */
+ bytesPerRow = bytesPerPixel * width;
+ bytesPerComp = bytesPerPixel / components;
+ flipBytes = GL_FALSE;
+ swap2 = (bytesPerComp == 2) && unpack->SwapBytes;
+ swap4 = (bytesPerComp == 4) && unpack->SwapBytes;
+ compsPerRow = components * width;
+ assert(compsPerRow >= width);
+ }
+
+ {
+ GLubyte *destBuffer
+ = (GLubyte *) malloc(bytesPerRow * height * depth);
+ GLubyte *dst;
+ GLint img, row;
+ if (!destBuffer)
+ return NULL; /* generate GL_OUT_OF_MEMORY later */
+
+ dst = destBuffer;
+ for (img = 0; img < depth; img++) {
+ for (row = 0; row < height; row++) {
+ const GLvoid *src = _mesa_image_address(dimensions, unpack, pixels,
+ width, height, format, type, img, row, 0);
+
+ if ((type == GL_BITMAP) && (unpack->SkipPixels & 0x7)) {
+ GLint i;
+ flipBytes = GL_FALSE;
+ if (unpack->LsbFirst) {
+ GLubyte srcMask = 1 << (unpack->SkipPixels & 0x7);
+ GLubyte dstMask = 128;
+ const GLubyte *s = src;
+ GLubyte *d = dst;
+ *d = 0;
+ for (i = 0; i < width; i++) {
+ if (*s & srcMask) {
+ *d |= dstMask;
+ }
+ if (srcMask == 128) {
+ srcMask = 1;
+ s++;
+ }
+ else {
+ srcMask = srcMask << 1;
+ }
+ if (dstMask == 1) {
+ dstMask = 128;
+ d++;
+ *d = 0;
+ }
+ else {
+ dstMask = dstMask >> 1;
+ }
+ }
+ }
+ else {
+ GLubyte srcMask = 128 >> (unpack->SkipPixels & 0x7);
+ GLubyte dstMask = 128;
+ const GLubyte *s = src;
+ GLubyte *d = dst;
+ *d = 0;
+ for (i = 0; i < width; i++) {
+ if (*s & srcMask) {
+ *d |= dstMask;
+ }
+ if (srcMask == 1) {
+ srcMask = 128;
+ s++;
+ }
+ else {
+ srcMask = srcMask >> 1;
+ }
+ if (dstMask == 1) {
+ dstMask = 128;
+ d++;
+ *d = 0;
+ }
+ else {
+ dstMask = dstMask >> 1;
+ }
+ }
+ }
+ }
+ else {
+ memcpy(dst, src, bytesPerRow);
+ }
+
+ /* byte flipping/swapping */
+ if (flipBytes) {
+ flip_bytes((GLubyte *) dst, bytesPerRow);
+ }
+ else if (swap2) {
+ _mesa_swap2((GLushort*) dst, compsPerRow);
+ }
+ else if (swap4) {
+ _mesa_swap4((GLuint*) dst, compsPerRow);
+ }
+ dst += bytesPerRow;
+ }
+ }
+ return destBuffer;
+ }
+}
+
diff --git a/mesalib/src/mesa/main/pbo.c b/mesalib/src/mesa/main/pbo.c
index 15e0480e9..9d0e38a58 100644
--- a/mesalib/src/mesa/main/pbo.c
+++ b/mesalib/src/mesa/main/pbo.c
@@ -1,392 +1,392 @@
-/*
- * Mesa 3-D graphics library
- *
- * Copyright (C) 1999-2008 Brian Paul All Rights Reserved.
- * Copyright (C) 2009-2011 VMware, Inc. All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-
-/**
- * \file pbo.c
- * \brief Functions related to Pixel Buffer Objects.
- */
-
-
-
-#include "glheader.h"
-#include "bufferobj.h"
-#include "image.h"
-#include "imports.h"
-#include "mtypes.h"
-#include "pbo.h"
-
-
-
-/**
- * When we're about to read pixel data out of a PBO (via glDrawPixels,
- * glTexImage, etc) or write data into a PBO (via glReadPixels,
- * glGetTexImage, etc) we call this function to check that we're not
- * going to read/write out of bounds.
- *
- * XXX This would also be a convenient time to check that the PBO isn't
- * currently mapped. Whoever calls this function should check for that.
- * Remember, we can't use a PBO when it's mapped!
- *
- * If we're not using a PBO, this is a no-op.
- *
- * \param width width of image to read/write
- * \param height height of image to read/write
- * \param depth depth of image to read/write
- * \param format format of image to read/write
- * \param type datatype of image to read/write
- * \param clientMemSize the maximum number of bytes to read/write
- * \param ptr the user-provided pointer/offset
- * \return GL_TRUE if the buffer access is OK, GL_FALSE if the access would
- * go out of bounds.
- */
-GLboolean
-_mesa_validate_pbo_access(GLuint dimensions,
- const struct gl_pixelstore_attrib *pack,
- GLsizei width, GLsizei height, GLsizei depth,
- GLenum format, GLenum type, GLsizei clientMemSize,
- const GLvoid *ptr)
-{
- const GLvoid *start, *end, *offset;
- const GLubyte *sizeAddr; /* buffer size, cast to a pointer */
-
- /* If no PBO is bound, 'ptr' is a pointer to client memory containing
- 'clientMemSize' bytes.
- If a PBO is bound, 'ptr' is an offset into the bound PBO.
- In that case 'clientMemSize' is ignored: we just use the PBO's size.
- */
- if (!_mesa_is_bufferobj(pack->BufferObj)) {
- offset = 0;
- sizeAddr = ((const GLubyte *) 0) + clientMemSize;
- } else {
- offset = ptr;
- sizeAddr = ((const GLubyte *) 0) + pack->BufferObj->Size;
- }
-
- if (sizeAddr == 0)
- /* no buffer! */
- return GL_FALSE;
-
- /* get the offset to the first pixel we'll read/write */
- start = _mesa_image_address(dimensions, pack, offset, width, height,
- format, type, 0, 0, 0);
-
- /* get the offset to just past the last pixel we'll read/write */
- end = _mesa_image_address(dimensions, pack, offset, width, height,
- format, type, depth-1, height-1, width);
-
- if ((const GLubyte *) start > sizeAddr) {
- /* This will catch negative values / wrap-around */
- return GL_FALSE;
- }
- if ((const GLubyte *) end > sizeAddr) {
- /* Image read/write goes beyond end of buffer */
- return GL_FALSE;
- }
-
- /* OK! */
- return GL_TRUE;
-}
-
-
-/**
- * For commands that read from a PBO (glDrawPixels, glTexImage,
- * glPolygonStipple, etc), if we're reading from a PBO, map it read-only
- * and return the pointer into the PBO. If we're not reading from a
- * PBO, return \p src as-is.
- * If non-null return, must call _mesa_unmap_pbo_source() when done.
- *
- * \return NULL if error, else pointer to start of data
- */
-const GLvoid *
-_mesa_map_pbo_source(struct gl_context *ctx,
- const struct gl_pixelstore_attrib *unpack,
- const GLvoid *src)
-{
- const GLubyte *buf;
-
- if (_mesa_is_bufferobj(unpack->BufferObj)) {
- /* unpack from PBO */
- buf = (GLubyte *) ctx->Driver.MapBuffer(ctx, GL_PIXEL_UNPACK_BUFFER_EXT,
- GL_READ_ONLY_ARB,
- unpack->BufferObj);
- if (!buf)
- return NULL;
-
- buf = ADD_POINTERS(buf, src);
- }
- else {
- /* unpack from normal memory */
- buf = src;
- }
-
- return buf;
-}
-
-
-/**
- * Combine PBO-read validation and mapping.
- * If any GL errors are detected, they'll be recorded and NULL returned.
- * \sa _mesa_validate_pbo_access
- * \sa _mesa_map_pbo_source
- * A call to this function should have a matching call to
- * _mesa_unmap_pbo_source().
- */
-const GLvoid *
-_mesa_map_validate_pbo_source(struct gl_context *ctx,
- GLuint dimensions,
- const struct gl_pixelstore_attrib *unpack,
- GLsizei width, GLsizei height, GLsizei depth,
- GLenum format, GLenum type, GLsizei clientMemSize,
- const GLvoid *ptr, const char *where)
-{
- ASSERT(dimensions == 1 || dimensions == 2 || dimensions == 3);
-
- if (!_mesa_validate_pbo_access(dimensions, unpack, width, height, depth,
- format, type, clientMemSize, ptr)) {
- if (_mesa_is_bufferobj(unpack->BufferObj)) {
- _mesa_error(ctx, GL_INVALID_OPERATION,
- "%s(out of bounds PBO access)", where);
- } else {
- _mesa_error(ctx, GL_INVALID_OPERATION,
- "%s(out of bounds access: bufSize (%d) is too small)",
- where, clientMemSize);
- }
- return NULL;
- }
-
- if (!_mesa_is_bufferobj(unpack->BufferObj)) {
- /* non-PBO access: no further validation to be done */
- return ptr;
- }
-
- if (_mesa_bufferobj_mapped(unpack->BufferObj)) {
- /* buffer is already mapped - that's an error */
- _mesa_error(ctx, GL_INVALID_OPERATION, "%s(PBO is mapped)", where);
- return NULL;
- }
-
- ptr = _mesa_map_pbo_source(ctx, unpack, ptr);
- return ptr;
-}
-
-
-/**
- * Counterpart to _mesa_map_pbo_source()
- */
-void
-_mesa_unmap_pbo_source(struct gl_context *ctx,
- const struct gl_pixelstore_attrib *unpack)
-{
- ASSERT(unpack != &ctx->Pack); /* catch pack/unpack mismatch */
- if (_mesa_is_bufferobj(unpack->BufferObj)) {
- ctx->Driver.UnmapBuffer(ctx, GL_PIXEL_UNPACK_BUFFER_EXT,
- unpack->BufferObj);
- }
-}
-
-
-/**
- * For commands that write to a PBO (glReadPixels, glGetColorTable, etc),
- * if we're writing to a PBO, map it write-only and return the pointer
- * into the PBO. If we're not writing to a PBO, return \p dst as-is.
- * If non-null return, must call _mesa_unmap_pbo_dest() when done.
- *
- * \return NULL if error, else pointer to start of data
- */
-void *
-_mesa_map_pbo_dest(struct gl_context *ctx,
- const struct gl_pixelstore_attrib *pack,
- GLvoid *dest)
-{
- void *buf;
-
- if (_mesa_is_bufferobj(pack->BufferObj)) {
- /* pack into PBO */
- buf = (GLubyte *) ctx->Driver.MapBuffer(ctx, GL_PIXEL_PACK_BUFFER_EXT,
- GL_WRITE_ONLY_ARB,
- pack->BufferObj);
- if (!buf)
- return NULL;
-
- buf = ADD_POINTERS(buf, dest);
- }
- else {
- /* pack to normal memory */
- buf = dest;
- }
-
- return buf;
-}
-
-
-/**
- * Combine PBO-write validation and mapping.
- * If any GL errors are detected, they'll be recorded and NULL returned.
- * \sa _mesa_validate_pbo_access
- * \sa _mesa_map_pbo_dest
- * A call to this function should have a matching call to
- * _mesa_unmap_pbo_dest().
- */
-GLvoid *
-_mesa_map_validate_pbo_dest(struct gl_context *ctx,
- GLuint dimensions,
- const struct gl_pixelstore_attrib *unpack,
- GLsizei width, GLsizei height, GLsizei depth,
- GLenum format, GLenum type, GLsizei clientMemSize,
- GLvoid *ptr, const char *where)
-{
- ASSERT(dimensions == 1 || dimensions == 2 || dimensions == 3);
-
- if (!_mesa_validate_pbo_access(dimensions, unpack, width, height, depth,
- format, type, clientMemSize, ptr)) {
- if (_mesa_is_bufferobj(unpack->BufferObj)) {
- _mesa_error(ctx, GL_INVALID_OPERATION,
- "%s(out of bounds PBO access)", where);
- } else {
- _mesa_error(ctx, GL_INVALID_OPERATION,
- "%s(out of bounds access: bufSize (%d) is too small)",
- where, clientMemSize);
- }
- return NULL;
- }
-
- if (!_mesa_is_bufferobj(unpack->BufferObj)) {
- /* non-PBO access: no further validation to be done */
- return ptr;
- }
-
- if (_mesa_bufferobj_mapped(unpack->BufferObj)) {
- /* buffer is already mapped - that's an error */
- _mesa_error(ctx, GL_INVALID_OPERATION, "%s(PBO is mapped)", where);
- return NULL;
- }
-
- ptr = _mesa_map_pbo_dest(ctx, unpack, ptr);
- return ptr;
-}
-
-
-/**
- * Counterpart to _mesa_map_pbo_dest()
- */
-void
-_mesa_unmap_pbo_dest(struct gl_context *ctx,
- const struct gl_pixelstore_attrib *pack)
-{
- ASSERT(pack != &ctx->Unpack); /* catch pack/unpack mismatch */
- if (_mesa_is_bufferobj(pack->BufferObj)) {
- ctx->Driver.UnmapBuffer(ctx, GL_PIXEL_PACK_BUFFER_EXT, pack->BufferObj);
- }
-}
-
-
-/**
- * Check if an unpack PBO is active prior to fetching a texture image.
- * If so, do bounds checking and map the buffer into main memory.
- * Any errors detected will be recorded.
- * The caller _must_ call _mesa_unmap_teximage_pbo() too!
- */
-const GLvoid *
-_mesa_validate_pbo_teximage(struct gl_context *ctx, GLuint dimensions,
- GLsizei width, GLsizei height, GLsizei depth,
- GLenum format, GLenum type, const GLvoid *pixels,
- const struct gl_pixelstore_attrib *unpack,
- const char *funcName)
-{
- GLubyte *buf;
-
- if (!_mesa_is_bufferobj(unpack->BufferObj)) {
- /* no PBO */
- return pixels;
- }
- if (!_mesa_validate_pbo_access(dimensions, unpack, width, height, depth,
- format, type, INT_MAX, pixels)) {
- _mesa_error(ctx, GL_INVALID_OPERATION, funcName, "(invalid PBO access)");
- return NULL;
- }
-
- buf = (GLubyte *) ctx->Driver.MapBuffer(ctx, GL_PIXEL_UNPACK_BUFFER_EXT,
- GL_READ_ONLY_ARB, unpack->BufferObj);
- if (!buf) {
- _mesa_error(ctx, GL_INVALID_OPERATION, funcName, "(PBO is mapped)");
- return NULL;
- }
-
- return ADD_POINTERS(buf, pixels);
-}
-
-
-/**
- * Check if an unpack PBO is active prior to fetching a compressed texture
- * image.
- * If so, do bounds checking and map the buffer into main memory.
- * Any errors detected will be recorded.
- * The caller _must_ call _mesa_unmap_teximage_pbo() too!
- */
-const GLvoid *
-_mesa_validate_pbo_compressed_teximage(struct gl_context *ctx,
- GLsizei imageSize, const GLvoid *pixels,
- const struct gl_pixelstore_attrib *packing,
- const char *funcName)
-{
- GLubyte *buf;
-
- if (!_mesa_is_bufferobj(packing->BufferObj)) {
- /* not using a PBO - return pointer unchanged */
- return pixels;
- }
- if ((const GLubyte *) pixels + imageSize >
- ((const GLubyte *) 0) + packing->BufferObj->Size) {
- /* out of bounds read! */
- _mesa_error(ctx, GL_INVALID_OPERATION, funcName, "(invalid PBO access)");
- return NULL;
- }
-
- buf = (GLubyte*) ctx->Driver.MapBuffer(ctx, GL_PIXEL_UNPACK_BUFFER_EXT,
- GL_READ_ONLY_ARB, packing->BufferObj);
- if (!buf) {
- _mesa_error(ctx, GL_INVALID_OPERATION, funcName, "(PBO is mapped");
- return NULL;
- }
-
- return ADD_POINTERS(buf, pixels);
-}
-
-
-/**
- * This function must be called after either of the validate_pbo_*_teximage()
- * functions. It unmaps the PBO buffer if it was mapped earlier.
- */
-void
-_mesa_unmap_teximage_pbo(struct gl_context *ctx,
- const struct gl_pixelstore_attrib *unpack)
-{
- if (_mesa_is_bufferobj(unpack->BufferObj)) {
- ctx->Driver.UnmapBuffer(ctx, GL_PIXEL_UNPACK_BUFFER_EXT,
- unpack->BufferObj);
- }
-}
-
-
+/*
+ * Mesa 3-D graphics library
+ *
+ * Copyright (C) 1999-2008 Brian Paul All Rights Reserved.
+ * Copyright (C) 2009-2011 VMware, Inc. All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+
+/**
+ * \file pbo.c
+ * \brief Functions related to Pixel Buffer Objects.
+ */
+
+
+
+#include "glheader.h"
+#include "bufferobj.h"
+#include "image.h"
+#include "imports.h"
+#include "mtypes.h"
+#include "pbo.h"
+
+
+
+/**
+ * When we're about to read pixel data out of a PBO (via glDrawPixels,
+ * glTexImage, etc) or write data into a PBO (via glReadPixels,
+ * glGetTexImage, etc) we call this function to check that we're not
+ * going to read/write out of bounds.
+ *
+ * XXX This would also be a convenient time to check that the PBO isn't
+ * currently mapped. Whoever calls this function should check for that.
+ * Remember, we can't use a PBO when it's mapped!
+ *
+ * If we're not using a PBO, this is a no-op.
+ *
+ * \param width width of image to read/write
+ * \param height height of image to read/write
+ * \param depth depth of image to read/write
+ * \param format format of image to read/write
+ * \param type datatype of image to read/write
+ * \param clientMemSize the maximum number of bytes to read/write
+ * \param ptr the user-provided pointer/offset
+ * \return GL_TRUE if the buffer access is OK, GL_FALSE if the access would
+ * go out of bounds.
+ */
+GLboolean
+_mesa_validate_pbo_access(GLuint dimensions,
+ const struct gl_pixelstore_attrib *pack,
+ GLsizei width, GLsizei height, GLsizei depth,
+ GLenum format, GLenum type, GLsizei clientMemSize,
+ const GLvoid *ptr)
+{
+ const GLvoid *start, *end, *offset;
+ const GLubyte *sizeAddr; /* buffer size, cast to a pointer */
+
+ /* If no PBO is bound, 'ptr' is a pointer to client memory containing
+ 'clientMemSize' bytes.
+ If a PBO is bound, 'ptr' is an offset into the bound PBO.
+ In that case 'clientMemSize' is ignored: we just use the PBO's size.
+ */
+ if (!_mesa_is_bufferobj(pack->BufferObj)) {
+ offset = 0;
+ sizeAddr = ((const GLubyte *) 0) + clientMemSize;
+ } else {
+ offset = ptr;
+ sizeAddr = ((const GLubyte *) 0) + pack->BufferObj->Size;
+ }
+
+ if (sizeAddr == 0)
+ /* no buffer! */
+ return GL_FALSE;
+
+ /* get the offset to the first pixel we'll read/write */
+ start = _mesa_image_address(dimensions, pack, offset, width, height,
+ format, type, 0, 0, 0);
+
+ /* get the offset to just past the last pixel we'll read/write */
+ end = _mesa_image_address(dimensions, pack, offset, width, height,
+ format, type, depth-1, height-1, width);
+
+ if ((const GLubyte *) start > sizeAddr) {
+ /* This will catch negative values / wrap-around */
+ return GL_FALSE;
+ }
+ if ((const GLubyte *) end > sizeAddr) {
+ /* Image read/write goes beyond end of buffer */
+ return GL_FALSE;
+ }
+
+ /* OK! */
+ return GL_TRUE;
+}
+
+
+/**
+ * For commands that read from a PBO (glDrawPixels, glTexImage,
+ * glPolygonStipple, etc), if we're reading from a PBO, map it read-only
+ * and return the pointer into the PBO. If we're not reading from a
+ * PBO, return \p src as-is.
+ * If non-null return, must call _mesa_unmap_pbo_source() when done.
+ *
+ * \return NULL if error, else pointer to start of data
+ */
+const GLvoid *
+_mesa_map_pbo_source(struct gl_context *ctx,
+ const struct gl_pixelstore_attrib *unpack,
+ const GLvoid *src)
+{
+ const GLubyte *buf;
+
+ if (_mesa_is_bufferobj(unpack->BufferObj)) {
+ /* unpack from PBO */
+ buf = (GLubyte *) ctx->Driver.MapBuffer(ctx, GL_PIXEL_UNPACK_BUFFER_EXT,
+ GL_READ_ONLY_ARB,
+ unpack->BufferObj);
+ if (!buf)
+ return NULL;
+
+ buf = ADD_POINTERS(buf, src);
+ }
+ else {
+ /* unpack from normal memory */
+ buf = src;
+ }
+
+ return buf;
+}
+
+
+/**
+ * Combine PBO-read validation and mapping.
+ * If any GL errors are detected, they'll be recorded and NULL returned.
+ * \sa _mesa_validate_pbo_access
+ * \sa _mesa_map_pbo_source
+ * A call to this function should have a matching call to
+ * _mesa_unmap_pbo_source().
+ */
+const GLvoid *
+_mesa_map_validate_pbo_source(struct gl_context *ctx,
+ GLuint dimensions,
+ const struct gl_pixelstore_attrib *unpack,
+ GLsizei width, GLsizei height, GLsizei depth,
+ GLenum format, GLenum type, GLsizei clientMemSize,
+ const GLvoid *ptr, const char *where)
+{
+ ASSERT(dimensions == 1 || dimensions == 2 || dimensions == 3);
+
+ if (!_mesa_validate_pbo_access(dimensions, unpack, width, height, depth,
+ format, type, clientMemSize, ptr)) {
+ if (_mesa_is_bufferobj(unpack->BufferObj)) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "%s(out of bounds PBO access)", where);
+ } else {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "%s(out of bounds access: bufSize (%d) is too small)",
+ where, clientMemSize);
+ }
+ return NULL;
+ }
+
+ if (!_mesa_is_bufferobj(unpack->BufferObj)) {
+ /* non-PBO access: no further validation to be done */
+ return ptr;
+ }
+
+ if (_mesa_bufferobj_mapped(unpack->BufferObj)) {
+ /* buffer is already mapped - that's an error */
+ _mesa_error(ctx, GL_INVALID_OPERATION, "%s(PBO is mapped)", where);
+ return NULL;
+ }
+
+ ptr = _mesa_map_pbo_source(ctx, unpack, ptr);
+ return ptr;
+}
+
+
+/**
+ * Counterpart to _mesa_map_pbo_source()
+ */
+void
+_mesa_unmap_pbo_source(struct gl_context *ctx,
+ const struct gl_pixelstore_attrib *unpack)
+{
+ ASSERT(unpack != &ctx->Pack); /* catch pack/unpack mismatch */
+ if (_mesa_is_bufferobj(unpack->BufferObj)) {
+ ctx->Driver.UnmapBuffer(ctx, GL_PIXEL_UNPACK_BUFFER_EXT,
+ unpack->BufferObj);
+ }
+}
+
+
+/**
+ * For commands that write to a PBO (glReadPixels, glGetColorTable, etc),
+ * if we're writing to a PBO, map it write-only and return the pointer
+ * into the PBO. If we're not writing to a PBO, return \p dst as-is.
+ * If non-null return, must call _mesa_unmap_pbo_dest() when done.
+ *
+ * \return NULL if error, else pointer to start of data
+ */
+void *
+_mesa_map_pbo_dest(struct gl_context *ctx,
+ const struct gl_pixelstore_attrib *pack,
+ GLvoid *dest)
+{
+ void *buf;
+
+ if (_mesa_is_bufferobj(pack->BufferObj)) {
+ /* pack into PBO */
+ buf = (GLubyte *) ctx->Driver.MapBuffer(ctx, GL_PIXEL_PACK_BUFFER_EXT,
+ GL_WRITE_ONLY_ARB,
+ pack->BufferObj);
+ if (!buf)
+ return NULL;
+
+ buf = ADD_POINTERS(buf, dest);
+ }
+ else {
+ /* pack to normal memory */
+ buf = dest;
+ }
+
+ return buf;
+}
+
+
+/**
+ * Combine PBO-write validation and mapping.
+ * If any GL errors are detected, they'll be recorded and NULL returned.
+ * \sa _mesa_validate_pbo_access
+ * \sa _mesa_map_pbo_dest
+ * A call to this function should have a matching call to
+ * _mesa_unmap_pbo_dest().
+ */
+GLvoid *
+_mesa_map_validate_pbo_dest(struct gl_context *ctx,
+ GLuint dimensions,
+ const struct gl_pixelstore_attrib *unpack,
+ GLsizei width, GLsizei height, GLsizei depth,
+ GLenum format, GLenum type, GLsizei clientMemSize,
+ GLvoid *ptr, const char *where)
+{
+ ASSERT(dimensions == 1 || dimensions == 2 || dimensions == 3);
+
+ if (!_mesa_validate_pbo_access(dimensions, unpack, width, height, depth,
+ format, type, clientMemSize, ptr)) {
+ if (_mesa_is_bufferobj(unpack->BufferObj)) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "%s(out of bounds PBO access)", where);
+ } else {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "%s(out of bounds access: bufSize (%d) is too small)",
+ where, clientMemSize);
+ }
+ return NULL;
+ }
+
+ if (!_mesa_is_bufferobj(unpack->BufferObj)) {
+ /* non-PBO access: no further validation to be done */
+ return ptr;
+ }
+
+ if (_mesa_bufferobj_mapped(unpack->BufferObj)) {
+ /* buffer is already mapped - that's an error */
+ _mesa_error(ctx, GL_INVALID_OPERATION, "%s(PBO is mapped)", where);
+ return NULL;
+ }
+
+ ptr = _mesa_map_pbo_dest(ctx, unpack, ptr);
+ return ptr;
+}
+
+
+/**
+ * Counterpart to _mesa_map_pbo_dest()
+ */
+void
+_mesa_unmap_pbo_dest(struct gl_context *ctx,
+ const struct gl_pixelstore_attrib *pack)
+{
+ ASSERT(pack != &ctx->Unpack); /* catch pack/unpack mismatch */
+ if (_mesa_is_bufferobj(pack->BufferObj)) {
+ ctx->Driver.UnmapBuffer(ctx, GL_PIXEL_PACK_BUFFER_EXT, pack->BufferObj);
+ }
+}
+
+
+/**
+ * Check if an unpack PBO is active prior to fetching a texture image.
+ * If so, do bounds checking and map the buffer into main memory.
+ * Any errors detected will be recorded.
+ * The caller _must_ call _mesa_unmap_teximage_pbo() too!
+ */
+const GLvoid *
+_mesa_validate_pbo_teximage(struct gl_context *ctx, GLuint dimensions,
+ GLsizei width, GLsizei height, GLsizei depth,
+ GLenum format, GLenum type, const GLvoid *pixels,
+ const struct gl_pixelstore_attrib *unpack,
+ const char *funcName)
+{
+ GLubyte *buf;
+
+ if (!_mesa_is_bufferobj(unpack->BufferObj)) {
+ /* no PBO */
+ return pixels;
+ }
+ if (!_mesa_validate_pbo_access(dimensions, unpack, width, height, depth,
+ format, type, INT_MAX, pixels)) {
+ _mesa_error(ctx, GL_INVALID_OPERATION, funcName, "(invalid PBO access)");
+ return NULL;
+ }
+
+ buf = (GLubyte *) ctx->Driver.MapBuffer(ctx, GL_PIXEL_UNPACK_BUFFER_EXT,
+ GL_READ_ONLY_ARB, unpack->BufferObj);
+ if (!buf) {
+ _mesa_error(ctx, GL_INVALID_OPERATION, funcName, "(PBO is mapped)");
+ return NULL;
+ }
+
+ return ADD_POINTERS(buf, pixels);
+}
+
+
+/**
+ * Check if an unpack PBO is active prior to fetching a compressed texture
+ * image.
+ * If so, do bounds checking and map the buffer into main memory.
+ * Any errors detected will be recorded.
+ * The caller _must_ call _mesa_unmap_teximage_pbo() too!
+ */
+const GLvoid *
+_mesa_validate_pbo_compressed_teximage(struct gl_context *ctx,
+ GLsizei imageSize, const GLvoid *pixels,
+ const struct gl_pixelstore_attrib *packing,
+ const char *funcName)
+{
+ GLubyte *buf;
+
+ if (!_mesa_is_bufferobj(packing->BufferObj)) {
+ /* not using a PBO - return pointer unchanged */
+ return pixels;
+ }
+ if ((const GLubyte *) pixels + imageSize >
+ ((const GLubyte *) 0) + packing->BufferObj->Size) {
+ /* out of bounds read! */
+ _mesa_error(ctx, GL_INVALID_OPERATION, funcName, "(invalid PBO access)");
+ return NULL;
+ }
+
+ buf = (GLubyte*) ctx->Driver.MapBuffer(ctx, GL_PIXEL_UNPACK_BUFFER_EXT,
+ GL_READ_ONLY_ARB, packing->BufferObj);
+ if (!buf) {
+ _mesa_error(ctx, GL_INVALID_OPERATION, funcName, "(PBO is mapped");
+ return NULL;
+ }
+
+ return ADD_POINTERS(buf, pixels);
+}
+
+
+/**
+ * This function must be called after either of the validate_pbo_*_teximage()
+ * functions. It unmaps the PBO buffer if it was mapped earlier.
+ */
+void
+_mesa_unmap_teximage_pbo(struct gl_context *ctx,
+ const struct gl_pixelstore_attrib *unpack)
+{
+ if (_mesa_is_bufferobj(unpack->BufferObj)) {
+ ctx->Driver.UnmapBuffer(ctx, GL_PIXEL_UNPACK_BUFFER_EXT,
+ unpack->BufferObj);
+ }
+}
+
+
diff --git a/mesalib/src/mesa/main/pbo.h b/mesalib/src/mesa/main/pbo.h
index 00a6e617f..605a9a8b5 100644
--- a/mesalib/src/mesa/main/pbo.h
+++ b/mesalib/src/mesa/main/pbo.h
@@ -1,93 +1,93 @@
-/*
- * Mesa 3-D graphics library
- *
- * Copyright (C) 1999-2008 Brian Paul All Rights Reserved.
- * Copyright (C) 2009-2011 VMware, Inc. All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-
-#ifndef PBO_H
-#define PBO_H
-
-
-#include "mtypes.h"
-
-
-extern GLboolean
-_mesa_validate_pbo_access(GLuint dimensions,
- const struct gl_pixelstore_attrib *pack,
- GLsizei width, GLsizei height, GLsizei depth,
- GLenum format, GLenum type, GLsizei clientMemSize,
- const GLvoid *ptr);
-
-extern const GLvoid *
-_mesa_map_pbo_source(struct gl_context *ctx,
- const struct gl_pixelstore_attrib *unpack,
- const GLvoid *src);
-
-extern const GLvoid *
-_mesa_map_validate_pbo_source(struct gl_context *ctx,
- GLuint dimensions,
- const struct gl_pixelstore_attrib *unpack,
- GLsizei width, GLsizei height, GLsizei depth,
- GLenum format, GLenum type, GLsizei clientMemSize,
- const GLvoid *ptr, const char *where);
-
-extern void
-_mesa_unmap_pbo_source(struct gl_context *ctx,
- const struct gl_pixelstore_attrib *unpack);
-
-extern void *
-_mesa_map_pbo_dest(struct gl_context *ctx,
- const struct gl_pixelstore_attrib *pack,
- GLvoid *dest);
-
-extern GLvoid *
-_mesa_map_validate_pbo_dest(struct gl_context *ctx,
- GLuint dimensions,
- const struct gl_pixelstore_attrib *unpack,
- GLsizei width, GLsizei height, GLsizei depth,
- GLenum format, GLenum type, GLsizei clientMemSize,
- GLvoid *ptr, const char *where);
-
-extern void
-_mesa_unmap_pbo_dest(struct gl_context *ctx,
- const struct gl_pixelstore_attrib *pack);
-
-
-extern const GLvoid *
-_mesa_validate_pbo_teximage(struct gl_context *ctx, GLuint dimensions,
- GLsizei width, GLsizei height, GLsizei depth,
- GLenum format, GLenum type, const GLvoid *pixels,
- const struct gl_pixelstore_attrib *unpack,
- const char *funcName);
-
-extern const GLvoid *
-_mesa_validate_pbo_compressed_teximage(struct gl_context *ctx,
- GLsizei imageSize, const GLvoid *pixels,
- const struct gl_pixelstore_attrib *packing,
- const char *funcName);
-
-extern void
-_mesa_unmap_teximage_pbo(struct gl_context *ctx,
- const struct gl_pixelstore_attrib *unpack);
-
-
-#endif
+/*
+ * Mesa 3-D graphics library
+ *
+ * Copyright (C) 1999-2008 Brian Paul All Rights Reserved.
+ * Copyright (C) 2009-2011 VMware, Inc. All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+
+#ifndef PBO_H
+#define PBO_H
+
+
+#include "mtypes.h"
+
+
+extern GLboolean
+_mesa_validate_pbo_access(GLuint dimensions,
+ const struct gl_pixelstore_attrib *pack,
+ GLsizei width, GLsizei height, GLsizei depth,
+ GLenum format, GLenum type, GLsizei clientMemSize,
+ const GLvoid *ptr);
+
+extern const GLvoid *
+_mesa_map_pbo_source(struct gl_context *ctx,
+ const struct gl_pixelstore_attrib *unpack,
+ const GLvoid *src);
+
+extern const GLvoid *
+_mesa_map_validate_pbo_source(struct gl_context *ctx,
+ GLuint dimensions,
+ const struct gl_pixelstore_attrib *unpack,
+ GLsizei width, GLsizei height, GLsizei depth,
+ GLenum format, GLenum type, GLsizei clientMemSize,
+ const GLvoid *ptr, const char *where);
+
+extern void
+_mesa_unmap_pbo_source(struct gl_context *ctx,
+ const struct gl_pixelstore_attrib *unpack);
+
+extern void *
+_mesa_map_pbo_dest(struct gl_context *ctx,
+ const struct gl_pixelstore_attrib *pack,
+ GLvoid *dest);
+
+extern GLvoid *
+_mesa_map_validate_pbo_dest(struct gl_context *ctx,
+ GLuint dimensions,
+ const struct gl_pixelstore_attrib *unpack,
+ GLsizei width, GLsizei height, GLsizei depth,
+ GLenum format, GLenum type, GLsizei clientMemSize,
+ GLvoid *ptr, const char *where);
+
+extern void
+_mesa_unmap_pbo_dest(struct gl_context *ctx,
+ const struct gl_pixelstore_attrib *pack);
+
+
+extern const GLvoid *
+_mesa_validate_pbo_teximage(struct gl_context *ctx, GLuint dimensions,
+ GLsizei width, GLsizei height, GLsizei depth,
+ GLenum format, GLenum type, const GLvoid *pixels,
+ const struct gl_pixelstore_attrib *unpack,
+ const char *funcName);
+
+extern const GLvoid *
+_mesa_validate_pbo_compressed_teximage(struct gl_context *ctx,
+ GLsizei imageSize, const GLvoid *pixels,
+ const struct gl_pixelstore_attrib *packing,
+ const char *funcName);
+
+extern void
+_mesa_unmap_teximage_pbo(struct gl_context *ctx,
+ const struct gl_pixelstore_attrib *unpack);
+
+
+#endif
diff --git a/mesalib/src/mesa/main/pixel.c b/mesalib/src/mesa/main/pixel.c
index 775746270..26fb71508 100644
--- a/mesalib/src/mesa/main/pixel.c
+++ b/mesalib/src/mesa/main/pixel.c
@@ -1,731 +1,731 @@
-/*
- * Mesa 3-D graphics library
- * Version: 7.1
- *
- * Copyright (C) 1999-2008 Brian Paul All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-
-/**
- * \file pixel.c
- * Pixel transfer functions (glPixelZoom, glPixelMap, glPixelTransfer)
- */
-
-#include "glheader.h"
-#include "bufferobj.h"
-#include "colormac.h"
-#include "context.h"
-#include "macros.h"
-#include "mfeatures.h"
-#include "pixel.h"
-#include "pbo.h"
-#include "mtypes.h"
-#include "main/dispatch.h"
-
-
-#if FEATURE_pixel_transfer
-
-
-/**********************************************************************/
-/***** glPixelZoom *****/
-/**********************************************************************/
-
-static void GLAPIENTRY
-_mesa_PixelZoom( GLfloat xfactor, GLfloat yfactor )
-{
- GET_CURRENT_CONTEXT(ctx);
-
- if (ctx->Pixel.ZoomX == xfactor &&
- ctx->Pixel.ZoomY == yfactor)
- return;
-
- FLUSH_VERTICES(ctx, _NEW_PIXEL);
- ctx->Pixel.ZoomX = xfactor;
- ctx->Pixel.ZoomY = yfactor;
-}
-
-
-
-/**********************************************************************/
-/***** glPixelMap *****/
-/**********************************************************************/
-
-/**
- * Return pointer to a pixelmap by name.
- */
-static struct gl_pixelmap *
-get_pixelmap(struct gl_context *ctx, GLenum map)
-{
- switch (map) {
- case GL_PIXEL_MAP_I_TO_I:
- return &ctx->PixelMaps.ItoI;
- case GL_PIXEL_MAP_S_TO_S:
- return &ctx->PixelMaps.StoS;
- case GL_PIXEL_MAP_I_TO_R:
- return &ctx->PixelMaps.ItoR;
- case GL_PIXEL_MAP_I_TO_G:
- return &ctx->PixelMaps.ItoG;
- case GL_PIXEL_MAP_I_TO_B:
- return &ctx->PixelMaps.ItoB;
- case GL_PIXEL_MAP_I_TO_A:
- return &ctx->PixelMaps.ItoA;
- case GL_PIXEL_MAP_R_TO_R:
- return &ctx->PixelMaps.RtoR;
- case GL_PIXEL_MAP_G_TO_G:
- return &ctx->PixelMaps.GtoG;
- case GL_PIXEL_MAP_B_TO_B:
- return &ctx->PixelMaps.BtoB;
- case GL_PIXEL_MAP_A_TO_A:
- return &ctx->PixelMaps.AtoA;
- default:
- return NULL;
- }
-}
-
-
-/**
- * Helper routine used by the other _mesa_PixelMap() functions.
- */
-static void
-store_pixelmap(struct gl_context *ctx, GLenum map, GLsizei mapsize,
- const GLfloat *values)
-{
- GLint i;
- struct gl_pixelmap *pm = get_pixelmap(ctx, map);
- if (!pm) {
- _mesa_error(ctx, GL_INVALID_ENUM, "glPixelMap(map)");
- return;
- }
-
- switch (map) {
- case GL_PIXEL_MAP_S_TO_S:
- /* special case */
- ctx->PixelMaps.StoS.Size = mapsize;
- for (i = 0; i < mapsize; i++) {
- ctx->PixelMaps.StoS.Map[i] = (GLfloat)IROUND(values[i]);
- }
- break;
- case GL_PIXEL_MAP_I_TO_I:
- /* special case */
- ctx->PixelMaps.ItoI.Size = mapsize;
- for (i = 0; i < mapsize; i++) {
- ctx->PixelMaps.ItoI.Map[i] = values[i];
- }
- break;
- default:
- /* general case */
- pm->Size = mapsize;
- for (i = 0; i < mapsize; i++) {
- GLfloat val = CLAMP(values[i], 0.0F, 1.0F);
- pm->Map[i] = val;
- pm->Map8[i] = (GLint) (val * 255.0F);
- }
- }
-}
-
-
-/**
- * Convenience wrapper for _mesa_validate_pbo_access() for gl[Get]PixelMap().
- */
-static GLboolean
-validate_pbo_access(struct gl_context *ctx,
- struct gl_pixelstore_attrib *pack, GLsizei mapsize,
- GLenum format, GLenum type, GLsizei clientMemSize,
- const GLvoid *ptr)
-{
- GLboolean ok;
-
- /* Note, need to use DefaultPacking and Unpack's buffer object */
- _mesa_reference_buffer_object(ctx,
- &ctx->DefaultPacking.BufferObj,
- pack->BufferObj);
-
- ok = _mesa_validate_pbo_access(1, &ctx->DefaultPacking, mapsize, 1, 1,
- format, type, clientMemSize, ptr);
-
- /* restore */
- _mesa_reference_buffer_object(ctx,
- &ctx->DefaultPacking.BufferObj,
- ctx->Shared->NullBufferObj);
-
- if (!ok) {
- if (_mesa_is_bufferobj(pack->BufferObj)) {
- _mesa_error(ctx, GL_INVALID_OPERATION,
- "gl[Get]PixelMap*v(out of bounds PBO access)");
- } else {
- _mesa_error(ctx, GL_INVALID_OPERATION,
- "glGetnPixelMap*vARB(out of bounds access:"
- " bufSize (%d) is too small)", clientMemSize);
- }
- }
- return ok;
-}
-
-
-static void GLAPIENTRY
-_mesa_PixelMapfv( GLenum map, GLsizei mapsize, const GLfloat *values )
-{
- GET_CURRENT_CONTEXT(ctx);
- ASSERT_OUTSIDE_BEGIN_END(ctx);
-
- /* XXX someday, test against ctx->Const.MaxPixelMapTableSize */
- if (mapsize < 1 || mapsize > MAX_PIXEL_MAP_TABLE) {
- _mesa_error( ctx, GL_INVALID_VALUE, "glPixelMapfv(mapsize)" );
- return;
- }
-
- if (map >= GL_PIXEL_MAP_S_TO_S && map <= GL_PIXEL_MAP_I_TO_A) {
- /* test that mapsize is a power of two */
- if (!_mesa_is_pow_two(mapsize)) {
- _mesa_error( ctx, GL_INVALID_VALUE, "glPixelMapfv(mapsize)" );
- return;
- }
- }
-
- FLUSH_VERTICES(ctx, _NEW_PIXEL);
-
- if (!validate_pbo_access(ctx, &ctx->Unpack, mapsize, GL_INTENSITY,
- GL_FLOAT, INT_MAX, values)) {
- return;
- }
-
- values = (const GLfloat *) _mesa_map_pbo_source(ctx, &ctx->Unpack, values);
- if (!values) {
- if (_mesa_is_bufferobj(ctx->Unpack.BufferObj)) {
- _mesa_error(ctx, GL_INVALID_OPERATION,
- "glPixelMapfv(PBO is mapped)");
- }
- return;
- }
-
- store_pixelmap(ctx, map, mapsize, values);
-
- _mesa_unmap_pbo_source(ctx, &ctx->Unpack);
-}
-
-
-static void GLAPIENTRY
-_mesa_PixelMapuiv(GLenum map, GLsizei mapsize, const GLuint *values )
-{
- GLfloat fvalues[MAX_PIXEL_MAP_TABLE];
- GET_CURRENT_CONTEXT(ctx);
- ASSERT_OUTSIDE_BEGIN_END(ctx);
-
- if (mapsize < 1 || mapsize > MAX_PIXEL_MAP_TABLE) {
- _mesa_error( ctx, GL_INVALID_VALUE, "glPixelMapuiv(mapsize)" );
- return;
- }
-
- if (map >= GL_PIXEL_MAP_S_TO_S && map <= GL_PIXEL_MAP_I_TO_A) {
- /* test that mapsize is a power of two */
- if (!_mesa_is_pow_two(mapsize)) {
- _mesa_error( ctx, GL_INVALID_VALUE, "glPixelMapuiv(mapsize)" );
- return;
- }
- }
-
- FLUSH_VERTICES(ctx, _NEW_PIXEL);
-
- if (!validate_pbo_access(ctx, &ctx->Unpack, mapsize, GL_INTENSITY,
- GL_UNSIGNED_INT, INT_MAX, values)) {
- return;
- }
-
- values = (const GLuint *) _mesa_map_pbo_source(ctx, &ctx->Unpack, values);
- if (!values) {
- if (_mesa_is_bufferobj(ctx->Unpack.BufferObj)) {
- _mesa_error(ctx, GL_INVALID_OPERATION,
- "glPixelMapuiv(PBO is mapped)");
- }
- return;
- }
-
- /* convert to floats */
- if (map == GL_PIXEL_MAP_I_TO_I || map == GL_PIXEL_MAP_S_TO_S) {
- GLint i;
- for (i = 0; i < mapsize; i++) {
- fvalues[i] = (GLfloat) values[i];
- }
- }
- else {
- GLint i;
- for (i = 0; i < mapsize; i++) {
- fvalues[i] = UINT_TO_FLOAT( values[i] );
- }
- }
-
- _mesa_unmap_pbo_source(ctx, &ctx->Unpack);
-
- store_pixelmap(ctx, map, mapsize, fvalues);
-}
-
-
-static void GLAPIENTRY
-_mesa_PixelMapusv(GLenum map, GLsizei mapsize, const GLushort *values )
-{
- GLfloat fvalues[MAX_PIXEL_MAP_TABLE];
- GET_CURRENT_CONTEXT(ctx);
- ASSERT_OUTSIDE_BEGIN_END(ctx);
-
- if (mapsize < 1 || mapsize > MAX_PIXEL_MAP_TABLE) {
- _mesa_error( ctx, GL_INVALID_VALUE, "glPixelMapusv(mapsize)" );
- return;
- }
-
- if (map >= GL_PIXEL_MAP_S_TO_S && map <= GL_PIXEL_MAP_I_TO_A) {
- /* test that mapsize is a power of two */
- if (!_mesa_is_pow_two(mapsize)) {
- _mesa_error( ctx, GL_INVALID_VALUE, "glPixelMapuiv(mapsize)" );
- return;
- }
- }
-
- FLUSH_VERTICES(ctx, _NEW_PIXEL);
-
- if (!validate_pbo_access(ctx, &ctx->Unpack, mapsize, GL_INTENSITY,
- GL_UNSIGNED_SHORT, INT_MAX, values)) {
- return;
- }
-
- values = (const GLushort *) _mesa_map_pbo_source(ctx, &ctx->Unpack, values);
- if (!values) {
- if (_mesa_is_bufferobj(ctx->Unpack.BufferObj)) {
- _mesa_error(ctx, GL_INVALID_OPERATION,
- "glPixelMapusv(PBO is mapped)");
- }
- return;
- }
-
- /* convert to floats */
- if (map == GL_PIXEL_MAP_I_TO_I || map == GL_PIXEL_MAP_S_TO_S) {
- GLint i;
- for (i = 0; i < mapsize; i++) {
- fvalues[i] = (GLfloat) values[i];
- }
- }
- else {
- GLint i;
- for (i = 0; i < mapsize; i++) {
- fvalues[i] = USHORT_TO_FLOAT( values[i] );
- }
- }
-
- _mesa_unmap_pbo_source(ctx, &ctx->Unpack);
-
- store_pixelmap(ctx, map, mapsize, fvalues);
-}
-
-
-static void GLAPIENTRY
-_mesa_GetnPixelMapfvARB( GLenum map, GLsizei bufSize, GLfloat *values )
-{
- GET_CURRENT_CONTEXT(ctx);
- GLint mapsize, i;
- const struct gl_pixelmap *pm;
-
- ASSERT_OUTSIDE_BEGIN_END(ctx);
-
- pm = get_pixelmap(ctx, map);
- if (!pm) {
- _mesa_error(ctx, GL_INVALID_ENUM, "glGetPixelMapfv(map)");
- return;
- }
-
- mapsize = pm->Size;
-
- if (!validate_pbo_access(ctx, &ctx->Pack, mapsize, GL_INTENSITY,
- GL_FLOAT, bufSize, values)) {
- return;
- }
-
- values = (GLfloat *) _mesa_map_pbo_dest(ctx, &ctx->Pack, values);
- if (!values) {
- if (_mesa_is_bufferobj(ctx->Pack.BufferObj)) {
- _mesa_error(ctx, GL_INVALID_OPERATION,
- "glGetPixelMapfv(PBO is mapped)");
- }
- return;
- }
-
- if (map == GL_PIXEL_MAP_S_TO_S) {
- /* special case */
- for (i = 0; i < mapsize; i++) {
- values[i] = (GLfloat) ctx->PixelMaps.StoS.Map[i];
- }
- }
- else {
- memcpy(values, pm->Map, mapsize * sizeof(GLfloat));
- }
-
- _mesa_unmap_pbo_dest(ctx, &ctx->Pack);
-}
-
-
-static void GLAPIENTRY
-_mesa_GetPixelMapfv( GLenum map, GLfloat *values )
-{
- _mesa_GetnPixelMapfvARB(map, INT_MAX, values);
-}
-
-static void GLAPIENTRY
-_mesa_GetnPixelMapuivARB( GLenum map, GLsizei bufSize, GLuint *values )
-{
- GET_CURRENT_CONTEXT(ctx);
- GLint mapsize, i;
- const struct gl_pixelmap *pm;
-
- ASSERT_OUTSIDE_BEGIN_END(ctx);
-
- pm = get_pixelmap(ctx, map);
- if (!pm) {
- _mesa_error(ctx, GL_INVALID_ENUM, "glGetPixelMapuiv(map)");
- return;
- }
-
- mapsize = pm->Size;
-
- if (!validate_pbo_access(ctx, &ctx->Pack, mapsize, GL_INTENSITY,
- GL_UNSIGNED_INT, bufSize, values)) {
- return;
- }
-
- values = (GLuint *) _mesa_map_pbo_dest(ctx, &ctx->Pack, values);
- if (!values) {
- if (_mesa_is_bufferobj(ctx->Pack.BufferObj)) {
- _mesa_error(ctx, GL_INVALID_OPERATION,
- "glGetPixelMapuiv(PBO is mapped)");
- }
- return;
- }
-
- if (map == GL_PIXEL_MAP_S_TO_S) {
- /* special case */
- memcpy(values, ctx->PixelMaps.StoS.Map, mapsize * sizeof(GLint));
- }
- else {
- for (i = 0; i < mapsize; i++) {
- values[i] = FLOAT_TO_UINT( pm->Map[i] );
- }
- }
-
- _mesa_unmap_pbo_dest(ctx, &ctx->Pack);
-}
-
-
-static void GLAPIENTRY
-_mesa_GetPixelMapuiv( GLenum map, GLuint *values )
-{
- _mesa_GetnPixelMapuivARB(map, INT_MAX, values);
-}
-
-static void GLAPIENTRY
-_mesa_GetnPixelMapusvARB( GLenum map, GLsizei bufSize, GLushort *values )
-{
- GET_CURRENT_CONTEXT(ctx);
- GLint mapsize, i;
- const struct gl_pixelmap *pm;
-
- ASSERT_OUTSIDE_BEGIN_END(ctx);
-
- pm = get_pixelmap(ctx, map);
- if (!pm) {
- _mesa_error(ctx, GL_INVALID_ENUM, "glGetPixelMapusv(map)");
- return;
- }
-
- mapsize = pm->Size;
-
- if (!validate_pbo_access(ctx, &ctx->Pack, mapsize, GL_INTENSITY,
- GL_UNSIGNED_SHORT, bufSize, values)) {
- return;
- }
-
- values = (GLushort *) _mesa_map_pbo_dest(ctx, &ctx->Pack, values);
- if (!values) {
- if (_mesa_is_bufferobj(ctx->Pack.BufferObj)) {
- _mesa_error(ctx, GL_INVALID_OPERATION,
- "glGetPixelMapusv(PBO is mapped)");
- }
- return;
- }
-
- switch (map) {
- /* special cases */
- case GL_PIXEL_MAP_I_TO_I:
- for (i = 0; i < mapsize; i++) {
- values[i] = (GLushort) CLAMP(ctx->PixelMaps.ItoI.Map[i], 0.0, 65535.);
- }
- break;
- case GL_PIXEL_MAP_S_TO_S:
- for (i = 0; i < mapsize; i++) {
- values[i] = (GLushort) CLAMP(ctx->PixelMaps.StoS.Map[i], 0.0, 65535.);
- }
- break;
- default:
- for (i = 0; i < mapsize; i++) {
- CLAMPED_FLOAT_TO_USHORT(values[i], pm->Map[i] );
- }
- }
-
- _mesa_unmap_pbo_dest(ctx, &ctx->Pack);
-}
-
-
-static void GLAPIENTRY
-_mesa_GetPixelMapusv( GLenum map, GLushort *values )
-{
- _mesa_GetnPixelMapusvARB(map, INT_MAX, values);
-}
-
-
-/**********************************************************************/
-/***** glPixelTransfer *****/
-/**********************************************************************/
-
-
-/*
- * Implements glPixelTransfer[fi] whether called immediately or from a
- * display list.
- */
-static void GLAPIENTRY
-_mesa_PixelTransferf( GLenum pname, GLfloat param )
-{
- GET_CURRENT_CONTEXT(ctx);
- ASSERT_OUTSIDE_BEGIN_END(ctx);
-
- switch (pname) {
- case GL_MAP_COLOR:
- if (ctx->Pixel.MapColorFlag == (param ? GL_TRUE : GL_FALSE))
- return;
- FLUSH_VERTICES(ctx, _NEW_PIXEL);
- ctx->Pixel.MapColorFlag = param ? GL_TRUE : GL_FALSE;
- break;
- case GL_MAP_STENCIL:
- if (ctx->Pixel.MapStencilFlag == (param ? GL_TRUE : GL_FALSE))
- return;
- FLUSH_VERTICES(ctx, _NEW_PIXEL);
- ctx->Pixel.MapStencilFlag = param ? GL_TRUE : GL_FALSE;
- break;
- case GL_INDEX_SHIFT:
- if (ctx->Pixel.IndexShift == (GLint) param)
- return;
- FLUSH_VERTICES(ctx, _NEW_PIXEL);
- ctx->Pixel.IndexShift = (GLint) param;
- break;
- case GL_INDEX_OFFSET:
- if (ctx->Pixel.IndexOffset == (GLint) param)
- return;
- FLUSH_VERTICES(ctx, _NEW_PIXEL);
- ctx->Pixel.IndexOffset = (GLint) param;
- break;
- case GL_RED_SCALE:
- if (ctx->Pixel.RedScale == param)
- return;
- FLUSH_VERTICES(ctx, _NEW_PIXEL);
- ctx->Pixel.RedScale = param;
- break;
- case GL_RED_BIAS:
- if (ctx->Pixel.RedBias == param)
- return;
- FLUSH_VERTICES(ctx, _NEW_PIXEL);
- ctx->Pixel.RedBias = param;
- break;
- case GL_GREEN_SCALE:
- if (ctx->Pixel.GreenScale == param)
- return;
- FLUSH_VERTICES(ctx, _NEW_PIXEL);
- ctx->Pixel.GreenScale = param;
- break;
- case GL_GREEN_BIAS:
- if (ctx->Pixel.GreenBias == param)
- return;
- FLUSH_VERTICES(ctx, _NEW_PIXEL);
- ctx->Pixel.GreenBias = param;
- break;
- case GL_BLUE_SCALE:
- if (ctx->Pixel.BlueScale == param)
- return;
- FLUSH_VERTICES(ctx, _NEW_PIXEL);
- ctx->Pixel.BlueScale = param;
- break;
- case GL_BLUE_BIAS:
- if (ctx->Pixel.BlueBias == param)
- return;
- FLUSH_VERTICES(ctx, _NEW_PIXEL);
- ctx->Pixel.BlueBias = param;
- break;
- case GL_ALPHA_SCALE:
- if (ctx->Pixel.AlphaScale == param)
- return;
- FLUSH_VERTICES(ctx, _NEW_PIXEL);
- ctx->Pixel.AlphaScale = param;
- break;
- case GL_ALPHA_BIAS:
- if (ctx->Pixel.AlphaBias == param)
- return;
- FLUSH_VERTICES(ctx, _NEW_PIXEL);
- ctx->Pixel.AlphaBias = param;
- break;
- case GL_DEPTH_SCALE:
- if (ctx->Pixel.DepthScale == param)
- return;
- FLUSH_VERTICES(ctx, _NEW_PIXEL);
- ctx->Pixel.DepthScale = param;
- break;
- case GL_DEPTH_BIAS:
- if (ctx->Pixel.DepthBias == param)
- return;
- FLUSH_VERTICES(ctx, _NEW_PIXEL);
- ctx->Pixel.DepthBias = param;
- break;
- default:
- _mesa_error( ctx, GL_INVALID_ENUM, "glPixelTransfer(pname)" );
- return;
- }
-}
-
-
-static void GLAPIENTRY
-_mesa_PixelTransferi( GLenum pname, GLint param )
-{
- _mesa_PixelTransferf( pname, (GLfloat) param );
-}
-
-
-
-/**********************************************************************/
-/***** State Management *****/
-/**********************************************************************/
-
-/*
- * Return a bitmask of IMAGE_*_BIT flags which to indicate which
- * pixel transfer operations are enabled.
- */
-static void
-update_image_transfer_state(struct gl_context *ctx)
-{
- GLuint mask = 0;
-
- if (ctx->Pixel.RedScale != 1.0F || ctx->Pixel.RedBias != 0.0F ||
- ctx->Pixel.GreenScale != 1.0F || ctx->Pixel.GreenBias != 0.0F ||
- ctx->Pixel.BlueScale != 1.0F || ctx->Pixel.BlueBias != 0.0F ||
- ctx->Pixel.AlphaScale != 1.0F || ctx->Pixel.AlphaBias != 0.0F)
- mask |= IMAGE_SCALE_BIAS_BIT;
-
- if (ctx->Pixel.IndexShift || ctx->Pixel.IndexOffset)
- mask |= IMAGE_SHIFT_OFFSET_BIT;
-
- if (ctx->Pixel.MapColorFlag)
- mask |= IMAGE_MAP_COLOR_BIT;
-
- ctx->_ImageTransferState = mask;
-}
-
-
-/**
- * Update mesa pixel transfer derived state.
- */
-void _mesa_update_pixel( struct gl_context *ctx, GLuint new_state )
-{
- if (new_state & _NEW_PIXEL)
- update_image_transfer_state(ctx);
-}
-
-
-void
-_mesa_init_pixel_dispatch(struct _glapi_table *disp)
-{
- SET_GetPixelMapfv(disp, _mesa_GetPixelMapfv);
- SET_GetPixelMapuiv(disp, _mesa_GetPixelMapuiv);
- SET_GetPixelMapusv(disp, _mesa_GetPixelMapusv);
- SET_PixelMapfv(disp, _mesa_PixelMapfv);
- SET_PixelMapuiv(disp, _mesa_PixelMapuiv);
- SET_PixelMapusv(disp, _mesa_PixelMapusv);
- SET_PixelTransferf(disp, _mesa_PixelTransferf);
- SET_PixelTransferi(disp, _mesa_PixelTransferi);
- SET_PixelZoom(disp, _mesa_PixelZoom);
-
- /* GL_ARB_robustness */
- SET_GetnPixelMapfvARB(disp, _mesa_GetnPixelMapfvARB);
- SET_GetnPixelMapuivARB(disp, _mesa_GetnPixelMapuivARB);
- SET_GetnPixelMapusvARB(disp, _mesa_GetnPixelMapusvARB);
-}
-
-
-#endif /* FEATURE_pixel_transfer */
-
-
-/**********************************************************************/
-/***** Initialization *****/
-/**********************************************************************/
-
-static void
-init_pixelmap(struct gl_pixelmap *map)
-{
- map->Size = 1;
- map->Map[0] = 0.0;
- map->Map8[0] = 0;
-}
-
-
-/**
- * Initialize the context's PIXEL attribute group.
- */
-void
-_mesa_init_pixel( struct gl_context *ctx )
-{
- /* Pixel group */
- ctx->Pixel.RedBias = 0.0;
- ctx->Pixel.RedScale = 1.0;
- ctx->Pixel.GreenBias = 0.0;
- ctx->Pixel.GreenScale = 1.0;
- ctx->Pixel.BlueBias = 0.0;
- ctx->Pixel.BlueScale = 1.0;
- ctx->Pixel.AlphaBias = 0.0;
- ctx->Pixel.AlphaScale = 1.0;
- ctx->Pixel.DepthBias = 0.0;
- ctx->Pixel.DepthScale = 1.0;
- ctx->Pixel.IndexOffset = 0;
- ctx->Pixel.IndexShift = 0;
- ctx->Pixel.ZoomX = 1.0;
- ctx->Pixel.ZoomY = 1.0;
- ctx->Pixel.MapColorFlag = GL_FALSE;
- ctx->Pixel.MapStencilFlag = GL_FALSE;
- init_pixelmap(&ctx->PixelMaps.StoS);
- init_pixelmap(&ctx->PixelMaps.ItoI);
- init_pixelmap(&ctx->PixelMaps.ItoR);
- init_pixelmap(&ctx->PixelMaps.ItoG);
- init_pixelmap(&ctx->PixelMaps.ItoB);
- init_pixelmap(&ctx->PixelMaps.ItoA);
- init_pixelmap(&ctx->PixelMaps.RtoR);
- init_pixelmap(&ctx->PixelMaps.GtoG);
- init_pixelmap(&ctx->PixelMaps.BtoB);
- init_pixelmap(&ctx->PixelMaps.AtoA);
-
- if (ctx->Visual.doubleBufferMode) {
- ctx->Pixel.ReadBuffer = GL_BACK;
- }
- else {
- ctx->Pixel.ReadBuffer = GL_FRONT;
- }
-
- /* Miscellaneous */
- ctx->_ImageTransferState = 0;
-}
+/*
+ * Mesa 3-D graphics library
+ * Version: 7.1
+ *
+ * Copyright (C) 1999-2008 Brian Paul All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+
+/**
+ * \file pixel.c
+ * Pixel transfer functions (glPixelZoom, glPixelMap, glPixelTransfer)
+ */
+
+#include "glheader.h"
+#include "bufferobj.h"
+#include "colormac.h"
+#include "context.h"
+#include "macros.h"
+#include "mfeatures.h"
+#include "pixel.h"
+#include "pbo.h"
+#include "mtypes.h"
+#include "main/dispatch.h"
+
+
+#if FEATURE_pixel_transfer
+
+
+/**********************************************************************/
+/***** glPixelZoom *****/
+/**********************************************************************/
+
+static void GLAPIENTRY
+_mesa_PixelZoom( GLfloat xfactor, GLfloat yfactor )
+{
+ GET_CURRENT_CONTEXT(ctx);
+
+ if (ctx->Pixel.ZoomX == xfactor &&
+ ctx->Pixel.ZoomY == yfactor)
+ return;
+
+ FLUSH_VERTICES(ctx, _NEW_PIXEL);
+ ctx->Pixel.ZoomX = xfactor;
+ ctx->Pixel.ZoomY = yfactor;
+}
+
+
+
+/**********************************************************************/
+/***** glPixelMap *****/
+/**********************************************************************/
+
+/**
+ * Return pointer to a pixelmap by name.
+ */
+static struct gl_pixelmap *
+get_pixelmap(struct gl_context *ctx, GLenum map)
+{
+ switch (map) {
+ case GL_PIXEL_MAP_I_TO_I:
+ return &ctx->PixelMaps.ItoI;
+ case GL_PIXEL_MAP_S_TO_S:
+ return &ctx->PixelMaps.StoS;
+ case GL_PIXEL_MAP_I_TO_R:
+ return &ctx->PixelMaps.ItoR;
+ case GL_PIXEL_MAP_I_TO_G:
+ return &ctx->PixelMaps.ItoG;
+ case GL_PIXEL_MAP_I_TO_B:
+ return &ctx->PixelMaps.ItoB;
+ case GL_PIXEL_MAP_I_TO_A:
+ return &ctx->PixelMaps.ItoA;
+ case GL_PIXEL_MAP_R_TO_R:
+ return &ctx->PixelMaps.RtoR;
+ case GL_PIXEL_MAP_G_TO_G:
+ return &ctx->PixelMaps.GtoG;
+ case GL_PIXEL_MAP_B_TO_B:
+ return &ctx->PixelMaps.BtoB;
+ case GL_PIXEL_MAP_A_TO_A:
+ return &ctx->PixelMaps.AtoA;
+ default:
+ return NULL;
+ }
+}
+
+
+/**
+ * Helper routine used by the other _mesa_PixelMap() functions.
+ */
+static void
+store_pixelmap(struct gl_context *ctx, GLenum map, GLsizei mapsize,
+ const GLfloat *values)
+{
+ GLint i;
+ struct gl_pixelmap *pm = get_pixelmap(ctx, map);
+ if (!pm) {
+ _mesa_error(ctx, GL_INVALID_ENUM, "glPixelMap(map)");
+ return;
+ }
+
+ switch (map) {
+ case GL_PIXEL_MAP_S_TO_S:
+ /* special case */
+ ctx->PixelMaps.StoS.Size = mapsize;
+ for (i = 0; i < mapsize; i++) {
+ ctx->PixelMaps.StoS.Map[i] = (GLfloat)IROUND(values[i]);
+ }
+ break;
+ case GL_PIXEL_MAP_I_TO_I:
+ /* special case */
+ ctx->PixelMaps.ItoI.Size = mapsize;
+ for (i = 0; i < mapsize; i++) {
+ ctx->PixelMaps.ItoI.Map[i] = values[i];
+ }
+ break;
+ default:
+ /* general case */
+ pm->Size = mapsize;
+ for (i = 0; i < mapsize; i++) {
+ GLfloat val = CLAMP(values[i], 0.0F, 1.0F);
+ pm->Map[i] = val;
+ pm->Map8[i] = (GLint) (val * 255.0F);
+ }
+ }
+}
+
+
+/**
+ * Convenience wrapper for _mesa_validate_pbo_access() for gl[Get]PixelMap().
+ */
+static GLboolean
+validate_pbo_access(struct gl_context *ctx,
+ struct gl_pixelstore_attrib *pack, GLsizei mapsize,
+ GLenum format, GLenum type, GLsizei clientMemSize,
+ const GLvoid *ptr)
+{
+ GLboolean ok;
+
+ /* Note, need to use DefaultPacking and Unpack's buffer object */
+ _mesa_reference_buffer_object(ctx,
+ &ctx->DefaultPacking.BufferObj,
+ pack->BufferObj);
+
+ ok = _mesa_validate_pbo_access(1, &ctx->DefaultPacking, mapsize, 1, 1,
+ format, type, clientMemSize, ptr);
+
+ /* restore */
+ _mesa_reference_buffer_object(ctx,
+ &ctx->DefaultPacking.BufferObj,
+ ctx->Shared->NullBufferObj);
+
+ if (!ok) {
+ if (_mesa_is_bufferobj(pack->BufferObj)) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "gl[Get]PixelMap*v(out of bounds PBO access)");
+ } else {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glGetnPixelMap*vARB(out of bounds access:"
+ " bufSize (%d) is too small)", clientMemSize);
+ }
+ }
+ return ok;
+}
+
+
+static void GLAPIENTRY
+_mesa_PixelMapfv( GLenum map, GLsizei mapsize, const GLfloat *values )
+{
+ GET_CURRENT_CONTEXT(ctx);
+ ASSERT_OUTSIDE_BEGIN_END(ctx);
+
+ /* XXX someday, test against ctx->Const.MaxPixelMapTableSize */
+ if (mapsize < 1 || mapsize > MAX_PIXEL_MAP_TABLE) {
+ _mesa_error( ctx, GL_INVALID_VALUE, "glPixelMapfv(mapsize)" );
+ return;
+ }
+
+ if (map >= GL_PIXEL_MAP_S_TO_S && map <= GL_PIXEL_MAP_I_TO_A) {
+ /* test that mapsize is a power of two */
+ if (!_mesa_is_pow_two(mapsize)) {
+ _mesa_error( ctx, GL_INVALID_VALUE, "glPixelMapfv(mapsize)" );
+ return;
+ }
+ }
+
+ FLUSH_VERTICES(ctx, _NEW_PIXEL);
+
+ if (!validate_pbo_access(ctx, &ctx->Unpack, mapsize, GL_INTENSITY,
+ GL_FLOAT, INT_MAX, values)) {
+ return;
+ }
+
+ values = (const GLfloat *) _mesa_map_pbo_source(ctx, &ctx->Unpack, values);
+ if (!values) {
+ if (_mesa_is_bufferobj(ctx->Unpack.BufferObj)) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glPixelMapfv(PBO is mapped)");
+ }
+ return;
+ }
+
+ store_pixelmap(ctx, map, mapsize, values);
+
+ _mesa_unmap_pbo_source(ctx, &ctx->Unpack);
+}
+
+
+static void GLAPIENTRY
+_mesa_PixelMapuiv(GLenum map, GLsizei mapsize, const GLuint *values )
+{
+ GLfloat fvalues[MAX_PIXEL_MAP_TABLE];
+ GET_CURRENT_CONTEXT(ctx);
+ ASSERT_OUTSIDE_BEGIN_END(ctx);
+
+ if (mapsize < 1 || mapsize > MAX_PIXEL_MAP_TABLE) {
+ _mesa_error( ctx, GL_INVALID_VALUE, "glPixelMapuiv(mapsize)" );
+ return;
+ }
+
+ if (map >= GL_PIXEL_MAP_S_TO_S && map <= GL_PIXEL_MAP_I_TO_A) {
+ /* test that mapsize is a power of two */
+ if (!_mesa_is_pow_two(mapsize)) {
+ _mesa_error( ctx, GL_INVALID_VALUE, "glPixelMapuiv(mapsize)" );
+ return;
+ }
+ }
+
+ FLUSH_VERTICES(ctx, _NEW_PIXEL);
+
+ if (!validate_pbo_access(ctx, &ctx->Unpack, mapsize, GL_INTENSITY,
+ GL_UNSIGNED_INT, INT_MAX, values)) {
+ return;
+ }
+
+ values = (const GLuint *) _mesa_map_pbo_source(ctx, &ctx->Unpack, values);
+ if (!values) {
+ if (_mesa_is_bufferobj(ctx->Unpack.BufferObj)) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glPixelMapuiv(PBO is mapped)");
+ }
+ return;
+ }
+
+ /* convert to floats */
+ if (map == GL_PIXEL_MAP_I_TO_I || map == GL_PIXEL_MAP_S_TO_S) {
+ GLint i;
+ for (i = 0; i < mapsize; i++) {
+ fvalues[i] = (GLfloat) values[i];
+ }
+ }
+ else {
+ GLint i;
+ for (i = 0; i < mapsize; i++) {
+ fvalues[i] = UINT_TO_FLOAT( values[i] );
+ }
+ }
+
+ _mesa_unmap_pbo_source(ctx, &ctx->Unpack);
+
+ store_pixelmap(ctx, map, mapsize, fvalues);
+}
+
+
+static void GLAPIENTRY
+_mesa_PixelMapusv(GLenum map, GLsizei mapsize, const GLushort *values )
+{
+ GLfloat fvalues[MAX_PIXEL_MAP_TABLE];
+ GET_CURRENT_CONTEXT(ctx);
+ ASSERT_OUTSIDE_BEGIN_END(ctx);
+
+ if (mapsize < 1 || mapsize > MAX_PIXEL_MAP_TABLE) {
+ _mesa_error( ctx, GL_INVALID_VALUE, "glPixelMapusv(mapsize)" );
+ return;
+ }
+
+ if (map >= GL_PIXEL_MAP_S_TO_S && map <= GL_PIXEL_MAP_I_TO_A) {
+ /* test that mapsize is a power of two */
+ if (!_mesa_is_pow_two(mapsize)) {
+ _mesa_error( ctx, GL_INVALID_VALUE, "glPixelMapuiv(mapsize)" );
+ return;
+ }
+ }
+
+ FLUSH_VERTICES(ctx, _NEW_PIXEL);
+
+ if (!validate_pbo_access(ctx, &ctx->Unpack, mapsize, GL_INTENSITY,
+ GL_UNSIGNED_SHORT, INT_MAX, values)) {
+ return;
+ }
+
+ values = (const GLushort *) _mesa_map_pbo_source(ctx, &ctx->Unpack, values);
+ if (!values) {
+ if (_mesa_is_bufferobj(ctx->Unpack.BufferObj)) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glPixelMapusv(PBO is mapped)");
+ }
+ return;
+ }
+
+ /* convert to floats */
+ if (map == GL_PIXEL_MAP_I_TO_I || map == GL_PIXEL_MAP_S_TO_S) {
+ GLint i;
+ for (i = 0; i < mapsize; i++) {
+ fvalues[i] = (GLfloat) values[i];
+ }
+ }
+ else {
+ GLint i;
+ for (i = 0; i < mapsize; i++) {
+ fvalues[i] = USHORT_TO_FLOAT( values[i] );
+ }
+ }
+
+ _mesa_unmap_pbo_source(ctx, &ctx->Unpack);
+
+ store_pixelmap(ctx, map, mapsize, fvalues);
+}
+
+
+static void GLAPIENTRY
+_mesa_GetnPixelMapfvARB( GLenum map, GLsizei bufSize, GLfloat *values )
+{
+ GET_CURRENT_CONTEXT(ctx);
+ GLint mapsize, i;
+ const struct gl_pixelmap *pm;
+
+ ASSERT_OUTSIDE_BEGIN_END(ctx);
+
+ pm = get_pixelmap(ctx, map);
+ if (!pm) {
+ _mesa_error(ctx, GL_INVALID_ENUM, "glGetPixelMapfv(map)");
+ return;
+ }
+
+ mapsize = pm->Size;
+
+ if (!validate_pbo_access(ctx, &ctx->Pack, mapsize, GL_INTENSITY,
+ GL_FLOAT, bufSize, values)) {
+ return;
+ }
+
+ values = (GLfloat *) _mesa_map_pbo_dest(ctx, &ctx->Pack, values);
+ if (!values) {
+ if (_mesa_is_bufferobj(ctx->Pack.BufferObj)) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glGetPixelMapfv(PBO is mapped)");
+ }
+ return;
+ }
+
+ if (map == GL_PIXEL_MAP_S_TO_S) {
+ /* special case */
+ for (i = 0; i < mapsize; i++) {
+ values[i] = (GLfloat) ctx->PixelMaps.StoS.Map[i];
+ }
+ }
+ else {
+ memcpy(values, pm->Map, mapsize * sizeof(GLfloat));
+ }
+
+ _mesa_unmap_pbo_dest(ctx, &ctx->Pack);
+}
+
+
+static void GLAPIENTRY
+_mesa_GetPixelMapfv( GLenum map, GLfloat *values )
+{
+ _mesa_GetnPixelMapfvARB(map, INT_MAX, values);
+}
+
+static void GLAPIENTRY
+_mesa_GetnPixelMapuivARB( GLenum map, GLsizei bufSize, GLuint *values )
+{
+ GET_CURRENT_CONTEXT(ctx);
+ GLint mapsize, i;
+ const struct gl_pixelmap *pm;
+
+ ASSERT_OUTSIDE_BEGIN_END(ctx);
+
+ pm = get_pixelmap(ctx, map);
+ if (!pm) {
+ _mesa_error(ctx, GL_INVALID_ENUM, "glGetPixelMapuiv(map)");
+ return;
+ }
+
+ mapsize = pm->Size;
+
+ if (!validate_pbo_access(ctx, &ctx->Pack, mapsize, GL_INTENSITY,
+ GL_UNSIGNED_INT, bufSize, values)) {
+ return;
+ }
+
+ values = (GLuint *) _mesa_map_pbo_dest(ctx, &ctx->Pack, values);
+ if (!values) {
+ if (_mesa_is_bufferobj(ctx->Pack.BufferObj)) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glGetPixelMapuiv(PBO is mapped)");
+ }
+ return;
+ }
+
+ if (map == GL_PIXEL_MAP_S_TO_S) {
+ /* special case */
+ memcpy(values, ctx->PixelMaps.StoS.Map, mapsize * sizeof(GLint));
+ }
+ else {
+ for (i = 0; i < mapsize; i++) {
+ values[i] = FLOAT_TO_UINT( pm->Map[i] );
+ }
+ }
+
+ _mesa_unmap_pbo_dest(ctx, &ctx->Pack);
+}
+
+
+static void GLAPIENTRY
+_mesa_GetPixelMapuiv( GLenum map, GLuint *values )
+{
+ _mesa_GetnPixelMapuivARB(map, INT_MAX, values);
+}
+
+static void GLAPIENTRY
+_mesa_GetnPixelMapusvARB( GLenum map, GLsizei bufSize, GLushort *values )
+{
+ GET_CURRENT_CONTEXT(ctx);
+ GLint mapsize, i;
+ const struct gl_pixelmap *pm;
+
+ ASSERT_OUTSIDE_BEGIN_END(ctx);
+
+ pm = get_pixelmap(ctx, map);
+ if (!pm) {
+ _mesa_error(ctx, GL_INVALID_ENUM, "glGetPixelMapusv(map)");
+ return;
+ }
+
+ mapsize = pm->Size;
+
+ if (!validate_pbo_access(ctx, &ctx->Pack, mapsize, GL_INTENSITY,
+ GL_UNSIGNED_SHORT, bufSize, values)) {
+ return;
+ }
+
+ values = (GLushort *) _mesa_map_pbo_dest(ctx, &ctx->Pack, values);
+ if (!values) {
+ if (_mesa_is_bufferobj(ctx->Pack.BufferObj)) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glGetPixelMapusv(PBO is mapped)");
+ }
+ return;
+ }
+
+ switch (map) {
+ /* special cases */
+ case GL_PIXEL_MAP_I_TO_I:
+ for (i = 0; i < mapsize; i++) {
+ values[i] = (GLushort) CLAMP(ctx->PixelMaps.ItoI.Map[i], 0.0, 65535.);
+ }
+ break;
+ case GL_PIXEL_MAP_S_TO_S:
+ for (i = 0; i < mapsize; i++) {
+ values[i] = (GLushort) CLAMP(ctx->PixelMaps.StoS.Map[i], 0.0, 65535.);
+ }
+ break;
+ default:
+ for (i = 0; i < mapsize; i++) {
+ CLAMPED_FLOAT_TO_USHORT(values[i], pm->Map[i] );
+ }
+ }
+
+ _mesa_unmap_pbo_dest(ctx, &ctx->Pack);
+}
+
+
+static void GLAPIENTRY
+_mesa_GetPixelMapusv( GLenum map, GLushort *values )
+{
+ _mesa_GetnPixelMapusvARB(map, INT_MAX, values);
+}
+
+
+/**********************************************************************/
+/***** glPixelTransfer *****/
+/**********************************************************************/
+
+
+/*
+ * Implements glPixelTransfer[fi] whether called immediately or from a
+ * display list.
+ */
+static void GLAPIENTRY
+_mesa_PixelTransferf( GLenum pname, GLfloat param )
+{
+ GET_CURRENT_CONTEXT(ctx);
+ ASSERT_OUTSIDE_BEGIN_END(ctx);
+
+ switch (pname) {
+ case GL_MAP_COLOR:
+ if (ctx->Pixel.MapColorFlag == (param ? GL_TRUE : GL_FALSE))
+ return;
+ FLUSH_VERTICES(ctx, _NEW_PIXEL);
+ ctx->Pixel.MapColorFlag = param ? GL_TRUE : GL_FALSE;
+ break;
+ case GL_MAP_STENCIL:
+ if (ctx->Pixel.MapStencilFlag == (param ? GL_TRUE : GL_FALSE))
+ return;
+ FLUSH_VERTICES(ctx, _NEW_PIXEL);
+ ctx->Pixel.MapStencilFlag = param ? GL_TRUE : GL_FALSE;
+ break;
+ case GL_INDEX_SHIFT:
+ if (ctx->Pixel.IndexShift == (GLint) param)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_PIXEL);
+ ctx->Pixel.IndexShift = (GLint) param;
+ break;
+ case GL_INDEX_OFFSET:
+ if (ctx->Pixel.IndexOffset == (GLint) param)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_PIXEL);
+ ctx->Pixel.IndexOffset = (GLint) param;
+ break;
+ case GL_RED_SCALE:
+ if (ctx->Pixel.RedScale == param)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_PIXEL);
+ ctx->Pixel.RedScale = param;
+ break;
+ case GL_RED_BIAS:
+ if (ctx->Pixel.RedBias == param)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_PIXEL);
+ ctx->Pixel.RedBias = param;
+ break;
+ case GL_GREEN_SCALE:
+ if (ctx->Pixel.GreenScale == param)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_PIXEL);
+ ctx->Pixel.GreenScale = param;
+ break;
+ case GL_GREEN_BIAS:
+ if (ctx->Pixel.GreenBias == param)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_PIXEL);
+ ctx->Pixel.GreenBias = param;
+ break;
+ case GL_BLUE_SCALE:
+ if (ctx->Pixel.BlueScale == param)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_PIXEL);
+ ctx->Pixel.BlueScale = param;
+ break;
+ case GL_BLUE_BIAS:
+ if (ctx->Pixel.BlueBias == param)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_PIXEL);
+ ctx->Pixel.BlueBias = param;
+ break;
+ case GL_ALPHA_SCALE:
+ if (ctx->Pixel.AlphaScale == param)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_PIXEL);
+ ctx->Pixel.AlphaScale = param;
+ break;
+ case GL_ALPHA_BIAS:
+ if (ctx->Pixel.AlphaBias == param)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_PIXEL);
+ ctx->Pixel.AlphaBias = param;
+ break;
+ case GL_DEPTH_SCALE:
+ if (ctx->Pixel.DepthScale == param)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_PIXEL);
+ ctx->Pixel.DepthScale = param;
+ break;
+ case GL_DEPTH_BIAS:
+ if (ctx->Pixel.DepthBias == param)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_PIXEL);
+ ctx->Pixel.DepthBias = param;
+ break;
+ default:
+ _mesa_error( ctx, GL_INVALID_ENUM, "glPixelTransfer(pname)" );
+ return;
+ }
+}
+
+
+static void GLAPIENTRY
+_mesa_PixelTransferi( GLenum pname, GLint param )
+{
+ _mesa_PixelTransferf( pname, (GLfloat) param );
+}
+
+
+
+/**********************************************************************/
+/***** State Management *****/
+/**********************************************************************/
+
+/*
+ * Return a bitmask of IMAGE_*_BIT flags which to indicate which
+ * pixel transfer operations are enabled.
+ */
+static void
+update_image_transfer_state(struct gl_context *ctx)
+{
+ GLuint mask = 0;
+
+ if (ctx->Pixel.RedScale != 1.0F || ctx->Pixel.RedBias != 0.0F ||
+ ctx->Pixel.GreenScale != 1.0F || ctx->Pixel.GreenBias != 0.0F ||
+ ctx->Pixel.BlueScale != 1.0F || ctx->Pixel.BlueBias != 0.0F ||
+ ctx->Pixel.AlphaScale != 1.0F || ctx->Pixel.AlphaBias != 0.0F)
+ mask |= IMAGE_SCALE_BIAS_BIT;
+
+ if (ctx->Pixel.IndexShift || ctx->Pixel.IndexOffset)
+ mask |= IMAGE_SHIFT_OFFSET_BIT;
+
+ if (ctx->Pixel.MapColorFlag)
+ mask |= IMAGE_MAP_COLOR_BIT;
+
+ ctx->_ImageTransferState = mask;
+}
+
+
+/**
+ * Update mesa pixel transfer derived state.
+ */
+void _mesa_update_pixel( struct gl_context *ctx, GLuint new_state )
+{
+ if (new_state & _NEW_PIXEL)
+ update_image_transfer_state(ctx);
+}
+
+
+void
+_mesa_init_pixel_dispatch(struct _glapi_table *disp)
+{
+ SET_GetPixelMapfv(disp, _mesa_GetPixelMapfv);
+ SET_GetPixelMapuiv(disp, _mesa_GetPixelMapuiv);
+ SET_GetPixelMapusv(disp, _mesa_GetPixelMapusv);
+ SET_PixelMapfv(disp, _mesa_PixelMapfv);
+ SET_PixelMapuiv(disp, _mesa_PixelMapuiv);
+ SET_PixelMapusv(disp, _mesa_PixelMapusv);
+ SET_PixelTransferf(disp, _mesa_PixelTransferf);
+ SET_PixelTransferi(disp, _mesa_PixelTransferi);
+ SET_PixelZoom(disp, _mesa_PixelZoom);
+
+ /* GL_ARB_robustness */
+ SET_GetnPixelMapfvARB(disp, _mesa_GetnPixelMapfvARB);
+ SET_GetnPixelMapuivARB(disp, _mesa_GetnPixelMapuivARB);
+ SET_GetnPixelMapusvARB(disp, _mesa_GetnPixelMapusvARB);
+}
+
+
+#endif /* FEATURE_pixel_transfer */
+
+
+/**********************************************************************/
+/***** Initialization *****/
+/**********************************************************************/
+
+static void
+init_pixelmap(struct gl_pixelmap *map)
+{
+ map->Size = 1;
+ map->Map[0] = 0.0;
+ map->Map8[0] = 0;
+}
+
+
+/**
+ * Initialize the context's PIXEL attribute group.
+ */
+void
+_mesa_init_pixel( struct gl_context *ctx )
+{
+ /* Pixel group */
+ ctx->Pixel.RedBias = 0.0;
+ ctx->Pixel.RedScale = 1.0;
+ ctx->Pixel.GreenBias = 0.0;
+ ctx->Pixel.GreenScale = 1.0;
+ ctx->Pixel.BlueBias = 0.0;
+ ctx->Pixel.BlueScale = 1.0;
+ ctx->Pixel.AlphaBias = 0.0;
+ ctx->Pixel.AlphaScale = 1.0;
+ ctx->Pixel.DepthBias = 0.0;
+ ctx->Pixel.DepthScale = 1.0;
+ ctx->Pixel.IndexOffset = 0;
+ ctx->Pixel.IndexShift = 0;
+ ctx->Pixel.ZoomX = 1.0;
+ ctx->Pixel.ZoomY = 1.0;
+ ctx->Pixel.MapColorFlag = GL_FALSE;
+ ctx->Pixel.MapStencilFlag = GL_FALSE;
+ init_pixelmap(&ctx->PixelMaps.StoS);
+ init_pixelmap(&ctx->PixelMaps.ItoI);
+ init_pixelmap(&ctx->PixelMaps.ItoR);
+ init_pixelmap(&ctx->PixelMaps.ItoG);
+ init_pixelmap(&ctx->PixelMaps.ItoB);
+ init_pixelmap(&ctx->PixelMaps.ItoA);
+ init_pixelmap(&ctx->PixelMaps.RtoR);
+ init_pixelmap(&ctx->PixelMaps.GtoG);
+ init_pixelmap(&ctx->PixelMaps.BtoB);
+ init_pixelmap(&ctx->PixelMaps.AtoA);
+
+ if (ctx->Visual.doubleBufferMode) {
+ ctx->Pixel.ReadBuffer = GL_BACK;
+ }
+ else {
+ ctx->Pixel.ReadBuffer = GL_FRONT;
+ }
+
+ /* Miscellaneous */
+ ctx->_ImageTransferState = 0;
+}
diff --git a/mesalib/src/mesa/main/polygon.c b/mesalib/src/mesa/main/polygon.c
index addca0228..fc64cf4a0 100644
--- a/mesalib/src/mesa/main/polygon.c
+++ b/mesalib/src/mesa/main/polygon.c
@@ -1,330 +1,330 @@
-/**
- * \file polygon.c
- * Polygon operations.
- */
-
-/*
- * Mesa 3-D graphics library
- * Version: 6.5.1
- *
- * Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-
-#include "glheader.h"
-#include "imports.h"
-#include "context.h"
-#include "image.h"
-#include "enums.h"
-#include "pack.h"
-#include "pbo.h"
-#include "polygon.h"
-#include "mtypes.h"
-
-
-/**
- * Specify whether to cull front- or back-facing facets.
- *
- * \param mode culling mode.
- *
- * \sa glCullFace().
- *
- * Verifies the parameter and updates gl_polygon_attrib::CullFaceMode. On
- * change, flushes the vertices and notifies the driver via
- * the dd_function_table::CullFace callback.
- */
-void GLAPIENTRY
-_mesa_CullFace( GLenum mode )
-{
- GET_CURRENT_CONTEXT(ctx);
- ASSERT_OUTSIDE_BEGIN_END(ctx);
-
- if (MESA_VERBOSE&VERBOSE_API)
- _mesa_debug(ctx, "glCullFace %s\n", _mesa_lookup_enum_by_nr(mode));
-
- if (mode!=GL_FRONT && mode!=GL_BACK && mode!=GL_FRONT_AND_BACK) {
- _mesa_error( ctx, GL_INVALID_ENUM, "glCullFace" );
- return;
- }
-
- if (ctx->Polygon.CullFaceMode == mode)
- return;
-
- FLUSH_VERTICES(ctx, _NEW_POLYGON);
- ctx->Polygon.CullFaceMode = mode;
-
- if (ctx->Driver.CullFace)
- ctx->Driver.CullFace( ctx, mode );
-}
-
-
-/**
- * Define front- and back-facing
- *
- * \param mode orientation of front-facing polygons.
- *
- * \sa glFrontFace().
- *
- * Verifies the parameter and updates gl_polygon_attrib::FrontFace. On change
- * flushes the vertices and notifies the driver via
- * the dd_function_table::FrontFace callback.
- */
-void GLAPIENTRY
-_mesa_FrontFace( GLenum mode )
-{
- GET_CURRENT_CONTEXT(ctx);
- ASSERT_OUTSIDE_BEGIN_END(ctx);
-
- if (MESA_VERBOSE&VERBOSE_API)
- _mesa_debug(ctx, "glFrontFace %s\n", _mesa_lookup_enum_by_nr(mode));
-
- if (mode!=GL_CW && mode!=GL_CCW) {
- _mesa_error( ctx, GL_INVALID_ENUM, "glFrontFace" );
- return;
- }
-
- if (ctx->Polygon.FrontFace == mode)
- return;
-
- FLUSH_VERTICES(ctx, _NEW_POLYGON);
- ctx->Polygon.FrontFace = mode;
-
- ctx->Polygon._FrontBit = (GLboolean) (mode == GL_CW);
-
- if (ctx->Driver.FrontFace)
- ctx->Driver.FrontFace( ctx, mode );
-}
-
-
-/**
- * Set the polygon rasterization mode.
- *
- * \param face the polygons which \p mode applies to.
- * \param mode how polygons should be rasterized.
- *
- * \sa glPolygonMode().
- *
- * Verifies the parameters and updates gl_polygon_attrib::FrontMode and
- * gl_polygon_attrib::BackMode. On change flushes the vertices and notifies the
- * driver via the dd_function_table::PolygonMode callback.
- */
-void GLAPIENTRY
-_mesa_PolygonMode( GLenum face, GLenum mode )
-{
- GET_CURRENT_CONTEXT(ctx);
- ASSERT_OUTSIDE_BEGIN_END(ctx);
-
- if (MESA_VERBOSE&VERBOSE_API)
- _mesa_debug(ctx, "glPolygonMode %s %s\n",
- _mesa_lookup_enum_by_nr(face),
- _mesa_lookup_enum_by_nr(mode));
-
- if (mode!=GL_POINT && mode!=GL_LINE && mode!=GL_FILL) {
- _mesa_error( ctx, GL_INVALID_ENUM, "glPolygonMode(mode)" );
- return;
- }
-
- switch (face) {
- case GL_FRONT:
- if (ctx->Polygon.FrontMode == mode)
- return;
- FLUSH_VERTICES(ctx, _NEW_POLYGON);
- ctx->Polygon.FrontMode = mode;
- break;
- case GL_FRONT_AND_BACK:
- if (ctx->Polygon.FrontMode == mode &&
- ctx->Polygon.BackMode == mode)
- return;
- FLUSH_VERTICES(ctx, _NEW_POLYGON);
- ctx->Polygon.FrontMode = mode;
- ctx->Polygon.BackMode = mode;
- break;
- case GL_BACK:
- if (ctx->Polygon.BackMode == mode)
- return;
- FLUSH_VERTICES(ctx, _NEW_POLYGON);
- ctx->Polygon.BackMode = mode;
- break;
- default:
- _mesa_error( ctx, GL_INVALID_ENUM, "glPolygonMode(face)" );
- return;
- }
-
- if (ctx->Polygon.FrontMode == GL_FILL && ctx->Polygon.BackMode == GL_FILL)
- ctx->_TriangleCaps &= ~DD_TRI_UNFILLED;
- else
- ctx->_TriangleCaps |= DD_TRI_UNFILLED;
-
- if (ctx->Driver.PolygonMode)
- ctx->Driver.PolygonMode(ctx, face, mode);
-}
-
-#if _HAVE_FULL_GL
-
-
-/**
- * This routine updates the ctx->Polygon.Stipple state.
- * If we're getting the stipple data from a PBO, we map the buffer
- * in order to access the data.
- * In any case, we obey the current pixel unpacking parameters when fetching
- * the stipple data.
- *
- * In the future, this routine should be used as a fallback, called via
- * ctx->Driver.PolygonStipple(). We'll have to update all the DRI drivers
- * too.
- */
-void
-_mesa_polygon_stipple(struct gl_context *ctx, const GLubyte *pattern)
-{
- pattern = _mesa_map_validate_pbo_source(ctx, 2,
- &ctx->Unpack, 32, 32, 1,
- GL_COLOR_INDEX, GL_BITMAP,
- INT_MAX, pattern,
- "glPolygonStipple");
- if (!pattern)
- return;
-
- _mesa_unpack_polygon_stipple(pattern, ctx->PolygonStipple, &ctx->Unpack);
-
- _mesa_unmap_pbo_source(ctx, &ctx->Unpack);
-}
-
-
-/**
- * Called by glPolygonStipple.
- */
-void GLAPIENTRY
-_mesa_PolygonStipple( const GLubyte *pattern )
-{
- GET_CURRENT_CONTEXT(ctx);
- ASSERT_OUTSIDE_BEGIN_END(ctx);
-
- if (MESA_VERBOSE&VERBOSE_API)
- _mesa_debug(ctx, "glPolygonStipple\n");
-
- FLUSH_VERTICES(ctx, _NEW_POLYGONSTIPPLE);
-
- _mesa_polygon_stipple(ctx, pattern);
-
- if (ctx->Driver.PolygonStipple)
- ctx->Driver.PolygonStipple(ctx, pattern);
-}
-
-
-/**
- * Called by glPolygonStipple.
- */
-void GLAPIENTRY
-_mesa_GetnPolygonStippleARB( GLsizei bufSize, GLubyte *dest )
-{
- GET_CURRENT_CONTEXT(ctx);
- ASSERT_OUTSIDE_BEGIN_END(ctx);
-
- if (MESA_VERBOSE&VERBOSE_API)
- _mesa_debug(ctx, "glGetPolygonStipple\n");
-
- dest = _mesa_map_validate_pbo_dest(ctx, 2,
- &ctx->Pack, 32, 32, 1,
- GL_COLOR_INDEX, GL_BITMAP,
- bufSize, dest, "glGetPolygonStipple");
- if (!dest)
- return;
-
- _mesa_pack_polygon_stipple(ctx->PolygonStipple, dest, &ctx->Pack);
-
- _mesa_unmap_pbo_dest(ctx, &ctx->Pack);
-}
-
-
-void GLAPIENTRY
-_mesa_GetPolygonStipple( GLubyte *dest )
-{
- _mesa_GetnPolygonStippleARB(INT_MAX, dest);
-}
-
-
-void GLAPIENTRY
-_mesa_PolygonOffset( GLfloat factor, GLfloat units )
-{
- GET_CURRENT_CONTEXT(ctx);
- ASSERT_OUTSIDE_BEGIN_END(ctx);
-
- if (MESA_VERBOSE&VERBOSE_API)
- _mesa_debug(ctx, "glPolygonOffset %f %f\n", factor, units);
-
- if (ctx->Polygon.OffsetFactor == factor &&
- ctx->Polygon.OffsetUnits == units)
- return;
-
- FLUSH_VERTICES(ctx, _NEW_POLYGON);
- ctx->Polygon.OffsetFactor = factor;
- ctx->Polygon.OffsetUnits = units;
-
- if (ctx->Driver.PolygonOffset)
- ctx->Driver.PolygonOffset( ctx, factor, units );
-}
-
-
-void GLAPIENTRY
-_mesa_PolygonOffsetEXT( GLfloat factor, GLfloat bias )
-{
- GET_CURRENT_CONTEXT(ctx);
- /* XXX mult by DepthMaxF here??? */
- _mesa_PolygonOffset(factor, bias * ctx->DrawBuffer->_DepthMaxF );
-}
-
-#endif
-
-
-/**********************************************************************/
-/** \name Initialization */
-/*@{*/
-
-/**
- * Initialize the context polygon state.
- *
- * \param ctx GL context.
- *
- * Initializes __struct gl_contextRec::Polygon and __struct gl_contextRec::PolygonStipple
- * attribute groups.
- */
-void _mesa_init_polygon( struct gl_context * ctx )
-{
- /* Polygon group */
- ctx->Polygon.CullFlag = GL_FALSE;
- ctx->Polygon.CullFaceMode = GL_BACK;
- ctx->Polygon.FrontFace = GL_CCW;
- ctx->Polygon._FrontBit = 0;
- ctx->Polygon.FrontMode = GL_FILL;
- ctx->Polygon.BackMode = GL_FILL;
- ctx->Polygon.SmoothFlag = GL_FALSE;
- ctx->Polygon.StippleFlag = GL_FALSE;
- ctx->Polygon.OffsetFactor = 0.0F;
- ctx->Polygon.OffsetUnits = 0.0F;
- ctx->Polygon.OffsetPoint = GL_FALSE;
- ctx->Polygon.OffsetLine = GL_FALSE;
- ctx->Polygon.OffsetFill = GL_FALSE;
-
-
- /* Polygon Stipple group */
- memset( ctx->PolygonStipple, 0xff, 32*sizeof(GLuint) );
-}
-
-/*@}*/
+/**
+ * \file polygon.c
+ * Polygon operations.
+ */
+
+/*
+ * Mesa 3-D graphics library
+ * Version: 6.5.1
+ *
+ * Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+
+#include "glheader.h"
+#include "imports.h"
+#include "context.h"
+#include "image.h"
+#include "enums.h"
+#include "pack.h"
+#include "pbo.h"
+#include "polygon.h"
+#include "mtypes.h"
+
+
+/**
+ * Specify whether to cull front- or back-facing facets.
+ *
+ * \param mode culling mode.
+ *
+ * \sa glCullFace().
+ *
+ * Verifies the parameter and updates gl_polygon_attrib::CullFaceMode. On
+ * change, flushes the vertices and notifies the driver via
+ * the dd_function_table::CullFace callback.
+ */
+void GLAPIENTRY
+_mesa_CullFace( GLenum mode )
+{
+ GET_CURRENT_CONTEXT(ctx);
+ ASSERT_OUTSIDE_BEGIN_END(ctx);
+
+ if (MESA_VERBOSE&VERBOSE_API)
+ _mesa_debug(ctx, "glCullFace %s\n", _mesa_lookup_enum_by_nr(mode));
+
+ if (mode!=GL_FRONT && mode!=GL_BACK && mode!=GL_FRONT_AND_BACK) {
+ _mesa_error( ctx, GL_INVALID_ENUM, "glCullFace" );
+ return;
+ }
+
+ if (ctx->Polygon.CullFaceMode == mode)
+ return;
+
+ FLUSH_VERTICES(ctx, _NEW_POLYGON);
+ ctx->Polygon.CullFaceMode = mode;
+
+ if (ctx->Driver.CullFace)
+ ctx->Driver.CullFace( ctx, mode );
+}
+
+
+/**
+ * Define front- and back-facing
+ *
+ * \param mode orientation of front-facing polygons.
+ *
+ * \sa glFrontFace().
+ *
+ * Verifies the parameter and updates gl_polygon_attrib::FrontFace. On change
+ * flushes the vertices and notifies the driver via
+ * the dd_function_table::FrontFace callback.
+ */
+void GLAPIENTRY
+_mesa_FrontFace( GLenum mode )
+{
+ GET_CURRENT_CONTEXT(ctx);
+ ASSERT_OUTSIDE_BEGIN_END(ctx);
+
+ if (MESA_VERBOSE&VERBOSE_API)
+ _mesa_debug(ctx, "glFrontFace %s\n", _mesa_lookup_enum_by_nr(mode));
+
+ if (mode!=GL_CW && mode!=GL_CCW) {
+ _mesa_error( ctx, GL_INVALID_ENUM, "glFrontFace" );
+ return;
+ }
+
+ if (ctx->Polygon.FrontFace == mode)
+ return;
+
+ FLUSH_VERTICES(ctx, _NEW_POLYGON);
+ ctx->Polygon.FrontFace = mode;
+
+ ctx->Polygon._FrontBit = (GLboolean) (mode == GL_CW);
+
+ if (ctx->Driver.FrontFace)
+ ctx->Driver.FrontFace( ctx, mode );
+}
+
+
+/**
+ * Set the polygon rasterization mode.
+ *
+ * \param face the polygons which \p mode applies to.
+ * \param mode how polygons should be rasterized.
+ *
+ * \sa glPolygonMode().
+ *
+ * Verifies the parameters and updates gl_polygon_attrib::FrontMode and
+ * gl_polygon_attrib::BackMode. On change flushes the vertices and notifies the
+ * driver via the dd_function_table::PolygonMode callback.
+ */
+void GLAPIENTRY
+_mesa_PolygonMode( GLenum face, GLenum mode )
+{
+ GET_CURRENT_CONTEXT(ctx);
+ ASSERT_OUTSIDE_BEGIN_END(ctx);
+
+ if (MESA_VERBOSE&VERBOSE_API)
+ _mesa_debug(ctx, "glPolygonMode %s %s\n",
+ _mesa_lookup_enum_by_nr(face),
+ _mesa_lookup_enum_by_nr(mode));
+
+ if (mode!=GL_POINT && mode!=GL_LINE && mode!=GL_FILL) {
+ _mesa_error( ctx, GL_INVALID_ENUM, "glPolygonMode(mode)" );
+ return;
+ }
+
+ switch (face) {
+ case GL_FRONT:
+ if (ctx->Polygon.FrontMode == mode)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_POLYGON);
+ ctx->Polygon.FrontMode = mode;
+ break;
+ case GL_FRONT_AND_BACK:
+ if (ctx->Polygon.FrontMode == mode &&
+ ctx->Polygon.BackMode == mode)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_POLYGON);
+ ctx->Polygon.FrontMode = mode;
+ ctx->Polygon.BackMode = mode;
+ break;
+ case GL_BACK:
+ if (ctx->Polygon.BackMode == mode)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_POLYGON);
+ ctx->Polygon.BackMode = mode;
+ break;
+ default:
+ _mesa_error( ctx, GL_INVALID_ENUM, "glPolygonMode(face)" );
+ return;
+ }
+
+ if (ctx->Polygon.FrontMode == GL_FILL && ctx->Polygon.BackMode == GL_FILL)
+ ctx->_TriangleCaps &= ~DD_TRI_UNFILLED;
+ else
+ ctx->_TriangleCaps |= DD_TRI_UNFILLED;
+
+ if (ctx->Driver.PolygonMode)
+ ctx->Driver.PolygonMode(ctx, face, mode);
+}
+
+#if _HAVE_FULL_GL
+
+
+/**
+ * This routine updates the ctx->Polygon.Stipple state.
+ * If we're getting the stipple data from a PBO, we map the buffer
+ * in order to access the data.
+ * In any case, we obey the current pixel unpacking parameters when fetching
+ * the stipple data.
+ *
+ * In the future, this routine should be used as a fallback, called via
+ * ctx->Driver.PolygonStipple(). We'll have to update all the DRI drivers
+ * too.
+ */
+void
+_mesa_polygon_stipple(struct gl_context *ctx, const GLubyte *pattern)
+{
+ pattern = _mesa_map_validate_pbo_source(ctx, 2,
+ &ctx->Unpack, 32, 32, 1,
+ GL_COLOR_INDEX, GL_BITMAP,
+ INT_MAX, pattern,
+ "glPolygonStipple");
+ if (!pattern)
+ return;
+
+ _mesa_unpack_polygon_stipple(pattern, ctx->PolygonStipple, &ctx->Unpack);
+
+ _mesa_unmap_pbo_source(ctx, &ctx->Unpack);
+}
+
+
+/**
+ * Called by glPolygonStipple.
+ */
+void GLAPIENTRY
+_mesa_PolygonStipple( const GLubyte *pattern )
+{
+ GET_CURRENT_CONTEXT(ctx);
+ ASSERT_OUTSIDE_BEGIN_END(ctx);
+
+ if (MESA_VERBOSE&VERBOSE_API)
+ _mesa_debug(ctx, "glPolygonStipple\n");
+
+ FLUSH_VERTICES(ctx, _NEW_POLYGONSTIPPLE);
+
+ _mesa_polygon_stipple(ctx, pattern);
+
+ if (ctx->Driver.PolygonStipple)
+ ctx->Driver.PolygonStipple(ctx, pattern);
+}
+
+
+/**
+ * Called by glPolygonStipple.
+ */
+void GLAPIENTRY
+_mesa_GetnPolygonStippleARB( GLsizei bufSize, GLubyte *dest )
+{
+ GET_CURRENT_CONTEXT(ctx);
+ ASSERT_OUTSIDE_BEGIN_END(ctx);
+
+ if (MESA_VERBOSE&VERBOSE_API)
+ _mesa_debug(ctx, "glGetPolygonStipple\n");
+
+ dest = _mesa_map_validate_pbo_dest(ctx, 2,
+ &ctx->Pack, 32, 32, 1,
+ GL_COLOR_INDEX, GL_BITMAP,
+ bufSize, dest, "glGetPolygonStipple");
+ if (!dest)
+ return;
+
+ _mesa_pack_polygon_stipple(ctx->PolygonStipple, dest, &ctx->Pack);
+
+ _mesa_unmap_pbo_dest(ctx, &ctx->Pack);
+}
+
+
+void GLAPIENTRY
+_mesa_GetPolygonStipple( GLubyte *dest )
+{
+ _mesa_GetnPolygonStippleARB(INT_MAX, dest);
+}
+
+
+void GLAPIENTRY
+_mesa_PolygonOffset( GLfloat factor, GLfloat units )
+{
+ GET_CURRENT_CONTEXT(ctx);
+ ASSERT_OUTSIDE_BEGIN_END(ctx);
+
+ if (MESA_VERBOSE&VERBOSE_API)
+ _mesa_debug(ctx, "glPolygonOffset %f %f\n", factor, units);
+
+ if (ctx->Polygon.OffsetFactor == factor &&
+ ctx->Polygon.OffsetUnits == units)
+ return;
+
+ FLUSH_VERTICES(ctx, _NEW_POLYGON);
+ ctx->Polygon.OffsetFactor = factor;
+ ctx->Polygon.OffsetUnits = units;
+
+ if (ctx->Driver.PolygonOffset)
+ ctx->Driver.PolygonOffset( ctx, factor, units );
+}
+
+
+void GLAPIENTRY
+_mesa_PolygonOffsetEXT( GLfloat factor, GLfloat bias )
+{
+ GET_CURRENT_CONTEXT(ctx);
+ /* XXX mult by DepthMaxF here??? */
+ _mesa_PolygonOffset(factor, bias * ctx->DrawBuffer->_DepthMaxF );
+}
+
+#endif
+
+
+/**********************************************************************/
+/** \name Initialization */
+/*@{*/
+
+/**
+ * Initialize the context polygon state.
+ *
+ * \param ctx GL context.
+ *
+ * Initializes __struct gl_contextRec::Polygon and __struct gl_contextRec::PolygonStipple
+ * attribute groups.
+ */
+void _mesa_init_polygon( struct gl_context * ctx )
+{
+ /* Polygon group */
+ ctx->Polygon.CullFlag = GL_FALSE;
+ ctx->Polygon.CullFaceMode = GL_BACK;
+ ctx->Polygon.FrontFace = GL_CCW;
+ ctx->Polygon._FrontBit = 0;
+ ctx->Polygon.FrontMode = GL_FILL;
+ ctx->Polygon.BackMode = GL_FILL;
+ ctx->Polygon.SmoothFlag = GL_FALSE;
+ ctx->Polygon.StippleFlag = GL_FALSE;
+ ctx->Polygon.OffsetFactor = 0.0F;
+ ctx->Polygon.OffsetUnits = 0.0F;
+ ctx->Polygon.OffsetPoint = GL_FALSE;
+ ctx->Polygon.OffsetLine = GL_FALSE;
+ ctx->Polygon.OffsetFill = GL_FALSE;
+
+
+ /* Polygon Stipple group */
+ memset( ctx->PolygonStipple, 0xff, 32*sizeof(GLuint) );
+}
+
+/*@}*/
diff --git a/mesalib/src/mesa/main/polygon.h b/mesalib/src/mesa/main/polygon.h
index 35f222f26..7f6a94bad 100644
--- a/mesalib/src/mesa/main/polygon.h
+++ b/mesalib/src/mesa/main/polygon.h
@@ -1,70 +1,70 @@
-/**
- * \file polygon.h
- * Polygon operations.
- */
-
-/*
- * Mesa 3-D graphics library
- * Version: 6.5.1
- *
- * Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-
-#ifndef POLYGON_H
-#define POLYGON_H
-
-
-#include "glheader.h"
-
-struct gl_context;
-
-extern void GLAPIENTRY
-_mesa_GetnPolygonStippleARB( GLsizei bufSize, GLubyte *dest );
-
-extern void
-_mesa_polygon_stipple(struct gl_context *ctx, const GLubyte *pattern);
-
-
-extern void GLAPIENTRY
-_mesa_CullFace( GLenum mode );
-
-extern void GLAPIENTRY
-_mesa_FrontFace( GLenum mode );
-
-extern void GLAPIENTRY
-_mesa_PolygonMode( GLenum face, GLenum mode );
-
-extern void GLAPIENTRY
-_mesa_PolygonOffset( GLfloat factor, GLfloat units );
-
-extern void GLAPIENTRY
-_mesa_PolygonOffsetEXT( GLfloat factor, GLfloat bias );
-
-extern void GLAPIENTRY
-_mesa_PolygonStipple( const GLubyte *mask );
-
-extern void GLAPIENTRY
-_mesa_GetPolygonStipple( GLubyte *mask );
-
-extern void
-_mesa_init_polygon( struct gl_context * ctx );
-
-#endif
+/**
+ * \file polygon.h
+ * Polygon operations.
+ */
+
+/*
+ * Mesa 3-D graphics library
+ * Version: 6.5.1
+ *
+ * Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+
+#ifndef POLYGON_H
+#define POLYGON_H
+
+
+#include "glheader.h"
+
+struct gl_context;
+
+extern void GLAPIENTRY
+_mesa_GetnPolygonStippleARB( GLsizei bufSize, GLubyte *dest );
+
+extern void
+_mesa_polygon_stipple(struct gl_context *ctx, const GLubyte *pattern);
+
+
+extern void GLAPIENTRY
+_mesa_CullFace( GLenum mode );
+
+extern void GLAPIENTRY
+_mesa_FrontFace( GLenum mode );
+
+extern void GLAPIENTRY
+_mesa_PolygonMode( GLenum face, GLenum mode );
+
+extern void GLAPIENTRY
+_mesa_PolygonOffset( GLfloat factor, GLfloat units );
+
+extern void GLAPIENTRY
+_mesa_PolygonOffsetEXT( GLfloat factor, GLfloat bias );
+
+extern void GLAPIENTRY
+_mesa_PolygonStipple( const GLubyte *mask );
+
+extern void GLAPIENTRY
+_mesa_GetPolygonStipple( GLubyte *mask );
+
+extern void
+_mesa_init_polygon( struct gl_context * ctx );
+
+#endif
diff --git a/mesalib/src/mesa/main/queryobj.c b/mesalib/src/mesa/main/queryobj.c
index 25ec31fd4..c3c1aa170 100644
--- a/mesalib/src/mesa/main/queryobj.c
+++ b/mesalib/src/mesa/main/queryobj.c
@@ -44,7 +44,7 @@
* \param id - the new object's ID
* \return pointer to new query_object object or NULL if out of memory.
*/
-static struct gl_query_object *
+struct gl_query_object *
_mesa_new_query_object(struct gl_context *ctx, GLuint id)
{
struct gl_query_object *q = MALLOC_STRUCT(gl_query_object);
@@ -63,7 +63,7 @@ _mesa_new_query_object(struct gl_context *ctx, GLuint id)
* Begin a query. Software driver fallback.
* Called via ctx->Driver.BeginQuery().
*/
-static void
+void
_mesa_begin_query(struct gl_context *ctx, struct gl_query_object *q)
{
/* no-op */
@@ -74,7 +74,7 @@ _mesa_begin_query(struct gl_context *ctx, struct gl_query_object *q)
* End a query. Software driver fallback.
* Called via ctx->Driver.EndQuery().
*/
-static void
+void
_mesa_end_query(struct gl_context *ctx, struct gl_query_object *q)
{
q->Ready = GL_TRUE;
@@ -85,7 +85,7 @@ _mesa_end_query(struct gl_context *ctx, struct gl_query_object *q)
* Wait for query to complete. Software driver fallback.
* Called via ctx->Driver.WaitQuery().
*/
-static void
+void
_mesa_wait_query(struct gl_context *ctx, struct gl_query_object *q)
{
/* For software drivers, _mesa_end_query() should have completed the query.
@@ -113,7 +113,7 @@ _mesa_check_query(struct gl_context *ctx, struct gl_query_object *q)
* Delete a query object. Called via ctx->Driver.DeleteQuery().
* Not removed from hash table here.
*/
-static void
+void
_mesa_delete_query(struct gl_context *ctx, struct gl_query_object *q)
{
free(q);
diff --git a/mesalib/src/mesa/main/readpix.c b/mesalib/src/mesa/main/readpix.c
index 0331a8ca2..e9f5b3c41 100644
--- a/mesalib/src/mesa/main/readpix.c
+++ b/mesalib/src/mesa/main/readpix.c
@@ -1,257 +1,257 @@
-/*
- * Mesa 3-D graphics library
- * Version: 7.1
- *
- * Copyright (C) 1999-2008 Brian Paul All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-#include "glheader.h"
-#include "imports.h"
-#include "bufferobj.h"
-#include "context.h"
-#include "enums.h"
-#include "readpix.h"
-#include "framebuffer.h"
-#include "formats.h"
-#include "image.h"
-#include "mtypes.h"
-#include "pbo.h"
-#include "state.h"
-
-
-/**
- * Do error checking of the format/type parameters to glReadPixels and
- * glDrawPixels.
- * \param drawing if GL_TRUE do checking for DrawPixels, else do checking
- * for ReadPixels.
- * \return GL_TRUE if error detected, GL_FALSE if no errors
- */
-GLboolean
-_mesa_error_check_format_type(struct gl_context *ctx, GLenum format,
- GLenum type, GLboolean drawing)
-{
- const char *readDraw = drawing ? "Draw" : "Read";
- const GLboolean reading = !drawing;
-
- /* state validation should have already been done */
- ASSERT(ctx->NewState == 0x0);
-
- if (ctx->Extensions.EXT_packed_depth_stencil
- && type == GL_UNSIGNED_INT_24_8_EXT
- && format != GL_DEPTH_STENCIL_EXT) {
- _mesa_error(ctx, GL_INVALID_OPERATION,
- "gl%sPixels(format is not GL_DEPTH_STENCIL_EXT)", readDraw);
- return GL_TRUE;
- }
-
- /* basic combinations test */
- if (!_mesa_is_legal_format_and_type(ctx, format, type)) {
- _mesa_error(ctx, GL_INVALID_ENUM,
- "gl%sPixels(format or type)", readDraw);
- return GL_TRUE;
- }
-
- /* additional checks */
- switch (format) {
- case GL_RG:
- case GL_RED:
- case GL_GREEN:
- case GL_BLUE:
- case GL_ALPHA:
- case GL_LUMINANCE:
- case GL_LUMINANCE_ALPHA:
- case GL_RGB:
- case GL_BGR:
- case GL_RGBA:
- case GL_BGRA:
- case GL_ABGR_EXT:
- case GL_RED_INTEGER_EXT:
- case GL_GREEN_INTEGER_EXT:
- case GL_BLUE_INTEGER_EXT:
- case GL_ALPHA_INTEGER_EXT:
- case GL_RGB_INTEGER_EXT:
- case GL_RGBA_INTEGER_EXT:
- case GL_BGR_INTEGER_EXT:
- case GL_BGRA_INTEGER_EXT:
- case GL_LUMINANCE_INTEGER_EXT:
- case GL_LUMINANCE_ALPHA_INTEGER_EXT:
- if (!drawing) {
- /* reading */
- if (!_mesa_source_buffer_exists(ctx, GL_COLOR)) {
- _mesa_error(ctx, GL_INVALID_OPERATION,
- "glReadPixels(no color buffer)");
- return GL_TRUE;
- }
- }
- break;
- case GL_COLOR_INDEX:
- if (drawing) {
- if (ctx->PixelMaps.ItoR.Size == 0 ||
- ctx->PixelMaps.ItoG.Size == 0 ||
- ctx->PixelMaps.ItoB.Size == 0) {
- _mesa_error(ctx, GL_INVALID_OPERATION,
- "glDrawPixels(drawing color index pixels into RGB buffer)");
- return GL_TRUE;
- }
- }
- else {
- /* reading */
- if (!_mesa_source_buffer_exists(ctx, GL_COLOR)) {
- _mesa_error(ctx, GL_INVALID_OPERATION,
- "glReadPixels(no color buffer)");
- return GL_TRUE;
- }
- /* We no longer support CI-mode color buffers so trying to read
- * GL_COLOR_INDEX pixels is always an error.
- */
- _mesa_error(ctx, GL_INVALID_OPERATION,
- "glReadPixels(color buffer is RGB)");
- return GL_TRUE;
- }
- break;
- case GL_STENCIL_INDEX:
- if ((drawing && !_mesa_dest_buffer_exists(ctx, format)) ||
- (reading && !_mesa_source_buffer_exists(ctx, format))) {
- _mesa_error(ctx, GL_INVALID_OPERATION,
- "gl%sPixels(no stencil buffer)", readDraw);
- return GL_TRUE;
- }
- break;
- case GL_DEPTH_COMPONENT:
- if ((drawing && !_mesa_dest_buffer_exists(ctx, format))) {
- _mesa_error(ctx, GL_INVALID_OPERATION,
- "gl%sPixels(no depth buffer)", readDraw);
- return GL_TRUE;
- }
- break;
- case GL_DEPTH_STENCIL_EXT:
- if (!ctx->Extensions.EXT_packed_depth_stencil ||
- type != GL_UNSIGNED_INT_24_8_EXT) {
- _mesa_error(ctx, GL_INVALID_ENUM, "gl%sPixels(type)", readDraw);
- return GL_TRUE;
- }
- if ((drawing && !_mesa_dest_buffer_exists(ctx, format)) ||
- (reading && !_mesa_source_buffer_exists(ctx, format))) {
- _mesa_error(ctx, GL_INVALID_OPERATION,
- "gl%sPixels(no depth or stencil buffer)", readDraw);
- return GL_TRUE;
- }
- break;
- default:
- /* this should have been caught in _mesa_is_legal_format_type() */
- _mesa_problem(ctx, "unexpected format in _mesa_%sPixels", readDraw);
- return GL_TRUE;
- }
-
- /* no errors */
- return GL_FALSE;
-}
-
-
-
-void GLAPIENTRY
-_mesa_ReadnPixelsARB( GLint x, GLint y, GLsizei width, GLsizei height,
- GLenum format, GLenum type, GLsizei bufSize,
- GLvoid *pixels )
-{
- GET_CURRENT_CONTEXT(ctx);
- ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
-
- FLUSH_CURRENT(ctx, 0);
-
- if (MESA_VERBOSE & VERBOSE_API)
- _mesa_debug(ctx, "glReadPixels(%d, %d, %s, %s, %p)\n",
- width, height,
- _mesa_lookup_enum_by_nr(format),
- _mesa_lookup_enum_by_nr(type),
- pixels);
-
- if (width < 0 || height < 0) {
- _mesa_error( ctx, GL_INVALID_VALUE,
- "glReadPixels(width=%d height=%d)", width, height );
- return;
- }
-
- if (ctx->NewState)
- _mesa_update_state(ctx);
-
- if (_mesa_error_check_format_type(ctx, format, type, GL_FALSE)) {
- /* found an error */
- return;
- }
-
- /* Check that the destination format and source buffer are both
- * integer-valued or both non-integer-valued.
- */
- if (ctx->Extensions.EXT_texture_integer && _mesa_is_color_format(format)) {
- const struct gl_renderbuffer *rb = ctx->ReadBuffer->_ColorReadBuffer;
- const GLboolean srcInteger = _mesa_is_format_integer_color(rb->Format);
- const GLboolean dstInteger = _mesa_is_integer_format(format);
- if (dstInteger != srcInteger) {
- _mesa_error(ctx, GL_INVALID_OPERATION,
- "glReadPixels(integer / non-integer format mismatch");
- return;
- }
- }
-
- if (ctx->ReadBuffer->_Status != GL_FRAMEBUFFER_COMPLETE_EXT) {
- _mesa_error(ctx, GL_INVALID_FRAMEBUFFER_OPERATION_EXT,
- "glReadPixels(incomplete framebuffer)" );
- return;
- }
-
- if (!_mesa_source_buffer_exists(ctx, format)) {
- _mesa_error(ctx, GL_INVALID_OPERATION, "glReadPixels(no readbuffer)");
- return;
- }
-
- if (width == 0 || height == 0)
- return; /* nothing to do */
-
- if (!_mesa_validate_pbo_access(2, &ctx->Pack, width, height, 1,
- format, type, bufSize, pixels)) {
- if (_mesa_is_bufferobj(ctx->Pack.BufferObj)) {
- _mesa_error(ctx, GL_INVALID_OPERATION,
- "glReadPixels(out of bounds PBO access)");
- } else {
- _mesa_error(ctx, GL_INVALID_OPERATION,
- "glReadnPixelsARB(out of bounds access:"
- " bufSize (%d) is too small)", bufSize);
- }
- return;
- }
-
- if (_mesa_is_bufferobj(ctx->Pack.BufferObj) &&
- _mesa_bufferobj_mapped(ctx->Pack.BufferObj)) {
- /* buffer is mapped - that's an error */
- _mesa_error(ctx, GL_INVALID_OPERATION, "glReadPixels(PBO is mapped)");
- return;
- }
-
- ctx->Driver.ReadPixels(ctx, x, y, width, height,
- format, type, &ctx->Pack, pixels);
-}
-
-void GLAPIENTRY
-_mesa_ReadPixels( GLint x, GLint y, GLsizei width, GLsizei height,
- GLenum format, GLenum type, GLvoid *pixels )
-{
- _mesa_ReadnPixelsARB(x, y, width, height, format, type, INT_MAX, pixels);
-}
+/*
+ * Mesa 3-D graphics library
+ * Version: 7.1
+ *
+ * Copyright (C) 1999-2008 Brian Paul All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+#include "glheader.h"
+#include "imports.h"
+#include "bufferobj.h"
+#include "context.h"
+#include "enums.h"
+#include "readpix.h"
+#include "framebuffer.h"
+#include "formats.h"
+#include "image.h"
+#include "mtypes.h"
+#include "pbo.h"
+#include "state.h"
+
+
+/**
+ * Do error checking of the format/type parameters to glReadPixels and
+ * glDrawPixels.
+ * \param drawing if GL_TRUE do checking for DrawPixels, else do checking
+ * for ReadPixels.
+ * \return GL_TRUE if error detected, GL_FALSE if no errors
+ */
+GLboolean
+_mesa_error_check_format_type(struct gl_context *ctx, GLenum format,
+ GLenum type, GLboolean drawing)
+{
+ const char *readDraw = drawing ? "Draw" : "Read";
+ const GLboolean reading = !drawing;
+
+ /* state validation should have already been done */
+ ASSERT(ctx->NewState == 0x0);
+
+ if (ctx->Extensions.EXT_packed_depth_stencil
+ && type == GL_UNSIGNED_INT_24_8_EXT
+ && format != GL_DEPTH_STENCIL_EXT) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "gl%sPixels(format is not GL_DEPTH_STENCIL_EXT)", readDraw);
+ return GL_TRUE;
+ }
+
+ /* basic combinations test */
+ if (!_mesa_is_legal_format_and_type(ctx, format, type)) {
+ _mesa_error(ctx, GL_INVALID_ENUM,
+ "gl%sPixels(format or type)", readDraw);
+ return GL_TRUE;
+ }
+
+ /* additional checks */
+ switch (format) {
+ case GL_RG:
+ case GL_RED:
+ case GL_GREEN:
+ case GL_BLUE:
+ case GL_ALPHA:
+ case GL_LUMINANCE:
+ case GL_LUMINANCE_ALPHA:
+ case GL_RGB:
+ case GL_BGR:
+ case GL_RGBA:
+ case GL_BGRA:
+ case GL_ABGR_EXT:
+ case GL_RED_INTEGER_EXT:
+ case GL_GREEN_INTEGER_EXT:
+ case GL_BLUE_INTEGER_EXT:
+ case GL_ALPHA_INTEGER_EXT:
+ case GL_RGB_INTEGER_EXT:
+ case GL_RGBA_INTEGER_EXT:
+ case GL_BGR_INTEGER_EXT:
+ case GL_BGRA_INTEGER_EXT:
+ case GL_LUMINANCE_INTEGER_EXT:
+ case GL_LUMINANCE_ALPHA_INTEGER_EXT:
+ if (!drawing) {
+ /* reading */
+ if (!_mesa_source_buffer_exists(ctx, GL_COLOR)) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glReadPixels(no color buffer)");
+ return GL_TRUE;
+ }
+ }
+ break;
+ case GL_COLOR_INDEX:
+ if (drawing) {
+ if (ctx->PixelMaps.ItoR.Size == 0 ||
+ ctx->PixelMaps.ItoG.Size == 0 ||
+ ctx->PixelMaps.ItoB.Size == 0) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glDrawPixels(drawing color index pixels into RGB buffer)");
+ return GL_TRUE;
+ }
+ }
+ else {
+ /* reading */
+ if (!_mesa_source_buffer_exists(ctx, GL_COLOR)) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glReadPixels(no color buffer)");
+ return GL_TRUE;
+ }
+ /* We no longer support CI-mode color buffers so trying to read
+ * GL_COLOR_INDEX pixels is always an error.
+ */
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glReadPixels(color buffer is RGB)");
+ return GL_TRUE;
+ }
+ break;
+ case GL_STENCIL_INDEX:
+ if ((drawing && !_mesa_dest_buffer_exists(ctx, format)) ||
+ (reading && !_mesa_source_buffer_exists(ctx, format))) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "gl%sPixels(no stencil buffer)", readDraw);
+ return GL_TRUE;
+ }
+ break;
+ case GL_DEPTH_COMPONENT:
+ if ((drawing && !_mesa_dest_buffer_exists(ctx, format))) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "gl%sPixels(no depth buffer)", readDraw);
+ return GL_TRUE;
+ }
+ break;
+ case GL_DEPTH_STENCIL_EXT:
+ if (!ctx->Extensions.EXT_packed_depth_stencil ||
+ type != GL_UNSIGNED_INT_24_8_EXT) {
+ _mesa_error(ctx, GL_INVALID_ENUM, "gl%sPixels(type)", readDraw);
+ return GL_TRUE;
+ }
+ if ((drawing && !_mesa_dest_buffer_exists(ctx, format)) ||
+ (reading && !_mesa_source_buffer_exists(ctx, format))) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "gl%sPixels(no depth or stencil buffer)", readDraw);
+ return GL_TRUE;
+ }
+ break;
+ default:
+ /* this should have been caught in _mesa_is_legal_format_type() */
+ _mesa_problem(ctx, "unexpected format in _mesa_%sPixels", readDraw);
+ return GL_TRUE;
+ }
+
+ /* no errors */
+ return GL_FALSE;
+}
+
+
+
+void GLAPIENTRY
+_mesa_ReadnPixelsARB( GLint x, GLint y, GLsizei width, GLsizei height,
+ GLenum format, GLenum type, GLsizei bufSize,
+ GLvoid *pixels )
+{
+ GET_CURRENT_CONTEXT(ctx);
+ ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
+
+ FLUSH_CURRENT(ctx, 0);
+
+ if (MESA_VERBOSE & VERBOSE_API)
+ _mesa_debug(ctx, "glReadPixels(%d, %d, %s, %s, %p)\n",
+ width, height,
+ _mesa_lookup_enum_by_nr(format),
+ _mesa_lookup_enum_by_nr(type),
+ pixels);
+
+ if (width < 0 || height < 0) {
+ _mesa_error( ctx, GL_INVALID_VALUE,
+ "glReadPixels(width=%d height=%d)", width, height );
+ return;
+ }
+
+ if (ctx->NewState)
+ _mesa_update_state(ctx);
+
+ if (_mesa_error_check_format_type(ctx, format, type, GL_FALSE)) {
+ /* found an error */
+ return;
+ }
+
+ /* Check that the destination format and source buffer are both
+ * integer-valued or both non-integer-valued.
+ */
+ if (ctx->Extensions.EXT_texture_integer && _mesa_is_color_format(format)) {
+ const struct gl_renderbuffer *rb = ctx->ReadBuffer->_ColorReadBuffer;
+ const GLboolean srcInteger = _mesa_is_format_integer_color(rb->Format);
+ const GLboolean dstInteger = _mesa_is_integer_format(format);
+ if (dstInteger != srcInteger) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glReadPixels(integer / non-integer format mismatch");
+ return;
+ }
+ }
+
+ if (ctx->ReadBuffer->_Status != GL_FRAMEBUFFER_COMPLETE_EXT) {
+ _mesa_error(ctx, GL_INVALID_FRAMEBUFFER_OPERATION_EXT,
+ "glReadPixels(incomplete framebuffer)" );
+ return;
+ }
+
+ if (!_mesa_source_buffer_exists(ctx, format)) {
+ _mesa_error(ctx, GL_INVALID_OPERATION, "glReadPixels(no readbuffer)");
+ return;
+ }
+
+ if (width == 0 || height == 0)
+ return; /* nothing to do */
+
+ if (!_mesa_validate_pbo_access(2, &ctx->Pack, width, height, 1,
+ format, type, bufSize, pixels)) {
+ if (_mesa_is_bufferobj(ctx->Pack.BufferObj)) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glReadPixels(out of bounds PBO access)");
+ } else {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glReadnPixelsARB(out of bounds access:"
+ " bufSize (%d) is too small)", bufSize);
+ }
+ return;
+ }
+
+ if (_mesa_is_bufferobj(ctx->Pack.BufferObj) &&
+ _mesa_bufferobj_mapped(ctx->Pack.BufferObj)) {
+ /* buffer is mapped - that's an error */
+ _mesa_error(ctx, GL_INVALID_OPERATION, "glReadPixels(PBO is mapped)");
+ return;
+ }
+
+ ctx->Driver.ReadPixels(ctx, x, y, width, height,
+ format, type, &ctx->Pack, pixels);
+}
+
+void GLAPIENTRY
+_mesa_ReadPixels( GLint x, GLint y, GLsizei width, GLsizei height,
+ GLenum format, GLenum type, GLvoid *pixels )
+{
+ _mesa_ReadnPixelsARB(x, y, width, height, format, type, INT_MAX, pixels);
+}
diff --git a/mesalib/src/mesa/main/readpix.h b/mesalib/src/mesa/main/readpix.h
index f6bb3d6e2..dceac7c6e 100644
--- a/mesalib/src/mesa/main/readpix.h
+++ b/mesalib/src/mesa/main/readpix.h
@@ -1,47 +1,47 @@
-/*
- * Mesa 3-D graphics library
- * Version: 7.1
- *
- * Copyright (C) 1999-2008 Brian Paul All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-
-#ifndef READPIXELS_H
-#define READPIXELS_H
-
-
-#include "glheader.h"
-
-struct gl_context;
-
-extern GLboolean
-_mesa_error_check_format_type(struct gl_context *ctx, GLenum format, GLenum type,
- GLboolean drawing);
-
-extern void GLAPIENTRY
-_mesa_ReadPixels( GLint x, GLint y, GLsizei width, GLsizei height,
- GLenum format, GLenum type, GLvoid *pixels );
-
-extern void GLAPIENTRY
-_mesa_ReadnPixelsARB( GLint x, GLint y, GLsizei width, GLsizei height,
- GLenum format, GLenum type, GLsizei bufSize,
- GLvoid *pixels );
-
-#endif
+/*
+ * Mesa 3-D graphics library
+ * Version: 7.1
+ *
+ * Copyright (C) 1999-2008 Brian Paul All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+
+#ifndef READPIXELS_H
+#define READPIXELS_H
+
+
+#include "glheader.h"
+
+struct gl_context;
+
+extern GLboolean
+_mesa_error_check_format_type(struct gl_context *ctx, GLenum format, GLenum type,
+ GLboolean drawing);
+
+extern void GLAPIENTRY
+_mesa_ReadPixels( GLint x, GLint y, GLsizei width, GLsizei height,
+ GLenum format, GLenum type, GLvoid *pixels );
+
+extern void GLAPIENTRY
+_mesa_ReadnPixelsARB( GLint x, GLint y, GLsizei width, GLsizei height,
+ GLenum format, GLenum type, GLsizei bufSize,
+ GLvoid *pixels );
+
+#endif
diff --git a/mesalib/src/mesa/main/remap_helper.h b/mesalib/src/mesa/main/remap_helper.h
index fdb86d3e3..a6f2e726a 100644
--- a/mesalib/src/mesa/main/remap_helper.h
+++ b/mesalib/src/mesa/main/remap_helper.h
@@ -1,6806 +1,6806 @@
-/* DO NOT EDIT - This file generated automatically by remap_helper.py (from Mesa) script */
-
-/*
- * Copyright (C) 2009 Chia-I Wu <olv@0xlab.org>
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sub license,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
- * Chia-I Wu,
- * AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
- * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-#include "main/dispatch.h"
-#include "main/remap.h"
-
-/* this is internal to remap.c */
-#ifdef need_MESA_remap_table
-
-static const char _mesa_function_pool[] =
- /* _mesa_function_pool[0]: MapGrid1d (offset 224) */
- "idd\0"
- "glMapGrid1d\0"
- "\0"
- /* _mesa_function_pool[17]: UniformMatrix3fvARB (will be remapped) */
- "iiip\0"
- "glUniformMatrix3fv\0"
- "glUniformMatrix3fvARB\0"
- "\0"
- /* _mesa_function_pool[64]: MapGrid1f (offset 225) */
- "iff\0"
- "glMapGrid1f\0"
- "\0"
- /* _mesa_function_pool[81]: VertexAttribI2iEXT (will be remapped) */
- "iii\0"
- "glVertexAttribI2iEXT\0"
- "glVertexAttribI2i\0"
- "\0"
- /* _mesa_function_pool[125]: RasterPos4i (offset 82) */
- "iiii\0"
- "glRasterPos4i\0"
- "\0"
- /* _mesa_function_pool[145]: RasterPos4d (offset 78) */
- "dddd\0"
- "glRasterPos4d\0"
- "\0"
- /* _mesa_function_pool[165]: NewList (dynamic) */
- "ii\0"
- "glNewList\0"
- "\0"
- /* _mesa_function_pool[179]: RasterPos4f (offset 80) */
- "ffff\0"
- "glRasterPos4f\0"
- "\0"
- /* _mesa_function_pool[199]: LoadIdentity (offset 290) */
- "\0"
- "glLoadIdentity\0"
- "\0"
- /* _mesa_function_pool[216]: GetCombinerOutputParameterfvNV (will be remapped) */
- "iiip\0"
- "glGetCombinerOutputParameterfvNV\0"
- "\0"
- /* _mesa_function_pool[255]: SampleCoverageARB (will be remapped) */
- "fi\0"
- "glSampleCoverage\0"
- "glSampleCoverageARB\0"
- "\0"
- /* _mesa_function_pool[296]: ConvolutionFilter1D (offset 348) */
- "iiiiip\0"
- "glConvolutionFilter1D\0"
- "glConvolutionFilter1DEXT\0"
- "\0"
- /* _mesa_function_pool[351]: BeginQueryARB (will be remapped) */
- "ii\0"
- "glBeginQuery\0"
- "glBeginQueryARB\0"
- "\0"
- /* _mesa_function_pool[384]: RasterPos3dv (offset 71) */
- "p\0"
- "glRasterPos3dv\0"
- "\0"
- /* _mesa_function_pool[402]: PointParameteriNV (will be remapped) */
- "ii\0"
- "glPointParameteri\0"
- "glPointParameteriNV\0"
- "\0"
- /* _mesa_function_pool[444]: GetProgramiv (will be remapped) */
- "iip\0"
- "glGetProgramiv\0"
- "\0"
- /* _mesa_function_pool[464]: MultiTexCoord3sARB (offset 398) */
- "iiii\0"
- "glMultiTexCoord3s\0"
- "glMultiTexCoord3sARB\0"
- "\0"
- /* _mesa_function_pool[509]: SecondaryColor3iEXT (will be remapped) */
- "iii\0"
- "glSecondaryColor3i\0"
- "glSecondaryColor3iEXT\0"
- "\0"
- /* _mesa_function_pool[555]: WindowPos3fMESA (will be remapped) */
- "fff\0"
- "glWindowPos3f\0"
- "glWindowPos3fARB\0"
- "glWindowPos3fMESA\0"
- "\0"
- /* _mesa_function_pool[609]: TexCoord1iv (offset 99) */
- "p\0"
- "glTexCoord1iv\0"
- "\0"
- /* _mesa_function_pool[626]: TexCoord4sv (offset 125) */
- "p\0"
- "glTexCoord4sv\0"
- "\0"
- /* _mesa_function_pool[643]: RasterPos4s (offset 84) */
- "iiii\0"
- "glRasterPos4s\0"
- "\0"
- /* _mesa_function_pool[663]: PixelTexGenParameterfvSGIS (will be remapped) */
- "ip\0"
- "glPixelTexGenParameterfvSGIS\0"
- "\0"
- /* _mesa_function_pool[696]: ActiveTextureARB (offset 374) */
- "i\0"
- "glActiveTexture\0"
- "glActiveTextureARB\0"
- "\0"
- /* _mesa_function_pool[734]: BlitFramebufferEXT (will be remapped) */
- "iiiiiiiiii\0"
- "glBlitFramebuffer\0"
- "glBlitFramebufferEXT\0"
- "\0"
- /* _mesa_function_pool[785]: TexCoord1f (offset 96) */
- "f\0"
- "glTexCoord1f\0"
- "\0"
- /* _mesa_function_pool[801]: TexCoord1d (offset 94) */
- "d\0"
- "glTexCoord1d\0"
- "\0"
- /* _mesa_function_pool[817]: VertexAttrib4ubvNV (will be remapped) */
- "ip\0"
- "glVertexAttrib4ubvNV\0"
- "\0"
- /* _mesa_function_pool[842]: TexCoord1i (offset 98) */
- "i\0"
- "glTexCoord1i\0"
- "\0"
- /* _mesa_function_pool[858]: GetProgramNamedParameterdvNV (will be remapped) */
- "iipp\0"
- "glGetProgramNamedParameterdvNV\0"
- "\0"
- /* _mesa_function_pool[895]: Histogram (offset 367) */
- "iiii\0"
- "glHistogram\0"
- "glHistogramEXT\0"
- "\0"
- /* _mesa_function_pool[928]: TexCoord1s (offset 100) */
- "i\0"
- "glTexCoord1s\0"
- "\0"
- /* _mesa_function_pool[944]: GetMapfv (offset 267) */
- "iip\0"
- "glGetMapfv\0"
- "\0"
- /* _mesa_function_pool[960]: EvalCoord1f (offset 230) */
- "f\0"
- "glEvalCoord1f\0"
- "\0"
- /* _mesa_function_pool[977]: FramebufferTexture (will be remapped) */
- "iiii\0"
- "glFramebufferTexture\0"
- "\0"
- /* _mesa_function_pool[1004]: GetGraphicsResetStatusARB (will be remapped) */
- "\0"
- "glGetGraphicsResetStatusARB\0"
- "\0"
- /* _mesa_function_pool[1034]: TexImage4DSGIS (dynamic) */
- "iiiiiiiiiip\0"
- "glTexImage4DSGIS\0"
- "\0"
- /* _mesa_function_pool[1064]: PolygonStipple (offset 175) */
- "p\0"
- "glPolygonStipple\0"
- "\0"
- /* _mesa_function_pool[1084]: WindowPos2dvMESA (will be remapped) */
- "p\0"
- "glWindowPos2dv\0"
- "glWindowPos2dvARB\0"
- "glWindowPos2dvMESA\0"
- "\0"
- /* _mesa_function_pool[1139]: ReplacementCodeuiColor3fVertex3fvSUN (dynamic) */
- "ppp\0"
- "glReplacementCodeuiColor3fVertex3fvSUN\0"
- "\0"
- /* _mesa_function_pool[1183]: BlendEquationSeparateEXT (will be remapped) */
- "ii\0"
- "glBlendEquationSeparate\0"
- "glBlendEquationSeparateEXT\0"
- "glBlendEquationSeparateATI\0"
- "\0"
- /* _mesa_function_pool[1265]: ListParameterfSGIX (dynamic) */
- "iif\0"
- "glListParameterfSGIX\0"
- "\0"
- /* _mesa_function_pool[1291]: SecondaryColor3bEXT (will be remapped) */
- "iii\0"
- "glSecondaryColor3b\0"
- "glSecondaryColor3bEXT\0"
- "\0"
- /* _mesa_function_pool[1337]: TexCoord4fColor4fNormal3fVertex4fvSUN (dynamic) */
- "pppp\0"
- "glTexCoord4fColor4fNormal3fVertex4fvSUN\0"
- "\0"
- /* _mesa_function_pool[1383]: GetnPolygonStippleARB (will be remapped) */
- "ip\0"
- "glGetnPolygonStippleARB\0"
- "\0"
- /* _mesa_function_pool[1411]: GetPixelMapfv (offset 271) */
- "ip\0"
- "glGetPixelMapfv\0"
- "\0"
- /* _mesa_function_pool[1431]: Color3uiv (offset 22) */
- "p\0"
- "glColor3uiv\0"
- "\0"
- /* _mesa_function_pool[1446]: IsEnabled (offset 286) */
- "i\0"
- "glIsEnabled\0"
- "\0"
- /* _mesa_function_pool[1461]: VertexAttrib4svNV (will be remapped) */
- "ip\0"
- "glVertexAttrib4svNV\0"
- "\0"
- /* _mesa_function_pool[1485]: EvalCoord2fv (offset 235) */
- "p\0"
- "glEvalCoord2fv\0"
- "\0"
- /* _mesa_function_pool[1503]: GetBufferSubDataARB (will be remapped) */
- "iiip\0"
- "glGetBufferSubData\0"
- "glGetBufferSubDataARB\0"
- "\0"
- /* _mesa_function_pool[1550]: BufferSubDataARB (will be remapped) */
- "iiip\0"
- "glBufferSubData\0"
- "glBufferSubDataARB\0"
- "\0"
- /* _mesa_function_pool[1591]: TexCoord2fColor4ubVertex3fvSUN (dynamic) */
- "ppp\0"
- "glTexCoord2fColor4ubVertex3fvSUN\0"
- "\0"
- /* _mesa_function_pool[1629]: AttachShader (will be remapped) */
- "ii\0"
- "glAttachShader\0"
- "\0"
- /* _mesa_function_pool[1648]: GetCombinerInputParameterfvNV (will be remapped) */
- "iiiip\0"
- "glGetCombinerInputParameterfvNV\0"
- "\0"
- /* _mesa_function_pool[1687]: VertexAttrib2fARB (will be remapped) */
- "iff\0"
- "glVertexAttrib2f\0"
- "glVertexAttrib2fARB\0"
- "\0"
- /* _mesa_function_pool[1729]: GetDebugLogLengthMESA (dynamic) */
- "iii\0"
- "glGetDebugLogLengthMESA\0"
- "\0"
- /* _mesa_function_pool[1758]: GetMapiv (offset 268) */
- "iip\0"
- "glGetMapiv\0"
- "\0"
- /* _mesa_function_pool[1774]: VertexAttrib3fARB (will be remapped) */
- "ifff\0"
- "glVertexAttrib3f\0"
- "glVertexAttrib3fARB\0"
- "\0"
- /* _mesa_function_pool[1817]: Indexubv (offset 316) */
- "p\0"
- "glIndexubv\0"
- "\0"
- /* _mesa_function_pool[1831]: GetQueryivARB (will be remapped) */
- "iip\0"
- "glGetQueryiv\0"
- "glGetQueryivARB\0"
- "\0"
- /* _mesa_function_pool[1865]: TexImage3D (offset 371) */
- "iiiiiiiiip\0"
- "glTexImage3D\0"
- "glTexImage3DEXT\0"
- "\0"
- /* _mesa_function_pool[1906]: BindFragDataLocationEXT (will be remapped) */
- "iip\0"
- "glBindFragDataLocationEXT\0"
- "glBindFragDataLocation\0"
- "\0"
- /* _mesa_function_pool[1960]: ReplacementCodeuiVertex3fvSUN (dynamic) */
- "pp\0"
- "glReplacementCodeuiVertex3fvSUN\0"
- "\0"
- /* _mesa_function_pool[1996]: EdgeFlagPointer (offset 312) */
- "ip\0"
- "glEdgeFlagPointer\0"
- "\0"
- /* _mesa_function_pool[2018]: Color3ubv (offset 20) */
- "p\0"
- "glColor3ubv\0"
- "\0"
- /* _mesa_function_pool[2033]: GetQueryObjectivARB (will be remapped) */
- "iip\0"
- "glGetQueryObjectiv\0"
- "glGetQueryObjectivARB\0"
- "\0"
- /* _mesa_function_pool[2079]: Vertex3dv (offset 135) */
- "p\0"
- "glVertex3dv\0"
- "\0"
- /* _mesa_function_pool[2094]: ReplacementCodeuiTexCoord2fVertex3fvSUN (dynamic) */
- "ppp\0"
- "glReplacementCodeuiTexCoord2fVertex3fvSUN\0"
- "\0"
- /* _mesa_function_pool[2141]: CompressedTexSubImage2DARB (will be remapped) */
- "iiiiiiiip\0"
- "glCompressedTexSubImage2D\0"
- "glCompressedTexSubImage2DARB\0"
- "\0"
- /* _mesa_function_pool[2207]: CombinerOutputNV (will be remapped) */
- "iiiiiiiiii\0"
- "glCombinerOutputNV\0"
- "\0"
- /* _mesa_function_pool[2238]: VertexAttribs3fvNV (will be remapped) */
- "iip\0"
- "glVertexAttribs3fvNV\0"
- "\0"
- /* _mesa_function_pool[2264]: GetnMapivARB (will be remapped) */
- "iiip\0"
- "glGetnMapivARB\0"
- "\0"
- /* _mesa_function_pool[2285]: Uniform2fARB (will be remapped) */
- "iff\0"
- "glUniform2f\0"
- "glUniform2fARB\0"
- "\0"
- /* _mesa_function_pool[2317]: LightModeliv (offset 166) */
- "ip\0"
- "glLightModeliv\0"
- "\0"
- /* _mesa_function_pool[2336]: VertexAttrib1svARB (will be remapped) */
- "ip\0"
- "glVertexAttrib1sv\0"
- "glVertexAttrib1svARB\0"
- "\0"
- /* _mesa_function_pool[2379]: VertexAttribs1dvNV (will be remapped) */
- "iip\0"
- "glVertexAttribs1dvNV\0"
- "\0"
- /* _mesa_function_pool[2405]: Uniform2ivARB (will be remapped) */
- "iip\0"
- "glUniform2iv\0"
- "glUniform2ivARB\0"
- "\0"
- /* _mesa_function_pool[2439]: GetImageTransformParameterfvHP (dynamic) */
- "iip\0"
- "glGetImageTransformParameterfvHP\0"
- "\0"
- /* _mesa_function_pool[2477]: Normal3bv (offset 53) */
- "p\0"
- "glNormal3bv\0"
- "\0"
- /* _mesa_function_pool[2492]: TexGeniv (offset 193) */
- "iip\0"
- "glTexGeniv\0"
- "\0"
- /* _mesa_function_pool[2508]: WeightubvARB (dynamic) */
- "ip\0"
- "glWeightubvARB\0"
- "\0"
- /* _mesa_function_pool[2527]: VertexAttrib1fvNV (will be remapped) */
- "ip\0"
- "glVertexAttrib1fvNV\0"
- "\0"
- /* _mesa_function_pool[2551]: Vertex3iv (offset 139) */
- "p\0"
- "glVertex3iv\0"
- "\0"
- /* _mesa_function_pool[2566]: CopyConvolutionFilter1D (offset 354) */
- "iiiii\0"
- "glCopyConvolutionFilter1D\0"
- "glCopyConvolutionFilter1DEXT\0"
- "\0"
- /* _mesa_function_pool[2628]: VertexAttribI1uiEXT (will be remapped) */
- "ii\0"
- "glVertexAttribI1uiEXT\0"
- "glVertexAttribI1ui\0"
- "\0"
- /* _mesa_function_pool[2673]: ReplacementCodeuiNormal3fVertex3fSUN (dynamic) */
- "iffffff\0"
- "glReplacementCodeuiNormal3fVertex3fSUN\0"
- "\0"
- /* _mesa_function_pool[2721]: DeleteSync (will be remapped) */
- "i\0"
- "glDeleteSync\0"
- "\0"
- /* _mesa_function_pool[2737]: FragmentMaterialfvSGIX (dynamic) */
- "iip\0"
- "glFragmentMaterialfvSGIX\0"
- "\0"
- /* _mesa_function_pool[2767]: BlendColor (offset 336) */
- "ffff\0"
- "glBlendColor\0"
- "glBlendColorEXT\0"
- "\0"
- /* _mesa_function_pool[2802]: UniformMatrix4fvARB (will be remapped) */
- "iiip\0"
- "glUniformMatrix4fv\0"
- "glUniformMatrix4fvARB\0"
- "\0"
- /* _mesa_function_pool[2849]: DeleteVertexArraysAPPLE (will be remapped) */
- "ip\0"
- "glDeleteVertexArrays\0"
- "glDeleteVertexArraysAPPLE\0"
- "\0"
- /* _mesa_function_pool[2900]: TexBuffer (will be remapped) */
- "iii\0"
- "glTexBuffer\0"
- "\0"
- /* _mesa_function_pool[2917]: ReadInstrumentsSGIX (dynamic) */
- "i\0"
- "glReadInstrumentsSGIX\0"
- "\0"
- /* _mesa_function_pool[2942]: CallLists (offset 3) */
- "iip\0"
- "glCallLists\0"
- "\0"
- /* _mesa_function_pool[2959]: DeformationMap3dSGIX (dynamic) */
- "iddiiddiiddiip\0"
- "glDeformationMap3dSGIX\0"
- "\0"
- /* _mesa_function_pool[2998]: UniformMatrix2x4fv (will be remapped) */
- "iiip\0"
- "glUniformMatrix2x4fv\0"
- "\0"
- /* _mesa_function_pool[3025]: ReadnPixelsARB (will be remapped) */
- "iiiiiiip\0"
- "glReadnPixelsARB\0"
- "\0"
- /* _mesa_function_pool[3052]: Color4ubVertex3fvSUN (dynamic) */
- "pp\0"
- "glColor4ubVertex3fvSUN\0"
- "\0"
- /* _mesa_function_pool[3079]: Normal3iv (offset 59) */
- "p\0"
- "glNormal3iv\0"
- "\0"
- /* _mesa_function_pool[3094]: PassThrough (offset 199) */
- "f\0"
- "glPassThrough\0"
- "\0"
- /* _mesa_function_pool[3111]: GetnPixelMapusvARB (will be remapped) */
- "iip\0"
- "glGetnPixelMapusvARB\0"
- "\0"
- /* _mesa_function_pool[3137]: TexParameterIivEXT (will be remapped) */
- "iip\0"
- "glTexParameterIivEXT\0"
- "glTexParameterIiv\0"
- "\0"
- /* _mesa_function_pool[3181]: FramebufferTextureLayerEXT (will be remapped) */
- "iiiii\0"
- "glFramebufferTextureLayer\0"
- "glFramebufferTextureLayerEXT\0"
- "\0"
- /* _mesa_function_pool[3243]: GetListParameterfvSGIX (dynamic) */
- "iip\0"
- "glGetListParameterfvSGIX\0"
- "\0"
- /* _mesa_function_pool[3273]: Viewport (offset 305) */
- "iiii\0"
- "glViewport\0"
- "\0"
- /* _mesa_function_pool[3290]: VertexAttrib4NusvARB (will be remapped) */
- "ip\0"
- "glVertexAttrib4Nusv\0"
- "glVertexAttrib4NusvARB\0"
- "\0"
- /* _mesa_function_pool[3337]: WindowPos4svMESA (will be remapped) */
- "p\0"
- "glWindowPos4svMESA\0"
- "\0"
- /* _mesa_function_pool[3359]: CreateProgramObjectARB (will be remapped) */
- "\0"
- "glCreateProgramObjectARB\0"
- "\0"
- /* _mesa_function_pool[3386]: DeleteTransformFeedbacks (will be remapped) */
- "ip\0"
- "glDeleteTransformFeedbacks\0"
- "\0"
- /* _mesa_function_pool[3417]: UniformMatrix4x3fv (will be remapped) */
- "iiip\0"
- "glUniformMatrix4x3fv\0"
- "\0"
- /* _mesa_function_pool[3444]: PrioritizeTextures (offset 331) */
- "ipp\0"
- "glPrioritizeTextures\0"
- "glPrioritizeTexturesEXT\0"
- "\0"
- /* _mesa_function_pool[3494]: VertexAttribI3uiEXT (will be remapped) */
- "iiii\0"
- "glVertexAttribI3uiEXT\0"
- "glVertexAttribI3ui\0"
- "\0"
- /* _mesa_function_pool[3541]: AsyncMarkerSGIX (dynamic) */
- "i\0"
- "glAsyncMarkerSGIX\0"
- "\0"
- /* _mesa_function_pool[3562]: GlobalAlphaFactorubSUN (dynamic) */
- "i\0"
- "glGlobalAlphaFactorubSUN\0"
- "\0"
- /* _mesa_function_pool[3590]: ClearColorIuiEXT (will be remapped) */
- "iiii\0"
- "glClearColorIuiEXT\0"
- "\0"
- /* _mesa_function_pool[3615]: ClearDebugLogMESA (dynamic) */
- "iii\0"
- "glClearDebugLogMESA\0"
- "\0"
- /* _mesa_function_pool[3640]: Uniform4uiEXT (will be remapped) */
- "iiiii\0"
- "glUniform4uiEXT\0"
- "glUniform4ui\0"
- "\0"
- /* _mesa_function_pool[3676]: ResetHistogram (offset 369) */
- "i\0"
- "glResetHistogram\0"
- "glResetHistogramEXT\0"
- "\0"
- /* _mesa_function_pool[3716]: GetProgramNamedParameterfvNV (will be remapped) */
- "iipp\0"
- "glGetProgramNamedParameterfvNV\0"
- "\0"
- /* _mesa_function_pool[3753]: PointParameterfEXT (will be remapped) */
- "if\0"
- "glPointParameterf\0"
- "glPointParameterfARB\0"
- "glPointParameterfEXT\0"
- "glPointParameterfSGIS\0"
- "\0"
- /* _mesa_function_pool[3839]: LoadIdentityDeformationMapSGIX (dynamic) */
- "i\0"
- "glLoadIdentityDeformationMapSGIX\0"
- "\0"
- /* _mesa_function_pool[3875]: GenFencesNV (will be remapped) */
- "ip\0"
- "glGenFencesNV\0"
- "\0"
- /* _mesa_function_pool[3893]: ImageTransformParameterfHP (dynamic) */
- "iif\0"
- "glImageTransformParameterfHP\0"
- "\0"
- /* _mesa_function_pool[3927]: MatrixIndexusvARB (dynamic) */
- "ip\0"
- "glMatrixIndexusvARB\0"
- "\0"
- /* _mesa_function_pool[3951]: DrawElementsBaseVertex (will be remapped) */
- "iiipi\0"
- "glDrawElementsBaseVertex\0"
- "\0"
- /* _mesa_function_pool[3983]: DisableVertexAttribArrayARB (will be remapped) */
- "i\0"
- "glDisableVertexAttribArray\0"
- "glDisableVertexAttribArrayARB\0"
- "\0"
- /* _mesa_function_pool[4043]: VertexAttribI4ubvEXT (will be remapped) */
- "ip\0"
- "glVertexAttribI4ubvEXT\0"
- "glVertexAttribI4ubv\0"
- "\0"
- /* _mesa_function_pool[4090]: GetnConvolutionFilterARB (will be remapped) */
- "iiiip\0"
- "glGetnConvolutionFilterARB\0"
- "\0"
- /* _mesa_function_pool[4124]: TexCoord2sv (offset 109) */
- "p\0"
- "glTexCoord2sv\0"
- "\0"
- /* _mesa_function_pool[4141]: Vertex4dv (offset 143) */
- "p\0"
- "glVertex4dv\0"
- "\0"
- /* _mesa_function_pool[4156]: StencilMaskSeparate (will be remapped) */
- "ii\0"
- "glStencilMaskSeparate\0"
- "\0"
- /* _mesa_function_pool[4182]: ProgramLocalParameter4dARB (will be remapped) */
- "iidddd\0"
- "glProgramLocalParameter4dARB\0"
- "\0"
- /* _mesa_function_pool[4219]: CompressedTexImage3DARB (will be remapped) */
- "iiiiiiiip\0"
- "glCompressedTexImage3D\0"
- "glCompressedTexImage3DARB\0"
- "\0"
- /* _mesa_function_pool[4279]: Color3sv (offset 18) */
- "p\0"
- "glColor3sv\0"
- "\0"
- /* _mesa_function_pool[4293]: GetConvolutionParameteriv (offset 358) */
- "iip\0"
- "glGetConvolutionParameteriv\0"
- "glGetConvolutionParameterivEXT\0"
- "\0"
- /* _mesa_function_pool[4357]: DeleteSamplers (will be remapped) */
- "ip\0"
- "glDeleteSamplers\0"
- "\0"
- /* _mesa_function_pool[4378]: VertexAttrib1fARB (will be remapped) */
- "if\0"
- "glVertexAttrib1f\0"
- "glVertexAttrib1fARB\0"
- "\0"
- /* _mesa_function_pool[4419]: Vertex2dv (offset 127) */
- "p\0"
- "glVertex2dv\0"
- "\0"
- /* _mesa_function_pool[4434]: TestFenceNV (will be remapped) */
- "i\0"
- "glTestFenceNV\0"
- "\0"
- /* _mesa_function_pool[4451]: MultiTexCoord1fvARB (offset 379) */
- "ip\0"
- "glMultiTexCoord1fv\0"
- "glMultiTexCoord1fvARB\0"
- "\0"
- /* _mesa_function_pool[4496]: TexCoord3iv (offset 115) */
- "p\0"
- "glTexCoord3iv\0"
- "\0"
- /* _mesa_function_pool[4513]: Uniform2uivEXT (will be remapped) */
- "iip\0"
- "glUniform2uivEXT\0"
- "glUniform2uiv\0"
- "\0"
- /* _mesa_function_pool[4549]: ColorFragmentOp2ATI (will be remapped) */
- "iiiiiiiiii\0"
- "glColorFragmentOp2ATI\0"
- "\0"
- /* _mesa_function_pool[4583]: SecondaryColorPointerListIBM (dynamic) */
- "iiipi\0"
- "glSecondaryColorPointerListIBM\0"
- "\0"
- /* _mesa_function_pool[4621]: GetPixelTexGenParameterivSGIS (will be remapped) */
- "ip\0"
- "glGetPixelTexGenParameterivSGIS\0"
- "\0"
- /* _mesa_function_pool[4657]: Color3fv (offset 14) */
- "p\0"
- "glColor3fv\0"
- "\0"
- /* _mesa_function_pool[4671]: GetnPixelMapfvARB (will be remapped) */
- "iip\0"
- "glGetnPixelMapfvARB\0"
- "\0"
- /* _mesa_function_pool[4696]: ReplacementCodeubSUN (dynamic) */
- "i\0"
- "glReplacementCodeubSUN\0"
- "\0"
- /* _mesa_function_pool[4722]: FinishAsyncSGIX (dynamic) */
- "p\0"
- "glFinishAsyncSGIX\0"
- "\0"
- /* _mesa_function_pool[4743]: GetnUniformfvARB (will be remapped) */
- "iiip\0"
- "glGetnUniformfvARB\0"
- "\0"
- /* _mesa_function_pool[4768]: GetDebugLogMESA (dynamic) */
- "iiiipp\0"
- "glGetDebugLogMESA\0"
- "\0"
- /* _mesa_function_pool[4794]: FogCoorddEXT (will be remapped) */
- "d\0"
- "glFogCoordd\0"
- "glFogCoorddEXT\0"
- "\0"
- /* _mesa_function_pool[4824]: BeginConditionalRenderNV (will be remapped) */
- "ii\0"
- "glBeginConditionalRenderNV\0"
- "glBeginConditionalRender\0"
- "\0"
- /* _mesa_function_pool[4880]: Color4ubVertex3fSUN (dynamic) */
- "iiiifff\0"
- "glColor4ubVertex3fSUN\0"
- "\0"
- /* _mesa_function_pool[4911]: FogCoordfEXT (will be remapped) */
- "f\0"
- "glFogCoordf\0"
- "glFogCoordfEXT\0"
- "\0"
- /* _mesa_function_pool[4941]: PointSize (offset 173) */
- "f\0"
- "glPointSize\0"
- "\0"
- /* _mesa_function_pool[4956]: VertexAttribI2uivEXT (will be remapped) */
- "ip\0"
- "glVertexAttribI2uivEXT\0"
- "glVertexAttribI2uiv\0"
- "\0"
- /* _mesa_function_pool[5003]: TexCoord2fVertex3fSUN (dynamic) */
- "fffff\0"
- "glTexCoord2fVertex3fSUN\0"
- "\0"
- /* _mesa_function_pool[5034]: PopName (offset 200) */
- "\0"
- "glPopName\0"
- "\0"
- /* _mesa_function_pool[5046]: GetSamplerParameterfv (will be remapped) */
- "iip\0"
- "glGetSamplerParameterfv\0"
- "\0"
- /* _mesa_function_pool[5075]: GlobalAlphaFactoriSUN (dynamic) */
- "i\0"
- "glGlobalAlphaFactoriSUN\0"
- "\0"
- /* _mesa_function_pool[5102]: VertexAttrib2dNV (will be remapped) */
- "idd\0"
- "glVertexAttrib2dNV\0"
- "\0"
- /* _mesa_function_pool[5126]: GetProgramInfoLog (will be remapped) */
- "iipp\0"
- "glGetProgramInfoLog\0"
- "\0"
- /* _mesa_function_pool[5152]: VertexAttrib4NbvARB (will be remapped) */
- "ip\0"
- "glVertexAttrib4Nbv\0"
- "glVertexAttrib4NbvARB\0"
- "\0"
- /* _mesa_function_pool[5197]: GetActiveAttribARB (will be remapped) */
- "iiipppp\0"
- "glGetActiveAttrib\0"
- "glGetActiveAttribARB\0"
- "\0"
- /* _mesa_function_pool[5245]: Vertex4sv (offset 149) */
- "p\0"
- "glVertex4sv\0"
- "\0"
- /* _mesa_function_pool[5260]: VertexAttrib4ubNV (will be remapped) */
- "iiiii\0"
- "glVertexAttrib4ubNV\0"
- "\0"
- /* _mesa_function_pool[5287]: VertexAttribI1ivEXT (will be remapped) */
- "ip\0"
- "glVertexAttribI1ivEXT\0"
- "glVertexAttribI1iv\0"
- "\0"
- /* _mesa_function_pool[5332]: ClampColor (will be remapped) */
- "ii\0"
- "glClampColor\0"
- "\0"
- /* _mesa_function_pool[5349]: TextureRangeAPPLE (will be remapped) */
- "iip\0"
- "glTextureRangeAPPLE\0"
- "\0"
- /* _mesa_function_pool[5374]: GetTexEnvfv (offset 276) */
- "iip\0"
- "glGetTexEnvfv\0"
- "\0"
- /* _mesa_function_pool[5393]: BindTransformFeedback (will be remapped) */
- "ii\0"
- "glBindTransformFeedback\0"
- "\0"
- /* _mesa_function_pool[5421]: TexCoord2fColor4fNormal3fVertex3fSUN (dynamic) */
- "ffffffffffff\0"
- "glTexCoord2fColor4fNormal3fVertex3fSUN\0"
- "\0"
- /* _mesa_function_pool[5474]: Indexub (offset 315) */
- "i\0"
- "glIndexub\0"
- "\0"
- /* _mesa_function_pool[5487]: VertexAttrib4fNV (will be remapped) */
- "iffff\0"
- "glVertexAttrib4fNV\0"
- "\0"
- /* _mesa_function_pool[5513]: TexEnvi (offset 186) */
- "iii\0"
- "glTexEnvi\0"
- "\0"
- /* _mesa_function_pool[5528]: GetClipPlane (offset 259) */
- "ip\0"
- "glGetClipPlane\0"
- "\0"
- /* _mesa_function_pool[5547]: CombinerParameterfvNV (will be remapped) */
- "ip\0"
- "glCombinerParameterfvNV\0"
- "\0"
- /* _mesa_function_pool[5575]: VertexAttribs3dvNV (will be remapped) */
- "iip\0"
- "glVertexAttribs3dvNV\0"
- "\0"
- /* _mesa_function_pool[5601]: VertexAttribI2uiEXT (will be remapped) */
- "iii\0"
- "glVertexAttribI2uiEXT\0"
- "glVertexAttribI2ui\0"
- "\0"
- /* _mesa_function_pool[5647]: VertexAttribs4fvNV (will be remapped) */
- "iip\0"
- "glVertexAttribs4fvNV\0"
- "\0"
- /* _mesa_function_pool[5673]: VertexArrayRangeNV (will be remapped) */
- "ip\0"
- "glVertexArrayRangeNV\0"
- "\0"
- /* _mesa_function_pool[5698]: FragmentLightiSGIX (dynamic) */
- "iii\0"
- "glFragmentLightiSGIX\0"
- "\0"
- /* _mesa_function_pool[5724]: PolygonOffsetEXT (will be remapped) */
- "ff\0"
- "glPolygonOffsetEXT\0"
- "\0"
- /* _mesa_function_pool[5747]: VertexAttribI4uivEXT (will be remapped) */
- "ip\0"
- "glVertexAttribI4uivEXT\0"
- "glVertexAttribI4uiv\0"
- "\0"
- /* _mesa_function_pool[5794]: PollAsyncSGIX (dynamic) */
- "p\0"
- "glPollAsyncSGIX\0"
- "\0"
- /* _mesa_function_pool[5813]: DeleteFragmentShaderATI (will be remapped) */
- "i\0"
- "glDeleteFragmentShaderATI\0"
- "\0"
- /* _mesa_function_pool[5842]: Scaled (offset 301) */
- "ddd\0"
- "glScaled\0"
- "\0"
- /* _mesa_function_pool[5856]: ResumeTransformFeedback (will be remapped) */
- "\0"
- "glResumeTransformFeedback\0"
- "\0"
- /* _mesa_function_pool[5884]: Scalef (offset 302) */
- "fff\0"
- "glScalef\0"
- "\0"
- /* _mesa_function_pool[5898]: TexCoord2fNormal3fVertex3fvSUN (dynamic) */
- "ppp\0"
- "glTexCoord2fNormal3fVertex3fvSUN\0"
- "\0"
- /* _mesa_function_pool[5936]: ProgramEnvParameters4fvEXT (will be remapped) */
- "iiip\0"
- "glProgramEnvParameters4fvEXT\0"
- "\0"
- /* _mesa_function_pool[5971]: MultTransposeMatrixdARB (will be remapped) */
- "p\0"
- "glMultTransposeMatrixd\0"
- "glMultTransposeMatrixdARB\0"
- "\0"
- /* _mesa_function_pool[6023]: ObjectUnpurgeableAPPLE (will be remapped) */
- "iii\0"
- "glObjectUnpurgeableAPPLE\0"
- "\0"
- /* _mesa_function_pool[6053]: AlphaFunc (offset 240) */
- "if\0"
- "glAlphaFunc\0"
- "\0"
- /* _mesa_function_pool[6069]: WindowPos2svMESA (will be remapped) */
- "p\0"
- "glWindowPos2sv\0"
- "glWindowPos2svARB\0"
- "glWindowPos2svMESA\0"
- "\0"
- /* _mesa_function_pool[6124]: EdgeFlag (offset 41) */
- "i\0"
- "glEdgeFlag\0"
- "\0"
- /* _mesa_function_pool[6138]: TexCoord2iv (offset 107) */
- "p\0"
- "glTexCoord2iv\0"
- "\0"
- /* _mesa_function_pool[6155]: CompressedTexImage1DARB (will be remapped) */
- "iiiiiip\0"
- "glCompressedTexImage1D\0"
- "glCompressedTexImage1DARB\0"
- "\0"
- /* _mesa_function_pool[6213]: Rotated (offset 299) */
- "dddd\0"
- "glRotated\0"
- "\0"
- /* _mesa_function_pool[6229]: GetTexParameterIuivEXT (will be remapped) */
- "iip\0"
- "glGetTexParameterIuivEXT\0"
- "glGetTexParameterIuiv\0"
- "\0"
- /* _mesa_function_pool[6281]: VertexAttrib2sNV (will be remapped) */
- "iii\0"
- "glVertexAttrib2sNV\0"
- "\0"
- /* _mesa_function_pool[6305]: ReadPixels (offset 256) */
- "iiiiiip\0"
- "glReadPixels\0"
- "\0"
- /* _mesa_function_pool[6327]: VertexAttribDivisorARB (will be remapped) */
- "ii\0"
- "glVertexAttribDivisorARB\0"
- "\0"
- /* _mesa_function_pool[6356]: EdgeFlagv (offset 42) */
- "p\0"
- "glEdgeFlagv\0"
- "\0"
- /* _mesa_function_pool[6371]: NormalPointerListIBM (dynamic) */
- "iipi\0"
- "glNormalPointerListIBM\0"
- "\0"
- /* _mesa_function_pool[6400]: IndexPointerEXT (will be remapped) */
- "iiip\0"
- "glIndexPointerEXT\0"
- "\0"
- /* _mesa_function_pool[6424]: Color4iv (offset 32) */
- "p\0"
- "glColor4iv\0"
- "\0"
- /* _mesa_function_pool[6438]: TexParameterf (offset 178) */
- "iif\0"
- "glTexParameterf\0"
- "\0"
- /* _mesa_function_pool[6459]: TexParameteri (offset 180) */
- "iii\0"
- "glTexParameteri\0"
- "\0"
- /* _mesa_function_pool[6480]: NormalPointerEXT (will be remapped) */
- "iiip\0"
- "glNormalPointerEXT\0"
- "\0"
- /* _mesa_function_pool[6505]: MultiTexCoord3dARB (offset 392) */
- "iddd\0"
- "glMultiTexCoord3d\0"
- "glMultiTexCoord3dARB\0"
- "\0"
- /* _mesa_function_pool[6550]: MultiTexCoord2iARB (offset 388) */
- "iii\0"
- "glMultiTexCoord2i\0"
- "glMultiTexCoord2iARB\0"
- "\0"
- /* _mesa_function_pool[6594]: DrawPixels (offset 257) */
- "iiiip\0"
- "glDrawPixels\0"
- "\0"
- /* _mesa_function_pool[6614]: ReplacementCodeuiTexCoord2fNormal3fVertex3fSUN (dynamic) */
- "iffffffff\0"
- "glReplacementCodeuiTexCoord2fNormal3fVertex3fSUN\0"
- "\0"
- /* _mesa_function_pool[6674]: MultiTexCoord2svARB (offset 391) */
- "ip\0"
- "glMultiTexCoord2sv\0"
- "glMultiTexCoord2svARB\0"
- "\0"
- /* _mesa_function_pool[6719]: ReplacementCodeubvSUN (dynamic) */
- "p\0"
- "glReplacementCodeubvSUN\0"
- "\0"
- /* _mesa_function_pool[6746]: Uniform3iARB (will be remapped) */
- "iiii\0"
- "glUniform3i\0"
- "glUniform3iARB\0"
- "\0"
- /* _mesa_function_pool[6779]: DrawTransformFeedback (will be remapped) */
- "ii\0"
- "glDrawTransformFeedback\0"
- "\0"
- /* _mesa_function_pool[6807]: DrawElementsInstancedARB (will be remapped) */
- "iiipi\0"
- "glDrawElementsInstancedARB\0"
- "glDrawElementsInstancedEXT\0"
- "glDrawElementsInstanced\0"
- "\0"
- /* _mesa_function_pool[6892]: GetShaderInfoLog (will be remapped) */
- "iipp\0"
- "glGetShaderInfoLog\0"
- "\0"
- /* _mesa_function_pool[6917]: WeightivARB (dynamic) */
- "ip\0"
- "glWeightivARB\0"
- "\0"
- /* _mesa_function_pool[6935]: PollInstrumentsSGIX (dynamic) */
- "p\0"
- "glPollInstrumentsSGIX\0"
- "\0"
- /* _mesa_function_pool[6960]: GlobalAlphaFactordSUN (dynamic) */
- "d\0"
- "glGlobalAlphaFactordSUN\0"
- "\0"
- /* _mesa_function_pool[6987]: GetFinalCombinerInputParameterfvNV (will be remapped) */
- "iip\0"
- "glGetFinalCombinerInputParameterfvNV\0"
- "\0"
- /* _mesa_function_pool[7029]: GenerateMipmapEXT (will be remapped) */
- "i\0"
- "glGenerateMipmap\0"
- "glGenerateMipmapEXT\0"
- "\0"
- /* _mesa_function_pool[7069]: GenLists (offset 5) */
- "i\0"
- "glGenLists\0"
- "\0"
- /* _mesa_function_pool[7083]: DepthRangef (will be remapped) */
- "ff\0"
- "glDepthRangef\0"
- "\0"
- /* _mesa_function_pool[7101]: GetMapAttribParameterivNV (dynamic) */
- "iiip\0"
- "glGetMapAttribParameterivNV\0"
- "\0"
- /* _mesa_function_pool[7135]: CreateShaderObjectARB (will be remapped) */
- "i\0"
- "glCreateShaderObjectARB\0"
- "\0"
- /* _mesa_function_pool[7162]: GetSharpenTexFuncSGIS (dynamic) */
- "ip\0"
- "glGetSharpenTexFuncSGIS\0"
- "\0"
- /* _mesa_function_pool[7190]: BufferDataARB (will be remapped) */
- "iipi\0"
- "glBufferData\0"
- "glBufferDataARB\0"
- "\0"
- /* _mesa_function_pool[7225]: FlushVertexArrayRangeNV (will be remapped) */
- "\0"
- "glFlushVertexArrayRangeNV\0"
- "\0"
- /* _mesa_function_pool[7253]: MapGrid2d (offset 226) */
- "iddidd\0"
- "glMapGrid2d\0"
- "\0"
- /* _mesa_function_pool[7273]: MapGrid2f (offset 227) */
- "iffiff\0"
- "glMapGrid2f\0"
- "\0"
- /* _mesa_function_pool[7293]: SampleMapATI (will be remapped) */
- "iii\0"
- "glSampleMapATI\0"
- "\0"
- /* _mesa_function_pool[7313]: VertexPointerEXT (will be remapped) */
- "iiiip\0"
- "glVertexPointerEXT\0"
- "\0"
- /* _mesa_function_pool[7339]: GetTexFilterFuncSGIS (dynamic) */
- "iip\0"
- "glGetTexFilterFuncSGIS\0"
- "\0"
- /* _mesa_function_pool[7367]: Scissor (offset 176) */
- "iiii\0"
- "glScissor\0"
- "\0"
- /* _mesa_function_pool[7383]: Fogf (offset 153) */
- "if\0"
- "glFogf\0"
- "\0"
- /* _mesa_function_pool[7394]: ReplacementCodeuiColor4ubVertex3fvSUN (dynamic) */
- "ppp\0"
- "glReplacementCodeuiColor4ubVertex3fvSUN\0"
- "\0"
- /* _mesa_function_pool[7439]: TexSubImage1D (offset 332) */
- "iiiiiip\0"
- "glTexSubImage1D\0"
- "glTexSubImage1DEXT\0"
- "\0"
- /* _mesa_function_pool[7483]: VertexAttrib1sARB (will be remapped) */
- "ii\0"
- "glVertexAttrib1s\0"
- "glVertexAttrib1sARB\0"
- "\0"
- /* _mesa_function_pool[7524]: FenceSync (will be remapped) */
- "ii\0"
- "glFenceSync\0"
- "\0"
- /* _mesa_function_pool[7540]: Color4usv (offset 40) */
- "p\0"
- "glColor4usv\0"
- "\0"
- /* _mesa_function_pool[7555]: Fogi (offset 155) */
- "ii\0"
- "glFogi\0"
- "\0"
- /* _mesa_function_pool[7566]: DepthRange (offset 288) */
- "dd\0"
- "glDepthRange\0"
- "\0"
- /* _mesa_function_pool[7583]: RasterPos3iv (offset 75) */
- "p\0"
- "glRasterPos3iv\0"
- "\0"
- /* _mesa_function_pool[7601]: FinalCombinerInputNV (will be remapped) */
- "iiii\0"
- "glFinalCombinerInputNV\0"
- "\0"
- /* _mesa_function_pool[7630]: TexCoord2i (offset 106) */
- "ii\0"
- "glTexCoord2i\0"
- "\0"
- /* _mesa_function_pool[7647]: PixelMapfv (offset 251) */
- "iip\0"
- "glPixelMapfv\0"
- "\0"
- /* _mesa_function_pool[7665]: Color4ui (offset 37) */
- "iiii\0"
- "glColor4ui\0"
- "\0"
- /* _mesa_function_pool[7682]: RasterPos3s (offset 76) */
- "iii\0"
- "glRasterPos3s\0"
- "\0"
- /* _mesa_function_pool[7701]: Color3usv (offset 24) */
- "p\0"
- "glColor3usv\0"
- "\0"
- /* _mesa_function_pool[7716]: FlushRasterSGIX (dynamic) */
- "\0"
- "glFlushRasterSGIX\0"
- "\0"
- /* _mesa_function_pool[7736]: TexCoord2f (offset 104) */
- "ff\0"
- "glTexCoord2f\0"
- "\0"
- /* _mesa_function_pool[7753]: ReplacementCodeuiTexCoord2fVertex3fSUN (dynamic) */
- "ifffff\0"
- "glReplacementCodeuiTexCoord2fVertex3fSUN\0"
- "\0"
- /* _mesa_function_pool[7802]: TexCoord2d (offset 102) */
- "dd\0"
- "glTexCoord2d\0"
- "\0"
- /* _mesa_function_pool[7819]: RasterPos3d (offset 70) */
- "ddd\0"
- "glRasterPos3d\0"
- "\0"
- /* _mesa_function_pool[7838]: RasterPos3f (offset 72) */
- "fff\0"
- "glRasterPos3f\0"
- "\0"
- /* _mesa_function_pool[7857]: Uniform1fARB (will be remapped) */
- "if\0"
- "glUniform1f\0"
- "glUniform1fARB\0"
- "\0"
- /* _mesa_function_pool[7888]: AreTexturesResident (offset 322) */
- "ipp\0"
- "glAreTexturesResident\0"
- "glAreTexturesResidentEXT\0"
- "\0"
- /* _mesa_function_pool[7940]: TexCoord2s (offset 108) */
- "ii\0"
- "glTexCoord2s\0"
- "\0"
- /* _mesa_function_pool[7957]: StencilOpSeparate (will be remapped) */
- "iiii\0"
- "glStencilOpSeparate\0"
- "glStencilOpSeparateATI\0"
- "\0"
- /* _mesa_function_pool[8006]: ColorTableParameteriv (offset 341) */
- "iip\0"
- "glColorTableParameteriv\0"
- "glColorTableParameterivSGI\0"
- "\0"
- /* _mesa_function_pool[8062]: FogCoordPointerListIBM (dynamic) */
- "iipi\0"
- "glFogCoordPointerListIBM\0"
- "\0"
- /* _mesa_function_pool[8093]: WindowPos3dMESA (will be remapped) */
- "ddd\0"
- "glWindowPos3d\0"
- "glWindowPos3dARB\0"
- "glWindowPos3dMESA\0"
- "\0"
- /* _mesa_function_pool[8147]: Color4us (offset 39) */
- "iiii\0"
- "glColor4us\0"
- "\0"
- /* _mesa_function_pool[8164]: PointParameterfvEXT (will be remapped) */
- "ip\0"
- "glPointParameterfv\0"
- "glPointParameterfvARB\0"
- "glPointParameterfvEXT\0"
- "glPointParameterfvSGIS\0"
- "\0"
- /* _mesa_function_pool[8254]: Color3bv (offset 10) */
- "p\0"
- "glColor3bv\0"
- "\0"
- /* _mesa_function_pool[8268]: GetnCompressedTexImageARB (will be remapped) */
- "iiip\0"
- "glGetnCompressedTexImageARB\0"
- "\0"
- /* _mesa_function_pool[8302]: WindowPos2fvMESA (will be remapped) */
- "p\0"
- "glWindowPos2fv\0"
- "glWindowPos2fvARB\0"
- "glWindowPos2fvMESA\0"
- "\0"
- /* _mesa_function_pool[8357]: SecondaryColor3bvEXT (will be remapped) */
- "p\0"
- "glSecondaryColor3bv\0"
- "glSecondaryColor3bvEXT\0"
- "\0"
- /* _mesa_function_pool[8403]: VertexPointerListIBM (dynamic) */
- "iiipi\0"
- "glVertexPointerListIBM\0"
- "\0"
- /* _mesa_function_pool[8433]: GetProgramLocalParameterfvARB (will be remapped) */
- "iip\0"
- "glGetProgramLocalParameterfvARB\0"
- "\0"
- /* _mesa_function_pool[8470]: FragmentMaterialfSGIX (dynamic) */
- "iif\0"
- "glFragmentMaterialfSGIX\0"
- "\0"
- /* _mesa_function_pool[8499]: BindSampler (will be remapped) */
- "ii\0"
- "glBindSampler\0"
- "\0"
- /* _mesa_function_pool[8517]: RenderbufferStorageEXT (will be remapped) */
- "iiii\0"
- "glRenderbufferStorage\0"
- "glRenderbufferStorageEXT\0"
- "\0"
- /* _mesa_function_pool[8570]: IsFenceNV (will be remapped) */
- "i\0"
- "glIsFenceNV\0"
- "\0"
- /* _mesa_function_pool[8585]: AttachObjectARB (will be remapped) */
- "ii\0"
- "glAttachObjectARB\0"
- "\0"
- /* _mesa_function_pool[8607]: GetFragmentLightivSGIX (dynamic) */
- "iip\0"
- "glGetFragmentLightivSGIX\0"
- "\0"
- /* _mesa_function_pool[8637]: UniformMatrix2fvARB (will be remapped) */
- "iiip\0"
- "glUniformMatrix2fv\0"
- "glUniformMatrix2fvARB\0"
- "\0"
- /* _mesa_function_pool[8684]: MultiTexCoord2fARB (offset 386) */
- "iff\0"
- "glMultiTexCoord2f\0"
- "glMultiTexCoord2fARB\0"
- "\0"
- /* _mesa_function_pool[8728]: ColorTable (offset 339) */
- "iiiiip\0"
- "glColorTable\0"
- "glColorTableSGI\0"
- "glColorTableEXT\0"
- "\0"
- /* _mesa_function_pool[8781]: IndexPointer (offset 314) */
- "iip\0"
- "glIndexPointer\0"
- "\0"
- /* _mesa_function_pool[8801]: Accum (offset 213) */
- "if\0"
- "glAccum\0"
- "\0"
- /* _mesa_function_pool[8813]: GetTexImage (offset 281) */
- "iiiip\0"
- "glGetTexImage\0"
- "\0"
- /* _mesa_function_pool[8834]: MapControlPointsNV (dynamic) */
- "iiiiiiiip\0"
- "glMapControlPointsNV\0"
- "\0"
- /* _mesa_function_pool[8866]: ConvolutionFilter2D (offset 349) */
- "iiiiiip\0"
- "glConvolutionFilter2D\0"
- "glConvolutionFilter2DEXT\0"
- "\0"
- /* _mesa_function_pool[8922]: Finish (offset 216) */
- "\0"
- "glFinish\0"
- "\0"
- /* _mesa_function_pool[8933]: MapParameterfvNV (dynamic) */
- "iip\0"
- "glMapParameterfvNV\0"
- "\0"
- /* _mesa_function_pool[8957]: ClearStencil (offset 207) */
- "i\0"
- "glClearStencil\0"
- "\0"
- /* _mesa_function_pool[8975]: VertexAttrib3dvARB (will be remapped) */
- "ip\0"
- "glVertexAttrib3dv\0"
- "glVertexAttrib3dvARB\0"
- "\0"
- /* _mesa_function_pool[9018]: Uniform4uivEXT (will be remapped) */
- "iip\0"
- "glUniform4uivEXT\0"
- "glUniform4uiv\0"
- "\0"
- /* _mesa_function_pool[9054]: HintPGI (dynamic) */
- "ii\0"
- "glHintPGI\0"
- "\0"
- /* _mesa_function_pool[9068]: ConvolutionParameteriv (offset 353) */
- "iip\0"
- "glConvolutionParameteriv\0"
- "glConvolutionParameterivEXT\0"
- "\0"
- /* _mesa_function_pool[9126]: Color4s (offset 33) */
- "iiii\0"
- "glColor4s\0"
- "\0"
- /* _mesa_function_pool[9142]: InterleavedArrays (offset 317) */
- "iip\0"
- "glInterleavedArrays\0"
- "\0"
- /* _mesa_function_pool[9167]: RasterPos2fv (offset 65) */
- "p\0"
- "glRasterPos2fv\0"
- "\0"
- /* _mesa_function_pool[9185]: TexCoord1fv (offset 97) */
- "p\0"
- "glTexCoord1fv\0"
- "\0"
- /* _mesa_function_pool[9202]: Vertex2d (offset 126) */
- "dd\0"
- "glVertex2d\0"
- "\0"
- /* _mesa_function_pool[9217]: CullParameterdvEXT (dynamic) */
- "ip\0"
- "glCullParameterdvEXT\0"
- "\0"
- /* _mesa_function_pool[9242]: ProgramNamedParameter4fNV (will be remapped) */
- "iipffff\0"
- "glProgramNamedParameter4fNV\0"
- "\0"
- /* _mesa_function_pool[9279]: Color3fVertex3fSUN (dynamic) */
- "ffffff\0"
- "glColor3fVertex3fSUN\0"
- "\0"
- /* _mesa_function_pool[9308]: ProgramEnvParameter4fvARB (will be remapped) */
- "iip\0"
- "glProgramEnvParameter4fvARB\0"
- "glProgramParameter4fvNV\0"
- "\0"
- /* _mesa_function_pool[9365]: Color4i (offset 31) */
- "iiii\0"
- "glColor4i\0"
- "\0"
- /* _mesa_function_pool[9381]: Color4f (offset 29) */
- "ffff\0"
- "glColor4f\0"
- "\0"
- /* _mesa_function_pool[9397]: RasterPos4fv (offset 81) */
- "p\0"
- "glRasterPos4fv\0"
- "\0"
- /* _mesa_function_pool[9415]: Color4d (offset 27) */
- "dddd\0"
- "glColor4d\0"
- "\0"
- /* _mesa_function_pool[9431]: ClearIndex (offset 205) */
- "f\0"
- "glClearIndex\0"
- "\0"
- /* _mesa_function_pool[9447]: Color4b (offset 25) */
- "iiii\0"
- "glColor4b\0"
- "\0"
- /* _mesa_function_pool[9463]: LoadMatrixd (offset 292) */
- "p\0"
- "glLoadMatrixd\0"
- "\0"
- /* _mesa_function_pool[9480]: FragmentLightModeliSGIX (dynamic) */
- "ii\0"
- "glFragmentLightModeliSGIX\0"
- "\0"
- /* _mesa_function_pool[9510]: RasterPos2dv (offset 63) */
- "p\0"
- "glRasterPos2dv\0"
- "\0"
- /* _mesa_function_pool[9528]: ConvolutionParameterfv (offset 351) */
- "iip\0"
- "glConvolutionParameterfv\0"
- "glConvolutionParameterfvEXT\0"
- "\0"
- /* _mesa_function_pool[9586]: TbufferMask3DFX (dynamic) */
- "i\0"
- "glTbufferMask3DFX\0"
- "\0"
- /* _mesa_function_pool[9607]: GetTexGendv (offset 278) */
- "iip\0"
- "glGetTexGendv\0"
- "\0"
- /* _mesa_function_pool[9626]: GetVertexAttribfvNV (will be remapped) */
- "iip\0"
- "glGetVertexAttribfvNV\0"
- "\0"
- /* _mesa_function_pool[9653]: BeginTransformFeedbackEXT (will be remapped) */
- "i\0"
- "glBeginTransformFeedbackEXT\0"
- "glBeginTransformFeedback\0"
- "\0"
- /* _mesa_function_pool[9709]: LoadProgramNV (will be remapped) */
- "iiip\0"
- "glLoadProgramNV\0"
- "\0"
- /* _mesa_function_pool[9731]: WaitSync (will be remapped) */
- "iii\0"
- "glWaitSync\0"
- "\0"
- /* _mesa_function_pool[9747]: EndList (offset 1) */
- "\0"
- "glEndList\0"
- "\0"
- /* _mesa_function_pool[9759]: VertexAttrib4fvNV (will be remapped) */
- "ip\0"
- "glVertexAttrib4fvNV\0"
- "\0"
- /* _mesa_function_pool[9783]: GetAttachedObjectsARB (will be remapped) */
- "iipp\0"
- "glGetAttachedObjectsARB\0"
- "\0"
- /* _mesa_function_pool[9813]: Uniform3fvARB (will be remapped) */
- "iip\0"
- "glUniform3fv\0"
- "glUniform3fvARB\0"
- "\0"
- /* _mesa_function_pool[9847]: EvalCoord1fv (offset 231) */
- "p\0"
- "glEvalCoord1fv\0"
- "\0"
- /* _mesa_function_pool[9865]: DrawRangeElements (offset 338) */
- "iiiiip\0"
- "glDrawRangeElements\0"
- "glDrawRangeElementsEXT\0"
- "\0"
- /* _mesa_function_pool[9916]: EvalMesh2 (offset 238) */
- "iiiii\0"
- "glEvalMesh2\0"
- "\0"
- /* _mesa_function_pool[9935]: Vertex4fv (offset 145) */
- "p\0"
- "glVertex4fv\0"
- "\0"
- /* _mesa_function_pool[9950]: GenTransformFeedbacks (will be remapped) */
- "ip\0"
- "glGenTransformFeedbacks\0"
- "\0"
- /* _mesa_function_pool[9978]: SpriteParameterfvSGIX (dynamic) */
- "ip\0"
- "glSpriteParameterfvSGIX\0"
- "\0"
- /* _mesa_function_pool[10006]: CheckFramebufferStatusEXT (will be remapped) */
- "i\0"
- "glCheckFramebufferStatus\0"
- "glCheckFramebufferStatusEXT\0"
- "\0"
- /* _mesa_function_pool[10062]: GlobalAlphaFactoruiSUN (dynamic) */
- "i\0"
- "glGlobalAlphaFactoruiSUN\0"
- "\0"
- /* _mesa_function_pool[10090]: GetHandleARB (will be remapped) */
- "i\0"
- "glGetHandleARB\0"
- "\0"
- /* _mesa_function_pool[10108]: GetVertexAttribivARB (will be remapped) */
- "iip\0"
- "glGetVertexAttribiv\0"
- "glGetVertexAttribivARB\0"
- "\0"
- /* _mesa_function_pool[10156]: BlendFunciARB (will be remapped) */
- "iii\0"
- "glBlendFunciARB\0"
- "glBlendFuncIndexedAMD\0"
- "\0"
- /* _mesa_function_pool[10199]: GetnUniformivARB (will be remapped) */
- "iiip\0"
- "glGetnUniformivARB\0"
- "\0"
- /* _mesa_function_pool[10224]: GetTexParameterIivEXT (will be remapped) */
- "iip\0"
- "glGetTexParameterIivEXT\0"
- "glGetTexParameterIiv\0"
- "\0"
- /* _mesa_function_pool[10274]: CreateProgram (will be remapped) */
- "\0"
- "glCreateProgram\0"
- "\0"
- /* _mesa_function_pool[10292]: LoadTransposeMatrixdARB (will be remapped) */
- "p\0"
- "glLoadTransposeMatrixd\0"
- "glLoadTransposeMatrixdARB\0"
- "\0"
- /* _mesa_function_pool[10344]: ReleaseShaderCompiler (will be remapped) */
- "\0"
- "glReleaseShaderCompiler\0"
- "\0"
- /* _mesa_function_pool[10370]: GetMinmax (offset 364) */
- "iiiip\0"
- "glGetMinmax\0"
- "glGetMinmaxEXT\0"
- "\0"
- /* _mesa_function_pool[10404]: StencilFuncSeparate (will be remapped) */
- "iiii\0"
- "glStencilFuncSeparate\0"
- "\0"
- /* _mesa_function_pool[10432]: SecondaryColor3sEXT (will be remapped) */
- "iii\0"
- "glSecondaryColor3s\0"
- "glSecondaryColor3sEXT\0"
- "\0"
- /* _mesa_function_pool[10478]: Color3fVertex3fvSUN (dynamic) */
- "pp\0"
- "glColor3fVertex3fvSUN\0"
- "\0"
- /* _mesa_function_pool[10504]: GetInteger64i_v (will be remapped) */
- "iip\0"
- "glGetInteger64i_v\0"
- "\0"
- /* _mesa_function_pool[10527]: GetVertexAttribdvNV (will be remapped) */
- "iip\0"
- "glGetVertexAttribdvNV\0"
- "\0"
- /* _mesa_function_pool[10554]: Normal3fv (offset 57) */
- "p\0"
- "glNormal3fv\0"
- "\0"
- /* _mesa_function_pool[10569]: GlobalAlphaFactorbSUN (dynamic) */
- "i\0"
- "glGlobalAlphaFactorbSUN\0"
- "\0"
- /* _mesa_function_pool[10596]: Color3us (offset 23) */
- "iii\0"
- "glColor3us\0"
- "\0"
- /* _mesa_function_pool[10612]: ImageTransformParameterfvHP (dynamic) */
- "iip\0"
- "glImageTransformParameterfvHP\0"
- "\0"
- /* _mesa_function_pool[10647]: VertexAttrib4ivARB (will be remapped) */
- "ip\0"
- "glVertexAttrib4iv\0"
- "glVertexAttrib4ivARB\0"
- "\0"
- /* _mesa_function_pool[10690]: End (offset 43) */
- "\0"
- "glEnd\0"
- "\0"
- /* _mesa_function_pool[10698]: VertexAttrib3fNV (will be remapped) */
- "ifff\0"
- "glVertexAttrib3fNV\0"
- "\0"
- /* _mesa_function_pool[10723]: VertexAttribs2dvNV (will be remapped) */
- "iip\0"
- "glVertexAttribs2dvNV\0"
- "\0"
- /* _mesa_function_pool[10749]: GetQueryObjectui64vEXT (will be remapped) */
- "iip\0"
- "glGetQueryObjectui64vEXT\0"
- "\0"
- /* _mesa_function_pool[10779]: MultiTexCoord3fvARB (offset 395) */
- "ip\0"
- "glMultiTexCoord3fv\0"
- "glMultiTexCoord3fvARB\0"
- "\0"
- /* _mesa_function_pool[10824]: SecondaryColor3dEXT (will be remapped) */
- "ddd\0"
- "glSecondaryColor3d\0"
- "glSecondaryColor3dEXT\0"
- "\0"
- /* _mesa_function_pool[10870]: Color3ub (offset 19) */
- "iii\0"
- "glColor3ub\0"
- "\0"
- /* _mesa_function_pool[10886]: GetProgramParameterfvNV (will be remapped) */
- "iiip\0"
- "glGetProgramParameterfvNV\0"
- "\0"
- /* _mesa_function_pool[10918]: TangentPointerEXT (dynamic) */
- "iip\0"
- "glTangentPointerEXT\0"
- "\0"
- /* _mesa_function_pool[10943]: Color4fNormal3fVertex3fvSUN (dynamic) */
- "ppp\0"
- "glColor4fNormal3fVertex3fvSUN\0"
- "\0"
- /* _mesa_function_pool[10978]: GetInstrumentsSGIX (dynamic) */
- "\0"
- "glGetInstrumentsSGIX\0"
- "\0"
- /* _mesa_function_pool[11001]: GetUniformuivEXT (will be remapped) */
- "iip\0"
- "glGetUniformuivEXT\0"
- "glGetUniformuiv\0"
- "\0"
- /* _mesa_function_pool[11041]: Color3ui (offset 21) */
- "iii\0"
- "glColor3ui\0"
- "\0"
- /* _mesa_function_pool[11057]: EvalMapsNV (dynamic) */
- "ii\0"
- "glEvalMapsNV\0"
- "\0"
- /* _mesa_function_pool[11074]: TexSubImage2D (offset 333) */
- "iiiiiiiip\0"
- "glTexSubImage2D\0"
- "glTexSubImage2DEXT\0"
- "\0"
- /* _mesa_function_pool[11120]: FragmentLightivSGIX (dynamic) */
- "iip\0"
- "glFragmentLightivSGIX\0"
- "\0"
- /* _mesa_function_pool[11147]: GetTexParameterPointervAPPLE (will be remapped) */
- "iip\0"
- "glGetTexParameterPointervAPPLE\0"
- "\0"
- /* _mesa_function_pool[11183]: TexGenfv (offset 191) */
- "iip\0"
- "glTexGenfv\0"
- "\0"
- /* _mesa_function_pool[11199]: GetTransformFeedbackVaryingEXT (will be remapped) */
- "iiipppp\0"
- "glGetTransformFeedbackVaryingEXT\0"
- "glGetTransformFeedbackVarying\0"
- "\0"
- /* _mesa_function_pool[11271]: VertexAttrib4bvARB (will be remapped) */
- "ip\0"
- "glVertexAttrib4bv\0"
- "glVertexAttrib4bvARB\0"
- "\0"
- /* _mesa_function_pool[11314]: ShaderBinary (will be remapped) */
- "ipipi\0"
- "glShaderBinary\0"
- "\0"
- /* _mesa_function_pool[11336]: GetIntegerIndexedvEXT (will be remapped) */
- "iip\0"
- "glGetIntegerIndexedvEXT\0"
- "glGetIntegeri_v\0"
- "\0"
- /* _mesa_function_pool[11381]: MultiTexCoord4sARB (offset 406) */
- "iiiii\0"
- "glMultiTexCoord4s\0"
- "glMultiTexCoord4sARB\0"
- "\0"
- /* _mesa_function_pool[11427]: GetFragmentMaterialivSGIX (dynamic) */
- "iip\0"
- "glGetFragmentMaterialivSGIX\0"
- "\0"
- /* _mesa_function_pool[11460]: WindowPos4dMESA (will be remapped) */
- "dddd\0"
- "glWindowPos4dMESA\0"
- "\0"
- /* _mesa_function_pool[11484]: WeightPointerARB (dynamic) */
- "iiip\0"
- "glWeightPointerARB\0"
- "\0"
- /* _mesa_function_pool[11509]: WindowPos2dMESA (will be remapped) */
- "dd\0"
- "glWindowPos2d\0"
- "glWindowPos2dARB\0"
- "glWindowPos2dMESA\0"
- "\0"
- /* _mesa_function_pool[11562]: FramebufferTexture3DEXT (will be remapped) */
- "iiiiii\0"
- "glFramebufferTexture3D\0"
- "glFramebufferTexture3DEXT\0"
- "\0"
- /* _mesa_function_pool[11619]: BlendEquation (offset 337) */
- "i\0"
- "glBlendEquation\0"
- "glBlendEquationEXT\0"
- "\0"
- /* _mesa_function_pool[11657]: VertexAttrib3dNV (will be remapped) */
- "iddd\0"
- "glVertexAttrib3dNV\0"
- "\0"
- /* _mesa_function_pool[11682]: VertexAttrib3dARB (will be remapped) */
- "iddd\0"
- "glVertexAttrib3d\0"
- "glVertexAttrib3dARB\0"
- "\0"
- /* _mesa_function_pool[11725]: VertexAttribI4usvEXT (will be remapped) */
- "ip\0"
- "glVertexAttribI4usvEXT\0"
- "glVertexAttribI4usv\0"
- "\0"
- /* _mesa_function_pool[11772]: ReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN (dynamic) */
- "ppppp\0"
- "glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN\0"
- "\0"
- /* _mesa_function_pool[11836]: VertexAttrib4fARB (will be remapped) */
- "iffff\0"
- "glVertexAttrib4f\0"
- "glVertexAttrib4fARB\0"
- "\0"
- /* _mesa_function_pool[11880]: GetError (offset 261) */
- "\0"
- "glGetError\0"
- "\0"
- /* _mesa_function_pool[11893]: IndexFuncEXT (dynamic) */
- "if\0"
- "glIndexFuncEXT\0"
- "\0"
- /* _mesa_function_pool[11912]: TexCoord3dv (offset 111) */
- "p\0"
- "glTexCoord3dv\0"
- "\0"
- /* _mesa_function_pool[11929]: Indexdv (offset 45) */
- "p\0"
- "glIndexdv\0"
- "\0"
- /* _mesa_function_pool[11942]: FramebufferTexture2DEXT (will be remapped) */
- "iiiii\0"
- "glFramebufferTexture2D\0"
- "glFramebufferTexture2DEXT\0"
- "\0"
- /* _mesa_function_pool[11998]: Normal3s (offset 60) */
- "iii\0"
- "glNormal3s\0"
- "\0"
- /* _mesa_function_pool[12014]: GetObjectParameterivAPPLE (will be remapped) */
- "iiip\0"
- "glGetObjectParameterivAPPLE\0"
- "\0"
- /* _mesa_function_pool[12048]: PushName (offset 201) */
- "i\0"
- "glPushName\0"
- "\0"
- /* _mesa_function_pool[12062]: MultiTexCoord2dvARB (offset 385) */
- "ip\0"
- "glMultiTexCoord2dv\0"
- "glMultiTexCoord2dvARB\0"
- "\0"
- /* _mesa_function_pool[12107]: CullParameterfvEXT (dynamic) */
- "ip\0"
- "glCullParameterfvEXT\0"
- "\0"
- /* _mesa_function_pool[12132]: Normal3i (offset 58) */
- "iii\0"
- "glNormal3i\0"
- "\0"
- /* _mesa_function_pool[12148]: ProgramNamedParameter4fvNV (will be remapped) */
- "iipp\0"
- "glProgramNamedParameter4fvNV\0"
- "\0"
- /* _mesa_function_pool[12183]: SecondaryColorPointerEXT (will be remapped) */
- "iiip\0"
- "glSecondaryColorPointer\0"
- "glSecondaryColorPointerEXT\0"
- "\0"
- /* _mesa_function_pool[12240]: VertexAttrib4fvARB (will be remapped) */
- "ip\0"
- "glVertexAttrib4fv\0"
- "glVertexAttrib4fvARB\0"
- "\0"
- /* _mesa_function_pool[12283]: PixelTexGenSGIX (will be remapped) */
- "i\0"
- "glPixelTexGenSGIX\0"
- "\0"
- /* _mesa_function_pool[12304]: GetActiveUniformARB (will be remapped) */
- "iiipppp\0"
- "glGetActiveUniform\0"
- "glGetActiveUniformARB\0"
- "\0"
- /* _mesa_function_pool[12354]: ImageTransformParameteriHP (dynamic) */
- "iii\0"
- "glImageTransformParameteriHP\0"
- "\0"
- /* _mesa_function_pool[12388]: Normal3b (offset 52) */
- "iii\0"
- "glNormal3b\0"
- "\0"
- /* _mesa_function_pool[12404]: Normal3d (offset 54) */
- "ddd\0"
- "glNormal3d\0"
- "\0"
- /* _mesa_function_pool[12420]: Uniform1uiEXT (will be remapped) */
- "ii\0"
- "glUniform1uiEXT\0"
- "glUniform1ui\0"
- "\0"
- /* _mesa_function_pool[12453]: Normal3f (offset 56) */
- "fff\0"
- "glNormal3f\0"
- "\0"
- /* _mesa_function_pool[12469]: MultiTexCoord1svARB (offset 383) */
- "ip\0"
- "glMultiTexCoord1sv\0"
- "glMultiTexCoord1svARB\0"
- "\0"
- /* _mesa_function_pool[12514]: Indexi (offset 48) */
- "i\0"
- "glIndexi\0"
- "\0"
- /* _mesa_function_pool[12526]: EGLImageTargetTexture2DOES (will be remapped) */
- "ip\0"
- "glEGLImageTargetTexture2DOES\0"
- "\0"
- /* _mesa_function_pool[12559]: EndQueryARB (will be remapped) */
- "i\0"
- "glEndQuery\0"
- "glEndQueryARB\0"
- "\0"
- /* _mesa_function_pool[12587]: DeleteFencesNV (will be remapped) */
- "ip\0"
- "glDeleteFencesNV\0"
- "\0"
- /* _mesa_function_pool[12608]: ColorPointerListIBM (dynamic) */
- "iiipi\0"
- "glColorPointerListIBM\0"
- "\0"
- /* _mesa_function_pool[12637]: BindBufferRangeEXT (will be remapped) */
- "iiiii\0"
- "glBindBufferRangeEXT\0"
- "glBindBufferRange\0"
- "\0"
- /* _mesa_function_pool[12683]: DepthMask (offset 211) */
- "i\0"
- "glDepthMask\0"
- "\0"
- /* _mesa_function_pool[12698]: IsShader (will be remapped) */
- "i\0"
- "glIsShader\0"
- "\0"
- /* _mesa_function_pool[12712]: Indexf (offset 46) */
- "f\0"
- "glIndexf\0"
- "\0"
- /* _mesa_function_pool[12724]: GetImageTransformParameterivHP (dynamic) */
- "iip\0"
- "glGetImageTransformParameterivHP\0"
- "\0"
- /* _mesa_function_pool[12762]: Indexd (offset 44) */
- "d\0"
- "glIndexd\0"
- "\0"
- /* _mesa_function_pool[12774]: GetMaterialiv (offset 270) */
- "iip\0"
- "glGetMaterialiv\0"
- "\0"
- /* _mesa_function_pool[12795]: StencilOp (offset 244) */
- "iii\0"
- "glStencilOp\0"
- "\0"
- /* _mesa_function_pool[12812]: WindowPos4ivMESA (will be remapped) */
- "p\0"
- "glWindowPos4ivMESA\0"
- "\0"
- /* _mesa_function_pool[12834]: FramebufferTextureLayer (dynamic) */
- "iiiii\0"
- "glFramebufferTextureLayerARB\0"
- "\0"
- /* _mesa_function_pool[12870]: MultiTexCoord3svARB (offset 399) */
- "ip\0"
- "glMultiTexCoord3sv\0"
- "glMultiTexCoord3svARB\0"
- "\0"
- /* _mesa_function_pool[12915]: TexEnvfv (offset 185) */
- "iip\0"
- "glTexEnvfv\0"
- "\0"
- /* _mesa_function_pool[12931]: MultiTexCoord4iARB (offset 404) */
- "iiiii\0"
- "glMultiTexCoord4i\0"
- "glMultiTexCoord4iARB\0"
- "\0"
- /* _mesa_function_pool[12977]: Indexs (offset 50) */
- "i\0"
- "glIndexs\0"
- "\0"
- /* _mesa_function_pool[12989]: Binormal3ivEXT (dynamic) */
- "p\0"
- "glBinormal3ivEXT\0"
- "\0"
- /* _mesa_function_pool[13009]: ResizeBuffersMESA (will be remapped) */
- "\0"
- "glResizeBuffersMESA\0"
- "\0"
- /* _mesa_function_pool[13031]: BlendFuncSeparateiARB (will be remapped) */
- "iiiii\0"
- "glBlendFuncSeparateiARB\0"
- "glBlendFuncSeparateIndexedAMD\0"
- "\0"
- /* _mesa_function_pool[13092]: GetUniformivARB (will be remapped) */
- "iip\0"
- "glGetUniformiv\0"
- "glGetUniformivARB\0"
- "\0"
- /* _mesa_function_pool[13130]: PixelTexGenParameteriSGIS (will be remapped) */
- "ii\0"
- "glPixelTexGenParameteriSGIS\0"
- "\0"
- /* _mesa_function_pool[13162]: VertexPointervINTEL (dynamic) */
- "iip\0"
- "glVertexPointervINTEL\0"
- "\0"
- /* _mesa_function_pool[13189]: Vertex2i (offset 130) */
- "ii\0"
- "glVertex2i\0"
- "\0"
- /* _mesa_function_pool[13204]: LoadMatrixf (offset 291) */
- "p\0"
- "glLoadMatrixf\0"
- "\0"
- /* _mesa_function_pool[13221]: VertexAttribI1uivEXT (will be remapped) */
- "ip\0"
- "glVertexAttribI1uivEXT\0"
- "glVertexAttribI1uiv\0"
- "\0"
- /* _mesa_function_pool[13268]: Vertex2f (offset 128) */
- "ff\0"
- "glVertex2f\0"
- "\0"
- /* _mesa_function_pool[13283]: ReplacementCodeuiColor4fNormal3fVertex3fvSUN (dynamic) */
- "pppp\0"
- "glReplacementCodeuiColor4fNormal3fVertex3fvSUN\0"
- "\0"
- /* _mesa_function_pool[13336]: Color4bv (offset 26) */
- "p\0"
- "glColor4bv\0"
- "\0"
- /* _mesa_function_pool[13350]: VertexPointer (offset 321) */
- "iiip\0"
- "glVertexPointer\0"
- "\0"
- /* _mesa_function_pool[13372]: SecondaryColor3uiEXT (will be remapped) */
- "iii\0"
- "glSecondaryColor3ui\0"
- "glSecondaryColor3uiEXT\0"
- "\0"
- /* _mesa_function_pool[13420]: StartInstrumentsSGIX (dynamic) */
- "\0"
- "glStartInstrumentsSGIX\0"
- "\0"
- /* _mesa_function_pool[13445]: SecondaryColor3usvEXT (will be remapped) */
- "p\0"
- "glSecondaryColor3usv\0"
- "glSecondaryColor3usvEXT\0"
- "\0"
- /* _mesa_function_pool[13493]: VertexAttrib2fvNV (will be remapped) */
- "ip\0"
- "glVertexAttrib2fvNV\0"
- "\0"
- /* _mesa_function_pool[13517]: ProgramLocalParameter4dvARB (will be remapped) */
- "iip\0"
- "glProgramLocalParameter4dvARB\0"
- "\0"
- /* _mesa_function_pool[13552]: DeleteLists (offset 4) */
- "ii\0"
- "glDeleteLists\0"
- "\0"
- /* _mesa_function_pool[13570]: LogicOp (offset 242) */
- "i\0"
- "glLogicOp\0"
- "\0"
- /* _mesa_function_pool[13583]: MatrixIndexuivARB (dynamic) */
- "ip\0"
- "glMatrixIndexuivARB\0"
- "\0"
- /* _mesa_function_pool[13607]: Vertex2s (offset 132) */
- "ii\0"
- "glVertex2s\0"
- "\0"
- /* _mesa_function_pool[13622]: RenderbufferStorageMultisample (will be remapped) */
- "iiiii\0"
- "glRenderbufferStorageMultisample\0"
- "glRenderbufferStorageMultisampleEXT\0"
- "\0"
- /* _mesa_function_pool[13698]: TexCoord4fv (offset 121) */
- "p\0"
- "glTexCoord4fv\0"
- "\0"
- /* _mesa_function_pool[13715]: Tangent3sEXT (dynamic) */
- "iii\0"
- "glTangent3sEXT\0"
- "\0"
- /* _mesa_function_pool[13735]: GlobalAlphaFactorfSUN (dynamic) */
- "f\0"
- "glGlobalAlphaFactorfSUN\0"
- "\0"
- /* _mesa_function_pool[13762]: MultiTexCoord3iARB (offset 396) */
- "iiii\0"
- "glMultiTexCoord3i\0"
- "glMultiTexCoord3iARB\0"
- "\0"
- /* _mesa_function_pool[13807]: IsProgram (will be remapped) */
- "i\0"
- "glIsProgram\0"
- "\0"
- /* _mesa_function_pool[13822]: TexCoordPointerListIBM (dynamic) */
- "iiipi\0"
- "glTexCoordPointerListIBM\0"
- "\0"
- /* _mesa_function_pool[13854]: VertexAttribI4svEXT (will be remapped) */
- "ip\0"
- "glVertexAttribI4svEXT\0"
- "glVertexAttribI4sv\0"
- "\0"
- /* _mesa_function_pool[13899]: GlobalAlphaFactorusSUN (dynamic) */
- "i\0"
- "glGlobalAlphaFactorusSUN\0"
- "\0"
- /* _mesa_function_pool[13927]: VertexAttrib2dvNV (will be remapped) */
- "ip\0"
- "glVertexAttrib2dvNV\0"
- "\0"
- /* _mesa_function_pool[13951]: FramebufferRenderbufferEXT (will be remapped) */
- "iiii\0"
- "glFramebufferRenderbuffer\0"
- "glFramebufferRenderbufferEXT\0"
- "\0"
- /* _mesa_function_pool[14012]: ClearBufferuiv (will be remapped) */
- "iip\0"
- "glClearBufferuiv\0"
- "\0"
- /* _mesa_function_pool[14034]: VertexAttrib1dvNV (will be remapped) */
- "ip\0"
- "glVertexAttrib1dvNV\0"
- "\0"
- /* _mesa_function_pool[14058]: GenTextures (offset 328) */
- "ip\0"
- "glGenTextures\0"
- "glGenTexturesEXT\0"
- "\0"
- /* _mesa_function_pool[14093]: FramebufferTextureARB (will be remapped) */
- "iiii\0"
- "glFramebufferTextureARB\0"
- "\0"
- /* _mesa_function_pool[14123]: SetFenceNV (will be remapped) */
- "ii\0"
- "glSetFenceNV\0"
- "\0"
- /* _mesa_function_pool[14140]: FramebufferTexture1DEXT (will be remapped) */
- "iiiii\0"
- "glFramebufferTexture1D\0"
- "glFramebufferTexture1DEXT\0"
- "\0"
- /* _mesa_function_pool[14196]: GetCombinerOutputParameterivNV (will be remapped) */
- "iiip\0"
- "glGetCombinerOutputParameterivNV\0"
- "\0"
- /* _mesa_function_pool[14235]: PixelTexGenParameterivSGIS (will be remapped) */
- "ip\0"
- "glPixelTexGenParameterivSGIS\0"
- "\0"
- /* _mesa_function_pool[14268]: TextureNormalEXT (dynamic) */
- "i\0"
- "glTextureNormalEXT\0"
- "\0"
- /* _mesa_function_pool[14290]: IndexPointerListIBM (dynamic) */
- "iipi\0"
- "glIndexPointerListIBM\0"
- "\0"
- /* _mesa_function_pool[14318]: WeightfvARB (dynamic) */
- "ip\0"
- "glWeightfvARB\0"
- "\0"
- /* _mesa_function_pool[14336]: RasterPos2sv (offset 69) */
- "p\0"
- "glRasterPos2sv\0"
- "\0"
- /* _mesa_function_pool[14354]: Color4ubv (offset 36) */
- "p\0"
- "glColor4ubv\0"
- "\0"
- /* _mesa_function_pool[14369]: DrawBuffer (offset 202) */
- "i\0"
- "glDrawBuffer\0"
- "\0"
- /* _mesa_function_pool[14385]: TexCoord2fv (offset 105) */
- "p\0"
- "glTexCoord2fv\0"
- "\0"
- /* _mesa_function_pool[14402]: WindowPos4fMESA (will be remapped) */
- "ffff\0"
- "glWindowPos4fMESA\0"
- "\0"
- /* _mesa_function_pool[14426]: TexCoord1sv (offset 101) */
- "p\0"
- "glTexCoord1sv\0"
- "\0"
- /* _mesa_function_pool[14443]: WindowPos3dvMESA (will be remapped) */
- "p\0"
- "glWindowPos3dv\0"
- "glWindowPos3dvARB\0"
- "glWindowPos3dvMESA\0"
- "\0"
- /* _mesa_function_pool[14498]: DepthFunc (offset 245) */
- "i\0"
- "glDepthFunc\0"
- "\0"
- /* _mesa_function_pool[14513]: PixelMapusv (offset 253) */
- "iip\0"
- "glPixelMapusv\0"
- "\0"
- /* _mesa_function_pool[14532]: GetQueryObjecti64vEXT (will be remapped) */
- "iip\0"
- "glGetQueryObjecti64vEXT\0"
- "\0"
- /* _mesa_function_pool[14561]: MultiTexCoord1dARB (offset 376) */
- "id\0"
- "glMultiTexCoord1d\0"
- "glMultiTexCoord1dARB\0"
- "\0"
- /* _mesa_function_pool[14604]: PointParameterivNV (will be remapped) */
- "ip\0"
- "glPointParameteriv\0"
- "glPointParameterivNV\0"
- "\0"
- /* _mesa_function_pool[14648]: IsSampler (will be remapped) */
- "i\0"
- "glIsSampler\0"
- "\0"
- /* _mesa_function_pool[14663]: BlendFunc (offset 241) */
- "ii\0"
- "glBlendFunc\0"
- "\0"
- /* _mesa_function_pool[14679]: EndTransformFeedbackEXT (will be remapped) */
- "\0"
- "glEndTransformFeedbackEXT\0"
- "glEndTransformFeedback\0"
- "\0"
- /* _mesa_function_pool[14730]: Uniform2fvARB (will be remapped) */
- "iip\0"
- "glUniform2fv\0"
- "glUniform2fvARB\0"
- "\0"
- /* _mesa_function_pool[14764]: BufferParameteriAPPLE (will be remapped) */
- "iii\0"
- "glBufferParameteriAPPLE\0"
- "\0"
- /* _mesa_function_pool[14793]: MultiTexCoord3dvARB (offset 393) */
- "ip\0"
- "glMultiTexCoord3dv\0"
- "glMultiTexCoord3dvARB\0"
- "\0"
- /* _mesa_function_pool[14838]: ReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN (dynamic) */
- "pppp\0"
- "glReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN\0"
- "\0"
- /* _mesa_function_pool[14894]: DeleteObjectARB (will be remapped) */
- "i\0"
- "glDeleteObjectARB\0"
- "\0"
- /* _mesa_function_pool[14915]: GetShaderPrecisionFormat (will be remapped) */
- "iipp\0"
- "glGetShaderPrecisionFormat\0"
- "\0"
- /* _mesa_function_pool[14948]: MatrixIndexPointerARB (dynamic) */
- "iiip\0"
- "glMatrixIndexPointerARB\0"
- "\0"
- /* _mesa_function_pool[14978]: ProgramNamedParameter4dvNV (will be remapped) */
- "iipp\0"
- "glProgramNamedParameter4dvNV\0"
- "\0"
- /* _mesa_function_pool[15013]: Tangent3fvEXT (dynamic) */
- "p\0"
- "glTangent3fvEXT\0"
- "\0"
- /* _mesa_function_pool[15032]: Flush (offset 217) */
- "\0"
- "glFlush\0"
- "\0"
- /* _mesa_function_pool[15042]: Color4uiv (offset 38) */
- "p\0"
- "glColor4uiv\0"
- "\0"
- /* _mesa_function_pool[15057]: VertexAttribI4iEXT (will be remapped) */
- "iiiii\0"
- "glVertexAttribI4iEXT\0"
- "glVertexAttribI4i\0"
- "\0"
- /* _mesa_function_pool[15103]: GenVertexArrays (will be remapped) */
- "ip\0"
- "glGenVertexArrays\0"
- "\0"
- /* _mesa_function_pool[15125]: Uniform3uivEXT (will be remapped) */
- "iip\0"
- "glUniform3uivEXT\0"
- "glUniform3uiv\0"
- "\0"
- /* _mesa_function_pool[15161]: RasterPos3sv (offset 77) */
- "p\0"
- "glRasterPos3sv\0"
- "\0"
- /* _mesa_function_pool[15179]: BindFramebufferEXT (will be remapped) */
- "ii\0"
- "glBindFramebuffer\0"
- "glBindFramebufferEXT\0"
- "\0"
- /* _mesa_function_pool[15222]: ReferencePlaneSGIX (dynamic) */
- "p\0"
- "glReferencePlaneSGIX\0"
- "\0"
- /* _mesa_function_pool[15246]: PushAttrib (offset 219) */
- "i\0"
- "glPushAttrib\0"
- "\0"
- /* _mesa_function_pool[15262]: RasterPos2i (offset 66) */
- "ii\0"
- "glRasterPos2i\0"
- "\0"
- /* _mesa_function_pool[15280]: ValidateProgramARB (will be remapped) */
- "i\0"
- "glValidateProgram\0"
- "glValidateProgramARB\0"
- "\0"
- /* _mesa_function_pool[15322]: TexParameteriv (offset 181) */
- "iip\0"
- "glTexParameteriv\0"
- "\0"
- /* _mesa_function_pool[15344]: UnlockArraysEXT (will be remapped) */
- "\0"
- "glUnlockArraysEXT\0"
- "\0"
- /* _mesa_function_pool[15364]: TexCoord2fColor3fVertex3fSUN (dynamic) */
- "ffffffff\0"
- "glTexCoord2fColor3fVertex3fSUN\0"
- "\0"
- /* _mesa_function_pool[15405]: WindowPos3fvMESA (will be remapped) */
- "p\0"
- "glWindowPos3fv\0"
- "glWindowPos3fvARB\0"
- "glWindowPos3fvMESA\0"
- "\0"
- /* _mesa_function_pool[15460]: RasterPos2f (offset 64) */
- "ff\0"
- "glRasterPos2f\0"
- "\0"
- /* _mesa_function_pool[15478]: VertexAttrib1svNV (will be remapped) */
- "ip\0"
- "glVertexAttrib1svNV\0"
- "\0"
- /* _mesa_function_pool[15502]: RasterPos2d (offset 62) */
- "dd\0"
- "glRasterPos2d\0"
- "\0"
- /* _mesa_function_pool[15520]: RasterPos3fv (offset 73) */
- "p\0"
- "glRasterPos3fv\0"
- "\0"
- /* _mesa_function_pool[15538]: CopyTexSubImage3D (offset 373) */
- "iiiiiiiii\0"
- "glCopyTexSubImage3D\0"
- "glCopyTexSubImage3DEXT\0"
- "\0"
- /* _mesa_function_pool[15592]: VertexAttrib2dARB (will be remapped) */
- "idd\0"
- "glVertexAttrib2d\0"
- "glVertexAttrib2dARB\0"
- "\0"
- /* _mesa_function_pool[15634]: Color4ub (offset 35) */
- "iiii\0"
- "glColor4ub\0"
- "\0"
- /* _mesa_function_pool[15651]: GetInteger64v (will be remapped) */
- "ip\0"
- "glGetInteger64v\0"
- "\0"
- /* _mesa_function_pool[15671]: TextureColorMaskSGIS (dynamic) */
- "iiii\0"
- "glTextureColorMaskSGIS\0"
- "\0"
- /* _mesa_function_pool[15700]: RasterPos2s (offset 68) */
- "ii\0"
- "glRasterPos2s\0"
- "\0"
- /* _mesa_function_pool[15718]: GetColorTable (offset 343) */
- "iiip\0"
- "glGetColorTable\0"
- "glGetColorTableSGI\0"
- "glGetColorTableEXT\0"
- "\0"
- /* _mesa_function_pool[15778]: SelectBuffer (offset 195) */
- "ip\0"
- "glSelectBuffer\0"
- "\0"
- /* _mesa_function_pool[15797]: Indexiv (offset 49) */
- "p\0"
- "glIndexiv\0"
- "\0"
- /* _mesa_function_pool[15810]: TexCoord3i (offset 114) */
- "iii\0"
- "glTexCoord3i\0"
- "\0"
- /* _mesa_function_pool[15828]: CopyColorTable (offset 342) */
- "iiiii\0"
- "glCopyColorTable\0"
- "glCopyColorTableSGI\0"
- "\0"
- /* _mesa_function_pool[15872]: GetHistogramParameterfv (offset 362) */
- "iip\0"
- "glGetHistogramParameterfv\0"
- "glGetHistogramParameterfvEXT\0"
- "\0"
- /* _mesa_function_pool[15932]: Frustum (offset 289) */
- "dddddd\0"
- "glFrustum\0"
- "\0"
- /* _mesa_function_pool[15950]: GetString (offset 275) */
- "i\0"
- "glGetString\0"
- "\0"
- /* _mesa_function_pool[15965]: ColorPointervINTEL (dynamic) */
- "iip\0"
- "glColorPointervINTEL\0"
- "\0"
- /* _mesa_function_pool[15991]: TexEnvf (offset 184) */
- "iif\0"
- "glTexEnvf\0"
- "\0"
- /* _mesa_function_pool[16006]: TexCoord3d (offset 110) */
- "ddd\0"
- "glTexCoord3d\0"
- "\0"
- /* _mesa_function_pool[16024]: AlphaFragmentOp1ATI (will be remapped) */
- "iiiiii\0"
- "glAlphaFragmentOp1ATI\0"
- "\0"
- /* _mesa_function_pool[16054]: TexCoord3f (offset 112) */
- "fff\0"
- "glTexCoord3f\0"
- "\0"
- /* _mesa_function_pool[16072]: MultiTexCoord3ivARB (offset 397) */
- "ip\0"
- "glMultiTexCoord3iv\0"
- "glMultiTexCoord3ivARB\0"
- "\0"
- /* _mesa_function_pool[16117]: MultiTexCoord2sARB (offset 390) */
- "iii\0"
- "glMultiTexCoord2s\0"
- "glMultiTexCoord2sARB\0"
- "\0"
- /* _mesa_function_pool[16161]: VertexAttrib1dvARB (will be remapped) */
- "ip\0"
- "glVertexAttrib1dv\0"
- "glVertexAttrib1dvARB\0"
- "\0"
- /* _mesa_function_pool[16204]: GetnHistogramARB (will be remapped) */
- "iiiiip\0"
- "glGetnHistogramARB\0"
- "\0"
- /* _mesa_function_pool[16231]: DeleteTextures (offset 327) */
- "ip\0"
- "glDeleteTextures\0"
- "glDeleteTexturesEXT\0"
- "\0"
- /* _mesa_function_pool[16272]: TexCoordPointerEXT (will be remapped) */
- "iiiip\0"
- "glTexCoordPointerEXT\0"
- "\0"
- /* _mesa_function_pool[16300]: TexSubImage4DSGIS (dynamic) */
- "iiiiiiiiiiiip\0"
- "glTexSubImage4DSGIS\0"
- "\0"
- /* _mesa_function_pool[16335]: TexCoord3s (offset 116) */
- "iii\0"
- "glTexCoord3s\0"
- "\0"
- /* _mesa_function_pool[16353]: GetTexLevelParameteriv (offset 285) */
- "iiip\0"
- "glGetTexLevelParameteriv\0"
- "\0"
- /* _mesa_function_pool[16384]: CombinerStageParameterfvNV (dynamic) */
- "iip\0"
- "glCombinerStageParameterfvNV\0"
- "\0"
- /* _mesa_function_pool[16418]: StopInstrumentsSGIX (dynamic) */
- "i\0"
- "glStopInstrumentsSGIX\0"
- "\0"
- /* _mesa_function_pool[16443]: TexCoord4fColor4fNormal3fVertex4fSUN (dynamic) */
- "fffffffffffffff\0"
- "glTexCoord4fColor4fNormal3fVertex4fSUN\0"
- "\0"
- /* _mesa_function_pool[16499]: ClearAccum (offset 204) */
- "ffff\0"
- "glClearAccum\0"
- "\0"
- /* _mesa_function_pool[16518]: DeformSGIX (dynamic) */
- "i\0"
- "glDeformSGIX\0"
- "\0"
- /* _mesa_function_pool[16534]: GetVertexAttribfvARB (will be remapped) */
- "iip\0"
- "glGetVertexAttribfv\0"
- "glGetVertexAttribfvARB\0"
- "\0"
- /* _mesa_function_pool[16582]: SecondaryColor3ivEXT (will be remapped) */
- "p\0"
- "glSecondaryColor3iv\0"
- "glSecondaryColor3ivEXT\0"
- "\0"
- /* _mesa_function_pool[16628]: TexCoord4iv (offset 123) */
- "p\0"
- "glTexCoord4iv\0"
- "\0"
- /* _mesa_function_pool[16645]: VertexAttribI4uiEXT (will be remapped) */
- "iiiii\0"
- "glVertexAttribI4uiEXT\0"
- "glVertexAttribI4ui\0"
- "\0"
- /* _mesa_function_pool[16693]: GetFragmentMaterialfvSGIX (dynamic) */
- "iip\0"
- "glGetFragmentMaterialfvSGIX\0"
- "\0"
- /* _mesa_function_pool[16726]: UniformMatrix4x2fv (will be remapped) */
- "iiip\0"
- "glUniformMatrix4x2fv\0"
- "\0"
- /* _mesa_function_pool[16753]: GetDetailTexFuncSGIS (dynamic) */
- "ip\0"
- "glGetDetailTexFuncSGIS\0"
- "\0"
- /* _mesa_function_pool[16780]: GetCombinerStageParameterfvNV (dynamic) */
- "iip\0"
- "glGetCombinerStageParameterfvNV\0"
- "\0"
- /* _mesa_function_pool[16817]: SamplerParameterIiv (will be remapped) */
- "iip\0"
- "glSamplerParameterIiv\0"
- "\0"
- /* _mesa_function_pool[16844]: PolygonOffset (offset 319) */
- "ff\0"
- "glPolygonOffset\0"
- "\0"
- /* _mesa_function_pool[16864]: BindVertexArray (will be remapped) */
- "i\0"
- "glBindVertexArray\0"
- "\0"
- /* _mesa_function_pool[16885]: Color4ubVertex2fvSUN (dynamic) */
- "pp\0"
- "glColor4ubVertex2fvSUN\0"
- "\0"
- /* _mesa_function_pool[16912]: Rectd (offset 86) */
- "dddd\0"
- "glRectd\0"
- "\0"
- /* _mesa_function_pool[16926]: TexFilterFuncSGIS (dynamic) */
- "iiip\0"
- "glTexFilterFuncSGIS\0"
- "\0"
- /* _mesa_function_pool[16952]: TextureBarrierNV (will be remapped) */
- "\0"
- "glTextureBarrierNV\0"
- "\0"
- /* _mesa_function_pool[16973]: SamplerParameterfv (will be remapped) */
- "iip\0"
- "glSamplerParameterfv\0"
- "\0"
- /* _mesa_function_pool[16999]: ColorMaskIndexedEXT (will be remapped) */
- "iiiii\0"
- "glColorMaskIndexedEXT\0"
- "glColorMaski\0"
- "\0"
- /* _mesa_function_pool[17041]: GetAttribLocationARB (will be remapped) */
- "ip\0"
- "glGetAttribLocation\0"
- "glGetAttribLocationARB\0"
- "\0"
- /* _mesa_function_pool[17088]: RasterPos3i (offset 74) */
- "iii\0"
- "glRasterPos3i\0"
- "\0"
- /* _mesa_function_pool[17107]: VertexAttrib4ubvARB (will be remapped) */
- "ip\0"
- "glVertexAttrib4ubv\0"
- "glVertexAttrib4ubvARB\0"
- "\0"
- /* _mesa_function_pool[17152]: DetailTexFuncSGIS (dynamic) */
- "iip\0"
- "glDetailTexFuncSGIS\0"
- "\0"
- /* _mesa_function_pool[17177]: Normal3fVertex3fSUN (dynamic) */
- "ffffff\0"
- "glNormal3fVertex3fSUN\0"
- "\0"
- /* _mesa_function_pool[17207]: CopyTexImage2D (offset 324) */
- "iiiiiiii\0"
- "glCopyTexImage2D\0"
- "glCopyTexImage2DEXT\0"
- "\0"
- /* _mesa_function_pool[17254]: GetBufferPointervARB (will be remapped) */
- "iip\0"
- "glGetBufferPointerv\0"
- "glGetBufferPointervARB\0"
- "\0"
- /* _mesa_function_pool[17302]: ProgramEnvParameter4fARB (will be remapped) */
- "iiffff\0"
- "glProgramEnvParameter4fARB\0"
- "glProgramParameter4fNV\0"
- "\0"
- /* _mesa_function_pool[17360]: Uniform3ivARB (will be remapped) */
- "iip\0"
- "glUniform3iv\0"
- "glUniform3ivARB\0"
- "\0"
- /* _mesa_function_pool[17394]: Lightfv (offset 160) */
- "iip\0"
- "glLightfv\0"
- "\0"
- /* _mesa_function_pool[17409]: PrimitiveRestartIndexNV (will be remapped) */
- "i\0"
- "glPrimitiveRestartIndexNV\0"
- "glPrimitiveRestartIndex\0"
- "\0"
- /* _mesa_function_pool[17462]: ClearDepth (offset 208) */
- "d\0"
- "glClearDepth\0"
- "\0"
- /* _mesa_function_pool[17478]: GetFenceivNV (will be remapped) */
- "iip\0"
- "glGetFenceivNV\0"
- "\0"
- /* _mesa_function_pool[17498]: WindowPos4dvMESA (will be remapped) */
- "p\0"
- "glWindowPos4dvMESA\0"
- "\0"
- /* _mesa_function_pool[17520]: ColorSubTable (offset 346) */
- "iiiiip\0"
- "glColorSubTable\0"
- "glColorSubTableEXT\0"
- "\0"
- /* _mesa_function_pool[17563]: Color4fv (offset 30) */
- "p\0"
- "glColor4fv\0"
- "\0"
- /* _mesa_function_pool[17577]: MultiTexCoord4ivARB (offset 405) */
- "ip\0"
- "glMultiTexCoord4iv\0"
- "glMultiTexCoord4ivARB\0"
- "\0"
- /* _mesa_function_pool[17622]: GetnMinmaxARB (will be remapped) */
- "iiiiip\0"
- "glGetnMinmaxARB\0"
- "\0"
- /* _mesa_function_pool[17646]: ProgramLocalParameters4fvEXT (will be remapped) */
- "iiip\0"
- "glProgramLocalParameters4fvEXT\0"
- "\0"
- /* _mesa_function_pool[17683]: ColorPointer (offset 308) */
- "iiip\0"
- "glColorPointer\0"
- "\0"
- /* _mesa_function_pool[17704]: Rects (offset 92) */
- "iiii\0"
- "glRects\0"
- "\0"
- /* _mesa_function_pool[17718]: GetMapAttribParameterfvNV (dynamic) */
- "iiip\0"
- "glGetMapAttribParameterfvNV\0"
- "\0"
- /* _mesa_function_pool[17752]: CreateShaderProgramEXT (will be remapped) */
- "ip\0"
- "glCreateShaderProgramEXT\0"
- "\0"
- /* _mesa_function_pool[17781]: ActiveProgramEXT (will be remapped) */
- "i\0"
- "glActiveProgramEXT\0"
- "\0"
- /* _mesa_function_pool[17803]: Lightiv (offset 162) */
- "iip\0"
- "glLightiv\0"
- "\0"
- /* _mesa_function_pool[17818]: VertexAttrib4sARB (will be remapped) */
- "iiiii\0"
- "glVertexAttrib4s\0"
- "glVertexAttrib4sARB\0"
- "\0"
- /* _mesa_function_pool[17862]: GetQueryObjectuivARB (will be remapped) */
- "iip\0"
- "glGetQueryObjectuiv\0"
- "glGetQueryObjectuivARB\0"
- "\0"
- /* _mesa_function_pool[17910]: GetTexParameteriv (offset 283) */
- "iip\0"
- "glGetTexParameteriv\0"
- "\0"
- /* _mesa_function_pool[17935]: MapParameterivNV (dynamic) */
- "iip\0"
- "glMapParameterivNV\0"
- "\0"
- /* _mesa_function_pool[17959]: GenRenderbuffersEXT (will be remapped) */
- "ip\0"
- "glGenRenderbuffers\0"
- "glGenRenderbuffersEXT\0"
- "\0"
- /* _mesa_function_pool[18004]: ClearBufferfv (will be remapped) */
- "iip\0"
- "glClearBufferfv\0"
- "\0"
- /* _mesa_function_pool[18025]: VertexAttrib2dvARB (will be remapped) */
- "ip\0"
- "glVertexAttrib2dv\0"
- "glVertexAttrib2dvARB\0"
- "\0"
- /* _mesa_function_pool[18068]: EdgeFlagPointerEXT (will be remapped) */
- "iip\0"
- "glEdgeFlagPointerEXT\0"
- "\0"
- /* _mesa_function_pool[18094]: VertexAttribs2svNV (will be remapped) */
- "iip\0"
- "glVertexAttribs2svNV\0"
- "\0"
- /* _mesa_function_pool[18120]: WeightbvARB (dynamic) */
- "ip\0"
- "glWeightbvARB\0"
- "\0"
- /* _mesa_function_pool[18138]: VertexAttrib2fvARB (will be remapped) */
- "ip\0"
- "glVertexAttrib2fv\0"
- "glVertexAttrib2fvARB\0"
- "\0"
- /* _mesa_function_pool[18181]: GetBufferParameterivARB (will be remapped) */
- "iip\0"
- "glGetBufferParameteriv\0"
- "glGetBufferParameterivARB\0"
- "\0"
- /* _mesa_function_pool[18235]: Rectdv (offset 87) */
- "pp\0"
- "glRectdv\0"
- "\0"
- /* _mesa_function_pool[18248]: ListParameteriSGIX (dynamic) */
- "iii\0"
- "glListParameteriSGIX\0"
- "\0"
- /* _mesa_function_pool[18274]: BlendEquationiARB (will be remapped) */
- "ii\0"
- "glBlendEquationiARB\0"
- "glBlendEquationIndexedAMD\0"
- "\0"
- /* _mesa_function_pool[18324]: ReplacementCodeuiColor4fNormal3fVertex3fSUN (dynamic) */
- "iffffffffff\0"
- "glReplacementCodeuiColor4fNormal3fVertex3fSUN\0"
- "\0"
- /* _mesa_function_pool[18383]: InstrumentsBufferSGIX (dynamic) */
- "ip\0"
- "glInstrumentsBufferSGIX\0"
- "\0"
- /* _mesa_function_pool[18411]: VertexAttrib4NivARB (will be remapped) */
- "ip\0"
- "glVertexAttrib4Niv\0"
- "glVertexAttrib4NivARB\0"
- "\0"
- /* _mesa_function_pool[18456]: DrawArraysInstancedARB (will be remapped) */
- "iiii\0"
- "glDrawArraysInstancedARB\0"
- "glDrawArraysInstancedEXT\0"
- "glDrawArraysInstanced\0"
- "\0"
- /* _mesa_function_pool[18534]: GetAttachedShaders (will be remapped) */
- "iipp\0"
- "glGetAttachedShaders\0"
- "\0"
- /* _mesa_function_pool[18561]: GenVertexArraysAPPLE (will be remapped) */
- "ip\0"
- "glGenVertexArraysAPPLE\0"
- "\0"
- /* _mesa_function_pool[18588]: ClearBufferfi (will be remapped) */
- "iifi\0"
- "glClearBufferfi\0"
- "\0"
- /* _mesa_function_pool[18610]: Materialiv (offset 172) */
- "iip\0"
- "glMaterialiv\0"
- "\0"
- /* _mesa_function_pool[18628]: PushClientAttrib (offset 335) */
- "i\0"
- "glPushClientAttrib\0"
- "\0"
- /* _mesa_function_pool[18650]: SamplerParameteriv (will be remapped) */
- "iip\0"
- "glSamplerParameteriv\0"
- "\0"
- /* _mesa_function_pool[18676]: TexCoord2fColor4fNormal3fVertex3fvSUN (dynamic) */
- "pppp\0"
- "glTexCoord2fColor4fNormal3fVertex3fvSUN\0"
- "\0"
- /* _mesa_function_pool[18722]: WindowPos2iMESA (will be remapped) */
- "ii\0"
- "glWindowPos2i\0"
- "glWindowPos2iARB\0"
- "glWindowPos2iMESA\0"
- "\0"
- /* _mesa_function_pool[18775]: SampleMaskSGIS (will be remapped) */
- "fi\0"
- "glSampleMaskSGIS\0"
- "glSampleMaskEXT\0"
- "\0"
- /* _mesa_function_pool[18812]: SecondaryColor3fvEXT (will be remapped) */
- "p\0"
- "glSecondaryColor3fv\0"
- "glSecondaryColor3fvEXT\0"
- "\0"
- /* _mesa_function_pool[18858]: PolygonMode (offset 174) */
- "ii\0"
- "glPolygonMode\0"
- "\0"
- /* _mesa_function_pool[18876]: CompressedTexSubImage1DARB (will be remapped) */
- "iiiiiip\0"
- "glCompressedTexSubImage1D\0"
- "glCompressedTexSubImage1DARB\0"
- "\0"
- /* _mesa_function_pool[18940]: VertexAttribI1iEXT (will be remapped) */
- "ii\0"
- "glVertexAttribI1iEXT\0"
- "glVertexAttribI1i\0"
- "\0"
- /* _mesa_function_pool[18983]: TexCoord2fNormal3fVertex3fSUN (dynamic) */
- "ffffffff\0"
- "glTexCoord2fNormal3fVertex3fSUN\0"
- "\0"
- /* _mesa_function_pool[19025]: GetVertexAttribivNV (will be remapped) */
- "iip\0"
- "glGetVertexAttribivNV\0"
- "\0"
- /* _mesa_function_pool[19052]: GetProgramStringARB (will be remapped) */
- "iip\0"
- "glGetProgramStringARB\0"
- "\0"
- /* _mesa_function_pool[19079]: GetnUniformdvARB (will be remapped) */
- "iiip\0"
- "glGetnUniformdvARB\0"
- "\0"
- /* _mesa_function_pool[19104]: VertexAttribIPointerEXT (will be remapped) */
- "iiiip\0"
- "glVertexAttribIPointerEXT\0"
- "glVertexAttribIPointer\0"
- "\0"
- /* _mesa_function_pool[19160]: TexBumpParameterfvATI (will be remapped) */
- "ip\0"
- "glTexBumpParameterfvATI\0"
- "\0"
- /* _mesa_function_pool[19188]: Tangent3ivEXT (dynamic) */
- "p\0"
- "glTangent3ivEXT\0"
- "\0"
- /* _mesa_function_pool[19207]: CompileShaderARB (will be remapped) */
- "i\0"
- "glCompileShader\0"
- "glCompileShaderARB\0"
- "\0"
- /* _mesa_function_pool[19245]: DeleteShader (will be remapped) */
- "i\0"
- "glDeleteShader\0"
- "\0"
- /* _mesa_function_pool[19263]: DisableClientState (offset 309) */
- "i\0"
- "glDisableClientState\0"
- "\0"
- /* _mesa_function_pool[19287]: TexGeni (offset 192) */
- "iii\0"
- "glTexGeni\0"
- "\0"
- /* _mesa_function_pool[19302]: TexGenf (offset 190) */
- "iif\0"
- "glTexGenf\0"
- "\0"
- /* _mesa_function_pool[19317]: Uniform3fARB (will be remapped) */
- "ifff\0"
- "glUniform3f\0"
- "glUniform3fARB\0"
- "\0"
- /* _mesa_function_pool[19350]: TexGend (offset 188) */
- "iid\0"
- "glTexGend\0"
- "\0"
- /* _mesa_function_pool[19365]: ListParameterfvSGIX (dynamic) */
- "iip\0"
- "glListParameterfvSGIX\0"
- "\0"
- /* _mesa_function_pool[19392]: GetPolygonStipple (offset 274) */
- "p\0"
- "glGetPolygonStipple\0"
- "\0"
- /* _mesa_function_pool[19415]: Tangent3dvEXT (dynamic) */
- "p\0"
- "glTangent3dvEXT\0"
- "\0"
- /* _mesa_function_pool[19434]: BindBufferOffsetEXT (will be remapped) */
- "iiii\0"
- "glBindBufferOffsetEXT\0"
- "\0"
- /* _mesa_function_pool[19462]: WindowPos3sMESA (will be remapped) */
- "iii\0"
- "glWindowPos3s\0"
- "glWindowPos3sARB\0"
- "glWindowPos3sMESA\0"
- "\0"
- /* _mesa_function_pool[19516]: VertexAttrib2svNV (will be remapped) */
- "ip\0"
- "glVertexAttrib2svNV\0"
- "\0"
- /* _mesa_function_pool[19540]: DisableIndexedEXT (will be remapped) */
- "ii\0"
- "glDisableIndexedEXT\0"
- "glDisablei\0"
- "\0"
- /* _mesa_function_pool[19575]: BindBufferBaseEXT (will be remapped) */
- "iii\0"
- "glBindBufferBaseEXT\0"
- "glBindBufferBase\0"
- "\0"
- /* _mesa_function_pool[19617]: TexCoord2fVertex3fvSUN (dynamic) */
- "pp\0"
- "glTexCoord2fVertex3fvSUN\0"
- "\0"
- /* _mesa_function_pool[19646]: WindowPos4sMESA (will be remapped) */
- "iiii\0"
- "glWindowPos4sMESA\0"
- "\0"
- /* _mesa_function_pool[19670]: GetnPixelMapuivARB (will be remapped) */
- "iip\0"
- "glGetnPixelMapuivARB\0"
- "\0"
- /* _mesa_function_pool[19696]: VertexAttrib4NuivARB (will be remapped) */
- "ip\0"
- "glVertexAttrib4Nuiv\0"
- "glVertexAttrib4NuivARB\0"
- "\0"
- /* _mesa_function_pool[19743]: ClientActiveTextureARB (offset 375) */
- "i\0"
- "glClientActiveTexture\0"
- "glClientActiveTextureARB\0"
- "\0"
- /* _mesa_function_pool[19793]: GetSamplerParameterIuiv (will be remapped) */
- "iip\0"
- "glGetSamplerParameterIuiv\0"
- "\0"
- /* _mesa_function_pool[19824]: ReplacementCodeusvSUN (dynamic) */
- "p\0"
- "glReplacementCodeusvSUN\0"
- "\0"
- /* _mesa_function_pool[19851]: Uniform4fARB (will be remapped) */
- "iffff\0"
- "glUniform4f\0"
- "glUniform4fARB\0"
- "\0"
- /* _mesa_function_pool[19885]: Color4sv (offset 34) */
- "p\0"
- "glColor4sv\0"
- "\0"
- /* _mesa_function_pool[19899]: FlushMappedBufferRange (will be remapped) */
- "iii\0"
- "glFlushMappedBufferRange\0"
- "\0"
- /* _mesa_function_pool[19929]: IsProgramNV (will be remapped) */
- "i\0"
- "glIsProgramARB\0"
- "glIsProgramNV\0"
- "\0"
- /* _mesa_function_pool[19961]: FlushMappedBufferRangeAPPLE (will be remapped) */
- "iii\0"
- "glFlushMappedBufferRangeAPPLE\0"
- "\0"
- /* _mesa_function_pool[19996]: PixelZoom (offset 246) */
- "ff\0"
- "glPixelZoom\0"
- "\0"
- /* _mesa_function_pool[20012]: ReplacementCodePointerSUN (dynamic) */
- "iip\0"
- "glReplacementCodePointerSUN\0"
- "\0"
- /* _mesa_function_pool[20045]: ProgramEnvParameter4dARB (will be remapped) */
- "iidddd\0"
- "glProgramEnvParameter4dARB\0"
- "glProgramParameter4dNV\0"
- "\0"
- /* _mesa_function_pool[20103]: ColorTableParameterfv (offset 340) */
- "iip\0"
- "glColorTableParameterfv\0"
- "glColorTableParameterfvSGI\0"
- "\0"
- /* _mesa_function_pool[20159]: FragmentLightModelfSGIX (dynamic) */
- "if\0"
- "glFragmentLightModelfSGIX\0"
- "\0"
- /* _mesa_function_pool[20189]: Binormal3bvEXT (dynamic) */
- "p\0"
- "glBinormal3bvEXT\0"
- "\0"
- /* _mesa_function_pool[20209]: PixelMapuiv (offset 252) */
- "iip\0"
- "glPixelMapuiv\0"
- "\0"
- /* _mesa_function_pool[20228]: Color3dv (offset 12) */
- "p\0"
- "glColor3dv\0"
- "\0"
- /* _mesa_function_pool[20242]: IsTexture (offset 330) */
- "i\0"
- "glIsTexture\0"
- "glIsTextureEXT\0"
- "\0"
- /* _mesa_function_pool[20272]: GenSamplers (will be remapped) */
- "ip\0"
- "glGenSamplers\0"
- "\0"
- /* _mesa_function_pool[20290]: VertexWeightfvEXT (dynamic) */
- "p\0"
- "glVertexWeightfvEXT\0"
- "\0"
- /* _mesa_function_pool[20313]: VertexAttrib1dARB (will be remapped) */
- "id\0"
- "glVertexAttrib1d\0"
- "glVertexAttrib1dARB\0"
- "\0"
- /* _mesa_function_pool[20354]: ImageTransformParameterivHP (dynamic) */
- "iip\0"
- "glImageTransformParameterivHP\0"
- "\0"
- /* _mesa_function_pool[20389]: TexCoord4i (offset 122) */
- "iiii\0"
- "glTexCoord4i\0"
- "\0"
- /* _mesa_function_pool[20408]: DeleteQueriesARB (will be remapped) */
- "ip\0"
- "glDeleteQueries\0"
- "glDeleteQueriesARB\0"
- "\0"
- /* _mesa_function_pool[20447]: Color4ubVertex2fSUN (dynamic) */
- "iiiiff\0"
- "glColor4ubVertex2fSUN\0"
- "\0"
- /* _mesa_function_pool[20477]: FragmentColorMaterialSGIX (dynamic) */
- "ii\0"
- "glFragmentColorMaterialSGIX\0"
- "\0"
- /* _mesa_function_pool[20509]: CurrentPaletteMatrixARB (dynamic) */
- "i\0"
- "glCurrentPaletteMatrixARB\0"
- "\0"
- /* _mesa_function_pool[20538]: GetMapdv (offset 266) */
- "iip\0"
- "glGetMapdv\0"
- "\0"
- /* _mesa_function_pool[20554]: ObjectPurgeableAPPLE (will be remapped) */
- "iii\0"
- "glObjectPurgeableAPPLE\0"
- "\0"
- /* _mesa_function_pool[20582]: GetStringi (will be remapped) */
- "ii\0"
- "glGetStringi\0"
- "\0"
- /* _mesa_function_pool[20599]: SamplePatternSGIS (will be remapped) */
- "i\0"
- "glSamplePatternSGIS\0"
- "glSamplePatternEXT\0"
- "\0"
- /* _mesa_function_pool[20641]: PixelStoref (offset 249) */
- "if\0"
- "glPixelStoref\0"
- "\0"
- /* _mesa_function_pool[20659]: IsQueryARB (will be remapped) */
- "i\0"
- "glIsQuery\0"
- "glIsQueryARB\0"
- "\0"
- /* _mesa_function_pool[20685]: ReplacementCodeuiColor4ubVertex3fSUN (dynamic) */
- "iiiiifff\0"
- "glReplacementCodeuiColor4ubVertex3fSUN\0"
- "\0"
- /* _mesa_function_pool[20734]: PixelStorei (offset 250) */
- "ii\0"
- "glPixelStorei\0"
- "\0"
- /* _mesa_function_pool[20752]: VertexAttrib4usvARB (will be remapped) */
- "ip\0"
- "glVertexAttrib4usv\0"
- "glVertexAttrib4usvARB\0"
- "\0"
- /* _mesa_function_pool[20797]: LinkProgramARB (will be remapped) */
- "i\0"
- "glLinkProgram\0"
- "glLinkProgramARB\0"
- "\0"
- /* _mesa_function_pool[20831]: VertexAttrib2fNV (will be remapped) */
- "iff\0"
- "glVertexAttrib2fNV\0"
- "\0"
- /* _mesa_function_pool[20855]: ShaderSourceARB (will be remapped) */
- "iipp\0"
- "glShaderSource\0"
- "glShaderSourceARB\0"
- "\0"
- /* _mesa_function_pool[20894]: FragmentMaterialiSGIX (dynamic) */
- "iii\0"
- "glFragmentMaterialiSGIX\0"
- "\0"
- /* _mesa_function_pool[20923]: EvalCoord2dv (offset 233) */
- "p\0"
- "glEvalCoord2dv\0"
- "\0"
- /* _mesa_function_pool[20941]: VertexAttrib3svARB (will be remapped) */
- "ip\0"
- "glVertexAttrib3sv\0"
- "glVertexAttrib3svARB\0"
- "\0"
- /* _mesa_function_pool[20984]: ColorMaterial (offset 151) */
- "ii\0"
- "glColorMaterial\0"
- "\0"
- /* _mesa_function_pool[21004]: CompressedTexSubImage3DARB (will be remapped) */
- "iiiiiiiiiip\0"
- "glCompressedTexSubImage3D\0"
- "glCompressedTexSubImage3DARB\0"
- "\0"
- /* _mesa_function_pool[21072]: WindowPos2ivMESA (will be remapped) */
- "p\0"
- "glWindowPos2iv\0"
- "glWindowPos2ivARB\0"
- "glWindowPos2ivMESA\0"
- "\0"
- /* _mesa_function_pool[21127]: IsFramebufferEXT (will be remapped) */
- "i\0"
- "glIsFramebuffer\0"
- "glIsFramebufferEXT\0"
- "\0"
- /* _mesa_function_pool[21165]: Uniform4ivARB (will be remapped) */
- "iip\0"
- "glUniform4iv\0"
- "glUniform4ivARB\0"
- "\0"
- /* _mesa_function_pool[21199]: GetVertexAttribdvARB (will be remapped) */
- "iip\0"
- "glGetVertexAttribdv\0"
- "glGetVertexAttribdvARB\0"
- "\0"
- /* _mesa_function_pool[21247]: TexBumpParameterivATI (will be remapped) */
- "ip\0"
- "glTexBumpParameterivATI\0"
- "\0"
- /* _mesa_function_pool[21275]: GetSeparableFilter (offset 359) */
- "iiippp\0"
- "glGetSeparableFilter\0"
- "glGetSeparableFilterEXT\0"
- "\0"
- /* _mesa_function_pool[21328]: Binormal3dEXT (dynamic) */
- "ddd\0"
- "glBinormal3dEXT\0"
- "\0"
- /* _mesa_function_pool[21349]: SpriteParameteriSGIX (dynamic) */
- "ii\0"
- "glSpriteParameteriSGIX\0"
- "\0"
- /* _mesa_function_pool[21376]: RequestResidentProgramsNV (will be remapped) */
- "ip\0"
- "glRequestResidentProgramsNV\0"
- "\0"
- /* _mesa_function_pool[21408]: TagSampleBufferSGIX (dynamic) */
- "\0"
- "glTagSampleBufferSGIX\0"
- "\0"
- /* _mesa_function_pool[21432]: TransformFeedbackVaryingsEXT (will be remapped) */
- "iipi\0"
- "glTransformFeedbackVaryingsEXT\0"
- "glTransformFeedbackVaryings\0"
- "\0"
- /* _mesa_function_pool[21497]: FeedbackBuffer (offset 194) */
- "iip\0"
- "glFeedbackBuffer\0"
- "\0"
- /* _mesa_function_pool[21519]: RasterPos2iv (offset 67) */
- "p\0"
- "glRasterPos2iv\0"
- "\0"
- /* _mesa_function_pool[21537]: TexImage1D (offset 182) */
- "iiiiiiip\0"
- "glTexImage1D\0"
- "\0"
- /* _mesa_function_pool[21560]: ListParameterivSGIX (dynamic) */
- "iip\0"
- "glListParameterivSGIX\0"
- "\0"
- /* _mesa_function_pool[21587]: MultiDrawElementsEXT (will be remapped) */
- "ipipi\0"
- "glMultiDrawElements\0"
- "glMultiDrawElementsEXT\0"
- "\0"
- /* _mesa_function_pool[21637]: Color3s (offset 17) */
- "iii\0"
- "glColor3s\0"
- "\0"
- /* _mesa_function_pool[21652]: Uniform1ivARB (will be remapped) */
- "iip\0"
- "glUniform1iv\0"
- "glUniform1ivARB\0"
- "\0"
- /* _mesa_function_pool[21686]: WindowPos2sMESA (will be remapped) */
- "ii\0"
- "glWindowPos2s\0"
- "glWindowPos2sARB\0"
- "glWindowPos2sMESA\0"
- "\0"
- /* _mesa_function_pool[21739]: WeightusvARB (dynamic) */
- "ip\0"
- "glWeightusvARB\0"
- "\0"
- /* _mesa_function_pool[21758]: TexCoordPointer (offset 320) */
- "iiip\0"
- "glTexCoordPointer\0"
- "\0"
- /* _mesa_function_pool[21782]: FogCoordPointerEXT (will be remapped) */
- "iip\0"
- "glFogCoordPointer\0"
- "glFogCoordPointerEXT\0"
- "\0"
- /* _mesa_function_pool[21826]: GetnSeparableFilterARB (will be remapped) */
- "iiiipipp\0"
- "glGetnSeparableFilterARB\0"
- "\0"
- /* _mesa_function_pool[21861]: IndexMaterialEXT (dynamic) */
- "ii\0"
- "glIndexMaterialEXT\0"
- "\0"
- /* _mesa_function_pool[21884]: Color3i (offset 15) */
- "iii\0"
- "glColor3i\0"
- "\0"
- /* _mesa_function_pool[21899]: FrontFace (offset 157) */
- "i\0"
- "glFrontFace\0"
- "\0"
- /* _mesa_function_pool[21914]: EvalCoord2d (offset 232) */
- "dd\0"
- "glEvalCoord2d\0"
- "\0"
- /* _mesa_function_pool[21932]: SecondaryColor3ubvEXT (will be remapped) */
- "p\0"
- "glSecondaryColor3ubv\0"
- "glSecondaryColor3ubvEXT\0"
- "\0"
- /* _mesa_function_pool[21980]: EvalCoord2f (offset 234) */
- "ff\0"
- "glEvalCoord2f\0"
- "\0"
- /* _mesa_function_pool[21998]: VertexAttrib4dvARB (will be remapped) */
- "ip\0"
- "glVertexAttrib4dv\0"
- "glVertexAttrib4dvARB\0"
- "\0"
- /* _mesa_function_pool[22041]: BindAttribLocationARB (will be remapped) */
- "iip\0"
- "glBindAttribLocation\0"
- "glBindAttribLocationARB\0"
- "\0"
- /* _mesa_function_pool[22091]: Color3b (offset 9) */
- "iii\0"
- "glColor3b\0"
- "\0"
- /* _mesa_function_pool[22106]: MultiTexCoord2dARB (offset 384) */
- "idd\0"
- "glMultiTexCoord2d\0"
- "glMultiTexCoord2dARB\0"
- "\0"
- /* _mesa_function_pool[22150]: ExecuteProgramNV (will be remapped) */
- "iip\0"
- "glExecuteProgramNV\0"
- "\0"
- /* _mesa_function_pool[22174]: Color3f (offset 13) */
- "fff\0"
- "glColor3f\0"
- "\0"
- /* _mesa_function_pool[22189]: LightEnviSGIX (dynamic) */
- "ii\0"
- "glLightEnviSGIX\0"
- "\0"
- /* _mesa_function_pool[22209]: Color3d (offset 11) */
- "ddd\0"
- "glColor3d\0"
- "\0"
- /* _mesa_function_pool[22224]: Normal3dv (offset 55) */
- "p\0"
- "glNormal3dv\0"
- "\0"
- /* _mesa_function_pool[22239]: Lightf (offset 159) */
- "iif\0"
- "glLightf\0"
- "\0"
- /* _mesa_function_pool[22253]: ReplacementCodeuiSUN (dynamic) */
- "i\0"
- "glReplacementCodeuiSUN\0"
- "\0"
- /* _mesa_function_pool[22279]: MatrixMode (offset 293) */
- "i\0"
- "glMatrixMode\0"
- "\0"
- /* _mesa_function_pool[22295]: GetPixelMapusv (offset 273) */
- "ip\0"
- "glGetPixelMapusv\0"
- "\0"
- /* _mesa_function_pool[22316]: Lighti (offset 161) */
- "iii\0"
- "glLighti\0"
- "\0"
- /* _mesa_function_pool[22330]: VertexAttribPointerNV (will be remapped) */
- "iiiip\0"
- "glVertexAttribPointerNV\0"
- "\0"
- /* _mesa_function_pool[22361]: ClearDepthf (will be remapped) */
- "f\0"
- "glClearDepthf\0"
- "\0"
- /* _mesa_function_pool[22378]: GetBooleanIndexedvEXT (will be remapped) */
- "iip\0"
- "glGetBooleanIndexedvEXT\0"
- "glGetBooleani_v\0"
- "\0"
- /* _mesa_function_pool[22423]: GetFramebufferAttachmentParameterivEXT (will be remapped) */
- "iiip\0"
- "glGetFramebufferAttachmentParameteriv\0"
- "glGetFramebufferAttachmentParameterivEXT\0"
- "\0"
- /* _mesa_function_pool[22508]: PixelTransformParameterfEXT (dynamic) */
- "iif\0"
- "glPixelTransformParameterfEXT\0"
- "\0"
- /* _mesa_function_pool[22543]: MultiTexCoord4dvARB (offset 401) */
- "ip\0"
- "glMultiTexCoord4dv\0"
- "glMultiTexCoord4dvARB\0"
- "\0"
- /* _mesa_function_pool[22588]: PixelTransformParameteriEXT (dynamic) */
- "iii\0"
- "glPixelTransformParameteriEXT\0"
- "\0"
- /* _mesa_function_pool[22623]: GetDoublev (offset 260) */
- "ip\0"
- "glGetDoublev\0"
- "\0"
- /* _mesa_function_pool[22640]: MultMatrixd (offset 295) */
- "p\0"
- "glMultMatrixd\0"
- "\0"
- /* _mesa_function_pool[22657]: MultMatrixf (offset 294) */
- "p\0"
- "glMultMatrixf\0"
- "\0"
- /* _mesa_function_pool[22674]: VertexAttribI4bvEXT (will be remapped) */
- "ip\0"
- "glVertexAttribI4bvEXT\0"
- "glVertexAttribI4bv\0"
- "\0"
- /* _mesa_function_pool[22719]: TexCoord2fColor4ubVertex3fSUN (dynamic) */
- "ffiiiifff\0"
- "glTexCoord2fColor4ubVertex3fSUN\0"
- "\0"
- /* _mesa_function_pool[22762]: Uniform1iARB (will be remapped) */
- "ii\0"
- "glUniform1i\0"
- "glUniform1iARB\0"
- "\0"
- /* _mesa_function_pool[22793]: GetnMapfvARB (will be remapped) */
- "iiip\0"
- "glGetnMapfvARB\0"
- "\0"
- /* _mesa_function_pool[22814]: VertexAttribPointerARB (will be remapped) */
- "iiiiip\0"
- "glVertexAttribPointer\0"
- "glVertexAttribPointerARB\0"
- "\0"
- /* _mesa_function_pool[22869]: VertexAttrib3sNV (will be remapped) */
- "iiii\0"
- "glVertexAttrib3sNV\0"
- "\0"
- /* _mesa_function_pool[22894]: SharpenTexFuncSGIS (dynamic) */
- "iip\0"
- "glSharpenTexFuncSGIS\0"
- "\0"
- /* _mesa_function_pool[22920]: MultiTexCoord4fvARB (offset 403) */
- "ip\0"
- "glMultiTexCoord4fv\0"
- "glMultiTexCoord4fvARB\0"
- "\0"
- /* _mesa_function_pool[22965]: Uniform2uiEXT (will be remapped) */
- "iii\0"
- "glUniform2uiEXT\0"
- "glUniform2ui\0"
- "\0"
- /* _mesa_function_pool[22999]: UniformMatrix2x3fv (will be remapped) */
- "iiip\0"
- "glUniformMatrix2x3fv\0"
- "\0"
- /* _mesa_function_pool[23026]: SamplerParameteri (will be remapped) */
- "iii\0"
- "glSamplerParameteri\0"
- "\0"
- /* _mesa_function_pool[23051]: SamplerParameterf (will be remapped) */
- "iif\0"
- "glSamplerParameterf\0"
- "\0"
- /* _mesa_function_pool[23076]: CombinerParameteriNV (will be remapped) */
- "ii\0"
- "glCombinerParameteriNV\0"
- "\0"
- /* _mesa_function_pool[23103]: DeleteAsyncMarkersSGIX (dynamic) */
- "ii\0"
- "glDeleteAsyncMarkersSGIX\0"
- "\0"
- /* _mesa_function_pool[23132]: ReplacementCodeusSUN (dynamic) */
- "i\0"
- "glReplacementCodeusSUN\0"
- "\0"
- /* _mesa_function_pool[23158]: IsAsyncMarkerSGIX (dynamic) */
- "i\0"
- "glIsAsyncMarkerSGIX\0"
- "\0"
- /* _mesa_function_pool[23181]: FrameZoomSGIX (dynamic) */
- "i\0"
- "glFrameZoomSGIX\0"
- "\0"
- /* _mesa_function_pool[23200]: Normal3fVertex3fvSUN (dynamic) */
- "pp\0"
- "glNormal3fVertex3fvSUN\0"
- "\0"
- /* _mesa_function_pool[23227]: GetnUniformuivARB (will be remapped) */
- "iiip\0"
- "glGetnUniformuivARB\0"
- "\0"
- /* _mesa_function_pool[23253]: RasterPos4sv (offset 85) */
- "p\0"
- "glRasterPos4sv\0"
- "\0"
- /* _mesa_function_pool[23271]: VertexAttrib4NsvARB (will be remapped) */
- "ip\0"
- "glVertexAttrib4Nsv\0"
- "glVertexAttrib4NsvARB\0"
- "\0"
- /* _mesa_function_pool[23316]: VertexAttrib3fvARB (will be remapped) */
- "ip\0"
- "glVertexAttrib3fv\0"
- "glVertexAttrib3fvARB\0"
- "\0"
- /* _mesa_function_pool[23359]: ClearColor (offset 206) */
- "ffff\0"
- "glClearColor\0"
- "\0"
- /* _mesa_function_pool[23378]: GetSynciv (will be remapped) */
- "iiipp\0"
- "glGetSynciv\0"
- "\0"
- /* _mesa_function_pool[23397]: ClearColorIiEXT (will be remapped) */
- "iiii\0"
- "glClearColorIiEXT\0"
- "\0"
- /* _mesa_function_pool[23421]: DeleteFramebuffersEXT (will be remapped) */
- "ip\0"
- "glDeleteFramebuffers\0"
- "glDeleteFramebuffersEXT\0"
- "\0"
- /* _mesa_function_pool[23470]: GlobalAlphaFactorsSUN (dynamic) */
- "i\0"
- "glGlobalAlphaFactorsSUN\0"
- "\0"
- /* _mesa_function_pool[23497]: IsEnabledIndexedEXT (will be remapped) */
- "ii\0"
- "glIsEnabledIndexedEXT\0"
- "glIsEnabledi\0"
- "\0"
- /* _mesa_function_pool[23536]: TexEnviv (offset 187) */
- "iip\0"
- "glTexEnviv\0"
- "\0"
- /* _mesa_function_pool[23552]: TexSubImage3D (offset 372) */
- "iiiiiiiiiip\0"
- "glTexSubImage3D\0"
- "glTexSubImage3DEXT\0"
- "\0"
- /* _mesa_function_pool[23600]: Tangent3fEXT (dynamic) */
- "fff\0"
- "glTangent3fEXT\0"
- "\0"
- /* _mesa_function_pool[23620]: SecondaryColor3uivEXT (will be remapped) */
- "p\0"
- "glSecondaryColor3uiv\0"
- "glSecondaryColor3uivEXT\0"
- "\0"
- /* _mesa_function_pool[23668]: MatrixIndexubvARB (dynamic) */
- "ip\0"
- "glMatrixIndexubvARB\0"
- "\0"
- /* _mesa_function_pool[23692]: Color4fNormal3fVertex3fSUN (dynamic) */
- "ffffffffff\0"
- "glColor4fNormal3fVertex3fSUN\0"
- "\0"
- /* _mesa_function_pool[23733]: PixelTexGenParameterfSGIS (will be remapped) */
- "if\0"
- "glPixelTexGenParameterfSGIS\0"
- "\0"
- /* _mesa_function_pool[23765]: CreateShader (will be remapped) */
- "i\0"
- "glCreateShader\0"
- "\0"
- /* _mesa_function_pool[23783]: GetColorTableParameterfv (offset 344) */
- "iip\0"
- "glGetColorTableParameterfv\0"
- "glGetColorTableParameterfvSGI\0"
- "glGetColorTableParameterfvEXT\0"
- "\0"
- /* _mesa_function_pool[23875]: FragmentLightModelfvSGIX (dynamic) */
- "ip\0"
- "glFragmentLightModelfvSGIX\0"
- "\0"
- /* _mesa_function_pool[23906]: Bitmap (offset 8) */
- "iiffffp\0"
- "glBitmap\0"
- "\0"
- /* _mesa_function_pool[23924]: MultiTexCoord3fARB (offset 394) */
- "ifff\0"
- "glMultiTexCoord3f\0"
- "glMultiTexCoord3fARB\0"
- "\0"
- /* _mesa_function_pool[23969]: GetTexLevelParameterfv (offset 284) */
- "iiip\0"
- "glGetTexLevelParameterfv\0"
- "\0"
- /* _mesa_function_pool[24000]: GetPixelTexGenParameterfvSGIS (will be remapped) */
- "ip\0"
- "glGetPixelTexGenParameterfvSGIS\0"
- "\0"
- /* _mesa_function_pool[24036]: GenFramebuffersEXT (will be remapped) */
- "ip\0"
- "glGenFramebuffers\0"
- "glGenFramebuffersEXT\0"
- "\0"
- /* _mesa_function_pool[24079]: VertexAttribDivisor (will be remapped) */
- "ii\0"
- "glVertexAttribDivisor\0"
- "\0"
- /* _mesa_function_pool[24105]: GetProgramParameterdvNV (will be remapped) */
- "iiip\0"
- "glGetProgramParameterdvNV\0"
- "\0"
- /* _mesa_function_pool[24137]: Vertex2sv (offset 133) */
- "p\0"
- "glVertex2sv\0"
- "\0"
- /* _mesa_function_pool[24152]: GetIntegerv (offset 263) */
- "ip\0"
- "glGetIntegerv\0"
- "\0"
- /* _mesa_function_pool[24170]: IsVertexArrayAPPLE (will be remapped) */
- "i\0"
- "glIsVertexArray\0"
- "glIsVertexArrayAPPLE\0"
- "\0"
- /* _mesa_function_pool[24210]: FragmentLightfvSGIX (dynamic) */
- "iip\0"
- "glFragmentLightfvSGIX\0"
- "\0"
- /* _mesa_function_pool[24237]: GetnMapdvARB (will be remapped) */
- "iiip\0"
- "glGetnMapdvARB\0"
- "\0"
- /* _mesa_function_pool[24258]: DetachShader (will be remapped) */
- "ii\0"
- "glDetachShader\0"
- "\0"
- /* _mesa_function_pool[24277]: VertexAttrib4NubARB (will be remapped) */
- "iiiii\0"
- "glVertexAttrib4Nub\0"
- "glVertexAttrib4NubARB\0"
- "\0"
- /* _mesa_function_pool[24325]: GetProgramEnvParameterfvARB (will be remapped) */
- "iip\0"
- "glGetProgramEnvParameterfvARB\0"
- "\0"
- /* _mesa_function_pool[24360]: GetTrackMatrixivNV (will be remapped) */
- "iiip\0"
- "glGetTrackMatrixivNV\0"
- "\0"
- /* _mesa_function_pool[24387]: VertexAttrib3svNV (will be remapped) */
- "ip\0"
- "glVertexAttrib3svNV\0"
- "\0"
- /* _mesa_function_pool[24411]: Uniform4fvARB (will be remapped) */
- "iip\0"
- "glUniform4fv\0"
- "glUniform4fvARB\0"
- "\0"
- /* _mesa_function_pool[24445]: MultTransposeMatrixfARB (will be remapped) */
- "p\0"
- "glMultTransposeMatrixf\0"
- "glMultTransposeMatrixfARB\0"
- "\0"
- /* _mesa_function_pool[24497]: GetTexEnviv (offset 277) */
- "iip\0"
- "glGetTexEnviv\0"
- "\0"
- /* _mesa_function_pool[24516]: ColorFragmentOp1ATI (will be remapped) */
- "iiiiiii\0"
- "glColorFragmentOp1ATI\0"
- "\0"
- /* _mesa_function_pool[24547]: GetUniformfvARB (will be remapped) */
- "iip\0"
- "glGetUniformfv\0"
- "glGetUniformfvARB\0"
- "\0"
- /* _mesa_function_pool[24585]: EGLImageTargetRenderbufferStorageOES (will be remapped) */
- "ip\0"
- "glEGLImageTargetRenderbufferStorageOES\0"
- "\0"
- /* _mesa_function_pool[24628]: VertexAttribI2ivEXT (will be remapped) */
- "ip\0"
- "glVertexAttribI2ivEXT\0"
- "glVertexAttribI2iv\0"
- "\0"
- /* _mesa_function_pool[24673]: PopClientAttrib (offset 334) */
- "\0"
- "glPopClientAttrib\0"
- "\0"
- /* _mesa_function_pool[24693]: ReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN (dynamic) */
- "iffffffffffff\0"
- "glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN\0"
- "\0"
- /* _mesa_function_pool[24764]: DetachObjectARB (will be remapped) */
- "ii\0"
- "glDetachObjectARB\0"
- "\0"
- /* _mesa_function_pool[24786]: VertexBlendARB (dynamic) */
- "i\0"
- "glVertexBlendARB\0"
- "\0"
- /* _mesa_function_pool[24806]: WindowPos3iMESA (will be remapped) */
- "iii\0"
- "glWindowPos3i\0"
- "glWindowPos3iARB\0"
- "glWindowPos3iMESA\0"
- "\0"
- /* _mesa_function_pool[24860]: SeparableFilter2D (offset 360) */
- "iiiiiipp\0"
- "glSeparableFilter2D\0"
- "glSeparableFilter2DEXT\0"
- "\0"
- /* _mesa_function_pool[24913]: ProgramParameteriARB (will be remapped) */
- "iii\0"
- "glProgramParameteriARB\0"
- "\0"
- /* _mesa_function_pool[24941]: Map1d (offset 220) */
- "iddiip\0"
- "glMap1d\0"
- "\0"
- /* _mesa_function_pool[24957]: Map1f (offset 221) */
- "iffiip\0"
- "glMap1f\0"
- "\0"
- /* _mesa_function_pool[24973]: CompressedTexImage2DARB (will be remapped) */
- "iiiiiiip\0"
- "glCompressedTexImage2D\0"
- "glCompressedTexImage2DARB\0"
- "\0"
- /* _mesa_function_pool[25032]: ArrayElement (offset 306) */
- "i\0"
- "glArrayElement\0"
- "glArrayElementEXT\0"
- "\0"
- /* _mesa_function_pool[25068]: TexImage2D (offset 183) */
- "iiiiiiiip\0"
- "glTexImage2D\0"
- "\0"
- /* _mesa_function_pool[25092]: DepthBoundsEXT (will be remapped) */
- "dd\0"
- "glDepthBoundsEXT\0"
- "\0"
- /* _mesa_function_pool[25113]: ProgramParameters4fvNV (will be remapped) */
- "iiip\0"
- "glProgramParameters4fvNV\0"
- "\0"
- /* _mesa_function_pool[25144]: DeformationMap3fSGIX (dynamic) */
- "iffiiffiiffiip\0"
- "glDeformationMap3fSGIX\0"
- "\0"
- /* _mesa_function_pool[25183]: GetProgramivNV (will be remapped) */
- "iip\0"
- "glGetProgramivNV\0"
- "\0"
- /* _mesa_function_pool[25205]: GetFragDataLocationEXT (will be remapped) */
- "ip\0"
- "glGetFragDataLocationEXT\0"
- "glGetFragDataLocation\0"
- "\0"
- /* _mesa_function_pool[25256]: GetMinmaxParameteriv (offset 366) */
- "iip\0"
- "glGetMinmaxParameteriv\0"
- "glGetMinmaxParameterivEXT\0"
- "\0"
- /* _mesa_function_pool[25310]: PixelTransferf (offset 247) */
- "if\0"
- "glPixelTransferf\0"
- "\0"
- /* _mesa_function_pool[25331]: CopyTexImage1D (offset 323) */
- "iiiiiii\0"
- "glCopyTexImage1D\0"
- "glCopyTexImage1DEXT\0"
- "\0"
- /* _mesa_function_pool[25377]: PushMatrix (offset 298) */
- "\0"
- "glPushMatrix\0"
- "\0"
- /* _mesa_function_pool[25392]: Fogiv (offset 156) */
- "ip\0"
- "glFogiv\0"
- "\0"
- /* _mesa_function_pool[25404]: TexCoord1dv (offset 95) */
- "p\0"
- "glTexCoord1dv\0"
- "\0"
- /* _mesa_function_pool[25421]: AlphaFragmentOp3ATI (will be remapped) */
- "iiiiiiiiiiii\0"
- "glAlphaFragmentOp3ATI\0"
- "\0"
- /* _mesa_function_pool[25457]: PixelTransferi (offset 248) */
- "ii\0"
- "glPixelTransferi\0"
- "\0"
- /* _mesa_function_pool[25478]: GetnColorTableARB (will be remapped) */
- "iiiip\0"
- "glGetnColorTableARB\0"
- "\0"
- /* _mesa_function_pool[25505]: VertexAttrib3fvNV (will be remapped) */
- "ip\0"
- "glVertexAttrib3fvNV\0"
- "\0"
- /* _mesa_function_pool[25529]: Rotatef (offset 300) */
- "ffff\0"
- "glRotatef\0"
- "\0"
- /* _mesa_function_pool[25545]: GetFinalCombinerInputParameterivNV (will be remapped) */
- "iip\0"
- "glGetFinalCombinerInputParameterivNV\0"
- "\0"
- /* _mesa_function_pool[25587]: Vertex3i (offset 138) */
- "iii\0"
- "glVertex3i\0"
- "\0"
- /* _mesa_function_pool[25603]: Vertex3f (offset 136) */
- "fff\0"
- "glVertex3f\0"
- "\0"
- /* _mesa_function_pool[25619]: Clear (offset 203) */
- "i\0"
- "glClear\0"
- "\0"
- /* _mesa_function_pool[25630]: Vertex3d (offset 134) */
- "ddd\0"
- "glVertex3d\0"
- "\0"
- /* _mesa_function_pool[25646]: GetMapParameterivNV (dynamic) */
- "iip\0"
- "glGetMapParameterivNV\0"
- "\0"
- /* _mesa_function_pool[25673]: Uniform4iARB (will be remapped) */
- "iiiii\0"
- "glUniform4i\0"
- "glUniform4iARB\0"
- "\0"
- /* _mesa_function_pool[25707]: ReadBuffer (offset 254) */
- "i\0"
- "glReadBuffer\0"
- "\0"
- /* _mesa_function_pool[25723]: ConvolutionParameteri (offset 352) */
- "iii\0"
- "glConvolutionParameteri\0"
- "glConvolutionParameteriEXT\0"
- "\0"
- /* _mesa_function_pool[25779]: Ortho (offset 296) */
- "dddddd\0"
- "glOrtho\0"
- "\0"
- /* _mesa_function_pool[25795]: Binormal3sEXT (dynamic) */
- "iii\0"
- "glBinormal3sEXT\0"
- "\0"
- /* _mesa_function_pool[25816]: ListBase (offset 6) */
- "i\0"
- "glListBase\0"
- "\0"
- /* _mesa_function_pool[25830]: VertexAttribI3ivEXT (will be remapped) */
- "ip\0"
- "glVertexAttribI3ivEXT\0"
- "glVertexAttribI3iv\0"
- "\0"
- /* _mesa_function_pool[25875]: Vertex3s (offset 140) */
- "iii\0"
- "glVertex3s\0"
- "\0"
- /* _mesa_function_pool[25891]: ConvolutionParameterf (offset 350) */
- "iif\0"
- "glConvolutionParameterf\0"
- "glConvolutionParameterfEXT\0"
- "\0"
- /* _mesa_function_pool[25947]: GetColorTableParameteriv (offset 345) */
- "iip\0"
- "glGetColorTableParameteriv\0"
- "glGetColorTableParameterivSGI\0"
- "glGetColorTableParameterivEXT\0"
- "\0"
- /* _mesa_function_pool[26039]: ProgramEnvParameter4dvARB (will be remapped) */
- "iip\0"
- "glProgramEnvParameter4dvARB\0"
- "glProgramParameter4dvNV\0"
- "\0"
- /* _mesa_function_pool[26096]: ShadeModel (offset 177) */
- "i\0"
- "glShadeModel\0"
- "\0"
- /* _mesa_function_pool[26112]: VertexAttribs2fvNV (will be remapped) */
- "iip\0"
- "glVertexAttribs2fvNV\0"
- "\0"
- /* _mesa_function_pool[26138]: Rectiv (offset 91) */
- "pp\0"
- "glRectiv\0"
- "\0"
- /* _mesa_function_pool[26151]: UseProgramObjectARB (will be remapped) */
- "i\0"
- "glUseProgram\0"
- "glUseProgramObjectARB\0"
- "\0"
- /* _mesa_function_pool[26189]: GetMapParameterfvNV (dynamic) */
- "iip\0"
- "glGetMapParameterfvNV\0"
- "\0"
- /* _mesa_function_pool[26216]: EndConditionalRenderNV (will be remapped) */
- "\0"
- "glEndConditionalRenderNV\0"
- "glEndConditionalRender\0"
- "\0"
- /* _mesa_function_pool[26266]: PassTexCoordATI (will be remapped) */
- "iii\0"
- "glPassTexCoordATI\0"
- "\0"
- /* _mesa_function_pool[26289]: DeleteProgram (will be remapped) */
- "i\0"
- "glDeleteProgram\0"
- "\0"
- /* _mesa_function_pool[26308]: GetSamplerParameteriv (will be remapped) */
- "iip\0"
- "glGetSamplerParameteriv\0"
- "\0"
- /* _mesa_function_pool[26337]: Tangent3dEXT (dynamic) */
- "ddd\0"
- "glTangent3dEXT\0"
- "\0"
- /* _mesa_function_pool[26357]: SecondaryColor3dvEXT (will be remapped) */
- "p\0"
- "glSecondaryColor3dv\0"
- "glSecondaryColor3dvEXT\0"
- "\0"
- /* _mesa_function_pool[26403]: AlphaFragmentOp2ATI (will be remapped) */
- "iiiiiiiii\0"
- "glAlphaFragmentOp2ATI\0"
- "\0"
- /* _mesa_function_pool[26436]: Vertex2fv (offset 129) */
- "p\0"
- "glVertex2fv\0"
- "\0"
- /* _mesa_function_pool[26451]: MultiDrawArraysEXT (will be remapped) */
- "ippi\0"
- "glMultiDrawArrays\0"
- "glMultiDrawArraysEXT\0"
- "\0"
- /* _mesa_function_pool[26496]: BindRenderbufferEXT (will be remapped) */
- "ii\0"
- "glBindRenderbuffer\0"
- "glBindRenderbufferEXT\0"
- "\0"
- /* _mesa_function_pool[26541]: MultiTexCoord4dARB (offset 400) */
- "idddd\0"
- "glMultiTexCoord4d\0"
- "glMultiTexCoord4dARB\0"
- "\0"
- /* _mesa_function_pool[26587]: FramebufferTextureFaceARB (will be remapped) */
- "iiiii\0"
- "glFramebufferTextureFaceARB\0"
- "\0"
- /* _mesa_function_pool[26622]: Vertex3sv (offset 141) */
- "p\0"
- "glVertex3sv\0"
- "\0"
- /* _mesa_function_pool[26637]: SecondaryColor3usEXT (will be remapped) */
- "iii\0"
- "glSecondaryColor3us\0"
- "glSecondaryColor3usEXT\0"
- "\0"
- /* _mesa_function_pool[26685]: ProgramLocalParameter4fvARB (will be remapped) */
- "iip\0"
- "glProgramLocalParameter4fvARB\0"
- "\0"
- /* _mesa_function_pool[26720]: DeleteProgramsNV (will be remapped) */
- "ip\0"
- "glDeleteProgramsARB\0"
- "glDeleteProgramsNV\0"
- "\0"
- /* _mesa_function_pool[26763]: EvalMesh1 (offset 236) */
- "iii\0"
- "glEvalMesh1\0"
- "\0"
- /* _mesa_function_pool[26780]: PauseTransformFeedback (will be remapped) */
- "\0"
- "glPauseTransformFeedback\0"
- "\0"
- /* _mesa_function_pool[26807]: MultiTexCoord1sARB (offset 382) */
- "ii\0"
- "glMultiTexCoord1s\0"
- "glMultiTexCoord1sARB\0"
- "\0"
- /* _mesa_function_pool[26850]: ReplacementCodeuiColor3fVertex3fSUN (dynamic) */
- "iffffff\0"
- "glReplacementCodeuiColor3fVertex3fSUN\0"
- "\0"
- /* _mesa_function_pool[26897]: GetVertexAttribPointervNV (will be remapped) */
- "iip\0"
- "glGetVertexAttribPointerv\0"
- "glGetVertexAttribPointervARB\0"
- "glGetVertexAttribPointervNV\0"
- "\0"
- /* _mesa_function_pool[26985]: VertexAttribs1fvNV (will be remapped) */
- "iip\0"
- "glVertexAttribs1fvNV\0"
- "\0"
- /* _mesa_function_pool[27011]: MultiTexCoord1dvARB (offset 377) */
- "ip\0"
- "glMultiTexCoord1dv\0"
- "glMultiTexCoord1dvARB\0"
- "\0"
- /* _mesa_function_pool[27056]: Uniform2iARB (will be remapped) */
- "iii\0"
- "glUniform2i\0"
- "glUniform2iARB\0"
- "\0"
- /* _mesa_function_pool[27088]: Vertex2iv (offset 131) */
- "p\0"
- "glVertex2iv\0"
- "\0"
- /* _mesa_function_pool[27103]: GetProgramStringNV (will be remapped) */
- "iip\0"
- "glGetProgramStringNV\0"
- "\0"
- /* _mesa_function_pool[27129]: ColorPointerEXT (will be remapped) */
- "iiiip\0"
- "glColorPointerEXT\0"
- "\0"
- /* _mesa_function_pool[27154]: LineWidth (offset 168) */
- "f\0"
- "glLineWidth\0"
- "\0"
- /* _mesa_function_pool[27169]: MapBufferARB (will be remapped) */
- "ii\0"
- "glMapBuffer\0"
- "glMapBufferARB\0"
- "\0"
- /* _mesa_function_pool[27200]: MultiDrawElementsBaseVertex (will be remapped) */
- "ipipip\0"
- "glMultiDrawElementsBaseVertex\0"
- "\0"
- /* _mesa_function_pool[27238]: TexParameterIuivEXT (will be remapped) */
- "iip\0"
- "glTexParameterIuivEXT\0"
- "glTexParameterIuiv\0"
- "\0"
- /* _mesa_function_pool[27284]: Binormal3svEXT (dynamic) */
- "p\0"
- "glBinormal3svEXT\0"
- "\0"
- /* _mesa_function_pool[27304]: ApplyTextureEXT (dynamic) */
- "i\0"
- "glApplyTextureEXT\0"
- "\0"
- /* _mesa_function_pool[27325]: GetBufferParameteri64v (will be remapped) */
- "iip\0"
- "glGetBufferParameteri64v\0"
- "\0"
- /* _mesa_function_pool[27355]: TexGendv (offset 189) */
- "iip\0"
- "glTexGendv\0"
- "\0"
- /* _mesa_function_pool[27371]: VertexAttribI3iEXT (will be remapped) */
- "iiii\0"
- "glVertexAttribI3iEXT\0"
- "glVertexAttribI3i\0"
- "\0"
- /* _mesa_function_pool[27416]: EnableIndexedEXT (will be remapped) */
- "ii\0"
- "glEnableIndexedEXT\0"
- "glEnablei\0"
- "\0"
- /* _mesa_function_pool[27449]: TextureMaterialEXT (dynamic) */
- "ii\0"
- "glTextureMaterialEXT\0"
- "\0"
- /* _mesa_function_pool[27474]: TextureLightEXT (dynamic) */
- "i\0"
- "glTextureLightEXT\0"
- "\0"
- /* _mesa_function_pool[27495]: ResetMinmax (offset 370) */
- "i\0"
- "glResetMinmax\0"
- "glResetMinmaxEXT\0"
- "\0"
- /* _mesa_function_pool[27529]: SpriteParameterfSGIX (dynamic) */
- "if\0"
- "glSpriteParameterfSGIX\0"
- "\0"
- /* _mesa_function_pool[27556]: EnableClientState (offset 313) */
- "i\0"
- "glEnableClientState\0"
- "\0"
- /* _mesa_function_pool[27579]: VertexAttrib4sNV (will be remapped) */
- "iiiii\0"
- "glVertexAttrib4sNV\0"
- "\0"
- /* _mesa_function_pool[27605]: GetConvolutionParameterfv (offset 357) */
- "iip\0"
- "glGetConvolutionParameterfv\0"
- "glGetConvolutionParameterfvEXT\0"
- "\0"
- /* _mesa_function_pool[27669]: VertexAttribs4dvNV (will be remapped) */
- "iip\0"
- "glVertexAttribs4dvNV\0"
- "\0"
- /* _mesa_function_pool[27695]: MultiModeDrawArraysIBM (will be remapped) */
- "pppii\0"
- "glMultiModeDrawArraysIBM\0"
- "\0"
- /* _mesa_function_pool[27727]: VertexAttrib4dARB (will be remapped) */
- "idddd\0"
- "glVertexAttrib4d\0"
- "glVertexAttrib4dARB\0"
- "\0"
- /* _mesa_function_pool[27771]: GetTexBumpParameterfvATI (will be remapped) */
- "ip\0"
- "glGetTexBumpParameterfvATI\0"
- "\0"
- /* _mesa_function_pool[27802]: ProgramNamedParameter4dNV (will be remapped) */
- "iipdddd\0"
- "glProgramNamedParameter4dNV\0"
- "\0"
- /* _mesa_function_pool[27839]: GetMaterialfv (offset 269) */
- "iip\0"
- "glGetMaterialfv\0"
- "\0"
- /* _mesa_function_pool[27860]: VertexWeightfEXT (dynamic) */
- "f\0"
- "glVertexWeightfEXT\0"
- "\0"
- /* _mesa_function_pool[27882]: SetFragmentShaderConstantATI (will be remapped) */
- "ip\0"
- "glSetFragmentShaderConstantATI\0"
- "\0"
- /* _mesa_function_pool[27917]: Binormal3fEXT (dynamic) */
- "fff\0"
- "glBinormal3fEXT\0"
- "\0"
- /* _mesa_function_pool[27938]: CallList (offset 2) */
- "i\0"
- "glCallList\0"
- "\0"
- /* _mesa_function_pool[27952]: Materialfv (offset 170) */
- "iip\0"
- "glMaterialfv\0"
- "\0"
- /* _mesa_function_pool[27970]: TexCoord3fv (offset 113) */
- "p\0"
- "glTexCoord3fv\0"
- "\0"
- /* _mesa_function_pool[27987]: FogCoordfvEXT (will be remapped) */
- "p\0"
- "glFogCoordfv\0"
- "glFogCoordfvEXT\0"
- "\0"
- /* _mesa_function_pool[28019]: MultiTexCoord1ivARB (offset 381) */
- "ip\0"
- "glMultiTexCoord1iv\0"
- "glMultiTexCoord1ivARB\0"
- "\0"
- /* _mesa_function_pool[28064]: SecondaryColor3ubEXT (will be remapped) */
- "iii\0"
- "glSecondaryColor3ub\0"
- "glSecondaryColor3ubEXT\0"
- "\0"
- /* _mesa_function_pool[28112]: MultiTexCoord2ivARB (offset 389) */
- "ip\0"
- "glMultiTexCoord2iv\0"
- "glMultiTexCoord2ivARB\0"
- "\0"
- /* _mesa_function_pool[28157]: FogFuncSGIS (dynamic) */
- "ip\0"
- "glFogFuncSGIS\0"
- "\0"
- /* _mesa_function_pool[28175]: CopyTexSubImage2D (offset 326) */
- "iiiiiiii\0"
- "glCopyTexSubImage2D\0"
- "glCopyTexSubImage2DEXT\0"
- "\0"
- /* _mesa_function_pool[28228]: GetObjectParameterivARB (will be remapped) */
- "iip\0"
- "glGetObjectParameterivARB\0"
- "\0"
- /* _mesa_function_pool[28259]: Color3iv (offset 16) */
- "p\0"
- "glColor3iv\0"
- "\0"
- /* _mesa_function_pool[28273]: TexCoord4fVertex4fSUN (dynamic) */
- "ffffffff\0"
- "glTexCoord4fVertex4fSUN\0"
- "\0"
- /* _mesa_function_pool[28307]: DrawElements (offset 311) */
- "iiip\0"
- "glDrawElements\0"
- "\0"
- /* _mesa_function_pool[28328]: BindVertexArrayAPPLE (will be remapped) */
- "i\0"
- "glBindVertexArrayAPPLE\0"
- "\0"
- /* _mesa_function_pool[28354]: GetProgramLocalParameterdvARB (will be remapped) */
- "iip\0"
- "glGetProgramLocalParameterdvARB\0"
- "\0"
- /* _mesa_function_pool[28391]: GetHistogramParameteriv (offset 363) */
- "iip\0"
- "glGetHistogramParameteriv\0"
- "glGetHistogramParameterivEXT\0"
- "\0"
- /* _mesa_function_pool[28451]: MultiTexCoord1iARB (offset 380) */
- "ii\0"
- "glMultiTexCoord1i\0"
- "glMultiTexCoord1iARB\0"
- "\0"
- /* _mesa_function_pool[28494]: GetConvolutionFilter (offset 356) */
- "iiip\0"
- "glGetConvolutionFilter\0"
- "glGetConvolutionFilterEXT\0"
- "\0"
- /* _mesa_function_pool[28549]: GetProgramivARB (will be remapped) */
- "iip\0"
- "glGetProgramivARB\0"
- "\0"
- /* _mesa_function_pool[28572]: TexBufferARB (will be remapped) */
- "iii\0"
- "glTexBufferARB\0"
- "\0"
- /* _mesa_function_pool[28592]: BlendFuncSeparateEXT (will be remapped) */
- "iiii\0"
- "glBlendFuncSeparate\0"
- "glBlendFuncSeparateEXT\0"
- "glBlendFuncSeparateINGR\0"
- "\0"
- /* _mesa_function_pool[28665]: MapBufferRange (will be remapped) */
- "iiii\0"
- "glMapBufferRange\0"
- "\0"
- /* _mesa_function_pool[28688]: ProgramParameters4dvNV (will be remapped) */
- "iiip\0"
- "glProgramParameters4dvNV\0"
- "\0"
- /* _mesa_function_pool[28719]: TexCoord2fColor3fVertex3fvSUN (dynamic) */
- "ppp\0"
- "glTexCoord2fColor3fVertex3fvSUN\0"
- "\0"
- /* _mesa_function_pool[28756]: EvalPoint2 (offset 239) */
- "ii\0"
- "glEvalPoint2\0"
- "\0"
- /* _mesa_function_pool[28773]: Uniform1uivEXT (will be remapped) */
- "iip\0"
- "glUniform1uivEXT\0"
- "glUniform1uiv\0"
- "\0"
- /* _mesa_function_pool[28809]: EvalPoint1 (offset 237) */
- "i\0"
- "glEvalPoint1\0"
- "\0"
- /* _mesa_function_pool[28825]: Binormal3dvEXT (dynamic) */
- "p\0"
- "glBinormal3dvEXT\0"
- "\0"
- /* _mesa_function_pool[28845]: PopMatrix (offset 297) */
- "\0"
- "glPopMatrix\0"
- "\0"
- /* _mesa_function_pool[28859]: GetVertexAttribIuivEXT (will be remapped) */
- "iip\0"
- "glGetVertexAttribIuivEXT\0"
- "glGetVertexAttribIuiv\0"
- "\0"
- /* _mesa_function_pool[28911]: FinishFenceNV (will be remapped) */
- "i\0"
- "glFinishFenceNV\0"
- "\0"
- /* _mesa_function_pool[28930]: GetFogFuncSGIS (dynamic) */
- "p\0"
- "glGetFogFuncSGIS\0"
- "\0"
- /* _mesa_function_pool[28950]: GetUniformLocationARB (will be remapped) */
- "ip\0"
- "glGetUniformLocation\0"
- "glGetUniformLocationARB\0"
- "\0"
- /* _mesa_function_pool[28999]: SecondaryColor3fEXT (will be remapped) */
- "fff\0"
- "glSecondaryColor3f\0"
- "glSecondaryColor3fEXT\0"
- "\0"
- /* _mesa_function_pool[29045]: GetTexGeniv (offset 280) */
- "iip\0"
- "glGetTexGeniv\0"
- "\0"
- /* _mesa_function_pool[29064]: CombinerInputNV (will be remapped) */
- "iiiiii\0"
- "glCombinerInputNV\0"
- "\0"
- /* _mesa_function_pool[29090]: VertexAttrib3sARB (will be remapped) */
- "iiii\0"
- "glVertexAttrib3s\0"
- "glVertexAttrib3sARB\0"
- "\0"
- /* _mesa_function_pool[29133]: IsTransformFeedback (will be remapped) */
- "i\0"
- "glIsTransformFeedback\0"
- "\0"
- /* _mesa_function_pool[29158]: ReplacementCodeuiNormal3fVertex3fvSUN (dynamic) */
- "ppp\0"
- "glReplacementCodeuiNormal3fVertex3fvSUN\0"
- "\0"
- /* _mesa_function_pool[29203]: Map2d (offset 222) */
- "iddiiddiip\0"
- "glMap2d\0"
- "\0"
- /* _mesa_function_pool[29223]: Map2f (offset 223) */
- "iffiiffiip\0"
- "glMap2f\0"
- "\0"
- /* _mesa_function_pool[29243]: ProgramStringARB (will be remapped) */
- "iiip\0"
- "glProgramStringARB\0"
- "\0"
- /* _mesa_function_pool[29268]: Vertex4s (offset 148) */
- "iiii\0"
- "glVertex4s\0"
- "\0"
- /* _mesa_function_pool[29285]: TexCoord4fVertex4fvSUN (dynamic) */
- "pp\0"
- "glTexCoord4fVertex4fvSUN\0"
- "\0"
- /* _mesa_function_pool[29314]: FragmentLightModelivSGIX (dynamic) */
- "ip\0"
- "glFragmentLightModelivSGIX\0"
- "\0"
- /* _mesa_function_pool[29345]: VertexAttrib1fNV (will be remapped) */
- "if\0"
- "glVertexAttrib1fNV\0"
- "\0"
- /* _mesa_function_pool[29368]: Vertex4f (offset 144) */
- "ffff\0"
- "glVertex4f\0"
- "\0"
- /* _mesa_function_pool[29385]: EvalCoord1d (offset 228) */
- "d\0"
- "glEvalCoord1d\0"
- "\0"
- /* _mesa_function_pool[29402]: Vertex4d (offset 142) */
- "dddd\0"
- "glVertex4d\0"
- "\0"
- /* _mesa_function_pool[29419]: RasterPos4dv (offset 79) */
- "p\0"
- "glRasterPos4dv\0"
- "\0"
- /* _mesa_function_pool[29437]: UseShaderProgramEXT (will be remapped) */
- "ii\0"
- "glUseShaderProgramEXT\0"
- "\0"
- /* _mesa_function_pool[29463]: FragmentLightfSGIX (dynamic) */
- "iif\0"
- "glFragmentLightfSGIX\0"
- "\0"
- /* _mesa_function_pool[29489]: GetCompressedTexImageARB (will be remapped) */
- "iip\0"
- "glGetCompressedTexImage\0"
- "glGetCompressedTexImageARB\0"
- "\0"
- /* _mesa_function_pool[29545]: GetTexGenfv (offset 279) */
- "iip\0"
- "glGetTexGenfv\0"
- "\0"
- /* _mesa_function_pool[29564]: Vertex4i (offset 146) */
- "iiii\0"
- "glVertex4i\0"
- "\0"
- /* _mesa_function_pool[29581]: VertexWeightPointerEXT (dynamic) */
- "iiip\0"
- "glVertexWeightPointerEXT\0"
- "\0"
- /* _mesa_function_pool[29612]: GetHistogram (offset 361) */
- "iiiip\0"
- "glGetHistogram\0"
- "glGetHistogramEXT\0"
- "\0"
- /* _mesa_function_pool[29652]: ActiveStencilFaceEXT (will be remapped) */
- "i\0"
- "glActiveStencilFaceEXT\0"
- "\0"
- /* _mesa_function_pool[29678]: StencilFuncSeparateATI (will be remapped) */
- "iiii\0"
- "glStencilFuncSeparateATI\0"
- "\0"
- /* _mesa_function_pool[29709]: Materialf (offset 169) */
- "iif\0"
- "glMaterialf\0"
- "\0"
- /* _mesa_function_pool[29726]: GetShaderSourceARB (will be remapped) */
- "iipp\0"
- "glGetShaderSource\0"
- "glGetShaderSourceARB\0"
- "\0"
- /* _mesa_function_pool[29771]: IglooInterfaceSGIX (dynamic) */
- "ip\0"
- "glIglooInterfaceSGIX\0"
- "\0"
- /* _mesa_function_pool[29796]: Materiali (offset 171) */
- "iii\0"
- "glMateriali\0"
- "\0"
- /* _mesa_function_pool[29813]: VertexAttrib4dNV (will be remapped) */
- "idddd\0"
- "glVertexAttrib4dNV\0"
- "\0"
- /* _mesa_function_pool[29839]: MultiModeDrawElementsIBM (will be remapped) */
- "ppipii\0"
- "glMultiModeDrawElementsIBM\0"
- "\0"
- /* _mesa_function_pool[29874]: Indexsv (offset 51) */
- "p\0"
- "glIndexsv\0"
- "\0"
- /* _mesa_function_pool[29887]: MultiTexCoord4svARB (offset 407) */
- "ip\0"
- "glMultiTexCoord4sv\0"
- "glMultiTexCoord4svARB\0"
- "\0"
- /* _mesa_function_pool[29932]: LightModelfv (offset 164) */
- "ip\0"
- "glLightModelfv\0"
- "\0"
- /* _mesa_function_pool[29951]: TexCoord2dv (offset 103) */
- "p\0"
- "glTexCoord2dv\0"
- "\0"
- /* _mesa_function_pool[29968]: GenQueriesARB (will be remapped) */
- "ip\0"
- "glGenQueries\0"
- "glGenQueriesARB\0"
- "\0"
- /* _mesa_function_pool[30001]: EvalCoord1dv (offset 229) */
- "p\0"
- "glEvalCoord1dv\0"
- "\0"
- /* _mesa_function_pool[30019]: ReplacementCodeuiVertex3fSUN (dynamic) */
- "ifff\0"
- "glReplacementCodeuiVertex3fSUN\0"
- "\0"
- /* _mesa_function_pool[30056]: Translated (offset 303) */
- "ddd\0"
- "glTranslated\0"
- "\0"
- /* _mesa_function_pool[30074]: Translatef (offset 304) */
- "fff\0"
- "glTranslatef\0"
- "\0"
- /* _mesa_function_pool[30092]: Uniform3uiEXT (will be remapped) */
- "iiii\0"
- "glUniform3uiEXT\0"
- "glUniform3ui\0"
- "\0"
- /* _mesa_function_pool[30127]: StencilMask (offset 209) */
- "i\0"
- "glStencilMask\0"
- "\0"
- /* _mesa_function_pool[30144]: Tangent3iEXT (dynamic) */
- "iii\0"
- "glTangent3iEXT\0"
- "\0"
- /* _mesa_function_pool[30164]: ClampColorARB (will be remapped) */
- "ii\0"
- "glClampColorARB\0"
- "\0"
- /* _mesa_function_pool[30184]: GetLightiv (offset 265) */
- "iip\0"
- "glGetLightiv\0"
- "\0"
- /* _mesa_function_pool[30202]: GetSamplerParameterIiv (will be remapped) */
- "iip\0"
- "glGetSamplerParameterIiv\0"
- "\0"
- /* _mesa_function_pool[30232]: DrawMeshArraysSUN (dynamic) */
- "iiii\0"
- "glDrawMeshArraysSUN\0"
- "\0"
- /* _mesa_function_pool[30258]: IsList (offset 287) */
- "i\0"
- "glIsList\0"
- "\0"
- /* _mesa_function_pool[30270]: IsSync (will be remapped) */
- "i\0"
- "glIsSync\0"
- "\0"
- /* _mesa_function_pool[30282]: RenderMode (offset 196) */
- "i\0"
- "glRenderMode\0"
- "\0"
- /* _mesa_function_pool[30298]: GetMapControlPointsNV (dynamic) */
- "iiiiiip\0"
- "glGetMapControlPointsNV\0"
- "\0"
- /* _mesa_function_pool[30331]: DrawBuffersARB (will be remapped) */
- "ip\0"
- "glDrawBuffers\0"
- "glDrawBuffersARB\0"
- "glDrawBuffersATI\0"
- "\0"
- /* _mesa_function_pool[30383]: ClearBufferiv (will be remapped) */
- "iip\0"
- "glClearBufferiv\0"
- "\0"
- /* _mesa_function_pool[30404]: ProgramLocalParameter4fARB (will be remapped) */
- "iiffff\0"
- "glProgramLocalParameter4fARB\0"
- "\0"
- /* _mesa_function_pool[30441]: SpriteParameterivSGIX (dynamic) */
- "ip\0"
- "glSpriteParameterivSGIX\0"
- "\0"
- /* _mesa_function_pool[30469]: ProvokingVertexEXT (will be remapped) */
- "i\0"
- "glProvokingVertexEXT\0"
- "glProvokingVertex\0"
- "\0"
- /* _mesa_function_pool[30511]: MultiTexCoord1fARB (offset 378) */
- "if\0"
- "glMultiTexCoord1f\0"
- "glMultiTexCoord1fARB\0"
- "\0"
- /* _mesa_function_pool[30554]: LoadName (offset 198) */
- "i\0"
- "glLoadName\0"
- "\0"
- /* _mesa_function_pool[30568]: VertexAttribs4ubvNV (will be remapped) */
- "iip\0"
- "glVertexAttribs4ubvNV\0"
- "\0"
- /* _mesa_function_pool[30595]: WeightsvARB (dynamic) */
- "ip\0"
- "glWeightsvARB\0"
- "\0"
- /* _mesa_function_pool[30613]: Uniform1fvARB (will be remapped) */
- "iip\0"
- "glUniform1fv\0"
- "glUniform1fvARB\0"
- "\0"
- /* _mesa_function_pool[30647]: CopyTexSubImage1D (offset 325) */
- "iiiiii\0"
- "glCopyTexSubImage1D\0"
- "glCopyTexSubImage1DEXT\0"
- "\0"
- /* _mesa_function_pool[30698]: CullFace (offset 152) */
- "i\0"
- "glCullFace\0"
- "\0"
- /* _mesa_function_pool[30712]: BindTexture (offset 307) */
- "ii\0"
- "glBindTexture\0"
- "glBindTextureEXT\0"
- "\0"
- /* _mesa_function_pool[30747]: BeginFragmentShaderATI (will be remapped) */
- "\0"
- "glBeginFragmentShaderATI\0"
- "\0"
- /* _mesa_function_pool[30774]: MultiTexCoord4fARB (offset 402) */
- "iffff\0"
- "glMultiTexCoord4f\0"
- "glMultiTexCoord4fARB\0"
- "\0"
- /* _mesa_function_pool[30820]: VertexAttribs3svNV (will be remapped) */
- "iip\0"
- "glVertexAttribs3svNV\0"
- "\0"
- /* _mesa_function_pool[30846]: StencilFunc (offset 243) */
- "iii\0"
- "glStencilFunc\0"
- "\0"
- /* _mesa_function_pool[30865]: CopyPixels (offset 255) */
- "iiiii\0"
- "glCopyPixels\0"
- "\0"
- /* _mesa_function_pool[30885]: Rectsv (offset 93) */
- "pp\0"
- "glRectsv\0"
- "\0"
- /* _mesa_function_pool[30898]: ReplacementCodeuivSUN (dynamic) */
- "p\0"
- "glReplacementCodeuivSUN\0"
- "\0"
- /* _mesa_function_pool[30925]: EnableVertexAttribArrayARB (will be remapped) */
- "i\0"
- "glEnableVertexAttribArray\0"
- "glEnableVertexAttribArrayARB\0"
- "\0"
- /* _mesa_function_pool[30983]: NormalPointervINTEL (dynamic) */
- "ip\0"
- "glNormalPointervINTEL\0"
- "\0"
- /* _mesa_function_pool[31009]: CopyConvolutionFilter2D (offset 355) */
- "iiiiii\0"
- "glCopyConvolutionFilter2D\0"
- "glCopyConvolutionFilter2DEXT\0"
- "\0"
- /* _mesa_function_pool[31072]: WindowPos3ivMESA (will be remapped) */
- "p\0"
- "glWindowPos3iv\0"
- "glWindowPos3ivARB\0"
- "glWindowPos3ivMESA\0"
- "\0"
- /* _mesa_function_pool[31127]: CopyBufferSubData (will be remapped) */
- "iiiii\0"
- "glCopyBufferSubData\0"
- "\0"
- /* _mesa_function_pool[31154]: NormalPointer (offset 318) */
- "iip\0"
- "glNormalPointer\0"
- "\0"
- /* _mesa_function_pool[31175]: TexParameterfv (offset 179) */
- "iip\0"
- "glTexParameterfv\0"
- "\0"
- /* _mesa_function_pool[31197]: IsBufferARB (will be remapped) */
- "i\0"
- "glIsBuffer\0"
- "glIsBufferARB\0"
- "\0"
- /* _mesa_function_pool[31225]: WindowPos4iMESA (will be remapped) */
- "iiii\0"
- "glWindowPos4iMESA\0"
- "\0"
- /* _mesa_function_pool[31249]: VertexAttrib4uivARB (will be remapped) */
- "ip\0"
- "glVertexAttrib4uiv\0"
- "glVertexAttrib4uivARB\0"
- "\0"
- /* _mesa_function_pool[31294]: Tangent3bvEXT (dynamic) */
- "p\0"
- "glTangent3bvEXT\0"
- "\0"
- /* _mesa_function_pool[31313]: VertexAttribI3uivEXT (will be remapped) */
- "ip\0"
- "glVertexAttribI3uivEXT\0"
- "glVertexAttribI3uiv\0"
- "\0"
- /* _mesa_function_pool[31360]: UniformMatrix3x4fv (will be remapped) */
- "iiip\0"
- "glUniformMatrix3x4fv\0"
- "\0"
- /* _mesa_function_pool[31387]: ClipPlane (offset 150) */
- "ip\0"
- "glClipPlane\0"
- "\0"
- /* _mesa_function_pool[31403]: Recti (offset 90) */
- "iiii\0"
- "glRecti\0"
- "\0"
- /* _mesa_function_pool[31417]: TrackMatrixNV (will be remapped) */
- "iiii\0"
- "glTrackMatrixNV\0"
- "\0"
- /* _mesa_function_pool[31439]: DrawRangeElementsBaseVertex (will be remapped) */
- "iiiiipi\0"
- "glDrawRangeElementsBaseVertex\0"
- "\0"
- /* _mesa_function_pool[31478]: SamplerParameterIuiv (will be remapped) */
- "iip\0"
- "glSamplerParameterIuiv\0"
- "\0"
- /* _mesa_function_pool[31506]: TexCoordPointervINTEL (dynamic) */
- "iip\0"
- "glTexCoordPointervINTEL\0"
- "\0"
- /* _mesa_function_pool[31535]: DeleteBuffersARB (will be remapped) */
- "ip\0"
- "glDeleteBuffers\0"
- "glDeleteBuffersARB\0"
- "\0"
- /* _mesa_function_pool[31574]: PixelTransformParameterfvEXT (dynamic) */
- "iip\0"
- "glPixelTransformParameterfvEXT\0"
- "\0"
- /* _mesa_function_pool[31610]: PrimitiveRestartNV (will be remapped) */
- "\0"
- "glPrimitiveRestartNV\0"
- "\0"
- /* _mesa_function_pool[31633]: WindowPos4fvMESA (will be remapped) */
- "p\0"
- "glWindowPos4fvMESA\0"
- "\0"
- /* _mesa_function_pool[31655]: GetPixelMapuiv (offset 272) */
- "ip\0"
- "glGetPixelMapuiv\0"
- "\0"
- /* _mesa_function_pool[31676]: Rectf (offset 88) */
- "ffff\0"
- "glRectf\0"
- "\0"
- /* _mesa_function_pool[31690]: VertexAttrib1sNV (will be remapped) */
- "ii\0"
- "glVertexAttrib1sNV\0"
- "\0"
- /* _mesa_function_pool[31713]: Indexfv (offset 47) */
- "p\0"
- "glIndexfv\0"
- "\0"
- /* _mesa_function_pool[31726]: SecondaryColor3svEXT (will be remapped) */
- "p\0"
- "glSecondaryColor3sv\0"
- "glSecondaryColor3svEXT\0"
- "\0"
- /* _mesa_function_pool[31772]: LoadTransposeMatrixfARB (will be remapped) */
- "p\0"
- "glLoadTransposeMatrixf\0"
- "glLoadTransposeMatrixfARB\0"
- "\0"
- /* _mesa_function_pool[31824]: GetPointerv (offset 329) */
- "ip\0"
- "glGetPointerv\0"
- "glGetPointervEXT\0"
- "\0"
- /* _mesa_function_pool[31859]: Tangent3bEXT (dynamic) */
- "iii\0"
- "glTangent3bEXT\0"
- "\0"
- /* _mesa_function_pool[31879]: CombinerParameterfNV (will be remapped) */
- "if\0"
- "glCombinerParameterfNV\0"
- "\0"
- /* _mesa_function_pool[31906]: IndexMask (offset 212) */
- "i\0"
- "glIndexMask\0"
- "\0"
- /* _mesa_function_pool[31921]: BindProgramNV (will be remapped) */
- "ii\0"
- "glBindProgramARB\0"
- "glBindProgramNV\0"
- "\0"
- /* _mesa_function_pool[31958]: VertexAttrib4svARB (will be remapped) */
- "ip\0"
- "glVertexAttrib4sv\0"
- "glVertexAttrib4svARB\0"
- "\0"
- /* _mesa_function_pool[32001]: GetFloatv (offset 262) */
- "ip\0"
- "glGetFloatv\0"
- "\0"
- /* _mesa_function_pool[32017]: CreateDebugObjectMESA (dynamic) */
- "\0"
- "glCreateDebugObjectMESA\0"
- "\0"
- /* _mesa_function_pool[32043]: GetShaderiv (will be remapped) */
- "iip\0"
- "glGetShaderiv\0"
- "\0"
- /* _mesa_function_pool[32062]: ClientWaitSync (will be remapped) */
- "iii\0"
- "glClientWaitSync\0"
- "\0"
- /* _mesa_function_pool[32084]: TexCoord4s (offset 124) */
- "iiii\0"
- "glTexCoord4s\0"
- "\0"
- /* _mesa_function_pool[32103]: TexCoord3sv (offset 117) */
- "p\0"
- "glTexCoord3sv\0"
- "\0"
- /* _mesa_function_pool[32120]: BindFragmentShaderATI (will be remapped) */
- "i\0"
- "glBindFragmentShaderATI\0"
- "\0"
- /* _mesa_function_pool[32147]: PopAttrib (offset 218) */
- "\0"
- "glPopAttrib\0"
- "\0"
- /* _mesa_function_pool[32161]: Fogfv (offset 154) */
- "ip\0"
- "glFogfv\0"
- "\0"
- /* _mesa_function_pool[32173]: UnmapBufferARB (will be remapped) */
- "i\0"
- "glUnmapBuffer\0"
- "glUnmapBufferARB\0"
- "\0"
- /* _mesa_function_pool[32207]: InitNames (offset 197) */
- "\0"
- "glInitNames\0"
- "\0"
- /* _mesa_function_pool[32221]: Normal3sv (offset 61) */
- "p\0"
- "glNormal3sv\0"
- "\0"
- /* _mesa_function_pool[32236]: Minmax (offset 368) */
- "iii\0"
- "glMinmax\0"
- "glMinmaxEXT\0"
- "\0"
- /* _mesa_function_pool[32262]: TexCoord4d (offset 118) */
- "dddd\0"
- "glTexCoord4d\0"
- "\0"
- /* _mesa_function_pool[32281]: TexCoord4f (offset 120) */
- "ffff\0"
- "glTexCoord4f\0"
- "\0"
- /* _mesa_function_pool[32300]: FogCoorddvEXT (will be remapped) */
- "p\0"
- "glFogCoorddv\0"
- "glFogCoorddvEXT\0"
- "\0"
- /* _mesa_function_pool[32332]: FinishTextureSUNX (dynamic) */
- "\0"
- "glFinishTextureSUNX\0"
- "\0"
- /* _mesa_function_pool[32354]: GetFragmentLightfvSGIX (dynamic) */
- "iip\0"
- "glGetFragmentLightfvSGIX\0"
- "\0"
- /* _mesa_function_pool[32384]: Binormal3fvEXT (dynamic) */
- "p\0"
- "glBinormal3fvEXT\0"
- "\0"
- /* _mesa_function_pool[32404]: GetBooleanv (offset 258) */
- "ip\0"
- "glGetBooleanv\0"
- "\0"
- /* _mesa_function_pool[32422]: ColorFragmentOp3ATI (will be remapped) */
- "iiiiiiiiiiiii\0"
- "glColorFragmentOp3ATI\0"
- "\0"
- /* _mesa_function_pool[32459]: Hint (offset 158) */
- "ii\0"
- "glHint\0"
- "\0"
- /* _mesa_function_pool[32470]: Color4dv (offset 28) */
- "p\0"
- "glColor4dv\0"
- "\0"
- /* _mesa_function_pool[32484]: VertexAttrib2svARB (will be remapped) */
- "ip\0"
- "glVertexAttrib2sv\0"
- "glVertexAttrib2svARB\0"
- "\0"
- /* _mesa_function_pool[32527]: AreProgramsResidentNV (will be remapped) */
- "ipp\0"
- "glAreProgramsResidentNV\0"
- "\0"
- /* _mesa_function_pool[32556]: WindowPos3svMESA (will be remapped) */
- "p\0"
- "glWindowPos3sv\0"
- "glWindowPos3svARB\0"
- "glWindowPos3svMESA\0"
- "\0"
- /* _mesa_function_pool[32611]: CopyColorSubTable (offset 347) */
- "iiiii\0"
- "glCopyColorSubTable\0"
- "glCopyColorSubTableEXT\0"
- "\0"
- /* _mesa_function_pool[32661]: WeightdvARB (dynamic) */
- "ip\0"
- "glWeightdvARB\0"
- "\0"
- /* _mesa_function_pool[32679]: DeleteRenderbuffersEXT (will be remapped) */
- "ip\0"
- "glDeleteRenderbuffers\0"
- "glDeleteRenderbuffersEXT\0"
- "\0"
- /* _mesa_function_pool[32730]: VertexAttrib4NubvARB (will be remapped) */
- "ip\0"
- "glVertexAttrib4Nubv\0"
- "glVertexAttrib4NubvARB\0"
- "\0"
- /* _mesa_function_pool[32777]: VertexAttrib3dvNV (will be remapped) */
- "ip\0"
- "glVertexAttrib3dvNV\0"
- "\0"
- /* _mesa_function_pool[32801]: GetObjectParameterfvARB (will be remapped) */
- "iip\0"
- "glGetObjectParameterfvARB\0"
- "\0"
- /* _mesa_function_pool[32832]: Vertex4iv (offset 147) */
- "p\0"
- "glVertex4iv\0"
- "\0"
- /* _mesa_function_pool[32847]: GetProgramEnvParameterdvARB (will be remapped) */
- "iip\0"
- "glGetProgramEnvParameterdvARB\0"
- "\0"
- /* _mesa_function_pool[32882]: TexCoord4dv (offset 119) */
- "p\0"
- "glTexCoord4dv\0"
- "\0"
- /* _mesa_function_pool[32899]: LockArraysEXT (will be remapped) */
- "ii\0"
- "glLockArraysEXT\0"
- "\0"
- /* _mesa_function_pool[32919]: Begin (offset 7) */
- "i\0"
- "glBegin\0"
- "\0"
- /* _mesa_function_pool[32930]: LightModeli (offset 165) */
- "ii\0"
- "glLightModeli\0"
- "\0"
- /* _mesa_function_pool[32948]: VertexAttribI4ivEXT (will be remapped) */
- "ip\0"
- "glVertexAttribI4ivEXT\0"
- "glVertexAttribI4iv\0"
- "\0"
- /* _mesa_function_pool[32993]: Rectfv (offset 89) */
- "pp\0"
- "glRectfv\0"
- "\0"
- /* _mesa_function_pool[33006]: BlendEquationSeparateiARB (will be remapped) */
- "iii\0"
- "glBlendEquationSeparateiARB\0"
- "glBlendEquationSeparateIndexedAMD\0"
- "\0"
- /* _mesa_function_pool[33073]: LightModelf (offset 163) */
- "if\0"
- "glLightModelf\0"
- "\0"
- /* _mesa_function_pool[33091]: GetTexParameterfv (offset 282) */
- "iip\0"
- "glGetTexParameterfv\0"
- "\0"
- /* _mesa_function_pool[33116]: GetLightfv (offset 264) */
- "iip\0"
- "glGetLightfv\0"
- "\0"
- /* _mesa_function_pool[33134]: PixelTransformParameterivEXT (dynamic) */
- "iip\0"
- "glPixelTransformParameterivEXT\0"
- "\0"
- /* _mesa_function_pool[33170]: BinormalPointerEXT (dynamic) */
- "iip\0"
- "glBinormalPointerEXT\0"
- "\0"
- /* _mesa_function_pool[33196]: VertexAttrib1dNV (will be remapped) */
- "id\0"
- "glVertexAttrib1dNV\0"
- "\0"
- /* _mesa_function_pool[33219]: GetCombinerInputParameterivNV (will be remapped) */
- "iiiip\0"
- "glGetCombinerInputParameterivNV\0"
- "\0"
- /* _mesa_function_pool[33258]: Disable (offset 214) */
- "i\0"
- "glDisable\0"
- "\0"
- /* _mesa_function_pool[33271]: MultiTexCoord2fvARB (offset 387) */
- "ip\0"
- "glMultiTexCoord2fv\0"
- "glMultiTexCoord2fvARB\0"
- "\0"
- /* _mesa_function_pool[33316]: GetRenderbufferParameterivEXT (will be remapped) */
- "iip\0"
- "glGetRenderbufferParameteriv\0"
- "glGetRenderbufferParameterivEXT\0"
- "\0"
- /* _mesa_function_pool[33382]: CombinerParameterivNV (will be remapped) */
- "ip\0"
- "glCombinerParameterivNV\0"
- "\0"
- /* _mesa_function_pool[33410]: GenFragmentShadersATI (will be remapped) */
- "i\0"
- "glGenFragmentShadersATI\0"
- "\0"
- /* _mesa_function_pool[33437]: DrawArrays (offset 310) */
- "iii\0"
- "glDrawArrays\0"
- "glDrawArraysEXT\0"
- "\0"
- /* _mesa_function_pool[33471]: WeightuivARB (dynamic) */
- "ip\0"
- "glWeightuivARB\0"
- "\0"
- /* _mesa_function_pool[33490]: GetVertexAttribIivEXT (will be remapped) */
- "iip\0"
- "glGetVertexAttribIivEXT\0"
- "glGetVertexAttribIiv\0"
- "\0"
- /* _mesa_function_pool[33540]: VertexAttrib2sARB (will be remapped) */
- "iii\0"
- "glVertexAttrib2s\0"
- "glVertexAttrib2sARB\0"
- "\0"
- /* _mesa_function_pool[33582]: GetnTexImageARB (will be remapped) */
- "iiiiip\0"
- "glGetnTexImageARB\0"
- "\0"
- /* _mesa_function_pool[33608]: ColorMask (offset 210) */
- "iiii\0"
- "glColorMask\0"
- "\0"
- /* _mesa_function_pool[33626]: GenAsyncMarkersSGIX (dynamic) */
- "i\0"
- "glGenAsyncMarkersSGIX\0"
- "\0"
- /* _mesa_function_pool[33651]: Tangent3svEXT (dynamic) */
- "p\0"
- "glTangent3svEXT\0"
- "\0"
- /* _mesa_function_pool[33670]: GetListParameterivSGIX (dynamic) */
- "iip\0"
- "glGetListParameterivSGIX\0"
- "\0"
- /* _mesa_function_pool[33700]: BindBufferARB (will be remapped) */
- "ii\0"
- "glBindBuffer\0"
- "glBindBufferARB\0"
- "\0"
- /* _mesa_function_pool[33733]: GetInfoLogARB (will be remapped) */
- "iipp\0"
- "glGetInfoLogARB\0"
- "\0"
- /* _mesa_function_pool[33755]: RasterPos4iv (offset 83) */
- "p\0"
- "glRasterPos4iv\0"
- "\0"
- /* _mesa_function_pool[33773]: Enable (offset 215) */
- "i\0"
- "glEnable\0"
- "\0"
- /* _mesa_function_pool[33785]: LineStipple (offset 167) */
- "ii\0"
- "glLineStipple\0"
- "\0"
- /* _mesa_function_pool[33803]: VertexAttribs4svNV (will be remapped) */
- "iip\0"
- "glVertexAttribs4svNV\0"
- "\0"
- /* _mesa_function_pool[33829]: EdgeFlagPointerListIBM (dynamic) */
- "ipi\0"
- "glEdgeFlagPointerListIBM\0"
- "\0"
- /* _mesa_function_pool[33859]: UniformMatrix3x2fv (will be remapped) */
- "iiip\0"
- "glUniformMatrix3x2fv\0"
- "\0"
- /* _mesa_function_pool[33886]: GetMinmaxParameterfv (offset 365) */
- "iip\0"
- "glGetMinmaxParameterfv\0"
- "glGetMinmaxParameterfvEXT\0"
- "\0"
- /* _mesa_function_pool[33940]: VertexAttrib1fvARB (will be remapped) */
- "ip\0"
- "glVertexAttrib1fv\0"
- "glVertexAttrib1fvARB\0"
- "\0"
- /* _mesa_function_pool[33983]: GenBuffersARB (will be remapped) */
- "ip\0"
- "glGenBuffers\0"
- "glGenBuffersARB\0"
- "\0"
- /* _mesa_function_pool[34016]: VertexAttribs1svNV (will be remapped) */
- "iip\0"
- "glVertexAttribs1svNV\0"
- "\0"
- /* _mesa_function_pool[34042]: Vertex3fv (offset 137) */
- "p\0"
- "glVertex3fv\0"
- "\0"
- /* _mesa_function_pool[34057]: GetTexBumpParameterivATI (will be remapped) */
- "ip\0"
- "glGetTexBumpParameterivATI\0"
- "\0"
- /* _mesa_function_pool[34088]: Binormal3bEXT (dynamic) */
- "iii\0"
- "glBinormal3bEXT\0"
- "\0"
- /* _mesa_function_pool[34109]: FragmentMaterialivSGIX (dynamic) */
- "iip\0"
- "glFragmentMaterialivSGIX\0"
- "\0"
- /* _mesa_function_pool[34139]: IsRenderbufferEXT (will be remapped) */
- "i\0"
- "glIsRenderbuffer\0"
- "glIsRenderbufferEXT\0"
- "\0"
- /* _mesa_function_pool[34179]: GenProgramsNV (will be remapped) */
- "ip\0"
- "glGenProgramsARB\0"
- "glGenProgramsNV\0"
- "\0"
- /* _mesa_function_pool[34216]: VertexAttrib4dvNV (will be remapped) */
- "ip\0"
- "glVertexAttrib4dvNV\0"
- "\0"
- /* _mesa_function_pool[34240]: EndFragmentShaderATI (will be remapped) */
- "\0"
- "glEndFragmentShaderATI\0"
- "\0"
- /* _mesa_function_pool[34265]: Binormal3iEXT (dynamic) */
- "iii\0"
- "glBinormal3iEXT\0"
- "\0"
- /* _mesa_function_pool[34286]: WindowPos2fMESA (will be remapped) */
- "ff\0"
- "glWindowPos2f\0"
- "glWindowPos2fARB\0"
- "glWindowPos2fMESA\0"
- "\0"
- ;
-
-/* these functions need to be remapped */
-static const struct gl_function_pool_remap MESA_remap_table_functions[] = {
- { 1629, AttachShader_remap_index },
- { 10274, CreateProgram_remap_index },
- { 23765, CreateShader_remap_index },
- { 26289, DeleteProgram_remap_index },
- { 19245, DeleteShader_remap_index },
- { 24258, DetachShader_remap_index },
- { 18534, GetAttachedShaders_remap_index },
- { 5126, GetProgramInfoLog_remap_index },
- { 444, GetProgramiv_remap_index },
- { 6892, GetShaderInfoLog_remap_index },
- { 32043, GetShaderiv_remap_index },
- { 13807, IsProgram_remap_index },
- { 12698, IsShader_remap_index },
- { 10404, StencilFuncSeparate_remap_index },
- { 4156, StencilMaskSeparate_remap_index },
- { 7957, StencilOpSeparate_remap_index },
- { 22999, UniformMatrix2x3fv_remap_index },
- { 2998, UniformMatrix2x4fv_remap_index },
- { 33859, UniformMatrix3x2fv_remap_index },
- { 31360, UniformMatrix3x4fv_remap_index },
- { 16726, UniformMatrix4x2fv_remap_index },
- { 3417, UniformMatrix4x3fv_remap_index },
- { 5332, ClampColor_remap_index },
- { 18588, ClearBufferfi_remap_index },
- { 18004, ClearBufferfv_remap_index },
- { 30383, ClearBufferiv_remap_index },
- { 14012, ClearBufferuiv_remap_index },
- { 20582, GetStringi_remap_index },
- { 2900, TexBuffer_remap_index },
- { 977, FramebufferTexture_remap_index },
- { 27325, GetBufferParameteri64v_remap_index },
- { 10504, GetInteger64i_v_remap_index },
- { 24079, VertexAttribDivisor_remap_index },
- { 10292, LoadTransposeMatrixdARB_remap_index },
- { 31772, LoadTransposeMatrixfARB_remap_index },
- { 5971, MultTransposeMatrixdARB_remap_index },
- { 24445, MultTransposeMatrixfARB_remap_index },
- { 255, SampleCoverageARB_remap_index },
- { 6155, CompressedTexImage1DARB_remap_index },
- { 24973, CompressedTexImage2DARB_remap_index },
- { 4219, CompressedTexImage3DARB_remap_index },
- { 18876, CompressedTexSubImage1DARB_remap_index },
- { 2141, CompressedTexSubImage2DARB_remap_index },
- { 21004, CompressedTexSubImage3DARB_remap_index },
- { 29489, GetCompressedTexImageARB_remap_index },
- { 3983, DisableVertexAttribArrayARB_remap_index },
- { 30925, EnableVertexAttribArrayARB_remap_index },
- { 32847, GetProgramEnvParameterdvARB_remap_index },
- { 24325, GetProgramEnvParameterfvARB_remap_index },
- { 28354, GetProgramLocalParameterdvARB_remap_index },
- { 8433, GetProgramLocalParameterfvARB_remap_index },
- { 19052, GetProgramStringARB_remap_index },
- { 28549, GetProgramivARB_remap_index },
- { 21199, GetVertexAttribdvARB_remap_index },
- { 16534, GetVertexAttribfvARB_remap_index },
- { 10108, GetVertexAttribivARB_remap_index },
- { 20045, ProgramEnvParameter4dARB_remap_index },
- { 26039, ProgramEnvParameter4dvARB_remap_index },
- { 17302, ProgramEnvParameter4fARB_remap_index },
- { 9308, ProgramEnvParameter4fvARB_remap_index },
- { 4182, ProgramLocalParameter4dARB_remap_index },
- { 13517, ProgramLocalParameter4dvARB_remap_index },
- { 30404, ProgramLocalParameter4fARB_remap_index },
- { 26685, ProgramLocalParameter4fvARB_remap_index },
- { 29243, ProgramStringARB_remap_index },
- { 20313, VertexAttrib1dARB_remap_index },
- { 16161, VertexAttrib1dvARB_remap_index },
- { 4378, VertexAttrib1fARB_remap_index },
- { 33940, VertexAttrib1fvARB_remap_index },
- { 7483, VertexAttrib1sARB_remap_index },
- { 2336, VertexAttrib1svARB_remap_index },
- { 15592, VertexAttrib2dARB_remap_index },
- { 18025, VertexAttrib2dvARB_remap_index },
- { 1687, VertexAttrib2fARB_remap_index },
- { 18138, VertexAttrib2fvARB_remap_index },
- { 33540, VertexAttrib2sARB_remap_index },
- { 32484, VertexAttrib2svARB_remap_index },
- { 11682, VertexAttrib3dARB_remap_index },
- { 8975, VertexAttrib3dvARB_remap_index },
- { 1774, VertexAttrib3fARB_remap_index },
- { 23316, VertexAttrib3fvARB_remap_index },
- { 29090, VertexAttrib3sARB_remap_index },
- { 20941, VertexAttrib3svARB_remap_index },
- { 5152, VertexAttrib4NbvARB_remap_index },
- { 18411, VertexAttrib4NivARB_remap_index },
- { 23271, VertexAttrib4NsvARB_remap_index },
- { 24277, VertexAttrib4NubARB_remap_index },
- { 32730, VertexAttrib4NubvARB_remap_index },
- { 19696, VertexAttrib4NuivARB_remap_index },
- { 3290, VertexAttrib4NusvARB_remap_index },
- { 11271, VertexAttrib4bvARB_remap_index },
- { 27727, VertexAttrib4dARB_remap_index },
- { 21998, VertexAttrib4dvARB_remap_index },
- { 11836, VertexAttrib4fARB_remap_index },
- { 12240, VertexAttrib4fvARB_remap_index },
- { 10647, VertexAttrib4ivARB_remap_index },
- { 17818, VertexAttrib4sARB_remap_index },
- { 31958, VertexAttrib4svARB_remap_index },
- { 17107, VertexAttrib4ubvARB_remap_index },
- { 31249, VertexAttrib4uivARB_remap_index },
- { 20752, VertexAttrib4usvARB_remap_index },
- { 22814, VertexAttribPointerARB_remap_index },
- { 33700, BindBufferARB_remap_index },
- { 7190, BufferDataARB_remap_index },
- { 1550, BufferSubDataARB_remap_index },
- { 31535, DeleteBuffersARB_remap_index },
- { 33983, GenBuffersARB_remap_index },
- { 18181, GetBufferParameterivARB_remap_index },
- { 17254, GetBufferPointervARB_remap_index },
- { 1503, GetBufferSubDataARB_remap_index },
- { 31197, IsBufferARB_remap_index },
- { 27169, MapBufferARB_remap_index },
- { 32173, UnmapBufferARB_remap_index },
- { 351, BeginQueryARB_remap_index },
- { 20408, DeleteQueriesARB_remap_index },
- { 12559, EndQueryARB_remap_index },
- { 29968, GenQueriesARB_remap_index },
- { 2033, GetQueryObjectivARB_remap_index },
- { 17862, GetQueryObjectuivARB_remap_index },
- { 1831, GetQueryivARB_remap_index },
- { 20659, IsQueryARB_remap_index },
- { 8585, AttachObjectARB_remap_index },
- { 19207, CompileShaderARB_remap_index },
- { 3359, CreateProgramObjectARB_remap_index },
- { 7135, CreateShaderObjectARB_remap_index },
- { 14894, DeleteObjectARB_remap_index },
- { 24764, DetachObjectARB_remap_index },
- { 12304, GetActiveUniformARB_remap_index },
- { 9783, GetAttachedObjectsARB_remap_index },
- { 10090, GetHandleARB_remap_index },
- { 33733, GetInfoLogARB_remap_index },
- { 32801, GetObjectParameterfvARB_remap_index },
- { 28228, GetObjectParameterivARB_remap_index },
- { 29726, GetShaderSourceARB_remap_index },
- { 28950, GetUniformLocationARB_remap_index },
- { 24547, GetUniformfvARB_remap_index },
- { 13092, GetUniformivARB_remap_index },
- { 20797, LinkProgramARB_remap_index },
- { 20855, ShaderSourceARB_remap_index },
- { 7857, Uniform1fARB_remap_index },
- { 30613, Uniform1fvARB_remap_index },
- { 22762, Uniform1iARB_remap_index },
- { 21652, Uniform1ivARB_remap_index },
- { 2285, Uniform2fARB_remap_index },
- { 14730, Uniform2fvARB_remap_index },
- { 27056, Uniform2iARB_remap_index },
- { 2405, Uniform2ivARB_remap_index },
- { 19317, Uniform3fARB_remap_index },
- { 9813, Uniform3fvARB_remap_index },
- { 6746, Uniform3iARB_remap_index },
- { 17360, Uniform3ivARB_remap_index },
- { 19851, Uniform4fARB_remap_index },
- { 24411, Uniform4fvARB_remap_index },
- { 25673, Uniform4iARB_remap_index },
- { 21165, Uniform4ivARB_remap_index },
- { 8637, UniformMatrix2fvARB_remap_index },
- { 17, UniformMatrix3fvARB_remap_index },
- { 2802, UniformMatrix4fvARB_remap_index },
- { 26151, UseProgramObjectARB_remap_index },
- { 15280, ValidateProgramARB_remap_index },
- { 22041, BindAttribLocationARB_remap_index },
- { 5197, GetActiveAttribARB_remap_index },
- { 17041, GetAttribLocationARB_remap_index },
- { 30331, DrawBuffersARB_remap_index },
- { 30164, ClampColorARB_remap_index },
- { 18456, DrawArraysInstancedARB_remap_index },
- { 6807, DrawElementsInstancedARB_remap_index },
- { 13622, RenderbufferStorageMultisample_remap_index },
- { 14093, FramebufferTextureARB_remap_index },
- { 26587, FramebufferTextureFaceARB_remap_index },
- { 24913, ProgramParameteriARB_remap_index },
- { 6327, VertexAttribDivisorARB_remap_index },
- { 19899, FlushMappedBufferRange_remap_index },
- { 28665, MapBufferRange_remap_index },
- { 28572, TexBufferARB_remap_index },
- { 16864, BindVertexArray_remap_index },
- { 15103, GenVertexArrays_remap_index },
- { 31127, CopyBufferSubData_remap_index },
- { 32062, ClientWaitSync_remap_index },
- { 2721, DeleteSync_remap_index },
- { 7524, FenceSync_remap_index },
- { 15651, GetInteger64v_remap_index },
- { 23378, GetSynciv_remap_index },
- { 30270, IsSync_remap_index },
- { 9731, WaitSync_remap_index },
- { 3951, DrawElementsBaseVertex_remap_index },
- { 31439, DrawRangeElementsBaseVertex_remap_index },
- { 27200, MultiDrawElementsBaseVertex_remap_index },
- { 33006, BlendEquationSeparateiARB_remap_index },
- { 18274, BlendEquationiARB_remap_index },
- { 13031, BlendFuncSeparateiARB_remap_index },
- { 10156, BlendFunciARB_remap_index },
- { 8499, BindSampler_remap_index },
- { 4357, DeleteSamplers_remap_index },
- { 20272, GenSamplers_remap_index },
- { 30202, GetSamplerParameterIiv_remap_index },
- { 19793, GetSamplerParameterIuiv_remap_index },
- { 5046, GetSamplerParameterfv_remap_index },
- { 26308, GetSamplerParameteriv_remap_index },
- { 14648, IsSampler_remap_index },
- { 16817, SamplerParameterIiv_remap_index },
- { 31478, SamplerParameterIuiv_remap_index },
- { 23051, SamplerParameterf_remap_index },
- { 16973, SamplerParameterfv_remap_index },
- { 23026, SamplerParameteri_remap_index },
- { 18650, SamplerParameteriv_remap_index },
- { 5393, BindTransformFeedback_remap_index },
- { 3386, DeleteTransformFeedbacks_remap_index },
- { 6779, DrawTransformFeedback_remap_index },
- { 9950, GenTransformFeedbacks_remap_index },
- { 29133, IsTransformFeedback_remap_index },
- { 26780, PauseTransformFeedback_remap_index },
- { 5856, ResumeTransformFeedback_remap_index },
- { 22361, ClearDepthf_remap_index },
- { 7083, DepthRangef_remap_index },
- { 14915, GetShaderPrecisionFormat_remap_index },
- { 10344, ReleaseShaderCompiler_remap_index },
- { 11314, ShaderBinary_remap_index },
- { 1004, GetGraphicsResetStatusARB_remap_index },
- { 25478, GetnColorTableARB_remap_index },
- { 8268, GetnCompressedTexImageARB_remap_index },
- { 4090, GetnConvolutionFilterARB_remap_index },
- { 16204, GetnHistogramARB_remap_index },
- { 24237, GetnMapdvARB_remap_index },
- { 22793, GetnMapfvARB_remap_index },
- { 2264, GetnMapivARB_remap_index },
- { 17622, GetnMinmaxARB_remap_index },
- { 4671, GetnPixelMapfvARB_remap_index },
- { 19670, GetnPixelMapuivARB_remap_index },
- { 3111, GetnPixelMapusvARB_remap_index },
- { 1383, GetnPolygonStippleARB_remap_index },
- { 21826, GetnSeparableFilterARB_remap_index },
- { 33582, GetnTexImageARB_remap_index },
- { 19079, GetnUniformdvARB_remap_index },
- { 4743, GetnUniformfvARB_remap_index },
- { 10199, GetnUniformivARB_remap_index },
- { 23227, GetnUniformuivARB_remap_index },
- { 3025, ReadnPixelsARB_remap_index },
- { 5724, PolygonOffsetEXT_remap_index },
- { 24000, GetPixelTexGenParameterfvSGIS_remap_index },
- { 4621, GetPixelTexGenParameterivSGIS_remap_index },
- { 23733, PixelTexGenParameterfSGIS_remap_index },
- { 663, PixelTexGenParameterfvSGIS_remap_index },
- { 13130, PixelTexGenParameteriSGIS_remap_index },
- { 14235, PixelTexGenParameterivSGIS_remap_index },
- { 18775, SampleMaskSGIS_remap_index },
- { 20599, SamplePatternSGIS_remap_index },
- { 27129, ColorPointerEXT_remap_index },
- { 18068, EdgeFlagPointerEXT_remap_index },
- { 6400, IndexPointerEXT_remap_index },
- { 6480, NormalPointerEXT_remap_index },
- { 16272, TexCoordPointerEXT_remap_index },
- { 7313, VertexPointerEXT_remap_index },
- { 3753, PointParameterfEXT_remap_index },
- { 8164, PointParameterfvEXT_remap_index },
- { 32899, LockArraysEXT_remap_index },
- { 15344, UnlockArraysEXT_remap_index },
- { 1291, SecondaryColor3bEXT_remap_index },
- { 8357, SecondaryColor3bvEXT_remap_index },
- { 10824, SecondaryColor3dEXT_remap_index },
- { 26357, SecondaryColor3dvEXT_remap_index },
- { 28999, SecondaryColor3fEXT_remap_index },
- { 18812, SecondaryColor3fvEXT_remap_index },
- { 509, SecondaryColor3iEXT_remap_index },
- { 16582, SecondaryColor3ivEXT_remap_index },
- { 10432, SecondaryColor3sEXT_remap_index },
- { 31726, SecondaryColor3svEXT_remap_index },
- { 28064, SecondaryColor3ubEXT_remap_index },
- { 21932, SecondaryColor3ubvEXT_remap_index },
- { 13372, SecondaryColor3uiEXT_remap_index },
- { 23620, SecondaryColor3uivEXT_remap_index },
- { 26637, SecondaryColor3usEXT_remap_index },
- { 13445, SecondaryColor3usvEXT_remap_index },
- { 12183, SecondaryColorPointerEXT_remap_index },
- { 26451, MultiDrawArraysEXT_remap_index },
- { 21587, MultiDrawElementsEXT_remap_index },
- { 21782, FogCoordPointerEXT_remap_index },
- { 4794, FogCoorddEXT_remap_index },
- { 32300, FogCoorddvEXT_remap_index },
- { 4911, FogCoordfEXT_remap_index },
- { 27987, FogCoordfvEXT_remap_index },
- { 12283, PixelTexGenSGIX_remap_index },
- { 28592, BlendFuncSeparateEXT_remap_index },
- { 7225, FlushVertexArrayRangeNV_remap_index },
- { 5673, VertexArrayRangeNV_remap_index },
- { 29064, CombinerInputNV_remap_index },
- { 2207, CombinerOutputNV_remap_index },
- { 31879, CombinerParameterfNV_remap_index },
- { 5547, CombinerParameterfvNV_remap_index },
- { 23076, CombinerParameteriNV_remap_index },
- { 33382, CombinerParameterivNV_remap_index },
- { 7601, FinalCombinerInputNV_remap_index },
- { 1648, GetCombinerInputParameterfvNV_remap_index },
- { 33219, GetCombinerInputParameterivNV_remap_index },
- { 216, GetCombinerOutputParameterfvNV_remap_index },
- { 14196, GetCombinerOutputParameterivNV_remap_index },
- { 6987, GetFinalCombinerInputParameterfvNV_remap_index },
- { 25545, GetFinalCombinerInputParameterivNV_remap_index },
- { 13009, ResizeBuffersMESA_remap_index },
- { 11509, WindowPos2dMESA_remap_index },
- { 1084, WindowPos2dvMESA_remap_index },
- { 34286, WindowPos2fMESA_remap_index },
- { 8302, WindowPos2fvMESA_remap_index },
- { 18722, WindowPos2iMESA_remap_index },
- { 21072, WindowPos2ivMESA_remap_index },
- { 21686, WindowPos2sMESA_remap_index },
- { 6069, WindowPos2svMESA_remap_index },
- { 8093, WindowPos3dMESA_remap_index },
- { 14443, WindowPos3dvMESA_remap_index },
- { 555, WindowPos3fMESA_remap_index },
- { 15405, WindowPos3fvMESA_remap_index },
- { 24806, WindowPos3iMESA_remap_index },
- { 31072, WindowPos3ivMESA_remap_index },
- { 19462, WindowPos3sMESA_remap_index },
- { 32556, WindowPos3svMESA_remap_index },
- { 11460, WindowPos4dMESA_remap_index },
- { 17498, WindowPos4dvMESA_remap_index },
- { 14402, WindowPos4fMESA_remap_index },
- { 31633, WindowPos4fvMESA_remap_index },
- { 31225, WindowPos4iMESA_remap_index },
- { 12812, WindowPos4ivMESA_remap_index },
- { 19646, WindowPos4sMESA_remap_index },
- { 3337, WindowPos4svMESA_remap_index },
- { 27695, MultiModeDrawArraysIBM_remap_index },
- { 29839, MultiModeDrawElementsIBM_remap_index },
- { 12587, DeleteFencesNV_remap_index },
- { 28911, FinishFenceNV_remap_index },
- { 3875, GenFencesNV_remap_index },
- { 17478, GetFenceivNV_remap_index },
- { 8570, IsFenceNV_remap_index },
- { 14123, SetFenceNV_remap_index },
- { 4434, TestFenceNV_remap_index },
- { 32527, AreProgramsResidentNV_remap_index },
- { 31921, BindProgramNV_remap_index },
- { 26720, DeleteProgramsNV_remap_index },
- { 22150, ExecuteProgramNV_remap_index },
- { 34179, GenProgramsNV_remap_index },
- { 24105, GetProgramParameterdvNV_remap_index },
- { 10886, GetProgramParameterfvNV_remap_index },
- { 27103, GetProgramStringNV_remap_index },
- { 25183, GetProgramivNV_remap_index },
- { 24360, GetTrackMatrixivNV_remap_index },
- { 26897, GetVertexAttribPointervNV_remap_index },
- { 10527, GetVertexAttribdvNV_remap_index },
- { 9626, GetVertexAttribfvNV_remap_index },
- { 19025, GetVertexAttribivNV_remap_index },
- { 19929, IsProgramNV_remap_index },
- { 9709, LoadProgramNV_remap_index },
- { 28688, ProgramParameters4dvNV_remap_index },
- { 25113, ProgramParameters4fvNV_remap_index },
- { 21376, RequestResidentProgramsNV_remap_index },
- { 31417, TrackMatrixNV_remap_index },
- { 33196, VertexAttrib1dNV_remap_index },
- { 14034, VertexAttrib1dvNV_remap_index },
- { 29345, VertexAttrib1fNV_remap_index },
- { 2527, VertexAttrib1fvNV_remap_index },
- { 31690, VertexAttrib1sNV_remap_index },
- { 15478, VertexAttrib1svNV_remap_index },
- { 5102, VertexAttrib2dNV_remap_index },
- { 13927, VertexAttrib2dvNV_remap_index },
- { 20831, VertexAttrib2fNV_remap_index },
- { 13493, VertexAttrib2fvNV_remap_index },
- { 6281, VertexAttrib2sNV_remap_index },
- { 19516, VertexAttrib2svNV_remap_index },
- { 11657, VertexAttrib3dNV_remap_index },
- { 32777, VertexAttrib3dvNV_remap_index },
- { 10698, VertexAttrib3fNV_remap_index },
- { 25505, VertexAttrib3fvNV_remap_index },
- { 22869, VertexAttrib3sNV_remap_index },
- { 24387, VertexAttrib3svNV_remap_index },
- { 29813, VertexAttrib4dNV_remap_index },
- { 34216, VertexAttrib4dvNV_remap_index },
- { 5487, VertexAttrib4fNV_remap_index },
- { 9759, VertexAttrib4fvNV_remap_index },
- { 27579, VertexAttrib4sNV_remap_index },
- { 1461, VertexAttrib4svNV_remap_index },
- { 5260, VertexAttrib4ubNV_remap_index },
- { 817, VertexAttrib4ubvNV_remap_index },
- { 22330, VertexAttribPointerNV_remap_index },
- { 2379, VertexAttribs1dvNV_remap_index },
- { 26985, VertexAttribs1fvNV_remap_index },
- { 34016, VertexAttribs1svNV_remap_index },
- { 10723, VertexAttribs2dvNV_remap_index },
- { 26112, VertexAttribs2fvNV_remap_index },
- { 18094, VertexAttribs2svNV_remap_index },
- { 5575, VertexAttribs3dvNV_remap_index },
- { 2238, VertexAttribs3fvNV_remap_index },
- { 30820, VertexAttribs3svNV_remap_index },
- { 27669, VertexAttribs4dvNV_remap_index },
- { 5647, VertexAttribs4fvNV_remap_index },
- { 33803, VertexAttribs4svNV_remap_index },
- { 30568, VertexAttribs4ubvNV_remap_index },
- { 27771, GetTexBumpParameterfvATI_remap_index },
- { 34057, GetTexBumpParameterivATI_remap_index },
- { 19160, TexBumpParameterfvATI_remap_index },
- { 21247, TexBumpParameterivATI_remap_index },
- { 16024, AlphaFragmentOp1ATI_remap_index },
- { 26403, AlphaFragmentOp2ATI_remap_index },
- { 25421, AlphaFragmentOp3ATI_remap_index },
- { 30747, BeginFragmentShaderATI_remap_index },
- { 32120, BindFragmentShaderATI_remap_index },
- { 24516, ColorFragmentOp1ATI_remap_index },
- { 4549, ColorFragmentOp2ATI_remap_index },
- { 32422, ColorFragmentOp3ATI_remap_index },
- { 5813, DeleteFragmentShaderATI_remap_index },
- { 34240, EndFragmentShaderATI_remap_index },
- { 33410, GenFragmentShadersATI_remap_index },
- { 26266, PassTexCoordATI_remap_index },
- { 7293, SampleMapATI_remap_index },
- { 27882, SetFragmentShaderConstantATI_remap_index },
- { 402, PointParameteriNV_remap_index },
- { 14604, PointParameterivNV_remap_index },
- { 29652, ActiveStencilFaceEXT_remap_index },
- { 28328, BindVertexArrayAPPLE_remap_index },
- { 2849, DeleteVertexArraysAPPLE_remap_index },
- { 18561, GenVertexArraysAPPLE_remap_index },
- { 24170, IsVertexArrayAPPLE_remap_index },
- { 858, GetProgramNamedParameterdvNV_remap_index },
- { 3716, GetProgramNamedParameterfvNV_remap_index },
- { 27802, ProgramNamedParameter4dNV_remap_index },
- { 14978, ProgramNamedParameter4dvNV_remap_index },
- { 9242, ProgramNamedParameter4fNV_remap_index },
- { 12148, ProgramNamedParameter4fvNV_remap_index },
- { 17409, PrimitiveRestartIndexNV_remap_index },
- { 31610, PrimitiveRestartNV_remap_index },
- { 25092, DepthBoundsEXT_remap_index },
- { 1183, BlendEquationSeparateEXT_remap_index },
- { 15179, BindFramebufferEXT_remap_index },
- { 26496, BindRenderbufferEXT_remap_index },
- { 10006, CheckFramebufferStatusEXT_remap_index },
- { 23421, DeleteFramebuffersEXT_remap_index },
- { 32679, DeleteRenderbuffersEXT_remap_index },
- { 13951, FramebufferRenderbufferEXT_remap_index },
- { 14140, FramebufferTexture1DEXT_remap_index },
- { 11942, FramebufferTexture2DEXT_remap_index },
- { 11562, FramebufferTexture3DEXT_remap_index },
- { 24036, GenFramebuffersEXT_remap_index },
- { 17959, GenRenderbuffersEXT_remap_index },
- { 7029, GenerateMipmapEXT_remap_index },
- { 22423, GetFramebufferAttachmentParameterivEXT_remap_index },
- { 33316, GetRenderbufferParameterivEXT_remap_index },
- { 21127, IsFramebufferEXT_remap_index },
- { 34139, IsRenderbufferEXT_remap_index },
- { 8517, RenderbufferStorageEXT_remap_index },
- { 734, BlitFramebufferEXT_remap_index },
- { 14764, BufferParameteriAPPLE_remap_index },
- { 19961, FlushMappedBufferRangeAPPLE_remap_index },
- { 1906, BindFragDataLocationEXT_remap_index },
- { 25205, GetFragDataLocationEXT_remap_index },
- { 11001, GetUniformuivEXT_remap_index },
- { 33490, GetVertexAttribIivEXT_remap_index },
- { 28859, GetVertexAttribIuivEXT_remap_index },
- { 12420, Uniform1uiEXT_remap_index },
- { 28773, Uniform1uivEXT_remap_index },
- { 22965, Uniform2uiEXT_remap_index },
- { 4513, Uniform2uivEXT_remap_index },
- { 30092, Uniform3uiEXT_remap_index },
- { 15125, Uniform3uivEXT_remap_index },
- { 3640, Uniform4uiEXT_remap_index },
- { 9018, Uniform4uivEXT_remap_index },
- { 18940, VertexAttribI1iEXT_remap_index },
- { 5287, VertexAttribI1ivEXT_remap_index },
- { 2628, VertexAttribI1uiEXT_remap_index },
- { 13221, VertexAttribI1uivEXT_remap_index },
- { 81, VertexAttribI2iEXT_remap_index },
- { 24628, VertexAttribI2ivEXT_remap_index },
- { 5601, VertexAttribI2uiEXT_remap_index },
- { 4956, VertexAttribI2uivEXT_remap_index },
- { 27371, VertexAttribI3iEXT_remap_index },
- { 25830, VertexAttribI3ivEXT_remap_index },
- { 3494, VertexAttribI3uiEXT_remap_index },
- { 31313, VertexAttribI3uivEXT_remap_index },
- { 22674, VertexAttribI4bvEXT_remap_index },
- { 15057, VertexAttribI4iEXT_remap_index },
- { 32948, VertexAttribI4ivEXT_remap_index },
- { 13854, VertexAttribI4svEXT_remap_index },
- { 4043, VertexAttribI4ubvEXT_remap_index },
- { 16645, VertexAttribI4uiEXT_remap_index },
- { 5747, VertexAttribI4uivEXT_remap_index },
- { 11725, VertexAttribI4usvEXT_remap_index },
- { 19104, VertexAttribIPointerEXT_remap_index },
- { 3181, FramebufferTextureLayerEXT_remap_index },
- { 16999, ColorMaskIndexedEXT_remap_index },
- { 19540, DisableIndexedEXT_remap_index },
- { 27416, EnableIndexedEXT_remap_index },
- { 22378, GetBooleanIndexedvEXT_remap_index },
- { 11336, GetIntegerIndexedvEXT_remap_index },
- { 23497, IsEnabledIndexedEXT_remap_index },
- { 23397, ClearColorIiEXT_remap_index },
- { 3590, ClearColorIuiEXT_remap_index },
- { 10224, GetTexParameterIivEXT_remap_index },
- { 6229, GetTexParameterIuivEXT_remap_index },
- { 3137, TexParameterIivEXT_remap_index },
- { 27238, TexParameterIuivEXT_remap_index },
- { 4824, BeginConditionalRenderNV_remap_index },
- { 26216, EndConditionalRenderNV_remap_index },
- { 9653, BeginTransformFeedbackEXT_remap_index },
- { 19575, BindBufferBaseEXT_remap_index },
- { 19434, BindBufferOffsetEXT_remap_index },
- { 12637, BindBufferRangeEXT_remap_index },
- { 14679, EndTransformFeedbackEXT_remap_index },
- { 11199, GetTransformFeedbackVaryingEXT_remap_index },
- { 21432, TransformFeedbackVaryingsEXT_remap_index },
- { 30469, ProvokingVertexEXT_remap_index },
- { 11147, GetTexParameterPointervAPPLE_remap_index },
- { 5349, TextureRangeAPPLE_remap_index },
- { 12014, GetObjectParameterivAPPLE_remap_index },
- { 20554, ObjectPurgeableAPPLE_remap_index },
- { 6023, ObjectUnpurgeableAPPLE_remap_index },
- { 17781, ActiveProgramEXT_remap_index },
- { 17752, CreateShaderProgramEXT_remap_index },
- { 29437, UseShaderProgramEXT_remap_index },
- { 16952, TextureBarrierNV_remap_index },
- { 29678, StencilFuncSeparateATI_remap_index },
- { 5936, ProgramEnvParameters4fvEXT_remap_index },
- { 17646, ProgramLocalParameters4fvEXT_remap_index },
- { 14532, GetQueryObjecti64vEXT_remap_index },
- { 10749, GetQueryObjectui64vEXT_remap_index },
- { 24585, EGLImageTargetRenderbufferStorageOES_remap_index },
- { 12526, EGLImageTargetTexture2DOES_remap_index },
- { -1, -1 }
-};
-
-/* these functions are in the ABI, but have alternative names */
-static const struct gl_function_remap MESA_alt_functions[] = {
- /* from GL_EXT_blend_color */
- { 2767, _gloffset_BlendColor },
- /* from GL_EXT_blend_minmax */
- { 11619, _gloffset_BlendEquation },
- /* from GL_EXT_color_subtable */
- { 17520, _gloffset_ColorSubTable },
- { 32611, _gloffset_CopyColorSubTable },
- /* from GL_EXT_convolution */
- { 296, _gloffset_ConvolutionFilter1D },
- { 2566, _gloffset_CopyConvolutionFilter1D },
- { 4293, _gloffset_GetConvolutionParameteriv },
- { 8866, _gloffset_ConvolutionFilter2D },
- { 9068, _gloffset_ConvolutionParameteriv },
- { 9528, _gloffset_ConvolutionParameterfv },
- { 21275, _gloffset_GetSeparableFilter },
- { 24860, _gloffset_SeparableFilter2D },
- { 25723, _gloffset_ConvolutionParameteri },
- { 25891, _gloffset_ConvolutionParameterf },
- { 27605, _gloffset_GetConvolutionParameterfv },
- { 28494, _gloffset_GetConvolutionFilter },
- { 31009, _gloffset_CopyConvolutionFilter2D },
- /* from GL_EXT_copy_texture */
- { 15538, _gloffset_CopyTexSubImage3D },
- { 17207, _gloffset_CopyTexImage2D },
- { 25331, _gloffset_CopyTexImage1D },
- { 28175, _gloffset_CopyTexSubImage2D },
- { 30647, _gloffset_CopyTexSubImage1D },
- /* from GL_EXT_draw_range_elements */
- { 9865, _gloffset_DrawRangeElements },
- /* from GL_EXT_histogram */
- { 895, _gloffset_Histogram },
- { 3676, _gloffset_ResetHistogram },
- { 10370, _gloffset_GetMinmax },
- { 15872, _gloffset_GetHistogramParameterfv },
- { 25256, _gloffset_GetMinmaxParameteriv },
- { 27495, _gloffset_ResetMinmax },
- { 28391, _gloffset_GetHistogramParameteriv },
- { 29612, _gloffset_GetHistogram },
- { 32236, _gloffset_Minmax },
- { 33886, _gloffset_GetMinmaxParameterfv },
- /* from GL_EXT_paletted_texture */
- { 8728, _gloffset_ColorTable },
- { 15718, _gloffset_GetColorTable },
- { 23783, _gloffset_GetColorTableParameterfv },
- { 25947, _gloffset_GetColorTableParameteriv },
- /* from GL_EXT_subtexture */
- { 7439, _gloffset_TexSubImage1D },
- { 11074, _gloffset_TexSubImage2D },
- /* from GL_EXT_texture3D */
- { 1865, _gloffset_TexImage3D },
- { 23552, _gloffset_TexSubImage3D },
- /* from GL_EXT_texture_object */
- { 3444, _gloffset_PrioritizeTextures },
- { 7888, _gloffset_AreTexturesResident },
- { 14058, _gloffset_GenTextures },
- { 16231, _gloffset_DeleteTextures },
- { 20242, _gloffset_IsTexture },
- { 30712, _gloffset_BindTexture },
- /* from GL_EXT_vertex_array */
- { 25032, _gloffset_ArrayElement },
- { 31824, _gloffset_GetPointerv },
- { 33437, _gloffset_DrawArrays },
- /* from GL_SGI_color_table */
- { 8006, _gloffset_ColorTableParameteriv },
- { 8728, _gloffset_ColorTable },
- { 15718, _gloffset_GetColorTable },
- { 15828, _gloffset_CopyColorTable },
- { 20103, _gloffset_ColorTableParameterfv },
- { 23783, _gloffset_GetColorTableParameterfv },
- { 25947, _gloffset_GetColorTableParameteriv },
- /* from GL_VERSION_1_3 */
- { 464, _gloffset_MultiTexCoord3sARB },
- { 696, _gloffset_ActiveTextureARB },
- { 4451, _gloffset_MultiTexCoord1fvARB },
- { 6505, _gloffset_MultiTexCoord3dARB },
- { 6550, _gloffset_MultiTexCoord2iARB },
- { 6674, _gloffset_MultiTexCoord2svARB },
- { 8684, _gloffset_MultiTexCoord2fARB },
- { 10779, _gloffset_MultiTexCoord3fvARB },
- { 11381, _gloffset_MultiTexCoord4sARB },
- { 12062, _gloffset_MultiTexCoord2dvARB },
- { 12469, _gloffset_MultiTexCoord1svARB },
- { 12870, _gloffset_MultiTexCoord3svARB },
- { 12931, _gloffset_MultiTexCoord4iARB },
- { 13762, _gloffset_MultiTexCoord3iARB },
- { 14561, _gloffset_MultiTexCoord1dARB },
- { 14793, _gloffset_MultiTexCoord3dvARB },
- { 16072, _gloffset_MultiTexCoord3ivARB },
- { 16117, _gloffset_MultiTexCoord2sARB },
- { 17577, _gloffset_MultiTexCoord4ivARB },
- { 19743, _gloffset_ClientActiveTextureARB },
- { 22106, _gloffset_MultiTexCoord2dARB },
- { 22543, _gloffset_MultiTexCoord4dvARB },
- { 22920, _gloffset_MultiTexCoord4fvARB },
- { 23924, _gloffset_MultiTexCoord3fARB },
- { 26541, _gloffset_MultiTexCoord4dARB },
- { 26807, _gloffset_MultiTexCoord1sARB },
- { 27011, _gloffset_MultiTexCoord1dvARB },
- { 28019, _gloffset_MultiTexCoord1ivARB },
- { 28112, _gloffset_MultiTexCoord2ivARB },
- { 28451, _gloffset_MultiTexCoord1iARB },
- { 29887, _gloffset_MultiTexCoord4svARB },
- { 30511, _gloffset_MultiTexCoord1fARB },
- { 30774, _gloffset_MultiTexCoord4fARB },
- { 33271, _gloffset_MultiTexCoord2fvARB },
- { -1, -1 }
-};
-
-#endif /* need_MESA_remap_table */
-
-#if defined(need_GL_3DFX_tbuffer)
-static const struct gl_function_remap GL_3DFX_tbuffer_functions[] = {
- { 9586, -1 }, /* TbufferMask3DFX */
- { -1, -1 }
-};
-#endif
-
-#if defined(need_GL_AMD_draw_buffers_blend)
-/* functions defined in MESA_remap_table_functions are excluded */
-static const struct gl_function_remap GL_AMD_draw_buffers_blend_functions[] = {
- { -1, -1 }
-};
-#endif
-
-#if defined(need_GL_APPLE_flush_buffer_range)
-/* functions defined in MESA_remap_table_functions are excluded */
-static const struct gl_function_remap GL_APPLE_flush_buffer_range_functions[] = {
- { -1, -1 }
-};
-#endif
-
-#if defined(need_GL_APPLE_object_purgeable)
-/* functions defined in MESA_remap_table_functions are excluded */
-static const struct gl_function_remap GL_APPLE_object_purgeable_functions[] = {
- { -1, -1 }
-};
-#endif
-
-#if defined(need_GL_APPLE_texture_range)
-/* functions defined in MESA_remap_table_functions are excluded */
-static const struct gl_function_remap GL_APPLE_texture_range_functions[] = {
- { -1, -1 }
-};
-#endif
-
-#if defined(need_GL_APPLE_vertex_array_object)
-/* functions defined in MESA_remap_table_functions are excluded */
-static const struct gl_function_remap GL_APPLE_vertex_array_object_functions[] = {
- { -1, -1 }
-};
-#endif
-
-#if defined(need_GL_ARB_ES2_compatibility)
-/* functions defined in MESA_remap_table_functions are excluded */
-static const struct gl_function_remap GL_ARB_ES2_compatibility_functions[] = {
- { -1, -1 }
-};
-#endif
-
-#if defined(need_GL_ARB_color_buffer_float)
-/* functions defined in MESA_remap_table_functions are excluded */
-static const struct gl_function_remap GL_ARB_color_buffer_float_functions[] = {
- { -1, -1 }
-};
-#endif
-
-#if defined(need_GL_ARB_copy_buffer)
-/* functions defined in MESA_remap_table_functions are excluded */
-static const struct gl_function_remap GL_ARB_copy_buffer_functions[] = {
- { -1, -1 }
-};
-#endif
-
-#if defined(need_GL_ARB_draw_buffers)
-/* functions defined in MESA_remap_table_functions are excluded */
-static const struct gl_function_remap GL_ARB_draw_buffers_functions[] = {
- { -1, -1 }
-};
-#endif
-
-#if defined(need_GL_ARB_draw_buffers_blend)
-/* functions defined in MESA_remap_table_functions are excluded */
-static const struct gl_function_remap GL_ARB_draw_buffers_blend_functions[] = {
- { -1, -1 }
-};
-#endif
-
-#if defined(need_GL_ARB_draw_elements_base_vertex)
-/* functions defined in MESA_remap_table_functions are excluded */
-static const struct gl_function_remap GL_ARB_draw_elements_base_vertex_functions[] = {
- { -1, -1 }
-};
-#endif
-
-#if defined(need_GL_ARB_draw_instanced)
-/* functions defined in MESA_remap_table_functions are excluded */
-static const struct gl_function_remap GL_ARB_draw_instanced_functions[] = {
- { -1, -1 }
-};
-#endif
-
-#if defined(need_GL_ARB_framebuffer_object)
-/* functions defined in MESA_remap_table_functions are excluded */
-static const struct gl_function_remap GL_ARB_framebuffer_object_functions[] = {
- { -1, -1 }
-};
-#endif
-
-#if defined(need_GL_ARB_geometry_shader4)
-/* functions defined in MESA_remap_table_functions are excluded */
-static const struct gl_function_remap GL_ARB_geometry_shader4_functions[] = {
- { 12834, -1 }, /* FramebufferTextureLayer */
- { -1, -1 }
-};
-#endif
-
-#if defined(need_GL_ARB_instanced_arrays)
-/* functions defined in MESA_remap_table_functions are excluded */
-static const struct gl_function_remap GL_ARB_instanced_arrays_functions[] = {
- { -1, -1 }
-};
-#endif
-
-#if defined(need_GL_ARB_map_buffer_range)
-/* functions defined in MESA_remap_table_functions are excluded */
-static const struct gl_function_remap GL_ARB_map_buffer_range_functions[] = {
- { -1, -1 }
-};
-#endif
-
-#if defined(need_GL_ARB_matrix_palette)
-static const struct gl_function_remap GL_ARB_matrix_palette_functions[] = {
- { 3927, -1 }, /* MatrixIndexusvARB */
- { 13583, -1 }, /* MatrixIndexuivARB */
- { 14948, -1 }, /* MatrixIndexPointerARB */
- { 20509, -1 }, /* CurrentPaletteMatrixARB */
- { 23668, -1 }, /* MatrixIndexubvARB */
- { -1, -1 }
-};
-#endif
-
-#if defined(need_GL_ARB_multisample)
-/* functions defined in MESA_remap_table_functions are excluded */
-static const struct gl_function_remap GL_ARB_multisample_functions[] = {
- { -1, -1 }
-};
-#endif
-
-#if defined(need_GL_ARB_occlusion_query)
-/* functions defined in MESA_remap_table_functions are excluded */
-static const struct gl_function_remap GL_ARB_occlusion_query_functions[] = {
- { -1, -1 }
-};
-#endif
-
-#if defined(need_GL_ARB_point_parameters)
-/* functions defined in MESA_remap_table_functions are excluded */
-static const struct gl_function_remap GL_ARB_point_parameters_functions[] = {
- { -1, -1 }
-};
-#endif
-
-#if defined(need_GL_ARB_provoking_vertex)
-/* functions defined in MESA_remap_table_functions are excluded */
-static const struct gl_function_remap GL_ARB_provoking_vertex_functions[] = {
- { -1, -1 }
-};
-#endif
-
-#if defined(need_GL_ARB_robustness)
-/* functions defined in MESA_remap_table_functions are excluded */
-static const struct gl_function_remap GL_ARB_robustness_functions[] = {
- { -1, -1 }
-};
-#endif
-
-#if defined(need_GL_ARB_sampler_objects)
-/* functions defined in MESA_remap_table_functions are excluded */
-static const struct gl_function_remap GL_ARB_sampler_objects_functions[] = {
- { -1, -1 }
-};
-#endif
-
-#if defined(need_GL_ARB_shader_objects)
-/* functions defined in MESA_remap_table_functions are excluded */
-static const struct gl_function_remap GL_ARB_shader_objects_functions[] = {
- { -1, -1 }
-};
-#endif
-
-#if defined(need_GL_ARB_sync)
-/* functions defined in MESA_remap_table_functions are excluded */
-static const struct gl_function_remap GL_ARB_sync_functions[] = {
- { -1, -1 }
-};
-#endif
-
-#if defined(need_GL_ARB_texture_buffer_object)
-/* functions defined in MESA_remap_table_functions are excluded */
-static const struct gl_function_remap GL_ARB_texture_buffer_object_functions[] = {
- { -1, -1 }
-};
-#endif
-
-#if defined(need_GL_ARB_texture_compression)
-/* functions defined in MESA_remap_table_functions are excluded */
-static const struct gl_function_remap GL_ARB_texture_compression_functions[] = {
- { -1, -1 }
-};
-#endif
-
-#if defined(need_GL_ARB_transform_feedback2)
-/* functions defined in MESA_remap_table_functions are excluded */
-static const struct gl_function_remap GL_ARB_transform_feedback2_functions[] = {
- { -1, -1 }
-};
-#endif
-
-#if defined(need_GL_ARB_transpose_matrix)
-/* functions defined in MESA_remap_table_functions are excluded */
-static const struct gl_function_remap GL_ARB_transpose_matrix_functions[] = {
- { -1, -1 }
-};
-#endif
-
-#if defined(need_GL_ARB_vertex_array_object)
-/* functions defined in MESA_remap_table_functions are excluded */
-static const struct gl_function_remap GL_ARB_vertex_array_object_functions[] = {
- { -1, -1 }
-};
-#endif
-
-#if defined(need_GL_ARB_vertex_blend)
-static const struct gl_function_remap GL_ARB_vertex_blend_functions[] = {
- { 2508, -1 }, /* WeightubvARB */
- { 6917, -1 }, /* WeightivARB */
- { 11484, -1 }, /* WeightPointerARB */
- { 14318, -1 }, /* WeightfvARB */
- { 18120, -1 }, /* WeightbvARB */
- { 21739, -1 }, /* WeightusvARB */
- { 24786, -1 }, /* VertexBlendARB */
- { 30595, -1 }, /* WeightsvARB */
- { 32661, -1 }, /* WeightdvARB */
- { 33471, -1 }, /* WeightuivARB */
- { -1, -1 }
-};
-#endif
-
-#if defined(need_GL_ARB_vertex_buffer_object)
-/* functions defined in MESA_remap_table_functions are excluded */
-static const struct gl_function_remap GL_ARB_vertex_buffer_object_functions[] = {
- { -1, -1 }
-};
-#endif
-
-#if defined(need_GL_ARB_vertex_program)
-/* functions defined in MESA_remap_table_functions are excluded */
-static const struct gl_function_remap GL_ARB_vertex_program_functions[] = {
- { -1, -1 }
-};
-#endif
-
-#if defined(need_GL_ARB_vertex_shader)
-/* functions defined in MESA_remap_table_functions are excluded */
-static const struct gl_function_remap GL_ARB_vertex_shader_functions[] = {
- { -1, -1 }
-};
-#endif
-
-#if defined(need_GL_ARB_window_pos)
-/* functions defined in MESA_remap_table_functions are excluded */
-static const struct gl_function_remap GL_ARB_window_pos_functions[] = {
- { -1, -1 }
-};
-#endif
-
-#if defined(need_GL_ATI_blend_equation_separate)
-/* functions defined in MESA_remap_table_functions are excluded */
-static const struct gl_function_remap GL_ATI_blend_equation_separate_functions[] = {
- { -1, -1 }
-};
-#endif
-
-#if defined(need_GL_ATI_draw_buffers)
-/* functions defined in MESA_remap_table_functions are excluded */
-static const struct gl_function_remap GL_ATI_draw_buffers_functions[] = {
- { -1, -1 }
-};
-#endif
-
-#if defined(need_GL_ATI_envmap_bumpmap)
-/* functions defined in MESA_remap_table_functions are excluded */
-static const struct gl_function_remap GL_ATI_envmap_bumpmap_functions[] = {
- { -1, -1 }
-};
-#endif
-
-#if defined(need_GL_ATI_fragment_shader)
-/* functions defined in MESA_remap_table_functions are excluded */
-static const struct gl_function_remap GL_ATI_fragment_shader_functions[] = {
- { -1, -1 }
-};
-#endif
-
-#if defined(need_GL_ATI_separate_stencil)
-/* functions defined in MESA_remap_table_functions are excluded */
-static const struct gl_function_remap GL_ATI_separate_stencil_functions[] = {
- { -1, -1 }
-};
-#endif
-
-#if defined(need_GL_EXT_blend_color)
-static const struct gl_function_remap GL_EXT_blend_color_functions[] = {
- { 2767, _gloffset_BlendColor },
- { -1, -1 }
-};
-#endif
-
-#if defined(need_GL_EXT_blend_equation_separate)
-/* functions defined in MESA_remap_table_functions are excluded */
-static const struct gl_function_remap GL_EXT_blend_equation_separate_functions[] = {
- { -1, -1 }
-};
-#endif
-
-#if defined(need_GL_EXT_blend_func_separate)
-/* functions defined in MESA_remap_table_functions are excluded */
-static const struct gl_function_remap GL_EXT_blend_func_separate_functions[] = {
- { -1, -1 }
-};
-#endif
-
-#if defined(need_GL_EXT_blend_minmax)
-static const struct gl_function_remap GL_EXT_blend_minmax_functions[] = {
- { 11619, _gloffset_BlendEquation },
- { -1, -1 }
-};
-#endif
-
-#if defined(need_GL_EXT_color_subtable)
-static const struct gl_function_remap GL_EXT_color_subtable_functions[] = {
- { 17520, _gloffset_ColorSubTable },
- { 32611, _gloffset_CopyColorSubTable },
- { -1, -1 }
-};
-#endif
-
-#if defined(need_GL_EXT_compiled_vertex_array)
-/* functions defined in MESA_remap_table_functions are excluded */
-static const struct gl_function_remap GL_EXT_compiled_vertex_array_functions[] = {
- { -1, -1 }
-};
-#endif
-
-#if defined(need_GL_EXT_convolution)
-static const struct gl_function_remap GL_EXT_convolution_functions[] = {
- { 296, _gloffset_ConvolutionFilter1D },
- { 2566, _gloffset_CopyConvolutionFilter1D },
- { 4293, _gloffset_GetConvolutionParameteriv },
- { 8866, _gloffset_ConvolutionFilter2D },
- { 9068, _gloffset_ConvolutionParameteriv },
- { 9528, _gloffset_ConvolutionParameterfv },
- { 21275, _gloffset_GetSeparableFilter },
- { 24860, _gloffset_SeparableFilter2D },
- { 25723, _gloffset_ConvolutionParameteri },
- { 25891, _gloffset_ConvolutionParameterf },
- { 27605, _gloffset_GetConvolutionParameterfv },
- { 28494, _gloffset_GetConvolutionFilter },
- { 31009, _gloffset_CopyConvolutionFilter2D },
- { -1, -1 }
-};
-#endif
-
-#if defined(need_GL_EXT_coordinate_frame)
-static const struct gl_function_remap GL_EXT_coordinate_frame_functions[] = {
- { 10918, -1 }, /* TangentPointerEXT */
- { 12989, -1 }, /* Binormal3ivEXT */
- { 13715, -1 }, /* Tangent3sEXT */
- { 15013, -1 }, /* Tangent3fvEXT */
- { 19188, -1 }, /* Tangent3ivEXT */
- { 19415, -1 }, /* Tangent3dvEXT */
- { 20189, -1 }, /* Binormal3bvEXT */
- { 21328, -1 }, /* Binormal3dEXT */
- { 23600, -1 }, /* Tangent3fEXT */
- { 25795, -1 }, /* Binormal3sEXT */
- { 26337, -1 }, /* Tangent3dEXT */
- { 27284, -1 }, /* Binormal3svEXT */
- { 27917, -1 }, /* Binormal3fEXT */
- { 28825, -1 }, /* Binormal3dvEXT */
- { 30144, -1 }, /* Tangent3iEXT */
- { 31294, -1 }, /* Tangent3bvEXT */
- { 31859, -1 }, /* Tangent3bEXT */
- { 32384, -1 }, /* Binormal3fvEXT */
- { 33170, -1 }, /* BinormalPointerEXT */
- { 33651, -1 }, /* Tangent3svEXT */
- { 34088, -1 }, /* Binormal3bEXT */
- { 34265, -1 }, /* Binormal3iEXT */
- { -1, -1 }
-};
-#endif
-
-#if defined(need_GL_EXT_copy_texture)
-static const struct gl_function_remap GL_EXT_copy_texture_functions[] = {
- { 15538, _gloffset_CopyTexSubImage3D },
- { 17207, _gloffset_CopyTexImage2D },
- { 25331, _gloffset_CopyTexImage1D },
- { 28175, _gloffset_CopyTexSubImage2D },
- { 30647, _gloffset_CopyTexSubImage1D },
- { -1, -1 }
-};
-#endif
-
-#if defined(need_GL_EXT_cull_vertex)
-static const struct gl_function_remap GL_EXT_cull_vertex_functions[] = {
- { 9217, -1 }, /* CullParameterdvEXT */
- { 12107, -1 }, /* CullParameterfvEXT */
- { -1, -1 }
-};
-#endif
-
-#if defined(need_GL_EXT_depth_bounds_test)
-/* functions defined in MESA_remap_table_functions are excluded */
-static const struct gl_function_remap GL_EXT_depth_bounds_test_functions[] = {
- { -1, -1 }
-};
-#endif
-
-#if defined(need_GL_EXT_draw_buffers2)
-/* functions defined in MESA_remap_table_functions are excluded */
-static const struct gl_function_remap GL_EXT_draw_buffers2_functions[] = {
- { -1, -1 }
-};
-#endif
-
-#if defined(need_GL_EXT_draw_instanced)
-/* functions defined in MESA_remap_table_functions are excluded */
-static const struct gl_function_remap GL_EXT_draw_instanced_functions[] = {
- { -1, -1 }
-};
-#endif
-
-#if defined(need_GL_EXT_draw_range_elements)
-static const struct gl_function_remap GL_EXT_draw_range_elements_functions[] = {
- { 9865, _gloffset_DrawRangeElements },
- { -1, -1 }
-};
-#endif
-
-#if defined(need_GL_EXT_fog_coord)
-/* functions defined in MESA_remap_table_functions are excluded */
-static const struct gl_function_remap GL_EXT_fog_coord_functions[] = {
- { -1, -1 }
-};
-#endif
-
-#if defined(need_GL_EXT_framebuffer_blit)
-/* functions defined in MESA_remap_table_functions are excluded */
-static const struct gl_function_remap GL_EXT_framebuffer_blit_functions[] = {
- { -1, -1 }
-};
-#endif
-
-#if defined(need_GL_EXT_framebuffer_multisample)
-/* functions defined in MESA_remap_table_functions are excluded */
-static const struct gl_function_remap GL_EXT_framebuffer_multisample_functions[] = {
- { -1, -1 }
-};
-#endif
-
-#if defined(need_GL_EXT_framebuffer_object)
-/* functions defined in MESA_remap_table_functions are excluded */
-static const struct gl_function_remap GL_EXT_framebuffer_object_functions[] = {
- { -1, -1 }
-};
-#endif
-
-#if defined(need_GL_EXT_gpu_program_parameters)
-/* functions defined in MESA_remap_table_functions are excluded */
-static const struct gl_function_remap GL_EXT_gpu_program_parameters_functions[] = {
- { -1, -1 }
-};
-#endif
-
-#if defined(need_GL_EXT_gpu_shader4)
-/* functions defined in MESA_remap_table_functions are excluded */
-static const struct gl_function_remap GL_EXT_gpu_shader4_functions[] = {
- { -1, -1 }
-};
-#endif
-
-#if defined(need_GL_EXT_histogram)
-static const struct gl_function_remap GL_EXT_histogram_functions[] = {
- { 895, _gloffset_Histogram },
- { 3676, _gloffset_ResetHistogram },
- { 10370, _gloffset_GetMinmax },
- { 15872, _gloffset_GetHistogramParameterfv },
- { 25256, _gloffset_GetMinmaxParameteriv },
- { 27495, _gloffset_ResetMinmax },
- { 28391, _gloffset_GetHistogramParameteriv },
- { 29612, _gloffset_GetHistogram },
- { 32236, _gloffset_Minmax },
- { 33886, _gloffset_GetMinmaxParameterfv },
- { -1, -1 }
-};
-#endif
-
-#if defined(need_GL_EXT_index_func)
-static const struct gl_function_remap GL_EXT_index_func_functions[] = {
- { 11893, -1 }, /* IndexFuncEXT */
- { -1, -1 }
-};
-#endif
-
-#if defined(need_GL_EXT_index_material)
-static const struct gl_function_remap GL_EXT_index_material_functions[] = {
- { 21861, -1 }, /* IndexMaterialEXT */
- { -1, -1 }
-};
-#endif
-
-#if defined(need_GL_EXT_light_texture)
-static const struct gl_function_remap GL_EXT_light_texture_functions[] = {
- { 27304, -1 }, /* ApplyTextureEXT */
- { 27449, -1 }, /* TextureMaterialEXT */
- { 27474, -1 }, /* TextureLightEXT */
- { -1, -1 }
-};
-#endif
-
-#if defined(need_GL_EXT_multi_draw_arrays)
-/* functions defined in MESA_remap_table_functions are excluded */
-static const struct gl_function_remap GL_EXT_multi_draw_arrays_functions[] = {
- { -1, -1 }
-};
-#endif
-
-#if defined(need_GL_EXT_multisample)
-/* functions defined in MESA_remap_table_functions are excluded */
-static const struct gl_function_remap GL_EXT_multisample_functions[] = {
- { -1, -1 }
-};
-#endif
-
-#if defined(need_GL_EXT_paletted_texture)
-static const struct gl_function_remap GL_EXT_paletted_texture_functions[] = {
- { 8728, _gloffset_ColorTable },
- { 15718, _gloffset_GetColorTable },
- { 23783, _gloffset_GetColorTableParameterfv },
- { 25947, _gloffset_GetColorTableParameteriv },
- { -1, -1 }
-};
-#endif
-
-#if defined(need_GL_EXT_pixel_transform)
-static const struct gl_function_remap GL_EXT_pixel_transform_functions[] = {
- { 22508, -1 }, /* PixelTransformParameterfEXT */
- { 22588, -1 }, /* PixelTransformParameteriEXT */
- { 31574, -1 }, /* PixelTransformParameterfvEXT */
- { 33134, -1 }, /* PixelTransformParameterivEXT */
- { -1, -1 }
-};
-#endif
-
-#if defined(need_GL_EXT_point_parameters)
-/* functions defined in MESA_remap_table_functions are excluded */
-static const struct gl_function_remap GL_EXT_point_parameters_functions[] = {
- { -1, -1 }
-};
-#endif
-
-#if defined(need_GL_EXT_polygon_offset)
-/* functions defined in MESA_remap_table_functions are excluded */
-static const struct gl_function_remap GL_EXT_polygon_offset_functions[] = {
- { -1, -1 }
-};
-#endif
-
-#if defined(need_GL_EXT_provoking_vertex)
-/* functions defined in MESA_remap_table_functions are excluded */
-static const struct gl_function_remap GL_EXT_provoking_vertex_functions[] = {
- { -1, -1 }
-};
-#endif
-
-#if defined(need_GL_EXT_secondary_color)
-/* functions defined in MESA_remap_table_functions are excluded */
-static const struct gl_function_remap GL_EXT_secondary_color_functions[] = {
- { -1, -1 }
-};
-#endif
-
-#if defined(need_GL_EXT_separate_shader_objects)
-/* functions defined in MESA_remap_table_functions are excluded */
-static const struct gl_function_remap GL_EXT_separate_shader_objects_functions[] = {
- { -1, -1 }
-};
-#endif
-
-#if defined(need_GL_EXT_stencil_two_side)
-/* functions defined in MESA_remap_table_functions are excluded */
-static const struct gl_function_remap GL_EXT_stencil_two_side_functions[] = {
- { -1, -1 }
-};
-#endif
-
-#if defined(need_GL_EXT_subtexture)
-static const struct gl_function_remap GL_EXT_subtexture_functions[] = {
- { 7439, _gloffset_TexSubImage1D },
- { 11074, _gloffset_TexSubImage2D },
- { -1, -1 }
-};
-#endif
-
-#if defined(need_GL_EXT_texture3D)
-static const struct gl_function_remap GL_EXT_texture3D_functions[] = {
- { 1865, _gloffset_TexImage3D },
- { 23552, _gloffset_TexSubImage3D },
- { -1, -1 }
-};
-#endif
-
-#if defined(need_GL_EXT_texture_array)
-/* functions defined in MESA_remap_table_functions are excluded */
-static const struct gl_function_remap GL_EXT_texture_array_functions[] = {
- { -1, -1 }
-};
-#endif
-
-#if defined(need_GL_EXT_texture_integer)
-/* functions defined in MESA_remap_table_functions are excluded */
-static const struct gl_function_remap GL_EXT_texture_integer_functions[] = {
- { -1, -1 }
-};
-#endif
-
-#if defined(need_GL_EXT_texture_object)
-static const struct gl_function_remap GL_EXT_texture_object_functions[] = {
- { 3444, _gloffset_PrioritizeTextures },
- { 7888, _gloffset_AreTexturesResident },
- { 14058, _gloffset_GenTextures },
- { 16231, _gloffset_DeleteTextures },
- { 20242, _gloffset_IsTexture },
- { 30712, _gloffset_BindTexture },
- { -1, -1 }
-};
-#endif
-
-#if defined(need_GL_EXT_texture_perturb_normal)
-static const struct gl_function_remap GL_EXT_texture_perturb_normal_functions[] = {
- { 14268, -1 }, /* TextureNormalEXT */
- { -1, -1 }
-};
-#endif
-
-#if defined(need_GL_EXT_timer_query)
-/* functions defined in MESA_remap_table_functions are excluded */
-static const struct gl_function_remap GL_EXT_timer_query_functions[] = {
- { -1, -1 }
-};
-#endif
-
-#if defined(need_GL_EXT_transform_feedback)
-/* functions defined in MESA_remap_table_functions are excluded */
-static const struct gl_function_remap GL_EXT_transform_feedback_functions[] = {
- { -1, -1 }
-};
-#endif
-
-#if defined(need_GL_EXT_vertex_array)
-/* functions defined in MESA_remap_table_functions are excluded */
-static const struct gl_function_remap GL_EXT_vertex_array_functions[] = {
- { 25032, _gloffset_ArrayElement },
- { 31824, _gloffset_GetPointerv },
- { 33437, _gloffset_DrawArrays },
- { -1, -1 }
-};
-#endif
-
-#if defined(need_GL_EXT_vertex_weighting)
-static const struct gl_function_remap GL_EXT_vertex_weighting_functions[] = {
- { 20290, -1 }, /* VertexWeightfvEXT */
- { 27860, -1 }, /* VertexWeightfEXT */
- { 29581, -1 }, /* VertexWeightPointerEXT */
- { -1, -1 }
-};
-#endif
-
-#if defined(need_GL_HP_image_transform)
-static const struct gl_function_remap GL_HP_image_transform_functions[] = {
- { 2439, -1 }, /* GetImageTransformParameterfvHP */
- { 3893, -1 }, /* ImageTransformParameterfHP */
- { 10612, -1 }, /* ImageTransformParameterfvHP */
- { 12354, -1 }, /* ImageTransformParameteriHP */
- { 12724, -1 }, /* GetImageTransformParameterivHP */
- { 20354, -1 }, /* ImageTransformParameterivHP */
- { -1, -1 }
-};
-#endif
-
-#if defined(need_GL_IBM_multimode_draw_arrays)
-/* functions defined in MESA_remap_table_functions are excluded */
-static const struct gl_function_remap GL_IBM_multimode_draw_arrays_functions[] = {
- { -1, -1 }
-};
-#endif
-
-#if defined(need_GL_IBM_vertex_array_lists)
-static const struct gl_function_remap GL_IBM_vertex_array_lists_functions[] = {
- { 4583, -1 }, /* SecondaryColorPointerListIBM */
- { 6371, -1 }, /* NormalPointerListIBM */
- { 8062, -1 }, /* FogCoordPointerListIBM */
- { 8403, -1 }, /* VertexPointerListIBM */
- { 12608, -1 }, /* ColorPointerListIBM */
- { 13822, -1 }, /* TexCoordPointerListIBM */
- { 14290, -1 }, /* IndexPointerListIBM */
- { 33829, -1 }, /* EdgeFlagPointerListIBM */
- { -1, -1 }
-};
-#endif
-
-#if defined(need_GL_INGR_blend_func_separate)
-/* functions defined in MESA_remap_table_functions are excluded */
-static const struct gl_function_remap GL_INGR_blend_func_separate_functions[] = {
- { -1, -1 }
-};
-#endif
-
-#if defined(need_GL_INTEL_parallel_arrays)
-static const struct gl_function_remap GL_INTEL_parallel_arrays_functions[] = {
- { 13162, -1 }, /* VertexPointervINTEL */
- { 15965, -1 }, /* ColorPointervINTEL */
- { 30983, -1 }, /* NormalPointervINTEL */
- { 31506, -1 }, /* TexCoordPointervINTEL */
- { -1, -1 }
-};
-#endif
-
-#if defined(need_GL_MESA_resize_buffers)
-/* functions defined in MESA_remap_table_functions are excluded */
-static const struct gl_function_remap GL_MESA_resize_buffers_functions[] = {
- { -1, -1 }
-};
-#endif
-
-#if defined(need_GL_MESA_shader_debug)
-static const struct gl_function_remap GL_MESA_shader_debug_functions[] = {
- { 1729, -1 }, /* GetDebugLogLengthMESA */
- { 3615, -1 }, /* ClearDebugLogMESA */
- { 4768, -1 }, /* GetDebugLogMESA */
- { 32017, -1 }, /* CreateDebugObjectMESA */
- { -1, -1 }
-};
-#endif
-
-#if defined(need_GL_MESA_window_pos)
-/* functions defined in MESA_remap_table_functions are excluded */
-static const struct gl_function_remap GL_MESA_window_pos_functions[] = {
- { -1, -1 }
-};
-#endif
-
-#if defined(need_GL_NV_condtitional_render)
-/* functions defined in MESA_remap_table_functions are excluded */
-static const struct gl_function_remap GL_NV_condtitional_render_functions[] = {
- { -1, -1 }
-};
-#endif
-
-#if defined(need_GL_NV_evaluators)
-static const struct gl_function_remap GL_NV_evaluators_functions[] = {
- { 7101, -1 }, /* GetMapAttribParameterivNV */
- { 8834, -1 }, /* MapControlPointsNV */
- { 8933, -1 }, /* MapParameterfvNV */
- { 11057, -1 }, /* EvalMapsNV */
- { 17718, -1 }, /* GetMapAttribParameterfvNV */
- { 17935, -1 }, /* MapParameterivNV */
- { 25646, -1 }, /* GetMapParameterivNV */
- { 26189, -1 }, /* GetMapParameterfvNV */
- { 30298, -1 }, /* GetMapControlPointsNV */
- { -1, -1 }
-};
-#endif
-
-#if defined(need_GL_NV_fence)
-/* functions defined in MESA_remap_table_functions are excluded */
-static const struct gl_function_remap GL_NV_fence_functions[] = {
- { -1, -1 }
-};
-#endif
-
-#if defined(need_GL_NV_fragment_program)
-/* functions defined in MESA_remap_table_functions are excluded */
-static const struct gl_function_remap GL_NV_fragment_program_functions[] = {
- { -1, -1 }
-};
-#endif
-
-#if defined(need_GL_NV_point_sprite)
-/* functions defined in MESA_remap_table_functions are excluded */
-static const struct gl_function_remap GL_NV_point_sprite_functions[] = {
- { -1, -1 }
-};
-#endif
-
-#if defined(need_GL_NV_primitive_restart)
-/* functions defined in MESA_remap_table_functions are excluded */
-static const struct gl_function_remap GL_NV_primitive_restart_functions[] = {
- { -1, -1 }
-};
-#endif
-
-#if defined(need_GL_NV_register_combiners)
-/* functions defined in MESA_remap_table_functions are excluded */
-static const struct gl_function_remap GL_NV_register_combiners_functions[] = {
- { -1, -1 }
-};
-#endif
-
-#if defined(need_GL_NV_register_combiners2)
-static const struct gl_function_remap GL_NV_register_combiners2_functions[] = {
- { 16384, -1 }, /* CombinerStageParameterfvNV */
- { 16780, -1 }, /* GetCombinerStageParameterfvNV */
- { -1, -1 }
-};
-#endif
-
-#if defined(need_GL_NV_texture_barrier)
-/* functions defined in MESA_remap_table_functions are excluded */
-static const struct gl_function_remap GL_NV_texture_barrier_functions[] = {
- { -1, -1 }
-};
-#endif
-
-#if defined(need_GL_NV_vertex_array_range)
-/* functions defined in MESA_remap_table_functions are excluded */
-static const struct gl_function_remap GL_NV_vertex_array_range_functions[] = {
- { -1, -1 }
-};
-#endif
-
-#if defined(need_GL_NV_vertex_program)
-/* functions defined in MESA_remap_table_functions are excluded */
-static const struct gl_function_remap GL_NV_vertex_program_functions[] = {
- { -1, -1 }
-};
-#endif
-
-#if defined(need_GL_OES_EGL_image)
-/* functions defined in MESA_remap_table_functions are excluded */
-static const struct gl_function_remap GL_OES_EGL_image_functions[] = {
- { -1, -1 }
-};
-#endif
-
-#if defined(need_GL_PGI_misc_hints)
-static const struct gl_function_remap GL_PGI_misc_hints_functions[] = {
- { 9054, -1 }, /* HintPGI */
- { -1, -1 }
-};
-#endif
-
-#if defined(need_GL_SGIS_detail_texture)
-static const struct gl_function_remap GL_SGIS_detail_texture_functions[] = {
- { 16753, -1 }, /* GetDetailTexFuncSGIS */
- { 17152, -1 }, /* DetailTexFuncSGIS */
- { -1, -1 }
-};
-#endif
-
-#if defined(need_GL_SGIS_fog_function)
-static const struct gl_function_remap GL_SGIS_fog_function_functions[] = {
- { 28157, -1 }, /* FogFuncSGIS */
- { 28930, -1 }, /* GetFogFuncSGIS */
- { -1, -1 }
-};
-#endif
-
-#if defined(need_GL_SGIS_multisample)
-/* functions defined in MESA_remap_table_functions are excluded */
-static const struct gl_function_remap GL_SGIS_multisample_functions[] = {
- { -1, -1 }
-};
-#endif
-
-#if defined(need_GL_SGIS_pixel_texture)
-/* functions defined in MESA_remap_table_functions are excluded */
-static const struct gl_function_remap GL_SGIS_pixel_texture_functions[] = {
- { -1, -1 }
-};
-#endif
-
-#if defined(need_GL_SGIS_point_parameters)
-/* functions defined in MESA_remap_table_functions are excluded */
-static const struct gl_function_remap GL_SGIS_point_parameters_functions[] = {
- { -1, -1 }
-};
-#endif
-
-#if defined(need_GL_SGIS_sharpen_texture)
-static const struct gl_function_remap GL_SGIS_sharpen_texture_functions[] = {
- { 7162, -1 }, /* GetSharpenTexFuncSGIS */
- { 22894, -1 }, /* SharpenTexFuncSGIS */
- { -1, -1 }
-};
-#endif
-
-#if defined(need_GL_SGIS_texture4D)
-static const struct gl_function_remap GL_SGIS_texture4D_functions[] = {
- { 1034, -1 }, /* TexImage4DSGIS */
- { 16300, -1 }, /* TexSubImage4DSGIS */
- { -1, -1 }
-};
-#endif
-
-#if defined(need_GL_SGIS_texture_color_mask)
-static const struct gl_function_remap GL_SGIS_texture_color_mask_functions[] = {
- { 15671, -1 }, /* TextureColorMaskSGIS */
- { -1, -1 }
-};
-#endif
-
-#if defined(need_GL_SGIS_texture_filter4)
-static const struct gl_function_remap GL_SGIS_texture_filter4_functions[] = {
- { 7339, -1 }, /* GetTexFilterFuncSGIS */
- { 16926, -1 }, /* TexFilterFuncSGIS */
- { -1, -1 }
-};
-#endif
-
-#if defined(need_GL_SGIX_async)
-static const struct gl_function_remap GL_SGIX_async_functions[] = {
- { 3541, -1 }, /* AsyncMarkerSGIX */
- { 4722, -1 }, /* FinishAsyncSGIX */
- { 5794, -1 }, /* PollAsyncSGIX */
- { 23103, -1 }, /* DeleteAsyncMarkersSGIX */
- { 23158, -1 }, /* IsAsyncMarkerSGIX */
- { 33626, -1 }, /* GenAsyncMarkersSGIX */
- { -1, -1 }
-};
-#endif
-
-#if defined(need_GL_SGIX_flush_raster)
-static const struct gl_function_remap GL_SGIX_flush_raster_functions[] = {
- { 7716, -1 }, /* FlushRasterSGIX */
- { -1, -1 }
-};
-#endif
-
-#if defined(need_GL_SGIX_fragment_lighting)
-static const struct gl_function_remap GL_SGIX_fragment_lighting_functions[] = {
- { 2737, -1 }, /* FragmentMaterialfvSGIX */
- { 5698, -1 }, /* FragmentLightiSGIX */
- { 8470, -1 }, /* FragmentMaterialfSGIX */
- { 8607, -1 }, /* GetFragmentLightivSGIX */
- { 9480, -1 }, /* FragmentLightModeliSGIX */
- { 11120, -1 }, /* FragmentLightivSGIX */
- { 11427, -1 }, /* GetFragmentMaterialivSGIX */
- { 16693, -1 }, /* GetFragmentMaterialfvSGIX */
- { 20159, -1 }, /* FragmentLightModelfSGIX */
- { 20477, -1 }, /* FragmentColorMaterialSGIX */
- { 20894, -1 }, /* FragmentMaterialiSGIX */
- { 22189, -1 }, /* LightEnviSGIX */
- { 23875, -1 }, /* FragmentLightModelfvSGIX */
- { 24210, -1 }, /* FragmentLightfvSGIX */
- { 29314, -1 }, /* FragmentLightModelivSGIX */
- { 29463, -1 }, /* FragmentLightfSGIX */
- { 32354, -1 }, /* GetFragmentLightfvSGIX */
- { 34109, -1 }, /* FragmentMaterialivSGIX */
- { -1, -1 }
-};
-#endif
-
-#if defined(need_GL_SGIX_framezoom)
-static const struct gl_function_remap GL_SGIX_framezoom_functions[] = {
- { 23181, -1 }, /* FrameZoomSGIX */
- { -1, -1 }
-};
-#endif
-
-#if defined(need_GL_SGIX_igloo_interface)
-static const struct gl_function_remap GL_SGIX_igloo_interface_functions[] = {
- { 29771, -1 }, /* IglooInterfaceSGIX */
- { -1, -1 }
-};
-#endif
-
-#if defined(need_GL_SGIX_instruments)
-static const struct gl_function_remap GL_SGIX_instruments_functions[] = {
- { 2917, -1 }, /* ReadInstrumentsSGIX */
- { 6935, -1 }, /* PollInstrumentsSGIX */
- { 10978, -1 }, /* GetInstrumentsSGIX */
- { 13420, -1 }, /* StartInstrumentsSGIX */
- { 16418, -1 }, /* StopInstrumentsSGIX */
- { 18383, -1 }, /* InstrumentsBufferSGIX */
- { -1, -1 }
-};
-#endif
-
-#if defined(need_GL_SGIX_list_priority)
-static const struct gl_function_remap GL_SGIX_list_priority_functions[] = {
- { 1265, -1 }, /* ListParameterfSGIX */
- { 3243, -1 }, /* GetListParameterfvSGIX */
- { 18248, -1 }, /* ListParameteriSGIX */
- { 19365, -1 }, /* ListParameterfvSGIX */
- { 21560, -1 }, /* ListParameterivSGIX */
- { 33670, -1 }, /* GetListParameterivSGIX */
- { -1, -1 }
-};
-#endif
-
-#if defined(need_GL_SGIX_pixel_texture)
-/* functions defined in MESA_remap_table_functions are excluded */
-static const struct gl_function_remap GL_SGIX_pixel_texture_functions[] = {
- { -1, -1 }
-};
-#endif
-
-#if defined(need_GL_SGIX_polynomial_ffd)
-static const struct gl_function_remap GL_SGIX_polynomial_ffd_functions[] = {
- { 2959, -1 }, /* DeformationMap3dSGIX */
- { 3839, -1 }, /* LoadIdentityDeformationMapSGIX */
- { 16518, -1 }, /* DeformSGIX */
- { 25144, -1 }, /* DeformationMap3fSGIX */
- { -1, -1 }
-};
-#endif
-
-#if defined(need_GL_SGIX_reference_plane)
-static const struct gl_function_remap GL_SGIX_reference_plane_functions[] = {
- { 15222, -1 }, /* ReferencePlaneSGIX */
- { -1, -1 }
-};
-#endif
-
-#if defined(need_GL_SGIX_sprite)
-static const struct gl_function_remap GL_SGIX_sprite_functions[] = {
- { 9978, -1 }, /* SpriteParameterfvSGIX */
- { 21349, -1 }, /* SpriteParameteriSGIX */
- { 27529, -1 }, /* SpriteParameterfSGIX */
- { 30441, -1 }, /* SpriteParameterivSGIX */
- { -1, -1 }
-};
-#endif
-
-#if defined(need_GL_SGIX_tag_sample_buffer)
-static const struct gl_function_remap GL_SGIX_tag_sample_buffer_functions[] = {
- { 21408, -1 }, /* TagSampleBufferSGIX */
- { -1, -1 }
-};
-#endif
-
-#if defined(need_GL_SGI_color_table)
-static const struct gl_function_remap GL_SGI_color_table_functions[] = {
- { 8006, _gloffset_ColorTableParameteriv },
- { 8728, _gloffset_ColorTable },
- { 15718, _gloffset_GetColorTable },
- { 15828, _gloffset_CopyColorTable },
- { 20103, _gloffset_ColorTableParameterfv },
- { 23783, _gloffset_GetColorTableParameterfv },
- { 25947, _gloffset_GetColorTableParameteriv },
- { -1, -1 }
-};
-#endif
-
-#if defined(need_GL_SUNX_constant_data)
-static const struct gl_function_remap GL_SUNX_constant_data_functions[] = {
- { 32332, -1 }, /* FinishTextureSUNX */
- { -1, -1 }
-};
-#endif
-
-#if defined(need_GL_SUN_global_alpha)
-static const struct gl_function_remap GL_SUN_global_alpha_functions[] = {
- { 3562, -1 }, /* GlobalAlphaFactorubSUN */
- { 5075, -1 }, /* GlobalAlphaFactoriSUN */
- { 6960, -1 }, /* GlobalAlphaFactordSUN */
- { 10062, -1 }, /* GlobalAlphaFactoruiSUN */
- { 10569, -1 }, /* GlobalAlphaFactorbSUN */
- { 13735, -1 }, /* GlobalAlphaFactorfSUN */
- { 13899, -1 }, /* GlobalAlphaFactorusSUN */
- { 23470, -1 }, /* GlobalAlphaFactorsSUN */
- { -1, -1 }
-};
-#endif
-
-#if defined(need_GL_SUN_mesh_array)
-static const struct gl_function_remap GL_SUN_mesh_array_functions[] = {
- { 30232, -1 }, /* DrawMeshArraysSUN */
- { -1, -1 }
-};
-#endif
-
-#if defined(need_GL_SUN_triangle_list)
-static const struct gl_function_remap GL_SUN_triangle_list_functions[] = {
- { 4696, -1 }, /* ReplacementCodeubSUN */
- { 6719, -1 }, /* ReplacementCodeubvSUN */
- { 19824, -1 }, /* ReplacementCodeusvSUN */
- { 20012, -1 }, /* ReplacementCodePointerSUN */
- { 22253, -1 }, /* ReplacementCodeuiSUN */
- { 23132, -1 }, /* ReplacementCodeusSUN */
- { 30898, -1 }, /* ReplacementCodeuivSUN */
- { -1, -1 }
-};
-#endif
-
-#if defined(need_GL_SUN_vertex)
-static const struct gl_function_remap GL_SUN_vertex_functions[] = {
- { 1139, -1 }, /* ReplacementCodeuiColor3fVertex3fvSUN */
- { 1337, -1 }, /* TexCoord4fColor4fNormal3fVertex4fvSUN */
- { 1591, -1 }, /* TexCoord2fColor4ubVertex3fvSUN */
- { 1960, -1 }, /* ReplacementCodeuiVertex3fvSUN */
- { 2094, -1 }, /* ReplacementCodeuiTexCoord2fVertex3fvSUN */
- { 2673, -1 }, /* ReplacementCodeuiNormal3fVertex3fSUN */
- { 3052, -1 }, /* Color4ubVertex3fvSUN */
- { 4880, -1 }, /* Color4ubVertex3fSUN */
- { 5003, -1 }, /* TexCoord2fVertex3fSUN */
- { 5421, -1 }, /* TexCoord2fColor4fNormal3fVertex3fSUN */
- { 5898, -1 }, /* TexCoord2fNormal3fVertex3fvSUN */
- { 6614, -1 }, /* ReplacementCodeuiTexCoord2fNormal3fVertex3fSUN */
- { 7394, -1 }, /* ReplacementCodeuiColor4ubVertex3fvSUN */
- { 7753, -1 }, /* ReplacementCodeuiTexCoord2fVertex3fSUN */
- { 9279, -1 }, /* Color3fVertex3fSUN */
- { 10478, -1 }, /* Color3fVertex3fvSUN */
- { 10943, -1 }, /* Color4fNormal3fVertex3fvSUN */
- { 11772, -1 }, /* ReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN */
- { 13283, -1 }, /* ReplacementCodeuiColor4fNormal3fVertex3fvSUN */
- { 14838, -1 }, /* ReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN */
- { 15364, -1 }, /* TexCoord2fColor3fVertex3fSUN */
- { 16443, -1 }, /* TexCoord4fColor4fNormal3fVertex4fSUN */
- { 16885, -1 }, /* Color4ubVertex2fvSUN */
- { 17177, -1 }, /* Normal3fVertex3fSUN */
- { 18324, -1 }, /* ReplacementCodeuiColor4fNormal3fVertex3fSUN */
- { 18676, -1 }, /* TexCoord2fColor4fNormal3fVertex3fvSUN */
- { 18983, -1 }, /* TexCoord2fNormal3fVertex3fSUN */
- { 19617, -1 }, /* TexCoord2fVertex3fvSUN */
- { 20447, -1 }, /* Color4ubVertex2fSUN */
- { 20685, -1 }, /* ReplacementCodeuiColor4ubVertex3fSUN */
- { 22719, -1 }, /* TexCoord2fColor4ubVertex3fSUN */
- { 23200, -1 }, /* Normal3fVertex3fvSUN */
- { 23692, -1 }, /* Color4fNormal3fVertex3fSUN */
- { 24693, -1 }, /* ReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN */
- { 26850, -1 }, /* ReplacementCodeuiColor3fVertex3fSUN */
- { 28273, -1 }, /* TexCoord4fVertex4fSUN */
- { 28719, -1 }, /* TexCoord2fColor3fVertex3fvSUN */
- { 29158, -1 }, /* ReplacementCodeuiNormal3fVertex3fvSUN */
- { 29285, -1 }, /* TexCoord4fVertex4fvSUN */
- { 30019, -1 }, /* ReplacementCodeuiVertex3fSUN */
- { -1, -1 }
-};
-#endif
-
-#if defined(need_GL_VERSION_1_3)
-/* functions defined in MESA_remap_table_functions are excluded */
-static const struct gl_function_remap GL_VERSION_1_3_functions[] = {
- { 464, _gloffset_MultiTexCoord3sARB },
- { 696, _gloffset_ActiveTextureARB },
- { 4451, _gloffset_MultiTexCoord1fvARB },
- { 6505, _gloffset_MultiTexCoord3dARB },
- { 6550, _gloffset_MultiTexCoord2iARB },
- { 6674, _gloffset_MultiTexCoord2svARB },
- { 8684, _gloffset_MultiTexCoord2fARB },
- { 10779, _gloffset_MultiTexCoord3fvARB },
- { 11381, _gloffset_MultiTexCoord4sARB },
- { 12062, _gloffset_MultiTexCoord2dvARB },
- { 12469, _gloffset_MultiTexCoord1svARB },
- { 12870, _gloffset_MultiTexCoord3svARB },
- { 12931, _gloffset_MultiTexCoord4iARB },
- { 13762, _gloffset_MultiTexCoord3iARB },
- { 14561, _gloffset_MultiTexCoord1dARB },
- { 14793, _gloffset_MultiTexCoord3dvARB },
- { 16072, _gloffset_MultiTexCoord3ivARB },
- { 16117, _gloffset_MultiTexCoord2sARB },
- { 17577, _gloffset_MultiTexCoord4ivARB },
- { 19743, _gloffset_ClientActiveTextureARB },
- { 22106, _gloffset_MultiTexCoord2dARB },
- { 22543, _gloffset_MultiTexCoord4dvARB },
- { 22920, _gloffset_MultiTexCoord4fvARB },
- { 23924, _gloffset_MultiTexCoord3fARB },
- { 26541, _gloffset_MultiTexCoord4dARB },
- { 26807, _gloffset_MultiTexCoord1sARB },
- { 27011, _gloffset_MultiTexCoord1dvARB },
- { 28019, _gloffset_MultiTexCoord1ivARB },
- { 28112, _gloffset_MultiTexCoord2ivARB },
- { 28451, _gloffset_MultiTexCoord1iARB },
- { 29887, _gloffset_MultiTexCoord4svARB },
- { 30511, _gloffset_MultiTexCoord1fARB },
- { 30774, _gloffset_MultiTexCoord4fARB },
- { 33271, _gloffset_MultiTexCoord2fvARB },
- { -1, -1 }
-};
-#endif
-
-#if defined(need_GL_VERSION_1_4)
-/* functions defined in MESA_remap_table_functions are excluded */
-static const struct gl_function_remap GL_VERSION_1_4_functions[] = {
- { -1, -1 }
-};
-#endif
-
-#if defined(need_GL_VERSION_1_5)
-/* functions defined in MESA_remap_table_functions are excluded */
-static const struct gl_function_remap GL_VERSION_1_5_functions[] = {
- { -1, -1 }
-};
-#endif
-
-#if defined(need_GL_VERSION_2_0)
-/* functions defined in MESA_remap_table_functions are excluded */
-static const struct gl_function_remap GL_VERSION_2_0_functions[] = {
- { -1, -1 }
-};
-#endif
-
-#if defined(need_GL_VERSION_2_1)
-/* functions defined in MESA_remap_table_functions are excluded */
-static const struct gl_function_remap GL_VERSION_2_1_functions[] = {
- { -1, -1 }
-};
-#endif
-
-#if defined(need_GL_VERSION_3_0)
-/* functions defined in MESA_remap_table_functions are excluded */
-static const struct gl_function_remap GL_VERSION_3_0_functions[] = {
- { -1, -1 }
-};
-#endif
-
-#if defined(need_GL_VERSION_3_1)
-/* functions defined in MESA_remap_table_functions are excluded */
-static const struct gl_function_remap GL_VERSION_3_1_functions[] = {
- { -1, -1 }
-};
-#endif
-
-#if defined(need_GL_VERSION_3_2)
-/* functions defined in MESA_remap_table_functions are excluded */
-static const struct gl_function_remap GL_VERSION_3_2_functions[] = {
- { -1, -1 }
-};
-#endif
-
-#if defined(need_GL_VERSION_3_3)
-/* functions defined in MESA_remap_table_functions are excluded */
-static const struct gl_function_remap GL_VERSION_3_3_functions[] = {
- { -1, -1 }
-};
-#endif
-
+/* DO NOT EDIT - This file generated automatically by remap_helper.py (from Mesa) script */
+
+/*
+ * Copyright (C) 2009 Chia-I Wu <olv@0xlab.org>
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sub license,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
+ * Chia-I Wu,
+ * AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
+ * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+#include "main/dispatch.h"
+#include "main/remap.h"
+
+/* this is internal to remap.c */
+#ifdef need_MESA_remap_table
+
+static const char _mesa_function_pool[] =
+ /* _mesa_function_pool[0]: MapGrid1d (offset 224) */
+ "idd\0"
+ "glMapGrid1d\0"
+ "\0"
+ /* _mesa_function_pool[17]: UniformMatrix3fvARB (will be remapped) */
+ "iiip\0"
+ "glUniformMatrix3fv\0"
+ "glUniformMatrix3fvARB\0"
+ "\0"
+ /* _mesa_function_pool[64]: MapGrid1f (offset 225) */
+ "iff\0"
+ "glMapGrid1f\0"
+ "\0"
+ /* _mesa_function_pool[81]: VertexAttribI2iEXT (will be remapped) */
+ "iii\0"
+ "glVertexAttribI2iEXT\0"
+ "glVertexAttribI2i\0"
+ "\0"
+ /* _mesa_function_pool[125]: RasterPos4i (offset 82) */
+ "iiii\0"
+ "glRasterPos4i\0"
+ "\0"
+ /* _mesa_function_pool[145]: RasterPos4d (offset 78) */
+ "dddd\0"
+ "glRasterPos4d\0"
+ "\0"
+ /* _mesa_function_pool[165]: NewList (dynamic) */
+ "ii\0"
+ "glNewList\0"
+ "\0"
+ /* _mesa_function_pool[179]: RasterPos4f (offset 80) */
+ "ffff\0"
+ "glRasterPos4f\0"
+ "\0"
+ /* _mesa_function_pool[199]: LoadIdentity (offset 290) */
+ "\0"
+ "glLoadIdentity\0"
+ "\0"
+ /* _mesa_function_pool[216]: GetCombinerOutputParameterfvNV (will be remapped) */
+ "iiip\0"
+ "glGetCombinerOutputParameterfvNV\0"
+ "\0"
+ /* _mesa_function_pool[255]: SampleCoverageARB (will be remapped) */
+ "fi\0"
+ "glSampleCoverage\0"
+ "glSampleCoverageARB\0"
+ "\0"
+ /* _mesa_function_pool[296]: ConvolutionFilter1D (offset 348) */
+ "iiiiip\0"
+ "glConvolutionFilter1D\0"
+ "glConvolutionFilter1DEXT\0"
+ "\0"
+ /* _mesa_function_pool[351]: BeginQueryARB (will be remapped) */
+ "ii\0"
+ "glBeginQuery\0"
+ "glBeginQueryARB\0"
+ "\0"
+ /* _mesa_function_pool[384]: RasterPos3dv (offset 71) */
+ "p\0"
+ "glRasterPos3dv\0"
+ "\0"
+ /* _mesa_function_pool[402]: PointParameteriNV (will be remapped) */
+ "ii\0"
+ "glPointParameteri\0"
+ "glPointParameteriNV\0"
+ "\0"
+ /* _mesa_function_pool[444]: GetProgramiv (will be remapped) */
+ "iip\0"
+ "glGetProgramiv\0"
+ "\0"
+ /* _mesa_function_pool[464]: MultiTexCoord3sARB (offset 398) */
+ "iiii\0"
+ "glMultiTexCoord3s\0"
+ "glMultiTexCoord3sARB\0"
+ "\0"
+ /* _mesa_function_pool[509]: SecondaryColor3iEXT (will be remapped) */
+ "iii\0"
+ "glSecondaryColor3i\0"
+ "glSecondaryColor3iEXT\0"
+ "\0"
+ /* _mesa_function_pool[555]: WindowPos3fMESA (will be remapped) */
+ "fff\0"
+ "glWindowPos3f\0"
+ "glWindowPos3fARB\0"
+ "glWindowPos3fMESA\0"
+ "\0"
+ /* _mesa_function_pool[609]: TexCoord1iv (offset 99) */
+ "p\0"
+ "glTexCoord1iv\0"
+ "\0"
+ /* _mesa_function_pool[626]: TexCoord4sv (offset 125) */
+ "p\0"
+ "glTexCoord4sv\0"
+ "\0"
+ /* _mesa_function_pool[643]: RasterPos4s (offset 84) */
+ "iiii\0"
+ "glRasterPos4s\0"
+ "\0"
+ /* _mesa_function_pool[663]: PixelTexGenParameterfvSGIS (will be remapped) */
+ "ip\0"
+ "glPixelTexGenParameterfvSGIS\0"
+ "\0"
+ /* _mesa_function_pool[696]: ActiveTextureARB (offset 374) */
+ "i\0"
+ "glActiveTexture\0"
+ "glActiveTextureARB\0"
+ "\0"
+ /* _mesa_function_pool[734]: BlitFramebufferEXT (will be remapped) */
+ "iiiiiiiiii\0"
+ "glBlitFramebuffer\0"
+ "glBlitFramebufferEXT\0"
+ "\0"
+ /* _mesa_function_pool[785]: TexCoord1f (offset 96) */
+ "f\0"
+ "glTexCoord1f\0"
+ "\0"
+ /* _mesa_function_pool[801]: TexCoord1d (offset 94) */
+ "d\0"
+ "glTexCoord1d\0"
+ "\0"
+ /* _mesa_function_pool[817]: VertexAttrib4ubvNV (will be remapped) */
+ "ip\0"
+ "glVertexAttrib4ubvNV\0"
+ "\0"
+ /* _mesa_function_pool[842]: TexCoord1i (offset 98) */
+ "i\0"
+ "glTexCoord1i\0"
+ "\0"
+ /* _mesa_function_pool[858]: GetProgramNamedParameterdvNV (will be remapped) */
+ "iipp\0"
+ "glGetProgramNamedParameterdvNV\0"
+ "\0"
+ /* _mesa_function_pool[895]: Histogram (offset 367) */
+ "iiii\0"
+ "glHistogram\0"
+ "glHistogramEXT\0"
+ "\0"
+ /* _mesa_function_pool[928]: TexCoord1s (offset 100) */
+ "i\0"
+ "glTexCoord1s\0"
+ "\0"
+ /* _mesa_function_pool[944]: GetMapfv (offset 267) */
+ "iip\0"
+ "glGetMapfv\0"
+ "\0"
+ /* _mesa_function_pool[960]: EvalCoord1f (offset 230) */
+ "f\0"
+ "glEvalCoord1f\0"
+ "\0"
+ /* _mesa_function_pool[977]: FramebufferTexture (will be remapped) */
+ "iiii\0"
+ "glFramebufferTexture\0"
+ "\0"
+ /* _mesa_function_pool[1004]: GetGraphicsResetStatusARB (will be remapped) */
+ "\0"
+ "glGetGraphicsResetStatusARB\0"
+ "\0"
+ /* _mesa_function_pool[1034]: TexImage4DSGIS (dynamic) */
+ "iiiiiiiiiip\0"
+ "glTexImage4DSGIS\0"
+ "\0"
+ /* _mesa_function_pool[1064]: PolygonStipple (offset 175) */
+ "p\0"
+ "glPolygonStipple\0"
+ "\0"
+ /* _mesa_function_pool[1084]: WindowPos2dvMESA (will be remapped) */
+ "p\0"
+ "glWindowPos2dv\0"
+ "glWindowPos2dvARB\0"
+ "glWindowPos2dvMESA\0"
+ "\0"
+ /* _mesa_function_pool[1139]: ReplacementCodeuiColor3fVertex3fvSUN (dynamic) */
+ "ppp\0"
+ "glReplacementCodeuiColor3fVertex3fvSUN\0"
+ "\0"
+ /* _mesa_function_pool[1183]: BlendEquationSeparateEXT (will be remapped) */
+ "ii\0"
+ "glBlendEquationSeparate\0"
+ "glBlendEquationSeparateEXT\0"
+ "glBlendEquationSeparateATI\0"
+ "\0"
+ /* _mesa_function_pool[1265]: ListParameterfSGIX (dynamic) */
+ "iif\0"
+ "glListParameterfSGIX\0"
+ "\0"
+ /* _mesa_function_pool[1291]: SecondaryColor3bEXT (will be remapped) */
+ "iii\0"
+ "glSecondaryColor3b\0"
+ "glSecondaryColor3bEXT\0"
+ "\0"
+ /* _mesa_function_pool[1337]: TexCoord4fColor4fNormal3fVertex4fvSUN (dynamic) */
+ "pppp\0"
+ "glTexCoord4fColor4fNormal3fVertex4fvSUN\0"
+ "\0"
+ /* _mesa_function_pool[1383]: GetnPolygonStippleARB (will be remapped) */
+ "ip\0"
+ "glGetnPolygonStippleARB\0"
+ "\0"
+ /* _mesa_function_pool[1411]: GetPixelMapfv (offset 271) */
+ "ip\0"
+ "glGetPixelMapfv\0"
+ "\0"
+ /* _mesa_function_pool[1431]: Color3uiv (offset 22) */
+ "p\0"
+ "glColor3uiv\0"
+ "\0"
+ /* _mesa_function_pool[1446]: IsEnabled (offset 286) */
+ "i\0"
+ "glIsEnabled\0"
+ "\0"
+ /* _mesa_function_pool[1461]: VertexAttrib4svNV (will be remapped) */
+ "ip\0"
+ "glVertexAttrib4svNV\0"
+ "\0"
+ /* _mesa_function_pool[1485]: EvalCoord2fv (offset 235) */
+ "p\0"
+ "glEvalCoord2fv\0"
+ "\0"
+ /* _mesa_function_pool[1503]: GetBufferSubDataARB (will be remapped) */
+ "iiip\0"
+ "glGetBufferSubData\0"
+ "glGetBufferSubDataARB\0"
+ "\0"
+ /* _mesa_function_pool[1550]: BufferSubDataARB (will be remapped) */
+ "iiip\0"
+ "glBufferSubData\0"
+ "glBufferSubDataARB\0"
+ "\0"
+ /* _mesa_function_pool[1591]: TexCoord2fColor4ubVertex3fvSUN (dynamic) */
+ "ppp\0"
+ "glTexCoord2fColor4ubVertex3fvSUN\0"
+ "\0"
+ /* _mesa_function_pool[1629]: AttachShader (will be remapped) */
+ "ii\0"
+ "glAttachShader\0"
+ "\0"
+ /* _mesa_function_pool[1648]: GetCombinerInputParameterfvNV (will be remapped) */
+ "iiiip\0"
+ "glGetCombinerInputParameterfvNV\0"
+ "\0"
+ /* _mesa_function_pool[1687]: VertexAttrib2fARB (will be remapped) */
+ "iff\0"
+ "glVertexAttrib2f\0"
+ "glVertexAttrib2fARB\0"
+ "\0"
+ /* _mesa_function_pool[1729]: GetDebugLogLengthMESA (dynamic) */
+ "iii\0"
+ "glGetDebugLogLengthMESA\0"
+ "\0"
+ /* _mesa_function_pool[1758]: GetMapiv (offset 268) */
+ "iip\0"
+ "glGetMapiv\0"
+ "\0"
+ /* _mesa_function_pool[1774]: VertexAttrib3fARB (will be remapped) */
+ "ifff\0"
+ "glVertexAttrib3f\0"
+ "glVertexAttrib3fARB\0"
+ "\0"
+ /* _mesa_function_pool[1817]: Indexubv (offset 316) */
+ "p\0"
+ "glIndexubv\0"
+ "\0"
+ /* _mesa_function_pool[1831]: GetQueryivARB (will be remapped) */
+ "iip\0"
+ "glGetQueryiv\0"
+ "glGetQueryivARB\0"
+ "\0"
+ /* _mesa_function_pool[1865]: TexImage3D (offset 371) */
+ "iiiiiiiiip\0"
+ "glTexImage3D\0"
+ "glTexImage3DEXT\0"
+ "\0"
+ /* _mesa_function_pool[1906]: BindFragDataLocationEXT (will be remapped) */
+ "iip\0"
+ "glBindFragDataLocationEXT\0"
+ "glBindFragDataLocation\0"
+ "\0"
+ /* _mesa_function_pool[1960]: ReplacementCodeuiVertex3fvSUN (dynamic) */
+ "pp\0"
+ "glReplacementCodeuiVertex3fvSUN\0"
+ "\0"
+ /* _mesa_function_pool[1996]: EdgeFlagPointer (offset 312) */
+ "ip\0"
+ "glEdgeFlagPointer\0"
+ "\0"
+ /* _mesa_function_pool[2018]: Color3ubv (offset 20) */
+ "p\0"
+ "glColor3ubv\0"
+ "\0"
+ /* _mesa_function_pool[2033]: GetQueryObjectivARB (will be remapped) */
+ "iip\0"
+ "glGetQueryObjectiv\0"
+ "glGetQueryObjectivARB\0"
+ "\0"
+ /* _mesa_function_pool[2079]: Vertex3dv (offset 135) */
+ "p\0"
+ "glVertex3dv\0"
+ "\0"
+ /* _mesa_function_pool[2094]: ReplacementCodeuiTexCoord2fVertex3fvSUN (dynamic) */
+ "ppp\0"
+ "glReplacementCodeuiTexCoord2fVertex3fvSUN\0"
+ "\0"
+ /* _mesa_function_pool[2141]: CompressedTexSubImage2DARB (will be remapped) */
+ "iiiiiiiip\0"
+ "glCompressedTexSubImage2D\0"
+ "glCompressedTexSubImage2DARB\0"
+ "\0"
+ /* _mesa_function_pool[2207]: CombinerOutputNV (will be remapped) */
+ "iiiiiiiiii\0"
+ "glCombinerOutputNV\0"
+ "\0"
+ /* _mesa_function_pool[2238]: VertexAttribs3fvNV (will be remapped) */
+ "iip\0"
+ "glVertexAttribs3fvNV\0"
+ "\0"
+ /* _mesa_function_pool[2264]: GetnMapivARB (will be remapped) */
+ "iiip\0"
+ "glGetnMapivARB\0"
+ "\0"
+ /* _mesa_function_pool[2285]: Uniform2fARB (will be remapped) */
+ "iff\0"
+ "glUniform2f\0"
+ "glUniform2fARB\0"
+ "\0"
+ /* _mesa_function_pool[2317]: LightModeliv (offset 166) */
+ "ip\0"
+ "glLightModeliv\0"
+ "\0"
+ /* _mesa_function_pool[2336]: VertexAttrib1svARB (will be remapped) */
+ "ip\0"
+ "glVertexAttrib1sv\0"
+ "glVertexAttrib1svARB\0"
+ "\0"
+ /* _mesa_function_pool[2379]: VertexAttribs1dvNV (will be remapped) */
+ "iip\0"
+ "glVertexAttribs1dvNV\0"
+ "\0"
+ /* _mesa_function_pool[2405]: Uniform2ivARB (will be remapped) */
+ "iip\0"
+ "glUniform2iv\0"
+ "glUniform2ivARB\0"
+ "\0"
+ /* _mesa_function_pool[2439]: GetImageTransformParameterfvHP (dynamic) */
+ "iip\0"
+ "glGetImageTransformParameterfvHP\0"
+ "\0"
+ /* _mesa_function_pool[2477]: Normal3bv (offset 53) */
+ "p\0"
+ "glNormal3bv\0"
+ "\0"
+ /* _mesa_function_pool[2492]: TexGeniv (offset 193) */
+ "iip\0"
+ "glTexGeniv\0"
+ "\0"
+ /* _mesa_function_pool[2508]: WeightubvARB (dynamic) */
+ "ip\0"
+ "glWeightubvARB\0"
+ "\0"
+ /* _mesa_function_pool[2527]: VertexAttrib1fvNV (will be remapped) */
+ "ip\0"
+ "glVertexAttrib1fvNV\0"
+ "\0"
+ /* _mesa_function_pool[2551]: Vertex3iv (offset 139) */
+ "p\0"
+ "glVertex3iv\0"
+ "\0"
+ /* _mesa_function_pool[2566]: CopyConvolutionFilter1D (offset 354) */
+ "iiiii\0"
+ "glCopyConvolutionFilter1D\0"
+ "glCopyConvolutionFilter1DEXT\0"
+ "\0"
+ /* _mesa_function_pool[2628]: VertexAttribI1uiEXT (will be remapped) */
+ "ii\0"
+ "glVertexAttribI1uiEXT\0"
+ "glVertexAttribI1ui\0"
+ "\0"
+ /* _mesa_function_pool[2673]: ReplacementCodeuiNormal3fVertex3fSUN (dynamic) */
+ "iffffff\0"
+ "glReplacementCodeuiNormal3fVertex3fSUN\0"
+ "\0"
+ /* _mesa_function_pool[2721]: DeleteSync (will be remapped) */
+ "i\0"
+ "glDeleteSync\0"
+ "\0"
+ /* _mesa_function_pool[2737]: FragmentMaterialfvSGIX (dynamic) */
+ "iip\0"
+ "glFragmentMaterialfvSGIX\0"
+ "\0"
+ /* _mesa_function_pool[2767]: BlendColor (offset 336) */
+ "ffff\0"
+ "glBlendColor\0"
+ "glBlendColorEXT\0"
+ "\0"
+ /* _mesa_function_pool[2802]: UniformMatrix4fvARB (will be remapped) */
+ "iiip\0"
+ "glUniformMatrix4fv\0"
+ "glUniformMatrix4fvARB\0"
+ "\0"
+ /* _mesa_function_pool[2849]: DeleteVertexArraysAPPLE (will be remapped) */
+ "ip\0"
+ "glDeleteVertexArrays\0"
+ "glDeleteVertexArraysAPPLE\0"
+ "\0"
+ /* _mesa_function_pool[2900]: TexBuffer (will be remapped) */
+ "iii\0"
+ "glTexBuffer\0"
+ "\0"
+ /* _mesa_function_pool[2917]: ReadInstrumentsSGIX (dynamic) */
+ "i\0"
+ "glReadInstrumentsSGIX\0"
+ "\0"
+ /* _mesa_function_pool[2942]: CallLists (offset 3) */
+ "iip\0"
+ "glCallLists\0"
+ "\0"
+ /* _mesa_function_pool[2959]: DeformationMap3dSGIX (dynamic) */
+ "iddiiddiiddiip\0"
+ "glDeformationMap3dSGIX\0"
+ "\0"
+ /* _mesa_function_pool[2998]: UniformMatrix2x4fv (will be remapped) */
+ "iiip\0"
+ "glUniformMatrix2x4fv\0"
+ "\0"
+ /* _mesa_function_pool[3025]: ReadnPixelsARB (will be remapped) */
+ "iiiiiiip\0"
+ "glReadnPixelsARB\0"
+ "\0"
+ /* _mesa_function_pool[3052]: Color4ubVertex3fvSUN (dynamic) */
+ "pp\0"
+ "glColor4ubVertex3fvSUN\0"
+ "\0"
+ /* _mesa_function_pool[3079]: Normal3iv (offset 59) */
+ "p\0"
+ "glNormal3iv\0"
+ "\0"
+ /* _mesa_function_pool[3094]: PassThrough (offset 199) */
+ "f\0"
+ "glPassThrough\0"
+ "\0"
+ /* _mesa_function_pool[3111]: GetnPixelMapusvARB (will be remapped) */
+ "iip\0"
+ "glGetnPixelMapusvARB\0"
+ "\0"
+ /* _mesa_function_pool[3137]: TexParameterIivEXT (will be remapped) */
+ "iip\0"
+ "glTexParameterIivEXT\0"
+ "glTexParameterIiv\0"
+ "\0"
+ /* _mesa_function_pool[3181]: FramebufferTextureLayerEXT (will be remapped) */
+ "iiiii\0"
+ "glFramebufferTextureLayer\0"
+ "glFramebufferTextureLayerEXT\0"
+ "\0"
+ /* _mesa_function_pool[3243]: GetListParameterfvSGIX (dynamic) */
+ "iip\0"
+ "glGetListParameterfvSGIX\0"
+ "\0"
+ /* _mesa_function_pool[3273]: Viewport (offset 305) */
+ "iiii\0"
+ "glViewport\0"
+ "\0"
+ /* _mesa_function_pool[3290]: VertexAttrib4NusvARB (will be remapped) */
+ "ip\0"
+ "glVertexAttrib4Nusv\0"
+ "glVertexAttrib4NusvARB\0"
+ "\0"
+ /* _mesa_function_pool[3337]: WindowPos4svMESA (will be remapped) */
+ "p\0"
+ "glWindowPos4svMESA\0"
+ "\0"
+ /* _mesa_function_pool[3359]: CreateProgramObjectARB (will be remapped) */
+ "\0"
+ "glCreateProgramObjectARB\0"
+ "\0"
+ /* _mesa_function_pool[3386]: DeleteTransformFeedbacks (will be remapped) */
+ "ip\0"
+ "glDeleteTransformFeedbacks\0"
+ "\0"
+ /* _mesa_function_pool[3417]: UniformMatrix4x3fv (will be remapped) */
+ "iiip\0"
+ "glUniformMatrix4x3fv\0"
+ "\0"
+ /* _mesa_function_pool[3444]: PrioritizeTextures (offset 331) */
+ "ipp\0"
+ "glPrioritizeTextures\0"
+ "glPrioritizeTexturesEXT\0"
+ "\0"
+ /* _mesa_function_pool[3494]: VertexAttribI3uiEXT (will be remapped) */
+ "iiii\0"
+ "glVertexAttribI3uiEXT\0"
+ "glVertexAttribI3ui\0"
+ "\0"
+ /* _mesa_function_pool[3541]: AsyncMarkerSGIX (dynamic) */
+ "i\0"
+ "glAsyncMarkerSGIX\0"
+ "\0"
+ /* _mesa_function_pool[3562]: GlobalAlphaFactorubSUN (dynamic) */
+ "i\0"
+ "glGlobalAlphaFactorubSUN\0"
+ "\0"
+ /* _mesa_function_pool[3590]: ClearColorIuiEXT (will be remapped) */
+ "iiii\0"
+ "glClearColorIuiEXT\0"
+ "\0"
+ /* _mesa_function_pool[3615]: ClearDebugLogMESA (dynamic) */
+ "iii\0"
+ "glClearDebugLogMESA\0"
+ "\0"
+ /* _mesa_function_pool[3640]: Uniform4uiEXT (will be remapped) */
+ "iiiii\0"
+ "glUniform4uiEXT\0"
+ "glUniform4ui\0"
+ "\0"
+ /* _mesa_function_pool[3676]: ResetHistogram (offset 369) */
+ "i\0"
+ "glResetHistogram\0"
+ "glResetHistogramEXT\0"
+ "\0"
+ /* _mesa_function_pool[3716]: GetProgramNamedParameterfvNV (will be remapped) */
+ "iipp\0"
+ "glGetProgramNamedParameterfvNV\0"
+ "\0"
+ /* _mesa_function_pool[3753]: PointParameterfEXT (will be remapped) */
+ "if\0"
+ "glPointParameterf\0"
+ "glPointParameterfARB\0"
+ "glPointParameterfEXT\0"
+ "glPointParameterfSGIS\0"
+ "\0"
+ /* _mesa_function_pool[3839]: LoadIdentityDeformationMapSGIX (dynamic) */
+ "i\0"
+ "glLoadIdentityDeformationMapSGIX\0"
+ "\0"
+ /* _mesa_function_pool[3875]: GenFencesNV (will be remapped) */
+ "ip\0"
+ "glGenFencesNV\0"
+ "\0"
+ /* _mesa_function_pool[3893]: ImageTransformParameterfHP (dynamic) */
+ "iif\0"
+ "glImageTransformParameterfHP\0"
+ "\0"
+ /* _mesa_function_pool[3927]: MatrixIndexusvARB (dynamic) */
+ "ip\0"
+ "glMatrixIndexusvARB\0"
+ "\0"
+ /* _mesa_function_pool[3951]: DrawElementsBaseVertex (will be remapped) */
+ "iiipi\0"
+ "glDrawElementsBaseVertex\0"
+ "\0"
+ /* _mesa_function_pool[3983]: DisableVertexAttribArrayARB (will be remapped) */
+ "i\0"
+ "glDisableVertexAttribArray\0"
+ "glDisableVertexAttribArrayARB\0"
+ "\0"
+ /* _mesa_function_pool[4043]: VertexAttribI4ubvEXT (will be remapped) */
+ "ip\0"
+ "glVertexAttribI4ubvEXT\0"
+ "glVertexAttribI4ubv\0"
+ "\0"
+ /* _mesa_function_pool[4090]: GetnConvolutionFilterARB (will be remapped) */
+ "iiiip\0"
+ "glGetnConvolutionFilterARB\0"
+ "\0"
+ /* _mesa_function_pool[4124]: TexCoord2sv (offset 109) */
+ "p\0"
+ "glTexCoord2sv\0"
+ "\0"
+ /* _mesa_function_pool[4141]: Vertex4dv (offset 143) */
+ "p\0"
+ "glVertex4dv\0"
+ "\0"
+ /* _mesa_function_pool[4156]: StencilMaskSeparate (will be remapped) */
+ "ii\0"
+ "glStencilMaskSeparate\0"
+ "\0"
+ /* _mesa_function_pool[4182]: ProgramLocalParameter4dARB (will be remapped) */
+ "iidddd\0"
+ "glProgramLocalParameter4dARB\0"
+ "\0"
+ /* _mesa_function_pool[4219]: CompressedTexImage3DARB (will be remapped) */
+ "iiiiiiiip\0"
+ "glCompressedTexImage3D\0"
+ "glCompressedTexImage3DARB\0"
+ "\0"
+ /* _mesa_function_pool[4279]: Color3sv (offset 18) */
+ "p\0"
+ "glColor3sv\0"
+ "\0"
+ /* _mesa_function_pool[4293]: GetConvolutionParameteriv (offset 358) */
+ "iip\0"
+ "glGetConvolutionParameteriv\0"
+ "glGetConvolutionParameterivEXT\0"
+ "\0"
+ /* _mesa_function_pool[4357]: DeleteSamplers (will be remapped) */
+ "ip\0"
+ "glDeleteSamplers\0"
+ "\0"
+ /* _mesa_function_pool[4378]: VertexAttrib1fARB (will be remapped) */
+ "if\0"
+ "glVertexAttrib1f\0"
+ "glVertexAttrib1fARB\0"
+ "\0"
+ /* _mesa_function_pool[4419]: Vertex2dv (offset 127) */
+ "p\0"
+ "glVertex2dv\0"
+ "\0"
+ /* _mesa_function_pool[4434]: TestFenceNV (will be remapped) */
+ "i\0"
+ "glTestFenceNV\0"
+ "\0"
+ /* _mesa_function_pool[4451]: MultiTexCoord1fvARB (offset 379) */
+ "ip\0"
+ "glMultiTexCoord1fv\0"
+ "glMultiTexCoord1fvARB\0"
+ "\0"
+ /* _mesa_function_pool[4496]: TexCoord3iv (offset 115) */
+ "p\0"
+ "glTexCoord3iv\0"
+ "\0"
+ /* _mesa_function_pool[4513]: Uniform2uivEXT (will be remapped) */
+ "iip\0"
+ "glUniform2uivEXT\0"
+ "glUniform2uiv\0"
+ "\0"
+ /* _mesa_function_pool[4549]: ColorFragmentOp2ATI (will be remapped) */
+ "iiiiiiiiii\0"
+ "glColorFragmentOp2ATI\0"
+ "\0"
+ /* _mesa_function_pool[4583]: SecondaryColorPointerListIBM (dynamic) */
+ "iiipi\0"
+ "glSecondaryColorPointerListIBM\0"
+ "\0"
+ /* _mesa_function_pool[4621]: GetPixelTexGenParameterivSGIS (will be remapped) */
+ "ip\0"
+ "glGetPixelTexGenParameterivSGIS\0"
+ "\0"
+ /* _mesa_function_pool[4657]: Color3fv (offset 14) */
+ "p\0"
+ "glColor3fv\0"
+ "\0"
+ /* _mesa_function_pool[4671]: GetnPixelMapfvARB (will be remapped) */
+ "iip\0"
+ "glGetnPixelMapfvARB\0"
+ "\0"
+ /* _mesa_function_pool[4696]: ReplacementCodeubSUN (dynamic) */
+ "i\0"
+ "glReplacementCodeubSUN\0"
+ "\0"
+ /* _mesa_function_pool[4722]: FinishAsyncSGIX (dynamic) */
+ "p\0"
+ "glFinishAsyncSGIX\0"
+ "\0"
+ /* _mesa_function_pool[4743]: GetnUniformfvARB (will be remapped) */
+ "iiip\0"
+ "glGetnUniformfvARB\0"
+ "\0"
+ /* _mesa_function_pool[4768]: GetDebugLogMESA (dynamic) */
+ "iiiipp\0"
+ "glGetDebugLogMESA\0"
+ "\0"
+ /* _mesa_function_pool[4794]: FogCoorddEXT (will be remapped) */
+ "d\0"
+ "glFogCoordd\0"
+ "glFogCoorddEXT\0"
+ "\0"
+ /* _mesa_function_pool[4824]: BeginConditionalRenderNV (will be remapped) */
+ "ii\0"
+ "glBeginConditionalRenderNV\0"
+ "glBeginConditionalRender\0"
+ "\0"
+ /* _mesa_function_pool[4880]: Color4ubVertex3fSUN (dynamic) */
+ "iiiifff\0"
+ "glColor4ubVertex3fSUN\0"
+ "\0"
+ /* _mesa_function_pool[4911]: FogCoordfEXT (will be remapped) */
+ "f\0"
+ "glFogCoordf\0"
+ "glFogCoordfEXT\0"
+ "\0"
+ /* _mesa_function_pool[4941]: PointSize (offset 173) */
+ "f\0"
+ "glPointSize\0"
+ "\0"
+ /* _mesa_function_pool[4956]: VertexAttribI2uivEXT (will be remapped) */
+ "ip\0"
+ "glVertexAttribI2uivEXT\0"
+ "glVertexAttribI2uiv\0"
+ "\0"
+ /* _mesa_function_pool[5003]: TexCoord2fVertex3fSUN (dynamic) */
+ "fffff\0"
+ "glTexCoord2fVertex3fSUN\0"
+ "\0"
+ /* _mesa_function_pool[5034]: PopName (offset 200) */
+ "\0"
+ "glPopName\0"
+ "\0"
+ /* _mesa_function_pool[5046]: GetSamplerParameterfv (will be remapped) */
+ "iip\0"
+ "glGetSamplerParameterfv\0"
+ "\0"
+ /* _mesa_function_pool[5075]: GlobalAlphaFactoriSUN (dynamic) */
+ "i\0"
+ "glGlobalAlphaFactoriSUN\0"
+ "\0"
+ /* _mesa_function_pool[5102]: VertexAttrib2dNV (will be remapped) */
+ "idd\0"
+ "glVertexAttrib2dNV\0"
+ "\0"
+ /* _mesa_function_pool[5126]: GetProgramInfoLog (will be remapped) */
+ "iipp\0"
+ "glGetProgramInfoLog\0"
+ "\0"
+ /* _mesa_function_pool[5152]: VertexAttrib4NbvARB (will be remapped) */
+ "ip\0"
+ "glVertexAttrib4Nbv\0"
+ "glVertexAttrib4NbvARB\0"
+ "\0"
+ /* _mesa_function_pool[5197]: GetActiveAttribARB (will be remapped) */
+ "iiipppp\0"
+ "glGetActiveAttrib\0"
+ "glGetActiveAttribARB\0"
+ "\0"
+ /* _mesa_function_pool[5245]: Vertex4sv (offset 149) */
+ "p\0"
+ "glVertex4sv\0"
+ "\0"
+ /* _mesa_function_pool[5260]: VertexAttrib4ubNV (will be remapped) */
+ "iiiii\0"
+ "glVertexAttrib4ubNV\0"
+ "\0"
+ /* _mesa_function_pool[5287]: VertexAttribI1ivEXT (will be remapped) */
+ "ip\0"
+ "glVertexAttribI1ivEXT\0"
+ "glVertexAttribI1iv\0"
+ "\0"
+ /* _mesa_function_pool[5332]: ClampColor (will be remapped) */
+ "ii\0"
+ "glClampColor\0"
+ "\0"
+ /* _mesa_function_pool[5349]: TextureRangeAPPLE (will be remapped) */
+ "iip\0"
+ "glTextureRangeAPPLE\0"
+ "\0"
+ /* _mesa_function_pool[5374]: GetTexEnvfv (offset 276) */
+ "iip\0"
+ "glGetTexEnvfv\0"
+ "\0"
+ /* _mesa_function_pool[5393]: BindTransformFeedback (will be remapped) */
+ "ii\0"
+ "glBindTransformFeedback\0"
+ "\0"
+ /* _mesa_function_pool[5421]: TexCoord2fColor4fNormal3fVertex3fSUN (dynamic) */
+ "ffffffffffff\0"
+ "glTexCoord2fColor4fNormal3fVertex3fSUN\0"
+ "\0"
+ /* _mesa_function_pool[5474]: Indexub (offset 315) */
+ "i\0"
+ "glIndexub\0"
+ "\0"
+ /* _mesa_function_pool[5487]: VertexAttrib4fNV (will be remapped) */
+ "iffff\0"
+ "glVertexAttrib4fNV\0"
+ "\0"
+ /* _mesa_function_pool[5513]: TexEnvi (offset 186) */
+ "iii\0"
+ "glTexEnvi\0"
+ "\0"
+ /* _mesa_function_pool[5528]: GetClipPlane (offset 259) */
+ "ip\0"
+ "glGetClipPlane\0"
+ "\0"
+ /* _mesa_function_pool[5547]: CombinerParameterfvNV (will be remapped) */
+ "ip\0"
+ "glCombinerParameterfvNV\0"
+ "\0"
+ /* _mesa_function_pool[5575]: VertexAttribs3dvNV (will be remapped) */
+ "iip\0"
+ "glVertexAttribs3dvNV\0"
+ "\0"
+ /* _mesa_function_pool[5601]: VertexAttribI2uiEXT (will be remapped) */
+ "iii\0"
+ "glVertexAttribI2uiEXT\0"
+ "glVertexAttribI2ui\0"
+ "\0"
+ /* _mesa_function_pool[5647]: VertexAttribs4fvNV (will be remapped) */
+ "iip\0"
+ "glVertexAttribs4fvNV\0"
+ "\0"
+ /* _mesa_function_pool[5673]: VertexArrayRangeNV (will be remapped) */
+ "ip\0"
+ "glVertexArrayRangeNV\0"
+ "\0"
+ /* _mesa_function_pool[5698]: FragmentLightiSGIX (dynamic) */
+ "iii\0"
+ "glFragmentLightiSGIX\0"
+ "\0"
+ /* _mesa_function_pool[5724]: PolygonOffsetEXT (will be remapped) */
+ "ff\0"
+ "glPolygonOffsetEXT\0"
+ "\0"
+ /* _mesa_function_pool[5747]: VertexAttribI4uivEXT (will be remapped) */
+ "ip\0"
+ "glVertexAttribI4uivEXT\0"
+ "glVertexAttribI4uiv\0"
+ "\0"
+ /* _mesa_function_pool[5794]: PollAsyncSGIX (dynamic) */
+ "p\0"
+ "glPollAsyncSGIX\0"
+ "\0"
+ /* _mesa_function_pool[5813]: DeleteFragmentShaderATI (will be remapped) */
+ "i\0"
+ "glDeleteFragmentShaderATI\0"
+ "\0"
+ /* _mesa_function_pool[5842]: Scaled (offset 301) */
+ "ddd\0"
+ "glScaled\0"
+ "\0"
+ /* _mesa_function_pool[5856]: ResumeTransformFeedback (will be remapped) */
+ "\0"
+ "glResumeTransformFeedback\0"
+ "\0"
+ /* _mesa_function_pool[5884]: Scalef (offset 302) */
+ "fff\0"
+ "glScalef\0"
+ "\0"
+ /* _mesa_function_pool[5898]: TexCoord2fNormal3fVertex3fvSUN (dynamic) */
+ "ppp\0"
+ "glTexCoord2fNormal3fVertex3fvSUN\0"
+ "\0"
+ /* _mesa_function_pool[5936]: ProgramEnvParameters4fvEXT (will be remapped) */
+ "iiip\0"
+ "glProgramEnvParameters4fvEXT\0"
+ "\0"
+ /* _mesa_function_pool[5971]: MultTransposeMatrixdARB (will be remapped) */
+ "p\0"
+ "glMultTransposeMatrixd\0"
+ "glMultTransposeMatrixdARB\0"
+ "\0"
+ /* _mesa_function_pool[6023]: ObjectUnpurgeableAPPLE (will be remapped) */
+ "iii\0"
+ "glObjectUnpurgeableAPPLE\0"
+ "\0"
+ /* _mesa_function_pool[6053]: AlphaFunc (offset 240) */
+ "if\0"
+ "glAlphaFunc\0"
+ "\0"
+ /* _mesa_function_pool[6069]: WindowPos2svMESA (will be remapped) */
+ "p\0"
+ "glWindowPos2sv\0"
+ "glWindowPos2svARB\0"
+ "glWindowPos2svMESA\0"
+ "\0"
+ /* _mesa_function_pool[6124]: EdgeFlag (offset 41) */
+ "i\0"
+ "glEdgeFlag\0"
+ "\0"
+ /* _mesa_function_pool[6138]: TexCoord2iv (offset 107) */
+ "p\0"
+ "glTexCoord2iv\0"
+ "\0"
+ /* _mesa_function_pool[6155]: CompressedTexImage1DARB (will be remapped) */
+ "iiiiiip\0"
+ "glCompressedTexImage1D\0"
+ "glCompressedTexImage1DARB\0"
+ "\0"
+ /* _mesa_function_pool[6213]: Rotated (offset 299) */
+ "dddd\0"
+ "glRotated\0"
+ "\0"
+ /* _mesa_function_pool[6229]: GetTexParameterIuivEXT (will be remapped) */
+ "iip\0"
+ "glGetTexParameterIuivEXT\0"
+ "glGetTexParameterIuiv\0"
+ "\0"
+ /* _mesa_function_pool[6281]: VertexAttrib2sNV (will be remapped) */
+ "iii\0"
+ "glVertexAttrib2sNV\0"
+ "\0"
+ /* _mesa_function_pool[6305]: ReadPixels (offset 256) */
+ "iiiiiip\0"
+ "glReadPixels\0"
+ "\0"
+ /* _mesa_function_pool[6327]: VertexAttribDivisorARB (will be remapped) */
+ "ii\0"
+ "glVertexAttribDivisorARB\0"
+ "\0"
+ /* _mesa_function_pool[6356]: EdgeFlagv (offset 42) */
+ "p\0"
+ "glEdgeFlagv\0"
+ "\0"
+ /* _mesa_function_pool[6371]: NormalPointerListIBM (dynamic) */
+ "iipi\0"
+ "glNormalPointerListIBM\0"
+ "\0"
+ /* _mesa_function_pool[6400]: IndexPointerEXT (will be remapped) */
+ "iiip\0"
+ "glIndexPointerEXT\0"
+ "\0"
+ /* _mesa_function_pool[6424]: Color4iv (offset 32) */
+ "p\0"
+ "glColor4iv\0"
+ "\0"
+ /* _mesa_function_pool[6438]: TexParameterf (offset 178) */
+ "iif\0"
+ "glTexParameterf\0"
+ "\0"
+ /* _mesa_function_pool[6459]: TexParameteri (offset 180) */
+ "iii\0"
+ "glTexParameteri\0"
+ "\0"
+ /* _mesa_function_pool[6480]: NormalPointerEXT (will be remapped) */
+ "iiip\0"
+ "glNormalPointerEXT\0"
+ "\0"
+ /* _mesa_function_pool[6505]: MultiTexCoord3dARB (offset 392) */
+ "iddd\0"
+ "glMultiTexCoord3d\0"
+ "glMultiTexCoord3dARB\0"
+ "\0"
+ /* _mesa_function_pool[6550]: MultiTexCoord2iARB (offset 388) */
+ "iii\0"
+ "glMultiTexCoord2i\0"
+ "glMultiTexCoord2iARB\0"
+ "\0"
+ /* _mesa_function_pool[6594]: DrawPixels (offset 257) */
+ "iiiip\0"
+ "glDrawPixels\0"
+ "\0"
+ /* _mesa_function_pool[6614]: ReplacementCodeuiTexCoord2fNormal3fVertex3fSUN (dynamic) */
+ "iffffffff\0"
+ "glReplacementCodeuiTexCoord2fNormal3fVertex3fSUN\0"
+ "\0"
+ /* _mesa_function_pool[6674]: MultiTexCoord2svARB (offset 391) */
+ "ip\0"
+ "glMultiTexCoord2sv\0"
+ "glMultiTexCoord2svARB\0"
+ "\0"
+ /* _mesa_function_pool[6719]: ReplacementCodeubvSUN (dynamic) */
+ "p\0"
+ "glReplacementCodeubvSUN\0"
+ "\0"
+ /* _mesa_function_pool[6746]: Uniform3iARB (will be remapped) */
+ "iiii\0"
+ "glUniform3i\0"
+ "glUniform3iARB\0"
+ "\0"
+ /* _mesa_function_pool[6779]: DrawTransformFeedback (will be remapped) */
+ "ii\0"
+ "glDrawTransformFeedback\0"
+ "\0"
+ /* _mesa_function_pool[6807]: DrawElementsInstancedARB (will be remapped) */
+ "iiipi\0"
+ "glDrawElementsInstancedARB\0"
+ "glDrawElementsInstancedEXT\0"
+ "glDrawElementsInstanced\0"
+ "\0"
+ /* _mesa_function_pool[6892]: GetShaderInfoLog (will be remapped) */
+ "iipp\0"
+ "glGetShaderInfoLog\0"
+ "\0"
+ /* _mesa_function_pool[6917]: WeightivARB (dynamic) */
+ "ip\0"
+ "glWeightivARB\0"
+ "\0"
+ /* _mesa_function_pool[6935]: PollInstrumentsSGIX (dynamic) */
+ "p\0"
+ "glPollInstrumentsSGIX\0"
+ "\0"
+ /* _mesa_function_pool[6960]: GlobalAlphaFactordSUN (dynamic) */
+ "d\0"
+ "glGlobalAlphaFactordSUN\0"
+ "\0"
+ /* _mesa_function_pool[6987]: GetFinalCombinerInputParameterfvNV (will be remapped) */
+ "iip\0"
+ "glGetFinalCombinerInputParameterfvNV\0"
+ "\0"
+ /* _mesa_function_pool[7029]: GenerateMipmapEXT (will be remapped) */
+ "i\0"
+ "glGenerateMipmap\0"
+ "glGenerateMipmapEXT\0"
+ "\0"
+ /* _mesa_function_pool[7069]: GenLists (offset 5) */
+ "i\0"
+ "glGenLists\0"
+ "\0"
+ /* _mesa_function_pool[7083]: DepthRangef (will be remapped) */
+ "ff\0"
+ "glDepthRangef\0"
+ "\0"
+ /* _mesa_function_pool[7101]: GetMapAttribParameterivNV (dynamic) */
+ "iiip\0"
+ "glGetMapAttribParameterivNV\0"
+ "\0"
+ /* _mesa_function_pool[7135]: CreateShaderObjectARB (will be remapped) */
+ "i\0"
+ "glCreateShaderObjectARB\0"
+ "\0"
+ /* _mesa_function_pool[7162]: GetSharpenTexFuncSGIS (dynamic) */
+ "ip\0"
+ "glGetSharpenTexFuncSGIS\0"
+ "\0"
+ /* _mesa_function_pool[7190]: BufferDataARB (will be remapped) */
+ "iipi\0"
+ "glBufferData\0"
+ "glBufferDataARB\0"
+ "\0"
+ /* _mesa_function_pool[7225]: FlushVertexArrayRangeNV (will be remapped) */
+ "\0"
+ "glFlushVertexArrayRangeNV\0"
+ "\0"
+ /* _mesa_function_pool[7253]: MapGrid2d (offset 226) */
+ "iddidd\0"
+ "glMapGrid2d\0"
+ "\0"
+ /* _mesa_function_pool[7273]: MapGrid2f (offset 227) */
+ "iffiff\0"
+ "glMapGrid2f\0"
+ "\0"
+ /* _mesa_function_pool[7293]: SampleMapATI (will be remapped) */
+ "iii\0"
+ "glSampleMapATI\0"
+ "\0"
+ /* _mesa_function_pool[7313]: VertexPointerEXT (will be remapped) */
+ "iiiip\0"
+ "glVertexPointerEXT\0"
+ "\0"
+ /* _mesa_function_pool[7339]: GetTexFilterFuncSGIS (dynamic) */
+ "iip\0"
+ "glGetTexFilterFuncSGIS\0"
+ "\0"
+ /* _mesa_function_pool[7367]: Scissor (offset 176) */
+ "iiii\0"
+ "glScissor\0"
+ "\0"
+ /* _mesa_function_pool[7383]: Fogf (offset 153) */
+ "if\0"
+ "glFogf\0"
+ "\0"
+ /* _mesa_function_pool[7394]: ReplacementCodeuiColor4ubVertex3fvSUN (dynamic) */
+ "ppp\0"
+ "glReplacementCodeuiColor4ubVertex3fvSUN\0"
+ "\0"
+ /* _mesa_function_pool[7439]: TexSubImage1D (offset 332) */
+ "iiiiiip\0"
+ "glTexSubImage1D\0"
+ "glTexSubImage1DEXT\0"
+ "\0"
+ /* _mesa_function_pool[7483]: VertexAttrib1sARB (will be remapped) */
+ "ii\0"
+ "glVertexAttrib1s\0"
+ "glVertexAttrib1sARB\0"
+ "\0"
+ /* _mesa_function_pool[7524]: FenceSync (will be remapped) */
+ "ii\0"
+ "glFenceSync\0"
+ "\0"
+ /* _mesa_function_pool[7540]: Color4usv (offset 40) */
+ "p\0"
+ "glColor4usv\0"
+ "\0"
+ /* _mesa_function_pool[7555]: Fogi (offset 155) */
+ "ii\0"
+ "glFogi\0"
+ "\0"
+ /* _mesa_function_pool[7566]: DepthRange (offset 288) */
+ "dd\0"
+ "glDepthRange\0"
+ "\0"
+ /* _mesa_function_pool[7583]: RasterPos3iv (offset 75) */
+ "p\0"
+ "glRasterPos3iv\0"
+ "\0"
+ /* _mesa_function_pool[7601]: FinalCombinerInputNV (will be remapped) */
+ "iiii\0"
+ "glFinalCombinerInputNV\0"
+ "\0"
+ /* _mesa_function_pool[7630]: TexCoord2i (offset 106) */
+ "ii\0"
+ "glTexCoord2i\0"
+ "\0"
+ /* _mesa_function_pool[7647]: PixelMapfv (offset 251) */
+ "iip\0"
+ "glPixelMapfv\0"
+ "\0"
+ /* _mesa_function_pool[7665]: Color4ui (offset 37) */
+ "iiii\0"
+ "glColor4ui\0"
+ "\0"
+ /* _mesa_function_pool[7682]: RasterPos3s (offset 76) */
+ "iii\0"
+ "glRasterPos3s\0"
+ "\0"
+ /* _mesa_function_pool[7701]: Color3usv (offset 24) */
+ "p\0"
+ "glColor3usv\0"
+ "\0"
+ /* _mesa_function_pool[7716]: FlushRasterSGIX (dynamic) */
+ "\0"
+ "glFlushRasterSGIX\0"
+ "\0"
+ /* _mesa_function_pool[7736]: TexCoord2f (offset 104) */
+ "ff\0"
+ "glTexCoord2f\0"
+ "\0"
+ /* _mesa_function_pool[7753]: ReplacementCodeuiTexCoord2fVertex3fSUN (dynamic) */
+ "ifffff\0"
+ "glReplacementCodeuiTexCoord2fVertex3fSUN\0"
+ "\0"
+ /* _mesa_function_pool[7802]: TexCoord2d (offset 102) */
+ "dd\0"
+ "glTexCoord2d\0"
+ "\0"
+ /* _mesa_function_pool[7819]: RasterPos3d (offset 70) */
+ "ddd\0"
+ "glRasterPos3d\0"
+ "\0"
+ /* _mesa_function_pool[7838]: RasterPos3f (offset 72) */
+ "fff\0"
+ "glRasterPos3f\0"
+ "\0"
+ /* _mesa_function_pool[7857]: Uniform1fARB (will be remapped) */
+ "if\0"
+ "glUniform1f\0"
+ "glUniform1fARB\0"
+ "\0"
+ /* _mesa_function_pool[7888]: AreTexturesResident (offset 322) */
+ "ipp\0"
+ "glAreTexturesResident\0"
+ "glAreTexturesResidentEXT\0"
+ "\0"
+ /* _mesa_function_pool[7940]: TexCoord2s (offset 108) */
+ "ii\0"
+ "glTexCoord2s\0"
+ "\0"
+ /* _mesa_function_pool[7957]: StencilOpSeparate (will be remapped) */
+ "iiii\0"
+ "glStencilOpSeparate\0"
+ "glStencilOpSeparateATI\0"
+ "\0"
+ /* _mesa_function_pool[8006]: ColorTableParameteriv (offset 341) */
+ "iip\0"
+ "glColorTableParameteriv\0"
+ "glColorTableParameterivSGI\0"
+ "\0"
+ /* _mesa_function_pool[8062]: FogCoordPointerListIBM (dynamic) */
+ "iipi\0"
+ "glFogCoordPointerListIBM\0"
+ "\0"
+ /* _mesa_function_pool[8093]: WindowPos3dMESA (will be remapped) */
+ "ddd\0"
+ "glWindowPos3d\0"
+ "glWindowPos3dARB\0"
+ "glWindowPos3dMESA\0"
+ "\0"
+ /* _mesa_function_pool[8147]: Color4us (offset 39) */
+ "iiii\0"
+ "glColor4us\0"
+ "\0"
+ /* _mesa_function_pool[8164]: PointParameterfvEXT (will be remapped) */
+ "ip\0"
+ "glPointParameterfv\0"
+ "glPointParameterfvARB\0"
+ "glPointParameterfvEXT\0"
+ "glPointParameterfvSGIS\0"
+ "\0"
+ /* _mesa_function_pool[8254]: Color3bv (offset 10) */
+ "p\0"
+ "glColor3bv\0"
+ "\0"
+ /* _mesa_function_pool[8268]: GetnCompressedTexImageARB (will be remapped) */
+ "iiip\0"
+ "glGetnCompressedTexImageARB\0"
+ "\0"
+ /* _mesa_function_pool[8302]: WindowPos2fvMESA (will be remapped) */
+ "p\0"
+ "glWindowPos2fv\0"
+ "glWindowPos2fvARB\0"
+ "glWindowPos2fvMESA\0"
+ "\0"
+ /* _mesa_function_pool[8357]: SecondaryColor3bvEXT (will be remapped) */
+ "p\0"
+ "glSecondaryColor3bv\0"
+ "glSecondaryColor3bvEXT\0"
+ "\0"
+ /* _mesa_function_pool[8403]: VertexPointerListIBM (dynamic) */
+ "iiipi\0"
+ "glVertexPointerListIBM\0"
+ "\0"
+ /* _mesa_function_pool[8433]: GetProgramLocalParameterfvARB (will be remapped) */
+ "iip\0"
+ "glGetProgramLocalParameterfvARB\0"
+ "\0"
+ /* _mesa_function_pool[8470]: FragmentMaterialfSGIX (dynamic) */
+ "iif\0"
+ "glFragmentMaterialfSGIX\0"
+ "\0"
+ /* _mesa_function_pool[8499]: BindSampler (will be remapped) */
+ "ii\0"
+ "glBindSampler\0"
+ "\0"
+ /* _mesa_function_pool[8517]: RenderbufferStorageEXT (will be remapped) */
+ "iiii\0"
+ "glRenderbufferStorage\0"
+ "glRenderbufferStorageEXT\0"
+ "\0"
+ /* _mesa_function_pool[8570]: IsFenceNV (will be remapped) */
+ "i\0"
+ "glIsFenceNV\0"
+ "\0"
+ /* _mesa_function_pool[8585]: AttachObjectARB (will be remapped) */
+ "ii\0"
+ "glAttachObjectARB\0"
+ "\0"
+ /* _mesa_function_pool[8607]: GetFragmentLightivSGIX (dynamic) */
+ "iip\0"
+ "glGetFragmentLightivSGIX\0"
+ "\0"
+ /* _mesa_function_pool[8637]: UniformMatrix2fvARB (will be remapped) */
+ "iiip\0"
+ "glUniformMatrix2fv\0"
+ "glUniformMatrix2fvARB\0"
+ "\0"
+ /* _mesa_function_pool[8684]: MultiTexCoord2fARB (offset 386) */
+ "iff\0"
+ "glMultiTexCoord2f\0"
+ "glMultiTexCoord2fARB\0"
+ "\0"
+ /* _mesa_function_pool[8728]: ColorTable (offset 339) */
+ "iiiiip\0"
+ "glColorTable\0"
+ "glColorTableSGI\0"
+ "glColorTableEXT\0"
+ "\0"
+ /* _mesa_function_pool[8781]: IndexPointer (offset 314) */
+ "iip\0"
+ "glIndexPointer\0"
+ "\0"
+ /* _mesa_function_pool[8801]: Accum (offset 213) */
+ "if\0"
+ "glAccum\0"
+ "\0"
+ /* _mesa_function_pool[8813]: GetTexImage (offset 281) */
+ "iiiip\0"
+ "glGetTexImage\0"
+ "\0"
+ /* _mesa_function_pool[8834]: MapControlPointsNV (dynamic) */
+ "iiiiiiiip\0"
+ "glMapControlPointsNV\0"
+ "\0"
+ /* _mesa_function_pool[8866]: ConvolutionFilter2D (offset 349) */
+ "iiiiiip\0"
+ "glConvolutionFilter2D\0"
+ "glConvolutionFilter2DEXT\0"
+ "\0"
+ /* _mesa_function_pool[8922]: Finish (offset 216) */
+ "\0"
+ "glFinish\0"
+ "\0"
+ /* _mesa_function_pool[8933]: MapParameterfvNV (dynamic) */
+ "iip\0"
+ "glMapParameterfvNV\0"
+ "\0"
+ /* _mesa_function_pool[8957]: ClearStencil (offset 207) */
+ "i\0"
+ "glClearStencil\0"
+ "\0"
+ /* _mesa_function_pool[8975]: VertexAttrib3dvARB (will be remapped) */
+ "ip\0"
+ "glVertexAttrib3dv\0"
+ "glVertexAttrib3dvARB\0"
+ "\0"
+ /* _mesa_function_pool[9018]: Uniform4uivEXT (will be remapped) */
+ "iip\0"
+ "glUniform4uivEXT\0"
+ "glUniform4uiv\0"
+ "\0"
+ /* _mesa_function_pool[9054]: HintPGI (dynamic) */
+ "ii\0"
+ "glHintPGI\0"
+ "\0"
+ /* _mesa_function_pool[9068]: ConvolutionParameteriv (offset 353) */
+ "iip\0"
+ "glConvolutionParameteriv\0"
+ "glConvolutionParameterivEXT\0"
+ "\0"
+ /* _mesa_function_pool[9126]: Color4s (offset 33) */
+ "iiii\0"
+ "glColor4s\0"
+ "\0"
+ /* _mesa_function_pool[9142]: InterleavedArrays (offset 317) */
+ "iip\0"
+ "glInterleavedArrays\0"
+ "\0"
+ /* _mesa_function_pool[9167]: RasterPos2fv (offset 65) */
+ "p\0"
+ "glRasterPos2fv\0"
+ "\0"
+ /* _mesa_function_pool[9185]: TexCoord1fv (offset 97) */
+ "p\0"
+ "glTexCoord1fv\0"
+ "\0"
+ /* _mesa_function_pool[9202]: Vertex2d (offset 126) */
+ "dd\0"
+ "glVertex2d\0"
+ "\0"
+ /* _mesa_function_pool[9217]: CullParameterdvEXT (dynamic) */
+ "ip\0"
+ "glCullParameterdvEXT\0"
+ "\0"
+ /* _mesa_function_pool[9242]: ProgramNamedParameter4fNV (will be remapped) */
+ "iipffff\0"
+ "glProgramNamedParameter4fNV\0"
+ "\0"
+ /* _mesa_function_pool[9279]: Color3fVertex3fSUN (dynamic) */
+ "ffffff\0"
+ "glColor3fVertex3fSUN\0"
+ "\0"
+ /* _mesa_function_pool[9308]: ProgramEnvParameter4fvARB (will be remapped) */
+ "iip\0"
+ "glProgramEnvParameter4fvARB\0"
+ "glProgramParameter4fvNV\0"
+ "\0"
+ /* _mesa_function_pool[9365]: Color4i (offset 31) */
+ "iiii\0"
+ "glColor4i\0"
+ "\0"
+ /* _mesa_function_pool[9381]: Color4f (offset 29) */
+ "ffff\0"
+ "glColor4f\0"
+ "\0"
+ /* _mesa_function_pool[9397]: RasterPos4fv (offset 81) */
+ "p\0"
+ "glRasterPos4fv\0"
+ "\0"
+ /* _mesa_function_pool[9415]: Color4d (offset 27) */
+ "dddd\0"
+ "glColor4d\0"
+ "\0"
+ /* _mesa_function_pool[9431]: ClearIndex (offset 205) */
+ "f\0"
+ "glClearIndex\0"
+ "\0"
+ /* _mesa_function_pool[9447]: Color4b (offset 25) */
+ "iiii\0"
+ "glColor4b\0"
+ "\0"
+ /* _mesa_function_pool[9463]: LoadMatrixd (offset 292) */
+ "p\0"
+ "glLoadMatrixd\0"
+ "\0"
+ /* _mesa_function_pool[9480]: FragmentLightModeliSGIX (dynamic) */
+ "ii\0"
+ "glFragmentLightModeliSGIX\0"
+ "\0"
+ /* _mesa_function_pool[9510]: RasterPos2dv (offset 63) */
+ "p\0"
+ "glRasterPos2dv\0"
+ "\0"
+ /* _mesa_function_pool[9528]: ConvolutionParameterfv (offset 351) */
+ "iip\0"
+ "glConvolutionParameterfv\0"
+ "glConvolutionParameterfvEXT\0"
+ "\0"
+ /* _mesa_function_pool[9586]: TbufferMask3DFX (dynamic) */
+ "i\0"
+ "glTbufferMask3DFX\0"
+ "\0"
+ /* _mesa_function_pool[9607]: GetTexGendv (offset 278) */
+ "iip\0"
+ "glGetTexGendv\0"
+ "\0"
+ /* _mesa_function_pool[9626]: GetVertexAttribfvNV (will be remapped) */
+ "iip\0"
+ "glGetVertexAttribfvNV\0"
+ "\0"
+ /* _mesa_function_pool[9653]: BeginTransformFeedbackEXT (will be remapped) */
+ "i\0"
+ "glBeginTransformFeedbackEXT\0"
+ "glBeginTransformFeedback\0"
+ "\0"
+ /* _mesa_function_pool[9709]: LoadProgramNV (will be remapped) */
+ "iiip\0"
+ "glLoadProgramNV\0"
+ "\0"
+ /* _mesa_function_pool[9731]: WaitSync (will be remapped) */
+ "iii\0"
+ "glWaitSync\0"
+ "\0"
+ /* _mesa_function_pool[9747]: EndList (offset 1) */
+ "\0"
+ "glEndList\0"
+ "\0"
+ /* _mesa_function_pool[9759]: VertexAttrib4fvNV (will be remapped) */
+ "ip\0"
+ "glVertexAttrib4fvNV\0"
+ "\0"
+ /* _mesa_function_pool[9783]: GetAttachedObjectsARB (will be remapped) */
+ "iipp\0"
+ "glGetAttachedObjectsARB\0"
+ "\0"
+ /* _mesa_function_pool[9813]: Uniform3fvARB (will be remapped) */
+ "iip\0"
+ "glUniform3fv\0"
+ "glUniform3fvARB\0"
+ "\0"
+ /* _mesa_function_pool[9847]: EvalCoord1fv (offset 231) */
+ "p\0"
+ "glEvalCoord1fv\0"
+ "\0"
+ /* _mesa_function_pool[9865]: DrawRangeElements (offset 338) */
+ "iiiiip\0"
+ "glDrawRangeElements\0"
+ "glDrawRangeElementsEXT\0"
+ "\0"
+ /* _mesa_function_pool[9916]: EvalMesh2 (offset 238) */
+ "iiiii\0"
+ "glEvalMesh2\0"
+ "\0"
+ /* _mesa_function_pool[9935]: Vertex4fv (offset 145) */
+ "p\0"
+ "glVertex4fv\0"
+ "\0"
+ /* _mesa_function_pool[9950]: GenTransformFeedbacks (will be remapped) */
+ "ip\0"
+ "glGenTransformFeedbacks\0"
+ "\0"
+ /* _mesa_function_pool[9978]: SpriteParameterfvSGIX (dynamic) */
+ "ip\0"
+ "glSpriteParameterfvSGIX\0"
+ "\0"
+ /* _mesa_function_pool[10006]: CheckFramebufferStatusEXT (will be remapped) */
+ "i\0"
+ "glCheckFramebufferStatus\0"
+ "glCheckFramebufferStatusEXT\0"
+ "\0"
+ /* _mesa_function_pool[10062]: GlobalAlphaFactoruiSUN (dynamic) */
+ "i\0"
+ "glGlobalAlphaFactoruiSUN\0"
+ "\0"
+ /* _mesa_function_pool[10090]: GetHandleARB (will be remapped) */
+ "i\0"
+ "glGetHandleARB\0"
+ "\0"
+ /* _mesa_function_pool[10108]: GetVertexAttribivARB (will be remapped) */
+ "iip\0"
+ "glGetVertexAttribiv\0"
+ "glGetVertexAttribivARB\0"
+ "\0"
+ /* _mesa_function_pool[10156]: BlendFunciARB (will be remapped) */
+ "iii\0"
+ "glBlendFunciARB\0"
+ "glBlendFuncIndexedAMD\0"
+ "\0"
+ /* _mesa_function_pool[10199]: GetnUniformivARB (will be remapped) */
+ "iiip\0"
+ "glGetnUniformivARB\0"
+ "\0"
+ /* _mesa_function_pool[10224]: GetTexParameterIivEXT (will be remapped) */
+ "iip\0"
+ "glGetTexParameterIivEXT\0"
+ "glGetTexParameterIiv\0"
+ "\0"
+ /* _mesa_function_pool[10274]: CreateProgram (will be remapped) */
+ "\0"
+ "glCreateProgram\0"
+ "\0"
+ /* _mesa_function_pool[10292]: LoadTransposeMatrixdARB (will be remapped) */
+ "p\0"
+ "glLoadTransposeMatrixd\0"
+ "glLoadTransposeMatrixdARB\0"
+ "\0"
+ /* _mesa_function_pool[10344]: ReleaseShaderCompiler (will be remapped) */
+ "\0"
+ "glReleaseShaderCompiler\0"
+ "\0"
+ /* _mesa_function_pool[10370]: GetMinmax (offset 364) */
+ "iiiip\0"
+ "glGetMinmax\0"
+ "glGetMinmaxEXT\0"
+ "\0"
+ /* _mesa_function_pool[10404]: StencilFuncSeparate (will be remapped) */
+ "iiii\0"
+ "glStencilFuncSeparate\0"
+ "\0"
+ /* _mesa_function_pool[10432]: SecondaryColor3sEXT (will be remapped) */
+ "iii\0"
+ "glSecondaryColor3s\0"
+ "glSecondaryColor3sEXT\0"
+ "\0"
+ /* _mesa_function_pool[10478]: Color3fVertex3fvSUN (dynamic) */
+ "pp\0"
+ "glColor3fVertex3fvSUN\0"
+ "\0"
+ /* _mesa_function_pool[10504]: GetInteger64i_v (will be remapped) */
+ "iip\0"
+ "glGetInteger64i_v\0"
+ "\0"
+ /* _mesa_function_pool[10527]: GetVertexAttribdvNV (will be remapped) */
+ "iip\0"
+ "glGetVertexAttribdvNV\0"
+ "\0"
+ /* _mesa_function_pool[10554]: Normal3fv (offset 57) */
+ "p\0"
+ "glNormal3fv\0"
+ "\0"
+ /* _mesa_function_pool[10569]: GlobalAlphaFactorbSUN (dynamic) */
+ "i\0"
+ "glGlobalAlphaFactorbSUN\0"
+ "\0"
+ /* _mesa_function_pool[10596]: Color3us (offset 23) */
+ "iii\0"
+ "glColor3us\0"
+ "\0"
+ /* _mesa_function_pool[10612]: ImageTransformParameterfvHP (dynamic) */
+ "iip\0"
+ "glImageTransformParameterfvHP\0"
+ "\0"
+ /* _mesa_function_pool[10647]: VertexAttrib4ivARB (will be remapped) */
+ "ip\0"
+ "glVertexAttrib4iv\0"
+ "glVertexAttrib4ivARB\0"
+ "\0"
+ /* _mesa_function_pool[10690]: End (offset 43) */
+ "\0"
+ "glEnd\0"
+ "\0"
+ /* _mesa_function_pool[10698]: VertexAttrib3fNV (will be remapped) */
+ "ifff\0"
+ "glVertexAttrib3fNV\0"
+ "\0"
+ /* _mesa_function_pool[10723]: VertexAttribs2dvNV (will be remapped) */
+ "iip\0"
+ "glVertexAttribs2dvNV\0"
+ "\0"
+ /* _mesa_function_pool[10749]: GetQueryObjectui64vEXT (will be remapped) */
+ "iip\0"
+ "glGetQueryObjectui64vEXT\0"
+ "\0"
+ /* _mesa_function_pool[10779]: MultiTexCoord3fvARB (offset 395) */
+ "ip\0"
+ "glMultiTexCoord3fv\0"
+ "glMultiTexCoord3fvARB\0"
+ "\0"
+ /* _mesa_function_pool[10824]: SecondaryColor3dEXT (will be remapped) */
+ "ddd\0"
+ "glSecondaryColor3d\0"
+ "glSecondaryColor3dEXT\0"
+ "\0"
+ /* _mesa_function_pool[10870]: Color3ub (offset 19) */
+ "iii\0"
+ "glColor3ub\0"
+ "\0"
+ /* _mesa_function_pool[10886]: GetProgramParameterfvNV (will be remapped) */
+ "iiip\0"
+ "glGetProgramParameterfvNV\0"
+ "\0"
+ /* _mesa_function_pool[10918]: TangentPointerEXT (dynamic) */
+ "iip\0"
+ "glTangentPointerEXT\0"
+ "\0"
+ /* _mesa_function_pool[10943]: Color4fNormal3fVertex3fvSUN (dynamic) */
+ "ppp\0"
+ "glColor4fNormal3fVertex3fvSUN\0"
+ "\0"
+ /* _mesa_function_pool[10978]: GetInstrumentsSGIX (dynamic) */
+ "\0"
+ "glGetInstrumentsSGIX\0"
+ "\0"
+ /* _mesa_function_pool[11001]: GetUniformuivEXT (will be remapped) */
+ "iip\0"
+ "glGetUniformuivEXT\0"
+ "glGetUniformuiv\0"
+ "\0"
+ /* _mesa_function_pool[11041]: Color3ui (offset 21) */
+ "iii\0"
+ "glColor3ui\0"
+ "\0"
+ /* _mesa_function_pool[11057]: EvalMapsNV (dynamic) */
+ "ii\0"
+ "glEvalMapsNV\0"
+ "\0"
+ /* _mesa_function_pool[11074]: TexSubImage2D (offset 333) */
+ "iiiiiiiip\0"
+ "glTexSubImage2D\0"
+ "glTexSubImage2DEXT\0"
+ "\0"
+ /* _mesa_function_pool[11120]: FragmentLightivSGIX (dynamic) */
+ "iip\0"
+ "glFragmentLightivSGIX\0"
+ "\0"
+ /* _mesa_function_pool[11147]: GetTexParameterPointervAPPLE (will be remapped) */
+ "iip\0"
+ "glGetTexParameterPointervAPPLE\0"
+ "\0"
+ /* _mesa_function_pool[11183]: TexGenfv (offset 191) */
+ "iip\0"
+ "glTexGenfv\0"
+ "\0"
+ /* _mesa_function_pool[11199]: GetTransformFeedbackVaryingEXT (will be remapped) */
+ "iiipppp\0"
+ "glGetTransformFeedbackVaryingEXT\0"
+ "glGetTransformFeedbackVarying\0"
+ "\0"
+ /* _mesa_function_pool[11271]: VertexAttrib4bvARB (will be remapped) */
+ "ip\0"
+ "glVertexAttrib4bv\0"
+ "glVertexAttrib4bvARB\0"
+ "\0"
+ /* _mesa_function_pool[11314]: ShaderBinary (will be remapped) */
+ "ipipi\0"
+ "glShaderBinary\0"
+ "\0"
+ /* _mesa_function_pool[11336]: GetIntegerIndexedvEXT (will be remapped) */
+ "iip\0"
+ "glGetIntegerIndexedvEXT\0"
+ "glGetIntegeri_v\0"
+ "\0"
+ /* _mesa_function_pool[11381]: MultiTexCoord4sARB (offset 406) */
+ "iiiii\0"
+ "glMultiTexCoord4s\0"
+ "glMultiTexCoord4sARB\0"
+ "\0"
+ /* _mesa_function_pool[11427]: GetFragmentMaterialivSGIX (dynamic) */
+ "iip\0"
+ "glGetFragmentMaterialivSGIX\0"
+ "\0"
+ /* _mesa_function_pool[11460]: WindowPos4dMESA (will be remapped) */
+ "dddd\0"
+ "glWindowPos4dMESA\0"
+ "\0"
+ /* _mesa_function_pool[11484]: WeightPointerARB (dynamic) */
+ "iiip\0"
+ "glWeightPointerARB\0"
+ "\0"
+ /* _mesa_function_pool[11509]: WindowPos2dMESA (will be remapped) */
+ "dd\0"
+ "glWindowPos2d\0"
+ "glWindowPos2dARB\0"
+ "glWindowPos2dMESA\0"
+ "\0"
+ /* _mesa_function_pool[11562]: FramebufferTexture3DEXT (will be remapped) */
+ "iiiiii\0"
+ "glFramebufferTexture3D\0"
+ "glFramebufferTexture3DEXT\0"
+ "\0"
+ /* _mesa_function_pool[11619]: BlendEquation (offset 337) */
+ "i\0"
+ "glBlendEquation\0"
+ "glBlendEquationEXT\0"
+ "\0"
+ /* _mesa_function_pool[11657]: VertexAttrib3dNV (will be remapped) */
+ "iddd\0"
+ "glVertexAttrib3dNV\0"
+ "\0"
+ /* _mesa_function_pool[11682]: VertexAttrib3dARB (will be remapped) */
+ "iddd\0"
+ "glVertexAttrib3d\0"
+ "glVertexAttrib3dARB\0"
+ "\0"
+ /* _mesa_function_pool[11725]: VertexAttribI4usvEXT (will be remapped) */
+ "ip\0"
+ "glVertexAttribI4usvEXT\0"
+ "glVertexAttribI4usv\0"
+ "\0"
+ /* _mesa_function_pool[11772]: ReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN (dynamic) */
+ "ppppp\0"
+ "glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN\0"
+ "\0"
+ /* _mesa_function_pool[11836]: VertexAttrib4fARB (will be remapped) */
+ "iffff\0"
+ "glVertexAttrib4f\0"
+ "glVertexAttrib4fARB\0"
+ "\0"
+ /* _mesa_function_pool[11880]: GetError (offset 261) */
+ "\0"
+ "glGetError\0"
+ "\0"
+ /* _mesa_function_pool[11893]: IndexFuncEXT (dynamic) */
+ "if\0"
+ "glIndexFuncEXT\0"
+ "\0"
+ /* _mesa_function_pool[11912]: TexCoord3dv (offset 111) */
+ "p\0"
+ "glTexCoord3dv\0"
+ "\0"
+ /* _mesa_function_pool[11929]: Indexdv (offset 45) */
+ "p\0"
+ "glIndexdv\0"
+ "\0"
+ /* _mesa_function_pool[11942]: FramebufferTexture2DEXT (will be remapped) */
+ "iiiii\0"
+ "glFramebufferTexture2D\0"
+ "glFramebufferTexture2DEXT\0"
+ "\0"
+ /* _mesa_function_pool[11998]: Normal3s (offset 60) */
+ "iii\0"
+ "glNormal3s\0"
+ "\0"
+ /* _mesa_function_pool[12014]: GetObjectParameterivAPPLE (will be remapped) */
+ "iiip\0"
+ "glGetObjectParameterivAPPLE\0"
+ "\0"
+ /* _mesa_function_pool[12048]: PushName (offset 201) */
+ "i\0"
+ "glPushName\0"
+ "\0"
+ /* _mesa_function_pool[12062]: MultiTexCoord2dvARB (offset 385) */
+ "ip\0"
+ "glMultiTexCoord2dv\0"
+ "glMultiTexCoord2dvARB\0"
+ "\0"
+ /* _mesa_function_pool[12107]: CullParameterfvEXT (dynamic) */
+ "ip\0"
+ "glCullParameterfvEXT\0"
+ "\0"
+ /* _mesa_function_pool[12132]: Normal3i (offset 58) */
+ "iii\0"
+ "glNormal3i\0"
+ "\0"
+ /* _mesa_function_pool[12148]: ProgramNamedParameter4fvNV (will be remapped) */
+ "iipp\0"
+ "glProgramNamedParameter4fvNV\0"
+ "\0"
+ /* _mesa_function_pool[12183]: SecondaryColorPointerEXT (will be remapped) */
+ "iiip\0"
+ "glSecondaryColorPointer\0"
+ "glSecondaryColorPointerEXT\0"
+ "\0"
+ /* _mesa_function_pool[12240]: VertexAttrib4fvARB (will be remapped) */
+ "ip\0"
+ "glVertexAttrib4fv\0"
+ "glVertexAttrib4fvARB\0"
+ "\0"
+ /* _mesa_function_pool[12283]: PixelTexGenSGIX (will be remapped) */
+ "i\0"
+ "glPixelTexGenSGIX\0"
+ "\0"
+ /* _mesa_function_pool[12304]: GetActiveUniformARB (will be remapped) */
+ "iiipppp\0"
+ "glGetActiveUniform\0"
+ "glGetActiveUniformARB\0"
+ "\0"
+ /* _mesa_function_pool[12354]: ImageTransformParameteriHP (dynamic) */
+ "iii\0"
+ "glImageTransformParameteriHP\0"
+ "\0"
+ /* _mesa_function_pool[12388]: Normal3b (offset 52) */
+ "iii\0"
+ "glNormal3b\0"
+ "\0"
+ /* _mesa_function_pool[12404]: Normal3d (offset 54) */
+ "ddd\0"
+ "glNormal3d\0"
+ "\0"
+ /* _mesa_function_pool[12420]: Uniform1uiEXT (will be remapped) */
+ "ii\0"
+ "glUniform1uiEXT\0"
+ "glUniform1ui\0"
+ "\0"
+ /* _mesa_function_pool[12453]: Normal3f (offset 56) */
+ "fff\0"
+ "glNormal3f\0"
+ "\0"
+ /* _mesa_function_pool[12469]: MultiTexCoord1svARB (offset 383) */
+ "ip\0"
+ "glMultiTexCoord1sv\0"
+ "glMultiTexCoord1svARB\0"
+ "\0"
+ /* _mesa_function_pool[12514]: Indexi (offset 48) */
+ "i\0"
+ "glIndexi\0"
+ "\0"
+ /* _mesa_function_pool[12526]: EGLImageTargetTexture2DOES (will be remapped) */
+ "ip\0"
+ "glEGLImageTargetTexture2DOES\0"
+ "\0"
+ /* _mesa_function_pool[12559]: EndQueryARB (will be remapped) */
+ "i\0"
+ "glEndQuery\0"
+ "glEndQueryARB\0"
+ "\0"
+ /* _mesa_function_pool[12587]: DeleteFencesNV (will be remapped) */
+ "ip\0"
+ "glDeleteFencesNV\0"
+ "\0"
+ /* _mesa_function_pool[12608]: ColorPointerListIBM (dynamic) */
+ "iiipi\0"
+ "glColorPointerListIBM\0"
+ "\0"
+ /* _mesa_function_pool[12637]: BindBufferRangeEXT (will be remapped) */
+ "iiiii\0"
+ "glBindBufferRangeEXT\0"
+ "glBindBufferRange\0"
+ "\0"
+ /* _mesa_function_pool[12683]: DepthMask (offset 211) */
+ "i\0"
+ "glDepthMask\0"
+ "\0"
+ /* _mesa_function_pool[12698]: IsShader (will be remapped) */
+ "i\0"
+ "glIsShader\0"
+ "\0"
+ /* _mesa_function_pool[12712]: Indexf (offset 46) */
+ "f\0"
+ "glIndexf\0"
+ "\0"
+ /* _mesa_function_pool[12724]: GetImageTransformParameterivHP (dynamic) */
+ "iip\0"
+ "glGetImageTransformParameterivHP\0"
+ "\0"
+ /* _mesa_function_pool[12762]: Indexd (offset 44) */
+ "d\0"
+ "glIndexd\0"
+ "\0"
+ /* _mesa_function_pool[12774]: GetMaterialiv (offset 270) */
+ "iip\0"
+ "glGetMaterialiv\0"
+ "\0"
+ /* _mesa_function_pool[12795]: StencilOp (offset 244) */
+ "iii\0"
+ "glStencilOp\0"
+ "\0"
+ /* _mesa_function_pool[12812]: WindowPos4ivMESA (will be remapped) */
+ "p\0"
+ "glWindowPos4ivMESA\0"
+ "\0"
+ /* _mesa_function_pool[12834]: FramebufferTextureLayer (dynamic) */
+ "iiiii\0"
+ "glFramebufferTextureLayerARB\0"
+ "\0"
+ /* _mesa_function_pool[12870]: MultiTexCoord3svARB (offset 399) */
+ "ip\0"
+ "glMultiTexCoord3sv\0"
+ "glMultiTexCoord3svARB\0"
+ "\0"
+ /* _mesa_function_pool[12915]: TexEnvfv (offset 185) */
+ "iip\0"
+ "glTexEnvfv\0"
+ "\0"
+ /* _mesa_function_pool[12931]: MultiTexCoord4iARB (offset 404) */
+ "iiiii\0"
+ "glMultiTexCoord4i\0"
+ "glMultiTexCoord4iARB\0"
+ "\0"
+ /* _mesa_function_pool[12977]: Indexs (offset 50) */
+ "i\0"
+ "glIndexs\0"
+ "\0"
+ /* _mesa_function_pool[12989]: Binormal3ivEXT (dynamic) */
+ "p\0"
+ "glBinormal3ivEXT\0"
+ "\0"
+ /* _mesa_function_pool[13009]: ResizeBuffersMESA (will be remapped) */
+ "\0"
+ "glResizeBuffersMESA\0"
+ "\0"
+ /* _mesa_function_pool[13031]: BlendFuncSeparateiARB (will be remapped) */
+ "iiiii\0"
+ "glBlendFuncSeparateiARB\0"
+ "glBlendFuncSeparateIndexedAMD\0"
+ "\0"
+ /* _mesa_function_pool[13092]: GetUniformivARB (will be remapped) */
+ "iip\0"
+ "glGetUniformiv\0"
+ "glGetUniformivARB\0"
+ "\0"
+ /* _mesa_function_pool[13130]: PixelTexGenParameteriSGIS (will be remapped) */
+ "ii\0"
+ "glPixelTexGenParameteriSGIS\0"
+ "\0"
+ /* _mesa_function_pool[13162]: VertexPointervINTEL (dynamic) */
+ "iip\0"
+ "glVertexPointervINTEL\0"
+ "\0"
+ /* _mesa_function_pool[13189]: Vertex2i (offset 130) */
+ "ii\0"
+ "glVertex2i\0"
+ "\0"
+ /* _mesa_function_pool[13204]: LoadMatrixf (offset 291) */
+ "p\0"
+ "glLoadMatrixf\0"
+ "\0"
+ /* _mesa_function_pool[13221]: VertexAttribI1uivEXT (will be remapped) */
+ "ip\0"
+ "glVertexAttribI1uivEXT\0"
+ "glVertexAttribI1uiv\0"
+ "\0"
+ /* _mesa_function_pool[13268]: Vertex2f (offset 128) */
+ "ff\0"
+ "glVertex2f\0"
+ "\0"
+ /* _mesa_function_pool[13283]: ReplacementCodeuiColor4fNormal3fVertex3fvSUN (dynamic) */
+ "pppp\0"
+ "glReplacementCodeuiColor4fNormal3fVertex3fvSUN\0"
+ "\0"
+ /* _mesa_function_pool[13336]: Color4bv (offset 26) */
+ "p\0"
+ "glColor4bv\0"
+ "\0"
+ /* _mesa_function_pool[13350]: VertexPointer (offset 321) */
+ "iiip\0"
+ "glVertexPointer\0"
+ "\0"
+ /* _mesa_function_pool[13372]: SecondaryColor3uiEXT (will be remapped) */
+ "iii\0"
+ "glSecondaryColor3ui\0"
+ "glSecondaryColor3uiEXT\0"
+ "\0"
+ /* _mesa_function_pool[13420]: StartInstrumentsSGIX (dynamic) */
+ "\0"
+ "glStartInstrumentsSGIX\0"
+ "\0"
+ /* _mesa_function_pool[13445]: SecondaryColor3usvEXT (will be remapped) */
+ "p\0"
+ "glSecondaryColor3usv\0"
+ "glSecondaryColor3usvEXT\0"
+ "\0"
+ /* _mesa_function_pool[13493]: VertexAttrib2fvNV (will be remapped) */
+ "ip\0"
+ "glVertexAttrib2fvNV\0"
+ "\0"
+ /* _mesa_function_pool[13517]: ProgramLocalParameter4dvARB (will be remapped) */
+ "iip\0"
+ "glProgramLocalParameter4dvARB\0"
+ "\0"
+ /* _mesa_function_pool[13552]: DeleteLists (offset 4) */
+ "ii\0"
+ "glDeleteLists\0"
+ "\0"
+ /* _mesa_function_pool[13570]: LogicOp (offset 242) */
+ "i\0"
+ "glLogicOp\0"
+ "\0"
+ /* _mesa_function_pool[13583]: MatrixIndexuivARB (dynamic) */
+ "ip\0"
+ "glMatrixIndexuivARB\0"
+ "\0"
+ /* _mesa_function_pool[13607]: Vertex2s (offset 132) */
+ "ii\0"
+ "glVertex2s\0"
+ "\0"
+ /* _mesa_function_pool[13622]: RenderbufferStorageMultisample (will be remapped) */
+ "iiiii\0"
+ "glRenderbufferStorageMultisample\0"
+ "glRenderbufferStorageMultisampleEXT\0"
+ "\0"
+ /* _mesa_function_pool[13698]: TexCoord4fv (offset 121) */
+ "p\0"
+ "glTexCoord4fv\0"
+ "\0"
+ /* _mesa_function_pool[13715]: Tangent3sEXT (dynamic) */
+ "iii\0"
+ "glTangent3sEXT\0"
+ "\0"
+ /* _mesa_function_pool[13735]: GlobalAlphaFactorfSUN (dynamic) */
+ "f\0"
+ "glGlobalAlphaFactorfSUN\0"
+ "\0"
+ /* _mesa_function_pool[13762]: MultiTexCoord3iARB (offset 396) */
+ "iiii\0"
+ "glMultiTexCoord3i\0"
+ "glMultiTexCoord3iARB\0"
+ "\0"
+ /* _mesa_function_pool[13807]: IsProgram (will be remapped) */
+ "i\0"
+ "glIsProgram\0"
+ "\0"
+ /* _mesa_function_pool[13822]: TexCoordPointerListIBM (dynamic) */
+ "iiipi\0"
+ "glTexCoordPointerListIBM\0"
+ "\0"
+ /* _mesa_function_pool[13854]: VertexAttribI4svEXT (will be remapped) */
+ "ip\0"
+ "glVertexAttribI4svEXT\0"
+ "glVertexAttribI4sv\0"
+ "\0"
+ /* _mesa_function_pool[13899]: GlobalAlphaFactorusSUN (dynamic) */
+ "i\0"
+ "glGlobalAlphaFactorusSUN\0"
+ "\0"
+ /* _mesa_function_pool[13927]: VertexAttrib2dvNV (will be remapped) */
+ "ip\0"
+ "glVertexAttrib2dvNV\0"
+ "\0"
+ /* _mesa_function_pool[13951]: FramebufferRenderbufferEXT (will be remapped) */
+ "iiii\0"
+ "glFramebufferRenderbuffer\0"
+ "glFramebufferRenderbufferEXT\0"
+ "\0"
+ /* _mesa_function_pool[14012]: ClearBufferuiv (will be remapped) */
+ "iip\0"
+ "glClearBufferuiv\0"
+ "\0"
+ /* _mesa_function_pool[14034]: VertexAttrib1dvNV (will be remapped) */
+ "ip\0"
+ "glVertexAttrib1dvNV\0"
+ "\0"
+ /* _mesa_function_pool[14058]: GenTextures (offset 328) */
+ "ip\0"
+ "glGenTextures\0"
+ "glGenTexturesEXT\0"
+ "\0"
+ /* _mesa_function_pool[14093]: FramebufferTextureARB (will be remapped) */
+ "iiii\0"
+ "glFramebufferTextureARB\0"
+ "\0"
+ /* _mesa_function_pool[14123]: SetFenceNV (will be remapped) */
+ "ii\0"
+ "glSetFenceNV\0"
+ "\0"
+ /* _mesa_function_pool[14140]: FramebufferTexture1DEXT (will be remapped) */
+ "iiiii\0"
+ "glFramebufferTexture1D\0"
+ "glFramebufferTexture1DEXT\0"
+ "\0"
+ /* _mesa_function_pool[14196]: GetCombinerOutputParameterivNV (will be remapped) */
+ "iiip\0"
+ "glGetCombinerOutputParameterivNV\0"
+ "\0"
+ /* _mesa_function_pool[14235]: PixelTexGenParameterivSGIS (will be remapped) */
+ "ip\0"
+ "glPixelTexGenParameterivSGIS\0"
+ "\0"
+ /* _mesa_function_pool[14268]: TextureNormalEXT (dynamic) */
+ "i\0"
+ "glTextureNormalEXT\0"
+ "\0"
+ /* _mesa_function_pool[14290]: IndexPointerListIBM (dynamic) */
+ "iipi\0"
+ "glIndexPointerListIBM\0"
+ "\0"
+ /* _mesa_function_pool[14318]: WeightfvARB (dynamic) */
+ "ip\0"
+ "glWeightfvARB\0"
+ "\0"
+ /* _mesa_function_pool[14336]: RasterPos2sv (offset 69) */
+ "p\0"
+ "glRasterPos2sv\0"
+ "\0"
+ /* _mesa_function_pool[14354]: Color4ubv (offset 36) */
+ "p\0"
+ "glColor4ubv\0"
+ "\0"
+ /* _mesa_function_pool[14369]: DrawBuffer (offset 202) */
+ "i\0"
+ "glDrawBuffer\0"
+ "\0"
+ /* _mesa_function_pool[14385]: TexCoord2fv (offset 105) */
+ "p\0"
+ "glTexCoord2fv\0"
+ "\0"
+ /* _mesa_function_pool[14402]: WindowPos4fMESA (will be remapped) */
+ "ffff\0"
+ "glWindowPos4fMESA\0"
+ "\0"
+ /* _mesa_function_pool[14426]: TexCoord1sv (offset 101) */
+ "p\0"
+ "glTexCoord1sv\0"
+ "\0"
+ /* _mesa_function_pool[14443]: WindowPos3dvMESA (will be remapped) */
+ "p\0"
+ "glWindowPos3dv\0"
+ "glWindowPos3dvARB\0"
+ "glWindowPos3dvMESA\0"
+ "\0"
+ /* _mesa_function_pool[14498]: DepthFunc (offset 245) */
+ "i\0"
+ "glDepthFunc\0"
+ "\0"
+ /* _mesa_function_pool[14513]: PixelMapusv (offset 253) */
+ "iip\0"
+ "glPixelMapusv\0"
+ "\0"
+ /* _mesa_function_pool[14532]: GetQueryObjecti64vEXT (will be remapped) */
+ "iip\0"
+ "glGetQueryObjecti64vEXT\0"
+ "\0"
+ /* _mesa_function_pool[14561]: MultiTexCoord1dARB (offset 376) */
+ "id\0"
+ "glMultiTexCoord1d\0"
+ "glMultiTexCoord1dARB\0"
+ "\0"
+ /* _mesa_function_pool[14604]: PointParameterivNV (will be remapped) */
+ "ip\0"
+ "glPointParameteriv\0"
+ "glPointParameterivNV\0"
+ "\0"
+ /* _mesa_function_pool[14648]: IsSampler (will be remapped) */
+ "i\0"
+ "glIsSampler\0"
+ "\0"
+ /* _mesa_function_pool[14663]: BlendFunc (offset 241) */
+ "ii\0"
+ "glBlendFunc\0"
+ "\0"
+ /* _mesa_function_pool[14679]: EndTransformFeedbackEXT (will be remapped) */
+ "\0"
+ "glEndTransformFeedbackEXT\0"
+ "glEndTransformFeedback\0"
+ "\0"
+ /* _mesa_function_pool[14730]: Uniform2fvARB (will be remapped) */
+ "iip\0"
+ "glUniform2fv\0"
+ "glUniform2fvARB\0"
+ "\0"
+ /* _mesa_function_pool[14764]: BufferParameteriAPPLE (will be remapped) */
+ "iii\0"
+ "glBufferParameteriAPPLE\0"
+ "\0"
+ /* _mesa_function_pool[14793]: MultiTexCoord3dvARB (offset 393) */
+ "ip\0"
+ "glMultiTexCoord3dv\0"
+ "glMultiTexCoord3dvARB\0"
+ "\0"
+ /* _mesa_function_pool[14838]: ReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN (dynamic) */
+ "pppp\0"
+ "glReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN\0"
+ "\0"
+ /* _mesa_function_pool[14894]: DeleteObjectARB (will be remapped) */
+ "i\0"
+ "glDeleteObjectARB\0"
+ "\0"
+ /* _mesa_function_pool[14915]: GetShaderPrecisionFormat (will be remapped) */
+ "iipp\0"
+ "glGetShaderPrecisionFormat\0"
+ "\0"
+ /* _mesa_function_pool[14948]: MatrixIndexPointerARB (dynamic) */
+ "iiip\0"
+ "glMatrixIndexPointerARB\0"
+ "\0"
+ /* _mesa_function_pool[14978]: ProgramNamedParameter4dvNV (will be remapped) */
+ "iipp\0"
+ "glProgramNamedParameter4dvNV\0"
+ "\0"
+ /* _mesa_function_pool[15013]: Tangent3fvEXT (dynamic) */
+ "p\0"
+ "glTangent3fvEXT\0"
+ "\0"
+ /* _mesa_function_pool[15032]: Flush (offset 217) */
+ "\0"
+ "glFlush\0"
+ "\0"
+ /* _mesa_function_pool[15042]: Color4uiv (offset 38) */
+ "p\0"
+ "glColor4uiv\0"
+ "\0"
+ /* _mesa_function_pool[15057]: VertexAttribI4iEXT (will be remapped) */
+ "iiiii\0"
+ "glVertexAttribI4iEXT\0"
+ "glVertexAttribI4i\0"
+ "\0"
+ /* _mesa_function_pool[15103]: GenVertexArrays (will be remapped) */
+ "ip\0"
+ "glGenVertexArrays\0"
+ "\0"
+ /* _mesa_function_pool[15125]: Uniform3uivEXT (will be remapped) */
+ "iip\0"
+ "glUniform3uivEXT\0"
+ "glUniform3uiv\0"
+ "\0"
+ /* _mesa_function_pool[15161]: RasterPos3sv (offset 77) */
+ "p\0"
+ "glRasterPos3sv\0"
+ "\0"
+ /* _mesa_function_pool[15179]: BindFramebufferEXT (will be remapped) */
+ "ii\0"
+ "glBindFramebuffer\0"
+ "glBindFramebufferEXT\0"
+ "\0"
+ /* _mesa_function_pool[15222]: ReferencePlaneSGIX (dynamic) */
+ "p\0"
+ "glReferencePlaneSGIX\0"
+ "\0"
+ /* _mesa_function_pool[15246]: PushAttrib (offset 219) */
+ "i\0"
+ "glPushAttrib\0"
+ "\0"
+ /* _mesa_function_pool[15262]: RasterPos2i (offset 66) */
+ "ii\0"
+ "glRasterPos2i\0"
+ "\0"
+ /* _mesa_function_pool[15280]: ValidateProgramARB (will be remapped) */
+ "i\0"
+ "glValidateProgram\0"
+ "glValidateProgramARB\0"
+ "\0"
+ /* _mesa_function_pool[15322]: TexParameteriv (offset 181) */
+ "iip\0"
+ "glTexParameteriv\0"
+ "\0"
+ /* _mesa_function_pool[15344]: UnlockArraysEXT (will be remapped) */
+ "\0"
+ "glUnlockArraysEXT\0"
+ "\0"
+ /* _mesa_function_pool[15364]: TexCoord2fColor3fVertex3fSUN (dynamic) */
+ "ffffffff\0"
+ "glTexCoord2fColor3fVertex3fSUN\0"
+ "\0"
+ /* _mesa_function_pool[15405]: WindowPos3fvMESA (will be remapped) */
+ "p\0"
+ "glWindowPos3fv\0"
+ "glWindowPos3fvARB\0"
+ "glWindowPos3fvMESA\0"
+ "\0"
+ /* _mesa_function_pool[15460]: RasterPos2f (offset 64) */
+ "ff\0"
+ "glRasterPos2f\0"
+ "\0"
+ /* _mesa_function_pool[15478]: VertexAttrib1svNV (will be remapped) */
+ "ip\0"
+ "glVertexAttrib1svNV\0"
+ "\0"
+ /* _mesa_function_pool[15502]: RasterPos2d (offset 62) */
+ "dd\0"
+ "glRasterPos2d\0"
+ "\0"
+ /* _mesa_function_pool[15520]: RasterPos3fv (offset 73) */
+ "p\0"
+ "glRasterPos3fv\0"
+ "\0"
+ /* _mesa_function_pool[15538]: CopyTexSubImage3D (offset 373) */
+ "iiiiiiiii\0"
+ "glCopyTexSubImage3D\0"
+ "glCopyTexSubImage3DEXT\0"
+ "\0"
+ /* _mesa_function_pool[15592]: VertexAttrib2dARB (will be remapped) */
+ "idd\0"
+ "glVertexAttrib2d\0"
+ "glVertexAttrib2dARB\0"
+ "\0"
+ /* _mesa_function_pool[15634]: Color4ub (offset 35) */
+ "iiii\0"
+ "glColor4ub\0"
+ "\0"
+ /* _mesa_function_pool[15651]: GetInteger64v (will be remapped) */
+ "ip\0"
+ "glGetInteger64v\0"
+ "\0"
+ /* _mesa_function_pool[15671]: TextureColorMaskSGIS (dynamic) */
+ "iiii\0"
+ "glTextureColorMaskSGIS\0"
+ "\0"
+ /* _mesa_function_pool[15700]: RasterPos2s (offset 68) */
+ "ii\0"
+ "glRasterPos2s\0"
+ "\0"
+ /* _mesa_function_pool[15718]: GetColorTable (offset 343) */
+ "iiip\0"
+ "glGetColorTable\0"
+ "glGetColorTableSGI\0"
+ "glGetColorTableEXT\0"
+ "\0"
+ /* _mesa_function_pool[15778]: SelectBuffer (offset 195) */
+ "ip\0"
+ "glSelectBuffer\0"
+ "\0"
+ /* _mesa_function_pool[15797]: Indexiv (offset 49) */
+ "p\0"
+ "glIndexiv\0"
+ "\0"
+ /* _mesa_function_pool[15810]: TexCoord3i (offset 114) */
+ "iii\0"
+ "glTexCoord3i\0"
+ "\0"
+ /* _mesa_function_pool[15828]: CopyColorTable (offset 342) */
+ "iiiii\0"
+ "glCopyColorTable\0"
+ "glCopyColorTableSGI\0"
+ "\0"
+ /* _mesa_function_pool[15872]: GetHistogramParameterfv (offset 362) */
+ "iip\0"
+ "glGetHistogramParameterfv\0"
+ "glGetHistogramParameterfvEXT\0"
+ "\0"
+ /* _mesa_function_pool[15932]: Frustum (offset 289) */
+ "dddddd\0"
+ "glFrustum\0"
+ "\0"
+ /* _mesa_function_pool[15950]: GetString (offset 275) */
+ "i\0"
+ "glGetString\0"
+ "\0"
+ /* _mesa_function_pool[15965]: ColorPointervINTEL (dynamic) */
+ "iip\0"
+ "glColorPointervINTEL\0"
+ "\0"
+ /* _mesa_function_pool[15991]: TexEnvf (offset 184) */
+ "iif\0"
+ "glTexEnvf\0"
+ "\0"
+ /* _mesa_function_pool[16006]: TexCoord3d (offset 110) */
+ "ddd\0"
+ "glTexCoord3d\0"
+ "\0"
+ /* _mesa_function_pool[16024]: AlphaFragmentOp1ATI (will be remapped) */
+ "iiiiii\0"
+ "glAlphaFragmentOp1ATI\0"
+ "\0"
+ /* _mesa_function_pool[16054]: TexCoord3f (offset 112) */
+ "fff\0"
+ "glTexCoord3f\0"
+ "\0"
+ /* _mesa_function_pool[16072]: MultiTexCoord3ivARB (offset 397) */
+ "ip\0"
+ "glMultiTexCoord3iv\0"
+ "glMultiTexCoord3ivARB\0"
+ "\0"
+ /* _mesa_function_pool[16117]: MultiTexCoord2sARB (offset 390) */
+ "iii\0"
+ "glMultiTexCoord2s\0"
+ "glMultiTexCoord2sARB\0"
+ "\0"
+ /* _mesa_function_pool[16161]: VertexAttrib1dvARB (will be remapped) */
+ "ip\0"
+ "glVertexAttrib1dv\0"
+ "glVertexAttrib1dvARB\0"
+ "\0"
+ /* _mesa_function_pool[16204]: GetnHistogramARB (will be remapped) */
+ "iiiiip\0"
+ "glGetnHistogramARB\0"
+ "\0"
+ /* _mesa_function_pool[16231]: DeleteTextures (offset 327) */
+ "ip\0"
+ "glDeleteTextures\0"
+ "glDeleteTexturesEXT\0"
+ "\0"
+ /* _mesa_function_pool[16272]: TexCoordPointerEXT (will be remapped) */
+ "iiiip\0"
+ "glTexCoordPointerEXT\0"
+ "\0"
+ /* _mesa_function_pool[16300]: TexSubImage4DSGIS (dynamic) */
+ "iiiiiiiiiiiip\0"
+ "glTexSubImage4DSGIS\0"
+ "\0"
+ /* _mesa_function_pool[16335]: TexCoord3s (offset 116) */
+ "iii\0"
+ "glTexCoord3s\0"
+ "\0"
+ /* _mesa_function_pool[16353]: GetTexLevelParameteriv (offset 285) */
+ "iiip\0"
+ "glGetTexLevelParameteriv\0"
+ "\0"
+ /* _mesa_function_pool[16384]: CombinerStageParameterfvNV (dynamic) */
+ "iip\0"
+ "glCombinerStageParameterfvNV\0"
+ "\0"
+ /* _mesa_function_pool[16418]: StopInstrumentsSGIX (dynamic) */
+ "i\0"
+ "glStopInstrumentsSGIX\0"
+ "\0"
+ /* _mesa_function_pool[16443]: TexCoord4fColor4fNormal3fVertex4fSUN (dynamic) */
+ "fffffffffffffff\0"
+ "glTexCoord4fColor4fNormal3fVertex4fSUN\0"
+ "\0"
+ /* _mesa_function_pool[16499]: ClearAccum (offset 204) */
+ "ffff\0"
+ "glClearAccum\0"
+ "\0"
+ /* _mesa_function_pool[16518]: DeformSGIX (dynamic) */
+ "i\0"
+ "glDeformSGIX\0"
+ "\0"
+ /* _mesa_function_pool[16534]: GetVertexAttribfvARB (will be remapped) */
+ "iip\0"
+ "glGetVertexAttribfv\0"
+ "glGetVertexAttribfvARB\0"
+ "\0"
+ /* _mesa_function_pool[16582]: SecondaryColor3ivEXT (will be remapped) */
+ "p\0"
+ "glSecondaryColor3iv\0"
+ "glSecondaryColor3ivEXT\0"
+ "\0"
+ /* _mesa_function_pool[16628]: TexCoord4iv (offset 123) */
+ "p\0"
+ "glTexCoord4iv\0"
+ "\0"
+ /* _mesa_function_pool[16645]: VertexAttribI4uiEXT (will be remapped) */
+ "iiiii\0"
+ "glVertexAttribI4uiEXT\0"
+ "glVertexAttribI4ui\0"
+ "\0"
+ /* _mesa_function_pool[16693]: GetFragmentMaterialfvSGIX (dynamic) */
+ "iip\0"
+ "glGetFragmentMaterialfvSGIX\0"
+ "\0"
+ /* _mesa_function_pool[16726]: UniformMatrix4x2fv (will be remapped) */
+ "iiip\0"
+ "glUniformMatrix4x2fv\0"
+ "\0"
+ /* _mesa_function_pool[16753]: GetDetailTexFuncSGIS (dynamic) */
+ "ip\0"
+ "glGetDetailTexFuncSGIS\0"
+ "\0"
+ /* _mesa_function_pool[16780]: GetCombinerStageParameterfvNV (dynamic) */
+ "iip\0"
+ "glGetCombinerStageParameterfvNV\0"
+ "\0"
+ /* _mesa_function_pool[16817]: SamplerParameterIiv (will be remapped) */
+ "iip\0"
+ "glSamplerParameterIiv\0"
+ "\0"
+ /* _mesa_function_pool[16844]: PolygonOffset (offset 319) */
+ "ff\0"
+ "glPolygonOffset\0"
+ "\0"
+ /* _mesa_function_pool[16864]: BindVertexArray (will be remapped) */
+ "i\0"
+ "glBindVertexArray\0"
+ "\0"
+ /* _mesa_function_pool[16885]: Color4ubVertex2fvSUN (dynamic) */
+ "pp\0"
+ "glColor4ubVertex2fvSUN\0"
+ "\0"
+ /* _mesa_function_pool[16912]: Rectd (offset 86) */
+ "dddd\0"
+ "glRectd\0"
+ "\0"
+ /* _mesa_function_pool[16926]: TexFilterFuncSGIS (dynamic) */
+ "iiip\0"
+ "glTexFilterFuncSGIS\0"
+ "\0"
+ /* _mesa_function_pool[16952]: TextureBarrierNV (will be remapped) */
+ "\0"
+ "glTextureBarrierNV\0"
+ "\0"
+ /* _mesa_function_pool[16973]: SamplerParameterfv (will be remapped) */
+ "iip\0"
+ "glSamplerParameterfv\0"
+ "\0"
+ /* _mesa_function_pool[16999]: ColorMaskIndexedEXT (will be remapped) */
+ "iiiii\0"
+ "glColorMaskIndexedEXT\0"
+ "glColorMaski\0"
+ "\0"
+ /* _mesa_function_pool[17041]: GetAttribLocationARB (will be remapped) */
+ "ip\0"
+ "glGetAttribLocation\0"
+ "glGetAttribLocationARB\0"
+ "\0"
+ /* _mesa_function_pool[17088]: RasterPos3i (offset 74) */
+ "iii\0"
+ "glRasterPos3i\0"
+ "\0"
+ /* _mesa_function_pool[17107]: VertexAttrib4ubvARB (will be remapped) */
+ "ip\0"
+ "glVertexAttrib4ubv\0"
+ "glVertexAttrib4ubvARB\0"
+ "\0"
+ /* _mesa_function_pool[17152]: DetailTexFuncSGIS (dynamic) */
+ "iip\0"
+ "glDetailTexFuncSGIS\0"
+ "\0"
+ /* _mesa_function_pool[17177]: Normal3fVertex3fSUN (dynamic) */
+ "ffffff\0"
+ "glNormal3fVertex3fSUN\0"
+ "\0"
+ /* _mesa_function_pool[17207]: CopyTexImage2D (offset 324) */
+ "iiiiiiii\0"
+ "glCopyTexImage2D\0"
+ "glCopyTexImage2DEXT\0"
+ "\0"
+ /* _mesa_function_pool[17254]: GetBufferPointervARB (will be remapped) */
+ "iip\0"
+ "glGetBufferPointerv\0"
+ "glGetBufferPointervARB\0"
+ "\0"
+ /* _mesa_function_pool[17302]: ProgramEnvParameter4fARB (will be remapped) */
+ "iiffff\0"
+ "glProgramEnvParameter4fARB\0"
+ "glProgramParameter4fNV\0"
+ "\0"
+ /* _mesa_function_pool[17360]: Uniform3ivARB (will be remapped) */
+ "iip\0"
+ "glUniform3iv\0"
+ "glUniform3ivARB\0"
+ "\0"
+ /* _mesa_function_pool[17394]: Lightfv (offset 160) */
+ "iip\0"
+ "glLightfv\0"
+ "\0"
+ /* _mesa_function_pool[17409]: PrimitiveRestartIndexNV (will be remapped) */
+ "i\0"
+ "glPrimitiveRestartIndexNV\0"
+ "glPrimitiveRestartIndex\0"
+ "\0"
+ /* _mesa_function_pool[17462]: ClearDepth (offset 208) */
+ "d\0"
+ "glClearDepth\0"
+ "\0"
+ /* _mesa_function_pool[17478]: GetFenceivNV (will be remapped) */
+ "iip\0"
+ "glGetFenceivNV\0"
+ "\0"
+ /* _mesa_function_pool[17498]: WindowPos4dvMESA (will be remapped) */
+ "p\0"
+ "glWindowPos4dvMESA\0"
+ "\0"
+ /* _mesa_function_pool[17520]: ColorSubTable (offset 346) */
+ "iiiiip\0"
+ "glColorSubTable\0"
+ "glColorSubTableEXT\0"
+ "\0"
+ /* _mesa_function_pool[17563]: Color4fv (offset 30) */
+ "p\0"
+ "glColor4fv\0"
+ "\0"
+ /* _mesa_function_pool[17577]: MultiTexCoord4ivARB (offset 405) */
+ "ip\0"
+ "glMultiTexCoord4iv\0"
+ "glMultiTexCoord4ivARB\0"
+ "\0"
+ /* _mesa_function_pool[17622]: GetnMinmaxARB (will be remapped) */
+ "iiiiip\0"
+ "glGetnMinmaxARB\0"
+ "\0"
+ /* _mesa_function_pool[17646]: ProgramLocalParameters4fvEXT (will be remapped) */
+ "iiip\0"
+ "glProgramLocalParameters4fvEXT\0"
+ "\0"
+ /* _mesa_function_pool[17683]: ColorPointer (offset 308) */
+ "iiip\0"
+ "glColorPointer\0"
+ "\0"
+ /* _mesa_function_pool[17704]: Rects (offset 92) */
+ "iiii\0"
+ "glRects\0"
+ "\0"
+ /* _mesa_function_pool[17718]: GetMapAttribParameterfvNV (dynamic) */
+ "iiip\0"
+ "glGetMapAttribParameterfvNV\0"
+ "\0"
+ /* _mesa_function_pool[17752]: CreateShaderProgramEXT (will be remapped) */
+ "ip\0"
+ "glCreateShaderProgramEXT\0"
+ "\0"
+ /* _mesa_function_pool[17781]: ActiveProgramEXT (will be remapped) */
+ "i\0"
+ "glActiveProgramEXT\0"
+ "\0"
+ /* _mesa_function_pool[17803]: Lightiv (offset 162) */
+ "iip\0"
+ "glLightiv\0"
+ "\0"
+ /* _mesa_function_pool[17818]: VertexAttrib4sARB (will be remapped) */
+ "iiiii\0"
+ "glVertexAttrib4s\0"
+ "glVertexAttrib4sARB\0"
+ "\0"
+ /* _mesa_function_pool[17862]: GetQueryObjectuivARB (will be remapped) */
+ "iip\0"
+ "glGetQueryObjectuiv\0"
+ "glGetQueryObjectuivARB\0"
+ "\0"
+ /* _mesa_function_pool[17910]: GetTexParameteriv (offset 283) */
+ "iip\0"
+ "glGetTexParameteriv\0"
+ "\0"
+ /* _mesa_function_pool[17935]: MapParameterivNV (dynamic) */
+ "iip\0"
+ "glMapParameterivNV\0"
+ "\0"
+ /* _mesa_function_pool[17959]: GenRenderbuffersEXT (will be remapped) */
+ "ip\0"
+ "glGenRenderbuffers\0"
+ "glGenRenderbuffersEXT\0"
+ "\0"
+ /* _mesa_function_pool[18004]: ClearBufferfv (will be remapped) */
+ "iip\0"
+ "glClearBufferfv\0"
+ "\0"
+ /* _mesa_function_pool[18025]: VertexAttrib2dvARB (will be remapped) */
+ "ip\0"
+ "glVertexAttrib2dv\0"
+ "glVertexAttrib2dvARB\0"
+ "\0"
+ /* _mesa_function_pool[18068]: EdgeFlagPointerEXT (will be remapped) */
+ "iip\0"
+ "glEdgeFlagPointerEXT\0"
+ "\0"
+ /* _mesa_function_pool[18094]: VertexAttribs2svNV (will be remapped) */
+ "iip\0"
+ "glVertexAttribs2svNV\0"
+ "\0"
+ /* _mesa_function_pool[18120]: WeightbvARB (dynamic) */
+ "ip\0"
+ "glWeightbvARB\0"
+ "\0"
+ /* _mesa_function_pool[18138]: VertexAttrib2fvARB (will be remapped) */
+ "ip\0"
+ "glVertexAttrib2fv\0"
+ "glVertexAttrib2fvARB\0"
+ "\0"
+ /* _mesa_function_pool[18181]: GetBufferParameterivARB (will be remapped) */
+ "iip\0"
+ "glGetBufferParameteriv\0"
+ "glGetBufferParameterivARB\0"
+ "\0"
+ /* _mesa_function_pool[18235]: Rectdv (offset 87) */
+ "pp\0"
+ "glRectdv\0"
+ "\0"
+ /* _mesa_function_pool[18248]: ListParameteriSGIX (dynamic) */
+ "iii\0"
+ "glListParameteriSGIX\0"
+ "\0"
+ /* _mesa_function_pool[18274]: BlendEquationiARB (will be remapped) */
+ "ii\0"
+ "glBlendEquationiARB\0"
+ "glBlendEquationIndexedAMD\0"
+ "\0"
+ /* _mesa_function_pool[18324]: ReplacementCodeuiColor4fNormal3fVertex3fSUN (dynamic) */
+ "iffffffffff\0"
+ "glReplacementCodeuiColor4fNormal3fVertex3fSUN\0"
+ "\0"
+ /* _mesa_function_pool[18383]: InstrumentsBufferSGIX (dynamic) */
+ "ip\0"
+ "glInstrumentsBufferSGIX\0"
+ "\0"
+ /* _mesa_function_pool[18411]: VertexAttrib4NivARB (will be remapped) */
+ "ip\0"
+ "glVertexAttrib4Niv\0"
+ "glVertexAttrib4NivARB\0"
+ "\0"
+ /* _mesa_function_pool[18456]: DrawArraysInstancedARB (will be remapped) */
+ "iiii\0"
+ "glDrawArraysInstancedARB\0"
+ "glDrawArraysInstancedEXT\0"
+ "glDrawArraysInstanced\0"
+ "\0"
+ /* _mesa_function_pool[18534]: GetAttachedShaders (will be remapped) */
+ "iipp\0"
+ "glGetAttachedShaders\0"
+ "\0"
+ /* _mesa_function_pool[18561]: GenVertexArraysAPPLE (will be remapped) */
+ "ip\0"
+ "glGenVertexArraysAPPLE\0"
+ "\0"
+ /* _mesa_function_pool[18588]: ClearBufferfi (will be remapped) */
+ "iifi\0"
+ "glClearBufferfi\0"
+ "\0"
+ /* _mesa_function_pool[18610]: Materialiv (offset 172) */
+ "iip\0"
+ "glMaterialiv\0"
+ "\0"
+ /* _mesa_function_pool[18628]: PushClientAttrib (offset 335) */
+ "i\0"
+ "glPushClientAttrib\0"
+ "\0"
+ /* _mesa_function_pool[18650]: SamplerParameteriv (will be remapped) */
+ "iip\0"
+ "glSamplerParameteriv\0"
+ "\0"
+ /* _mesa_function_pool[18676]: TexCoord2fColor4fNormal3fVertex3fvSUN (dynamic) */
+ "pppp\0"
+ "glTexCoord2fColor4fNormal3fVertex3fvSUN\0"
+ "\0"
+ /* _mesa_function_pool[18722]: WindowPos2iMESA (will be remapped) */
+ "ii\0"
+ "glWindowPos2i\0"
+ "glWindowPos2iARB\0"
+ "glWindowPos2iMESA\0"
+ "\0"
+ /* _mesa_function_pool[18775]: SampleMaskSGIS (will be remapped) */
+ "fi\0"
+ "glSampleMaskSGIS\0"
+ "glSampleMaskEXT\0"
+ "\0"
+ /* _mesa_function_pool[18812]: SecondaryColor3fvEXT (will be remapped) */
+ "p\0"
+ "glSecondaryColor3fv\0"
+ "glSecondaryColor3fvEXT\0"
+ "\0"
+ /* _mesa_function_pool[18858]: PolygonMode (offset 174) */
+ "ii\0"
+ "glPolygonMode\0"
+ "\0"
+ /* _mesa_function_pool[18876]: CompressedTexSubImage1DARB (will be remapped) */
+ "iiiiiip\0"
+ "glCompressedTexSubImage1D\0"
+ "glCompressedTexSubImage1DARB\0"
+ "\0"
+ /* _mesa_function_pool[18940]: VertexAttribI1iEXT (will be remapped) */
+ "ii\0"
+ "glVertexAttribI1iEXT\0"
+ "glVertexAttribI1i\0"
+ "\0"
+ /* _mesa_function_pool[18983]: TexCoord2fNormal3fVertex3fSUN (dynamic) */
+ "ffffffff\0"
+ "glTexCoord2fNormal3fVertex3fSUN\0"
+ "\0"
+ /* _mesa_function_pool[19025]: GetVertexAttribivNV (will be remapped) */
+ "iip\0"
+ "glGetVertexAttribivNV\0"
+ "\0"
+ /* _mesa_function_pool[19052]: GetProgramStringARB (will be remapped) */
+ "iip\0"
+ "glGetProgramStringARB\0"
+ "\0"
+ /* _mesa_function_pool[19079]: GetnUniformdvARB (will be remapped) */
+ "iiip\0"
+ "glGetnUniformdvARB\0"
+ "\0"
+ /* _mesa_function_pool[19104]: VertexAttribIPointerEXT (will be remapped) */
+ "iiiip\0"
+ "glVertexAttribIPointerEXT\0"
+ "glVertexAttribIPointer\0"
+ "\0"
+ /* _mesa_function_pool[19160]: TexBumpParameterfvATI (will be remapped) */
+ "ip\0"
+ "glTexBumpParameterfvATI\0"
+ "\0"
+ /* _mesa_function_pool[19188]: Tangent3ivEXT (dynamic) */
+ "p\0"
+ "glTangent3ivEXT\0"
+ "\0"
+ /* _mesa_function_pool[19207]: CompileShaderARB (will be remapped) */
+ "i\0"
+ "glCompileShader\0"
+ "glCompileShaderARB\0"
+ "\0"
+ /* _mesa_function_pool[19245]: DeleteShader (will be remapped) */
+ "i\0"
+ "glDeleteShader\0"
+ "\0"
+ /* _mesa_function_pool[19263]: DisableClientState (offset 309) */
+ "i\0"
+ "glDisableClientState\0"
+ "\0"
+ /* _mesa_function_pool[19287]: TexGeni (offset 192) */
+ "iii\0"
+ "glTexGeni\0"
+ "\0"
+ /* _mesa_function_pool[19302]: TexGenf (offset 190) */
+ "iif\0"
+ "glTexGenf\0"
+ "\0"
+ /* _mesa_function_pool[19317]: Uniform3fARB (will be remapped) */
+ "ifff\0"
+ "glUniform3f\0"
+ "glUniform3fARB\0"
+ "\0"
+ /* _mesa_function_pool[19350]: TexGend (offset 188) */
+ "iid\0"
+ "glTexGend\0"
+ "\0"
+ /* _mesa_function_pool[19365]: ListParameterfvSGIX (dynamic) */
+ "iip\0"
+ "glListParameterfvSGIX\0"
+ "\0"
+ /* _mesa_function_pool[19392]: GetPolygonStipple (offset 274) */
+ "p\0"
+ "glGetPolygonStipple\0"
+ "\0"
+ /* _mesa_function_pool[19415]: Tangent3dvEXT (dynamic) */
+ "p\0"
+ "glTangent3dvEXT\0"
+ "\0"
+ /* _mesa_function_pool[19434]: BindBufferOffsetEXT (will be remapped) */
+ "iiii\0"
+ "glBindBufferOffsetEXT\0"
+ "\0"
+ /* _mesa_function_pool[19462]: WindowPos3sMESA (will be remapped) */
+ "iii\0"
+ "glWindowPos3s\0"
+ "glWindowPos3sARB\0"
+ "glWindowPos3sMESA\0"
+ "\0"
+ /* _mesa_function_pool[19516]: VertexAttrib2svNV (will be remapped) */
+ "ip\0"
+ "glVertexAttrib2svNV\0"
+ "\0"
+ /* _mesa_function_pool[19540]: DisableIndexedEXT (will be remapped) */
+ "ii\0"
+ "glDisableIndexedEXT\0"
+ "glDisablei\0"
+ "\0"
+ /* _mesa_function_pool[19575]: BindBufferBaseEXT (will be remapped) */
+ "iii\0"
+ "glBindBufferBaseEXT\0"
+ "glBindBufferBase\0"
+ "\0"
+ /* _mesa_function_pool[19617]: TexCoord2fVertex3fvSUN (dynamic) */
+ "pp\0"
+ "glTexCoord2fVertex3fvSUN\0"
+ "\0"
+ /* _mesa_function_pool[19646]: WindowPos4sMESA (will be remapped) */
+ "iiii\0"
+ "glWindowPos4sMESA\0"
+ "\0"
+ /* _mesa_function_pool[19670]: GetnPixelMapuivARB (will be remapped) */
+ "iip\0"
+ "glGetnPixelMapuivARB\0"
+ "\0"
+ /* _mesa_function_pool[19696]: VertexAttrib4NuivARB (will be remapped) */
+ "ip\0"
+ "glVertexAttrib4Nuiv\0"
+ "glVertexAttrib4NuivARB\0"
+ "\0"
+ /* _mesa_function_pool[19743]: ClientActiveTextureARB (offset 375) */
+ "i\0"
+ "glClientActiveTexture\0"
+ "glClientActiveTextureARB\0"
+ "\0"
+ /* _mesa_function_pool[19793]: GetSamplerParameterIuiv (will be remapped) */
+ "iip\0"
+ "glGetSamplerParameterIuiv\0"
+ "\0"
+ /* _mesa_function_pool[19824]: ReplacementCodeusvSUN (dynamic) */
+ "p\0"
+ "glReplacementCodeusvSUN\0"
+ "\0"
+ /* _mesa_function_pool[19851]: Uniform4fARB (will be remapped) */
+ "iffff\0"
+ "glUniform4f\0"
+ "glUniform4fARB\0"
+ "\0"
+ /* _mesa_function_pool[19885]: Color4sv (offset 34) */
+ "p\0"
+ "glColor4sv\0"
+ "\0"
+ /* _mesa_function_pool[19899]: FlushMappedBufferRange (will be remapped) */
+ "iii\0"
+ "glFlushMappedBufferRange\0"
+ "\0"
+ /* _mesa_function_pool[19929]: IsProgramNV (will be remapped) */
+ "i\0"
+ "glIsProgramARB\0"
+ "glIsProgramNV\0"
+ "\0"
+ /* _mesa_function_pool[19961]: FlushMappedBufferRangeAPPLE (will be remapped) */
+ "iii\0"
+ "glFlushMappedBufferRangeAPPLE\0"
+ "\0"
+ /* _mesa_function_pool[19996]: PixelZoom (offset 246) */
+ "ff\0"
+ "glPixelZoom\0"
+ "\0"
+ /* _mesa_function_pool[20012]: ReplacementCodePointerSUN (dynamic) */
+ "iip\0"
+ "glReplacementCodePointerSUN\0"
+ "\0"
+ /* _mesa_function_pool[20045]: ProgramEnvParameter4dARB (will be remapped) */
+ "iidddd\0"
+ "glProgramEnvParameter4dARB\0"
+ "glProgramParameter4dNV\0"
+ "\0"
+ /* _mesa_function_pool[20103]: ColorTableParameterfv (offset 340) */
+ "iip\0"
+ "glColorTableParameterfv\0"
+ "glColorTableParameterfvSGI\0"
+ "\0"
+ /* _mesa_function_pool[20159]: FragmentLightModelfSGIX (dynamic) */
+ "if\0"
+ "glFragmentLightModelfSGIX\0"
+ "\0"
+ /* _mesa_function_pool[20189]: Binormal3bvEXT (dynamic) */
+ "p\0"
+ "glBinormal3bvEXT\0"
+ "\0"
+ /* _mesa_function_pool[20209]: PixelMapuiv (offset 252) */
+ "iip\0"
+ "glPixelMapuiv\0"
+ "\0"
+ /* _mesa_function_pool[20228]: Color3dv (offset 12) */
+ "p\0"
+ "glColor3dv\0"
+ "\0"
+ /* _mesa_function_pool[20242]: IsTexture (offset 330) */
+ "i\0"
+ "glIsTexture\0"
+ "glIsTextureEXT\0"
+ "\0"
+ /* _mesa_function_pool[20272]: GenSamplers (will be remapped) */
+ "ip\0"
+ "glGenSamplers\0"
+ "\0"
+ /* _mesa_function_pool[20290]: VertexWeightfvEXT (dynamic) */
+ "p\0"
+ "glVertexWeightfvEXT\0"
+ "\0"
+ /* _mesa_function_pool[20313]: VertexAttrib1dARB (will be remapped) */
+ "id\0"
+ "glVertexAttrib1d\0"
+ "glVertexAttrib1dARB\0"
+ "\0"
+ /* _mesa_function_pool[20354]: ImageTransformParameterivHP (dynamic) */
+ "iip\0"
+ "glImageTransformParameterivHP\0"
+ "\0"
+ /* _mesa_function_pool[20389]: TexCoord4i (offset 122) */
+ "iiii\0"
+ "glTexCoord4i\0"
+ "\0"
+ /* _mesa_function_pool[20408]: DeleteQueriesARB (will be remapped) */
+ "ip\0"
+ "glDeleteQueries\0"
+ "glDeleteQueriesARB\0"
+ "\0"
+ /* _mesa_function_pool[20447]: Color4ubVertex2fSUN (dynamic) */
+ "iiiiff\0"
+ "glColor4ubVertex2fSUN\0"
+ "\0"
+ /* _mesa_function_pool[20477]: FragmentColorMaterialSGIX (dynamic) */
+ "ii\0"
+ "glFragmentColorMaterialSGIX\0"
+ "\0"
+ /* _mesa_function_pool[20509]: CurrentPaletteMatrixARB (dynamic) */
+ "i\0"
+ "glCurrentPaletteMatrixARB\0"
+ "\0"
+ /* _mesa_function_pool[20538]: GetMapdv (offset 266) */
+ "iip\0"
+ "glGetMapdv\0"
+ "\0"
+ /* _mesa_function_pool[20554]: ObjectPurgeableAPPLE (will be remapped) */
+ "iii\0"
+ "glObjectPurgeableAPPLE\0"
+ "\0"
+ /* _mesa_function_pool[20582]: GetStringi (will be remapped) */
+ "ii\0"
+ "glGetStringi\0"
+ "\0"
+ /* _mesa_function_pool[20599]: SamplePatternSGIS (will be remapped) */
+ "i\0"
+ "glSamplePatternSGIS\0"
+ "glSamplePatternEXT\0"
+ "\0"
+ /* _mesa_function_pool[20641]: PixelStoref (offset 249) */
+ "if\0"
+ "glPixelStoref\0"
+ "\0"
+ /* _mesa_function_pool[20659]: IsQueryARB (will be remapped) */
+ "i\0"
+ "glIsQuery\0"
+ "glIsQueryARB\0"
+ "\0"
+ /* _mesa_function_pool[20685]: ReplacementCodeuiColor4ubVertex3fSUN (dynamic) */
+ "iiiiifff\0"
+ "glReplacementCodeuiColor4ubVertex3fSUN\0"
+ "\0"
+ /* _mesa_function_pool[20734]: PixelStorei (offset 250) */
+ "ii\0"
+ "glPixelStorei\0"
+ "\0"
+ /* _mesa_function_pool[20752]: VertexAttrib4usvARB (will be remapped) */
+ "ip\0"
+ "glVertexAttrib4usv\0"
+ "glVertexAttrib4usvARB\0"
+ "\0"
+ /* _mesa_function_pool[20797]: LinkProgramARB (will be remapped) */
+ "i\0"
+ "glLinkProgram\0"
+ "glLinkProgramARB\0"
+ "\0"
+ /* _mesa_function_pool[20831]: VertexAttrib2fNV (will be remapped) */
+ "iff\0"
+ "glVertexAttrib2fNV\0"
+ "\0"
+ /* _mesa_function_pool[20855]: ShaderSourceARB (will be remapped) */
+ "iipp\0"
+ "glShaderSource\0"
+ "glShaderSourceARB\0"
+ "\0"
+ /* _mesa_function_pool[20894]: FragmentMaterialiSGIX (dynamic) */
+ "iii\0"
+ "glFragmentMaterialiSGIX\0"
+ "\0"
+ /* _mesa_function_pool[20923]: EvalCoord2dv (offset 233) */
+ "p\0"
+ "glEvalCoord2dv\0"
+ "\0"
+ /* _mesa_function_pool[20941]: VertexAttrib3svARB (will be remapped) */
+ "ip\0"
+ "glVertexAttrib3sv\0"
+ "glVertexAttrib3svARB\0"
+ "\0"
+ /* _mesa_function_pool[20984]: ColorMaterial (offset 151) */
+ "ii\0"
+ "glColorMaterial\0"
+ "\0"
+ /* _mesa_function_pool[21004]: CompressedTexSubImage3DARB (will be remapped) */
+ "iiiiiiiiiip\0"
+ "glCompressedTexSubImage3D\0"
+ "glCompressedTexSubImage3DARB\0"
+ "\0"
+ /* _mesa_function_pool[21072]: WindowPos2ivMESA (will be remapped) */
+ "p\0"
+ "glWindowPos2iv\0"
+ "glWindowPos2ivARB\0"
+ "glWindowPos2ivMESA\0"
+ "\0"
+ /* _mesa_function_pool[21127]: IsFramebufferEXT (will be remapped) */
+ "i\0"
+ "glIsFramebuffer\0"
+ "glIsFramebufferEXT\0"
+ "\0"
+ /* _mesa_function_pool[21165]: Uniform4ivARB (will be remapped) */
+ "iip\0"
+ "glUniform4iv\0"
+ "glUniform4ivARB\0"
+ "\0"
+ /* _mesa_function_pool[21199]: GetVertexAttribdvARB (will be remapped) */
+ "iip\0"
+ "glGetVertexAttribdv\0"
+ "glGetVertexAttribdvARB\0"
+ "\0"
+ /* _mesa_function_pool[21247]: TexBumpParameterivATI (will be remapped) */
+ "ip\0"
+ "glTexBumpParameterivATI\0"
+ "\0"
+ /* _mesa_function_pool[21275]: GetSeparableFilter (offset 359) */
+ "iiippp\0"
+ "glGetSeparableFilter\0"
+ "glGetSeparableFilterEXT\0"
+ "\0"
+ /* _mesa_function_pool[21328]: Binormal3dEXT (dynamic) */
+ "ddd\0"
+ "glBinormal3dEXT\0"
+ "\0"
+ /* _mesa_function_pool[21349]: SpriteParameteriSGIX (dynamic) */
+ "ii\0"
+ "glSpriteParameteriSGIX\0"
+ "\0"
+ /* _mesa_function_pool[21376]: RequestResidentProgramsNV (will be remapped) */
+ "ip\0"
+ "glRequestResidentProgramsNV\0"
+ "\0"
+ /* _mesa_function_pool[21408]: TagSampleBufferSGIX (dynamic) */
+ "\0"
+ "glTagSampleBufferSGIX\0"
+ "\0"
+ /* _mesa_function_pool[21432]: TransformFeedbackVaryingsEXT (will be remapped) */
+ "iipi\0"
+ "glTransformFeedbackVaryingsEXT\0"
+ "glTransformFeedbackVaryings\0"
+ "\0"
+ /* _mesa_function_pool[21497]: FeedbackBuffer (offset 194) */
+ "iip\0"
+ "glFeedbackBuffer\0"
+ "\0"
+ /* _mesa_function_pool[21519]: RasterPos2iv (offset 67) */
+ "p\0"
+ "glRasterPos2iv\0"
+ "\0"
+ /* _mesa_function_pool[21537]: TexImage1D (offset 182) */
+ "iiiiiiip\0"
+ "glTexImage1D\0"
+ "\0"
+ /* _mesa_function_pool[21560]: ListParameterivSGIX (dynamic) */
+ "iip\0"
+ "glListParameterivSGIX\0"
+ "\0"
+ /* _mesa_function_pool[21587]: MultiDrawElementsEXT (will be remapped) */
+ "ipipi\0"
+ "glMultiDrawElements\0"
+ "glMultiDrawElementsEXT\0"
+ "\0"
+ /* _mesa_function_pool[21637]: Color3s (offset 17) */
+ "iii\0"
+ "glColor3s\0"
+ "\0"
+ /* _mesa_function_pool[21652]: Uniform1ivARB (will be remapped) */
+ "iip\0"
+ "glUniform1iv\0"
+ "glUniform1ivARB\0"
+ "\0"
+ /* _mesa_function_pool[21686]: WindowPos2sMESA (will be remapped) */
+ "ii\0"
+ "glWindowPos2s\0"
+ "glWindowPos2sARB\0"
+ "glWindowPos2sMESA\0"
+ "\0"
+ /* _mesa_function_pool[21739]: WeightusvARB (dynamic) */
+ "ip\0"
+ "glWeightusvARB\0"
+ "\0"
+ /* _mesa_function_pool[21758]: TexCoordPointer (offset 320) */
+ "iiip\0"
+ "glTexCoordPointer\0"
+ "\0"
+ /* _mesa_function_pool[21782]: FogCoordPointerEXT (will be remapped) */
+ "iip\0"
+ "glFogCoordPointer\0"
+ "glFogCoordPointerEXT\0"
+ "\0"
+ /* _mesa_function_pool[21826]: GetnSeparableFilterARB (will be remapped) */
+ "iiiipipp\0"
+ "glGetnSeparableFilterARB\0"
+ "\0"
+ /* _mesa_function_pool[21861]: IndexMaterialEXT (dynamic) */
+ "ii\0"
+ "glIndexMaterialEXT\0"
+ "\0"
+ /* _mesa_function_pool[21884]: Color3i (offset 15) */
+ "iii\0"
+ "glColor3i\0"
+ "\0"
+ /* _mesa_function_pool[21899]: FrontFace (offset 157) */
+ "i\0"
+ "glFrontFace\0"
+ "\0"
+ /* _mesa_function_pool[21914]: EvalCoord2d (offset 232) */
+ "dd\0"
+ "glEvalCoord2d\0"
+ "\0"
+ /* _mesa_function_pool[21932]: SecondaryColor3ubvEXT (will be remapped) */
+ "p\0"
+ "glSecondaryColor3ubv\0"
+ "glSecondaryColor3ubvEXT\0"
+ "\0"
+ /* _mesa_function_pool[21980]: EvalCoord2f (offset 234) */
+ "ff\0"
+ "glEvalCoord2f\0"
+ "\0"
+ /* _mesa_function_pool[21998]: VertexAttrib4dvARB (will be remapped) */
+ "ip\0"
+ "glVertexAttrib4dv\0"
+ "glVertexAttrib4dvARB\0"
+ "\0"
+ /* _mesa_function_pool[22041]: BindAttribLocationARB (will be remapped) */
+ "iip\0"
+ "glBindAttribLocation\0"
+ "glBindAttribLocationARB\0"
+ "\0"
+ /* _mesa_function_pool[22091]: Color3b (offset 9) */
+ "iii\0"
+ "glColor3b\0"
+ "\0"
+ /* _mesa_function_pool[22106]: MultiTexCoord2dARB (offset 384) */
+ "idd\0"
+ "glMultiTexCoord2d\0"
+ "glMultiTexCoord2dARB\0"
+ "\0"
+ /* _mesa_function_pool[22150]: ExecuteProgramNV (will be remapped) */
+ "iip\0"
+ "glExecuteProgramNV\0"
+ "\0"
+ /* _mesa_function_pool[22174]: Color3f (offset 13) */
+ "fff\0"
+ "glColor3f\0"
+ "\0"
+ /* _mesa_function_pool[22189]: LightEnviSGIX (dynamic) */
+ "ii\0"
+ "glLightEnviSGIX\0"
+ "\0"
+ /* _mesa_function_pool[22209]: Color3d (offset 11) */
+ "ddd\0"
+ "glColor3d\0"
+ "\0"
+ /* _mesa_function_pool[22224]: Normal3dv (offset 55) */
+ "p\0"
+ "glNormal3dv\0"
+ "\0"
+ /* _mesa_function_pool[22239]: Lightf (offset 159) */
+ "iif\0"
+ "glLightf\0"
+ "\0"
+ /* _mesa_function_pool[22253]: ReplacementCodeuiSUN (dynamic) */
+ "i\0"
+ "glReplacementCodeuiSUN\0"
+ "\0"
+ /* _mesa_function_pool[22279]: MatrixMode (offset 293) */
+ "i\0"
+ "glMatrixMode\0"
+ "\0"
+ /* _mesa_function_pool[22295]: GetPixelMapusv (offset 273) */
+ "ip\0"
+ "glGetPixelMapusv\0"
+ "\0"
+ /* _mesa_function_pool[22316]: Lighti (offset 161) */
+ "iii\0"
+ "glLighti\0"
+ "\0"
+ /* _mesa_function_pool[22330]: VertexAttribPointerNV (will be remapped) */
+ "iiiip\0"
+ "glVertexAttribPointerNV\0"
+ "\0"
+ /* _mesa_function_pool[22361]: ClearDepthf (will be remapped) */
+ "f\0"
+ "glClearDepthf\0"
+ "\0"
+ /* _mesa_function_pool[22378]: GetBooleanIndexedvEXT (will be remapped) */
+ "iip\0"
+ "glGetBooleanIndexedvEXT\0"
+ "glGetBooleani_v\0"
+ "\0"
+ /* _mesa_function_pool[22423]: GetFramebufferAttachmentParameterivEXT (will be remapped) */
+ "iiip\0"
+ "glGetFramebufferAttachmentParameteriv\0"
+ "glGetFramebufferAttachmentParameterivEXT\0"
+ "\0"
+ /* _mesa_function_pool[22508]: PixelTransformParameterfEXT (dynamic) */
+ "iif\0"
+ "glPixelTransformParameterfEXT\0"
+ "\0"
+ /* _mesa_function_pool[22543]: MultiTexCoord4dvARB (offset 401) */
+ "ip\0"
+ "glMultiTexCoord4dv\0"
+ "glMultiTexCoord4dvARB\0"
+ "\0"
+ /* _mesa_function_pool[22588]: PixelTransformParameteriEXT (dynamic) */
+ "iii\0"
+ "glPixelTransformParameteriEXT\0"
+ "\0"
+ /* _mesa_function_pool[22623]: GetDoublev (offset 260) */
+ "ip\0"
+ "glGetDoublev\0"
+ "\0"
+ /* _mesa_function_pool[22640]: MultMatrixd (offset 295) */
+ "p\0"
+ "glMultMatrixd\0"
+ "\0"
+ /* _mesa_function_pool[22657]: MultMatrixf (offset 294) */
+ "p\0"
+ "glMultMatrixf\0"
+ "\0"
+ /* _mesa_function_pool[22674]: VertexAttribI4bvEXT (will be remapped) */
+ "ip\0"
+ "glVertexAttribI4bvEXT\0"
+ "glVertexAttribI4bv\0"
+ "\0"
+ /* _mesa_function_pool[22719]: TexCoord2fColor4ubVertex3fSUN (dynamic) */
+ "ffiiiifff\0"
+ "glTexCoord2fColor4ubVertex3fSUN\0"
+ "\0"
+ /* _mesa_function_pool[22762]: Uniform1iARB (will be remapped) */
+ "ii\0"
+ "glUniform1i\0"
+ "glUniform1iARB\0"
+ "\0"
+ /* _mesa_function_pool[22793]: GetnMapfvARB (will be remapped) */
+ "iiip\0"
+ "glGetnMapfvARB\0"
+ "\0"
+ /* _mesa_function_pool[22814]: VertexAttribPointerARB (will be remapped) */
+ "iiiiip\0"
+ "glVertexAttribPointer\0"
+ "glVertexAttribPointerARB\0"
+ "\0"
+ /* _mesa_function_pool[22869]: VertexAttrib3sNV (will be remapped) */
+ "iiii\0"
+ "glVertexAttrib3sNV\0"
+ "\0"
+ /* _mesa_function_pool[22894]: SharpenTexFuncSGIS (dynamic) */
+ "iip\0"
+ "glSharpenTexFuncSGIS\0"
+ "\0"
+ /* _mesa_function_pool[22920]: MultiTexCoord4fvARB (offset 403) */
+ "ip\0"
+ "glMultiTexCoord4fv\0"
+ "glMultiTexCoord4fvARB\0"
+ "\0"
+ /* _mesa_function_pool[22965]: Uniform2uiEXT (will be remapped) */
+ "iii\0"
+ "glUniform2uiEXT\0"
+ "glUniform2ui\0"
+ "\0"
+ /* _mesa_function_pool[22999]: UniformMatrix2x3fv (will be remapped) */
+ "iiip\0"
+ "glUniformMatrix2x3fv\0"
+ "\0"
+ /* _mesa_function_pool[23026]: SamplerParameteri (will be remapped) */
+ "iii\0"
+ "glSamplerParameteri\0"
+ "\0"
+ /* _mesa_function_pool[23051]: SamplerParameterf (will be remapped) */
+ "iif\0"
+ "glSamplerParameterf\0"
+ "\0"
+ /* _mesa_function_pool[23076]: CombinerParameteriNV (will be remapped) */
+ "ii\0"
+ "glCombinerParameteriNV\0"
+ "\0"
+ /* _mesa_function_pool[23103]: DeleteAsyncMarkersSGIX (dynamic) */
+ "ii\0"
+ "glDeleteAsyncMarkersSGIX\0"
+ "\0"
+ /* _mesa_function_pool[23132]: ReplacementCodeusSUN (dynamic) */
+ "i\0"
+ "glReplacementCodeusSUN\0"
+ "\0"
+ /* _mesa_function_pool[23158]: IsAsyncMarkerSGIX (dynamic) */
+ "i\0"
+ "glIsAsyncMarkerSGIX\0"
+ "\0"
+ /* _mesa_function_pool[23181]: FrameZoomSGIX (dynamic) */
+ "i\0"
+ "glFrameZoomSGIX\0"
+ "\0"
+ /* _mesa_function_pool[23200]: Normal3fVertex3fvSUN (dynamic) */
+ "pp\0"
+ "glNormal3fVertex3fvSUN\0"
+ "\0"
+ /* _mesa_function_pool[23227]: GetnUniformuivARB (will be remapped) */
+ "iiip\0"
+ "glGetnUniformuivARB\0"
+ "\0"
+ /* _mesa_function_pool[23253]: RasterPos4sv (offset 85) */
+ "p\0"
+ "glRasterPos4sv\0"
+ "\0"
+ /* _mesa_function_pool[23271]: VertexAttrib4NsvARB (will be remapped) */
+ "ip\0"
+ "glVertexAttrib4Nsv\0"
+ "glVertexAttrib4NsvARB\0"
+ "\0"
+ /* _mesa_function_pool[23316]: VertexAttrib3fvARB (will be remapped) */
+ "ip\0"
+ "glVertexAttrib3fv\0"
+ "glVertexAttrib3fvARB\0"
+ "\0"
+ /* _mesa_function_pool[23359]: ClearColor (offset 206) */
+ "ffff\0"
+ "glClearColor\0"
+ "\0"
+ /* _mesa_function_pool[23378]: GetSynciv (will be remapped) */
+ "iiipp\0"
+ "glGetSynciv\0"
+ "\0"
+ /* _mesa_function_pool[23397]: ClearColorIiEXT (will be remapped) */
+ "iiii\0"
+ "glClearColorIiEXT\0"
+ "\0"
+ /* _mesa_function_pool[23421]: DeleteFramebuffersEXT (will be remapped) */
+ "ip\0"
+ "glDeleteFramebuffers\0"
+ "glDeleteFramebuffersEXT\0"
+ "\0"
+ /* _mesa_function_pool[23470]: GlobalAlphaFactorsSUN (dynamic) */
+ "i\0"
+ "glGlobalAlphaFactorsSUN\0"
+ "\0"
+ /* _mesa_function_pool[23497]: IsEnabledIndexedEXT (will be remapped) */
+ "ii\0"
+ "glIsEnabledIndexedEXT\0"
+ "glIsEnabledi\0"
+ "\0"
+ /* _mesa_function_pool[23536]: TexEnviv (offset 187) */
+ "iip\0"
+ "glTexEnviv\0"
+ "\0"
+ /* _mesa_function_pool[23552]: TexSubImage3D (offset 372) */
+ "iiiiiiiiiip\0"
+ "glTexSubImage3D\0"
+ "glTexSubImage3DEXT\0"
+ "\0"
+ /* _mesa_function_pool[23600]: Tangent3fEXT (dynamic) */
+ "fff\0"
+ "glTangent3fEXT\0"
+ "\0"
+ /* _mesa_function_pool[23620]: SecondaryColor3uivEXT (will be remapped) */
+ "p\0"
+ "glSecondaryColor3uiv\0"
+ "glSecondaryColor3uivEXT\0"
+ "\0"
+ /* _mesa_function_pool[23668]: MatrixIndexubvARB (dynamic) */
+ "ip\0"
+ "glMatrixIndexubvARB\0"
+ "\0"
+ /* _mesa_function_pool[23692]: Color4fNormal3fVertex3fSUN (dynamic) */
+ "ffffffffff\0"
+ "glColor4fNormal3fVertex3fSUN\0"
+ "\0"
+ /* _mesa_function_pool[23733]: PixelTexGenParameterfSGIS (will be remapped) */
+ "if\0"
+ "glPixelTexGenParameterfSGIS\0"
+ "\0"
+ /* _mesa_function_pool[23765]: CreateShader (will be remapped) */
+ "i\0"
+ "glCreateShader\0"
+ "\0"
+ /* _mesa_function_pool[23783]: GetColorTableParameterfv (offset 344) */
+ "iip\0"
+ "glGetColorTableParameterfv\0"
+ "glGetColorTableParameterfvSGI\0"
+ "glGetColorTableParameterfvEXT\0"
+ "\0"
+ /* _mesa_function_pool[23875]: FragmentLightModelfvSGIX (dynamic) */
+ "ip\0"
+ "glFragmentLightModelfvSGIX\0"
+ "\0"
+ /* _mesa_function_pool[23906]: Bitmap (offset 8) */
+ "iiffffp\0"
+ "glBitmap\0"
+ "\0"
+ /* _mesa_function_pool[23924]: MultiTexCoord3fARB (offset 394) */
+ "ifff\0"
+ "glMultiTexCoord3f\0"
+ "glMultiTexCoord3fARB\0"
+ "\0"
+ /* _mesa_function_pool[23969]: GetTexLevelParameterfv (offset 284) */
+ "iiip\0"
+ "glGetTexLevelParameterfv\0"
+ "\0"
+ /* _mesa_function_pool[24000]: GetPixelTexGenParameterfvSGIS (will be remapped) */
+ "ip\0"
+ "glGetPixelTexGenParameterfvSGIS\0"
+ "\0"
+ /* _mesa_function_pool[24036]: GenFramebuffersEXT (will be remapped) */
+ "ip\0"
+ "glGenFramebuffers\0"
+ "glGenFramebuffersEXT\0"
+ "\0"
+ /* _mesa_function_pool[24079]: VertexAttribDivisor (will be remapped) */
+ "ii\0"
+ "glVertexAttribDivisor\0"
+ "\0"
+ /* _mesa_function_pool[24105]: GetProgramParameterdvNV (will be remapped) */
+ "iiip\0"
+ "glGetProgramParameterdvNV\0"
+ "\0"
+ /* _mesa_function_pool[24137]: Vertex2sv (offset 133) */
+ "p\0"
+ "glVertex2sv\0"
+ "\0"
+ /* _mesa_function_pool[24152]: GetIntegerv (offset 263) */
+ "ip\0"
+ "glGetIntegerv\0"
+ "\0"
+ /* _mesa_function_pool[24170]: IsVertexArrayAPPLE (will be remapped) */
+ "i\0"
+ "glIsVertexArray\0"
+ "glIsVertexArrayAPPLE\0"
+ "\0"
+ /* _mesa_function_pool[24210]: FragmentLightfvSGIX (dynamic) */
+ "iip\0"
+ "glFragmentLightfvSGIX\0"
+ "\0"
+ /* _mesa_function_pool[24237]: GetnMapdvARB (will be remapped) */
+ "iiip\0"
+ "glGetnMapdvARB\0"
+ "\0"
+ /* _mesa_function_pool[24258]: DetachShader (will be remapped) */
+ "ii\0"
+ "glDetachShader\0"
+ "\0"
+ /* _mesa_function_pool[24277]: VertexAttrib4NubARB (will be remapped) */
+ "iiiii\0"
+ "glVertexAttrib4Nub\0"
+ "glVertexAttrib4NubARB\0"
+ "\0"
+ /* _mesa_function_pool[24325]: GetProgramEnvParameterfvARB (will be remapped) */
+ "iip\0"
+ "glGetProgramEnvParameterfvARB\0"
+ "\0"
+ /* _mesa_function_pool[24360]: GetTrackMatrixivNV (will be remapped) */
+ "iiip\0"
+ "glGetTrackMatrixivNV\0"
+ "\0"
+ /* _mesa_function_pool[24387]: VertexAttrib3svNV (will be remapped) */
+ "ip\0"
+ "glVertexAttrib3svNV\0"
+ "\0"
+ /* _mesa_function_pool[24411]: Uniform4fvARB (will be remapped) */
+ "iip\0"
+ "glUniform4fv\0"
+ "glUniform4fvARB\0"
+ "\0"
+ /* _mesa_function_pool[24445]: MultTransposeMatrixfARB (will be remapped) */
+ "p\0"
+ "glMultTransposeMatrixf\0"
+ "glMultTransposeMatrixfARB\0"
+ "\0"
+ /* _mesa_function_pool[24497]: GetTexEnviv (offset 277) */
+ "iip\0"
+ "glGetTexEnviv\0"
+ "\0"
+ /* _mesa_function_pool[24516]: ColorFragmentOp1ATI (will be remapped) */
+ "iiiiiii\0"
+ "glColorFragmentOp1ATI\0"
+ "\0"
+ /* _mesa_function_pool[24547]: GetUniformfvARB (will be remapped) */
+ "iip\0"
+ "glGetUniformfv\0"
+ "glGetUniformfvARB\0"
+ "\0"
+ /* _mesa_function_pool[24585]: EGLImageTargetRenderbufferStorageOES (will be remapped) */
+ "ip\0"
+ "glEGLImageTargetRenderbufferStorageOES\0"
+ "\0"
+ /* _mesa_function_pool[24628]: VertexAttribI2ivEXT (will be remapped) */
+ "ip\0"
+ "glVertexAttribI2ivEXT\0"
+ "glVertexAttribI2iv\0"
+ "\0"
+ /* _mesa_function_pool[24673]: PopClientAttrib (offset 334) */
+ "\0"
+ "glPopClientAttrib\0"
+ "\0"
+ /* _mesa_function_pool[24693]: ReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN (dynamic) */
+ "iffffffffffff\0"
+ "glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN\0"
+ "\0"
+ /* _mesa_function_pool[24764]: DetachObjectARB (will be remapped) */
+ "ii\0"
+ "glDetachObjectARB\0"
+ "\0"
+ /* _mesa_function_pool[24786]: VertexBlendARB (dynamic) */
+ "i\0"
+ "glVertexBlendARB\0"
+ "\0"
+ /* _mesa_function_pool[24806]: WindowPos3iMESA (will be remapped) */
+ "iii\0"
+ "glWindowPos3i\0"
+ "glWindowPos3iARB\0"
+ "glWindowPos3iMESA\0"
+ "\0"
+ /* _mesa_function_pool[24860]: SeparableFilter2D (offset 360) */
+ "iiiiiipp\0"
+ "glSeparableFilter2D\0"
+ "glSeparableFilter2DEXT\0"
+ "\0"
+ /* _mesa_function_pool[24913]: ProgramParameteriARB (will be remapped) */
+ "iii\0"
+ "glProgramParameteriARB\0"
+ "\0"
+ /* _mesa_function_pool[24941]: Map1d (offset 220) */
+ "iddiip\0"
+ "glMap1d\0"
+ "\0"
+ /* _mesa_function_pool[24957]: Map1f (offset 221) */
+ "iffiip\0"
+ "glMap1f\0"
+ "\0"
+ /* _mesa_function_pool[24973]: CompressedTexImage2DARB (will be remapped) */
+ "iiiiiiip\0"
+ "glCompressedTexImage2D\0"
+ "glCompressedTexImage2DARB\0"
+ "\0"
+ /* _mesa_function_pool[25032]: ArrayElement (offset 306) */
+ "i\0"
+ "glArrayElement\0"
+ "glArrayElementEXT\0"
+ "\0"
+ /* _mesa_function_pool[25068]: TexImage2D (offset 183) */
+ "iiiiiiiip\0"
+ "glTexImage2D\0"
+ "\0"
+ /* _mesa_function_pool[25092]: DepthBoundsEXT (will be remapped) */
+ "dd\0"
+ "glDepthBoundsEXT\0"
+ "\0"
+ /* _mesa_function_pool[25113]: ProgramParameters4fvNV (will be remapped) */
+ "iiip\0"
+ "glProgramParameters4fvNV\0"
+ "\0"
+ /* _mesa_function_pool[25144]: DeformationMap3fSGIX (dynamic) */
+ "iffiiffiiffiip\0"
+ "glDeformationMap3fSGIX\0"
+ "\0"
+ /* _mesa_function_pool[25183]: GetProgramivNV (will be remapped) */
+ "iip\0"
+ "glGetProgramivNV\0"
+ "\0"
+ /* _mesa_function_pool[25205]: GetFragDataLocationEXT (will be remapped) */
+ "ip\0"
+ "glGetFragDataLocationEXT\0"
+ "glGetFragDataLocation\0"
+ "\0"
+ /* _mesa_function_pool[25256]: GetMinmaxParameteriv (offset 366) */
+ "iip\0"
+ "glGetMinmaxParameteriv\0"
+ "glGetMinmaxParameterivEXT\0"
+ "\0"
+ /* _mesa_function_pool[25310]: PixelTransferf (offset 247) */
+ "if\0"
+ "glPixelTransferf\0"
+ "\0"
+ /* _mesa_function_pool[25331]: CopyTexImage1D (offset 323) */
+ "iiiiiii\0"
+ "glCopyTexImage1D\0"
+ "glCopyTexImage1DEXT\0"
+ "\0"
+ /* _mesa_function_pool[25377]: PushMatrix (offset 298) */
+ "\0"
+ "glPushMatrix\0"
+ "\0"
+ /* _mesa_function_pool[25392]: Fogiv (offset 156) */
+ "ip\0"
+ "glFogiv\0"
+ "\0"
+ /* _mesa_function_pool[25404]: TexCoord1dv (offset 95) */
+ "p\0"
+ "glTexCoord1dv\0"
+ "\0"
+ /* _mesa_function_pool[25421]: AlphaFragmentOp3ATI (will be remapped) */
+ "iiiiiiiiiiii\0"
+ "glAlphaFragmentOp3ATI\0"
+ "\0"
+ /* _mesa_function_pool[25457]: PixelTransferi (offset 248) */
+ "ii\0"
+ "glPixelTransferi\0"
+ "\0"
+ /* _mesa_function_pool[25478]: GetnColorTableARB (will be remapped) */
+ "iiiip\0"
+ "glGetnColorTableARB\0"
+ "\0"
+ /* _mesa_function_pool[25505]: VertexAttrib3fvNV (will be remapped) */
+ "ip\0"
+ "glVertexAttrib3fvNV\0"
+ "\0"
+ /* _mesa_function_pool[25529]: Rotatef (offset 300) */
+ "ffff\0"
+ "glRotatef\0"
+ "\0"
+ /* _mesa_function_pool[25545]: GetFinalCombinerInputParameterivNV (will be remapped) */
+ "iip\0"
+ "glGetFinalCombinerInputParameterivNV\0"
+ "\0"
+ /* _mesa_function_pool[25587]: Vertex3i (offset 138) */
+ "iii\0"
+ "glVertex3i\0"
+ "\0"
+ /* _mesa_function_pool[25603]: Vertex3f (offset 136) */
+ "fff\0"
+ "glVertex3f\0"
+ "\0"
+ /* _mesa_function_pool[25619]: Clear (offset 203) */
+ "i\0"
+ "glClear\0"
+ "\0"
+ /* _mesa_function_pool[25630]: Vertex3d (offset 134) */
+ "ddd\0"
+ "glVertex3d\0"
+ "\0"
+ /* _mesa_function_pool[25646]: GetMapParameterivNV (dynamic) */
+ "iip\0"
+ "glGetMapParameterivNV\0"
+ "\0"
+ /* _mesa_function_pool[25673]: Uniform4iARB (will be remapped) */
+ "iiiii\0"
+ "glUniform4i\0"
+ "glUniform4iARB\0"
+ "\0"
+ /* _mesa_function_pool[25707]: ReadBuffer (offset 254) */
+ "i\0"
+ "glReadBuffer\0"
+ "\0"
+ /* _mesa_function_pool[25723]: ConvolutionParameteri (offset 352) */
+ "iii\0"
+ "glConvolutionParameteri\0"
+ "glConvolutionParameteriEXT\0"
+ "\0"
+ /* _mesa_function_pool[25779]: Ortho (offset 296) */
+ "dddddd\0"
+ "glOrtho\0"
+ "\0"
+ /* _mesa_function_pool[25795]: Binormal3sEXT (dynamic) */
+ "iii\0"
+ "glBinormal3sEXT\0"
+ "\0"
+ /* _mesa_function_pool[25816]: ListBase (offset 6) */
+ "i\0"
+ "glListBase\0"
+ "\0"
+ /* _mesa_function_pool[25830]: VertexAttribI3ivEXT (will be remapped) */
+ "ip\0"
+ "glVertexAttribI3ivEXT\0"
+ "glVertexAttribI3iv\0"
+ "\0"
+ /* _mesa_function_pool[25875]: Vertex3s (offset 140) */
+ "iii\0"
+ "glVertex3s\0"
+ "\0"
+ /* _mesa_function_pool[25891]: ConvolutionParameterf (offset 350) */
+ "iif\0"
+ "glConvolutionParameterf\0"
+ "glConvolutionParameterfEXT\0"
+ "\0"
+ /* _mesa_function_pool[25947]: GetColorTableParameteriv (offset 345) */
+ "iip\0"
+ "glGetColorTableParameteriv\0"
+ "glGetColorTableParameterivSGI\0"
+ "glGetColorTableParameterivEXT\0"
+ "\0"
+ /* _mesa_function_pool[26039]: ProgramEnvParameter4dvARB (will be remapped) */
+ "iip\0"
+ "glProgramEnvParameter4dvARB\0"
+ "glProgramParameter4dvNV\0"
+ "\0"
+ /* _mesa_function_pool[26096]: ShadeModel (offset 177) */
+ "i\0"
+ "glShadeModel\0"
+ "\0"
+ /* _mesa_function_pool[26112]: VertexAttribs2fvNV (will be remapped) */
+ "iip\0"
+ "glVertexAttribs2fvNV\0"
+ "\0"
+ /* _mesa_function_pool[26138]: Rectiv (offset 91) */
+ "pp\0"
+ "glRectiv\0"
+ "\0"
+ /* _mesa_function_pool[26151]: UseProgramObjectARB (will be remapped) */
+ "i\0"
+ "glUseProgram\0"
+ "glUseProgramObjectARB\0"
+ "\0"
+ /* _mesa_function_pool[26189]: GetMapParameterfvNV (dynamic) */
+ "iip\0"
+ "glGetMapParameterfvNV\0"
+ "\0"
+ /* _mesa_function_pool[26216]: EndConditionalRenderNV (will be remapped) */
+ "\0"
+ "glEndConditionalRenderNV\0"
+ "glEndConditionalRender\0"
+ "\0"
+ /* _mesa_function_pool[26266]: PassTexCoordATI (will be remapped) */
+ "iii\0"
+ "glPassTexCoordATI\0"
+ "\0"
+ /* _mesa_function_pool[26289]: DeleteProgram (will be remapped) */
+ "i\0"
+ "glDeleteProgram\0"
+ "\0"
+ /* _mesa_function_pool[26308]: GetSamplerParameteriv (will be remapped) */
+ "iip\0"
+ "glGetSamplerParameteriv\0"
+ "\0"
+ /* _mesa_function_pool[26337]: Tangent3dEXT (dynamic) */
+ "ddd\0"
+ "glTangent3dEXT\0"
+ "\0"
+ /* _mesa_function_pool[26357]: SecondaryColor3dvEXT (will be remapped) */
+ "p\0"
+ "glSecondaryColor3dv\0"
+ "glSecondaryColor3dvEXT\0"
+ "\0"
+ /* _mesa_function_pool[26403]: AlphaFragmentOp2ATI (will be remapped) */
+ "iiiiiiiii\0"
+ "glAlphaFragmentOp2ATI\0"
+ "\0"
+ /* _mesa_function_pool[26436]: Vertex2fv (offset 129) */
+ "p\0"
+ "glVertex2fv\0"
+ "\0"
+ /* _mesa_function_pool[26451]: MultiDrawArraysEXT (will be remapped) */
+ "ippi\0"
+ "glMultiDrawArrays\0"
+ "glMultiDrawArraysEXT\0"
+ "\0"
+ /* _mesa_function_pool[26496]: BindRenderbufferEXT (will be remapped) */
+ "ii\0"
+ "glBindRenderbuffer\0"
+ "glBindRenderbufferEXT\0"
+ "\0"
+ /* _mesa_function_pool[26541]: MultiTexCoord4dARB (offset 400) */
+ "idddd\0"
+ "glMultiTexCoord4d\0"
+ "glMultiTexCoord4dARB\0"
+ "\0"
+ /* _mesa_function_pool[26587]: FramebufferTextureFaceARB (will be remapped) */
+ "iiiii\0"
+ "glFramebufferTextureFaceARB\0"
+ "\0"
+ /* _mesa_function_pool[26622]: Vertex3sv (offset 141) */
+ "p\0"
+ "glVertex3sv\0"
+ "\0"
+ /* _mesa_function_pool[26637]: SecondaryColor3usEXT (will be remapped) */
+ "iii\0"
+ "glSecondaryColor3us\0"
+ "glSecondaryColor3usEXT\0"
+ "\0"
+ /* _mesa_function_pool[26685]: ProgramLocalParameter4fvARB (will be remapped) */
+ "iip\0"
+ "glProgramLocalParameter4fvARB\0"
+ "\0"
+ /* _mesa_function_pool[26720]: DeleteProgramsNV (will be remapped) */
+ "ip\0"
+ "glDeleteProgramsARB\0"
+ "glDeleteProgramsNV\0"
+ "\0"
+ /* _mesa_function_pool[26763]: EvalMesh1 (offset 236) */
+ "iii\0"
+ "glEvalMesh1\0"
+ "\0"
+ /* _mesa_function_pool[26780]: PauseTransformFeedback (will be remapped) */
+ "\0"
+ "glPauseTransformFeedback\0"
+ "\0"
+ /* _mesa_function_pool[26807]: MultiTexCoord1sARB (offset 382) */
+ "ii\0"
+ "glMultiTexCoord1s\0"
+ "glMultiTexCoord1sARB\0"
+ "\0"
+ /* _mesa_function_pool[26850]: ReplacementCodeuiColor3fVertex3fSUN (dynamic) */
+ "iffffff\0"
+ "glReplacementCodeuiColor3fVertex3fSUN\0"
+ "\0"
+ /* _mesa_function_pool[26897]: GetVertexAttribPointervNV (will be remapped) */
+ "iip\0"
+ "glGetVertexAttribPointerv\0"
+ "glGetVertexAttribPointervARB\0"
+ "glGetVertexAttribPointervNV\0"
+ "\0"
+ /* _mesa_function_pool[26985]: VertexAttribs1fvNV (will be remapped) */
+ "iip\0"
+ "glVertexAttribs1fvNV\0"
+ "\0"
+ /* _mesa_function_pool[27011]: MultiTexCoord1dvARB (offset 377) */
+ "ip\0"
+ "glMultiTexCoord1dv\0"
+ "glMultiTexCoord1dvARB\0"
+ "\0"
+ /* _mesa_function_pool[27056]: Uniform2iARB (will be remapped) */
+ "iii\0"
+ "glUniform2i\0"
+ "glUniform2iARB\0"
+ "\0"
+ /* _mesa_function_pool[27088]: Vertex2iv (offset 131) */
+ "p\0"
+ "glVertex2iv\0"
+ "\0"
+ /* _mesa_function_pool[27103]: GetProgramStringNV (will be remapped) */
+ "iip\0"
+ "glGetProgramStringNV\0"
+ "\0"
+ /* _mesa_function_pool[27129]: ColorPointerEXT (will be remapped) */
+ "iiiip\0"
+ "glColorPointerEXT\0"
+ "\0"
+ /* _mesa_function_pool[27154]: LineWidth (offset 168) */
+ "f\0"
+ "glLineWidth\0"
+ "\0"
+ /* _mesa_function_pool[27169]: MapBufferARB (will be remapped) */
+ "ii\0"
+ "glMapBuffer\0"
+ "glMapBufferARB\0"
+ "\0"
+ /* _mesa_function_pool[27200]: MultiDrawElementsBaseVertex (will be remapped) */
+ "ipipip\0"
+ "glMultiDrawElementsBaseVertex\0"
+ "\0"
+ /* _mesa_function_pool[27238]: TexParameterIuivEXT (will be remapped) */
+ "iip\0"
+ "glTexParameterIuivEXT\0"
+ "glTexParameterIuiv\0"
+ "\0"
+ /* _mesa_function_pool[27284]: Binormal3svEXT (dynamic) */
+ "p\0"
+ "glBinormal3svEXT\0"
+ "\0"
+ /* _mesa_function_pool[27304]: ApplyTextureEXT (dynamic) */
+ "i\0"
+ "glApplyTextureEXT\0"
+ "\0"
+ /* _mesa_function_pool[27325]: GetBufferParameteri64v (will be remapped) */
+ "iip\0"
+ "glGetBufferParameteri64v\0"
+ "\0"
+ /* _mesa_function_pool[27355]: TexGendv (offset 189) */
+ "iip\0"
+ "glTexGendv\0"
+ "\0"
+ /* _mesa_function_pool[27371]: VertexAttribI3iEXT (will be remapped) */
+ "iiii\0"
+ "glVertexAttribI3iEXT\0"
+ "glVertexAttribI3i\0"
+ "\0"
+ /* _mesa_function_pool[27416]: EnableIndexedEXT (will be remapped) */
+ "ii\0"
+ "glEnableIndexedEXT\0"
+ "glEnablei\0"
+ "\0"
+ /* _mesa_function_pool[27449]: TextureMaterialEXT (dynamic) */
+ "ii\0"
+ "glTextureMaterialEXT\0"
+ "\0"
+ /* _mesa_function_pool[27474]: TextureLightEXT (dynamic) */
+ "i\0"
+ "glTextureLightEXT\0"
+ "\0"
+ /* _mesa_function_pool[27495]: ResetMinmax (offset 370) */
+ "i\0"
+ "glResetMinmax\0"
+ "glResetMinmaxEXT\0"
+ "\0"
+ /* _mesa_function_pool[27529]: SpriteParameterfSGIX (dynamic) */
+ "if\0"
+ "glSpriteParameterfSGIX\0"
+ "\0"
+ /* _mesa_function_pool[27556]: EnableClientState (offset 313) */
+ "i\0"
+ "glEnableClientState\0"
+ "\0"
+ /* _mesa_function_pool[27579]: VertexAttrib4sNV (will be remapped) */
+ "iiiii\0"
+ "glVertexAttrib4sNV\0"
+ "\0"
+ /* _mesa_function_pool[27605]: GetConvolutionParameterfv (offset 357) */
+ "iip\0"
+ "glGetConvolutionParameterfv\0"
+ "glGetConvolutionParameterfvEXT\0"
+ "\0"
+ /* _mesa_function_pool[27669]: VertexAttribs4dvNV (will be remapped) */
+ "iip\0"
+ "glVertexAttribs4dvNV\0"
+ "\0"
+ /* _mesa_function_pool[27695]: MultiModeDrawArraysIBM (will be remapped) */
+ "pppii\0"
+ "glMultiModeDrawArraysIBM\0"
+ "\0"
+ /* _mesa_function_pool[27727]: VertexAttrib4dARB (will be remapped) */
+ "idddd\0"
+ "glVertexAttrib4d\0"
+ "glVertexAttrib4dARB\0"
+ "\0"
+ /* _mesa_function_pool[27771]: GetTexBumpParameterfvATI (will be remapped) */
+ "ip\0"
+ "glGetTexBumpParameterfvATI\0"
+ "\0"
+ /* _mesa_function_pool[27802]: ProgramNamedParameter4dNV (will be remapped) */
+ "iipdddd\0"
+ "glProgramNamedParameter4dNV\0"
+ "\0"
+ /* _mesa_function_pool[27839]: GetMaterialfv (offset 269) */
+ "iip\0"
+ "glGetMaterialfv\0"
+ "\0"
+ /* _mesa_function_pool[27860]: VertexWeightfEXT (dynamic) */
+ "f\0"
+ "glVertexWeightfEXT\0"
+ "\0"
+ /* _mesa_function_pool[27882]: SetFragmentShaderConstantATI (will be remapped) */
+ "ip\0"
+ "glSetFragmentShaderConstantATI\0"
+ "\0"
+ /* _mesa_function_pool[27917]: Binormal3fEXT (dynamic) */
+ "fff\0"
+ "glBinormal3fEXT\0"
+ "\0"
+ /* _mesa_function_pool[27938]: CallList (offset 2) */
+ "i\0"
+ "glCallList\0"
+ "\0"
+ /* _mesa_function_pool[27952]: Materialfv (offset 170) */
+ "iip\0"
+ "glMaterialfv\0"
+ "\0"
+ /* _mesa_function_pool[27970]: TexCoord3fv (offset 113) */
+ "p\0"
+ "glTexCoord3fv\0"
+ "\0"
+ /* _mesa_function_pool[27987]: FogCoordfvEXT (will be remapped) */
+ "p\0"
+ "glFogCoordfv\0"
+ "glFogCoordfvEXT\0"
+ "\0"
+ /* _mesa_function_pool[28019]: MultiTexCoord1ivARB (offset 381) */
+ "ip\0"
+ "glMultiTexCoord1iv\0"
+ "glMultiTexCoord1ivARB\0"
+ "\0"
+ /* _mesa_function_pool[28064]: SecondaryColor3ubEXT (will be remapped) */
+ "iii\0"
+ "glSecondaryColor3ub\0"
+ "glSecondaryColor3ubEXT\0"
+ "\0"
+ /* _mesa_function_pool[28112]: MultiTexCoord2ivARB (offset 389) */
+ "ip\0"
+ "glMultiTexCoord2iv\0"
+ "glMultiTexCoord2ivARB\0"
+ "\0"
+ /* _mesa_function_pool[28157]: FogFuncSGIS (dynamic) */
+ "ip\0"
+ "glFogFuncSGIS\0"
+ "\0"
+ /* _mesa_function_pool[28175]: CopyTexSubImage2D (offset 326) */
+ "iiiiiiii\0"
+ "glCopyTexSubImage2D\0"
+ "glCopyTexSubImage2DEXT\0"
+ "\0"
+ /* _mesa_function_pool[28228]: GetObjectParameterivARB (will be remapped) */
+ "iip\0"
+ "glGetObjectParameterivARB\0"
+ "\0"
+ /* _mesa_function_pool[28259]: Color3iv (offset 16) */
+ "p\0"
+ "glColor3iv\0"
+ "\0"
+ /* _mesa_function_pool[28273]: TexCoord4fVertex4fSUN (dynamic) */
+ "ffffffff\0"
+ "glTexCoord4fVertex4fSUN\0"
+ "\0"
+ /* _mesa_function_pool[28307]: DrawElements (offset 311) */
+ "iiip\0"
+ "glDrawElements\0"
+ "\0"
+ /* _mesa_function_pool[28328]: BindVertexArrayAPPLE (will be remapped) */
+ "i\0"
+ "glBindVertexArrayAPPLE\0"
+ "\0"
+ /* _mesa_function_pool[28354]: GetProgramLocalParameterdvARB (will be remapped) */
+ "iip\0"
+ "glGetProgramLocalParameterdvARB\0"
+ "\0"
+ /* _mesa_function_pool[28391]: GetHistogramParameteriv (offset 363) */
+ "iip\0"
+ "glGetHistogramParameteriv\0"
+ "glGetHistogramParameterivEXT\0"
+ "\0"
+ /* _mesa_function_pool[28451]: MultiTexCoord1iARB (offset 380) */
+ "ii\0"
+ "glMultiTexCoord1i\0"
+ "glMultiTexCoord1iARB\0"
+ "\0"
+ /* _mesa_function_pool[28494]: GetConvolutionFilter (offset 356) */
+ "iiip\0"
+ "glGetConvolutionFilter\0"
+ "glGetConvolutionFilterEXT\0"
+ "\0"
+ /* _mesa_function_pool[28549]: GetProgramivARB (will be remapped) */
+ "iip\0"
+ "glGetProgramivARB\0"
+ "\0"
+ /* _mesa_function_pool[28572]: TexBufferARB (will be remapped) */
+ "iii\0"
+ "glTexBufferARB\0"
+ "\0"
+ /* _mesa_function_pool[28592]: BlendFuncSeparateEXT (will be remapped) */
+ "iiii\0"
+ "glBlendFuncSeparate\0"
+ "glBlendFuncSeparateEXT\0"
+ "glBlendFuncSeparateINGR\0"
+ "\0"
+ /* _mesa_function_pool[28665]: MapBufferRange (will be remapped) */
+ "iiii\0"
+ "glMapBufferRange\0"
+ "\0"
+ /* _mesa_function_pool[28688]: ProgramParameters4dvNV (will be remapped) */
+ "iiip\0"
+ "glProgramParameters4dvNV\0"
+ "\0"
+ /* _mesa_function_pool[28719]: TexCoord2fColor3fVertex3fvSUN (dynamic) */
+ "ppp\0"
+ "glTexCoord2fColor3fVertex3fvSUN\0"
+ "\0"
+ /* _mesa_function_pool[28756]: EvalPoint2 (offset 239) */
+ "ii\0"
+ "glEvalPoint2\0"
+ "\0"
+ /* _mesa_function_pool[28773]: Uniform1uivEXT (will be remapped) */
+ "iip\0"
+ "glUniform1uivEXT\0"
+ "glUniform1uiv\0"
+ "\0"
+ /* _mesa_function_pool[28809]: EvalPoint1 (offset 237) */
+ "i\0"
+ "glEvalPoint1\0"
+ "\0"
+ /* _mesa_function_pool[28825]: Binormal3dvEXT (dynamic) */
+ "p\0"
+ "glBinormal3dvEXT\0"
+ "\0"
+ /* _mesa_function_pool[28845]: PopMatrix (offset 297) */
+ "\0"
+ "glPopMatrix\0"
+ "\0"
+ /* _mesa_function_pool[28859]: GetVertexAttribIuivEXT (will be remapped) */
+ "iip\0"
+ "glGetVertexAttribIuivEXT\0"
+ "glGetVertexAttribIuiv\0"
+ "\0"
+ /* _mesa_function_pool[28911]: FinishFenceNV (will be remapped) */
+ "i\0"
+ "glFinishFenceNV\0"
+ "\0"
+ /* _mesa_function_pool[28930]: GetFogFuncSGIS (dynamic) */
+ "p\0"
+ "glGetFogFuncSGIS\0"
+ "\0"
+ /* _mesa_function_pool[28950]: GetUniformLocationARB (will be remapped) */
+ "ip\0"
+ "glGetUniformLocation\0"
+ "glGetUniformLocationARB\0"
+ "\0"
+ /* _mesa_function_pool[28999]: SecondaryColor3fEXT (will be remapped) */
+ "fff\0"
+ "glSecondaryColor3f\0"
+ "glSecondaryColor3fEXT\0"
+ "\0"
+ /* _mesa_function_pool[29045]: GetTexGeniv (offset 280) */
+ "iip\0"
+ "glGetTexGeniv\0"
+ "\0"
+ /* _mesa_function_pool[29064]: CombinerInputNV (will be remapped) */
+ "iiiiii\0"
+ "glCombinerInputNV\0"
+ "\0"
+ /* _mesa_function_pool[29090]: VertexAttrib3sARB (will be remapped) */
+ "iiii\0"
+ "glVertexAttrib3s\0"
+ "glVertexAttrib3sARB\0"
+ "\0"
+ /* _mesa_function_pool[29133]: IsTransformFeedback (will be remapped) */
+ "i\0"
+ "glIsTransformFeedback\0"
+ "\0"
+ /* _mesa_function_pool[29158]: ReplacementCodeuiNormal3fVertex3fvSUN (dynamic) */
+ "ppp\0"
+ "glReplacementCodeuiNormal3fVertex3fvSUN\0"
+ "\0"
+ /* _mesa_function_pool[29203]: Map2d (offset 222) */
+ "iddiiddiip\0"
+ "glMap2d\0"
+ "\0"
+ /* _mesa_function_pool[29223]: Map2f (offset 223) */
+ "iffiiffiip\0"
+ "glMap2f\0"
+ "\0"
+ /* _mesa_function_pool[29243]: ProgramStringARB (will be remapped) */
+ "iiip\0"
+ "glProgramStringARB\0"
+ "\0"
+ /* _mesa_function_pool[29268]: Vertex4s (offset 148) */
+ "iiii\0"
+ "glVertex4s\0"
+ "\0"
+ /* _mesa_function_pool[29285]: TexCoord4fVertex4fvSUN (dynamic) */
+ "pp\0"
+ "glTexCoord4fVertex4fvSUN\0"
+ "\0"
+ /* _mesa_function_pool[29314]: FragmentLightModelivSGIX (dynamic) */
+ "ip\0"
+ "glFragmentLightModelivSGIX\0"
+ "\0"
+ /* _mesa_function_pool[29345]: VertexAttrib1fNV (will be remapped) */
+ "if\0"
+ "glVertexAttrib1fNV\0"
+ "\0"
+ /* _mesa_function_pool[29368]: Vertex4f (offset 144) */
+ "ffff\0"
+ "glVertex4f\0"
+ "\0"
+ /* _mesa_function_pool[29385]: EvalCoord1d (offset 228) */
+ "d\0"
+ "glEvalCoord1d\0"
+ "\0"
+ /* _mesa_function_pool[29402]: Vertex4d (offset 142) */
+ "dddd\0"
+ "glVertex4d\0"
+ "\0"
+ /* _mesa_function_pool[29419]: RasterPos4dv (offset 79) */
+ "p\0"
+ "glRasterPos4dv\0"
+ "\0"
+ /* _mesa_function_pool[29437]: UseShaderProgramEXT (will be remapped) */
+ "ii\0"
+ "glUseShaderProgramEXT\0"
+ "\0"
+ /* _mesa_function_pool[29463]: FragmentLightfSGIX (dynamic) */
+ "iif\0"
+ "glFragmentLightfSGIX\0"
+ "\0"
+ /* _mesa_function_pool[29489]: GetCompressedTexImageARB (will be remapped) */
+ "iip\0"
+ "glGetCompressedTexImage\0"
+ "glGetCompressedTexImageARB\0"
+ "\0"
+ /* _mesa_function_pool[29545]: GetTexGenfv (offset 279) */
+ "iip\0"
+ "glGetTexGenfv\0"
+ "\0"
+ /* _mesa_function_pool[29564]: Vertex4i (offset 146) */
+ "iiii\0"
+ "glVertex4i\0"
+ "\0"
+ /* _mesa_function_pool[29581]: VertexWeightPointerEXT (dynamic) */
+ "iiip\0"
+ "glVertexWeightPointerEXT\0"
+ "\0"
+ /* _mesa_function_pool[29612]: GetHistogram (offset 361) */
+ "iiiip\0"
+ "glGetHistogram\0"
+ "glGetHistogramEXT\0"
+ "\0"
+ /* _mesa_function_pool[29652]: ActiveStencilFaceEXT (will be remapped) */
+ "i\0"
+ "glActiveStencilFaceEXT\0"
+ "\0"
+ /* _mesa_function_pool[29678]: StencilFuncSeparateATI (will be remapped) */
+ "iiii\0"
+ "glStencilFuncSeparateATI\0"
+ "\0"
+ /* _mesa_function_pool[29709]: Materialf (offset 169) */
+ "iif\0"
+ "glMaterialf\0"
+ "\0"
+ /* _mesa_function_pool[29726]: GetShaderSourceARB (will be remapped) */
+ "iipp\0"
+ "glGetShaderSource\0"
+ "glGetShaderSourceARB\0"
+ "\0"
+ /* _mesa_function_pool[29771]: IglooInterfaceSGIX (dynamic) */
+ "ip\0"
+ "glIglooInterfaceSGIX\0"
+ "\0"
+ /* _mesa_function_pool[29796]: Materiali (offset 171) */
+ "iii\0"
+ "glMateriali\0"
+ "\0"
+ /* _mesa_function_pool[29813]: VertexAttrib4dNV (will be remapped) */
+ "idddd\0"
+ "glVertexAttrib4dNV\0"
+ "\0"
+ /* _mesa_function_pool[29839]: MultiModeDrawElementsIBM (will be remapped) */
+ "ppipii\0"
+ "glMultiModeDrawElementsIBM\0"
+ "\0"
+ /* _mesa_function_pool[29874]: Indexsv (offset 51) */
+ "p\0"
+ "glIndexsv\0"
+ "\0"
+ /* _mesa_function_pool[29887]: MultiTexCoord4svARB (offset 407) */
+ "ip\0"
+ "glMultiTexCoord4sv\0"
+ "glMultiTexCoord4svARB\0"
+ "\0"
+ /* _mesa_function_pool[29932]: LightModelfv (offset 164) */
+ "ip\0"
+ "glLightModelfv\0"
+ "\0"
+ /* _mesa_function_pool[29951]: TexCoord2dv (offset 103) */
+ "p\0"
+ "glTexCoord2dv\0"
+ "\0"
+ /* _mesa_function_pool[29968]: GenQueriesARB (will be remapped) */
+ "ip\0"
+ "glGenQueries\0"
+ "glGenQueriesARB\0"
+ "\0"
+ /* _mesa_function_pool[30001]: EvalCoord1dv (offset 229) */
+ "p\0"
+ "glEvalCoord1dv\0"
+ "\0"
+ /* _mesa_function_pool[30019]: ReplacementCodeuiVertex3fSUN (dynamic) */
+ "ifff\0"
+ "glReplacementCodeuiVertex3fSUN\0"
+ "\0"
+ /* _mesa_function_pool[30056]: Translated (offset 303) */
+ "ddd\0"
+ "glTranslated\0"
+ "\0"
+ /* _mesa_function_pool[30074]: Translatef (offset 304) */
+ "fff\0"
+ "glTranslatef\0"
+ "\0"
+ /* _mesa_function_pool[30092]: Uniform3uiEXT (will be remapped) */
+ "iiii\0"
+ "glUniform3uiEXT\0"
+ "glUniform3ui\0"
+ "\0"
+ /* _mesa_function_pool[30127]: StencilMask (offset 209) */
+ "i\0"
+ "glStencilMask\0"
+ "\0"
+ /* _mesa_function_pool[30144]: Tangent3iEXT (dynamic) */
+ "iii\0"
+ "glTangent3iEXT\0"
+ "\0"
+ /* _mesa_function_pool[30164]: ClampColorARB (will be remapped) */
+ "ii\0"
+ "glClampColorARB\0"
+ "\0"
+ /* _mesa_function_pool[30184]: GetLightiv (offset 265) */
+ "iip\0"
+ "glGetLightiv\0"
+ "\0"
+ /* _mesa_function_pool[30202]: GetSamplerParameterIiv (will be remapped) */
+ "iip\0"
+ "glGetSamplerParameterIiv\0"
+ "\0"
+ /* _mesa_function_pool[30232]: DrawMeshArraysSUN (dynamic) */
+ "iiii\0"
+ "glDrawMeshArraysSUN\0"
+ "\0"
+ /* _mesa_function_pool[30258]: IsList (offset 287) */
+ "i\0"
+ "glIsList\0"
+ "\0"
+ /* _mesa_function_pool[30270]: IsSync (will be remapped) */
+ "i\0"
+ "glIsSync\0"
+ "\0"
+ /* _mesa_function_pool[30282]: RenderMode (offset 196) */
+ "i\0"
+ "glRenderMode\0"
+ "\0"
+ /* _mesa_function_pool[30298]: GetMapControlPointsNV (dynamic) */
+ "iiiiiip\0"
+ "glGetMapControlPointsNV\0"
+ "\0"
+ /* _mesa_function_pool[30331]: DrawBuffersARB (will be remapped) */
+ "ip\0"
+ "glDrawBuffers\0"
+ "glDrawBuffersARB\0"
+ "glDrawBuffersATI\0"
+ "\0"
+ /* _mesa_function_pool[30383]: ClearBufferiv (will be remapped) */
+ "iip\0"
+ "glClearBufferiv\0"
+ "\0"
+ /* _mesa_function_pool[30404]: ProgramLocalParameter4fARB (will be remapped) */
+ "iiffff\0"
+ "glProgramLocalParameter4fARB\0"
+ "\0"
+ /* _mesa_function_pool[30441]: SpriteParameterivSGIX (dynamic) */
+ "ip\0"
+ "glSpriteParameterivSGIX\0"
+ "\0"
+ /* _mesa_function_pool[30469]: ProvokingVertexEXT (will be remapped) */
+ "i\0"
+ "glProvokingVertexEXT\0"
+ "glProvokingVertex\0"
+ "\0"
+ /* _mesa_function_pool[30511]: MultiTexCoord1fARB (offset 378) */
+ "if\0"
+ "glMultiTexCoord1f\0"
+ "glMultiTexCoord1fARB\0"
+ "\0"
+ /* _mesa_function_pool[30554]: LoadName (offset 198) */
+ "i\0"
+ "glLoadName\0"
+ "\0"
+ /* _mesa_function_pool[30568]: VertexAttribs4ubvNV (will be remapped) */
+ "iip\0"
+ "glVertexAttribs4ubvNV\0"
+ "\0"
+ /* _mesa_function_pool[30595]: WeightsvARB (dynamic) */
+ "ip\0"
+ "glWeightsvARB\0"
+ "\0"
+ /* _mesa_function_pool[30613]: Uniform1fvARB (will be remapped) */
+ "iip\0"
+ "glUniform1fv\0"
+ "glUniform1fvARB\0"
+ "\0"
+ /* _mesa_function_pool[30647]: CopyTexSubImage1D (offset 325) */
+ "iiiiii\0"
+ "glCopyTexSubImage1D\0"
+ "glCopyTexSubImage1DEXT\0"
+ "\0"
+ /* _mesa_function_pool[30698]: CullFace (offset 152) */
+ "i\0"
+ "glCullFace\0"
+ "\0"
+ /* _mesa_function_pool[30712]: BindTexture (offset 307) */
+ "ii\0"
+ "glBindTexture\0"
+ "glBindTextureEXT\0"
+ "\0"
+ /* _mesa_function_pool[30747]: BeginFragmentShaderATI (will be remapped) */
+ "\0"
+ "glBeginFragmentShaderATI\0"
+ "\0"
+ /* _mesa_function_pool[30774]: MultiTexCoord4fARB (offset 402) */
+ "iffff\0"
+ "glMultiTexCoord4f\0"
+ "glMultiTexCoord4fARB\0"
+ "\0"
+ /* _mesa_function_pool[30820]: VertexAttribs3svNV (will be remapped) */
+ "iip\0"
+ "glVertexAttribs3svNV\0"
+ "\0"
+ /* _mesa_function_pool[30846]: StencilFunc (offset 243) */
+ "iii\0"
+ "glStencilFunc\0"
+ "\0"
+ /* _mesa_function_pool[30865]: CopyPixels (offset 255) */
+ "iiiii\0"
+ "glCopyPixels\0"
+ "\0"
+ /* _mesa_function_pool[30885]: Rectsv (offset 93) */
+ "pp\0"
+ "glRectsv\0"
+ "\0"
+ /* _mesa_function_pool[30898]: ReplacementCodeuivSUN (dynamic) */
+ "p\0"
+ "glReplacementCodeuivSUN\0"
+ "\0"
+ /* _mesa_function_pool[30925]: EnableVertexAttribArrayARB (will be remapped) */
+ "i\0"
+ "glEnableVertexAttribArray\0"
+ "glEnableVertexAttribArrayARB\0"
+ "\0"
+ /* _mesa_function_pool[30983]: NormalPointervINTEL (dynamic) */
+ "ip\0"
+ "glNormalPointervINTEL\0"
+ "\0"
+ /* _mesa_function_pool[31009]: CopyConvolutionFilter2D (offset 355) */
+ "iiiiii\0"
+ "glCopyConvolutionFilter2D\0"
+ "glCopyConvolutionFilter2DEXT\0"
+ "\0"
+ /* _mesa_function_pool[31072]: WindowPos3ivMESA (will be remapped) */
+ "p\0"
+ "glWindowPos3iv\0"
+ "glWindowPos3ivARB\0"
+ "glWindowPos3ivMESA\0"
+ "\0"
+ /* _mesa_function_pool[31127]: CopyBufferSubData (will be remapped) */
+ "iiiii\0"
+ "glCopyBufferSubData\0"
+ "\0"
+ /* _mesa_function_pool[31154]: NormalPointer (offset 318) */
+ "iip\0"
+ "glNormalPointer\0"
+ "\0"
+ /* _mesa_function_pool[31175]: TexParameterfv (offset 179) */
+ "iip\0"
+ "glTexParameterfv\0"
+ "\0"
+ /* _mesa_function_pool[31197]: IsBufferARB (will be remapped) */
+ "i\0"
+ "glIsBuffer\0"
+ "glIsBufferARB\0"
+ "\0"
+ /* _mesa_function_pool[31225]: WindowPos4iMESA (will be remapped) */
+ "iiii\0"
+ "glWindowPos4iMESA\0"
+ "\0"
+ /* _mesa_function_pool[31249]: VertexAttrib4uivARB (will be remapped) */
+ "ip\0"
+ "glVertexAttrib4uiv\0"
+ "glVertexAttrib4uivARB\0"
+ "\0"
+ /* _mesa_function_pool[31294]: Tangent3bvEXT (dynamic) */
+ "p\0"
+ "glTangent3bvEXT\0"
+ "\0"
+ /* _mesa_function_pool[31313]: VertexAttribI3uivEXT (will be remapped) */
+ "ip\0"
+ "glVertexAttribI3uivEXT\0"
+ "glVertexAttribI3uiv\0"
+ "\0"
+ /* _mesa_function_pool[31360]: UniformMatrix3x4fv (will be remapped) */
+ "iiip\0"
+ "glUniformMatrix3x4fv\0"
+ "\0"
+ /* _mesa_function_pool[31387]: ClipPlane (offset 150) */
+ "ip\0"
+ "glClipPlane\0"
+ "\0"
+ /* _mesa_function_pool[31403]: Recti (offset 90) */
+ "iiii\0"
+ "glRecti\0"
+ "\0"
+ /* _mesa_function_pool[31417]: TrackMatrixNV (will be remapped) */
+ "iiii\0"
+ "glTrackMatrixNV\0"
+ "\0"
+ /* _mesa_function_pool[31439]: DrawRangeElementsBaseVertex (will be remapped) */
+ "iiiiipi\0"
+ "glDrawRangeElementsBaseVertex\0"
+ "\0"
+ /* _mesa_function_pool[31478]: SamplerParameterIuiv (will be remapped) */
+ "iip\0"
+ "glSamplerParameterIuiv\0"
+ "\0"
+ /* _mesa_function_pool[31506]: TexCoordPointervINTEL (dynamic) */
+ "iip\0"
+ "glTexCoordPointervINTEL\0"
+ "\0"
+ /* _mesa_function_pool[31535]: DeleteBuffersARB (will be remapped) */
+ "ip\0"
+ "glDeleteBuffers\0"
+ "glDeleteBuffersARB\0"
+ "\0"
+ /* _mesa_function_pool[31574]: PixelTransformParameterfvEXT (dynamic) */
+ "iip\0"
+ "glPixelTransformParameterfvEXT\0"
+ "\0"
+ /* _mesa_function_pool[31610]: PrimitiveRestartNV (will be remapped) */
+ "\0"
+ "glPrimitiveRestartNV\0"
+ "\0"
+ /* _mesa_function_pool[31633]: WindowPos4fvMESA (will be remapped) */
+ "p\0"
+ "glWindowPos4fvMESA\0"
+ "\0"
+ /* _mesa_function_pool[31655]: GetPixelMapuiv (offset 272) */
+ "ip\0"
+ "glGetPixelMapuiv\0"
+ "\0"
+ /* _mesa_function_pool[31676]: Rectf (offset 88) */
+ "ffff\0"
+ "glRectf\0"
+ "\0"
+ /* _mesa_function_pool[31690]: VertexAttrib1sNV (will be remapped) */
+ "ii\0"
+ "glVertexAttrib1sNV\0"
+ "\0"
+ /* _mesa_function_pool[31713]: Indexfv (offset 47) */
+ "p\0"
+ "glIndexfv\0"
+ "\0"
+ /* _mesa_function_pool[31726]: SecondaryColor3svEXT (will be remapped) */
+ "p\0"
+ "glSecondaryColor3sv\0"
+ "glSecondaryColor3svEXT\0"
+ "\0"
+ /* _mesa_function_pool[31772]: LoadTransposeMatrixfARB (will be remapped) */
+ "p\0"
+ "glLoadTransposeMatrixf\0"
+ "glLoadTransposeMatrixfARB\0"
+ "\0"
+ /* _mesa_function_pool[31824]: GetPointerv (offset 329) */
+ "ip\0"
+ "glGetPointerv\0"
+ "glGetPointervEXT\0"
+ "\0"
+ /* _mesa_function_pool[31859]: Tangent3bEXT (dynamic) */
+ "iii\0"
+ "glTangent3bEXT\0"
+ "\0"
+ /* _mesa_function_pool[31879]: CombinerParameterfNV (will be remapped) */
+ "if\0"
+ "glCombinerParameterfNV\0"
+ "\0"
+ /* _mesa_function_pool[31906]: IndexMask (offset 212) */
+ "i\0"
+ "glIndexMask\0"
+ "\0"
+ /* _mesa_function_pool[31921]: BindProgramNV (will be remapped) */
+ "ii\0"
+ "glBindProgramARB\0"
+ "glBindProgramNV\0"
+ "\0"
+ /* _mesa_function_pool[31958]: VertexAttrib4svARB (will be remapped) */
+ "ip\0"
+ "glVertexAttrib4sv\0"
+ "glVertexAttrib4svARB\0"
+ "\0"
+ /* _mesa_function_pool[32001]: GetFloatv (offset 262) */
+ "ip\0"
+ "glGetFloatv\0"
+ "\0"
+ /* _mesa_function_pool[32017]: CreateDebugObjectMESA (dynamic) */
+ "\0"
+ "glCreateDebugObjectMESA\0"
+ "\0"
+ /* _mesa_function_pool[32043]: GetShaderiv (will be remapped) */
+ "iip\0"
+ "glGetShaderiv\0"
+ "\0"
+ /* _mesa_function_pool[32062]: ClientWaitSync (will be remapped) */
+ "iii\0"
+ "glClientWaitSync\0"
+ "\0"
+ /* _mesa_function_pool[32084]: TexCoord4s (offset 124) */
+ "iiii\0"
+ "glTexCoord4s\0"
+ "\0"
+ /* _mesa_function_pool[32103]: TexCoord3sv (offset 117) */
+ "p\0"
+ "glTexCoord3sv\0"
+ "\0"
+ /* _mesa_function_pool[32120]: BindFragmentShaderATI (will be remapped) */
+ "i\0"
+ "glBindFragmentShaderATI\0"
+ "\0"
+ /* _mesa_function_pool[32147]: PopAttrib (offset 218) */
+ "\0"
+ "glPopAttrib\0"
+ "\0"
+ /* _mesa_function_pool[32161]: Fogfv (offset 154) */
+ "ip\0"
+ "glFogfv\0"
+ "\0"
+ /* _mesa_function_pool[32173]: UnmapBufferARB (will be remapped) */
+ "i\0"
+ "glUnmapBuffer\0"
+ "glUnmapBufferARB\0"
+ "\0"
+ /* _mesa_function_pool[32207]: InitNames (offset 197) */
+ "\0"
+ "glInitNames\0"
+ "\0"
+ /* _mesa_function_pool[32221]: Normal3sv (offset 61) */
+ "p\0"
+ "glNormal3sv\0"
+ "\0"
+ /* _mesa_function_pool[32236]: Minmax (offset 368) */
+ "iii\0"
+ "glMinmax\0"
+ "glMinmaxEXT\0"
+ "\0"
+ /* _mesa_function_pool[32262]: TexCoord4d (offset 118) */
+ "dddd\0"
+ "glTexCoord4d\0"
+ "\0"
+ /* _mesa_function_pool[32281]: TexCoord4f (offset 120) */
+ "ffff\0"
+ "glTexCoord4f\0"
+ "\0"
+ /* _mesa_function_pool[32300]: FogCoorddvEXT (will be remapped) */
+ "p\0"
+ "glFogCoorddv\0"
+ "glFogCoorddvEXT\0"
+ "\0"
+ /* _mesa_function_pool[32332]: FinishTextureSUNX (dynamic) */
+ "\0"
+ "glFinishTextureSUNX\0"
+ "\0"
+ /* _mesa_function_pool[32354]: GetFragmentLightfvSGIX (dynamic) */
+ "iip\0"
+ "glGetFragmentLightfvSGIX\0"
+ "\0"
+ /* _mesa_function_pool[32384]: Binormal3fvEXT (dynamic) */
+ "p\0"
+ "glBinormal3fvEXT\0"
+ "\0"
+ /* _mesa_function_pool[32404]: GetBooleanv (offset 258) */
+ "ip\0"
+ "glGetBooleanv\0"
+ "\0"
+ /* _mesa_function_pool[32422]: ColorFragmentOp3ATI (will be remapped) */
+ "iiiiiiiiiiiii\0"
+ "glColorFragmentOp3ATI\0"
+ "\0"
+ /* _mesa_function_pool[32459]: Hint (offset 158) */
+ "ii\0"
+ "glHint\0"
+ "\0"
+ /* _mesa_function_pool[32470]: Color4dv (offset 28) */
+ "p\0"
+ "glColor4dv\0"
+ "\0"
+ /* _mesa_function_pool[32484]: VertexAttrib2svARB (will be remapped) */
+ "ip\0"
+ "glVertexAttrib2sv\0"
+ "glVertexAttrib2svARB\0"
+ "\0"
+ /* _mesa_function_pool[32527]: AreProgramsResidentNV (will be remapped) */
+ "ipp\0"
+ "glAreProgramsResidentNV\0"
+ "\0"
+ /* _mesa_function_pool[32556]: WindowPos3svMESA (will be remapped) */
+ "p\0"
+ "glWindowPos3sv\0"
+ "glWindowPos3svARB\0"
+ "glWindowPos3svMESA\0"
+ "\0"
+ /* _mesa_function_pool[32611]: CopyColorSubTable (offset 347) */
+ "iiiii\0"
+ "glCopyColorSubTable\0"
+ "glCopyColorSubTableEXT\0"
+ "\0"
+ /* _mesa_function_pool[32661]: WeightdvARB (dynamic) */
+ "ip\0"
+ "glWeightdvARB\0"
+ "\0"
+ /* _mesa_function_pool[32679]: DeleteRenderbuffersEXT (will be remapped) */
+ "ip\0"
+ "glDeleteRenderbuffers\0"
+ "glDeleteRenderbuffersEXT\0"
+ "\0"
+ /* _mesa_function_pool[32730]: VertexAttrib4NubvARB (will be remapped) */
+ "ip\0"
+ "glVertexAttrib4Nubv\0"
+ "glVertexAttrib4NubvARB\0"
+ "\0"
+ /* _mesa_function_pool[32777]: VertexAttrib3dvNV (will be remapped) */
+ "ip\0"
+ "glVertexAttrib3dvNV\0"
+ "\0"
+ /* _mesa_function_pool[32801]: GetObjectParameterfvARB (will be remapped) */
+ "iip\0"
+ "glGetObjectParameterfvARB\0"
+ "\0"
+ /* _mesa_function_pool[32832]: Vertex4iv (offset 147) */
+ "p\0"
+ "glVertex4iv\0"
+ "\0"
+ /* _mesa_function_pool[32847]: GetProgramEnvParameterdvARB (will be remapped) */
+ "iip\0"
+ "glGetProgramEnvParameterdvARB\0"
+ "\0"
+ /* _mesa_function_pool[32882]: TexCoord4dv (offset 119) */
+ "p\0"
+ "glTexCoord4dv\0"
+ "\0"
+ /* _mesa_function_pool[32899]: LockArraysEXT (will be remapped) */
+ "ii\0"
+ "glLockArraysEXT\0"
+ "\0"
+ /* _mesa_function_pool[32919]: Begin (offset 7) */
+ "i\0"
+ "glBegin\0"
+ "\0"
+ /* _mesa_function_pool[32930]: LightModeli (offset 165) */
+ "ii\0"
+ "glLightModeli\0"
+ "\0"
+ /* _mesa_function_pool[32948]: VertexAttribI4ivEXT (will be remapped) */
+ "ip\0"
+ "glVertexAttribI4ivEXT\0"
+ "glVertexAttribI4iv\0"
+ "\0"
+ /* _mesa_function_pool[32993]: Rectfv (offset 89) */
+ "pp\0"
+ "glRectfv\0"
+ "\0"
+ /* _mesa_function_pool[33006]: BlendEquationSeparateiARB (will be remapped) */
+ "iii\0"
+ "glBlendEquationSeparateiARB\0"
+ "glBlendEquationSeparateIndexedAMD\0"
+ "\0"
+ /* _mesa_function_pool[33073]: LightModelf (offset 163) */
+ "if\0"
+ "glLightModelf\0"
+ "\0"
+ /* _mesa_function_pool[33091]: GetTexParameterfv (offset 282) */
+ "iip\0"
+ "glGetTexParameterfv\0"
+ "\0"
+ /* _mesa_function_pool[33116]: GetLightfv (offset 264) */
+ "iip\0"
+ "glGetLightfv\0"
+ "\0"
+ /* _mesa_function_pool[33134]: PixelTransformParameterivEXT (dynamic) */
+ "iip\0"
+ "glPixelTransformParameterivEXT\0"
+ "\0"
+ /* _mesa_function_pool[33170]: BinormalPointerEXT (dynamic) */
+ "iip\0"
+ "glBinormalPointerEXT\0"
+ "\0"
+ /* _mesa_function_pool[33196]: VertexAttrib1dNV (will be remapped) */
+ "id\0"
+ "glVertexAttrib1dNV\0"
+ "\0"
+ /* _mesa_function_pool[33219]: GetCombinerInputParameterivNV (will be remapped) */
+ "iiiip\0"
+ "glGetCombinerInputParameterivNV\0"
+ "\0"
+ /* _mesa_function_pool[33258]: Disable (offset 214) */
+ "i\0"
+ "glDisable\0"
+ "\0"
+ /* _mesa_function_pool[33271]: MultiTexCoord2fvARB (offset 387) */
+ "ip\0"
+ "glMultiTexCoord2fv\0"
+ "glMultiTexCoord2fvARB\0"
+ "\0"
+ /* _mesa_function_pool[33316]: GetRenderbufferParameterivEXT (will be remapped) */
+ "iip\0"
+ "glGetRenderbufferParameteriv\0"
+ "glGetRenderbufferParameterivEXT\0"
+ "\0"
+ /* _mesa_function_pool[33382]: CombinerParameterivNV (will be remapped) */
+ "ip\0"
+ "glCombinerParameterivNV\0"
+ "\0"
+ /* _mesa_function_pool[33410]: GenFragmentShadersATI (will be remapped) */
+ "i\0"
+ "glGenFragmentShadersATI\0"
+ "\0"
+ /* _mesa_function_pool[33437]: DrawArrays (offset 310) */
+ "iii\0"
+ "glDrawArrays\0"
+ "glDrawArraysEXT\0"
+ "\0"
+ /* _mesa_function_pool[33471]: WeightuivARB (dynamic) */
+ "ip\0"
+ "glWeightuivARB\0"
+ "\0"
+ /* _mesa_function_pool[33490]: GetVertexAttribIivEXT (will be remapped) */
+ "iip\0"
+ "glGetVertexAttribIivEXT\0"
+ "glGetVertexAttribIiv\0"
+ "\0"
+ /* _mesa_function_pool[33540]: VertexAttrib2sARB (will be remapped) */
+ "iii\0"
+ "glVertexAttrib2s\0"
+ "glVertexAttrib2sARB\0"
+ "\0"
+ /* _mesa_function_pool[33582]: GetnTexImageARB (will be remapped) */
+ "iiiiip\0"
+ "glGetnTexImageARB\0"
+ "\0"
+ /* _mesa_function_pool[33608]: ColorMask (offset 210) */
+ "iiii\0"
+ "glColorMask\0"
+ "\0"
+ /* _mesa_function_pool[33626]: GenAsyncMarkersSGIX (dynamic) */
+ "i\0"
+ "glGenAsyncMarkersSGIX\0"
+ "\0"
+ /* _mesa_function_pool[33651]: Tangent3svEXT (dynamic) */
+ "p\0"
+ "glTangent3svEXT\0"
+ "\0"
+ /* _mesa_function_pool[33670]: GetListParameterivSGIX (dynamic) */
+ "iip\0"
+ "glGetListParameterivSGIX\0"
+ "\0"
+ /* _mesa_function_pool[33700]: BindBufferARB (will be remapped) */
+ "ii\0"
+ "glBindBuffer\0"
+ "glBindBufferARB\0"
+ "\0"
+ /* _mesa_function_pool[33733]: GetInfoLogARB (will be remapped) */
+ "iipp\0"
+ "glGetInfoLogARB\0"
+ "\0"
+ /* _mesa_function_pool[33755]: RasterPos4iv (offset 83) */
+ "p\0"
+ "glRasterPos4iv\0"
+ "\0"
+ /* _mesa_function_pool[33773]: Enable (offset 215) */
+ "i\0"
+ "glEnable\0"
+ "\0"
+ /* _mesa_function_pool[33785]: LineStipple (offset 167) */
+ "ii\0"
+ "glLineStipple\0"
+ "\0"
+ /* _mesa_function_pool[33803]: VertexAttribs4svNV (will be remapped) */
+ "iip\0"
+ "glVertexAttribs4svNV\0"
+ "\0"
+ /* _mesa_function_pool[33829]: EdgeFlagPointerListIBM (dynamic) */
+ "ipi\0"
+ "glEdgeFlagPointerListIBM\0"
+ "\0"
+ /* _mesa_function_pool[33859]: UniformMatrix3x2fv (will be remapped) */
+ "iiip\0"
+ "glUniformMatrix3x2fv\0"
+ "\0"
+ /* _mesa_function_pool[33886]: GetMinmaxParameterfv (offset 365) */
+ "iip\0"
+ "glGetMinmaxParameterfv\0"
+ "glGetMinmaxParameterfvEXT\0"
+ "\0"
+ /* _mesa_function_pool[33940]: VertexAttrib1fvARB (will be remapped) */
+ "ip\0"
+ "glVertexAttrib1fv\0"
+ "glVertexAttrib1fvARB\0"
+ "\0"
+ /* _mesa_function_pool[33983]: GenBuffersARB (will be remapped) */
+ "ip\0"
+ "glGenBuffers\0"
+ "glGenBuffersARB\0"
+ "\0"
+ /* _mesa_function_pool[34016]: VertexAttribs1svNV (will be remapped) */
+ "iip\0"
+ "glVertexAttribs1svNV\0"
+ "\0"
+ /* _mesa_function_pool[34042]: Vertex3fv (offset 137) */
+ "p\0"
+ "glVertex3fv\0"
+ "\0"
+ /* _mesa_function_pool[34057]: GetTexBumpParameterivATI (will be remapped) */
+ "ip\0"
+ "glGetTexBumpParameterivATI\0"
+ "\0"
+ /* _mesa_function_pool[34088]: Binormal3bEXT (dynamic) */
+ "iii\0"
+ "glBinormal3bEXT\0"
+ "\0"
+ /* _mesa_function_pool[34109]: FragmentMaterialivSGIX (dynamic) */
+ "iip\0"
+ "glFragmentMaterialivSGIX\0"
+ "\0"
+ /* _mesa_function_pool[34139]: IsRenderbufferEXT (will be remapped) */
+ "i\0"
+ "glIsRenderbuffer\0"
+ "glIsRenderbufferEXT\0"
+ "\0"
+ /* _mesa_function_pool[34179]: GenProgramsNV (will be remapped) */
+ "ip\0"
+ "glGenProgramsARB\0"
+ "glGenProgramsNV\0"
+ "\0"
+ /* _mesa_function_pool[34216]: VertexAttrib4dvNV (will be remapped) */
+ "ip\0"
+ "glVertexAttrib4dvNV\0"
+ "\0"
+ /* _mesa_function_pool[34240]: EndFragmentShaderATI (will be remapped) */
+ "\0"
+ "glEndFragmentShaderATI\0"
+ "\0"
+ /* _mesa_function_pool[34265]: Binormal3iEXT (dynamic) */
+ "iii\0"
+ "glBinormal3iEXT\0"
+ "\0"
+ /* _mesa_function_pool[34286]: WindowPos2fMESA (will be remapped) */
+ "ff\0"
+ "glWindowPos2f\0"
+ "glWindowPos2fARB\0"
+ "glWindowPos2fMESA\0"
+ "\0"
+ ;
+
+/* these functions need to be remapped */
+static const struct gl_function_pool_remap MESA_remap_table_functions[] = {
+ { 1629, AttachShader_remap_index },
+ { 10274, CreateProgram_remap_index },
+ { 23765, CreateShader_remap_index },
+ { 26289, DeleteProgram_remap_index },
+ { 19245, DeleteShader_remap_index },
+ { 24258, DetachShader_remap_index },
+ { 18534, GetAttachedShaders_remap_index },
+ { 5126, GetProgramInfoLog_remap_index },
+ { 444, GetProgramiv_remap_index },
+ { 6892, GetShaderInfoLog_remap_index },
+ { 32043, GetShaderiv_remap_index },
+ { 13807, IsProgram_remap_index },
+ { 12698, IsShader_remap_index },
+ { 10404, StencilFuncSeparate_remap_index },
+ { 4156, StencilMaskSeparate_remap_index },
+ { 7957, StencilOpSeparate_remap_index },
+ { 22999, UniformMatrix2x3fv_remap_index },
+ { 2998, UniformMatrix2x4fv_remap_index },
+ { 33859, UniformMatrix3x2fv_remap_index },
+ { 31360, UniformMatrix3x4fv_remap_index },
+ { 16726, UniformMatrix4x2fv_remap_index },
+ { 3417, UniformMatrix4x3fv_remap_index },
+ { 5332, ClampColor_remap_index },
+ { 18588, ClearBufferfi_remap_index },
+ { 18004, ClearBufferfv_remap_index },
+ { 30383, ClearBufferiv_remap_index },
+ { 14012, ClearBufferuiv_remap_index },
+ { 20582, GetStringi_remap_index },
+ { 2900, TexBuffer_remap_index },
+ { 977, FramebufferTexture_remap_index },
+ { 27325, GetBufferParameteri64v_remap_index },
+ { 10504, GetInteger64i_v_remap_index },
+ { 24079, VertexAttribDivisor_remap_index },
+ { 10292, LoadTransposeMatrixdARB_remap_index },
+ { 31772, LoadTransposeMatrixfARB_remap_index },
+ { 5971, MultTransposeMatrixdARB_remap_index },
+ { 24445, MultTransposeMatrixfARB_remap_index },
+ { 255, SampleCoverageARB_remap_index },
+ { 6155, CompressedTexImage1DARB_remap_index },
+ { 24973, CompressedTexImage2DARB_remap_index },
+ { 4219, CompressedTexImage3DARB_remap_index },
+ { 18876, CompressedTexSubImage1DARB_remap_index },
+ { 2141, CompressedTexSubImage2DARB_remap_index },
+ { 21004, CompressedTexSubImage3DARB_remap_index },
+ { 29489, GetCompressedTexImageARB_remap_index },
+ { 3983, DisableVertexAttribArrayARB_remap_index },
+ { 30925, EnableVertexAttribArrayARB_remap_index },
+ { 32847, GetProgramEnvParameterdvARB_remap_index },
+ { 24325, GetProgramEnvParameterfvARB_remap_index },
+ { 28354, GetProgramLocalParameterdvARB_remap_index },
+ { 8433, GetProgramLocalParameterfvARB_remap_index },
+ { 19052, GetProgramStringARB_remap_index },
+ { 28549, GetProgramivARB_remap_index },
+ { 21199, GetVertexAttribdvARB_remap_index },
+ { 16534, GetVertexAttribfvARB_remap_index },
+ { 10108, GetVertexAttribivARB_remap_index },
+ { 20045, ProgramEnvParameter4dARB_remap_index },
+ { 26039, ProgramEnvParameter4dvARB_remap_index },
+ { 17302, ProgramEnvParameter4fARB_remap_index },
+ { 9308, ProgramEnvParameter4fvARB_remap_index },
+ { 4182, ProgramLocalParameter4dARB_remap_index },
+ { 13517, ProgramLocalParameter4dvARB_remap_index },
+ { 30404, ProgramLocalParameter4fARB_remap_index },
+ { 26685, ProgramLocalParameter4fvARB_remap_index },
+ { 29243, ProgramStringARB_remap_index },
+ { 20313, VertexAttrib1dARB_remap_index },
+ { 16161, VertexAttrib1dvARB_remap_index },
+ { 4378, VertexAttrib1fARB_remap_index },
+ { 33940, VertexAttrib1fvARB_remap_index },
+ { 7483, VertexAttrib1sARB_remap_index },
+ { 2336, VertexAttrib1svARB_remap_index },
+ { 15592, VertexAttrib2dARB_remap_index },
+ { 18025, VertexAttrib2dvARB_remap_index },
+ { 1687, VertexAttrib2fARB_remap_index },
+ { 18138, VertexAttrib2fvARB_remap_index },
+ { 33540, VertexAttrib2sARB_remap_index },
+ { 32484, VertexAttrib2svARB_remap_index },
+ { 11682, VertexAttrib3dARB_remap_index },
+ { 8975, VertexAttrib3dvARB_remap_index },
+ { 1774, VertexAttrib3fARB_remap_index },
+ { 23316, VertexAttrib3fvARB_remap_index },
+ { 29090, VertexAttrib3sARB_remap_index },
+ { 20941, VertexAttrib3svARB_remap_index },
+ { 5152, VertexAttrib4NbvARB_remap_index },
+ { 18411, VertexAttrib4NivARB_remap_index },
+ { 23271, VertexAttrib4NsvARB_remap_index },
+ { 24277, VertexAttrib4NubARB_remap_index },
+ { 32730, VertexAttrib4NubvARB_remap_index },
+ { 19696, VertexAttrib4NuivARB_remap_index },
+ { 3290, VertexAttrib4NusvARB_remap_index },
+ { 11271, VertexAttrib4bvARB_remap_index },
+ { 27727, VertexAttrib4dARB_remap_index },
+ { 21998, VertexAttrib4dvARB_remap_index },
+ { 11836, VertexAttrib4fARB_remap_index },
+ { 12240, VertexAttrib4fvARB_remap_index },
+ { 10647, VertexAttrib4ivARB_remap_index },
+ { 17818, VertexAttrib4sARB_remap_index },
+ { 31958, VertexAttrib4svARB_remap_index },
+ { 17107, VertexAttrib4ubvARB_remap_index },
+ { 31249, VertexAttrib4uivARB_remap_index },
+ { 20752, VertexAttrib4usvARB_remap_index },
+ { 22814, VertexAttribPointerARB_remap_index },
+ { 33700, BindBufferARB_remap_index },
+ { 7190, BufferDataARB_remap_index },
+ { 1550, BufferSubDataARB_remap_index },
+ { 31535, DeleteBuffersARB_remap_index },
+ { 33983, GenBuffersARB_remap_index },
+ { 18181, GetBufferParameterivARB_remap_index },
+ { 17254, GetBufferPointervARB_remap_index },
+ { 1503, GetBufferSubDataARB_remap_index },
+ { 31197, IsBufferARB_remap_index },
+ { 27169, MapBufferARB_remap_index },
+ { 32173, UnmapBufferARB_remap_index },
+ { 351, BeginQueryARB_remap_index },
+ { 20408, DeleteQueriesARB_remap_index },
+ { 12559, EndQueryARB_remap_index },
+ { 29968, GenQueriesARB_remap_index },
+ { 2033, GetQueryObjectivARB_remap_index },
+ { 17862, GetQueryObjectuivARB_remap_index },
+ { 1831, GetQueryivARB_remap_index },
+ { 20659, IsQueryARB_remap_index },
+ { 8585, AttachObjectARB_remap_index },
+ { 19207, CompileShaderARB_remap_index },
+ { 3359, CreateProgramObjectARB_remap_index },
+ { 7135, CreateShaderObjectARB_remap_index },
+ { 14894, DeleteObjectARB_remap_index },
+ { 24764, DetachObjectARB_remap_index },
+ { 12304, GetActiveUniformARB_remap_index },
+ { 9783, GetAttachedObjectsARB_remap_index },
+ { 10090, GetHandleARB_remap_index },
+ { 33733, GetInfoLogARB_remap_index },
+ { 32801, GetObjectParameterfvARB_remap_index },
+ { 28228, GetObjectParameterivARB_remap_index },
+ { 29726, GetShaderSourceARB_remap_index },
+ { 28950, GetUniformLocationARB_remap_index },
+ { 24547, GetUniformfvARB_remap_index },
+ { 13092, GetUniformivARB_remap_index },
+ { 20797, LinkProgramARB_remap_index },
+ { 20855, ShaderSourceARB_remap_index },
+ { 7857, Uniform1fARB_remap_index },
+ { 30613, Uniform1fvARB_remap_index },
+ { 22762, Uniform1iARB_remap_index },
+ { 21652, Uniform1ivARB_remap_index },
+ { 2285, Uniform2fARB_remap_index },
+ { 14730, Uniform2fvARB_remap_index },
+ { 27056, Uniform2iARB_remap_index },
+ { 2405, Uniform2ivARB_remap_index },
+ { 19317, Uniform3fARB_remap_index },
+ { 9813, Uniform3fvARB_remap_index },
+ { 6746, Uniform3iARB_remap_index },
+ { 17360, Uniform3ivARB_remap_index },
+ { 19851, Uniform4fARB_remap_index },
+ { 24411, Uniform4fvARB_remap_index },
+ { 25673, Uniform4iARB_remap_index },
+ { 21165, Uniform4ivARB_remap_index },
+ { 8637, UniformMatrix2fvARB_remap_index },
+ { 17, UniformMatrix3fvARB_remap_index },
+ { 2802, UniformMatrix4fvARB_remap_index },
+ { 26151, UseProgramObjectARB_remap_index },
+ { 15280, ValidateProgramARB_remap_index },
+ { 22041, BindAttribLocationARB_remap_index },
+ { 5197, GetActiveAttribARB_remap_index },
+ { 17041, GetAttribLocationARB_remap_index },
+ { 30331, DrawBuffersARB_remap_index },
+ { 30164, ClampColorARB_remap_index },
+ { 18456, DrawArraysInstancedARB_remap_index },
+ { 6807, DrawElementsInstancedARB_remap_index },
+ { 13622, RenderbufferStorageMultisample_remap_index },
+ { 14093, FramebufferTextureARB_remap_index },
+ { 26587, FramebufferTextureFaceARB_remap_index },
+ { 24913, ProgramParameteriARB_remap_index },
+ { 6327, VertexAttribDivisorARB_remap_index },
+ { 19899, FlushMappedBufferRange_remap_index },
+ { 28665, MapBufferRange_remap_index },
+ { 28572, TexBufferARB_remap_index },
+ { 16864, BindVertexArray_remap_index },
+ { 15103, GenVertexArrays_remap_index },
+ { 31127, CopyBufferSubData_remap_index },
+ { 32062, ClientWaitSync_remap_index },
+ { 2721, DeleteSync_remap_index },
+ { 7524, FenceSync_remap_index },
+ { 15651, GetInteger64v_remap_index },
+ { 23378, GetSynciv_remap_index },
+ { 30270, IsSync_remap_index },
+ { 9731, WaitSync_remap_index },
+ { 3951, DrawElementsBaseVertex_remap_index },
+ { 31439, DrawRangeElementsBaseVertex_remap_index },
+ { 27200, MultiDrawElementsBaseVertex_remap_index },
+ { 33006, BlendEquationSeparateiARB_remap_index },
+ { 18274, BlendEquationiARB_remap_index },
+ { 13031, BlendFuncSeparateiARB_remap_index },
+ { 10156, BlendFunciARB_remap_index },
+ { 8499, BindSampler_remap_index },
+ { 4357, DeleteSamplers_remap_index },
+ { 20272, GenSamplers_remap_index },
+ { 30202, GetSamplerParameterIiv_remap_index },
+ { 19793, GetSamplerParameterIuiv_remap_index },
+ { 5046, GetSamplerParameterfv_remap_index },
+ { 26308, GetSamplerParameteriv_remap_index },
+ { 14648, IsSampler_remap_index },
+ { 16817, SamplerParameterIiv_remap_index },
+ { 31478, SamplerParameterIuiv_remap_index },
+ { 23051, SamplerParameterf_remap_index },
+ { 16973, SamplerParameterfv_remap_index },
+ { 23026, SamplerParameteri_remap_index },
+ { 18650, SamplerParameteriv_remap_index },
+ { 5393, BindTransformFeedback_remap_index },
+ { 3386, DeleteTransformFeedbacks_remap_index },
+ { 6779, DrawTransformFeedback_remap_index },
+ { 9950, GenTransformFeedbacks_remap_index },
+ { 29133, IsTransformFeedback_remap_index },
+ { 26780, PauseTransformFeedback_remap_index },
+ { 5856, ResumeTransformFeedback_remap_index },
+ { 22361, ClearDepthf_remap_index },
+ { 7083, DepthRangef_remap_index },
+ { 14915, GetShaderPrecisionFormat_remap_index },
+ { 10344, ReleaseShaderCompiler_remap_index },
+ { 11314, ShaderBinary_remap_index },
+ { 1004, GetGraphicsResetStatusARB_remap_index },
+ { 25478, GetnColorTableARB_remap_index },
+ { 8268, GetnCompressedTexImageARB_remap_index },
+ { 4090, GetnConvolutionFilterARB_remap_index },
+ { 16204, GetnHistogramARB_remap_index },
+ { 24237, GetnMapdvARB_remap_index },
+ { 22793, GetnMapfvARB_remap_index },
+ { 2264, GetnMapivARB_remap_index },
+ { 17622, GetnMinmaxARB_remap_index },
+ { 4671, GetnPixelMapfvARB_remap_index },
+ { 19670, GetnPixelMapuivARB_remap_index },
+ { 3111, GetnPixelMapusvARB_remap_index },
+ { 1383, GetnPolygonStippleARB_remap_index },
+ { 21826, GetnSeparableFilterARB_remap_index },
+ { 33582, GetnTexImageARB_remap_index },
+ { 19079, GetnUniformdvARB_remap_index },
+ { 4743, GetnUniformfvARB_remap_index },
+ { 10199, GetnUniformivARB_remap_index },
+ { 23227, GetnUniformuivARB_remap_index },
+ { 3025, ReadnPixelsARB_remap_index },
+ { 5724, PolygonOffsetEXT_remap_index },
+ { 24000, GetPixelTexGenParameterfvSGIS_remap_index },
+ { 4621, GetPixelTexGenParameterivSGIS_remap_index },
+ { 23733, PixelTexGenParameterfSGIS_remap_index },
+ { 663, PixelTexGenParameterfvSGIS_remap_index },
+ { 13130, PixelTexGenParameteriSGIS_remap_index },
+ { 14235, PixelTexGenParameterivSGIS_remap_index },
+ { 18775, SampleMaskSGIS_remap_index },
+ { 20599, SamplePatternSGIS_remap_index },
+ { 27129, ColorPointerEXT_remap_index },
+ { 18068, EdgeFlagPointerEXT_remap_index },
+ { 6400, IndexPointerEXT_remap_index },
+ { 6480, NormalPointerEXT_remap_index },
+ { 16272, TexCoordPointerEXT_remap_index },
+ { 7313, VertexPointerEXT_remap_index },
+ { 3753, PointParameterfEXT_remap_index },
+ { 8164, PointParameterfvEXT_remap_index },
+ { 32899, LockArraysEXT_remap_index },
+ { 15344, UnlockArraysEXT_remap_index },
+ { 1291, SecondaryColor3bEXT_remap_index },
+ { 8357, SecondaryColor3bvEXT_remap_index },
+ { 10824, SecondaryColor3dEXT_remap_index },
+ { 26357, SecondaryColor3dvEXT_remap_index },
+ { 28999, SecondaryColor3fEXT_remap_index },
+ { 18812, SecondaryColor3fvEXT_remap_index },
+ { 509, SecondaryColor3iEXT_remap_index },
+ { 16582, SecondaryColor3ivEXT_remap_index },
+ { 10432, SecondaryColor3sEXT_remap_index },
+ { 31726, SecondaryColor3svEXT_remap_index },
+ { 28064, SecondaryColor3ubEXT_remap_index },
+ { 21932, SecondaryColor3ubvEXT_remap_index },
+ { 13372, SecondaryColor3uiEXT_remap_index },
+ { 23620, SecondaryColor3uivEXT_remap_index },
+ { 26637, SecondaryColor3usEXT_remap_index },
+ { 13445, SecondaryColor3usvEXT_remap_index },
+ { 12183, SecondaryColorPointerEXT_remap_index },
+ { 26451, MultiDrawArraysEXT_remap_index },
+ { 21587, MultiDrawElementsEXT_remap_index },
+ { 21782, FogCoordPointerEXT_remap_index },
+ { 4794, FogCoorddEXT_remap_index },
+ { 32300, FogCoorddvEXT_remap_index },
+ { 4911, FogCoordfEXT_remap_index },
+ { 27987, FogCoordfvEXT_remap_index },
+ { 12283, PixelTexGenSGIX_remap_index },
+ { 28592, BlendFuncSeparateEXT_remap_index },
+ { 7225, FlushVertexArrayRangeNV_remap_index },
+ { 5673, VertexArrayRangeNV_remap_index },
+ { 29064, CombinerInputNV_remap_index },
+ { 2207, CombinerOutputNV_remap_index },
+ { 31879, CombinerParameterfNV_remap_index },
+ { 5547, CombinerParameterfvNV_remap_index },
+ { 23076, CombinerParameteriNV_remap_index },
+ { 33382, CombinerParameterivNV_remap_index },
+ { 7601, FinalCombinerInputNV_remap_index },
+ { 1648, GetCombinerInputParameterfvNV_remap_index },
+ { 33219, GetCombinerInputParameterivNV_remap_index },
+ { 216, GetCombinerOutputParameterfvNV_remap_index },
+ { 14196, GetCombinerOutputParameterivNV_remap_index },
+ { 6987, GetFinalCombinerInputParameterfvNV_remap_index },
+ { 25545, GetFinalCombinerInputParameterivNV_remap_index },
+ { 13009, ResizeBuffersMESA_remap_index },
+ { 11509, WindowPos2dMESA_remap_index },
+ { 1084, WindowPos2dvMESA_remap_index },
+ { 34286, WindowPos2fMESA_remap_index },
+ { 8302, WindowPos2fvMESA_remap_index },
+ { 18722, WindowPos2iMESA_remap_index },
+ { 21072, WindowPos2ivMESA_remap_index },
+ { 21686, WindowPos2sMESA_remap_index },
+ { 6069, WindowPos2svMESA_remap_index },
+ { 8093, WindowPos3dMESA_remap_index },
+ { 14443, WindowPos3dvMESA_remap_index },
+ { 555, WindowPos3fMESA_remap_index },
+ { 15405, WindowPos3fvMESA_remap_index },
+ { 24806, WindowPos3iMESA_remap_index },
+ { 31072, WindowPos3ivMESA_remap_index },
+ { 19462, WindowPos3sMESA_remap_index },
+ { 32556, WindowPos3svMESA_remap_index },
+ { 11460, WindowPos4dMESA_remap_index },
+ { 17498, WindowPos4dvMESA_remap_index },
+ { 14402, WindowPos4fMESA_remap_index },
+ { 31633, WindowPos4fvMESA_remap_index },
+ { 31225, WindowPos4iMESA_remap_index },
+ { 12812, WindowPos4ivMESA_remap_index },
+ { 19646, WindowPos4sMESA_remap_index },
+ { 3337, WindowPos4svMESA_remap_index },
+ { 27695, MultiModeDrawArraysIBM_remap_index },
+ { 29839, MultiModeDrawElementsIBM_remap_index },
+ { 12587, DeleteFencesNV_remap_index },
+ { 28911, FinishFenceNV_remap_index },
+ { 3875, GenFencesNV_remap_index },
+ { 17478, GetFenceivNV_remap_index },
+ { 8570, IsFenceNV_remap_index },
+ { 14123, SetFenceNV_remap_index },
+ { 4434, TestFenceNV_remap_index },
+ { 32527, AreProgramsResidentNV_remap_index },
+ { 31921, BindProgramNV_remap_index },
+ { 26720, DeleteProgramsNV_remap_index },
+ { 22150, ExecuteProgramNV_remap_index },
+ { 34179, GenProgramsNV_remap_index },
+ { 24105, GetProgramParameterdvNV_remap_index },
+ { 10886, GetProgramParameterfvNV_remap_index },
+ { 27103, GetProgramStringNV_remap_index },
+ { 25183, GetProgramivNV_remap_index },
+ { 24360, GetTrackMatrixivNV_remap_index },
+ { 26897, GetVertexAttribPointervNV_remap_index },
+ { 10527, GetVertexAttribdvNV_remap_index },
+ { 9626, GetVertexAttribfvNV_remap_index },
+ { 19025, GetVertexAttribivNV_remap_index },
+ { 19929, IsProgramNV_remap_index },
+ { 9709, LoadProgramNV_remap_index },
+ { 28688, ProgramParameters4dvNV_remap_index },
+ { 25113, ProgramParameters4fvNV_remap_index },
+ { 21376, RequestResidentProgramsNV_remap_index },
+ { 31417, TrackMatrixNV_remap_index },
+ { 33196, VertexAttrib1dNV_remap_index },
+ { 14034, VertexAttrib1dvNV_remap_index },
+ { 29345, VertexAttrib1fNV_remap_index },
+ { 2527, VertexAttrib1fvNV_remap_index },
+ { 31690, VertexAttrib1sNV_remap_index },
+ { 15478, VertexAttrib1svNV_remap_index },
+ { 5102, VertexAttrib2dNV_remap_index },
+ { 13927, VertexAttrib2dvNV_remap_index },
+ { 20831, VertexAttrib2fNV_remap_index },
+ { 13493, VertexAttrib2fvNV_remap_index },
+ { 6281, VertexAttrib2sNV_remap_index },
+ { 19516, VertexAttrib2svNV_remap_index },
+ { 11657, VertexAttrib3dNV_remap_index },
+ { 32777, VertexAttrib3dvNV_remap_index },
+ { 10698, VertexAttrib3fNV_remap_index },
+ { 25505, VertexAttrib3fvNV_remap_index },
+ { 22869, VertexAttrib3sNV_remap_index },
+ { 24387, VertexAttrib3svNV_remap_index },
+ { 29813, VertexAttrib4dNV_remap_index },
+ { 34216, VertexAttrib4dvNV_remap_index },
+ { 5487, VertexAttrib4fNV_remap_index },
+ { 9759, VertexAttrib4fvNV_remap_index },
+ { 27579, VertexAttrib4sNV_remap_index },
+ { 1461, VertexAttrib4svNV_remap_index },
+ { 5260, VertexAttrib4ubNV_remap_index },
+ { 817, VertexAttrib4ubvNV_remap_index },
+ { 22330, VertexAttribPointerNV_remap_index },
+ { 2379, VertexAttribs1dvNV_remap_index },
+ { 26985, VertexAttribs1fvNV_remap_index },
+ { 34016, VertexAttribs1svNV_remap_index },
+ { 10723, VertexAttribs2dvNV_remap_index },
+ { 26112, VertexAttribs2fvNV_remap_index },
+ { 18094, VertexAttribs2svNV_remap_index },
+ { 5575, VertexAttribs3dvNV_remap_index },
+ { 2238, VertexAttribs3fvNV_remap_index },
+ { 30820, VertexAttribs3svNV_remap_index },
+ { 27669, VertexAttribs4dvNV_remap_index },
+ { 5647, VertexAttribs4fvNV_remap_index },
+ { 33803, VertexAttribs4svNV_remap_index },
+ { 30568, VertexAttribs4ubvNV_remap_index },
+ { 27771, GetTexBumpParameterfvATI_remap_index },
+ { 34057, GetTexBumpParameterivATI_remap_index },
+ { 19160, TexBumpParameterfvATI_remap_index },
+ { 21247, TexBumpParameterivATI_remap_index },
+ { 16024, AlphaFragmentOp1ATI_remap_index },
+ { 26403, AlphaFragmentOp2ATI_remap_index },
+ { 25421, AlphaFragmentOp3ATI_remap_index },
+ { 30747, BeginFragmentShaderATI_remap_index },
+ { 32120, BindFragmentShaderATI_remap_index },
+ { 24516, ColorFragmentOp1ATI_remap_index },
+ { 4549, ColorFragmentOp2ATI_remap_index },
+ { 32422, ColorFragmentOp3ATI_remap_index },
+ { 5813, DeleteFragmentShaderATI_remap_index },
+ { 34240, EndFragmentShaderATI_remap_index },
+ { 33410, GenFragmentShadersATI_remap_index },
+ { 26266, PassTexCoordATI_remap_index },
+ { 7293, SampleMapATI_remap_index },
+ { 27882, SetFragmentShaderConstantATI_remap_index },
+ { 402, PointParameteriNV_remap_index },
+ { 14604, PointParameterivNV_remap_index },
+ { 29652, ActiveStencilFaceEXT_remap_index },
+ { 28328, BindVertexArrayAPPLE_remap_index },
+ { 2849, DeleteVertexArraysAPPLE_remap_index },
+ { 18561, GenVertexArraysAPPLE_remap_index },
+ { 24170, IsVertexArrayAPPLE_remap_index },
+ { 858, GetProgramNamedParameterdvNV_remap_index },
+ { 3716, GetProgramNamedParameterfvNV_remap_index },
+ { 27802, ProgramNamedParameter4dNV_remap_index },
+ { 14978, ProgramNamedParameter4dvNV_remap_index },
+ { 9242, ProgramNamedParameter4fNV_remap_index },
+ { 12148, ProgramNamedParameter4fvNV_remap_index },
+ { 17409, PrimitiveRestartIndexNV_remap_index },
+ { 31610, PrimitiveRestartNV_remap_index },
+ { 25092, DepthBoundsEXT_remap_index },
+ { 1183, BlendEquationSeparateEXT_remap_index },
+ { 15179, BindFramebufferEXT_remap_index },
+ { 26496, BindRenderbufferEXT_remap_index },
+ { 10006, CheckFramebufferStatusEXT_remap_index },
+ { 23421, DeleteFramebuffersEXT_remap_index },
+ { 32679, DeleteRenderbuffersEXT_remap_index },
+ { 13951, FramebufferRenderbufferEXT_remap_index },
+ { 14140, FramebufferTexture1DEXT_remap_index },
+ { 11942, FramebufferTexture2DEXT_remap_index },
+ { 11562, FramebufferTexture3DEXT_remap_index },
+ { 24036, GenFramebuffersEXT_remap_index },
+ { 17959, GenRenderbuffersEXT_remap_index },
+ { 7029, GenerateMipmapEXT_remap_index },
+ { 22423, GetFramebufferAttachmentParameterivEXT_remap_index },
+ { 33316, GetRenderbufferParameterivEXT_remap_index },
+ { 21127, IsFramebufferEXT_remap_index },
+ { 34139, IsRenderbufferEXT_remap_index },
+ { 8517, RenderbufferStorageEXT_remap_index },
+ { 734, BlitFramebufferEXT_remap_index },
+ { 14764, BufferParameteriAPPLE_remap_index },
+ { 19961, FlushMappedBufferRangeAPPLE_remap_index },
+ { 1906, BindFragDataLocationEXT_remap_index },
+ { 25205, GetFragDataLocationEXT_remap_index },
+ { 11001, GetUniformuivEXT_remap_index },
+ { 33490, GetVertexAttribIivEXT_remap_index },
+ { 28859, GetVertexAttribIuivEXT_remap_index },
+ { 12420, Uniform1uiEXT_remap_index },
+ { 28773, Uniform1uivEXT_remap_index },
+ { 22965, Uniform2uiEXT_remap_index },
+ { 4513, Uniform2uivEXT_remap_index },
+ { 30092, Uniform3uiEXT_remap_index },
+ { 15125, Uniform3uivEXT_remap_index },
+ { 3640, Uniform4uiEXT_remap_index },
+ { 9018, Uniform4uivEXT_remap_index },
+ { 18940, VertexAttribI1iEXT_remap_index },
+ { 5287, VertexAttribI1ivEXT_remap_index },
+ { 2628, VertexAttribI1uiEXT_remap_index },
+ { 13221, VertexAttribI1uivEXT_remap_index },
+ { 81, VertexAttribI2iEXT_remap_index },
+ { 24628, VertexAttribI2ivEXT_remap_index },
+ { 5601, VertexAttribI2uiEXT_remap_index },
+ { 4956, VertexAttribI2uivEXT_remap_index },
+ { 27371, VertexAttribI3iEXT_remap_index },
+ { 25830, VertexAttribI3ivEXT_remap_index },
+ { 3494, VertexAttribI3uiEXT_remap_index },
+ { 31313, VertexAttribI3uivEXT_remap_index },
+ { 22674, VertexAttribI4bvEXT_remap_index },
+ { 15057, VertexAttribI4iEXT_remap_index },
+ { 32948, VertexAttribI4ivEXT_remap_index },
+ { 13854, VertexAttribI4svEXT_remap_index },
+ { 4043, VertexAttribI4ubvEXT_remap_index },
+ { 16645, VertexAttribI4uiEXT_remap_index },
+ { 5747, VertexAttribI4uivEXT_remap_index },
+ { 11725, VertexAttribI4usvEXT_remap_index },
+ { 19104, VertexAttribIPointerEXT_remap_index },
+ { 3181, FramebufferTextureLayerEXT_remap_index },
+ { 16999, ColorMaskIndexedEXT_remap_index },
+ { 19540, DisableIndexedEXT_remap_index },
+ { 27416, EnableIndexedEXT_remap_index },
+ { 22378, GetBooleanIndexedvEXT_remap_index },
+ { 11336, GetIntegerIndexedvEXT_remap_index },
+ { 23497, IsEnabledIndexedEXT_remap_index },
+ { 23397, ClearColorIiEXT_remap_index },
+ { 3590, ClearColorIuiEXT_remap_index },
+ { 10224, GetTexParameterIivEXT_remap_index },
+ { 6229, GetTexParameterIuivEXT_remap_index },
+ { 3137, TexParameterIivEXT_remap_index },
+ { 27238, TexParameterIuivEXT_remap_index },
+ { 4824, BeginConditionalRenderNV_remap_index },
+ { 26216, EndConditionalRenderNV_remap_index },
+ { 9653, BeginTransformFeedbackEXT_remap_index },
+ { 19575, BindBufferBaseEXT_remap_index },
+ { 19434, BindBufferOffsetEXT_remap_index },
+ { 12637, BindBufferRangeEXT_remap_index },
+ { 14679, EndTransformFeedbackEXT_remap_index },
+ { 11199, GetTransformFeedbackVaryingEXT_remap_index },
+ { 21432, TransformFeedbackVaryingsEXT_remap_index },
+ { 30469, ProvokingVertexEXT_remap_index },
+ { 11147, GetTexParameterPointervAPPLE_remap_index },
+ { 5349, TextureRangeAPPLE_remap_index },
+ { 12014, GetObjectParameterivAPPLE_remap_index },
+ { 20554, ObjectPurgeableAPPLE_remap_index },
+ { 6023, ObjectUnpurgeableAPPLE_remap_index },
+ { 17781, ActiveProgramEXT_remap_index },
+ { 17752, CreateShaderProgramEXT_remap_index },
+ { 29437, UseShaderProgramEXT_remap_index },
+ { 16952, TextureBarrierNV_remap_index },
+ { 29678, StencilFuncSeparateATI_remap_index },
+ { 5936, ProgramEnvParameters4fvEXT_remap_index },
+ { 17646, ProgramLocalParameters4fvEXT_remap_index },
+ { 14532, GetQueryObjecti64vEXT_remap_index },
+ { 10749, GetQueryObjectui64vEXT_remap_index },
+ { 24585, EGLImageTargetRenderbufferStorageOES_remap_index },
+ { 12526, EGLImageTargetTexture2DOES_remap_index },
+ { -1, -1 }
+};
+
+/* these functions are in the ABI, but have alternative names */
+static const struct gl_function_remap MESA_alt_functions[] = {
+ /* from GL_EXT_blend_color */
+ { 2767, _gloffset_BlendColor },
+ /* from GL_EXT_blend_minmax */
+ { 11619, _gloffset_BlendEquation },
+ /* from GL_EXT_color_subtable */
+ { 17520, _gloffset_ColorSubTable },
+ { 32611, _gloffset_CopyColorSubTable },
+ /* from GL_EXT_convolution */
+ { 296, _gloffset_ConvolutionFilter1D },
+ { 2566, _gloffset_CopyConvolutionFilter1D },
+ { 4293, _gloffset_GetConvolutionParameteriv },
+ { 8866, _gloffset_ConvolutionFilter2D },
+ { 9068, _gloffset_ConvolutionParameteriv },
+ { 9528, _gloffset_ConvolutionParameterfv },
+ { 21275, _gloffset_GetSeparableFilter },
+ { 24860, _gloffset_SeparableFilter2D },
+ { 25723, _gloffset_ConvolutionParameteri },
+ { 25891, _gloffset_ConvolutionParameterf },
+ { 27605, _gloffset_GetConvolutionParameterfv },
+ { 28494, _gloffset_GetConvolutionFilter },
+ { 31009, _gloffset_CopyConvolutionFilter2D },
+ /* from GL_EXT_copy_texture */
+ { 15538, _gloffset_CopyTexSubImage3D },
+ { 17207, _gloffset_CopyTexImage2D },
+ { 25331, _gloffset_CopyTexImage1D },
+ { 28175, _gloffset_CopyTexSubImage2D },
+ { 30647, _gloffset_CopyTexSubImage1D },
+ /* from GL_EXT_draw_range_elements */
+ { 9865, _gloffset_DrawRangeElements },
+ /* from GL_EXT_histogram */
+ { 895, _gloffset_Histogram },
+ { 3676, _gloffset_ResetHistogram },
+ { 10370, _gloffset_GetMinmax },
+ { 15872, _gloffset_GetHistogramParameterfv },
+ { 25256, _gloffset_GetMinmaxParameteriv },
+ { 27495, _gloffset_ResetMinmax },
+ { 28391, _gloffset_GetHistogramParameteriv },
+ { 29612, _gloffset_GetHistogram },
+ { 32236, _gloffset_Minmax },
+ { 33886, _gloffset_GetMinmaxParameterfv },
+ /* from GL_EXT_paletted_texture */
+ { 8728, _gloffset_ColorTable },
+ { 15718, _gloffset_GetColorTable },
+ { 23783, _gloffset_GetColorTableParameterfv },
+ { 25947, _gloffset_GetColorTableParameteriv },
+ /* from GL_EXT_subtexture */
+ { 7439, _gloffset_TexSubImage1D },
+ { 11074, _gloffset_TexSubImage2D },
+ /* from GL_EXT_texture3D */
+ { 1865, _gloffset_TexImage3D },
+ { 23552, _gloffset_TexSubImage3D },
+ /* from GL_EXT_texture_object */
+ { 3444, _gloffset_PrioritizeTextures },
+ { 7888, _gloffset_AreTexturesResident },
+ { 14058, _gloffset_GenTextures },
+ { 16231, _gloffset_DeleteTextures },
+ { 20242, _gloffset_IsTexture },
+ { 30712, _gloffset_BindTexture },
+ /* from GL_EXT_vertex_array */
+ { 25032, _gloffset_ArrayElement },
+ { 31824, _gloffset_GetPointerv },
+ { 33437, _gloffset_DrawArrays },
+ /* from GL_SGI_color_table */
+ { 8006, _gloffset_ColorTableParameteriv },
+ { 8728, _gloffset_ColorTable },
+ { 15718, _gloffset_GetColorTable },
+ { 15828, _gloffset_CopyColorTable },
+ { 20103, _gloffset_ColorTableParameterfv },
+ { 23783, _gloffset_GetColorTableParameterfv },
+ { 25947, _gloffset_GetColorTableParameteriv },
+ /* from GL_VERSION_1_3 */
+ { 464, _gloffset_MultiTexCoord3sARB },
+ { 696, _gloffset_ActiveTextureARB },
+ { 4451, _gloffset_MultiTexCoord1fvARB },
+ { 6505, _gloffset_MultiTexCoord3dARB },
+ { 6550, _gloffset_MultiTexCoord2iARB },
+ { 6674, _gloffset_MultiTexCoord2svARB },
+ { 8684, _gloffset_MultiTexCoord2fARB },
+ { 10779, _gloffset_MultiTexCoord3fvARB },
+ { 11381, _gloffset_MultiTexCoord4sARB },
+ { 12062, _gloffset_MultiTexCoord2dvARB },
+ { 12469, _gloffset_MultiTexCoord1svARB },
+ { 12870, _gloffset_MultiTexCoord3svARB },
+ { 12931, _gloffset_MultiTexCoord4iARB },
+ { 13762, _gloffset_MultiTexCoord3iARB },
+ { 14561, _gloffset_MultiTexCoord1dARB },
+ { 14793, _gloffset_MultiTexCoord3dvARB },
+ { 16072, _gloffset_MultiTexCoord3ivARB },
+ { 16117, _gloffset_MultiTexCoord2sARB },
+ { 17577, _gloffset_MultiTexCoord4ivARB },
+ { 19743, _gloffset_ClientActiveTextureARB },
+ { 22106, _gloffset_MultiTexCoord2dARB },
+ { 22543, _gloffset_MultiTexCoord4dvARB },
+ { 22920, _gloffset_MultiTexCoord4fvARB },
+ { 23924, _gloffset_MultiTexCoord3fARB },
+ { 26541, _gloffset_MultiTexCoord4dARB },
+ { 26807, _gloffset_MultiTexCoord1sARB },
+ { 27011, _gloffset_MultiTexCoord1dvARB },
+ { 28019, _gloffset_MultiTexCoord1ivARB },
+ { 28112, _gloffset_MultiTexCoord2ivARB },
+ { 28451, _gloffset_MultiTexCoord1iARB },
+ { 29887, _gloffset_MultiTexCoord4svARB },
+ { 30511, _gloffset_MultiTexCoord1fARB },
+ { 30774, _gloffset_MultiTexCoord4fARB },
+ { 33271, _gloffset_MultiTexCoord2fvARB },
+ { -1, -1 }
+};
+
+#endif /* need_MESA_remap_table */
+
+#if defined(need_GL_3DFX_tbuffer)
+static const struct gl_function_remap GL_3DFX_tbuffer_functions[] = {
+ { 9586, -1 }, /* TbufferMask3DFX */
+ { -1, -1 }
+};
+#endif
+
+#if defined(need_GL_AMD_draw_buffers_blend)
+/* functions defined in MESA_remap_table_functions are excluded */
+static const struct gl_function_remap GL_AMD_draw_buffers_blend_functions[] = {
+ { -1, -1 }
+};
+#endif
+
+#if defined(need_GL_APPLE_flush_buffer_range)
+/* functions defined in MESA_remap_table_functions are excluded */
+static const struct gl_function_remap GL_APPLE_flush_buffer_range_functions[] = {
+ { -1, -1 }
+};
+#endif
+
+#if defined(need_GL_APPLE_object_purgeable)
+/* functions defined in MESA_remap_table_functions are excluded */
+static const struct gl_function_remap GL_APPLE_object_purgeable_functions[] = {
+ { -1, -1 }
+};
+#endif
+
+#if defined(need_GL_APPLE_texture_range)
+/* functions defined in MESA_remap_table_functions are excluded */
+static const struct gl_function_remap GL_APPLE_texture_range_functions[] = {
+ { -1, -1 }
+};
+#endif
+
+#if defined(need_GL_APPLE_vertex_array_object)
+/* functions defined in MESA_remap_table_functions are excluded */
+static const struct gl_function_remap GL_APPLE_vertex_array_object_functions[] = {
+ { -1, -1 }
+};
+#endif
+
+#if defined(need_GL_ARB_ES2_compatibility)
+/* functions defined in MESA_remap_table_functions are excluded */
+static const struct gl_function_remap GL_ARB_ES2_compatibility_functions[] = {
+ { -1, -1 }
+};
+#endif
+
+#if defined(need_GL_ARB_color_buffer_float)
+/* functions defined in MESA_remap_table_functions are excluded */
+static const struct gl_function_remap GL_ARB_color_buffer_float_functions[] = {
+ { -1, -1 }
+};
+#endif
+
+#if defined(need_GL_ARB_copy_buffer)
+/* functions defined in MESA_remap_table_functions are excluded */
+static const struct gl_function_remap GL_ARB_copy_buffer_functions[] = {
+ { -1, -1 }
+};
+#endif
+
+#if defined(need_GL_ARB_draw_buffers)
+/* functions defined in MESA_remap_table_functions are excluded */
+static const struct gl_function_remap GL_ARB_draw_buffers_functions[] = {
+ { -1, -1 }
+};
+#endif
+
+#if defined(need_GL_ARB_draw_buffers_blend)
+/* functions defined in MESA_remap_table_functions are excluded */
+static const struct gl_function_remap GL_ARB_draw_buffers_blend_functions[] = {
+ { -1, -1 }
+};
+#endif
+
+#if defined(need_GL_ARB_draw_elements_base_vertex)
+/* functions defined in MESA_remap_table_functions are excluded */
+static const struct gl_function_remap GL_ARB_draw_elements_base_vertex_functions[] = {
+ { -1, -1 }
+};
+#endif
+
+#if defined(need_GL_ARB_draw_instanced)
+/* functions defined in MESA_remap_table_functions are excluded */
+static const struct gl_function_remap GL_ARB_draw_instanced_functions[] = {
+ { -1, -1 }
+};
+#endif
+
+#if defined(need_GL_ARB_framebuffer_object)
+/* functions defined in MESA_remap_table_functions are excluded */
+static const struct gl_function_remap GL_ARB_framebuffer_object_functions[] = {
+ { -1, -1 }
+};
+#endif
+
+#if defined(need_GL_ARB_geometry_shader4)
+/* functions defined in MESA_remap_table_functions are excluded */
+static const struct gl_function_remap GL_ARB_geometry_shader4_functions[] = {
+ { 12834, -1 }, /* FramebufferTextureLayer */
+ { -1, -1 }
+};
+#endif
+
+#if defined(need_GL_ARB_instanced_arrays)
+/* functions defined in MESA_remap_table_functions are excluded */
+static const struct gl_function_remap GL_ARB_instanced_arrays_functions[] = {
+ { -1, -1 }
+};
+#endif
+
+#if defined(need_GL_ARB_map_buffer_range)
+/* functions defined in MESA_remap_table_functions are excluded */
+static const struct gl_function_remap GL_ARB_map_buffer_range_functions[] = {
+ { -1, -1 }
+};
+#endif
+
+#if defined(need_GL_ARB_matrix_palette)
+static const struct gl_function_remap GL_ARB_matrix_palette_functions[] = {
+ { 3927, -1 }, /* MatrixIndexusvARB */
+ { 13583, -1 }, /* MatrixIndexuivARB */
+ { 14948, -1 }, /* MatrixIndexPointerARB */
+ { 20509, -1 }, /* CurrentPaletteMatrixARB */
+ { 23668, -1 }, /* MatrixIndexubvARB */
+ { -1, -1 }
+};
+#endif
+
+#if defined(need_GL_ARB_multisample)
+/* functions defined in MESA_remap_table_functions are excluded */
+static const struct gl_function_remap GL_ARB_multisample_functions[] = {
+ { -1, -1 }
+};
+#endif
+
+#if defined(need_GL_ARB_occlusion_query)
+/* functions defined in MESA_remap_table_functions are excluded */
+static const struct gl_function_remap GL_ARB_occlusion_query_functions[] = {
+ { -1, -1 }
+};
+#endif
+
+#if defined(need_GL_ARB_point_parameters)
+/* functions defined in MESA_remap_table_functions are excluded */
+static const struct gl_function_remap GL_ARB_point_parameters_functions[] = {
+ { -1, -1 }
+};
+#endif
+
+#if defined(need_GL_ARB_provoking_vertex)
+/* functions defined in MESA_remap_table_functions are excluded */
+static const struct gl_function_remap GL_ARB_provoking_vertex_functions[] = {
+ { -1, -1 }
+};
+#endif
+
+#if defined(need_GL_ARB_robustness)
+/* functions defined in MESA_remap_table_functions are excluded */
+static const struct gl_function_remap GL_ARB_robustness_functions[] = {
+ { -1, -1 }
+};
+#endif
+
+#if defined(need_GL_ARB_sampler_objects)
+/* functions defined in MESA_remap_table_functions are excluded */
+static const struct gl_function_remap GL_ARB_sampler_objects_functions[] = {
+ { -1, -1 }
+};
+#endif
+
+#if defined(need_GL_ARB_shader_objects)
+/* functions defined in MESA_remap_table_functions are excluded */
+static const struct gl_function_remap GL_ARB_shader_objects_functions[] = {
+ { -1, -1 }
+};
+#endif
+
+#if defined(need_GL_ARB_sync)
+/* functions defined in MESA_remap_table_functions are excluded */
+static const struct gl_function_remap GL_ARB_sync_functions[] = {
+ { -1, -1 }
+};
+#endif
+
+#if defined(need_GL_ARB_texture_buffer_object)
+/* functions defined in MESA_remap_table_functions are excluded */
+static const struct gl_function_remap GL_ARB_texture_buffer_object_functions[] = {
+ { -1, -1 }
+};
+#endif
+
+#if defined(need_GL_ARB_texture_compression)
+/* functions defined in MESA_remap_table_functions are excluded */
+static const struct gl_function_remap GL_ARB_texture_compression_functions[] = {
+ { -1, -1 }
+};
+#endif
+
+#if defined(need_GL_ARB_transform_feedback2)
+/* functions defined in MESA_remap_table_functions are excluded */
+static const struct gl_function_remap GL_ARB_transform_feedback2_functions[] = {
+ { -1, -1 }
+};
+#endif
+
+#if defined(need_GL_ARB_transpose_matrix)
+/* functions defined in MESA_remap_table_functions are excluded */
+static const struct gl_function_remap GL_ARB_transpose_matrix_functions[] = {
+ { -1, -1 }
+};
+#endif
+
+#if defined(need_GL_ARB_vertex_array_object)
+/* functions defined in MESA_remap_table_functions are excluded */
+static const struct gl_function_remap GL_ARB_vertex_array_object_functions[] = {
+ { -1, -1 }
+};
+#endif
+
+#if defined(need_GL_ARB_vertex_blend)
+static const struct gl_function_remap GL_ARB_vertex_blend_functions[] = {
+ { 2508, -1 }, /* WeightubvARB */
+ { 6917, -1 }, /* WeightivARB */
+ { 11484, -1 }, /* WeightPointerARB */
+ { 14318, -1 }, /* WeightfvARB */
+ { 18120, -1 }, /* WeightbvARB */
+ { 21739, -1 }, /* WeightusvARB */
+ { 24786, -1 }, /* VertexBlendARB */
+ { 30595, -1 }, /* WeightsvARB */
+ { 32661, -1 }, /* WeightdvARB */
+ { 33471, -1 }, /* WeightuivARB */
+ { -1, -1 }
+};
+#endif
+
+#if defined(need_GL_ARB_vertex_buffer_object)
+/* functions defined in MESA_remap_table_functions are excluded */
+static const struct gl_function_remap GL_ARB_vertex_buffer_object_functions[] = {
+ { -1, -1 }
+};
+#endif
+
+#if defined(need_GL_ARB_vertex_program)
+/* functions defined in MESA_remap_table_functions are excluded */
+static const struct gl_function_remap GL_ARB_vertex_program_functions[] = {
+ { -1, -1 }
+};
+#endif
+
+#if defined(need_GL_ARB_vertex_shader)
+/* functions defined in MESA_remap_table_functions are excluded */
+static const struct gl_function_remap GL_ARB_vertex_shader_functions[] = {
+ { -1, -1 }
+};
+#endif
+
+#if defined(need_GL_ARB_window_pos)
+/* functions defined in MESA_remap_table_functions are excluded */
+static const struct gl_function_remap GL_ARB_window_pos_functions[] = {
+ { -1, -1 }
+};
+#endif
+
+#if defined(need_GL_ATI_blend_equation_separate)
+/* functions defined in MESA_remap_table_functions are excluded */
+static const struct gl_function_remap GL_ATI_blend_equation_separate_functions[] = {
+ { -1, -1 }
+};
+#endif
+
+#if defined(need_GL_ATI_draw_buffers)
+/* functions defined in MESA_remap_table_functions are excluded */
+static const struct gl_function_remap GL_ATI_draw_buffers_functions[] = {
+ { -1, -1 }
+};
+#endif
+
+#if defined(need_GL_ATI_envmap_bumpmap)
+/* functions defined in MESA_remap_table_functions are excluded */
+static const struct gl_function_remap GL_ATI_envmap_bumpmap_functions[] = {
+ { -1, -1 }
+};
+#endif
+
+#if defined(need_GL_ATI_fragment_shader)
+/* functions defined in MESA_remap_table_functions are excluded */
+static const struct gl_function_remap GL_ATI_fragment_shader_functions[] = {
+ { -1, -1 }
+};
+#endif
+
+#if defined(need_GL_ATI_separate_stencil)
+/* functions defined in MESA_remap_table_functions are excluded */
+static const struct gl_function_remap GL_ATI_separate_stencil_functions[] = {
+ { -1, -1 }
+};
+#endif
+
+#if defined(need_GL_EXT_blend_color)
+static const struct gl_function_remap GL_EXT_blend_color_functions[] = {
+ { 2767, _gloffset_BlendColor },
+ { -1, -1 }
+};
+#endif
+
+#if defined(need_GL_EXT_blend_equation_separate)
+/* functions defined in MESA_remap_table_functions are excluded */
+static const struct gl_function_remap GL_EXT_blend_equation_separate_functions[] = {
+ { -1, -1 }
+};
+#endif
+
+#if defined(need_GL_EXT_blend_func_separate)
+/* functions defined in MESA_remap_table_functions are excluded */
+static const struct gl_function_remap GL_EXT_blend_func_separate_functions[] = {
+ { -1, -1 }
+};
+#endif
+
+#if defined(need_GL_EXT_blend_minmax)
+static const struct gl_function_remap GL_EXT_blend_minmax_functions[] = {
+ { 11619, _gloffset_BlendEquation },
+ { -1, -1 }
+};
+#endif
+
+#if defined(need_GL_EXT_color_subtable)
+static const struct gl_function_remap GL_EXT_color_subtable_functions[] = {
+ { 17520, _gloffset_ColorSubTable },
+ { 32611, _gloffset_CopyColorSubTable },
+ { -1, -1 }
+};
+#endif
+
+#if defined(need_GL_EXT_compiled_vertex_array)
+/* functions defined in MESA_remap_table_functions are excluded */
+static const struct gl_function_remap GL_EXT_compiled_vertex_array_functions[] = {
+ { -1, -1 }
+};
+#endif
+
+#if defined(need_GL_EXT_convolution)
+static const struct gl_function_remap GL_EXT_convolution_functions[] = {
+ { 296, _gloffset_ConvolutionFilter1D },
+ { 2566, _gloffset_CopyConvolutionFilter1D },
+ { 4293, _gloffset_GetConvolutionParameteriv },
+ { 8866, _gloffset_ConvolutionFilter2D },
+ { 9068, _gloffset_ConvolutionParameteriv },
+ { 9528, _gloffset_ConvolutionParameterfv },
+ { 21275, _gloffset_GetSeparableFilter },
+ { 24860, _gloffset_SeparableFilter2D },
+ { 25723, _gloffset_ConvolutionParameteri },
+ { 25891, _gloffset_ConvolutionParameterf },
+ { 27605, _gloffset_GetConvolutionParameterfv },
+ { 28494, _gloffset_GetConvolutionFilter },
+ { 31009, _gloffset_CopyConvolutionFilter2D },
+ { -1, -1 }
+};
+#endif
+
+#if defined(need_GL_EXT_coordinate_frame)
+static const struct gl_function_remap GL_EXT_coordinate_frame_functions[] = {
+ { 10918, -1 }, /* TangentPointerEXT */
+ { 12989, -1 }, /* Binormal3ivEXT */
+ { 13715, -1 }, /* Tangent3sEXT */
+ { 15013, -1 }, /* Tangent3fvEXT */
+ { 19188, -1 }, /* Tangent3ivEXT */
+ { 19415, -1 }, /* Tangent3dvEXT */
+ { 20189, -1 }, /* Binormal3bvEXT */
+ { 21328, -1 }, /* Binormal3dEXT */
+ { 23600, -1 }, /* Tangent3fEXT */
+ { 25795, -1 }, /* Binormal3sEXT */
+ { 26337, -1 }, /* Tangent3dEXT */
+ { 27284, -1 }, /* Binormal3svEXT */
+ { 27917, -1 }, /* Binormal3fEXT */
+ { 28825, -1 }, /* Binormal3dvEXT */
+ { 30144, -1 }, /* Tangent3iEXT */
+ { 31294, -1 }, /* Tangent3bvEXT */
+ { 31859, -1 }, /* Tangent3bEXT */
+ { 32384, -1 }, /* Binormal3fvEXT */
+ { 33170, -1 }, /* BinormalPointerEXT */
+ { 33651, -1 }, /* Tangent3svEXT */
+ { 34088, -1 }, /* Binormal3bEXT */
+ { 34265, -1 }, /* Binormal3iEXT */
+ { -1, -1 }
+};
+#endif
+
+#if defined(need_GL_EXT_copy_texture)
+static const struct gl_function_remap GL_EXT_copy_texture_functions[] = {
+ { 15538, _gloffset_CopyTexSubImage3D },
+ { 17207, _gloffset_CopyTexImage2D },
+ { 25331, _gloffset_CopyTexImage1D },
+ { 28175, _gloffset_CopyTexSubImage2D },
+ { 30647, _gloffset_CopyTexSubImage1D },
+ { -1, -1 }
+};
+#endif
+
+#if defined(need_GL_EXT_cull_vertex)
+static const struct gl_function_remap GL_EXT_cull_vertex_functions[] = {
+ { 9217, -1 }, /* CullParameterdvEXT */
+ { 12107, -1 }, /* CullParameterfvEXT */
+ { -1, -1 }
+};
+#endif
+
+#if defined(need_GL_EXT_depth_bounds_test)
+/* functions defined in MESA_remap_table_functions are excluded */
+static const struct gl_function_remap GL_EXT_depth_bounds_test_functions[] = {
+ { -1, -1 }
+};
+#endif
+
+#if defined(need_GL_EXT_draw_buffers2)
+/* functions defined in MESA_remap_table_functions are excluded */
+static const struct gl_function_remap GL_EXT_draw_buffers2_functions[] = {
+ { -1, -1 }
+};
+#endif
+
+#if defined(need_GL_EXT_draw_instanced)
+/* functions defined in MESA_remap_table_functions are excluded */
+static const struct gl_function_remap GL_EXT_draw_instanced_functions[] = {
+ { -1, -1 }
+};
+#endif
+
+#if defined(need_GL_EXT_draw_range_elements)
+static const struct gl_function_remap GL_EXT_draw_range_elements_functions[] = {
+ { 9865, _gloffset_DrawRangeElements },
+ { -1, -1 }
+};
+#endif
+
+#if defined(need_GL_EXT_fog_coord)
+/* functions defined in MESA_remap_table_functions are excluded */
+static const struct gl_function_remap GL_EXT_fog_coord_functions[] = {
+ { -1, -1 }
+};
+#endif
+
+#if defined(need_GL_EXT_framebuffer_blit)
+/* functions defined in MESA_remap_table_functions are excluded */
+static const struct gl_function_remap GL_EXT_framebuffer_blit_functions[] = {
+ { -1, -1 }
+};
+#endif
+
+#if defined(need_GL_EXT_framebuffer_multisample)
+/* functions defined in MESA_remap_table_functions are excluded */
+static const struct gl_function_remap GL_EXT_framebuffer_multisample_functions[] = {
+ { -1, -1 }
+};
+#endif
+
+#if defined(need_GL_EXT_framebuffer_object)
+/* functions defined in MESA_remap_table_functions are excluded */
+static const struct gl_function_remap GL_EXT_framebuffer_object_functions[] = {
+ { -1, -1 }
+};
+#endif
+
+#if defined(need_GL_EXT_gpu_program_parameters)
+/* functions defined in MESA_remap_table_functions are excluded */
+static const struct gl_function_remap GL_EXT_gpu_program_parameters_functions[] = {
+ { -1, -1 }
+};
+#endif
+
+#if defined(need_GL_EXT_gpu_shader4)
+/* functions defined in MESA_remap_table_functions are excluded */
+static const struct gl_function_remap GL_EXT_gpu_shader4_functions[] = {
+ { -1, -1 }
+};
+#endif
+
+#if defined(need_GL_EXT_histogram)
+static const struct gl_function_remap GL_EXT_histogram_functions[] = {
+ { 895, _gloffset_Histogram },
+ { 3676, _gloffset_ResetHistogram },
+ { 10370, _gloffset_GetMinmax },
+ { 15872, _gloffset_GetHistogramParameterfv },
+ { 25256, _gloffset_GetMinmaxParameteriv },
+ { 27495, _gloffset_ResetMinmax },
+ { 28391, _gloffset_GetHistogramParameteriv },
+ { 29612, _gloffset_GetHistogram },
+ { 32236, _gloffset_Minmax },
+ { 33886, _gloffset_GetMinmaxParameterfv },
+ { -1, -1 }
+};
+#endif
+
+#if defined(need_GL_EXT_index_func)
+static const struct gl_function_remap GL_EXT_index_func_functions[] = {
+ { 11893, -1 }, /* IndexFuncEXT */
+ { -1, -1 }
+};
+#endif
+
+#if defined(need_GL_EXT_index_material)
+static const struct gl_function_remap GL_EXT_index_material_functions[] = {
+ { 21861, -1 }, /* IndexMaterialEXT */
+ { -1, -1 }
+};
+#endif
+
+#if defined(need_GL_EXT_light_texture)
+static const struct gl_function_remap GL_EXT_light_texture_functions[] = {
+ { 27304, -1 }, /* ApplyTextureEXT */
+ { 27449, -1 }, /* TextureMaterialEXT */
+ { 27474, -1 }, /* TextureLightEXT */
+ { -1, -1 }
+};
+#endif
+
+#if defined(need_GL_EXT_multi_draw_arrays)
+/* functions defined in MESA_remap_table_functions are excluded */
+static const struct gl_function_remap GL_EXT_multi_draw_arrays_functions[] = {
+ { -1, -1 }
+};
+#endif
+
+#if defined(need_GL_EXT_multisample)
+/* functions defined in MESA_remap_table_functions are excluded */
+static const struct gl_function_remap GL_EXT_multisample_functions[] = {
+ { -1, -1 }
+};
+#endif
+
+#if defined(need_GL_EXT_paletted_texture)
+static const struct gl_function_remap GL_EXT_paletted_texture_functions[] = {
+ { 8728, _gloffset_ColorTable },
+ { 15718, _gloffset_GetColorTable },
+ { 23783, _gloffset_GetColorTableParameterfv },
+ { 25947, _gloffset_GetColorTableParameteriv },
+ { -1, -1 }
+};
+#endif
+
+#if defined(need_GL_EXT_pixel_transform)
+static const struct gl_function_remap GL_EXT_pixel_transform_functions[] = {
+ { 22508, -1 }, /* PixelTransformParameterfEXT */
+ { 22588, -1 }, /* PixelTransformParameteriEXT */
+ { 31574, -1 }, /* PixelTransformParameterfvEXT */
+ { 33134, -1 }, /* PixelTransformParameterivEXT */
+ { -1, -1 }
+};
+#endif
+
+#if defined(need_GL_EXT_point_parameters)
+/* functions defined in MESA_remap_table_functions are excluded */
+static const struct gl_function_remap GL_EXT_point_parameters_functions[] = {
+ { -1, -1 }
+};
+#endif
+
+#if defined(need_GL_EXT_polygon_offset)
+/* functions defined in MESA_remap_table_functions are excluded */
+static const struct gl_function_remap GL_EXT_polygon_offset_functions[] = {
+ { -1, -1 }
+};
+#endif
+
+#if defined(need_GL_EXT_provoking_vertex)
+/* functions defined in MESA_remap_table_functions are excluded */
+static const struct gl_function_remap GL_EXT_provoking_vertex_functions[] = {
+ { -1, -1 }
+};
+#endif
+
+#if defined(need_GL_EXT_secondary_color)
+/* functions defined in MESA_remap_table_functions are excluded */
+static const struct gl_function_remap GL_EXT_secondary_color_functions[] = {
+ { -1, -1 }
+};
+#endif
+
+#if defined(need_GL_EXT_separate_shader_objects)
+/* functions defined in MESA_remap_table_functions are excluded */
+static const struct gl_function_remap GL_EXT_separate_shader_objects_functions[] = {
+ { -1, -1 }
+};
+#endif
+
+#if defined(need_GL_EXT_stencil_two_side)
+/* functions defined in MESA_remap_table_functions are excluded */
+static const struct gl_function_remap GL_EXT_stencil_two_side_functions[] = {
+ { -1, -1 }
+};
+#endif
+
+#if defined(need_GL_EXT_subtexture)
+static const struct gl_function_remap GL_EXT_subtexture_functions[] = {
+ { 7439, _gloffset_TexSubImage1D },
+ { 11074, _gloffset_TexSubImage2D },
+ { -1, -1 }
+};
+#endif
+
+#if defined(need_GL_EXT_texture3D)
+static const struct gl_function_remap GL_EXT_texture3D_functions[] = {
+ { 1865, _gloffset_TexImage3D },
+ { 23552, _gloffset_TexSubImage3D },
+ { -1, -1 }
+};
+#endif
+
+#if defined(need_GL_EXT_texture_array)
+/* functions defined in MESA_remap_table_functions are excluded */
+static const struct gl_function_remap GL_EXT_texture_array_functions[] = {
+ { -1, -1 }
+};
+#endif
+
+#if defined(need_GL_EXT_texture_integer)
+/* functions defined in MESA_remap_table_functions are excluded */
+static const struct gl_function_remap GL_EXT_texture_integer_functions[] = {
+ { -1, -1 }
+};
+#endif
+
+#if defined(need_GL_EXT_texture_object)
+static const struct gl_function_remap GL_EXT_texture_object_functions[] = {
+ { 3444, _gloffset_PrioritizeTextures },
+ { 7888, _gloffset_AreTexturesResident },
+ { 14058, _gloffset_GenTextures },
+ { 16231, _gloffset_DeleteTextures },
+ { 20242, _gloffset_IsTexture },
+ { 30712, _gloffset_BindTexture },
+ { -1, -1 }
+};
+#endif
+
+#if defined(need_GL_EXT_texture_perturb_normal)
+static const struct gl_function_remap GL_EXT_texture_perturb_normal_functions[] = {
+ { 14268, -1 }, /* TextureNormalEXT */
+ { -1, -1 }
+};
+#endif
+
+#if defined(need_GL_EXT_timer_query)
+/* functions defined in MESA_remap_table_functions are excluded */
+static const struct gl_function_remap GL_EXT_timer_query_functions[] = {
+ { -1, -1 }
+};
+#endif
+
+#if defined(need_GL_EXT_transform_feedback)
+/* functions defined in MESA_remap_table_functions are excluded */
+static const struct gl_function_remap GL_EXT_transform_feedback_functions[] = {
+ { -1, -1 }
+};
+#endif
+
+#if defined(need_GL_EXT_vertex_array)
+/* functions defined in MESA_remap_table_functions are excluded */
+static const struct gl_function_remap GL_EXT_vertex_array_functions[] = {
+ { 25032, _gloffset_ArrayElement },
+ { 31824, _gloffset_GetPointerv },
+ { 33437, _gloffset_DrawArrays },
+ { -1, -1 }
+};
+#endif
+
+#if defined(need_GL_EXT_vertex_weighting)
+static const struct gl_function_remap GL_EXT_vertex_weighting_functions[] = {
+ { 20290, -1 }, /* VertexWeightfvEXT */
+ { 27860, -1 }, /* VertexWeightfEXT */
+ { 29581, -1 }, /* VertexWeightPointerEXT */
+ { -1, -1 }
+};
+#endif
+
+#if defined(need_GL_HP_image_transform)
+static const struct gl_function_remap GL_HP_image_transform_functions[] = {
+ { 2439, -1 }, /* GetImageTransformParameterfvHP */
+ { 3893, -1 }, /* ImageTransformParameterfHP */
+ { 10612, -1 }, /* ImageTransformParameterfvHP */
+ { 12354, -1 }, /* ImageTransformParameteriHP */
+ { 12724, -1 }, /* GetImageTransformParameterivHP */
+ { 20354, -1 }, /* ImageTransformParameterivHP */
+ { -1, -1 }
+};
+#endif
+
+#if defined(need_GL_IBM_multimode_draw_arrays)
+/* functions defined in MESA_remap_table_functions are excluded */
+static const struct gl_function_remap GL_IBM_multimode_draw_arrays_functions[] = {
+ { -1, -1 }
+};
+#endif
+
+#if defined(need_GL_IBM_vertex_array_lists)
+static const struct gl_function_remap GL_IBM_vertex_array_lists_functions[] = {
+ { 4583, -1 }, /* SecondaryColorPointerListIBM */
+ { 6371, -1 }, /* NormalPointerListIBM */
+ { 8062, -1 }, /* FogCoordPointerListIBM */
+ { 8403, -1 }, /* VertexPointerListIBM */
+ { 12608, -1 }, /* ColorPointerListIBM */
+ { 13822, -1 }, /* TexCoordPointerListIBM */
+ { 14290, -1 }, /* IndexPointerListIBM */
+ { 33829, -1 }, /* EdgeFlagPointerListIBM */
+ { -1, -1 }
+};
+#endif
+
+#if defined(need_GL_INGR_blend_func_separate)
+/* functions defined in MESA_remap_table_functions are excluded */
+static const struct gl_function_remap GL_INGR_blend_func_separate_functions[] = {
+ { -1, -1 }
+};
+#endif
+
+#if defined(need_GL_INTEL_parallel_arrays)
+static const struct gl_function_remap GL_INTEL_parallel_arrays_functions[] = {
+ { 13162, -1 }, /* VertexPointervINTEL */
+ { 15965, -1 }, /* ColorPointervINTEL */
+ { 30983, -1 }, /* NormalPointervINTEL */
+ { 31506, -1 }, /* TexCoordPointervINTEL */
+ { -1, -1 }
+};
+#endif
+
+#if defined(need_GL_MESA_resize_buffers)
+/* functions defined in MESA_remap_table_functions are excluded */
+static const struct gl_function_remap GL_MESA_resize_buffers_functions[] = {
+ { -1, -1 }
+};
+#endif
+
+#if defined(need_GL_MESA_shader_debug)
+static const struct gl_function_remap GL_MESA_shader_debug_functions[] = {
+ { 1729, -1 }, /* GetDebugLogLengthMESA */
+ { 3615, -1 }, /* ClearDebugLogMESA */
+ { 4768, -1 }, /* GetDebugLogMESA */
+ { 32017, -1 }, /* CreateDebugObjectMESA */
+ { -1, -1 }
+};
+#endif
+
+#if defined(need_GL_MESA_window_pos)
+/* functions defined in MESA_remap_table_functions are excluded */
+static const struct gl_function_remap GL_MESA_window_pos_functions[] = {
+ { -1, -1 }
+};
+#endif
+
+#if defined(need_GL_NV_condtitional_render)
+/* functions defined in MESA_remap_table_functions are excluded */
+static const struct gl_function_remap GL_NV_condtitional_render_functions[] = {
+ { -1, -1 }
+};
+#endif
+
+#if defined(need_GL_NV_evaluators)
+static const struct gl_function_remap GL_NV_evaluators_functions[] = {
+ { 7101, -1 }, /* GetMapAttribParameterivNV */
+ { 8834, -1 }, /* MapControlPointsNV */
+ { 8933, -1 }, /* MapParameterfvNV */
+ { 11057, -1 }, /* EvalMapsNV */
+ { 17718, -1 }, /* GetMapAttribParameterfvNV */
+ { 17935, -1 }, /* MapParameterivNV */
+ { 25646, -1 }, /* GetMapParameterivNV */
+ { 26189, -1 }, /* GetMapParameterfvNV */
+ { 30298, -1 }, /* GetMapControlPointsNV */
+ { -1, -1 }
+};
+#endif
+
+#if defined(need_GL_NV_fence)
+/* functions defined in MESA_remap_table_functions are excluded */
+static const struct gl_function_remap GL_NV_fence_functions[] = {
+ { -1, -1 }
+};
+#endif
+
+#if defined(need_GL_NV_fragment_program)
+/* functions defined in MESA_remap_table_functions are excluded */
+static const struct gl_function_remap GL_NV_fragment_program_functions[] = {
+ { -1, -1 }
+};
+#endif
+
+#if defined(need_GL_NV_point_sprite)
+/* functions defined in MESA_remap_table_functions are excluded */
+static const struct gl_function_remap GL_NV_point_sprite_functions[] = {
+ { -1, -1 }
+};
+#endif
+
+#if defined(need_GL_NV_primitive_restart)
+/* functions defined in MESA_remap_table_functions are excluded */
+static const struct gl_function_remap GL_NV_primitive_restart_functions[] = {
+ { -1, -1 }
+};
+#endif
+
+#if defined(need_GL_NV_register_combiners)
+/* functions defined in MESA_remap_table_functions are excluded */
+static const struct gl_function_remap GL_NV_register_combiners_functions[] = {
+ { -1, -1 }
+};
+#endif
+
+#if defined(need_GL_NV_register_combiners2)
+static const struct gl_function_remap GL_NV_register_combiners2_functions[] = {
+ { 16384, -1 }, /* CombinerStageParameterfvNV */
+ { 16780, -1 }, /* GetCombinerStageParameterfvNV */
+ { -1, -1 }
+};
+#endif
+
+#if defined(need_GL_NV_texture_barrier)
+/* functions defined in MESA_remap_table_functions are excluded */
+static const struct gl_function_remap GL_NV_texture_barrier_functions[] = {
+ { -1, -1 }
+};
+#endif
+
+#if defined(need_GL_NV_vertex_array_range)
+/* functions defined in MESA_remap_table_functions are excluded */
+static const struct gl_function_remap GL_NV_vertex_array_range_functions[] = {
+ { -1, -1 }
+};
+#endif
+
+#if defined(need_GL_NV_vertex_program)
+/* functions defined in MESA_remap_table_functions are excluded */
+static const struct gl_function_remap GL_NV_vertex_program_functions[] = {
+ { -1, -1 }
+};
+#endif
+
+#if defined(need_GL_OES_EGL_image)
+/* functions defined in MESA_remap_table_functions are excluded */
+static const struct gl_function_remap GL_OES_EGL_image_functions[] = {
+ { -1, -1 }
+};
+#endif
+
+#if defined(need_GL_PGI_misc_hints)
+static const struct gl_function_remap GL_PGI_misc_hints_functions[] = {
+ { 9054, -1 }, /* HintPGI */
+ { -1, -1 }
+};
+#endif
+
+#if defined(need_GL_SGIS_detail_texture)
+static const struct gl_function_remap GL_SGIS_detail_texture_functions[] = {
+ { 16753, -1 }, /* GetDetailTexFuncSGIS */
+ { 17152, -1 }, /* DetailTexFuncSGIS */
+ { -1, -1 }
+};
+#endif
+
+#if defined(need_GL_SGIS_fog_function)
+static const struct gl_function_remap GL_SGIS_fog_function_functions[] = {
+ { 28157, -1 }, /* FogFuncSGIS */
+ { 28930, -1 }, /* GetFogFuncSGIS */
+ { -1, -1 }
+};
+#endif
+
+#if defined(need_GL_SGIS_multisample)
+/* functions defined in MESA_remap_table_functions are excluded */
+static const struct gl_function_remap GL_SGIS_multisample_functions[] = {
+ { -1, -1 }
+};
+#endif
+
+#if defined(need_GL_SGIS_pixel_texture)
+/* functions defined in MESA_remap_table_functions are excluded */
+static const struct gl_function_remap GL_SGIS_pixel_texture_functions[] = {
+ { -1, -1 }
+};
+#endif
+
+#if defined(need_GL_SGIS_point_parameters)
+/* functions defined in MESA_remap_table_functions are excluded */
+static const struct gl_function_remap GL_SGIS_point_parameters_functions[] = {
+ { -1, -1 }
+};
+#endif
+
+#if defined(need_GL_SGIS_sharpen_texture)
+static const struct gl_function_remap GL_SGIS_sharpen_texture_functions[] = {
+ { 7162, -1 }, /* GetSharpenTexFuncSGIS */
+ { 22894, -1 }, /* SharpenTexFuncSGIS */
+ { -1, -1 }
+};
+#endif
+
+#if defined(need_GL_SGIS_texture4D)
+static const struct gl_function_remap GL_SGIS_texture4D_functions[] = {
+ { 1034, -1 }, /* TexImage4DSGIS */
+ { 16300, -1 }, /* TexSubImage4DSGIS */
+ { -1, -1 }
+};
+#endif
+
+#if defined(need_GL_SGIS_texture_color_mask)
+static const struct gl_function_remap GL_SGIS_texture_color_mask_functions[] = {
+ { 15671, -1 }, /* TextureColorMaskSGIS */
+ { -1, -1 }
+};
+#endif
+
+#if defined(need_GL_SGIS_texture_filter4)
+static const struct gl_function_remap GL_SGIS_texture_filter4_functions[] = {
+ { 7339, -1 }, /* GetTexFilterFuncSGIS */
+ { 16926, -1 }, /* TexFilterFuncSGIS */
+ { -1, -1 }
+};
+#endif
+
+#if defined(need_GL_SGIX_async)
+static const struct gl_function_remap GL_SGIX_async_functions[] = {
+ { 3541, -1 }, /* AsyncMarkerSGIX */
+ { 4722, -1 }, /* FinishAsyncSGIX */
+ { 5794, -1 }, /* PollAsyncSGIX */
+ { 23103, -1 }, /* DeleteAsyncMarkersSGIX */
+ { 23158, -1 }, /* IsAsyncMarkerSGIX */
+ { 33626, -1 }, /* GenAsyncMarkersSGIX */
+ { -1, -1 }
+};
+#endif
+
+#if defined(need_GL_SGIX_flush_raster)
+static const struct gl_function_remap GL_SGIX_flush_raster_functions[] = {
+ { 7716, -1 }, /* FlushRasterSGIX */
+ { -1, -1 }
+};
+#endif
+
+#if defined(need_GL_SGIX_fragment_lighting)
+static const struct gl_function_remap GL_SGIX_fragment_lighting_functions[] = {
+ { 2737, -1 }, /* FragmentMaterialfvSGIX */
+ { 5698, -1 }, /* FragmentLightiSGIX */
+ { 8470, -1 }, /* FragmentMaterialfSGIX */
+ { 8607, -1 }, /* GetFragmentLightivSGIX */
+ { 9480, -1 }, /* FragmentLightModeliSGIX */
+ { 11120, -1 }, /* FragmentLightivSGIX */
+ { 11427, -1 }, /* GetFragmentMaterialivSGIX */
+ { 16693, -1 }, /* GetFragmentMaterialfvSGIX */
+ { 20159, -1 }, /* FragmentLightModelfSGIX */
+ { 20477, -1 }, /* FragmentColorMaterialSGIX */
+ { 20894, -1 }, /* FragmentMaterialiSGIX */
+ { 22189, -1 }, /* LightEnviSGIX */
+ { 23875, -1 }, /* FragmentLightModelfvSGIX */
+ { 24210, -1 }, /* FragmentLightfvSGIX */
+ { 29314, -1 }, /* FragmentLightModelivSGIX */
+ { 29463, -1 }, /* FragmentLightfSGIX */
+ { 32354, -1 }, /* GetFragmentLightfvSGIX */
+ { 34109, -1 }, /* FragmentMaterialivSGIX */
+ { -1, -1 }
+};
+#endif
+
+#if defined(need_GL_SGIX_framezoom)
+static const struct gl_function_remap GL_SGIX_framezoom_functions[] = {
+ { 23181, -1 }, /* FrameZoomSGIX */
+ { -1, -1 }
+};
+#endif
+
+#if defined(need_GL_SGIX_igloo_interface)
+static const struct gl_function_remap GL_SGIX_igloo_interface_functions[] = {
+ { 29771, -1 }, /* IglooInterfaceSGIX */
+ { -1, -1 }
+};
+#endif
+
+#if defined(need_GL_SGIX_instruments)
+static const struct gl_function_remap GL_SGIX_instruments_functions[] = {
+ { 2917, -1 }, /* ReadInstrumentsSGIX */
+ { 6935, -1 }, /* PollInstrumentsSGIX */
+ { 10978, -1 }, /* GetInstrumentsSGIX */
+ { 13420, -1 }, /* StartInstrumentsSGIX */
+ { 16418, -1 }, /* StopInstrumentsSGIX */
+ { 18383, -1 }, /* InstrumentsBufferSGIX */
+ { -1, -1 }
+};
+#endif
+
+#if defined(need_GL_SGIX_list_priority)
+static const struct gl_function_remap GL_SGIX_list_priority_functions[] = {
+ { 1265, -1 }, /* ListParameterfSGIX */
+ { 3243, -1 }, /* GetListParameterfvSGIX */
+ { 18248, -1 }, /* ListParameteriSGIX */
+ { 19365, -1 }, /* ListParameterfvSGIX */
+ { 21560, -1 }, /* ListParameterivSGIX */
+ { 33670, -1 }, /* GetListParameterivSGIX */
+ { -1, -1 }
+};
+#endif
+
+#if defined(need_GL_SGIX_pixel_texture)
+/* functions defined in MESA_remap_table_functions are excluded */
+static const struct gl_function_remap GL_SGIX_pixel_texture_functions[] = {
+ { -1, -1 }
+};
+#endif
+
+#if defined(need_GL_SGIX_polynomial_ffd)
+static const struct gl_function_remap GL_SGIX_polynomial_ffd_functions[] = {
+ { 2959, -1 }, /* DeformationMap3dSGIX */
+ { 3839, -1 }, /* LoadIdentityDeformationMapSGIX */
+ { 16518, -1 }, /* DeformSGIX */
+ { 25144, -1 }, /* DeformationMap3fSGIX */
+ { -1, -1 }
+};
+#endif
+
+#if defined(need_GL_SGIX_reference_plane)
+static const struct gl_function_remap GL_SGIX_reference_plane_functions[] = {
+ { 15222, -1 }, /* ReferencePlaneSGIX */
+ { -1, -1 }
+};
+#endif
+
+#if defined(need_GL_SGIX_sprite)
+static const struct gl_function_remap GL_SGIX_sprite_functions[] = {
+ { 9978, -1 }, /* SpriteParameterfvSGIX */
+ { 21349, -1 }, /* SpriteParameteriSGIX */
+ { 27529, -1 }, /* SpriteParameterfSGIX */
+ { 30441, -1 }, /* SpriteParameterivSGIX */
+ { -1, -1 }
+};
+#endif
+
+#if defined(need_GL_SGIX_tag_sample_buffer)
+static const struct gl_function_remap GL_SGIX_tag_sample_buffer_functions[] = {
+ { 21408, -1 }, /* TagSampleBufferSGIX */
+ { -1, -1 }
+};
+#endif
+
+#if defined(need_GL_SGI_color_table)
+static const struct gl_function_remap GL_SGI_color_table_functions[] = {
+ { 8006, _gloffset_ColorTableParameteriv },
+ { 8728, _gloffset_ColorTable },
+ { 15718, _gloffset_GetColorTable },
+ { 15828, _gloffset_CopyColorTable },
+ { 20103, _gloffset_ColorTableParameterfv },
+ { 23783, _gloffset_GetColorTableParameterfv },
+ { 25947, _gloffset_GetColorTableParameteriv },
+ { -1, -1 }
+};
+#endif
+
+#if defined(need_GL_SUNX_constant_data)
+static const struct gl_function_remap GL_SUNX_constant_data_functions[] = {
+ { 32332, -1 }, /* FinishTextureSUNX */
+ { -1, -1 }
+};
+#endif
+
+#if defined(need_GL_SUN_global_alpha)
+static const struct gl_function_remap GL_SUN_global_alpha_functions[] = {
+ { 3562, -1 }, /* GlobalAlphaFactorubSUN */
+ { 5075, -1 }, /* GlobalAlphaFactoriSUN */
+ { 6960, -1 }, /* GlobalAlphaFactordSUN */
+ { 10062, -1 }, /* GlobalAlphaFactoruiSUN */
+ { 10569, -1 }, /* GlobalAlphaFactorbSUN */
+ { 13735, -1 }, /* GlobalAlphaFactorfSUN */
+ { 13899, -1 }, /* GlobalAlphaFactorusSUN */
+ { 23470, -1 }, /* GlobalAlphaFactorsSUN */
+ { -1, -1 }
+};
+#endif
+
+#if defined(need_GL_SUN_mesh_array)
+static const struct gl_function_remap GL_SUN_mesh_array_functions[] = {
+ { 30232, -1 }, /* DrawMeshArraysSUN */
+ { -1, -1 }
+};
+#endif
+
+#if defined(need_GL_SUN_triangle_list)
+static const struct gl_function_remap GL_SUN_triangle_list_functions[] = {
+ { 4696, -1 }, /* ReplacementCodeubSUN */
+ { 6719, -1 }, /* ReplacementCodeubvSUN */
+ { 19824, -1 }, /* ReplacementCodeusvSUN */
+ { 20012, -1 }, /* ReplacementCodePointerSUN */
+ { 22253, -1 }, /* ReplacementCodeuiSUN */
+ { 23132, -1 }, /* ReplacementCodeusSUN */
+ { 30898, -1 }, /* ReplacementCodeuivSUN */
+ { -1, -1 }
+};
+#endif
+
+#if defined(need_GL_SUN_vertex)
+static const struct gl_function_remap GL_SUN_vertex_functions[] = {
+ { 1139, -1 }, /* ReplacementCodeuiColor3fVertex3fvSUN */
+ { 1337, -1 }, /* TexCoord4fColor4fNormal3fVertex4fvSUN */
+ { 1591, -1 }, /* TexCoord2fColor4ubVertex3fvSUN */
+ { 1960, -1 }, /* ReplacementCodeuiVertex3fvSUN */
+ { 2094, -1 }, /* ReplacementCodeuiTexCoord2fVertex3fvSUN */
+ { 2673, -1 }, /* ReplacementCodeuiNormal3fVertex3fSUN */
+ { 3052, -1 }, /* Color4ubVertex3fvSUN */
+ { 4880, -1 }, /* Color4ubVertex3fSUN */
+ { 5003, -1 }, /* TexCoord2fVertex3fSUN */
+ { 5421, -1 }, /* TexCoord2fColor4fNormal3fVertex3fSUN */
+ { 5898, -1 }, /* TexCoord2fNormal3fVertex3fvSUN */
+ { 6614, -1 }, /* ReplacementCodeuiTexCoord2fNormal3fVertex3fSUN */
+ { 7394, -1 }, /* ReplacementCodeuiColor4ubVertex3fvSUN */
+ { 7753, -1 }, /* ReplacementCodeuiTexCoord2fVertex3fSUN */
+ { 9279, -1 }, /* Color3fVertex3fSUN */
+ { 10478, -1 }, /* Color3fVertex3fvSUN */
+ { 10943, -1 }, /* Color4fNormal3fVertex3fvSUN */
+ { 11772, -1 }, /* ReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN */
+ { 13283, -1 }, /* ReplacementCodeuiColor4fNormal3fVertex3fvSUN */
+ { 14838, -1 }, /* ReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN */
+ { 15364, -1 }, /* TexCoord2fColor3fVertex3fSUN */
+ { 16443, -1 }, /* TexCoord4fColor4fNormal3fVertex4fSUN */
+ { 16885, -1 }, /* Color4ubVertex2fvSUN */
+ { 17177, -1 }, /* Normal3fVertex3fSUN */
+ { 18324, -1 }, /* ReplacementCodeuiColor4fNormal3fVertex3fSUN */
+ { 18676, -1 }, /* TexCoord2fColor4fNormal3fVertex3fvSUN */
+ { 18983, -1 }, /* TexCoord2fNormal3fVertex3fSUN */
+ { 19617, -1 }, /* TexCoord2fVertex3fvSUN */
+ { 20447, -1 }, /* Color4ubVertex2fSUN */
+ { 20685, -1 }, /* ReplacementCodeuiColor4ubVertex3fSUN */
+ { 22719, -1 }, /* TexCoord2fColor4ubVertex3fSUN */
+ { 23200, -1 }, /* Normal3fVertex3fvSUN */
+ { 23692, -1 }, /* Color4fNormal3fVertex3fSUN */
+ { 24693, -1 }, /* ReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN */
+ { 26850, -1 }, /* ReplacementCodeuiColor3fVertex3fSUN */
+ { 28273, -1 }, /* TexCoord4fVertex4fSUN */
+ { 28719, -1 }, /* TexCoord2fColor3fVertex3fvSUN */
+ { 29158, -1 }, /* ReplacementCodeuiNormal3fVertex3fvSUN */
+ { 29285, -1 }, /* TexCoord4fVertex4fvSUN */
+ { 30019, -1 }, /* ReplacementCodeuiVertex3fSUN */
+ { -1, -1 }
+};
+#endif
+
+#if defined(need_GL_VERSION_1_3)
+/* functions defined in MESA_remap_table_functions are excluded */
+static const struct gl_function_remap GL_VERSION_1_3_functions[] = {
+ { 464, _gloffset_MultiTexCoord3sARB },
+ { 696, _gloffset_ActiveTextureARB },
+ { 4451, _gloffset_MultiTexCoord1fvARB },
+ { 6505, _gloffset_MultiTexCoord3dARB },
+ { 6550, _gloffset_MultiTexCoord2iARB },
+ { 6674, _gloffset_MultiTexCoord2svARB },
+ { 8684, _gloffset_MultiTexCoord2fARB },
+ { 10779, _gloffset_MultiTexCoord3fvARB },
+ { 11381, _gloffset_MultiTexCoord4sARB },
+ { 12062, _gloffset_MultiTexCoord2dvARB },
+ { 12469, _gloffset_MultiTexCoord1svARB },
+ { 12870, _gloffset_MultiTexCoord3svARB },
+ { 12931, _gloffset_MultiTexCoord4iARB },
+ { 13762, _gloffset_MultiTexCoord3iARB },
+ { 14561, _gloffset_MultiTexCoord1dARB },
+ { 14793, _gloffset_MultiTexCoord3dvARB },
+ { 16072, _gloffset_MultiTexCoord3ivARB },
+ { 16117, _gloffset_MultiTexCoord2sARB },
+ { 17577, _gloffset_MultiTexCoord4ivARB },
+ { 19743, _gloffset_ClientActiveTextureARB },
+ { 22106, _gloffset_MultiTexCoord2dARB },
+ { 22543, _gloffset_MultiTexCoord4dvARB },
+ { 22920, _gloffset_MultiTexCoord4fvARB },
+ { 23924, _gloffset_MultiTexCoord3fARB },
+ { 26541, _gloffset_MultiTexCoord4dARB },
+ { 26807, _gloffset_MultiTexCoord1sARB },
+ { 27011, _gloffset_MultiTexCoord1dvARB },
+ { 28019, _gloffset_MultiTexCoord1ivARB },
+ { 28112, _gloffset_MultiTexCoord2ivARB },
+ { 28451, _gloffset_MultiTexCoord1iARB },
+ { 29887, _gloffset_MultiTexCoord4svARB },
+ { 30511, _gloffset_MultiTexCoord1fARB },
+ { 30774, _gloffset_MultiTexCoord4fARB },
+ { 33271, _gloffset_MultiTexCoord2fvARB },
+ { -1, -1 }
+};
+#endif
+
+#if defined(need_GL_VERSION_1_4)
+/* functions defined in MESA_remap_table_functions are excluded */
+static const struct gl_function_remap GL_VERSION_1_4_functions[] = {
+ { -1, -1 }
+};
+#endif
+
+#if defined(need_GL_VERSION_1_5)
+/* functions defined in MESA_remap_table_functions are excluded */
+static const struct gl_function_remap GL_VERSION_1_5_functions[] = {
+ { -1, -1 }
+};
+#endif
+
+#if defined(need_GL_VERSION_2_0)
+/* functions defined in MESA_remap_table_functions are excluded */
+static const struct gl_function_remap GL_VERSION_2_0_functions[] = {
+ { -1, -1 }
+};
+#endif
+
+#if defined(need_GL_VERSION_2_1)
+/* functions defined in MESA_remap_table_functions are excluded */
+static const struct gl_function_remap GL_VERSION_2_1_functions[] = {
+ { -1, -1 }
+};
+#endif
+
+#if defined(need_GL_VERSION_3_0)
+/* functions defined in MESA_remap_table_functions are excluded */
+static const struct gl_function_remap GL_VERSION_3_0_functions[] = {
+ { -1, -1 }
+};
+#endif
+
+#if defined(need_GL_VERSION_3_1)
+/* functions defined in MESA_remap_table_functions are excluded */
+static const struct gl_function_remap GL_VERSION_3_1_functions[] = {
+ { -1, -1 }
+};
+#endif
+
+#if defined(need_GL_VERSION_3_2)
+/* functions defined in MESA_remap_table_functions are excluded */
+static const struct gl_function_remap GL_VERSION_3_2_functions[] = {
+ { -1, -1 }
+};
+#endif
+
+#if defined(need_GL_VERSION_3_3)
+/* functions defined in MESA_remap_table_functions are excluded */
+static const struct gl_function_remap GL_VERSION_3_3_functions[] = {
+ { -1, -1 }
+};
+#endif
+
diff --git a/mesalib/src/mesa/main/renderbuffer.c b/mesalib/src/mesa/main/renderbuffer.c
index fa884c0de..af3029499 100644
--- a/mesalib/src/mesa/main/renderbuffer.c
+++ b/mesalib/src/mesa/main/renderbuffer.c
@@ -1,2592 +1,2592 @@
-/*
- * Mesa 3-D graphics library
- * Version: 6.5
- *
- * Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-
-/**
- * Functions for allocating/managing renderbuffers.
- * Also, routines for reading/writing software-based renderbuffer data as
- * ubytes, ushorts, uints, etc.
- *
- * The 'alpha8' renderbuffer is interesting. It's used to add a software-based
- * alpha channel to RGB renderbuffers. This is done by wrapping the RGB
- * renderbuffer with the alpha renderbuffer. We can do this because of the
- * OO-nature of renderbuffers.
- *
- * Down the road we'll use this for run-time support of 8, 16 and 32-bit
- * color channels. For example, Mesa may use 32-bit/float color channels
- * internally (swrast) and use wrapper renderbuffers to convert 32-bit
- * values down to 16 or 8-bit values for whatever kind of framebuffer we have.
- */
-
-
-#include "glheader.h"
-#include "imports.h"
-#include "context.h"
-#include "fbobject.h"
-#include "formats.h"
-#include "mtypes.h"
-#include "renderbuffer.h"
-
-
-/*
- * Routines for get/put values in common buffer formats follow.
- */
-
-/* Returns a bytes per pixel of the DataType in the get/put span
- * functions for at least a subset of the available combinations a
- * renderbuffer can have.
- *
- * It would be nice to see gl_renderbuffer start talking about a
- * gl_format instead of a GLenum DataType.
- */
-static int
-get_datatype_bytes(struct gl_renderbuffer *rb)
-{
- int component_size;
-
- switch (rb->DataType) {
- case GL_FLOAT:
- case GL_UNSIGNED_INT:
- case GL_UNSIGNED_INT_24_8_EXT:
- component_size = 4;
- break;
- case GL_UNSIGNED_SHORT:
- component_size = 2;
- break;
- case GL_UNSIGNED_BYTE:
- component_size = 1;
- break;
- default:
- component_size = 1;
- assert(0);
- }
-
- switch (rb->_BaseFormat) {
- case GL_DEPTH_COMPONENT:
- case GL_DEPTH_STENCIL:
- return component_size;
- default:
- return 4 * component_size;
- }
-}
-
-/* This is commonly used by most of the accessors. */
-static void *
-get_pointer_generic(struct gl_context *ctx, struct gl_renderbuffer *rb,
- GLint x, GLint y)
-{
- if (!rb->Data)
- return NULL;
-
- return ((char *) rb->Data +
- (y * rb->RowStride + x) * _mesa_get_format_bytes(rb->Format));
-}
-
-/* GetRow() implementation for formats where DataType matches the rb->Format.
- */
-static void
-get_row_generic(struct gl_context *ctx, struct gl_renderbuffer *rb,
- GLuint count, GLint x, GLint y, void *values)
-{
- void *src = rb->GetPointer(ctx, rb, x, y);
- memcpy(values, src, count * _mesa_get_format_bytes(rb->Format));
-}
-
-/* Only used for float textures currently, but might also be used for
- * RGBA8888, RGBA16, etc.
- */
-static void
-get_values_generic(struct gl_context *ctx, struct gl_renderbuffer *rb,
- GLuint count, const GLint x[], const GLint y[], void *values)
-{
- int format_bytes = _mesa_get_format_bytes(rb->Format) / sizeof(GLfloat);
- GLuint i;
-
- for (i = 0; i < count; i++) {
- const void *src = rb->GetPointer(ctx, rb, x[i], y[i]);
- char *dst = (char *) values + i * format_bytes;
- memcpy(dst, src, format_bytes);
- }
-}
-
-/* For the GL_RED/GL_RG/GL_RGB format/DataType combinations (and
- * GL_LUMINANCE/GL_INTENSITY?), the Put functions are a matter of
- * storing those initial components of the value per pixel into the
- * destination.
- */
-static void
-put_row_generic(struct gl_context *ctx, struct gl_renderbuffer *rb,
- GLuint count, GLint x, GLint y,
- const void *values, const GLubyte *mask)
-{
- void *row = rb->GetPointer(ctx, rb, x, y);
- int format_bytes = _mesa_get_format_bytes(rb->Format) / sizeof(GLfloat);
- int datatype_bytes = get_datatype_bytes(rb);
- unsigned int i;
-
- if (mask) {
- for (i = 0; i < count; i++) {
- char *dst = (char *) row + i * format_bytes;
- const char *src = (const char *) values + i * datatype_bytes;
-
- if (mask[i]) {
- memcpy(dst, src, format_bytes);
- }
- }
- }
- else {
- for (i = 0; i < count; i++) {
- char *dst = (char *) row + i * format_bytes;
- const char *src = (const char *) values + i * datatype_bytes;
- memcpy(dst, src, format_bytes);
- }
- }
-}
-
-static void
-put_mono_row_generic(struct gl_context *ctx, struct gl_renderbuffer *rb,
- GLuint count, GLint x, GLint y,
- const void *value, const GLubyte *mask)
-{
- void *row = rb->GetPointer(ctx, rb, x, y);
- int format_bytes = _mesa_get_format_bytes(rb->Format) / sizeof(GLfloat);
- unsigned int i;
-
- if (mask) {
- for (i = 0; i < count; i++) {
- char *dst = (char *) row + i * format_bytes;
- if (mask[i]) {
- memcpy(dst, value, format_bytes);
- }
- }
- }
- else {
- for (i = 0; i < count; i++) {
- char *dst = (char *) row + i * format_bytes;
- memcpy(dst, value, format_bytes);
- }
- }
-}
-
-
-static void
-put_values_generic(struct gl_context *ctx, struct gl_renderbuffer *rb,
- GLuint count, const GLint x[], const GLint y[],
- const void *values, const GLubyte *mask)
-{
- int format_bytes = _mesa_get_format_bytes(rb->Format) / sizeof(GLfloat);
- int datatype_bytes = get_datatype_bytes(rb);
- unsigned int i;
-
- for (i = 0; i < count; i++) {
- if (!mask || mask[i]) {
- void *dst = rb->GetPointer(ctx, rb, x[i], y[i]);
- const char *src = (const char *) values + i * datatype_bytes;
- memcpy(dst, src, format_bytes);
- }
- }
-}
-
-
-static void
-put_mono_values_generic(struct gl_context *ctx,
- struct gl_renderbuffer *rb,
- GLuint count, const GLint x[], const GLint y[],
- const void *value, const GLubyte *mask)
-{
- int format_bytes = _mesa_get_format_bytes(rb->Format) / sizeof(GLfloat);
- unsigned int i;
-
- for (i = 0; i < count; i++) {
- if (!mask || mask[i]) {
- void *dst = rb->GetPointer(ctx, rb, x[i], y[i]);
- memcpy(dst, value, format_bytes);
- }
- }
-}
-
-/**********************************************************************
- * Functions for buffers of 1 X GLubyte values.
- * Typically stencil.
- */
-
-static void
-get_values_ubyte(struct gl_context *ctx, struct gl_renderbuffer *rb, GLuint count,
- const GLint x[], const GLint y[], void *values)
-{
- GLubyte *dst = (GLubyte *) values;
- GLuint i;
- ASSERT(rb->DataType == GL_UNSIGNED_BYTE);
- for (i = 0; i < count; i++) {
- const GLubyte *src = (GLubyte *) rb->Data + y[i] * rb->RowStride + x[i];
- dst[i] = *src;
- }
-}
-
-
-static void
-put_row_ubyte(struct gl_context *ctx, struct gl_renderbuffer *rb, GLuint count,
- GLint x, GLint y, const void *values, const GLubyte *mask)
-{
- const GLubyte *src = (const GLubyte *) values;
- GLubyte *dst = (GLubyte *) rb->Data + y * rb->RowStride + x;
- ASSERT(rb->DataType == GL_UNSIGNED_BYTE);
- if (mask) {
- GLuint i;
- for (i = 0; i < count; i++) {
- if (mask[i]) {
- dst[i] = src[i];
- }
- }
- }
- else {
- memcpy(dst, values, count * sizeof(GLubyte));
- }
-}
-
-
-static void
-put_mono_row_ubyte(struct gl_context *ctx, struct gl_renderbuffer *rb, GLuint count,
- GLint x, GLint y, const void *value, const GLubyte *mask)
-{
- const GLubyte val = *((const GLubyte *) value);
- GLubyte *dst = (GLubyte *) rb->Data + y * rb->RowStride + x;
- ASSERT(rb->DataType == GL_UNSIGNED_BYTE);
- if (mask) {
- GLuint i;
- for (i = 0; i < count; i++) {
- if (mask[i]) {
- dst[i] = val;
- }
- }
- }
- else {
- GLuint i;
- for (i = 0; i < count; i++) {
- dst[i] = val;
- }
- }
-}
-
-
-static void
-put_values_ubyte(struct gl_context *ctx, struct gl_renderbuffer *rb, GLuint count,
- const GLint x[], const GLint y[],
- const void *values, const GLubyte *mask)
-{
- const GLubyte *src = (const GLubyte *) values;
- GLuint i;
- ASSERT(rb->DataType == GL_UNSIGNED_BYTE);
- for (i = 0; i < count; i++) {
- if (!mask || mask[i]) {
- GLubyte *dst = (GLubyte *) rb->Data + y[i] * rb->RowStride + x[i];
- *dst = src[i];
- }
- }
-}
-
-
-static void
-put_mono_values_ubyte(struct gl_context *ctx, struct gl_renderbuffer *rb, GLuint count,
- const GLint x[], const GLint y[],
- const void *value, const GLubyte *mask)
-{
- const GLubyte val = *((const GLubyte *) value);
- GLuint i;
- ASSERT(rb->DataType == GL_UNSIGNED_BYTE);
- for (i = 0; i < count; i++) {
- if (!mask || mask[i]) {
- GLubyte *dst = (GLubyte *) rb->Data + y[i] * rb->RowStride + x[i];
- *dst = val;
- }
- }
-}
-
-
-/**********************************************************************
- * Functions for buffers of 1 X GLushort values.
- * Typically depth/Z.
- */
-
-static void
-get_values_ushort(struct gl_context *ctx, struct gl_renderbuffer *rb, GLuint count,
- const GLint x[], const GLint y[], void *values)
-{
- GLushort *dst = (GLushort *) values;
- GLuint i;
- ASSERT(rb->DataType == GL_UNSIGNED_SHORT);
- for (i = 0; i < count; i++) {
- const GLushort *src = (GLushort *) rb->Data + y[i] * rb->RowStride + x[i];
- dst[i] = *src;
- }
-}
-
-
-static void
-put_row_ushort(struct gl_context *ctx, struct gl_renderbuffer *rb, GLuint count,
- GLint x, GLint y, const void *values, const GLubyte *mask)
-{
- const GLushort *src = (const GLushort *) values;
- GLushort *dst = (GLushort *) rb->Data + y * rb->RowStride + x;
- ASSERT(rb->DataType == GL_UNSIGNED_SHORT);
- if (mask) {
- GLuint i;
- for (i = 0; i < count; i++) {
- if (mask[i]) {
- dst[i] = src[i];
- }
- }
- }
- else {
- memcpy(dst, src, count * sizeof(GLushort));
- }
-}
-
-
-static void
-put_mono_row_ushort(struct gl_context *ctx, struct gl_renderbuffer *rb, GLuint count,
- GLint x, GLint y, const void *value, const GLubyte *mask)
-{
- const GLushort val = *((const GLushort *) value);
- GLushort *dst = (GLushort *) rb->Data + y * rb->RowStride + x;
- ASSERT(rb->DataType == GL_UNSIGNED_SHORT);
- if (mask) {
- GLuint i;
- for (i = 0; i < count; i++) {
- if (mask[i]) {
- dst[i] = val;
- }
- }
- }
- else {
- GLuint i;
- for (i = 0; i < count; i++) {
- dst[i] = val;
- }
- }
-}
-
-
-static void
-put_values_ushort(struct gl_context *ctx, struct gl_renderbuffer *rb, GLuint count,
- const GLint x[], const GLint y[], const void *values,
- const GLubyte *mask)
-{
- const GLushort *src = (const GLushort *) values;
- GLuint i;
- ASSERT(rb->DataType == GL_UNSIGNED_SHORT);
- for (i = 0; i < count; i++) {
- if (!mask || mask[i]) {
- GLushort *dst = (GLushort *) rb->Data + y[i] * rb->RowStride + x[i];
- *dst = src[i];
- }
- }
-}
-
-
-static void
-put_mono_values_ushort(struct gl_context *ctx, struct gl_renderbuffer *rb,
- GLuint count, const GLint x[], const GLint y[],
- const void *value, const GLubyte *mask)
-{
- const GLushort val = *((const GLushort *) value);
- ASSERT(rb->DataType == GL_UNSIGNED_SHORT);
- if (mask) {
- GLuint i;
- for (i = 0; i < count; i++) {
- if (mask[i]) {
- GLushort *dst = (GLushort *) rb->Data + y[i] * rb->RowStride + x[i];
- *dst = val;
- }
- }
- }
- else {
- GLuint i;
- for (i = 0; i < count; i++) {
- GLushort *dst = (GLushort *) rb->Data + y[i] * rb->RowStride + x[i];
- *dst = val;
- }
- }
-}
-
-
-/**********************************************************************
- * Functions for buffers of 1 X GLuint values.
- * Typically depth/Z or color index.
- */
-
-static void
-get_values_uint(struct gl_context *ctx, struct gl_renderbuffer *rb, GLuint count,
- const GLint x[], const GLint y[], void *values)
-{
- GLuint *dst = (GLuint *) values;
- GLuint i;
- ASSERT(rb->DataType == GL_UNSIGNED_INT ||
- rb->DataType == GL_UNSIGNED_INT_24_8_EXT);
- for (i = 0; i < count; i++) {
- const GLuint *src = (GLuint *) rb->Data + y[i] * rb->RowStride + x[i];
- dst[i] = *src;
- }
-}
-
-
-static void
-put_row_uint(struct gl_context *ctx, struct gl_renderbuffer *rb, GLuint count,
- GLint x, GLint y, const void *values, const GLubyte *mask)
-{
- const GLuint *src = (const GLuint *) values;
- GLuint *dst = (GLuint *) rb->Data + y * rb->RowStride + x;
- ASSERT(rb->DataType == GL_UNSIGNED_INT ||
- rb->DataType == GL_UNSIGNED_INT_24_8_EXT);
- if (mask) {
- GLuint i;
- for (i = 0; i < count; i++) {
- if (mask[i]) {
- dst[i] = src[i];
- }
- }
- }
- else {
- memcpy(dst, src, count * sizeof(GLuint));
- }
-}
-
-
-static void
-put_mono_row_uint(struct gl_context *ctx, struct gl_renderbuffer *rb, GLuint count,
- GLint x, GLint y, const void *value, const GLubyte *mask)
-{
- const GLuint val = *((const GLuint *) value);
- GLuint *dst = (GLuint *) rb->Data + y * rb->RowStride + x;
- ASSERT(rb->DataType == GL_UNSIGNED_INT ||
- rb->DataType == GL_UNSIGNED_INT_24_8_EXT);
- if (mask) {
- GLuint i;
- for (i = 0; i < count; i++) {
- if (mask[i]) {
- dst[i] = val;
- }
- }
- }
- else {
- GLuint i;
- for (i = 0; i < count; i++) {
- dst[i] = val;
- }
- }
-}
-
-
-static void
-put_values_uint(struct gl_context *ctx, struct gl_renderbuffer *rb, GLuint count,
- const GLint x[], const GLint y[], const void *values,
- const GLubyte *mask)
-{
- const GLuint *src = (const GLuint *) values;
- GLuint i;
- ASSERT(rb->DataType == GL_UNSIGNED_INT ||
- rb->DataType == GL_UNSIGNED_INT_24_8_EXT);
- for (i = 0; i < count; i++) {
- if (!mask || mask[i]) {
- GLuint *dst = (GLuint *) rb->Data + y[i] * rb->RowStride + x[i];
- *dst = src[i];
- }
- }
-}
-
-
-static void
-put_mono_values_uint(struct gl_context *ctx, struct gl_renderbuffer *rb, GLuint count,
- const GLint x[], const GLint y[], const void *value,
- const GLubyte *mask)
-{
- const GLuint val = *((const GLuint *) value);
- GLuint i;
- ASSERT(rb->DataType == GL_UNSIGNED_INT ||
- rb->DataType == GL_UNSIGNED_INT_24_8_EXT);
- for (i = 0; i < count; i++) {
- if (!mask || mask[i]) {
- GLuint *dst = (GLuint *) rb->Data + y[i] * rb->RowStride + x[i];
- *dst = val;
- }
- }
-}
-
-
-/**********************************************************************
- * Functions for buffers of 3 X GLubyte (or GLbyte) values.
- * Typically color buffers.
- * NOTE: the incoming and outgoing colors are RGBA! We ignore incoming
- * alpha values and return 255 for outgoing alpha values.
- */
-
-static void *
-get_pointer_ubyte3(struct gl_context *ctx, struct gl_renderbuffer *rb,
- GLint x, GLint y)
-{
- ASSERT(rb->Format == MESA_FORMAT_RGB888);
- /* No direct access since this buffer is RGB but caller will be
- * treating it as if it were RGBA.
- */
- return NULL;
-}
-
-
-static void
-get_row_ubyte3(struct gl_context *ctx, struct gl_renderbuffer *rb, GLuint count,
- GLint x, GLint y, void *values)
-{
- const GLubyte *src = ((const GLubyte *) rb->Data) +
- 3 * (y * rb->RowStride + x);
- GLubyte *dst = (GLubyte *) values;
- GLuint i;
- ASSERT(rb->Format == MESA_FORMAT_RGB888);
- ASSERT(rb->DataType == GL_UNSIGNED_BYTE);
- for (i = 0; i < count; i++) {
- dst[i * 4 + 0] = src[i * 3 + 0];
- dst[i * 4 + 1] = src[i * 3 + 1];
- dst[i * 4 + 2] = src[i * 3 + 2];
- dst[i * 4 + 3] = 255;
- }
-}
-
-
-static void
-get_values_ubyte3(struct gl_context *ctx, struct gl_renderbuffer *rb, GLuint count,
- const GLint x[], const GLint y[], void *values)
-{
- GLubyte *dst = (GLubyte *) values;
- GLuint i;
- ASSERT(rb->Format == MESA_FORMAT_RGB888);
- ASSERT(rb->DataType == GL_UNSIGNED_BYTE);
- for (i = 0; i < count; i++) {
- const GLubyte *src
- = (GLubyte *) rb->Data + 3 * (y[i] * rb->RowStride + x[i]);
- dst[i * 4 + 0] = src[0];
- dst[i * 4 + 1] = src[1];
- dst[i * 4 + 2] = src[2];
- dst[i * 4 + 3] = 255;
- }
-}
-
-
-static void
-put_row_ubyte3(struct gl_context *ctx, struct gl_renderbuffer *rb, GLuint count,
- GLint x, GLint y, const void *values, const GLubyte *mask)
-{
- /* note: incoming values are RGB+A! */
- const GLubyte *src = (const GLubyte *) values;
- GLubyte *dst = (GLubyte *) rb->Data + 3 * (y * rb->RowStride + x);
- GLuint i;
- ASSERT(rb->Format == MESA_FORMAT_RGB888);
- ASSERT(rb->DataType == GL_UNSIGNED_BYTE);
- for (i = 0; i < count; i++) {
- if (!mask || mask[i]) {
- dst[i * 3 + 0] = src[i * 4 + 0];
- dst[i * 3 + 1] = src[i * 4 + 1];
- dst[i * 3 + 2] = src[i * 4 + 2];
- }
- }
-}
-
-
-static void
-put_row_rgb_ubyte3(struct gl_context *ctx, struct gl_renderbuffer *rb, GLuint count,
- GLint x, GLint y, const void *values, const GLubyte *mask)
-{
- /* note: incoming values are RGB+A! */
- const GLubyte *src = (const GLubyte *) values;
- GLubyte *dst = (GLubyte *) rb->Data + 3 * (y * rb->RowStride + x);
- GLuint i;
- ASSERT(rb->Format == MESA_FORMAT_RGB888);
- ASSERT(rb->DataType == GL_UNSIGNED_BYTE);
- for (i = 0; i < count; i++) {
- if (!mask || mask[i]) {
- dst[i * 3 + 0] = src[i * 3 + 0];
- dst[i * 3 + 1] = src[i * 3 + 1];
- dst[i * 3 + 2] = src[i * 3 + 2];
- }
- }
-}
-
-
-static void
-put_mono_row_ubyte3(struct gl_context *ctx, struct gl_renderbuffer *rb, GLuint count,
- GLint x, GLint y, const void *value, const GLubyte *mask)
-{
- /* note: incoming value is RGB+A! */
- const GLubyte val0 = ((const GLubyte *) value)[0];
- const GLubyte val1 = ((const GLubyte *) value)[1];
- const GLubyte val2 = ((const GLubyte *) value)[2];
- GLubyte *dst = (GLubyte *) rb->Data + 3 * (y * rb->RowStride + x);
- ASSERT(rb->Format == MESA_FORMAT_RGB888);
- ASSERT(rb->DataType == GL_UNSIGNED_BYTE);
- if (!mask && val0 == val1 && val1 == val2) {
- /* optimized case */
- memset(dst, val0, 3 * count);
- }
- else {
- GLuint i;
- for (i = 0; i < count; i++) {
- if (!mask || mask[i]) {
- dst[i * 3 + 0] = val0;
- dst[i * 3 + 1] = val1;
- dst[i * 3 + 2] = val2;
- }
- }
- }
-}
-
-
-static void
-put_values_ubyte3(struct gl_context *ctx, struct gl_renderbuffer *rb, GLuint count,
- const GLint x[], const GLint y[], const void *values,
- const GLubyte *mask)
-{
- /* note: incoming values are RGB+A! */
- const GLubyte *src = (const GLubyte *) values;
- GLuint i;
- ASSERT(rb->Format == MESA_FORMAT_RGB888);
- ASSERT(rb->DataType == GL_UNSIGNED_BYTE);
- for (i = 0; i < count; i++) {
- if (!mask || mask[i]) {
- GLubyte *dst = (GLubyte *) rb->Data + 3 * (y[i] * rb->RowStride + x[i]);
- dst[0] = src[i * 4 + 0];
- dst[1] = src[i * 4 + 1];
- dst[2] = src[i * 4 + 2];
- }
- }
-}
-
-
-static void
-put_mono_values_ubyte3(struct gl_context *ctx, struct gl_renderbuffer *rb,
- GLuint count, const GLint x[], const GLint y[],
- const void *value, const GLubyte *mask)
-{
- /* note: incoming value is RGB+A! */
- const GLubyte val0 = ((const GLubyte *) value)[0];
- const GLubyte val1 = ((const GLubyte *) value)[1];
- const GLubyte val2 = ((const GLubyte *) value)[2];
- GLuint i;
- ASSERT(rb->Format == MESA_FORMAT_RGB888);
- ASSERT(rb->DataType == GL_UNSIGNED_BYTE);
- for (i = 0; i < count; i++) {
- if (!mask || mask[i]) {
- GLubyte *dst = ((GLubyte *) rb->Data) +
- 3 * (y[i] * rb->RowStride + x[i]);
- dst[0] = val0;
- dst[1] = val1;
- dst[2] = val2;
- }
- }
-}
-
-
-/**********************************************************************
- * Functions for buffers of 4 X GLubyte (or GLbyte) values.
- * Typically color buffers.
- */
-
-static void
-get_values_ubyte4(struct gl_context *ctx, struct gl_renderbuffer *rb, GLuint count,
- const GLint x[], const GLint y[], void *values)
-{
- /* treat 4*GLubyte as 1*GLuint */
- GLuint *dst = (GLuint *) values;
- GLuint i;
- ASSERT(rb->DataType == GL_UNSIGNED_BYTE);
- ASSERT(rb->Format == MESA_FORMAT_RGBA8888);
- for (i = 0; i < count; i++) {
- const GLuint *src = (GLuint *) rb->Data + (y[i] * rb->RowStride + x[i]);
- dst[i] = *src;
- }
-}
-
-
-static void
-put_row_ubyte4(struct gl_context *ctx, struct gl_renderbuffer *rb, GLuint count,
- GLint x, GLint y, const void *values, const GLubyte *mask)
-{
- /* treat 4*GLubyte as 1*GLuint */
- const GLuint *src = (const GLuint *) values;
- GLuint *dst = (GLuint *) rb->Data + (y * rb->RowStride + x);
- ASSERT(rb->DataType == GL_UNSIGNED_BYTE);
- ASSERT(rb->Format == MESA_FORMAT_RGBA8888);
- if (mask) {
- GLuint i;
- for (i = 0; i < count; i++) {
- if (mask[i]) {
- dst[i] = src[i];
- }
- }
- }
- else {
- memcpy(dst, src, 4 * count * sizeof(GLubyte));
- }
-}
-
-
-static void
-put_row_rgb_ubyte4(struct gl_context *ctx, struct gl_renderbuffer *rb, GLuint count,
- GLint x, GLint y, const void *values, const GLubyte *mask)
-{
- /* Store RGB values in RGBA buffer */
- const GLubyte *src = (const GLubyte *) values;
- GLubyte *dst = (GLubyte *) rb->Data + 4 * (y * rb->RowStride + x);
- GLuint i;
- ASSERT(rb->DataType == GL_UNSIGNED_BYTE);
- ASSERT(rb->Format == MESA_FORMAT_RGBA8888);
- for (i = 0; i < count; i++) {
- if (!mask || mask[i]) {
- dst[i * 4 + 0] = src[i * 3 + 0];
- dst[i * 4 + 1] = src[i * 3 + 1];
- dst[i * 4 + 2] = src[i * 3 + 2];
- dst[i * 4 + 3] = 0xff;
- }
- }
-}
-
-
-static void
-put_mono_row_ubyte4(struct gl_context *ctx, struct gl_renderbuffer *rb, GLuint count,
- GLint x, GLint y, const void *value, const GLubyte *mask)
-{
- /* treat 4*GLubyte as 1*GLuint */
- const GLuint val = *((const GLuint *) value);
- GLuint *dst = (GLuint *) rb->Data + (y * rb->RowStride + x);
- ASSERT(rb->DataType == GL_UNSIGNED_BYTE);
- ASSERT(rb->Format == MESA_FORMAT_RGBA8888);
- if (!mask && val == 0) {
- /* common case */
- memset(dst, 0, count * 4 * sizeof(GLubyte));
- }
- else {
- /* general case */
- if (mask) {
- GLuint i;
- for (i = 0; i < count; i++) {
- if (mask[i]) {
- dst[i] = val;
- }
- }
- }
- else {
- GLuint i;
- for (i = 0; i < count; i++) {
- dst[i] = val;
- }
- }
- }
-}
-
-
-static void
-put_values_ubyte4(struct gl_context *ctx, struct gl_renderbuffer *rb, GLuint count,
- const GLint x[], const GLint y[], const void *values,
- const GLubyte *mask)
-{
- /* treat 4*GLubyte as 1*GLuint */
- const GLuint *src = (const GLuint *) values;
- GLuint i;
- ASSERT(rb->DataType == GL_UNSIGNED_BYTE);
- ASSERT(rb->Format == MESA_FORMAT_RGBA8888);
- for (i = 0; i < count; i++) {
- if (!mask || mask[i]) {
- GLuint *dst = (GLuint *) rb->Data + (y[i] * rb->RowStride + x[i]);
- *dst = src[i];
- }
- }
-}
-
-
-static void
-put_mono_values_ubyte4(struct gl_context *ctx, struct gl_renderbuffer *rb,
- GLuint count, const GLint x[], const GLint y[],
- const void *value, const GLubyte *mask)
-{
- /* treat 4*GLubyte as 1*GLuint */
- const GLuint val = *((const GLuint *) value);
- GLuint i;
- ASSERT(rb->DataType == GL_UNSIGNED_BYTE);
- ASSERT(rb->Format == MESA_FORMAT_RGBA8888);
- for (i = 0; i < count; i++) {
- if (!mask || mask[i]) {
- GLuint *dst = (GLuint *) rb->Data + (y[i] * rb->RowStride + x[i]);
- *dst = val;
- }
- }
-}
-
-
-/**********************************************************************
- * Functions for buffers of 4 X GLushort (or GLshort) values.
- * Typically accum buffer.
- */
-
-static void
-get_values_ushort4(struct gl_context *ctx, struct gl_renderbuffer *rb, GLuint count,
- const GLint x[], const GLint y[], void *values)
-{
- GLushort *dst = (GLushort *) values;
- GLuint i;
- ASSERT(rb->DataType == GL_UNSIGNED_SHORT || rb->DataType == GL_SHORT);
- for (i = 0; i < count; i++) {
- const GLushort *src
- = (GLushort *) rb->Data + 4 * (y[i] * rb->RowStride + x[i]);
- dst[i] = *src;
- }
-}
-
-
-static void
-put_row_ushort4(struct gl_context *ctx, struct gl_renderbuffer *rb, GLuint count,
- GLint x, GLint y, const void *values, const GLubyte *mask)
-{
- const GLushort *src = (const GLushort *) values;
- GLushort *dst = (GLushort *) rb->Data + 4 * (y * rb->RowStride + x);
- ASSERT(rb->DataType == GL_UNSIGNED_SHORT || rb->DataType == GL_SHORT);
- if (mask) {
- GLuint i;
- for (i = 0; i < count; i++) {
- if (mask[i]) {
- dst[i * 4 + 0] = src[i * 4 + 0];
- dst[i * 4 + 1] = src[i * 4 + 1];
- dst[i * 4 + 2] = src[i * 4 + 2];
- dst[i * 4 + 3] = src[i * 4 + 3];
- }
- }
- }
- else {
- memcpy(dst, src, 4 * count * sizeof(GLushort));
- }
-}
-
-
-static void
-put_row_rgb_ushort4(struct gl_context *ctx, struct gl_renderbuffer *rb, GLuint count,
- GLint x, GLint y, const void *values, const GLubyte *mask)
-{
- /* Put RGB values in RGBA buffer */
- const GLushort *src = (const GLushort *) values;
- GLushort *dst = (GLushort *) rb->Data + 4 * (y * rb->RowStride + x);
- ASSERT(rb->DataType == GL_UNSIGNED_SHORT || rb->DataType == GL_SHORT);
- if (mask) {
- GLuint i;
- for (i = 0; i < count; i++) {
- if (mask[i]) {
- dst[i * 4 + 0] = src[i * 3 + 0];
- dst[i * 4 + 1] = src[i * 3 + 1];
- dst[i * 4 + 2] = src[i * 3 + 2];
- dst[i * 4 + 3] = 0xffff;
- }
- }
- }
- else {
- memcpy(dst, src, 4 * count * sizeof(GLushort));
- }
-}
-
-
-static void
-put_mono_row_ushort4(struct gl_context *ctx, struct gl_renderbuffer *rb, GLuint count,
- GLint x, GLint y, const void *value, const GLubyte *mask)
-{
- const GLushort val0 = ((const GLushort *) value)[0];
- const GLushort val1 = ((const GLushort *) value)[1];
- const GLushort val2 = ((const GLushort *) value)[2];
- const GLushort val3 = ((const GLushort *) value)[3];
- GLushort *dst = (GLushort *) rb->Data + 4 * (y * rb->RowStride + x);
- ASSERT(rb->DataType == GL_UNSIGNED_SHORT || rb->DataType == GL_SHORT);
- if (!mask && val0 == 0 && val1 == 0 && val2 == 0 && val3 == 0) {
- /* common case for clearing accum buffer */
- memset(dst, 0, count * 4 * sizeof(GLushort));
- }
- else {
- GLuint i;
- for (i = 0; i < count; i++) {
- if (!mask || mask[i]) {
- dst[i * 4 + 0] = val0;
- dst[i * 4 + 1] = val1;
- dst[i * 4 + 2] = val2;
- dst[i * 4 + 3] = val3;
- }
- }
- }
-}
-
-
-static void
-put_values_ushort4(struct gl_context *ctx, struct gl_renderbuffer *rb, GLuint count,
- const GLint x[], const GLint y[], const void *values,
- const GLubyte *mask)
-{
- const GLushort *src = (const GLushort *) values;
- GLuint i;
- ASSERT(rb->DataType == GL_UNSIGNED_SHORT || rb->DataType == GL_SHORT);
- for (i = 0; i < count; i++) {
- if (!mask || mask[i]) {
- GLushort *dst =
- ((GLushort *) rb->Data) + 4 * (y[i] * rb->RowStride + x[i]);
- dst[0] = src[i * 4 + 0];
- dst[1] = src[i * 4 + 1];
- dst[2] = src[i * 4 + 2];
- dst[3] = src[i * 4 + 3];
- }
- }
-}
-
-
-static void
-put_mono_values_ushort4(struct gl_context *ctx, struct gl_renderbuffer *rb,
- GLuint count, const GLint x[], const GLint y[],
- const void *value, const GLubyte *mask)
-{
- const GLushort val0 = ((const GLushort *) value)[0];
- const GLushort val1 = ((const GLushort *) value)[1];
- const GLushort val2 = ((const GLushort *) value)[2];
- const GLushort val3 = ((const GLushort *) value)[3];
- GLuint i;
- ASSERT(rb->DataType == GL_UNSIGNED_SHORT || rb->DataType == GL_SHORT);
- for (i = 0; i < count; i++) {
- if (!mask || mask[i]) {
- GLushort *dst = ((GLushort *) rb->Data) +
- 4 * (y[i] * rb->RowStride + x[i]);
- dst[0] = val0;
- dst[1] = val1;
- dst[2] = val2;
- dst[3] = val3;
- }
- }
-}
-
-/**********************************************************************
- * Functions for MESA_FORMAT_R8.
- */
-static void
-get_row_r8(struct gl_context *ctx, struct gl_renderbuffer *rb, GLuint count,
- GLint x, GLint y, void *values)
-{
- const GLubyte *src = rb->GetPointer(ctx, rb, x, y);
- GLuint *dst = values;
- GLuint i;
-
- for (i = 0; i < count; i++) {
- dst[i] = 0xff000000 | src[i];
- }
-}
-
-static void
-get_values_r8(struct gl_context *ctx, struct gl_renderbuffer *rb, GLuint count,
- const GLint x[], const GLint y[], void *values)
-{
- GLuint *dst = (GLuint *) values;
- GLuint i;
-
- for (i = 0; i < count; i++) {
- const GLubyte *src = rb->GetPointer(ctx, rb, x[i], y[i]);
- dst[i] = 0xff000000 | *src;
- }
-}
-
-/**********************************************************************
- * Functions for MESA_FORMAT_RG88.
- */
-static void
-get_row_rg88(struct gl_context *ctx, struct gl_renderbuffer *rb, GLuint count,
- GLint x, GLint y, void *values)
-{
- const GLushort *src = rb->GetPointer(ctx, rb, x, y);
- GLuint *dst = values;
- GLuint i;
-
- for (i = 0; i < count; i++) {
- dst[i] = 0xff000000 | src[i];
- }
-}
-
-static void
-get_values_rg88(struct gl_context *ctx, struct gl_renderbuffer *rb,
- GLuint count, const GLint x[], const GLint y[], void *values)
-{
- GLuint *dst = (GLuint *) values;
- GLuint i;
-
- for (i = 0; i < count; i++) {
- const GLshort *src = rb->GetPointer(ctx, rb, x[i], y[i]);
- dst[i] = 0xff000000 | *src;
- }
-}
-
-/**********************************************************************
- * Functions for MESA_FORMAT_R16.
- */
-static void
-get_row_r16(struct gl_context *ctx, struct gl_renderbuffer *rb, GLuint count,
- GLint x, GLint y, void *values)
-{
- const GLushort *src = rb->GetPointer(ctx, rb, x, y);
- GLushort *dst = values;
- GLuint i;
-
- for (i = 0; i < count; i++) {
- dst[i * 4 + RCOMP] = src[i];
- dst[i * 4 + GCOMP] = 0;
- dst[i * 4 + BCOMP] = 0;
- dst[i * 4 + ACOMP] = 0xffff;
- }
-}
-
-static void
-get_values_r16(struct gl_context *ctx, struct gl_renderbuffer *rb, GLuint count,
- const GLint x[], const GLint y[], void *values)
-{
- GLushort *dst = values;
- GLuint i;
-
- for (i = 0; i < count; i++) {
- const GLushort *src = rb->GetPointer(ctx, rb, x[i], y[i]);
- dst[i * 4 + RCOMP] = *src;
- dst[i * 4 + GCOMP] = 0;
- dst[i * 4 + BCOMP] = 0;
- dst[i * 4 + ACOMP] = 0xffff;
- }
-}
-
-/**********************************************************************
- * Functions for MESA_FORMAT_RG1616.
- */
-static void
-get_row_rg1616(struct gl_context *ctx, struct gl_renderbuffer *rb, GLuint count,
- GLint x, GLint y, void *values)
-{
- const GLushort *src = rb->GetPointer(ctx, rb, x, y);
- GLushort *dst = values;
- GLuint i;
-
- for (i = 0; i < count; i++) {
- dst[i * 4 + RCOMP] = src[i * 2];
- dst[i * 4 + GCOMP] = src[i * 2 + 1];
- dst[i * 4 + BCOMP] = 0;
- dst[i * 4 + ACOMP] = 0xffff;
- }
-}
-
-static void
-get_values_rg1616(struct gl_context *ctx, struct gl_renderbuffer *rb,
- GLuint count, const GLint x[], const GLint y[], void *values)
-{
- GLushort *dst = values;
- GLuint i;
-
- for (i = 0; i < count; i++) {
- const GLshort *src = rb->GetPointer(ctx, rb, x[i], y[i]);
- dst[i * 4 + RCOMP] = src[0];
- dst[i * 4 + GCOMP] = src[1];
- dst[i * 4 + BCOMP] = 0;
- dst[i * 4 + ACOMP] = 0xffff;
- }
-}
-
-/**********************************************************************
- * Functions for MESA_FORMAT_INTENSITY_FLOAT32.
- */
-static void
-get_row_i_float32(struct gl_context *ctx, struct gl_renderbuffer *rb,
- GLuint count, GLint x, GLint y, void *values)
-{
- const GLfloat *src = rb->GetPointer(ctx, rb, x, y);
- GLfloat *dst = values;
- GLuint i;
-
- for (i = 0; i < count; i++) {
- dst[i * 4 + RCOMP] =
- dst[i * 4 + GCOMP] =
- dst[i * 4 + BCOMP] =
- dst[i * 4 + ACOMP] = src[i];
- }
-}
-
-static void
-get_values_i_float32(struct gl_context *ctx, struct gl_renderbuffer *rb,
- GLuint count, const GLint x[], const GLint y[],
- void *values)
-{
- GLfloat *dst = values;
- GLuint i;
-
- for (i = 0; i < count; i++) {
- const GLfloat *src = rb->GetPointer(ctx, rb, x[i], y[i]);
- dst[i * 4 + RCOMP] =
- dst[i * 4 + GCOMP] =
- dst[i * 4 + BCOMP] =
- dst[i * 4 + ACOMP] = src[0];
- }
-}
-
-/**********************************************************************
- * Functions for MESA_FORMAT_LUMINANCE_FLOAT32.
- */
-static void
-get_row_l_float32(struct gl_context *ctx, struct gl_renderbuffer *rb,
- GLuint count, GLint x, GLint y, void *values)
-{
- const GLfloat *src = rb->GetPointer(ctx, rb, x, y);
- GLfloat *dst = values;
- GLuint i;
-
- for (i = 0; i < count; i++) {
- dst[i * 4 + RCOMP] =
- dst[i * 4 + GCOMP] =
- dst[i * 4 + BCOMP] = src[i];
- dst[i * 4 + ACOMP] = 1.0;
- }
-}
-
-static void
-get_values_l_float32(struct gl_context *ctx, struct gl_renderbuffer *rb,
- GLuint count, const GLint x[], const GLint y[],
- void *values)
-{
- GLfloat *dst = values;
- GLuint i;
-
- for (i = 0; i < count; i++) {
- const GLfloat *src = rb->GetPointer(ctx, rb, x[i], y[i]);
- dst[i * 4 + RCOMP] =
- dst[i * 4 + GCOMP] =
- dst[i * 4 + BCOMP] = src[0];
- dst[i * 4 + ACOMP] = 1.0;
- }
-}
-
-/**********************************************************************
- * Functions for MESA_FORMAT_ALPHA_FLOAT32.
- */
-static void
-get_row_a_float32(struct gl_context *ctx, struct gl_renderbuffer *rb,
- GLuint count, GLint x, GLint y, void *values)
-{
- const GLfloat *src = rb->GetPointer(ctx, rb, x, y);
- GLfloat *dst = values;
- GLuint i;
-
- for (i = 0; i < count; i++) {
- dst[i * 4 + RCOMP] = 0.0;
- dst[i * 4 + GCOMP] = 0.0;
- dst[i * 4 + BCOMP] = 0.0;
- dst[i * 4 + ACOMP] = src[i];
- }
-}
-
-static void
-get_values_a_float32(struct gl_context *ctx, struct gl_renderbuffer *rb,
- GLuint count, const GLint x[], const GLint y[],
- void *values)
-{
- GLfloat *dst = values;
- GLuint i;
-
- for (i = 0; i < count; i++) {
- const GLfloat *src = rb->GetPointer(ctx, rb, x[i], y[i]);
- dst[i * 4 + RCOMP] = 0.0;
- dst[i * 4 + GCOMP] = 0.0;
- dst[i * 4 + BCOMP] = 0.0;
- dst[i * 4 + ACOMP] = src[0];
- }
-}
-
-static void
-put_row_a_float32(struct gl_context *ctx, struct gl_renderbuffer *rb,
- GLuint count, GLint x, GLint y,
- const void *values, const GLubyte *mask)
-{
- float *dst = rb->GetPointer(ctx, rb, x, y);
- const float *src = values;
- unsigned int i;
-
- if (mask) {
- for (i = 0; i < count; i++) {
- if (mask[i]) {
- dst[i] = src[i * 4 + ACOMP];
- }
- }
- }
- else {
- for (i = 0; i < count; i++) {
- dst[i] = src[i * 4 + ACOMP];
- }
- }
-}
-
-static void
-put_mono_row_a_float32(struct gl_context *ctx, struct gl_renderbuffer *rb,
- GLuint count, GLint x, GLint y,
- const void *value, const GLubyte *mask)
-{
- float *dst = rb->GetPointer(ctx, rb, x, y);
- const float *src = value;
- unsigned int i;
-
- if (mask) {
- for (i = 0; i < count; i++) {
- if (mask[i]) {
- dst[i] = src[ACOMP];
- }
- }
- }
- else {
- for (i = 0; i < count; i++) {
- dst[i] = src[ACOMP];
- }
- }
-}
-
-static void
-put_values_a_float32(struct gl_context *ctx, struct gl_renderbuffer *rb,
- GLuint count, const GLint x[], const GLint y[],
- const void *values, const GLubyte *mask)
-{
- const float *src = values;
- unsigned int i;
-
- for (i = 0; i < count; i++) {
- if (!mask || mask[i]) {
- float *dst = rb->GetPointer(ctx, rb, x[i], y[i]);
-
- *dst = src[i * 4 + ACOMP];
- }
- }
-}
-
-static void
-put_mono_values_a_float32(struct gl_context *ctx,
- struct gl_renderbuffer *rb,
- GLuint count, const GLint x[], const GLint y[],
- const void *value, const GLubyte *mask)
-{
- const float *src = value;
- unsigned int i;
-
- for (i = 0; i < count; i++) {
- if (!mask || mask[i]) {
- float *dst = rb->GetPointer(ctx, rb, x[i], y[i]);
- *dst = src[ACOMP];
- }
- }
-}
-
-/**********************************************************************
- * Functions for MESA_FORMAT_R_FLOAT32.
- */
-static void
-get_row_r_float32(struct gl_context *ctx, struct gl_renderbuffer *rb,
- GLuint count, GLint x, GLint y, void *values)
-{
- const GLfloat *src = rb->GetPointer(ctx, rb, x, y);
- GLfloat *dst = values;
- GLuint i;
-
- for (i = 0; i < count; i++) {
- dst[i * 4 + RCOMP] = src[i];
- dst[i * 4 + GCOMP] = 0.0;
- dst[i * 4 + BCOMP] = 0.0;
- dst[i * 4 + ACOMP] = 1.0;
- }
-}
-
-static void
-get_values_r_float32(struct gl_context *ctx, struct gl_renderbuffer *rb,
- GLuint count, const GLint x[], const GLint y[],
- void *values)
-{
- GLfloat *dst = values;
- GLuint i;
-
- for (i = 0; i < count; i++) {
- const GLfloat *src = rb->GetPointer(ctx, rb, x[i], y[i]);
- dst[i * 4 + RCOMP] = src[0];
- dst[i * 4 + GCOMP] = 0.0;
- dst[i * 4 + BCOMP] = 0.0;
- dst[i * 4 + ACOMP] = 1.0;
- }
-}
-
-/**********************************************************************
- * Functions for MESA_FORMAT_RG_FLOAT32.
- */
-static void
-get_row_rg_float32(struct gl_context *ctx, struct gl_renderbuffer *rb,
- GLuint count, GLint x, GLint y, void *values)
-{
- const GLfloat *src = rb->GetPointer(ctx, rb, x, y);
- GLfloat *dst = values;
- GLuint i;
-
- for (i = 0; i < count; i++) {
- dst[i * 4 + RCOMP] = src[i * 2 + 0];
- dst[i * 4 + GCOMP] = src[i * 2 + 1];
- dst[i * 4 + BCOMP] = 0.0;
- dst[i * 4 + ACOMP] = 1.0;
- }
-}
-
-static void
-get_values_rg_float32(struct gl_context *ctx, struct gl_renderbuffer *rb,
- GLuint count, const GLint x[], const GLint y[],
- void *values)
-{
- GLfloat *dst = values;
- GLuint i;
-
- for (i = 0; i < count; i++) {
- const GLfloat *src = rb->GetPointer(ctx, rb, x[i], y[i]);
- dst[i * 4 + RCOMP] = src[0];
- dst[i * 4 + GCOMP] = src[1];
- dst[i * 4 + BCOMP] = 0.0;
- dst[i * 4 + ACOMP] = 1.0;
- }
-}
-
-/**
- * This is the default software fallback for gl_renderbuffer's span
- * access functions.
- *
- * The assumptions are that rb->Data will be a pointer to (0,0), that pixels
- * are packed in the type of rb->Format, and that subsequent rows appear
- * rb->RowStride pixels later.
- */
-void
-_mesa_set_renderbuffer_accessors(struct gl_renderbuffer *rb)
-{
- rb->GetPointer = get_pointer_generic;
- rb->GetRow = get_row_generic;
-
- switch (rb->Format) {
- case MESA_FORMAT_RGB888:
- rb->DataType = GL_UNSIGNED_BYTE;
- rb->GetPointer = get_pointer_ubyte3;
- rb->GetRow = get_row_ubyte3;
- rb->GetValues = get_values_ubyte3;
- rb->PutRow = put_row_ubyte3;
- rb->PutRowRGB = put_row_rgb_ubyte3;
- rb->PutMonoRow = put_mono_row_ubyte3;
- rb->PutValues = put_values_ubyte3;
- rb->PutMonoValues = put_mono_values_ubyte3;
- break;
-
- case MESA_FORMAT_RGBA8888:
- rb->DataType = GL_UNSIGNED_BYTE;
- rb->GetValues = get_values_ubyte4;
- rb->PutRow = put_row_ubyte4;
- rb->PutRowRGB = put_row_rgb_ubyte4;
- rb->PutMonoRow = put_mono_row_ubyte4;
- rb->PutValues = put_values_ubyte4;
- rb->PutMonoValues = put_mono_values_ubyte4;
- break;
-
- case MESA_FORMAT_R8:
- rb->DataType = GL_UNSIGNED_BYTE;
- rb->GetValues = get_values_r8;
- rb->GetRow = get_row_r8;
- rb->PutRow = put_row_generic;
- rb->PutRowRGB = put_row_generic;
- rb->PutMonoRow = put_mono_row_generic;
- rb->PutValues = put_values_generic;
- rb->PutMonoValues = put_mono_values_generic;
- break;
-
- case MESA_FORMAT_RG88:
- rb->DataType = GL_UNSIGNED_BYTE;
- rb->GetValues = get_values_rg88;
- rb->GetRow = get_row_rg88;
- rb->PutRow = put_row_generic;
- rb->PutRowRGB = put_row_generic;
- rb->PutMonoRow = put_mono_row_generic;
- rb->PutValues = put_values_generic;
- rb->PutMonoValues = put_mono_values_generic;
- break;
-
- case MESA_FORMAT_R16:
- rb->DataType = GL_UNSIGNED_SHORT;
- rb->GetValues = get_values_r16;
- rb->GetRow = get_row_r16;
- rb->PutRow = put_row_generic;
- rb->PutRowRGB = put_row_generic;
- rb->PutMonoRow = put_mono_row_generic;
- rb->PutValues = put_values_generic;
- rb->PutMonoValues = put_mono_values_generic;
- break;
-
- case MESA_FORMAT_RG1616:
- rb->DataType = GL_UNSIGNED_SHORT;
- rb->GetValues = get_values_rg1616;
- rb->GetRow = get_row_rg1616;
- rb->PutRow = put_row_generic;
- rb->PutRowRGB = put_row_generic;
- rb->PutMonoRow = put_mono_row_generic;
- rb->PutValues = put_values_generic;
- rb->PutMonoValues = put_mono_values_generic;
- break;
-
- case MESA_FORMAT_SIGNED_RGBA_16:
- rb->DataType = GL_SHORT;
- rb->GetValues = get_values_ushort4;
- rb->PutRow = put_row_ushort4;
- rb->PutRowRGB = put_row_rgb_ushort4;
- rb->PutMonoRow = put_mono_row_ushort4;
- rb->PutValues = put_values_ushort4;
- rb->PutMonoValues = put_mono_values_ushort4;
- break;
-
-#if 0
- case MESA_FORMAT_A8:
- rb->DataType = GL_UNSIGNED_BYTE;
- rb->GetValues = get_values_alpha8;
- rb->PutRow = put_row_alpha8;
- rb->PutRowRGB = NULL;
- rb->PutMonoRow = put_mono_row_alpha8;
- rb->PutValues = put_values_alpha8;
- rb->PutMonoValues = put_mono_values_alpha8;
- break;
-#endif
-
- case MESA_FORMAT_S8:
- rb->DataType = GL_UNSIGNED_BYTE;
- rb->GetValues = get_values_ubyte;
- rb->PutRow = put_row_ubyte;
- rb->PutRowRGB = NULL;
- rb->PutMonoRow = put_mono_row_ubyte;
- rb->PutValues = put_values_ubyte;
- rb->PutMonoValues = put_mono_values_ubyte;
- break;
-
- case MESA_FORMAT_Z16:
- rb->DataType = GL_UNSIGNED_SHORT;
- rb->GetValues = get_values_ushort;
- rb->PutRow = put_row_ushort;
- rb->PutRowRGB = NULL;
- rb->PutMonoRow = put_mono_row_ushort;
- rb->PutValues = put_values_ushort;
- rb->PutMonoValues = put_mono_values_ushort;
- break;
-
- case MESA_FORMAT_Z32:
- case MESA_FORMAT_X8_Z24:
- case MESA_FORMAT_Z24_X8:
- rb->DataType = GL_UNSIGNED_INT;
- rb->GetValues = get_values_uint;
- rb->PutRow = put_row_uint;
- rb->PutRowRGB = NULL;
- rb->PutMonoRow = put_mono_row_uint;
- rb->PutValues = put_values_uint;
- rb->PutMonoValues = put_mono_values_uint;
- break;
-
- case MESA_FORMAT_Z24_S8:
- case MESA_FORMAT_S8_Z24:
- rb->DataType = GL_UNSIGNED_INT_24_8_EXT;
- rb->GetValues = get_values_uint;
- rb->PutRow = put_row_uint;
- rb->PutRowRGB = NULL;
- rb->PutMonoRow = put_mono_row_uint;
- rb->PutValues = put_values_uint;
- rb->PutMonoValues = put_mono_values_uint;
- break;
-
- case MESA_FORMAT_RGBA_FLOAT32:
- rb->GetRow = get_row_generic;
- rb->GetValues = get_values_generic;
- rb->PutRow = put_row_generic;
- rb->PutRowRGB = NULL;
- rb->PutMonoRow = put_mono_row_generic;
- rb->PutValues = put_values_generic;
- rb->PutMonoValues = put_mono_values_generic;
- break;
-
- case MESA_FORMAT_INTENSITY_FLOAT32:
- rb->GetRow = get_row_i_float32;
- rb->GetValues = get_values_i_float32;
- rb->PutRow = put_row_generic;
- rb->PutRowRGB = NULL;
- rb->PutMonoRow = put_mono_row_generic;
- rb->PutValues = put_values_generic;
- rb->PutMonoValues = put_mono_values_generic;
- break;
-
- case MESA_FORMAT_LUMINANCE_FLOAT32:
- rb->GetRow = get_row_l_float32;
- rb->GetValues = get_values_l_float32;
- rb->PutRow = put_row_generic;
- rb->PutRowRGB = NULL;
- rb->PutMonoRow = put_mono_row_generic;
- rb->PutValues = put_values_generic;
- rb->PutMonoValues = put_mono_values_generic;
- break;
-
- case MESA_FORMAT_ALPHA_FLOAT32:
- rb->GetRow = get_row_a_float32;
- rb->GetValues = get_values_a_float32;
- rb->PutRow = put_row_a_float32;
- rb->PutRowRGB = NULL;
- rb->PutMonoRow = put_mono_row_a_float32;
- rb->PutValues = put_values_a_float32;
- rb->PutMonoValues = put_mono_values_a_float32;
- break;
-
- case MESA_FORMAT_RG_FLOAT32:
- rb->GetRow = get_row_rg_float32;
- rb->GetValues = get_values_rg_float32;
- rb->PutRow = put_row_generic;
- rb->PutRowRGB = NULL;
- rb->PutMonoRow = put_mono_row_generic;
- rb->PutValues = put_values_generic;
- rb->PutMonoValues = put_mono_values_generic;
- break;
-
- case MESA_FORMAT_R_FLOAT32:
- rb->GetRow = get_row_r_float32;
- rb->GetValues = get_values_r_float32;
- rb->PutRow = put_row_generic;
- rb->PutRowRGB = NULL;
- rb->PutMonoRow = put_mono_row_generic;
- rb->PutValues = put_values_generic;
- rb->PutMonoValues = put_mono_values_generic;
- break;
-
- default:
- break;
- }
-}
-
-/**
- * This is a software fallback for the gl_renderbuffer->AllocStorage
- * function.
- * Device drivers will typically override this function for the buffers
- * which it manages (typically color buffers, Z and stencil).
- * Other buffers (like software accumulation and aux buffers) which the driver
- * doesn't manage can be handled with this function.
- *
- * This one multi-purpose function can allocate stencil, depth, accum, color
- * or color-index buffers!
- *
- * This function also plugs in the appropriate GetPointer, Get/PutRow and
- * Get/PutValues functions.
- */
-GLboolean
-_mesa_soft_renderbuffer_storage(struct gl_context *ctx, struct gl_renderbuffer *rb,
- GLenum internalFormat,
- GLuint width, GLuint height)
-{
- switch (internalFormat) {
- case GL_RGB:
- case GL_R3_G3_B2:
- case GL_RGB4:
- case GL_RGB5:
- case GL_RGB8:
- case GL_RGB10:
- case GL_RGB12:
- case GL_RGB16:
- rb->Format = MESA_FORMAT_RGB888;
- break;
- case GL_RGBA:
- case GL_RGBA2:
- case GL_RGBA4:
- case GL_RGB5_A1:
- case GL_RGBA8:
-#if 1
- case GL_RGB10_A2:
- case GL_RGBA12:
-#endif
- rb->Format = MESA_FORMAT_RGBA8888;
- break;
- case GL_RGBA16:
- case GL_RGBA16_SNORM:
- /* for accum buffer */
- rb->Format = MESA_FORMAT_SIGNED_RGBA_16;
- break;
-#if 0
- case GL_ALPHA8:
- rb->Format = MESA_FORMAT_A8;
- break;
-#endif
- case GL_STENCIL_INDEX:
- case GL_STENCIL_INDEX1_EXT:
- case GL_STENCIL_INDEX4_EXT:
- case GL_STENCIL_INDEX8_EXT:
- case GL_STENCIL_INDEX16_EXT:
- rb->Format = MESA_FORMAT_S8;
- break;
- case GL_DEPTH_COMPONENT:
- case GL_DEPTH_COMPONENT16:
- rb->Format = MESA_FORMAT_Z16;
- break;
- case GL_DEPTH_COMPONENT24:
- rb->Format = MESA_FORMAT_X8_Z24;
- break;
- case GL_DEPTH_COMPONENT32:
- rb->Format = MESA_FORMAT_Z32;
- break;
- case GL_DEPTH_STENCIL_EXT:
- case GL_DEPTH24_STENCIL8_EXT:
- rb->Format = MESA_FORMAT_Z24_S8;
- break;
- default:
- /* unsupported format */
- return GL_FALSE;
- }
-
- _mesa_set_renderbuffer_accessors(rb);
-
- ASSERT(rb->DataType);
- ASSERT(rb->GetPointer);
- ASSERT(rb->GetRow);
- ASSERT(rb->GetValues);
- ASSERT(rb->PutRow);
- ASSERT(rb->PutMonoRow);
- ASSERT(rb->PutValues);
- ASSERT(rb->PutMonoValues);
-
- /* free old buffer storage */
- if (rb->Data) {
- free(rb->Data);
- rb->Data = NULL;
- }
-
- rb->RowStride = width;
-
- if (width > 0 && height > 0) {
- /* allocate new buffer storage */
- rb->Data = malloc(width * height * _mesa_get_format_bytes(rb->Format));
-
- if (rb->Data == NULL) {
- rb->Width = 0;
- rb->Height = 0;
- rb->RowStride = 0;
- _mesa_error(ctx, GL_OUT_OF_MEMORY,
- "software renderbuffer allocation (%d x %d x %d)",
- width, height, _mesa_get_format_bytes(rb->Format));
- return GL_FALSE;
- }
- }
-
- rb->Width = width;
- rb->Height = height;
- rb->_BaseFormat = _mesa_base_fbo_format(ctx, internalFormat);
-
- if (rb->Name == 0 &&
- internalFormat == GL_RGBA16_SNORM &&
- rb->_BaseFormat == 0) {
- /* NOTE: This is a special case just for accumulation buffers.
- * This is a very limited use case- there's no snorm texturing or
- * rendering going on.
- */
- rb->_BaseFormat = GL_RGBA;
- }
- else {
- /* the internalFormat should have been error checked long ago */
- ASSERT(rb->_BaseFormat);
- }
-
- return GL_TRUE;
-}
-
-
-
-/**********************************************************************/
-/**********************************************************************/
-/**********************************************************************/
-
-
-/**
- * Here we utilize the gl_renderbuffer->Wrapper field to put an alpha
- * buffer wrapper around an existing RGB renderbuffer (hw or sw).
- *
- * When PutRow is called (for example), we store the alpha values in
- * this buffer, then pass on the PutRow call to the wrapped RGB
- * buffer.
- */
-
-
-static GLboolean
-alloc_storage_alpha8(struct gl_context *ctx, struct gl_renderbuffer *arb,
- GLenum internalFormat, GLuint width, GLuint height)
-{
- ASSERT(arb != arb->Wrapped);
- ASSERT(arb->Format == MESA_FORMAT_A8);
-
- /* first, pass the call to the wrapped RGB buffer */
- if (!arb->Wrapped->AllocStorage(ctx, arb->Wrapped, internalFormat,
- width, height)) {
- return GL_FALSE;
- }
-
- /* next, resize my alpha buffer */
- if (arb->Data) {
- free(arb->Data);
- }
-
- arb->Data = malloc(width * height * sizeof(GLubyte));
- if (arb->Data == NULL) {
- arb->Width = 0;
- arb->Height = 0;
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "software alpha buffer allocation");
- return GL_FALSE;
- }
-
- arb->Width = width;
- arb->Height = height;
- arb->RowStride = width;
-
- return GL_TRUE;
-}
-
-
-/**
- * Delete an alpha_renderbuffer object, as well as the wrapped RGB buffer.
- */
-static void
-delete_renderbuffer_alpha8(struct gl_renderbuffer *arb)
-{
- if (arb->Data) {
- free(arb->Data);
- }
- ASSERT(arb->Wrapped);
- ASSERT(arb != arb->Wrapped);
- arb->Wrapped->Delete(arb->Wrapped);
- arb->Wrapped = NULL;
- free(arb);
-}
-
-
-static void *
-get_pointer_alpha8(struct gl_context *ctx, struct gl_renderbuffer *arb,
- GLint x, GLint y)
-{
- return NULL; /* don't allow direct access! */
-}
-
-
-static void
-get_row_alpha8(struct gl_context *ctx, struct gl_renderbuffer *arb, GLuint count,
- GLint x, GLint y, void *values)
-{
- /* NOTE: 'values' is RGBA format! */
- const GLubyte *src = (const GLubyte *) arb->Data + y * arb->RowStride + x;
- GLubyte *dst = (GLubyte *) values;
- GLuint i;
- ASSERT(arb != arb->Wrapped);
- ASSERT(arb->DataType == GL_UNSIGNED_BYTE);
- /* first, pass the call to the wrapped RGB buffer */
- arb->Wrapped->GetRow(ctx, arb->Wrapped, count, x, y, values);
- /* second, fill in alpha values from this buffer! */
- for (i = 0; i < count; i++) {
- dst[i * 4 + 3] = src[i];
- }
-}
-
-
-static void
-get_values_alpha8(struct gl_context *ctx, struct gl_renderbuffer *arb, GLuint count,
- const GLint x[], const GLint y[], void *values)
-{
- GLubyte *dst = (GLubyte *) values;
- GLuint i;
- ASSERT(arb != arb->Wrapped);
- ASSERT(arb->DataType == GL_UNSIGNED_BYTE);
- /* first, pass the call to the wrapped RGB buffer */
- arb->Wrapped->GetValues(ctx, arb->Wrapped, count, x, y, values);
- /* second, fill in alpha values from this buffer! */
- for (i = 0; i < count; i++) {
- const GLubyte *src = (GLubyte *) arb->Data + y[i] * arb->RowStride + x[i];
- dst[i * 4 + 3] = *src;
- }
-}
-
-
-static void
-put_row_alpha8(struct gl_context *ctx, struct gl_renderbuffer *arb, GLuint count,
- GLint x, GLint y, const void *values, const GLubyte *mask)
-{
- const GLubyte *src = (const GLubyte *) values;
- GLubyte *dst = (GLubyte *) arb->Data + y * arb->RowStride + x;
- GLuint i;
- ASSERT(arb != arb->Wrapped);
- ASSERT(arb->DataType == GL_UNSIGNED_BYTE);
- /* first, pass the call to the wrapped RGB buffer */
- arb->Wrapped->PutRow(ctx, arb->Wrapped, count, x, y, values, mask);
- /* second, store alpha in our buffer */
- for (i = 0; i < count; i++) {
- if (!mask || mask[i]) {
- dst[i] = src[i * 4 + 3];
- }
- }
-}
-
-
-static void
-put_row_rgb_alpha8(struct gl_context *ctx, struct gl_renderbuffer *arb, GLuint count,
- GLint x, GLint y, const void *values, const GLubyte *mask)
-{
- const GLubyte *src = (const GLubyte *) values;
- GLubyte *dst = (GLubyte *) arb->Data + y * arb->RowStride + x;
- GLuint i;
- ASSERT(arb != arb->Wrapped);
- ASSERT(arb->DataType == GL_UNSIGNED_BYTE);
- /* first, pass the call to the wrapped RGB buffer */
- arb->Wrapped->PutRowRGB(ctx, arb->Wrapped, count, x, y, values, mask);
- /* second, store alpha in our buffer */
- for (i = 0; i < count; i++) {
- if (!mask || mask[i]) {
- dst[i] = src[i * 4 + 3];
- }
- }
-}
-
-
-static void
-put_mono_row_alpha8(struct gl_context *ctx, struct gl_renderbuffer *arb, GLuint count,
- GLint x, GLint y, const void *value, const GLubyte *mask)
-{
- const GLubyte val = ((const GLubyte *) value)[3];
- GLubyte *dst = (GLubyte *) arb->Data + y * arb->RowStride + x;
- ASSERT(arb != arb->Wrapped);
- ASSERT(arb->DataType == GL_UNSIGNED_BYTE);
- /* first, pass the call to the wrapped RGB buffer */
- arb->Wrapped->PutMonoRow(ctx, arb->Wrapped, count, x, y, value, mask);
- /* second, store alpha in our buffer */
- if (mask) {
- GLuint i;
- for (i = 0; i < count; i++) {
- if (mask[i]) {
- dst[i] = val;
- }
- }
- }
- else {
- memset(dst, val, count);
- }
-}
-
-
-static void
-put_values_alpha8(struct gl_context *ctx, struct gl_renderbuffer *arb, GLuint count,
- const GLint x[], const GLint y[],
- const void *values, const GLubyte *mask)
-{
- const GLubyte *src = (const GLubyte *) values;
- GLuint i;
- ASSERT(arb != arb->Wrapped);
- ASSERT(arb->DataType == GL_UNSIGNED_BYTE);
- /* first, pass the call to the wrapped RGB buffer */
- arb->Wrapped->PutValues(ctx, arb->Wrapped, count, x, y, values, mask);
- /* second, store alpha in our buffer */
- for (i = 0; i < count; i++) {
- if (!mask || mask[i]) {
- GLubyte *dst = (GLubyte *) arb->Data + y[i] * arb->RowStride + x[i];
- *dst = src[i * 4 + 3];
- }
- }
-}
-
-
-static void
-put_mono_values_alpha8(struct gl_context *ctx, struct gl_renderbuffer *arb,
- GLuint count, const GLint x[], const GLint y[],
- const void *value, const GLubyte *mask)
-{
- const GLubyte val = ((const GLubyte *) value)[3];
- GLuint i;
- ASSERT(arb != arb->Wrapped);
- ASSERT(arb->DataType == GL_UNSIGNED_BYTE);
- /* first, pass the call to the wrapped RGB buffer */
- arb->Wrapped->PutValues(ctx, arb->Wrapped, count, x, y, value, mask);
- /* second, store alpha in our buffer */
- for (i = 0; i < count; i++) {
- if (!mask || mask[i]) {
- GLubyte *dst = (GLubyte *) arb->Data + y[i] * arb->RowStride + x[i];
- *dst = val;
- }
- }
-}
-
-
-static void
-copy_buffer_alpha8(struct gl_renderbuffer* dst, struct gl_renderbuffer* src)
-{
- ASSERT(dst->Format == MESA_FORMAT_A8);
- ASSERT(src->Format == MESA_FORMAT_A8);
- ASSERT(dst->Width == src->Width);
- ASSERT(dst->Height == src->Height);
- ASSERT(dst->RowStride == src->RowStride);
-
- memcpy(dst->Data, src->Data, dst->RowStride * dst->Height * sizeof(GLubyte));
-}
-
-
-/**********************************************************************/
-/**********************************************************************/
-/**********************************************************************/
-
-
-/**
- * Default GetPointer routine. Always return NULL to indicate that
- * direct buffer access is not supported.
- */
-static void *
-nop_get_pointer(struct gl_context *ctx, struct gl_renderbuffer *rb, GLint x, GLint y)
-{
- return NULL;
-}
-
-
-/**
- * Initialize the fields of a gl_renderbuffer to default values.
- */
-void
-_mesa_init_renderbuffer(struct gl_renderbuffer *rb, GLuint name)
-{
- _glthread_INIT_MUTEX(rb->Mutex);
-
- rb->ClassID = 0;
- rb->Name = name;
- rb->RefCount = 0;
- rb->Delete = _mesa_delete_renderbuffer;
-
- /* The rest of these should be set later by the caller of this function or
- * the AllocStorage method:
- */
- rb->AllocStorage = NULL;
-
- rb->Width = 0;
- rb->Height = 0;
- rb->InternalFormat = GL_NONE;
- rb->Format = MESA_FORMAT_NONE;
-
- rb->DataType = GL_NONE;
- rb->Data = NULL;
-
- /* Point back to ourself so that we don't have to check for Wrapped==NULL
- * all over the drivers.
- */
- rb->Wrapped = rb;
-
- rb->GetPointer = nop_get_pointer;
- rb->GetRow = NULL;
- rb->GetValues = NULL;
- rb->PutRow = NULL;
- rb->PutRowRGB = NULL;
- rb->PutMonoRow = NULL;
- rb->PutValues = NULL;
- rb->PutMonoValues = NULL;
-}
-
-
-/**
- * Allocate a new gl_renderbuffer object. This can be used for user-created
- * renderbuffers or window-system renderbuffers.
- */
-struct gl_renderbuffer *
-_mesa_new_renderbuffer(struct gl_context *ctx, GLuint name)
-{
- struct gl_renderbuffer *rb = CALLOC_STRUCT(gl_renderbuffer);
- if (rb) {
- _mesa_init_renderbuffer(rb, name);
- }
- return rb;
-}
-
-
-/**
- * Delete a gl_framebuffer.
- * This is the default function for renderbuffer->Delete().
- */
-void
-_mesa_delete_renderbuffer(struct gl_renderbuffer *rb)
-{
- if (rb->Data) {
- free(rb->Data);
- }
- free(rb);
-}
-
-
-/**
- * Allocate a software-based renderbuffer. This is called via the
- * ctx->Driver.NewRenderbuffer() function when the user creates a new
- * renderbuffer.
- * This would not be used for hardware-based renderbuffers.
- */
-struct gl_renderbuffer *
-_mesa_new_soft_renderbuffer(struct gl_context *ctx, GLuint name)
-{
- struct gl_renderbuffer *rb = _mesa_new_renderbuffer(ctx, name);
- if (rb) {
- rb->AllocStorage = _mesa_soft_renderbuffer_storage;
- /* Normally, one would setup the PutRow, GetRow, etc functions here.
- * But we're doing that in the _mesa_soft_renderbuffer_storage() function
- * instead.
- */
- }
- return rb;
-}
-
-
-/**
- * Add software-based color renderbuffers to the given framebuffer.
- * This is a helper routine for device drivers when creating a
- * window system framebuffer (not a user-created render/framebuffer).
- * Once this function is called, you can basically forget about this
- * renderbuffer; core Mesa will handle all the buffer management and
- * rendering!
- */
-GLboolean
-_mesa_add_color_renderbuffers(struct gl_context *ctx, struct gl_framebuffer *fb,
- GLuint rgbBits, GLuint alphaBits,
- GLboolean frontLeft, GLboolean backLeft,
- GLboolean frontRight, GLboolean backRight)
-{
- gl_buffer_index b;
-
- if (rgbBits > 16 || alphaBits > 16) {
- _mesa_problem(ctx,
- "Unsupported bit depth in _mesa_add_color_renderbuffers");
- return GL_FALSE;
- }
-
- assert(MAX_COLOR_ATTACHMENTS >= 4);
-
- for (b = BUFFER_FRONT_LEFT; b <= BUFFER_BACK_RIGHT; b++) {
- struct gl_renderbuffer *rb;
-
- if (b == BUFFER_FRONT_LEFT && !frontLeft)
- continue;
- else if (b == BUFFER_BACK_LEFT && !backLeft)
- continue;
- else if (b == BUFFER_FRONT_RIGHT && !frontRight)
- continue;
- else if (b == BUFFER_BACK_RIGHT && !backRight)
- continue;
-
- assert(fb->Attachment[b].Renderbuffer == NULL);
-
- rb = _mesa_new_renderbuffer(ctx, 0);
- if (!rb) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "Allocating color buffer");
- return GL_FALSE;
- }
-
- if (rgbBits <= 8) {
- if (alphaBits)
- rb->Format = MESA_FORMAT_RGBA8888;
- else
- rb->Format = MESA_FORMAT_RGB888;
- }
- else {
- assert(rgbBits <= 16);
- rb->Format = MESA_FORMAT_NONE; /*XXX RGBA16;*/
- }
- rb->InternalFormat = GL_RGBA;
-
- rb->AllocStorage = _mesa_soft_renderbuffer_storage;
- _mesa_add_renderbuffer(fb, b, rb);
- }
-
- return GL_TRUE;
-}
-
-
-/**
- * Add software-based alpha renderbuffers to the given framebuffer.
- * This is a helper routine for device drivers when creating a
- * window system framebuffer (not a user-created render/framebuffer).
- * Once this function is called, you can basically forget about this
- * renderbuffer; core Mesa will handle all the buffer management and
- * rendering!
- */
-GLboolean
-_mesa_add_alpha_renderbuffers(struct gl_context *ctx, struct gl_framebuffer *fb,
- GLuint alphaBits,
- GLboolean frontLeft, GLboolean backLeft,
- GLboolean frontRight, GLboolean backRight)
-{
- gl_buffer_index b;
-
- /* for window system framebuffers only! */
- assert(fb->Name == 0);
-
- if (alphaBits > 8) {
- _mesa_problem(ctx,
- "Unsupported bit depth in _mesa_add_alpha_renderbuffers");
- return GL_FALSE;
- }
-
- assert(MAX_COLOR_ATTACHMENTS >= 4);
-
- /* Wrap each of the RGB color buffers with an alpha renderbuffer.
- */
- for (b = BUFFER_FRONT_LEFT; b <= BUFFER_BACK_RIGHT; b++) {
- struct gl_renderbuffer *arb;
-
- if (b == BUFFER_FRONT_LEFT && !frontLeft)
- continue;
- else if (b == BUFFER_BACK_LEFT && !backLeft)
- continue;
- else if (b == BUFFER_FRONT_RIGHT && !frontRight)
- continue;
- else if (b == BUFFER_BACK_RIGHT && !backRight)
- continue;
-
- /* the RGB buffer to wrap must already exist!! */
- assert(fb->Attachment[b].Renderbuffer);
-
- /* only GLubyte supported for now */
- assert(fb->Attachment[b].Renderbuffer->DataType == GL_UNSIGNED_BYTE);
-
- /* allocate alpha renderbuffer */
- arb = _mesa_new_renderbuffer(ctx, 0);
- if (!arb) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "Allocating alpha buffer");
- return GL_FALSE;
- }
-
- /* wrap the alpha renderbuffer around the RGB renderbuffer */
- arb->Wrapped = fb->Attachment[b].Renderbuffer;
-
- /* Set up my alphabuffer fields and plug in my functions.
- * The functions will put/get the alpha values from/to RGBA arrays
- * and then call the wrapped buffer's functions to handle the RGB
- * values.
- */
- arb->InternalFormat = arb->Wrapped->InternalFormat;
- arb->Format = MESA_FORMAT_A8;
- arb->DataType = arb->Wrapped->DataType;
- arb->AllocStorage = alloc_storage_alpha8;
- arb->Delete = delete_renderbuffer_alpha8;
- arb->GetPointer = get_pointer_alpha8;
- arb->GetRow = get_row_alpha8;
- arb->GetValues = get_values_alpha8;
- arb->PutRow = put_row_alpha8;
- arb->PutRowRGB = put_row_rgb_alpha8;
- arb->PutMonoRow = put_mono_row_alpha8;
- arb->PutValues = put_values_alpha8;
- arb->PutMonoValues = put_mono_values_alpha8;
-
- /* clear the pointer to avoid assertion/sanity check failure later */
- fb->Attachment[b].Renderbuffer = NULL;
-
- /* plug the alpha renderbuffer into the colorbuffer attachment */
- _mesa_add_renderbuffer(fb, b, arb);
- }
-
- return GL_TRUE;
-}
-
-
-/**
- * For framebuffers that use a software alpha channel wrapper
- * created by _mesa_add_alpha_renderbuffer or _mesa_add_soft_renderbuffers,
- * copy the back buffer alpha channel into the front buffer alpha channel.
- */
-void
-_mesa_copy_soft_alpha_renderbuffers(struct gl_context *ctx, struct gl_framebuffer *fb)
-{
- if (fb->Attachment[BUFFER_FRONT_LEFT].Renderbuffer &&
- fb->Attachment[BUFFER_BACK_LEFT].Renderbuffer)
- copy_buffer_alpha8(fb->Attachment[BUFFER_FRONT_LEFT].Renderbuffer,
- fb->Attachment[BUFFER_BACK_LEFT].Renderbuffer);
-
-
- if (fb->Attachment[BUFFER_FRONT_RIGHT].Renderbuffer &&
- fb->Attachment[BUFFER_BACK_RIGHT].Renderbuffer)
- copy_buffer_alpha8(fb->Attachment[BUFFER_FRONT_RIGHT].Renderbuffer,
- fb->Attachment[BUFFER_BACK_RIGHT].Renderbuffer);
-}
-
-
-/**
- * Add a software-based depth renderbuffer to the given framebuffer.
- * This is a helper routine for device drivers when creating a
- * window system framebuffer (not a user-created render/framebuffer).
- * Once this function is called, you can basically forget about this
- * renderbuffer; core Mesa will handle all the buffer management and
- * rendering!
- */
-GLboolean
-_mesa_add_depth_renderbuffer(struct gl_context *ctx, struct gl_framebuffer *fb,
- GLuint depthBits)
-{
- struct gl_renderbuffer *rb;
-
- if (depthBits > 32) {
- _mesa_problem(ctx,
- "Unsupported depthBits in _mesa_add_depth_renderbuffer");
- return GL_FALSE;
- }
-
- assert(fb->Attachment[BUFFER_DEPTH].Renderbuffer == NULL);
-
- rb = _mesa_new_renderbuffer(ctx, 0);
- if (!rb) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "Allocating depth buffer");
- return GL_FALSE;
- }
-
- if (depthBits <= 16) {
- rb->Format = MESA_FORMAT_Z16;
- rb->InternalFormat = GL_DEPTH_COMPONENT16;
- }
- else if (depthBits <= 24) {
- rb->Format = MESA_FORMAT_X8_Z24;
- rb->InternalFormat = GL_DEPTH_COMPONENT24;
- }
- else {
- rb->Format = MESA_FORMAT_Z32;
- rb->InternalFormat = GL_DEPTH_COMPONENT32;
- }
-
- rb->AllocStorage = _mesa_soft_renderbuffer_storage;
- _mesa_add_renderbuffer(fb, BUFFER_DEPTH, rb);
-
- return GL_TRUE;
-}
-
-
-/**
- * Add a software-based stencil renderbuffer to the given framebuffer.
- * This is a helper routine for device drivers when creating a
- * window system framebuffer (not a user-created render/framebuffer).
- * Once this function is called, you can basically forget about this
- * renderbuffer; core Mesa will handle all the buffer management and
- * rendering!
- */
-GLboolean
-_mesa_add_stencil_renderbuffer(struct gl_context *ctx, struct gl_framebuffer *fb,
- GLuint stencilBits)
-{
- struct gl_renderbuffer *rb;
-
- if (stencilBits > 16) {
- _mesa_problem(ctx,
- "Unsupported stencilBits in _mesa_add_stencil_renderbuffer");
- return GL_FALSE;
- }
-
- assert(fb->Attachment[BUFFER_STENCIL].Renderbuffer == NULL);
-
- rb = _mesa_new_renderbuffer(ctx, 0);
- if (!rb) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "Allocating stencil buffer");
- return GL_FALSE;
- }
-
- assert(stencilBits <= 8);
- rb->Format = MESA_FORMAT_S8;
- rb->InternalFormat = GL_STENCIL_INDEX8;
-
- rb->AllocStorage = _mesa_soft_renderbuffer_storage;
- _mesa_add_renderbuffer(fb, BUFFER_STENCIL, rb);
-
- return GL_TRUE;
-}
-
-
-/**
- * Add a software-based accumulation renderbuffer to the given framebuffer.
- * This is a helper routine for device drivers when creating a
- * window system framebuffer (not a user-created render/framebuffer).
- * Once this function is called, you can basically forget about this
- * renderbuffer; core Mesa will handle all the buffer management and
- * rendering!
- */
-GLboolean
-_mesa_add_accum_renderbuffer(struct gl_context *ctx, struct gl_framebuffer *fb,
- GLuint redBits, GLuint greenBits,
- GLuint blueBits, GLuint alphaBits)
-{
- struct gl_renderbuffer *rb;
-
- if (redBits > 16 || greenBits > 16 || blueBits > 16 || alphaBits > 16) {
- _mesa_problem(ctx,
- "Unsupported accumBits in _mesa_add_accum_renderbuffer");
- return GL_FALSE;
- }
-
- assert(fb->Attachment[BUFFER_ACCUM].Renderbuffer == NULL);
-
- rb = _mesa_new_renderbuffer(ctx, 0);
- if (!rb) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "Allocating accum buffer");
- return GL_FALSE;
- }
-
- rb->Format = MESA_FORMAT_SIGNED_RGBA_16;
- rb->InternalFormat = GL_RGBA16_SNORM;
- rb->AllocStorage = _mesa_soft_renderbuffer_storage;
- _mesa_add_renderbuffer(fb, BUFFER_ACCUM, rb);
-
- return GL_TRUE;
-}
-
-
-
-/**
- * Add a software-based aux renderbuffer to the given framebuffer.
- * This is a helper routine for device drivers when creating a
- * window system framebuffer (not a user-created render/framebuffer).
- * Once this function is called, you can basically forget about this
- * renderbuffer; core Mesa will handle all the buffer management and
- * rendering!
- *
- * NOTE: color-index aux buffers not supported.
- */
-GLboolean
-_mesa_add_aux_renderbuffers(struct gl_context *ctx, struct gl_framebuffer *fb,
- GLuint colorBits, GLuint numBuffers)
-{
- GLuint i;
-
- if (colorBits > 16) {
- _mesa_problem(ctx,
- "Unsupported accumBits in _mesa_add_aux_renderbuffers");
- return GL_FALSE;
- }
-
- assert(numBuffers <= MAX_AUX_BUFFERS);
-
- for (i = 0; i < numBuffers; i++) {
- struct gl_renderbuffer *rb = _mesa_new_renderbuffer(ctx, 0);
-
- assert(fb->Attachment[BUFFER_AUX0 + i].Renderbuffer == NULL);
-
- if (!rb) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "Allocating aux buffer");
- return GL_FALSE;
- }
-
- assert (colorBits <= 8);
- rb->Format = MESA_FORMAT_RGBA8888;
- rb->InternalFormat = GL_RGBA;
-
- rb->AllocStorage = _mesa_soft_renderbuffer_storage;
- _mesa_add_renderbuffer(fb, BUFFER_AUX0 + i, rb);
- }
- return GL_TRUE;
-}
-
-
-/**
- * Create/attach software-based renderbuffers to the given framebuffer.
- * This is a helper routine for device drivers. Drivers can just as well
- * call the individual _mesa_add_*_renderbuffer() routines directly.
- */
-void
-_mesa_add_soft_renderbuffers(struct gl_framebuffer *fb,
- GLboolean color,
- GLboolean depth,
- GLboolean stencil,
- GLboolean accum,
- GLboolean alpha,
- GLboolean aux)
-{
- GLboolean frontLeft = GL_TRUE;
- GLboolean backLeft = fb->Visual.doubleBufferMode;
- GLboolean frontRight = fb->Visual.stereoMode;
- GLboolean backRight = fb->Visual.stereoMode && fb->Visual.doubleBufferMode;
-
- if (color) {
- assert(fb->Visual.redBits == fb->Visual.greenBits);
- assert(fb->Visual.redBits == fb->Visual.blueBits);
- _mesa_add_color_renderbuffers(NULL, fb,
- fb->Visual.redBits,
- fb->Visual.alphaBits,
- frontLeft, backLeft,
- frontRight, backRight);
- }
-
- if (depth) {
- assert(fb->Visual.depthBits > 0);
- _mesa_add_depth_renderbuffer(NULL, fb, fb->Visual.depthBits);
- }
-
- if (stencil) {
- assert(fb->Visual.stencilBits > 0);
- _mesa_add_stencil_renderbuffer(NULL, fb, fb->Visual.stencilBits);
- }
-
- if (accum) {
- assert(fb->Visual.accumRedBits > 0);
- assert(fb->Visual.accumGreenBits > 0);
- assert(fb->Visual.accumBlueBits > 0);
- _mesa_add_accum_renderbuffer(NULL, fb,
- fb->Visual.accumRedBits,
- fb->Visual.accumGreenBits,
- fb->Visual.accumBlueBits,
- fb->Visual.accumAlphaBits);
- }
-
- if (aux) {
- assert(fb->Visual.numAuxBuffers > 0);
- _mesa_add_aux_renderbuffers(NULL, fb, fb->Visual.redBits,
- fb->Visual.numAuxBuffers);
- }
-
- if (alpha) {
- assert(fb->Visual.alphaBits > 0);
- _mesa_add_alpha_renderbuffers(NULL, fb, fb->Visual.alphaBits,
- frontLeft, backLeft,
- frontRight, backRight);
- }
-
-#if 0
- if (multisample) {
- /* maybe someday */
- }
-#endif
-}
-
-
-/**
- * Attach a renderbuffer to a framebuffer.
- * \param bufferName one of the BUFFER_x tokens
- */
-void
-_mesa_add_renderbuffer(struct gl_framebuffer *fb,
- gl_buffer_index bufferName, struct gl_renderbuffer *rb)
-{
- assert(fb);
- assert(rb);
- assert(bufferName < BUFFER_COUNT);
-
- /* There should be no previous renderbuffer on this attachment point,
- * with the exception of depth/stencil since the same renderbuffer may
- * be used for both.
- */
- assert(bufferName == BUFFER_DEPTH ||
- bufferName == BUFFER_STENCIL ||
- fb->Attachment[bufferName].Renderbuffer == NULL);
-
- /* winsys vs. user-created buffer cross check */
- if (fb->Name) {
- assert(rb->Name);
- }
- else {
- assert(!rb->Name);
- }
-
- fb->Attachment[bufferName].Type = GL_RENDERBUFFER_EXT;
- fb->Attachment[bufferName].Complete = GL_TRUE;
- _mesa_reference_renderbuffer(&fb->Attachment[bufferName].Renderbuffer, rb);
-}
-
-
-/**
- * Remove the named renderbuffer from the given framebuffer.
- * \param bufferName one of the BUFFER_x tokens
- */
-void
-_mesa_remove_renderbuffer(struct gl_framebuffer *fb,
- gl_buffer_index bufferName)
-{
- struct gl_renderbuffer *rb;
-
- assert(bufferName < BUFFER_COUNT);
-
- rb = fb->Attachment[bufferName].Renderbuffer;
- if (!rb)
- return;
-
- _mesa_reference_renderbuffer(&rb, NULL);
-
- fb->Attachment[bufferName].Renderbuffer = NULL;
-}
-
-
-/**
- * Set *ptr to point to rb. If *ptr points to another renderbuffer,
- * dereference that buffer first. The new renderbuffer's refcount will
- * be incremented. The old renderbuffer's refcount will be decremented.
- */
-void
-_mesa_reference_renderbuffer(struct gl_renderbuffer **ptr,
- struct gl_renderbuffer *rb)
-{
- assert(ptr);
- if (*ptr == rb) {
- /* no change */
- return;
- }
-
- if (*ptr) {
- /* Unreference the old renderbuffer */
- GLboolean deleteFlag = GL_FALSE;
- struct gl_renderbuffer *oldRb = *ptr;
-
- _glthread_LOCK_MUTEX(oldRb->Mutex);
- ASSERT(oldRb->RefCount > 0);
- oldRb->RefCount--;
- /*printf("RB DECR %p (%d) to %d\n", (void*) oldRb, oldRb->Name, oldRb->RefCount);*/
- deleteFlag = (oldRb->RefCount == 0);
- _glthread_UNLOCK_MUTEX(oldRb->Mutex);
-
- if (deleteFlag) {
- oldRb->Delete(oldRb);
- }
-
- *ptr = NULL;
- }
- assert(!*ptr);
-
- if (rb) {
- /* reference new renderbuffer */
- _glthread_LOCK_MUTEX(rb->Mutex);
- rb->RefCount++;
- /*printf("RB INCR %p (%d) to %d\n", (void*) rb, rb->Name, rb->RefCount);*/
- _glthread_UNLOCK_MUTEX(rb->Mutex);
- *ptr = rb;
- }
-}
-
-
-/**
- * Create a new combined depth/stencil renderbuffer for implementing
- * the GL_EXT_packed_depth_stencil extension.
- * \return new depth/stencil renderbuffer
- */
-struct gl_renderbuffer *
-_mesa_new_depthstencil_renderbuffer(struct gl_context *ctx, GLuint name)
-{
- struct gl_renderbuffer *dsrb;
-
- dsrb = _mesa_new_renderbuffer(ctx, name);
- if (!dsrb)
- return NULL;
-
- /* init fields not covered by _mesa_new_renderbuffer() */
- dsrb->InternalFormat = GL_DEPTH24_STENCIL8_EXT;
- dsrb->Format = MESA_FORMAT_Z24_S8;
- dsrb->AllocStorage = _mesa_soft_renderbuffer_storage;
-
- return dsrb;
-}
+/*
+ * Mesa 3-D graphics library
+ * Version: 6.5
+ *
+ * Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+
+/**
+ * Functions for allocating/managing renderbuffers.
+ * Also, routines for reading/writing software-based renderbuffer data as
+ * ubytes, ushorts, uints, etc.
+ *
+ * The 'alpha8' renderbuffer is interesting. It's used to add a software-based
+ * alpha channel to RGB renderbuffers. This is done by wrapping the RGB
+ * renderbuffer with the alpha renderbuffer. We can do this because of the
+ * OO-nature of renderbuffers.
+ *
+ * Down the road we'll use this for run-time support of 8, 16 and 32-bit
+ * color channels. For example, Mesa may use 32-bit/float color channels
+ * internally (swrast) and use wrapper renderbuffers to convert 32-bit
+ * values down to 16 or 8-bit values for whatever kind of framebuffer we have.
+ */
+
+
+#include "glheader.h"
+#include "imports.h"
+#include "context.h"
+#include "fbobject.h"
+#include "formats.h"
+#include "mtypes.h"
+#include "renderbuffer.h"
+
+
+/*
+ * Routines for get/put values in common buffer formats follow.
+ */
+
+/* Returns a bytes per pixel of the DataType in the get/put span
+ * functions for at least a subset of the available combinations a
+ * renderbuffer can have.
+ *
+ * It would be nice to see gl_renderbuffer start talking about a
+ * gl_format instead of a GLenum DataType.
+ */
+static int
+get_datatype_bytes(struct gl_renderbuffer *rb)
+{
+ int component_size;
+
+ switch (rb->DataType) {
+ case GL_FLOAT:
+ case GL_UNSIGNED_INT:
+ case GL_UNSIGNED_INT_24_8_EXT:
+ component_size = 4;
+ break;
+ case GL_UNSIGNED_SHORT:
+ component_size = 2;
+ break;
+ case GL_UNSIGNED_BYTE:
+ component_size = 1;
+ break;
+ default:
+ component_size = 1;
+ assert(0);
+ }
+
+ switch (rb->_BaseFormat) {
+ case GL_DEPTH_COMPONENT:
+ case GL_DEPTH_STENCIL:
+ return component_size;
+ default:
+ return 4 * component_size;
+ }
+}
+
+/* This is commonly used by most of the accessors. */
+static void *
+get_pointer_generic(struct gl_context *ctx, struct gl_renderbuffer *rb,
+ GLint x, GLint y)
+{
+ if (!rb->Data)
+ return NULL;
+
+ return ((char *) rb->Data +
+ (y * rb->RowStride + x) * _mesa_get_format_bytes(rb->Format));
+}
+
+/* GetRow() implementation for formats where DataType matches the rb->Format.
+ */
+static void
+get_row_generic(struct gl_context *ctx, struct gl_renderbuffer *rb,
+ GLuint count, GLint x, GLint y, void *values)
+{
+ void *src = rb->GetPointer(ctx, rb, x, y);
+ memcpy(values, src, count * _mesa_get_format_bytes(rb->Format));
+}
+
+/* Only used for float textures currently, but might also be used for
+ * RGBA8888, RGBA16, etc.
+ */
+static void
+get_values_generic(struct gl_context *ctx, struct gl_renderbuffer *rb,
+ GLuint count, const GLint x[], const GLint y[], void *values)
+{
+ int format_bytes = _mesa_get_format_bytes(rb->Format) / sizeof(GLfloat);
+ GLuint i;
+
+ for (i = 0; i < count; i++) {
+ const void *src = rb->GetPointer(ctx, rb, x[i], y[i]);
+ char *dst = (char *) values + i * format_bytes;
+ memcpy(dst, src, format_bytes);
+ }
+}
+
+/* For the GL_RED/GL_RG/GL_RGB format/DataType combinations (and
+ * GL_LUMINANCE/GL_INTENSITY?), the Put functions are a matter of
+ * storing those initial components of the value per pixel into the
+ * destination.
+ */
+static void
+put_row_generic(struct gl_context *ctx, struct gl_renderbuffer *rb,
+ GLuint count, GLint x, GLint y,
+ const void *values, const GLubyte *mask)
+{
+ void *row = rb->GetPointer(ctx, rb, x, y);
+ int format_bytes = _mesa_get_format_bytes(rb->Format) / sizeof(GLfloat);
+ int datatype_bytes = get_datatype_bytes(rb);
+ unsigned int i;
+
+ if (mask) {
+ for (i = 0; i < count; i++) {
+ char *dst = (char *) row + i * format_bytes;
+ const char *src = (const char *) values + i * datatype_bytes;
+
+ if (mask[i]) {
+ memcpy(dst, src, format_bytes);
+ }
+ }
+ }
+ else {
+ for (i = 0; i < count; i++) {
+ char *dst = (char *) row + i * format_bytes;
+ const char *src = (const char *) values + i * datatype_bytes;
+ memcpy(dst, src, format_bytes);
+ }
+ }
+}
+
+static void
+put_mono_row_generic(struct gl_context *ctx, struct gl_renderbuffer *rb,
+ GLuint count, GLint x, GLint y,
+ const void *value, const GLubyte *mask)
+{
+ void *row = rb->GetPointer(ctx, rb, x, y);
+ int format_bytes = _mesa_get_format_bytes(rb->Format) / sizeof(GLfloat);
+ unsigned int i;
+
+ if (mask) {
+ for (i = 0; i < count; i++) {
+ char *dst = (char *) row + i * format_bytes;
+ if (mask[i]) {
+ memcpy(dst, value, format_bytes);
+ }
+ }
+ }
+ else {
+ for (i = 0; i < count; i++) {
+ char *dst = (char *) row + i * format_bytes;
+ memcpy(dst, value, format_bytes);
+ }
+ }
+}
+
+
+static void
+put_values_generic(struct gl_context *ctx, struct gl_renderbuffer *rb,
+ GLuint count, const GLint x[], const GLint y[],
+ const void *values, const GLubyte *mask)
+{
+ int format_bytes = _mesa_get_format_bytes(rb->Format) / sizeof(GLfloat);
+ int datatype_bytes = get_datatype_bytes(rb);
+ unsigned int i;
+
+ for (i = 0; i < count; i++) {
+ if (!mask || mask[i]) {
+ void *dst = rb->GetPointer(ctx, rb, x[i], y[i]);
+ const char *src = (const char *) values + i * datatype_bytes;
+ memcpy(dst, src, format_bytes);
+ }
+ }
+}
+
+
+static void
+put_mono_values_generic(struct gl_context *ctx,
+ struct gl_renderbuffer *rb,
+ GLuint count, const GLint x[], const GLint y[],
+ const void *value, const GLubyte *mask)
+{
+ int format_bytes = _mesa_get_format_bytes(rb->Format) / sizeof(GLfloat);
+ unsigned int i;
+
+ for (i = 0; i < count; i++) {
+ if (!mask || mask[i]) {
+ void *dst = rb->GetPointer(ctx, rb, x[i], y[i]);
+ memcpy(dst, value, format_bytes);
+ }
+ }
+}
+
+/**********************************************************************
+ * Functions for buffers of 1 X GLubyte values.
+ * Typically stencil.
+ */
+
+static void
+get_values_ubyte(struct gl_context *ctx, struct gl_renderbuffer *rb, GLuint count,
+ const GLint x[], const GLint y[], void *values)
+{
+ GLubyte *dst = (GLubyte *) values;
+ GLuint i;
+ ASSERT(rb->DataType == GL_UNSIGNED_BYTE);
+ for (i = 0; i < count; i++) {
+ const GLubyte *src = (GLubyte *) rb->Data + y[i] * rb->RowStride + x[i];
+ dst[i] = *src;
+ }
+}
+
+
+static void
+put_row_ubyte(struct gl_context *ctx, struct gl_renderbuffer *rb, GLuint count,
+ GLint x, GLint y, const void *values, const GLubyte *mask)
+{
+ const GLubyte *src = (const GLubyte *) values;
+ GLubyte *dst = (GLubyte *) rb->Data + y * rb->RowStride + x;
+ ASSERT(rb->DataType == GL_UNSIGNED_BYTE);
+ if (mask) {
+ GLuint i;
+ for (i = 0; i < count; i++) {
+ if (mask[i]) {
+ dst[i] = src[i];
+ }
+ }
+ }
+ else {
+ memcpy(dst, values, count * sizeof(GLubyte));
+ }
+}
+
+
+static void
+put_mono_row_ubyte(struct gl_context *ctx, struct gl_renderbuffer *rb, GLuint count,
+ GLint x, GLint y, const void *value, const GLubyte *mask)
+{
+ const GLubyte val = *((const GLubyte *) value);
+ GLubyte *dst = (GLubyte *) rb->Data + y * rb->RowStride + x;
+ ASSERT(rb->DataType == GL_UNSIGNED_BYTE);
+ if (mask) {
+ GLuint i;
+ for (i = 0; i < count; i++) {
+ if (mask[i]) {
+ dst[i] = val;
+ }
+ }
+ }
+ else {
+ GLuint i;
+ for (i = 0; i < count; i++) {
+ dst[i] = val;
+ }
+ }
+}
+
+
+static void
+put_values_ubyte(struct gl_context *ctx, struct gl_renderbuffer *rb, GLuint count,
+ const GLint x[], const GLint y[],
+ const void *values, const GLubyte *mask)
+{
+ const GLubyte *src = (const GLubyte *) values;
+ GLuint i;
+ ASSERT(rb->DataType == GL_UNSIGNED_BYTE);
+ for (i = 0; i < count; i++) {
+ if (!mask || mask[i]) {
+ GLubyte *dst = (GLubyte *) rb->Data + y[i] * rb->RowStride + x[i];
+ *dst = src[i];
+ }
+ }
+}
+
+
+static void
+put_mono_values_ubyte(struct gl_context *ctx, struct gl_renderbuffer *rb, GLuint count,
+ const GLint x[], const GLint y[],
+ const void *value, const GLubyte *mask)
+{
+ const GLubyte val = *((const GLubyte *) value);
+ GLuint i;
+ ASSERT(rb->DataType == GL_UNSIGNED_BYTE);
+ for (i = 0; i < count; i++) {
+ if (!mask || mask[i]) {
+ GLubyte *dst = (GLubyte *) rb->Data + y[i] * rb->RowStride + x[i];
+ *dst = val;
+ }
+ }
+}
+
+
+/**********************************************************************
+ * Functions for buffers of 1 X GLushort values.
+ * Typically depth/Z.
+ */
+
+static void
+get_values_ushort(struct gl_context *ctx, struct gl_renderbuffer *rb, GLuint count,
+ const GLint x[], const GLint y[], void *values)
+{
+ GLushort *dst = (GLushort *) values;
+ GLuint i;
+ ASSERT(rb->DataType == GL_UNSIGNED_SHORT);
+ for (i = 0; i < count; i++) {
+ const GLushort *src = (GLushort *) rb->Data + y[i] * rb->RowStride + x[i];
+ dst[i] = *src;
+ }
+}
+
+
+static void
+put_row_ushort(struct gl_context *ctx, struct gl_renderbuffer *rb, GLuint count,
+ GLint x, GLint y, const void *values, const GLubyte *mask)
+{
+ const GLushort *src = (const GLushort *) values;
+ GLushort *dst = (GLushort *) rb->Data + y * rb->RowStride + x;
+ ASSERT(rb->DataType == GL_UNSIGNED_SHORT);
+ if (mask) {
+ GLuint i;
+ for (i = 0; i < count; i++) {
+ if (mask[i]) {
+ dst[i] = src[i];
+ }
+ }
+ }
+ else {
+ memcpy(dst, src, count * sizeof(GLushort));
+ }
+}
+
+
+static void
+put_mono_row_ushort(struct gl_context *ctx, struct gl_renderbuffer *rb, GLuint count,
+ GLint x, GLint y, const void *value, const GLubyte *mask)
+{
+ const GLushort val = *((const GLushort *) value);
+ GLushort *dst = (GLushort *) rb->Data + y * rb->RowStride + x;
+ ASSERT(rb->DataType == GL_UNSIGNED_SHORT);
+ if (mask) {
+ GLuint i;
+ for (i = 0; i < count; i++) {
+ if (mask[i]) {
+ dst[i] = val;
+ }
+ }
+ }
+ else {
+ GLuint i;
+ for (i = 0; i < count; i++) {
+ dst[i] = val;
+ }
+ }
+}
+
+
+static void
+put_values_ushort(struct gl_context *ctx, struct gl_renderbuffer *rb, GLuint count,
+ const GLint x[], const GLint y[], const void *values,
+ const GLubyte *mask)
+{
+ const GLushort *src = (const GLushort *) values;
+ GLuint i;
+ ASSERT(rb->DataType == GL_UNSIGNED_SHORT);
+ for (i = 0; i < count; i++) {
+ if (!mask || mask[i]) {
+ GLushort *dst = (GLushort *) rb->Data + y[i] * rb->RowStride + x[i];
+ *dst = src[i];
+ }
+ }
+}
+
+
+static void
+put_mono_values_ushort(struct gl_context *ctx, struct gl_renderbuffer *rb,
+ GLuint count, const GLint x[], const GLint y[],
+ const void *value, const GLubyte *mask)
+{
+ const GLushort val = *((const GLushort *) value);
+ ASSERT(rb->DataType == GL_UNSIGNED_SHORT);
+ if (mask) {
+ GLuint i;
+ for (i = 0; i < count; i++) {
+ if (mask[i]) {
+ GLushort *dst = (GLushort *) rb->Data + y[i] * rb->RowStride + x[i];
+ *dst = val;
+ }
+ }
+ }
+ else {
+ GLuint i;
+ for (i = 0; i < count; i++) {
+ GLushort *dst = (GLushort *) rb->Data + y[i] * rb->RowStride + x[i];
+ *dst = val;
+ }
+ }
+}
+
+
+/**********************************************************************
+ * Functions for buffers of 1 X GLuint values.
+ * Typically depth/Z or color index.
+ */
+
+static void
+get_values_uint(struct gl_context *ctx, struct gl_renderbuffer *rb, GLuint count,
+ const GLint x[], const GLint y[], void *values)
+{
+ GLuint *dst = (GLuint *) values;
+ GLuint i;
+ ASSERT(rb->DataType == GL_UNSIGNED_INT ||
+ rb->DataType == GL_UNSIGNED_INT_24_8_EXT);
+ for (i = 0; i < count; i++) {
+ const GLuint *src = (GLuint *) rb->Data + y[i] * rb->RowStride + x[i];
+ dst[i] = *src;
+ }
+}
+
+
+static void
+put_row_uint(struct gl_context *ctx, struct gl_renderbuffer *rb, GLuint count,
+ GLint x, GLint y, const void *values, const GLubyte *mask)
+{
+ const GLuint *src = (const GLuint *) values;
+ GLuint *dst = (GLuint *) rb->Data + y * rb->RowStride + x;
+ ASSERT(rb->DataType == GL_UNSIGNED_INT ||
+ rb->DataType == GL_UNSIGNED_INT_24_8_EXT);
+ if (mask) {
+ GLuint i;
+ for (i = 0; i < count; i++) {
+ if (mask[i]) {
+ dst[i] = src[i];
+ }
+ }
+ }
+ else {
+ memcpy(dst, src, count * sizeof(GLuint));
+ }
+}
+
+
+static void
+put_mono_row_uint(struct gl_context *ctx, struct gl_renderbuffer *rb, GLuint count,
+ GLint x, GLint y, const void *value, const GLubyte *mask)
+{
+ const GLuint val = *((const GLuint *) value);
+ GLuint *dst = (GLuint *) rb->Data + y * rb->RowStride + x;
+ ASSERT(rb->DataType == GL_UNSIGNED_INT ||
+ rb->DataType == GL_UNSIGNED_INT_24_8_EXT);
+ if (mask) {
+ GLuint i;
+ for (i = 0; i < count; i++) {
+ if (mask[i]) {
+ dst[i] = val;
+ }
+ }
+ }
+ else {
+ GLuint i;
+ for (i = 0; i < count; i++) {
+ dst[i] = val;
+ }
+ }
+}
+
+
+static void
+put_values_uint(struct gl_context *ctx, struct gl_renderbuffer *rb, GLuint count,
+ const GLint x[], const GLint y[], const void *values,
+ const GLubyte *mask)
+{
+ const GLuint *src = (const GLuint *) values;
+ GLuint i;
+ ASSERT(rb->DataType == GL_UNSIGNED_INT ||
+ rb->DataType == GL_UNSIGNED_INT_24_8_EXT);
+ for (i = 0; i < count; i++) {
+ if (!mask || mask[i]) {
+ GLuint *dst = (GLuint *) rb->Data + y[i] * rb->RowStride + x[i];
+ *dst = src[i];
+ }
+ }
+}
+
+
+static void
+put_mono_values_uint(struct gl_context *ctx, struct gl_renderbuffer *rb, GLuint count,
+ const GLint x[], const GLint y[], const void *value,
+ const GLubyte *mask)
+{
+ const GLuint val = *((const GLuint *) value);
+ GLuint i;
+ ASSERT(rb->DataType == GL_UNSIGNED_INT ||
+ rb->DataType == GL_UNSIGNED_INT_24_8_EXT);
+ for (i = 0; i < count; i++) {
+ if (!mask || mask[i]) {
+ GLuint *dst = (GLuint *) rb->Data + y[i] * rb->RowStride + x[i];
+ *dst = val;
+ }
+ }
+}
+
+
+/**********************************************************************
+ * Functions for buffers of 3 X GLubyte (or GLbyte) values.
+ * Typically color buffers.
+ * NOTE: the incoming and outgoing colors are RGBA! We ignore incoming
+ * alpha values and return 255 for outgoing alpha values.
+ */
+
+static void *
+get_pointer_ubyte3(struct gl_context *ctx, struct gl_renderbuffer *rb,
+ GLint x, GLint y)
+{
+ ASSERT(rb->Format == MESA_FORMAT_RGB888);
+ /* No direct access since this buffer is RGB but caller will be
+ * treating it as if it were RGBA.
+ */
+ return NULL;
+}
+
+
+static void
+get_row_ubyte3(struct gl_context *ctx, struct gl_renderbuffer *rb, GLuint count,
+ GLint x, GLint y, void *values)
+{
+ const GLubyte *src = ((const GLubyte *) rb->Data) +
+ 3 * (y * rb->RowStride + x);
+ GLubyte *dst = (GLubyte *) values;
+ GLuint i;
+ ASSERT(rb->Format == MESA_FORMAT_RGB888);
+ ASSERT(rb->DataType == GL_UNSIGNED_BYTE);
+ for (i = 0; i < count; i++) {
+ dst[i * 4 + 0] = src[i * 3 + 0];
+ dst[i * 4 + 1] = src[i * 3 + 1];
+ dst[i * 4 + 2] = src[i * 3 + 2];
+ dst[i * 4 + 3] = 255;
+ }
+}
+
+
+static void
+get_values_ubyte3(struct gl_context *ctx, struct gl_renderbuffer *rb, GLuint count,
+ const GLint x[], const GLint y[], void *values)
+{
+ GLubyte *dst = (GLubyte *) values;
+ GLuint i;
+ ASSERT(rb->Format == MESA_FORMAT_RGB888);
+ ASSERT(rb->DataType == GL_UNSIGNED_BYTE);
+ for (i = 0; i < count; i++) {
+ const GLubyte *src
+ = (GLubyte *) rb->Data + 3 * (y[i] * rb->RowStride + x[i]);
+ dst[i * 4 + 0] = src[0];
+ dst[i * 4 + 1] = src[1];
+ dst[i * 4 + 2] = src[2];
+ dst[i * 4 + 3] = 255;
+ }
+}
+
+
+static void
+put_row_ubyte3(struct gl_context *ctx, struct gl_renderbuffer *rb, GLuint count,
+ GLint x, GLint y, const void *values, const GLubyte *mask)
+{
+ /* note: incoming values are RGB+A! */
+ const GLubyte *src = (const GLubyte *) values;
+ GLubyte *dst = (GLubyte *) rb->Data + 3 * (y * rb->RowStride + x);
+ GLuint i;
+ ASSERT(rb->Format == MESA_FORMAT_RGB888);
+ ASSERT(rb->DataType == GL_UNSIGNED_BYTE);
+ for (i = 0; i < count; i++) {
+ if (!mask || mask[i]) {
+ dst[i * 3 + 0] = src[i * 4 + 0];
+ dst[i * 3 + 1] = src[i * 4 + 1];
+ dst[i * 3 + 2] = src[i * 4 + 2];
+ }
+ }
+}
+
+
+static void
+put_row_rgb_ubyte3(struct gl_context *ctx, struct gl_renderbuffer *rb, GLuint count,
+ GLint x, GLint y, const void *values, const GLubyte *mask)
+{
+ /* note: incoming values are RGB+A! */
+ const GLubyte *src = (const GLubyte *) values;
+ GLubyte *dst = (GLubyte *) rb->Data + 3 * (y * rb->RowStride + x);
+ GLuint i;
+ ASSERT(rb->Format == MESA_FORMAT_RGB888);
+ ASSERT(rb->DataType == GL_UNSIGNED_BYTE);
+ for (i = 0; i < count; i++) {
+ if (!mask || mask[i]) {
+ dst[i * 3 + 0] = src[i * 3 + 0];
+ dst[i * 3 + 1] = src[i * 3 + 1];
+ dst[i * 3 + 2] = src[i * 3 + 2];
+ }
+ }
+}
+
+
+static void
+put_mono_row_ubyte3(struct gl_context *ctx, struct gl_renderbuffer *rb, GLuint count,
+ GLint x, GLint y, const void *value, const GLubyte *mask)
+{
+ /* note: incoming value is RGB+A! */
+ const GLubyte val0 = ((const GLubyte *) value)[0];
+ const GLubyte val1 = ((const GLubyte *) value)[1];
+ const GLubyte val2 = ((const GLubyte *) value)[2];
+ GLubyte *dst = (GLubyte *) rb->Data + 3 * (y * rb->RowStride + x);
+ ASSERT(rb->Format == MESA_FORMAT_RGB888);
+ ASSERT(rb->DataType == GL_UNSIGNED_BYTE);
+ if (!mask && val0 == val1 && val1 == val2) {
+ /* optimized case */
+ memset(dst, val0, 3 * count);
+ }
+ else {
+ GLuint i;
+ for (i = 0; i < count; i++) {
+ if (!mask || mask[i]) {
+ dst[i * 3 + 0] = val0;
+ dst[i * 3 + 1] = val1;
+ dst[i * 3 + 2] = val2;
+ }
+ }
+ }
+}
+
+
+static void
+put_values_ubyte3(struct gl_context *ctx, struct gl_renderbuffer *rb, GLuint count,
+ const GLint x[], const GLint y[], const void *values,
+ const GLubyte *mask)
+{
+ /* note: incoming values are RGB+A! */
+ const GLubyte *src = (const GLubyte *) values;
+ GLuint i;
+ ASSERT(rb->Format == MESA_FORMAT_RGB888);
+ ASSERT(rb->DataType == GL_UNSIGNED_BYTE);
+ for (i = 0; i < count; i++) {
+ if (!mask || mask[i]) {
+ GLubyte *dst = (GLubyte *) rb->Data + 3 * (y[i] * rb->RowStride + x[i]);
+ dst[0] = src[i * 4 + 0];
+ dst[1] = src[i * 4 + 1];
+ dst[2] = src[i * 4 + 2];
+ }
+ }
+}
+
+
+static void
+put_mono_values_ubyte3(struct gl_context *ctx, struct gl_renderbuffer *rb,
+ GLuint count, const GLint x[], const GLint y[],
+ const void *value, const GLubyte *mask)
+{
+ /* note: incoming value is RGB+A! */
+ const GLubyte val0 = ((const GLubyte *) value)[0];
+ const GLubyte val1 = ((const GLubyte *) value)[1];
+ const GLubyte val2 = ((const GLubyte *) value)[2];
+ GLuint i;
+ ASSERT(rb->Format == MESA_FORMAT_RGB888);
+ ASSERT(rb->DataType == GL_UNSIGNED_BYTE);
+ for (i = 0; i < count; i++) {
+ if (!mask || mask[i]) {
+ GLubyte *dst = ((GLubyte *) rb->Data) +
+ 3 * (y[i] * rb->RowStride + x[i]);
+ dst[0] = val0;
+ dst[1] = val1;
+ dst[2] = val2;
+ }
+ }
+}
+
+
+/**********************************************************************
+ * Functions for buffers of 4 X GLubyte (or GLbyte) values.
+ * Typically color buffers.
+ */
+
+static void
+get_values_ubyte4(struct gl_context *ctx, struct gl_renderbuffer *rb, GLuint count,
+ const GLint x[], const GLint y[], void *values)
+{
+ /* treat 4*GLubyte as 1*GLuint */
+ GLuint *dst = (GLuint *) values;
+ GLuint i;
+ ASSERT(rb->DataType == GL_UNSIGNED_BYTE);
+ ASSERT(rb->Format == MESA_FORMAT_RGBA8888);
+ for (i = 0; i < count; i++) {
+ const GLuint *src = (GLuint *) rb->Data + (y[i] * rb->RowStride + x[i]);
+ dst[i] = *src;
+ }
+}
+
+
+static void
+put_row_ubyte4(struct gl_context *ctx, struct gl_renderbuffer *rb, GLuint count,
+ GLint x, GLint y, const void *values, const GLubyte *mask)
+{
+ /* treat 4*GLubyte as 1*GLuint */
+ const GLuint *src = (const GLuint *) values;
+ GLuint *dst = (GLuint *) rb->Data + (y * rb->RowStride + x);
+ ASSERT(rb->DataType == GL_UNSIGNED_BYTE);
+ ASSERT(rb->Format == MESA_FORMAT_RGBA8888);
+ if (mask) {
+ GLuint i;
+ for (i = 0; i < count; i++) {
+ if (mask[i]) {
+ dst[i] = src[i];
+ }
+ }
+ }
+ else {
+ memcpy(dst, src, 4 * count * sizeof(GLubyte));
+ }
+}
+
+
+static void
+put_row_rgb_ubyte4(struct gl_context *ctx, struct gl_renderbuffer *rb, GLuint count,
+ GLint x, GLint y, const void *values, const GLubyte *mask)
+{
+ /* Store RGB values in RGBA buffer */
+ const GLubyte *src = (const GLubyte *) values;
+ GLubyte *dst = (GLubyte *) rb->Data + 4 * (y * rb->RowStride + x);
+ GLuint i;
+ ASSERT(rb->DataType == GL_UNSIGNED_BYTE);
+ ASSERT(rb->Format == MESA_FORMAT_RGBA8888);
+ for (i = 0; i < count; i++) {
+ if (!mask || mask[i]) {
+ dst[i * 4 + 0] = src[i * 3 + 0];
+ dst[i * 4 + 1] = src[i * 3 + 1];
+ dst[i * 4 + 2] = src[i * 3 + 2];
+ dst[i * 4 + 3] = 0xff;
+ }
+ }
+}
+
+
+static void
+put_mono_row_ubyte4(struct gl_context *ctx, struct gl_renderbuffer *rb, GLuint count,
+ GLint x, GLint y, const void *value, const GLubyte *mask)
+{
+ /* treat 4*GLubyte as 1*GLuint */
+ const GLuint val = *((const GLuint *) value);
+ GLuint *dst = (GLuint *) rb->Data + (y * rb->RowStride + x);
+ ASSERT(rb->DataType == GL_UNSIGNED_BYTE);
+ ASSERT(rb->Format == MESA_FORMAT_RGBA8888);
+ if (!mask && val == 0) {
+ /* common case */
+ memset(dst, 0, count * 4 * sizeof(GLubyte));
+ }
+ else {
+ /* general case */
+ if (mask) {
+ GLuint i;
+ for (i = 0; i < count; i++) {
+ if (mask[i]) {
+ dst[i] = val;
+ }
+ }
+ }
+ else {
+ GLuint i;
+ for (i = 0; i < count; i++) {
+ dst[i] = val;
+ }
+ }
+ }
+}
+
+
+static void
+put_values_ubyte4(struct gl_context *ctx, struct gl_renderbuffer *rb, GLuint count,
+ const GLint x[], const GLint y[], const void *values,
+ const GLubyte *mask)
+{
+ /* treat 4*GLubyte as 1*GLuint */
+ const GLuint *src = (const GLuint *) values;
+ GLuint i;
+ ASSERT(rb->DataType == GL_UNSIGNED_BYTE);
+ ASSERT(rb->Format == MESA_FORMAT_RGBA8888);
+ for (i = 0; i < count; i++) {
+ if (!mask || mask[i]) {
+ GLuint *dst = (GLuint *) rb->Data + (y[i] * rb->RowStride + x[i]);
+ *dst = src[i];
+ }
+ }
+}
+
+
+static void
+put_mono_values_ubyte4(struct gl_context *ctx, struct gl_renderbuffer *rb,
+ GLuint count, const GLint x[], const GLint y[],
+ const void *value, const GLubyte *mask)
+{
+ /* treat 4*GLubyte as 1*GLuint */
+ const GLuint val = *((const GLuint *) value);
+ GLuint i;
+ ASSERT(rb->DataType == GL_UNSIGNED_BYTE);
+ ASSERT(rb->Format == MESA_FORMAT_RGBA8888);
+ for (i = 0; i < count; i++) {
+ if (!mask || mask[i]) {
+ GLuint *dst = (GLuint *) rb->Data + (y[i] * rb->RowStride + x[i]);
+ *dst = val;
+ }
+ }
+}
+
+
+/**********************************************************************
+ * Functions for buffers of 4 X GLushort (or GLshort) values.
+ * Typically accum buffer.
+ */
+
+static void
+get_values_ushort4(struct gl_context *ctx, struct gl_renderbuffer *rb, GLuint count,
+ const GLint x[], const GLint y[], void *values)
+{
+ GLushort *dst = (GLushort *) values;
+ GLuint i;
+ ASSERT(rb->DataType == GL_UNSIGNED_SHORT || rb->DataType == GL_SHORT);
+ for (i = 0; i < count; i++) {
+ const GLushort *src
+ = (GLushort *) rb->Data + 4 * (y[i] * rb->RowStride + x[i]);
+ dst[i] = *src;
+ }
+}
+
+
+static void
+put_row_ushort4(struct gl_context *ctx, struct gl_renderbuffer *rb, GLuint count,
+ GLint x, GLint y, const void *values, const GLubyte *mask)
+{
+ const GLushort *src = (const GLushort *) values;
+ GLushort *dst = (GLushort *) rb->Data + 4 * (y * rb->RowStride + x);
+ ASSERT(rb->DataType == GL_UNSIGNED_SHORT || rb->DataType == GL_SHORT);
+ if (mask) {
+ GLuint i;
+ for (i = 0; i < count; i++) {
+ if (mask[i]) {
+ dst[i * 4 + 0] = src[i * 4 + 0];
+ dst[i * 4 + 1] = src[i * 4 + 1];
+ dst[i * 4 + 2] = src[i * 4 + 2];
+ dst[i * 4 + 3] = src[i * 4 + 3];
+ }
+ }
+ }
+ else {
+ memcpy(dst, src, 4 * count * sizeof(GLushort));
+ }
+}
+
+
+static void
+put_row_rgb_ushort4(struct gl_context *ctx, struct gl_renderbuffer *rb, GLuint count,
+ GLint x, GLint y, const void *values, const GLubyte *mask)
+{
+ /* Put RGB values in RGBA buffer */
+ const GLushort *src = (const GLushort *) values;
+ GLushort *dst = (GLushort *) rb->Data + 4 * (y * rb->RowStride + x);
+ ASSERT(rb->DataType == GL_UNSIGNED_SHORT || rb->DataType == GL_SHORT);
+ if (mask) {
+ GLuint i;
+ for (i = 0; i < count; i++) {
+ if (mask[i]) {
+ dst[i * 4 + 0] = src[i * 3 + 0];
+ dst[i * 4 + 1] = src[i * 3 + 1];
+ dst[i * 4 + 2] = src[i * 3 + 2];
+ dst[i * 4 + 3] = 0xffff;
+ }
+ }
+ }
+ else {
+ memcpy(dst, src, 4 * count * sizeof(GLushort));
+ }
+}
+
+
+static void
+put_mono_row_ushort4(struct gl_context *ctx, struct gl_renderbuffer *rb, GLuint count,
+ GLint x, GLint y, const void *value, const GLubyte *mask)
+{
+ const GLushort val0 = ((const GLushort *) value)[0];
+ const GLushort val1 = ((const GLushort *) value)[1];
+ const GLushort val2 = ((const GLushort *) value)[2];
+ const GLushort val3 = ((const GLushort *) value)[3];
+ GLushort *dst = (GLushort *) rb->Data + 4 * (y * rb->RowStride + x);
+ ASSERT(rb->DataType == GL_UNSIGNED_SHORT || rb->DataType == GL_SHORT);
+ if (!mask && val0 == 0 && val1 == 0 && val2 == 0 && val3 == 0) {
+ /* common case for clearing accum buffer */
+ memset(dst, 0, count * 4 * sizeof(GLushort));
+ }
+ else {
+ GLuint i;
+ for (i = 0; i < count; i++) {
+ if (!mask || mask[i]) {
+ dst[i * 4 + 0] = val0;
+ dst[i * 4 + 1] = val1;
+ dst[i * 4 + 2] = val2;
+ dst[i * 4 + 3] = val3;
+ }
+ }
+ }
+}
+
+
+static void
+put_values_ushort4(struct gl_context *ctx, struct gl_renderbuffer *rb, GLuint count,
+ const GLint x[], const GLint y[], const void *values,
+ const GLubyte *mask)
+{
+ const GLushort *src = (const GLushort *) values;
+ GLuint i;
+ ASSERT(rb->DataType == GL_UNSIGNED_SHORT || rb->DataType == GL_SHORT);
+ for (i = 0; i < count; i++) {
+ if (!mask || mask[i]) {
+ GLushort *dst =
+ ((GLushort *) rb->Data) + 4 * (y[i] * rb->RowStride + x[i]);
+ dst[0] = src[i * 4 + 0];
+ dst[1] = src[i * 4 + 1];
+ dst[2] = src[i * 4 + 2];
+ dst[3] = src[i * 4 + 3];
+ }
+ }
+}
+
+
+static void
+put_mono_values_ushort4(struct gl_context *ctx, struct gl_renderbuffer *rb,
+ GLuint count, const GLint x[], const GLint y[],
+ const void *value, const GLubyte *mask)
+{
+ const GLushort val0 = ((const GLushort *) value)[0];
+ const GLushort val1 = ((const GLushort *) value)[1];
+ const GLushort val2 = ((const GLushort *) value)[2];
+ const GLushort val3 = ((const GLushort *) value)[3];
+ GLuint i;
+ ASSERT(rb->DataType == GL_UNSIGNED_SHORT || rb->DataType == GL_SHORT);
+ for (i = 0; i < count; i++) {
+ if (!mask || mask[i]) {
+ GLushort *dst = ((GLushort *) rb->Data) +
+ 4 * (y[i] * rb->RowStride + x[i]);
+ dst[0] = val0;
+ dst[1] = val1;
+ dst[2] = val2;
+ dst[3] = val3;
+ }
+ }
+}
+
+/**********************************************************************
+ * Functions for MESA_FORMAT_R8.
+ */
+static void
+get_row_r8(struct gl_context *ctx, struct gl_renderbuffer *rb, GLuint count,
+ GLint x, GLint y, void *values)
+{
+ const GLubyte *src = rb->GetPointer(ctx, rb, x, y);
+ GLuint *dst = values;
+ GLuint i;
+
+ for (i = 0; i < count; i++) {
+ dst[i] = 0xff000000 | src[i];
+ }
+}
+
+static void
+get_values_r8(struct gl_context *ctx, struct gl_renderbuffer *rb, GLuint count,
+ const GLint x[], const GLint y[], void *values)
+{
+ GLuint *dst = (GLuint *) values;
+ GLuint i;
+
+ for (i = 0; i < count; i++) {
+ const GLubyte *src = rb->GetPointer(ctx, rb, x[i], y[i]);
+ dst[i] = 0xff000000 | *src;
+ }
+}
+
+/**********************************************************************
+ * Functions for MESA_FORMAT_RG88.
+ */
+static void
+get_row_rg88(struct gl_context *ctx, struct gl_renderbuffer *rb, GLuint count,
+ GLint x, GLint y, void *values)
+{
+ const GLushort *src = rb->GetPointer(ctx, rb, x, y);
+ GLuint *dst = values;
+ GLuint i;
+
+ for (i = 0; i < count; i++) {
+ dst[i] = 0xff000000 | src[i];
+ }
+}
+
+static void
+get_values_rg88(struct gl_context *ctx, struct gl_renderbuffer *rb,
+ GLuint count, const GLint x[], const GLint y[], void *values)
+{
+ GLuint *dst = (GLuint *) values;
+ GLuint i;
+
+ for (i = 0; i < count; i++) {
+ const GLshort *src = rb->GetPointer(ctx, rb, x[i], y[i]);
+ dst[i] = 0xff000000 | *src;
+ }
+}
+
+/**********************************************************************
+ * Functions for MESA_FORMAT_R16.
+ */
+static void
+get_row_r16(struct gl_context *ctx, struct gl_renderbuffer *rb, GLuint count,
+ GLint x, GLint y, void *values)
+{
+ const GLushort *src = rb->GetPointer(ctx, rb, x, y);
+ GLushort *dst = values;
+ GLuint i;
+
+ for (i = 0; i < count; i++) {
+ dst[i * 4 + RCOMP] = src[i];
+ dst[i * 4 + GCOMP] = 0;
+ dst[i * 4 + BCOMP] = 0;
+ dst[i * 4 + ACOMP] = 0xffff;
+ }
+}
+
+static void
+get_values_r16(struct gl_context *ctx, struct gl_renderbuffer *rb, GLuint count,
+ const GLint x[], const GLint y[], void *values)
+{
+ GLushort *dst = values;
+ GLuint i;
+
+ for (i = 0; i < count; i++) {
+ const GLushort *src = rb->GetPointer(ctx, rb, x[i], y[i]);
+ dst[i * 4 + RCOMP] = *src;
+ dst[i * 4 + GCOMP] = 0;
+ dst[i * 4 + BCOMP] = 0;
+ dst[i * 4 + ACOMP] = 0xffff;
+ }
+}
+
+/**********************************************************************
+ * Functions for MESA_FORMAT_RG1616.
+ */
+static void
+get_row_rg1616(struct gl_context *ctx, struct gl_renderbuffer *rb, GLuint count,
+ GLint x, GLint y, void *values)
+{
+ const GLushort *src = rb->GetPointer(ctx, rb, x, y);
+ GLushort *dst = values;
+ GLuint i;
+
+ for (i = 0; i < count; i++) {
+ dst[i * 4 + RCOMP] = src[i * 2];
+ dst[i * 4 + GCOMP] = src[i * 2 + 1];
+ dst[i * 4 + BCOMP] = 0;
+ dst[i * 4 + ACOMP] = 0xffff;
+ }
+}
+
+static void
+get_values_rg1616(struct gl_context *ctx, struct gl_renderbuffer *rb,
+ GLuint count, const GLint x[], const GLint y[], void *values)
+{
+ GLushort *dst = values;
+ GLuint i;
+
+ for (i = 0; i < count; i++) {
+ const GLshort *src = rb->GetPointer(ctx, rb, x[i], y[i]);
+ dst[i * 4 + RCOMP] = src[0];
+ dst[i * 4 + GCOMP] = src[1];
+ dst[i * 4 + BCOMP] = 0;
+ dst[i * 4 + ACOMP] = 0xffff;
+ }
+}
+
+/**********************************************************************
+ * Functions for MESA_FORMAT_INTENSITY_FLOAT32.
+ */
+static void
+get_row_i_float32(struct gl_context *ctx, struct gl_renderbuffer *rb,
+ GLuint count, GLint x, GLint y, void *values)
+{
+ const GLfloat *src = rb->GetPointer(ctx, rb, x, y);
+ GLfloat *dst = values;
+ GLuint i;
+
+ for (i = 0; i < count; i++) {
+ dst[i * 4 + RCOMP] =
+ dst[i * 4 + GCOMP] =
+ dst[i * 4 + BCOMP] =
+ dst[i * 4 + ACOMP] = src[i];
+ }
+}
+
+static void
+get_values_i_float32(struct gl_context *ctx, struct gl_renderbuffer *rb,
+ GLuint count, const GLint x[], const GLint y[],
+ void *values)
+{
+ GLfloat *dst = values;
+ GLuint i;
+
+ for (i = 0; i < count; i++) {
+ const GLfloat *src = rb->GetPointer(ctx, rb, x[i], y[i]);
+ dst[i * 4 + RCOMP] =
+ dst[i * 4 + GCOMP] =
+ dst[i * 4 + BCOMP] =
+ dst[i * 4 + ACOMP] = src[0];
+ }
+}
+
+/**********************************************************************
+ * Functions for MESA_FORMAT_LUMINANCE_FLOAT32.
+ */
+static void
+get_row_l_float32(struct gl_context *ctx, struct gl_renderbuffer *rb,
+ GLuint count, GLint x, GLint y, void *values)
+{
+ const GLfloat *src = rb->GetPointer(ctx, rb, x, y);
+ GLfloat *dst = values;
+ GLuint i;
+
+ for (i = 0; i < count; i++) {
+ dst[i * 4 + RCOMP] =
+ dst[i * 4 + GCOMP] =
+ dst[i * 4 + BCOMP] = src[i];
+ dst[i * 4 + ACOMP] = 1.0;
+ }
+}
+
+static void
+get_values_l_float32(struct gl_context *ctx, struct gl_renderbuffer *rb,
+ GLuint count, const GLint x[], const GLint y[],
+ void *values)
+{
+ GLfloat *dst = values;
+ GLuint i;
+
+ for (i = 0; i < count; i++) {
+ const GLfloat *src = rb->GetPointer(ctx, rb, x[i], y[i]);
+ dst[i * 4 + RCOMP] =
+ dst[i * 4 + GCOMP] =
+ dst[i * 4 + BCOMP] = src[0];
+ dst[i * 4 + ACOMP] = 1.0;
+ }
+}
+
+/**********************************************************************
+ * Functions for MESA_FORMAT_ALPHA_FLOAT32.
+ */
+static void
+get_row_a_float32(struct gl_context *ctx, struct gl_renderbuffer *rb,
+ GLuint count, GLint x, GLint y, void *values)
+{
+ const GLfloat *src = rb->GetPointer(ctx, rb, x, y);
+ GLfloat *dst = values;
+ GLuint i;
+
+ for (i = 0; i < count; i++) {
+ dst[i * 4 + RCOMP] = 0.0;
+ dst[i * 4 + GCOMP] = 0.0;
+ dst[i * 4 + BCOMP] = 0.0;
+ dst[i * 4 + ACOMP] = src[i];
+ }
+}
+
+static void
+get_values_a_float32(struct gl_context *ctx, struct gl_renderbuffer *rb,
+ GLuint count, const GLint x[], const GLint y[],
+ void *values)
+{
+ GLfloat *dst = values;
+ GLuint i;
+
+ for (i = 0; i < count; i++) {
+ const GLfloat *src = rb->GetPointer(ctx, rb, x[i], y[i]);
+ dst[i * 4 + RCOMP] = 0.0;
+ dst[i * 4 + GCOMP] = 0.0;
+ dst[i * 4 + BCOMP] = 0.0;
+ dst[i * 4 + ACOMP] = src[0];
+ }
+}
+
+static void
+put_row_a_float32(struct gl_context *ctx, struct gl_renderbuffer *rb,
+ GLuint count, GLint x, GLint y,
+ const void *values, const GLubyte *mask)
+{
+ float *dst = rb->GetPointer(ctx, rb, x, y);
+ const float *src = values;
+ unsigned int i;
+
+ if (mask) {
+ for (i = 0; i < count; i++) {
+ if (mask[i]) {
+ dst[i] = src[i * 4 + ACOMP];
+ }
+ }
+ }
+ else {
+ for (i = 0; i < count; i++) {
+ dst[i] = src[i * 4 + ACOMP];
+ }
+ }
+}
+
+static void
+put_mono_row_a_float32(struct gl_context *ctx, struct gl_renderbuffer *rb,
+ GLuint count, GLint x, GLint y,
+ const void *value, const GLubyte *mask)
+{
+ float *dst = rb->GetPointer(ctx, rb, x, y);
+ const float *src = value;
+ unsigned int i;
+
+ if (mask) {
+ for (i = 0; i < count; i++) {
+ if (mask[i]) {
+ dst[i] = src[ACOMP];
+ }
+ }
+ }
+ else {
+ for (i = 0; i < count; i++) {
+ dst[i] = src[ACOMP];
+ }
+ }
+}
+
+static void
+put_values_a_float32(struct gl_context *ctx, struct gl_renderbuffer *rb,
+ GLuint count, const GLint x[], const GLint y[],
+ const void *values, const GLubyte *mask)
+{
+ const float *src = values;
+ unsigned int i;
+
+ for (i = 0; i < count; i++) {
+ if (!mask || mask[i]) {
+ float *dst = rb->GetPointer(ctx, rb, x[i], y[i]);
+
+ *dst = src[i * 4 + ACOMP];
+ }
+ }
+}
+
+static void
+put_mono_values_a_float32(struct gl_context *ctx,
+ struct gl_renderbuffer *rb,
+ GLuint count, const GLint x[], const GLint y[],
+ const void *value, const GLubyte *mask)
+{
+ const float *src = value;
+ unsigned int i;
+
+ for (i = 0; i < count; i++) {
+ if (!mask || mask[i]) {
+ float *dst = rb->GetPointer(ctx, rb, x[i], y[i]);
+ *dst = src[ACOMP];
+ }
+ }
+}
+
+/**********************************************************************
+ * Functions for MESA_FORMAT_R_FLOAT32.
+ */
+static void
+get_row_r_float32(struct gl_context *ctx, struct gl_renderbuffer *rb,
+ GLuint count, GLint x, GLint y, void *values)
+{
+ const GLfloat *src = rb->GetPointer(ctx, rb, x, y);
+ GLfloat *dst = values;
+ GLuint i;
+
+ for (i = 0; i < count; i++) {
+ dst[i * 4 + RCOMP] = src[i];
+ dst[i * 4 + GCOMP] = 0.0;
+ dst[i * 4 + BCOMP] = 0.0;
+ dst[i * 4 + ACOMP] = 1.0;
+ }
+}
+
+static void
+get_values_r_float32(struct gl_context *ctx, struct gl_renderbuffer *rb,
+ GLuint count, const GLint x[], const GLint y[],
+ void *values)
+{
+ GLfloat *dst = values;
+ GLuint i;
+
+ for (i = 0; i < count; i++) {
+ const GLfloat *src = rb->GetPointer(ctx, rb, x[i], y[i]);
+ dst[i * 4 + RCOMP] = src[0];
+ dst[i * 4 + GCOMP] = 0.0;
+ dst[i * 4 + BCOMP] = 0.0;
+ dst[i * 4 + ACOMP] = 1.0;
+ }
+}
+
+/**********************************************************************
+ * Functions for MESA_FORMAT_RG_FLOAT32.
+ */
+static void
+get_row_rg_float32(struct gl_context *ctx, struct gl_renderbuffer *rb,
+ GLuint count, GLint x, GLint y, void *values)
+{
+ const GLfloat *src = rb->GetPointer(ctx, rb, x, y);
+ GLfloat *dst = values;
+ GLuint i;
+
+ for (i = 0; i < count; i++) {
+ dst[i * 4 + RCOMP] = src[i * 2 + 0];
+ dst[i * 4 + GCOMP] = src[i * 2 + 1];
+ dst[i * 4 + BCOMP] = 0.0;
+ dst[i * 4 + ACOMP] = 1.0;
+ }
+}
+
+static void
+get_values_rg_float32(struct gl_context *ctx, struct gl_renderbuffer *rb,
+ GLuint count, const GLint x[], const GLint y[],
+ void *values)
+{
+ GLfloat *dst = values;
+ GLuint i;
+
+ for (i = 0; i < count; i++) {
+ const GLfloat *src = rb->GetPointer(ctx, rb, x[i], y[i]);
+ dst[i * 4 + RCOMP] = src[0];
+ dst[i * 4 + GCOMP] = src[1];
+ dst[i * 4 + BCOMP] = 0.0;
+ dst[i * 4 + ACOMP] = 1.0;
+ }
+}
+
+/**
+ * This is the default software fallback for gl_renderbuffer's span
+ * access functions.
+ *
+ * The assumptions are that rb->Data will be a pointer to (0,0), that pixels
+ * are packed in the type of rb->Format, and that subsequent rows appear
+ * rb->RowStride pixels later.
+ */
+void
+_mesa_set_renderbuffer_accessors(struct gl_renderbuffer *rb)
+{
+ rb->GetPointer = get_pointer_generic;
+ rb->GetRow = get_row_generic;
+
+ switch (rb->Format) {
+ case MESA_FORMAT_RGB888:
+ rb->DataType = GL_UNSIGNED_BYTE;
+ rb->GetPointer = get_pointer_ubyte3;
+ rb->GetRow = get_row_ubyte3;
+ rb->GetValues = get_values_ubyte3;
+ rb->PutRow = put_row_ubyte3;
+ rb->PutRowRGB = put_row_rgb_ubyte3;
+ rb->PutMonoRow = put_mono_row_ubyte3;
+ rb->PutValues = put_values_ubyte3;
+ rb->PutMonoValues = put_mono_values_ubyte3;
+ break;
+
+ case MESA_FORMAT_RGBA8888:
+ rb->DataType = GL_UNSIGNED_BYTE;
+ rb->GetValues = get_values_ubyte4;
+ rb->PutRow = put_row_ubyte4;
+ rb->PutRowRGB = put_row_rgb_ubyte4;
+ rb->PutMonoRow = put_mono_row_ubyte4;
+ rb->PutValues = put_values_ubyte4;
+ rb->PutMonoValues = put_mono_values_ubyte4;
+ break;
+
+ case MESA_FORMAT_R8:
+ rb->DataType = GL_UNSIGNED_BYTE;
+ rb->GetValues = get_values_r8;
+ rb->GetRow = get_row_r8;
+ rb->PutRow = put_row_generic;
+ rb->PutRowRGB = put_row_generic;
+ rb->PutMonoRow = put_mono_row_generic;
+ rb->PutValues = put_values_generic;
+ rb->PutMonoValues = put_mono_values_generic;
+ break;
+
+ case MESA_FORMAT_RG88:
+ rb->DataType = GL_UNSIGNED_BYTE;
+ rb->GetValues = get_values_rg88;
+ rb->GetRow = get_row_rg88;
+ rb->PutRow = put_row_generic;
+ rb->PutRowRGB = put_row_generic;
+ rb->PutMonoRow = put_mono_row_generic;
+ rb->PutValues = put_values_generic;
+ rb->PutMonoValues = put_mono_values_generic;
+ break;
+
+ case MESA_FORMAT_R16:
+ rb->DataType = GL_UNSIGNED_SHORT;
+ rb->GetValues = get_values_r16;
+ rb->GetRow = get_row_r16;
+ rb->PutRow = put_row_generic;
+ rb->PutRowRGB = put_row_generic;
+ rb->PutMonoRow = put_mono_row_generic;
+ rb->PutValues = put_values_generic;
+ rb->PutMonoValues = put_mono_values_generic;
+ break;
+
+ case MESA_FORMAT_RG1616:
+ rb->DataType = GL_UNSIGNED_SHORT;
+ rb->GetValues = get_values_rg1616;
+ rb->GetRow = get_row_rg1616;
+ rb->PutRow = put_row_generic;
+ rb->PutRowRGB = put_row_generic;
+ rb->PutMonoRow = put_mono_row_generic;
+ rb->PutValues = put_values_generic;
+ rb->PutMonoValues = put_mono_values_generic;
+ break;
+
+ case MESA_FORMAT_SIGNED_RGBA_16:
+ rb->DataType = GL_SHORT;
+ rb->GetValues = get_values_ushort4;
+ rb->PutRow = put_row_ushort4;
+ rb->PutRowRGB = put_row_rgb_ushort4;
+ rb->PutMonoRow = put_mono_row_ushort4;
+ rb->PutValues = put_values_ushort4;
+ rb->PutMonoValues = put_mono_values_ushort4;
+ break;
+
+#if 0
+ case MESA_FORMAT_A8:
+ rb->DataType = GL_UNSIGNED_BYTE;
+ rb->GetValues = get_values_alpha8;
+ rb->PutRow = put_row_alpha8;
+ rb->PutRowRGB = NULL;
+ rb->PutMonoRow = put_mono_row_alpha8;
+ rb->PutValues = put_values_alpha8;
+ rb->PutMonoValues = put_mono_values_alpha8;
+ break;
+#endif
+
+ case MESA_FORMAT_S8:
+ rb->DataType = GL_UNSIGNED_BYTE;
+ rb->GetValues = get_values_ubyte;
+ rb->PutRow = put_row_ubyte;
+ rb->PutRowRGB = NULL;
+ rb->PutMonoRow = put_mono_row_ubyte;
+ rb->PutValues = put_values_ubyte;
+ rb->PutMonoValues = put_mono_values_ubyte;
+ break;
+
+ case MESA_FORMAT_Z16:
+ rb->DataType = GL_UNSIGNED_SHORT;
+ rb->GetValues = get_values_ushort;
+ rb->PutRow = put_row_ushort;
+ rb->PutRowRGB = NULL;
+ rb->PutMonoRow = put_mono_row_ushort;
+ rb->PutValues = put_values_ushort;
+ rb->PutMonoValues = put_mono_values_ushort;
+ break;
+
+ case MESA_FORMAT_Z32:
+ case MESA_FORMAT_X8_Z24:
+ case MESA_FORMAT_Z24_X8:
+ rb->DataType = GL_UNSIGNED_INT;
+ rb->GetValues = get_values_uint;
+ rb->PutRow = put_row_uint;
+ rb->PutRowRGB = NULL;
+ rb->PutMonoRow = put_mono_row_uint;
+ rb->PutValues = put_values_uint;
+ rb->PutMonoValues = put_mono_values_uint;
+ break;
+
+ case MESA_FORMAT_Z24_S8:
+ case MESA_FORMAT_S8_Z24:
+ rb->DataType = GL_UNSIGNED_INT_24_8_EXT;
+ rb->GetValues = get_values_uint;
+ rb->PutRow = put_row_uint;
+ rb->PutRowRGB = NULL;
+ rb->PutMonoRow = put_mono_row_uint;
+ rb->PutValues = put_values_uint;
+ rb->PutMonoValues = put_mono_values_uint;
+ break;
+
+ case MESA_FORMAT_RGBA_FLOAT32:
+ rb->GetRow = get_row_generic;
+ rb->GetValues = get_values_generic;
+ rb->PutRow = put_row_generic;
+ rb->PutRowRGB = NULL;
+ rb->PutMonoRow = put_mono_row_generic;
+ rb->PutValues = put_values_generic;
+ rb->PutMonoValues = put_mono_values_generic;
+ break;
+
+ case MESA_FORMAT_INTENSITY_FLOAT32:
+ rb->GetRow = get_row_i_float32;
+ rb->GetValues = get_values_i_float32;
+ rb->PutRow = put_row_generic;
+ rb->PutRowRGB = NULL;
+ rb->PutMonoRow = put_mono_row_generic;
+ rb->PutValues = put_values_generic;
+ rb->PutMonoValues = put_mono_values_generic;
+ break;
+
+ case MESA_FORMAT_LUMINANCE_FLOAT32:
+ rb->GetRow = get_row_l_float32;
+ rb->GetValues = get_values_l_float32;
+ rb->PutRow = put_row_generic;
+ rb->PutRowRGB = NULL;
+ rb->PutMonoRow = put_mono_row_generic;
+ rb->PutValues = put_values_generic;
+ rb->PutMonoValues = put_mono_values_generic;
+ break;
+
+ case MESA_FORMAT_ALPHA_FLOAT32:
+ rb->GetRow = get_row_a_float32;
+ rb->GetValues = get_values_a_float32;
+ rb->PutRow = put_row_a_float32;
+ rb->PutRowRGB = NULL;
+ rb->PutMonoRow = put_mono_row_a_float32;
+ rb->PutValues = put_values_a_float32;
+ rb->PutMonoValues = put_mono_values_a_float32;
+ break;
+
+ case MESA_FORMAT_RG_FLOAT32:
+ rb->GetRow = get_row_rg_float32;
+ rb->GetValues = get_values_rg_float32;
+ rb->PutRow = put_row_generic;
+ rb->PutRowRGB = NULL;
+ rb->PutMonoRow = put_mono_row_generic;
+ rb->PutValues = put_values_generic;
+ rb->PutMonoValues = put_mono_values_generic;
+ break;
+
+ case MESA_FORMAT_R_FLOAT32:
+ rb->GetRow = get_row_r_float32;
+ rb->GetValues = get_values_r_float32;
+ rb->PutRow = put_row_generic;
+ rb->PutRowRGB = NULL;
+ rb->PutMonoRow = put_mono_row_generic;
+ rb->PutValues = put_values_generic;
+ rb->PutMonoValues = put_mono_values_generic;
+ break;
+
+ default:
+ break;
+ }
+}
+
+/**
+ * This is a software fallback for the gl_renderbuffer->AllocStorage
+ * function.
+ * Device drivers will typically override this function for the buffers
+ * which it manages (typically color buffers, Z and stencil).
+ * Other buffers (like software accumulation and aux buffers) which the driver
+ * doesn't manage can be handled with this function.
+ *
+ * This one multi-purpose function can allocate stencil, depth, accum, color
+ * or color-index buffers!
+ *
+ * This function also plugs in the appropriate GetPointer, Get/PutRow and
+ * Get/PutValues functions.
+ */
+GLboolean
+_mesa_soft_renderbuffer_storage(struct gl_context *ctx, struct gl_renderbuffer *rb,
+ GLenum internalFormat,
+ GLuint width, GLuint height)
+{
+ switch (internalFormat) {
+ case GL_RGB:
+ case GL_R3_G3_B2:
+ case GL_RGB4:
+ case GL_RGB5:
+ case GL_RGB8:
+ case GL_RGB10:
+ case GL_RGB12:
+ case GL_RGB16:
+ rb->Format = MESA_FORMAT_RGB888;
+ break;
+ case GL_RGBA:
+ case GL_RGBA2:
+ case GL_RGBA4:
+ case GL_RGB5_A1:
+ case GL_RGBA8:
+#if 1
+ case GL_RGB10_A2:
+ case GL_RGBA12:
+#endif
+ rb->Format = MESA_FORMAT_RGBA8888;
+ break;
+ case GL_RGBA16:
+ case GL_RGBA16_SNORM:
+ /* for accum buffer */
+ rb->Format = MESA_FORMAT_SIGNED_RGBA_16;
+ break;
+#if 0
+ case GL_ALPHA8:
+ rb->Format = MESA_FORMAT_A8;
+ break;
+#endif
+ case GL_STENCIL_INDEX:
+ case GL_STENCIL_INDEX1_EXT:
+ case GL_STENCIL_INDEX4_EXT:
+ case GL_STENCIL_INDEX8_EXT:
+ case GL_STENCIL_INDEX16_EXT:
+ rb->Format = MESA_FORMAT_S8;
+ break;
+ case GL_DEPTH_COMPONENT:
+ case GL_DEPTH_COMPONENT16:
+ rb->Format = MESA_FORMAT_Z16;
+ break;
+ case GL_DEPTH_COMPONENT24:
+ rb->Format = MESA_FORMAT_X8_Z24;
+ break;
+ case GL_DEPTH_COMPONENT32:
+ rb->Format = MESA_FORMAT_Z32;
+ break;
+ case GL_DEPTH_STENCIL_EXT:
+ case GL_DEPTH24_STENCIL8_EXT:
+ rb->Format = MESA_FORMAT_Z24_S8;
+ break;
+ default:
+ /* unsupported format */
+ return GL_FALSE;
+ }
+
+ _mesa_set_renderbuffer_accessors(rb);
+
+ ASSERT(rb->DataType);
+ ASSERT(rb->GetPointer);
+ ASSERT(rb->GetRow);
+ ASSERT(rb->GetValues);
+ ASSERT(rb->PutRow);
+ ASSERT(rb->PutMonoRow);
+ ASSERT(rb->PutValues);
+ ASSERT(rb->PutMonoValues);
+
+ /* free old buffer storage */
+ if (rb->Data) {
+ free(rb->Data);
+ rb->Data = NULL;
+ }
+
+ rb->RowStride = width;
+
+ if (width > 0 && height > 0) {
+ /* allocate new buffer storage */
+ rb->Data = malloc(width * height * _mesa_get_format_bytes(rb->Format));
+
+ if (rb->Data == NULL) {
+ rb->Width = 0;
+ rb->Height = 0;
+ rb->RowStride = 0;
+ _mesa_error(ctx, GL_OUT_OF_MEMORY,
+ "software renderbuffer allocation (%d x %d x %d)",
+ width, height, _mesa_get_format_bytes(rb->Format));
+ return GL_FALSE;
+ }
+ }
+
+ rb->Width = width;
+ rb->Height = height;
+ rb->_BaseFormat = _mesa_base_fbo_format(ctx, internalFormat);
+
+ if (rb->Name == 0 &&
+ internalFormat == GL_RGBA16_SNORM &&
+ rb->_BaseFormat == 0) {
+ /* NOTE: This is a special case just for accumulation buffers.
+ * This is a very limited use case- there's no snorm texturing or
+ * rendering going on.
+ */
+ rb->_BaseFormat = GL_RGBA;
+ }
+ else {
+ /* the internalFormat should have been error checked long ago */
+ ASSERT(rb->_BaseFormat);
+ }
+
+ return GL_TRUE;
+}
+
+
+
+/**********************************************************************/
+/**********************************************************************/
+/**********************************************************************/
+
+
+/**
+ * Here we utilize the gl_renderbuffer->Wrapper field to put an alpha
+ * buffer wrapper around an existing RGB renderbuffer (hw or sw).
+ *
+ * When PutRow is called (for example), we store the alpha values in
+ * this buffer, then pass on the PutRow call to the wrapped RGB
+ * buffer.
+ */
+
+
+static GLboolean
+alloc_storage_alpha8(struct gl_context *ctx, struct gl_renderbuffer *arb,
+ GLenum internalFormat, GLuint width, GLuint height)
+{
+ ASSERT(arb != arb->Wrapped);
+ ASSERT(arb->Format == MESA_FORMAT_A8);
+
+ /* first, pass the call to the wrapped RGB buffer */
+ if (!arb->Wrapped->AllocStorage(ctx, arb->Wrapped, internalFormat,
+ width, height)) {
+ return GL_FALSE;
+ }
+
+ /* next, resize my alpha buffer */
+ if (arb->Data) {
+ free(arb->Data);
+ }
+
+ arb->Data = malloc(width * height * sizeof(GLubyte));
+ if (arb->Data == NULL) {
+ arb->Width = 0;
+ arb->Height = 0;
+ _mesa_error(ctx, GL_OUT_OF_MEMORY, "software alpha buffer allocation");
+ return GL_FALSE;
+ }
+
+ arb->Width = width;
+ arb->Height = height;
+ arb->RowStride = width;
+
+ return GL_TRUE;
+}
+
+
+/**
+ * Delete an alpha_renderbuffer object, as well as the wrapped RGB buffer.
+ */
+static void
+delete_renderbuffer_alpha8(struct gl_renderbuffer *arb)
+{
+ if (arb->Data) {
+ free(arb->Data);
+ }
+ ASSERT(arb->Wrapped);
+ ASSERT(arb != arb->Wrapped);
+ arb->Wrapped->Delete(arb->Wrapped);
+ arb->Wrapped = NULL;
+ free(arb);
+}
+
+
+static void *
+get_pointer_alpha8(struct gl_context *ctx, struct gl_renderbuffer *arb,
+ GLint x, GLint y)
+{
+ return NULL; /* don't allow direct access! */
+}
+
+
+static void
+get_row_alpha8(struct gl_context *ctx, struct gl_renderbuffer *arb, GLuint count,
+ GLint x, GLint y, void *values)
+{
+ /* NOTE: 'values' is RGBA format! */
+ const GLubyte *src = (const GLubyte *) arb->Data + y * arb->RowStride + x;
+ GLubyte *dst = (GLubyte *) values;
+ GLuint i;
+ ASSERT(arb != arb->Wrapped);
+ ASSERT(arb->DataType == GL_UNSIGNED_BYTE);
+ /* first, pass the call to the wrapped RGB buffer */
+ arb->Wrapped->GetRow(ctx, arb->Wrapped, count, x, y, values);
+ /* second, fill in alpha values from this buffer! */
+ for (i = 0; i < count; i++) {
+ dst[i * 4 + 3] = src[i];
+ }
+}
+
+
+static void
+get_values_alpha8(struct gl_context *ctx, struct gl_renderbuffer *arb, GLuint count,
+ const GLint x[], const GLint y[], void *values)
+{
+ GLubyte *dst = (GLubyte *) values;
+ GLuint i;
+ ASSERT(arb != arb->Wrapped);
+ ASSERT(arb->DataType == GL_UNSIGNED_BYTE);
+ /* first, pass the call to the wrapped RGB buffer */
+ arb->Wrapped->GetValues(ctx, arb->Wrapped, count, x, y, values);
+ /* second, fill in alpha values from this buffer! */
+ for (i = 0; i < count; i++) {
+ const GLubyte *src = (GLubyte *) arb->Data + y[i] * arb->RowStride + x[i];
+ dst[i * 4 + 3] = *src;
+ }
+}
+
+
+static void
+put_row_alpha8(struct gl_context *ctx, struct gl_renderbuffer *arb, GLuint count,
+ GLint x, GLint y, const void *values, const GLubyte *mask)
+{
+ const GLubyte *src = (const GLubyte *) values;
+ GLubyte *dst = (GLubyte *) arb->Data + y * arb->RowStride + x;
+ GLuint i;
+ ASSERT(arb != arb->Wrapped);
+ ASSERT(arb->DataType == GL_UNSIGNED_BYTE);
+ /* first, pass the call to the wrapped RGB buffer */
+ arb->Wrapped->PutRow(ctx, arb->Wrapped, count, x, y, values, mask);
+ /* second, store alpha in our buffer */
+ for (i = 0; i < count; i++) {
+ if (!mask || mask[i]) {
+ dst[i] = src[i * 4 + 3];
+ }
+ }
+}
+
+
+static void
+put_row_rgb_alpha8(struct gl_context *ctx, struct gl_renderbuffer *arb, GLuint count,
+ GLint x, GLint y, const void *values, const GLubyte *mask)
+{
+ const GLubyte *src = (const GLubyte *) values;
+ GLubyte *dst = (GLubyte *) arb->Data + y * arb->RowStride + x;
+ GLuint i;
+ ASSERT(arb != arb->Wrapped);
+ ASSERT(arb->DataType == GL_UNSIGNED_BYTE);
+ /* first, pass the call to the wrapped RGB buffer */
+ arb->Wrapped->PutRowRGB(ctx, arb->Wrapped, count, x, y, values, mask);
+ /* second, store alpha in our buffer */
+ for (i = 0; i < count; i++) {
+ if (!mask || mask[i]) {
+ dst[i] = src[i * 4 + 3];
+ }
+ }
+}
+
+
+static void
+put_mono_row_alpha8(struct gl_context *ctx, struct gl_renderbuffer *arb, GLuint count,
+ GLint x, GLint y, const void *value, const GLubyte *mask)
+{
+ const GLubyte val = ((const GLubyte *) value)[3];
+ GLubyte *dst = (GLubyte *) arb->Data + y * arb->RowStride + x;
+ ASSERT(arb != arb->Wrapped);
+ ASSERT(arb->DataType == GL_UNSIGNED_BYTE);
+ /* first, pass the call to the wrapped RGB buffer */
+ arb->Wrapped->PutMonoRow(ctx, arb->Wrapped, count, x, y, value, mask);
+ /* second, store alpha in our buffer */
+ if (mask) {
+ GLuint i;
+ for (i = 0; i < count; i++) {
+ if (mask[i]) {
+ dst[i] = val;
+ }
+ }
+ }
+ else {
+ memset(dst, val, count);
+ }
+}
+
+
+static void
+put_values_alpha8(struct gl_context *ctx, struct gl_renderbuffer *arb, GLuint count,
+ const GLint x[], const GLint y[],
+ const void *values, const GLubyte *mask)
+{
+ const GLubyte *src = (const GLubyte *) values;
+ GLuint i;
+ ASSERT(arb != arb->Wrapped);
+ ASSERT(arb->DataType == GL_UNSIGNED_BYTE);
+ /* first, pass the call to the wrapped RGB buffer */
+ arb->Wrapped->PutValues(ctx, arb->Wrapped, count, x, y, values, mask);
+ /* second, store alpha in our buffer */
+ for (i = 0; i < count; i++) {
+ if (!mask || mask[i]) {
+ GLubyte *dst = (GLubyte *) arb->Data + y[i] * arb->RowStride + x[i];
+ *dst = src[i * 4 + 3];
+ }
+ }
+}
+
+
+static void
+put_mono_values_alpha8(struct gl_context *ctx, struct gl_renderbuffer *arb,
+ GLuint count, const GLint x[], const GLint y[],
+ const void *value, const GLubyte *mask)
+{
+ const GLubyte val = ((const GLubyte *) value)[3];
+ GLuint i;
+ ASSERT(arb != arb->Wrapped);
+ ASSERT(arb->DataType == GL_UNSIGNED_BYTE);
+ /* first, pass the call to the wrapped RGB buffer */
+ arb->Wrapped->PutValues(ctx, arb->Wrapped, count, x, y, value, mask);
+ /* second, store alpha in our buffer */
+ for (i = 0; i < count; i++) {
+ if (!mask || mask[i]) {
+ GLubyte *dst = (GLubyte *) arb->Data + y[i] * arb->RowStride + x[i];
+ *dst = val;
+ }
+ }
+}
+
+
+static void
+copy_buffer_alpha8(struct gl_renderbuffer* dst, struct gl_renderbuffer* src)
+{
+ ASSERT(dst->Format == MESA_FORMAT_A8);
+ ASSERT(src->Format == MESA_FORMAT_A8);
+ ASSERT(dst->Width == src->Width);
+ ASSERT(dst->Height == src->Height);
+ ASSERT(dst->RowStride == src->RowStride);
+
+ memcpy(dst->Data, src->Data, dst->RowStride * dst->Height * sizeof(GLubyte));
+}
+
+
+/**********************************************************************/
+/**********************************************************************/
+/**********************************************************************/
+
+
+/**
+ * Default GetPointer routine. Always return NULL to indicate that
+ * direct buffer access is not supported.
+ */
+static void *
+nop_get_pointer(struct gl_context *ctx, struct gl_renderbuffer *rb, GLint x, GLint y)
+{
+ return NULL;
+}
+
+
+/**
+ * Initialize the fields of a gl_renderbuffer to default values.
+ */
+void
+_mesa_init_renderbuffer(struct gl_renderbuffer *rb, GLuint name)
+{
+ _glthread_INIT_MUTEX(rb->Mutex);
+
+ rb->ClassID = 0;
+ rb->Name = name;
+ rb->RefCount = 0;
+ rb->Delete = _mesa_delete_renderbuffer;
+
+ /* The rest of these should be set later by the caller of this function or
+ * the AllocStorage method:
+ */
+ rb->AllocStorage = NULL;
+
+ rb->Width = 0;
+ rb->Height = 0;
+ rb->InternalFormat = GL_NONE;
+ rb->Format = MESA_FORMAT_NONE;
+
+ rb->DataType = GL_NONE;
+ rb->Data = NULL;
+
+ /* Point back to ourself so that we don't have to check for Wrapped==NULL
+ * all over the drivers.
+ */
+ rb->Wrapped = rb;
+
+ rb->GetPointer = nop_get_pointer;
+ rb->GetRow = NULL;
+ rb->GetValues = NULL;
+ rb->PutRow = NULL;
+ rb->PutRowRGB = NULL;
+ rb->PutMonoRow = NULL;
+ rb->PutValues = NULL;
+ rb->PutMonoValues = NULL;
+}
+
+
+/**
+ * Allocate a new gl_renderbuffer object. This can be used for user-created
+ * renderbuffers or window-system renderbuffers.
+ */
+struct gl_renderbuffer *
+_mesa_new_renderbuffer(struct gl_context *ctx, GLuint name)
+{
+ struct gl_renderbuffer *rb = CALLOC_STRUCT(gl_renderbuffer);
+ if (rb) {
+ _mesa_init_renderbuffer(rb, name);
+ }
+ return rb;
+}
+
+
+/**
+ * Delete a gl_framebuffer.
+ * This is the default function for renderbuffer->Delete().
+ */
+void
+_mesa_delete_renderbuffer(struct gl_renderbuffer *rb)
+{
+ if (rb->Data) {
+ free(rb->Data);
+ }
+ free(rb);
+}
+
+
+/**
+ * Allocate a software-based renderbuffer. This is called via the
+ * ctx->Driver.NewRenderbuffer() function when the user creates a new
+ * renderbuffer.
+ * This would not be used for hardware-based renderbuffers.
+ */
+struct gl_renderbuffer *
+_mesa_new_soft_renderbuffer(struct gl_context *ctx, GLuint name)
+{
+ struct gl_renderbuffer *rb = _mesa_new_renderbuffer(ctx, name);
+ if (rb) {
+ rb->AllocStorage = _mesa_soft_renderbuffer_storage;
+ /* Normally, one would setup the PutRow, GetRow, etc functions here.
+ * But we're doing that in the _mesa_soft_renderbuffer_storage() function
+ * instead.
+ */
+ }
+ return rb;
+}
+
+
+/**
+ * Add software-based color renderbuffers to the given framebuffer.
+ * This is a helper routine for device drivers when creating a
+ * window system framebuffer (not a user-created render/framebuffer).
+ * Once this function is called, you can basically forget about this
+ * renderbuffer; core Mesa will handle all the buffer management and
+ * rendering!
+ */
+GLboolean
+_mesa_add_color_renderbuffers(struct gl_context *ctx, struct gl_framebuffer *fb,
+ GLuint rgbBits, GLuint alphaBits,
+ GLboolean frontLeft, GLboolean backLeft,
+ GLboolean frontRight, GLboolean backRight)
+{
+ gl_buffer_index b;
+
+ if (rgbBits > 16 || alphaBits > 16) {
+ _mesa_problem(ctx,
+ "Unsupported bit depth in _mesa_add_color_renderbuffers");
+ return GL_FALSE;
+ }
+
+ assert(MAX_COLOR_ATTACHMENTS >= 4);
+
+ for (b = BUFFER_FRONT_LEFT; b <= BUFFER_BACK_RIGHT; b++) {
+ struct gl_renderbuffer *rb;
+
+ if (b == BUFFER_FRONT_LEFT && !frontLeft)
+ continue;
+ else if (b == BUFFER_BACK_LEFT && !backLeft)
+ continue;
+ else if (b == BUFFER_FRONT_RIGHT && !frontRight)
+ continue;
+ else if (b == BUFFER_BACK_RIGHT && !backRight)
+ continue;
+
+ assert(fb->Attachment[b].Renderbuffer == NULL);
+
+ rb = _mesa_new_renderbuffer(ctx, 0);
+ if (!rb) {
+ _mesa_error(ctx, GL_OUT_OF_MEMORY, "Allocating color buffer");
+ return GL_FALSE;
+ }
+
+ if (rgbBits <= 8) {
+ if (alphaBits)
+ rb->Format = MESA_FORMAT_RGBA8888;
+ else
+ rb->Format = MESA_FORMAT_RGB888;
+ }
+ else {
+ assert(rgbBits <= 16);
+ rb->Format = MESA_FORMAT_NONE; /*XXX RGBA16;*/
+ }
+ rb->InternalFormat = GL_RGBA;
+
+ rb->AllocStorage = _mesa_soft_renderbuffer_storage;
+ _mesa_add_renderbuffer(fb, b, rb);
+ }
+
+ return GL_TRUE;
+}
+
+
+/**
+ * Add software-based alpha renderbuffers to the given framebuffer.
+ * This is a helper routine for device drivers when creating a
+ * window system framebuffer (not a user-created render/framebuffer).
+ * Once this function is called, you can basically forget about this
+ * renderbuffer; core Mesa will handle all the buffer management and
+ * rendering!
+ */
+GLboolean
+_mesa_add_alpha_renderbuffers(struct gl_context *ctx, struct gl_framebuffer *fb,
+ GLuint alphaBits,
+ GLboolean frontLeft, GLboolean backLeft,
+ GLboolean frontRight, GLboolean backRight)
+{
+ gl_buffer_index b;
+
+ /* for window system framebuffers only! */
+ assert(fb->Name == 0);
+
+ if (alphaBits > 8) {
+ _mesa_problem(ctx,
+ "Unsupported bit depth in _mesa_add_alpha_renderbuffers");
+ return GL_FALSE;
+ }
+
+ assert(MAX_COLOR_ATTACHMENTS >= 4);
+
+ /* Wrap each of the RGB color buffers with an alpha renderbuffer.
+ */
+ for (b = BUFFER_FRONT_LEFT; b <= BUFFER_BACK_RIGHT; b++) {
+ struct gl_renderbuffer *arb;
+
+ if (b == BUFFER_FRONT_LEFT && !frontLeft)
+ continue;
+ else if (b == BUFFER_BACK_LEFT && !backLeft)
+ continue;
+ else if (b == BUFFER_FRONT_RIGHT && !frontRight)
+ continue;
+ else if (b == BUFFER_BACK_RIGHT && !backRight)
+ continue;
+
+ /* the RGB buffer to wrap must already exist!! */
+ assert(fb->Attachment[b].Renderbuffer);
+
+ /* only GLubyte supported for now */
+ assert(fb->Attachment[b].Renderbuffer->DataType == GL_UNSIGNED_BYTE);
+
+ /* allocate alpha renderbuffer */
+ arb = _mesa_new_renderbuffer(ctx, 0);
+ if (!arb) {
+ _mesa_error(ctx, GL_OUT_OF_MEMORY, "Allocating alpha buffer");
+ return GL_FALSE;
+ }
+
+ /* wrap the alpha renderbuffer around the RGB renderbuffer */
+ arb->Wrapped = fb->Attachment[b].Renderbuffer;
+
+ /* Set up my alphabuffer fields and plug in my functions.
+ * The functions will put/get the alpha values from/to RGBA arrays
+ * and then call the wrapped buffer's functions to handle the RGB
+ * values.
+ */
+ arb->InternalFormat = arb->Wrapped->InternalFormat;
+ arb->Format = MESA_FORMAT_A8;
+ arb->DataType = arb->Wrapped->DataType;
+ arb->AllocStorage = alloc_storage_alpha8;
+ arb->Delete = delete_renderbuffer_alpha8;
+ arb->GetPointer = get_pointer_alpha8;
+ arb->GetRow = get_row_alpha8;
+ arb->GetValues = get_values_alpha8;
+ arb->PutRow = put_row_alpha8;
+ arb->PutRowRGB = put_row_rgb_alpha8;
+ arb->PutMonoRow = put_mono_row_alpha8;
+ arb->PutValues = put_values_alpha8;
+ arb->PutMonoValues = put_mono_values_alpha8;
+
+ /* clear the pointer to avoid assertion/sanity check failure later */
+ fb->Attachment[b].Renderbuffer = NULL;
+
+ /* plug the alpha renderbuffer into the colorbuffer attachment */
+ _mesa_add_renderbuffer(fb, b, arb);
+ }
+
+ return GL_TRUE;
+}
+
+
+/**
+ * For framebuffers that use a software alpha channel wrapper
+ * created by _mesa_add_alpha_renderbuffer or _mesa_add_soft_renderbuffers,
+ * copy the back buffer alpha channel into the front buffer alpha channel.
+ */
+void
+_mesa_copy_soft_alpha_renderbuffers(struct gl_context *ctx, struct gl_framebuffer *fb)
+{
+ if (fb->Attachment[BUFFER_FRONT_LEFT].Renderbuffer &&
+ fb->Attachment[BUFFER_BACK_LEFT].Renderbuffer)
+ copy_buffer_alpha8(fb->Attachment[BUFFER_FRONT_LEFT].Renderbuffer,
+ fb->Attachment[BUFFER_BACK_LEFT].Renderbuffer);
+
+
+ if (fb->Attachment[BUFFER_FRONT_RIGHT].Renderbuffer &&
+ fb->Attachment[BUFFER_BACK_RIGHT].Renderbuffer)
+ copy_buffer_alpha8(fb->Attachment[BUFFER_FRONT_RIGHT].Renderbuffer,
+ fb->Attachment[BUFFER_BACK_RIGHT].Renderbuffer);
+}
+
+
+/**
+ * Add a software-based depth renderbuffer to the given framebuffer.
+ * This is a helper routine for device drivers when creating a
+ * window system framebuffer (not a user-created render/framebuffer).
+ * Once this function is called, you can basically forget about this
+ * renderbuffer; core Mesa will handle all the buffer management and
+ * rendering!
+ */
+GLboolean
+_mesa_add_depth_renderbuffer(struct gl_context *ctx, struct gl_framebuffer *fb,
+ GLuint depthBits)
+{
+ struct gl_renderbuffer *rb;
+
+ if (depthBits > 32) {
+ _mesa_problem(ctx,
+ "Unsupported depthBits in _mesa_add_depth_renderbuffer");
+ return GL_FALSE;
+ }
+
+ assert(fb->Attachment[BUFFER_DEPTH].Renderbuffer == NULL);
+
+ rb = _mesa_new_renderbuffer(ctx, 0);
+ if (!rb) {
+ _mesa_error(ctx, GL_OUT_OF_MEMORY, "Allocating depth buffer");
+ return GL_FALSE;
+ }
+
+ if (depthBits <= 16) {
+ rb->Format = MESA_FORMAT_Z16;
+ rb->InternalFormat = GL_DEPTH_COMPONENT16;
+ }
+ else if (depthBits <= 24) {
+ rb->Format = MESA_FORMAT_X8_Z24;
+ rb->InternalFormat = GL_DEPTH_COMPONENT24;
+ }
+ else {
+ rb->Format = MESA_FORMAT_Z32;
+ rb->InternalFormat = GL_DEPTH_COMPONENT32;
+ }
+
+ rb->AllocStorage = _mesa_soft_renderbuffer_storage;
+ _mesa_add_renderbuffer(fb, BUFFER_DEPTH, rb);
+
+ return GL_TRUE;
+}
+
+
+/**
+ * Add a software-based stencil renderbuffer to the given framebuffer.
+ * This is a helper routine for device drivers when creating a
+ * window system framebuffer (not a user-created render/framebuffer).
+ * Once this function is called, you can basically forget about this
+ * renderbuffer; core Mesa will handle all the buffer management and
+ * rendering!
+ */
+GLboolean
+_mesa_add_stencil_renderbuffer(struct gl_context *ctx, struct gl_framebuffer *fb,
+ GLuint stencilBits)
+{
+ struct gl_renderbuffer *rb;
+
+ if (stencilBits > 16) {
+ _mesa_problem(ctx,
+ "Unsupported stencilBits in _mesa_add_stencil_renderbuffer");
+ return GL_FALSE;
+ }
+
+ assert(fb->Attachment[BUFFER_STENCIL].Renderbuffer == NULL);
+
+ rb = _mesa_new_renderbuffer(ctx, 0);
+ if (!rb) {
+ _mesa_error(ctx, GL_OUT_OF_MEMORY, "Allocating stencil buffer");
+ return GL_FALSE;
+ }
+
+ assert(stencilBits <= 8);
+ rb->Format = MESA_FORMAT_S8;
+ rb->InternalFormat = GL_STENCIL_INDEX8;
+
+ rb->AllocStorage = _mesa_soft_renderbuffer_storage;
+ _mesa_add_renderbuffer(fb, BUFFER_STENCIL, rb);
+
+ return GL_TRUE;
+}
+
+
+/**
+ * Add a software-based accumulation renderbuffer to the given framebuffer.
+ * This is a helper routine for device drivers when creating a
+ * window system framebuffer (not a user-created render/framebuffer).
+ * Once this function is called, you can basically forget about this
+ * renderbuffer; core Mesa will handle all the buffer management and
+ * rendering!
+ */
+GLboolean
+_mesa_add_accum_renderbuffer(struct gl_context *ctx, struct gl_framebuffer *fb,
+ GLuint redBits, GLuint greenBits,
+ GLuint blueBits, GLuint alphaBits)
+{
+ struct gl_renderbuffer *rb;
+
+ if (redBits > 16 || greenBits > 16 || blueBits > 16 || alphaBits > 16) {
+ _mesa_problem(ctx,
+ "Unsupported accumBits in _mesa_add_accum_renderbuffer");
+ return GL_FALSE;
+ }
+
+ assert(fb->Attachment[BUFFER_ACCUM].Renderbuffer == NULL);
+
+ rb = _mesa_new_renderbuffer(ctx, 0);
+ if (!rb) {
+ _mesa_error(ctx, GL_OUT_OF_MEMORY, "Allocating accum buffer");
+ return GL_FALSE;
+ }
+
+ rb->Format = MESA_FORMAT_SIGNED_RGBA_16;
+ rb->InternalFormat = GL_RGBA16_SNORM;
+ rb->AllocStorage = _mesa_soft_renderbuffer_storage;
+ _mesa_add_renderbuffer(fb, BUFFER_ACCUM, rb);
+
+ return GL_TRUE;
+}
+
+
+
+/**
+ * Add a software-based aux renderbuffer to the given framebuffer.
+ * This is a helper routine for device drivers when creating a
+ * window system framebuffer (not a user-created render/framebuffer).
+ * Once this function is called, you can basically forget about this
+ * renderbuffer; core Mesa will handle all the buffer management and
+ * rendering!
+ *
+ * NOTE: color-index aux buffers not supported.
+ */
+GLboolean
+_mesa_add_aux_renderbuffers(struct gl_context *ctx, struct gl_framebuffer *fb,
+ GLuint colorBits, GLuint numBuffers)
+{
+ GLuint i;
+
+ if (colorBits > 16) {
+ _mesa_problem(ctx,
+ "Unsupported accumBits in _mesa_add_aux_renderbuffers");
+ return GL_FALSE;
+ }
+
+ assert(numBuffers <= MAX_AUX_BUFFERS);
+
+ for (i = 0; i < numBuffers; i++) {
+ struct gl_renderbuffer *rb = _mesa_new_renderbuffer(ctx, 0);
+
+ assert(fb->Attachment[BUFFER_AUX0 + i].Renderbuffer == NULL);
+
+ if (!rb) {
+ _mesa_error(ctx, GL_OUT_OF_MEMORY, "Allocating aux buffer");
+ return GL_FALSE;
+ }
+
+ assert (colorBits <= 8);
+ rb->Format = MESA_FORMAT_RGBA8888;
+ rb->InternalFormat = GL_RGBA;
+
+ rb->AllocStorage = _mesa_soft_renderbuffer_storage;
+ _mesa_add_renderbuffer(fb, BUFFER_AUX0 + i, rb);
+ }
+ return GL_TRUE;
+}
+
+
+/**
+ * Create/attach software-based renderbuffers to the given framebuffer.
+ * This is a helper routine for device drivers. Drivers can just as well
+ * call the individual _mesa_add_*_renderbuffer() routines directly.
+ */
+void
+_mesa_add_soft_renderbuffers(struct gl_framebuffer *fb,
+ GLboolean color,
+ GLboolean depth,
+ GLboolean stencil,
+ GLboolean accum,
+ GLboolean alpha,
+ GLboolean aux)
+{
+ GLboolean frontLeft = GL_TRUE;
+ GLboolean backLeft = fb->Visual.doubleBufferMode;
+ GLboolean frontRight = fb->Visual.stereoMode;
+ GLboolean backRight = fb->Visual.stereoMode && fb->Visual.doubleBufferMode;
+
+ if (color) {
+ assert(fb->Visual.redBits == fb->Visual.greenBits);
+ assert(fb->Visual.redBits == fb->Visual.blueBits);
+ _mesa_add_color_renderbuffers(NULL, fb,
+ fb->Visual.redBits,
+ fb->Visual.alphaBits,
+ frontLeft, backLeft,
+ frontRight, backRight);
+ }
+
+ if (depth) {
+ assert(fb->Visual.depthBits > 0);
+ _mesa_add_depth_renderbuffer(NULL, fb, fb->Visual.depthBits);
+ }
+
+ if (stencil) {
+ assert(fb->Visual.stencilBits > 0);
+ _mesa_add_stencil_renderbuffer(NULL, fb, fb->Visual.stencilBits);
+ }
+
+ if (accum) {
+ assert(fb->Visual.accumRedBits > 0);
+ assert(fb->Visual.accumGreenBits > 0);
+ assert(fb->Visual.accumBlueBits > 0);
+ _mesa_add_accum_renderbuffer(NULL, fb,
+ fb->Visual.accumRedBits,
+ fb->Visual.accumGreenBits,
+ fb->Visual.accumBlueBits,
+ fb->Visual.accumAlphaBits);
+ }
+
+ if (aux) {
+ assert(fb->Visual.numAuxBuffers > 0);
+ _mesa_add_aux_renderbuffers(NULL, fb, fb->Visual.redBits,
+ fb->Visual.numAuxBuffers);
+ }
+
+ if (alpha) {
+ assert(fb->Visual.alphaBits > 0);
+ _mesa_add_alpha_renderbuffers(NULL, fb, fb->Visual.alphaBits,
+ frontLeft, backLeft,
+ frontRight, backRight);
+ }
+
+#if 0
+ if (multisample) {
+ /* maybe someday */
+ }
+#endif
+}
+
+
+/**
+ * Attach a renderbuffer to a framebuffer.
+ * \param bufferName one of the BUFFER_x tokens
+ */
+void
+_mesa_add_renderbuffer(struct gl_framebuffer *fb,
+ gl_buffer_index bufferName, struct gl_renderbuffer *rb)
+{
+ assert(fb);
+ assert(rb);
+ assert(bufferName < BUFFER_COUNT);
+
+ /* There should be no previous renderbuffer on this attachment point,
+ * with the exception of depth/stencil since the same renderbuffer may
+ * be used for both.
+ */
+ assert(bufferName == BUFFER_DEPTH ||
+ bufferName == BUFFER_STENCIL ||
+ fb->Attachment[bufferName].Renderbuffer == NULL);
+
+ /* winsys vs. user-created buffer cross check */
+ if (fb->Name) {
+ assert(rb->Name);
+ }
+ else {
+ assert(!rb->Name);
+ }
+
+ fb->Attachment[bufferName].Type = GL_RENDERBUFFER_EXT;
+ fb->Attachment[bufferName].Complete = GL_TRUE;
+ _mesa_reference_renderbuffer(&fb->Attachment[bufferName].Renderbuffer, rb);
+}
+
+
+/**
+ * Remove the named renderbuffer from the given framebuffer.
+ * \param bufferName one of the BUFFER_x tokens
+ */
+void
+_mesa_remove_renderbuffer(struct gl_framebuffer *fb,
+ gl_buffer_index bufferName)
+{
+ struct gl_renderbuffer *rb;
+
+ assert(bufferName < BUFFER_COUNT);
+
+ rb = fb->Attachment[bufferName].Renderbuffer;
+ if (!rb)
+ return;
+
+ _mesa_reference_renderbuffer(&rb, NULL);
+
+ fb->Attachment[bufferName].Renderbuffer = NULL;
+}
+
+
+/**
+ * Set *ptr to point to rb. If *ptr points to another renderbuffer,
+ * dereference that buffer first. The new renderbuffer's refcount will
+ * be incremented. The old renderbuffer's refcount will be decremented.
+ */
+void
+_mesa_reference_renderbuffer(struct gl_renderbuffer **ptr,
+ struct gl_renderbuffer *rb)
+{
+ assert(ptr);
+ if (*ptr == rb) {
+ /* no change */
+ return;
+ }
+
+ if (*ptr) {
+ /* Unreference the old renderbuffer */
+ GLboolean deleteFlag = GL_FALSE;
+ struct gl_renderbuffer *oldRb = *ptr;
+
+ _glthread_LOCK_MUTEX(oldRb->Mutex);
+ ASSERT(oldRb->RefCount > 0);
+ oldRb->RefCount--;
+ /*printf("RB DECR %p (%d) to %d\n", (void*) oldRb, oldRb->Name, oldRb->RefCount);*/
+ deleteFlag = (oldRb->RefCount == 0);
+ _glthread_UNLOCK_MUTEX(oldRb->Mutex);
+
+ if (deleteFlag) {
+ oldRb->Delete(oldRb);
+ }
+
+ *ptr = NULL;
+ }
+ assert(!*ptr);
+
+ if (rb) {
+ /* reference new renderbuffer */
+ _glthread_LOCK_MUTEX(rb->Mutex);
+ rb->RefCount++;
+ /*printf("RB INCR %p (%d) to %d\n", (void*) rb, rb->Name, rb->RefCount);*/
+ _glthread_UNLOCK_MUTEX(rb->Mutex);
+ *ptr = rb;
+ }
+}
+
+
+/**
+ * Create a new combined depth/stencil renderbuffer for implementing
+ * the GL_EXT_packed_depth_stencil extension.
+ * \return new depth/stencil renderbuffer
+ */
+struct gl_renderbuffer *
+_mesa_new_depthstencil_renderbuffer(struct gl_context *ctx, GLuint name)
+{
+ struct gl_renderbuffer *dsrb;
+
+ dsrb = _mesa_new_renderbuffer(ctx, name);
+ if (!dsrb)
+ return NULL;
+
+ /* init fields not covered by _mesa_new_renderbuffer() */
+ dsrb->InternalFormat = GL_DEPTH24_STENCIL8_EXT;
+ dsrb->Format = MESA_FORMAT_Z24_S8;
+ dsrb->AllocStorage = _mesa_soft_renderbuffer_storage;
+
+ return dsrb;
+}
diff --git a/mesalib/src/mesa/main/renderbuffer.h b/mesalib/src/mesa/main/renderbuffer.h
index 39d9b3035..a3a618297 100644
--- a/mesalib/src/mesa/main/renderbuffer.h
+++ b/mesalib/src/mesa/main/renderbuffer.h
@@ -1,115 +1,115 @@
-/*
- * Mesa 3-D graphics library
- * Version: 6.5
- *
- * Copyright (C) 1999-2005 Brian Paul All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-
-#ifndef RENDERBUFFER_H
-#define RENDERBUFFER_H
-
-#include "glheader.h"
-#include "mtypes.h"
-
-struct gl_context;
-struct gl_framebuffer;
-struct gl_renderbuffer;
-
-extern void
-_mesa_init_renderbuffer(struct gl_renderbuffer *rb, GLuint name);
-
-extern struct gl_renderbuffer *
-_mesa_new_renderbuffer(struct gl_context *ctx, GLuint name);
-
-extern void
-_mesa_delete_renderbuffer(struct gl_renderbuffer *rb);
-
-
-extern struct gl_renderbuffer *
-_mesa_new_soft_renderbuffer(struct gl_context *ctx, GLuint name);
-
-extern void
-_mesa_set_renderbuffer_accessors(struct gl_renderbuffer *rb);
-
-extern GLboolean
-_mesa_soft_renderbuffer_storage(struct gl_context *ctx, struct gl_renderbuffer *rb,
- GLenum internalFormat,
- GLuint width, GLuint height);
-
-extern GLboolean
-_mesa_add_color_renderbuffers(struct gl_context *ctx, struct gl_framebuffer *fb,
- GLuint rgbBits, GLuint alphaBits,
- GLboolean frontLeft, GLboolean backLeft,
- GLboolean frontRight, GLboolean backRight);
-
-extern GLboolean
-_mesa_add_alpha_renderbuffers(struct gl_context *ctx, struct gl_framebuffer *fb,
- GLuint alphaBits,
- GLboolean frontLeft, GLboolean backLeft,
- GLboolean frontRight, GLboolean backRight);
-
-extern void
-_mesa_copy_soft_alpha_renderbuffers(struct gl_context *ctx, struct gl_framebuffer *fb);
-
-extern GLboolean
-_mesa_add_depth_renderbuffer(struct gl_context *ctx, struct gl_framebuffer *fb,
- GLuint depthBits);
-
-extern GLboolean
-_mesa_add_stencil_renderbuffer(struct gl_context *ctx, struct gl_framebuffer *fb,
- GLuint stencilBits);
-
-
-extern GLboolean
-_mesa_add_accum_renderbuffer(struct gl_context *ctx, struct gl_framebuffer *fb,
- GLuint redBits, GLuint greenBits,
- GLuint blueBits, GLuint alphaBits);
-
-extern GLboolean
-_mesa_add_aux_renderbuffers(struct gl_context *ctx, struct gl_framebuffer *fb,
- GLuint bits, GLuint numBuffers);
-
-extern void
-_mesa_add_soft_renderbuffers(struct gl_framebuffer *fb,
- GLboolean color,
- GLboolean depth,
- GLboolean stencil,
- GLboolean accum,
- GLboolean alpha,
- GLboolean aux);
-
-extern void
-_mesa_add_renderbuffer(struct gl_framebuffer *fb,
- gl_buffer_index bufferName, struct gl_renderbuffer *rb);
-
-extern void
-_mesa_remove_renderbuffer(struct gl_framebuffer *fb,
- gl_buffer_index bufferName);
-
-extern void
-_mesa_reference_renderbuffer(struct gl_renderbuffer **ptr,
- struct gl_renderbuffer *rb);
-
-extern struct gl_renderbuffer *
-_mesa_new_depthstencil_renderbuffer(struct gl_context *ctx, GLuint name);
-
-
-#endif /* RENDERBUFFER_H */
+/*
+ * Mesa 3-D graphics library
+ * Version: 6.5
+ *
+ * Copyright (C) 1999-2005 Brian Paul All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+
+#ifndef RENDERBUFFER_H
+#define RENDERBUFFER_H
+
+#include "glheader.h"
+#include "mtypes.h"
+
+struct gl_context;
+struct gl_framebuffer;
+struct gl_renderbuffer;
+
+extern void
+_mesa_init_renderbuffer(struct gl_renderbuffer *rb, GLuint name);
+
+extern struct gl_renderbuffer *
+_mesa_new_renderbuffer(struct gl_context *ctx, GLuint name);
+
+extern void
+_mesa_delete_renderbuffer(struct gl_renderbuffer *rb);
+
+
+extern struct gl_renderbuffer *
+_mesa_new_soft_renderbuffer(struct gl_context *ctx, GLuint name);
+
+extern void
+_mesa_set_renderbuffer_accessors(struct gl_renderbuffer *rb);
+
+extern GLboolean
+_mesa_soft_renderbuffer_storage(struct gl_context *ctx, struct gl_renderbuffer *rb,
+ GLenum internalFormat,
+ GLuint width, GLuint height);
+
+extern GLboolean
+_mesa_add_color_renderbuffers(struct gl_context *ctx, struct gl_framebuffer *fb,
+ GLuint rgbBits, GLuint alphaBits,
+ GLboolean frontLeft, GLboolean backLeft,
+ GLboolean frontRight, GLboolean backRight);
+
+extern GLboolean
+_mesa_add_alpha_renderbuffers(struct gl_context *ctx, struct gl_framebuffer *fb,
+ GLuint alphaBits,
+ GLboolean frontLeft, GLboolean backLeft,
+ GLboolean frontRight, GLboolean backRight);
+
+extern void
+_mesa_copy_soft_alpha_renderbuffers(struct gl_context *ctx, struct gl_framebuffer *fb);
+
+extern GLboolean
+_mesa_add_depth_renderbuffer(struct gl_context *ctx, struct gl_framebuffer *fb,
+ GLuint depthBits);
+
+extern GLboolean
+_mesa_add_stencil_renderbuffer(struct gl_context *ctx, struct gl_framebuffer *fb,
+ GLuint stencilBits);
+
+
+extern GLboolean
+_mesa_add_accum_renderbuffer(struct gl_context *ctx, struct gl_framebuffer *fb,
+ GLuint redBits, GLuint greenBits,
+ GLuint blueBits, GLuint alphaBits);
+
+extern GLboolean
+_mesa_add_aux_renderbuffers(struct gl_context *ctx, struct gl_framebuffer *fb,
+ GLuint bits, GLuint numBuffers);
+
+extern void
+_mesa_add_soft_renderbuffers(struct gl_framebuffer *fb,
+ GLboolean color,
+ GLboolean depth,
+ GLboolean stencil,
+ GLboolean accum,
+ GLboolean alpha,
+ GLboolean aux);
+
+extern void
+_mesa_add_renderbuffer(struct gl_framebuffer *fb,
+ gl_buffer_index bufferName, struct gl_renderbuffer *rb);
+
+extern void
+_mesa_remove_renderbuffer(struct gl_framebuffer *fb,
+ gl_buffer_index bufferName);
+
+extern void
+_mesa_reference_renderbuffer(struct gl_renderbuffer **ptr,
+ struct gl_renderbuffer *rb);
+
+extern struct gl_renderbuffer *
+_mesa_new_depthstencil_renderbuffer(struct gl_context *ctx, GLuint name);
+
+
+#endif /* RENDERBUFFER_H */
diff --git a/mesalib/src/mesa/main/samplerobj.c b/mesalib/src/mesa/main/samplerobj.c
index f7774fdd7..9a5ba2955 100644
--- a/mesalib/src/mesa/main/samplerobj.c
+++ b/mesalib/src/mesa/main/samplerobj.c
@@ -1,1413 +1,1413 @@
-/*
- * Mesa 3-D graphics library
- *
- * Copyright (C) 2011 VMware, Inc. All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-
-/**
- * \file samplerobj.c
- * \brief Functions for the GL_ARB_sampler_objects extension.
- * \author Brian Paul
- */
-
-
-#include "main/glheader.h"
-#include "main/context.h"
-#include "main/dispatch.h"
-#include "main/enums.h"
-#include "main/hash.h"
-#include "main/macros.h"
-#include "main/mfeatures.h"
-#include "main/mtypes.h"
-#include "main/samplerobj.h"
-
-
-static struct gl_sampler_object *
-_mesa_lookup_samplerobj(struct gl_context *ctx, GLuint name)
-{
- if (name == 0)
- return NULL;
- else
- return (struct gl_sampler_object *)
- _mesa_HashLookup(ctx->Shared->SamplerObjects, name);
-}
-
-
-/**
- * Handle reference counting.
- */
-void
-_mesa_reference_sampler_object(struct gl_context *ctx,
- struct gl_sampler_object **ptr,
- struct gl_sampler_object *samp)
-{
- if (*ptr == samp)
- return;
-
- if (*ptr) {
- /* Unreference the old sampler */
- GLboolean deleteFlag = GL_FALSE;
- struct gl_sampler_object *oldSamp = *ptr;
-
- /*_glthread_LOCK_MUTEX(oldSamp->Mutex);*/
- ASSERT(oldSamp->RefCount > 0);
- oldSamp->RefCount--;
-#if 0
- printf("SamplerObj %p %d DECR to %d\n",
- (void *) oldSamp, oldSamp->Name, oldSamp->RefCount);
-#endif
- deleteFlag = (oldSamp->RefCount == 0);
- /*_glthread_UNLOCK_MUTEX(oldSamp->Mutex);*/
-
- if (deleteFlag) {
- ASSERT(ctx->Driver.DeleteSamplerObject);
- ctx->Driver.DeleteSamplerObject(ctx, oldSamp);
- }
-
- *ptr = NULL;
- }
- ASSERT(!*ptr);
-
- if (samp) {
- /* reference new sampler */
- /*_glthread_LOCK_MUTEX(samp->Mutex);*/
- if (samp->RefCount == 0) {
- /* this sampler's being deleted (look just above) */
- /* Not sure this can every really happen. Warn if it does. */
- _mesa_problem(NULL, "referencing deleted sampler object");
- *ptr = NULL;
- }
- else {
- samp->RefCount++;
-#if 0
- printf("SamplerObj %p %d INCR to %d\n",
- (void *) samp, samp->Name, samp->RefCount);
-#endif
- *ptr = samp;
- }
- /*_glthread_UNLOCK_MUTEX(samp->Mutex);*/
- }
-}
-
-
-/**
- * Initialize the fields of the given sampler object.
- */
-void
-_mesa_init_sampler_object(struct gl_sampler_object *sampObj, GLuint name)
-{
- sampObj->Name = name;
- sampObj->RefCount = 1;
- sampObj->WrapS = GL_REPEAT;
- sampObj->WrapT = GL_REPEAT;
- sampObj->WrapR = GL_REPEAT;
- sampObj->MinFilter = GL_NEAREST_MIPMAP_LINEAR;
- sampObj->MagFilter = GL_LINEAR;
- sampObj->BorderColor.f[0] = 0.0;
- sampObj->BorderColor.f[1] = 0.0;
- sampObj->BorderColor.f[2] = 0.0;
- sampObj->BorderColor.f[3] = 0.0;
- sampObj->MinLod = -1000.0F;
- sampObj->MaxLod = 1000.0F;
- sampObj->LodBias = 0.0F;
- sampObj->MaxAnisotropy = 1.0F;
- sampObj->CompareMode = GL_NONE;
- sampObj->CompareFunc = GL_LEQUAL;
- sampObj->CompareFailValue = 0.0;
- sampObj->sRGBDecode = GL_DECODE_EXT;
- sampObj->CubeMapSeamless = GL_FALSE;
- sampObj->DepthMode = 0;
-}
-
-
-/**
- * Fallback for ctx->Driver.NewSamplerObject();
- */
-struct gl_sampler_object *
-_mesa_new_sampler_object(struct gl_context *ctx, GLuint name)
-{
- struct gl_sampler_object *sampObj = CALLOC_STRUCT(gl_sampler_object);
- if (sampObj) {
- _mesa_init_sampler_object(sampObj, name);
- }
- return sampObj;
-}
-
-
-/**
- * Fallback for ctx->Driver.DeleteSamplerObject();
- */
-void
-_mesa_delete_sampler_object(struct gl_context *ctx,
- struct gl_sampler_object *sampObj)
-{
- FREE(sampObj);
-}
-
-
-static void GLAPIENTRY
-_mesa_GenSamplers(GLsizei count, GLuint *samplers)
-{
- GET_CURRENT_CONTEXT(ctx);
- GLuint first;
- GLint i;
-
- ASSERT_OUTSIDE_BEGIN_END(ctx);
-
- if (MESA_VERBOSE & VERBOSE_API)
- _mesa_debug(ctx, "glGenSamplers(%d)\n", count);
-
- if (count < 0) {
- _mesa_error(ctx, GL_INVALID_VALUE, "glGenSamplers");
- return;
- }
-
- if (!samplers)
- return;
-
- first = _mesa_HashFindFreeKeyBlock(ctx->Shared->SamplerObjects, count);
-
- /* Insert the ID and pointer to new sampler object into hash table */
- for (i = 0; i < count; i++) {
- struct gl_sampler_object *sampObj =
- ctx->Driver.NewSamplerObject(ctx, first + i);
- _mesa_HashInsert(ctx->Shared->SamplerObjects, first + i, sampObj);
- samplers[i] = first + i;
- }
-}
-
-
-static void GLAPIENTRY
-_mesa_DeleteSamplers(GLsizei count, const GLuint *samplers)
-{
- GET_CURRENT_CONTEXT(ctx);
- GLsizei i;
-
- ASSERT_OUTSIDE_BEGIN_END(ctx);
- FLUSH_VERTICES(ctx, 0);
-
- if (count < 0) {
- _mesa_error(ctx, GL_INVALID_VALUE, "glDeleteSamplers(count)");
- return;
- }
-
- _glthread_LOCK_MUTEX(ctx->Shared->Mutex);
-
- for (i = 0; i < count; i++) {
- if (samplers[i]) {
- struct gl_sampler_object *sampObj =
- _mesa_lookup_samplerobj(ctx, samplers[i]);
- if (sampObj) {
- /* The ID is immediately freed for re-use */
- _mesa_HashRemove(ctx->Shared->SamplerObjects, samplers[i]);
- /* But the object exists until its reference count goes to zero */
- _mesa_reference_sampler_object(ctx, &sampObj, NULL);
- }
- }
- }
-
- _glthread_UNLOCK_MUTEX(ctx->Shared->Mutex);
-}
-
-
-static GLboolean GLAPIENTRY
-_mesa_IsSampler(GLuint sampler)
-{
- struct gl_sampler_object *sampObj;
- GET_CURRENT_CONTEXT(ctx);
-
- ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, GL_FALSE);
-
- if (sampler == 0)
- return GL_FALSE;
-
- sampObj = _mesa_lookup_samplerobj(ctx, sampler);
-
- return sampObj != NULL;
-}
-
-
-static void GLAPIENTRY
-_mesa_BindSampler(GLuint unit, GLuint sampler)
-{
- struct gl_sampler_object *sampObj;
- GET_CURRENT_CONTEXT(ctx);
-
- if (unit >= ctx->Const.MaxTextureImageUnits) {
- _mesa_error(ctx, GL_INVALID_VALUE, "glBindSampler(unit %u)", unit);
- return;
- }
-
- if (sampler == 0) {
- /* Use the default sampler object, the one contained in the texture
- * object.
- */
- sampObj = NULL;
- }
- else {
- /* user-defined sampler object */
- sampObj = _mesa_lookup_samplerobj(ctx, sampler);
- if (!sampObj) {
- _mesa_error(ctx, GL_INVALID_OPERATION, "glBindSampler(sampler)");
- return;
- }
- }
-
- if (ctx->Texture.Unit[unit].Sampler != sampObj) {
- FLUSH_VERTICES(ctx, _NEW_TEXTURE);
- }
-
- /* bind new sampler */
- _mesa_reference_sampler_object(ctx, &ctx->Texture.Unit[unit].Sampler,
- sampObj);
-}
-
-
-/**
- * Check if a coordinate wrap mode is legal.
- * \return GL_TRUE if legal, GL_FALSE otherwise
- */
-static GLboolean
-validate_texture_wrap_mode(struct gl_context *ctx, GLenum wrap)
-{
- const struct gl_extensions * const e = &ctx->Extensions;
-
- switch (wrap) {
- case GL_CLAMP:
- case GL_CLAMP_TO_EDGE:
- case GL_REPEAT:
- return GL_TRUE;
- case GL_CLAMP_TO_BORDER:
- return e->ARB_texture_border_clamp;
- case GL_MIRRORED_REPEAT:
- return e->ARB_texture_mirrored_repeat;
- case GL_MIRROR_CLAMP_EXT:
- return e->ATI_texture_mirror_once || e->EXT_texture_mirror_clamp;
- case GL_MIRROR_CLAMP_TO_EDGE_EXT:
- return e->ATI_texture_mirror_once || e->EXT_texture_mirror_clamp;
- case GL_MIRROR_CLAMP_TO_BORDER_EXT:
- return e->EXT_texture_mirror_clamp;
- default:
- return GL_FALSE;
- }
-}
-
-
-/**
- * This is called just prior to changing any sampler object state.
- */
-static INLINE void
-flush(struct gl_context *ctx)
-{
- FLUSH_VERTICES(ctx, _NEW_TEXTURE);
-}
-
-
-#define INVALID_PARAM 0x100
-#define INVALID_PNAME 0x101
-#define INVALID_VALUE 0x102
-
-static GLuint
-set_sampler_wrap_s(struct gl_context *ctx, struct gl_sampler_object *samp,
- GLint param)
-{
- if (samp->WrapS == param)
- return GL_FALSE;
- if (validate_texture_wrap_mode(ctx, param)) {
- flush(ctx);
- samp->WrapS = param;
- return GL_TRUE;
- }
- return INVALID_PARAM;
-}
-
-
-static GLuint
-set_sampler_wrap_t(struct gl_context *ctx, struct gl_sampler_object *samp,
- GLint param)
-{
- if (samp->WrapT == param)
- return GL_FALSE;
- if (validate_texture_wrap_mode(ctx, param)) {
- flush(ctx);
- samp->WrapT = param;
- return GL_TRUE;
- }
- return INVALID_PARAM;
-}
-
-
-static GLuint
-set_sampler_wrap_r(struct gl_context *ctx, struct gl_sampler_object *samp,
- GLint param)
-{
- if (samp->WrapR == param)
- return GL_FALSE;
- if (validate_texture_wrap_mode(ctx, param)) {
- flush(ctx);
- samp->WrapR = param;
- return GL_TRUE;
- }
- return INVALID_PARAM;
-}
-
-
-static GLuint
-set_sampler_min_filter(struct gl_context *ctx, struct gl_sampler_object *samp,
- GLint param)
-{
- if (samp->MinFilter == param)
- return GL_FALSE;
-
- switch (param) {
- case GL_NEAREST:
- case GL_LINEAR:
- case GL_NEAREST_MIPMAP_NEAREST:
- case GL_LINEAR_MIPMAP_NEAREST:
- case GL_NEAREST_MIPMAP_LINEAR:
- case GL_LINEAR_MIPMAP_LINEAR:
- flush(ctx);
- samp->MinFilter = param;
- return GL_TRUE;
- default:
- return INVALID_PARAM;
- }
-}
-
-
-static GLuint
-set_sampler_mag_filter(struct gl_context *ctx, struct gl_sampler_object *samp,
- GLint param)
-{
- if (samp->MagFilter == param)
- return GL_FALSE;
-
- switch (param) {
- case GL_NEAREST:
- case GL_LINEAR:
- flush(ctx);
- samp->MagFilter = param;
- return GL_TRUE;
- default:
- return INVALID_PARAM;
- }
-}
-
-
-static GLuint
-set_sampler_lod_bias(struct gl_context *ctx, struct gl_sampler_object *samp,
- GLfloat param)
-{
- if (samp->LodBias == param)
- return GL_FALSE;
-
- flush(ctx);
- samp->LodBias = param;
- return GL_TRUE;
-}
-
-
-static GLuint
-set_sampler_border_colorf(struct gl_context *ctx,
- struct gl_sampler_object *samp,
- const GLfloat params[4])
-{
- flush(ctx);
- samp->BorderColor.f[RCOMP] = params[0];
- samp->BorderColor.f[GCOMP] = params[1];
- samp->BorderColor.f[BCOMP] = params[2];
- samp->BorderColor.f[ACOMP] = params[3];
- return GL_TRUE;
-}
-
-
-static GLuint
-set_sampler_border_colori(struct gl_context *ctx,
- struct gl_sampler_object *samp,
- const GLint params[4])
-{
- flush(ctx);
- samp->BorderColor.i[RCOMP] = params[0];
- samp->BorderColor.i[GCOMP] = params[1];
- samp->BorderColor.i[BCOMP] = params[2];
- samp->BorderColor.i[ACOMP] = params[3];
- return GL_TRUE;
-}
-
-
-static GLuint
-set_sampler_border_colorui(struct gl_context *ctx,
- struct gl_sampler_object *samp,
- const GLuint params[4])
-{
- flush(ctx);
- samp->BorderColor.ui[RCOMP] = params[0];
- samp->BorderColor.ui[GCOMP] = params[1];
- samp->BorderColor.ui[BCOMP] = params[2];
- samp->BorderColor.ui[ACOMP] = params[3];
- return GL_TRUE;
-}
-
-
-static GLuint
-set_sampler_min_lod(struct gl_context *ctx, struct gl_sampler_object *samp,
- GLfloat param)
-{
- if (samp->MinLod == param)
- return GL_FALSE;
-
- flush(ctx);
- samp->MinLod = param;
- return GL_TRUE;
-}
-
-
-static GLuint
-set_sampler_max_lod(struct gl_context *ctx, struct gl_sampler_object *samp,
- GLfloat param)
-{
- if (samp->MaxLod == param)
- return GL_FALSE;
-
- flush(ctx);
- samp->MaxLod = param;
- return GL_TRUE;
-}
-
-
-static GLuint
-set_sampler_compare_mode(struct gl_context *ctx,
- struct gl_sampler_object *samp, GLint param)
-{
- if (!ctx->Extensions.ARB_shadow)
- return INVALID_PNAME;
-
- if (samp->CompareMode == param)
- return GL_FALSE;
-
- if (param == GL_NONE ||
- param == GL_COMPARE_R_TO_TEXTURE_ARB) {
- flush(ctx);
- samp->CompareMode = param;
- return GL_TRUE;
- }
-
- return INVALID_PARAM;
-}
-
-
-static GLuint
-set_sampler_compare_func(struct gl_context *ctx,
- struct gl_sampler_object *samp, GLint param)
-{
- if (!ctx->Extensions.ARB_shadow)
- return INVALID_PNAME;
-
- if (samp->CompareFunc == param)
- return GL_FALSE;
-
- switch (param) {
- case GL_LEQUAL:
- case GL_GEQUAL:
- flush(ctx);
- samp->CompareFunc = param;
- return GL_TRUE;
- case GL_EQUAL:
- case GL_NOTEQUAL:
- case GL_LESS:
- case GL_GREATER:
- case GL_ALWAYS:
- case GL_NEVER:
- if (ctx->Extensions.EXT_shadow_funcs) {
- flush(ctx);
- samp->CompareFunc = param;
- return GL_TRUE;
- }
- /* fall-through */
- default:
- return INVALID_PARAM;
- }
-}
-
-
-static GLuint
-set_sampler_max_anisotropy(struct gl_context *ctx,
- struct gl_sampler_object *samp, GLfloat param)
-{
- if (!ctx->Extensions.EXT_texture_filter_anisotropic)
- return INVALID_PNAME;
-
- if (samp->MaxAnisotropy == param)
- return GL_FALSE;
-
- if (param < 1.0)
- return INVALID_VALUE;
-
- flush(ctx);
- /* clamp to max, that's what NVIDIA does */
- samp->MaxAnisotropy = MIN2(param, ctx->Const.MaxTextureMaxAnisotropy);
- return GL_TRUE;
-}
-
-
-static GLuint
-set_sampler_cube_map_seamless(struct gl_context *ctx,
- struct gl_sampler_object *samp, GLboolean param)
-{
- if (!ctx->Extensions.AMD_seamless_cubemap_per_texture)
- return INVALID_PNAME;
-
- if (samp->CubeMapSeamless == param)
- return GL_FALSE;
-
- if (param != GL_TRUE && param != GL_FALSE)
- return INVALID_VALUE;
-
- flush(ctx);
- samp->CubeMapSeamless = param;
- return GL_TRUE;
-}
-
-
-static void GLAPIENTRY
-_mesa_SamplerParameteri(GLuint sampler, GLenum pname, GLint param)
-{
- struct gl_sampler_object *sampObj;
- GLuint res;
- GET_CURRENT_CONTEXT(ctx);
-
- sampObj = _mesa_lookup_samplerobj(ctx, sampler);
- if (!sampObj) {
- _mesa_error(ctx, GL_INVALID_VALUE, "glSamplerParameteri(sampler %u)",
- sampler);
- return;
- }
-
- switch (pname) {
- case GL_TEXTURE_WRAP_S:
- res = set_sampler_wrap_s(ctx, sampObj, param);
- break;
- case GL_TEXTURE_WRAP_T:
- res = set_sampler_wrap_t(ctx, sampObj, param);
- break;
- case GL_TEXTURE_WRAP_R:
- res = set_sampler_wrap_r(ctx, sampObj, param);
- break;
- case GL_TEXTURE_MIN_FILTER:
- res = set_sampler_min_filter(ctx, sampObj, param);
- break;
- case GL_TEXTURE_MAG_FILTER:
- res = set_sampler_mag_filter(ctx, sampObj, param);
- break;
- case GL_TEXTURE_MIN_LOD:
- res = set_sampler_min_lod(ctx, sampObj, (GLfloat) param);
- break;
- case GL_TEXTURE_MAX_LOD:
- res = set_sampler_max_lod(ctx, sampObj, (GLfloat) param);
- break;
- case GL_TEXTURE_LOD_BIAS:
- res = set_sampler_lod_bias(ctx, sampObj, (GLfloat) param);
- break;
- case GL_TEXTURE_COMPARE_MODE:
- res = set_sampler_compare_mode(ctx, sampObj, param);
- break;
- case GL_TEXTURE_COMPARE_FUNC:
- res = set_sampler_compare_func(ctx, sampObj, param);
- break;
- case GL_TEXTURE_MAX_ANISOTROPY_EXT:
- res = set_sampler_max_anisotropy(ctx, sampObj, (GLfloat) param);
- break;
- case GL_TEXTURE_CUBE_MAP_SEAMLESS:
- res = set_sampler_cube_map_seamless(ctx, sampObj, param);
- break;
- case GL_TEXTURE_BORDER_COLOR:
- /* fall-through */
- default:
- res = INVALID_PNAME;
- }
-
- switch (res) {
- case GL_FALSE:
- /* no change */
- break;
- case GL_TRUE:
- /* state change - we do nothing special at this time */
- break;
- case INVALID_PNAME:
- _mesa_error(ctx, GL_INVALID_ENUM, "glSamplerParameteri(pname=%s)\n",
- _mesa_lookup_enum_by_nr(pname));
- break;
- case INVALID_PARAM:
- _mesa_error(ctx, GL_INVALID_ENUM, "glSamplerParameteri(param=%d)\n",
- param);
- break;
- case INVALID_VALUE:
- _mesa_error(ctx, GL_INVALID_VALUE, "glSamplerParameteri(param=%d)\n",
- param);
- break;
- default:
- ;
- }
-}
-
-
-static void GLAPIENTRY
-_mesa_SamplerParameterf(GLuint sampler, GLenum pname, GLfloat param)
-{
- struct gl_sampler_object *sampObj;
- GLuint res;
- GET_CURRENT_CONTEXT(ctx);
-
- ASSERT_OUTSIDE_BEGIN_END(ctx);
-
- sampObj = _mesa_lookup_samplerobj(ctx, sampler);
- if (!sampObj) {
- _mesa_error(ctx, GL_INVALID_VALUE, "glSamplerParameterf(sampler %u)",
- sampler);
- return;
- }
-
- switch (pname) {
- case GL_TEXTURE_WRAP_S:
- res = set_sampler_wrap_s(ctx, sampObj, (GLint) param);
- break;
- case GL_TEXTURE_WRAP_T:
- res = set_sampler_wrap_t(ctx, sampObj, (GLint) param);
- break;
- case GL_TEXTURE_WRAP_R:
- res = set_sampler_wrap_r(ctx, sampObj, (GLint) param);
- break;
- case GL_TEXTURE_MIN_FILTER:
- res = set_sampler_min_filter(ctx, sampObj, (GLint) param);
- break;
- case GL_TEXTURE_MAG_FILTER:
- res = set_sampler_mag_filter(ctx, sampObj, (GLint) param);
- break;
- case GL_TEXTURE_MIN_LOD:
- res = set_sampler_min_lod(ctx, sampObj, param);
- break;
- case GL_TEXTURE_MAX_LOD:
- res = set_sampler_max_lod(ctx, sampObj, param);
- break;
- case GL_TEXTURE_LOD_BIAS:
- res = set_sampler_lod_bias(ctx, sampObj, param);
- break;
- case GL_TEXTURE_COMPARE_MODE:
- res = set_sampler_compare_mode(ctx, sampObj, (GLint) param);
- break;
- case GL_TEXTURE_COMPARE_FUNC:
- res = set_sampler_compare_func(ctx, sampObj, (GLint) param);
- break;
- case GL_TEXTURE_MAX_ANISOTROPY_EXT:
- res = set_sampler_max_anisotropy(ctx, sampObj, param);
- break;
- case GL_TEXTURE_CUBE_MAP_SEAMLESS:
- res = set_sampler_cube_map_seamless(ctx, sampObj, (GLboolean) param);
- break;
- case GL_TEXTURE_BORDER_COLOR:
- /* fall-through */
- default:
- res = INVALID_PNAME;
- }
-
- switch (res) {
- case GL_FALSE:
- /* no change */
- break;
- case GL_TRUE:
- /* state change - we do nothing special at this time */
- break;
- case INVALID_PNAME:
- _mesa_error(ctx, GL_INVALID_ENUM, "glSamplerParameterf(pname=%s)\n",
- _mesa_lookup_enum_by_nr(pname));
- break;
- case INVALID_PARAM:
- _mesa_error(ctx, GL_INVALID_ENUM, "glSamplerParameterf(param=%f)\n",
- param);
- break;
- case INVALID_VALUE:
- _mesa_error(ctx, GL_INVALID_VALUE, "glSamplerParameterf(param=%f)\n",
- param);
- break;
- default:
- ;
- }
-}
-
-static void GLAPIENTRY
-_mesa_SamplerParameteriv(GLuint sampler, GLenum pname, const GLint *params)
-{
- struct gl_sampler_object *sampObj;
- GLuint res;
- GET_CURRENT_CONTEXT(ctx);
-
- sampObj = _mesa_lookup_samplerobj(ctx, sampler);
- if (!sampObj) {
- _mesa_error(ctx, GL_INVALID_VALUE, "glSamplerParameteriv(sampler %u)",
- sampler);
- return;
- }
-
- switch (pname) {
- case GL_TEXTURE_WRAP_S:
- res = set_sampler_wrap_s(ctx, sampObj, params[0]);
- break;
- case GL_TEXTURE_WRAP_T:
- res = set_sampler_wrap_t(ctx, sampObj, params[0]);
- break;
- case GL_TEXTURE_WRAP_R:
- res = set_sampler_wrap_r(ctx, sampObj, params[0]);
- break;
- case GL_TEXTURE_MIN_FILTER:
- res = set_sampler_min_filter(ctx, sampObj, params[0]);
- break;
- case GL_TEXTURE_MAG_FILTER:
- res = set_sampler_mag_filter(ctx, sampObj, params[0]);
- break;
- case GL_TEXTURE_MIN_LOD:
- res = set_sampler_min_lod(ctx, sampObj, (GLfloat) params[0]);
- break;
- case GL_TEXTURE_MAX_LOD:
- res = set_sampler_max_lod(ctx, sampObj, (GLfloat) params[0]);
- break;
- case GL_TEXTURE_LOD_BIAS:
- res = set_sampler_lod_bias(ctx, sampObj, (GLfloat) params[0]);
- break;
- case GL_TEXTURE_COMPARE_MODE:
- res = set_sampler_compare_mode(ctx, sampObj, params[0]);
- break;
- case GL_TEXTURE_COMPARE_FUNC:
- res = set_sampler_compare_func(ctx, sampObj, params[0]);
- break;
- case GL_TEXTURE_MAX_ANISOTROPY_EXT:
- res = set_sampler_max_anisotropy(ctx, sampObj, (GLfloat) params[0]);
- break;
- case GL_TEXTURE_CUBE_MAP_SEAMLESS:
- res = set_sampler_cube_map_seamless(ctx, sampObj, params[0]);
- break;
- case GL_TEXTURE_BORDER_COLOR:
- {
- GLfloat c[4];
- c[0] = INT_TO_FLOAT(params[0]);
- c[1] = INT_TO_FLOAT(params[1]);
- c[2] = INT_TO_FLOAT(params[2]);
- c[3] = INT_TO_FLOAT(params[3]);
- res = set_sampler_border_colorf(ctx, sampObj, c);
- }
- break;
- default:
- res = INVALID_PNAME;
- }
-
- switch (res) {
- case GL_FALSE:
- /* no change */
- break;
- case GL_TRUE:
- /* state change - we do nothing special at this time */
- break;
- case INVALID_PNAME:
- _mesa_error(ctx, GL_INVALID_ENUM, "glSamplerParameteriv(pname=%s)\n",
- _mesa_lookup_enum_by_nr(pname));
- break;
- case INVALID_PARAM:
- _mesa_error(ctx, GL_INVALID_ENUM, "glSamplerParameteriv(param=%d)\n",
- params[0]);
- break;
- case INVALID_VALUE:
- _mesa_error(ctx, GL_INVALID_VALUE, "glSamplerParameteriv(param=%d)\n",
- params[0]);
- break;
- default:
- ;
- }
-}
-
-static void GLAPIENTRY
-_mesa_SamplerParameterfv(GLuint sampler, GLenum pname, const GLfloat *params)
-{
- struct gl_sampler_object *sampObj;
- GLuint res;
- GET_CURRENT_CONTEXT(ctx);
-
- ASSERT_OUTSIDE_BEGIN_END(ctx);
-
- sampObj = _mesa_lookup_samplerobj(ctx, sampler);
- if (!sampObj) {
- _mesa_error(ctx, GL_INVALID_VALUE, "glSamplerParameterfv(sampler %u)",
- sampler);
- return;
- }
-
- switch (pname) {
- case GL_TEXTURE_WRAP_S:
- res = set_sampler_wrap_s(ctx, sampObj, (GLint) params[0]);
- break;
- case GL_TEXTURE_WRAP_T:
- res = set_sampler_wrap_t(ctx, sampObj, (GLint) params[0]);
- break;
- case GL_TEXTURE_WRAP_R:
- res = set_sampler_wrap_r(ctx, sampObj, (GLint) params[0]);
- break;
- case GL_TEXTURE_MIN_FILTER:
- res = set_sampler_min_filter(ctx, sampObj, (GLint) params[0]);
- break;
- case GL_TEXTURE_MAG_FILTER:
- res = set_sampler_mag_filter(ctx, sampObj, (GLint) params[0]);
- break;
- case GL_TEXTURE_MIN_LOD:
- res = set_sampler_min_lod(ctx, sampObj, params[0]);
- break;
- case GL_TEXTURE_MAX_LOD:
- res = set_sampler_max_lod(ctx, sampObj, params[0]);
- break;
- case GL_TEXTURE_LOD_BIAS:
- res = set_sampler_lod_bias(ctx, sampObj, params[0]);
- break;
- case GL_TEXTURE_COMPARE_MODE:
- res = set_sampler_compare_mode(ctx, sampObj, (GLint) params[0]);
- break;
- case GL_TEXTURE_COMPARE_FUNC:
- res = set_sampler_compare_func(ctx, sampObj, (GLint) params[0]);
- break;
- case GL_TEXTURE_MAX_ANISOTROPY_EXT:
- res = set_sampler_max_anisotropy(ctx, sampObj, params[0]);
- break;
- case GL_TEXTURE_CUBE_MAP_SEAMLESS:
- res = set_sampler_cube_map_seamless(ctx, sampObj, (GLboolean) params[0]);
- break;
- case GL_TEXTURE_BORDER_COLOR:
- res = set_sampler_border_colorf(ctx, sampObj, params);
- break;
- default:
- res = INVALID_PNAME;
- }
-
- switch (res) {
- case GL_FALSE:
- /* no change */
- break;
- case GL_TRUE:
- /* state change - we do nothing special at this time */
- break;
- case INVALID_PNAME:
- _mesa_error(ctx, GL_INVALID_ENUM, "glSamplerParameterfv(pname=%s)\n",
- _mesa_lookup_enum_by_nr(pname));
- break;
- case INVALID_PARAM:
- _mesa_error(ctx, GL_INVALID_ENUM, "glSamplerParameterfv(param=%f)\n",
- params[0]);
- break;
- case INVALID_VALUE:
- _mesa_error(ctx, GL_INVALID_VALUE, "glSamplerParameterfv(param=%f)\n",
- params[0]);
- break;
- default:
- ;
- }
-}
-
-static void GLAPIENTRY
-_mesa_SamplerParameterIiv(GLuint sampler, GLenum pname, const GLint *params)
-{
- struct gl_sampler_object *sampObj;
- GLuint res;
- GET_CURRENT_CONTEXT(ctx);
-
- sampObj = _mesa_lookup_samplerobj(ctx, sampler);
- if (!sampObj) {
- _mesa_error(ctx, GL_INVALID_VALUE, "glSamplerParameterIiv(sampler %u)",
- sampler);
- return;
- }
-
- switch (pname) {
- case GL_TEXTURE_WRAP_S:
- res = set_sampler_wrap_s(ctx, sampObj, params[0]);
- break;
- case GL_TEXTURE_WRAP_T:
- res = set_sampler_wrap_t(ctx, sampObj, params[0]);
- break;
- case GL_TEXTURE_WRAP_R:
- res = set_sampler_wrap_r(ctx, sampObj, params[0]);
- break;
- case GL_TEXTURE_MIN_FILTER:
- res = set_sampler_min_filter(ctx, sampObj, params[0]);
- break;
- case GL_TEXTURE_MAG_FILTER:
- res = set_sampler_mag_filter(ctx, sampObj, params[0]);
- break;
- case GL_TEXTURE_MIN_LOD:
- res = set_sampler_min_lod(ctx, sampObj, (GLfloat) params[0]);
- break;
- case GL_TEXTURE_MAX_LOD:
- res = set_sampler_max_lod(ctx, sampObj, (GLfloat) params[0]);
- break;
- case GL_TEXTURE_LOD_BIAS:
- res = set_sampler_lod_bias(ctx, sampObj, (GLfloat) params[0]);
- break;
- case GL_TEXTURE_COMPARE_MODE:
- res = set_sampler_compare_mode(ctx, sampObj, params[0]);
- break;
- case GL_TEXTURE_COMPARE_FUNC:
- res = set_sampler_compare_func(ctx, sampObj, params[0]);
- break;
- case GL_TEXTURE_MAX_ANISOTROPY_EXT:
- res = set_sampler_max_anisotropy(ctx, sampObj, (GLfloat) params[0]);
- break;
- case GL_TEXTURE_CUBE_MAP_SEAMLESS:
- res = set_sampler_cube_map_seamless(ctx, sampObj, params[0]);
- break;
- case GL_TEXTURE_BORDER_COLOR:
- res = set_sampler_border_colori(ctx, sampObj, params);
- break;
- default:
- res = INVALID_PNAME;
- }
-
- switch (res) {
- case GL_FALSE:
- /* no change */
- break;
- case GL_TRUE:
- /* state change - we do nothing special at this time */
- break;
- case INVALID_PNAME:
- _mesa_error(ctx, GL_INVALID_ENUM, "glSamplerParameterIiv(pname=%s)\n",
- _mesa_lookup_enum_by_nr(pname));
- break;
- case INVALID_PARAM:
- _mesa_error(ctx, GL_INVALID_ENUM, "glSamplerParameterIiv(param=%d)\n",
- params[0]);
- break;
- case INVALID_VALUE:
- _mesa_error(ctx, GL_INVALID_VALUE, "glSamplerParameterIiv(param=%d)\n",
- params[0]);
- break;
- default:
- ;
- }
-}
-
-
-static void GLAPIENTRY
-_mesa_SamplerParameterIuiv(GLuint sampler, GLenum pname, const GLuint *params)
-{
- struct gl_sampler_object *sampObj;
- GLuint res;
- GET_CURRENT_CONTEXT(ctx);
-
- sampObj = _mesa_lookup_samplerobj(ctx, sampler);
- if (!sampObj) {
- _mesa_error(ctx, GL_INVALID_VALUE, "glSamplerParameterIuiv(sampler %u)",
- sampler);
- return;
- }
-
- switch (pname) {
- case GL_TEXTURE_WRAP_S:
- res = set_sampler_wrap_s(ctx, sampObj, params[0]);
- break;
- case GL_TEXTURE_WRAP_T:
- res = set_sampler_wrap_t(ctx, sampObj, params[0]);
- break;
- case GL_TEXTURE_WRAP_R:
- res = set_sampler_wrap_r(ctx, sampObj, params[0]);
- break;
- case GL_TEXTURE_MIN_FILTER:
- res = set_sampler_min_filter(ctx, sampObj, params[0]);
- break;
- case GL_TEXTURE_MAG_FILTER:
- res = set_sampler_mag_filter(ctx, sampObj, params[0]);
- break;
- case GL_TEXTURE_MIN_LOD:
- res = set_sampler_min_lod(ctx, sampObj, (GLfloat) params[0]);
- break;
- case GL_TEXTURE_MAX_LOD:
- res = set_sampler_max_lod(ctx, sampObj, (GLfloat) params[0]);
- break;
- case GL_TEXTURE_LOD_BIAS:
- res = set_sampler_lod_bias(ctx, sampObj, (GLfloat) params[0]);
- break;
- case GL_TEXTURE_COMPARE_MODE:
- res = set_sampler_compare_mode(ctx, sampObj, params[0]);
- break;
- case GL_TEXTURE_COMPARE_FUNC:
- res = set_sampler_compare_func(ctx, sampObj, params[0]);
- break;
- case GL_TEXTURE_MAX_ANISOTROPY_EXT:
- res = set_sampler_max_anisotropy(ctx, sampObj, (GLfloat) params[0]);
- break;
- case GL_TEXTURE_CUBE_MAP_SEAMLESS:
- res = set_sampler_cube_map_seamless(ctx, sampObj, params[0]);
- break;
- case GL_TEXTURE_BORDER_COLOR:
- res = set_sampler_border_colorui(ctx, sampObj, params);
- break;
- default:
- res = INVALID_PNAME;
- }
-
- switch (res) {
- case GL_FALSE:
- /* no change */
- break;
- case GL_TRUE:
- /* state change - we do nothing special at this time */
- break;
- case INVALID_PNAME:
- _mesa_error(ctx, GL_INVALID_ENUM, "glSamplerParameterIuiv(pname=%s)\n",
- _mesa_lookup_enum_by_nr(pname));
- break;
- case INVALID_PARAM:
- _mesa_error(ctx, GL_INVALID_ENUM, "glSamplerParameterIuiv(param=%u)\n",
- params[0]);
- break;
- case INVALID_VALUE:
- _mesa_error(ctx, GL_INVALID_VALUE, "glSamplerParameterIuiv(param=%u)\n",
- params[0]);
- break;
- default:
- ;
- }
-}
-
-
-static void GLAPIENTRY
-_mesa_GetSamplerParameteriv(GLuint sampler, GLenum pname, GLint *params)
-{
- struct gl_sampler_object *sampObj;
- GET_CURRENT_CONTEXT(ctx);
-
- sampObj = _mesa_lookup_samplerobj(ctx, sampler);
- if (!sampObj) {
- _mesa_error(ctx, GL_INVALID_VALUE, "glGetSamplerParameteriv(sampler %u)",
- sampler);
- return;
- }
-
- switch (pname) {
- case GL_TEXTURE_WRAP_S:
- *params = sampObj->WrapS;
- break;
- case GL_TEXTURE_WRAP_T:
- *params = sampObj->WrapT;
- break;
- case GL_TEXTURE_WRAP_R:
- *params = sampObj->WrapR;
- break;
- case GL_TEXTURE_MIN_FILTER:
- *params = sampObj->MinFilter;
- break;
- case GL_TEXTURE_MAG_FILTER:
- *params = sampObj->MagFilter;
- break;
- case GL_TEXTURE_MIN_LOD:
- *params = (GLint) sampObj->MinLod;
- break;
- case GL_TEXTURE_MAX_LOD:
- *params = (GLint) sampObj->MaxLod;
- break;
- case GL_TEXTURE_LOD_BIAS:
- *params = (GLint) sampObj->LodBias;
- break;
- case GL_TEXTURE_COMPARE_MODE:
- if (!ctx->Extensions.ARB_shadow)
- goto invalid_pname;
- *params = sampObj->CompareMode;
- break;
- case GL_TEXTURE_COMPARE_FUNC:
- if (!ctx->Extensions.ARB_shadow)
- goto invalid_pname;
- *params = sampObj->CompareFunc;
- break;
- case GL_TEXTURE_MAX_ANISOTROPY_EXT:
- *params = (GLint) sampObj->MaxAnisotropy;
- break;
- case GL_TEXTURE_BORDER_COLOR:
- params[0] = FLOAT_TO_INT(sampObj->BorderColor.f[0]);
- params[1] = FLOAT_TO_INT(sampObj->BorderColor.f[1]);
- params[2] = FLOAT_TO_INT(sampObj->BorderColor.f[2]);
- params[3] = FLOAT_TO_INT(sampObj->BorderColor.f[3]);
- break;
- case GL_TEXTURE_CUBE_MAP_SEAMLESS:
- if (!ctx->Extensions.AMD_seamless_cubemap_per_texture)
- goto invalid_pname;
- *params = sampObj->CubeMapSeamless;
- break;
- default:
- goto invalid_pname;
- }
- return;
-
-invalid_pname:
- _mesa_error(ctx, GL_INVALID_ENUM, "glGetSamplerParameteriv(pname=%s)",
- _mesa_lookup_enum_by_nr(pname));
-}
-
-
-static void GLAPIENTRY
-_mesa_GetSamplerParameterfv(GLuint sampler, GLenum pname, GLfloat *params)
-{
- struct gl_sampler_object *sampObj;
- GET_CURRENT_CONTEXT(ctx);
-
- sampObj = _mesa_lookup_samplerobj(ctx, sampler);
- if (!sampObj) {
- _mesa_error(ctx, GL_INVALID_VALUE, "glGetSamplerParameterfv(sampler %u)",
- sampler);
- return;
- }
-
- switch (pname) {
- case GL_TEXTURE_WRAP_S:
- *params = (GLfloat) sampObj->WrapS;
- break;
- case GL_TEXTURE_WRAP_T:
- *params = (GLfloat) sampObj->WrapT;
- break;
- case GL_TEXTURE_WRAP_R:
- *params = (GLfloat) sampObj->WrapR;
- break;
- case GL_TEXTURE_MIN_FILTER:
- *params = (GLfloat) sampObj->MinFilter;
- break;
- case GL_TEXTURE_MAG_FILTER:
- *params = (GLfloat) sampObj->MagFilter;
- break;
- case GL_TEXTURE_MIN_LOD:
- *params = sampObj->MinLod;
- break;
- case GL_TEXTURE_MAX_LOD:
- *params = sampObj->MaxLod;
- break;
- case GL_TEXTURE_LOD_BIAS:
- *params = sampObj->LodBias;
- break;
- case GL_TEXTURE_COMPARE_MODE:
- if (!ctx->Extensions.ARB_shadow)
- goto invalid_pname;
- *params = (GLfloat) sampObj->CompareMode;
- break;
- case GL_TEXTURE_COMPARE_FUNC:
- if (!ctx->Extensions.ARB_shadow)
- goto invalid_pname;
- *params = (GLfloat) sampObj->CompareFunc;
- break;
- case GL_TEXTURE_MAX_ANISOTROPY_EXT:
- *params = sampObj->MaxAnisotropy;
- break;
- case GL_TEXTURE_BORDER_COLOR:
- params[0] = sampObj->BorderColor.f[0];
- params[1] = sampObj->BorderColor.f[1];
- params[2] = sampObj->BorderColor.f[2];
- params[3] = sampObj->BorderColor.f[3];
- break;
- case GL_TEXTURE_CUBE_MAP_SEAMLESS:
- if (!ctx->Extensions.AMD_seamless_cubemap_per_texture)
- goto invalid_pname;
- *params = (GLfloat) sampObj->CubeMapSeamless;
- break;
- default:
- goto invalid_pname;
- }
- return;
-
-invalid_pname:
- _mesa_error(ctx, GL_INVALID_ENUM, "glGetSamplerParameterfv(pname=%s)",
- _mesa_lookup_enum_by_nr(pname));
-}
-
-
-static void GLAPIENTRY
-_mesa_GetSamplerParameterIiv(GLuint sampler, GLenum pname, GLint *params)
-{
- struct gl_sampler_object *sampObj;
- GET_CURRENT_CONTEXT(ctx);
-
- sampObj = _mesa_lookup_samplerobj(ctx, sampler);
- if (!sampObj) {
- _mesa_error(ctx, GL_INVALID_VALUE,
- "glGetSamplerParameterIiv(sampler %u)",
- sampler);
- return;
- }
-
- switch (pname) {
- case GL_TEXTURE_WRAP_S:
- *params = sampObj->WrapS;
- break;
- case GL_TEXTURE_WRAP_T:
- *params = sampObj->WrapT;
- break;
- case GL_TEXTURE_WRAP_R:
- *params = sampObj->WrapR;
- break;
- case GL_TEXTURE_MIN_FILTER:
- *params = sampObj->MinFilter;
- break;
- case GL_TEXTURE_MAG_FILTER:
- *params = sampObj->MagFilter;
- break;
- case GL_TEXTURE_MIN_LOD:
- *params = (GLint) sampObj->MinLod;
- break;
- case GL_TEXTURE_MAX_LOD:
- *params = (GLint) sampObj->MaxLod;
- break;
- case GL_TEXTURE_LOD_BIAS:
- *params = (GLint) sampObj->LodBias;
- break;
- case GL_TEXTURE_COMPARE_MODE:
- if (!ctx->Extensions.ARB_shadow)
- goto invalid_pname;
- *params = sampObj->CompareMode;
- break;
- case GL_TEXTURE_COMPARE_FUNC:
- if (!ctx->Extensions.ARB_shadow)
- goto invalid_pname;
- *params = sampObj->CompareFunc;
- break;
- case GL_TEXTURE_MAX_ANISOTROPY_EXT:
- *params = (GLint) sampObj->MaxAnisotropy;
- break;
- case GL_TEXTURE_BORDER_COLOR:
- params[0] = sampObj->BorderColor.i[0];
- params[1] = sampObj->BorderColor.i[1];
- params[2] = sampObj->BorderColor.i[2];
- params[3] = sampObj->BorderColor.i[3];
- break;
- case GL_TEXTURE_CUBE_MAP_SEAMLESS:
- if (!ctx->Extensions.AMD_seamless_cubemap_per_texture)
- goto invalid_pname;
- *params = sampObj->CubeMapSeamless;
- break;
- default:
- goto invalid_pname;
- }
- return;
-
-invalid_pname:
- _mesa_error(ctx, GL_INVALID_ENUM, "glGetSamplerParameterIiv(pname=%s)",
- _mesa_lookup_enum_by_nr(pname));
-}
-
-
-static void GLAPIENTRY
-_mesa_GetSamplerParameterIuiv(GLuint sampler, GLenum pname, GLuint *params)
-{
- struct gl_sampler_object *sampObj;
- GET_CURRENT_CONTEXT(ctx);
-
- sampObj = _mesa_lookup_samplerobj(ctx, sampler);
- if (!sampObj) {
- _mesa_error(ctx, GL_INVALID_VALUE,
- "glGetSamplerParameterIuiv(sampler %u)",
- sampler);
- return;
- }
-
- switch (pname) {
- case GL_TEXTURE_WRAP_S:
- *params = sampObj->WrapS;
- break;
- case GL_TEXTURE_WRAP_T:
- *params = sampObj->WrapT;
- break;
- case GL_TEXTURE_WRAP_R:
- *params = sampObj->WrapR;
- break;
- case GL_TEXTURE_MIN_FILTER:
- *params = sampObj->MinFilter;
- break;
- case GL_TEXTURE_MAG_FILTER:
- *params = sampObj->MagFilter;
- break;
- case GL_TEXTURE_MIN_LOD:
- *params = (GLuint) sampObj->MinLod;
- break;
- case GL_TEXTURE_MAX_LOD:
- *params = (GLuint) sampObj->MaxLod;
- break;
- case GL_TEXTURE_LOD_BIAS:
- *params = (GLuint) sampObj->LodBias;
- break;
- case GL_TEXTURE_COMPARE_MODE:
- if (!ctx->Extensions.ARB_shadow)
- goto invalid_pname;
- *params = sampObj->CompareMode;
- break;
- case GL_TEXTURE_COMPARE_FUNC:
- if (!ctx->Extensions.ARB_shadow)
- goto invalid_pname;
- *params = sampObj->CompareFunc;
- break;
- case GL_TEXTURE_MAX_ANISOTROPY_EXT:
- *params = (GLuint) sampObj->MaxAnisotropy;
- break;
- case GL_TEXTURE_BORDER_COLOR:
- params[0] = sampObj->BorderColor.ui[0];
- params[1] = sampObj->BorderColor.ui[1];
- params[2] = sampObj->BorderColor.ui[2];
- params[3] = sampObj->BorderColor.ui[3];
- break;
- case GL_TEXTURE_CUBE_MAP_SEAMLESS:
- if (!ctx->Extensions.AMD_seamless_cubemap_per_texture)
- goto invalid_pname;
- *params = sampObj->CubeMapSeamless;
- break;
- default:
- goto invalid_pname;
- }
- return;
-
-invalid_pname:
- _mesa_error(ctx, GL_INVALID_ENUM, "glGetSamplerParameterIuiv(pname=%s)",
- _mesa_lookup_enum_by_nr(pname));
-}
-
-
-void
-_mesa_init_sampler_object_functions(struct dd_function_table *driver)
-{
- driver->NewSamplerObject = _mesa_new_sampler_object;
- driver->DeleteSamplerObject = _mesa_delete_sampler_object;
-}
-
-
-void
-_mesa_init_sampler_object_dispatch(struct _glapi_table *disp)
-{
- SET_GenSamplers(disp, _mesa_GenSamplers);
- SET_DeleteSamplers(disp, _mesa_DeleteSamplers);
- SET_IsSampler(disp, _mesa_IsSampler);
- SET_BindSampler(disp, _mesa_BindSampler);
- SET_SamplerParameteri(disp, _mesa_SamplerParameteri);
- SET_SamplerParameterf(disp, _mesa_SamplerParameterf);
- SET_SamplerParameteriv(disp, _mesa_SamplerParameteriv);
- SET_SamplerParameterfv(disp, _mesa_SamplerParameterfv);
- SET_SamplerParameterIiv(disp, _mesa_SamplerParameterIiv);
- SET_SamplerParameterIuiv(disp, _mesa_SamplerParameterIuiv);
- SET_GetSamplerParameteriv(disp, _mesa_GetSamplerParameteriv);
- SET_GetSamplerParameterfv(disp, _mesa_GetSamplerParameterfv);
- SET_GetSamplerParameterIiv(disp, _mesa_GetSamplerParameterIiv);
- SET_GetSamplerParameterIuiv(disp, _mesa_GetSamplerParameterIuiv);
-}
+/*
+ * Mesa 3-D graphics library
+ *
+ * Copyright (C) 2011 VMware, Inc. All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+
+/**
+ * \file samplerobj.c
+ * \brief Functions for the GL_ARB_sampler_objects extension.
+ * \author Brian Paul
+ */
+
+
+#include "main/glheader.h"
+#include "main/context.h"
+#include "main/dispatch.h"
+#include "main/enums.h"
+#include "main/hash.h"
+#include "main/macros.h"
+#include "main/mfeatures.h"
+#include "main/mtypes.h"
+#include "main/samplerobj.h"
+
+
+static struct gl_sampler_object *
+_mesa_lookup_samplerobj(struct gl_context *ctx, GLuint name)
+{
+ if (name == 0)
+ return NULL;
+ else
+ return (struct gl_sampler_object *)
+ _mesa_HashLookup(ctx->Shared->SamplerObjects, name);
+}
+
+
+/**
+ * Handle reference counting.
+ */
+void
+_mesa_reference_sampler_object(struct gl_context *ctx,
+ struct gl_sampler_object **ptr,
+ struct gl_sampler_object *samp)
+{
+ if (*ptr == samp)
+ return;
+
+ if (*ptr) {
+ /* Unreference the old sampler */
+ GLboolean deleteFlag = GL_FALSE;
+ struct gl_sampler_object *oldSamp = *ptr;
+
+ /*_glthread_LOCK_MUTEX(oldSamp->Mutex);*/
+ ASSERT(oldSamp->RefCount > 0);
+ oldSamp->RefCount--;
+#if 0
+ printf("SamplerObj %p %d DECR to %d\n",
+ (void *) oldSamp, oldSamp->Name, oldSamp->RefCount);
+#endif
+ deleteFlag = (oldSamp->RefCount == 0);
+ /*_glthread_UNLOCK_MUTEX(oldSamp->Mutex);*/
+
+ if (deleteFlag) {
+ ASSERT(ctx->Driver.DeleteSamplerObject);
+ ctx->Driver.DeleteSamplerObject(ctx, oldSamp);
+ }
+
+ *ptr = NULL;
+ }
+ ASSERT(!*ptr);
+
+ if (samp) {
+ /* reference new sampler */
+ /*_glthread_LOCK_MUTEX(samp->Mutex);*/
+ if (samp->RefCount == 0) {
+ /* this sampler's being deleted (look just above) */
+ /* Not sure this can every really happen. Warn if it does. */
+ _mesa_problem(NULL, "referencing deleted sampler object");
+ *ptr = NULL;
+ }
+ else {
+ samp->RefCount++;
+#if 0
+ printf("SamplerObj %p %d INCR to %d\n",
+ (void *) samp, samp->Name, samp->RefCount);
+#endif
+ *ptr = samp;
+ }
+ /*_glthread_UNLOCK_MUTEX(samp->Mutex);*/
+ }
+}
+
+
+/**
+ * Initialize the fields of the given sampler object.
+ */
+void
+_mesa_init_sampler_object(struct gl_sampler_object *sampObj, GLuint name)
+{
+ sampObj->Name = name;
+ sampObj->RefCount = 1;
+ sampObj->WrapS = GL_REPEAT;
+ sampObj->WrapT = GL_REPEAT;
+ sampObj->WrapR = GL_REPEAT;
+ sampObj->MinFilter = GL_NEAREST_MIPMAP_LINEAR;
+ sampObj->MagFilter = GL_LINEAR;
+ sampObj->BorderColor.f[0] = 0.0;
+ sampObj->BorderColor.f[1] = 0.0;
+ sampObj->BorderColor.f[2] = 0.0;
+ sampObj->BorderColor.f[3] = 0.0;
+ sampObj->MinLod = -1000.0F;
+ sampObj->MaxLod = 1000.0F;
+ sampObj->LodBias = 0.0F;
+ sampObj->MaxAnisotropy = 1.0F;
+ sampObj->CompareMode = GL_NONE;
+ sampObj->CompareFunc = GL_LEQUAL;
+ sampObj->CompareFailValue = 0.0;
+ sampObj->sRGBDecode = GL_DECODE_EXT;
+ sampObj->CubeMapSeamless = GL_FALSE;
+ sampObj->DepthMode = 0;
+}
+
+
+/**
+ * Fallback for ctx->Driver.NewSamplerObject();
+ */
+struct gl_sampler_object *
+_mesa_new_sampler_object(struct gl_context *ctx, GLuint name)
+{
+ struct gl_sampler_object *sampObj = CALLOC_STRUCT(gl_sampler_object);
+ if (sampObj) {
+ _mesa_init_sampler_object(sampObj, name);
+ }
+ return sampObj;
+}
+
+
+/**
+ * Fallback for ctx->Driver.DeleteSamplerObject();
+ */
+void
+_mesa_delete_sampler_object(struct gl_context *ctx,
+ struct gl_sampler_object *sampObj)
+{
+ FREE(sampObj);
+}
+
+
+static void GLAPIENTRY
+_mesa_GenSamplers(GLsizei count, GLuint *samplers)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ GLuint first;
+ GLint i;
+
+ ASSERT_OUTSIDE_BEGIN_END(ctx);
+
+ if (MESA_VERBOSE & VERBOSE_API)
+ _mesa_debug(ctx, "glGenSamplers(%d)\n", count);
+
+ if (count < 0) {
+ _mesa_error(ctx, GL_INVALID_VALUE, "glGenSamplers");
+ return;
+ }
+
+ if (!samplers)
+ return;
+
+ first = _mesa_HashFindFreeKeyBlock(ctx->Shared->SamplerObjects, count);
+
+ /* Insert the ID and pointer to new sampler object into hash table */
+ for (i = 0; i < count; i++) {
+ struct gl_sampler_object *sampObj =
+ ctx->Driver.NewSamplerObject(ctx, first + i);
+ _mesa_HashInsert(ctx->Shared->SamplerObjects, first + i, sampObj);
+ samplers[i] = first + i;
+ }
+}
+
+
+static void GLAPIENTRY
+_mesa_DeleteSamplers(GLsizei count, const GLuint *samplers)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ GLsizei i;
+
+ ASSERT_OUTSIDE_BEGIN_END(ctx);
+ FLUSH_VERTICES(ctx, 0);
+
+ if (count < 0) {
+ _mesa_error(ctx, GL_INVALID_VALUE, "glDeleteSamplers(count)");
+ return;
+ }
+
+ _glthread_LOCK_MUTEX(ctx->Shared->Mutex);
+
+ for (i = 0; i < count; i++) {
+ if (samplers[i]) {
+ struct gl_sampler_object *sampObj =
+ _mesa_lookup_samplerobj(ctx, samplers[i]);
+ if (sampObj) {
+ /* The ID is immediately freed for re-use */
+ _mesa_HashRemove(ctx->Shared->SamplerObjects, samplers[i]);
+ /* But the object exists until its reference count goes to zero */
+ _mesa_reference_sampler_object(ctx, &sampObj, NULL);
+ }
+ }
+ }
+
+ _glthread_UNLOCK_MUTEX(ctx->Shared->Mutex);
+}
+
+
+static GLboolean GLAPIENTRY
+_mesa_IsSampler(GLuint sampler)
+{
+ struct gl_sampler_object *sampObj;
+ GET_CURRENT_CONTEXT(ctx);
+
+ ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, GL_FALSE);
+
+ if (sampler == 0)
+ return GL_FALSE;
+
+ sampObj = _mesa_lookup_samplerobj(ctx, sampler);
+
+ return sampObj != NULL;
+}
+
+
+static void GLAPIENTRY
+_mesa_BindSampler(GLuint unit, GLuint sampler)
+{
+ struct gl_sampler_object *sampObj;
+ GET_CURRENT_CONTEXT(ctx);
+
+ if (unit >= ctx->Const.MaxTextureImageUnits) {
+ _mesa_error(ctx, GL_INVALID_VALUE, "glBindSampler(unit %u)", unit);
+ return;
+ }
+
+ if (sampler == 0) {
+ /* Use the default sampler object, the one contained in the texture
+ * object.
+ */
+ sampObj = NULL;
+ }
+ else {
+ /* user-defined sampler object */
+ sampObj = _mesa_lookup_samplerobj(ctx, sampler);
+ if (!sampObj) {
+ _mesa_error(ctx, GL_INVALID_OPERATION, "glBindSampler(sampler)");
+ return;
+ }
+ }
+
+ if (ctx->Texture.Unit[unit].Sampler != sampObj) {
+ FLUSH_VERTICES(ctx, _NEW_TEXTURE);
+ }
+
+ /* bind new sampler */
+ _mesa_reference_sampler_object(ctx, &ctx->Texture.Unit[unit].Sampler,
+ sampObj);
+}
+
+
+/**
+ * Check if a coordinate wrap mode is legal.
+ * \return GL_TRUE if legal, GL_FALSE otherwise
+ */
+static GLboolean
+validate_texture_wrap_mode(struct gl_context *ctx, GLenum wrap)
+{
+ const struct gl_extensions * const e = &ctx->Extensions;
+
+ switch (wrap) {
+ case GL_CLAMP:
+ case GL_CLAMP_TO_EDGE:
+ case GL_REPEAT:
+ return GL_TRUE;
+ case GL_CLAMP_TO_BORDER:
+ return e->ARB_texture_border_clamp;
+ case GL_MIRRORED_REPEAT:
+ return e->ARB_texture_mirrored_repeat;
+ case GL_MIRROR_CLAMP_EXT:
+ return e->ATI_texture_mirror_once || e->EXT_texture_mirror_clamp;
+ case GL_MIRROR_CLAMP_TO_EDGE_EXT:
+ return e->ATI_texture_mirror_once || e->EXT_texture_mirror_clamp;
+ case GL_MIRROR_CLAMP_TO_BORDER_EXT:
+ return e->EXT_texture_mirror_clamp;
+ default:
+ return GL_FALSE;
+ }
+}
+
+
+/**
+ * This is called just prior to changing any sampler object state.
+ */
+static INLINE void
+flush(struct gl_context *ctx)
+{
+ FLUSH_VERTICES(ctx, _NEW_TEXTURE);
+}
+
+
+#define INVALID_PARAM 0x100
+#define INVALID_PNAME 0x101
+#define INVALID_VALUE 0x102
+
+static GLuint
+set_sampler_wrap_s(struct gl_context *ctx, struct gl_sampler_object *samp,
+ GLint param)
+{
+ if (samp->WrapS == param)
+ return GL_FALSE;
+ if (validate_texture_wrap_mode(ctx, param)) {
+ flush(ctx);
+ samp->WrapS = param;
+ return GL_TRUE;
+ }
+ return INVALID_PARAM;
+}
+
+
+static GLuint
+set_sampler_wrap_t(struct gl_context *ctx, struct gl_sampler_object *samp,
+ GLint param)
+{
+ if (samp->WrapT == param)
+ return GL_FALSE;
+ if (validate_texture_wrap_mode(ctx, param)) {
+ flush(ctx);
+ samp->WrapT = param;
+ return GL_TRUE;
+ }
+ return INVALID_PARAM;
+}
+
+
+static GLuint
+set_sampler_wrap_r(struct gl_context *ctx, struct gl_sampler_object *samp,
+ GLint param)
+{
+ if (samp->WrapR == param)
+ return GL_FALSE;
+ if (validate_texture_wrap_mode(ctx, param)) {
+ flush(ctx);
+ samp->WrapR = param;
+ return GL_TRUE;
+ }
+ return INVALID_PARAM;
+}
+
+
+static GLuint
+set_sampler_min_filter(struct gl_context *ctx, struct gl_sampler_object *samp,
+ GLint param)
+{
+ if (samp->MinFilter == param)
+ return GL_FALSE;
+
+ switch (param) {
+ case GL_NEAREST:
+ case GL_LINEAR:
+ case GL_NEAREST_MIPMAP_NEAREST:
+ case GL_LINEAR_MIPMAP_NEAREST:
+ case GL_NEAREST_MIPMAP_LINEAR:
+ case GL_LINEAR_MIPMAP_LINEAR:
+ flush(ctx);
+ samp->MinFilter = param;
+ return GL_TRUE;
+ default:
+ return INVALID_PARAM;
+ }
+}
+
+
+static GLuint
+set_sampler_mag_filter(struct gl_context *ctx, struct gl_sampler_object *samp,
+ GLint param)
+{
+ if (samp->MagFilter == param)
+ return GL_FALSE;
+
+ switch (param) {
+ case GL_NEAREST:
+ case GL_LINEAR:
+ flush(ctx);
+ samp->MagFilter = param;
+ return GL_TRUE;
+ default:
+ return INVALID_PARAM;
+ }
+}
+
+
+static GLuint
+set_sampler_lod_bias(struct gl_context *ctx, struct gl_sampler_object *samp,
+ GLfloat param)
+{
+ if (samp->LodBias == param)
+ return GL_FALSE;
+
+ flush(ctx);
+ samp->LodBias = param;
+ return GL_TRUE;
+}
+
+
+static GLuint
+set_sampler_border_colorf(struct gl_context *ctx,
+ struct gl_sampler_object *samp,
+ const GLfloat params[4])
+{
+ flush(ctx);
+ samp->BorderColor.f[RCOMP] = params[0];
+ samp->BorderColor.f[GCOMP] = params[1];
+ samp->BorderColor.f[BCOMP] = params[2];
+ samp->BorderColor.f[ACOMP] = params[3];
+ return GL_TRUE;
+}
+
+
+static GLuint
+set_sampler_border_colori(struct gl_context *ctx,
+ struct gl_sampler_object *samp,
+ const GLint params[4])
+{
+ flush(ctx);
+ samp->BorderColor.i[RCOMP] = params[0];
+ samp->BorderColor.i[GCOMP] = params[1];
+ samp->BorderColor.i[BCOMP] = params[2];
+ samp->BorderColor.i[ACOMP] = params[3];
+ return GL_TRUE;
+}
+
+
+static GLuint
+set_sampler_border_colorui(struct gl_context *ctx,
+ struct gl_sampler_object *samp,
+ const GLuint params[4])
+{
+ flush(ctx);
+ samp->BorderColor.ui[RCOMP] = params[0];
+ samp->BorderColor.ui[GCOMP] = params[1];
+ samp->BorderColor.ui[BCOMP] = params[2];
+ samp->BorderColor.ui[ACOMP] = params[3];
+ return GL_TRUE;
+}
+
+
+static GLuint
+set_sampler_min_lod(struct gl_context *ctx, struct gl_sampler_object *samp,
+ GLfloat param)
+{
+ if (samp->MinLod == param)
+ return GL_FALSE;
+
+ flush(ctx);
+ samp->MinLod = param;
+ return GL_TRUE;
+}
+
+
+static GLuint
+set_sampler_max_lod(struct gl_context *ctx, struct gl_sampler_object *samp,
+ GLfloat param)
+{
+ if (samp->MaxLod == param)
+ return GL_FALSE;
+
+ flush(ctx);
+ samp->MaxLod = param;
+ return GL_TRUE;
+}
+
+
+static GLuint
+set_sampler_compare_mode(struct gl_context *ctx,
+ struct gl_sampler_object *samp, GLint param)
+{
+ if (!ctx->Extensions.ARB_shadow)
+ return INVALID_PNAME;
+
+ if (samp->CompareMode == param)
+ return GL_FALSE;
+
+ if (param == GL_NONE ||
+ param == GL_COMPARE_R_TO_TEXTURE_ARB) {
+ flush(ctx);
+ samp->CompareMode = param;
+ return GL_TRUE;
+ }
+
+ return INVALID_PARAM;
+}
+
+
+static GLuint
+set_sampler_compare_func(struct gl_context *ctx,
+ struct gl_sampler_object *samp, GLint param)
+{
+ if (!ctx->Extensions.ARB_shadow)
+ return INVALID_PNAME;
+
+ if (samp->CompareFunc == param)
+ return GL_FALSE;
+
+ switch (param) {
+ case GL_LEQUAL:
+ case GL_GEQUAL:
+ flush(ctx);
+ samp->CompareFunc = param;
+ return GL_TRUE;
+ case GL_EQUAL:
+ case GL_NOTEQUAL:
+ case GL_LESS:
+ case GL_GREATER:
+ case GL_ALWAYS:
+ case GL_NEVER:
+ if (ctx->Extensions.EXT_shadow_funcs) {
+ flush(ctx);
+ samp->CompareFunc = param;
+ return GL_TRUE;
+ }
+ /* fall-through */
+ default:
+ return INVALID_PARAM;
+ }
+}
+
+
+static GLuint
+set_sampler_max_anisotropy(struct gl_context *ctx,
+ struct gl_sampler_object *samp, GLfloat param)
+{
+ if (!ctx->Extensions.EXT_texture_filter_anisotropic)
+ return INVALID_PNAME;
+
+ if (samp->MaxAnisotropy == param)
+ return GL_FALSE;
+
+ if (param < 1.0)
+ return INVALID_VALUE;
+
+ flush(ctx);
+ /* clamp to max, that's what NVIDIA does */
+ samp->MaxAnisotropy = MIN2(param, ctx->Const.MaxTextureMaxAnisotropy);
+ return GL_TRUE;
+}
+
+
+static GLuint
+set_sampler_cube_map_seamless(struct gl_context *ctx,
+ struct gl_sampler_object *samp, GLboolean param)
+{
+ if (!ctx->Extensions.AMD_seamless_cubemap_per_texture)
+ return INVALID_PNAME;
+
+ if (samp->CubeMapSeamless == param)
+ return GL_FALSE;
+
+ if (param != GL_TRUE && param != GL_FALSE)
+ return INVALID_VALUE;
+
+ flush(ctx);
+ samp->CubeMapSeamless = param;
+ return GL_TRUE;
+}
+
+
+static void GLAPIENTRY
+_mesa_SamplerParameteri(GLuint sampler, GLenum pname, GLint param)
+{
+ struct gl_sampler_object *sampObj;
+ GLuint res;
+ GET_CURRENT_CONTEXT(ctx);
+
+ sampObj = _mesa_lookup_samplerobj(ctx, sampler);
+ if (!sampObj) {
+ _mesa_error(ctx, GL_INVALID_VALUE, "glSamplerParameteri(sampler %u)",
+ sampler);
+ return;
+ }
+
+ switch (pname) {
+ case GL_TEXTURE_WRAP_S:
+ res = set_sampler_wrap_s(ctx, sampObj, param);
+ break;
+ case GL_TEXTURE_WRAP_T:
+ res = set_sampler_wrap_t(ctx, sampObj, param);
+ break;
+ case GL_TEXTURE_WRAP_R:
+ res = set_sampler_wrap_r(ctx, sampObj, param);
+ break;
+ case GL_TEXTURE_MIN_FILTER:
+ res = set_sampler_min_filter(ctx, sampObj, param);
+ break;
+ case GL_TEXTURE_MAG_FILTER:
+ res = set_sampler_mag_filter(ctx, sampObj, param);
+ break;
+ case GL_TEXTURE_MIN_LOD:
+ res = set_sampler_min_lod(ctx, sampObj, (GLfloat) param);
+ break;
+ case GL_TEXTURE_MAX_LOD:
+ res = set_sampler_max_lod(ctx, sampObj, (GLfloat) param);
+ break;
+ case GL_TEXTURE_LOD_BIAS:
+ res = set_sampler_lod_bias(ctx, sampObj, (GLfloat) param);
+ break;
+ case GL_TEXTURE_COMPARE_MODE:
+ res = set_sampler_compare_mode(ctx, sampObj, param);
+ break;
+ case GL_TEXTURE_COMPARE_FUNC:
+ res = set_sampler_compare_func(ctx, sampObj, param);
+ break;
+ case GL_TEXTURE_MAX_ANISOTROPY_EXT:
+ res = set_sampler_max_anisotropy(ctx, sampObj, (GLfloat) param);
+ break;
+ case GL_TEXTURE_CUBE_MAP_SEAMLESS:
+ res = set_sampler_cube_map_seamless(ctx, sampObj, param);
+ break;
+ case GL_TEXTURE_BORDER_COLOR:
+ /* fall-through */
+ default:
+ res = INVALID_PNAME;
+ }
+
+ switch (res) {
+ case GL_FALSE:
+ /* no change */
+ break;
+ case GL_TRUE:
+ /* state change - we do nothing special at this time */
+ break;
+ case INVALID_PNAME:
+ _mesa_error(ctx, GL_INVALID_ENUM, "glSamplerParameteri(pname=%s)\n",
+ _mesa_lookup_enum_by_nr(pname));
+ break;
+ case INVALID_PARAM:
+ _mesa_error(ctx, GL_INVALID_ENUM, "glSamplerParameteri(param=%d)\n",
+ param);
+ break;
+ case INVALID_VALUE:
+ _mesa_error(ctx, GL_INVALID_VALUE, "glSamplerParameteri(param=%d)\n",
+ param);
+ break;
+ default:
+ ;
+ }
+}
+
+
+static void GLAPIENTRY
+_mesa_SamplerParameterf(GLuint sampler, GLenum pname, GLfloat param)
+{
+ struct gl_sampler_object *sampObj;
+ GLuint res;
+ GET_CURRENT_CONTEXT(ctx);
+
+ ASSERT_OUTSIDE_BEGIN_END(ctx);
+
+ sampObj = _mesa_lookup_samplerobj(ctx, sampler);
+ if (!sampObj) {
+ _mesa_error(ctx, GL_INVALID_VALUE, "glSamplerParameterf(sampler %u)",
+ sampler);
+ return;
+ }
+
+ switch (pname) {
+ case GL_TEXTURE_WRAP_S:
+ res = set_sampler_wrap_s(ctx, sampObj, (GLint) param);
+ break;
+ case GL_TEXTURE_WRAP_T:
+ res = set_sampler_wrap_t(ctx, sampObj, (GLint) param);
+ break;
+ case GL_TEXTURE_WRAP_R:
+ res = set_sampler_wrap_r(ctx, sampObj, (GLint) param);
+ break;
+ case GL_TEXTURE_MIN_FILTER:
+ res = set_sampler_min_filter(ctx, sampObj, (GLint) param);
+ break;
+ case GL_TEXTURE_MAG_FILTER:
+ res = set_sampler_mag_filter(ctx, sampObj, (GLint) param);
+ break;
+ case GL_TEXTURE_MIN_LOD:
+ res = set_sampler_min_lod(ctx, sampObj, param);
+ break;
+ case GL_TEXTURE_MAX_LOD:
+ res = set_sampler_max_lod(ctx, sampObj, param);
+ break;
+ case GL_TEXTURE_LOD_BIAS:
+ res = set_sampler_lod_bias(ctx, sampObj, param);
+ break;
+ case GL_TEXTURE_COMPARE_MODE:
+ res = set_sampler_compare_mode(ctx, sampObj, (GLint) param);
+ break;
+ case GL_TEXTURE_COMPARE_FUNC:
+ res = set_sampler_compare_func(ctx, sampObj, (GLint) param);
+ break;
+ case GL_TEXTURE_MAX_ANISOTROPY_EXT:
+ res = set_sampler_max_anisotropy(ctx, sampObj, param);
+ break;
+ case GL_TEXTURE_CUBE_MAP_SEAMLESS:
+ res = set_sampler_cube_map_seamless(ctx, sampObj, (GLboolean) param);
+ break;
+ case GL_TEXTURE_BORDER_COLOR:
+ /* fall-through */
+ default:
+ res = INVALID_PNAME;
+ }
+
+ switch (res) {
+ case GL_FALSE:
+ /* no change */
+ break;
+ case GL_TRUE:
+ /* state change - we do nothing special at this time */
+ break;
+ case INVALID_PNAME:
+ _mesa_error(ctx, GL_INVALID_ENUM, "glSamplerParameterf(pname=%s)\n",
+ _mesa_lookup_enum_by_nr(pname));
+ break;
+ case INVALID_PARAM:
+ _mesa_error(ctx, GL_INVALID_ENUM, "glSamplerParameterf(param=%f)\n",
+ param);
+ break;
+ case INVALID_VALUE:
+ _mesa_error(ctx, GL_INVALID_VALUE, "glSamplerParameterf(param=%f)\n",
+ param);
+ break;
+ default:
+ ;
+ }
+}
+
+static void GLAPIENTRY
+_mesa_SamplerParameteriv(GLuint sampler, GLenum pname, const GLint *params)
+{
+ struct gl_sampler_object *sampObj;
+ GLuint res;
+ GET_CURRENT_CONTEXT(ctx);
+
+ sampObj = _mesa_lookup_samplerobj(ctx, sampler);
+ if (!sampObj) {
+ _mesa_error(ctx, GL_INVALID_VALUE, "glSamplerParameteriv(sampler %u)",
+ sampler);
+ return;
+ }
+
+ switch (pname) {
+ case GL_TEXTURE_WRAP_S:
+ res = set_sampler_wrap_s(ctx, sampObj, params[0]);
+ break;
+ case GL_TEXTURE_WRAP_T:
+ res = set_sampler_wrap_t(ctx, sampObj, params[0]);
+ break;
+ case GL_TEXTURE_WRAP_R:
+ res = set_sampler_wrap_r(ctx, sampObj, params[0]);
+ break;
+ case GL_TEXTURE_MIN_FILTER:
+ res = set_sampler_min_filter(ctx, sampObj, params[0]);
+ break;
+ case GL_TEXTURE_MAG_FILTER:
+ res = set_sampler_mag_filter(ctx, sampObj, params[0]);
+ break;
+ case GL_TEXTURE_MIN_LOD:
+ res = set_sampler_min_lod(ctx, sampObj, (GLfloat) params[0]);
+ break;
+ case GL_TEXTURE_MAX_LOD:
+ res = set_sampler_max_lod(ctx, sampObj, (GLfloat) params[0]);
+ break;
+ case GL_TEXTURE_LOD_BIAS:
+ res = set_sampler_lod_bias(ctx, sampObj, (GLfloat) params[0]);
+ break;
+ case GL_TEXTURE_COMPARE_MODE:
+ res = set_sampler_compare_mode(ctx, sampObj, params[0]);
+ break;
+ case GL_TEXTURE_COMPARE_FUNC:
+ res = set_sampler_compare_func(ctx, sampObj, params[0]);
+ break;
+ case GL_TEXTURE_MAX_ANISOTROPY_EXT:
+ res = set_sampler_max_anisotropy(ctx, sampObj, (GLfloat) params[0]);
+ break;
+ case GL_TEXTURE_CUBE_MAP_SEAMLESS:
+ res = set_sampler_cube_map_seamless(ctx, sampObj, params[0]);
+ break;
+ case GL_TEXTURE_BORDER_COLOR:
+ {
+ GLfloat c[4];
+ c[0] = INT_TO_FLOAT(params[0]);
+ c[1] = INT_TO_FLOAT(params[1]);
+ c[2] = INT_TO_FLOAT(params[2]);
+ c[3] = INT_TO_FLOAT(params[3]);
+ res = set_sampler_border_colorf(ctx, sampObj, c);
+ }
+ break;
+ default:
+ res = INVALID_PNAME;
+ }
+
+ switch (res) {
+ case GL_FALSE:
+ /* no change */
+ break;
+ case GL_TRUE:
+ /* state change - we do nothing special at this time */
+ break;
+ case INVALID_PNAME:
+ _mesa_error(ctx, GL_INVALID_ENUM, "glSamplerParameteriv(pname=%s)\n",
+ _mesa_lookup_enum_by_nr(pname));
+ break;
+ case INVALID_PARAM:
+ _mesa_error(ctx, GL_INVALID_ENUM, "glSamplerParameteriv(param=%d)\n",
+ params[0]);
+ break;
+ case INVALID_VALUE:
+ _mesa_error(ctx, GL_INVALID_VALUE, "glSamplerParameteriv(param=%d)\n",
+ params[0]);
+ break;
+ default:
+ ;
+ }
+}
+
+static void GLAPIENTRY
+_mesa_SamplerParameterfv(GLuint sampler, GLenum pname, const GLfloat *params)
+{
+ struct gl_sampler_object *sampObj;
+ GLuint res;
+ GET_CURRENT_CONTEXT(ctx);
+
+ ASSERT_OUTSIDE_BEGIN_END(ctx);
+
+ sampObj = _mesa_lookup_samplerobj(ctx, sampler);
+ if (!sampObj) {
+ _mesa_error(ctx, GL_INVALID_VALUE, "glSamplerParameterfv(sampler %u)",
+ sampler);
+ return;
+ }
+
+ switch (pname) {
+ case GL_TEXTURE_WRAP_S:
+ res = set_sampler_wrap_s(ctx, sampObj, (GLint) params[0]);
+ break;
+ case GL_TEXTURE_WRAP_T:
+ res = set_sampler_wrap_t(ctx, sampObj, (GLint) params[0]);
+ break;
+ case GL_TEXTURE_WRAP_R:
+ res = set_sampler_wrap_r(ctx, sampObj, (GLint) params[0]);
+ break;
+ case GL_TEXTURE_MIN_FILTER:
+ res = set_sampler_min_filter(ctx, sampObj, (GLint) params[0]);
+ break;
+ case GL_TEXTURE_MAG_FILTER:
+ res = set_sampler_mag_filter(ctx, sampObj, (GLint) params[0]);
+ break;
+ case GL_TEXTURE_MIN_LOD:
+ res = set_sampler_min_lod(ctx, sampObj, params[0]);
+ break;
+ case GL_TEXTURE_MAX_LOD:
+ res = set_sampler_max_lod(ctx, sampObj, params[0]);
+ break;
+ case GL_TEXTURE_LOD_BIAS:
+ res = set_sampler_lod_bias(ctx, sampObj, params[0]);
+ break;
+ case GL_TEXTURE_COMPARE_MODE:
+ res = set_sampler_compare_mode(ctx, sampObj, (GLint) params[0]);
+ break;
+ case GL_TEXTURE_COMPARE_FUNC:
+ res = set_sampler_compare_func(ctx, sampObj, (GLint) params[0]);
+ break;
+ case GL_TEXTURE_MAX_ANISOTROPY_EXT:
+ res = set_sampler_max_anisotropy(ctx, sampObj, params[0]);
+ break;
+ case GL_TEXTURE_CUBE_MAP_SEAMLESS:
+ res = set_sampler_cube_map_seamless(ctx, sampObj, (GLboolean) params[0]);
+ break;
+ case GL_TEXTURE_BORDER_COLOR:
+ res = set_sampler_border_colorf(ctx, sampObj, params);
+ break;
+ default:
+ res = INVALID_PNAME;
+ }
+
+ switch (res) {
+ case GL_FALSE:
+ /* no change */
+ break;
+ case GL_TRUE:
+ /* state change - we do nothing special at this time */
+ break;
+ case INVALID_PNAME:
+ _mesa_error(ctx, GL_INVALID_ENUM, "glSamplerParameterfv(pname=%s)\n",
+ _mesa_lookup_enum_by_nr(pname));
+ break;
+ case INVALID_PARAM:
+ _mesa_error(ctx, GL_INVALID_ENUM, "glSamplerParameterfv(param=%f)\n",
+ params[0]);
+ break;
+ case INVALID_VALUE:
+ _mesa_error(ctx, GL_INVALID_VALUE, "glSamplerParameterfv(param=%f)\n",
+ params[0]);
+ break;
+ default:
+ ;
+ }
+}
+
+static void GLAPIENTRY
+_mesa_SamplerParameterIiv(GLuint sampler, GLenum pname, const GLint *params)
+{
+ struct gl_sampler_object *sampObj;
+ GLuint res;
+ GET_CURRENT_CONTEXT(ctx);
+
+ sampObj = _mesa_lookup_samplerobj(ctx, sampler);
+ if (!sampObj) {
+ _mesa_error(ctx, GL_INVALID_VALUE, "glSamplerParameterIiv(sampler %u)",
+ sampler);
+ return;
+ }
+
+ switch (pname) {
+ case GL_TEXTURE_WRAP_S:
+ res = set_sampler_wrap_s(ctx, sampObj, params[0]);
+ break;
+ case GL_TEXTURE_WRAP_T:
+ res = set_sampler_wrap_t(ctx, sampObj, params[0]);
+ break;
+ case GL_TEXTURE_WRAP_R:
+ res = set_sampler_wrap_r(ctx, sampObj, params[0]);
+ break;
+ case GL_TEXTURE_MIN_FILTER:
+ res = set_sampler_min_filter(ctx, sampObj, params[0]);
+ break;
+ case GL_TEXTURE_MAG_FILTER:
+ res = set_sampler_mag_filter(ctx, sampObj, params[0]);
+ break;
+ case GL_TEXTURE_MIN_LOD:
+ res = set_sampler_min_lod(ctx, sampObj, (GLfloat) params[0]);
+ break;
+ case GL_TEXTURE_MAX_LOD:
+ res = set_sampler_max_lod(ctx, sampObj, (GLfloat) params[0]);
+ break;
+ case GL_TEXTURE_LOD_BIAS:
+ res = set_sampler_lod_bias(ctx, sampObj, (GLfloat) params[0]);
+ break;
+ case GL_TEXTURE_COMPARE_MODE:
+ res = set_sampler_compare_mode(ctx, sampObj, params[0]);
+ break;
+ case GL_TEXTURE_COMPARE_FUNC:
+ res = set_sampler_compare_func(ctx, sampObj, params[0]);
+ break;
+ case GL_TEXTURE_MAX_ANISOTROPY_EXT:
+ res = set_sampler_max_anisotropy(ctx, sampObj, (GLfloat) params[0]);
+ break;
+ case GL_TEXTURE_CUBE_MAP_SEAMLESS:
+ res = set_sampler_cube_map_seamless(ctx, sampObj, params[0]);
+ break;
+ case GL_TEXTURE_BORDER_COLOR:
+ res = set_sampler_border_colori(ctx, sampObj, params);
+ break;
+ default:
+ res = INVALID_PNAME;
+ }
+
+ switch (res) {
+ case GL_FALSE:
+ /* no change */
+ break;
+ case GL_TRUE:
+ /* state change - we do nothing special at this time */
+ break;
+ case INVALID_PNAME:
+ _mesa_error(ctx, GL_INVALID_ENUM, "glSamplerParameterIiv(pname=%s)\n",
+ _mesa_lookup_enum_by_nr(pname));
+ break;
+ case INVALID_PARAM:
+ _mesa_error(ctx, GL_INVALID_ENUM, "glSamplerParameterIiv(param=%d)\n",
+ params[0]);
+ break;
+ case INVALID_VALUE:
+ _mesa_error(ctx, GL_INVALID_VALUE, "glSamplerParameterIiv(param=%d)\n",
+ params[0]);
+ break;
+ default:
+ ;
+ }
+}
+
+
+static void GLAPIENTRY
+_mesa_SamplerParameterIuiv(GLuint sampler, GLenum pname, const GLuint *params)
+{
+ struct gl_sampler_object *sampObj;
+ GLuint res;
+ GET_CURRENT_CONTEXT(ctx);
+
+ sampObj = _mesa_lookup_samplerobj(ctx, sampler);
+ if (!sampObj) {
+ _mesa_error(ctx, GL_INVALID_VALUE, "glSamplerParameterIuiv(sampler %u)",
+ sampler);
+ return;
+ }
+
+ switch (pname) {
+ case GL_TEXTURE_WRAP_S:
+ res = set_sampler_wrap_s(ctx, sampObj, params[0]);
+ break;
+ case GL_TEXTURE_WRAP_T:
+ res = set_sampler_wrap_t(ctx, sampObj, params[0]);
+ break;
+ case GL_TEXTURE_WRAP_R:
+ res = set_sampler_wrap_r(ctx, sampObj, params[0]);
+ break;
+ case GL_TEXTURE_MIN_FILTER:
+ res = set_sampler_min_filter(ctx, sampObj, params[0]);
+ break;
+ case GL_TEXTURE_MAG_FILTER:
+ res = set_sampler_mag_filter(ctx, sampObj, params[0]);
+ break;
+ case GL_TEXTURE_MIN_LOD:
+ res = set_sampler_min_lod(ctx, sampObj, (GLfloat) params[0]);
+ break;
+ case GL_TEXTURE_MAX_LOD:
+ res = set_sampler_max_lod(ctx, sampObj, (GLfloat) params[0]);
+ break;
+ case GL_TEXTURE_LOD_BIAS:
+ res = set_sampler_lod_bias(ctx, sampObj, (GLfloat) params[0]);
+ break;
+ case GL_TEXTURE_COMPARE_MODE:
+ res = set_sampler_compare_mode(ctx, sampObj, params[0]);
+ break;
+ case GL_TEXTURE_COMPARE_FUNC:
+ res = set_sampler_compare_func(ctx, sampObj, params[0]);
+ break;
+ case GL_TEXTURE_MAX_ANISOTROPY_EXT:
+ res = set_sampler_max_anisotropy(ctx, sampObj, (GLfloat) params[0]);
+ break;
+ case GL_TEXTURE_CUBE_MAP_SEAMLESS:
+ res = set_sampler_cube_map_seamless(ctx, sampObj, params[0]);
+ break;
+ case GL_TEXTURE_BORDER_COLOR:
+ res = set_sampler_border_colorui(ctx, sampObj, params);
+ break;
+ default:
+ res = INVALID_PNAME;
+ }
+
+ switch (res) {
+ case GL_FALSE:
+ /* no change */
+ break;
+ case GL_TRUE:
+ /* state change - we do nothing special at this time */
+ break;
+ case INVALID_PNAME:
+ _mesa_error(ctx, GL_INVALID_ENUM, "glSamplerParameterIuiv(pname=%s)\n",
+ _mesa_lookup_enum_by_nr(pname));
+ break;
+ case INVALID_PARAM:
+ _mesa_error(ctx, GL_INVALID_ENUM, "glSamplerParameterIuiv(param=%u)\n",
+ params[0]);
+ break;
+ case INVALID_VALUE:
+ _mesa_error(ctx, GL_INVALID_VALUE, "glSamplerParameterIuiv(param=%u)\n",
+ params[0]);
+ break;
+ default:
+ ;
+ }
+}
+
+
+static void GLAPIENTRY
+_mesa_GetSamplerParameteriv(GLuint sampler, GLenum pname, GLint *params)
+{
+ struct gl_sampler_object *sampObj;
+ GET_CURRENT_CONTEXT(ctx);
+
+ sampObj = _mesa_lookup_samplerobj(ctx, sampler);
+ if (!sampObj) {
+ _mesa_error(ctx, GL_INVALID_VALUE, "glGetSamplerParameteriv(sampler %u)",
+ sampler);
+ return;
+ }
+
+ switch (pname) {
+ case GL_TEXTURE_WRAP_S:
+ *params = sampObj->WrapS;
+ break;
+ case GL_TEXTURE_WRAP_T:
+ *params = sampObj->WrapT;
+ break;
+ case GL_TEXTURE_WRAP_R:
+ *params = sampObj->WrapR;
+ break;
+ case GL_TEXTURE_MIN_FILTER:
+ *params = sampObj->MinFilter;
+ break;
+ case GL_TEXTURE_MAG_FILTER:
+ *params = sampObj->MagFilter;
+ break;
+ case GL_TEXTURE_MIN_LOD:
+ *params = (GLint) sampObj->MinLod;
+ break;
+ case GL_TEXTURE_MAX_LOD:
+ *params = (GLint) sampObj->MaxLod;
+ break;
+ case GL_TEXTURE_LOD_BIAS:
+ *params = (GLint) sampObj->LodBias;
+ break;
+ case GL_TEXTURE_COMPARE_MODE:
+ if (!ctx->Extensions.ARB_shadow)
+ goto invalid_pname;
+ *params = sampObj->CompareMode;
+ break;
+ case GL_TEXTURE_COMPARE_FUNC:
+ if (!ctx->Extensions.ARB_shadow)
+ goto invalid_pname;
+ *params = sampObj->CompareFunc;
+ break;
+ case GL_TEXTURE_MAX_ANISOTROPY_EXT:
+ *params = (GLint) sampObj->MaxAnisotropy;
+ break;
+ case GL_TEXTURE_BORDER_COLOR:
+ params[0] = FLOAT_TO_INT(sampObj->BorderColor.f[0]);
+ params[1] = FLOAT_TO_INT(sampObj->BorderColor.f[1]);
+ params[2] = FLOAT_TO_INT(sampObj->BorderColor.f[2]);
+ params[3] = FLOAT_TO_INT(sampObj->BorderColor.f[3]);
+ break;
+ case GL_TEXTURE_CUBE_MAP_SEAMLESS:
+ if (!ctx->Extensions.AMD_seamless_cubemap_per_texture)
+ goto invalid_pname;
+ *params = sampObj->CubeMapSeamless;
+ break;
+ default:
+ goto invalid_pname;
+ }
+ return;
+
+invalid_pname:
+ _mesa_error(ctx, GL_INVALID_ENUM, "glGetSamplerParameteriv(pname=%s)",
+ _mesa_lookup_enum_by_nr(pname));
+}
+
+
+static void GLAPIENTRY
+_mesa_GetSamplerParameterfv(GLuint sampler, GLenum pname, GLfloat *params)
+{
+ struct gl_sampler_object *sampObj;
+ GET_CURRENT_CONTEXT(ctx);
+
+ sampObj = _mesa_lookup_samplerobj(ctx, sampler);
+ if (!sampObj) {
+ _mesa_error(ctx, GL_INVALID_VALUE, "glGetSamplerParameterfv(sampler %u)",
+ sampler);
+ return;
+ }
+
+ switch (pname) {
+ case GL_TEXTURE_WRAP_S:
+ *params = (GLfloat) sampObj->WrapS;
+ break;
+ case GL_TEXTURE_WRAP_T:
+ *params = (GLfloat) sampObj->WrapT;
+ break;
+ case GL_TEXTURE_WRAP_R:
+ *params = (GLfloat) sampObj->WrapR;
+ break;
+ case GL_TEXTURE_MIN_FILTER:
+ *params = (GLfloat) sampObj->MinFilter;
+ break;
+ case GL_TEXTURE_MAG_FILTER:
+ *params = (GLfloat) sampObj->MagFilter;
+ break;
+ case GL_TEXTURE_MIN_LOD:
+ *params = sampObj->MinLod;
+ break;
+ case GL_TEXTURE_MAX_LOD:
+ *params = sampObj->MaxLod;
+ break;
+ case GL_TEXTURE_LOD_BIAS:
+ *params = sampObj->LodBias;
+ break;
+ case GL_TEXTURE_COMPARE_MODE:
+ if (!ctx->Extensions.ARB_shadow)
+ goto invalid_pname;
+ *params = (GLfloat) sampObj->CompareMode;
+ break;
+ case GL_TEXTURE_COMPARE_FUNC:
+ if (!ctx->Extensions.ARB_shadow)
+ goto invalid_pname;
+ *params = (GLfloat) sampObj->CompareFunc;
+ break;
+ case GL_TEXTURE_MAX_ANISOTROPY_EXT:
+ *params = sampObj->MaxAnisotropy;
+ break;
+ case GL_TEXTURE_BORDER_COLOR:
+ params[0] = sampObj->BorderColor.f[0];
+ params[1] = sampObj->BorderColor.f[1];
+ params[2] = sampObj->BorderColor.f[2];
+ params[3] = sampObj->BorderColor.f[3];
+ break;
+ case GL_TEXTURE_CUBE_MAP_SEAMLESS:
+ if (!ctx->Extensions.AMD_seamless_cubemap_per_texture)
+ goto invalid_pname;
+ *params = (GLfloat) sampObj->CubeMapSeamless;
+ break;
+ default:
+ goto invalid_pname;
+ }
+ return;
+
+invalid_pname:
+ _mesa_error(ctx, GL_INVALID_ENUM, "glGetSamplerParameterfv(pname=%s)",
+ _mesa_lookup_enum_by_nr(pname));
+}
+
+
+static void GLAPIENTRY
+_mesa_GetSamplerParameterIiv(GLuint sampler, GLenum pname, GLint *params)
+{
+ struct gl_sampler_object *sampObj;
+ GET_CURRENT_CONTEXT(ctx);
+
+ sampObj = _mesa_lookup_samplerobj(ctx, sampler);
+ if (!sampObj) {
+ _mesa_error(ctx, GL_INVALID_VALUE,
+ "glGetSamplerParameterIiv(sampler %u)",
+ sampler);
+ return;
+ }
+
+ switch (pname) {
+ case GL_TEXTURE_WRAP_S:
+ *params = sampObj->WrapS;
+ break;
+ case GL_TEXTURE_WRAP_T:
+ *params = sampObj->WrapT;
+ break;
+ case GL_TEXTURE_WRAP_R:
+ *params = sampObj->WrapR;
+ break;
+ case GL_TEXTURE_MIN_FILTER:
+ *params = sampObj->MinFilter;
+ break;
+ case GL_TEXTURE_MAG_FILTER:
+ *params = sampObj->MagFilter;
+ break;
+ case GL_TEXTURE_MIN_LOD:
+ *params = (GLint) sampObj->MinLod;
+ break;
+ case GL_TEXTURE_MAX_LOD:
+ *params = (GLint) sampObj->MaxLod;
+ break;
+ case GL_TEXTURE_LOD_BIAS:
+ *params = (GLint) sampObj->LodBias;
+ break;
+ case GL_TEXTURE_COMPARE_MODE:
+ if (!ctx->Extensions.ARB_shadow)
+ goto invalid_pname;
+ *params = sampObj->CompareMode;
+ break;
+ case GL_TEXTURE_COMPARE_FUNC:
+ if (!ctx->Extensions.ARB_shadow)
+ goto invalid_pname;
+ *params = sampObj->CompareFunc;
+ break;
+ case GL_TEXTURE_MAX_ANISOTROPY_EXT:
+ *params = (GLint) sampObj->MaxAnisotropy;
+ break;
+ case GL_TEXTURE_BORDER_COLOR:
+ params[0] = sampObj->BorderColor.i[0];
+ params[1] = sampObj->BorderColor.i[1];
+ params[2] = sampObj->BorderColor.i[2];
+ params[3] = sampObj->BorderColor.i[3];
+ break;
+ case GL_TEXTURE_CUBE_MAP_SEAMLESS:
+ if (!ctx->Extensions.AMD_seamless_cubemap_per_texture)
+ goto invalid_pname;
+ *params = sampObj->CubeMapSeamless;
+ break;
+ default:
+ goto invalid_pname;
+ }
+ return;
+
+invalid_pname:
+ _mesa_error(ctx, GL_INVALID_ENUM, "glGetSamplerParameterIiv(pname=%s)",
+ _mesa_lookup_enum_by_nr(pname));
+}
+
+
+static void GLAPIENTRY
+_mesa_GetSamplerParameterIuiv(GLuint sampler, GLenum pname, GLuint *params)
+{
+ struct gl_sampler_object *sampObj;
+ GET_CURRENT_CONTEXT(ctx);
+
+ sampObj = _mesa_lookup_samplerobj(ctx, sampler);
+ if (!sampObj) {
+ _mesa_error(ctx, GL_INVALID_VALUE,
+ "glGetSamplerParameterIuiv(sampler %u)",
+ sampler);
+ return;
+ }
+
+ switch (pname) {
+ case GL_TEXTURE_WRAP_S:
+ *params = sampObj->WrapS;
+ break;
+ case GL_TEXTURE_WRAP_T:
+ *params = sampObj->WrapT;
+ break;
+ case GL_TEXTURE_WRAP_R:
+ *params = sampObj->WrapR;
+ break;
+ case GL_TEXTURE_MIN_FILTER:
+ *params = sampObj->MinFilter;
+ break;
+ case GL_TEXTURE_MAG_FILTER:
+ *params = sampObj->MagFilter;
+ break;
+ case GL_TEXTURE_MIN_LOD:
+ *params = (GLuint) sampObj->MinLod;
+ break;
+ case GL_TEXTURE_MAX_LOD:
+ *params = (GLuint) sampObj->MaxLod;
+ break;
+ case GL_TEXTURE_LOD_BIAS:
+ *params = (GLuint) sampObj->LodBias;
+ break;
+ case GL_TEXTURE_COMPARE_MODE:
+ if (!ctx->Extensions.ARB_shadow)
+ goto invalid_pname;
+ *params = sampObj->CompareMode;
+ break;
+ case GL_TEXTURE_COMPARE_FUNC:
+ if (!ctx->Extensions.ARB_shadow)
+ goto invalid_pname;
+ *params = sampObj->CompareFunc;
+ break;
+ case GL_TEXTURE_MAX_ANISOTROPY_EXT:
+ *params = (GLuint) sampObj->MaxAnisotropy;
+ break;
+ case GL_TEXTURE_BORDER_COLOR:
+ params[0] = sampObj->BorderColor.ui[0];
+ params[1] = sampObj->BorderColor.ui[1];
+ params[2] = sampObj->BorderColor.ui[2];
+ params[3] = sampObj->BorderColor.ui[3];
+ break;
+ case GL_TEXTURE_CUBE_MAP_SEAMLESS:
+ if (!ctx->Extensions.AMD_seamless_cubemap_per_texture)
+ goto invalid_pname;
+ *params = sampObj->CubeMapSeamless;
+ break;
+ default:
+ goto invalid_pname;
+ }
+ return;
+
+invalid_pname:
+ _mesa_error(ctx, GL_INVALID_ENUM, "glGetSamplerParameterIuiv(pname=%s)",
+ _mesa_lookup_enum_by_nr(pname));
+}
+
+
+void
+_mesa_init_sampler_object_functions(struct dd_function_table *driver)
+{
+ driver->NewSamplerObject = _mesa_new_sampler_object;
+ driver->DeleteSamplerObject = _mesa_delete_sampler_object;
+}
+
+
+void
+_mesa_init_sampler_object_dispatch(struct _glapi_table *disp)
+{
+ SET_GenSamplers(disp, _mesa_GenSamplers);
+ SET_DeleteSamplers(disp, _mesa_DeleteSamplers);
+ SET_IsSampler(disp, _mesa_IsSampler);
+ SET_BindSampler(disp, _mesa_BindSampler);
+ SET_SamplerParameteri(disp, _mesa_SamplerParameteri);
+ SET_SamplerParameterf(disp, _mesa_SamplerParameterf);
+ SET_SamplerParameteriv(disp, _mesa_SamplerParameteriv);
+ SET_SamplerParameterfv(disp, _mesa_SamplerParameterfv);
+ SET_SamplerParameterIiv(disp, _mesa_SamplerParameterIiv);
+ SET_SamplerParameterIuiv(disp, _mesa_SamplerParameterIuiv);
+ SET_GetSamplerParameteriv(disp, _mesa_GetSamplerParameteriv);
+ SET_GetSamplerParameterfv(disp, _mesa_GetSamplerParameterfv);
+ SET_GetSamplerParameterIiv(disp, _mesa_GetSamplerParameterIiv);
+ SET_GetSamplerParameterIuiv(disp, _mesa_GetSamplerParameterIuiv);
+}
diff --git a/mesalib/src/mesa/main/samplerobj.h b/mesalib/src/mesa/main/samplerobj.h
index a839010b7..4245594d6 100644
--- a/mesalib/src/mesa/main/samplerobj.h
+++ b/mesalib/src/mesa/main/samplerobj.h
@@ -1,62 +1,62 @@
-/*
- * Mesa 3-D graphics library
- *
- * Copyright (C) 2011 VMware, Inc. All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-
-
-#ifndef SAMPLEROBJ_H
-#define SAMPLEROBJ_H
-
-struct dd_function_table;
-
-static INLINE struct gl_sampler_object *
-_mesa_get_samplerobj(struct gl_context *ctx, GLuint unit)
-{
- if (ctx->Texture.Unit[unit].Sampler)
- return ctx->Texture.Unit[unit].Sampler;
- else
- return &ctx->Texture.Unit[unit]._Current->Sampler;
-}
-
-extern void
-_mesa_reference_sampler_object(struct gl_context *ctx,
- struct gl_sampler_object **ptr,
- struct gl_sampler_object *samp);
-
-extern void
-_mesa_init_sampler_object(struct gl_sampler_object *sampObj, GLuint name);
-
-extern struct gl_sampler_object *
-_mesa_new_sampler_object(struct gl_context *ctx, GLuint name);
-
-extern void
-_mesa_delete_sampler_object(struct gl_context *ctx,
- struct gl_sampler_object *sampObj);
-
-extern void
-_mesa_init_sampler_object_functions(struct dd_function_table *driver);
-
-extern void
-_mesa_init_sampler_object_dispatch(struct _glapi_table *disp);
-
-
-#endif /* SAMPLEROBJ_H */
+/*
+ * Mesa 3-D graphics library
+ *
+ * Copyright (C) 2011 VMware, Inc. All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+
+
+#ifndef SAMPLEROBJ_H
+#define SAMPLEROBJ_H
+
+struct dd_function_table;
+
+static INLINE struct gl_sampler_object *
+_mesa_get_samplerobj(struct gl_context *ctx, GLuint unit)
+{
+ if (ctx->Texture.Unit[unit].Sampler)
+ return ctx->Texture.Unit[unit].Sampler;
+ else
+ return &ctx->Texture.Unit[unit]._Current->Sampler;
+}
+
+extern void
+_mesa_reference_sampler_object(struct gl_context *ctx,
+ struct gl_sampler_object **ptr,
+ struct gl_sampler_object *samp);
+
+extern void
+_mesa_init_sampler_object(struct gl_sampler_object *sampObj, GLuint name);
+
+extern struct gl_sampler_object *
+_mesa_new_sampler_object(struct gl_context *ctx, GLuint name);
+
+extern void
+_mesa_delete_sampler_object(struct gl_context *ctx,
+ struct gl_sampler_object *sampObj);
+
+extern void
+_mesa_init_sampler_object_functions(struct dd_function_table *driver);
+
+extern void
+_mesa_init_sampler_object_dispatch(struct _glapi_table *disp);
+
+
+#endif /* SAMPLEROBJ_H */
diff --git a/mesalib/src/mesa/main/shaderapi.c b/mesalib/src/mesa/main/shaderapi.c
index 514eed5d0..baebb5cd3 100644
--- a/mesalib/src/mesa/main/shaderapi.c
+++ b/mesalib/src/mesa/main/shaderapi.c
@@ -1,1938 +1,1938 @@
-/*
- * Mesa 3-D graphics library
- *
- * Copyright (C) 2004-2008 Brian Paul All Rights Reserved.
- * Copyright (C) 2009-2010 VMware, Inc. All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-/**
- * \file shaderapi.c
- * \author Brian Paul
- *
- * Implementation of GLSL-related API functions.
- * The glUniform* functions are in uniforms.c
- *
- *
- * XXX things to do:
- * 1. Check that the right error code is generated for all _mesa_error() calls.
- * 2. Insert FLUSH_VERTICES calls in various places
- */
-
-
-#include "main/glheader.h"
-#include "main/context.h"
-#include "main/dispatch.h"
-#include "main/enums.h"
-#include "main/hash.h"
-#include "main/mfeatures.h"
-#include "main/mtypes.h"
-#include "main/shaderapi.h"
-#include "main/shaderobj.h"
-#include "program/program.h"
-#include "program/prog_parameter.h"
-#include "program/prog_uniform.h"
-#include "ralloc.h"
-#include <stdbool.h>
-#include "../glsl/glsl_parser_extras.h"
-
-/** Define this to enable shader substitution (see below) */
-#define SHADER_SUBST 0
-
-
-/**
- * Return mask of GLSL_x flags by examining the MESA_GLSL env var.
- */
-static GLbitfield
-get_shader_flags(void)
-{
- GLbitfield flags = 0x0;
- const char *env = _mesa_getenv("MESA_GLSL");
-
- if (env) {
- if (strstr(env, "dump"))
- flags |= GLSL_DUMP;
- if (strstr(env, "log"))
- flags |= GLSL_LOG;
- if (strstr(env, "nopvert"))
- flags |= GLSL_NOP_VERT;
- if (strstr(env, "nopfrag"))
- flags |= GLSL_NOP_FRAG;
- if (strstr(env, "nopt"))
- flags |= GLSL_NO_OPT;
- else if (strstr(env, "opt"))
- flags |= GLSL_OPT;
- if (strstr(env, "uniform"))
- flags |= GLSL_UNIFORMS;
- if (strstr(env, "useprog"))
- flags |= GLSL_USE_PROG;
- }
-
- return flags;
-}
-
-
-/**
- * Initialize context's shader state.
- */
-void
-_mesa_init_shader_state(struct gl_context *ctx)
-{
- /* Device drivers may override these to control what kind of instructions
- * are generated by the GLSL compiler.
- */
- struct gl_shader_compiler_options options;
- gl_shader_type sh;
-
- memset(&options, 0, sizeof(options));
- options.MaxUnrollIterations = 32;
-
- /* Default pragma settings */
- options.DefaultPragmas.Optimize = GL_TRUE;
-
- for (sh = 0; sh < MESA_SHADER_TYPES; ++sh)
- memcpy(&ctx->ShaderCompilerOptions[sh], &options, sizeof(options));
-
- ctx->Shader.Flags = get_shader_flags();
-}
-
-
-/**
- * Free the per-context shader-related state.
- */
-void
-_mesa_free_shader_state(struct gl_context *ctx)
-{
- _mesa_reference_shader_program(ctx, &ctx->Shader.CurrentVertexProgram, NULL);
- _mesa_reference_shader_program(ctx, &ctx->Shader.CurrentGeometryProgram,
- NULL);
- _mesa_reference_shader_program(ctx, &ctx->Shader.CurrentFragmentProgram,
- NULL);
- _mesa_reference_shader_program(ctx, &ctx->Shader.ActiveProgram, NULL);
-}
-
-
-/**
- * Return the size of the given GLSL datatype, in floats (components).
- */
-GLint
-_mesa_sizeof_glsl_type(GLenum type)
-{
- switch (type) {
- case GL_FLOAT:
- case GL_INT:
- case GL_BOOL:
- case GL_SAMPLER_1D:
- case GL_SAMPLER_2D:
- case GL_SAMPLER_3D:
- case GL_SAMPLER_CUBE:
- case GL_SAMPLER_1D_SHADOW:
- case GL_SAMPLER_2D_SHADOW:
- case GL_SAMPLER_2D_RECT_ARB:
- case GL_SAMPLER_2D_RECT_SHADOW_ARB:
- case GL_SAMPLER_1D_ARRAY_EXT:
- case GL_SAMPLER_2D_ARRAY_EXT:
- case GL_SAMPLER_1D_ARRAY_SHADOW_EXT:
- case GL_SAMPLER_2D_ARRAY_SHADOW_EXT:
- case GL_SAMPLER_CUBE_SHADOW_EXT:
- return 1;
- case GL_FLOAT_VEC2:
- case GL_INT_VEC2:
- case GL_UNSIGNED_INT_VEC2:
- case GL_BOOL_VEC2:
- return 2;
- case GL_FLOAT_VEC3:
- case GL_INT_VEC3:
- case GL_UNSIGNED_INT_VEC3:
- case GL_BOOL_VEC3:
- return 3;
- case GL_FLOAT_VEC4:
- case GL_INT_VEC4:
- case GL_UNSIGNED_INT_VEC4:
- case GL_BOOL_VEC4:
- return 4;
- case GL_FLOAT_MAT2:
- case GL_FLOAT_MAT2x3:
- case GL_FLOAT_MAT2x4:
- return 8; /* two float[4] vectors */
- case GL_FLOAT_MAT3:
- case GL_FLOAT_MAT3x2:
- case GL_FLOAT_MAT3x4:
- return 12; /* three float[4] vectors */
- case GL_FLOAT_MAT4:
- case GL_FLOAT_MAT4x2:
- case GL_FLOAT_MAT4x3:
- return 16; /* four float[4] vectors */
- default:
- _mesa_problem(NULL, "Invalid type in _mesa_sizeof_glsl_type()");
- return 1;
- }
-}
-
-
-/**
- * Copy string from <src> to <dst>, up to maxLength characters, returning
- * length of <dst> in <length>.
- * \param src the strings source
- * \param maxLength max chars to copy
- * \param length returns number of chars copied
- * \param dst the string destination
- */
-void
-_mesa_copy_string(GLchar *dst, GLsizei maxLength,
- GLsizei *length, const GLchar *src)
-{
- GLsizei len;
- for (len = 0; len < maxLength - 1 && src && src[len]; len++)
- dst[len] = src[len];
- if (maxLength > 0)
- dst[len] = 0;
- if (length)
- *length = len;
-}
-
-
-
-/**
- * Confirm that the a shader type is valid and supported by the implementation
- *
- * \param ctx Current GL context
- * \param type Shader target
- *
- */
-static bool
-validate_shader_target(const struct gl_context *ctx, GLenum type)
-{
- switch (type) {
-#if FEATURE_ARB_fragment_shader
- case GL_FRAGMENT_SHADER:
- return ctx->Extensions.ARB_fragment_shader;
-#endif
-#if FEATURE_ARB_vertex_shader
- case GL_VERTEX_SHADER:
- return ctx->Extensions.ARB_vertex_shader;
-#endif
-#if FEATURE_ARB_geometry_shader4
- case GL_GEOMETRY_SHADER_ARB:
- return ctx->Extensions.ARB_geometry_shader4;
-#endif
- default:
- return false;
- }
-}
-
-
-/**
- * Find the length of the longest transform feedback varying name
- * which was specified with glTransformFeedbackVaryings().
- */
-static GLint
-longest_feedback_varying_name(const struct gl_shader_program *shProg)
-{
- GLuint i;
- GLint max = 0;
- for (i = 0; i < shProg->TransformFeedback.NumVarying; i++) {
- GLint len = strlen(shProg->TransformFeedback.VaryingNames[i]);
- if (len > max)
- max = len;
- }
- return max;
-}
-
-
-
-static GLboolean
-is_program(struct gl_context *ctx, GLuint name)
-{
- struct gl_shader_program *shProg = _mesa_lookup_shader_program(ctx, name);
- return shProg ? GL_TRUE : GL_FALSE;
-}
-
-
-static GLboolean
-is_shader(struct gl_context *ctx, GLuint name)
-{
- struct gl_shader *shader = _mesa_lookup_shader(ctx, name);
- return shader ? GL_TRUE : GL_FALSE;
-}
-
-
-/**
- * Attach shader to a shader program.
- */
-static void
-attach_shader(struct gl_context *ctx, GLuint program, GLuint shader)
-{
- struct gl_shader_program *shProg;
- struct gl_shader *sh;
- GLuint i, n;
-
- shProg = _mesa_lookup_shader_program_err(ctx, program, "glAttachShader");
- if (!shProg)
- return;
-
- sh = _mesa_lookup_shader_err(ctx, shader, "glAttachShader");
- if (!sh) {
- return;
- }
-
- n = shProg->NumShaders;
- for (i = 0; i < n; i++) {
- if (shProg->Shaders[i] == sh) {
- /* The shader is already attched to this program. The
- * GL_ARB_shader_objects spec says:
- *
- * "The error INVALID_OPERATION is generated by AttachObjectARB
- * if <obj> is already attached to <containerObj>."
- */
- _mesa_error(ctx, GL_INVALID_OPERATION, "glAttachShader");
- return;
- }
- }
-
- /* grow list */
- shProg->Shaders = (struct gl_shader **)
- _mesa_realloc(shProg->Shaders,
- n * sizeof(struct gl_shader *),
- (n + 1) * sizeof(struct gl_shader *));
- if (!shProg->Shaders) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "glAttachShader");
- return;
- }
-
- /* append */
- shProg->Shaders[n] = NULL; /* since realloc() didn't zero the new space */
- _mesa_reference_shader(ctx, &shProg->Shaders[n], sh);
- shProg->NumShaders++;
-}
-
-
-static GLint
-get_attrib_location(struct gl_context *ctx, GLuint program, const GLchar *name)
-{
- struct gl_shader_program *shProg
- = _mesa_lookup_shader_program_err(ctx, program, "glGetAttribLocation");
-
- if (!shProg) {
- return -1;
- }
-
- if (!shProg->LinkStatus) {
- _mesa_error(ctx, GL_INVALID_OPERATION,
- "glGetAttribLocation(program not linked)");
- return -1;
- }
-
- if (!name)
- return -1;
-
- if (shProg->VertexProgram) {
- const struct gl_program_parameter_list *attribs =
- shProg->VertexProgram->Base.Attributes;
- if (attribs) {
- GLint i = _mesa_lookup_parameter_index(attribs, -1, name);
- if (i >= 0) {
- return attribs->Parameters[i].StateIndexes[0];
- }
- }
- }
- return -1;
-}
-
-
-static void
-bind_attrib_location(struct gl_context *ctx, GLuint program, GLuint index,
- const GLchar *name)
-{
- struct gl_shader_program *shProg;
- const GLint size = -1; /* unknown size */
- GLint i;
- GLenum datatype = GL_FLOAT_VEC4;
-
- shProg = _mesa_lookup_shader_program_err(ctx, program,
- "glBindAttribLocation");
- if (!shProg) {
- return;
- }
-
- if (!name)
- return;
-
- if (strncmp(name, "gl_", 3) == 0) {
- _mesa_error(ctx, GL_INVALID_OPERATION,
- "glBindAttribLocation(illegal name)");
- return;
- }
-
- if (index >= ctx->Const.VertexProgram.MaxAttribs) {
- _mesa_error(ctx, GL_INVALID_VALUE, "glBindAttribLocation(index)");
- return;
- }
-
- /* this will replace the current value if it's already in the list */
- i = _mesa_add_attribute(shProg->Attributes, name, size, datatype, index);
- if (i < 0) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "glBindAttribLocation");
- return;
- }
-
- /*
- * Note that this attribute binding won't go into effect until
- * glLinkProgram is called again.
- */
-}
-
-
-static void
-bind_frag_data_location(struct gl_context *ctx, GLuint program,
- GLuint colorNumber, const GLchar *name)
-{
- _mesa_problem(ctx, "bind_frag_data_location() not implemented yet");
-}
-
-
-static GLuint
-create_shader(struct gl_context *ctx, GLenum type)
-{
- struct gl_shader *sh;
- GLuint name;
-
- if (!validate_shader_target(ctx, type)) {
- _mesa_error(ctx, GL_INVALID_ENUM, "CreateShader(type)");
- return 0;
- }
-
- name = _mesa_HashFindFreeKeyBlock(ctx->Shared->ShaderObjects, 1);
- sh = ctx->Driver.NewShader(ctx, name, type);
- _mesa_HashInsert(ctx->Shared->ShaderObjects, name, sh);
-
- return name;
-}
-
-
-static GLuint
-create_shader_program(struct gl_context *ctx)
-{
- GLuint name;
- struct gl_shader_program *shProg;
-
- name = _mesa_HashFindFreeKeyBlock(ctx->Shared->ShaderObjects, 1);
-
- shProg = ctx->Driver.NewShaderProgram(ctx, name);
-
- _mesa_HashInsert(ctx->Shared->ShaderObjects, name, shProg);
-
- assert(shProg->RefCount == 1);
-
- return name;
-}
-
-
-/**
- * Named w/ "2" to indicate OpenGL 2.x vs GL_ARB_fragment_programs's
- * DeleteProgramARB.
- */
-static void
-delete_shader_program(struct gl_context *ctx, GLuint name)
-{
- /*
- * NOTE: deleting shaders/programs works a bit differently than
- * texture objects (and buffer objects, etc). Shader/program
- * handles/IDs exist in the hash table until the object is really
- * deleted (refcount==0). With texture objects, the handle/ID is
- * removed from the hash table in glDeleteTextures() while the tex
- * object itself might linger until its refcount goes to zero.
- */
- struct gl_shader_program *shProg;
-
- shProg = _mesa_lookup_shader_program_err(ctx, name, "glDeleteProgram");
- if (!shProg)
- return;
-
- shProg->DeletePending = GL_TRUE;
-
- /* effectively, decr shProg's refcount */
- _mesa_reference_shader_program(ctx, &shProg, NULL);
-}
-
-
-static void
-delete_shader(struct gl_context *ctx, GLuint shader)
-{
- struct gl_shader *sh;
-
- sh = _mesa_lookup_shader_err(ctx, shader, "glDeleteShader");
- if (!sh)
- return;
-
- sh->DeletePending = GL_TRUE;
-
- /* effectively, decr sh's refcount */
- _mesa_reference_shader(ctx, &sh, NULL);
-}
-
-
-static void
-detach_shader(struct gl_context *ctx, GLuint program, GLuint shader)
-{
- struct gl_shader_program *shProg;
- GLuint n;
- GLuint i, j;
-
- shProg = _mesa_lookup_shader_program_err(ctx, program, "glDetachShader");
- if (!shProg)
- return;
-
- n = shProg->NumShaders;
-
- for (i = 0; i < n; i++) {
- if (shProg->Shaders[i]->Name == shader) {
- /* found it */
- struct gl_shader **newList;
-
- /* release */
- _mesa_reference_shader(ctx, &shProg->Shaders[i], NULL);
-
- /* alloc new, smaller array */
- newList = (struct gl_shader **)
- malloc((n - 1) * sizeof(struct gl_shader *));
- if (!newList) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "glDetachShader");
- return;
- }
- for (j = 0; j < i; j++) {
- newList[j] = shProg->Shaders[j];
- }
- while (++i < n)
- newList[j++] = shProg->Shaders[i];
- free(shProg->Shaders);
-
- shProg->Shaders = newList;
- shProg->NumShaders = n - 1;
-
-#ifdef DEBUG
- /* sanity check */
- {
- for (j = 0; j < shProg->NumShaders; j++) {
- assert(shProg->Shaders[j]->Type == GL_VERTEX_SHADER ||
- shProg->Shaders[j]->Type == GL_FRAGMENT_SHADER);
- assert(shProg->Shaders[j]->RefCount > 0);
- }
- }
-#endif
-
- return;
- }
- }
-
- /* not found */
- {
- GLenum err;
- if (is_shader(ctx, shader))
- err = GL_INVALID_OPERATION;
- else if (is_program(ctx, shader))
- err = GL_INVALID_OPERATION;
- else
- err = GL_INVALID_VALUE;
- _mesa_error(ctx, err, "glDetachProgram(shader)");
- return;
- }
-}
-
-
-static void
-get_active_attrib(struct gl_context *ctx, GLuint program, GLuint index,
- GLsizei maxLength, GLsizei *length, GLint *size,
- GLenum *type, GLchar *nameOut)
-{
- const struct gl_program_parameter_list *attribs = NULL;
- struct gl_shader_program *shProg;
-
- shProg = _mesa_lookup_shader_program_err(ctx, program, "glGetActiveAttrib");
- if (!shProg)
- return;
-
- if (shProg->VertexProgram)
- attribs = shProg->VertexProgram->Base.Attributes;
-
- if (!attribs || index >= attribs->NumParameters) {
- _mesa_error(ctx, GL_INVALID_VALUE, "glGetActiveAttrib(index)");
- return;
- }
-
- _mesa_copy_string(nameOut, maxLength, length,
- attribs->Parameters[index].Name);
-
- if (size)
- *size = attribs->Parameters[index].Size
- / _mesa_sizeof_glsl_type(attribs->Parameters[index].DataType);
-
- if (type)
- *type = attribs->Parameters[index].DataType;
-}
-
-
-/**
- * Return list of shaders attached to shader program.
- */
-static void
-get_attached_shaders(struct gl_context *ctx, GLuint program, GLsizei maxCount,
- GLsizei *count, GLuint *obj)
-{
- struct gl_shader_program *shProg =
- _mesa_lookup_shader_program_err(ctx, program, "glGetAttachedShaders");
- if (shProg) {
- GLuint i;
- for (i = 0; i < (GLuint) maxCount && i < shProg->NumShaders; i++) {
- obj[i] = shProg->Shaders[i]->Name;
- }
- if (count)
- *count = i;
- }
-}
-
-
-static GLint
-get_frag_data_location(struct gl_context *ctx, GLuint program,
- const GLchar *name)
-{
- _mesa_problem(ctx, "get_frag_data_location() not implemented yet");
- return -1;
-}
-
-
-
-/**
- * glGetHandleARB() - return ID/name of currently bound shader program.
- */
-static GLuint
-get_handle(struct gl_context *ctx, GLenum pname)
-{
- if (pname == GL_PROGRAM_OBJECT_ARB) {
- if (ctx->Shader.ActiveProgram)
- return ctx->Shader.ActiveProgram->Name;
- else
- return 0;
- }
- else {
- _mesa_error(ctx, GL_INVALID_ENUM, "glGetHandleARB");
- return 0;
- }
-}
-
-
-/**
- * glGetProgramiv() - get shader program state.
- * Note that this is for GLSL shader programs, not ARB vertex/fragment
- * programs (see glGetProgramivARB).
- */
-static void
-get_programiv(struct gl_context *ctx, GLuint program, GLenum pname, GLint *params)
-{
- const struct gl_program_parameter_list *attribs;
- struct gl_shader_program *shProg
- = _mesa_lookup_shader_program(ctx, program);
-
- if (!shProg) {
- _mesa_error(ctx, GL_INVALID_VALUE, "glGetProgramiv(program)");
- return;
- }
-
- if (shProg->VertexProgram)
- attribs = shProg->VertexProgram->Base.Attributes;
- else
- attribs = NULL;
-
- switch (pname) {
- case GL_DELETE_STATUS:
- *params = shProg->DeletePending;
- break;
- case GL_LINK_STATUS:
- *params = shProg->LinkStatus;
- break;
- case GL_VALIDATE_STATUS:
- *params = shProg->Validated;
- break;
- case GL_INFO_LOG_LENGTH:
- *params = shProg->InfoLog ? strlen(shProg->InfoLog) + 1 : 0;
- break;
- case GL_ATTACHED_SHADERS:
- *params = shProg->NumShaders;
- break;
- case GL_ACTIVE_ATTRIBUTES:
- *params = attribs ? attribs->NumParameters : 0;
- break;
- case GL_ACTIVE_ATTRIBUTE_MAX_LENGTH:
- *params = _mesa_longest_parameter_name(attribs, PROGRAM_INPUT) + 1;
- break;
- case GL_ACTIVE_UNIFORMS:
- *params = shProg->Uniforms ? shProg->Uniforms->NumUniforms : 0;
- break;
- case GL_ACTIVE_UNIFORM_MAX_LENGTH:
- *params = _mesa_longest_uniform_name(shProg->Uniforms);
- if (*params > 0)
- (*params)++; /* add one for terminating zero */
- break;
- case GL_PROGRAM_BINARY_LENGTH_OES:
- *params = 0;
- break;
-#if FEATURE_EXT_transform_feedback
- case GL_TRANSFORM_FEEDBACK_VARYINGS:
- *params = shProg->TransformFeedback.NumVarying;
- break;
- case GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH:
- *params = longest_feedback_varying_name(shProg) + 1;
- break;
- case GL_TRANSFORM_FEEDBACK_BUFFER_MODE:
- *params = shProg->TransformFeedback.BufferMode;
- break;
-#endif
-#if FEATURE_ARB_geometry_shader4
- case GL_GEOMETRY_VERTICES_OUT_ARB:
- *params = shProg->Geom.VerticesOut;
- break;
- case GL_GEOMETRY_INPUT_TYPE_ARB:
- *params = shProg->Geom.InputType;
- break;
- case GL_GEOMETRY_OUTPUT_TYPE_ARB:
- *params = shProg->Geom.OutputType;
- break;
-#endif
- default:
- _mesa_error(ctx, GL_INVALID_ENUM, "glGetProgramiv(pname)");
- return;
- }
-}
-
-
-/**
- * glGetShaderiv() - get GLSL shader state
- */
-static void
-get_shaderiv(struct gl_context *ctx, GLuint name, GLenum pname, GLint *params)
-{
- struct gl_shader *shader =
- _mesa_lookup_shader_err(ctx, name, "glGetShaderiv");
-
- if (!shader) {
- return;
- }
-
- switch (pname) {
- case GL_SHADER_TYPE:
- *params = shader->Type;
- break;
- case GL_DELETE_STATUS:
- *params = shader->DeletePending;
- break;
- case GL_COMPILE_STATUS:
- *params = shader->CompileStatus;
- break;
- case GL_INFO_LOG_LENGTH:
- *params = shader->InfoLog ? strlen(shader->InfoLog) + 1 : 0;
- break;
- case GL_SHADER_SOURCE_LENGTH:
- *params = shader->Source ? strlen((char *) shader->Source) + 1 : 0;
- break;
- default:
- _mesa_error(ctx, GL_INVALID_ENUM, "glGetShaderiv(pname)");
- return;
- }
-}
-
-
-static void
-get_program_info_log(struct gl_context *ctx, GLuint program, GLsizei bufSize,
- GLsizei *length, GLchar *infoLog)
-{
- struct gl_shader_program *shProg
- = _mesa_lookup_shader_program(ctx, program);
- if (!shProg) {
- _mesa_error(ctx, GL_INVALID_VALUE, "glGetProgramInfoLog(program)");
- return;
- }
- _mesa_copy_string(infoLog, bufSize, length, shProg->InfoLog);
-}
-
-
-static void
-get_shader_info_log(struct gl_context *ctx, GLuint shader, GLsizei bufSize,
- GLsizei *length, GLchar *infoLog)
-{
- struct gl_shader *sh = _mesa_lookup_shader(ctx, shader);
- if (!sh) {
- _mesa_error(ctx, GL_INVALID_VALUE, "glGetShaderInfoLog(shader)");
- return;
- }
- _mesa_copy_string(infoLog, bufSize, length, sh->InfoLog);
-}
-
-
-/**
- * Return shader source code.
- */
-static void
-get_shader_source(struct gl_context *ctx, GLuint shader, GLsizei maxLength,
- GLsizei *length, GLchar *sourceOut)
-{
- struct gl_shader *sh;
- sh = _mesa_lookup_shader_err(ctx, shader, "glGetShaderSource");
- if (!sh) {
- return;
- }
- _mesa_copy_string(sourceOut, maxLength, length, sh->Source);
-}
-
-
-/**
- * Set/replace shader source code.
- */
-static void
-shader_source(struct gl_context *ctx, GLuint shader, const GLchar *source)
-{
- struct gl_shader *sh;
-
- sh = _mesa_lookup_shader_err(ctx, shader, "glShaderSource");
- if (!sh)
- return;
-
- /* free old shader source string and install new one */
- if (sh->Source) {
- free((void *) sh->Source);
- }
- sh->Source = source;
- sh->CompileStatus = GL_FALSE;
-#ifdef DEBUG
- sh->SourceChecksum = _mesa_str_checksum(sh->Source);
-#endif
-}
-
-
-/**
- * Compile a shader.
- */
-static void
-compile_shader(struct gl_context *ctx, GLuint shaderObj)
-{
- struct gl_shader *sh;
- struct gl_shader_compiler_options *options;
-
- sh = _mesa_lookup_shader_err(ctx, shaderObj, "glCompileShader");
- if (!sh)
- return;
-
- options = &ctx->ShaderCompilerOptions[_mesa_shader_type_to_index(sh->Type)];
-
- /* set default pragma state for shader */
- sh->Pragmas = options->DefaultPragmas;
-
- /* this call will set the sh->CompileStatus field to indicate if
- * compilation was successful.
- */
- _mesa_glsl_compile_shader(ctx, sh);
-}
-
-
-/**
- * Link a program's shaders.
- */
-static void
-link_program(struct gl_context *ctx, GLuint program)
-{
- struct gl_shader_program *shProg;
- struct gl_transform_feedback_object *obj =
- ctx->TransformFeedback.CurrentObject;
-
- shProg = _mesa_lookup_shader_program_err(ctx, program, "glLinkProgram");
- if (!shProg)
- return;
-
- if (obj->Active
- && (shProg == ctx->Shader.CurrentVertexProgram
- || shProg == ctx->Shader.CurrentGeometryProgram
- || shProg == ctx->Shader.CurrentFragmentProgram)) {
- _mesa_error(ctx, GL_INVALID_OPERATION,
- "glLinkProgram(transform feedback active");
- return;
- }
-
- FLUSH_VERTICES(ctx, _NEW_PROGRAM);
-
- _mesa_glsl_link_shader(ctx, shProg);
-
- /* debug code */
- if (0) {
- GLuint i;
-
- printf("Link %u shaders in program %u: %s\n",
- shProg->NumShaders, shProg->Name,
- shProg->LinkStatus ? "Success" : "Failed");
-
- for (i = 0; i < shProg->NumShaders; i++) {
- printf(" shader %u, type 0x%x\n",
- shProg->Shaders[i]->Name,
- shProg->Shaders[i]->Type);
- }
- }
-}
-
-
-/**
- * Print basic shader info (for debug).
- */
-static void
-print_shader_info(const struct gl_shader_program *shProg)
-{
- GLuint i;
-
- printf("Mesa: glUseProgram(%u)\n", shProg->Name);
- for (i = 0; i < shProg->NumShaders; i++) {
- const char *s;
- switch (shProg->Shaders[i]->Type) {
- case GL_VERTEX_SHADER:
- s = "vertex";
- break;
- case GL_FRAGMENT_SHADER:
- s = "fragment";
- break;
- case GL_GEOMETRY_SHADER:
- s = "geometry";
- break;
- default:
- s = "";
- }
- printf(" %s shader %u, checksum %u\n", s,
- shProg->Shaders[i]->Name,
- shProg->Shaders[i]->SourceChecksum);
- }
- if (shProg->VertexProgram)
- printf(" vert prog %u\n", shProg->VertexProgram->Base.Id);
- if (shProg->FragmentProgram)
- printf(" frag prog %u\n", shProg->FragmentProgram->Base.Id);
-}
-
-
-/**
- * Use the named shader program for subsequent glUniform calls
- */
-void
-_mesa_active_program(struct gl_context *ctx, struct gl_shader_program *shProg,
- const char *caller)
-{
- if ((shProg != NULL) && !shProg->LinkStatus) {
- _mesa_error(ctx, GL_INVALID_OPERATION,
- "%s(program %u not linked)", caller, shProg->Name);
- return;
- }
-
- if (ctx->Shader.ActiveProgram != shProg) {
- _mesa_reference_shader_program(ctx, &ctx->Shader.ActiveProgram, shProg);
- }
-}
-
-/**
- */
-static bool
-use_shader_program(struct gl_context *ctx, GLenum type,
- struct gl_shader_program *shProg)
-{
- struct gl_shader_program **target;
-
- switch (type) {
-#if FEATURE_ARB_vertex_shader
- case GL_VERTEX_SHADER:
- target = &ctx->Shader.CurrentVertexProgram;
- if ((shProg == NULL)
- || (shProg->_LinkedShaders[MESA_SHADER_VERTEX] == NULL)) {
- shProg = NULL;
- }
- break;
-#endif
-#if FEATURE_ARB_geometry_shader4
- case GL_GEOMETRY_SHADER_ARB:
- target = &ctx->Shader.CurrentGeometryProgram;
- if ((shProg == NULL)
- || (shProg->_LinkedShaders[MESA_SHADER_GEOMETRY] == NULL)) {
- shProg = NULL;
- }
- break;
-#endif
-#if FEATURE_ARB_fragment_shader
- case GL_FRAGMENT_SHADER:
- target = &ctx->Shader.CurrentFragmentProgram;
- if ((shProg == NULL)
- || (shProg->_LinkedShaders[MESA_SHADER_FRAGMENT] == NULL)) {
- shProg = NULL;
- }
- break;
-#endif
- default:
- return false;
- }
-
- if (*target != shProg) {
- FLUSH_VERTICES(ctx, _NEW_PROGRAM | _NEW_PROGRAM_CONSTANTS);
- _mesa_reference_shader_program(ctx, target, shProg);
- return true;
- }
-
- return false;
-}
-
-/**
- * Use the named shader program for subsequent rendering.
- */
-void
-_mesa_use_program(struct gl_context *ctx, struct gl_shader_program *shProg)
-{
- use_shader_program(ctx, GL_VERTEX_SHADER, shProg);
- use_shader_program(ctx, GL_GEOMETRY_SHADER_ARB, shProg);
- use_shader_program(ctx, GL_FRAGMENT_SHADER, shProg);
- _mesa_active_program(ctx, shProg, "glUseProgram");
-
- if (ctx->Driver.UseProgram)
- ctx->Driver.UseProgram(ctx, shProg);
-}
-
-
-/**
- * Validate a program's samplers.
- * Specifically, check that there aren't two samplers of different types
- * pointing to the same texture unit.
- * \return GL_TRUE if valid, GL_FALSE if invalid
- */
-static GLboolean
-validate_samplers(const struct gl_program *prog, char *errMsg)
-{
- static const char *targetName[] = {
- "TEXTURE_BUFFER",
- "TEXTURE_2D_ARRAY",
- "TEXTURE_1D_ARRAY",
- "TEXTURE_CUBE",
- "TEXTURE_3D",
- "TEXTURE_RECT",
- "TEXTURE_2D",
- "TEXTURE_1D",
- };
- GLint targetUsed[MAX_TEXTURE_IMAGE_UNITS];
- GLbitfield samplersUsed = prog->SamplersUsed;
- GLuint i;
-
- assert(Elements(targetName) == NUM_TEXTURE_TARGETS);
-
- if (samplersUsed == 0x0)
- return GL_TRUE;
-
- for (i = 0; i < Elements(targetUsed); i++)
- targetUsed[i] = -1;
-
- /* walk over bits which are set in 'samplers' */
- while (samplersUsed) {
- GLuint unit;
- gl_texture_index target;
- GLint sampler = _mesa_ffs(samplersUsed) - 1;
- assert(sampler >= 0);
- assert(sampler < MAX_TEXTURE_IMAGE_UNITS);
- unit = prog->SamplerUnits[sampler];
- target = prog->SamplerTargets[sampler];
- if (targetUsed[unit] != -1 && targetUsed[unit] != (int) target) {
- _mesa_snprintf(errMsg, 100,
- "Texture unit %d is accessed both as %s and %s",
- unit, targetName[targetUsed[unit]], targetName[target]);
- return GL_FALSE;
- }
- targetUsed[unit] = target;
- samplersUsed ^= (1 << sampler);
- }
-
- return GL_TRUE;
-}
-
-
-/**
- * Do validation of the given shader program.
- * \param errMsg returns error message if validation fails.
- * \return GL_TRUE if valid, GL_FALSE if invalid (and set errMsg)
- */
-static GLboolean
-validate_shader_program(const struct gl_shader_program *shProg,
- char *errMsg)
-{
- const struct gl_vertex_program *vp = shProg->VertexProgram;
- const struct gl_fragment_program *fp = shProg->FragmentProgram;
-
- if (!shProg->LinkStatus) {
- return GL_FALSE;
- }
-
- /* From the GL spec, a program is invalid if any of these are true:
-
- any two active samplers in the current program object are of
- different types, but refer to the same texture image unit,
-
- any active sampler in the current program object refers to a texture
- image unit where fixed-function fragment processing accesses a
- texture target that does not match the sampler type, or
-
- the sum of the number of active samplers in the program and the
- number of texture image units enabled for fixed-function fragment
- processing exceeds the combined limit on the total number of texture
- image units allowed.
- */
-
-
- /*
- * Check: any two active samplers in the current program object are of
- * different types, but refer to the same texture image unit,
- */
- if (vp && !validate_samplers(&vp->Base, errMsg)) {
- return GL_FALSE;
- }
- if (fp && !validate_samplers(&fp->Base, errMsg)) {
- return GL_FALSE;
- }
-
- return GL_TRUE;
-}
-
-
-/**
- * Called via glValidateProgram()
- */
-static void
-validate_program(struct gl_context *ctx, GLuint program)
-{
- struct gl_shader_program *shProg;
- char errMsg[100];
-
- shProg = _mesa_lookup_shader_program_err(ctx, program, "glValidateProgram");
- if (!shProg) {
- return;
- }
-
- shProg->Validated = validate_shader_program(shProg, errMsg);
- if (!shProg->Validated) {
- /* update info log */
- if (shProg->InfoLog) {
- ralloc_free(shProg->InfoLog);
- }
- shProg->InfoLog = ralloc_strdup(shProg, errMsg);
- }
-}
-
-
-
-void GLAPIENTRY
-_mesa_AttachObjectARB(GLhandleARB program, GLhandleARB shader)
-{
- GET_CURRENT_CONTEXT(ctx);
- attach_shader(ctx, program, shader);
-}
-
-
-void GLAPIENTRY
-_mesa_AttachShader(GLuint program, GLuint shader)
-{
- GET_CURRENT_CONTEXT(ctx);
- attach_shader(ctx, program, shader);
-}
-
-
-void GLAPIENTRY
-_mesa_BindAttribLocationARB(GLhandleARB program, GLuint index,
- const GLcharARB *name)
-{
- GET_CURRENT_CONTEXT(ctx);
- bind_attrib_location(ctx, program, index, name);
-}
-
-
-/* GL_EXT_gpu_shader4, GL3 */
-void GLAPIENTRY
-_mesa_BindFragDataLocation(GLuint program, GLuint colorNumber,
- const GLchar *name)
-{
- GET_CURRENT_CONTEXT(ctx);
- bind_frag_data_location(ctx, program, colorNumber, name);
-}
-
-
-void GLAPIENTRY
-_mesa_CompileShaderARB(GLhandleARB shaderObj)
-{
- GET_CURRENT_CONTEXT(ctx);
- if (MESA_VERBOSE & VERBOSE_API)
- _mesa_debug(ctx, "glCompileShader %u\n", shaderObj);
- compile_shader(ctx, shaderObj);
-}
-
-
-GLuint GLAPIENTRY
-_mesa_CreateShader(GLenum type)
-{
- GET_CURRENT_CONTEXT(ctx);
- if (MESA_VERBOSE & VERBOSE_API)
- _mesa_debug(ctx, "glCreateShader %s\n", _mesa_lookup_enum_by_nr(type));
- return create_shader(ctx, type);
-}
-
-
-GLhandleARB GLAPIENTRY
-_mesa_CreateShaderObjectARB(GLenum type)
-{
- GET_CURRENT_CONTEXT(ctx);
- return create_shader(ctx, type);
-}
-
-
-GLuint GLAPIENTRY
-_mesa_CreateProgram(void)
-{
- GET_CURRENT_CONTEXT(ctx);
- if (MESA_VERBOSE & VERBOSE_API)
- _mesa_debug(ctx, "glCreateProgram\n");
- return create_shader_program(ctx);
-}
-
-
-GLhandleARB GLAPIENTRY
-_mesa_CreateProgramObjectARB(void)
-{
- GET_CURRENT_CONTEXT(ctx);
- return create_shader_program(ctx);
-}
-
-
-void GLAPIENTRY
-_mesa_DeleteObjectARB(GLhandleARB obj)
-{
- if (MESA_VERBOSE & VERBOSE_API) {
- GET_CURRENT_CONTEXT(ctx);
- _mesa_debug(ctx, "glDeleteObjectARB(%u)\n", obj);
- }
-
- if (obj) {
- GET_CURRENT_CONTEXT(ctx);
- FLUSH_VERTICES(ctx, 0);
- if (is_program(ctx, obj)) {
- delete_shader_program(ctx, obj);
- }
- else if (is_shader(ctx, obj)) {
- delete_shader(ctx, obj);
- }
- else {
- /* error? */
- }
- }
-}
-
-
-void GLAPIENTRY
-_mesa_DeleteProgram(GLuint name)
-{
- if (name) {
- GET_CURRENT_CONTEXT(ctx);
- FLUSH_VERTICES(ctx, 0);
- delete_shader_program(ctx, name);
- }
-}
-
-
-void GLAPIENTRY
-_mesa_DeleteShader(GLuint name)
-{
- if (name) {
- GET_CURRENT_CONTEXT(ctx);
- FLUSH_VERTICES(ctx, 0);
- delete_shader(ctx, name);
- }
-}
-
-
-void GLAPIENTRY
-_mesa_DetachObjectARB(GLhandleARB program, GLhandleARB shader)
-{
- GET_CURRENT_CONTEXT(ctx);
- detach_shader(ctx, program, shader);
-}
-
-
-void GLAPIENTRY
-_mesa_DetachShader(GLuint program, GLuint shader)
-{
- GET_CURRENT_CONTEXT(ctx);
- detach_shader(ctx, program, shader);
-}
-
-
-void GLAPIENTRY
-_mesa_GetActiveAttribARB(GLhandleARB program, GLuint index,
- GLsizei maxLength, GLsizei * length, GLint * size,
- GLenum * type, GLcharARB * name)
-{
- GET_CURRENT_CONTEXT(ctx);
- get_active_attrib(ctx, program, index, maxLength, length, size, type, name);
-}
-
-
-void GLAPIENTRY
-_mesa_GetAttachedObjectsARB(GLhandleARB container, GLsizei maxCount,
- GLsizei * count, GLhandleARB * obj)
-{
- GET_CURRENT_CONTEXT(ctx);
- get_attached_shaders(ctx, container, maxCount, count, obj);
-}
-
-
-void GLAPIENTRY
-_mesa_GetAttachedShaders(GLuint program, GLsizei maxCount,
- GLsizei *count, GLuint *obj)
-{
- GET_CURRENT_CONTEXT(ctx);
- get_attached_shaders(ctx, program, maxCount, count, obj);
-}
-
-
-GLint GLAPIENTRY
-_mesa_GetAttribLocationARB(GLhandleARB program, const GLcharARB * name)
-{
- GET_CURRENT_CONTEXT(ctx);
- return get_attrib_location(ctx, program, name);
-}
-
-
-/* GL_EXT_gpu_shader4, GL3 */
-GLint GLAPIENTRY
-_mesa_GetFragDataLocation(GLuint program, const GLchar *name)
-{
- GET_CURRENT_CONTEXT(ctx);
- return get_frag_data_location(ctx, program, name);
-}
-
-
-
-void GLAPIENTRY
-_mesa_GetInfoLogARB(GLhandleARB object, GLsizei maxLength, GLsizei * length,
- GLcharARB * infoLog)
-{
- GET_CURRENT_CONTEXT(ctx);
- if (is_program(ctx, object)) {
- get_program_info_log(ctx, object, maxLength, length, infoLog);
- }
- else if (is_shader(ctx, object)) {
- get_shader_info_log(ctx, object, maxLength, length, infoLog);
- }
- else {
- _mesa_error(ctx, GL_INVALID_OPERATION, "glGetInfoLogARB");
- }
-}
-
-
-void GLAPIENTRY
-_mesa_GetObjectParameterivARB(GLhandleARB object, GLenum pname, GLint *params)
-{
- GET_CURRENT_CONTEXT(ctx);
- /* Implement in terms of GetProgramiv, GetShaderiv */
- if (is_program(ctx, object)) {
- if (pname == GL_OBJECT_TYPE_ARB) {
- *params = GL_PROGRAM_OBJECT_ARB;
- }
- else {
- get_programiv(ctx, object, pname, params);
- }
- }
- else if (is_shader(ctx, object)) {
- if (pname == GL_OBJECT_TYPE_ARB) {
- *params = GL_SHADER_OBJECT_ARB;
- }
- else {
- get_shaderiv(ctx, object, pname, params);
- }
- }
- else {
- _mesa_error(ctx, GL_INVALID_VALUE, "glGetObjectParameterivARB");
- }
-}
-
-
-void GLAPIENTRY
-_mesa_GetObjectParameterfvARB(GLhandleARB object, GLenum pname,
- GLfloat *params)
-{
- GLint iparams[1]; /* XXX is one element enough? */
- _mesa_GetObjectParameterivARB(object, pname, iparams);
- params[0] = (GLfloat) iparams[0];
-}
-
-
-void GLAPIENTRY
-_mesa_GetProgramiv(GLuint program, GLenum pname, GLint *params)
-{
- GET_CURRENT_CONTEXT(ctx);
- get_programiv(ctx, program, pname, params);
-}
-
-
-void GLAPIENTRY
-_mesa_GetShaderiv(GLuint shader, GLenum pname, GLint *params)
-{
- GET_CURRENT_CONTEXT(ctx);
- get_shaderiv(ctx, shader, pname, params);
-}
-
-
-void GLAPIENTRY
-_mesa_GetProgramInfoLog(GLuint program, GLsizei bufSize,
- GLsizei *length, GLchar *infoLog)
-{
- GET_CURRENT_CONTEXT(ctx);
- get_program_info_log(ctx, program, bufSize, length, infoLog);
-}
-
-
-void GLAPIENTRY
-_mesa_GetShaderInfoLog(GLuint shader, GLsizei bufSize,
- GLsizei *length, GLchar *infoLog)
-{
- GET_CURRENT_CONTEXT(ctx);
- get_shader_info_log(ctx, shader, bufSize, length, infoLog);
-}
-
-
-void GLAPIENTRY
-_mesa_GetShaderSourceARB(GLhandleARB shader, GLsizei maxLength,
- GLsizei *length, GLcharARB *sourceOut)
-{
- GET_CURRENT_CONTEXT(ctx);
- get_shader_source(ctx, shader, maxLength, length, sourceOut);
-}
-
-
-GLhandleARB GLAPIENTRY
-_mesa_GetHandleARB(GLenum pname)
-{
- GET_CURRENT_CONTEXT(ctx);
- return get_handle(ctx, pname);
-}
-
-
-GLboolean GLAPIENTRY
-_mesa_IsProgram(GLuint name)
-{
- GET_CURRENT_CONTEXT(ctx);
- return is_program(ctx, name);
-}
-
-
-GLboolean GLAPIENTRY
-_mesa_IsShader(GLuint name)
-{
- GET_CURRENT_CONTEXT(ctx);
- return is_shader(ctx, name);
-}
-
-
-void GLAPIENTRY
-_mesa_LinkProgramARB(GLhandleARB programObj)
-{
- GET_CURRENT_CONTEXT(ctx);
- link_program(ctx, programObj);
-}
-
-
-
-/**
- * Read shader source code from a file.
- * Useful for debugging to override an app's shader.
- */
-static GLcharARB *
-read_shader(const char *fname)
-{
- const int max = 50*1000;
- FILE *f = fopen(fname, "r");
- GLcharARB *buffer, *shader;
- int len;
-
- if (!f) {
- return NULL;
- }
-
- buffer = (char *) malloc(max);
- len = fread(buffer, 1, max, f);
- buffer[len] = 0;
-
- fclose(f);
-
- shader = _mesa_strdup(buffer);
- free(buffer);
-
- return shader;
-}
-
-
-/**
- * Called via glShaderSource() and glShaderSourceARB() API functions.
- * Basically, concatenate the source code strings into one long string
- * and pass it to _mesa_shader_source().
- */
-void GLAPIENTRY
-_mesa_ShaderSourceARB(GLhandleARB shaderObj, GLsizei count,
- const GLcharARB ** string, const GLint * length)
-{
- GET_CURRENT_CONTEXT(ctx);
- GLint *offsets;
- GLsizei i, totalLength;
- GLcharARB *source;
- GLuint checksum;
-
- if (!shaderObj || string == NULL) {
- _mesa_error(ctx, GL_INVALID_VALUE, "glShaderSourceARB");
- return;
- }
-
- /*
- * This array holds offsets of where the appropriate string ends, thus the
- * last element will be set to the total length of the source code.
- */
- offsets = (GLint *) malloc(count * sizeof(GLint));
- if (offsets == NULL) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "glShaderSourceARB");
- return;
- }
-
- for (i = 0; i < count; i++) {
- if (string[i] == NULL) {
- free((GLvoid *) offsets);
- _mesa_error(ctx, GL_INVALID_OPERATION, "glShaderSourceARB(null string)");
- return;
- }
- if (length == NULL || length[i] < 0)
- offsets[i] = strlen(string[i]);
- else
- offsets[i] = length[i];
- /* accumulate string lengths */
- if (i > 0)
- offsets[i] += offsets[i - 1];
- }
-
- /* Total length of source string is sum off all strings plus two.
- * One extra byte for terminating zero, another extra byte to silence
- * valgrind warnings in the parser/grammer code.
- */
- totalLength = offsets[count - 1] + 2;
- source = (GLcharARB *) malloc(totalLength * sizeof(GLcharARB));
- if (source == NULL) {
- free((GLvoid *) offsets);
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "glShaderSourceARB");
- return;
- }
-
- for (i = 0; i < count; i++) {
- GLint start = (i > 0) ? offsets[i - 1] : 0;
- memcpy(source + start, string[i],
- (offsets[i] - start) * sizeof(GLcharARB));
- }
- source[totalLength - 1] = '\0';
- source[totalLength - 2] = '\0';
-
- if (SHADER_SUBST) {
- /* Compute the shader's source code checksum then try to open a file
- * named newshader_<CHECKSUM>. If it exists, use it in place of the
- * original shader source code. For debugging.
- */
- char filename[100];
- GLcharARB *newSource;
-
- checksum = _mesa_str_checksum(source);
-
- _mesa_snprintf(filename, sizeof(filename), "newshader_%d", checksum);
-
- newSource = read_shader(filename);
- if (newSource) {
- fprintf(stderr, "Mesa: Replacing shader %u chksum=%d with %s\n",
- shaderObj, checksum, filename);
- free(source);
- source = newSource;
- }
- }
-
- shader_source(ctx, shaderObj, source);
-
- if (SHADER_SUBST) {
- struct gl_shader *sh = _mesa_lookup_shader(ctx, shaderObj);
- if (sh)
- sh->SourceChecksum = checksum; /* save original checksum */
- }
-
- free(offsets);
-}
-
-
-void GLAPIENTRY
-_mesa_UseProgramObjectARB(GLhandleARB program)
-{
- GET_CURRENT_CONTEXT(ctx);
- struct gl_shader_program *shProg;
- struct gl_transform_feedback_object *obj =
- ctx->TransformFeedback.CurrentObject;
-
- if (obj->Active) {
- _mesa_error(ctx, GL_INVALID_OPERATION,
- "glUseProgram(transform feedback active)");
- return;
- }
-
- if (program) {
- shProg = _mesa_lookup_shader_program_err(ctx, program, "glUseProgram");
- if (!shProg) {
- return;
- }
- if (!shProg->LinkStatus) {
- _mesa_error(ctx, GL_INVALID_OPERATION,
- "glUseProgram(program %u not linked)", program);
- return;
- }
-
- /* debug code */
- if (ctx->Shader.Flags & GLSL_USE_PROG) {
- print_shader_info(shProg);
- }
- }
- else {
- shProg = NULL;
- }
-
- _mesa_use_program(ctx, shProg);
-}
-
-
-void GLAPIENTRY
-_mesa_ValidateProgramARB(GLhandleARB program)
-{
- GET_CURRENT_CONTEXT(ctx);
- validate_program(ctx, program);
-}
-
-#ifdef FEATURE_ES2
-
-void GLAPIENTRY
-_mesa_GetShaderPrecisionFormat(GLenum shadertype, GLenum precisiontype,
- GLint* range, GLint* precision)
-{
- const struct gl_program_constants *limits;
- const struct gl_precision *p;
- GET_CURRENT_CONTEXT(ctx);
-
- switch (shadertype) {
- case GL_VERTEX_SHADER:
- limits = &ctx->Const.VertexProgram;
- break;
- case GL_FRAGMENT_SHADER:
- limits = &ctx->Const.FragmentProgram;
- break;
- default:
- _mesa_error(ctx, GL_INVALID_ENUM,
- "glGetShaderPrecisionFormat(shadertype)");
- return;
- }
-
- switch (precisiontype) {
- case GL_LOW_FLOAT:
- p = &limits->LowFloat;
- break;
- case GL_MEDIUM_FLOAT:
- p = &limits->MediumFloat;
- break;
- case GL_HIGH_FLOAT:
- p = &limits->HighFloat;
- break;
- case GL_LOW_INT:
- p = &limits->LowInt;
- break;
- case GL_MEDIUM_INT:
- p = &limits->MediumInt;
- break;
- case GL_HIGH_INT:
- p = &limits->HighInt;
- break;
- default:
- _mesa_error(ctx, GL_INVALID_ENUM,
- "glGetShaderPrecisionFormat(precisiontype)");
- return;
- }
-
- range[0] = p->RangeMin;
- range[1] = p->RangeMax;
- precision[0] = p->Precision;
-}
-
-
-void GLAPIENTRY
-_mesa_ReleaseShaderCompiler(void)
-{
- _mesa_destroy_shader_compiler_caches();
-}
-
-
-void GLAPIENTRY
-_mesa_ShaderBinary(GLint n, const GLuint* shaders, GLenum binaryformat,
- const void* binary, GLint length)
-{
- GET_CURRENT_CONTEXT(ctx);
- (void) n;
- (void) shaders;
- (void) binaryformat;
- (void) binary;
- (void) length;
- _mesa_error(ctx, GL_INVALID_OPERATION, __FUNCTION__);
-}
-
-#endif /* FEATURE_ES2 */
-
-
-#if FEATURE_ARB_geometry_shader4
-
-void GLAPIENTRY
-_mesa_ProgramParameteriARB(GLuint program, GLenum pname,
- GLint value)
-{
- struct gl_shader_program *shProg;
- GET_CURRENT_CONTEXT(ctx);
-
- ASSERT_OUTSIDE_BEGIN_END(ctx);
-
- shProg = _mesa_lookup_shader_program_err(ctx, program,
- "glProgramParameteri");
- if (!shProg)
- return;
-
- switch (pname) {
- case GL_GEOMETRY_VERTICES_OUT_ARB:
- if (value < 1 ||
- (unsigned) value > ctx->Const.MaxGeometryOutputVertices) {
- _mesa_error(ctx, GL_INVALID_VALUE,
- "glProgramParameteri(GL_GEOMETRY_VERTICES_OUT_ARB=%d",
- value);
- return;
- }
- shProg->Geom.VerticesOut = value;
- break;
- case GL_GEOMETRY_INPUT_TYPE_ARB:
- switch (value) {
- case GL_POINTS:
- case GL_LINES:
- case GL_LINES_ADJACENCY_ARB:
- case GL_TRIANGLES:
- case GL_TRIANGLES_ADJACENCY_ARB:
- shProg->Geom.InputType = value;
- break;
- default:
- _mesa_error(ctx, GL_INVALID_VALUE,
- "glProgramParameteri(geometry input type = %s",
- _mesa_lookup_enum_by_nr(value));
- return;
- }
- break;
- case GL_GEOMETRY_OUTPUT_TYPE_ARB:
- switch (value) {
- case GL_POINTS:
- case GL_LINE_STRIP:
- case GL_TRIANGLE_STRIP:
- shProg->Geom.OutputType = value;
- break;
- default:
- _mesa_error(ctx, GL_INVALID_VALUE,
- "glProgramParameteri(geometry output type = %s",
- _mesa_lookup_enum_by_nr(value));
- return;
- }
- break;
- default:
- _mesa_error(ctx, GL_INVALID_ENUM, "glProgramParameteriARB(pname=%s)",
- _mesa_lookup_enum_by_nr(pname));
- break;
- }
-}
-
-#endif
-
-void
-_mesa_use_shader_program(struct gl_context *ctx, GLenum type,
- struct gl_shader_program *shProg)
-{
- use_shader_program(ctx, type, shProg);
-
- if (ctx->Driver.UseProgram)
- ctx->Driver.UseProgram(ctx, shProg);
-}
-
-void GLAPIENTRY
-_mesa_UseShaderProgramEXT(GLenum type, GLuint program)
-{
- GET_CURRENT_CONTEXT(ctx);
- struct gl_shader_program *shProg = NULL;
-
- if (!validate_shader_target(ctx, type)) {
- _mesa_error(ctx, GL_INVALID_ENUM, "glUseShaderProgramEXT(type)");
- return;
- }
-
- if (ctx->TransformFeedback.CurrentObject->Active) {
- _mesa_error(ctx, GL_INVALID_OPERATION,
- "glUseShaderProgramEXT(transform feedback is active)");
- return;
- }
-
- if (program) {
- shProg = _mesa_lookup_shader_program_err(ctx, program,
- "glUseShaderProgramEXT");
- if (shProg == NULL)
- return;
-
- if (!shProg->LinkStatus) {
- _mesa_error(ctx, GL_INVALID_OPERATION,
- "glUseShaderProgramEXT(program not linked)");
- return;
- }
- }
-
- _mesa_use_shader_program(ctx, type, shProg);
-}
-
-void GLAPIENTRY
-_mesa_ActiveProgramEXT(GLuint program)
-{
- GET_CURRENT_CONTEXT(ctx);
- struct gl_shader_program *shProg = (program != 0)
- ? _mesa_lookup_shader_program_err(ctx, program, "glActiveProgramEXT")
- : NULL;
-
- _mesa_active_program(ctx, shProg, "glActiveProgramEXT");
- return;
-}
-
-GLuint GLAPIENTRY
-_mesa_CreateShaderProgramEXT(GLenum type, const GLchar *string)
-{
- GET_CURRENT_CONTEXT(ctx);
- const GLuint shader = create_shader(ctx, type);
- GLuint program = 0;
-
- if (shader) {
- shader_source(ctx, shader, _mesa_strdup(string));
- compile_shader(ctx, shader);
-
- program = create_shader_program(ctx);
- if (program) {
- struct gl_shader_program *shProg;
- struct gl_shader *sh;
- GLint compiled = GL_FALSE;
-
- shProg = _mesa_lookup_shader_program(ctx, program);
- sh = _mesa_lookup_shader(ctx, shader);
-
- get_shaderiv(ctx, shader, GL_COMPILE_STATUS, &compiled);
- if (compiled) {
- attach_shader(ctx, program, shader);
- link_program(ctx, program);
- detach_shader(ctx, program, shader);
-
-#if 0
- /* Possibly... */
- if (active-user-defined-varyings-in-linked-program) {
- append-error-to-info-log;
- shProg->LinkStatus = GL_FALSE;
- }
-#endif
- }
-
- ralloc_strcat(&shProg->InfoLog, sh->InfoLog);
- }
-
- delete_shader(ctx, shader);
- }
-
- return program;
-}
-
-/**
- * Plug in shader-related functions into API dispatch table.
- */
-void
-_mesa_init_shader_dispatch(struct _glapi_table *exec)
-{
-#if FEATURE_GL
- /* GL_ARB_vertex/fragment_shader */
- SET_DeleteObjectARB(exec, _mesa_DeleteObjectARB);
- SET_GetHandleARB(exec, _mesa_GetHandleARB);
- SET_DetachObjectARB(exec, _mesa_DetachObjectARB);
- SET_CreateShaderObjectARB(exec, _mesa_CreateShaderObjectARB);
- SET_ShaderSourceARB(exec, _mesa_ShaderSourceARB);
- SET_CompileShaderARB(exec, _mesa_CompileShaderARB);
- SET_CreateProgramObjectARB(exec, _mesa_CreateProgramObjectARB);
- SET_AttachObjectARB(exec, _mesa_AttachObjectARB);
- SET_LinkProgramARB(exec, _mesa_LinkProgramARB);
- SET_UseProgramObjectARB(exec, _mesa_UseProgramObjectARB);
- SET_ValidateProgramARB(exec, _mesa_ValidateProgramARB);
- SET_GetObjectParameterfvARB(exec, _mesa_GetObjectParameterfvARB);
- SET_GetObjectParameterivARB(exec, _mesa_GetObjectParameterivARB);
- SET_GetInfoLogARB(exec, _mesa_GetInfoLogARB);
- SET_GetAttachedObjectsARB(exec, _mesa_GetAttachedObjectsARB);
- SET_GetShaderSourceARB(exec, _mesa_GetShaderSourceARB);
-
- /* OpenGL 2.0 */
- SET_AttachShader(exec, _mesa_AttachShader);
- SET_CreateProgram(exec, _mesa_CreateProgram);
- SET_CreateShader(exec, _mesa_CreateShader);
- SET_DeleteProgram(exec, _mesa_DeleteProgram);
- SET_DeleteShader(exec, _mesa_DeleteShader);
- SET_DetachShader(exec, _mesa_DetachShader);
- SET_GetAttachedShaders(exec, _mesa_GetAttachedShaders);
- SET_GetProgramiv(exec, _mesa_GetProgramiv);
- SET_GetProgramInfoLog(exec, _mesa_GetProgramInfoLog);
- SET_GetShaderiv(exec, _mesa_GetShaderiv);
- SET_GetShaderInfoLog(exec, _mesa_GetShaderInfoLog);
- SET_IsProgram(exec, _mesa_IsProgram);
- SET_IsShader(exec, _mesa_IsShader);
-
-#if FEATURE_ARB_vertex_shader
- SET_BindAttribLocationARB(exec, _mesa_BindAttribLocationARB);
- SET_GetActiveAttribARB(exec, _mesa_GetActiveAttribARB);
- SET_GetAttribLocationARB(exec, _mesa_GetAttribLocationARB);
-#endif
-
-#if FEATURE_ARB_geometry_shader4
- SET_ProgramParameteriARB(exec, _mesa_ProgramParameteriARB);
-#endif
-
- SET_UseShaderProgramEXT(exec, _mesa_UseShaderProgramEXT);
- SET_ActiveProgramEXT(exec, _mesa_ActiveProgramEXT);
- SET_CreateShaderProgramEXT(exec, _mesa_CreateShaderProgramEXT);
-
- /* GL_EXT_gpu_shader4 / GL 3.0 */
- SET_BindFragDataLocationEXT(exec, _mesa_BindFragDataLocation);
- SET_GetFragDataLocationEXT(exec, _mesa_GetFragDataLocation);
-
- /* GL_ARB_ES2_compatibility */
- SET_ReleaseShaderCompiler(exec, _mesa_ReleaseShaderCompiler);
- SET_GetShaderPrecisionFormat(exec, _mesa_GetShaderPrecisionFormat);
-
-#endif /* FEATURE_GL */
-}
-
+/*
+ * Mesa 3-D graphics library
+ *
+ * Copyright (C) 2004-2008 Brian Paul All Rights Reserved.
+ * Copyright (C) 2009-2010 VMware, Inc. All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+/**
+ * \file shaderapi.c
+ * \author Brian Paul
+ *
+ * Implementation of GLSL-related API functions.
+ * The glUniform* functions are in uniforms.c
+ *
+ *
+ * XXX things to do:
+ * 1. Check that the right error code is generated for all _mesa_error() calls.
+ * 2. Insert FLUSH_VERTICES calls in various places
+ */
+
+
+#include "main/glheader.h"
+#include "main/context.h"
+#include "main/dispatch.h"
+#include "main/enums.h"
+#include "main/hash.h"
+#include "main/mfeatures.h"
+#include "main/mtypes.h"
+#include "main/shaderapi.h"
+#include "main/shaderobj.h"
+#include "program/program.h"
+#include "program/prog_parameter.h"
+#include "program/prog_uniform.h"
+#include "ralloc.h"
+#include <stdbool.h>
+#include "../glsl/glsl_parser_extras.h"
+
+/** Define this to enable shader substitution (see below) */
+#define SHADER_SUBST 0
+
+
+/**
+ * Return mask of GLSL_x flags by examining the MESA_GLSL env var.
+ */
+static GLbitfield
+get_shader_flags(void)
+{
+ GLbitfield flags = 0x0;
+ const char *env = _mesa_getenv("MESA_GLSL");
+
+ if (env) {
+ if (strstr(env, "dump"))
+ flags |= GLSL_DUMP;
+ if (strstr(env, "log"))
+ flags |= GLSL_LOG;
+ if (strstr(env, "nopvert"))
+ flags |= GLSL_NOP_VERT;
+ if (strstr(env, "nopfrag"))
+ flags |= GLSL_NOP_FRAG;
+ if (strstr(env, "nopt"))
+ flags |= GLSL_NO_OPT;
+ else if (strstr(env, "opt"))
+ flags |= GLSL_OPT;
+ if (strstr(env, "uniform"))
+ flags |= GLSL_UNIFORMS;
+ if (strstr(env, "useprog"))
+ flags |= GLSL_USE_PROG;
+ }
+
+ return flags;
+}
+
+
+/**
+ * Initialize context's shader state.
+ */
+void
+_mesa_init_shader_state(struct gl_context *ctx)
+{
+ /* Device drivers may override these to control what kind of instructions
+ * are generated by the GLSL compiler.
+ */
+ struct gl_shader_compiler_options options;
+ gl_shader_type sh;
+
+ memset(&options, 0, sizeof(options));
+ options.MaxUnrollIterations = 32;
+
+ /* Default pragma settings */
+ options.DefaultPragmas.Optimize = GL_TRUE;
+
+ for (sh = 0; sh < MESA_SHADER_TYPES; ++sh)
+ memcpy(&ctx->ShaderCompilerOptions[sh], &options, sizeof(options));
+
+ ctx->Shader.Flags = get_shader_flags();
+}
+
+
+/**
+ * Free the per-context shader-related state.
+ */
+void
+_mesa_free_shader_state(struct gl_context *ctx)
+{
+ _mesa_reference_shader_program(ctx, &ctx->Shader.CurrentVertexProgram, NULL);
+ _mesa_reference_shader_program(ctx, &ctx->Shader.CurrentGeometryProgram,
+ NULL);
+ _mesa_reference_shader_program(ctx, &ctx->Shader.CurrentFragmentProgram,
+ NULL);
+ _mesa_reference_shader_program(ctx, &ctx->Shader.ActiveProgram, NULL);
+}
+
+
+/**
+ * Return the size of the given GLSL datatype, in floats (components).
+ */
+GLint
+_mesa_sizeof_glsl_type(GLenum type)
+{
+ switch (type) {
+ case GL_FLOAT:
+ case GL_INT:
+ case GL_BOOL:
+ case GL_SAMPLER_1D:
+ case GL_SAMPLER_2D:
+ case GL_SAMPLER_3D:
+ case GL_SAMPLER_CUBE:
+ case GL_SAMPLER_1D_SHADOW:
+ case GL_SAMPLER_2D_SHADOW:
+ case GL_SAMPLER_2D_RECT_ARB:
+ case GL_SAMPLER_2D_RECT_SHADOW_ARB:
+ case GL_SAMPLER_1D_ARRAY_EXT:
+ case GL_SAMPLER_2D_ARRAY_EXT:
+ case GL_SAMPLER_1D_ARRAY_SHADOW_EXT:
+ case GL_SAMPLER_2D_ARRAY_SHADOW_EXT:
+ case GL_SAMPLER_CUBE_SHADOW_EXT:
+ return 1;
+ case GL_FLOAT_VEC2:
+ case GL_INT_VEC2:
+ case GL_UNSIGNED_INT_VEC2:
+ case GL_BOOL_VEC2:
+ return 2;
+ case GL_FLOAT_VEC3:
+ case GL_INT_VEC3:
+ case GL_UNSIGNED_INT_VEC3:
+ case GL_BOOL_VEC3:
+ return 3;
+ case GL_FLOAT_VEC4:
+ case GL_INT_VEC4:
+ case GL_UNSIGNED_INT_VEC4:
+ case GL_BOOL_VEC4:
+ return 4;
+ case GL_FLOAT_MAT2:
+ case GL_FLOAT_MAT2x3:
+ case GL_FLOAT_MAT2x4:
+ return 8; /* two float[4] vectors */
+ case GL_FLOAT_MAT3:
+ case GL_FLOAT_MAT3x2:
+ case GL_FLOAT_MAT3x4:
+ return 12; /* three float[4] vectors */
+ case GL_FLOAT_MAT4:
+ case GL_FLOAT_MAT4x2:
+ case GL_FLOAT_MAT4x3:
+ return 16; /* four float[4] vectors */
+ default:
+ _mesa_problem(NULL, "Invalid type in _mesa_sizeof_glsl_type()");
+ return 1;
+ }
+}
+
+
+/**
+ * Copy string from <src> to <dst>, up to maxLength characters, returning
+ * length of <dst> in <length>.
+ * \param src the strings source
+ * \param maxLength max chars to copy
+ * \param length returns number of chars copied
+ * \param dst the string destination
+ */
+void
+_mesa_copy_string(GLchar *dst, GLsizei maxLength,
+ GLsizei *length, const GLchar *src)
+{
+ GLsizei len;
+ for (len = 0; len < maxLength - 1 && src && src[len]; len++)
+ dst[len] = src[len];
+ if (maxLength > 0)
+ dst[len] = 0;
+ if (length)
+ *length = len;
+}
+
+
+
+/**
+ * Confirm that the a shader type is valid and supported by the implementation
+ *
+ * \param ctx Current GL context
+ * \param type Shader target
+ *
+ */
+static bool
+validate_shader_target(const struct gl_context *ctx, GLenum type)
+{
+ switch (type) {
+#if FEATURE_ARB_fragment_shader
+ case GL_FRAGMENT_SHADER:
+ return ctx->Extensions.ARB_fragment_shader;
+#endif
+#if FEATURE_ARB_vertex_shader
+ case GL_VERTEX_SHADER:
+ return ctx->Extensions.ARB_vertex_shader;
+#endif
+#if FEATURE_ARB_geometry_shader4
+ case GL_GEOMETRY_SHADER_ARB:
+ return ctx->Extensions.ARB_geometry_shader4;
+#endif
+ default:
+ return false;
+ }
+}
+
+
+/**
+ * Find the length of the longest transform feedback varying name
+ * which was specified with glTransformFeedbackVaryings().
+ */
+static GLint
+longest_feedback_varying_name(const struct gl_shader_program *shProg)
+{
+ GLuint i;
+ GLint max = 0;
+ for (i = 0; i < shProg->TransformFeedback.NumVarying; i++) {
+ GLint len = strlen(shProg->TransformFeedback.VaryingNames[i]);
+ if (len > max)
+ max = len;
+ }
+ return max;
+}
+
+
+
+static GLboolean
+is_program(struct gl_context *ctx, GLuint name)
+{
+ struct gl_shader_program *shProg = _mesa_lookup_shader_program(ctx, name);
+ return shProg ? GL_TRUE : GL_FALSE;
+}
+
+
+static GLboolean
+is_shader(struct gl_context *ctx, GLuint name)
+{
+ struct gl_shader *shader = _mesa_lookup_shader(ctx, name);
+ return shader ? GL_TRUE : GL_FALSE;
+}
+
+
+/**
+ * Attach shader to a shader program.
+ */
+static void
+attach_shader(struct gl_context *ctx, GLuint program, GLuint shader)
+{
+ struct gl_shader_program *shProg;
+ struct gl_shader *sh;
+ GLuint i, n;
+
+ shProg = _mesa_lookup_shader_program_err(ctx, program, "glAttachShader");
+ if (!shProg)
+ return;
+
+ sh = _mesa_lookup_shader_err(ctx, shader, "glAttachShader");
+ if (!sh) {
+ return;
+ }
+
+ n = shProg->NumShaders;
+ for (i = 0; i < n; i++) {
+ if (shProg->Shaders[i] == sh) {
+ /* The shader is already attched to this program. The
+ * GL_ARB_shader_objects spec says:
+ *
+ * "The error INVALID_OPERATION is generated by AttachObjectARB
+ * if <obj> is already attached to <containerObj>."
+ */
+ _mesa_error(ctx, GL_INVALID_OPERATION, "glAttachShader");
+ return;
+ }
+ }
+
+ /* grow list */
+ shProg->Shaders = (struct gl_shader **)
+ _mesa_realloc(shProg->Shaders,
+ n * sizeof(struct gl_shader *),
+ (n + 1) * sizeof(struct gl_shader *));
+ if (!shProg->Shaders) {
+ _mesa_error(ctx, GL_OUT_OF_MEMORY, "glAttachShader");
+ return;
+ }
+
+ /* append */
+ shProg->Shaders[n] = NULL; /* since realloc() didn't zero the new space */
+ _mesa_reference_shader(ctx, &shProg->Shaders[n], sh);
+ shProg->NumShaders++;
+}
+
+
+static GLint
+get_attrib_location(struct gl_context *ctx, GLuint program, const GLchar *name)
+{
+ struct gl_shader_program *shProg
+ = _mesa_lookup_shader_program_err(ctx, program, "glGetAttribLocation");
+
+ if (!shProg) {
+ return -1;
+ }
+
+ if (!shProg->LinkStatus) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glGetAttribLocation(program not linked)");
+ return -1;
+ }
+
+ if (!name)
+ return -1;
+
+ if (shProg->VertexProgram) {
+ const struct gl_program_parameter_list *attribs =
+ shProg->VertexProgram->Base.Attributes;
+ if (attribs) {
+ GLint i = _mesa_lookup_parameter_index(attribs, -1, name);
+ if (i >= 0) {
+ return attribs->Parameters[i].StateIndexes[0];
+ }
+ }
+ }
+ return -1;
+}
+
+
+static void
+bind_attrib_location(struct gl_context *ctx, GLuint program, GLuint index,
+ const GLchar *name)
+{
+ struct gl_shader_program *shProg;
+ const GLint size = -1; /* unknown size */
+ GLint i;
+ GLenum datatype = GL_FLOAT_VEC4;
+
+ shProg = _mesa_lookup_shader_program_err(ctx, program,
+ "glBindAttribLocation");
+ if (!shProg) {
+ return;
+ }
+
+ if (!name)
+ return;
+
+ if (strncmp(name, "gl_", 3) == 0) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glBindAttribLocation(illegal name)");
+ return;
+ }
+
+ if (index >= ctx->Const.VertexProgram.MaxAttribs) {
+ _mesa_error(ctx, GL_INVALID_VALUE, "glBindAttribLocation(index)");
+ return;
+ }
+
+ /* this will replace the current value if it's already in the list */
+ i = _mesa_add_attribute(shProg->Attributes, name, size, datatype, index);
+ if (i < 0) {
+ _mesa_error(ctx, GL_OUT_OF_MEMORY, "glBindAttribLocation");
+ return;
+ }
+
+ /*
+ * Note that this attribute binding won't go into effect until
+ * glLinkProgram is called again.
+ */
+}
+
+
+static void
+bind_frag_data_location(struct gl_context *ctx, GLuint program,
+ GLuint colorNumber, const GLchar *name)
+{
+ _mesa_problem(ctx, "bind_frag_data_location() not implemented yet");
+}
+
+
+static GLuint
+create_shader(struct gl_context *ctx, GLenum type)
+{
+ struct gl_shader *sh;
+ GLuint name;
+
+ if (!validate_shader_target(ctx, type)) {
+ _mesa_error(ctx, GL_INVALID_ENUM, "CreateShader(type)");
+ return 0;
+ }
+
+ name = _mesa_HashFindFreeKeyBlock(ctx->Shared->ShaderObjects, 1);
+ sh = ctx->Driver.NewShader(ctx, name, type);
+ _mesa_HashInsert(ctx->Shared->ShaderObjects, name, sh);
+
+ return name;
+}
+
+
+static GLuint
+create_shader_program(struct gl_context *ctx)
+{
+ GLuint name;
+ struct gl_shader_program *shProg;
+
+ name = _mesa_HashFindFreeKeyBlock(ctx->Shared->ShaderObjects, 1);
+
+ shProg = ctx->Driver.NewShaderProgram(ctx, name);
+
+ _mesa_HashInsert(ctx->Shared->ShaderObjects, name, shProg);
+
+ assert(shProg->RefCount == 1);
+
+ return name;
+}
+
+
+/**
+ * Named w/ "2" to indicate OpenGL 2.x vs GL_ARB_fragment_programs's
+ * DeleteProgramARB.
+ */
+static void
+delete_shader_program(struct gl_context *ctx, GLuint name)
+{
+ /*
+ * NOTE: deleting shaders/programs works a bit differently than
+ * texture objects (and buffer objects, etc). Shader/program
+ * handles/IDs exist in the hash table until the object is really
+ * deleted (refcount==0). With texture objects, the handle/ID is
+ * removed from the hash table in glDeleteTextures() while the tex
+ * object itself might linger until its refcount goes to zero.
+ */
+ struct gl_shader_program *shProg;
+
+ shProg = _mesa_lookup_shader_program_err(ctx, name, "glDeleteProgram");
+ if (!shProg)
+ return;
+
+ shProg->DeletePending = GL_TRUE;
+
+ /* effectively, decr shProg's refcount */
+ _mesa_reference_shader_program(ctx, &shProg, NULL);
+}
+
+
+static void
+delete_shader(struct gl_context *ctx, GLuint shader)
+{
+ struct gl_shader *sh;
+
+ sh = _mesa_lookup_shader_err(ctx, shader, "glDeleteShader");
+ if (!sh)
+ return;
+
+ sh->DeletePending = GL_TRUE;
+
+ /* effectively, decr sh's refcount */
+ _mesa_reference_shader(ctx, &sh, NULL);
+}
+
+
+static void
+detach_shader(struct gl_context *ctx, GLuint program, GLuint shader)
+{
+ struct gl_shader_program *shProg;
+ GLuint n;
+ GLuint i, j;
+
+ shProg = _mesa_lookup_shader_program_err(ctx, program, "glDetachShader");
+ if (!shProg)
+ return;
+
+ n = shProg->NumShaders;
+
+ for (i = 0; i < n; i++) {
+ if (shProg->Shaders[i]->Name == shader) {
+ /* found it */
+ struct gl_shader **newList;
+
+ /* release */
+ _mesa_reference_shader(ctx, &shProg->Shaders[i], NULL);
+
+ /* alloc new, smaller array */
+ newList = (struct gl_shader **)
+ malloc((n - 1) * sizeof(struct gl_shader *));
+ if (!newList) {
+ _mesa_error(ctx, GL_OUT_OF_MEMORY, "glDetachShader");
+ return;
+ }
+ for (j = 0; j < i; j++) {
+ newList[j] = shProg->Shaders[j];
+ }
+ while (++i < n)
+ newList[j++] = shProg->Shaders[i];
+ free(shProg->Shaders);
+
+ shProg->Shaders = newList;
+ shProg->NumShaders = n - 1;
+
+#ifdef DEBUG
+ /* sanity check */
+ {
+ for (j = 0; j < shProg->NumShaders; j++) {
+ assert(shProg->Shaders[j]->Type == GL_VERTEX_SHADER ||
+ shProg->Shaders[j]->Type == GL_FRAGMENT_SHADER);
+ assert(shProg->Shaders[j]->RefCount > 0);
+ }
+ }
+#endif
+
+ return;
+ }
+ }
+
+ /* not found */
+ {
+ GLenum err;
+ if (is_shader(ctx, shader))
+ err = GL_INVALID_OPERATION;
+ else if (is_program(ctx, shader))
+ err = GL_INVALID_OPERATION;
+ else
+ err = GL_INVALID_VALUE;
+ _mesa_error(ctx, err, "glDetachProgram(shader)");
+ return;
+ }
+}
+
+
+static void
+get_active_attrib(struct gl_context *ctx, GLuint program, GLuint index,
+ GLsizei maxLength, GLsizei *length, GLint *size,
+ GLenum *type, GLchar *nameOut)
+{
+ const struct gl_program_parameter_list *attribs = NULL;
+ struct gl_shader_program *shProg;
+
+ shProg = _mesa_lookup_shader_program_err(ctx, program, "glGetActiveAttrib");
+ if (!shProg)
+ return;
+
+ if (shProg->VertexProgram)
+ attribs = shProg->VertexProgram->Base.Attributes;
+
+ if (!attribs || index >= attribs->NumParameters) {
+ _mesa_error(ctx, GL_INVALID_VALUE, "glGetActiveAttrib(index)");
+ return;
+ }
+
+ _mesa_copy_string(nameOut, maxLength, length,
+ attribs->Parameters[index].Name);
+
+ if (size)
+ *size = attribs->Parameters[index].Size
+ / _mesa_sizeof_glsl_type(attribs->Parameters[index].DataType);
+
+ if (type)
+ *type = attribs->Parameters[index].DataType;
+}
+
+
+/**
+ * Return list of shaders attached to shader program.
+ */
+static void
+get_attached_shaders(struct gl_context *ctx, GLuint program, GLsizei maxCount,
+ GLsizei *count, GLuint *obj)
+{
+ struct gl_shader_program *shProg =
+ _mesa_lookup_shader_program_err(ctx, program, "glGetAttachedShaders");
+ if (shProg) {
+ GLuint i;
+ for (i = 0; i < (GLuint) maxCount && i < shProg->NumShaders; i++) {
+ obj[i] = shProg->Shaders[i]->Name;
+ }
+ if (count)
+ *count = i;
+ }
+}
+
+
+static GLint
+get_frag_data_location(struct gl_context *ctx, GLuint program,
+ const GLchar *name)
+{
+ _mesa_problem(ctx, "get_frag_data_location() not implemented yet");
+ return -1;
+}
+
+
+
+/**
+ * glGetHandleARB() - return ID/name of currently bound shader program.
+ */
+static GLuint
+get_handle(struct gl_context *ctx, GLenum pname)
+{
+ if (pname == GL_PROGRAM_OBJECT_ARB) {
+ if (ctx->Shader.ActiveProgram)
+ return ctx->Shader.ActiveProgram->Name;
+ else
+ return 0;
+ }
+ else {
+ _mesa_error(ctx, GL_INVALID_ENUM, "glGetHandleARB");
+ return 0;
+ }
+}
+
+
+/**
+ * glGetProgramiv() - get shader program state.
+ * Note that this is for GLSL shader programs, not ARB vertex/fragment
+ * programs (see glGetProgramivARB).
+ */
+static void
+get_programiv(struct gl_context *ctx, GLuint program, GLenum pname, GLint *params)
+{
+ const struct gl_program_parameter_list *attribs;
+ struct gl_shader_program *shProg
+ = _mesa_lookup_shader_program(ctx, program);
+
+ if (!shProg) {
+ _mesa_error(ctx, GL_INVALID_VALUE, "glGetProgramiv(program)");
+ return;
+ }
+
+ if (shProg->VertexProgram)
+ attribs = shProg->VertexProgram->Base.Attributes;
+ else
+ attribs = NULL;
+
+ switch (pname) {
+ case GL_DELETE_STATUS:
+ *params = shProg->DeletePending;
+ break;
+ case GL_LINK_STATUS:
+ *params = shProg->LinkStatus;
+ break;
+ case GL_VALIDATE_STATUS:
+ *params = shProg->Validated;
+ break;
+ case GL_INFO_LOG_LENGTH:
+ *params = shProg->InfoLog ? strlen(shProg->InfoLog) + 1 : 0;
+ break;
+ case GL_ATTACHED_SHADERS:
+ *params = shProg->NumShaders;
+ break;
+ case GL_ACTIVE_ATTRIBUTES:
+ *params = attribs ? attribs->NumParameters : 0;
+ break;
+ case GL_ACTIVE_ATTRIBUTE_MAX_LENGTH:
+ *params = _mesa_longest_parameter_name(attribs, PROGRAM_INPUT) + 1;
+ break;
+ case GL_ACTIVE_UNIFORMS:
+ *params = shProg->Uniforms ? shProg->Uniforms->NumUniforms : 0;
+ break;
+ case GL_ACTIVE_UNIFORM_MAX_LENGTH:
+ *params = _mesa_longest_uniform_name(shProg->Uniforms);
+ if (*params > 0)
+ (*params)++; /* add one for terminating zero */
+ break;
+ case GL_PROGRAM_BINARY_LENGTH_OES:
+ *params = 0;
+ break;
+#if FEATURE_EXT_transform_feedback
+ case GL_TRANSFORM_FEEDBACK_VARYINGS:
+ *params = shProg->TransformFeedback.NumVarying;
+ break;
+ case GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH:
+ *params = longest_feedback_varying_name(shProg) + 1;
+ break;
+ case GL_TRANSFORM_FEEDBACK_BUFFER_MODE:
+ *params = shProg->TransformFeedback.BufferMode;
+ break;
+#endif
+#if FEATURE_ARB_geometry_shader4
+ case GL_GEOMETRY_VERTICES_OUT_ARB:
+ *params = shProg->Geom.VerticesOut;
+ break;
+ case GL_GEOMETRY_INPUT_TYPE_ARB:
+ *params = shProg->Geom.InputType;
+ break;
+ case GL_GEOMETRY_OUTPUT_TYPE_ARB:
+ *params = shProg->Geom.OutputType;
+ break;
+#endif
+ default:
+ _mesa_error(ctx, GL_INVALID_ENUM, "glGetProgramiv(pname)");
+ return;
+ }
+}
+
+
+/**
+ * glGetShaderiv() - get GLSL shader state
+ */
+static void
+get_shaderiv(struct gl_context *ctx, GLuint name, GLenum pname, GLint *params)
+{
+ struct gl_shader *shader =
+ _mesa_lookup_shader_err(ctx, name, "glGetShaderiv");
+
+ if (!shader) {
+ return;
+ }
+
+ switch (pname) {
+ case GL_SHADER_TYPE:
+ *params = shader->Type;
+ break;
+ case GL_DELETE_STATUS:
+ *params = shader->DeletePending;
+ break;
+ case GL_COMPILE_STATUS:
+ *params = shader->CompileStatus;
+ break;
+ case GL_INFO_LOG_LENGTH:
+ *params = shader->InfoLog ? strlen(shader->InfoLog) + 1 : 0;
+ break;
+ case GL_SHADER_SOURCE_LENGTH:
+ *params = shader->Source ? strlen((char *) shader->Source) + 1 : 0;
+ break;
+ default:
+ _mesa_error(ctx, GL_INVALID_ENUM, "glGetShaderiv(pname)");
+ return;
+ }
+}
+
+
+static void
+get_program_info_log(struct gl_context *ctx, GLuint program, GLsizei bufSize,
+ GLsizei *length, GLchar *infoLog)
+{
+ struct gl_shader_program *shProg
+ = _mesa_lookup_shader_program(ctx, program);
+ if (!shProg) {
+ _mesa_error(ctx, GL_INVALID_VALUE, "glGetProgramInfoLog(program)");
+ return;
+ }
+ _mesa_copy_string(infoLog, bufSize, length, shProg->InfoLog);
+}
+
+
+static void
+get_shader_info_log(struct gl_context *ctx, GLuint shader, GLsizei bufSize,
+ GLsizei *length, GLchar *infoLog)
+{
+ struct gl_shader *sh = _mesa_lookup_shader(ctx, shader);
+ if (!sh) {
+ _mesa_error(ctx, GL_INVALID_VALUE, "glGetShaderInfoLog(shader)");
+ return;
+ }
+ _mesa_copy_string(infoLog, bufSize, length, sh->InfoLog);
+}
+
+
+/**
+ * Return shader source code.
+ */
+static void
+get_shader_source(struct gl_context *ctx, GLuint shader, GLsizei maxLength,
+ GLsizei *length, GLchar *sourceOut)
+{
+ struct gl_shader *sh;
+ sh = _mesa_lookup_shader_err(ctx, shader, "glGetShaderSource");
+ if (!sh) {
+ return;
+ }
+ _mesa_copy_string(sourceOut, maxLength, length, sh->Source);
+}
+
+
+/**
+ * Set/replace shader source code.
+ */
+static void
+shader_source(struct gl_context *ctx, GLuint shader, const GLchar *source)
+{
+ struct gl_shader *sh;
+
+ sh = _mesa_lookup_shader_err(ctx, shader, "glShaderSource");
+ if (!sh)
+ return;
+
+ /* free old shader source string and install new one */
+ if (sh->Source) {
+ free((void *) sh->Source);
+ }
+ sh->Source = source;
+ sh->CompileStatus = GL_FALSE;
+#ifdef DEBUG
+ sh->SourceChecksum = _mesa_str_checksum(sh->Source);
+#endif
+}
+
+
+/**
+ * Compile a shader.
+ */
+static void
+compile_shader(struct gl_context *ctx, GLuint shaderObj)
+{
+ struct gl_shader *sh;
+ struct gl_shader_compiler_options *options;
+
+ sh = _mesa_lookup_shader_err(ctx, shaderObj, "glCompileShader");
+ if (!sh)
+ return;
+
+ options = &ctx->ShaderCompilerOptions[_mesa_shader_type_to_index(sh->Type)];
+
+ /* set default pragma state for shader */
+ sh->Pragmas = options->DefaultPragmas;
+
+ /* this call will set the sh->CompileStatus field to indicate if
+ * compilation was successful.
+ */
+ _mesa_glsl_compile_shader(ctx, sh);
+}
+
+
+/**
+ * Link a program's shaders.
+ */
+static void
+link_program(struct gl_context *ctx, GLuint program)
+{
+ struct gl_shader_program *shProg;
+ struct gl_transform_feedback_object *obj =
+ ctx->TransformFeedback.CurrentObject;
+
+ shProg = _mesa_lookup_shader_program_err(ctx, program, "glLinkProgram");
+ if (!shProg)
+ return;
+
+ if (obj->Active
+ && (shProg == ctx->Shader.CurrentVertexProgram
+ || shProg == ctx->Shader.CurrentGeometryProgram
+ || shProg == ctx->Shader.CurrentFragmentProgram)) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glLinkProgram(transform feedback active");
+ return;
+ }
+
+ FLUSH_VERTICES(ctx, _NEW_PROGRAM);
+
+ _mesa_glsl_link_shader(ctx, shProg);
+
+ /* debug code */
+ if (0) {
+ GLuint i;
+
+ printf("Link %u shaders in program %u: %s\n",
+ shProg->NumShaders, shProg->Name,
+ shProg->LinkStatus ? "Success" : "Failed");
+
+ for (i = 0; i < shProg->NumShaders; i++) {
+ printf(" shader %u, type 0x%x\n",
+ shProg->Shaders[i]->Name,
+ shProg->Shaders[i]->Type);
+ }
+ }
+}
+
+
+/**
+ * Print basic shader info (for debug).
+ */
+static void
+print_shader_info(const struct gl_shader_program *shProg)
+{
+ GLuint i;
+
+ printf("Mesa: glUseProgram(%u)\n", shProg->Name);
+ for (i = 0; i < shProg->NumShaders; i++) {
+ const char *s;
+ switch (shProg->Shaders[i]->Type) {
+ case GL_VERTEX_SHADER:
+ s = "vertex";
+ break;
+ case GL_FRAGMENT_SHADER:
+ s = "fragment";
+ break;
+ case GL_GEOMETRY_SHADER:
+ s = "geometry";
+ break;
+ default:
+ s = "";
+ }
+ printf(" %s shader %u, checksum %u\n", s,
+ shProg->Shaders[i]->Name,
+ shProg->Shaders[i]->SourceChecksum);
+ }
+ if (shProg->VertexProgram)
+ printf(" vert prog %u\n", shProg->VertexProgram->Base.Id);
+ if (shProg->FragmentProgram)
+ printf(" frag prog %u\n", shProg->FragmentProgram->Base.Id);
+}
+
+
+/**
+ * Use the named shader program for subsequent glUniform calls
+ */
+void
+_mesa_active_program(struct gl_context *ctx, struct gl_shader_program *shProg,
+ const char *caller)
+{
+ if ((shProg != NULL) && !shProg->LinkStatus) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "%s(program %u not linked)", caller, shProg->Name);
+ return;
+ }
+
+ if (ctx->Shader.ActiveProgram != shProg) {
+ _mesa_reference_shader_program(ctx, &ctx->Shader.ActiveProgram, shProg);
+ }
+}
+
+/**
+ */
+static bool
+use_shader_program(struct gl_context *ctx, GLenum type,
+ struct gl_shader_program *shProg)
+{
+ struct gl_shader_program **target;
+
+ switch (type) {
+#if FEATURE_ARB_vertex_shader
+ case GL_VERTEX_SHADER:
+ target = &ctx->Shader.CurrentVertexProgram;
+ if ((shProg == NULL)
+ || (shProg->_LinkedShaders[MESA_SHADER_VERTEX] == NULL)) {
+ shProg = NULL;
+ }
+ break;
+#endif
+#if FEATURE_ARB_geometry_shader4
+ case GL_GEOMETRY_SHADER_ARB:
+ target = &ctx->Shader.CurrentGeometryProgram;
+ if ((shProg == NULL)
+ || (shProg->_LinkedShaders[MESA_SHADER_GEOMETRY] == NULL)) {
+ shProg = NULL;
+ }
+ break;
+#endif
+#if FEATURE_ARB_fragment_shader
+ case GL_FRAGMENT_SHADER:
+ target = &ctx->Shader.CurrentFragmentProgram;
+ if ((shProg == NULL)
+ || (shProg->_LinkedShaders[MESA_SHADER_FRAGMENT] == NULL)) {
+ shProg = NULL;
+ }
+ break;
+#endif
+ default:
+ return false;
+ }
+
+ if (*target != shProg) {
+ FLUSH_VERTICES(ctx, _NEW_PROGRAM | _NEW_PROGRAM_CONSTANTS);
+ _mesa_reference_shader_program(ctx, target, shProg);
+ return true;
+ }
+
+ return false;
+}
+
+/**
+ * Use the named shader program for subsequent rendering.
+ */
+void
+_mesa_use_program(struct gl_context *ctx, struct gl_shader_program *shProg)
+{
+ use_shader_program(ctx, GL_VERTEX_SHADER, shProg);
+ use_shader_program(ctx, GL_GEOMETRY_SHADER_ARB, shProg);
+ use_shader_program(ctx, GL_FRAGMENT_SHADER, shProg);
+ _mesa_active_program(ctx, shProg, "glUseProgram");
+
+ if (ctx->Driver.UseProgram)
+ ctx->Driver.UseProgram(ctx, shProg);
+}
+
+
+/**
+ * Validate a program's samplers.
+ * Specifically, check that there aren't two samplers of different types
+ * pointing to the same texture unit.
+ * \return GL_TRUE if valid, GL_FALSE if invalid
+ */
+static GLboolean
+validate_samplers(const struct gl_program *prog, char *errMsg)
+{
+ static const char *targetName[] = {
+ "TEXTURE_BUFFER",
+ "TEXTURE_2D_ARRAY",
+ "TEXTURE_1D_ARRAY",
+ "TEXTURE_CUBE",
+ "TEXTURE_3D",
+ "TEXTURE_RECT",
+ "TEXTURE_2D",
+ "TEXTURE_1D",
+ };
+ GLint targetUsed[MAX_TEXTURE_IMAGE_UNITS];
+ GLbitfield samplersUsed = prog->SamplersUsed;
+ GLuint i;
+
+ assert(Elements(targetName) == NUM_TEXTURE_TARGETS);
+
+ if (samplersUsed == 0x0)
+ return GL_TRUE;
+
+ for (i = 0; i < Elements(targetUsed); i++)
+ targetUsed[i] = -1;
+
+ /* walk over bits which are set in 'samplers' */
+ while (samplersUsed) {
+ GLuint unit;
+ gl_texture_index target;
+ GLint sampler = _mesa_ffs(samplersUsed) - 1;
+ assert(sampler >= 0);
+ assert(sampler < MAX_TEXTURE_IMAGE_UNITS);
+ unit = prog->SamplerUnits[sampler];
+ target = prog->SamplerTargets[sampler];
+ if (targetUsed[unit] != -1 && targetUsed[unit] != (int) target) {
+ _mesa_snprintf(errMsg, 100,
+ "Texture unit %d is accessed both as %s and %s",
+ unit, targetName[targetUsed[unit]], targetName[target]);
+ return GL_FALSE;
+ }
+ targetUsed[unit] = target;
+ samplersUsed ^= (1 << sampler);
+ }
+
+ return GL_TRUE;
+}
+
+
+/**
+ * Do validation of the given shader program.
+ * \param errMsg returns error message if validation fails.
+ * \return GL_TRUE if valid, GL_FALSE if invalid (and set errMsg)
+ */
+static GLboolean
+validate_shader_program(const struct gl_shader_program *shProg,
+ char *errMsg)
+{
+ const struct gl_vertex_program *vp = shProg->VertexProgram;
+ const struct gl_fragment_program *fp = shProg->FragmentProgram;
+
+ if (!shProg->LinkStatus) {
+ return GL_FALSE;
+ }
+
+ /* From the GL spec, a program is invalid if any of these are true:
+
+ any two active samplers in the current program object are of
+ different types, but refer to the same texture image unit,
+
+ any active sampler in the current program object refers to a texture
+ image unit where fixed-function fragment processing accesses a
+ texture target that does not match the sampler type, or
+
+ the sum of the number of active samplers in the program and the
+ number of texture image units enabled for fixed-function fragment
+ processing exceeds the combined limit on the total number of texture
+ image units allowed.
+ */
+
+
+ /*
+ * Check: any two active samplers in the current program object are of
+ * different types, but refer to the same texture image unit,
+ */
+ if (vp && !validate_samplers(&vp->Base, errMsg)) {
+ return GL_FALSE;
+ }
+ if (fp && !validate_samplers(&fp->Base, errMsg)) {
+ return GL_FALSE;
+ }
+
+ return GL_TRUE;
+}
+
+
+/**
+ * Called via glValidateProgram()
+ */
+static void
+validate_program(struct gl_context *ctx, GLuint program)
+{
+ struct gl_shader_program *shProg;
+ char errMsg[100];
+
+ shProg = _mesa_lookup_shader_program_err(ctx, program, "glValidateProgram");
+ if (!shProg) {
+ return;
+ }
+
+ shProg->Validated = validate_shader_program(shProg, errMsg);
+ if (!shProg->Validated) {
+ /* update info log */
+ if (shProg->InfoLog) {
+ ralloc_free(shProg->InfoLog);
+ }
+ shProg->InfoLog = ralloc_strdup(shProg, errMsg);
+ }
+}
+
+
+
+void GLAPIENTRY
+_mesa_AttachObjectARB(GLhandleARB program, GLhandleARB shader)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ attach_shader(ctx, program, shader);
+}
+
+
+void GLAPIENTRY
+_mesa_AttachShader(GLuint program, GLuint shader)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ attach_shader(ctx, program, shader);
+}
+
+
+void GLAPIENTRY
+_mesa_BindAttribLocationARB(GLhandleARB program, GLuint index,
+ const GLcharARB *name)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ bind_attrib_location(ctx, program, index, name);
+}
+
+
+/* GL_EXT_gpu_shader4, GL3 */
+void GLAPIENTRY
+_mesa_BindFragDataLocation(GLuint program, GLuint colorNumber,
+ const GLchar *name)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ bind_frag_data_location(ctx, program, colorNumber, name);
+}
+
+
+void GLAPIENTRY
+_mesa_CompileShaderARB(GLhandleARB shaderObj)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ if (MESA_VERBOSE & VERBOSE_API)
+ _mesa_debug(ctx, "glCompileShader %u\n", shaderObj);
+ compile_shader(ctx, shaderObj);
+}
+
+
+GLuint GLAPIENTRY
+_mesa_CreateShader(GLenum type)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ if (MESA_VERBOSE & VERBOSE_API)
+ _mesa_debug(ctx, "glCreateShader %s\n", _mesa_lookup_enum_by_nr(type));
+ return create_shader(ctx, type);
+}
+
+
+GLhandleARB GLAPIENTRY
+_mesa_CreateShaderObjectARB(GLenum type)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ return create_shader(ctx, type);
+}
+
+
+GLuint GLAPIENTRY
+_mesa_CreateProgram(void)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ if (MESA_VERBOSE & VERBOSE_API)
+ _mesa_debug(ctx, "glCreateProgram\n");
+ return create_shader_program(ctx);
+}
+
+
+GLhandleARB GLAPIENTRY
+_mesa_CreateProgramObjectARB(void)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ return create_shader_program(ctx);
+}
+
+
+void GLAPIENTRY
+_mesa_DeleteObjectARB(GLhandleARB obj)
+{
+ if (MESA_VERBOSE & VERBOSE_API) {
+ GET_CURRENT_CONTEXT(ctx);
+ _mesa_debug(ctx, "glDeleteObjectARB(%u)\n", obj);
+ }
+
+ if (obj) {
+ GET_CURRENT_CONTEXT(ctx);
+ FLUSH_VERTICES(ctx, 0);
+ if (is_program(ctx, obj)) {
+ delete_shader_program(ctx, obj);
+ }
+ else if (is_shader(ctx, obj)) {
+ delete_shader(ctx, obj);
+ }
+ else {
+ /* error? */
+ }
+ }
+}
+
+
+void GLAPIENTRY
+_mesa_DeleteProgram(GLuint name)
+{
+ if (name) {
+ GET_CURRENT_CONTEXT(ctx);
+ FLUSH_VERTICES(ctx, 0);
+ delete_shader_program(ctx, name);
+ }
+}
+
+
+void GLAPIENTRY
+_mesa_DeleteShader(GLuint name)
+{
+ if (name) {
+ GET_CURRENT_CONTEXT(ctx);
+ FLUSH_VERTICES(ctx, 0);
+ delete_shader(ctx, name);
+ }
+}
+
+
+void GLAPIENTRY
+_mesa_DetachObjectARB(GLhandleARB program, GLhandleARB shader)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ detach_shader(ctx, program, shader);
+}
+
+
+void GLAPIENTRY
+_mesa_DetachShader(GLuint program, GLuint shader)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ detach_shader(ctx, program, shader);
+}
+
+
+void GLAPIENTRY
+_mesa_GetActiveAttribARB(GLhandleARB program, GLuint index,
+ GLsizei maxLength, GLsizei * length, GLint * size,
+ GLenum * type, GLcharARB * name)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ get_active_attrib(ctx, program, index, maxLength, length, size, type, name);
+}
+
+
+void GLAPIENTRY
+_mesa_GetAttachedObjectsARB(GLhandleARB container, GLsizei maxCount,
+ GLsizei * count, GLhandleARB * obj)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ get_attached_shaders(ctx, container, maxCount, count, obj);
+}
+
+
+void GLAPIENTRY
+_mesa_GetAttachedShaders(GLuint program, GLsizei maxCount,
+ GLsizei *count, GLuint *obj)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ get_attached_shaders(ctx, program, maxCount, count, obj);
+}
+
+
+GLint GLAPIENTRY
+_mesa_GetAttribLocationARB(GLhandleARB program, const GLcharARB * name)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ return get_attrib_location(ctx, program, name);
+}
+
+
+/* GL_EXT_gpu_shader4, GL3 */
+GLint GLAPIENTRY
+_mesa_GetFragDataLocation(GLuint program, const GLchar *name)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ return get_frag_data_location(ctx, program, name);
+}
+
+
+
+void GLAPIENTRY
+_mesa_GetInfoLogARB(GLhandleARB object, GLsizei maxLength, GLsizei * length,
+ GLcharARB * infoLog)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ if (is_program(ctx, object)) {
+ get_program_info_log(ctx, object, maxLength, length, infoLog);
+ }
+ else if (is_shader(ctx, object)) {
+ get_shader_info_log(ctx, object, maxLength, length, infoLog);
+ }
+ else {
+ _mesa_error(ctx, GL_INVALID_OPERATION, "glGetInfoLogARB");
+ }
+}
+
+
+void GLAPIENTRY
+_mesa_GetObjectParameterivARB(GLhandleARB object, GLenum pname, GLint *params)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ /* Implement in terms of GetProgramiv, GetShaderiv */
+ if (is_program(ctx, object)) {
+ if (pname == GL_OBJECT_TYPE_ARB) {
+ *params = GL_PROGRAM_OBJECT_ARB;
+ }
+ else {
+ get_programiv(ctx, object, pname, params);
+ }
+ }
+ else if (is_shader(ctx, object)) {
+ if (pname == GL_OBJECT_TYPE_ARB) {
+ *params = GL_SHADER_OBJECT_ARB;
+ }
+ else {
+ get_shaderiv(ctx, object, pname, params);
+ }
+ }
+ else {
+ _mesa_error(ctx, GL_INVALID_VALUE, "glGetObjectParameterivARB");
+ }
+}
+
+
+void GLAPIENTRY
+_mesa_GetObjectParameterfvARB(GLhandleARB object, GLenum pname,
+ GLfloat *params)
+{
+ GLint iparams[1]; /* XXX is one element enough? */
+ _mesa_GetObjectParameterivARB(object, pname, iparams);
+ params[0] = (GLfloat) iparams[0];
+}
+
+
+void GLAPIENTRY
+_mesa_GetProgramiv(GLuint program, GLenum pname, GLint *params)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ get_programiv(ctx, program, pname, params);
+}
+
+
+void GLAPIENTRY
+_mesa_GetShaderiv(GLuint shader, GLenum pname, GLint *params)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ get_shaderiv(ctx, shader, pname, params);
+}
+
+
+void GLAPIENTRY
+_mesa_GetProgramInfoLog(GLuint program, GLsizei bufSize,
+ GLsizei *length, GLchar *infoLog)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ get_program_info_log(ctx, program, bufSize, length, infoLog);
+}
+
+
+void GLAPIENTRY
+_mesa_GetShaderInfoLog(GLuint shader, GLsizei bufSize,
+ GLsizei *length, GLchar *infoLog)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ get_shader_info_log(ctx, shader, bufSize, length, infoLog);
+}
+
+
+void GLAPIENTRY
+_mesa_GetShaderSourceARB(GLhandleARB shader, GLsizei maxLength,
+ GLsizei *length, GLcharARB *sourceOut)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ get_shader_source(ctx, shader, maxLength, length, sourceOut);
+}
+
+
+GLhandleARB GLAPIENTRY
+_mesa_GetHandleARB(GLenum pname)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ return get_handle(ctx, pname);
+}
+
+
+GLboolean GLAPIENTRY
+_mesa_IsProgram(GLuint name)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ return is_program(ctx, name);
+}
+
+
+GLboolean GLAPIENTRY
+_mesa_IsShader(GLuint name)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ return is_shader(ctx, name);
+}
+
+
+void GLAPIENTRY
+_mesa_LinkProgramARB(GLhandleARB programObj)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ link_program(ctx, programObj);
+}
+
+
+
+/**
+ * Read shader source code from a file.
+ * Useful for debugging to override an app's shader.
+ */
+static GLcharARB *
+read_shader(const char *fname)
+{
+ const int max = 50*1000;
+ FILE *f = fopen(fname, "r");
+ GLcharARB *buffer, *shader;
+ int len;
+
+ if (!f) {
+ return NULL;
+ }
+
+ buffer = (char *) malloc(max);
+ len = fread(buffer, 1, max, f);
+ buffer[len] = 0;
+
+ fclose(f);
+
+ shader = _mesa_strdup(buffer);
+ free(buffer);
+
+ return shader;
+}
+
+
+/**
+ * Called via glShaderSource() and glShaderSourceARB() API functions.
+ * Basically, concatenate the source code strings into one long string
+ * and pass it to _mesa_shader_source().
+ */
+void GLAPIENTRY
+_mesa_ShaderSourceARB(GLhandleARB shaderObj, GLsizei count,
+ const GLcharARB ** string, const GLint * length)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ GLint *offsets;
+ GLsizei i, totalLength;
+ GLcharARB *source;
+ GLuint checksum;
+
+ if (!shaderObj || string == NULL) {
+ _mesa_error(ctx, GL_INVALID_VALUE, "glShaderSourceARB");
+ return;
+ }
+
+ /*
+ * This array holds offsets of where the appropriate string ends, thus the
+ * last element will be set to the total length of the source code.
+ */
+ offsets = (GLint *) malloc(count * sizeof(GLint));
+ if (offsets == NULL) {
+ _mesa_error(ctx, GL_OUT_OF_MEMORY, "glShaderSourceARB");
+ return;
+ }
+
+ for (i = 0; i < count; i++) {
+ if (string[i] == NULL) {
+ free((GLvoid *) offsets);
+ _mesa_error(ctx, GL_INVALID_OPERATION, "glShaderSourceARB(null string)");
+ return;
+ }
+ if (length == NULL || length[i] < 0)
+ offsets[i] = strlen(string[i]);
+ else
+ offsets[i] = length[i];
+ /* accumulate string lengths */
+ if (i > 0)
+ offsets[i] += offsets[i - 1];
+ }
+
+ /* Total length of source string is sum off all strings plus two.
+ * One extra byte for terminating zero, another extra byte to silence
+ * valgrind warnings in the parser/grammer code.
+ */
+ totalLength = offsets[count - 1] + 2;
+ source = (GLcharARB *) malloc(totalLength * sizeof(GLcharARB));
+ if (source == NULL) {
+ free((GLvoid *) offsets);
+ _mesa_error(ctx, GL_OUT_OF_MEMORY, "glShaderSourceARB");
+ return;
+ }
+
+ for (i = 0; i < count; i++) {
+ GLint start = (i > 0) ? offsets[i - 1] : 0;
+ memcpy(source + start, string[i],
+ (offsets[i] - start) * sizeof(GLcharARB));
+ }
+ source[totalLength - 1] = '\0';
+ source[totalLength - 2] = '\0';
+
+ if (SHADER_SUBST) {
+ /* Compute the shader's source code checksum then try to open a file
+ * named newshader_<CHECKSUM>. If it exists, use it in place of the
+ * original shader source code. For debugging.
+ */
+ char filename[100];
+ GLcharARB *newSource;
+
+ checksum = _mesa_str_checksum(source);
+
+ _mesa_snprintf(filename, sizeof(filename), "newshader_%d", checksum);
+
+ newSource = read_shader(filename);
+ if (newSource) {
+ fprintf(stderr, "Mesa: Replacing shader %u chksum=%d with %s\n",
+ shaderObj, checksum, filename);
+ free(source);
+ source = newSource;
+ }
+ }
+
+ shader_source(ctx, shaderObj, source);
+
+ if (SHADER_SUBST) {
+ struct gl_shader *sh = _mesa_lookup_shader(ctx, shaderObj);
+ if (sh)
+ sh->SourceChecksum = checksum; /* save original checksum */
+ }
+
+ free(offsets);
+}
+
+
+void GLAPIENTRY
+_mesa_UseProgramObjectARB(GLhandleARB program)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ struct gl_shader_program *shProg;
+ struct gl_transform_feedback_object *obj =
+ ctx->TransformFeedback.CurrentObject;
+
+ if (obj->Active) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glUseProgram(transform feedback active)");
+ return;
+ }
+
+ if (program) {
+ shProg = _mesa_lookup_shader_program_err(ctx, program, "glUseProgram");
+ if (!shProg) {
+ return;
+ }
+ if (!shProg->LinkStatus) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glUseProgram(program %u not linked)", program);
+ return;
+ }
+
+ /* debug code */
+ if (ctx->Shader.Flags & GLSL_USE_PROG) {
+ print_shader_info(shProg);
+ }
+ }
+ else {
+ shProg = NULL;
+ }
+
+ _mesa_use_program(ctx, shProg);
+}
+
+
+void GLAPIENTRY
+_mesa_ValidateProgramARB(GLhandleARB program)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ validate_program(ctx, program);
+}
+
+#ifdef FEATURE_ES2
+
+void GLAPIENTRY
+_mesa_GetShaderPrecisionFormat(GLenum shadertype, GLenum precisiontype,
+ GLint* range, GLint* precision)
+{
+ const struct gl_program_constants *limits;
+ const struct gl_precision *p;
+ GET_CURRENT_CONTEXT(ctx);
+
+ switch (shadertype) {
+ case GL_VERTEX_SHADER:
+ limits = &ctx->Const.VertexProgram;
+ break;
+ case GL_FRAGMENT_SHADER:
+ limits = &ctx->Const.FragmentProgram;
+ break;
+ default:
+ _mesa_error(ctx, GL_INVALID_ENUM,
+ "glGetShaderPrecisionFormat(shadertype)");
+ return;
+ }
+
+ switch (precisiontype) {
+ case GL_LOW_FLOAT:
+ p = &limits->LowFloat;
+ break;
+ case GL_MEDIUM_FLOAT:
+ p = &limits->MediumFloat;
+ break;
+ case GL_HIGH_FLOAT:
+ p = &limits->HighFloat;
+ break;
+ case GL_LOW_INT:
+ p = &limits->LowInt;
+ break;
+ case GL_MEDIUM_INT:
+ p = &limits->MediumInt;
+ break;
+ case GL_HIGH_INT:
+ p = &limits->HighInt;
+ break;
+ default:
+ _mesa_error(ctx, GL_INVALID_ENUM,
+ "glGetShaderPrecisionFormat(precisiontype)");
+ return;
+ }
+
+ range[0] = p->RangeMin;
+ range[1] = p->RangeMax;
+ precision[0] = p->Precision;
+}
+
+
+void GLAPIENTRY
+_mesa_ReleaseShaderCompiler(void)
+{
+ _mesa_destroy_shader_compiler_caches();
+}
+
+
+void GLAPIENTRY
+_mesa_ShaderBinary(GLint n, const GLuint* shaders, GLenum binaryformat,
+ const void* binary, GLint length)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ (void) n;
+ (void) shaders;
+ (void) binaryformat;
+ (void) binary;
+ (void) length;
+ _mesa_error(ctx, GL_INVALID_OPERATION, __FUNCTION__);
+}
+
+#endif /* FEATURE_ES2 */
+
+
+#if FEATURE_ARB_geometry_shader4
+
+void GLAPIENTRY
+_mesa_ProgramParameteriARB(GLuint program, GLenum pname,
+ GLint value)
+{
+ struct gl_shader_program *shProg;
+ GET_CURRENT_CONTEXT(ctx);
+
+ ASSERT_OUTSIDE_BEGIN_END(ctx);
+
+ shProg = _mesa_lookup_shader_program_err(ctx, program,
+ "glProgramParameteri");
+ if (!shProg)
+ return;
+
+ switch (pname) {
+ case GL_GEOMETRY_VERTICES_OUT_ARB:
+ if (value < 1 ||
+ (unsigned) value > ctx->Const.MaxGeometryOutputVertices) {
+ _mesa_error(ctx, GL_INVALID_VALUE,
+ "glProgramParameteri(GL_GEOMETRY_VERTICES_OUT_ARB=%d",
+ value);
+ return;
+ }
+ shProg->Geom.VerticesOut = value;
+ break;
+ case GL_GEOMETRY_INPUT_TYPE_ARB:
+ switch (value) {
+ case GL_POINTS:
+ case GL_LINES:
+ case GL_LINES_ADJACENCY_ARB:
+ case GL_TRIANGLES:
+ case GL_TRIANGLES_ADJACENCY_ARB:
+ shProg->Geom.InputType = value;
+ break;
+ default:
+ _mesa_error(ctx, GL_INVALID_VALUE,
+ "glProgramParameteri(geometry input type = %s",
+ _mesa_lookup_enum_by_nr(value));
+ return;
+ }
+ break;
+ case GL_GEOMETRY_OUTPUT_TYPE_ARB:
+ switch (value) {
+ case GL_POINTS:
+ case GL_LINE_STRIP:
+ case GL_TRIANGLE_STRIP:
+ shProg->Geom.OutputType = value;
+ break;
+ default:
+ _mesa_error(ctx, GL_INVALID_VALUE,
+ "glProgramParameteri(geometry output type = %s",
+ _mesa_lookup_enum_by_nr(value));
+ return;
+ }
+ break;
+ default:
+ _mesa_error(ctx, GL_INVALID_ENUM, "glProgramParameteriARB(pname=%s)",
+ _mesa_lookup_enum_by_nr(pname));
+ break;
+ }
+}
+
+#endif
+
+void
+_mesa_use_shader_program(struct gl_context *ctx, GLenum type,
+ struct gl_shader_program *shProg)
+{
+ use_shader_program(ctx, type, shProg);
+
+ if (ctx->Driver.UseProgram)
+ ctx->Driver.UseProgram(ctx, shProg);
+}
+
+void GLAPIENTRY
+_mesa_UseShaderProgramEXT(GLenum type, GLuint program)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ struct gl_shader_program *shProg = NULL;
+
+ if (!validate_shader_target(ctx, type)) {
+ _mesa_error(ctx, GL_INVALID_ENUM, "glUseShaderProgramEXT(type)");
+ return;
+ }
+
+ if (ctx->TransformFeedback.CurrentObject->Active) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glUseShaderProgramEXT(transform feedback is active)");
+ return;
+ }
+
+ if (program) {
+ shProg = _mesa_lookup_shader_program_err(ctx, program,
+ "glUseShaderProgramEXT");
+ if (shProg == NULL)
+ return;
+
+ if (!shProg->LinkStatus) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glUseShaderProgramEXT(program not linked)");
+ return;
+ }
+ }
+
+ _mesa_use_shader_program(ctx, type, shProg);
+}
+
+void GLAPIENTRY
+_mesa_ActiveProgramEXT(GLuint program)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ struct gl_shader_program *shProg = (program != 0)
+ ? _mesa_lookup_shader_program_err(ctx, program, "glActiveProgramEXT")
+ : NULL;
+
+ _mesa_active_program(ctx, shProg, "glActiveProgramEXT");
+ return;
+}
+
+GLuint GLAPIENTRY
+_mesa_CreateShaderProgramEXT(GLenum type, const GLchar *string)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ const GLuint shader = create_shader(ctx, type);
+ GLuint program = 0;
+
+ if (shader) {
+ shader_source(ctx, shader, _mesa_strdup(string));
+ compile_shader(ctx, shader);
+
+ program = create_shader_program(ctx);
+ if (program) {
+ struct gl_shader_program *shProg;
+ struct gl_shader *sh;
+ GLint compiled = GL_FALSE;
+
+ shProg = _mesa_lookup_shader_program(ctx, program);
+ sh = _mesa_lookup_shader(ctx, shader);
+
+ get_shaderiv(ctx, shader, GL_COMPILE_STATUS, &compiled);
+ if (compiled) {
+ attach_shader(ctx, program, shader);
+ link_program(ctx, program);
+ detach_shader(ctx, program, shader);
+
+#if 0
+ /* Possibly... */
+ if (active-user-defined-varyings-in-linked-program) {
+ append-error-to-info-log;
+ shProg->LinkStatus = GL_FALSE;
+ }
+#endif
+ }
+
+ ralloc_strcat(&shProg->InfoLog, sh->InfoLog);
+ }
+
+ delete_shader(ctx, shader);
+ }
+
+ return program;
+}
+
+/**
+ * Plug in shader-related functions into API dispatch table.
+ */
+void
+_mesa_init_shader_dispatch(struct _glapi_table *exec)
+{
+#if FEATURE_GL
+ /* GL_ARB_vertex/fragment_shader */
+ SET_DeleteObjectARB(exec, _mesa_DeleteObjectARB);
+ SET_GetHandleARB(exec, _mesa_GetHandleARB);
+ SET_DetachObjectARB(exec, _mesa_DetachObjectARB);
+ SET_CreateShaderObjectARB(exec, _mesa_CreateShaderObjectARB);
+ SET_ShaderSourceARB(exec, _mesa_ShaderSourceARB);
+ SET_CompileShaderARB(exec, _mesa_CompileShaderARB);
+ SET_CreateProgramObjectARB(exec, _mesa_CreateProgramObjectARB);
+ SET_AttachObjectARB(exec, _mesa_AttachObjectARB);
+ SET_LinkProgramARB(exec, _mesa_LinkProgramARB);
+ SET_UseProgramObjectARB(exec, _mesa_UseProgramObjectARB);
+ SET_ValidateProgramARB(exec, _mesa_ValidateProgramARB);
+ SET_GetObjectParameterfvARB(exec, _mesa_GetObjectParameterfvARB);
+ SET_GetObjectParameterivARB(exec, _mesa_GetObjectParameterivARB);
+ SET_GetInfoLogARB(exec, _mesa_GetInfoLogARB);
+ SET_GetAttachedObjectsARB(exec, _mesa_GetAttachedObjectsARB);
+ SET_GetShaderSourceARB(exec, _mesa_GetShaderSourceARB);
+
+ /* OpenGL 2.0 */
+ SET_AttachShader(exec, _mesa_AttachShader);
+ SET_CreateProgram(exec, _mesa_CreateProgram);
+ SET_CreateShader(exec, _mesa_CreateShader);
+ SET_DeleteProgram(exec, _mesa_DeleteProgram);
+ SET_DeleteShader(exec, _mesa_DeleteShader);
+ SET_DetachShader(exec, _mesa_DetachShader);
+ SET_GetAttachedShaders(exec, _mesa_GetAttachedShaders);
+ SET_GetProgramiv(exec, _mesa_GetProgramiv);
+ SET_GetProgramInfoLog(exec, _mesa_GetProgramInfoLog);
+ SET_GetShaderiv(exec, _mesa_GetShaderiv);
+ SET_GetShaderInfoLog(exec, _mesa_GetShaderInfoLog);
+ SET_IsProgram(exec, _mesa_IsProgram);
+ SET_IsShader(exec, _mesa_IsShader);
+
+#if FEATURE_ARB_vertex_shader
+ SET_BindAttribLocationARB(exec, _mesa_BindAttribLocationARB);
+ SET_GetActiveAttribARB(exec, _mesa_GetActiveAttribARB);
+ SET_GetAttribLocationARB(exec, _mesa_GetAttribLocationARB);
+#endif
+
+#if FEATURE_ARB_geometry_shader4
+ SET_ProgramParameteriARB(exec, _mesa_ProgramParameteriARB);
+#endif
+
+ SET_UseShaderProgramEXT(exec, _mesa_UseShaderProgramEXT);
+ SET_ActiveProgramEXT(exec, _mesa_ActiveProgramEXT);
+ SET_CreateShaderProgramEXT(exec, _mesa_CreateShaderProgramEXT);
+
+ /* GL_EXT_gpu_shader4 / GL 3.0 */
+ SET_BindFragDataLocationEXT(exec, _mesa_BindFragDataLocation);
+ SET_GetFragDataLocationEXT(exec, _mesa_GetFragDataLocation);
+
+ /* GL_ARB_ES2_compatibility */
+ SET_ReleaseShaderCompiler(exec, _mesa_ReleaseShaderCompiler);
+ SET_GetShaderPrecisionFormat(exec, _mesa_GetShaderPrecisionFormat);
+
+#endif /* FEATURE_GL */
+}
+
diff --git a/mesalib/src/mesa/main/shared.c b/mesalib/src/mesa/main/shared.c
index d84f59690..a36083a37 100644
--- a/mesalib/src/mesa/main/shared.c
+++ b/mesalib/src/mesa/main/shared.c
@@ -1,420 +1,420 @@
-/*
- * Mesa 3-D graphics library
- * Version: 7.5
- *
- * Copyright (C) 2009 VMware, Inc. All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-/**
- * \file shared.c
- * Shared-context state
- */
-
-#include "imports.h"
-#include "mfeatures.h"
-#include "mtypes.h"
-#include "hash.h"
-#if FEATURE_ATI_fragment_shader
-#include "atifragshader.h"
-#endif
-#include "bufferobj.h"
-#include "shared.h"
-#include "program/program.h"
-#include "dlist.h"
-#if FEATURE_ARB_sampler_objects
-#include "samplerobj.h"
-#endif
-#include "shaderobj.h"
-#include "syncobj.h"
-
-
-/**
- * Allocate and initialize a shared context state structure.
- * Initializes the display list, texture objects and vertex programs hash
- * tables, allocates the texture objects. If it runs out of memory, frees
- * everything already allocated before returning NULL.
- *
- * \return pointer to a gl_shared_state structure on success, or NULL on
- * failure.
- */
-struct gl_shared_state *
-_mesa_alloc_shared_state(struct gl_context *ctx)
-{
- struct gl_shared_state *shared;
- GLuint i;
-
- shared = CALLOC_STRUCT(gl_shared_state);
- if (!shared)
- return NULL;
-
- _glthread_INIT_MUTEX(shared->Mutex);
-
- shared->DisplayList = _mesa_NewHashTable();
- shared->TexObjects = _mesa_NewHashTable();
- shared->Programs = _mesa_NewHashTable();
-
-#if FEATURE_ARB_vertex_program
- shared->DefaultVertexProgram = (struct gl_vertex_program *)
- ctx->Driver.NewProgram(ctx, GL_VERTEX_PROGRAM_ARB, 0);
-#endif
-
-#if FEATURE_ARB_fragment_program
- shared->DefaultFragmentProgram = (struct gl_fragment_program *)
- ctx->Driver.NewProgram(ctx, GL_FRAGMENT_PROGRAM_ARB, 0);
-#endif
-
-#if FEATURE_ATI_fragment_shader
- shared->ATIShaders = _mesa_NewHashTable();
- shared->DefaultFragmentShader = _mesa_new_ati_fragment_shader(ctx, 0);
-#endif
-
-#if FEATURE_ARB_shader_objects
- shared->ShaderObjects = _mesa_NewHashTable();
-#endif
-
-#if FEATURE_ARB_vertex_buffer_object || FEATURE_ARB_pixel_buffer_object
- shared->BufferObjects = _mesa_NewHashTable();
-#endif
-
-#if FEATURE_ARB_sampler_objects
- /* GL_ARB_sampler_objects */
- shared->SamplerObjects = _mesa_NewHashTable();
-#endif
-
- /* Allocate the default buffer object */
- shared->NullBufferObj = ctx->Driver.NewBufferObject(ctx, 0, 0);
-
- /* Create default texture objects */
- for (i = 0; i < NUM_TEXTURE_TARGETS; i++) {
- /* NOTE: the order of these enums matches the TEXTURE_x_INDEX values */
- static const GLenum targets[NUM_TEXTURE_TARGETS] = {
- GL_TEXTURE_BUFFER,
- GL_TEXTURE_2D_ARRAY_EXT,
- GL_TEXTURE_1D_ARRAY_EXT,
- GL_TEXTURE_CUBE_MAP,
- GL_TEXTURE_3D,
- GL_TEXTURE_RECTANGLE_NV,
- GL_TEXTURE_2D,
- GL_TEXTURE_1D
- };
- assert(Elements(targets) == NUM_TEXTURE_TARGETS);
- shared->DefaultTex[i] = ctx->Driver.NewTextureObject(ctx, 0, targets[i]);
- }
-
- /* sanity check */
- assert(shared->DefaultTex[TEXTURE_1D_INDEX]->RefCount == 1);
-
- /* Mutex and timestamp for texobj state validation */
- _glthread_INIT_MUTEX(shared->TexMutex);
- shared->TextureStateStamp = 0;
-
-#if FEATURE_EXT_framebuffer_object
- shared->FrameBuffers = _mesa_NewHashTable();
- shared->RenderBuffers = _mesa_NewHashTable();
-#endif
-
- make_empty_list(& shared->SyncObjects);
-
- return shared;
-}
-
-
-/**
- * Callback for deleting a display list. Called by _mesa_HashDeleteAll().
- */
-static void
-delete_displaylist_cb(GLuint id, void *data, void *userData)
-{
- struct gl_display_list *list = (struct gl_display_list *) data;
- struct gl_context *ctx = (struct gl_context *) userData;
- _mesa_delete_list(ctx, list);
-}
-
-
-/**
- * Callback for deleting a texture object. Called by _mesa_HashDeleteAll().
- */
-static void
-delete_texture_cb(GLuint id, void *data, void *userData)
-{
- struct gl_texture_object *texObj = (struct gl_texture_object *) data;
- struct gl_context *ctx = (struct gl_context *) userData;
- ctx->Driver.DeleteTexture(ctx, texObj);
-}
-
-
-/**
- * Callback for deleting a program object. Called by _mesa_HashDeleteAll().
- */
-static void
-delete_program_cb(GLuint id, void *data, void *userData)
-{
- struct gl_program *prog = (struct gl_program *) data;
- struct gl_context *ctx = (struct gl_context *) userData;
- if(prog != &_mesa_DummyProgram) {
- ASSERT(prog->RefCount == 1); /* should only be referenced by hash table */
- prog->RefCount = 0; /* now going away */
- ctx->Driver.DeleteProgram(ctx, prog);
- }
-}
-
-
-#if FEATURE_ATI_fragment_shader
-/**
- * Callback for deleting an ATI fragment shader object.
- * Called by _mesa_HashDeleteAll().
- */
-static void
-delete_fragshader_cb(GLuint id, void *data, void *userData)
-{
- struct ati_fragment_shader *shader = (struct ati_fragment_shader *) data;
- struct gl_context *ctx = (struct gl_context *) userData;
- _mesa_delete_ati_fragment_shader(ctx, shader);
-}
-#endif
-
-
-/**
- * Callback for deleting a buffer object. Called by _mesa_HashDeleteAll().
- */
-static void
-delete_bufferobj_cb(GLuint id, void *data, void *userData)
-{
- struct gl_buffer_object *bufObj = (struct gl_buffer_object *) data;
- struct gl_context *ctx = (struct gl_context *) userData;
- if (_mesa_bufferobj_mapped(bufObj)) {
- ctx->Driver.UnmapBuffer(ctx, 0, bufObj);
- bufObj->Pointer = NULL;
- }
- _mesa_reference_buffer_object(ctx, &bufObj, NULL);
-}
-
-
-/**
- * Callback for freeing shader program data. Call it before delete_shader_cb
- * to avoid memory access error.
- */
-static void
-free_shader_program_data_cb(GLuint id, void *data, void *userData)
-{
- struct gl_context *ctx = (struct gl_context *) userData;
- struct gl_shader_program *shProg = (struct gl_shader_program *) data;
-
- if (shProg->Type == GL_SHADER_PROGRAM_MESA) {
- _mesa_free_shader_program_data(ctx, shProg);
- }
-}
-
-
-/**
- * Callback for deleting shader and shader programs objects.
- * Called by _mesa_HashDeleteAll().
- */
-static void
-delete_shader_cb(GLuint id, void *data, void *userData)
-{
- struct gl_context *ctx = (struct gl_context *) userData;
- struct gl_shader *sh = (struct gl_shader *) data;
- if (sh->Type == GL_FRAGMENT_SHADER || sh->Type == GL_VERTEX_SHADER) {
- ctx->Driver.DeleteShader(ctx, sh);
- }
- else {
- struct gl_shader_program *shProg = (struct gl_shader_program *) data;
- ASSERT(shProg->Type == GL_SHADER_PROGRAM_MESA);
- ctx->Driver.DeleteShaderProgram(ctx, shProg);
- }
-}
-
-
-/**
- * Callback for deleting a framebuffer object. Called by _mesa_HashDeleteAll()
- */
-static void
-delete_framebuffer_cb(GLuint id, void *data, void *userData)
-{
- struct gl_framebuffer *fb = (struct gl_framebuffer *) data;
- /* The fact that the framebuffer is in the hashtable means its refcount
- * is one, but we're removing from the hashtable now. So clear refcount.
- */
- /*assert(fb->RefCount == 1);*/
- fb->RefCount = 0;
-
- /* NOTE: Delete should always be defined but there are two reports
- * of it being NULL (bugs 13507, 14293). Work-around for now.
- */
- if (fb->Delete)
- fb->Delete(fb);
-}
-
-
-/**
- * Callback for deleting a renderbuffer object. Called by _mesa_HashDeleteAll()
- */
-static void
-delete_renderbuffer_cb(GLuint id, void *data, void *userData)
-{
- struct gl_renderbuffer *rb = (struct gl_renderbuffer *) data;
- rb->RefCount = 0; /* see comment for FBOs above */
- if (rb->Delete)
- rb->Delete(rb);
-}
-
-
-#if FEATURE_ARB_sampler_objects
-/**
- * Callback for deleting a sampler object. Called by _mesa_HashDeleteAll()
- */
-static void
-delete_sampler_object_cb(GLuint id, void *data, void *userData)
-{
- struct gl_context *ctx = (struct gl_context *) userData;
- struct gl_sampler_object *sampObj = (struct gl_sampler_object *) data;
- _mesa_reference_sampler_object(ctx, &sampObj, NULL);
-}
-#endif
-
-
-/**
- * Deallocate a shared state object and all children structures.
- *
- * \param ctx GL context.
- * \param shared shared state pointer.
- *
- * Frees the display lists, the texture objects (calling the driver texture
- * deletion callback to free its private data) and the vertex programs, as well
- * as their hash tables.
- *
- * \sa alloc_shared_state().
- */
-static void
-free_shared_state(struct gl_context *ctx, struct gl_shared_state *shared)
-{
- GLuint i;
-
- /* Free the dummy/fallback texture object */
- if (shared->FallbackTex)
- ctx->Driver.DeleteTexture(ctx, shared->FallbackTex);
-
- /*
- * Free display lists
- */
- _mesa_HashDeleteAll(shared->DisplayList, delete_displaylist_cb, ctx);
- _mesa_DeleteHashTable(shared->DisplayList);
-
-#if FEATURE_ARB_shader_objects
- _mesa_HashWalk(shared->ShaderObjects, free_shader_program_data_cb, ctx);
- _mesa_HashDeleteAll(shared->ShaderObjects, delete_shader_cb, ctx);
- _mesa_DeleteHashTable(shared->ShaderObjects);
-#endif
-
- _mesa_HashDeleteAll(shared->Programs, delete_program_cb, ctx);
- _mesa_DeleteHashTable(shared->Programs);
-
-#if FEATURE_ARB_vertex_program
- _mesa_reference_vertprog(ctx, &shared->DefaultVertexProgram, NULL);
-#endif
-
-#if FEATURE_ARB_fragment_program
- _mesa_reference_fragprog(ctx, &shared->DefaultFragmentProgram, NULL);
-#endif
-
-#if FEATURE_ATI_fragment_shader
- _mesa_HashDeleteAll(shared->ATIShaders, delete_fragshader_cb, ctx);
- _mesa_DeleteHashTable(shared->ATIShaders);
- _mesa_delete_ati_fragment_shader(ctx, shared->DefaultFragmentShader);
-#endif
-
-#if FEATURE_ARB_vertex_buffer_object || FEATURE_ARB_pixel_buffer_object
- _mesa_HashDeleteAll(shared->BufferObjects, delete_bufferobj_cb, ctx);
- _mesa_DeleteHashTable(shared->BufferObjects);
-#endif
-
-#if FEATURE_EXT_framebuffer_object
- _mesa_HashDeleteAll(shared->FrameBuffers, delete_framebuffer_cb, ctx);
- _mesa_DeleteHashTable(shared->FrameBuffers);
- _mesa_HashDeleteAll(shared->RenderBuffers, delete_renderbuffer_cb, ctx);
- _mesa_DeleteHashTable(shared->RenderBuffers);
-#endif
-
-#if FEATURE_ARB_vertex_buffer_object
- _mesa_reference_buffer_object(ctx, &shared->NullBufferObj, NULL);
-#endif
-
- {
- struct simple_node *node;
- struct simple_node *temp;
-
- foreach_s(node, temp, & shared->SyncObjects) {
- _mesa_unref_sync_object(ctx, (struct gl_sync_object *) node);
- }
- }
-
-#if FEATURE_ARB_sampler_objects
- _mesa_HashDeleteAll(shared->SamplerObjects, delete_sampler_object_cb, ctx);
- _mesa_DeleteHashTable(shared->SamplerObjects);
-#endif
-
- /*
- * Free texture objects (after FBOs since some textures might have
- * been bound to FBOs).
- */
- ASSERT(ctx->Driver.DeleteTexture);
- /* the default textures */
- for (i = 0; i < NUM_TEXTURE_TARGETS; i++) {
- ctx->Driver.DeleteTexture(ctx, shared->DefaultTex[i]);
- }
-
- /* all other textures */
- _mesa_HashDeleteAll(shared->TexObjects, delete_texture_cb, ctx);
- _mesa_DeleteHashTable(shared->TexObjects);
-
- _glthread_DESTROY_MUTEX(shared->Mutex);
- _glthread_DESTROY_MUTEX(shared->TexMutex);
-
- free(shared);
-}
-
-
-/**
- * Decrement shared state object reference count and potentially free it
- * and all children structures.
- *
- * \param ctx GL context.
- * \param shared shared state pointer.
- *
- * \sa free_shared_state().
- */
-void
-_mesa_release_shared_state(struct gl_context *ctx,
- struct gl_shared_state *shared)
-{
- GLint RefCount;
-
- _glthread_LOCK_MUTEX(shared->Mutex);
- RefCount = --shared->RefCount;
- _glthread_UNLOCK_MUTEX(shared->Mutex);
-
- assert(RefCount >= 0);
-
- if (RefCount == 0) {
- /* free shared state */
- free_shared_state( ctx, shared );
- }
-}
+/*
+ * Mesa 3-D graphics library
+ * Version: 7.5
+ *
+ * Copyright (C) 2009 VMware, Inc. All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+/**
+ * \file shared.c
+ * Shared-context state
+ */
+
+#include "imports.h"
+#include "mfeatures.h"
+#include "mtypes.h"
+#include "hash.h"
+#if FEATURE_ATI_fragment_shader
+#include "atifragshader.h"
+#endif
+#include "bufferobj.h"
+#include "shared.h"
+#include "program/program.h"
+#include "dlist.h"
+#if FEATURE_ARB_sampler_objects
+#include "samplerobj.h"
+#endif
+#include "shaderobj.h"
+#include "syncobj.h"
+
+
+/**
+ * Allocate and initialize a shared context state structure.
+ * Initializes the display list, texture objects and vertex programs hash
+ * tables, allocates the texture objects. If it runs out of memory, frees
+ * everything already allocated before returning NULL.
+ *
+ * \return pointer to a gl_shared_state structure on success, or NULL on
+ * failure.
+ */
+struct gl_shared_state *
+_mesa_alloc_shared_state(struct gl_context *ctx)
+{
+ struct gl_shared_state *shared;
+ GLuint i;
+
+ shared = CALLOC_STRUCT(gl_shared_state);
+ if (!shared)
+ return NULL;
+
+ _glthread_INIT_MUTEX(shared->Mutex);
+
+ shared->DisplayList = _mesa_NewHashTable();
+ shared->TexObjects = _mesa_NewHashTable();
+ shared->Programs = _mesa_NewHashTable();
+
+#if FEATURE_ARB_vertex_program
+ shared->DefaultVertexProgram = (struct gl_vertex_program *)
+ ctx->Driver.NewProgram(ctx, GL_VERTEX_PROGRAM_ARB, 0);
+#endif
+
+#if FEATURE_ARB_fragment_program
+ shared->DefaultFragmentProgram = (struct gl_fragment_program *)
+ ctx->Driver.NewProgram(ctx, GL_FRAGMENT_PROGRAM_ARB, 0);
+#endif
+
+#if FEATURE_ATI_fragment_shader
+ shared->ATIShaders = _mesa_NewHashTable();
+ shared->DefaultFragmentShader = _mesa_new_ati_fragment_shader(ctx, 0);
+#endif
+
+#if FEATURE_ARB_shader_objects
+ shared->ShaderObjects = _mesa_NewHashTable();
+#endif
+
+#if FEATURE_ARB_vertex_buffer_object || FEATURE_ARB_pixel_buffer_object
+ shared->BufferObjects = _mesa_NewHashTable();
+#endif
+
+#if FEATURE_ARB_sampler_objects
+ /* GL_ARB_sampler_objects */
+ shared->SamplerObjects = _mesa_NewHashTable();
+#endif
+
+ /* Allocate the default buffer object */
+ shared->NullBufferObj = ctx->Driver.NewBufferObject(ctx, 0, 0);
+
+ /* Create default texture objects */
+ for (i = 0; i < NUM_TEXTURE_TARGETS; i++) {
+ /* NOTE: the order of these enums matches the TEXTURE_x_INDEX values */
+ static const GLenum targets[NUM_TEXTURE_TARGETS] = {
+ GL_TEXTURE_BUFFER,
+ GL_TEXTURE_2D_ARRAY_EXT,
+ GL_TEXTURE_1D_ARRAY_EXT,
+ GL_TEXTURE_CUBE_MAP,
+ GL_TEXTURE_3D,
+ GL_TEXTURE_RECTANGLE_NV,
+ GL_TEXTURE_2D,
+ GL_TEXTURE_1D
+ };
+ assert(Elements(targets) == NUM_TEXTURE_TARGETS);
+ shared->DefaultTex[i] = ctx->Driver.NewTextureObject(ctx, 0, targets[i]);
+ }
+
+ /* sanity check */
+ assert(shared->DefaultTex[TEXTURE_1D_INDEX]->RefCount == 1);
+
+ /* Mutex and timestamp for texobj state validation */
+ _glthread_INIT_MUTEX(shared->TexMutex);
+ shared->TextureStateStamp = 0;
+
+#if FEATURE_EXT_framebuffer_object
+ shared->FrameBuffers = _mesa_NewHashTable();
+ shared->RenderBuffers = _mesa_NewHashTable();
+#endif
+
+ make_empty_list(& shared->SyncObjects);
+
+ return shared;
+}
+
+
+/**
+ * Callback for deleting a display list. Called by _mesa_HashDeleteAll().
+ */
+static void
+delete_displaylist_cb(GLuint id, void *data, void *userData)
+{
+ struct gl_display_list *list = (struct gl_display_list *) data;
+ struct gl_context *ctx = (struct gl_context *) userData;
+ _mesa_delete_list(ctx, list);
+}
+
+
+/**
+ * Callback for deleting a texture object. Called by _mesa_HashDeleteAll().
+ */
+static void
+delete_texture_cb(GLuint id, void *data, void *userData)
+{
+ struct gl_texture_object *texObj = (struct gl_texture_object *) data;
+ struct gl_context *ctx = (struct gl_context *) userData;
+ ctx->Driver.DeleteTexture(ctx, texObj);
+}
+
+
+/**
+ * Callback for deleting a program object. Called by _mesa_HashDeleteAll().
+ */
+static void
+delete_program_cb(GLuint id, void *data, void *userData)
+{
+ struct gl_program *prog = (struct gl_program *) data;
+ struct gl_context *ctx = (struct gl_context *) userData;
+ if(prog != &_mesa_DummyProgram) {
+ ASSERT(prog->RefCount == 1); /* should only be referenced by hash table */
+ prog->RefCount = 0; /* now going away */
+ ctx->Driver.DeleteProgram(ctx, prog);
+ }
+}
+
+
+#if FEATURE_ATI_fragment_shader
+/**
+ * Callback for deleting an ATI fragment shader object.
+ * Called by _mesa_HashDeleteAll().
+ */
+static void
+delete_fragshader_cb(GLuint id, void *data, void *userData)
+{
+ struct ati_fragment_shader *shader = (struct ati_fragment_shader *) data;
+ struct gl_context *ctx = (struct gl_context *) userData;
+ _mesa_delete_ati_fragment_shader(ctx, shader);
+}
+#endif
+
+
+/**
+ * Callback for deleting a buffer object. Called by _mesa_HashDeleteAll().
+ */
+static void
+delete_bufferobj_cb(GLuint id, void *data, void *userData)
+{
+ struct gl_buffer_object *bufObj = (struct gl_buffer_object *) data;
+ struct gl_context *ctx = (struct gl_context *) userData;
+ if (_mesa_bufferobj_mapped(bufObj)) {
+ ctx->Driver.UnmapBuffer(ctx, 0, bufObj);
+ bufObj->Pointer = NULL;
+ }
+ _mesa_reference_buffer_object(ctx, &bufObj, NULL);
+}
+
+
+/**
+ * Callback for freeing shader program data. Call it before delete_shader_cb
+ * to avoid memory access error.
+ */
+static void
+free_shader_program_data_cb(GLuint id, void *data, void *userData)
+{
+ struct gl_context *ctx = (struct gl_context *) userData;
+ struct gl_shader_program *shProg = (struct gl_shader_program *) data;
+
+ if (shProg->Type == GL_SHADER_PROGRAM_MESA) {
+ _mesa_free_shader_program_data(ctx, shProg);
+ }
+}
+
+
+/**
+ * Callback for deleting shader and shader programs objects.
+ * Called by _mesa_HashDeleteAll().
+ */
+static void
+delete_shader_cb(GLuint id, void *data, void *userData)
+{
+ struct gl_context *ctx = (struct gl_context *) userData;
+ struct gl_shader *sh = (struct gl_shader *) data;
+ if (sh->Type == GL_FRAGMENT_SHADER || sh->Type == GL_VERTEX_SHADER) {
+ ctx->Driver.DeleteShader(ctx, sh);
+ }
+ else {
+ struct gl_shader_program *shProg = (struct gl_shader_program *) data;
+ ASSERT(shProg->Type == GL_SHADER_PROGRAM_MESA);
+ ctx->Driver.DeleteShaderProgram(ctx, shProg);
+ }
+}
+
+
+/**
+ * Callback for deleting a framebuffer object. Called by _mesa_HashDeleteAll()
+ */
+static void
+delete_framebuffer_cb(GLuint id, void *data, void *userData)
+{
+ struct gl_framebuffer *fb = (struct gl_framebuffer *) data;
+ /* The fact that the framebuffer is in the hashtable means its refcount
+ * is one, but we're removing from the hashtable now. So clear refcount.
+ */
+ /*assert(fb->RefCount == 1);*/
+ fb->RefCount = 0;
+
+ /* NOTE: Delete should always be defined but there are two reports
+ * of it being NULL (bugs 13507, 14293). Work-around for now.
+ */
+ if (fb->Delete)
+ fb->Delete(fb);
+}
+
+
+/**
+ * Callback for deleting a renderbuffer object. Called by _mesa_HashDeleteAll()
+ */
+static void
+delete_renderbuffer_cb(GLuint id, void *data, void *userData)
+{
+ struct gl_renderbuffer *rb = (struct gl_renderbuffer *) data;
+ rb->RefCount = 0; /* see comment for FBOs above */
+ if (rb->Delete)
+ rb->Delete(rb);
+}
+
+
+#if FEATURE_ARB_sampler_objects
+/**
+ * Callback for deleting a sampler object. Called by _mesa_HashDeleteAll()
+ */
+static void
+delete_sampler_object_cb(GLuint id, void *data, void *userData)
+{
+ struct gl_context *ctx = (struct gl_context *) userData;
+ struct gl_sampler_object *sampObj = (struct gl_sampler_object *) data;
+ _mesa_reference_sampler_object(ctx, &sampObj, NULL);
+}
+#endif
+
+
+/**
+ * Deallocate a shared state object and all children structures.
+ *
+ * \param ctx GL context.
+ * \param shared shared state pointer.
+ *
+ * Frees the display lists, the texture objects (calling the driver texture
+ * deletion callback to free its private data) and the vertex programs, as well
+ * as their hash tables.
+ *
+ * \sa alloc_shared_state().
+ */
+static void
+free_shared_state(struct gl_context *ctx, struct gl_shared_state *shared)
+{
+ GLuint i;
+
+ /* Free the dummy/fallback texture object */
+ if (shared->FallbackTex)
+ ctx->Driver.DeleteTexture(ctx, shared->FallbackTex);
+
+ /*
+ * Free display lists
+ */
+ _mesa_HashDeleteAll(shared->DisplayList, delete_displaylist_cb, ctx);
+ _mesa_DeleteHashTable(shared->DisplayList);
+
+#if FEATURE_ARB_shader_objects
+ _mesa_HashWalk(shared->ShaderObjects, free_shader_program_data_cb, ctx);
+ _mesa_HashDeleteAll(shared->ShaderObjects, delete_shader_cb, ctx);
+ _mesa_DeleteHashTable(shared->ShaderObjects);
+#endif
+
+ _mesa_HashDeleteAll(shared->Programs, delete_program_cb, ctx);
+ _mesa_DeleteHashTable(shared->Programs);
+
+#if FEATURE_ARB_vertex_program
+ _mesa_reference_vertprog(ctx, &shared->DefaultVertexProgram, NULL);
+#endif
+
+#if FEATURE_ARB_fragment_program
+ _mesa_reference_fragprog(ctx, &shared->DefaultFragmentProgram, NULL);
+#endif
+
+#if FEATURE_ATI_fragment_shader
+ _mesa_HashDeleteAll(shared->ATIShaders, delete_fragshader_cb, ctx);
+ _mesa_DeleteHashTable(shared->ATIShaders);
+ _mesa_delete_ati_fragment_shader(ctx, shared->DefaultFragmentShader);
+#endif
+
+#if FEATURE_ARB_vertex_buffer_object || FEATURE_ARB_pixel_buffer_object
+ _mesa_HashDeleteAll(shared->BufferObjects, delete_bufferobj_cb, ctx);
+ _mesa_DeleteHashTable(shared->BufferObjects);
+#endif
+
+#if FEATURE_EXT_framebuffer_object
+ _mesa_HashDeleteAll(shared->FrameBuffers, delete_framebuffer_cb, ctx);
+ _mesa_DeleteHashTable(shared->FrameBuffers);
+ _mesa_HashDeleteAll(shared->RenderBuffers, delete_renderbuffer_cb, ctx);
+ _mesa_DeleteHashTable(shared->RenderBuffers);
+#endif
+
+#if FEATURE_ARB_vertex_buffer_object
+ _mesa_reference_buffer_object(ctx, &shared->NullBufferObj, NULL);
+#endif
+
+ {
+ struct simple_node *node;
+ struct simple_node *temp;
+
+ foreach_s(node, temp, & shared->SyncObjects) {
+ _mesa_unref_sync_object(ctx, (struct gl_sync_object *) node);
+ }
+ }
+
+#if FEATURE_ARB_sampler_objects
+ _mesa_HashDeleteAll(shared->SamplerObjects, delete_sampler_object_cb, ctx);
+ _mesa_DeleteHashTable(shared->SamplerObjects);
+#endif
+
+ /*
+ * Free texture objects (after FBOs since some textures might have
+ * been bound to FBOs).
+ */
+ ASSERT(ctx->Driver.DeleteTexture);
+ /* the default textures */
+ for (i = 0; i < NUM_TEXTURE_TARGETS; i++) {
+ ctx->Driver.DeleteTexture(ctx, shared->DefaultTex[i]);
+ }
+
+ /* all other textures */
+ _mesa_HashDeleteAll(shared->TexObjects, delete_texture_cb, ctx);
+ _mesa_DeleteHashTable(shared->TexObjects);
+
+ _glthread_DESTROY_MUTEX(shared->Mutex);
+ _glthread_DESTROY_MUTEX(shared->TexMutex);
+
+ free(shared);
+}
+
+
+/**
+ * Decrement shared state object reference count and potentially free it
+ * and all children structures.
+ *
+ * \param ctx GL context.
+ * \param shared shared state pointer.
+ *
+ * \sa free_shared_state().
+ */
+void
+_mesa_release_shared_state(struct gl_context *ctx,
+ struct gl_shared_state *shared)
+{
+ GLint RefCount;
+
+ _glthread_LOCK_MUTEX(shared->Mutex);
+ RefCount = --shared->RefCount;
+ _glthread_UNLOCK_MUTEX(shared->Mutex);
+
+ assert(RefCount >= 0);
+
+ if (RefCount == 0) {
+ /* free shared state */
+ free_shared_state( ctx, shared );
+ }
+}
diff --git a/mesalib/src/mesa/main/shared.h b/mesalib/src/mesa/main/shared.h
index 55516a8c3..4e0ca2203 100644
--- a/mesalib/src/mesa/main/shared.h
+++ b/mesalib/src/mesa/main/shared.h
@@ -1,39 +1,39 @@
-/*
- * Mesa 3-D graphics library
- * Version: 7.5
- *
- * Copyright (C) 2009 VMware, Inc. All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-#ifndef SHARED_H
-#define SHARED_H
-
-struct gl_context;
-
-struct gl_shared_state *
-_mesa_alloc_shared_state(struct gl_context *ctx);
-
-
-void
-_mesa_release_shared_state(struct gl_context *ctx,
- struct gl_shared_state *shared);
-
-
-#endif
+/*
+ * Mesa 3-D graphics library
+ * Version: 7.5
+ *
+ * Copyright (C) 2009 VMware, Inc. All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+#ifndef SHARED_H
+#define SHARED_H
+
+struct gl_context;
+
+struct gl_shared_state *
+_mesa_alloc_shared_state(struct gl_context *ctx);
+
+
+void
+_mesa_release_shared_state(struct gl_context *ctx,
+ struct gl_shared_state *shared);
+
+
+#endif
diff --git a/mesalib/src/mesa/main/state.c b/mesalib/src/mesa/main/state.c
index 4696dbb52..685bee010 100644
--- a/mesalib/src/mesa/main/state.c
+++ b/mesalib/src/mesa/main/state.c
@@ -1,743 +1,743 @@
-/*
- * Mesa 3-D graphics library
- * Version: 7.3
- *
- * Copyright (C) 1999-2008 Brian Paul All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-
-/**
- * \file state.c
- * State management.
- *
- * This file manages recalculation of derived values in struct gl_context.
- */
-
-
-#include "glheader.h"
-#include "mtypes.h"
-#include "context.h"
-#include "debug.h"
-#include "macros.h"
-#include "ffvertex_prog.h"
-#include "framebuffer.h"
-#include "light.h"
-#include "matrix.h"
-#include "pixel.h"
-#include "program/program.h"
-#include "program/prog_parameter.h"
-#include "state.h"
-#include "stencil.h"
-#include "texenvprogram.h"
-#include "texobj.h"
-#include "texstate.h"
-#include "varray.h"
-
-
-static void
-update_separate_specular(struct gl_context *ctx)
-{
- if (_mesa_need_secondary_color(ctx))
- ctx->_TriangleCaps |= DD_SEPARATE_SPECULAR;
- else
- ctx->_TriangleCaps &= ~DD_SEPARATE_SPECULAR;
-}
-
-
-/**
- * Helper for update_arrays().
- * \return min(current min, array->_MaxElement).
- */
-static GLuint
-update_min(GLuint min, struct gl_client_array *array)
-{
- _mesa_update_array_max_element(array);
- return MIN2(min, array->_MaxElement);
-}
-
-
-/**
- * Update ctx->Array._MaxElement (the max legal index into all enabled arrays).
- * Need to do this upon new array state or new buffer object state.
- */
-static void
-update_arrays( struct gl_context *ctx )
-{
- struct gl_array_object *arrayObj = ctx->Array.ArrayObj;
- GLuint i, min = ~0;
-
- /* find min of _MaxElement values for all enabled arrays */
-
- /* 0 */
- if (ctx->VertexProgram._Current
- && arrayObj->VertexAttrib[VERT_ATTRIB_POS].Enabled) {
- min = update_min(min, &arrayObj->VertexAttrib[VERT_ATTRIB_POS]);
- }
- else if (arrayObj->Vertex.Enabled) {
- min = update_min(min, &arrayObj->Vertex);
- }
-
- /* 1 */
- if (ctx->VertexProgram._Enabled
- && arrayObj->VertexAttrib[VERT_ATTRIB_WEIGHT].Enabled) {
- min = update_min(min, &arrayObj->VertexAttrib[VERT_ATTRIB_WEIGHT]);
- }
- /* no conventional vertex weight array */
-
- /* 2 */
- if (ctx->VertexProgram._Enabled
- && arrayObj->VertexAttrib[VERT_ATTRIB_NORMAL].Enabled) {
- min = update_min(min, &arrayObj->VertexAttrib[VERT_ATTRIB_NORMAL]);
- }
- else if (arrayObj->Normal.Enabled) {
- min = update_min(min, &arrayObj->Normal);
- }
-
- /* 3 */
- if (ctx->VertexProgram._Enabled
- && arrayObj->VertexAttrib[VERT_ATTRIB_COLOR0].Enabled) {
- min = update_min(min, &arrayObj->VertexAttrib[VERT_ATTRIB_COLOR0]);
- }
- else if (arrayObj->Color.Enabled) {
- min = update_min(min, &arrayObj->Color);
- }
-
- /* 4 */
- if (ctx->VertexProgram._Enabled
- && arrayObj->VertexAttrib[VERT_ATTRIB_COLOR1].Enabled) {
- min = update_min(min, &arrayObj->VertexAttrib[VERT_ATTRIB_COLOR1]);
- }
- else if (arrayObj->SecondaryColor.Enabled) {
- min = update_min(min, &arrayObj->SecondaryColor);
- }
-
- /* 5 */
- if (ctx->VertexProgram._Enabled
- && arrayObj->VertexAttrib[VERT_ATTRIB_FOG].Enabled) {
- min = update_min(min, &arrayObj->VertexAttrib[VERT_ATTRIB_FOG]);
- }
- else if (arrayObj->FogCoord.Enabled) {
- min = update_min(min, &arrayObj->FogCoord);
- }
-
- /* 6 */
- if (ctx->VertexProgram._Enabled
- && arrayObj->VertexAttrib[VERT_ATTRIB_COLOR_INDEX].Enabled) {
- min = update_min(min, &arrayObj->VertexAttrib[VERT_ATTRIB_COLOR_INDEX]);
- }
- else if (arrayObj->Index.Enabled) {
- min = update_min(min, &arrayObj->Index);
- }
-
- /* 7 */
- if (ctx->VertexProgram._Enabled
- && arrayObj->VertexAttrib[VERT_ATTRIB_EDGEFLAG].Enabled) {
- min = update_min(min, &arrayObj->VertexAttrib[VERT_ATTRIB_EDGEFLAG]);
- }
-
- /* 8..15 */
- for (i = VERT_ATTRIB_TEX0; i <= VERT_ATTRIB_TEX7; i++) {
- if (ctx->VertexProgram._Enabled
- && arrayObj->VertexAttrib[i].Enabled) {
- min = update_min(min, &arrayObj->VertexAttrib[i]);
- }
- else if (i - VERT_ATTRIB_TEX0 < ctx->Const.MaxTextureCoordUnits
- && arrayObj->TexCoord[i - VERT_ATTRIB_TEX0].Enabled) {
- min = update_min(min, &arrayObj->TexCoord[i - VERT_ATTRIB_TEX0]);
- }
- }
-
- /* 16..31 */
- if (ctx->VertexProgram._Current) {
- for (i = 0; i < Elements(arrayObj->VertexAttrib); i++) {
- if (arrayObj->VertexAttrib[i].Enabled) {
- min = update_min(min, &arrayObj->VertexAttrib[i]);
- }
- }
- }
-
- if (arrayObj->EdgeFlag.Enabled) {
- min = update_min(min, &arrayObj->EdgeFlag);
- }
-
- /* _MaxElement is one past the last legal array element */
- arrayObj->_MaxElement = min;
-}
-
-
-/**
- * Update the following fields:
- * ctx->VertexProgram._Enabled
- * ctx->FragmentProgram._Enabled
- * ctx->ATIFragmentShader._Enabled
- * This needs to be done before texture state validation.
- */
-static void
-update_program_enables(struct gl_context *ctx)
-{
- /* These _Enabled flags indicate if the program is enabled AND valid. */
- ctx->VertexProgram._Enabled = ctx->VertexProgram.Enabled
- && ctx->VertexProgram.Current->Base.Instructions;
- ctx->FragmentProgram._Enabled = ctx->FragmentProgram.Enabled
- && ctx->FragmentProgram.Current->Base.Instructions;
- ctx->ATIFragmentShader._Enabled = ctx->ATIFragmentShader.Enabled
- && ctx->ATIFragmentShader.Current->Instructions[0];
-}
-
-
-/**
- * Update vertex/fragment program state. In particular, update these fields:
- * ctx->VertexProgram._Current
- * ctx->VertexProgram._TnlProgram,
- * These point to the highest priority enabled vertex/fragment program or are
- * NULL if fixed-function processing is to be done.
- *
- * This function needs to be called after texture state validation in case
- * we're generating a fragment program from fixed-function texture state.
- *
- * \return bitfield which will indicate _NEW_PROGRAM state if a new vertex
- * or fragment program is being used.
- */
-static GLbitfield
-update_program(struct gl_context *ctx)
-{
- const struct gl_shader_program *vsProg = ctx->Shader.CurrentVertexProgram;
- const struct gl_shader_program *gsProg = ctx->Shader.CurrentGeometryProgram;
- const struct gl_shader_program *fsProg = ctx->Shader.CurrentFragmentProgram;
- const struct gl_vertex_program *prevVP = ctx->VertexProgram._Current;
- const struct gl_fragment_program *prevFP = ctx->FragmentProgram._Current;
- const struct gl_geometry_program *prevGP = ctx->GeometryProgram._Current;
- GLbitfield new_state = 0x0;
-
- /*
- * Set the ctx->VertexProgram._Current and ctx->FragmentProgram._Current
- * pointers to the programs that should be used for rendering. If either
- * is NULL, use fixed-function code paths.
- *
- * These programs may come from several sources. The priority is as
- * follows:
- * 1. OpenGL 2.0/ARB vertex/fragment shaders
- * 2. ARB/NV vertex/fragment programs
- * 3. Programs derived from fixed-function state.
- *
- * Note: it's possible for a vertex shader to get used with a fragment
- * program (and vice versa) here, but in practice that shouldn't ever
- * come up, or matter.
- */
-
- if (fsProg && fsProg->LinkStatus && fsProg->FragmentProgram) {
- /* Use shader programs */
- _mesa_reference_fragprog(ctx, &ctx->FragmentProgram._Current,
- fsProg->FragmentProgram);
- }
- else if (ctx->FragmentProgram._Enabled) {
- /* use user-defined vertex program */
- _mesa_reference_fragprog(ctx, &ctx->FragmentProgram._Current,
- ctx->FragmentProgram.Current);
- }
- else if (ctx->FragmentProgram._MaintainTexEnvProgram) {
- /* Use fragment program generated from fixed-function state.
- */
- _mesa_reference_fragprog(ctx, &ctx->FragmentProgram._Current,
- _mesa_get_fixed_func_fragment_program(ctx));
- _mesa_reference_fragprog(ctx, &ctx->FragmentProgram._TexEnvProgram,
- ctx->FragmentProgram._Current);
- }
- else {
- /* no fragment program */
- _mesa_reference_fragprog(ctx, &ctx->FragmentProgram._Current, NULL);
- }
-
- if (gsProg && gsProg->LinkStatus && gsProg->GeometryProgram) {
- /* Use shader programs */
- _mesa_reference_geomprog(ctx, &ctx->GeometryProgram._Current,
- gsProg->GeometryProgram);
- } else {
- /* no fragment program */
- _mesa_reference_geomprog(ctx, &ctx->GeometryProgram._Current, NULL);
- }
-
- /* Examine vertex program after fragment program as
- * _mesa_get_fixed_func_vertex_program() needs to know active
- * fragprog inputs.
- */
- if (vsProg && vsProg->LinkStatus && vsProg->VertexProgram) {
- /* Use shader programs */
- _mesa_reference_vertprog(ctx, &ctx->VertexProgram._Current,
- vsProg->VertexProgram);
- }
- else if (ctx->VertexProgram._Enabled) {
- /* use user-defined vertex program */
- _mesa_reference_vertprog(ctx, &ctx->VertexProgram._Current,
- ctx->VertexProgram.Current);
- }
- else if (ctx->VertexProgram._MaintainTnlProgram) {
- /* Use vertex program generated from fixed-function state.
- */
- _mesa_reference_vertprog(ctx, &ctx->VertexProgram._Current,
- _mesa_get_fixed_func_vertex_program(ctx));
- _mesa_reference_vertprog(ctx, &ctx->VertexProgram._TnlProgram,
- ctx->VertexProgram._Current);
- }
- else {
- /* no vertex program */
- _mesa_reference_vertprog(ctx, &ctx->VertexProgram._Current, NULL);
- }
-
- /* Let the driver know what's happening:
- */
- if (ctx->FragmentProgram._Current != prevFP) {
- new_state |= _NEW_PROGRAM;
- if (ctx->Driver.BindProgram) {
- ctx->Driver.BindProgram(ctx, GL_FRAGMENT_PROGRAM_ARB,
- (struct gl_program *) ctx->FragmentProgram._Current);
- }
- }
-
- if (ctx->GeometryProgram._Current != prevGP) {
- new_state |= _NEW_PROGRAM;
- if (ctx->Driver.BindProgram) {
- ctx->Driver.BindProgram(ctx, MESA_GEOMETRY_PROGRAM,
- (struct gl_program *) ctx->GeometryProgram._Current);
- }
- }
-
- if (ctx->VertexProgram._Current != prevVP) {
- new_state |= _NEW_PROGRAM;
- if (ctx->Driver.BindProgram) {
- ctx->Driver.BindProgram(ctx, GL_VERTEX_PROGRAM_ARB,
- (struct gl_program *) ctx->VertexProgram._Current);
- }
- }
-
- return new_state;
-}
-
-
-/**
- * Examine shader constants and return either _NEW_PROGRAM_CONSTANTS or 0.
- */
-static GLbitfield
-update_program_constants(struct gl_context *ctx)
-{
- GLbitfield new_state = 0x0;
-
- if (ctx->FragmentProgram._Current) {
- const struct gl_program_parameter_list *params =
- ctx->FragmentProgram._Current->Base.Parameters;
- if (params && params->StateFlags & ctx->NewState) {
- new_state |= _NEW_PROGRAM_CONSTANTS;
- }
- }
-
- if (ctx->GeometryProgram._Current) {
- const struct gl_program_parameter_list *params =
- ctx->GeometryProgram._Current->Base.Parameters;
- /*FIXME: StateFlags is always 0 because we have unnamed constant
- * not state changes */
- if (params /*&& params->StateFlags & ctx->NewState*/) {
- new_state |= _NEW_PROGRAM_CONSTANTS;
- }
- }
-
- if (ctx->VertexProgram._Current) {
- const struct gl_program_parameter_list *params =
- ctx->VertexProgram._Current->Base.Parameters;
- if (params && params->StateFlags & ctx->NewState) {
- new_state |= _NEW_PROGRAM_CONSTANTS;
- }
- }
-
- return new_state;
-}
-
-
-
-
-static void
-update_viewport_matrix(struct gl_context *ctx)
-{
- const GLfloat depthMax = ctx->DrawBuffer->_DepthMaxF;
-
- ASSERT(depthMax > 0);
-
- /* Compute scale and bias values. This is really driver-specific
- * and should be maintained elsewhere if at all.
- * NOTE: RasterPos uses this.
- */
- _math_matrix_viewport(&ctx->Viewport._WindowMap,
- ctx->Viewport.X, ctx->Viewport.Y,
- ctx->Viewport.Width, ctx->Viewport.Height,
- ctx->Viewport.Near, ctx->Viewport.Far,
- depthMax);
-}
-
-
-/**
- * Update derived multisample state.
- */
-static void
-update_multisample(struct gl_context *ctx)
-{
- ctx->Multisample._Enabled = GL_FALSE;
- if (ctx->Multisample.Enabled &&
- ctx->DrawBuffer &&
- ctx->DrawBuffer->Visual.sampleBuffers)
- ctx->Multisample._Enabled = GL_TRUE;
-}
-
-
-/**
- * Update derived color/blend/logicop state.
- */
-static void
-update_color(struct gl_context *ctx)
-{
- /* This is needed to support 1.1's RGB logic ops AND
- * 1.0's blending logicops.
- */
- ctx->Color._LogicOpEnabled = _mesa_rgba_logicop_enabled(ctx);
-}
-
-static void
-update_clamp_fragment_color(struct gl_context *ctx)
-{
- if(ctx->Color.ClampFragmentColor == GL_FIXED_ONLY_ARB)
- ctx->Color._ClampFragmentColor = !ctx->DrawBuffer || !ctx->DrawBuffer->Visual.floatMode;
- else
- ctx->Color._ClampFragmentColor = ctx->Color.ClampFragmentColor;
-}
-
-static void
-update_clamp_vertex_color(struct gl_context *ctx)
-{
- if(ctx->Light.ClampVertexColor == GL_FIXED_ONLY_ARB)
- ctx->Light._ClampVertexColor = !ctx->DrawBuffer || !ctx->DrawBuffer->Visual.floatMode;
- else
- ctx->Light._ClampVertexColor = ctx->Light.ClampVertexColor;
-}
-
-static void
-update_clamp_read_color(struct gl_context *ctx)
-{
- if(ctx->Color.ClampReadColor == GL_FIXED_ONLY_ARB)
- ctx->Color._ClampReadColor = !ctx->ReadBuffer || !ctx->ReadBuffer->Visual.floatMode;
- else
- ctx->Color._ClampReadColor = ctx->Color.ClampReadColor;
-}
-
-
-
-
-/*
- * Check polygon state and set DD_TRI_CULL_FRONT_BACK and/or DD_TRI_OFFSET
- * in ctx->_TriangleCaps if needed.
- */
-static void
-update_polygon(struct gl_context *ctx)
-{
- ctx->_TriangleCaps &= ~(DD_TRI_CULL_FRONT_BACK | DD_TRI_OFFSET);
-
- if (ctx->Polygon.CullFlag && ctx->Polygon.CullFaceMode == GL_FRONT_AND_BACK)
- ctx->_TriangleCaps |= DD_TRI_CULL_FRONT_BACK;
-
- if ( ctx->Polygon.OffsetPoint
- || ctx->Polygon.OffsetLine
- || ctx->Polygon.OffsetFill)
- ctx->_TriangleCaps |= DD_TRI_OFFSET;
-}
-
-
-/**
- * Update the ctx->_TriangleCaps bitfield.
- * XXX that bitfield should really go away someday!
- * This function must be called after other update_*() functions since
- * there are dependencies on some other derived values.
- */
-#if 0
-static void
-update_tricaps(struct gl_context *ctx, GLbitfield new_state)
-{
- ctx->_TriangleCaps = 0;
-
- /*
- * Points
- */
- if (1/*new_state & _NEW_POINT*/) {
- if (ctx->Point.SmoothFlag)
- ctx->_TriangleCaps |= DD_POINT_SMOOTH;
- if (ctx->Point._Attenuated)
- ctx->_TriangleCaps |= DD_POINT_ATTEN;
- }
-
- /*
- * Lines
- */
- if (1/*new_state & _NEW_LINE*/) {
- if (ctx->Line.SmoothFlag)
- ctx->_TriangleCaps |= DD_LINE_SMOOTH;
- if (ctx->Line.StippleFlag)
- ctx->_TriangleCaps |= DD_LINE_STIPPLE;
- }
-
- /*
- * Polygons
- */
- if (1/*new_state & _NEW_POLYGON*/) {
- if (ctx->Polygon.SmoothFlag)
- ctx->_TriangleCaps |= DD_TRI_SMOOTH;
- if (ctx->Polygon.StippleFlag)
- ctx->_TriangleCaps |= DD_TRI_STIPPLE;
- if (ctx->Polygon.FrontMode != GL_FILL
- || ctx->Polygon.BackMode != GL_FILL)
- ctx->_TriangleCaps |= DD_TRI_UNFILLED;
- if (ctx->Polygon.CullFlag
- && ctx->Polygon.CullFaceMode == GL_FRONT_AND_BACK)
- ctx->_TriangleCaps |= DD_TRI_CULL_FRONT_BACK;
- if (ctx->Polygon.OffsetPoint ||
- ctx->Polygon.OffsetLine ||
- ctx->Polygon.OffsetFill)
- ctx->_TriangleCaps |= DD_TRI_OFFSET;
- }
-
- /*
- * Lighting and shading
- */
- if (ctx->Light.Enabled && ctx->Light.Model.TwoSide)
- ctx->_TriangleCaps |= DD_TRI_LIGHT_TWOSIDE;
- if (ctx->Light.ShadeModel == GL_FLAT)
- ctx->_TriangleCaps |= DD_FLATSHADE;
- if (_mesa_need_secondary_color(ctx))
- ctx->_TriangleCaps |= DD_SEPARATE_SPECULAR;
-
- /*
- * Stencil
- */
- if (ctx->Stencil._TestTwoSide)
- ctx->_TriangleCaps |= DD_TRI_TWOSTENCIL;
-}
-#endif
-
-
-/**
- * Compute derived GL state.
- * If __struct gl_contextRec::NewState is non-zero then this function \b must
- * be called before rendering anything.
- *
- * Calls dd_function_table::UpdateState to perform any internal state
- * management necessary.
- *
- * \sa _mesa_update_modelview_project(), _mesa_update_texture(),
- * _mesa_update_buffer_bounds(),
- * _mesa_update_lighting() and _mesa_update_tnl_spaces().
- */
-void
-_mesa_update_state_locked( struct gl_context *ctx )
-{
- GLbitfield new_state = ctx->NewState;
- GLbitfield prog_flags = _NEW_PROGRAM;
- GLbitfield new_prog_state = 0x0;
-
- if (new_state == _NEW_CURRENT_ATTRIB)
- goto out;
-
- if (MESA_VERBOSE & VERBOSE_STATE)
- _mesa_print_state("_mesa_update_state", new_state);
-
- /* Determine which state flags effect vertex/fragment program state */
- if (ctx->FragmentProgram._MaintainTexEnvProgram) {
- prog_flags |= (_NEW_BUFFERS | _NEW_TEXTURE | _NEW_FOG |
- _NEW_ARRAY | _NEW_LIGHT | _NEW_POINT | _NEW_RENDERMODE |
- _NEW_PROGRAM | _NEW_FRAG_CLAMP);
- }
- if (ctx->VertexProgram._MaintainTnlProgram) {
- prog_flags |= (_NEW_ARRAY | _NEW_TEXTURE | _NEW_TEXTURE_MATRIX |
- _NEW_TRANSFORM | _NEW_POINT |
- _NEW_FOG | _NEW_LIGHT |
- _MESA_NEW_NEED_EYE_COORDS);
- }
-
- /*
- * Now update derived state info
- */
-
- if (new_state & prog_flags)
- update_program_enables( ctx );
-
- if (new_state & (_NEW_MODELVIEW|_NEW_PROJECTION))
- _mesa_update_modelview_project( ctx, new_state );
-
- if (new_state & (_NEW_PROGRAM|_NEW_TEXTURE|_NEW_TEXTURE_MATRIX))
- _mesa_update_texture( ctx, new_state );
-
- if (new_state & _NEW_BUFFERS)
- _mesa_update_framebuffer(ctx);
-
- if (new_state & (_NEW_SCISSOR | _NEW_BUFFERS | _NEW_VIEWPORT))
- _mesa_update_draw_buffer_bounds( ctx );
-
- if (new_state & _NEW_POLYGON)
- update_polygon( ctx );
-
- if (new_state & _NEW_LIGHT)
- _mesa_update_lighting( ctx );
-
- if (new_state & (_NEW_LIGHT | _NEW_BUFFERS))
- update_clamp_vertex_color(ctx);
-
- if (new_state & (_NEW_STENCIL | _NEW_BUFFERS))
- _mesa_update_stencil( ctx );
-
- if (new_state & _NEW_PIXEL)
- _mesa_update_pixel( ctx, new_state );
-
- if (new_state & _DD_NEW_SEPARATE_SPECULAR)
- update_separate_specular( ctx );
-
- if (new_state & (_NEW_BUFFERS | _NEW_VIEWPORT))
- update_viewport_matrix(ctx);
-
- if (new_state & _NEW_MULTISAMPLE)
- update_multisample( ctx );
-
- if (new_state & _NEW_COLOR)
- update_color( ctx );
-
- if (new_state & (_NEW_COLOR | _NEW_BUFFERS))
- update_clamp_read_color(ctx);
-
- if(new_state & (_NEW_FRAG_CLAMP | _NEW_BUFFERS))
- update_clamp_fragment_color(ctx);
-
-#if 0
- if (new_state & (_NEW_POINT | _NEW_LINE | _NEW_POLYGON | _NEW_LIGHT
- | _NEW_STENCIL | _DD_NEW_SEPARATE_SPECULAR))
- update_tricaps( ctx, new_state );
-#endif
-
- /* ctx->_NeedEyeCoords is now up to date.
- *
- * If the truth value of this variable has changed, update for the
- * new lighting space and recompute the positions of lights and the
- * normal transform.
- *
- * If the lighting space hasn't changed, may still need to recompute
- * light positions & normal transforms for other reasons.
- */
- if (new_state & _MESA_NEW_NEED_EYE_COORDS)
- _mesa_update_tnl_spaces( ctx, new_state );
-
- if (new_state & prog_flags) {
- /* When we generate programs from fixed-function vertex/fragment state
- * this call may generate/bind a new program. If so, we need to
- * propogate the _NEW_PROGRAM flag to the driver.
- */
- new_prog_state |= update_program( ctx );
- }
-
- if (new_state & (_NEW_ARRAY | _NEW_PROGRAM | _NEW_BUFFER_OBJECT))
- update_arrays( ctx );
-
- out:
- new_prog_state |= update_program_constants(ctx);
-
- /*
- * Give the driver a chance to act upon the new_state flags.
- * The driver might plug in different span functions, for example.
- * Also, this is where the driver can invalidate the state of any
- * active modules (such as swrast_setup, swrast, tnl, etc).
- *
- * Set ctx->NewState to zero to avoid recursion if
- * Driver.UpdateState() has to call FLUSH_VERTICES(). (fixed?)
- */
- new_state = ctx->NewState | new_prog_state;
- ctx->NewState = 0;
- ctx->Driver.UpdateState(ctx, new_state);
- ctx->Array.NewState = 0;
- if (!ctx->Array.RebindArrays)
- ctx->Array.RebindArrays = (new_state & (_NEW_ARRAY | _NEW_PROGRAM)) != 0;
-}
-
-
-/* This is the usual entrypoint for state updates:
- */
-void
-_mesa_update_state( struct gl_context *ctx )
-{
- _mesa_lock_context_textures(ctx);
- _mesa_update_state_locked(ctx);
- _mesa_unlock_context_textures(ctx);
-}
-
-
-
-
-/**
- * Want to figure out which fragment program inputs are actually
- * constant/current values from ctx->Current. These should be
- * referenced as a tracked state variable rather than a fragment
- * program input, to save the overhead of putting a constant value in
- * every submitted vertex, transferring it to hardware, interpolating
- * it across the triangle, etc...
- *
- * When there is a VP bound, just use vp->outputs. But when we're
- * generating vp from fixed function state, basically want to
- * calculate:
- *
- * vp_out_2_fp_in( vp_in_2_vp_out( varying_inputs ) |
- * potential_vp_outputs )
- *
- * Where potential_vp_outputs is calculated by looking at enabled
- * texgen, etc.
- *
- * The generated fragment program should then only declare inputs that
- * may vary or otherwise differ from the ctx->Current values.
- * Otherwise, the fp should track them as state values instead.
- */
-void
-_mesa_set_varying_vp_inputs( struct gl_context *ctx,
- GLbitfield varying_inputs )
-{
- if (ctx->varying_vp_inputs != varying_inputs) {
- ctx->varying_vp_inputs = varying_inputs;
- ctx->NewState |= _NEW_ARRAY;
- /*printf("%s %x\n", __FUNCTION__, varying_inputs);*/
- }
-}
-
-
-/**
- * Used by drivers to tell core Mesa that the driver is going to
- * install/ use its own vertex program. In particular, this will
- * prevent generated fragment programs from using state vars instead
- * of ordinary varyings/inputs.
- */
-void
-_mesa_set_vp_override(struct gl_context *ctx, GLboolean flag)
-{
- if (ctx->VertexProgram._Overriden != flag) {
- ctx->VertexProgram._Overriden = flag;
-
- /* Set one of the bits which will trigger fragment program
- * regeneration:
- */
- ctx->NewState |= _NEW_PROGRAM;
- }
-}
+/*
+ * Mesa 3-D graphics library
+ * Version: 7.3
+ *
+ * Copyright (C) 1999-2008 Brian Paul All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+
+/**
+ * \file state.c
+ * State management.
+ *
+ * This file manages recalculation of derived values in struct gl_context.
+ */
+
+
+#include "glheader.h"
+#include "mtypes.h"
+#include "context.h"
+#include "debug.h"
+#include "macros.h"
+#include "ffvertex_prog.h"
+#include "framebuffer.h"
+#include "light.h"
+#include "matrix.h"
+#include "pixel.h"
+#include "program/program.h"
+#include "program/prog_parameter.h"
+#include "state.h"
+#include "stencil.h"
+#include "texenvprogram.h"
+#include "texobj.h"
+#include "texstate.h"
+#include "varray.h"
+
+
+static void
+update_separate_specular(struct gl_context *ctx)
+{
+ if (_mesa_need_secondary_color(ctx))
+ ctx->_TriangleCaps |= DD_SEPARATE_SPECULAR;
+ else
+ ctx->_TriangleCaps &= ~DD_SEPARATE_SPECULAR;
+}
+
+
+/**
+ * Helper for update_arrays().
+ * \return min(current min, array->_MaxElement).
+ */
+static GLuint
+update_min(GLuint min, struct gl_client_array *array)
+{
+ _mesa_update_array_max_element(array);
+ return MIN2(min, array->_MaxElement);
+}
+
+
+/**
+ * Update ctx->Array._MaxElement (the max legal index into all enabled arrays).
+ * Need to do this upon new array state or new buffer object state.
+ */
+static void
+update_arrays( struct gl_context *ctx )
+{
+ struct gl_array_object *arrayObj = ctx->Array.ArrayObj;
+ GLuint i, min = ~0;
+
+ /* find min of _MaxElement values for all enabled arrays */
+
+ /* 0 */
+ if (ctx->VertexProgram._Current
+ && arrayObj->VertexAttrib[VERT_ATTRIB_POS].Enabled) {
+ min = update_min(min, &arrayObj->VertexAttrib[VERT_ATTRIB_POS]);
+ }
+ else if (arrayObj->Vertex.Enabled) {
+ min = update_min(min, &arrayObj->Vertex);
+ }
+
+ /* 1 */
+ if (ctx->VertexProgram._Enabled
+ && arrayObj->VertexAttrib[VERT_ATTRIB_WEIGHT].Enabled) {
+ min = update_min(min, &arrayObj->VertexAttrib[VERT_ATTRIB_WEIGHT]);
+ }
+ /* no conventional vertex weight array */
+
+ /* 2 */
+ if (ctx->VertexProgram._Enabled
+ && arrayObj->VertexAttrib[VERT_ATTRIB_NORMAL].Enabled) {
+ min = update_min(min, &arrayObj->VertexAttrib[VERT_ATTRIB_NORMAL]);
+ }
+ else if (arrayObj->Normal.Enabled) {
+ min = update_min(min, &arrayObj->Normal);
+ }
+
+ /* 3 */
+ if (ctx->VertexProgram._Enabled
+ && arrayObj->VertexAttrib[VERT_ATTRIB_COLOR0].Enabled) {
+ min = update_min(min, &arrayObj->VertexAttrib[VERT_ATTRIB_COLOR0]);
+ }
+ else if (arrayObj->Color.Enabled) {
+ min = update_min(min, &arrayObj->Color);
+ }
+
+ /* 4 */
+ if (ctx->VertexProgram._Enabled
+ && arrayObj->VertexAttrib[VERT_ATTRIB_COLOR1].Enabled) {
+ min = update_min(min, &arrayObj->VertexAttrib[VERT_ATTRIB_COLOR1]);
+ }
+ else if (arrayObj->SecondaryColor.Enabled) {
+ min = update_min(min, &arrayObj->SecondaryColor);
+ }
+
+ /* 5 */
+ if (ctx->VertexProgram._Enabled
+ && arrayObj->VertexAttrib[VERT_ATTRIB_FOG].Enabled) {
+ min = update_min(min, &arrayObj->VertexAttrib[VERT_ATTRIB_FOG]);
+ }
+ else if (arrayObj->FogCoord.Enabled) {
+ min = update_min(min, &arrayObj->FogCoord);
+ }
+
+ /* 6 */
+ if (ctx->VertexProgram._Enabled
+ && arrayObj->VertexAttrib[VERT_ATTRIB_COLOR_INDEX].Enabled) {
+ min = update_min(min, &arrayObj->VertexAttrib[VERT_ATTRIB_COLOR_INDEX]);
+ }
+ else if (arrayObj->Index.Enabled) {
+ min = update_min(min, &arrayObj->Index);
+ }
+
+ /* 7 */
+ if (ctx->VertexProgram._Enabled
+ && arrayObj->VertexAttrib[VERT_ATTRIB_EDGEFLAG].Enabled) {
+ min = update_min(min, &arrayObj->VertexAttrib[VERT_ATTRIB_EDGEFLAG]);
+ }
+
+ /* 8..15 */
+ for (i = VERT_ATTRIB_TEX0; i <= VERT_ATTRIB_TEX7; i++) {
+ if (ctx->VertexProgram._Enabled
+ && arrayObj->VertexAttrib[i].Enabled) {
+ min = update_min(min, &arrayObj->VertexAttrib[i]);
+ }
+ else if (i - VERT_ATTRIB_TEX0 < ctx->Const.MaxTextureCoordUnits
+ && arrayObj->TexCoord[i - VERT_ATTRIB_TEX0].Enabled) {
+ min = update_min(min, &arrayObj->TexCoord[i - VERT_ATTRIB_TEX0]);
+ }
+ }
+
+ /* 16..31 */
+ if (ctx->VertexProgram._Current) {
+ for (i = 0; i < Elements(arrayObj->VertexAttrib); i++) {
+ if (arrayObj->VertexAttrib[i].Enabled) {
+ min = update_min(min, &arrayObj->VertexAttrib[i]);
+ }
+ }
+ }
+
+ if (arrayObj->EdgeFlag.Enabled) {
+ min = update_min(min, &arrayObj->EdgeFlag);
+ }
+
+ /* _MaxElement is one past the last legal array element */
+ arrayObj->_MaxElement = min;
+}
+
+
+/**
+ * Update the following fields:
+ * ctx->VertexProgram._Enabled
+ * ctx->FragmentProgram._Enabled
+ * ctx->ATIFragmentShader._Enabled
+ * This needs to be done before texture state validation.
+ */
+static void
+update_program_enables(struct gl_context *ctx)
+{
+ /* These _Enabled flags indicate if the program is enabled AND valid. */
+ ctx->VertexProgram._Enabled = ctx->VertexProgram.Enabled
+ && ctx->VertexProgram.Current->Base.Instructions;
+ ctx->FragmentProgram._Enabled = ctx->FragmentProgram.Enabled
+ && ctx->FragmentProgram.Current->Base.Instructions;
+ ctx->ATIFragmentShader._Enabled = ctx->ATIFragmentShader.Enabled
+ && ctx->ATIFragmentShader.Current->Instructions[0];
+}
+
+
+/**
+ * Update vertex/fragment program state. In particular, update these fields:
+ * ctx->VertexProgram._Current
+ * ctx->VertexProgram._TnlProgram,
+ * These point to the highest priority enabled vertex/fragment program or are
+ * NULL if fixed-function processing is to be done.
+ *
+ * This function needs to be called after texture state validation in case
+ * we're generating a fragment program from fixed-function texture state.
+ *
+ * \return bitfield which will indicate _NEW_PROGRAM state if a new vertex
+ * or fragment program is being used.
+ */
+static GLbitfield
+update_program(struct gl_context *ctx)
+{
+ const struct gl_shader_program *vsProg = ctx->Shader.CurrentVertexProgram;
+ const struct gl_shader_program *gsProg = ctx->Shader.CurrentGeometryProgram;
+ const struct gl_shader_program *fsProg = ctx->Shader.CurrentFragmentProgram;
+ const struct gl_vertex_program *prevVP = ctx->VertexProgram._Current;
+ const struct gl_fragment_program *prevFP = ctx->FragmentProgram._Current;
+ const struct gl_geometry_program *prevGP = ctx->GeometryProgram._Current;
+ GLbitfield new_state = 0x0;
+
+ /*
+ * Set the ctx->VertexProgram._Current and ctx->FragmentProgram._Current
+ * pointers to the programs that should be used for rendering. If either
+ * is NULL, use fixed-function code paths.
+ *
+ * These programs may come from several sources. The priority is as
+ * follows:
+ * 1. OpenGL 2.0/ARB vertex/fragment shaders
+ * 2. ARB/NV vertex/fragment programs
+ * 3. Programs derived from fixed-function state.
+ *
+ * Note: it's possible for a vertex shader to get used with a fragment
+ * program (and vice versa) here, but in practice that shouldn't ever
+ * come up, or matter.
+ */
+
+ if (fsProg && fsProg->LinkStatus && fsProg->FragmentProgram) {
+ /* Use shader programs */
+ _mesa_reference_fragprog(ctx, &ctx->FragmentProgram._Current,
+ fsProg->FragmentProgram);
+ }
+ else if (ctx->FragmentProgram._Enabled) {
+ /* use user-defined vertex program */
+ _mesa_reference_fragprog(ctx, &ctx->FragmentProgram._Current,
+ ctx->FragmentProgram.Current);
+ }
+ else if (ctx->FragmentProgram._MaintainTexEnvProgram) {
+ /* Use fragment program generated from fixed-function state.
+ */
+ _mesa_reference_fragprog(ctx, &ctx->FragmentProgram._Current,
+ _mesa_get_fixed_func_fragment_program(ctx));
+ _mesa_reference_fragprog(ctx, &ctx->FragmentProgram._TexEnvProgram,
+ ctx->FragmentProgram._Current);
+ }
+ else {
+ /* no fragment program */
+ _mesa_reference_fragprog(ctx, &ctx->FragmentProgram._Current, NULL);
+ }
+
+ if (gsProg && gsProg->LinkStatus && gsProg->GeometryProgram) {
+ /* Use shader programs */
+ _mesa_reference_geomprog(ctx, &ctx->GeometryProgram._Current,
+ gsProg->GeometryProgram);
+ } else {
+ /* no fragment program */
+ _mesa_reference_geomprog(ctx, &ctx->GeometryProgram._Current, NULL);
+ }
+
+ /* Examine vertex program after fragment program as
+ * _mesa_get_fixed_func_vertex_program() needs to know active
+ * fragprog inputs.
+ */
+ if (vsProg && vsProg->LinkStatus && vsProg->VertexProgram) {
+ /* Use shader programs */
+ _mesa_reference_vertprog(ctx, &ctx->VertexProgram._Current,
+ vsProg->VertexProgram);
+ }
+ else if (ctx->VertexProgram._Enabled) {
+ /* use user-defined vertex program */
+ _mesa_reference_vertprog(ctx, &ctx->VertexProgram._Current,
+ ctx->VertexProgram.Current);
+ }
+ else if (ctx->VertexProgram._MaintainTnlProgram) {
+ /* Use vertex program generated from fixed-function state.
+ */
+ _mesa_reference_vertprog(ctx, &ctx->VertexProgram._Current,
+ _mesa_get_fixed_func_vertex_program(ctx));
+ _mesa_reference_vertprog(ctx, &ctx->VertexProgram._TnlProgram,
+ ctx->VertexProgram._Current);
+ }
+ else {
+ /* no vertex program */
+ _mesa_reference_vertprog(ctx, &ctx->VertexProgram._Current, NULL);
+ }
+
+ /* Let the driver know what's happening:
+ */
+ if (ctx->FragmentProgram._Current != prevFP) {
+ new_state |= _NEW_PROGRAM;
+ if (ctx->Driver.BindProgram) {
+ ctx->Driver.BindProgram(ctx, GL_FRAGMENT_PROGRAM_ARB,
+ (struct gl_program *) ctx->FragmentProgram._Current);
+ }
+ }
+
+ if (ctx->GeometryProgram._Current != prevGP) {
+ new_state |= _NEW_PROGRAM;
+ if (ctx->Driver.BindProgram) {
+ ctx->Driver.BindProgram(ctx, MESA_GEOMETRY_PROGRAM,
+ (struct gl_program *) ctx->GeometryProgram._Current);
+ }
+ }
+
+ if (ctx->VertexProgram._Current != prevVP) {
+ new_state |= _NEW_PROGRAM;
+ if (ctx->Driver.BindProgram) {
+ ctx->Driver.BindProgram(ctx, GL_VERTEX_PROGRAM_ARB,
+ (struct gl_program *) ctx->VertexProgram._Current);
+ }
+ }
+
+ return new_state;
+}
+
+
+/**
+ * Examine shader constants and return either _NEW_PROGRAM_CONSTANTS or 0.
+ */
+static GLbitfield
+update_program_constants(struct gl_context *ctx)
+{
+ GLbitfield new_state = 0x0;
+
+ if (ctx->FragmentProgram._Current) {
+ const struct gl_program_parameter_list *params =
+ ctx->FragmentProgram._Current->Base.Parameters;
+ if (params && params->StateFlags & ctx->NewState) {
+ new_state |= _NEW_PROGRAM_CONSTANTS;
+ }
+ }
+
+ if (ctx->GeometryProgram._Current) {
+ const struct gl_program_parameter_list *params =
+ ctx->GeometryProgram._Current->Base.Parameters;
+ /*FIXME: StateFlags is always 0 because we have unnamed constant
+ * not state changes */
+ if (params /*&& params->StateFlags & ctx->NewState*/) {
+ new_state |= _NEW_PROGRAM_CONSTANTS;
+ }
+ }
+
+ if (ctx->VertexProgram._Current) {
+ const struct gl_program_parameter_list *params =
+ ctx->VertexProgram._Current->Base.Parameters;
+ if (params && params->StateFlags & ctx->NewState) {
+ new_state |= _NEW_PROGRAM_CONSTANTS;
+ }
+ }
+
+ return new_state;
+}
+
+
+
+
+static void
+update_viewport_matrix(struct gl_context *ctx)
+{
+ const GLfloat depthMax = ctx->DrawBuffer->_DepthMaxF;
+
+ ASSERT(depthMax > 0);
+
+ /* Compute scale and bias values. This is really driver-specific
+ * and should be maintained elsewhere if at all.
+ * NOTE: RasterPos uses this.
+ */
+ _math_matrix_viewport(&ctx->Viewport._WindowMap,
+ ctx->Viewport.X, ctx->Viewport.Y,
+ ctx->Viewport.Width, ctx->Viewport.Height,
+ ctx->Viewport.Near, ctx->Viewport.Far,
+ depthMax);
+}
+
+
+/**
+ * Update derived multisample state.
+ */
+static void
+update_multisample(struct gl_context *ctx)
+{
+ ctx->Multisample._Enabled = GL_FALSE;
+ if (ctx->Multisample.Enabled &&
+ ctx->DrawBuffer &&
+ ctx->DrawBuffer->Visual.sampleBuffers)
+ ctx->Multisample._Enabled = GL_TRUE;
+}
+
+
+/**
+ * Update derived color/blend/logicop state.
+ */
+static void
+update_color(struct gl_context *ctx)
+{
+ /* This is needed to support 1.1's RGB logic ops AND
+ * 1.0's blending logicops.
+ */
+ ctx->Color._LogicOpEnabled = _mesa_rgba_logicop_enabled(ctx);
+}
+
+static void
+update_clamp_fragment_color(struct gl_context *ctx)
+{
+ if(ctx->Color.ClampFragmentColor == GL_FIXED_ONLY_ARB)
+ ctx->Color._ClampFragmentColor = !ctx->DrawBuffer || !ctx->DrawBuffer->Visual.floatMode;
+ else
+ ctx->Color._ClampFragmentColor = ctx->Color.ClampFragmentColor;
+}
+
+static void
+update_clamp_vertex_color(struct gl_context *ctx)
+{
+ if(ctx->Light.ClampVertexColor == GL_FIXED_ONLY_ARB)
+ ctx->Light._ClampVertexColor = !ctx->DrawBuffer || !ctx->DrawBuffer->Visual.floatMode;
+ else
+ ctx->Light._ClampVertexColor = ctx->Light.ClampVertexColor;
+}
+
+static void
+update_clamp_read_color(struct gl_context *ctx)
+{
+ if(ctx->Color.ClampReadColor == GL_FIXED_ONLY_ARB)
+ ctx->Color._ClampReadColor = !ctx->ReadBuffer || !ctx->ReadBuffer->Visual.floatMode;
+ else
+ ctx->Color._ClampReadColor = ctx->Color.ClampReadColor;
+}
+
+
+
+
+/*
+ * Check polygon state and set DD_TRI_CULL_FRONT_BACK and/or DD_TRI_OFFSET
+ * in ctx->_TriangleCaps if needed.
+ */
+static void
+update_polygon(struct gl_context *ctx)
+{
+ ctx->_TriangleCaps &= ~(DD_TRI_CULL_FRONT_BACK | DD_TRI_OFFSET);
+
+ if (ctx->Polygon.CullFlag && ctx->Polygon.CullFaceMode == GL_FRONT_AND_BACK)
+ ctx->_TriangleCaps |= DD_TRI_CULL_FRONT_BACK;
+
+ if ( ctx->Polygon.OffsetPoint
+ || ctx->Polygon.OffsetLine
+ || ctx->Polygon.OffsetFill)
+ ctx->_TriangleCaps |= DD_TRI_OFFSET;
+}
+
+
+/**
+ * Update the ctx->_TriangleCaps bitfield.
+ * XXX that bitfield should really go away someday!
+ * This function must be called after other update_*() functions since
+ * there are dependencies on some other derived values.
+ */
+#if 0
+static void
+update_tricaps(struct gl_context *ctx, GLbitfield new_state)
+{
+ ctx->_TriangleCaps = 0;
+
+ /*
+ * Points
+ */
+ if (1/*new_state & _NEW_POINT*/) {
+ if (ctx->Point.SmoothFlag)
+ ctx->_TriangleCaps |= DD_POINT_SMOOTH;
+ if (ctx->Point._Attenuated)
+ ctx->_TriangleCaps |= DD_POINT_ATTEN;
+ }
+
+ /*
+ * Lines
+ */
+ if (1/*new_state & _NEW_LINE*/) {
+ if (ctx->Line.SmoothFlag)
+ ctx->_TriangleCaps |= DD_LINE_SMOOTH;
+ if (ctx->Line.StippleFlag)
+ ctx->_TriangleCaps |= DD_LINE_STIPPLE;
+ }
+
+ /*
+ * Polygons
+ */
+ if (1/*new_state & _NEW_POLYGON*/) {
+ if (ctx->Polygon.SmoothFlag)
+ ctx->_TriangleCaps |= DD_TRI_SMOOTH;
+ if (ctx->Polygon.StippleFlag)
+ ctx->_TriangleCaps |= DD_TRI_STIPPLE;
+ if (ctx->Polygon.FrontMode != GL_FILL
+ || ctx->Polygon.BackMode != GL_FILL)
+ ctx->_TriangleCaps |= DD_TRI_UNFILLED;
+ if (ctx->Polygon.CullFlag
+ && ctx->Polygon.CullFaceMode == GL_FRONT_AND_BACK)
+ ctx->_TriangleCaps |= DD_TRI_CULL_FRONT_BACK;
+ if (ctx->Polygon.OffsetPoint ||
+ ctx->Polygon.OffsetLine ||
+ ctx->Polygon.OffsetFill)
+ ctx->_TriangleCaps |= DD_TRI_OFFSET;
+ }
+
+ /*
+ * Lighting and shading
+ */
+ if (ctx->Light.Enabled && ctx->Light.Model.TwoSide)
+ ctx->_TriangleCaps |= DD_TRI_LIGHT_TWOSIDE;
+ if (ctx->Light.ShadeModel == GL_FLAT)
+ ctx->_TriangleCaps |= DD_FLATSHADE;
+ if (_mesa_need_secondary_color(ctx))
+ ctx->_TriangleCaps |= DD_SEPARATE_SPECULAR;
+
+ /*
+ * Stencil
+ */
+ if (ctx->Stencil._TestTwoSide)
+ ctx->_TriangleCaps |= DD_TRI_TWOSTENCIL;
+}
+#endif
+
+
+/**
+ * Compute derived GL state.
+ * If __struct gl_contextRec::NewState is non-zero then this function \b must
+ * be called before rendering anything.
+ *
+ * Calls dd_function_table::UpdateState to perform any internal state
+ * management necessary.
+ *
+ * \sa _mesa_update_modelview_project(), _mesa_update_texture(),
+ * _mesa_update_buffer_bounds(),
+ * _mesa_update_lighting() and _mesa_update_tnl_spaces().
+ */
+void
+_mesa_update_state_locked( struct gl_context *ctx )
+{
+ GLbitfield new_state = ctx->NewState;
+ GLbitfield prog_flags = _NEW_PROGRAM;
+ GLbitfield new_prog_state = 0x0;
+
+ if (new_state == _NEW_CURRENT_ATTRIB)
+ goto out;
+
+ if (MESA_VERBOSE & VERBOSE_STATE)
+ _mesa_print_state("_mesa_update_state", new_state);
+
+ /* Determine which state flags effect vertex/fragment program state */
+ if (ctx->FragmentProgram._MaintainTexEnvProgram) {
+ prog_flags |= (_NEW_BUFFERS | _NEW_TEXTURE | _NEW_FOG |
+ _NEW_ARRAY | _NEW_LIGHT | _NEW_POINT | _NEW_RENDERMODE |
+ _NEW_PROGRAM | _NEW_FRAG_CLAMP);
+ }
+ if (ctx->VertexProgram._MaintainTnlProgram) {
+ prog_flags |= (_NEW_ARRAY | _NEW_TEXTURE | _NEW_TEXTURE_MATRIX |
+ _NEW_TRANSFORM | _NEW_POINT |
+ _NEW_FOG | _NEW_LIGHT |
+ _MESA_NEW_NEED_EYE_COORDS);
+ }
+
+ /*
+ * Now update derived state info
+ */
+
+ if (new_state & prog_flags)
+ update_program_enables( ctx );
+
+ if (new_state & (_NEW_MODELVIEW|_NEW_PROJECTION))
+ _mesa_update_modelview_project( ctx, new_state );
+
+ if (new_state & (_NEW_PROGRAM|_NEW_TEXTURE|_NEW_TEXTURE_MATRIX))
+ _mesa_update_texture( ctx, new_state );
+
+ if (new_state & _NEW_BUFFERS)
+ _mesa_update_framebuffer(ctx);
+
+ if (new_state & (_NEW_SCISSOR | _NEW_BUFFERS | _NEW_VIEWPORT))
+ _mesa_update_draw_buffer_bounds( ctx );
+
+ if (new_state & _NEW_POLYGON)
+ update_polygon( ctx );
+
+ if (new_state & _NEW_LIGHT)
+ _mesa_update_lighting( ctx );
+
+ if (new_state & (_NEW_LIGHT | _NEW_BUFFERS))
+ update_clamp_vertex_color(ctx);
+
+ if (new_state & (_NEW_STENCIL | _NEW_BUFFERS))
+ _mesa_update_stencil( ctx );
+
+ if (new_state & _NEW_PIXEL)
+ _mesa_update_pixel( ctx, new_state );
+
+ if (new_state & _DD_NEW_SEPARATE_SPECULAR)
+ update_separate_specular( ctx );
+
+ if (new_state & (_NEW_BUFFERS | _NEW_VIEWPORT))
+ update_viewport_matrix(ctx);
+
+ if (new_state & _NEW_MULTISAMPLE)
+ update_multisample( ctx );
+
+ if (new_state & _NEW_COLOR)
+ update_color( ctx );
+
+ if (new_state & (_NEW_COLOR | _NEW_BUFFERS))
+ update_clamp_read_color(ctx);
+
+ if(new_state & (_NEW_FRAG_CLAMP | _NEW_BUFFERS))
+ update_clamp_fragment_color(ctx);
+
+#if 0
+ if (new_state & (_NEW_POINT | _NEW_LINE | _NEW_POLYGON | _NEW_LIGHT
+ | _NEW_STENCIL | _DD_NEW_SEPARATE_SPECULAR))
+ update_tricaps( ctx, new_state );
+#endif
+
+ /* ctx->_NeedEyeCoords is now up to date.
+ *
+ * If the truth value of this variable has changed, update for the
+ * new lighting space and recompute the positions of lights and the
+ * normal transform.
+ *
+ * If the lighting space hasn't changed, may still need to recompute
+ * light positions & normal transforms for other reasons.
+ */
+ if (new_state & _MESA_NEW_NEED_EYE_COORDS)
+ _mesa_update_tnl_spaces( ctx, new_state );
+
+ if (new_state & prog_flags) {
+ /* When we generate programs from fixed-function vertex/fragment state
+ * this call may generate/bind a new program. If so, we need to
+ * propogate the _NEW_PROGRAM flag to the driver.
+ */
+ new_prog_state |= update_program( ctx );
+ }
+
+ if (new_state & (_NEW_ARRAY | _NEW_PROGRAM | _NEW_BUFFER_OBJECT))
+ update_arrays( ctx );
+
+ out:
+ new_prog_state |= update_program_constants(ctx);
+
+ /*
+ * Give the driver a chance to act upon the new_state flags.
+ * The driver might plug in different span functions, for example.
+ * Also, this is where the driver can invalidate the state of any
+ * active modules (such as swrast_setup, swrast, tnl, etc).
+ *
+ * Set ctx->NewState to zero to avoid recursion if
+ * Driver.UpdateState() has to call FLUSH_VERTICES(). (fixed?)
+ */
+ new_state = ctx->NewState | new_prog_state;
+ ctx->NewState = 0;
+ ctx->Driver.UpdateState(ctx, new_state);
+ ctx->Array.NewState = 0;
+ if (!ctx->Array.RebindArrays)
+ ctx->Array.RebindArrays = (new_state & (_NEW_ARRAY | _NEW_PROGRAM)) != 0;
+}
+
+
+/* This is the usual entrypoint for state updates:
+ */
+void
+_mesa_update_state( struct gl_context *ctx )
+{
+ _mesa_lock_context_textures(ctx);
+ _mesa_update_state_locked(ctx);
+ _mesa_unlock_context_textures(ctx);
+}
+
+
+
+
+/**
+ * Want to figure out which fragment program inputs are actually
+ * constant/current values from ctx->Current. These should be
+ * referenced as a tracked state variable rather than a fragment
+ * program input, to save the overhead of putting a constant value in
+ * every submitted vertex, transferring it to hardware, interpolating
+ * it across the triangle, etc...
+ *
+ * When there is a VP bound, just use vp->outputs. But when we're
+ * generating vp from fixed function state, basically want to
+ * calculate:
+ *
+ * vp_out_2_fp_in( vp_in_2_vp_out( varying_inputs ) |
+ * potential_vp_outputs )
+ *
+ * Where potential_vp_outputs is calculated by looking at enabled
+ * texgen, etc.
+ *
+ * The generated fragment program should then only declare inputs that
+ * may vary or otherwise differ from the ctx->Current values.
+ * Otherwise, the fp should track them as state values instead.
+ */
+void
+_mesa_set_varying_vp_inputs( struct gl_context *ctx,
+ GLbitfield varying_inputs )
+{
+ if (ctx->varying_vp_inputs != varying_inputs) {
+ ctx->varying_vp_inputs = varying_inputs;
+ ctx->NewState |= _NEW_ARRAY;
+ /*printf("%s %x\n", __FUNCTION__, varying_inputs);*/
+ }
+}
+
+
+/**
+ * Used by drivers to tell core Mesa that the driver is going to
+ * install/ use its own vertex program. In particular, this will
+ * prevent generated fragment programs from using state vars instead
+ * of ordinary varyings/inputs.
+ */
+void
+_mesa_set_vp_override(struct gl_context *ctx, GLboolean flag)
+{
+ if (ctx->VertexProgram._Overriden != flag) {
+ ctx->VertexProgram._Overriden = flag;
+
+ /* Set one of the bits which will trigger fragment program
+ * regeneration:
+ */
+ ctx->NewState |= _NEW_PROGRAM;
+ }
+}
diff --git a/mesalib/src/mesa/main/stencil.c b/mesalib/src/mesa/main/stencil.c
index d898bf1d7..b49ddbdbb 100644
--- a/mesalib/src/mesa/main/stencil.c
+++ b/mesalib/src/mesa/main/stencil.c
@@ -1,614 +1,614 @@
-/*
- * Mesa 3-D graphics library
- * Version: 7.1
- *
- * Copyright (C) 1999-2007 Brian Paul All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-
-/**
- * \file stencil.c
- * Stencil operations.
- *
- * Note: There's some conflict between GL_EXT_stencil_two_side and
- * OpenGL 2.0's two-sided stencil feature.
- *
- * With GL_EXT_stencil_two_side, calling glStencilOp/Func/Mask() only the
- * front OR back face state (as set by glActiveStencilFaceEXT) is set.
- *
- * But with OpenGL 2.0, calling glStencilOp/Func/Mask() sets BOTH the
- * front AND back state.
- *
- * Also, note that GL_ATI_separate_stencil is different as well:
- * glStencilFuncSeparateATI(GLenum frontfunc, GLenum backfunc, ...) vs.
- * glStencilFuncSeparate(GLenum face, GLenum func, ...).
- *
- * This problem is solved by keeping three sets of stencil state:
- * state[0] = GL_FRONT state.
- * state[1] = OpenGL 2.0 / GL_ATI_separate_stencil GL_BACK state.
- * state[2] = GL_EXT_stencil_two_side GL_BACK state.
- */
-
-
-#include "glheader.h"
-#include "imports.h"
-#include "context.h"
-#include "macros.h"
-#include "stencil.h"
-#include "mtypes.h"
-
-
-static GLboolean
-validate_stencil_op(struct gl_context *ctx, GLenum op)
-{
- switch (op) {
- case GL_KEEP:
- case GL_ZERO:
- case GL_REPLACE:
- case GL_INCR:
- case GL_DECR:
- case GL_INVERT:
- return GL_TRUE;
- case GL_INCR_WRAP_EXT:
- case GL_DECR_WRAP_EXT:
- if (ctx->Extensions.EXT_stencil_wrap) {
- return GL_TRUE;
- }
- /* FALL-THROUGH */
- default:
- return GL_FALSE;
- }
-}
-
-
-static GLboolean
-validate_stencil_func(struct gl_context *ctx, GLenum func)
-{
- switch (func) {
- case GL_NEVER:
- case GL_LESS:
- case GL_LEQUAL:
- case GL_GREATER:
- case GL_GEQUAL:
- case GL_EQUAL:
- case GL_NOTEQUAL:
- case GL_ALWAYS:
- return GL_TRUE;
- default:
- return GL_FALSE;
- }
-}
-
-
-/**
- * Set the clear value for the stencil buffer.
- *
- * \param s clear value.
- *
- * \sa glClearStencil().
- *
- * Updates gl_stencil_attrib::Clear. On change
- * flushes the vertices and notifies the driver via
- * the dd_function_table::ClearStencil callback.
- */
-void GLAPIENTRY
-_mesa_ClearStencil( GLint s )
-{
- GET_CURRENT_CONTEXT(ctx);
- ASSERT_OUTSIDE_BEGIN_END(ctx);
-
- if (ctx->Stencil.Clear == (GLuint) s)
- return;
-
- FLUSH_VERTICES(ctx, _NEW_STENCIL);
- ctx->Stencil.Clear = (GLuint) s;
-
- if (ctx->Driver.ClearStencil) {
- ctx->Driver.ClearStencil( ctx, s );
- }
-}
-
-
-/**
- * Set the function and reference value for stencil testing.
- *
- * \param frontfunc front test function.
- * \param backfunc back test function.
- * \param ref front and back reference value.
- * \param mask front and back bitmask.
- *
- * \sa glStencilFunc().
- *
- * Verifies the parameters and updates the respective values in
- * __struct gl_contextRec::Stencil. On change flushes the vertices and notifies the
- * driver via the dd_function_table::StencilFunc callback.
- */
-void GLAPIENTRY
-_mesa_StencilFuncSeparateATI( GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask )
-{
- GET_CURRENT_CONTEXT(ctx);
- const GLint stencilMax = (1 << ctx->DrawBuffer->Visual.stencilBits) - 1;
- ASSERT_OUTSIDE_BEGIN_END(ctx);
-
- if (MESA_VERBOSE & VERBOSE_API)
- _mesa_debug(ctx, "glStencilFuncSeparateATI()\n");
-
- if (!validate_stencil_func(ctx, frontfunc)) {
- _mesa_error(ctx, GL_INVALID_ENUM,
- "glStencilFuncSeparateATI(frontfunc)");
- return;
- }
- if (!validate_stencil_func(ctx, backfunc)) {
- _mesa_error(ctx, GL_INVALID_ENUM,
- "glStencilFuncSeparateATI(backfunc)");
- return;
- }
-
- ref = CLAMP( ref, 0, stencilMax );
-
- /* set both front and back state */
- if (ctx->Stencil.Function[0] == frontfunc &&
- ctx->Stencil.Function[1] == backfunc &&
- ctx->Stencil.ValueMask[0] == mask &&
- ctx->Stencil.ValueMask[1] == mask &&
- ctx->Stencil.Ref[0] == ref &&
- ctx->Stencil.Ref[1] == ref)
- return;
- FLUSH_VERTICES(ctx, _NEW_STENCIL);
- ctx->Stencil.Function[0] = frontfunc;
- ctx->Stencil.Function[1] = backfunc;
- ctx->Stencil.Ref[0] = ctx->Stencil.Ref[1] = ref;
- ctx->Stencil.ValueMask[0] = ctx->Stencil.ValueMask[1] = mask;
- if (ctx->Driver.StencilFuncSeparate) {
- ctx->Driver.StencilFuncSeparate(ctx, GL_FRONT,
- frontfunc, ref, mask);
- ctx->Driver.StencilFuncSeparate(ctx, GL_BACK,
- backfunc, ref, mask);
- }
-}
-
-
-/**
- * Set the function and reference value for stencil testing.
- *
- * \param func test function.
- * \param ref reference value.
- * \param mask bitmask.
- *
- * \sa glStencilFunc().
- *
- * Verifies the parameters and updates the respective values in
- * __struct gl_contextRec::Stencil. On change flushes the vertices and notifies the
- * driver via the dd_function_table::StencilFunc callback.
- */
-void GLAPIENTRY
-_mesa_StencilFunc( GLenum func, GLint ref, GLuint mask )
-{
- GET_CURRENT_CONTEXT(ctx);
- const GLint stencilMax = (1 << ctx->DrawBuffer->Visual.stencilBits) - 1;
- const GLint face = ctx->Stencil.ActiveFace;
- ASSERT_OUTSIDE_BEGIN_END(ctx);
-
- if (MESA_VERBOSE & VERBOSE_API)
- _mesa_debug(ctx, "glStencilFunc()\n");
-
- if (!validate_stencil_func(ctx, func)) {
- _mesa_error(ctx, GL_INVALID_ENUM, "glStencilFunc(func)");
- return;
- }
-
- ref = CLAMP( ref, 0, stencilMax );
-
- if (face != 0) {
- if (ctx->Stencil.Function[face] == func &&
- ctx->Stencil.ValueMask[face] == mask &&
- ctx->Stencil.Ref[face] == ref)
- return;
- FLUSH_VERTICES(ctx, _NEW_STENCIL);
- ctx->Stencil.Function[face] = func;
- ctx->Stencil.Ref[face] = ref;
- ctx->Stencil.ValueMask[face] = mask;
-
- /* Only propagate the change to the driver if EXT_stencil_two_side
- * is enabled.
- */
- if (ctx->Driver.StencilFuncSeparate && ctx->Stencil.TestTwoSide) {
- ctx->Driver.StencilFuncSeparate(ctx, GL_BACK, func, ref, mask);
- }
- }
- else {
- /* set both front and back state */
- if (ctx->Stencil.Function[0] == func &&
- ctx->Stencil.Function[1] == func &&
- ctx->Stencil.ValueMask[0] == mask &&
- ctx->Stencil.ValueMask[1] == mask &&
- ctx->Stencil.Ref[0] == ref &&
- ctx->Stencil.Ref[1] == ref)
- return;
- FLUSH_VERTICES(ctx, _NEW_STENCIL);
- ctx->Stencil.Function[0] = ctx->Stencil.Function[1] = func;
- ctx->Stencil.Ref[0] = ctx->Stencil.Ref[1] = ref;
- ctx->Stencil.ValueMask[0] = ctx->Stencil.ValueMask[1] = mask;
- if (ctx->Driver.StencilFuncSeparate) {
- ctx->Driver.StencilFuncSeparate(ctx,
- ((ctx->Stencil.TestTwoSide)
- ? GL_FRONT : GL_FRONT_AND_BACK),
- func, ref, mask);
- }
- }
-}
-
-
-/**
- * Set the stencil writing mask.
- *
- * \param mask bit-mask to enable/disable writing of individual bits in the
- * stencil planes.
- *
- * \sa glStencilMask().
- *
- * Updates gl_stencil_attrib::WriteMask. On change flushes the vertices and
- * notifies the driver via the dd_function_table::StencilMask callback.
- */
-void GLAPIENTRY
-_mesa_StencilMask( GLuint mask )
-{
- GET_CURRENT_CONTEXT(ctx);
- const GLint face = ctx->Stencil.ActiveFace;
-
- if (MESA_VERBOSE & VERBOSE_API)
- _mesa_debug(ctx, "glStencilMask()\n");
-
- ASSERT_OUTSIDE_BEGIN_END(ctx);
-
- if (face != 0) {
- /* Only modify the EXT_stencil_two_side back-face state.
- */
- if (ctx->Stencil.WriteMask[face] == mask)
- return;
- FLUSH_VERTICES(ctx, _NEW_STENCIL);
- ctx->Stencil.WriteMask[face] = mask;
-
- /* Only propagate the change to the driver if EXT_stencil_two_side
- * is enabled.
- */
- if (ctx->Driver.StencilMaskSeparate && ctx->Stencil.TestTwoSide) {
- ctx->Driver.StencilMaskSeparate(ctx, GL_BACK, mask);
- }
- }
- else {
- /* set both front and back state */
- if (ctx->Stencil.WriteMask[0] == mask &&
- ctx->Stencil.WriteMask[1] == mask)
- return;
- FLUSH_VERTICES(ctx, _NEW_STENCIL);
- ctx->Stencil.WriteMask[0] = ctx->Stencil.WriteMask[1] = mask;
- if (ctx->Driver.StencilMaskSeparate) {
- ctx->Driver.StencilMaskSeparate(ctx,
- ((ctx->Stencil.TestTwoSide)
- ? GL_FRONT : GL_FRONT_AND_BACK),
- mask);
- }
- }
-}
-
-
-/**
- * Set the stencil test actions.
- *
- * \param fail action to take when stencil test fails.
- * \param zfail action to take when stencil test passes, but depth test fails.
- * \param zpass action to take when stencil test passes and the depth test
- * passes (or depth testing is not enabled).
- *
- * \sa glStencilOp().
- *
- * Verifies the parameters and updates the respective fields in
- * __struct gl_contextRec::Stencil. On change flushes the vertices and notifies the
- * driver via the dd_function_table::StencilOp callback.
- */
-void GLAPIENTRY
-_mesa_StencilOp(GLenum fail, GLenum zfail, GLenum zpass)
-{
- GET_CURRENT_CONTEXT(ctx);
- const GLint face = ctx->Stencil.ActiveFace;
-
- if (MESA_VERBOSE & VERBOSE_API)
- _mesa_debug(ctx, "glStencilOp()\n");
-
- ASSERT_OUTSIDE_BEGIN_END(ctx);
-
- if (!validate_stencil_op(ctx, fail)) {
- _mesa_error(ctx, GL_INVALID_ENUM, "glStencilOp(sfail)");
- return;
- }
- if (!validate_stencil_op(ctx, zfail)) {
- _mesa_error(ctx, GL_INVALID_ENUM, "glStencilOp(zfail)");
- return;
- }
- if (!validate_stencil_op(ctx, zpass)) {
- _mesa_error(ctx, GL_INVALID_ENUM, "glStencilOp(zpass)");
- return;
- }
-
- if (face != 0) {
- /* only set active face state */
- if (ctx->Stencil.ZFailFunc[face] == zfail &&
- ctx->Stencil.ZPassFunc[face] == zpass &&
- ctx->Stencil.FailFunc[face] == fail)
- return;
- FLUSH_VERTICES(ctx, _NEW_STENCIL);
- ctx->Stencil.ZFailFunc[face] = zfail;
- ctx->Stencil.ZPassFunc[face] = zpass;
- ctx->Stencil.FailFunc[face] = fail;
-
- /* Only propagate the change to the driver if EXT_stencil_two_side
- * is enabled.
- */
- if (ctx->Driver.StencilOpSeparate && ctx->Stencil.TestTwoSide) {
- ctx->Driver.StencilOpSeparate(ctx, GL_BACK, fail, zfail, zpass);
- }
- }
- else {
- /* set both front and back state */
- if (ctx->Stencil.ZFailFunc[0] == zfail &&
- ctx->Stencil.ZFailFunc[1] == zfail &&
- ctx->Stencil.ZPassFunc[0] == zpass &&
- ctx->Stencil.ZPassFunc[1] == zpass &&
- ctx->Stencil.FailFunc[0] == fail &&
- ctx->Stencil.FailFunc[1] == fail)
- return;
- FLUSH_VERTICES(ctx, _NEW_STENCIL);
- ctx->Stencil.ZFailFunc[0] = ctx->Stencil.ZFailFunc[1] = zfail;
- ctx->Stencil.ZPassFunc[0] = ctx->Stencil.ZPassFunc[1] = zpass;
- ctx->Stencil.FailFunc[0] = ctx->Stencil.FailFunc[1] = fail;
- if (ctx->Driver.StencilOpSeparate) {
- ctx->Driver.StencilOpSeparate(ctx,
- ((ctx->Stencil.TestTwoSide)
- ? GL_FRONT : GL_FRONT_AND_BACK),
- fail, zfail, zpass);
- }
- }
-}
-
-
-
-#if _HAVE_FULL_GL
-/* GL_EXT_stencil_two_side */
-void GLAPIENTRY
-_mesa_ActiveStencilFaceEXT(GLenum face)
-{
- GET_CURRENT_CONTEXT(ctx);
- ASSERT_OUTSIDE_BEGIN_END(ctx);
-
- if (MESA_VERBOSE & VERBOSE_API)
- _mesa_debug(ctx, "glActiveStencilFaceEXT()\n");
-
- if (!ctx->Extensions.EXT_stencil_two_side) {
- _mesa_error(ctx, GL_INVALID_OPERATION, "glActiveStencilFaceEXT");
- return;
- }
-
- if (face == GL_FRONT || face == GL_BACK) {
- FLUSH_VERTICES(ctx, _NEW_STENCIL);
- ctx->Stencil.ActiveFace = (face == GL_FRONT) ? 0 : 2;
- }
- else {
- _mesa_error(ctx, GL_INVALID_ENUM, "glActiveStencilFaceEXT(face)");
- }
-}
-#endif
-
-
-
-/**
- * OpenGL 2.0 function.
- * \todo Make StencilOp() call this function. And eventually remove the
- * ctx->Driver.StencilOp function and use ctx->Driver.StencilOpSeparate
- * instead.
- */
-void GLAPIENTRY
-_mesa_StencilOpSeparate(GLenum face, GLenum sfail, GLenum zfail, GLenum zpass)
-{
- GLboolean set = GL_FALSE;
- GET_CURRENT_CONTEXT(ctx);
- ASSERT_OUTSIDE_BEGIN_END(ctx);
-
- if (MESA_VERBOSE & VERBOSE_API)
- _mesa_debug(ctx, "glStencilOpSeparate()\n");
-
- if (!validate_stencil_op(ctx, sfail)) {
- _mesa_error(ctx, GL_INVALID_ENUM, "glStencilOpSeparate(sfail)");
- return;
- }
- if (!validate_stencil_op(ctx, zfail)) {
- _mesa_error(ctx, GL_INVALID_ENUM, "glStencilOpSeparate(zfail)");
- return;
- }
- if (!validate_stencil_op(ctx, zpass)) {
- _mesa_error(ctx, GL_INVALID_ENUM, "glStencilOpSeparate(zpass)");
- return;
- }
- if (face != GL_FRONT && face != GL_BACK && face != GL_FRONT_AND_BACK) {
- _mesa_error(ctx, GL_INVALID_ENUM, "glStencilOpSeparate(face)");
- return;
- }
-
- if (face != GL_BACK) {
- /* set front */
- if (ctx->Stencil.ZFailFunc[0] != zfail ||
- ctx->Stencil.ZPassFunc[0] != zpass ||
- ctx->Stencil.FailFunc[0] != sfail){
- FLUSH_VERTICES(ctx, _NEW_STENCIL);
- ctx->Stencil.ZFailFunc[0] = zfail;
- ctx->Stencil.ZPassFunc[0] = zpass;
- ctx->Stencil.FailFunc[0] = sfail;
- set = GL_TRUE;
- }
- }
- if (face != GL_FRONT) {
- /* set back */
- if (ctx->Stencil.ZFailFunc[1] != zfail ||
- ctx->Stencil.ZPassFunc[1] != zpass ||
- ctx->Stencil.FailFunc[1] != sfail) {
- FLUSH_VERTICES(ctx, _NEW_STENCIL);
- ctx->Stencil.ZFailFunc[1] = zfail;
- ctx->Stencil.ZPassFunc[1] = zpass;
- ctx->Stencil.FailFunc[1] = sfail;
- set = GL_TRUE;
- }
- }
- if (set && ctx->Driver.StencilOpSeparate) {
- ctx->Driver.StencilOpSeparate(ctx, face, sfail, zfail, zpass);
- }
-}
-
-
-/* OpenGL 2.0 */
-void GLAPIENTRY
-_mesa_StencilFuncSeparate(GLenum face, GLenum func, GLint ref, GLuint mask)
-{
- GET_CURRENT_CONTEXT(ctx);
- const GLint stencilMax = (1 << ctx->DrawBuffer->Visual.stencilBits) - 1;
- ASSERT_OUTSIDE_BEGIN_END(ctx);
-
- if (MESA_VERBOSE & VERBOSE_API)
- _mesa_debug(ctx, "glStencilFuncSeparate()\n");
-
- if (face != GL_FRONT && face != GL_BACK && face != GL_FRONT_AND_BACK) {
- _mesa_error(ctx, GL_INVALID_ENUM, "glStencilFuncSeparate(face)");
- return;
- }
- if (!validate_stencil_func(ctx, func)) {
- _mesa_error(ctx, GL_INVALID_ENUM, "glStencilFuncSeparate(func)");
- return;
- }
-
- ref = CLAMP(ref, 0, stencilMax);
-
- FLUSH_VERTICES(ctx, _NEW_STENCIL);
-
- if (face != GL_BACK) {
- /* set front */
- ctx->Stencil.Function[0] = func;
- ctx->Stencil.Ref[0] = ref;
- ctx->Stencil.ValueMask[0] = mask;
- }
- if (face != GL_FRONT) {
- /* set back */
- ctx->Stencil.Function[1] = func;
- ctx->Stencil.Ref[1] = ref;
- ctx->Stencil.ValueMask[1] = mask;
- }
- if (ctx->Driver.StencilFuncSeparate) {
- ctx->Driver.StencilFuncSeparate(ctx, face, func, ref, mask);
- }
-}
-
-
-/* OpenGL 2.0 */
-void GLAPIENTRY
-_mesa_StencilMaskSeparate(GLenum face, GLuint mask)
-{
- GET_CURRENT_CONTEXT(ctx);
- ASSERT_OUTSIDE_BEGIN_END(ctx);
-
- if (MESA_VERBOSE & VERBOSE_API)
- _mesa_debug(ctx, "glStencilMaskSeparate()\n");
-
- if (face != GL_FRONT && face != GL_BACK && face != GL_FRONT_AND_BACK) {
- _mesa_error(ctx, GL_INVALID_ENUM, "glStencilaMaskSeparate(face)");
- return;
- }
-
- FLUSH_VERTICES(ctx, _NEW_STENCIL);
-
- if (face != GL_BACK) {
- ctx->Stencil.WriteMask[0] = mask;
- }
- if (face != GL_FRONT) {
- ctx->Stencil.WriteMask[1] = mask;
- }
- if (ctx->Driver.StencilMaskSeparate) {
- ctx->Driver.StencilMaskSeparate(ctx, face, mask);
- }
-}
-
-
-/**
- * Update derived stencil state.
- */
-void
-_mesa_update_stencil(struct gl_context *ctx)
-{
- const GLint face = ctx->Stencil._BackFace;
-
- ctx->Stencil._Enabled = (ctx->Stencil.Enabled &&
- ctx->DrawBuffer->Visual.stencilBits > 0);
-
- ctx->Stencil._TestTwoSide =
- ctx->Stencil._Enabled &&
- (ctx->Stencil.Function[0] != ctx->Stencil.Function[face] ||
- ctx->Stencil.FailFunc[0] != ctx->Stencil.FailFunc[face] ||
- ctx->Stencil.ZPassFunc[0] != ctx->Stencil.ZPassFunc[face] ||
- ctx->Stencil.ZFailFunc[0] != ctx->Stencil.ZFailFunc[face] ||
- ctx->Stencil.Ref[0] != ctx->Stencil.Ref[face] ||
- ctx->Stencil.ValueMask[0] != ctx->Stencil.ValueMask[face] ||
- ctx->Stencil.WriteMask[0] != ctx->Stencil.WriteMask[face]);
-}
-
-
-/**
- * Initialize the context stipple state.
- *
- * \param ctx GL context.
- *
- * Initializes __struct gl_contextRec::Stencil attribute group.
- */
-void
-_mesa_init_stencil(struct gl_context *ctx)
-{
- ctx->Stencil.Enabled = GL_FALSE;
- ctx->Stencil.TestTwoSide = GL_FALSE;
- ctx->Stencil.ActiveFace = 0; /* 0 = GL_FRONT, 2 = GL_BACK */
- ctx->Stencil.Function[0] = GL_ALWAYS;
- ctx->Stencil.Function[1] = GL_ALWAYS;
- ctx->Stencil.Function[2] = GL_ALWAYS;
- ctx->Stencil.FailFunc[0] = GL_KEEP;
- ctx->Stencil.FailFunc[1] = GL_KEEP;
- ctx->Stencil.FailFunc[2] = GL_KEEP;
- ctx->Stencil.ZPassFunc[0] = GL_KEEP;
- ctx->Stencil.ZPassFunc[1] = GL_KEEP;
- ctx->Stencil.ZPassFunc[2] = GL_KEEP;
- ctx->Stencil.ZFailFunc[0] = GL_KEEP;
- ctx->Stencil.ZFailFunc[1] = GL_KEEP;
- ctx->Stencil.ZFailFunc[2] = GL_KEEP;
- ctx->Stencil.Ref[0] = 0;
- ctx->Stencil.Ref[1] = 0;
- ctx->Stencil.Ref[2] = 0;
- ctx->Stencil.ValueMask[0] = ~0U;
- ctx->Stencil.ValueMask[1] = ~0U;
- ctx->Stencil.ValueMask[2] = ~0U;
- ctx->Stencil.WriteMask[0] = ~0U;
- ctx->Stencil.WriteMask[1] = ~0U;
- ctx->Stencil.WriteMask[2] = ~0U;
- ctx->Stencil.Clear = 0;
- ctx->Stencil._BackFace = 1;
-}
+/*
+ * Mesa 3-D graphics library
+ * Version: 7.1
+ *
+ * Copyright (C) 1999-2007 Brian Paul All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+
+/**
+ * \file stencil.c
+ * Stencil operations.
+ *
+ * Note: There's some conflict between GL_EXT_stencil_two_side and
+ * OpenGL 2.0's two-sided stencil feature.
+ *
+ * With GL_EXT_stencil_two_side, calling glStencilOp/Func/Mask() only the
+ * front OR back face state (as set by glActiveStencilFaceEXT) is set.
+ *
+ * But with OpenGL 2.0, calling glStencilOp/Func/Mask() sets BOTH the
+ * front AND back state.
+ *
+ * Also, note that GL_ATI_separate_stencil is different as well:
+ * glStencilFuncSeparateATI(GLenum frontfunc, GLenum backfunc, ...) vs.
+ * glStencilFuncSeparate(GLenum face, GLenum func, ...).
+ *
+ * This problem is solved by keeping three sets of stencil state:
+ * state[0] = GL_FRONT state.
+ * state[1] = OpenGL 2.0 / GL_ATI_separate_stencil GL_BACK state.
+ * state[2] = GL_EXT_stencil_two_side GL_BACK state.
+ */
+
+
+#include "glheader.h"
+#include "imports.h"
+#include "context.h"
+#include "macros.h"
+#include "stencil.h"
+#include "mtypes.h"
+
+
+static GLboolean
+validate_stencil_op(struct gl_context *ctx, GLenum op)
+{
+ switch (op) {
+ case GL_KEEP:
+ case GL_ZERO:
+ case GL_REPLACE:
+ case GL_INCR:
+ case GL_DECR:
+ case GL_INVERT:
+ return GL_TRUE;
+ case GL_INCR_WRAP_EXT:
+ case GL_DECR_WRAP_EXT:
+ if (ctx->Extensions.EXT_stencil_wrap) {
+ return GL_TRUE;
+ }
+ /* FALL-THROUGH */
+ default:
+ return GL_FALSE;
+ }
+}
+
+
+static GLboolean
+validate_stencil_func(struct gl_context *ctx, GLenum func)
+{
+ switch (func) {
+ case GL_NEVER:
+ case GL_LESS:
+ case GL_LEQUAL:
+ case GL_GREATER:
+ case GL_GEQUAL:
+ case GL_EQUAL:
+ case GL_NOTEQUAL:
+ case GL_ALWAYS:
+ return GL_TRUE;
+ default:
+ return GL_FALSE;
+ }
+}
+
+
+/**
+ * Set the clear value for the stencil buffer.
+ *
+ * \param s clear value.
+ *
+ * \sa glClearStencil().
+ *
+ * Updates gl_stencil_attrib::Clear. On change
+ * flushes the vertices and notifies the driver via
+ * the dd_function_table::ClearStencil callback.
+ */
+void GLAPIENTRY
+_mesa_ClearStencil( GLint s )
+{
+ GET_CURRENT_CONTEXT(ctx);
+ ASSERT_OUTSIDE_BEGIN_END(ctx);
+
+ if (ctx->Stencil.Clear == (GLuint) s)
+ return;
+
+ FLUSH_VERTICES(ctx, _NEW_STENCIL);
+ ctx->Stencil.Clear = (GLuint) s;
+
+ if (ctx->Driver.ClearStencil) {
+ ctx->Driver.ClearStencil( ctx, s );
+ }
+}
+
+
+/**
+ * Set the function and reference value for stencil testing.
+ *
+ * \param frontfunc front test function.
+ * \param backfunc back test function.
+ * \param ref front and back reference value.
+ * \param mask front and back bitmask.
+ *
+ * \sa glStencilFunc().
+ *
+ * Verifies the parameters and updates the respective values in
+ * __struct gl_contextRec::Stencil. On change flushes the vertices and notifies the
+ * driver via the dd_function_table::StencilFunc callback.
+ */
+void GLAPIENTRY
+_mesa_StencilFuncSeparateATI( GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask )
+{
+ GET_CURRENT_CONTEXT(ctx);
+ const GLint stencilMax = (1 << ctx->DrawBuffer->Visual.stencilBits) - 1;
+ ASSERT_OUTSIDE_BEGIN_END(ctx);
+
+ if (MESA_VERBOSE & VERBOSE_API)
+ _mesa_debug(ctx, "glStencilFuncSeparateATI()\n");
+
+ if (!validate_stencil_func(ctx, frontfunc)) {
+ _mesa_error(ctx, GL_INVALID_ENUM,
+ "glStencilFuncSeparateATI(frontfunc)");
+ return;
+ }
+ if (!validate_stencil_func(ctx, backfunc)) {
+ _mesa_error(ctx, GL_INVALID_ENUM,
+ "glStencilFuncSeparateATI(backfunc)");
+ return;
+ }
+
+ ref = CLAMP( ref, 0, stencilMax );
+
+ /* set both front and back state */
+ if (ctx->Stencil.Function[0] == frontfunc &&
+ ctx->Stencil.Function[1] == backfunc &&
+ ctx->Stencil.ValueMask[0] == mask &&
+ ctx->Stencil.ValueMask[1] == mask &&
+ ctx->Stencil.Ref[0] == ref &&
+ ctx->Stencil.Ref[1] == ref)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_STENCIL);
+ ctx->Stencil.Function[0] = frontfunc;
+ ctx->Stencil.Function[1] = backfunc;
+ ctx->Stencil.Ref[0] = ctx->Stencil.Ref[1] = ref;
+ ctx->Stencil.ValueMask[0] = ctx->Stencil.ValueMask[1] = mask;
+ if (ctx->Driver.StencilFuncSeparate) {
+ ctx->Driver.StencilFuncSeparate(ctx, GL_FRONT,
+ frontfunc, ref, mask);
+ ctx->Driver.StencilFuncSeparate(ctx, GL_BACK,
+ backfunc, ref, mask);
+ }
+}
+
+
+/**
+ * Set the function and reference value for stencil testing.
+ *
+ * \param func test function.
+ * \param ref reference value.
+ * \param mask bitmask.
+ *
+ * \sa glStencilFunc().
+ *
+ * Verifies the parameters and updates the respective values in
+ * __struct gl_contextRec::Stencil. On change flushes the vertices and notifies the
+ * driver via the dd_function_table::StencilFunc callback.
+ */
+void GLAPIENTRY
+_mesa_StencilFunc( GLenum func, GLint ref, GLuint mask )
+{
+ GET_CURRENT_CONTEXT(ctx);
+ const GLint stencilMax = (1 << ctx->DrawBuffer->Visual.stencilBits) - 1;
+ const GLint face = ctx->Stencil.ActiveFace;
+ ASSERT_OUTSIDE_BEGIN_END(ctx);
+
+ if (MESA_VERBOSE & VERBOSE_API)
+ _mesa_debug(ctx, "glStencilFunc()\n");
+
+ if (!validate_stencil_func(ctx, func)) {
+ _mesa_error(ctx, GL_INVALID_ENUM, "glStencilFunc(func)");
+ return;
+ }
+
+ ref = CLAMP( ref, 0, stencilMax );
+
+ if (face != 0) {
+ if (ctx->Stencil.Function[face] == func &&
+ ctx->Stencil.ValueMask[face] == mask &&
+ ctx->Stencil.Ref[face] == ref)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_STENCIL);
+ ctx->Stencil.Function[face] = func;
+ ctx->Stencil.Ref[face] = ref;
+ ctx->Stencil.ValueMask[face] = mask;
+
+ /* Only propagate the change to the driver if EXT_stencil_two_side
+ * is enabled.
+ */
+ if (ctx->Driver.StencilFuncSeparate && ctx->Stencil.TestTwoSide) {
+ ctx->Driver.StencilFuncSeparate(ctx, GL_BACK, func, ref, mask);
+ }
+ }
+ else {
+ /* set both front and back state */
+ if (ctx->Stencil.Function[0] == func &&
+ ctx->Stencil.Function[1] == func &&
+ ctx->Stencil.ValueMask[0] == mask &&
+ ctx->Stencil.ValueMask[1] == mask &&
+ ctx->Stencil.Ref[0] == ref &&
+ ctx->Stencil.Ref[1] == ref)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_STENCIL);
+ ctx->Stencil.Function[0] = ctx->Stencil.Function[1] = func;
+ ctx->Stencil.Ref[0] = ctx->Stencil.Ref[1] = ref;
+ ctx->Stencil.ValueMask[0] = ctx->Stencil.ValueMask[1] = mask;
+ if (ctx->Driver.StencilFuncSeparate) {
+ ctx->Driver.StencilFuncSeparate(ctx,
+ ((ctx->Stencil.TestTwoSide)
+ ? GL_FRONT : GL_FRONT_AND_BACK),
+ func, ref, mask);
+ }
+ }
+}
+
+
+/**
+ * Set the stencil writing mask.
+ *
+ * \param mask bit-mask to enable/disable writing of individual bits in the
+ * stencil planes.
+ *
+ * \sa glStencilMask().
+ *
+ * Updates gl_stencil_attrib::WriteMask. On change flushes the vertices and
+ * notifies the driver via the dd_function_table::StencilMask callback.
+ */
+void GLAPIENTRY
+_mesa_StencilMask( GLuint mask )
+{
+ GET_CURRENT_CONTEXT(ctx);
+ const GLint face = ctx->Stencil.ActiveFace;
+
+ if (MESA_VERBOSE & VERBOSE_API)
+ _mesa_debug(ctx, "glStencilMask()\n");
+
+ ASSERT_OUTSIDE_BEGIN_END(ctx);
+
+ if (face != 0) {
+ /* Only modify the EXT_stencil_two_side back-face state.
+ */
+ if (ctx->Stencil.WriteMask[face] == mask)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_STENCIL);
+ ctx->Stencil.WriteMask[face] = mask;
+
+ /* Only propagate the change to the driver if EXT_stencil_two_side
+ * is enabled.
+ */
+ if (ctx->Driver.StencilMaskSeparate && ctx->Stencil.TestTwoSide) {
+ ctx->Driver.StencilMaskSeparate(ctx, GL_BACK, mask);
+ }
+ }
+ else {
+ /* set both front and back state */
+ if (ctx->Stencil.WriteMask[0] == mask &&
+ ctx->Stencil.WriteMask[1] == mask)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_STENCIL);
+ ctx->Stencil.WriteMask[0] = ctx->Stencil.WriteMask[1] = mask;
+ if (ctx->Driver.StencilMaskSeparate) {
+ ctx->Driver.StencilMaskSeparate(ctx,
+ ((ctx->Stencil.TestTwoSide)
+ ? GL_FRONT : GL_FRONT_AND_BACK),
+ mask);
+ }
+ }
+}
+
+
+/**
+ * Set the stencil test actions.
+ *
+ * \param fail action to take when stencil test fails.
+ * \param zfail action to take when stencil test passes, but depth test fails.
+ * \param zpass action to take when stencil test passes and the depth test
+ * passes (or depth testing is not enabled).
+ *
+ * \sa glStencilOp().
+ *
+ * Verifies the parameters and updates the respective fields in
+ * __struct gl_contextRec::Stencil. On change flushes the vertices and notifies the
+ * driver via the dd_function_table::StencilOp callback.
+ */
+void GLAPIENTRY
+_mesa_StencilOp(GLenum fail, GLenum zfail, GLenum zpass)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ const GLint face = ctx->Stencil.ActiveFace;
+
+ if (MESA_VERBOSE & VERBOSE_API)
+ _mesa_debug(ctx, "glStencilOp()\n");
+
+ ASSERT_OUTSIDE_BEGIN_END(ctx);
+
+ if (!validate_stencil_op(ctx, fail)) {
+ _mesa_error(ctx, GL_INVALID_ENUM, "glStencilOp(sfail)");
+ return;
+ }
+ if (!validate_stencil_op(ctx, zfail)) {
+ _mesa_error(ctx, GL_INVALID_ENUM, "glStencilOp(zfail)");
+ return;
+ }
+ if (!validate_stencil_op(ctx, zpass)) {
+ _mesa_error(ctx, GL_INVALID_ENUM, "glStencilOp(zpass)");
+ return;
+ }
+
+ if (face != 0) {
+ /* only set active face state */
+ if (ctx->Stencil.ZFailFunc[face] == zfail &&
+ ctx->Stencil.ZPassFunc[face] == zpass &&
+ ctx->Stencil.FailFunc[face] == fail)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_STENCIL);
+ ctx->Stencil.ZFailFunc[face] = zfail;
+ ctx->Stencil.ZPassFunc[face] = zpass;
+ ctx->Stencil.FailFunc[face] = fail;
+
+ /* Only propagate the change to the driver if EXT_stencil_two_side
+ * is enabled.
+ */
+ if (ctx->Driver.StencilOpSeparate && ctx->Stencil.TestTwoSide) {
+ ctx->Driver.StencilOpSeparate(ctx, GL_BACK, fail, zfail, zpass);
+ }
+ }
+ else {
+ /* set both front and back state */
+ if (ctx->Stencil.ZFailFunc[0] == zfail &&
+ ctx->Stencil.ZFailFunc[1] == zfail &&
+ ctx->Stencil.ZPassFunc[0] == zpass &&
+ ctx->Stencil.ZPassFunc[1] == zpass &&
+ ctx->Stencil.FailFunc[0] == fail &&
+ ctx->Stencil.FailFunc[1] == fail)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_STENCIL);
+ ctx->Stencil.ZFailFunc[0] = ctx->Stencil.ZFailFunc[1] = zfail;
+ ctx->Stencil.ZPassFunc[0] = ctx->Stencil.ZPassFunc[1] = zpass;
+ ctx->Stencil.FailFunc[0] = ctx->Stencil.FailFunc[1] = fail;
+ if (ctx->Driver.StencilOpSeparate) {
+ ctx->Driver.StencilOpSeparate(ctx,
+ ((ctx->Stencil.TestTwoSide)
+ ? GL_FRONT : GL_FRONT_AND_BACK),
+ fail, zfail, zpass);
+ }
+ }
+}
+
+
+
+#if _HAVE_FULL_GL
+/* GL_EXT_stencil_two_side */
+void GLAPIENTRY
+_mesa_ActiveStencilFaceEXT(GLenum face)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ ASSERT_OUTSIDE_BEGIN_END(ctx);
+
+ if (MESA_VERBOSE & VERBOSE_API)
+ _mesa_debug(ctx, "glActiveStencilFaceEXT()\n");
+
+ if (!ctx->Extensions.EXT_stencil_two_side) {
+ _mesa_error(ctx, GL_INVALID_OPERATION, "glActiveStencilFaceEXT");
+ return;
+ }
+
+ if (face == GL_FRONT || face == GL_BACK) {
+ FLUSH_VERTICES(ctx, _NEW_STENCIL);
+ ctx->Stencil.ActiveFace = (face == GL_FRONT) ? 0 : 2;
+ }
+ else {
+ _mesa_error(ctx, GL_INVALID_ENUM, "glActiveStencilFaceEXT(face)");
+ }
+}
+#endif
+
+
+
+/**
+ * OpenGL 2.0 function.
+ * \todo Make StencilOp() call this function. And eventually remove the
+ * ctx->Driver.StencilOp function and use ctx->Driver.StencilOpSeparate
+ * instead.
+ */
+void GLAPIENTRY
+_mesa_StencilOpSeparate(GLenum face, GLenum sfail, GLenum zfail, GLenum zpass)
+{
+ GLboolean set = GL_FALSE;
+ GET_CURRENT_CONTEXT(ctx);
+ ASSERT_OUTSIDE_BEGIN_END(ctx);
+
+ if (MESA_VERBOSE & VERBOSE_API)
+ _mesa_debug(ctx, "glStencilOpSeparate()\n");
+
+ if (!validate_stencil_op(ctx, sfail)) {
+ _mesa_error(ctx, GL_INVALID_ENUM, "glStencilOpSeparate(sfail)");
+ return;
+ }
+ if (!validate_stencil_op(ctx, zfail)) {
+ _mesa_error(ctx, GL_INVALID_ENUM, "glStencilOpSeparate(zfail)");
+ return;
+ }
+ if (!validate_stencil_op(ctx, zpass)) {
+ _mesa_error(ctx, GL_INVALID_ENUM, "glStencilOpSeparate(zpass)");
+ return;
+ }
+ if (face != GL_FRONT && face != GL_BACK && face != GL_FRONT_AND_BACK) {
+ _mesa_error(ctx, GL_INVALID_ENUM, "glStencilOpSeparate(face)");
+ return;
+ }
+
+ if (face != GL_BACK) {
+ /* set front */
+ if (ctx->Stencil.ZFailFunc[0] != zfail ||
+ ctx->Stencil.ZPassFunc[0] != zpass ||
+ ctx->Stencil.FailFunc[0] != sfail){
+ FLUSH_VERTICES(ctx, _NEW_STENCIL);
+ ctx->Stencil.ZFailFunc[0] = zfail;
+ ctx->Stencil.ZPassFunc[0] = zpass;
+ ctx->Stencil.FailFunc[0] = sfail;
+ set = GL_TRUE;
+ }
+ }
+ if (face != GL_FRONT) {
+ /* set back */
+ if (ctx->Stencil.ZFailFunc[1] != zfail ||
+ ctx->Stencil.ZPassFunc[1] != zpass ||
+ ctx->Stencil.FailFunc[1] != sfail) {
+ FLUSH_VERTICES(ctx, _NEW_STENCIL);
+ ctx->Stencil.ZFailFunc[1] = zfail;
+ ctx->Stencil.ZPassFunc[1] = zpass;
+ ctx->Stencil.FailFunc[1] = sfail;
+ set = GL_TRUE;
+ }
+ }
+ if (set && ctx->Driver.StencilOpSeparate) {
+ ctx->Driver.StencilOpSeparate(ctx, face, sfail, zfail, zpass);
+ }
+}
+
+
+/* OpenGL 2.0 */
+void GLAPIENTRY
+_mesa_StencilFuncSeparate(GLenum face, GLenum func, GLint ref, GLuint mask)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ const GLint stencilMax = (1 << ctx->DrawBuffer->Visual.stencilBits) - 1;
+ ASSERT_OUTSIDE_BEGIN_END(ctx);
+
+ if (MESA_VERBOSE & VERBOSE_API)
+ _mesa_debug(ctx, "glStencilFuncSeparate()\n");
+
+ if (face != GL_FRONT && face != GL_BACK && face != GL_FRONT_AND_BACK) {
+ _mesa_error(ctx, GL_INVALID_ENUM, "glStencilFuncSeparate(face)");
+ return;
+ }
+ if (!validate_stencil_func(ctx, func)) {
+ _mesa_error(ctx, GL_INVALID_ENUM, "glStencilFuncSeparate(func)");
+ return;
+ }
+
+ ref = CLAMP(ref, 0, stencilMax);
+
+ FLUSH_VERTICES(ctx, _NEW_STENCIL);
+
+ if (face != GL_BACK) {
+ /* set front */
+ ctx->Stencil.Function[0] = func;
+ ctx->Stencil.Ref[0] = ref;
+ ctx->Stencil.ValueMask[0] = mask;
+ }
+ if (face != GL_FRONT) {
+ /* set back */
+ ctx->Stencil.Function[1] = func;
+ ctx->Stencil.Ref[1] = ref;
+ ctx->Stencil.ValueMask[1] = mask;
+ }
+ if (ctx->Driver.StencilFuncSeparate) {
+ ctx->Driver.StencilFuncSeparate(ctx, face, func, ref, mask);
+ }
+}
+
+
+/* OpenGL 2.0 */
+void GLAPIENTRY
+_mesa_StencilMaskSeparate(GLenum face, GLuint mask)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ ASSERT_OUTSIDE_BEGIN_END(ctx);
+
+ if (MESA_VERBOSE & VERBOSE_API)
+ _mesa_debug(ctx, "glStencilMaskSeparate()\n");
+
+ if (face != GL_FRONT && face != GL_BACK && face != GL_FRONT_AND_BACK) {
+ _mesa_error(ctx, GL_INVALID_ENUM, "glStencilaMaskSeparate(face)");
+ return;
+ }
+
+ FLUSH_VERTICES(ctx, _NEW_STENCIL);
+
+ if (face != GL_BACK) {
+ ctx->Stencil.WriteMask[0] = mask;
+ }
+ if (face != GL_FRONT) {
+ ctx->Stencil.WriteMask[1] = mask;
+ }
+ if (ctx->Driver.StencilMaskSeparate) {
+ ctx->Driver.StencilMaskSeparate(ctx, face, mask);
+ }
+}
+
+
+/**
+ * Update derived stencil state.
+ */
+void
+_mesa_update_stencil(struct gl_context *ctx)
+{
+ const GLint face = ctx->Stencil._BackFace;
+
+ ctx->Stencil._Enabled = (ctx->Stencil.Enabled &&
+ ctx->DrawBuffer->Visual.stencilBits > 0);
+
+ ctx->Stencil._TestTwoSide =
+ ctx->Stencil._Enabled &&
+ (ctx->Stencil.Function[0] != ctx->Stencil.Function[face] ||
+ ctx->Stencil.FailFunc[0] != ctx->Stencil.FailFunc[face] ||
+ ctx->Stencil.ZPassFunc[0] != ctx->Stencil.ZPassFunc[face] ||
+ ctx->Stencil.ZFailFunc[0] != ctx->Stencil.ZFailFunc[face] ||
+ ctx->Stencil.Ref[0] != ctx->Stencil.Ref[face] ||
+ ctx->Stencil.ValueMask[0] != ctx->Stencil.ValueMask[face] ||
+ ctx->Stencil.WriteMask[0] != ctx->Stencil.WriteMask[face]);
+}
+
+
+/**
+ * Initialize the context stipple state.
+ *
+ * \param ctx GL context.
+ *
+ * Initializes __struct gl_contextRec::Stencil attribute group.
+ */
+void
+_mesa_init_stencil(struct gl_context *ctx)
+{
+ ctx->Stencil.Enabled = GL_FALSE;
+ ctx->Stencil.TestTwoSide = GL_FALSE;
+ ctx->Stencil.ActiveFace = 0; /* 0 = GL_FRONT, 2 = GL_BACK */
+ ctx->Stencil.Function[0] = GL_ALWAYS;
+ ctx->Stencil.Function[1] = GL_ALWAYS;
+ ctx->Stencil.Function[2] = GL_ALWAYS;
+ ctx->Stencil.FailFunc[0] = GL_KEEP;
+ ctx->Stencil.FailFunc[1] = GL_KEEP;
+ ctx->Stencil.FailFunc[2] = GL_KEEP;
+ ctx->Stencil.ZPassFunc[0] = GL_KEEP;
+ ctx->Stencil.ZPassFunc[1] = GL_KEEP;
+ ctx->Stencil.ZPassFunc[2] = GL_KEEP;
+ ctx->Stencil.ZFailFunc[0] = GL_KEEP;
+ ctx->Stencil.ZFailFunc[1] = GL_KEEP;
+ ctx->Stencil.ZFailFunc[2] = GL_KEEP;
+ ctx->Stencil.Ref[0] = 0;
+ ctx->Stencil.Ref[1] = 0;
+ ctx->Stencil.Ref[2] = 0;
+ ctx->Stencil.ValueMask[0] = ~0U;
+ ctx->Stencil.ValueMask[1] = ~0U;
+ ctx->Stencil.ValueMask[2] = ~0U;
+ ctx->Stencil.WriteMask[0] = ~0U;
+ ctx->Stencil.WriteMask[1] = ~0U;
+ ctx->Stencil.WriteMask[2] = ~0U;
+ ctx->Stencil.Clear = 0;
+ ctx->Stencil._BackFace = 1;
+}
diff --git a/mesalib/src/mesa/main/syncobj.c b/mesalib/src/mesa/main/syncobj.c
index 676038430..25307a17c 100644
--- a/mesalib/src/mesa/main/syncobj.c
+++ b/mesalib/src/mesa/main/syncobj.c
@@ -125,7 +125,7 @@ _mesa_wait_sync(struct gl_context *ctx, struct gl_sync_object *syncObj,
}
-void
+void GLAPIENTRY
_mesa_init_sync_object_functions(struct dd_function_table *driver)
{
driver->NewSyncObject = _mesa_new_sync_object;
@@ -140,7 +140,7 @@ _mesa_init_sync_object_functions(struct dd_function_table *driver)
}
-void
+void GLAPIENTRY
_mesa_init_sync_dispatch(struct _glapi_table *disp)
{
SET_IsSync(disp, _mesa_IsSync);
@@ -156,7 +156,7 @@ _mesa_init_sync_dispatch(struct _glapi_table *disp)
/**
* Allocate/init the context state related to sync objects.
*/
-void
+void GLAPIENTRY
_mesa_init_sync(struct gl_context *ctx)
{
(void) ctx;
@@ -166,7 +166,7 @@ _mesa_init_sync(struct gl_context *ctx)
/**
* Free the context state related to sync objects.
*/
-void
+void GLAPIENTRY
_mesa_free_sync_data(struct gl_context *ctx)
{
(void) ctx;
@@ -182,7 +182,7 @@ _mesa_validate_sync(struct gl_sync_object *syncObj)
}
-void
+void GLAPIENTRY
_mesa_ref_sync_object(struct gl_context *ctx, struct gl_sync_object *syncObj)
{
_glthread_LOCK_MUTEX(ctx->Shared->Mutex);
@@ -191,7 +191,7 @@ _mesa_ref_sync_object(struct gl_context *ctx, struct gl_sync_object *syncObj)
}
-void
+void GLAPIENTRY
_mesa_unref_sync_object(struct gl_context *ctx, struct gl_sync_object *syncObj)
{
_glthread_LOCK_MUTEX(ctx->Shared->Mutex);
diff --git a/mesalib/src/mesa/main/syncobj.h b/mesalib/src/mesa/main/syncobj.h
index ac1384f61..e83ac8b0e 100644
--- a/mesalib/src/mesa/main/syncobj.h
+++ b/mesalib/src/mesa/main/syncobj.h
@@ -41,22 +41,22 @@ struct gl_sync_object;
#if FEATURE_ARB_sync
-extern void
+extern void GLAPIENTRY
_mesa_init_sync_object_functions(struct dd_function_table *driver);
-extern void
+extern void GLAPIENTRY
_mesa_init_sync_dispatch(struct _glapi_table *disp);
-extern void
+extern void GLAPIENTRY
_mesa_init_sync(struct gl_context *);
-extern void
+extern void GLAPIENTRY
_mesa_free_sync_data(struct gl_context *);
-extern void
+extern void GLAPIENTRY
_mesa_ref_sync_object(struct gl_context *ctx, struct gl_sync_object *syncObj);
-extern void
+extern void GLAPIENTRY
_mesa_unref_sync_object(struct gl_context *ctx, struct gl_sync_object *syncObj);
extern GLboolean GLAPIENTRY
diff --git a/mesalib/src/mesa/main/texcompress.c b/mesalib/src/mesa/main/texcompress.c
index d820ae927..59603e81e 100644
--- a/mesalib/src/mesa/main/texcompress.c
+++ b/mesalib/src/mesa/main/texcompress.c
@@ -1,288 +1,288 @@
-/*
- * Mesa 3-D graphics library
- * Version: 6.5.1
- *
- * Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
- * Copyright (c) 2008 VMware, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-
-/**
- * \file texcompress.c
- * Helper functions for texture compression.
- */
-
-
-#include "glheader.h"
-#include "imports.h"
-#include "colormac.h"
-#include "formats.h"
-#include "mfeatures.h"
-#include "mtypes.h"
-#include "texcompress.h"
-
-
-/**
- * Return list of (and count of) all specific texture compression
- * formats that are supported.
- *
- * \param ctx the GL context
- * \param formats the resulting format list (may be NULL).
- * \param all if true return all formats, even those with some kind
- * of restrictions/limitations (See GL_ARB_texture_compression
- * spec for more info).
- *
- * \return number of formats.
- */
-GLuint
-_mesa_get_compressed_formats(struct gl_context *ctx, GLint *formats, GLboolean all)
-{
- GLuint n = 0;
- if (ctx->Extensions.TDFX_texture_compression_FXT1) {
- if (formats) {
- formats[n++] = GL_COMPRESSED_RGB_FXT1_3DFX;
- formats[n++] = GL_COMPRESSED_RGBA_FXT1_3DFX;
- }
- else {
- n += 2;
- }
- }
- /* don't return RGTC - ARB_texture_compression_rgtc query 19 */
- if (ctx->Extensions.EXT_texture_compression_s3tc) {
- if (formats) {
- formats[n++] = GL_COMPRESSED_RGB_S3TC_DXT1_EXT;
- /* This format has some restrictions/limitations and so should
- * not be returned via the GL_COMPRESSED_TEXTURE_FORMATS query.
- * Specifically, all transparent pixels become black. NVIDIA
- * omits this format too.
- */
- if (all)
- formats[n++] = GL_COMPRESSED_RGBA_S3TC_DXT1_EXT;
- formats[n++] = GL_COMPRESSED_RGBA_S3TC_DXT3_EXT;
- formats[n++] = GL_COMPRESSED_RGBA_S3TC_DXT5_EXT;
- }
- else {
- n += 3;
- if (all)
- n += 1;
- }
- }
- if (ctx->Extensions.S3_s3tc) {
- if (formats) {
- formats[n++] = GL_RGB_S3TC;
- formats[n++] = GL_RGB4_S3TC;
- formats[n++] = GL_RGBA_S3TC;
- formats[n++] = GL_RGBA4_S3TC;
- }
- else {
- n += 4;
- }
- }
-#if FEATURE_EXT_texture_sRGB
- if (ctx->Extensions.EXT_texture_sRGB) {
- if (formats) {
- formats[n++] = GL_COMPRESSED_SRGB_S3TC_DXT1_EXT;
- formats[n++] = GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;
- formats[n++] = GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;
- formats[n++] = GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT;
- }
- else {
- n += 4;
- }
- }
-#endif /* FEATURE_EXT_texture_sRGB */
- return n;
-
-#if FEATURE_ES1 || FEATURE_ES2
- if (formats) {
- formats[n++] = GL_PALETTE4_RGB8_OES;
- formats[n++] = GL_PALETTE4_RGBA8_OES;
- formats[n++] = GL_PALETTE4_R5_G6_B5_OES;
- formats[n++] = GL_PALETTE4_RGBA4_OES;
- formats[n++] = GL_PALETTE4_RGB5_A1_OES;
- formats[n++] = GL_PALETTE8_RGB8_OES;
- formats[n++] = GL_PALETTE8_RGBA8_OES;
- formats[n++] = GL_PALETTE8_R5_G6_B5_OES;
- formats[n++] = GL_PALETTE8_RGBA4_OES;
- formats[n++] = GL_PALETTE8_RGB5_A1_OES;
- }
- else {
- n += 10;
- }
-#endif
-}
-
-
-/**
- * Convert a compressed MESA_FORMAT_x to a GLenum.
- */
-gl_format
-_mesa_glenum_to_compressed_format(GLenum format)
-{
- switch (format) {
- case GL_COMPRESSED_RGB_FXT1_3DFX:
- return MESA_FORMAT_RGB_FXT1;
- case GL_COMPRESSED_RGBA_FXT1_3DFX:
- return MESA_FORMAT_RGBA_FXT1;
-
- case GL_COMPRESSED_RGB_S3TC_DXT1_EXT:
- case GL_RGB_S3TC:
- return MESA_FORMAT_RGB_DXT1;
- case GL_COMPRESSED_RGBA_S3TC_DXT1_EXT:
- case GL_RGB4_S3TC:
- return MESA_FORMAT_RGBA_DXT1;
- case GL_COMPRESSED_RGBA_S3TC_DXT3_EXT:
- case GL_RGBA_S3TC:
- return MESA_FORMAT_RGBA_DXT3;
- case GL_COMPRESSED_RGBA_S3TC_DXT5_EXT:
- case GL_RGBA4_S3TC:
- return MESA_FORMAT_RGBA_DXT5;
-
- case GL_COMPRESSED_SRGB_S3TC_DXT1_EXT:
- return MESA_FORMAT_SRGB_DXT1;
- case GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT:
- return MESA_FORMAT_SRGBA_DXT1;
- case GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT:
- return MESA_FORMAT_SRGBA_DXT3;
- case GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT:
- return MESA_FORMAT_SRGBA_DXT5;
-
- case GL_COMPRESSED_RED_RGTC1:
- return MESA_FORMAT_RED_RGTC1;
- case GL_COMPRESSED_SIGNED_RED_RGTC1:
- return MESA_FORMAT_SIGNED_RED_RGTC1;
- case GL_COMPRESSED_RG_RGTC2:
- return MESA_FORMAT_RG_RGTC2;
- case GL_COMPRESSED_SIGNED_RG_RGTC2:
- return MESA_FORMAT_SIGNED_RG_RGTC2;
-
- case GL_COMPRESSED_LUMINANCE_LATC1_EXT:
- return MESA_FORMAT_L_LATC1;
- case GL_COMPRESSED_SIGNED_LUMINANCE_LATC1_EXT:
- return MESA_FORMAT_SIGNED_L_LATC1;
- case GL_COMPRESSED_LUMINANCE_ALPHA_LATC2_EXT:
- case GL_COMPRESSED_LUMINANCE_ALPHA_3DC_ATI:
- return MESA_FORMAT_LA_LATC2;
- case GL_COMPRESSED_SIGNED_LUMINANCE_ALPHA_LATC2_EXT:
- return MESA_FORMAT_SIGNED_LA_LATC2;
-
- default:
- return MESA_FORMAT_NONE;
- }
-}
-
-
-/**
- * Given a compressed MESA_FORMAT_x value, return the corresponding
- * GLenum for that format.
- * This is needed for glGetTexLevelParameter(GL_TEXTURE_INTERNAL_FORMAT)
- * which must return the specific texture format used when the user might
- * have originally specified a generic compressed format in their
- * glTexImage2D() call.
- * For non-compressed textures, we always return the user-specified
- * internal format unchanged.
- */
-GLenum
-_mesa_compressed_format_to_glenum(struct gl_context *ctx, GLuint mesaFormat)
-{
- switch (mesaFormat) {
-#if FEATURE_texture_fxt1
- case MESA_FORMAT_RGB_FXT1:
- return GL_COMPRESSED_RGB_FXT1_3DFX;
- case MESA_FORMAT_RGBA_FXT1:
- return GL_COMPRESSED_RGBA_FXT1_3DFX;
-#endif
-#if FEATURE_texture_s3tc
- case MESA_FORMAT_RGB_DXT1:
- return GL_COMPRESSED_RGB_S3TC_DXT1_EXT;
- case MESA_FORMAT_RGBA_DXT1:
- return GL_COMPRESSED_RGBA_S3TC_DXT1_EXT;
- case MESA_FORMAT_RGBA_DXT3:
- return GL_COMPRESSED_RGBA_S3TC_DXT3_EXT;
- case MESA_FORMAT_RGBA_DXT5:
- return GL_COMPRESSED_RGBA_S3TC_DXT5_EXT;
-#if FEATURE_EXT_texture_sRGB
- case MESA_FORMAT_SRGB_DXT1:
- return GL_COMPRESSED_SRGB_S3TC_DXT1_EXT;
- case MESA_FORMAT_SRGBA_DXT1:
- return GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;
- case MESA_FORMAT_SRGBA_DXT3:
- return GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;
- case MESA_FORMAT_SRGBA_DXT5:
- return GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT;
-#endif
-#endif
-
- case MESA_FORMAT_RED_RGTC1:
- return GL_COMPRESSED_RED_RGTC1;
- case MESA_FORMAT_SIGNED_RED_RGTC1:
- return GL_COMPRESSED_SIGNED_RED_RGTC1;
- case MESA_FORMAT_RG_RGTC2:
- return GL_COMPRESSED_RG_RGTC2;
- case MESA_FORMAT_SIGNED_RG_RGTC2:
- return GL_COMPRESSED_SIGNED_RG_RGTC2;
-
- case MESA_FORMAT_L_LATC1:
- return GL_COMPRESSED_LUMINANCE_LATC1_EXT;
- case MESA_FORMAT_SIGNED_L_LATC1:
- return GL_COMPRESSED_SIGNED_LUMINANCE_LATC1_EXT;
- case MESA_FORMAT_LA_LATC2:
- return GL_COMPRESSED_LUMINANCE_ALPHA_LATC2_EXT;
- case MESA_FORMAT_SIGNED_LA_LATC2:
- return GL_COMPRESSED_SIGNED_LUMINANCE_ALPHA_LATC2_EXT;
-
- default:
- _mesa_problem(ctx, "Unexpected mesa texture format in"
- " _mesa_compressed_format_to_glenum()");
- return 0;
- }
-}
-
-
-/*
- * Return the address of the pixel at (col, row, img) in a
- * compressed texture image.
- * \param col, row, img - image position (3D), should be a multiple of the
- * format's block size.
- * \param format - compressed image format
- * \param width - image width (stride) in pixels
- * \param image - the image address
- * \return address of pixel at (row, col, img)
- */
-GLubyte *
-_mesa_compressed_image_address(GLint col, GLint row, GLint img,
- gl_format mesaFormat,
- GLsizei width, const GLubyte *image)
-{
- /* XXX only 2D images implemented, not 3D */
- const GLuint blockSize = _mesa_get_format_bytes(mesaFormat);
- GLuint bw, bh;
- GLint offset;
-
- _mesa_get_format_block_size(mesaFormat, &bw, &bh);
-
- ASSERT(col % bw == 0);
- ASSERT(row % bh == 0);
-
- offset = ((width + bw - 1) / bw) * (row / bh) + col / bw;
- offset *= blockSize;
-
- return (GLubyte *) image + offset;
-}
+/*
+ * Mesa 3-D graphics library
+ * Version: 6.5.1
+ *
+ * Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
+ * Copyright (c) 2008 VMware, Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+
+/**
+ * \file texcompress.c
+ * Helper functions for texture compression.
+ */
+
+
+#include "glheader.h"
+#include "imports.h"
+#include "colormac.h"
+#include "formats.h"
+#include "mfeatures.h"
+#include "mtypes.h"
+#include "texcompress.h"
+
+
+/**
+ * Return list of (and count of) all specific texture compression
+ * formats that are supported.
+ *
+ * \param ctx the GL context
+ * \param formats the resulting format list (may be NULL).
+ * \param all if true return all formats, even those with some kind
+ * of restrictions/limitations (See GL_ARB_texture_compression
+ * spec for more info).
+ *
+ * \return number of formats.
+ */
+GLuint
+_mesa_get_compressed_formats(struct gl_context *ctx, GLint *formats, GLboolean all)
+{
+ GLuint n = 0;
+ if (ctx->Extensions.TDFX_texture_compression_FXT1) {
+ if (formats) {
+ formats[n++] = GL_COMPRESSED_RGB_FXT1_3DFX;
+ formats[n++] = GL_COMPRESSED_RGBA_FXT1_3DFX;
+ }
+ else {
+ n += 2;
+ }
+ }
+ /* don't return RGTC - ARB_texture_compression_rgtc query 19 */
+ if (ctx->Extensions.EXT_texture_compression_s3tc) {
+ if (formats) {
+ formats[n++] = GL_COMPRESSED_RGB_S3TC_DXT1_EXT;
+ /* This format has some restrictions/limitations and so should
+ * not be returned via the GL_COMPRESSED_TEXTURE_FORMATS query.
+ * Specifically, all transparent pixels become black. NVIDIA
+ * omits this format too.
+ */
+ if (all)
+ formats[n++] = GL_COMPRESSED_RGBA_S3TC_DXT1_EXT;
+ formats[n++] = GL_COMPRESSED_RGBA_S3TC_DXT3_EXT;
+ formats[n++] = GL_COMPRESSED_RGBA_S3TC_DXT5_EXT;
+ }
+ else {
+ n += 3;
+ if (all)
+ n += 1;
+ }
+ }
+ if (ctx->Extensions.S3_s3tc) {
+ if (formats) {
+ formats[n++] = GL_RGB_S3TC;
+ formats[n++] = GL_RGB4_S3TC;
+ formats[n++] = GL_RGBA_S3TC;
+ formats[n++] = GL_RGBA4_S3TC;
+ }
+ else {
+ n += 4;
+ }
+ }
+#if FEATURE_EXT_texture_sRGB
+ if (ctx->Extensions.EXT_texture_sRGB) {
+ if (formats) {
+ formats[n++] = GL_COMPRESSED_SRGB_S3TC_DXT1_EXT;
+ formats[n++] = GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;
+ formats[n++] = GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;
+ formats[n++] = GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT;
+ }
+ else {
+ n += 4;
+ }
+ }
+#endif /* FEATURE_EXT_texture_sRGB */
+ return n;
+
+#if FEATURE_ES1 || FEATURE_ES2
+ if (formats) {
+ formats[n++] = GL_PALETTE4_RGB8_OES;
+ formats[n++] = GL_PALETTE4_RGBA8_OES;
+ formats[n++] = GL_PALETTE4_R5_G6_B5_OES;
+ formats[n++] = GL_PALETTE4_RGBA4_OES;
+ formats[n++] = GL_PALETTE4_RGB5_A1_OES;
+ formats[n++] = GL_PALETTE8_RGB8_OES;
+ formats[n++] = GL_PALETTE8_RGBA8_OES;
+ formats[n++] = GL_PALETTE8_R5_G6_B5_OES;
+ formats[n++] = GL_PALETTE8_RGBA4_OES;
+ formats[n++] = GL_PALETTE8_RGB5_A1_OES;
+ }
+ else {
+ n += 10;
+ }
+#endif
+}
+
+
+/**
+ * Convert a compressed MESA_FORMAT_x to a GLenum.
+ */
+gl_format
+_mesa_glenum_to_compressed_format(GLenum format)
+{
+ switch (format) {
+ case GL_COMPRESSED_RGB_FXT1_3DFX:
+ return MESA_FORMAT_RGB_FXT1;
+ case GL_COMPRESSED_RGBA_FXT1_3DFX:
+ return MESA_FORMAT_RGBA_FXT1;
+
+ case GL_COMPRESSED_RGB_S3TC_DXT1_EXT:
+ case GL_RGB_S3TC:
+ return MESA_FORMAT_RGB_DXT1;
+ case GL_COMPRESSED_RGBA_S3TC_DXT1_EXT:
+ case GL_RGB4_S3TC:
+ return MESA_FORMAT_RGBA_DXT1;
+ case GL_COMPRESSED_RGBA_S3TC_DXT3_EXT:
+ case GL_RGBA_S3TC:
+ return MESA_FORMAT_RGBA_DXT3;
+ case GL_COMPRESSED_RGBA_S3TC_DXT5_EXT:
+ case GL_RGBA4_S3TC:
+ return MESA_FORMAT_RGBA_DXT5;
+
+ case GL_COMPRESSED_SRGB_S3TC_DXT1_EXT:
+ return MESA_FORMAT_SRGB_DXT1;
+ case GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT:
+ return MESA_FORMAT_SRGBA_DXT1;
+ case GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT:
+ return MESA_FORMAT_SRGBA_DXT3;
+ case GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT:
+ return MESA_FORMAT_SRGBA_DXT5;
+
+ case GL_COMPRESSED_RED_RGTC1:
+ return MESA_FORMAT_RED_RGTC1;
+ case GL_COMPRESSED_SIGNED_RED_RGTC1:
+ return MESA_FORMAT_SIGNED_RED_RGTC1;
+ case GL_COMPRESSED_RG_RGTC2:
+ return MESA_FORMAT_RG_RGTC2;
+ case GL_COMPRESSED_SIGNED_RG_RGTC2:
+ return MESA_FORMAT_SIGNED_RG_RGTC2;
+
+ case GL_COMPRESSED_LUMINANCE_LATC1_EXT:
+ return MESA_FORMAT_L_LATC1;
+ case GL_COMPRESSED_SIGNED_LUMINANCE_LATC1_EXT:
+ return MESA_FORMAT_SIGNED_L_LATC1;
+ case GL_COMPRESSED_LUMINANCE_ALPHA_LATC2_EXT:
+ case GL_COMPRESSED_LUMINANCE_ALPHA_3DC_ATI:
+ return MESA_FORMAT_LA_LATC2;
+ case GL_COMPRESSED_SIGNED_LUMINANCE_ALPHA_LATC2_EXT:
+ return MESA_FORMAT_SIGNED_LA_LATC2;
+
+ default:
+ return MESA_FORMAT_NONE;
+ }
+}
+
+
+/**
+ * Given a compressed MESA_FORMAT_x value, return the corresponding
+ * GLenum for that format.
+ * This is needed for glGetTexLevelParameter(GL_TEXTURE_INTERNAL_FORMAT)
+ * which must return the specific texture format used when the user might
+ * have originally specified a generic compressed format in their
+ * glTexImage2D() call.
+ * For non-compressed textures, we always return the user-specified
+ * internal format unchanged.
+ */
+GLenum
+_mesa_compressed_format_to_glenum(struct gl_context *ctx, GLuint mesaFormat)
+{
+ switch (mesaFormat) {
+#if FEATURE_texture_fxt1
+ case MESA_FORMAT_RGB_FXT1:
+ return GL_COMPRESSED_RGB_FXT1_3DFX;
+ case MESA_FORMAT_RGBA_FXT1:
+ return GL_COMPRESSED_RGBA_FXT1_3DFX;
+#endif
+#if FEATURE_texture_s3tc
+ case MESA_FORMAT_RGB_DXT1:
+ return GL_COMPRESSED_RGB_S3TC_DXT1_EXT;
+ case MESA_FORMAT_RGBA_DXT1:
+ return GL_COMPRESSED_RGBA_S3TC_DXT1_EXT;
+ case MESA_FORMAT_RGBA_DXT3:
+ return GL_COMPRESSED_RGBA_S3TC_DXT3_EXT;
+ case MESA_FORMAT_RGBA_DXT5:
+ return GL_COMPRESSED_RGBA_S3TC_DXT5_EXT;
+#if FEATURE_EXT_texture_sRGB
+ case MESA_FORMAT_SRGB_DXT1:
+ return GL_COMPRESSED_SRGB_S3TC_DXT1_EXT;
+ case MESA_FORMAT_SRGBA_DXT1:
+ return GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;
+ case MESA_FORMAT_SRGBA_DXT3:
+ return GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;
+ case MESA_FORMAT_SRGBA_DXT5:
+ return GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT;
+#endif
+#endif
+
+ case MESA_FORMAT_RED_RGTC1:
+ return GL_COMPRESSED_RED_RGTC1;
+ case MESA_FORMAT_SIGNED_RED_RGTC1:
+ return GL_COMPRESSED_SIGNED_RED_RGTC1;
+ case MESA_FORMAT_RG_RGTC2:
+ return GL_COMPRESSED_RG_RGTC2;
+ case MESA_FORMAT_SIGNED_RG_RGTC2:
+ return GL_COMPRESSED_SIGNED_RG_RGTC2;
+
+ case MESA_FORMAT_L_LATC1:
+ return GL_COMPRESSED_LUMINANCE_LATC1_EXT;
+ case MESA_FORMAT_SIGNED_L_LATC1:
+ return GL_COMPRESSED_SIGNED_LUMINANCE_LATC1_EXT;
+ case MESA_FORMAT_LA_LATC2:
+ return GL_COMPRESSED_LUMINANCE_ALPHA_LATC2_EXT;
+ case MESA_FORMAT_SIGNED_LA_LATC2:
+ return GL_COMPRESSED_SIGNED_LUMINANCE_ALPHA_LATC2_EXT;
+
+ default:
+ _mesa_problem(ctx, "Unexpected mesa texture format in"
+ " _mesa_compressed_format_to_glenum()");
+ return 0;
+ }
+}
+
+
+/*
+ * Return the address of the pixel at (col, row, img) in a
+ * compressed texture image.
+ * \param col, row, img - image position (3D), should be a multiple of the
+ * format's block size.
+ * \param format - compressed image format
+ * \param width - image width (stride) in pixels
+ * \param image - the image address
+ * \return address of pixel at (row, col, img)
+ */
+GLubyte *
+_mesa_compressed_image_address(GLint col, GLint row, GLint img,
+ gl_format mesaFormat,
+ GLsizei width, const GLubyte *image)
+{
+ /* XXX only 2D images implemented, not 3D */
+ const GLuint blockSize = _mesa_get_format_bytes(mesaFormat);
+ GLuint bw, bh;
+ GLint offset;
+
+ _mesa_get_format_block_size(mesaFormat, &bw, &bh);
+
+ ASSERT(col % bw == 0);
+ ASSERT(row % bh == 0);
+
+ offset = ((width + bw - 1) / bw) * (row / bh) + col / bw;
+ offset *= blockSize;
+
+ return (GLubyte *) image + offset;
+}
diff --git a/mesalib/src/mesa/main/texcompress_rgtc.h b/mesalib/src/mesa/main/texcompress_rgtc.h
index 18766770d..a64ef9968 100644
--- a/mesalib/src/mesa/main/texcompress_rgtc.h
+++ b/mesalib/src/mesa/main/texcompress_rgtc.h
@@ -1,77 +1,77 @@
-/*
- * Copyright (C) 2011 Red Hat Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-
-#ifndef TEXCOMPRESS_RGTC_H
-#define TEXCOMPRESS_RGTC_H
-
-#include "glheader.h"
-#include "mfeatures.h"
-#include "texstore.h"
-
-struct gl_texture_image;
-
-extern GLboolean
-_mesa_texstore_red_rgtc1(TEXSTORE_PARAMS);
-
-extern GLboolean
-_mesa_texstore_signed_red_rgtc1(TEXSTORE_PARAMS);
-
-extern GLboolean
-_mesa_texstore_rg_rgtc2(TEXSTORE_PARAMS);
-
-extern GLboolean
-_mesa_texstore_signed_rg_rgtc2(TEXSTORE_PARAMS);
-
-extern void
-_mesa_fetch_texel_2d_f_red_rgtc1(const struct gl_texture_image *texImage,
- GLint i, GLint j, GLint k, GLfloat *texel);
-
-extern void
-_mesa_fetch_texel_2d_f_signed_red_rgtc1(const struct gl_texture_image *texImage,
- GLint i, GLint j, GLint k, GLfloat *texel);
-
-extern void
-_mesa_fetch_texel_2d_f_rg_rgtc2(const struct gl_texture_image *texImage,
- GLint i, GLint j, GLint k, GLfloat *texel);
-
-extern void
-_mesa_fetch_texel_2d_f_signed_rg_rgtc2(const struct gl_texture_image *texImage,
- GLint i, GLint j, GLint k, GLfloat *texel);
-
-extern void
-_mesa_fetch_texel_2d_f_l_latc1(const struct gl_texture_image *texImage,
- GLint i, GLint j, GLint k, GLfloat *texel);
-
-extern void
-_mesa_fetch_texel_2d_f_signed_l_latc1(const struct gl_texture_image *texImage,
- GLint i, GLint j, GLint k, GLfloat *texel);
-
-extern void
-_mesa_fetch_texel_2d_f_la_latc2(const struct gl_texture_image *texImage,
- GLint i, GLint j, GLint k, GLfloat *texel);
-
-extern void
-_mesa_fetch_texel_2d_f_signed_la_latc2(const struct gl_texture_image *texImage,
- GLint i, GLint j, GLint k, GLfloat *texel);
-
-#endif
+/*
+ * Copyright (C) 2011 Red Hat Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+#ifndef TEXCOMPRESS_RGTC_H
+#define TEXCOMPRESS_RGTC_H
+
+#include "glheader.h"
+#include "mfeatures.h"
+#include "texstore.h"
+
+struct gl_texture_image;
+
+extern GLboolean
+_mesa_texstore_red_rgtc1(TEXSTORE_PARAMS);
+
+extern GLboolean
+_mesa_texstore_signed_red_rgtc1(TEXSTORE_PARAMS);
+
+extern GLboolean
+_mesa_texstore_rg_rgtc2(TEXSTORE_PARAMS);
+
+extern GLboolean
+_mesa_texstore_signed_rg_rgtc2(TEXSTORE_PARAMS);
+
+extern void
+_mesa_fetch_texel_2d_f_red_rgtc1(const struct gl_texture_image *texImage,
+ GLint i, GLint j, GLint k, GLfloat *texel);
+
+extern void
+_mesa_fetch_texel_2d_f_signed_red_rgtc1(const struct gl_texture_image *texImage,
+ GLint i, GLint j, GLint k, GLfloat *texel);
+
+extern void
+_mesa_fetch_texel_2d_f_rg_rgtc2(const struct gl_texture_image *texImage,
+ GLint i, GLint j, GLint k, GLfloat *texel);
+
+extern void
+_mesa_fetch_texel_2d_f_signed_rg_rgtc2(const struct gl_texture_image *texImage,
+ GLint i, GLint j, GLint k, GLfloat *texel);
+
+extern void
+_mesa_fetch_texel_2d_f_l_latc1(const struct gl_texture_image *texImage,
+ GLint i, GLint j, GLint k, GLfloat *texel);
+
+extern void
+_mesa_fetch_texel_2d_f_signed_l_latc1(const struct gl_texture_image *texImage,
+ GLint i, GLint j, GLint k, GLfloat *texel);
+
+extern void
+_mesa_fetch_texel_2d_f_la_latc2(const struct gl_texture_image *texImage,
+ GLint i, GLint j, GLint k, GLfloat *texel);
+
+extern void
+_mesa_fetch_texel_2d_f_signed_la_latc2(const struct gl_texture_image *texImage,
+ GLint i, GLint j, GLint k, GLfloat *texel);
+
+#endif
diff --git a/mesalib/src/mesa/main/texcompress_rgtc_tmp.h b/mesalib/src/mesa/main/texcompress_rgtc_tmp.h
index c8bf082a1..335e1f4a1 100644
--- a/mesalib/src/mesa/main/texcompress_rgtc_tmp.h
+++ b/mesalib/src/mesa/main/texcompress_rgtc_tmp.h
@@ -1,418 +1,418 @@
-/*
- * Copyright (C) 2011 Red Hat Inc.
- *
- * block compression parts are:
- * Copyright (C) 2004 Roland Scheidegger All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- *
- * Author:
- * Dave Airlie
- */
-
-/* included by texcompress_rgtc to define byte/ubyte compressors */
-
-static void TAG(fetch_texel_rgtc)(unsigned srcRowStride, const TYPE *pixdata,
- unsigned i, unsigned j, TYPE *value, unsigned comps)
-{
- TYPE decode;
- const TYPE *blksrc = (pixdata + ((srcRowStride + 3) / 4 * (j / 4) + (i / 4)) * 8 * comps);
- const TYPE alpha0 = blksrc[0];
- const TYPE alpha1 = blksrc[1];
- const char bit_pos = ((j&3) * 4 + (i&3)) * 3;
- const TYPE acodelow = blksrc[2 + bit_pos / 8];
- const TYPE acodehigh = (3 + bit_pos / 8) < 8 ? blksrc[3 + bit_pos / 8] : 0;
- const TYPE code = (acodelow >> (bit_pos & 0x7) |
- (acodehigh << (8 - (bit_pos & 0x7)))) & 0x7;
-
- if (code == 0)
- decode = alpha0;
- else if (code == 1)
- decode = alpha1;
- else if (alpha0 > alpha1)
- decode = ((alpha0 * (8 - code) + (alpha1 * (code - 1))) / 7);
- else if (code < 6)
- decode = ((alpha0 * (6 - code) + (alpha1 * (code - 1))) / 5);
- else if (code == 6)
- decode = T_MIN;
- else
- decode = T_MAX;
-
- *value = decode;
-}
-
-static void TAG(write_rgtc_encoded_channel)(TYPE *blkaddr,
- TYPE alphabase1,
- TYPE alphabase2,
- TYPE alphaenc[16])
-{
- *blkaddr++ = alphabase1;
- *blkaddr++ = alphabase2;
- *blkaddr++ = alphaenc[0] | (alphaenc[1] << 3) | ((alphaenc[2] & 3) << 6);
- *blkaddr++ = (alphaenc[2] >> 2) | (alphaenc[3] << 1) | (alphaenc[4] << 4) | ((alphaenc[5] & 1) << 7);
- *blkaddr++ = (alphaenc[5] >> 1) | (alphaenc[6] << 2) | (alphaenc[7] << 5);
- *blkaddr++ = alphaenc[8] | (alphaenc[9] << 3) | ((alphaenc[10] & 3) << 6);
- *blkaddr++ = (alphaenc[10] >> 2) | (alphaenc[11] << 1) | (alphaenc[12] << 4) | ((alphaenc[13] & 1) << 7);
- *blkaddr++ = (alphaenc[13] >> 1) | (alphaenc[14] << 2) | (alphaenc[15] << 5);
-}
-
-static void TAG(encode_rgtc_chan)(TYPE *blkaddr, TYPE srccolors[4][4],
- int numxpixels, int numypixels)
-{
- TYPE alphabase[2], alphause[2];
- short alphatest[2] = { 0 };
- unsigned int alphablockerror1, alphablockerror2, alphablockerror3;
- TYPE i, j, aindex, acutValues[7];
- TYPE alphaenc1[16], alphaenc2[16], alphaenc3[16];
- int alphaabsmin = 0, alphaabsmax = 0;
- short alphadist;
-
- /* find lowest and highest alpha value in block, alphabase[0] lowest, alphabase[1] highest */
- alphabase[0] = T_MAX; alphabase[1] = T_MIN;
- for (j = 0; j < numypixels; j++) {
- for (i = 0; i < numxpixels; i++) {
- if (srccolors[j][i] == T_MIN)
- alphaabsmin = 1;
- else if (srccolors[j][i] == T_MAX)
- alphaabsmax = 1;
- else {
- if (srccolors[j][i] > alphabase[1])
- alphabase[1] = srccolors[j][i];
- if (srccolors[j][i] < alphabase[0])
- alphabase[0] = srccolors[j][i];
- }
- }
- }
-
-
- if (((alphabase[0] > alphabase[1]) && !(alphaabsmin && alphaabsmax))
- || (alphabase[0] == alphabase[1] && !alphaabsmin && !alphaabsmax)) { /* one color, either max or min */
- /* shortcut here since it is a very common case (and also avoids later problems) */
- /* could also thest for alpha0 == alpha1 (and not min/max), but probably not common, so don't bother */
-
- *blkaddr++ = srccolors[0][0];
- blkaddr++;
- *blkaddr++ = 0;
- *blkaddr++ = 0;
- *blkaddr++ = 0;
- *blkaddr++ = 0;
- *blkaddr++ = 0;
- *blkaddr++ = 0;
-#if RGTC_DEBUG
- fprintf(stderr, "enc0 used\n");
-#endif
- return;
- }
-
- /* find best encoding for alpha0 > alpha1 */
- /* it's possible this encoding is better even if both alphaabsmin and alphaabsmax are true */
- alphablockerror1 = 0x0;
- alphablockerror2 = 0xffffffff;
- alphablockerror3 = 0xffffffff;
- if (alphaabsmin) alphause[0] = T_MIN;
- else alphause[0] = alphabase[0];
- if (alphaabsmax) alphause[1] = T_MAX;
- else alphause[1] = alphabase[1];
- /* calculate the 7 cut values, just the middle between 2 of the computed alpha values */
- for (aindex = 0; aindex < 7; aindex++) {
- /* don't forget here is always rounded down */
- acutValues[aindex] = (alphause[0] * (2*aindex + 1) + alphause[1] * (14 - (2*aindex + 1))) / 14;
- }
-
- for (j = 0; j < numypixels; j++) {
- for (i = 0; i < numxpixels; i++) {
- /* maybe it's overkill to have the most complicated calculation just for the error
- calculation which we only need to figure out if encoding1 or encoding2 is better... */
- if (srccolors[j][i] > acutValues[0]) {
- alphaenc1[4*j + i] = 0;
- alphadist = srccolors[j][i] - alphause[1];
- }
- else if (srccolors[j][i] > acutValues[1]) {
- alphaenc1[4*j + i] = 2;
- alphadist = srccolors[j][i] - (alphause[1] * 6 + alphause[0] * 1) / 7;
- }
- else if (srccolors[j][i] > acutValues[2]) {
- alphaenc1[4*j + i] = 3;
- alphadist = srccolors[j][i] - (alphause[1] * 5 + alphause[0] * 2) / 7;
- }
- else if (srccolors[j][i] > acutValues[3]) {
- alphaenc1[4*j + i] = 4;
- alphadist = srccolors[j][i] - (alphause[1] * 4 + alphause[0] * 3) / 7;
- }
- else if (srccolors[j][i] > acutValues[4]) {
- alphaenc1[4*j + i] = 5;
- alphadist = srccolors[j][i] - (alphause[1] * 3 + alphause[0] * 4) / 7;
- }
- else if (srccolors[j][i] > acutValues[5]) {
- alphaenc1[4*j + i] = 6;
- alphadist = srccolors[j][i] - (alphause[1] * 2 + alphause[0] * 5) / 7;
- }
- else if (srccolors[j][i] > acutValues[6]) {
- alphaenc1[4*j + i] = 7;
- alphadist = srccolors[j][i] - (alphause[1] * 1 + alphause[0] * 6) / 7;
- }
- else {
- alphaenc1[4*j + i] = 1;
- alphadist = srccolors[j][i] - alphause[0];
- }
- alphablockerror1 += alphadist * alphadist;
- }
- }
-
-#if RGTC_DEBUG
- for (i = 0; i < 16; i++) {
- fprintf(stderr, "%d ", alphaenc1[i]);
- }
- fprintf(stderr, "cutVals ");
- for (i = 0; i < 8; i++) {
- fprintf(stderr, "%d ", acutValues[i]);
- }
- fprintf(stderr, "srcVals ");
- for (j = 0; j < numypixels; j++) {
- for (i = 0; i < numxpixels; i++) {
- fprintf(stderr, "%d ", srccolors[j][i]);
- }
- }
- fprintf(stderr, "\n");
-#endif
-
- /* it's not very likely this encoding is better if both alphaabsmin and alphaabsmax
- are false but try it anyway */
- if (alphablockerror1 >= 32) {
-
- /* don't bother if encoding is already very good, this condition should also imply
- we have valid alphabase colors which we absolutely need (alphabase[0] <= alphabase[1]) */
- alphablockerror2 = 0;
- for (aindex = 0; aindex < 5; aindex++) {
- /* don't forget here is always rounded down */
- acutValues[aindex] = (alphabase[0] * (10 - (2*aindex + 1)) + alphabase[1] * (2*aindex + 1)) / 10;
- }
- for (j = 0; j < numypixels; j++) {
- for (i = 0; i < numxpixels; i++) {
- /* maybe it's overkill to have the most complicated calculation just for the error
- calculation which we only need to figure out if encoding1 or encoding2 is better... */
- if (srccolors[j][i] == T_MIN) {
- alphaenc2[4*j + i] = 6;
- alphadist = 0;
- }
- else if (srccolors[j][i] == T_MAX) {
- alphaenc2[4*j + i] = 7;
- alphadist = 0;
- }
- else if (srccolors[j][i] <= acutValues[0]) {
- alphaenc2[4*j + i] = 0;
- alphadist = srccolors[j][i] - alphabase[0];
- }
- else if (srccolors[j][i] <= acutValues[1]) {
- alphaenc2[4*j + i] = 2;
- alphadist = srccolors[j][i] - (alphabase[0] * 4 + alphabase[1] * 1) / 5;
- }
- else if (srccolors[j][i] <= acutValues[2]) {
- alphaenc2[4*j + i] = 3;
- alphadist = srccolors[j][i] - (alphabase[0] * 3 + alphabase[1] * 2) / 5;
- }
- else if (srccolors[j][i] <= acutValues[3]) {
- alphaenc2[4*j + i] = 4;
- alphadist = srccolors[j][i] - (alphabase[0] * 2 + alphabase[1] * 3) / 5;
- }
- else if (srccolors[j][i] <= acutValues[4]) {
- alphaenc2[4*j + i] = 5;
- alphadist = srccolors[j][i] - (alphabase[0] * 1 + alphabase[1] * 4) / 5;
- }
- else {
- alphaenc2[4*j + i] = 1;
- alphadist = srccolors[j][i] - alphabase[1];
- }
- alphablockerror2 += alphadist * alphadist;
- }
- }
-
-
- /* skip this if the error is already very small
- this encoding is MUCH better on average than #2 though, but expensive! */
- if ((alphablockerror2 > 96) && (alphablockerror1 > 96)) {
- short blockerrlin1 = 0;
- short blockerrlin2 = 0;
- TYPE nralphainrangelow = 0;
- TYPE nralphainrangehigh = 0;
- alphatest[0] = T_MAX;
- alphatest[1] = T_MIN;
- /* if we have large range it's likely there are values close to 0/255, try to map them to 0/255 */
- for (j = 0; j < numypixels; j++) {
- for (i = 0; i < numxpixels; i++) {
- if ((srccolors[j][i] > alphatest[1]) && (srccolors[j][i] < (T_MAX -(alphabase[1] - alphabase[0]) / 28)))
- alphatest[1] = srccolors[j][i];
- if ((srccolors[j][i] < alphatest[0]) && (srccolors[j][i] > (alphabase[1] - alphabase[0]) / 28))
- alphatest[0] = srccolors[j][i];
- }
- }
- /* shouldn't happen too often, don't really care about those degenerated cases */
- if (alphatest[1] <= alphatest[0]) {
- alphatest[0] = T_MIN+1;
- alphatest[1] = T_MAX-1;
- }
- for (aindex = 0; aindex < 5; aindex++) {
- /* don't forget here is always rounded down */
- acutValues[aindex] = (alphatest[0] * (10 - (2*aindex + 1)) + alphatest[1] * (2*aindex + 1)) / 10;
- }
-
- /* find the "average" difference between the alpha values and the next encoded value.
- This is then used to calculate new base values.
- Should there be some weighting, i.e. those values closer to alphatest[x] have more weight,
- since they will see more improvement, and also because the values in the middle are somewhat
- likely to get no improvement at all (because the base values might move in different directions)?
- OTOH it would mean the values in the middle are even less likely to get an improvement
- */
- for (j = 0; j < numypixels; j++) {
- for (i = 0; i < numxpixels; i++) {
- if (srccolors[j][i] <= alphatest[0] / 2) {
- }
- else if (srccolors[j][i] > ((T_MAX + alphatest[1]) / 2)) {
- }
- else if (srccolors[j][i] <= acutValues[0]) {
- blockerrlin1 += (srccolors[j][i] - alphatest[0]);
- nralphainrangelow += 1;
- }
- else if (srccolors[j][i] <= acutValues[1]) {
- blockerrlin1 += (srccolors[j][i] - (alphatest[0] * 4 + alphatest[1] * 1) / 5);
- blockerrlin2 += (srccolors[j][i] - (alphatest[0] * 4 + alphatest[1] * 1) / 5);
- nralphainrangelow += 1;
- nralphainrangehigh += 1;
- }
- else if (srccolors[j][i] <= acutValues[2]) {
- blockerrlin1 += (srccolors[j][i] - (alphatest[0] * 3 + alphatest[1] * 2) / 5);
- blockerrlin2 += (srccolors[j][i] - (alphatest[0] * 3 + alphatest[1] * 2) / 5);
- nralphainrangelow += 1;
- nralphainrangehigh += 1;
- }
- else if (srccolors[j][i] <= acutValues[3]) {
- blockerrlin1 += (srccolors[j][i] - (alphatest[0] * 2 + alphatest[1] * 3) / 5);
- blockerrlin2 += (srccolors[j][i] - (alphatest[0] * 2 + alphatest[1] * 3) / 5);
- nralphainrangelow += 1;
- nralphainrangehigh += 1;
- }
- else if (srccolors[j][i] <= acutValues[4]) {
- blockerrlin1 += (srccolors[j][i] - (alphatest[0] * 1 + alphatest[1] * 4) / 5);
- blockerrlin2 += (srccolors[j][i] - (alphatest[0] * 1 + alphatest[1] * 4) / 5);
- nralphainrangelow += 1;
- nralphainrangehigh += 1;
- }
- else {
- blockerrlin2 += (srccolors[j][i] - alphatest[1]);
- nralphainrangehigh += 1;
- }
- }
- }
- /* shouldn't happen often, needed to avoid div by zero */
- if (nralphainrangelow == 0) nralphainrangelow = 1;
- if (nralphainrangehigh == 0) nralphainrangehigh = 1;
- alphatest[0] = alphatest[0] + (blockerrlin1 / nralphainrangelow);
-#if RGTC_DEBUG
- fprintf(stderr, "block err lin low %d, nr %d\n", blockerrlin1, nralphainrangelow);
- fprintf(stderr, "block err lin high %d, nr %d\n", blockerrlin2, nralphainrangehigh);
-#endif
- /* again shouldn't really happen often... */
- if (alphatest[0] < T_MIN) {
- alphatest[0] = T_MIN;
- }
- alphatest[1] = alphatest[1] + (blockerrlin2 / nralphainrangehigh);
- if (alphatest[1] > T_MAX) {
- alphatest[1] = T_MAX;
- }
-
- alphablockerror3 = 0;
- for (aindex = 0; aindex < 5; aindex++) {
- /* don't forget here is always rounded down */
- acutValues[aindex] = (alphatest[0] * (10 - (2*aindex + 1)) + alphatest[1] * (2*aindex + 1)) / 10;
- }
- for (j = 0; j < numypixels; j++) {
- for (i = 0; i < numxpixels; i++) {
- /* maybe it's overkill to have the most complicated calculation just for the error
- calculation which we only need to figure out if encoding1 or encoding2 is better... */
- if (srccolors[j][i] <= alphatest[0] / 2) {
- alphaenc3[4*j + i] = 6;
- alphadist = srccolors[j][i];
- }
- else if (srccolors[j][i] > ((T_MAX + alphatest[1]) / 2)) {
- alphaenc3[4*j + i] = 7;
- alphadist = T_MAX - srccolors[j][i];
- }
- else if (srccolors[j][i] <= acutValues[0]) {
- alphaenc3[4*j + i] = 0;
- alphadist = srccolors[j][i] - alphatest[0];
- }
- else if (srccolors[j][i] <= acutValues[1]) {
- alphaenc3[4*j + i] = 2;
- alphadist = srccolors[j][i] - (alphatest[0] * 4 + alphatest[1] * 1) / 5;
- }
- else if (srccolors[j][i] <= acutValues[2]) {
- alphaenc3[4*j + i] = 3;
- alphadist = srccolors[j][i] - (alphatest[0] * 3 + alphatest[1] * 2) / 5;
- }
- else if (srccolors[j][i] <= acutValues[3]) {
- alphaenc3[4*j + i] = 4;
- alphadist = srccolors[j][i] - (alphatest[0] * 2 + alphatest[1] * 3) / 5;
- }
- else if (srccolors[j][i] <= acutValues[4]) {
- alphaenc3[4*j + i] = 5;
- alphadist = srccolors[j][i] - (alphatest[0] * 1 + alphatest[1] * 4) / 5;
- }
- else {
- alphaenc3[4*j + i] = 1;
- alphadist = srccolors[j][i] - alphatest[1];
- }
- alphablockerror3 += alphadist * alphadist;
- }
- }
- }
- }
-
- /* write the alpha values and encoding back. */
- if ((alphablockerror1 <= alphablockerror2) && (alphablockerror1 <= alphablockerror3)) {
-#if RGTC_DEBUG
- if (alphablockerror1 > 96) fprintf(stderr, "enc1 used, error %d\n", alphablockerror1);
- fprintf(stderr,"w1: min %d max %d au0 %d au1 %d\n",
- T_MIN, T_MAX,
- alphause[1], alphause[0]);
-#endif
-
- TAG(write_rgtc_encoded_channel)( blkaddr, alphause[1], alphause[0], alphaenc1 );
- }
- else if (alphablockerror2 <= alphablockerror3) {
-#if RGTC_DEBUG
- if (alphablockerror2 > 96) fprintf(stderr, "enc2 used, error %d\n", alphablockerror2);
- fprintf(stderr,"w2: min %d max %d au0 %d au1 %d\n",
- T_MIN, T_MAX,
- alphabase[0], alphabase[1]);
-#endif
-
- TAG(write_rgtc_encoded_channel)( blkaddr, alphabase[0], alphabase[1], alphaenc2 );
- }
- else {
-#if RGTC_DEBUG
- fprintf(stderr, "enc3 used, error %d\n", alphablockerror3);
- fprintf(stderr,"w3: min %d max %d au0 %d au1 %d\n",
- T_MIN, T_MAX,
- alphatest[0], alphatest[1]);
-#endif
-
- TAG(write_rgtc_encoded_channel)( blkaddr, (TYPE)alphatest[0], (TYPE)alphatest[1], alphaenc3 );
- }
-}
+/*
+ * Copyright (C) 2011 Red Hat Inc.
+ *
+ * block compression parts are:
+ * Copyright (C) 2004 Roland Scheidegger All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ * Author:
+ * Dave Airlie
+ */
+
+/* included by texcompress_rgtc to define byte/ubyte compressors */
+
+static void TAG(fetch_texel_rgtc)(unsigned srcRowStride, const TYPE *pixdata,
+ unsigned i, unsigned j, TYPE *value, unsigned comps)
+{
+ TYPE decode;
+ const TYPE *blksrc = (pixdata + ((srcRowStride + 3) / 4 * (j / 4) + (i / 4)) * 8 * comps);
+ const TYPE alpha0 = blksrc[0];
+ const TYPE alpha1 = blksrc[1];
+ const char bit_pos = ((j&3) * 4 + (i&3)) * 3;
+ const TYPE acodelow = blksrc[2 + bit_pos / 8];
+ const TYPE acodehigh = (3 + bit_pos / 8) < 8 ? blksrc[3 + bit_pos / 8] : 0;
+ const TYPE code = (acodelow >> (bit_pos & 0x7) |
+ (acodehigh << (8 - (bit_pos & 0x7)))) & 0x7;
+
+ if (code == 0)
+ decode = alpha0;
+ else if (code == 1)
+ decode = alpha1;
+ else if (alpha0 > alpha1)
+ decode = ((alpha0 * (8 - code) + (alpha1 * (code - 1))) / 7);
+ else if (code < 6)
+ decode = ((alpha0 * (6 - code) + (alpha1 * (code - 1))) / 5);
+ else if (code == 6)
+ decode = T_MIN;
+ else
+ decode = T_MAX;
+
+ *value = decode;
+}
+
+static void TAG(write_rgtc_encoded_channel)(TYPE *blkaddr,
+ TYPE alphabase1,
+ TYPE alphabase2,
+ TYPE alphaenc[16])
+{
+ *blkaddr++ = alphabase1;
+ *blkaddr++ = alphabase2;
+ *blkaddr++ = alphaenc[0] | (alphaenc[1] << 3) | ((alphaenc[2] & 3) << 6);
+ *blkaddr++ = (alphaenc[2] >> 2) | (alphaenc[3] << 1) | (alphaenc[4] << 4) | ((alphaenc[5] & 1) << 7);
+ *blkaddr++ = (alphaenc[5] >> 1) | (alphaenc[6] << 2) | (alphaenc[7] << 5);
+ *blkaddr++ = alphaenc[8] | (alphaenc[9] << 3) | ((alphaenc[10] & 3) << 6);
+ *blkaddr++ = (alphaenc[10] >> 2) | (alphaenc[11] << 1) | (alphaenc[12] << 4) | ((alphaenc[13] & 1) << 7);
+ *blkaddr++ = (alphaenc[13] >> 1) | (alphaenc[14] << 2) | (alphaenc[15] << 5);
+}
+
+static void TAG(encode_rgtc_chan)(TYPE *blkaddr, TYPE srccolors[4][4],
+ int numxpixels, int numypixels)
+{
+ TYPE alphabase[2], alphause[2];
+ short alphatest[2] = { 0 };
+ unsigned int alphablockerror1, alphablockerror2, alphablockerror3;
+ TYPE i, j, aindex, acutValues[7];
+ TYPE alphaenc1[16], alphaenc2[16], alphaenc3[16];
+ int alphaabsmin = 0, alphaabsmax = 0;
+ short alphadist;
+
+ /* find lowest and highest alpha value in block, alphabase[0] lowest, alphabase[1] highest */
+ alphabase[0] = T_MAX; alphabase[1] = T_MIN;
+ for (j = 0; j < numypixels; j++) {
+ for (i = 0; i < numxpixels; i++) {
+ if (srccolors[j][i] == T_MIN)
+ alphaabsmin = 1;
+ else if (srccolors[j][i] == T_MAX)
+ alphaabsmax = 1;
+ else {
+ if (srccolors[j][i] > alphabase[1])
+ alphabase[1] = srccolors[j][i];
+ if (srccolors[j][i] < alphabase[0])
+ alphabase[0] = srccolors[j][i];
+ }
+ }
+ }
+
+
+ if (((alphabase[0] > alphabase[1]) && !(alphaabsmin && alphaabsmax))
+ || (alphabase[0] == alphabase[1] && !alphaabsmin && !alphaabsmax)) { /* one color, either max or min */
+ /* shortcut here since it is a very common case (and also avoids later problems) */
+ /* could also thest for alpha0 == alpha1 (and not min/max), but probably not common, so don't bother */
+
+ *blkaddr++ = srccolors[0][0];
+ blkaddr++;
+ *blkaddr++ = 0;
+ *blkaddr++ = 0;
+ *blkaddr++ = 0;
+ *blkaddr++ = 0;
+ *blkaddr++ = 0;
+ *blkaddr++ = 0;
+#if RGTC_DEBUG
+ fprintf(stderr, "enc0 used\n");
+#endif
+ return;
+ }
+
+ /* find best encoding for alpha0 > alpha1 */
+ /* it's possible this encoding is better even if both alphaabsmin and alphaabsmax are true */
+ alphablockerror1 = 0x0;
+ alphablockerror2 = 0xffffffff;
+ alphablockerror3 = 0xffffffff;
+ if (alphaabsmin) alphause[0] = T_MIN;
+ else alphause[0] = alphabase[0];
+ if (alphaabsmax) alphause[1] = T_MAX;
+ else alphause[1] = alphabase[1];
+ /* calculate the 7 cut values, just the middle between 2 of the computed alpha values */
+ for (aindex = 0; aindex < 7; aindex++) {
+ /* don't forget here is always rounded down */
+ acutValues[aindex] = (alphause[0] * (2*aindex + 1) + alphause[1] * (14 - (2*aindex + 1))) / 14;
+ }
+
+ for (j = 0; j < numypixels; j++) {
+ for (i = 0; i < numxpixels; i++) {
+ /* maybe it's overkill to have the most complicated calculation just for the error
+ calculation which we only need to figure out if encoding1 or encoding2 is better... */
+ if (srccolors[j][i] > acutValues[0]) {
+ alphaenc1[4*j + i] = 0;
+ alphadist = srccolors[j][i] - alphause[1];
+ }
+ else if (srccolors[j][i] > acutValues[1]) {
+ alphaenc1[4*j + i] = 2;
+ alphadist = srccolors[j][i] - (alphause[1] * 6 + alphause[0] * 1) / 7;
+ }
+ else if (srccolors[j][i] > acutValues[2]) {
+ alphaenc1[4*j + i] = 3;
+ alphadist = srccolors[j][i] - (alphause[1] * 5 + alphause[0] * 2) / 7;
+ }
+ else if (srccolors[j][i] > acutValues[3]) {
+ alphaenc1[4*j + i] = 4;
+ alphadist = srccolors[j][i] - (alphause[1] * 4 + alphause[0] * 3) / 7;
+ }
+ else if (srccolors[j][i] > acutValues[4]) {
+ alphaenc1[4*j + i] = 5;
+ alphadist = srccolors[j][i] - (alphause[1] * 3 + alphause[0] * 4) / 7;
+ }
+ else if (srccolors[j][i] > acutValues[5]) {
+ alphaenc1[4*j + i] = 6;
+ alphadist = srccolors[j][i] - (alphause[1] * 2 + alphause[0] * 5) / 7;
+ }
+ else if (srccolors[j][i] > acutValues[6]) {
+ alphaenc1[4*j + i] = 7;
+ alphadist = srccolors[j][i] - (alphause[1] * 1 + alphause[0] * 6) / 7;
+ }
+ else {
+ alphaenc1[4*j + i] = 1;
+ alphadist = srccolors[j][i] - alphause[0];
+ }
+ alphablockerror1 += alphadist * alphadist;
+ }
+ }
+
+#if RGTC_DEBUG
+ for (i = 0; i < 16; i++) {
+ fprintf(stderr, "%d ", alphaenc1[i]);
+ }
+ fprintf(stderr, "cutVals ");
+ for (i = 0; i < 8; i++) {
+ fprintf(stderr, "%d ", acutValues[i]);
+ }
+ fprintf(stderr, "srcVals ");
+ for (j = 0; j < numypixels; j++) {
+ for (i = 0; i < numxpixels; i++) {
+ fprintf(stderr, "%d ", srccolors[j][i]);
+ }
+ }
+ fprintf(stderr, "\n");
+#endif
+
+ /* it's not very likely this encoding is better if both alphaabsmin and alphaabsmax
+ are false but try it anyway */
+ if (alphablockerror1 >= 32) {
+
+ /* don't bother if encoding is already very good, this condition should also imply
+ we have valid alphabase colors which we absolutely need (alphabase[0] <= alphabase[1]) */
+ alphablockerror2 = 0;
+ for (aindex = 0; aindex < 5; aindex++) {
+ /* don't forget here is always rounded down */
+ acutValues[aindex] = (alphabase[0] * (10 - (2*aindex + 1)) + alphabase[1] * (2*aindex + 1)) / 10;
+ }
+ for (j = 0; j < numypixels; j++) {
+ for (i = 0; i < numxpixels; i++) {
+ /* maybe it's overkill to have the most complicated calculation just for the error
+ calculation which we only need to figure out if encoding1 or encoding2 is better... */
+ if (srccolors[j][i] == T_MIN) {
+ alphaenc2[4*j + i] = 6;
+ alphadist = 0;
+ }
+ else if (srccolors[j][i] == T_MAX) {
+ alphaenc2[4*j + i] = 7;
+ alphadist = 0;
+ }
+ else if (srccolors[j][i] <= acutValues[0]) {
+ alphaenc2[4*j + i] = 0;
+ alphadist = srccolors[j][i] - alphabase[0];
+ }
+ else if (srccolors[j][i] <= acutValues[1]) {
+ alphaenc2[4*j + i] = 2;
+ alphadist = srccolors[j][i] - (alphabase[0] * 4 + alphabase[1] * 1) / 5;
+ }
+ else if (srccolors[j][i] <= acutValues[2]) {
+ alphaenc2[4*j + i] = 3;
+ alphadist = srccolors[j][i] - (alphabase[0] * 3 + alphabase[1] * 2) / 5;
+ }
+ else if (srccolors[j][i] <= acutValues[3]) {
+ alphaenc2[4*j + i] = 4;
+ alphadist = srccolors[j][i] - (alphabase[0] * 2 + alphabase[1] * 3) / 5;
+ }
+ else if (srccolors[j][i] <= acutValues[4]) {
+ alphaenc2[4*j + i] = 5;
+ alphadist = srccolors[j][i] - (alphabase[0] * 1 + alphabase[1] * 4) / 5;
+ }
+ else {
+ alphaenc2[4*j + i] = 1;
+ alphadist = srccolors[j][i] - alphabase[1];
+ }
+ alphablockerror2 += alphadist * alphadist;
+ }
+ }
+
+
+ /* skip this if the error is already very small
+ this encoding is MUCH better on average than #2 though, but expensive! */
+ if ((alphablockerror2 > 96) && (alphablockerror1 > 96)) {
+ short blockerrlin1 = 0;
+ short blockerrlin2 = 0;
+ TYPE nralphainrangelow = 0;
+ TYPE nralphainrangehigh = 0;
+ alphatest[0] = T_MAX;
+ alphatest[1] = T_MIN;
+ /* if we have large range it's likely there are values close to 0/255, try to map them to 0/255 */
+ for (j = 0; j < numypixels; j++) {
+ for (i = 0; i < numxpixels; i++) {
+ if ((srccolors[j][i] > alphatest[1]) && (srccolors[j][i] < (T_MAX -(alphabase[1] - alphabase[0]) / 28)))
+ alphatest[1] = srccolors[j][i];
+ if ((srccolors[j][i] < alphatest[0]) && (srccolors[j][i] > (alphabase[1] - alphabase[0]) / 28))
+ alphatest[0] = srccolors[j][i];
+ }
+ }
+ /* shouldn't happen too often, don't really care about those degenerated cases */
+ if (alphatest[1] <= alphatest[0]) {
+ alphatest[0] = T_MIN+1;
+ alphatest[1] = T_MAX-1;
+ }
+ for (aindex = 0; aindex < 5; aindex++) {
+ /* don't forget here is always rounded down */
+ acutValues[aindex] = (alphatest[0] * (10 - (2*aindex + 1)) + alphatest[1] * (2*aindex + 1)) / 10;
+ }
+
+ /* find the "average" difference between the alpha values and the next encoded value.
+ This is then used to calculate new base values.
+ Should there be some weighting, i.e. those values closer to alphatest[x] have more weight,
+ since they will see more improvement, and also because the values in the middle are somewhat
+ likely to get no improvement at all (because the base values might move in different directions)?
+ OTOH it would mean the values in the middle are even less likely to get an improvement
+ */
+ for (j = 0; j < numypixels; j++) {
+ for (i = 0; i < numxpixels; i++) {
+ if (srccolors[j][i] <= alphatest[0] / 2) {
+ }
+ else if (srccolors[j][i] > ((T_MAX + alphatest[1]) / 2)) {
+ }
+ else if (srccolors[j][i] <= acutValues[0]) {
+ blockerrlin1 += (srccolors[j][i] - alphatest[0]);
+ nralphainrangelow += 1;
+ }
+ else if (srccolors[j][i] <= acutValues[1]) {
+ blockerrlin1 += (srccolors[j][i] - (alphatest[0] * 4 + alphatest[1] * 1) / 5);
+ blockerrlin2 += (srccolors[j][i] - (alphatest[0] * 4 + alphatest[1] * 1) / 5);
+ nralphainrangelow += 1;
+ nralphainrangehigh += 1;
+ }
+ else if (srccolors[j][i] <= acutValues[2]) {
+ blockerrlin1 += (srccolors[j][i] - (alphatest[0] * 3 + alphatest[1] * 2) / 5);
+ blockerrlin2 += (srccolors[j][i] - (alphatest[0] * 3 + alphatest[1] * 2) / 5);
+ nralphainrangelow += 1;
+ nralphainrangehigh += 1;
+ }
+ else if (srccolors[j][i] <= acutValues[3]) {
+ blockerrlin1 += (srccolors[j][i] - (alphatest[0] * 2 + alphatest[1] * 3) / 5);
+ blockerrlin2 += (srccolors[j][i] - (alphatest[0] * 2 + alphatest[1] * 3) / 5);
+ nralphainrangelow += 1;
+ nralphainrangehigh += 1;
+ }
+ else if (srccolors[j][i] <= acutValues[4]) {
+ blockerrlin1 += (srccolors[j][i] - (alphatest[0] * 1 + alphatest[1] * 4) / 5);
+ blockerrlin2 += (srccolors[j][i] - (alphatest[0] * 1 + alphatest[1] * 4) / 5);
+ nralphainrangelow += 1;
+ nralphainrangehigh += 1;
+ }
+ else {
+ blockerrlin2 += (srccolors[j][i] - alphatest[1]);
+ nralphainrangehigh += 1;
+ }
+ }
+ }
+ /* shouldn't happen often, needed to avoid div by zero */
+ if (nralphainrangelow == 0) nralphainrangelow = 1;
+ if (nralphainrangehigh == 0) nralphainrangehigh = 1;
+ alphatest[0] = alphatest[0] + (blockerrlin1 / nralphainrangelow);
+#if RGTC_DEBUG
+ fprintf(stderr, "block err lin low %d, nr %d\n", blockerrlin1, nralphainrangelow);
+ fprintf(stderr, "block err lin high %d, nr %d\n", blockerrlin2, nralphainrangehigh);
+#endif
+ /* again shouldn't really happen often... */
+ if (alphatest[0] < T_MIN) {
+ alphatest[0] = T_MIN;
+ }
+ alphatest[1] = alphatest[1] + (blockerrlin2 / nralphainrangehigh);
+ if (alphatest[1] > T_MAX) {
+ alphatest[1] = T_MAX;
+ }
+
+ alphablockerror3 = 0;
+ for (aindex = 0; aindex < 5; aindex++) {
+ /* don't forget here is always rounded down */
+ acutValues[aindex] = (alphatest[0] * (10 - (2*aindex + 1)) + alphatest[1] * (2*aindex + 1)) / 10;
+ }
+ for (j = 0; j < numypixels; j++) {
+ for (i = 0; i < numxpixels; i++) {
+ /* maybe it's overkill to have the most complicated calculation just for the error
+ calculation which we only need to figure out if encoding1 or encoding2 is better... */
+ if (srccolors[j][i] <= alphatest[0] / 2) {
+ alphaenc3[4*j + i] = 6;
+ alphadist = srccolors[j][i];
+ }
+ else if (srccolors[j][i] > ((T_MAX + alphatest[1]) / 2)) {
+ alphaenc3[4*j + i] = 7;
+ alphadist = T_MAX - srccolors[j][i];
+ }
+ else if (srccolors[j][i] <= acutValues[0]) {
+ alphaenc3[4*j + i] = 0;
+ alphadist = srccolors[j][i] - alphatest[0];
+ }
+ else if (srccolors[j][i] <= acutValues[1]) {
+ alphaenc3[4*j + i] = 2;
+ alphadist = srccolors[j][i] - (alphatest[0] * 4 + alphatest[1] * 1) / 5;
+ }
+ else if (srccolors[j][i] <= acutValues[2]) {
+ alphaenc3[4*j + i] = 3;
+ alphadist = srccolors[j][i] - (alphatest[0] * 3 + alphatest[1] * 2) / 5;
+ }
+ else if (srccolors[j][i] <= acutValues[3]) {
+ alphaenc3[4*j + i] = 4;
+ alphadist = srccolors[j][i] - (alphatest[0] * 2 + alphatest[1] * 3) / 5;
+ }
+ else if (srccolors[j][i] <= acutValues[4]) {
+ alphaenc3[4*j + i] = 5;
+ alphadist = srccolors[j][i] - (alphatest[0] * 1 + alphatest[1] * 4) / 5;
+ }
+ else {
+ alphaenc3[4*j + i] = 1;
+ alphadist = srccolors[j][i] - alphatest[1];
+ }
+ alphablockerror3 += alphadist * alphadist;
+ }
+ }
+ }
+ }
+
+ /* write the alpha values and encoding back. */
+ if ((alphablockerror1 <= alphablockerror2) && (alphablockerror1 <= alphablockerror3)) {
+#if RGTC_DEBUG
+ if (alphablockerror1 > 96) fprintf(stderr, "enc1 used, error %d\n", alphablockerror1);
+ fprintf(stderr,"w1: min %d max %d au0 %d au1 %d\n",
+ T_MIN, T_MAX,
+ alphause[1], alphause[0]);
+#endif
+
+ TAG(write_rgtc_encoded_channel)( blkaddr, alphause[1], alphause[0], alphaenc1 );
+ }
+ else if (alphablockerror2 <= alphablockerror3) {
+#if RGTC_DEBUG
+ if (alphablockerror2 > 96) fprintf(stderr, "enc2 used, error %d\n", alphablockerror2);
+ fprintf(stderr,"w2: min %d max %d au0 %d au1 %d\n",
+ T_MIN, T_MAX,
+ alphabase[0], alphabase[1]);
+#endif
+
+ TAG(write_rgtc_encoded_channel)( blkaddr, alphabase[0], alphabase[1], alphaenc2 );
+ }
+ else {
+#if RGTC_DEBUG
+ fprintf(stderr, "enc3 used, error %d\n", alphablockerror3);
+ fprintf(stderr,"w3: min %d max %d au0 %d au1 %d\n",
+ T_MIN, T_MAX,
+ alphatest[0], alphatest[1]);
+#endif
+
+ TAG(write_rgtc_encoded_channel)( blkaddr, (TYPE)alphatest[0], (TYPE)alphatest[1], alphaenc3 );
+ }
+}
diff --git a/mesalib/src/mesa/main/texcompress_s3tc.c b/mesalib/src/mesa/main/texcompress_s3tc.c
index 86f962e98..c7b27c1a4 100644
--- a/mesalib/src/mesa/main/texcompress_s3tc.c
+++ b/mesalib/src/mesa/main/texcompress_s3tc.c
@@ -1,558 +1,562 @@
-/*
- * Mesa 3-D graphics library
- * Version: 6.5.3
- *
- * Copyright (C) 1999-2007 Brian Paul All Rights Reserved.
- * Copyright (c) 2008 VMware, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-
-/**
- * \file texcompress_s3tc.c
- * GL_EXT_texture_compression_s3tc support.
- */
-
-#ifndef USE_EXTERNAL_DXTN_LIB
-#define USE_EXTERNAL_DXTN_LIB 1
-#endif
-
-#include "glheader.h"
-#include "imports.h"
-#include "colormac.h"
-#include "dlopen.h"
-#include "image.h"
-#include "macros.h"
-#include "mfeatures.h"
-#include "mtypes.h"
-#include "texcompress.h"
-#include "texcompress_s3tc.h"
-#include "texstore.h"
-
-
-#if FEATURE_texture_s3tc
-
-
-#if defined(_WIN32) || defined(WIN32)
-#define DXTN_LIBNAME "dxtn.dll"
-#define RTLD_LAZY 0
-#define RTLD_GLOBAL 0
-#elif defined(__DJGPP__)
-#define DXTN_LIBNAME "dxtn.dxe"
-#else
-#define DXTN_LIBNAME "libtxc_dxtn.so"
-#endif
-
-#if FEATURE_EXT_texture_sRGB
-/**
- * Convert an 8-bit sRGB value from non-linear space to a
- * linear RGB value in [0, 1].
- * Implemented with a 256-entry lookup table.
- */
-static INLINE GLfloat
-nonlinear_to_linear(GLubyte cs8)
-{
- static GLfloat table[256];
- static GLboolean tableReady = GL_FALSE;
- if (!tableReady) {
- /* compute lookup table now */
- GLuint i;
- for (i = 0; i < 256; i++) {
- const GLfloat cs = UBYTE_TO_FLOAT(i);
- if (cs <= 0.04045) {
- table[i] = cs / 12.92f;
- }
- else {
- table[i] = (GLfloat) pow((cs + 0.055) / 1.055, 2.4);
- }
- }
- tableReady = GL_TRUE;
- }
- return table[cs8];
-}
-#endif /* FEATURE_EXT_texture_sRGB */
-
-typedef void (*dxtFetchTexelFuncExt)( GLint srcRowstride, GLubyte *pixdata, GLint col, GLint row, GLvoid *texelOut );
-
-dxtFetchTexelFuncExt fetch_ext_rgb_dxt1 = NULL;
-dxtFetchTexelFuncExt fetch_ext_rgba_dxt1 = NULL;
-dxtFetchTexelFuncExt fetch_ext_rgba_dxt3 = NULL;
-dxtFetchTexelFuncExt fetch_ext_rgba_dxt5 = NULL;
-
-typedef void (*dxtCompressTexFuncExt)(GLint srccomps, GLint width,
- GLint height, const GLchan *srcPixData,
- GLenum destformat, GLubyte *dest,
- GLint dstRowStride);
-
-static dxtCompressTexFuncExt ext_tx_compress_dxtn = NULL;
-
-static void *dxtlibhandle = NULL;
-
-
-void
-_mesa_init_texture_s3tc( struct gl_context *ctx )
-{
- /* called during context initialization */
- ctx->Mesa_DXTn = GL_FALSE;
-#if USE_EXTERNAL_DXTN_LIB
- if (!dxtlibhandle) {
- dxtlibhandle = _mesa_dlopen(DXTN_LIBNAME, 0);
- if (!dxtlibhandle) {
- _mesa_warning(ctx, "couldn't open " DXTN_LIBNAME ", software DXTn "
- "compression/decompression unavailable");
- }
- else {
- /* the fetch functions are not per context! Might be problematic... */
- fetch_ext_rgb_dxt1 = (dxtFetchTexelFuncExt)
- _mesa_dlsym(dxtlibhandle, "fetch_2d_texel_rgb_dxt1");
- fetch_ext_rgba_dxt1 = (dxtFetchTexelFuncExt)
- _mesa_dlsym(dxtlibhandle, "fetch_2d_texel_rgba_dxt1");
- fetch_ext_rgba_dxt3 = (dxtFetchTexelFuncExt)
- _mesa_dlsym(dxtlibhandle, "fetch_2d_texel_rgba_dxt3");
- fetch_ext_rgba_dxt5 = (dxtFetchTexelFuncExt)
- _mesa_dlsym(dxtlibhandle, "fetch_2d_texel_rgba_dxt5");
- ext_tx_compress_dxtn = (dxtCompressTexFuncExt)
- _mesa_dlsym(dxtlibhandle, "tx_compress_dxtn");
-
- if (!fetch_ext_rgb_dxt1 ||
- !fetch_ext_rgba_dxt1 ||
- !fetch_ext_rgba_dxt3 ||
- !fetch_ext_rgba_dxt5 ||
- !ext_tx_compress_dxtn) {
- _mesa_warning(ctx, "couldn't reference all symbols in "
- DXTN_LIBNAME ", software DXTn compression/decompression "
- "unavailable");
- fetch_ext_rgb_dxt1 = NULL;
- fetch_ext_rgba_dxt1 = NULL;
- fetch_ext_rgba_dxt3 = NULL;
- fetch_ext_rgba_dxt5 = NULL;
- ext_tx_compress_dxtn = NULL;
- _mesa_dlclose(dxtlibhandle);
- dxtlibhandle = NULL;
- }
- }
- }
- if (dxtlibhandle) {
- ctx->Mesa_DXTn = GL_TRUE;
- }
-#else
- (void) ctx;
-#endif
-}
-
-/**
- * Store user's image in rgb_dxt1 format.
- */
-GLboolean
-_mesa_texstore_rgb_dxt1(TEXSTORE_PARAMS)
-{
- const GLchan *pixels;
- GLubyte *dst;
- const GLint texWidth = dstRowStride * 4 / 8; /* a bit of a hack */
- const GLchan *tempImage = NULL;
-
- ASSERT(dstFormat == MESA_FORMAT_RGB_DXT1 ||
- dstFormat == MESA_FORMAT_SRGB_DXT1);
- ASSERT(dstXoffset % 4 == 0);
- ASSERT(dstYoffset % 4 == 0);
- ASSERT(dstZoffset % 4 == 0);
- (void) dstZoffset;
- (void) dstImageOffsets;
-
- if (srcFormat != GL_RGB ||
- srcType != CHAN_TYPE ||
- ctx->_ImageTransferState ||
- srcPacking->SwapBytes) {
- /* convert image to RGB/GLchan */
- tempImage = _mesa_make_temp_chan_image(ctx, dims,
- baseInternalFormat,
- _mesa_get_format_base_format(dstFormat),
- srcWidth, srcHeight, srcDepth,
- srcFormat, srcType, srcAddr,
- srcPacking);
- if (!tempImage)
- return GL_FALSE; /* out of memory */
- pixels = tempImage;
- srcFormat = GL_RGB;
- }
- else {
- pixels = (const GLchan *) srcAddr;
- }
-
- dst = _mesa_compressed_image_address(dstXoffset, dstYoffset, 0,
- dstFormat,
- texWidth, (GLubyte *) dstAddr);
-
- if (ext_tx_compress_dxtn) {
- (*ext_tx_compress_dxtn)(3, srcWidth, srcHeight, pixels,
- GL_COMPRESSED_RGB_S3TC_DXT1_EXT,
- dst, dstRowStride);
- }
- else {
- _mesa_warning(ctx, "external dxt library not available: texstore_rgb_dxt1");
- }
-
- if (tempImage)
- free((void *) tempImage);
-
- return GL_TRUE;
-}
-
-
-/**
- * Store user's image in rgba_dxt1 format.
- */
-GLboolean
-_mesa_texstore_rgba_dxt1(TEXSTORE_PARAMS)
-{
- const GLchan *pixels;
- GLubyte *dst;
- const GLint texWidth = dstRowStride * 4 / 8; /* a bit of a hack */
- const GLchan *tempImage = NULL;
-
- ASSERT(dstFormat == MESA_FORMAT_RGBA_DXT1 ||
- dstFormat == MESA_FORMAT_SRGBA_DXT1);
- ASSERT(dstXoffset % 4 == 0);
- ASSERT(dstYoffset % 4 == 0);
- ASSERT(dstZoffset % 4 == 0);
- (void) dstZoffset;
- (void) dstImageOffsets;
-
- if (srcFormat != GL_RGBA ||
- srcType != CHAN_TYPE ||
- ctx->_ImageTransferState ||
- srcPacking->SwapBytes) {
- /* convert image to RGBA/GLchan */
- tempImage = _mesa_make_temp_chan_image(ctx, dims,
- baseInternalFormat,
- _mesa_get_format_base_format(dstFormat),
- srcWidth, srcHeight, srcDepth,
- srcFormat, srcType, srcAddr,
- srcPacking);
- if (!tempImage)
- return GL_FALSE; /* out of memory */
- pixels = tempImage;
- srcFormat = GL_RGBA;
- }
- else {
- pixels = (const GLchan *) srcAddr;
- }
-
- dst = _mesa_compressed_image_address(dstXoffset, dstYoffset, 0,
- dstFormat,
- texWidth, (GLubyte *) dstAddr);
- if (ext_tx_compress_dxtn) {
- (*ext_tx_compress_dxtn)(4, srcWidth, srcHeight, pixels,
- GL_COMPRESSED_RGBA_S3TC_DXT1_EXT,
- dst, dstRowStride);
- }
- else {
- _mesa_warning(ctx, "external dxt library not available: texstore_rgba_dxt1");
- }
-
- if (tempImage)
- free((void*) tempImage);
-
- return GL_TRUE;
-}
-
-
-/**
- * Store user's image in rgba_dxt3 format.
- */
-GLboolean
-_mesa_texstore_rgba_dxt3(TEXSTORE_PARAMS)
-{
- const GLchan *pixels;
- GLubyte *dst;
- const GLint texWidth = dstRowStride * 4 / 16; /* a bit of a hack */
- const GLchan *tempImage = NULL;
-
- ASSERT(dstFormat == MESA_FORMAT_RGBA_DXT3 ||
- dstFormat == MESA_FORMAT_SRGBA_DXT3);
- ASSERT(dstXoffset % 4 == 0);
- ASSERT(dstYoffset % 4 == 0);
- ASSERT(dstZoffset % 4 == 0);
- (void) dstZoffset;
- (void) dstImageOffsets;
-
- if (srcFormat != GL_RGBA ||
- srcType != CHAN_TYPE ||
- ctx->_ImageTransferState ||
- srcPacking->SwapBytes) {
- /* convert image to RGBA/GLchan */
- tempImage = _mesa_make_temp_chan_image(ctx, dims,
- baseInternalFormat,
- _mesa_get_format_base_format(dstFormat),
- srcWidth, srcHeight, srcDepth,
- srcFormat, srcType, srcAddr,
- srcPacking);
- if (!tempImage)
- return GL_FALSE; /* out of memory */
- pixels = tempImage;
- }
- else {
- pixels = (const GLchan *) srcAddr;
- }
-
- dst = _mesa_compressed_image_address(dstXoffset, dstYoffset, 0,
- dstFormat,
- texWidth, (GLubyte *) dstAddr);
- if (ext_tx_compress_dxtn) {
- (*ext_tx_compress_dxtn)(4, srcWidth, srcHeight, pixels,
- GL_COMPRESSED_RGBA_S3TC_DXT3_EXT,
- dst, dstRowStride);
- }
- else {
- _mesa_warning(ctx, "external dxt library not available: texstore_rgba_dxt3");
- }
-
- if (tempImage)
- free((void *) tempImage);
-
- return GL_TRUE;
-}
-
-
-/**
- * Store user's image in rgba_dxt5 format.
- */
-GLboolean
-_mesa_texstore_rgba_dxt5(TEXSTORE_PARAMS)
-{
- const GLchan *pixels;
- GLubyte *dst;
- const GLint texWidth = dstRowStride * 4 / 16; /* a bit of a hack */
- const GLchan *tempImage = NULL;
-
- ASSERT(dstFormat == MESA_FORMAT_RGBA_DXT5 ||
- dstFormat == MESA_FORMAT_SRGBA_DXT5);
- ASSERT(dstXoffset % 4 == 0);
- ASSERT(dstYoffset % 4 == 0);
- ASSERT(dstZoffset % 4 == 0);
- (void) dstZoffset;
- (void) dstImageOffsets;
-
- if (srcFormat != GL_RGBA ||
- srcType != CHAN_TYPE ||
- ctx->_ImageTransferState ||
- srcPacking->SwapBytes) {
- /* convert image to RGBA/GLchan */
- tempImage = _mesa_make_temp_chan_image(ctx, dims,
- baseInternalFormat,
- _mesa_get_format_base_format(dstFormat),
- srcWidth, srcHeight, srcDepth,
- srcFormat, srcType, srcAddr,
- srcPacking);
- if (!tempImage)
- return GL_FALSE; /* out of memory */
- pixels = tempImage;
- }
- else {
- pixels = (const GLchan *) srcAddr;
- }
-
- dst = _mesa_compressed_image_address(dstXoffset, dstYoffset, 0,
- dstFormat,
- texWidth, (GLubyte *) dstAddr);
- if (ext_tx_compress_dxtn) {
- (*ext_tx_compress_dxtn)(4, srcWidth, srcHeight, pixels,
- GL_COMPRESSED_RGBA_S3TC_DXT5_EXT,
- dst, dstRowStride);
- }
- else {
- _mesa_warning(ctx, "external dxt library not available: texstore_rgba_dxt5");
- }
-
- if (tempImage)
- free((void *) tempImage);
-
- return GL_TRUE;
-}
-
-
-static void
-fetch_texel_2d_rgb_dxt1( const struct gl_texture_image *texImage,
- GLint i, GLint j, GLint k, GLchan *texel )
-{
- (void) k;
- if (fetch_ext_rgb_dxt1) {
- ASSERT (sizeof(GLchan) == sizeof(GLubyte));
- fetch_ext_rgb_dxt1(texImage->RowStride,
- (GLubyte *)(texImage)->Data, i, j, texel);
- }
- else
- _mesa_debug(NULL, "attempted to decode s3tc texture without library available: fetch_texel_2d_rgb_dxt1");
-}
-
-
-void
-_mesa_fetch_texel_2d_f_rgb_dxt1(const struct gl_texture_image *texImage,
- GLint i, GLint j, GLint k, GLfloat *texel)
-{
- /* just sample as GLchan and convert to float here */
- GLchan rgba[4];
- fetch_texel_2d_rgb_dxt1(texImage, i, j, k, rgba);
- texel[RCOMP] = CHAN_TO_FLOAT(rgba[RCOMP]);
- texel[GCOMP] = CHAN_TO_FLOAT(rgba[GCOMP]);
- texel[BCOMP] = CHAN_TO_FLOAT(rgba[BCOMP]);
- texel[ACOMP] = CHAN_TO_FLOAT(rgba[ACOMP]);
-}
-
-
-static void
-fetch_texel_2d_rgba_dxt1( const struct gl_texture_image *texImage,
- GLint i, GLint j, GLint k, GLchan *texel )
-{
- (void) k;
- if (fetch_ext_rgba_dxt1) {
- fetch_ext_rgba_dxt1(texImage->RowStride,
- (GLubyte *)(texImage)->Data, i, j, texel);
- }
- else
- _mesa_debug(NULL, "attempted to decode s3tc texture without library available: fetch_texel_2d_rgba_dxt1\n");
-}
-
-
-void
-_mesa_fetch_texel_2d_f_rgba_dxt1(const struct gl_texture_image *texImage,
- GLint i, GLint j, GLint k, GLfloat *texel)
-{
- /* just sample as GLchan and convert to float here */
- GLchan rgba[4];
- fetch_texel_2d_rgba_dxt1(texImage, i, j, k, rgba);
- texel[RCOMP] = CHAN_TO_FLOAT(rgba[RCOMP]);
- texel[GCOMP] = CHAN_TO_FLOAT(rgba[GCOMP]);
- texel[BCOMP] = CHAN_TO_FLOAT(rgba[BCOMP]);
- texel[ACOMP] = CHAN_TO_FLOAT(rgba[ACOMP]);
-}
-
-
-static void
-fetch_texel_2d_rgba_dxt3( const struct gl_texture_image *texImage,
- GLint i, GLint j, GLint k, GLchan *texel )
-{
- (void) k;
- if (fetch_ext_rgba_dxt3) {
- ASSERT (sizeof(GLchan) == sizeof(GLubyte));
- fetch_ext_rgba_dxt3(texImage->RowStride, (GLubyte *)(texImage)->Data,
- i, j, texel);
- }
- else
- _mesa_debug(NULL, "attempted to decode s3tc texture without library available: fetch_texel_2d_rgba_dxt3\n");
-}
-
-
-void
-_mesa_fetch_texel_2d_f_rgba_dxt3(const struct gl_texture_image *texImage,
- GLint i, GLint j, GLint k, GLfloat *texel)
-{
- /* just sample as GLchan and convert to float here */
- GLchan rgba[4];
- fetch_texel_2d_rgba_dxt3(texImage, i, j, k, rgba);
- texel[RCOMP] = CHAN_TO_FLOAT(rgba[RCOMP]);
- texel[GCOMP] = CHAN_TO_FLOAT(rgba[GCOMP]);
- texel[BCOMP] = CHAN_TO_FLOAT(rgba[BCOMP]);
- texel[ACOMP] = CHAN_TO_FLOAT(rgba[ACOMP]);
-}
-
-
-static void
-fetch_texel_2d_rgba_dxt5( const struct gl_texture_image *texImage,
- GLint i, GLint j, GLint k, GLchan *texel )
-{
- (void) k;
- if (fetch_ext_rgba_dxt5) {
- fetch_ext_rgba_dxt5(texImage->RowStride, (GLubyte *)(texImage)->Data,
- i, j, texel);
- }
- else
- _mesa_debug(NULL, "attempted to decode s3tc texture without library available: fetch_texel_2d_rgba_dxt5\n");
-}
-
-
-void
-_mesa_fetch_texel_2d_f_rgba_dxt5(const struct gl_texture_image *texImage,
- GLint i, GLint j, GLint k, GLfloat *texel)
-{
- /* just sample as GLchan and convert to float here */
- GLchan rgba[4];
- fetch_texel_2d_rgba_dxt5(texImage, i, j, k, rgba);
- texel[RCOMP] = CHAN_TO_FLOAT(rgba[RCOMP]);
- texel[GCOMP] = CHAN_TO_FLOAT(rgba[GCOMP]);
- texel[BCOMP] = CHAN_TO_FLOAT(rgba[BCOMP]);
- texel[ACOMP] = CHAN_TO_FLOAT(rgba[ACOMP]);
-}
-
-#if FEATURE_EXT_texture_sRGB
-void
-_mesa_fetch_texel_2d_f_srgb_dxt1( const struct gl_texture_image *texImage,
- GLint i, GLint j, GLint k, GLfloat *texel )
-{
- /* just sample as GLchan and convert to float here */
- GLchan rgba[4];
- fetch_texel_2d_rgb_dxt1(texImage, i, j, k, rgba);
- texel[RCOMP] = nonlinear_to_linear(rgba[RCOMP]);
- texel[GCOMP] = nonlinear_to_linear(rgba[GCOMP]);
- texel[BCOMP] = nonlinear_to_linear(rgba[BCOMP]);
- texel[ACOMP] = CHAN_TO_FLOAT(rgba[ACOMP]);
-}
-
-void
-_mesa_fetch_texel_2d_f_srgba_dxt1(const struct gl_texture_image *texImage,
- GLint i, GLint j, GLint k, GLfloat *texel)
-{
- /* just sample as GLchan and convert to float here */
- GLchan rgba[4];
- fetch_texel_2d_rgba_dxt1(texImage, i, j, k, rgba);
- texel[RCOMP] = nonlinear_to_linear(rgba[RCOMP]);
- texel[GCOMP] = nonlinear_to_linear(rgba[GCOMP]);
- texel[BCOMP] = nonlinear_to_linear(rgba[BCOMP]);
- texel[ACOMP] = CHAN_TO_FLOAT(rgba[ACOMP]);
-}
-
-void
-_mesa_fetch_texel_2d_f_srgba_dxt3(const struct gl_texture_image *texImage,
- GLint i, GLint j, GLint k, GLfloat *texel)
-{
- /* just sample as GLchan and convert to float here */
- GLchan rgba[4];
- fetch_texel_2d_rgba_dxt3(texImage, i, j, k, rgba);
- texel[RCOMP] = nonlinear_to_linear(rgba[RCOMP]);
- texel[GCOMP] = nonlinear_to_linear(rgba[GCOMP]);
- texel[BCOMP] = nonlinear_to_linear(rgba[BCOMP]);
- texel[ACOMP] = CHAN_TO_FLOAT(rgba[ACOMP]);
-}
-
-void
-_mesa_fetch_texel_2d_f_srgba_dxt5(const struct gl_texture_image *texImage,
- GLint i, GLint j, GLint k, GLfloat *texel)
-{
- /* just sample as GLchan and convert to float here */
- GLchan rgba[4];
- fetch_texel_2d_rgba_dxt5(texImage, i, j, k, rgba);
- texel[RCOMP] = nonlinear_to_linear(rgba[RCOMP]);
- texel[GCOMP] = nonlinear_to_linear(rgba[GCOMP]);
- texel[BCOMP] = nonlinear_to_linear(rgba[BCOMP]);
- texel[ACOMP] = CHAN_TO_FLOAT(rgba[ACOMP]);
-}
-#endif /* FEATURE_EXT_texture_sRGB */
-
-
-#endif /* FEATURE_texture_s3tc */
+/*
+ * Mesa 3-D graphics library
+ * Version: 6.5.3
+ *
+ * Copyright (C) 1999-2007 Brian Paul All Rights Reserved.
+ * Copyright (c) 2008 VMware, Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+
+/**
+ * \file texcompress_s3tc.c
+ * GL_EXT_texture_compression_s3tc support.
+ */
+
+#ifndef USE_EXTERNAL_DXTN_LIB
+#define USE_EXTERNAL_DXTN_LIB 1
+#endif
+
+#include "glheader.h"
+#include "imports.h"
+#include "colormac.h"
+#include "dlopen.h"
+#include "image.h"
+#include "macros.h"
+#include "mfeatures.h"
+#include "mtypes.h"
+#include "texcompress.h"
+#include "texcompress_s3tc.h"
+#include "texstore.h"
+
+
+#if FEATURE_texture_s3tc
+
+
+#if defined(_WIN32) || defined(WIN32)
+#ifdef _DEBUG
+#define DXTN_LIBNAME "dxtn_dbg.dll"
+#else
+#define DXTN_LIBNAME "dxtn.dll"
+#endif
+#define RTLD_LAZY 0
+#define RTLD_GLOBAL 0
+#elif defined(__DJGPP__)
+#define DXTN_LIBNAME "dxtn.dxe"
+#else
+#define DXTN_LIBNAME "libtxc_dxtn.so"
+#endif
+
+#if FEATURE_EXT_texture_sRGB
+/**
+ * Convert an 8-bit sRGB value from non-linear space to a
+ * linear RGB value in [0, 1].
+ * Implemented with a 256-entry lookup table.
+ */
+static INLINE GLfloat
+nonlinear_to_linear(GLubyte cs8)
+{
+ static GLfloat table[256];
+ static GLboolean tableReady = GL_FALSE;
+ if (!tableReady) {
+ /* compute lookup table now */
+ GLuint i;
+ for (i = 0; i < 256; i++) {
+ const GLfloat cs = UBYTE_TO_FLOAT(i);
+ if (cs <= 0.04045) {
+ table[i] = cs / 12.92f;
+ }
+ else {
+ table[i] = (GLfloat) pow((cs + 0.055) / 1.055, 2.4);
+ }
+ }
+ tableReady = GL_TRUE;
+ }
+ return table[cs8];
+}
+#endif /* FEATURE_EXT_texture_sRGB */
+
+typedef void (*dxtFetchTexelFuncExt)( GLint srcRowstride, GLubyte *pixdata, GLint col, GLint row, GLvoid *texelOut );
+
+dxtFetchTexelFuncExt fetch_ext_rgb_dxt1 = NULL;
+dxtFetchTexelFuncExt fetch_ext_rgba_dxt1 = NULL;
+dxtFetchTexelFuncExt fetch_ext_rgba_dxt3 = NULL;
+dxtFetchTexelFuncExt fetch_ext_rgba_dxt5 = NULL;
+
+typedef void (*dxtCompressTexFuncExt)(GLint srccomps, GLint width,
+ GLint height, const GLchan *srcPixData,
+ GLenum destformat, GLubyte *dest,
+ GLint dstRowStride);
+
+static dxtCompressTexFuncExt ext_tx_compress_dxtn = NULL;
+
+static void *dxtlibhandle = NULL;
+
+
+void
+_mesa_init_texture_s3tc( struct gl_context *ctx )
+{
+ /* called during context initialization */
+ ctx->Mesa_DXTn = GL_FALSE;
+#if USE_EXTERNAL_DXTN_LIB
+ if (!dxtlibhandle) {
+ dxtlibhandle = _mesa_dlopen(DXTN_LIBNAME, 0);
+ if (!dxtlibhandle) {
+ _mesa_warning(ctx, "couldn't open " DXTN_LIBNAME ", software DXTn "
+ "compression/decompression unavailable");
+ }
+ else {
+ /* the fetch functions are not per context! Might be problematic... */
+ fetch_ext_rgb_dxt1 = (dxtFetchTexelFuncExt)
+ _mesa_dlsym(dxtlibhandle, "fetch_2d_texel_rgb_dxt1");
+ fetch_ext_rgba_dxt1 = (dxtFetchTexelFuncExt)
+ _mesa_dlsym(dxtlibhandle, "fetch_2d_texel_rgba_dxt1");
+ fetch_ext_rgba_dxt3 = (dxtFetchTexelFuncExt)
+ _mesa_dlsym(dxtlibhandle, "fetch_2d_texel_rgba_dxt3");
+ fetch_ext_rgba_dxt5 = (dxtFetchTexelFuncExt)
+ _mesa_dlsym(dxtlibhandle, "fetch_2d_texel_rgba_dxt5");
+ ext_tx_compress_dxtn = (dxtCompressTexFuncExt)
+ _mesa_dlsym(dxtlibhandle, "tx_compress_dxtn");
+
+ if (!fetch_ext_rgb_dxt1 ||
+ !fetch_ext_rgba_dxt1 ||
+ !fetch_ext_rgba_dxt3 ||
+ !fetch_ext_rgba_dxt5 ||
+ !ext_tx_compress_dxtn) {
+ _mesa_warning(ctx, "couldn't reference all symbols in "
+ DXTN_LIBNAME ", software DXTn compression/decompression "
+ "unavailable");
+ fetch_ext_rgb_dxt1 = NULL;
+ fetch_ext_rgba_dxt1 = NULL;
+ fetch_ext_rgba_dxt3 = NULL;
+ fetch_ext_rgba_dxt5 = NULL;
+ ext_tx_compress_dxtn = NULL;
+ _mesa_dlclose(dxtlibhandle);
+ dxtlibhandle = NULL;
+ }
+ }
+ }
+ if (dxtlibhandle) {
+ ctx->Mesa_DXTn = GL_TRUE;
+ }
+#else
+ (void) ctx;
+#endif
+}
+
+/**
+ * Store user's image in rgb_dxt1 format.
+ */
+GLboolean
+_mesa_texstore_rgb_dxt1(TEXSTORE_PARAMS)
+{
+ const GLchan *pixels;
+ GLubyte *dst;
+ const GLint texWidth = dstRowStride * 4 / 8; /* a bit of a hack */
+ const GLchan *tempImage = NULL;
+
+ ASSERT(dstFormat == MESA_FORMAT_RGB_DXT1 ||
+ dstFormat == MESA_FORMAT_SRGB_DXT1);
+ ASSERT(dstXoffset % 4 == 0);
+ ASSERT(dstYoffset % 4 == 0);
+ ASSERT(dstZoffset % 4 == 0);
+ (void) dstZoffset;
+ (void) dstImageOffsets;
+
+ if (srcFormat != GL_RGB ||
+ srcType != CHAN_TYPE ||
+ ctx->_ImageTransferState ||
+ srcPacking->SwapBytes) {
+ /* convert image to RGB/GLchan */
+ tempImage = _mesa_make_temp_chan_image(ctx, dims,
+ baseInternalFormat,
+ _mesa_get_format_base_format(dstFormat),
+ srcWidth, srcHeight, srcDepth,
+ srcFormat, srcType, srcAddr,
+ srcPacking);
+ if (!tempImage)
+ return GL_FALSE; /* out of memory */
+ pixels = tempImage;
+ srcFormat = GL_RGB;
+ }
+ else {
+ pixels = (const GLchan *) srcAddr;
+ }
+
+ dst = _mesa_compressed_image_address(dstXoffset, dstYoffset, 0,
+ dstFormat,
+ texWidth, (GLubyte *) dstAddr);
+
+ if (ext_tx_compress_dxtn) {
+ (*ext_tx_compress_dxtn)(3, srcWidth, srcHeight, pixels,
+ GL_COMPRESSED_RGB_S3TC_DXT1_EXT,
+ dst, dstRowStride);
+ }
+ else {
+ _mesa_warning(ctx, "external dxt library not available: texstore_rgb_dxt1");
+ }
+
+ if (tempImage)
+ free((void *) tempImage);
+
+ return GL_TRUE;
+}
+
+
+/**
+ * Store user's image in rgba_dxt1 format.
+ */
+GLboolean
+_mesa_texstore_rgba_dxt1(TEXSTORE_PARAMS)
+{
+ const GLchan *pixels;
+ GLubyte *dst;
+ const GLint texWidth = dstRowStride * 4 / 8; /* a bit of a hack */
+ const GLchan *tempImage = NULL;
+
+ ASSERT(dstFormat == MESA_FORMAT_RGBA_DXT1 ||
+ dstFormat == MESA_FORMAT_SRGBA_DXT1);
+ ASSERT(dstXoffset % 4 == 0);
+ ASSERT(dstYoffset % 4 == 0);
+ ASSERT(dstZoffset % 4 == 0);
+ (void) dstZoffset;
+ (void) dstImageOffsets;
+
+ if (srcFormat != GL_RGBA ||
+ srcType != CHAN_TYPE ||
+ ctx->_ImageTransferState ||
+ srcPacking->SwapBytes) {
+ /* convert image to RGBA/GLchan */
+ tempImage = _mesa_make_temp_chan_image(ctx, dims,
+ baseInternalFormat,
+ _mesa_get_format_base_format(dstFormat),
+ srcWidth, srcHeight, srcDepth,
+ srcFormat, srcType, srcAddr,
+ srcPacking);
+ if (!tempImage)
+ return GL_FALSE; /* out of memory */
+ pixels = tempImage;
+ srcFormat = GL_RGBA;
+ }
+ else {
+ pixels = (const GLchan *) srcAddr;
+ }
+
+ dst = _mesa_compressed_image_address(dstXoffset, dstYoffset, 0,
+ dstFormat,
+ texWidth, (GLubyte *) dstAddr);
+ if (ext_tx_compress_dxtn) {
+ (*ext_tx_compress_dxtn)(4, srcWidth, srcHeight, pixels,
+ GL_COMPRESSED_RGBA_S3TC_DXT1_EXT,
+ dst, dstRowStride);
+ }
+ else {
+ _mesa_warning(ctx, "external dxt library not available: texstore_rgba_dxt1");
+ }
+
+ if (tempImage)
+ free((void*) tempImage);
+
+ return GL_TRUE;
+}
+
+
+/**
+ * Store user's image in rgba_dxt3 format.
+ */
+GLboolean
+_mesa_texstore_rgba_dxt3(TEXSTORE_PARAMS)
+{
+ const GLchan *pixels;
+ GLubyte *dst;
+ const GLint texWidth = dstRowStride * 4 / 16; /* a bit of a hack */
+ const GLchan *tempImage = NULL;
+
+ ASSERT(dstFormat == MESA_FORMAT_RGBA_DXT3 ||
+ dstFormat == MESA_FORMAT_SRGBA_DXT3);
+ ASSERT(dstXoffset % 4 == 0);
+ ASSERT(dstYoffset % 4 == 0);
+ ASSERT(dstZoffset % 4 == 0);
+ (void) dstZoffset;
+ (void) dstImageOffsets;
+
+ if (srcFormat != GL_RGBA ||
+ srcType != CHAN_TYPE ||
+ ctx->_ImageTransferState ||
+ srcPacking->SwapBytes) {
+ /* convert image to RGBA/GLchan */
+ tempImage = _mesa_make_temp_chan_image(ctx, dims,
+ baseInternalFormat,
+ _mesa_get_format_base_format(dstFormat),
+ srcWidth, srcHeight, srcDepth,
+ srcFormat, srcType, srcAddr,
+ srcPacking);
+ if (!tempImage)
+ return GL_FALSE; /* out of memory */
+ pixels = tempImage;
+ }
+ else {
+ pixels = (const GLchan *) srcAddr;
+ }
+
+ dst = _mesa_compressed_image_address(dstXoffset, dstYoffset, 0,
+ dstFormat,
+ texWidth, (GLubyte *) dstAddr);
+ if (ext_tx_compress_dxtn) {
+ (*ext_tx_compress_dxtn)(4, srcWidth, srcHeight, pixels,
+ GL_COMPRESSED_RGBA_S3TC_DXT3_EXT,
+ dst, dstRowStride);
+ }
+ else {
+ _mesa_warning(ctx, "external dxt library not available: texstore_rgba_dxt3");
+ }
+
+ if (tempImage)
+ free((void *) tempImage);
+
+ return GL_TRUE;
+}
+
+
+/**
+ * Store user's image in rgba_dxt5 format.
+ */
+GLboolean
+_mesa_texstore_rgba_dxt5(TEXSTORE_PARAMS)
+{
+ const GLchan *pixels;
+ GLubyte *dst;
+ const GLint texWidth = dstRowStride * 4 / 16; /* a bit of a hack */
+ const GLchan *tempImage = NULL;
+
+ ASSERT(dstFormat == MESA_FORMAT_RGBA_DXT5 ||
+ dstFormat == MESA_FORMAT_SRGBA_DXT5);
+ ASSERT(dstXoffset % 4 == 0);
+ ASSERT(dstYoffset % 4 == 0);
+ ASSERT(dstZoffset % 4 == 0);
+ (void) dstZoffset;
+ (void) dstImageOffsets;
+
+ if (srcFormat != GL_RGBA ||
+ srcType != CHAN_TYPE ||
+ ctx->_ImageTransferState ||
+ srcPacking->SwapBytes) {
+ /* convert image to RGBA/GLchan */
+ tempImage = _mesa_make_temp_chan_image(ctx, dims,
+ baseInternalFormat,
+ _mesa_get_format_base_format(dstFormat),
+ srcWidth, srcHeight, srcDepth,
+ srcFormat, srcType, srcAddr,
+ srcPacking);
+ if (!tempImage)
+ return GL_FALSE; /* out of memory */
+ pixels = tempImage;
+ }
+ else {
+ pixels = (const GLchan *) srcAddr;
+ }
+
+ dst = _mesa_compressed_image_address(dstXoffset, dstYoffset, 0,
+ dstFormat,
+ texWidth, (GLubyte *) dstAddr);
+ if (ext_tx_compress_dxtn) {
+ (*ext_tx_compress_dxtn)(4, srcWidth, srcHeight, pixels,
+ GL_COMPRESSED_RGBA_S3TC_DXT5_EXT,
+ dst, dstRowStride);
+ }
+ else {
+ _mesa_warning(ctx, "external dxt library not available: texstore_rgba_dxt5");
+ }
+
+ if (tempImage)
+ free((void *) tempImage);
+
+ return GL_TRUE;
+}
+
+
+static void
+fetch_texel_2d_rgb_dxt1( const struct gl_texture_image *texImage,
+ GLint i, GLint j, GLint k, GLchan *texel )
+{
+ (void) k;
+ if (fetch_ext_rgb_dxt1) {
+ ASSERT (sizeof(GLchan) == sizeof(GLubyte));
+ fetch_ext_rgb_dxt1(texImage->RowStride,
+ (GLubyte *)(texImage)->Data, i, j, texel);
+ }
+ else
+ _mesa_debug(NULL, "attempted to decode s3tc texture without library available: fetch_texel_2d_rgb_dxt1");
+}
+
+
+void
+_mesa_fetch_texel_2d_f_rgb_dxt1(const struct gl_texture_image *texImage,
+ GLint i, GLint j, GLint k, GLfloat *texel)
+{
+ /* just sample as GLchan and convert to float here */
+ GLchan rgba[4];
+ fetch_texel_2d_rgb_dxt1(texImage, i, j, k, rgba);
+ texel[RCOMP] = CHAN_TO_FLOAT(rgba[RCOMP]);
+ texel[GCOMP] = CHAN_TO_FLOAT(rgba[GCOMP]);
+ texel[BCOMP] = CHAN_TO_FLOAT(rgba[BCOMP]);
+ texel[ACOMP] = CHAN_TO_FLOAT(rgba[ACOMP]);
+}
+
+
+static void
+fetch_texel_2d_rgba_dxt1( const struct gl_texture_image *texImage,
+ GLint i, GLint j, GLint k, GLchan *texel )
+{
+ (void) k;
+ if (fetch_ext_rgba_dxt1) {
+ fetch_ext_rgba_dxt1(texImage->RowStride,
+ (GLubyte *)(texImage)->Data, i, j, texel);
+ }
+ else
+ _mesa_debug(NULL, "attempted to decode s3tc texture without library available: fetch_texel_2d_rgba_dxt1\n");
+}
+
+
+void
+_mesa_fetch_texel_2d_f_rgba_dxt1(const struct gl_texture_image *texImage,
+ GLint i, GLint j, GLint k, GLfloat *texel)
+{
+ /* just sample as GLchan and convert to float here */
+ GLchan rgba[4];
+ fetch_texel_2d_rgba_dxt1(texImage, i, j, k, rgba);
+ texel[RCOMP] = CHAN_TO_FLOAT(rgba[RCOMP]);
+ texel[GCOMP] = CHAN_TO_FLOAT(rgba[GCOMP]);
+ texel[BCOMP] = CHAN_TO_FLOAT(rgba[BCOMP]);
+ texel[ACOMP] = CHAN_TO_FLOAT(rgba[ACOMP]);
+}
+
+
+static void
+fetch_texel_2d_rgba_dxt3( const struct gl_texture_image *texImage,
+ GLint i, GLint j, GLint k, GLchan *texel )
+{
+ (void) k;
+ if (fetch_ext_rgba_dxt3) {
+ ASSERT (sizeof(GLchan) == sizeof(GLubyte));
+ fetch_ext_rgba_dxt3(texImage->RowStride, (GLubyte *)(texImage)->Data,
+ i, j, texel);
+ }
+ else
+ _mesa_debug(NULL, "attempted to decode s3tc texture without library available: fetch_texel_2d_rgba_dxt3\n");
+}
+
+
+void
+_mesa_fetch_texel_2d_f_rgba_dxt3(const struct gl_texture_image *texImage,
+ GLint i, GLint j, GLint k, GLfloat *texel)
+{
+ /* just sample as GLchan and convert to float here */
+ GLchan rgba[4];
+ fetch_texel_2d_rgba_dxt3(texImage, i, j, k, rgba);
+ texel[RCOMP] = CHAN_TO_FLOAT(rgba[RCOMP]);
+ texel[GCOMP] = CHAN_TO_FLOAT(rgba[GCOMP]);
+ texel[BCOMP] = CHAN_TO_FLOAT(rgba[BCOMP]);
+ texel[ACOMP] = CHAN_TO_FLOAT(rgba[ACOMP]);
+}
+
+
+static void
+fetch_texel_2d_rgba_dxt5( const struct gl_texture_image *texImage,
+ GLint i, GLint j, GLint k, GLchan *texel )
+{
+ (void) k;
+ if (fetch_ext_rgba_dxt5) {
+ fetch_ext_rgba_dxt5(texImage->RowStride, (GLubyte *)(texImage)->Data,
+ i, j, texel);
+ }
+ else
+ _mesa_debug(NULL, "attempted to decode s3tc texture without library available: fetch_texel_2d_rgba_dxt5\n");
+}
+
+
+void
+_mesa_fetch_texel_2d_f_rgba_dxt5(const struct gl_texture_image *texImage,
+ GLint i, GLint j, GLint k, GLfloat *texel)
+{
+ /* just sample as GLchan and convert to float here */
+ GLchan rgba[4];
+ fetch_texel_2d_rgba_dxt5(texImage, i, j, k, rgba);
+ texel[RCOMP] = CHAN_TO_FLOAT(rgba[RCOMP]);
+ texel[GCOMP] = CHAN_TO_FLOAT(rgba[GCOMP]);
+ texel[BCOMP] = CHAN_TO_FLOAT(rgba[BCOMP]);
+ texel[ACOMP] = CHAN_TO_FLOAT(rgba[ACOMP]);
+}
+
+#if FEATURE_EXT_texture_sRGB
+void
+_mesa_fetch_texel_2d_f_srgb_dxt1( const struct gl_texture_image *texImage,
+ GLint i, GLint j, GLint k, GLfloat *texel )
+{
+ /* just sample as GLchan and convert to float here */
+ GLchan rgba[4];
+ fetch_texel_2d_rgb_dxt1(texImage, i, j, k, rgba);
+ texel[RCOMP] = nonlinear_to_linear(rgba[RCOMP]);
+ texel[GCOMP] = nonlinear_to_linear(rgba[GCOMP]);
+ texel[BCOMP] = nonlinear_to_linear(rgba[BCOMP]);
+ texel[ACOMP] = CHAN_TO_FLOAT(rgba[ACOMP]);
+}
+
+void
+_mesa_fetch_texel_2d_f_srgba_dxt1(const struct gl_texture_image *texImage,
+ GLint i, GLint j, GLint k, GLfloat *texel)
+{
+ /* just sample as GLchan and convert to float here */
+ GLchan rgba[4];
+ fetch_texel_2d_rgba_dxt1(texImage, i, j, k, rgba);
+ texel[RCOMP] = nonlinear_to_linear(rgba[RCOMP]);
+ texel[GCOMP] = nonlinear_to_linear(rgba[GCOMP]);
+ texel[BCOMP] = nonlinear_to_linear(rgba[BCOMP]);
+ texel[ACOMP] = CHAN_TO_FLOAT(rgba[ACOMP]);
+}
+
+void
+_mesa_fetch_texel_2d_f_srgba_dxt3(const struct gl_texture_image *texImage,
+ GLint i, GLint j, GLint k, GLfloat *texel)
+{
+ /* just sample as GLchan and convert to float here */
+ GLchan rgba[4];
+ fetch_texel_2d_rgba_dxt3(texImage, i, j, k, rgba);
+ texel[RCOMP] = nonlinear_to_linear(rgba[RCOMP]);
+ texel[GCOMP] = nonlinear_to_linear(rgba[GCOMP]);
+ texel[BCOMP] = nonlinear_to_linear(rgba[BCOMP]);
+ texel[ACOMP] = CHAN_TO_FLOAT(rgba[ACOMP]);
+}
+
+void
+_mesa_fetch_texel_2d_f_srgba_dxt5(const struct gl_texture_image *texImage,
+ GLint i, GLint j, GLint k, GLfloat *texel)
+{
+ /* just sample as GLchan and convert to float here */
+ GLchan rgba[4];
+ fetch_texel_2d_rgba_dxt5(texImage, i, j, k, rgba);
+ texel[RCOMP] = nonlinear_to_linear(rgba[RCOMP]);
+ texel[GCOMP] = nonlinear_to_linear(rgba[GCOMP]);
+ texel[BCOMP] = nonlinear_to_linear(rgba[BCOMP]);
+ texel[ACOMP] = CHAN_TO_FLOAT(rgba[ACOMP]);
+}
+#endif /* FEATURE_EXT_texture_sRGB */
+
+
+#endif /* FEATURE_texture_s3tc */
diff --git a/mesalib/src/mesa/main/texenv.c b/mesalib/src/mesa/main/texenv.c
index 9228e354a..7363e2794 100644
--- a/mesalib/src/mesa/main/texenv.c
+++ b/mesalib/src/mesa/main/texenv.c
@@ -1,1043 +1,1043 @@
-/*
- * Mesa 3-D graphics library
- * Version: 7.5
- *
- * Copyright (C) 1999-2008 Brian Paul All Rights Reserved.
- * Copyright (C) 2009 VMware, Inc. All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-/**
- * \file texenv.c
- *
- * glTexEnv-related functions
- */
-
-
-#include "main/glheader.h"
-#include "main/context.h"
-#include "main/enums.h"
-#include "main/macros.h"
-#include "main/mtypes.h"
-#include "main/state.h"
-#include "main/texenv.h"
-#include "main/texstate.h"
-
-
-#define TE_ERROR(errCode, msg, value) \
- _mesa_error(ctx, errCode, msg, _mesa_lookup_enum_by_nr(value));
-
-
-/** Set texture env mode */
-static void
-set_env_mode(struct gl_context *ctx,
- struct gl_texture_unit *texUnit,
- GLenum mode)
-{
- GLboolean legal;
-
- if (texUnit->EnvMode == mode)
- return;
-
- switch (mode) {
- case GL_MODULATE:
- case GL_BLEND:
- case GL_DECAL:
- case GL_REPLACE:
- legal = GL_TRUE;
- break;
- case GL_REPLACE_EXT:
- mode = GL_REPLACE; /* GL_REPLACE_EXT != GL_REPLACE */
- legal = GL_TRUE;
- break;
- case GL_ADD:
- legal = ctx->Extensions.EXT_texture_env_add;
- break;
- case GL_COMBINE:
- legal = (ctx->Extensions.EXT_texture_env_combine ||
- ctx->Extensions.ARB_texture_env_combine);
- break;
- case GL_COMBINE4_NV:
- legal = ctx->Extensions.NV_texture_env_combine4;
- break;
- default:
- legal = GL_FALSE;
- }
-
- if (legal) {
- FLUSH_VERTICES(ctx, _NEW_TEXTURE);
- texUnit->EnvMode = mode;
- }
- else {
- TE_ERROR(GL_INVALID_ENUM, "glTexEnv(param=%s)", mode);
- }
-}
-
-
-static void
-set_env_color(struct gl_context *ctx,
- struct gl_texture_unit *texUnit,
- const GLfloat *color)
-{
- if (TEST_EQ_4V(color, texUnit->EnvColorUnclamped))
- return;
- FLUSH_VERTICES(ctx, _NEW_TEXTURE);
- COPY_4FV(texUnit->EnvColorUnclamped, color);
- texUnit->EnvColor[0] = CLAMP(color[0], 0.0F, 1.0F);
- texUnit->EnvColor[1] = CLAMP(color[1], 0.0F, 1.0F);
- texUnit->EnvColor[2] = CLAMP(color[2], 0.0F, 1.0F);
- texUnit->EnvColor[3] = CLAMP(color[3], 0.0F, 1.0F);
-}
-
-
-/** Set an RGB or A combiner mode/function */
-static void
-set_combiner_mode(struct gl_context *ctx,
- struct gl_texture_unit *texUnit,
- GLenum pname, GLenum mode)
-{
- GLboolean legal;
-
- if (!ctx->Extensions.EXT_texture_env_combine &&
- !ctx->Extensions.ARB_texture_env_combine) {
- _mesa_error(ctx, GL_INVALID_ENUM, "glTexEnv(pname)");
- return;
- }
-
- switch (mode) {
- case GL_REPLACE:
- case GL_MODULATE:
- case GL_ADD:
- case GL_ADD_SIGNED:
- case GL_INTERPOLATE:
- legal = GL_TRUE;
- break;
- case GL_SUBTRACT:
- legal = ctx->Extensions.ARB_texture_env_combine;
- break;
- case GL_DOT3_RGB_EXT:
- case GL_DOT3_RGBA_EXT:
- legal = (ctx->Extensions.EXT_texture_env_dot3 &&
- pname == GL_COMBINE_RGB);
- break;
- case GL_DOT3_RGB:
- case GL_DOT3_RGBA:
- legal = (ctx->Extensions.ARB_texture_env_dot3 &&
- pname == GL_COMBINE_RGB);
- break;
- case GL_MODULATE_ADD_ATI:
- case GL_MODULATE_SIGNED_ADD_ATI:
- case GL_MODULATE_SUBTRACT_ATI:
- legal = ctx->Extensions.ATI_texture_env_combine3;
- break;
- case GL_BUMP_ENVMAP_ATI:
- legal = (ctx->Extensions.ATI_envmap_bumpmap &&
- pname == GL_COMBINE_RGB);
- break;
- default:
- legal = GL_FALSE;
- }
-
- if (!legal) {
- TE_ERROR(GL_INVALID_ENUM, "glTexEnv(param=%s)", mode);
- return;
- }
-
- switch (pname) {
- case GL_COMBINE_RGB:
- if (texUnit->Combine.ModeRGB == mode)
- return;
- FLUSH_VERTICES(ctx, _NEW_TEXTURE);
- texUnit->Combine.ModeRGB = mode;
- break;
-
- case GL_COMBINE_ALPHA:
- if (texUnit->Combine.ModeA == mode)
- return;
- FLUSH_VERTICES(ctx, _NEW_TEXTURE);
- texUnit->Combine.ModeA = mode;
- break;
- default:
- TE_ERROR(GL_INVALID_ENUM, "glTexEnv(pname=%s)", pname);
- }
-}
-
-
-
-/** Set an RGB or A combiner source term */
-static void
-set_combiner_source(struct gl_context *ctx,
- struct gl_texture_unit *texUnit,
- GLenum pname, GLenum param)
-{
- GLuint term;
- GLboolean alpha, legal;
-
- if (!ctx->Extensions.EXT_texture_env_combine &&
- !ctx->Extensions.ARB_texture_env_combine) {
- _mesa_error(ctx, GL_INVALID_ENUM, "glTexEnv(pname)");
- return;
- }
-
- /*
- * Translate pname to (term, alpha).
- *
- * The enums were given sequential values for a reason.
- */
- switch (pname) {
- case GL_SOURCE0_RGB:
- case GL_SOURCE1_RGB:
- case GL_SOURCE2_RGB:
- case GL_SOURCE3_RGB_NV:
- term = pname - GL_SOURCE0_RGB;
- alpha = GL_FALSE;
- break;
- case GL_SOURCE0_ALPHA:
- case GL_SOURCE1_ALPHA:
- case GL_SOURCE2_ALPHA:
- case GL_SOURCE3_ALPHA_NV:
- term = pname - GL_SOURCE0_ALPHA;
- alpha = GL_TRUE;
- break;
- default:
- TE_ERROR(GL_INVALID_ENUM, "glTexEnv(pname=%s)", pname);
- return;
- }
-
- if ((term == 3) && !ctx->Extensions.NV_texture_env_combine4) {
- TE_ERROR(GL_INVALID_ENUM, "glTexEnv(pname=%s)", pname);
- return;
- }
-
- assert(term < MAX_COMBINER_TERMS);
-
- /*
- * Error-check param (the source term)
- */
- switch (param) {
- case GL_TEXTURE:
- case GL_CONSTANT:
- case GL_PRIMARY_COLOR:
- case GL_PREVIOUS:
- legal = GL_TRUE;
- break;
- case GL_TEXTURE0:
- case GL_TEXTURE1:
- case GL_TEXTURE2:
- case GL_TEXTURE3:
- case GL_TEXTURE4:
- case GL_TEXTURE5:
- case GL_TEXTURE6:
- case GL_TEXTURE7:
- legal = (ctx->Extensions.ARB_texture_env_crossbar &&
- param - GL_TEXTURE0 < ctx->Const.MaxTextureUnits);
- break;
- case GL_ZERO:
- legal = (ctx->Extensions.ATI_texture_env_combine3 ||
- ctx->Extensions.NV_texture_env_combine4);
- break;
- case GL_ONE:
- legal = ctx->Extensions.ATI_texture_env_combine3;
- break;
- default:
- legal = GL_FALSE;
- }
-
- if (!legal) {
- TE_ERROR(GL_INVALID_ENUM, "glTexEnv(param=%s)", param);
- return;
- }
-
- FLUSH_VERTICES(ctx, _NEW_TEXTURE);
-
- if (alpha)
- texUnit->Combine.SourceA[term] = param;
- else
- texUnit->Combine.SourceRGB[term] = param;
-}
-
-
-/** Set an RGB or A combiner operand term */
-static void
-set_combiner_operand(struct gl_context *ctx,
- struct gl_texture_unit *texUnit,
- GLenum pname, GLenum param)
-{
- GLuint term;
- GLboolean alpha, legal;
-
- if (!ctx->Extensions.EXT_texture_env_combine &&
- !ctx->Extensions.ARB_texture_env_combine) {
- _mesa_error(ctx, GL_INVALID_ENUM, "glTexEnv(pname)");
- return;
- }
-
- /* The enums were given sequential values for a reason.
- */
- switch (pname) {
- case GL_OPERAND0_RGB:
- case GL_OPERAND1_RGB:
- case GL_OPERAND2_RGB:
- case GL_OPERAND3_RGB_NV:
- term = pname - GL_OPERAND0_RGB;
- alpha = GL_FALSE;
- break;
- case GL_OPERAND0_ALPHA:
- case GL_OPERAND1_ALPHA:
- case GL_OPERAND2_ALPHA:
- case GL_OPERAND3_ALPHA_NV:
- term = pname - GL_OPERAND0_ALPHA;
- alpha = GL_TRUE;
- break;
- default:
- TE_ERROR(GL_INVALID_ENUM, "glTexEnv(pname=%s)", pname);
- return;
- }
-
- if ((term == 3) && !ctx->Extensions.NV_texture_env_combine4) {
- TE_ERROR(GL_INVALID_ENUM, "glTexEnv(pname=%s)", pname);
- return;
- }
-
- assert(term < MAX_COMBINER_TERMS);
-
- /*
- * Error-check param (the source operand)
- */
- switch (param) {
- case GL_SRC_COLOR:
- case GL_ONE_MINUS_SRC_COLOR:
- /* The color input can only be used with GL_OPERAND[01]_RGB in the EXT
- * version. In the ARB and NV versions they can be used for any RGB
- * operand.
- */
- legal = !alpha
- && ((term < 2) || ctx->Extensions.ARB_texture_env_combine
- || ctx->Extensions.NV_texture_env_combine4);
- break;
- case GL_ONE_MINUS_SRC_ALPHA:
- /* GL_ONE_MINUS_SRC_ALPHA can only be used with
- * GL_OPERAND[01]_(RGB|ALPHA) in the EXT version. In the ARB and NV
- * versions it can be used for any operand.
- */
- legal = (term < 2) || ctx->Extensions.ARB_texture_env_combine
- || ctx->Extensions.NV_texture_env_combine4;
- break;
- case GL_SRC_ALPHA:
- legal = GL_TRUE;
- break;
- default:
- legal = GL_FALSE;
- }
-
- if (!legal) {
- TE_ERROR(GL_INVALID_ENUM, "glTexEnv(param=%s)", param);
- return;
- }
-
- FLUSH_VERTICES(ctx, _NEW_TEXTURE);
-
- if (alpha)
- texUnit->Combine.OperandA[term] = param;
- else
- texUnit->Combine.OperandRGB[term] = param;
-}
-
-
-static void
-set_combiner_scale(struct gl_context *ctx,
- struct gl_texture_unit *texUnit,
- GLenum pname, GLfloat scale)
-{
- GLuint shift;
-
- if (!ctx->Extensions.EXT_texture_env_combine &&
- !ctx->Extensions.ARB_texture_env_combine) {
- _mesa_error(ctx, GL_INVALID_ENUM, "glTexEnv(pname)");
- return;
- }
-
- if (scale == 1.0F) {
- shift = 0;
- }
- else if (scale == 2.0F) {
- shift = 1;
- }
- else if (scale == 4.0F) {
- shift = 2;
- }
- else {
- _mesa_error( ctx, GL_INVALID_VALUE,
- "glTexEnv(GL_RGB_SCALE not 1, 2 or 4)" );
- return;
- }
-
- switch (pname) {
- case GL_RGB_SCALE:
- if (texUnit->Combine.ScaleShiftRGB == shift)
- return;
- FLUSH_VERTICES(ctx, _NEW_TEXTURE);
- texUnit->Combine.ScaleShiftRGB = shift;
- break;
- case GL_ALPHA_SCALE:
- if (texUnit->Combine.ScaleShiftA == shift)
- return;
- FLUSH_VERTICES(ctx, _NEW_TEXTURE);
- texUnit->Combine.ScaleShiftA = shift;
- break;
- default:
- TE_ERROR(GL_INVALID_ENUM, "glTexEnv(pname=%s)", pname);
- }
-}
-
-
-
-void GLAPIENTRY
-_mesa_TexEnvfv( GLenum target, GLenum pname, const GLfloat *param )
-{
- const GLint iparam0 = (GLint) param[0];
- struct gl_texture_unit *texUnit;
- GLuint maxUnit;
-
- GET_CURRENT_CONTEXT(ctx);
- ASSERT_OUTSIDE_BEGIN_END(ctx);
-
- maxUnit = (target == GL_POINT_SPRITE_NV && pname == GL_COORD_REPLACE_NV)
- ? ctx->Const.MaxTextureCoordUnits : ctx->Const.MaxTextureImageUnits;
- if (ctx->Texture.CurrentUnit >= maxUnit) {
- _mesa_error(ctx, GL_INVALID_OPERATION, "glTexEnvfv(current unit)");
- return;
- }
-
- texUnit = _mesa_get_current_tex_unit(ctx);
-
- if (target == GL_TEXTURE_ENV) {
- switch (pname) {
- case GL_TEXTURE_ENV_MODE:
- set_env_mode(ctx, texUnit, (GLenum) iparam0);
- break;
- case GL_TEXTURE_ENV_COLOR:
- set_env_color(ctx, texUnit, param);
- break;
- case GL_COMBINE_RGB:
- case GL_COMBINE_ALPHA:
- set_combiner_mode(ctx, texUnit, pname, (GLenum) iparam0);
- break;
- case GL_SOURCE0_RGB:
- case GL_SOURCE1_RGB:
- case GL_SOURCE2_RGB:
- case GL_SOURCE3_RGB_NV:
- case GL_SOURCE0_ALPHA:
- case GL_SOURCE1_ALPHA:
- case GL_SOURCE2_ALPHA:
- case GL_SOURCE3_ALPHA_NV:
- set_combiner_source(ctx, texUnit, pname, (GLenum) iparam0);
- break;
- case GL_OPERAND0_RGB:
- case GL_OPERAND1_RGB:
- case GL_OPERAND2_RGB:
- case GL_OPERAND3_RGB_NV:
- case GL_OPERAND0_ALPHA:
- case GL_OPERAND1_ALPHA:
- case GL_OPERAND2_ALPHA:
- case GL_OPERAND3_ALPHA_NV:
- set_combiner_operand(ctx, texUnit, pname, (GLenum) iparam0);
- break;
- case GL_RGB_SCALE:
- case GL_ALPHA_SCALE:
- set_combiner_scale(ctx, texUnit, pname, param[0]);
- break;
- case GL_BUMP_TARGET_ATI:
- if (!ctx->Extensions.ATI_envmap_bumpmap) {
- _mesa_error( ctx, GL_INVALID_ENUM, "glTexEnv(pname=0x%x)", pname );
- return;
- }
- if ((iparam0 < GL_TEXTURE0) ||
- (iparam0 > GL_TEXTURE31)) {
- /* spec doesn't say this but it seems logical */
- _mesa_error( ctx, GL_INVALID_ENUM, "glTexEnv(param=0x%x)", iparam0);
- return;
- }
- if (!((1 << (iparam0 - GL_TEXTURE0)) & ctx->Const.SupportedBumpUnits)) {
- _mesa_error( ctx, GL_INVALID_VALUE, "glTexEnv(param=0x%x)", iparam0);
- return;
- }
- else {
- FLUSH_VERTICES(ctx, _NEW_TEXTURE);
- texUnit->BumpTarget = iparam0;
- }
- break;
- default:
- _mesa_error( ctx, GL_INVALID_ENUM, "glTexEnv(pname)" );
- return;
- }
- }
- else if (target == GL_TEXTURE_FILTER_CONTROL_EXT) {
- /* GL_EXT_texture_lod_bias */
- if (!ctx->Extensions.EXT_texture_lod_bias) {
- _mesa_error( ctx, GL_INVALID_ENUM, "glTexEnv(target=0x%x)", target );
- return;
- }
- if (pname == GL_TEXTURE_LOD_BIAS_EXT) {
- if (texUnit->LodBias == param[0])
- return;
- FLUSH_VERTICES(ctx, _NEW_TEXTURE);
- texUnit->LodBias = param[0];
- }
- else {
- TE_ERROR(GL_INVALID_ENUM, "glTexEnv(pname=%s)", pname);
- return;
- }
- }
- else if (target == GL_POINT_SPRITE_NV) {
- /* GL_ARB_point_sprite / GL_NV_point_sprite */
- if (!ctx->Extensions.NV_point_sprite
- && !ctx->Extensions.ARB_point_sprite) {
- _mesa_error( ctx, GL_INVALID_ENUM, "glTexEnv(target=0x%x)", target );
- return;
- }
- if (pname == GL_COORD_REPLACE_NV) {
- if (iparam0 == GL_TRUE || iparam0 == GL_FALSE) {
- /* It's kind of weird to set point state via glTexEnv,
- * but that's what the spec calls for.
- */
- const GLboolean state = (GLboolean) iparam0;
- if (ctx->Point.CoordReplace[ctx->Texture.CurrentUnit] == state)
- return;
- FLUSH_VERTICES(ctx, _NEW_POINT);
- ctx->Point.CoordReplace[ctx->Texture.CurrentUnit] = state;
- }
- else {
- _mesa_error( ctx, GL_INVALID_VALUE, "glTexEnv(param=0x%x)", iparam0);
- return;
- }
- }
- else {
- _mesa_error( ctx, GL_INVALID_ENUM, "glTexEnv(pname=0x%x)", pname );
- return;
- }
- }
- else {
- _mesa_error( ctx, GL_INVALID_ENUM, "glTexEnv(target=0x%x)",target );
- return;
- }
-
- if (MESA_VERBOSE&(VERBOSE_API|VERBOSE_TEXTURE))
- _mesa_debug(ctx, "glTexEnv %s %s %.1f(%s) ...\n",
- _mesa_lookup_enum_by_nr(target),
- _mesa_lookup_enum_by_nr(pname),
- *param,
- _mesa_lookup_enum_by_nr((GLenum) iparam0));
-
- /* Tell device driver about the new texture environment */
- if (ctx->Driver.TexEnv) {
- (*ctx->Driver.TexEnv)( ctx, target, pname, param );
- }
-}
-
-
-void GLAPIENTRY
-_mesa_TexEnvf( GLenum target, GLenum pname, GLfloat param )
-{
- GLfloat p[4];
- p[0] = param;
- p[1] = p[2] = p[3] = 0.0;
- _mesa_TexEnvfv( target, pname, p );
-}
-
-
-
-void GLAPIENTRY
-_mesa_TexEnvi( GLenum target, GLenum pname, GLint param )
-{
- GLfloat p[4];
- p[0] = (GLfloat) param;
- p[1] = p[2] = p[3] = 0.0;
- _mesa_TexEnvfv( target, pname, p );
-}
-
-
-void GLAPIENTRY
-_mesa_TexEnviv( GLenum target, GLenum pname, const GLint *param )
-{
- GLfloat p[4];
- if (pname == GL_TEXTURE_ENV_COLOR) {
- p[0] = INT_TO_FLOAT( param[0] );
- p[1] = INT_TO_FLOAT( param[1] );
- p[2] = INT_TO_FLOAT( param[2] );
- p[3] = INT_TO_FLOAT( param[3] );
- }
- else {
- p[0] = (GLfloat) param[0];
- p[1] = p[2] = p[3] = 0; /* init to zero, just to be safe */
- }
- _mesa_TexEnvfv( target, pname, p );
-}
-
-
-
-/**
- * Helper for glGetTexEnvi/f()
- * \return value of queried pname or -1 if error.
- */
-static GLint
-get_texenvi(struct gl_context *ctx, const struct gl_texture_unit *texUnit,
- GLenum pname)
-{
- switch (pname) {
- case GL_TEXTURE_ENV_MODE:
- return texUnit->EnvMode;
- break;
- case GL_COMBINE_RGB:
- if (ctx->Extensions.EXT_texture_env_combine ||
- ctx->Extensions.ARB_texture_env_combine) {
- return texUnit->Combine.ModeRGB;
- }
- else {
- _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)");
- }
- break;
- case GL_COMBINE_ALPHA:
- if (ctx->Extensions.EXT_texture_env_combine ||
- ctx->Extensions.ARB_texture_env_combine) {
- return texUnit->Combine.ModeA;
- }
- else {
- _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)");
- }
- break;
- case GL_SOURCE0_RGB:
- case GL_SOURCE1_RGB:
- case GL_SOURCE2_RGB:
- if (ctx->Extensions.EXT_texture_env_combine ||
- ctx->Extensions.ARB_texture_env_combine) {
- const unsigned rgb_idx = pname - GL_SOURCE0_RGB;
- return texUnit->Combine.SourceRGB[rgb_idx];
- }
- else {
- _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)");
- }
- break;
- case GL_SOURCE3_RGB_NV:
- if (ctx->Extensions.NV_texture_env_combine4) {
- return texUnit->Combine.SourceRGB[3];
- }
- else {
- _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)");
- }
- break;
- case GL_SOURCE0_ALPHA:
- case GL_SOURCE1_ALPHA:
- case GL_SOURCE2_ALPHA:
- if (ctx->Extensions.EXT_texture_env_combine ||
- ctx->Extensions.ARB_texture_env_combine) {
- const unsigned alpha_idx = pname - GL_SOURCE0_ALPHA;
- return texUnit->Combine.SourceA[alpha_idx];
- }
- else {
- _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)");
- }
- break;
- case GL_SOURCE3_ALPHA_NV:
- if (ctx->Extensions.NV_texture_env_combine4) {
- return texUnit->Combine.SourceA[3];
- }
- else {
- _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)");
- }
- break;
- case GL_OPERAND0_RGB:
- case GL_OPERAND1_RGB:
- case GL_OPERAND2_RGB:
- if (ctx->Extensions.EXT_texture_env_combine ||
- ctx->Extensions.ARB_texture_env_combine) {
- const unsigned op_rgb = pname - GL_OPERAND0_RGB;
- return texUnit->Combine.OperandRGB[op_rgb];
- }
- else {
- _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)");
- }
- break;
- case GL_OPERAND3_RGB_NV:
- if (ctx->Extensions.NV_texture_env_combine4) {
- return texUnit->Combine.OperandRGB[3];
- }
- else {
- _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)");
- }
- break;
- case GL_OPERAND0_ALPHA:
- case GL_OPERAND1_ALPHA:
- case GL_OPERAND2_ALPHA:
- if (ctx->Extensions.EXT_texture_env_combine ||
- ctx->Extensions.ARB_texture_env_combine) {
- const unsigned op_alpha = pname - GL_OPERAND0_ALPHA;
- return texUnit->Combine.OperandA[op_alpha];
- }
- else {
- _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)");
- }
- break;
- case GL_OPERAND3_ALPHA_NV:
- if (ctx->Extensions.NV_texture_env_combine4) {
- return texUnit->Combine.OperandA[3];
- }
- else {
- _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)");
- }
- break;
- case GL_RGB_SCALE:
- if (ctx->Extensions.EXT_texture_env_combine ||
- ctx->Extensions.ARB_texture_env_combine) {
- return 1 << texUnit->Combine.ScaleShiftRGB;
- }
- else {
- _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)");
- }
- break;
- case GL_ALPHA_SCALE:
- if (ctx->Extensions.EXT_texture_env_combine ||
- ctx->Extensions.ARB_texture_env_combine) {
- return 1 << texUnit->Combine.ScaleShiftA;
- }
- else {
- _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)");
- }
- break;
- case GL_BUMP_TARGET_ATI:
- /* spec doesn't say so, but I think this should be queryable */
- if (ctx->Extensions.ATI_envmap_bumpmap) {
- return texUnit->BumpTarget;
- }
- else {
- _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)");
- }
- break;
-
- default:
- ;
- }
-
- return -1; /* error */
-}
-
-
-
-void GLAPIENTRY
-_mesa_GetTexEnvfv( GLenum target, GLenum pname, GLfloat *params )
-{
- GLuint maxUnit;
- const struct gl_texture_unit *texUnit;
- GET_CURRENT_CONTEXT(ctx);
- ASSERT_OUTSIDE_BEGIN_END(ctx);
-
- maxUnit = (target == GL_POINT_SPRITE_NV && pname == GL_COORD_REPLACE_NV)
- ? ctx->Const.MaxTextureCoordUnits : ctx->Const.MaxTextureImageUnits;
- if (ctx->Texture.CurrentUnit >= maxUnit) {
- _mesa_error(ctx, GL_INVALID_OPERATION, "glGetTexEnvfv(current unit)");
- return;
- }
-
- texUnit = _mesa_get_current_tex_unit(ctx);
-
- if (target == GL_TEXTURE_ENV) {
- if (pname == GL_TEXTURE_ENV_COLOR) {
- if(ctx->NewState & (_NEW_BUFFERS | _NEW_FRAG_CLAMP))
- _mesa_update_state(ctx);
- if(ctx->Color._ClampFragmentColor)
- COPY_4FV( params, texUnit->EnvColor );
- else
- COPY_4FV( params, texUnit->EnvColorUnclamped );
- }
- else {
- GLint val = get_texenvi(ctx, texUnit, pname);
- if (val >= 0) {
- *params = (GLfloat) val;
- }
- }
- }
- else if (target == GL_TEXTURE_FILTER_CONTROL_EXT) {
- /* GL_EXT_texture_lod_bias */
- if (!ctx->Extensions.EXT_texture_lod_bias) {
- _mesa_error( ctx, GL_INVALID_ENUM, "glGetTexEnvfv(target)" );
- return;
- }
- if (pname == GL_TEXTURE_LOD_BIAS_EXT) {
- *params = texUnit->LodBias;
- }
- else {
- _mesa_error( ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)" );
- return;
- }
- }
- else if (target == GL_POINT_SPRITE_NV) {
- /* GL_ARB_point_sprite / GL_NV_point_sprite */
- if (!ctx->Extensions.NV_point_sprite
- && !ctx->Extensions.ARB_point_sprite) {
- _mesa_error( ctx, GL_INVALID_ENUM, "glGetTexEnvfv(target)" );
- return;
- }
- if (pname == GL_COORD_REPLACE_NV) {
- *params = (GLfloat) ctx->Point.CoordReplace[ctx->Texture.CurrentUnit];
- }
- else {
- _mesa_error( ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)" );
- return;
- }
- }
- else {
- _mesa_error( ctx, GL_INVALID_ENUM, "glGetTexEnvfv(target)" );
- return;
- }
-}
-
-
-void GLAPIENTRY
-_mesa_GetTexEnviv( GLenum target, GLenum pname, GLint *params )
-{
- GLuint maxUnit;
- const struct gl_texture_unit *texUnit;
- GET_CURRENT_CONTEXT(ctx);
- ASSERT_OUTSIDE_BEGIN_END(ctx);
-
- maxUnit = (target == GL_POINT_SPRITE_NV && pname == GL_COORD_REPLACE_NV)
- ? ctx->Const.MaxTextureCoordUnits : ctx->Const.MaxTextureImageUnits;
- if (ctx->Texture.CurrentUnit >= maxUnit) {
- _mesa_error(ctx, GL_INVALID_OPERATION, "glGetTexEnviv(current unit)");
- return;
- }
-
- texUnit = _mesa_get_current_tex_unit(ctx);
-
- if (target == GL_TEXTURE_ENV) {
- if (pname == GL_TEXTURE_ENV_COLOR) {
- params[0] = FLOAT_TO_INT( texUnit->EnvColor[0] );
- params[1] = FLOAT_TO_INT( texUnit->EnvColor[1] );
- params[2] = FLOAT_TO_INT( texUnit->EnvColor[2] );
- params[3] = FLOAT_TO_INT( texUnit->EnvColor[3] );
- }
- else {
- GLint val = get_texenvi(ctx, texUnit, pname);
- if (val >= 0) {
- *params = val;
- }
- }
- }
- else if (target == GL_TEXTURE_FILTER_CONTROL_EXT) {
- /* GL_EXT_texture_lod_bias */
- if (!ctx->Extensions.EXT_texture_lod_bias) {
- _mesa_error( ctx, GL_INVALID_ENUM, "glGetTexEnviv(target)" );
- return;
- }
- if (pname == GL_TEXTURE_LOD_BIAS_EXT) {
- *params = (GLint) texUnit->LodBias;
- }
- else {
- _mesa_error( ctx, GL_INVALID_ENUM, "glGetTexEnviv(pname)" );
- return;
- }
- }
- else if (target == GL_POINT_SPRITE_NV) {
- /* GL_ARB_point_sprite / GL_NV_point_sprite */
- if (!ctx->Extensions.NV_point_sprite
- && !ctx->Extensions.ARB_point_sprite) {
- _mesa_error( ctx, GL_INVALID_ENUM, "glGetTexEnviv(target)" );
- return;
- }
- if (pname == GL_COORD_REPLACE_NV) {
- *params = (GLint) ctx->Point.CoordReplace[ctx->Texture.CurrentUnit];
- }
- else {
- _mesa_error( ctx, GL_INVALID_ENUM, "glGetTexEnviv(pname)" );
- return;
- }
- }
- else {
- _mesa_error( ctx, GL_INVALID_ENUM, "glGetTexEnviv(target)" );
- return;
- }
-}
-
-
-/**
- * Why does ATI_envmap_bumpmap require new entrypoints? Should just
- * reuse TexEnv ones...
- */
-void GLAPIENTRY
-_mesa_TexBumpParameterivATI( GLenum pname, const GLint *param )
-{
- GLfloat p[4];
- GET_CURRENT_CONTEXT(ctx);
- ASSERT_OUTSIDE_BEGIN_END(ctx);
-
- if (!ctx->Extensions.ATI_envmap_bumpmap) {
- /* This isn't an "official" error case, but let's tell the user
- * that something's wrong.
- */
- _mesa_error(ctx, GL_INVALID_OPERATION, "glTexBumpParameterivATI");
- return;
- }
-
- if (pname == GL_BUMP_ROT_MATRIX_ATI) {
- /* hope that conversion is correct here */
- p[0] = INT_TO_FLOAT( param[0] );
- p[1] = INT_TO_FLOAT( param[1] );
- p[2] = INT_TO_FLOAT( param[2] );
- p[3] = INT_TO_FLOAT( param[3] );
- }
- else {
- p[0] = (GLfloat) param[0];
- p[1] = p[2] = p[3] = 0.0F; /* init to zero, just to be safe */
- }
- _mesa_TexBumpParameterfvATI( pname, p );
-}
-
-
-void GLAPIENTRY
-_mesa_TexBumpParameterfvATI( GLenum pname, const GLfloat *param )
-{
- struct gl_texture_unit *texUnit;
- GET_CURRENT_CONTEXT(ctx);
- ASSERT_OUTSIDE_BEGIN_END(ctx);
-
- if (!ctx->Extensions.ATI_envmap_bumpmap) {
- _mesa_error(ctx, GL_INVALID_OPERATION, "glTexBumpParameterfvATI");
- return;
- }
-
- texUnit = _mesa_get_current_tex_unit(ctx);
-
- if (pname == GL_BUMP_ROT_MATRIX_ATI) {
- if (TEST_EQ_4V(param, texUnit->RotMatrix))
- return;
- FLUSH_VERTICES(ctx, _NEW_TEXTURE);
- COPY_4FV(texUnit->RotMatrix, param);
- }
- else {
- _mesa_error( ctx, GL_INVALID_ENUM, "glTexBumpParameter(pname)" );
- return;
- }
- /* Drivers might want to know about this, instead of dedicated function
- just shove it into TexEnv where it really belongs anyway */
- if (ctx->Driver.TexEnv) {
- (*ctx->Driver.TexEnv)( ctx, 0, pname, param );
- }
-}
-
-
-void GLAPIENTRY
-_mesa_GetTexBumpParameterivATI( GLenum pname, GLint *param )
-{
- const struct gl_texture_unit *texUnit;
- GLuint i;
- GET_CURRENT_CONTEXT(ctx);
- ASSERT_OUTSIDE_BEGIN_END(ctx);
-
- if (!ctx->Extensions.ATI_envmap_bumpmap) {
- _mesa_error(ctx, GL_INVALID_OPERATION, "glGetTexBumpParameterivATI");
- return;
- }
-
- texUnit = _mesa_get_current_tex_unit(ctx);
-
- if (pname == GL_BUMP_ROT_MATRIX_SIZE_ATI) {
- /* spec leaves open to support larger matrices.
- Don't think anyone would ever want to use it
- (and apps almost certainly would not understand it and
- thus fail to submit matrices correctly) so hardcode this. */
- *param = 4;
- }
- else if (pname == GL_BUMP_ROT_MATRIX_ATI) {
- /* hope that conversion is correct here */
- param[0] = FLOAT_TO_INT(texUnit->RotMatrix[0]);
- param[1] = FLOAT_TO_INT(texUnit->RotMatrix[1]);
- param[2] = FLOAT_TO_INT(texUnit->RotMatrix[2]);
- param[3] = FLOAT_TO_INT(texUnit->RotMatrix[3]);
- }
- else if (pname == GL_BUMP_NUM_TEX_UNITS_ATI) {
- GLint count = 0;
- for (i = 0; i < ctx->Const.MaxTextureImageUnits; i++) {
- if (ctx->Const.SupportedBumpUnits & (1 << i)) {
- count++;
- }
- }
- *param = count;
- }
- else if (pname == GL_BUMP_TEX_UNITS_ATI) {
- for (i = 0; i < ctx->Const.MaxTextureImageUnits; i++) {
- if (ctx->Const.SupportedBumpUnits & (1 << i)) {
- *param++ = i + GL_TEXTURE0;
- }
- }
- }
- else {
- _mesa_error( ctx, GL_INVALID_ENUM, "glGetTexBumpParameter(pname)" );
- return;
- }
-}
-
-
-void GLAPIENTRY
-_mesa_GetTexBumpParameterfvATI( GLenum pname, GLfloat *param )
-{
- const struct gl_texture_unit *texUnit;
- GLuint i;
- GET_CURRENT_CONTEXT(ctx);
- ASSERT_OUTSIDE_BEGIN_END(ctx);
-
- if (!ctx->Extensions.ATI_envmap_bumpmap) {
- _mesa_error(ctx, GL_INVALID_OPERATION, "glGetTexBumpParameterfvATI");
- return;
- }
-
- texUnit = _mesa_get_current_tex_unit(ctx);
-
- if (pname == GL_BUMP_ROT_MATRIX_SIZE_ATI) {
- /* spec leaves open to support larger matrices.
- Don't think anyone would ever want to use it
- (and apps might not understand it) so hardcode this. */
- *param = 4.0F;
- }
- else if (pname == GL_BUMP_ROT_MATRIX_ATI) {
- param[0] = texUnit->RotMatrix[0];
- param[1] = texUnit->RotMatrix[1];
- param[2] = texUnit->RotMatrix[2];
- param[3] = texUnit->RotMatrix[3];
- }
- else if (pname == GL_BUMP_NUM_TEX_UNITS_ATI) {
- GLint count = 0;
- for (i = 0; i < ctx->Const.MaxTextureImageUnits; i++) {
- if (ctx->Const.SupportedBumpUnits & (1 << i)) {
- count++;
- }
- }
- *param = (GLfloat) count;
- }
- else if (pname == GL_BUMP_TEX_UNITS_ATI) {
- for (i = 0; i < ctx->Const.MaxTextureImageUnits; i++) {
- if (ctx->Const.SupportedBumpUnits & (1 << i)) {
- *param++ = (GLfloat) (i + GL_TEXTURE0);
- }
- }
- }
- else {
- _mesa_error( ctx, GL_INVALID_ENUM, "glGetTexBumpParameter(pname)" );
- return;
- }
-}
+/*
+ * Mesa 3-D graphics library
+ * Version: 7.5
+ *
+ * Copyright (C) 1999-2008 Brian Paul All Rights Reserved.
+ * Copyright (C) 2009 VMware, Inc. All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+/**
+ * \file texenv.c
+ *
+ * glTexEnv-related functions
+ */
+
+
+#include "main/glheader.h"
+#include "main/context.h"
+#include "main/enums.h"
+#include "main/macros.h"
+#include "main/mtypes.h"
+#include "main/state.h"
+#include "main/texenv.h"
+#include "main/texstate.h"
+
+
+#define TE_ERROR(errCode, msg, value) \
+ _mesa_error(ctx, errCode, msg, _mesa_lookup_enum_by_nr(value));
+
+
+/** Set texture env mode */
+static void
+set_env_mode(struct gl_context *ctx,
+ struct gl_texture_unit *texUnit,
+ GLenum mode)
+{
+ GLboolean legal;
+
+ if (texUnit->EnvMode == mode)
+ return;
+
+ switch (mode) {
+ case GL_MODULATE:
+ case GL_BLEND:
+ case GL_DECAL:
+ case GL_REPLACE:
+ legal = GL_TRUE;
+ break;
+ case GL_REPLACE_EXT:
+ mode = GL_REPLACE; /* GL_REPLACE_EXT != GL_REPLACE */
+ legal = GL_TRUE;
+ break;
+ case GL_ADD:
+ legal = ctx->Extensions.EXT_texture_env_add;
+ break;
+ case GL_COMBINE:
+ legal = (ctx->Extensions.EXT_texture_env_combine ||
+ ctx->Extensions.ARB_texture_env_combine);
+ break;
+ case GL_COMBINE4_NV:
+ legal = ctx->Extensions.NV_texture_env_combine4;
+ break;
+ default:
+ legal = GL_FALSE;
+ }
+
+ if (legal) {
+ FLUSH_VERTICES(ctx, _NEW_TEXTURE);
+ texUnit->EnvMode = mode;
+ }
+ else {
+ TE_ERROR(GL_INVALID_ENUM, "glTexEnv(param=%s)", mode);
+ }
+}
+
+
+static void
+set_env_color(struct gl_context *ctx,
+ struct gl_texture_unit *texUnit,
+ const GLfloat *color)
+{
+ if (TEST_EQ_4V(color, texUnit->EnvColorUnclamped))
+ return;
+ FLUSH_VERTICES(ctx, _NEW_TEXTURE);
+ COPY_4FV(texUnit->EnvColorUnclamped, color);
+ texUnit->EnvColor[0] = CLAMP(color[0], 0.0F, 1.0F);
+ texUnit->EnvColor[1] = CLAMP(color[1], 0.0F, 1.0F);
+ texUnit->EnvColor[2] = CLAMP(color[2], 0.0F, 1.0F);
+ texUnit->EnvColor[3] = CLAMP(color[3], 0.0F, 1.0F);
+}
+
+
+/** Set an RGB or A combiner mode/function */
+static void
+set_combiner_mode(struct gl_context *ctx,
+ struct gl_texture_unit *texUnit,
+ GLenum pname, GLenum mode)
+{
+ GLboolean legal;
+
+ if (!ctx->Extensions.EXT_texture_env_combine &&
+ !ctx->Extensions.ARB_texture_env_combine) {
+ _mesa_error(ctx, GL_INVALID_ENUM, "glTexEnv(pname)");
+ return;
+ }
+
+ switch (mode) {
+ case GL_REPLACE:
+ case GL_MODULATE:
+ case GL_ADD:
+ case GL_ADD_SIGNED:
+ case GL_INTERPOLATE:
+ legal = GL_TRUE;
+ break;
+ case GL_SUBTRACT:
+ legal = ctx->Extensions.ARB_texture_env_combine;
+ break;
+ case GL_DOT3_RGB_EXT:
+ case GL_DOT3_RGBA_EXT:
+ legal = (ctx->Extensions.EXT_texture_env_dot3 &&
+ pname == GL_COMBINE_RGB);
+ break;
+ case GL_DOT3_RGB:
+ case GL_DOT3_RGBA:
+ legal = (ctx->Extensions.ARB_texture_env_dot3 &&
+ pname == GL_COMBINE_RGB);
+ break;
+ case GL_MODULATE_ADD_ATI:
+ case GL_MODULATE_SIGNED_ADD_ATI:
+ case GL_MODULATE_SUBTRACT_ATI:
+ legal = ctx->Extensions.ATI_texture_env_combine3;
+ break;
+ case GL_BUMP_ENVMAP_ATI:
+ legal = (ctx->Extensions.ATI_envmap_bumpmap &&
+ pname == GL_COMBINE_RGB);
+ break;
+ default:
+ legal = GL_FALSE;
+ }
+
+ if (!legal) {
+ TE_ERROR(GL_INVALID_ENUM, "glTexEnv(param=%s)", mode);
+ return;
+ }
+
+ switch (pname) {
+ case GL_COMBINE_RGB:
+ if (texUnit->Combine.ModeRGB == mode)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_TEXTURE);
+ texUnit->Combine.ModeRGB = mode;
+ break;
+
+ case GL_COMBINE_ALPHA:
+ if (texUnit->Combine.ModeA == mode)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_TEXTURE);
+ texUnit->Combine.ModeA = mode;
+ break;
+ default:
+ TE_ERROR(GL_INVALID_ENUM, "glTexEnv(pname=%s)", pname);
+ }
+}
+
+
+
+/** Set an RGB or A combiner source term */
+static void
+set_combiner_source(struct gl_context *ctx,
+ struct gl_texture_unit *texUnit,
+ GLenum pname, GLenum param)
+{
+ GLuint term;
+ GLboolean alpha, legal;
+
+ if (!ctx->Extensions.EXT_texture_env_combine &&
+ !ctx->Extensions.ARB_texture_env_combine) {
+ _mesa_error(ctx, GL_INVALID_ENUM, "glTexEnv(pname)");
+ return;
+ }
+
+ /*
+ * Translate pname to (term, alpha).
+ *
+ * The enums were given sequential values for a reason.
+ */
+ switch (pname) {
+ case GL_SOURCE0_RGB:
+ case GL_SOURCE1_RGB:
+ case GL_SOURCE2_RGB:
+ case GL_SOURCE3_RGB_NV:
+ term = pname - GL_SOURCE0_RGB;
+ alpha = GL_FALSE;
+ break;
+ case GL_SOURCE0_ALPHA:
+ case GL_SOURCE1_ALPHA:
+ case GL_SOURCE2_ALPHA:
+ case GL_SOURCE3_ALPHA_NV:
+ term = pname - GL_SOURCE0_ALPHA;
+ alpha = GL_TRUE;
+ break;
+ default:
+ TE_ERROR(GL_INVALID_ENUM, "glTexEnv(pname=%s)", pname);
+ return;
+ }
+
+ if ((term == 3) && !ctx->Extensions.NV_texture_env_combine4) {
+ TE_ERROR(GL_INVALID_ENUM, "glTexEnv(pname=%s)", pname);
+ return;
+ }
+
+ assert(term < MAX_COMBINER_TERMS);
+
+ /*
+ * Error-check param (the source term)
+ */
+ switch (param) {
+ case GL_TEXTURE:
+ case GL_CONSTANT:
+ case GL_PRIMARY_COLOR:
+ case GL_PREVIOUS:
+ legal = GL_TRUE;
+ break;
+ case GL_TEXTURE0:
+ case GL_TEXTURE1:
+ case GL_TEXTURE2:
+ case GL_TEXTURE3:
+ case GL_TEXTURE4:
+ case GL_TEXTURE5:
+ case GL_TEXTURE6:
+ case GL_TEXTURE7:
+ legal = (ctx->Extensions.ARB_texture_env_crossbar &&
+ param - GL_TEXTURE0 < ctx->Const.MaxTextureUnits);
+ break;
+ case GL_ZERO:
+ legal = (ctx->Extensions.ATI_texture_env_combine3 ||
+ ctx->Extensions.NV_texture_env_combine4);
+ break;
+ case GL_ONE:
+ legal = ctx->Extensions.ATI_texture_env_combine3;
+ break;
+ default:
+ legal = GL_FALSE;
+ }
+
+ if (!legal) {
+ TE_ERROR(GL_INVALID_ENUM, "glTexEnv(param=%s)", param);
+ return;
+ }
+
+ FLUSH_VERTICES(ctx, _NEW_TEXTURE);
+
+ if (alpha)
+ texUnit->Combine.SourceA[term] = param;
+ else
+ texUnit->Combine.SourceRGB[term] = param;
+}
+
+
+/** Set an RGB or A combiner operand term */
+static void
+set_combiner_operand(struct gl_context *ctx,
+ struct gl_texture_unit *texUnit,
+ GLenum pname, GLenum param)
+{
+ GLuint term;
+ GLboolean alpha, legal;
+
+ if (!ctx->Extensions.EXT_texture_env_combine &&
+ !ctx->Extensions.ARB_texture_env_combine) {
+ _mesa_error(ctx, GL_INVALID_ENUM, "glTexEnv(pname)");
+ return;
+ }
+
+ /* The enums were given sequential values for a reason.
+ */
+ switch (pname) {
+ case GL_OPERAND0_RGB:
+ case GL_OPERAND1_RGB:
+ case GL_OPERAND2_RGB:
+ case GL_OPERAND3_RGB_NV:
+ term = pname - GL_OPERAND0_RGB;
+ alpha = GL_FALSE;
+ break;
+ case GL_OPERAND0_ALPHA:
+ case GL_OPERAND1_ALPHA:
+ case GL_OPERAND2_ALPHA:
+ case GL_OPERAND3_ALPHA_NV:
+ term = pname - GL_OPERAND0_ALPHA;
+ alpha = GL_TRUE;
+ break;
+ default:
+ TE_ERROR(GL_INVALID_ENUM, "glTexEnv(pname=%s)", pname);
+ return;
+ }
+
+ if ((term == 3) && !ctx->Extensions.NV_texture_env_combine4) {
+ TE_ERROR(GL_INVALID_ENUM, "glTexEnv(pname=%s)", pname);
+ return;
+ }
+
+ assert(term < MAX_COMBINER_TERMS);
+
+ /*
+ * Error-check param (the source operand)
+ */
+ switch (param) {
+ case GL_SRC_COLOR:
+ case GL_ONE_MINUS_SRC_COLOR:
+ /* The color input can only be used with GL_OPERAND[01]_RGB in the EXT
+ * version. In the ARB and NV versions they can be used for any RGB
+ * operand.
+ */
+ legal = !alpha
+ && ((term < 2) || ctx->Extensions.ARB_texture_env_combine
+ || ctx->Extensions.NV_texture_env_combine4);
+ break;
+ case GL_ONE_MINUS_SRC_ALPHA:
+ /* GL_ONE_MINUS_SRC_ALPHA can only be used with
+ * GL_OPERAND[01]_(RGB|ALPHA) in the EXT version. In the ARB and NV
+ * versions it can be used for any operand.
+ */
+ legal = (term < 2) || ctx->Extensions.ARB_texture_env_combine
+ || ctx->Extensions.NV_texture_env_combine4;
+ break;
+ case GL_SRC_ALPHA:
+ legal = GL_TRUE;
+ break;
+ default:
+ legal = GL_FALSE;
+ }
+
+ if (!legal) {
+ TE_ERROR(GL_INVALID_ENUM, "glTexEnv(param=%s)", param);
+ return;
+ }
+
+ FLUSH_VERTICES(ctx, _NEW_TEXTURE);
+
+ if (alpha)
+ texUnit->Combine.OperandA[term] = param;
+ else
+ texUnit->Combine.OperandRGB[term] = param;
+}
+
+
+static void
+set_combiner_scale(struct gl_context *ctx,
+ struct gl_texture_unit *texUnit,
+ GLenum pname, GLfloat scale)
+{
+ GLuint shift;
+
+ if (!ctx->Extensions.EXT_texture_env_combine &&
+ !ctx->Extensions.ARB_texture_env_combine) {
+ _mesa_error(ctx, GL_INVALID_ENUM, "glTexEnv(pname)");
+ return;
+ }
+
+ if (scale == 1.0F) {
+ shift = 0;
+ }
+ else if (scale == 2.0F) {
+ shift = 1;
+ }
+ else if (scale == 4.0F) {
+ shift = 2;
+ }
+ else {
+ _mesa_error( ctx, GL_INVALID_VALUE,
+ "glTexEnv(GL_RGB_SCALE not 1, 2 or 4)" );
+ return;
+ }
+
+ switch (pname) {
+ case GL_RGB_SCALE:
+ if (texUnit->Combine.ScaleShiftRGB == shift)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_TEXTURE);
+ texUnit->Combine.ScaleShiftRGB = shift;
+ break;
+ case GL_ALPHA_SCALE:
+ if (texUnit->Combine.ScaleShiftA == shift)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_TEXTURE);
+ texUnit->Combine.ScaleShiftA = shift;
+ break;
+ default:
+ TE_ERROR(GL_INVALID_ENUM, "glTexEnv(pname=%s)", pname);
+ }
+}
+
+
+
+void GLAPIENTRY
+_mesa_TexEnvfv( GLenum target, GLenum pname, const GLfloat *param )
+{
+ const GLint iparam0 = (GLint) param[0];
+ struct gl_texture_unit *texUnit;
+ GLuint maxUnit;
+
+ GET_CURRENT_CONTEXT(ctx);
+ ASSERT_OUTSIDE_BEGIN_END(ctx);
+
+ maxUnit = (target == GL_POINT_SPRITE_NV && pname == GL_COORD_REPLACE_NV)
+ ? ctx->Const.MaxTextureCoordUnits : ctx->Const.MaxTextureImageUnits;
+ if (ctx->Texture.CurrentUnit >= maxUnit) {
+ _mesa_error(ctx, GL_INVALID_OPERATION, "glTexEnvfv(current unit)");
+ return;
+ }
+
+ texUnit = _mesa_get_current_tex_unit(ctx);
+
+ if (target == GL_TEXTURE_ENV) {
+ switch (pname) {
+ case GL_TEXTURE_ENV_MODE:
+ set_env_mode(ctx, texUnit, (GLenum) iparam0);
+ break;
+ case GL_TEXTURE_ENV_COLOR:
+ set_env_color(ctx, texUnit, param);
+ break;
+ case GL_COMBINE_RGB:
+ case GL_COMBINE_ALPHA:
+ set_combiner_mode(ctx, texUnit, pname, (GLenum) iparam0);
+ break;
+ case GL_SOURCE0_RGB:
+ case GL_SOURCE1_RGB:
+ case GL_SOURCE2_RGB:
+ case GL_SOURCE3_RGB_NV:
+ case GL_SOURCE0_ALPHA:
+ case GL_SOURCE1_ALPHA:
+ case GL_SOURCE2_ALPHA:
+ case GL_SOURCE3_ALPHA_NV:
+ set_combiner_source(ctx, texUnit, pname, (GLenum) iparam0);
+ break;
+ case GL_OPERAND0_RGB:
+ case GL_OPERAND1_RGB:
+ case GL_OPERAND2_RGB:
+ case GL_OPERAND3_RGB_NV:
+ case GL_OPERAND0_ALPHA:
+ case GL_OPERAND1_ALPHA:
+ case GL_OPERAND2_ALPHA:
+ case GL_OPERAND3_ALPHA_NV:
+ set_combiner_operand(ctx, texUnit, pname, (GLenum) iparam0);
+ break;
+ case GL_RGB_SCALE:
+ case GL_ALPHA_SCALE:
+ set_combiner_scale(ctx, texUnit, pname, param[0]);
+ break;
+ case GL_BUMP_TARGET_ATI:
+ if (!ctx->Extensions.ATI_envmap_bumpmap) {
+ _mesa_error( ctx, GL_INVALID_ENUM, "glTexEnv(pname=0x%x)", pname );
+ return;
+ }
+ if ((iparam0 < GL_TEXTURE0) ||
+ (iparam0 > GL_TEXTURE31)) {
+ /* spec doesn't say this but it seems logical */
+ _mesa_error( ctx, GL_INVALID_ENUM, "glTexEnv(param=0x%x)", iparam0);
+ return;
+ }
+ if (!((1 << (iparam0 - GL_TEXTURE0)) & ctx->Const.SupportedBumpUnits)) {
+ _mesa_error( ctx, GL_INVALID_VALUE, "glTexEnv(param=0x%x)", iparam0);
+ return;
+ }
+ else {
+ FLUSH_VERTICES(ctx, _NEW_TEXTURE);
+ texUnit->BumpTarget = iparam0;
+ }
+ break;
+ default:
+ _mesa_error( ctx, GL_INVALID_ENUM, "glTexEnv(pname)" );
+ return;
+ }
+ }
+ else if (target == GL_TEXTURE_FILTER_CONTROL_EXT) {
+ /* GL_EXT_texture_lod_bias */
+ if (!ctx->Extensions.EXT_texture_lod_bias) {
+ _mesa_error( ctx, GL_INVALID_ENUM, "glTexEnv(target=0x%x)", target );
+ return;
+ }
+ if (pname == GL_TEXTURE_LOD_BIAS_EXT) {
+ if (texUnit->LodBias == param[0])
+ return;
+ FLUSH_VERTICES(ctx, _NEW_TEXTURE);
+ texUnit->LodBias = param[0];
+ }
+ else {
+ TE_ERROR(GL_INVALID_ENUM, "glTexEnv(pname=%s)", pname);
+ return;
+ }
+ }
+ else if (target == GL_POINT_SPRITE_NV) {
+ /* GL_ARB_point_sprite / GL_NV_point_sprite */
+ if (!ctx->Extensions.NV_point_sprite
+ && !ctx->Extensions.ARB_point_sprite) {
+ _mesa_error( ctx, GL_INVALID_ENUM, "glTexEnv(target=0x%x)", target );
+ return;
+ }
+ if (pname == GL_COORD_REPLACE_NV) {
+ if (iparam0 == GL_TRUE || iparam0 == GL_FALSE) {
+ /* It's kind of weird to set point state via glTexEnv,
+ * but that's what the spec calls for.
+ */
+ const GLboolean state = (GLboolean) iparam0;
+ if (ctx->Point.CoordReplace[ctx->Texture.CurrentUnit] == state)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_POINT);
+ ctx->Point.CoordReplace[ctx->Texture.CurrentUnit] = state;
+ }
+ else {
+ _mesa_error( ctx, GL_INVALID_VALUE, "glTexEnv(param=0x%x)", iparam0);
+ return;
+ }
+ }
+ else {
+ _mesa_error( ctx, GL_INVALID_ENUM, "glTexEnv(pname=0x%x)", pname );
+ return;
+ }
+ }
+ else {
+ _mesa_error( ctx, GL_INVALID_ENUM, "glTexEnv(target=0x%x)",target );
+ return;
+ }
+
+ if (MESA_VERBOSE&(VERBOSE_API|VERBOSE_TEXTURE))
+ _mesa_debug(ctx, "glTexEnv %s %s %.1f(%s) ...\n",
+ _mesa_lookup_enum_by_nr(target),
+ _mesa_lookup_enum_by_nr(pname),
+ *param,
+ _mesa_lookup_enum_by_nr((GLenum) iparam0));
+
+ /* Tell device driver about the new texture environment */
+ if (ctx->Driver.TexEnv) {
+ (*ctx->Driver.TexEnv)( ctx, target, pname, param );
+ }
+}
+
+
+void GLAPIENTRY
+_mesa_TexEnvf( GLenum target, GLenum pname, GLfloat param )
+{
+ GLfloat p[4];
+ p[0] = param;
+ p[1] = p[2] = p[3] = 0.0;
+ _mesa_TexEnvfv( target, pname, p );
+}
+
+
+
+void GLAPIENTRY
+_mesa_TexEnvi( GLenum target, GLenum pname, GLint param )
+{
+ GLfloat p[4];
+ p[0] = (GLfloat) param;
+ p[1] = p[2] = p[3] = 0.0;
+ _mesa_TexEnvfv( target, pname, p );
+}
+
+
+void GLAPIENTRY
+_mesa_TexEnviv( GLenum target, GLenum pname, const GLint *param )
+{
+ GLfloat p[4];
+ if (pname == GL_TEXTURE_ENV_COLOR) {
+ p[0] = INT_TO_FLOAT( param[0] );
+ p[1] = INT_TO_FLOAT( param[1] );
+ p[2] = INT_TO_FLOAT( param[2] );
+ p[3] = INT_TO_FLOAT( param[3] );
+ }
+ else {
+ p[0] = (GLfloat) param[0];
+ p[1] = p[2] = p[3] = 0; /* init to zero, just to be safe */
+ }
+ _mesa_TexEnvfv( target, pname, p );
+}
+
+
+
+/**
+ * Helper for glGetTexEnvi/f()
+ * \return value of queried pname or -1 if error.
+ */
+static GLint
+get_texenvi(struct gl_context *ctx, const struct gl_texture_unit *texUnit,
+ GLenum pname)
+{
+ switch (pname) {
+ case GL_TEXTURE_ENV_MODE:
+ return texUnit->EnvMode;
+ break;
+ case GL_COMBINE_RGB:
+ if (ctx->Extensions.EXT_texture_env_combine ||
+ ctx->Extensions.ARB_texture_env_combine) {
+ return texUnit->Combine.ModeRGB;
+ }
+ else {
+ _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)");
+ }
+ break;
+ case GL_COMBINE_ALPHA:
+ if (ctx->Extensions.EXT_texture_env_combine ||
+ ctx->Extensions.ARB_texture_env_combine) {
+ return texUnit->Combine.ModeA;
+ }
+ else {
+ _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)");
+ }
+ break;
+ case GL_SOURCE0_RGB:
+ case GL_SOURCE1_RGB:
+ case GL_SOURCE2_RGB:
+ if (ctx->Extensions.EXT_texture_env_combine ||
+ ctx->Extensions.ARB_texture_env_combine) {
+ const unsigned rgb_idx = pname - GL_SOURCE0_RGB;
+ return texUnit->Combine.SourceRGB[rgb_idx];
+ }
+ else {
+ _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)");
+ }
+ break;
+ case GL_SOURCE3_RGB_NV:
+ if (ctx->Extensions.NV_texture_env_combine4) {
+ return texUnit->Combine.SourceRGB[3];
+ }
+ else {
+ _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)");
+ }
+ break;
+ case GL_SOURCE0_ALPHA:
+ case GL_SOURCE1_ALPHA:
+ case GL_SOURCE2_ALPHA:
+ if (ctx->Extensions.EXT_texture_env_combine ||
+ ctx->Extensions.ARB_texture_env_combine) {
+ const unsigned alpha_idx = pname - GL_SOURCE0_ALPHA;
+ return texUnit->Combine.SourceA[alpha_idx];
+ }
+ else {
+ _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)");
+ }
+ break;
+ case GL_SOURCE3_ALPHA_NV:
+ if (ctx->Extensions.NV_texture_env_combine4) {
+ return texUnit->Combine.SourceA[3];
+ }
+ else {
+ _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)");
+ }
+ break;
+ case GL_OPERAND0_RGB:
+ case GL_OPERAND1_RGB:
+ case GL_OPERAND2_RGB:
+ if (ctx->Extensions.EXT_texture_env_combine ||
+ ctx->Extensions.ARB_texture_env_combine) {
+ const unsigned op_rgb = pname - GL_OPERAND0_RGB;
+ return texUnit->Combine.OperandRGB[op_rgb];
+ }
+ else {
+ _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)");
+ }
+ break;
+ case GL_OPERAND3_RGB_NV:
+ if (ctx->Extensions.NV_texture_env_combine4) {
+ return texUnit->Combine.OperandRGB[3];
+ }
+ else {
+ _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)");
+ }
+ break;
+ case GL_OPERAND0_ALPHA:
+ case GL_OPERAND1_ALPHA:
+ case GL_OPERAND2_ALPHA:
+ if (ctx->Extensions.EXT_texture_env_combine ||
+ ctx->Extensions.ARB_texture_env_combine) {
+ const unsigned op_alpha = pname - GL_OPERAND0_ALPHA;
+ return texUnit->Combine.OperandA[op_alpha];
+ }
+ else {
+ _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)");
+ }
+ break;
+ case GL_OPERAND3_ALPHA_NV:
+ if (ctx->Extensions.NV_texture_env_combine4) {
+ return texUnit->Combine.OperandA[3];
+ }
+ else {
+ _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)");
+ }
+ break;
+ case GL_RGB_SCALE:
+ if (ctx->Extensions.EXT_texture_env_combine ||
+ ctx->Extensions.ARB_texture_env_combine) {
+ return 1 << texUnit->Combine.ScaleShiftRGB;
+ }
+ else {
+ _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)");
+ }
+ break;
+ case GL_ALPHA_SCALE:
+ if (ctx->Extensions.EXT_texture_env_combine ||
+ ctx->Extensions.ARB_texture_env_combine) {
+ return 1 << texUnit->Combine.ScaleShiftA;
+ }
+ else {
+ _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)");
+ }
+ break;
+ case GL_BUMP_TARGET_ATI:
+ /* spec doesn't say so, but I think this should be queryable */
+ if (ctx->Extensions.ATI_envmap_bumpmap) {
+ return texUnit->BumpTarget;
+ }
+ else {
+ _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)");
+ }
+ break;
+
+ default:
+ ;
+ }
+
+ return -1; /* error */
+}
+
+
+
+void GLAPIENTRY
+_mesa_GetTexEnvfv( GLenum target, GLenum pname, GLfloat *params )
+{
+ GLuint maxUnit;
+ const struct gl_texture_unit *texUnit;
+ GET_CURRENT_CONTEXT(ctx);
+ ASSERT_OUTSIDE_BEGIN_END(ctx);
+
+ maxUnit = (target == GL_POINT_SPRITE_NV && pname == GL_COORD_REPLACE_NV)
+ ? ctx->Const.MaxTextureCoordUnits : ctx->Const.MaxTextureImageUnits;
+ if (ctx->Texture.CurrentUnit >= maxUnit) {
+ _mesa_error(ctx, GL_INVALID_OPERATION, "glGetTexEnvfv(current unit)");
+ return;
+ }
+
+ texUnit = _mesa_get_current_tex_unit(ctx);
+
+ if (target == GL_TEXTURE_ENV) {
+ if (pname == GL_TEXTURE_ENV_COLOR) {
+ if(ctx->NewState & (_NEW_BUFFERS | _NEW_FRAG_CLAMP))
+ _mesa_update_state(ctx);
+ if(ctx->Color._ClampFragmentColor)
+ COPY_4FV( params, texUnit->EnvColor );
+ else
+ COPY_4FV( params, texUnit->EnvColorUnclamped );
+ }
+ else {
+ GLint val = get_texenvi(ctx, texUnit, pname);
+ if (val >= 0) {
+ *params = (GLfloat) val;
+ }
+ }
+ }
+ else if (target == GL_TEXTURE_FILTER_CONTROL_EXT) {
+ /* GL_EXT_texture_lod_bias */
+ if (!ctx->Extensions.EXT_texture_lod_bias) {
+ _mesa_error( ctx, GL_INVALID_ENUM, "glGetTexEnvfv(target)" );
+ return;
+ }
+ if (pname == GL_TEXTURE_LOD_BIAS_EXT) {
+ *params = texUnit->LodBias;
+ }
+ else {
+ _mesa_error( ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)" );
+ return;
+ }
+ }
+ else if (target == GL_POINT_SPRITE_NV) {
+ /* GL_ARB_point_sprite / GL_NV_point_sprite */
+ if (!ctx->Extensions.NV_point_sprite
+ && !ctx->Extensions.ARB_point_sprite) {
+ _mesa_error( ctx, GL_INVALID_ENUM, "glGetTexEnvfv(target)" );
+ return;
+ }
+ if (pname == GL_COORD_REPLACE_NV) {
+ *params = (GLfloat) ctx->Point.CoordReplace[ctx->Texture.CurrentUnit];
+ }
+ else {
+ _mesa_error( ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)" );
+ return;
+ }
+ }
+ else {
+ _mesa_error( ctx, GL_INVALID_ENUM, "glGetTexEnvfv(target)" );
+ return;
+ }
+}
+
+
+void GLAPIENTRY
+_mesa_GetTexEnviv( GLenum target, GLenum pname, GLint *params )
+{
+ GLuint maxUnit;
+ const struct gl_texture_unit *texUnit;
+ GET_CURRENT_CONTEXT(ctx);
+ ASSERT_OUTSIDE_BEGIN_END(ctx);
+
+ maxUnit = (target == GL_POINT_SPRITE_NV && pname == GL_COORD_REPLACE_NV)
+ ? ctx->Const.MaxTextureCoordUnits : ctx->Const.MaxTextureImageUnits;
+ if (ctx->Texture.CurrentUnit >= maxUnit) {
+ _mesa_error(ctx, GL_INVALID_OPERATION, "glGetTexEnviv(current unit)");
+ return;
+ }
+
+ texUnit = _mesa_get_current_tex_unit(ctx);
+
+ if (target == GL_TEXTURE_ENV) {
+ if (pname == GL_TEXTURE_ENV_COLOR) {
+ params[0] = FLOAT_TO_INT( texUnit->EnvColor[0] );
+ params[1] = FLOAT_TO_INT( texUnit->EnvColor[1] );
+ params[2] = FLOAT_TO_INT( texUnit->EnvColor[2] );
+ params[3] = FLOAT_TO_INT( texUnit->EnvColor[3] );
+ }
+ else {
+ GLint val = get_texenvi(ctx, texUnit, pname);
+ if (val >= 0) {
+ *params = val;
+ }
+ }
+ }
+ else if (target == GL_TEXTURE_FILTER_CONTROL_EXT) {
+ /* GL_EXT_texture_lod_bias */
+ if (!ctx->Extensions.EXT_texture_lod_bias) {
+ _mesa_error( ctx, GL_INVALID_ENUM, "glGetTexEnviv(target)" );
+ return;
+ }
+ if (pname == GL_TEXTURE_LOD_BIAS_EXT) {
+ *params = (GLint) texUnit->LodBias;
+ }
+ else {
+ _mesa_error( ctx, GL_INVALID_ENUM, "glGetTexEnviv(pname)" );
+ return;
+ }
+ }
+ else if (target == GL_POINT_SPRITE_NV) {
+ /* GL_ARB_point_sprite / GL_NV_point_sprite */
+ if (!ctx->Extensions.NV_point_sprite
+ && !ctx->Extensions.ARB_point_sprite) {
+ _mesa_error( ctx, GL_INVALID_ENUM, "glGetTexEnviv(target)" );
+ return;
+ }
+ if (pname == GL_COORD_REPLACE_NV) {
+ *params = (GLint) ctx->Point.CoordReplace[ctx->Texture.CurrentUnit];
+ }
+ else {
+ _mesa_error( ctx, GL_INVALID_ENUM, "glGetTexEnviv(pname)" );
+ return;
+ }
+ }
+ else {
+ _mesa_error( ctx, GL_INVALID_ENUM, "glGetTexEnviv(target)" );
+ return;
+ }
+}
+
+
+/**
+ * Why does ATI_envmap_bumpmap require new entrypoints? Should just
+ * reuse TexEnv ones...
+ */
+void GLAPIENTRY
+_mesa_TexBumpParameterivATI( GLenum pname, const GLint *param )
+{
+ GLfloat p[4];
+ GET_CURRENT_CONTEXT(ctx);
+ ASSERT_OUTSIDE_BEGIN_END(ctx);
+
+ if (!ctx->Extensions.ATI_envmap_bumpmap) {
+ /* This isn't an "official" error case, but let's tell the user
+ * that something's wrong.
+ */
+ _mesa_error(ctx, GL_INVALID_OPERATION, "glTexBumpParameterivATI");
+ return;
+ }
+
+ if (pname == GL_BUMP_ROT_MATRIX_ATI) {
+ /* hope that conversion is correct here */
+ p[0] = INT_TO_FLOAT( param[0] );
+ p[1] = INT_TO_FLOAT( param[1] );
+ p[2] = INT_TO_FLOAT( param[2] );
+ p[3] = INT_TO_FLOAT( param[3] );
+ }
+ else {
+ p[0] = (GLfloat) param[0];
+ p[1] = p[2] = p[3] = 0.0F; /* init to zero, just to be safe */
+ }
+ _mesa_TexBumpParameterfvATI( pname, p );
+}
+
+
+void GLAPIENTRY
+_mesa_TexBumpParameterfvATI( GLenum pname, const GLfloat *param )
+{
+ struct gl_texture_unit *texUnit;
+ GET_CURRENT_CONTEXT(ctx);
+ ASSERT_OUTSIDE_BEGIN_END(ctx);
+
+ if (!ctx->Extensions.ATI_envmap_bumpmap) {
+ _mesa_error(ctx, GL_INVALID_OPERATION, "glTexBumpParameterfvATI");
+ return;
+ }
+
+ texUnit = _mesa_get_current_tex_unit(ctx);
+
+ if (pname == GL_BUMP_ROT_MATRIX_ATI) {
+ if (TEST_EQ_4V(param, texUnit->RotMatrix))
+ return;
+ FLUSH_VERTICES(ctx, _NEW_TEXTURE);
+ COPY_4FV(texUnit->RotMatrix, param);
+ }
+ else {
+ _mesa_error( ctx, GL_INVALID_ENUM, "glTexBumpParameter(pname)" );
+ return;
+ }
+ /* Drivers might want to know about this, instead of dedicated function
+ just shove it into TexEnv where it really belongs anyway */
+ if (ctx->Driver.TexEnv) {
+ (*ctx->Driver.TexEnv)( ctx, 0, pname, param );
+ }
+}
+
+
+void GLAPIENTRY
+_mesa_GetTexBumpParameterivATI( GLenum pname, GLint *param )
+{
+ const struct gl_texture_unit *texUnit;
+ GLuint i;
+ GET_CURRENT_CONTEXT(ctx);
+ ASSERT_OUTSIDE_BEGIN_END(ctx);
+
+ if (!ctx->Extensions.ATI_envmap_bumpmap) {
+ _mesa_error(ctx, GL_INVALID_OPERATION, "glGetTexBumpParameterivATI");
+ return;
+ }
+
+ texUnit = _mesa_get_current_tex_unit(ctx);
+
+ if (pname == GL_BUMP_ROT_MATRIX_SIZE_ATI) {
+ /* spec leaves open to support larger matrices.
+ Don't think anyone would ever want to use it
+ (and apps almost certainly would not understand it and
+ thus fail to submit matrices correctly) so hardcode this. */
+ *param = 4;
+ }
+ else if (pname == GL_BUMP_ROT_MATRIX_ATI) {
+ /* hope that conversion is correct here */
+ param[0] = FLOAT_TO_INT(texUnit->RotMatrix[0]);
+ param[1] = FLOAT_TO_INT(texUnit->RotMatrix[1]);
+ param[2] = FLOAT_TO_INT(texUnit->RotMatrix[2]);
+ param[3] = FLOAT_TO_INT(texUnit->RotMatrix[3]);
+ }
+ else if (pname == GL_BUMP_NUM_TEX_UNITS_ATI) {
+ GLint count = 0;
+ for (i = 0; i < ctx->Const.MaxTextureImageUnits; i++) {
+ if (ctx->Const.SupportedBumpUnits & (1 << i)) {
+ count++;
+ }
+ }
+ *param = count;
+ }
+ else if (pname == GL_BUMP_TEX_UNITS_ATI) {
+ for (i = 0; i < ctx->Const.MaxTextureImageUnits; i++) {
+ if (ctx->Const.SupportedBumpUnits & (1 << i)) {
+ *param++ = i + GL_TEXTURE0;
+ }
+ }
+ }
+ else {
+ _mesa_error( ctx, GL_INVALID_ENUM, "glGetTexBumpParameter(pname)" );
+ return;
+ }
+}
+
+
+void GLAPIENTRY
+_mesa_GetTexBumpParameterfvATI( GLenum pname, GLfloat *param )
+{
+ const struct gl_texture_unit *texUnit;
+ GLuint i;
+ GET_CURRENT_CONTEXT(ctx);
+ ASSERT_OUTSIDE_BEGIN_END(ctx);
+
+ if (!ctx->Extensions.ATI_envmap_bumpmap) {
+ _mesa_error(ctx, GL_INVALID_OPERATION, "glGetTexBumpParameterfvATI");
+ return;
+ }
+
+ texUnit = _mesa_get_current_tex_unit(ctx);
+
+ if (pname == GL_BUMP_ROT_MATRIX_SIZE_ATI) {
+ /* spec leaves open to support larger matrices.
+ Don't think anyone would ever want to use it
+ (and apps might not understand it) so hardcode this. */
+ *param = 4.0F;
+ }
+ else if (pname == GL_BUMP_ROT_MATRIX_ATI) {
+ param[0] = texUnit->RotMatrix[0];
+ param[1] = texUnit->RotMatrix[1];
+ param[2] = texUnit->RotMatrix[2];
+ param[3] = texUnit->RotMatrix[3];
+ }
+ else if (pname == GL_BUMP_NUM_TEX_UNITS_ATI) {
+ GLint count = 0;
+ for (i = 0; i < ctx->Const.MaxTextureImageUnits; i++) {
+ if (ctx->Const.SupportedBumpUnits & (1 << i)) {
+ count++;
+ }
+ }
+ *param = (GLfloat) count;
+ }
+ else if (pname == GL_BUMP_TEX_UNITS_ATI) {
+ for (i = 0; i < ctx->Const.MaxTextureImageUnits; i++) {
+ if (ctx->Const.SupportedBumpUnits & (1 << i)) {
+ *param++ = (GLfloat) (i + GL_TEXTURE0);
+ }
+ }
+ }
+ else {
+ _mesa_error( ctx, GL_INVALID_ENUM, "glGetTexBumpParameter(pname)" );
+ return;
+ }
+}
diff --git a/mesalib/src/mesa/main/texgetimage.h b/mesalib/src/mesa/main/texgetimage.h
index 8612705ca..a017a29c0 100644
--- a/mesalib/src/mesa/main/texgetimage.h
+++ b/mesalib/src/mesa/main/texgetimage.h
@@ -1,65 +1,65 @@
-/*
- * Mesa 3-D graphics library
- * Version: 7.5
- *
- * Copyright (C) 1999-2008 Brian Paul All Rights Reserved.
- * Copyright (c) 2009 VMware, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-
-#ifndef TEXGETIMAGE_H
-#define TEXGETIMAGE_H
-
-#include "glheader.h"
-
-struct gl_context;
-struct gl_texture_image;
-struct gl_texture_object;
-
-extern void
-_mesa_get_teximage(struct gl_context *ctx, GLenum target, GLint level,
- GLenum format, GLenum type, GLvoid *pixels,
- struct gl_texture_object *texObj,
- struct gl_texture_image *texImage);
-
-
-extern void
-_mesa_get_compressed_teximage(struct gl_context *ctx, GLenum target, GLint level,
- GLvoid *img,
- struct gl_texture_object *texObj,
- struct gl_texture_image *texImage);
-
-
-
-extern void GLAPIENTRY
-_mesa_GetTexImage( GLenum target, GLint level,
- GLenum format, GLenum type, GLvoid *pixels );
-extern void GLAPIENTRY
-_mesa_GetnTexImageARB( GLenum target, GLint level, GLenum format,
- GLenum type, GLsizei bufSize, GLvoid *pixels );
-
-extern void GLAPIENTRY
-_mesa_GetCompressedTexImageARB(GLenum target, GLint lod, GLvoid *img);
-
-extern void GLAPIENTRY
-_mesa_GetnCompressedTexImageARB(GLenum target, GLint level, GLsizei bufSize,
- GLvoid *img);
-
-#endif /* TEXGETIMAGE_H */
+/*
+ * Mesa 3-D graphics library
+ * Version: 7.5
+ *
+ * Copyright (C) 1999-2008 Brian Paul All Rights Reserved.
+ * Copyright (c) 2009 VMware, Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+
+#ifndef TEXGETIMAGE_H
+#define TEXGETIMAGE_H
+
+#include "glheader.h"
+
+struct gl_context;
+struct gl_texture_image;
+struct gl_texture_object;
+
+extern void
+_mesa_get_teximage(struct gl_context *ctx, GLenum target, GLint level,
+ GLenum format, GLenum type, GLvoid *pixels,
+ struct gl_texture_object *texObj,
+ struct gl_texture_image *texImage);
+
+
+extern void
+_mesa_get_compressed_teximage(struct gl_context *ctx, GLenum target, GLint level,
+ GLvoid *img,
+ struct gl_texture_object *texObj,
+ struct gl_texture_image *texImage);
+
+
+
+extern void GLAPIENTRY
+_mesa_GetTexImage( GLenum target, GLint level,
+ GLenum format, GLenum type, GLvoid *pixels );
+extern void GLAPIENTRY
+_mesa_GetnTexImageARB( GLenum target, GLint level, GLenum format,
+ GLenum type, GLsizei bufSize, GLvoid *pixels );
+
+extern void GLAPIENTRY
+_mesa_GetCompressedTexImageARB(GLenum target, GLint lod, GLvoid *img);
+
+extern void GLAPIENTRY
+_mesa_GetnCompressedTexImageARB(GLenum target, GLint level, GLsizei bufSize,
+ GLvoid *img);
+
+#endif /* TEXGETIMAGE_H */
diff --git a/mesalib/src/mesa/main/teximage.c b/mesalib/src/mesa/main/teximage.c
index 8fb54c693..3656079b6 100644
--- a/mesalib/src/mesa/main/teximage.c
+++ b/mesalib/src/mesa/main/teximage.c
@@ -1,3849 +1,3849 @@
-/*
- * mesa 3-D graphics library
- * Version: 7.6
- *
- * Copyright (C) 1999-2008 Brian Paul All Rights Reserved.
- * Copyright (C) 2009 VMware, Inc. All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-
-/**
- * \file teximage.c
- * Texture image-related functions.
- */
-
-
-#include "glheader.h"
-#include "bufferobj.h"
-#include "context.h"
-#include "enums.h"
-#include "fbobject.h"
-#include "framebuffer.h"
-#include "hash.h"
-#include "image.h"
-#include "imports.h"
-#include "macros.h"
-#include "mfeatures.h"
-#include "state.h"
-#include "texcompress.h"
-#include "texfetch.h"
-#include "teximage.h"
-#include "texstate.h"
-#include "texpal.h"
-#include "mtypes.h"
-
-
-/**
- * State changes which we care about for glCopyTex[Sub]Image() calls.
- * In particular, we care about pixel transfer state and buffer state
- * (such as glReadBuffer to make sure we read from the right renderbuffer).
- */
-#define NEW_COPY_TEX_STATE (_NEW_BUFFERS | _NEW_PIXEL)
-
-
-
-/**
- * We allocate texture memory on 512-byte boundaries so we can use MMX/SSE
- * elsewhere.
- */
-void *
-_mesa_alloc_texmemory(GLsizei bytes)
-{
- return _mesa_align_malloc(bytes, 512);
-}
-
-
-/**
- * Free texture memory allocated with _mesa_alloc_texmemory()
- */
-void
-_mesa_free_texmemory(void *m)
-{
- _mesa_align_free(m);
-}
-
-
-/*
- * Compute floor(log_base_2(n)).
- * If n < 0 return -1.
- */
-static int
-logbase2( int n )
-{
- GLint i = 1;
- GLint log2 = 0;
-
- if (n < 0)
- return -1;
-
- if (n == 0)
- return 0;
-
- while ( n > i ) {
- i *= 2;
- log2++;
- }
- if (i != n) {
- return log2 - 1;
- }
- else {
- return log2;
- }
-}
-
-
-
-/**
- * Return the simple base format for a given internal texture format.
- * For example, given GL_LUMINANCE12_ALPHA4, return GL_LUMINANCE_ALPHA.
- *
- * \param ctx GL context.
- * \param internalFormat the internal texture format token or 1, 2, 3, or 4.
- *
- * \return the corresponding \u base internal format (GL_ALPHA, GL_LUMINANCE,
- * GL_LUMANCE_ALPHA, GL_INTENSITY, GL_RGB, or GL_RGBA), or -1 if invalid enum.
- *
- * This is the format which is used during texture application (i.e. the
- * texture format and env mode determine the arithmetic used.
- *
- * XXX this could be static
- */
-GLint
-_mesa_base_tex_format( struct gl_context *ctx, GLint internalFormat )
-{
- switch (internalFormat) {
- case GL_ALPHA:
- case GL_ALPHA4:
- case GL_ALPHA8:
- case GL_ALPHA12:
- case GL_ALPHA16:
- return GL_ALPHA;
- case 1:
- case GL_LUMINANCE:
- case GL_LUMINANCE4:
- case GL_LUMINANCE8:
- case GL_LUMINANCE12:
- case GL_LUMINANCE16:
- return GL_LUMINANCE;
- case 2:
- case GL_LUMINANCE_ALPHA:
- case GL_LUMINANCE4_ALPHA4:
- case GL_LUMINANCE6_ALPHA2:
- case GL_LUMINANCE8_ALPHA8:
- case GL_LUMINANCE12_ALPHA4:
- case GL_LUMINANCE12_ALPHA12:
- case GL_LUMINANCE16_ALPHA16:
- return GL_LUMINANCE_ALPHA;
- case GL_INTENSITY:
- case GL_INTENSITY4:
- case GL_INTENSITY8:
- case GL_INTENSITY12:
- case GL_INTENSITY16:
- return GL_INTENSITY;
- case 3:
- case GL_RGB:
- case GL_R3_G3_B2:
- case GL_RGB4:
- case GL_RGB5:
- case GL_RGB8:
- case GL_RGB10:
- case GL_RGB12:
- case GL_RGB16:
- return GL_RGB;
- case 4:
- case GL_RGBA:
- case GL_RGBA2:
- case GL_RGBA4:
- case GL_RGB5_A1:
- case GL_RGBA8:
- case GL_RGB10_A2:
- case GL_RGBA12:
- case GL_RGBA16:
- return GL_RGBA;
- default:
- ; /* fallthrough */
- }
-
- if (ctx->Extensions.EXT_texture_format_BGRA8888) {
- switch (internalFormat) {
- case GL_BGRA_EXT:
- return GL_RGBA;
- default:
- ; /* fallthrough */
- }
- }
-
- if (ctx->Extensions.EXT_paletted_texture) {
- switch (internalFormat) {
- case GL_COLOR_INDEX:
- case GL_COLOR_INDEX1_EXT:
- case GL_COLOR_INDEX2_EXT:
- case GL_COLOR_INDEX4_EXT:
- case GL_COLOR_INDEX8_EXT:
- case GL_COLOR_INDEX12_EXT:
- case GL_COLOR_INDEX16_EXT:
- return GL_COLOR_INDEX;
- default:
- ; /* fallthrough */
- }
- }
-
- if (ctx->Extensions.ARB_depth_texture) {
- switch (internalFormat) {
- case GL_DEPTH_COMPONENT:
- case GL_DEPTH_COMPONENT16:
- case GL_DEPTH_COMPONENT24:
- case GL_DEPTH_COMPONENT32:
- return GL_DEPTH_COMPONENT;
- default:
- ; /* fallthrough */
- }
- }
-
- switch (internalFormat) {
- case GL_COMPRESSED_ALPHA:
- return GL_ALPHA;
- case GL_COMPRESSED_LUMINANCE:
- return GL_LUMINANCE;
- case GL_COMPRESSED_LUMINANCE_ALPHA:
- return GL_LUMINANCE_ALPHA;
- case GL_COMPRESSED_INTENSITY:
- return GL_INTENSITY;
- case GL_COMPRESSED_RGB:
- return GL_RGB;
- case GL_COMPRESSED_RGBA:
- return GL_RGBA;
- default:
- ; /* fallthrough */
- }
-
- if (ctx->Extensions.TDFX_texture_compression_FXT1) {
- switch (internalFormat) {
- case GL_COMPRESSED_RGB_FXT1_3DFX:
- return GL_RGB;
- case GL_COMPRESSED_RGBA_FXT1_3DFX:
- return GL_RGBA;
- default:
- ; /* fallthrough */
- }
- }
-
- if (ctx->Extensions.EXT_texture_compression_s3tc) {
- switch (internalFormat) {
- case GL_COMPRESSED_RGB_S3TC_DXT1_EXT:
- return GL_RGB;
- case GL_COMPRESSED_RGBA_S3TC_DXT1_EXT:
- case GL_COMPRESSED_RGBA_S3TC_DXT3_EXT:
- case GL_COMPRESSED_RGBA_S3TC_DXT5_EXT:
- return GL_RGBA;
- default:
- ; /* fallthrough */
- }
- }
-
- if (ctx->Extensions.S3_s3tc) {
- switch (internalFormat) {
- case GL_RGB_S3TC:
- case GL_RGB4_S3TC:
- return GL_RGB;
- case GL_RGBA_S3TC:
- case GL_RGBA4_S3TC:
- return GL_RGBA;
- default:
- ; /* fallthrough */
- }
- }
-
- if (ctx->Extensions.MESA_ycbcr_texture) {
- if (internalFormat == GL_YCBCR_MESA)
- return GL_YCBCR_MESA;
- }
-
- if (ctx->Extensions.ARB_texture_float) {
- switch (internalFormat) {
- case GL_ALPHA16F_ARB:
- case GL_ALPHA32F_ARB:
- return GL_ALPHA;
- case GL_RGBA16F_ARB:
- case GL_RGBA32F_ARB:
- return GL_RGBA;
- case GL_RGB16F_ARB:
- case GL_RGB32F_ARB:
- return GL_RGB;
- case GL_INTENSITY16F_ARB:
- case GL_INTENSITY32F_ARB:
- return GL_INTENSITY;
- case GL_LUMINANCE16F_ARB:
- case GL_LUMINANCE32F_ARB:
- return GL_LUMINANCE;
- case GL_LUMINANCE_ALPHA16F_ARB:
- case GL_LUMINANCE_ALPHA32F_ARB:
- return GL_LUMINANCE_ALPHA;
- default:
- ; /* fallthrough */
- }
- }
-
- if (ctx->Extensions.ATI_envmap_bumpmap) {
- switch (internalFormat) {
- case GL_DUDV_ATI:
- case GL_DU8DV8_ATI:
- return GL_DUDV_ATI;
- default:
- ; /* fallthrough */
- }
- }
-
- if (ctx->Extensions.EXT_texture_snorm) {
- switch (internalFormat) {
- case GL_RED_SNORM:
- case GL_R8_SNORM:
- case GL_R16_SNORM:
- return GL_RED;
- case GL_RG_SNORM:
- case GL_RG8_SNORM:
- case GL_RG16_SNORM:
- return GL_RG;
- case GL_RGB_SNORM:
- case GL_RGB8_SNORM:
- case GL_RGB16_SNORM:
- return GL_RGB;
- case GL_RGBA_SNORM:
- case GL_RGBA8_SNORM:
- case GL_RGBA16_SNORM:
- return GL_RGBA;
- case GL_ALPHA_SNORM:
- case GL_ALPHA8_SNORM:
- case GL_ALPHA16_SNORM:
- return GL_ALPHA;
- case GL_LUMINANCE_SNORM:
- case GL_LUMINANCE8_SNORM:
- case GL_LUMINANCE16_SNORM:
- return GL_LUMINANCE;
- case GL_LUMINANCE_ALPHA_SNORM:
- case GL_LUMINANCE8_ALPHA8_SNORM:
- case GL_LUMINANCE16_ALPHA16_SNORM:
- return GL_LUMINANCE_ALPHA;
- case GL_INTENSITY_SNORM:
- case GL_INTENSITY8_SNORM:
- case GL_INTENSITY16_SNORM:
- return GL_INTENSITY;
- default:
- ; /* fallthrough */
- }
- }
-
- if (ctx->Extensions.EXT_packed_depth_stencil) {
- switch (internalFormat) {
- case GL_DEPTH_STENCIL_EXT:
- case GL_DEPTH24_STENCIL8_EXT:
- return GL_DEPTH_STENCIL_EXT;
- default:
- ; /* fallthrough */
- }
- }
-
-#if FEATURE_EXT_texture_sRGB
- if (ctx->Extensions.EXT_texture_sRGB) {
- switch (internalFormat) {
- case GL_SRGB_EXT:
- case GL_SRGB8_EXT:
- case GL_COMPRESSED_SRGB_EXT:
- case GL_COMPRESSED_SRGB_S3TC_DXT1_EXT:
- return GL_RGB;
- case GL_SRGB_ALPHA_EXT:
- case GL_SRGB8_ALPHA8_EXT:
- case GL_COMPRESSED_SRGB_ALPHA_EXT:
- case GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT:
- case GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT:
- case GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT:
- return GL_RGBA;
- case GL_SLUMINANCE_ALPHA_EXT:
- case GL_SLUMINANCE8_ALPHA8_EXT:
- case GL_COMPRESSED_SLUMINANCE_ALPHA_EXT:
- return GL_LUMINANCE_ALPHA;
- case GL_SLUMINANCE_EXT:
- case GL_SLUMINANCE8_EXT:
- case GL_COMPRESSED_SLUMINANCE_EXT:
- return GL_LUMINANCE;
- default:
- ; /* fallthrough */
- }
- }
-#endif /* FEATURE_EXT_texture_sRGB */
-
- if (ctx->Extensions.EXT_texture_integer) {
- switch (internalFormat) {
- case GL_RGBA8UI_EXT:
- case GL_RGBA16UI_EXT:
- case GL_RGBA32UI_EXT:
- case GL_RGBA8I_EXT:
- case GL_RGBA16I_EXT:
- case GL_RGBA32I_EXT:
- return GL_RGBA;
- case GL_RGB8UI_EXT:
- case GL_RGB16UI_EXT:
- case GL_RGB32UI_EXT:
- case GL_RGB8I_EXT:
- case GL_RGB16I_EXT:
- case GL_RGB32I_EXT:
- return GL_RGB;
- case GL_ALPHA8UI_EXT:
- case GL_ALPHA16UI_EXT:
- case GL_ALPHA32UI_EXT:
- case GL_ALPHA8I_EXT:
- case GL_ALPHA16I_EXT:
- case GL_ALPHA32I_EXT:
- return GL_ALPHA;
- case GL_INTENSITY8UI_EXT:
- case GL_INTENSITY16UI_EXT:
- case GL_INTENSITY32UI_EXT:
- case GL_INTENSITY8I_EXT:
- case GL_INTENSITY16I_EXT:
- case GL_INTENSITY32I_EXT:
- return GL_INTENSITY;
- case GL_LUMINANCE8UI_EXT:
- case GL_LUMINANCE16UI_EXT:
- case GL_LUMINANCE32UI_EXT:
- case GL_LUMINANCE8I_EXT:
- case GL_LUMINANCE16I_EXT:
- case GL_LUMINANCE32I_EXT:
- return GL_LUMINANCE;
- case GL_LUMINANCE_ALPHA8UI_EXT:
- case GL_LUMINANCE_ALPHA16UI_EXT:
- case GL_LUMINANCE_ALPHA32UI_EXT:
- case GL_LUMINANCE_ALPHA8I_EXT:
- case GL_LUMINANCE_ALPHA16I_EXT:
- case GL_LUMINANCE_ALPHA32I_EXT:
- return GL_LUMINANCE_ALPHA;
- default:
- ; /* fallthrough */
- }
- }
-
- if (ctx->Extensions.ARB_texture_rg) {
- switch (internalFormat) {
- case GL_R16F:
- /* R16F depends on both ARB_half_float_pixel and ARB_texture_float.
- */
- if (!ctx->Extensions.ARB_half_float_pixel)
- break;
- /* FALLTHROUGH */
- case GL_R32F:
- if (!ctx->Extensions.ARB_texture_float)
- break;
- return GL_RED;
- case GL_R8I:
- case GL_R8UI:
- case GL_R16I:
- case GL_R16UI:
- case GL_R32I:
- case GL_R32UI:
- if (!ctx->Extensions.EXT_texture_integer)
- break;
- /* FALLTHROUGH */
- case GL_R8:
- case GL_R16:
- case GL_RED:
- case GL_COMPRESSED_RED:
- return GL_RED;
-
- case GL_RG16F:
- /* RG16F depends on both ARB_half_float_pixel and ARB_texture_float.
- */
- if (!ctx->Extensions.ARB_half_float_pixel)
- break;
- /* FALLTHROUGH */
- case GL_RG32F:
- if (!ctx->Extensions.ARB_texture_float)
- break;
- return GL_RG;
- case GL_RG8I:
- case GL_RG8UI:
- case GL_RG16I:
- case GL_RG16UI:
- case GL_RG32I:
- case GL_RG32UI:
- if (!ctx->Extensions.EXT_texture_integer)
- break;
- /* FALLTHROUGH */
- case GL_RG:
- case GL_RG8:
- case GL_RG16:
- case GL_COMPRESSED_RG:
- return GL_RG;
- default:
- ; /* fallthrough */
- }
- }
-
- if (ctx->Extensions.EXT_texture_shared_exponent) {
- switch (internalFormat) {
- case GL_RGB9_E5_EXT:
- return GL_RGB;
- default:
- ; /* fallthrough */
- }
- }
-
- if (ctx->Extensions.EXT_packed_float) {
- switch (internalFormat) {
- case GL_R11F_G11F_B10F_EXT:
- return GL_RGB;
- default:
- ; /* fallthrough */
- }
- }
-
- if (ctx->Extensions.ARB_depth_buffer_float) {
- switch (internalFormat) {
- case GL_DEPTH_COMPONENT32F:
- return GL_DEPTH_COMPONENT;
- case GL_DEPTH32F_STENCIL8:
- return GL_DEPTH_STENCIL;
- default:
- ; /* fallthrough */
- }
- }
-
- if (ctx->Extensions.ARB_texture_compression_rgtc) {
- switch (internalFormat) {
- case GL_COMPRESSED_RED_RGTC1:
- case GL_COMPRESSED_SIGNED_RED_RGTC1:
- return GL_RED;
- case GL_COMPRESSED_RG_RGTC2:
- case GL_COMPRESSED_SIGNED_RG_RGTC2:
- return GL_RG;
- default:
- ; /* fallthrough */
- }
- }
-
- if (ctx->Extensions.EXT_texture_compression_latc) {
- switch (internalFormat) {
- case GL_COMPRESSED_LUMINANCE_LATC1_EXT:
- case GL_COMPRESSED_SIGNED_LUMINANCE_LATC1_EXT:
- return GL_LUMINANCE;
- case GL_COMPRESSED_LUMINANCE_ALPHA_LATC2_EXT:
- case GL_COMPRESSED_SIGNED_LUMINANCE_ALPHA_LATC2_EXT:
- return GL_LUMINANCE_ALPHA;
- default:
- ; /* fallthrough */
- }
- }
-
- if (ctx->Extensions.ATI_texture_compression_3dc) {
- switch (internalFormat) {
- case GL_COMPRESSED_LUMINANCE_ALPHA_3DC_ATI:
- return GL_LUMINANCE_ALPHA;
- default:
- ; /* fallthrough */
- }
- }
-
- return -1; /* error */
-}
-
-
-/**
- * For cube map faces, return a face index in [0,5].
- * For other targets return 0;
- */
-GLuint
-_mesa_tex_target_to_face(GLenum target)
-{
- if (target >= GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB &&
- target <= GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB)
- return (GLuint) target - (GLuint) GL_TEXTURE_CUBE_MAP_POSITIVE_X;
- else
- return 0;
-}
-
-
-
-/**
- * Store a gl_texture_image pointer in a gl_texture_object structure
- * according to the target and level parameters.
- *
- * \param tObj texture object.
- * \param target texture target.
- * \param level image level.
- * \param texImage texture image.
- *
- * This was basically prompted by the introduction of cube maps.
- */
-void
-_mesa_set_tex_image(struct gl_texture_object *tObj,
- GLenum target, GLint level,
- struct gl_texture_image *texImage)
-{
- const GLuint face = _mesa_tex_target_to_face(target);
-
- ASSERT(tObj);
- ASSERT(texImage);
- ASSERT(target != GL_TEXTURE_RECTANGLE_NV || level == 0);
-
- tObj->Image[face][level] = texImage;
-
- /* Set the 'back' pointer */
- texImage->TexObject = tObj;
-}
-
-
-/**
- * Allocate a texture image structure.
- *
- * Called via ctx->Driver.NewTextureImage() unless overriden by a device
- * driver.
- *
- * \return a pointer to gl_texture_image struct with all fields initialized to
- * zero.
- */
-struct gl_texture_image *
-_mesa_new_texture_image( struct gl_context *ctx )
-{
- (void) ctx;
- return CALLOC_STRUCT(gl_texture_image);
-}
-
-
-/**
- * Free texture image data.
- * This function is a fallback called via ctx->Driver.FreeTexImageData().
- *
- * \param texImage texture image.
- *
- * Free the texture image data if it's not marked as client data.
- */
-void
-_mesa_free_texture_image_data(struct gl_context *ctx,
- struct gl_texture_image *texImage)
-{
- (void) ctx;
-
- if (texImage->Data && !texImage->IsClientData) {
- /* free the old texture data */
- _mesa_free_texmemory(texImage->Data);
- }
-
- texImage->Data = NULL;
-}
-
-
-/**
- * Free texture image.
- *
- * \param texImage texture image.
- *
- * Free the texture image structure and the associated image data.
- */
-void
-_mesa_delete_texture_image(struct gl_context *ctx,
- struct gl_texture_image *texImage)
-{
- /* Free texImage->Data and/or any other driver-specific texture
- * image storage.
- */
- ASSERT(ctx->Driver.FreeTexImageData);
- ctx->Driver.FreeTexImageData( ctx, texImage );
-
- ASSERT(texImage->Data == NULL);
- if (texImage->ImageOffsets)
- free(texImage->ImageOffsets);
- free(texImage);
-}
-
-
-/**
- * Test if a target is a proxy target.
- *
- * \param target texture target.
- *
- * \return GL_TRUE if the target is a proxy target, GL_FALSE otherwise.
- */
-GLboolean
-_mesa_is_proxy_texture(GLenum target)
-{
- /* NUM_TEXTURE_TARGETS should match number of terms below,
- * except there's no proxy for GL_TEXTURE_BUFFER.
- */
- assert(NUM_TEXTURE_TARGETS == 8);
-
- return (target == GL_PROXY_TEXTURE_1D ||
- target == GL_PROXY_TEXTURE_2D ||
- target == GL_PROXY_TEXTURE_3D ||
- target == GL_PROXY_TEXTURE_CUBE_MAP_ARB ||
- target == GL_PROXY_TEXTURE_RECTANGLE_NV ||
- target == GL_PROXY_TEXTURE_1D_ARRAY_EXT ||
- target == GL_PROXY_TEXTURE_2D_ARRAY_EXT);
-}
-
-
-/**
- * Return the proxy target which corresponds to the given texture target
- */
-static GLenum
-get_proxy_target(GLenum target)
-{
- switch (target) {
- case GL_TEXTURE_1D:
- case GL_PROXY_TEXTURE_1D:
- return GL_PROXY_TEXTURE_1D;
- case GL_TEXTURE_2D:
- case GL_PROXY_TEXTURE_2D:
- return GL_PROXY_TEXTURE_2D;
- case GL_TEXTURE_3D:
- case GL_PROXY_TEXTURE_3D:
- return GL_PROXY_TEXTURE_3D;
- case GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB:
- case GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB:
- case GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB:
- case GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB:
- case GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB:
- case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB:
- case GL_TEXTURE_CUBE_MAP_ARB:
- case GL_PROXY_TEXTURE_CUBE_MAP_ARB:
- return GL_PROXY_TEXTURE_CUBE_MAP_ARB;
- case GL_TEXTURE_RECTANGLE_NV:
- case GL_PROXY_TEXTURE_RECTANGLE_NV:
- return GL_PROXY_TEXTURE_RECTANGLE_NV;
- case GL_TEXTURE_1D_ARRAY_EXT:
- case GL_PROXY_TEXTURE_1D_ARRAY_EXT:
- return GL_PROXY_TEXTURE_1D_ARRAY_EXT;
- case GL_TEXTURE_2D_ARRAY_EXT:
- case GL_PROXY_TEXTURE_2D_ARRAY_EXT:
- return GL_PROXY_TEXTURE_2D_ARRAY_EXT;
- default:
- _mesa_problem(NULL, "unexpected target in get_proxy_target()");
- return 0;
- }
-}
-
-
-/**
- * Get the texture object that corresponds to the target of the given
- * texture unit.
- *
- * \param ctx GL context.
- * \param texUnit texture unit.
- * \param target texture target.
- *
- * \return pointer to the texture object on success, or NULL on failure.
- *
- * \sa gl_texture_unit.
- */
-struct gl_texture_object *
-_mesa_select_tex_object(struct gl_context *ctx,
- const struct gl_texture_unit *texUnit,
- GLenum target)
-{
- const GLboolean arrayTex = (ctx->Extensions.MESA_texture_array ||
- ctx->Extensions.EXT_texture_array);
-
- switch (target) {
- case GL_TEXTURE_1D:
- return texUnit->CurrentTex[TEXTURE_1D_INDEX];
- case GL_PROXY_TEXTURE_1D:
- return ctx->Texture.ProxyTex[TEXTURE_1D_INDEX];
- case GL_TEXTURE_2D:
- return texUnit->CurrentTex[TEXTURE_2D_INDEX];
- case GL_PROXY_TEXTURE_2D:
- return ctx->Texture.ProxyTex[TEXTURE_2D_INDEX];
- case GL_TEXTURE_3D:
- return texUnit->CurrentTex[TEXTURE_3D_INDEX];
- case GL_PROXY_TEXTURE_3D:
- return ctx->Texture.ProxyTex[TEXTURE_3D_INDEX];
- case GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB:
- case GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB:
- case GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB:
- case GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB:
- case GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB:
- case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB:
- case GL_TEXTURE_CUBE_MAP_ARB:
- return ctx->Extensions.ARB_texture_cube_map
- ? texUnit->CurrentTex[TEXTURE_CUBE_INDEX] : NULL;
- case GL_PROXY_TEXTURE_CUBE_MAP_ARB:
- return ctx->Extensions.ARB_texture_cube_map
- ? ctx->Texture.ProxyTex[TEXTURE_CUBE_INDEX] : NULL;
- case GL_TEXTURE_RECTANGLE_NV:
- return ctx->Extensions.NV_texture_rectangle
- ? texUnit->CurrentTex[TEXTURE_RECT_INDEX] : NULL;
- case GL_PROXY_TEXTURE_RECTANGLE_NV:
- return ctx->Extensions.NV_texture_rectangle
- ? ctx->Texture.ProxyTex[TEXTURE_RECT_INDEX] : NULL;
- case GL_TEXTURE_1D_ARRAY_EXT:
- return arrayTex ? texUnit->CurrentTex[TEXTURE_1D_ARRAY_INDEX] : NULL;
- case GL_PROXY_TEXTURE_1D_ARRAY_EXT:
- return arrayTex ? ctx->Texture.ProxyTex[TEXTURE_1D_ARRAY_INDEX] : NULL;
- case GL_TEXTURE_2D_ARRAY_EXT:
- return arrayTex ? texUnit->CurrentTex[TEXTURE_2D_ARRAY_INDEX] : NULL;
- case GL_PROXY_TEXTURE_2D_ARRAY_EXT:
- return arrayTex ? ctx->Texture.ProxyTex[TEXTURE_2D_ARRAY_INDEX] : NULL;
- case GL_TEXTURE_BUFFER:
- return ctx->Extensions.ARB_texture_buffer_object
- ? texUnit->CurrentTex[TEXTURE_BUFFER_INDEX] : NULL;
- default:
- _mesa_problem(NULL, "bad target in _mesa_select_tex_object()");
- return NULL;
- }
-}
-
-
-/**
- * Return pointer to texture object for given target on current texture unit.
- */
-struct gl_texture_object *
-_mesa_get_current_tex_object(struct gl_context *ctx, GLenum target)
-{
- struct gl_texture_unit *texUnit = _mesa_get_current_tex_unit(ctx);
- return _mesa_select_tex_object(ctx, texUnit, target);
-}
-
-
-/**
- * Get a texture image pointer from a texture object, given a texture
- * target and mipmap level. The target and level parameters should
- * have already been error-checked.
- *
- * \param ctx GL context.
- * \param texObj texture unit.
- * \param target texture target.
- * \param level image level.
- *
- * \return pointer to the texture image structure, or NULL on failure.
- */
-struct gl_texture_image *
-_mesa_select_tex_image(struct gl_context *ctx,
- const struct gl_texture_object *texObj,
- GLenum target, GLint level)
-{
- const GLuint face = _mesa_tex_target_to_face(target);
-
- ASSERT(texObj);
- ASSERT(level >= 0);
- ASSERT(level < MAX_TEXTURE_LEVELS);
-
- return texObj->Image[face][level];
-}
-
-
-/**
- * Like _mesa_select_tex_image() but if the image doesn't exist, allocate
- * it and install it. Only return NULL if passed a bad parameter or run
- * out of memory.
- */
-struct gl_texture_image *
-_mesa_get_tex_image(struct gl_context *ctx, struct gl_texture_object *texObj,
- GLenum target, GLint level)
-{
- struct gl_texture_image *texImage;
-
- if (!texObj)
- return NULL;
-
- texImage = _mesa_select_tex_image(ctx, texObj, target, level);
- if (!texImage) {
- texImage = ctx->Driver.NewTextureImage(ctx);
- if (!texImage) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "texture image allocation");
- return NULL;
- }
-
- _mesa_set_tex_image(texObj, target, level, texImage);
- }
-
- return texImage;
-}
-
-
-/**
- * Return pointer to the specified proxy texture image.
- * Note that proxy textures are per-context, not per-texture unit.
- * \return pointer to texture image or NULL if invalid target, invalid
- * level, or out of memory.
- */
-struct gl_texture_image *
-_mesa_get_proxy_tex_image(struct gl_context *ctx, GLenum target, GLint level)
-{
- struct gl_texture_image *texImage;
- GLuint texIndex;
-
- if (level < 0 )
- return NULL;
-
- switch (target) {
- case GL_PROXY_TEXTURE_1D:
- if (level >= ctx->Const.MaxTextureLevels)
- return NULL;
- texIndex = TEXTURE_1D_INDEX;
- break;
- case GL_PROXY_TEXTURE_2D:
- if (level >= ctx->Const.MaxTextureLevels)
- return NULL;
- texIndex = TEXTURE_2D_INDEX;
- break;
- case GL_PROXY_TEXTURE_3D:
- if (level >= ctx->Const.Max3DTextureLevels)
- return NULL;
- texIndex = TEXTURE_3D_INDEX;
- break;
- case GL_PROXY_TEXTURE_CUBE_MAP:
- if (level >= ctx->Const.MaxCubeTextureLevels)
- return NULL;
- texIndex = TEXTURE_CUBE_INDEX;
- break;
- case GL_PROXY_TEXTURE_RECTANGLE_NV:
- if (level > 0)
- return NULL;
- texIndex = TEXTURE_RECT_INDEX;
- break;
- case GL_PROXY_TEXTURE_1D_ARRAY_EXT:
- if (level >= ctx->Const.MaxTextureLevels)
- return NULL;
- texIndex = TEXTURE_1D_ARRAY_INDEX;
- break;
- case GL_PROXY_TEXTURE_2D_ARRAY_EXT:
- if (level >= ctx->Const.MaxTextureLevels)
- return NULL;
- texIndex = TEXTURE_2D_ARRAY_INDEX;
- break;
- default:
- return NULL;
- }
-
- texImage = ctx->Texture.ProxyTex[texIndex]->Image[0][level];
- if (!texImage) {
- texImage = ctx->Driver.NewTextureImage(ctx);
- if (!texImage) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "proxy texture allocation");
- return NULL;
- }
- ctx->Texture.ProxyTex[texIndex]->Image[0][level] = texImage;
- /* Set the 'back' pointer */
- texImage->TexObject = ctx->Texture.ProxyTex[texIndex];
- }
- return texImage;
-}
-
-
-/**
- * Get the maximum number of allowed mipmap levels.
- *
- * \param ctx GL context.
- * \param target texture target.
- *
- * \return the maximum number of allowed mipmap levels for the given
- * texture target, or zero if passed a bad target.
- *
- * \sa gl_constants.
- */
-GLint
-_mesa_max_texture_levels(struct gl_context *ctx, GLenum target)
-{
- switch (target) {
- case GL_TEXTURE_1D:
- case GL_PROXY_TEXTURE_1D:
- case GL_TEXTURE_2D:
- case GL_PROXY_TEXTURE_2D:
- return ctx->Const.MaxTextureLevels;
- case GL_TEXTURE_3D:
- case GL_PROXY_TEXTURE_3D:
- return ctx->Const.Max3DTextureLevels;
- case GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB:
- case GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB:
- case GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB:
- case GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB:
- case GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB:
- case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB:
- case GL_TEXTURE_CUBE_MAP_ARB:
- case GL_PROXY_TEXTURE_CUBE_MAP_ARB:
- return ctx->Extensions.ARB_texture_cube_map
- ? ctx->Const.MaxCubeTextureLevels : 0;
- case GL_TEXTURE_RECTANGLE_NV:
- case GL_PROXY_TEXTURE_RECTANGLE_NV:
- return ctx->Extensions.NV_texture_rectangle ? 1 : 0;
- case GL_TEXTURE_1D_ARRAY_EXT:
- case GL_PROXY_TEXTURE_1D_ARRAY_EXT:
- case GL_TEXTURE_2D_ARRAY_EXT:
- case GL_PROXY_TEXTURE_2D_ARRAY_EXT:
- return (ctx->Extensions.MESA_texture_array ||
- ctx->Extensions.EXT_texture_array)
- ? ctx->Const.MaxTextureLevels : 0;
- case GL_TEXTURE_BUFFER:
- /* fall-through */
- default:
- return 0; /* bad target */
- }
-}
-
-
-/**
- * Return number of dimensions per mipmap level for the given texture target.
- */
-GLint
-_mesa_get_texture_dimensions(GLenum target)
-{
- switch (target) {
- case GL_TEXTURE_1D:
- case GL_PROXY_TEXTURE_1D:
- return 1;
- case GL_TEXTURE_2D:
- case GL_TEXTURE_RECTANGLE:
- case GL_TEXTURE_CUBE_MAP:
- case GL_PROXY_TEXTURE_2D:
- case GL_PROXY_TEXTURE_RECTANGLE:
- case GL_PROXY_TEXTURE_CUBE_MAP:
- case GL_TEXTURE_CUBE_MAP_POSITIVE_X:
- case GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
- case GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
- case GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
- case GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
- case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
- case GL_TEXTURE_1D_ARRAY:
- case GL_PROXY_TEXTURE_1D_ARRAY:
- return 2;
- case GL_TEXTURE_3D:
- case GL_PROXY_TEXTURE_3D:
- case GL_TEXTURE_2D_ARRAY:
- case GL_PROXY_TEXTURE_2D_ARRAY:
- return 3;
- case GL_TEXTURE_BUFFER:
- /* fall-through */
- default:
- _mesa_problem(NULL, "invalid target 0x%x in get_texture_dimensions()",
- target);
- return 2;
- }
-}
-
-
-
-
-#if 000 /* not used anymore */
-/*
- * glTexImage[123]D can accept a NULL image pointer. In this case we
- * create a texture image with unspecified image contents per the OpenGL
- * spec.
- */
-static GLubyte *
-make_null_texture(GLint width, GLint height, GLint depth, GLenum format)
-{
- const GLint components = _mesa_components_in_format(format);
- const GLint numPixels = width * height * depth;
- GLubyte *data = (GLubyte *) MALLOC(numPixels * components * sizeof(GLubyte));
-
-#ifdef DEBUG
- /*
- * Let's see if anyone finds this. If glTexImage2D() is called with
- * a NULL image pointer then load the texture image with something
- * interesting instead of leaving it indeterminate.
- */
- if (data) {
- static const char message[8][32] = {
- " X X XXXXX XXX X ",
- " XX XX X X X X X ",
- " X X X X X X X ",
- " X X XXXX XXX XXXXX ",
- " X X X X X X ",
- " X X X X X X X ",
- " X X XXXXX XXX X X ",
- " "
- };
-
- GLubyte *imgPtr = data;
- GLint h, i, j, k;
- for (h = 0; h < depth; h++) {
- for (i = 0; i < height; i++) {
- GLint srcRow = 7 - (i % 8);
- for (j = 0; j < width; j++) {
- GLint srcCol = j % 32;
- GLubyte texel = (message[srcRow][srcCol]=='X') ? 255 : 70;
- for (k = 0; k < components; k++) {
- *imgPtr++ = texel;
- }
- }
- }
- }
- }
-#endif
-
- return data;
-}
-#endif
-
-
-
-/**
- * Reset the fields of a gl_texture_image struct to zero.
- *
- * \param img texture image structure.
- *
- * This is called when a proxy texture test fails, we set all the
- * image members (except DriverData) to zero.
- * It's also used in glTexImage[123]D as a safeguard to be sure all
- * required fields get initialized properly by the Driver.TexImage[123]D
- * functions.
- */
-static void
-clear_teximage_fields(struct gl_texture_image *img)
-{
- ASSERT(img);
- img->_BaseFormat = 0;
- img->InternalFormat = 0;
- img->Border = 0;
- img->Width = 0;
- img->Height = 0;
- img->Depth = 0;
- img->RowStride = 0;
- if (img->ImageOffsets) {
- free(img->ImageOffsets);
- img->ImageOffsets = NULL;
- }
- img->Width2 = 0;
- img->Height2 = 0;
- img->Depth2 = 0;
- img->WidthLog2 = 0;
- img->HeightLog2 = 0;
- img->DepthLog2 = 0;
- img->Data = NULL;
- img->TexFormat = MESA_FORMAT_NONE;
- img->FetchTexelc = NULL;
- img->FetchTexelf = NULL;
-}
-
-
-/**
- * Initialize basic fields of the gl_texture_image struct.
- *
- * \param ctx GL context.
- * \param target texture target (GL_TEXTURE_1D, GL_TEXTURE_RECTANGLE, etc).
- * \param img texture image structure to be initialized.
- * \param width image width.
- * \param height image height.
- * \param depth image depth.
- * \param border image border.
- * \param internalFormat internal format.
- * \param format the actual hardware format (one of MESA_FORMAT_*)
- *
- * Fills in the fields of \p img with the given information.
- * Note: width, height and depth include the border.
- */
-void
-_mesa_init_teximage_fields(struct gl_context *ctx, GLenum target,
- struct gl_texture_image *img,
- GLsizei width, GLsizei height, GLsizei depth,
- GLint border, GLenum internalFormat,
- gl_format format)
-{
- GLint i, dims;
-
- ASSERT(img);
- ASSERT(width >= 0);
- ASSERT(height >= 0);
- ASSERT(depth >= 0);
-
- img->_BaseFormat = _mesa_base_tex_format( ctx, internalFormat );
- ASSERT(img->_BaseFormat > 0);
- img->InternalFormat = internalFormat;
- img->Border = border;
- img->Width = width;
- img->Height = height;
- img->Depth = depth;
-
- img->Width2 = width - 2 * border; /* == 1 << img->WidthLog2; */
- img->WidthLog2 = logbase2(img->Width2);
-
- if (height == 1) { /* 1-D texture */
- img->Height2 = 1;
- img->HeightLog2 = 0;
- }
- else {
- img->Height2 = height - 2 * border; /* == 1 << img->HeightLog2; */
- img->HeightLog2 = logbase2(img->Height2);
- }
-
- if (depth == 1) { /* 2-D texture */
- img->Depth2 = 1;
- img->DepthLog2 = 0;
- }
- else {
- img->Depth2 = depth - 2 * border; /* == 1 << img->DepthLog2; */
- img->DepthLog2 = logbase2(img->Depth2);
- }
-
- img->MaxLog2 = MAX2(img->WidthLog2, img->HeightLog2);
-
- if ((width == 1 || _mesa_is_pow_two(img->Width2)) &&
- (height == 1 || _mesa_is_pow_two(img->Height2)) &&
- (depth == 1 || _mesa_is_pow_two(img->Depth2)))
- img->_IsPowerOfTwo = GL_TRUE;
- else
- img->_IsPowerOfTwo = GL_FALSE;
-
- /* RowStride and ImageOffsets[] describe how to address texels in 'Data' */
- img->RowStride = width;
- /* Allocate the ImageOffsets array and initialize to typical values.
- * We allocate the array for 1D/2D textures too in order to avoid special-
- * case code in the texstore routines.
- */
- if (img->ImageOffsets)
- free(img->ImageOffsets);
- img->ImageOffsets = (GLuint *) malloc(depth * sizeof(GLuint));
- for (i = 0; i < depth; i++) {
- img->ImageOffsets[i] = i * width * height;
- }
-
- /* Compute Width/Height/DepthScale for mipmap lod computation */
- if (target == GL_TEXTURE_RECTANGLE_NV) {
- /* scale = 1.0 since texture coords directly map to texels */
- img->WidthScale = 1.0;
- img->HeightScale = 1.0;
- img->DepthScale = 1.0;
- }
- else {
- img->WidthScale = (GLfloat) img->Width;
- img->HeightScale = (GLfloat) img->Height;
- img->DepthScale = (GLfloat) img->Depth;
- }
-
- img->TexFormat = format;
-
- dims = _mesa_get_texture_dimensions(target);
-
- _mesa_set_fetch_functions(img, dims);
-}
-
-
-/**
- * Free and clear fields of the gl_texture_image struct.
- *
- * \param ctx GL context.
- * \param texImage texture image structure to be cleared.
- *
- * After the call, \p texImage will have no data associated with it. Its
- * fields are cleared so that its parent object will test incomplete.
- */
-void
-_mesa_clear_texture_image(struct gl_context *ctx,
- struct gl_texture_image *texImage)
-{
- ctx->Driver.FreeTexImageData(ctx, texImage);
- clear_teximage_fields(texImage);
-}
-
-
-/**
- * This is the fallback for Driver.TestProxyTexImage(). Test the texture
- * level, width, height and depth against the ctx->Const limits for textures.
- *
- * A hardware driver might override this function if, for example, the
- * max 3D texture size is 512x512x64 (i.e. not a cube).
- *
- * Note that width, height, depth == 0 is not an error. However, a
- * texture with zero width/height/depth will be considered "incomplete"
- * and texturing will effectively be disabled.
- *
- * \param target one of GL_PROXY_TEXTURE_1D, GL_PROXY_TEXTURE_2D,
- * GL_PROXY_TEXTURE_3D, GL_PROXY_TEXTURE_RECTANGLE_NV,
- * GL_PROXY_TEXTURE_CUBE_MAP_ARB.
- * \param level as passed to glTexImage
- * \param internalFormat as passed to glTexImage
- * \param format as passed to glTexImage
- * \param type as passed to glTexImage
- * \param width as passed to glTexImage
- * \param height as passed to glTexImage
- * \param depth as passed to glTexImage
- * \param border as passed to glTexImage
- * \return GL_TRUE if the image is acceptable, GL_FALSE if not acceptable.
- */
-GLboolean
-_mesa_test_proxy_teximage(struct gl_context *ctx, GLenum target, GLint level,
- GLint internalFormat, GLenum format, GLenum type,
- GLint width, GLint height, GLint depth, GLint border)
-{
- GLint maxSize;
-
- (void) internalFormat;
- (void) format;
- (void) type;
-
- switch (target) {
- case GL_PROXY_TEXTURE_1D:
- maxSize = 1 << (ctx->Const.MaxTextureLevels - 1);
- if (width < 2 * border || width > 2 + maxSize)
- return GL_FALSE;
- if (level >= ctx->Const.MaxTextureLevels)
- return GL_FALSE;
- if (!ctx->Extensions.ARB_texture_non_power_of_two) {
- if (width > 0 && !_mesa_is_pow_two(width - 2 * border))
- return GL_FALSE;
- }
- return GL_TRUE;
-
- case GL_PROXY_TEXTURE_2D:
- maxSize = 1 << (ctx->Const.MaxTextureLevels - 1);
- if (width < 2 * border || width > 2 + maxSize)
- return GL_FALSE;
- if (height < 2 * border || height > 2 + maxSize)
- return GL_FALSE;
- if (level >= ctx->Const.MaxTextureLevels)
- return GL_FALSE;
- if (!ctx->Extensions.ARB_texture_non_power_of_two) {
- if (width > 0 && !_mesa_is_pow_two(width - 2 * border))
- return GL_FALSE;
- if (height > 0 && !_mesa_is_pow_two(height - 2 * border))
- return GL_FALSE;
- }
- return GL_TRUE;
-
- case GL_PROXY_TEXTURE_3D:
- maxSize = 1 << (ctx->Const.Max3DTextureLevels - 1);
- if (width < 2 * border || width > 2 + maxSize)
- return GL_FALSE;
- if (height < 2 * border || height > 2 + maxSize)
- return GL_FALSE;
- if (depth < 2 * border || depth > 2 + maxSize)
- return GL_FALSE;
- if (level >= ctx->Const.Max3DTextureLevels)
- return GL_FALSE;
- if (!ctx->Extensions.ARB_texture_non_power_of_two) {
- if (width > 0 && !_mesa_is_pow_two(width - 2 * border))
- return GL_FALSE;
- if (height > 0 && !_mesa_is_pow_two(height - 2 * border))
- return GL_FALSE;
- if (depth > 0 && !_mesa_is_pow_two(depth - 2 * border))
- return GL_FALSE;
- }
- return GL_TRUE;
-
- case GL_PROXY_TEXTURE_RECTANGLE_NV:
- maxSize = ctx->Const.MaxTextureRectSize;
- if (width < 0 || width > maxSize)
- return GL_FALSE;
- if (height < 0 || height > maxSize)
- return GL_FALSE;
- if (level != 0)
- return GL_FALSE;
- return GL_TRUE;
-
- case GL_PROXY_TEXTURE_CUBE_MAP_ARB:
- maxSize = 1 << (ctx->Const.MaxCubeTextureLevels - 1);
- if (width < 2 * border || width > 2 + maxSize)
- return GL_FALSE;
- if (height < 2 * border || height > 2 + maxSize)
- return GL_FALSE;
- if (level >= ctx->Const.MaxCubeTextureLevels)
- return GL_FALSE;
- if (!ctx->Extensions.ARB_texture_non_power_of_two) {
- if (width > 0 && !_mesa_is_pow_two(width - 2 * border))
- return GL_FALSE;
- if (height > 0 && !_mesa_is_pow_two(height - 2 * border))
- return GL_FALSE;
- }
- return GL_TRUE;
-
- case GL_PROXY_TEXTURE_1D_ARRAY_EXT:
- maxSize = 1 << (ctx->Const.MaxTextureLevels - 1);
- if (width < 2 * border || width > 2 + maxSize)
- return GL_FALSE;
- if (height < 1 || height > ctx->Const.MaxArrayTextureLayers)
- return GL_FALSE;
- if (level >= ctx->Const.MaxTextureLevels)
- return GL_FALSE;
- if (!ctx->Extensions.ARB_texture_non_power_of_two) {
- if (width > 0 && !_mesa_is_pow_two(width - 2 * border))
- return GL_FALSE;
- }
- return GL_TRUE;
-
- case GL_PROXY_TEXTURE_2D_ARRAY_EXT:
- maxSize = 1 << (ctx->Const.MaxTextureLevels - 1);
- if (width < 2 * border || width > 2 + maxSize)
- return GL_FALSE;
- if (height < 2 * border || height > 2 + maxSize)
- return GL_FALSE;
- if (depth < 1 || depth > ctx->Const.MaxArrayTextureLayers)
- return GL_FALSE;
- if (level >= ctx->Const.MaxTextureLevels)
- return GL_FALSE;
- if (!ctx->Extensions.ARB_texture_non_power_of_two) {
- if (width > 0 && !_mesa_is_pow_two(width - 2 * border))
- return GL_FALSE;
- if (height > 0 && !_mesa_is_pow_two(height - 2 * border))
- return GL_FALSE;
- }
- return GL_TRUE;
-
- default:
- _mesa_problem(ctx, "Invalid target in _mesa_test_proxy_teximage");
- return GL_FALSE;
- }
-}
-
-
-/**
- * Check if the memory used by the texture would exceed the driver's limit.
- * This lets us support a max 3D texture size of 8K (for example) but
- * prevents allocating a full 8K x 8K x 8K texture.
- * XXX this could be rolled into the proxy texture size test (above) but
- * we don't have the actual texture internal format at that point.
- */
-static GLboolean
-legal_texture_size(struct gl_context *ctx, gl_format format,
- GLint width, GLint height, GLint depth)
-{
- uint64_t bytes = _mesa_format_image_size64(format, width, height, depth);
- uint64_t mbytes = bytes / (1024 * 1024); /* convert to MB */
- return mbytes <= (uint64_t) ctx->Const.MaxTextureMbytes;
-}
-
-
-
-/**
- * Helper function to determine whether a target and specific compression
- * format are supported.
- */
-static GLboolean
-target_can_be_compressed(const struct gl_context *ctx, GLenum target,
- GLenum intFormat)
-{
- (void) intFormat; /* not used yet */
-
- switch (target) {
- case GL_TEXTURE_2D:
- case GL_PROXY_TEXTURE_2D:
- return GL_TRUE; /* true for any compressed format so far */
- case GL_PROXY_TEXTURE_CUBE_MAP:
- case GL_TEXTURE_CUBE_MAP_POSITIVE_X:
- case GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
- case GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
- case GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
- case GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
- case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
- return ctx->Extensions.ARB_texture_cube_map;
- case GL_PROXY_TEXTURE_2D_ARRAY_EXT:
- case GL_TEXTURE_2D_ARRAY_EXT:
- return (ctx->Extensions.MESA_texture_array ||
- ctx->Extensions.EXT_texture_array);
- default:
- return GL_FALSE;
- }
-}
-
-
-/**
- * Check if the given texture target value is legal for a
- * glTexImage1/2/3D call.
- */
-static GLboolean
-legal_teximage_target(struct gl_context *ctx, GLuint dims, GLenum target)
-{
- switch (dims) {
- case 1:
- switch (target) {
- case GL_TEXTURE_1D:
- case GL_PROXY_TEXTURE_1D:
- return GL_TRUE;
- default:
- return GL_FALSE;
- }
- case 2:
- switch (target) {
- case GL_TEXTURE_2D:
- case GL_PROXY_TEXTURE_2D:
- return GL_TRUE;
- case GL_PROXY_TEXTURE_CUBE_MAP:
- case GL_TEXTURE_CUBE_MAP_POSITIVE_X:
- case GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
- case GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
- case GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
- case GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
- case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
- return ctx->Extensions.ARB_texture_cube_map;
- case GL_TEXTURE_RECTANGLE_NV:
- case GL_PROXY_TEXTURE_RECTANGLE_NV:
- return ctx->Extensions.NV_texture_rectangle;
- case GL_TEXTURE_1D_ARRAY_EXT:
- case GL_PROXY_TEXTURE_1D_ARRAY_EXT:
- return (ctx->Extensions.MESA_texture_array ||
- ctx->Extensions.EXT_texture_array);
- default:
- return GL_FALSE;
- }
- case 3:
- switch (target) {
- case GL_TEXTURE_3D:
- case GL_PROXY_TEXTURE_3D:
- return GL_TRUE;
- case GL_TEXTURE_2D_ARRAY_EXT:
- case GL_PROXY_TEXTURE_2D_ARRAY_EXT:
- return (ctx->Extensions.MESA_texture_array ||
- ctx->Extensions.EXT_texture_array);
- default:
- return GL_FALSE;
- }
- default:
- _mesa_problem(ctx, "invalid dims=%u in legal_teximage_target()", dims);
- return GL_FALSE;
- }
-}
-
-
-/**
- * Check if the given texture target value is legal for a
- * glTexSubImage, glCopyTexSubImage or glCopyTexImage call.
- * The difference compared to legal_teximage_target() above is that
- * proxy targets are not supported.
- */
-static GLboolean
-legal_texsubimage_target(struct gl_context *ctx, GLuint dims, GLenum target)
-{
- switch (dims) {
- case 1:
- return target == GL_TEXTURE_1D;
- case 2:
- switch (target) {
- case GL_TEXTURE_2D:
- return GL_TRUE;
- case GL_TEXTURE_CUBE_MAP_POSITIVE_X:
- case GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
- case GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
- case GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
- case GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
- case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
- return ctx->Extensions.ARB_texture_cube_map;
- case GL_TEXTURE_RECTANGLE_NV:
- return ctx->Extensions.NV_texture_rectangle;
- case GL_TEXTURE_1D_ARRAY_EXT:
- return (ctx->Extensions.MESA_texture_array ||
- ctx->Extensions.EXT_texture_array);
- default:
- return GL_FALSE;
- }
- case 3:
- switch (target) {
- case GL_TEXTURE_3D:
- return GL_TRUE;
- case GL_TEXTURE_2D_ARRAY_EXT:
- return (ctx->Extensions.MESA_texture_array ||
- ctx->Extensions.EXT_texture_array);
- default:
- return GL_FALSE;
- }
- default:
- _mesa_problem(ctx, "invalid dims=%u in legal_texsubimage_target()",
- dims);
- return GL_FALSE;
- }
-}
-
-
-/**
- * Test the glTexImage[123]D() parameters for errors.
- *
- * \param ctx GL context.
- * \param dimensions texture image dimensions (must be 1, 2 or 3).
- * \param target texture target given by the user.
- * \param level image level given by the user.
- * \param internalFormat internal format given by the user.
- * \param format pixel data format given by the user.
- * \param type pixel data type given by the user.
- * \param width image width given by the user.
- * \param height image height given by the user.
- * \param depth image depth given by the user.
- * \param border image border given by the user.
- *
- * \return GL_TRUE if an error was detected, or GL_FALSE if no errors.
- *
- * Verifies each of the parameters against the constants specified in
- * __struct gl_contextRec::Const and the supported extensions, and according
- * to the OpenGL specification.
- */
-static GLboolean
-texture_error_check( struct gl_context *ctx,
- GLuint dimensions, GLenum target,
- GLint level, GLint internalFormat,
- GLenum format, GLenum type,
- GLint width, GLint height,
- GLint depth, GLint border )
-{
- const GLenum proxyTarget = get_proxy_target(target);
- const GLboolean isProxy = target == proxyTarget;
- GLboolean sizeOK = GL_TRUE;
- GLboolean colorFormat, indexFormat;
-
- /* Basic level check (more checking in ctx->Driver.TestProxyTexImage) */
- if (level < 0 || level >= MAX_TEXTURE_LEVELS) {
- if (!isProxy) {
- _mesa_error(ctx, GL_INVALID_VALUE,
- "glTexImage%dD(level=%d)", dimensions, level);
- }
- return GL_TRUE;
- }
-
- /* Check border */
- if (border < 0 || border > 1 ||
- ((target == GL_TEXTURE_RECTANGLE_NV ||
- target == GL_PROXY_TEXTURE_RECTANGLE_NV) && border != 0)) {
- if (!isProxy) {
- _mesa_error(ctx, GL_INVALID_VALUE,
- "glTexImage%dD(border=%d)", dimensions, border);
- }
- return GL_TRUE;
- }
-
- if (width < 0 || height < 0 || depth < 0) {
- if (!isProxy) {
- _mesa_error(ctx, GL_INVALID_VALUE,
- "glTexImage%dD(width, height or depth < 0)", dimensions);
- }
- return GL_TRUE;
- }
-
- /* Do this simple check before calling the TestProxyTexImage() function */
- if (proxyTarget == GL_PROXY_TEXTURE_CUBE_MAP_ARB) {
- sizeOK = (width == height);
- }
-
- /*
- * Use the proxy texture driver hook to see if the size/level/etc are
- * legal.
- */
- sizeOK = sizeOK && ctx->Driver.TestProxyTexImage(ctx, proxyTarget, level,
- internalFormat, format,
- type, width, height,
- depth, border);
- if (!sizeOK) {
- if (!isProxy) {
- _mesa_error(ctx, GL_INVALID_VALUE,
- "glTexImage%dD(level=%d, width=%d, height=%d, depth=%d)",
- dimensions, level, width, height, depth);
- }
- return GL_TRUE;
- }
-
- /* Check internalFormat */
- if (_mesa_base_tex_format(ctx, internalFormat) < 0) {
- if (!isProxy) {
- _mesa_error(ctx, GL_INVALID_VALUE,
- "glTexImage%dD(internalFormat=%s)",
- dimensions, _mesa_lookup_enum_by_nr(internalFormat));
- }
- return GL_TRUE;
- }
-
- /* Check incoming image format and type */
- if (!_mesa_is_legal_format_and_type(ctx, format, type)) {
- /* Normally, GL_INVALID_OPERATION is generated by a format/type
- * mismatch (see the 1.2 spec page 94, sec 3.6.4.). But with the
- * GL_EXT_texture_integer extension, some combinations should generate
- * GL_INVALID_ENUM instead (grr!).
- */
- if (!isProxy) {
- GLenum error = _mesa_is_integer_format(format)
- ? GL_INVALID_ENUM : GL_INVALID_OPERATION;
- _mesa_error(ctx, error,
- "glTexImage%dD(incompatible format 0x%x, type 0x%x)",
- dimensions, format, type);
- }
- return GL_TRUE;
- }
-
- /* make sure internal format and format basically agree */
- colorFormat = _mesa_is_color_format(format);
- indexFormat = _mesa_is_index_format(format);
- if ((_mesa_is_color_format(internalFormat) && !colorFormat && !indexFormat) ||
- (_mesa_is_index_format(internalFormat) && !indexFormat) ||
- (_mesa_is_depth_format(internalFormat) != _mesa_is_depth_format(format)) ||
- (_mesa_is_ycbcr_format(internalFormat) != _mesa_is_ycbcr_format(format)) ||
- (_mesa_is_depthstencil_format(internalFormat) != _mesa_is_depthstencil_format(format)) ||
- (_mesa_is_dudv_format(internalFormat) != _mesa_is_dudv_format(format))) {
- if (!isProxy)
- _mesa_error(ctx, GL_INVALID_OPERATION,
- "glTexImage%dD(incompatible internalFormat 0x%x, format 0x%x)",
- dimensions, internalFormat, format);
- return GL_TRUE;
- }
-
- /* additional checks for ycbcr textures */
- if (internalFormat == GL_YCBCR_MESA) {
- ASSERT(ctx->Extensions.MESA_ycbcr_texture);
- if (type != GL_UNSIGNED_SHORT_8_8_MESA &&
- type != GL_UNSIGNED_SHORT_8_8_REV_MESA) {
- char message[100];
- _mesa_snprintf(message, sizeof(message),
- "glTexImage%dD(format/type YCBCR mismatch", dimensions);
- _mesa_error(ctx, GL_INVALID_ENUM, "%s", message);
- return GL_TRUE; /* error */
- }
- if (target != GL_TEXTURE_2D &&
- target != GL_PROXY_TEXTURE_2D &&
- target != GL_TEXTURE_RECTANGLE_NV &&
- target != GL_PROXY_TEXTURE_RECTANGLE_NV) {
- if (!isProxy)
- _mesa_error(ctx, GL_INVALID_ENUM, "glTexImage(target)");
- return GL_TRUE;
- }
- if (border != 0) {
- if (!isProxy) {
- char message[100];
- _mesa_snprintf(message, sizeof(message),
- "glTexImage%dD(format=GL_YCBCR_MESA and border=%d)",
- dimensions, border);
- _mesa_error(ctx, GL_INVALID_VALUE, "%s", message);
- }
- return GL_TRUE;
- }
- }
-
- /* additional checks for depth textures */
- if (_mesa_base_tex_format(ctx, internalFormat) == GL_DEPTH_COMPONENT) {
- /* Only 1D, 2D and rectangular textures supported, not 3D or cubes */
- if (target != GL_TEXTURE_1D &&
- target != GL_PROXY_TEXTURE_1D &&
- target != GL_TEXTURE_2D &&
- target != GL_PROXY_TEXTURE_2D &&
- target != GL_TEXTURE_RECTANGLE_ARB &&
- target != GL_PROXY_TEXTURE_RECTANGLE_ARB) {
- if (!isProxy)
- _mesa_error(ctx, GL_INVALID_ENUM,
- "glTexImage(target/internalFormat)");
- return GL_TRUE;
- }
- }
-
- /* additional checks for compressed textures */
- if (_mesa_is_compressed_format(ctx, internalFormat)) {
- if (!target_can_be_compressed(ctx, target, internalFormat)) {
- if (!isProxy)
- _mesa_error(ctx, GL_INVALID_ENUM,
- "glTexImage%dD(target)", dimensions);
- return GL_TRUE;
- }
- if (border != 0) {
- if (!isProxy) {
- _mesa_error(ctx, GL_INVALID_OPERATION,
- "glTexImage%dD(border!=0)", dimensions);
- }
- return GL_TRUE;
- }
- }
-
- /* additional checks for integer textures */
- if (ctx->Extensions.EXT_texture_integer &&
- (_mesa_is_integer_format(format) !=
- _mesa_is_integer_format(internalFormat))) {
- if (!isProxy) {
- _mesa_error(ctx, GL_INVALID_OPERATION,
- "glTexImage%dD(integer/non-integer format mismatch)",
- dimensions);
- }
- return GL_TRUE;
- }
-
- /* if we get here, the parameters are OK */
- return GL_FALSE;
-}
-
-
-/**
- * Test glTexSubImage[123]D() parameters for errors.
- *
- * \param ctx GL context.
- * \param dimensions texture image dimensions (must be 1, 2 or 3).
- * \param target texture target given by the user.
- * \param level image level given by the user.
- * \param xoffset sub-image x offset given by the user.
- * \param yoffset sub-image y offset given by the user.
- * \param zoffset sub-image z offset given by the user.
- * \param format pixel data format given by the user.
- * \param type pixel data type given by the user.
- * \param width image width given by the user.
- * \param height image height given by the user.
- * \param depth image depth given by the user.
- *
- * \return GL_TRUE if an error was detected, or GL_FALSE if no errors.
- *
- * Verifies each of the parameters against the constants specified in
- * __struct gl_contextRec::Const and the supported extensions, and according
- * to the OpenGL specification.
- */
-static GLboolean
-subtexture_error_check( struct gl_context *ctx, GLuint dimensions,
- GLenum target, GLint level,
- GLint xoffset, GLint yoffset, GLint zoffset,
- GLint width, GLint height, GLint depth,
- GLenum format, GLenum type )
-{
- /* Basic level check */
- if (level < 0 || level >= MAX_TEXTURE_LEVELS) {
- _mesa_error(ctx, GL_INVALID_ENUM, "glTexSubImage2D(level=%d)", level);
- return GL_TRUE;
- }
-
- /* Check for negative sizes */
- if (width < 0) {
- _mesa_error(ctx, GL_INVALID_VALUE,
- "glTexSubImage%dD(width=%d)", dimensions, width);
- return GL_TRUE;
- }
- if (height < 0 && dimensions > 1) {
- _mesa_error(ctx, GL_INVALID_VALUE,
- "glTexSubImage%dD(height=%d)", dimensions, height);
- return GL_TRUE;
- }
- if (depth < 0 && dimensions > 2) {
- _mesa_error(ctx, GL_INVALID_VALUE,
- "glTexSubImage%dD(depth=%d)", dimensions, depth);
- return GL_TRUE;
- }
-
- if (!_mesa_is_legal_format_and_type(ctx, format, type)) {
- /* As with the glTexImage2D check above, the error code here
- * depends on texture integer.
- */
- GLenum error = _mesa_is_integer_format(format)
- ? GL_INVALID_OPERATION : GL_INVALID_ENUM;
- _mesa_error(ctx, error,
- "glTexSubImage%dD(incompatible format 0x%x, type 0x%x)",
- dimensions, format, type);
- return GL_TRUE;
- }
-
- return GL_FALSE;
-}
-
-
-/**
- * Do second part of glTexSubImage which depends on the destination texture.
- * \return GL_TRUE if error recorded, GL_FALSE otherwise
- */
-static GLboolean
-subtexture_error_check2( struct gl_context *ctx, GLuint dimensions,
- GLenum target, GLint level,
- GLint xoffset, GLint yoffset, GLint zoffset,
- GLint width, GLint height, GLint depth,
- GLenum format, GLenum type,
- const struct gl_texture_image *destTex )
-{
- if (!destTex) {
- /* undefined image level */
- _mesa_error(ctx, GL_INVALID_OPERATION, "glTexSubImage%dD", dimensions);
- return GL_TRUE;
- }
-
- if (xoffset < -((GLint)destTex->Border)) {
- _mesa_error(ctx, GL_INVALID_VALUE, "glTexSubImage%dD(xoffset)",
- dimensions);
- return GL_TRUE;
- }
- if (xoffset + width > (GLint) (destTex->Width + destTex->Border)) {
- _mesa_error(ctx, GL_INVALID_VALUE, "glTexSubImage%dD(xoffset+width)",
- dimensions);
- return GL_TRUE;
- }
- if (dimensions > 1) {
- if (yoffset < -((GLint)destTex->Border)) {
- _mesa_error(ctx, GL_INVALID_VALUE, "glTexSubImage%dD(yoffset)",
- dimensions);
- return GL_TRUE;
- }
- if (yoffset + height > (GLint) (destTex->Height + destTex->Border)) {
- _mesa_error(ctx, GL_INVALID_VALUE, "glTexSubImage%dD(yoffset+height)",
- dimensions);
- return GL_TRUE;
- }
- }
- if (dimensions > 2) {
- if (zoffset < -((GLint)destTex->Border)) {
- _mesa_error(ctx, GL_INVALID_VALUE, "glTexSubImage3D(zoffset)");
- return GL_TRUE;
- }
- if (zoffset + depth > (GLint) (destTex->Depth + destTex->Border)) {
- _mesa_error(ctx, GL_INVALID_VALUE, "glTexSubImage3D(zoffset+depth)");
- return GL_TRUE;
- }
- }
-
- if (_mesa_is_format_compressed(destTex->TexFormat)) {
- GLuint bw, bh;
-
- /* do tests which depend on compression block size */
- _mesa_get_format_block_size(destTex->TexFormat, &bw, &bh);
-
- /* offset must be multiple of block size */
- if ((xoffset % bw != 0) || (yoffset % bh != 0)) {
- _mesa_error(ctx, GL_INVALID_OPERATION,
- "glTexSubImage%dD(xoffset = %d, yoffset = %d)",
- dimensions, xoffset, yoffset);
- return GL_TRUE;
- }
- /* size must be multiple of bw by bh or equal to whole texture size */
- if ((width % bw != 0) && (GLuint) width != destTex->Width) {
- _mesa_error(ctx, GL_INVALID_OPERATION,
- "glTexSubImage%dD(width = %d)", dimensions, width);
- return GL_TRUE;
- }
- if ((height % bh != 0) && (GLuint) height != destTex->Height) {
- _mesa_error(ctx, GL_INVALID_OPERATION,
- "glTexSubImage%dD(height = %d)", dimensions, height);
- return GL_TRUE;
- }
- }
-
- return GL_FALSE;
-}
-
-
-/**
- * Test glCopyTexImage[12]D() parameters for errors.
- *
- * \param ctx GL context.
- * \param dimensions texture image dimensions (must be 1, 2 or 3).
- * \param target texture target given by the user.
- * \param level image level given by the user.
- * \param internalFormat internal format given by the user.
- * \param width image width given by the user.
- * \param height image height given by the user.
- * \param border texture border.
- *
- * \return GL_TRUE if an error was detected, or GL_FALSE if no errors.
- *
- * Verifies each of the parameters against the constants specified in
- * __struct gl_contextRec::Const and the supported extensions, and according
- * to the OpenGL specification.
- */
-static GLboolean
-copytexture_error_check( struct gl_context *ctx, GLuint dimensions,
- GLenum target, GLint level, GLint internalFormat,
- GLint width, GLint height, GLint border )
-{
- const GLenum proxyTarget = get_proxy_target(target);
- const GLenum type = GL_FLOAT;
- GLboolean sizeOK;
- GLint format;
-
- /* check target */
- if (!legal_texsubimage_target(ctx, dimensions, target)) {
- _mesa_error(ctx, GL_INVALID_ENUM, "glCopyTexImage%uD(target=%s)",
- dimensions, _mesa_lookup_enum_by_nr(target));
- return GL_TRUE;
- }
-
- /* Basic level check (more checking in ctx->Driver.TestProxyTexImage) */
- if (level < 0 || level >= MAX_TEXTURE_LEVELS) {
- _mesa_error(ctx, GL_INVALID_VALUE,
- "glCopyTexImage%dD(level=%d)", dimensions, level);
- return GL_TRUE;
- }
-
- /* Check that the source buffer is complete */
- if (ctx->ReadBuffer->Name) {
- if (ctx->ReadBuffer->_Status == 0) {
- _mesa_test_framebuffer_completeness(ctx, ctx->ReadBuffer);
- }
- if (ctx->ReadBuffer->_Status != GL_FRAMEBUFFER_COMPLETE_EXT) {
- _mesa_error(ctx, GL_INVALID_FRAMEBUFFER_OPERATION_EXT,
- "glCopyTexImage%dD(invalid readbuffer)", dimensions);
- return GL_TRUE;
- }
- }
-
- /* Check border */
- if (border < 0 || border > 1 ||
- ((target == GL_TEXTURE_RECTANGLE_NV ||
- target == GL_PROXY_TEXTURE_RECTANGLE_NV) && border != 0)) {
- return GL_TRUE;
- }
-
- format = _mesa_base_tex_format(ctx, internalFormat);
- if (format < 0) {
- _mesa_error(ctx, GL_INVALID_VALUE,
- "glCopyTexImage%dD(internalFormat)", dimensions);
- return GL_TRUE;
- }
-
- if (!_mesa_source_buffer_exists(ctx, format)) {
- _mesa_error(ctx, GL_INVALID_OPERATION,
- "glCopyTexImage%dD(missing readbuffer)", dimensions);
- return GL_TRUE;
- }
-
- /* Do size, level checking */
- sizeOK = (proxyTarget == GL_PROXY_TEXTURE_CUBE_MAP_ARB)
- ? (width == height) : 1;
-
- sizeOK = sizeOK && ctx->Driver.TestProxyTexImage(ctx, proxyTarget, level,
- internalFormat, format,
- type, width, height,
- 1, border);
-
- if (!sizeOK) {
- if (dimensions == 1) {
- _mesa_error(ctx, GL_INVALID_VALUE,
- "glCopyTexImage1D(width=%d)", width);
- }
- else {
- ASSERT(dimensions == 2);
- _mesa_error(ctx, GL_INVALID_VALUE,
- "glCopyTexImage2D(width=%d, height=%d)", width, height);
- }
- return GL_TRUE;
- }
-
- if (_mesa_is_compressed_format(ctx, internalFormat)) {
- if (!target_can_be_compressed(ctx, target, internalFormat)) {
- _mesa_error(ctx, GL_INVALID_ENUM,
- "glCopyTexImage%dD(target)", dimensions);
- return GL_TRUE;
- }
- if (border != 0) {
- _mesa_error(ctx, GL_INVALID_OPERATION,
- "glCopyTexImage%dD(border!=0)", dimensions);
- return GL_TRUE;
- }
- }
- else if (_mesa_is_depth_format(internalFormat)) {
- /* make sure we have depth/stencil buffers */
- if (!ctx->ReadBuffer->_DepthBuffer) {
- _mesa_error(ctx, GL_INVALID_OPERATION,
- "glCopyTexImage%dD(no depth)", dimensions);
- return GL_TRUE;
- }
- }
- else if (_mesa_is_depthstencil_format(internalFormat)) {
- /* make sure we have depth/stencil buffers */
- if (!ctx->ReadBuffer->_DepthBuffer || !ctx->ReadBuffer->_StencilBuffer) {
- _mesa_error(ctx, GL_INVALID_OPERATION,
- "glCopyTexImage%dD(no depth/stencil buffer)", dimensions);
- return GL_TRUE;
- }
- }
-
- /* if we get here, the parameters are OK */
- return GL_FALSE;
-}
-
-
-/**
- * Test glCopyTexSubImage[12]D() parameters for errors.
- * Note that this is the first part of error checking.
- * See also copytexsubimage_error_check2() below for the second part.
- *
- * \param ctx GL context.
- * \param dimensions texture image dimensions (must be 1, 2 or 3).
- * \param target texture target given by the user.
- * \param level image level given by the user.
- *
- * \return GL_TRUE if an error was detected, or GL_FALSE if no errors.
- */
-static GLboolean
-copytexsubimage_error_check1( struct gl_context *ctx, GLuint dimensions,
- GLenum target, GLint level)
-{
- /* Check that the source buffer is complete */
- if (ctx->ReadBuffer->Name) {
- if (ctx->ReadBuffer->_Status == 0) {
- _mesa_test_framebuffer_completeness(ctx, ctx->ReadBuffer);
- }
- if (ctx->ReadBuffer->_Status != GL_FRAMEBUFFER_COMPLETE_EXT) {
- _mesa_error(ctx, GL_INVALID_FRAMEBUFFER_OPERATION_EXT,
- "glCopyTexImage%dD(invalid readbuffer)", dimensions);
- return GL_TRUE;
- }
- }
-
- /* check target (proxies not allowed) */
- if (!legal_texsubimage_target(ctx, dimensions, target)) {
- _mesa_error(ctx, GL_INVALID_ENUM, "glCopyTexSubImage%uD(target=%s)",
- dimensions, _mesa_lookup_enum_by_nr(target));
- return GL_TRUE;
- }
-
- /* Check level */
- if (level < 0 || level >= MAX_TEXTURE_LEVELS) {
- _mesa_error(ctx, GL_INVALID_VALUE,
- "glCopyTexSubImage%dD(level=%d)", dimensions, level);
- return GL_TRUE;
- }
-
- return GL_FALSE;
-}
-
-
-/**
- * Second part of error checking for glCopyTexSubImage[12]D().
- * \param xoffset sub-image x offset given by the user.
- * \param yoffset sub-image y offset given by the user.
- * \param zoffset sub-image z offset given by the user.
- * \param width image width given by the user.
- * \param height image height given by the user.
- */
-static GLboolean
-copytexsubimage_error_check2( struct gl_context *ctx, GLuint dimensions,
- GLenum target, GLint level,
- GLint xoffset, GLint yoffset, GLint zoffset,
- GLsizei width, GLsizei height,
- const struct gl_texture_image *teximage )
-{
- /* check that dest tex image exists */
- if (!teximage) {
- _mesa_error(ctx, GL_INVALID_OPERATION,
- "glCopyTexSubImage%dD(undefined texture level: %d)",
- dimensions, level);
- return GL_TRUE;
- }
-
- /* Check size */
- if (width < 0) {
- _mesa_error(ctx, GL_INVALID_VALUE,
- "glCopyTexSubImage%dD(width=%d)", dimensions, width);
- return GL_TRUE;
- }
- if (dimensions > 1 && height < 0) {
- _mesa_error(ctx, GL_INVALID_VALUE,
- "glCopyTexSubImage%dD(height=%d)", dimensions, height);
- return GL_TRUE;
- }
-
- /* check x/y offsets */
- if (xoffset < -((GLint)teximage->Border)) {
- _mesa_error(ctx, GL_INVALID_VALUE,
- "glCopyTexSubImage%dD(xoffset=%d)", dimensions, xoffset);
- return GL_TRUE;
- }
- if (xoffset + width > (GLint) (teximage->Width + teximage->Border)) {
- _mesa_error(ctx, GL_INVALID_VALUE,
- "glCopyTexSubImage%dD(xoffset+width)", dimensions);
- return GL_TRUE;
- }
- if (dimensions > 1) {
- if (yoffset < -((GLint)teximage->Border)) {
- _mesa_error(ctx, GL_INVALID_VALUE,
- "glCopyTexSubImage%dD(yoffset=%d)", dimensions, yoffset);
- return GL_TRUE;
- }
- /* NOTE: we're adding the border here, not subtracting! */
- if (yoffset + height > (GLint) (teximage->Height + teximage->Border)) {
- _mesa_error(ctx, GL_INVALID_VALUE,
- "glCopyTexSubImage%dD(yoffset+height)", dimensions);
- return GL_TRUE;
- }
- }
-
- /* check z offset */
- if (dimensions > 2) {
- if (zoffset < -((GLint)teximage->Border)) {
- _mesa_error(ctx, GL_INVALID_VALUE,
- "glCopyTexSubImage%dD(zoffset)", dimensions);
- return GL_TRUE;
- }
- if (zoffset > (GLint) (teximage->Depth + teximage->Border)) {
- _mesa_error(ctx, GL_INVALID_VALUE,
- "glCopyTexSubImage%dD(zoffset+depth)", dimensions);
- return GL_TRUE;
- }
- }
-
- if (_mesa_is_format_compressed(teximage->TexFormat)) {
- /* offset must be multiple of 4 */
- if ((xoffset & 3) || (yoffset & 3)) {
- _mesa_error(ctx, GL_INVALID_VALUE,
- "glCopyTexSubImage%dD(xoffset or yoffset)", dimensions);
- return GL_TRUE;
- }
- /* size must be multiple of 4 */
- if ((width & 3) != 0 && (GLuint) width != teximage->Width) {
- _mesa_error(ctx, GL_INVALID_VALUE,
- "glCopyTexSubImage%dD(width)", dimensions);
- return GL_TRUE;
- }
- if ((height & 3) != 0 && (GLuint) height != teximage->Height) {
- _mesa_error(ctx, GL_INVALID_VALUE,
- "glCopyTexSubImage%dD(height)", dimensions);
- return GL_TRUE;
- }
- }
-
- if (teximage->InternalFormat == GL_YCBCR_MESA) {
- _mesa_error(ctx, GL_INVALID_OPERATION, "glCopyTexSubImage2D");
- return GL_TRUE;
- }
-
- if (!_mesa_source_buffer_exists(ctx, teximage->_BaseFormat)) {
- _mesa_error(ctx, GL_INVALID_OPERATION,
- "glCopyTexSubImage%dD(missing readbuffer, format=0x%x)",
- dimensions, teximage->_BaseFormat);
- return GL_TRUE;
- }
-
- if (teximage->_BaseFormat == GL_DEPTH_COMPONENT) {
- if (!ctx->ReadBuffer->_DepthBuffer) {
- _mesa_error(ctx, GL_INVALID_OPERATION,
- "glCopyTexSubImage%dD(no depth buffer)",
- dimensions);
- return GL_TRUE;
- }
- }
- else if (teximage->_BaseFormat == GL_DEPTH_STENCIL_EXT) {
- if (!ctx->ReadBuffer->_DepthBuffer || !ctx->ReadBuffer->_StencilBuffer) {
- _mesa_error(ctx, GL_INVALID_OPERATION,
- "glCopyTexSubImage%dD(no depth/stencil buffer)",
- dimensions);
- return GL_TRUE;
- }
- }
-
- /* If copying into an integer texture, the source buffer must also be
- * integer-valued.
- */
- if (_mesa_is_format_integer_color(teximage->TexFormat)) {
- struct gl_renderbuffer *rb = ctx->ReadBuffer->_ColorReadBuffer;
- if (!_mesa_is_format_integer_color(rb->Format)) {
- _mesa_error(ctx, GL_INVALID_OPERATION,
- "glCopyTexSubImage%dD(source buffer is not integer format)",
- dimensions);
- return GL_TRUE;
- }
- }
-
- /* if we get here, the parameters are OK */
- return GL_FALSE;
-}
-
-
-/** Callback info for walking over FBO hash table */
-struct cb_info
-{
- struct gl_context *ctx;
- struct gl_texture_object *texObj;
- GLuint level, face;
-};
-
-
-/**
- * Check render to texture callback. Called from _mesa_HashWalk().
- */
-static void
-check_rtt_cb(GLuint key, void *data, void *userData)
-{
- struct gl_framebuffer *fb = (struct gl_framebuffer *) data;
- const struct cb_info *info = (struct cb_info *) userData;
- struct gl_context *ctx = info->ctx;
- const struct gl_texture_object *texObj = info->texObj;
- const GLuint level = info->level, face = info->face;
-
- /* If this is a user-created FBO */
- if (fb->Name) {
- GLuint i;
- /* check if any of the FBO's attachments point to 'texObj' */
- for (i = 0; i < BUFFER_COUNT; i++) {
- struct gl_renderbuffer_attachment *att = fb->Attachment + i;
- if (att->Type == GL_TEXTURE &&
- att->Texture == texObj &&
- att->TextureLevel == level &&
- att->CubeMapFace == face) {
- ASSERT(_mesa_get_attachment_teximage(att));
- /* Tell driver about the new renderbuffer texture */
- ctx->Driver.RenderTexture(ctx, ctx->DrawBuffer, att);
- /* Mark fb status as indeterminate to force re-validation */
- fb->_Status = 0;
- }
- }
- }
-}
-
-
-/**
- * When a texture image is specified we have to check if it's bound to
- * any framebuffer objects (render to texture) in order to detect changes
- * in size or format since that effects FBO completeness.
- * Any FBOs rendering into the texture must be re-validated.
- */
-static void
-update_fbo_texture(struct gl_context *ctx, struct gl_texture_object *texObj,
- GLuint face, GLuint level)
-{
- /* Only check this texture if it's been marked as RenderToTexture */
- if (texObj->_RenderToTexture) {
- struct cb_info info;
- info.ctx = ctx;
- info.texObj = texObj;
- info.level = level;
- info.face = face;
- _mesa_HashWalk(ctx->Shared->FrameBuffers, check_rtt_cb, &info);
- }
-}
-
-
-/**
- * If the texture object's GenerateMipmap flag is set and we've
- * changed the texture base level image, regenerate the rest of the
- * mipmap levels now.
- */
-static INLINE void
-check_gen_mipmap(struct gl_context *ctx, GLenum target,
- struct gl_texture_object *texObj, GLint level)
-{
- ASSERT(target != GL_TEXTURE_CUBE_MAP);
- if (texObj->GenerateMipmap &&
- level == texObj->BaseLevel &&
- level < texObj->MaxLevel) {
- ASSERT(ctx->Driver.GenerateMipmap);
- ctx->Driver.GenerateMipmap(ctx, target, texObj);
- }
-}
-
-
-/** Debug helper: override the user-requested internal format */
-static GLenum
-override_internal_format(GLenum internalFormat, GLint width, GLint height)
-{
-#if 0
- if (internalFormat == GL_RGBA16F_ARB ||
- internalFormat == GL_RGBA32F_ARB) {
- printf("Convert rgba float tex to int %d x %d\n", width, height);
- return GL_RGBA;
- }
- else if (internalFormat == GL_RGB16F_ARB ||
- internalFormat == GL_RGB32F_ARB) {
- printf("Convert rgb float tex to int %d x %d\n", width, height);
- return GL_RGB;
- }
- else if (internalFormat == GL_LUMINANCE_ALPHA16F_ARB ||
- internalFormat == GL_LUMINANCE_ALPHA32F_ARB) {
- printf("Convert luminance float tex to int %d x %d\n", width, height);
- return GL_LUMINANCE_ALPHA;
- }
- else if (internalFormat == GL_LUMINANCE16F_ARB ||
- internalFormat == GL_LUMINANCE32F_ARB) {
- printf("Convert luminance float tex to int %d x %d\n", width, height);
- return GL_LUMINANCE;
- }
- else if (internalFormat == GL_ALPHA16F_ARB ||
- internalFormat == GL_ALPHA32F_ARB) {
- printf("Convert luminance float tex to int %d x %d\n", width, height);
- return GL_ALPHA;
- }
- /*
- else if (internalFormat == GL_COMPRESSED_RGBA_S3TC_DXT1_EXT) {
- internalFormat = GL_RGBA;
- }
- */
- else {
- return internalFormat;
- }
-#else
- return internalFormat;
-#endif
-}
-
-
-/**
- * Choose the actual hardware format for a texture image.
- * Try to use the same format as the previous image level when possible.
- * Otherwise, ask the driver for the best format.
- * It's important to try to choose a consistant format for all levels
- * for efficient texture memory layout/allocation. In particular, this
- * comes up during automatic mipmap generation.
- */
-gl_format
-_mesa_choose_texture_format(struct gl_context *ctx,
- struct gl_texture_object *texObj,
- GLenum target, GLint level,
- GLenum internalFormat, GLenum format, GLenum type)
-{
- gl_format f;
-
- /* see if we've already chosen a format for the previous level */
- if (level > 0) {
- struct gl_texture_image *prevImage =
- _mesa_select_tex_image(ctx, texObj, target, level - 1);
- /* See if the prev level is defined and has an internal format which
- * matches the new internal format.
- */
- if (prevImage &&
- prevImage->Width > 0 &&
- prevImage->InternalFormat == internalFormat) {
- /* use the same format */
- ASSERT(prevImage->TexFormat != MESA_FORMAT_NONE);
- return prevImage->TexFormat;
- }
- }
-
- /* choose format from scratch */
- f = ctx->Driver.ChooseTextureFormat(ctx, internalFormat, format, type);
- ASSERT(f != MESA_FORMAT_NONE);
- return f;
-}
-
-
-/**
- * Common code to implement all the glTexImage1D/2D/3D functions.
- */
-static void
-teximage(struct gl_context *ctx, GLuint dims,
- GLenum target, GLint level, GLint internalFormat,
- GLsizei width, GLsizei height, GLsizei depth,
- GLint border, GLenum format, GLenum type,
- const GLvoid *pixels)
-{
- GLboolean error;
-
- ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
-
- if (MESA_VERBOSE & (VERBOSE_API|VERBOSE_TEXTURE))
- _mesa_debug(ctx, "glTexImage%uD %s %d %s %d %d %d %d %s %s %p\n",
- dims,
- _mesa_lookup_enum_by_nr(target), level,
- _mesa_lookup_enum_by_nr(internalFormat),
- width, height, depth, border,
- _mesa_lookup_enum_by_nr(format),
- _mesa_lookup_enum_by_nr(type), pixels);
-
- internalFormat = override_internal_format(internalFormat, width, height);
-
- /* target error checking */
- if (!legal_teximage_target(ctx, dims, target)) {
- _mesa_error(ctx, GL_INVALID_ENUM, "glTexImage%uD(target=%s)",
- dims, _mesa_lookup_enum_by_nr(target));
- return;
- }
-
- /* general error checking */
- error = texture_error_check(ctx, dims, target, level, internalFormat,
- format, type, width, height, depth, border);
-
- if (_mesa_is_proxy_texture(target)) {
- /* Proxy texture: just clear or set state depending on error checking */
- struct gl_texture_image *texImage =
- _mesa_get_proxy_tex_image(ctx, target, level);
-
- if (error) {
- /* when error, clear all proxy texture image parameters */
- if (texImage)
- clear_teximage_fields(texImage);
- }
- else {
- /* no error, set the tex image parameters */
- struct gl_texture_object *texObj =
- _mesa_get_current_tex_object(ctx, target);
- gl_format texFormat = _mesa_choose_texture_format(ctx, texObj,
- target, level,
- internalFormat,
- format, type);
-
- if (legal_texture_size(ctx, texFormat, width, height, depth)) {
- _mesa_init_teximage_fields(ctx, target, texImage, width, height,
- depth, border, internalFormat,
- texFormat);
- }
- else if (texImage) {
- clear_teximage_fields(texImage);
- }
- }
- }
- else {
- /* non-proxy target */
- const GLuint face = _mesa_tex_target_to_face(target);
- struct gl_texture_object *texObj;
- struct gl_texture_image *texImage;
-
- if (error) {
- return; /* error was recorded */
- }
-
- if (ctx->NewState & _NEW_PIXEL)
- _mesa_update_state(ctx);
-
- texObj = _mesa_get_current_tex_object(ctx, target);
-
- _mesa_lock_texture(ctx, texObj);
- {
- texImage = _mesa_get_tex_image(ctx, texObj, target, level);
-
- if (!texImage) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage%uD", dims);
- }
- else {
- gl_format texFormat;
-
- if (texImage->Data) {
- ctx->Driver.FreeTexImageData( ctx, texImage );
- }
-
- ASSERT(texImage->Data == NULL);
- texFormat = _mesa_choose_texture_format(ctx, texObj, target, level,
- internalFormat, format,
- type);
-
- if (legal_texture_size(ctx, texFormat, width, height, depth)) {
- _mesa_init_teximage_fields(ctx, target, texImage,
- width, height, depth,
- border, internalFormat, texFormat);
-
- /* Give the texture to the driver. <pixels> may be null. */
- ASSERT(ctx->Driver.TexImage3D);
- switch (dims) {
- case 1:
- ctx->Driver.TexImage1D(ctx, target, level, internalFormat,
- width, border, format,
- type, pixels, &ctx->Unpack, texObj,
- texImage);
- break;
- case 2:
- ctx->Driver.TexImage2D(ctx, target, level, internalFormat,
- width, height, border, format,
- type, pixels, &ctx->Unpack, texObj,
- texImage);
- break;
- case 3:
- ctx->Driver.TexImage3D(ctx, target, level, internalFormat,
- width, height, depth, border, format,
- type, pixels, &ctx->Unpack, texObj,
- texImage);
- break;
- default:
- _mesa_problem(ctx, "invalid dims=%u in teximage()", dims);
- }
-
- check_gen_mipmap(ctx, target, texObj, level);
-
- update_fbo_texture(ctx, texObj, face, level);
-
- /* state update */
- texObj->_Complete = GL_FALSE;
- ctx->NewState |= _NEW_TEXTURE;
- }
- else {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage%uD", dims);
- }
- }
- }
- _mesa_unlock_texture(ctx, texObj);
- }
-}
-
-
-/*
- * Called from the API. Note that width includes the border.
- */
-void GLAPIENTRY
-_mesa_TexImage1D( GLenum target, GLint level, GLint internalFormat,
- GLsizei width, GLint border, GLenum format,
- GLenum type, const GLvoid *pixels )
-{
- GET_CURRENT_CONTEXT(ctx);
- teximage(ctx, 1, target, level, internalFormat, width, 1, 1,
- border, format, type, pixels);
-}
-
-
-void GLAPIENTRY
-_mesa_TexImage2D( GLenum target, GLint level, GLint internalFormat,
- GLsizei width, GLsizei height, GLint border,
- GLenum format, GLenum type,
- const GLvoid *pixels )
-{
- GET_CURRENT_CONTEXT(ctx);
- teximage(ctx, 2, target, level, internalFormat, width, height, 1,
- border, format, type, pixels);
-}
-
-
-/*
- * Called by the API or display list executor.
- * Note that width and height include the border.
- */
-void GLAPIENTRY
-_mesa_TexImage3D( GLenum target, GLint level, GLint internalFormat,
- GLsizei width, GLsizei height, GLsizei depth,
- GLint border, GLenum format, GLenum type,
- const GLvoid *pixels )
-{
- GET_CURRENT_CONTEXT(ctx);
- teximage(ctx, 3, target, level, internalFormat, width, height, depth,
- border, format, type, pixels);
-}
-
-
-void GLAPIENTRY
-_mesa_TexImage3DEXT( GLenum target, GLint level, GLenum internalFormat,
- GLsizei width, GLsizei height, GLsizei depth,
- GLint border, GLenum format, GLenum type,
- const GLvoid *pixels )
-{
- _mesa_TexImage3D(target, level, (GLint) internalFormat, width, height,
- depth, border, format, type, pixels);
-}
-
-
-#if FEATURE_OES_EGL_image
-void GLAPIENTRY
-_mesa_EGLImageTargetTexture2DOES (GLenum target, GLeglImageOES image)
-{
- struct gl_texture_object *texObj;
- struct gl_texture_image *texImage;
- GET_CURRENT_CONTEXT(ctx);
- ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
-
- if (!ctx->Extensions.OES_EGL_image) {
- _mesa_error(ctx, GL_INVALID_OPERATION,
- "glEGLImageTargetTexture2DOES(unsupported)");
- return;
- }
-
- if (target != GL_TEXTURE_2D) {
- _mesa_error(ctx, GL_INVALID_ENUM,
- "glEGLImageTargetTexture2D(target=%d)", target);
- return;
- }
-
- if (ctx->NewState & _NEW_PIXEL)
- _mesa_update_state(ctx);
-
- texObj = _mesa_get_current_tex_object(ctx, target);
- _mesa_lock_texture(ctx, texObj);
-
- texImage = _mesa_get_tex_image(ctx, texObj, target, 0);
- if (!texImage) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "glEGLImageTargetTexture2D");
- } else {
- if (texImage->Data)
- ctx->Driver.FreeTexImageData( ctx, texImage );
-
- ASSERT(texImage->Data == NULL);
- ctx->Driver.EGLImageTargetTexture2D(ctx, target,
- texObj, texImage, image);
-
- /* state update */
- texObj->_Complete = GL_FALSE;
- ctx->NewState |= _NEW_TEXTURE;
- }
- _mesa_unlock_texture(ctx, texObj);
-
-}
-#endif
-
-
-
-/**
- * Implement all the glTexSubImage1/2/3D() functions.
- */
-static void
-texsubimage(struct gl_context *ctx, GLuint dims, GLenum target, GLint level,
- GLint xoffset, GLint yoffset, GLint zoffset,
- GLsizei width, GLsizei height, GLsizei depth,
- GLenum format, GLenum type, const GLvoid *pixels )
-{
- struct gl_texture_object *texObj;
- struct gl_texture_image *texImage;
-
- ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
-
- if (MESA_VERBOSE & (VERBOSE_API|VERBOSE_TEXTURE))
- _mesa_debug(ctx, "glTexSubImage%uD %s %d %d %d %d %d %d %d %s %s %p\n",
- dims,
- _mesa_lookup_enum_by_nr(target), level,
- xoffset, yoffset, zoffset, width, height, depth,
- _mesa_lookup_enum_by_nr(format),
- _mesa_lookup_enum_by_nr(type), pixels);
-
- /* check target (proxies not allowed) */
- if (!legal_texsubimage_target(ctx, dims, target)) {
- _mesa_error(ctx, GL_INVALID_ENUM, "glTexSubImage%uD(target=%s)",
- dims, _mesa_lookup_enum_by_nr(target));
- return;
- }
-
- if (ctx->NewState & _NEW_PIXEL)
- _mesa_update_state(ctx);
-
- if (subtexture_error_check(ctx, dims, target, level, xoffset, yoffset, zoffset,
- width, height, depth, format, type)) {
- return; /* error was detected */
- }
-
- texObj = _mesa_get_current_tex_object(ctx, target);
-
- _mesa_lock_texture(ctx, texObj);
- {
- texImage = _mesa_select_tex_image(ctx, texObj, target, level);
-
- if (subtexture_error_check2(ctx, dims, target, level,
- xoffset, yoffset, zoffset,
- width, height, depth,
- format, type, texImage)) {
- /* error was recorded */
- }
- else if (width > 0 && height > 0 && height > 0) {
- /* If we have a border, offset=-1 is legal. Bias by border width. */
- switch (dims) {
- case 3:
- zoffset += texImage->Border;
- /* fall-through */
- case 2:
- yoffset += texImage->Border;
- /* fall-through */
- case 1:
- xoffset += texImage->Border;
- }
-
- switch (dims) {
- case 1:
- ctx->Driver.TexSubImage1D(ctx, target, level,
- xoffset, width,
- format, type, pixels,
- &ctx->Unpack, texObj, texImage );
- break;
- case 2:
- ctx->Driver.TexSubImage2D(ctx, target, level,
- xoffset, yoffset, width, height,
- format, type, pixels,
- &ctx->Unpack, texObj, texImage );
- break;
- case 3:
- ctx->Driver.TexSubImage3D(ctx, target, level,
- xoffset, yoffset, zoffset,
- width, height, depth,
- format, type, pixels,
- &ctx->Unpack, texObj, texImage );
- break;
- default:
- _mesa_problem(ctx, "unexpected dims in subteximage()");
- }
-
- check_gen_mipmap(ctx, target, texObj, level);
-
- ctx->NewState |= _NEW_TEXTURE;
- }
- }
- _mesa_unlock_texture(ctx, texObj);
-}
-
-
-void GLAPIENTRY
-_mesa_TexSubImage1D( GLenum target, GLint level,
- GLint xoffset, GLsizei width,
- GLenum format, GLenum type,
- const GLvoid *pixels )
-{
- GET_CURRENT_CONTEXT(ctx);
- texsubimage(ctx, 1, target, level,
- xoffset, 0, 0,
- width, 1, 1,
- format, type, pixels);
-}
-
-
-void GLAPIENTRY
-_mesa_TexSubImage2D( GLenum target, GLint level,
- GLint xoffset, GLint yoffset,
- GLsizei width, GLsizei height,
- GLenum format, GLenum type,
- const GLvoid *pixels )
-{
- GET_CURRENT_CONTEXT(ctx);
- texsubimage(ctx, 2, target, level,
- xoffset, yoffset, 0,
- width, height, 1,
- format, type, pixels);
-}
-
-
-
-void GLAPIENTRY
-_mesa_TexSubImage3D( GLenum target, GLint level,
- GLint xoffset, GLint yoffset, GLint zoffset,
- GLsizei width, GLsizei height, GLsizei depth,
- GLenum format, GLenum type,
- const GLvoid *pixels )
-{
- GET_CURRENT_CONTEXT(ctx);
- texsubimage(ctx, 3, target, level,
- xoffset, yoffset, zoffset,
- width, height, depth,
- format, type, pixels);
-}
-
-
-
-/**
- * Implement the glCopyTexImage1/2D() functions.
- */
-static void
-copyteximage(struct gl_context *ctx, GLuint dims,
- GLenum target, GLint level, GLenum internalFormat,
- GLint x, GLint y, GLsizei width, GLsizei height, GLint border )
-{
- struct gl_texture_object *texObj;
- struct gl_texture_image *texImage;
- const GLuint face = _mesa_tex_target_to_face(target);
-
- ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
-
- if (MESA_VERBOSE & (VERBOSE_API|VERBOSE_TEXTURE))
- _mesa_debug(ctx, "glCopyTexImage%uD %s %d %s %d %d %d %d %d\n",
- dims,
- _mesa_lookup_enum_by_nr(target), level,
- _mesa_lookup_enum_by_nr(internalFormat),
- x, y, width, height, border);
-
- if (ctx->NewState & NEW_COPY_TEX_STATE)
- _mesa_update_state(ctx);
-
- if (copytexture_error_check(ctx, dims, target, level, internalFormat,
- width, height, border))
- return;
-
- texObj = _mesa_get_current_tex_object(ctx, target);
-
- _mesa_lock_texture(ctx, texObj);
- {
- texImage = _mesa_get_tex_image(ctx, texObj, target, level);
-
- if (!texImage) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyTexImage%uD", dims);
- }
- else {
- gl_format texFormat;
-
- if (texImage->Data) {
- ctx->Driver.FreeTexImageData( ctx, texImage );
- }
-
- ASSERT(texImage->Data == NULL);
-
- texFormat = _mesa_choose_texture_format(ctx, texObj, target, level,
- internalFormat, GL_NONE,
- GL_NONE);
-
- if (legal_texture_size(ctx, texFormat, width, height, 1)) {
- _mesa_init_teximage_fields(ctx, target, texImage, width, height, 1,
- border, internalFormat, texFormat);
-
- ASSERT(ctx->Driver.CopyTexImage2D);
- if (dims == 1)
- ctx->Driver.CopyTexImage1D(ctx, target, level, internalFormat,
- x, y, width, border);
- else
- ctx->Driver.CopyTexImage2D(ctx, target, level, internalFormat,
- x, y, width, height, border);
-
- check_gen_mipmap(ctx, target, texObj, level);
-
- update_fbo_texture(ctx, texObj, face, level);
-
- /* state update */
- texObj->_Complete = GL_FALSE;
- ctx->NewState |= _NEW_TEXTURE;
- }
- else {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyTexImage%uD", dims);
- }
- }
- }
- _mesa_unlock_texture(ctx, texObj);
-}
-
-
-
-void GLAPIENTRY
-_mesa_CopyTexImage1D( GLenum target, GLint level,
- GLenum internalFormat,
- GLint x, GLint y,
- GLsizei width, GLint border )
-{
- GET_CURRENT_CONTEXT(ctx);
- copyteximage(ctx, 1, target, level, internalFormat, x, y, width, 1, border);
-}
-
-
-
-void GLAPIENTRY
-_mesa_CopyTexImage2D( GLenum target, GLint level, GLenum internalFormat,
- GLint x, GLint y, GLsizei width, GLsizei height,
- GLint border )
-{
- GET_CURRENT_CONTEXT(ctx);
- copyteximage(ctx, 2, target, level, internalFormat,
- x, y, width, height, border);
-}
-
-
-
-/**
- * Implementation for glCopyTexSubImage1/2/3D() functions.
- */
-static void
-copytexsubimage(struct gl_context *ctx, GLuint dims, GLenum target, GLint level,
- GLint xoffset, GLint yoffset, GLint zoffset,
- GLint x, GLint y, GLsizei width, GLsizei height)
-{
- struct gl_texture_object *texObj;
- struct gl_texture_image *texImage;
-
- ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
-
- if (MESA_VERBOSE & (VERBOSE_API|VERBOSE_TEXTURE))
- _mesa_debug(ctx, "glCopyTexSubImage%uD %s %d %d %d %d %d %d %d %d\n",
- dims,
- _mesa_lookup_enum_by_nr(target),
- level, xoffset, yoffset, zoffset, x, y, width, height);
-
- if (ctx->NewState & NEW_COPY_TEX_STATE)
- _mesa_update_state(ctx);
-
- if (copytexsubimage_error_check1(ctx, dims, target, level))
- return;
-
- texObj = _mesa_get_current_tex_object(ctx, target);
-
- _mesa_lock_texture(ctx, texObj);
- {
- texImage = _mesa_select_tex_image(ctx, texObj, target, level);
-
- if (copytexsubimage_error_check2(ctx, dims, target, level, xoffset, yoffset,
- zoffset, width, height, texImage)) {
- /* error was recored */
- }
- else {
- /* If we have a border, offset=-1 is legal. Bias by border width. */
- switch (dims) {
- case 3:
- zoffset += texImage->Border;
- /* fall-through */
- case 2:
- yoffset += texImage->Border;
- /* fall-through */
- case 1:
- xoffset += texImage->Border;
- }
-
- if (_mesa_clip_copytexsubimage(ctx, &xoffset, &yoffset, &x, &y,
- &width, &height)) {
- switch (dims) {
- case 1:
- ctx->Driver.CopyTexSubImage1D(ctx, target, level,
- xoffset, x, y, width);
- break;
- case 2:
- ctx->Driver.CopyTexSubImage2D(ctx, target, level,
- xoffset, yoffset,
- x, y, width, height);
- break;
- case 3:
- ctx->Driver.CopyTexSubImage3D(ctx, target, level,
- xoffset, yoffset, zoffset,
- x, y, width, height);
- break;
- default:
- _mesa_problem(ctx, "bad dims in copytexsubimage()");
- }
-
- check_gen_mipmap(ctx, target, texObj, level);
-
- ctx->NewState |= _NEW_TEXTURE;
- }
- }
- }
- _mesa_unlock_texture(ctx, texObj);
-}
-
-
-void GLAPIENTRY
-_mesa_CopyTexSubImage1D( GLenum target, GLint level,
- GLint xoffset, GLint x, GLint y, GLsizei width )
-{
- GET_CURRENT_CONTEXT(ctx);
- copytexsubimage(ctx, 1, target, level, xoffset, 0, 0, x, y, width, 1);
-}
-
-
-
-void GLAPIENTRY
-_mesa_CopyTexSubImage2D( GLenum target, GLint level,
- GLint xoffset, GLint yoffset,
- GLint x, GLint y, GLsizei width, GLsizei height )
-{
- GET_CURRENT_CONTEXT(ctx);
- copytexsubimage(ctx, 2, target, level, xoffset, yoffset, 0, x, y,
- width, height);
-}
-
-
-
-void GLAPIENTRY
-_mesa_CopyTexSubImage3D( GLenum target, GLint level,
- GLint xoffset, GLint yoffset, GLint zoffset,
- GLint x, GLint y, GLsizei width, GLsizei height )
-{
- GET_CURRENT_CONTEXT(ctx);
- copytexsubimage(ctx, 3, target, level, xoffset, yoffset, zoffset,
- x, y, width, height);
-}
-
-
-
-
-/**********************************************************************/
-/****** Compressed Textures ******/
-/**********************************************************************/
-
-
-/**
- * Return expected size of a compressed texture.
- */
-static GLuint
-compressed_tex_size(GLsizei width, GLsizei height, GLsizei depth,
- GLenum glformat)
-{
- gl_format mesaFormat = _mesa_glenum_to_compressed_format(glformat);
- return _mesa_format_image_size(mesaFormat, width, height, depth);
-}
-
-
-/*
- * Return compressed texture block size, in pixels.
- */
-static void
-get_compressed_block_size(GLenum glformat, GLuint *bw, GLuint *bh)
-{
- gl_format mesaFormat = _mesa_glenum_to_compressed_format(glformat);
- _mesa_get_format_block_size(mesaFormat, bw, bh);
-}
-
-
-/**
- * Error checking for glCompressedTexImage[123]D().
- * \param reason returns reason for error, if any
- * \return error code or GL_NO_ERROR.
- */
-static GLenum
-compressed_texture_error_check(struct gl_context *ctx, GLint dimensions,
- GLenum target, GLint level,
- GLenum internalFormat, GLsizei width,
- GLsizei height, GLsizei depth, GLint border,
- GLsizei imageSize, char **reason)
-{
- const GLenum proxyTarget = get_proxy_target(target);
- const GLint maxLevels = _mesa_max_texture_levels(ctx, target);
- GLint expectedSize;
-
- *reason = ""; /* no error */
-
- /* check level */
- if (level < 0 || level >= maxLevels) {
- *reason = "level";
- return GL_INVALID_VALUE;
- }
-
- if (!target_can_be_compressed(ctx, target, internalFormat)) {
- *reason = "target";
- return GL_INVALID_ENUM;
- }
-
- /* This will detect any invalid internalFormat value */
- if (!_mesa_is_compressed_format(ctx, internalFormat)) {
- *reason = "internalFormat";
- return GL_INVALID_ENUM;
- }
-
- /* This should really never fail */
- if (_mesa_base_tex_format(ctx, internalFormat) < 0) {
- *reason = "internalFormat";
- return GL_INVALID_ENUM;
- }
-
- /* No compressed formats support borders at this time */
- if (border != 0) {
- *reason = "border != 0";
- return GL_INVALID_VALUE;
- }
-
- /* For cube map, width must equal height */
- if (target >= GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB &&
- target <= GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB && width != height) {
- *reason = "width != height";
- return GL_INVALID_VALUE;
- }
-
- /* check image size against compression block size */
- {
- gl_format texFormat =
- ctx->Driver.ChooseTextureFormat(ctx, internalFormat,
- GL_NONE, GL_NONE);
- GLuint bw, bh;
-
- _mesa_get_format_block_size(texFormat, &bw, &bh);
- if ((width > bw && width % bw > 0) ||
- (height > bh && height % bh > 0)) {
- /*
- * Per GL_ARB_texture_compression: GL_INVALID_OPERATION is
- * generated [...] if any parameter combinations are not
- * supported by the specific compressed internal format.
- */
- *reason = "invalid width or height for compression format";
- return GL_INVALID_OPERATION;
- }
- }
-
- /* check image sizes */
- if (!ctx->Driver.TestProxyTexImage(ctx, proxyTarget, level,
- internalFormat, GL_NONE, GL_NONE,
- width, height, depth, border)) {
- /* See error comment above */
- *reason = "invalid width, height or format";
- return GL_INVALID_OPERATION;
- }
-
- /* check image size in bytes */
- expectedSize = compressed_tex_size(width, height, depth, internalFormat);
- if (expectedSize != imageSize) {
- /* Per GL_ARB_texture_compression: GL_INVALID_VALUE is generated [...]
- * if <imageSize> is not consistent with the format, dimensions, and
- * contents of the specified image.
- */
- *reason = "imageSize inconsistant with width/height/format";
- return GL_INVALID_VALUE;
- }
-
- return GL_NO_ERROR;
-}
-
-
-/**
- * Error checking for glCompressedTexSubImage[123]D().
- * \warning There are some bad assumptions here about the size of compressed
- * texture tiles (multiple of 4) used to test the validity of the
- * offset and size parameters.
- * \return error code or GL_NO_ERROR.
- */
-static GLenum
-compressed_subtexture_error_check(struct gl_context *ctx, GLint dimensions,
- GLenum target, GLint level,
- GLint xoffset, GLint yoffset, GLint zoffset,
- GLsizei width, GLsizei height, GLsizei depth,
- GLenum format, GLsizei imageSize)
-{
- GLint expectedSize, maxLevels = 0, maxTextureSize;
- GLuint bw, bh;
- (void) zoffset;
-
- if (dimensions == 1) {
- /* 1D compressed textures not allowed */
- return GL_INVALID_ENUM;
- }
- else if (dimensions == 2) {
- if (target == GL_PROXY_TEXTURE_2D) {
- maxLevels = ctx->Const.MaxTextureLevels;
- }
- else if (target == GL_TEXTURE_2D) {
- maxLevels = ctx->Const.MaxTextureLevels;
- }
- else if (target == GL_PROXY_TEXTURE_CUBE_MAP_ARB) {
- if (!ctx->Extensions.ARB_texture_cube_map)
- return GL_INVALID_ENUM; /*target*/
- maxLevels = ctx->Const.MaxCubeTextureLevels;
- }
- else if (target >= GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB &&
- target <= GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB) {
- if (!ctx->Extensions.ARB_texture_cube_map)
- return GL_INVALID_ENUM; /*target*/
- maxLevels = ctx->Const.MaxCubeTextureLevels;
- }
- else {
- return GL_INVALID_ENUM; /*target*/
- }
- }
- else if (dimensions == 3) {
- /* 3D compressed textures not allowed */
- return GL_INVALID_ENUM;
- }
-
- maxTextureSize = 1 << (maxLevels - 1);
-
- /* this will catch any invalid compressed format token */
- if (!_mesa_is_compressed_format(ctx, format))
- return GL_INVALID_ENUM;
-
- if (width < 1 || width > maxTextureSize)
- return GL_INVALID_VALUE;
-
- if ((height < 1 || height > maxTextureSize)
- && dimensions > 1)
- return GL_INVALID_VALUE;
-
- if (level < 0 || level >= maxLevels)
- return GL_INVALID_VALUE;
-
- /*
- * do checks which depend on compression block size
- */
- get_compressed_block_size(format, &bw, &bh);
-
- if ((xoffset % bw != 0) || (yoffset % bh != 0))
- return GL_INVALID_VALUE;
-
- if ((width % bw != 0) && width != 2 && width != 1)
- return GL_INVALID_VALUE;
-
- if ((height % bh != 0) && height != 2 && height != 1)
- return GL_INVALID_VALUE;
-
- expectedSize = compressed_tex_size(width, height, depth, format);
- if (expectedSize != imageSize)
- return GL_INVALID_VALUE;
-
- return GL_NO_ERROR;
-}
-
-
-/**
- * Do second part of glCompressedTexSubImage error checking.
- * \return GL_TRUE if error found, GL_FALSE otherwise.
- */
-static GLboolean
-compressed_subtexture_error_check2(struct gl_context *ctx, GLuint dims,
- GLsizei width, GLsizei height,
- GLsizei depth, GLenum format,
- struct gl_texture_image *texImage)
-{
-
- if ((GLint) format != texImage->InternalFormat) {
- _mesa_error(ctx, GL_INVALID_OPERATION,
- "glCompressedTexSubImage%uD(format=0x%x)", dims, format);
- return GL_TRUE;
- }
-
- if (((width == 1 || width == 2) &&
- width != (GLsizei) texImage->Width) ||
- (width > (GLsizei) texImage->Width)) {
- _mesa_error(ctx, GL_INVALID_VALUE,
- "glCompressedTexSubImage%uD(width=%d)", dims, width);
- return GL_TRUE;
- }
-
- if (dims >= 2) {
- if (((height == 1 || height == 2) &&
- height != (GLsizei) texImage->Height) ||
- (height > (GLsizei) texImage->Height)) {
- _mesa_error(ctx, GL_INVALID_VALUE,
- "glCompressedTexSubImage%uD(height=%d)", dims, height);
- return GL_TRUE;
- }
- }
-
- if (dims >= 3) {
- if (((depth == 1 || depth == 2) &&
- depth != (GLsizei) texImage->Depth) ||
- (depth > (GLsizei) texImage->Depth)) {
- _mesa_error(ctx, GL_INVALID_VALUE,
- "glCompressedTexSubImage%uD(depth=%d)", dims, depth);
- return GL_TRUE;
- }
- }
-
- return GL_FALSE;
-}
-
-
-/**
- * Implementation of the glCompressedTexImage1/2/3D() functions.
- */
-static void
-compressedteximage(struct gl_context *ctx, GLuint dims,
- GLenum target, GLint level,
- GLenum internalFormat, GLsizei width,
- GLsizei height, GLsizei depth, GLint border,
- GLsizei imageSize, const GLvoid *data)
-{
- GLenum error;
- char *reason = "";
-
- ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
-
- if (MESA_VERBOSE & (VERBOSE_API|VERBOSE_TEXTURE))
- _mesa_debug(ctx,
- "glCompressedTexImage%uDARB %s %d %s %d %d %d %d %d %p\n",
- dims,
- _mesa_lookup_enum_by_nr(target), level,
- _mesa_lookup_enum_by_nr(internalFormat),
- width, height, depth, border, imageSize, data);
-
- /* check target */
- if (!legal_teximage_target(ctx, dims, target)) {
- _mesa_error(ctx, GL_INVALID_ENUM, "glCompressedTexImage%uD(target=%s)",
- dims, _mesa_lookup_enum_by_nr(target));
- return;
- }
-
- error = compressed_texture_error_check(ctx, dims, target, level,
- internalFormat, width, height, depth,
- border, imageSize, &reason);
-
- if (error) {
- _mesa_error(ctx, error, "glTexImage2D(%s)", reason);
- return;
- }
-
-#if FEATURE_ES
- /* XXX this is kind of a hack */
- if (dims == 2) {
- switch (internalFormat) {
- case GL_PALETTE4_RGB8_OES:
- case GL_PALETTE4_RGBA8_OES:
- case GL_PALETTE4_R5_G6_B5_OES:
- case GL_PALETTE4_RGBA4_OES:
- case GL_PALETTE4_RGB5_A1_OES:
- case GL_PALETTE8_RGB8_OES:
- case GL_PALETTE8_RGBA8_OES:
- case GL_PALETTE8_R5_G6_B5_OES:
- case GL_PALETTE8_RGBA4_OES:
- case GL_PALETTE8_RGB5_A1_OES:
- _mesa_cpal_compressed_teximage2d(target, level, internalFormat,
- width, height, imageSize, data);
- return;
- }
- }
-#endif
-
- if (_mesa_is_proxy_texture(target)) {
- /* Proxy texture: just check for errors and update proxy state */
- struct gl_texture_image *texImage;
-
- if (!error) {
- struct gl_texture_object *texObj =
- _mesa_get_current_tex_object(ctx, target);
- gl_format texFormat =
- _mesa_choose_texture_format(ctx, texObj, target, level,
- internalFormat, GL_NONE, GL_NONE);
- if (!legal_texture_size(ctx, texFormat, width, height, depth)) {
- error = GL_OUT_OF_MEMORY;
- }
- }
-
- texImage = _mesa_get_proxy_tex_image(ctx, target, level);
- if (texImage) {
- if (error) {
- /* if error, clear all proxy texture image parameters */
- clear_teximage_fields(texImage);
- }
- else {
- /* no error: store the teximage parameters */
- _mesa_init_teximage_fields(ctx, target, texImage, width, height,
- depth, border, internalFormat,
- MESA_FORMAT_NONE);
- }
- }
- }
- else {
- /* non-proxy target */
- struct gl_texture_object *texObj;
- struct gl_texture_image *texImage;
-
- if (error) {
- _mesa_error(ctx, error, "glCompressedTexImage%uD", dims);
- return;
- }
-
- texObj = _mesa_get_current_tex_object(ctx, target);
-
- _mesa_lock_texture(ctx, texObj);
- {
- texImage = _mesa_get_tex_image(ctx, texObj, target, level);
- if (!texImage) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY,
- "glCompressedTexImage%uD", dims);
- }
- else {
- gl_format texFormat;
-
- if (texImage->Data) {
- ctx->Driver.FreeTexImageData( ctx, texImage );
- }
- ASSERT(texImage->Data == NULL);
-
- texFormat = _mesa_choose_texture_format(ctx, texObj, target, level,
- internalFormat, GL_NONE,
- GL_NONE);
-
- if (legal_texture_size(ctx, texFormat, width, height, depth)) {
- _mesa_init_teximage_fields(ctx, target, texImage,
- width, height, depth,
- border, internalFormat, texFormat);
-
- switch (dims) {
- case 1:
- ASSERT(ctx->Driver.CompressedTexImage1D);
- ctx->Driver.CompressedTexImage1D(ctx, target, level,
- internalFormat,
- width,
- border, imageSize, data,
- texObj, texImage);
- break;
- case 2:
- ASSERT(ctx->Driver.CompressedTexImage2D);
- ctx->Driver.CompressedTexImage2D(ctx, target, level,
- internalFormat,
- width, height,
- border, imageSize, data,
- texObj, texImage);
- break;
- case 3:
- ASSERT(ctx->Driver.CompressedTexImage3D);
- ctx->Driver.CompressedTexImage3D(ctx, target, level,
- internalFormat,
- width, height, depth,
- border, imageSize, data,
- texObj, texImage);
- break;
- default:
- _mesa_problem(ctx, "bad dims in compressedteximage");
- }
-
- check_gen_mipmap(ctx, target, texObj, level);
-
- /* state update */
- texObj->_Complete = GL_FALSE;
- ctx->NewState |= _NEW_TEXTURE;
- }
- else {
- _mesa_error(ctx, GL_OUT_OF_MEMORY,
- "glCompressedTexImage%uD", dims);
- }
- }
- }
- _mesa_unlock_texture(ctx, texObj);
- }
-}
-
-
-void GLAPIENTRY
-_mesa_CompressedTexImage1DARB(GLenum target, GLint level,
- GLenum internalFormat, GLsizei width,
- GLint border, GLsizei imageSize,
- const GLvoid *data)
-{
- GET_CURRENT_CONTEXT(ctx);
- compressedteximage(ctx, 1, target, level, internalFormat,
- width, 1, 1, border, imageSize, data);
-}
-
-
-void GLAPIENTRY
-_mesa_CompressedTexImage2DARB(GLenum target, GLint level,
- GLenum internalFormat, GLsizei width,
- GLsizei height, GLint border, GLsizei imageSize,
- const GLvoid *data)
-{
- GET_CURRENT_CONTEXT(ctx);
- compressedteximage(ctx, 2, target, level, internalFormat,
- width, height, 1, border, imageSize, data);
-}
-
-
-void GLAPIENTRY
-_mesa_CompressedTexImage3DARB(GLenum target, GLint level,
- GLenum internalFormat, GLsizei width,
- GLsizei height, GLsizei depth, GLint border,
- GLsizei imageSize, const GLvoid *data)
-{
- GET_CURRENT_CONTEXT(ctx);
- compressedteximage(ctx, 3, target, level, internalFormat,
- width, height, depth, border, imageSize, data);
-}
-
-
-/**
- * Common helper for glCompressedTexSubImage1/2/3D().
- */
-static void
-compressed_tex_sub_image(GLuint dims, GLenum target, GLint level,
- GLint xoffset, GLint yoffset, GLint zoffset,
- GLsizei width, GLsizei height, GLsizei depth,
- GLenum format, GLsizei imageSize, const GLvoid *data)
-{
- struct gl_texture_object *texObj;
- struct gl_texture_image *texImage;
- GLenum error;
- GET_CURRENT_CONTEXT(ctx);
- ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
-
- error = compressed_subtexture_error_check(ctx, dims, target, level,
- xoffset, 0, 0, /* pos */
- width, height, depth, /* size */
- format, imageSize);
- if (error) {
- _mesa_error(ctx, error, "glCompressedTexSubImage%uD", dims);
- return;
- }
-
- texObj = _mesa_get_current_tex_object(ctx, target);
-
- _mesa_lock_texture(ctx, texObj);
- {
- texImage = _mesa_select_tex_image(ctx, texObj, target, level);
- assert(texImage);
-
- if (compressed_subtexture_error_check2(ctx, dims, width, height, depth,
- format, texImage)) {
- /* error was recorded */
- }
- else if (width > 0 && height > 0 && depth > 0) {
- switch (dims) {
- case 1:
- if (ctx->Driver.CompressedTexSubImage1D) {
- ctx->Driver.CompressedTexSubImage1D(ctx, target, level,
- xoffset, width,
- format, imageSize, data,
- texObj, texImage);
- }
- break;
- case 2:
- if (ctx->Driver.CompressedTexSubImage2D) {
- ctx->Driver.CompressedTexSubImage2D(ctx, target, level,
- xoffset, yoffset,
- width, height,
- format, imageSize, data,
- texObj, texImage);
- }
- break;
- case 3:
- if (ctx->Driver.CompressedTexSubImage3D) {
- ctx->Driver.CompressedTexSubImage3D(ctx, target, level,
- xoffset, yoffset, zoffset,
- width, height, depth,
- format, imageSize, data,
- texObj, texImage);
- }
- break;
- default:
- ;
- }
-
- check_gen_mipmap(ctx, target, texObj, level);
-
- ctx->NewState |= _NEW_TEXTURE;
- }
- }
- _mesa_unlock_texture(ctx, texObj);
-}
-
-
-void GLAPIENTRY
-_mesa_CompressedTexSubImage1DARB(GLenum target, GLint level, GLint xoffset,
- GLsizei width, GLenum format,
- GLsizei imageSize, const GLvoid *data)
-{
- compressed_tex_sub_image(1, target, level, xoffset, 0, 0, width, 1, 1,
- format, imageSize, data);
-}
-
-
-void GLAPIENTRY
-_mesa_CompressedTexSubImage2DARB(GLenum target, GLint level, GLint xoffset,
- GLint yoffset, GLsizei width, GLsizei height,
- GLenum format, GLsizei imageSize,
- const GLvoid *data)
-{
- compressed_tex_sub_image(2, target, level, xoffset, yoffset, 0,
- width, height, 1, format, imageSize, data);
-}
-
-
-void GLAPIENTRY
-_mesa_CompressedTexSubImage3DARB(GLenum target, GLint level, GLint xoffset,
- GLint yoffset, GLint zoffset, GLsizei width,
- GLsizei height, GLsizei depth, GLenum format,
- GLsizei imageSize, const GLvoid *data)
-{
- compressed_tex_sub_image(3, target, level, xoffset, yoffset, zoffset,
- width, height, depth, format, imageSize, data);
-}
-
-
-/**
- * Helper for glTexBuffer(). Check if internalFormat is legal. If so,
- * return the basic data type and number of components for the format.
- * \param return GL_TRUE if internalFormat is legal, GL_FALSE otherwise
- */
-static GLboolean
-get_sized_format_info(const struct gl_context *ctx, GLenum internalFormat,
- GLenum *datatype, GLuint *components)
-{
- switch (internalFormat) {
- case GL_ALPHA8:
- *datatype = GL_UNSIGNED_BYTE;
- *components = 1;
- break;
- case GL_ALPHA16:
- *datatype = GL_UNSIGNED_SHORT;
- *components = 1;
- break;
- case GL_ALPHA16F_ARB:
- *datatype = GL_HALF_FLOAT;
- *components = 1;
- break;
- case GL_ALPHA32F_ARB:
- *datatype = GL_FLOAT;
- *components = 1;
- break;
- case GL_ALPHA8I_EXT:
- *datatype = GL_BYTE;
- *components = 1;
- break;
- case GL_ALPHA16I_EXT:
- *datatype = GL_SHORT;
- *components = 1;
- break;
- case GL_ALPHA32I_EXT:
- *datatype = GL_INT;
- *components = 1;
- break;
- case GL_ALPHA8UI_EXT:
- *datatype = GL_UNSIGNED_BYTE;
- *components = 1;
- break;
- case GL_ALPHA16UI_EXT:
- *datatype = GL_UNSIGNED_SHORT;
- *components = 1;
- break;
- case GL_ALPHA32UI_EXT:
- *datatype = GL_UNSIGNED_INT;
- *components = 1;
- break;
- case GL_LUMINANCE8:
- *datatype = GL_UNSIGNED_BYTE;
- *components = 1;
- break;
- case GL_LUMINANCE16:
- *datatype = GL_UNSIGNED_SHORT;
- *components = 1;
- break;
- case GL_LUMINANCE16F_ARB:
- *datatype = GL_HALF_FLOAT;
- *components = 1;
- break;
- case GL_LUMINANCE32F_ARB:
- *datatype = GL_FLOAT;
- *components = 1;
- break;
- case GL_LUMINANCE8I_EXT:
- *datatype = GL_BYTE;
- *components = 1;
- break;
- case GL_LUMINANCE16I_EXT:
- *datatype = GL_SHORT;
- *components = 1;
- break;
- case GL_LUMINANCE32I_EXT:
- *datatype = GL_INT;
- *components = 1;
- break;
- case GL_LUMINANCE8UI_EXT:
- *datatype = GL_UNSIGNED_BYTE;
- *components = 1;
- break;
- case GL_LUMINANCE16UI_EXT:
- *datatype = GL_UNSIGNED_SHORT;
- *components = 1;
- break;
- case GL_LUMINANCE32UI_EXT:
- *datatype = GL_UNSIGNED_INT;
- *components = 1;
- break;
- case GL_LUMINANCE8_ALPHA8:
- *datatype = GL_UNSIGNED_BYTE;
- *components = 2;
- break;
- case GL_LUMINANCE16_ALPHA16:
- *datatype = GL_UNSIGNED_SHORT;
- *components = 2;
- break;
- case GL_LUMINANCE_ALPHA16F_ARB:
- *datatype = GL_HALF_FLOAT;
- *components = 2;
- break;
- case GL_LUMINANCE_ALPHA32F_ARB:
- *datatype = GL_FLOAT;
- *components = 2;
- break;
- case GL_LUMINANCE_ALPHA8I_EXT:
- *datatype = GL_BYTE;
- *components = 2;
- break;
- case GL_LUMINANCE_ALPHA16I_EXT:
- *datatype = GL_SHORT;
- *components = 2;
- break;
- case GL_LUMINANCE_ALPHA32I_EXT:
- *datatype = GL_INT;
- *components = 2;
- break;
- case GL_LUMINANCE_ALPHA8UI_EXT:
- *datatype = GL_UNSIGNED_BYTE;
- *components = 2;
- break;
- case GL_LUMINANCE_ALPHA16UI_EXT:
- *datatype = GL_UNSIGNED_SHORT;
- *components = 2;
- break;
- case GL_LUMINANCE_ALPHA32UI_EXT:
- *datatype = GL_UNSIGNED_INT;
- *components = 2;
- break;
- case GL_INTENSITY8:
- *datatype = GL_UNSIGNED_BYTE;
- *components = 1;
- break;
- case GL_INTENSITY16:
- *datatype = GL_UNSIGNED_SHORT;
- *components = 1;
- break;
- case GL_INTENSITY16F_ARB:
- *datatype = GL_HALF_FLOAT;
- *components = 1;
- break;
- case GL_INTENSITY32F_ARB:
- *datatype = GL_FLOAT;
- *components = 1;
- break;
- case GL_INTENSITY8I_EXT:
- *datatype = GL_BYTE;
- *components = 1;
- break;
- case GL_INTENSITY16I_EXT:
- *datatype = GL_SHORT;
- *components = 1;
- break;
- case GL_INTENSITY32I_EXT:
- *datatype = GL_INT;
- *components = 1;
- break;
- case GL_INTENSITY8UI_EXT:
- *datatype = GL_UNSIGNED_BYTE;
- *components = 1;
- break;
- case GL_INTENSITY16UI_EXT:
- *datatype = GL_UNSIGNED_SHORT;
- *components = 1;
- break;
- case GL_INTENSITY32UI_EXT:
- *datatype = GL_UNSIGNED_INT;
- *components = 1;
- break;
- case GL_RGBA8:
- *datatype = GL_UNSIGNED_BYTE;
- *components = 4;
- break;
- case GL_RGBA16:
- *datatype = GL_UNSIGNED_SHORT;
- *components = 4;
- break;
- case GL_RGBA16F_ARB:
- *datatype = GL_HALF_FLOAT;
- *components = 4;
- break;
- case GL_RGBA32F_ARB:
- *datatype = GL_FLOAT;
- *components = 4;
- break;
- case GL_RGBA8I_EXT:
- *datatype = GL_BYTE;
- *components = 4;
- break;
- case GL_RGBA16I_EXT:
- *datatype = GL_SHORT;
- *components = 4;
- break;
- case GL_RGBA32I_EXT:
- *datatype = GL_INT;
- *components = 4;
- break;
- case GL_RGBA8UI_EXT:
- *datatype = GL_UNSIGNED_BYTE;
- *components = 4;
- break;
- case GL_RGBA16UI_EXT:
- *datatype = GL_UNSIGNED_SHORT;
- *components = 4;
- break;
- case GL_RGBA32UI_EXT:
- *datatype = GL_UNSIGNED_INT;
- *components = 4;
- break;
- default:
- return GL_FALSE;
- }
-
- if (*datatype == GL_FLOAT && !ctx->Extensions.ARB_texture_float)
- return GL_FALSE;
-
- if (*datatype == GL_HALF_FLOAT && !ctx->Extensions.ARB_half_float_pixel)
- return GL_FALSE;
-
- return GL_TRUE;
-}
-
-
-/** GL_ARB_texture_buffer_object */
-void GLAPIENTRY
-_mesa_TexBuffer(GLenum target, GLenum internalFormat, GLuint buffer)
-{
- struct gl_texture_object *texObj;
- struct gl_buffer_object *bufObj;
- GLenum dataType;
- GLuint comps;
-
- GET_CURRENT_CONTEXT(ctx);
- ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
-
- if (!ctx->Extensions.ARB_texture_buffer_object) {
- _mesa_error(ctx, GL_INVALID_OPERATION, "glTexBuffer");
- return;
- }
-
- if (target != GL_TEXTURE_BUFFER_ARB) {
- _mesa_error(ctx, GL_INVALID_ENUM, "glTexBuffer(target)");
- return;
- }
-
- if (!get_sized_format_info(ctx, internalFormat, &dataType, &comps)) {
- _mesa_error(ctx, GL_INVALID_ENUM, "glTexBuffer(internalFormat 0x%x)",
- internalFormat);
- return;
- }
-
- bufObj = _mesa_lookup_bufferobj(ctx, buffer);
- if (buffer && !bufObj) {
- _mesa_error(ctx, GL_INVALID_OPERATION, "glTexBuffer(buffer %u)", buffer);
- return;
- }
-
- texObj = _mesa_get_current_tex_object(ctx, target);
-
- _mesa_lock_texture(ctx, texObj);
- {
- _mesa_reference_buffer_object(ctx, &texObj->BufferObject, bufObj);
- texObj->BufferObjectFormat = internalFormat;
- }
- _mesa_unlock_texture(ctx, texObj);
-}
+/*
+ * mesa 3-D graphics library
+ * Version: 7.6
+ *
+ * Copyright (C) 1999-2008 Brian Paul All Rights Reserved.
+ * Copyright (C) 2009 VMware, Inc. All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+
+/**
+ * \file teximage.c
+ * Texture image-related functions.
+ */
+
+
+#include "glheader.h"
+#include "bufferobj.h"
+#include "context.h"
+#include "enums.h"
+#include "fbobject.h"
+#include "framebuffer.h"
+#include "hash.h"
+#include "image.h"
+#include "imports.h"
+#include "macros.h"
+#include "mfeatures.h"
+#include "state.h"
+#include "texcompress.h"
+#include "texfetch.h"
+#include "teximage.h"
+#include "texstate.h"
+#include "texpal.h"
+#include "mtypes.h"
+
+
+/**
+ * State changes which we care about for glCopyTex[Sub]Image() calls.
+ * In particular, we care about pixel transfer state and buffer state
+ * (such as glReadBuffer to make sure we read from the right renderbuffer).
+ */
+#define NEW_COPY_TEX_STATE (_NEW_BUFFERS | _NEW_PIXEL)
+
+
+
+/**
+ * We allocate texture memory on 512-byte boundaries so we can use MMX/SSE
+ * elsewhere.
+ */
+void *
+_mesa_alloc_texmemory(GLsizei bytes)
+{
+ return _mesa_align_malloc(bytes, 512);
+}
+
+
+/**
+ * Free texture memory allocated with _mesa_alloc_texmemory()
+ */
+void
+_mesa_free_texmemory(void *m)
+{
+ _mesa_align_free(m);
+}
+
+
+/*
+ * Compute floor(log_base_2(n)).
+ * If n < 0 return -1.
+ */
+static int
+logbase2( int n )
+{
+ GLint i = 1;
+ GLint log2 = 0;
+
+ if (n < 0)
+ return -1;
+
+ if (n == 0)
+ return 0;
+
+ while ( n > i ) {
+ i *= 2;
+ log2++;
+ }
+ if (i != n) {
+ return log2 - 1;
+ }
+ else {
+ return log2;
+ }
+}
+
+
+
+/**
+ * Return the simple base format for a given internal texture format.
+ * For example, given GL_LUMINANCE12_ALPHA4, return GL_LUMINANCE_ALPHA.
+ *
+ * \param ctx GL context.
+ * \param internalFormat the internal texture format token or 1, 2, 3, or 4.
+ *
+ * \return the corresponding \u base internal format (GL_ALPHA, GL_LUMINANCE,
+ * GL_LUMANCE_ALPHA, GL_INTENSITY, GL_RGB, or GL_RGBA), or -1 if invalid enum.
+ *
+ * This is the format which is used during texture application (i.e. the
+ * texture format and env mode determine the arithmetic used.
+ *
+ * XXX this could be static
+ */
+GLint
+_mesa_base_tex_format( struct gl_context *ctx, GLint internalFormat )
+{
+ switch (internalFormat) {
+ case GL_ALPHA:
+ case GL_ALPHA4:
+ case GL_ALPHA8:
+ case GL_ALPHA12:
+ case GL_ALPHA16:
+ return GL_ALPHA;
+ case 1:
+ case GL_LUMINANCE:
+ case GL_LUMINANCE4:
+ case GL_LUMINANCE8:
+ case GL_LUMINANCE12:
+ case GL_LUMINANCE16:
+ return GL_LUMINANCE;
+ case 2:
+ case GL_LUMINANCE_ALPHA:
+ case GL_LUMINANCE4_ALPHA4:
+ case GL_LUMINANCE6_ALPHA2:
+ case GL_LUMINANCE8_ALPHA8:
+ case GL_LUMINANCE12_ALPHA4:
+ case GL_LUMINANCE12_ALPHA12:
+ case GL_LUMINANCE16_ALPHA16:
+ return GL_LUMINANCE_ALPHA;
+ case GL_INTENSITY:
+ case GL_INTENSITY4:
+ case GL_INTENSITY8:
+ case GL_INTENSITY12:
+ case GL_INTENSITY16:
+ return GL_INTENSITY;
+ case 3:
+ case GL_RGB:
+ case GL_R3_G3_B2:
+ case GL_RGB4:
+ case GL_RGB5:
+ case GL_RGB8:
+ case GL_RGB10:
+ case GL_RGB12:
+ case GL_RGB16:
+ return GL_RGB;
+ case 4:
+ case GL_RGBA:
+ case GL_RGBA2:
+ case GL_RGBA4:
+ case GL_RGB5_A1:
+ case GL_RGBA8:
+ case GL_RGB10_A2:
+ case GL_RGBA12:
+ case GL_RGBA16:
+ return GL_RGBA;
+ default:
+ ; /* fallthrough */
+ }
+
+ if (ctx->Extensions.EXT_texture_format_BGRA8888) {
+ switch (internalFormat) {
+ case GL_BGRA_EXT:
+ return GL_RGBA;
+ default:
+ ; /* fallthrough */
+ }
+ }
+
+ if (ctx->Extensions.EXT_paletted_texture) {
+ switch (internalFormat) {
+ case GL_COLOR_INDEX:
+ case GL_COLOR_INDEX1_EXT:
+ case GL_COLOR_INDEX2_EXT:
+ case GL_COLOR_INDEX4_EXT:
+ case GL_COLOR_INDEX8_EXT:
+ case GL_COLOR_INDEX12_EXT:
+ case GL_COLOR_INDEX16_EXT:
+ return GL_COLOR_INDEX;
+ default:
+ ; /* fallthrough */
+ }
+ }
+
+ if (ctx->Extensions.ARB_depth_texture) {
+ switch (internalFormat) {
+ case GL_DEPTH_COMPONENT:
+ case GL_DEPTH_COMPONENT16:
+ case GL_DEPTH_COMPONENT24:
+ case GL_DEPTH_COMPONENT32:
+ return GL_DEPTH_COMPONENT;
+ default:
+ ; /* fallthrough */
+ }
+ }
+
+ switch (internalFormat) {
+ case GL_COMPRESSED_ALPHA:
+ return GL_ALPHA;
+ case GL_COMPRESSED_LUMINANCE:
+ return GL_LUMINANCE;
+ case GL_COMPRESSED_LUMINANCE_ALPHA:
+ return GL_LUMINANCE_ALPHA;
+ case GL_COMPRESSED_INTENSITY:
+ return GL_INTENSITY;
+ case GL_COMPRESSED_RGB:
+ return GL_RGB;
+ case GL_COMPRESSED_RGBA:
+ return GL_RGBA;
+ default:
+ ; /* fallthrough */
+ }
+
+ if (ctx->Extensions.TDFX_texture_compression_FXT1) {
+ switch (internalFormat) {
+ case GL_COMPRESSED_RGB_FXT1_3DFX:
+ return GL_RGB;
+ case GL_COMPRESSED_RGBA_FXT1_3DFX:
+ return GL_RGBA;
+ default:
+ ; /* fallthrough */
+ }
+ }
+
+ if (ctx->Extensions.EXT_texture_compression_s3tc) {
+ switch (internalFormat) {
+ case GL_COMPRESSED_RGB_S3TC_DXT1_EXT:
+ return GL_RGB;
+ case GL_COMPRESSED_RGBA_S3TC_DXT1_EXT:
+ case GL_COMPRESSED_RGBA_S3TC_DXT3_EXT:
+ case GL_COMPRESSED_RGBA_S3TC_DXT5_EXT:
+ return GL_RGBA;
+ default:
+ ; /* fallthrough */
+ }
+ }
+
+ if (ctx->Extensions.S3_s3tc) {
+ switch (internalFormat) {
+ case GL_RGB_S3TC:
+ case GL_RGB4_S3TC:
+ return GL_RGB;
+ case GL_RGBA_S3TC:
+ case GL_RGBA4_S3TC:
+ return GL_RGBA;
+ default:
+ ; /* fallthrough */
+ }
+ }
+
+ if (ctx->Extensions.MESA_ycbcr_texture) {
+ if (internalFormat == GL_YCBCR_MESA)
+ return GL_YCBCR_MESA;
+ }
+
+ if (ctx->Extensions.ARB_texture_float) {
+ switch (internalFormat) {
+ case GL_ALPHA16F_ARB:
+ case GL_ALPHA32F_ARB:
+ return GL_ALPHA;
+ case GL_RGBA16F_ARB:
+ case GL_RGBA32F_ARB:
+ return GL_RGBA;
+ case GL_RGB16F_ARB:
+ case GL_RGB32F_ARB:
+ return GL_RGB;
+ case GL_INTENSITY16F_ARB:
+ case GL_INTENSITY32F_ARB:
+ return GL_INTENSITY;
+ case GL_LUMINANCE16F_ARB:
+ case GL_LUMINANCE32F_ARB:
+ return GL_LUMINANCE;
+ case GL_LUMINANCE_ALPHA16F_ARB:
+ case GL_LUMINANCE_ALPHA32F_ARB:
+ return GL_LUMINANCE_ALPHA;
+ default:
+ ; /* fallthrough */
+ }
+ }
+
+ if (ctx->Extensions.ATI_envmap_bumpmap) {
+ switch (internalFormat) {
+ case GL_DUDV_ATI:
+ case GL_DU8DV8_ATI:
+ return GL_DUDV_ATI;
+ default:
+ ; /* fallthrough */
+ }
+ }
+
+ if (ctx->Extensions.EXT_texture_snorm) {
+ switch (internalFormat) {
+ case GL_RED_SNORM:
+ case GL_R8_SNORM:
+ case GL_R16_SNORM:
+ return GL_RED;
+ case GL_RG_SNORM:
+ case GL_RG8_SNORM:
+ case GL_RG16_SNORM:
+ return GL_RG;
+ case GL_RGB_SNORM:
+ case GL_RGB8_SNORM:
+ case GL_RGB16_SNORM:
+ return GL_RGB;
+ case GL_RGBA_SNORM:
+ case GL_RGBA8_SNORM:
+ case GL_RGBA16_SNORM:
+ return GL_RGBA;
+ case GL_ALPHA_SNORM:
+ case GL_ALPHA8_SNORM:
+ case GL_ALPHA16_SNORM:
+ return GL_ALPHA;
+ case GL_LUMINANCE_SNORM:
+ case GL_LUMINANCE8_SNORM:
+ case GL_LUMINANCE16_SNORM:
+ return GL_LUMINANCE;
+ case GL_LUMINANCE_ALPHA_SNORM:
+ case GL_LUMINANCE8_ALPHA8_SNORM:
+ case GL_LUMINANCE16_ALPHA16_SNORM:
+ return GL_LUMINANCE_ALPHA;
+ case GL_INTENSITY_SNORM:
+ case GL_INTENSITY8_SNORM:
+ case GL_INTENSITY16_SNORM:
+ return GL_INTENSITY;
+ default:
+ ; /* fallthrough */
+ }
+ }
+
+ if (ctx->Extensions.EXT_packed_depth_stencil) {
+ switch (internalFormat) {
+ case GL_DEPTH_STENCIL_EXT:
+ case GL_DEPTH24_STENCIL8_EXT:
+ return GL_DEPTH_STENCIL_EXT;
+ default:
+ ; /* fallthrough */
+ }
+ }
+
+#if FEATURE_EXT_texture_sRGB
+ if (ctx->Extensions.EXT_texture_sRGB) {
+ switch (internalFormat) {
+ case GL_SRGB_EXT:
+ case GL_SRGB8_EXT:
+ case GL_COMPRESSED_SRGB_EXT:
+ case GL_COMPRESSED_SRGB_S3TC_DXT1_EXT:
+ return GL_RGB;
+ case GL_SRGB_ALPHA_EXT:
+ case GL_SRGB8_ALPHA8_EXT:
+ case GL_COMPRESSED_SRGB_ALPHA_EXT:
+ case GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT:
+ case GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT:
+ case GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT:
+ return GL_RGBA;
+ case GL_SLUMINANCE_ALPHA_EXT:
+ case GL_SLUMINANCE8_ALPHA8_EXT:
+ case GL_COMPRESSED_SLUMINANCE_ALPHA_EXT:
+ return GL_LUMINANCE_ALPHA;
+ case GL_SLUMINANCE_EXT:
+ case GL_SLUMINANCE8_EXT:
+ case GL_COMPRESSED_SLUMINANCE_EXT:
+ return GL_LUMINANCE;
+ default:
+ ; /* fallthrough */
+ }
+ }
+#endif /* FEATURE_EXT_texture_sRGB */
+
+ if (ctx->Extensions.EXT_texture_integer) {
+ switch (internalFormat) {
+ case GL_RGBA8UI_EXT:
+ case GL_RGBA16UI_EXT:
+ case GL_RGBA32UI_EXT:
+ case GL_RGBA8I_EXT:
+ case GL_RGBA16I_EXT:
+ case GL_RGBA32I_EXT:
+ return GL_RGBA;
+ case GL_RGB8UI_EXT:
+ case GL_RGB16UI_EXT:
+ case GL_RGB32UI_EXT:
+ case GL_RGB8I_EXT:
+ case GL_RGB16I_EXT:
+ case GL_RGB32I_EXT:
+ return GL_RGB;
+ case GL_ALPHA8UI_EXT:
+ case GL_ALPHA16UI_EXT:
+ case GL_ALPHA32UI_EXT:
+ case GL_ALPHA8I_EXT:
+ case GL_ALPHA16I_EXT:
+ case GL_ALPHA32I_EXT:
+ return GL_ALPHA;
+ case GL_INTENSITY8UI_EXT:
+ case GL_INTENSITY16UI_EXT:
+ case GL_INTENSITY32UI_EXT:
+ case GL_INTENSITY8I_EXT:
+ case GL_INTENSITY16I_EXT:
+ case GL_INTENSITY32I_EXT:
+ return GL_INTENSITY;
+ case GL_LUMINANCE8UI_EXT:
+ case GL_LUMINANCE16UI_EXT:
+ case GL_LUMINANCE32UI_EXT:
+ case GL_LUMINANCE8I_EXT:
+ case GL_LUMINANCE16I_EXT:
+ case GL_LUMINANCE32I_EXT:
+ return GL_LUMINANCE;
+ case GL_LUMINANCE_ALPHA8UI_EXT:
+ case GL_LUMINANCE_ALPHA16UI_EXT:
+ case GL_LUMINANCE_ALPHA32UI_EXT:
+ case GL_LUMINANCE_ALPHA8I_EXT:
+ case GL_LUMINANCE_ALPHA16I_EXT:
+ case GL_LUMINANCE_ALPHA32I_EXT:
+ return GL_LUMINANCE_ALPHA;
+ default:
+ ; /* fallthrough */
+ }
+ }
+
+ if (ctx->Extensions.ARB_texture_rg) {
+ switch (internalFormat) {
+ case GL_R16F:
+ /* R16F depends on both ARB_half_float_pixel and ARB_texture_float.
+ */
+ if (!ctx->Extensions.ARB_half_float_pixel)
+ break;
+ /* FALLTHROUGH */
+ case GL_R32F:
+ if (!ctx->Extensions.ARB_texture_float)
+ break;
+ return GL_RED;
+ case GL_R8I:
+ case GL_R8UI:
+ case GL_R16I:
+ case GL_R16UI:
+ case GL_R32I:
+ case GL_R32UI:
+ if (!ctx->Extensions.EXT_texture_integer)
+ break;
+ /* FALLTHROUGH */
+ case GL_R8:
+ case GL_R16:
+ case GL_RED:
+ case GL_COMPRESSED_RED:
+ return GL_RED;
+
+ case GL_RG16F:
+ /* RG16F depends on both ARB_half_float_pixel and ARB_texture_float.
+ */
+ if (!ctx->Extensions.ARB_half_float_pixel)
+ break;
+ /* FALLTHROUGH */
+ case GL_RG32F:
+ if (!ctx->Extensions.ARB_texture_float)
+ break;
+ return GL_RG;
+ case GL_RG8I:
+ case GL_RG8UI:
+ case GL_RG16I:
+ case GL_RG16UI:
+ case GL_RG32I:
+ case GL_RG32UI:
+ if (!ctx->Extensions.EXT_texture_integer)
+ break;
+ /* FALLTHROUGH */
+ case GL_RG:
+ case GL_RG8:
+ case GL_RG16:
+ case GL_COMPRESSED_RG:
+ return GL_RG;
+ default:
+ ; /* fallthrough */
+ }
+ }
+
+ if (ctx->Extensions.EXT_texture_shared_exponent) {
+ switch (internalFormat) {
+ case GL_RGB9_E5_EXT:
+ return GL_RGB;
+ default:
+ ; /* fallthrough */
+ }
+ }
+
+ if (ctx->Extensions.EXT_packed_float) {
+ switch (internalFormat) {
+ case GL_R11F_G11F_B10F_EXT:
+ return GL_RGB;
+ default:
+ ; /* fallthrough */
+ }
+ }
+
+ if (ctx->Extensions.ARB_depth_buffer_float) {
+ switch (internalFormat) {
+ case GL_DEPTH_COMPONENT32F:
+ return GL_DEPTH_COMPONENT;
+ case GL_DEPTH32F_STENCIL8:
+ return GL_DEPTH_STENCIL;
+ default:
+ ; /* fallthrough */
+ }
+ }
+
+ if (ctx->Extensions.ARB_texture_compression_rgtc) {
+ switch (internalFormat) {
+ case GL_COMPRESSED_RED_RGTC1:
+ case GL_COMPRESSED_SIGNED_RED_RGTC1:
+ return GL_RED;
+ case GL_COMPRESSED_RG_RGTC2:
+ case GL_COMPRESSED_SIGNED_RG_RGTC2:
+ return GL_RG;
+ default:
+ ; /* fallthrough */
+ }
+ }
+
+ if (ctx->Extensions.EXT_texture_compression_latc) {
+ switch (internalFormat) {
+ case GL_COMPRESSED_LUMINANCE_LATC1_EXT:
+ case GL_COMPRESSED_SIGNED_LUMINANCE_LATC1_EXT:
+ return GL_LUMINANCE;
+ case GL_COMPRESSED_LUMINANCE_ALPHA_LATC2_EXT:
+ case GL_COMPRESSED_SIGNED_LUMINANCE_ALPHA_LATC2_EXT:
+ return GL_LUMINANCE_ALPHA;
+ default:
+ ; /* fallthrough */
+ }
+ }
+
+ if (ctx->Extensions.ATI_texture_compression_3dc) {
+ switch (internalFormat) {
+ case GL_COMPRESSED_LUMINANCE_ALPHA_3DC_ATI:
+ return GL_LUMINANCE_ALPHA;
+ default:
+ ; /* fallthrough */
+ }
+ }
+
+ return -1; /* error */
+}
+
+
+/**
+ * For cube map faces, return a face index in [0,5].
+ * For other targets return 0;
+ */
+GLuint
+_mesa_tex_target_to_face(GLenum target)
+{
+ if (target >= GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB &&
+ target <= GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB)
+ return (GLuint) target - (GLuint) GL_TEXTURE_CUBE_MAP_POSITIVE_X;
+ else
+ return 0;
+}
+
+
+
+/**
+ * Store a gl_texture_image pointer in a gl_texture_object structure
+ * according to the target and level parameters.
+ *
+ * \param tObj texture object.
+ * \param target texture target.
+ * \param level image level.
+ * \param texImage texture image.
+ *
+ * This was basically prompted by the introduction of cube maps.
+ */
+void
+_mesa_set_tex_image(struct gl_texture_object *tObj,
+ GLenum target, GLint level,
+ struct gl_texture_image *texImage)
+{
+ const GLuint face = _mesa_tex_target_to_face(target);
+
+ ASSERT(tObj);
+ ASSERT(texImage);
+ ASSERT(target != GL_TEXTURE_RECTANGLE_NV || level == 0);
+
+ tObj->Image[face][level] = texImage;
+
+ /* Set the 'back' pointer */
+ texImage->TexObject = tObj;
+}
+
+
+/**
+ * Allocate a texture image structure.
+ *
+ * Called via ctx->Driver.NewTextureImage() unless overriden by a device
+ * driver.
+ *
+ * \return a pointer to gl_texture_image struct with all fields initialized to
+ * zero.
+ */
+struct gl_texture_image *
+_mesa_new_texture_image( struct gl_context *ctx )
+{
+ (void) ctx;
+ return CALLOC_STRUCT(gl_texture_image);
+}
+
+
+/**
+ * Free texture image data.
+ * This function is a fallback called via ctx->Driver.FreeTexImageData().
+ *
+ * \param texImage texture image.
+ *
+ * Free the texture image data if it's not marked as client data.
+ */
+void
+_mesa_free_texture_image_data(struct gl_context *ctx,
+ struct gl_texture_image *texImage)
+{
+ (void) ctx;
+
+ if (texImage->Data && !texImage->IsClientData) {
+ /* free the old texture data */
+ _mesa_free_texmemory(texImage->Data);
+ }
+
+ texImage->Data = NULL;
+}
+
+
+/**
+ * Free texture image.
+ *
+ * \param texImage texture image.
+ *
+ * Free the texture image structure and the associated image data.
+ */
+void
+_mesa_delete_texture_image(struct gl_context *ctx,
+ struct gl_texture_image *texImage)
+{
+ /* Free texImage->Data and/or any other driver-specific texture
+ * image storage.
+ */
+ ASSERT(ctx->Driver.FreeTexImageData);
+ ctx->Driver.FreeTexImageData( ctx, texImage );
+
+ ASSERT(texImage->Data == NULL);
+ if (texImage->ImageOffsets)
+ free(texImage->ImageOffsets);
+ free(texImage);
+}
+
+
+/**
+ * Test if a target is a proxy target.
+ *
+ * \param target texture target.
+ *
+ * \return GL_TRUE if the target is a proxy target, GL_FALSE otherwise.
+ */
+GLboolean
+_mesa_is_proxy_texture(GLenum target)
+{
+ /* NUM_TEXTURE_TARGETS should match number of terms below,
+ * except there's no proxy for GL_TEXTURE_BUFFER.
+ */
+ assert(NUM_TEXTURE_TARGETS == 8);
+
+ return (target == GL_PROXY_TEXTURE_1D ||
+ target == GL_PROXY_TEXTURE_2D ||
+ target == GL_PROXY_TEXTURE_3D ||
+ target == GL_PROXY_TEXTURE_CUBE_MAP_ARB ||
+ target == GL_PROXY_TEXTURE_RECTANGLE_NV ||
+ target == GL_PROXY_TEXTURE_1D_ARRAY_EXT ||
+ target == GL_PROXY_TEXTURE_2D_ARRAY_EXT);
+}
+
+
+/**
+ * Return the proxy target which corresponds to the given texture target
+ */
+static GLenum
+get_proxy_target(GLenum target)
+{
+ switch (target) {
+ case GL_TEXTURE_1D:
+ case GL_PROXY_TEXTURE_1D:
+ return GL_PROXY_TEXTURE_1D;
+ case GL_TEXTURE_2D:
+ case GL_PROXY_TEXTURE_2D:
+ return GL_PROXY_TEXTURE_2D;
+ case GL_TEXTURE_3D:
+ case GL_PROXY_TEXTURE_3D:
+ return GL_PROXY_TEXTURE_3D;
+ case GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB:
+ case GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB:
+ case GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB:
+ case GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB:
+ case GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB:
+ case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB:
+ case GL_TEXTURE_CUBE_MAP_ARB:
+ case GL_PROXY_TEXTURE_CUBE_MAP_ARB:
+ return GL_PROXY_TEXTURE_CUBE_MAP_ARB;
+ case GL_TEXTURE_RECTANGLE_NV:
+ case GL_PROXY_TEXTURE_RECTANGLE_NV:
+ return GL_PROXY_TEXTURE_RECTANGLE_NV;
+ case GL_TEXTURE_1D_ARRAY_EXT:
+ case GL_PROXY_TEXTURE_1D_ARRAY_EXT:
+ return GL_PROXY_TEXTURE_1D_ARRAY_EXT;
+ case GL_TEXTURE_2D_ARRAY_EXT:
+ case GL_PROXY_TEXTURE_2D_ARRAY_EXT:
+ return GL_PROXY_TEXTURE_2D_ARRAY_EXT;
+ default:
+ _mesa_problem(NULL, "unexpected target in get_proxy_target()");
+ return 0;
+ }
+}
+
+
+/**
+ * Get the texture object that corresponds to the target of the given
+ * texture unit.
+ *
+ * \param ctx GL context.
+ * \param texUnit texture unit.
+ * \param target texture target.
+ *
+ * \return pointer to the texture object on success, or NULL on failure.
+ *
+ * \sa gl_texture_unit.
+ */
+struct gl_texture_object *
+_mesa_select_tex_object(struct gl_context *ctx,
+ const struct gl_texture_unit *texUnit,
+ GLenum target)
+{
+ const GLboolean arrayTex = (ctx->Extensions.MESA_texture_array ||
+ ctx->Extensions.EXT_texture_array);
+
+ switch (target) {
+ case GL_TEXTURE_1D:
+ return texUnit->CurrentTex[TEXTURE_1D_INDEX];
+ case GL_PROXY_TEXTURE_1D:
+ return ctx->Texture.ProxyTex[TEXTURE_1D_INDEX];
+ case GL_TEXTURE_2D:
+ return texUnit->CurrentTex[TEXTURE_2D_INDEX];
+ case GL_PROXY_TEXTURE_2D:
+ return ctx->Texture.ProxyTex[TEXTURE_2D_INDEX];
+ case GL_TEXTURE_3D:
+ return texUnit->CurrentTex[TEXTURE_3D_INDEX];
+ case GL_PROXY_TEXTURE_3D:
+ return ctx->Texture.ProxyTex[TEXTURE_3D_INDEX];
+ case GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB:
+ case GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB:
+ case GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB:
+ case GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB:
+ case GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB:
+ case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB:
+ case GL_TEXTURE_CUBE_MAP_ARB:
+ return ctx->Extensions.ARB_texture_cube_map
+ ? texUnit->CurrentTex[TEXTURE_CUBE_INDEX] : NULL;
+ case GL_PROXY_TEXTURE_CUBE_MAP_ARB:
+ return ctx->Extensions.ARB_texture_cube_map
+ ? ctx->Texture.ProxyTex[TEXTURE_CUBE_INDEX] : NULL;
+ case GL_TEXTURE_RECTANGLE_NV:
+ return ctx->Extensions.NV_texture_rectangle
+ ? texUnit->CurrentTex[TEXTURE_RECT_INDEX] : NULL;
+ case GL_PROXY_TEXTURE_RECTANGLE_NV:
+ return ctx->Extensions.NV_texture_rectangle
+ ? ctx->Texture.ProxyTex[TEXTURE_RECT_INDEX] : NULL;
+ case GL_TEXTURE_1D_ARRAY_EXT:
+ return arrayTex ? texUnit->CurrentTex[TEXTURE_1D_ARRAY_INDEX] : NULL;
+ case GL_PROXY_TEXTURE_1D_ARRAY_EXT:
+ return arrayTex ? ctx->Texture.ProxyTex[TEXTURE_1D_ARRAY_INDEX] : NULL;
+ case GL_TEXTURE_2D_ARRAY_EXT:
+ return arrayTex ? texUnit->CurrentTex[TEXTURE_2D_ARRAY_INDEX] : NULL;
+ case GL_PROXY_TEXTURE_2D_ARRAY_EXT:
+ return arrayTex ? ctx->Texture.ProxyTex[TEXTURE_2D_ARRAY_INDEX] : NULL;
+ case GL_TEXTURE_BUFFER:
+ return ctx->Extensions.ARB_texture_buffer_object
+ ? texUnit->CurrentTex[TEXTURE_BUFFER_INDEX] : NULL;
+ default:
+ _mesa_problem(NULL, "bad target in _mesa_select_tex_object()");
+ return NULL;
+ }
+}
+
+
+/**
+ * Return pointer to texture object for given target on current texture unit.
+ */
+struct gl_texture_object *
+_mesa_get_current_tex_object(struct gl_context *ctx, GLenum target)
+{
+ struct gl_texture_unit *texUnit = _mesa_get_current_tex_unit(ctx);
+ return _mesa_select_tex_object(ctx, texUnit, target);
+}
+
+
+/**
+ * Get a texture image pointer from a texture object, given a texture
+ * target and mipmap level. The target and level parameters should
+ * have already been error-checked.
+ *
+ * \param ctx GL context.
+ * \param texObj texture unit.
+ * \param target texture target.
+ * \param level image level.
+ *
+ * \return pointer to the texture image structure, or NULL on failure.
+ */
+struct gl_texture_image *
+_mesa_select_tex_image(struct gl_context *ctx,
+ const struct gl_texture_object *texObj,
+ GLenum target, GLint level)
+{
+ const GLuint face = _mesa_tex_target_to_face(target);
+
+ ASSERT(texObj);
+ ASSERT(level >= 0);
+ ASSERT(level < MAX_TEXTURE_LEVELS);
+
+ return texObj->Image[face][level];
+}
+
+
+/**
+ * Like _mesa_select_tex_image() but if the image doesn't exist, allocate
+ * it and install it. Only return NULL if passed a bad parameter or run
+ * out of memory.
+ */
+struct gl_texture_image *
+_mesa_get_tex_image(struct gl_context *ctx, struct gl_texture_object *texObj,
+ GLenum target, GLint level)
+{
+ struct gl_texture_image *texImage;
+
+ if (!texObj)
+ return NULL;
+
+ texImage = _mesa_select_tex_image(ctx, texObj, target, level);
+ if (!texImage) {
+ texImage = ctx->Driver.NewTextureImage(ctx);
+ if (!texImage) {
+ _mesa_error(ctx, GL_OUT_OF_MEMORY, "texture image allocation");
+ return NULL;
+ }
+
+ _mesa_set_tex_image(texObj, target, level, texImage);
+ }
+
+ return texImage;
+}
+
+
+/**
+ * Return pointer to the specified proxy texture image.
+ * Note that proxy textures are per-context, not per-texture unit.
+ * \return pointer to texture image or NULL if invalid target, invalid
+ * level, or out of memory.
+ */
+struct gl_texture_image *
+_mesa_get_proxy_tex_image(struct gl_context *ctx, GLenum target, GLint level)
+{
+ struct gl_texture_image *texImage;
+ GLuint texIndex;
+
+ if (level < 0 )
+ return NULL;
+
+ switch (target) {
+ case GL_PROXY_TEXTURE_1D:
+ if (level >= ctx->Const.MaxTextureLevels)
+ return NULL;
+ texIndex = TEXTURE_1D_INDEX;
+ break;
+ case GL_PROXY_TEXTURE_2D:
+ if (level >= ctx->Const.MaxTextureLevels)
+ return NULL;
+ texIndex = TEXTURE_2D_INDEX;
+ break;
+ case GL_PROXY_TEXTURE_3D:
+ if (level >= ctx->Const.Max3DTextureLevels)
+ return NULL;
+ texIndex = TEXTURE_3D_INDEX;
+ break;
+ case GL_PROXY_TEXTURE_CUBE_MAP:
+ if (level >= ctx->Const.MaxCubeTextureLevels)
+ return NULL;
+ texIndex = TEXTURE_CUBE_INDEX;
+ break;
+ case GL_PROXY_TEXTURE_RECTANGLE_NV:
+ if (level > 0)
+ return NULL;
+ texIndex = TEXTURE_RECT_INDEX;
+ break;
+ case GL_PROXY_TEXTURE_1D_ARRAY_EXT:
+ if (level >= ctx->Const.MaxTextureLevels)
+ return NULL;
+ texIndex = TEXTURE_1D_ARRAY_INDEX;
+ break;
+ case GL_PROXY_TEXTURE_2D_ARRAY_EXT:
+ if (level >= ctx->Const.MaxTextureLevels)
+ return NULL;
+ texIndex = TEXTURE_2D_ARRAY_INDEX;
+ break;
+ default:
+ return NULL;
+ }
+
+ texImage = ctx->Texture.ProxyTex[texIndex]->Image[0][level];
+ if (!texImage) {
+ texImage = ctx->Driver.NewTextureImage(ctx);
+ if (!texImage) {
+ _mesa_error(ctx, GL_OUT_OF_MEMORY, "proxy texture allocation");
+ return NULL;
+ }
+ ctx->Texture.ProxyTex[texIndex]->Image[0][level] = texImage;
+ /* Set the 'back' pointer */
+ texImage->TexObject = ctx->Texture.ProxyTex[texIndex];
+ }
+ return texImage;
+}
+
+
+/**
+ * Get the maximum number of allowed mipmap levels.
+ *
+ * \param ctx GL context.
+ * \param target texture target.
+ *
+ * \return the maximum number of allowed mipmap levels for the given
+ * texture target, or zero if passed a bad target.
+ *
+ * \sa gl_constants.
+ */
+GLint
+_mesa_max_texture_levels(struct gl_context *ctx, GLenum target)
+{
+ switch (target) {
+ case GL_TEXTURE_1D:
+ case GL_PROXY_TEXTURE_1D:
+ case GL_TEXTURE_2D:
+ case GL_PROXY_TEXTURE_2D:
+ return ctx->Const.MaxTextureLevels;
+ case GL_TEXTURE_3D:
+ case GL_PROXY_TEXTURE_3D:
+ return ctx->Const.Max3DTextureLevels;
+ case GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB:
+ case GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB:
+ case GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB:
+ case GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB:
+ case GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB:
+ case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB:
+ case GL_TEXTURE_CUBE_MAP_ARB:
+ case GL_PROXY_TEXTURE_CUBE_MAP_ARB:
+ return ctx->Extensions.ARB_texture_cube_map
+ ? ctx->Const.MaxCubeTextureLevels : 0;
+ case GL_TEXTURE_RECTANGLE_NV:
+ case GL_PROXY_TEXTURE_RECTANGLE_NV:
+ return ctx->Extensions.NV_texture_rectangle ? 1 : 0;
+ case GL_TEXTURE_1D_ARRAY_EXT:
+ case GL_PROXY_TEXTURE_1D_ARRAY_EXT:
+ case GL_TEXTURE_2D_ARRAY_EXT:
+ case GL_PROXY_TEXTURE_2D_ARRAY_EXT:
+ return (ctx->Extensions.MESA_texture_array ||
+ ctx->Extensions.EXT_texture_array)
+ ? ctx->Const.MaxTextureLevels : 0;
+ case GL_TEXTURE_BUFFER:
+ /* fall-through */
+ default:
+ return 0; /* bad target */
+ }
+}
+
+
+/**
+ * Return number of dimensions per mipmap level for the given texture target.
+ */
+GLint
+_mesa_get_texture_dimensions(GLenum target)
+{
+ switch (target) {
+ case GL_TEXTURE_1D:
+ case GL_PROXY_TEXTURE_1D:
+ return 1;
+ case GL_TEXTURE_2D:
+ case GL_TEXTURE_RECTANGLE:
+ case GL_TEXTURE_CUBE_MAP:
+ case GL_PROXY_TEXTURE_2D:
+ case GL_PROXY_TEXTURE_RECTANGLE:
+ case GL_PROXY_TEXTURE_CUBE_MAP:
+ case GL_TEXTURE_CUBE_MAP_POSITIVE_X:
+ case GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
+ case GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
+ case GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
+ case GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
+ case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
+ case GL_TEXTURE_1D_ARRAY:
+ case GL_PROXY_TEXTURE_1D_ARRAY:
+ return 2;
+ case GL_TEXTURE_3D:
+ case GL_PROXY_TEXTURE_3D:
+ case GL_TEXTURE_2D_ARRAY:
+ case GL_PROXY_TEXTURE_2D_ARRAY:
+ return 3;
+ case GL_TEXTURE_BUFFER:
+ /* fall-through */
+ default:
+ _mesa_problem(NULL, "invalid target 0x%x in get_texture_dimensions()",
+ target);
+ return 2;
+ }
+}
+
+
+
+
+#if 000 /* not used anymore */
+/*
+ * glTexImage[123]D can accept a NULL image pointer. In this case we
+ * create a texture image with unspecified image contents per the OpenGL
+ * spec.
+ */
+static GLubyte *
+make_null_texture(GLint width, GLint height, GLint depth, GLenum format)
+{
+ const GLint components = _mesa_components_in_format(format);
+ const GLint numPixels = width * height * depth;
+ GLubyte *data = (GLubyte *) MALLOC(numPixels * components * sizeof(GLubyte));
+
+#ifdef DEBUG
+ /*
+ * Let's see if anyone finds this. If glTexImage2D() is called with
+ * a NULL image pointer then load the texture image with something
+ * interesting instead of leaving it indeterminate.
+ */
+ if (data) {
+ static const char message[8][32] = {
+ " X X XXXXX XXX X ",
+ " XX XX X X X X X ",
+ " X X X X X X X ",
+ " X X XXXX XXX XXXXX ",
+ " X X X X X X ",
+ " X X X X X X X ",
+ " X X XXXXX XXX X X ",
+ " "
+ };
+
+ GLubyte *imgPtr = data;
+ GLint h, i, j, k;
+ for (h = 0; h < depth; h++) {
+ for (i = 0; i < height; i++) {
+ GLint srcRow = 7 - (i % 8);
+ for (j = 0; j < width; j++) {
+ GLint srcCol = j % 32;
+ GLubyte texel = (message[srcRow][srcCol]=='X') ? 255 : 70;
+ for (k = 0; k < components; k++) {
+ *imgPtr++ = texel;
+ }
+ }
+ }
+ }
+ }
+#endif
+
+ return data;
+}
+#endif
+
+
+
+/**
+ * Reset the fields of a gl_texture_image struct to zero.
+ *
+ * \param img texture image structure.
+ *
+ * This is called when a proxy texture test fails, we set all the
+ * image members (except DriverData) to zero.
+ * It's also used in glTexImage[123]D as a safeguard to be sure all
+ * required fields get initialized properly by the Driver.TexImage[123]D
+ * functions.
+ */
+static void
+clear_teximage_fields(struct gl_texture_image *img)
+{
+ ASSERT(img);
+ img->_BaseFormat = 0;
+ img->InternalFormat = 0;
+ img->Border = 0;
+ img->Width = 0;
+ img->Height = 0;
+ img->Depth = 0;
+ img->RowStride = 0;
+ if (img->ImageOffsets) {
+ free(img->ImageOffsets);
+ img->ImageOffsets = NULL;
+ }
+ img->Width2 = 0;
+ img->Height2 = 0;
+ img->Depth2 = 0;
+ img->WidthLog2 = 0;
+ img->HeightLog2 = 0;
+ img->DepthLog2 = 0;
+ img->Data = NULL;
+ img->TexFormat = MESA_FORMAT_NONE;
+ img->FetchTexelc = NULL;
+ img->FetchTexelf = NULL;
+}
+
+
+/**
+ * Initialize basic fields of the gl_texture_image struct.
+ *
+ * \param ctx GL context.
+ * \param target texture target (GL_TEXTURE_1D, GL_TEXTURE_RECTANGLE, etc).
+ * \param img texture image structure to be initialized.
+ * \param width image width.
+ * \param height image height.
+ * \param depth image depth.
+ * \param border image border.
+ * \param internalFormat internal format.
+ * \param format the actual hardware format (one of MESA_FORMAT_*)
+ *
+ * Fills in the fields of \p img with the given information.
+ * Note: width, height and depth include the border.
+ */
+void
+_mesa_init_teximage_fields(struct gl_context *ctx, GLenum target,
+ struct gl_texture_image *img,
+ GLsizei width, GLsizei height, GLsizei depth,
+ GLint border, GLenum internalFormat,
+ gl_format format)
+{
+ GLint i, dims;
+
+ ASSERT(img);
+ ASSERT(width >= 0);
+ ASSERT(height >= 0);
+ ASSERT(depth >= 0);
+
+ img->_BaseFormat = _mesa_base_tex_format( ctx, internalFormat );
+ ASSERT(img->_BaseFormat > 0);
+ img->InternalFormat = internalFormat;
+ img->Border = border;
+ img->Width = width;
+ img->Height = height;
+ img->Depth = depth;
+
+ img->Width2 = width - 2 * border; /* == 1 << img->WidthLog2; */
+ img->WidthLog2 = logbase2(img->Width2);
+
+ if (height == 1) { /* 1-D texture */
+ img->Height2 = 1;
+ img->HeightLog2 = 0;
+ }
+ else {
+ img->Height2 = height - 2 * border; /* == 1 << img->HeightLog2; */
+ img->HeightLog2 = logbase2(img->Height2);
+ }
+
+ if (depth == 1) { /* 2-D texture */
+ img->Depth2 = 1;
+ img->DepthLog2 = 0;
+ }
+ else {
+ img->Depth2 = depth - 2 * border; /* == 1 << img->DepthLog2; */
+ img->DepthLog2 = logbase2(img->Depth2);
+ }
+
+ img->MaxLog2 = MAX2(img->WidthLog2, img->HeightLog2);
+
+ if ((width == 1 || _mesa_is_pow_two(img->Width2)) &&
+ (height == 1 || _mesa_is_pow_two(img->Height2)) &&
+ (depth == 1 || _mesa_is_pow_two(img->Depth2)))
+ img->_IsPowerOfTwo = GL_TRUE;
+ else
+ img->_IsPowerOfTwo = GL_FALSE;
+
+ /* RowStride and ImageOffsets[] describe how to address texels in 'Data' */
+ img->RowStride = width;
+ /* Allocate the ImageOffsets array and initialize to typical values.
+ * We allocate the array for 1D/2D textures too in order to avoid special-
+ * case code in the texstore routines.
+ */
+ if (img->ImageOffsets)
+ free(img->ImageOffsets);
+ img->ImageOffsets = (GLuint *) malloc(depth * sizeof(GLuint));
+ for (i = 0; i < depth; i++) {
+ img->ImageOffsets[i] = i * width * height;
+ }
+
+ /* Compute Width/Height/DepthScale for mipmap lod computation */
+ if (target == GL_TEXTURE_RECTANGLE_NV) {
+ /* scale = 1.0 since texture coords directly map to texels */
+ img->WidthScale = 1.0;
+ img->HeightScale = 1.0;
+ img->DepthScale = 1.0;
+ }
+ else {
+ img->WidthScale = (GLfloat) img->Width;
+ img->HeightScale = (GLfloat) img->Height;
+ img->DepthScale = (GLfloat) img->Depth;
+ }
+
+ img->TexFormat = format;
+
+ dims = _mesa_get_texture_dimensions(target);
+
+ _mesa_set_fetch_functions(img, dims);
+}
+
+
+/**
+ * Free and clear fields of the gl_texture_image struct.
+ *
+ * \param ctx GL context.
+ * \param texImage texture image structure to be cleared.
+ *
+ * After the call, \p texImage will have no data associated with it. Its
+ * fields are cleared so that its parent object will test incomplete.
+ */
+void
+_mesa_clear_texture_image(struct gl_context *ctx,
+ struct gl_texture_image *texImage)
+{
+ ctx->Driver.FreeTexImageData(ctx, texImage);
+ clear_teximage_fields(texImage);
+}
+
+
+/**
+ * This is the fallback for Driver.TestProxyTexImage(). Test the texture
+ * level, width, height and depth against the ctx->Const limits for textures.
+ *
+ * A hardware driver might override this function if, for example, the
+ * max 3D texture size is 512x512x64 (i.e. not a cube).
+ *
+ * Note that width, height, depth == 0 is not an error. However, a
+ * texture with zero width/height/depth will be considered "incomplete"
+ * and texturing will effectively be disabled.
+ *
+ * \param target one of GL_PROXY_TEXTURE_1D, GL_PROXY_TEXTURE_2D,
+ * GL_PROXY_TEXTURE_3D, GL_PROXY_TEXTURE_RECTANGLE_NV,
+ * GL_PROXY_TEXTURE_CUBE_MAP_ARB.
+ * \param level as passed to glTexImage
+ * \param internalFormat as passed to glTexImage
+ * \param format as passed to glTexImage
+ * \param type as passed to glTexImage
+ * \param width as passed to glTexImage
+ * \param height as passed to glTexImage
+ * \param depth as passed to glTexImage
+ * \param border as passed to glTexImage
+ * \return GL_TRUE if the image is acceptable, GL_FALSE if not acceptable.
+ */
+GLboolean
+_mesa_test_proxy_teximage(struct gl_context *ctx, GLenum target, GLint level,
+ GLint internalFormat, GLenum format, GLenum type,
+ GLint width, GLint height, GLint depth, GLint border)
+{
+ GLint maxSize;
+
+ (void) internalFormat;
+ (void) format;
+ (void) type;
+
+ switch (target) {
+ case GL_PROXY_TEXTURE_1D:
+ maxSize = 1 << (ctx->Const.MaxTextureLevels - 1);
+ if (width < 2 * border || width > 2 + maxSize)
+ return GL_FALSE;
+ if (level >= ctx->Const.MaxTextureLevels)
+ return GL_FALSE;
+ if (!ctx->Extensions.ARB_texture_non_power_of_two) {
+ if (width > 0 && !_mesa_is_pow_two(width - 2 * border))
+ return GL_FALSE;
+ }
+ return GL_TRUE;
+
+ case GL_PROXY_TEXTURE_2D:
+ maxSize = 1 << (ctx->Const.MaxTextureLevels - 1);
+ if (width < 2 * border || width > 2 + maxSize)
+ return GL_FALSE;
+ if (height < 2 * border || height > 2 + maxSize)
+ return GL_FALSE;
+ if (level >= ctx->Const.MaxTextureLevels)
+ return GL_FALSE;
+ if (!ctx->Extensions.ARB_texture_non_power_of_two) {
+ if (width > 0 && !_mesa_is_pow_two(width - 2 * border))
+ return GL_FALSE;
+ if (height > 0 && !_mesa_is_pow_two(height - 2 * border))
+ return GL_FALSE;
+ }
+ return GL_TRUE;
+
+ case GL_PROXY_TEXTURE_3D:
+ maxSize = 1 << (ctx->Const.Max3DTextureLevels - 1);
+ if (width < 2 * border || width > 2 + maxSize)
+ return GL_FALSE;
+ if (height < 2 * border || height > 2 + maxSize)
+ return GL_FALSE;
+ if (depth < 2 * border || depth > 2 + maxSize)
+ return GL_FALSE;
+ if (level >= ctx->Const.Max3DTextureLevels)
+ return GL_FALSE;
+ if (!ctx->Extensions.ARB_texture_non_power_of_two) {
+ if (width > 0 && !_mesa_is_pow_two(width - 2 * border))
+ return GL_FALSE;
+ if (height > 0 && !_mesa_is_pow_two(height - 2 * border))
+ return GL_FALSE;
+ if (depth > 0 && !_mesa_is_pow_two(depth - 2 * border))
+ return GL_FALSE;
+ }
+ return GL_TRUE;
+
+ case GL_PROXY_TEXTURE_RECTANGLE_NV:
+ maxSize = ctx->Const.MaxTextureRectSize;
+ if (width < 0 || width > maxSize)
+ return GL_FALSE;
+ if (height < 0 || height > maxSize)
+ return GL_FALSE;
+ if (level != 0)
+ return GL_FALSE;
+ return GL_TRUE;
+
+ case GL_PROXY_TEXTURE_CUBE_MAP_ARB:
+ maxSize = 1 << (ctx->Const.MaxCubeTextureLevels - 1);
+ if (width < 2 * border || width > 2 + maxSize)
+ return GL_FALSE;
+ if (height < 2 * border || height > 2 + maxSize)
+ return GL_FALSE;
+ if (level >= ctx->Const.MaxCubeTextureLevels)
+ return GL_FALSE;
+ if (!ctx->Extensions.ARB_texture_non_power_of_two) {
+ if (width > 0 && !_mesa_is_pow_two(width - 2 * border))
+ return GL_FALSE;
+ if (height > 0 && !_mesa_is_pow_two(height - 2 * border))
+ return GL_FALSE;
+ }
+ return GL_TRUE;
+
+ case GL_PROXY_TEXTURE_1D_ARRAY_EXT:
+ maxSize = 1 << (ctx->Const.MaxTextureLevels - 1);
+ if (width < 2 * border || width > 2 + maxSize)
+ return GL_FALSE;
+ if (height < 1 || height > ctx->Const.MaxArrayTextureLayers)
+ return GL_FALSE;
+ if (level >= ctx->Const.MaxTextureLevels)
+ return GL_FALSE;
+ if (!ctx->Extensions.ARB_texture_non_power_of_two) {
+ if (width > 0 && !_mesa_is_pow_two(width - 2 * border))
+ return GL_FALSE;
+ }
+ return GL_TRUE;
+
+ case GL_PROXY_TEXTURE_2D_ARRAY_EXT:
+ maxSize = 1 << (ctx->Const.MaxTextureLevels - 1);
+ if (width < 2 * border || width > 2 + maxSize)
+ return GL_FALSE;
+ if (height < 2 * border || height > 2 + maxSize)
+ return GL_FALSE;
+ if (depth < 1 || depth > ctx->Const.MaxArrayTextureLayers)
+ return GL_FALSE;
+ if (level >= ctx->Const.MaxTextureLevels)
+ return GL_FALSE;
+ if (!ctx->Extensions.ARB_texture_non_power_of_two) {
+ if (width > 0 && !_mesa_is_pow_two(width - 2 * border))
+ return GL_FALSE;
+ if (height > 0 && !_mesa_is_pow_two(height - 2 * border))
+ return GL_FALSE;
+ }
+ return GL_TRUE;
+
+ default:
+ _mesa_problem(ctx, "Invalid target in _mesa_test_proxy_teximage");
+ return GL_FALSE;
+ }
+}
+
+
+/**
+ * Check if the memory used by the texture would exceed the driver's limit.
+ * This lets us support a max 3D texture size of 8K (for example) but
+ * prevents allocating a full 8K x 8K x 8K texture.
+ * XXX this could be rolled into the proxy texture size test (above) but
+ * we don't have the actual texture internal format at that point.
+ */
+static GLboolean
+legal_texture_size(struct gl_context *ctx, gl_format format,
+ GLint width, GLint height, GLint depth)
+{
+ uint64_t bytes = _mesa_format_image_size64(format, width, height, depth);
+ uint64_t mbytes = bytes / (1024 * 1024); /* convert to MB */
+ return mbytes <= (uint64_t) ctx->Const.MaxTextureMbytes;
+}
+
+
+
+/**
+ * Helper function to determine whether a target and specific compression
+ * format are supported.
+ */
+static GLboolean
+target_can_be_compressed(const struct gl_context *ctx, GLenum target,
+ GLenum intFormat)
+{
+ (void) intFormat; /* not used yet */
+
+ switch (target) {
+ case GL_TEXTURE_2D:
+ case GL_PROXY_TEXTURE_2D:
+ return GL_TRUE; /* true for any compressed format so far */
+ case GL_PROXY_TEXTURE_CUBE_MAP:
+ case GL_TEXTURE_CUBE_MAP_POSITIVE_X:
+ case GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
+ case GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
+ case GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
+ case GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
+ case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
+ return ctx->Extensions.ARB_texture_cube_map;
+ case GL_PROXY_TEXTURE_2D_ARRAY_EXT:
+ case GL_TEXTURE_2D_ARRAY_EXT:
+ return (ctx->Extensions.MESA_texture_array ||
+ ctx->Extensions.EXT_texture_array);
+ default:
+ return GL_FALSE;
+ }
+}
+
+
+/**
+ * Check if the given texture target value is legal for a
+ * glTexImage1/2/3D call.
+ */
+static GLboolean
+legal_teximage_target(struct gl_context *ctx, GLuint dims, GLenum target)
+{
+ switch (dims) {
+ case 1:
+ switch (target) {
+ case GL_TEXTURE_1D:
+ case GL_PROXY_TEXTURE_1D:
+ return GL_TRUE;
+ default:
+ return GL_FALSE;
+ }
+ case 2:
+ switch (target) {
+ case GL_TEXTURE_2D:
+ case GL_PROXY_TEXTURE_2D:
+ return GL_TRUE;
+ case GL_PROXY_TEXTURE_CUBE_MAP:
+ case GL_TEXTURE_CUBE_MAP_POSITIVE_X:
+ case GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
+ case GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
+ case GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
+ case GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
+ case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
+ return ctx->Extensions.ARB_texture_cube_map;
+ case GL_TEXTURE_RECTANGLE_NV:
+ case GL_PROXY_TEXTURE_RECTANGLE_NV:
+ return ctx->Extensions.NV_texture_rectangle;
+ case GL_TEXTURE_1D_ARRAY_EXT:
+ case GL_PROXY_TEXTURE_1D_ARRAY_EXT:
+ return (ctx->Extensions.MESA_texture_array ||
+ ctx->Extensions.EXT_texture_array);
+ default:
+ return GL_FALSE;
+ }
+ case 3:
+ switch (target) {
+ case GL_TEXTURE_3D:
+ case GL_PROXY_TEXTURE_3D:
+ return GL_TRUE;
+ case GL_TEXTURE_2D_ARRAY_EXT:
+ case GL_PROXY_TEXTURE_2D_ARRAY_EXT:
+ return (ctx->Extensions.MESA_texture_array ||
+ ctx->Extensions.EXT_texture_array);
+ default:
+ return GL_FALSE;
+ }
+ default:
+ _mesa_problem(ctx, "invalid dims=%u in legal_teximage_target()", dims);
+ return GL_FALSE;
+ }
+}
+
+
+/**
+ * Check if the given texture target value is legal for a
+ * glTexSubImage, glCopyTexSubImage or glCopyTexImage call.
+ * The difference compared to legal_teximage_target() above is that
+ * proxy targets are not supported.
+ */
+static GLboolean
+legal_texsubimage_target(struct gl_context *ctx, GLuint dims, GLenum target)
+{
+ switch (dims) {
+ case 1:
+ return target == GL_TEXTURE_1D;
+ case 2:
+ switch (target) {
+ case GL_TEXTURE_2D:
+ return GL_TRUE;
+ case GL_TEXTURE_CUBE_MAP_POSITIVE_X:
+ case GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
+ case GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
+ case GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
+ case GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
+ case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
+ return ctx->Extensions.ARB_texture_cube_map;
+ case GL_TEXTURE_RECTANGLE_NV:
+ return ctx->Extensions.NV_texture_rectangle;
+ case GL_TEXTURE_1D_ARRAY_EXT:
+ return (ctx->Extensions.MESA_texture_array ||
+ ctx->Extensions.EXT_texture_array);
+ default:
+ return GL_FALSE;
+ }
+ case 3:
+ switch (target) {
+ case GL_TEXTURE_3D:
+ return GL_TRUE;
+ case GL_TEXTURE_2D_ARRAY_EXT:
+ return (ctx->Extensions.MESA_texture_array ||
+ ctx->Extensions.EXT_texture_array);
+ default:
+ return GL_FALSE;
+ }
+ default:
+ _mesa_problem(ctx, "invalid dims=%u in legal_texsubimage_target()",
+ dims);
+ return GL_FALSE;
+ }
+}
+
+
+/**
+ * Test the glTexImage[123]D() parameters for errors.
+ *
+ * \param ctx GL context.
+ * \param dimensions texture image dimensions (must be 1, 2 or 3).
+ * \param target texture target given by the user.
+ * \param level image level given by the user.
+ * \param internalFormat internal format given by the user.
+ * \param format pixel data format given by the user.
+ * \param type pixel data type given by the user.
+ * \param width image width given by the user.
+ * \param height image height given by the user.
+ * \param depth image depth given by the user.
+ * \param border image border given by the user.
+ *
+ * \return GL_TRUE if an error was detected, or GL_FALSE if no errors.
+ *
+ * Verifies each of the parameters against the constants specified in
+ * __struct gl_contextRec::Const and the supported extensions, and according
+ * to the OpenGL specification.
+ */
+static GLboolean
+texture_error_check( struct gl_context *ctx,
+ GLuint dimensions, GLenum target,
+ GLint level, GLint internalFormat,
+ GLenum format, GLenum type,
+ GLint width, GLint height,
+ GLint depth, GLint border )
+{
+ const GLenum proxyTarget = get_proxy_target(target);
+ const GLboolean isProxy = target == proxyTarget;
+ GLboolean sizeOK = GL_TRUE;
+ GLboolean colorFormat, indexFormat;
+
+ /* Basic level check (more checking in ctx->Driver.TestProxyTexImage) */
+ if (level < 0 || level >= MAX_TEXTURE_LEVELS) {
+ if (!isProxy) {
+ _mesa_error(ctx, GL_INVALID_VALUE,
+ "glTexImage%dD(level=%d)", dimensions, level);
+ }
+ return GL_TRUE;
+ }
+
+ /* Check border */
+ if (border < 0 || border > 1 ||
+ ((target == GL_TEXTURE_RECTANGLE_NV ||
+ target == GL_PROXY_TEXTURE_RECTANGLE_NV) && border != 0)) {
+ if (!isProxy) {
+ _mesa_error(ctx, GL_INVALID_VALUE,
+ "glTexImage%dD(border=%d)", dimensions, border);
+ }
+ return GL_TRUE;
+ }
+
+ if (width < 0 || height < 0 || depth < 0) {
+ if (!isProxy) {
+ _mesa_error(ctx, GL_INVALID_VALUE,
+ "glTexImage%dD(width, height or depth < 0)", dimensions);
+ }
+ return GL_TRUE;
+ }
+
+ /* Do this simple check before calling the TestProxyTexImage() function */
+ if (proxyTarget == GL_PROXY_TEXTURE_CUBE_MAP_ARB) {
+ sizeOK = (width == height);
+ }
+
+ /*
+ * Use the proxy texture driver hook to see if the size/level/etc are
+ * legal.
+ */
+ sizeOK = sizeOK && ctx->Driver.TestProxyTexImage(ctx, proxyTarget, level,
+ internalFormat, format,
+ type, width, height,
+ depth, border);
+ if (!sizeOK) {
+ if (!isProxy) {
+ _mesa_error(ctx, GL_INVALID_VALUE,
+ "glTexImage%dD(level=%d, width=%d, height=%d, depth=%d)",
+ dimensions, level, width, height, depth);
+ }
+ return GL_TRUE;
+ }
+
+ /* Check internalFormat */
+ if (_mesa_base_tex_format(ctx, internalFormat) < 0) {
+ if (!isProxy) {
+ _mesa_error(ctx, GL_INVALID_VALUE,
+ "glTexImage%dD(internalFormat=%s)",
+ dimensions, _mesa_lookup_enum_by_nr(internalFormat));
+ }
+ return GL_TRUE;
+ }
+
+ /* Check incoming image format and type */
+ if (!_mesa_is_legal_format_and_type(ctx, format, type)) {
+ /* Normally, GL_INVALID_OPERATION is generated by a format/type
+ * mismatch (see the 1.2 spec page 94, sec 3.6.4.). But with the
+ * GL_EXT_texture_integer extension, some combinations should generate
+ * GL_INVALID_ENUM instead (grr!).
+ */
+ if (!isProxy) {
+ GLenum error = _mesa_is_integer_format(format)
+ ? GL_INVALID_ENUM : GL_INVALID_OPERATION;
+ _mesa_error(ctx, error,
+ "glTexImage%dD(incompatible format 0x%x, type 0x%x)",
+ dimensions, format, type);
+ }
+ return GL_TRUE;
+ }
+
+ /* make sure internal format and format basically agree */
+ colorFormat = _mesa_is_color_format(format);
+ indexFormat = _mesa_is_index_format(format);
+ if ((_mesa_is_color_format(internalFormat) && !colorFormat && !indexFormat) ||
+ (_mesa_is_index_format(internalFormat) && !indexFormat) ||
+ (_mesa_is_depth_format(internalFormat) != _mesa_is_depth_format(format)) ||
+ (_mesa_is_ycbcr_format(internalFormat) != _mesa_is_ycbcr_format(format)) ||
+ (_mesa_is_depthstencil_format(internalFormat) != _mesa_is_depthstencil_format(format)) ||
+ (_mesa_is_dudv_format(internalFormat) != _mesa_is_dudv_format(format))) {
+ if (!isProxy)
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glTexImage%dD(incompatible internalFormat 0x%x, format 0x%x)",
+ dimensions, internalFormat, format);
+ return GL_TRUE;
+ }
+
+ /* additional checks for ycbcr textures */
+ if (internalFormat == GL_YCBCR_MESA) {
+ ASSERT(ctx->Extensions.MESA_ycbcr_texture);
+ if (type != GL_UNSIGNED_SHORT_8_8_MESA &&
+ type != GL_UNSIGNED_SHORT_8_8_REV_MESA) {
+ char message[100];
+ _mesa_snprintf(message, sizeof(message),
+ "glTexImage%dD(format/type YCBCR mismatch", dimensions);
+ _mesa_error(ctx, GL_INVALID_ENUM, "%s", message);
+ return GL_TRUE; /* error */
+ }
+ if (target != GL_TEXTURE_2D &&
+ target != GL_PROXY_TEXTURE_2D &&
+ target != GL_TEXTURE_RECTANGLE_NV &&
+ target != GL_PROXY_TEXTURE_RECTANGLE_NV) {
+ if (!isProxy)
+ _mesa_error(ctx, GL_INVALID_ENUM, "glTexImage(target)");
+ return GL_TRUE;
+ }
+ if (border != 0) {
+ if (!isProxy) {
+ char message[100];
+ _mesa_snprintf(message, sizeof(message),
+ "glTexImage%dD(format=GL_YCBCR_MESA and border=%d)",
+ dimensions, border);
+ _mesa_error(ctx, GL_INVALID_VALUE, "%s", message);
+ }
+ return GL_TRUE;
+ }
+ }
+
+ /* additional checks for depth textures */
+ if (_mesa_base_tex_format(ctx, internalFormat) == GL_DEPTH_COMPONENT) {
+ /* Only 1D, 2D and rectangular textures supported, not 3D or cubes */
+ if (target != GL_TEXTURE_1D &&
+ target != GL_PROXY_TEXTURE_1D &&
+ target != GL_TEXTURE_2D &&
+ target != GL_PROXY_TEXTURE_2D &&
+ target != GL_TEXTURE_RECTANGLE_ARB &&
+ target != GL_PROXY_TEXTURE_RECTANGLE_ARB) {
+ if (!isProxy)
+ _mesa_error(ctx, GL_INVALID_ENUM,
+ "glTexImage(target/internalFormat)");
+ return GL_TRUE;
+ }
+ }
+
+ /* additional checks for compressed textures */
+ if (_mesa_is_compressed_format(ctx, internalFormat)) {
+ if (!target_can_be_compressed(ctx, target, internalFormat)) {
+ if (!isProxy)
+ _mesa_error(ctx, GL_INVALID_ENUM,
+ "glTexImage%dD(target)", dimensions);
+ return GL_TRUE;
+ }
+ if (border != 0) {
+ if (!isProxy) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glTexImage%dD(border!=0)", dimensions);
+ }
+ return GL_TRUE;
+ }
+ }
+
+ /* additional checks for integer textures */
+ if (ctx->Extensions.EXT_texture_integer &&
+ (_mesa_is_integer_format(format) !=
+ _mesa_is_integer_format(internalFormat))) {
+ if (!isProxy) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glTexImage%dD(integer/non-integer format mismatch)",
+ dimensions);
+ }
+ return GL_TRUE;
+ }
+
+ /* if we get here, the parameters are OK */
+ return GL_FALSE;
+}
+
+
+/**
+ * Test glTexSubImage[123]D() parameters for errors.
+ *
+ * \param ctx GL context.
+ * \param dimensions texture image dimensions (must be 1, 2 or 3).
+ * \param target texture target given by the user.
+ * \param level image level given by the user.
+ * \param xoffset sub-image x offset given by the user.
+ * \param yoffset sub-image y offset given by the user.
+ * \param zoffset sub-image z offset given by the user.
+ * \param format pixel data format given by the user.
+ * \param type pixel data type given by the user.
+ * \param width image width given by the user.
+ * \param height image height given by the user.
+ * \param depth image depth given by the user.
+ *
+ * \return GL_TRUE if an error was detected, or GL_FALSE if no errors.
+ *
+ * Verifies each of the parameters against the constants specified in
+ * __struct gl_contextRec::Const and the supported extensions, and according
+ * to the OpenGL specification.
+ */
+static GLboolean
+subtexture_error_check( struct gl_context *ctx, GLuint dimensions,
+ GLenum target, GLint level,
+ GLint xoffset, GLint yoffset, GLint zoffset,
+ GLint width, GLint height, GLint depth,
+ GLenum format, GLenum type )
+{
+ /* Basic level check */
+ if (level < 0 || level >= MAX_TEXTURE_LEVELS) {
+ _mesa_error(ctx, GL_INVALID_ENUM, "glTexSubImage2D(level=%d)", level);
+ return GL_TRUE;
+ }
+
+ /* Check for negative sizes */
+ if (width < 0) {
+ _mesa_error(ctx, GL_INVALID_VALUE,
+ "glTexSubImage%dD(width=%d)", dimensions, width);
+ return GL_TRUE;
+ }
+ if (height < 0 && dimensions > 1) {
+ _mesa_error(ctx, GL_INVALID_VALUE,
+ "glTexSubImage%dD(height=%d)", dimensions, height);
+ return GL_TRUE;
+ }
+ if (depth < 0 && dimensions > 2) {
+ _mesa_error(ctx, GL_INVALID_VALUE,
+ "glTexSubImage%dD(depth=%d)", dimensions, depth);
+ return GL_TRUE;
+ }
+
+ if (!_mesa_is_legal_format_and_type(ctx, format, type)) {
+ /* As with the glTexImage2D check above, the error code here
+ * depends on texture integer.
+ */
+ GLenum error = _mesa_is_integer_format(format)
+ ? GL_INVALID_OPERATION : GL_INVALID_ENUM;
+ _mesa_error(ctx, error,
+ "glTexSubImage%dD(incompatible format 0x%x, type 0x%x)",
+ dimensions, format, type);
+ return GL_TRUE;
+ }
+
+ return GL_FALSE;
+}
+
+
+/**
+ * Do second part of glTexSubImage which depends on the destination texture.
+ * \return GL_TRUE if error recorded, GL_FALSE otherwise
+ */
+static GLboolean
+subtexture_error_check2( struct gl_context *ctx, GLuint dimensions,
+ GLenum target, GLint level,
+ GLint xoffset, GLint yoffset, GLint zoffset,
+ GLint width, GLint height, GLint depth,
+ GLenum format, GLenum type,
+ const struct gl_texture_image *destTex )
+{
+ if (!destTex) {
+ /* undefined image level */
+ _mesa_error(ctx, GL_INVALID_OPERATION, "glTexSubImage%dD", dimensions);
+ return GL_TRUE;
+ }
+
+ if (xoffset < -((GLint)destTex->Border)) {
+ _mesa_error(ctx, GL_INVALID_VALUE, "glTexSubImage%dD(xoffset)",
+ dimensions);
+ return GL_TRUE;
+ }
+ if (xoffset + width > (GLint) (destTex->Width + destTex->Border)) {
+ _mesa_error(ctx, GL_INVALID_VALUE, "glTexSubImage%dD(xoffset+width)",
+ dimensions);
+ return GL_TRUE;
+ }
+ if (dimensions > 1) {
+ if (yoffset < -((GLint)destTex->Border)) {
+ _mesa_error(ctx, GL_INVALID_VALUE, "glTexSubImage%dD(yoffset)",
+ dimensions);
+ return GL_TRUE;
+ }
+ if (yoffset + height > (GLint) (destTex->Height + destTex->Border)) {
+ _mesa_error(ctx, GL_INVALID_VALUE, "glTexSubImage%dD(yoffset+height)",
+ dimensions);
+ return GL_TRUE;
+ }
+ }
+ if (dimensions > 2) {
+ if (zoffset < -((GLint)destTex->Border)) {
+ _mesa_error(ctx, GL_INVALID_VALUE, "glTexSubImage3D(zoffset)");
+ return GL_TRUE;
+ }
+ if (zoffset + depth > (GLint) (destTex->Depth + destTex->Border)) {
+ _mesa_error(ctx, GL_INVALID_VALUE, "glTexSubImage3D(zoffset+depth)");
+ return GL_TRUE;
+ }
+ }
+
+ if (_mesa_is_format_compressed(destTex->TexFormat)) {
+ GLuint bw, bh;
+
+ /* do tests which depend on compression block size */
+ _mesa_get_format_block_size(destTex->TexFormat, &bw, &bh);
+
+ /* offset must be multiple of block size */
+ if ((xoffset % bw != 0) || (yoffset % bh != 0)) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glTexSubImage%dD(xoffset = %d, yoffset = %d)",
+ dimensions, xoffset, yoffset);
+ return GL_TRUE;
+ }
+ /* size must be multiple of bw by bh or equal to whole texture size */
+ if ((width % bw != 0) && (GLuint) width != destTex->Width) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glTexSubImage%dD(width = %d)", dimensions, width);
+ return GL_TRUE;
+ }
+ if ((height % bh != 0) && (GLuint) height != destTex->Height) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glTexSubImage%dD(height = %d)", dimensions, height);
+ return GL_TRUE;
+ }
+ }
+
+ return GL_FALSE;
+}
+
+
+/**
+ * Test glCopyTexImage[12]D() parameters for errors.
+ *
+ * \param ctx GL context.
+ * \param dimensions texture image dimensions (must be 1, 2 or 3).
+ * \param target texture target given by the user.
+ * \param level image level given by the user.
+ * \param internalFormat internal format given by the user.
+ * \param width image width given by the user.
+ * \param height image height given by the user.
+ * \param border texture border.
+ *
+ * \return GL_TRUE if an error was detected, or GL_FALSE if no errors.
+ *
+ * Verifies each of the parameters against the constants specified in
+ * __struct gl_contextRec::Const and the supported extensions, and according
+ * to the OpenGL specification.
+ */
+static GLboolean
+copytexture_error_check( struct gl_context *ctx, GLuint dimensions,
+ GLenum target, GLint level, GLint internalFormat,
+ GLint width, GLint height, GLint border )
+{
+ const GLenum proxyTarget = get_proxy_target(target);
+ const GLenum type = GL_FLOAT;
+ GLboolean sizeOK;
+ GLint format;
+
+ /* check target */
+ if (!legal_texsubimage_target(ctx, dimensions, target)) {
+ _mesa_error(ctx, GL_INVALID_ENUM, "glCopyTexImage%uD(target=%s)",
+ dimensions, _mesa_lookup_enum_by_nr(target));
+ return GL_TRUE;
+ }
+
+ /* Basic level check (more checking in ctx->Driver.TestProxyTexImage) */
+ if (level < 0 || level >= MAX_TEXTURE_LEVELS) {
+ _mesa_error(ctx, GL_INVALID_VALUE,
+ "glCopyTexImage%dD(level=%d)", dimensions, level);
+ return GL_TRUE;
+ }
+
+ /* Check that the source buffer is complete */
+ if (ctx->ReadBuffer->Name) {
+ if (ctx->ReadBuffer->_Status == 0) {
+ _mesa_test_framebuffer_completeness(ctx, ctx->ReadBuffer);
+ }
+ if (ctx->ReadBuffer->_Status != GL_FRAMEBUFFER_COMPLETE_EXT) {
+ _mesa_error(ctx, GL_INVALID_FRAMEBUFFER_OPERATION_EXT,
+ "glCopyTexImage%dD(invalid readbuffer)", dimensions);
+ return GL_TRUE;
+ }
+ }
+
+ /* Check border */
+ if (border < 0 || border > 1 ||
+ ((target == GL_TEXTURE_RECTANGLE_NV ||
+ target == GL_PROXY_TEXTURE_RECTANGLE_NV) && border != 0)) {
+ return GL_TRUE;
+ }
+
+ format = _mesa_base_tex_format(ctx, internalFormat);
+ if (format < 0) {
+ _mesa_error(ctx, GL_INVALID_VALUE,
+ "glCopyTexImage%dD(internalFormat)", dimensions);
+ return GL_TRUE;
+ }
+
+ if (!_mesa_source_buffer_exists(ctx, format)) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glCopyTexImage%dD(missing readbuffer)", dimensions);
+ return GL_TRUE;
+ }
+
+ /* Do size, level checking */
+ sizeOK = (proxyTarget == GL_PROXY_TEXTURE_CUBE_MAP_ARB)
+ ? (width == height) : 1;
+
+ sizeOK = sizeOK && ctx->Driver.TestProxyTexImage(ctx, proxyTarget, level,
+ internalFormat, format,
+ type, width, height,
+ 1, border);
+
+ if (!sizeOK) {
+ if (dimensions == 1) {
+ _mesa_error(ctx, GL_INVALID_VALUE,
+ "glCopyTexImage1D(width=%d)", width);
+ }
+ else {
+ ASSERT(dimensions == 2);
+ _mesa_error(ctx, GL_INVALID_VALUE,
+ "glCopyTexImage2D(width=%d, height=%d)", width, height);
+ }
+ return GL_TRUE;
+ }
+
+ if (_mesa_is_compressed_format(ctx, internalFormat)) {
+ if (!target_can_be_compressed(ctx, target, internalFormat)) {
+ _mesa_error(ctx, GL_INVALID_ENUM,
+ "glCopyTexImage%dD(target)", dimensions);
+ return GL_TRUE;
+ }
+ if (border != 0) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glCopyTexImage%dD(border!=0)", dimensions);
+ return GL_TRUE;
+ }
+ }
+ else if (_mesa_is_depth_format(internalFormat)) {
+ /* make sure we have depth/stencil buffers */
+ if (!ctx->ReadBuffer->_DepthBuffer) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glCopyTexImage%dD(no depth)", dimensions);
+ return GL_TRUE;
+ }
+ }
+ else if (_mesa_is_depthstencil_format(internalFormat)) {
+ /* make sure we have depth/stencil buffers */
+ if (!ctx->ReadBuffer->_DepthBuffer || !ctx->ReadBuffer->_StencilBuffer) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glCopyTexImage%dD(no depth/stencil buffer)", dimensions);
+ return GL_TRUE;
+ }
+ }
+
+ /* if we get here, the parameters are OK */
+ return GL_FALSE;
+}
+
+
+/**
+ * Test glCopyTexSubImage[12]D() parameters for errors.
+ * Note that this is the first part of error checking.
+ * See also copytexsubimage_error_check2() below for the second part.
+ *
+ * \param ctx GL context.
+ * \param dimensions texture image dimensions (must be 1, 2 or 3).
+ * \param target texture target given by the user.
+ * \param level image level given by the user.
+ *
+ * \return GL_TRUE if an error was detected, or GL_FALSE if no errors.
+ */
+static GLboolean
+copytexsubimage_error_check1( struct gl_context *ctx, GLuint dimensions,
+ GLenum target, GLint level)
+{
+ /* Check that the source buffer is complete */
+ if (ctx->ReadBuffer->Name) {
+ if (ctx->ReadBuffer->_Status == 0) {
+ _mesa_test_framebuffer_completeness(ctx, ctx->ReadBuffer);
+ }
+ if (ctx->ReadBuffer->_Status != GL_FRAMEBUFFER_COMPLETE_EXT) {
+ _mesa_error(ctx, GL_INVALID_FRAMEBUFFER_OPERATION_EXT,
+ "glCopyTexImage%dD(invalid readbuffer)", dimensions);
+ return GL_TRUE;
+ }
+ }
+
+ /* check target (proxies not allowed) */
+ if (!legal_texsubimage_target(ctx, dimensions, target)) {
+ _mesa_error(ctx, GL_INVALID_ENUM, "glCopyTexSubImage%uD(target=%s)",
+ dimensions, _mesa_lookup_enum_by_nr(target));
+ return GL_TRUE;
+ }
+
+ /* Check level */
+ if (level < 0 || level >= MAX_TEXTURE_LEVELS) {
+ _mesa_error(ctx, GL_INVALID_VALUE,
+ "glCopyTexSubImage%dD(level=%d)", dimensions, level);
+ return GL_TRUE;
+ }
+
+ return GL_FALSE;
+}
+
+
+/**
+ * Second part of error checking for glCopyTexSubImage[12]D().
+ * \param xoffset sub-image x offset given by the user.
+ * \param yoffset sub-image y offset given by the user.
+ * \param zoffset sub-image z offset given by the user.
+ * \param width image width given by the user.
+ * \param height image height given by the user.
+ */
+static GLboolean
+copytexsubimage_error_check2( struct gl_context *ctx, GLuint dimensions,
+ GLenum target, GLint level,
+ GLint xoffset, GLint yoffset, GLint zoffset,
+ GLsizei width, GLsizei height,
+ const struct gl_texture_image *teximage )
+{
+ /* check that dest tex image exists */
+ if (!teximage) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glCopyTexSubImage%dD(undefined texture level: %d)",
+ dimensions, level);
+ return GL_TRUE;
+ }
+
+ /* Check size */
+ if (width < 0) {
+ _mesa_error(ctx, GL_INVALID_VALUE,
+ "glCopyTexSubImage%dD(width=%d)", dimensions, width);
+ return GL_TRUE;
+ }
+ if (dimensions > 1 && height < 0) {
+ _mesa_error(ctx, GL_INVALID_VALUE,
+ "glCopyTexSubImage%dD(height=%d)", dimensions, height);
+ return GL_TRUE;
+ }
+
+ /* check x/y offsets */
+ if (xoffset < -((GLint)teximage->Border)) {
+ _mesa_error(ctx, GL_INVALID_VALUE,
+ "glCopyTexSubImage%dD(xoffset=%d)", dimensions, xoffset);
+ return GL_TRUE;
+ }
+ if (xoffset + width > (GLint) (teximage->Width + teximage->Border)) {
+ _mesa_error(ctx, GL_INVALID_VALUE,
+ "glCopyTexSubImage%dD(xoffset+width)", dimensions);
+ return GL_TRUE;
+ }
+ if (dimensions > 1) {
+ if (yoffset < -((GLint)teximage->Border)) {
+ _mesa_error(ctx, GL_INVALID_VALUE,
+ "glCopyTexSubImage%dD(yoffset=%d)", dimensions, yoffset);
+ return GL_TRUE;
+ }
+ /* NOTE: we're adding the border here, not subtracting! */
+ if (yoffset + height > (GLint) (teximage->Height + teximage->Border)) {
+ _mesa_error(ctx, GL_INVALID_VALUE,
+ "glCopyTexSubImage%dD(yoffset+height)", dimensions);
+ return GL_TRUE;
+ }
+ }
+
+ /* check z offset */
+ if (dimensions > 2) {
+ if (zoffset < -((GLint)teximage->Border)) {
+ _mesa_error(ctx, GL_INVALID_VALUE,
+ "glCopyTexSubImage%dD(zoffset)", dimensions);
+ return GL_TRUE;
+ }
+ if (zoffset > (GLint) (teximage->Depth + teximage->Border)) {
+ _mesa_error(ctx, GL_INVALID_VALUE,
+ "glCopyTexSubImage%dD(zoffset+depth)", dimensions);
+ return GL_TRUE;
+ }
+ }
+
+ if (_mesa_is_format_compressed(teximage->TexFormat)) {
+ /* offset must be multiple of 4 */
+ if ((xoffset & 3) || (yoffset & 3)) {
+ _mesa_error(ctx, GL_INVALID_VALUE,
+ "glCopyTexSubImage%dD(xoffset or yoffset)", dimensions);
+ return GL_TRUE;
+ }
+ /* size must be multiple of 4 */
+ if ((width & 3) != 0 && (GLuint) width != teximage->Width) {
+ _mesa_error(ctx, GL_INVALID_VALUE,
+ "glCopyTexSubImage%dD(width)", dimensions);
+ return GL_TRUE;
+ }
+ if ((height & 3) != 0 && (GLuint) height != teximage->Height) {
+ _mesa_error(ctx, GL_INVALID_VALUE,
+ "glCopyTexSubImage%dD(height)", dimensions);
+ return GL_TRUE;
+ }
+ }
+
+ if (teximage->InternalFormat == GL_YCBCR_MESA) {
+ _mesa_error(ctx, GL_INVALID_OPERATION, "glCopyTexSubImage2D");
+ return GL_TRUE;
+ }
+
+ if (!_mesa_source_buffer_exists(ctx, teximage->_BaseFormat)) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glCopyTexSubImage%dD(missing readbuffer, format=0x%x)",
+ dimensions, teximage->_BaseFormat);
+ return GL_TRUE;
+ }
+
+ if (teximage->_BaseFormat == GL_DEPTH_COMPONENT) {
+ if (!ctx->ReadBuffer->_DepthBuffer) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glCopyTexSubImage%dD(no depth buffer)",
+ dimensions);
+ return GL_TRUE;
+ }
+ }
+ else if (teximage->_BaseFormat == GL_DEPTH_STENCIL_EXT) {
+ if (!ctx->ReadBuffer->_DepthBuffer || !ctx->ReadBuffer->_StencilBuffer) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glCopyTexSubImage%dD(no depth/stencil buffer)",
+ dimensions);
+ return GL_TRUE;
+ }
+ }
+
+ /* If copying into an integer texture, the source buffer must also be
+ * integer-valued.
+ */
+ if (_mesa_is_format_integer_color(teximage->TexFormat)) {
+ struct gl_renderbuffer *rb = ctx->ReadBuffer->_ColorReadBuffer;
+ if (!_mesa_is_format_integer_color(rb->Format)) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glCopyTexSubImage%dD(source buffer is not integer format)",
+ dimensions);
+ return GL_TRUE;
+ }
+ }
+
+ /* if we get here, the parameters are OK */
+ return GL_FALSE;
+}
+
+
+/** Callback info for walking over FBO hash table */
+struct cb_info
+{
+ struct gl_context *ctx;
+ struct gl_texture_object *texObj;
+ GLuint level, face;
+};
+
+
+/**
+ * Check render to texture callback. Called from _mesa_HashWalk().
+ */
+static void
+check_rtt_cb(GLuint key, void *data, void *userData)
+{
+ struct gl_framebuffer *fb = (struct gl_framebuffer *) data;
+ const struct cb_info *info = (struct cb_info *) userData;
+ struct gl_context *ctx = info->ctx;
+ const struct gl_texture_object *texObj = info->texObj;
+ const GLuint level = info->level, face = info->face;
+
+ /* If this is a user-created FBO */
+ if (fb->Name) {
+ GLuint i;
+ /* check if any of the FBO's attachments point to 'texObj' */
+ for (i = 0; i < BUFFER_COUNT; i++) {
+ struct gl_renderbuffer_attachment *att = fb->Attachment + i;
+ if (att->Type == GL_TEXTURE &&
+ att->Texture == texObj &&
+ att->TextureLevel == level &&
+ att->CubeMapFace == face) {
+ ASSERT(_mesa_get_attachment_teximage(att));
+ /* Tell driver about the new renderbuffer texture */
+ ctx->Driver.RenderTexture(ctx, ctx->DrawBuffer, att);
+ /* Mark fb status as indeterminate to force re-validation */
+ fb->_Status = 0;
+ }
+ }
+ }
+}
+
+
+/**
+ * When a texture image is specified we have to check if it's bound to
+ * any framebuffer objects (render to texture) in order to detect changes
+ * in size or format since that effects FBO completeness.
+ * Any FBOs rendering into the texture must be re-validated.
+ */
+static void
+update_fbo_texture(struct gl_context *ctx, struct gl_texture_object *texObj,
+ GLuint face, GLuint level)
+{
+ /* Only check this texture if it's been marked as RenderToTexture */
+ if (texObj->_RenderToTexture) {
+ struct cb_info info;
+ info.ctx = ctx;
+ info.texObj = texObj;
+ info.level = level;
+ info.face = face;
+ _mesa_HashWalk(ctx->Shared->FrameBuffers, check_rtt_cb, &info);
+ }
+}
+
+
+/**
+ * If the texture object's GenerateMipmap flag is set and we've
+ * changed the texture base level image, regenerate the rest of the
+ * mipmap levels now.
+ */
+static INLINE void
+check_gen_mipmap(struct gl_context *ctx, GLenum target,
+ struct gl_texture_object *texObj, GLint level)
+{
+ ASSERT(target != GL_TEXTURE_CUBE_MAP);
+ if (texObj->GenerateMipmap &&
+ level == texObj->BaseLevel &&
+ level < texObj->MaxLevel) {
+ ASSERT(ctx->Driver.GenerateMipmap);
+ ctx->Driver.GenerateMipmap(ctx, target, texObj);
+ }
+}
+
+
+/** Debug helper: override the user-requested internal format */
+static GLenum
+override_internal_format(GLenum internalFormat, GLint width, GLint height)
+{
+#if 0
+ if (internalFormat == GL_RGBA16F_ARB ||
+ internalFormat == GL_RGBA32F_ARB) {
+ printf("Convert rgba float tex to int %d x %d\n", width, height);
+ return GL_RGBA;
+ }
+ else if (internalFormat == GL_RGB16F_ARB ||
+ internalFormat == GL_RGB32F_ARB) {
+ printf("Convert rgb float tex to int %d x %d\n", width, height);
+ return GL_RGB;
+ }
+ else if (internalFormat == GL_LUMINANCE_ALPHA16F_ARB ||
+ internalFormat == GL_LUMINANCE_ALPHA32F_ARB) {
+ printf("Convert luminance float tex to int %d x %d\n", width, height);
+ return GL_LUMINANCE_ALPHA;
+ }
+ else if (internalFormat == GL_LUMINANCE16F_ARB ||
+ internalFormat == GL_LUMINANCE32F_ARB) {
+ printf("Convert luminance float tex to int %d x %d\n", width, height);
+ return GL_LUMINANCE;
+ }
+ else if (internalFormat == GL_ALPHA16F_ARB ||
+ internalFormat == GL_ALPHA32F_ARB) {
+ printf("Convert luminance float tex to int %d x %d\n", width, height);
+ return GL_ALPHA;
+ }
+ /*
+ else if (internalFormat == GL_COMPRESSED_RGBA_S3TC_DXT1_EXT) {
+ internalFormat = GL_RGBA;
+ }
+ */
+ else {
+ return internalFormat;
+ }
+#else
+ return internalFormat;
+#endif
+}
+
+
+/**
+ * Choose the actual hardware format for a texture image.
+ * Try to use the same format as the previous image level when possible.
+ * Otherwise, ask the driver for the best format.
+ * It's important to try to choose a consistant format for all levels
+ * for efficient texture memory layout/allocation. In particular, this
+ * comes up during automatic mipmap generation.
+ */
+gl_format
+_mesa_choose_texture_format(struct gl_context *ctx,
+ struct gl_texture_object *texObj,
+ GLenum target, GLint level,
+ GLenum internalFormat, GLenum format, GLenum type)
+{
+ gl_format f;
+
+ /* see if we've already chosen a format for the previous level */
+ if (level > 0) {
+ struct gl_texture_image *prevImage =
+ _mesa_select_tex_image(ctx, texObj, target, level - 1);
+ /* See if the prev level is defined and has an internal format which
+ * matches the new internal format.
+ */
+ if (prevImage &&
+ prevImage->Width > 0 &&
+ prevImage->InternalFormat == internalFormat) {
+ /* use the same format */
+ ASSERT(prevImage->TexFormat != MESA_FORMAT_NONE);
+ return prevImage->TexFormat;
+ }
+ }
+
+ /* choose format from scratch */
+ f = ctx->Driver.ChooseTextureFormat(ctx, internalFormat, format, type);
+ ASSERT(f != MESA_FORMAT_NONE);
+ return f;
+}
+
+
+/**
+ * Common code to implement all the glTexImage1D/2D/3D functions.
+ */
+static void
+teximage(struct gl_context *ctx, GLuint dims,
+ GLenum target, GLint level, GLint internalFormat,
+ GLsizei width, GLsizei height, GLsizei depth,
+ GLint border, GLenum format, GLenum type,
+ const GLvoid *pixels)
+{
+ GLboolean error;
+
+ ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
+
+ if (MESA_VERBOSE & (VERBOSE_API|VERBOSE_TEXTURE))
+ _mesa_debug(ctx, "glTexImage%uD %s %d %s %d %d %d %d %s %s %p\n",
+ dims,
+ _mesa_lookup_enum_by_nr(target), level,
+ _mesa_lookup_enum_by_nr(internalFormat),
+ width, height, depth, border,
+ _mesa_lookup_enum_by_nr(format),
+ _mesa_lookup_enum_by_nr(type), pixels);
+
+ internalFormat = override_internal_format(internalFormat, width, height);
+
+ /* target error checking */
+ if (!legal_teximage_target(ctx, dims, target)) {
+ _mesa_error(ctx, GL_INVALID_ENUM, "glTexImage%uD(target=%s)",
+ dims, _mesa_lookup_enum_by_nr(target));
+ return;
+ }
+
+ /* general error checking */
+ error = texture_error_check(ctx, dims, target, level, internalFormat,
+ format, type, width, height, depth, border);
+
+ if (_mesa_is_proxy_texture(target)) {
+ /* Proxy texture: just clear or set state depending on error checking */
+ struct gl_texture_image *texImage =
+ _mesa_get_proxy_tex_image(ctx, target, level);
+
+ if (error) {
+ /* when error, clear all proxy texture image parameters */
+ if (texImage)
+ clear_teximage_fields(texImage);
+ }
+ else {
+ /* no error, set the tex image parameters */
+ struct gl_texture_object *texObj =
+ _mesa_get_current_tex_object(ctx, target);
+ gl_format texFormat = _mesa_choose_texture_format(ctx, texObj,
+ target, level,
+ internalFormat,
+ format, type);
+
+ if (legal_texture_size(ctx, texFormat, width, height, depth)) {
+ _mesa_init_teximage_fields(ctx, target, texImage, width, height,
+ depth, border, internalFormat,
+ texFormat);
+ }
+ else if (texImage) {
+ clear_teximage_fields(texImage);
+ }
+ }
+ }
+ else {
+ /* non-proxy target */
+ const GLuint face = _mesa_tex_target_to_face(target);
+ struct gl_texture_object *texObj;
+ struct gl_texture_image *texImage;
+
+ if (error) {
+ return; /* error was recorded */
+ }
+
+ if (ctx->NewState & _NEW_PIXEL)
+ _mesa_update_state(ctx);
+
+ texObj = _mesa_get_current_tex_object(ctx, target);
+
+ _mesa_lock_texture(ctx, texObj);
+ {
+ texImage = _mesa_get_tex_image(ctx, texObj, target, level);
+
+ if (!texImage) {
+ _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage%uD", dims);
+ }
+ else {
+ gl_format texFormat;
+
+ if (texImage->Data) {
+ ctx->Driver.FreeTexImageData( ctx, texImage );
+ }
+
+ ASSERT(texImage->Data == NULL);
+ texFormat = _mesa_choose_texture_format(ctx, texObj, target, level,
+ internalFormat, format,
+ type);
+
+ if (legal_texture_size(ctx, texFormat, width, height, depth)) {
+ _mesa_init_teximage_fields(ctx, target, texImage,
+ width, height, depth,
+ border, internalFormat, texFormat);
+
+ /* Give the texture to the driver. <pixels> may be null. */
+ ASSERT(ctx->Driver.TexImage3D);
+ switch (dims) {
+ case 1:
+ ctx->Driver.TexImage1D(ctx, target, level, internalFormat,
+ width, border, format,
+ type, pixels, &ctx->Unpack, texObj,
+ texImage);
+ break;
+ case 2:
+ ctx->Driver.TexImage2D(ctx, target, level, internalFormat,
+ width, height, border, format,
+ type, pixels, &ctx->Unpack, texObj,
+ texImage);
+ break;
+ case 3:
+ ctx->Driver.TexImage3D(ctx, target, level, internalFormat,
+ width, height, depth, border, format,
+ type, pixels, &ctx->Unpack, texObj,
+ texImage);
+ break;
+ default:
+ _mesa_problem(ctx, "invalid dims=%u in teximage()", dims);
+ }
+
+ check_gen_mipmap(ctx, target, texObj, level);
+
+ update_fbo_texture(ctx, texObj, face, level);
+
+ /* state update */
+ texObj->_Complete = GL_FALSE;
+ ctx->NewState |= _NEW_TEXTURE;
+ }
+ else {
+ _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage%uD", dims);
+ }
+ }
+ }
+ _mesa_unlock_texture(ctx, texObj);
+ }
+}
+
+
+/*
+ * Called from the API. Note that width includes the border.
+ */
+void GLAPIENTRY
+_mesa_TexImage1D( GLenum target, GLint level, GLint internalFormat,
+ GLsizei width, GLint border, GLenum format,
+ GLenum type, const GLvoid *pixels )
+{
+ GET_CURRENT_CONTEXT(ctx);
+ teximage(ctx, 1, target, level, internalFormat, width, 1, 1,
+ border, format, type, pixels);
+}
+
+
+void GLAPIENTRY
+_mesa_TexImage2D( GLenum target, GLint level, GLint internalFormat,
+ GLsizei width, GLsizei height, GLint border,
+ GLenum format, GLenum type,
+ const GLvoid *pixels )
+{
+ GET_CURRENT_CONTEXT(ctx);
+ teximage(ctx, 2, target, level, internalFormat, width, height, 1,
+ border, format, type, pixels);
+}
+
+
+/*
+ * Called by the API or display list executor.
+ * Note that width and height include the border.
+ */
+void GLAPIENTRY
+_mesa_TexImage3D( GLenum target, GLint level, GLint internalFormat,
+ GLsizei width, GLsizei height, GLsizei depth,
+ GLint border, GLenum format, GLenum type,
+ const GLvoid *pixels )
+{
+ GET_CURRENT_CONTEXT(ctx);
+ teximage(ctx, 3, target, level, internalFormat, width, height, depth,
+ border, format, type, pixels);
+}
+
+
+void GLAPIENTRY
+_mesa_TexImage3DEXT( GLenum target, GLint level, GLenum internalFormat,
+ GLsizei width, GLsizei height, GLsizei depth,
+ GLint border, GLenum format, GLenum type,
+ const GLvoid *pixels )
+{
+ _mesa_TexImage3D(target, level, (GLint) internalFormat, width, height,
+ depth, border, format, type, pixels);
+}
+
+
+#if FEATURE_OES_EGL_image
+void GLAPIENTRY
+_mesa_EGLImageTargetTexture2DOES (GLenum target, GLeglImageOES image)
+{
+ struct gl_texture_object *texObj;
+ struct gl_texture_image *texImage;
+ GET_CURRENT_CONTEXT(ctx);
+ ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
+
+ if (!ctx->Extensions.OES_EGL_image) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glEGLImageTargetTexture2DOES(unsupported)");
+ return;
+ }
+
+ if (target != GL_TEXTURE_2D) {
+ _mesa_error(ctx, GL_INVALID_ENUM,
+ "glEGLImageTargetTexture2D(target=%d)", target);
+ return;
+ }
+
+ if (ctx->NewState & _NEW_PIXEL)
+ _mesa_update_state(ctx);
+
+ texObj = _mesa_get_current_tex_object(ctx, target);
+ _mesa_lock_texture(ctx, texObj);
+
+ texImage = _mesa_get_tex_image(ctx, texObj, target, 0);
+ if (!texImage) {
+ _mesa_error(ctx, GL_OUT_OF_MEMORY, "glEGLImageTargetTexture2D");
+ } else {
+ if (texImage->Data)
+ ctx->Driver.FreeTexImageData( ctx, texImage );
+
+ ASSERT(texImage->Data == NULL);
+ ctx->Driver.EGLImageTargetTexture2D(ctx, target,
+ texObj, texImage, image);
+
+ /* state update */
+ texObj->_Complete = GL_FALSE;
+ ctx->NewState |= _NEW_TEXTURE;
+ }
+ _mesa_unlock_texture(ctx, texObj);
+
+}
+#endif
+
+
+
+/**
+ * Implement all the glTexSubImage1/2/3D() functions.
+ */
+static void
+texsubimage(struct gl_context *ctx, GLuint dims, GLenum target, GLint level,
+ GLint xoffset, GLint yoffset, GLint zoffset,
+ GLsizei width, GLsizei height, GLsizei depth,
+ GLenum format, GLenum type, const GLvoid *pixels )
+{
+ struct gl_texture_object *texObj;
+ struct gl_texture_image *texImage;
+
+ ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
+
+ if (MESA_VERBOSE & (VERBOSE_API|VERBOSE_TEXTURE))
+ _mesa_debug(ctx, "glTexSubImage%uD %s %d %d %d %d %d %d %d %s %s %p\n",
+ dims,
+ _mesa_lookup_enum_by_nr(target), level,
+ xoffset, yoffset, zoffset, width, height, depth,
+ _mesa_lookup_enum_by_nr(format),
+ _mesa_lookup_enum_by_nr(type), pixels);
+
+ /* check target (proxies not allowed) */
+ if (!legal_texsubimage_target(ctx, dims, target)) {
+ _mesa_error(ctx, GL_INVALID_ENUM, "glTexSubImage%uD(target=%s)",
+ dims, _mesa_lookup_enum_by_nr(target));
+ return;
+ }
+
+ if (ctx->NewState & _NEW_PIXEL)
+ _mesa_update_state(ctx);
+
+ if (subtexture_error_check(ctx, dims, target, level, xoffset, yoffset, zoffset,
+ width, height, depth, format, type)) {
+ return; /* error was detected */
+ }
+
+ texObj = _mesa_get_current_tex_object(ctx, target);
+
+ _mesa_lock_texture(ctx, texObj);
+ {
+ texImage = _mesa_select_tex_image(ctx, texObj, target, level);
+
+ if (subtexture_error_check2(ctx, dims, target, level,
+ xoffset, yoffset, zoffset,
+ width, height, depth,
+ format, type, texImage)) {
+ /* error was recorded */
+ }
+ else if (width > 0 && height > 0 && height > 0) {
+ /* If we have a border, offset=-1 is legal. Bias by border width. */
+ switch (dims) {
+ case 3:
+ zoffset += texImage->Border;
+ /* fall-through */
+ case 2:
+ yoffset += texImage->Border;
+ /* fall-through */
+ case 1:
+ xoffset += texImage->Border;
+ }
+
+ switch (dims) {
+ case 1:
+ ctx->Driver.TexSubImage1D(ctx, target, level,
+ xoffset, width,
+ format, type, pixels,
+ &ctx->Unpack, texObj, texImage );
+ break;
+ case 2:
+ ctx->Driver.TexSubImage2D(ctx, target, level,
+ xoffset, yoffset, width, height,
+ format, type, pixels,
+ &ctx->Unpack, texObj, texImage );
+ break;
+ case 3:
+ ctx->Driver.TexSubImage3D(ctx, target, level,
+ xoffset, yoffset, zoffset,
+ width, height, depth,
+ format, type, pixels,
+ &ctx->Unpack, texObj, texImage );
+ break;
+ default:
+ _mesa_problem(ctx, "unexpected dims in subteximage()");
+ }
+
+ check_gen_mipmap(ctx, target, texObj, level);
+
+ ctx->NewState |= _NEW_TEXTURE;
+ }
+ }
+ _mesa_unlock_texture(ctx, texObj);
+}
+
+
+void GLAPIENTRY
+_mesa_TexSubImage1D( GLenum target, GLint level,
+ GLint xoffset, GLsizei width,
+ GLenum format, GLenum type,
+ const GLvoid *pixels )
+{
+ GET_CURRENT_CONTEXT(ctx);
+ texsubimage(ctx, 1, target, level,
+ xoffset, 0, 0,
+ width, 1, 1,
+ format, type, pixels);
+}
+
+
+void GLAPIENTRY
+_mesa_TexSubImage2D( GLenum target, GLint level,
+ GLint xoffset, GLint yoffset,
+ GLsizei width, GLsizei height,
+ GLenum format, GLenum type,
+ const GLvoid *pixels )
+{
+ GET_CURRENT_CONTEXT(ctx);
+ texsubimage(ctx, 2, target, level,
+ xoffset, yoffset, 0,
+ width, height, 1,
+ format, type, pixels);
+}
+
+
+
+void GLAPIENTRY
+_mesa_TexSubImage3D( GLenum target, GLint level,
+ GLint xoffset, GLint yoffset, GLint zoffset,
+ GLsizei width, GLsizei height, GLsizei depth,
+ GLenum format, GLenum type,
+ const GLvoid *pixels )
+{
+ GET_CURRENT_CONTEXT(ctx);
+ texsubimage(ctx, 3, target, level,
+ xoffset, yoffset, zoffset,
+ width, height, depth,
+ format, type, pixels);
+}
+
+
+
+/**
+ * Implement the glCopyTexImage1/2D() functions.
+ */
+static void
+copyteximage(struct gl_context *ctx, GLuint dims,
+ GLenum target, GLint level, GLenum internalFormat,
+ GLint x, GLint y, GLsizei width, GLsizei height, GLint border )
+{
+ struct gl_texture_object *texObj;
+ struct gl_texture_image *texImage;
+ const GLuint face = _mesa_tex_target_to_face(target);
+
+ ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
+
+ if (MESA_VERBOSE & (VERBOSE_API|VERBOSE_TEXTURE))
+ _mesa_debug(ctx, "glCopyTexImage%uD %s %d %s %d %d %d %d %d\n",
+ dims,
+ _mesa_lookup_enum_by_nr(target), level,
+ _mesa_lookup_enum_by_nr(internalFormat),
+ x, y, width, height, border);
+
+ if (ctx->NewState & NEW_COPY_TEX_STATE)
+ _mesa_update_state(ctx);
+
+ if (copytexture_error_check(ctx, dims, target, level, internalFormat,
+ width, height, border))
+ return;
+
+ texObj = _mesa_get_current_tex_object(ctx, target);
+
+ _mesa_lock_texture(ctx, texObj);
+ {
+ texImage = _mesa_get_tex_image(ctx, texObj, target, level);
+
+ if (!texImage) {
+ _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyTexImage%uD", dims);
+ }
+ else {
+ gl_format texFormat;
+
+ if (texImage->Data) {
+ ctx->Driver.FreeTexImageData( ctx, texImage );
+ }
+
+ ASSERT(texImage->Data == NULL);
+
+ texFormat = _mesa_choose_texture_format(ctx, texObj, target, level,
+ internalFormat, GL_NONE,
+ GL_NONE);
+
+ if (legal_texture_size(ctx, texFormat, width, height, 1)) {
+ _mesa_init_teximage_fields(ctx, target, texImage, width, height, 1,
+ border, internalFormat, texFormat);
+
+ ASSERT(ctx->Driver.CopyTexImage2D);
+ if (dims == 1)
+ ctx->Driver.CopyTexImage1D(ctx, target, level, internalFormat,
+ x, y, width, border);
+ else
+ ctx->Driver.CopyTexImage2D(ctx, target, level, internalFormat,
+ x, y, width, height, border);
+
+ check_gen_mipmap(ctx, target, texObj, level);
+
+ update_fbo_texture(ctx, texObj, face, level);
+
+ /* state update */
+ texObj->_Complete = GL_FALSE;
+ ctx->NewState |= _NEW_TEXTURE;
+ }
+ else {
+ _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyTexImage%uD", dims);
+ }
+ }
+ }
+ _mesa_unlock_texture(ctx, texObj);
+}
+
+
+
+void GLAPIENTRY
+_mesa_CopyTexImage1D( GLenum target, GLint level,
+ GLenum internalFormat,
+ GLint x, GLint y,
+ GLsizei width, GLint border )
+{
+ GET_CURRENT_CONTEXT(ctx);
+ copyteximage(ctx, 1, target, level, internalFormat, x, y, width, 1, border);
+}
+
+
+
+void GLAPIENTRY
+_mesa_CopyTexImage2D( GLenum target, GLint level, GLenum internalFormat,
+ GLint x, GLint y, GLsizei width, GLsizei height,
+ GLint border )
+{
+ GET_CURRENT_CONTEXT(ctx);
+ copyteximage(ctx, 2, target, level, internalFormat,
+ x, y, width, height, border);
+}
+
+
+
+/**
+ * Implementation for glCopyTexSubImage1/2/3D() functions.
+ */
+static void
+copytexsubimage(struct gl_context *ctx, GLuint dims, GLenum target, GLint level,
+ GLint xoffset, GLint yoffset, GLint zoffset,
+ GLint x, GLint y, GLsizei width, GLsizei height)
+{
+ struct gl_texture_object *texObj;
+ struct gl_texture_image *texImage;
+
+ ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
+
+ if (MESA_VERBOSE & (VERBOSE_API|VERBOSE_TEXTURE))
+ _mesa_debug(ctx, "glCopyTexSubImage%uD %s %d %d %d %d %d %d %d %d\n",
+ dims,
+ _mesa_lookup_enum_by_nr(target),
+ level, xoffset, yoffset, zoffset, x, y, width, height);
+
+ if (ctx->NewState & NEW_COPY_TEX_STATE)
+ _mesa_update_state(ctx);
+
+ if (copytexsubimage_error_check1(ctx, dims, target, level))
+ return;
+
+ texObj = _mesa_get_current_tex_object(ctx, target);
+
+ _mesa_lock_texture(ctx, texObj);
+ {
+ texImage = _mesa_select_tex_image(ctx, texObj, target, level);
+
+ if (copytexsubimage_error_check2(ctx, dims, target, level, xoffset, yoffset,
+ zoffset, width, height, texImage)) {
+ /* error was recored */
+ }
+ else {
+ /* If we have a border, offset=-1 is legal. Bias by border width. */
+ switch (dims) {
+ case 3:
+ zoffset += texImage->Border;
+ /* fall-through */
+ case 2:
+ yoffset += texImage->Border;
+ /* fall-through */
+ case 1:
+ xoffset += texImage->Border;
+ }
+
+ if (_mesa_clip_copytexsubimage(ctx, &xoffset, &yoffset, &x, &y,
+ &width, &height)) {
+ switch (dims) {
+ case 1:
+ ctx->Driver.CopyTexSubImage1D(ctx, target, level,
+ xoffset, x, y, width);
+ break;
+ case 2:
+ ctx->Driver.CopyTexSubImage2D(ctx, target, level,
+ xoffset, yoffset,
+ x, y, width, height);
+ break;
+ case 3:
+ ctx->Driver.CopyTexSubImage3D(ctx, target, level,
+ xoffset, yoffset, zoffset,
+ x, y, width, height);
+ break;
+ default:
+ _mesa_problem(ctx, "bad dims in copytexsubimage()");
+ }
+
+ check_gen_mipmap(ctx, target, texObj, level);
+
+ ctx->NewState |= _NEW_TEXTURE;
+ }
+ }
+ }
+ _mesa_unlock_texture(ctx, texObj);
+}
+
+
+void GLAPIENTRY
+_mesa_CopyTexSubImage1D( GLenum target, GLint level,
+ GLint xoffset, GLint x, GLint y, GLsizei width )
+{
+ GET_CURRENT_CONTEXT(ctx);
+ copytexsubimage(ctx, 1, target, level, xoffset, 0, 0, x, y, width, 1);
+}
+
+
+
+void GLAPIENTRY
+_mesa_CopyTexSubImage2D( GLenum target, GLint level,
+ GLint xoffset, GLint yoffset,
+ GLint x, GLint y, GLsizei width, GLsizei height )
+{
+ GET_CURRENT_CONTEXT(ctx);
+ copytexsubimage(ctx, 2, target, level, xoffset, yoffset, 0, x, y,
+ width, height);
+}
+
+
+
+void GLAPIENTRY
+_mesa_CopyTexSubImage3D( GLenum target, GLint level,
+ GLint xoffset, GLint yoffset, GLint zoffset,
+ GLint x, GLint y, GLsizei width, GLsizei height )
+{
+ GET_CURRENT_CONTEXT(ctx);
+ copytexsubimage(ctx, 3, target, level, xoffset, yoffset, zoffset,
+ x, y, width, height);
+}
+
+
+
+
+/**********************************************************************/
+/****** Compressed Textures ******/
+/**********************************************************************/
+
+
+/**
+ * Return expected size of a compressed texture.
+ */
+static GLuint
+compressed_tex_size(GLsizei width, GLsizei height, GLsizei depth,
+ GLenum glformat)
+{
+ gl_format mesaFormat = _mesa_glenum_to_compressed_format(glformat);
+ return _mesa_format_image_size(mesaFormat, width, height, depth);
+}
+
+
+/*
+ * Return compressed texture block size, in pixels.
+ */
+static void
+get_compressed_block_size(GLenum glformat, GLuint *bw, GLuint *bh)
+{
+ gl_format mesaFormat = _mesa_glenum_to_compressed_format(glformat);
+ _mesa_get_format_block_size(mesaFormat, bw, bh);
+}
+
+
+/**
+ * Error checking for glCompressedTexImage[123]D().
+ * \param reason returns reason for error, if any
+ * \return error code or GL_NO_ERROR.
+ */
+static GLenum
+compressed_texture_error_check(struct gl_context *ctx, GLint dimensions,
+ GLenum target, GLint level,
+ GLenum internalFormat, GLsizei width,
+ GLsizei height, GLsizei depth, GLint border,
+ GLsizei imageSize, char **reason)
+{
+ const GLenum proxyTarget = get_proxy_target(target);
+ const GLint maxLevels = _mesa_max_texture_levels(ctx, target);
+ GLint expectedSize;
+
+ *reason = ""; /* no error */
+
+ /* check level */
+ if (level < 0 || level >= maxLevels) {
+ *reason = "level";
+ return GL_INVALID_VALUE;
+ }
+
+ if (!target_can_be_compressed(ctx, target, internalFormat)) {
+ *reason = "target";
+ return GL_INVALID_ENUM;
+ }
+
+ /* This will detect any invalid internalFormat value */
+ if (!_mesa_is_compressed_format(ctx, internalFormat)) {
+ *reason = "internalFormat";
+ return GL_INVALID_ENUM;
+ }
+
+ /* This should really never fail */
+ if (_mesa_base_tex_format(ctx, internalFormat) < 0) {
+ *reason = "internalFormat";
+ return GL_INVALID_ENUM;
+ }
+
+ /* No compressed formats support borders at this time */
+ if (border != 0) {
+ *reason = "border != 0";
+ return GL_INVALID_VALUE;
+ }
+
+ /* For cube map, width must equal height */
+ if (target >= GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB &&
+ target <= GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB && width != height) {
+ *reason = "width != height";
+ return GL_INVALID_VALUE;
+ }
+
+ /* check image size against compression block size */
+ {
+ gl_format texFormat =
+ ctx->Driver.ChooseTextureFormat(ctx, internalFormat,
+ GL_NONE, GL_NONE);
+ GLuint bw, bh;
+
+ _mesa_get_format_block_size(texFormat, &bw, &bh);
+ if ((width > bw && width % bw > 0) ||
+ (height > bh && height % bh > 0)) {
+ /*
+ * Per GL_ARB_texture_compression: GL_INVALID_OPERATION is
+ * generated [...] if any parameter combinations are not
+ * supported by the specific compressed internal format.
+ */
+ *reason = "invalid width or height for compression format";
+ return GL_INVALID_OPERATION;
+ }
+ }
+
+ /* check image sizes */
+ if (!ctx->Driver.TestProxyTexImage(ctx, proxyTarget, level,
+ internalFormat, GL_NONE, GL_NONE,
+ width, height, depth, border)) {
+ /* See error comment above */
+ *reason = "invalid width, height or format";
+ return GL_INVALID_OPERATION;
+ }
+
+ /* check image size in bytes */
+ expectedSize = compressed_tex_size(width, height, depth, internalFormat);
+ if (expectedSize != imageSize) {
+ /* Per GL_ARB_texture_compression: GL_INVALID_VALUE is generated [...]
+ * if <imageSize> is not consistent with the format, dimensions, and
+ * contents of the specified image.
+ */
+ *reason = "imageSize inconsistant with width/height/format";
+ return GL_INVALID_VALUE;
+ }
+
+ return GL_NO_ERROR;
+}
+
+
+/**
+ * Error checking for glCompressedTexSubImage[123]D().
+ * \warning There are some bad assumptions here about the size of compressed
+ * texture tiles (multiple of 4) used to test the validity of the
+ * offset and size parameters.
+ * \return error code or GL_NO_ERROR.
+ */
+static GLenum
+compressed_subtexture_error_check(struct gl_context *ctx, GLint dimensions,
+ GLenum target, GLint level,
+ GLint xoffset, GLint yoffset, GLint zoffset,
+ GLsizei width, GLsizei height, GLsizei depth,
+ GLenum format, GLsizei imageSize)
+{
+ GLint expectedSize, maxLevels = 0, maxTextureSize;
+ GLuint bw, bh;
+ (void) zoffset;
+
+ if (dimensions == 1) {
+ /* 1D compressed textures not allowed */
+ return GL_INVALID_ENUM;
+ }
+ else if (dimensions == 2) {
+ if (target == GL_PROXY_TEXTURE_2D) {
+ maxLevels = ctx->Const.MaxTextureLevels;
+ }
+ else if (target == GL_TEXTURE_2D) {
+ maxLevels = ctx->Const.MaxTextureLevels;
+ }
+ else if (target == GL_PROXY_TEXTURE_CUBE_MAP_ARB) {
+ if (!ctx->Extensions.ARB_texture_cube_map)
+ return GL_INVALID_ENUM; /*target*/
+ maxLevels = ctx->Const.MaxCubeTextureLevels;
+ }
+ else if (target >= GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB &&
+ target <= GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB) {
+ if (!ctx->Extensions.ARB_texture_cube_map)
+ return GL_INVALID_ENUM; /*target*/
+ maxLevels = ctx->Const.MaxCubeTextureLevels;
+ }
+ else {
+ return GL_INVALID_ENUM; /*target*/
+ }
+ }
+ else if (dimensions == 3) {
+ /* 3D compressed textures not allowed */
+ return GL_INVALID_ENUM;
+ }
+
+ maxTextureSize = 1 << (maxLevels - 1);
+
+ /* this will catch any invalid compressed format token */
+ if (!_mesa_is_compressed_format(ctx, format))
+ return GL_INVALID_ENUM;
+
+ if (width < 1 || width > maxTextureSize)
+ return GL_INVALID_VALUE;
+
+ if ((height < 1 || height > maxTextureSize)
+ && dimensions > 1)
+ return GL_INVALID_VALUE;
+
+ if (level < 0 || level >= maxLevels)
+ return GL_INVALID_VALUE;
+
+ /*
+ * do checks which depend on compression block size
+ */
+ get_compressed_block_size(format, &bw, &bh);
+
+ if ((xoffset % bw != 0) || (yoffset % bh != 0))
+ return GL_INVALID_VALUE;
+
+ if ((width % bw != 0) && width != 2 && width != 1)
+ return GL_INVALID_VALUE;
+
+ if ((height % bh != 0) && height != 2 && height != 1)
+ return GL_INVALID_VALUE;
+
+ expectedSize = compressed_tex_size(width, height, depth, format);
+ if (expectedSize != imageSize)
+ return GL_INVALID_VALUE;
+
+ return GL_NO_ERROR;
+}
+
+
+/**
+ * Do second part of glCompressedTexSubImage error checking.
+ * \return GL_TRUE if error found, GL_FALSE otherwise.
+ */
+static GLboolean
+compressed_subtexture_error_check2(struct gl_context *ctx, GLuint dims,
+ GLsizei width, GLsizei height,
+ GLsizei depth, GLenum format,
+ struct gl_texture_image *texImage)
+{
+
+ if ((GLint) format != texImage->InternalFormat) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glCompressedTexSubImage%uD(format=0x%x)", dims, format);
+ return GL_TRUE;
+ }
+
+ if (((width == 1 || width == 2) &&
+ width != (GLsizei) texImage->Width) ||
+ (width > (GLsizei) texImage->Width)) {
+ _mesa_error(ctx, GL_INVALID_VALUE,
+ "glCompressedTexSubImage%uD(width=%d)", dims, width);
+ return GL_TRUE;
+ }
+
+ if (dims >= 2) {
+ if (((height == 1 || height == 2) &&
+ height != (GLsizei) texImage->Height) ||
+ (height > (GLsizei) texImage->Height)) {
+ _mesa_error(ctx, GL_INVALID_VALUE,
+ "glCompressedTexSubImage%uD(height=%d)", dims, height);
+ return GL_TRUE;
+ }
+ }
+
+ if (dims >= 3) {
+ if (((depth == 1 || depth == 2) &&
+ depth != (GLsizei) texImage->Depth) ||
+ (depth > (GLsizei) texImage->Depth)) {
+ _mesa_error(ctx, GL_INVALID_VALUE,
+ "glCompressedTexSubImage%uD(depth=%d)", dims, depth);
+ return GL_TRUE;
+ }
+ }
+
+ return GL_FALSE;
+}
+
+
+/**
+ * Implementation of the glCompressedTexImage1/2/3D() functions.
+ */
+static void
+compressedteximage(struct gl_context *ctx, GLuint dims,
+ GLenum target, GLint level,
+ GLenum internalFormat, GLsizei width,
+ GLsizei height, GLsizei depth, GLint border,
+ GLsizei imageSize, const GLvoid *data)
+{
+ GLenum error;
+ char *reason = "";
+
+ ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
+
+ if (MESA_VERBOSE & (VERBOSE_API|VERBOSE_TEXTURE))
+ _mesa_debug(ctx,
+ "glCompressedTexImage%uDARB %s %d %s %d %d %d %d %d %p\n",
+ dims,
+ _mesa_lookup_enum_by_nr(target), level,
+ _mesa_lookup_enum_by_nr(internalFormat),
+ width, height, depth, border, imageSize, data);
+
+ /* check target */
+ if (!legal_teximage_target(ctx, dims, target)) {
+ _mesa_error(ctx, GL_INVALID_ENUM, "glCompressedTexImage%uD(target=%s)",
+ dims, _mesa_lookup_enum_by_nr(target));
+ return;
+ }
+
+ error = compressed_texture_error_check(ctx, dims, target, level,
+ internalFormat, width, height, depth,
+ border, imageSize, &reason);
+
+ if (error) {
+ _mesa_error(ctx, error, "glTexImage2D(%s)", reason);
+ return;
+ }
+
+#if FEATURE_ES
+ /* XXX this is kind of a hack */
+ if (dims == 2) {
+ switch (internalFormat) {
+ case GL_PALETTE4_RGB8_OES:
+ case GL_PALETTE4_RGBA8_OES:
+ case GL_PALETTE4_R5_G6_B5_OES:
+ case GL_PALETTE4_RGBA4_OES:
+ case GL_PALETTE4_RGB5_A1_OES:
+ case GL_PALETTE8_RGB8_OES:
+ case GL_PALETTE8_RGBA8_OES:
+ case GL_PALETTE8_R5_G6_B5_OES:
+ case GL_PALETTE8_RGBA4_OES:
+ case GL_PALETTE8_RGB5_A1_OES:
+ _mesa_cpal_compressed_teximage2d(target, level, internalFormat,
+ width, height, imageSize, data);
+ return;
+ }
+ }
+#endif
+
+ if (_mesa_is_proxy_texture(target)) {
+ /* Proxy texture: just check for errors and update proxy state */
+ struct gl_texture_image *texImage;
+
+ if (!error) {
+ struct gl_texture_object *texObj =
+ _mesa_get_current_tex_object(ctx, target);
+ gl_format texFormat =
+ _mesa_choose_texture_format(ctx, texObj, target, level,
+ internalFormat, GL_NONE, GL_NONE);
+ if (!legal_texture_size(ctx, texFormat, width, height, depth)) {
+ error = GL_OUT_OF_MEMORY;
+ }
+ }
+
+ texImage = _mesa_get_proxy_tex_image(ctx, target, level);
+ if (texImage) {
+ if (error) {
+ /* if error, clear all proxy texture image parameters */
+ clear_teximage_fields(texImage);
+ }
+ else {
+ /* no error: store the teximage parameters */
+ _mesa_init_teximage_fields(ctx, target, texImage, width, height,
+ depth, border, internalFormat,
+ MESA_FORMAT_NONE);
+ }
+ }
+ }
+ else {
+ /* non-proxy target */
+ struct gl_texture_object *texObj;
+ struct gl_texture_image *texImage;
+
+ if (error) {
+ _mesa_error(ctx, error, "glCompressedTexImage%uD", dims);
+ return;
+ }
+
+ texObj = _mesa_get_current_tex_object(ctx, target);
+
+ _mesa_lock_texture(ctx, texObj);
+ {
+ texImage = _mesa_get_tex_image(ctx, texObj, target, level);
+ if (!texImage) {
+ _mesa_error(ctx, GL_OUT_OF_MEMORY,
+ "glCompressedTexImage%uD", dims);
+ }
+ else {
+ gl_format texFormat;
+
+ if (texImage->Data) {
+ ctx->Driver.FreeTexImageData( ctx, texImage );
+ }
+ ASSERT(texImage->Data == NULL);
+
+ texFormat = _mesa_choose_texture_format(ctx, texObj, target, level,
+ internalFormat, GL_NONE,
+ GL_NONE);
+
+ if (legal_texture_size(ctx, texFormat, width, height, depth)) {
+ _mesa_init_teximage_fields(ctx, target, texImage,
+ width, height, depth,
+ border, internalFormat, texFormat);
+
+ switch (dims) {
+ case 1:
+ ASSERT(ctx->Driver.CompressedTexImage1D);
+ ctx->Driver.CompressedTexImage1D(ctx, target, level,
+ internalFormat,
+ width,
+ border, imageSize, data,
+ texObj, texImage);
+ break;
+ case 2:
+ ASSERT(ctx->Driver.CompressedTexImage2D);
+ ctx->Driver.CompressedTexImage2D(ctx, target, level,
+ internalFormat,
+ width, height,
+ border, imageSize, data,
+ texObj, texImage);
+ break;
+ case 3:
+ ASSERT(ctx->Driver.CompressedTexImage3D);
+ ctx->Driver.CompressedTexImage3D(ctx, target, level,
+ internalFormat,
+ width, height, depth,
+ border, imageSize, data,
+ texObj, texImage);
+ break;
+ default:
+ _mesa_problem(ctx, "bad dims in compressedteximage");
+ }
+
+ check_gen_mipmap(ctx, target, texObj, level);
+
+ /* state update */
+ texObj->_Complete = GL_FALSE;
+ ctx->NewState |= _NEW_TEXTURE;
+ }
+ else {
+ _mesa_error(ctx, GL_OUT_OF_MEMORY,
+ "glCompressedTexImage%uD", dims);
+ }
+ }
+ }
+ _mesa_unlock_texture(ctx, texObj);
+ }
+}
+
+
+void GLAPIENTRY
+_mesa_CompressedTexImage1DARB(GLenum target, GLint level,
+ GLenum internalFormat, GLsizei width,
+ GLint border, GLsizei imageSize,
+ const GLvoid *data)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ compressedteximage(ctx, 1, target, level, internalFormat,
+ width, 1, 1, border, imageSize, data);
+}
+
+
+void GLAPIENTRY
+_mesa_CompressedTexImage2DARB(GLenum target, GLint level,
+ GLenum internalFormat, GLsizei width,
+ GLsizei height, GLint border, GLsizei imageSize,
+ const GLvoid *data)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ compressedteximage(ctx, 2, target, level, internalFormat,
+ width, height, 1, border, imageSize, data);
+}
+
+
+void GLAPIENTRY
+_mesa_CompressedTexImage3DARB(GLenum target, GLint level,
+ GLenum internalFormat, GLsizei width,
+ GLsizei height, GLsizei depth, GLint border,
+ GLsizei imageSize, const GLvoid *data)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ compressedteximage(ctx, 3, target, level, internalFormat,
+ width, height, depth, border, imageSize, data);
+}
+
+
+/**
+ * Common helper for glCompressedTexSubImage1/2/3D().
+ */
+static void
+compressed_tex_sub_image(GLuint dims, GLenum target, GLint level,
+ GLint xoffset, GLint yoffset, GLint zoffset,
+ GLsizei width, GLsizei height, GLsizei depth,
+ GLenum format, GLsizei imageSize, const GLvoid *data)
+{
+ struct gl_texture_object *texObj;
+ struct gl_texture_image *texImage;
+ GLenum error;
+ GET_CURRENT_CONTEXT(ctx);
+ ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
+
+ error = compressed_subtexture_error_check(ctx, dims, target, level,
+ xoffset, 0, 0, /* pos */
+ width, height, depth, /* size */
+ format, imageSize);
+ if (error) {
+ _mesa_error(ctx, error, "glCompressedTexSubImage%uD", dims);
+ return;
+ }
+
+ texObj = _mesa_get_current_tex_object(ctx, target);
+
+ _mesa_lock_texture(ctx, texObj);
+ {
+ texImage = _mesa_select_tex_image(ctx, texObj, target, level);
+ assert(texImage);
+
+ if (compressed_subtexture_error_check2(ctx, dims, width, height, depth,
+ format, texImage)) {
+ /* error was recorded */
+ }
+ else if (width > 0 && height > 0 && depth > 0) {
+ switch (dims) {
+ case 1:
+ if (ctx->Driver.CompressedTexSubImage1D) {
+ ctx->Driver.CompressedTexSubImage1D(ctx, target, level,
+ xoffset, width,
+ format, imageSize, data,
+ texObj, texImage);
+ }
+ break;
+ case 2:
+ if (ctx->Driver.CompressedTexSubImage2D) {
+ ctx->Driver.CompressedTexSubImage2D(ctx, target, level,
+ xoffset, yoffset,
+ width, height,
+ format, imageSize, data,
+ texObj, texImage);
+ }
+ break;
+ case 3:
+ if (ctx->Driver.CompressedTexSubImage3D) {
+ ctx->Driver.CompressedTexSubImage3D(ctx, target, level,
+ xoffset, yoffset, zoffset,
+ width, height, depth,
+ format, imageSize, data,
+ texObj, texImage);
+ }
+ break;
+ default:
+ ;
+ }
+
+ check_gen_mipmap(ctx, target, texObj, level);
+
+ ctx->NewState |= _NEW_TEXTURE;
+ }
+ }
+ _mesa_unlock_texture(ctx, texObj);
+}
+
+
+void GLAPIENTRY
+_mesa_CompressedTexSubImage1DARB(GLenum target, GLint level, GLint xoffset,
+ GLsizei width, GLenum format,
+ GLsizei imageSize, const GLvoid *data)
+{
+ compressed_tex_sub_image(1, target, level, xoffset, 0, 0, width, 1, 1,
+ format, imageSize, data);
+}
+
+
+void GLAPIENTRY
+_mesa_CompressedTexSubImage2DARB(GLenum target, GLint level, GLint xoffset,
+ GLint yoffset, GLsizei width, GLsizei height,
+ GLenum format, GLsizei imageSize,
+ const GLvoid *data)
+{
+ compressed_tex_sub_image(2, target, level, xoffset, yoffset, 0,
+ width, height, 1, format, imageSize, data);
+}
+
+
+void GLAPIENTRY
+_mesa_CompressedTexSubImage3DARB(GLenum target, GLint level, GLint xoffset,
+ GLint yoffset, GLint zoffset, GLsizei width,
+ GLsizei height, GLsizei depth, GLenum format,
+ GLsizei imageSize, const GLvoid *data)
+{
+ compressed_tex_sub_image(3, target, level, xoffset, yoffset, zoffset,
+ width, height, depth, format, imageSize, data);
+}
+
+
+/**
+ * Helper for glTexBuffer(). Check if internalFormat is legal. If so,
+ * return the basic data type and number of components for the format.
+ * \param return GL_TRUE if internalFormat is legal, GL_FALSE otherwise
+ */
+static GLboolean
+get_sized_format_info(const struct gl_context *ctx, GLenum internalFormat,
+ GLenum *datatype, GLuint *components)
+{
+ switch (internalFormat) {
+ case GL_ALPHA8:
+ *datatype = GL_UNSIGNED_BYTE;
+ *components = 1;
+ break;
+ case GL_ALPHA16:
+ *datatype = GL_UNSIGNED_SHORT;
+ *components = 1;
+ break;
+ case GL_ALPHA16F_ARB:
+ *datatype = GL_HALF_FLOAT;
+ *components = 1;
+ break;
+ case GL_ALPHA32F_ARB:
+ *datatype = GL_FLOAT;
+ *components = 1;
+ break;
+ case GL_ALPHA8I_EXT:
+ *datatype = GL_BYTE;
+ *components = 1;
+ break;
+ case GL_ALPHA16I_EXT:
+ *datatype = GL_SHORT;
+ *components = 1;
+ break;
+ case GL_ALPHA32I_EXT:
+ *datatype = GL_INT;
+ *components = 1;
+ break;
+ case GL_ALPHA8UI_EXT:
+ *datatype = GL_UNSIGNED_BYTE;
+ *components = 1;
+ break;
+ case GL_ALPHA16UI_EXT:
+ *datatype = GL_UNSIGNED_SHORT;
+ *components = 1;
+ break;
+ case GL_ALPHA32UI_EXT:
+ *datatype = GL_UNSIGNED_INT;
+ *components = 1;
+ break;
+ case GL_LUMINANCE8:
+ *datatype = GL_UNSIGNED_BYTE;
+ *components = 1;
+ break;
+ case GL_LUMINANCE16:
+ *datatype = GL_UNSIGNED_SHORT;
+ *components = 1;
+ break;
+ case GL_LUMINANCE16F_ARB:
+ *datatype = GL_HALF_FLOAT;
+ *components = 1;
+ break;
+ case GL_LUMINANCE32F_ARB:
+ *datatype = GL_FLOAT;
+ *components = 1;
+ break;
+ case GL_LUMINANCE8I_EXT:
+ *datatype = GL_BYTE;
+ *components = 1;
+ break;
+ case GL_LUMINANCE16I_EXT:
+ *datatype = GL_SHORT;
+ *components = 1;
+ break;
+ case GL_LUMINANCE32I_EXT:
+ *datatype = GL_INT;
+ *components = 1;
+ break;
+ case GL_LUMINANCE8UI_EXT:
+ *datatype = GL_UNSIGNED_BYTE;
+ *components = 1;
+ break;
+ case GL_LUMINANCE16UI_EXT:
+ *datatype = GL_UNSIGNED_SHORT;
+ *components = 1;
+ break;
+ case GL_LUMINANCE32UI_EXT:
+ *datatype = GL_UNSIGNED_INT;
+ *components = 1;
+ break;
+ case GL_LUMINANCE8_ALPHA8:
+ *datatype = GL_UNSIGNED_BYTE;
+ *components = 2;
+ break;
+ case GL_LUMINANCE16_ALPHA16:
+ *datatype = GL_UNSIGNED_SHORT;
+ *components = 2;
+ break;
+ case GL_LUMINANCE_ALPHA16F_ARB:
+ *datatype = GL_HALF_FLOAT;
+ *components = 2;
+ break;
+ case GL_LUMINANCE_ALPHA32F_ARB:
+ *datatype = GL_FLOAT;
+ *components = 2;
+ break;
+ case GL_LUMINANCE_ALPHA8I_EXT:
+ *datatype = GL_BYTE;
+ *components = 2;
+ break;
+ case GL_LUMINANCE_ALPHA16I_EXT:
+ *datatype = GL_SHORT;
+ *components = 2;
+ break;
+ case GL_LUMINANCE_ALPHA32I_EXT:
+ *datatype = GL_INT;
+ *components = 2;
+ break;
+ case GL_LUMINANCE_ALPHA8UI_EXT:
+ *datatype = GL_UNSIGNED_BYTE;
+ *components = 2;
+ break;
+ case GL_LUMINANCE_ALPHA16UI_EXT:
+ *datatype = GL_UNSIGNED_SHORT;
+ *components = 2;
+ break;
+ case GL_LUMINANCE_ALPHA32UI_EXT:
+ *datatype = GL_UNSIGNED_INT;
+ *components = 2;
+ break;
+ case GL_INTENSITY8:
+ *datatype = GL_UNSIGNED_BYTE;
+ *components = 1;
+ break;
+ case GL_INTENSITY16:
+ *datatype = GL_UNSIGNED_SHORT;
+ *components = 1;
+ break;
+ case GL_INTENSITY16F_ARB:
+ *datatype = GL_HALF_FLOAT;
+ *components = 1;
+ break;
+ case GL_INTENSITY32F_ARB:
+ *datatype = GL_FLOAT;
+ *components = 1;
+ break;
+ case GL_INTENSITY8I_EXT:
+ *datatype = GL_BYTE;
+ *components = 1;
+ break;
+ case GL_INTENSITY16I_EXT:
+ *datatype = GL_SHORT;
+ *components = 1;
+ break;
+ case GL_INTENSITY32I_EXT:
+ *datatype = GL_INT;
+ *components = 1;
+ break;
+ case GL_INTENSITY8UI_EXT:
+ *datatype = GL_UNSIGNED_BYTE;
+ *components = 1;
+ break;
+ case GL_INTENSITY16UI_EXT:
+ *datatype = GL_UNSIGNED_SHORT;
+ *components = 1;
+ break;
+ case GL_INTENSITY32UI_EXT:
+ *datatype = GL_UNSIGNED_INT;
+ *components = 1;
+ break;
+ case GL_RGBA8:
+ *datatype = GL_UNSIGNED_BYTE;
+ *components = 4;
+ break;
+ case GL_RGBA16:
+ *datatype = GL_UNSIGNED_SHORT;
+ *components = 4;
+ break;
+ case GL_RGBA16F_ARB:
+ *datatype = GL_HALF_FLOAT;
+ *components = 4;
+ break;
+ case GL_RGBA32F_ARB:
+ *datatype = GL_FLOAT;
+ *components = 4;
+ break;
+ case GL_RGBA8I_EXT:
+ *datatype = GL_BYTE;
+ *components = 4;
+ break;
+ case GL_RGBA16I_EXT:
+ *datatype = GL_SHORT;
+ *components = 4;
+ break;
+ case GL_RGBA32I_EXT:
+ *datatype = GL_INT;
+ *components = 4;
+ break;
+ case GL_RGBA8UI_EXT:
+ *datatype = GL_UNSIGNED_BYTE;
+ *components = 4;
+ break;
+ case GL_RGBA16UI_EXT:
+ *datatype = GL_UNSIGNED_SHORT;
+ *components = 4;
+ break;
+ case GL_RGBA32UI_EXT:
+ *datatype = GL_UNSIGNED_INT;
+ *components = 4;
+ break;
+ default:
+ return GL_FALSE;
+ }
+
+ if (*datatype == GL_FLOAT && !ctx->Extensions.ARB_texture_float)
+ return GL_FALSE;
+
+ if (*datatype == GL_HALF_FLOAT && !ctx->Extensions.ARB_half_float_pixel)
+ return GL_FALSE;
+
+ return GL_TRUE;
+}
+
+
+/** GL_ARB_texture_buffer_object */
+void GLAPIENTRY
+_mesa_TexBuffer(GLenum target, GLenum internalFormat, GLuint buffer)
+{
+ struct gl_texture_object *texObj;
+ struct gl_buffer_object *bufObj;
+ GLenum dataType;
+ GLuint comps;
+
+ GET_CURRENT_CONTEXT(ctx);
+ ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
+
+ if (!ctx->Extensions.ARB_texture_buffer_object) {
+ _mesa_error(ctx, GL_INVALID_OPERATION, "glTexBuffer");
+ return;
+ }
+
+ if (target != GL_TEXTURE_BUFFER_ARB) {
+ _mesa_error(ctx, GL_INVALID_ENUM, "glTexBuffer(target)");
+ return;
+ }
+
+ if (!get_sized_format_info(ctx, internalFormat, &dataType, &comps)) {
+ _mesa_error(ctx, GL_INVALID_ENUM, "glTexBuffer(internalFormat 0x%x)",
+ internalFormat);
+ return;
+ }
+
+ bufObj = _mesa_lookup_bufferobj(ctx, buffer);
+ if (buffer && !bufObj) {
+ _mesa_error(ctx, GL_INVALID_OPERATION, "glTexBuffer(buffer %u)", buffer);
+ return;
+ }
+
+ texObj = _mesa_get_current_tex_object(ctx, target);
+
+ _mesa_lock_texture(ctx, texObj);
+ {
+ _mesa_reference_buffer_object(ctx, &texObj->BufferObject, bufObj);
+ texObj->BufferObjectFormat = internalFormat;
+ }
+ _mesa_unlock_texture(ctx, texObj);
+}
diff --git a/mesalib/src/mesa/main/texobj.c b/mesalib/src/mesa/main/texobj.c
index fdf12817c..ffce68a0e 100644
--- a/mesalib/src/mesa/main/texobj.c
+++ b/mesalib/src/mesa/main/texobj.c
@@ -1,1279 +1,1279 @@
-/**
- * \file texobj.c
- * Texture object management.
- */
-
-/*
- * Mesa 3-D graphics library
- * Version: 7.1
- *
- * Copyright (C) 1999-2007 Brian Paul All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-
-#include "mfeatures.h"
-#include "bufferobj.h"
-#include "colortab.h"
-#include "context.h"
-#include "enums.h"
-#include "fbobject.h"
-#include "formats.h"
-#include "hash.h"
-#include "imports.h"
-#include "macros.h"
-#include "teximage.h"
-#include "texobj.h"
-#include "texstate.h"
-#include "mtypes.h"
-#include "program/prog_instruction.h"
-
-
-
-/**********************************************************************/
-/** \name Internal functions */
-/*@{*/
-
-
-/**
- * Return the gl_texture_object for a given ID.
- */
-struct gl_texture_object *
-_mesa_lookup_texture(struct gl_context *ctx, GLuint id)
-{
- return (struct gl_texture_object *)
- _mesa_HashLookup(ctx->Shared->TexObjects, id);
-}
-
-
-
-/**
- * Allocate and initialize a new texture object. But don't put it into the
- * texture object hash table.
- *
- * Called via ctx->Driver.NewTextureObject, unless overridden by a device
- * driver.
- *
- * \param shared the shared GL state structure to contain the texture object
- * \param name integer name for the texture object
- * \param target either GL_TEXTURE_1D, GL_TEXTURE_2D, GL_TEXTURE_3D,
- * GL_TEXTURE_CUBE_MAP_ARB or GL_TEXTURE_RECTANGLE_NV. zero is ok for the sake
- * of GenTextures()
- *
- * \return pointer to new texture object.
- */
-struct gl_texture_object *
-_mesa_new_texture_object( struct gl_context *ctx, GLuint name, GLenum target )
-{
- struct gl_texture_object *obj;
- (void) ctx;
- obj = MALLOC_STRUCT(gl_texture_object);
- _mesa_initialize_texture_object(obj, name, target);
- return obj;
-}
-
-
-/**
- * Initialize a new texture object to default values.
- * \param obj the texture object
- * \param name the texture name
- * \param target the texture target
- */
-void
-_mesa_initialize_texture_object( struct gl_texture_object *obj,
- GLuint name, GLenum target )
-{
- ASSERT(target == 0 ||
- target == GL_TEXTURE_1D ||
- target == GL_TEXTURE_2D ||
- target == GL_TEXTURE_3D ||
- target == GL_TEXTURE_CUBE_MAP_ARB ||
- target == GL_TEXTURE_RECTANGLE_NV ||
- target == GL_TEXTURE_1D_ARRAY_EXT ||
- target == GL_TEXTURE_2D_ARRAY_EXT ||
- target == GL_TEXTURE_BUFFER);
-
- memset(obj, 0, sizeof(*obj));
- /* init the non-zero fields */
- _glthread_INIT_MUTEX(obj->Mutex);
- obj->RefCount = 1;
- obj->Name = name;
- obj->Target = target;
- obj->Priority = 1.0F;
- obj->BaseLevel = 0;
- obj->MaxLevel = 1000;
-
- /* sampler state */
- if (target == GL_TEXTURE_RECTANGLE_NV) {
- obj->Sampler.WrapS = GL_CLAMP_TO_EDGE;
- obj->Sampler.WrapT = GL_CLAMP_TO_EDGE;
- obj->Sampler.WrapR = GL_CLAMP_TO_EDGE;
- obj->Sampler.MinFilter = GL_LINEAR;
- }
- else {
- obj->Sampler.WrapS = GL_REPEAT;
- obj->Sampler.WrapT = GL_REPEAT;
- obj->Sampler.WrapR = GL_REPEAT;
- obj->Sampler.MinFilter = GL_NEAREST_MIPMAP_LINEAR;
- }
- obj->Sampler.MagFilter = GL_LINEAR;
- obj->Sampler.MinLod = -1000.0;
- obj->Sampler.MaxLod = 1000.0;
- obj->Sampler.LodBias = 0.0;
- obj->Sampler.MaxAnisotropy = 1.0;
- obj->Sampler.CompareMode = GL_NONE; /* ARB_shadow */
- obj->Sampler.CompareFunc = GL_LEQUAL; /* ARB_shadow */
- obj->Sampler.CompareFailValue = 0.0F; /* ARB_shadow_ambient */
- obj->Sampler.DepthMode = GL_LUMINANCE; /* ARB_depth_texture */
- obj->Sampler.CubeMapSeamless = GL_FALSE;
- obj->Swizzle[0] = GL_RED;
- obj->Swizzle[1] = GL_GREEN;
- obj->Swizzle[2] = GL_BLUE;
- obj->Swizzle[3] = GL_ALPHA;
- obj->_Swizzle = SWIZZLE_NOOP;
- obj->Sampler.sRGBDecode = GL_DECODE_EXT;
-}
-
-
-/**
- * Some texture initialization can't be finished until we know which
- * target it's getting bound to (GL_TEXTURE_1D/2D/etc).
- */
-static void
-finish_texture_init(struct gl_context *ctx, GLenum target,
- struct gl_texture_object *obj)
-{
- assert(obj->Target == 0);
-
- if (target == GL_TEXTURE_RECTANGLE_NV) {
- /* have to init wrap and filter state here - kind of klunky */
- obj->Sampler.WrapS = GL_CLAMP_TO_EDGE;
- obj->Sampler.WrapT = GL_CLAMP_TO_EDGE;
- obj->Sampler.WrapR = GL_CLAMP_TO_EDGE;
- obj->Sampler.MinFilter = GL_LINEAR;
- if (ctx->Driver.TexParameter) {
- static const GLfloat fparam_wrap[1] = {(GLfloat) GL_CLAMP_TO_EDGE};
- static const GLfloat fparam_filter[1] = {(GLfloat) GL_LINEAR};
- ctx->Driver.TexParameter(ctx, target, obj, GL_TEXTURE_WRAP_S, fparam_wrap);
- ctx->Driver.TexParameter(ctx, target, obj, GL_TEXTURE_WRAP_T, fparam_wrap);
- ctx->Driver.TexParameter(ctx, target, obj, GL_TEXTURE_WRAP_R, fparam_wrap);
- ctx->Driver.TexParameter(ctx, target, obj, GL_TEXTURE_MIN_FILTER, fparam_filter);
- }
- }
-}
-
-
-/**
- * Deallocate a texture object struct. It should have already been
- * removed from the texture object pool.
- * Called via ctx->Driver.DeleteTexture() if not overriden by a driver.
- *
- * \param shared the shared GL state to which the object belongs.
- * \param texObj the texture object to delete.
- */
-void
-_mesa_delete_texture_object(struct gl_context *ctx,
- struct gl_texture_object *texObj)
-{
- GLuint i, face;
-
- /* Set Target to an invalid value. With some assertions elsewhere
- * we can try to detect possible use of deleted textures.
- */
- texObj->Target = 0x99;
-
- _mesa_free_colortable_data(&texObj->Palette);
-
- /* free the texture images */
- for (face = 0; face < 6; face++) {
- for (i = 0; i < MAX_TEXTURE_LEVELS; i++) {
- if (texObj->Image[face][i]) {
- _mesa_delete_texture_image( ctx, texObj->Image[face][i] );
- }
- }
- }
-
- _mesa_reference_buffer_object(ctx, &texObj->BufferObject, NULL);
-
- /* destroy the mutex -- it may have allocated memory (eg on bsd) */
- _glthread_DESTROY_MUTEX(texObj->Mutex);
-
- /* free this object */
- free(texObj);
-}
-
-
-
-/**
- * Copy texture object state from one texture object to another.
- * Use for glPush/PopAttrib.
- *
- * \param dest destination texture object.
- * \param src source texture object.
- */
-void
-_mesa_copy_texture_object( struct gl_texture_object *dest,
- const struct gl_texture_object *src )
-{
- dest->Target = src->Target;
- dest->Name = src->Name;
- dest->Priority = src->Priority;
- dest->Sampler.BorderColor.f[0] = src->Sampler.BorderColor.f[0];
- dest->Sampler.BorderColor.f[1] = src->Sampler.BorderColor.f[1];
- dest->Sampler.BorderColor.f[2] = src->Sampler.BorderColor.f[2];
- dest->Sampler.BorderColor.f[3] = src->Sampler.BorderColor.f[3];
- dest->Sampler.WrapS = src->Sampler.WrapS;
- dest->Sampler.WrapT = src->Sampler.WrapT;
- dest->Sampler.WrapR = src->Sampler.WrapR;
- dest->Sampler.MinFilter = src->Sampler.MinFilter;
- dest->Sampler.MagFilter = src->Sampler.MagFilter;
- dest->Sampler.MinLod = src->Sampler.MinLod;
- dest->Sampler.MaxLod = src->Sampler.MaxLod;
- dest->Sampler.LodBias = src->Sampler.LodBias;
- dest->BaseLevel = src->BaseLevel;
- dest->MaxLevel = src->MaxLevel;
- dest->Sampler.MaxAnisotropy = src->Sampler.MaxAnisotropy;
- dest->Sampler.CompareMode = src->Sampler.CompareMode;
- dest->Sampler.CompareFunc = src->Sampler.CompareFunc;
- dest->Sampler.CompareFailValue = src->Sampler.CompareFailValue;
- dest->Sampler.CubeMapSeamless = src->Sampler.CubeMapSeamless;
- dest->Sampler.DepthMode = src->Sampler.DepthMode;
- dest->Sampler.sRGBDecode = src->Sampler.sRGBDecode;
- dest->_MaxLevel = src->_MaxLevel;
- dest->_MaxLambda = src->_MaxLambda;
- dest->GenerateMipmap = src->GenerateMipmap;
- dest->Palette = src->Palette;
- dest->_Complete = src->_Complete;
- COPY_4V(dest->Swizzle, src->Swizzle);
- dest->_Swizzle = src->_Swizzle;
-}
-
-
-/**
- * Free all texture images of the given texture object.
- *
- * \param ctx GL context.
- * \param t texture object.
- *
- * \sa _mesa_clear_texture_image().
- */
-void
-_mesa_clear_texture_object(struct gl_context *ctx,
- struct gl_texture_object *texObj)
-{
- GLuint i, j;
-
- if (texObj->Target == 0)
- return;
-
- for (i = 0; i < MAX_FACES; i++) {
- for (j = 0; j < MAX_TEXTURE_LEVELS; j++) {
- struct gl_texture_image *texImage = texObj->Image[i][j];
- if (texImage)
- _mesa_clear_texture_image(ctx, texImage);
- }
- }
-}
-
-
-/**
- * Check if the given texture object is valid by examining its Target field.
- * For debugging only.
- */
-static GLboolean
-valid_texture_object(const struct gl_texture_object *tex)
-{
- switch (tex->Target) {
- case 0:
- case GL_TEXTURE_1D:
- case GL_TEXTURE_2D:
- case GL_TEXTURE_3D:
- case GL_TEXTURE_CUBE_MAP_ARB:
- case GL_TEXTURE_RECTANGLE_NV:
- case GL_TEXTURE_1D_ARRAY_EXT:
- case GL_TEXTURE_2D_ARRAY_EXT:
- case GL_TEXTURE_BUFFER:
- return GL_TRUE;
- case 0x99:
- _mesa_problem(NULL, "invalid reference to a deleted texture object");
- return GL_FALSE;
- default:
- _mesa_problem(NULL, "invalid texture object Target 0x%x, Id = %u",
- tex->Target, tex->Name);
- return GL_FALSE;
- }
-}
-
-
-/**
- * Reference (or unreference) a texture object.
- * If '*ptr', decrement *ptr's refcount (and delete if it becomes zero).
- * If 'tex' is non-null, increment its refcount.
- */
-void
-_mesa_reference_texobj(struct gl_texture_object **ptr,
- struct gl_texture_object *tex)
-{
- assert(ptr);
- if (*ptr == tex) {
- /* no change */
- return;
- }
-
- if (*ptr) {
- /* Unreference the old texture */
- GLboolean deleteFlag = GL_FALSE;
- struct gl_texture_object *oldTex = *ptr;
-
- ASSERT(valid_texture_object(oldTex));
- (void) valid_texture_object; /* silence warning in release builds */
-
- _glthread_LOCK_MUTEX(oldTex->Mutex);
- ASSERT(oldTex->RefCount > 0);
- oldTex->RefCount--;
-
- deleteFlag = (oldTex->RefCount == 0);
- _glthread_UNLOCK_MUTEX(oldTex->Mutex);
-
- if (deleteFlag) {
- GET_CURRENT_CONTEXT(ctx);
- if (ctx)
- ctx->Driver.DeleteTexture(ctx, oldTex);
- else
- _mesa_problem(NULL, "Unable to delete texture, no context");
- }
-
- *ptr = NULL;
- }
- assert(!*ptr);
-
- if (tex) {
- /* reference new texture */
- ASSERT(valid_texture_object(tex));
- _glthread_LOCK_MUTEX(tex->Mutex);
- if (tex->RefCount == 0) {
- /* this texture's being deleted (look just above) */
- /* Not sure this can every really happen. Warn if it does. */
- _mesa_problem(NULL, "referencing deleted texture object");
- *ptr = NULL;
- }
- else {
- tex->RefCount++;
- *ptr = tex;
- }
- _glthread_UNLOCK_MUTEX(tex->Mutex);
- }
-}
-
-
-
-/**
- * Mark a texture object as incomplete.
- * \param t texture object
- * \param fmt... string describing why it's incomplete (for debugging).
- */
-static void
-incomplete(struct gl_texture_object *t, const char *fmt, ...)
-{
-#if 0
- va_list args;
- char s[100];
-
- va_start(args, fmt);
- vsnprintf(s, sizeof(s), fmt, args);
- va_end(args);
-
- printf("Texture Obj %d incomplete because: %s\n", t->Name, s);
-#endif
- t->_Complete = GL_FALSE;
-}
-
-
-/**
- * Examine a texture object to determine if it is complete.
- *
- * The gl_texture_object::Complete flag will be set to GL_TRUE or GL_FALSE
- * accordingly.
- *
- * \param ctx GL context.
- * \param t texture object.
- *
- * According to the texture target, verifies that each of the mipmaps is
- * present and has the expected size.
- */
-void
-_mesa_test_texobj_completeness( const struct gl_context *ctx,
- struct gl_texture_object *t )
-{
- const GLint baseLevel = t->BaseLevel;
- GLint maxLog2 = 0, maxLevels = 0;
-
- t->_Complete = GL_TRUE; /* be optimistic */
-
- /* Detect cases where the application set the base level to an invalid
- * value.
- */
- if ((baseLevel < 0) || (baseLevel >= MAX_TEXTURE_LEVELS)) {
- incomplete(t, "base level = %d is invalid", baseLevel);
- return;
- }
-
- /* Always need the base level image */
- if (!t->Image[0][baseLevel]) {
- incomplete(t, "Image[baseLevel=%d] == NULL", baseLevel);
- return;
- }
-
- /* Check width/height/depth for zero */
- if (t->Image[0][baseLevel]->Width == 0 ||
- t->Image[0][baseLevel]->Height == 0 ||
- t->Image[0][baseLevel]->Depth == 0) {
- incomplete(t, "texture width = 0");
- return;
- }
-
- /* Compute _MaxLevel */
- if ((t->Target == GL_TEXTURE_1D) ||
- (t->Target == GL_TEXTURE_1D_ARRAY_EXT)) {
- maxLog2 = t->Image[0][baseLevel]->WidthLog2;
- maxLevels = ctx->Const.MaxTextureLevels;
- }
- else if ((t->Target == GL_TEXTURE_2D) ||
- (t->Target == GL_TEXTURE_2D_ARRAY_EXT)) {
- maxLog2 = MAX2(t->Image[0][baseLevel]->WidthLog2,
- t->Image[0][baseLevel]->HeightLog2);
- maxLevels = ctx->Const.MaxTextureLevels;
- }
- else if (t->Target == GL_TEXTURE_3D) {
- GLint max = MAX2(t->Image[0][baseLevel]->WidthLog2,
- t->Image[0][baseLevel]->HeightLog2);
- maxLog2 = MAX2(max, (GLint)(t->Image[0][baseLevel]->DepthLog2));
- maxLevels = ctx->Const.Max3DTextureLevels;
- }
- else if (t->Target == GL_TEXTURE_CUBE_MAP_ARB) {
- maxLog2 = MAX2(t->Image[0][baseLevel]->WidthLog2,
- t->Image[0][baseLevel]->HeightLog2);
- maxLevels = ctx->Const.MaxCubeTextureLevels;
- }
- else if (t->Target == GL_TEXTURE_RECTANGLE_NV) {
- maxLog2 = 0; /* not applicable */
- maxLevels = 1; /* no mipmapping */
- }
- else {
- _mesa_problem(ctx, "Bad t->Target in _mesa_test_texobj_completeness");
- return;
- }
-
- ASSERT(maxLevels > 0);
-
- if (t->MaxLevel < t->BaseLevel) {
- incomplete(t, "MAX_LEVEL (%d) < BASE_LEVEL (%d)",
- t->MaxLevel, t->BaseLevel);
- return;
- }
-
- t->_MaxLevel = baseLevel + maxLog2;
- t->_MaxLevel = MIN2(t->_MaxLevel, t->MaxLevel);
- t->_MaxLevel = MIN2(t->_MaxLevel, maxLevels - 1);
-
- /* Compute _MaxLambda = q - b (see the 1.2 spec) used during mipmapping */
- t->_MaxLambda = (GLfloat) (t->_MaxLevel - t->BaseLevel);
-
- if (t->Target == GL_TEXTURE_CUBE_MAP_ARB) {
- /* make sure that all six cube map level 0 images are the same size */
- const GLuint w = t->Image[0][baseLevel]->Width2;
- const GLuint h = t->Image[0][baseLevel]->Height2;
- GLuint face;
- for (face = 1; face < 6; face++) {
- if (t->Image[face][baseLevel] == NULL ||
- t->Image[face][baseLevel]->Width2 != w ||
- t->Image[face][baseLevel]->Height2 != h) {
- incomplete(t, "Cube face missing or mismatched size");
- return;
- }
- }
- }
-
- /* extra checking for mipmaps */
- if (t->Sampler.MinFilter != GL_NEAREST && t->Sampler.MinFilter != GL_LINEAR) {
- /*
- * Mipmapping: determine if we have a complete set of mipmaps
- */
- GLint i;
- GLint minLevel = baseLevel;
- GLint maxLevel = t->_MaxLevel;
-
- if (minLevel > maxLevel) {
- incomplete(t, "minLevel > maxLevel");
- return;
- }
-
- /* Test dimension-independent attributes */
- for (i = minLevel; i <= maxLevel; i++) {
- if (t->Image[0][i]) {
- if (t->Image[0][i]->TexFormat != t->Image[0][baseLevel]->TexFormat) {
- incomplete(t, "Format[i] != Format[baseLevel]");
- return;
- }
- if (t->Image[0][i]->Border != t->Image[0][baseLevel]->Border) {
- incomplete(t, "Border[i] != Border[baseLevel]");
- return;
- }
- }
- }
-
- /* Test things which depend on number of texture image dimensions */
- if ((t->Target == GL_TEXTURE_1D) ||
- (t->Target == GL_TEXTURE_1D_ARRAY_EXT)) {
- /* Test 1-D mipmaps */
- GLuint width = t->Image[0][baseLevel]->Width2;
- for (i = baseLevel + 1; i < maxLevels; i++) {
- if (width > 1) {
- width /= 2;
- }
- if (i >= minLevel && i <= maxLevel) {
- if (!t->Image[0][i]) {
- incomplete(t, "1D Image[0][i] == NULL");
- return;
- }
- if (t->Image[0][i]->Width2 != width ) {
- incomplete(t, "1D Image[0][i] bad width");
- return;
- }
- }
- if (width == 1) {
- return; /* found smallest needed mipmap, all done! */
- }
- }
- }
- else if ((t->Target == GL_TEXTURE_2D) ||
- (t->Target == GL_TEXTURE_2D_ARRAY_EXT)) {
- /* Test 2-D mipmaps */
- GLuint width = t->Image[0][baseLevel]->Width2;
- GLuint height = t->Image[0][baseLevel]->Height2;
- for (i = baseLevel + 1; i < maxLevels; i++) {
- if (width > 1) {
- width /= 2;
- }
- if (height > 1) {
- height /= 2;
- }
- if (i >= minLevel && i <= maxLevel) {
- if (!t->Image[0][i]) {
- incomplete(t, "2D Image[0][i] == NULL");
- return;
- }
- if (t->Image[0][i]->Width2 != width) {
- incomplete(t, "2D Image[0][i] bad width");
- return;
- }
- if (t->Image[0][i]->Height2 != height) {
- incomplete(t, "2D Image[0][i] bad height");
- return;
- }
- if (width==1 && height==1) {
- return; /* found smallest needed mipmap, all done! */
- }
- }
- }
- }
- else if (t->Target == GL_TEXTURE_3D) {
- /* Test 3-D mipmaps */
- GLuint width = t->Image[0][baseLevel]->Width2;
- GLuint height = t->Image[0][baseLevel]->Height2;
- GLuint depth = t->Image[0][baseLevel]->Depth2;
- for (i = baseLevel + 1; i < maxLevels; i++) {
- if (width > 1) {
- width /= 2;
- }
- if (height > 1) {
- height /= 2;
- }
- if (depth > 1) {
- depth /= 2;
- }
- if (i >= minLevel && i <= maxLevel) {
- if (!t->Image[0][i]) {
- incomplete(t, "3D Image[0][i] == NULL");
- return;
- }
- if (t->Image[0][i]->_BaseFormat == GL_DEPTH_COMPONENT) {
- incomplete(t, "GL_DEPTH_COMPONENT only works with 1/2D tex");
- return;
- }
- if (t->Image[0][i]->Width2 != width) {
- incomplete(t, "3D Image[0][i] bad width");
- return;
- }
- if (t->Image[0][i]->Height2 != height) {
- incomplete(t, "3D Image[0][i] bad height");
- return;
- }
- if (t->Image[0][i]->Depth2 != depth) {
- incomplete(t, "3D Image[0][i] bad depth");
- return;
- }
- }
- if (width == 1 && height == 1 && depth == 1) {
- return; /* found smallest needed mipmap, all done! */
- }
- }
- }
- else if (t->Target == GL_TEXTURE_CUBE_MAP_ARB) {
- /* make sure 6 cube faces are consistant */
- GLuint width = t->Image[0][baseLevel]->Width2;
- GLuint height = t->Image[0][baseLevel]->Height2;
- for (i = baseLevel + 1; i < maxLevels; i++) {
- if (width > 1) {
- width /= 2;
- }
- if (height > 1) {
- height /= 2;
- }
- if (i >= minLevel && i <= maxLevel) {
- GLuint face;
- for (face = 0; face < 6; face++) {
- /* check that we have images defined */
- if (!t->Image[face][i]) {
- incomplete(t, "CubeMap Image[n][i] == NULL");
- return;
- }
- /* Don't support GL_DEPTH_COMPONENT for cube maps */
- if (t->Image[face][i]->_BaseFormat == GL_DEPTH_COMPONENT) {
- incomplete(t, "GL_DEPTH_COMPONENT only works with 1/2D tex");
- return;
- }
- /* check that all six images have same size */
- if (t->Image[face][i]->Width2 != width ||
- t->Image[face][i]->Height2 != height) {
- incomplete(t, "CubeMap Image[n][i] bad size");
- return;
- }
- }
- }
- if (width == 1 && height == 1) {
- return; /* found smallest needed mipmap, all done! */
- }
- }
- }
- else if (t->Target == GL_TEXTURE_RECTANGLE_NV) {
- /* XXX special checking? */
- }
- else {
- /* Target = ??? */
- _mesa_problem(ctx, "Bug in gl_test_texture_object_completeness\n");
- }
- }
-}
-
-
-/**
- * Check if the given cube map texture is "cube complete" as defined in
- * the OpenGL specification.
- */
-GLboolean
-_mesa_cube_complete(const struct gl_texture_object *texObj)
-{
- const GLint baseLevel = texObj->BaseLevel;
- const struct gl_texture_image *img0, *img;
- GLuint face;
-
- if (texObj->Target != GL_TEXTURE_CUBE_MAP)
- return GL_FALSE;
-
- if ((baseLevel < 0) || (baseLevel >= MAX_TEXTURE_LEVELS))
- return GL_FALSE;
-
- /* check first face */
- img0 = texObj->Image[0][baseLevel];
- if (!img0 ||
- img0->Width < 1 ||
- img0->Width != img0->Height)
- return GL_FALSE;
-
- /* check remaining faces vs. first face */
- for (face = 1; face < 6; face++) {
- img = texObj->Image[face][baseLevel];
- if (!img ||
- img->Width != img0->Width ||
- img->Height != img0->Height ||
- img->TexFormat != img0->TexFormat)
- return GL_FALSE;
- }
-
- return GL_TRUE;
-}
-
-
-/**
- * Mark a texture object dirty. It forces the object to be incomplete
- * and optionally forces the context to re-validate its state.
- *
- * \param ctx GL context.
- * \param texObj texture object.
- * \param invalidate_state also invalidate context state.
- */
-void
-_mesa_dirty_texobj(struct gl_context *ctx, struct gl_texture_object *texObj,
- GLboolean invalidate_state)
-{
- texObj->_Complete = GL_FALSE;
- if (invalidate_state)
- ctx->NewState |= _NEW_TEXTURE;
-}
-
-
-/**
- * Return pointer to a default/fallback texture.
- * The texture is a 2D 8x8 RGBA texture with all texels = (0,0,0,1).
- * That's the value a sampler should get when sampling from an
- * incomplete texture.
- */
-struct gl_texture_object *
-_mesa_get_fallback_texture(struct gl_context *ctx)
-{
- if (!ctx->Shared->FallbackTex) {
- /* create fallback texture now */
- static GLubyte texels[8 * 8][4];
- struct gl_texture_object *texObj;
- struct gl_texture_image *texImage;
- gl_format texFormat;
- GLuint i;
-
- for (i = 0; i < 8 * 8; i++) {
- texels[i][0] =
- texels[i][1] =
- texels[i][2] = 0x0;
- texels[i][3] = 0xff;
- }
-
- /* create texture object */
- texObj = ctx->Driver.NewTextureObject(ctx, 0, GL_TEXTURE_2D);
- assert(texObj->RefCount == 1);
- texObj->Sampler.MinFilter = GL_NEAREST;
- texObj->Sampler.MagFilter = GL_NEAREST;
-
- /* create level[0] texture image */
- texImage = _mesa_get_tex_image(ctx, texObj, GL_TEXTURE_2D, 0);
-
- texFormat = ctx->Driver.ChooseTextureFormat(ctx, GL_RGBA, GL_RGBA,
- GL_UNSIGNED_BYTE);
-
- /* init the image fields */
- _mesa_init_teximage_fields(ctx, GL_TEXTURE_2D, texImage,
- 8, 8, 1, 0, GL_RGBA, texFormat);
-
- ASSERT(texImage->TexFormat != MESA_FORMAT_NONE);
-
- /* set image data */
- ctx->Driver.TexImage2D(ctx, GL_TEXTURE_2D, 0, GL_RGBA,
- 8, 8, 0,
- GL_RGBA, GL_UNSIGNED_BYTE, texels,
- &ctx->DefaultPacking, texObj, texImage);
-
- _mesa_test_texobj_completeness(ctx, texObj);
- assert(texObj->_Complete);
-
- ctx->Shared->FallbackTex = texObj;
- }
- return ctx->Shared->FallbackTex;
-}
-
-
-/*@}*/
-
-
-/***********************************************************************/
-/** \name API functions */
-/*@{*/
-
-
-/**
- * Generate texture names.
- *
- * \param n number of texture names to be generated.
- * \param textures an array in which will hold the generated texture names.
- *
- * \sa glGenTextures().
- *
- * Calls _mesa_HashFindFreeKeyBlock() to find a block of free texture
- * IDs which are stored in \p textures. Corresponding empty texture
- * objects are also generated.
- */
-void GLAPIENTRY
-_mesa_GenTextures( GLsizei n, GLuint *textures )
-{
- GET_CURRENT_CONTEXT(ctx);
- GLuint first;
- GLint i;
- ASSERT_OUTSIDE_BEGIN_END(ctx);
-
- if (n < 0) {
- _mesa_error( ctx, GL_INVALID_VALUE, "glGenTextures" );
- return;
- }
-
- if (!textures)
- return;
-
- /*
- * This must be atomic (generation and allocation of texture IDs)
- */
- _glthread_LOCK_MUTEX(ctx->Shared->Mutex);
-
- first = _mesa_HashFindFreeKeyBlock(ctx->Shared->TexObjects, n);
-
- /* Allocate new, empty texture objects */
- for (i = 0; i < n; i++) {
- struct gl_texture_object *texObj;
- GLuint name = first + i;
- GLenum target = 0;
- texObj = (*ctx->Driver.NewTextureObject)( ctx, name, target);
- if (!texObj) {
- _glthread_UNLOCK_MUTEX(ctx->Shared->Mutex);
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "glGenTextures");
- return;
- }
-
- /* insert into hash table */
- _mesa_HashInsert(ctx->Shared->TexObjects, texObj->Name, texObj);
-
- textures[i] = name;
- }
-
- _glthread_UNLOCK_MUTEX(ctx->Shared->Mutex);
-}
-
-
-/**
- * Check if the given texture object is bound to the current draw or
- * read framebuffer. If so, Unbind it.
- */
-static void
-unbind_texobj_from_fbo(struct gl_context *ctx,
- struct gl_texture_object *texObj)
-{
- const GLuint n = (ctx->DrawBuffer == ctx->ReadBuffer) ? 1 : 2;
- GLuint i;
-
- for (i = 0; i < n; i++) {
- struct gl_framebuffer *fb = (i == 0) ? ctx->DrawBuffer : ctx->ReadBuffer;
- if (fb->Name) {
- GLuint j;
- for (j = 0; j < BUFFER_COUNT; j++) {
- if (fb->Attachment[j].Type == GL_TEXTURE &&
- fb->Attachment[j].Texture == texObj) {
- _mesa_remove_attachment(ctx, fb->Attachment + j);
- }
- }
- }
- }
-}
-
-
-/**
- * Check if the given texture object is bound to any texture image units and
- * unbind it if so (revert to default textures).
- */
-static void
-unbind_texobj_from_texunits(struct gl_context *ctx,
- struct gl_texture_object *texObj)
-{
- GLuint u, tex;
-
- for (u = 0; u < MAX_TEXTURE_IMAGE_UNITS; u++) {
- struct gl_texture_unit *unit = &ctx->Texture.Unit[u];
- for (tex = 0; tex < NUM_TEXTURE_TARGETS; tex++) {
- if (texObj == unit->CurrentTex[tex]) {
- _mesa_reference_texobj(&unit->CurrentTex[tex],
- ctx->Shared->DefaultTex[tex]);
- ASSERT(unit->CurrentTex[tex]);
- break;
- }
- }
- }
-}
-
-
-/**
- * Delete named textures.
- *
- * \param n number of textures to be deleted.
- * \param textures array of texture IDs to be deleted.
- *
- * \sa glDeleteTextures().
- *
- * If we're about to delete a texture that's currently bound to any
- * texture unit, unbind the texture first. Decrement the reference
- * count on the texture object and delete it if it's zero.
- * Recall that texture objects can be shared among several rendering
- * contexts.
- */
-void GLAPIENTRY
-_mesa_DeleteTextures( GLsizei n, const GLuint *textures)
-{
- GET_CURRENT_CONTEXT(ctx);
- GLint i;
- ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); /* too complex */
-
- if (!textures)
- return;
-
- for (i = 0; i < n; i++) {
- if (textures[i] > 0) {
- struct gl_texture_object *delObj
- = _mesa_lookup_texture(ctx, textures[i]);
-
- if (delObj) {
- _mesa_lock_texture(ctx, delObj);
-
- /* Check if texture is bound to any framebuffer objects.
- * If so, unbind.
- * See section 4.4.2.3 of GL_EXT_framebuffer_object.
- */
- unbind_texobj_from_fbo(ctx, delObj);
-
- /* Check if this texture is currently bound to any texture units.
- * If so, unbind it.
- */
- unbind_texobj_from_texunits(ctx, delObj);
-
- _mesa_unlock_texture(ctx, delObj);
-
- ctx->NewState |= _NEW_TEXTURE;
-
- /* The texture _name_ is now free for re-use.
- * Remove it from the hash table now.
- */
- _glthread_LOCK_MUTEX(ctx->Shared->Mutex);
- _mesa_HashRemove(ctx->Shared->TexObjects, delObj->Name);
- _glthread_UNLOCK_MUTEX(ctx->Shared->Mutex);
-
- /* Unreference the texobj. If refcount hits zero, the texture
- * will be deleted.
- */
- _mesa_reference_texobj(&delObj, NULL);
- }
- }
- }
-}
-
-
-/**
- * Convert a GL texture target enum such as GL_TEXTURE_2D or GL_TEXTURE_3D
- * into the corresponding Mesa texture target index.
- * Note that proxy targets are not valid here.
- * \return TEXTURE_x_INDEX or -1 if target is invalid
- */
-static GLint
-target_enum_to_index(GLenum target)
-{
- switch (target) {
- case GL_TEXTURE_1D:
- return TEXTURE_1D_INDEX;
- case GL_TEXTURE_2D:
- return TEXTURE_2D_INDEX;
- case GL_TEXTURE_3D:
- return TEXTURE_3D_INDEX;
- case GL_TEXTURE_CUBE_MAP_ARB:
- return TEXTURE_CUBE_INDEX;
- case GL_TEXTURE_RECTANGLE_NV:
- return TEXTURE_RECT_INDEX;
- case GL_TEXTURE_1D_ARRAY_EXT:
- return TEXTURE_1D_ARRAY_INDEX;
- case GL_TEXTURE_2D_ARRAY_EXT:
- return TEXTURE_2D_ARRAY_INDEX;
- case GL_TEXTURE_BUFFER_ARB:
- return TEXTURE_BUFFER_INDEX;
- default:
- return -1;
- }
-}
-
-
-/**
- * Bind a named texture to a texturing target.
- *
- * \param target texture target.
- * \param texName texture name.
- *
- * \sa glBindTexture().
- *
- * Determines the old texture object bound and returns immediately if rebinding
- * the same texture. Get the current texture which is either a default texture
- * if name is null, a named texture from the hash, or a new texture if the
- * given texture name is new. Increments its reference count, binds it, and
- * calls dd_function_table::BindTexture. Decrements the old texture reference
- * count and deletes it if it reaches zero.
- */
-void GLAPIENTRY
-_mesa_BindTexture( GLenum target, GLuint texName )
-{
- GET_CURRENT_CONTEXT(ctx);
- struct gl_texture_unit *texUnit = _mesa_get_current_tex_unit(ctx);
- struct gl_texture_object *newTexObj = NULL;
- GLint targetIndex;
- ASSERT_OUTSIDE_BEGIN_END(ctx);
-
- if (MESA_VERBOSE & (VERBOSE_API|VERBOSE_TEXTURE))
- _mesa_debug(ctx, "glBindTexture %s %d\n",
- _mesa_lookup_enum_by_nr(target), (GLint) texName);
-
- targetIndex = target_enum_to_index(target);
- if (targetIndex < 0) {
- _mesa_error(ctx, GL_INVALID_ENUM, "glBindTexture(target)");
- return;
- }
- assert(targetIndex < NUM_TEXTURE_TARGETS);
-
- /*
- * Get pointer to new texture object (newTexObj)
- */
- if (texName == 0) {
- /* Use a default texture object */
- newTexObj = ctx->Shared->DefaultTex[targetIndex];
- }
- else {
- /* non-default texture object */
- newTexObj = _mesa_lookup_texture(ctx, texName);
- if (newTexObj) {
- /* error checking */
- if (newTexObj->Target != 0 && newTexObj->Target != target) {
- /* the named texture object's target doesn't match the given target */
- _mesa_error( ctx, GL_INVALID_OPERATION,
- "glBindTexture(target mismatch)" );
- return;
- }
- if (newTexObj->Target == 0) {
- finish_texture_init(ctx, target, newTexObj);
- }
- }
- else {
- /* if this is a new texture id, allocate a texture object now */
- newTexObj = (*ctx->Driver.NewTextureObject)(ctx, texName, target);
- if (!newTexObj) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "glBindTexture");
- return;
- }
-
- /* and insert it into hash table */
- _glthread_LOCK_MUTEX(ctx->Shared->Mutex);
- _mesa_HashInsert(ctx->Shared->TexObjects, texName, newTexObj);
- _glthread_UNLOCK_MUTEX(ctx->Shared->Mutex);
- }
- newTexObj->Target = target;
- }
-
- assert(valid_texture_object(newTexObj));
-
- /* Check if this texture is only used by this context and is already bound.
- * If so, just return.
- */
- {
- GLboolean early_out;
- _glthread_LOCK_MUTEX(ctx->Shared->Mutex);
- early_out = ((ctx->Shared->RefCount == 1)
- && (newTexObj == texUnit->CurrentTex[targetIndex]));
- _glthread_UNLOCK_MUTEX(ctx->Shared->Mutex);
- if (early_out) {
- return;
- }
- }
-
- /* flush before changing binding */
- FLUSH_VERTICES(ctx, _NEW_TEXTURE);
-
- /* Do the actual binding. The refcount on the previously bound
- * texture object will be decremented. It'll be deleted if the
- * count hits zero.
- */
- _mesa_reference_texobj(&texUnit->CurrentTex[targetIndex], newTexObj);
- ASSERT(texUnit->CurrentTex[targetIndex]);
-
- /* Pass BindTexture call to device driver */
- if (ctx->Driver.BindTexture)
- (*ctx->Driver.BindTexture)( ctx, target, newTexObj );
-}
-
-
-/**
- * Set texture priorities.
- *
- * \param n number of textures.
- * \param texName texture names.
- * \param priorities corresponding texture priorities.
- *
- * \sa glPrioritizeTextures().
- *
- * Looks up each texture in the hash, clamps the corresponding priority between
- * 0.0 and 1.0, and calls dd_function_table::PrioritizeTexture.
- */
-void GLAPIENTRY
-_mesa_PrioritizeTextures( GLsizei n, const GLuint *texName,
- const GLclampf *priorities )
-{
- GET_CURRENT_CONTEXT(ctx);
- GLint i;
- ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
-
- if (n < 0) {
- _mesa_error( ctx, GL_INVALID_VALUE, "glPrioritizeTextures" );
- return;
- }
-
- if (!priorities)
- return;
-
- for (i = 0; i < n; i++) {
- if (texName[i] > 0) {
- struct gl_texture_object *t = _mesa_lookup_texture(ctx, texName[i]);
- if (t) {
- t->Priority = CLAMP( priorities[i], 0.0F, 1.0F );
- }
- }
- }
-
- ctx->NewState |= _NEW_TEXTURE;
-}
-
-
-
-/**
- * See if textures are loaded in texture memory.
- *
- * \param n number of textures to query.
- * \param texName array with the texture names.
- * \param residences array which will hold the residence status.
- *
- * \return GL_TRUE if all textures are resident and \p residences is left unchanged,
- *
- * \sa glAreTexturesResident().
- *
- * Looks up each texture in the hash and calls
- * dd_function_table::IsTextureResident.
- */
-GLboolean GLAPIENTRY
-_mesa_AreTexturesResident(GLsizei n, const GLuint *texName,
- GLboolean *residences)
-{
- GET_CURRENT_CONTEXT(ctx);
- GLboolean allResident = GL_TRUE;
- GLint i, j;
- ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, GL_FALSE);
-
- if (n < 0) {
- _mesa_error(ctx, GL_INVALID_VALUE, "glAreTexturesResident(n)");
- return GL_FALSE;
- }
-
- if (!texName || !residences)
- return GL_FALSE;
-
- for (i = 0; i < n; i++) {
- struct gl_texture_object *t;
- if (texName[i] == 0) {
- _mesa_error(ctx, GL_INVALID_VALUE, "glAreTexturesResident");
- return GL_FALSE;
- }
- t = _mesa_lookup_texture(ctx, texName[i]);
- if (!t) {
- _mesa_error(ctx, GL_INVALID_VALUE, "glAreTexturesResident");
- return GL_FALSE;
- }
- if (!ctx->Driver.IsTextureResident ||
- ctx->Driver.IsTextureResident(ctx, t)) {
- /* The texture is resident */
- if (!allResident)
- residences[i] = GL_TRUE;
- }
- else {
- /* The texture is not resident */
- if (allResident) {
- allResident = GL_FALSE;
- for (j = 0; j < i; j++)
- residences[j] = GL_TRUE;
- }
- residences[i] = GL_FALSE;
- }
- }
-
- return allResident;
-}
-
-
-/**
- * See if a name corresponds to a texture.
- *
- * \param texture texture name.
- *
- * \return GL_TRUE if texture name corresponds to a texture, or GL_FALSE
- * otherwise.
- *
- * \sa glIsTexture().
- *
- * Calls _mesa_HashLookup().
- */
-GLboolean GLAPIENTRY
-_mesa_IsTexture( GLuint texture )
-{
- struct gl_texture_object *t;
- GET_CURRENT_CONTEXT(ctx);
- ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, GL_FALSE);
-
- if (!texture)
- return GL_FALSE;
-
- t = _mesa_lookup_texture(ctx, texture);
-
- /* IsTexture is true only after object has been bound once. */
- return t && t->Target;
-}
-
-
-/**
- * Simplest implementation of texture locking: grab the shared tex
- * mutex. Examine the shared context state timestamp and if there has
- * been a change, set the appropriate bits in ctx->NewState.
- *
- * This is used to deal with synchronizing things when a texture object
- * is used/modified by different contexts (or threads) which are sharing
- * the texture.
- *
- * See also _mesa_lock/unlock_texture() in teximage.h
- */
-void
-_mesa_lock_context_textures( struct gl_context *ctx )
-{
- _glthread_LOCK_MUTEX(ctx->Shared->TexMutex);
-
- if (ctx->Shared->TextureStateStamp != ctx->TextureStateTimestamp) {
- ctx->NewState |= _NEW_TEXTURE;
- ctx->TextureStateTimestamp = ctx->Shared->TextureStateStamp;
- }
-}
-
-
-void
-_mesa_unlock_context_textures( struct gl_context *ctx )
-{
- assert(ctx->Shared->TextureStateStamp == ctx->TextureStateTimestamp);
- _glthread_UNLOCK_MUTEX(ctx->Shared->TexMutex);
-}
-
-/*@}*/
+/**
+ * \file texobj.c
+ * Texture object management.
+ */
+
+/*
+ * Mesa 3-D graphics library
+ * Version: 7.1
+ *
+ * Copyright (C) 1999-2007 Brian Paul All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+
+#include "mfeatures.h"
+#include "bufferobj.h"
+#include "colortab.h"
+#include "context.h"
+#include "enums.h"
+#include "fbobject.h"
+#include "formats.h"
+#include "hash.h"
+#include "imports.h"
+#include "macros.h"
+#include "teximage.h"
+#include "texobj.h"
+#include "texstate.h"
+#include "mtypes.h"
+#include "program/prog_instruction.h"
+
+
+
+/**********************************************************************/
+/** \name Internal functions */
+/*@{*/
+
+
+/**
+ * Return the gl_texture_object for a given ID.
+ */
+struct gl_texture_object *
+_mesa_lookup_texture(struct gl_context *ctx, GLuint id)
+{
+ return (struct gl_texture_object *)
+ _mesa_HashLookup(ctx->Shared->TexObjects, id);
+}
+
+
+
+/**
+ * Allocate and initialize a new texture object. But don't put it into the
+ * texture object hash table.
+ *
+ * Called via ctx->Driver.NewTextureObject, unless overridden by a device
+ * driver.
+ *
+ * \param shared the shared GL state structure to contain the texture object
+ * \param name integer name for the texture object
+ * \param target either GL_TEXTURE_1D, GL_TEXTURE_2D, GL_TEXTURE_3D,
+ * GL_TEXTURE_CUBE_MAP_ARB or GL_TEXTURE_RECTANGLE_NV. zero is ok for the sake
+ * of GenTextures()
+ *
+ * \return pointer to new texture object.
+ */
+struct gl_texture_object *
+_mesa_new_texture_object( struct gl_context *ctx, GLuint name, GLenum target )
+{
+ struct gl_texture_object *obj;
+ (void) ctx;
+ obj = MALLOC_STRUCT(gl_texture_object);
+ _mesa_initialize_texture_object(obj, name, target);
+ return obj;
+}
+
+
+/**
+ * Initialize a new texture object to default values.
+ * \param obj the texture object
+ * \param name the texture name
+ * \param target the texture target
+ */
+void
+_mesa_initialize_texture_object( struct gl_texture_object *obj,
+ GLuint name, GLenum target )
+{
+ ASSERT(target == 0 ||
+ target == GL_TEXTURE_1D ||
+ target == GL_TEXTURE_2D ||
+ target == GL_TEXTURE_3D ||
+ target == GL_TEXTURE_CUBE_MAP_ARB ||
+ target == GL_TEXTURE_RECTANGLE_NV ||
+ target == GL_TEXTURE_1D_ARRAY_EXT ||
+ target == GL_TEXTURE_2D_ARRAY_EXT ||
+ target == GL_TEXTURE_BUFFER);
+
+ memset(obj, 0, sizeof(*obj));
+ /* init the non-zero fields */
+ _glthread_INIT_MUTEX(obj->Mutex);
+ obj->RefCount = 1;
+ obj->Name = name;
+ obj->Target = target;
+ obj->Priority = 1.0F;
+ obj->BaseLevel = 0;
+ obj->MaxLevel = 1000;
+
+ /* sampler state */
+ if (target == GL_TEXTURE_RECTANGLE_NV) {
+ obj->Sampler.WrapS = GL_CLAMP_TO_EDGE;
+ obj->Sampler.WrapT = GL_CLAMP_TO_EDGE;
+ obj->Sampler.WrapR = GL_CLAMP_TO_EDGE;
+ obj->Sampler.MinFilter = GL_LINEAR;
+ }
+ else {
+ obj->Sampler.WrapS = GL_REPEAT;
+ obj->Sampler.WrapT = GL_REPEAT;
+ obj->Sampler.WrapR = GL_REPEAT;
+ obj->Sampler.MinFilter = GL_NEAREST_MIPMAP_LINEAR;
+ }
+ obj->Sampler.MagFilter = GL_LINEAR;
+ obj->Sampler.MinLod = -1000.0;
+ obj->Sampler.MaxLod = 1000.0;
+ obj->Sampler.LodBias = 0.0;
+ obj->Sampler.MaxAnisotropy = 1.0;
+ obj->Sampler.CompareMode = GL_NONE; /* ARB_shadow */
+ obj->Sampler.CompareFunc = GL_LEQUAL; /* ARB_shadow */
+ obj->Sampler.CompareFailValue = 0.0F; /* ARB_shadow_ambient */
+ obj->Sampler.DepthMode = GL_LUMINANCE; /* ARB_depth_texture */
+ obj->Sampler.CubeMapSeamless = GL_FALSE;
+ obj->Swizzle[0] = GL_RED;
+ obj->Swizzle[1] = GL_GREEN;
+ obj->Swizzle[2] = GL_BLUE;
+ obj->Swizzle[3] = GL_ALPHA;
+ obj->_Swizzle = SWIZZLE_NOOP;
+ obj->Sampler.sRGBDecode = GL_DECODE_EXT;
+}
+
+
+/**
+ * Some texture initialization can't be finished until we know which
+ * target it's getting bound to (GL_TEXTURE_1D/2D/etc).
+ */
+static void
+finish_texture_init(struct gl_context *ctx, GLenum target,
+ struct gl_texture_object *obj)
+{
+ assert(obj->Target == 0);
+
+ if (target == GL_TEXTURE_RECTANGLE_NV) {
+ /* have to init wrap and filter state here - kind of klunky */
+ obj->Sampler.WrapS = GL_CLAMP_TO_EDGE;
+ obj->Sampler.WrapT = GL_CLAMP_TO_EDGE;
+ obj->Sampler.WrapR = GL_CLAMP_TO_EDGE;
+ obj->Sampler.MinFilter = GL_LINEAR;
+ if (ctx->Driver.TexParameter) {
+ static const GLfloat fparam_wrap[1] = {(GLfloat) GL_CLAMP_TO_EDGE};
+ static const GLfloat fparam_filter[1] = {(GLfloat) GL_LINEAR};
+ ctx->Driver.TexParameter(ctx, target, obj, GL_TEXTURE_WRAP_S, fparam_wrap);
+ ctx->Driver.TexParameter(ctx, target, obj, GL_TEXTURE_WRAP_T, fparam_wrap);
+ ctx->Driver.TexParameter(ctx, target, obj, GL_TEXTURE_WRAP_R, fparam_wrap);
+ ctx->Driver.TexParameter(ctx, target, obj, GL_TEXTURE_MIN_FILTER, fparam_filter);
+ }
+ }
+}
+
+
+/**
+ * Deallocate a texture object struct. It should have already been
+ * removed from the texture object pool.
+ * Called via ctx->Driver.DeleteTexture() if not overriden by a driver.
+ *
+ * \param shared the shared GL state to which the object belongs.
+ * \param texObj the texture object to delete.
+ */
+void
+_mesa_delete_texture_object(struct gl_context *ctx,
+ struct gl_texture_object *texObj)
+{
+ GLuint i, face;
+
+ /* Set Target to an invalid value. With some assertions elsewhere
+ * we can try to detect possible use of deleted textures.
+ */
+ texObj->Target = 0x99;
+
+ _mesa_free_colortable_data(&texObj->Palette);
+
+ /* free the texture images */
+ for (face = 0; face < 6; face++) {
+ for (i = 0; i < MAX_TEXTURE_LEVELS; i++) {
+ if (texObj->Image[face][i]) {
+ _mesa_delete_texture_image( ctx, texObj->Image[face][i] );
+ }
+ }
+ }
+
+ _mesa_reference_buffer_object(ctx, &texObj->BufferObject, NULL);
+
+ /* destroy the mutex -- it may have allocated memory (eg on bsd) */
+ _glthread_DESTROY_MUTEX(texObj->Mutex);
+
+ /* free this object */
+ free(texObj);
+}
+
+
+
+/**
+ * Copy texture object state from one texture object to another.
+ * Use for glPush/PopAttrib.
+ *
+ * \param dest destination texture object.
+ * \param src source texture object.
+ */
+void
+_mesa_copy_texture_object( struct gl_texture_object *dest,
+ const struct gl_texture_object *src )
+{
+ dest->Target = src->Target;
+ dest->Name = src->Name;
+ dest->Priority = src->Priority;
+ dest->Sampler.BorderColor.f[0] = src->Sampler.BorderColor.f[0];
+ dest->Sampler.BorderColor.f[1] = src->Sampler.BorderColor.f[1];
+ dest->Sampler.BorderColor.f[2] = src->Sampler.BorderColor.f[2];
+ dest->Sampler.BorderColor.f[3] = src->Sampler.BorderColor.f[3];
+ dest->Sampler.WrapS = src->Sampler.WrapS;
+ dest->Sampler.WrapT = src->Sampler.WrapT;
+ dest->Sampler.WrapR = src->Sampler.WrapR;
+ dest->Sampler.MinFilter = src->Sampler.MinFilter;
+ dest->Sampler.MagFilter = src->Sampler.MagFilter;
+ dest->Sampler.MinLod = src->Sampler.MinLod;
+ dest->Sampler.MaxLod = src->Sampler.MaxLod;
+ dest->Sampler.LodBias = src->Sampler.LodBias;
+ dest->BaseLevel = src->BaseLevel;
+ dest->MaxLevel = src->MaxLevel;
+ dest->Sampler.MaxAnisotropy = src->Sampler.MaxAnisotropy;
+ dest->Sampler.CompareMode = src->Sampler.CompareMode;
+ dest->Sampler.CompareFunc = src->Sampler.CompareFunc;
+ dest->Sampler.CompareFailValue = src->Sampler.CompareFailValue;
+ dest->Sampler.CubeMapSeamless = src->Sampler.CubeMapSeamless;
+ dest->Sampler.DepthMode = src->Sampler.DepthMode;
+ dest->Sampler.sRGBDecode = src->Sampler.sRGBDecode;
+ dest->_MaxLevel = src->_MaxLevel;
+ dest->_MaxLambda = src->_MaxLambda;
+ dest->GenerateMipmap = src->GenerateMipmap;
+ dest->Palette = src->Palette;
+ dest->_Complete = src->_Complete;
+ COPY_4V(dest->Swizzle, src->Swizzle);
+ dest->_Swizzle = src->_Swizzle;
+}
+
+
+/**
+ * Free all texture images of the given texture object.
+ *
+ * \param ctx GL context.
+ * \param t texture object.
+ *
+ * \sa _mesa_clear_texture_image().
+ */
+void
+_mesa_clear_texture_object(struct gl_context *ctx,
+ struct gl_texture_object *texObj)
+{
+ GLuint i, j;
+
+ if (texObj->Target == 0)
+ return;
+
+ for (i = 0; i < MAX_FACES; i++) {
+ for (j = 0; j < MAX_TEXTURE_LEVELS; j++) {
+ struct gl_texture_image *texImage = texObj->Image[i][j];
+ if (texImage)
+ _mesa_clear_texture_image(ctx, texImage);
+ }
+ }
+}
+
+
+/**
+ * Check if the given texture object is valid by examining its Target field.
+ * For debugging only.
+ */
+static GLboolean
+valid_texture_object(const struct gl_texture_object *tex)
+{
+ switch (tex->Target) {
+ case 0:
+ case GL_TEXTURE_1D:
+ case GL_TEXTURE_2D:
+ case GL_TEXTURE_3D:
+ case GL_TEXTURE_CUBE_MAP_ARB:
+ case GL_TEXTURE_RECTANGLE_NV:
+ case GL_TEXTURE_1D_ARRAY_EXT:
+ case GL_TEXTURE_2D_ARRAY_EXT:
+ case GL_TEXTURE_BUFFER:
+ return GL_TRUE;
+ case 0x99:
+ _mesa_problem(NULL, "invalid reference to a deleted texture object");
+ return GL_FALSE;
+ default:
+ _mesa_problem(NULL, "invalid texture object Target 0x%x, Id = %u",
+ tex->Target, tex->Name);
+ return GL_FALSE;
+ }
+}
+
+
+/**
+ * Reference (or unreference) a texture object.
+ * If '*ptr', decrement *ptr's refcount (and delete if it becomes zero).
+ * If 'tex' is non-null, increment its refcount.
+ */
+void
+_mesa_reference_texobj(struct gl_texture_object **ptr,
+ struct gl_texture_object *tex)
+{
+ assert(ptr);
+ if (*ptr == tex) {
+ /* no change */
+ return;
+ }
+
+ if (*ptr) {
+ /* Unreference the old texture */
+ GLboolean deleteFlag = GL_FALSE;
+ struct gl_texture_object *oldTex = *ptr;
+
+ ASSERT(valid_texture_object(oldTex));
+ (void) valid_texture_object; /* silence warning in release builds */
+
+ _glthread_LOCK_MUTEX(oldTex->Mutex);
+ ASSERT(oldTex->RefCount > 0);
+ oldTex->RefCount--;
+
+ deleteFlag = (oldTex->RefCount == 0);
+ _glthread_UNLOCK_MUTEX(oldTex->Mutex);
+
+ if (deleteFlag) {
+ GET_CURRENT_CONTEXT(ctx);
+ if (ctx)
+ ctx->Driver.DeleteTexture(ctx, oldTex);
+ else
+ _mesa_problem(NULL, "Unable to delete texture, no context");
+ }
+
+ *ptr = NULL;
+ }
+ assert(!*ptr);
+
+ if (tex) {
+ /* reference new texture */
+ ASSERT(valid_texture_object(tex));
+ _glthread_LOCK_MUTEX(tex->Mutex);
+ if (tex->RefCount == 0) {
+ /* this texture's being deleted (look just above) */
+ /* Not sure this can every really happen. Warn if it does. */
+ _mesa_problem(NULL, "referencing deleted texture object");
+ *ptr = NULL;
+ }
+ else {
+ tex->RefCount++;
+ *ptr = tex;
+ }
+ _glthread_UNLOCK_MUTEX(tex->Mutex);
+ }
+}
+
+
+
+/**
+ * Mark a texture object as incomplete.
+ * \param t texture object
+ * \param fmt... string describing why it's incomplete (for debugging).
+ */
+static void
+incomplete(struct gl_texture_object *t, const char *fmt, ...)
+{
+#if 0
+ va_list args;
+ char s[100];
+
+ va_start(args, fmt);
+ vsnprintf(s, sizeof(s), fmt, args);
+ va_end(args);
+
+ printf("Texture Obj %d incomplete because: %s\n", t->Name, s);
+#endif
+ t->_Complete = GL_FALSE;
+}
+
+
+/**
+ * Examine a texture object to determine if it is complete.
+ *
+ * The gl_texture_object::Complete flag will be set to GL_TRUE or GL_FALSE
+ * accordingly.
+ *
+ * \param ctx GL context.
+ * \param t texture object.
+ *
+ * According to the texture target, verifies that each of the mipmaps is
+ * present and has the expected size.
+ */
+void
+_mesa_test_texobj_completeness( const struct gl_context *ctx,
+ struct gl_texture_object *t )
+{
+ const GLint baseLevel = t->BaseLevel;
+ GLint maxLog2 = 0, maxLevels = 0;
+
+ t->_Complete = GL_TRUE; /* be optimistic */
+
+ /* Detect cases where the application set the base level to an invalid
+ * value.
+ */
+ if ((baseLevel < 0) || (baseLevel >= MAX_TEXTURE_LEVELS)) {
+ incomplete(t, "base level = %d is invalid", baseLevel);
+ return;
+ }
+
+ /* Always need the base level image */
+ if (!t->Image[0][baseLevel]) {
+ incomplete(t, "Image[baseLevel=%d] == NULL", baseLevel);
+ return;
+ }
+
+ /* Check width/height/depth for zero */
+ if (t->Image[0][baseLevel]->Width == 0 ||
+ t->Image[0][baseLevel]->Height == 0 ||
+ t->Image[0][baseLevel]->Depth == 0) {
+ incomplete(t, "texture width = 0");
+ return;
+ }
+
+ /* Compute _MaxLevel */
+ if ((t->Target == GL_TEXTURE_1D) ||
+ (t->Target == GL_TEXTURE_1D_ARRAY_EXT)) {
+ maxLog2 = t->Image[0][baseLevel]->WidthLog2;
+ maxLevels = ctx->Const.MaxTextureLevels;
+ }
+ else if ((t->Target == GL_TEXTURE_2D) ||
+ (t->Target == GL_TEXTURE_2D_ARRAY_EXT)) {
+ maxLog2 = MAX2(t->Image[0][baseLevel]->WidthLog2,
+ t->Image[0][baseLevel]->HeightLog2);
+ maxLevels = ctx->Const.MaxTextureLevels;
+ }
+ else if (t->Target == GL_TEXTURE_3D) {
+ GLint max = MAX2(t->Image[0][baseLevel]->WidthLog2,
+ t->Image[0][baseLevel]->HeightLog2);
+ maxLog2 = MAX2(max, (GLint)(t->Image[0][baseLevel]->DepthLog2));
+ maxLevels = ctx->Const.Max3DTextureLevels;
+ }
+ else if (t->Target == GL_TEXTURE_CUBE_MAP_ARB) {
+ maxLog2 = MAX2(t->Image[0][baseLevel]->WidthLog2,
+ t->Image[0][baseLevel]->HeightLog2);
+ maxLevels = ctx->Const.MaxCubeTextureLevels;
+ }
+ else if (t->Target == GL_TEXTURE_RECTANGLE_NV) {
+ maxLog2 = 0; /* not applicable */
+ maxLevels = 1; /* no mipmapping */
+ }
+ else {
+ _mesa_problem(ctx, "Bad t->Target in _mesa_test_texobj_completeness");
+ return;
+ }
+
+ ASSERT(maxLevels > 0);
+
+ if (t->MaxLevel < t->BaseLevel) {
+ incomplete(t, "MAX_LEVEL (%d) < BASE_LEVEL (%d)",
+ t->MaxLevel, t->BaseLevel);
+ return;
+ }
+
+ t->_MaxLevel = baseLevel + maxLog2;
+ t->_MaxLevel = MIN2(t->_MaxLevel, t->MaxLevel);
+ t->_MaxLevel = MIN2(t->_MaxLevel, maxLevels - 1);
+
+ /* Compute _MaxLambda = q - b (see the 1.2 spec) used during mipmapping */
+ t->_MaxLambda = (GLfloat) (t->_MaxLevel - t->BaseLevel);
+
+ if (t->Target == GL_TEXTURE_CUBE_MAP_ARB) {
+ /* make sure that all six cube map level 0 images are the same size */
+ const GLuint w = t->Image[0][baseLevel]->Width2;
+ const GLuint h = t->Image[0][baseLevel]->Height2;
+ GLuint face;
+ for (face = 1; face < 6; face++) {
+ if (t->Image[face][baseLevel] == NULL ||
+ t->Image[face][baseLevel]->Width2 != w ||
+ t->Image[face][baseLevel]->Height2 != h) {
+ incomplete(t, "Cube face missing or mismatched size");
+ return;
+ }
+ }
+ }
+
+ /* extra checking for mipmaps */
+ if (t->Sampler.MinFilter != GL_NEAREST && t->Sampler.MinFilter != GL_LINEAR) {
+ /*
+ * Mipmapping: determine if we have a complete set of mipmaps
+ */
+ GLint i;
+ GLint minLevel = baseLevel;
+ GLint maxLevel = t->_MaxLevel;
+
+ if (minLevel > maxLevel) {
+ incomplete(t, "minLevel > maxLevel");
+ return;
+ }
+
+ /* Test dimension-independent attributes */
+ for (i = minLevel; i <= maxLevel; i++) {
+ if (t->Image[0][i]) {
+ if (t->Image[0][i]->TexFormat != t->Image[0][baseLevel]->TexFormat) {
+ incomplete(t, "Format[i] != Format[baseLevel]");
+ return;
+ }
+ if (t->Image[0][i]->Border != t->Image[0][baseLevel]->Border) {
+ incomplete(t, "Border[i] != Border[baseLevel]");
+ return;
+ }
+ }
+ }
+
+ /* Test things which depend on number of texture image dimensions */
+ if ((t->Target == GL_TEXTURE_1D) ||
+ (t->Target == GL_TEXTURE_1D_ARRAY_EXT)) {
+ /* Test 1-D mipmaps */
+ GLuint width = t->Image[0][baseLevel]->Width2;
+ for (i = baseLevel + 1; i < maxLevels; i++) {
+ if (width > 1) {
+ width /= 2;
+ }
+ if (i >= minLevel && i <= maxLevel) {
+ if (!t->Image[0][i]) {
+ incomplete(t, "1D Image[0][i] == NULL");
+ return;
+ }
+ if (t->Image[0][i]->Width2 != width ) {
+ incomplete(t, "1D Image[0][i] bad width");
+ return;
+ }
+ }
+ if (width == 1) {
+ return; /* found smallest needed mipmap, all done! */
+ }
+ }
+ }
+ else if ((t->Target == GL_TEXTURE_2D) ||
+ (t->Target == GL_TEXTURE_2D_ARRAY_EXT)) {
+ /* Test 2-D mipmaps */
+ GLuint width = t->Image[0][baseLevel]->Width2;
+ GLuint height = t->Image[0][baseLevel]->Height2;
+ for (i = baseLevel + 1; i < maxLevels; i++) {
+ if (width > 1) {
+ width /= 2;
+ }
+ if (height > 1) {
+ height /= 2;
+ }
+ if (i >= minLevel && i <= maxLevel) {
+ if (!t->Image[0][i]) {
+ incomplete(t, "2D Image[0][i] == NULL");
+ return;
+ }
+ if (t->Image[0][i]->Width2 != width) {
+ incomplete(t, "2D Image[0][i] bad width");
+ return;
+ }
+ if (t->Image[0][i]->Height2 != height) {
+ incomplete(t, "2D Image[0][i] bad height");
+ return;
+ }
+ if (width==1 && height==1) {
+ return; /* found smallest needed mipmap, all done! */
+ }
+ }
+ }
+ }
+ else if (t->Target == GL_TEXTURE_3D) {
+ /* Test 3-D mipmaps */
+ GLuint width = t->Image[0][baseLevel]->Width2;
+ GLuint height = t->Image[0][baseLevel]->Height2;
+ GLuint depth = t->Image[0][baseLevel]->Depth2;
+ for (i = baseLevel + 1; i < maxLevels; i++) {
+ if (width > 1) {
+ width /= 2;
+ }
+ if (height > 1) {
+ height /= 2;
+ }
+ if (depth > 1) {
+ depth /= 2;
+ }
+ if (i >= minLevel && i <= maxLevel) {
+ if (!t->Image[0][i]) {
+ incomplete(t, "3D Image[0][i] == NULL");
+ return;
+ }
+ if (t->Image[0][i]->_BaseFormat == GL_DEPTH_COMPONENT) {
+ incomplete(t, "GL_DEPTH_COMPONENT only works with 1/2D tex");
+ return;
+ }
+ if (t->Image[0][i]->Width2 != width) {
+ incomplete(t, "3D Image[0][i] bad width");
+ return;
+ }
+ if (t->Image[0][i]->Height2 != height) {
+ incomplete(t, "3D Image[0][i] bad height");
+ return;
+ }
+ if (t->Image[0][i]->Depth2 != depth) {
+ incomplete(t, "3D Image[0][i] bad depth");
+ return;
+ }
+ }
+ if (width == 1 && height == 1 && depth == 1) {
+ return; /* found smallest needed mipmap, all done! */
+ }
+ }
+ }
+ else if (t->Target == GL_TEXTURE_CUBE_MAP_ARB) {
+ /* make sure 6 cube faces are consistant */
+ GLuint width = t->Image[0][baseLevel]->Width2;
+ GLuint height = t->Image[0][baseLevel]->Height2;
+ for (i = baseLevel + 1; i < maxLevels; i++) {
+ if (width > 1) {
+ width /= 2;
+ }
+ if (height > 1) {
+ height /= 2;
+ }
+ if (i >= minLevel && i <= maxLevel) {
+ GLuint face;
+ for (face = 0; face < 6; face++) {
+ /* check that we have images defined */
+ if (!t->Image[face][i]) {
+ incomplete(t, "CubeMap Image[n][i] == NULL");
+ return;
+ }
+ /* Don't support GL_DEPTH_COMPONENT for cube maps */
+ if (t->Image[face][i]->_BaseFormat == GL_DEPTH_COMPONENT) {
+ incomplete(t, "GL_DEPTH_COMPONENT only works with 1/2D tex");
+ return;
+ }
+ /* check that all six images have same size */
+ if (t->Image[face][i]->Width2 != width ||
+ t->Image[face][i]->Height2 != height) {
+ incomplete(t, "CubeMap Image[n][i] bad size");
+ return;
+ }
+ }
+ }
+ if (width == 1 && height == 1) {
+ return; /* found smallest needed mipmap, all done! */
+ }
+ }
+ }
+ else if (t->Target == GL_TEXTURE_RECTANGLE_NV) {
+ /* XXX special checking? */
+ }
+ else {
+ /* Target = ??? */
+ _mesa_problem(ctx, "Bug in gl_test_texture_object_completeness\n");
+ }
+ }
+}
+
+
+/**
+ * Check if the given cube map texture is "cube complete" as defined in
+ * the OpenGL specification.
+ */
+GLboolean
+_mesa_cube_complete(const struct gl_texture_object *texObj)
+{
+ const GLint baseLevel = texObj->BaseLevel;
+ const struct gl_texture_image *img0, *img;
+ GLuint face;
+
+ if (texObj->Target != GL_TEXTURE_CUBE_MAP)
+ return GL_FALSE;
+
+ if ((baseLevel < 0) || (baseLevel >= MAX_TEXTURE_LEVELS))
+ return GL_FALSE;
+
+ /* check first face */
+ img0 = texObj->Image[0][baseLevel];
+ if (!img0 ||
+ img0->Width < 1 ||
+ img0->Width != img0->Height)
+ return GL_FALSE;
+
+ /* check remaining faces vs. first face */
+ for (face = 1; face < 6; face++) {
+ img = texObj->Image[face][baseLevel];
+ if (!img ||
+ img->Width != img0->Width ||
+ img->Height != img0->Height ||
+ img->TexFormat != img0->TexFormat)
+ return GL_FALSE;
+ }
+
+ return GL_TRUE;
+}
+
+
+/**
+ * Mark a texture object dirty. It forces the object to be incomplete
+ * and optionally forces the context to re-validate its state.
+ *
+ * \param ctx GL context.
+ * \param texObj texture object.
+ * \param invalidate_state also invalidate context state.
+ */
+void
+_mesa_dirty_texobj(struct gl_context *ctx, struct gl_texture_object *texObj,
+ GLboolean invalidate_state)
+{
+ texObj->_Complete = GL_FALSE;
+ if (invalidate_state)
+ ctx->NewState |= _NEW_TEXTURE;
+}
+
+
+/**
+ * Return pointer to a default/fallback texture.
+ * The texture is a 2D 8x8 RGBA texture with all texels = (0,0,0,1).
+ * That's the value a sampler should get when sampling from an
+ * incomplete texture.
+ */
+struct gl_texture_object *
+_mesa_get_fallback_texture(struct gl_context *ctx)
+{
+ if (!ctx->Shared->FallbackTex) {
+ /* create fallback texture now */
+ static GLubyte texels[8 * 8][4];
+ struct gl_texture_object *texObj;
+ struct gl_texture_image *texImage;
+ gl_format texFormat;
+ GLuint i;
+
+ for (i = 0; i < 8 * 8; i++) {
+ texels[i][0] =
+ texels[i][1] =
+ texels[i][2] = 0x0;
+ texels[i][3] = 0xff;
+ }
+
+ /* create texture object */
+ texObj = ctx->Driver.NewTextureObject(ctx, 0, GL_TEXTURE_2D);
+ assert(texObj->RefCount == 1);
+ texObj->Sampler.MinFilter = GL_NEAREST;
+ texObj->Sampler.MagFilter = GL_NEAREST;
+
+ /* create level[0] texture image */
+ texImage = _mesa_get_tex_image(ctx, texObj, GL_TEXTURE_2D, 0);
+
+ texFormat = ctx->Driver.ChooseTextureFormat(ctx, GL_RGBA, GL_RGBA,
+ GL_UNSIGNED_BYTE);
+
+ /* init the image fields */
+ _mesa_init_teximage_fields(ctx, GL_TEXTURE_2D, texImage,
+ 8, 8, 1, 0, GL_RGBA, texFormat);
+
+ ASSERT(texImage->TexFormat != MESA_FORMAT_NONE);
+
+ /* set image data */
+ ctx->Driver.TexImage2D(ctx, GL_TEXTURE_2D, 0, GL_RGBA,
+ 8, 8, 0,
+ GL_RGBA, GL_UNSIGNED_BYTE, texels,
+ &ctx->DefaultPacking, texObj, texImage);
+
+ _mesa_test_texobj_completeness(ctx, texObj);
+ assert(texObj->_Complete);
+
+ ctx->Shared->FallbackTex = texObj;
+ }
+ return ctx->Shared->FallbackTex;
+}
+
+
+/*@}*/
+
+
+/***********************************************************************/
+/** \name API functions */
+/*@{*/
+
+
+/**
+ * Generate texture names.
+ *
+ * \param n number of texture names to be generated.
+ * \param textures an array in which will hold the generated texture names.
+ *
+ * \sa glGenTextures().
+ *
+ * Calls _mesa_HashFindFreeKeyBlock() to find a block of free texture
+ * IDs which are stored in \p textures. Corresponding empty texture
+ * objects are also generated.
+ */
+void GLAPIENTRY
+_mesa_GenTextures( GLsizei n, GLuint *textures )
+{
+ GET_CURRENT_CONTEXT(ctx);
+ GLuint first;
+ GLint i;
+ ASSERT_OUTSIDE_BEGIN_END(ctx);
+
+ if (n < 0) {
+ _mesa_error( ctx, GL_INVALID_VALUE, "glGenTextures" );
+ return;
+ }
+
+ if (!textures)
+ return;
+
+ /*
+ * This must be atomic (generation and allocation of texture IDs)
+ */
+ _glthread_LOCK_MUTEX(ctx->Shared->Mutex);
+
+ first = _mesa_HashFindFreeKeyBlock(ctx->Shared->TexObjects, n);
+
+ /* Allocate new, empty texture objects */
+ for (i = 0; i < n; i++) {
+ struct gl_texture_object *texObj;
+ GLuint name = first + i;
+ GLenum target = 0;
+ texObj = (*ctx->Driver.NewTextureObject)( ctx, name, target);
+ if (!texObj) {
+ _glthread_UNLOCK_MUTEX(ctx->Shared->Mutex);
+ _mesa_error(ctx, GL_OUT_OF_MEMORY, "glGenTextures");
+ return;
+ }
+
+ /* insert into hash table */
+ _mesa_HashInsert(ctx->Shared->TexObjects, texObj->Name, texObj);
+
+ textures[i] = name;
+ }
+
+ _glthread_UNLOCK_MUTEX(ctx->Shared->Mutex);
+}
+
+
+/**
+ * Check if the given texture object is bound to the current draw or
+ * read framebuffer. If so, Unbind it.
+ */
+static void
+unbind_texobj_from_fbo(struct gl_context *ctx,
+ struct gl_texture_object *texObj)
+{
+ const GLuint n = (ctx->DrawBuffer == ctx->ReadBuffer) ? 1 : 2;
+ GLuint i;
+
+ for (i = 0; i < n; i++) {
+ struct gl_framebuffer *fb = (i == 0) ? ctx->DrawBuffer : ctx->ReadBuffer;
+ if (fb->Name) {
+ GLuint j;
+ for (j = 0; j < BUFFER_COUNT; j++) {
+ if (fb->Attachment[j].Type == GL_TEXTURE &&
+ fb->Attachment[j].Texture == texObj) {
+ _mesa_remove_attachment(ctx, fb->Attachment + j);
+ }
+ }
+ }
+ }
+}
+
+
+/**
+ * Check if the given texture object is bound to any texture image units and
+ * unbind it if so (revert to default textures).
+ */
+static void
+unbind_texobj_from_texunits(struct gl_context *ctx,
+ struct gl_texture_object *texObj)
+{
+ GLuint u, tex;
+
+ for (u = 0; u < MAX_TEXTURE_IMAGE_UNITS; u++) {
+ struct gl_texture_unit *unit = &ctx->Texture.Unit[u];
+ for (tex = 0; tex < NUM_TEXTURE_TARGETS; tex++) {
+ if (texObj == unit->CurrentTex[tex]) {
+ _mesa_reference_texobj(&unit->CurrentTex[tex],
+ ctx->Shared->DefaultTex[tex]);
+ ASSERT(unit->CurrentTex[tex]);
+ break;
+ }
+ }
+ }
+}
+
+
+/**
+ * Delete named textures.
+ *
+ * \param n number of textures to be deleted.
+ * \param textures array of texture IDs to be deleted.
+ *
+ * \sa glDeleteTextures().
+ *
+ * If we're about to delete a texture that's currently bound to any
+ * texture unit, unbind the texture first. Decrement the reference
+ * count on the texture object and delete it if it's zero.
+ * Recall that texture objects can be shared among several rendering
+ * contexts.
+ */
+void GLAPIENTRY
+_mesa_DeleteTextures( GLsizei n, const GLuint *textures)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ GLint i;
+ ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); /* too complex */
+
+ if (!textures)
+ return;
+
+ for (i = 0; i < n; i++) {
+ if (textures[i] > 0) {
+ struct gl_texture_object *delObj
+ = _mesa_lookup_texture(ctx, textures[i]);
+
+ if (delObj) {
+ _mesa_lock_texture(ctx, delObj);
+
+ /* Check if texture is bound to any framebuffer objects.
+ * If so, unbind.
+ * See section 4.4.2.3 of GL_EXT_framebuffer_object.
+ */
+ unbind_texobj_from_fbo(ctx, delObj);
+
+ /* Check if this texture is currently bound to any texture units.
+ * If so, unbind it.
+ */
+ unbind_texobj_from_texunits(ctx, delObj);
+
+ _mesa_unlock_texture(ctx, delObj);
+
+ ctx->NewState |= _NEW_TEXTURE;
+
+ /* The texture _name_ is now free for re-use.
+ * Remove it from the hash table now.
+ */
+ _glthread_LOCK_MUTEX(ctx->Shared->Mutex);
+ _mesa_HashRemove(ctx->Shared->TexObjects, delObj->Name);
+ _glthread_UNLOCK_MUTEX(ctx->Shared->Mutex);
+
+ /* Unreference the texobj. If refcount hits zero, the texture
+ * will be deleted.
+ */
+ _mesa_reference_texobj(&delObj, NULL);
+ }
+ }
+ }
+}
+
+
+/**
+ * Convert a GL texture target enum such as GL_TEXTURE_2D or GL_TEXTURE_3D
+ * into the corresponding Mesa texture target index.
+ * Note that proxy targets are not valid here.
+ * \return TEXTURE_x_INDEX or -1 if target is invalid
+ */
+static GLint
+target_enum_to_index(GLenum target)
+{
+ switch (target) {
+ case GL_TEXTURE_1D:
+ return TEXTURE_1D_INDEX;
+ case GL_TEXTURE_2D:
+ return TEXTURE_2D_INDEX;
+ case GL_TEXTURE_3D:
+ return TEXTURE_3D_INDEX;
+ case GL_TEXTURE_CUBE_MAP_ARB:
+ return TEXTURE_CUBE_INDEX;
+ case GL_TEXTURE_RECTANGLE_NV:
+ return TEXTURE_RECT_INDEX;
+ case GL_TEXTURE_1D_ARRAY_EXT:
+ return TEXTURE_1D_ARRAY_INDEX;
+ case GL_TEXTURE_2D_ARRAY_EXT:
+ return TEXTURE_2D_ARRAY_INDEX;
+ case GL_TEXTURE_BUFFER_ARB:
+ return TEXTURE_BUFFER_INDEX;
+ default:
+ return -1;
+ }
+}
+
+
+/**
+ * Bind a named texture to a texturing target.
+ *
+ * \param target texture target.
+ * \param texName texture name.
+ *
+ * \sa glBindTexture().
+ *
+ * Determines the old texture object bound and returns immediately if rebinding
+ * the same texture. Get the current texture which is either a default texture
+ * if name is null, a named texture from the hash, or a new texture if the
+ * given texture name is new. Increments its reference count, binds it, and
+ * calls dd_function_table::BindTexture. Decrements the old texture reference
+ * count and deletes it if it reaches zero.
+ */
+void GLAPIENTRY
+_mesa_BindTexture( GLenum target, GLuint texName )
+{
+ GET_CURRENT_CONTEXT(ctx);
+ struct gl_texture_unit *texUnit = _mesa_get_current_tex_unit(ctx);
+ struct gl_texture_object *newTexObj = NULL;
+ GLint targetIndex;
+ ASSERT_OUTSIDE_BEGIN_END(ctx);
+
+ if (MESA_VERBOSE & (VERBOSE_API|VERBOSE_TEXTURE))
+ _mesa_debug(ctx, "glBindTexture %s %d\n",
+ _mesa_lookup_enum_by_nr(target), (GLint) texName);
+
+ targetIndex = target_enum_to_index(target);
+ if (targetIndex < 0) {
+ _mesa_error(ctx, GL_INVALID_ENUM, "glBindTexture(target)");
+ return;
+ }
+ assert(targetIndex < NUM_TEXTURE_TARGETS);
+
+ /*
+ * Get pointer to new texture object (newTexObj)
+ */
+ if (texName == 0) {
+ /* Use a default texture object */
+ newTexObj = ctx->Shared->DefaultTex[targetIndex];
+ }
+ else {
+ /* non-default texture object */
+ newTexObj = _mesa_lookup_texture(ctx, texName);
+ if (newTexObj) {
+ /* error checking */
+ if (newTexObj->Target != 0 && newTexObj->Target != target) {
+ /* the named texture object's target doesn't match the given target */
+ _mesa_error( ctx, GL_INVALID_OPERATION,
+ "glBindTexture(target mismatch)" );
+ return;
+ }
+ if (newTexObj->Target == 0) {
+ finish_texture_init(ctx, target, newTexObj);
+ }
+ }
+ else {
+ /* if this is a new texture id, allocate a texture object now */
+ newTexObj = (*ctx->Driver.NewTextureObject)(ctx, texName, target);
+ if (!newTexObj) {
+ _mesa_error(ctx, GL_OUT_OF_MEMORY, "glBindTexture");
+ return;
+ }
+
+ /* and insert it into hash table */
+ _glthread_LOCK_MUTEX(ctx->Shared->Mutex);
+ _mesa_HashInsert(ctx->Shared->TexObjects, texName, newTexObj);
+ _glthread_UNLOCK_MUTEX(ctx->Shared->Mutex);
+ }
+ newTexObj->Target = target;
+ }
+
+ assert(valid_texture_object(newTexObj));
+
+ /* Check if this texture is only used by this context and is already bound.
+ * If so, just return.
+ */
+ {
+ GLboolean early_out;
+ _glthread_LOCK_MUTEX(ctx->Shared->Mutex);
+ early_out = ((ctx->Shared->RefCount == 1)
+ && (newTexObj == texUnit->CurrentTex[targetIndex]));
+ _glthread_UNLOCK_MUTEX(ctx->Shared->Mutex);
+ if (early_out) {
+ return;
+ }
+ }
+
+ /* flush before changing binding */
+ FLUSH_VERTICES(ctx, _NEW_TEXTURE);
+
+ /* Do the actual binding. The refcount on the previously bound
+ * texture object will be decremented. It'll be deleted if the
+ * count hits zero.
+ */
+ _mesa_reference_texobj(&texUnit->CurrentTex[targetIndex], newTexObj);
+ ASSERT(texUnit->CurrentTex[targetIndex]);
+
+ /* Pass BindTexture call to device driver */
+ if (ctx->Driver.BindTexture)
+ (*ctx->Driver.BindTexture)( ctx, target, newTexObj );
+}
+
+
+/**
+ * Set texture priorities.
+ *
+ * \param n number of textures.
+ * \param texName texture names.
+ * \param priorities corresponding texture priorities.
+ *
+ * \sa glPrioritizeTextures().
+ *
+ * Looks up each texture in the hash, clamps the corresponding priority between
+ * 0.0 and 1.0, and calls dd_function_table::PrioritizeTexture.
+ */
+void GLAPIENTRY
+_mesa_PrioritizeTextures( GLsizei n, const GLuint *texName,
+ const GLclampf *priorities )
+{
+ GET_CURRENT_CONTEXT(ctx);
+ GLint i;
+ ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
+
+ if (n < 0) {
+ _mesa_error( ctx, GL_INVALID_VALUE, "glPrioritizeTextures" );
+ return;
+ }
+
+ if (!priorities)
+ return;
+
+ for (i = 0; i < n; i++) {
+ if (texName[i] > 0) {
+ struct gl_texture_object *t = _mesa_lookup_texture(ctx, texName[i]);
+ if (t) {
+ t->Priority = CLAMP( priorities[i], 0.0F, 1.0F );
+ }
+ }
+ }
+
+ ctx->NewState |= _NEW_TEXTURE;
+}
+
+
+
+/**
+ * See if textures are loaded in texture memory.
+ *
+ * \param n number of textures to query.
+ * \param texName array with the texture names.
+ * \param residences array which will hold the residence status.
+ *
+ * \return GL_TRUE if all textures are resident and \p residences is left unchanged,
+ *
+ * \sa glAreTexturesResident().
+ *
+ * Looks up each texture in the hash and calls
+ * dd_function_table::IsTextureResident.
+ */
+GLboolean GLAPIENTRY
+_mesa_AreTexturesResident(GLsizei n, const GLuint *texName,
+ GLboolean *residences)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ GLboolean allResident = GL_TRUE;
+ GLint i, j;
+ ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, GL_FALSE);
+
+ if (n < 0) {
+ _mesa_error(ctx, GL_INVALID_VALUE, "glAreTexturesResident(n)");
+ return GL_FALSE;
+ }
+
+ if (!texName || !residences)
+ return GL_FALSE;
+
+ for (i = 0; i < n; i++) {
+ struct gl_texture_object *t;
+ if (texName[i] == 0) {
+ _mesa_error(ctx, GL_INVALID_VALUE, "glAreTexturesResident");
+ return GL_FALSE;
+ }
+ t = _mesa_lookup_texture(ctx, texName[i]);
+ if (!t) {
+ _mesa_error(ctx, GL_INVALID_VALUE, "glAreTexturesResident");
+ return GL_FALSE;
+ }
+ if (!ctx->Driver.IsTextureResident ||
+ ctx->Driver.IsTextureResident(ctx, t)) {
+ /* The texture is resident */
+ if (!allResident)
+ residences[i] = GL_TRUE;
+ }
+ else {
+ /* The texture is not resident */
+ if (allResident) {
+ allResident = GL_FALSE;
+ for (j = 0; j < i; j++)
+ residences[j] = GL_TRUE;
+ }
+ residences[i] = GL_FALSE;
+ }
+ }
+
+ return allResident;
+}
+
+
+/**
+ * See if a name corresponds to a texture.
+ *
+ * \param texture texture name.
+ *
+ * \return GL_TRUE if texture name corresponds to a texture, or GL_FALSE
+ * otherwise.
+ *
+ * \sa glIsTexture().
+ *
+ * Calls _mesa_HashLookup().
+ */
+GLboolean GLAPIENTRY
+_mesa_IsTexture( GLuint texture )
+{
+ struct gl_texture_object *t;
+ GET_CURRENT_CONTEXT(ctx);
+ ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, GL_FALSE);
+
+ if (!texture)
+ return GL_FALSE;
+
+ t = _mesa_lookup_texture(ctx, texture);
+
+ /* IsTexture is true only after object has been bound once. */
+ return t && t->Target;
+}
+
+
+/**
+ * Simplest implementation of texture locking: grab the shared tex
+ * mutex. Examine the shared context state timestamp and if there has
+ * been a change, set the appropriate bits in ctx->NewState.
+ *
+ * This is used to deal with synchronizing things when a texture object
+ * is used/modified by different contexts (or threads) which are sharing
+ * the texture.
+ *
+ * See also _mesa_lock/unlock_texture() in teximage.h
+ */
+void
+_mesa_lock_context_textures( struct gl_context *ctx )
+{
+ _glthread_LOCK_MUTEX(ctx->Shared->TexMutex);
+
+ if (ctx->Shared->TextureStateStamp != ctx->TextureStateTimestamp) {
+ ctx->NewState |= _NEW_TEXTURE;
+ ctx->TextureStateTimestamp = ctx->Shared->TextureStateStamp;
+ }
+}
+
+
+void
+_mesa_unlock_context_textures( struct gl_context *ctx )
+{
+ assert(ctx->Shared->TextureStateStamp == ctx->TextureStateTimestamp);
+ _glthread_UNLOCK_MUTEX(ctx->Shared->TexMutex);
+}
+
+/*@}*/
diff --git a/mesalib/src/mesa/main/texparam.c b/mesalib/src/mesa/main/texparam.c
index 4b9dcb5d3..545c44ab9 100644
--- a/mesalib/src/mesa/main/texparam.c
+++ b/mesalib/src/mesa/main/texparam.c
@@ -1,1490 +1,1490 @@
-/*
- * Mesa 3-D graphics library
- * Version: 7.5
- *
- * Copyright (C) 1999-2008 Brian Paul All Rights Reserved.
- * Copyright (C) 2009 VMware, Inc. All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-/**
- * \file texparam.c
- *
- * glTexParameter-related functions
- */
-
-
-#include "main/glheader.h"
-#include "main/colormac.h"
-#include "main/context.h"
-#include "main/enums.h"
-#include "main/formats.h"
-#include "main/macros.h"
-#include "main/mfeatures.h"
-#include "main/mtypes.h"
-#include "main/state.h"
-#include "main/texcompress.h"
-#include "main/texparam.h"
-#include "main/teximage.h"
-#include "main/texstate.h"
-#include "main/texfetch.h"
-#include "program/prog_instruction.h"
-
-
-/**
- * Check if a coordinate wrap mode is supported for the texture target.
- * \return GL_TRUE if legal, GL_FALSE otherwise
- */
-static GLboolean
-validate_texture_wrap_mode(struct gl_context * ctx, GLenum target, GLenum wrap)
-{
- const struct gl_extensions * const e = & ctx->Extensions;
-
- if (wrap == GL_CLAMP || wrap == GL_CLAMP_TO_EDGE ||
- (wrap == GL_CLAMP_TO_BORDER && e->ARB_texture_border_clamp)) {
- /* any texture target */
- return GL_TRUE;
- }
- else if (target != GL_TEXTURE_RECTANGLE_NV &&
- (wrap == GL_REPEAT ||
- (wrap == GL_MIRRORED_REPEAT &&
- e->ARB_texture_mirrored_repeat) ||
- (wrap == GL_MIRROR_CLAMP_EXT &&
- (e->ATI_texture_mirror_once || e->EXT_texture_mirror_clamp)) ||
- (wrap == GL_MIRROR_CLAMP_TO_EDGE_EXT &&
- (e->ATI_texture_mirror_once || e->EXT_texture_mirror_clamp)) ||
- (wrap == GL_MIRROR_CLAMP_TO_BORDER_EXT &&
- (e->EXT_texture_mirror_clamp)))) {
- /* non-rectangle texture */
- return GL_TRUE;
- }
-
- _mesa_error( ctx, GL_INVALID_ENUM, "glTexParameter(param=0x%x)", wrap );
- return GL_FALSE;
-}
-
-
-/**
- * Get current texture object for given target.
- * Return NULL if any error (and record the error).
- * Note that this is different from _mesa_select_tex_object() in that proxy
- * targets are not accepted.
- * Only the glGetTexLevelParameter() functions accept proxy targets.
- */
-static struct gl_texture_object *
-get_texobj(struct gl_context *ctx, GLenum target, GLboolean get)
-{
- struct gl_texture_unit *texUnit;
-
- if (ctx->Texture.CurrentUnit >= ctx->Const.MaxCombinedTextureImageUnits) {
- _mesa_error(ctx, GL_INVALID_OPERATION,
- "gl%sTexParameter(current unit)", get ? "Get" : "");
- return NULL;
- }
-
- texUnit = _mesa_get_current_tex_unit(ctx);
-
- switch (target) {
- case GL_TEXTURE_1D:
- return texUnit->CurrentTex[TEXTURE_1D_INDEX];
- case GL_TEXTURE_2D:
- return texUnit->CurrentTex[TEXTURE_2D_INDEX];
- case GL_TEXTURE_3D:
- return texUnit->CurrentTex[TEXTURE_3D_INDEX];
- case GL_TEXTURE_CUBE_MAP:
- if (ctx->Extensions.ARB_texture_cube_map) {
- return texUnit->CurrentTex[TEXTURE_CUBE_INDEX];
- }
- break;
- case GL_TEXTURE_RECTANGLE_NV:
- if (ctx->Extensions.NV_texture_rectangle) {
- return texUnit->CurrentTex[TEXTURE_RECT_INDEX];
- }
- break;
- case GL_TEXTURE_1D_ARRAY_EXT:
- if (ctx->Extensions.MESA_texture_array ||
- ctx->Extensions.EXT_texture_array) {
- return texUnit->CurrentTex[TEXTURE_1D_ARRAY_INDEX];
- }
- break;
- case GL_TEXTURE_2D_ARRAY_EXT:
- if (ctx->Extensions.MESA_texture_array ||
- ctx->Extensions.EXT_texture_array) {
- return texUnit->CurrentTex[TEXTURE_2D_ARRAY_INDEX];
- }
- break;
- default:
- ;
- }
-
- _mesa_error(ctx, GL_INVALID_ENUM,
- "gl%sTexParameter(target)", get ? "Get" : "");
- return NULL;
-}
-
-
-/**
- * Convert GL_RED/GREEN/BLUE/ALPHA/ZERO/ONE to SWIZZLE_X/Y/Z/W/ZERO/ONE.
- * \return -1 if error.
- */
-static GLint
-comp_to_swizzle(GLenum comp)
-{
- switch (comp) {
- case GL_RED:
- return SWIZZLE_X;
- case GL_GREEN:
- return SWIZZLE_Y;
- case GL_BLUE:
- return SWIZZLE_Z;
- case GL_ALPHA:
- return SWIZZLE_W;
- case GL_ZERO:
- return SWIZZLE_ZERO;
- case GL_ONE:
- return SWIZZLE_ONE;
- default:
- return -1;
- }
-}
-
-
-static void
-set_swizzle_component(GLuint *swizzle, GLuint comp, GLuint swz)
-{
- ASSERT(comp < 4);
- ASSERT(swz <= SWIZZLE_NIL);
- {
- GLuint mask = 0x7 << (3 * comp);
- GLuint s = (*swizzle & ~mask) | (swz << (3 * comp));
- *swizzle = s;
- }
-}
-
-
-/**
- * This is called just prior to changing any texture object state which
- * will not effect texture completeness.
- */
-static INLINE void
-flush(struct gl_context *ctx)
-{
- FLUSH_VERTICES(ctx, _NEW_TEXTURE);
-}
-
-
-/**
- * This is called just prior to changing any texture object state which
- * can effect texture completeness (texture base level, max level,
- * minification filter).
- * Any pending rendering will be flushed out, we'll set the _NEW_TEXTURE
- * state flag and then mark the texture object as 'incomplete' so that any
- * per-texture derived state gets recomputed.
- */
-static INLINE void
-incomplete(struct gl_context *ctx, struct gl_texture_object *texObj)
-{
- FLUSH_VERTICES(ctx, _NEW_TEXTURE);
- texObj->_Complete = GL_FALSE;
-}
-
-
-/**
- * Set an integer-valued texture parameter
- * \return GL_TRUE if legal AND the value changed, GL_FALSE otherwise
- */
-static GLboolean
-set_tex_parameteri(struct gl_context *ctx,
- struct gl_texture_object *texObj,
- GLenum pname, const GLint *params)
-{
- switch (pname) {
- case GL_TEXTURE_MIN_FILTER:
- if (texObj->Sampler.MinFilter == params[0])
- return GL_FALSE;
- switch (params[0]) {
- case GL_NEAREST:
- case GL_LINEAR:
- incomplete(ctx, texObj);
- texObj->Sampler.MinFilter = params[0];
- return GL_TRUE;
- case GL_NEAREST_MIPMAP_NEAREST:
- case GL_LINEAR_MIPMAP_NEAREST:
- case GL_NEAREST_MIPMAP_LINEAR:
- case GL_LINEAR_MIPMAP_LINEAR:
- if (texObj->Target != GL_TEXTURE_RECTANGLE_NV) {
- incomplete(ctx, texObj);
- texObj->Sampler.MinFilter = params[0];
- return GL_TRUE;
- }
- /* fall-through */
- default:
- goto invalid_param;
- }
- return GL_FALSE;
-
- case GL_TEXTURE_MAG_FILTER:
- if (texObj->Sampler.MagFilter == params[0])
- return GL_FALSE;
- switch (params[0]) {
- case GL_NEAREST:
- case GL_LINEAR:
- flush(ctx); /* does not effect completeness */
- texObj->Sampler.MagFilter = params[0];
- return GL_TRUE;
- default:
- goto invalid_param;
- }
- return GL_FALSE;
-
- case GL_TEXTURE_WRAP_S:
- if (texObj->Sampler.WrapS == params[0])
- return GL_FALSE;
- if (validate_texture_wrap_mode(ctx, texObj->Target, params[0])) {
- flush(ctx);
- texObj->Sampler.WrapS = params[0];
- return GL_TRUE;
- }
- return GL_FALSE;
-
- case GL_TEXTURE_WRAP_T:
- if (texObj->Sampler.WrapT == params[0])
- return GL_FALSE;
- if (validate_texture_wrap_mode(ctx, texObj->Target, params[0])) {
- flush(ctx);
- texObj->Sampler.WrapT = params[0];
- return GL_TRUE;
- }
- return GL_FALSE;
-
- case GL_TEXTURE_WRAP_R:
- if (texObj->Sampler.WrapR == params[0])
- return GL_FALSE;
- if (validate_texture_wrap_mode(ctx, texObj->Target, params[0])) {
- flush(ctx);
- texObj->Sampler.WrapR = params[0];
- return GL_TRUE;
- }
- return GL_FALSE;
-
- case GL_TEXTURE_BASE_LEVEL:
- if (texObj->BaseLevel == params[0])
- return GL_FALSE;
- if (params[0] < 0 ||
- (texObj->Target == GL_TEXTURE_RECTANGLE_ARB && params[0] != 0)) {
- _mesa_error(ctx, GL_INVALID_VALUE,
- "glTexParameter(param=%d)", params[0]);
- return GL_FALSE;
- }
- incomplete(ctx, texObj);
- texObj->BaseLevel = params[0];
- return GL_TRUE;
-
- case GL_TEXTURE_MAX_LEVEL:
- if (texObj->MaxLevel == params[0])
- return GL_FALSE;
- if (params[0] < 0 || texObj->Target == GL_TEXTURE_RECTANGLE_ARB) {
- _mesa_error(ctx, GL_INVALID_OPERATION,
- "glTexParameter(param=%d)", params[0]);
- return GL_FALSE;
- }
- incomplete(ctx, texObj);
- texObj->MaxLevel = params[0];
- return GL_TRUE;
-
- case GL_GENERATE_MIPMAP_SGIS:
- if (texObj->GenerateMipmap != params[0]) {
- /* no flush() */
- texObj->GenerateMipmap = params[0] ? GL_TRUE : GL_FALSE;
- return GL_TRUE;
- }
- return GL_FALSE;
-
- case GL_TEXTURE_COMPARE_MODE_ARB:
- if (ctx->Extensions.ARB_shadow) {
- if (texObj->Sampler.CompareMode == params[0])
- return GL_FALSE;
- if (params[0] == GL_NONE ||
- params[0] == GL_COMPARE_R_TO_TEXTURE_ARB) {
- flush(ctx);
- texObj->Sampler.CompareMode = params[0];
- return GL_TRUE;
- }
- goto invalid_param;
- }
- goto invalid_pname;
-
- case GL_TEXTURE_COMPARE_FUNC_ARB:
- if (ctx->Extensions.ARB_shadow) {
- if (texObj->Sampler.CompareFunc == params[0])
- return GL_FALSE;
- switch (params[0]) {
- case GL_LEQUAL:
- case GL_GEQUAL:
- flush(ctx);
- texObj->Sampler.CompareFunc = params[0];
- return GL_TRUE;
- case GL_EQUAL:
- case GL_NOTEQUAL:
- case GL_LESS:
- case GL_GREATER:
- case GL_ALWAYS:
- case GL_NEVER:
- if (ctx->Extensions.EXT_shadow_funcs) {
- flush(ctx);
- texObj->Sampler.CompareFunc = params[0];
- return GL_TRUE;
- }
- /* fall-through */
- default:
- goto invalid_param;
- }
- }
- goto invalid_pname;
-
- case GL_DEPTH_TEXTURE_MODE_ARB:
- if (ctx->Extensions.ARB_depth_texture) {
- if (texObj->Sampler.DepthMode == params[0])
- return GL_FALSE;
- if (params[0] == GL_LUMINANCE ||
- params[0] == GL_INTENSITY ||
- params[0] == GL_ALPHA ||
- (ctx->Extensions.ARB_texture_rg && params[0] == GL_RED)) {
- flush(ctx);
- texObj->Sampler.DepthMode = params[0];
- return GL_TRUE;
- }
- goto invalid_param;
- }
- goto invalid_pname;
-
-#if FEATURE_OES_draw_texture
- case GL_TEXTURE_CROP_RECT_OES:
- texObj->CropRect[0] = params[0];
- texObj->CropRect[1] = params[1];
- texObj->CropRect[2] = params[2];
- texObj->CropRect[3] = params[3];
- return GL_TRUE;
-#endif
-
- case GL_TEXTURE_SWIZZLE_R_EXT:
- case GL_TEXTURE_SWIZZLE_G_EXT:
- case GL_TEXTURE_SWIZZLE_B_EXT:
- case GL_TEXTURE_SWIZZLE_A_EXT:
- if (ctx->Extensions.EXT_texture_swizzle) {
- const GLuint comp = pname - GL_TEXTURE_SWIZZLE_R_EXT;
- const GLint swz = comp_to_swizzle(params[0]);
- if (swz < 0) {
- _mesa_error(ctx, GL_INVALID_OPERATION,
- "glTexParameter(swizzle 0x%x)", params[0]);
- return GL_FALSE;
- }
- ASSERT(comp < 4);
- if (swz >= 0) {
- flush(ctx);
- texObj->Swizzle[comp] = params[0];
- set_swizzle_component(&texObj->_Swizzle, comp, swz);
- return GL_TRUE;
- }
- }
- goto invalid_pname;
-
- case GL_TEXTURE_SWIZZLE_RGBA_EXT:
- if (ctx->Extensions.EXT_texture_swizzle) {
- GLuint comp;
- flush(ctx);
- for (comp = 0; comp < 4; comp++) {
- const GLint swz = comp_to_swizzle(params[comp]);
- if (swz >= 0) {
- texObj->Swizzle[comp] = params[comp];
- set_swizzle_component(&texObj->_Swizzle, comp, swz);
- }
- else {
- _mesa_error(ctx, GL_INVALID_OPERATION,
- "glTexParameter(swizzle 0x%x)", params[comp]);
- return GL_FALSE;
- }
- }
- return GL_TRUE;
- }
- goto invalid_pname;
-
- case GL_TEXTURE_SRGB_DECODE_EXT:
- if (ctx->Extensions.EXT_texture_sRGB_decode) {
- GLenum decode = params[0];
- if (decode == GL_DECODE_EXT || decode == GL_SKIP_DECODE_EXT) {
- if (texObj->Sampler.sRGBDecode != decode) {
- flush(ctx);
- texObj->Sampler.sRGBDecode = decode;
- _mesa_update_fetch_functions(texObj);
- }
- return GL_TRUE;
- }
- }
- goto invalid_pname;
-
- case GL_TEXTURE_CUBE_MAP_SEAMLESS:
- if (ctx->Extensions.AMD_seamless_cubemap_per_texture) {
- GLenum param = params[0];
- if (param != GL_TRUE && param != GL_FALSE) {
- goto invalid_param;
- }
- if (param != texObj->Sampler.CubeMapSeamless) {
- flush(ctx);
- texObj->Sampler.CubeMapSeamless = param;
- }
- return GL_TRUE;
- }
- goto invalid_pname;
-
- default:
- goto invalid_pname;
- }
-
-invalid_pname:
- _mesa_error(ctx, GL_INVALID_ENUM, "glTexParameter(pname=%s)",
- _mesa_lookup_enum_by_nr(pname));
- return GL_FALSE;
-
-invalid_param:
- _mesa_error(ctx, GL_INVALID_ENUM, "glTexParameter(param=%s)",
- _mesa_lookup_enum_by_nr(params[0]));
- return GL_FALSE;
-}
-
-
-/**
- * Set a float-valued texture parameter
- * \return GL_TRUE if legal AND the value changed, GL_FALSE otherwise
- */
-static GLboolean
-set_tex_parameterf(struct gl_context *ctx,
- struct gl_texture_object *texObj,
- GLenum pname, const GLfloat *params)
-{
- switch (pname) {
- case GL_TEXTURE_MIN_LOD:
- if (texObj->Sampler.MinLod == params[0])
- return GL_FALSE;
- flush(ctx);
- texObj->Sampler.MinLod = params[0];
- return GL_TRUE;
-
- case GL_TEXTURE_MAX_LOD:
- if (texObj->Sampler.MaxLod == params[0])
- return GL_FALSE;
- flush(ctx);
- texObj->Sampler.MaxLod = params[0];
- return GL_TRUE;
-
- case GL_TEXTURE_PRIORITY:
- flush(ctx);
- texObj->Priority = CLAMP(params[0], 0.0F, 1.0F);
- return GL_TRUE;
-
- case GL_TEXTURE_MAX_ANISOTROPY_EXT:
- if (ctx->Extensions.EXT_texture_filter_anisotropic) {
- if (texObj->Sampler.MaxAnisotropy == params[0])
- return GL_FALSE;
- if (params[0] < 1.0) {
- _mesa_error(ctx, GL_INVALID_VALUE, "glTexParameter(param)" );
- return GL_FALSE;
- }
- flush(ctx);
- /* clamp to max, that's what NVIDIA does */
- texObj->Sampler.MaxAnisotropy = MIN2(params[0],
- ctx->Const.MaxTextureMaxAnisotropy);
- return GL_TRUE;
- }
- else {
- static GLuint count = 0;
- if (count++ < 10)
- _mesa_error(ctx, GL_INVALID_ENUM,
- "glTexParameter(pname=GL_TEXTURE_MAX_ANISOTROPY_EXT)");
- }
- return GL_FALSE;
-
- case GL_TEXTURE_COMPARE_FAIL_VALUE_ARB:
- if (ctx->Extensions.ARB_shadow_ambient) {
- if (texObj->Sampler.CompareFailValue != params[0]) {
- flush(ctx);
- texObj->Sampler.CompareFailValue = CLAMP(params[0], 0.0F, 1.0F);
- return GL_TRUE;
- }
- }
- else {
- _mesa_error(ctx, GL_INVALID_ENUM,
- "glTexParameter(pname=GL_TEXTURE_COMPARE_FAIL_VALUE_ARB)");
- }
- return GL_FALSE;
-
- case GL_TEXTURE_LOD_BIAS:
- /* NOTE: this is really part of OpenGL 1.4, not EXT_texture_lod_bias */
- if (ctx->Extensions.EXT_texture_lod_bias) {
- if (texObj->Sampler.LodBias != params[0]) {
- flush(ctx);
- texObj->Sampler.LodBias = params[0];
- return GL_TRUE;
- }
- return GL_FALSE;
- }
- break;
-
- case GL_TEXTURE_BORDER_COLOR:
- flush(ctx);
- /* ARB_texture_float disables clamping */
- if (ctx->Extensions.ARB_texture_float) {
- texObj->Sampler.BorderColor.f[RCOMP] = params[0];
- texObj->Sampler.BorderColor.f[GCOMP] = params[1];
- texObj->Sampler.BorderColor.f[BCOMP] = params[2];
- texObj->Sampler.BorderColor.f[ACOMP] = params[3];
- } else {
- texObj->Sampler.BorderColor.f[RCOMP] = CLAMP(params[0], 0.0F, 1.0F);
- texObj->Sampler.BorderColor.f[GCOMP] = CLAMP(params[1], 0.0F, 1.0F);
- texObj->Sampler.BorderColor.f[BCOMP] = CLAMP(params[2], 0.0F, 1.0F);
- texObj->Sampler.BorderColor.f[ACOMP] = CLAMP(params[3], 0.0F, 1.0F);
- }
- return GL_TRUE;
-
- default:
- _mesa_error(ctx, GL_INVALID_ENUM, "glTexParameter(pname=0x%x)", pname);
- }
- return GL_FALSE;
-}
-
-
-void GLAPIENTRY
-_mesa_TexParameterf(GLenum target, GLenum pname, GLfloat param)
-{
- GLboolean need_update;
- struct gl_texture_object *texObj;
- GET_CURRENT_CONTEXT(ctx);
- ASSERT_OUTSIDE_BEGIN_END(ctx);
-
- texObj = get_texobj(ctx, target, GL_FALSE);
- if (!texObj)
- return;
-
- switch (pname) {
- case GL_TEXTURE_MIN_FILTER:
- case GL_TEXTURE_MAG_FILTER:
- case GL_TEXTURE_WRAP_S:
- case GL_TEXTURE_WRAP_T:
- case GL_TEXTURE_WRAP_R:
- case GL_TEXTURE_BASE_LEVEL:
- case GL_TEXTURE_MAX_LEVEL:
- case GL_GENERATE_MIPMAP_SGIS:
- case GL_TEXTURE_COMPARE_MODE_ARB:
- case GL_TEXTURE_COMPARE_FUNC_ARB:
- case GL_DEPTH_TEXTURE_MODE_ARB:
- case GL_TEXTURE_SRGB_DECODE_EXT:
- case GL_TEXTURE_CUBE_MAP_SEAMLESS:
- {
- /* convert float param to int */
- GLint p[4];
- p[0] = (GLint) param;
- p[1] = p[2] = p[3] = 0;
- need_update = set_tex_parameteri(ctx, texObj, pname, p);
- }
- break;
- default:
- {
- /* this will generate an error if pname is illegal */
- GLfloat p[4];
- p[0] = param;
- p[1] = p[2] = p[3] = 0.0F;
- need_update = set_tex_parameterf(ctx, texObj, pname, p);
- }
- }
-
- if (ctx->Driver.TexParameter && need_update) {
- ctx->Driver.TexParameter(ctx, target, texObj, pname, &param);
- }
-}
-
-
-void GLAPIENTRY
-_mesa_TexParameterfv(GLenum target, GLenum pname, const GLfloat *params)
-{
- GLboolean need_update;
- struct gl_texture_object *texObj;
- GET_CURRENT_CONTEXT(ctx);
- ASSERT_OUTSIDE_BEGIN_END(ctx);
-
- texObj = get_texobj(ctx, target, GL_FALSE);
- if (!texObj)
- return;
-
- switch (pname) {
- case GL_TEXTURE_MIN_FILTER:
- case GL_TEXTURE_MAG_FILTER:
- case GL_TEXTURE_WRAP_S:
- case GL_TEXTURE_WRAP_T:
- case GL_TEXTURE_WRAP_R:
- case GL_TEXTURE_BASE_LEVEL:
- case GL_TEXTURE_MAX_LEVEL:
- case GL_GENERATE_MIPMAP_SGIS:
- case GL_TEXTURE_COMPARE_MODE_ARB:
- case GL_TEXTURE_COMPARE_FUNC_ARB:
- case GL_DEPTH_TEXTURE_MODE_ARB:
- case GL_TEXTURE_SRGB_DECODE_EXT:
- case GL_TEXTURE_CUBE_MAP_SEAMLESS:
- {
- /* convert float param to int */
- GLint p[4];
- p[0] = (GLint) params[0];
- p[1] = p[2] = p[3] = 0;
- need_update = set_tex_parameteri(ctx, texObj, pname, p);
- }
- break;
-
-#if FEATURE_OES_draw_texture
- case GL_TEXTURE_CROP_RECT_OES:
- {
- /* convert float params to int */
- GLint iparams[4];
- iparams[0] = (GLint) params[0];
- iparams[1] = (GLint) params[1];
- iparams[2] = (GLint) params[2];
- iparams[3] = (GLint) params[3];
- need_update = set_tex_parameteri(ctx, texObj, pname, iparams);
- }
- break;
-#endif
-
- default:
- /* this will generate an error if pname is illegal */
- need_update = set_tex_parameterf(ctx, texObj, pname, params);
- }
-
- if (ctx->Driver.TexParameter && need_update) {
- ctx->Driver.TexParameter(ctx, target, texObj, pname, params);
- }
-}
-
-
-void GLAPIENTRY
-_mesa_TexParameteri(GLenum target, GLenum pname, GLint param)
-{
- GLboolean need_update;
- struct gl_texture_object *texObj;
- GET_CURRENT_CONTEXT(ctx);
- ASSERT_OUTSIDE_BEGIN_END(ctx);
-
- texObj = get_texobj(ctx, target, GL_FALSE);
- if (!texObj)
- return;
-
- switch (pname) {
- case GL_TEXTURE_MIN_LOD:
- case GL_TEXTURE_MAX_LOD:
- case GL_TEXTURE_PRIORITY:
- case GL_TEXTURE_MAX_ANISOTROPY_EXT:
- case GL_TEXTURE_LOD_BIAS:
- case GL_TEXTURE_COMPARE_FAIL_VALUE_ARB:
- {
- GLfloat fparam[4];
- fparam[0] = (GLfloat) param;
- fparam[1] = fparam[2] = fparam[3] = 0.0F;
- /* convert int param to float */
- need_update = set_tex_parameterf(ctx, texObj, pname, fparam);
- }
- break;
- default:
- /* this will generate an error if pname is illegal */
- {
- GLint iparam[4];
- iparam[0] = param;
- iparam[1] = iparam[2] = iparam[3] = 0;
- need_update = set_tex_parameteri(ctx, texObj, pname, iparam);
- }
- }
-
- if (ctx->Driver.TexParameter && need_update) {
- GLfloat fparam = (GLfloat) param;
- ctx->Driver.TexParameter(ctx, target, texObj, pname, &fparam);
- }
-}
-
-
-void GLAPIENTRY
-_mesa_TexParameteriv(GLenum target, GLenum pname, const GLint *params)
-{
- GLboolean need_update;
- struct gl_texture_object *texObj;
- GET_CURRENT_CONTEXT(ctx);
- ASSERT_OUTSIDE_BEGIN_END(ctx);
-
- texObj = get_texobj(ctx, target, GL_FALSE);
- if (!texObj)
- return;
-
- switch (pname) {
- case GL_TEXTURE_BORDER_COLOR:
- {
- /* convert int params to float */
- GLfloat fparams[4];
- fparams[0] = INT_TO_FLOAT(params[0]);
- fparams[1] = INT_TO_FLOAT(params[1]);
- fparams[2] = INT_TO_FLOAT(params[2]);
- fparams[3] = INT_TO_FLOAT(params[3]);
- need_update = set_tex_parameterf(ctx, texObj, pname, fparams);
- }
- break;
- case GL_TEXTURE_MIN_LOD:
- case GL_TEXTURE_MAX_LOD:
- case GL_TEXTURE_PRIORITY:
- case GL_TEXTURE_MAX_ANISOTROPY_EXT:
- case GL_TEXTURE_LOD_BIAS:
- case GL_TEXTURE_COMPARE_FAIL_VALUE_ARB:
- {
- /* convert int param to float */
- GLfloat fparams[4];
- fparams[0] = (GLfloat) params[0];
- fparams[1] = fparams[2] = fparams[3] = 0.0F;
- need_update = set_tex_parameterf(ctx, texObj, pname, fparams);
- }
- break;
- default:
- /* this will generate an error if pname is illegal */
- need_update = set_tex_parameteri(ctx, texObj, pname, params);
- }
-
- if (ctx->Driver.TexParameter && need_update) {
- GLfloat fparams[4];
- fparams[0] = INT_TO_FLOAT(params[0]);
- if (pname == GL_TEXTURE_BORDER_COLOR ||
- pname == GL_TEXTURE_CROP_RECT_OES) {
- fparams[1] = INT_TO_FLOAT(params[1]);
- fparams[2] = INT_TO_FLOAT(params[2]);
- fparams[3] = INT_TO_FLOAT(params[3]);
- }
- ctx->Driver.TexParameter(ctx, target, texObj, pname, fparams);
- }
-}
-
-
-/**
- * Set tex parameter to integer value(s). Primarily intended to set
- * integer-valued texture border color (for integer-valued textures).
- * New in GL 3.0.
- */
-void GLAPIENTRY
-_mesa_TexParameterIiv(GLenum target, GLenum pname, const GLint *params)
-{
- struct gl_texture_object *texObj;
- GET_CURRENT_CONTEXT(ctx);
- ASSERT_OUTSIDE_BEGIN_END(ctx);
-
- texObj = get_texobj(ctx, target, GL_FALSE);
- if (!texObj)
- return;
-
- switch (pname) {
- case GL_TEXTURE_BORDER_COLOR:
- FLUSH_VERTICES(ctx, _NEW_TEXTURE);
- /* set the integer-valued border color */
- COPY_4V(texObj->Sampler.BorderColor.i, params);
- break;
- default:
- _mesa_TexParameteriv(target, pname, params);
- break;
- }
- /* XXX no driver hook for TexParameterIiv() yet */
-}
-
-
-/**
- * Set tex parameter to unsigned integer value(s). Primarily intended to set
- * uint-valued texture border color (for integer-valued textures).
- * New in GL 3.0
- */
-void GLAPIENTRY
-_mesa_TexParameterIuiv(GLenum target, GLenum pname, const GLuint *params)
-{
- struct gl_texture_object *texObj;
- GET_CURRENT_CONTEXT(ctx);
- ASSERT_OUTSIDE_BEGIN_END(ctx);
-
- texObj = get_texobj(ctx, target, GL_FALSE);
- if (!texObj)
- return;
-
- switch (pname) {
- case GL_TEXTURE_BORDER_COLOR:
- FLUSH_VERTICES(ctx, _NEW_TEXTURE);
- /* set the unsigned integer-valued border color */
- COPY_4V(texObj->Sampler.BorderColor.ui, params);
- break;
- default:
- _mesa_TexParameteriv(target, pname, (const GLint *) params);
- break;
- }
- /* XXX no driver hook for TexParameterIuiv() yet */
-}
-
-
-
-
-void GLAPIENTRY
-_mesa_GetTexLevelParameterfv( GLenum target, GLint level,
- GLenum pname, GLfloat *params )
-{
- GLint iparam;
- _mesa_GetTexLevelParameteriv( target, level, pname, &iparam );
- *params = (GLfloat) iparam;
-}
-
-
-void GLAPIENTRY
-_mesa_GetTexLevelParameteriv( GLenum target, GLint level,
- GLenum pname, GLint *params )
-{
- const struct gl_texture_unit *texUnit;
- struct gl_texture_object *texObj;
- const struct gl_texture_image *img = NULL;
- GLint maxLevels;
- gl_format texFormat;
- GET_CURRENT_CONTEXT(ctx);
- ASSERT_OUTSIDE_BEGIN_END(ctx);
-
- if (ctx->Texture.CurrentUnit >= ctx->Const.MaxCombinedTextureImageUnits) {
- _mesa_error(ctx, GL_INVALID_OPERATION,
- "glGetTexLevelParameteriv(current unit)");
- return;
- }
-
- texUnit = _mesa_get_current_tex_unit(ctx);
-
- /* this will catch bad target values */
- maxLevels = _mesa_max_texture_levels(ctx, target);
- if (maxLevels == 0) {
- _mesa_error(ctx, GL_INVALID_ENUM,
- "glGetTexLevelParameter[if]v(target=0x%x)", target);
- return;
- }
-
- if (level < 0 || level >= maxLevels) {
- _mesa_error( ctx, GL_INVALID_VALUE, "glGetTexLevelParameter[if]v" );
- return;
- }
-
- texObj = _mesa_select_tex_object(ctx, texUnit, target);
-
- img = _mesa_select_tex_image(ctx, texObj, target, level);
- if (!img || !img->TexFormat) {
- /* undefined texture image */
- if (pname == GL_TEXTURE_COMPONENTS)
- *params = 1;
- else
- *params = 0;
- return;
- }
-
- texFormat = img->TexFormat;
-
- switch (pname) {
- case GL_TEXTURE_WIDTH:
- *params = img->Width;
- break;
- case GL_TEXTURE_HEIGHT:
- *params = img->Height;
- break;
- case GL_TEXTURE_DEPTH:
- *params = img->Depth;
- break;
- case GL_TEXTURE_INTERNAL_FORMAT:
- if (_mesa_is_format_compressed(texFormat)) {
- /* need to return the actual compressed format */
- *params = _mesa_compressed_format_to_glenum(ctx, texFormat);
- }
- else {
- /* return the user's requested internal format */
- *params = img->InternalFormat;
- }
- break;
- case GL_TEXTURE_BORDER:
- *params = img->Border;
- break;
- case GL_TEXTURE_RED_SIZE:
- if (img->_BaseFormat == GL_RED) {
- *params = _mesa_get_format_bits(texFormat, pname);
- break;
- }
- /* FALLTHROUGH */
- case GL_TEXTURE_GREEN_SIZE:
- if (img->_BaseFormat == GL_RG) {
- *params = _mesa_get_format_bits(texFormat, pname);
- break;
- }
- /* FALLTHROUGH */
- case GL_TEXTURE_BLUE_SIZE:
- if (img->_BaseFormat == GL_RGB || img->_BaseFormat == GL_RGBA)
- *params = _mesa_get_format_bits(texFormat, pname);
- else
- *params = 0;
- break;
- case GL_TEXTURE_ALPHA_SIZE:
- if (img->_BaseFormat == GL_ALPHA ||
- img->_BaseFormat == GL_LUMINANCE_ALPHA ||
- img->_BaseFormat == GL_RGBA)
- *params = _mesa_get_format_bits(texFormat, pname);
- else
- *params = 0;
- break;
- case GL_TEXTURE_INTENSITY_SIZE:
- if (img->_BaseFormat != GL_INTENSITY)
- *params = 0;
- else {
- *params = _mesa_get_format_bits(texFormat, pname);
- if (*params == 0) {
- /* intensity probably stored as rgb texture */
- *params = MIN2(_mesa_get_format_bits(texFormat, GL_TEXTURE_RED_SIZE),
- _mesa_get_format_bits(texFormat, GL_TEXTURE_GREEN_SIZE));
- }
- }
- break;
- case GL_TEXTURE_LUMINANCE_SIZE:
- if (img->_BaseFormat != GL_LUMINANCE &&
- img->_BaseFormat != GL_LUMINANCE_ALPHA)
- *params = 0;
- else {
- *params = _mesa_get_format_bits(texFormat, pname);
- if (*params == 0) {
- /* luminance probably stored as rgb texture */
- *params = MIN2(_mesa_get_format_bits(texFormat, GL_TEXTURE_RED_SIZE),
- _mesa_get_format_bits(texFormat, GL_TEXTURE_GREEN_SIZE));
- }
- }
- break;
- case GL_TEXTURE_INDEX_SIZE_EXT:
- if (img->_BaseFormat == GL_COLOR_INDEX)
- *params = _mesa_get_format_bits(texFormat, pname);
- else
- *params = 0;
- break;
- case GL_TEXTURE_DEPTH_SIZE_ARB:
- if (ctx->Extensions.ARB_depth_texture)
- *params = _mesa_get_format_bits(texFormat, pname);
- else
- goto invalid_pname;
- break;
- case GL_TEXTURE_STENCIL_SIZE_EXT:
- if (ctx->Extensions.EXT_packed_depth_stencil ||
- ctx->Extensions.ARB_framebuffer_object) {
- *params = _mesa_get_format_bits(texFormat, pname);
- }
- else {
- goto invalid_pname;
- }
- break;
- case GL_TEXTURE_SHARED_SIZE:
- if (ctx->VersionMajor >= 3 ||
- ctx->Extensions.EXT_texture_shared_exponent) {
- *params = texFormat == MESA_FORMAT_RGB9_E5_FLOAT ? 5 : 0;
- }
- else {
- goto invalid_pname;
- }
- break;
-
- /* GL_ARB_texture_compression */
- case GL_TEXTURE_COMPRESSED_IMAGE_SIZE:
- if (_mesa_is_format_compressed(texFormat) &&
- !_mesa_is_proxy_texture(target)) {
- *params = _mesa_format_image_size(texFormat, img->Width,
- img->Height, img->Depth);
- }
- else {
- _mesa_error(ctx, GL_INVALID_OPERATION,
- "glGetTexLevelParameter[if]v(pname)");
- }
- break;
- case GL_TEXTURE_COMPRESSED:
- *params = (GLint) _mesa_is_format_compressed(texFormat);
- break;
-
- /* GL_ARB_texture_float */
- case GL_TEXTURE_RED_TYPE_ARB:
- if (ctx->Extensions.ARB_texture_float) {
- *params = _mesa_get_format_bits(texFormat, GL_TEXTURE_RED_SIZE) ?
- _mesa_get_format_datatype(texFormat) : GL_NONE;
- }
- else {
- goto invalid_pname;
- }
- break;
- case GL_TEXTURE_GREEN_TYPE_ARB:
- if (ctx->Extensions.ARB_texture_float) {
- *params = _mesa_get_format_bits(texFormat, GL_TEXTURE_GREEN_SIZE) ?
- _mesa_get_format_datatype(texFormat) : GL_NONE;
- }
- else {
- goto invalid_pname;
- }
- break;
- case GL_TEXTURE_BLUE_TYPE_ARB:
- if (ctx->Extensions.ARB_texture_float) {
- *params = _mesa_get_format_bits(texFormat, GL_TEXTURE_BLUE_SIZE) ?
- _mesa_get_format_datatype(texFormat) : GL_NONE;
- }
- else {
- goto invalid_pname;
- }
- break;
- case GL_TEXTURE_ALPHA_TYPE_ARB:
- if (ctx->Extensions.ARB_texture_float) {
- *params = _mesa_get_format_bits(texFormat, GL_TEXTURE_ALPHA_SIZE) ?
- _mesa_get_format_datatype(texFormat) : GL_NONE;
- }
- else {
- goto invalid_pname;
- }
- break;
- case GL_TEXTURE_LUMINANCE_TYPE_ARB:
- if (ctx->Extensions.ARB_texture_float) {
- *params = _mesa_get_format_bits(texFormat, GL_TEXTURE_LUMINANCE_SIZE) ?
- _mesa_get_format_datatype(texFormat) : GL_NONE;
- }
- else {
- goto invalid_pname;
- }
- break;
- case GL_TEXTURE_INTENSITY_TYPE_ARB:
- if (ctx->Extensions.ARB_texture_float) {
- *params = _mesa_get_format_bits(texFormat, GL_TEXTURE_INTENSITY_SIZE) ?
- _mesa_get_format_datatype(texFormat) : GL_NONE;
- }
- else {
- goto invalid_pname;
- }
- break;
- case GL_TEXTURE_DEPTH_TYPE_ARB:
- if (ctx->Extensions.ARB_texture_float) {
- *params = _mesa_get_format_bits(texFormat, GL_TEXTURE_DEPTH_SIZE) ?
- _mesa_get_format_datatype(texFormat) : GL_NONE;
- }
- else {
- goto invalid_pname;
- }
- break;
-
- default:
- goto invalid_pname;
- }
-
- /* no error if we get here */
- return;
-
-invalid_pname:
- _mesa_error(ctx, GL_INVALID_ENUM,
- "glGetTexLevelParameter[if]v(pname=%s)",
- _mesa_lookup_enum_by_nr(pname));
-}
-
-
-
-void GLAPIENTRY
-_mesa_GetTexParameterfv( GLenum target, GLenum pname, GLfloat *params )
-{
- struct gl_texture_object *obj;
- GLboolean error = GL_FALSE;
- GET_CURRENT_CONTEXT(ctx);
- ASSERT_OUTSIDE_BEGIN_END(ctx);
-
- obj = get_texobj(ctx, target, GL_TRUE);
- if (!obj)
- return;
-
- _mesa_lock_texture(ctx, obj);
- switch (pname) {
- case GL_TEXTURE_MAG_FILTER:
- *params = ENUM_TO_FLOAT(obj->Sampler.MagFilter);
- break;
- case GL_TEXTURE_MIN_FILTER:
- *params = ENUM_TO_FLOAT(obj->Sampler.MinFilter);
- break;
- case GL_TEXTURE_WRAP_S:
- *params = ENUM_TO_FLOAT(obj->Sampler.WrapS);
- break;
- case GL_TEXTURE_WRAP_T:
- *params = ENUM_TO_FLOAT(obj->Sampler.WrapT);
- break;
- case GL_TEXTURE_WRAP_R:
- *params = ENUM_TO_FLOAT(obj->Sampler.WrapR);
- break;
- case GL_TEXTURE_BORDER_COLOR:
- if(ctx->NewState & (_NEW_BUFFERS | _NEW_FRAG_CLAMP))
- _mesa_update_state_locked(ctx);
- if(ctx->Color._ClampFragmentColor)
- {
- params[0] = CLAMP(obj->Sampler.BorderColor.f[0], 0.0F, 1.0F);
- params[1] = CLAMP(obj->Sampler.BorderColor.f[1], 0.0F, 1.0F);
- params[2] = CLAMP(obj->Sampler.BorderColor.f[2], 0.0F, 1.0F);
- params[3] = CLAMP(obj->Sampler.BorderColor.f[3], 0.0F, 1.0F);
- }
- else
- {
- params[0] = obj->Sampler.BorderColor.f[0];
- params[1] = obj->Sampler.BorderColor.f[1];
- params[2] = obj->Sampler.BorderColor.f[2];
- params[3] = obj->Sampler.BorderColor.f[3];
- }
- break;
- case GL_TEXTURE_RESIDENT:
- {
- GLboolean resident;
- if (ctx->Driver.IsTextureResident)
- resident = ctx->Driver.IsTextureResident(ctx, obj);
- else
- resident = GL_TRUE;
- *params = ENUM_TO_FLOAT(resident);
- }
- break;
- case GL_TEXTURE_PRIORITY:
- *params = obj->Priority;
- break;
- case GL_TEXTURE_MIN_LOD:
- *params = obj->Sampler.MinLod;
- break;
- case GL_TEXTURE_MAX_LOD:
- *params = obj->Sampler.MaxLod;
- break;
- case GL_TEXTURE_BASE_LEVEL:
- *params = (GLfloat) obj->BaseLevel;
- break;
- case GL_TEXTURE_MAX_LEVEL:
- *params = (GLfloat) obj->MaxLevel;
- break;
- case GL_TEXTURE_MAX_ANISOTROPY_EXT:
- if (ctx->Extensions.EXT_texture_filter_anisotropic) {
- *params = obj->Sampler.MaxAnisotropy;
- }
- else
- error = GL_TRUE;
- break;
- case GL_TEXTURE_COMPARE_FAIL_VALUE_ARB:
- if (ctx->Extensions.ARB_shadow_ambient) {
- *params = obj->Sampler.CompareFailValue;
- }
- else
- error = GL_TRUE;
- break;
- case GL_GENERATE_MIPMAP_SGIS:
- *params = (GLfloat) obj->GenerateMipmap;
- break;
- case GL_TEXTURE_COMPARE_MODE_ARB:
- if (ctx->Extensions.ARB_shadow) {
- *params = (GLfloat) obj->Sampler.CompareMode;
- }
- else
- error = GL_TRUE;
- break;
- case GL_TEXTURE_COMPARE_FUNC_ARB:
- if (ctx->Extensions.ARB_shadow) {
- *params = (GLfloat) obj->Sampler.CompareFunc;
- }
- else
- error = GL_TRUE;
- break;
- case GL_DEPTH_TEXTURE_MODE_ARB:
- if (ctx->Extensions.ARB_depth_texture) {
- *params = (GLfloat) obj->Sampler.DepthMode;
- }
- else
- error = GL_TRUE;
- break;
- case GL_TEXTURE_LOD_BIAS:
- if (ctx->Extensions.EXT_texture_lod_bias) {
- *params = obj->Sampler.LodBias;
- }
- else
- error = GL_TRUE;
- break;
-#if FEATURE_OES_draw_texture
- case GL_TEXTURE_CROP_RECT_OES:
- params[0] = obj->CropRect[0];
- params[1] = obj->CropRect[1];
- params[2] = obj->CropRect[2];
- params[3] = obj->CropRect[3];
- break;
-#endif
-
- case GL_TEXTURE_SWIZZLE_R_EXT:
- case GL_TEXTURE_SWIZZLE_G_EXT:
- case GL_TEXTURE_SWIZZLE_B_EXT:
- case GL_TEXTURE_SWIZZLE_A_EXT:
- if (ctx->Extensions.EXT_texture_swizzle) {
- GLuint comp = pname - GL_TEXTURE_SWIZZLE_R_EXT;
- *params = (GLfloat) obj->Swizzle[comp];
- }
- else {
- error = GL_TRUE;
- }
- break;
-
- case GL_TEXTURE_SWIZZLE_RGBA_EXT:
- if (ctx->Extensions.EXT_texture_swizzle) {
- GLuint comp;
- for (comp = 0; comp < 4; comp++) {
- params[comp] = (GLfloat) obj->Swizzle[comp];
- }
- }
- else {
- error = GL_TRUE;
- }
- break;
-
- case GL_TEXTURE_CUBE_MAP_SEAMLESS:
- if (ctx->Extensions.AMD_seamless_cubemap_per_texture) {
- *params = (GLfloat) obj->Sampler.CubeMapSeamless;
- }
- else {
- error = GL_TRUE;
- }
-
- default:
- error = GL_TRUE;
- break;
- }
-
- if (error)
- _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexParameterfv(pname=0x%x)",
- pname);
-
- _mesa_unlock_texture(ctx, obj);
-}
-
-
-void GLAPIENTRY
-_mesa_GetTexParameteriv( GLenum target, GLenum pname, GLint *params )
-{
- struct gl_texture_object *obj;
- GLboolean error = GL_FALSE;
- GET_CURRENT_CONTEXT(ctx);
- ASSERT_OUTSIDE_BEGIN_END(ctx);
-
- obj = get_texobj(ctx, target, GL_TRUE);
- if (!obj)
- return;
-
- _mesa_lock_texture(ctx, obj);
- switch (pname) {
- case GL_TEXTURE_MAG_FILTER:
- *params = (GLint) obj->Sampler.MagFilter;
- break;;
- case GL_TEXTURE_MIN_FILTER:
- *params = (GLint) obj->Sampler.MinFilter;
- break;;
- case GL_TEXTURE_WRAP_S:
- *params = (GLint) obj->Sampler.WrapS;
- break;;
- case GL_TEXTURE_WRAP_T:
- *params = (GLint) obj->Sampler.WrapT;
- break;;
- case GL_TEXTURE_WRAP_R:
- *params = (GLint) obj->Sampler.WrapR;
- break;;
- case GL_TEXTURE_BORDER_COLOR:
- {
- GLfloat b[4];
- b[0] = CLAMP(obj->Sampler.BorderColor.f[0], 0.0F, 1.0F);
- b[1] = CLAMP(obj->Sampler.BorderColor.f[1], 0.0F, 1.0F);
- b[2] = CLAMP(obj->Sampler.BorderColor.f[2], 0.0F, 1.0F);
- b[3] = CLAMP(obj->Sampler.BorderColor.f[3], 0.0F, 1.0F);
- params[0] = FLOAT_TO_INT(b[0]);
- params[1] = FLOAT_TO_INT(b[1]);
- params[2] = FLOAT_TO_INT(b[2]);
- params[3] = FLOAT_TO_INT(b[3]);
- }
- break;;
- case GL_TEXTURE_RESIDENT:
- {
- GLboolean resident;
- if (ctx->Driver.IsTextureResident)
- resident = ctx->Driver.IsTextureResident(ctx, obj);
- else
- resident = GL_TRUE;
- *params = (GLint) resident;
- }
- break;;
- case GL_TEXTURE_PRIORITY:
- *params = FLOAT_TO_INT(obj->Priority);
- break;;
- case GL_TEXTURE_MIN_LOD:
- *params = (GLint) obj->Sampler.MinLod;
- break;;
- case GL_TEXTURE_MAX_LOD:
- *params = (GLint) obj->Sampler.MaxLod;
- break;;
- case GL_TEXTURE_BASE_LEVEL:
- *params = obj->BaseLevel;
- break;;
- case GL_TEXTURE_MAX_LEVEL:
- *params = obj->MaxLevel;
- break;;
- case GL_TEXTURE_MAX_ANISOTROPY_EXT:
- if (ctx->Extensions.EXT_texture_filter_anisotropic) {
- *params = (GLint) obj->Sampler.MaxAnisotropy;
- }
- else {
- error = GL_TRUE;
- }
- break;
- case GL_TEXTURE_COMPARE_FAIL_VALUE_ARB:
- if (ctx->Extensions.ARB_shadow_ambient) {
- *params = (GLint) FLOAT_TO_INT(obj->Sampler.CompareFailValue);
- }
- else {
- error = GL_TRUE;
- }
- break;
- case GL_GENERATE_MIPMAP_SGIS:
- *params = (GLint) obj->GenerateMipmap;
- break;
- case GL_TEXTURE_COMPARE_MODE_ARB:
- if (ctx->Extensions.ARB_shadow) {
- *params = (GLint) obj->Sampler.CompareMode;
- }
- else {
- error = GL_TRUE;
- }
- break;
- case GL_TEXTURE_COMPARE_FUNC_ARB:
- if (ctx->Extensions.ARB_shadow) {
- *params = (GLint) obj->Sampler.CompareFunc;
- }
- else {
- error = GL_TRUE;
- }
- break;
- case GL_DEPTH_TEXTURE_MODE_ARB:
- if (ctx->Extensions.ARB_depth_texture) {
- *params = (GLint) obj->Sampler.DepthMode;
- }
- else {
- error = GL_TRUE;
- }
- break;
- case GL_TEXTURE_LOD_BIAS:
- if (ctx->Extensions.EXT_texture_lod_bias) {
- *params = (GLint) obj->Sampler.LodBias;
- }
- else {
- error = GL_TRUE;
- }
- break;
-#if FEATURE_OES_draw_texture
- case GL_TEXTURE_CROP_RECT_OES:
- params[0] = obj->CropRect[0];
- params[1] = obj->CropRect[1];
- params[2] = obj->CropRect[2];
- params[3] = obj->CropRect[3];
- break;
-#endif
- case GL_TEXTURE_SWIZZLE_R_EXT:
- case GL_TEXTURE_SWIZZLE_G_EXT:
- case GL_TEXTURE_SWIZZLE_B_EXT:
- case GL_TEXTURE_SWIZZLE_A_EXT:
- if (ctx->Extensions.EXT_texture_swizzle) {
- GLuint comp = pname - GL_TEXTURE_SWIZZLE_R_EXT;
- *params = obj->Swizzle[comp];
- }
- else {
- error = GL_TRUE;
- }
- break;
-
- case GL_TEXTURE_SWIZZLE_RGBA_EXT:
- if (ctx->Extensions.EXT_texture_swizzle) {
- COPY_4V(params, obj->Swizzle);
- }
- else {
- error = GL_TRUE;
- }
- break;
-
- case GL_TEXTURE_CUBE_MAP_SEAMLESS:
- if (ctx->Extensions.AMD_seamless_cubemap_per_texture) {
- *params = (GLint) obj->Sampler.CubeMapSeamless;
- }
- else {
- error = GL_TRUE;
- }
-
- default:
- ; /* silence warnings */
- }
-
- if (error)
- _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexParameteriv(pname=0x%x)",
- pname);
-
- _mesa_unlock_texture(ctx, obj);
-}
-
-
-/** New in GL 3.0 */
-void GLAPIENTRY
-_mesa_GetTexParameterIiv(GLenum target, GLenum pname, GLint *params)
-{
- struct gl_texture_object *texObj;
- GET_CURRENT_CONTEXT(ctx);
- ASSERT_OUTSIDE_BEGIN_END(ctx);
-
- texObj = get_texobj(ctx, target, GL_TRUE);
-
- switch (pname) {
- case GL_TEXTURE_BORDER_COLOR:
- COPY_4V(params, texObj->Sampler.BorderColor.i);
- break;
- default:
- _mesa_GetTexParameteriv(target, pname, params);
- }
-}
-
-
-/** New in GL 3.0 */
-void GLAPIENTRY
-_mesa_GetTexParameterIuiv(GLenum target, GLenum pname, GLuint *params)
-{
- struct gl_texture_object *texObj;
- GET_CURRENT_CONTEXT(ctx);
- ASSERT_OUTSIDE_BEGIN_END(ctx);
-
- texObj = get_texobj(ctx, target, GL_TRUE);
-
- switch (pname) {
- case GL_TEXTURE_BORDER_COLOR:
- COPY_4V(params, texObj->Sampler.BorderColor.i);
- break;
- default:
- {
- GLint ip[4];
- _mesa_GetTexParameteriv(target, pname, ip);
- params[0] = ip[0];
- if (pname == GL_TEXTURE_SWIZZLE_RGBA_EXT ||
- pname == GL_TEXTURE_CROP_RECT_OES) {
- params[1] = ip[1];
- params[2] = ip[2];
- params[3] = ip[3];
- }
- }
- }
-}
+/*
+ * Mesa 3-D graphics library
+ * Version: 7.5
+ *
+ * Copyright (C) 1999-2008 Brian Paul All Rights Reserved.
+ * Copyright (C) 2009 VMware, Inc. All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+/**
+ * \file texparam.c
+ *
+ * glTexParameter-related functions
+ */
+
+
+#include "main/glheader.h"
+#include "main/colormac.h"
+#include "main/context.h"
+#include "main/enums.h"
+#include "main/formats.h"
+#include "main/macros.h"
+#include "main/mfeatures.h"
+#include "main/mtypes.h"
+#include "main/state.h"
+#include "main/texcompress.h"
+#include "main/texparam.h"
+#include "main/teximage.h"
+#include "main/texstate.h"
+#include "main/texfetch.h"
+#include "program/prog_instruction.h"
+
+
+/**
+ * Check if a coordinate wrap mode is supported for the texture target.
+ * \return GL_TRUE if legal, GL_FALSE otherwise
+ */
+static GLboolean
+validate_texture_wrap_mode(struct gl_context * ctx, GLenum target, GLenum wrap)
+{
+ const struct gl_extensions * const e = & ctx->Extensions;
+
+ if (wrap == GL_CLAMP || wrap == GL_CLAMP_TO_EDGE ||
+ (wrap == GL_CLAMP_TO_BORDER && e->ARB_texture_border_clamp)) {
+ /* any texture target */
+ return GL_TRUE;
+ }
+ else if (target != GL_TEXTURE_RECTANGLE_NV &&
+ (wrap == GL_REPEAT ||
+ (wrap == GL_MIRRORED_REPEAT &&
+ e->ARB_texture_mirrored_repeat) ||
+ (wrap == GL_MIRROR_CLAMP_EXT &&
+ (e->ATI_texture_mirror_once || e->EXT_texture_mirror_clamp)) ||
+ (wrap == GL_MIRROR_CLAMP_TO_EDGE_EXT &&
+ (e->ATI_texture_mirror_once || e->EXT_texture_mirror_clamp)) ||
+ (wrap == GL_MIRROR_CLAMP_TO_BORDER_EXT &&
+ (e->EXT_texture_mirror_clamp)))) {
+ /* non-rectangle texture */
+ return GL_TRUE;
+ }
+
+ _mesa_error( ctx, GL_INVALID_ENUM, "glTexParameter(param=0x%x)", wrap );
+ return GL_FALSE;
+}
+
+
+/**
+ * Get current texture object for given target.
+ * Return NULL if any error (and record the error).
+ * Note that this is different from _mesa_select_tex_object() in that proxy
+ * targets are not accepted.
+ * Only the glGetTexLevelParameter() functions accept proxy targets.
+ */
+static struct gl_texture_object *
+get_texobj(struct gl_context *ctx, GLenum target, GLboolean get)
+{
+ struct gl_texture_unit *texUnit;
+
+ if (ctx->Texture.CurrentUnit >= ctx->Const.MaxCombinedTextureImageUnits) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "gl%sTexParameter(current unit)", get ? "Get" : "");
+ return NULL;
+ }
+
+ texUnit = _mesa_get_current_tex_unit(ctx);
+
+ switch (target) {
+ case GL_TEXTURE_1D:
+ return texUnit->CurrentTex[TEXTURE_1D_INDEX];
+ case GL_TEXTURE_2D:
+ return texUnit->CurrentTex[TEXTURE_2D_INDEX];
+ case GL_TEXTURE_3D:
+ return texUnit->CurrentTex[TEXTURE_3D_INDEX];
+ case GL_TEXTURE_CUBE_MAP:
+ if (ctx->Extensions.ARB_texture_cube_map) {
+ return texUnit->CurrentTex[TEXTURE_CUBE_INDEX];
+ }
+ break;
+ case GL_TEXTURE_RECTANGLE_NV:
+ if (ctx->Extensions.NV_texture_rectangle) {
+ return texUnit->CurrentTex[TEXTURE_RECT_INDEX];
+ }
+ break;
+ case GL_TEXTURE_1D_ARRAY_EXT:
+ if (ctx->Extensions.MESA_texture_array ||
+ ctx->Extensions.EXT_texture_array) {
+ return texUnit->CurrentTex[TEXTURE_1D_ARRAY_INDEX];
+ }
+ break;
+ case GL_TEXTURE_2D_ARRAY_EXT:
+ if (ctx->Extensions.MESA_texture_array ||
+ ctx->Extensions.EXT_texture_array) {
+ return texUnit->CurrentTex[TEXTURE_2D_ARRAY_INDEX];
+ }
+ break;
+ default:
+ ;
+ }
+
+ _mesa_error(ctx, GL_INVALID_ENUM,
+ "gl%sTexParameter(target)", get ? "Get" : "");
+ return NULL;
+}
+
+
+/**
+ * Convert GL_RED/GREEN/BLUE/ALPHA/ZERO/ONE to SWIZZLE_X/Y/Z/W/ZERO/ONE.
+ * \return -1 if error.
+ */
+static GLint
+comp_to_swizzle(GLenum comp)
+{
+ switch (comp) {
+ case GL_RED:
+ return SWIZZLE_X;
+ case GL_GREEN:
+ return SWIZZLE_Y;
+ case GL_BLUE:
+ return SWIZZLE_Z;
+ case GL_ALPHA:
+ return SWIZZLE_W;
+ case GL_ZERO:
+ return SWIZZLE_ZERO;
+ case GL_ONE:
+ return SWIZZLE_ONE;
+ default:
+ return -1;
+ }
+}
+
+
+static void
+set_swizzle_component(GLuint *swizzle, GLuint comp, GLuint swz)
+{
+ ASSERT(comp < 4);
+ ASSERT(swz <= SWIZZLE_NIL);
+ {
+ GLuint mask = 0x7 << (3 * comp);
+ GLuint s = (*swizzle & ~mask) | (swz << (3 * comp));
+ *swizzle = s;
+ }
+}
+
+
+/**
+ * This is called just prior to changing any texture object state which
+ * will not effect texture completeness.
+ */
+static INLINE void
+flush(struct gl_context *ctx)
+{
+ FLUSH_VERTICES(ctx, _NEW_TEXTURE);
+}
+
+
+/**
+ * This is called just prior to changing any texture object state which
+ * can effect texture completeness (texture base level, max level,
+ * minification filter).
+ * Any pending rendering will be flushed out, we'll set the _NEW_TEXTURE
+ * state flag and then mark the texture object as 'incomplete' so that any
+ * per-texture derived state gets recomputed.
+ */
+static INLINE void
+incomplete(struct gl_context *ctx, struct gl_texture_object *texObj)
+{
+ FLUSH_VERTICES(ctx, _NEW_TEXTURE);
+ texObj->_Complete = GL_FALSE;
+}
+
+
+/**
+ * Set an integer-valued texture parameter
+ * \return GL_TRUE if legal AND the value changed, GL_FALSE otherwise
+ */
+static GLboolean
+set_tex_parameteri(struct gl_context *ctx,
+ struct gl_texture_object *texObj,
+ GLenum pname, const GLint *params)
+{
+ switch (pname) {
+ case GL_TEXTURE_MIN_FILTER:
+ if (texObj->Sampler.MinFilter == params[0])
+ return GL_FALSE;
+ switch (params[0]) {
+ case GL_NEAREST:
+ case GL_LINEAR:
+ incomplete(ctx, texObj);
+ texObj->Sampler.MinFilter = params[0];
+ return GL_TRUE;
+ case GL_NEAREST_MIPMAP_NEAREST:
+ case GL_LINEAR_MIPMAP_NEAREST:
+ case GL_NEAREST_MIPMAP_LINEAR:
+ case GL_LINEAR_MIPMAP_LINEAR:
+ if (texObj->Target != GL_TEXTURE_RECTANGLE_NV) {
+ incomplete(ctx, texObj);
+ texObj->Sampler.MinFilter = params[0];
+ return GL_TRUE;
+ }
+ /* fall-through */
+ default:
+ goto invalid_param;
+ }
+ return GL_FALSE;
+
+ case GL_TEXTURE_MAG_FILTER:
+ if (texObj->Sampler.MagFilter == params[0])
+ return GL_FALSE;
+ switch (params[0]) {
+ case GL_NEAREST:
+ case GL_LINEAR:
+ flush(ctx); /* does not effect completeness */
+ texObj->Sampler.MagFilter = params[0];
+ return GL_TRUE;
+ default:
+ goto invalid_param;
+ }
+ return GL_FALSE;
+
+ case GL_TEXTURE_WRAP_S:
+ if (texObj->Sampler.WrapS == params[0])
+ return GL_FALSE;
+ if (validate_texture_wrap_mode(ctx, texObj->Target, params[0])) {
+ flush(ctx);
+ texObj->Sampler.WrapS = params[0];
+ return GL_TRUE;
+ }
+ return GL_FALSE;
+
+ case GL_TEXTURE_WRAP_T:
+ if (texObj->Sampler.WrapT == params[0])
+ return GL_FALSE;
+ if (validate_texture_wrap_mode(ctx, texObj->Target, params[0])) {
+ flush(ctx);
+ texObj->Sampler.WrapT = params[0];
+ return GL_TRUE;
+ }
+ return GL_FALSE;
+
+ case GL_TEXTURE_WRAP_R:
+ if (texObj->Sampler.WrapR == params[0])
+ return GL_FALSE;
+ if (validate_texture_wrap_mode(ctx, texObj->Target, params[0])) {
+ flush(ctx);
+ texObj->Sampler.WrapR = params[0];
+ return GL_TRUE;
+ }
+ return GL_FALSE;
+
+ case GL_TEXTURE_BASE_LEVEL:
+ if (texObj->BaseLevel == params[0])
+ return GL_FALSE;
+ if (params[0] < 0 ||
+ (texObj->Target == GL_TEXTURE_RECTANGLE_ARB && params[0] != 0)) {
+ _mesa_error(ctx, GL_INVALID_VALUE,
+ "glTexParameter(param=%d)", params[0]);
+ return GL_FALSE;
+ }
+ incomplete(ctx, texObj);
+ texObj->BaseLevel = params[0];
+ return GL_TRUE;
+
+ case GL_TEXTURE_MAX_LEVEL:
+ if (texObj->MaxLevel == params[0])
+ return GL_FALSE;
+ if (params[0] < 0 || texObj->Target == GL_TEXTURE_RECTANGLE_ARB) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glTexParameter(param=%d)", params[0]);
+ return GL_FALSE;
+ }
+ incomplete(ctx, texObj);
+ texObj->MaxLevel = params[0];
+ return GL_TRUE;
+
+ case GL_GENERATE_MIPMAP_SGIS:
+ if (texObj->GenerateMipmap != params[0]) {
+ /* no flush() */
+ texObj->GenerateMipmap = params[0] ? GL_TRUE : GL_FALSE;
+ return GL_TRUE;
+ }
+ return GL_FALSE;
+
+ case GL_TEXTURE_COMPARE_MODE_ARB:
+ if (ctx->Extensions.ARB_shadow) {
+ if (texObj->Sampler.CompareMode == params[0])
+ return GL_FALSE;
+ if (params[0] == GL_NONE ||
+ params[0] == GL_COMPARE_R_TO_TEXTURE_ARB) {
+ flush(ctx);
+ texObj->Sampler.CompareMode = params[0];
+ return GL_TRUE;
+ }
+ goto invalid_param;
+ }
+ goto invalid_pname;
+
+ case GL_TEXTURE_COMPARE_FUNC_ARB:
+ if (ctx->Extensions.ARB_shadow) {
+ if (texObj->Sampler.CompareFunc == params[0])
+ return GL_FALSE;
+ switch (params[0]) {
+ case GL_LEQUAL:
+ case GL_GEQUAL:
+ flush(ctx);
+ texObj->Sampler.CompareFunc = params[0];
+ return GL_TRUE;
+ case GL_EQUAL:
+ case GL_NOTEQUAL:
+ case GL_LESS:
+ case GL_GREATER:
+ case GL_ALWAYS:
+ case GL_NEVER:
+ if (ctx->Extensions.EXT_shadow_funcs) {
+ flush(ctx);
+ texObj->Sampler.CompareFunc = params[0];
+ return GL_TRUE;
+ }
+ /* fall-through */
+ default:
+ goto invalid_param;
+ }
+ }
+ goto invalid_pname;
+
+ case GL_DEPTH_TEXTURE_MODE_ARB:
+ if (ctx->Extensions.ARB_depth_texture) {
+ if (texObj->Sampler.DepthMode == params[0])
+ return GL_FALSE;
+ if (params[0] == GL_LUMINANCE ||
+ params[0] == GL_INTENSITY ||
+ params[0] == GL_ALPHA ||
+ (ctx->Extensions.ARB_texture_rg && params[0] == GL_RED)) {
+ flush(ctx);
+ texObj->Sampler.DepthMode = params[0];
+ return GL_TRUE;
+ }
+ goto invalid_param;
+ }
+ goto invalid_pname;
+
+#if FEATURE_OES_draw_texture
+ case GL_TEXTURE_CROP_RECT_OES:
+ texObj->CropRect[0] = params[0];
+ texObj->CropRect[1] = params[1];
+ texObj->CropRect[2] = params[2];
+ texObj->CropRect[3] = params[3];
+ return GL_TRUE;
+#endif
+
+ case GL_TEXTURE_SWIZZLE_R_EXT:
+ case GL_TEXTURE_SWIZZLE_G_EXT:
+ case GL_TEXTURE_SWIZZLE_B_EXT:
+ case GL_TEXTURE_SWIZZLE_A_EXT:
+ if (ctx->Extensions.EXT_texture_swizzle) {
+ const GLuint comp = pname - GL_TEXTURE_SWIZZLE_R_EXT;
+ const GLint swz = comp_to_swizzle(params[0]);
+ if (swz < 0) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glTexParameter(swizzle 0x%x)", params[0]);
+ return GL_FALSE;
+ }
+ ASSERT(comp < 4);
+ if (swz >= 0) {
+ flush(ctx);
+ texObj->Swizzle[comp] = params[0];
+ set_swizzle_component(&texObj->_Swizzle, comp, swz);
+ return GL_TRUE;
+ }
+ }
+ goto invalid_pname;
+
+ case GL_TEXTURE_SWIZZLE_RGBA_EXT:
+ if (ctx->Extensions.EXT_texture_swizzle) {
+ GLuint comp;
+ flush(ctx);
+ for (comp = 0; comp < 4; comp++) {
+ const GLint swz = comp_to_swizzle(params[comp]);
+ if (swz >= 0) {
+ texObj->Swizzle[comp] = params[comp];
+ set_swizzle_component(&texObj->_Swizzle, comp, swz);
+ }
+ else {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glTexParameter(swizzle 0x%x)", params[comp]);
+ return GL_FALSE;
+ }
+ }
+ return GL_TRUE;
+ }
+ goto invalid_pname;
+
+ case GL_TEXTURE_SRGB_DECODE_EXT:
+ if (ctx->Extensions.EXT_texture_sRGB_decode) {
+ GLenum decode = params[0];
+ if (decode == GL_DECODE_EXT || decode == GL_SKIP_DECODE_EXT) {
+ if (texObj->Sampler.sRGBDecode != decode) {
+ flush(ctx);
+ texObj->Sampler.sRGBDecode = decode;
+ _mesa_update_fetch_functions(texObj);
+ }
+ return GL_TRUE;
+ }
+ }
+ goto invalid_pname;
+
+ case GL_TEXTURE_CUBE_MAP_SEAMLESS:
+ if (ctx->Extensions.AMD_seamless_cubemap_per_texture) {
+ GLenum param = params[0];
+ if (param != GL_TRUE && param != GL_FALSE) {
+ goto invalid_param;
+ }
+ if (param != texObj->Sampler.CubeMapSeamless) {
+ flush(ctx);
+ texObj->Sampler.CubeMapSeamless = param;
+ }
+ return GL_TRUE;
+ }
+ goto invalid_pname;
+
+ default:
+ goto invalid_pname;
+ }
+
+invalid_pname:
+ _mesa_error(ctx, GL_INVALID_ENUM, "glTexParameter(pname=%s)",
+ _mesa_lookup_enum_by_nr(pname));
+ return GL_FALSE;
+
+invalid_param:
+ _mesa_error(ctx, GL_INVALID_ENUM, "glTexParameter(param=%s)",
+ _mesa_lookup_enum_by_nr(params[0]));
+ return GL_FALSE;
+}
+
+
+/**
+ * Set a float-valued texture parameter
+ * \return GL_TRUE if legal AND the value changed, GL_FALSE otherwise
+ */
+static GLboolean
+set_tex_parameterf(struct gl_context *ctx,
+ struct gl_texture_object *texObj,
+ GLenum pname, const GLfloat *params)
+{
+ switch (pname) {
+ case GL_TEXTURE_MIN_LOD:
+ if (texObj->Sampler.MinLod == params[0])
+ return GL_FALSE;
+ flush(ctx);
+ texObj->Sampler.MinLod = params[0];
+ return GL_TRUE;
+
+ case GL_TEXTURE_MAX_LOD:
+ if (texObj->Sampler.MaxLod == params[0])
+ return GL_FALSE;
+ flush(ctx);
+ texObj->Sampler.MaxLod = params[0];
+ return GL_TRUE;
+
+ case GL_TEXTURE_PRIORITY:
+ flush(ctx);
+ texObj->Priority = CLAMP(params[0], 0.0F, 1.0F);
+ return GL_TRUE;
+
+ case GL_TEXTURE_MAX_ANISOTROPY_EXT:
+ if (ctx->Extensions.EXT_texture_filter_anisotropic) {
+ if (texObj->Sampler.MaxAnisotropy == params[0])
+ return GL_FALSE;
+ if (params[0] < 1.0) {
+ _mesa_error(ctx, GL_INVALID_VALUE, "glTexParameter(param)" );
+ return GL_FALSE;
+ }
+ flush(ctx);
+ /* clamp to max, that's what NVIDIA does */
+ texObj->Sampler.MaxAnisotropy = MIN2(params[0],
+ ctx->Const.MaxTextureMaxAnisotropy);
+ return GL_TRUE;
+ }
+ else {
+ static GLuint count = 0;
+ if (count++ < 10)
+ _mesa_error(ctx, GL_INVALID_ENUM,
+ "glTexParameter(pname=GL_TEXTURE_MAX_ANISOTROPY_EXT)");
+ }
+ return GL_FALSE;
+
+ case GL_TEXTURE_COMPARE_FAIL_VALUE_ARB:
+ if (ctx->Extensions.ARB_shadow_ambient) {
+ if (texObj->Sampler.CompareFailValue != params[0]) {
+ flush(ctx);
+ texObj->Sampler.CompareFailValue = CLAMP(params[0], 0.0F, 1.0F);
+ return GL_TRUE;
+ }
+ }
+ else {
+ _mesa_error(ctx, GL_INVALID_ENUM,
+ "glTexParameter(pname=GL_TEXTURE_COMPARE_FAIL_VALUE_ARB)");
+ }
+ return GL_FALSE;
+
+ case GL_TEXTURE_LOD_BIAS:
+ /* NOTE: this is really part of OpenGL 1.4, not EXT_texture_lod_bias */
+ if (ctx->Extensions.EXT_texture_lod_bias) {
+ if (texObj->Sampler.LodBias != params[0]) {
+ flush(ctx);
+ texObj->Sampler.LodBias = params[0];
+ return GL_TRUE;
+ }
+ return GL_FALSE;
+ }
+ break;
+
+ case GL_TEXTURE_BORDER_COLOR:
+ flush(ctx);
+ /* ARB_texture_float disables clamping */
+ if (ctx->Extensions.ARB_texture_float) {
+ texObj->Sampler.BorderColor.f[RCOMP] = params[0];
+ texObj->Sampler.BorderColor.f[GCOMP] = params[1];
+ texObj->Sampler.BorderColor.f[BCOMP] = params[2];
+ texObj->Sampler.BorderColor.f[ACOMP] = params[3];
+ } else {
+ texObj->Sampler.BorderColor.f[RCOMP] = CLAMP(params[0], 0.0F, 1.0F);
+ texObj->Sampler.BorderColor.f[GCOMP] = CLAMP(params[1], 0.0F, 1.0F);
+ texObj->Sampler.BorderColor.f[BCOMP] = CLAMP(params[2], 0.0F, 1.0F);
+ texObj->Sampler.BorderColor.f[ACOMP] = CLAMP(params[3], 0.0F, 1.0F);
+ }
+ return GL_TRUE;
+
+ default:
+ _mesa_error(ctx, GL_INVALID_ENUM, "glTexParameter(pname=0x%x)", pname);
+ }
+ return GL_FALSE;
+}
+
+
+void GLAPIENTRY
+_mesa_TexParameterf(GLenum target, GLenum pname, GLfloat param)
+{
+ GLboolean need_update;
+ struct gl_texture_object *texObj;
+ GET_CURRENT_CONTEXT(ctx);
+ ASSERT_OUTSIDE_BEGIN_END(ctx);
+
+ texObj = get_texobj(ctx, target, GL_FALSE);
+ if (!texObj)
+ return;
+
+ switch (pname) {
+ case GL_TEXTURE_MIN_FILTER:
+ case GL_TEXTURE_MAG_FILTER:
+ case GL_TEXTURE_WRAP_S:
+ case GL_TEXTURE_WRAP_T:
+ case GL_TEXTURE_WRAP_R:
+ case GL_TEXTURE_BASE_LEVEL:
+ case GL_TEXTURE_MAX_LEVEL:
+ case GL_GENERATE_MIPMAP_SGIS:
+ case GL_TEXTURE_COMPARE_MODE_ARB:
+ case GL_TEXTURE_COMPARE_FUNC_ARB:
+ case GL_DEPTH_TEXTURE_MODE_ARB:
+ case GL_TEXTURE_SRGB_DECODE_EXT:
+ case GL_TEXTURE_CUBE_MAP_SEAMLESS:
+ {
+ /* convert float param to int */
+ GLint p[4];
+ p[0] = (GLint) param;
+ p[1] = p[2] = p[3] = 0;
+ need_update = set_tex_parameteri(ctx, texObj, pname, p);
+ }
+ break;
+ default:
+ {
+ /* this will generate an error if pname is illegal */
+ GLfloat p[4];
+ p[0] = param;
+ p[1] = p[2] = p[3] = 0.0F;
+ need_update = set_tex_parameterf(ctx, texObj, pname, p);
+ }
+ }
+
+ if (ctx->Driver.TexParameter && need_update) {
+ ctx->Driver.TexParameter(ctx, target, texObj, pname, &param);
+ }
+}
+
+
+void GLAPIENTRY
+_mesa_TexParameterfv(GLenum target, GLenum pname, const GLfloat *params)
+{
+ GLboolean need_update;
+ struct gl_texture_object *texObj;
+ GET_CURRENT_CONTEXT(ctx);
+ ASSERT_OUTSIDE_BEGIN_END(ctx);
+
+ texObj = get_texobj(ctx, target, GL_FALSE);
+ if (!texObj)
+ return;
+
+ switch (pname) {
+ case GL_TEXTURE_MIN_FILTER:
+ case GL_TEXTURE_MAG_FILTER:
+ case GL_TEXTURE_WRAP_S:
+ case GL_TEXTURE_WRAP_T:
+ case GL_TEXTURE_WRAP_R:
+ case GL_TEXTURE_BASE_LEVEL:
+ case GL_TEXTURE_MAX_LEVEL:
+ case GL_GENERATE_MIPMAP_SGIS:
+ case GL_TEXTURE_COMPARE_MODE_ARB:
+ case GL_TEXTURE_COMPARE_FUNC_ARB:
+ case GL_DEPTH_TEXTURE_MODE_ARB:
+ case GL_TEXTURE_SRGB_DECODE_EXT:
+ case GL_TEXTURE_CUBE_MAP_SEAMLESS:
+ {
+ /* convert float param to int */
+ GLint p[4];
+ p[0] = (GLint) params[0];
+ p[1] = p[2] = p[3] = 0;
+ need_update = set_tex_parameteri(ctx, texObj, pname, p);
+ }
+ break;
+
+#if FEATURE_OES_draw_texture
+ case GL_TEXTURE_CROP_RECT_OES:
+ {
+ /* convert float params to int */
+ GLint iparams[4];
+ iparams[0] = (GLint) params[0];
+ iparams[1] = (GLint) params[1];
+ iparams[2] = (GLint) params[2];
+ iparams[3] = (GLint) params[3];
+ need_update = set_tex_parameteri(ctx, texObj, pname, iparams);
+ }
+ break;
+#endif
+
+ default:
+ /* this will generate an error if pname is illegal */
+ need_update = set_tex_parameterf(ctx, texObj, pname, params);
+ }
+
+ if (ctx->Driver.TexParameter && need_update) {
+ ctx->Driver.TexParameter(ctx, target, texObj, pname, params);
+ }
+}
+
+
+void GLAPIENTRY
+_mesa_TexParameteri(GLenum target, GLenum pname, GLint param)
+{
+ GLboolean need_update;
+ struct gl_texture_object *texObj;
+ GET_CURRENT_CONTEXT(ctx);
+ ASSERT_OUTSIDE_BEGIN_END(ctx);
+
+ texObj = get_texobj(ctx, target, GL_FALSE);
+ if (!texObj)
+ return;
+
+ switch (pname) {
+ case GL_TEXTURE_MIN_LOD:
+ case GL_TEXTURE_MAX_LOD:
+ case GL_TEXTURE_PRIORITY:
+ case GL_TEXTURE_MAX_ANISOTROPY_EXT:
+ case GL_TEXTURE_LOD_BIAS:
+ case GL_TEXTURE_COMPARE_FAIL_VALUE_ARB:
+ {
+ GLfloat fparam[4];
+ fparam[0] = (GLfloat) param;
+ fparam[1] = fparam[2] = fparam[3] = 0.0F;
+ /* convert int param to float */
+ need_update = set_tex_parameterf(ctx, texObj, pname, fparam);
+ }
+ break;
+ default:
+ /* this will generate an error if pname is illegal */
+ {
+ GLint iparam[4];
+ iparam[0] = param;
+ iparam[1] = iparam[2] = iparam[3] = 0;
+ need_update = set_tex_parameteri(ctx, texObj, pname, iparam);
+ }
+ }
+
+ if (ctx->Driver.TexParameter && need_update) {
+ GLfloat fparam = (GLfloat) param;
+ ctx->Driver.TexParameter(ctx, target, texObj, pname, &fparam);
+ }
+}
+
+
+void GLAPIENTRY
+_mesa_TexParameteriv(GLenum target, GLenum pname, const GLint *params)
+{
+ GLboolean need_update;
+ struct gl_texture_object *texObj;
+ GET_CURRENT_CONTEXT(ctx);
+ ASSERT_OUTSIDE_BEGIN_END(ctx);
+
+ texObj = get_texobj(ctx, target, GL_FALSE);
+ if (!texObj)
+ return;
+
+ switch (pname) {
+ case GL_TEXTURE_BORDER_COLOR:
+ {
+ /* convert int params to float */
+ GLfloat fparams[4];
+ fparams[0] = INT_TO_FLOAT(params[0]);
+ fparams[1] = INT_TO_FLOAT(params[1]);
+ fparams[2] = INT_TO_FLOAT(params[2]);
+ fparams[3] = INT_TO_FLOAT(params[3]);
+ need_update = set_tex_parameterf(ctx, texObj, pname, fparams);
+ }
+ break;
+ case GL_TEXTURE_MIN_LOD:
+ case GL_TEXTURE_MAX_LOD:
+ case GL_TEXTURE_PRIORITY:
+ case GL_TEXTURE_MAX_ANISOTROPY_EXT:
+ case GL_TEXTURE_LOD_BIAS:
+ case GL_TEXTURE_COMPARE_FAIL_VALUE_ARB:
+ {
+ /* convert int param to float */
+ GLfloat fparams[4];
+ fparams[0] = (GLfloat) params[0];
+ fparams[1] = fparams[2] = fparams[3] = 0.0F;
+ need_update = set_tex_parameterf(ctx, texObj, pname, fparams);
+ }
+ break;
+ default:
+ /* this will generate an error if pname is illegal */
+ need_update = set_tex_parameteri(ctx, texObj, pname, params);
+ }
+
+ if (ctx->Driver.TexParameter && need_update) {
+ GLfloat fparams[4];
+ fparams[0] = INT_TO_FLOAT(params[0]);
+ if (pname == GL_TEXTURE_BORDER_COLOR ||
+ pname == GL_TEXTURE_CROP_RECT_OES) {
+ fparams[1] = INT_TO_FLOAT(params[1]);
+ fparams[2] = INT_TO_FLOAT(params[2]);
+ fparams[3] = INT_TO_FLOAT(params[3]);
+ }
+ ctx->Driver.TexParameter(ctx, target, texObj, pname, fparams);
+ }
+}
+
+
+/**
+ * Set tex parameter to integer value(s). Primarily intended to set
+ * integer-valued texture border color (for integer-valued textures).
+ * New in GL 3.0.
+ */
+void GLAPIENTRY
+_mesa_TexParameterIiv(GLenum target, GLenum pname, const GLint *params)
+{
+ struct gl_texture_object *texObj;
+ GET_CURRENT_CONTEXT(ctx);
+ ASSERT_OUTSIDE_BEGIN_END(ctx);
+
+ texObj = get_texobj(ctx, target, GL_FALSE);
+ if (!texObj)
+ return;
+
+ switch (pname) {
+ case GL_TEXTURE_BORDER_COLOR:
+ FLUSH_VERTICES(ctx, _NEW_TEXTURE);
+ /* set the integer-valued border color */
+ COPY_4V(texObj->Sampler.BorderColor.i, params);
+ break;
+ default:
+ _mesa_TexParameteriv(target, pname, params);
+ break;
+ }
+ /* XXX no driver hook for TexParameterIiv() yet */
+}
+
+
+/**
+ * Set tex parameter to unsigned integer value(s). Primarily intended to set
+ * uint-valued texture border color (for integer-valued textures).
+ * New in GL 3.0
+ */
+void GLAPIENTRY
+_mesa_TexParameterIuiv(GLenum target, GLenum pname, const GLuint *params)
+{
+ struct gl_texture_object *texObj;
+ GET_CURRENT_CONTEXT(ctx);
+ ASSERT_OUTSIDE_BEGIN_END(ctx);
+
+ texObj = get_texobj(ctx, target, GL_FALSE);
+ if (!texObj)
+ return;
+
+ switch (pname) {
+ case GL_TEXTURE_BORDER_COLOR:
+ FLUSH_VERTICES(ctx, _NEW_TEXTURE);
+ /* set the unsigned integer-valued border color */
+ COPY_4V(texObj->Sampler.BorderColor.ui, params);
+ break;
+ default:
+ _mesa_TexParameteriv(target, pname, (const GLint *) params);
+ break;
+ }
+ /* XXX no driver hook for TexParameterIuiv() yet */
+}
+
+
+
+
+void GLAPIENTRY
+_mesa_GetTexLevelParameterfv( GLenum target, GLint level,
+ GLenum pname, GLfloat *params )
+{
+ GLint iparam;
+ _mesa_GetTexLevelParameteriv( target, level, pname, &iparam );
+ *params = (GLfloat) iparam;
+}
+
+
+void GLAPIENTRY
+_mesa_GetTexLevelParameteriv( GLenum target, GLint level,
+ GLenum pname, GLint *params )
+{
+ const struct gl_texture_unit *texUnit;
+ struct gl_texture_object *texObj;
+ const struct gl_texture_image *img = NULL;
+ GLint maxLevels;
+ gl_format texFormat;
+ GET_CURRENT_CONTEXT(ctx);
+ ASSERT_OUTSIDE_BEGIN_END(ctx);
+
+ if (ctx->Texture.CurrentUnit >= ctx->Const.MaxCombinedTextureImageUnits) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glGetTexLevelParameteriv(current unit)");
+ return;
+ }
+
+ texUnit = _mesa_get_current_tex_unit(ctx);
+
+ /* this will catch bad target values */
+ maxLevels = _mesa_max_texture_levels(ctx, target);
+ if (maxLevels == 0) {
+ _mesa_error(ctx, GL_INVALID_ENUM,
+ "glGetTexLevelParameter[if]v(target=0x%x)", target);
+ return;
+ }
+
+ if (level < 0 || level >= maxLevels) {
+ _mesa_error( ctx, GL_INVALID_VALUE, "glGetTexLevelParameter[if]v" );
+ return;
+ }
+
+ texObj = _mesa_select_tex_object(ctx, texUnit, target);
+
+ img = _mesa_select_tex_image(ctx, texObj, target, level);
+ if (!img || !img->TexFormat) {
+ /* undefined texture image */
+ if (pname == GL_TEXTURE_COMPONENTS)
+ *params = 1;
+ else
+ *params = 0;
+ return;
+ }
+
+ texFormat = img->TexFormat;
+
+ switch (pname) {
+ case GL_TEXTURE_WIDTH:
+ *params = img->Width;
+ break;
+ case GL_TEXTURE_HEIGHT:
+ *params = img->Height;
+ break;
+ case GL_TEXTURE_DEPTH:
+ *params = img->Depth;
+ break;
+ case GL_TEXTURE_INTERNAL_FORMAT:
+ if (_mesa_is_format_compressed(texFormat)) {
+ /* need to return the actual compressed format */
+ *params = _mesa_compressed_format_to_glenum(ctx, texFormat);
+ }
+ else {
+ /* return the user's requested internal format */
+ *params = img->InternalFormat;
+ }
+ break;
+ case GL_TEXTURE_BORDER:
+ *params = img->Border;
+ break;
+ case GL_TEXTURE_RED_SIZE:
+ if (img->_BaseFormat == GL_RED) {
+ *params = _mesa_get_format_bits(texFormat, pname);
+ break;
+ }
+ /* FALLTHROUGH */
+ case GL_TEXTURE_GREEN_SIZE:
+ if (img->_BaseFormat == GL_RG) {
+ *params = _mesa_get_format_bits(texFormat, pname);
+ break;
+ }
+ /* FALLTHROUGH */
+ case GL_TEXTURE_BLUE_SIZE:
+ if (img->_BaseFormat == GL_RGB || img->_BaseFormat == GL_RGBA)
+ *params = _mesa_get_format_bits(texFormat, pname);
+ else
+ *params = 0;
+ break;
+ case GL_TEXTURE_ALPHA_SIZE:
+ if (img->_BaseFormat == GL_ALPHA ||
+ img->_BaseFormat == GL_LUMINANCE_ALPHA ||
+ img->_BaseFormat == GL_RGBA)
+ *params = _mesa_get_format_bits(texFormat, pname);
+ else
+ *params = 0;
+ break;
+ case GL_TEXTURE_INTENSITY_SIZE:
+ if (img->_BaseFormat != GL_INTENSITY)
+ *params = 0;
+ else {
+ *params = _mesa_get_format_bits(texFormat, pname);
+ if (*params == 0) {
+ /* intensity probably stored as rgb texture */
+ *params = MIN2(_mesa_get_format_bits(texFormat, GL_TEXTURE_RED_SIZE),
+ _mesa_get_format_bits(texFormat, GL_TEXTURE_GREEN_SIZE));
+ }
+ }
+ break;
+ case GL_TEXTURE_LUMINANCE_SIZE:
+ if (img->_BaseFormat != GL_LUMINANCE &&
+ img->_BaseFormat != GL_LUMINANCE_ALPHA)
+ *params = 0;
+ else {
+ *params = _mesa_get_format_bits(texFormat, pname);
+ if (*params == 0) {
+ /* luminance probably stored as rgb texture */
+ *params = MIN2(_mesa_get_format_bits(texFormat, GL_TEXTURE_RED_SIZE),
+ _mesa_get_format_bits(texFormat, GL_TEXTURE_GREEN_SIZE));
+ }
+ }
+ break;
+ case GL_TEXTURE_INDEX_SIZE_EXT:
+ if (img->_BaseFormat == GL_COLOR_INDEX)
+ *params = _mesa_get_format_bits(texFormat, pname);
+ else
+ *params = 0;
+ break;
+ case GL_TEXTURE_DEPTH_SIZE_ARB:
+ if (ctx->Extensions.ARB_depth_texture)
+ *params = _mesa_get_format_bits(texFormat, pname);
+ else
+ goto invalid_pname;
+ break;
+ case GL_TEXTURE_STENCIL_SIZE_EXT:
+ if (ctx->Extensions.EXT_packed_depth_stencil ||
+ ctx->Extensions.ARB_framebuffer_object) {
+ *params = _mesa_get_format_bits(texFormat, pname);
+ }
+ else {
+ goto invalid_pname;
+ }
+ break;
+ case GL_TEXTURE_SHARED_SIZE:
+ if (ctx->VersionMajor >= 3 ||
+ ctx->Extensions.EXT_texture_shared_exponent) {
+ *params = texFormat == MESA_FORMAT_RGB9_E5_FLOAT ? 5 : 0;
+ }
+ else {
+ goto invalid_pname;
+ }
+ break;
+
+ /* GL_ARB_texture_compression */
+ case GL_TEXTURE_COMPRESSED_IMAGE_SIZE:
+ if (_mesa_is_format_compressed(texFormat) &&
+ !_mesa_is_proxy_texture(target)) {
+ *params = _mesa_format_image_size(texFormat, img->Width,
+ img->Height, img->Depth);
+ }
+ else {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glGetTexLevelParameter[if]v(pname)");
+ }
+ break;
+ case GL_TEXTURE_COMPRESSED:
+ *params = (GLint) _mesa_is_format_compressed(texFormat);
+ break;
+
+ /* GL_ARB_texture_float */
+ case GL_TEXTURE_RED_TYPE_ARB:
+ if (ctx->Extensions.ARB_texture_float) {
+ *params = _mesa_get_format_bits(texFormat, GL_TEXTURE_RED_SIZE) ?
+ _mesa_get_format_datatype(texFormat) : GL_NONE;
+ }
+ else {
+ goto invalid_pname;
+ }
+ break;
+ case GL_TEXTURE_GREEN_TYPE_ARB:
+ if (ctx->Extensions.ARB_texture_float) {
+ *params = _mesa_get_format_bits(texFormat, GL_TEXTURE_GREEN_SIZE) ?
+ _mesa_get_format_datatype(texFormat) : GL_NONE;
+ }
+ else {
+ goto invalid_pname;
+ }
+ break;
+ case GL_TEXTURE_BLUE_TYPE_ARB:
+ if (ctx->Extensions.ARB_texture_float) {
+ *params = _mesa_get_format_bits(texFormat, GL_TEXTURE_BLUE_SIZE) ?
+ _mesa_get_format_datatype(texFormat) : GL_NONE;
+ }
+ else {
+ goto invalid_pname;
+ }
+ break;
+ case GL_TEXTURE_ALPHA_TYPE_ARB:
+ if (ctx->Extensions.ARB_texture_float) {
+ *params = _mesa_get_format_bits(texFormat, GL_TEXTURE_ALPHA_SIZE) ?
+ _mesa_get_format_datatype(texFormat) : GL_NONE;
+ }
+ else {
+ goto invalid_pname;
+ }
+ break;
+ case GL_TEXTURE_LUMINANCE_TYPE_ARB:
+ if (ctx->Extensions.ARB_texture_float) {
+ *params = _mesa_get_format_bits(texFormat, GL_TEXTURE_LUMINANCE_SIZE) ?
+ _mesa_get_format_datatype(texFormat) : GL_NONE;
+ }
+ else {
+ goto invalid_pname;
+ }
+ break;
+ case GL_TEXTURE_INTENSITY_TYPE_ARB:
+ if (ctx->Extensions.ARB_texture_float) {
+ *params = _mesa_get_format_bits(texFormat, GL_TEXTURE_INTENSITY_SIZE) ?
+ _mesa_get_format_datatype(texFormat) : GL_NONE;
+ }
+ else {
+ goto invalid_pname;
+ }
+ break;
+ case GL_TEXTURE_DEPTH_TYPE_ARB:
+ if (ctx->Extensions.ARB_texture_float) {
+ *params = _mesa_get_format_bits(texFormat, GL_TEXTURE_DEPTH_SIZE) ?
+ _mesa_get_format_datatype(texFormat) : GL_NONE;
+ }
+ else {
+ goto invalid_pname;
+ }
+ break;
+
+ default:
+ goto invalid_pname;
+ }
+
+ /* no error if we get here */
+ return;
+
+invalid_pname:
+ _mesa_error(ctx, GL_INVALID_ENUM,
+ "glGetTexLevelParameter[if]v(pname=%s)",
+ _mesa_lookup_enum_by_nr(pname));
+}
+
+
+
+void GLAPIENTRY
+_mesa_GetTexParameterfv( GLenum target, GLenum pname, GLfloat *params )
+{
+ struct gl_texture_object *obj;
+ GLboolean error = GL_FALSE;
+ GET_CURRENT_CONTEXT(ctx);
+ ASSERT_OUTSIDE_BEGIN_END(ctx);
+
+ obj = get_texobj(ctx, target, GL_TRUE);
+ if (!obj)
+ return;
+
+ _mesa_lock_texture(ctx, obj);
+ switch (pname) {
+ case GL_TEXTURE_MAG_FILTER:
+ *params = ENUM_TO_FLOAT(obj->Sampler.MagFilter);
+ break;
+ case GL_TEXTURE_MIN_FILTER:
+ *params = ENUM_TO_FLOAT(obj->Sampler.MinFilter);
+ break;
+ case GL_TEXTURE_WRAP_S:
+ *params = ENUM_TO_FLOAT(obj->Sampler.WrapS);
+ break;
+ case GL_TEXTURE_WRAP_T:
+ *params = ENUM_TO_FLOAT(obj->Sampler.WrapT);
+ break;
+ case GL_TEXTURE_WRAP_R:
+ *params = ENUM_TO_FLOAT(obj->Sampler.WrapR);
+ break;
+ case GL_TEXTURE_BORDER_COLOR:
+ if(ctx->NewState & (_NEW_BUFFERS | _NEW_FRAG_CLAMP))
+ _mesa_update_state_locked(ctx);
+ if(ctx->Color._ClampFragmentColor)
+ {
+ params[0] = CLAMP(obj->Sampler.BorderColor.f[0], 0.0F, 1.0F);
+ params[1] = CLAMP(obj->Sampler.BorderColor.f[1], 0.0F, 1.0F);
+ params[2] = CLAMP(obj->Sampler.BorderColor.f[2], 0.0F, 1.0F);
+ params[3] = CLAMP(obj->Sampler.BorderColor.f[3], 0.0F, 1.0F);
+ }
+ else
+ {
+ params[0] = obj->Sampler.BorderColor.f[0];
+ params[1] = obj->Sampler.BorderColor.f[1];
+ params[2] = obj->Sampler.BorderColor.f[2];
+ params[3] = obj->Sampler.BorderColor.f[3];
+ }
+ break;
+ case GL_TEXTURE_RESIDENT:
+ {
+ GLboolean resident;
+ if (ctx->Driver.IsTextureResident)
+ resident = ctx->Driver.IsTextureResident(ctx, obj);
+ else
+ resident = GL_TRUE;
+ *params = ENUM_TO_FLOAT(resident);
+ }
+ break;
+ case GL_TEXTURE_PRIORITY:
+ *params = obj->Priority;
+ break;
+ case GL_TEXTURE_MIN_LOD:
+ *params = obj->Sampler.MinLod;
+ break;
+ case GL_TEXTURE_MAX_LOD:
+ *params = obj->Sampler.MaxLod;
+ break;
+ case GL_TEXTURE_BASE_LEVEL:
+ *params = (GLfloat) obj->BaseLevel;
+ break;
+ case GL_TEXTURE_MAX_LEVEL:
+ *params = (GLfloat) obj->MaxLevel;
+ break;
+ case GL_TEXTURE_MAX_ANISOTROPY_EXT:
+ if (ctx->Extensions.EXT_texture_filter_anisotropic) {
+ *params = obj->Sampler.MaxAnisotropy;
+ }
+ else
+ error = GL_TRUE;
+ break;
+ case GL_TEXTURE_COMPARE_FAIL_VALUE_ARB:
+ if (ctx->Extensions.ARB_shadow_ambient) {
+ *params = obj->Sampler.CompareFailValue;
+ }
+ else
+ error = GL_TRUE;
+ break;
+ case GL_GENERATE_MIPMAP_SGIS:
+ *params = (GLfloat) obj->GenerateMipmap;
+ break;
+ case GL_TEXTURE_COMPARE_MODE_ARB:
+ if (ctx->Extensions.ARB_shadow) {
+ *params = (GLfloat) obj->Sampler.CompareMode;
+ }
+ else
+ error = GL_TRUE;
+ break;
+ case GL_TEXTURE_COMPARE_FUNC_ARB:
+ if (ctx->Extensions.ARB_shadow) {
+ *params = (GLfloat) obj->Sampler.CompareFunc;
+ }
+ else
+ error = GL_TRUE;
+ break;
+ case GL_DEPTH_TEXTURE_MODE_ARB:
+ if (ctx->Extensions.ARB_depth_texture) {
+ *params = (GLfloat) obj->Sampler.DepthMode;
+ }
+ else
+ error = GL_TRUE;
+ break;
+ case GL_TEXTURE_LOD_BIAS:
+ if (ctx->Extensions.EXT_texture_lod_bias) {
+ *params = obj->Sampler.LodBias;
+ }
+ else
+ error = GL_TRUE;
+ break;
+#if FEATURE_OES_draw_texture
+ case GL_TEXTURE_CROP_RECT_OES:
+ params[0] = obj->CropRect[0];
+ params[1] = obj->CropRect[1];
+ params[2] = obj->CropRect[2];
+ params[3] = obj->CropRect[3];
+ break;
+#endif
+
+ case GL_TEXTURE_SWIZZLE_R_EXT:
+ case GL_TEXTURE_SWIZZLE_G_EXT:
+ case GL_TEXTURE_SWIZZLE_B_EXT:
+ case GL_TEXTURE_SWIZZLE_A_EXT:
+ if (ctx->Extensions.EXT_texture_swizzle) {
+ GLuint comp = pname - GL_TEXTURE_SWIZZLE_R_EXT;
+ *params = (GLfloat) obj->Swizzle[comp];
+ }
+ else {
+ error = GL_TRUE;
+ }
+ break;
+
+ case GL_TEXTURE_SWIZZLE_RGBA_EXT:
+ if (ctx->Extensions.EXT_texture_swizzle) {
+ GLuint comp;
+ for (comp = 0; comp < 4; comp++) {
+ params[comp] = (GLfloat) obj->Swizzle[comp];
+ }
+ }
+ else {
+ error = GL_TRUE;
+ }
+ break;
+
+ case GL_TEXTURE_CUBE_MAP_SEAMLESS:
+ if (ctx->Extensions.AMD_seamless_cubemap_per_texture) {
+ *params = (GLfloat) obj->Sampler.CubeMapSeamless;
+ }
+ else {
+ error = GL_TRUE;
+ }
+
+ default:
+ error = GL_TRUE;
+ break;
+ }
+
+ if (error)
+ _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexParameterfv(pname=0x%x)",
+ pname);
+
+ _mesa_unlock_texture(ctx, obj);
+}
+
+
+void GLAPIENTRY
+_mesa_GetTexParameteriv( GLenum target, GLenum pname, GLint *params )
+{
+ struct gl_texture_object *obj;
+ GLboolean error = GL_FALSE;
+ GET_CURRENT_CONTEXT(ctx);
+ ASSERT_OUTSIDE_BEGIN_END(ctx);
+
+ obj = get_texobj(ctx, target, GL_TRUE);
+ if (!obj)
+ return;
+
+ _mesa_lock_texture(ctx, obj);
+ switch (pname) {
+ case GL_TEXTURE_MAG_FILTER:
+ *params = (GLint) obj->Sampler.MagFilter;
+ break;;
+ case GL_TEXTURE_MIN_FILTER:
+ *params = (GLint) obj->Sampler.MinFilter;
+ break;;
+ case GL_TEXTURE_WRAP_S:
+ *params = (GLint) obj->Sampler.WrapS;
+ break;;
+ case GL_TEXTURE_WRAP_T:
+ *params = (GLint) obj->Sampler.WrapT;
+ break;;
+ case GL_TEXTURE_WRAP_R:
+ *params = (GLint) obj->Sampler.WrapR;
+ break;;
+ case GL_TEXTURE_BORDER_COLOR:
+ {
+ GLfloat b[4];
+ b[0] = CLAMP(obj->Sampler.BorderColor.f[0], 0.0F, 1.0F);
+ b[1] = CLAMP(obj->Sampler.BorderColor.f[1], 0.0F, 1.0F);
+ b[2] = CLAMP(obj->Sampler.BorderColor.f[2], 0.0F, 1.0F);
+ b[3] = CLAMP(obj->Sampler.BorderColor.f[3], 0.0F, 1.0F);
+ params[0] = FLOAT_TO_INT(b[0]);
+ params[1] = FLOAT_TO_INT(b[1]);
+ params[2] = FLOAT_TO_INT(b[2]);
+ params[3] = FLOAT_TO_INT(b[3]);
+ }
+ break;;
+ case GL_TEXTURE_RESIDENT:
+ {
+ GLboolean resident;
+ if (ctx->Driver.IsTextureResident)
+ resident = ctx->Driver.IsTextureResident(ctx, obj);
+ else
+ resident = GL_TRUE;
+ *params = (GLint) resident;
+ }
+ break;;
+ case GL_TEXTURE_PRIORITY:
+ *params = FLOAT_TO_INT(obj->Priority);
+ break;;
+ case GL_TEXTURE_MIN_LOD:
+ *params = (GLint) obj->Sampler.MinLod;
+ break;;
+ case GL_TEXTURE_MAX_LOD:
+ *params = (GLint) obj->Sampler.MaxLod;
+ break;;
+ case GL_TEXTURE_BASE_LEVEL:
+ *params = obj->BaseLevel;
+ break;;
+ case GL_TEXTURE_MAX_LEVEL:
+ *params = obj->MaxLevel;
+ break;;
+ case GL_TEXTURE_MAX_ANISOTROPY_EXT:
+ if (ctx->Extensions.EXT_texture_filter_anisotropic) {
+ *params = (GLint) obj->Sampler.MaxAnisotropy;
+ }
+ else {
+ error = GL_TRUE;
+ }
+ break;
+ case GL_TEXTURE_COMPARE_FAIL_VALUE_ARB:
+ if (ctx->Extensions.ARB_shadow_ambient) {
+ *params = (GLint) FLOAT_TO_INT(obj->Sampler.CompareFailValue);
+ }
+ else {
+ error = GL_TRUE;
+ }
+ break;
+ case GL_GENERATE_MIPMAP_SGIS:
+ *params = (GLint) obj->GenerateMipmap;
+ break;
+ case GL_TEXTURE_COMPARE_MODE_ARB:
+ if (ctx->Extensions.ARB_shadow) {
+ *params = (GLint) obj->Sampler.CompareMode;
+ }
+ else {
+ error = GL_TRUE;
+ }
+ break;
+ case GL_TEXTURE_COMPARE_FUNC_ARB:
+ if (ctx->Extensions.ARB_shadow) {
+ *params = (GLint) obj->Sampler.CompareFunc;
+ }
+ else {
+ error = GL_TRUE;
+ }
+ break;
+ case GL_DEPTH_TEXTURE_MODE_ARB:
+ if (ctx->Extensions.ARB_depth_texture) {
+ *params = (GLint) obj->Sampler.DepthMode;
+ }
+ else {
+ error = GL_TRUE;
+ }
+ break;
+ case GL_TEXTURE_LOD_BIAS:
+ if (ctx->Extensions.EXT_texture_lod_bias) {
+ *params = (GLint) obj->Sampler.LodBias;
+ }
+ else {
+ error = GL_TRUE;
+ }
+ break;
+#if FEATURE_OES_draw_texture
+ case GL_TEXTURE_CROP_RECT_OES:
+ params[0] = obj->CropRect[0];
+ params[1] = obj->CropRect[1];
+ params[2] = obj->CropRect[2];
+ params[3] = obj->CropRect[3];
+ break;
+#endif
+ case GL_TEXTURE_SWIZZLE_R_EXT:
+ case GL_TEXTURE_SWIZZLE_G_EXT:
+ case GL_TEXTURE_SWIZZLE_B_EXT:
+ case GL_TEXTURE_SWIZZLE_A_EXT:
+ if (ctx->Extensions.EXT_texture_swizzle) {
+ GLuint comp = pname - GL_TEXTURE_SWIZZLE_R_EXT;
+ *params = obj->Swizzle[comp];
+ }
+ else {
+ error = GL_TRUE;
+ }
+ break;
+
+ case GL_TEXTURE_SWIZZLE_RGBA_EXT:
+ if (ctx->Extensions.EXT_texture_swizzle) {
+ COPY_4V(params, obj->Swizzle);
+ }
+ else {
+ error = GL_TRUE;
+ }
+ break;
+
+ case GL_TEXTURE_CUBE_MAP_SEAMLESS:
+ if (ctx->Extensions.AMD_seamless_cubemap_per_texture) {
+ *params = (GLint) obj->Sampler.CubeMapSeamless;
+ }
+ else {
+ error = GL_TRUE;
+ }
+
+ default:
+ ; /* silence warnings */
+ }
+
+ if (error)
+ _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexParameteriv(pname=0x%x)",
+ pname);
+
+ _mesa_unlock_texture(ctx, obj);
+}
+
+
+/** New in GL 3.0 */
+void GLAPIENTRY
+_mesa_GetTexParameterIiv(GLenum target, GLenum pname, GLint *params)
+{
+ struct gl_texture_object *texObj;
+ GET_CURRENT_CONTEXT(ctx);
+ ASSERT_OUTSIDE_BEGIN_END(ctx);
+
+ texObj = get_texobj(ctx, target, GL_TRUE);
+
+ switch (pname) {
+ case GL_TEXTURE_BORDER_COLOR:
+ COPY_4V(params, texObj->Sampler.BorderColor.i);
+ break;
+ default:
+ _mesa_GetTexParameteriv(target, pname, params);
+ }
+}
+
+
+/** New in GL 3.0 */
+void GLAPIENTRY
+_mesa_GetTexParameterIuiv(GLenum target, GLenum pname, GLuint *params)
+{
+ struct gl_texture_object *texObj;
+ GET_CURRENT_CONTEXT(ctx);
+ ASSERT_OUTSIDE_BEGIN_END(ctx);
+
+ texObj = get_texobj(ctx, target, GL_TRUE);
+
+ switch (pname) {
+ case GL_TEXTURE_BORDER_COLOR:
+ COPY_4V(params, texObj->Sampler.BorderColor.i);
+ break;
+ default:
+ {
+ GLint ip[4];
+ _mesa_GetTexParameteriv(target, pname, ip);
+ params[0] = ip[0];
+ if (pname == GL_TEXTURE_SWIZZLE_RGBA_EXT ||
+ pname == GL_TEXTURE_CROP_RECT_OES) {
+ params[1] = ip[1];
+ params[2] = ip[2];
+ params[3] = ip[3];
+ }
+ }
+ }
+}
diff --git a/mesalib/src/mesa/main/texrender.c b/mesalib/src/mesa/main/texrender.c
index a7641a5f9..2766bd6c5 100644
--- a/mesalib/src/mesa/main/texrender.c
+++ b/mesalib/src/mesa/main/texrender.c
@@ -1,654 +1,654 @@
-
-#include "context.h"
-#include "colormac.h"
-#include "fbobject.h"
-#include "macros.h"
-#include "texfetch.h"
-#include "teximage.h"
-#include "texrender.h"
-#include "renderbuffer.h"
-
-
-/*
- * Render-to-texture code for GL_EXT_framebuffer_object
- */
-
-
-/**
- * Derived from gl_renderbuffer class
- */
-struct texture_renderbuffer
-{
- struct gl_renderbuffer Base; /**< Base class object */
- struct gl_texture_image *TexImage;
- StoreTexelFunc Store;
- FetchTexelFuncF Fetchf;
- GLint Yoffset; /**< Layer for 1D array textures. */
- GLint Zoffset; /**< Layer for 2D array textures, or slice
- * for 3D textures
- */
-};
-
-
-/**
- * Get row of values from the renderbuffer that wraps a texture image.
- */
-static void
-texture_get_row(struct gl_context *ctx, struct gl_renderbuffer *rb, GLuint count,
- GLint x, GLint y, void *values)
-{
- const struct texture_renderbuffer *trb
- = (const struct texture_renderbuffer *) rb;
- const GLint z = trb->Zoffset;
- GLuint i;
-
- ASSERT(trb->TexImage->Width == rb->Width);
- ASSERT(trb->TexImage->Height == rb->Height);
-
- y += trb->Yoffset;
-
- if (rb->DataType == CHAN_TYPE) {
- GLchan *rgbaOut = (GLchan *) values;
- for (i = 0; i < count; i++) {
- GLfloat rgba[4];
- trb->Fetchf(trb->TexImage, x + i, y, z, rgba);
- UNCLAMPED_FLOAT_TO_RGBA_CHAN(rgbaOut + 4 * i, rgba);
- }
- }
- else if (rb->DataType == GL_UNSIGNED_SHORT) {
- GLushort *zValues = (GLushort *) values;
- for (i = 0; i < count; i++) {
- GLfloat flt;
- trb->Fetchf(trb->TexImage, x + i, y, z, &flt);
- zValues[i] = (GLushort) (flt * 0xffff);
- }
- }
- else if (rb->DataType == GL_UNSIGNED_INT) {
- GLuint *zValues = (GLuint *) values;
- /*
- const GLdouble scale = (GLdouble) 0xffffffff;
- */
- for (i = 0; i < count; i++) {
- GLfloat flt;
- trb->Fetchf(trb->TexImage, x + i, y, z, &flt);
-#if 0
- /* this should work, but doesn't (overflow due to low precision) */
- zValues[i] = (GLuint) (flt * scale);
-#else
- /* temporary hack */
- zValues[i] = ((GLuint) (flt * 0xffffff)) << 8;
-#endif
- }
- }
- else if (rb->DataType == GL_UNSIGNED_INT_24_8_EXT) {
- GLuint *zValues = (GLuint *) values;
- for (i = 0; i < count; i++) {
- GLfloat flt;
- trb->Fetchf(trb->TexImage, x + i, y, z, &flt);
- zValues[i] = ((GLuint) (flt * 0xffffff)) << 8;
- }
- }
- else if (rb->DataType == GL_UNSIGNED_INT_8_24_REV_MESA) {
- GLuint *zValues = (GLuint *) values;
- for (i = 0; i < count; i++) {
- GLfloat flt;
- trb->Fetchf(trb->TexImage, x + i, y, z, &flt);
- zValues[i] = (GLuint) (flt * 0xffffff);
- }
- }
- else {
- _mesa_problem(ctx, "invalid rb->DataType in texture_get_row");
- }
-}
-
-
-static void
-texture_get_values(struct gl_context *ctx, struct gl_renderbuffer *rb, GLuint count,
- const GLint x[], const GLint y[], void *values)
-{
- const struct texture_renderbuffer *trb
- = (const struct texture_renderbuffer *) rb;
- const GLint z = trb->Zoffset;
- GLuint i;
-
- if (rb->DataType == CHAN_TYPE) {
- GLchan *rgbaOut = (GLchan *) values;
- for (i = 0; i < count; i++) {
- GLfloat rgba[4];
- trb->Fetchf(trb->TexImage, x[i], y[i] + trb->Yoffset,
- z, rgba);
- UNCLAMPED_FLOAT_TO_RGBA_CHAN(rgbaOut + 4 * i, rgba);
- }
- }
- else if (rb->DataType == GL_UNSIGNED_SHORT) {
- GLushort *zValues = (GLushort *) values;
- for (i = 0; i < count; i++) {
- GLfloat flt;
- trb->Fetchf(trb->TexImage, x[i], y[i] + trb->Yoffset,
- z, &flt);
- zValues[i] = (GLushort) (flt * 0xffff);
- }
- }
- else if (rb->DataType == GL_UNSIGNED_INT) {
- GLuint *zValues = (GLuint *) values;
- for (i = 0; i < count; i++) {
- GLfloat flt;
- trb->Fetchf(trb->TexImage, x[i], y[i] + trb->Yoffset,
- z, &flt);
-#if 0
- zValues[i] = (GLuint) (flt * 0xffffffff);
-#else
- zValues[i] = ((GLuint) (flt * 0xffffff)) << 8;
-#endif
- }
- }
- else if (rb->DataType == GL_UNSIGNED_INT_24_8_EXT) {
- GLuint *zValues = (GLuint *) values;
- for (i = 0; i < count; i++) {
- GLfloat flt;
- trb->Fetchf(trb->TexImage, x[i], y[i] + trb->Yoffset,
- z, &flt);
- zValues[i] = ((GLuint) (flt * 0xffffff)) << 8;
- }
- }
- else if (rb->DataType == GL_UNSIGNED_INT_8_24_REV_MESA) {
- GLuint *zValues = (GLuint *) values;
- for (i = 0; i < count; i++) {
- GLfloat flt;
- trb->Fetchf(trb->TexImage, x[i], y[i] + trb->Yoffset,
- z, &flt);
- zValues[i] = (GLuint) (flt * 0xffffff);
- }
- }
- else {
- _mesa_problem(ctx, "invalid rb->DataType in texture_get_values");
- }
-}
-
-
-/**
- * Put row of values into a renderbuffer that wraps a texture image.
- */
-static void
-texture_put_row(struct gl_context *ctx, struct gl_renderbuffer *rb, GLuint count,
- GLint x, GLint y, const void *values, const GLubyte *mask)
-{
- const struct texture_renderbuffer *trb
- = (const struct texture_renderbuffer *) rb;
- const GLint z = trb->Zoffset;
- GLuint i;
-
- y += trb->Yoffset;
-
- if (rb->DataType == CHAN_TYPE) {
- const GLchan *rgba = (const GLchan *) values;
- for (i = 0; i < count; i++) {
- if (!mask || mask[i]) {
- trb->Store(trb->TexImage, x + i, y, z, rgba);
- }
- rgba += 4;
- }
- }
- else if (rb->DataType == GL_UNSIGNED_SHORT) {
- const GLushort *zValues = (const GLushort *) values;
- for (i = 0; i < count; i++) {
- if (!mask || mask[i]) {
- trb->Store(trb->TexImage, x + i, y, z, zValues + i);
- }
- }
- }
- else if (rb->DataType == GL_UNSIGNED_INT) {
- const GLuint *zValues = (const GLuint *) values;
- for (i = 0; i < count; i++) {
- if (!mask || mask[i]) {
- trb->Store(trb->TexImage, x + i, y, z, zValues + i);
- }
- }
- }
- else if (rb->DataType == GL_UNSIGNED_INT_24_8_EXT) {
- const GLuint *zValues = (const GLuint *) values;
- for (i = 0; i < count; i++) {
- if (!mask || mask[i]) {
- GLfloat flt = (GLfloat) ((zValues[i] >> 8) * (1.0 / 0xffffff));
- trb->Store(trb->TexImage, x + i, y, z, &flt);
- }
- }
- }
- else if (rb->DataType == GL_UNSIGNED_INT_8_24_REV_MESA) {
- const GLuint *zValues = (const GLuint *) values;
- for (i = 0; i < count; i++) {
- if (!mask || mask[i]) {
- GLfloat flt = (GLfloat) ((zValues[i] & 0xffffff) * (1.0 / 0xffffff));
- trb->Store(trb->TexImage, x + i, y, z, &flt);
- }
- }
- }
- else {
- _mesa_problem(ctx, "invalid rb->DataType in texture_put_row");
- }
-}
-
-/**
- * Put row of RGB values into a renderbuffer that wraps a texture image.
- */
-static void
-texture_put_row_rgb(struct gl_context *ctx, struct gl_renderbuffer *rb, GLuint count,
- GLint x, GLint y, const void *values, const GLubyte *mask)
-{
- const struct texture_renderbuffer *trb
- = (const struct texture_renderbuffer *) rb;
- const GLint z = trb->Zoffset;
- GLuint i;
-
- y += trb->Yoffset;
-
- if (rb->DataType == CHAN_TYPE) {
- const GLchan *rgb = (const GLchan *) values;
- for (i = 0; i < count; i++) {
- if (!mask || mask[i]) {
- trb->Store(trb->TexImage, x + i, y, z, rgb);
- }
- rgb += 3;
- }
- }
- else if (rb->DataType == GL_UNSIGNED_SHORT) {
- const GLushort *zValues = (const GLushort *) values;
- for (i = 0; i < count; i++) {
- if (!mask || mask[i]) {
- trb->Store(trb->TexImage, x + i, y, z, zValues + i);
- }
- }
- }
- else if (rb->DataType == GL_UNSIGNED_INT) {
- const GLuint *zValues = (const GLuint *) values;
- for (i = 0; i < count; i++) {
- if (!mask || mask[i]) {
- trb->Store(trb->TexImage, x + i, y, z, zValues + i);
- }
- }
- }
- else if (rb->DataType == GL_UNSIGNED_INT_24_8_EXT) {
- const GLuint *zValues = (const GLuint *) values;
- for (i = 0; i < count; i++) {
- if (!mask || mask[i]) {
- GLfloat flt = (GLfloat) ((zValues[i] >> 8) * (1.0 / 0xffffff));
- trb->Store(trb->TexImage, x + i, y, z, &flt);
- }
- }
- }
- else if (rb->DataType == GL_UNSIGNED_INT_8_24_REV_MESA) {
- const GLuint *zValues = (const GLuint *) values;
- for (i = 0; i < count; i++) {
- if (!mask || mask[i]) {
- GLfloat flt = (GLfloat) ((zValues[i] & 0xffffff) * (1.0 / 0xffffff));
- trb->Store(trb->TexImage, x + i, y, z, &flt);
- }
- }
- }
- else {
- _mesa_problem(ctx, "invalid rb->DataType in texture_put_row");
- }
-}
-
-
-static void
-texture_put_mono_row(struct gl_context *ctx, struct gl_renderbuffer *rb, GLuint count,
- GLint x, GLint y, const void *value, const GLubyte *mask)
-{
- const struct texture_renderbuffer *trb
- = (const struct texture_renderbuffer *) rb;
- const GLint z = trb->Zoffset;
- GLuint i;
-
- y += trb->Yoffset;
-
- if (rb->DataType == CHAN_TYPE) {
- const GLchan *rgba = (const GLchan *) value;
- for (i = 0; i < count; i++) {
- if (!mask || mask[i]) {
- trb->Store(trb->TexImage, x + i, y, z, rgba);
- }
- }
- }
- else if (rb->DataType == GL_UNSIGNED_SHORT) {
- const GLushort zValue = *((const GLushort *) value);
- for (i = 0; i < count; i++) {
- if (!mask || mask[i]) {
- trb->Store(trb->TexImage, x + i, y, z, &zValue);
- }
- }
- }
- else if (rb->DataType == GL_UNSIGNED_INT) {
- const GLuint zValue = *((const GLuint *) value);
- for (i = 0; i < count; i++) {
- if (!mask || mask[i]) {
- trb->Store(trb->TexImage, x + i, y, z, &zValue);
- }
- }
- }
- else if (rb->DataType == GL_UNSIGNED_INT_24_8_EXT) {
- const GLuint zValue = *((const GLuint *) value);
- const GLfloat flt = (GLfloat) ((zValue >> 8) * (1.0 / 0xffffff));
- for (i = 0; i < count; i++) {
- if (!mask || mask[i]) {
- trb->Store(trb->TexImage, x + i, y, z, &flt);
- }
- }
- }
- else if (rb->DataType == GL_UNSIGNED_INT_8_24_REV_MESA) {
- const GLuint zValue = *((const GLuint *) value);
- const GLfloat flt = (GLfloat) ((zValue & 0xffffff) * (1.0 / 0xffffff));
- for (i = 0; i < count; i++) {
- if (!mask || mask[i]) {
- trb->Store(trb->TexImage, x + i, y, z, &flt);
- }
- }
- }
- else {
- _mesa_problem(ctx, "invalid rb->DataType in texture_put_mono_row");
- }
-}
-
-
-static void
-texture_put_values(struct gl_context *ctx, struct gl_renderbuffer *rb, GLuint count,
- const GLint x[], const GLint y[], const void *values,
- const GLubyte *mask)
-{
- const struct texture_renderbuffer *trb
- = (const struct texture_renderbuffer *) rb;
- const GLint z = trb->Zoffset;
- GLuint i;
-
- if (rb->DataType == CHAN_TYPE) {
- const GLchan *rgba = (const GLchan *) values;
- for (i = 0; i < count; i++) {
- if (!mask || mask[i]) {
- trb->Store(trb->TexImage, x[i], y[i] + trb->Yoffset, z, rgba);
- }
- rgba += 4;
- }
- }
- else if (rb->DataType == GL_UNSIGNED_SHORT) {
- const GLushort *zValues = (const GLushort *) values;
- for (i = 0; i < count; i++) {
- if (!mask || mask[i]) {
- trb->Store(trb->TexImage, x[i], y[i] + trb->Yoffset, z, zValues + i);
- }
- }
- }
- else if (rb->DataType == GL_UNSIGNED_INT) {
- const GLuint *zValues = (const GLuint *) values;
- for (i = 0; i < count; i++) {
- if (!mask || mask[i]) {
- trb->Store(trb->TexImage, x[i], y[i] + trb->Yoffset, z, zValues + i);
- }
- }
- }
- else if (rb->DataType == GL_UNSIGNED_INT_24_8_EXT) {
- const GLuint *zValues = (const GLuint *) values;
- for (i = 0; i < count; i++) {
- if (!mask || mask[i]) {
- GLfloat flt = (GLfloat) ((zValues[i] >> 8) * (1.0 / 0xffffff));
- trb->Store(trb->TexImage, x[i], y[i] + trb->Yoffset, z, &flt);
- }
- }
- }
- else if (rb->DataType == GL_UNSIGNED_INT_8_24_REV_MESA) {
- const GLuint *zValues = (const GLuint *) values;
- for (i = 0; i < count; i++) {
- if (!mask || mask[i]) {
- GLfloat flt = (GLfloat) ((zValues[i] & 0xffffff) * (1.0 / 0xffffff));
- trb->Store(trb->TexImage, x[i], y[i] + trb->Yoffset, z, &flt);
- }
- }
- }
- else {
- _mesa_problem(ctx, "invalid rb->DataType in texture_put_values");
- }
-}
-
-
-static void
-texture_put_mono_values(struct gl_context *ctx, struct gl_renderbuffer *rb,
- GLuint count, const GLint x[], const GLint y[],
- const void *value, const GLubyte *mask)
-{
- const struct texture_renderbuffer *trb
- = (const struct texture_renderbuffer *) rb;
- const GLint z = trb->Zoffset;
- GLuint i;
-
- if (rb->DataType == CHAN_TYPE) {
- const GLchan *rgba = (const GLchan *) value;
- for (i = 0; i < count; i++) {
- if (!mask || mask[i]) {
- trb->Store(trb->TexImage, x[i], y[i] + trb->Yoffset, z, rgba);
- }
- }
- }
- else if (rb->DataType == GL_UNSIGNED_INT) {
- const GLuint zValue = *((const GLuint *) value);
- for (i = 0; i < count; i++) {
- if (!mask || mask[i]) {
- trb->Store(trb->TexImage, x[i], y[i] + trb->Yoffset, z, &zValue);
- }
- }
- }
- else if (rb->DataType == GL_UNSIGNED_SHORT) {
- const GLushort zValue = *((const GLushort *) value);
- for (i = 0; i < count; i++) {
- if (!mask || mask[i]) {
- trb->Store(trb->TexImage, x[i], y[i] + trb->Yoffset, z, &zValue);
- }
- }
- }
- else if (rb->DataType == GL_UNSIGNED_INT_24_8_EXT) {
- const GLuint zValue = *((const GLuint *) value);
- const GLfloat flt = (GLfloat) ((zValue >> 8) * (1.0 / 0xffffff));
- for (i = 0; i < count; i++) {
- if (!mask || mask[i]) {
- trb->Store(trb->TexImage, x[i], y[i] + trb->Yoffset, z, &flt);
- }
- }
- }
- else if (rb->DataType == GL_UNSIGNED_INT_8_24_REV_MESA) {
- const GLuint zValue = *((const GLuint *) value);
- const GLfloat flt = (GLfloat) ((zValue & 0xffffff) * (1.0 / 0xffffff));
- for (i = 0; i < count; i++) {
- if (!mask || mask[i]) {
- trb->Store(trb->TexImage, x[i], y[i] + trb->Yoffset, z, &flt);
- }
- }
- }
- else {
- _mesa_problem(ctx, "invalid rb->DataType in texture_put_mono_values");
- }
-}
-
-
-static void
-store_nop(struct gl_texture_image *texImage,
- GLint col, GLint row, GLint img,
- const void *texel)
-{
-}
-
-
-static void
-delete_texture_wrapper(struct gl_renderbuffer *rb)
-{
- ASSERT(rb->RefCount == 0);
- free(rb);
-}
-
-
-/**
- * This function creates a renderbuffer object which wraps a texture image.
- * The new renderbuffer is plugged into the given attachment point.
- * This allows rendering into the texture as if it were a renderbuffer.
- */
-static void
-wrap_texture(struct gl_context *ctx, struct gl_renderbuffer_attachment *att)
-{
- struct texture_renderbuffer *trb;
- const GLuint name = 0;
-
- ASSERT(att->Type == GL_TEXTURE);
- ASSERT(att->Renderbuffer == NULL);
-
- trb = CALLOC_STRUCT(texture_renderbuffer);
- if (!trb) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "wrap_texture");
- return;
- }
-
- /* init base gl_renderbuffer fields */
- _mesa_init_renderbuffer(&trb->Base, name);
- /* plug in our texture_renderbuffer-specific functions */
- trb->Base.Delete = delete_texture_wrapper;
- trb->Base.AllocStorage = NULL; /* illegal! */
- trb->Base.GetRow = texture_get_row;
- trb->Base.GetValues = texture_get_values;
- trb->Base.PutRow = texture_put_row;
- trb->Base.PutRowRGB = texture_put_row_rgb;
- trb->Base.PutMonoRow = texture_put_mono_row;
- trb->Base.PutValues = texture_put_values;
- trb->Base.PutMonoValues = texture_put_mono_values;
-
- /* update attachment point */
- _mesa_reference_renderbuffer(&att->Renderbuffer, &(trb->Base));
-}
-
-/**
- * Update the renderbuffer wrapper for rendering to a texture.
- * For example, update the width, height of the RB based on the texture size,
- * update the internal format info, etc.
- */
-static void
-update_wrapper(struct gl_context *ctx, struct gl_renderbuffer_attachment *att)
-{
- struct texture_renderbuffer *trb
- = (struct texture_renderbuffer *) att->Renderbuffer;
-
- (void) ctx;
- ASSERT(trb);
-
- trb->TexImage = _mesa_get_attachment_teximage(att);
- ASSERT(trb->TexImage);
-
- trb->Store = _mesa_get_texel_store_func(trb->TexImage->TexFormat);
- if (!trb->Store) {
- /* we'll never draw into some textures (compressed formats) */
- trb->Store = store_nop;
- }
-
- trb->Fetchf = trb->TexImage->FetchTexelf;
-
- if (att->Texture->Target == GL_TEXTURE_1D_ARRAY_EXT) {
- trb->Yoffset = att->Zoffset;
- trb->Zoffset = 0;
- }
- else {
- trb->Yoffset = 0;
- trb->Zoffset = att->Zoffset;
- }
-
- trb->Base.Width = trb->TexImage->Width;
- trb->Base.Height = trb->TexImage->Height;
- trb->Base.InternalFormat = trb->TexImage->InternalFormat;
- trb->Base.Format = trb->TexImage->TexFormat;
-
- /* XXX may need more special cases here */
- switch (trb->TexImage->TexFormat) {
- case MESA_FORMAT_Z24_S8:
- trb->Base.DataType = GL_UNSIGNED_INT_24_8_EXT;
- trb->Base._BaseFormat = GL_DEPTH_STENCIL;
- break;
- case MESA_FORMAT_S8_Z24:
- trb->Base.DataType = GL_UNSIGNED_INT_8_24_REV_MESA;
- trb->Base._BaseFormat = GL_DEPTH_STENCIL;
- break;
- case MESA_FORMAT_Z24_X8:
- trb->Base.DataType = GL_UNSIGNED_INT_24_8_EXT;
- trb->Base._BaseFormat = GL_DEPTH_COMPONENT;
- break;
- case MESA_FORMAT_X8_Z24:
- trb->Base.DataType = GL_UNSIGNED_INT_8_24_REV_MESA;
- trb->Base._BaseFormat = GL_DEPTH_COMPONENT;
- break;
- case MESA_FORMAT_Z16:
- trb->Base.DataType = GL_UNSIGNED_SHORT;
- trb->Base._BaseFormat = GL_DEPTH_COMPONENT;
- break;
- case MESA_FORMAT_Z32:
- trb->Base.DataType = GL_UNSIGNED_INT;
- trb->Base._BaseFormat = GL_DEPTH_COMPONENT;
- break;
- /* SRGB formats pre EXT_framebuffer_sRGB don't do sRGB translations on FBO readback */
- case MESA_FORMAT_SRGB8:
- trb->Fetchf = _mesa_get_texel_fetch_func(MESA_FORMAT_RGB888, _mesa_get_texture_dimensions(att->Texture->Target));
- trb->Base.DataType = CHAN_TYPE;
- trb->Base._BaseFormat = GL_RGBA;
- break;
- case MESA_FORMAT_SRGBA8:
- trb->Fetchf = _mesa_get_texel_fetch_func(MESA_FORMAT_RGBA8888, _mesa_get_texture_dimensions(att->Texture->Target));
- trb->Base.DataType = CHAN_TYPE;
- trb->Base._BaseFormat = GL_RGBA;
- break;
- case MESA_FORMAT_SARGB8:
- trb->Fetchf = _mesa_get_texel_fetch_func(MESA_FORMAT_ARGB8888, _mesa_get_texture_dimensions(att->Texture->Target));
- trb->Base.DataType = CHAN_TYPE;
- trb->Base._BaseFormat = GL_RGBA;
- break;
- default:
- trb->Base.DataType = CHAN_TYPE;
- trb->Base._BaseFormat = GL_RGBA;
- }
- trb->Base.Data = trb->TexImage->Data;
-}
-
-
-
-/**
- * Called when rendering to a texture image begins, or when changing
- * the dest mipmap level, cube face, etc.
- * This is a fallback routine for software render-to-texture.
- *
- * Called via the glRenderbufferTexture1D/2D/3D() functions
- * and elsewhere (such as glTexImage2D).
- *
- * The image we're rendering into is
- * att->Texture->Image[att->CubeMapFace][att->TextureLevel];
- * It'll never be NULL.
- *
- * \param fb the framebuffer object the texture is being bound to
- * \param att the fb attachment point of the texture
- *
- * \sa _mesa_framebuffer_renderbuffer
- */
-void
-_mesa_render_texture(struct gl_context *ctx,
- struct gl_framebuffer *fb,
- struct gl_renderbuffer_attachment *att)
-{
- (void) fb;
-
- if (!att->Renderbuffer) {
- wrap_texture(ctx, att);
- }
- update_wrapper(ctx, att);
-}
-
-
-void
-_mesa_finish_render_texture(struct gl_context *ctx,
- struct gl_renderbuffer_attachment *att)
-{
- /* do nothing */
- /* The renderbuffer texture wrapper will get deleted by the
- * normal mechanism for deleting renderbuffers.
- */
- (void) ctx;
- (void) att;
-}
+
+#include "context.h"
+#include "colormac.h"
+#include "fbobject.h"
+#include "macros.h"
+#include "texfetch.h"
+#include "teximage.h"
+#include "texrender.h"
+#include "renderbuffer.h"
+
+
+/*
+ * Render-to-texture code for GL_EXT_framebuffer_object
+ */
+
+
+/**
+ * Derived from gl_renderbuffer class
+ */
+struct texture_renderbuffer
+{
+ struct gl_renderbuffer Base; /**< Base class object */
+ struct gl_texture_image *TexImage;
+ StoreTexelFunc Store;
+ FetchTexelFuncF Fetchf;
+ GLint Yoffset; /**< Layer for 1D array textures. */
+ GLint Zoffset; /**< Layer for 2D array textures, or slice
+ * for 3D textures
+ */
+};
+
+
+/**
+ * Get row of values from the renderbuffer that wraps a texture image.
+ */
+static void
+texture_get_row(struct gl_context *ctx, struct gl_renderbuffer *rb, GLuint count,
+ GLint x, GLint y, void *values)
+{
+ const struct texture_renderbuffer *trb
+ = (const struct texture_renderbuffer *) rb;
+ const GLint z = trb->Zoffset;
+ GLuint i;
+
+ ASSERT(trb->TexImage->Width == rb->Width);
+ ASSERT(trb->TexImage->Height == rb->Height);
+
+ y += trb->Yoffset;
+
+ if (rb->DataType == CHAN_TYPE) {
+ GLchan *rgbaOut = (GLchan *) values;
+ for (i = 0; i < count; i++) {
+ GLfloat rgba[4];
+ trb->Fetchf(trb->TexImage, x + i, y, z, rgba);
+ UNCLAMPED_FLOAT_TO_RGBA_CHAN(rgbaOut + 4 * i, rgba);
+ }
+ }
+ else if (rb->DataType == GL_UNSIGNED_SHORT) {
+ GLushort *zValues = (GLushort *) values;
+ for (i = 0; i < count; i++) {
+ GLfloat flt;
+ trb->Fetchf(trb->TexImage, x + i, y, z, &flt);
+ zValues[i] = (GLushort) (flt * 0xffff);
+ }
+ }
+ else if (rb->DataType == GL_UNSIGNED_INT) {
+ GLuint *zValues = (GLuint *) values;
+ /*
+ const GLdouble scale = (GLdouble) 0xffffffff;
+ */
+ for (i = 0; i < count; i++) {
+ GLfloat flt;
+ trb->Fetchf(trb->TexImage, x + i, y, z, &flt);
+#if 0
+ /* this should work, but doesn't (overflow due to low precision) */
+ zValues[i] = (GLuint) (flt * scale);
+#else
+ /* temporary hack */
+ zValues[i] = ((GLuint) (flt * 0xffffff)) << 8;
+#endif
+ }
+ }
+ else if (rb->DataType == GL_UNSIGNED_INT_24_8_EXT) {
+ GLuint *zValues = (GLuint *) values;
+ for (i = 0; i < count; i++) {
+ GLfloat flt;
+ trb->Fetchf(trb->TexImage, x + i, y, z, &flt);
+ zValues[i] = ((GLuint) (flt * 0xffffff)) << 8;
+ }
+ }
+ else if (rb->DataType == GL_UNSIGNED_INT_8_24_REV_MESA) {
+ GLuint *zValues = (GLuint *) values;
+ for (i = 0; i < count; i++) {
+ GLfloat flt;
+ trb->Fetchf(trb->TexImage, x + i, y, z, &flt);
+ zValues[i] = (GLuint) (flt * 0xffffff);
+ }
+ }
+ else {
+ _mesa_problem(ctx, "invalid rb->DataType in texture_get_row");
+ }
+}
+
+
+static void
+texture_get_values(struct gl_context *ctx, struct gl_renderbuffer *rb, GLuint count,
+ const GLint x[], const GLint y[], void *values)
+{
+ const struct texture_renderbuffer *trb
+ = (const struct texture_renderbuffer *) rb;
+ const GLint z = trb->Zoffset;
+ GLuint i;
+
+ if (rb->DataType == CHAN_TYPE) {
+ GLchan *rgbaOut = (GLchan *) values;
+ for (i = 0; i < count; i++) {
+ GLfloat rgba[4];
+ trb->Fetchf(trb->TexImage, x[i], y[i] + trb->Yoffset,
+ z, rgba);
+ UNCLAMPED_FLOAT_TO_RGBA_CHAN(rgbaOut + 4 * i, rgba);
+ }
+ }
+ else if (rb->DataType == GL_UNSIGNED_SHORT) {
+ GLushort *zValues = (GLushort *) values;
+ for (i = 0; i < count; i++) {
+ GLfloat flt;
+ trb->Fetchf(trb->TexImage, x[i], y[i] + trb->Yoffset,
+ z, &flt);
+ zValues[i] = (GLushort) (flt * 0xffff);
+ }
+ }
+ else if (rb->DataType == GL_UNSIGNED_INT) {
+ GLuint *zValues = (GLuint *) values;
+ for (i = 0; i < count; i++) {
+ GLfloat flt;
+ trb->Fetchf(trb->TexImage, x[i], y[i] + trb->Yoffset,
+ z, &flt);
+#if 0
+ zValues[i] = (GLuint) (flt * 0xffffffff);
+#else
+ zValues[i] = ((GLuint) (flt * 0xffffff)) << 8;
+#endif
+ }
+ }
+ else if (rb->DataType == GL_UNSIGNED_INT_24_8_EXT) {
+ GLuint *zValues = (GLuint *) values;
+ for (i = 0; i < count; i++) {
+ GLfloat flt;
+ trb->Fetchf(trb->TexImage, x[i], y[i] + trb->Yoffset,
+ z, &flt);
+ zValues[i] = ((GLuint) (flt * 0xffffff)) << 8;
+ }
+ }
+ else if (rb->DataType == GL_UNSIGNED_INT_8_24_REV_MESA) {
+ GLuint *zValues = (GLuint *) values;
+ for (i = 0; i < count; i++) {
+ GLfloat flt;
+ trb->Fetchf(trb->TexImage, x[i], y[i] + trb->Yoffset,
+ z, &flt);
+ zValues[i] = (GLuint) (flt * 0xffffff);
+ }
+ }
+ else {
+ _mesa_problem(ctx, "invalid rb->DataType in texture_get_values");
+ }
+}
+
+
+/**
+ * Put row of values into a renderbuffer that wraps a texture image.
+ */
+static void
+texture_put_row(struct gl_context *ctx, struct gl_renderbuffer *rb, GLuint count,
+ GLint x, GLint y, const void *values, const GLubyte *mask)
+{
+ const struct texture_renderbuffer *trb
+ = (const struct texture_renderbuffer *) rb;
+ const GLint z = trb->Zoffset;
+ GLuint i;
+
+ y += trb->Yoffset;
+
+ if (rb->DataType == CHAN_TYPE) {
+ const GLchan *rgba = (const GLchan *) values;
+ for (i = 0; i < count; i++) {
+ if (!mask || mask[i]) {
+ trb->Store(trb->TexImage, x + i, y, z, rgba);
+ }
+ rgba += 4;
+ }
+ }
+ else if (rb->DataType == GL_UNSIGNED_SHORT) {
+ const GLushort *zValues = (const GLushort *) values;
+ for (i = 0; i < count; i++) {
+ if (!mask || mask[i]) {
+ trb->Store(trb->TexImage, x + i, y, z, zValues + i);
+ }
+ }
+ }
+ else if (rb->DataType == GL_UNSIGNED_INT) {
+ const GLuint *zValues = (const GLuint *) values;
+ for (i = 0; i < count; i++) {
+ if (!mask || mask[i]) {
+ trb->Store(trb->TexImage, x + i, y, z, zValues + i);
+ }
+ }
+ }
+ else if (rb->DataType == GL_UNSIGNED_INT_24_8_EXT) {
+ const GLuint *zValues = (const GLuint *) values;
+ for (i = 0; i < count; i++) {
+ if (!mask || mask[i]) {
+ GLfloat flt = (GLfloat) ((zValues[i] >> 8) * (1.0 / 0xffffff));
+ trb->Store(trb->TexImage, x + i, y, z, &flt);
+ }
+ }
+ }
+ else if (rb->DataType == GL_UNSIGNED_INT_8_24_REV_MESA) {
+ const GLuint *zValues = (const GLuint *) values;
+ for (i = 0; i < count; i++) {
+ if (!mask || mask[i]) {
+ GLfloat flt = (GLfloat) ((zValues[i] & 0xffffff) * (1.0 / 0xffffff));
+ trb->Store(trb->TexImage, x + i, y, z, &flt);
+ }
+ }
+ }
+ else {
+ _mesa_problem(ctx, "invalid rb->DataType in texture_put_row");
+ }
+}
+
+/**
+ * Put row of RGB values into a renderbuffer that wraps a texture image.
+ */
+static void
+texture_put_row_rgb(struct gl_context *ctx, struct gl_renderbuffer *rb, GLuint count,
+ GLint x, GLint y, const void *values, const GLubyte *mask)
+{
+ const struct texture_renderbuffer *trb
+ = (const struct texture_renderbuffer *) rb;
+ const GLint z = trb->Zoffset;
+ GLuint i;
+
+ y += trb->Yoffset;
+
+ if (rb->DataType == CHAN_TYPE) {
+ const GLchan *rgb = (const GLchan *) values;
+ for (i = 0; i < count; i++) {
+ if (!mask || mask[i]) {
+ trb->Store(trb->TexImage, x + i, y, z, rgb);
+ }
+ rgb += 3;
+ }
+ }
+ else if (rb->DataType == GL_UNSIGNED_SHORT) {
+ const GLushort *zValues = (const GLushort *) values;
+ for (i = 0; i < count; i++) {
+ if (!mask || mask[i]) {
+ trb->Store(trb->TexImage, x + i, y, z, zValues + i);
+ }
+ }
+ }
+ else if (rb->DataType == GL_UNSIGNED_INT) {
+ const GLuint *zValues = (const GLuint *) values;
+ for (i = 0; i < count; i++) {
+ if (!mask || mask[i]) {
+ trb->Store(trb->TexImage, x + i, y, z, zValues + i);
+ }
+ }
+ }
+ else if (rb->DataType == GL_UNSIGNED_INT_24_8_EXT) {
+ const GLuint *zValues = (const GLuint *) values;
+ for (i = 0; i < count; i++) {
+ if (!mask || mask[i]) {
+ GLfloat flt = (GLfloat) ((zValues[i] >> 8) * (1.0 / 0xffffff));
+ trb->Store(trb->TexImage, x + i, y, z, &flt);
+ }
+ }
+ }
+ else if (rb->DataType == GL_UNSIGNED_INT_8_24_REV_MESA) {
+ const GLuint *zValues = (const GLuint *) values;
+ for (i = 0; i < count; i++) {
+ if (!mask || mask[i]) {
+ GLfloat flt = (GLfloat) ((zValues[i] & 0xffffff) * (1.0 / 0xffffff));
+ trb->Store(trb->TexImage, x + i, y, z, &flt);
+ }
+ }
+ }
+ else {
+ _mesa_problem(ctx, "invalid rb->DataType in texture_put_row");
+ }
+}
+
+
+static void
+texture_put_mono_row(struct gl_context *ctx, struct gl_renderbuffer *rb, GLuint count,
+ GLint x, GLint y, const void *value, const GLubyte *mask)
+{
+ const struct texture_renderbuffer *trb
+ = (const struct texture_renderbuffer *) rb;
+ const GLint z = trb->Zoffset;
+ GLuint i;
+
+ y += trb->Yoffset;
+
+ if (rb->DataType == CHAN_TYPE) {
+ const GLchan *rgba = (const GLchan *) value;
+ for (i = 0; i < count; i++) {
+ if (!mask || mask[i]) {
+ trb->Store(trb->TexImage, x + i, y, z, rgba);
+ }
+ }
+ }
+ else if (rb->DataType == GL_UNSIGNED_SHORT) {
+ const GLushort zValue = *((const GLushort *) value);
+ for (i = 0; i < count; i++) {
+ if (!mask || mask[i]) {
+ trb->Store(trb->TexImage, x + i, y, z, &zValue);
+ }
+ }
+ }
+ else if (rb->DataType == GL_UNSIGNED_INT) {
+ const GLuint zValue = *((const GLuint *) value);
+ for (i = 0; i < count; i++) {
+ if (!mask || mask[i]) {
+ trb->Store(trb->TexImage, x + i, y, z, &zValue);
+ }
+ }
+ }
+ else if (rb->DataType == GL_UNSIGNED_INT_24_8_EXT) {
+ const GLuint zValue = *((const GLuint *) value);
+ const GLfloat flt = (GLfloat) ((zValue >> 8) * (1.0 / 0xffffff));
+ for (i = 0; i < count; i++) {
+ if (!mask || mask[i]) {
+ trb->Store(trb->TexImage, x + i, y, z, &flt);
+ }
+ }
+ }
+ else if (rb->DataType == GL_UNSIGNED_INT_8_24_REV_MESA) {
+ const GLuint zValue = *((const GLuint *) value);
+ const GLfloat flt = (GLfloat) ((zValue & 0xffffff) * (1.0 / 0xffffff));
+ for (i = 0; i < count; i++) {
+ if (!mask || mask[i]) {
+ trb->Store(trb->TexImage, x + i, y, z, &flt);
+ }
+ }
+ }
+ else {
+ _mesa_problem(ctx, "invalid rb->DataType in texture_put_mono_row");
+ }
+}
+
+
+static void
+texture_put_values(struct gl_context *ctx, struct gl_renderbuffer *rb, GLuint count,
+ const GLint x[], const GLint y[], const void *values,
+ const GLubyte *mask)
+{
+ const struct texture_renderbuffer *trb
+ = (const struct texture_renderbuffer *) rb;
+ const GLint z = trb->Zoffset;
+ GLuint i;
+
+ if (rb->DataType == CHAN_TYPE) {
+ const GLchan *rgba = (const GLchan *) values;
+ for (i = 0; i < count; i++) {
+ if (!mask || mask[i]) {
+ trb->Store(trb->TexImage, x[i], y[i] + trb->Yoffset, z, rgba);
+ }
+ rgba += 4;
+ }
+ }
+ else if (rb->DataType == GL_UNSIGNED_SHORT) {
+ const GLushort *zValues = (const GLushort *) values;
+ for (i = 0; i < count; i++) {
+ if (!mask || mask[i]) {
+ trb->Store(trb->TexImage, x[i], y[i] + trb->Yoffset, z, zValues + i);
+ }
+ }
+ }
+ else if (rb->DataType == GL_UNSIGNED_INT) {
+ const GLuint *zValues = (const GLuint *) values;
+ for (i = 0; i < count; i++) {
+ if (!mask || mask[i]) {
+ trb->Store(trb->TexImage, x[i], y[i] + trb->Yoffset, z, zValues + i);
+ }
+ }
+ }
+ else if (rb->DataType == GL_UNSIGNED_INT_24_8_EXT) {
+ const GLuint *zValues = (const GLuint *) values;
+ for (i = 0; i < count; i++) {
+ if (!mask || mask[i]) {
+ GLfloat flt = (GLfloat) ((zValues[i] >> 8) * (1.0 / 0xffffff));
+ trb->Store(trb->TexImage, x[i], y[i] + trb->Yoffset, z, &flt);
+ }
+ }
+ }
+ else if (rb->DataType == GL_UNSIGNED_INT_8_24_REV_MESA) {
+ const GLuint *zValues = (const GLuint *) values;
+ for (i = 0; i < count; i++) {
+ if (!mask || mask[i]) {
+ GLfloat flt = (GLfloat) ((zValues[i] & 0xffffff) * (1.0 / 0xffffff));
+ trb->Store(trb->TexImage, x[i], y[i] + trb->Yoffset, z, &flt);
+ }
+ }
+ }
+ else {
+ _mesa_problem(ctx, "invalid rb->DataType in texture_put_values");
+ }
+}
+
+
+static void
+texture_put_mono_values(struct gl_context *ctx, struct gl_renderbuffer *rb,
+ GLuint count, const GLint x[], const GLint y[],
+ const void *value, const GLubyte *mask)
+{
+ const struct texture_renderbuffer *trb
+ = (const struct texture_renderbuffer *) rb;
+ const GLint z = trb->Zoffset;
+ GLuint i;
+
+ if (rb->DataType == CHAN_TYPE) {
+ const GLchan *rgba = (const GLchan *) value;
+ for (i = 0; i < count; i++) {
+ if (!mask || mask[i]) {
+ trb->Store(trb->TexImage, x[i], y[i] + trb->Yoffset, z, rgba);
+ }
+ }
+ }
+ else if (rb->DataType == GL_UNSIGNED_INT) {
+ const GLuint zValue = *((const GLuint *) value);
+ for (i = 0; i < count; i++) {
+ if (!mask || mask[i]) {
+ trb->Store(trb->TexImage, x[i], y[i] + trb->Yoffset, z, &zValue);
+ }
+ }
+ }
+ else if (rb->DataType == GL_UNSIGNED_SHORT) {
+ const GLushort zValue = *((const GLushort *) value);
+ for (i = 0; i < count; i++) {
+ if (!mask || mask[i]) {
+ trb->Store(trb->TexImage, x[i], y[i] + trb->Yoffset, z, &zValue);
+ }
+ }
+ }
+ else if (rb->DataType == GL_UNSIGNED_INT_24_8_EXT) {
+ const GLuint zValue = *((const GLuint *) value);
+ const GLfloat flt = (GLfloat) ((zValue >> 8) * (1.0 / 0xffffff));
+ for (i = 0; i < count; i++) {
+ if (!mask || mask[i]) {
+ trb->Store(trb->TexImage, x[i], y[i] + trb->Yoffset, z, &flt);
+ }
+ }
+ }
+ else if (rb->DataType == GL_UNSIGNED_INT_8_24_REV_MESA) {
+ const GLuint zValue = *((const GLuint *) value);
+ const GLfloat flt = (GLfloat) ((zValue & 0xffffff) * (1.0 / 0xffffff));
+ for (i = 0; i < count; i++) {
+ if (!mask || mask[i]) {
+ trb->Store(trb->TexImage, x[i], y[i] + trb->Yoffset, z, &flt);
+ }
+ }
+ }
+ else {
+ _mesa_problem(ctx, "invalid rb->DataType in texture_put_mono_values");
+ }
+}
+
+
+static void
+store_nop(struct gl_texture_image *texImage,
+ GLint col, GLint row, GLint img,
+ const void *texel)
+{
+}
+
+
+static void
+delete_texture_wrapper(struct gl_renderbuffer *rb)
+{
+ ASSERT(rb->RefCount == 0);
+ free(rb);
+}
+
+
+/**
+ * This function creates a renderbuffer object which wraps a texture image.
+ * The new renderbuffer is plugged into the given attachment point.
+ * This allows rendering into the texture as if it were a renderbuffer.
+ */
+static void
+wrap_texture(struct gl_context *ctx, struct gl_renderbuffer_attachment *att)
+{
+ struct texture_renderbuffer *trb;
+ const GLuint name = 0;
+
+ ASSERT(att->Type == GL_TEXTURE);
+ ASSERT(att->Renderbuffer == NULL);
+
+ trb = CALLOC_STRUCT(texture_renderbuffer);
+ if (!trb) {
+ _mesa_error(ctx, GL_OUT_OF_MEMORY, "wrap_texture");
+ return;
+ }
+
+ /* init base gl_renderbuffer fields */
+ _mesa_init_renderbuffer(&trb->Base, name);
+ /* plug in our texture_renderbuffer-specific functions */
+ trb->Base.Delete = delete_texture_wrapper;
+ trb->Base.AllocStorage = NULL; /* illegal! */
+ trb->Base.GetRow = texture_get_row;
+ trb->Base.GetValues = texture_get_values;
+ trb->Base.PutRow = texture_put_row;
+ trb->Base.PutRowRGB = texture_put_row_rgb;
+ trb->Base.PutMonoRow = texture_put_mono_row;
+ trb->Base.PutValues = texture_put_values;
+ trb->Base.PutMonoValues = texture_put_mono_values;
+
+ /* update attachment point */
+ _mesa_reference_renderbuffer(&att->Renderbuffer, &(trb->Base));
+}
+
+/**
+ * Update the renderbuffer wrapper for rendering to a texture.
+ * For example, update the width, height of the RB based on the texture size,
+ * update the internal format info, etc.
+ */
+static void
+update_wrapper(struct gl_context *ctx, struct gl_renderbuffer_attachment *att)
+{
+ struct texture_renderbuffer *trb
+ = (struct texture_renderbuffer *) att->Renderbuffer;
+
+ (void) ctx;
+ ASSERT(trb);
+
+ trb->TexImage = _mesa_get_attachment_teximage(att);
+ ASSERT(trb->TexImage);
+
+ trb->Store = _mesa_get_texel_store_func(trb->TexImage->TexFormat);
+ if (!trb->Store) {
+ /* we'll never draw into some textures (compressed formats) */
+ trb->Store = store_nop;
+ }
+
+ trb->Fetchf = trb->TexImage->FetchTexelf;
+
+ if (att->Texture->Target == GL_TEXTURE_1D_ARRAY_EXT) {
+ trb->Yoffset = att->Zoffset;
+ trb->Zoffset = 0;
+ }
+ else {
+ trb->Yoffset = 0;
+ trb->Zoffset = att->Zoffset;
+ }
+
+ trb->Base.Width = trb->TexImage->Width;
+ trb->Base.Height = trb->TexImage->Height;
+ trb->Base.InternalFormat = trb->TexImage->InternalFormat;
+ trb->Base.Format = trb->TexImage->TexFormat;
+
+ /* XXX may need more special cases here */
+ switch (trb->TexImage->TexFormat) {
+ case MESA_FORMAT_Z24_S8:
+ trb->Base.DataType = GL_UNSIGNED_INT_24_8_EXT;
+ trb->Base._BaseFormat = GL_DEPTH_STENCIL;
+ break;
+ case MESA_FORMAT_S8_Z24:
+ trb->Base.DataType = GL_UNSIGNED_INT_8_24_REV_MESA;
+ trb->Base._BaseFormat = GL_DEPTH_STENCIL;
+ break;
+ case MESA_FORMAT_Z24_X8:
+ trb->Base.DataType = GL_UNSIGNED_INT_24_8_EXT;
+ trb->Base._BaseFormat = GL_DEPTH_COMPONENT;
+ break;
+ case MESA_FORMAT_X8_Z24:
+ trb->Base.DataType = GL_UNSIGNED_INT_8_24_REV_MESA;
+ trb->Base._BaseFormat = GL_DEPTH_COMPONENT;
+ break;
+ case MESA_FORMAT_Z16:
+ trb->Base.DataType = GL_UNSIGNED_SHORT;
+ trb->Base._BaseFormat = GL_DEPTH_COMPONENT;
+ break;
+ case MESA_FORMAT_Z32:
+ trb->Base.DataType = GL_UNSIGNED_INT;
+ trb->Base._BaseFormat = GL_DEPTH_COMPONENT;
+ break;
+ /* SRGB formats pre EXT_framebuffer_sRGB don't do sRGB translations on FBO readback */
+ case MESA_FORMAT_SRGB8:
+ trb->Fetchf = _mesa_get_texel_fetch_func(MESA_FORMAT_RGB888, _mesa_get_texture_dimensions(att->Texture->Target));
+ trb->Base.DataType = CHAN_TYPE;
+ trb->Base._BaseFormat = GL_RGBA;
+ break;
+ case MESA_FORMAT_SRGBA8:
+ trb->Fetchf = _mesa_get_texel_fetch_func(MESA_FORMAT_RGBA8888, _mesa_get_texture_dimensions(att->Texture->Target));
+ trb->Base.DataType = CHAN_TYPE;
+ trb->Base._BaseFormat = GL_RGBA;
+ break;
+ case MESA_FORMAT_SARGB8:
+ trb->Fetchf = _mesa_get_texel_fetch_func(MESA_FORMAT_ARGB8888, _mesa_get_texture_dimensions(att->Texture->Target));
+ trb->Base.DataType = CHAN_TYPE;
+ trb->Base._BaseFormat = GL_RGBA;
+ break;
+ default:
+ trb->Base.DataType = CHAN_TYPE;
+ trb->Base._BaseFormat = GL_RGBA;
+ }
+ trb->Base.Data = trb->TexImage->Data;
+}
+
+
+
+/**
+ * Called when rendering to a texture image begins, or when changing
+ * the dest mipmap level, cube face, etc.
+ * This is a fallback routine for software render-to-texture.
+ *
+ * Called via the glRenderbufferTexture1D/2D/3D() functions
+ * and elsewhere (such as glTexImage2D).
+ *
+ * The image we're rendering into is
+ * att->Texture->Image[att->CubeMapFace][att->TextureLevel];
+ * It'll never be NULL.
+ *
+ * \param fb the framebuffer object the texture is being bound to
+ * \param att the fb attachment point of the texture
+ *
+ * \sa _mesa_framebuffer_renderbuffer
+ */
+void
+_mesa_render_texture(struct gl_context *ctx,
+ struct gl_framebuffer *fb,
+ struct gl_renderbuffer_attachment *att)
+{
+ (void) fb;
+
+ if (!att->Renderbuffer) {
+ wrap_texture(ctx, att);
+ }
+ update_wrapper(ctx, att);
+}
+
+
+void
+_mesa_finish_render_texture(struct gl_context *ctx,
+ struct gl_renderbuffer_attachment *att)
+{
+ /* do nothing */
+ /* The renderbuffer texture wrapper will get deleted by the
+ * normal mechanism for deleting renderbuffers.
+ */
+ (void) ctx;
+ (void) att;
+}
diff --git a/mesalib/src/mesa/main/texstate.c b/mesalib/src/mesa/main/texstate.c
index 1810b88b2..29b50637a 100644
--- a/mesalib/src/mesa/main/texstate.c
+++ b/mesalib/src/mesa/main/texstate.c
@@ -1,856 +1,856 @@
-/*
- * Mesa 3-D graphics library
- * Version: 7.5
- *
- * Copyright (C) 1999-2007 Brian Paul All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-/**
- * \file texstate.c
- *
- * Texture state handling.
- */
-
-#include "glheader.h"
-#include "mfeatures.h"
-#include "bufferobj.h"
-#include "colormac.h"
-#include "colortab.h"
-#include "context.h"
-#include "enums.h"
-#include "macros.h"
-#include "texobj.h"
-#include "teximage.h"
-#include "texstate.h"
-#include "mtypes.h"
-
-
-
-/**
- * Default texture combine environment state. This is used to initialize
- * a context's texture units and as the basis for converting "classic"
- * texture environmnets to ARB_texture_env_combine style values.
- */
-static const struct gl_tex_env_combine_state default_combine_state = {
- GL_MODULATE, GL_MODULATE,
- { GL_TEXTURE, GL_PREVIOUS, GL_CONSTANT, GL_CONSTANT },
- { GL_TEXTURE, GL_PREVIOUS, GL_CONSTANT, GL_CONSTANT },
- { GL_SRC_COLOR, GL_SRC_COLOR, GL_SRC_ALPHA, GL_SRC_ALPHA },
- { GL_SRC_ALPHA, GL_SRC_ALPHA, GL_SRC_ALPHA, GL_SRC_ALPHA },
- 0, 0,
- 2, 2
-};
-
-
-
-/**
- * Used by glXCopyContext to copy texture state from one context to another.
- */
-void
-_mesa_copy_texture_state( const struct gl_context *src, struct gl_context *dst )
-{
- GLuint u, tex;
-
- ASSERT(src);
- ASSERT(dst);
-
- dst->Texture.CurrentUnit = src->Texture.CurrentUnit;
- dst->Texture._GenFlags = src->Texture._GenFlags;
- dst->Texture._TexGenEnabled = src->Texture._TexGenEnabled;
- dst->Texture._TexMatEnabled = src->Texture._TexMatEnabled;
- dst->Texture.SharedPalette = src->Texture.SharedPalette;
-
- /* per-unit state */
- for (u = 0; u < src->Const.MaxCombinedTextureImageUnits; u++) {
- dst->Texture.Unit[u].Enabled = src->Texture.Unit[u].Enabled;
- dst->Texture.Unit[u].EnvMode = src->Texture.Unit[u].EnvMode;
- COPY_4V(dst->Texture.Unit[u].EnvColor, src->Texture.Unit[u].EnvColor);
- dst->Texture.Unit[u].TexGenEnabled = src->Texture.Unit[u].TexGenEnabled;
- dst->Texture.Unit[u].GenS = src->Texture.Unit[u].GenS;
- dst->Texture.Unit[u].GenT = src->Texture.Unit[u].GenT;
- dst->Texture.Unit[u].GenR = src->Texture.Unit[u].GenR;
- dst->Texture.Unit[u].GenQ = src->Texture.Unit[u].GenQ;
- dst->Texture.Unit[u].LodBias = src->Texture.Unit[u].LodBias;
-
- /* GL_EXT_texture_env_combine */
- dst->Texture.Unit[u].Combine = src->Texture.Unit[u].Combine;
-
- /* GL_ATI_envmap_bumpmap - need this? */
- dst->Texture.Unit[u].BumpTarget = src->Texture.Unit[u].BumpTarget;
- COPY_4V(dst->Texture.Unit[u].RotMatrix, src->Texture.Unit[u].RotMatrix);
-
- /*
- * XXX strictly speaking, we should compare texture names/ids and
- * bind textures in the dest context according to id. For now, only
- * copy bindings if the contexts share the same pool of textures to
- * avoid refcounting bugs.
- */
- if (dst->Shared == src->Shared) {
- /* copy texture object bindings, not contents of texture objects */
- _mesa_lock_context_textures(dst);
-
- for (tex = 0; tex < NUM_TEXTURE_TARGETS; tex++) {
- _mesa_reference_texobj(&dst->Texture.Unit[u].CurrentTex[tex],
- src->Texture.Unit[u].CurrentTex[tex]);
- }
- _mesa_unlock_context_textures(dst);
- }
- }
-}
-
-
-/*
- * For debugging
- */
-void
-_mesa_print_texunit_state( struct gl_context *ctx, GLuint unit )
-{
- const struct gl_texture_unit *texUnit = ctx->Texture.Unit + unit;
- printf("Texture Unit %d\n", unit);
- printf(" GL_TEXTURE_ENV_MODE = %s\n", _mesa_lookup_enum_by_nr(texUnit->EnvMode));
- printf(" GL_COMBINE_RGB = %s\n", _mesa_lookup_enum_by_nr(texUnit->Combine.ModeRGB));
- printf(" GL_COMBINE_ALPHA = %s\n", _mesa_lookup_enum_by_nr(texUnit->Combine.ModeA));
- printf(" GL_SOURCE0_RGB = %s\n", _mesa_lookup_enum_by_nr(texUnit->Combine.SourceRGB[0]));
- printf(" GL_SOURCE1_RGB = %s\n", _mesa_lookup_enum_by_nr(texUnit->Combine.SourceRGB[1]));
- printf(" GL_SOURCE2_RGB = %s\n", _mesa_lookup_enum_by_nr(texUnit->Combine.SourceRGB[2]));
- printf(" GL_SOURCE0_ALPHA = %s\n", _mesa_lookup_enum_by_nr(texUnit->Combine.SourceA[0]));
- printf(" GL_SOURCE1_ALPHA = %s\n", _mesa_lookup_enum_by_nr(texUnit->Combine.SourceA[1]));
- printf(" GL_SOURCE2_ALPHA = %s\n", _mesa_lookup_enum_by_nr(texUnit->Combine.SourceA[2]));
- printf(" GL_OPERAND0_RGB = %s\n", _mesa_lookup_enum_by_nr(texUnit->Combine.OperandRGB[0]));
- printf(" GL_OPERAND1_RGB = %s\n", _mesa_lookup_enum_by_nr(texUnit->Combine.OperandRGB[1]));
- printf(" GL_OPERAND2_RGB = %s\n", _mesa_lookup_enum_by_nr(texUnit->Combine.OperandRGB[2]));
- printf(" GL_OPERAND0_ALPHA = %s\n", _mesa_lookup_enum_by_nr(texUnit->Combine.OperandA[0]));
- printf(" GL_OPERAND1_ALPHA = %s\n", _mesa_lookup_enum_by_nr(texUnit->Combine.OperandA[1]));
- printf(" GL_OPERAND2_ALPHA = %s\n", _mesa_lookup_enum_by_nr(texUnit->Combine.OperandA[2]));
- printf(" GL_RGB_SCALE = %d\n", 1 << texUnit->Combine.ScaleShiftRGB);
- printf(" GL_ALPHA_SCALE = %d\n", 1 << texUnit->Combine.ScaleShiftA);
- printf(" GL_TEXTURE_ENV_COLOR = (%f, %f, %f, %f)\n", texUnit->EnvColor[0], texUnit->EnvColor[1], texUnit->EnvColor[2], texUnit->EnvColor[3]);
-}
-
-
-
-/**********************************************************************/
-/* Texture Environment */
-/**********************************************************************/
-
-/**
- * Convert "classic" texture environment to ARB_texture_env_combine style
- * environments.
- *
- * \param state texture_env_combine state vector to be filled-in.
- * \param mode Classic texture environment mode (i.e., \c GL_REPLACE,
- * \c GL_BLEND, \c GL_DECAL, etc.).
- * \param texBaseFormat Base format of the texture associated with the
- * texture unit.
- */
-static void
-calculate_derived_texenv( struct gl_tex_env_combine_state *state,
- GLenum mode, GLenum texBaseFormat )
-{
- GLenum mode_rgb;
- GLenum mode_a;
-
- *state = default_combine_state;
-
- switch (texBaseFormat) {
- case GL_ALPHA:
- state->SourceRGB[0] = GL_PREVIOUS;
- break;
-
- case GL_LUMINANCE_ALPHA:
- case GL_INTENSITY:
- case GL_RGBA:
- break;
-
- case GL_LUMINANCE:
- case GL_RED:
- case GL_RG:
- case GL_RGB:
- case GL_YCBCR_MESA:
- case GL_DUDV_ATI:
- state->SourceA[0] = GL_PREVIOUS;
- break;
-
- default:
- _mesa_problem(NULL,
- "Invalid texBaseFormat 0x%x in calculate_derived_texenv",
- texBaseFormat);
- return;
- }
-
- if (mode == GL_REPLACE_EXT)
- mode = GL_REPLACE;
-
- switch (mode) {
- case GL_REPLACE:
- case GL_MODULATE:
- mode_rgb = (texBaseFormat == GL_ALPHA) ? GL_REPLACE : mode;
- mode_a = mode;
- break;
-
- case GL_DECAL:
- mode_rgb = GL_INTERPOLATE;
- mode_a = GL_REPLACE;
-
- state->SourceA[0] = GL_PREVIOUS;
-
- /* Having alpha / luminance / intensity textures replace using the
- * incoming fragment color matches the definition in NV_texture_shader.
- * The 1.5 spec simply marks these as "undefined".
- */
- switch (texBaseFormat) {
- case GL_ALPHA:
- case GL_LUMINANCE:
- case GL_LUMINANCE_ALPHA:
- case GL_INTENSITY:
- state->SourceRGB[0] = GL_PREVIOUS;
- break;
- case GL_RED:
- case GL_RG:
- case GL_RGB:
- case GL_YCBCR_MESA:
- case GL_DUDV_ATI:
- mode_rgb = GL_REPLACE;
- break;
- case GL_RGBA:
- state->SourceRGB[2] = GL_TEXTURE;
- break;
- }
- break;
-
- case GL_BLEND:
- mode_rgb = GL_INTERPOLATE;
- mode_a = GL_MODULATE;
-
- switch (texBaseFormat) {
- case GL_ALPHA:
- mode_rgb = GL_REPLACE;
- break;
- case GL_INTENSITY:
- mode_a = GL_INTERPOLATE;
- state->SourceA[0] = GL_CONSTANT;
- state->OperandA[2] = GL_SRC_ALPHA;
- /* FALLTHROUGH */
- case GL_LUMINANCE:
- case GL_RED:
- case GL_RG:
- case GL_RGB:
- case GL_LUMINANCE_ALPHA:
- case GL_RGBA:
- case GL_YCBCR_MESA:
- case GL_DUDV_ATI:
- state->SourceRGB[2] = GL_TEXTURE;
- state->SourceA[2] = GL_TEXTURE;
- state->SourceRGB[0] = GL_CONSTANT;
- state->OperandRGB[2] = GL_SRC_COLOR;
- break;
- }
- break;
-
- case GL_ADD:
- mode_rgb = (texBaseFormat == GL_ALPHA) ? GL_REPLACE : GL_ADD;
- mode_a = (texBaseFormat == GL_INTENSITY) ? GL_ADD : GL_MODULATE;
- break;
-
- default:
- _mesa_problem(NULL,
- "Invalid texture env mode 0x%x in calculate_derived_texenv",
- mode);
- return;
- }
-
- state->ModeRGB = (state->SourceRGB[0] != GL_PREVIOUS)
- ? mode_rgb : GL_REPLACE;
- state->ModeA = (state->SourceA[0] != GL_PREVIOUS)
- ? mode_a : GL_REPLACE;
-}
-
-
-
-
-/* GL_ARB_multitexture */
-void GLAPIENTRY
-_mesa_ActiveTextureARB(GLenum texture)
-{
- const GLuint texUnit = texture - GL_TEXTURE0;
- GLuint k;
- GET_CURRENT_CONTEXT(ctx);
-
- /* See OpenGL spec for glActiveTexture: */
- k = MAX2(ctx->Const.MaxCombinedTextureImageUnits,
- ctx->Const.MaxTextureCoordUnits);
-
- ASSERT(k <= Elements(ctx->Texture.Unit));
-
- ASSERT_OUTSIDE_BEGIN_END(ctx);
-
- if (MESA_VERBOSE & (VERBOSE_API|VERBOSE_TEXTURE))
- _mesa_debug(ctx, "glActiveTexture %s\n",
- _mesa_lookup_enum_by_nr(texture));
-
- if (texUnit >= k) {
- _mesa_error(ctx, GL_INVALID_ENUM, "glActiveTexture(texture=%s)",
- _mesa_lookup_enum_by_nr(texture));
- return;
- }
-
- if (ctx->Texture.CurrentUnit == texUnit)
- return;
-
- FLUSH_VERTICES(ctx, _NEW_TEXTURE);
-
- ctx->Texture.CurrentUnit = texUnit;
- if (ctx->Transform.MatrixMode == GL_TEXTURE) {
- /* update current stack pointer */
- ctx->CurrentStack = &ctx->TextureMatrixStack[texUnit];
- }
-}
-
-
-/* GL_ARB_multitexture */
-void GLAPIENTRY
-_mesa_ClientActiveTextureARB(GLenum texture)
-{
- GET_CURRENT_CONTEXT(ctx);
- GLuint texUnit = texture - GL_TEXTURE0;
- ASSERT_OUTSIDE_BEGIN_END(ctx);
-
- if (MESA_VERBOSE & (VERBOSE_API | VERBOSE_TEXTURE))
- _mesa_debug(ctx, "glClientActiveTexture %s\n",
- _mesa_lookup_enum_by_nr(texture));
-
- if (texUnit >= ctx->Const.MaxTextureCoordUnits) {
- _mesa_error(ctx, GL_INVALID_ENUM, "glClientActiveTexture(texture)");
- return;
- }
-
- if (ctx->Array.ActiveTexture == texUnit)
- return;
-
- FLUSH_VERTICES(ctx, _NEW_ARRAY);
- ctx->Array.ActiveTexture = texUnit;
-}
-
-
-
-/**********************************************************************/
-/***** State management *****/
-/**********************************************************************/
-
-
-/**
- * \note This routine refers to derived texture attribute values to
- * compute the ENABLE_TEXMAT flags, but is only called on
- * _NEW_TEXTURE_MATRIX. On changes to _NEW_TEXTURE, the ENABLE_TEXMAT
- * flags are updated by _mesa_update_textures(), below.
- *
- * \param ctx GL context.
- */
-static void
-update_texture_matrices( struct gl_context *ctx )
-{
- GLuint u;
-
- ctx->Texture._TexMatEnabled = 0x0;
-
- for (u = 0; u < ctx->Const.MaxTextureCoordUnits; u++) {
- ASSERT(u < Elements(ctx->TextureMatrixStack));
- if (_math_matrix_is_dirty(ctx->TextureMatrixStack[u].Top)) {
- _math_matrix_analyse( ctx->TextureMatrixStack[u].Top );
-
- if (ctx->Texture.Unit[u]._ReallyEnabled &&
- ctx->TextureMatrixStack[u].Top->type != MATRIX_IDENTITY)
- ctx->Texture._TexMatEnabled |= ENABLE_TEXMAT(u);
- }
- }
-}
-
-
-/**
- * Examine texture unit's combine/env state to update derived state.
- */
-static void
-update_tex_combine(struct gl_context *ctx, struct gl_texture_unit *texUnit)
-{
- struct gl_tex_env_combine_state *combine;
-
- /* Set the texUnit->_CurrentCombine field to point to the user's combiner
- * state, or the combiner state which is derived from traditional texenv
- * mode.
- */
- if (texUnit->EnvMode == GL_COMBINE ||
- texUnit->EnvMode == GL_COMBINE4_NV) {
- texUnit->_CurrentCombine = & texUnit->Combine;
- }
- else {
- const struct gl_texture_object *texObj = texUnit->_Current;
- GLenum format = texObj->Image[0][texObj->BaseLevel]->_BaseFormat;
- if (format == GL_COLOR_INDEX) {
- format = GL_RGBA; /* a bit of a hack */
- }
- else if (format == GL_DEPTH_COMPONENT ||
- format == GL_DEPTH_STENCIL_EXT) {
- format = texObj->Sampler.DepthMode;
- }
- calculate_derived_texenv(&texUnit->_EnvMode, texUnit->EnvMode, format);
- texUnit->_CurrentCombine = & texUnit->_EnvMode;
- }
-
- combine = texUnit->_CurrentCombine;
-
- /* Determine number of source RGB terms in the combiner function */
- switch (combine->ModeRGB) {
- case GL_REPLACE:
- combine->_NumArgsRGB = 1;
- break;
- case GL_ADD:
- case GL_ADD_SIGNED:
- if (texUnit->EnvMode == GL_COMBINE4_NV)
- combine->_NumArgsRGB = 4;
- else
- combine->_NumArgsRGB = 2;
- break;
- case GL_MODULATE:
- case GL_SUBTRACT:
- case GL_DOT3_RGB:
- case GL_DOT3_RGBA:
- case GL_DOT3_RGB_EXT:
- case GL_DOT3_RGBA_EXT:
- combine->_NumArgsRGB = 2;
- break;
- case GL_INTERPOLATE:
- case GL_MODULATE_ADD_ATI:
- case GL_MODULATE_SIGNED_ADD_ATI:
- case GL_MODULATE_SUBTRACT_ATI:
- combine->_NumArgsRGB = 3;
- break;
- case GL_BUMP_ENVMAP_ATI:
- /* no real arguments for this case */
- combine->_NumArgsRGB = 0;
- break;
- default:
- combine->_NumArgsRGB = 0;
- _mesa_problem(ctx, "invalid RGB combine mode in update_texture_state");
- return;
- }
-
- /* Determine number of source Alpha terms in the combiner function */
- switch (combine->ModeA) {
- case GL_REPLACE:
- combine->_NumArgsA = 1;
- break;
- case GL_ADD:
- case GL_ADD_SIGNED:
- if (texUnit->EnvMode == GL_COMBINE4_NV)
- combine->_NumArgsA = 4;
- else
- combine->_NumArgsA = 2;
- break;
- case GL_MODULATE:
- case GL_SUBTRACT:
- combine->_NumArgsA = 2;
- break;
- case GL_INTERPOLATE:
- case GL_MODULATE_ADD_ATI:
- case GL_MODULATE_SIGNED_ADD_ATI:
- case GL_MODULATE_SUBTRACT_ATI:
- combine->_NumArgsA = 3;
- break;
- default:
- combine->_NumArgsA = 0;
- _mesa_problem(ctx, "invalid Alpha combine mode in update_texture_state");
- break;
- }
-}
-
-
-/**
- * \note This routine refers to derived texture matrix values to
- * compute the ENABLE_TEXMAT flags, but is only called on
- * _NEW_TEXTURE. On changes to _NEW_TEXTURE_MATRIX, the ENABLE_TEXMAT
- * flags are updated by _mesa_update_texture_matrices, above.
- *
- * \param ctx GL context.
- */
-static void
-update_texture_state( struct gl_context *ctx )
-{
- GLuint unit;
- struct gl_fragment_program *fprog = NULL;
- struct gl_vertex_program *vprog = NULL;
- GLbitfield enabledFragUnits = 0x0;
-
- if (ctx->Shader.CurrentVertexProgram &&
- ctx->Shader.CurrentVertexProgram->LinkStatus) {
- vprog = ctx->Shader.CurrentVertexProgram->VertexProgram;
- } else if (ctx->VertexProgram._Enabled) {
- /* XXX enable this if/when non-shader vertex programs get
- * texture fetches:
- vprog = ctx->VertexProgram.Current;
- */
- }
-
- if (ctx->Shader.CurrentFragmentProgram &&
- ctx->Shader.CurrentFragmentProgram->LinkStatus) {
- fprog = ctx->Shader.CurrentFragmentProgram->FragmentProgram;
- }
- else if (ctx->FragmentProgram._Enabled) {
- fprog = ctx->FragmentProgram.Current;
- }
-
- /* FINISHME: Geometry shader texture accesses should also be considered
- * FINISHME: here.
- */
-
- /* TODO: only set this if there are actual changes */
- ctx->NewState |= _NEW_TEXTURE;
-
- ctx->Texture._EnabledUnits = 0x0;
- ctx->Texture._GenFlags = 0x0;
- ctx->Texture._TexMatEnabled = 0x0;
- ctx->Texture._TexGenEnabled = 0x0;
-
- /*
- * Update texture unit state.
- */
- for (unit = 0; unit < ctx->Const.MaxCombinedTextureImageUnits; unit++) {
- struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit];
- GLbitfield enabledVertTargets = 0x0;
- GLbitfield enabledFragTargets = 0x0;
- GLbitfield enabledTargets = 0x0;
- GLuint texIndex;
-
- /* Get the bitmask of texture target enables.
- * enableBits will be a mask of the TEXTURE_*_BIT flags indicating
- * which texture targets are enabled (fixed function) or referenced
- * by a fragment program/program. When multiple flags are set, we'll
- * settle on the one with highest priority (see below).
- */
- if (vprog) {
- enabledVertTargets |= vprog->Base.TexturesUsed[unit];
- }
-
- if (fprog) {
- enabledFragTargets |= fprog->Base.TexturesUsed[unit];
- }
- else {
- /* fixed-function fragment program */
- enabledFragTargets |= texUnit->Enabled;
- }
-
- enabledTargets = enabledVertTargets | enabledFragTargets;
-
- texUnit->_ReallyEnabled = 0x0;
-
- if (enabledTargets == 0x0) {
- /* neither vertex nor fragment processing uses this unit */
- continue;
- }
-
- /* Look for the highest priority texture target that's enabled (or used
- * by the vert/frag shaders) and "complete". That's the one we'll use
- * for texturing. If we're using vert/frag program we're guaranteed
- * that bitcount(enabledBits) <= 1.
- * Note that the TEXTURE_x_INDEX values are in high to low priority.
- */
- for (texIndex = 0; texIndex < NUM_TEXTURE_TARGETS; texIndex++) {
- if (enabledTargets & (1 << texIndex)) {
- struct gl_texture_object *texObj = texUnit->CurrentTex[texIndex];
- if (!texObj->_Complete) {
- _mesa_test_texobj_completeness(ctx, texObj);
- }
- if (texObj->_Complete) {
- texUnit->_ReallyEnabled = 1 << texIndex;
- _mesa_reference_texobj(&texUnit->_Current, texObj);
- break;
- }
- }
- }
-
- if (!texUnit->_ReallyEnabled) {
- if (fprog) {
- /* If we get here it means the shader is expecting a texture
- * object, but there isn't one (or it's incomplete). Use the
- * fallback texture.
- */
- struct gl_texture_object *texObj = _mesa_get_fallback_texture(ctx);
- texUnit->_ReallyEnabled = 1 << TEXTURE_2D_INDEX;
- _mesa_reference_texobj(&texUnit->_Current, texObj);
- }
- else {
- /* fixed-function: texture unit is really disabled */
- continue;
- }
- }
-
- /* if we get here, we know this texture unit is enabled */
-
- ctx->Texture._EnabledUnits |= (1 << unit);
-
- if (enabledFragTargets)
- enabledFragUnits |= (1 << unit);
-
- update_tex_combine(ctx, texUnit);
- }
-
-
- /* Determine which texture coordinate sets are actually needed */
- if (fprog) {
- const GLuint coordMask = (1 << MAX_TEXTURE_COORD_UNITS) - 1;
- ctx->Texture._EnabledCoordUnits
- = (fprog->Base.InputsRead >> FRAG_ATTRIB_TEX0) & coordMask;
- }
- else {
- ctx->Texture._EnabledCoordUnits = enabledFragUnits;
- }
-
- /* Setup texgen for those texture coordinate sets that are in use */
- for (unit = 0; unit < ctx->Const.MaxTextureCoordUnits; unit++) {
- struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit];
-
- texUnit->_GenFlags = 0x0;
-
- if (!(ctx->Texture._EnabledCoordUnits & (1 << unit)))
- continue;
-
- if (texUnit->TexGenEnabled) {
- if (texUnit->TexGenEnabled & S_BIT) {
- texUnit->_GenFlags |= texUnit->GenS._ModeBit;
- }
- if (texUnit->TexGenEnabled & T_BIT) {
- texUnit->_GenFlags |= texUnit->GenT._ModeBit;
- }
- if (texUnit->TexGenEnabled & R_BIT) {
- texUnit->_GenFlags |= texUnit->GenR._ModeBit;
- }
- if (texUnit->TexGenEnabled & Q_BIT) {
- texUnit->_GenFlags |= texUnit->GenQ._ModeBit;
- }
-
- ctx->Texture._TexGenEnabled |= ENABLE_TEXGEN(unit);
- ctx->Texture._GenFlags |= texUnit->_GenFlags;
- }
-
- ASSERT(unit < Elements(ctx->TextureMatrixStack));
- if (ctx->TextureMatrixStack[unit].Top->type != MATRIX_IDENTITY)
- ctx->Texture._TexMatEnabled |= ENABLE_TEXMAT(unit);
- }
-}
-
-
-/**
- * Update texture-related derived state.
- */
-void
-_mesa_update_texture( struct gl_context *ctx, GLuint new_state )
-{
- if (new_state & _NEW_TEXTURE_MATRIX)
- update_texture_matrices( ctx );
-
- if (new_state & (_NEW_TEXTURE | _NEW_PROGRAM))
- update_texture_state( ctx );
-}
-
-
-/**********************************************************************/
-/***** Initialization *****/
-/**********************************************************************/
-
-/**
- * Allocate the proxy textures for the given context.
- *
- * \param ctx the context to allocate proxies for.
- *
- * \return GL_TRUE on success, or GL_FALSE on failure
- *
- * If run out of memory part way through the allocations, clean up and return
- * GL_FALSE.
- */
-static GLboolean
-alloc_proxy_textures( struct gl_context *ctx )
-{
- static const GLenum targets[] = {
- GL_TEXTURE_1D,
- GL_TEXTURE_2D,
- GL_TEXTURE_3D,
- GL_TEXTURE_CUBE_MAP_ARB,
- GL_TEXTURE_RECTANGLE_NV,
- GL_TEXTURE_1D_ARRAY_EXT,
- GL_TEXTURE_2D_ARRAY_EXT,
- GL_TEXTURE_BUFFER
- };
- GLint tgt;
-
- ASSERT(Elements(targets) == NUM_TEXTURE_TARGETS);
-
- for (tgt = 0; tgt < NUM_TEXTURE_TARGETS; tgt++) {
- if (!(ctx->Texture.ProxyTex[tgt]
- = ctx->Driver.NewTextureObject(ctx, 0, targets[tgt]))) {
- /* out of memory, free what we did allocate */
- while (--tgt >= 0) {
- ctx->Driver.DeleteTexture(ctx, ctx->Texture.ProxyTex[tgt]);
- }
- return GL_FALSE;
- }
- }
-
- assert(ctx->Texture.ProxyTex[0]->RefCount == 1); /* sanity check */
- return GL_TRUE;
-}
-
-
-/**
- * Initialize a texture unit.
- *
- * \param ctx GL context.
- * \param unit texture unit number to be initialized.
- */
-static void
-init_texture_unit( struct gl_context *ctx, GLuint unit )
-{
- struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit];
- GLuint tex;
-
- texUnit->EnvMode = GL_MODULATE;
- ASSIGN_4V( texUnit->EnvColor, 0.0, 0.0, 0.0, 0.0 );
-
- texUnit->Combine = default_combine_state;
- texUnit->_EnvMode = default_combine_state;
- texUnit->_CurrentCombine = & texUnit->_EnvMode;
- texUnit->BumpTarget = GL_TEXTURE0;
-
- texUnit->TexGenEnabled = 0x0;
- texUnit->GenS.Mode = GL_EYE_LINEAR;
- texUnit->GenT.Mode = GL_EYE_LINEAR;
- texUnit->GenR.Mode = GL_EYE_LINEAR;
- texUnit->GenQ.Mode = GL_EYE_LINEAR;
- texUnit->GenS._ModeBit = TEXGEN_EYE_LINEAR;
- texUnit->GenT._ModeBit = TEXGEN_EYE_LINEAR;
- texUnit->GenR._ModeBit = TEXGEN_EYE_LINEAR;
- texUnit->GenQ._ModeBit = TEXGEN_EYE_LINEAR;
-
- /* Yes, these plane coefficients are correct! */
- ASSIGN_4V( texUnit->GenS.ObjectPlane, 1.0, 0.0, 0.0, 0.0 );
- ASSIGN_4V( texUnit->GenT.ObjectPlane, 0.0, 1.0, 0.0, 0.0 );
- ASSIGN_4V( texUnit->GenR.ObjectPlane, 0.0, 0.0, 0.0, 0.0 );
- ASSIGN_4V( texUnit->GenQ.ObjectPlane, 0.0, 0.0, 0.0, 0.0 );
- ASSIGN_4V( texUnit->GenS.EyePlane, 1.0, 0.0, 0.0, 0.0 );
- ASSIGN_4V( texUnit->GenT.EyePlane, 0.0, 1.0, 0.0, 0.0 );
- ASSIGN_4V( texUnit->GenR.EyePlane, 0.0, 0.0, 0.0, 0.0 );
- ASSIGN_4V( texUnit->GenQ.EyePlane, 0.0, 0.0, 0.0, 0.0 );
-
- /* no mention of this in spec, but maybe id matrix expected? */
- ASSIGN_4V( texUnit->RotMatrix, 1.0, 0.0, 0.0, 1.0 );
-
- /* initialize current texture object ptrs to the shared default objects */
- for (tex = 0; tex < NUM_TEXTURE_TARGETS; tex++) {
- _mesa_reference_texobj(&texUnit->CurrentTex[tex],
- ctx->Shared->DefaultTex[tex]);
- }
-}
-
-
-/**
- * Initialize texture state for the given context.
- */
-GLboolean
-_mesa_init_texture(struct gl_context *ctx)
-{
- GLuint u;
-
- /* Texture group */
- ctx->Texture.CurrentUnit = 0; /* multitexture */
- ctx->Texture._EnabledUnits = 0x0;
- ctx->Texture.SharedPalette = GL_FALSE;
- _mesa_init_colortable(&ctx->Texture.Palette);
-
- for (u = 0; u < Elements(ctx->Texture.Unit); u++)
- init_texture_unit(ctx, u);
-
- /* After we're done initializing the context's texture state the default
- * texture objects' refcounts should be at least
- * MAX_COMBINED_TEXTURE_IMAGE_UNITS + 1.
- */
- assert(ctx->Shared->DefaultTex[TEXTURE_1D_INDEX]->RefCount
- >= MAX_COMBINED_TEXTURE_IMAGE_UNITS + 1);
-
- /* Allocate proxy textures */
- if (!alloc_proxy_textures( ctx ))
- return GL_FALSE;
-
- /* GL_ARB_texture_buffer_object */
- _mesa_reference_buffer_object(ctx, &ctx->Texture.BufferObject,
- ctx->Shared->NullBufferObj);
-
- return GL_TRUE;
-}
-
-
-/**
- * Free dynamically-allocted texture data attached to the given context.
- */
-void
-_mesa_free_texture_data(struct gl_context *ctx)
-{
- GLuint u, tgt;
-
- /* unreference current textures */
- for (u = 0; u < Elements(ctx->Texture.Unit); u++) {
- /* The _Current texture could account for another reference */
- _mesa_reference_texobj(&ctx->Texture.Unit[u]._Current, NULL);
-
- for (tgt = 0; tgt < NUM_TEXTURE_TARGETS; tgt++) {
- _mesa_reference_texobj(&ctx->Texture.Unit[u].CurrentTex[tgt], NULL);
- }
- }
-
- /* Free proxy texture objects */
- for (tgt = 0; tgt < NUM_TEXTURE_TARGETS; tgt++)
- ctx->Driver.DeleteTexture(ctx, ctx->Texture.ProxyTex[tgt]);
-
- /* GL_ARB_texture_buffer_object */
- _mesa_reference_buffer_object(ctx, &ctx->Texture.BufferObject, NULL);
-
-#if FEATURE_sampler_objects
- for (u = 0; u < Elements(ctx->Texture.Unit); u++) {
- _mesa_reference_sampler_object(ctx, &ctx->Texture.Unit[u].Sampler, NULL);
- }
-#endif
-}
-
-
-/**
- * Update the default texture objects in the given context to reference those
- * specified in the shared state and release those referencing the old
- * shared state.
- */
-void
-_mesa_update_default_objects_texture(struct gl_context *ctx)
-{
- GLuint u, tex;
-
- for (u = 0; u < Elements(ctx->Texture.Unit); u++) {
- struct gl_texture_unit *texUnit = &ctx->Texture.Unit[u];
- for (tex = 0; tex < NUM_TEXTURE_TARGETS; tex++) {
- _mesa_reference_texobj(&texUnit->CurrentTex[tex],
- ctx->Shared->DefaultTex[tex]);
- }
- }
-}
+/*
+ * Mesa 3-D graphics library
+ * Version: 7.5
+ *
+ * Copyright (C) 1999-2007 Brian Paul All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+/**
+ * \file texstate.c
+ *
+ * Texture state handling.
+ */
+
+#include "glheader.h"
+#include "mfeatures.h"
+#include "bufferobj.h"
+#include "colormac.h"
+#include "colortab.h"
+#include "context.h"
+#include "enums.h"
+#include "macros.h"
+#include "texobj.h"
+#include "teximage.h"
+#include "texstate.h"
+#include "mtypes.h"
+
+
+
+/**
+ * Default texture combine environment state. This is used to initialize
+ * a context's texture units and as the basis for converting "classic"
+ * texture environmnets to ARB_texture_env_combine style values.
+ */
+static const struct gl_tex_env_combine_state default_combine_state = {
+ GL_MODULATE, GL_MODULATE,
+ { GL_TEXTURE, GL_PREVIOUS, GL_CONSTANT, GL_CONSTANT },
+ { GL_TEXTURE, GL_PREVIOUS, GL_CONSTANT, GL_CONSTANT },
+ { GL_SRC_COLOR, GL_SRC_COLOR, GL_SRC_ALPHA, GL_SRC_ALPHA },
+ { GL_SRC_ALPHA, GL_SRC_ALPHA, GL_SRC_ALPHA, GL_SRC_ALPHA },
+ 0, 0,
+ 2, 2
+};
+
+
+
+/**
+ * Used by glXCopyContext to copy texture state from one context to another.
+ */
+void
+_mesa_copy_texture_state( const struct gl_context *src, struct gl_context *dst )
+{
+ GLuint u, tex;
+
+ ASSERT(src);
+ ASSERT(dst);
+
+ dst->Texture.CurrentUnit = src->Texture.CurrentUnit;
+ dst->Texture._GenFlags = src->Texture._GenFlags;
+ dst->Texture._TexGenEnabled = src->Texture._TexGenEnabled;
+ dst->Texture._TexMatEnabled = src->Texture._TexMatEnabled;
+ dst->Texture.SharedPalette = src->Texture.SharedPalette;
+
+ /* per-unit state */
+ for (u = 0; u < src->Const.MaxCombinedTextureImageUnits; u++) {
+ dst->Texture.Unit[u].Enabled = src->Texture.Unit[u].Enabled;
+ dst->Texture.Unit[u].EnvMode = src->Texture.Unit[u].EnvMode;
+ COPY_4V(dst->Texture.Unit[u].EnvColor, src->Texture.Unit[u].EnvColor);
+ dst->Texture.Unit[u].TexGenEnabled = src->Texture.Unit[u].TexGenEnabled;
+ dst->Texture.Unit[u].GenS = src->Texture.Unit[u].GenS;
+ dst->Texture.Unit[u].GenT = src->Texture.Unit[u].GenT;
+ dst->Texture.Unit[u].GenR = src->Texture.Unit[u].GenR;
+ dst->Texture.Unit[u].GenQ = src->Texture.Unit[u].GenQ;
+ dst->Texture.Unit[u].LodBias = src->Texture.Unit[u].LodBias;
+
+ /* GL_EXT_texture_env_combine */
+ dst->Texture.Unit[u].Combine = src->Texture.Unit[u].Combine;
+
+ /* GL_ATI_envmap_bumpmap - need this? */
+ dst->Texture.Unit[u].BumpTarget = src->Texture.Unit[u].BumpTarget;
+ COPY_4V(dst->Texture.Unit[u].RotMatrix, src->Texture.Unit[u].RotMatrix);
+
+ /*
+ * XXX strictly speaking, we should compare texture names/ids and
+ * bind textures in the dest context according to id. For now, only
+ * copy bindings if the contexts share the same pool of textures to
+ * avoid refcounting bugs.
+ */
+ if (dst->Shared == src->Shared) {
+ /* copy texture object bindings, not contents of texture objects */
+ _mesa_lock_context_textures(dst);
+
+ for (tex = 0; tex < NUM_TEXTURE_TARGETS; tex++) {
+ _mesa_reference_texobj(&dst->Texture.Unit[u].CurrentTex[tex],
+ src->Texture.Unit[u].CurrentTex[tex]);
+ }
+ _mesa_unlock_context_textures(dst);
+ }
+ }
+}
+
+
+/*
+ * For debugging
+ */
+void
+_mesa_print_texunit_state( struct gl_context *ctx, GLuint unit )
+{
+ const struct gl_texture_unit *texUnit = ctx->Texture.Unit + unit;
+ printf("Texture Unit %d\n", unit);
+ printf(" GL_TEXTURE_ENV_MODE = %s\n", _mesa_lookup_enum_by_nr(texUnit->EnvMode));
+ printf(" GL_COMBINE_RGB = %s\n", _mesa_lookup_enum_by_nr(texUnit->Combine.ModeRGB));
+ printf(" GL_COMBINE_ALPHA = %s\n", _mesa_lookup_enum_by_nr(texUnit->Combine.ModeA));
+ printf(" GL_SOURCE0_RGB = %s\n", _mesa_lookup_enum_by_nr(texUnit->Combine.SourceRGB[0]));
+ printf(" GL_SOURCE1_RGB = %s\n", _mesa_lookup_enum_by_nr(texUnit->Combine.SourceRGB[1]));
+ printf(" GL_SOURCE2_RGB = %s\n", _mesa_lookup_enum_by_nr(texUnit->Combine.SourceRGB[2]));
+ printf(" GL_SOURCE0_ALPHA = %s\n", _mesa_lookup_enum_by_nr(texUnit->Combine.SourceA[0]));
+ printf(" GL_SOURCE1_ALPHA = %s\n", _mesa_lookup_enum_by_nr(texUnit->Combine.SourceA[1]));
+ printf(" GL_SOURCE2_ALPHA = %s\n", _mesa_lookup_enum_by_nr(texUnit->Combine.SourceA[2]));
+ printf(" GL_OPERAND0_RGB = %s\n", _mesa_lookup_enum_by_nr(texUnit->Combine.OperandRGB[0]));
+ printf(" GL_OPERAND1_RGB = %s\n", _mesa_lookup_enum_by_nr(texUnit->Combine.OperandRGB[1]));
+ printf(" GL_OPERAND2_RGB = %s\n", _mesa_lookup_enum_by_nr(texUnit->Combine.OperandRGB[2]));
+ printf(" GL_OPERAND0_ALPHA = %s\n", _mesa_lookup_enum_by_nr(texUnit->Combine.OperandA[0]));
+ printf(" GL_OPERAND1_ALPHA = %s\n", _mesa_lookup_enum_by_nr(texUnit->Combine.OperandA[1]));
+ printf(" GL_OPERAND2_ALPHA = %s\n", _mesa_lookup_enum_by_nr(texUnit->Combine.OperandA[2]));
+ printf(" GL_RGB_SCALE = %d\n", 1 << texUnit->Combine.ScaleShiftRGB);
+ printf(" GL_ALPHA_SCALE = %d\n", 1 << texUnit->Combine.ScaleShiftA);
+ printf(" GL_TEXTURE_ENV_COLOR = (%f, %f, %f, %f)\n", texUnit->EnvColor[0], texUnit->EnvColor[1], texUnit->EnvColor[2], texUnit->EnvColor[3]);
+}
+
+
+
+/**********************************************************************/
+/* Texture Environment */
+/**********************************************************************/
+
+/**
+ * Convert "classic" texture environment to ARB_texture_env_combine style
+ * environments.
+ *
+ * \param state texture_env_combine state vector to be filled-in.
+ * \param mode Classic texture environment mode (i.e., \c GL_REPLACE,
+ * \c GL_BLEND, \c GL_DECAL, etc.).
+ * \param texBaseFormat Base format of the texture associated with the
+ * texture unit.
+ */
+static void
+calculate_derived_texenv( struct gl_tex_env_combine_state *state,
+ GLenum mode, GLenum texBaseFormat )
+{
+ GLenum mode_rgb;
+ GLenum mode_a;
+
+ *state = default_combine_state;
+
+ switch (texBaseFormat) {
+ case GL_ALPHA:
+ state->SourceRGB[0] = GL_PREVIOUS;
+ break;
+
+ case GL_LUMINANCE_ALPHA:
+ case GL_INTENSITY:
+ case GL_RGBA:
+ break;
+
+ case GL_LUMINANCE:
+ case GL_RED:
+ case GL_RG:
+ case GL_RGB:
+ case GL_YCBCR_MESA:
+ case GL_DUDV_ATI:
+ state->SourceA[0] = GL_PREVIOUS;
+ break;
+
+ default:
+ _mesa_problem(NULL,
+ "Invalid texBaseFormat 0x%x in calculate_derived_texenv",
+ texBaseFormat);
+ return;
+ }
+
+ if (mode == GL_REPLACE_EXT)
+ mode = GL_REPLACE;
+
+ switch (mode) {
+ case GL_REPLACE:
+ case GL_MODULATE:
+ mode_rgb = (texBaseFormat == GL_ALPHA) ? GL_REPLACE : mode;
+ mode_a = mode;
+ break;
+
+ case GL_DECAL:
+ mode_rgb = GL_INTERPOLATE;
+ mode_a = GL_REPLACE;
+
+ state->SourceA[0] = GL_PREVIOUS;
+
+ /* Having alpha / luminance / intensity textures replace using the
+ * incoming fragment color matches the definition in NV_texture_shader.
+ * The 1.5 spec simply marks these as "undefined".
+ */
+ switch (texBaseFormat) {
+ case GL_ALPHA:
+ case GL_LUMINANCE:
+ case GL_LUMINANCE_ALPHA:
+ case GL_INTENSITY:
+ state->SourceRGB[0] = GL_PREVIOUS;
+ break;
+ case GL_RED:
+ case GL_RG:
+ case GL_RGB:
+ case GL_YCBCR_MESA:
+ case GL_DUDV_ATI:
+ mode_rgb = GL_REPLACE;
+ break;
+ case GL_RGBA:
+ state->SourceRGB[2] = GL_TEXTURE;
+ break;
+ }
+ break;
+
+ case GL_BLEND:
+ mode_rgb = GL_INTERPOLATE;
+ mode_a = GL_MODULATE;
+
+ switch (texBaseFormat) {
+ case GL_ALPHA:
+ mode_rgb = GL_REPLACE;
+ break;
+ case GL_INTENSITY:
+ mode_a = GL_INTERPOLATE;
+ state->SourceA[0] = GL_CONSTANT;
+ state->OperandA[2] = GL_SRC_ALPHA;
+ /* FALLTHROUGH */
+ case GL_LUMINANCE:
+ case GL_RED:
+ case GL_RG:
+ case GL_RGB:
+ case GL_LUMINANCE_ALPHA:
+ case GL_RGBA:
+ case GL_YCBCR_MESA:
+ case GL_DUDV_ATI:
+ state->SourceRGB[2] = GL_TEXTURE;
+ state->SourceA[2] = GL_TEXTURE;
+ state->SourceRGB[0] = GL_CONSTANT;
+ state->OperandRGB[2] = GL_SRC_COLOR;
+ break;
+ }
+ break;
+
+ case GL_ADD:
+ mode_rgb = (texBaseFormat == GL_ALPHA) ? GL_REPLACE : GL_ADD;
+ mode_a = (texBaseFormat == GL_INTENSITY) ? GL_ADD : GL_MODULATE;
+ break;
+
+ default:
+ _mesa_problem(NULL,
+ "Invalid texture env mode 0x%x in calculate_derived_texenv",
+ mode);
+ return;
+ }
+
+ state->ModeRGB = (state->SourceRGB[0] != GL_PREVIOUS)
+ ? mode_rgb : GL_REPLACE;
+ state->ModeA = (state->SourceA[0] != GL_PREVIOUS)
+ ? mode_a : GL_REPLACE;
+}
+
+
+
+
+/* GL_ARB_multitexture */
+void GLAPIENTRY
+_mesa_ActiveTextureARB(GLenum texture)
+{
+ const GLuint texUnit = texture - GL_TEXTURE0;
+ GLuint k;
+ GET_CURRENT_CONTEXT(ctx);
+
+ /* See OpenGL spec for glActiveTexture: */
+ k = MAX2(ctx->Const.MaxCombinedTextureImageUnits,
+ ctx->Const.MaxTextureCoordUnits);
+
+ ASSERT(k <= Elements(ctx->Texture.Unit));
+
+ ASSERT_OUTSIDE_BEGIN_END(ctx);
+
+ if (MESA_VERBOSE & (VERBOSE_API|VERBOSE_TEXTURE))
+ _mesa_debug(ctx, "glActiveTexture %s\n",
+ _mesa_lookup_enum_by_nr(texture));
+
+ if (texUnit >= k) {
+ _mesa_error(ctx, GL_INVALID_ENUM, "glActiveTexture(texture=%s)",
+ _mesa_lookup_enum_by_nr(texture));
+ return;
+ }
+
+ if (ctx->Texture.CurrentUnit == texUnit)
+ return;
+
+ FLUSH_VERTICES(ctx, _NEW_TEXTURE);
+
+ ctx->Texture.CurrentUnit = texUnit;
+ if (ctx->Transform.MatrixMode == GL_TEXTURE) {
+ /* update current stack pointer */
+ ctx->CurrentStack = &ctx->TextureMatrixStack[texUnit];
+ }
+}
+
+
+/* GL_ARB_multitexture */
+void GLAPIENTRY
+_mesa_ClientActiveTextureARB(GLenum texture)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ GLuint texUnit = texture - GL_TEXTURE0;
+ ASSERT_OUTSIDE_BEGIN_END(ctx);
+
+ if (MESA_VERBOSE & (VERBOSE_API | VERBOSE_TEXTURE))
+ _mesa_debug(ctx, "glClientActiveTexture %s\n",
+ _mesa_lookup_enum_by_nr(texture));
+
+ if (texUnit >= ctx->Const.MaxTextureCoordUnits) {
+ _mesa_error(ctx, GL_INVALID_ENUM, "glClientActiveTexture(texture)");
+ return;
+ }
+
+ if (ctx->Array.ActiveTexture == texUnit)
+ return;
+
+ FLUSH_VERTICES(ctx, _NEW_ARRAY);
+ ctx->Array.ActiveTexture = texUnit;
+}
+
+
+
+/**********************************************************************/
+/***** State management *****/
+/**********************************************************************/
+
+
+/**
+ * \note This routine refers to derived texture attribute values to
+ * compute the ENABLE_TEXMAT flags, but is only called on
+ * _NEW_TEXTURE_MATRIX. On changes to _NEW_TEXTURE, the ENABLE_TEXMAT
+ * flags are updated by _mesa_update_textures(), below.
+ *
+ * \param ctx GL context.
+ */
+static void
+update_texture_matrices( struct gl_context *ctx )
+{
+ GLuint u;
+
+ ctx->Texture._TexMatEnabled = 0x0;
+
+ for (u = 0; u < ctx->Const.MaxTextureCoordUnits; u++) {
+ ASSERT(u < Elements(ctx->TextureMatrixStack));
+ if (_math_matrix_is_dirty(ctx->TextureMatrixStack[u].Top)) {
+ _math_matrix_analyse( ctx->TextureMatrixStack[u].Top );
+
+ if (ctx->Texture.Unit[u]._ReallyEnabled &&
+ ctx->TextureMatrixStack[u].Top->type != MATRIX_IDENTITY)
+ ctx->Texture._TexMatEnabled |= ENABLE_TEXMAT(u);
+ }
+ }
+}
+
+
+/**
+ * Examine texture unit's combine/env state to update derived state.
+ */
+static void
+update_tex_combine(struct gl_context *ctx, struct gl_texture_unit *texUnit)
+{
+ struct gl_tex_env_combine_state *combine;
+
+ /* Set the texUnit->_CurrentCombine field to point to the user's combiner
+ * state, or the combiner state which is derived from traditional texenv
+ * mode.
+ */
+ if (texUnit->EnvMode == GL_COMBINE ||
+ texUnit->EnvMode == GL_COMBINE4_NV) {
+ texUnit->_CurrentCombine = & texUnit->Combine;
+ }
+ else {
+ const struct gl_texture_object *texObj = texUnit->_Current;
+ GLenum format = texObj->Image[0][texObj->BaseLevel]->_BaseFormat;
+ if (format == GL_COLOR_INDEX) {
+ format = GL_RGBA; /* a bit of a hack */
+ }
+ else if (format == GL_DEPTH_COMPONENT ||
+ format == GL_DEPTH_STENCIL_EXT) {
+ format = texObj->Sampler.DepthMode;
+ }
+ calculate_derived_texenv(&texUnit->_EnvMode, texUnit->EnvMode, format);
+ texUnit->_CurrentCombine = & texUnit->_EnvMode;
+ }
+
+ combine = texUnit->_CurrentCombine;
+
+ /* Determine number of source RGB terms in the combiner function */
+ switch (combine->ModeRGB) {
+ case GL_REPLACE:
+ combine->_NumArgsRGB = 1;
+ break;
+ case GL_ADD:
+ case GL_ADD_SIGNED:
+ if (texUnit->EnvMode == GL_COMBINE4_NV)
+ combine->_NumArgsRGB = 4;
+ else
+ combine->_NumArgsRGB = 2;
+ break;
+ case GL_MODULATE:
+ case GL_SUBTRACT:
+ case GL_DOT3_RGB:
+ case GL_DOT3_RGBA:
+ case GL_DOT3_RGB_EXT:
+ case GL_DOT3_RGBA_EXT:
+ combine->_NumArgsRGB = 2;
+ break;
+ case GL_INTERPOLATE:
+ case GL_MODULATE_ADD_ATI:
+ case GL_MODULATE_SIGNED_ADD_ATI:
+ case GL_MODULATE_SUBTRACT_ATI:
+ combine->_NumArgsRGB = 3;
+ break;
+ case GL_BUMP_ENVMAP_ATI:
+ /* no real arguments for this case */
+ combine->_NumArgsRGB = 0;
+ break;
+ default:
+ combine->_NumArgsRGB = 0;
+ _mesa_problem(ctx, "invalid RGB combine mode in update_texture_state");
+ return;
+ }
+
+ /* Determine number of source Alpha terms in the combiner function */
+ switch (combine->ModeA) {
+ case GL_REPLACE:
+ combine->_NumArgsA = 1;
+ break;
+ case GL_ADD:
+ case GL_ADD_SIGNED:
+ if (texUnit->EnvMode == GL_COMBINE4_NV)
+ combine->_NumArgsA = 4;
+ else
+ combine->_NumArgsA = 2;
+ break;
+ case GL_MODULATE:
+ case GL_SUBTRACT:
+ combine->_NumArgsA = 2;
+ break;
+ case GL_INTERPOLATE:
+ case GL_MODULATE_ADD_ATI:
+ case GL_MODULATE_SIGNED_ADD_ATI:
+ case GL_MODULATE_SUBTRACT_ATI:
+ combine->_NumArgsA = 3;
+ break;
+ default:
+ combine->_NumArgsA = 0;
+ _mesa_problem(ctx, "invalid Alpha combine mode in update_texture_state");
+ break;
+ }
+}
+
+
+/**
+ * \note This routine refers to derived texture matrix values to
+ * compute the ENABLE_TEXMAT flags, but is only called on
+ * _NEW_TEXTURE. On changes to _NEW_TEXTURE_MATRIX, the ENABLE_TEXMAT
+ * flags are updated by _mesa_update_texture_matrices, above.
+ *
+ * \param ctx GL context.
+ */
+static void
+update_texture_state( struct gl_context *ctx )
+{
+ GLuint unit;
+ struct gl_fragment_program *fprog = NULL;
+ struct gl_vertex_program *vprog = NULL;
+ GLbitfield enabledFragUnits = 0x0;
+
+ if (ctx->Shader.CurrentVertexProgram &&
+ ctx->Shader.CurrentVertexProgram->LinkStatus) {
+ vprog = ctx->Shader.CurrentVertexProgram->VertexProgram;
+ } else if (ctx->VertexProgram._Enabled) {
+ /* XXX enable this if/when non-shader vertex programs get
+ * texture fetches:
+ vprog = ctx->VertexProgram.Current;
+ */
+ }
+
+ if (ctx->Shader.CurrentFragmentProgram &&
+ ctx->Shader.CurrentFragmentProgram->LinkStatus) {
+ fprog = ctx->Shader.CurrentFragmentProgram->FragmentProgram;
+ }
+ else if (ctx->FragmentProgram._Enabled) {
+ fprog = ctx->FragmentProgram.Current;
+ }
+
+ /* FINISHME: Geometry shader texture accesses should also be considered
+ * FINISHME: here.
+ */
+
+ /* TODO: only set this if there are actual changes */
+ ctx->NewState |= _NEW_TEXTURE;
+
+ ctx->Texture._EnabledUnits = 0x0;
+ ctx->Texture._GenFlags = 0x0;
+ ctx->Texture._TexMatEnabled = 0x0;
+ ctx->Texture._TexGenEnabled = 0x0;
+
+ /*
+ * Update texture unit state.
+ */
+ for (unit = 0; unit < ctx->Const.MaxCombinedTextureImageUnits; unit++) {
+ struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit];
+ GLbitfield enabledVertTargets = 0x0;
+ GLbitfield enabledFragTargets = 0x0;
+ GLbitfield enabledTargets = 0x0;
+ GLuint texIndex;
+
+ /* Get the bitmask of texture target enables.
+ * enableBits will be a mask of the TEXTURE_*_BIT flags indicating
+ * which texture targets are enabled (fixed function) or referenced
+ * by a fragment program/program. When multiple flags are set, we'll
+ * settle on the one with highest priority (see below).
+ */
+ if (vprog) {
+ enabledVertTargets |= vprog->Base.TexturesUsed[unit];
+ }
+
+ if (fprog) {
+ enabledFragTargets |= fprog->Base.TexturesUsed[unit];
+ }
+ else {
+ /* fixed-function fragment program */
+ enabledFragTargets |= texUnit->Enabled;
+ }
+
+ enabledTargets = enabledVertTargets | enabledFragTargets;
+
+ texUnit->_ReallyEnabled = 0x0;
+
+ if (enabledTargets == 0x0) {
+ /* neither vertex nor fragment processing uses this unit */
+ continue;
+ }
+
+ /* Look for the highest priority texture target that's enabled (or used
+ * by the vert/frag shaders) and "complete". That's the one we'll use
+ * for texturing. If we're using vert/frag program we're guaranteed
+ * that bitcount(enabledBits) <= 1.
+ * Note that the TEXTURE_x_INDEX values are in high to low priority.
+ */
+ for (texIndex = 0; texIndex < NUM_TEXTURE_TARGETS; texIndex++) {
+ if (enabledTargets & (1 << texIndex)) {
+ struct gl_texture_object *texObj = texUnit->CurrentTex[texIndex];
+ if (!texObj->_Complete) {
+ _mesa_test_texobj_completeness(ctx, texObj);
+ }
+ if (texObj->_Complete) {
+ texUnit->_ReallyEnabled = 1 << texIndex;
+ _mesa_reference_texobj(&texUnit->_Current, texObj);
+ break;
+ }
+ }
+ }
+
+ if (!texUnit->_ReallyEnabled) {
+ if (fprog) {
+ /* If we get here it means the shader is expecting a texture
+ * object, but there isn't one (or it's incomplete). Use the
+ * fallback texture.
+ */
+ struct gl_texture_object *texObj = _mesa_get_fallback_texture(ctx);
+ texUnit->_ReallyEnabled = 1 << TEXTURE_2D_INDEX;
+ _mesa_reference_texobj(&texUnit->_Current, texObj);
+ }
+ else {
+ /* fixed-function: texture unit is really disabled */
+ continue;
+ }
+ }
+
+ /* if we get here, we know this texture unit is enabled */
+
+ ctx->Texture._EnabledUnits |= (1 << unit);
+
+ if (enabledFragTargets)
+ enabledFragUnits |= (1 << unit);
+
+ update_tex_combine(ctx, texUnit);
+ }
+
+
+ /* Determine which texture coordinate sets are actually needed */
+ if (fprog) {
+ const GLuint coordMask = (1 << MAX_TEXTURE_COORD_UNITS) - 1;
+ ctx->Texture._EnabledCoordUnits
+ = (fprog->Base.InputsRead >> FRAG_ATTRIB_TEX0) & coordMask;
+ }
+ else {
+ ctx->Texture._EnabledCoordUnits = enabledFragUnits;
+ }
+
+ /* Setup texgen for those texture coordinate sets that are in use */
+ for (unit = 0; unit < ctx->Const.MaxTextureCoordUnits; unit++) {
+ struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit];
+
+ texUnit->_GenFlags = 0x0;
+
+ if (!(ctx->Texture._EnabledCoordUnits & (1 << unit)))
+ continue;
+
+ if (texUnit->TexGenEnabled) {
+ if (texUnit->TexGenEnabled & S_BIT) {
+ texUnit->_GenFlags |= texUnit->GenS._ModeBit;
+ }
+ if (texUnit->TexGenEnabled & T_BIT) {
+ texUnit->_GenFlags |= texUnit->GenT._ModeBit;
+ }
+ if (texUnit->TexGenEnabled & R_BIT) {
+ texUnit->_GenFlags |= texUnit->GenR._ModeBit;
+ }
+ if (texUnit->TexGenEnabled & Q_BIT) {
+ texUnit->_GenFlags |= texUnit->GenQ._ModeBit;
+ }
+
+ ctx->Texture._TexGenEnabled |= ENABLE_TEXGEN(unit);
+ ctx->Texture._GenFlags |= texUnit->_GenFlags;
+ }
+
+ ASSERT(unit < Elements(ctx->TextureMatrixStack));
+ if (ctx->TextureMatrixStack[unit].Top->type != MATRIX_IDENTITY)
+ ctx->Texture._TexMatEnabled |= ENABLE_TEXMAT(unit);
+ }
+}
+
+
+/**
+ * Update texture-related derived state.
+ */
+void
+_mesa_update_texture( struct gl_context *ctx, GLuint new_state )
+{
+ if (new_state & _NEW_TEXTURE_MATRIX)
+ update_texture_matrices( ctx );
+
+ if (new_state & (_NEW_TEXTURE | _NEW_PROGRAM))
+ update_texture_state( ctx );
+}
+
+
+/**********************************************************************/
+/***** Initialization *****/
+/**********************************************************************/
+
+/**
+ * Allocate the proxy textures for the given context.
+ *
+ * \param ctx the context to allocate proxies for.
+ *
+ * \return GL_TRUE on success, or GL_FALSE on failure
+ *
+ * If run out of memory part way through the allocations, clean up and return
+ * GL_FALSE.
+ */
+static GLboolean
+alloc_proxy_textures( struct gl_context *ctx )
+{
+ static const GLenum targets[] = {
+ GL_TEXTURE_1D,
+ GL_TEXTURE_2D,
+ GL_TEXTURE_3D,
+ GL_TEXTURE_CUBE_MAP_ARB,
+ GL_TEXTURE_RECTANGLE_NV,
+ GL_TEXTURE_1D_ARRAY_EXT,
+ GL_TEXTURE_2D_ARRAY_EXT,
+ GL_TEXTURE_BUFFER
+ };
+ GLint tgt;
+
+ ASSERT(Elements(targets) == NUM_TEXTURE_TARGETS);
+
+ for (tgt = 0; tgt < NUM_TEXTURE_TARGETS; tgt++) {
+ if (!(ctx->Texture.ProxyTex[tgt]
+ = ctx->Driver.NewTextureObject(ctx, 0, targets[tgt]))) {
+ /* out of memory, free what we did allocate */
+ while (--tgt >= 0) {
+ ctx->Driver.DeleteTexture(ctx, ctx->Texture.ProxyTex[tgt]);
+ }
+ return GL_FALSE;
+ }
+ }
+
+ assert(ctx->Texture.ProxyTex[0]->RefCount == 1); /* sanity check */
+ return GL_TRUE;
+}
+
+
+/**
+ * Initialize a texture unit.
+ *
+ * \param ctx GL context.
+ * \param unit texture unit number to be initialized.
+ */
+static void
+init_texture_unit( struct gl_context *ctx, GLuint unit )
+{
+ struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit];
+ GLuint tex;
+
+ texUnit->EnvMode = GL_MODULATE;
+ ASSIGN_4V( texUnit->EnvColor, 0.0, 0.0, 0.0, 0.0 );
+
+ texUnit->Combine = default_combine_state;
+ texUnit->_EnvMode = default_combine_state;
+ texUnit->_CurrentCombine = & texUnit->_EnvMode;
+ texUnit->BumpTarget = GL_TEXTURE0;
+
+ texUnit->TexGenEnabled = 0x0;
+ texUnit->GenS.Mode = GL_EYE_LINEAR;
+ texUnit->GenT.Mode = GL_EYE_LINEAR;
+ texUnit->GenR.Mode = GL_EYE_LINEAR;
+ texUnit->GenQ.Mode = GL_EYE_LINEAR;
+ texUnit->GenS._ModeBit = TEXGEN_EYE_LINEAR;
+ texUnit->GenT._ModeBit = TEXGEN_EYE_LINEAR;
+ texUnit->GenR._ModeBit = TEXGEN_EYE_LINEAR;
+ texUnit->GenQ._ModeBit = TEXGEN_EYE_LINEAR;
+
+ /* Yes, these plane coefficients are correct! */
+ ASSIGN_4V( texUnit->GenS.ObjectPlane, 1.0, 0.0, 0.0, 0.0 );
+ ASSIGN_4V( texUnit->GenT.ObjectPlane, 0.0, 1.0, 0.0, 0.0 );
+ ASSIGN_4V( texUnit->GenR.ObjectPlane, 0.0, 0.0, 0.0, 0.0 );
+ ASSIGN_4V( texUnit->GenQ.ObjectPlane, 0.0, 0.0, 0.0, 0.0 );
+ ASSIGN_4V( texUnit->GenS.EyePlane, 1.0, 0.0, 0.0, 0.0 );
+ ASSIGN_4V( texUnit->GenT.EyePlane, 0.0, 1.0, 0.0, 0.0 );
+ ASSIGN_4V( texUnit->GenR.EyePlane, 0.0, 0.0, 0.0, 0.0 );
+ ASSIGN_4V( texUnit->GenQ.EyePlane, 0.0, 0.0, 0.0, 0.0 );
+
+ /* no mention of this in spec, but maybe id matrix expected? */
+ ASSIGN_4V( texUnit->RotMatrix, 1.0, 0.0, 0.0, 1.0 );
+
+ /* initialize current texture object ptrs to the shared default objects */
+ for (tex = 0; tex < NUM_TEXTURE_TARGETS; tex++) {
+ _mesa_reference_texobj(&texUnit->CurrentTex[tex],
+ ctx->Shared->DefaultTex[tex]);
+ }
+}
+
+
+/**
+ * Initialize texture state for the given context.
+ */
+GLboolean
+_mesa_init_texture(struct gl_context *ctx)
+{
+ GLuint u;
+
+ /* Texture group */
+ ctx->Texture.CurrentUnit = 0; /* multitexture */
+ ctx->Texture._EnabledUnits = 0x0;
+ ctx->Texture.SharedPalette = GL_FALSE;
+ _mesa_init_colortable(&ctx->Texture.Palette);
+
+ for (u = 0; u < Elements(ctx->Texture.Unit); u++)
+ init_texture_unit(ctx, u);
+
+ /* After we're done initializing the context's texture state the default
+ * texture objects' refcounts should be at least
+ * MAX_COMBINED_TEXTURE_IMAGE_UNITS + 1.
+ */
+ assert(ctx->Shared->DefaultTex[TEXTURE_1D_INDEX]->RefCount
+ >= MAX_COMBINED_TEXTURE_IMAGE_UNITS + 1);
+
+ /* Allocate proxy textures */
+ if (!alloc_proxy_textures( ctx ))
+ return GL_FALSE;
+
+ /* GL_ARB_texture_buffer_object */
+ _mesa_reference_buffer_object(ctx, &ctx->Texture.BufferObject,
+ ctx->Shared->NullBufferObj);
+
+ return GL_TRUE;
+}
+
+
+/**
+ * Free dynamically-allocted texture data attached to the given context.
+ */
+void
+_mesa_free_texture_data(struct gl_context *ctx)
+{
+ GLuint u, tgt;
+
+ /* unreference current textures */
+ for (u = 0; u < Elements(ctx->Texture.Unit); u++) {
+ /* The _Current texture could account for another reference */
+ _mesa_reference_texobj(&ctx->Texture.Unit[u]._Current, NULL);
+
+ for (tgt = 0; tgt < NUM_TEXTURE_TARGETS; tgt++) {
+ _mesa_reference_texobj(&ctx->Texture.Unit[u].CurrentTex[tgt], NULL);
+ }
+ }
+
+ /* Free proxy texture objects */
+ for (tgt = 0; tgt < NUM_TEXTURE_TARGETS; tgt++)
+ ctx->Driver.DeleteTexture(ctx, ctx->Texture.ProxyTex[tgt]);
+
+ /* GL_ARB_texture_buffer_object */
+ _mesa_reference_buffer_object(ctx, &ctx->Texture.BufferObject, NULL);
+
+#if FEATURE_sampler_objects
+ for (u = 0; u < Elements(ctx->Texture.Unit); u++) {
+ _mesa_reference_sampler_object(ctx, &ctx->Texture.Unit[u].Sampler, NULL);
+ }
+#endif
+}
+
+
+/**
+ * Update the default texture objects in the given context to reference those
+ * specified in the shared state and release those referencing the old
+ * shared state.
+ */
+void
+_mesa_update_default_objects_texture(struct gl_context *ctx)
+{
+ GLuint u, tex;
+
+ for (u = 0; u < Elements(ctx->Texture.Unit); u++) {
+ struct gl_texture_unit *texUnit = &ctx->Texture.Unit[u];
+ for (tex = 0; tex < NUM_TEXTURE_TARGETS; tex++) {
+ _mesa_reference_texobj(&texUnit->CurrentTex[tex],
+ ctx->Shared->DefaultTex[tex]);
+ }
+ }
+}
diff --git a/mesalib/src/mesa/main/texstore.h b/mesalib/src/mesa/main/texstore.h
index d56318709..1d0ce7d4a 100644
--- a/mesalib/src/mesa/main/texstore.h
+++ b/mesalib/src/mesa/main/texstore.h
@@ -1,209 +1,209 @@
-/*
- * Mesa 3-D graphics library
- * Version: 6.5.1
- *
- * Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
- * Copyright (c) 2008 VMware, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-
-/**
- * \file texstore.h
- * Texture image storage routines.
- *
- * \author Brian Paul
- */
-
-
-#ifndef TEXSTORE_H
-#define TEXSTORE_H
-
-
-#include "mtypes.h"
-#include "formats.h"
-
-
-/**
- * This macro defines the (many) parameters to the texstore functions.
- * \param dims either 1 or 2 or 3
- * \param baseInternalFormat user-specified base internal format
- * \param dstFormat destination Mesa texture format
- * \param dstAddr destination image address
- * \param dstX/Y/Zoffset destination x/y/z offset (ala TexSubImage), in texels
- * \param dstRowStride destination image row stride, in bytes
- * \param dstImageOffsets offset of each 2D slice within 3D texture, in texels
- * \param srcWidth/Height/Depth source image size, in pixels
- * \param srcFormat incoming image format
- * \param srcType incoming image data type
- * \param srcAddr source image address
- * \param srcPacking source image packing parameters
- */
-#define TEXSTORE_PARAMS \
- struct gl_context *ctx, GLuint dims, \
- GLenum baseInternalFormat, \
- gl_format dstFormat, \
- GLvoid *dstAddr, \
- GLint dstXoffset, GLint dstYoffset, GLint dstZoffset, \
- GLint dstRowStride, const GLuint *dstImageOffsets, \
- GLint srcWidth, GLint srcHeight, GLint srcDepth, \
- GLenum srcFormat, GLenum srcType, \
- const GLvoid *srcAddr, \
- const struct gl_pixelstore_attrib *srcPacking
-
-
-extern GLboolean
-_mesa_texstore(TEXSTORE_PARAMS);
-
-
-extern GLchan *
-_mesa_make_temp_chan_image(struct gl_context *ctx, GLuint dims,
- GLenum logicalBaseFormat,
- GLenum textureBaseFormat,
- GLint srcWidth, GLint srcHeight, GLint srcDepth,
- GLenum srcFormat, GLenum srcType,
- const GLvoid *srcAddr,
- const struct gl_pixelstore_attrib *srcPacking);
-
-GLfloat *
-_mesa_make_temp_float_image(struct gl_context *ctx, GLuint dims,
- GLenum logicalBaseFormat,
- GLenum textureBaseFormat,
- GLint srcWidth, GLint srcHeight, GLint srcDepth,
- GLenum srcFormat, GLenum srcType,
- const GLvoid *srcAddr,
- const struct gl_pixelstore_attrib *srcPacking,
- GLbitfield transferOps);
-
-extern void
-_mesa_store_teximage1d(struct gl_context *ctx, GLenum target, GLint level,
- GLint internalFormat,
- GLint width, GLint border,
- GLenum format, GLenum type, const GLvoid *pixels,
- const struct gl_pixelstore_attrib *packing,
- struct gl_texture_object *texObj,
- struct gl_texture_image *texImage);
-
-
-extern void
-_mesa_store_teximage2d(struct gl_context *ctx, GLenum target, GLint level,
- GLint internalFormat,
- GLint width, GLint height, GLint border,
- GLenum format, GLenum type, const GLvoid *pixels,
- const struct gl_pixelstore_attrib *packing,
- struct gl_texture_object *texObj,
- struct gl_texture_image *texImage);
-
-
-extern void
-_mesa_store_teximage3d(struct gl_context *ctx, GLenum target, GLint level,
- GLint internalFormat,
- GLint width, GLint height, GLint depth, GLint border,
- GLenum format, GLenum type, const GLvoid *pixels,
- const struct gl_pixelstore_attrib *packing,
- struct gl_texture_object *texObj,
- struct gl_texture_image *texImage);
-
-
-extern void
-_mesa_store_texsubimage1d(struct gl_context *ctx, GLenum target, GLint level,
- GLint xoffset, GLint width,
- GLenum format, GLenum type, const GLvoid *pixels,
- const struct gl_pixelstore_attrib *packing,
- struct gl_texture_object *texObj,
- struct gl_texture_image *texImage);
-
-
-extern void
-_mesa_store_texsubimage2d(struct gl_context *ctx, GLenum target, GLint level,
- GLint xoffset, GLint yoffset,
- GLint width, GLint height,
- GLenum format, GLenum type, const GLvoid *pixels,
- const struct gl_pixelstore_attrib *packing,
- struct gl_texture_object *texObj,
- struct gl_texture_image *texImage);
-
-
-extern void
-_mesa_store_texsubimage3d(struct gl_context *ctx, GLenum target, GLint level,
- GLint xoffset, GLint yoffset, GLint zoffset,
- GLint width, GLint height, GLint depth,
- GLenum format, GLenum type, const GLvoid *pixels,
- const struct gl_pixelstore_attrib *packing,
- struct gl_texture_object *texObj,
- struct gl_texture_image *texImage);
-
-
-extern void
-_mesa_store_compressed_teximage1d(struct gl_context *ctx, GLenum target, GLint level,
- GLint internalFormat,
- GLint width, GLint border,
- GLsizei imageSize, const GLvoid *data,
- struct gl_texture_object *texObj,
- struct gl_texture_image *texImage);
-
-extern void
-_mesa_store_compressed_teximage2d(struct gl_context *ctx, GLenum target, GLint level,
- GLint internalFormat,
- GLint width, GLint height, GLint border,
- GLsizei imageSize, const GLvoid *data,
- struct gl_texture_object *texObj,
- struct gl_texture_image *texImage);
-
-extern void
-_mesa_store_compressed_teximage3d(struct gl_context *ctx, GLenum target, GLint level,
- GLint internalFormat,
- GLint width, GLint height, GLint depth,
- GLint border,
- GLsizei imageSize, const GLvoid *data,
- struct gl_texture_object *texObj,
- struct gl_texture_image *texImage);
-
-
-extern void
-_mesa_store_compressed_texsubimage1d(struct gl_context *ctx, GLenum target,
- GLint level,
- GLint xoffset, GLsizei width,
- GLenum format,
- GLsizei imageSize, const GLvoid *data,
- struct gl_texture_object *texObj,
- struct gl_texture_image *texImage);
-
-extern void
-_mesa_store_compressed_texsubimage2d(struct gl_context *ctx, GLenum target,
- GLint level,
- GLint xoffset, GLint yoffset,
- GLsizei width, GLsizei height,
- GLenum format,
- GLsizei imageSize, const GLvoid *data,
- struct gl_texture_object *texObj,
- struct gl_texture_image *texImage);
-
-extern void
-_mesa_store_compressed_texsubimage3d(struct gl_context *ctx, GLenum target,
- GLint level,
- GLint xoffset, GLint yoffset, GLint zoffset,
- GLsizei width, GLsizei height, GLsizei depth,
- GLenum format,
- GLsizei imageSize, const GLvoid *data,
- struct gl_texture_object *texObj,
- struct gl_texture_image *texImage);
-
-
-#endif
+/*
+ * Mesa 3-D graphics library
+ * Version: 6.5.1
+ *
+ * Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
+ * Copyright (c) 2008 VMware, Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+
+/**
+ * \file texstore.h
+ * Texture image storage routines.
+ *
+ * \author Brian Paul
+ */
+
+
+#ifndef TEXSTORE_H
+#define TEXSTORE_H
+
+
+#include "mtypes.h"
+#include "formats.h"
+
+
+/**
+ * This macro defines the (many) parameters to the texstore functions.
+ * \param dims either 1 or 2 or 3
+ * \param baseInternalFormat user-specified base internal format
+ * \param dstFormat destination Mesa texture format
+ * \param dstAddr destination image address
+ * \param dstX/Y/Zoffset destination x/y/z offset (ala TexSubImage), in texels
+ * \param dstRowStride destination image row stride, in bytes
+ * \param dstImageOffsets offset of each 2D slice within 3D texture, in texels
+ * \param srcWidth/Height/Depth source image size, in pixels
+ * \param srcFormat incoming image format
+ * \param srcType incoming image data type
+ * \param srcAddr source image address
+ * \param srcPacking source image packing parameters
+ */
+#define TEXSTORE_PARAMS \
+ struct gl_context *ctx, GLuint dims, \
+ GLenum baseInternalFormat, \
+ gl_format dstFormat, \
+ GLvoid *dstAddr, \
+ GLint dstXoffset, GLint dstYoffset, GLint dstZoffset, \
+ GLint dstRowStride, const GLuint *dstImageOffsets, \
+ GLint srcWidth, GLint srcHeight, GLint srcDepth, \
+ GLenum srcFormat, GLenum srcType, \
+ const GLvoid *srcAddr, \
+ const struct gl_pixelstore_attrib *srcPacking
+
+
+extern GLboolean
+_mesa_texstore(TEXSTORE_PARAMS);
+
+
+extern GLchan *
+_mesa_make_temp_chan_image(struct gl_context *ctx, GLuint dims,
+ GLenum logicalBaseFormat,
+ GLenum textureBaseFormat,
+ GLint srcWidth, GLint srcHeight, GLint srcDepth,
+ GLenum srcFormat, GLenum srcType,
+ const GLvoid *srcAddr,
+ const struct gl_pixelstore_attrib *srcPacking);
+
+GLfloat *
+_mesa_make_temp_float_image(struct gl_context *ctx, GLuint dims,
+ GLenum logicalBaseFormat,
+ GLenum textureBaseFormat,
+ GLint srcWidth, GLint srcHeight, GLint srcDepth,
+ GLenum srcFormat, GLenum srcType,
+ const GLvoid *srcAddr,
+ const struct gl_pixelstore_attrib *srcPacking,
+ GLbitfield transferOps);
+
+extern void
+_mesa_store_teximage1d(struct gl_context *ctx, GLenum target, GLint level,
+ GLint internalFormat,
+ GLint width, GLint border,
+ GLenum format, GLenum type, const GLvoid *pixels,
+ const struct gl_pixelstore_attrib *packing,
+ struct gl_texture_object *texObj,
+ struct gl_texture_image *texImage);
+
+
+extern void
+_mesa_store_teximage2d(struct gl_context *ctx, GLenum target, GLint level,
+ GLint internalFormat,
+ GLint width, GLint height, GLint border,
+ GLenum format, GLenum type, const GLvoid *pixels,
+ const struct gl_pixelstore_attrib *packing,
+ struct gl_texture_object *texObj,
+ struct gl_texture_image *texImage);
+
+
+extern void
+_mesa_store_teximage3d(struct gl_context *ctx, GLenum target, GLint level,
+ GLint internalFormat,
+ GLint width, GLint height, GLint depth, GLint border,
+ GLenum format, GLenum type, const GLvoid *pixels,
+ const struct gl_pixelstore_attrib *packing,
+ struct gl_texture_object *texObj,
+ struct gl_texture_image *texImage);
+
+
+extern void
+_mesa_store_texsubimage1d(struct gl_context *ctx, GLenum target, GLint level,
+ GLint xoffset, GLint width,
+ GLenum format, GLenum type, const GLvoid *pixels,
+ const struct gl_pixelstore_attrib *packing,
+ struct gl_texture_object *texObj,
+ struct gl_texture_image *texImage);
+
+
+extern void
+_mesa_store_texsubimage2d(struct gl_context *ctx, GLenum target, GLint level,
+ GLint xoffset, GLint yoffset,
+ GLint width, GLint height,
+ GLenum format, GLenum type, const GLvoid *pixels,
+ const struct gl_pixelstore_attrib *packing,
+ struct gl_texture_object *texObj,
+ struct gl_texture_image *texImage);
+
+
+extern void
+_mesa_store_texsubimage3d(struct gl_context *ctx, GLenum target, GLint level,
+ GLint xoffset, GLint yoffset, GLint zoffset,
+ GLint width, GLint height, GLint depth,
+ GLenum format, GLenum type, const GLvoid *pixels,
+ const struct gl_pixelstore_attrib *packing,
+ struct gl_texture_object *texObj,
+ struct gl_texture_image *texImage);
+
+
+extern void
+_mesa_store_compressed_teximage1d(struct gl_context *ctx, GLenum target, GLint level,
+ GLint internalFormat,
+ GLint width, GLint border,
+ GLsizei imageSize, const GLvoid *data,
+ struct gl_texture_object *texObj,
+ struct gl_texture_image *texImage);
+
+extern void
+_mesa_store_compressed_teximage2d(struct gl_context *ctx, GLenum target, GLint level,
+ GLint internalFormat,
+ GLint width, GLint height, GLint border,
+ GLsizei imageSize, const GLvoid *data,
+ struct gl_texture_object *texObj,
+ struct gl_texture_image *texImage);
+
+extern void
+_mesa_store_compressed_teximage3d(struct gl_context *ctx, GLenum target, GLint level,
+ GLint internalFormat,
+ GLint width, GLint height, GLint depth,
+ GLint border,
+ GLsizei imageSize, const GLvoid *data,
+ struct gl_texture_object *texObj,
+ struct gl_texture_image *texImage);
+
+
+extern void
+_mesa_store_compressed_texsubimage1d(struct gl_context *ctx, GLenum target,
+ GLint level,
+ GLint xoffset, GLsizei width,
+ GLenum format,
+ GLsizei imageSize, const GLvoid *data,
+ struct gl_texture_object *texObj,
+ struct gl_texture_image *texImage);
+
+extern void
+_mesa_store_compressed_texsubimage2d(struct gl_context *ctx, GLenum target,
+ GLint level,
+ GLint xoffset, GLint yoffset,
+ GLsizei width, GLsizei height,
+ GLenum format,
+ GLsizei imageSize, const GLvoid *data,
+ struct gl_texture_object *texObj,
+ struct gl_texture_image *texImage);
+
+extern void
+_mesa_store_compressed_texsubimage3d(struct gl_context *ctx, GLenum target,
+ GLint level,
+ GLint xoffset, GLint yoffset, GLint zoffset,
+ GLsizei width, GLsizei height, GLsizei depth,
+ GLenum format,
+ GLsizei imageSize, const GLvoid *data,
+ struct gl_texture_object *texObj,
+ struct gl_texture_image *texImage);
+
+
+#endif
diff --git a/mesalib/src/mesa/main/uniforms.c b/mesalib/src/mesa/main/uniforms.c
index 12fe7b5e2..8d934642e 100644
--- a/mesalib/src/mesa/main/uniforms.c
+++ b/mesalib/src/mesa/main/uniforms.c
@@ -1,1537 +1,1537 @@
-/*
- * Mesa 3-D graphics library
- *
- * Copyright (C) 2004-2008 Brian Paul All Rights Reserved.
- * Copyright (C) 2009-2010 VMware, Inc. All Rights Reserved.
- * Copyright © 2010 Intel Corporation
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-/**
- * \file uniforms.c
- * Functions related to GLSL uniform variables.
- * \author Brian Paul
- */
-
-/**
- * XXX things to do:
- * 1. Check that the right error code is generated for all _mesa_error() calls.
- * 2. Insert FLUSH_VERTICES calls in various places
- */
-
-
-#include "main/glheader.h"
-#include "main/context.h"
-#include "main/dispatch.h"
-#include "main/mfeatures.h"
-#include "main/mtypes.h"
-#include "main/shaderapi.h"
-#include "main/shaderobj.h"
-#include "main/uniforms.h"
-#include "program/prog_parameter.h"
-#include "program/prog_statevars.h"
-#include "program/prog_uniform.h"
-#include "program/prog_instruction.h"
-
-
-static GLenum
-base_uniform_type(GLenum type)
-{
- switch (type) {
-#if 0 /* not needed, for now */
- case GL_BOOL:
- case GL_BOOL_VEC2:
- case GL_BOOL_VEC3:
- case GL_BOOL_VEC4:
- return GL_BOOL;
-#endif
- case GL_FLOAT:
- case GL_FLOAT_VEC2:
- case GL_FLOAT_VEC3:
- case GL_FLOAT_VEC4:
- return GL_FLOAT;
- case GL_UNSIGNED_INT:
- case GL_UNSIGNED_INT_VEC2:
- case GL_UNSIGNED_INT_VEC3:
- case GL_UNSIGNED_INT_VEC4:
- return GL_UNSIGNED_INT;
- case GL_INT:
- case GL_INT_VEC2:
- case GL_INT_VEC3:
- case GL_INT_VEC4:
- return GL_INT;
- default:
- _mesa_problem(NULL, "Invalid type in base_uniform_type()");
- return GL_FLOAT;
- }
-}
-
-
-static GLboolean
-is_boolean_type(GLenum type)
-{
- switch (type) {
- case GL_BOOL:
- case GL_BOOL_VEC2:
- case GL_BOOL_VEC3:
- case GL_BOOL_VEC4:
- return GL_TRUE;
- default:
- return GL_FALSE;
- }
-}
-
-
-static GLboolean
-is_sampler_type(GLenum type)
-{
- switch (type) {
- case GL_SAMPLER_1D:
- case GL_SAMPLER_2D:
- case GL_SAMPLER_3D:
- case GL_SAMPLER_CUBE:
- case GL_SAMPLER_1D_SHADOW:
- case GL_SAMPLER_2D_SHADOW:
- case GL_SAMPLER_2D_RECT_ARB:
- case GL_SAMPLER_2D_RECT_SHADOW_ARB:
- case GL_SAMPLER_1D_ARRAY_EXT:
- case GL_SAMPLER_2D_ARRAY_EXT:
- case GL_SAMPLER_1D_ARRAY_SHADOW_EXT:
- case GL_SAMPLER_2D_ARRAY_SHADOW_EXT:
- return GL_TRUE;
- default:
- return GL_FALSE;
- }
-}
-
-
-static struct gl_program_parameter *
-get_uniform_parameter(const struct gl_shader_program *shProg, GLuint index)
-{
- const struct gl_program *prog = NULL;
- GLint progPos;
-
- progPos = shProg->Uniforms->Uniforms[index].VertPos;
- if (progPos >= 0) {
- prog = &shProg->VertexProgram->Base;
- }
- else {
- progPos = shProg->Uniforms->Uniforms[index].FragPos;
- if (progPos >= 0) {
- prog = &shProg->FragmentProgram->Base;
- } else {
- progPos = shProg->Uniforms->Uniforms[index].GeomPos;
- if (progPos >= 0) {
- prog = &shProg->GeometryProgram->Base;
- }
- }
- }
-
- if (!prog || progPos < 0)
- return NULL; /* should never happen */
-
- return &prog->Parameters->Parameters[progPos];
-}
-
-
-/**
- * Called by glGetActiveUniform().
- */
-static void
-_mesa_get_active_uniform(struct gl_context *ctx, GLuint program, GLuint index,
- GLsizei maxLength, GLsizei *length, GLint *size,
- GLenum *type, GLchar *nameOut)
-{
- const struct gl_shader_program *shProg;
- const struct gl_program *prog = NULL;
- const struct gl_program_parameter *param;
- GLint progPos;
-
- shProg = _mesa_lookup_shader_program_err(ctx, program, "glGetActiveUniform");
- if (!shProg)
- return;
-
- if (!shProg->Uniforms || index >= shProg->Uniforms->NumUniforms) {
- _mesa_error(ctx, GL_INVALID_VALUE, "glGetActiveUniform(index)");
- return;
- }
-
- progPos = shProg->Uniforms->Uniforms[index].VertPos;
- if (progPos >= 0) {
- prog = &shProg->VertexProgram->Base;
- }
- else {
- progPos = shProg->Uniforms->Uniforms[index].FragPos;
- if (progPos >= 0) {
- prog = &shProg->FragmentProgram->Base;
- } else {
- progPos = shProg->Uniforms->Uniforms[index].GeomPos;
- if (progPos >= 0) {
- prog = &shProg->GeometryProgram->Base;
- }
- }
- }
-
- if (!prog || progPos < 0)
- return; /* should never happen */
-
- ASSERT(progPos < prog->Parameters->NumParameters);
- param = &prog->Parameters->Parameters[progPos];
-
- if (nameOut) {
- _mesa_copy_string(nameOut, maxLength, length, param->Name);
- }
-
- if (size) {
- GLint typeSize = _mesa_sizeof_glsl_type(param->DataType);
- if ((GLint) param->Size > typeSize) {
- /* This is an array.
- * Array elements are placed on vector[4] boundaries so they're
- * a multiple of four floats. We round typeSize up to next multiple
- * of four to get the right size below.
- */
- typeSize = (typeSize + 3) & ~3;
- }
- /* Note that the returned size is in units of the <type>, not bytes */
- *size = param->Size / typeSize;
- }
-
- if (type) {
- *type = param->DataType;
- }
-}
-
-
-static unsigned
-get_vector_elements(GLenum type)
-{
- switch (type) {
- case GL_FLOAT:
- case GL_INT:
- case GL_BOOL:
- case GL_UNSIGNED_INT:
- default: /* Catch all the various sampler types. */
- return 1;
-
- case GL_FLOAT_VEC2:
- case GL_INT_VEC2:
- case GL_BOOL_VEC2:
- case GL_UNSIGNED_INT_VEC2:
- return 2;
-
- case GL_FLOAT_VEC3:
- case GL_INT_VEC3:
- case GL_BOOL_VEC3:
- case GL_UNSIGNED_INT_VEC3:
- return 3;
-
- case GL_FLOAT_VEC4:
- case GL_INT_VEC4:
- case GL_BOOL_VEC4:
- case GL_UNSIGNED_INT_VEC4:
- return 4;
- }
-}
-
-static void
-get_matrix_dims(GLenum type, GLint *rows, GLint *cols)
-{
- switch (type) {
- case GL_FLOAT_MAT2:
- *rows = *cols = 2;
- break;
- case GL_FLOAT_MAT2x3:
- *rows = 3;
- *cols = 2;
- break;
- case GL_FLOAT_MAT2x4:
- *rows = 4;
- *cols = 2;
- break;
- case GL_FLOAT_MAT3:
- *rows = 3;
- *cols = 3;
- break;
- case GL_FLOAT_MAT3x2:
- *rows = 2;
- *cols = 3;
- break;
- case GL_FLOAT_MAT3x4:
- *rows = 4;
- *cols = 3;
- break;
- case GL_FLOAT_MAT4:
- *rows = 4;
- *cols = 4;
- break;
- case GL_FLOAT_MAT4x2:
- *rows = 2;
- *cols = 4;
- break;
- case GL_FLOAT_MAT4x3:
- *rows = 3;
- *cols = 4;
- break;
- default:
- *rows = *cols = 0;
- }
-}
-
-
-/**
- * Determine the number of rows and columns occupied by a uniform
- * according to its datatype. For non-matrix types (such as GL_FLOAT_VEC4),
- * the number of rows = 1 and cols = number of elements in the vector.
- */
-static void
-get_uniform_rows_cols(const struct gl_program_parameter *p,
- GLint *rows, GLint *cols)
-{
- get_matrix_dims(p->DataType, rows, cols);
- if (*rows == 0 && *cols == 0) {
- /* not a matrix type, probably a float or vector */
- *rows = 1;
- *cols = get_vector_elements(p->DataType);
- }
-}
-
-
-/**
- * Helper for get_uniform[fi]v() functions.
- * Given a shader program name and uniform location, return a pointer
- * to the shader program and return the program parameter position.
- */
-static void
-lookup_uniform_parameter(struct gl_context *ctx, GLuint program, GLint location,
- struct gl_program **progOut, GLint *paramPosOut)
-{
- struct gl_shader_program *shProg
- = _mesa_lookup_shader_program_err(ctx, program, "glGetUniform[if]v");
- struct gl_program *prog = NULL;
- GLint progPos = -1;
-
- /* if shProg is NULL, we'll have already recorded an error */
-
- if (shProg) {
- if (!shProg->Uniforms ||
- location < 0 ||
- location >= (GLint) shProg->Uniforms->NumUniforms) {
- _mesa_error(ctx, GL_INVALID_OPERATION, "glGetUniformfv(location)");
- }
- else {
- /* OK, find the gl_program and program parameter location */
- progPos = shProg->Uniforms->Uniforms[location].VertPos;
- if (progPos >= 0) {
- prog = &shProg->VertexProgram->Base;
- }
- else {
- progPos = shProg->Uniforms->Uniforms[location].FragPos;
- if (progPos >= 0) {
- prog = &shProg->FragmentProgram->Base;
- } else {
- progPos = shProg->Uniforms->Uniforms[location].GeomPos;
- if (progPos >= 0) {
- prog = &shProg->GeometryProgram->Base;
- }
- }
- }
- }
- }
-
- *progOut = prog;
- *paramPosOut = progPos;
-}
-
-
-/**
- * GLGL uniform arrays and structs require special handling.
- *
- * The GL_ARB_shader_objects spec says that if you use
- * glGetUniformLocation to get the location of an array, you CANNOT
- * access other elements of the array by adding an offset to the
- * returned location. For example, you must call
- * glGetUniformLocation("foo[16]") if you want to set the 16th element
- * of the array with glUniform().
- *
- * HOWEVER, some other OpenGL drivers allow accessing array elements
- * by adding an offset to the returned array location. And some apps
- * seem to depend on that behaviour.
- *
- * Mesa's gl_uniform_list doesn't directly support this since each
- * entry in the list describes one uniform variable, not one uniform
- * element. We could insert dummy entries in the list for each array
- * element after [0] but that causes complications elsewhere.
- *
- * We solve this problem by encoding two values in the location that's
- * returned by glGetUniformLocation():
- * a) index into gl_uniform_list::Uniforms[] for the uniform
- * b) an array/field offset (0 for simple types)
- *
- * These two values are encoded in the high and low halves of a GLint.
- * By putting the uniform number in the high part and the offset in the
- * low part, we can support the unofficial ability to index into arrays
- * by adding offsets to the location value.
- */
-static void
-merge_location_offset(GLint *location, GLint offset)
-{
- *location = (*location << 16) | offset;
-}
-
-
-/**
- * Separate the uniform location and parameter offset. See above.
- */
-static void
-split_location_offset(GLint *location, GLint *offset)
-{
- *offset = *location & 0xffff;
- *location = *location >> 16;
-}
-
-
-
-/**
- * Called via glGetUniformfv().
- */
-static void
-_mesa_get_uniformfv(struct gl_context *ctx, GLuint program, GLint location,
- GLsizei bufSize, GLfloat *params)
-{
- struct gl_program *prog;
- GLint paramPos, offset;
-
- split_location_offset(&location, &offset);
-
- lookup_uniform_parameter(ctx, program, location, &prog, &paramPos);
-
- if (prog) {
- const struct gl_program_parameter *p =
- &prog->Parameters->Parameters[paramPos];
- GLint rows, cols, i, j, k;
- GLsizei numBytes;
-
- get_uniform_rows_cols(p, &rows, &cols);
-
- numBytes = rows * cols * sizeof *params;
- if (bufSize < numBytes) {
- _mesa_error( ctx, GL_INVALID_OPERATION,
- "glGetnUniformfvARB(out of bounds: bufSize is %d,"
- " but %d bytes are required)", bufSize, numBytes );
- return;
- }
-
- k = 0;
- for (i = 0; i < rows; i++) {
- const int base = paramPos + offset + i;
-
- for (j = 0; j < cols; j++ ) {
- params[k++] = prog->Parameters->ParameterValues[base][j];
- }
- }
- }
-}
-
-
-/**
- * Called via glGetUniformiv().
- * \sa _mesa_get_uniformfv, only difference is a cast.
- */
-static void
-_mesa_get_uniformiv(struct gl_context *ctx, GLuint program, GLint location,
- GLsizei bufSize, GLint *params)
-{
- struct gl_program *prog;
- GLint paramPos, offset;
-
- split_location_offset(&location, &offset);
-
- lookup_uniform_parameter(ctx, program, location, &prog, &paramPos);
-
- if (prog) {
- const struct gl_program_parameter *p =
- &prog->Parameters->Parameters[paramPos];
- GLint rows, cols, i, j, k;
- GLsizei numBytes;
-
- get_uniform_rows_cols(p, &rows, &cols);
-
- numBytes = rows * cols * sizeof *params;
- if (bufSize < numBytes) {
- _mesa_error( ctx, GL_INVALID_OPERATION,
- "glGetnUniformivARB(out of bounds: bufSize is %d,"
- " but %d bytes are required)", bufSize, numBytes );
- return;
- }
-
- k = 0;
- for (i = 0; i < rows; i++) {
- const int base = paramPos + offset + i;
-
- for (j = 0; j < cols; j++ ) {
- params[k++] = (GLint) prog->Parameters->ParameterValues[base][j];
- }
- }
- }
-}
-
-
-/**
- * Called via glGetUniformuiv().
- * New in GL_EXT_gpu_shader4, OpenGL 3.0
- * \sa _mesa_get_uniformfv, only difference is a cast.
- */
-static void
-_mesa_get_uniformuiv(struct gl_context *ctx, GLuint program, GLint location,
- GLsizei bufSize, GLuint *params)
-{
- struct gl_program *prog;
- GLint paramPos, offset;
-
- split_location_offset(&location, &offset);
-
- lookup_uniform_parameter(ctx, program, location, &prog, &paramPos);
-
- if (prog) {
- const struct gl_program_parameter *p =
- &prog->Parameters->Parameters[paramPos];
- GLint rows, cols, i, j, k;
- GLsizei numBytes;
-
- get_uniform_rows_cols(p, &rows, &cols);
-
- numBytes = rows * cols * sizeof *params;
- if (bufSize < numBytes) {
- _mesa_error( ctx, GL_INVALID_OPERATION,
- "glGetnUniformuivARB(out of bounds: bufSize is %d,"
- " but %d bytes are required)", bufSize, numBytes );
- return;
- }
-
- k = 0;
- for (i = 0; i < rows; i++) {
- const int base = paramPos + offset + i;
-
- for (j = 0; j < cols; j++ ) {
- params[k++] = (GLuint) prog->Parameters->ParameterValues[base][j];
- }
- }
- }
-}
-
-
-/**
- * Called via glGetUniformdv().
- * New in GL_ARB_gpu_shader_fp64, OpenGL 4.0
- */
-static void
-_mesa_get_uniformdv(struct gl_context *ctx, GLuint program, GLint location,
- GLsizei bufSize, GLdouble *params)
-{
- _mesa_error(ctx, GL_INVALID_OPERATION, "glGetUniformdvARB"
- "(GL_ARB_gpu_shader_fp64 not implemented)");
-}
-
-
-/**
- * Called via glGetUniformLocation().
- *
- * The return value will encode two values, the uniform location and an
- * offset (used for arrays, structs).
- */
-GLint
-_mesa_get_uniform_location(struct gl_context *ctx, struct gl_shader_program *shProg,
- const GLchar *name)
-{
- GLint offset = 0, location = -1;
-
- if (shProg->LinkStatus == GL_FALSE) {
- _mesa_error(ctx, GL_INVALID_OPERATION, "glGetUniformfv(program)");
- return -1;
- }
-
- /* XXX we should return -1 if the uniform was declared, but not
- * actually used.
- */
-
- /* XXX we need to be able to parse uniform names for structs and arrays
- * such as:
- * mymatrix[1]
- * mystruct.field1
- */
-
- {
- /* handle 1-dimension arrays here... */
- char *c = strchr(name, '[');
- if (c) {
- /* truncate name at [ */
- const GLint len = c - name;
- GLchar *newName = malloc(len + 1);
- if (!newName)
- return -1; /* out of mem */
- memcpy(newName, name, len);
- newName[len] = 0;
-
- location = _mesa_lookup_uniform(shProg->Uniforms, newName);
- if (location >= 0) {
- const GLint element = atoi(c + 1);
- if (element > 0) {
- /* get type of the uniform array element */
- struct gl_program_parameter *p;
- p = get_uniform_parameter(shProg, location);
- if (p) {
- GLint rows, cols;
- get_matrix_dims(p->DataType, &rows, &cols);
- if (rows < 1)
- rows = 1;
- offset = element * rows;
- }
- }
- }
-
- free(newName);
- }
- }
-
- if (location < 0) {
- location = _mesa_lookup_uniform(shProg->Uniforms, name);
- }
-
- if (location >= 0) {
- merge_location_offset(&location, offset);
- }
-
- return location;
-}
-
-
-
-/**
- * Update the vertex/fragment program's TexturesUsed array.
- *
- * This needs to be called after glUniform(set sampler var) is called.
- * A call to glUniform(samplerVar, value) causes a sampler to point to a
- * particular texture unit. We know the sampler's texture target
- * (1D/2D/3D/etc) from compile time but the sampler's texture unit is
- * set by glUniform() calls.
- *
- * So, scan the program->SamplerUnits[] and program->SamplerTargets[]
- * information to update the prog->TexturesUsed[] values.
- * Each value of TexturesUsed[unit] is one of zero, TEXTURE_1D_INDEX,
- * TEXTURE_2D_INDEX, TEXTURE_3D_INDEX, etc.
- * We'll use that info for state validation before rendering.
- */
-void
-_mesa_update_shader_textures_used(struct gl_program *prog)
-{
- GLuint s;
-
- memset(prog->TexturesUsed, 0, sizeof(prog->TexturesUsed));
-
- for (s = 0; s < MAX_SAMPLERS; s++) {
- if (prog->SamplersUsed & (1 << s)) {
- GLuint unit = prog->SamplerUnits[s];
- GLuint tgt = prog->SamplerTargets[s];
- assert(unit < MAX_TEXTURE_IMAGE_UNITS);
- assert(tgt < NUM_TEXTURE_TARGETS);
- prog->TexturesUsed[unit] |= (1 << tgt);
- }
- }
-}
-
-
-/**
- * Check if the type given by userType is allowed to set a uniform of the
- * target type. Generally, equivalence is required, but setting Boolean
- * uniforms can be done with glUniformiv or glUniformfv.
- */
-static GLboolean
-compatible_types(GLenum userType, GLenum targetType)
-{
- if (userType == targetType)
- return GL_TRUE;
-
- if (targetType == GL_BOOL && (userType == GL_FLOAT ||
- userType == GL_UNSIGNED_INT ||
- userType == GL_INT))
- return GL_TRUE;
-
- if (targetType == GL_BOOL_VEC2 && (userType == GL_FLOAT_VEC2 ||
- userType == GL_UNSIGNED_INT_VEC2 ||
- userType == GL_INT_VEC2))
- return GL_TRUE;
-
- if (targetType == GL_BOOL_VEC3 && (userType == GL_FLOAT_VEC3 ||
- userType == GL_UNSIGNED_INT_VEC3 ||
- userType == GL_INT_VEC3))
- return GL_TRUE;
-
- if (targetType == GL_BOOL_VEC4 && (userType == GL_FLOAT_VEC4 ||
- userType == GL_UNSIGNED_INT_VEC4 ||
- userType == GL_INT_VEC4))
- return GL_TRUE;
-
- if (is_sampler_type(targetType) && userType == GL_INT)
- return GL_TRUE;
-
- return GL_FALSE;
-}
-
-
-/**
- * Set the value of a program's uniform variable.
- * \param program the program whose uniform to update
- * \param index the index of the program parameter for the uniform
- * \param offset additional parameter slot offset (for arrays)
- * \param type the incoming datatype of 'values'
- * \param count the number of uniforms to set
- * \param elems number of elements per uniform (1, 2, 3 or 4)
- * \param values the new values, of datatype 'type'
- */
-static void
-set_program_uniform(struct gl_context *ctx, struct gl_program *program,
- GLint index, GLint offset,
- GLenum type, GLsizei count, GLint elems,
- const void *values)
-{
- const struct gl_program_parameter *param =
- &program->Parameters->Parameters[index];
-
- assert(offset >= 0);
- assert(elems >= 1);
- assert(elems <= 4);
-
- if (!compatible_types(type, param->DataType)) {
- _mesa_error(ctx, GL_INVALID_OPERATION, "glUniform(type mismatch)");
- return;
- }
-
- if (index + offset > (GLint) program->Parameters->Size) {
- /* out of bounds! */
- return;
- }
-
- if (param->Type == PROGRAM_SAMPLER) {
- /* This controls which texture unit which is used by a sampler */
- GLboolean changed = GL_FALSE;
- GLint i;
-
- /* this should have been caught by the compatible_types() check */
- ASSERT(type == GL_INT);
-
- /* loop over number of samplers to change */
- for (i = 0; i < count; i++) {
- GLuint sampler =
- (GLuint) program->Parameters->ParameterValues[index + offset + i][0];
- GLuint texUnit = ((GLuint *) values)[i];
-
- /* check that the sampler (tex unit index) is legal */
- if (texUnit >= ctx->Const.MaxTextureImageUnits) {
- _mesa_error(ctx, GL_INVALID_VALUE,
- "glUniform1(invalid sampler/tex unit index for '%s')",
- param->Name);
- return;
- }
-
- /* This maps a sampler to a texture unit: */
- if (sampler < MAX_SAMPLERS) {
-#if 0
- printf("Set program %p sampler %d '%s' to unit %u\n",
- program, sampler, param->Name, texUnit);
-#endif
- if (program->SamplerUnits[sampler] != texUnit) {
- program->SamplerUnits[sampler] = texUnit;
- changed = GL_TRUE;
- }
- }
- }
-
- if (changed) {
- /* When a sampler's value changes it usually requires rewriting
- * a GPU program's TEX instructions since there may not be a
- * sampler->texture lookup table. We signal this with the
- * ProgramStringNotify() callback.
- */
- FLUSH_VERTICES(ctx, _NEW_TEXTURE | _NEW_PROGRAM);
- _mesa_update_shader_textures_used(program);
- /* Do we need to care about the return value here?
- * This should not be the first time the driver was notified of
- * this program.
- */
- (void) ctx->Driver.ProgramStringNotify(ctx, program->Target, program);
- }
- }
- else {
- /* ordinary uniform variable */
- const GLboolean isUniformBool = is_boolean_type(param->DataType);
- const GLenum basicType = base_uniform_type(type);
- const GLint slots = (param->Size + 3) / 4;
- const GLint typeSize = _mesa_sizeof_glsl_type(param->DataType);
- GLsizei k, i;
-
- if ((GLint) param->Size > typeSize) {
- /* an array */
- /* we'll ignore extra data below */
- }
- else {
- /* non-array: count must be at most one; count == 0 is handled by the loop below */
- if (count > 1) {
- _mesa_error(ctx, GL_INVALID_OPERATION,
- "glUniform(uniform '%s' is not an array)",
- param->Name);
- return;
- }
- }
-
- /* loop over number of array elements */
- for (k = 0; k < count; k++) {
- GLfloat *uniformVal;
-
- if (offset + k >= slots) {
- /* Extra array data is ignored */
- break;
- }
-
- /* uniformVal (the destination) is always float[4] */
- uniformVal = program->Parameters->ParameterValues[index + offset + k];
-
- if (basicType == GL_INT) {
- /* convert user's ints to floats */
- const GLint *iValues = ((const GLint *) values) + k * elems;
- for (i = 0; i < elems; i++) {
- uniformVal[i] = (GLfloat) iValues[i];
- }
- }
- else if (basicType == GL_UNSIGNED_INT) {
- /* convert user's uints to floats */
- const GLuint *iValues = ((const GLuint *) values) + k * elems;
- for (i = 0; i < elems; i++) {
- uniformVal[i] = (GLfloat) iValues[i];
- }
- }
- else {
- const GLfloat *fValues = ((const GLfloat *) values) + k * elems;
- assert(basicType == GL_FLOAT);
- for (i = 0; i < elems; i++) {
- uniformVal[i] = fValues[i];
- }
- }
-
- /* if the uniform is bool-valued, convert to 1.0 or 0.0 */
- if (isUniformBool) {
- for (i = 0; i < elems; i++) {
- uniformVal[i] = uniformVal[i] ? 1.0f : 0.0f;
- }
- }
- }
- }
-}
-
-
-/**
- * Called via glUniform*() functions.
- */
-void
-_mesa_uniform(struct gl_context *ctx, struct gl_shader_program *shProg,
- GLint location, GLsizei count,
- const GLvoid *values, GLenum type)
-{
- struct gl_uniform *uniform;
- GLint elems, offset;
-
- if (!shProg || !shProg->LinkStatus) {
- _mesa_error(ctx, GL_INVALID_OPERATION, "glUniform(program not linked)");
- return;
- }
-
- if (location == -1)
- return; /* The standard specifies this as a no-op */
-
- if (location < -1) {
- _mesa_error(ctx, GL_INVALID_OPERATION, "glUniform(location=%d)",
- location);
- return;
- }
-
- split_location_offset(&location, &offset);
-
- if (location < 0 || location >= (GLint) shProg->Uniforms->NumUniforms) {
- _mesa_error(ctx, GL_INVALID_VALUE, "glUniform(location=%d)", location);
- return;
- }
-
- if (count < 0) {
- _mesa_error(ctx, GL_INVALID_VALUE, "glUniform(count < 0)");
- return;
- }
-
- elems = _mesa_sizeof_glsl_type(type);
-
- FLUSH_VERTICES(ctx, _NEW_PROGRAM_CONSTANTS);
-
- uniform = &shProg->Uniforms->Uniforms[location];
-
- if (ctx->Shader.Flags & GLSL_UNIFORMS) {
- const GLenum basicType = base_uniform_type(type);
- GLint i;
- printf("Mesa: set program %u uniform %s (loc %d) to: ",
- shProg->Name, uniform->Name, location);
- if (basicType == GL_INT) {
- const GLint *v = (const GLint *) values;
- for (i = 0; i < count * elems; i++) {
- printf("%d ", v[i]);
- }
- }
- else if (basicType == GL_UNSIGNED_INT) {
- const GLuint *v = (const GLuint *) values;
- for (i = 0; i < count * elems; i++) {
- printf("%u ", v[i]);
- }
- }
- else {
- const GLfloat *v = (const GLfloat *) values;
- assert(basicType == GL_FLOAT);
- for (i = 0; i < count * elems; i++) {
- printf("%g ", v[i]);
- }
- }
- printf("\n");
- }
-
- /* A uniform var may be used by both a vertex shader and a fragment
- * shader. We may need to update one or both shader's uniform here:
- */
- if (shProg->VertexProgram) {
- /* convert uniform location to program parameter index */
- GLint index = uniform->VertPos;
- if (index >= 0) {
- set_program_uniform(ctx, &shProg->VertexProgram->Base,
- index, offset, type, count, elems, values);
- }
- }
-
- if (shProg->FragmentProgram) {
- /* convert uniform location to program parameter index */
- GLint index = uniform->FragPos;
- if (index >= 0) {
- set_program_uniform(ctx, &shProg->FragmentProgram->Base,
- index, offset, type, count, elems, values);
- }
- }
-
- if (shProg->GeometryProgram) {
- /* convert uniform location to program parameter index */
- GLint index = uniform->GeomPos;
- if (index >= 0) {
- set_program_uniform(ctx, &shProg->GeometryProgram->Base,
- index, offset, type, count, elems, values);
- }
- }
-
- uniform->Initialized = GL_TRUE;
-}
-
-
-/**
- * Set a matrix-valued program parameter.
- */
-static void
-set_program_uniform_matrix(struct gl_context *ctx, struct gl_program *program,
- GLuint index, GLuint offset,
- GLuint count, GLuint rows, GLuint cols,
- GLboolean transpose, const GLfloat *values)
-{
- GLuint mat, row, col;
- GLuint src = 0;
- const struct gl_program_parameter * param = &program->Parameters->Parameters[index];
- const GLuint slots = (param->Size + 3) / 4;
- const GLint typeSize = _mesa_sizeof_glsl_type(param->DataType);
- GLint nr, nc;
-
- /* check that the number of rows, columns is correct */
- get_matrix_dims(param->DataType, &nr, &nc);
- if (rows != nr || cols != nc) {
- _mesa_error(ctx, GL_INVALID_OPERATION,
- "glUniformMatrix(matrix size mismatch)");
- return;
- }
-
- if ((GLint) param->Size <= typeSize) {
- /* non-array: count must be at most one; count == 0 is handled by the loop below */
- if (count > 1) {
- _mesa_error(ctx, GL_INVALID_OPERATION,
- "glUniformMatrix(uniform is not an array)");
- return;
- }
- }
-
- /*
- * Note: the _columns_ of a matrix are stored in program registers, not
- * the rows. So, the loops below look a little funny.
- * XXX could optimize this a bit...
- */
-
- /* loop over matrices */
- for (mat = 0; mat < count; mat++) {
-
- /* each matrix: */
- for (col = 0; col < cols; col++) {
- GLfloat *v;
- if (offset >= slots) {
- /* Ignore writes beyond the end of (the used part of) an array */
- return;
- }
- v = program->Parameters->ParameterValues[index + offset];
- for (row = 0; row < rows; row++) {
- if (transpose) {
- v[row] = values[src + row * cols + col];
- }
- else {
- v[row] = values[src + col * rows + row];
- }
- }
-
- offset++;
- }
-
- src += rows * cols; /* next matrix */
- }
-}
-
-
-/**
- * Called by glUniformMatrix*() functions.
- * Note: cols=2, rows=4 ==> array[2] of vec4
- */
-void
-_mesa_uniform_matrix(struct gl_context *ctx, struct gl_shader_program *shProg,
- GLint cols, GLint rows,
- GLint location, GLsizei count,
- GLboolean transpose, const GLfloat *values)
-{
- struct gl_uniform *uniform;
- GLint offset;
-
- if (!shProg || !shProg->LinkStatus) {
- _mesa_error(ctx, GL_INVALID_OPERATION,
- "glUniformMatrix(program not linked)");
- return;
- }
-
- if (location == -1)
- return; /* The standard specifies this as a no-op */
-
- if (location < -1) {
- _mesa_error(ctx, GL_INVALID_OPERATION, "glUniformMatrix(location)");
- return;
- }
-
- split_location_offset(&location, &offset);
-
- if (location < 0 || location >= (GLint) shProg->Uniforms->NumUniforms) {
- _mesa_error(ctx, GL_INVALID_VALUE, "glUniformMatrix(location)");
- return;
- }
- if (values == NULL) {
- _mesa_error(ctx, GL_INVALID_VALUE, "glUniformMatrix");
- return;
- }
-
- FLUSH_VERTICES(ctx, _NEW_PROGRAM_CONSTANTS);
-
- uniform = &shProg->Uniforms->Uniforms[location];
-
- if (shProg->VertexProgram) {
- /* convert uniform location to program parameter index */
- GLint index = uniform->VertPos;
- if (index >= 0) {
- set_program_uniform_matrix(ctx, &shProg->VertexProgram->Base,
- index, offset,
- count, rows, cols, transpose, values);
- }
- }
-
- if (shProg->FragmentProgram) {
- /* convert uniform location to program parameter index */
- GLint index = uniform->FragPos;
- if (index >= 0) {
- set_program_uniform_matrix(ctx, &shProg->FragmentProgram->Base,
- index, offset,
- count, rows, cols, transpose, values);
- }
- }
-
- if (shProg->GeometryProgram) {
- /* convert uniform location to program parameter index */
- GLint index = uniform->GeomPos;
- if (index >= 0) {
- set_program_uniform_matrix(ctx, &shProg->GeometryProgram->Base,
- index, offset,
- count, rows, cols, transpose, values);
- }
- }
-
- uniform->Initialized = GL_TRUE;
-}
-
-
-void GLAPIENTRY
-_mesa_Uniform1fARB(GLint location, GLfloat v0)
-{
- GET_CURRENT_CONTEXT(ctx);
- _mesa_uniform(ctx, ctx->Shader.ActiveProgram, location, 1, &v0, GL_FLOAT);
-}
-
-void GLAPIENTRY
-_mesa_Uniform2fARB(GLint location, GLfloat v0, GLfloat v1)
-{
- GET_CURRENT_CONTEXT(ctx);
- GLfloat v[2];
- v[0] = v0;
- v[1] = v1;
- _mesa_uniform(ctx, ctx->Shader.ActiveProgram, location, 1, v, GL_FLOAT_VEC2);
-}
-
-void GLAPIENTRY
-_mesa_Uniform3fARB(GLint location, GLfloat v0, GLfloat v1, GLfloat v2)
-{
- GET_CURRENT_CONTEXT(ctx);
- GLfloat v[3];
- v[0] = v0;
- v[1] = v1;
- v[2] = v2;
- _mesa_uniform(ctx, ctx->Shader.ActiveProgram, location, 1, v, GL_FLOAT_VEC3);
-}
-
-void GLAPIENTRY
-_mesa_Uniform4fARB(GLint location, GLfloat v0, GLfloat v1, GLfloat v2,
- GLfloat v3)
-{
- GET_CURRENT_CONTEXT(ctx);
- GLfloat v[4];
- v[0] = v0;
- v[1] = v1;
- v[2] = v2;
- v[3] = v3;
- _mesa_uniform(ctx, ctx->Shader.ActiveProgram, location, 1, v, GL_FLOAT_VEC4);
-}
-
-void GLAPIENTRY
-_mesa_Uniform1iARB(GLint location, GLint v0)
-{
- GET_CURRENT_CONTEXT(ctx);
- _mesa_uniform(ctx, ctx->Shader.ActiveProgram, location, 1, &v0, GL_INT);
-}
-
-void GLAPIENTRY
-_mesa_Uniform2iARB(GLint location, GLint v0, GLint v1)
-{
- GET_CURRENT_CONTEXT(ctx);
- GLint v[2];
- v[0] = v0;
- v[1] = v1;
- _mesa_uniform(ctx, ctx->Shader.ActiveProgram, location, 1, v, GL_INT_VEC2);
-}
-
-void GLAPIENTRY
-_mesa_Uniform3iARB(GLint location, GLint v0, GLint v1, GLint v2)
-{
- GET_CURRENT_CONTEXT(ctx);
- GLint v[3];
- v[0] = v0;
- v[1] = v1;
- v[2] = v2;
- _mesa_uniform(ctx, ctx->Shader.ActiveProgram, location, 1, v, GL_INT_VEC3);
-}
-
-void GLAPIENTRY
-_mesa_Uniform4iARB(GLint location, GLint v0, GLint v1, GLint v2, GLint v3)
-{
- GET_CURRENT_CONTEXT(ctx);
- GLint v[4];
- v[0] = v0;
- v[1] = v1;
- v[2] = v2;
- v[3] = v3;
- _mesa_uniform(ctx, ctx->Shader.ActiveProgram, location, 1, v, GL_INT_VEC4);
-}
-
-void GLAPIENTRY
-_mesa_Uniform1fvARB(GLint location, GLsizei count, const GLfloat * value)
-{
- GET_CURRENT_CONTEXT(ctx);
- _mesa_uniform(ctx, ctx->Shader.ActiveProgram, location, count, value, GL_FLOAT);
-}
-
-void GLAPIENTRY
-_mesa_Uniform2fvARB(GLint location, GLsizei count, const GLfloat * value)
-{
- GET_CURRENT_CONTEXT(ctx);
- _mesa_uniform(ctx, ctx->Shader.ActiveProgram, location, count, value, GL_FLOAT_VEC2);
-}
-
-void GLAPIENTRY
-_mesa_Uniform3fvARB(GLint location, GLsizei count, const GLfloat * value)
-{
- GET_CURRENT_CONTEXT(ctx);
- _mesa_uniform(ctx, ctx->Shader.ActiveProgram, location, count, value, GL_FLOAT_VEC3);
-}
-
-void GLAPIENTRY
-_mesa_Uniform4fvARB(GLint location, GLsizei count, const GLfloat * value)
-{
- GET_CURRENT_CONTEXT(ctx);
- _mesa_uniform(ctx, ctx->Shader.ActiveProgram, location, count, value, GL_FLOAT_VEC4);
-}
-
-void GLAPIENTRY
-_mesa_Uniform1ivARB(GLint location, GLsizei count, const GLint * value)
-{
- GET_CURRENT_CONTEXT(ctx);
- _mesa_uniform(ctx, ctx->Shader.ActiveProgram, location, count, value, GL_INT);
-}
-
-void GLAPIENTRY
-_mesa_Uniform2ivARB(GLint location, GLsizei count, const GLint * value)
-{
- GET_CURRENT_CONTEXT(ctx);
- _mesa_uniform(ctx, ctx->Shader.ActiveProgram, location, count, value, GL_INT_VEC2);
-}
-
-void GLAPIENTRY
-_mesa_Uniform3ivARB(GLint location, GLsizei count, const GLint * value)
-{
- GET_CURRENT_CONTEXT(ctx);
- _mesa_uniform(ctx, ctx->Shader.ActiveProgram, location, count, value, GL_INT_VEC3);
-}
-
-void GLAPIENTRY
-_mesa_Uniform4ivARB(GLint location, GLsizei count, const GLint * value)
-{
- GET_CURRENT_CONTEXT(ctx);
- _mesa_uniform(ctx, ctx->Shader.ActiveProgram, location, count, value, GL_INT_VEC4);
-}
-
-
-/** OpenGL 3.0 GLuint-valued functions **/
-void GLAPIENTRY
-_mesa_Uniform1ui(GLint location, GLuint v0)
-{
- GET_CURRENT_CONTEXT(ctx);
- _mesa_uniform(ctx, ctx->Shader.ActiveProgram, location, 1, &v0, GL_UNSIGNED_INT);
-}
-
-void GLAPIENTRY
-_mesa_Uniform2ui(GLint location, GLuint v0, GLuint v1)
-{
- GET_CURRENT_CONTEXT(ctx);
- GLuint v[2];
- v[0] = v0;
- v[1] = v1;
- _mesa_uniform(ctx, ctx->Shader.ActiveProgram, location, 1, v, GL_UNSIGNED_INT_VEC2);
-}
-
-void GLAPIENTRY
-_mesa_Uniform3ui(GLint location, GLuint v0, GLuint v1, GLuint v2)
-{
- GET_CURRENT_CONTEXT(ctx);
- GLuint v[3];
- v[0] = v0;
- v[1] = v1;
- v[2] = v2;
- _mesa_uniform(ctx, ctx->Shader.ActiveProgram, location, 1, v, GL_UNSIGNED_INT_VEC3);
-}
-
-void GLAPIENTRY
-_mesa_Uniform4ui(GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3)
-{
- GET_CURRENT_CONTEXT(ctx);
- GLuint v[4];
- v[0] = v0;
- v[1] = v1;
- v[2] = v2;
- v[3] = v3;
- _mesa_uniform(ctx, ctx->Shader.ActiveProgram, location, 1, v, GL_UNSIGNED_INT_VEC4);
-}
-
-void GLAPIENTRY
-_mesa_Uniform1uiv(GLint location, GLsizei count, const GLuint *value)
-{
- GET_CURRENT_CONTEXT(ctx);
- _mesa_uniform(ctx, ctx->Shader.ActiveProgram, location, count, value, GL_UNSIGNED_INT);
-}
-
-void GLAPIENTRY
-_mesa_Uniform2uiv(GLint location, GLsizei count, const GLuint *value)
-{
- GET_CURRENT_CONTEXT(ctx);
- _mesa_uniform(ctx, ctx->Shader.ActiveProgram, location, count, value, GL_UNSIGNED_INT_VEC2);
-}
-
-void GLAPIENTRY
-_mesa_Uniform3uiv(GLint location, GLsizei count, const GLuint *value)
-{
- GET_CURRENT_CONTEXT(ctx);
- _mesa_uniform(ctx, ctx->Shader.ActiveProgram, location, count, value, GL_UNSIGNED_INT_VEC3);
-}
-
-void GLAPIENTRY
-_mesa_Uniform4uiv(GLint location, GLsizei count, const GLuint *value)
-{
- GET_CURRENT_CONTEXT(ctx);
- _mesa_uniform(ctx, ctx->Shader.ActiveProgram, location, count, value, GL_UNSIGNED_INT_VEC4);
-}
-
-
-
-void GLAPIENTRY
-_mesa_UniformMatrix2fvARB(GLint location, GLsizei count, GLboolean transpose,
- const GLfloat * value)
-{
- GET_CURRENT_CONTEXT(ctx);
- _mesa_uniform_matrix(ctx, ctx->Shader.ActiveProgram,
- 2, 2, location, count, transpose, value);
-}
-
-void GLAPIENTRY
-_mesa_UniformMatrix3fvARB(GLint location, GLsizei count, GLboolean transpose,
- const GLfloat * value)
-{
- GET_CURRENT_CONTEXT(ctx);
- _mesa_uniform_matrix(ctx, ctx->Shader.ActiveProgram,
- 3, 3, location, count, transpose, value);
-}
-
-void GLAPIENTRY
-_mesa_UniformMatrix4fvARB(GLint location, GLsizei count, GLboolean transpose,
- const GLfloat * value)
-{
- GET_CURRENT_CONTEXT(ctx);
- _mesa_uniform_matrix(ctx, ctx->Shader.ActiveProgram,
- 4, 4, location, count, transpose, value);
-}
-
-
-/**
- * Non-square UniformMatrix are OpenGL 2.1
- */
-void GLAPIENTRY
-_mesa_UniformMatrix2x3fv(GLint location, GLsizei count, GLboolean transpose,
- const GLfloat *value)
-{
- GET_CURRENT_CONTEXT(ctx);
- _mesa_uniform_matrix(ctx, ctx->Shader.ActiveProgram,
- 2, 3, location, count, transpose, value);
-}
-
-void GLAPIENTRY
-_mesa_UniformMatrix3x2fv(GLint location, GLsizei count, GLboolean transpose,
- const GLfloat *value)
-{
- GET_CURRENT_CONTEXT(ctx);
- _mesa_uniform_matrix(ctx, ctx->Shader.ActiveProgram,
- 3, 2, location, count, transpose, value);
-}
-
-void GLAPIENTRY
-_mesa_UniformMatrix2x4fv(GLint location, GLsizei count, GLboolean transpose,
- const GLfloat *value)
-{
- GET_CURRENT_CONTEXT(ctx);
- _mesa_uniform_matrix(ctx, ctx->Shader.ActiveProgram,
- 2, 4, location, count, transpose, value);
-}
-
-void GLAPIENTRY
-_mesa_UniformMatrix4x2fv(GLint location, GLsizei count, GLboolean transpose,
- const GLfloat *value)
-{
- GET_CURRENT_CONTEXT(ctx);
- _mesa_uniform_matrix(ctx, ctx->Shader.ActiveProgram,
- 4, 2, location, count, transpose, value);
-}
-
-void GLAPIENTRY
-_mesa_UniformMatrix3x4fv(GLint location, GLsizei count, GLboolean transpose,
- const GLfloat *value)
-{
- GET_CURRENT_CONTEXT(ctx);
- _mesa_uniform_matrix(ctx, ctx->Shader.ActiveProgram,
- 3, 4, location, count, transpose, value);
-}
-
-void GLAPIENTRY
-_mesa_UniformMatrix4x3fv(GLint location, GLsizei count, GLboolean transpose,
- const GLfloat *value)
-{
- GET_CURRENT_CONTEXT(ctx);
- _mesa_uniform_matrix(ctx, ctx->Shader.ActiveProgram,
- 4, 3, location, count, transpose, value);
-}
-
-
-void GLAPIENTRY
-_mesa_GetnUniformfvARB(GLhandleARB program, GLint location,
- GLsizei bufSize, GLfloat *params)
-{
- GET_CURRENT_CONTEXT(ctx);
- _mesa_get_uniformfv(ctx, program, location, bufSize, params);
-}
-
-void GLAPIENTRY
-_mesa_GetUniformfvARB(GLhandleARB program, GLint location, GLfloat *params)
-{
- _mesa_GetnUniformfvARB(program, location, INT_MAX, params);
-}
-
-
-void GLAPIENTRY
-_mesa_GetnUniformivARB(GLhandleARB program, GLint location,
- GLsizei bufSize, GLint *params)
-{
- GET_CURRENT_CONTEXT(ctx);
- _mesa_get_uniformiv(ctx, program, location, bufSize, params);
-}
-
-void GLAPIENTRY
-_mesa_GetUniformivARB(GLhandleARB program, GLint location, GLint *params)
-{
- _mesa_GetnUniformivARB(program, location, INT_MAX, params);
-}
-
-
-/* GL3 */
-void GLAPIENTRY
-_mesa_GetnUniformuivARB(GLhandleARB program, GLint location,
- GLsizei bufSize, GLuint *params)
-{
- GET_CURRENT_CONTEXT(ctx);
- _mesa_get_uniformuiv(ctx, program, location, bufSize, params);
-}
-
-void GLAPIENTRY
-_mesa_GetUniformuiv(GLhandleARB program, GLint location, GLuint *params)
-{
- _mesa_GetnUniformuivARB(program, location, INT_MAX, params);
-}
-
-
-/* GL4 */
-void GLAPIENTRY
-_mesa_GetnUniformdvARB(GLhandleARB program, GLint location,
- GLsizei bufSize, GLdouble *params)
-{
- GET_CURRENT_CONTEXT(ctx);
- _mesa_get_uniformdv(ctx, program, location, bufSize, params);
-}
-
-void GLAPIENTRY
-_mesa_GetUniformdv(GLhandleARB program, GLint location, GLdouble *params)
-{
- _mesa_GetnUniformdvARB(program, location, INT_MAX, params);
-}
-
-
-GLint GLAPIENTRY
-_mesa_GetUniformLocationARB(GLhandleARB programObj, const GLcharARB *name)
-{
- struct gl_shader_program *shProg;
-
- GET_CURRENT_CONTEXT(ctx);
-
- shProg = _mesa_lookup_shader_program_err(ctx, programObj,
- "glGetUniformLocation");
- if (!shProg)
- return -1;
-
- return _mesa_get_uniform_location(ctx, shProg, name);
-}
-
-
-void GLAPIENTRY
-_mesa_GetActiveUniformARB(GLhandleARB program, GLuint index,
- GLsizei maxLength, GLsizei * length, GLint * size,
- GLenum * type, GLcharARB * name)
-{
- GET_CURRENT_CONTEXT(ctx);
- _mesa_get_active_uniform(ctx, program, index, maxLength, length, size,
- type, name);
-}
-
-
-/**
- * Plug in shader uniform-related functions into API dispatch table.
- */
-void
-_mesa_init_shader_uniform_dispatch(struct _glapi_table *exec)
-{
-#if FEATURE_GL
- SET_Uniform1fARB(exec, _mesa_Uniform1fARB);
- SET_Uniform2fARB(exec, _mesa_Uniform2fARB);
- SET_Uniform3fARB(exec, _mesa_Uniform3fARB);
- SET_Uniform4fARB(exec, _mesa_Uniform4fARB);
- SET_Uniform1iARB(exec, _mesa_Uniform1iARB);
- SET_Uniform2iARB(exec, _mesa_Uniform2iARB);
- SET_Uniform3iARB(exec, _mesa_Uniform3iARB);
- SET_Uniform4iARB(exec, _mesa_Uniform4iARB);
- SET_Uniform1fvARB(exec, _mesa_Uniform1fvARB);
- SET_Uniform2fvARB(exec, _mesa_Uniform2fvARB);
- SET_Uniform3fvARB(exec, _mesa_Uniform3fvARB);
- SET_Uniform4fvARB(exec, _mesa_Uniform4fvARB);
- SET_Uniform1ivARB(exec, _mesa_Uniform1ivARB);
- SET_Uniform2ivARB(exec, _mesa_Uniform2ivARB);
- SET_Uniform3ivARB(exec, _mesa_Uniform3ivARB);
- SET_Uniform4ivARB(exec, _mesa_Uniform4ivARB);
- SET_UniformMatrix2fvARB(exec, _mesa_UniformMatrix2fvARB);
- SET_UniformMatrix3fvARB(exec, _mesa_UniformMatrix3fvARB);
- SET_UniformMatrix4fvARB(exec, _mesa_UniformMatrix4fvARB);
-
- SET_GetActiveUniformARB(exec, _mesa_GetActiveUniformARB);
- SET_GetUniformLocationARB(exec, _mesa_GetUniformLocationARB);
- SET_GetUniformfvARB(exec, _mesa_GetUniformfvARB);
- SET_GetUniformivARB(exec, _mesa_GetUniformivARB);
-
- /* OpenGL 2.1 */
- SET_UniformMatrix2x3fv(exec, _mesa_UniformMatrix2x3fv);
- SET_UniformMatrix3x2fv(exec, _mesa_UniformMatrix3x2fv);
- SET_UniformMatrix2x4fv(exec, _mesa_UniformMatrix2x4fv);
- SET_UniformMatrix4x2fv(exec, _mesa_UniformMatrix4x2fv);
- SET_UniformMatrix3x4fv(exec, _mesa_UniformMatrix3x4fv);
- SET_UniformMatrix4x3fv(exec, _mesa_UniformMatrix4x3fv);
-
- /* OpenGL 3.0 */
- /* XXX finish dispatch */
- SET_Uniform1uiEXT(exec, _mesa_Uniform1ui);
- SET_Uniform2uiEXT(exec, _mesa_Uniform2ui);
- SET_Uniform3uiEXT(exec, _mesa_Uniform3ui);
- SET_Uniform4uiEXT(exec, _mesa_Uniform4ui);
- SET_Uniform1uivEXT(exec, _mesa_Uniform1uiv);
- SET_Uniform2uivEXT(exec, _mesa_Uniform2uiv);
- SET_Uniform3uivEXT(exec, _mesa_Uniform3uiv);
- SET_Uniform4uivEXT(exec, _mesa_Uniform4uiv);
- SET_GetUniformuivEXT(exec, _mesa_GetUniformuiv);
-
- /* GL_ARB_robustness */
- SET_GetnUniformfvARB(exec, _mesa_GetnUniformfvARB);
- SET_GetnUniformivARB(exec, _mesa_GetnUniformivARB);
- SET_GetnUniformuivARB(exec, _mesa_GetnUniformuivARB);
- SET_GetnUniformdvARB(exec, _mesa_GetnUniformdvARB); /* GL 4.0 */
-
-#endif /* FEATURE_GL */
-}
+/*
+ * Mesa 3-D graphics library
+ *
+ * Copyright (C) 2004-2008 Brian Paul All Rights Reserved.
+ * Copyright (C) 2009-2010 VMware, Inc. All Rights Reserved.
+ * Copyright © 2010 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+/**
+ * \file uniforms.c
+ * Functions related to GLSL uniform variables.
+ * \author Brian Paul
+ */
+
+/**
+ * XXX things to do:
+ * 1. Check that the right error code is generated for all _mesa_error() calls.
+ * 2. Insert FLUSH_VERTICES calls in various places
+ */
+
+
+#include "main/glheader.h"
+#include "main/context.h"
+#include "main/dispatch.h"
+#include "main/mfeatures.h"
+#include "main/mtypes.h"
+#include "main/shaderapi.h"
+#include "main/shaderobj.h"
+#include "main/uniforms.h"
+#include "program/prog_parameter.h"
+#include "program/prog_statevars.h"
+#include "program/prog_uniform.h"
+#include "program/prog_instruction.h"
+
+
+static GLenum
+base_uniform_type(GLenum type)
+{
+ switch (type) {
+#if 0 /* not needed, for now */
+ case GL_BOOL:
+ case GL_BOOL_VEC2:
+ case GL_BOOL_VEC3:
+ case GL_BOOL_VEC4:
+ return GL_BOOL;
+#endif
+ case GL_FLOAT:
+ case GL_FLOAT_VEC2:
+ case GL_FLOAT_VEC3:
+ case GL_FLOAT_VEC4:
+ return GL_FLOAT;
+ case GL_UNSIGNED_INT:
+ case GL_UNSIGNED_INT_VEC2:
+ case GL_UNSIGNED_INT_VEC3:
+ case GL_UNSIGNED_INT_VEC4:
+ return GL_UNSIGNED_INT;
+ case GL_INT:
+ case GL_INT_VEC2:
+ case GL_INT_VEC3:
+ case GL_INT_VEC4:
+ return GL_INT;
+ default:
+ _mesa_problem(NULL, "Invalid type in base_uniform_type()");
+ return GL_FLOAT;
+ }
+}
+
+
+static GLboolean
+is_boolean_type(GLenum type)
+{
+ switch (type) {
+ case GL_BOOL:
+ case GL_BOOL_VEC2:
+ case GL_BOOL_VEC3:
+ case GL_BOOL_VEC4:
+ return GL_TRUE;
+ default:
+ return GL_FALSE;
+ }
+}
+
+
+static GLboolean
+is_sampler_type(GLenum type)
+{
+ switch (type) {
+ case GL_SAMPLER_1D:
+ case GL_SAMPLER_2D:
+ case GL_SAMPLER_3D:
+ case GL_SAMPLER_CUBE:
+ case GL_SAMPLER_1D_SHADOW:
+ case GL_SAMPLER_2D_SHADOW:
+ case GL_SAMPLER_2D_RECT_ARB:
+ case GL_SAMPLER_2D_RECT_SHADOW_ARB:
+ case GL_SAMPLER_1D_ARRAY_EXT:
+ case GL_SAMPLER_2D_ARRAY_EXT:
+ case GL_SAMPLER_1D_ARRAY_SHADOW_EXT:
+ case GL_SAMPLER_2D_ARRAY_SHADOW_EXT:
+ return GL_TRUE;
+ default:
+ return GL_FALSE;
+ }
+}
+
+
+static struct gl_program_parameter *
+get_uniform_parameter(const struct gl_shader_program *shProg, GLuint index)
+{
+ const struct gl_program *prog = NULL;
+ GLint progPos;
+
+ progPos = shProg->Uniforms->Uniforms[index].VertPos;
+ if (progPos >= 0) {
+ prog = &shProg->VertexProgram->Base;
+ }
+ else {
+ progPos = shProg->Uniforms->Uniforms[index].FragPos;
+ if (progPos >= 0) {
+ prog = &shProg->FragmentProgram->Base;
+ } else {
+ progPos = shProg->Uniforms->Uniforms[index].GeomPos;
+ if (progPos >= 0) {
+ prog = &shProg->GeometryProgram->Base;
+ }
+ }
+ }
+
+ if (!prog || progPos < 0)
+ return NULL; /* should never happen */
+
+ return &prog->Parameters->Parameters[progPos];
+}
+
+
+/**
+ * Called by glGetActiveUniform().
+ */
+static void
+_mesa_get_active_uniform(struct gl_context *ctx, GLuint program, GLuint index,
+ GLsizei maxLength, GLsizei *length, GLint *size,
+ GLenum *type, GLchar *nameOut)
+{
+ const struct gl_shader_program *shProg;
+ const struct gl_program *prog = NULL;
+ const struct gl_program_parameter *param;
+ GLint progPos;
+
+ shProg = _mesa_lookup_shader_program_err(ctx, program, "glGetActiveUniform");
+ if (!shProg)
+ return;
+
+ if (!shProg->Uniforms || index >= shProg->Uniforms->NumUniforms) {
+ _mesa_error(ctx, GL_INVALID_VALUE, "glGetActiveUniform(index)");
+ return;
+ }
+
+ progPos = shProg->Uniforms->Uniforms[index].VertPos;
+ if (progPos >= 0) {
+ prog = &shProg->VertexProgram->Base;
+ }
+ else {
+ progPos = shProg->Uniforms->Uniforms[index].FragPos;
+ if (progPos >= 0) {
+ prog = &shProg->FragmentProgram->Base;
+ } else {
+ progPos = shProg->Uniforms->Uniforms[index].GeomPos;
+ if (progPos >= 0) {
+ prog = &shProg->GeometryProgram->Base;
+ }
+ }
+ }
+
+ if (!prog || progPos < 0)
+ return; /* should never happen */
+
+ ASSERT(progPos < prog->Parameters->NumParameters);
+ param = &prog->Parameters->Parameters[progPos];
+
+ if (nameOut) {
+ _mesa_copy_string(nameOut, maxLength, length, param->Name);
+ }
+
+ if (size) {
+ GLint typeSize = _mesa_sizeof_glsl_type(param->DataType);
+ if ((GLint) param->Size > typeSize) {
+ /* This is an array.
+ * Array elements are placed on vector[4] boundaries so they're
+ * a multiple of four floats. We round typeSize up to next multiple
+ * of four to get the right size below.
+ */
+ typeSize = (typeSize + 3) & ~3;
+ }
+ /* Note that the returned size is in units of the <type>, not bytes */
+ *size = param->Size / typeSize;
+ }
+
+ if (type) {
+ *type = param->DataType;
+ }
+}
+
+
+static unsigned
+get_vector_elements(GLenum type)
+{
+ switch (type) {
+ case GL_FLOAT:
+ case GL_INT:
+ case GL_BOOL:
+ case GL_UNSIGNED_INT:
+ default: /* Catch all the various sampler types. */
+ return 1;
+
+ case GL_FLOAT_VEC2:
+ case GL_INT_VEC2:
+ case GL_BOOL_VEC2:
+ case GL_UNSIGNED_INT_VEC2:
+ return 2;
+
+ case GL_FLOAT_VEC3:
+ case GL_INT_VEC3:
+ case GL_BOOL_VEC3:
+ case GL_UNSIGNED_INT_VEC3:
+ return 3;
+
+ case GL_FLOAT_VEC4:
+ case GL_INT_VEC4:
+ case GL_BOOL_VEC4:
+ case GL_UNSIGNED_INT_VEC4:
+ return 4;
+ }
+}
+
+static void
+get_matrix_dims(GLenum type, GLint *rows, GLint *cols)
+{
+ switch (type) {
+ case GL_FLOAT_MAT2:
+ *rows = *cols = 2;
+ break;
+ case GL_FLOAT_MAT2x3:
+ *rows = 3;
+ *cols = 2;
+ break;
+ case GL_FLOAT_MAT2x4:
+ *rows = 4;
+ *cols = 2;
+ break;
+ case GL_FLOAT_MAT3:
+ *rows = 3;
+ *cols = 3;
+ break;
+ case GL_FLOAT_MAT3x2:
+ *rows = 2;
+ *cols = 3;
+ break;
+ case GL_FLOAT_MAT3x4:
+ *rows = 4;
+ *cols = 3;
+ break;
+ case GL_FLOAT_MAT4:
+ *rows = 4;
+ *cols = 4;
+ break;
+ case GL_FLOAT_MAT4x2:
+ *rows = 2;
+ *cols = 4;
+ break;
+ case GL_FLOAT_MAT4x3:
+ *rows = 3;
+ *cols = 4;
+ break;
+ default:
+ *rows = *cols = 0;
+ }
+}
+
+
+/**
+ * Determine the number of rows and columns occupied by a uniform
+ * according to its datatype. For non-matrix types (such as GL_FLOAT_VEC4),
+ * the number of rows = 1 and cols = number of elements in the vector.
+ */
+static void
+get_uniform_rows_cols(const struct gl_program_parameter *p,
+ GLint *rows, GLint *cols)
+{
+ get_matrix_dims(p->DataType, rows, cols);
+ if (*rows == 0 && *cols == 0) {
+ /* not a matrix type, probably a float or vector */
+ *rows = 1;
+ *cols = get_vector_elements(p->DataType);
+ }
+}
+
+
+/**
+ * Helper for get_uniform[fi]v() functions.
+ * Given a shader program name and uniform location, return a pointer
+ * to the shader program and return the program parameter position.
+ */
+static void
+lookup_uniform_parameter(struct gl_context *ctx, GLuint program, GLint location,
+ struct gl_program **progOut, GLint *paramPosOut)
+{
+ struct gl_shader_program *shProg
+ = _mesa_lookup_shader_program_err(ctx, program, "glGetUniform[if]v");
+ struct gl_program *prog = NULL;
+ GLint progPos = -1;
+
+ /* if shProg is NULL, we'll have already recorded an error */
+
+ if (shProg) {
+ if (!shProg->Uniforms ||
+ location < 0 ||
+ location >= (GLint) shProg->Uniforms->NumUniforms) {
+ _mesa_error(ctx, GL_INVALID_OPERATION, "glGetUniformfv(location)");
+ }
+ else {
+ /* OK, find the gl_program and program parameter location */
+ progPos = shProg->Uniforms->Uniforms[location].VertPos;
+ if (progPos >= 0) {
+ prog = &shProg->VertexProgram->Base;
+ }
+ else {
+ progPos = shProg->Uniforms->Uniforms[location].FragPos;
+ if (progPos >= 0) {
+ prog = &shProg->FragmentProgram->Base;
+ } else {
+ progPos = shProg->Uniforms->Uniforms[location].GeomPos;
+ if (progPos >= 0) {
+ prog = &shProg->GeometryProgram->Base;
+ }
+ }
+ }
+ }
+ }
+
+ *progOut = prog;
+ *paramPosOut = progPos;
+}
+
+
+/**
+ * GLGL uniform arrays and structs require special handling.
+ *
+ * The GL_ARB_shader_objects spec says that if you use
+ * glGetUniformLocation to get the location of an array, you CANNOT
+ * access other elements of the array by adding an offset to the
+ * returned location. For example, you must call
+ * glGetUniformLocation("foo[16]") if you want to set the 16th element
+ * of the array with glUniform().
+ *
+ * HOWEVER, some other OpenGL drivers allow accessing array elements
+ * by adding an offset to the returned array location. And some apps
+ * seem to depend on that behaviour.
+ *
+ * Mesa's gl_uniform_list doesn't directly support this since each
+ * entry in the list describes one uniform variable, not one uniform
+ * element. We could insert dummy entries in the list for each array
+ * element after [0] but that causes complications elsewhere.
+ *
+ * We solve this problem by encoding two values in the location that's
+ * returned by glGetUniformLocation():
+ * a) index into gl_uniform_list::Uniforms[] for the uniform
+ * b) an array/field offset (0 for simple types)
+ *
+ * These two values are encoded in the high and low halves of a GLint.
+ * By putting the uniform number in the high part and the offset in the
+ * low part, we can support the unofficial ability to index into arrays
+ * by adding offsets to the location value.
+ */
+static void
+merge_location_offset(GLint *location, GLint offset)
+{
+ *location = (*location << 16) | offset;
+}
+
+
+/**
+ * Separate the uniform location and parameter offset. See above.
+ */
+static void
+split_location_offset(GLint *location, GLint *offset)
+{
+ *offset = *location & 0xffff;
+ *location = *location >> 16;
+}
+
+
+
+/**
+ * Called via glGetUniformfv().
+ */
+static void
+_mesa_get_uniformfv(struct gl_context *ctx, GLuint program, GLint location,
+ GLsizei bufSize, GLfloat *params)
+{
+ struct gl_program *prog;
+ GLint paramPos, offset;
+
+ split_location_offset(&location, &offset);
+
+ lookup_uniform_parameter(ctx, program, location, &prog, &paramPos);
+
+ if (prog) {
+ const struct gl_program_parameter *p =
+ &prog->Parameters->Parameters[paramPos];
+ GLint rows, cols, i, j, k;
+ GLsizei numBytes;
+
+ get_uniform_rows_cols(p, &rows, &cols);
+
+ numBytes = rows * cols * sizeof *params;
+ if (bufSize < numBytes) {
+ _mesa_error( ctx, GL_INVALID_OPERATION,
+ "glGetnUniformfvARB(out of bounds: bufSize is %d,"
+ " but %d bytes are required)", bufSize, numBytes );
+ return;
+ }
+
+ k = 0;
+ for (i = 0; i < rows; i++) {
+ const int base = paramPos + offset + i;
+
+ for (j = 0; j < cols; j++ ) {
+ params[k++] = prog->Parameters->ParameterValues[base][j];
+ }
+ }
+ }
+}
+
+
+/**
+ * Called via glGetUniformiv().
+ * \sa _mesa_get_uniformfv, only difference is a cast.
+ */
+static void
+_mesa_get_uniformiv(struct gl_context *ctx, GLuint program, GLint location,
+ GLsizei bufSize, GLint *params)
+{
+ struct gl_program *prog;
+ GLint paramPos, offset;
+
+ split_location_offset(&location, &offset);
+
+ lookup_uniform_parameter(ctx, program, location, &prog, &paramPos);
+
+ if (prog) {
+ const struct gl_program_parameter *p =
+ &prog->Parameters->Parameters[paramPos];
+ GLint rows, cols, i, j, k;
+ GLsizei numBytes;
+
+ get_uniform_rows_cols(p, &rows, &cols);
+
+ numBytes = rows * cols * sizeof *params;
+ if (bufSize < numBytes) {
+ _mesa_error( ctx, GL_INVALID_OPERATION,
+ "glGetnUniformivARB(out of bounds: bufSize is %d,"
+ " but %d bytes are required)", bufSize, numBytes );
+ return;
+ }
+
+ k = 0;
+ for (i = 0; i < rows; i++) {
+ const int base = paramPos + offset + i;
+
+ for (j = 0; j < cols; j++ ) {
+ params[k++] = (GLint) prog->Parameters->ParameterValues[base][j];
+ }
+ }
+ }
+}
+
+
+/**
+ * Called via glGetUniformuiv().
+ * New in GL_EXT_gpu_shader4, OpenGL 3.0
+ * \sa _mesa_get_uniformfv, only difference is a cast.
+ */
+static void
+_mesa_get_uniformuiv(struct gl_context *ctx, GLuint program, GLint location,
+ GLsizei bufSize, GLuint *params)
+{
+ struct gl_program *prog;
+ GLint paramPos, offset;
+
+ split_location_offset(&location, &offset);
+
+ lookup_uniform_parameter(ctx, program, location, &prog, &paramPos);
+
+ if (prog) {
+ const struct gl_program_parameter *p =
+ &prog->Parameters->Parameters[paramPos];
+ GLint rows, cols, i, j, k;
+ GLsizei numBytes;
+
+ get_uniform_rows_cols(p, &rows, &cols);
+
+ numBytes = rows * cols * sizeof *params;
+ if (bufSize < numBytes) {
+ _mesa_error( ctx, GL_INVALID_OPERATION,
+ "glGetnUniformuivARB(out of bounds: bufSize is %d,"
+ " but %d bytes are required)", bufSize, numBytes );
+ return;
+ }
+
+ k = 0;
+ for (i = 0; i < rows; i++) {
+ const int base = paramPos + offset + i;
+
+ for (j = 0; j < cols; j++ ) {
+ params[k++] = (GLuint) prog->Parameters->ParameterValues[base][j];
+ }
+ }
+ }
+}
+
+
+/**
+ * Called via glGetUniformdv().
+ * New in GL_ARB_gpu_shader_fp64, OpenGL 4.0
+ */
+static void
+_mesa_get_uniformdv(struct gl_context *ctx, GLuint program, GLint location,
+ GLsizei bufSize, GLdouble *params)
+{
+ _mesa_error(ctx, GL_INVALID_OPERATION, "glGetUniformdvARB"
+ "(GL_ARB_gpu_shader_fp64 not implemented)");
+}
+
+
+/**
+ * Called via glGetUniformLocation().
+ *
+ * The return value will encode two values, the uniform location and an
+ * offset (used for arrays, structs).
+ */
+GLint
+_mesa_get_uniform_location(struct gl_context *ctx, struct gl_shader_program *shProg,
+ const GLchar *name)
+{
+ GLint offset = 0, location = -1;
+
+ if (shProg->LinkStatus == GL_FALSE) {
+ _mesa_error(ctx, GL_INVALID_OPERATION, "glGetUniformfv(program)");
+ return -1;
+ }
+
+ /* XXX we should return -1 if the uniform was declared, but not
+ * actually used.
+ */
+
+ /* XXX we need to be able to parse uniform names for structs and arrays
+ * such as:
+ * mymatrix[1]
+ * mystruct.field1
+ */
+
+ {
+ /* handle 1-dimension arrays here... */
+ char *c = strchr(name, '[');
+ if (c) {
+ /* truncate name at [ */
+ const GLint len = c - name;
+ GLchar *newName = malloc(len + 1);
+ if (!newName)
+ return -1; /* out of mem */
+ memcpy(newName, name, len);
+ newName[len] = 0;
+
+ location = _mesa_lookup_uniform(shProg->Uniforms, newName);
+ if (location >= 0) {
+ const GLint element = atoi(c + 1);
+ if (element > 0) {
+ /* get type of the uniform array element */
+ struct gl_program_parameter *p;
+ p = get_uniform_parameter(shProg, location);
+ if (p) {
+ GLint rows, cols;
+ get_matrix_dims(p->DataType, &rows, &cols);
+ if (rows < 1)
+ rows = 1;
+ offset = element * rows;
+ }
+ }
+ }
+
+ free(newName);
+ }
+ }
+
+ if (location < 0) {
+ location = _mesa_lookup_uniform(shProg->Uniforms, name);
+ }
+
+ if (location >= 0) {
+ merge_location_offset(&location, offset);
+ }
+
+ return location;
+}
+
+
+
+/**
+ * Update the vertex/fragment program's TexturesUsed array.
+ *
+ * This needs to be called after glUniform(set sampler var) is called.
+ * A call to glUniform(samplerVar, value) causes a sampler to point to a
+ * particular texture unit. We know the sampler's texture target
+ * (1D/2D/3D/etc) from compile time but the sampler's texture unit is
+ * set by glUniform() calls.
+ *
+ * So, scan the program->SamplerUnits[] and program->SamplerTargets[]
+ * information to update the prog->TexturesUsed[] values.
+ * Each value of TexturesUsed[unit] is one of zero, TEXTURE_1D_INDEX,
+ * TEXTURE_2D_INDEX, TEXTURE_3D_INDEX, etc.
+ * We'll use that info for state validation before rendering.
+ */
+void
+_mesa_update_shader_textures_used(struct gl_program *prog)
+{
+ GLuint s;
+
+ memset(prog->TexturesUsed, 0, sizeof(prog->TexturesUsed));
+
+ for (s = 0; s < MAX_SAMPLERS; s++) {
+ if (prog->SamplersUsed & (1 << s)) {
+ GLuint unit = prog->SamplerUnits[s];
+ GLuint tgt = prog->SamplerTargets[s];
+ assert(unit < MAX_TEXTURE_IMAGE_UNITS);
+ assert(tgt < NUM_TEXTURE_TARGETS);
+ prog->TexturesUsed[unit] |= (1 << tgt);
+ }
+ }
+}
+
+
+/**
+ * Check if the type given by userType is allowed to set a uniform of the
+ * target type. Generally, equivalence is required, but setting Boolean
+ * uniforms can be done with glUniformiv or glUniformfv.
+ */
+static GLboolean
+compatible_types(GLenum userType, GLenum targetType)
+{
+ if (userType == targetType)
+ return GL_TRUE;
+
+ if (targetType == GL_BOOL && (userType == GL_FLOAT ||
+ userType == GL_UNSIGNED_INT ||
+ userType == GL_INT))
+ return GL_TRUE;
+
+ if (targetType == GL_BOOL_VEC2 && (userType == GL_FLOAT_VEC2 ||
+ userType == GL_UNSIGNED_INT_VEC2 ||
+ userType == GL_INT_VEC2))
+ return GL_TRUE;
+
+ if (targetType == GL_BOOL_VEC3 && (userType == GL_FLOAT_VEC3 ||
+ userType == GL_UNSIGNED_INT_VEC3 ||
+ userType == GL_INT_VEC3))
+ return GL_TRUE;
+
+ if (targetType == GL_BOOL_VEC4 && (userType == GL_FLOAT_VEC4 ||
+ userType == GL_UNSIGNED_INT_VEC4 ||
+ userType == GL_INT_VEC4))
+ return GL_TRUE;
+
+ if (is_sampler_type(targetType) && userType == GL_INT)
+ return GL_TRUE;
+
+ return GL_FALSE;
+}
+
+
+/**
+ * Set the value of a program's uniform variable.
+ * \param program the program whose uniform to update
+ * \param index the index of the program parameter for the uniform
+ * \param offset additional parameter slot offset (for arrays)
+ * \param type the incoming datatype of 'values'
+ * \param count the number of uniforms to set
+ * \param elems number of elements per uniform (1, 2, 3 or 4)
+ * \param values the new values, of datatype 'type'
+ */
+static void
+set_program_uniform(struct gl_context *ctx, struct gl_program *program,
+ GLint index, GLint offset,
+ GLenum type, GLsizei count, GLint elems,
+ const void *values)
+{
+ const struct gl_program_parameter *param =
+ &program->Parameters->Parameters[index];
+
+ assert(offset >= 0);
+ assert(elems >= 1);
+ assert(elems <= 4);
+
+ if (!compatible_types(type, param->DataType)) {
+ _mesa_error(ctx, GL_INVALID_OPERATION, "glUniform(type mismatch)");
+ return;
+ }
+
+ if (index + offset > (GLint) program->Parameters->Size) {
+ /* out of bounds! */
+ return;
+ }
+
+ if (param->Type == PROGRAM_SAMPLER) {
+ /* This controls which texture unit which is used by a sampler */
+ GLboolean changed = GL_FALSE;
+ GLint i;
+
+ /* this should have been caught by the compatible_types() check */
+ ASSERT(type == GL_INT);
+
+ /* loop over number of samplers to change */
+ for (i = 0; i < count; i++) {
+ GLuint sampler =
+ (GLuint) program->Parameters->ParameterValues[index + offset + i][0];
+ GLuint texUnit = ((GLuint *) values)[i];
+
+ /* check that the sampler (tex unit index) is legal */
+ if (texUnit >= ctx->Const.MaxTextureImageUnits) {
+ _mesa_error(ctx, GL_INVALID_VALUE,
+ "glUniform1(invalid sampler/tex unit index for '%s')",
+ param->Name);
+ return;
+ }
+
+ /* This maps a sampler to a texture unit: */
+ if (sampler < MAX_SAMPLERS) {
+#if 0
+ printf("Set program %p sampler %d '%s' to unit %u\n",
+ program, sampler, param->Name, texUnit);
+#endif
+ if (program->SamplerUnits[sampler] != texUnit) {
+ program->SamplerUnits[sampler] = texUnit;
+ changed = GL_TRUE;
+ }
+ }
+ }
+
+ if (changed) {
+ /* When a sampler's value changes it usually requires rewriting
+ * a GPU program's TEX instructions since there may not be a
+ * sampler->texture lookup table. We signal this with the
+ * ProgramStringNotify() callback.
+ */
+ FLUSH_VERTICES(ctx, _NEW_TEXTURE | _NEW_PROGRAM);
+ _mesa_update_shader_textures_used(program);
+ /* Do we need to care about the return value here?
+ * This should not be the first time the driver was notified of
+ * this program.
+ */
+ (void) ctx->Driver.ProgramStringNotify(ctx, program->Target, program);
+ }
+ }
+ else {
+ /* ordinary uniform variable */
+ const GLboolean isUniformBool = is_boolean_type(param->DataType);
+ const GLenum basicType = base_uniform_type(type);
+ const GLint slots = (param->Size + 3) / 4;
+ const GLint typeSize = _mesa_sizeof_glsl_type(param->DataType);
+ GLsizei k, i;
+
+ if ((GLint) param->Size > typeSize) {
+ /* an array */
+ /* we'll ignore extra data below */
+ }
+ else {
+ /* non-array: count must be at most one; count == 0 is handled by the loop below */
+ if (count > 1) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glUniform(uniform '%s' is not an array)",
+ param->Name);
+ return;
+ }
+ }
+
+ /* loop over number of array elements */
+ for (k = 0; k < count; k++) {
+ GLfloat *uniformVal;
+
+ if (offset + k >= slots) {
+ /* Extra array data is ignored */
+ break;
+ }
+
+ /* uniformVal (the destination) is always float[4] */
+ uniformVal = program->Parameters->ParameterValues[index + offset + k];
+
+ if (basicType == GL_INT) {
+ /* convert user's ints to floats */
+ const GLint *iValues = ((const GLint *) values) + k * elems;
+ for (i = 0; i < elems; i++) {
+ uniformVal[i] = (GLfloat) iValues[i];
+ }
+ }
+ else if (basicType == GL_UNSIGNED_INT) {
+ /* convert user's uints to floats */
+ const GLuint *iValues = ((const GLuint *) values) + k * elems;
+ for (i = 0; i < elems; i++) {
+ uniformVal[i] = (GLfloat) iValues[i];
+ }
+ }
+ else {
+ const GLfloat *fValues = ((const GLfloat *) values) + k * elems;
+ assert(basicType == GL_FLOAT);
+ for (i = 0; i < elems; i++) {
+ uniformVal[i] = fValues[i];
+ }
+ }
+
+ /* if the uniform is bool-valued, convert to 1.0 or 0.0 */
+ if (isUniformBool) {
+ for (i = 0; i < elems; i++) {
+ uniformVal[i] = uniformVal[i] ? 1.0f : 0.0f;
+ }
+ }
+ }
+ }
+}
+
+
+/**
+ * Called via glUniform*() functions.
+ */
+void
+_mesa_uniform(struct gl_context *ctx, struct gl_shader_program *shProg,
+ GLint location, GLsizei count,
+ const GLvoid *values, GLenum type)
+{
+ struct gl_uniform *uniform;
+ GLint elems, offset;
+
+ if (!shProg || !shProg->LinkStatus) {
+ _mesa_error(ctx, GL_INVALID_OPERATION, "glUniform(program not linked)");
+ return;
+ }
+
+ if (location == -1)
+ return; /* The standard specifies this as a no-op */
+
+ if (location < -1) {
+ _mesa_error(ctx, GL_INVALID_OPERATION, "glUniform(location=%d)",
+ location);
+ return;
+ }
+
+ split_location_offset(&location, &offset);
+
+ if (location < 0 || location >= (GLint) shProg->Uniforms->NumUniforms) {
+ _mesa_error(ctx, GL_INVALID_VALUE, "glUniform(location=%d)", location);
+ return;
+ }
+
+ if (count < 0) {
+ _mesa_error(ctx, GL_INVALID_VALUE, "glUniform(count < 0)");
+ return;
+ }
+
+ elems = _mesa_sizeof_glsl_type(type);
+
+ FLUSH_VERTICES(ctx, _NEW_PROGRAM_CONSTANTS);
+
+ uniform = &shProg->Uniforms->Uniforms[location];
+
+ if (ctx->Shader.Flags & GLSL_UNIFORMS) {
+ const GLenum basicType = base_uniform_type(type);
+ GLint i;
+ printf("Mesa: set program %u uniform %s (loc %d) to: ",
+ shProg->Name, uniform->Name, location);
+ if (basicType == GL_INT) {
+ const GLint *v = (const GLint *) values;
+ for (i = 0; i < count * elems; i++) {
+ printf("%d ", v[i]);
+ }
+ }
+ else if (basicType == GL_UNSIGNED_INT) {
+ const GLuint *v = (const GLuint *) values;
+ for (i = 0; i < count * elems; i++) {
+ printf("%u ", v[i]);
+ }
+ }
+ else {
+ const GLfloat *v = (const GLfloat *) values;
+ assert(basicType == GL_FLOAT);
+ for (i = 0; i < count * elems; i++) {
+ printf("%g ", v[i]);
+ }
+ }
+ printf("\n");
+ }
+
+ /* A uniform var may be used by both a vertex shader and a fragment
+ * shader. We may need to update one or both shader's uniform here:
+ */
+ if (shProg->VertexProgram) {
+ /* convert uniform location to program parameter index */
+ GLint index = uniform->VertPos;
+ if (index >= 0) {
+ set_program_uniform(ctx, &shProg->VertexProgram->Base,
+ index, offset, type, count, elems, values);
+ }
+ }
+
+ if (shProg->FragmentProgram) {
+ /* convert uniform location to program parameter index */
+ GLint index = uniform->FragPos;
+ if (index >= 0) {
+ set_program_uniform(ctx, &shProg->FragmentProgram->Base,
+ index, offset, type, count, elems, values);
+ }
+ }
+
+ if (shProg->GeometryProgram) {
+ /* convert uniform location to program parameter index */
+ GLint index = uniform->GeomPos;
+ if (index >= 0) {
+ set_program_uniform(ctx, &shProg->GeometryProgram->Base,
+ index, offset, type, count, elems, values);
+ }
+ }
+
+ uniform->Initialized = GL_TRUE;
+}
+
+
+/**
+ * Set a matrix-valued program parameter.
+ */
+static void
+set_program_uniform_matrix(struct gl_context *ctx, struct gl_program *program,
+ GLuint index, GLuint offset,
+ GLuint count, GLuint rows, GLuint cols,
+ GLboolean transpose, const GLfloat *values)
+{
+ GLuint mat, row, col;
+ GLuint src = 0;
+ const struct gl_program_parameter * param = &program->Parameters->Parameters[index];
+ const GLuint slots = (param->Size + 3) / 4;
+ const GLint typeSize = _mesa_sizeof_glsl_type(param->DataType);
+ GLint nr, nc;
+
+ /* check that the number of rows, columns is correct */
+ get_matrix_dims(param->DataType, &nr, &nc);
+ if (rows != nr || cols != nc) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glUniformMatrix(matrix size mismatch)");
+ return;
+ }
+
+ if ((GLint) param->Size <= typeSize) {
+ /* non-array: count must be at most one; count == 0 is handled by the loop below */
+ if (count > 1) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glUniformMatrix(uniform is not an array)");
+ return;
+ }
+ }
+
+ /*
+ * Note: the _columns_ of a matrix are stored in program registers, not
+ * the rows. So, the loops below look a little funny.
+ * XXX could optimize this a bit...
+ */
+
+ /* loop over matrices */
+ for (mat = 0; mat < count; mat++) {
+
+ /* each matrix: */
+ for (col = 0; col < cols; col++) {
+ GLfloat *v;
+ if (offset >= slots) {
+ /* Ignore writes beyond the end of (the used part of) an array */
+ return;
+ }
+ v = program->Parameters->ParameterValues[index + offset];
+ for (row = 0; row < rows; row++) {
+ if (transpose) {
+ v[row] = values[src + row * cols + col];
+ }
+ else {
+ v[row] = values[src + col * rows + row];
+ }
+ }
+
+ offset++;
+ }
+
+ src += rows * cols; /* next matrix */
+ }
+}
+
+
+/**
+ * Called by glUniformMatrix*() functions.
+ * Note: cols=2, rows=4 ==> array[2] of vec4
+ */
+void
+_mesa_uniform_matrix(struct gl_context *ctx, struct gl_shader_program *shProg,
+ GLint cols, GLint rows,
+ GLint location, GLsizei count,
+ GLboolean transpose, const GLfloat *values)
+{
+ struct gl_uniform *uniform;
+ GLint offset;
+
+ if (!shProg || !shProg->LinkStatus) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glUniformMatrix(program not linked)");
+ return;
+ }
+
+ if (location == -1)
+ return; /* The standard specifies this as a no-op */
+
+ if (location < -1) {
+ _mesa_error(ctx, GL_INVALID_OPERATION, "glUniformMatrix(location)");
+ return;
+ }
+
+ split_location_offset(&location, &offset);
+
+ if (location < 0 || location >= (GLint) shProg->Uniforms->NumUniforms) {
+ _mesa_error(ctx, GL_INVALID_VALUE, "glUniformMatrix(location)");
+ return;
+ }
+ if (values == NULL) {
+ _mesa_error(ctx, GL_INVALID_VALUE, "glUniformMatrix");
+ return;
+ }
+
+ FLUSH_VERTICES(ctx, _NEW_PROGRAM_CONSTANTS);
+
+ uniform = &shProg->Uniforms->Uniforms[location];
+
+ if (shProg->VertexProgram) {
+ /* convert uniform location to program parameter index */
+ GLint index = uniform->VertPos;
+ if (index >= 0) {
+ set_program_uniform_matrix(ctx, &shProg->VertexProgram->Base,
+ index, offset,
+ count, rows, cols, transpose, values);
+ }
+ }
+
+ if (shProg->FragmentProgram) {
+ /* convert uniform location to program parameter index */
+ GLint index = uniform->FragPos;
+ if (index >= 0) {
+ set_program_uniform_matrix(ctx, &shProg->FragmentProgram->Base,
+ index, offset,
+ count, rows, cols, transpose, values);
+ }
+ }
+
+ if (shProg->GeometryProgram) {
+ /* convert uniform location to program parameter index */
+ GLint index = uniform->GeomPos;
+ if (index >= 0) {
+ set_program_uniform_matrix(ctx, &shProg->GeometryProgram->Base,
+ index, offset,
+ count, rows, cols, transpose, values);
+ }
+ }
+
+ uniform->Initialized = GL_TRUE;
+}
+
+
+void GLAPIENTRY
+_mesa_Uniform1fARB(GLint location, GLfloat v0)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ _mesa_uniform(ctx, ctx->Shader.ActiveProgram, location, 1, &v0, GL_FLOAT);
+}
+
+void GLAPIENTRY
+_mesa_Uniform2fARB(GLint location, GLfloat v0, GLfloat v1)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ GLfloat v[2];
+ v[0] = v0;
+ v[1] = v1;
+ _mesa_uniform(ctx, ctx->Shader.ActiveProgram, location, 1, v, GL_FLOAT_VEC2);
+}
+
+void GLAPIENTRY
+_mesa_Uniform3fARB(GLint location, GLfloat v0, GLfloat v1, GLfloat v2)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ GLfloat v[3];
+ v[0] = v0;
+ v[1] = v1;
+ v[2] = v2;
+ _mesa_uniform(ctx, ctx->Shader.ActiveProgram, location, 1, v, GL_FLOAT_VEC3);
+}
+
+void GLAPIENTRY
+_mesa_Uniform4fARB(GLint location, GLfloat v0, GLfloat v1, GLfloat v2,
+ GLfloat v3)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ GLfloat v[4];
+ v[0] = v0;
+ v[1] = v1;
+ v[2] = v2;
+ v[3] = v3;
+ _mesa_uniform(ctx, ctx->Shader.ActiveProgram, location, 1, v, GL_FLOAT_VEC4);
+}
+
+void GLAPIENTRY
+_mesa_Uniform1iARB(GLint location, GLint v0)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ _mesa_uniform(ctx, ctx->Shader.ActiveProgram, location, 1, &v0, GL_INT);
+}
+
+void GLAPIENTRY
+_mesa_Uniform2iARB(GLint location, GLint v0, GLint v1)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ GLint v[2];
+ v[0] = v0;
+ v[1] = v1;
+ _mesa_uniform(ctx, ctx->Shader.ActiveProgram, location, 1, v, GL_INT_VEC2);
+}
+
+void GLAPIENTRY
+_mesa_Uniform3iARB(GLint location, GLint v0, GLint v1, GLint v2)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ GLint v[3];
+ v[0] = v0;
+ v[1] = v1;
+ v[2] = v2;
+ _mesa_uniform(ctx, ctx->Shader.ActiveProgram, location, 1, v, GL_INT_VEC3);
+}
+
+void GLAPIENTRY
+_mesa_Uniform4iARB(GLint location, GLint v0, GLint v1, GLint v2, GLint v3)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ GLint v[4];
+ v[0] = v0;
+ v[1] = v1;
+ v[2] = v2;
+ v[3] = v3;
+ _mesa_uniform(ctx, ctx->Shader.ActiveProgram, location, 1, v, GL_INT_VEC4);
+}
+
+void GLAPIENTRY
+_mesa_Uniform1fvARB(GLint location, GLsizei count, const GLfloat * value)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ _mesa_uniform(ctx, ctx->Shader.ActiveProgram, location, count, value, GL_FLOAT);
+}
+
+void GLAPIENTRY
+_mesa_Uniform2fvARB(GLint location, GLsizei count, const GLfloat * value)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ _mesa_uniform(ctx, ctx->Shader.ActiveProgram, location, count, value, GL_FLOAT_VEC2);
+}
+
+void GLAPIENTRY
+_mesa_Uniform3fvARB(GLint location, GLsizei count, const GLfloat * value)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ _mesa_uniform(ctx, ctx->Shader.ActiveProgram, location, count, value, GL_FLOAT_VEC3);
+}
+
+void GLAPIENTRY
+_mesa_Uniform4fvARB(GLint location, GLsizei count, const GLfloat * value)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ _mesa_uniform(ctx, ctx->Shader.ActiveProgram, location, count, value, GL_FLOAT_VEC4);
+}
+
+void GLAPIENTRY
+_mesa_Uniform1ivARB(GLint location, GLsizei count, const GLint * value)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ _mesa_uniform(ctx, ctx->Shader.ActiveProgram, location, count, value, GL_INT);
+}
+
+void GLAPIENTRY
+_mesa_Uniform2ivARB(GLint location, GLsizei count, const GLint * value)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ _mesa_uniform(ctx, ctx->Shader.ActiveProgram, location, count, value, GL_INT_VEC2);
+}
+
+void GLAPIENTRY
+_mesa_Uniform3ivARB(GLint location, GLsizei count, const GLint * value)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ _mesa_uniform(ctx, ctx->Shader.ActiveProgram, location, count, value, GL_INT_VEC3);
+}
+
+void GLAPIENTRY
+_mesa_Uniform4ivARB(GLint location, GLsizei count, const GLint * value)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ _mesa_uniform(ctx, ctx->Shader.ActiveProgram, location, count, value, GL_INT_VEC4);
+}
+
+
+/** OpenGL 3.0 GLuint-valued functions **/
+void GLAPIENTRY
+_mesa_Uniform1ui(GLint location, GLuint v0)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ _mesa_uniform(ctx, ctx->Shader.ActiveProgram, location, 1, &v0, GL_UNSIGNED_INT);
+}
+
+void GLAPIENTRY
+_mesa_Uniform2ui(GLint location, GLuint v0, GLuint v1)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ GLuint v[2];
+ v[0] = v0;
+ v[1] = v1;
+ _mesa_uniform(ctx, ctx->Shader.ActiveProgram, location, 1, v, GL_UNSIGNED_INT_VEC2);
+}
+
+void GLAPIENTRY
+_mesa_Uniform3ui(GLint location, GLuint v0, GLuint v1, GLuint v2)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ GLuint v[3];
+ v[0] = v0;
+ v[1] = v1;
+ v[2] = v2;
+ _mesa_uniform(ctx, ctx->Shader.ActiveProgram, location, 1, v, GL_UNSIGNED_INT_VEC3);
+}
+
+void GLAPIENTRY
+_mesa_Uniform4ui(GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ GLuint v[4];
+ v[0] = v0;
+ v[1] = v1;
+ v[2] = v2;
+ v[3] = v3;
+ _mesa_uniform(ctx, ctx->Shader.ActiveProgram, location, 1, v, GL_UNSIGNED_INT_VEC4);
+}
+
+void GLAPIENTRY
+_mesa_Uniform1uiv(GLint location, GLsizei count, const GLuint *value)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ _mesa_uniform(ctx, ctx->Shader.ActiveProgram, location, count, value, GL_UNSIGNED_INT);
+}
+
+void GLAPIENTRY
+_mesa_Uniform2uiv(GLint location, GLsizei count, const GLuint *value)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ _mesa_uniform(ctx, ctx->Shader.ActiveProgram, location, count, value, GL_UNSIGNED_INT_VEC2);
+}
+
+void GLAPIENTRY
+_mesa_Uniform3uiv(GLint location, GLsizei count, const GLuint *value)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ _mesa_uniform(ctx, ctx->Shader.ActiveProgram, location, count, value, GL_UNSIGNED_INT_VEC3);
+}
+
+void GLAPIENTRY
+_mesa_Uniform4uiv(GLint location, GLsizei count, const GLuint *value)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ _mesa_uniform(ctx, ctx->Shader.ActiveProgram, location, count, value, GL_UNSIGNED_INT_VEC4);
+}
+
+
+
+void GLAPIENTRY
+_mesa_UniformMatrix2fvARB(GLint location, GLsizei count, GLboolean transpose,
+ const GLfloat * value)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ _mesa_uniform_matrix(ctx, ctx->Shader.ActiveProgram,
+ 2, 2, location, count, transpose, value);
+}
+
+void GLAPIENTRY
+_mesa_UniformMatrix3fvARB(GLint location, GLsizei count, GLboolean transpose,
+ const GLfloat * value)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ _mesa_uniform_matrix(ctx, ctx->Shader.ActiveProgram,
+ 3, 3, location, count, transpose, value);
+}
+
+void GLAPIENTRY
+_mesa_UniformMatrix4fvARB(GLint location, GLsizei count, GLboolean transpose,
+ const GLfloat * value)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ _mesa_uniform_matrix(ctx, ctx->Shader.ActiveProgram,
+ 4, 4, location, count, transpose, value);
+}
+
+
+/**
+ * Non-square UniformMatrix are OpenGL 2.1
+ */
+void GLAPIENTRY
+_mesa_UniformMatrix2x3fv(GLint location, GLsizei count, GLboolean transpose,
+ const GLfloat *value)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ _mesa_uniform_matrix(ctx, ctx->Shader.ActiveProgram,
+ 2, 3, location, count, transpose, value);
+}
+
+void GLAPIENTRY
+_mesa_UniformMatrix3x2fv(GLint location, GLsizei count, GLboolean transpose,
+ const GLfloat *value)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ _mesa_uniform_matrix(ctx, ctx->Shader.ActiveProgram,
+ 3, 2, location, count, transpose, value);
+}
+
+void GLAPIENTRY
+_mesa_UniformMatrix2x4fv(GLint location, GLsizei count, GLboolean transpose,
+ const GLfloat *value)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ _mesa_uniform_matrix(ctx, ctx->Shader.ActiveProgram,
+ 2, 4, location, count, transpose, value);
+}
+
+void GLAPIENTRY
+_mesa_UniformMatrix4x2fv(GLint location, GLsizei count, GLboolean transpose,
+ const GLfloat *value)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ _mesa_uniform_matrix(ctx, ctx->Shader.ActiveProgram,
+ 4, 2, location, count, transpose, value);
+}
+
+void GLAPIENTRY
+_mesa_UniformMatrix3x4fv(GLint location, GLsizei count, GLboolean transpose,
+ const GLfloat *value)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ _mesa_uniform_matrix(ctx, ctx->Shader.ActiveProgram,
+ 3, 4, location, count, transpose, value);
+}
+
+void GLAPIENTRY
+_mesa_UniformMatrix4x3fv(GLint location, GLsizei count, GLboolean transpose,
+ const GLfloat *value)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ _mesa_uniform_matrix(ctx, ctx->Shader.ActiveProgram,
+ 4, 3, location, count, transpose, value);
+}
+
+
+void GLAPIENTRY
+_mesa_GetnUniformfvARB(GLhandleARB program, GLint location,
+ GLsizei bufSize, GLfloat *params)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ _mesa_get_uniformfv(ctx, program, location, bufSize, params);
+}
+
+void GLAPIENTRY
+_mesa_GetUniformfvARB(GLhandleARB program, GLint location, GLfloat *params)
+{
+ _mesa_GetnUniformfvARB(program, location, INT_MAX, params);
+}
+
+
+void GLAPIENTRY
+_mesa_GetnUniformivARB(GLhandleARB program, GLint location,
+ GLsizei bufSize, GLint *params)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ _mesa_get_uniformiv(ctx, program, location, bufSize, params);
+}
+
+void GLAPIENTRY
+_mesa_GetUniformivARB(GLhandleARB program, GLint location, GLint *params)
+{
+ _mesa_GetnUniformivARB(program, location, INT_MAX, params);
+}
+
+
+/* GL3 */
+void GLAPIENTRY
+_mesa_GetnUniformuivARB(GLhandleARB program, GLint location,
+ GLsizei bufSize, GLuint *params)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ _mesa_get_uniformuiv(ctx, program, location, bufSize, params);
+}
+
+void GLAPIENTRY
+_mesa_GetUniformuiv(GLhandleARB program, GLint location, GLuint *params)
+{
+ _mesa_GetnUniformuivARB(program, location, INT_MAX, params);
+}
+
+
+/* GL4 */
+void GLAPIENTRY
+_mesa_GetnUniformdvARB(GLhandleARB program, GLint location,
+ GLsizei bufSize, GLdouble *params)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ _mesa_get_uniformdv(ctx, program, location, bufSize, params);
+}
+
+void GLAPIENTRY
+_mesa_GetUniformdv(GLhandleARB program, GLint location, GLdouble *params)
+{
+ _mesa_GetnUniformdvARB(program, location, INT_MAX, params);
+}
+
+
+GLint GLAPIENTRY
+_mesa_GetUniformLocationARB(GLhandleARB programObj, const GLcharARB *name)
+{
+ struct gl_shader_program *shProg;
+
+ GET_CURRENT_CONTEXT(ctx);
+
+ shProg = _mesa_lookup_shader_program_err(ctx, programObj,
+ "glGetUniformLocation");
+ if (!shProg)
+ return -1;
+
+ return _mesa_get_uniform_location(ctx, shProg, name);
+}
+
+
+void GLAPIENTRY
+_mesa_GetActiveUniformARB(GLhandleARB program, GLuint index,
+ GLsizei maxLength, GLsizei * length, GLint * size,
+ GLenum * type, GLcharARB * name)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ _mesa_get_active_uniform(ctx, program, index, maxLength, length, size,
+ type, name);
+}
+
+
+/**
+ * Plug in shader uniform-related functions into API dispatch table.
+ */
+void
+_mesa_init_shader_uniform_dispatch(struct _glapi_table *exec)
+{
+#if FEATURE_GL
+ SET_Uniform1fARB(exec, _mesa_Uniform1fARB);
+ SET_Uniform2fARB(exec, _mesa_Uniform2fARB);
+ SET_Uniform3fARB(exec, _mesa_Uniform3fARB);
+ SET_Uniform4fARB(exec, _mesa_Uniform4fARB);
+ SET_Uniform1iARB(exec, _mesa_Uniform1iARB);
+ SET_Uniform2iARB(exec, _mesa_Uniform2iARB);
+ SET_Uniform3iARB(exec, _mesa_Uniform3iARB);
+ SET_Uniform4iARB(exec, _mesa_Uniform4iARB);
+ SET_Uniform1fvARB(exec, _mesa_Uniform1fvARB);
+ SET_Uniform2fvARB(exec, _mesa_Uniform2fvARB);
+ SET_Uniform3fvARB(exec, _mesa_Uniform3fvARB);
+ SET_Uniform4fvARB(exec, _mesa_Uniform4fvARB);
+ SET_Uniform1ivARB(exec, _mesa_Uniform1ivARB);
+ SET_Uniform2ivARB(exec, _mesa_Uniform2ivARB);
+ SET_Uniform3ivARB(exec, _mesa_Uniform3ivARB);
+ SET_Uniform4ivARB(exec, _mesa_Uniform4ivARB);
+ SET_UniformMatrix2fvARB(exec, _mesa_UniformMatrix2fvARB);
+ SET_UniformMatrix3fvARB(exec, _mesa_UniformMatrix3fvARB);
+ SET_UniformMatrix4fvARB(exec, _mesa_UniformMatrix4fvARB);
+
+ SET_GetActiveUniformARB(exec, _mesa_GetActiveUniformARB);
+ SET_GetUniformLocationARB(exec, _mesa_GetUniformLocationARB);
+ SET_GetUniformfvARB(exec, _mesa_GetUniformfvARB);
+ SET_GetUniformivARB(exec, _mesa_GetUniformivARB);
+
+ /* OpenGL 2.1 */
+ SET_UniformMatrix2x3fv(exec, _mesa_UniformMatrix2x3fv);
+ SET_UniformMatrix3x2fv(exec, _mesa_UniformMatrix3x2fv);
+ SET_UniformMatrix2x4fv(exec, _mesa_UniformMatrix2x4fv);
+ SET_UniformMatrix4x2fv(exec, _mesa_UniformMatrix4x2fv);
+ SET_UniformMatrix3x4fv(exec, _mesa_UniformMatrix3x4fv);
+ SET_UniformMatrix4x3fv(exec, _mesa_UniformMatrix4x3fv);
+
+ /* OpenGL 3.0 */
+ /* XXX finish dispatch */
+ SET_Uniform1uiEXT(exec, _mesa_Uniform1ui);
+ SET_Uniform2uiEXT(exec, _mesa_Uniform2ui);
+ SET_Uniform3uiEXT(exec, _mesa_Uniform3ui);
+ SET_Uniform4uiEXT(exec, _mesa_Uniform4ui);
+ SET_Uniform1uivEXT(exec, _mesa_Uniform1uiv);
+ SET_Uniform2uivEXT(exec, _mesa_Uniform2uiv);
+ SET_Uniform3uivEXT(exec, _mesa_Uniform3uiv);
+ SET_Uniform4uivEXT(exec, _mesa_Uniform4uiv);
+ SET_GetUniformuivEXT(exec, _mesa_GetUniformuiv);
+
+ /* GL_ARB_robustness */
+ SET_GetnUniformfvARB(exec, _mesa_GetnUniformfvARB);
+ SET_GetnUniformivARB(exec, _mesa_GetnUniformivARB);
+ SET_GetnUniformuivARB(exec, _mesa_GetnUniformuivARB);
+ SET_GetnUniformdvARB(exec, _mesa_GetnUniformdvARB); /* GL 4.0 */
+
+#endif /* FEATURE_GL */
+}
diff --git a/mesalib/src/mesa/main/uniforms.h b/mesalib/src/mesa/main/uniforms.h
index b024cb30b..adc3c6406 100644
--- a/mesalib/src/mesa/main/uniforms.h
+++ b/mesalib/src/mesa/main/uniforms.h
@@ -1,208 +1,208 @@
-/*
- * Mesa 3-D graphics library
- *
- * Copyright (C) 2010 VMware, Inc. All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-
-#ifndef UNIFORMS_H
-#define UNIFORMS_H
-
-#include "glheader.h"
-#include "program/prog_parameter.h"
-
-struct gl_program;
-struct _glapi_table;
-
-extern void GLAPIENTRY
-_mesa_Uniform1fARB(GLint, GLfloat);
-
-extern void GLAPIENTRY
-_mesa_Uniform2fARB(GLint, GLfloat, GLfloat);
-
-extern void GLAPIENTRY
-_mesa_Uniform3fARB(GLint, GLfloat, GLfloat, GLfloat);
-
-extern void GLAPIENTRY
-_mesa_Uniform4fARB(GLint, GLfloat, GLfloat, GLfloat, GLfloat);
-
-extern void GLAPIENTRY
-_mesa_Uniform1iARB(GLint, GLint);
-
-extern void GLAPIENTRY
-_mesa_Uniform2iARB(GLint, GLint, GLint);
-
-extern void GLAPIENTRY
-_mesa_Uniform3iARB(GLint, GLint, GLint, GLint);
-
-extern void GLAPIENTRY
-_mesa_Uniform4iARB(GLint, GLint, GLint, GLint, GLint);
-
-extern void GLAPIENTRY
-_mesa_Uniform1fvARB(GLint, GLsizei, const GLfloat *);
-
-extern void GLAPIENTRY
-_mesa_Uniform2fvARB(GLint, GLsizei, const GLfloat *);
-
-extern void GLAPIENTRY
-_mesa_Uniform3fvARB(GLint, GLsizei, const GLfloat *);
-
-extern void GLAPIENTRY
-_mesa_Uniform4fvARB(GLint, GLsizei, const GLfloat *);
-
-extern void GLAPIENTRY
-_mesa_Uniform1ivARB(GLint, GLsizei, const GLint *);
-
-extern void GLAPIENTRY
-_mesa_Uniform2ivARB(GLint, GLsizei, const GLint *);
-
-extern void GLAPIENTRY
-_mesa_Uniform3ivARB(GLint, GLsizei, const GLint *);
-
-extern void GLAPIENTRY
-_mesa_Uniform4ivARB(GLint, GLsizei, const GLint *);
-
-extern void GLAPIENTRY
-_mesa_Uniform1ui(GLint location, GLuint v0);
-
-extern void GLAPIENTRY
-_mesa_Uniform2ui(GLint location, GLuint v0, GLuint v1);
-
-extern void GLAPIENTRY
-_mesa_Uniform3ui(GLint location, GLuint v0, GLuint v1, GLuint v2);
-
-extern void GLAPIENTRY
-_mesa_Uniform4ui(GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
-
-extern void GLAPIENTRY
-_mesa_Uniform1uiv(GLint location, GLsizei count, const GLuint *value);
-
-extern void GLAPIENTRY
-_mesa_Uniform2uiv(GLint location, GLsizei count, const GLuint *value);
-
-extern void GLAPIENTRY
-_mesa_Uniform3uiv(GLint location, GLsizei count, const GLuint *value);
-
-extern void GLAPIENTRY
-_mesa_Uniform4uiv(GLint location, GLsizei count, const GLuint *value);
-
-
-extern void GLAPIENTRY
-_mesa_UniformMatrix2fvARB(GLint, GLsizei, GLboolean, const GLfloat *);
-
-extern void GLAPIENTRY
-_mesa_UniformMatrix3fvARB(GLint, GLsizei, GLboolean, const GLfloat *);
-
-extern void GLAPIENTRY
-_mesa_UniformMatrix4fvARB(GLint, GLsizei, GLboolean, const GLfloat *);
-
-extern void GLAPIENTRY
-_mesa_UniformMatrix2x3fv(GLint location, GLsizei count, GLboolean transpose,
- const GLfloat *value);
-
-extern void GLAPIENTRY
-_mesa_UniformMatrix3x2fv(GLint location, GLsizei count, GLboolean transpose,
- const GLfloat *value);
-
-extern void GLAPIENTRY
-_mesa_UniformMatrix2x4fv(GLint location, GLsizei count, GLboolean transpose,
- const GLfloat *value);
-
-extern void GLAPIENTRY
-_mesa_UniformMatrix4x2fv(GLint location, GLsizei count, GLboolean transpose,
- const GLfloat *value);
-
-extern void GLAPIENTRY
-_mesa_UniformMatrix3x4fv(GLint location, GLsizei count, GLboolean transpose,
- const GLfloat *value);
-
-extern void GLAPIENTRY
-_mesa_UniformMatrix4x3fv(GLint location, GLsizei count, GLboolean transpose,
- const GLfloat *value);
-
-
-extern void GLAPIENTRY
-_mesa_GetActiveUniformARB(GLhandleARB, GLuint, GLsizei, GLsizei *,
- GLint *, GLenum *, GLcharARB *);
-
-extern void GLAPIENTRY
-_mesa_GetUniformfvARB(GLhandleARB, GLint, GLfloat *);
-
-extern void GLAPIENTRY
-_mesa_GetnUniformfvARB(GLhandleARB, GLint, GLsizei, GLfloat *);
-
-extern void GLAPIENTRY
-_mesa_GetUniformivARB(GLhandleARB, GLint, GLint *);
-
-extern void GLAPIENTRY
-_mesa_GetnUniformivARB(GLhandleARB, GLint, GLsizei, GLint *);
-
-extern void GLAPIENTRY
-_mesa_GetUniformuiv(GLhandleARB, GLint, GLuint *);
-
-extern void GLAPIENTRY
-_mesa_GetnUniformuivARB(GLhandleARB, GLint, GLsizei, GLuint *);
-
-extern void GLAPIENTRY
-_mesa_GetUniformdv(GLhandleARB, GLint, GLdouble *);
-
-extern void GLAPIENTRY
-_mesa_GetnUniformdvARB(GLhandleARB, GLint, GLsizei, GLdouble *);
-
-extern GLint GLAPIENTRY
-_mesa_GetUniformLocationARB(GLhandleARB, const GLcharARB *);
-
-GLint
-_mesa_get_uniform_location(struct gl_context *ctx, struct gl_shader_program *shProg,
- const GLchar *name);
-
-void
-_mesa_uniform(struct gl_context *ctx, struct gl_shader_program *shader_program,
- GLint location, GLsizei count,
- const GLvoid *values, GLenum type);
-
-void
-_mesa_uniform_matrix(struct gl_context *ctx, struct gl_shader_program *shProg,
- GLint cols, GLint rows,
- GLint location, GLsizei count,
- GLboolean transpose, const GLfloat *values);
-
-extern void
-_mesa_update_shader_textures_used(struct gl_program *prog);
-
-
-extern void
-_mesa_init_shader_uniform_dispatch(struct _glapi_table *exec);
-
-struct gl_builtin_uniform_element {
- const char *field;
- int tokens[STATE_LENGTH];
- int swizzle;
-};
-
-struct gl_builtin_uniform_desc {
- const char *name;
- struct gl_builtin_uniform_element *elements;
- unsigned int num_elements;
-};
-
-extern const struct gl_builtin_uniform_desc _mesa_builtin_uniform_desc[];
-
-#endif /* UNIFORMS_H */
+/*
+ * Mesa 3-D graphics library
+ *
+ * Copyright (C) 2010 VMware, Inc. All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+
+#ifndef UNIFORMS_H
+#define UNIFORMS_H
+
+#include "glheader.h"
+#include "program/prog_parameter.h"
+
+struct gl_program;
+struct _glapi_table;
+
+extern void GLAPIENTRY
+_mesa_Uniform1fARB(GLint, GLfloat);
+
+extern void GLAPIENTRY
+_mesa_Uniform2fARB(GLint, GLfloat, GLfloat);
+
+extern void GLAPIENTRY
+_mesa_Uniform3fARB(GLint, GLfloat, GLfloat, GLfloat);
+
+extern void GLAPIENTRY
+_mesa_Uniform4fARB(GLint, GLfloat, GLfloat, GLfloat, GLfloat);
+
+extern void GLAPIENTRY
+_mesa_Uniform1iARB(GLint, GLint);
+
+extern void GLAPIENTRY
+_mesa_Uniform2iARB(GLint, GLint, GLint);
+
+extern void GLAPIENTRY
+_mesa_Uniform3iARB(GLint, GLint, GLint, GLint);
+
+extern void GLAPIENTRY
+_mesa_Uniform4iARB(GLint, GLint, GLint, GLint, GLint);
+
+extern void GLAPIENTRY
+_mesa_Uniform1fvARB(GLint, GLsizei, const GLfloat *);
+
+extern void GLAPIENTRY
+_mesa_Uniform2fvARB(GLint, GLsizei, const GLfloat *);
+
+extern void GLAPIENTRY
+_mesa_Uniform3fvARB(GLint, GLsizei, const GLfloat *);
+
+extern void GLAPIENTRY
+_mesa_Uniform4fvARB(GLint, GLsizei, const GLfloat *);
+
+extern void GLAPIENTRY
+_mesa_Uniform1ivARB(GLint, GLsizei, const GLint *);
+
+extern void GLAPIENTRY
+_mesa_Uniform2ivARB(GLint, GLsizei, const GLint *);
+
+extern void GLAPIENTRY
+_mesa_Uniform3ivARB(GLint, GLsizei, const GLint *);
+
+extern void GLAPIENTRY
+_mesa_Uniform4ivARB(GLint, GLsizei, const GLint *);
+
+extern void GLAPIENTRY
+_mesa_Uniform1ui(GLint location, GLuint v0);
+
+extern void GLAPIENTRY
+_mesa_Uniform2ui(GLint location, GLuint v0, GLuint v1);
+
+extern void GLAPIENTRY
+_mesa_Uniform3ui(GLint location, GLuint v0, GLuint v1, GLuint v2);
+
+extern void GLAPIENTRY
+_mesa_Uniform4ui(GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
+
+extern void GLAPIENTRY
+_mesa_Uniform1uiv(GLint location, GLsizei count, const GLuint *value);
+
+extern void GLAPIENTRY
+_mesa_Uniform2uiv(GLint location, GLsizei count, const GLuint *value);
+
+extern void GLAPIENTRY
+_mesa_Uniform3uiv(GLint location, GLsizei count, const GLuint *value);
+
+extern void GLAPIENTRY
+_mesa_Uniform4uiv(GLint location, GLsizei count, const GLuint *value);
+
+
+extern void GLAPIENTRY
+_mesa_UniformMatrix2fvARB(GLint, GLsizei, GLboolean, const GLfloat *);
+
+extern void GLAPIENTRY
+_mesa_UniformMatrix3fvARB(GLint, GLsizei, GLboolean, const GLfloat *);
+
+extern void GLAPIENTRY
+_mesa_UniformMatrix4fvARB(GLint, GLsizei, GLboolean, const GLfloat *);
+
+extern void GLAPIENTRY
+_mesa_UniformMatrix2x3fv(GLint location, GLsizei count, GLboolean transpose,
+ const GLfloat *value);
+
+extern void GLAPIENTRY
+_mesa_UniformMatrix3x2fv(GLint location, GLsizei count, GLboolean transpose,
+ const GLfloat *value);
+
+extern void GLAPIENTRY
+_mesa_UniformMatrix2x4fv(GLint location, GLsizei count, GLboolean transpose,
+ const GLfloat *value);
+
+extern void GLAPIENTRY
+_mesa_UniformMatrix4x2fv(GLint location, GLsizei count, GLboolean transpose,
+ const GLfloat *value);
+
+extern void GLAPIENTRY
+_mesa_UniformMatrix3x4fv(GLint location, GLsizei count, GLboolean transpose,
+ const GLfloat *value);
+
+extern void GLAPIENTRY
+_mesa_UniformMatrix4x3fv(GLint location, GLsizei count, GLboolean transpose,
+ const GLfloat *value);
+
+
+extern void GLAPIENTRY
+_mesa_GetActiveUniformARB(GLhandleARB, GLuint, GLsizei, GLsizei *,
+ GLint *, GLenum *, GLcharARB *);
+
+extern void GLAPIENTRY
+_mesa_GetUniformfvARB(GLhandleARB, GLint, GLfloat *);
+
+extern void GLAPIENTRY
+_mesa_GetnUniformfvARB(GLhandleARB, GLint, GLsizei, GLfloat *);
+
+extern void GLAPIENTRY
+_mesa_GetUniformivARB(GLhandleARB, GLint, GLint *);
+
+extern void GLAPIENTRY
+_mesa_GetnUniformivARB(GLhandleARB, GLint, GLsizei, GLint *);
+
+extern void GLAPIENTRY
+_mesa_GetUniformuiv(GLhandleARB, GLint, GLuint *);
+
+extern void GLAPIENTRY
+_mesa_GetnUniformuivARB(GLhandleARB, GLint, GLsizei, GLuint *);
+
+extern void GLAPIENTRY
+_mesa_GetUniformdv(GLhandleARB, GLint, GLdouble *);
+
+extern void GLAPIENTRY
+_mesa_GetnUniformdvARB(GLhandleARB, GLint, GLsizei, GLdouble *);
+
+extern GLint GLAPIENTRY
+_mesa_GetUniformLocationARB(GLhandleARB, const GLcharARB *);
+
+GLint
+_mesa_get_uniform_location(struct gl_context *ctx, struct gl_shader_program *shProg,
+ const GLchar *name);
+
+void
+_mesa_uniform(struct gl_context *ctx, struct gl_shader_program *shader_program,
+ GLint location, GLsizei count,
+ const GLvoid *values, GLenum type);
+
+void
+_mesa_uniform_matrix(struct gl_context *ctx, struct gl_shader_program *shProg,
+ GLint cols, GLint rows,
+ GLint location, GLsizei count,
+ GLboolean transpose, const GLfloat *values);
+
+extern void
+_mesa_update_shader_textures_used(struct gl_program *prog);
+
+
+extern void
+_mesa_init_shader_uniform_dispatch(struct _glapi_table *exec);
+
+struct gl_builtin_uniform_element {
+ const char *field;
+ int tokens[STATE_LENGTH];
+ int swizzle;
+};
+
+struct gl_builtin_uniform_desc {
+ const char *name;
+ struct gl_builtin_uniform_element *elements;
+ unsigned int num_elements;
+};
+
+extern const struct gl_builtin_uniform_desc _mesa_builtin_uniform_desc[];
+
+#endif /* UNIFORMS_H */
diff --git a/mesalib/src/mesa/main/varray.h b/mesalib/src/mesa/main/varray.h
index 1c423200f..493494e5c 100644
--- a/mesalib/src/mesa/main/varray.h
+++ b/mesalib/src/mesa/main/varray.h
@@ -1,279 +1,279 @@
-/*
- * Mesa 3-D graphics library
- * Version: 7.6
- *
- * Copyright (C) 1999-2008 Brian Paul All Rights Reserved.
- * Copyright (C) 2009 VMware, Inc. All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-
-#ifndef VARRAY_H
-#define VARRAY_H
-
-
-#include "glheader.h"
-#include "mfeatures.h"
-
-struct gl_client_array;
-struct gl_context;
-
-
-/**
- * Compute the index of the last array element that can be safely accessed in
- * a vertex array. We can really only do this when the array lives in a VBO.
- * The array->_MaxElement field will be updated.
- * Later in glDrawArrays/Elements/etc we can do some bounds checking.
- */
-static INLINE void
-_mesa_update_array_max_element(struct gl_client_array *array)
-{
- assert(array->Enabled);
-
- if (array->BufferObj->Name) {
- GLsizeiptrARB offset = (GLsizeiptrARB) array->Ptr;
- GLsizeiptrARB bufSize = (GLsizeiptrARB) array->BufferObj->Size;
-
- if (offset < bufSize) {
- array->_MaxElement = (bufSize - offset + array->StrideB
- - array->_ElementSize) / array->StrideB;
- }
- else {
- array->_MaxElement = 0;
- }
- }
- else {
- /* user-space array, no idea how big it is */
- array->_MaxElement = 2 * 1000 * 1000 * 1000; /* just a big number */
- }
-}
-
-
-#if _HAVE_FULL_GL
-
-extern void GLAPIENTRY
-_mesa_VertexPointer(GLint size, GLenum type, GLsizei stride,
- const GLvoid *ptr);
-
-extern void GLAPIENTRY
-_mesa_UnlockArraysEXT( void );
-
-extern void GLAPIENTRY
-_mesa_LockArraysEXT(GLint first, GLsizei count);
-
-
-extern void GLAPIENTRY
-_mesa_NormalPointer(GLenum type, GLsizei stride, const GLvoid *ptr);
-
-
-extern void GLAPIENTRY
-_mesa_ColorPointer(GLint size, GLenum type, GLsizei stride, const GLvoid *ptr);
-
-
-extern void GLAPIENTRY
-_mesa_IndexPointer(GLenum type, GLsizei stride, const GLvoid *ptr);
-
-
-extern void GLAPIENTRY
-_mesa_TexCoordPointer(GLint size, GLenum type, GLsizei stride,
- const GLvoid *ptr);
-
-
-extern void GLAPIENTRY
-_mesa_EdgeFlagPointer(GLsizei stride, const GLvoid *ptr);
-
-
-extern void GLAPIENTRY
-_mesa_VertexPointerEXT(GLint size, GLenum type, GLsizei stride,
- GLsizei count, const GLvoid *ptr);
-
-
-extern void GLAPIENTRY
-_mesa_NormalPointerEXT(GLenum type, GLsizei stride, GLsizei count,
- const GLvoid *ptr);
-
-
-extern void GLAPIENTRY
-_mesa_ColorPointerEXT(GLint size, GLenum type, GLsizei stride, GLsizei count,
- const GLvoid *ptr);
-
-
-extern void GLAPIENTRY
-_mesa_IndexPointerEXT(GLenum type, GLsizei stride, GLsizei count,
- const GLvoid *ptr);
-
-
-extern void GLAPIENTRY
-_mesa_TexCoordPointerEXT(GLint size, GLenum type, GLsizei stride,
- GLsizei count, const GLvoid *ptr);
-
-
-extern void GLAPIENTRY
-_mesa_EdgeFlagPointerEXT(GLsizei stride, GLsizei count, const GLboolean *ptr);
-
-
-extern void GLAPIENTRY
-_mesa_FogCoordPointerEXT(GLenum type, GLsizei stride, const GLvoid *ptr);
-
-
-extern void GLAPIENTRY
-_mesa_SecondaryColorPointerEXT(GLint size, GLenum type,
- GLsizei stride, const GLvoid *ptr);
-
-
-extern void GLAPIENTRY
-_mesa_PointSizePointer(GLenum type, GLsizei stride, const GLvoid *ptr);
-
-
-extern void GLAPIENTRY
-_mesa_VertexAttribPointerNV(GLuint index, GLint size, GLenum type,
- GLsizei stride, const GLvoid *pointer);
-
-
-extern void GLAPIENTRY
-_mesa_VertexAttribPointerARB(GLuint index, GLint size, GLenum type,
- GLboolean normalized, GLsizei stride,
- const GLvoid *pointer);
-
-void GLAPIENTRY
-_mesa_VertexAttribIPointer(GLuint index, GLint size, GLenum type,
- GLsizei stride, const GLvoid *ptr);
-
-
-extern void GLAPIENTRY
-_mesa_EnableVertexAttribArrayARB(GLuint index);
-
-
-extern void GLAPIENTRY
-_mesa_DisableVertexAttribArrayARB(GLuint index);
-
-
-extern void GLAPIENTRY
-_mesa_GetVertexAttribdvARB(GLuint index, GLenum pname, GLdouble *params);
-
-
-extern void GLAPIENTRY
-_mesa_GetVertexAttribfvARB(GLuint index, GLenum pname, GLfloat *params);
-
-
-extern void GLAPIENTRY
-_mesa_GetVertexAttribivARB(GLuint index, GLenum pname, GLint *params);
-
-
-extern void GLAPIENTRY
-_mesa_GetVertexAttribIiv(GLuint index, GLenum pname, GLint *params);
-
-
-extern void GLAPIENTRY
-_mesa_GetVertexAttribIuiv(GLuint index, GLenum pname, GLuint *params);
-
-
-extern void GLAPIENTRY
-_mesa_GetVertexAttribPointervARB(GLuint index, GLenum pname, GLvoid **pointer);
-
-
-extern void GLAPIENTRY
-_mesa_InterleavedArrays(GLenum format, GLsizei stride, const GLvoid *pointer);
-
-
-extern void GLAPIENTRY
-_mesa_MultiDrawArraysEXT( GLenum mode, const GLint *first,
- const GLsizei *count, GLsizei primcount );
-
-extern void GLAPIENTRY
-_mesa_MultiDrawElementsEXT( GLenum mode, const GLsizei *count, GLenum type,
- const GLvoid **indices, GLsizei primcount );
-
-extern void GLAPIENTRY
-_mesa_MultiDrawElementsBaseVertex( GLenum mode,
- const GLsizei *count, GLenum type,
- const GLvoid **indices, GLsizei primcount,
- const GLint *basevertex);
-
-extern void GLAPIENTRY
-_mesa_MultiModeDrawArraysIBM( const GLenum * mode, const GLint * first,
- const GLsizei * count,
- GLsizei primcount, GLint modestride );
-
-
-extern void GLAPIENTRY
-_mesa_MultiModeDrawElementsIBM( const GLenum * mode, const GLsizei * count,
- GLenum type, const GLvoid * const * indices,
- GLsizei primcount, GLint modestride );
-
-extern void GLAPIENTRY
-_mesa_LockArraysEXT(GLint first, GLsizei count);
-
-extern void GLAPIENTRY
-_mesa_UnlockArraysEXT( void );
-
-
-extern void GLAPIENTRY
-_mesa_DrawArrays(GLenum mode, GLint first, GLsizei count);
-
-extern void GLAPIENTRY
-_mesa_DrawElements(GLenum mode, GLsizei count, GLenum type,
- const GLvoid *indices);
-
-extern void GLAPIENTRY
-_mesa_DrawRangeElements(GLenum mode, GLuint start, GLuint end, GLsizei count,
- GLenum type, const GLvoid *indices);
-
-extern void GLAPIENTRY
-_mesa_DrawElementsBaseVertex(GLenum mode, GLsizei count, GLenum type,
- const GLvoid *indices, GLint basevertex);
-
-extern void GLAPIENTRY
-_mesa_DrawRangeElementsBaseVertex(GLenum mode, GLuint start, GLuint end,
- GLsizei count, GLenum type,
- const GLvoid *indices,
- GLint basevertex);
-
-extern void GLAPIENTRY
-_mesa_PrimitiveRestartIndex(GLuint index);
-
-
-extern void GLAPIENTRY
-_mesa_VertexAttribDivisor(GLuint index, GLuint divisor);
-
-
-extern void
-_mesa_copy_client_array(struct gl_context *ctx,
- struct gl_client_array *dst,
- struct gl_client_array *src);
-
-
-extern void
-_mesa_print_arrays(struct gl_context *ctx);
-
-extern void
-_mesa_init_varray( struct gl_context * ctx );
-
-extern void
-_mesa_free_varray_data(struct gl_context *ctx);
-
-#else
-
-/** No-op */
-#define _mesa_init_varray( c ) ((void)0)
-#define _mesa_free_varray_data( c ) ((void)0)
-
-#endif
-
-#endif
+/*
+ * Mesa 3-D graphics library
+ * Version: 7.6
+ *
+ * Copyright (C) 1999-2008 Brian Paul All Rights Reserved.
+ * Copyright (C) 2009 VMware, Inc. All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+
+#ifndef VARRAY_H
+#define VARRAY_H
+
+
+#include "glheader.h"
+#include "mfeatures.h"
+
+struct gl_client_array;
+struct gl_context;
+
+
+/**
+ * Compute the index of the last array element that can be safely accessed in
+ * a vertex array. We can really only do this when the array lives in a VBO.
+ * The array->_MaxElement field will be updated.
+ * Later in glDrawArrays/Elements/etc we can do some bounds checking.
+ */
+static INLINE void
+_mesa_update_array_max_element(struct gl_client_array *array)
+{
+ assert(array->Enabled);
+
+ if (array->BufferObj->Name) {
+ GLsizeiptrARB offset = (GLsizeiptrARB) array->Ptr;
+ GLsizeiptrARB bufSize = (GLsizeiptrARB) array->BufferObj->Size;
+
+ if (offset < bufSize) {
+ array->_MaxElement = (bufSize - offset + array->StrideB
+ - array->_ElementSize) / array->StrideB;
+ }
+ else {
+ array->_MaxElement = 0;
+ }
+ }
+ else {
+ /* user-space array, no idea how big it is */
+ array->_MaxElement = 2 * 1000 * 1000 * 1000; /* just a big number */
+ }
+}
+
+
+#if _HAVE_FULL_GL
+
+extern void GLAPIENTRY
+_mesa_VertexPointer(GLint size, GLenum type, GLsizei stride,
+ const GLvoid *ptr);
+
+extern void GLAPIENTRY
+_mesa_UnlockArraysEXT( void );
+
+extern void GLAPIENTRY
+_mesa_LockArraysEXT(GLint first, GLsizei count);
+
+
+extern void GLAPIENTRY
+_mesa_NormalPointer(GLenum type, GLsizei stride, const GLvoid *ptr);
+
+
+extern void GLAPIENTRY
+_mesa_ColorPointer(GLint size, GLenum type, GLsizei stride, const GLvoid *ptr);
+
+
+extern void GLAPIENTRY
+_mesa_IndexPointer(GLenum type, GLsizei stride, const GLvoid *ptr);
+
+
+extern void GLAPIENTRY
+_mesa_TexCoordPointer(GLint size, GLenum type, GLsizei stride,
+ const GLvoid *ptr);
+
+
+extern void GLAPIENTRY
+_mesa_EdgeFlagPointer(GLsizei stride, const GLvoid *ptr);
+
+
+extern void GLAPIENTRY
+_mesa_VertexPointerEXT(GLint size, GLenum type, GLsizei stride,
+ GLsizei count, const GLvoid *ptr);
+
+
+extern void GLAPIENTRY
+_mesa_NormalPointerEXT(GLenum type, GLsizei stride, GLsizei count,
+ const GLvoid *ptr);
+
+
+extern void GLAPIENTRY
+_mesa_ColorPointerEXT(GLint size, GLenum type, GLsizei stride, GLsizei count,
+ const GLvoid *ptr);
+
+
+extern void GLAPIENTRY
+_mesa_IndexPointerEXT(GLenum type, GLsizei stride, GLsizei count,
+ const GLvoid *ptr);
+
+
+extern void GLAPIENTRY
+_mesa_TexCoordPointerEXT(GLint size, GLenum type, GLsizei stride,
+ GLsizei count, const GLvoid *ptr);
+
+
+extern void GLAPIENTRY
+_mesa_EdgeFlagPointerEXT(GLsizei stride, GLsizei count, const GLboolean *ptr);
+
+
+extern void GLAPIENTRY
+_mesa_FogCoordPointerEXT(GLenum type, GLsizei stride, const GLvoid *ptr);
+
+
+extern void GLAPIENTRY
+_mesa_SecondaryColorPointerEXT(GLint size, GLenum type,
+ GLsizei stride, const GLvoid *ptr);
+
+
+extern void GLAPIENTRY
+_mesa_PointSizePointer(GLenum type, GLsizei stride, const GLvoid *ptr);
+
+
+extern void GLAPIENTRY
+_mesa_VertexAttribPointerNV(GLuint index, GLint size, GLenum type,
+ GLsizei stride, const GLvoid *pointer);
+
+
+extern void GLAPIENTRY
+_mesa_VertexAttribPointerARB(GLuint index, GLint size, GLenum type,
+ GLboolean normalized, GLsizei stride,
+ const GLvoid *pointer);
+
+void GLAPIENTRY
+_mesa_VertexAttribIPointer(GLuint index, GLint size, GLenum type,
+ GLsizei stride, const GLvoid *ptr);
+
+
+extern void GLAPIENTRY
+_mesa_EnableVertexAttribArrayARB(GLuint index);
+
+
+extern void GLAPIENTRY
+_mesa_DisableVertexAttribArrayARB(GLuint index);
+
+
+extern void GLAPIENTRY
+_mesa_GetVertexAttribdvARB(GLuint index, GLenum pname, GLdouble *params);
+
+
+extern void GLAPIENTRY
+_mesa_GetVertexAttribfvARB(GLuint index, GLenum pname, GLfloat *params);
+
+
+extern void GLAPIENTRY
+_mesa_GetVertexAttribivARB(GLuint index, GLenum pname, GLint *params);
+
+
+extern void GLAPIENTRY
+_mesa_GetVertexAttribIiv(GLuint index, GLenum pname, GLint *params);
+
+
+extern void GLAPIENTRY
+_mesa_GetVertexAttribIuiv(GLuint index, GLenum pname, GLuint *params);
+
+
+extern void GLAPIENTRY
+_mesa_GetVertexAttribPointervARB(GLuint index, GLenum pname, GLvoid **pointer);
+
+
+extern void GLAPIENTRY
+_mesa_InterleavedArrays(GLenum format, GLsizei stride, const GLvoid *pointer);
+
+
+extern void GLAPIENTRY
+_mesa_MultiDrawArraysEXT( GLenum mode, const GLint *first,
+ const GLsizei *count, GLsizei primcount );
+
+extern void GLAPIENTRY
+_mesa_MultiDrawElementsEXT( GLenum mode, const GLsizei *count, GLenum type,
+ const GLvoid **indices, GLsizei primcount );
+
+extern void GLAPIENTRY
+_mesa_MultiDrawElementsBaseVertex( GLenum mode,
+ const GLsizei *count, GLenum type,
+ const GLvoid **indices, GLsizei primcount,
+ const GLint *basevertex);
+
+extern void GLAPIENTRY
+_mesa_MultiModeDrawArraysIBM( const GLenum * mode, const GLint * first,
+ const GLsizei * count,
+ GLsizei primcount, GLint modestride );
+
+
+extern void GLAPIENTRY
+_mesa_MultiModeDrawElementsIBM( const GLenum * mode, const GLsizei * count,
+ GLenum type, const GLvoid * const * indices,
+ GLsizei primcount, GLint modestride );
+
+extern void GLAPIENTRY
+_mesa_LockArraysEXT(GLint first, GLsizei count);
+
+extern void GLAPIENTRY
+_mesa_UnlockArraysEXT( void );
+
+
+extern void GLAPIENTRY
+_mesa_DrawArrays(GLenum mode, GLint first, GLsizei count);
+
+extern void GLAPIENTRY
+_mesa_DrawElements(GLenum mode, GLsizei count, GLenum type,
+ const GLvoid *indices);
+
+extern void GLAPIENTRY
+_mesa_DrawRangeElements(GLenum mode, GLuint start, GLuint end, GLsizei count,
+ GLenum type, const GLvoid *indices);
+
+extern void GLAPIENTRY
+_mesa_DrawElementsBaseVertex(GLenum mode, GLsizei count, GLenum type,
+ const GLvoid *indices, GLint basevertex);
+
+extern void GLAPIENTRY
+_mesa_DrawRangeElementsBaseVertex(GLenum mode, GLuint start, GLuint end,
+ GLsizei count, GLenum type,
+ const GLvoid *indices,
+ GLint basevertex);
+
+extern void GLAPIENTRY
+_mesa_PrimitiveRestartIndex(GLuint index);
+
+
+extern void GLAPIENTRY
+_mesa_VertexAttribDivisor(GLuint index, GLuint divisor);
+
+
+extern void
+_mesa_copy_client_array(struct gl_context *ctx,
+ struct gl_client_array *dst,
+ struct gl_client_array *src);
+
+
+extern void
+_mesa_print_arrays(struct gl_context *ctx);
+
+extern void
+_mesa_init_varray( struct gl_context * ctx );
+
+extern void
+_mesa_free_varray_data(struct gl_context *ctx);
+
+#else
+
+/** No-op */
+#define _mesa_init_varray( c ) ((void)0)
+#define _mesa_free_varray_data( c ) ((void)0)
+
+#endif
+
+#endif
diff --git a/mesalib/src/mesa/main/version.c b/mesalib/src/mesa/main/version.c
index 6dbdb3ac6..a333250c9 100644
--- a/mesalib/src/mesa/main/version.c
+++ b/mesalib/src/mesa/main/version.c
@@ -25,7 +25,7 @@
#include "imports.h"
#include "mtypes.h"
#include "version.h"
-#include "git_sha1.h"
+/*#include "git_sha1.h"*/
diff --git a/mesalib/src/mesa/program/arbprogparse.c b/mesalib/src/mesa/program/arbprogparse.c
index dffc8abf7..bca033477 100644
--- a/mesalib/src/mesa/program/arbprogparse.c
+++ b/mesalib/src/mesa/program/arbprogparse.c
@@ -1,216 +1,216 @@
-/*
- * Mesa 3-D graphics library
- * Version: 7.1
- *
- * Copyright (C) 1999-2008 Brian Paul All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-#define DEBUG_PARSING 0
-
-/**
- * \file arbprogparse.c
- * ARB_*_program parser core
- * \author Karl Rasche
- */
-
-/**
-Notes on program parameters, etc.
-
-The instructions we emit will use six kinds of source registers:
-
- PROGRAM_INPUT - input registers
- PROGRAM_TEMPORARY - temp registers
- PROGRAM_ADDRESS - address/indirect register
- PROGRAM_SAMPLER - texture sampler
- PROGRAM_CONSTANT - indexes into program->Parameters, a known constant/literal
- PROGRAM_STATE_VAR - indexes into program->Parameters, and may actually be:
- + a state variable, like "state.fog.color", or
- + a pointer to a "program.local[k]" parameter, or
- + a pointer to a "program.env[k]" parameter
-
-Basically, all the program.local[] and program.env[] values will get mapped
-into the unified gl_program->Parameters array. This solves the problem of
-having three separate program parameter arrays.
-*/
-
-
-#include "main/glheader.h"
-#include "main/imports.h"
-#include "main/context.h"
-#include "main/mtypes.h"
-#include "arbprogparse.h"
-#include "programopt.h"
-#include "prog_parameter.h"
-#include "prog_statevars.h"
-#include "prog_instruction.h"
-#include "program_parser.h"
-
-
-void
-_mesa_parse_arb_fragment_program(struct gl_context* ctx, GLenum target,
- const GLvoid *str, GLsizei len,
- struct gl_fragment_program *program)
-{
- struct gl_program prog;
- struct asm_parser_state state;
- GLuint i;
-
- ASSERT(target == GL_FRAGMENT_PROGRAM_ARB);
-
- memset(&prog, 0, sizeof(prog));
- memset(&state, 0, sizeof(state));
- state.prog = &prog;
-
- if (!_mesa_parse_arb_program(ctx, target, (const GLubyte*) str, len,
- &state)) {
- /* Error in the program. Just return. */
- return;
- }
-
- if (program->Base.String != NULL)
- free(program->Base.String);
-
- /* Copy the relevant contents of the arb_program struct into the
- * fragment_program struct.
- */
- program->Base.String = prog.String;
- program->Base.NumInstructions = prog.NumInstructions;
- program->Base.NumTemporaries = prog.NumTemporaries;
- program->Base.NumParameters = prog.NumParameters;
- program->Base.NumAttributes = prog.NumAttributes;
- program->Base.NumAddressRegs = prog.NumAddressRegs;
- program->Base.NumNativeInstructions = prog.NumNativeInstructions;
- program->Base.NumNativeTemporaries = prog.NumNativeTemporaries;
- program->Base.NumNativeParameters = prog.NumNativeParameters;
- program->Base.NumNativeAttributes = prog.NumNativeAttributes;
- program->Base.NumNativeAddressRegs = prog.NumNativeAddressRegs;
- program->Base.NumAluInstructions = prog.NumAluInstructions;
- program->Base.NumTexInstructions = prog.NumTexInstructions;
- program->Base.NumTexIndirections = prog.NumTexIndirections;
- program->Base.NumNativeAluInstructions = prog.NumAluInstructions;
- program->Base.NumNativeTexInstructions = prog.NumTexInstructions;
- program->Base.NumNativeTexIndirections = prog.NumTexIndirections;
- program->Base.InputsRead = prog.InputsRead;
- program->Base.OutputsWritten = prog.OutputsWritten;
- program->Base.IndirectRegisterFiles = prog.IndirectRegisterFiles;
- for (i = 0; i < MAX_TEXTURE_IMAGE_UNITS; i++) {
- program->Base.TexturesUsed[i] = prog.TexturesUsed[i];
- if (prog.TexturesUsed[i])
- program->Base.SamplersUsed |= (1 << i);
- }
- program->Base.ShadowSamplers = prog.ShadowSamplers;
- program->OriginUpperLeft = state.option.OriginUpperLeft;
- program->PixelCenterInteger = state.option.PixelCenterInteger;
-
- program->UsesKill = state.fragment.UsesKill;
-
- if (program->Base.Instructions)
- free(program->Base.Instructions);
- program->Base.Instructions = prog.Instructions;
-
- if (program->Base.Parameters)
- _mesa_free_parameter_list(program->Base.Parameters);
- program->Base.Parameters = prog.Parameters;
-
- /* Append fog instructions now if the program has "OPTION ARB_fog_exp"
- * or similar. We used to leave this up to drivers, but it appears
- * there's no hardware that wants to do fog in a discrete stage separate
- * from the fragment shader.
- */
- if (state.option.Fog != OPTION_NONE) {
- static const GLenum fog_modes[4] = {
- GL_NONE, GL_EXP, GL_EXP2, GL_LINEAR
- };
-
- /* XXX: we should somehow recompile this to remove clamping if disabled
- * On the ATI driver, this is unclampled if fragment clamping is disabled
- */
- _mesa_append_fog_code(ctx, program, fog_modes[state.option.Fog], GL_TRUE);
- }
-
-#if DEBUG_FP
- printf("____________Fragment program %u ________\n", program->Base.Id);
- _mesa_print_program(&program->Base);
-#endif
-}
-
-
-
-/**
- * Parse the vertex program string. If success, update the given
- * vertex_program object with the new program. Else, leave the vertex_program
- * object unchanged.
- */
-void
-_mesa_parse_arb_vertex_program(struct gl_context *ctx, GLenum target,
- const GLvoid *str, GLsizei len,
- struct gl_vertex_program *program)
-{
- struct gl_program prog;
- struct asm_parser_state state;
-
- ASSERT(target == GL_VERTEX_PROGRAM_ARB);
-
- memset(&prog, 0, sizeof(prog));
- memset(&state, 0, sizeof(state));
- state.prog = &prog;
-
- if (!_mesa_parse_arb_program(ctx, target, (const GLubyte*) str, len,
- &state)) {
- _mesa_error(ctx, GL_INVALID_OPERATION, "glProgramString(bad program)");
- return;
- }
-
- if (program->Base.String != NULL)
- free(program->Base.String);
-
- /* Copy the relevant contents of the arb_program struct into the
- * vertex_program struct.
- */
- program->Base.String = prog.String;
- program->Base.NumInstructions = prog.NumInstructions;
- program->Base.NumTemporaries = prog.NumTemporaries;
- program->Base.NumParameters = prog.NumParameters;
- program->Base.NumAttributes = prog.NumAttributes;
- program->Base.NumAddressRegs = prog.NumAddressRegs;
- program->Base.NumNativeInstructions = prog.NumNativeInstructions;
- program->Base.NumNativeTemporaries = prog.NumNativeTemporaries;
- program->Base.NumNativeParameters = prog.NumNativeParameters;
- program->Base.NumNativeAttributes = prog.NumNativeAttributes;
- program->Base.NumNativeAddressRegs = prog.NumNativeAddressRegs;
- program->Base.InputsRead = prog.InputsRead;
- program->Base.OutputsWritten = prog.OutputsWritten;
- program->Base.IndirectRegisterFiles = prog.IndirectRegisterFiles;
- program->IsPositionInvariant = (state.option.PositionInvariant)
- ? GL_TRUE : GL_FALSE;
-
- if (program->Base.Instructions)
- free(program->Base.Instructions);
- program->Base.Instructions = prog.Instructions;
-
- if (program->Base.Parameters)
- _mesa_free_parameter_list(program->Base.Parameters);
- program->Base.Parameters = prog.Parameters;
-
-#if DEBUG_VP
- printf("____________Vertex program %u __________\n", program->Base.Id);
- _mesa_print_program(&program->Base);
-#endif
-}
+/*
+ * Mesa 3-D graphics library
+ * Version: 7.1
+ *
+ * Copyright (C) 1999-2008 Brian Paul All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+#define DEBUG_PARSING 0
+
+/**
+ * \file arbprogparse.c
+ * ARB_*_program parser core
+ * \author Karl Rasche
+ */
+
+/**
+Notes on program parameters, etc.
+
+The instructions we emit will use six kinds of source registers:
+
+ PROGRAM_INPUT - input registers
+ PROGRAM_TEMPORARY - temp registers
+ PROGRAM_ADDRESS - address/indirect register
+ PROGRAM_SAMPLER - texture sampler
+ PROGRAM_CONSTANT - indexes into program->Parameters, a known constant/literal
+ PROGRAM_STATE_VAR - indexes into program->Parameters, and may actually be:
+ + a state variable, like "state.fog.color", or
+ + a pointer to a "program.local[k]" parameter, or
+ + a pointer to a "program.env[k]" parameter
+
+Basically, all the program.local[] and program.env[] values will get mapped
+into the unified gl_program->Parameters array. This solves the problem of
+having three separate program parameter arrays.
+*/
+
+
+#include "main/glheader.h"
+#include "main/imports.h"
+#include "main/context.h"
+#include "main/mtypes.h"
+#include "arbprogparse.h"
+#include "programopt.h"
+#include "prog_parameter.h"
+#include "prog_statevars.h"
+#include "prog_instruction.h"
+#include "program_parser.h"
+
+
+void
+_mesa_parse_arb_fragment_program(struct gl_context* ctx, GLenum target,
+ const GLvoid *str, GLsizei len,
+ struct gl_fragment_program *program)
+{
+ struct gl_program prog;
+ struct asm_parser_state state;
+ GLuint i;
+
+ ASSERT(target == GL_FRAGMENT_PROGRAM_ARB);
+
+ memset(&prog, 0, sizeof(prog));
+ memset(&state, 0, sizeof(state));
+ state.prog = &prog;
+
+ if (!_mesa_parse_arb_program(ctx, target, (const GLubyte*) str, len,
+ &state)) {
+ /* Error in the program. Just return. */
+ return;
+ }
+
+ if (program->Base.String != NULL)
+ free(program->Base.String);
+
+ /* Copy the relevant contents of the arb_program struct into the
+ * fragment_program struct.
+ */
+ program->Base.String = prog.String;
+ program->Base.NumInstructions = prog.NumInstructions;
+ program->Base.NumTemporaries = prog.NumTemporaries;
+ program->Base.NumParameters = prog.NumParameters;
+ program->Base.NumAttributes = prog.NumAttributes;
+ program->Base.NumAddressRegs = prog.NumAddressRegs;
+ program->Base.NumNativeInstructions = prog.NumNativeInstructions;
+ program->Base.NumNativeTemporaries = prog.NumNativeTemporaries;
+ program->Base.NumNativeParameters = prog.NumNativeParameters;
+ program->Base.NumNativeAttributes = prog.NumNativeAttributes;
+ program->Base.NumNativeAddressRegs = prog.NumNativeAddressRegs;
+ program->Base.NumAluInstructions = prog.NumAluInstructions;
+ program->Base.NumTexInstructions = prog.NumTexInstructions;
+ program->Base.NumTexIndirections = prog.NumTexIndirections;
+ program->Base.NumNativeAluInstructions = prog.NumAluInstructions;
+ program->Base.NumNativeTexInstructions = prog.NumTexInstructions;
+ program->Base.NumNativeTexIndirections = prog.NumTexIndirections;
+ program->Base.InputsRead = prog.InputsRead;
+ program->Base.OutputsWritten = prog.OutputsWritten;
+ program->Base.IndirectRegisterFiles = prog.IndirectRegisterFiles;
+ for (i = 0; i < MAX_TEXTURE_IMAGE_UNITS; i++) {
+ program->Base.TexturesUsed[i] = prog.TexturesUsed[i];
+ if (prog.TexturesUsed[i])
+ program->Base.SamplersUsed |= (1 << i);
+ }
+ program->Base.ShadowSamplers = prog.ShadowSamplers;
+ program->OriginUpperLeft = state.option.OriginUpperLeft;
+ program->PixelCenterInteger = state.option.PixelCenterInteger;
+
+ program->UsesKill = state.fragment.UsesKill;
+
+ if (program->Base.Instructions)
+ free(program->Base.Instructions);
+ program->Base.Instructions = prog.Instructions;
+
+ if (program->Base.Parameters)
+ _mesa_free_parameter_list(program->Base.Parameters);
+ program->Base.Parameters = prog.Parameters;
+
+ /* Append fog instructions now if the program has "OPTION ARB_fog_exp"
+ * or similar. We used to leave this up to drivers, but it appears
+ * there's no hardware that wants to do fog in a discrete stage separate
+ * from the fragment shader.
+ */
+ if (state.option.Fog != OPTION_NONE) {
+ static const GLenum fog_modes[4] = {
+ GL_NONE, GL_EXP, GL_EXP2, GL_LINEAR
+ };
+
+ /* XXX: we should somehow recompile this to remove clamping if disabled
+ * On the ATI driver, this is unclampled if fragment clamping is disabled
+ */
+ _mesa_append_fog_code(ctx, program, fog_modes[state.option.Fog], GL_TRUE);
+ }
+
+#if DEBUG_FP
+ printf("____________Fragment program %u ________\n", program->Base.Id);
+ _mesa_print_program(&program->Base);
+#endif
+}
+
+
+
+/**
+ * Parse the vertex program string. If success, update the given
+ * vertex_program object with the new program. Else, leave the vertex_program
+ * object unchanged.
+ */
+void
+_mesa_parse_arb_vertex_program(struct gl_context *ctx, GLenum target,
+ const GLvoid *str, GLsizei len,
+ struct gl_vertex_program *program)
+{
+ struct gl_program prog;
+ struct asm_parser_state state;
+
+ ASSERT(target == GL_VERTEX_PROGRAM_ARB);
+
+ memset(&prog, 0, sizeof(prog));
+ memset(&state, 0, sizeof(state));
+ state.prog = &prog;
+
+ if (!_mesa_parse_arb_program(ctx, target, (const GLubyte*) str, len,
+ &state)) {
+ _mesa_error(ctx, GL_INVALID_OPERATION, "glProgramString(bad program)");
+ return;
+ }
+
+ if (program->Base.String != NULL)
+ free(program->Base.String);
+
+ /* Copy the relevant contents of the arb_program struct into the
+ * vertex_program struct.
+ */
+ program->Base.String = prog.String;
+ program->Base.NumInstructions = prog.NumInstructions;
+ program->Base.NumTemporaries = prog.NumTemporaries;
+ program->Base.NumParameters = prog.NumParameters;
+ program->Base.NumAttributes = prog.NumAttributes;
+ program->Base.NumAddressRegs = prog.NumAddressRegs;
+ program->Base.NumNativeInstructions = prog.NumNativeInstructions;
+ program->Base.NumNativeTemporaries = prog.NumNativeTemporaries;
+ program->Base.NumNativeParameters = prog.NumNativeParameters;
+ program->Base.NumNativeAttributes = prog.NumNativeAttributes;
+ program->Base.NumNativeAddressRegs = prog.NumNativeAddressRegs;
+ program->Base.InputsRead = prog.InputsRead;
+ program->Base.OutputsWritten = prog.OutputsWritten;
+ program->Base.IndirectRegisterFiles = prog.IndirectRegisterFiles;
+ program->IsPositionInvariant = (state.option.PositionInvariant)
+ ? GL_TRUE : GL_FALSE;
+
+ if (program->Base.Instructions)
+ free(program->Base.Instructions);
+ program->Base.Instructions = prog.Instructions;
+
+ if (program->Base.Parameters)
+ _mesa_free_parameter_list(program->Base.Parameters);
+ program->Base.Parameters = prog.Parameters;
+
+#if DEBUG_VP
+ printf("____________Vertex program %u __________\n", program->Base.Id);
+ _mesa_print_program(&program->Base);
+#endif
+}
diff --git a/mesalib/src/mesa/program/doflexbison.bat b/mesalib/src/mesa/program/doflexbison.bat
new file mode 100644
index 000000000..d54e5ac65
--- /dev/null
+++ b/mesalib/src/mesa/program/doflexbison.bat
@@ -0,0 +1,18 @@
+@echo off
+setlocal
+
+cd "%~dp0"
+
+set M4=..\..\..\..\tools\mhmake\m4.exe
+set BISON_PKGDATADIR=../../../../tools/mhmake/src/bisondata
+
+set path=..\..\..\..\tools\mhmake;%path%
+
+..\..\..\..\tools\mhmake\bison.exe -v -d --output=program_parse.tab.c program_parse.y
+
+copy "..\..\..\..\tools\mhmake\flex++.exe" flex.exe
+flex.exe --never-interactive --outfile=lex.yy.c program_lexer.l
+del flex.exe
+
+endlocal
+
diff --git a/mesalib/src/mesa/program/hash_table.c b/mesalib/src/mesa/program/hash_table.c
index 877a9e2ff..3e9b9d4d3 100644
--- a/mesalib/src/mesa/program/hash_table.c
+++ b/mesalib/src/mesa/program/hash_table.c
@@ -1,209 +1,209 @@
-/*
- * Copyright © 2008 Intel Corporation
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-
-/**
- * \file hash_table.c
- * \brief Implementation of a generic, opaque hash table data type.
- *
- * \author Ian Romanick <ian.d.romanick@intel.com>
- */
-
-#include "main/imports.h"
-#include "main/simple_list.h"
-#include "hash_table.h"
-
-struct node {
- struct node *next;
- struct node *prev;
-};
-
-struct hash_table {
- hash_func_t hash;
- hash_compare_func_t compare;
-
- unsigned num_buckets;
- struct node buckets[1];
-};
-
-
-struct hash_node {
- struct node link;
- const void *key;
- void *data;
-};
-
-
-struct hash_table *
-hash_table_ctor(unsigned num_buckets, hash_func_t hash,
- hash_compare_func_t compare)
-{
- struct hash_table *ht;
- unsigned i;
-
-
- if (num_buckets < 16) {
- num_buckets = 16;
- }
-
- ht = malloc(sizeof(*ht) + ((num_buckets - 1)
- * sizeof(ht->buckets[0])));
- if (ht != NULL) {
- ht->hash = hash;
- ht->compare = compare;
- ht->num_buckets = num_buckets;
-
- for (i = 0; i < num_buckets; i++) {
- make_empty_list(& ht->buckets[i]);
- }
- }
-
- return ht;
-}
-
-
-void
-hash_table_dtor(struct hash_table *ht)
-{
- hash_table_clear(ht);
- free(ht);
-}
-
-
-void
-hash_table_clear(struct hash_table *ht)
-{
- struct node *node;
- struct node *temp;
- unsigned i;
-
-
- for (i = 0; i < ht->num_buckets; i++) {
- foreach_s(node, temp, & ht->buckets[i]) {
- remove_from_list(node);
- free(node);
- }
-
- assert(is_empty_list(& ht->buckets[i]));
- }
-}
-
-
-void *
-hash_table_find(struct hash_table *ht, const void *key)
-{
- const unsigned hash_value = (*ht->hash)(key);
- const unsigned bucket = hash_value % ht->num_buckets;
- struct node *node;
-
- foreach(node, & ht->buckets[bucket]) {
- struct hash_node *hn = (struct hash_node *) node;
-
- if ((*ht->compare)(hn->key, key) == 0) {
- return hn->data;
- }
- }
-
- return NULL;
-}
-
-
-void
-hash_table_insert(struct hash_table *ht, void *data, const void *key)
-{
- const unsigned hash_value = (*ht->hash)(key);
- const unsigned bucket = hash_value % ht->num_buckets;
- struct hash_node *node;
-
- node = calloc(1, sizeof(*node));
-
- node->data = data;
- node->key = key;
-
- insert_at_head(& ht->buckets[bucket], & node->link);
-}
-
-void
-hash_table_remove(struct hash_table *ht, const void *key)
-{
- const unsigned hash_value = (*ht->hash)(key);
- const unsigned bucket = hash_value % ht->num_buckets;
- struct node *node;
-
- foreach(node, & ht->buckets[bucket]) {
- struct hash_node *hn = (struct hash_node *) node;
-
- if ((*ht->compare)(hn->key, key) == 0) {
- remove_from_list(node);
- free(node);
- return;
- }
- }
-}
-
-void
-hash_table_call_foreach(struct hash_table *ht,
- void (*callback)(const void *key,
- void *data,
- void *closure),
- void *closure)
-{
- int bucket;
-
- for (bucket = 0; bucket < ht->num_buckets; bucket++) {
- struct node *node, *temp;
- foreach_s(node, temp, &ht->buckets[bucket]) {
- struct hash_node *hn = (struct hash_node *) node;
-
- callback(hn->key, hn->data, closure);
- }
- }
-}
-
-unsigned
-hash_table_string_hash(const void *key)
-{
- const char *str = (const char *) key;
- unsigned hash = 5381;
-
-
- while (*str != '\0') {
- hash = (hash * 33) + *str;
- str++;
- }
-
- return hash;
-}
-
-
-unsigned
-hash_table_pointer_hash(const void *key)
-{
- return (unsigned)((uintptr_t) key / sizeof(void *));
-}
-
-
-int
-hash_table_pointer_compare(const void *key1, const void *key2)
-{
- return key1 == key2 ? 0 : 1;
-}
+/*
+ * Copyright © 2008 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+/**
+ * \file hash_table.c
+ * \brief Implementation of a generic, opaque hash table data type.
+ *
+ * \author Ian Romanick <ian.d.romanick@intel.com>
+ */
+
+#include "main/imports.h"
+#include "main/simple_list.h"
+#include "hash_table.h"
+
+struct node {
+ struct node *next;
+ struct node *prev;
+};
+
+struct hash_table {
+ hash_func_t hash;
+ hash_compare_func_t compare;
+
+ unsigned num_buckets;
+ struct node buckets[1];
+};
+
+
+struct hash_node {
+ struct node link;
+ const void *key;
+ void *data;
+};
+
+
+struct hash_table *
+hash_table_ctor(unsigned num_buckets, hash_func_t hash,
+ hash_compare_func_t compare)
+{
+ struct hash_table *ht;
+ unsigned i;
+
+
+ if (num_buckets < 16) {
+ num_buckets = 16;
+ }
+
+ ht = malloc(sizeof(*ht) + ((num_buckets - 1)
+ * sizeof(ht->buckets[0])));
+ if (ht != NULL) {
+ ht->hash = hash;
+ ht->compare = compare;
+ ht->num_buckets = num_buckets;
+
+ for (i = 0; i < num_buckets; i++) {
+ make_empty_list(& ht->buckets[i]);
+ }
+ }
+
+ return ht;
+}
+
+
+void
+hash_table_dtor(struct hash_table *ht)
+{
+ hash_table_clear(ht);
+ free(ht);
+}
+
+
+void
+hash_table_clear(struct hash_table *ht)
+{
+ struct node *node;
+ struct node *temp;
+ unsigned i;
+
+
+ for (i = 0; i < ht->num_buckets; i++) {
+ foreach_s(node, temp, & ht->buckets[i]) {
+ remove_from_list(node);
+ free(node);
+ }
+
+ assert(is_empty_list(& ht->buckets[i]));
+ }
+}
+
+
+void *
+hash_table_find(struct hash_table *ht, const void *key)
+{
+ const unsigned hash_value = (*ht->hash)(key);
+ const unsigned bucket = hash_value % ht->num_buckets;
+ struct node *node;
+
+ foreach(node, & ht->buckets[bucket]) {
+ struct hash_node *hn = (struct hash_node *) node;
+
+ if ((*ht->compare)(hn->key, key) == 0) {
+ return hn->data;
+ }
+ }
+
+ return NULL;
+}
+
+
+void
+hash_table_insert(struct hash_table *ht, void *data, const void *key)
+{
+ const unsigned hash_value = (*ht->hash)(key);
+ const unsigned bucket = hash_value % ht->num_buckets;
+ struct hash_node *node;
+
+ node = calloc(1, sizeof(*node));
+
+ node->data = data;
+ node->key = key;
+
+ insert_at_head(& ht->buckets[bucket], & node->link);
+}
+
+void
+hash_table_remove(struct hash_table *ht, const void *key)
+{
+ const unsigned hash_value = (*ht->hash)(key);
+ const unsigned bucket = hash_value % ht->num_buckets;
+ struct node *node;
+
+ foreach(node, & ht->buckets[bucket]) {
+ struct hash_node *hn = (struct hash_node *) node;
+
+ if ((*ht->compare)(hn->key, key) == 0) {
+ remove_from_list(node);
+ free(node);
+ return;
+ }
+ }
+}
+
+void
+hash_table_call_foreach(struct hash_table *ht,
+ void (*callback)(const void *key,
+ void *data,
+ void *closure),
+ void *closure)
+{
+ int bucket;
+
+ for (bucket = 0; bucket < ht->num_buckets; bucket++) {
+ struct node *node, *temp;
+ foreach_s(node, temp, &ht->buckets[bucket]) {
+ struct hash_node *hn = (struct hash_node *) node;
+
+ callback(hn->key, hn->data, closure);
+ }
+ }
+}
+
+unsigned
+hash_table_string_hash(const void *key)
+{
+ const char *str = (const char *) key;
+ unsigned hash = 5381;
+
+
+ while (*str != '\0') {
+ hash = (hash * 33) + *str;
+ str++;
+ }
+
+ return hash;
+}
+
+
+unsigned
+hash_table_pointer_hash(const void *key)
+{
+ return (unsigned)((uintptr_t) key / sizeof(void *));
+}
+
+
+int
+hash_table_pointer_compare(const void *key1, const void *key2)
+{
+ return key1 == key2 ? 0 : 1;
+}
diff --git a/mesalib/src/mesa/program/hash_table.h b/mesalib/src/mesa/program/hash_table.h
index e715bb1cc..3910d0624 100644
--- a/mesalib/src/mesa/program/hash_table.h
+++ b/mesalib/src/mesa/program/hash_table.h
@@ -1,157 +1,157 @@
-/*
- * Copyright © 2008 Intel Corporation
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-
-/**
- * \file hash_table.h
- * \brief Implementation of a generic, opaque hash table data type.
- *
- * \author Ian Romanick <ian.d.romanick@intel.com>
- */
-
-#ifndef HASH_TABLE_H
-#define HASH_TABLE_H
-
-struct hash_table;
-
-typedef unsigned (*hash_func_t)(const void *key);
-typedef int (*hash_compare_func_t)(const void *key1, const void *key2);
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- * Hash table constructor
- *
- * Creates a hash table with the specified number of buckets. The supplied
- * \c hash and \c compare routines are used when adding elements to the table
- * and when searching for elements in the table.
- *
- * \param num_buckets Number of buckets (bins) in the hash table.
- * \param hash Function used to compute hash value of input keys.
- * \param compare Function used to compare keys.
- */
-extern struct hash_table *hash_table_ctor(unsigned num_buckets,
- hash_func_t hash, hash_compare_func_t compare);
-
-
-/**
- * Release all memory associated with a hash table
- *
- * \warning
- * This function cannot release memory occupied either by keys or data.
- */
-extern void hash_table_dtor(struct hash_table *ht);
-
-
-/**
- * Flush all entries from a hash table
- *
- * \param ht Table to be cleared of its entries.
- */
-extern void hash_table_clear(struct hash_table *ht);
-
-
-/**
- * Search a hash table for a specific element
- *
- * \param ht Table to be searched
- * \param key Key of the desired element
- *
- * \return
- * The \c data value supplied to \c hash_table_insert when the element with
- * the matching key was added. If no matching key exists in the table,
- * \c NULL is returned.
- */
-extern void *hash_table_find(struct hash_table *ht, const void *key);
-
-
-/**
- * Add an element to a hash table
- */
-extern void hash_table_insert(struct hash_table *ht, void *data,
- const void *key);
-
-/**
- * Remove a specific element from a hash table.
- */
-extern void hash_table_remove(struct hash_table *ht, const void *key);
-
-/**
- * Compute hash value of a string
- *
- * Computes the hash value of a string using the DJB2 algorithm developed by
- * Professor Daniel J. Bernstein. It was published on comp.lang.c once upon
- * a time. I was unable to find the original posting in the archives.
- *
- * \param key Pointer to a NUL terminated string to be hashed.
- *
- * \sa hash_table_string_compare
- */
-extern unsigned hash_table_string_hash(const void *key);
-
-
-/**
- * Compare two strings used as keys
- *
- * This is just a macro wrapper around \c strcmp.
- *
- * \sa hash_table_string_hash
- */
-#define hash_table_string_compare ((hash_compare_func_t) strcmp)
-
-
-/**
- * Compute hash value of a pointer
- *
- * \param key Pointer to be used as a hash key
- *
- * \note
- * The memory pointed to by \c key is \b never accessed. The value of \c key
- * itself is used as the hash key
- *
- * \sa hash_table_pointer_compare
- */
-unsigned
-hash_table_pointer_hash(const void *key);
-
-
-/**
- * Compare two pointers used as keys
- *
- * \sa hash_table_pointer_hash
- */
-int
-hash_table_pointer_compare(const void *key1, const void *key2);
-
-void
-hash_table_call_foreach(struct hash_table *ht,
- void (*callback)(const void *key,
- void *data,
- void *closure),
- void *closure);
-
-#ifdef __cplusplus
-}
-#endif
-#endif /* HASH_TABLE_H */
+/*
+ * Copyright © 2008 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+/**
+ * \file hash_table.h
+ * \brief Implementation of a generic, opaque hash table data type.
+ *
+ * \author Ian Romanick <ian.d.romanick@intel.com>
+ */
+
+#ifndef HASH_TABLE_H
+#define HASH_TABLE_H
+
+struct hash_table;
+
+typedef unsigned (*hash_func_t)(const void *key);
+typedef int (*hash_compare_func_t)(const void *key1, const void *key2);
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * Hash table constructor
+ *
+ * Creates a hash table with the specified number of buckets. The supplied
+ * \c hash and \c compare routines are used when adding elements to the table
+ * and when searching for elements in the table.
+ *
+ * \param num_buckets Number of buckets (bins) in the hash table.
+ * \param hash Function used to compute hash value of input keys.
+ * \param compare Function used to compare keys.
+ */
+extern struct hash_table *hash_table_ctor(unsigned num_buckets,
+ hash_func_t hash, hash_compare_func_t compare);
+
+
+/**
+ * Release all memory associated with a hash table
+ *
+ * \warning
+ * This function cannot release memory occupied either by keys or data.
+ */
+extern void hash_table_dtor(struct hash_table *ht);
+
+
+/**
+ * Flush all entries from a hash table
+ *
+ * \param ht Table to be cleared of its entries.
+ */
+extern void hash_table_clear(struct hash_table *ht);
+
+
+/**
+ * Search a hash table for a specific element
+ *
+ * \param ht Table to be searched
+ * \param key Key of the desired element
+ *
+ * \return
+ * The \c data value supplied to \c hash_table_insert when the element with
+ * the matching key was added. If no matching key exists in the table,
+ * \c NULL is returned.
+ */
+extern void *hash_table_find(struct hash_table *ht, const void *key);
+
+
+/**
+ * Add an element to a hash table
+ */
+extern void hash_table_insert(struct hash_table *ht, void *data,
+ const void *key);
+
+/**
+ * Remove a specific element from a hash table.
+ */
+extern void hash_table_remove(struct hash_table *ht, const void *key);
+
+/**
+ * Compute hash value of a string
+ *
+ * Computes the hash value of a string using the DJB2 algorithm developed by
+ * Professor Daniel J. Bernstein. It was published on comp.lang.c once upon
+ * a time. I was unable to find the original posting in the archives.
+ *
+ * \param key Pointer to a NUL terminated string to be hashed.
+ *
+ * \sa hash_table_string_compare
+ */
+extern unsigned hash_table_string_hash(const void *key);
+
+
+/**
+ * Compare two strings used as keys
+ *
+ * This is just a macro wrapper around \c strcmp.
+ *
+ * \sa hash_table_string_hash
+ */
+#define hash_table_string_compare ((hash_compare_func_t) strcmp)
+
+
+/**
+ * Compute hash value of a pointer
+ *
+ * \param key Pointer to be used as a hash key
+ *
+ * \note
+ * The memory pointed to by \c key is \b never accessed. The value of \c key
+ * itself is used as the hash key
+ *
+ * \sa hash_table_pointer_compare
+ */
+unsigned
+hash_table_pointer_hash(const void *key);
+
+
+/**
+ * Compare two pointers used as keys
+ *
+ * \sa hash_table_pointer_hash
+ */
+int
+hash_table_pointer_compare(const void *key1, const void *key2);
+
+void
+hash_table_call_foreach(struct hash_table *ht,
+ void (*callback)(const void *key,
+ void *data,
+ void *closure),
+ void *closure);
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* HASH_TABLE_H */
diff --git a/mesalib/src/mesa/program/ir_to_mesa.cpp b/mesalib/src/mesa/program/ir_to_mesa.cpp
index 510aeab82..ebeaa9ce3 100644
--- a/mesalib/src/mesa/program/ir_to_mesa.cpp
+++ b/mesalib/src/mesa/program/ir_to_mesa.cpp
@@ -1,3284 +1,3284 @@
-/*
- * Copyright (C) 2005-2007 Brian Paul All Rights Reserved.
- * Copyright (C) 2008 VMware, Inc. All Rights Reserved.
- * Copyright © 2010 Intel Corporation
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-
-/**
- * \file ir_to_mesa.cpp
- *
- * Translate GLSL IR to Mesa's gl_program representation.
- */
-
-#include <stdio.h>
-#include "main/compiler.h"
-#include "ir.h"
-#include "ir_visitor.h"
-#include "ir_print_visitor.h"
-#include "ir_expression_flattening.h"
-#include "glsl_types.h"
-#include "glsl_parser_extras.h"
-#include "../glsl/program.h"
-#include "ir_optimization.h"
-#include "ast.h"
-
-extern "C" {
-#include "main/mtypes.h"
-#include "main/shaderapi.h"
-#include "main/shaderobj.h"
-#include "main/uniforms.h"
-#include "program/hash_table.h"
-#include "program/prog_instruction.h"
-#include "program/prog_optimize.h"
-#include "program/prog_print.h"
-#include "program/program.h"
-#include "program/prog_uniform.h"
-#include "program/prog_parameter.h"
-#include "program/sampler.h"
-}
-
-class src_reg;
-class dst_reg;
-
-static int swizzle_for_size(int size);
-
-/**
- * This struct is a corresponding struct to Mesa prog_src_register, with
- * wider fields.
- */
-class src_reg {
-public:
- src_reg(gl_register_file file, int index, const glsl_type *type)
- {
- this->file = file;
- this->index = index;
- if (type && (type->is_scalar() || type->is_vector() || type->is_matrix()))
- this->swizzle = swizzle_for_size(type->vector_elements);
- else
- this->swizzle = SWIZZLE_XYZW;
- this->negate = 0;
- this->reladdr = NULL;
- }
-
- src_reg()
- {
- this->file = PROGRAM_UNDEFINED;
- this->index = 0;
- this->swizzle = 0;
- this->negate = 0;
- this->reladdr = NULL;
- }
-
- explicit src_reg(dst_reg reg);
-
- gl_register_file file; /**< PROGRAM_* from Mesa */
- int index; /**< temporary index, VERT_ATTRIB_*, FRAG_ATTRIB_*, etc. */
- GLuint swizzle; /**< SWIZZLE_XYZWONEZERO swizzles from Mesa. */
- int negate; /**< NEGATE_XYZW mask from mesa */
- /** Register index should be offset by the integer in this reg. */
- src_reg *reladdr;
-};
-
-class dst_reg {
-public:
- dst_reg(gl_register_file file, int writemask)
- {
- this->file = file;
- this->index = 0;
- this->writemask = writemask;
- this->cond_mask = COND_TR;
- this->reladdr = NULL;
- }
-
- dst_reg()
- {
- this->file = PROGRAM_UNDEFINED;
- this->index = 0;
- this->writemask = 0;
- this->cond_mask = COND_TR;
- this->reladdr = NULL;
- }
-
- explicit dst_reg(src_reg reg);
-
- gl_register_file file; /**< PROGRAM_* from Mesa */
- int index; /**< temporary index, VERT_ATTRIB_*, FRAG_ATTRIB_*, etc. */
- int writemask; /**< Bitfield of WRITEMASK_[XYZW] */
- GLuint cond_mask:4;
- /** Register index should be offset by the integer in this reg. */
- src_reg *reladdr;
-};
-
-src_reg::src_reg(dst_reg reg)
-{
- this->file = reg.file;
- this->index = reg.index;
- this->swizzle = SWIZZLE_XYZW;
- this->negate = 0;
- this->reladdr = NULL;
-}
-
-dst_reg::dst_reg(src_reg reg)
-{
- this->file = reg.file;
- this->index = reg.index;
- this->writemask = WRITEMASK_XYZW;
- this->cond_mask = COND_TR;
- this->reladdr = reg.reladdr;
-}
-
-class ir_to_mesa_instruction : public exec_node {
-public:
- /* Callers of this ralloc-based new need not call delete. It's
- * easier to just ralloc_free 'ctx' (or any of its ancestors). */
- static void* operator new(size_t size, void *ctx)
- {
- void *node;
-
- node = rzalloc_size(ctx, size);
- assert(node != NULL);
-
- return node;
- }
-
- enum prog_opcode op;
- dst_reg dst;
- src_reg src[3];
- /** Pointer to the ir source this tree came from for debugging */
- ir_instruction *ir;
- GLboolean cond_update;
- bool saturate;
- int sampler; /**< sampler index */
- int tex_target; /**< One of TEXTURE_*_INDEX */
- GLboolean tex_shadow;
-
- class function_entry *function; /* Set on OPCODE_CAL or OPCODE_BGNSUB */
-};
-
-class variable_storage : public exec_node {
-public:
- variable_storage(ir_variable *var, gl_register_file file, int index)
- : file(file), index(index), var(var)
- {
- /* empty */
- }
-
- gl_register_file file;
- int index;
- ir_variable *var; /* variable that maps to this, if any */
-};
-
-class function_entry : public exec_node {
-public:
- ir_function_signature *sig;
-
- /**
- * identifier of this function signature used by the program.
- *
- * At the point that Mesa instructions for function calls are
- * generated, we don't know the address of the first instruction of
- * the function body. So we make the BranchTarget that is called a
- * small integer and rewrite them during set_branchtargets().
- */
- int sig_id;
-
- /**
- * Pointer to first instruction of the function body.
- *
- * Set during function body emits after main() is processed.
- */
- ir_to_mesa_instruction *bgn_inst;
-
- /**
- * Index of the first instruction of the function body in actual
- * Mesa IR.
- *
- * Set after convertion from ir_to_mesa_instruction to prog_instruction.
- */
- int inst;
-
- /** Storage for the return value. */
- src_reg return_reg;
-};
-
-class ir_to_mesa_visitor : public ir_visitor {
-public:
- ir_to_mesa_visitor();
- ~ir_to_mesa_visitor();
-
- function_entry *current_function;
-
- struct gl_context *ctx;
- struct gl_program *prog;
- struct gl_shader_program *shader_program;
- struct gl_shader_compiler_options *options;
-
- int next_temp;
-
- variable_storage *find_variable_storage(ir_variable *var);
-
- function_entry *get_function_signature(ir_function_signature *sig);
-
- src_reg get_temp(const glsl_type *type);
- void reladdr_to_temp(ir_instruction *ir, src_reg *reg, int *num_reladdr);
-
- src_reg src_reg_for_float(float val);
-
- /**
- * \name Visit methods
- *
- * As typical for the visitor pattern, there must be one \c visit method for
- * each concrete subclass of \c ir_instruction. Virtual base classes within
- * the hierarchy should not have \c visit methods.
- */
- /*@{*/
- virtual void visit(ir_variable *);
- virtual void visit(ir_loop *);
- virtual void visit(ir_loop_jump *);
- virtual void visit(ir_function_signature *);
- virtual void visit(ir_function *);
- virtual void visit(ir_expression *);
- virtual void visit(ir_swizzle *);
- virtual void visit(ir_dereference_variable *);
- virtual void visit(ir_dereference_array *);
- virtual void visit(ir_dereference_record *);
- virtual void visit(ir_assignment *);
- virtual void visit(ir_constant *);
- virtual void visit(ir_call *);
- virtual void visit(ir_return *);
- virtual void visit(ir_discard *);
- virtual void visit(ir_texture *);
- virtual void visit(ir_if *);
- /*@}*/
-
- src_reg result;
-
- /** List of variable_storage */
- exec_list variables;
-
- /** List of function_entry */
- exec_list function_signatures;
- int next_signature_id;
-
- /** List of ir_to_mesa_instruction */
- exec_list instructions;
-
- ir_to_mesa_instruction *emit(ir_instruction *ir, enum prog_opcode op);
-
- ir_to_mesa_instruction *emit(ir_instruction *ir, enum prog_opcode op,
- dst_reg dst, src_reg src0);
-
- ir_to_mesa_instruction *emit(ir_instruction *ir, enum prog_opcode op,
- dst_reg dst, src_reg src0, src_reg src1);
-
- ir_to_mesa_instruction *emit(ir_instruction *ir, enum prog_opcode op,
- dst_reg dst,
- src_reg src0, src_reg src1, src_reg src2);
-
- /**
- * Emit the correct dot-product instruction for the type of arguments
- */
- void emit_dp(ir_instruction *ir,
- dst_reg dst,
- src_reg src0,
- src_reg src1,
- unsigned elements);
-
- void emit_scalar(ir_instruction *ir, enum prog_opcode op,
- dst_reg dst, src_reg src0);
-
- void emit_scalar(ir_instruction *ir, enum prog_opcode op,
- dst_reg dst, src_reg src0, src_reg src1);
-
- void emit_scs(ir_instruction *ir, enum prog_opcode op,
- dst_reg dst, const src_reg &src);
-
- GLboolean try_emit_mad(ir_expression *ir,
- int mul_operand);
- GLboolean try_emit_sat(ir_expression *ir);
-
- void emit_swz(ir_expression *ir);
-
- bool process_move_condition(ir_rvalue *ir);
-
- void copy_propagate(void);
-
- void *mem_ctx;
-};
-
-src_reg undef_src = src_reg(PROGRAM_UNDEFINED, 0, NULL);
-
-dst_reg undef_dst = dst_reg(PROGRAM_UNDEFINED, SWIZZLE_NOOP);
-
-dst_reg address_reg = dst_reg(PROGRAM_ADDRESS, WRITEMASK_X);
-
-static void
-fail_link(struct gl_shader_program *prog, const char *fmt, ...) PRINTFLIKE(2, 3);
-
-static void
-fail_link(struct gl_shader_program *prog, const char *fmt, ...)
-{
- va_list args;
- va_start(args, fmt);
- ralloc_vasprintf_append(&prog->InfoLog, fmt, args);
- va_end(args);
-
- prog->LinkStatus = GL_FALSE;
-}
-
-static int
-swizzle_for_size(int size)
-{
- int size_swizzles[4] = {
- MAKE_SWIZZLE4(SWIZZLE_X, SWIZZLE_X, SWIZZLE_X, SWIZZLE_X),
- MAKE_SWIZZLE4(SWIZZLE_X, SWIZZLE_Y, SWIZZLE_Y, SWIZZLE_Y),
- MAKE_SWIZZLE4(SWIZZLE_X, SWIZZLE_Y, SWIZZLE_Z, SWIZZLE_Z),
- MAKE_SWIZZLE4(SWIZZLE_X, SWIZZLE_Y, SWIZZLE_Z, SWIZZLE_W),
- };
-
- assert((size >= 1) && (size <= 4));
- return size_swizzles[size - 1];
-}
-
-ir_to_mesa_instruction *
-ir_to_mesa_visitor::emit(ir_instruction *ir, enum prog_opcode op,
- dst_reg dst,
- src_reg src0, src_reg src1, src_reg src2)
-{
- ir_to_mesa_instruction *inst = new(mem_ctx) ir_to_mesa_instruction();
- int num_reladdr = 0;
-
- /* If we have to do relative addressing, we want to load the ARL
- * reg directly for one of the regs, and preload the other reladdr
- * sources into temps.
- */
- num_reladdr += dst.reladdr != NULL;
- num_reladdr += src0.reladdr != NULL;
- num_reladdr += src1.reladdr != NULL;
- num_reladdr += src2.reladdr != NULL;
-
- reladdr_to_temp(ir, &src2, &num_reladdr);
- reladdr_to_temp(ir, &src1, &num_reladdr);
- reladdr_to_temp(ir, &src0, &num_reladdr);
-
- if (dst.reladdr) {
- emit(ir, OPCODE_ARL, address_reg, *dst.reladdr);
- num_reladdr--;
- }
- assert(num_reladdr == 0);
-
- inst->op = op;
- inst->dst = dst;
- inst->src[0] = src0;
- inst->src[1] = src1;
- inst->src[2] = src2;
- inst->ir = ir;
-
- inst->function = NULL;
-
- this->instructions.push_tail(inst);
-
- return inst;
-}
-
-
-ir_to_mesa_instruction *
-ir_to_mesa_visitor::emit(ir_instruction *ir, enum prog_opcode op,
- dst_reg dst, src_reg src0, src_reg src1)
-{
- return emit(ir, op, dst, src0, src1, undef_src);
-}
-
-ir_to_mesa_instruction *
-ir_to_mesa_visitor::emit(ir_instruction *ir, enum prog_opcode op,
- dst_reg dst, src_reg src0)
-{
- assert(dst.writemask != 0);
- return emit(ir, op, dst, src0, undef_src, undef_src);
-}
-
-ir_to_mesa_instruction *
-ir_to_mesa_visitor::emit(ir_instruction *ir, enum prog_opcode op)
-{
- return emit(ir, op, undef_dst, undef_src, undef_src, undef_src);
-}
-
-void
-ir_to_mesa_visitor::emit_dp(ir_instruction *ir,
- dst_reg dst, src_reg src0, src_reg src1,
- unsigned elements)
-{
- static const gl_inst_opcode dot_opcodes[] = {
- OPCODE_DP2, OPCODE_DP3, OPCODE_DP4
- };
-
- emit(ir, dot_opcodes[elements - 2], dst, src0, src1);
-}
-
-/**
- * Emits Mesa scalar opcodes to produce unique answers across channels.
- *
- * Some Mesa opcodes are scalar-only, like ARB_fp/vp. The src X
- * channel determines the result across all channels. So to do a vec4
- * of this operation, we want to emit a scalar per source channel used
- * to produce dest channels.
- */
-void
-ir_to_mesa_visitor::emit_scalar(ir_instruction *ir, enum prog_opcode op,
- dst_reg dst,
- src_reg orig_src0, src_reg orig_src1)
-{
- int i, j;
- int done_mask = ~dst.writemask;
-
- /* Mesa RCP is a scalar operation splatting results to all channels,
- * like ARB_fp/vp. So emit as many RCPs as necessary to cover our
- * dst channels.
- */
- for (i = 0; i < 4; i++) {
- GLuint this_mask = (1 << i);
- ir_to_mesa_instruction *inst;
- src_reg src0 = orig_src0;
- src_reg src1 = orig_src1;
-
- if (done_mask & this_mask)
- continue;
-
- GLuint src0_swiz = GET_SWZ(src0.swizzle, i);
- GLuint src1_swiz = GET_SWZ(src1.swizzle, i);
- for (j = i + 1; j < 4; j++) {
- /* If there is another enabled component in the destination that is
- * derived from the same inputs, generate its value on this pass as
- * well.
- */
- if (!(done_mask & (1 << j)) &&
- GET_SWZ(src0.swizzle, j) == src0_swiz &&
- GET_SWZ(src1.swizzle, j) == src1_swiz) {
- this_mask |= (1 << j);
- }
- }
- src0.swizzle = MAKE_SWIZZLE4(src0_swiz, src0_swiz,
- src0_swiz, src0_swiz);
- src1.swizzle = MAKE_SWIZZLE4(src1_swiz, src1_swiz,
- src1_swiz, src1_swiz);
-
- inst = emit(ir, op, dst, src0, src1);
- inst->dst.writemask = this_mask;
- done_mask |= this_mask;
- }
-}
-
-void
-ir_to_mesa_visitor::emit_scalar(ir_instruction *ir, enum prog_opcode op,
- dst_reg dst, src_reg src0)
-{
- src_reg undef = undef_src;
-
- undef.swizzle = SWIZZLE_XXXX;
-
- emit_scalar(ir, op, dst, src0, undef);
-}
-
-/**
- * Emit an OPCODE_SCS instruction
- *
- * The \c SCS opcode functions a bit differently than the other Mesa (or
- * ARB_fragment_program) opcodes. Instead of splatting its result across all
- * four components of the destination, it writes one value to the \c x
- * component and another value to the \c y component.
- *
- * \param ir IR instruction being processed
- * \param op Either \c OPCODE_SIN or \c OPCODE_COS depending on which
- * value is desired.
- * \param dst Destination register
- * \param src Source register
- */
-void
-ir_to_mesa_visitor::emit_scs(ir_instruction *ir, enum prog_opcode op,
- dst_reg dst,
- const src_reg &src)
-{
- /* Vertex programs cannot use the SCS opcode.
- */
- if (this->prog->Target == GL_VERTEX_PROGRAM_ARB) {
- emit_scalar(ir, op, dst, src);
- return;
- }
-
- const unsigned component = (op == OPCODE_SIN) ? 0 : 1;
- const unsigned scs_mask = (1U << component);
- int done_mask = ~dst.writemask;
- src_reg tmp;
-
- assert(op == OPCODE_SIN || op == OPCODE_COS);
-
- /* If there are compnents in the destination that differ from the component
- * that will be written by the SCS instrution, we'll need a temporary.
- */
- if (scs_mask != unsigned(dst.writemask)) {
- tmp = get_temp(glsl_type::vec4_type);
- }
-
- for (unsigned i = 0; i < 4; i++) {
- unsigned this_mask = (1U << i);
- src_reg src0 = src;
-
- if ((done_mask & this_mask) != 0)
- continue;
-
- /* The source swizzle specified which component of the source generates
- * sine / cosine for the current component in the destination. The SCS
- * instruction requires that this value be swizzle to the X component.
- * Replace the current swizzle with a swizzle that puts the source in
- * the X component.
- */
- unsigned src0_swiz = GET_SWZ(src.swizzle, i);
-
- src0.swizzle = MAKE_SWIZZLE4(src0_swiz, src0_swiz,
- src0_swiz, src0_swiz);
- for (unsigned j = i + 1; j < 4; j++) {
- /* If there is another enabled component in the destination that is
- * derived from the same inputs, generate its value on this pass as
- * well.
- */
- if (!(done_mask & (1 << j)) &&
- GET_SWZ(src0.swizzle, j) == src0_swiz) {
- this_mask |= (1 << j);
- }
- }
-
- if (this_mask != scs_mask) {
- ir_to_mesa_instruction *inst;
- dst_reg tmp_dst = dst_reg(tmp);
-
- /* Emit the SCS instruction.
- */
- inst = emit(ir, OPCODE_SCS, tmp_dst, src0);
- inst->dst.writemask = scs_mask;
-
- /* Move the result of the SCS instruction to the desired location in
- * the destination.
- */
- tmp.swizzle = MAKE_SWIZZLE4(component, component,
- component, component);
- inst = emit(ir, OPCODE_SCS, dst, tmp);
- inst->dst.writemask = this_mask;
- } else {
- /* Emit the SCS instruction to write directly to the destination.
- */
- ir_to_mesa_instruction *inst = emit(ir, OPCODE_SCS, dst, src0);
- inst->dst.writemask = scs_mask;
- }
-
- done_mask |= this_mask;
- }
-}
-
-struct src_reg
-ir_to_mesa_visitor::src_reg_for_float(float val)
-{
- src_reg src(PROGRAM_CONSTANT, -1, NULL);
-
- src.index = _mesa_add_unnamed_constant(this->prog->Parameters,
- &val, 1, &src.swizzle);
-
- return src;
-}
-
-static int
-type_size(const struct glsl_type *type)
-{
- unsigned int i;
- int size;
-
- switch (type->base_type) {
- case GLSL_TYPE_UINT:
- case GLSL_TYPE_INT:
- case GLSL_TYPE_FLOAT:
- case GLSL_TYPE_BOOL:
- if (type->is_matrix()) {
- return type->matrix_columns;
- } else {
- /* Regardless of size of vector, it gets a vec4. This is bad
- * packing for things like floats, but otherwise arrays become a
- * mess. Hopefully a later pass over the code can pack scalars
- * down if appropriate.
- */
- return 1;
- }
- case GLSL_TYPE_ARRAY:
- assert(type->length > 0);
- return type_size(type->fields.array) * type->length;
- case GLSL_TYPE_STRUCT:
- size = 0;
- for (i = 0; i < type->length; i++) {
- size += type_size(type->fields.structure[i].type);
- }
- return size;
- case GLSL_TYPE_SAMPLER:
- /* Samplers take up one slot in UNIFORMS[], but they're baked in
- * at link time.
- */
- return 1;
- default:
- assert(0);
- return 0;
- }
-}
-
-/**
- * In the initial pass of codegen, we assign temporary numbers to
- * intermediate results. (not SSA -- variable assignments will reuse
- * storage). Actual register allocation for the Mesa VM occurs in a
- * pass over the Mesa IR later.
- */
-src_reg
-ir_to_mesa_visitor::get_temp(const glsl_type *type)
-{
- src_reg src;
- int swizzle[4];
- int i;
-
- src.file = PROGRAM_TEMPORARY;
- src.index = next_temp;
- src.reladdr = NULL;
- next_temp += type_size(type);
-
- if (type->is_array() || type->is_record()) {
- src.swizzle = SWIZZLE_NOOP;
- } else {
- for (i = 0; i < type->vector_elements; i++)
- swizzle[i] = i;
- for (; i < 4; i++)
- swizzle[i] = type->vector_elements - 1;
- src.swizzle = MAKE_SWIZZLE4(swizzle[0], swizzle[1],
- swizzle[2], swizzle[3]);
- }
- src.negate = 0;
-
- return src;
-}
-
-variable_storage *
-ir_to_mesa_visitor::find_variable_storage(ir_variable *var)
-{
-
- variable_storage *entry;
-
- foreach_iter(exec_list_iterator, iter, this->variables) {
- entry = (variable_storage *)iter.get();
-
- if (entry->var == var)
- return entry;
- }
-
- return NULL;
-}
-
-void
-ir_to_mesa_visitor::visit(ir_variable *ir)
-{
- if (strcmp(ir->name, "gl_FragCoord") == 0) {
- struct gl_fragment_program *fp = (struct gl_fragment_program *)this->prog;
-
- fp->OriginUpperLeft = ir->origin_upper_left;
- fp->PixelCenterInteger = ir->pixel_center_integer;
-
- } else if (strcmp(ir->name, "gl_FragDepth") == 0) {
- struct gl_fragment_program *fp = (struct gl_fragment_program *)this->prog;
- switch (ir->depth_layout) {
- case ir_depth_layout_none:
- fp->FragDepthLayout = FRAG_DEPTH_LAYOUT_NONE;
- break;
- case ir_depth_layout_any:
- fp->FragDepthLayout = FRAG_DEPTH_LAYOUT_ANY;
- break;
- case ir_depth_layout_greater:
- fp->FragDepthLayout = FRAG_DEPTH_LAYOUT_GREATER;
- break;
- case ir_depth_layout_less:
- fp->FragDepthLayout = FRAG_DEPTH_LAYOUT_LESS;
- break;
- case ir_depth_layout_unchanged:
- fp->FragDepthLayout = FRAG_DEPTH_LAYOUT_UNCHANGED;
- break;
- default:
- assert(0);
- break;
- }
- }
-
- if (ir->mode == ir_var_uniform && strncmp(ir->name, "gl_", 3) == 0) {
- unsigned int i;
- const ir_state_slot *const slots = ir->state_slots;
- assert(ir->state_slots != NULL);
-
- /* Check if this statevar's setup in the STATE file exactly
- * matches how we'll want to reference it as a
- * struct/array/whatever. If not, then we need to move it into
- * temporary storage and hope that it'll get copy-propagated
- * out.
- */
- for (i = 0; i < ir->num_state_slots; i++) {
- if (slots[i].swizzle != SWIZZLE_XYZW) {
- break;
- }
- }
-
- struct variable_storage *storage;
- dst_reg dst;
- if (i == ir->num_state_slots) {
- /* We'll set the index later. */
- storage = new(mem_ctx) variable_storage(ir, PROGRAM_STATE_VAR, -1);
- this->variables.push_tail(storage);
-
- dst = undef_dst;
- } else {
- /* The variable_storage constructor allocates slots based on the size
- * of the type. However, this had better match the number of state
- * elements that we're going to copy into the new temporary.
- */
- assert((int) ir->num_state_slots == type_size(ir->type));
-
- storage = new(mem_ctx) variable_storage(ir, PROGRAM_TEMPORARY,
- this->next_temp);
- this->variables.push_tail(storage);
- this->next_temp += type_size(ir->type);
-
- dst = dst_reg(src_reg(PROGRAM_TEMPORARY, storage->index, NULL));
- }
-
-
- for (unsigned int i = 0; i < ir->num_state_slots; i++) {
- int index = _mesa_add_state_reference(this->prog->Parameters,
- (gl_state_index *)slots[i].tokens);
-
- if (storage->file == PROGRAM_STATE_VAR) {
- if (storage->index == -1) {
- storage->index = index;
- } else {
- assert(index == storage->index + (int)i);
- }
- } else {
- src_reg src(PROGRAM_STATE_VAR, index, NULL);
- src.swizzle = slots[i].swizzle;
- emit(ir, OPCODE_MOV, dst, src);
- /* even a float takes up a whole vec4 reg in a struct/array. */
- dst.index++;
- }
- }
-
- if (storage->file == PROGRAM_TEMPORARY &&
- dst.index != storage->index + (int) ir->num_state_slots) {
- fail_link(this->shader_program,
- "failed to load builtin uniform `%s' (%d/%d regs loaded)\n",
- ir->name, dst.index - storage->index,
- type_size(ir->type));
- }
- }
-}
-
-void
-ir_to_mesa_visitor::visit(ir_loop *ir)
-{
- ir_dereference_variable *counter = NULL;
-
- if (ir->counter != NULL)
- counter = new(ir) ir_dereference_variable(ir->counter);
-
- if (ir->from != NULL) {
- assert(ir->counter != NULL);
-
- ir_assignment *a = new(ir) ir_assignment(counter, ir->from, NULL);
-
- a->accept(this);
- delete a;
- }
-
- emit(NULL, OPCODE_BGNLOOP);
-
- if (ir->to) {
- ir_expression *e =
- new(ir) ir_expression(ir->cmp, glsl_type::bool_type,
- counter, ir->to);
- ir_if *if_stmt = new(ir) ir_if(e);
-
- ir_loop_jump *brk = new(ir) ir_loop_jump(ir_loop_jump::jump_break);
-
- if_stmt->then_instructions.push_tail(brk);
-
- if_stmt->accept(this);
-
- delete if_stmt;
- delete e;
- delete brk;
- }
-
- visit_exec_list(&ir->body_instructions, this);
-
- if (ir->increment) {
- ir_expression *e =
- new(ir) ir_expression(ir_binop_add, counter->type,
- counter, ir->increment);
-
- ir_assignment *a = new(ir) ir_assignment(counter, e, NULL);
-
- a->accept(this);
- delete a;
- delete e;
- }
-
- emit(NULL, OPCODE_ENDLOOP);
-}
-
-void
-ir_to_mesa_visitor::visit(ir_loop_jump *ir)
-{
- switch (ir->mode) {
- case ir_loop_jump::jump_break:
- emit(NULL, OPCODE_BRK);
- break;
- case ir_loop_jump::jump_continue:
- emit(NULL, OPCODE_CONT);
- break;
- }
-}
-
-
-void
-ir_to_mesa_visitor::visit(ir_function_signature *ir)
-{
- assert(0);
- (void)ir;
-}
-
-void
-ir_to_mesa_visitor::visit(ir_function *ir)
-{
- /* Ignore function bodies other than main() -- we shouldn't see calls to
- * them since they should all be inlined before we get to ir_to_mesa.
- */
- if (strcmp(ir->name, "main") == 0) {
- const ir_function_signature *sig;
- exec_list empty;
-
- sig = ir->matching_signature(&empty);
-
- assert(sig);
-
- foreach_iter(exec_list_iterator, iter, sig->body) {
- ir_instruction *ir = (ir_instruction *)iter.get();
-
- ir->accept(this);
- }
- }
-}
-
-GLboolean
-ir_to_mesa_visitor::try_emit_mad(ir_expression *ir, int mul_operand)
-{
- int nonmul_operand = 1 - mul_operand;
- src_reg a, b, c;
-
- ir_expression *expr = ir->operands[mul_operand]->as_expression();
- if (!expr || expr->operation != ir_binop_mul)
- return false;
-
- expr->operands[0]->accept(this);
- a = this->result;
- expr->operands[1]->accept(this);
- b = this->result;
- ir->operands[nonmul_operand]->accept(this);
- c = this->result;
-
- this->result = get_temp(ir->type);
- emit(ir, OPCODE_MAD, dst_reg(this->result), a, b, c);
-
- return true;
-}
-
-GLboolean
-ir_to_mesa_visitor::try_emit_sat(ir_expression *ir)
-{
- /* Saturates were only introduced to vertex programs in
- * NV_vertex_program3, so don't give them to drivers in the VP.
- */
- if (this->prog->Target == GL_VERTEX_PROGRAM_ARB)
- return false;
-
- ir_rvalue *sat_src = ir->as_rvalue_to_saturate();
- if (!sat_src)
- return false;
-
- sat_src->accept(this);
- src_reg src = this->result;
-
- this->result = get_temp(ir->type);
- ir_to_mesa_instruction *inst;
- inst = emit(ir, OPCODE_MOV, dst_reg(this->result), src);
- inst->saturate = true;
-
- return true;
-}
-
-void
-ir_to_mesa_visitor::reladdr_to_temp(ir_instruction *ir,
- src_reg *reg, int *num_reladdr)
-{
- if (!reg->reladdr)
- return;
-
- emit(ir, OPCODE_ARL, address_reg, *reg->reladdr);
-
- if (*num_reladdr != 1) {
- src_reg temp = get_temp(glsl_type::vec4_type);
-
- emit(ir, OPCODE_MOV, dst_reg(temp), *reg);
- *reg = temp;
- }
-
- (*num_reladdr)--;
-}
-
-void
-ir_to_mesa_visitor::emit_swz(ir_expression *ir)
-{
- /* Assume that the vector operator is in a form compatible with OPCODE_SWZ.
- * This means that each of the operands is either an immediate value of -1,
- * 0, or 1, or is a component from one source register (possibly with
- * negation).
- */
- uint8_t components[4] = { 0 };
- bool negate[4] = { false };
- ir_variable *var = NULL;
-
- for (unsigned i = 0; i < ir->type->vector_elements; i++) {
- ir_rvalue *op = ir->operands[i];
-
- assert(op->type->is_scalar());
-
- while (op != NULL) {
- switch (op->ir_type) {
- case ir_type_constant: {
-
- assert(op->type->is_scalar());
-
- const ir_constant *const c = op->as_constant();
- if (c->is_one()) {
- components[i] = SWIZZLE_ONE;
- } else if (c->is_zero()) {
- components[i] = SWIZZLE_ZERO;
- } else if (c->is_negative_one()) {
- components[i] = SWIZZLE_ONE;
- negate[i] = true;
- } else {
- assert(!"SWZ constant must be 0.0 or 1.0.");
- }
-
- op = NULL;
- break;
- }
-
- case ir_type_dereference_variable: {
- ir_dereference_variable *const deref =
- (ir_dereference_variable *) op;
-
- assert((var == NULL) || (deref->var == var));
- components[i] = SWIZZLE_X;
- var = deref->var;
- op = NULL;
- break;
- }
-
- case ir_type_expression: {
- ir_expression *const expr = (ir_expression *) op;
-
- assert(expr->operation == ir_unop_neg);
- negate[i] = true;
-
- op = expr->operands[0];
- break;
- }
-
- case ir_type_swizzle: {
- ir_swizzle *const swiz = (ir_swizzle *) op;
-
- components[i] = swiz->mask.x;
- op = swiz->val;
- break;
- }
-
- default:
- assert(!"Should not get here.");
- return;
- }
- }
- }
-
- assert(var != NULL);
-
- ir_dereference_variable *const deref =
- new(mem_ctx) ir_dereference_variable(var);
-
- this->result.file = PROGRAM_UNDEFINED;
- deref->accept(this);
- if (this->result.file == PROGRAM_UNDEFINED) {
- ir_print_visitor v;
- printf("Failed to get tree for expression operand:\n");
- deref->accept(&v);
- exit(1);
- }
-
- src_reg src;
-
- src = this->result;
- src.swizzle = MAKE_SWIZZLE4(components[0],
- components[1],
- components[2],
- components[3]);
- src.negate = ((unsigned(negate[0]) << 0)
- | (unsigned(negate[1]) << 1)
- | (unsigned(negate[2]) << 2)
- | (unsigned(negate[3]) << 3));
-
- /* Storage for our result. Ideally for an assignment we'd be using the
- * actual storage for the result here, instead.
- */
- const src_reg result_src = get_temp(ir->type);
- dst_reg result_dst = dst_reg(result_src);
-
- /* Limit writes to the channels that will be used by result_src later.
- * This does limit this temp's use as a temporary for multi-instruction
- * sequences.
- */
- result_dst.writemask = (1 << ir->type->vector_elements) - 1;
-
- emit(ir, OPCODE_SWZ, result_dst, src);
- this->result = result_src;
-}
-
-void
-ir_to_mesa_visitor::visit(ir_expression *ir)
-{
- unsigned int operand;
- src_reg op[Elements(ir->operands)];
- src_reg result_src;
- dst_reg result_dst;
-
- /* Quick peephole: Emit OPCODE_MAD(a, b, c) instead of ADD(MUL(a, b), c)
- */
- if (ir->operation == ir_binop_add) {
- if (try_emit_mad(ir, 1))
- return;
- if (try_emit_mad(ir, 0))
- return;
- }
- if (try_emit_sat(ir))
- return;
-
- if (ir->operation == ir_quadop_vector) {
- this->emit_swz(ir);
- return;
- }
-
- for (operand = 0; operand < ir->get_num_operands(); operand++) {
- this->result.file = PROGRAM_UNDEFINED;
- ir->operands[operand]->accept(this);
- if (this->result.file == PROGRAM_UNDEFINED) {
- ir_print_visitor v;
- printf("Failed to get tree for expression operand:\n");
- ir->operands[operand]->accept(&v);
- exit(1);
- }
- op[operand] = this->result;
-
- /* Matrix expression operands should have been broken down to vector
- * operations already.
- */
- assert(!ir->operands[operand]->type->is_matrix());
- }
-
- int vector_elements = ir->operands[0]->type->vector_elements;
- if (ir->operands[1]) {
- vector_elements = MAX2(vector_elements,
- ir->operands[1]->type->vector_elements);
- }
-
- this->result.file = PROGRAM_UNDEFINED;
-
- /* Storage for our result. Ideally for an assignment we'd be using
- * the actual storage for the result here, instead.
- */
- result_src = get_temp(ir->type);
- /* convenience for the emit functions below. */
- result_dst = dst_reg(result_src);
- /* Limit writes to the channels that will be used by result_src later.
- * This does limit this temp's use as a temporary for multi-instruction
- * sequences.
- */
- result_dst.writemask = (1 << ir->type->vector_elements) - 1;
-
- switch (ir->operation) {
- case ir_unop_logic_not:
- emit(ir, OPCODE_SEQ, result_dst, op[0], src_reg_for_float(0.0));
- break;
- case ir_unop_neg:
- op[0].negate = ~op[0].negate;
- result_src = op[0];
- break;
- case ir_unop_abs:
- emit(ir, OPCODE_ABS, result_dst, op[0]);
- break;
- case ir_unop_sign:
- emit(ir, OPCODE_SSG, result_dst, op[0]);
- break;
- case ir_unop_rcp:
- emit_scalar(ir, OPCODE_RCP, result_dst, op[0]);
- break;
-
- case ir_unop_exp2:
- emit_scalar(ir, OPCODE_EX2, result_dst, op[0]);
- break;
- case ir_unop_exp:
- case ir_unop_log:
- assert(!"not reached: should be handled by ir_explog_to_explog2");
- break;
- case ir_unop_log2:
- emit_scalar(ir, OPCODE_LG2, result_dst, op[0]);
- break;
- case ir_unop_sin:
- emit_scalar(ir, OPCODE_SIN, result_dst, op[0]);
- break;
- case ir_unop_cos:
- emit_scalar(ir, OPCODE_COS, result_dst, op[0]);
- break;
- case ir_unop_sin_reduced:
- emit_scs(ir, OPCODE_SIN, result_dst, op[0]);
- break;
- case ir_unop_cos_reduced:
- emit_scs(ir, OPCODE_COS, result_dst, op[0]);
- break;
-
- case ir_unop_dFdx:
- emit(ir, OPCODE_DDX, result_dst, op[0]);
- break;
- case ir_unop_dFdy:
- emit(ir, OPCODE_DDY, result_dst, op[0]);
- break;
-
- case ir_unop_noise: {
- const enum prog_opcode opcode =
- prog_opcode(OPCODE_NOISE1
- + (ir->operands[0]->type->vector_elements) - 1);
- assert((opcode >= OPCODE_NOISE1) && (opcode <= OPCODE_NOISE4));
-
- emit(ir, opcode, result_dst, op[0]);
- break;
- }
-
- case ir_binop_add:
- emit(ir, OPCODE_ADD, result_dst, op[0], op[1]);
- break;
- case ir_binop_sub:
- emit(ir, OPCODE_SUB, result_dst, op[0], op[1]);
- break;
-
- case ir_binop_mul:
- emit(ir, OPCODE_MUL, result_dst, op[0], op[1]);
- break;
- case ir_binop_div:
- assert(!"not reached: should be handled by ir_div_to_mul_rcp");
- case ir_binop_mod:
- assert(!"ir_binop_mod should have been converted to b * fract(a/b)");
- break;
-
- case ir_binop_less:
- emit(ir, OPCODE_SLT, result_dst, op[0], op[1]);
- break;
- case ir_binop_greater:
- emit(ir, OPCODE_SGT, result_dst, op[0], op[1]);
- break;
- case ir_binop_lequal:
- emit(ir, OPCODE_SLE, result_dst, op[0], op[1]);
- break;
- case ir_binop_gequal:
- emit(ir, OPCODE_SGE, result_dst, op[0], op[1]);
- break;
- case ir_binop_equal:
- emit(ir, OPCODE_SEQ, result_dst, op[0], op[1]);
- break;
- case ir_binop_nequal:
- emit(ir, OPCODE_SNE, result_dst, op[0], op[1]);
- break;
- case ir_binop_all_equal:
- /* "==" operator producing a scalar boolean. */
- if (ir->operands[0]->type->is_vector() ||
- ir->operands[1]->type->is_vector()) {
- src_reg temp = get_temp(glsl_type::vec4_type);
- emit(ir, OPCODE_SNE, dst_reg(temp), op[0], op[1]);
- emit_dp(ir, result_dst, temp, temp, vector_elements);
- emit(ir, OPCODE_SEQ, result_dst, result_src, src_reg_for_float(0.0));
- } else {
- emit(ir, OPCODE_SEQ, result_dst, op[0], op[1]);
- }
- break;
- case ir_binop_any_nequal:
- /* "!=" operator producing a scalar boolean. */
- if (ir->operands[0]->type->is_vector() ||
- ir->operands[1]->type->is_vector()) {
- src_reg temp = get_temp(glsl_type::vec4_type);
- emit(ir, OPCODE_SNE, dst_reg(temp), op[0], op[1]);
- emit_dp(ir, result_dst, temp, temp, vector_elements);
- emit(ir, OPCODE_SNE, result_dst, result_src, src_reg_for_float(0.0));
- } else {
- emit(ir, OPCODE_SNE, result_dst, op[0], op[1]);
- }
- break;
-
- case ir_unop_any:
- assert(ir->operands[0]->type->is_vector());
- emit_dp(ir, result_dst, op[0], op[0],
- ir->operands[0]->type->vector_elements);
- emit(ir, OPCODE_SNE, result_dst, result_src, src_reg_for_float(0.0));
- break;
-
- case ir_binop_logic_xor:
- emit(ir, OPCODE_SNE, result_dst, op[0], op[1]);
- break;
-
- case ir_binop_logic_or:
- /* This could be a saturated add and skip the SNE. */
- emit(ir, OPCODE_ADD, result_dst, op[0], op[1]);
- emit(ir, OPCODE_SNE, result_dst, result_src, src_reg_for_float(0.0));
- break;
-
- case ir_binop_logic_and:
- /* the bool args are stored as float 0.0 or 1.0, so "mul" gives us "and". */
- emit(ir, OPCODE_MUL, result_dst, op[0], op[1]);
- break;
-
- case ir_binop_dot:
- assert(ir->operands[0]->type->is_vector());
- assert(ir->operands[0]->type == ir->operands[1]->type);
- emit_dp(ir, result_dst, op[0], op[1],
- ir->operands[0]->type->vector_elements);
- break;
-
- case ir_unop_sqrt:
- /* sqrt(x) = x * rsq(x). */
- emit_scalar(ir, OPCODE_RSQ, result_dst, op[0]);
- emit(ir, OPCODE_MUL, result_dst, result_src, op[0]);
- /* For incoming channels <= 0, set the result to 0. */
- op[0].negate = ~op[0].negate;
- emit(ir, OPCODE_CMP, result_dst,
- op[0], result_src, src_reg_for_float(0.0));
- break;
- case ir_unop_rsq:
- emit_scalar(ir, OPCODE_RSQ, result_dst, op[0]);
- break;
- case ir_unop_i2f:
- case ir_unop_b2f:
- case ir_unop_b2i:
- /* Mesa IR lacks types, ints are stored as truncated floats. */
- result_src = op[0];
- break;
- case ir_unop_f2i:
- emit(ir, OPCODE_TRUNC, result_dst, op[0]);
- break;
- case ir_unop_f2b:
- case ir_unop_i2b:
- emit(ir, OPCODE_SNE, result_dst,
- op[0], src_reg_for_float(0.0));
- break;
- case ir_unop_trunc:
- emit(ir, OPCODE_TRUNC, result_dst, op[0]);
- break;
- case ir_unop_ceil:
- op[0].negate = ~op[0].negate;
- emit(ir, OPCODE_FLR, result_dst, op[0]);
- result_src.negate = ~result_src.negate;
- break;
- case ir_unop_floor:
- emit(ir, OPCODE_FLR, result_dst, op[0]);
- break;
- case ir_unop_fract:
- emit(ir, OPCODE_FRC, result_dst, op[0]);
- break;
-
- case ir_binop_min:
- emit(ir, OPCODE_MIN, result_dst, op[0], op[1]);
- break;
- case ir_binop_max:
- emit(ir, OPCODE_MAX, result_dst, op[0], op[1]);
- break;
- case ir_binop_pow:
- emit_scalar(ir, OPCODE_POW, result_dst, op[0], op[1]);
- break;
-
- case ir_unop_bit_not:
- case ir_unop_u2f:
- case ir_binop_lshift:
- case ir_binop_rshift:
- case ir_binop_bit_and:
- case ir_binop_bit_xor:
- case ir_binop_bit_or:
- case ir_unop_round_even:
- assert(!"GLSL 1.30 features unsupported");
- break;
-
- case ir_quadop_vector:
- /* This operation should have already been handled.
- */
- assert(!"Should not get here.");
- break;
- }
-
- this->result = result_src;
-}
-
-
-void
-ir_to_mesa_visitor::visit(ir_swizzle *ir)
-{
- src_reg src;
- int i;
- int swizzle[4];
-
- /* Note that this is only swizzles in expressions, not those on the left
- * hand side of an assignment, which do write masking. See ir_assignment
- * for that.
- */
-
- ir->val->accept(this);
- src = this->result;
- assert(src.file != PROGRAM_UNDEFINED);
-
- for (i = 0; i < 4; i++) {
- if (i < ir->type->vector_elements) {
- switch (i) {
- case 0:
- swizzle[i] = GET_SWZ(src.swizzle, ir->mask.x);
- break;
- case 1:
- swizzle[i] = GET_SWZ(src.swizzle, ir->mask.y);
- break;
- case 2:
- swizzle[i] = GET_SWZ(src.swizzle, ir->mask.z);
- break;
- case 3:
- swizzle[i] = GET_SWZ(src.swizzle, ir->mask.w);
- break;
- }
- } else {
- /* If the type is smaller than a vec4, replicate the last
- * channel out.
- */
- swizzle[i] = swizzle[ir->type->vector_elements - 1];
- }
- }
-
- src.swizzle = MAKE_SWIZZLE4(swizzle[0], swizzle[1], swizzle[2], swizzle[3]);
-
- this->result = src;
-}
-
-void
-ir_to_mesa_visitor::visit(ir_dereference_variable *ir)
-{
- variable_storage *entry = find_variable_storage(ir->var);
- ir_variable *var = ir->var;
-
- if (!entry) {
- switch (var->mode) {
- case ir_var_uniform:
- entry = new(mem_ctx) variable_storage(var, PROGRAM_UNIFORM,
- var->location);
- this->variables.push_tail(entry);
- break;
- case ir_var_in:
- case ir_var_inout:
- /* The linker assigns locations for varyings and attributes,
- * including deprecated builtins (like gl_Color), user-assign
- * generic attributes (glBindVertexLocation), and
- * user-defined varyings.
- *
- * FINISHME: We would hit this path for function arguments. Fix!
- */
- assert(var->location != -1);
- entry = new(mem_ctx) variable_storage(var,
- PROGRAM_INPUT,
- var->location);
- if (this->prog->Target == GL_VERTEX_PROGRAM_ARB &&
- var->location >= VERT_ATTRIB_GENERIC0) {
- _mesa_add_attribute(this->prog->Attributes,
- var->name,
- _mesa_sizeof_glsl_type(var->type->gl_type),
- var->type->gl_type,
- var->location - VERT_ATTRIB_GENERIC0);
- }
- break;
- case ir_var_out:
- assert(var->location != -1);
- entry = new(mem_ctx) variable_storage(var,
- PROGRAM_OUTPUT,
- var->location);
- break;
- case ir_var_system_value:
- entry = new(mem_ctx) variable_storage(var,
- PROGRAM_SYSTEM_VALUE,
- var->location);
- break;
- case ir_var_auto:
- case ir_var_temporary:
- entry = new(mem_ctx) variable_storage(var, PROGRAM_TEMPORARY,
- this->next_temp);
- this->variables.push_tail(entry);
-
- next_temp += type_size(var->type);
- break;
- }
-
- if (!entry) {
- printf("Failed to make storage for %s\n", var->name);
- exit(1);
- }
- }
-
- this->result = src_reg(entry->file, entry->index, var->type);
-}
-
-void
-ir_to_mesa_visitor::visit(ir_dereference_array *ir)
-{
- ir_constant *index;
- src_reg src;
- int element_size = type_size(ir->type);
-
- index = ir->array_index->constant_expression_value();
-
- ir->array->accept(this);
- src = this->result;
-
- if (index) {
- src.index += index->value.i[0] * element_size;
- } else {
- /* Variable index array dereference. It eats the "vec4" of the
- * base of the array and an index that offsets the Mesa register
- * index.
- */
- ir->array_index->accept(this);
-
- src_reg index_reg;
-
- if (element_size == 1) {
- index_reg = this->result;
- } else {
- index_reg = get_temp(glsl_type::float_type);
-
- emit(ir, OPCODE_MUL, dst_reg(index_reg),
- this->result, src_reg_for_float(element_size));
- }
-
- src.reladdr = ralloc(mem_ctx, src_reg);
- memcpy(src.reladdr, &index_reg, sizeof(index_reg));
- }
-
- /* If the type is smaller than a vec4, replicate the last channel out. */
- if (ir->type->is_scalar() || ir->type->is_vector())
- src.swizzle = swizzle_for_size(ir->type->vector_elements);
- else
- src.swizzle = SWIZZLE_NOOP;
-
- this->result = src;
-}
-
-void
-ir_to_mesa_visitor::visit(ir_dereference_record *ir)
-{
- unsigned int i;
- const glsl_type *struct_type = ir->record->type;
- int offset = 0;
-
- ir->record->accept(this);
-
- for (i = 0; i < struct_type->length; i++) {
- if (strcmp(struct_type->fields.structure[i].name, ir->field) == 0)
- break;
- offset += type_size(struct_type->fields.structure[i].type);
- }
-
- /* If the type is smaller than a vec4, replicate the last channel out. */
- if (ir->type->is_scalar() || ir->type->is_vector())
- this->result.swizzle = swizzle_for_size(ir->type->vector_elements);
- else
- this->result.swizzle = SWIZZLE_NOOP;
-
- this->result.index += offset;
-}
-
-/**
- * We want to be careful in assignment setup to hit the actual storage
- * instead of potentially using a temporary like we might with the
- * ir_dereference handler.
- */
-static dst_reg
-get_assignment_lhs(ir_dereference *ir, ir_to_mesa_visitor *v)
-{
- /* The LHS must be a dereference. If the LHS is a variable indexed array
- * access of a vector, it must be separated into a series conditional moves
- * before reaching this point (see ir_vec_index_to_cond_assign).
- */
- assert(ir->as_dereference());
- ir_dereference_array *deref_array = ir->as_dereference_array();
- if (deref_array) {
- assert(!deref_array->array->type->is_vector());
- }
-
- /* Use the rvalue deref handler for the most part. We'll ignore
- * swizzles in it and write swizzles using writemask, though.
- */
- ir->accept(v);
- return dst_reg(v->result);
-}
-
-/**
- * Process the condition of a conditional assignment
- *
- * Examines the condition of a conditional assignment to generate the optimal
- * first operand of a \c CMP instruction. If the condition is a relational
- * operator with 0 (e.g., \c ir_binop_less), the value being compared will be
- * used as the source for the \c CMP instruction. Otherwise the comparison
- * is processed to a boolean result, and the boolean result is used as the
- * operand to the CMP instruction.
- */
-bool
-ir_to_mesa_visitor::process_move_condition(ir_rvalue *ir)
-{
- ir_rvalue *src_ir = ir;
- bool negate = true;
- bool switch_order = false;
-
- ir_expression *const expr = ir->as_expression();
- if ((expr != NULL) && (expr->get_num_operands() == 2)) {
- bool zero_on_left = false;
-
- if (expr->operands[0]->is_zero()) {
- src_ir = expr->operands[1];
- zero_on_left = true;
- } else if (expr->operands[1]->is_zero()) {
- src_ir = expr->operands[0];
- zero_on_left = false;
- }
-
- /* a is - 0 + - 0 +
- * (a < 0) T F F ( a < 0) T F F
- * (0 < a) F F T (-a < 0) F F T
- * (a <= 0) T T F (-a < 0) F F T (swap order of other operands)
- * (0 <= a) F T T ( a < 0) T F F (swap order of other operands)
- * (a > 0) F F T (-a < 0) F F T
- * (0 > a) T F F ( a < 0) T F F
- * (a >= 0) F T T ( a < 0) T F F (swap order of other operands)
- * (0 >= a) T T F (-a < 0) F F T (swap order of other operands)
- *
- * Note that exchanging the order of 0 and 'a' in the comparison simply
- * means that the value of 'a' should be negated.
- */
- if (src_ir != ir) {
- switch (expr->operation) {
- case ir_binop_less:
- switch_order = false;
- negate = zero_on_left;
- break;
-
- case ir_binop_greater:
- switch_order = false;
- negate = !zero_on_left;
- break;
-
- case ir_binop_lequal:
- switch_order = true;
- negate = !zero_on_left;
- break;
-
- case ir_binop_gequal:
- switch_order = true;
- negate = zero_on_left;
- break;
-
- default:
- /* This isn't the right kind of comparison afterall, so make sure
- * the whole condition is visited.
- */
- src_ir = ir;
- break;
- }
- }
- }
-
- src_ir->accept(this);
-
- /* We use the OPCODE_CMP (a < 0 ? b : c) for conditional moves, and the
- * condition we produced is 0.0 or 1.0. By flipping the sign, we can
- * choose which value OPCODE_CMP produces without an extra instruction
- * computing the condition.
- */
- if (negate)
- this->result.negate = ~this->result.negate;
-
- return switch_order;
-}
-
-void
-ir_to_mesa_visitor::visit(ir_assignment *ir)
-{
- dst_reg l;
- src_reg r;
- int i;
-
- ir->rhs->accept(this);
- r = this->result;
-
- l = get_assignment_lhs(ir->lhs, this);
-
- /* FINISHME: This should really set to the correct maximal writemask for each
- * FINISHME: component written (in the loops below). This case can only
- * FINISHME: occur for matrices, arrays, and structures.
- */
- if (ir->write_mask == 0) {
- assert(!ir->lhs->type->is_scalar() && !ir->lhs->type->is_vector());
- l.writemask = WRITEMASK_XYZW;
- } else if (ir->lhs->type->is_scalar()) {
- /* FINISHME: This hack makes writing to gl_FragDepth, which lives in the
- * FINISHME: W component of fragment shader output zero, work correctly.
- */
- l.writemask = WRITEMASK_XYZW;
- } else {
- int swizzles[4];
- int first_enabled_chan = 0;
- int rhs_chan = 0;
-
- assert(ir->lhs->type->is_vector());
- l.writemask = ir->write_mask;
-
- for (int i = 0; i < 4; i++) {
- if (l.writemask & (1 << i)) {
- first_enabled_chan = GET_SWZ(r.swizzle, i);
- break;
- }
- }
-
- /* Swizzle a small RHS vector into the channels being written.
- *
- * glsl ir treats write_mask as dictating how many channels are
- * present on the RHS while Mesa IR treats write_mask as just
- * showing which channels of the vec4 RHS get written.
- */
- for (int i = 0; i < 4; i++) {
- if (l.writemask & (1 << i))
- swizzles[i] = GET_SWZ(r.swizzle, rhs_chan++);
- else
- swizzles[i] = first_enabled_chan;
- }
- r.swizzle = MAKE_SWIZZLE4(swizzles[0], swizzles[1],
- swizzles[2], swizzles[3]);
- }
-
- assert(l.file != PROGRAM_UNDEFINED);
- assert(r.file != PROGRAM_UNDEFINED);
-
- if (ir->condition) {
- const bool switch_order = this->process_move_condition(ir->condition);
- src_reg condition = this->result;
-
- for (i = 0; i < type_size(ir->lhs->type); i++) {
- if (switch_order) {
- emit(ir, OPCODE_CMP, l, condition, src_reg(l), r);
- } else {
- emit(ir, OPCODE_CMP, l, condition, r, src_reg(l));
- }
-
- l.index++;
- r.index++;
- }
- } else {
- for (i = 0; i < type_size(ir->lhs->type); i++) {
- emit(ir, OPCODE_MOV, l, r);
- l.index++;
- r.index++;
- }
- }
-}
-
-
-void
-ir_to_mesa_visitor::visit(ir_constant *ir)
-{
- src_reg src;
- GLfloat stack_vals[4] = { 0 };
- GLfloat *values = stack_vals;
- unsigned int i;
-
- /* Unfortunately, 4 floats is all we can get into
- * _mesa_add_unnamed_constant. So, make a temp to store an
- * aggregate constant and move each constant value into it. If we
- * get lucky, copy propagation will eliminate the extra moves.
- */
-
- if (ir->type->base_type == GLSL_TYPE_STRUCT) {
- src_reg temp_base = get_temp(ir->type);
- dst_reg temp = dst_reg(temp_base);
-
- foreach_iter(exec_list_iterator, iter, ir->components) {
- ir_constant *field_value = (ir_constant *)iter.get();
- int size = type_size(field_value->type);
-
- assert(size > 0);
-
- field_value->accept(this);
- src = this->result;
-
- for (i = 0; i < (unsigned int)size; i++) {
- emit(ir, OPCODE_MOV, temp, src);
-
- src.index++;
- temp.index++;
- }
- }
- this->result = temp_base;
- return;
- }
-
- if (ir->type->is_array()) {
- src_reg temp_base = get_temp(ir->type);
- dst_reg temp = dst_reg(temp_base);
- int size = type_size(ir->type->fields.array);
-
- assert(size > 0);
-
- for (i = 0; i < ir->type->length; i++) {
- ir->array_elements[i]->accept(this);
- src = this->result;
- for (int j = 0; j < size; j++) {
- emit(ir, OPCODE_MOV, temp, src);
-
- src.index++;
- temp.index++;
- }
- }
- this->result = temp_base;
- return;
- }
-
- if (ir->type->is_matrix()) {
- src_reg mat = get_temp(ir->type);
- dst_reg mat_column = dst_reg(mat);
-
- for (i = 0; i < ir->type->matrix_columns; i++) {
- assert(ir->type->base_type == GLSL_TYPE_FLOAT);
- values = &ir->value.f[i * ir->type->vector_elements];
-
- src = src_reg(PROGRAM_CONSTANT, -1, NULL);
- src.index = _mesa_add_unnamed_constant(this->prog->Parameters,
- values,
- ir->type->vector_elements,
- &src.swizzle);
- emit(ir, OPCODE_MOV, mat_column, src);
-
- mat_column.index++;
- }
-
- this->result = mat;
- return;
- }
-
- src.file = PROGRAM_CONSTANT;
- switch (ir->type->base_type) {
- case GLSL_TYPE_FLOAT:
- values = &ir->value.f[0];
- break;
- case GLSL_TYPE_UINT:
- for (i = 0; i < ir->type->vector_elements; i++) {
- values[i] = ir->value.u[i];
- }
- break;
- case GLSL_TYPE_INT:
- for (i = 0; i < ir->type->vector_elements; i++) {
- values[i] = ir->value.i[i];
- }
- break;
- case GLSL_TYPE_BOOL:
- for (i = 0; i < ir->type->vector_elements; i++) {
- values[i] = ir->value.b[i];
- }
- break;
- default:
- assert(!"Non-float/uint/int/bool constant");
- }
-
- this->result = src_reg(PROGRAM_CONSTANT, -1, ir->type);
- this->result.index = _mesa_add_unnamed_constant(this->prog->Parameters,
- values,
- ir->type->vector_elements,
- &this->result.swizzle);
-}
-
-function_entry *
-ir_to_mesa_visitor::get_function_signature(ir_function_signature *sig)
-{
- function_entry *entry;
-
- foreach_iter(exec_list_iterator, iter, this->function_signatures) {
- entry = (function_entry *)iter.get();
-
- if (entry->sig == sig)
- return entry;
- }
-
- entry = ralloc(mem_ctx, function_entry);
- entry->sig = sig;
- entry->sig_id = this->next_signature_id++;
- entry->bgn_inst = NULL;
-
- /* Allocate storage for all the parameters. */
- foreach_iter(exec_list_iterator, iter, sig->parameters) {
- ir_variable *param = (ir_variable *)iter.get();
- variable_storage *storage;
-
- storage = find_variable_storage(param);
- assert(!storage);
-
- storage = new(mem_ctx) variable_storage(param, PROGRAM_TEMPORARY,
- this->next_temp);
- this->variables.push_tail(storage);
-
- this->next_temp += type_size(param->type);
- }
-
- if (!sig->return_type->is_void()) {
- entry->return_reg = get_temp(sig->return_type);
- } else {
- entry->return_reg = undef_src;
- }
-
- this->function_signatures.push_tail(entry);
- return entry;
-}
-
-void
-ir_to_mesa_visitor::visit(ir_call *ir)
-{
- ir_to_mesa_instruction *call_inst;
- ir_function_signature *sig = ir->get_callee();
- function_entry *entry = get_function_signature(sig);
- int i;
-
- /* Process in parameters. */
- exec_list_iterator sig_iter = sig->parameters.iterator();
- foreach_iter(exec_list_iterator, iter, *ir) {
- ir_rvalue *param_rval = (ir_rvalue *)iter.get();
- ir_variable *param = (ir_variable *)sig_iter.get();
-
- if (param->mode == ir_var_in ||
- param->mode == ir_var_inout) {
- variable_storage *storage = find_variable_storage(param);
- assert(storage);
-
- param_rval->accept(this);
- src_reg r = this->result;
-
- dst_reg l;
- l.file = storage->file;
- l.index = storage->index;
- l.reladdr = NULL;
- l.writemask = WRITEMASK_XYZW;
- l.cond_mask = COND_TR;
-
- for (i = 0; i < type_size(param->type); i++) {
- emit(ir, OPCODE_MOV, l, r);
- l.index++;
- r.index++;
- }
- }
-
- sig_iter.next();
- }
- assert(!sig_iter.has_next());
-
- /* Emit call instruction */
- call_inst = emit(ir, OPCODE_CAL);
- call_inst->function = entry;
-
- /* Process out parameters. */
- sig_iter = sig->parameters.iterator();
- foreach_iter(exec_list_iterator, iter, *ir) {
- ir_rvalue *param_rval = (ir_rvalue *)iter.get();
- ir_variable *param = (ir_variable *)sig_iter.get();
-
- if (param->mode == ir_var_out ||
- param->mode == ir_var_inout) {
- variable_storage *storage = find_variable_storage(param);
- assert(storage);
-
- src_reg r;
- r.file = storage->file;
- r.index = storage->index;
- r.reladdr = NULL;
- r.swizzle = SWIZZLE_NOOP;
- r.negate = 0;
-
- param_rval->accept(this);
- dst_reg l = dst_reg(this->result);
-
- for (i = 0; i < type_size(param->type); i++) {
- emit(ir, OPCODE_MOV, l, r);
- l.index++;
- r.index++;
- }
- }
-
- sig_iter.next();
- }
- assert(!sig_iter.has_next());
-
- /* Process return value. */
- this->result = entry->return_reg;
-}
-
-void
-ir_to_mesa_visitor::visit(ir_texture *ir)
-{
- src_reg result_src, coord, lod_info, projector, dx, dy;
- dst_reg result_dst, coord_dst;
- ir_to_mesa_instruction *inst = NULL;
- prog_opcode opcode = OPCODE_NOP;
-
- ir->coordinate->accept(this);
-
- /* Put our coords in a temp. We'll need to modify them for shadow,
- * projection, or LOD, so the only case we'd use it as is is if
- * we're doing plain old texturing. Mesa IR optimization should
- * handle cleaning up our mess in that case.
- */
- coord = get_temp(glsl_type::vec4_type);
- coord_dst = dst_reg(coord);
- emit(ir, OPCODE_MOV, coord_dst, this->result);
-
- if (ir->projector) {
- ir->projector->accept(this);
- projector = this->result;
- }
-
- /* Storage for our result. Ideally for an assignment we'd be using
- * the actual storage for the result here, instead.
- */
- result_src = get_temp(glsl_type::vec4_type);
- result_dst = dst_reg(result_src);
-
- switch (ir->op) {
- case ir_tex:
- opcode = OPCODE_TEX;
- break;
- case ir_txb:
- opcode = OPCODE_TXB;
- ir->lod_info.bias->accept(this);
- lod_info = this->result;
- break;
- case ir_txl:
- opcode = OPCODE_TXL;
- ir->lod_info.lod->accept(this);
- lod_info = this->result;
- break;
- case ir_txd:
- opcode = OPCODE_TXD;
- ir->lod_info.grad.dPdx->accept(this);
- dx = this->result;
- ir->lod_info.grad.dPdy->accept(this);
- dy = this->result;
- break;
- case ir_txf:
- assert(!"GLSL 1.30 features unsupported");
- break;
- }
-
- if (ir->projector) {
- if (opcode == OPCODE_TEX) {
- /* Slot the projector in as the last component of the coord. */
- coord_dst.writemask = WRITEMASK_W;
- emit(ir, OPCODE_MOV, coord_dst, projector);
- coord_dst.writemask = WRITEMASK_XYZW;
- opcode = OPCODE_TXP;
- } else {
- src_reg coord_w = coord;
- coord_w.swizzle = SWIZZLE_WWWW;
-
- /* For the other TEX opcodes there's no projective version
- * since the last slot is taken up by lod info. Do the
- * projective divide now.
- */
- coord_dst.writemask = WRITEMASK_W;
- emit(ir, OPCODE_RCP, coord_dst, projector);
-
- /* In the case where we have to project the coordinates "by hand,"
- * the shadow comparitor value must also be projected.
- */
- src_reg tmp_src = coord;
- if (ir->shadow_comparitor) {
- /* Slot the shadow value in as the second to last component of the
- * coord.
- */
- ir->shadow_comparitor->accept(this);
-
- tmp_src = get_temp(glsl_type::vec4_type);
- dst_reg tmp_dst = dst_reg(tmp_src);
-
- tmp_dst.writemask = WRITEMASK_Z;
- emit(ir, OPCODE_MOV, tmp_dst, this->result);
-
- tmp_dst.writemask = WRITEMASK_XY;
- emit(ir, OPCODE_MOV, tmp_dst, coord);
- }
-
- coord_dst.writemask = WRITEMASK_XYZ;
- emit(ir, OPCODE_MUL, coord_dst, tmp_src, coord_w);
-
- coord_dst.writemask = WRITEMASK_XYZW;
- coord.swizzle = SWIZZLE_XYZW;
- }
- }
-
- /* If projection is done and the opcode is not OPCODE_TXP, then the shadow
- * comparitor was put in the correct place (and projected) by the code,
- * above, that handles by-hand projection.
- */
- if (ir->shadow_comparitor && (!ir->projector || opcode == OPCODE_TXP)) {
- /* Slot the shadow value in as the second to last component of the
- * coord.
- */
- ir->shadow_comparitor->accept(this);
- coord_dst.writemask = WRITEMASK_Z;
- emit(ir, OPCODE_MOV, coord_dst, this->result);
- coord_dst.writemask = WRITEMASK_XYZW;
- }
-
- if (opcode == OPCODE_TXL || opcode == OPCODE_TXB) {
- /* Mesa IR stores lod or lod bias in the last channel of the coords. */
- coord_dst.writemask = WRITEMASK_W;
- emit(ir, OPCODE_MOV, coord_dst, lod_info);
- coord_dst.writemask = WRITEMASK_XYZW;
- }
-
- if (opcode == OPCODE_TXD)
- inst = emit(ir, opcode, result_dst, coord, dx, dy);
- else
- inst = emit(ir, opcode, result_dst, coord);
-
- if (ir->shadow_comparitor)
- inst->tex_shadow = GL_TRUE;
-
- inst->sampler = _mesa_get_sampler_uniform_value(ir->sampler,
- this->shader_program,
- this->prog);
-
- const glsl_type *sampler_type = ir->sampler->type;
-
- switch (sampler_type->sampler_dimensionality) {
- case GLSL_SAMPLER_DIM_1D:
- inst->tex_target = (sampler_type->sampler_array)
- ? TEXTURE_1D_ARRAY_INDEX : TEXTURE_1D_INDEX;
- break;
- case GLSL_SAMPLER_DIM_2D:
- inst->tex_target = (sampler_type->sampler_array)
- ? TEXTURE_2D_ARRAY_INDEX : TEXTURE_2D_INDEX;
- break;
- case GLSL_SAMPLER_DIM_3D:
- inst->tex_target = TEXTURE_3D_INDEX;
- break;
- case GLSL_SAMPLER_DIM_CUBE:
- inst->tex_target = TEXTURE_CUBE_INDEX;
- break;
- case GLSL_SAMPLER_DIM_RECT:
- inst->tex_target = TEXTURE_RECT_INDEX;
- break;
- case GLSL_SAMPLER_DIM_BUF:
- assert(!"FINISHME: Implement ARB_texture_buffer_object");
- break;
- default:
- assert(!"Should not get here.");
- }
-
- this->result = result_src;
-}
-
-void
-ir_to_mesa_visitor::visit(ir_return *ir)
-{
- if (ir->get_value()) {
- dst_reg l;
- int i;
-
- assert(current_function);
-
- ir->get_value()->accept(this);
- src_reg r = this->result;
-
- l = dst_reg(current_function->return_reg);
-
- for (i = 0; i < type_size(current_function->sig->return_type); i++) {
- emit(ir, OPCODE_MOV, l, r);
- l.index++;
- r.index++;
- }
- }
-
- emit(ir, OPCODE_RET);
-}
-
-void
-ir_to_mesa_visitor::visit(ir_discard *ir)
-{
- struct gl_fragment_program *fp = (struct gl_fragment_program *)this->prog;
-
- if (ir->condition) {
- ir->condition->accept(this);
- this->result.negate = ~this->result.negate;
- emit(ir, OPCODE_KIL, undef_dst, this->result);
- } else {
- emit(ir, OPCODE_KIL_NV);
- }
-
- fp->UsesKill = GL_TRUE;
-}
-
-void
-ir_to_mesa_visitor::visit(ir_if *ir)
-{
- ir_to_mesa_instruction *cond_inst, *if_inst;
- ir_to_mesa_instruction *prev_inst;
-
- prev_inst = (ir_to_mesa_instruction *)this->instructions.get_tail();
-
- ir->condition->accept(this);
- assert(this->result.file != PROGRAM_UNDEFINED);
-
- if (this->options->EmitCondCodes) {
- cond_inst = (ir_to_mesa_instruction *)this->instructions.get_tail();
-
- /* See if we actually generated any instruction for generating
- * the condition. If not, then cook up a move to a temp so we
- * have something to set cond_update on.
- */
- if (cond_inst == prev_inst) {
- src_reg temp = get_temp(glsl_type::bool_type);
- cond_inst = emit(ir->condition, OPCODE_MOV, dst_reg(temp), result);
- }
- cond_inst->cond_update = GL_TRUE;
-
- if_inst = emit(ir->condition, OPCODE_IF);
- if_inst->dst.cond_mask = COND_NE;
- } else {
- if_inst = emit(ir->condition, OPCODE_IF, undef_dst, this->result);
- }
-
- this->instructions.push_tail(if_inst);
-
- visit_exec_list(&ir->then_instructions, this);
-
- if (!ir->else_instructions.is_empty()) {
- emit(ir->condition, OPCODE_ELSE);
- visit_exec_list(&ir->else_instructions, this);
- }
-
- if_inst = emit(ir->condition, OPCODE_ENDIF);
-}
-
-ir_to_mesa_visitor::ir_to_mesa_visitor()
-{
- result.file = PROGRAM_UNDEFINED;
- next_temp = 1;
- next_signature_id = 1;
- current_function = NULL;
- mem_ctx = ralloc_context(NULL);
-}
-
-ir_to_mesa_visitor::~ir_to_mesa_visitor()
-{
- ralloc_free(mem_ctx);
-}
-
-static struct prog_src_register
-mesa_src_reg_from_ir_src_reg(src_reg reg)
-{
- struct prog_src_register mesa_reg;
-
- mesa_reg.File = reg.file;
- assert(reg.index < (1 << INST_INDEX_BITS));
- mesa_reg.Index = reg.index;
- mesa_reg.Swizzle = reg.swizzle;
- mesa_reg.RelAddr = reg.reladdr != NULL;
- mesa_reg.Negate = reg.negate;
- mesa_reg.Abs = 0;
- mesa_reg.HasIndex2 = GL_FALSE;
- mesa_reg.RelAddr2 = 0;
- mesa_reg.Index2 = 0;
-
- return mesa_reg;
-}
-
-static void
-set_branchtargets(ir_to_mesa_visitor *v,
- struct prog_instruction *mesa_instructions,
- int num_instructions)
-{
- int if_count = 0, loop_count = 0;
- int *if_stack, *loop_stack;
- int if_stack_pos = 0, loop_stack_pos = 0;
- int i, j;
-
- for (i = 0; i < num_instructions; i++) {
- switch (mesa_instructions[i].Opcode) {
- case OPCODE_IF:
- if_count++;
- break;
- case OPCODE_BGNLOOP:
- loop_count++;
- break;
- case OPCODE_BRK:
- case OPCODE_CONT:
- mesa_instructions[i].BranchTarget = -1;
- break;
- default:
- break;
- }
- }
-
- if_stack = rzalloc_array(v->mem_ctx, int, if_count);
- loop_stack = rzalloc_array(v->mem_ctx, int, loop_count);
-
- for (i = 0; i < num_instructions; i++) {
- switch (mesa_instructions[i].Opcode) {
- case OPCODE_IF:
- if_stack[if_stack_pos] = i;
- if_stack_pos++;
- break;
- case OPCODE_ELSE:
- mesa_instructions[if_stack[if_stack_pos - 1]].BranchTarget = i;
- if_stack[if_stack_pos - 1] = i;
- break;
- case OPCODE_ENDIF:
- mesa_instructions[if_stack[if_stack_pos - 1]].BranchTarget = i;
- if_stack_pos--;
- break;
- case OPCODE_BGNLOOP:
- loop_stack[loop_stack_pos] = i;
- loop_stack_pos++;
- break;
- case OPCODE_ENDLOOP:
- loop_stack_pos--;
- /* Rewrite any breaks/conts at this nesting level (haven't
- * already had a BranchTarget assigned) to point to the end
- * of the loop.
- */
- for (j = loop_stack[loop_stack_pos]; j < i; j++) {
- if (mesa_instructions[j].Opcode == OPCODE_BRK ||
- mesa_instructions[j].Opcode == OPCODE_CONT) {
- if (mesa_instructions[j].BranchTarget == -1) {
- mesa_instructions[j].BranchTarget = i;
- }
- }
- }
- /* The loop ends point at each other. */
- mesa_instructions[i].BranchTarget = loop_stack[loop_stack_pos];
- mesa_instructions[loop_stack[loop_stack_pos]].BranchTarget = i;
- break;
- case OPCODE_CAL:
- foreach_iter(exec_list_iterator, iter, v->function_signatures) {
- function_entry *entry = (function_entry *)iter.get();
-
- if (entry->sig_id == mesa_instructions[i].BranchTarget) {
- mesa_instructions[i].BranchTarget = entry->inst;
- break;
- }
- }
- break;
- default:
- break;
- }
- }
-}
-
-static void
-print_program(struct prog_instruction *mesa_instructions,
- ir_instruction **mesa_instruction_annotation,
- int num_instructions)
-{
- ir_instruction *last_ir = NULL;
- int i;
- int indent = 0;
-
- for (i = 0; i < num_instructions; i++) {
- struct prog_instruction *mesa_inst = mesa_instructions + i;
- ir_instruction *ir = mesa_instruction_annotation[i];
-
- fprintf(stdout, "%3d: ", i);
-
- if (last_ir != ir && ir) {
- int j;
-
- for (j = 0; j < indent; j++) {
- fprintf(stdout, " ");
- }
- ir->print();
- printf("\n");
- last_ir = ir;
-
- fprintf(stdout, " "); /* line number spacing. */
- }
-
- indent = _mesa_fprint_instruction_opt(stdout, mesa_inst, indent,
- PROG_PRINT_DEBUG, NULL);
- }
-}
-
-
-/**
- * Count resources used by the given gpu program (number of texture
- * samplers, etc).
- */
-static void
-count_resources(struct gl_program *prog)
-{
- unsigned int i;
-
- prog->SamplersUsed = 0;
-
- for (i = 0; i < prog->NumInstructions; i++) {
- struct prog_instruction *inst = &prog->Instructions[i];
-
- if (_mesa_is_tex_instruction(inst->Opcode)) {
- prog->SamplerTargets[inst->TexSrcUnit] =
- (gl_texture_index)inst->TexSrcTarget;
- prog->SamplersUsed |= 1 << inst->TexSrcUnit;
- if (inst->TexShadow) {
- prog->ShadowSamplers |= 1 << inst->TexSrcUnit;
- }
- }
- }
-
- _mesa_update_shader_textures_used(prog);
-}
-
-
-/**
- * Check if the given vertex/fragment/shader program is within the
- * resource limits of the context (number of texture units, etc).
- * If any of those checks fail, record a linker error.
- *
- * XXX more checks are needed...
- */
-static void
-check_resources(const struct gl_context *ctx,
- struct gl_shader_program *shader_program,
- struct gl_program *prog)
-{
- switch (prog->Target) {
- case GL_VERTEX_PROGRAM_ARB:
- if (_mesa_bitcount(prog->SamplersUsed) >
- ctx->Const.MaxVertexTextureImageUnits) {
- fail_link(shader_program, "Too many vertex shader texture samplers");
- }
- if (prog->Parameters->NumParameters > MAX_UNIFORMS) {
- fail_link(shader_program, "Too many vertex shader constants");
- }
- break;
- case MESA_GEOMETRY_PROGRAM:
- if (_mesa_bitcount(prog->SamplersUsed) >
- ctx->Const.MaxGeometryTextureImageUnits) {
- fail_link(shader_program, "Too many geometry shader texture samplers");
- }
- if (prog->Parameters->NumParameters >
- MAX_GEOMETRY_UNIFORM_COMPONENTS / 4) {
- fail_link(shader_program, "Too many geometry shader constants");
- }
- break;
- case GL_FRAGMENT_PROGRAM_ARB:
- if (_mesa_bitcount(prog->SamplersUsed) >
- ctx->Const.MaxTextureImageUnits) {
- fail_link(shader_program, "Too many fragment shader texture samplers");
- }
- if (prog->Parameters->NumParameters > MAX_UNIFORMS) {
- fail_link(shader_program, "Too many fragment shader constants");
- }
- break;
- default:
- _mesa_problem(ctx, "unexpected program type in check_resources()");
- }
-}
-
-
-
-struct uniform_sort {
- struct gl_uniform *u;
- int pos;
-};
-
-/* The shader_program->Uniforms list is almost sorted in increasing
- * uniform->{Frag,Vert}Pos locations, but not quite when there are
- * uniforms shared between targets. We need to add parameters in
- * increasing order for the targets.
- */
-static int
-sort_uniforms(const void *a, const void *b)
-{
- struct uniform_sort *u1 = (struct uniform_sort *)a;
- struct uniform_sort *u2 = (struct uniform_sort *)b;
-
- return u1->pos - u2->pos;
-}
-
-/* Add the uniforms to the parameters. The linker chose locations
- * in our parameters lists (which weren't created yet), which the
- * uniforms code will use to poke values into our parameters list
- * when uniforms are updated.
- */
-static void
-add_uniforms_to_parameters_list(struct gl_shader_program *shader_program,
- struct gl_shader *shader,
- struct gl_program *prog)
-{
- unsigned int i;
- unsigned int next_sampler = 0, num_uniforms = 0;
- struct uniform_sort *sorted_uniforms;
-
- sorted_uniforms = ralloc_array(NULL, struct uniform_sort,
- shader_program->Uniforms->NumUniforms);
-
- for (i = 0; i < shader_program->Uniforms->NumUniforms; i++) {
- struct gl_uniform *uniform = shader_program->Uniforms->Uniforms + i;
- int parameter_index = -1;
-
- switch (shader->Type) {
- case GL_VERTEX_SHADER:
- parameter_index = uniform->VertPos;
- break;
- case GL_FRAGMENT_SHADER:
- parameter_index = uniform->FragPos;
- break;
- case GL_GEOMETRY_SHADER:
- parameter_index = uniform->GeomPos;
- break;
- }
-
- /* Only add uniforms used in our target. */
- if (parameter_index != -1) {
- sorted_uniforms[num_uniforms].pos = parameter_index;
- sorted_uniforms[num_uniforms].u = uniform;
- num_uniforms++;
- }
- }
-
- qsort(sorted_uniforms, num_uniforms, sizeof(struct uniform_sort),
- sort_uniforms);
-
- for (i = 0; i < num_uniforms; i++) {
- struct gl_uniform *uniform = sorted_uniforms[i].u;
- int parameter_index = sorted_uniforms[i].pos;
- const glsl_type *type = uniform->Type;
- unsigned int size;
-
- if (type->is_vector() ||
- type->is_scalar()) {
- size = type->vector_elements;
- } else {
- size = type_size(type) * 4;
- }
-
- gl_register_file file;
- if (type->is_sampler() ||
- (type->is_array() && type->fields.array->is_sampler())) {
- file = PROGRAM_SAMPLER;
- } else {
- file = PROGRAM_UNIFORM;
- }
-
- GLint index = _mesa_lookup_parameter_index(prog->Parameters, -1,
- uniform->Name);
-
- if (index < 0) {
- index = _mesa_add_parameter(prog->Parameters, file,
- uniform->Name, size, type->gl_type,
- NULL, NULL, 0x0);
-
- /* Sampler uniform values are stored in prog->SamplerUnits,
- * and the entry in that array is selected by this index we
- * store in ParameterValues[].
- */
- if (file == PROGRAM_SAMPLER) {
- for (unsigned int j = 0; j < size / 4; j++)
- prog->Parameters->ParameterValues[index + j][0] = next_sampler++;
- }
-
- /* The location chosen in the Parameters list here (returned
- * from _mesa_add_uniform) has to match what the linker chose.
- */
- if (index != parameter_index) {
- fail_link(shader_program, "Allocation of uniform `%s' to target "
- "failed (%d vs %d)\n",
- uniform->Name, index, parameter_index);
- }
- }
- }
-
- ralloc_free(sorted_uniforms);
-}
-
-static void
-set_uniform_initializer(struct gl_context *ctx, void *mem_ctx,
- struct gl_shader_program *shader_program,
- const char *name, const glsl_type *type,
- ir_constant *val)
-{
- if (type->is_record()) {
- ir_constant *field_constant;
-
- field_constant = (ir_constant *)val->components.get_head();
-
- for (unsigned int i = 0; i < type->length; i++) {
- const glsl_type *field_type = type->fields.structure[i].type;
- const char *field_name = ralloc_asprintf(mem_ctx, "%s.%s", name,
- type->fields.structure[i].name);
- set_uniform_initializer(ctx, mem_ctx, shader_program, field_name,
- field_type, field_constant);
- field_constant = (ir_constant *)field_constant->next;
- }
- return;
- }
-
- int loc = _mesa_get_uniform_location(ctx, shader_program, name);
-
- if (loc == -1) {
- fail_link(shader_program,
- "Couldn't find uniform for initializer %s\n", name);
- return;
- }
-
- for (unsigned int i = 0; i < (type->is_array() ? type->length : 1); i++) {
- ir_constant *element;
- const glsl_type *element_type;
- if (type->is_array()) {
- element = val->array_elements[i];
- element_type = type->fields.array;
- } else {
- element = val;
- element_type = type;
- }
-
- void *values;
-
- if (element_type->base_type == GLSL_TYPE_BOOL) {
- int *conv = ralloc_array(mem_ctx, int, element_type->components());
- for (unsigned int j = 0; j < element_type->components(); j++) {
- conv[j] = element->value.b[j];
- }
- values = (void *)conv;
- element_type = glsl_type::get_instance(GLSL_TYPE_INT,
- element_type->vector_elements,
- 1);
- } else {
- values = &element->value;
- }
-
- if (element_type->is_matrix()) {
- _mesa_uniform_matrix(ctx, shader_program,
- element_type->matrix_columns,
- element_type->vector_elements,
- loc, 1, GL_FALSE, (GLfloat *)values);
- loc += element_type->matrix_columns;
- } else {
- _mesa_uniform(ctx, shader_program, loc, element_type->matrix_columns,
- values, element_type->gl_type);
- loc += type_size(element_type);
- }
- }
-}
-
-static void
-set_uniform_initializers(struct gl_context *ctx,
- struct gl_shader_program *shader_program)
-{
- void *mem_ctx = NULL;
-
- for (unsigned int i = 0; i < MESA_SHADER_TYPES; i++) {
- struct gl_shader *shader = shader_program->_LinkedShaders[i];
-
- if (shader == NULL)
- continue;
-
- foreach_iter(exec_list_iterator, iter, *shader->ir) {
- ir_instruction *ir = (ir_instruction *)iter.get();
- ir_variable *var = ir->as_variable();
-
- if (!var || var->mode != ir_var_uniform || !var->constant_value)
- continue;
-
- if (!mem_ctx)
- mem_ctx = ralloc_context(NULL);
-
- set_uniform_initializer(ctx, mem_ctx, shader_program, var->name,
- var->type, var->constant_value);
- }
- }
-
- ralloc_free(mem_ctx);
-}
-
-/*
- * On a basic block basis, tracks available PROGRAM_TEMPORARY register
- * channels for copy propagation and updates following instructions to
- * use the original versions.
- *
- * The ir_to_mesa_visitor lazily produces code assuming that this pass
- * will occur. As an example, a TXP production before this pass:
- *
- * 0: MOV TEMP[1], INPUT[4].xyyy;
- * 1: MOV TEMP[1].w, INPUT[4].wwww;
- * 2: TXP TEMP[2], TEMP[1], texture[0], 2D;
- *
- * and after:
- *
- * 0: MOV TEMP[1], INPUT[4].xyyy;
- * 1: MOV TEMP[1].w, INPUT[4].wwww;
- * 2: TXP TEMP[2], INPUT[4].xyyw, texture[0], 2D;
- *
- * which allows for dead code elimination on TEMP[1]'s writes.
- */
-void
-ir_to_mesa_visitor::copy_propagate(void)
-{
- ir_to_mesa_instruction **acp = rzalloc_array(mem_ctx,
- ir_to_mesa_instruction *,
- this->next_temp * 4);
- int *acp_level = rzalloc_array(mem_ctx, int, this->next_temp * 4);
- int level = 0;
-
- foreach_iter(exec_list_iterator, iter, this->instructions) {
- ir_to_mesa_instruction *inst = (ir_to_mesa_instruction *)iter.get();
-
- assert(inst->dst.file != PROGRAM_TEMPORARY
- || inst->dst.index < this->next_temp);
-
- /* First, do any copy propagation possible into the src regs. */
- for (int r = 0; r < 3; r++) {
- ir_to_mesa_instruction *first = NULL;
- bool good = true;
- int acp_base = inst->src[r].index * 4;
-
- if (inst->src[r].file != PROGRAM_TEMPORARY ||
- inst->src[r].reladdr)
- continue;
-
- /* See if we can find entries in the ACP consisting of MOVs
- * from the same src register for all the swizzled channels
- * of this src register reference.
- */
- for (int i = 0; i < 4; i++) {
- int src_chan = GET_SWZ(inst->src[r].swizzle, i);
- ir_to_mesa_instruction *copy_chan = acp[acp_base + src_chan];
-
- if (!copy_chan) {
- good = false;
- break;
- }
-
- assert(acp_level[acp_base + src_chan] <= level);
-
- if (!first) {
- first = copy_chan;
- } else {
- if (first->src[0].file != copy_chan->src[0].file ||
- first->src[0].index != copy_chan->src[0].index) {
- good = false;
- break;
- }
- }
- }
-
- if (good) {
- /* We've now validated that we can copy-propagate to
- * replace this src register reference. Do it.
- */
- inst->src[r].file = first->src[0].file;
- inst->src[r].index = first->src[0].index;
-
- int swizzle = 0;
- for (int i = 0; i < 4; i++) {
- int src_chan = GET_SWZ(inst->src[r].swizzle, i);
- ir_to_mesa_instruction *copy_inst = acp[acp_base + src_chan];
- swizzle |= (GET_SWZ(copy_inst->src[0].swizzle, src_chan) <<
- (3 * i));
- }
- inst->src[r].swizzle = swizzle;
- }
- }
-
- switch (inst->op) {
- case OPCODE_BGNLOOP:
- case OPCODE_ENDLOOP:
- /* End of a basic block, clear the ACP entirely. */
- memset(acp, 0, sizeof(*acp) * this->next_temp * 4);
- break;
-
- case OPCODE_IF:
- ++level;
- break;
-
- case OPCODE_ENDIF:
- case OPCODE_ELSE:
- /* Clear all channels written inside the block from the ACP, but
- * leaving those that were not touched.
- */
- for (int r = 0; r < this->next_temp; r++) {
- for (int c = 0; c < 4; c++) {
- if (!acp[4 * r + c])
- continue;
-
- if (acp_level[4 * r + c] >= level)
- acp[4 * r + c] = NULL;
- }
- }
- if (inst->op == OPCODE_ENDIF)
- --level;
- break;
-
- default:
- /* Continuing the block, clear any written channels from
- * the ACP.
- */
- if (inst->dst.file == PROGRAM_TEMPORARY && inst->dst.reladdr) {
- /* Any temporary might be written, so no copy propagation
- * across this instruction.
- */
- memset(acp, 0, sizeof(*acp) * this->next_temp * 4);
- } else if (inst->dst.file == PROGRAM_OUTPUT &&
- inst->dst.reladdr) {
- /* Any output might be written, so no copy propagation
- * from outputs across this instruction.
- */
- for (int r = 0; r < this->next_temp; r++) {
- for (int c = 0; c < 4; c++) {
- if (!acp[4 * r + c])
- continue;
-
- if (acp[4 * r + c]->src[0].file == PROGRAM_OUTPUT)
- acp[4 * r + c] = NULL;
- }
- }
- } else if (inst->dst.file == PROGRAM_TEMPORARY ||
- inst->dst.file == PROGRAM_OUTPUT) {
- /* Clear where it's used as dst. */
- if (inst->dst.file == PROGRAM_TEMPORARY) {
- for (int c = 0; c < 4; c++) {
- if (inst->dst.writemask & (1 << c)) {
- acp[4 * inst->dst.index + c] = NULL;
- }
- }
- }
-
- /* Clear where it's used as src. */
- for (int r = 0; r < this->next_temp; r++) {
- for (int c = 0; c < 4; c++) {
- if (!acp[4 * r + c])
- continue;
-
- int src_chan = GET_SWZ(acp[4 * r + c]->src[0].swizzle, c);
-
- if (acp[4 * r + c]->src[0].file == inst->dst.file &&
- acp[4 * r + c]->src[0].index == inst->dst.index &&
- inst->dst.writemask & (1 << src_chan))
- {
- acp[4 * r + c] = NULL;
- }
- }
- }
- }
- break;
- }
-
- /* If this is a copy, add it to the ACP. */
- if (inst->op == OPCODE_MOV &&
- inst->dst.file == PROGRAM_TEMPORARY &&
- !inst->dst.reladdr &&
- !inst->saturate &&
- !inst->src[0].reladdr &&
- !inst->src[0].negate) {
- for (int i = 0; i < 4; i++) {
- if (inst->dst.writemask & (1 << i)) {
- acp[4 * inst->dst.index + i] = inst;
- acp_level[4 * inst->dst.index + i] = level;
- }
- }
- }
- }
-
- ralloc_free(acp_level);
- ralloc_free(acp);
-}
-
-
-/**
- * Convert a shader's GLSL IR into a Mesa gl_program.
- */
-static struct gl_program *
-get_mesa_program(struct gl_context *ctx,
- struct gl_shader_program *shader_program,
- struct gl_shader *shader)
-{
- ir_to_mesa_visitor v;
- struct prog_instruction *mesa_instructions, *mesa_inst;
- ir_instruction **mesa_instruction_annotation;
- int i;
- struct gl_program *prog;
- GLenum target;
- const char *target_string;
- GLboolean progress;
- struct gl_shader_compiler_options *options =
- &ctx->ShaderCompilerOptions[_mesa_shader_type_to_index(shader->Type)];
-
- switch (shader->Type) {
- case GL_VERTEX_SHADER:
- target = GL_VERTEX_PROGRAM_ARB;
- target_string = "vertex";
- break;
- case GL_FRAGMENT_SHADER:
- target = GL_FRAGMENT_PROGRAM_ARB;
- target_string = "fragment";
- break;
- case GL_GEOMETRY_SHADER:
- target = GL_GEOMETRY_PROGRAM_NV;
- target_string = "geometry";
- break;
- default:
- assert(!"should not be reached");
- return NULL;
- }
-
- validate_ir_tree(shader->ir);
-
- prog = ctx->Driver.NewProgram(ctx, target, shader_program->Name);
- if (!prog)
- return NULL;
- prog->Parameters = _mesa_new_parameter_list();
- prog->Varying = _mesa_new_parameter_list();
- prog->Attributes = _mesa_new_parameter_list();
- v.ctx = ctx;
- v.prog = prog;
- v.shader_program = shader_program;
- v.options = options;
-
- add_uniforms_to_parameters_list(shader_program, shader, prog);
-
- /* Emit Mesa IR for main(). */
- visit_exec_list(shader->ir, &v);
- v.emit(NULL, OPCODE_END);
-
- /* Now emit bodies for any functions that were used. */
- do {
- progress = GL_FALSE;
-
- foreach_iter(exec_list_iterator, iter, v.function_signatures) {
- function_entry *entry = (function_entry *)iter.get();
-
- if (!entry->bgn_inst) {
- v.current_function = entry;
-
- entry->bgn_inst = v.emit(NULL, OPCODE_BGNSUB);
- entry->bgn_inst->function = entry;
-
- visit_exec_list(&entry->sig->body, &v);
-
- ir_to_mesa_instruction *last;
- last = (ir_to_mesa_instruction *)v.instructions.get_tail();
- if (last->op != OPCODE_RET)
- v.emit(NULL, OPCODE_RET);
-
- ir_to_mesa_instruction *end;
- end = v.emit(NULL, OPCODE_ENDSUB);
- end->function = entry;
-
- progress = GL_TRUE;
- }
- }
- } while (progress);
-
- prog->NumTemporaries = v.next_temp;
-
- int num_instructions = 0;
- foreach_iter(exec_list_iterator, iter, v.instructions) {
- num_instructions++;
- }
-
- mesa_instructions =
- (struct prog_instruction *)calloc(num_instructions,
- sizeof(*mesa_instructions));
- mesa_instruction_annotation = ralloc_array(v.mem_ctx, ir_instruction *,
- num_instructions);
-
- v.copy_propagate();
-
- /* Convert ir_mesa_instructions into prog_instructions.
- */
- mesa_inst = mesa_instructions;
- i = 0;
- foreach_iter(exec_list_iterator, iter, v.instructions) {
- const ir_to_mesa_instruction *inst = (ir_to_mesa_instruction *)iter.get();
-
- mesa_inst->Opcode = inst->op;
- mesa_inst->CondUpdate = inst->cond_update;
- if (inst->saturate)
- mesa_inst->SaturateMode = SATURATE_ZERO_ONE;
- mesa_inst->DstReg.File = inst->dst.file;
- mesa_inst->DstReg.Index = inst->dst.index;
- mesa_inst->DstReg.CondMask = inst->dst.cond_mask;
- mesa_inst->DstReg.WriteMask = inst->dst.writemask;
- mesa_inst->DstReg.RelAddr = inst->dst.reladdr != NULL;
- mesa_inst->SrcReg[0] = mesa_src_reg_from_ir_src_reg(inst->src[0]);
- mesa_inst->SrcReg[1] = mesa_src_reg_from_ir_src_reg(inst->src[1]);
- mesa_inst->SrcReg[2] = mesa_src_reg_from_ir_src_reg(inst->src[2]);
- mesa_inst->TexSrcUnit = inst->sampler;
- mesa_inst->TexSrcTarget = inst->tex_target;
- mesa_inst->TexShadow = inst->tex_shadow;
- mesa_instruction_annotation[i] = inst->ir;
-
- /* Set IndirectRegisterFiles. */
- if (mesa_inst->DstReg.RelAddr)
- prog->IndirectRegisterFiles |= 1 << mesa_inst->DstReg.File;
-
- /* Update program's bitmask of indirectly accessed register files */
- for (unsigned src = 0; src < 3; src++)
- if (mesa_inst->SrcReg[src].RelAddr)
- prog->IndirectRegisterFiles |= 1 << mesa_inst->SrcReg[src].File;
-
- if (options->EmitNoIfs && mesa_inst->Opcode == OPCODE_IF) {
- fail_link(shader_program, "Couldn't flatten if statement\n");
- }
-
- switch (mesa_inst->Opcode) {
- case OPCODE_BGNSUB:
- inst->function->inst = i;
- mesa_inst->Comment = strdup(inst->function->sig->function_name());
- break;
- case OPCODE_ENDSUB:
- mesa_inst->Comment = strdup(inst->function->sig->function_name());
- break;
- case OPCODE_CAL:
- mesa_inst->BranchTarget = inst->function->sig_id; /* rewritten later */
- break;
- case OPCODE_ARL:
- prog->NumAddressRegs = 1;
- break;
- default:
- break;
- }
-
- mesa_inst++;
- i++;
-
- if (!shader_program->LinkStatus)
- break;
- }
-
- if (!shader_program->LinkStatus) {
- free(mesa_instructions);
- _mesa_reference_program(ctx, &shader->Program, NULL);
- return NULL;
- }
-
- set_branchtargets(&v, mesa_instructions, num_instructions);
-
- if (ctx->Shader.Flags & GLSL_DUMP) {
- printf("\n");
- printf("GLSL IR for linked %s program %d:\n", target_string,
- shader_program->Name);
- _mesa_print_ir(shader->ir, NULL);
- printf("\n");
- printf("\n");
- printf("Mesa IR for linked %s program %d:\n", target_string,
- shader_program->Name);
- print_program(mesa_instructions, mesa_instruction_annotation,
- num_instructions);
- }
-
- prog->Instructions = mesa_instructions;
- prog->NumInstructions = num_instructions;
-
- do_set_program_inouts(shader->ir, prog);
- count_resources(prog);
-
- check_resources(ctx, shader_program, prog);
-
- _mesa_reference_program(ctx, &shader->Program, prog);
-
- if ((ctx->Shader.Flags & GLSL_NO_OPT) == 0) {
- _mesa_optimize_program(ctx, prog);
- }
-
- return prog;
-}
-
-extern "C" {
-
-/**
- * Link a shader.
- * Called via ctx->Driver.LinkShader()
- * This actually involves converting GLSL IR into Mesa gl_programs with
- * code lowering and other optimizations.
- */
-GLboolean
-_mesa_ir_link_shader(struct gl_context *ctx, struct gl_shader_program *prog)
-{
- assert(prog->LinkStatus);
-
- for (unsigned i = 0; i < MESA_SHADER_TYPES; i++) {
- if (prog->_LinkedShaders[i] == NULL)
- continue;
-
- bool progress;
- exec_list *ir = prog->_LinkedShaders[i]->ir;
- const struct gl_shader_compiler_options *options =
- &ctx->ShaderCompilerOptions[_mesa_shader_type_to_index(prog->_LinkedShaders[i]->Type)];
-
- do {
- progress = false;
-
- /* Lowering */
- do_mat_op_to_vec(ir);
- lower_instructions(ir, (MOD_TO_FRACT | DIV_TO_MUL_RCP | EXP_TO_EXP2
- | LOG_TO_LOG2
- | ((options->EmitNoPow) ? POW_TO_EXP2 : 0)));
-
- progress = do_lower_jumps(ir, true, true, options->EmitNoMainReturn, options->EmitNoCont, options->EmitNoLoops) || progress;
-
- progress = do_common_optimization(ir, true, options->MaxUnrollIterations) || progress;
-
- progress = lower_quadop_vector(ir, true) || progress;
-
- if (options->EmitNoIfs) {
- progress = lower_discard(ir) || progress;
- progress = lower_if_to_cond_assign(ir) || progress;
- }
-
- if (options->EmitNoNoise)
- progress = lower_noise(ir) || progress;
-
- /* If there are forms of indirect addressing that the driver
- * cannot handle, perform the lowering pass.
- */
- if (options->EmitNoIndirectInput || options->EmitNoIndirectOutput
- || options->EmitNoIndirectTemp || options->EmitNoIndirectUniform)
- progress =
- lower_variable_index_to_cond_assign(ir,
- options->EmitNoIndirectInput,
- options->EmitNoIndirectOutput,
- options->EmitNoIndirectTemp,
- options->EmitNoIndirectUniform)
- || progress;
-
- progress = do_vec_index_to_cond_assign(ir) || progress;
- } while (progress);
-
- validate_ir_tree(ir);
- }
-
- for (unsigned i = 0; i < MESA_SHADER_TYPES; i++) {
- struct gl_program *linked_prog;
-
- if (prog->_LinkedShaders[i] == NULL)
- continue;
-
- linked_prog = get_mesa_program(ctx, prog, prog->_LinkedShaders[i]);
-
- if (linked_prog) {
- bool ok = true;
-
- switch (prog->_LinkedShaders[i]->Type) {
- case GL_VERTEX_SHADER:
- _mesa_reference_vertprog(ctx, &prog->VertexProgram,
- (struct gl_vertex_program *)linked_prog);
- ok = ctx->Driver.ProgramStringNotify(ctx, GL_VERTEX_PROGRAM_ARB,
- linked_prog);
- break;
- case GL_FRAGMENT_SHADER:
- _mesa_reference_fragprog(ctx, &prog->FragmentProgram,
- (struct gl_fragment_program *)linked_prog);
- ok = ctx->Driver.ProgramStringNotify(ctx, GL_FRAGMENT_PROGRAM_ARB,
- linked_prog);
- break;
- case GL_GEOMETRY_SHADER:
- _mesa_reference_geomprog(ctx, &prog->GeometryProgram,
- (struct gl_geometry_program *)linked_prog);
- ok = ctx->Driver.ProgramStringNotify(ctx, GL_GEOMETRY_PROGRAM_NV,
- linked_prog);
- break;
- }
- if (!ok) {
- return GL_FALSE;
- }
- }
-
- _mesa_reference_program(ctx, &linked_prog, NULL);
- }
-
- return GL_TRUE;
-}
-
-
-/**
- * Compile a GLSL shader. Called via glCompileShader().
- */
-void
-_mesa_glsl_compile_shader(struct gl_context *ctx, struct gl_shader *shader)
-{
- struct _mesa_glsl_parse_state *state =
- new(shader) _mesa_glsl_parse_state(ctx, shader->Type, shader);
-
- const char *source = shader->Source;
- /* Check if the user called glCompileShader without first calling
- * glShaderSource. This should fail to compile, but not raise a GL_ERROR.
- */
- if (source == NULL) {
- shader->CompileStatus = GL_FALSE;
- return;
- }
-
- state->error = preprocess(state, &source, &state->info_log,
- &ctx->Extensions, ctx->API);
-
- if (ctx->Shader.Flags & GLSL_DUMP) {
- printf("GLSL source for shader %d:\n", shader->Name);
- printf("%s\n", shader->Source);
- }
-
- if (!state->error) {
- _mesa_glsl_lexer_ctor(state, source);
- _mesa_glsl_parse(state);
- _mesa_glsl_lexer_dtor(state);
- }
-
- ralloc_free(shader->ir);
- shader->ir = new(shader) exec_list;
- if (!state->error && !state->translation_unit.is_empty())
- _mesa_ast_to_hir(shader->ir, state);
-
- if (!state->error && !shader->ir->is_empty()) {
- validate_ir_tree(shader->ir);
-
- /* Do some optimization at compile time to reduce shader IR size
- * and reduce later work if the same shader is linked multiple times
- */
- while (do_common_optimization(shader->ir, false, 32))
- ;
-
- validate_ir_tree(shader->ir);
- }
-
- shader->symbols = state->symbols;
-
- shader->CompileStatus = !state->error;
- shader->InfoLog = state->info_log;
- shader->Version = state->language_version;
- memcpy(shader->builtins_to_link, state->builtins_to_link,
- sizeof(shader->builtins_to_link[0]) * state->num_builtins_to_link);
- shader->num_builtins_to_link = state->num_builtins_to_link;
-
- if (ctx->Shader.Flags & GLSL_LOG) {
- _mesa_write_shader_to_file(shader);
- }
-
- if (ctx->Shader.Flags & GLSL_DUMP) {
- if (shader->CompileStatus) {
- printf("GLSL IR for shader %d:\n", shader->Name);
- _mesa_print_ir(shader->ir, NULL);
- printf("\n\n");
- } else {
- printf("GLSL shader %d failed to compile.\n", shader->Name);
- }
- if (shader->InfoLog && shader->InfoLog[0] != 0) {
- printf("GLSL shader %d info log:\n", shader->Name);
- printf("%s\n", shader->InfoLog);
- }
- }
-
- /* Retain any live IR, but trash the rest. */
- reparent_ir(shader->ir, shader->ir);
-
- ralloc_free(state);
-}
-
-
-/**
- * Link a GLSL shader program. Called via glLinkProgram().
- */
-void
-_mesa_glsl_link_shader(struct gl_context *ctx, struct gl_shader_program *prog)
-{
- unsigned int i;
-
- _mesa_clear_shader_program_data(ctx, prog);
-
- prog->LinkStatus = GL_TRUE;
-
- for (i = 0; i < prog->NumShaders; i++) {
- if (!prog->Shaders[i]->CompileStatus) {
- fail_link(prog, "linking with uncompiled shader");
- prog->LinkStatus = GL_FALSE;
- }
- }
-
- prog->Varying = _mesa_new_parameter_list();
- _mesa_reference_vertprog(ctx, &prog->VertexProgram, NULL);
- _mesa_reference_fragprog(ctx, &prog->FragmentProgram, NULL);
- _mesa_reference_geomprog(ctx, &prog->GeometryProgram, NULL);
-
- if (prog->LinkStatus) {
- link_shaders(ctx, prog);
- }
-
- if (prog->LinkStatus) {
- if (!ctx->Driver.LinkShader(ctx, prog)) {
- prog->LinkStatus = GL_FALSE;
- }
- }
-
- set_uniform_initializers(ctx, prog);
-
- if (ctx->Shader.Flags & GLSL_DUMP) {
- if (!prog->LinkStatus) {
- printf("GLSL shader program %d failed to link\n", prog->Name);
- }
-
- if (prog->InfoLog && prog->InfoLog[0] != 0) {
- printf("GLSL shader program %d info log:\n", prog->Name);
- printf("%s\n", prog->InfoLog);
- }
- }
-}
-
-} /* extern "C" */
+/*
+ * Copyright (C) 2005-2007 Brian Paul All Rights Reserved.
+ * Copyright (C) 2008 VMware, Inc. All Rights Reserved.
+ * Copyright © 2010 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+/**
+ * \file ir_to_mesa.cpp
+ *
+ * Translate GLSL IR to Mesa's gl_program representation.
+ */
+
+#include <stdio.h>
+#include "main/compiler.h"
+#include "ir.h"
+#include "ir_visitor.h"
+#include "ir_print_visitor.h"
+#include "ir_expression_flattening.h"
+#include "glsl_types.h"
+#include "glsl_parser_extras.h"
+#include "../glsl/program.h"
+#include "ir_optimization.h"
+#include "ast.h"
+
+extern "C" {
+#include "main/mtypes.h"
+#include "main/shaderapi.h"
+#include "main/shaderobj.h"
+#include "main/uniforms.h"
+#include "program/hash_table.h"
+#include "program/prog_instruction.h"
+#include "program/prog_optimize.h"
+#include "program/prog_print.h"
+#include "program/program.h"
+#include "program/prog_uniform.h"
+#include "program/prog_parameter.h"
+#include "program/sampler.h"
+}
+
+class src_reg;
+class dst_reg;
+
+static int swizzle_for_size(int size);
+
+/**
+ * This struct is a corresponding struct to Mesa prog_src_register, with
+ * wider fields.
+ */
+class src_reg {
+public:
+ src_reg(gl_register_file file, int index, const glsl_type *type)
+ {
+ this->file = file;
+ this->index = index;
+ if (type && (type->is_scalar() || type->is_vector() || type->is_matrix()))
+ this->swizzle = swizzle_for_size(type->vector_elements);
+ else
+ this->swizzle = SWIZZLE_XYZW;
+ this->negate = 0;
+ this->reladdr = NULL;
+ }
+
+ src_reg()
+ {
+ this->file = PROGRAM_UNDEFINED;
+ this->index = 0;
+ this->swizzle = 0;
+ this->negate = 0;
+ this->reladdr = NULL;
+ }
+
+ explicit src_reg(dst_reg reg);
+
+ gl_register_file file; /**< PROGRAM_* from Mesa */
+ int index; /**< temporary index, VERT_ATTRIB_*, FRAG_ATTRIB_*, etc. */
+ GLuint swizzle; /**< SWIZZLE_XYZWONEZERO swizzles from Mesa. */
+ int negate; /**< NEGATE_XYZW mask from mesa */
+ /** Register index should be offset by the integer in this reg. */
+ src_reg *reladdr;
+};
+
+class dst_reg {
+public:
+ dst_reg(gl_register_file file, int writemask)
+ {
+ this->file = file;
+ this->index = 0;
+ this->writemask = writemask;
+ this->cond_mask = COND_TR;
+ this->reladdr = NULL;
+ }
+
+ dst_reg()
+ {
+ this->file = PROGRAM_UNDEFINED;
+ this->index = 0;
+ this->writemask = 0;
+ this->cond_mask = COND_TR;
+ this->reladdr = NULL;
+ }
+
+ explicit dst_reg(src_reg reg);
+
+ gl_register_file file; /**< PROGRAM_* from Mesa */
+ int index; /**< temporary index, VERT_ATTRIB_*, FRAG_ATTRIB_*, etc. */
+ int writemask; /**< Bitfield of WRITEMASK_[XYZW] */
+ GLuint cond_mask:4;
+ /** Register index should be offset by the integer in this reg. */
+ src_reg *reladdr;
+};
+
+src_reg::src_reg(dst_reg reg)
+{
+ this->file = reg.file;
+ this->index = reg.index;
+ this->swizzle = SWIZZLE_XYZW;
+ this->negate = 0;
+ this->reladdr = NULL;
+}
+
+dst_reg::dst_reg(src_reg reg)
+{
+ this->file = reg.file;
+ this->index = reg.index;
+ this->writemask = WRITEMASK_XYZW;
+ this->cond_mask = COND_TR;
+ this->reladdr = reg.reladdr;
+}
+
+class ir_to_mesa_instruction : public exec_node {
+public:
+ /* Callers of this ralloc-based new need not call delete. It's
+ * easier to just ralloc_free 'ctx' (or any of its ancestors). */
+ static void* operator new(size_t size, void *ctx)
+ {
+ void *node;
+
+ node = rzalloc_size(ctx, size);
+ assert(node != NULL);
+
+ return node;
+ }
+
+ enum prog_opcode op;
+ dst_reg dst;
+ src_reg src[3];
+ /** Pointer to the ir source this tree came from for debugging */
+ ir_instruction *ir;
+ GLboolean cond_update;
+ bool saturate;
+ int sampler; /**< sampler index */
+ int tex_target; /**< One of TEXTURE_*_INDEX */
+ GLboolean tex_shadow;
+
+ class function_entry *function; /* Set on OPCODE_CAL or OPCODE_BGNSUB */
+};
+
+class variable_storage : public exec_node {
+public:
+ variable_storage(ir_variable *var, gl_register_file file, int index)
+ : file(file), index(index), var(var)
+ {
+ /* empty */
+ }
+
+ gl_register_file file;
+ int index;
+ ir_variable *var; /* variable that maps to this, if any */
+};
+
+class function_entry : public exec_node {
+public:
+ ir_function_signature *sig;
+
+ /**
+ * identifier of this function signature used by the program.
+ *
+ * At the point that Mesa instructions for function calls are
+ * generated, we don't know the address of the first instruction of
+ * the function body. So we make the BranchTarget that is called a
+ * small integer and rewrite them during set_branchtargets().
+ */
+ int sig_id;
+
+ /**
+ * Pointer to first instruction of the function body.
+ *
+ * Set during function body emits after main() is processed.
+ */
+ ir_to_mesa_instruction *bgn_inst;
+
+ /**
+ * Index of the first instruction of the function body in actual
+ * Mesa IR.
+ *
+ * Set after convertion from ir_to_mesa_instruction to prog_instruction.
+ */
+ int inst;
+
+ /** Storage for the return value. */
+ src_reg return_reg;
+};
+
+class ir_to_mesa_visitor : public ir_visitor {
+public:
+ ir_to_mesa_visitor();
+ ~ir_to_mesa_visitor();
+
+ function_entry *current_function;
+
+ struct gl_context *ctx;
+ struct gl_program *prog;
+ struct gl_shader_program *shader_program;
+ struct gl_shader_compiler_options *options;
+
+ int next_temp;
+
+ variable_storage *find_variable_storage(ir_variable *var);
+
+ function_entry *get_function_signature(ir_function_signature *sig);
+
+ src_reg get_temp(const glsl_type *type);
+ void reladdr_to_temp(ir_instruction *ir, src_reg *reg, int *num_reladdr);
+
+ src_reg src_reg_for_float(float val);
+
+ /**
+ * \name Visit methods
+ *
+ * As typical for the visitor pattern, there must be one \c visit method for
+ * each concrete subclass of \c ir_instruction. Virtual base classes within
+ * the hierarchy should not have \c visit methods.
+ */
+ /*@{*/
+ virtual void visit(ir_variable *);
+ virtual void visit(ir_loop *);
+ virtual void visit(ir_loop_jump *);
+ virtual void visit(ir_function_signature *);
+ virtual void visit(ir_function *);
+ virtual void visit(ir_expression *);
+ virtual void visit(ir_swizzle *);
+ virtual void visit(ir_dereference_variable *);
+ virtual void visit(ir_dereference_array *);
+ virtual void visit(ir_dereference_record *);
+ virtual void visit(ir_assignment *);
+ virtual void visit(ir_constant *);
+ virtual void visit(ir_call *);
+ virtual void visit(ir_return *);
+ virtual void visit(ir_discard *);
+ virtual void visit(ir_texture *);
+ virtual void visit(ir_if *);
+ /*@}*/
+
+ src_reg result;
+
+ /** List of variable_storage */
+ exec_list variables;
+
+ /** List of function_entry */
+ exec_list function_signatures;
+ int next_signature_id;
+
+ /** List of ir_to_mesa_instruction */
+ exec_list instructions;
+
+ ir_to_mesa_instruction *emit(ir_instruction *ir, enum prog_opcode op);
+
+ ir_to_mesa_instruction *emit(ir_instruction *ir, enum prog_opcode op,
+ dst_reg dst, src_reg src0);
+
+ ir_to_mesa_instruction *emit(ir_instruction *ir, enum prog_opcode op,
+ dst_reg dst, src_reg src0, src_reg src1);
+
+ ir_to_mesa_instruction *emit(ir_instruction *ir, enum prog_opcode op,
+ dst_reg dst,
+ src_reg src0, src_reg src1, src_reg src2);
+
+ /**
+ * Emit the correct dot-product instruction for the type of arguments
+ */
+ void emit_dp(ir_instruction *ir,
+ dst_reg dst,
+ src_reg src0,
+ src_reg src1,
+ unsigned elements);
+
+ void emit_scalar(ir_instruction *ir, enum prog_opcode op,
+ dst_reg dst, src_reg src0);
+
+ void emit_scalar(ir_instruction *ir, enum prog_opcode op,
+ dst_reg dst, src_reg src0, src_reg src1);
+
+ void emit_scs(ir_instruction *ir, enum prog_opcode op,
+ dst_reg dst, const src_reg &src);
+
+ GLboolean try_emit_mad(ir_expression *ir,
+ int mul_operand);
+ GLboolean try_emit_sat(ir_expression *ir);
+
+ void emit_swz(ir_expression *ir);
+
+ bool process_move_condition(ir_rvalue *ir);
+
+ void copy_propagate(void);
+
+ void *mem_ctx;
+};
+
+src_reg undef_src = src_reg(PROGRAM_UNDEFINED, 0, NULL);
+
+dst_reg undef_dst = dst_reg(PROGRAM_UNDEFINED, SWIZZLE_NOOP);
+
+dst_reg address_reg = dst_reg(PROGRAM_ADDRESS, WRITEMASK_X);
+
+static void
+fail_link(struct gl_shader_program *prog, const char *fmt, ...) PRINTFLIKE(2, 3);
+
+static void
+fail_link(struct gl_shader_program *prog, const char *fmt, ...)
+{
+ va_list args;
+ va_start(args, fmt);
+ ralloc_vasprintf_append(&prog->InfoLog, fmt, args);
+ va_end(args);
+
+ prog->LinkStatus = GL_FALSE;
+}
+
+static int
+swizzle_for_size(int size)
+{
+ int size_swizzles[4] = {
+ MAKE_SWIZZLE4(SWIZZLE_X, SWIZZLE_X, SWIZZLE_X, SWIZZLE_X),
+ MAKE_SWIZZLE4(SWIZZLE_X, SWIZZLE_Y, SWIZZLE_Y, SWIZZLE_Y),
+ MAKE_SWIZZLE4(SWIZZLE_X, SWIZZLE_Y, SWIZZLE_Z, SWIZZLE_Z),
+ MAKE_SWIZZLE4(SWIZZLE_X, SWIZZLE_Y, SWIZZLE_Z, SWIZZLE_W),
+ };
+
+ assert((size >= 1) && (size <= 4));
+ return size_swizzles[size - 1];
+}
+
+ir_to_mesa_instruction *
+ir_to_mesa_visitor::emit(ir_instruction *ir, enum prog_opcode op,
+ dst_reg dst,
+ src_reg src0, src_reg src1, src_reg src2)
+{
+ ir_to_mesa_instruction *inst = new(mem_ctx) ir_to_mesa_instruction();
+ int num_reladdr = 0;
+
+ /* If we have to do relative addressing, we want to load the ARL
+ * reg directly for one of the regs, and preload the other reladdr
+ * sources into temps.
+ */
+ num_reladdr += dst.reladdr != NULL;
+ num_reladdr += src0.reladdr != NULL;
+ num_reladdr += src1.reladdr != NULL;
+ num_reladdr += src2.reladdr != NULL;
+
+ reladdr_to_temp(ir, &src2, &num_reladdr);
+ reladdr_to_temp(ir, &src1, &num_reladdr);
+ reladdr_to_temp(ir, &src0, &num_reladdr);
+
+ if (dst.reladdr) {
+ emit(ir, OPCODE_ARL, address_reg, *dst.reladdr);
+ num_reladdr--;
+ }
+ assert(num_reladdr == 0);
+
+ inst->op = op;
+ inst->dst = dst;
+ inst->src[0] = src0;
+ inst->src[1] = src1;
+ inst->src[2] = src2;
+ inst->ir = ir;
+
+ inst->function = NULL;
+
+ this->instructions.push_tail(inst);
+
+ return inst;
+}
+
+
+ir_to_mesa_instruction *
+ir_to_mesa_visitor::emit(ir_instruction *ir, enum prog_opcode op,
+ dst_reg dst, src_reg src0, src_reg src1)
+{
+ return emit(ir, op, dst, src0, src1, undef_src);
+}
+
+ir_to_mesa_instruction *
+ir_to_mesa_visitor::emit(ir_instruction *ir, enum prog_opcode op,
+ dst_reg dst, src_reg src0)
+{
+ assert(dst.writemask != 0);
+ return emit(ir, op, dst, src0, undef_src, undef_src);
+}
+
+ir_to_mesa_instruction *
+ir_to_mesa_visitor::emit(ir_instruction *ir, enum prog_opcode op)
+{
+ return emit(ir, op, undef_dst, undef_src, undef_src, undef_src);
+}
+
+void
+ir_to_mesa_visitor::emit_dp(ir_instruction *ir,
+ dst_reg dst, src_reg src0, src_reg src1,
+ unsigned elements)
+{
+ static const gl_inst_opcode dot_opcodes[] = {
+ OPCODE_DP2, OPCODE_DP3, OPCODE_DP4
+ };
+
+ emit(ir, dot_opcodes[elements - 2], dst, src0, src1);
+}
+
+/**
+ * Emits Mesa scalar opcodes to produce unique answers across channels.
+ *
+ * Some Mesa opcodes are scalar-only, like ARB_fp/vp. The src X
+ * channel determines the result across all channels. So to do a vec4
+ * of this operation, we want to emit a scalar per source channel used
+ * to produce dest channels.
+ */
+void
+ir_to_mesa_visitor::emit_scalar(ir_instruction *ir, enum prog_opcode op,
+ dst_reg dst,
+ src_reg orig_src0, src_reg orig_src1)
+{
+ int i, j;
+ int done_mask = ~dst.writemask;
+
+ /* Mesa RCP is a scalar operation splatting results to all channels,
+ * like ARB_fp/vp. So emit as many RCPs as necessary to cover our
+ * dst channels.
+ */
+ for (i = 0; i < 4; i++) {
+ GLuint this_mask = (1 << i);
+ ir_to_mesa_instruction *inst;
+ src_reg src0 = orig_src0;
+ src_reg src1 = orig_src1;
+
+ if (done_mask & this_mask)
+ continue;
+
+ GLuint src0_swiz = GET_SWZ(src0.swizzle, i);
+ GLuint src1_swiz = GET_SWZ(src1.swizzle, i);
+ for (j = i + 1; j < 4; j++) {
+ /* If there is another enabled component in the destination that is
+ * derived from the same inputs, generate its value on this pass as
+ * well.
+ */
+ if (!(done_mask & (1 << j)) &&
+ GET_SWZ(src0.swizzle, j) == src0_swiz &&
+ GET_SWZ(src1.swizzle, j) == src1_swiz) {
+ this_mask |= (1 << j);
+ }
+ }
+ src0.swizzle = MAKE_SWIZZLE4(src0_swiz, src0_swiz,
+ src0_swiz, src0_swiz);
+ src1.swizzle = MAKE_SWIZZLE4(src1_swiz, src1_swiz,
+ src1_swiz, src1_swiz);
+
+ inst = emit(ir, op, dst, src0, src1);
+ inst->dst.writemask = this_mask;
+ done_mask |= this_mask;
+ }
+}
+
+void
+ir_to_mesa_visitor::emit_scalar(ir_instruction *ir, enum prog_opcode op,
+ dst_reg dst, src_reg src0)
+{
+ src_reg undef = undef_src;
+
+ undef.swizzle = SWIZZLE_XXXX;
+
+ emit_scalar(ir, op, dst, src0, undef);
+}
+
+/**
+ * Emit an OPCODE_SCS instruction
+ *
+ * The \c SCS opcode functions a bit differently than the other Mesa (or
+ * ARB_fragment_program) opcodes. Instead of splatting its result across all
+ * four components of the destination, it writes one value to the \c x
+ * component and another value to the \c y component.
+ *
+ * \param ir IR instruction being processed
+ * \param op Either \c OPCODE_SIN or \c OPCODE_COS depending on which
+ * value is desired.
+ * \param dst Destination register
+ * \param src Source register
+ */
+void
+ir_to_mesa_visitor::emit_scs(ir_instruction *ir, enum prog_opcode op,
+ dst_reg dst,
+ const src_reg &src)
+{
+ /* Vertex programs cannot use the SCS opcode.
+ */
+ if (this->prog->Target == GL_VERTEX_PROGRAM_ARB) {
+ emit_scalar(ir, op, dst, src);
+ return;
+ }
+
+ const unsigned component = (op == OPCODE_SIN) ? 0 : 1;
+ const unsigned scs_mask = (1U << component);
+ int done_mask = ~dst.writemask;
+ src_reg tmp;
+
+ assert(op == OPCODE_SIN || op == OPCODE_COS);
+
+ /* If there are compnents in the destination that differ from the component
+ * that will be written by the SCS instrution, we'll need a temporary.
+ */
+ if (scs_mask != unsigned(dst.writemask)) {
+ tmp = get_temp(glsl_type::vec4_type);
+ }
+
+ for (unsigned i = 0; i < 4; i++) {
+ unsigned this_mask = (1U << i);
+ src_reg src0 = src;
+
+ if ((done_mask & this_mask) != 0)
+ continue;
+
+ /* The source swizzle specified which component of the source generates
+ * sine / cosine for the current component in the destination. The SCS
+ * instruction requires that this value be swizzle to the X component.
+ * Replace the current swizzle with a swizzle that puts the source in
+ * the X component.
+ */
+ unsigned src0_swiz = GET_SWZ(src.swizzle, i);
+
+ src0.swizzle = MAKE_SWIZZLE4(src0_swiz, src0_swiz,
+ src0_swiz, src0_swiz);
+ for (unsigned j = i + 1; j < 4; j++) {
+ /* If there is another enabled component in the destination that is
+ * derived from the same inputs, generate its value on this pass as
+ * well.
+ */
+ if (!(done_mask & (1 << j)) &&
+ GET_SWZ(src0.swizzle, j) == src0_swiz) {
+ this_mask |= (1 << j);
+ }
+ }
+
+ if (this_mask != scs_mask) {
+ ir_to_mesa_instruction *inst;
+ dst_reg tmp_dst = dst_reg(tmp);
+
+ /* Emit the SCS instruction.
+ */
+ inst = emit(ir, OPCODE_SCS, tmp_dst, src0);
+ inst->dst.writemask = scs_mask;
+
+ /* Move the result of the SCS instruction to the desired location in
+ * the destination.
+ */
+ tmp.swizzle = MAKE_SWIZZLE4(component, component,
+ component, component);
+ inst = emit(ir, OPCODE_SCS, dst, tmp);
+ inst->dst.writemask = this_mask;
+ } else {
+ /* Emit the SCS instruction to write directly to the destination.
+ */
+ ir_to_mesa_instruction *inst = emit(ir, OPCODE_SCS, dst, src0);
+ inst->dst.writemask = scs_mask;
+ }
+
+ done_mask |= this_mask;
+ }
+}
+
+struct src_reg
+ir_to_mesa_visitor::src_reg_for_float(float val)
+{
+ src_reg src(PROGRAM_CONSTANT, -1, NULL);
+
+ src.index = _mesa_add_unnamed_constant(this->prog->Parameters,
+ &val, 1, &src.swizzle);
+
+ return src;
+}
+
+static int
+type_size(const struct glsl_type *type)
+{
+ unsigned int i;
+ int size;
+
+ switch (type->base_type) {
+ case GLSL_TYPE_UINT:
+ case GLSL_TYPE_INT:
+ case GLSL_TYPE_FLOAT:
+ case GLSL_TYPE_BOOL:
+ if (type->is_matrix()) {
+ return type->matrix_columns;
+ } else {
+ /* Regardless of size of vector, it gets a vec4. This is bad
+ * packing for things like floats, but otherwise arrays become a
+ * mess. Hopefully a later pass over the code can pack scalars
+ * down if appropriate.
+ */
+ return 1;
+ }
+ case GLSL_TYPE_ARRAY:
+ assert(type->length > 0);
+ return type_size(type->fields.array) * type->length;
+ case GLSL_TYPE_STRUCT:
+ size = 0;
+ for (i = 0; i < type->length; i++) {
+ size += type_size(type->fields.structure[i].type);
+ }
+ return size;
+ case GLSL_TYPE_SAMPLER:
+ /* Samplers take up one slot in UNIFORMS[], but they're baked in
+ * at link time.
+ */
+ return 1;
+ default:
+ assert(0);
+ return 0;
+ }
+}
+
+/**
+ * In the initial pass of codegen, we assign temporary numbers to
+ * intermediate results. (not SSA -- variable assignments will reuse
+ * storage). Actual register allocation for the Mesa VM occurs in a
+ * pass over the Mesa IR later.
+ */
+src_reg
+ir_to_mesa_visitor::get_temp(const glsl_type *type)
+{
+ src_reg src;
+ int swizzle[4];
+ int i;
+
+ src.file = PROGRAM_TEMPORARY;
+ src.index = next_temp;
+ src.reladdr = NULL;
+ next_temp += type_size(type);
+
+ if (type->is_array() || type->is_record()) {
+ src.swizzle = SWIZZLE_NOOP;
+ } else {
+ for (i = 0; i < type->vector_elements; i++)
+ swizzle[i] = i;
+ for (; i < 4; i++)
+ swizzle[i] = type->vector_elements - 1;
+ src.swizzle = MAKE_SWIZZLE4(swizzle[0], swizzle[1],
+ swizzle[2], swizzle[3]);
+ }
+ src.negate = 0;
+
+ return src;
+}
+
+variable_storage *
+ir_to_mesa_visitor::find_variable_storage(ir_variable *var)
+{
+
+ variable_storage *entry;
+
+ foreach_iter(exec_list_iterator, iter, this->variables) {
+ entry = (variable_storage *)iter.get();
+
+ if (entry->var == var)
+ return entry;
+ }
+
+ return NULL;
+}
+
+void
+ir_to_mesa_visitor::visit(ir_variable *ir)
+{
+ if (strcmp(ir->name, "gl_FragCoord") == 0) {
+ struct gl_fragment_program *fp = (struct gl_fragment_program *)this->prog;
+
+ fp->OriginUpperLeft = ir->origin_upper_left;
+ fp->PixelCenterInteger = ir->pixel_center_integer;
+
+ } else if (strcmp(ir->name, "gl_FragDepth") == 0) {
+ struct gl_fragment_program *fp = (struct gl_fragment_program *)this->prog;
+ switch (ir->depth_layout) {
+ case ir_depth_layout_none:
+ fp->FragDepthLayout = FRAG_DEPTH_LAYOUT_NONE;
+ break;
+ case ir_depth_layout_any:
+ fp->FragDepthLayout = FRAG_DEPTH_LAYOUT_ANY;
+ break;
+ case ir_depth_layout_greater:
+ fp->FragDepthLayout = FRAG_DEPTH_LAYOUT_GREATER;
+ break;
+ case ir_depth_layout_less:
+ fp->FragDepthLayout = FRAG_DEPTH_LAYOUT_LESS;
+ break;
+ case ir_depth_layout_unchanged:
+ fp->FragDepthLayout = FRAG_DEPTH_LAYOUT_UNCHANGED;
+ break;
+ default:
+ assert(0);
+ break;
+ }
+ }
+
+ if (ir->mode == ir_var_uniform && strncmp(ir->name, "gl_", 3) == 0) {
+ unsigned int i;
+ const ir_state_slot *const slots = ir->state_slots;
+ assert(ir->state_slots != NULL);
+
+ /* Check if this statevar's setup in the STATE file exactly
+ * matches how we'll want to reference it as a
+ * struct/array/whatever. If not, then we need to move it into
+ * temporary storage and hope that it'll get copy-propagated
+ * out.
+ */
+ for (i = 0; i < ir->num_state_slots; i++) {
+ if (slots[i].swizzle != SWIZZLE_XYZW) {
+ break;
+ }
+ }
+
+ struct variable_storage *storage;
+ dst_reg dst;
+ if (i == ir->num_state_slots) {
+ /* We'll set the index later. */
+ storage = new(mem_ctx) variable_storage(ir, PROGRAM_STATE_VAR, -1);
+ this->variables.push_tail(storage);
+
+ dst = undef_dst;
+ } else {
+ /* The variable_storage constructor allocates slots based on the size
+ * of the type. However, this had better match the number of state
+ * elements that we're going to copy into the new temporary.
+ */
+ assert((int) ir->num_state_slots == type_size(ir->type));
+
+ storage = new(mem_ctx) variable_storage(ir, PROGRAM_TEMPORARY,
+ this->next_temp);
+ this->variables.push_tail(storage);
+ this->next_temp += type_size(ir->type);
+
+ dst = dst_reg(src_reg(PROGRAM_TEMPORARY, storage->index, NULL));
+ }
+
+
+ for (unsigned int i = 0; i < ir->num_state_slots; i++) {
+ int index = _mesa_add_state_reference(this->prog->Parameters,
+ (gl_state_index *)slots[i].tokens);
+
+ if (storage->file == PROGRAM_STATE_VAR) {
+ if (storage->index == -1) {
+ storage->index = index;
+ } else {
+ assert(index == storage->index + (int)i);
+ }
+ } else {
+ src_reg src(PROGRAM_STATE_VAR, index, NULL);
+ src.swizzle = slots[i].swizzle;
+ emit(ir, OPCODE_MOV, dst, src);
+ /* even a float takes up a whole vec4 reg in a struct/array. */
+ dst.index++;
+ }
+ }
+
+ if (storage->file == PROGRAM_TEMPORARY &&
+ dst.index != storage->index + (int) ir->num_state_slots) {
+ fail_link(this->shader_program,
+ "failed to load builtin uniform `%s' (%d/%d regs loaded)\n",
+ ir->name, dst.index - storage->index,
+ type_size(ir->type));
+ }
+ }
+}
+
+void
+ir_to_mesa_visitor::visit(ir_loop *ir)
+{
+ ir_dereference_variable *counter = NULL;
+
+ if (ir->counter != NULL)
+ counter = new(ir) ir_dereference_variable(ir->counter);
+
+ if (ir->from != NULL) {
+ assert(ir->counter != NULL);
+
+ ir_assignment *a = new(ir) ir_assignment(counter, ir->from, NULL);
+
+ a->accept(this);
+ delete a;
+ }
+
+ emit(NULL, OPCODE_BGNLOOP);
+
+ if (ir->to) {
+ ir_expression *e =
+ new(ir) ir_expression(ir->cmp, glsl_type::bool_type,
+ counter, ir->to);
+ ir_if *if_stmt = new(ir) ir_if(e);
+
+ ir_loop_jump *brk = new(ir) ir_loop_jump(ir_loop_jump::jump_break);
+
+ if_stmt->then_instructions.push_tail(brk);
+
+ if_stmt->accept(this);
+
+ delete if_stmt;
+ delete e;
+ delete brk;
+ }
+
+ visit_exec_list(&ir->body_instructions, this);
+
+ if (ir->increment) {
+ ir_expression *e =
+ new(ir) ir_expression(ir_binop_add, counter->type,
+ counter, ir->increment);
+
+ ir_assignment *a = new(ir) ir_assignment(counter, e, NULL);
+
+ a->accept(this);
+ delete a;
+ delete e;
+ }
+
+ emit(NULL, OPCODE_ENDLOOP);
+}
+
+void
+ir_to_mesa_visitor::visit(ir_loop_jump *ir)
+{
+ switch (ir->mode) {
+ case ir_loop_jump::jump_break:
+ emit(NULL, OPCODE_BRK);
+ break;
+ case ir_loop_jump::jump_continue:
+ emit(NULL, OPCODE_CONT);
+ break;
+ }
+}
+
+
+void
+ir_to_mesa_visitor::visit(ir_function_signature *ir)
+{
+ assert(0);
+ (void)ir;
+}
+
+void
+ir_to_mesa_visitor::visit(ir_function *ir)
+{
+ /* Ignore function bodies other than main() -- we shouldn't see calls to
+ * them since they should all be inlined before we get to ir_to_mesa.
+ */
+ if (strcmp(ir->name, "main") == 0) {
+ const ir_function_signature *sig;
+ exec_list empty;
+
+ sig = ir->matching_signature(&empty);
+
+ assert(sig);
+
+ foreach_iter(exec_list_iterator, iter, sig->body) {
+ ir_instruction *ir = (ir_instruction *)iter.get();
+
+ ir->accept(this);
+ }
+ }
+}
+
+GLboolean
+ir_to_mesa_visitor::try_emit_mad(ir_expression *ir, int mul_operand)
+{
+ int nonmul_operand = 1 - mul_operand;
+ src_reg a, b, c;
+
+ ir_expression *expr = ir->operands[mul_operand]->as_expression();
+ if (!expr || expr->operation != ir_binop_mul)
+ return false;
+
+ expr->operands[0]->accept(this);
+ a = this->result;
+ expr->operands[1]->accept(this);
+ b = this->result;
+ ir->operands[nonmul_operand]->accept(this);
+ c = this->result;
+
+ this->result = get_temp(ir->type);
+ emit(ir, OPCODE_MAD, dst_reg(this->result), a, b, c);
+
+ return true;
+}
+
+GLboolean
+ir_to_mesa_visitor::try_emit_sat(ir_expression *ir)
+{
+ /* Saturates were only introduced to vertex programs in
+ * NV_vertex_program3, so don't give them to drivers in the VP.
+ */
+ if (this->prog->Target == GL_VERTEX_PROGRAM_ARB)
+ return false;
+
+ ir_rvalue *sat_src = ir->as_rvalue_to_saturate();
+ if (!sat_src)
+ return false;
+
+ sat_src->accept(this);
+ src_reg src = this->result;
+
+ this->result = get_temp(ir->type);
+ ir_to_mesa_instruction *inst;
+ inst = emit(ir, OPCODE_MOV, dst_reg(this->result), src);
+ inst->saturate = true;
+
+ return true;
+}
+
+void
+ir_to_mesa_visitor::reladdr_to_temp(ir_instruction *ir,
+ src_reg *reg, int *num_reladdr)
+{
+ if (!reg->reladdr)
+ return;
+
+ emit(ir, OPCODE_ARL, address_reg, *reg->reladdr);
+
+ if (*num_reladdr != 1) {
+ src_reg temp = get_temp(glsl_type::vec4_type);
+
+ emit(ir, OPCODE_MOV, dst_reg(temp), *reg);
+ *reg = temp;
+ }
+
+ (*num_reladdr)--;
+}
+
+void
+ir_to_mesa_visitor::emit_swz(ir_expression *ir)
+{
+ /* Assume that the vector operator is in a form compatible with OPCODE_SWZ.
+ * This means that each of the operands is either an immediate value of -1,
+ * 0, or 1, or is a component from one source register (possibly with
+ * negation).
+ */
+ uint8_t components[4] = { 0 };
+ bool negate[4] = { false };
+ ir_variable *var = NULL;
+
+ for (unsigned i = 0; i < ir->type->vector_elements; i++) {
+ ir_rvalue *op = ir->operands[i];
+
+ assert(op->type->is_scalar());
+
+ while (op != NULL) {
+ switch (op->ir_type) {
+ case ir_type_constant: {
+
+ assert(op->type->is_scalar());
+
+ const ir_constant *const c = op->as_constant();
+ if (c->is_one()) {
+ components[i] = SWIZZLE_ONE;
+ } else if (c->is_zero()) {
+ components[i] = SWIZZLE_ZERO;
+ } else if (c->is_negative_one()) {
+ components[i] = SWIZZLE_ONE;
+ negate[i] = true;
+ } else {
+ assert(!"SWZ constant must be 0.0 or 1.0.");
+ }
+
+ op = NULL;
+ break;
+ }
+
+ case ir_type_dereference_variable: {
+ ir_dereference_variable *const deref =
+ (ir_dereference_variable *) op;
+
+ assert((var == NULL) || (deref->var == var));
+ components[i] = SWIZZLE_X;
+ var = deref->var;
+ op = NULL;
+ break;
+ }
+
+ case ir_type_expression: {
+ ir_expression *const expr = (ir_expression *) op;
+
+ assert(expr->operation == ir_unop_neg);
+ negate[i] = true;
+
+ op = expr->operands[0];
+ break;
+ }
+
+ case ir_type_swizzle: {
+ ir_swizzle *const swiz = (ir_swizzle *) op;
+
+ components[i] = swiz->mask.x;
+ op = swiz->val;
+ break;
+ }
+
+ default:
+ assert(!"Should not get here.");
+ return;
+ }
+ }
+ }
+
+ assert(var != NULL);
+
+ ir_dereference_variable *const deref =
+ new(mem_ctx) ir_dereference_variable(var);
+
+ this->result.file = PROGRAM_UNDEFINED;
+ deref->accept(this);
+ if (this->result.file == PROGRAM_UNDEFINED) {
+ ir_print_visitor v;
+ printf("Failed to get tree for expression operand:\n");
+ deref->accept(&v);
+ exit(1);
+ }
+
+ src_reg src;
+
+ src = this->result;
+ src.swizzle = MAKE_SWIZZLE4(components[0],
+ components[1],
+ components[2],
+ components[3]);
+ src.negate = ((unsigned(negate[0]) << 0)
+ | (unsigned(negate[1]) << 1)
+ | (unsigned(negate[2]) << 2)
+ | (unsigned(negate[3]) << 3));
+
+ /* Storage for our result. Ideally for an assignment we'd be using the
+ * actual storage for the result here, instead.
+ */
+ const src_reg result_src = get_temp(ir->type);
+ dst_reg result_dst = dst_reg(result_src);
+
+ /* Limit writes to the channels that will be used by result_src later.
+ * This does limit this temp's use as a temporary for multi-instruction
+ * sequences.
+ */
+ result_dst.writemask = (1 << ir->type->vector_elements) - 1;
+
+ emit(ir, OPCODE_SWZ, result_dst, src);
+ this->result = result_src;
+}
+
+void
+ir_to_mesa_visitor::visit(ir_expression *ir)
+{
+ unsigned int operand;
+ src_reg op[Elements(ir->operands)];
+ src_reg result_src;
+ dst_reg result_dst;
+
+ /* Quick peephole: Emit OPCODE_MAD(a, b, c) instead of ADD(MUL(a, b), c)
+ */
+ if (ir->operation == ir_binop_add) {
+ if (try_emit_mad(ir, 1))
+ return;
+ if (try_emit_mad(ir, 0))
+ return;
+ }
+ if (try_emit_sat(ir))
+ return;
+
+ if (ir->operation == ir_quadop_vector) {
+ this->emit_swz(ir);
+ return;
+ }
+
+ for (operand = 0; operand < ir->get_num_operands(); operand++) {
+ this->result.file = PROGRAM_UNDEFINED;
+ ir->operands[operand]->accept(this);
+ if (this->result.file == PROGRAM_UNDEFINED) {
+ ir_print_visitor v;
+ printf("Failed to get tree for expression operand:\n");
+ ir->operands[operand]->accept(&v);
+ exit(1);
+ }
+ op[operand] = this->result;
+
+ /* Matrix expression operands should have been broken down to vector
+ * operations already.
+ */
+ assert(!ir->operands[operand]->type->is_matrix());
+ }
+
+ int vector_elements = ir->operands[0]->type->vector_elements;
+ if (ir->operands[1]) {
+ vector_elements = MAX2(vector_elements,
+ ir->operands[1]->type->vector_elements);
+ }
+
+ this->result.file = PROGRAM_UNDEFINED;
+
+ /* Storage for our result. Ideally for an assignment we'd be using
+ * the actual storage for the result here, instead.
+ */
+ result_src = get_temp(ir->type);
+ /* convenience for the emit functions below. */
+ result_dst = dst_reg(result_src);
+ /* Limit writes to the channels that will be used by result_src later.
+ * This does limit this temp's use as a temporary for multi-instruction
+ * sequences.
+ */
+ result_dst.writemask = (1 << ir->type->vector_elements) - 1;
+
+ switch (ir->operation) {
+ case ir_unop_logic_not:
+ emit(ir, OPCODE_SEQ, result_dst, op[0], src_reg_for_float(0.0));
+ break;
+ case ir_unop_neg:
+ op[0].negate = ~op[0].negate;
+ result_src = op[0];
+ break;
+ case ir_unop_abs:
+ emit(ir, OPCODE_ABS, result_dst, op[0]);
+ break;
+ case ir_unop_sign:
+ emit(ir, OPCODE_SSG, result_dst, op[0]);
+ break;
+ case ir_unop_rcp:
+ emit_scalar(ir, OPCODE_RCP, result_dst, op[0]);
+ break;
+
+ case ir_unop_exp2:
+ emit_scalar(ir, OPCODE_EX2, result_dst, op[0]);
+ break;
+ case ir_unop_exp:
+ case ir_unop_log:
+ assert(!"not reached: should be handled by ir_explog_to_explog2");
+ break;
+ case ir_unop_log2:
+ emit_scalar(ir, OPCODE_LG2, result_dst, op[0]);
+ break;
+ case ir_unop_sin:
+ emit_scalar(ir, OPCODE_SIN, result_dst, op[0]);
+ break;
+ case ir_unop_cos:
+ emit_scalar(ir, OPCODE_COS, result_dst, op[0]);
+ break;
+ case ir_unop_sin_reduced:
+ emit_scs(ir, OPCODE_SIN, result_dst, op[0]);
+ break;
+ case ir_unop_cos_reduced:
+ emit_scs(ir, OPCODE_COS, result_dst, op[0]);
+ break;
+
+ case ir_unop_dFdx:
+ emit(ir, OPCODE_DDX, result_dst, op[0]);
+ break;
+ case ir_unop_dFdy:
+ emit(ir, OPCODE_DDY, result_dst, op[0]);
+ break;
+
+ case ir_unop_noise: {
+ const enum prog_opcode opcode =
+ prog_opcode(OPCODE_NOISE1
+ + (ir->operands[0]->type->vector_elements) - 1);
+ assert((opcode >= OPCODE_NOISE1) && (opcode <= OPCODE_NOISE4));
+
+ emit(ir, opcode, result_dst, op[0]);
+ break;
+ }
+
+ case ir_binop_add:
+ emit(ir, OPCODE_ADD, result_dst, op[0], op[1]);
+ break;
+ case ir_binop_sub:
+ emit(ir, OPCODE_SUB, result_dst, op[0], op[1]);
+ break;
+
+ case ir_binop_mul:
+ emit(ir, OPCODE_MUL, result_dst, op[0], op[1]);
+ break;
+ case ir_binop_div:
+ assert(!"not reached: should be handled by ir_div_to_mul_rcp");
+ case ir_binop_mod:
+ assert(!"ir_binop_mod should have been converted to b * fract(a/b)");
+ break;
+
+ case ir_binop_less:
+ emit(ir, OPCODE_SLT, result_dst, op[0], op[1]);
+ break;
+ case ir_binop_greater:
+ emit(ir, OPCODE_SGT, result_dst, op[0], op[1]);
+ break;
+ case ir_binop_lequal:
+ emit(ir, OPCODE_SLE, result_dst, op[0], op[1]);
+ break;
+ case ir_binop_gequal:
+ emit(ir, OPCODE_SGE, result_dst, op[0], op[1]);
+ break;
+ case ir_binop_equal:
+ emit(ir, OPCODE_SEQ, result_dst, op[0], op[1]);
+ break;
+ case ir_binop_nequal:
+ emit(ir, OPCODE_SNE, result_dst, op[0], op[1]);
+ break;
+ case ir_binop_all_equal:
+ /* "==" operator producing a scalar boolean. */
+ if (ir->operands[0]->type->is_vector() ||
+ ir->operands[1]->type->is_vector()) {
+ src_reg temp = get_temp(glsl_type::vec4_type);
+ emit(ir, OPCODE_SNE, dst_reg(temp), op[0], op[1]);
+ emit_dp(ir, result_dst, temp, temp, vector_elements);
+ emit(ir, OPCODE_SEQ, result_dst, result_src, src_reg_for_float(0.0));
+ } else {
+ emit(ir, OPCODE_SEQ, result_dst, op[0], op[1]);
+ }
+ break;
+ case ir_binop_any_nequal:
+ /* "!=" operator producing a scalar boolean. */
+ if (ir->operands[0]->type->is_vector() ||
+ ir->operands[1]->type->is_vector()) {
+ src_reg temp = get_temp(glsl_type::vec4_type);
+ emit(ir, OPCODE_SNE, dst_reg(temp), op[0], op[1]);
+ emit_dp(ir, result_dst, temp, temp, vector_elements);
+ emit(ir, OPCODE_SNE, result_dst, result_src, src_reg_for_float(0.0));
+ } else {
+ emit(ir, OPCODE_SNE, result_dst, op[0], op[1]);
+ }
+ break;
+
+ case ir_unop_any:
+ assert(ir->operands[0]->type->is_vector());
+ emit_dp(ir, result_dst, op[0], op[0],
+ ir->operands[0]->type->vector_elements);
+ emit(ir, OPCODE_SNE, result_dst, result_src, src_reg_for_float(0.0));
+ break;
+
+ case ir_binop_logic_xor:
+ emit(ir, OPCODE_SNE, result_dst, op[0], op[1]);
+ break;
+
+ case ir_binop_logic_or:
+ /* This could be a saturated add and skip the SNE. */
+ emit(ir, OPCODE_ADD, result_dst, op[0], op[1]);
+ emit(ir, OPCODE_SNE, result_dst, result_src, src_reg_for_float(0.0));
+ break;
+
+ case ir_binop_logic_and:
+ /* the bool args are stored as float 0.0 or 1.0, so "mul" gives us "and". */
+ emit(ir, OPCODE_MUL, result_dst, op[0], op[1]);
+ break;
+
+ case ir_binop_dot:
+ assert(ir->operands[0]->type->is_vector());
+ assert(ir->operands[0]->type == ir->operands[1]->type);
+ emit_dp(ir, result_dst, op[0], op[1],
+ ir->operands[0]->type->vector_elements);
+ break;
+
+ case ir_unop_sqrt:
+ /* sqrt(x) = x * rsq(x). */
+ emit_scalar(ir, OPCODE_RSQ, result_dst, op[0]);
+ emit(ir, OPCODE_MUL, result_dst, result_src, op[0]);
+ /* For incoming channels <= 0, set the result to 0. */
+ op[0].negate = ~op[0].negate;
+ emit(ir, OPCODE_CMP, result_dst,
+ op[0], result_src, src_reg_for_float(0.0));
+ break;
+ case ir_unop_rsq:
+ emit_scalar(ir, OPCODE_RSQ, result_dst, op[0]);
+ break;
+ case ir_unop_i2f:
+ case ir_unop_b2f:
+ case ir_unop_b2i:
+ /* Mesa IR lacks types, ints are stored as truncated floats. */
+ result_src = op[0];
+ break;
+ case ir_unop_f2i:
+ emit(ir, OPCODE_TRUNC, result_dst, op[0]);
+ break;
+ case ir_unop_f2b:
+ case ir_unop_i2b:
+ emit(ir, OPCODE_SNE, result_dst,
+ op[0], src_reg_for_float(0.0));
+ break;
+ case ir_unop_trunc:
+ emit(ir, OPCODE_TRUNC, result_dst, op[0]);
+ break;
+ case ir_unop_ceil:
+ op[0].negate = ~op[0].negate;
+ emit(ir, OPCODE_FLR, result_dst, op[0]);
+ result_src.negate = ~result_src.negate;
+ break;
+ case ir_unop_floor:
+ emit(ir, OPCODE_FLR, result_dst, op[0]);
+ break;
+ case ir_unop_fract:
+ emit(ir, OPCODE_FRC, result_dst, op[0]);
+ break;
+
+ case ir_binop_min:
+ emit(ir, OPCODE_MIN, result_dst, op[0], op[1]);
+ break;
+ case ir_binop_max:
+ emit(ir, OPCODE_MAX, result_dst, op[0], op[1]);
+ break;
+ case ir_binop_pow:
+ emit_scalar(ir, OPCODE_POW, result_dst, op[0], op[1]);
+ break;
+
+ case ir_unop_bit_not:
+ case ir_unop_u2f:
+ case ir_binop_lshift:
+ case ir_binop_rshift:
+ case ir_binop_bit_and:
+ case ir_binop_bit_xor:
+ case ir_binop_bit_or:
+ case ir_unop_round_even:
+ assert(!"GLSL 1.30 features unsupported");
+ break;
+
+ case ir_quadop_vector:
+ /* This operation should have already been handled.
+ */
+ assert(!"Should not get here.");
+ break;
+ }
+
+ this->result = result_src;
+}
+
+
+void
+ir_to_mesa_visitor::visit(ir_swizzle *ir)
+{
+ src_reg src;
+ int i;
+ int swizzle[4];
+
+ /* Note that this is only swizzles in expressions, not those on the left
+ * hand side of an assignment, which do write masking. See ir_assignment
+ * for that.
+ */
+
+ ir->val->accept(this);
+ src = this->result;
+ assert(src.file != PROGRAM_UNDEFINED);
+
+ for (i = 0; i < 4; i++) {
+ if (i < ir->type->vector_elements) {
+ switch (i) {
+ case 0:
+ swizzle[i] = GET_SWZ(src.swizzle, ir->mask.x);
+ break;
+ case 1:
+ swizzle[i] = GET_SWZ(src.swizzle, ir->mask.y);
+ break;
+ case 2:
+ swizzle[i] = GET_SWZ(src.swizzle, ir->mask.z);
+ break;
+ case 3:
+ swizzle[i] = GET_SWZ(src.swizzle, ir->mask.w);
+ break;
+ }
+ } else {
+ /* If the type is smaller than a vec4, replicate the last
+ * channel out.
+ */
+ swizzle[i] = swizzle[ir->type->vector_elements - 1];
+ }
+ }
+
+ src.swizzle = MAKE_SWIZZLE4(swizzle[0], swizzle[1], swizzle[2], swizzle[3]);
+
+ this->result = src;
+}
+
+void
+ir_to_mesa_visitor::visit(ir_dereference_variable *ir)
+{
+ variable_storage *entry = find_variable_storage(ir->var);
+ ir_variable *var = ir->var;
+
+ if (!entry) {
+ switch (var->mode) {
+ case ir_var_uniform:
+ entry = new(mem_ctx) variable_storage(var, PROGRAM_UNIFORM,
+ var->location);
+ this->variables.push_tail(entry);
+ break;
+ case ir_var_in:
+ case ir_var_inout:
+ /* The linker assigns locations for varyings and attributes,
+ * including deprecated builtins (like gl_Color), user-assign
+ * generic attributes (glBindVertexLocation), and
+ * user-defined varyings.
+ *
+ * FINISHME: We would hit this path for function arguments. Fix!
+ */
+ assert(var->location != -1);
+ entry = new(mem_ctx) variable_storage(var,
+ PROGRAM_INPUT,
+ var->location);
+ if (this->prog->Target == GL_VERTEX_PROGRAM_ARB &&
+ var->location >= VERT_ATTRIB_GENERIC0) {
+ _mesa_add_attribute(this->prog->Attributes,
+ var->name,
+ _mesa_sizeof_glsl_type(var->type->gl_type),
+ var->type->gl_type,
+ var->location - VERT_ATTRIB_GENERIC0);
+ }
+ break;
+ case ir_var_out:
+ assert(var->location != -1);
+ entry = new(mem_ctx) variable_storage(var,
+ PROGRAM_OUTPUT,
+ var->location);
+ break;
+ case ir_var_system_value:
+ entry = new(mem_ctx) variable_storage(var,
+ PROGRAM_SYSTEM_VALUE,
+ var->location);
+ break;
+ case ir_var_auto:
+ case ir_var_temporary:
+ entry = new(mem_ctx) variable_storage(var, PROGRAM_TEMPORARY,
+ this->next_temp);
+ this->variables.push_tail(entry);
+
+ next_temp += type_size(var->type);
+ break;
+ }
+
+ if (!entry) {
+ printf("Failed to make storage for %s\n", var->name);
+ exit(1);
+ }
+ }
+
+ this->result = src_reg(entry->file, entry->index, var->type);
+}
+
+void
+ir_to_mesa_visitor::visit(ir_dereference_array *ir)
+{
+ ir_constant *index;
+ src_reg src;
+ int element_size = type_size(ir->type);
+
+ index = ir->array_index->constant_expression_value();
+
+ ir->array->accept(this);
+ src = this->result;
+
+ if (index) {
+ src.index += index->value.i[0] * element_size;
+ } else {
+ /* Variable index array dereference. It eats the "vec4" of the
+ * base of the array and an index that offsets the Mesa register
+ * index.
+ */
+ ir->array_index->accept(this);
+
+ src_reg index_reg;
+
+ if (element_size == 1) {
+ index_reg = this->result;
+ } else {
+ index_reg = get_temp(glsl_type::float_type);
+
+ emit(ir, OPCODE_MUL, dst_reg(index_reg),
+ this->result, src_reg_for_float(element_size));
+ }
+
+ src.reladdr = ralloc(mem_ctx, src_reg);
+ memcpy(src.reladdr, &index_reg, sizeof(index_reg));
+ }
+
+ /* If the type is smaller than a vec4, replicate the last channel out. */
+ if (ir->type->is_scalar() || ir->type->is_vector())
+ src.swizzle = swizzle_for_size(ir->type->vector_elements);
+ else
+ src.swizzle = SWIZZLE_NOOP;
+
+ this->result = src;
+}
+
+void
+ir_to_mesa_visitor::visit(ir_dereference_record *ir)
+{
+ unsigned int i;
+ const glsl_type *struct_type = ir->record->type;
+ int offset = 0;
+
+ ir->record->accept(this);
+
+ for (i = 0; i < struct_type->length; i++) {
+ if (strcmp(struct_type->fields.structure[i].name, ir->field) == 0)
+ break;
+ offset += type_size(struct_type->fields.structure[i].type);
+ }
+
+ /* If the type is smaller than a vec4, replicate the last channel out. */
+ if (ir->type->is_scalar() || ir->type->is_vector())
+ this->result.swizzle = swizzle_for_size(ir->type->vector_elements);
+ else
+ this->result.swizzle = SWIZZLE_NOOP;
+
+ this->result.index += offset;
+}
+
+/**
+ * We want to be careful in assignment setup to hit the actual storage
+ * instead of potentially using a temporary like we might with the
+ * ir_dereference handler.
+ */
+static dst_reg
+get_assignment_lhs(ir_dereference *ir, ir_to_mesa_visitor *v)
+{
+ /* The LHS must be a dereference. If the LHS is a variable indexed array
+ * access of a vector, it must be separated into a series conditional moves
+ * before reaching this point (see ir_vec_index_to_cond_assign).
+ */
+ assert(ir->as_dereference());
+ ir_dereference_array *deref_array = ir->as_dereference_array();
+ if (deref_array) {
+ assert(!deref_array->array->type->is_vector());
+ }
+
+ /* Use the rvalue deref handler for the most part. We'll ignore
+ * swizzles in it and write swizzles using writemask, though.
+ */
+ ir->accept(v);
+ return dst_reg(v->result);
+}
+
+/**
+ * Process the condition of a conditional assignment
+ *
+ * Examines the condition of a conditional assignment to generate the optimal
+ * first operand of a \c CMP instruction. If the condition is a relational
+ * operator with 0 (e.g., \c ir_binop_less), the value being compared will be
+ * used as the source for the \c CMP instruction. Otherwise the comparison
+ * is processed to a boolean result, and the boolean result is used as the
+ * operand to the CMP instruction.
+ */
+bool
+ir_to_mesa_visitor::process_move_condition(ir_rvalue *ir)
+{
+ ir_rvalue *src_ir = ir;
+ bool negate = true;
+ bool switch_order = false;
+
+ ir_expression *const expr = ir->as_expression();
+ if ((expr != NULL) && (expr->get_num_operands() == 2)) {
+ bool zero_on_left = false;
+
+ if (expr->operands[0]->is_zero()) {
+ src_ir = expr->operands[1];
+ zero_on_left = true;
+ } else if (expr->operands[1]->is_zero()) {
+ src_ir = expr->operands[0];
+ zero_on_left = false;
+ }
+
+ /* a is - 0 + - 0 +
+ * (a < 0) T F F ( a < 0) T F F
+ * (0 < a) F F T (-a < 0) F F T
+ * (a <= 0) T T F (-a < 0) F F T (swap order of other operands)
+ * (0 <= a) F T T ( a < 0) T F F (swap order of other operands)
+ * (a > 0) F F T (-a < 0) F F T
+ * (0 > a) T F F ( a < 0) T F F
+ * (a >= 0) F T T ( a < 0) T F F (swap order of other operands)
+ * (0 >= a) T T F (-a < 0) F F T (swap order of other operands)
+ *
+ * Note that exchanging the order of 0 and 'a' in the comparison simply
+ * means that the value of 'a' should be negated.
+ */
+ if (src_ir != ir) {
+ switch (expr->operation) {
+ case ir_binop_less:
+ switch_order = false;
+ negate = zero_on_left;
+ break;
+
+ case ir_binop_greater:
+ switch_order = false;
+ negate = !zero_on_left;
+ break;
+
+ case ir_binop_lequal:
+ switch_order = true;
+ negate = !zero_on_left;
+ break;
+
+ case ir_binop_gequal:
+ switch_order = true;
+ negate = zero_on_left;
+ break;
+
+ default:
+ /* This isn't the right kind of comparison afterall, so make sure
+ * the whole condition is visited.
+ */
+ src_ir = ir;
+ break;
+ }
+ }
+ }
+
+ src_ir->accept(this);
+
+ /* We use the OPCODE_CMP (a < 0 ? b : c) for conditional moves, and the
+ * condition we produced is 0.0 or 1.0. By flipping the sign, we can
+ * choose which value OPCODE_CMP produces without an extra instruction
+ * computing the condition.
+ */
+ if (negate)
+ this->result.negate = ~this->result.negate;
+
+ return switch_order;
+}
+
+void
+ir_to_mesa_visitor::visit(ir_assignment *ir)
+{
+ dst_reg l;
+ src_reg r;
+ int i;
+
+ ir->rhs->accept(this);
+ r = this->result;
+
+ l = get_assignment_lhs(ir->lhs, this);
+
+ /* FINISHME: This should really set to the correct maximal writemask for each
+ * FINISHME: component written (in the loops below). This case can only
+ * FINISHME: occur for matrices, arrays, and structures.
+ */
+ if (ir->write_mask == 0) {
+ assert(!ir->lhs->type->is_scalar() && !ir->lhs->type->is_vector());
+ l.writemask = WRITEMASK_XYZW;
+ } else if (ir->lhs->type->is_scalar()) {
+ /* FINISHME: This hack makes writing to gl_FragDepth, which lives in the
+ * FINISHME: W component of fragment shader output zero, work correctly.
+ */
+ l.writemask = WRITEMASK_XYZW;
+ } else {
+ int swizzles[4];
+ int first_enabled_chan = 0;
+ int rhs_chan = 0;
+
+ assert(ir->lhs->type->is_vector());
+ l.writemask = ir->write_mask;
+
+ for (int i = 0; i < 4; i++) {
+ if (l.writemask & (1 << i)) {
+ first_enabled_chan = GET_SWZ(r.swizzle, i);
+ break;
+ }
+ }
+
+ /* Swizzle a small RHS vector into the channels being written.
+ *
+ * glsl ir treats write_mask as dictating how many channels are
+ * present on the RHS while Mesa IR treats write_mask as just
+ * showing which channels of the vec4 RHS get written.
+ */
+ for (int i = 0; i < 4; i++) {
+ if (l.writemask & (1 << i))
+ swizzles[i] = GET_SWZ(r.swizzle, rhs_chan++);
+ else
+ swizzles[i] = first_enabled_chan;
+ }
+ r.swizzle = MAKE_SWIZZLE4(swizzles[0], swizzles[1],
+ swizzles[2], swizzles[3]);
+ }
+
+ assert(l.file != PROGRAM_UNDEFINED);
+ assert(r.file != PROGRAM_UNDEFINED);
+
+ if (ir->condition) {
+ const bool switch_order = this->process_move_condition(ir->condition);
+ src_reg condition = this->result;
+
+ for (i = 0; i < type_size(ir->lhs->type); i++) {
+ if (switch_order) {
+ emit(ir, OPCODE_CMP, l, condition, src_reg(l), r);
+ } else {
+ emit(ir, OPCODE_CMP, l, condition, r, src_reg(l));
+ }
+
+ l.index++;
+ r.index++;
+ }
+ } else {
+ for (i = 0; i < type_size(ir->lhs->type); i++) {
+ emit(ir, OPCODE_MOV, l, r);
+ l.index++;
+ r.index++;
+ }
+ }
+}
+
+
+void
+ir_to_mesa_visitor::visit(ir_constant *ir)
+{
+ src_reg src;
+ GLfloat stack_vals[4] = { 0 };
+ GLfloat *values = stack_vals;
+ unsigned int i;
+
+ /* Unfortunately, 4 floats is all we can get into
+ * _mesa_add_unnamed_constant. So, make a temp to store an
+ * aggregate constant and move each constant value into it. If we
+ * get lucky, copy propagation will eliminate the extra moves.
+ */
+
+ if (ir->type->base_type == GLSL_TYPE_STRUCT) {
+ src_reg temp_base = get_temp(ir->type);
+ dst_reg temp = dst_reg(temp_base);
+
+ foreach_iter(exec_list_iterator, iter, ir->components) {
+ ir_constant *field_value = (ir_constant *)iter.get();
+ int size = type_size(field_value->type);
+
+ assert(size > 0);
+
+ field_value->accept(this);
+ src = this->result;
+
+ for (i = 0; i < (unsigned int)size; i++) {
+ emit(ir, OPCODE_MOV, temp, src);
+
+ src.index++;
+ temp.index++;
+ }
+ }
+ this->result = temp_base;
+ return;
+ }
+
+ if (ir->type->is_array()) {
+ src_reg temp_base = get_temp(ir->type);
+ dst_reg temp = dst_reg(temp_base);
+ int size = type_size(ir->type->fields.array);
+
+ assert(size > 0);
+
+ for (i = 0; i < ir->type->length; i++) {
+ ir->array_elements[i]->accept(this);
+ src = this->result;
+ for (int j = 0; j < size; j++) {
+ emit(ir, OPCODE_MOV, temp, src);
+
+ src.index++;
+ temp.index++;
+ }
+ }
+ this->result = temp_base;
+ return;
+ }
+
+ if (ir->type->is_matrix()) {
+ src_reg mat = get_temp(ir->type);
+ dst_reg mat_column = dst_reg(mat);
+
+ for (i = 0; i < ir->type->matrix_columns; i++) {
+ assert(ir->type->base_type == GLSL_TYPE_FLOAT);
+ values = &ir->value.f[i * ir->type->vector_elements];
+
+ src = src_reg(PROGRAM_CONSTANT, -1, NULL);
+ src.index = _mesa_add_unnamed_constant(this->prog->Parameters,
+ values,
+ ir->type->vector_elements,
+ &src.swizzle);
+ emit(ir, OPCODE_MOV, mat_column, src);
+
+ mat_column.index++;
+ }
+
+ this->result = mat;
+ return;
+ }
+
+ src.file = PROGRAM_CONSTANT;
+ switch (ir->type->base_type) {
+ case GLSL_TYPE_FLOAT:
+ values = &ir->value.f[0];
+ break;
+ case GLSL_TYPE_UINT:
+ for (i = 0; i < ir->type->vector_elements; i++) {
+ values[i] = ir->value.u[i];
+ }
+ break;
+ case GLSL_TYPE_INT:
+ for (i = 0; i < ir->type->vector_elements; i++) {
+ values[i] = ir->value.i[i];
+ }
+ break;
+ case GLSL_TYPE_BOOL:
+ for (i = 0; i < ir->type->vector_elements; i++) {
+ values[i] = ir->value.b[i];
+ }
+ break;
+ default:
+ assert(!"Non-float/uint/int/bool constant");
+ }
+
+ this->result = src_reg(PROGRAM_CONSTANT, -1, ir->type);
+ this->result.index = _mesa_add_unnamed_constant(this->prog->Parameters,
+ values,
+ ir->type->vector_elements,
+ &this->result.swizzle);
+}
+
+function_entry *
+ir_to_mesa_visitor::get_function_signature(ir_function_signature *sig)
+{
+ function_entry *entry;
+
+ foreach_iter(exec_list_iterator, iter, this->function_signatures) {
+ entry = (function_entry *)iter.get();
+
+ if (entry->sig == sig)
+ return entry;
+ }
+
+ entry = ralloc(mem_ctx, function_entry);
+ entry->sig = sig;
+ entry->sig_id = this->next_signature_id++;
+ entry->bgn_inst = NULL;
+
+ /* Allocate storage for all the parameters. */
+ foreach_iter(exec_list_iterator, iter, sig->parameters) {
+ ir_variable *param = (ir_variable *)iter.get();
+ variable_storage *storage;
+
+ storage = find_variable_storage(param);
+ assert(!storage);
+
+ storage = new(mem_ctx) variable_storage(param, PROGRAM_TEMPORARY,
+ this->next_temp);
+ this->variables.push_tail(storage);
+
+ this->next_temp += type_size(param->type);
+ }
+
+ if (!sig->return_type->is_void()) {
+ entry->return_reg = get_temp(sig->return_type);
+ } else {
+ entry->return_reg = undef_src;
+ }
+
+ this->function_signatures.push_tail(entry);
+ return entry;
+}
+
+void
+ir_to_mesa_visitor::visit(ir_call *ir)
+{
+ ir_to_mesa_instruction *call_inst;
+ ir_function_signature *sig = ir->get_callee();
+ function_entry *entry = get_function_signature(sig);
+ int i;
+
+ /* Process in parameters. */
+ exec_list_iterator sig_iter = sig->parameters.iterator();
+ foreach_iter(exec_list_iterator, iter, *ir) {
+ ir_rvalue *param_rval = (ir_rvalue *)iter.get();
+ ir_variable *param = (ir_variable *)sig_iter.get();
+
+ if (param->mode == ir_var_in ||
+ param->mode == ir_var_inout) {
+ variable_storage *storage = find_variable_storage(param);
+ assert(storage);
+
+ param_rval->accept(this);
+ src_reg r = this->result;
+
+ dst_reg l;
+ l.file = storage->file;
+ l.index = storage->index;
+ l.reladdr = NULL;
+ l.writemask = WRITEMASK_XYZW;
+ l.cond_mask = COND_TR;
+
+ for (i = 0; i < type_size(param->type); i++) {
+ emit(ir, OPCODE_MOV, l, r);
+ l.index++;
+ r.index++;
+ }
+ }
+
+ sig_iter.next();
+ }
+ assert(!sig_iter.has_next());
+
+ /* Emit call instruction */
+ call_inst = emit(ir, OPCODE_CAL);
+ call_inst->function = entry;
+
+ /* Process out parameters. */
+ sig_iter = sig->parameters.iterator();
+ foreach_iter(exec_list_iterator, iter, *ir) {
+ ir_rvalue *param_rval = (ir_rvalue *)iter.get();
+ ir_variable *param = (ir_variable *)sig_iter.get();
+
+ if (param->mode == ir_var_out ||
+ param->mode == ir_var_inout) {
+ variable_storage *storage = find_variable_storage(param);
+ assert(storage);
+
+ src_reg r;
+ r.file = storage->file;
+ r.index = storage->index;
+ r.reladdr = NULL;
+ r.swizzle = SWIZZLE_NOOP;
+ r.negate = 0;
+
+ param_rval->accept(this);
+ dst_reg l = dst_reg(this->result);
+
+ for (i = 0; i < type_size(param->type); i++) {
+ emit(ir, OPCODE_MOV, l, r);
+ l.index++;
+ r.index++;
+ }
+ }
+
+ sig_iter.next();
+ }
+ assert(!sig_iter.has_next());
+
+ /* Process return value. */
+ this->result = entry->return_reg;
+}
+
+void
+ir_to_mesa_visitor::visit(ir_texture *ir)
+{
+ src_reg result_src, coord, lod_info, projector, dx, dy;
+ dst_reg result_dst, coord_dst;
+ ir_to_mesa_instruction *inst = NULL;
+ prog_opcode opcode = OPCODE_NOP;
+
+ ir->coordinate->accept(this);
+
+ /* Put our coords in a temp. We'll need to modify them for shadow,
+ * projection, or LOD, so the only case we'd use it as is is if
+ * we're doing plain old texturing. Mesa IR optimization should
+ * handle cleaning up our mess in that case.
+ */
+ coord = get_temp(glsl_type::vec4_type);
+ coord_dst = dst_reg(coord);
+ emit(ir, OPCODE_MOV, coord_dst, this->result);
+
+ if (ir->projector) {
+ ir->projector->accept(this);
+ projector = this->result;
+ }
+
+ /* Storage for our result. Ideally for an assignment we'd be using
+ * the actual storage for the result here, instead.
+ */
+ result_src = get_temp(glsl_type::vec4_type);
+ result_dst = dst_reg(result_src);
+
+ switch (ir->op) {
+ case ir_tex:
+ opcode = OPCODE_TEX;
+ break;
+ case ir_txb:
+ opcode = OPCODE_TXB;
+ ir->lod_info.bias->accept(this);
+ lod_info = this->result;
+ break;
+ case ir_txl:
+ opcode = OPCODE_TXL;
+ ir->lod_info.lod->accept(this);
+ lod_info = this->result;
+ break;
+ case ir_txd:
+ opcode = OPCODE_TXD;
+ ir->lod_info.grad.dPdx->accept(this);
+ dx = this->result;
+ ir->lod_info.grad.dPdy->accept(this);
+ dy = this->result;
+ break;
+ case ir_txf:
+ assert(!"GLSL 1.30 features unsupported");
+ break;
+ }
+
+ if (ir->projector) {
+ if (opcode == OPCODE_TEX) {
+ /* Slot the projector in as the last component of the coord. */
+ coord_dst.writemask = WRITEMASK_W;
+ emit(ir, OPCODE_MOV, coord_dst, projector);
+ coord_dst.writemask = WRITEMASK_XYZW;
+ opcode = OPCODE_TXP;
+ } else {
+ src_reg coord_w = coord;
+ coord_w.swizzle = SWIZZLE_WWWW;
+
+ /* For the other TEX opcodes there's no projective version
+ * since the last slot is taken up by lod info. Do the
+ * projective divide now.
+ */
+ coord_dst.writemask = WRITEMASK_W;
+ emit(ir, OPCODE_RCP, coord_dst, projector);
+
+ /* In the case where we have to project the coordinates "by hand,"
+ * the shadow comparitor value must also be projected.
+ */
+ src_reg tmp_src = coord;
+ if (ir->shadow_comparitor) {
+ /* Slot the shadow value in as the second to last component of the
+ * coord.
+ */
+ ir->shadow_comparitor->accept(this);
+
+ tmp_src = get_temp(glsl_type::vec4_type);
+ dst_reg tmp_dst = dst_reg(tmp_src);
+
+ tmp_dst.writemask = WRITEMASK_Z;
+ emit(ir, OPCODE_MOV, tmp_dst, this->result);
+
+ tmp_dst.writemask = WRITEMASK_XY;
+ emit(ir, OPCODE_MOV, tmp_dst, coord);
+ }
+
+ coord_dst.writemask = WRITEMASK_XYZ;
+ emit(ir, OPCODE_MUL, coord_dst, tmp_src, coord_w);
+
+ coord_dst.writemask = WRITEMASK_XYZW;
+ coord.swizzle = SWIZZLE_XYZW;
+ }
+ }
+
+ /* If projection is done and the opcode is not OPCODE_TXP, then the shadow
+ * comparitor was put in the correct place (and projected) by the code,
+ * above, that handles by-hand projection.
+ */
+ if (ir->shadow_comparitor && (!ir->projector || opcode == OPCODE_TXP)) {
+ /* Slot the shadow value in as the second to last component of the
+ * coord.
+ */
+ ir->shadow_comparitor->accept(this);
+ coord_dst.writemask = WRITEMASK_Z;
+ emit(ir, OPCODE_MOV, coord_dst, this->result);
+ coord_dst.writemask = WRITEMASK_XYZW;
+ }
+
+ if (opcode == OPCODE_TXL || opcode == OPCODE_TXB) {
+ /* Mesa IR stores lod or lod bias in the last channel of the coords. */
+ coord_dst.writemask = WRITEMASK_W;
+ emit(ir, OPCODE_MOV, coord_dst, lod_info);
+ coord_dst.writemask = WRITEMASK_XYZW;
+ }
+
+ if (opcode == OPCODE_TXD)
+ inst = emit(ir, opcode, result_dst, coord, dx, dy);
+ else
+ inst = emit(ir, opcode, result_dst, coord);
+
+ if (ir->shadow_comparitor)
+ inst->tex_shadow = GL_TRUE;
+
+ inst->sampler = _mesa_get_sampler_uniform_value(ir->sampler,
+ this->shader_program,
+ this->prog);
+
+ const glsl_type *sampler_type = ir->sampler->type;
+
+ switch (sampler_type->sampler_dimensionality) {
+ case GLSL_SAMPLER_DIM_1D:
+ inst->tex_target = (sampler_type->sampler_array)
+ ? TEXTURE_1D_ARRAY_INDEX : TEXTURE_1D_INDEX;
+ break;
+ case GLSL_SAMPLER_DIM_2D:
+ inst->tex_target = (sampler_type->sampler_array)
+ ? TEXTURE_2D_ARRAY_INDEX : TEXTURE_2D_INDEX;
+ break;
+ case GLSL_SAMPLER_DIM_3D:
+ inst->tex_target = TEXTURE_3D_INDEX;
+ break;
+ case GLSL_SAMPLER_DIM_CUBE:
+ inst->tex_target = TEXTURE_CUBE_INDEX;
+ break;
+ case GLSL_SAMPLER_DIM_RECT:
+ inst->tex_target = TEXTURE_RECT_INDEX;
+ break;
+ case GLSL_SAMPLER_DIM_BUF:
+ assert(!"FINISHME: Implement ARB_texture_buffer_object");
+ break;
+ default:
+ assert(!"Should not get here.");
+ }
+
+ this->result = result_src;
+}
+
+void
+ir_to_mesa_visitor::visit(ir_return *ir)
+{
+ if (ir->get_value()) {
+ dst_reg l;
+ int i;
+
+ assert(current_function);
+
+ ir->get_value()->accept(this);
+ src_reg r = this->result;
+
+ l = dst_reg(current_function->return_reg);
+
+ for (i = 0; i < type_size(current_function->sig->return_type); i++) {
+ emit(ir, OPCODE_MOV, l, r);
+ l.index++;
+ r.index++;
+ }
+ }
+
+ emit(ir, OPCODE_RET);
+}
+
+void
+ir_to_mesa_visitor::visit(ir_discard *ir)
+{
+ struct gl_fragment_program *fp = (struct gl_fragment_program *)this->prog;
+
+ if (ir->condition) {
+ ir->condition->accept(this);
+ this->result.negate = ~this->result.negate;
+ emit(ir, OPCODE_KIL, undef_dst, this->result);
+ } else {
+ emit(ir, OPCODE_KIL_NV);
+ }
+
+ fp->UsesKill = GL_TRUE;
+}
+
+void
+ir_to_mesa_visitor::visit(ir_if *ir)
+{
+ ir_to_mesa_instruction *cond_inst, *if_inst;
+ ir_to_mesa_instruction *prev_inst;
+
+ prev_inst = (ir_to_mesa_instruction *)this->instructions.get_tail();
+
+ ir->condition->accept(this);
+ assert(this->result.file != PROGRAM_UNDEFINED);
+
+ if (this->options->EmitCondCodes) {
+ cond_inst = (ir_to_mesa_instruction *)this->instructions.get_tail();
+
+ /* See if we actually generated any instruction for generating
+ * the condition. If not, then cook up a move to a temp so we
+ * have something to set cond_update on.
+ */
+ if (cond_inst == prev_inst) {
+ src_reg temp = get_temp(glsl_type::bool_type);
+ cond_inst = emit(ir->condition, OPCODE_MOV, dst_reg(temp), result);
+ }
+ cond_inst->cond_update = GL_TRUE;
+
+ if_inst = emit(ir->condition, OPCODE_IF);
+ if_inst->dst.cond_mask = COND_NE;
+ } else {
+ if_inst = emit(ir->condition, OPCODE_IF, undef_dst, this->result);
+ }
+
+ this->instructions.push_tail(if_inst);
+
+ visit_exec_list(&ir->then_instructions, this);
+
+ if (!ir->else_instructions.is_empty()) {
+ emit(ir->condition, OPCODE_ELSE);
+ visit_exec_list(&ir->else_instructions, this);
+ }
+
+ if_inst = emit(ir->condition, OPCODE_ENDIF);
+}
+
+ir_to_mesa_visitor::ir_to_mesa_visitor()
+{
+ result.file = PROGRAM_UNDEFINED;
+ next_temp = 1;
+ next_signature_id = 1;
+ current_function = NULL;
+ mem_ctx = ralloc_context(NULL);
+}
+
+ir_to_mesa_visitor::~ir_to_mesa_visitor()
+{
+ ralloc_free(mem_ctx);
+}
+
+static struct prog_src_register
+mesa_src_reg_from_ir_src_reg(src_reg reg)
+{
+ struct prog_src_register mesa_reg;
+
+ mesa_reg.File = reg.file;
+ assert(reg.index < (1 << INST_INDEX_BITS));
+ mesa_reg.Index = reg.index;
+ mesa_reg.Swizzle = reg.swizzle;
+ mesa_reg.RelAddr = reg.reladdr != NULL;
+ mesa_reg.Negate = reg.negate;
+ mesa_reg.Abs = 0;
+ mesa_reg.HasIndex2 = GL_FALSE;
+ mesa_reg.RelAddr2 = 0;
+ mesa_reg.Index2 = 0;
+
+ return mesa_reg;
+}
+
+static void
+set_branchtargets(ir_to_mesa_visitor *v,
+ struct prog_instruction *mesa_instructions,
+ int num_instructions)
+{
+ int if_count = 0, loop_count = 0;
+ int *if_stack, *loop_stack;
+ int if_stack_pos = 0, loop_stack_pos = 0;
+ int i, j;
+
+ for (i = 0; i < num_instructions; i++) {
+ switch (mesa_instructions[i].Opcode) {
+ case OPCODE_IF:
+ if_count++;
+ break;
+ case OPCODE_BGNLOOP:
+ loop_count++;
+ break;
+ case OPCODE_BRK:
+ case OPCODE_CONT:
+ mesa_instructions[i].BranchTarget = -1;
+ break;
+ default:
+ break;
+ }
+ }
+
+ if_stack = rzalloc_array(v->mem_ctx, int, if_count);
+ loop_stack = rzalloc_array(v->mem_ctx, int, loop_count);
+
+ for (i = 0; i < num_instructions; i++) {
+ switch (mesa_instructions[i].Opcode) {
+ case OPCODE_IF:
+ if_stack[if_stack_pos] = i;
+ if_stack_pos++;
+ break;
+ case OPCODE_ELSE:
+ mesa_instructions[if_stack[if_stack_pos - 1]].BranchTarget = i;
+ if_stack[if_stack_pos - 1] = i;
+ break;
+ case OPCODE_ENDIF:
+ mesa_instructions[if_stack[if_stack_pos - 1]].BranchTarget = i;
+ if_stack_pos--;
+ break;
+ case OPCODE_BGNLOOP:
+ loop_stack[loop_stack_pos] = i;
+ loop_stack_pos++;
+ break;
+ case OPCODE_ENDLOOP:
+ loop_stack_pos--;
+ /* Rewrite any breaks/conts at this nesting level (haven't
+ * already had a BranchTarget assigned) to point to the end
+ * of the loop.
+ */
+ for (j = loop_stack[loop_stack_pos]; j < i; j++) {
+ if (mesa_instructions[j].Opcode == OPCODE_BRK ||
+ mesa_instructions[j].Opcode == OPCODE_CONT) {
+ if (mesa_instructions[j].BranchTarget == -1) {
+ mesa_instructions[j].BranchTarget = i;
+ }
+ }
+ }
+ /* The loop ends point at each other. */
+ mesa_instructions[i].BranchTarget = loop_stack[loop_stack_pos];
+ mesa_instructions[loop_stack[loop_stack_pos]].BranchTarget = i;
+ break;
+ case OPCODE_CAL:
+ foreach_iter(exec_list_iterator, iter, v->function_signatures) {
+ function_entry *entry = (function_entry *)iter.get();
+
+ if (entry->sig_id == mesa_instructions[i].BranchTarget) {
+ mesa_instructions[i].BranchTarget = entry->inst;
+ break;
+ }
+ }
+ break;
+ default:
+ break;
+ }
+ }
+}
+
+static void
+print_program(struct prog_instruction *mesa_instructions,
+ ir_instruction **mesa_instruction_annotation,
+ int num_instructions)
+{
+ ir_instruction *last_ir = NULL;
+ int i;
+ int indent = 0;
+
+ for (i = 0; i < num_instructions; i++) {
+ struct prog_instruction *mesa_inst = mesa_instructions + i;
+ ir_instruction *ir = mesa_instruction_annotation[i];
+
+ fprintf(stdout, "%3d: ", i);
+
+ if (last_ir != ir && ir) {
+ int j;
+
+ for (j = 0; j < indent; j++) {
+ fprintf(stdout, " ");
+ }
+ ir->print();
+ printf("\n");
+ last_ir = ir;
+
+ fprintf(stdout, " "); /* line number spacing. */
+ }
+
+ indent = _mesa_fprint_instruction_opt(stdout, mesa_inst, indent,
+ PROG_PRINT_DEBUG, NULL);
+ }
+}
+
+
+/**
+ * Count resources used by the given gpu program (number of texture
+ * samplers, etc).
+ */
+static void
+count_resources(struct gl_program *prog)
+{
+ unsigned int i;
+
+ prog->SamplersUsed = 0;
+
+ for (i = 0; i < prog->NumInstructions; i++) {
+ struct prog_instruction *inst = &prog->Instructions[i];
+
+ if (_mesa_is_tex_instruction(inst->Opcode)) {
+ prog->SamplerTargets[inst->TexSrcUnit] =
+ (gl_texture_index)inst->TexSrcTarget;
+ prog->SamplersUsed |= 1 << inst->TexSrcUnit;
+ if (inst->TexShadow) {
+ prog->ShadowSamplers |= 1 << inst->TexSrcUnit;
+ }
+ }
+ }
+
+ _mesa_update_shader_textures_used(prog);
+}
+
+
+/**
+ * Check if the given vertex/fragment/shader program is within the
+ * resource limits of the context (number of texture units, etc).
+ * If any of those checks fail, record a linker error.
+ *
+ * XXX more checks are needed...
+ */
+static void
+check_resources(const struct gl_context *ctx,
+ struct gl_shader_program *shader_program,
+ struct gl_program *prog)
+{
+ switch (prog->Target) {
+ case GL_VERTEX_PROGRAM_ARB:
+ if (_mesa_bitcount(prog->SamplersUsed) >
+ ctx->Const.MaxVertexTextureImageUnits) {
+ fail_link(shader_program, "Too many vertex shader texture samplers");
+ }
+ if (prog->Parameters->NumParameters > MAX_UNIFORMS) {
+ fail_link(shader_program, "Too many vertex shader constants");
+ }
+ break;
+ case MESA_GEOMETRY_PROGRAM:
+ if (_mesa_bitcount(prog->SamplersUsed) >
+ ctx->Const.MaxGeometryTextureImageUnits) {
+ fail_link(shader_program, "Too many geometry shader texture samplers");
+ }
+ if (prog->Parameters->NumParameters >
+ MAX_GEOMETRY_UNIFORM_COMPONENTS / 4) {
+ fail_link(shader_program, "Too many geometry shader constants");
+ }
+ break;
+ case GL_FRAGMENT_PROGRAM_ARB:
+ if (_mesa_bitcount(prog->SamplersUsed) >
+ ctx->Const.MaxTextureImageUnits) {
+ fail_link(shader_program, "Too many fragment shader texture samplers");
+ }
+ if (prog->Parameters->NumParameters > MAX_UNIFORMS) {
+ fail_link(shader_program, "Too many fragment shader constants");
+ }
+ break;
+ default:
+ _mesa_problem(ctx, "unexpected program type in check_resources()");
+ }
+}
+
+
+
+struct uniform_sort {
+ struct gl_uniform *u;
+ int pos;
+};
+
+/* The shader_program->Uniforms list is almost sorted in increasing
+ * uniform->{Frag,Vert}Pos locations, but not quite when there are
+ * uniforms shared between targets. We need to add parameters in
+ * increasing order for the targets.
+ */
+static int
+sort_uniforms(const void *a, const void *b)
+{
+ struct uniform_sort *u1 = (struct uniform_sort *)a;
+ struct uniform_sort *u2 = (struct uniform_sort *)b;
+
+ return u1->pos - u2->pos;
+}
+
+/* Add the uniforms to the parameters. The linker chose locations
+ * in our parameters lists (which weren't created yet), which the
+ * uniforms code will use to poke values into our parameters list
+ * when uniforms are updated.
+ */
+static void
+add_uniforms_to_parameters_list(struct gl_shader_program *shader_program,
+ struct gl_shader *shader,
+ struct gl_program *prog)
+{
+ unsigned int i;
+ unsigned int next_sampler = 0, num_uniforms = 0;
+ struct uniform_sort *sorted_uniforms;
+
+ sorted_uniforms = ralloc_array(NULL, struct uniform_sort,
+ shader_program->Uniforms->NumUniforms);
+
+ for (i = 0; i < shader_program->Uniforms->NumUniforms; i++) {
+ struct gl_uniform *uniform = shader_program->Uniforms->Uniforms + i;
+ int parameter_index = -1;
+
+ switch (shader->Type) {
+ case GL_VERTEX_SHADER:
+ parameter_index = uniform->VertPos;
+ break;
+ case GL_FRAGMENT_SHADER:
+ parameter_index = uniform->FragPos;
+ break;
+ case GL_GEOMETRY_SHADER:
+ parameter_index = uniform->GeomPos;
+ break;
+ }
+
+ /* Only add uniforms used in our target. */
+ if (parameter_index != -1) {
+ sorted_uniforms[num_uniforms].pos = parameter_index;
+ sorted_uniforms[num_uniforms].u = uniform;
+ num_uniforms++;
+ }
+ }
+
+ qsort(sorted_uniforms, num_uniforms, sizeof(struct uniform_sort),
+ sort_uniforms);
+
+ for (i = 0; i < num_uniforms; i++) {
+ struct gl_uniform *uniform = sorted_uniforms[i].u;
+ int parameter_index = sorted_uniforms[i].pos;
+ const glsl_type *type = uniform->Type;
+ unsigned int size;
+
+ if (type->is_vector() ||
+ type->is_scalar()) {
+ size = type->vector_elements;
+ } else {
+ size = type_size(type) * 4;
+ }
+
+ gl_register_file file;
+ if (type->is_sampler() ||
+ (type->is_array() && type->fields.array->is_sampler())) {
+ file = PROGRAM_SAMPLER;
+ } else {
+ file = PROGRAM_UNIFORM;
+ }
+
+ GLint index = _mesa_lookup_parameter_index(prog->Parameters, -1,
+ uniform->Name);
+
+ if (index < 0) {
+ index = _mesa_add_parameter(prog->Parameters, file,
+ uniform->Name, size, type->gl_type,
+ NULL, NULL, 0x0);
+
+ /* Sampler uniform values are stored in prog->SamplerUnits,
+ * and the entry in that array is selected by this index we
+ * store in ParameterValues[].
+ */
+ if (file == PROGRAM_SAMPLER) {
+ for (unsigned int j = 0; j < size / 4; j++)
+ prog->Parameters->ParameterValues[index + j][0] = next_sampler++;
+ }
+
+ /* The location chosen in the Parameters list here (returned
+ * from _mesa_add_uniform) has to match what the linker chose.
+ */
+ if (index != parameter_index) {
+ fail_link(shader_program, "Allocation of uniform `%s' to target "
+ "failed (%d vs %d)\n",
+ uniform->Name, index, parameter_index);
+ }
+ }
+ }
+
+ ralloc_free(sorted_uniforms);
+}
+
+static void
+set_uniform_initializer(struct gl_context *ctx, void *mem_ctx,
+ struct gl_shader_program *shader_program,
+ const char *name, const glsl_type *type,
+ ir_constant *val)
+{
+ if (type->is_record()) {
+ ir_constant *field_constant;
+
+ field_constant = (ir_constant *)val->components.get_head();
+
+ for (unsigned int i = 0; i < type->length; i++) {
+ const glsl_type *field_type = type->fields.structure[i].type;
+ const char *field_name = ralloc_asprintf(mem_ctx, "%s.%s", name,
+ type->fields.structure[i].name);
+ set_uniform_initializer(ctx, mem_ctx, shader_program, field_name,
+ field_type, field_constant);
+ field_constant = (ir_constant *)field_constant->next;
+ }
+ return;
+ }
+
+ int loc = _mesa_get_uniform_location(ctx, shader_program, name);
+
+ if (loc == -1) {
+ fail_link(shader_program,
+ "Couldn't find uniform for initializer %s\n", name);
+ return;
+ }
+
+ for (unsigned int i = 0; i < (type->is_array() ? type->length : 1); i++) {
+ ir_constant *element;
+ const glsl_type *element_type;
+ if (type->is_array()) {
+ element = val->array_elements[i];
+ element_type = type->fields.array;
+ } else {
+ element = val;
+ element_type = type;
+ }
+
+ void *values;
+
+ if (element_type->base_type == GLSL_TYPE_BOOL) {
+ int *conv = ralloc_array(mem_ctx, int, element_type->components());
+ for (unsigned int j = 0; j < element_type->components(); j++) {
+ conv[j] = element->value.b[j];
+ }
+ values = (void *)conv;
+ element_type = glsl_type::get_instance(GLSL_TYPE_INT,
+ element_type->vector_elements,
+ 1);
+ } else {
+ values = &element->value;
+ }
+
+ if (element_type->is_matrix()) {
+ _mesa_uniform_matrix(ctx, shader_program,
+ element_type->matrix_columns,
+ element_type->vector_elements,
+ loc, 1, GL_FALSE, (GLfloat *)values);
+ loc += element_type->matrix_columns;
+ } else {
+ _mesa_uniform(ctx, shader_program, loc, element_type->matrix_columns,
+ values, element_type->gl_type);
+ loc += type_size(element_type);
+ }
+ }
+}
+
+static void
+set_uniform_initializers(struct gl_context *ctx,
+ struct gl_shader_program *shader_program)
+{
+ void *mem_ctx = NULL;
+
+ for (unsigned int i = 0; i < MESA_SHADER_TYPES; i++) {
+ struct gl_shader *shader = shader_program->_LinkedShaders[i];
+
+ if (shader == NULL)
+ continue;
+
+ foreach_iter(exec_list_iterator, iter, *shader->ir) {
+ ir_instruction *ir = (ir_instruction *)iter.get();
+ ir_variable *var = ir->as_variable();
+
+ if (!var || var->mode != ir_var_uniform || !var->constant_value)
+ continue;
+
+ if (!mem_ctx)
+ mem_ctx = ralloc_context(NULL);
+
+ set_uniform_initializer(ctx, mem_ctx, shader_program, var->name,
+ var->type, var->constant_value);
+ }
+ }
+
+ ralloc_free(mem_ctx);
+}
+
+/*
+ * On a basic block basis, tracks available PROGRAM_TEMPORARY register
+ * channels for copy propagation and updates following instructions to
+ * use the original versions.
+ *
+ * The ir_to_mesa_visitor lazily produces code assuming that this pass
+ * will occur. As an example, a TXP production before this pass:
+ *
+ * 0: MOV TEMP[1], INPUT[4].xyyy;
+ * 1: MOV TEMP[1].w, INPUT[4].wwww;
+ * 2: TXP TEMP[2], TEMP[1], texture[0], 2D;
+ *
+ * and after:
+ *
+ * 0: MOV TEMP[1], INPUT[4].xyyy;
+ * 1: MOV TEMP[1].w, INPUT[4].wwww;
+ * 2: TXP TEMP[2], INPUT[4].xyyw, texture[0], 2D;
+ *
+ * which allows for dead code elimination on TEMP[1]'s writes.
+ */
+void
+ir_to_mesa_visitor::copy_propagate(void)
+{
+ ir_to_mesa_instruction **acp = rzalloc_array(mem_ctx,
+ ir_to_mesa_instruction *,
+ this->next_temp * 4);
+ int *acp_level = rzalloc_array(mem_ctx, int, this->next_temp * 4);
+ int level = 0;
+
+ foreach_iter(exec_list_iterator, iter, this->instructions) {
+ ir_to_mesa_instruction *inst = (ir_to_mesa_instruction *)iter.get();
+
+ assert(inst->dst.file != PROGRAM_TEMPORARY
+ || inst->dst.index < this->next_temp);
+
+ /* First, do any copy propagation possible into the src regs. */
+ for (int r = 0; r < 3; r++) {
+ ir_to_mesa_instruction *first = NULL;
+ bool good = true;
+ int acp_base = inst->src[r].index * 4;
+
+ if (inst->src[r].file != PROGRAM_TEMPORARY ||
+ inst->src[r].reladdr)
+ continue;
+
+ /* See if we can find entries in the ACP consisting of MOVs
+ * from the same src register for all the swizzled channels
+ * of this src register reference.
+ */
+ for (int i = 0; i < 4; i++) {
+ int src_chan = GET_SWZ(inst->src[r].swizzle, i);
+ ir_to_mesa_instruction *copy_chan = acp[acp_base + src_chan];
+
+ if (!copy_chan) {
+ good = false;
+ break;
+ }
+
+ assert(acp_level[acp_base + src_chan] <= level);
+
+ if (!first) {
+ first = copy_chan;
+ } else {
+ if (first->src[0].file != copy_chan->src[0].file ||
+ first->src[0].index != copy_chan->src[0].index) {
+ good = false;
+ break;
+ }
+ }
+ }
+
+ if (good) {
+ /* We've now validated that we can copy-propagate to
+ * replace this src register reference. Do it.
+ */
+ inst->src[r].file = first->src[0].file;
+ inst->src[r].index = first->src[0].index;
+
+ int swizzle = 0;
+ for (int i = 0; i < 4; i++) {
+ int src_chan = GET_SWZ(inst->src[r].swizzle, i);
+ ir_to_mesa_instruction *copy_inst = acp[acp_base + src_chan];
+ swizzle |= (GET_SWZ(copy_inst->src[0].swizzle, src_chan) <<
+ (3 * i));
+ }
+ inst->src[r].swizzle = swizzle;
+ }
+ }
+
+ switch (inst->op) {
+ case OPCODE_BGNLOOP:
+ case OPCODE_ENDLOOP:
+ /* End of a basic block, clear the ACP entirely. */
+ memset(acp, 0, sizeof(*acp) * this->next_temp * 4);
+ break;
+
+ case OPCODE_IF:
+ ++level;
+ break;
+
+ case OPCODE_ENDIF:
+ case OPCODE_ELSE:
+ /* Clear all channels written inside the block from the ACP, but
+ * leaving those that were not touched.
+ */
+ for (int r = 0; r < this->next_temp; r++) {
+ for (int c = 0; c < 4; c++) {
+ if (!acp[4 * r + c])
+ continue;
+
+ if (acp_level[4 * r + c] >= level)
+ acp[4 * r + c] = NULL;
+ }
+ }
+ if (inst->op == OPCODE_ENDIF)
+ --level;
+ break;
+
+ default:
+ /* Continuing the block, clear any written channels from
+ * the ACP.
+ */
+ if (inst->dst.file == PROGRAM_TEMPORARY && inst->dst.reladdr) {
+ /* Any temporary might be written, so no copy propagation
+ * across this instruction.
+ */
+ memset(acp, 0, sizeof(*acp) * this->next_temp * 4);
+ } else if (inst->dst.file == PROGRAM_OUTPUT &&
+ inst->dst.reladdr) {
+ /* Any output might be written, so no copy propagation
+ * from outputs across this instruction.
+ */
+ for (int r = 0; r < this->next_temp; r++) {
+ for (int c = 0; c < 4; c++) {
+ if (!acp[4 * r + c])
+ continue;
+
+ if (acp[4 * r + c]->src[0].file == PROGRAM_OUTPUT)
+ acp[4 * r + c] = NULL;
+ }
+ }
+ } else if (inst->dst.file == PROGRAM_TEMPORARY ||
+ inst->dst.file == PROGRAM_OUTPUT) {
+ /* Clear where it's used as dst. */
+ if (inst->dst.file == PROGRAM_TEMPORARY) {
+ for (int c = 0; c < 4; c++) {
+ if (inst->dst.writemask & (1 << c)) {
+ acp[4 * inst->dst.index + c] = NULL;
+ }
+ }
+ }
+
+ /* Clear where it's used as src. */
+ for (int r = 0; r < this->next_temp; r++) {
+ for (int c = 0; c < 4; c++) {
+ if (!acp[4 * r + c])
+ continue;
+
+ int src_chan = GET_SWZ(acp[4 * r + c]->src[0].swizzle, c);
+
+ if (acp[4 * r + c]->src[0].file == inst->dst.file &&
+ acp[4 * r + c]->src[0].index == inst->dst.index &&
+ inst->dst.writemask & (1 << src_chan))
+ {
+ acp[4 * r + c] = NULL;
+ }
+ }
+ }
+ }
+ break;
+ }
+
+ /* If this is a copy, add it to the ACP. */
+ if (inst->op == OPCODE_MOV &&
+ inst->dst.file == PROGRAM_TEMPORARY &&
+ !inst->dst.reladdr &&
+ !inst->saturate &&
+ !inst->src[0].reladdr &&
+ !inst->src[0].negate) {
+ for (int i = 0; i < 4; i++) {
+ if (inst->dst.writemask & (1 << i)) {
+ acp[4 * inst->dst.index + i] = inst;
+ acp_level[4 * inst->dst.index + i] = level;
+ }
+ }
+ }
+ }
+
+ ralloc_free(acp_level);
+ ralloc_free(acp);
+}
+
+
+/**
+ * Convert a shader's GLSL IR into a Mesa gl_program.
+ */
+static struct gl_program *
+get_mesa_program(struct gl_context *ctx,
+ struct gl_shader_program *shader_program,
+ struct gl_shader *shader)
+{
+ ir_to_mesa_visitor v;
+ struct prog_instruction *mesa_instructions, *mesa_inst;
+ ir_instruction **mesa_instruction_annotation;
+ int i;
+ struct gl_program *prog;
+ GLenum target;
+ const char *target_string;
+ GLboolean progress;
+ struct gl_shader_compiler_options *options =
+ &ctx->ShaderCompilerOptions[_mesa_shader_type_to_index(shader->Type)];
+
+ switch (shader->Type) {
+ case GL_VERTEX_SHADER:
+ target = GL_VERTEX_PROGRAM_ARB;
+ target_string = "vertex";
+ break;
+ case GL_FRAGMENT_SHADER:
+ target = GL_FRAGMENT_PROGRAM_ARB;
+ target_string = "fragment";
+ break;
+ case GL_GEOMETRY_SHADER:
+ target = GL_GEOMETRY_PROGRAM_NV;
+ target_string = "geometry";
+ break;
+ default:
+ assert(!"should not be reached");
+ return NULL;
+ }
+
+ validate_ir_tree(shader->ir);
+
+ prog = ctx->Driver.NewProgram(ctx, target, shader_program->Name);
+ if (!prog)
+ return NULL;
+ prog->Parameters = _mesa_new_parameter_list();
+ prog->Varying = _mesa_new_parameter_list();
+ prog->Attributes = _mesa_new_parameter_list();
+ v.ctx = ctx;
+ v.prog = prog;
+ v.shader_program = shader_program;
+ v.options = options;
+
+ add_uniforms_to_parameters_list(shader_program, shader, prog);
+
+ /* Emit Mesa IR for main(). */
+ visit_exec_list(shader->ir, &v);
+ v.emit(NULL, OPCODE_END);
+
+ /* Now emit bodies for any functions that were used. */
+ do {
+ progress = GL_FALSE;
+
+ foreach_iter(exec_list_iterator, iter, v.function_signatures) {
+ function_entry *entry = (function_entry *)iter.get();
+
+ if (!entry->bgn_inst) {
+ v.current_function = entry;
+
+ entry->bgn_inst = v.emit(NULL, OPCODE_BGNSUB);
+ entry->bgn_inst->function = entry;
+
+ visit_exec_list(&entry->sig->body, &v);
+
+ ir_to_mesa_instruction *last;
+ last = (ir_to_mesa_instruction *)v.instructions.get_tail();
+ if (last->op != OPCODE_RET)
+ v.emit(NULL, OPCODE_RET);
+
+ ir_to_mesa_instruction *end;
+ end = v.emit(NULL, OPCODE_ENDSUB);
+ end->function = entry;
+
+ progress = GL_TRUE;
+ }
+ }
+ } while (progress);
+
+ prog->NumTemporaries = v.next_temp;
+
+ int num_instructions = 0;
+ foreach_iter(exec_list_iterator, iter, v.instructions) {
+ num_instructions++;
+ }
+
+ mesa_instructions =
+ (struct prog_instruction *)calloc(num_instructions,
+ sizeof(*mesa_instructions));
+ mesa_instruction_annotation = ralloc_array(v.mem_ctx, ir_instruction *,
+ num_instructions);
+
+ v.copy_propagate();
+
+ /* Convert ir_mesa_instructions into prog_instructions.
+ */
+ mesa_inst = mesa_instructions;
+ i = 0;
+ foreach_iter(exec_list_iterator, iter, v.instructions) {
+ const ir_to_mesa_instruction *inst = (ir_to_mesa_instruction *)iter.get();
+
+ mesa_inst->Opcode = inst->op;
+ mesa_inst->CondUpdate = inst->cond_update;
+ if (inst->saturate)
+ mesa_inst->SaturateMode = SATURATE_ZERO_ONE;
+ mesa_inst->DstReg.File = inst->dst.file;
+ mesa_inst->DstReg.Index = inst->dst.index;
+ mesa_inst->DstReg.CondMask = inst->dst.cond_mask;
+ mesa_inst->DstReg.WriteMask = inst->dst.writemask;
+ mesa_inst->DstReg.RelAddr = inst->dst.reladdr != NULL;
+ mesa_inst->SrcReg[0] = mesa_src_reg_from_ir_src_reg(inst->src[0]);
+ mesa_inst->SrcReg[1] = mesa_src_reg_from_ir_src_reg(inst->src[1]);
+ mesa_inst->SrcReg[2] = mesa_src_reg_from_ir_src_reg(inst->src[2]);
+ mesa_inst->TexSrcUnit = inst->sampler;
+ mesa_inst->TexSrcTarget = inst->tex_target;
+ mesa_inst->TexShadow = inst->tex_shadow;
+ mesa_instruction_annotation[i] = inst->ir;
+
+ /* Set IndirectRegisterFiles. */
+ if (mesa_inst->DstReg.RelAddr)
+ prog->IndirectRegisterFiles |= 1 << mesa_inst->DstReg.File;
+
+ /* Update program's bitmask of indirectly accessed register files */
+ for (unsigned src = 0; src < 3; src++)
+ if (mesa_inst->SrcReg[src].RelAddr)
+ prog->IndirectRegisterFiles |= 1 << mesa_inst->SrcReg[src].File;
+
+ if (options->EmitNoIfs && mesa_inst->Opcode == OPCODE_IF) {
+ fail_link(shader_program, "Couldn't flatten if statement\n");
+ }
+
+ switch (mesa_inst->Opcode) {
+ case OPCODE_BGNSUB:
+ inst->function->inst = i;
+ mesa_inst->Comment = strdup(inst->function->sig->function_name());
+ break;
+ case OPCODE_ENDSUB:
+ mesa_inst->Comment = strdup(inst->function->sig->function_name());
+ break;
+ case OPCODE_CAL:
+ mesa_inst->BranchTarget = inst->function->sig_id; /* rewritten later */
+ break;
+ case OPCODE_ARL:
+ prog->NumAddressRegs = 1;
+ break;
+ default:
+ break;
+ }
+
+ mesa_inst++;
+ i++;
+
+ if (!shader_program->LinkStatus)
+ break;
+ }
+
+ if (!shader_program->LinkStatus) {
+ free(mesa_instructions);
+ _mesa_reference_program(ctx, &shader->Program, NULL);
+ return NULL;
+ }
+
+ set_branchtargets(&v, mesa_instructions, num_instructions);
+
+ if (ctx->Shader.Flags & GLSL_DUMP) {
+ printf("\n");
+ printf("GLSL IR for linked %s program %d:\n", target_string,
+ shader_program->Name);
+ _mesa_print_ir(shader->ir, NULL);
+ printf("\n");
+ printf("\n");
+ printf("Mesa IR for linked %s program %d:\n", target_string,
+ shader_program->Name);
+ print_program(mesa_instructions, mesa_instruction_annotation,
+ num_instructions);
+ }
+
+ prog->Instructions = mesa_instructions;
+ prog->NumInstructions = num_instructions;
+
+ do_set_program_inouts(shader->ir, prog);
+ count_resources(prog);
+
+ check_resources(ctx, shader_program, prog);
+
+ _mesa_reference_program(ctx, &shader->Program, prog);
+
+ if ((ctx->Shader.Flags & GLSL_NO_OPT) == 0) {
+ _mesa_optimize_program(ctx, prog);
+ }
+
+ return prog;
+}
+
+extern "C" {
+
+/**
+ * Link a shader.
+ * Called via ctx->Driver.LinkShader()
+ * This actually involves converting GLSL IR into Mesa gl_programs with
+ * code lowering and other optimizations.
+ */
+GLboolean
+_mesa_ir_link_shader(struct gl_context *ctx, struct gl_shader_program *prog)
+{
+ assert(prog->LinkStatus);
+
+ for (unsigned i = 0; i < MESA_SHADER_TYPES; i++) {
+ if (prog->_LinkedShaders[i] == NULL)
+ continue;
+
+ bool progress;
+ exec_list *ir = prog->_LinkedShaders[i]->ir;
+ const struct gl_shader_compiler_options *options =
+ &ctx->ShaderCompilerOptions[_mesa_shader_type_to_index(prog->_LinkedShaders[i]->Type)];
+
+ do {
+ progress = false;
+
+ /* Lowering */
+ do_mat_op_to_vec(ir);
+ lower_instructions(ir, (MOD_TO_FRACT | DIV_TO_MUL_RCP | EXP_TO_EXP2
+ | LOG_TO_LOG2
+ | ((options->EmitNoPow) ? POW_TO_EXP2 : 0)));
+
+ progress = do_lower_jumps(ir, true, true, options->EmitNoMainReturn, options->EmitNoCont, options->EmitNoLoops) || progress;
+
+ progress = do_common_optimization(ir, true, options->MaxUnrollIterations) || progress;
+
+ progress = lower_quadop_vector(ir, true) || progress;
+
+ if (options->EmitNoIfs) {
+ progress = lower_discard(ir) || progress;
+ progress = lower_if_to_cond_assign(ir) || progress;
+ }
+
+ if (options->EmitNoNoise)
+ progress = lower_noise(ir) || progress;
+
+ /* If there are forms of indirect addressing that the driver
+ * cannot handle, perform the lowering pass.
+ */
+ if (options->EmitNoIndirectInput || options->EmitNoIndirectOutput
+ || options->EmitNoIndirectTemp || options->EmitNoIndirectUniform)
+ progress =
+ lower_variable_index_to_cond_assign(ir,
+ options->EmitNoIndirectInput,
+ options->EmitNoIndirectOutput,
+ options->EmitNoIndirectTemp,
+ options->EmitNoIndirectUniform)
+ || progress;
+
+ progress = do_vec_index_to_cond_assign(ir) || progress;
+ } while (progress);
+
+ validate_ir_tree(ir);
+ }
+
+ for (unsigned i = 0; i < MESA_SHADER_TYPES; i++) {
+ struct gl_program *linked_prog;
+
+ if (prog->_LinkedShaders[i] == NULL)
+ continue;
+
+ linked_prog = get_mesa_program(ctx, prog, prog->_LinkedShaders[i]);
+
+ if (linked_prog) {
+ bool ok = true;
+
+ switch (prog->_LinkedShaders[i]->Type) {
+ case GL_VERTEX_SHADER:
+ _mesa_reference_vertprog(ctx, &prog->VertexProgram,
+ (struct gl_vertex_program *)linked_prog);
+ ok = ctx->Driver.ProgramStringNotify(ctx, GL_VERTEX_PROGRAM_ARB,
+ linked_prog);
+ break;
+ case GL_FRAGMENT_SHADER:
+ _mesa_reference_fragprog(ctx, &prog->FragmentProgram,
+ (struct gl_fragment_program *)linked_prog);
+ ok = ctx->Driver.ProgramStringNotify(ctx, GL_FRAGMENT_PROGRAM_ARB,
+ linked_prog);
+ break;
+ case GL_GEOMETRY_SHADER:
+ _mesa_reference_geomprog(ctx, &prog->GeometryProgram,
+ (struct gl_geometry_program *)linked_prog);
+ ok = ctx->Driver.ProgramStringNotify(ctx, GL_GEOMETRY_PROGRAM_NV,
+ linked_prog);
+ break;
+ }
+ if (!ok) {
+ return GL_FALSE;
+ }
+ }
+
+ _mesa_reference_program(ctx, &linked_prog, NULL);
+ }
+
+ return GL_TRUE;
+}
+
+
+/**
+ * Compile a GLSL shader. Called via glCompileShader().
+ */
+void
+_mesa_glsl_compile_shader(struct gl_context *ctx, struct gl_shader *shader)
+{
+ struct _mesa_glsl_parse_state *state =
+ new(shader) _mesa_glsl_parse_state(ctx, shader->Type, shader);
+
+ const char *source = shader->Source;
+ /* Check if the user called glCompileShader without first calling
+ * glShaderSource. This should fail to compile, but not raise a GL_ERROR.
+ */
+ if (source == NULL) {
+ shader->CompileStatus = GL_FALSE;
+ return;
+ }
+
+ state->error = preprocess(state, &source, &state->info_log,
+ &ctx->Extensions, ctx->API);
+
+ if (ctx->Shader.Flags & GLSL_DUMP) {
+ printf("GLSL source for shader %d:\n", shader->Name);
+ printf("%s\n", shader->Source);
+ }
+
+ if (!state->error) {
+ _mesa_glsl_lexer_ctor(state, source);
+ _mesa_glsl_parse(state);
+ _mesa_glsl_lexer_dtor(state);
+ }
+
+ ralloc_free(shader->ir);
+ shader->ir = new(shader) exec_list;
+ if (!state->error && !state->translation_unit.is_empty())
+ _mesa_ast_to_hir(shader->ir, state);
+
+ if (!state->error && !shader->ir->is_empty()) {
+ validate_ir_tree(shader->ir);
+
+ /* Do some optimization at compile time to reduce shader IR size
+ * and reduce later work if the same shader is linked multiple times
+ */
+ while (do_common_optimization(shader->ir, false, 32))
+ ;
+
+ validate_ir_tree(shader->ir);
+ }
+
+ shader->symbols = state->symbols;
+
+ shader->CompileStatus = !state->error;
+ shader->InfoLog = state->info_log;
+ shader->Version = state->language_version;
+ memcpy(shader->builtins_to_link, state->builtins_to_link,
+ sizeof(shader->builtins_to_link[0]) * state->num_builtins_to_link);
+ shader->num_builtins_to_link = state->num_builtins_to_link;
+
+ if (ctx->Shader.Flags & GLSL_LOG) {
+ _mesa_write_shader_to_file(shader);
+ }
+
+ if (ctx->Shader.Flags & GLSL_DUMP) {
+ if (shader->CompileStatus) {
+ printf("GLSL IR for shader %d:\n", shader->Name);
+ _mesa_print_ir(shader->ir, NULL);
+ printf("\n\n");
+ } else {
+ printf("GLSL shader %d failed to compile.\n", shader->Name);
+ }
+ if (shader->InfoLog && shader->InfoLog[0] != 0) {
+ printf("GLSL shader %d info log:\n", shader->Name);
+ printf("%s\n", shader->InfoLog);
+ }
+ }
+
+ /* Retain any live IR, but trash the rest. */
+ reparent_ir(shader->ir, shader->ir);
+
+ ralloc_free(state);
+}
+
+
+/**
+ * Link a GLSL shader program. Called via glLinkProgram().
+ */
+void
+_mesa_glsl_link_shader(struct gl_context *ctx, struct gl_shader_program *prog)
+{
+ unsigned int i;
+
+ _mesa_clear_shader_program_data(ctx, prog);
+
+ prog->LinkStatus = GL_TRUE;
+
+ for (i = 0; i < prog->NumShaders; i++) {
+ if (!prog->Shaders[i]->CompileStatus) {
+ fail_link(prog, "linking with uncompiled shader");
+ prog->LinkStatus = GL_FALSE;
+ }
+ }
+
+ prog->Varying = _mesa_new_parameter_list();
+ _mesa_reference_vertprog(ctx, &prog->VertexProgram, NULL);
+ _mesa_reference_fragprog(ctx, &prog->FragmentProgram, NULL);
+ _mesa_reference_geomprog(ctx, &prog->GeometryProgram, NULL);
+
+ if (prog->LinkStatus) {
+ link_shaders(ctx, prog);
+ }
+
+ if (prog->LinkStatus) {
+ if (!ctx->Driver.LinkShader(ctx, prog)) {
+ prog->LinkStatus = GL_FALSE;
+ }
+ }
+
+ set_uniform_initializers(ctx, prog);
+
+ if (ctx->Shader.Flags & GLSL_DUMP) {
+ if (!prog->LinkStatus) {
+ printf("GLSL shader program %d failed to link\n", prog->Name);
+ }
+
+ if (prog->InfoLog && prog->InfoLog[0] != 0) {
+ printf("GLSL shader program %d info log:\n", prog->Name);
+ printf("%s\n", prog->InfoLog);
+ }
+ }
+}
+
+} /* extern "C" */
diff --git a/mesalib/src/mesa/program/prog_instruction.h b/mesalib/src/mesa/program/prog_instruction.h
index db2b594e7..19e9b95a3 100644
--- a/mesalib/src/mesa/program/prog_instruction.h
+++ b/mesalib/src/mesa/program/prog_instruction.h
@@ -1,454 +1,454 @@
-/*
- * Mesa 3-D graphics library
- * Version: 7.3
- *
- * Copyright (C) 1999-2008 Brian Paul All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-
-/**
- * \file prog_instruction.h
- *
- * Vertex/fragment program instruction datatypes and constants.
- *
- * \author Brian Paul
- * \author Keith Whitwell
- * \author Ian Romanick <idr@us.ibm.com>
- */
-
-
-#ifndef PROG_INSTRUCTION_H
-#define PROG_INSTRUCTION_H
-
-
-#include "main/glheader.h"
-
-
-/**
- * Swizzle indexes.
- * Do not change!
- */
-/*@{*/
-#define SWIZZLE_X 0
-#define SWIZZLE_Y 1
-#define SWIZZLE_Z 2
-#define SWIZZLE_W 3
-#define SWIZZLE_ZERO 4 /**< For SWZ instruction only */
-#define SWIZZLE_ONE 5 /**< For SWZ instruction only */
-#define SWIZZLE_NIL 7 /**< used during shader code gen (undefined value) */
-/*@}*/
-
-#define MAKE_SWIZZLE4(a,b,c,d) (((a)<<0) | ((b)<<3) | ((c)<<6) | ((d)<<9))
-#define SWIZZLE_NOOP MAKE_SWIZZLE4(0,1,2,3)
-#define GET_SWZ(swz, idx) (((swz) >> ((idx)*3)) & 0x7)
-#define GET_BIT(msk, idx) (((msk) >> (idx)) & 0x1)
-
-#define SWIZZLE_XYZW MAKE_SWIZZLE4(SWIZZLE_X, SWIZZLE_Y, SWIZZLE_Z, SWIZZLE_W)
-#define SWIZZLE_XXXX MAKE_SWIZZLE4(SWIZZLE_X, SWIZZLE_X, SWIZZLE_X, SWIZZLE_X)
-#define SWIZZLE_YYYY MAKE_SWIZZLE4(SWIZZLE_Y, SWIZZLE_Y, SWIZZLE_Y, SWIZZLE_Y)
-#define SWIZZLE_ZZZZ MAKE_SWIZZLE4(SWIZZLE_Z, SWIZZLE_Z, SWIZZLE_Z, SWIZZLE_Z)
-#define SWIZZLE_WWWW MAKE_SWIZZLE4(SWIZZLE_W, SWIZZLE_W, SWIZZLE_W, SWIZZLE_W)
-
-
-/**
- * Writemask values, 1 bit per component.
- */
-/*@{*/
-#define WRITEMASK_X 0x1
-#define WRITEMASK_Y 0x2
-#define WRITEMASK_XY 0x3
-#define WRITEMASK_Z 0x4
-#define WRITEMASK_XZ 0x5
-#define WRITEMASK_YZ 0x6
-#define WRITEMASK_XYZ 0x7
-#define WRITEMASK_W 0x8
-#define WRITEMASK_XW 0x9
-#define WRITEMASK_YW 0xa
-#define WRITEMASK_XYW 0xb
-#define WRITEMASK_ZW 0xc
-#define WRITEMASK_XZW 0xd
-#define WRITEMASK_YZW 0xe
-#define WRITEMASK_XYZW 0xf
-/*@}*/
-
-
-/**
- * Condition codes
- */
-/*@{*/
-#define COND_GT 1 /**< greater than zero */
-#define COND_EQ 2 /**< equal to zero */
-#define COND_LT 3 /**< less than zero */
-#define COND_UN 4 /**< unordered (NaN) */
-#define COND_GE 5 /**< greater than or equal to zero */
-#define COND_LE 6 /**< less than or equal to zero */
-#define COND_NE 7 /**< not equal to zero */
-#define COND_TR 8 /**< always true */
-#define COND_FL 9 /**< always false */
-/*@}*/
-
-
-/**
- * Instruction precision for GL_NV_fragment_program
- */
-/*@{*/
-#define FLOAT32 0x1
-#define FLOAT16 0x2
-#define FIXED12 0x4
-/*@}*/
-
-
-/**
- * Saturation modes when storing values.
- */
-/*@{*/
-#define SATURATE_OFF 0
-#define SATURATE_ZERO_ONE 1
-/*@}*/
-
-
-/**
- * Per-component negation masks
- */
-/*@{*/
-#define NEGATE_X 0x1
-#define NEGATE_Y 0x2
-#define NEGATE_Z 0x4
-#define NEGATE_W 0x8
-#define NEGATE_XYZ 0x7
-#define NEGATE_XYZW 0xf
-#define NEGATE_NONE 0x0
-/*@}*/
-
-
-/**
- * Program instruction opcodes for vertex, fragment and geometry programs.
- */
-typedef enum prog_opcode {
- /* ARB_vp ARB_fp NV_vp NV_fp GLSL */
- /*------------------------------------------*/
- OPCODE_NOP = 0, /* X */
- OPCODE_ABS, /* X X 1.1 X */
- OPCODE_ADD, /* X X X X X */
- OPCODE_AND, /* */
- OPCODE_ARA, /* 2 */
- OPCODE_ARL, /* X X X */
- OPCODE_ARL_NV, /* 2 */
- OPCODE_ARR, /* 2 */
- OPCODE_BGNLOOP, /* opt */
- OPCODE_BGNSUB, /* opt */
- OPCODE_BRA, /* 2 */
- OPCODE_BRK, /* 2 opt */
- OPCODE_CAL, /* 2 2 opt */
- OPCODE_CMP, /* X X */
- OPCODE_CONT, /* opt */
- OPCODE_COS, /* X 2 X X */
- OPCODE_DDX, /* X X */
- OPCODE_DDY, /* X X */
- OPCODE_DP2, /* 2 X */
- OPCODE_DP2A, /* 2 */
- OPCODE_DP3, /* X X X X X */
- OPCODE_DP4, /* X X X X X */
- OPCODE_DPH, /* X X 1.1 */
- OPCODE_DST, /* X X X X */
- OPCODE_ELSE, /* opt */
- OPCODE_EMIT_VERTEX,/* X */
- OPCODE_END, /* X X X X opt */
- OPCODE_END_PRIMITIVE,/* X */
- OPCODE_ENDIF, /* opt */
- OPCODE_ENDLOOP, /* opt */
- OPCODE_ENDSUB, /* opt */
- OPCODE_EX2, /* X X 2 X X */
- OPCODE_EXP, /* X X */
- OPCODE_FLR, /* X X 2 X X */
- OPCODE_FRC, /* X X 2 X X */
- OPCODE_IF, /* opt */
- OPCODE_KIL, /* X X */
- OPCODE_KIL_NV, /* X X */
- OPCODE_LG2, /* X X 2 X X */
- OPCODE_LIT, /* X X X X */
- OPCODE_LOG, /* X X */
- OPCODE_LRP, /* X X */
- OPCODE_MAD, /* X X X X X */
- OPCODE_MAX, /* X X X X X */
- OPCODE_MIN, /* X X X X X */
- OPCODE_MOV, /* X X X X X */
- OPCODE_MUL, /* X X X X X */
- OPCODE_NOISE1, /* X */
- OPCODE_NOISE2, /* X */
- OPCODE_NOISE3, /* X */
- OPCODE_NOISE4, /* X */
- OPCODE_NOT, /* */
- OPCODE_NRM3, /* */
- OPCODE_NRM4, /* */
- OPCODE_OR, /* */
- OPCODE_PK2H, /* X */
- OPCODE_PK2US, /* X */
- OPCODE_PK4B, /* X */
- OPCODE_PK4UB, /* X */
- OPCODE_POW, /* X X X X */
- OPCODE_POPA, /* 3 */
- OPCODE_PRINT, /* X X */
- OPCODE_PUSHA, /* 3 */
- OPCODE_RCC, /* 1.1 */
- OPCODE_RCP, /* X X X X X */
- OPCODE_RET, /* 2 2 opt */
- OPCODE_RFL, /* X X */
- OPCODE_RSQ, /* X X X X X */
- OPCODE_SCS, /* X X */
- OPCODE_SEQ, /* 2 X X */
- OPCODE_SFL, /* 2 X */
- OPCODE_SGE, /* X X X X X */
- OPCODE_SGT, /* 2 X X */
- OPCODE_SIN, /* X 2 X X */
- OPCODE_SLE, /* 2 X X */
- OPCODE_SLT, /* X X X X X */
- OPCODE_SNE, /* 2 X X */
- OPCODE_SSG, /* 2 X */
- OPCODE_STR, /* 2 X */
- OPCODE_SUB, /* X X 1.1 X X */
- OPCODE_SWZ, /* X X X */
- OPCODE_TEX, /* X 3 X X */
- OPCODE_TXB, /* X 3 X */
- OPCODE_TXD, /* X X */
- OPCODE_TXL, /* 3 2 X */
- OPCODE_TXP, /* X X */
- OPCODE_TXP_NV, /* 3 X */
- OPCODE_TRUNC, /* X */
- OPCODE_UP2H, /* X */
- OPCODE_UP2US, /* X */
- OPCODE_UP4B, /* X */
- OPCODE_UP4UB, /* X */
- OPCODE_X2D, /* X */
- OPCODE_XOR, /* */
- OPCODE_XPD, /* X X */
- MAX_OPCODE
-} gl_inst_opcode;
-
-
-/**
- * Number of bits for the src/dst register Index field.
- * This limits the size of temp/uniform register files.
- */
-#define INST_INDEX_BITS 12
-
-
-/**
- * Instruction source register.
- */
-struct prog_src_register
-{
- GLuint File:4; /**< One of the PROGRAM_* register file values. */
- GLint Index:(INST_INDEX_BITS+1); /**< Extra bit here for sign bit.
- * May be negative for relative addressing.
- */
- GLuint Swizzle:12;
- GLuint RelAddr:1;
-
- /** Take the component-wise absolute value */
- GLuint Abs:1;
-
- /**
- * Post-Abs negation.
- * This will either be NEGATE_NONE or NEGATE_XYZW, except for the SWZ
- * instruction which allows per-component negation.
- */
- GLuint Negate:4;
-
- /**
- * Is the register two-dimensional.
- * Two dimensional registers are of the
- * REGISTER[index][index2] format.
- * They are used by the geometry shaders where
- * the first index is the index within an array
- * and the second index is the semantic of the
- * array, e.g. gl_PositionIn[index] would become
- * INPUT[index][gl_PositionIn]
- */
- GLuint HasIndex2:1;
- GLuint RelAddr2:1;
- GLint Index2:(INST_INDEX_BITS+1); /**< Extra bit here for sign bit.
- * May be negative for relative
- * addressing. */
-};
-
-
-/**
- * Instruction destination register.
- */
-struct prog_dst_register
-{
- GLuint File:4; /**< One of the PROGRAM_* register file values */
- GLuint Index:INST_INDEX_BITS; /**< Unsigned, never negative */
- GLuint WriteMask:4;
- GLuint RelAddr:1;
-
- /**
- * \name Conditional destination update control.
- *
- * \since
- * NV_fragment_program, NV_fragment_program_option, NV_vertex_program2,
- * NV_vertex_program2_option.
- */
- /*@{*/
- /**
- * Takes one of the 9 possible condition values (EQ, FL, GT, GE, LE, LT,
- * NE, TR, or UN). Dest reg is only written to if the matching
- * (swizzled) condition code value passes. When a conditional update mask
- * is not specified, this will be \c COND_TR.
- */
- GLuint CondMask:4;
-
- /**
- * Condition code swizzle value.
- */
- GLuint CondSwizzle:12;
-
- /**
- * Selects the condition code register to use for conditional destination
- * update masking. In NV_fragmnet_program or NV_vertex_program2 mode, only
- * condition code register 0 is available. In NV_vertex_program3 mode,
- * condition code registers 0 and 1 are available.
- */
- GLuint CondSrc:1;
- /*@}*/
-};
-
-
-/**
- * Vertex/fragment program instruction.
- */
-struct prog_instruction
-{
- gl_inst_opcode Opcode;
- struct prog_src_register SrcReg[3];
- struct prog_dst_register DstReg;
-
- /**
- * Indicates that the instruction should update the condition code
- * register.
- *
- * \since
- * NV_fragment_program, NV_fragment_program_option, NV_vertex_program2,
- * NV_vertex_program2_option.
- */
- GLuint CondUpdate:1;
-
- /**
- * If prog_instruction::CondUpdate is \c GL_TRUE, this value selects the
- * condition code register that is to be updated.
- *
- * In GL_NV_fragment_program or GL_NV_vertex_program2 mode, only condition
- * code register 0 is available. In GL_NV_vertex_program3 mode, condition
- * code registers 0 and 1 are available.
- *
- * \since
- * NV_fragment_program, NV_fragment_program_option, NV_vertex_program2,
- * NV_vertex_program2_option.
- */
- GLuint CondDst:1;
-
- /**
- * Saturate each value of the vectored result to the range [0,1] or the
- * range [-1,1]. \c SSAT mode (i.e., saturation to the range [-1,1]) is
- * only available in NV_fragment_program2 mode.
- * Value is one of the SATURATE_* tokens.
- *
- * \since
- * NV_fragment_program, NV_fragment_program_option, NV_vertex_program3.
- */
- GLuint SaturateMode:2;
-
- /**
- * Per-instruction selectable precision: FLOAT32, FLOAT16, FIXED12.
- *
- * \since
- * NV_fragment_program, NV_fragment_program_option.
- */
- GLuint Precision:3;
-
- /**
- * \name Extra fields for TEX, TXB, TXD, TXL, TXP instructions.
- */
- /*@{*/
- /** Source texture unit. */
- GLuint TexSrcUnit:5;
-
- /** Source texture target, one of TEXTURE_{1D,2D,3D,CUBE,RECT}_INDEX */
- GLuint TexSrcTarget:3;
-
- /** True if tex instruction should do shadow comparison */
- GLuint TexShadow:1;
- /*@}*/
-
- /**
- * For BRA and CAL instructions, the location to jump to.
- * For BGNLOOP, points to ENDLOOP (and vice-versa).
- * For BRK, points to ENDLOOP
- * For IF, points to ELSE or ENDIF.
- * For ELSE, points to ENDIF.
- */
- GLint BranchTarget;
-
- /** for debugging purposes */
- const char *Comment;
-
- /** Arbitrary data. Used for OPCODE_PRINT and some drivers */
- void *Data;
-
- /** for driver use (try to remove someday) */
- GLint Aux;
-};
-
-
-extern void
-_mesa_init_instructions(struct prog_instruction *inst, GLuint count);
-
-extern struct prog_instruction *
-_mesa_alloc_instructions(GLuint numInst);
-
-extern struct prog_instruction *
-_mesa_realloc_instructions(struct prog_instruction *oldInst,
- GLuint numOldInst, GLuint numNewInst);
-
-extern struct prog_instruction *
-_mesa_copy_instructions(struct prog_instruction *dest,
- const struct prog_instruction *src, GLuint n);
-
-extern void
-_mesa_free_instructions(struct prog_instruction *inst, GLuint count);
-
-extern GLuint
-_mesa_num_inst_src_regs(gl_inst_opcode opcode);
-
-extern GLuint
-_mesa_num_inst_dst_regs(gl_inst_opcode opcode);
-
-extern GLboolean
-_mesa_is_tex_instruction(gl_inst_opcode opcode);
-
-extern GLboolean
-_mesa_check_soa_dependencies(const struct prog_instruction *inst);
-
-extern const char *
-_mesa_opcode_string(gl_inst_opcode opcode);
-
-
-#endif /* PROG_INSTRUCTION_H */
+/*
+ * Mesa 3-D graphics library
+ * Version: 7.3
+ *
+ * Copyright (C) 1999-2008 Brian Paul All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+
+/**
+ * \file prog_instruction.h
+ *
+ * Vertex/fragment program instruction datatypes and constants.
+ *
+ * \author Brian Paul
+ * \author Keith Whitwell
+ * \author Ian Romanick <idr@us.ibm.com>
+ */
+
+
+#ifndef PROG_INSTRUCTION_H
+#define PROG_INSTRUCTION_H
+
+
+#include "main/glheader.h"
+
+
+/**
+ * Swizzle indexes.
+ * Do not change!
+ */
+/*@{*/
+#define SWIZZLE_X 0
+#define SWIZZLE_Y 1
+#define SWIZZLE_Z 2
+#define SWIZZLE_W 3
+#define SWIZZLE_ZERO 4 /**< For SWZ instruction only */
+#define SWIZZLE_ONE 5 /**< For SWZ instruction only */
+#define SWIZZLE_NIL 7 /**< used during shader code gen (undefined value) */
+/*@}*/
+
+#define MAKE_SWIZZLE4(a,b,c,d) (((a)<<0) | ((b)<<3) | ((c)<<6) | ((d)<<9))
+#define SWIZZLE_NOOP MAKE_SWIZZLE4(0,1,2,3)
+#define GET_SWZ(swz, idx) (((swz) >> ((idx)*3)) & 0x7)
+#define GET_BIT(msk, idx) (((msk) >> (idx)) & 0x1)
+
+#define SWIZZLE_XYZW MAKE_SWIZZLE4(SWIZZLE_X, SWIZZLE_Y, SWIZZLE_Z, SWIZZLE_W)
+#define SWIZZLE_XXXX MAKE_SWIZZLE4(SWIZZLE_X, SWIZZLE_X, SWIZZLE_X, SWIZZLE_X)
+#define SWIZZLE_YYYY MAKE_SWIZZLE4(SWIZZLE_Y, SWIZZLE_Y, SWIZZLE_Y, SWIZZLE_Y)
+#define SWIZZLE_ZZZZ MAKE_SWIZZLE4(SWIZZLE_Z, SWIZZLE_Z, SWIZZLE_Z, SWIZZLE_Z)
+#define SWIZZLE_WWWW MAKE_SWIZZLE4(SWIZZLE_W, SWIZZLE_W, SWIZZLE_W, SWIZZLE_W)
+
+
+/**
+ * Writemask values, 1 bit per component.
+ */
+/*@{*/
+#define WRITEMASK_X 0x1
+#define WRITEMASK_Y 0x2
+#define WRITEMASK_XY 0x3
+#define WRITEMASK_Z 0x4
+#define WRITEMASK_XZ 0x5
+#define WRITEMASK_YZ 0x6
+#define WRITEMASK_XYZ 0x7
+#define WRITEMASK_W 0x8
+#define WRITEMASK_XW 0x9
+#define WRITEMASK_YW 0xa
+#define WRITEMASK_XYW 0xb
+#define WRITEMASK_ZW 0xc
+#define WRITEMASK_XZW 0xd
+#define WRITEMASK_YZW 0xe
+#define WRITEMASK_XYZW 0xf
+/*@}*/
+
+
+/**
+ * Condition codes
+ */
+/*@{*/
+#define COND_GT 1 /**< greater than zero */
+#define COND_EQ 2 /**< equal to zero */
+#define COND_LT 3 /**< less than zero */
+#define COND_UN 4 /**< unordered (NaN) */
+#define COND_GE 5 /**< greater than or equal to zero */
+#define COND_LE 6 /**< less than or equal to zero */
+#define COND_NE 7 /**< not equal to zero */
+#define COND_TR 8 /**< always true */
+#define COND_FL 9 /**< always false */
+/*@}*/
+
+
+/**
+ * Instruction precision for GL_NV_fragment_program
+ */
+/*@{*/
+#define FLOAT32 0x1
+#define FLOAT16 0x2
+#define FIXED12 0x4
+/*@}*/
+
+
+/**
+ * Saturation modes when storing values.
+ */
+/*@{*/
+#define SATURATE_OFF 0
+#define SATURATE_ZERO_ONE 1
+/*@}*/
+
+
+/**
+ * Per-component negation masks
+ */
+/*@{*/
+#define NEGATE_X 0x1
+#define NEGATE_Y 0x2
+#define NEGATE_Z 0x4
+#define NEGATE_W 0x8
+#define NEGATE_XYZ 0x7
+#define NEGATE_XYZW 0xf
+#define NEGATE_NONE 0x0
+/*@}*/
+
+
+/**
+ * Program instruction opcodes for vertex, fragment and geometry programs.
+ */
+typedef enum prog_opcode {
+ /* ARB_vp ARB_fp NV_vp NV_fp GLSL */
+ /*------------------------------------------*/
+ OPCODE_NOP = 0, /* X */
+ OPCODE_ABS, /* X X 1.1 X */
+ OPCODE_ADD, /* X X X X X */
+ OPCODE_AND, /* */
+ OPCODE_ARA, /* 2 */
+ OPCODE_ARL, /* X X X */
+ OPCODE_ARL_NV, /* 2 */
+ OPCODE_ARR, /* 2 */
+ OPCODE_BGNLOOP, /* opt */
+ OPCODE_BGNSUB, /* opt */
+ OPCODE_BRA, /* 2 */
+ OPCODE_BRK, /* 2 opt */
+ OPCODE_CAL, /* 2 2 opt */
+ OPCODE_CMP, /* X X */
+ OPCODE_CONT, /* opt */
+ OPCODE_COS, /* X 2 X X */
+ OPCODE_DDX, /* X X */
+ OPCODE_DDY, /* X X */
+ OPCODE_DP2, /* 2 X */
+ OPCODE_DP2A, /* 2 */
+ OPCODE_DP3, /* X X X X X */
+ OPCODE_DP4, /* X X X X X */
+ OPCODE_DPH, /* X X 1.1 */
+ OPCODE_DST, /* X X X X */
+ OPCODE_ELSE, /* opt */
+ OPCODE_EMIT_VERTEX,/* X */
+ OPCODE_END, /* X X X X opt */
+ OPCODE_END_PRIMITIVE,/* X */
+ OPCODE_ENDIF, /* opt */
+ OPCODE_ENDLOOP, /* opt */
+ OPCODE_ENDSUB, /* opt */
+ OPCODE_EX2, /* X X 2 X X */
+ OPCODE_EXP, /* X X */
+ OPCODE_FLR, /* X X 2 X X */
+ OPCODE_FRC, /* X X 2 X X */
+ OPCODE_IF, /* opt */
+ OPCODE_KIL, /* X X */
+ OPCODE_KIL_NV, /* X X */
+ OPCODE_LG2, /* X X 2 X X */
+ OPCODE_LIT, /* X X X X */
+ OPCODE_LOG, /* X X */
+ OPCODE_LRP, /* X X */
+ OPCODE_MAD, /* X X X X X */
+ OPCODE_MAX, /* X X X X X */
+ OPCODE_MIN, /* X X X X X */
+ OPCODE_MOV, /* X X X X X */
+ OPCODE_MUL, /* X X X X X */
+ OPCODE_NOISE1, /* X */
+ OPCODE_NOISE2, /* X */
+ OPCODE_NOISE3, /* X */
+ OPCODE_NOISE4, /* X */
+ OPCODE_NOT, /* */
+ OPCODE_NRM3, /* */
+ OPCODE_NRM4, /* */
+ OPCODE_OR, /* */
+ OPCODE_PK2H, /* X */
+ OPCODE_PK2US, /* X */
+ OPCODE_PK4B, /* X */
+ OPCODE_PK4UB, /* X */
+ OPCODE_POW, /* X X X X */
+ OPCODE_POPA, /* 3 */
+ OPCODE_PRINT, /* X X */
+ OPCODE_PUSHA, /* 3 */
+ OPCODE_RCC, /* 1.1 */
+ OPCODE_RCP, /* X X X X X */
+ OPCODE_RET, /* 2 2 opt */
+ OPCODE_RFL, /* X X */
+ OPCODE_RSQ, /* X X X X X */
+ OPCODE_SCS, /* X X */
+ OPCODE_SEQ, /* 2 X X */
+ OPCODE_SFL, /* 2 X */
+ OPCODE_SGE, /* X X X X X */
+ OPCODE_SGT, /* 2 X X */
+ OPCODE_SIN, /* X 2 X X */
+ OPCODE_SLE, /* 2 X X */
+ OPCODE_SLT, /* X X X X X */
+ OPCODE_SNE, /* 2 X X */
+ OPCODE_SSG, /* 2 X */
+ OPCODE_STR, /* 2 X */
+ OPCODE_SUB, /* X X 1.1 X X */
+ OPCODE_SWZ, /* X X X */
+ OPCODE_TEX, /* X 3 X X */
+ OPCODE_TXB, /* X 3 X */
+ OPCODE_TXD, /* X X */
+ OPCODE_TXL, /* 3 2 X */
+ OPCODE_TXP, /* X X */
+ OPCODE_TXP_NV, /* 3 X */
+ OPCODE_TRUNC, /* X */
+ OPCODE_UP2H, /* X */
+ OPCODE_UP2US, /* X */
+ OPCODE_UP4B, /* X */
+ OPCODE_UP4UB, /* X */
+ OPCODE_X2D, /* X */
+ OPCODE_XOR, /* */
+ OPCODE_XPD, /* X X */
+ MAX_OPCODE
+} gl_inst_opcode;
+
+
+/**
+ * Number of bits for the src/dst register Index field.
+ * This limits the size of temp/uniform register files.
+ */
+#define INST_INDEX_BITS 12
+
+
+/**
+ * Instruction source register.
+ */
+struct prog_src_register
+{
+ GLuint File:4; /**< One of the PROGRAM_* register file values. */
+ GLint Index:(INST_INDEX_BITS+1); /**< Extra bit here for sign bit.
+ * May be negative for relative addressing.
+ */
+ GLuint Swizzle:12;
+ GLuint RelAddr:1;
+
+ /** Take the component-wise absolute value */
+ GLuint Abs:1;
+
+ /**
+ * Post-Abs negation.
+ * This will either be NEGATE_NONE or NEGATE_XYZW, except for the SWZ
+ * instruction which allows per-component negation.
+ */
+ GLuint Negate:4;
+
+ /**
+ * Is the register two-dimensional.
+ * Two dimensional registers are of the
+ * REGISTER[index][index2] format.
+ * They are used by the geometry shaders where
+ * the first index is the index within an array
+ * and the second index is the semantic of the
+ * array, e.g. gl_PositionIn[index] would become
+ * INPUT[index][gl_PositionIn]
+ */
+ GLuint HasIndex2:1;
+ GLuint RelAddr2:1;
+ GLint Index2:(INST_INDEX_BITS+1); /**< Extra bit here for sign bit.
+ * May be negative for relative
+ * addressing. */
+};
+
+
+/**
+ * Instruction destination register.
+ */
+struct prog_dst_register
+{
+ GLuint File:4; /**< One of the PROGRAM_* register file values */
+ GLuint Index:INST_INDEX_BITS; /**< Unsigned, never negative */
+ GLuint WriteMask:4;
+ GLuint RelAddr:1;
+
+ /**
+ * \name Conditional destination update control.
+ *
+ * \since
+ * NV_fragment_program, NV_fragment_program_option, NV_vertex_program2,
+ * NV_vertex_program2_option.
+ */
+ /*@{*/
+ /**
+ * Takes one of the 9 possible condition values (EQ, FL, GT, GE, LE, LT,
+ * NE, TR, or UN). Dest reg is only written to if the matching
+ * (swizzled) condition code value passes. When a conditional update mask
+ * is not specified, this will be \c COND_TR.
+ */
+ GLuint CondMask:4;
+
+ /**
+ * Condition code swizzle value.
+ */
+ GLuint CondSwizzle:12;
+
+ /**
+ * Selects the condition code register to use for conditional destination
+ * update masking. In NV_fragmnet_program or NV_vertex_program2 mode, only
+ * condition code register 0 is available. In NV_vertex_program3 mode,
+ * condition code registers 0 and 1 are available.
+ */
+ GLuint CondSrc:1;
+ /*@}*/
+};
+
+
+/**
+ * Vertex/fragment program instruction.
+ */
+struct prog_instruction
+{
+ gl_inst_opcode Opcode;
+ struct prog_src_register SrcReg[3];
+ struct prog_dst_register DstReg;
+
+ /**
+ * Indicates that the instruction should update the condition code
+ * register.
+ *
+ * \since
+ * NV_fragment_program, NV_fragment_program_option, NV_vertex_program2,
+ * NV_vertex_program2_option.
+ */
+ GLuint CondUpdate:1;
+
+ /**
+ * If prog_instruction::CondUpdate is \c GL_TRUE, this value selects the
+ * condition code register that is to be updated.
+ *
+ * In GL_NV_fragment_program or GL_NV_vertex_program2 mode, only condition
+ * code register 0 is available. In GL_NV_vertex_program3 mode, condition
+ * code registers 0 and 1 are available.
+ *
+ * \since
+ * NV_fragment_program, NV_fragment_program_option, NV_vertex_program2,
+ * NV_vertex_program2_option.
+ */
+ GLuint CondDst:1;
+
+ /**
+ * Saturate each value of the vectored result to the range [0,1] or the
+ * range [-1,1]. \c SSAT mode (i.e., saturation to the range [-1,1]) is
+ * only available in NV_fragment_program2 mode.
+ * Value is one of the SATURATE_* tokens.
+ *
+ * \since
+ * NV_fragment_program, NV_fragment_program_option, NV_vertex_program3.
+ */
+ GLuint SaturateMode:2;
+
+ /**
+ * Per-instruction selectable precision: FLOAT32, FLOAT16, FIXED12.
+ *
+ * \since
+ * NV_fragment_program, NV_fragment_program_option.
+ */
+ GLuint Precision:3;
+
+ /**
+ * \name Extra fields for TEX, TXB, TXD, TXL, TXP instructions.
+ */
+ /*@{*/
+ /** Source texture unit. */
+ GLuint TexSrcUnit:5;
+
+ /** Source texture target, one of TEXTURE_{1D,2D,3D,CUBE,RECT}_INDEX */
+ GLuint TexSrcTarget:3;
+
+ /** True if tex instruction should do shadow comparison */
+ GLuint TexShadow:1;
+ /*@}*/
+
+ /**
+ * For BRA and CAL instructions, the location to jump to.
+ * For BGNLOOP, points to ENDLOOP (and vice-versa).
+ * For BRK, points to ENDLOOP
+ * For IF, points to ELSE or ENDIF.
+ * For ELSE, points to ENDIF.
+ */
+ GLint BranchTarget;
+
+ /** for debugging purposes */
+ const char *Comment;
+
+ /** Arbitrary data. Used for OPCODE_PRINT and some drivers */
+ void *Data;
+
+ /** for driver use (try to remove someday) */
+ GLint Aux;
+};
+
+
+extern void
+_mesa_init_instructions(struct prog_instruction *inst, GLuint count);
+
+extern struct prog_instruction *
+_mesa_alloc_instructions(GLuint numInst);
+
+extern struct prog_instruction *
+_mesa_realloc_instructions(struct prog_instruction *oldInst,
+ GLuint numOldInst, GLuint numNewInst);
+
+extern struct prog_instruction *
+_mesa_copy_instructions(struct prog_instruction *dest,
+ const struct prog_instruction *src, GLuint n);
+
+extern void
+_mesa_free_instructions(struct prog_instruction *inst, GLuint count);
+
+extern GLuint
+_mesa_num_inst_src_regs(gl_inst_opcode opcode);
+
+extern GLuint
+_mesa_num_inst_dst_regs(gl_inst_opcode opcode);
+
+extern GLboolean
+_mesa_is_tex_instruction(gl_inst_opcode opcode);
+
+extern GLboolean
+_mesa_check_soa_dependencies(const struct prog_instruction *inst);
+
+extern const char *
+_mesa_opcode_string(gl_inst_opcode opcode);
+
+
+#endif /* PROG_INSTRUCTION_H */
diff --git a/mesalib/src/mesa/program/prog_optimize.c b/mesalib/src/mesa/program/prog_optimize.c
index 11debc485..8d95402bb 100644
--- a/mesalib/src/mesa/program/prog_optimize.c
+++ b/mesalib/src/mesa/program/prog_optimize.c
@@ -1,1350 +1,1350 @@
-/*
- * Mesa 3-D graphics library
- * Version: 7.5
- *
- * Copyright (C) 2009 VMware, Inc. All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * VMWARE BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-
-
-#include "main/glheader.h"
-#include "main/context.h"
-#include "main/macros.h"
-#include "program.h"
-#include "prog_instruction.h"
-#include "prog_optimize.h"
-#include "prog_print.h"
-
-
-#define MAX_LOOP_NESTING 50
-/* MAX_PROGRAM_TEMPS is a low number (256), and we want to be able to
- * register allocate many temporary values into that small number of
- * temps. So allow large temporary indices coming into the register
- * allocator.
- */
-#define REG_ALLOCATE_MAX_PROGRAM_TEMPS ((1 << INST_INDEX_BITS) - 1)
-
-static GLboolean dbg = GL_FALSE;
-
-#define NO_MASK 0xf
-
-/**
- * Returns the mask of channels (bitmask of WRITEMASK_X,Y,Z,W) which
- * are read from the given src in this instruction, We also provide
- * one optional masks which may mask other components in the dst
- * register
- */
-static GLuint
-get_src_arg_mask(const struct prog_instruction *inst,
- GLuint arg, GLuint dst_mask)
-{
- GLuint read_mask, channel_mask;
- GLuint comp;
-
- ASSERT(arg < _mesa_num_inst_src_regs(inst->Opcode));
-
- /* Form the dst register, find the written channels */
- if (inst->CondUpdate) {
- channel_mask = WRITEMASK_XYZW;
- }
- else {
- switch (inst->Opcode) {
- case OPCODE_MOV:
- case OPCODE_MIN:
- case OPCODE_MAX:
- case OPCODE_ABS:
- case OPCODE_ADD:
- case OPCODE_MAD:
- case OPCODE_MUL:
- case OPCODE_SUB:
- case OPCODE_CMP:
- case OPCODE_FLR:
- case OPCODE_FRC:
- case OPCODE_LRP:
- case OPCODE_SEQ:
- case OPCODE_SGE:
- case OPCODE_SGT:
- case OPCODE_SLE:
- case OPCODE_SLT:
- case OPCODE_SNE:
- case OPCODE_SSG:
- channel_mask = inst->DstReg.WriteMask & dst_mask;
- break;
- case OPCODE_RCP:
- case OPCODE_SIN:
- case OPCODE_COS:
- case OPCODE_RSQ:
- case OPCODE_POW:
- case OPCODE_EX2:
- case OPCODE_LOG:
- channel_mask = WRITEMASK_X;
- break;
- case OPCODE_DP2:
- channel_mask = WRITEMASK_XY;
- break;
- case OPCODE_DP3:
- case OPCODE_XPD:
- channel_mask = WRITEMASK_XYZ;
- break;
- default:
- channel_mask = WRITEMASK_XYZW;
- break;
- }
- }
-
- /* Now, given the src swizzle and the written channels, find which
- * components are actually read
- */
- read_mask = 0x0;
- for (comp = 0; comp < 4; ++comp) {
- const GLuint coord = GET_SWZ(inst->SrcReg[arg].Swizzle, comp);
- ASSERT(coord < 4);
- if (channel_mask & (1 << comp) && coord <= SWIZZLE_W)
- read_mask |= 1 << coord;
- }
-
- return read_mask;
-}
-
-
-/**
- * For a MOV instruction, compute a write mask when src register also has
- * a mask
- */
-static GLuint
-get_dst_mask_for_mov(const struct prog_instruction *mov, GLuint src_mask)
-{
- const GLuint mask = mov->DstReg.WriteMask;
- GLuint comp;
- GLuint updated_mask = 0x0;
-
- ASSERT(mov->Opcode == OPCODE_MOV);
-
- for (comp = 0; comp < 4; ++comp) {
- GLuint src_comp;
- if ((mask & (1 << comp)) == 0)
- continue;
- src_comp = GET_SWZ(mov->SrcReg[0].Swizzle, comp);
- if ((src_mask & (1 << src_comp)) == 0)
- continue;
- updated_mask |= 1 << comp;
- }
-
- return updated_mask;
-}
-
-
-/**
- * Ensure that the swizzle is regular. That is, all of the swizzle
- * terms are SWIZZLE_X,Y,Z,W and not SWIZZLE_ZERO or SWIZZLE_ONE.
- */
-static GLboolean
-is_swizzle_regular(GLuint swz)
-{
- return GET_SWZ(swz,0) <= SWIZZLE_W &&
- GET_SWZ(swz,1) <= SWIZZLE_W &&
- GET_SWZ(swz,2) <= SWIZZLE_W &&
- GET_SWZ(swz,3) <= SWIZZLE_W;
-}
-
-
-/**
- * In 'prog' remove instruction[i] if removeFlags[i] == TRUE.
- * \return number of instructions removed
- */
-static GLuint
-remove_instructions(struct gl_program *prog, const GLboolean *removeFlags)
-{
- GLint i, removeEnd = 0, removeCount = 0;
- GLuint totalRemoved = 0;
-
- /* go backward */
- for (i = prog->NumInstructions - 1; i >= 0; i--) {
- if (removeFlags[i]) {
- totalRemoved++;
- if (removeCount == 0) {
- /* begin a run of instructions to remove */
- removeEnd = i;
- removeCount = 1;
- }
- else {
- /* extend the run of instructions to remove */
- removeCount++;
- }
- }
- else {
- /* don't remove this instruction, but check if the preceeding
- * instructions are to be removed.
- */
- if (removeCount > 0) {
- GLint removeStart = removeEnd - removeCount + 1;
- _mesa_delete_instructions(prog, removeStart, removeCount);
- removeStart = removeCount = 0; /* reset removal info */
- }
- }
- }
- /* Finish removing if the first instruction was to be removed. */
- if (removeCount > 0) {
- GLint removeStart = removeEnd - removeCount + 1;
- _mesa_delete_instructions(prog, removeStart, removeCount);
- }
- return totalRemoved;
-}
-
-
-/**
- * Remap register indexes according to map.
- * \param prog the program to search/replace
- * \param file the type of register file to search/replace
- * \param map maps old register indexes to new indexes
- */
-static void
-replace_regs(struct gl_program *prog, gl_register_file file, const GLint map[])
-{
- GLuint i;
-
- for (i = 0; i < prog->NumInstructions; i++) {
- struct prog_instruction *inst = prog->Instructions + i;
- const GLuint numSrc = _mesa_num_inst_src_regs(inst->Opcode);
- GLuint j;
- for (j = 0; j < numSrc; j++) {
- if (inst->SrcReg[j].File == file) {
- GLuint index = inst->SrcReg[j].Index;
- ASSERT(map[index] >= 0);
- inst->SrcReg[j].Index = map[index];
- }
- }
- if (inst->DstReg.File == file) {
- const GLuint index = inst->DstReg.Index;
- ASSERT(map[index] >= 0);
- inst->DstReg.Index = map[index];
- }
- }
-}
-
-
-/**
- * Remove dead instructions from the given program.
- * This is very primitive for now. Basically look for temp registers
- * that are written to but never read. Remove any instructions that
- * write to such registers. Be careful with condition code setters.
- */
-static GLboolean
-_mesa_remove_dead_code_global(struct gl_program *prog)
-{
- GLboolean tempRead[REG_ALLOCATE_MAX_PROGRAM_TEMPS][4];
- GLboolean *removeInst; /* per-instruction removal flag */
- GLuint i, rem = 0, comp;
-
- memset(tempRead, 0, sizeof(tempRead));
-
- if (dbg) {
- printf("Optimize: Begin dead code removal\n");
- /*_mesa_print_program(prog);*/
- }
-
- removeInst = (GLboolean *)
- calloc(1, prog->NumInstructions * sizeof(GLboolean));
-
- /* Determine which temps are read and written */
- for (i = 0; i < prog->NumInstructions; i++) {
- const struct prog_instruction *inst = prog->Instructions + i;
- const GLuint numSrc = _mesa_num_inst_src_regs(inst->Opcode);
- GLuint j;
-
- /* check src regs */
- for (j = 0; j < numSrc; j++) {
- if (inst->SrcReg[j].File == PROGRAM_TEMPORARY) {
- const GLuint index = inst->SrcReg[j].Index;
- GLuint read_mask;
- ASSERT(index < REG_ALLOCATE_MAX_PROGRAM_TEMPS);
- read_mask = get_src_arg_mask(inst, j, NO_MASK);
-
- if (inst->SrcReg[j].RelAddr) {
- if (dbg)
- printf("abort remove dead code (indirect temp)\n");
- goto done;
- }
-
- for (comp = 0; comp < 4; comp++) {
- const GLuint swz = GET_SWZ(inst->SrcReg[j].Swizzle, comp);
- ASSERT(swz < 4);
- if ((read_mask & (1 << swz)) == 0)
- continue;
- if (swz <= SWIZZLE_W)
- tempRead[index][swz] = GL_TRUE;
- }
- }
- }
-
- /* check dst reg */
- if (inst->DstReg.File == PROGRAM_TEMPORARY) {
- const GLuint index = inst->DstReg.Index;
- ASSERT(index < REG_ALLOCATE_MAX_PROGRAM_TEMPS);
-
- if (inst->DstReg.RelAddr) {
- if (dbg)
- printf("abort remove dead code (indirect temp)\n");
- goto done;
- }
-
- if (inst->CondUpdate) {
- /* If we're writing to this register and setting condition
- * codes we cannot remove the instruction. Prevent removal
- * by setting the 'read' flag.
- */
- tempRead[index][0] = GL_TRUE;
- tempRead[index][1] = GL_TRUE;
- tempRead[index][2] = GL_TRUE;
- tempRead[index][3] = GL_TRUE;
- }
- }
- }
-
- /* find instructions that write to dead registers, flag for removal */
- for (i = 0; i < prog->NumInstructions; i++) {
- struct prog_instruction *inst = prog->Instructions + i;
- const GLuint numDst = _mesa_num_inst_dst_regs(inst->Opcode);
-
- if (numDst != 0 && inst->DstReg.File == PROGRAM_TEMPORARY) {
- GLint chan, index = inst->DstReg.Index;
-
- for (chan = 0; chan < 4; chan++) {
- if (!tempRead[index][chan] &&
- inst->DstReg.WriteMask & (1 << chan)) {
- if (dbg) {
- printf("Remove writemask on %u.%c\n", i,
- chan == 3 ? 'w' : 'x' + chan);
- }
- inst->DstReg.WriteMask &= ~(1 << chan);
- rem++;
- }
- }
-
- if (inst->DstReg.WriteMask == 0) {
- /* If we cleared all writes, the instruction can be removed. */
- if (dbg)
- printf("Remove instruction %u: \n", i);
- removeInst[i] = GL_TRUE;
- }
- }
- }
-
- /* now remove the instructions which aren't needed */
- rem = remove_instructions(prog, removeInst);
-
- if (dbg) {
- printf("Optimize: End dead code removal.\n");
- printf(" %u channel writes removed\n", rem);
- printf(" %u instructions removed\n", rem);
- /*_mesa_print_program(prog);*/
- }
-
-done:
- free(removeInst);
- return rem != 0;
-}
-
-
-enum inst_use
-{
- READ,
- WRITE,
- FLOW,
- END
-};
-
-
-/**
- * Scan forward in program from 'start' for the next occurances of TEMP[index].
- * We look if an instruction reads the component given by the masks and if they
- * are overwritten.
- * Return READ, WRITE, FLOW or END to indicate the next usage or an indicator
- * that we can't look further.
- */
-static enum inst_use
-find_next_use(const struct gl_program *prog,
- GLuint start,
- GLuint index,
- GLuint mask)
-{
- GLuint i;
-
- for (i = start; i < prog->NumInstructions; i++) {
- const struct prog_instruction *inst = prog->Instructions + i;
- switch (inst->Opcode) {
- case OPCODE_BGNLOOP:
- case OPCODE_BGNSUB:
- case OPCODE_BRA:
- case OPCODE_CAL:
- case OPCODE_CONT:
- case OPCODE_IF:
- case OPCODE_ELSE:
- case OPCODE_ENDIF:
- case OPCODE_ENDLOOP:
- case OPCODE_ENDSUB:
- case OPCODE_RET:
- return FLOW;
- case OPCODE_END:
- return END;
- default:
- {
- const GLuint numSrc = _mesa_num_inst_src_regs(inst->Opcode);
- GLuint j;
- for (j = 0; j < numSrc; j++) {
- if (inst->SrcReg[j].RelAddr ||
- (inst->SrcReg[j].File == PROGRAM_TEMPORARY &&
- inst->SrcReg[j].Index == index &&
- (get_src_arg_mask(inst,j,NO_MASK) & mask)))
- return READ;
- }
- if (_mesa_num_inst_dst_regs(inst->Opcode) == 1 &&
- inst->DstReg.File == PROGRAM_TEMPORARY &&
- inst->DstReg.Index == index) {
- mask &= ~inst->DstReg.WriteMask;
- if (mask == 0)
- return WRITE;
- }
- }
- }
- }
- return END;
-}
-
-
-/**
- * Is the given instruction opcode a flow-control opcode?
- * XXX maybe move this into prog_instruction.[ch]
- */
-static GLboolean
-_mesa_is_flow_control_opcode(enum prog_opcode opcode)
-{
- switch (opcode) {
- case OPCODE_BGNLOOP:
- case OPCODE_BGNSUB:
- case OPCODE_BRA:
- case OPCODE_CAL:
- case OPCODE_CONT:
- case OPCODE_IF:
- case OPCODE_ELSE:
- case OPCODE_END:
- case OPCODE_ENDIF:
- case OPCODE_ENDLOOP:
- case OPCODE_ENDSUB:
- case OPCODE_RET:
- return GL_TRUE;
- default:
- return GL_FALSE;
- }
-}
-
-
-/**
- * Test if the given instruction is a simple MOV (no conditional updating,
- * not relative addressing, no negation/abs, etc).
- */
-static GLboolean
-can_downward_mov_be_modifed(const struct prog_instruction *mov)
-{
- return
- mov->Opcode == OPCODE_MOV &&
- mov->CondUpdate == GL_FALSE &&
- mov->SrcReg[0].RelAddr == 0 &&
- mov->SrcReg[0].Negate == 0 &&
- mov->SrcReg[0].Abs == 0 &&
- mov->SrcReg[0].HasIndex2 == 0 &&
- mov->SrcReg[0].RelAddr2 == 0 &&
- mov->DstReg.RelAddr == 0 &&
- mov->DstReg.CondMask == COND_TR &&
- mov->SaturateMode == SATURATE_OFF;
-}
-
-
-static GLboolean
-can_upward_mov_be_modifed(const struct prog_instruction *mov)
-{
- return
- can_downward_mov_be_modifed(mov) &&
- mov->DstReg.File == PROGRAM_TEMPORARY;
-}
-
-
-/**
- * Try to remove use of extraneous MOV instructions, to free them up for dead
- * code removal.
- */
-static void
-_mesa_remove_extra_move_use(struct gl_program *prog)
-{
- GLuint i, j;
-
- if (dbg) {
- printf("Optimize: Begin remove extra move use\n");
- _mesa_print_program(prog);
- }
-
- /*
- * Look for sequences such as this:
- * MOV tmpX, arg0;
- * ...
- * FOO tmpY, tmpX, arg1;
- * and convert into:
- * MOV tmpX, arg0;
- * ...
- * FOO tmpY, arg0, arg1;
- */
-
- for (i = 0; i + 1 < prog->NumInstructions; i++) {
- const struct prog_instruction *mov = prog->Instructions + i;
- GLuint dst_mask, src_mask;
- if (can_upward_mov_be_modifed(mov) == GL_FALSE)
- continue;
-
- /* Scanning the code, we maintain the components which are still active in
- * these two masks
- */
- dst_mask = mov->DstReg.WriteMask;
- src_mask = get_src_arg_mask(mov, 0, NO_MASK);
-
- /* Walk through remaining instructions until the or src reg gets
- * rewritten or we get into some flow-control, eliminating the use of
- * this MOV.
- */
- for (j = i + 1; j < prog->NumInstructions; j++) {
- struct prog_instruction *inst2 = prog->Instructions + j;
- GLuint arg;
-
- if (_mesa_is_flow_control_opcode(inst2->Opcode))
- break;
-
- /* First rewrite this instruction's args if appropriate. */
- for (arg = 0; arg < _mesa_num_inst_src_regs(inst2->Opcode); arg++) {
- GLuint comp, read_mask;
-
- if (inst2->SrcReg[arg].File != mov->DstReg.File ||
- inst2->SrcReg[arg].Index != mov->DstReg.Index ||
- inst2->SrcReg[arg].RelAddr ||
- inst2->SrcReg[arg].Abs)
- continue;
- read_mask = get_src_arg_mask(inst2, arg, NO_MASK);
-
- /* Adjust the swizzles of inst2 to point at MOV's source if ALL the
- * components read still come from the mov instructions
- */
- if (is_swizzle_regular(inst2->SrcReg[arg].Swizzle) &&
- (read_mask & dst_mask) == read_mask) {
- for (comp = 0; comp < 4; comp++) {
- const GLuint inst2_swz =
- GET_SWZ(inst2->SrcReg[arg].Swizzle, comp);
- const GLuint s = GET_SWZ(mov->SrcReg[0].Swizzle, inst2_swz);
- inst2->SrcReg[arg].Swizzle &= ~(7 << (3 * comp));
- inst2->SrcReg[arg].Swizzle |= s << (3 * comp);
- inst2->SrcReg[arg].Negate ^= (((mov->SrcReg[0].Negate >>
- inst2_swz) & 0x1) << comp);
- }
- inst2->SrcReg[arg].File = mov->SrcReg[0].File;
- inst2->SrcReg[arg].Index = mov->SrcReg[0].Index;
- }
- }
-
- /* The source of MOV is written. This potentially deactivates some
- * components from the src and dst of the MOV instruction
- */
- if (inst2->DstReg.File == mov->DstReg.File &&
- (inst2->DstReg.RelAddr ||
- inst2->DstReg.Index == mov->DstReg.Index)) {
- dst_mask &= ~inst2->DstReg.WriteMask;
- src_mask = get_src_arg_mask(mov, 0, dst_mask);
- }
-
- /* Idem when the destination of mov is written */
- if (inst2->DstReg.File == mov->SrcReg[0].File &&
- (inst2->DstReg.RelAddr ||
- inst2->DstReg.Index == mov->SrcReg[0].Index)) {
- src_mask &= ~inst2->DstReg.WriteMask;
- dst_mask &= get_dst_mask_for_mov(mov, src_mask);
- }
- if (dst_mask == 0)
- break;
- }
- }
-
- if (dbg) {
- printf("Optimize: End remove extra move use.\n");
- /*_mesa_print_program(prog);*/
- }
-}
-
-
-/**
- * Complements dead_code_global. Try to remove code in block of code by
- * carefully monitoring the swizzles. Both functions should be merged into one
- * with a proper control flow graph
- */
-static GLboolean
-_mesa_remove_dead_code_local(struct gl_program *prog)
-{
- GLboolean *removeInst;
- GLuint i, arg, rem = 0;
-
- removeInst = (GLboolean *)
- calloc(1, prog->NumInstructions * sizeof(GLboolean));
-
- for (i = 0; i < prog->NumInstructions; i++) {
- const struct prog_instruction *inst = prog->Instructions + i;
- const GLuint index = inst->DstReg.Index;
- const GLuint mask = inst->DstReg.WriteMask;
- enum inst_use use;
-
- /* We must deactivate the pass as soon as some indirection is used */
- if (inst->DstReg.RelAddr)
- goto done;
- for (arg = 0; arg < _mesa_num_inst_src_regs(inst->Opcode); arg++)
- if (inst->SrcReg[arg].RelAddr)
- goto done;
-
- if (_mesa_is_flow_control_opcode(inst->Opcode) ||
- _mesa_num_inst_dst_regs(inst->Opcode) == 0 ||
- inst->DstReg.File != PROGRAM_TEMPORARY ||
- inst->DstReg.RelAddr)
- continue;
-
- use = find_next_use(prog, i+1, index, mask);
- if (use == WRITE || use == END)
- removeInst[i] = GL_TRUE;
- }
-
- rem = remove_instructions(prog, removeInst);
-
-done:
- free(removeInst);
- return rem != 0;
-}
-
-
-/**
- * Try to inject the destination of mov as the destination of inst and recompute
- * the swizzles operators for the sources of inst if required. Return GL_TRUE
- * of the substitution was possible, GL_FALSE otherwise
- */
-static GLboolean
-_mesa_merge_mov_into_inst(struct prog_instruction *inst,
- const struct prog_instruction *mov)
-{
- /* Indirection table which associates destination and source components for
- * the mov instruction
- */
- const GLuint mask = get_src_arg_mask(mov, 0, NO_MASK);
-
- /* Some components are not written by inst. We cannot remove the mov */
- if (mask != (inst->DstReg.WriteMask & mask))
- return GL_FALSE;
-
- /* Depending on the instruction, we may need to recompute the swizzles.
- * Also, some other instructions (like TEX) are not linear. We will only
- * consider completely active sources and destinations
- */
- switch (inst->Opcode) {
-
- /* Carstesian instructions: we compute the swizzle */
- case OPCODE_MOV:
- case OPCODE_MIN:
- case OPCODE_MAX:
- case OPCODE_ABS:
- case OPCODE_ADD:
- case OPCODE_MAD:
- case OPCODE_MUL:
- case OPCODE_SUB:
- {
- GLuint dst_to_src_comp[4] = {0,0,0,0};
- GLuint dst_comp, arg;
- for (dst_comp = 0; dst_comp < 4; ++dst_comp) {
- if (mov->DstReg.WriteMask & (1 << dst_comp)) {
- const GLuint src_comp = GET_SWZ(mov->SrcReg[0].Swizzle, dst_comp);
- ASSERT(src_comp < 4);
- dst_to_src_comp[dst_comp] = src_comp;
- }
- }
-
- /* Patch each source of the instruction */
- for (arg = 0; arg < _mesa_num_inst_src_regs(inst->Opcode); arg++) {
- const GLuint arg_swz = inst->SrcReg[arg].Swizzle;
- inst->SrcReg[arg].Swizzle = 0;
-
- /* Reset each active component of the swizzle */
- for (dst_comp = 0; dst_comp < 4; ++dst_comp) {
- GLuint src_comp, arg_comp;
- if ((mov->DstReg.WriteMask & (1 << dst_comp)) == 0)
- continue;
- src_comp = dst_to_src_comp[dst_comp];
- ASSERT(src_comp < 4);
- arg_comp = GET_SWZ(arg_swz, src_comp);
- ASSERT(arg_comp < 4);
- inst->SrcReg[arg].Swizzle |= arg_comp << (3*dst_comp);
- }
- }
- inst->DstReg = mov->DstReg;
- return GL_TRUE;
- }
-
- /* Dot products and scalar instructions: we only change the destination */
- case OPCODE_RCP:
- case OPCODE_SIN:
- case OPCODE_COS:
- case OPCODE_RSQ:
- case OPCODE_POW:
- case OPCODE_EX2:
- case OPCODE_LOG:
- case OPCODE_DP2:
- case OPCODE_DP3:
- case OPCODE_DP4:
- inst->DstReg = mov->DstReg;
- return GL_TRUE;
-
- /* All other instructions require fully active components with no swizzle */
- default:
- if (mov->SrcReg[0].Swizzle != SWIZZLE_XYZW ||
- inst->DstReg.WriteMask != WRITEMASK_XYZW)
- return GL_FALSE;
- inst->DstReg = mov->DstReg;
- return GL_TRUE;
- }
-}
-
-
-/**
- * Try to remove extraneous MOV instructions from the given program.
- */
-static GLboolean
-_mesa_remove_extra_moves(struct gl_program *prog)
-{
- GLboolean *removeInst; /* per-instruction removal flag */
- GLuint i, rem = 0, nesting = 0;
-
- if (dbg) {
- printf("Optimize: Begin remove extra moves\n");
- _mesa_print_program(prog);
- }
-
- removeInst = (GLboolean *)
- calloc(1, prog->NumInstructions * sizeof(GLboolean));
-
- /*
- * Look for sequences such as this:
- * FOO tmpX, arg0, arg1;
- * MOV tmpY, tmpX;
- * and convert into:
- * FOO tmpY, arg0, arg1;
- */
-
- for (i = 0; i < prog->NumInstructions; i++) {
- const struct prog_instruction *mov = prog->Instructions + i;
-
- switch (mov->Opcode) {
- case OPCODE_BGNLOOP:
- case OPCODE_BGNSUB:
- case OPCODE_IF:
- nesting++;
- break;
- case OPCODE_ENDLOOP:
- case OPCODE_ENDSUB:
- case OPCODE_ENDIF:
- nesting--;
- break;
- case OPCODE_MOV:
- if (i > 0 &&
- can_downward_mov_be_modifed(mov) &&
- mov->SrcReg[0].File == PROGRAM_TEMPORARY &&
- nesting == 0)
- {
-
- /* see if this MOV can be removed */
- const GLuint id = mov->SrcReg[0].Index;
- struct prog_instruction *prevInst;
- GLuint prevI;
-
- /* get pointer to previous instruction */
- prevI = i - 1;
- while (prevI > 0 && removeInst[prevI])
- prevI--;
- prevInst = prog->Instructions + prevI;
-
- if (prevInst->DstReg.File == PROGRAM_TEMPORARY &&
- prevInst->DstReg.Index == id &&
- prevInst->DstReg.RelAddr == 0 &&
- prevInst->DstReg.CondSrc == 0 &&
- prevInst->DstReg.CondMask == COND_TR) {
-
- const GLuint dst_mask = prevInst->DstReg.WriteMask;
- enum inst_use next_use = find_next_use(prog, i+1, id, dst_mask);
-
- if (next_use == WRITE || next_use == END) {
- /* OK, we can safely remove this MOV instruction.
- * Transform:
- * prevI: FOO tempIndex, x, y;
- * i: MOV z, tempIndex;
- * Into:
- * prevI: FOO z, x, y;
- */
- if (_mesa_merge_mov_into_inst(prevInst, mov)) {
- removeInst[i] = GL_TRUE;
- if (dbg) {
- printf("Remove MOV at %u\n", i);
- printf("new prev inst %u: ", prevI);
- _mesa_print_instruction(prevInst);
- }
- }
- }
- }
- }
- break;
- default:
- ; /* nothing */
- }
- }
-
- /* now remove the instructions which aren't needed */
- rem = remove_instructions(prog, removeInst);
-
- free(removeInst);
-
- if (dbg) {
- printf("Optimize: End remove extra moves. %u instructions removed\n", rem);
- /*_mesa_print_program(prog);*/
- }
-
- return rem != 0;
-}
-
-
-/** A live register interval */
-struct interval
-{
- GLuint Reg; /** The temporary register index */
- GLuint Start, End; /** Start/end instruction numbers */
-};
-
-
-/** A list of register intervals */
-struct interval_list
-{
- GLuint Num;
- struct interval Intervals[REG_ALLOCATE_MAX_PROGRAM_TEMPS];
-};
-
-
-static void
-append_interval(struct interval_list *list, const struct interval *inv)
-{
- list->Intervals[list->Num++] = *inv;
-}
-
-
-/** Insert interval inv into list, sorted by interval end */
-static void
-insert_interval_by_end(struct interval_list *list, const struct interval *inv)
-{
- /* XXX we could do a binary search insertion here since list is sorted */
- GLint i = list->Num - 1;
- while (i >= 0 && list->Intervals[i].End > inv->End) {
- list->Intervals[i + 1] = list->Intervals[i];
- i--;
- }
- list->Intervals[i + 1] = *inv;
- list->Num++;
-
-#ifdef DEBUG
- {
- GLuint i;
- for (i = 0; i + 1 < list->Num; i++) {
- ASSERT(list->Intervals[i].End <= list->Intervals[i + 1].End);
- }
- }
-#endif
-}
-
-
-/** Remove the given interval from the interval list */
-static void
-remove_interval(struct interval_list *list, const struct interval *inv)
-{
- /* XXX we could binary search since list is sorted */
- GLuint k;
- for (k = 0; k < list->Num; k++) {
- if (list->Intervals[k].Reg == inv->Reg) {
- /* found, remove it */
- ASSERT(list->Intervals[k].Start == inv->Start);
- ASSERT(list->Intervals[k].End == inv->End);
- while (k < list->Num - 1) {
- list->Intervals[k] = list->Intervals[k + 1];
- k++;
- }
- list->Num--;
- return;
- }
- }
-}
-
-
-/** called by qsort() */
-static int
-compare_start(const void *a, const void *b)
-{
- const struct interval *ia = (const struct interval *) a;
- const struct interval *ib = (const struct interval *) b;
- if (ia->Start < ib->Start)
- return -1;
- else if (ia->Start > ib->Start)
- return +1;
- else
- return 0;
-}
-
-
-/** sort the interval list according to interval starts */
-static void
-sort_interval_list_by_start(struct interval_list *list)
-{
- qsort(list->Intervals, list->Num, sizeof(struct interval), compare_start);
-#ifdef DEBUG
- {
- GLuint i;
- for (i = 0; i + 1 < list->Num; i++) {
- ASSERT(list->Intervals[i].Start <= list->Intervals[i + 1].Start);
- }
- }
-#endif
-}
-
-struct loop_info
-{
- GLuint Start, End; /**< Start, end instructions of loop */
-};
-
-/**
- * Update the intermediate interval info for register 'index' and
- * instruction 'ic'.
- */
-static void
-update_interval(GLint intBegin[], GLint intEnd[],
- struct loop_info *loopStack, GLuint loopStackDepth,
- GLuint index, GLuint ic)
-{
- int i;
- GLuint begin = ic;
- GLuint end = ic;
-
- /* If the register is used in a loop, extend its lifetime through the end
- * of the outermost loop that doesn't contain its definition.
- */
- for (i = 0; i < loopStackDepth; i++) {
- if (intBegin[index] < loopStack[i].Start) {
- end = loopStack[i].End;
- break;
- }
- }
-
- /* Variables that are live at the end of a loop will also be live at the
- * beginning, so an instruction inside of a loop should have its live
- * interval begin at the start of the outermost loop.
- */
- if (loopStackDepth > 0 && ic > loopStack[0].Start && ic < loopStack[0].End) {
- begin = loopStack[0].Start;
- }
-
- ASSERT(index < REG_ALLOCATE_MAX_PROGRAM_TEMPS);
- if (intBegin[index] == -1) {
- ASSERT(intEnd[index] == -1);
- intBegin[index] = begin;
- intEnd[index] = end;
- }
- else {
- intEnd[index] = end;
- }
-}
-
-
-/**
- * Find first/last instruction that references each temporary register.
- */
-GLboolean
-_mesa_find_temp_intervals(const struct prog_instruction *instructions,
- GLuint numInstructions,
- GLint intBegin[REG_ALLOCATE_MAX_PROGRAM_TEMPS],
- GLint intEnd[REG_ALLOCATE_MAX_PROGRAM_TEMPS])
-{
- struct loop_info loopStack[MAX_LOOP_NESTING];
- GLuint loopStackDepth = 0;
- GLuint i;
-
- for (i = 0; i < REG_ALLOCATE_MAX_PROGRAM_TEMPS; i++){
- intBegin[i] = intEnd[i] = -1;
- }
-
- /* Scan instructions looking for temporary registers */
- for (i = 0; i < numInstructions; i++) {
- const struct prog_instruction *inst = instructions + i;
- if (inst->Opcode == OPCODE_BGNLOOP) {
- loopStack[loopStackDepth].Start = i;
- loopStack[loopStackDepth].End = inst->BranchTarget;
- loopStackDepth++;
- }
- else if (inst->Opcode == OPCODE_ENDLOOP) {
- loopStackDepth--;
- }
- else if (inst->Opcode == OPCODE_CAL) {
- return GL_FALSE;
- }
- else {
- const GLuint numSrc = 3;/*_mesa_num_inst_src_regs(inst->Opcode);*/
- GLuint j;
- for (j = 0; j < numSrc; j++) {
- if (inst->SrcReg[j].File == PROGRAM_TEMPORARY) {
- const GLuint index = inst->SrcReg[j].Index;
- if (inst->SrcReg[j].RelAddr)
- return GL_FALSE;
- update_interval(intBegin, intEnd, loopStack, loopStackDepth,
- index, i);
- }
- }
- if (inst->DstReg.File == PROGRAM_TEMPORARY) {
- const GLuint index = inst->DstReg.Index;
- if (inst->DstReg.RelAddr)
- return GL_FALSE;
- update_interval(intBegin, intEnd, loopStack, loopStackDepth,
- index, i);
- }
- }
- }
-
- return GL_TRUE;
-}
-
-
-/**
- * Find the live intervals for each temporary register in the program.
- * For register R, the interval [A,B] indicates that R is referenced
- * from instruction A through instruction B.
- * Special consideration is needed for loops and subroutines.
- * \return GL_TRUE if success, GL_FALSE if we cannot proceed for some reason
- */
-static GLboolean
-find_live_intervals(struct gl_program *prog,
- struct interval_list *liveIntervals)
-{
- GLint intBegin[REG_ALLOCATE_MAX_PROGRAM_TEMPS];
- GLint intEnd[REG_ALLOCATE_MAX_PROGRAM_TEMPS];
- GLuint i;
-
- /*
- * Note: we'll return GL_FALSE below if we find relative indexing
- * into the TEMP register file. We can't handle that yet.
- * We also give up on subroutines for now.
- */
-
- if (dbg) {
- printf("Optimize: Begin find intervals\n");
- }
-
- /* build intermediate arrays */
- if (!_mesa_find_temp_intervals(prog->Instructions, prog->NumInstructions,
- intBegin, intEnd))
- return GL_FALSE;
-
- /* Build live intervals list from intermediate arrays */
- liveIntervals->Num = 0;
- for (i = 0; i < REG_ALLOCATE_MAX_PROGRAM_TEMPS; i++) {
- if (intBegin[i] >= 0) {
- struct interval inv;
- inv.Reg = i;
- inv.Start = intBegin[i];
- inv.End = intEnd[i];
- append_interval(liveIntervals, &inv);
- }
- }
-
- /* Sort the list according to interval starts */
- sort_interval_list_by_start(liveIntervals);
-
- if (dbg) {
- /* print interval info */
- for (i = 0; i < liveIntervals->Num; i++) {
- const struct interval *inv = liveIntervals->Intervals + i;
- printf("Reg[%d] live [%d, %d]:",
- inv->Reg, inv->Start, inv->End);
- if (1) {
- GLuint j;
- for (j = 0; j < inv->Start; j++)
- printf(" ");
- for (j = inv->Start; j <= inv->End; j++)
- printf("x");
- }
- printf("\n");
- }
- }
-
- return GL_TRUE;
-}
-
-
-/** Scan the array of used register flags to find free entry */
-static GLint
-alloc_register(GLboolean usedRegs[REG_ALLOCATE_MAX_PROGRAM_TEMPS])
-{
- GLuint k;
- for (k = 0; k < REG_ALLOCATE_MAX_PROGRAM_TEMPS; k++) {
- if (!usedRegs[k]) {
- usedRegs[k] = GL_TRUE;
- return k;
- }
- }
- return -1;
-}
-
-
-/**
- * This function implements "Linear Scan Register Allocation" to reduce
- * the number of temporary registers used by the program.
- *
- * We compute the "live interval" for all temporary registers then
- * examine the overlap of the intervals to allocate new registers.
- * Basically, if two intervals do not overlap, they can use the same register.
- */
-static void
-_mesa_reallocate_registers(struct gl_program *prog)
-{
- struct interval_list liveIntervals;
- GLint registerMap[REG_ALLOCATE_MAX_PROGRAM_TEMPS];
- GLboolean usedRegs[REG_ALLOCATE_MAX_PROGRAM_TEMPS];
- GLuint i;
- GLint maxTemp = -1;
-
- if (dbg) {
- printf("Optimize: Begin live-interval register reallocation\n");
- _mesa_print_program(prog);
- }
-
- for (i = 0; i < REG_ALLOCATE_MAX_PROGRAM_TEMPS; i++){
- registerMap[i] = -1;
- usedRegs[i] = GL_FALSE;
- }
-
- if (!find_live_intervals(prog, &liveIntervals)) {
- if (dbg)
- printf("Aborting register reallocation\n");
- return;
- }
-
- {
- struct interval_list activeIntervals;
- activeIntervals.Num = 0;
-
- /* loop over live intervals, allocating a new register for each */
- for (i = 0; i < liveIntervals.Num; i++) {
- const struct interval *live = liveIntervals.Intervals + i;
-
- if (dbg)
- printf("Consider register %u\n", live->Reg);
-
- /* Expire old intervals. Intervals which have ended with respect
- * to the live interval can have their remapped registers freed.
- */
- {
- GLint j;
- for (j = 0; j < (GLint) activeIntervals.Num; j++) {
- const struct interval *inv = activeIntervals.Intervals + j;
- if (inv->End >= live->Start) {
- /* Stop now. Since the activeInterval list is sorted
- * we know we don't have to go further.
- */
- break;
- }
- else {
- /* Interval 'inv' has expired */
- const GLint regNew = registerMap[inv->Reg];
- ASSERT(regNew >= 0);
-
- if (dbg)
- printf(" expire interval for reg %u\n", inv->Reg);
-
- /* remove interval j from active list */
- remove_interval(&activeIntervals, inv);
- j--; /* counter-act j++ in for-loop above */
-
- /* return register regNew to the free pool */
- if (dbg)
- printf(" free reg %d\n", regNew);
- ASSERT(usedRegs[regNew] == GL_TRUE);
- usedRegs[regNew] = GL_FALSE;
- }
- }
- }
-
- /* find a free register for this live interval */
- {
- const GLint k = alloc_register(usedRegs);
- if (k < 0) {
- /* out of registers, give up */
- return;
- }
- registerMap[live->Reg] = k;
- maxTemp = MAX2(maxTemp, k);
- if (dbg)
- printf(" remap register %u -> %d\n", live->Reg, k);
- }
-
- /* Insert this live interval into the active list which is sorted
- * by increasing end points.
- */
- insert_interval_by_end(&activeIntervals, live);
- }
- }
-
- if (maxTemp + 1 < (GLint) liveIntervals.Num) {
- /* OK, we've reduced the number of registers needed.
- * Scan the program and replace all the old temporary register
- * indexes with the new indexes.
- */
- replace_regs(prog, PROGRAM_TEMPORARY, registerMap);
-
- prog->NumTemporaries = maxTemp + 1;
- }
-
- if (dbg) {
- printf("Optimize: End live-interval register reallocation\n");
- printf("Num temp regs before: %u after: %u\n",
- liveIntervals.Num, maxTemp + 1);
- _mesa_print_program(prog);
- }
-}
-
-
-#if 0
-static void
-print_it(struct gl_context *ctx, struct gl_program *program, const char *txt) {
- fprintf(stderr, "%s (%u inst):\n", txt, program->NumInstructions);
- _mesa_print_program(program);
- _mesa_print_program_parameters(ctx, program);
- fprintf(stderr, "\n\n");
-}
-#endif
-
-/**
- * This pass replaces CMP T0, T1 T2 T0 with MOV T0, T2 when the CMP
- * instruction is the first instruction to write to register T0. The are
- * several lowering passes done in GLSL IR (e.g. branches and
- * relative addressing) that create a large number of conditional assignments
- * that ir_to_mesa converts to CMP instructions like the one mentioned above.
- *
- * Here is why this conversion is safe:
- * CMP T0, T1 T2 T0 can be expanded to:
- * if (T1 < 0.0)
- * MOV T0, T2;
- * else
- * MOV T0, T0;
- *
- * If (T1 < 0.0) evaluates to true then our replacement MOV T0, T2 is the same
- * as the original program. If (T1 < 0.0) evaluates to false, executing
- * MOV T0, T0 will store a garbage value in T0 since T0 is uninitialized.
- * Therefore, it doesn't matter that we are replacing MOV T0, T0 with MOV T0, T2
- * because any instruction that was going to read from T0 after this was going
- * to read a garbage value anyway.
- */
-static void
-_mesa_simplify_cmp(struct gl_program * program)
-{
- GLuint tempWrites[REG_ALLOCATE_MAX_PROGRAM_TEMPS];
- GLuint outputWrites[MAX_PROGRAM_OUTPUTS];
- GLuint i;
-
- if (dbg) {
- printf("Optimize: Begin reads without writes\n");
- _mesa_print_program(program);
- }
-
- for (i = 0; i < REG_ALLOCATE_MAX_PROGRAM_TEMPS; i++) {
- tempWrites[i] = 0;
- }
-
- for (i = 0; i < MAX_PROGRAM_OUTPUTS; i++) {
- outputWrites[i] = 0;
- }
-
- for (i = 0; i < program->NumInstructions; i++) {
- struct prog_instruction *inst = program->Instructions + i;
- GLuint prevWriteMask;
-
- /* Give up if we encounter relative addressing or flow control. */
- if (_mesa_is_flow_control_opcode(inst->Opcode) || inst->DstReg.RelAddr) {
- return;
- }
-
- if (inst->DstReg.File == PROGRAM_OUTPUT) {
- assert(inst->DstReg.Index < MAX_PROGRAM_OUTPUTS);
- prevWriteMask = outputWrites[inst->DstReg.Index];
- outputWrites[inst->DstReg.Index] |= inst->DstReg.WriteMask;
- } else if (inst->DstReg.File == PROGRAM_TEMPORARY) {
- assert(inst->DstReg.Index < REG_ALLOCATE_MAX_PROGRAM_TEMPS);
- prevWriteMask = tempWrites[inst->DstReg.Index];
- tempWrites[inst->DstReg.Index] |= inst->DstReg.WriteMask;
- }
-
- /* For a CMP to be considered a conditional write, the destination
- * register and source register two must be the same. */
- if (inst->Opcode == OPCODE_CMP
- && !(inst->DstReg.WriteMask & prevWriteMask)
- && inst->SrcReg[2].File == inst->DstReg.File
- && inst->SrcReg[2].Index == inst->DstReg.Index
- && inst->DstReg.WriteMask == get_src_arg_mask(inst, 2, NO_MASK)) {
-
- inst->Opcode = OPCODE_MOV;
- inst->SrcReg[0] = inst->SrcReg[1];
- }
- }
- if (dbg) {
- printf("Optimize: End reads without writes\n");
- _mesa_print_program(program);
- }
-}
-
-/**
- * Apply optimizations to the given program to eliminate unnecessary
- * instructions, temp regs, etc.
- */
-void
-_mesa_optimize_program(struct gl_context *ctx, struct gl_program *program)
-{
- GLboolean any_change;
-
- _mesa_simplify_cmp(program);
- /* Stop when no modifications were output */
- do {
- any_change = GL_FALSE;
- _mesa_remove_extra_move_use(program);
- if (_mesa_remove_dead_code_global(program))
- any_change = GL_TRUE;
- if (_mesa_remove_extra_moves(program))
- any_change = GL_TRUE;
- if (_mesa_remove_dead_code_local(program))
- any_change = GL_TRUE;
- _mesa_reallocate_registers(program);
- } while (any_change);
-}
-
+/*
+ * Mesa 3-D graphics library
+ * Version: 7.5
+ *
+ * Copyright (C) 2009 VMware, Inc. All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * VMWARE BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+
+
+#include "main/glheader.h"
+#include "main/context.h"
+#include "main/macros.h"
+#include "program.h"
+#include "prog_instruction.h"
+#include "prog_optimize.h"
+#include "prog_print.h"
+
+
+#define MAX_LOOP_NESTING 50
+/* MAX_PROGRAM_TEMPS is a low number (256), and we want to be able to
+ * register allocate many temporary values into that small number of
+ * temps. So allow large temporary indices coming into the register
+ * allocator.
+ */
+#define REG_ALLOCATE_MAX_PROGRAM_TEMPS ((1 << INST_INDEX_BITS) - 1)
+
+static GLboolean dbg = GL_FALSE;
+
+#define NO_MASK 0xf
+
+/**
+ * Returns the mask of channels (bitmask of WRITEMASK_X,Y,Z,W) which
+ * are read from the given src in this instruction, We also provide
+ * one optional masks which may mask other components in the dst
+ * register
+ */
+static GLuint
+get_src_arg_mask(const struct prog_instruction *inst,
+ GLuint arg, GLuint dst_mask)
+{
+ GLuint read_mask, channel_mask;
+ GLuint comp;
+
+ ASSERT(arg < _mesa_num_inst_src_regs(inst->Opcode));
+
+ /* Form the dst register, find the written channels */
+ if (inst->CondUpdate) {
+ channel_mask = WRITEMASK_XYZW;
+ }
+ else {
+ switch (inst->Opcode) {
+ case OPCODE_MOV:
+ case OPCODE_MIN:
+ case OPCODE_MAX:
+ case OPCODE_ABS:
+ case OPCODE_ADD:
+ case OPCODE_MAD:
+ case OPCODE_MUL:
+ case OPCODE_SUB:
+ case OPCODE_CMP:
+ case OPCODE_FLR:
+ case OPCODE_FRC:
+ case OPCODE_LRP:
+ case OPCODE_SEQ:
+ case OPCODE_SGE:
+ case OPCODE_SGT:
+ case OPCODE_SLE:
+ case OPCODE_SLT:
+ case OPCODE_SNE:
+ case OPCODE_SSG:
+ channel_mask = inst->DstReg.WriteMask & dst_mask;
+ break;
+ case OPCODE_RCP:
+ case OPCODE_SIN:
+ case OPCODE_COS:
+ case OPCODE_RSQ:
+ case OPCODE_POW:
+ case OPCODE_EX2:
+ case OPCODE_LOG:
+ channel_mask = WRITEMASK_X;
+ break;
+ case OPCODE_DP2:
+ channel_mask = WRITEMASK_XY;
+ break;
+ case OPCODE_DP3:
+ case OPCODE_XPD:
+ channel_mask = WRITEMASK_XYZ;
+ break;
+ default:
+ channel_mask = WRITEMASK_XYZW;
+ break;
+ }
+ }
+
+ /* Now, given the src swizzle and the written channels, find which
+ * components are actually read
+ */
+ read_mask = 0x0;
+ for (comp = 0; comp < 4; ++comp) {
+ const GLuint coord = GET_SWZ(inst->SrcReg[arg].Swizzle, comp);
+ ASSERT(coord < 4);
+ if (channel_mask & (1 << comp) && coord <= SWIZZLE_W)
+ read_mask |= 1 << coord;
+ }
+
+ return read_mask;
+}
+
+
+/**
+ * For a MOV instruction, compute a write mask when src register also has
+ * a mask
+ */
+static GLuint
+get_dst_mask_for_mov(const struct prog_instruction *mov, GLuint src_mask)
+{
+ const GLuint mask = mov->DstReg.WriteMask;
+ GLuint comp;
+ GLuint updated_mask = 0x0;
+
+ ASSERT(mov->Opcode == OPCODE_MOV);
+
+ for (comp = 0; comp < 4; ++comp) {
+ GLuint src_comp;
+ if ((mask & (1 << comp)) == 0)
+ continue;
+ src_comp = GET_SWZ(mov->SrcReg[0].Swizzle, comp);
+ if ((src_mask & (1 << src_comp)) == 0)
+ continue;
+ updated_mask |= 1 << comp;
+ }
+
+ return updated_mask;
+}
+
+
+/**
+ * Ensure that the swizzle is regular. That is, all of the swizzle
+ * terms are SWIZZLE_X,Y,Z,W and not SWIZZLE_ZERO or SWIZZLE_ONE.
+ */
+static GLboolean
+is_swizzle_regular(GLuint swz)
+{
+ return GET_SWZ(swz,0) <= SWIZZLE_W &&
+ GET_SWZ(swz,1) <= SWIZZLE_W &&
+ GET_SWZ(swz,2) <= SWIZZLE_W &&
+ GET_SWZ(swz,3) <= SWIZZLE_W;
+}
+
+
+/**
+ * In 'prog' remove instruction[i] if removeFlags[i] == TRUE.
+ * \return number of instructions removed
+ */
+static GLuint
+remove_instructions(struct gl_program *prog, const GLboolean *removeFlags)
+{
+ GLint i, removeEnd = 0, removeCount = 0;
+ GLuint totalRemoved = 0;
+
+ /* go backward */
+ for (i = prog->NumInstructions - 1; i >= 0; i--) {
+ if (removeFlags[i]) {
+ totalRemoved++;
+ if (removeCount == 0) {
+ /* begin a run of instructions to remove */
+ removeEnd = i;
+ removeCount = 1;
+ }
+ else {
+ /* extend the run of instructions to remove */
+ removeCount++;
+ }
+ }
+ else {
+ /* don't remove this instruction, but check if the preceeding
+ * instructions are to be removed.
+ */
+ if (removeCount > 0) {
+ GLint removeStart = removeEnd - removeCount + 1;
+ _mesa_delete_instructions(prog, removeStart, removeCount);
+ removeStart = removeCount = 0; /* reset removal info */
+ }
+ }
+ }
+ /* Finish removing if the first instruction was to be removed. */
+ if (removeCount > 0) {
+ GLint removeStart = removeEnd - removeCount + 1;
+ _mesa_delete_instructions(prog, removeStart, removeCount);
+ }
+ return totalRemoved;
+}
+
+
+/**
+ * Remap register indexes according to map.
+ * \param prog the program to search/replace
+ * \param file the type of register file to search/replace
+ * \param map maps old register indexes to new indexes
+ */
+static void
+replace_regs(struct gl_program *prog, gl_register_file file, const GLint map[])
+{
+ GLuint i;
+
+ for (i = 0; i < prog->NumInstructions; i++) {
+ struct prog_instruction *inst = prog->Instructions + i;
+ const GLuint numSrc = _mesa_num_inst_src_regs(inst->Opcode);
+ GLuint j;
+ for (j = 0; j < numSrc; j++) {
+ if (inst->SrcReg[j].File == file) {
+ GLuint index = inst->SrcReg[j].Index;
+ ASSERT(map[index] >= 0);
+ inst->SrcReg[j].Index = map[index];
+ }
+ }
+ if (inst->DstReg.File == file) {
+ const GLuint index = inst->DstReg.Index;
+ ASSERT(map[index] >= 0);
+ inst->DstReg.Index = map[index];
+ }
+ }
+}
+
+
+/**
+ * Remove dead instructions from the given program.
+ * This is very primitive for now. Basically look for temp registers
+ * that are written to but never read. Remove any instructions that
+ * write to such registers. Be careful with condition code setters.
+ */
+static GLboolean
+_mesa_remove_dead_code_global(struct gl_program *prog)
+{
+ GLboolean tempRead[REG_ALLOCATE_MAX_PROGRAM_TEMPS][4];
+ GLboolean *removeInst; /* per-instruction removal flag */
+ GLuint i, rem = 0, comp;
+
+ memset(tempRead, 0, sizeof(tempRead));
+
+ if (dbg) {
+ printf("Optimize: Begin dead code removal\n");
+ /*_mesa_print_program(prog);*/
+ }
+
+ removeInst = (GLboolean *)
+ calloc(1, prog->NumInstructions * sizeof(GLboolean));
+
+ /* Determine which temps are read and written */
+ for (i = 0; i < prog->NumInstructions; i++) {
+ const struct prog_instruction *inst = prog->Instructions + i;
+ const GLuint numSrc = _mesa_num_inst_src_regs(inst->Opcode);
+ GLuint j;
+
+ /* check src regs */
+ for (j = 0; j < numSrc; j++) {
+ if (inst->SrcReg[j].File == PROGRAM_TEMPORARY) {
+ const GLuint index = inst->SrcReg[j].Index;
+ GLuint read_mask;
+ ASSERT(index < REG_ALLOCATE_MAX_PROGRAM_TEMPS);
+ read_mask = get_src_arg_mask(inst, j, NO_MASK);
+
+ if (inst->SrcReg[j].RelAddr) {
+ if (dbg)
+ printf("abort remove dead code (indirect temp)\n");
+ goto done;
+ }
+
+ for (comp = 0; comp < 4; comp++) {
+ const GLuint swz = GET_SWZ(inst->SrcReg[j].Swizzle, comp);
+ ASSERT(swz < 4);
+ if ((read_mask & (1 << swz)) == 0)
+ continue;
+ if (swz <= SWIZZLE_W)
+ tempRead[index][swz] = GL_TRUE;
+ }
+ }
+ }
+
+ /* check dst reg */
+ if (inst->DstReg.File == PROGRAM_TEMPORARY) {
+ const GLuint index = inst->DstReg.Index;
+ ASSERT(index < REG_ALLOCATE_MAX_PROGRAM_TEMPS);
+
+ if (inst->DstReg.RelAddr) {
+ if (dbg)
+ printf("abort remove dead code (indirect temp)\n");
+ goto done;
+ }
+
+ if (inst->CondUpdate) {
+ /* If we're writing to this register and setting condition
+ * codes we cannot remove the instruction. Prevent removal
+ * by setting the 'read' flag.
+ */
+ tempRead[index][0] = GL_TRUE;
+ tempRead[index][1] = GL_TRUE;
+ tempRead[index][2] = GL_TRUE;
+ tempRead[index][3] = GL_TRUE;
+ }
+ }
+ }
+
+ /* find instructions that write to dead registers, flag for removal */
+ for (i = 0; i < prog->NumInstructions; i++) {
+ struct prog_instruction *inst = prog->Instructions + i;
+ const GLuint numDst = _mesa_num_inst_dst_regs(inst->Opcode);
+
+ if (numDst != 0 && inst->DstReg.File == PROGRAM_TEMPORARY) {
+ GLint chan, index = inst->DstReg.Index;
+
+ for (chan = 0; chan < 4; chan++) {
+ if (!tempRead[index][chan] &&
+ inst->DstReg.WriteMask & (1 << chan)) {
+ if (dbg) {
+ printf("Remove writemask on %u.%c\n", i,
+ chan == 3 ? 'w' : 'x' + chan);
+ }
+ inst->DstReg.WriteMask &= ~(1 << chan);
+ rem++;
+ }
+ }
+
+ if (inst->DstReg.WriteMask == 0) {
+ /* If we cleared all writes, the instruction can be removed. */
+ if (dbg)
+ printf("Remove instruction %u: \n", i);
+ removeInst[i] = GL_TRUE;
+ }
+ }
+ }
+
+ /* now remove the instructions which aren't needed */
+ rem = remove_instructions(prog, removeInst);
+
+ if (dbg) {
+ printf("Optimize: End dead code removal.\n");
+ printf(" %u channel writes removed\n", rem);
+ printf(" %u instructions removed\n", rem);
+ /*_mesa_print_program(prog);*/
+ }
+
+done:
+ free(removeInst);
+ return rem != 0;
+}
+
+
+enum inst_use
+{
+ READ,
+ WRITE,
+ FLOW,
+ END
+};
+
+
+/**
+ * Scan forward in program from 'start' for the next occurances of TEMP[index].
+ * We look if an instruction reads the component given by the masks and if they
+ * are overwritten.
+ * Return READ, WRITE, FLOW or END to indicate the next usage or an indicator
+ * that we can't look further.
+ */
+static enum inst_use
+find_next_use(const struct gl_program *prog,
+ GLuint start,
+ GLuint index,
+ GLuint mask)
+{
+ GLuint i;
+
+ for (i = start; i < prog->NumInstructions; i++) {
+ const struct prog_instruction *inst = prog->Instructions + i;
+ switch (inst->Opcode) {
+ case OPCODE_BGNLOOP:
+ case OPCODE_BGNSUB:
+ case OPCODE_BRA:
+ case OPCODE_CAL:
+ case OPCODE_CONT:
+ case OPCODE_IF:
+ case OPCODE_ELSE:
+ case OPCODE_ENDIF:
+ case OPCODE_ENDLOOP:
+ case OPCODE_ENDSUB:
+ case OPCODE_RET:
+ return FLOW;
+ case OPCODE_END:
+ return END;
+ default:
+ {
+ const GLuint numSrc = _mesa_num_inst_src_regs(inst->Opcode);
+ GLuint j;
+ for (j = 0; j < numSrc; j++) {
+ if (inst->SrcReg[j].RelAddr ||
+ (inst->SrcReg[j].File == PROGRAM_TEMPORARY &&
+ inst->SrcReg[j].Index == index &&
+ (get_src_arg_mask(inst,j,NO_MASK) & mask)))
+ return READ;
+ }
+ if (_mesa_num_inst_dst_regs(inst->Opcode) == 1 &&
+ inst->DstReg.File == PROGRAM_TEMPORARY &&
+ inst->DstReg.Index == index) {
+ mask &= ~inst->DstReg.WriteMask;
+ if (mask == 0)
+ return WRITE;
+ }
+ }
+ }
+ }
+ return END;
+}
+
+
+/**
+ * Is the given instruction opcode a flow-control opcode?
+ * XXX maybe move this into prog_instruction.[ch]
+ */
+static GLboolean
+_mesa_is_flow_control_opcode(enum prog_opcode opcode)
+{
+ switch (opcode) {
+ case OPCODE_BGNLOOP:
+ case OPCODE_BGNSUB:
+ case OPCODE_BRA:
+ case OPCODE_CAL:
+ case OPCODE_CONT:
+ case OPCODE_IF:
+ case OPCODE_ELSE:
+ case OPCODE_END:
+ case OPCODE_ENDIF:
+ case OPCODE_ENDLOOP:
+ case OPCODE_ENDSUB:
+ case OPCODE_RET:
+ return GL_TRUE;
+ default:
+ return GL_FALSE;
+ }
+}
+
+
+/**
+ * Test if the given instruction is a simple MOV (no conditional updating,
+ * not relative addressing, no negation/abs, etc).
+ */
+static GLboolean
+can_downward_mov_be_modifed(const struct prog_instruction *mov)
+{
+ return
+ mov->Opcode == OPCODE_MOV &&
+ mov->CondUpdate == GL_FALSE &&
+ mov->SrcReg[0].RelAddr == 0 &&
+ mov->SrcReg[0].Negate == 0 &&
+ mov->SrcReg[0].Abs == 0 &&
+ mov->SrcReg[0].HasIndex2 == 0 &&
+ mov->SrcReg[0].RelAddr2 == 0 &&
+ mov->DstReg.RelAddr == 0 &&
+ mov->DstReg.CondMask == COND_TR &&
+ mov->SaturateMode == SATURATE_OFF;
+}
+
+
+static GLboolean
+can_upward_mov_be_modifed(const struct prog_instruction *mov)
+{
+ return
+ can_downward_mov_be_modifed(mov) &&
+ mov->DstReg.File == PROGRAM_TEMPORARY;
+}
+
+
+/**
+ * Try to remove use of extraneous MOV instructions, to free them up for dead
+ * code removal.
+ */
+static void
+_mesa_remove_extra_move_use(struct gl_program *prog)
+{
+ GLuint i, j;
+
+ if (dbg) {
+ printf("Optimize: Begin remove extra move use\n");
+ _mesa_print_program(prog);
+ }
+
+ /*
+ * Look for sequences such as this:
+ * MOV tmpX, arg0;
+ * ...
+ * FOO tmpY, tmpX, arg1;
+ * and convert into:
+ * MOV tmpX, arg0;
+ * ...
+ * FOO tmpY, arg0, arg1;
+ */
+
+ for (i = 0; i + 1 < prog->NumInstructions; i++) {
+ const struct prog_instruction *mov = prog->Instructions + i;
+ GLuint dst_mask, src_mask;
+ if (can_upward_mov_be_modifed(mov) == GL_FALSE)
+ continue;
+
+ /* Scanning the code, we maintain the components which are still active in
+ * these two masks
+ */
+ dst_mask = mov->DstReg.WriteMask;
+ src_mask = get_src_arg_mask(mov, 0, NO_MASK);
+
+ /* Walk through remaining instructions until the or src reg gets
+ * rewritten or we get into some flow-control, eliminating the use of
+ * this MOV.
+ */
+ for (j = i + 1; j < prog->NumInstructions; j++) {
+ struct prog_instruction *inst2 = prog->Instructions + j;
+ GLuint arg;
+
+ if (_mesa_is_flow_control_opcode(inst2->Opcode))
+ break;
+
+ /* First rewrite this instruction's args if appropriate. */
+ for (arg = 0; arg < _mesa_num_inst_src_regs(inst2->Opcode); arg++) {
+ GLuint comp, read_mask;
+
+ if (inst2->SrcReg[arg].File != mov->DstReg.File ||
+ inst2->SrcReg[arg].Index != mov->DstReg.Index ||
+ inst2->SrcReg[arg].RelAddr ||
+ inst2->SrcReg[arg].Abs)
+ continue;
+ read_mask = get_src_arg_mask(inst2, arg, NO_MASK);
+
+ /* Adjust the swizzles of inst2 to point at MOV's source if ALL the
+ * components read still come from the mov instructions
+ */
+ if (is_swizzle_regular(inst2->SrcReg[arg].Swizzle) &&
+ (read_mask & dst_mask) == read_mask) {
+ for (comp = 0; comp < 4; comp++) {
+ const GLuint inst2_swz =
+ GET_SWZ(inst2->SrcReg[arg].Swizzle, comp);
+ const GLuint s = GET_SWZ(mov->SrcReg[0].Swizzle, inst2_swz);
+ inst2->SrcReg[arg].Swizzle &= ~(7 << (3 * comp));
+ inst2->SrcReg[arg].Swizzle |= s << (3 * comp);
+ inst2->SrcReg[arg].Negate ^= (((mov->SrcReg[0].Negate >>
+ inst2_swz) & 0x1) << comp);
+ }
+ inst2->SrcReg[arg].File = mov->SrcReg[0].File;
+ inst2->SrcReg[arg].Index = mov->SrcReg[0].Index;
+ }
+ }
+
+ /* The source of MOV is written. This potentially deactivates some
+ * components from the src and dst of the MOV instruction
+ */
+ if (inst2->DstReg.File == mov->DstReg.File &&
+ (inst2->DstReg.RelAddr ||
+ inst2->DstReg.Index == mov->DstReg.Index)) {
+ dst_mask &= ~inst2->DstReg.WriteMask;
+ src_mask = get_src_arg_mask(mov, 0, dst_mask);
+ }
+
+ /* Idem when the destination of mov is written */
+ if (inst2->DstReg.File == mov->SrcReg[0].File &&
+ (inst2->DstReg.RelAddr ||
+ inst2->DstReg.Index == mov->SrcReg[0].Index)) {
+ src_mask &= ~inst2->DstReg.WriteMask;
+ dst_mask &= get_dst_mask_for_mov(mov, src_mask);
+ }
+ if (dst_mask == 0)
+ break;
+ }
+ }
+
+ if (dbg) {
+ printf("Optimize: End remove extra move use.\n");
+ /*_mesa_print_program(prog);*/
+ }
+}
+
+
+/**
+ * Complements dead_code_global. Try to remove code in block of code by
+ * carefully monitoring the swizzles. Both functions should be merged into one
+ * with a proper control flow graph
+ */
+static GLboolean
+_mesa_remove_dead_code_local(struct gl_program *prog)
+{
+ GLboolean *removeInst;
+ GLuint i, arg, rem = 0;
+
+ removeInst = (GLboolean *)
+ calloc(1, prog->NumInstructions * sizeof(GLboolean));
+
+ for (i = 0; i < prog->NumInstructions; i++) {
+ const struct prog_instruction *inst = prog->Instructions + i;
+ const GLuint index = inst->DstReg.Index;
+ const GLuint mask = inst->DstReg.WriteMask;
+ enum inst_use use;
+
+ /* We must deactivate the pass as soon as some indirection is used */
+ if (inst->DstReg.RelAddr)
+ goto done;
+ for (arg = 0; arg < _mesa_num_inst_src_regs(inst->Opcode); arg++)
+ if (inst->SrcReg[arg].RelAddr)
+ goto done;
+
+ if (_mesa_is_flow_control_opcode(inst->Opcode) ||
+ _mesa_num_inst_dst_regs(inst->Opcode) == 0 ||
+ inst->DstReg.File != PROGRAM_TEMPORARY ||
+ inst->DstReg.RelAddr)
+ continue;
+
+ use = find_next_use(prog, i+1, index, mask);
+ if (use == WRITE || use == END)
+ removeInst[i] = GL_TRUE;
+ }
+
+ rem = remove_instructions(prog, removeInst);
+
+done:
+ free(removeInst);
+ return rem != 0;
+}
+
+
+/**
+ * Try to inject the destination of mov as the destination of inst and recompute
+ * the swizzles operators for the sources of inst if required. Return GL_TRUE
+ * of the substitution was possible, GL_FALSE otherwise
+ */
+static GLboolean
+_mesa_merge_mov_into_inst(struct prog_instruction *inst,
+ const struct prog_instruction *mov)
+{
+ /* Indirection table which associates destination and source components for
+ * the mov instruction
+ */
+ const GLuint mask = get_src_arg_mask(mov, 0, NO_MASK);
+
+ /* Some components are not written by inst. We cannot remove the mov */
+ if (mask != (inst->DstReg.WriteMask & mask))
+ return GL_FALSE;
+
+ /* Depending on the instruction, we may need to recompute the swizzles.
+ * Also, some other instructions (like TEX) are not linear. We will only
+ * consider completely active sources and destinations
+ */
+ switch (inst->Opcode) {
+
+ /* Carstesian instructions: we compute the swizzle */
+ case OPCODE_MOV:
+ case OPCODE_MIN:
+ case OPCODE_MAX:
+ case OPCODE_ABS:
+ case OPCODE_ADD:
+ case OPCODE_MAD:
+ case OPCODE_MUL:
+ case OPCODE_SUB:
+ {
+ GLuint dst_to_src_comp[4] = {0,0,0,0};
+ GLuint dst_comp, arg;
+ for (dst_comp = 0; dst_comp < 4; ++dst_comp) {
+ if (mov->DstReg.WriteMask & (1 << dst_comp)) {
+ const GLuint src_comp = GET_SWZ(mov->SrcReg[0].Swizzle, dst_comp);
+ ASSERT(src_comp < 4);
+ dst_to_src_comp[dst_comp] = src_comp;
+ }
+ }
+
+ /* Patch each source of the instruction */
+ for (arg = 0; arg < _mesa_num_inst_src_regs(inst->Opcode); arg++) {
+ const GLuint arg_swz = inst->SrcReg[arg].Swizzle;
+ inst->SrcReg[arg].Swizzle = 0;
+
+ /* Reset each active component of the swizzle */
+ for (dst_comp = 0; dst_comp < 4; ++dst_comp) {
+ GLuint src_comp, arg_comp;
+ if ((mov->DstReg.WriteMask & (1 << dst_comp)) == 0)
+ continue;
+ src_comp = dst_to_src_comp[dst_comp];
+ ASSERT(src_comp < 4);
+ arg_comp = GET_SWZ(arg_swz, src_comp);
+ ASSERT(arg_comp < 4);
+ inst->SrcReg[arg].Swizzle |= arg_comp << (3*dst_comp);
+ }
+ }
+ inst->DstReg = mov->DstReg;
+ return GL_TRUE;
+ }
+
+ /* Dot products and scalar instructions: we only change the destination */
+ case OPCODE_RCP:
+ case OPCODE_SIN:
+ case OPCODE_COS:
+ case OPCODE_RSQ:
+ case OPCODE_POW:
+ case OPCODE_EX2:
+ case OPCODE_LOG:
+ case OPCODE_DP2:
+ case OPCODE_DP3:
+ case OPCODE_DP4:
+ inst->DstReg = mov->DstReg;
+ return GL_TRUE;
+
+ /* All other instructions require fully active components with no swizzle */
+ default:
+ if (mov->SrcReg[0].Swizzle != SWIZZLE_XYZW ||
+ inst->DstReg.WriteMask != WRITEMASK_XYZW)
+ return GL_FALSE;
+ inst->DstReg = mov->DstReg;
+ return GL_TRUE;
+ }
+}
+
+
+/**
+ * Try to remove extraneous MOV instructions from the given program.
+ */
+static GLboolean
+_mesa_remove_extra_moves(struct gl_program *prog)
+{
+ GLboolean *removeInst; /* per-instruction removal flag */
+ GLuint i, rem = 0, nesting = 0;
+
+ if (dbg) {
+ printf("Optimize: Begin remove extra moves\n");
+ _mesa_print_program(prog);
+ }
+
+ removeInst = (GLboolean *)
+ calloc(1, prog->NumInstructions * sizeof(GLboolean));
+
+ /*
+ * Look for sequences such as this:
+ * FOO tmpX, arg0, arg1;
+ * MOV tmpY, tmpX;
+ * and convert into:
+ * FOO tmpY, arg0, arg1;
+ */
+
+ for (i = 0; i < prog->NumInstructions; i++) {
+ const struct prog_instruction *mov = prog->Instructions + i;
+
+ switch (mov->Opcode) {
+ case OPCODE_BGNLOOP:
+ case OPCODE_BGNSUB:
+ case OPCODE_IF:
+ nesting++;
+ break;
+ case OPCODE_ENDLOOP:
+ case OPCODE_ENDSUB:
+ case OPCODE_ENDIF:
+ nesting--;
+ break;
+ case OPCODE_MOV:
+ if (i > 0 &&
+ can_downward_mov_be_modifed(mov) &&
+ mov->SrcReg[0].File == PROGRAM_TEMPORARY &&
+ nesting == 0)
+ {
+
+ /* see if this MOV can be removed */
+ const GLuint id = mov->SrcReg[0].Index;
+ struct prog_instruction *prevInst;
+ GLuint prevI;
+
+ /* get pointer to previous instruction */
+ prevI = i - 1;
+ while (prevI > 0 && removeInst[prevI])
+ prevI--;
+ prevInst = prog->Instructions + prevI;
+
+ if (prevInst->DstReg.File == PROGRAM_TEMPORARY &&
+ prevInst->DstReg.Index == id &&
+ prevInst->DstReg.RelAddr == 0 &&
+ prevInst->DstReg.CondSrc == 0 &&
+ prevInst->DstReg.CondMask == COND_TR) {
+
+ const GLuint dst_mask = prevInst->DstReg.WriteMask;
+ enum inst_use next_use = find_next_use(prog, i+1, id, dst_mask);
+
+ if (next_use == WRITE || next_use == END) {
+ /* OK, we can safely remove this MOV instruction.
+ * Transform:
+ * prevI: FOO tempIndex, x, y;
+ * i: MOV z, tempIndex;
+ * Into:
+ * prevI: FOO z, x, y;
+ */
+ if (_mesa_merge_mov_into_inst(prevInst, mov)) {
+ removeInst[i] = GL_TRUE;
+ if (dbg) {
+ printf("Remove MOV at %u\n", i);
+ printf("new prev inst %u: ", prevI);
+ _mesa_print_instruction(prevInst);
+ }
+ }
+ }
+ }
+ }
+ break;
+ default:
+ ; /* nothing */
+ }
+ }
+
+ /* now remove the instructions which aren't needed */
+ rem = remove_instructions(prog, removeInst);
+
+ free(removeInst);
+
+ if (dbg) {
+ printf("Optimize: End remove extra moves. %u instructions removed\n", rem);
+ /*_mesa_print_program(prog);*/
+ }
+
+ return rem != 0;
+}
+
+
+/** A live register interval */
+struct interval
+{
+ GLuint Reg; /** The temporary register index */
+ GLuint Start, End; /** Start/end instruction numbers */
+};
+
+
+/** A list of register intervals */
+struct interval_list
+{
+ GLuint Num;
+ struct interval Intervals[REG_ALLOCATE_MAX_PROGRAM_TEMPS];
+};
+
+
+static void
+append_interval(struct interval_list *list, const struct interval *inv)
+{
+ list->Intervals[list->Num++] = *inv;
+}
+
+
+/** Insert interval inv into list, sorted by interval end */
+static void
+insert_interval_by_end(struct interval_list *list, const struct interval *inv)
+{
+ /* XXX we could do a binary search insertion here since list is sorted */
+ GLint i = list->Num - 1;
+ while (i >= 0 && list->Intervals[i].End > inv->End) {
+ list->Intervals[i + 1] = list->Intervals[i];
+ i--;
+ }
+ list->Intervals[i + 1] = *inv;
+ list->Num++;
+
+#ifdef DEBUG
+ {
+ GLuint i;
+ for (i = 0; i + 1 < list->Num; i++) {
+ ASSERT(list->Intervals[i].End <= list->Intervals[i + 1].End);
+ }
+ }
+#endif
+}
+
+
+/** Remove the given interval from the interval list */
+static void
+remove_interval(struct interval_list *list, const struct interval *inv)
+{
+ /* XXX we could binary search since list is sorted */
+ GLuint k;
+ for (k = 0; k < list->Num; k++) {
+ if (list->Intervals[k].Reg == inv->Reg) {
+ /* found, remove it */
+ ASSERT(list->Intervals[k].Start == inv->Start);
+ ASSERT(list->Intervals[k].End == inv->End);
+ while (k < list->Num - 1) {
+ list->Intervals[k] = list->Intervals[k + 1];
+ k++;
+ }
+ list->Num--;
+ return;
+ }
+ }
+}
+
+
+/** called by qsort() */
+static int
+compare_start(const void *a, const void *b)
+{
+ const struct interval *ia = (const struct interval *) a;
+ const struct interval *ib = (const struct interval *) b;
+ if (ia->Start < ib->Start)
+ return -1;
+ else if (ia->Start > ib->Start)
+ return +1;
+ else
+ return 0;
+}
+
+
+/** sort the interval list according to interval starts */
+static void
+sort_interval_list_by_start(struct interval_list *list)
+{
+ qsort(list->Intervals, list->Num, sizeof(struct interval), compare_start);
+#ifdef DEBUG
+ {
+ GLuint i;
+ for (i = 0; i + 1 < list->Num; i++) {
+ ASSERT(list->Intervals[i].Start <= list->Intervals[i + 1].Start);
+ }
+ }
+#endif
+}
+
+struct loop_info
+{
+ GLuint Start, End; /**< Start, end instructions of loop */
+};
+
+/**
+ * Update the intermediate interval info for register 'index' and
+ * instruction 'ic'.
+ */
+static void
+update_interval(GLint intBegin[], GLint intEnd[],
+ struct loop_info *loopStack, GLuint loopStackDepth,
+ GLuint index, GLuint ic)
+{
+ int i;
+ GLuint begin = ic;
+ GLuint end = ic;
+
+ /* If the register is used in a loop, extend its lifetime through the end
+ * of the outermost loop that doesn't contain its definition.
+ */
+ for (i = 0; i < loopStackDepth; i++) {
+ if (intBegin[index] < loopStack[i].Start) {
+ end = loopStack[i].End;
+ break;
+ }
+ }
+
+ /* Variables that are live at the end of a loop will also be live at the
+ * beginning, so an instruction inside of a loop should have its live
+ * interval begin at the start of the outermost loop.
+ */
+ if (loopStackDepth > 0 && ic > loopStack[0].Start && ic < loopStack[0].End) {
+ begin = loopStack[0].Start;
+ }
+
+ ASSERT(index < REG_ALLOCATE_MAX_PROGRAM_TEMPS);
+ if (intBegin[index] == -1) {
+ ASSERT(intEnd[index] == -1);
+ intBegin[index] = begin;
+ intEnd[index] = end;
+ }
+ else {
+ intEnd[index] = end;
+ }
+}
+
+
+/**
+ * Find first/last instruction that references each temporary register.
+ */
+GLboolean
+_mesa_find_temp_intervals(const struct prog_instruction *instructions,
+ GLuint numInstructions,
+ GLint intBegin[REG_ALLOCATE_MAX_PROGRAM_TEMPS],
+ GLint intEnd[REG_ALLOCATE_MAX_PROGRAM_TEMPS])
+{
+ struct loop_info loopStack[MAX_LOOP_NESTING];
+ GLuint loopStackDepth = 0;
+ GLuint i;
+
+ for (i = 0; i < REG_ALLOCATE_MAX_PROGRAM_TEMPS; i++){
+ intBegin[i] = intEnd[i] = -1;
+ }
+
+ /* Scan instructions looking for temporary registers */
+ for (i = 0; i < numInstructions; i++) {
+ const struct prog_instruction *inst = instructions + i;
+ if (inst->Opcode == OPCODE_BGNLOOP) {
+ loopStack[loopStackDepth].Start = i;
+ loopStack[loopStackDepth].End = inst->BranchTarget;
+ loopStackDepth++;
+ }
+ else if (inst->Opcode == OPCODE_ENDLOOP) {
+ loopStackDepth--;
+ }
+ else if (inst->Opcode == OPCODE_CAL) {
+ return GL_FALSE;
+ }
+ else {
+ const GLuint numSrc = 3;/*_mesa_num_inst_src_regs(inst->Opcode);*/
+ GLuint j;
+ for (j = 0; j < numSrc; j++) {
+ if (inst->SrcReg[j].File == PROGRAM_TEMPORARY) {
+ const GLuint index = inst->SrcReg[j].Index;
+ if (inst->SrcReg[j].RelAddr)
+ return GL_FALSE;
+ update_interval(intBegin, intEnd, loopStack, loopStackDepth,
+ index, i);
+ }
+ }
+ if (inst->DstReg.File == PROGRAM_TEMPORARY) {
+ const GLuint index = inst->DstReg.Index;
+ if (inst->DstReg.RelAddr)
+ return GL_FALSE;
+ update_interval(intBegin, intEnd, loopStack, loopStackDepth,
+ index, i);
+ }
+ }
+ }
+
+ return GL_TRUE;
+}
+
+
+/**
+ * Find the live intervals for each temporary register in the program.
+ * For register R, the interval [A,B] indicates that R is referenced
+ * from instruction A through instruction B.
+ * Special consideration is needed for loops and subroutines.
+ * \return GL_TRUE if success, GL_FALSE if we cannot proceed for some reason
+ */
+static GLboolean
+find_live_intervals(struct gl_program *prog,
+ struct interval_list *liveIntervals)
+{
+ GLint intBegin[REG_ALLOCATE_MAX_PROGRAM_TEMPS];
+ GLint intEnd[REG_ALLOCATE_MAX_PROGRAM_TEMPS];
+ GLuint i;
+
+ /*
+ * Note: we'll return GL_FALSE below if we find relative indexing
+ * into the TEMP register file. We can't handle that yet.
+ * We also give up on subroutines for now.
+ */
+
+ if (dbg) {
+ printf("Optimize: Begin find intervals\n");
+ }
+
+ /* build intermediate arrays */
+ if (!_mesa_find_temp_intervals(prog->Instructions, prog->NumInstructions,
+ intBegin, intEnd))
+ return GL_FALSE;
+
+ /* Build live intervals list from intermediate arrays */
+ liveIntervals->Num = 0;
+ for (i = 0; i < REG_ALLOCATE_MAX_PROGRAM_TEMPS; i++) {
+ if (intBegin[i] >= 0) {
+ struct interval inv;
+ inv.Reg = i;
+ inv.Start = intBegin[i];
+ inv.End = intEnd[i];
+ append_interval(liveIntervals, &inv);
+ }
+ }
+
+ /* Sort the list according to interval starts */
+ sort_interval_list_by_start(liveIntervals);
+
+ if (dbg) {
+ /* print interval info */
+ for (i = 0; i < liveIntervals->Num; i++) {
+ const struct interval *inv = liveIntervals->Intervals + i;
+ printf("Reg[%d] live [%d, %d]:",
+ inv->Reg, inv->Start, inv->End);
+ if (1) {
+ GLuint j;
+ for (j = 0; j < inv->Start; j++)
+ printf(" ");
+ for (j = inv->Start; j <= inv->End; j++)
+ printf("x");
+ }
+ printf("\n");
+ }
+ }
+
+ return GL_TRUE;
+}
+
+
+/** Scan the array of used register flags to find free entry */
+static GLint
+alloc_register(GLboolean usedRegs[REG_ALLOCATE_MAX_PROGRAM_TEMPS])
+{
+ GLuint k;
+ for (k = 0; k < REG_ALLOCATE_MAX_PROGRAM_TEMPS; k++) {
+ if (!usedRegs[k]) {
+ usedRegs[k] = GL_TRUE;
+ return k;
+ }
+ }
+ return -1;
+}
+
+
+/**
+ * This function implements "Linear Scan Register Allocation" to reduce
+ * the number of temporary registers used by the program.
+ *
+ * We compute the "live interval" for all temporary registers then
+ * examine the overlap of the intervals to allocate new registers.
+ * Basically, if two intervals do not overlap, they can use the same register.
+ */
+static void
+_mesa_reallocate_registers(struct gl_program *prog)
+{
+ struct interval_list liveIntervals;
+ GLint registerMap[REG_ALLOCATE_MAX_PROGRAM_TEMPS];
+ GLboolean usedRegs[REG_ALLOCATE_MAX_PROGRAM_TEMPS];
+ GLuint i;
+ GLint maxTemp = -1;
+
+ if (dbg) {
+ printf("Optimize: Begin live-interval register reallocation\n");
+ _mesa_print_program(prog);
+ }
+
+ for (i = 0; i < REG_ALLOCATE_MAX_PROGRAM_TEMPS; i++){
+ registerMap[i] = -1;
+ usedRegs[i] = GL_FALSE;
+ }
+
+ if (!find_live_intervals(prog, &liveIntervals)) {
+ if (dbg)
+ printf("Aborting register reallocation\n");
+ return;
+ }
+
+ {
+ struct interval_list activeIntervals;
+ activeIntervals.Num = 0;
+
+ /* loop over live intervals, allocating a new register for each */
+ for (i = 0; i < liveIntervals.Num; i++) {
+ const struct interval *live = liveIntervals.Intervals + i;
+
+ if (dbg)
+ printf("Consider register %u\n", live->Reg);
+
+ /* Expire old intervals. Intervals which have ended with respect
+ * to the live interval can have their remapped registers freed.
+ */
+ {
+ GLint j;
+ for (j = 0; j < (GLint) activeIntervals.Num; j++) {
+ const struct interval *inv = activeIntervals.Intervals + j;
+ if (inv->End >= live->Start) {
+ /* Stop now. Since the activeInterval list is sorted
+ * we know we don't have to go further.
+ */
+ break;
+ }
+ else {
+ /* Interval 'inv' has expired */
+ const GLint regNew = registerMap[inv->Reg];
+ ASSERT(regNew >= 0);
+
+ if (dbg)
+ printf(" expire interval for reg %u\n", inv->Reg);
+
+ /* remove interval j from active list */
+ remove_interval(&activeIntervals, inv);
+ j--; /* counter-act j++ in for-loop above */
+
+ /* return register regNew to the free pool */
+ if (dbg)
+ printf(" free reg %d\n", regNew);
+ ASSERT(usedRegs[regNew] == GL_TRUE);
+ usedRegs[regNew] = GL_FALSE;
+ }
+ }
+ }
+
+ /* find a free register for this live interval */
+ {
+ const GLint k = alloc_register(usedRegs);
+ if (k < 0) {
+ /* out of registers, give up */
+ return;
+ }
+ registerMap[live->Reg] = k;
+ maxTemp = MAX2(maxTemp, k);
+ if (dbg)
+ printf(" remap register %u -> %d\n", live->Reg, k);
+ }
+
+ /* Insert this live interval into the active list which is sorted
+ * by increasing end points.
+ */
+ insert_interval_by_end(&activeIntervals, live);
+ }
+ }
+
+ if (maxTemp + 1 < (GLint) liveIntervals.Num) {
+ /* OK, we've reduced the number of registers needed.
+ * Scan the program and replace all the old temporary register
+ * indexes with the new indexes.
+ */
+ replace_regs(prog, PROGRAM_TEMPORARY, registerMap);
+
+ prog->NumTemporaries = maxTemp + 1;
+ }
+
+ if (dbg) {
+ printf("Optimize: End live-interval register reallocation\n");
+ printf("Num temp regs before: %u after: %u\n",
+ liveIntervals.Num, maxTemp + 1);
+ _mesa_print_program(prog);
+ }
+}
+
+
+#if 0
+static void
+print_it(struct gl_context *ctx, struct gl_program *program, const char *txt) {
+ fprintf(stderr, "%s (%u inst):\n", txt, program->NumInstructions);
+ _mesa_print_program(program);
+ _mesa_print_program_parameters(ctx, program);
+ fprintf(stderr, "\n\n");
+}
+#endif
+
+/**
+ * This pass replaces CMP T0, T1 T2 T0 with MOV T0, T2 when the CMP
+ * instruction is the first instruction to write to register T0. The are
+ * several lowering passes done in GLSL IR (e.g. branches and
+ * relative addressing) that create a large number of conditional assignments
+ * that ir_to_mesa converts to CMP instructions like the one mentioned above.
+ *
+ * Here is why this conversion is safe:
+ * CMP T0, T1 T2 T0 can be expanded to:
+ * if (T1 < 0.0)
+ * MOV T0, T2;
+ * else
+ * MOV T0, T0;
+ *
+ * If (T1 < 0.0) evaluates to true then our replacement MOV T0, T2 is the same
+ * as the original program. If (T1 < 0.0) evaluates to false, executing
+ * MOV T0, T0 will store a garbage value in T0 since T0 is uninitialized.
+ * Therefore, it doesn't matter that we are replacing MOV T0, T0 with MOV T0, T2
+ * because any instruction that was going to read from T0 after this was going
+ * to read a garbage value anyway.
+ */
+static void
+_mesa_simplify_cmp(struct gl_program * program)
+{
+ GLuint tempWrites[REG_ALLOCATE_MAX_PROGRAM_TEMPS];
+ GLuint outputWrites[MAX_PROGRAM_OUTPUTS];
+ GLuint i;
+
+ if (dbg) {
+ printf("Optimize: Begin reads without writes\n");
+ _mesa_print_program(program);
+ }
+
+ for (i = 0; i < REG_ALLOCATE_MAX_PROGRAM_TEMPS; i++) {
+ tempWrites[i] = 0;
+ }
+
+ for (i = 0; i < MAX_PROGRAM_OUTPUTS; i++) {
+ outputWrites[i] = 0;
+ }
+
+ for (i = 0; i < program->NumInstructions; i++) {
+ struct prog_instruction *inst = program->Instructions + i;
+ GLuint prevWriteMask;
+
+ /* Give up if we encounter relative addressing or flow control. */
+ if (_mesa_is_flow_control_opcode(inst->Opcode) || inst->DstReg.RelAddr) {
+ return;
+ }
+
+ if (inst->DstReg.File == PROGRAM_OUTPUT) {
+ assert(inst->DstReg.Index < MAX_PROGRAM_OUTPUTS);
+ prevWriteMask = outputWrites[inst->DstReg.Index];
+ outputWrites[inst->DstReg.Index] |= inst->DstReg.WriteMask;
+ } else if (inst->DstReg.File == PROGRAM_TEMPORARY) {
+ assert(inst->DstReg.Index < REG_ALLOCATE_MAX_PROGRAM_TEMPS);
+ prevWriteMask = tempWrites[inst->DstReg.Index];
+ tempWrites[inst->DstReg.Index] |= inst->DstReg.WriteMask;
+ }
+
+ /* For a CMP to be considered a conditional write, the destination
+ * register and source register two must be the same. */
+ if (inst->Opcode == OPCODE_CMP
+ && !(inst->DstReg.WriteMask & prevWriteMask)
+ && inst->SrcReg[2].File == inst->DstReg.File
+ && inst->SrcReg[2].Index == inst->DstReg.Index
+ && inst->DstReg.WriteMask == get_src_arg_mask(inst, 2, NO_MASK)) {
+
+ inst->Opcode = OPCODE_MOV;
+ inst->SrcReg[0] = inst->SrcReg[1];
+ }
+ }
+ if (dbg) {
+ printf("Optimize: End reads without writes\n");
+ _mesa_print_program(program);
+ }
+}
+
+/**
+ * Apply optimizations to the given program to eliminate unnecessary
+ * instructions, temp regs, etc.
+ */
+void
+_mesa_optimize_program(struct gl_context *ctx, struct gl_program *program)
+{
+ GLboolean any_change;
+
+ _mesa_simplify_cmp(program);
+ /* Stop when no modifications were output */
+ do {
+ any_change = GL_FALSE;
+ _mesa_remove_extra_move_use(program);
+ if (_mesa_remove_dead_code_global(program))
+ any_change = GL_TRUE;
+ if (_mesa_remove_extra_moves(program))
+ any_change = GL_TRUE;
+ if (_mesa_remove_dead_code_local(program))
+ any_change = GL_TRUE;
+ _mesa_reallocate_registers(program);
+ } while (any_change);
+}
+
diff --git a/mesalib/src/mesa/program/prog_print.c b/mesalib/src/mesa/program/prog_print.c
index 7c3b4909e..248f4d730 100644
--- a/mesalib/src/mesa/program/prog_print.c
+++ b/mesalib/src/mesa/program/prog_print.c
@@ -1,1096 +1,1096 @@
-/*
- * Mesa 3-D graphics library
- * Version: 7.3
- *
- * Copyright (C) 1999-2008 Brian Paul All Rights Reserved.
- * Copyright (C) 2009 VMware, Inc. All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-/**
- * \file prog_print.c
- * Print vertex/fragment programs - for debugging.
- * \author Brian Paul
- */
-
-#include "main/glheader.h"
-#include "main/context.h"
-#include "main/imports.h"
-#include "prog_instruction.h"
-#include "prog_parameter.h"
-#include "prog_print.h"
-#include "prog_statevars.h"
-
-
-
-/**
- * Return string name for given program/register file.
- */
-const char *
-_mesa_register_file_name(gl_register_file f)
-{
- switch (f) {
- case PROGRAM_TEMPORARY:
- return "TEMP";
- case PROGRAM_LOCAL_PARAM:
- return "LOCAL";
- case PROGRAM_ENV_PARAM:
- return "ENV";
- case PROGRAM_STATE_VAR:
- return "STATE";
- case PROGRAM_INPUT:
- return "INPUT";
- case PROGRAM_OUTPUT:
- return "OUTPUT";
- case PROGRAM_NAMED_PARAM:
- return "NAMED";
- case PROGRAM_CONSTANT:
- return "CONST";
- case PROGRAM_UNIFORM:
- return "UNIFORM";
- case PROGRAM_VARYING:
- return "VARYING";
- case PROGRAM_WRITE_ONLY:
- return "WRITE_ONLY";
- case PROGRAM_ADDRESS:
- return "ADDR";
- case PROGRAM_SAMPLER:
- return "SAMPLER";
- case PROGRAM_SYSTEM_VALUE:
- return "SYSVAL";
- case PROGRAM_UNDEFINED:
- return "UNDEFINED";
- default:
- {
- static char s[20];
- _mesa_snprintf(s, sizeof(s), "FILE%u", f);
- return s;
- }
- }
-}
-
-
-/**
- * Return ARB_v/f_prog-style input attrib string.
- */
-static const char *
-arb_input_attrib_string(GLint index, GLenum progType)
-{
- /*
- * These strings should match the VERT_ATTRIB_x and FRAG_ATTRIB_x tokens.
- */
- const char *vertAttribs[] = {
- "vertex.position",
- "vertex.weight",
- "vertex.normal",
- "vertex.color.primary",
- "vertex.color.secondary",
- "vertex.fogcoord",
- "vertex.(six)",
- "vertex.(seven)",
- "vertex.texcoord[0]",
- "vertex.texcoord[1]",
- "vertex.texcoord[2]",
- "vertex.texcoord[3]",
- "vertex.texcoord[4]",
- "vertex.texcoord[5]",
- "vertex.texcoord[6]",
- "vertex.texcoord[7]",
- "vertex.attrib[0]",
- "vertex.attrib[1]",
- "vertex.attrib[2]",
- "vertex.attrib[3]",
- "vertex.attrib[4]",
- "vertex.attrib[5]",
- "vertex.attrib[6]",
- "vertex.attrib[7]",
- "vertex.attrib[8]",
- "vertex.attrib[9]",
- "vertex.attrib[10]",
- "vertex.attrib[11]",
- "vertex.attrib[12]",
- "vertex.attrib[13]",
- "vertex.attrib[14]",
- "vertex.attrib[15]"
- };
- const char *fragAttribs[] = {
- "fragment.position",
- "fragment.color.primary",
- "fragment.color.secondary",
- "fragment.fogcoord",
- "fragment.texcoord[0]",
- "fragment.texcoord[1]",
- "fragment.texcoord[2]",
- "fragment.texcoord[3]",
- "fragment.texcoord[4]",
- "fragment.texcoord[5]",
- "fragment.texcoord[6]",
- "fragment.texcoord[7]",
- "fragment.varying[0]",
- "fragment.varying[1]",
- "fragment.varying[2]",
- "fragment.varying[3]",
- "fragment.varying[4]",
- "fragment.varying[5]",
- "fragment.varying[6]",
- "fragment.varying[7]"
- };
-
- /* sanity checks */
- assert(strcmp(vertAttribs[VERT_ATTRIB_TEX0], "vertex.texcoord[0]") == 0);
- assert(strcmp(vertAttribs[VERT_ATTRIB_GENERIC15], "vertex.attrib[15]") == 0);
-
- if (progType == GL_VERTEX_PROGRAM_ARB) {
- assert(index < sizeof(vertAttribs) / sizeof(vertAttribs[0]));
- return vertAttribs[index];
- }
- else {
- assert(index < sizeof(fragAttribs) / sizeof(fragAttribs[0]));
- return fragAttribs[index];
- }
-}
-
-
-/**
- * Print a vertex program's InputsRead field in human-readable format.
- * For debugging.
- */
-void
-_mesa_print_vp_inputs(GLbitfield inputs)
-{
- printf("VP Inputs 0x%x: \n", inputs);
- while (inputs) {
- GLint attr = _mesa_ffs(inputs) - 1;
- const char *name = arb_input_attrib_string(attr,
- GL_VERTEX_PROGRAM_ARB);
- printf(" %d: %s\n", attr, name);
- inputs &= ~(1 << attr);
- }
-}
-
-
-/**
- * Print a fragment program's InputsRead field in human-readable format.
- * For debugging.
- */
-void
-_mesa_print_fp_inputs(GLbitfield inputs)
-{
- printf("FP Inputs 0x%x: \n", inputs);
- while (inputs) {
- GLint attr = _mesa_ffs(inputs) - 1;
- const char *name = arb_input_attrib_string(attr,
- GL_FRAGMENT_PROGRAM_ARB);
- printf(" %d: %s\n", attr, name);
- inputs &= ~(1 << attr);
- }
-}
-
-
-
-/**
- * Return ARB_v/f_prog-style output attrib string.
- */
-static const char *
-arb_output_attrib_string(GLint index, GLenum progType)
-{
- /*
- * These strings should match the VERT_RESULT_x and FRAG_RESULT_x tokens.
- */
- const char *vertResults[] = {
- "result.position",
- "result.color.primary",
- "result.color.secondary",
- "result.fogcoord",
- "result.texcoord[0]",
- "result.texcoord[1]",
- "result.texcoord[2]",
- "result.texcoord[3]",
- "result.texcoord[4]",
- "result.texcoord[5]",
- "result.texcoord[6]",
- "result.texcoord[7]",
- "result.varying[0]",
- "result.varying[1]",
- "result.varying[2]",
- "result.varying[3]",
- "result.varying[4]",
- "result.varying[5]",
- "result.varying[6]",
- "result.varying[7]"
- };
- const char *fragResults[] = {
- "result.color",
- "result.color(half)",
- "result.depth",
- "result.color[0]",
- "result.color[1]",
- "result.color[2]",
- "result.color[3]"
- };
-
- if (progType == GL_VERTEX_PROGRAM_ARB) {
- assert(index < sizeof(vertResults) / sizeof(vertResults[0]));
- return vertResults[index];
- }
- else {
- assert(index < sizeof(fragResults) / sizeof(fragResults[0]));
- return fragResults[index];
- }
-}
-
-
-/**
- * Return string representation of the given register.
- * Note that some types of registers (like PROGRAM_UNIFORM) aren't defined
- * by the ARB/NV program languages so we've taken some liberties here.
- * \param f the register file (PROGRAM_INPUT, PROGRAM_TEMPORARY, etc)
- * \param index number of the register in the register file
- * \param mode the output format/mode/style
- * \param prog pointer to containing program
- */
-static const char *
-reg_string(gl_register_file f, GLint index, gl_prog_print_mode mode,
- GLboolean relAddr, const struct gl_program *prog,
- GLboolean hasIndex2, GLboolean relAddr2, GLint index2)
-{
- static char str[100];
- const char *addr = relAddr ? "ADDR+" : "";
-
- str[0] = 0;
-
- switch (mode) {
- case PROG_PRINT_DEBUG:
- sprintf(str, "%s[%s%d]",
- _mesa_register_file_name(f), addr, index);
- if (hasIndex2) {
- int offset = strlen(str);
- const char *addr2 = relAddr2 ? "ADDR+" : "";
- sprintf(str+offset, "[%s%d]", addr2, index2);
- }
- break;
-
- case PROG_PRINT_ARB:
- switch (f) {
- case PROGRAM_INPUT:
- sprintf(str, "%s", arb_input_attrib_string(index, prog->Target));
- break;
- case PROGRAM_OUTPUT:
- sprintf(str, "%s", arb_output_attrib_string(index, prog->Target));
- break;
- case PROGRAM_TEMPORARY:
- sprintf(str, "temp%d", index);
- break;
- case PROGRAM_ENV_PARAM:
- sprintf(str, "program.env[%s%d]", addr, index);
- break;
- case PROGRAM_LOCAL_PARAM:
- sprintf(str, "program.local[%s%d]", addr, index);
- break;
- case PROGRAM_VARYING: /* extension */
- sprintf(str, "varying[%s%d]", addr, index);
- break;
- case PROGRAM_CONSTANT: /* extension */
- sprintf(str, "constant[%s%d]", addr, index);
- break;
- case PROGRAM_UNIFORM: /* extension */
- sprintf(str, "uniform[%s%d]", addr, index);
- break;
- case PROGRAM_SYSTEM_VALUE:
- sprintf(str, "sysvalue[%s%d]", addr, index);
- break;
- case PROGRAM_STATE_VAR:
- {
- struct gl_program_parameter *param
- = prog->Parameters->Parameters + index;
- char *state = _mesa_program_state_string(param->StateIndexes);
- sprintf(str, "%s", state);
- free(state);
- }
- break;
- case PROGRAM_ADDRESS:
- sprintf(str, "A%d", index);
- break;
- default:
- _mesa_problem(NULL, "bad file in reg_string()");
- }
- break;
-
- case PROG_PRINT_NV:
- switch (f) {
- case PROGRAM_INPUT:
- if (prog->Target == GL_VERTEX_PROGRAM_ARB)
- sprintf(str, "v[%d]", index);
- else
- sprintf(str, "f[%d]", index);
- break;
- case PROGRAM_OUTPUT:
- sprintf(str, "o[%d]", index);
- break;
- case PROGRAM_TEMPORARY:
- sprintf(str, "R%d", index);
- break;
- case PROGRAM_ENV_PARAM:
- sprintf(str, "c[%d]", index);
- break;
- case PROGRAM_VARYING: /* extension */
- sprintf(str, "varying[%s%d]", addr, index);
- break;
- case PROGRAM_UNIFORM: /* extension */
- sprintf(str, "uniform[%s%d]", addr, index);
- break;
- case PROGRAM_CONSTANT: /* extension */
- sprintf(str, "constant[%s%d]", addr, index);
- break;
- case PROGRAM_STATE_VAR: /* extension */
- sprintf(str, "state[%s%d]", addr, index);
- break;
- default:
- _mesa_problem(NULL, "bad file in reg_string()");
- }
- break;
-
- default:
- _mesa_problem(NULL, "bad mode in reg_string()");
- }
-
- return str;
-}
-
-
-/**
- * Return a string representation of the given swizzle word.
- * If extended is true, use extended (comma-separated) format.
- * \param swizzle the swizzle field
- * \param negateBase 4-bit negation vector
- * \param extended if true, also allow 0, 1 values
- */
-const char *
-_mesa_swizzle_string(GLuint swizzle, GLuint negateMask, GLboolean extended)
-{
- static const char swz[] = "xyzw01!?"; /* See SWIZZLE_x definitions */
- static char s[20];
- GLuint i = 0;
-
- if (!extended && swizzle == SWIZZLE_NOOP && negateMask == 0)
- return ""; /* no swizzle/negation */
-
- if (!extended)
- s[i++] = '.';
-
- if (negateMask & NEGATE_X)
- s[i++] = '-';
- s[i++] = swz[GET_SWZ(swizzle, 0)];
-
- if (extended) {
- s[i++] = ',';
- }
-
- if (negateMask & NEGATE_Y)
- s[i++] = '-';
- s[i++] = swz[GET_SWZ(swizzle, 1)];
-
- if (extended) {
- s[i++] = ',';
- }
-
- if (negateMask & NEGATE_Z)
- s[i++] = '-';
- s[i++] = swz[GET_SWZ(swizzle, 2)];
-
- if (extended) {
- s[i++] = ',';
- }
-
- if (negateMask & NEGATE_W)
- s[i++] = '-';
- s[i++] = swz[GET_SWZ(swizzle, 3)];
-
- s[i] = 0;
- return s;
-}
-
-
-void
-_mesa_print_swizzle(GLuint swizzle)
-{
- if (swizzle == SWIZZLE_XYZW) {
- printf(".xyzw\n");
- }
- else {
- const char *s = _mesa_swizzle_string(swizzle, 0, 0);
- printf("%s\n", s);
- }
-}
-
-
-const char *
-_mesa_writemask_string(GLuint writeMask)
-{
- static char s[10];
- GLuint i = 0;
-
- if (writeMask == WRITEMASK_XYZW)
- return "";
-
- s[i++] = '.';
- if (writeMask & WRITEMASK_X)
- s[i++] = 'x';
- if (writeMask & WRITEMASK_Y)
- s[i++] = 'y';
- if (writeMask & WRITEMASK_Z)
- s[i++] = 'z';
- if (writeMask & WRITEMASK_W)
- s[i++] = 'w';
-
- s[i] = 0;
- return s;
-}
-
-
-const char *
-_mesa_condcode_string(GLuint condcode)
-{
- switch (condcode) {
- case COND_GT: return "GT";
- case COND_EQ: return "EQ";
- case COND_LT: return "LT";
- case COND_UN: return "UN";
- case COND_GE: return "GE";
- case COND_LE: return "LE";
- case COND_NE: return "NE";
- case COND_TR: return "TR";
- case COND_FL: return "FL";
- default: return "cond???";
- }
-}
-
-
-static void
-fprint_dst_reg(FILE * f,
- const struct prog_dst_register *dstReg,
- gl_prog_print_mode mode,
- const struct gl_program *prog)
-{
- fprintf(f, "%s%s",
- reg_string((gl_register_file) dstReg->File,
- dstReg->Index, mode, dstReg->RelAddr, prog,
- GL_FALSE, GL_FALSE, 0),
- _mesa_writemask_string(dstReg->WriteMask));
-
- if (dstReg->CondMask != COND_TR) {
- fprintf(f, " (%s.%s)",
- _mesa_condcode_string(dstReg->CondMask),
- _mesa_swizzle_string(dstReg->CondSwizzle,
- GL_FALSE, GL_FALSE));
- }
-
-#if 0
- fprintf(f, "%s[%d]%s",
- _mesa_register_file_name((gl_register_file) dstReg->File),
- dstReg->Index,
- _mesa_writemask_string(dstReg->WriteMask));
-#endif
-}
-
-
-static void
-fprint_src_reg(FILE *f,
- const struct prog_src_register *srcReg,
- gl_prog_print_mode mode,
- const struct gl_program *prog)
-{
- const char *abs = srcReg->Abs ? "|" : "";
-
- fprintf(f, "%s%s%s%s",
- abs,
- reg_string((gl_register_file) srcReg->File,
- srcReg->Index, mode, srcReg->RelAddr, prog,
- srcReg->HasIndex2, srcReg->RelAddr2, srcReg->Index2),
- _mesa_swizzle_string(srcReg->Swizzle,
- srcReg->Negate, GL_FALSE),
- abs);
-#if 0
- fprintf(f, "%s[%d]%s",
- _mesa_register_file_name((gl_register_file) srcReg->File),
- srcReg->Index,
- _mesa_swizzle_string(srcReg->Swizzle,
- srcReg->Negate, GL_FALSE));
-#endif
-}
-
-
-static void
-fprint_comment(FILE *f, const struct prog_instruction *inst)
-{
- if (inst->Comment)
- fprintf(f, "; # %s\n", inst->Comment);
- else
- fprintf(f, ";\n");
-}
-
-
-void
-_mesa_fprint_alu_instruction(FILE *f,
- const struct prog_instruction *inst,
- const char *opcode_string, GLuint numRegs,
- gl_prog_print_mode mode,
- const struct gl_program *prog)
-{
- GLuint j;
-
- fprintf(f, "%s", opcode_string);
- if (inst->CondUpdate)
- fprintf(f, ".C");
-
- /* frag prog only */
- if (inst->SaturateMode == SATURATE_ZERO_ONE)
- fprintf(f, "_SAT");
-
- fprintf(f, " ");
- if (inst->DstReg.File != PROGRAM_UNDEFINED) {
- fprint_dst_reg(f, &inst->DstReg, mode, prog);
- }
- else {
- fprintf(f, " ???");
- }
-
- if (numRegs > 0)
- fprintf(f, ", ");
-
- for (j = 0; j < numRegs; j++) {
- fprint_src_reg(f, inst->SrcReg + j, mode, prog);
- if (j + 1 < numRegs)
- fprintf(f, ", ");
- }
-
- fprint_comment(f, inst);
-}
-
-
-void
-_mesa_print_alu_instruction(const struct prog_instruction *inst,
- const char *opcode_string, GLuint numRegs)
-{
- _mesa_fprint_alu_instruction(stderr, inst, opcode_string,
- numRegs, PROG_PRINT_DEBUG, NULL);
-}
-
-
-/**
- * Print a single vertex/fragment program instruction.
- */
-GLint
-_mesa_fprint_instruction_opt(FILE *f,
- const struct prog_instruction *inst,
- GLint indent,
- gl_prog_print_mode mode,
- const struct gl_program *prog)
-{
- GLint i;
-
- if (inst->Opcode == OPCODE_ELSE ||
- inst->Opcode == OPCODE_ENDIF ||
- inst->Opcode == OPCODE_ENDLOOP ||
- inst->Opcode == OPCODE_ENDSUB) {
- indent -= 3;
- }
- for (i = 0; i < indent; i++) {
- fprintf(f, " ");
- }
-
- switch (inst->Opcode) {
- case OPCODE_PRINT:
- fprintf(f, "PRINT '%s'", (char *) inst->Data);
- if (inst->SrcReg[0].File != PROGRAM_UNDEFINED) {
- fprintf(f, ", ");
- fprintf(f, "%s[%d]%s",
- _mesa_register_file_name((gl_register_file) inst->SrcReg[0].File),
- inst->SrcReg[0].Index,
- _mesa_swizzle_string(inst->SrcReg[0].Swizzle,
- inst->SrcReg[0].Negate, GL_FALSE));
- }
- if (inst->Comment)
- fprintf(f, " # %s", inst->Comment);
- fprint_comment(f, inst);
- break;
- case OPCODE_SWZ:
- fprintf(f, "SWZ");
- if (inst->SaturateMode == SATURATE_ZERO_ONE)
- fprintf(f, "_SAT");
- fprintf(f, " ");
- fprint_dst_reg(f, &inst->DstReg, mode, prog);
- fprintf(f, ", %s[%d], %s",
- _mesa_register_file_name((gl_register_file) inst->SrcReg[0].File),
- inst->SrcReg[0].Index,
- _mesa_swizzle_string(inst->SrcReg[0].Swizzle,
- inst->SrcReg[0].Negate, GL_TRUE));
- fprint_comment(f, inst);
- break;
- case OPCODE_TEX:
- case OPCODE_TXP:
- case OPCODE_TXL:
- case OPCODE_TXB:
- case OPCODE_TXD:
- fprintf(f, "%s", _mesa_opcode_string(inst->Opcode));
- if (inst->SaturateMode == SATURATE_ZERO_ONE)
- fprintf(f, "_SAT");
- fprintf(f, " ");
- fprint_dst_reg(f, &inst->DstReg, mode, prog);
- fprintf(f, ", ");
- fprint_src_reg(f, &inst->SrcReg[0], mode, prog);
- if (inst->Opcode == OPCODE_TXD) {
- fprintf(f, ", ");
- fprint_src_reg(f, &inst->SrcReg[1], mode, prog);
- fprintf(f, ", ");
- fprint_src_reg(f, &inst->SrcReg[2], mode, prog);
- }
- fprintf(f, ", texture[%d], ", inst->TexSrcUnit);
- switch (inst->TexSrcTarget) {
- case TEXTURE_1D_INDEX: fprintf(f, "1D"); break;
- case TEXTURE_2D_INDEX: fprintf(f, "2D"); break;
- case TEXTURE_3D_INDEX: fprintf(f, "3D"); break;
- case TEXTURE_CUBE_INDEX: fprintf(f, "CUBE"); break;
- case TEXTURE_RECT_INDEX: fprintf(f, "RECT"); break;
- case TEXTURE_1D_ARRAY_INDEX: fprintf(f, "1D_ARRAY"); break;
- case TEXTURE_2D_ARRAY_INDEX: fprintf(f, "2D_ARRAY"); break;
- default:
- ;
- }
- if (inst->TexShadow)
- fprintf(f, " SHADOW");
- fprint_comment(f, inst);
- break;
-
- case OPCODE_KIL:
- fprintf(f, "%s", _mesa_opcode_string(inst->Opcode));
- fprintf(f, " ");
- fprint_src_reg(f, &inst->SrcReg[0], mode, prog);
- fprint_comment(f, inst);
- break;
- case OPCODE_KIL_NV:
- fprintf(f, "%s", _mesa_opcode_string(inst->Opcode));
- fprintf(f, " ");
- fprintf(f, "%s.%s",
- _mesa_condcode_string(inst->DstReg.CondMask),
- _mesa_swizzle_string(inst->DstReg.CondSwizzle,
- GL_FALSE, GL_FALSE));
- fprint_comment(f, inst);
- break;
-
- case OPCODE_ARL:
- fprintf(f, "ARL ");
- fprint_dst_reg(f, &inst->DstReg, mode, prog);
- fprintf(f, ", ");
- fprint_src_reg(f, &inst->SrcReg[0], mode, prog);
- fprint_comment(f, inst);
- break;
- case OPCODE_BRA:
- fprintf(f, "BRA %d (%s%s)",
- inst->BranchTarget,
- _mesa_condcode_string(inst->DstReg.CondMask),
- _mesa_swizzle_string(inst->DstReg.CondSwizzle, 0, GL_FALSE));
- fprint_comment(f, inst);
- break;
- case OPCODE_IF:
- if (inst->SrcReg[0].File != PROGRAM_UNDEFINED) {
- /* Use ordinary register */
- fprintf(f, "IF ");
- fprint_src_reg(f, &inst->SrcReg[0], mode, prog);
- fprintf(f, "; ");
- }
- else {
- /* Use cond codes */
- fprintf(f, "IF (%s%s);",
- _mesa_condcode_string(inst->DstReg.CondMask),
- _mesa_swizzle_string(inst->DstReg.CondSwizzle,
- 0, GL_FALSE));
- }
- fprintf(f, " # (if false, goto %d)", inst->BranchTarget);
- fprint_comment(f, inst);
- return indent + 3;
- case OPCODE_ELSE:
- fprintf(f, "ELSE; # (goto %d)\n", inst->BranchTarget);
- return indent + 3;
- case OPCODE_ENDIF:
- fprintf(f, "ENDIF;\n");
- break;
- case OPCODE_BGNLOOP:
- fprintf(f, "BGNLOOP; # (end at %d)\n", inst->BranchTarget);
- return indent + 3;
- case OPCODE_ENDLOOP:
- fprintf(f, "ENDLOOP; # (goto %d)\n", inst->BranchTarget);
- break;
- case OPCODE_BRK:
- case OPCODE_CONT:
- fprintf(f, "%s (%s%s); # (goto %d)",
- _mesa_opcode_string(inst->Opcode),
- _mesa_condcode_string(inst->DstReg.CondMask),
- _mesa_swizzle_string(inst->DstReg.CondSwizzle, 0, GL_FALSE),
- inst->BranchTarget);
- fprint_comment(f, inst);
- break;
-
- case OPCODE_BGNSUB:
- if (mode == PROG_PRINT_NV) {
- fprintf(f, "%s:\n", inst->Comment); /* comment is label */
- return indent;
- }
- else {
- fprintf(f, "BGNSUB");
- fprint_comment(f, inst);
- return indent + 3;
- }
- case OPCODE_ENDSUB:
- if (mode == PROG_PRINT_DEBUG) {
- fprintf(f, "ENDSUB");
- fprint_comment(f, inst);
- }
- break;
- case OPCODE_CAL:
- if (mode == PROG_PRINT_NV) {
- fprintf(f, "CAL %s; # (goto %d)\n", inst->Comment, inst->BranchTarget);
- }
- else {
- fprintf(f, "CAL %u", inst->BranchTarget);
- fprint_comment(f, inst);
- }
- break;
- case OPCODE_RET:
- fprintf(f, "RET (%s%s)",
- _mesa_condcode_string(inst->DstReg.CondMask),
- _mesa_swizzle_string(inst->DstReg.CondSwizzle, 0, GL_FALSE));
- fprint_comment(f, inst);
- break;
-
- case OPCODE_END:
- fprintf(f, "END\n");
- break;
- case OPCODE_NOP:
- if (mode == PROG_PRINT_DEBUG) {
- fprintf(f, "NOP");
- fprint_comment(f, inst);
- }
- else if (inst->Comment) {
- /* ARB/NV extensions don't have NOP instruction */
- fprintf(f, "# %s\n", inst->Comment);
- }
- break;
- case OPCODE_EMIT_VERTEX:
- fprintf(f, "EMIT_VERTEX\n");
- break;
- case OPCODE_END_PRIMITIVE:
- fprintf(f, "END_PRIMITIVE\n");
- break;
- /* XXX may need other special-case instructions */
- default:
- if (inst->Opcode < MAX_OPCODE) {
- /* typical alu instruction */
- _mesa_fprint_alu_instruction(f, inst,
- _mesa_opcode_string(inst->Opcode),
- _mesa_num_inst_src_regs(inst->Opcode),
- mode, prog);
- }
- else {
- _mesa_fprint_alu_instruction(f, inst,
- _mesa_opcode_string(inst->Opcode),
- 3/*_mesa_num_inst_src_regs(inst->Opcode)*/,
- mode, prog);
- }
- break;
- }
- return indent;
-}
-
-
-GLint
-_mesa_print_instruction_opt(const struct prog_instruction *inst,
- GLint indent,
- gl_prog_print_mode mode,
- const struct gl_program *prog)
-{
- return _mesa_fprint_instruction_opt(stderr, inst, indent, mode, prog);
-}
-
-
-void
-_mesa_print_instruction(const struct prog_instruction *inst)
-{
- /* note: 4th param should be ignored for PROG_PRINT_DEBUG */
- _mesa_fprint_instruction_opt(stderr, inst, 0, PROG_PRINT_DEBUG, NULL);
-}
-
-
-
-/**
- * Print program, with options.
- */
-void
-_mesa_fprint_program_opt(FILE *f,
- const struct gl_program *prog,
- gl_prog_print_mode mode,
- GLboolean lineNumbers)
-{
- GLuint i, indent = 0;
-
- switch (prog->Target) {
- case GL_VERTEX_PROGRAM_ARB:
- if (mode == PROG_PRINT_ARB)
- fprintf(f, "!!ARBvp1.0\n");
- else if (mode == PROG_PRINT_NV)
- fprintf(f, "!!VP1.0\n");
- else
- fprintf(f, "# Vertex Program/Shader %u\n", prog->Id);
- break;
- case GL_FRAGMENT_PROGRAM_ARB:
- case GL_FRAGMENT_PROGRAM_NV:
- if (mode == PROG_PRINT_ARB)
- fprintf(f, "!!ARBfp1.0\n");
- else if (mode == PROG_PRINT_NV)
- fprintf(f, "!!FP1.0\n");
- else
- fprintf(f, "# Fragment Program/Shader %u\n", prog->Id);
- break;
- case MESA_GEOMETRY_PROGRAM:
- fprintf(f, "# Geometry Shader\n");
- }
-
- for (i = 0; i < prog->NumInstructions; i++) {
- if (lineNumbers)
- fprintf(f, "%3d: ", i);
- indent = _mesa_fprint_instruction_opt(f, prog->Instructions + i,
- indent, mode, prog);
- }
-}
-
-
-/**
- * Print program to stderr, default options.
- */
-void
-_mesa_print_program(const struct gl_program *prog)
-{
- _mesa_fprint_program_opt(stderr, prog, PROG_PRINT_DEBUG, GL_TRUE);
-}
-
-
-/**
- * Return binary representation of 64-bit value (as a string).
- * Insert a comma to separate each group of 8 bits.
- * Note we return a pointer to local static storage so this is not
- * re-entrant, etc.
- * XXX move to imports.[ch] if useful elsewhere.
- */
-static const char *
-binary(GLbitfield64 val)
-{
- static char buf[80];
- GLint i, len = 0;
- for (i = 63; i >= 0; --i) {
- if (val & (BITFIELD64_BIT(i)))
- buf[len++] = '1';
- else if (len > 0 || i == 0)
- buf[len++] = '0';
- if (len > 0 && ((i-1) % 8) == 7)
- buf[len++] = ',';
- }
- buf[len] = '\0';
- return buf;
-}
-
-
-/**
- * Print all of a program's parameters/fields to given file.
- */
-static void
-_mesa_fprint_program_parameters(FILE *f,
- struct gl_context *ctx,
- const struct gl_program *prog)
-{
- GLuint i;
-
- fprintf(f, "InputsRead: 0x%x (0b%s)\n",
- prog->InputsRead, binary(prog->InputsRead));
- fprintf(f, "OutputsWritten: 0x%llx (0b%s)\n",
- (unsigned long long)prog->OutputsWritten,
- binary(prog->OutputsWritten));
- fprintf(f, "NumInstructions=%d\n", prog->NumInstructions);
- fprintf(f, "NumTemporaries=%d\n", prog->NumTemporaries);
- fprintf(f, "NumParameters=%d\n", prog->NumParameters);
- fprintf(f, "NumAttributes=%d\n", prog->NumAttributes);
- fprintf(f, "NumAddressRegs=%d\n", prog->NumAddressRegs);
- fprintf(f, "IndirectRegisterFiles: 0x%x (0b%s)\n",
- prog->IndirectRegisterFiles, binary(prog->IndirectRegisterFiles));
- fprintf(f, "SamplersUsed: 0x%x (0b%s)\n",
- prog->SamplersUsed, binary(prog->SamplersUsed));
- fprintf(f, "Samplers=[ ");
- for (i = 0; i < MAX_SAMPLERS; i++) {
- fprintf(f, "%d ", prog->SamplerUnits[i]);
- }
- fprintf(f, "]\n");
-
- _mesa_load_state_parameters(ctx, prog->Parameters);
-
-#if 0
- fprintf(f, "Local Params:\n");
- for (i = 0; i < MAX_PROGRAM_LOCAL_PARAMS; i++){
- const GLfloat *p = prog->LocalParams[i];
- fprintf(f, "%2d: %f, %f, %f, %f\n", i, p[0], p[1], p[2], p[3]);
- }
-#endif
- _mesa_print_parameter_list(prog->Parameters);
-}
-
-
-/**
- * Print all of a program's parameters/fields to stderr.
- */
-void
-_mesa_print_program_parameters(struct gl_context *ctx, const struct gl_program *prog)
-{
- _mesa_fprint_program_parameters(stderr, ctx, prog);
-}
-
-
-/**
- * Print a program parameter list to given file.
- */
-static void
-_mesa_fprint_parameter_list(FILE *f,
- const struct gl_program_parameter_list *list)
-{
- GLuint i;
-
- if (!list)
- return;
-
- if (0)
- fprintf(f, "param list %p\n", (void *) list);
- fprintf(f, "dirty state flags: 0x%x\n", list->StateFlags);
- for (i = 0; i < list->NumParameters; i++){
- struct gl_program_parameter *param = list->Parameters + i;
- const GLfloat *v = list->ParameterValues[i];
- fprintf(f, "param[%d] sz=%d %s %s = {%.3g, %.3g, %.3g, %.3g}",
- i, param->Size,
- _mesa_register_file_name(list->Parameters[i].Type),
- param->Name, v[0], v[1], v[2], v[3]);
- if (param->Flags & PROG_PARAM_BIT_CENTROID)
- fprintf(f, " Centroid");
- if (param->Flags & PROG_PARAM_BIT_INVARIANT)
- fprintf(f, " Invariant");
- if (param->Flags & PROG_PARAM_BIT_FLAT)
- fprintf(f, " Flat");
- if (param->Flags & PROG_PARAM_BIT_LINEAR)
- fprintf(f, " Linear");
- fprintf(f, "\n");
- }
-}
-
-
-/**
- * Print a program parameter list to stderr.
- */
-void
-_mesa_print_parameter_list(const struct gl_program_parameter_list *list)
-{
- _mesa_fprint_parameter_list(stderr, list);
-}
-
-
-/**
- * Write shader and associated info to a file.
- */
-void
-_mesa_write_shader_to_file(const struct gl_shader *shader)
-{
- const char *type;
- char filename[100];
- FILE *f;
-
- if (shader->Type == GL_FRAGMENT_SHADER)
- type = "frag";
- else if (shader->Type == GL_VERTEX_SHADER)
- type = "vert";
- else
- type = "geom";
-
- _mesa_snprintf(filename, sizeof(filename), "shader_%u.%s", shader->Name, type);
- f = fopen(filename, "w");
- if (!f) {
- fprintf(stderr, "Unable to open %s for writing\n", filename);
- return;
- }
-
- fprintf(f, "/* Shader %u source, checksum %u */\n", shader->Name, shader->SourceChecksum);
- fputs(shader->Source, f);
- fprintf(f, "\n");
-
- fprintf(f, "/* Compile status: %s */\n",
- shader->CompileStatus ? "ok" : "fail");
- fprintf(f, "/* Log Info: */\n");
- if (shader->InfoLog) {
- fputs(shader->InfoLog, f);
- }
- if (shader->CompileStatus && shader->Program) {
- fprintf(f, "/* GPU code */\n");
- fprintf(f, "/*\n");
- _mesa_fprint_program_opt(f, shader->Program, PROG_PRINT_DEBUG, GL_TRUE);
- fprintf(f, "*/\n");
- fprintf(f, "/* Parameters / constants */\n");
- fprintf(f, "/*\n");
- _mesa_fprint_parameter_list(f, shader->Program->Parameters);
- fprintf(f, "*/\n");
- }
-
- fclose(f);
-}
-
-
-/**
- * Append the shader's uniform info/values to the shader log file.
- * The log file will typically have been created by the
- * _mesa_write_shader_to_file function.
- */
-void
-_mesa_append_uniforms_to_file(const struct gl_shader *shader,
- const struct gl_program *prog)
-{
- const char *type;
- char filename[100];
- FILE *f;
-
- if (shader->Type == GL_FRAGMENT_SHADER)
- type = "frag";
- else
- type = "vert";
-
- _mesa_snprintf(filename, sizeof(filename), "shader_%u.%s", shader->Name, type);
- f = fopen(filename, "a"); /* append */
- if (!f) {
- fprintf(stderr, "Unable to open %s for appending\n", filename);
- return;
- }
-
- fprintf(f, "/* First-draw parameters / constants */\n");
- fprintf(f, "/*\n");
- _mesa_fprint_parameter_list(f, prog->Parameters);
- fprintf(f, "*/\n");
-
- fclose(f);
-}
+/*
+ * Mesa 3-D graphics library
+ * Version: 7.3
+ *
+ * Copyright (C) 1999-2008 Brian Paul All Rights Reserved.
+ * Copyright (C) 2009 VMware, Inc. All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+/**
+ * \file prog_print.c
+ * Print vertex/fragment programs - for debugging.
+ * \author Brian Paul
+ */
+
+#include "main/glheader.h"
+#include "main/context.h"
+#include "main/imports.h"
+#include "prog_instruction.h"
+#include "prog_parameter.h"
+#include "prog_print.h"
+#include "prog_statevars.h"
+
+
+
+/**
+ * Return string name for given program/register file.
+ */
+const char *
+_mesa_register_file_name(gl_register_file f)
+{
+ switch (f) {
+ case PROGRAM_TEMPORARY:
+ return "TEMP";
+ case PROGRAM_LOCAL_PARAM:
+ return "LOCAL";
+ case PROGRAM_ENV_PARAM:
+ return "ENV";
+ case PROGRAM_STATE_VAR:
+ return "STATE";
+ case PROGRAM_INPUT:
+ return "INPUT";
+ case PROGRAM_OUTPUT:
+ return "OUTPUT";
+ case PROGRAM_NAMED_PARAM:
+ return "NAMED";
+ case PROGRAM_CONSTANT:
+ return "CONST";
+ case PROGRAM_UNIFORM:
+ return "UNIFORM";
+ case PROGRAM_VARYING:
+ return "VARYING";
+ case PROGRAM_WRITE_ONLY:
+ return "WRITE_ONLY";
+ case PROGRAM_ADDRESS:
+ return "ADDR";
+ case PROGRAM_SAMPLER:
+ return "SAMPLER";
+ case PROGRAM_SYSTEM_VALUE:
+ return "SYSVAL";
+ case PROGRAM_UNDEFINED:
+ return "UNDEFINED";
+ default:
+ {
+ static char s[20];
+ _mesa_snprintf(s, sizeof(s), "FILE%u", f);
+ return s;
+ }
+ }
+}
+
+
+/**
+ * Return ARB_v/f_prog-style input attrib string.
+ */
+static const char *
+arb_input_attrib_string(GLint index, GLenum progType)
+{
+ /*
+ * These strings should match the VERT_ATTRIB_x and FRAG_ATTRIB_x tokens.
+ */
+ const char *vertAttribs[] = {
+ "vertex.position",
+ "vertex.weight",
+ "vertex.normal",
+ "vertex.color.primary",
+ "vertex.color.secondary",
+ "vertex.fogcoord",
+ "vertex.(six)",
+ "vertex.(seven)",
+ "vertex.texcoord[0]",
+ "vertex.texcoord[1]",
+ "vertex.texcoord[2]",
+ "vertex.texcoord[3]",
+ "vertex.texcoord[4]",
+ "vertex.texcoord[5]",
+ "vertex.texcoord[6]",
+ "vertex.texcoord[7]",
+ "vertex.attrib[0]",
+ "vertex.attrib[1]",
+ "vertex.attrib[2]",
+ "vertex.attrib[3]",
+ "vertex.attrib[4]",
+ "vertex.attrib[5]",
+ "vertex.attrib[6]",
+ "vertex.attrib[7]",
+ "vertex.attrib[8]",
+ "vertex.attrib[9]",
+ "vertex.attrib[10]",
+ "vertex.attrib[11]",
+ "vertex.attrib[12]",
+ "vertex.attrib[13]",
+ "vertex.attrib[14]",
+ "vertex.attrib[15]"
+ };
+ const char *fragAttribs[] = {
+ "fragment.position",
+ "fragment.color.primary",
+ "fragment.color.secondary",
+ "fragment.fogcoord",
+ "fragment.texcoord[0]",
+ "fragment.texcoord[1]",
+ "fragment.texcoord[2]",
+ "fragment.texcoord[3]",
+ "fragment.texcoord[4]",
+ "fragment.texcoord[5]",
+ "fragment.texcoord[6]",
+ "fragment.texcoord[7]",
+ "fragment.varying[0]",
+ "fragment.varying[1]",
+ "fragment.varying[2]",
+ "fragment.varying[3]",
+ "fragment.varying[4]",
+ "fragment.varying[5]",
+ "fragment.varying[6]",
+ "fragment.varying[7]"
+ };
+
+ /* sanity checks */
+ assert(strcmp(vertAttribs[VERT_ATTRIB_TEX0], "vertex.texcoord[0]") == 0);
+ assert(strcmp(vertAttribs[VERT_ATTRIB_GENERIC15], "vertex.attrib[15]") == 0);
+
+ if (progType == GL_VERTEX_PROGRAM_ARB) {
+ assert(index < sizeof(vertAttribs) / sizeof(vertAttribs[0]));
+ return vertAttribs[index];
+ }
+ else {
+ assert(index < sizeof(fragAttribs) / sizeof(fragAttribs[0]));
+ return fragAttribs[index];
+ }
+}
+
+
+/**
+ * Print a vertex program's InputsRead field in human-readable format.
+ * For debugging.
+ */
+void
+_mesa_print_vp_inputs(GLbitfield inputs)
+{
+ printf("VP Inputs 0x%x: \n", inputs);
+ while (inputs) {
+ GLint attr = _mesa_ffs(inputs) - 1;
+ const char *name = arb_input_attrib_string(attr,
+ GL_VERTEX_PROGRAM_ARB);
+ printf(" %d: %s\n", attr, name);
+ inputs &= ~(1 << attr);
+ }
+}
+
+
+/**
+ * Print a fragment program's InputsRead field in human-readable format.
+ * For debugging.
+ */
+void
+_mesa_print_fp_inputs(GLbitfield inputs)
+{
+ printf("FP Inputs 0x%x: \n", inputs);
+ while (inputs) {
+ GLint attr = _mesa_ffs(inputs) - 1;
+ const char *name = arb_input_attrib_string(attr,
+ GL_FRAGMENT_PROGRAM_ARB);
+ printf(" %d: %s\n", attr, name);
+ inputs &= ~(1 << attr);
+ }
+}
+
+
+
+/**
+ * Return ARB_v/f_prog-style output attrib string.
+ */
+static const char *
+arb_output_attrib_string(GLint index, GLenum progType)
+{
+ /*
+ * These strings should match the VERT_RESULT_x and FRAG_RESULT_x tokens.
+ */
+ const char *vertResults[] = {
+ "result.position",
+ "result.color.primary",
+ "result.color.secondary",
+ "result.fogcoord",
+ "result.texcoord[0]",
+ "result.texcoord[1]",
+ "result.texcoord[2]",
+ "result.texcoord[3]",
+ "result.texcoord[4]",
+ "result.texcoord[5]",
+ "result.texcoord[6]",
+ "result.texcoord[7]",
+ "result.varying[0]",
+ "result.varying[1]",
+ "result.varying[2]",
+ "result.varying[3]",
+ "result.varying[4]",
+ "result.varying[5]",
+ "result.varying[6]",
+ "result.varying[7]"
+ };
+ const char *fragResults[] = {
+ "result.color",
+ "result.color(half)",
+ "result.depth",
+ "result.color[0]",
+ "result.color[1]",
+ "result.color[2]",
+ "result.color[3]"
+ };
+
+ if (progType == GL_VERTEX_PROGRAM_ARB) {
+ assert(index < sizeof(vertResults) / sizeof(vertResults[0]));
+ return vertResults[index];
+ }
+ else {
+ assert(index < sizeof(fragResults) / sizeof(fragResults[0]));
+ return fragResults[index];
+ }
+}
+
+
+/**
+ * Return string representation of the given register.
+ * Note that some types of registers (like PROGRAM_UNIFORM) aren't defined
+ * by the ARB/NV program languages so we've taken some liberties here.
+ * \param f the register file (PROGRAM_INPUT, PROGRAM_TEMPORARY, etc)
+ * \param index number of the register in the register file
+ * \param mode the output format/mode/style
+ * \param prog pointer to containing program
+ */
+static const char *
+reg_string(gl_register_file f, GLint index, gl_prog_print_mode mode,
+ GLboolean relAddr, const struct gl_program *prog,
+ GLboolean hasIndex2, GLboolean relAddr2, GLint index2)
+{
+ static char str[100];
+ const char *addr = relAddr ? "ADDR+" : "";
+
+ str[0] = 0;
+
+ switch (mode) {
+ case PROG_PRINT_DEBUG:
+ sprintf(str, "%s[%s%d]",
+ _mesa_register_file_name(f), addr, index);
+ if (hasIndex2) {
+ int offset = strlen(str);
+ const char *addr2 = relAddr2 ? "ADDR+" : "";
+ sprintf(str+offset, "[%s%d]", addr2, index2);
+ }
+ break;
+
+ case PROG_PRINT_ARB:
+ switch (f) {
+ case PROGRAM_INPUT:
+ sprintf(str, "%s", arb_input_attrib_string(index, prog->Target));
+ break;
+ case PROGRAM_OUTPUT:
+ sprintf(str, "%s", arb_output_attrib_string(index, prog->Target));
+ break;
+ case PROGRAM_TEMPORARY:
+ sprintf(str, "temp%d", index);
+ break;
+ case PROGRAM_ENV_PARAM:
+ sprintf(str, "program.env[%s%d]", addr, index);
+ break;
+ case PROGRAM_LOCAL_PARAM:
+ sprintf(str, "program.local[%s%d]", addr, index);
+ break;
+ case PROGRAM_VARYING: /* extension */
+ sprintf(str, "varying[%s%d]", addr, index);
+ break;
+ case PROGRAM_CONSTANT: /* extension */
+ sprintf(str, "constant[%s%d]", addr, index);
+ break;
+ case PROGRAM_UNIFORM: /* extension */
+ sprintf(str, "uniform[%s%d]", addr, index);
+ break;
+ case PROGRAM_SYSTEM_VALUE:
+ sprintf(str, "sysvalue[%s%d]", addr, index);
+ break;
+ case PROGRAM_STATE_VAR:
+ {
+ struct gl_program_parameter *param
+ = prog->Parameters->Parameters + index;
+ char *state = _mesa_program_state_string(param->StateIndexes);
+ sprintf(str, "%s", state);
+ free(state);
+ }
+ break;
+ case PROGRAM_ADDRESS:
+ sprintf(str, "A%d", index);
+ break;
+ default:
+ _mesa_problem(NULL, "bad file in reg_string()");
+ }
+ break;
+
+ case PROG_PRINT_NV:
+ switch (f) {
+ case PROGRAM_INPUT:
+ if (prog->Target == GL_VERTEX_PROGRAM_ARB)
+ sprintf(str, "v[%d]", index);
+ else
+ sprintf(str, "f[%d]", index);
+ break;
+ case PROGRAM_OUTPUT:
+ sprintf(str, "o[%d]", index);
+ break;
+ case PROGRAM_TEMPORARY:
+ sprintf(str, "R%d", index);
+ break;
+ case PROGRAM_ENV_PARAM:
+ sprintf(str, "c[%d]", index);
+ break;
+ case PROGRAM_VARYING: /* extension */
+ sprintf(str, "varying[%s%d]", addr, index);
+ break;
+ case PROGRAM_UNIFORM: /* extension */
+ sprintf(str, "uniform[%s%d]", addr, index);
+ break;
+ case PROGRAM_CONSTANT: /* extension */
+ sprintf(str, "constant[%s%d]", addr, index);
+ break;
+ case PROGRAM_STATE_VAR: /* extension */
+ sprintf(str, "state[%s%d]", addr, index);
+ break;
+ default:
+ _mesa_problem(NULL, "bad file in reg_string()");
+ }
+ break;
+
+ default:
+ _mesa_problem(NULL, "bad mode in reg_string()");
+ }
+
+ return str;
+}
+
+
+/**
+ * Return a string representation of the given swizzle word.
+ * If extended is true, use extended (comma-separated) format.
+ * \param swizzle the swizzle field
+ * \param negateBase 4-bit negation vector
+ * \param extended if true, also allow 0, 1 values
+ */
+const char *
+_mesa_swizzle_string(GLuint swizzle, GLuint negateMask, GLboolean extended)
+{
+ static const char swz[] = "xyzw01!?"; /* See SWIZZLE_x definitions */
+ static char s[20];
+ GLuint i = 0;
+
+ if (!extended && swizzle == SWIZZLE_NOOP && negateMask == 0)
+ return ""; /* no swizzle/negation */
+
+ if (!extended)
+ s[i++] = '.';
+
+ if (negateMask & NEGATE_X)
+ s[i++] = '-';
+ s[i++] = swz[GET_SWZ(swizzle, 0)];
+
+ if (extended) {
+ s[i++] = ',';
+ }
+
+ if (negateMask & NEGATE_Y)
+ s[i++] = '-';
+ s[i++] = swz[GET_SWZ(swizzle, 1)];
+
+ if (extended) {
+ s[i++] = ',';
+ }
+
+ if (negateMask & NEGATE_Z)
+ s[i++] = '-';
+ s[i++] = swz[GET_SWZ(swizzle, 2)];
+
+ if (extended) {
+ s[i++] = ',';
+ }
+
+ if (negateMask & NEGATE_W)
+ s[i++] = '-';
+ s[i++] = swz[GET_SWZ(swizzle, 3)];
+
+ s[i] = 0;
+ return s;
+}
+
+
+void
+_mesa_print_swizzle(GLuint swizzle)
+{
+ if (swizzle == SWIZZLE_XYZW) {
+ printf(".xyzw\n");
+ }
+ else {
+ const char *s = _mesa_swizzle_string(swizzle, 0, 0);
+ printf("%s\n", s);
+ }
+}
+
+
+const char *
+_mesa_writemask_string(GLuint writeMask)
+{
+ static char s[10];
+ GLuint i = 0;
+
+ if (writeMask == WRITEMASK_XYZW)
+ return "";
+
+ s[i++] = '.';
+ if (writeMask & WRITEMASK_X)
+ s[i++] = 'x';
+ if (writeMask & WRITEMASK_Y)
+ s[i++] = 'y';
+ if (writeMask & WRITEMASK_Z)
+ s[i++] = 'z';
+ if (writeMask & WRITEMASK_W)
+ s[i++] = 'w';
+
+ s[i] = 0;
+ return s;
+}
+
+
+const char *
+_mesa_condcode_string(GLuint condcode)
+{
+ switch (condcode) {
+ case COND_GT: return "GT";
+ case COND_EQ: return "EQ";
+ case COND_LT: return "LT";
+ case COND_UN: return "UN";
+ case COND_GE: return "GE";
+ case COND_LE: return "LE";
+ case COND_NE: return "NE";
+ case COND_TR: return "TR";
+ case COND_FL: return "FL";
+ default: return "cond???";
+ }
+}
+
+
+static void
+fprint_dst_reg(FILE * f,
+ const struct prog_dst_register *dstReg,
+ gl_prog_print_mode mode,
+ const struct gl_program *prog)
+{
+ fprintf(f, "%s%s",
+ reg_string((gl_register_file) dstReg->File,
+ dstReg->Index, mode, dstReg->RelAddr, prog,
+ GL_FALSE, GL_FALSE, 0),
+ _mesa_writemask_string(dstReg->WriteMask));
+
+ if (dstReg->CondMask != COND_TR) {
+ fprintf(f, " (%s.%s)",
+ _mesa_condcode_string(dstReg->CondMask),
+ _mesa_swizzle_string(dstReg->CondSwizzle,
+ GL_FALSE, GL_FALSE));
+ }
+
+#if 0
+ fprintf(f, "%s[%d]%s",
+ _mesa_register_file_name((gl_register_file) dstReg->File),
+ dstReg->Index,
+ _mesa_writemask_string(dstReg->WriteMask));
+#endif
+}
+
+
+static void
+fprint_src_reg(FILE *f,
+ const struct prog_src_register *srcReg,
+ gl_prog_print_mode mode,
+ const struct gl_program *prog)
+{
+ const char *abs = srcReg->Abs ? "|" : "";
+
+ fprintf(f, "%s%s%s%s",
+ abs,
+ reg_string((gl_register_file) srcReg->File,
+ srcReg->Index, mode, srcReg->RelAddr, prog,
+ srcReg->HasIndex2, srcReg->RelAddr2, srcReg->Index2),
+ _mesa_swizzle_string(srcReg->Swizzle,
+ srcReg->Negate, GL_FALSE),
+ abs);
+#if 0
+ fprintf(f, "%s[%d]%s",
+ _mesa_register_file_name((gl_register_file) srcReg->File),
+ srcReg->Index,
+ _mesa_swizzle_string(srcReg->Swizzle,
+ srcReg->Negate, GL_FALSE));
+#endif
+}
+
+
+static void
+fprint_comment(FILE *f, const struct prog_instruction *inst)
+{
+ if (inst->Comment)
+ fprintf(f, "; # %s\n", inst->Comment);
+ else
+ fprintf(f, ";\n");
+}
+
+
+void
+_mesa_fprint_alu_instruction(FILE *f,
+ const struct prog_instruction *inst,
+ const char *opcode_string, GLuint numRegs,
+ gl_prog_print_mode mode,
+ const struct gl_program *prog)
+{
+ GLuint j;
+
+ fprintf(f, "%s", opcode_string);
+ if (inst->CondUpdate)
+ fprintf(f, ".C");
+
+ /* frag prog only */
+ if (inst->SaturateMode == SATURATE_ZERO_ONE)
+ fprintf(f, "_SAT");
+
+ fprintf(f, " ");
+ if (inst->DstReg.File != PROGRAM_UNDEFINED) {
+ fprint_dst_reg(f, &inst->DstReg, mode, prog);
+ }
+ else {
+ fprintf(f, " ???");
+ }
+
+ if (numRegs > 0)
+ fprintf(f, ", ");
+
+ for (j = 0; j < numRegs; j++) {
+ fprint_src_reg(f, inst->SrcReg + j, mode, prog);
+ if (j + 1 < numRegs)
+ fprintf(f, ", ");
+ }
+
+ fprint_comment(f, inst);
+}
+
+
+void
+_mesa_print_alu_instruction(const struct prog_instruction *inst,
+ const char *opcode_string, GLuint numRegs)
+{
+ _mesa_fprint_alu_instruction(stderr, inst, opcode_string,
+ numRegs, PROG_PRINT_DEBUG, NULL);
+}
+
+
+/**
+ * Print a single vertex/fragment program instruction.
+ */
+GLint
+_mesa_fprint_instruction_opt(FILE *f,
+ const struct prog_instruction *inst,
+ GLint indent,
+ gl_prog_print_mode mode,
+ const struct gl_program *prog)
+{
+ GLint i;
+
+ if (inst->Opcode == OPCODE_ELSE ||
+ inst->Opcode == OPCODE_ENDIF ||
+ inst->Opcode == OPCODE_ENDLOOP ||
+ inst->Opcode == OPCODE_ENDSUB) {
+ indent -= 3;
+ }
+ for (i = 0; i < indent; i++) {
+ fprintf(f, " ");
+ }
+
+ switch (inst->Opcode) {
+ case OPCODE_PRINT:
+ fprintf(f, "PRINT '%s'", (char *) inst->Data);
+ if (inst->SrcReg[0].File != PROGRAM_UNDEFINED) {
+ fprintf(f, ", ");
+ fprintf(f, "%s[%d]%s",
+ _mesa_register_file_name((gl_register_file) inst->SrcReg[0].File),
+ inst->SrcReg[0].Index,
+ _mesa_swizzle_string(inst->SrcReg[0].Swizzle,
+ inst->SrcReg[0].Negate, GL_FALSE));
+ }
+ if (inst->Comment)
+ fprintf(f, " # %s", inst->Comment);
+ fprint_comment(f, inst);
+ break;
+ case OPCODE_SWZ:
+ fprintf(f, "SWZ");
+ if (inst->SaturateMode == SATURATE_ZERO_ONE)
+ fprintf(f, "_SAT");
+ fprintf(f, " ");
+ fprint_dst_reg(f, &inst->DstReg, mode, prog);
+ fprintf(f, ", %s[%d], %s",
+ _mesa_register_file_name((gl_register_file) inst->SrcReg[0].File),
+ inst->SrcReg[0].Index,
+ _mesa_swizzle_string(inst->SrcReg[0].Swizzle,
+ inst->SrcReg[0].Negate, GL_TRUE));
+ fprint_comment(f, inst);
+ break;
+ case OPCODE_TEX:
+ case OPCODE_TXP:
+ case OPCODE_TXL:
+ case OPCODE_TXB:
+ case OPCODE_TXD:
+ fprintf(f, "%s", _mesa_opcode_string(inst->Opcode));
+ if (inst->SaturateMode == SATURATE_ZERO_ONE)
+ fprintf(f, "_SAT");
+ fprintf(f, " ");
+ fprint_dst_reg(f, &inst->DstReg, mode, prog);
+ fprintf(f, ", ");
+ fprint_src_reg(f, &inst->SrcReg[0], mode, prog);
+ if (inst->Opcode == OPCODE_TXD) {
+ fprintf(f, ", ");
+ fprint_src_reg(f, &inst->SrcReg[1], mode, prog);
+ fprintf(f, ", ");
+ fprint_src_reg(f, &inst->SrcReg[2], mode, prog);
+ }
+ fprintf(f, ", texture[%d], ", inst->TexSrcUnit);
+ switch (inst->TexSrcTarget) {
+ case TEXTURE_1D_INDEX: fprintf(f, "1D"); break;
+ case TEXTURE_2D_INDEX: fprintf(f, "2D"); break;
+ case TEXTURE_3D_INDEX: fprintf(f, "3D"); break;
+ case TEXTURE_CUBE_INDEX: fprintf(f, "CUBE"); break;
+ case TEXTURE_RECT_INDEX: fprintf(f, "RECT"); break;
+ case TEXTURE_1D_ARRAY_INDEX: fprintf(f, "1D_ARRAY"); break;
+ case TEXTURE_2D_ARRAY_INDEX: fprintf(f, "2D_ARRAY"); break;
+ default:
+ ;
+ }
+ if (inst->TexShadow)
+ fprintf(f, " SHADOW");
+ fprint_comment(f, inst);
+ break;
+
+ case OPCODE_KIL:
+ fprintf(f, "%s", _mesa_opcode_string(inst->Opcode));
+ fprintf(f, " ");
+ fprint_src_reg(f, &inst->SrcReg[0], mode, prog);
+ fprint_comment(f, inst);
+ break;
+ case OPCODE_KIL_NV:
+ fprintf(f, "%s", _mesa_opcode_string(inst->Opcode));
+ fprintf(f, " ");
+ fprintf(f, "%s.%s",
+ _mesa_condcode_string(inst->DstReg.CondMask),
+ _mesa_swizzle_string(inst->DstReg.CondSwizzle,
+ GL_FALSE, GL_FALSE));
+ fprint_comment(f, inst);
+ break;
+
+ case OPCODE_ARL:
+ fprintf(f, "ARL ");
+ fprint_dst_reg(f, &inst->DstReg, mode, prog);
+ fprintf(f, ", ");
+ fprint_src_reg(f, &inst->SrcReg[0], mode, prog);
+ fprint_comment(f, inst);
+ break;
+ case OPCODE_BRA:
+ fprintf(f, "BRA %d (%s%s)",
+ inst->BranchTarget,
+ _mesa_condcode_string(inst->DstReg.CondMask),
+ _mesa_swizzle_string(inst->DstReg.CondSwizzle, 0, GL_FALSE));
+ fprint_comment(f, inst);
+ break;
+ case OPCODE_IF:
+ if (inst->SrcReg[0].File != PROGRAM_UNDEFINED) {
+ /* Use ordinary register */
+ fprintf(f, "IF ");
+ fprint_src_reg(f, &inst->SrcReg[0], mode, prog);
+ fprintf(f, "; ");
+ }
+ else {
+ /* Use cond codes */
+ fprintf(f, "IF (%s%s);",
+ _mesa_condcode_string(inst->DstReg.CondMask),
+ _mesa_swizzle_string(inst->DstReg.CondSwizzle,
+ 0, GL_FALSE));
+ }
+ fprintf(f, " # (if false, goto %d)", inst->BranchTarget);
+ fprint_comment(f, inst);
+ return indent + 3;
+ case OPCODE_ELSE:
+ fprintf(f, "ELSE; # (goto %d)\n", inst->BranchTarget);
+ return indent + 3;
+ case OPCODE_ENDIF:
+ fprintf(f, "ENDIF;\n");
+ break;
+ case OPCODE_BGNLOOP:
+ fprintf(f, "BGNLOOP; # (end at %d)\n", inst->BranchTarget);
+ return indent + 3;
+ case OPCODE_ENDLOOP:
+ fprintf(f, "ENDLOOP; # (goto %d)\n", inst->BranchTarget);
+ break;
+ case OPCODE_BRK:
+ case OPCODE_CONT:
+ fprintf(f, "%s (%s%s); # (goto %d)",
+ _mesa_opcode_string(inst->Opcode),
+ _mesa_condcode_string(inst->DstReg.CondMask),
+ _mesa_swizzle_string(inst->DstReg.CondSwizzle, 0, GL_FALSE),
+ inst->BranchTarget);
+ fprint_comment(f, inst);
+ break;
+
+ case OPCODE_BGNSUB:
+ if (mode == PROG_PRINT_NV) {
+ fprintf(f, "%s:\n", inst->Comment); /* comment is label */
+ return indent;
+ }
+ else {
+ fprintf(f, "BGNSUB");
+ fprint_comment(f, inst);
+ return indent + 3;
+ }
+ case OPCODE_ENDSUB:
+ if (mode == PROG_PRINT_DEBUG) {
+ fprintf(f, "ENDSUB");
+ fprint_comment(f, inst);
+ }
+ break;
+ case OPCODE_CAL:
+ if (mode == PROG_PRINT_NV) {
+ fprintf(f, "CAL %s; # (goto %d)\n", inst->Comment, inst->BranchTarget);
+ }
+ else {
+ fprintf(f, "CAL %u", inst->BranchTarget);
+ fprint_comment(f, inst);
+ }
+ break;
+ case OPCODE_RET:
+ fprintf(f, "RET (%s%s)",
+ _mesa_condcode_string(inst->DstReg.CondMask),
+ _mesa_swizzle_string(inst->DstReg.CondSwizzle, 0, GL_FALSE));
+ fprint_comment(f, inst);
+ break;
+
+ case OPCODE_END:
+ fprintf(f, "END\n");
+ break;
+ case OPCODE_NOP:
+ if (mode == PROG_PRINT_DEBUG) {
+ fprintf(f, "NOP");
+ fprint_comment(f, inst);
+ }
+ else if (inst->Comment) {
+ /* ARB/NV extensions don't have NOP instruction */
+ fprintf(f, "# %s\n", inst->Comment);
+ }
+ break;
+ case OPCODE_EMIT_VERTEX:
+ fprintf(f, "EMIT_VERTEX\n");
+ break;
+ case OPCODE_END_PRIMITIVE:
+ fprintf(f, "END_PRIMITIVE\n");
+ break;
+ /* XXX may need other special-case instructions */
+ default:
+ if (inst->Opcode < MAX_OPCODE) {
+ /* typical alu instruction */
+ _mesa_fprint_alu_instruction(f, inst,
+ _mesa_opcode_string(inst->Opcode),
+ _mesa_num_inst_src_regs(inst->Opcode),
+ mode, prog);
+ }
+ else {
+ _mesa_fprint_alu_instruction(f, inst,
+ _mesa_opcode_string(inst->Opcode),
+ 3/*_mesa_num_inst_src_regs(inst->Opcode)*/,
+ mode, prog);
+ }
+ break;
+ }
+ return indent;
+}
+
+
+GLint
+_mesa_print_instruction_opt(const struct prog_instruction *inst,
+ GLint indent,
+ gl_prog_print_mode mode,
+ const struct gl_program *prog)
+{
+ return _mesa_fprint_instruction_opt(stderr, inst, indent, mode, prog);
+}
+
+
+void
+_mesa_print_instruction(const struct prog_instruction *inst)
+{
+ /* note: 4th param should be ignored for PROG_PRINT_DEBUG */
+ _mesa_fprint_instruction_opt(stderr, inst, 0, PROG_PRINT_DEBUG, NULL);
+}
+
+
+
+/**
+ * Print program, with options.
+ */
+void
+_mesa_fprint_program_opt(FILE *f,
+ const struct gl_program *prog,
+ gl_prog_print_mode mode,
+ GLboolean lineNumbers)
+{
+ GLuint i, indent = 0;
+
+ switch (prog->Target) {
+ case GL_VERTEX_PROGRAM_ARB:
+ if (mode == PROG_PRINT_ARB)
+ fprintf(f, "!!ARBvp1.0\n");
+ else if (mode == PROG_PRINT_NV)
+ fprintf(f, "!!VP1.0\n");
+ else
+ fprintf(f, "# Vertex Program/Shader %u\n", prog->Id);
+ break;
+ case GL_FRAGMENT_PROGRAM_ARB:
+ case GL_FRAGMENT_PROGRAM_NV:
+ if (mode == PROG_PRINT_ARB)
+ fprintf(f, "!!ARBfp1.0\n");
+ else if (mode == PROG_PRINT_NV)
+ fprintf(f, "!!FP1.0\n");
+ else
+ fprintf(f, "# Fragment Program/Shader %u\n", prog->Id);
+ break;
+ case MESA_GEOMETRY_PROGRAM:
+ fprintf(f, "# Geometry Shader\n");
+ }
+
+ for (i = 0; i < prog->NumInstructions; i++) {
+ if (lineNumbers)
+ fprintf(f, "%3d: ", i);
+ indent = _mesa_fprint_instruction_opt(f, prog->Instructions + i,
+ indent, mode, prog);
+ }
+}
+
+
+/**
+ * Print program to stderr, default options.
+ */
+void
+_mesa_print_program(const struct gl_program *prog)
+{
+ _mesa_fprint_program_opt(stderr, prog, PROG_PRINT_DEBUG, GL_TRUE);
+}
+
+
+/**
+ * Return binary representation of 64-bit value (as a string).
+ * Insert a comma to separate each group of 8 bits.
+ * Note we return a pointer to local static storage so this is not
+ * re-entrant, etc.
+ * XXX move to imports.[ch] if useful elsewhere.
+ */
+static const char *
+binary(GLbitfield64 val)
+{
+ static char buf[80];
+ GLint i, len = 0;
+ for (i = 63; i >= 0; --i) {
+ if (val & (BITFIELD64_BIT(i)))
+ buf[len++] = '1';
+ else if (len > 0 || i == 0)
+ buf[len++] = '0';
+ if (len > 0 && ((i-1) % 8) == 7)
+ buf[len++] = ',';
+ }
+ buf[len] = '\0';
+ return buf;
+}
+
+
+/**
+ * Print all of a program's parameters/fields to given file.
+ */
+static void
+_mesa_fprint_program_parameters(FILE *f,
+ struct gl_context *ctx,
+ const struct gl_program *prog)
+{
+ GLuint i;
+
+ fprintf(f, "InputsRead: 0x%x (0b%s)\n",
+ prog->InputsRead, binary(prog->InputsRead));
+ fprintf(f, "OutputsWritten: 0x%llx (0b%s)\n",
+ (unsigned long long)prog->OutputsWritten,
+ binary(prog->OutputsWritten));
+ fprintf(f, "NumInstructions=%d\n", prog->NumInstructions);
+ fprintf(f, "NumTemporaries=%d\n", prog->NumTemporaries);
+ fprintf(f, "NumParameters=%d\n", prog->NumParameters);
+ fprintf(f, "NumAttributes=%d\n", prog->NumAttributes);
+ fprintf(f, "NumAddressRegs=%d\n", prog->NumAddressRegs);
+ fprintf(f, "IndirectRegisterFiles: 0x%x (0b%s)\n",
+ prog->IndirectRegisterFiles, binary(prog->IndirectRegisterFiles));
+ fprintf(f, "SamplersUsed: 0x%x (0b%s)\n",
+ prog->SamplersUsed, binary(prog->SamplersUsed));
+ fprintf(f, "Samplers=[ ");
+ for (i = 0; i < MAX_SAMPLERS; i++) {
+ fprintf(f, "%d ", prog->SamplerUnits[i]);
+ }
+ fprintf(f, "]\n");
+
+ _mesa_load_state_parameters(ctx, prog->Parameters);
+
+#if 0
+ fprintf(f, "Local Params:\n");
+ for (i = 0; i < MAX_PROGRAM_LOCAL_PARAMS; i++){
+ const GLfloat *p = prog->LocalParams[i];
+ fprintf(f, "%2d: %f, %f, %f, %f\n", i, p[0], p[1], p[2], p[3]);
+ }
+#endif
+ _mesa_print_parameter_list(prog->Parameters);
+}
+
+
+/**
+ * Print all of a program's parameters/fields to stderr.
+ */
+void
+_mesa_print_program_parameters(struct gl_context *ctx, const struct gl_program *prog)
+{
+ _mesa_fprint_program_parameters(stderr, ctx, prog);
+}
+
+
+/**
+ * Print a program parameter list to given file.
+ */
+static void
+_mesa_fprint_parameter_list(FILE *f,
+ const struct gl_program_parameter_list *list)
+{
+ GLuint i;
+
+ if (!list)
+ return;
+
+ if (0)
+ fprintf(f, "param list %p\n", (void *) list);
+ fprintf(f, "dirty state flags: 0x%x\n", list->StateFlags);
+ for (i = 0; i < list->NumParameters; i++){
+ struct gl_program_parameter *param = list->Parameters + i;
+ const GLfloat *v = list->ParameterValues[i];
+ fprintf(f, "param[%d] sz=%d %s %s = {%.3g, %.3g, %.3g, %.3g}",
+ i, param->Size,
+ _mesa_register_file_name(list->Parameters[i].Type),
+ param->Name, v[0], v[1], v[2], v[3]);
+ if (param->Flags & PROG_PARAM_BIT_CENTROID)
+ fprintf(f, " Centroid");
+ if (param->Flags & PROG_PARAM_BIT_INVARIANT)
+ fprintf(f, " Invariant");
+ if (param->Flags & PROG_PARAM_BIT_FLAT)
+ fprintf(f, " Flat");
+ if (param->Flags & PROG_PARAM_BIT_LINEAR)
+ fprintf(f, " Linear");
+ fprintf(f, "\n");
+ }
+}
+
+
+/**
+ * Print a program parameter list to stderr.
+ */
+void
+_mesa_print_parameter_list(const struct gl_program_parameter_list *list)
+{
+ _mesa_fprint_parameter_list(stderr, list);
+}
+
+
+/**
+ * Write shader and associated info to a file.
+ */
+void
+_mesa_write_shader_to_file(const struct gl_shader *shader)
+{
+ const char *type;
+ char filename[100];
+ FILE *f;
+
+ if (shader->Type == GL_FRAGMENT_SHADER)
+ type = "frag";
+ else if (shader->Type == GL_VERTEX_SHADER)
+ type = "vert";
+ else
+ type = "geom";
+
+ _mesa_snprintf(filename, sizeof(filename), "shader_%u.%s", shader->Name, type);
+ f = fopen(filename, "w");
+ if (!f) {
+ fprintf(stderr, "Unable to open %s for writing\n", filename);
+ return;
+ }
+
+ fprintf(f, "/* Shader %u source, checksum %u */\n", shader->Name, shader->SourceChecksum);
+ fputs(shader->Source, f);
+ fprintf(f, "\n");
+
+ fprintf(f, "/* Compile status: %s */\n",
+ shader->CompileStatus ? "ok" : "fail");
+ fprintf(f, "/* Log Info: */\n");
+ if (shader->InfoLog) {
+ fputs(shader->InfoLog, f);
+ }
+ if (shader->CompileStatus && shader->Program) {
+ fprintf(f, "/* GPU code */\n");
+ fprintf(f, "/*\n");
+ _mesa_fprint_program_opt(f, shader->Program, PROG_PRINT_DEBUG, GL_TRUE);
+ fprintf(f, "*/\n");
+ fprintf(f, "/* Parameters / constants */\n");
+ fprintf(f, "/*\n");
+ _mesa_fprint_parameter_list(f, shader->Program->Parameters);
+ fprintf(f, "*/\n");
+ }
+
+ fclose(f);
+}
+
+
+/**
+ * Append the shader's uniform info/values to the shader log file.
+ * The log file will typically have been created by the
+ * _mesa_write_shader_to_file function.
+ */
+void
+_mesa_append_uniforms_to_file(const struct gl_shader *shader,
+ const struct gl_program *prog)
+{
+ const char *type;
+ char filename[100];
+ FILE *f;
+
+ if (shader->Type == GL_FRAGMENT_SHADER)
+ type = "frag";
+ else
+ type = "vert";
+
+ _mesa_snprintf(filename, sizeof(filename), "shader_%u.%s", shader->Name, type);
+ f = fopen(filename, "a"); /* append */
+ if (!f) {
+ fprintf(stderr, "Unable to open %s for appending\n", filename);
+ return;
+ }
+
+ fprintf(f, "/* First-draw parameters / constants */\n");
+ fprintf(f, "/*\n");
+ _mesa_fprint_parameter_list(f, prog->Parameters);
+ fprintf(f, "*/\n");
+
+ fclose(f);
+}
diff --git a/mesalib/src/mesa/program/prog_statevars.c b/mesalib/src/mesa/program/prog_statevars.c
index 16f9690e8..ddda78e19 100644
--- a/mesalib/src/mesa/program/prog_statevars.c
+++ b/mesalib/src/mesa/program/prog_statevars.c
@@ -1,1208 +1,1208 @@
-/*
- * Mesa 3-D graphics library
- * Version: 7.1
- *
- * Copyright (C) 1999-2007 Brian Paul All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-/**
- * \file prog_statevars.c
- * Program state variable management.
- * \author Brian Paul
- */
-
-
-#include "main/glheader.h"
-#include "main/context.h"
-#include "main/imports.h"
-#include "main/macros.h"
-#include "main/mtypes.h"
-#include "prog_statevars.h"
-#include "prog_parameter.h"
-
-
-/**
- * Use the list of tokens in the state[] array to find global GL state
- * and return it in <value>. Usually, four values are returned in <value>
- * but matrix queries may return as many as 16 values.
- * This function is used for ARB vertex/fragment programs.
- * The program parser will produce the state[] values.
- */
-static void
-_mesa_fetch_state(struct gl_context *ctx, const gl_state_index state[],
- GLfloat *value)
-{
- switch (state[0]) {
- case STATE_MATERIAL:
- {
- /* state[1] is either 0=front or 1=back side */
- const GLuint face = (GLuint) state[1];
- const struct gl_material *mat = &ctx->Light.Material;
- ASSERT(face == 0 || face == 1);
- /* we rely on tokens numbered so that _BACK_ == _FRONT_+ 1 */
- ASSERT(MAT_ATTRIB_FRONT_AMBIENT + 1 == MAT_ATTRIB_BACK_AMBIENT);
- /* XXX we could get rid of this switch entirely with a little
- * work in arbprogparse.c's parse_state_single_item().
- */
- /* state[2] is the material attribute */
- switch (state[2]) {
- case STATE_AMBIENT:
- COPY_4V(value, mat->Attrib[MAT_ATTRIB_FRONT_AMBIENT + face]);
- return;
- case STATE_DIFFUSE:
- COPY_4V(value, mat->Attrib[MAT_ATTRIB_FRONT_DIFFUSE + face]);
- return;
- case STATE_SPECULAR:
- COPY_4V(value, mat->Attrib[MAT_ATTRIB_FRONT_SPECULAR + face]);
- return;
- case STATE_EMISSION:
- COPY_4V(value, mat->Attrib[MAT_ATTRIB_FRONT_EMISSION + face]);
- return;
- case STATE_SHININESS:
- value[0] = mat->Attrib[MAT_ATTRIB_FRONT_SHININESS + face][0];
- value[1] = 0.0F;
- value[2] = 0.0F;
- value[3] = 1.0F;
- return;
- default:
- _mesa_problem(ctx, "Invalid material state in fetch_state");
- return;
- }
- }
- case STATE_LIGHT:
- {
- /* state[1] is the light number */
- const GLuint ln = (GLuint) state[1];
- /* state[2] is the light attribute */
- switch (state[2]) {
- case STATE_AMBIENT:
- COPY_4V(value, ctx->Light.Light[ln].Ambient);
- return;
- case STATE_DIFFUSE:
- COPY_4V(value, ctx->Light.Light[ln].Diffuse);
- return;
- case STATE_SPECULAR:
- COPY_4V(value, ctx->Light.Light[ln].Specular);
- return;
- case STATE_POSITION:
- COPY_4V(value, ctx->Light.Light[ln].EyePosition);
- return;
- case STATE_ATTENUATION:
- value[0] = ctx->Light.Light[ln].ConstantAttenuation;
- value[1] = ctx->Light.Light[ln].LinearAttenuation;
- value[2] = ctx->Light.Light[ln].QuadraticAttenuation;
- value[3] = ctx->Light.Light[ln].SpotExponent;
- return;
- case STATE_SPOT_DIRECTION:
- COPY_3V(value, ctx->Light.Light[ln].SpotDirection);
- value[3] = ctx->Light.Light[ln]._CosCutoff;
- return;
- case STATE_SPOT_CUTOFF:
- value[0] = ctx->Light.Light[ln].SpotCutoff;
- return;
- case STATE_HALF_VECTOR:
- {
- static const GLfloat eye_z[] = {0, 0, 1};
- GLfloat p[3];
- /* Compute infinite half angle vector:
- * halfVector = normalize(normalize(lightPos) + (0, 0, 1))
- * light.EyePosition.w should be 0 for infinite lights.
- */
- COPY_3V(p, ctx->Light.Light[ln].EyePosition);
- NORMALIZE_3FV(p);
- ADD_3V(value, p, eye_z);
- NORMALIZE_3FV(value);
- value[3] = 1.0;
- }
- return;
- default:
- _mesa_problem(ctx, "Invalid light state in fetch_state");
- return;
- }
- }
- case STATE_LIGHTMODEL_AMBIENT:
- COPY_4V(value, ctx->Light.Model.Ambient);
- return;
- case STATE_LIGHTMODEL_SCENECOLOR:
- if (state[1] == 0) {
- /* front */
- GLint i;
- for (i = 0; i < 3; i++) {
- value[i] = ctx->Light.Model.Ambient[i]
- * ctx->Light.Material.Attrib[MAT_ATTRIB_FRONT_AMBIENT][i]
- + ctx->Light.Material.Attrib[MAT_ATTRIB_FRONT_EMISSION][i];
- }
- value[3] = ctx->Light.Material.Attrib[MAT_ATTRIB_FRONT_DIFFUSE][3];
- }
- else {
- /* back */
- GLint i;
- for (i = 0; i < 3; i++) {
- value[i] = ctx->Light.Model.Ambient[i]
- * ctx->Light.Material.Attrib[MAT_ATTRIB_BACK_AMBIENT][i]
- + ctx->Light.Material.Attrib[MAT_ATTRIB_BACK_EMISSION][i];
- }
- value[3] = ctx->Light.Material.Attrib[MAT_ATTRIB_BACK_DIFFUSE][3];
- }
- return;
- case STATE_LIGHTPROD:
- {
- const GLuint ln = (GLuint) state[1];
- const GLuint face = (GLuint) state[2];
- GLint i;
- ASSERT(face == 0 || face == 1);
- switch (state[3]) {
- case STATE_AMBIENT:
- for (i = 0; i < 3; i++) {
- value[i] = ctx->Light.Light[ln].Ambient[i] *
- ctx->Light.Material.Attrib[MAT_ATTRIB_FRONT_AMBIENT+face][i];
- }
- /* [3] = material alpha */
- value[3] = ctx->Light.Material.Attrib[MAT_ATTRIB_FRONT_AMBIENT+face][3];
- return;
- case STATE_DIFFUSE:
- for (i = 0; i < 3; i++) {
- value[i] = ctx->Light.Light[ln].Diffuse[i] *
- ctx->Light.Material.Attrib[MAT_ATTRIB_FRONT_DIFFUSE+face][i];
- }
- /* [3] = material alpha */
- value[3] = ctx->Light.Material.Attrib[MAT_ATTRIB_FRONT_DIFFUSE+face][3];
- return;
- case STATE_SPECULAR:
- for (i = 0; i < 3; i++) {
- value[i] = ctx->Light.Light[ln].Specular[i] *
- ctx->Light.Material.Attrib[MAT_ATTRIB_FRONT_SPECULAR+face][i];
- }
- /* [3] = material alpha */
- value[3] = ctx->Light.Material.Attrib[MAT_ATTRIB_FRONT_SPECULAR+face][3];
- return;
- default:
- _mesa_problem(ctx, "Invalid lightprod state in fetch_state");
- return;
- }
- }
- case STATE_TEXGEN:
- {
- /* state[1] is the texture unit */
- const GLuint unit = (GLuint) state[1];
- /* state[2] is the texgen attribute */
- switch (state[2]) {
- case STATE_TEXGEN_EYE_S:
- COPY_4V(value, ctx->Texture.Unit[unit].GenS.EyePlane);
- return;
- case STATE_TEXGEN_EYE_T:
- COPY_4V(value, ctx->Texture.Unit[unit].GenT.EyePlane);
- return;
- case STATE_TEXGEN_EYE_R:
- COPY_4V(value, ctx->Texture.Unit[unit].GenR.EyePlane);
- return;
- case STATE_TEXGEN_EYE_Q:
- COPY_4V(value, ctx->Texture.Unit[unit].GenQ.EyePlane);
- return;
- case STATE_TEXGEN_OBJECT_S:
- COPY_4V(value, ctx->Texture.Unit[unit].GenS.ObjectPlane);
- return;
- case STATE_TEXGEN_OBJECT_T:
- COPY_4V(value, ctx->Texture.Unit[unit].GenT.ObjectPlane);
- return;
- case STATE_TEXGEN_OBJECT_R:
- COPY_4V(value, ctx->Texture.Unit[unit].GenR.ObjectPlane);
- return;
- case STATE_TEXGEN_OBJECT_Q:
- COPY_4V(value, ctx->Texture.Unit[unit].GenQ.ObjectPlane);
- return;
- default:
- _mesa_problem(ctx, "Invalid texgen state in fetch_state");
- return;
- }
- }
- case STATE_TEXENV_COLOR:
- {
- /* state[1] is the texture unit */
- const GLuint unit = (GLuint) state[1];
- if(ctx->Color._ClampFragmentColor)
- COPY_4V(value, ctx->Texture.Unit[unit].EnvColor);
- else
- COPY_4V(value, ctx->Texture.Unit[unit].EnvColorUnclamped);
- }
- return;
- case STATE_FOG_COLOR:
- if(ctx->Color._ClampFragmentColor)
- COPY_4V(value, ctx->Fog.Color);
- else
- COPY_4V(value, ctx->Fog.ColorUnclamped);
- return;
- case STATE_FOG_PARAMS:
- value[0] = ctx->Fog.Density;
- value[1] = ctx->Fog.Start;
- value[2] = ctx->Fog.End;
- value[3] = (ctx->Fog.End == ctx->Fog.Start)
- ? 1.0f : (GLfloat)(1.0 / (ctx->Fog.End - ctx->Fog.Start));
- return;
- case STATE_CLIPPLANE:
- {
- const GLuint plane = (GLuint) state[1];
- COPY_4V(value, ctx->Transform.EyeUserPlane[plane]);
- }
- return;
- case STATE_POINT_SIZE:
- value[0] = ctx->Point.Size;
- value[1] = ctx->Point.MinSize;
- value[2] = ctx->Point.MaxSize;
- value[3] = ctx->Point.Threshold;
- return;
- case STATE_POINT_ATTENUATION:
- value[0] = ctx->Point.Params[0];
- value[1] = ctx->Point.Params[1];
- value[2] = ctx->Point.Params[2];
- value[3] = 1.0F;
- return;
- case STATE_MODELVIEW_MATRIX:
- case STATE_PROJECTION_MATRIX:
- case STATE_MVP_MATRIX:
- case STATE_TEXTURE_MATRIX:
- case STATE_PROGRAM_MATRIX:
- {
- /* state[0] = modelview, projection, texture, etc. */
- /* state[1] = which texture matrix or program matrix */
- /* state[2] = first row to fetch */
- /* state[3] = last row to fetch */
- /* state[4] = transpose, inverse or invtrans */
- const GLmatrix *matrix;
- const gl_state_index mat = state[0];
- const GLuint index = (GLuint) state[1];
- const GLuint firstRow = (GLuint) state[2];
- const GLuint lastRow = (GLuint) state[3];
- const gl_state_index modifier = state[4];
- const GLfloat *m;
- GLuint row, i;
- ASSERT(firstRow >= 0);
- ASSERT(firstRow < 4);
- ASSERT(lastRow >= 0);
- ASSERT(lastRow < 4);
- if (mat == STATE_MODELVIEW_MATRIX) {
- matrix = ctx->ModelviewMatrixStack.Top;
- }
- else if (mat == STATE_PROJECTION_MATRIX) {
- matrix = ctx->ProjectionMatrixStack.Top;
- }
- else if (mat == STATE_MVP_MATRIX) {
- matrix = &ctx->_ModelProjectMatrix;
- }
- else if (mat == STATE_TEXTURE_MATRIX) {
- ASSERT(index < Elements(ctx->TextureMatrixStack));
- matrix = ctx->TextureMatrixStack[index].Top;
- }
- else if (mat == STATE_PROGRAM_MATRIX) {
- ASSERT(index < Elements(ctx->ProgramMatrixStack));
- matrix = ctx->ProgramMatrixStack[index].Top;
- }
- else {
- _mesa_problem(ctx, "Bad matrix name in _mesa_fetch_state()");
- return;
- }
- if (modifier == STATE_MATRIX_INVERSE ||
- modifier == STATE_MATRIX_INVTRANS) {
- /* Be sure inverse is up to date:
- */
- _math_matrix_alloc_inv( (GLmatrix *) matrix );
- _math_matrix_analyse( (GLmatrix*) matrix );
- m = matrix->inv;
- }
- else {
- m = matrix->m;
- }
- if (modifier == STATE_MATRIX_TRANSPOSE ||
- modifier == STATE_MATRIX_INVTRANS) {
- for (i = 0, row = firstRow; row <= lastRow; row++) {
- value[i++] = m[row * 4 + 0];
- value[i++] = m[row * 4 + 1];
- value[i++] = m[row * 4 + 2];
- value[i++] = m[row * 4 + 3];
- }
- }
- else {
- for (i = 0, row = firstRow; row <= lastRow; row++) {
- value[i++] = m[row + 0];
- value[i++] = m[row + 4];
- value[i++] = m[row + 8];
- value[i++] = m[row + 12];
- }
- }
- }
- return;
- case STATE_DEPTH_RANGE:
- value[0] = ctx->Viewport.Near; /* near */
- value[1] = ctx->Viewport.Far; /* far */
- value[2] = ctx->Viewport.Far - ctx->Viewport.Near; /* far - near */
- value[3] = 1.0;
- return;
- case STATE_FRAGMENT_PROGRAM:
- {
- /* state[1] = {STATE_ENV, STATE_LOCAL} */
- /* state[2] = parameter index */
- const int idx = (int) state[2];
- switch (state[1]) {
- case STATE_ENV:
- COPY_4V(value, ctx->FragmentProgram.Parameters[idx]);
- return;
- case STATE_LOCAL:
- COPY_4V(value, ctx->FragmentProgram.Current->Base.LocalParams[idx]);
- return;
- default:
- _mesa_problem(ctx, "Bad state switch in _mesa_fetch_state()");
- return;
- }
- }
- return;
-
- case STATE_VERTEX_PROGRAM:
- {
- /* state[1] = {STATE_ENV, STATE_LOCAL} */
- /* state[2] = parameter index */
- const int idx = (int) state[2];
- switch (state[1]) {
- case STATE_ENV:
- COPY_4V(value, ctx->VertexProgram.Parameters[idx]);
- return;
- case STATE_LOCAL:
- COPY_4V(value, ctx->VertexProgram.Current->Base.LocalParams[idx]);
- return;
- default:
- _mesa_problem(ctx, "Bad state switch in _mesa_fetch_state()");
- return;
- }
- }
- return;
-
- case STATE_NORMAL_SCALE:
- ASSIGN_4V(value, ctx->_ModelViewInvScale, 0, 0, 1);
- return;
-
- case STATE_INTERNAL:
- switch (state[1]) {
- case STATE_CURRENT_ATTRIB:
- {
- const GLuint idx = (GLuint) state[2];
- COPY_4V(value, ctx->Current.Attrib[idx]);
- }
- return;
-
- case STATE_CURRENT_ATTRIB_MAYBE_VP_CLAMPED:
- {
- const GLuint idx = (GLuint) state[2];
- if(ctx->Light._ClampVertexColor &&
- (idx == VERT_ATTRIB_COLOR0 ||
- idx == VERT_ATTRIB_COLOR1)) {
- value[0] = CLAMP(ctx->Current.Attrib[idx][0], 0.0f, 1.0f);
- value[1] = CLAMP(ctx->Current.Attrib[idx][1], 0.0f, 1.0f);
- value[2] = CLAMP(ctx->Current.Attrib[idx][2], 0.0f, 1.0f);
- value[3] = CLAMP(ctx->Current.Attrib[idx][3], 0.0f, 1.0f);
- }
- else
- COPY_4V(value, ctx->Current.Attrib[idx]);
- }
- return;
-
- case STATE_NORMAL_SCALE:
- ASSIGN_4V(value,
- ctx->_ModelViewInvScale,
- ctx->_ModelViewInvScale,
- ctx->_ModelViewInvScale,
- 1);
- return;
-
- case STATE_TEXRECT_SCALE:
- /* Value = { 1/texWidth, 1/texHeight, 0, 1 }.
- * Used to convert unnormalized texcoords to normalized texcoords.
- */
- {
- const int unit = (int) state[2];
- const struct gl_texture_object *texObj
- = ctx->Texture.Unit[unit]._Current;
- if (texObj) {
- struct gl_texture_image *texImage = texObj->Image[0][0];
- ASSIGN_4V(value,
- (GLfloat) (1.0 / texImage->Width),
- (GLfloat) (1.0 / texImage->Height),
- 0.0f, 1.0f);
- }
- }
- return;
-
- case STATE_FOG_PARAMS_OPTIMIZED:
- /* for simpler per-vertex/pixel fog calcs. POW (for EXP/EXP2 fog)
- * might be more expensive than EX2 on some hw, plus it needs
- * another constant (e) anyway. Linear fog can now be done with a
- * single MAD.
- * linear: fogcoord * -1/(end-start) + end/(end-start)
- * exp: 2^-(density/ln(2) * fogcoord)
- * exp2: 2^-((density/(ln(2)^2) * fogcoord)^2)
- */
- value[0] = (ctx->Fog.End == ctx->Fog.Start)
- ? 1.0f : (GLfloat)(-1.0F / (ctx->Fog.End - ctx->Fog.Start));
- value[1] = ctx->Fog.End * -value[0];
- value[2] = (GLfloat)(ctx->Fog.Density * M_LOG2E); /* M_LOG2E == 1/ln(2) */
- value[3] = (GLfloat)(ctx->Fog.Density * ONE_DIV_SQRT_LN2);
- return;
-
- case STATE_POINT_SIZE_CLAMPED:
- {
- /* this includes implementation dependent limits, to avoid
- * another potentially necessary clamp.
- * Note: for sprites, point smooth (point AA) is ignored
- * and we'll clamp to MinPointSizeAA and MaxPointSize, because we
- * expect drivers will want to say their minimum for AA size is 0.0
- * but for non-AA it's 1.0 (because normal points with size below 1.0
- * need to get rounded up to 1.0, hence never disappear). GL does
- * not specify max clamp size for sprites, other than it needs to be
- * at least as large as max AA size, hence use non-AA size there.
- */
- GLfloat minImplSize;
- GLfloat maxImplSize;
- if (ctx->Point.PointSprite) {
- minImplSize = ctx->Const.MinPointSizeAA;
- maxImplSize = ctx->Const.MaxPointSize;
- }
- else if (ctx->Point.SmoothFlag || ctx->Multisample._Enabled) {
- minImplSize = ctx->Const.MinPointSizeAA;
- maxImplSize = ctx->Const.MaxPointSizeAA;
- }
- else {
- minImplSize = ctx->Const.MinPointSize;
- maxImplSize = ctx->Const.MaxPointSize;
- }
- value[0] = ctx->Point.Size;
- value[1] = ctx->Point.MinSize >= minImplSize ? ctx->Point.MinSize : minImplSize;
- value[2] = ctx->Point.MaxSize <= maxImplSize ? ctx->Point.MaxSize : maxImplSize;
- value[3] = ctx->Point.Threshold;
- }
- return;
- case STATE_POINT_SIZE_IMPL_CLAMP:
- {
- /* for implementation clamp only in vs */
- GLfloat minImplSize;
- GLfloat maxImplSize;
- if (ctx->Point.PointSprite) {
- minImplSize = ctx->Const.MinPointSizeAA;
- maxImplSize = ctx->Const.MaxPointSize;
- }
- else if (ctx->Point.SmoothFlag || ctx->Multisample._Enabled) {
- minImplSize = ctx->Const.MinPointSizeAA;
- maxImplSize = ctx->Const.MaxPointSizeAA;
- }
- else {
- minImplSize = ctx->Const.MinPointSize;
- maxImplSize = ctx->Const.MaxPointSize;
- }
- value[0] = ctx->Point.Size;
- value[1] = minImplSize;
- value[2] = maxImplSize;
- value[3] = ctx->Point.Threshold;
- }
- return;
- case STATE_LIGHT_SPOT_DIR_NORMALIZED:
- {
- /* here, state[2] is the light number */
- /* pre-normalize spot dir */
- const GLuint ln = (GLuint) state[2];
- COPY_3V(value, ctx->Light.Light[ln]._NormSpotDirection);
- value[3] = ctx->Light.Light[ln]._CosCutoff;
- }
- return;
-
- case STATE_LIGHT_POSITION:
- {
- const GLuint ln = (GLuint) state[2];
- COPY_4V(value, ctx->Light.Light[ln]._Position);
- }
- return;
-
- case STATE_LIGHT_POSITION_NORMALIZED:
- {
- const GLuint ln = (GLuint) state[2];
- COPY_4V(value, ctx->Light.Light[ln]._Position);
- NORMALIZE_3FV( value );
- }
- return;
-
- case STATE_LIGHT_HALF_VECTOR:
- {
- const GLuint ln = (GLuint) state[2];
- GLfloat p[3];
- /* Compute infinite half angle vector:
- * halfVector = normalize(normalize(lightPos) + (0, 0, 1))
- * light.EyePosition.w should be 0 for infinite lights.
- */
- COPY_3V(p, ctx->Light.Light[ln]._Position);
- NORMALIZE_3FV(p);
- ADD_3V(value, p, ctx->_EyeZDir);
- NORMALIZE_3FV(value);
- value[3] = 1.0;
- }
- return;
-
- case STATE_PT_SCALE:
- value[0] = ctx->Pixel.RedScale;
- value[1] = ctx->Pixel.GreenScale;
- value[2] = ctx->Pixel.BlueScale;
- value[3] = ctx->Pixel.AlphaScale;
- return;
-
- case STATE_PT_BIAS:
- value[0] = ctx->Pixel.RedBias;
- value[1] = ctx->Pixel.GreenBias;
- value[2] = ctx->Pixel.BlueBias;
- value[3] = ctx->Pixel.AlphaBias;
- return;
-
- case STATE_SHADOW_AMBIENT:
- {
- const int unit = (int) state[2];
- const struct gl_texture_object *texObj
- = ctx->Texture.Unit[unit]._Current;
- if (texObj) {
- value[0] =
- value[1] =
- value[2] =
- value[3] = texObj->Sampler.CompareFailValue;
- }
- }
- return;
-
- case STATE_FB_SIZE:
- value[0] = (GLfloat) (ctx->DrawBuffer->Width - 1);
- value[1] = (GLfloat) (ctx->DrawBuffer->Height - 1);
- value[2] = 0.0F;
- value[3] = 0.0F;
- return;
-
- case STATE_FB_WPOS_Y_TRANSFORM:
- /* A driver may negate this conditional by using ZW swizzle
- * instead of XY (based on e.g. some other state). */
- if (ctx->DrawBuffer->Name != 0) {
- /* Identity (XY) followed by flipping Y upside down (ZW). */
- value[0] = 1.0F;
- value[1] = 0.0F;
- value[2] = -1.0F;
- value[3] = (GLfloat) ctx->DrawBuffer->Height;
- } else {
- /* Flipping Y upside down (XY) followed by identity (ZW). */
- value[0] = -1.0F;
- value[1] = (GLfloat) ctx->DrawBuffer->Height;
- value[2] = 1.0F;
- value[3] = 0.0F;
- }
- return;
-
- case STATE_ROT_MATRIX_0:
- {
- const int unit = (int) state[2];
- GLfloat *rotMat22 = ctx->Texture.Unit[unit].RotMatrix;
- value[0] = rotMat22[0];
- value[1] = rotMat22[2];
- value[2] = 0.0;
- value[3] = 0.0;
- }
- return;
-
- case STATE_ROT_MATRIX_1:
- {
- const int unit = (int) state[2];
- GLfloat *rotMat22 = ctx->Texture.Unit[unit].RotMatrix;
- value[0] = rotMat22[1];
- value[1] = rotMat22[3];
- value[2] = 0.0;
- value[3] = 0.0;
- }
- return;
-
- /* XXX: make sure new tokens added here are also handled in the
- * _mesa_program_state_flags() switch, below.
- */
- default:
- /* Unknown state indexes are silently ignored here.
- * Drivers may do something special.
- */
- return;
- }
- return;
-
- default:
- _mesa_problem(ctx, "Invalid state in _mesa_fetch_state");
- return;
- }
-}
-
-
-/**
- * Return a bitmask of the Mesa state flags (_NEW_* values) which would
- * indicate that the given context state may have changed.
- * The bitmask is used during validation to determine if we need to update
- * vertex/fragment program parameters (like "state.material.color") when
- * some GL state has changed.
- */
-GLbitfield
-_mesa_program_state_flags(const gl_state_index state[STATE_LENGTH])
-{
- switch (state[0]) {
- case STATE_MATERIAL:
- case STATE_LIGHT:
- case STATE_LIGHTMODEL_AMBIENT:
- case STATE_LIGHTMODEL_SCENECOLOR:
- case STATE_LIGHTPROD:
- return _NEW_LIGHT;
-
- case STATE_TEXGEN:
- return _NEW_TEXTURE;
- case STATE_TEXENV_COLOR:
- return _NEW_TEXTURE | _NEW_BUFFERS | _NEW_FRAG_CLAMP;
-
- case STATE_FOG_COLOR:
- return _NEW_FOG | _NEW_BUFFERS | _NEW_FRAG_CLAMP;
- case STATE_FOG_PARAMS:
- return _NEW_FOG;
-
- case STATE_CLIPPLANE:
- return _NEW_TRANSFORM;
-
- case STATE_POINT_SIZE:
- case STATE_POINT_ATTENUATION:
- return _NEW_POINT;
-
- case STATE_MODELVIEW_MATRIX:
- return _NEW_MODELVIEW;
- case STATE_PROJECTION_MATRIX:
- return _NEW_PROJECTION;
- case STATE_MVP_MATRIX:
- return _NEW_MODELVIEW | _NEW_PROJECTION;
- case STATE_TEXTURE_MATRIX:
- return _NEW_TEXTURE_MATRIX;
- case STATE_PROGRAM_MATRIX:
- return _NEW_TRACK_MATRIX;
-
- case STATE_DEPTH_RANGE:
- return _NEW_VIEWPORT;
-
- case STATE_FRAGMENT_PROGRAM:
- case STATE_VERTEX_PROGRAM:
- return _NEW_PROGRAM;
-
- case STATE_NORMAL_SCALE:
- return _NEW_MODELVIEW;
-
- case STATE_INTERNAL:
- switch (state[1]) {
- case STATE_CURRENT_ATTRIB:
- return _NEW_CURRENT_ATTRIB;
- case STATE_CURRENT_ATTRIB_MAYBE_VP_CLAMPED:
- return _NEW_CURRENT_ATTRIB | _NEW_LIGHT | _NEW_BUFFERS;
-
- case STATE_NORMAL_SCALE:
- return _NEW_MODELVIEW;
-
- case STATE_TEXRECT_SCALE:
- case STATE_SHADOW_AMBIENT:
- case STATE_ROT_MATRIX_0:
- case STATE_ROT_MATRIX_1:
- return _NEW_TEXTURE;
- case STATE_FOG_PARAMS_OPTIMIZED:
- return _NEW_FOG;
- case STATE_POINT_SIZE_CLAMPED:
- case STATE_POINT_SIZE_IMPL_CLAMP:
- return _NEW_POINT | _NEW_MULTISAMPLE;
- case STATE_LIGHT_SPOT_DIR_NORMALIZED:
- case STATE_LIGHT_POSITION:
- case STATE_LIGHT_POSITION_NORMALIZED:
- case STATE_LIGHT_HALF_VECTOR:
- return _NEW_LIGHT;
-
- case STATE_PT_SCALE:
- case STATE_PT_BIAS:
- return _NEW_PIXEL;
-
- case STATE_FB_SIZE:
- case STATE_FB_WPOS_Y_TRANSFORM:
- return _NEW_BUFFERS;
-
- default:
- /* unknown state indexes are silently ignored and
- * no flag set, since it is handled by the driver.
- */
- return 0;
- }
-
- default:
- _mesa_problem(NULL, "unexpected state[0] in make_state_flags()");
- return 0;
- }
-}
-
-
-static void
-append(char *dst, const char *src)
-{
- while (*dst)
- dst++;
- while (*src)
- *dst++ = *src++;
- *dst = 0;
-}
-
-
-/**
- * Convert token 'k' to a string, append it onto 'dst' string.
- */
-static void
-append_token(char *dst, gl_state_index k)
-{
- switch (k) {
- case STATE_MATERIAL:
- append(dst, "material");
- break;
- case STATE_LIGHT:
- append(dst, "light");
- break;
- case STATE_LIGHTMODEL_AMBIENT:
- append(dst, "lightmodel.ambient");
- break;
- case STATE_LIGHTMODEL_SCENECOLOR:
- break;
- case STATE_LIGHTPROD:
- append(dst, "lightprod");
- break;
- case STATE_TEXGEN:
- append(dst, "texgen");
- break;
- case STATE_FOG_COLOR:
- append(dst, "fog.color");
- break;
- case STATE_FOG_PARAMS:
- append(dst, "fog.params");
- break;
- case STATE_CLIPPLANE:
- append(dst, "clip");
- break;
- case STATE_POINT_SIZE:
- append(dst, "point.size");
- break;
- case STATE_POINT_ATTENUATION:
- append(dst, "point.attenuation");
- break;
- case STATE_MODELVIEW_MATRIX:
- append(dst, "matrix.modelview");
- break;
- case STATE_PROJECTION_MATRIX:
- append(dst, "matrix.projection");
- break;
- case STATE_MVP_MATRIX:
- append(dst, "matrix.mvp");
- break;
- case STATE_TEXTURE_MATRIX:
- append(dst, "matrix.texture");
- break;
- case STATE_PROGRAM_MATRIX:
- append(dst, "matrix.program");
- break;
- case STATE_MATRIX_INVERSE:
- append(dst, ".inverse");
- break;
- case STATE_MATRIX_TRANSPOSE:
- append(dst, ".transpose");
- break;
- case STATE_MATRIX_INVTRANS:
- append(dst, ".invtrans");
- break;
- case STATE_AMBIENT:
- append(dst, ".ambient");
- break;
- case STATE_DIFFUSE:
- append(dst, ".diffuse");
- break;
- case STATE_SPECULAR:
- append(dst, ".specular");
- break;
- case STATE_EMISSION:
- append(dst, ".emission");
- break;
- case STATE_SHININESS:
- append(dst, "lshininess");
- break;
- case STATE_HALF_VECTOR:
- append(dst, ".half");
- break;
- case STATE_POSITION:
- append(dst, ".position");
- break;
- case STATE_ATTENUATION:
- append(dst, ".attenuation");
- break;
- case STATE_SPOT_DIRECTION:
- append(dst, ".spot.direction");
- break;
- case STATE_SPOT_CUTOFF:
- append(dst, ".spot.cutoff");
- break;
- case STATE_TEXGEN_EYE_S:
- append(dst, ".eye.s");
- break;
- case STATE_TEXGEN_EYE_T:
- append(dst, ".eye.t");
- break;
- case STATE_TEXGEN_EYE_R:
- append(dst, ".eye.r");
- break;
- case STATE_TEXGEN_EYE_Q:
- append(dst, ".eye.q");
- break;
- case STATE_TEXGEN_OBJECT_S:
- append(dst, ".object.s");
- break;
- case STATE_TEXGEN_OBJECT_T:
- append(dst, ".object.t");
- break;
- case STATE_TEXGEN_OBJECT_R:
- append(dst, ".object.r");
- break;
- case STATE_TEXGEN_OBJECT_Q:
- append(dst, ".object.q");
- break;
- case STATE_TEXENV_COLOR:
- append(dst, "texenv");
- break;
- case STATE_DEPTH_RANGE:
- append(dst, "depth.range");
- break;
- case STATE_VERTEX_PROGRAM:
- case STATE_FRAGMENT_PROGRAM:
- break;
- case STATE_ENV:
- append(dst, "env");
- break;
- case STATE_LOCAL:
- append(dst, "local");
- break;
- /* BEGIN internal state vars */
- case STATE_INTERNAL:
- append(dst, ".internal.");
- break;
- case STATE_CURRENT_ATTRIB:
- append(dst, "current");
- break;
- case STATE_NORMAL_SCALE:
- append(dst, "normalScale");
- break;
- case STATE_TEXRECT_SCALE:
- append(dst, "texrectScale");
- break;
- case STATE_FOG_PARAMS_OPTIMIZED:
- append(dst, "fogParamsOptimized");
- break;
- case STATE_POINT_SIZE_CLAMPED:
- append(dst, "pointSizeClamped");
- break;
- case STATE_POINT_SIZE_IMPL_CLAMP:
- append(dst, "pointSizeImplClamp");
- break;
- case STATE_LIGHT_SPOT_DIR_NORMALIZED:
- append(dst, "lightSpotDirNormalized");
- break;
- case STATE_LIGHT_POSITION:
- append(dst, "lightPosition");
- break;
- case STATE_LIGHT_POSITION_NORMALIZED:
- append(dst, "light.position.normalized");
- break;
- case STATE_LIGHT_HALF_VECTOR:
- append(dst, "lightHalfVector");
- break;
- case STATE_PT_SCALE:
- append(dst, "PTscale");
- break;
- case STATE_PT_BIAS:
- append(dst, "PTbias");
- break;
- case STATE_SHADOW_AMBIENT:
- append(dst, "CompareFailValue");
- break;
- case STATE_FB_SIZE:
- append(dst, "FbSize");
- break;
- case STATE_FB_WPOS_Y_TRANSFORM:
- append(dst, "FbWposYTransform");
- break;
- case STATE_ROT_MATRIX_0:
- append(dst, "rotMatrixRow0");
- break;
- case STATE_ROT_MATRIX_1:
- append(dst, "rotMatrixRow1");
- break;
- default:
- /* probably STATE_INTERNAL_DRIVER+i (driver private state) */
- append(dst, "driverState");
- }
-}
-
-static void
-append_face(char *dst, GLint face)
-{
- if (face == 0)
- append(dst, "front.");
- else
- append(dst, "back.");
-}
-
-static void
-append_index(char *dst, GLint index)
-{
- char s[20];
- sprintf(s, "[%d]", index);
- append(dst, s);
-}
-
-/**
- * Make a string from the given state vector.
- * For example, return "state.matrix.texture[2].inverse".
- * Use free() to deallocate the string.
- */
-char *
-_mesa_program_state_string(const gl_state_index state[STATE_LENGTH])
-{
- char str[1000] = "";
- char tmp[30];
-
- append(str, "state.");
- append_token(str, state[0]);
-
- switch (state[0]) {
- case STATE_MATERIAL:
- append_face(str, state[1]);
- append_token(str, state[2]);
- break;
- case STATE_LIGHT:
- append_index(str, state[1]); /* light number [i]. */
- append_token(str, state[2]); /* coefficients */
- break;
- case STATE_LIGHTMODEL_AMBIENT:
- append(str, "lightmodel.ambient");
- break;
- case STATE_LIGHTMODEL_SCENECOLOR:
- if (state[1] == 0) {
- append(str, "lightmodel.front.scenecolor");
- }
- else {
- append(str, "lightmodel.back.scenecolor");
- }
- break;
- case STATE_LIGHTPROD:
- append_index(str, state[1]); /* light number [i]. */
- append_face(str, state[2]);
- append_token(str, state[3]);
- break;
- case STATE_TEXGEN:
- append_index(str, state[1]); /* tex unit [i] */
- append_token(str, state[2]); /* plane coef */
- break;
- case STATE_TEXENV_COLOR:
- append_index(str, state[1]); /* tex unit [i] */
- append(str, "color");
- break;
- case STATE_CLIPPLANE:
- append_index(str, state[1]); /* plane [i] */
- append(str, ".plane");
- break;
- case STATE_MODELVIEW_MATRIX:
- case STATE_PROJECTION_MATRIX:
- case STATE_MVP_MATRIX:
- case STATE_TEXTURE_MATRIX:
- case STATE_PROGRAM_MATRIX:
- {
- /* state[0] = modelview, projection, texture, etc. */
- /* state[1] = which texture matrix or program matrix */
- /* state[2] = first row to fetch */
- /* state[3] = last row to fetch */
- /* state[4] = transpose, inverse or invtrans */
- const gl_state_index mat = state[0];
- const GLuint index = (GLuint) state[1];
- const GLuint firstRow = (GLuint) state[2];
- const GLuint lastRow = (GLuint) state[3];
- const gl_state_index modifier = state[4];
- if (index ||
- mat == STATE_TEXTURE_MATRIX ||
- mat == STATE_PROGRAM_MATRIX)
- append_index(str, index);
- if (modifier)
- append_token(str, modifier);
- if (firstRow == lastRow)
- sprintf(tmp, ".row[%d]", firstRow);
- else
- sprintf(tmp, ".row[%d..%d]", firstRow, lastRow);
- append(str, tmp);
- }
- break;
- case STATE_POINT_SIZE:
- break;
- case STATE_POINT_ATTENUATION:
- break;
- case STATE_FOG_PARAMS:
- break;
- case STATE_FOG_COLOR:
- break;
- case STATE_DEPTH_RANGE:
- break;
- case STATE_FRAGMENT_PROGRAM:
- case STATE_VERTEX_PROGRAM:
- /* state[1] = {STATE_ENV, STATE_LOCAL} */
- /* state[2] = parameter index */
- append_token(str, state[1]);
- append_index(str, state[2]);
- break;
- case STATE_NORMAL_SCALE:
- break;
- case STATE_INTERNAL:
- append_token(str, state[1]);
- if (state[1] == STATE_CURRENT_ATTRIB)
- append_index(str, state[2]);
- break;
- default:
- _mesa_problem(NULL, "Invalid state in _mesa_program_state_string");
- break;
- }
-
- return _mesa_strdup(str);
-}
-
-
-/**
- * Loop over all the parameters in a parameter list. If the parameter
- * is a GL state reference, look up the current value of that state
- * variable and put it into the parameter's Value[4] array.
- * Other parameter types never change or are explicitly set by the user
- * with glUniform() or glProgramParameter(), etc.
- * This would be called at glBegin time.
- */
-void
-_mesa_load_state_parameters(struct gl_context *ctx,
- struct gl_program_parameter_list *paramList)
-{
- GLuint i;
-
- if (!paramList)
- return;
-
- for (i = 0; i < paramList->NumParameters; i++) {
- if (paramList->Parameters[i].Type == PROGRAM_STATE_VAR) {
- _mesa_fetch_state(ctx,
- paramList->Parameters[i].StateIndexes,
- paramList->ParameterValues[i]);
- }
- }
-}
-
-
-/**
- * Copy the 16 elements of a matrix into four consecutive program
- * registers starting at 'pos'.
- */
-static void
-load_matrix(GLfloat registers[][4], GLuint pos, const GLfloat mat[16])
-{
- GLuint i;
- for (i = 0; i < 4; i++) {
- registers[pos + i][0] = mat[0 + i];
- registers[pos + i][1] = mat[4 + i];
- registers[pos + i][2] = mat[8 + i];
- registers[pos + i][3] = mat[12 + i];
- }
-}
-
-
-/**
- * As above, but transpose the matrix.
- */
-static void
-load_transpose_matrix(GLfloat registers[][4], GLuint pos,
- const GLfloat mat[16])
-{
- memcpy(registers[pos], mat, 16 * sizeof(GLfloat));
-}
-
-
-/**
- * Load current vertex program's parameter registers with tracked
- * matrices (if NV program). This only needs to be done per
- * glBegin/glEnd, not per-vertex.
- */
-void
-_mesa_load_tracked_matrices(struct gl_context *ctx)
-{
- GLuint i;
-
- for (i = 0; i < MAX_NV_VERTEX_PROGRAM_PARAMS / 4; i++) {
- /* point 'mat' at source matrix */
- GLmatrix *mat;
- if (ctx->VertexProgram.TrackMatrix[i] == GL_MODELVIEW) {
- mat = ctx->ModelviewMatrixStack.Top;
- }
- else if (ctx->VertexProgram.TrackMatrix[i] == GL_PROJECTION) {
- mat = ctx->ProjectionMatrixStack.Top;
- }
- else if (ctx->VertexProgram.TrackMatrix[i] == GL_TEXTURE) {
- GLuint unit = MIN2(ctx->Texture.CurrentUnit,
- Elements(ctx->TextureMatrixStack) - 1);
- mat = ctx->TextureMatrixStack[unit].Top;
- }
- else if (ctx->VertexProgram.TrackMatrix[i]==GL_MODELVIEW_PROJECTION_NV) {
- /* XXX verify the combined matrix is up to date */
- mat = &ctx->_ModelProjectMatrix;
- }
- else if (ctx->VertexProgram.TrackMatrix[i] >= GL_MATRIX0_NV &&
- ctx->VertexProgram.TrackMatrix[i] <= GL_MATRIX7_NV) {
- GLuint n = ctx->VertexProgram.TrackMatrix[i] - GL_MATRIX0_NV;
- ASSERT(n < Elements(ctx->ProgramMatrixStack));
- mat = ctx->ProgramMatrixStack[n].Top;
- }
- else {
- /* no matrix is tracked, but we leave the register values as-is */
- assert(ctx->VertexProgram.TrackMatrix[i] == GL_NONE);
- continue;
- }
-
- /* load the matrix values into sequential registers */
- if (ctx->VertexProgram.TrackMatrixTransform[i] == GL_IDENTITY_NV) {
- load_matrix(ctx->VertexProgram.Parameters, i*4, mat->m);
- }
- else if (ctx->VertexProgram.TrackMatrixTransform[i] == GL_INVERSE_NV) {
- _math_matrix_analyse(mat); /* update the inverse */
- ASSERT(!_math_matrix_is_dirty(mat));
- load_matrix(ctx->VertexProgram.Parameters, i*4, mat->inv);
- }
- else if (ctx->VertexProgram.TrackMatrixTransform[i] == GL_TRANSPOSE_NV) {
- load_transpose_matrix(ctx->VertexProgram.Parameters, i*4, mat->m);
- }
- else {
- assert(ctx->VertexProgram.TrackMatrixTransform[i]
- == GL_INVERSE_TRANSPOSE_NV);
- _math_matrix_analyse(mat); /* update the inverse */
- ASSERT(!_math_matrix_is_dirty(mat));
- load_transpose_matrix(ctx->VertexProgram.Parameters, i*4, mat->inv);
- }
- }
-}
+/*
+ * Mesa 3-D graphics library
+ * Version: 7.1
+ *
+ * Copyright (C) 1999-2007 Brian Paul All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+/**
+ * \file prog_statevars.c
+ * Program state variable management.
+ * \author Brian Paul
+ */
+
+
+#include "main/glheader.h"
+#include "main/context.h"
+#include "main/imports.h"
+#include "main/macros.h"
+#include "main/mtypes.h"
+#include "prog_statevars.h"
+#include "prog_parameter.h"
+
+
+/**
+ * Use the list of tokens in the state[] array to find global GL state
+ * and return it in <value>. Usually, four values are returned in <value>
+ * but matrix queries may return as many as 16 values.
+ * This function is used for ARB vertex/fragment programs.
+ * The program parser will produce the state[] values.
+ */
+static void
+_mesa_fetch_state(struct gl_context *ctx, const gl_state_index state[],
+ GLfloat *value)
+{
+ switch (state[0]) {
+ case STATE_MATERIAL:
+ {
+ /* state[1] is either 0=front or 1=back side */
+ const GLuint face = (GLuint) state[1];
+ const struct gl_material *mat = &ctx->Light.Material;
+ ASSERT(face == 0 || face == 1);
+ /* we rely on tokens numbered so that _BACK_ == _FRONT_+ 1 */
+ ASSERT(MAT_ATTRIB_FRONT_AMBIENT + 1 == MAT_ATTRIB_BACK_AMBIENT);
+ /* XXX we could get rid of this switch entirely with a little
+ * work in arbprogparse.c's parse_state_single_item().
+ */
+ /* state[2] is the material attribute */
+ switch (state[2]) {
+ case STATE_AMBIENT:
+ COPY_4V(value, mat->Attrib[MAT_ATTRIB_FRONT_AMBIENT + face]);
+ return;
+ case STATE_DIFFUSE:
+ COPY_4V(value, mat->Attrib[MAT_ATTRIB_FRONT_DIFFUSE + face]);
+ return;
+ case STATE_SPECULAR:
+ COPY_4V(value, mat->Attrib[MAT_ATTRIB_FRONT_SPECULAR + face]);
+ return;
+ case STATE_EMISSION:
+ COPY_4V(value, mat->Attrib[MAT_ATTRIB_FRONT_EMISSION + face]);
+ return;
+ case STATE_SHININESS:
+ value[0] = mat->Attrib[MAT_ATTRIB_FRONT_SHININESS + face][0];
+ value[1] = 0.0F;
+ value[2] = 0.0F;
+ value[3] = 1.0F;
+ return;
+ default:
+ _mesa_problem(ctx, "Invalid material state in fetch_state");
+ return;
+ }
+ }
+ case STATE_LIGHT:
+ {
+ /* state[1] is the light number */
+ const GLuint ln = (GLuint) state[1];
+ /* state[2] is the light attribute */
+ switch (state[2]) {
+ case STATE_AMBIENT:
+ COPY_4V(value, ctx->Light.Light[ln].Ambient);
+ return;
+ case STATE_DIFFUSE:
+ COPY_4V(value, ctx->Light.Light[ln].Diffuse);
+ return;
+ case STATE_SPECULAR:
+ COPY_4V(value, ctx->Light.Light[ln].Specular);
+ return;
+ case STATE_POSITION:
+ COPY_4V(value, ctx->Light.Light[ln].EyePosition);
+ return;
+ case STATE_ATTENUATION:
+ value[0] = ctx->Light.Light[ln].ConstantAttenuation;
+ value[1] = ctx->Light.Light[ln].LinearAttenuation;
+ value[2] = ctx->Light.Light[ln].QuadraticAttenuation;
+ value[3] = ctx->Light.Light[ln].SpotExponent;
+ return;
+ case STATE_SPOT_DIRECTION:
+ COPY_3V(value, ctx->Light.Light[ln].SpotDirection);
+ value[3] = ctx->Light.Light[ln]._CosCutoff;
+ return;
+ case STATE_SPOT_CUTOFF:
+ value[0] = ctx->Light.Light[ln].SpotCutoff;
+ return;
+ case STATE_HALF_VECTOR:
+ {
+ static const GLfloat eye_z[] = {0, 0, 1};
+ GLfloat p[3];
+ /* Compute infinite half angle vector:
+ * halfVector = normalize(normalize(lightPos) + (0, 0, 1))
+ * light.EyePosition.w should be 0 for infinite lights.
+ */
+ COPY_3V(p, ctx->Light.Light[ln].EyePosition);
+ NORMALIZE_3FV(p);
+ ADD_3V(value, p, eye_z);
+ NORMALIZE_3FV(value);
+ value[3] = 1.0;
+ }
+ return;
+ default:
+ _mesa_problem(ctx, "Invalid light state in fetch_state");
+ return;
+ }
+ }
+ case STATE_LIGHTMODEL_AMBIENT:
+ COPY_4V(value, ctx->Light.Model.Ambient);
+ return;
+ case STATE_LIGHTMODEL_SCENECOLOR:
+ if (state[1] == 0) {
+ /* front */
+ GLint i;
+ for (i = 0; i < 3; i++) {
+ value[i] = ctx->Light.Model.Ambient[i]
+ * ctx->Light.Material.Attrib[MAT_ATTRIB_FRONT_AMBIENT][i]
+ + ctx->Light.Material.Attrib[MAT_ATTRIB_FRONT_EMISSION][i];
+ }
+ value[3] = ctx->Light.Material.Attrib[MAT_ATTRIB_FRONT_DIFFUSE][3];
+ }
+ else {
+ /* back */
+ GLint i;
+ for (i = 0; i < 3; i++) {
+ value[i] = ctx->Light.Model.Ambient[i]
+ * ctx->Light.Material.Attrib[MAT_ATTRIB_BACK_AMBIENT][i]
+ + ctx->Light.Material.Attrib[MAT_ATTRIB_BACK_EMISSION][i];
+ }
+ value[3] = ctx->Light.Material.Attrib[MAT_ATTRIB_BACK_DIFFUSE][3];
+ }
+ return;
+ case STATE_LIGHTPROD:
+ {
+ const GLuint ln = (GLuint) state[1];
+ const GLuint face = (GLuint) state[2];
+ GLint i;
+ ASSERT(face == 0 || face == 1);
+ switch (state[3]) {
+ case STATE_AMBIENT:
+ for (i = 0; i < 3; i++) {
+ value[i] = ctx->Light.Light[ln].Ambient[i] *
+ ctx->Light.Material.Attrib[MAT_ATTRIB_FRONT_AMBIENT+face][i];
+ }
+ /* [3] = material alpha */
+ value[3] = ctx->Light.Material.Attrib[MAT_ATTRIB_FRONT_AMBIENT+face][3];
+ return;
+ case STATE_DIFFUSE:
+ for (i = 0; i < 3; i++) {
+ value[i] = ctx->Light.Light[ln].Diffuse[i] *
+ ctx->Light.Material.Attrib[MAT_ATTRIB_FRONT_DIFFUSE+face][i];
+ }
+ /* [3] = material alpha */
+ value[3] = ctx->Light.Material.Attrib[MAT_ATTRIB_FRONT_DIFFUSE+face][3];
+ return;
+ case STATE_SPECULAR:
+ for (i = 0; i < 3; i++) {
+ value[i] = ctx->Light.Light[ln].Specular[i] *
+ ctx->Light.Material.Attrib[MAT_ATTRIB_FRONT_SPECULAR+face][i];
+ }
+ /* [3] = material alpha */
+ value[3] = ctx->Light.Material.Attrib[MAT_ATTRIB_FRONT_SPECULAR+face][3];
+ return;
+ default:
+ _mesa_problem(ctx, "Invalid lightprod state in fetch_state");
+ return;
+ }
+ }
+ case STATE_TEXGEN:
+ {
+ /* state[1] is the texture unit */
+ const GLuint unit = (GLuint) state[1];
+ /* state[2] is the texgen attribute */
+ switch (state[2]) {
+ case STATE_TEXGEN_EYE_S:
+ COPY_4V(value, ctx->Texture.Unit[unit].GenS.EyePlane);
+ return;
+ case STATE_TEXGEN_EYE_T:
+ COPY_4V(value, ctx->Texture.Unit[unit].GenT.EyePlane);
+ return;
+ case STATE_TEXGEN_EYE_R:
+ COPY_4V(value, ctx->Texture.Unit[unit].GenR.EyePlane);
+ return;
+ case STATE_TEXGEN_EYE_Q:
+ COPY_4V(value, ctx->Texture.Unit[unit].GenQ.EyePlane);
+ return;
+ case STATE_TEXGEN_OBJECT_S:
+ COPY_4V(value, ctx->Texture.Unit[unit].GenS.ObjectPlane);
+ return;
+ case STATE_TEXGEN_OBJECT_T:
+ COPY_4V(value, ctx->Texture.Unit[unit].GenT.ObjectPlane);
+ return;
+ case STATE_TEXGEN_OBJECT_R:
+ COPY_4V(value, ctx->Texture.Unit[unit].GenR.ObjectPlane);
+ return;
+ case STATE_TEXGEN_OBJECT_Q:
+ COPY_4V(value, ctx->Texture.Unit[unit].GenQ.ObjectPlane);
+ return;
+ default:
+ _mesa_problem(ctx, "Invalid texgen state in fetch_state");
+ return;
+ }
+ }
+ case STATE_TEXENV_COLOR:
+ {
+ /* state[1] is the texture unit */
+ const GLuint unit = (GLuint) state[1];
+ if(ctx->Color._ClampFragmentColor)
+ COPY_4V(value, ctx->Texture.Unit[unit].EnvColor);
+ else
+ COPY_4V(value, ctx->Texture.Unit[unit].EnvColorUnclamped);
+ }
+ return;
+ case STATE_FOG_COLOR:
+ if(ctx->Color._ClampFragmentColor)
+ COPY_4V(value, ctx->Fog.Color);
+ else
+ COPY_4V(value, ctx->Fog.ColorUnclamped);
+ return;
+ case STATE_FOG_PARAMS:
+ value[0] = ctx->Fog.Density;
+ value[1] = ctx->Fog.Start;
+ value[2] = ctx->Fog.End;
+ value[3] = (ctx->Fog.End == ctx->Fog.Start)
+ ? 1.0f : (GLfloat)(1.0 / (ctx->Fog.End - ctx->Fog.Start));
+ return;
+ case STATE_CLIPPLANE:
+ {
+ const GLuint plane = (GLuint) state[1];
+ COPY_4V(value, ctx->Transform.EyeUserPlane[plane]);
+ }
+ return;
+ case STATE_POINT_SIZE:
+ value[0] = ctx->Point.Size;
+ value[1] = ctx->Point.MinSize;
+ value[2] = ctx->Point.MaxSize;
+ value[3] = ctx->Point.Threshold;
+ return;
+ case STATE_POINT_ATTENUATION:
+ value[0] = ctx->Point.Params[0];
+ value[1] = ctx->Point.Params[1];
+ value[2] = ctx->Point.Params[2];
+ value[3] = 1.0F;
+ return;
+ case STATE_MODELVIEW_MATRIX:
+ case STATE_PROJECTION_MATRIX:
+ case STATE_MVP_MATRIX:
+ case STATE_TEXTURE_MATRIX:
+ case STATE_PROGRAM_MATRIX:
+ {
+ /* state[0] = modelview, projection, texture, etc. */
+ /* state[1] = which texture matrix or program matrix */
+ /* state[2] = first row to fetch */
+ /* state[3] = last row to fetch */
+ /* state[4] = transpose, inverse or invtrans */
+ const GLmatrix *matrix;
+ const gl_state_index mat = state[0];
+ const GLuint index = (GLuint) state[1];
+ const GLuint firstRow = (GLuint) state[2];
+ const GLuint lastRow = (GLuint) state[3];
+ const gl_state_index modifier = state[4];
+ const GLfloat *m;
+ GLuint row, i;
+ ASSERT(firstRow >= 0);
+ ASSERT(firstRow < 4);
+ ASSERT(lastRow >= 0);
+ ASSERT(lastRow < 4);
+ if (mat == STATE_MODELVIEW_MATRIX) {
+ matrix = ctx->ModelviewMatrixStack.Top;
+ }
+ else if (mat == STATE_PROJECTION_MATRIX) {
+ matrix = ctx->ProjectionMatrixStack.Top;
+ }
+ else if (mat == STATE_MVP_MATRIX) {
+ matrix = &ctx->_ModelProjectMatrix;
+ }
+ else if (mat == STATE_TEXTURE_MATRIX) {
+ ASSERT(index < Elements(ctx->TextureMatrixStack));
+ matrix = ctx->TextureMatrixStack[index].Top;
+ }
+ else if (mat == STATE_PROGRAM_MATRIX) {
+ ASSERT(index < Elements(ctx->ProgramMatrixStack));
+ matrix = ctx->ProgramMatrixStack[index].Top;
+ }
+ else {
+ _mesa_problem(ctx, "Bad matrix name in _mesa_fetch_state()");
+ return;
+ }
+ if (modifier == STATE_MATRIX_INVERSE ||
+ modifier == STATE_MATRIX_INVTRANS) {
+ /* Be sure inverse is up to date:
+ */
+ _math_matrix_alloc_inv( (GLmatrix *) matrix );
+ _math_matrix_analyse( (GLmatrix*) matrix );
+ m = matrix->inv;
+ }
+ else {
+ m = matrix->m;
+ }
+ if (modifier == STATE_MATRIX_TRANSPOSE ||
+ modifier == STATE_MATRIX_INVTRANS) {
+ for (i = 0, row = firstRow; row <= lastRow; row++) {
+ value[i++] = m[row * 4 + 0];
+ value[i++] = m[row * 4 + 1];
+ value[i++] = m[row * 4 + 2];
+ value[i++] = m[row * 4 + 3];
+ }
+ }
+ else {
+ for (i = 0, row = firstRow; row <= lastRow; row++) {
+ value[i++] = m[row + 0];
+ value[i++] = m[row + 4];
+ value[i++] = m[row + 8];
+ value[i++] = m[row + 12];
+ }
+ }
+ }
+ return;
+ case STATE_DEPTH_RANGE:
+ value[0] = ctx->Viewport.Near; /* near */
+ value[1] = ctx->Viewport.Far; /* far */
+ value[2] = ctx->Viewport.Far - ctx->Viewport.Near; /* far - near */
+ value[3] = 1.0;
+ return;
+ case STATE_FRAGMENT_PROGRAM:
+ {
+ /* state[1] = {STATE_ENV, STATE_LOCAL} */
+ /* state[2] = parameter index */
+ const int idx = (int) state[2];
+ switch (state[1]) {
+ case STATE_ENV:
+ COPY_4V(value, ctx->FragmentProgram.Parameters[idx]);
+ return;
+ case STATE_LOCAL:
+ COPY_4V(value, ctx->FragmentProgram.Current->Base.LocalParams[idx]);
+ return;
+ default:
+ _mesa_problem(ctx, "Bad state switch in _mesa_fetch_state()");
+ return;
+ }
+ }
+ return;
+
+ case STATE_VERTEX_PROGRAM:
+ {
+ /* state[1] = {STATE_ENV, STATE_LOCAL} */
+ /* state[2] = parameter index */
+ const int idx = (int) state[2];
+ switch (state[1]) {
+ case STATE_ENV:
+ COPY_4V(value, ctx->VertexProgram.Parameters[idx]);
+ return;
+ case STATE_LOCAL:
+ COPY_4V(value, ctx->VertexProgram.Current->Base.LocalParams[idx]);
+ return;
+ default:
+ _mesa_problem(ctx, "Bad state switch in _mesa_fetch_state()");
+ return;
+ }
+ }
+ return;
+
+ case STATE_NORMAL_SCALE:
+ ASSIGN_4V(value, ctx->_ModelViewInvScale, 0, 0, 1);
+ return;
+
+ case STATE_INTERNAL:
+ switch (state[1]) {
+ case STATE_CURRENT_ATTRIB:
+ {
+ const GLuint idx = (GLuint) state[2];
+ COPY_4V(value, ctx->Current.Attrib[idx]);
+ }
+ return;
+
+ case STATE_CURRENT_ATTRIB_MAYBE_VP_CLAMPED:
+ {
+ const GLuint idx = (GLuint) state[2];
+ if(ctx->Light._ClampVertexColor &&
+ (idx == VERT_ATTRIB_COLOR0 ||
+ idx == VERT_ATTRIB_COLOR1)) {
+ value[0] = CLAMP(ctx->Current.Attrib[idx][0], 0.0f, 1.0f);
+ value[1] = CLAMP(ctx->Current.Attrib[idx][1], 0.0f, 1.0f);
+ value[2] = CLAMP(ctx->Current.Attrib[idx][2], 0.0f, 1.0f);
+ value[3] = CLAMP(ctx->Current.Attrib[idx][3], 0.0f, 1.0f);
+ }
+ else
+ COPY_4V(value, ctx->Current.Attrib[idx]);
+ }
+ return;
+
+ case STATE_NORMAL_SCALE:
+ ASSIGN_4V(value,
+ ctx->_ModelViewInvScale,
+ ctx->_ModelViewInvScale,
+ ctx->_ModelViewInvScale,
+ 1);
+ return;
+
+ case STATE_TEXRECT_SCALE:
+ /* Value = { 1/texWidth, 1/texHeight, 0, 1 }.
+ * Used to convert unnormalized texcoords to normalized texcoords.
+ */
+ {
+ const int unit = (int) state[2];
+ const struct gl_texture_object *texObj
+ = ctx->Texture.Unit[unit]._Current;
+ if (texObj) {
+ struct gl_texture_image *texImage = texObj->Image[0][0];
+ ASSIGN_4V(value,
+ (GLfloat) (1.0 / texImage->Width),
+ (GLfloat) (1.0 / texImage->Height),
+ 0.0f, 1.0f);
+ }
+ }
+ return;
+
+ case STATE_FOG_PARAMS_OPTIMIZED:
+ /* for simpler per-vertex/pixel fog calcs. POW (for EXP/EXP2 fog)
+ * might be more expensive than EX2 on some hw, plus it needs
+ * another constant (e) anyway. Linear fog can now be done with a
+ * single MAD.
+ * linear: fogcoord * -1/(end-start) + end/(end-start)
+ * exp: 2^-(density/ln(2) * fogcoord)
+ * exp2: 2^-((density/(ln(2)^2) * fogcoord)^2)
+ */
+ value[0] = (ctx->Fog.End == ctx->Fog.Start)
+ ? 1.0f : (GLfloat)(-1.0F / (ctx->Fog.End - ctx->Fog.Start));
+ value[1] = ctx->Fog.End * -value[0];
+ value[2] = (GLfloat)(ctx->Fog.Density * M_LOG2E); /* M_LOG2E == 1/ln(2) */
+ value[3] = (GLfloat)(ctx->Fog.Density * ONE_DIV_SQRT_LN2);
+ return;
+
+ case STATE_POINT_SIZE_CLAMPED:
+ {
+ /* this includes implementation dependent limits, to avoid
+ * another potentially necessary clamp.
+ * Note: for sprites, point smooth (point AA) is ignored
+ * and we'll clamp to MinPointSizeAA and MaxPointSize, because we
+ * expect drivers will want to say their minimum for AA size is 0.0
+ * but for non-AA it's 1.0 (because normal points with size below 1.0
+ * need to get rounded up to 1.0, hence never disappear). GL does
+ * not specify max clamp size for sprites, other than it needs to be
+ * at least as large as max AA size, hence use non-AA size there.
+ */
+ GLfloat minImplSize;
+ GLfloat maxImplSize;
+ if (ctx->Point.PointSprite) {
+ minImplSize = ctx->Const.MinPointSizeAA;
+ maxImplSize = ctx->Const.MaxPointSize;
+ }
+ else if (ctx->Point.SmoothFlag || ctx->Multisample._Enabled) {
+ minImplSize = ctx->Const.MinPointSizeAA;
+ maxImplSize = ctx->Const.MaxPointSizeAA;
+ }
+ else {
+ minImplSize = ctx->Const.MinPointSize;
+ maxImplSize = ctx->Const.MaxPointSize;
+ }
+ value[0] = ctx->Point.Size;
+ value[1] = ctx->Point.MinSize >= minImplSize ? ctx->Point.MinSize : minImplSize;
+ value[2] = ctx->Point.MaxSize <= maxImplSize ? ctx->Point.MaxSize : maxImplSize;
+ value[3] = ctx->Point.Threshold;
+ }
+ return;
+ case STATE_POINT_SIZE_IMPL_CLAMP:
+ {
+ /* for implementation clamp only in vs */
+ GLfloat minImplSize;
+ GLfloat maxImplSize;
+ if (ctx->Point.PointSprite) {
+ minImplSize = ctx->Const.MinPointSizeAA;
+ maxImplSize = ctx->Const.MaxPointSize;
+ }
+ else if (ctx->Point.SmoothFlag || ctx->Multisample._Enabled) {
+ minImplSize = ctx->Const.MinPointSizeAA;
+ maxImplSize = ctx->Const.MaxPointSizeAA;
+ }
+ else {
+ minImplSize = ctx->Const.MinPointSize;
+ maxImplSize = ctx->Const.MaxPointSize;
+ }
+ value[0] = ctx->Point.Size;
+ value[1] = minImplSize;
+ value[2] = maxImplSize;
+ value[3] = ctx->Point.Threshold;
+ }
+ return;
+ case STATE_LIGHT_SPOT_DIR_NORMALIZED:
+ {
+ /* here, state[2] is the light number */
+ /* pre-normalize spot dir */
+ const GLuint ln = (GLuint) state[2];
+ COPY_3V(value, ctx->Light.Light[ln]._NormSpotDirection);
+ value[3] = ctx->Light.Light[ln]._CosCutoff;
+ }
+ return;
+
+ case STATE_LIGHT_POSITION:
+ {
+ const GLuint ln = (GLuint) state[2];
+ COPY_4V(value, ctx->Light.Light[ln]._Position);
+ }
+ return;
+
+ case STATE_LIGHT_POSITION_NORMALIZED:
+ {
+ const GLuint ln = (GLuint) state[2];
+ COPY_4V(value, ctx->Light.Light[ln]._Position);
+ NORMALIZE_3FV( value );
+ }
+ return;
+
+ case STATE_LIGHT_HALF_VECTOR:
+ {
+ const GLuint ln = (GLuint) state[2];
+ GLfloat p[3];
+ /* Compute infinite half angle vector:
+ * halfVector = normalize(normalize(lightPos) + (0, 0, 1))
+ * light.EyePosition.w should be 0 for infinite lights.
+ */
+ COPY_3V(p, ctx->Light.Light[ln]._Position);
+ NORMALIZE_3FV(p);
+ ADD_3V(value, p, ctx->_EyeZDir);
+ NORMALIZE_3FV(value);
+ value[3] = 1.0;
+ }
+ return;
+
+ case STATE_PT_SCALE:
+ value[0] = ctx->Pixel.RedScale;
+ value[1] = ctx->Pixel.GreenScale;
+ value[2] = ctx->Pixel.BlueScale;
+ value[3] = ctx->Pixel.AlphaScale;
+ return;
+
+ case STATE_PT_BIAS:
+ value[0] = ctx->Pixel.RedBias;
+ value[1] = ctx->Pixel.GreenBias;
+ value[2] = ctx->Pixel.BlueBias;
+ value[3] = ctx->Pixel.AlphaBias;
+ return;
+
+ case STATE_SHADOW_AMBIENT:
+ {
+ const int unit = (int) state[2];
+ const struct gl_texture_object *texObj
+ = ctx->Texture.Unit[unit]._Current;
+ if (texObj) {
+ value[0] =
+ value[1] =
+ value[2] =
+ value[3] = texObj->Sampler.CompareFailValue;
+ }
+ }
+ return;
+
+ case STATE_FB_SIZE:
+ value[0] = (GLfloat) (ctx->DrawBuffer->Width - 1);
+ value[1] = (GLfloat) (ctx->DrawBuffer->Height - 1);
+ value[2] = 0.0F;
+ value[3] = 0.0F;
+ return;
+
+ case STATE_FB_WPOS_Y_TRANSFORM:
+ /* A driver may negate this conditional by using ZW swizzle
+ * instead of XY (based on e.g. some other state). */
+ if (ctx->DrawBuffer->Name != 0) {
+ /* Identity (XY) followed by flipping Y upside down (ZW). */
+ value[0] = 1.0F;
+ value[1] = 0.0F;
+ value[2] = -1.0F;
+ value[3] = (GLfloat) ctx->DrawBuffer->Height;
+ } else {
+ /* Flipping Y upside down (XY) followed by identity (ZW). */
+ value[0] = -1.0F;
+ value[1] = (GLfloat) ctx->DrawBuffer->Height;
+ value[2] = 1.0F;
+ value[3] = 0.0F;
+ }
+ return;
+
+ case STATE_ROT_MATRIX_0:
+ {
+ const int unit = (int) state[2];
+ GLfloat *rotMat22 = ctx->Texture.Unit[unit].RotMatrix;
+ value[0] = rotMat22[0];
+ value[1] = rotMat22[2];
+ value[2] = 0.0;
+ value[3] = 0.0;
+ }
+ return;
+
+ case STATE_ROT_MATRIX_1:
+ {
+ const int unit = (int) state[2];
+ GLfloat *rotMat22 = ctx->Texture.Unit[unit].RotMatrix;
+ value[0] = rotMat22[1];
+ value[1] = rotMat22[3];
+ value[2] = 0.0;
+ value[3] = 0.0;
+ }
+ return;
+
+ /* XXX: make sure new tokens added here are also handled in the
+ * _mesa_program_state_flags() switch, below.
+ */
+ default:
+ /* Unknown state indexes are silently ignored here.
+ * Drivers may do something special.
+ */
+ return;
+ }
+ return;
+
+ default:
+ _mesa_problem(ctx, "Invalid state in _mesa_fetch_state");
+ return;
+ }
+}
+
+
+/**
+ * Return a bitmask of the Mesa state flags (_NEW_* values) which would
+ * indicate that the given context state may have changed.
+ * The bitmask is used during validation to determine if we need to update
+ * vertex/fragment program parameters (like "state.material.color") when
+ * some GL state has changed.
+ */
+GLbitfield
+_mesa_program_state_flags(const gl_state_index state[STATE_LENGTH])
+{
+ switch (state[0]) {
+ case STATE_MATERIAL:
+ case STATE_LIGHT:
+ case STATE_LIGHTMODEL_AMBIENT:
+ case STATE_LIGHTMODEL_SCENECOLOR:
+ case STATE_LIGHTPROD:
+ return _NEW_LIGHT;
+
+ case STATE_TEXGEN:
+ return _NEW_TEXTURE;
+ case STATE_TEXENV_COLOR:
+ return _NEW_TEXTURE | _NEW_BUFFERS | _NEW_FRAG_CLAMP;
+
+ case STATE_FOG_COLOR:
+ return _NEW_FOG | _NEW_BUFFERS | _NEW_FRAG_CLAMP;
+ case STATE_FOG_PARAMS:
+ return _NEW_FOG;
+
+ case STATE_CLIPPLANE:
+ return _NEW_TRANSFORM;
+
+ case STATE_POINT_SIZE:
+ case STATE_POINT_ATTENUATION:
+ return _NEW_POINT;
+
+ case STATE_MODELVIEW_MATRIX:
+ return _NEW_MODELVIEW;
+ case STATE_PROJECTION_MATRIX:
+ return _NEW_PROJECTION;
+ case STATE_MVP_MATRIX:
+ return _NEW_MODELVIEW | _NEW_PROJECTION;
+ case STATE_TEXTURE_MATRIX:
+ return _NEW_TEXTURE_MATRIX;
+ case STATE_PROGRAM_MATRIX:
+ return _NEW_TRACK_MATRIX;
+
+ case STATE_DEPTH_RANGE:
+ return _NEW_VIEWPORT;
+
+ case STATE_FRAGMENT_PROGRAM:
+ case STATE_VERTEX_PROGRAM:
+ return _NEW_PROGRAM;
+
+ case STATE_NORMAL_SCALE:
+ return _NEW_MODELVIEW;
+
+ case STATE_INTERNAL:
+ switch (state[1]) {
+ case STATE_CURRENT_ATTRIB:
+ return _NEW_CURRENT_ATTRIB;
+ case STATE_CURRENT_ATTRIB_MAYBE_VP_CLAMPED:
+ return _NEW_CURRENT_ATTRIB | _NEW_LIGHT | _NEW_BUFFERS;
+
+ case STATE_NORMAL_SCALE:
+ return _NEW_MODELVIEW;
+
+ case STATE_TEXRECT_SCALE:
+ case STATE_SHADOW_AMBIENT:
+ case STATE_ROT_MATRIX_0:
+ case STATE_ROT_MATRIX_1:
+ return _NEW_TEXTURE;
+ case STATE_FOG_PARAMS_OPTIMIZED:
+ return _NEW_FOG;
+ case STATE_POINT_SIZE_CLAMPED:
+ case STATE_POINT_SIZE_IMPL_CLAMP:
+ return _NEW_POINT | _NEW_MULTISAMPLE;
+ case STATE_LIGHT_SPOT_DIR_NORMALIZED:
+ case STATE_LIGHT_POSITION:
+ case STATE_LIGHT_POSITION_NORMALIZED:
+ case STATE_LIGHT_HALF_VECTOR:
+ return _NEW_LIGHT;
+
+ case STATE_PT_SCALE:
+ case STATE_PT_BIAS:
+ return _NEW_PIXEL;
+
+ case STATE_FB_SIZE:
+ case STATE_FB_WPOS_Y_TRANSFORM:
+ return _NEW_BUFFERS;
+
+ default:
+ /* unknown state indexes are silently ignored and
+ * no flag set, since it is handled by the driver.
+ */
+ return 0;
+ }
+
+ default:
+ _mesa_problem(NULL, "unexpected state[0] in make_state_flags()");
+ return 0;
+ }
+}
+
+
+static void
+append(char *dst, const char *src)
+{
+ while (*dst)
+ dst++;
+ while (*src)
+ *dst++ = *src++;
+ *dst = 0;
+}
+
+
+/**
+ * Convert token 'k' to a string, append it onto 'dst' string.
+ */
+static void
+append_token(char *dst, gl_state_index k)
+{
+ switch (k) {
+ case STATE_MATERIAL:
+ append(dst, "material");
+ break;
+ case STATE_LIGHT:
+ append(dst, "light");
+ break;
+ case STATE_LIGHTMODEL_AMBIENT:
+ append(dst, "lightmodel.ambient");
+ break;
+ case STATE_LIGHTMODEL_SCENECOLOR:
+ break;
+ case STATE_LIGHTPROD:
+ append(dst, "lightprod");
+ break;
+ case STATE_TEXGEN:
+ append(dst, "texgen");
+ break;
+ case STATE_FOG_COLOR:
+ append(dst, "fog.color");
+ break;
+ case STATE_FOG_PARAMS:
+ append(dst, "fog.params");
+ break;
+ case STATE_CLIPPLANE:
+ append(dst, "clip");
+ break;
+ case STATE_POINT_SIZE:
+ append(dst, "point.size");
+ break;
+ case STATE_POINT_ATTENUATION:
+ append(dst, "point.attenuation");
+ break;
+ case STATE_MODELVIEW_MATRIX:
+ append(dst, "matrix.modelview");
+ break;
+ case STATE_PROJECTION_MATRIX:
+ append(dst, "matrix.projection");
+ break;
+ case STATE_MVP_MATRIX:
+ append(dst, "matrix.mvp");
+ break;
+ case STATE_TEXTURE_MATRIX:
+ append(dst, "matrix.texture");
+ break;
+ case STATE_PROGRAM_MATRIX:
+ append(dst, "matrix.program");
+ break;
+ case STATE_MATRIX_INVERSE:
+ append(dst, ".inverse");
+ break;
+ case STATE_MATRIX_TRANSPOSE:
+ append(dst, ".transpose");
+ break;
+ case STATE_MATRIX_INVTRANS:
+ append(dst, ".invtrans");
+ break;
+ case STATE_AMBIENT:
+ append(dst, ".ambient");
+ break;
+ case STATE_DIFFUSE:
+ append(dst, ".diffuse");
+ break;
+ case STATE_SPECULAR:
+ append(dst, ".specular");
+ break;
+ case STATE_EMISSION:
+ append(dst, ".emission");
+ break;
+ case STATE_SHININESS:
+ append(dst, "lshininess");
+ break;
+ case STATE_HALF_VECTOR:
+ append(dst, ".half");
+ break;
+ case STATE_POSITION:
+ append(dst, ".position");
+ break;
+ case STATE_ATTENUATION:
+ append(dst, ".attenuation");
+ break;
+ case STATE_SPOT_DIRECTION:
+ append(dst, ".spot.direction");
+ break;
+ case STATE_SPOT_CUTOFF:
+ append(dst, ".spot.cutoff");
+ break;
+ case STATE_TEXGEN_EYE_S:
+ append(dst, ".eye.s");
+ break;
+ case STATE_TEXGEN_EYE_T:
+ append(dst, ".eye.t");
+ break;
+ case STATE_TEXGEN_EYE_R:
+ append(dst, ".eye.r");
+ break;
+ case STATE_TEXGEN_EYE_Q:
+ append(dst, ".eye.q");
+ break;
+ case STATE_TEXGEN_OBJECT_S:
+ append(dst, ".object.s");
+ break;
+ case STATE_TEXGEN_OBJECT_T:
+ append(dst, ".object.t");
+ break;
+ case STATE_TEXGEN_OBJECT_R:
+ append(dst, ".object.r");
+ break;
+ case STATE_TEXGEN_OBJECT_Q:
+ append(dst, ".object.q");
+ break;
+ case STATE_TEXENV_COLOR:
+ append(dst, "texenv");
+ break;
+ case STATE_DEPTH_RANGE:
+ append(dst, "depth.range");
+ break;
+ case STATE_VERTEX_PROGRAM:
+ case STATE_FRAGMENT_PROGRAM:
+ break;
+ case STATE_ENV:
+ append(dst, "env");
+ break;
+ case STATE_LOCAL:
+ append(dst, "local");
+ break;
+ /* BEGIN internal state vars */
+ case STATE_INTERNAL:
+ append(dst, ".internal.");
+ break;
+ case STATE_CURRENT_ATTRIB:
+ append(dst, "current");
+ break;
+ case STATE_NORMAL_SCALE:
+ append(dst, "normalScale");
+ break;
+ case STATE_TEXRECT_SCALE:
+ append(dst, "texrectScale");
+ break;
+ case STATE_FOG_PARAMS_OPTIMIZED:
+ append(dst, "fogParamsOptimized");
+ break;
+ case STATE_POINT_SIZE_CLAMPED:
+ append(dst, "pointSizeClamped");
+ break;
+ case STATE_POINT_SIZE_IMPL_CLAMP:
+ append(dst, "pointSizeImplClamp");
+ break;
+ case STATE_LIGHT_SPOT_DIR_NORMALIZED:
+ append(dst, "lightSpotDirNormalized");
+ break;
+ case STATE_LIGHT_POSITION:
+ append(dst, "lightPosition");
+ break;
+ case STATE_LIGHT_POSITION_NORMALIZED:
+ append(dst, "light.position.normalized");
+ break;
+ case STATE_LIGHT_HALF_VECTOR:
+ append(dst, "lightHalfVector");
+ break;
+ case STATE_PT_SCALE:
+ append(dst, "PTscale");
+ break;
+ case STATE_PT_BIAS:
+ append(dst, "PTbias");
+ break;
+ case STATE_SHADOW_AMBIENT:
+ append(dst, "CompareFailValue");
+ break;
+ case STATE_FB_SIZE:
+ append(dst, "FbSize");
+ break;
+ case STATE_FB_WPOS_Y_TRANSFORM:
+ append(dst, "FbWposYTransform");
+ break;
+ case STATE_ROT_MATRIX_0:
+ append(dst, "rotMatrixRow0");
+ break;
+ case STATE_ROT_MATRIX_1:
+ append(dst, "rotMatrixRow1");
+ break;
+ default:
+ /* probably STATE_INTERNAL_DRIVER+i (driver private state) */
+ append(dst, "driverState");
+ }
+}
+
+static void
+append_face(char *dst, GLint face)
+{
+ if (face == 0)
+ append(dst, "front.");
+ else
+ append(dst, "back.");
+}
+
+static void
+append_index(char *dst, GLint index)
+{
+ char s[20];
+ sprintf(s, "[%d]", index);
+ append(dst, s);
+}
+
+/**
+ * Make a string from the given state vector.
+ * For example, return "state.matrix.texture[2].inverse".
+ * Use free() to deallocate the string.
+ */
+char *
+_mesa_program_state_string(const gl_state_index state[STATE_LENGTH])
+{
+ char str[1000] = "";
+ char tmp[30];
+
+ append(str, "state.");
+ append_token(str, state[0]);
+
+ switch (state[0]) {
+ case STATE_MATERIAL:
+ append_face(str, state[1]);
+ append_token(str, state[2]);
+ break;
+ case STATE_LIGHT:
+ append_index(str, state[1]); /* light number [i]. */
+ append_token(str, state[2]); /* coefficients */
+ break;
+ case STATE_LIGHTMODEL_AMBIENT:
+ append(str, "lightmodel.ambient");
+ break;
+ case STATE_LIGHTMODEL_SCENECOLOR:
+ if (state[1] == 0) {
+ append(str, "lightmodel.front.scenecolor");
+ }
+ else {
+ append(str, "lightmodel.back.scenecolor");
+ }
+ break;
+ case STATE_LIGHTPROD:
+ append_index(str, state[1]); /* light number [i]. */
+ append_face(str, state[2]);
+ append_token(str, state[3]);
+ break;
+ case STATE_TEXGEN:
+ append_index(str, state[1]); /* tex unit [i] */
+ append_token(str, state[2]); /* plane coef */
+ break;
+ case STATE_TEXENV_COLOR:
+ append_index(str, state[1]); /* tex unit [i] */
+ append(str, "color");
+ break;
+ case STATE_CLIPPLANE:
+ append_index(str, state[1]); /* plane [i] */
+ append(str, ".plane");
+ break;
+ case STATE_MODELVIEW_MATRIX:
+ case STATE_PROJECTION_MATRIX:
+ case STATE_MVP_MATRIX:
+ case STATE_TEXTURE_MATRIX:
+ case STATE_PROGRAM_MATRIX:
+ {
+ /* state[0] = modelview, projection, texture, etc. */
+ /* state[1] = which texture matrix or program matrix */
+ /* state[2] = first row to fetch */
+ /* state[3] = last row to fetch */
+ /* state[4] = transpose, inverse or invtrans */
+ const gl_state_index mat = state[0];
+ const GLuint index = (GLuint) state[1];
+ const GLuint firstRow = (GLuint) state[2];
+ const GLuint lastRow = (GLuint) state[3];
+ const gl_state_index modifier = state[4];
+ if (index ||
+ mat == STATE_TEXTURE_MATRIX ||
+ mat == STATE_PROGRAM_MATRIX)
+ append_index(str, index);
+ if (modifier)
+ append_token(str, modifier);
+ if (firstRow == lastRow)
+ sprintf(tmp, ".row[%d]", firstRow);
+ else
+ sprintf(tmp, ".row[%d..%d]", firstRow, lastRow);
+ append(str, tmp);
+ }
+ break;
+ case STATE_POINT_SIZE:
+ break;
+ case STATE_POINT_ATTENUATION:
+ break;
+ case STATE_FOG_PARAMS:
+ break;
+ case STATE_FOG_COLOR:
+ break;
+ case STATE_DEPTH_RANGE:
+ break;
+ case STATE_FRAGMENT_PROGRAM:
+ case STATE_VERTEX_PROGRAM:
+ /* state[1] = {STATE_ENV, STATE_LOCAL} */
+ /* state[2] = parameter index */
+ append_token(str, state[1]);
+ append_index(str, state[2]);
+ break;
+ case STATE_NORMAL_SCALE:
+ break;
+ case STATE_INTERNAL:
+ append_token(str, state[1]);
+ if (state[1] == STATE_CURRENT_ATTRIB)
+ append_index(str, state[2]);
+ break;
+ default:
+ _mesa_problem(NULL, "Invalid state in _mesa_program_state_string");
+ break;
+ }
+
+ return _mesa_strdup(str);
+}
+
+
+/**
+ * Loop over all the parameters in a parameter list. If the parameter
+ * is a GL state reference, look up the current value of that state
+ * variable and put it into the parameter's Value[4] array.
+ * Other parameter types never change or are explicitly set by the user
+ * with glUniform() or glProgramParameter(), etc.
+ * This would be called at glBegin time.
+ */
+void
+_mesa_load_state_parameters(struct gl_context *ctx,
+ struct gl_program_parameter_list *paramList)
+{
+ GLuint i;
+
+ if (!paramList)
+ return;
+
+ for (i = 0; i < paramList->NumParameters; i++) {
+ if (paramList->Parameters[i].Type == PROGRAM_STATE_VAR) {
+ _mesa_fetch_state(ctx,
+ paramList->Parameters[i].StateIndexes,
+ paramList->ParameterValues[i]);
+ }
+ }
+}
+
+
+/**
+ * Copy the 16 elements of a matrix into four consecutive program
+ * registers starting at 'pos'.
+ */
+static void
+load_matrix(GLfloat registers[][4], GLuint pos, const GLfloat mat[16])
+{
+ GLuint i;
+ for (i = 0; i < 4; i++) {
+ registers[pos + i][0] = mat[0 + i];
+ registers[pos + i][1] = mat[4 + i];
+ registers[pos + i][2] = mat[8 + i];
+ registers[pos + i][3] = mat[12 + i];
+ }
+}
+
+
+/**
+ * As above, but transpose the matrix.
+ */
+static void
+load_transpose_matrix(GLfloat registers[][4], GLuint pos,
+ const GLfloat mat[16])
+{
+ memcpy(registers[pos], mat, 16 * sizeof(GLfloat));
+}
+
+
+/**
+ * Load current vertex program's parameter registers with tracked
+ * matrices (if NV program). This only needs to be done per
+ * glBegin/glEnd, not per-vertex.
+ */
+void
+_mesa_load_tracked_matrices(struct gl_context *ctx)
+{
+ GLuint i;
+
+ for (i = 0; i < MAX_NV_VERTEX_PROGRAM_PARAMS / 4; i++) {
+ /* point 'mat' at source matrix */
+ GLmatrix *mat;
+ if (ctx->VertexProgram.TrackMatrix[i] == GL_MODELVIEW) {
+ mat = ctx->ModelviewMatrixStack.Top;
+ }
+ else if (ctx->VertexProgram.TrackMatrix[i] == GL_PROJECTION) {
+ mat = ctx->ProjectionMatrixStack.Top;
+ }
+ else if (ctx->VertexProgram.TrackMatrix[i] == GL_TEXTURE) {
+ GLuint unit = MIN2(ctx->Texture.CurrentUnit,
+ Elements(ctx->TextureMatrixStack) - 1);
+ mat = ctx->TextureMatrixStack[unit].Top;
+ }
+ else if (ctx->VertexProgram.TrackMatrix[i]==GL_MODELVIEW_PROJECTION_NV) {
+ /* XXX verify the combined matrix is up to date */
+ mat = &ctx->_ModelProjectMatrix;
+ }
+ else if (ctx->VertexProgram.TrackMatrix[i] >= GL_MATRIX0_NV &&
+ ctx->VertexProgram.TrackMatrix[i] <= GL_MATRIX7_NV) {
+ GLuint n = ctx->VertexProgram.TrackMatrix[i] - GL_MATRIX0_NV;
+ ASSERT(n < Elements(ctx->ProgramMatrixStack));
+ mat = ctx->ProgramMatrixStack[n].Top;
+ }
+ else {
+ /* no matrix is tracked, but we leave the register values as-is */
+ assert(ctx->VertexProgram.TrackMatrix[i] == GL_NONE);
+ continue;
+ }
+
+ /* load the matrix values into sequential registers */
+ if (ctx->VertexProgram.TrackMatrixTransform[i] == GL_IDENTITY_NV) {
+ load_matrix(ctx->VertexProgram.Parameters, i*4, mat->m);
+ }
+ else if (ctx->VertexProgram.TrackMatrixTransform[i] == GL_INVERSE_NV) {
+ _math_matrix_analyse(mat); /* update the inverse */
+ ASSERT(!_math_matrix_is_dirty(mat));
+ load_matrix(ctx->VertexProgram.Parameters, i*4, mat->inv);
+ }
+ else if (ctx->VertexProgram.TrackMatrixTransform[i] == GL_TRANSPOSE_NV) {
+ load_transpose_matrix(ctx->VertexProgram.Parameters, i*4, mat->m);
+ }
+ else {
+ assert(ctx->VertexProgram.TrackMatrixTransform[i]
+ == GL_INVERSE_TRANSPOSE_NV);
+ _math_matrix_analyse(mat); /* update the inverse */
+ ASSERT(!_math_matrix_is_dirty(mat));
+ load_transpose_matrix(ctx->VertexProgram.Parameters, i*4, mat->inv);
+ }
+ }
+}
diff --git a/mesalib/src/mesa/program/prog_statevars.h b/mesalib/src/mesa/program/prog_statevars.h
index 04af3f4cf..07e0a2798 100644
--- a/mesalib/src/mesa/program/prog_statevars.h
+++ b/mesalib/src/mesa/program/prog_statevars.h
@@ -1,148 +1,148 @@
-/*
- * Mesa 3-D graphics library
- * Version: 7.1
- *
- * Copyright (C) 1999-2007 Brian Paul All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-#ifndef PROG_STATEVARS_H
-#define PROG_STATEVARS_H
-
-#include "main/glheader.h"
-
-struct gl_context;
-struct gl_program_parameter_list;
-
-/**
- * Number of STATE_* values we need to address any GL state.
- * Used to dimension arrays.
- */
-#define STATE_LENGTH 5
-
-
-/**
- * Used for describing GL state referenced from inside ARB vertex and
- * fragment programs.
- * A string such as "state.light[0].ambient" gets translated into a
- * sequence of tokens such as [ STATE_LIGHT, 0, STATE_AMBIENT ].
- *
- * For state that's an array, like STATE_CLIPPLANE, the 2nd token [1] should
- * always be the array index.
- */
-typedef enum gl_state_index_ {
- STATE_MATERIAL = 100, /* start at 100 so small ints are seen as ints */
-
- STATE_LIGHT,
- STATE_LIGHTMODEL_AMBIENT,
- STATE_LIGHTMODEL_SCENECOLOR,
- STATE_LIGHTPROD,
-
- STATE_TEXGEN,
-
- STATE_FOG_COLOR,
- STATE_FOG_PARAMS,
-
- STATE_CLIPPLANE,
-
- STATE_POINT_SIZE,
- STATE_POINT_ATTENUATION,
-
- STATE_MODELVIEW_MATRIX,
- STATE_PROJECTION_MATRIX,
- STATE_MVP_MATRIX,
- STATE_TEXTURE_MATRIX,
- STATE_PROGRAM_MATRIX,
- STATE_MATRIX_INVERSE,
- STATE_MATRIX_TRANSPOSE,
- STATE_MATRIX_INVTRANS,
-
- STATE_AMBIENT,
- STATE_DIFFUSE,
- STATE_SPECULAR,
- STATE_EMISSION,
- STATE_SHININESS,
- STATE_HALF_VECTOR,
-
- STATE_POSITION, /**< xyzw = position */
- STATE_ATTENUATION, /**< xyz = attenuation, w = spot exponent */
- STATE_SPOT_DIRECTION, /**< xyz = direction, w = cos(cutoff) */
- STATE_SPOT_CUTOFF, /**< x = cutoff, yzw = undefined */
-
- STATE_TEXGEN_EYE_S,
- STATE_TEXGEN_EYE_T,
- STATE_TEXGEN_EYE_R,
- STATE_TEXGEN_EYE_Q,
- STATE_TEXGEN_OBJECT_S,
- STATE_TEXGEN_OBJECT_T,
- STATE_TEXGEN_OBJECT_R,
- STATE_TEXGEN_OBJECT_Q,
-
- STATE_TEXENV_COLOR,
-
- STATE_DEPTH_RANGE,
-
- STATE_VERTEX_PROGRAM,
- STATE_FRAGMENT_PROGRAM,
-
- STATE_ENV,
- STATE_LOCAL,
-
- STATE_INTERNAL, /* Mesa additions */
- STATE_CURRENT_ATTRIB, /* ctx->Current vertex attrib value */
- STATE_CURRENT_ATTRIB_MAYBE_VP_CLAMPED, /* ctx->Current vertex attrib value after passthrough vertex processing */
- STATE_NORMAL_SCALE,
- STATE_TEXRECT_SCALE,
- STATE_FOG_PARAMS_OPTIMIZED, /* for faster fog calc */
- STATE_POINT_SIZE_CLAMPED, /* includes implementation dependent size clamp */
- STATE_POINT_SIZE_IMPL_CLAMP, /* for implementation clamp only in vs */
- STATE_LIGHT_SPOT_DIR_NORMALIZED, /* pre-normalized spot dir */
- STATE_LIGHT_POSITION, /* object vs eye space */
- STATE_LIGHT_POSITION_NORMALIZED, /* object vs eye space */
- STATE_LIGHT_HALF_VECTOR, /* object vs eye space */
- STATE_PT_SCALE, /**< Pixel transfer RGBA scale */
- STATE_PT_BIAS, /**< Pixel transfer RGBA bias */
- STATE_SHADOW_AMBIENT, /**< ARB_shadow_ambient fail value; token[2] is texture unit index */
- STATE_FB_SIZE, /**< (width-1, height-1, 0, 0) */
- STATE_FB_WPOS_Y_TRANSFORM, /**< (1, 0, -1, height) if a FBO is bound, (-1, height, 1, 0) otherwise */
- STATE_ROT_MATRIX_0, /**< ATI_envmap_bumpmap, rot matrix row 0 */
- STATE_ROT_MATRIX_1, /**< ATI_envmap_bumpmap, rot matrix row 1 */
- STATE_INTERNAL_DRIVER /* first available state index for drivers (must be last) */
-} gl_state_index;
-
-
-
-extern void
-_mesa_load_state_parameters(struct gl_context *ctx,
- struct gl_program_parameter_list *paramList);
-
-
-extern GLbitfield
-_mesa_program_state_flags(const gl_state_index state[STATE_LENGTH]);
-
-
-extern char *
-_mesa_program_state_string(const gl_state_index state[STATE_LENGTH]);
-
-
-extern void
-_mesa_load_tracked_matrices(struct gl_context *ctx);
-
-
-#endif /* PROG_STATEVARS_H */
+/*
+ * Mesa 3-D graphics library
+ * Version: 7.1
+ *
+ * Copyright (C) 1999-2007 Brian Paul All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+#ifndef PROG_STATEVARS_H
+#define PROG_STATEVARS_H
+
+#include "main/glheader.h"
+
+struct gl_context;
+struct gl_program_parameter_list;
+
+/**
+ * Number of STATE_* values we need to address any GL state.
+ * Used to dimension arrays.
+ */
+#define STATE_LENGTH 5
+
+
+/**
+ * Used for describing GL state referenced from inside ARB vertex and
+ * fragment programs.
+ * A string such as "state.light[0].ambient" gets translated into a
+ * sequence of tokens such as [ STATE_LIGHT, 0, STATE_AMBIENT ].
+ *
+ * For state that's an array, like STATE_CLIPPLANE, the 2nd token [1] should
+ * always be the array index.
+ */
+typedef enum gl_state_index_ {
+ STATE_MATERIAL = 100, /* start at 100 so small ints are seen as ints */
+
+ STATE_LIGHT,
+ STATE_LIGHTMODEL_AMBIENT,
+ STATE_LIGHTMODEL_SCENECOLOR,
+ STATE_LIGHTPROD,
+
+ STATE_TEXGEN,
+
+ STATE_FOG_COLOR,
+ STATE_FOG_PARAMS,
+
+ STATE_CLIPPLANE,
+
+ STATE_POINT_SIZE,
+ STATE_POINT_ATTENUATION,
+
+ STATE_MODELVIEW_MATRIX,
+ STATE_PROJECTION_MATRIX,
+ STATE_MVP_MATRIX,
+ STATE_TEXTURE_MATRIX,
+ STATE_PROGRAM_MATRIX,
+ STATE_MATRIX_INVERSE,
+ STATE_MATRIX_TRANSPOSE,
+ STATE_MATRIX_INVTRANS,
+
+ STATE_AMBIENT,
+ STATE_DIFFUSE,
+ STATE_SPECULAR,
+ STATE_EMISSION,
+ STATE_SHININESS,
+ STATE_HALF_VECTOR,
+
+ STATE_POSITION, /**< xyzw = position */
+ STATE_ATTENUATION, /**< xyz = attenuation, w = spot exponent */
+ STATE_SPOT_DIRECTION, /**< xyz = direction, w = cos(cutoff) */
+ STATE_SPOT_CUTOFF, /**< x = cutoff, yzw = undefined */
+
+ STATE_TEXGEN_EYE_S,
+ STATE_TEXGEN_EYE_T,
+ STATE_TEXGEN_EYE_R,
+ STATE_TEXGEN_EYE_Q,
+ STATE_TEXGEN_OBJECT_S,
+ STATE_TEXGEN_OBJECT_T,
+ STATE_TEXGEN_OBJECT_R,
+ STATE_TEXGEN_OBJECT_Q,
+
+ STATE_TEXENV_COLOR,
+
+ STATE_DEPTH_RANGE,
+
+ STATE_VERTEX_PROGRAM,
+ STATE_FRAGMENT_PROGRAM,
+
+ STATE_ENV,
+ STATE_LOCAL,
+
+ STATE_INTERNAL, /* Mesa additions */
+ STATE_CURRENT_ATTRIB, /* ctx->Current vertex attrib value */
+ STATE_CURRENT_ATTRIB_MAYBE_VP_CLAMPED, /* ctx->Current vertex attrib value after passthrough vertex processing */
+ STATE_NORMAL_SCALE,
+ STATE_TEXRECT_SCALE,
+ STATE_FOG_PARAMS_OPTIMIZED, /* for faster fog calc */
+ STATE_POINT_SIZE_CLAMPED, /* includes implementation dependent size clamp */
+ STATE_POINT_SIZE_IMPL_CLAMP, /* for implementation clamp only in vs */
+ STATE_LIGHT_SPOT_DIR_NORMALIZED, /* pre-normalized spot dir */
+ STATE_LIGHT_POSITION, /* object vs eye space */
+ STATE_LIGHT_POSITION_NORMALIZED, /* object vs eye space */
+ STATE_LIGHT_HALF_VECTOR, /* object vs eye space */
+ STATE_PT_SCALE, /**< Pixel transfer RGBA scale */
+ STATE_PT_BIAS, /**< Pixel transfer RGBA bias */
+ STATE_SHADOW_AMBIENT, /**< ARB_shadow_ambient fail value; token[2] is texture unit index */
+ STATE_FB_SIZE, /**< (width-1, height-1, 0, 0) */
+ STATE_FB_WPOS_Y_TRANSFORM, /**< (1, 0, -1, height) if a FBO is bound, (-1, height, 1, 0) otherwise */
+ STATE_ROT_MATRIX_0, /**< ATI_envmap_bumpmap, rot matrix row 0 */
+ STATE_ROT_MATRIX_1, /**< ATI_envmap_bumpmap, rot matrix row 1 */
+ STATE_INTERNAL_DRIVER /* first available state index for drivers (must be last) */
+} gl_state_index;
+
+
+
+extern void
+_mesa_load_state_parameters(struct gl_context *ctx,
+ struct gl_program_parameter_list *paramList);
+
+
+extern GLbitfield
+_mesa_program_state_flags(const gl_state_index state[STATE_LENGTH]);
+
+
+extern char *
+_mesa_program_state_string(const gl_state_index state[STATE_LENGTH]);
+
+
+extern void
+_mesa_load_tracked_matrices(struct gl_context *ctx);
+
+
+#endif /* PROG_STATEVARS_H */
diff --git a/mesalib/src/mesa/program/program.c b/mesalib/src/mesa/program/program.c
index 78efca9f1..c39f85e89 100644
--- a/mesalib/src/mesa/program/program.c
+++ b/mesalib/src/mesa/program/program.c
@@ -1,1076 +1,1076 @@
-/*
- * Mesa 3-D graphics library
- * Version: 6.5.3
- *
- * Copyright (C) 1999-2007 Brian Paul All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-/**
- * \file program.c
- * Vertex and fragment program support functions.
- * \author Brian Paul
- */
-
-
-#include "main/glheader.h"
-#include "main/context.h"
-#include "main/hash.h"
-#include "main/mfeatures.h"
-#include "program.h"
-#include "prog_cache.h"
-#include "prog_parameter.h"
-#include "prog_instruction.h"
-
-
-/**
- * A pointer to this dummy program is put into the hash table when
- * glGenPrograms is called.
- */
-struct gl_program _mesa_DummyProgram;
-
-
-/**
- * Init context's vertex/fragment program state
- */
-void
-_mesa_init_program(struct gl_context *ctx)
-{
- GLuint i;
-
- /*
- * If this assertion fails, we need to increase the field
- * size for register indexes (see INST_INDEX_BITS).
- */
- ASSERT(ctx->Const.VertexProgram.MaxUniformComponents / 4
- <= (1 << INST_INDEX_BITS));
- ASSERT(ctx->Const.FragmentProgram.MaxUniformComponents / 4
- <= (1 << INST_INDEX_BITS));
-
- ASSERT(ctx->Const.VertexProgram.MaxTemps <= (1 << INST_INDEX_BITS));
- ASSERT(ctx->Const.VertexProgram.MaxLocalParams <= (1 << INST_INDEX_BITS));
- ASSERT(ctx->Const.FragmentProgram.MaxTemps <= (1 << INST_INDEX_BITS));
- ASSERT(ctx->Const.FragmentProgram.MaxLocalParams <= (1 << INST_INDEX_BITS));
-
- ASSERT(ctx->Const.VertexProgram.MaxUniformComponents <= 4 * MAX_UNIFORMS);
- ASSERT(ctx->Const.FragmentProgram.MaxUniformComponents <= 4 * MAX_UNIFORMS);
-
- ASSERT(ctx->Const.VertexProgram.MaxAddressOffset <= (1 << INST_INDEX_BITS));
- ASSERT(ctx->Const.FragmentProgram.MaxAddressOffset <= (1 << INST_INDEX_BITS));
-
- /* If this fails, increase prog_instruction::TexSrcUnit size */
- ASSERT(MAX_TEXTURE_UNITS <= (1 << 5));
-
- /* If this fails, increase prog_instruction::TexSrcTarget size */
- ASSERT(NUM_TEXTURE_TARGETS <= (1 << 3));
-
- ctx->Program.ErrorPos = -1;
- ctx->Program.ErrorString = _mesa_strdup("");
-
-#if FEATURE_NV_vertex_program || FEATURE_ARB_vertex_program
- ctx->VertexProgram.Enabled = GL_FALSE;
-#if FEATURE_es2_glsl
- ctx->VertexProgram.PointSizeEnabled =
- (ctx->API == API_OPENGLES2) ? GL_TRUE : GL_FALSE;
-#else
- ctx->VertexProgram.PointSizeEnabled = GL_FALSE;
-#endif
- ctx->VertexProgram.TwoSideEnabled = GL_FALSE;
- _mesa_reference_vertprog(ctx, &ctx->VertexProgram.Current,
- ctx->Shared->DefaultVertexProgram);
- assert(ctx->VertexProgram.Current);
- for (i = 0; i < MAX_NV_VERTEX_PROGRAM_PARAMS / 4; i++) {
- ctx->VertexProgram.TrackMatrix[i] = GL_NONE;
- ctx->VertexProgram.TrackMatrixTransform[i] = GL_IDENTITY_NV;
- }
- ctx->VertexProgram.Cache = _mesa_new_program_cache();
-#endif
-
-#if FEATURE_NV_fragment_program || FEATURE_ARB_fragment_program
- ctx->FragmentProgram.Enabled = GL_FALSE;
- _mesa_reference_fragprog(ctx, &ctx->FragmentProgram.Current,
- ctx->Shared->DefaultFragmentProgram);
- assert(ctx->FragmentProgram.Current);
- ctx->FragmentProgram.Cache = _mesa_new_program_cache();
-#endif
-
-#if FEATURE_ARB_geometry_shader4
- ctx->GeometryProgram.Enabled = GL_FALSE;
- /* right now by default we don't have a geometry program */
- _mesa_reference_geomprog(ctx, &ctx->GeometryProgram.Current,
- NULL);
- ctx->GeometryProgram.Cache = _mesa_new_program_cache();
-#endif
-
- /* XXX probably move this stuff */
-#if FEATURE_ATI_fragment_shader
- ctx->ATIFragmentShader.Enabled = GL_FALSE;
- ctx->ATIFragmentShader.Current = ctx->Shared->DefaultFragmentShader;
- assert(ctx->ATIFragmentShader.Current);
- ctx->ATIFragmentShader.Current->RefCount++;
-#endif
-}
-
-
-/**
- * Free a context's vertex/fragment program state
- */
-void
-_mesa_free_program_data(struct gl_context *ctx)
-{
-#if FEATURE_NV_vertex_program || FEATURE_ARB_vertex_program
- _mesa_reference_vertprog(ctx, &ctx->VertexProgram.Current, NULL);
- _mesa_delete_program_cache(ctx, ctx->VertexProgram.Cache);
-#endif
-#if FEATURE_NV_fragment_program || FEATURE_ARB_fragment_program
- _mesa_reference_fragprog(ctx, &ctx->FragmentProgram.Current, NULL);
- _mesa_delete_program_cache(ctx, ctx->FragmentProgram.Cache);
-#endif
-#if FEATURE_ARB_geometry_shader4
- _mesa_reference_geomprog(ctx, &ctx->GeometryProgram.Current, NULL);
- _mesa_delete_program_cache(ctx, ctx->GeometryProgram.Cache);
-#endif
- /* XXX probably move this stuff */
-#if FEATURE_ATI_fragment_shader
- if (ctx->ATIFragmentShader.Current) {
- ctx->ATIFragmentShader.Current->RefCount--;
- if (ctx->ATIFragmentShader.Current->RefCount <= 0) {
- free(ctx->ATIFragmentShader.Current);
- }
- }
-#endif
- free((void *) ctx->Program.ErrorString);
-}
-
-
-/**
- * Update the default program objects in the given context to reference those
- * specified in the shared state and release those referencing the old
- * shared state.
- */
-void
-_mesa_update_default_objects_program(struct gl_context *ctx)
-{
-#if FEATURE_NV_vertex_program || FEATURE_ARB_vertex_program
- _mesa_reference_vertprog(ctx, &ctx->VertexProgram.Current,
- (struct gl_vertex_program *)
- ctx->Shared->DefaultVertexProgram);
- assert(ctx->VertexProgram.Current);
-#endif
-
-#if FEATURE_NV_fragment_program || FEATURE_ARB_fragment_program
- _mesa_reference_fragprog(ctx, &ctx->FragmentProgram.Current,
- (struct gl_fragment_program *)
- ctx->Shared->DefaultFragmentProgram);
- assert(ctx->FragmentProgram.Current);
-#endif
-
-#if FEATURE_ARB_geometry_shader4
- _mesa_reference_geomprog(ctx, &ctx->GeometryProgram.Current,
- (struct gl_geometry_program *)
- ctx->Shared->DefaultGeometryProgram);
-#endif
-
- /* XXX probably move this stuff */
-#if FEATURE_ATI_fragment_shader
- if (ctx->ATIFragmentShader.Current) {
- ctx->ATIFragmentShader.Current->RefCount--;
- if (ctx->ATIFragmentShader.Current->RefCount <= 0) {
- free(ctx->ATIFragmentShader.Current);
- }
- }
- ctx->ATIFragmentShader.Current = (struct ati_fragment_shader *) ctx->Shared->DefaultFragmentShader;
- assert(ctx->ATIFragmentShader.Current);
- ctx->ATIFragmentShader.Current->RefCount++;
-#endif
-}
-
-
-/**
- * Set the vertex/fragment program error state (position and error string).
- * This is generally called from within the parsers.
- */
-void
-_mesa_set_program_error(struct gl_context *ctx, GLint pos, const char *string)
-{
- ctx->Program.ErrorPos = pos;
- free((void *) ctx->Program.ErrorString);
- if (!string)
- string = "";
- ctx->Program.ErrorString = _mesa_strdup(string);
-}
-
-
-/**
- * Find the line number and column for 'pos' within 'string'.
- * Return a copy of the line which contains 'pos'. Free the line with
- * free().
- * \param string the program string
- * \param pos the position within the string
- * \param line returns the line number corresponding to 'pos'.
- * \param col returns the column number corresponding to 'pos'.
- * \return copy of the line containing 'pos'.
- */
-const GLubyte *
-_mesa_find_line_column(const GLubyte *string, const GLubyte *pos,
- GLint *line, GLint *col)
-{
- const GLubyte *lineStart = string;
- const GLubyte *p = string;
- GLubyte *s;
- int len;
-
- *line = 1;
-
- while (p != pos) {
- if (*p == (GLubyte) '\n') {
- (*line)++;
- lineStart = p + 1;
- }
- p++;
- }
-
- *col = (pos - lineStart) + 1;
-
- /* return copy of this line */
- while (*p != 0 && *p != '\n')
- p++;
- len = p - lineStart;
- s = (GLubyte *) malloc(len + 1);
- memcpy(s, lineStart, len);
- s[len] = 0;
-
- return s;
-}
-
-
-/**
- * Initialize a new vertex/fragment program object.
- */
-static struct gl_program *
-_mesa_init_program_struct( struct gl_context *ctx, struct gl_program *prog,
- GLenum target, GLuint id)
-{
- (void) ctx;
- if (prog) {
- GLuint i;
- memset(prog, 0, sizeof(*prog));
- prog->Id = id;
- prog->Target = target;
- prog->Resident = GL_TRUE;
- prog->RefCount = 1;
- prog->Format = GL_PROGRAM_FORMAT_ASCII_ARB;
-
- /* default mapping from samplers to texture units */
- for (i = 0; i < MAX_SAMPLERS; i++)
- prog->SamplerUnits[i] = i;
- }
-
- return prog;
-}
-
-
-/**
- * Initialize a new fragment program object.
- */
-struct gl_program *
-_mesa_init_fragment_program( struct gl_context *ctx, struct gl_fragment_program *prog,
- GLenum target, GLuint id)
-{
- if (prog)
- return _mesa_init_program_struct( ctx, &prog->Base, target, id );
- else
- return NULL;
-}
-
-
-/**
- * Initialize a new vertex program object.
- */
-struct gl_program *
-_mesa_init_vertex_program( struct gl_context *ctx, struct gl_vertex_program *prog,
- GLenum target, GLuint id)
-{
- if (prog)
- return _mesa_init_program_struct( ctx, &prog->Base, target, id );
- else
- return NULL;
-}
-
-
-/**
- * Initialize a new geometry program object.
- */
-struct gl_program *
-_mesa_init_geometry_program( struct gl_context *ctx, struct gl_geometry_program *prog,
- GLenum target, GLuint id)
-{
- if (prog)
- return _mesa_init_program_struct( ctx, &prog->Base, target, id );
- else
- return NULL;
-}
-
-
-/**
- * Allocate and initialize a new fragment/vertex program object but
- * don't put it into the program hash table. Called via
- * ctx->Driver.NewProgram. May be overridden (ie. replaced) by a
- * device driver function to implement OO deriviation with additional
- * types not understood by this function.
- *
- * \param ctx context
- * \param id program id/number
- * \param target program target/type
- * \return pointer to new program object
- */
-struct gl_program *
-_mesa_new_program(struct gl_context *ctx, GLenum target, GLuint id)
-{
- struct gl_program *prog;
- switch (target) {
- case GL_VERTEX_PROGRAM_ARB: /* == GL_VERTEX_PROGRAM_NV */
- case GL_VERTEX_STATE_PROGRAM_NV:
- prog = _mesa_init_vertex_program(ctx, CALLOC_STRUCT(gl_vertex_program),
- target, id );
- break;
- case GL_FRAGMENT_PROGRAM_NV:
- case GL_FRAGMENT_PROGRAM_ARB:
- prog =_mesa_init_fragment_program(ctx,
- CALLOC_STRUCT(gl_fragment_program),
- target, id );
- break;
- case MESA_GEOMETRY_PROGRAM:
- prog = _mesa_init_geometry_program(ctx,
- CALLOC_STRUCT(gl_geometry_program),
- target, id);
- break;
- default:
- _mesa_problem(ctx, "bad target in _mesa_new_program");
- prog = NULL;
- }
- return prog;
-}
-
-
-/**
- * Delete a program and remove it from the hash table, ignoring the
- * reference count.
- * Called via ctx->Driver.DeleteProgram. May be wrapped (OO deriviation)
- * by a device driver function.
- */
-void
-_mesa_delete_program(struct gl_context *ctx, struct gl_program *prog)
-{
- (void) ctx;
- ASSERT(prog);
- ASSERT(prog->RefCount==0);
-
- if (prog == &_mesa_DummyProgram)
- return;
-
- if (prog->String)
- free(prog->String);
-
- _mesa_free_instructions(prog->Instructions, prog->NumInstructions);
-
- if (prog->Parameters) {
- _mesa_free_parameter_list(prog->Parameters);
- }
- if (prog->Varying) {
- _mesa_free_parameter_list(prog->Varying);
- }
- if (prog->Attributes) {
- _mesa_free_parameter_list(prog->Attributes);
- }
-
- free(prog);
-}
-
-
-/**
- * Return the gl_program object for a given ID.
- * Basically just a wrapper for _mesa_HashLookup() to avoid a lot of
- * casts elsewhere.
- */
-struct gl_program *
-_mesa_lookup_program(struct gl_context *ctx, GLuint id)
-{
- if (id)
- return (struct gl_program *) _mesa_HashLookup(ctx->Shared->Programs, id);
- else
- return NULL;
-}
-
-
-/**
- * Reference counting for vertex/fragment programs
- */
-void
-_mesa_reference_program(struct gl_context *ctx,
- struct gl_program **ptr,
- struct gl_program *prog)
-{
- assert(ptr);
- if (*ptr && prog) {
- /* sanity check */
- if ((*ptr)->Target == GL_VERTEX_PROGRAM_ARB)
- ASSERT(prog->Target == GL_VERTEX_PROGRAM_ARB);
- else if ((*ptr)->Target == GL_FRAGMENT_PROGRAM_ARB)
- ASSERT(prog->Target == GL_FRAGMENT_PROGRAM_ARB ||
- prog->Target == GL_FRAGMENT_PROGRAM_NV);
- else if ((*ptr)->Target == MESA_GEOMETRY_PROGRAM)
- ASSERT(prog->Target == MESA_GEOMETRY_PROGRAM);
- }
- if (*ptr == prog) {
- return; /* no change */
- }
- if (*ptr) {
- GLboolean deleteFlag;
-
- /*_glthread_LOCK_MUTEX((*ptr)->Mutex);*/
-#if 0
- printf("Program %p ID=%u Target=%s Refcount-- to %d\n",
- *ptr, (*ptr)->Id,
- ((*ptr)->Target == GL_VERTEX_PROGRAM_ARB ? "VP" :
- ((*ptr)->Target == MESA_GEOMETRY_PROGRAM ? "GP" : "FP")),
- (*ptr)->RefCount - 1);
-#endif
- ASSERT((*ptr)->RefCount > 0);
- (*ptr)->RefCount--;
-
- deleteFlag = ((*ptr)->RefCount == 0);
- /*_glthread_UNLOCK_MUTEX((*ptr)->Mutex);*/
-
- if (deleteFlag) {
- ASSERT(ctx);
- ctx->Driver.DeleteProgram(ctx, *ptr);
- }
-
- *ptr = NULL;
- }
-
- assert(!*ptr);
- if (prog) {
- /*_glthread_LOCK_MUTEX(prog->Mutex);*/
- prog->RefCount++;
-#if 0
- printf("Program %p ID=%u Target=%s Refcount++ to %d\n",
- prog, prog->Id,
- (prog->Target == GL_VERTEX_PROGRAM_ARB ? "VP" :
- (prog->Target == MESA_GEOMETRY_PROGRAM ? "GP" : "FP")),
- prog->RefCount);
-#endif
- /*_glthread_UNLOCK_MUTEX(prog->Mutex);*/
- }
-
- *ptr = prog;
-}
-
-
-/**
- * Return a copy of a program.
- * XXX Problem here if the program object is actually OO-derivation
- * made by a device driver.
- */
-struct gl_program *
-_mesa_clone_program(struct gl_context *ctx, const struct gl_program *prog)
-{
- struct gl_program *clone;
-
- clone = ctx->Driver.NewProgram(ctx, prog->Target, prog->Id);
- if (!clone)
- return NULL;
-
- assert(clone->Target == prog->Target);
- assert(clone->RefCount == 1);
-
- clone->String = (GLubyte *) _mesa_strdup((char *) prog->String);
- clone->Format = prog->Format;
- clone->Instructions = _mesa_alloc_instructions(prog->NumInstructions);
- if (!clone->Instructions) {
- _mesa_reference_program(ctx, &clone, NULL);
- return NULL;
- }
- _mesa_copy_instructions(clone->Instructions, prog->Instructions,
- prog->NumInstructions);
- clone->InputsRead = prog->InputsRead;
- clone->OutputsWritten = prog->OutputsWritten;
- clone->SamplersUsed = prog->SamplersUsed;
- clone->ShadowSamplers = prog->ShadowSamplers;
- memcpy(clone->TexturesUsed, prog->TexturesUsed, sizeof(prog->TexturesUsed));
-
- if (prog->Parameters)
- clone->Parameters = _mesa_clone_parameter_list(prog->Parameters);
- memcpy(clone->LocalParams, prog->LocalParams, sizeof(clone->LocalParams));
- if (prog->Varying)
- clone->Varying = _mesa_clone_parameter_list(prog->Varying);
- if (prog->Attributes)
- clone->Attributes = _mesa_clone_parameter_list(prog->Attributes);
- memcpy(clone->LocalParams, prog->LocalParams, sizeof(clone->LocalParams));
- clone->IndirectRegisterFiles = prog->IndirectRegisterFiles;
- clone->NumInstructions = prog->NumInstructions;
- clone->NumTemporaries = prog->NumTemporaries;
- clone->NumParameters = prog->NumParameters;
- clone->NumAttributes = prog->NumAttributes;
- clone->NumAddressRegs = prog->NumAddressRegs;
- clone->NumNativeInstructions = prog->NumNativeInstructions;
- clone->NumNativeTemporaries = prog->NumNativeTemporaries;
- clone->NumNativeParameters = prog->NumNativeParameters;
- clone->NumNativeAttributes = prog->NumNativeAttributes;
- clone->NumNativeAddressRegs = prog->NumNativeAddressRegs;
- clone->NumAluInstructions = prog->NumAluInstructions;
- clone->NumTexInstructions = prog->NumTexInstructions;
- clone->NumTexIndirections = prog->NumTexIndirections;
- clone->NumNativeAluInstructions = prog->NumNativeAluInstructions;
- clone->NumNativeTexInstructions = prog->NumNativeTexInstructions;
- clone->NumNativeTexIndirections = prog->NumNativeTexIndirections;
-
- switch (prog->Target) {
- case GL_VERTEX_PROGRAM_ARB:
- {
- const struct gl_vertex_program *vp
- = (const struct gl_vertex_program *) prog;
- struct gl_vertex_program *vpc = (struct gl_vertex_program *) clone;
- vpc->IsPositionInvariant = vp->IsPositionInvariant;
- vpc->IsNVProgram = vp->IsNVProgram;
- }
- break;
- case GL_FRAGMENT_PROGRAM_ARB:
- {
- const struct gl_fragment_program *fp
- = (const struct gl_fragment_program *) prog;
- struct gl_fragment_program *fpc = (struct gl_fragment_program *) clone;
- fpc->UsesKill = fp->UsesKill;
- fpc->OriginUpperLeft = fp->OriginUpperLeft;
- fpc->PixelCenterInteger = fp->PixelCenterInteger;
- }
- break;
- case MESA_GEOMETRY_PROGRAM:
- {
- const struct gl_geometry_program *gp
- = (const struct gl_geometry_program *) prog;
- struct gl_geometry_program *gpc = (struct gl_geometry_program *) clone;
- gpc->VerticesOut = gp->VerticesOut;
- gpc->InputType = gp->InputType;
- gpc->OutputType = gp->OutputType;
- }
- break;
- default:
- _mesa_problem(NULL, "Unexpected target in _mesa_clone_program");
- }
-
- return clone;
-}
-
-
-/**
- * Insert 'count' NOP instructions at 'start' in the given program.
- * Adjust branch targets accordingly.
- */
-GLboolean
-_mesa_insert_instructions(struct gl_program *prog, GLuint start, GLuint count)
-{
- const GLuint origLen = prog->NumInstructions;
- const GLuint newLen = origLen + count;
- struct prog_instruction *newInst;
- GLuint i;
-
- /* adjust branches */
- for (i = 0; i < prog->NumInstructions; i++) {
- struct prog_instruction *inst = prog->Instructions + i;
- if (inst->BranchTarget > 0) {
- if ((GLuint)inst->BranchTarget >= start) {
- inst->BranchTarget += count;
- }
- }
- }
-
- /* Alloc storage for new instructions */
- newInst = _mesa_alloc_instructions(newLen);
- if (!newInst) {
- return GL_FALSE;
- }
-
- /* Copy 'start' instructions into new instruction buffer */
- _mesa_copy_instructions(newInst, prog->Instructions, start);
-
- /* init the new instructions */
- _mesa_init_instructions(newInst + start, count);
-
- /* Copy the remaining/tail instructions to new inst buffer */
- _mesa_copy_instructions(newInst + start + count,
- prog->Instructions + start,
- origLen - start);
-
- /* free old instructions */
- _mesa_free_instructions(prog->Instructions, origLen);
-
- /* install new instructions */
- prog->Instructions = newInst;
- prog->NumInstructions = newLen;
-
- return GL_TRUE;
-}
-
-/**
- * Delete 'count' instructions at 'start' in the given program.
- * Adjust branch targets accordingly.
- */
-GLboolean
-_mesa_delete_instructions(struct gl_program *prog, GLuint start, GLuint count)
-{
- const GLuint origLen = prog->NumInstructions;
- const GLuint newLen = origLen - count;
- struct prog_instruction *newInst;
- GLuint i;
-
- /* adjust branches */
- for (i = 0; i < prog->NumInstructions; i++) {
- struct prog_instruction *inst = prog->Instructions + i;
- if (inst->BranchTarget > 0) {
- if (inst->BranchTarget > (GLint) start) {
- inst->BranchTarget -= count;
- }
- }
- }
-
- /* Alloc storage for new instructions */
- newInst = _mesa_alloc_instructions(newLen);
- if (!newInst) {
- return GL_FALSE;
- }
-
- /* Copy 'start' instructions into new instruction buffer */
- _mesa_copy_instructions(newInst, prog->Instructions, start);
-
- /* Copy the remaining/tail instructions to new inst buffer */
- _mesa_copy_instructions(newInst + start,
- prog->Instructions + start + count,
- newLen - start);
-
- /* free old instructions */
- _mesa_free_instructions(prog->Instructions, origLen);
-
- /* install new instructions */
- prog->Instructions = newInst;
- prog->NumInstructions = newLen;
-
- return GL_TRUE;
-}
-
-
-/**
- * Search instructions for registers that match (oldFile, oldIndex),
- * replacing them with (newFile, newIndex).
- */
-static void
-replace_registers(struct prog_instruction *inst, GLuint numInst,
- GLuint oldFile, GLuint oldIndex,
- GLuint newFile, GLuint newIndex)
-{
- GLuint i, j;
- for (i = 0; i < numInst; i++) {
- /* src regs */
- for (j = 0; j < _mesa_num_inst_src_regs(inst[i].Opcode); j++) {
- if (inst[i].SrcReg[j].File == oldFile &&
- inst[i].SrcReg[j].Index == oldIndex) {
- inst[i].SrcReg[j].File = newFile;
- inst[i].SrcReg[j].Index = newIndex;
- }
- }
- /* dst reg */
- if (inst[i].DstReg.File == oldFile && inst[i].DstReg.Index == oldIndex) {
- inst[i].DstReg.File = newFile;
- inst[i].DstReg.Index = newIndex;
- }
- }
-}
-
-
-/**
- * Search instructions for references to program parameters. When found,
- * increment the parameter index by 'offset'.
- * Used when combining programs.
- */
-static void
-adjust_param_indexes(struct prog_instruction *inst, GLuint numInst,
- GLuint offset)
-{
- GLuint i, j;
- for (i = 0; i < numInst; i++) {
- for (j = 0; j < _mesa_num_inst_src_regs(inst[i].Opcode); j++) {
- GLuint f = inst[i].SrcReg[j].File;
- if (f == PROGRAM_CONSTANT ||
- f == PROGRAM_UNIFORM ||
- f == PROGRAM_STATE_VAR) {
- inst[i].SrcReg[j].Index += offset;
- }
- }
- }
-}
-
-
-/**
- * Combine two programs into one. Fix instructions so the outputs of
- * the first program go to the inputs of the second program.
- */
-struct gl_program *
-_mesa_combine_programs(struct gl_context *ctx,
- const struct gl_program *progA,
- const struct gl_program *progB)
-{
- struct prog_instruction *newInst;
- struct gl_program *newProg;
- const GLuint lenA = progA->NumInstructions - 1; /* omit END instr */
- const GLuint lenB = progB->NumInstructions;
- const GLuint numParamsA = _mesa_num_parameters(progA->Parameters);
- const GLuint newLength = lenA + lenB;
- GLboolean usedTemps[MAX_PROGRAM_TEMPS];
- GLuint firstTemp = 0;
- GLbitfield inputsB;
- GLuint i;
-
- ASSERT(progA->Target == progB->Target);
-
- newInst = _mesa_alloc_instructions(newLength);
- if (!newInst)
- return GL_FALSE;
-
- _mesa_copy_instructions(newInst, progA->Instructions, lenA);
- _mesa_copy_instructions(newInst + lenA, progB->Instructions, lenB);
-
- /* adjust branch / instruction addresses for B's instructions */
- for (i = 0; i < lenB; i++) {
- newInst[lenA + i].BranchTarget += lenA;
- }
-
- newProg = ctx->Driver.NewProgram(ctx, progA->Target, 0);
- newProg->Instructions = newInst;
- newProg->NumInstructions = newLength;
-
- /* find used temp regs (we may need new temps below) */
- _mesa_find_used_registers(newProg, PROGRAM_TEMPORARY,
- usedTemps, MAX_PROGRAM_TEMPS);
-
- if (newProg->Target == GL_FRAGMENT_PROGRAM_ARB) {
- struct gl_fragment_program *fprogA, *fprogB, *newFprog;
- GLbitfield progB_inputsRead = progB->InputsRead;
- GLint progB_colorFile, progB_colorIndex;
-
- fprogA = (struct gl_fragment_program *) progA;
- fprogB = (struct gl_fragment_program *) progB;
- newFprog = (struct gl_fragment_program *) newProg;
-
- newFprog->UsesKill = fprogA->UsesKill || fprogB->UsesKill;
-
- /* We'll do a search and replace for instances
- * of progB_colorFile/progB_colorIndex below...
- */
- progB_colorFile = PROGRAM_INPUT;
- progB_colorIndex = FRAG_ATTRIB_COL0;
-
- /*
- * The fragment program may get color from a state var rather than
- * a fragment input (vertex output) if it's constant.
- * See the texenvprogram.c code.
- * So, search the program's parameter list now to see if the program
- * gets color from a state var instead of a conventional fragment
- * input register.
- */
- for (i = 0; i < progB->Parameters->NumParameters; i++) {
- struct gl_program_parameter *p = &progB->Parameters->Parameters[i];
- if (p->Type == PROGRAM_STATE_VAR &&
- p->StateIndexes[0] == STATE_INTERNAL &&
- p->StateIndexes[1] == STATE_CURRENT_ATTRIB &&
- (int) p->StateIndexes[2] == (int) VERT_ATTRIB_COLOR0) {
- progB_inputsRead |= FRAG_BIT_COL0;
- progB_colorFile = PROGRAM_STATE_VAR;
- progB_colorIndex = i;
- break;
- }
- }
-
- /* Connect color outputs of fprogA to color inputs of fprogB, via a
- * new temporary register.
- */
- if ((progA->OutputsWritten & BITFIELD64_BIT(FRAG_RESULT_COLOR)) &&
- (progB_inputsRead & FRAG_BIT_COL0)) {
- GLint tempReg = _mesa_find_free_register(usedTemps, MAX_PROGRAM_TEMPS,
- firstTemp);
- if (tempReg < 0) {
- _mesa_problem(ctx, "No free temp regs found in "
- "_mesa_combine_programs(), using 31");
- tempReg = 31;
- }
- firstTemp = tempReg + 1;
-
- /* replace writes to result.color[0] with tempReg */
- replace_registers(newInst, lenA,
- PROGRAM_OUTPUT, FRAG_RESULT_COLOR,
- PROGRAM_TEMPORARY, tempReg);
- /* replace reads from the input color with tempReg */
- replace_registers(newInst + lenA, lenB,
- progB_colorFile, progB_colorIndex, /* search for */
- PROGRAM_TEMPORARY, tempReg /* replace with */ );
- }
-
- /* compute combined program's InputsRead */
- inputsB = progB_inputsRead;
- if (progA->OutputsWritten & BITFIELD64_BIT(FRAG_RESULT_COLOR)) {
- inputsB &= ~(1 << FRAG_ATTRIB_COL0);
- }
- newProg->InputsRead = progA->InputsRead | inputsB;
- newProg->OutputsWritten = progB->OutputsWritten;
- newProg->SamplersUsed = progA->SamplersUsed | progB->SamplersUsed;
- }
- else {
- /* vertex program */
- assert(0); /* XXX todo */
- }
-
- /*
- * Merge parameters (uniforms, constants, etc)
- */
- newProg->Parameters = _mesa_combine_parameter_lists(progA->Parameters,
- progB->Parameters);
-
- adjust_param_indexes(newInst + lenA, lenB, numParamsA);
-
-
- return newProg;
-}
-
-
-/**
- * Populate the 'used' array with flags indicating which registers (TEMPs,
- * INPUTs, OUTPUTs, etc, are used by the given program.
- * \param file type of register to scan for
- * \param used returns true/false flags for in use / free
- * \param usedSize size of the 'used' array
- */
-void
-_mesa_find_used_registers(const struct gl_program *prog,
- gl_register_file file,
- GLboolean used[], GLuint usedSize)
-{
- GLuint i, j;
-
- memset(used, 0, usedSize);
-
- for (i = 0; i < prog->NumInstructions; i++) {
- const struct prog_instruction *inst = prog->Instructions + i;
- const GLuint n = _mesa_num_inst_src_regs(inst->Opcode);
-
- if (inst->DstReg.File == file) {
- ASSERT(inst->DstReg.Index < usedSize);
- if(inst->DstReg.Index < usedSize)
- used[inst->DstReg.Index] = GL_TRUE;
- }
-
- for (j = 0; j < n; j++) {
- if (inst->SrcReg[j].File == file) {
- ASSERT(inst->SrcReg[j].Index < usedSize);
- if(inst->SrcReg[j].Index < usedSize)
- used[inst->SrcReg[j].Index] = GL_TRUE;
- }
- }
- }
-}
-
-
-/**
- * Scan the given 'used' register flag array for the first entry
- * that's >= firstReg.
- * \param used vector of flags indicating registers in use (as returned
- * by _mesa_find_used_registers())
- * \param usedSize size of the 'used' array
- * \param firstReg first register to start searching at
- * \return index of unused register, or -1 if none.
- */
-GLint
-_mesa_find_free_register(const GLboolean used[],
- GLuint usedSize, GLuint firstReg)
-{
- GLuint i;
-
- assert(firstReg < usedSize);
-
- for (i = firstReg; i < usedSize; i++)
- if (!used[i])
- return i;
-
- return -1;
-}
-
-
-
-/**
- * Check if the given register index is valid (doesn't exceed implementation-
- * dependent limits).
- * \return GL_TRUE if OK, GL_FALSE if bad index
- */
-GLboolean
-_mesa_valid_register_index(const struct gl_context *ctx,
- gl_shader_type shaderType,
- gl_register_file file, GLint index)
-{
- const struct gl_program_constants *c;
-
- switch (shaderType) {
- case MESA_SHADER_VERTEX:
- c = &ctx->Const.VertexProgram;
- break;
- case MESA_SHADER_FRAGMENT:
- c = &ctx->Const.FragmentProgram;
- break;
- case MESA_SHADER_GEOMETRY:
- c = &ctx->Const.GeometryProgram;
- break;
- default:
- _mesa_problem(ctx,
- "unexpected shader type in _mesa_valid_register_index()");
- return GL_FALSE;
- }
-
- switch (file) {
- case PROGRAM_UNDEFINED:
- return GL_TRUE; /* XXX or maybe false? */
-
- case PROGRAM_TEMPORARY:
- return index >= 0 && index < c->MaxTemps;
-
- case PROGRAM_ENV_PARAM:
- return index >= 0 && index < c->MaxEnvParams;
-
- case PROGRAM_LOCAL_PARAM:
- return index >= 0 && index < c->MaxLocalParams;
-
- case PROGRAM_NAMED_PARAM:
- return index >= 0 && index < c->MaxParameters;
-
- case PROGRAM_UNIFORM:
- case PROGRAM_STATE_VAR:
- /* aka constant buffer */
- return index >= 0 && index < c->MaxUniformComponents / 4;
-
- case PROGRAM_CONSTANT:
- /* constant buffer w/ possible relative negative addressing */
- return (index > (int) c->MaxUniformComponents / -4 &&
- index < c->MaxUniformComponents / 4);
-
- case PROGRAM_INPUT:
- if (index < 0)
- return GL_FALSE;
-
- switch (shaderType) {
- case MESA_SHADER_VERTEX:
- return index < VERT_ATTRIB_GENERIC0 + c->MaxAttribs;
- case MESA_SHADER_FRAGMENT:
- return index < FRAG_ATTRIB_VAR0 + ctx->Const.MaxVarying;
- case MESA_SHADER_GEOMETRY:
- return index < GEOM_ATTRIB_VAR0 + ctx->Const.MaxVarying;
- default:
- return GL_FALSE;
- }
-
- case PROGRAM_OUTPUT:
- if (index < 0)
- return GL_FALSE;
-
- switch (shaderType) {
- case MESA_SHADER_VERTEX:
- return index < VERT_RESULT_VAR0 + ctx->Const.MaxVarying;
- case MESA_SHADER_FRAGMENT:
- return index < FRAG_RESULT_DATA0 + ctx->Const.MaxDrawBuffers;
- case MESA_SHADER_GEOMETRY:
- return index < GEOM_RESULT_VAR0 + ctx->Const.MaxVarying;
- default:
- return GL_FALSE;
- }
-
- case PROGRAM_ADDRESS:
- return index >= 0 && index < c->MaxAddressRegs;
-
- default:
- _mesa_problem(ctx,
- "unexpected register file in _mesa_valid_register_index()");
- return GL_FALSE;
- }
-}
-
-
-
-/**
- * "Post-process" a GPU program. This is intended to be used for debugging.
- * Example actions include no-op'ing instructions or changing instruction
- * behaviour.
- */
-void
-_mesa_postprocess_program(struct gl_context *ctx, struct gl_program *prog)
-{
- static const GLfloat white[4] = { 0.5, 0.5, 0.5, 0.5 };
- GLuint i;
- GLuint whiteSwizzle;
- GLint whiteIndex = _mesa_add_unnamed_constant(prog->Parameters,
- white, 4, &whiteSwizzle);
-
- (void) whiteIndex;
-
- for (i = 0; i < prog->NumInstructions; i++) {
- struct prog_instruction *inst = prog->Instructions + i;
- const GLuint n = _mesa_num_inst_src_regs(inst->Opcode);
-
- (void) n;
-
- if (_mesa_is_tex_instruction(inst->Opcode)) {
-#if 0
- /* replace TEX/TXP/TXB with MOV */
- inst->Opcode = OPCODE_MOV;
- inst->DstReg.WriteMask = WRITEMASK_XYZW;
- inst->SrcReg[0].Swizzle = SWIZZLE_XYZW;
- inst->SrcReg[0].Negate = NEGATE_NONE;
-#endif
-
-#if 0
- /* disable shadow texture mode */
- inst->TexShadow = 0;
-#endif
- }
-
- if (inst->Opcode == OPCODE_TXP) {
-#if 0
- inst->Opcode = OPCODE_MOV;
- inst->DstReg.WriteMask = WRITEMASK_XYZW;
- inst->SrcReg[0].File = PROGRAM_CONSTANT;
- inst->SrcReg[0].Index = whiteIndex;
- inst->SrcReg[0].Swizzle = SWIZZLE_XYZW;
- inst->SrcReg[0].Negate = NEGATE_NONE;
-#endif
-#if 0
- inst->TexShadow = 0;
-#endif
-#if 0
- inst->Opcode = OPCODE_TEX;
- inst->TexShadow = 0;
-#endif
- }
-
- }
-}
+/*
+ * Mesa 3-D graphics library
+ * Version: 6.5.3
+ *
+ * Copyright (C) 1999-2007 Brian Paul All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+/**
+ * \file program.c
+ * Vertex and fragment program support functions.
+ * \author Brian Paul
+ */
+
+
+#include "main/glheader.h"
+#include "main/context.h"
+#include "main/hash.h"
+#include "main/mfeatures.h"
+#include "program.h"
+#include "prog_cache.h"
+#include "prog_parameter.h"
+#include "prog_instruction.h"
+
+
+/**
+ * A pointer to this dummy program is put into the hash table when
+ * glGenPrograms is called.
+ */
+struct gl_program _mesa_DummyProgram;
+
+
+/**
+ * Init context's vertex/fragment program state
+ */
+void
+_mesa_init_program(struct gl_context *ctx)
+{
+ GLuint i;
+
+ /*
+ * If this assertion fails, we need to increase the field
+ * size for register indexes (see INST_INDEX_BITS).
+ */
+ ASSERT(ctx->Const.VertexProgram.MaxUniformComponents / 4
+ <= (1 << INST_INDEX_BITS));
+ ASSERT(ctx->Const.FragmentProgram.MaxUniformComponents / 4
+ <= (1 << INST_INDEX_BITS));
+
+ ASSERT(ctx->Const.VertexProgram.MaxTemps <= (1 << INST_INDEX_BITS));
+ ASSERT(ctx->Const.VertexProgram.MaxLocalParams <= (1 << INST_INDEX_BITS));
+ ASSERT(ctx->Const.FragmentProgram.MaxTemps <= (1 << INST_INDEX_BITS));
+ ASSERT(ctx->Const.FragmentProgram.MaxLocalParams <= (1 << INST_INDEX_BITS));
+
+ ASSERT(ctx->Const.VertexProgram.MaxUniformComponents <= 4 * MAX_UNIFORMS);
+ ASSERT(ctx->Const.FragmentProgram.MaxUniformComponents <= 4 * MAX_UNIFORMS);
+
+ ASSERT(ctx->Const.VertexProgram.MaxAddressOffset <= (1 << INST_INDEX_BITS));
+ ASSERT(ctx->Const.FragmentProgram.MaxAddressOffset <= (1 << INST_INDEX_BITS));
+
+ /* If this fails, increase prog_instruction::TexSrcUnit size */
+ ASSERT(MAX_TEXTURE_UNITS <= (1 << 5));
+
+ /* If this fails, increase prog_instruction::TexSrcTarget size */
+ ASSERT(NUM_TEXTURE_TARGETS <= (1 << 3));
+
+ ctx->Program.ErrorPos = -1;
+ ctx->Program.ErrorString = _mesa_strdup("");
+
+#if FEATURE_NV_vertex_program || FEATURE_ARB_vertex_program
+ ctx->VertexProgram.Enabled = GL_FALSE;
+#if FEATURE_es2_glsl
+ ctx->VertexProgram.PointSizeEnabled =
+ (ctx->API == API_OPENGLES2) ? GL_TRUE : GL_FALSE;
+#else
+ ctx->VertexProgram.PointSizeEnabled = GL_FALSE;
+#endif
+ ctx->VertexProgram.TwoSideEnabled = GL_FALSE;
+ _mesa_reference_vertprog(ctx, &ctx->VertexProgram.Current,
+ ctx->Shared->DefaultVertexProgram);
+ assert(ctx->VertexProgram.Current);
+ for (i = 0; i < MAX_NV_VERTEX_PROGRAM_PARAMS / 4; i++) {
+ ctx->VertexProgram.TrackMatrix[i] = GL_NONE;
+ ctx->VertexProgram.TrackMatrixTransform[i] = GL_IDENTITY_NV;
+ }
+ ctx->VertexProgram.Cache = _mesa_new_program_cache();
+#endif
+
+#if FEATURE_NV_fragment_program || FEATURE_ARB_fragment_program
+ ctx->FragmentProgram.Enabled = GL_FALSE;
+ _mesa_reference_fragprog(ctx, &ctx->FragmentProgram.Current,
+ ctx->Shared->DefaultFragmentProgram);
+ assert(ctx->FragmentProgram.Current);
+ ctx->FragmentProgram.Cache = _mesa_new_program_cache();
+#endif
+
+#if FEATURE_ARB_geometry_shader4
+ ctx->GeometryProgram.Enabled = GL_FALSE;
+ /* right now by default we don't have a geometry program */
+ _mesa_reference_geomprog(ctx, &ctx->GeometryProgram.Current,
+ NULL);
+ ctx->GeometryProgram.Cache = _mesa_new_program_cache();
+#endif
+
+ /* XXX probably move this stuff */
+#if FEATURE_ATI_fragment_shader
+ ctx->ATIFragmentShader.Enabled = GL_FALSE;
+ ctx->ATIFragmentShader.Current = ctx->Shared->DefaultFragmentShader;
+ assert(ctx->ATIFragmentShader.Current);
+ ctx->ATIFragmentShader.Current->RefCount++;
+#endif
+}
+
+
+/**
+ * Free a context's vertex/fragment program state
+ */
+void
+_mesa_free_program_data(struct gl_context *ctx)
+{
+#if FEATURE_NV_vertex_program || FEATURE_ARB_vertex_program
+ _mesa_reference_vertprog(ctx, &ctx->VertexProgram.Current, NULL);
+ _mesa_delete_program_cache(ctx, ctx->VertexProgram.Cache);
+#endif
+#if FEATURE_NV_fragment_program || FEATURE_ARB_fragment_program
+ _mesa_reference_fragprog(ctx, &ctx->FragmentProgram.Current, NULL);
+ _mesa_delete_program_cache(ctx, ctx->FragmentProgram.Cache);
+#endif
+#if FEATURE_ARB_geometry_shader4
+ _mesa_reference_geomprog(ctx, &ctx->GeometryProgram.Current, NULL);
+ _mesa_delete_program_cache(ctx, ctx->GeometryProgram.Cache);
+#endif
+ /* XXX probably move this stuff */
+#if FEATURE_ATI_fragment_shader
+ if (ctx->ATIFragmentShader.Current) {
+ ctx->ATIFragmentShader.Current->RefCount--;
+ if (ctx->ATIFragmentShader.Current->RefCount <= 0) {
+ free(ctx->ATIFragmentShader.Current);
+ }
+ }
+#endif
+ free((void *) ctx->Program.ErrorString);
+}
+
+
+/**
+ * Update the default program objects in the given context to reference those
+ * specified in the shared state and release those referencing the old
+ * shared state.
+ */
+void
+_mesa_update_default_objects_program(struct gl_context *ctx)
+{
+#if FEATURE_NV_vertex_program || FEATURE_ARB_vertex_program
+ _mesa_reference_vertprog(ctx, &ctx->VertexProgram.Current,
+ (struct gl_vertex_program *)
+ ctx->Shared->DefaultVertexProgram);
+ assert(ctx->VertexProgram.Current);
+#endif
+
+#if FEATURE_NV_fragment_program || FEATURE_ARB_fragment_program
+ _mesa_reference_fragprog(ctx, &ctx->FragmentProgram.Current,
+ (struct gl_fragment_program *)
+ ctx->Shared->DefaultFragmentProgram);
+ assert(ctx->FragmentProgram.Current);
+#endif
+
+#if FEATURE_ARB_geometry_shader4
+ _mesa_reference_geomprog(ctx, &ctx->GeometryProgram.Current,
+ (struct gl_geometry_program *)
+ ctx->Shared->DefaultGeometryProgram);
+#endif
+
+ /* XXX probably move this stuff */
+#if FEATURE_ATI_fragment_shader
+ if (ctx->ATIFragmentShader.Current) {
+ ctx->ATIFragmentShader.Current->RefCount--;
+ if (ctx->ATIFragmentShader.Current->RefCount <= 0) {
+ free(ctx->ATIFragmentShader.Current);
+ }
+ }
+ ctx->ATIFragmentShader.Current = (struct ati_fragment_shader *) ctx->Shared->DefaultFragmentShader;
+ assert(ctx->ATIFragmentShader.Current);
+ ctx->ATIFragmentShader.Current->RefCount++;
+#endif
+}
+
+
+/**
+ * Set the vertex/fragment program error state (position and error string).
+ * This is generally called from within the parsers.
+ */
+void
+_mesa_set_program_error(struct gl_context *ctx, GLint pos, const char *string)
+{
+ ctx->Program.ErrorPos = pos;
+ free((void *) ctx->Program.ErrorString);
+ if (!string)
+ string = "";
+ ctx->Program.ErrorString = _mesa_strdup(string);
+}
+
+
+/**
+ * Find the line number and column for 'pos' within 'string'.
+ * Return a copy of the line which contains 'pos'. Free the line with
+ * free().
+ * \param string the program string
+ * \param pos the position within the string
+ * \param line returns the line number corresponding to 'pos'.
+ * \param col returns the column number corresponding to 'pos'.
+ * \return copy of the line containing 'pos'.
+ */
+const GLubyte *
+_mesa_find_line_column(const GLubyte *string, const GLubyte *pos,
+ GLint *line, GLint *col)
+{
+ const GLubyte *lineStart = string;
+ const GLubyte *p = string;
+ GLubyte *s;
+ int len;
+
+ *line = 1;
+
+ while (p != pos) {
+ if (*p == (GLubyte) '\n') {
+ (*line)++;
+ lineStart = p + 1;
+ }
+ p++;
+ }
+
+ *col = (pos - lineStart) + 1;
+
+ /* return copy of this line */
+ while (*p != 0 && *p != '\n')
+ p++;
+ len = p - lineStart;
+ s = (GLubyte *) malloc(len + 1);
+ memcpy(s, lineStart, len);
+ s[len] = 0;
+
+ return s;
+}
+
+
+/**
+ * Initialize a new vertex/fragment program object.
+ */
+static struct gl_program *
+_mesa_init_program_struct( struct gl_context *ctx, struct gl_program *prog,
+ GLenum target, GLuint id)
+{
+ (void) ctx;
+ if (prog) {
+ GLuint i;
+ memset(prog, 0, sizeof(*prog));
+ prog->Id = id;
+ prog->Target = target;
+ prog->Resident = GL_TRUE;
+ prog->RefCount = 1;
+ prog->Format = GL_PROGRAM_FORMAT_ASCII_ARB;
+
+ /* default mapping from samplers to texture units */
+ for (i = 0; i < MAX_SAMPLERS; i++)
+ prog->SamplerUnits[i] = i;
+ }
+
+ return prog;
+}
+
+
+/**
+ * Initialize a new fragment program object.
+ */
+struct gl_program *
+_mesa_init_fragment_program( struct gl_context *ctx, struct gl_fragment_program *prog,
+ GLenum target, GLuint id)
+{
+ if (prog)
+ return _mesa_init_program_struct( ctx, &prog->Base, target, id );
+ else
+ return NULL;
+}
+
+
+/**
+ * Initialize a new vertex program object.
+ */
+struct gl_program *
+_mesa_init_vertex_program( struct gl_context *ctx, struct gl_vertex_program *prog,
+ GLenum target, GLuint id)
+{
+ if (prog)
+ return _mesa_init_program_struct( ctx, &prog->Base, target, id );
+ else
+ return NULL;
+}
+
+
+/**
+ * Initialize a new geometry program object.
+ */
+struct gl_program *
+_mesa_init_geometry_program( struct gl_context *ctx, struct gl_geometry_program *prog,
+ GLenum target, GLuint id)
+{
+ if (prog)
+ return _mesa_init_program_struct( ctx, &prog->Base, target, id );
+ else
+ return NULL;
+}
+
+
+/**
+ * Allocate and initialize a new fragment/vertex program object but
+ * don't put it into the program hash table. Called via
+ * ctx->Driver.NewProgram. May be overridden (ie. replaced) by a
+ * device driver function to implement OO deriviation with additional
+ * types not understood by this function.
+ *
+ * \param ctx context
+ * \param id program id/number
+ * \param target program target/type
+ * \return pointer to new program object
+ */
+struct gl_program *
+_mesa_new_program(struct gl_context *ctx, GLenum target, GLuint id)
+{
+ struct gl_program *prog;
+ switch (target) {
+ case GL_VERTEX_PROGRAM_ARB: /* == GL_VERTEX_PROGRAM_NV */
+ case GL_VERTEX_STATE_PROGRAM_NV:
+ prog = _mesa_init_vertex_program(ctx, CALLOC_STRUCT(gl_vertex_program),
+ target, id );
+ break;
+ case GL_FRAGMENT_PROGRAM_NV:
+ case GL_FRAGMENT_PROGRAM_ARB:
+ prog =_mesa_init_fragment_program(ctx,
+ CALLOC_STRUCT(gl_fragment_program),
+ target, id );
+ break;
+ case MESA_GEOMETRY_PROGRAM:
+ prog = _mesa_init_geometry_program(ctx,
+ CALLOC_STRUCT(gl_geometry_program),
+ target, id);
+ break;
+ default:
+ _mesa_problem(ctx, "bad target in _mesa_new_program");
+ prog = NULL;
+ }
+ return prog;
+}
+
+
+/**
+ * Delete a program and remove it from the hash table, ignoring the
+ * reference count.
+ * Called via ctx->Driver.DeleteProgram. May be wrapped (OO deriviation)
+ * by a device driver function.
+ */
+void
+_mesa_delete_program(struct gl_context *ctx, struct gl_program *prog)
+{
+ (void) ctx;
+ ASSERT(prog);
+ ASSERT(prog->RefCount==0);
+
+ if (prog == &_mesa_DummyProgram)
+ return;
+
+ if (prog->String)
+ free(prog->String);
+
+ _mesa_free_instructions(prog->Instructions, prog->NumInstructions);
+
+ if (prog->Parameters) {
+ _mesa_free_parameter_list(prog->Parameters);
+ }
+ if (prog->Varying) {
+ _mesa_free_parameter_list(prog->Varying);
+ }
+ if (prog->Attributes) {
+ _mesa_free_parameter_list(prog->Attributes);
+ }
+
+ free(prog);
+}
+
+
+/**
+ * Return the gl_program object for a given ID.
+ * Basically just a wrapper for _mesa_HashLookup() to avoid a lot of
+ * casts elsewhere.
+ */
+struct gl_program *
+_mesa_lookup_program(struct gl_context *ctx, GLuint id)
+{
+ if (id)
+ return (struct gl_program *) _mesa_HashLookup(ctx->Shared->Programs, id);
+ else
+ return NULL;
+}
+
+
+/**
+ * Reference counting for vertex/fragment programs
+ */
+void
+_mesa_reference_program(struct gl_context *ctx,
+ struct gl_program **ptr,
+ struct gl_program *prog)
+{
+ assert(ptr);
+ if (*ptr && prog) {
+ /* sanity check */
+ if ((*ptr)->Target == GL_VERTEX_PROGRAM_ARB)
+ ASSERT(prog->Target == GL_VERTEX_PROGRAM_ARB);
+ else if ((*ptr)->Target == GL_FRAGMENT_PROGRAM_ARB)
+ ASSERT(prog->Target == GL_FRAGMENT_PROGRAM_ARB ||
+ prog->Target == GL_FRAGMENT_PROGRAM_NV);
+ else if ((*ptr)->Target == MESA_GEOMETRY_PROGRAM)
+ ASSERT(prog->Target == MESA_GEOMETRY_PROGRAM);
+ }
+ if (*ptr == prog) {
+ return; /* no change */
+ }
+ if (*ptr) {
+ GLboolean deleteFlag;
+
+ /*_glthread_LOCK_MUTEX((*ptr)->Mutex);*/
+#if 0
+ printf("Program %p ID=%u Target=%s Refcount-- to %d\n",
+ *ptr, (*ptr)->Id,
+ ((*ptr)->Target == GL_VERTEX_PROGRAM_ARB ? "VP" :
+ ((*ptr)->Target == MESA_GEOMETRY_PROGRAM ? "GP" : "FP")),
+ (*ptr)->RefCount - 1);
+#endif
+ ASSERT((*ptr)->RefCount > 0);
+ (*ptr)->RefCount--;
+
+ deleteFlag = ((*ptr)->RefCount == 0);
+ /*_glthread_UNLOCK_MUTEX((*ptr)->Mutex);*/
+
+ if (deleteFlag) {
+ ASSERT(ctx);
+ ctx->Driver.DeleteProgram(ctx, *ptr);
+ }
+
+ *ptr = NULL;
+ }
+
+ assert(!*ptr);
+ if (prog) {
+ /*_glthread_LOCK_MUTEX(prog->Mutex);*/
+ prog->RefCount++;
+#if 0
+ printf("Program %p ID=%u Target=%s Refcount++ to %d\n",
+ prog, prog->Id,
+ (prog->Target == GL_VERTEX_PROGRAM_ARB ? "VP" :
+ (prog->Target == MESA_GEOMETRY_PROGRAM ? "GP" : "FP")),
+ prog->RefCount);
+#endif
+ /*_glthread_UNLOCK_MUTEX(prog->Mutex);*/
+ }
+
+ *ptr = prog;
+}
+
+
+/**
+ * Return a copy of a program.
+ * XXX Problem here if the program object is actually OO-derivation
+ * made by a device driver.
+ */
+struct gl_program *
+_mesa_clone_program(struct gl_context *ctx, const struct gl_program *prog)
+{
+ struct gl_program *clone;
+
+ clone = ctx->Driver.NewProgram(ctx, prog->Target, prog->Id);
+ if (!clone)
+ return NULL;
+
+ assert(clone->Target == prog->Target);
+ assert(clone->RefCount == 1);
+
+ clone->String = (GLubyte *) _mesa_strdup((char *) prog->String);
+ clone->Format = prog->Format;
+ clone->Instructions = _mesa_alloc_instructions(prog->NumInstructions);
+ if (!clone->Instructions) {
+ _mesa_reference_program(ctx, &clone, NULL);
+ return NULL;
+ }
+ _mesa_copy_instructions(clone->Instructions, prog->Instructions,
+ prog->NumInstructions);
+ clone->InputsRead = prog->InputsRead;
+ clone->OutputsWritten = prog->OutputsWritten;
+ clone->SamplersUsed = prog->SamplersUsed;
+ clone->ShadowSamplers = prog->ShadowSamplers;
+ memcpy(clone->TexturesUsed, prog->TexturesUsed, sizeof(prog->TexturesUsed));
+
+ if (prog->Parameters)
+ clone->Parameters = _mesa_clone_parameter_list(prog->Parameters);
+ memcpy(clone->LocalParams, prog->LocalParams, sizeof(clone->LocalParams));
+ if (prog->Varying)
+ clone->Varying = _mesa_clone_parameter_list(prog->Varying);
+ if (prog->Attributes)
+ clone->Attributes = _mesa_clone_parameter_list(prog->Attributes);
+ memcpy(clone->LocalParams, prog->LocalParams, sizeof(clone->LocalParams));
+ clone->IndirectRegisterFiles = prog->IndirectRegisterFiles;
+ clone->NumInstructions = prog->NumInstructions;
+ clone->NumTemporaries = prog->NumTemporaries;
+ clone->NumParameters = prog->NumParameters;
+ clone->NumAttributes = prog->NumAttributes;
+ clone->NumAddressRegs = prog->NumAddressRegs;
+ clone->NumNativeInstructions = prog->NumNativeInstructions;
+ clone->NumNativeTemporaries = prog->NumNativeTemporaries;
+ clone->NumNativeParameters = prog->NumNativeParameters;
+ clone->NumNativeAttributes = prog->NumNativeAttributes;
+ clone->NumNativeAddressRegs = prog->NumNativeAddressRegs;
+ clone->NumAluInstructions = prog->NumAluInstructions;
+ clone->NumTexInstructions = prog->NumTexInstructions;
+ clone->NumTexIndirections = prog->NumTexIndirections;
+ clone->NumNativeAluInstructions = prog->NumNativeAluInstructions;
+ clone->NumNativeTexInstructions = prog->NumNativeTexInstructions;
+ clone->NumNativeTexIndirections = prog->NumNativeTexIndirections;
+
+ switch (prog->Target) {
+ case GL_VERTEX_PROGRAM_ARB:
+ {
+ const struct gl_vertex_program *vp
+ = (const struct gl_vertex_program *) prog;
+ struct gl_vertex_program *vpc = (struct gl_vertex_program *) clone;
+ vpc->IsPositionInvariant = vp->IsPositionInvariant;
+ vpc->IsNVProgram = vp->IsNVProgram;
+ }
+ break;
+ case GL_FRAGMENT_PROGRAM_ARB:
+ {
+ const struct gl_fragment_program *fp
+ = (const struct gl_fragment_program *) prog;
+ struct gl_fragment_program *fpc = (struct gl_fragment_program *) clone;
+ fpc->UsesKill = fp->UsesKill;
+ fpc->OriginUpperLeft = fp->OriginUpperLeft;
+ fpc->PixelCenterInteger = fp->PixelCenterInteger;
+ }
+ break;
+ case MESA_GEOMETRY_PROGRAM:
+ {
+ const struct gl_geometry_program *gp
+ = (const struct gl_geometry_program *) prog;
+ struct gl_geometry_program *gpc = (struct gl_geometry_program *) clone;
+ gpc->VerticesOut = gp->VerticesOut;
+ gpc->InputType = gp->InputType;
+ gpc->OutputType = gp->OutputType;
+ }
+ break;
+ default:
+ _mesa_problem(NULL, "Unexpected target in _mesa_clone_program");
+ }
+
+ return clone;
+}
+
+
+/**
+ * Insert 'count' NOP instructions at 'start' in the given program.
+ * Adjust branch targets accordingly.
+ */
+GLboolean
+_mesa_insert_instructions(struct gl_program *prog, GLuint start, GLuint count)
+{
+ const GLuint origLen = prog->NumInstructions;
+ const GLuint newLen = origLen + count;
+ struct prog_instruction *newInst;
+ GLuint i;
+
+ /* adjust branches */
+ for (i = 0; i < prog->NumInstructions; i++) {
+ struct prog_instruction *inst = prog->Instructions + i;
+ if (inst->BranchTarget > 0) {
+ if ((GLuint)inst->BranchTarget >= start) {
+ inst->BranchTarget += count;
+ }
+ }
+ }
+
+ /* Alloc storage for new instructions */
+ newInst = _mesa_alloc_instructions(newLen);
+ if (!newInst) {
+ return GL_FALSE;
+ }
+
+ /* Copy 'start' instructions into new instruction buffer */
+ _mesa_copy_instructions(newInst, prog->Instructions, start);
+
+ /* init the new instructions */
+ _mesa_init_instructions(newInst + start, count);
+
+ /* Copy the remaining/tail instructions to new inst buffer */
+ _mesa_copy_instructions(newInst + start + count,
+ prog->Instructions + start,
+ origLen - start);
+
+ /* free old instructions */
+ _mesa_free_instructions(prog->Instructions, origLen);
+
+ /* install new instructions */
+ prog->Instructions = newInst;
+ prog->NumInstructions = newLen;
+
+ return GL_TRUE;
+}
+
+/**
+ * Delete 'count' instructions at 'start' in the given program.
+ * Adjust branch targets accordingly.
+ */
+GLboolean
+_mesa_delete_instructions(struct gl_program *prog, GLuint start, GLuint count)
+{
+ const GLuint origLen = prog->NumInstructions;
+ const GLuint newLen = origLen - count;
+ struct prog_instruction *newInst;
+ GLuint i;
+
+ /* adjust branches */
+ for (i = 0; i < prog->NumInstructions; i++) {
+ struct prog_instruction *inst = prog->Instructions + i;
+ if (inst->BranchTarget > 0) {
+ if (inst->BranchTarget > (GLint) start) {
+ inst->BranchTarget -= count;
+ }
+ }
+ }
+
+ /* Alloc storage for new instructions */
+ newInst = _mesa_alloc_instructions(newLen);
+ if (!newInst) {
+ return GL_FALSE;
+ }
+
+ /* Copy 'start' instructions into new instruction buffer */
+ _mesa_copy_instructions(newInst, prog->Instructions, start);
+
+ /* Copy the remaining/tail instructions to new inst buffer */
+ _mesa_copy_instructions(newInst + start,
+ prog->Instructions + start + count,
+ newLen - start);
+
+ /* free old instructions */
+ _mesa_free_instructions(prog->Instructions, origLen);
+
+ /* install new instructions */
+ prog->Instructions = newInst;
+ prog->NumInstructions = newLen;
+
+ return GL_TRUE;
+}
+
+
+/**
+ * Search instructions for registers that match (oldFile, oldIndex),
+ * replacing them with (newFile, newIndex).
+ */
+static void
+replace_registers(struct prog_instruction *inst, GLuint numInst,
+ GLuint oldFile, GLuint oldIndex,
+ GLuint newFile, GLuint newIndex)
+{
+ GLuint i, j;
+ for (i = 0; i < numInst; i++) {
+ /* src regs */
+ for (j = 0; j < _mesa_num_inst_src_regs(inst[i].Opcode); j++) {
+ if (inst[i].SrcReg[j].File == oldFile &&
+ inst[i].SrcReg[j].Index == oldIndex) {
+ inst[i].SrcReg[j].File = newFile;
+ inst[i].SrcReg[j].Index = newIndex;
+ }
+ }
+ /* dst reg */
+ if (inst[i].DstReg.File == oldFile && inst[i].DstReg.Index == oldIndex) {
+ inst[i].DstReg.File = newFile;
+ inst[i].DstReg.Index = newIndex;
+ }
+ }
+}
+
+
+/**
+ * Search instructions for references to program parameters. When found,
+ * increment the parameter index by 'offset'.
+ * Used when combining programs.
+ */
+static void
+adjust_param_indexes(struct prog_instruction *inst, GLuint numInst,
+ GLuint offset)
+{
+ GLuint i, j;
+ for (i = 0; i < numInst; i++) {
+ for (j = 0; j < _mesa_num_inst_src_regs(inst[i].Opcode); j++) {
+ GLuint f = inst[i].SrcReg[j].File;
+ if (f == PROGRAM_CONSTANT ||
+ f == PROGRAM_UNIFORM ||
+ f == PROGRAM_STATE_VAR) {
+ inst[i].SrcReg[j].Index += offset;
+ }
+ }
+ }
+}
+
+
+/**
+ * Combine two programs into one. Fix instructions so the outputs of
+ * the first program go to the inputs of the second program.
+ */
+struct gl_program *
+_mesa_combine_programs(struct gl_context *ctx,
+ const struct gl_program *progA,
+ const struct gl_program *progB)
+{
+ struct prog_instruction *newInst;
+ struct gl_program *newProg;
+ const GLuint lenA = progA->NumInstructions - 1; /* omit END instr */
+ const GLuint lenB = progB->NumInstructions;
+ const GLuint numParamsA = _mesa_num_parameters(progA->Parameters);
+ const GLuint newLength = lenA + lenB;
+ GLboolean usedTemps[MAX_PROGRAM_TEMPS];
+ GLuint firstTemp = 0;
+ GLbitfield inputsB;
+ GLuint i;
+
+ ASSERT(progA->Target == progB->Target);
+
+ newInst = _mesa_alloc_instructions(newLength);
+ if (!newInst)
+ return GL_FALSE;
+
+ _mesa_copy_instructions(newInst, progA->Instructions, lenA);
+ _mesa_copy_instructions(newInst + lenA, progB->Instructions, lenB);
+
+ /* adjust branch / instruction addresses for B's instructions */
+ for (i = 0; i < lenB; i++) {
+ newInst[lenA + i].BranchTarget += lenA;
+ }
+
+ newProg = ctx->Driver.NewProgram(ctx, progA->Target, 0);
+ newProg->Instructions = newInst;
+ newProg->NumInstructions = newLength;
+
+ /* find used temp regs (we may need new temps below) */
+ _mesa_find_used_registers(newProg, PROGRAM_TEMPORARY,
+ usedTemps, MAX_PROGRAM_TEMPS);
+
+ if (newProg->Target == GL_FRAGMENT_PROGRAM_ARB) {
+ struct gl_fragment_program *fprogA, *fprogB, *newFprog;
+ GLbitfield progB_inputsRead = progB->InputsRead;
+ GLint progB_colorFile, progB_colorIndex;
+
+ fprogA = (struct gl_fragment_program *) progA;
+ fprogB = (struct gl_fragment_program *) progB;
+ newFprog = (struct gl_fragment_program *) newProg;
+
+ newFprog->UsesKill = fprogA->UsesKill || fprogB->UsesKill;
+
+ /* We'll do a search and replace for instances
+ * of progB_colorFile/progB_colorIndex below...
+ */
+ progB_colorFile = PROGRAM_INPUT;
+ progB_colorIndex = FRAG_ATTRIB_COL0;
+
+ /*
+ * The fragment program may get color from a state var rather than
+ * a fragment input (vertex output) if it's constant.
+ * See the texenvprogram.c code.
+ * So, search the program's parameter list now to see if the program
+ * gets color from a state var instead of a conventional fragment
+ * input register.
+ */
+ for (i = 0; i < progB->Parameters->NumParameters; i++) {
+ struct gl_program_parameter *p = &progB->Parameters->Parameters[i];
+ if (p->Type == PROGRAM_STATE_VAR &&
+ p->StateIndexes[0] == STATE_INTERNAL &&
+ p->StateIndexes[1] == STATE_CURRENT_ATTRIB &&
+ (int) p->StateIndexes[2] == (int) VERT_ATTRIB_COLOR0) {
+ progB_inputsRead |= FRAG_BIT_COL0;
+ progB_colorFile = PROGRAM_STATE_VAR;
+ progB_colorIndex = i;
+ break;
+ }
+ }
+
+ /* Connect color outputs of fprogA to color inputs of fprogB, via a
+ * new temporary register.
+ */
+ if ((progA->OutputsWritten & BITFIELD64_BIT(FRAG_RESULT_COLOR)) &&
+ (progB_inputsRead & FRAG_BIT_COL0)) {
+ GLint tempReg = _mesa_find_free_register(usedTemps, MAX_PROGRAM_TEMPS,
+ firstTemp);
+ if (tempReg < 0) {
+ _mesa_problem(ctx, "No free temp regs found in "
+ "_mesa_combine_programs(), using 31");
+ tempReg = 31;
+ }
+ firstTemp = tempReg + 1;
+
+ /* replace writes to result.color[0] with tempReg */
+ replace_registers(newInst, lenA,
+ PROGRAM_OUTPUT, FRAG_RESULT_COLOR,
+ PROGRAM_TEMPORARY, tempReg);
+ /* replace reads from the input color with tempReg */
+ replace_registers(newInst + lenA, lenB,
+ progB_colorFile, progB_colorIndex, /* search for */
+ PROGRAM_TEMPORARY, tempReg /* replace with */ );
+ }
+
+ /* compute combined program's InputsRead */
+ inputsB = progB_inputsRead;
+ if (progA->OutputsWritten & BITFIELD64_BIT(FRAG_RESULT_COLOR)) {
+ inputsB &= ~(1 << FRAG_ATTRIB_COL0);
+ }
+ newProg->InputsRead = progA->InputsRead | inputsB;
+ newProg->OutputsWritten = progB->OutputsWritten;
+ newProg->SamplersUsed = progA->SamplersUsed | progB->SamplersUsed;
+ }
+ else {
+ /* vertex program */
+ assert(0); /* XXX todo */
+ }
+
+ /*
+ * Merge parameters (uniforms, constants, etc)
+ */
+ newProg->Parameters = _mesa_combine_parameter_lists(progA->Parameters,
+ progB->Parameters);
+
+ adjust_param_indexes(newInst + lenA, lenB, numParamsA);
+
+
+ return newProg;
+}
+
+
+/**
+ * Populate the 'used' array with flags indicating which registers (TEMPs,
+ * INPUTs, OUTPUTs, etc, are used by the given program.
+ * \param file type of register to scan for
+ * \param used returns true/false flags for in use / free
+ * \param usedSize size of the 'used' array
+ */
+void
+_mesa_find_used_registers(const struct gl_program *prog,
+ gl_register_file file,
+ GLboolean used[], GLuint usedSize)
+{
+ GLuint i, j;
+
+ memset(used, 0, usedSize);
+
+ for (i = 0; i < prog->NumInstructions; i++) {
+ const struct prog_instruction *inst = prog->Instructions + i;
+ const GLuint n = _mesa_num_inst_src_regs(inst->Opcode);
+
+ if (inst->DstReg.File == file) {
+ ASSERT(inst->DstReg.Index < usedSize);
+ if(inst->DstReg.Index < usedSize)
+ used[inst->DstReg.Index] = GL_TRUE;
+ }
+
+ for (j = 0; j < n; j++) {
+ if (inst->SrcReg[j].File == file) {
+ ASSERT(inst->SrcReg[j].Index < usedSize);
+ if(inst->SrcReg[j].Index < usedSize)
+ used[inst->SrcReg[j].Index] = GL_TRUE;
+ }
+ }
+ }
+}
+
+
+/**
+ * Scan the given 'used' register flag array for the first entry
+ * that's >= firstReg.
+ * \param used vector of flags indicating registers in use (as returned
+ * by _mesa_find_used_registers())
+ * \param usedSize size of the 'used' array
+ * \param firstReg first register to start searching at
+ * \return index of unused register, or -1 if none.
+ */
+GLint
+_mesa_find_free_register(const GLboolean used[],
+ GLuint usedSize, GLuint firstReg)
+{
+ GLuint i;
+
+ assert(firstReg < usedSize);
+
+ for (i = firstReg; i < usedSize; i++)
+ if (!used[i])
+ return i;
+
+ return -1;
+}
+
+
+
+/**
+ * Check if the given register index is valid (doesn't exceed implementation-
+ * dependent limits).
+ * \return GL_TRUE if OK, GL_FALSE if bad index
+ */
+GLboolean
+_mesa_valid_register_index(const struct gl_context *ctx,
+ gl_shader_type shaderType,
+ gl_register_file file, GLint index)
+{
+ const struct gl_program_constants *c;
+
+ switch (shaderType) {
+ case MESA_SHADER_VERTEX:
+ c = &ctx->Const.VertexProgram;
+ break;
+ case MESA_SHADER_FRAGMENT:
+ c = &ctx->Const.FragmentProgram;
+ break;
+ case MESA_SHADER_GEOMETRY:
+ c = &ctx->Const.GeometryProgram;
+ break;
+ default:
+ _mesa_problem(ctx,
+ "unexpected shader type in _mesa_valid_register_index()");
+ return GL_FALSE;
+ }
+
+ switch (file) {
+ case PROGRAM_UNDEFINED:
+ return GL_TRUE; /* XXX or maybe false? */
+
+ case PROGRAM_TEMPORARY:
+ return index >= 0 && index < c->MaxTemps;
+
+ case PROGRAM_ENV_PARAM:
+ return index >= 0 && index < c->MaxEnvParams;
+
+ case PROGRAM_LOCAL_PARAM:
+ return index >= 0 && index < c->MaxLocalParams;
+
+ case PROGRAM_NAMED_PARAM:
+ return index >= 0 && index < c->MaxParameters;
+
+ case PROGRAM_UNIFORM:
+ case PROGRAM_STATE_VAR:
+ /* aka constant buffer */
+ return index >= 0 && index < c->MaxUniformComponents / 4;
+
+ case PROGRAM_CONSTANT:
+ /* constant buffer w/ possible relative negative addressing */
+ return (index > (int) c->MaxUniformComponents / -4 &&
+ index < c->MaxUniformComponents / 4);
+
+ case PROGRAM_INPUT:
+ if (index < 0)
+ return GL_FALSE;
+
+ switch (shaderType) {
+ case MESA_SHADER_VERTEX:
+ return index < VERT_ATTRIB_GENERIC0 + c->MaxAttribs;
+ case MESA_SHADER_FRAGMENT:
+ return index < FRAG_ATTRIB_VAR0 + ctx->Const.MaxVarying;
+ case MESA_SHADER_GEOMETRY:
+ return index < GEOM_ATTRIB_VAR0 + ctx->Const.MaxVarying;
+ default:
+ return GL_FALSE;
+ }
+
+ case PROGRAM_OUTPUT:
+ if (index < 0)
+ return GL_FALSE;
+
+ switch (shaderType) {
+ case MESA_SHADER_VERTEX:
+ return index < VERT_RESULT_VAR0 + ctx->Const.MaxVarying;
+ case MESA_SHADER_FRAGMENT:
+ return index < FRAG_RESULT_DATA0 + ctx->Const.MaxDrawBuffers;
+ case MESA_SHADER_GEOMETRY:
+ return index < GEOM_RESULT_VAR0 + ctx->Const.MaxVarying;
+ default:
+ return GL_FALSE;
+ }
+
+ case PROGRAM_ADDRESS:
+ return index >= 0 && index < c->MaxAddressRegs;
+
+ default:
+ _mesa_problem(ctx,
+ "unexpected register file in _mesa_valid_register_index()");
+ return GL_FALSE;
+ }
+}
+
+
+
+/**
+ * "Post-process" a GPU program. This is intended to be used for debugging.
+ * Example actions include no-op'ing instructions or changing instruction
+ * behaviour.
+ */
+void
+_mesa_postprocess_program(struct gl_context *ctx, struct gl_program *prog)
+{
+ static const GLfloat white[4] = { 0.5, 0.5, 0.5, 0.5 };
+ GLuint i;
+ GLuint whiteSwizzle;
+ GLint whiteIndex = _mesa_add_unnamed_constant(prog->Parameters,
+ white, 4, &whiteSwizzle);
+
+ (void) whiteIndex;
+
+ for (i = 0; i < prog->NumInstructions; i++) {
+ struct prog_instruction *inst = prog->Instructions + i;
+ const GLuint n = _mesa_num_inst_src_regs(inst->Opcode);
+
+ (void) n;
+
+ if (_mesa_is_tex_instruction(inst->Opcode)) {
+#if 0
+ /* replace TEX/TXP/TXB with MOV */
+ inst->Opcode = OPCODE_MOV;
+ inst->DstReg.WriteMask = WRITEMASK_XYZW;
+ inst->SrcReg[0].Swizzle = SWIZZLE_XYZW;
+ inst->SrcReg[0].Negate = NEGATE_NONE;
+#endif
+
+#if 0
+ /* disable shadow texture mode */
+ inst->TexShadow = 0;
+#endif
+ }
+
+ if (inst->Opcode == OPCODE_TXP) {
+#if 0
+ inst->Opcode = OPCODE_MOV;
+ inst->DstReg.WriteMask = WRITEMASK_XYZW;
+ inst->SrcReg[0].File = PROGRAM_CONSTANT;
+ inst->SrcReg[0].Index = whiteIndex;
+ inst->SrcReg[0].Swizzle = SWIZZLE_XYZW;
+ inst->SrcReg[0].Negate = NEGATE_NONE;
+#endif
+#if 0
+ inst->TexShadow = 0;
+#endif
+#if 0
+ inst->Opcode = OPCODE_TEX;
+ inst->TexShadow = 0;
+#endif
+ }
+
+ }
+}
diff --git a/mesalib/src/mesa/program/program_parse.y b/mesalib/src/mesa/program/program_parse.y
index dbf5abaa6..e7752fcbd 100644
--- a/mesalib/src/mesa/program/program_parse.y
+++ b/mesalib/src/mesa/program/program_parse.y
@@ -1,2806 +1,2806 @@
-%{
-/*
- * Copyright © 2009 Intel Corporation
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "main/mtypes.h"
-#include "main/imports.h"
-#include "program/program.h"
-#include "program/prog_parameter.h"
-#include "program/prog_parameter_layout.h"
-#include "program/prog_statevars.h"
-#include "program/prog_instruction.h"
-
-#include "program/symbol_table.h"
-#include "program/program_parser.h"
-
-extern void *yy_scan_string(char *);
-extern void yy_delete_buffer(void *);
-
-static struct asm_symbol *declare_variable(struct asm_parser_state *state,
- char *name, enum asm_type t, struct YYLTYPE *locp);
-
-static int add_state_reference(struct gl_program_parameter_list *param_list,
- const gl_state_index tokens[STATE_LENGTH]);
-
-static int initialize_symbol_from_state(struct gl_program *prog,
- struct asm_symbol *param_var, const gl_state_index tokens[STATE_LENGTH]);
-
-static int initialize_symbol_from_param(struct gl_program *prog,
- struct asm_symbol *param_var, const gl_state_index tokens[STATE_LENGTH]);
-
-static int initialize_symbol_from_const(struct gl_program *prog,
- struct asm_symbol *param_var, const struct asm_vector *vec,
- GLboolean allowSwizzle);
-
-static int yyparse(struct asm_parser_state *state);
-
-static char *make_error_string(const char *fmt, ...);
-
-static void yyerror(struct YYLTYPE *locp, struct asm_parser_state *state,
- const char *s);
-
-static int validate_inputs(struct YYLTYPE *locp,
- struct asm_parser_state *state);
-
-static void init_dst_reg(struct prog_dst_register *r);
-
-static void set_dst_reg(struct prog_dst_register *r,
- gl_register_file file, GLint index);
-
-static void init_src_reg(struct asm_src_register *r);
-
-static void set_src_reg(struct asm_src_register *r,
- gl_register_file file, GLint index);
-
-static void set_src_reg_swz(struct asm_src_register *r,
- gl_register_file file, GLint index, GLuint swizzle);
-
-static void asm_instruction_set_operands(struct asm_instruction *inst,
- const struct prog_dst_register *dst, const struct asm_src_register *src0,
- const struct asm_src_register *src1, const struct asm_src_register *src2);
-
-static struct asm_instruction *asm_instruction_ctor(gl_inst_opcode op,
- const struct prog_dst_register *dst, const struct asm_src_register *src0,
- const struct asm_src_register *src1, const struct asm_src_register *src2);
-
-static struct asm_instruction *asm_instruction_copy_ctor(
- const struct prog_instruction *base, const struct prog_dst_register *dst,
- const struct asm_src_register *src0, const struct asm_src_register *src1,
- const struct asm_src_register *src2);
-
-#ifndef FALSE
-#define FALSE 0
-#define TRUE (!FALSE)
-#endif
-
-#define YYLLOC_DEFAULT(Current, Rhs, N) \
- do { \
- if (YYID(N)) { \
- (Current).first_line = YYRHSLOC(Rhs, 1).first_line; \
- (Current).first_column = YYRHSLOC(Rhs, 1).first_column; \
- (Current).position = YYRHSLOC(Rhs, 1).position; \
- (Current).last_line = YYRHSLOC(Rhs, N).last_line; \
- (Current).last_column = YYRHSLOC(Rhs, N).last_column; \
- } else { \
- (Current).first_line = YYRHSLOC(Rhs, 0).last_line; \
- (Current).last_line = (Current).first_line; \
- (Current).first_column = YYRHSLOC(Rhs, 0).last_column; \
- (Current).last_column = (Current).first_column; \
- (Current).position = YYRHSLOC(Rhs, 0).position \
- + (Current).first_column; \
- } \
- } while(YYID(0))
-
-#define YYLEX_PARAM state->scanner
-%}
-
-%pure-parser
-%locations
-%parse-param { struct asm_parser_state *state }
-%error-verbose
-%lex-param { void *scanner }
-
-%union {
- struct asm_instruction *inst;
- struct asm_symbol *sym;
- struct asm_symbol temp_sym;
- struct asm_swizzle_mask swiz_mask;
- struct asm_src_register src_reg;
- struct prog_dst_register dst_reg;
- struct prog_instruction temp_inst;
- char *string;
- unsigned result;
- unsigned attrib;
- int integer;
- float real;
- gl_state_index state[STATE_LENGTH];
- int negate;
- struct asm_vector vector;
- gl_inst_opcode opcode;
-
- struct {
- unsigned swz;
- unsigned rgba_valid:1;
- unsigned xyzw_valid:1;
- unsigned negate:1;
- } ext_swizzle;
-}
-
-%token ARBvp_10 ARBfp_10
-
-/* Tokens for assembler pseudo-ops */
-%token <integer> ADDRESS
-%token ALIAS ATTRIB
-%token OPTION OUTPUT
-%token PARAM
-%token <integer> TEMP
-%token END
-
- /* Tokens for instructions */
-%token <temp_inst> BIN_OP BINSC_OP SAMPLE_OP SCALAR_OP TRI_OP VECTOR_OP
-%token <temp_inst> ARL KIL SWZ TXD_OP
-
-%token <integer> INTEGER
-%token <real> REAL
-
-%token AMBIENT ATTENUATION
-%token BACK
-%token CLIP COLOR
-%token DEPTH DIFFUSE DIRECTION
-%token EMISSION ENV EYE
-%token FOG FOGCOORD FRAGMENT FRONT
-%token HALF
-%token INVERSE INVTRANS
-%token LIGHT LIGHTMODEL LIGHTPROD LOCAL
-%token MATERIAL MAT_PROGRAM MATRIX MATRIXINDEX MODELVIEW MVP
-%token NORMAL
-%token OBJECT
-%token PALETTE PARAMS PLANE POINT_TOK POINTSIZE POSITION PRIMARY PROGRAM PROJECTION
-%token RANGE RESULT ROW
-%token SCENECOLOR SECONDARY SHININESS SIZE_TOK SPECULAR SPOT STATE
-%token TEXCOORD TEXENV TEXGEN TEXGEN_Q TEXGEN_R TEXGEN_S TEXGEN_T TEXTURE TRANSPOSE
-%token TEXTURE_UNIT TEX_1D TEX_2D TEX_3D TEX_CUBE TEX_RECT
-%token TEX_SHADOW1D TEX_SHADOW2D TEX_SHADOWRECT
-%token TEX_ARRAY1D TEX_ARRAY2D TEX_ARRAYSHADOW1D TEX_ARRAYSHADOW2D
-%token VERTEX VTXATTRIB
-%token WEIGHT
-
-%token <string> IDENTIFIER USED_IDENTIFIER
-%type <string> string
-%token <swiz_mask> MASK4 MASK3 MASK2 MASK1 SWIZZLE
-%token DOT_DOT
-%token DOT
-
-%type <inst> instruction ALU_instruction TexInstruction
-%type <inst> ARL_instruction VECTORop_instruction
-%type <inst> SCALARop_instruction BINSCop_instruction BINop_instruction
-%type <inst> TRIop_instruction TXD_instruction SWZ_instruction SAMPLE_instruction
-%type <inst> KIL_instruction
-
-%type <dst_reg> dstReg maskedDstReg maskedAddrReg
-%type <src_reg> srcReg scalarUse scalarSrcReg swizzleSrcReg
-%type <swiz_mask> scalarSuffix swizzleSuffix extendedSwizzle
-%type <ext_swizzle> extSwizComp extSwizSel
-%type <swiz_mask> optionalMask
-
-%type <sym> progParamArray
-%type <integer> addrRegRelOffset addrRegPosOffset addrRegNegOffset
-%type <src_reg> progParamArrayMem progParamArrayAbs progParamArrayRel
-%type <sym> addrReg
-%type <swiz_mask> addrComponent addrWriteMask
-
-%type <dst_reg> ccMaskRule ccTest ccMaskRule2 ccTest2 optionalCcMask
-
-%type <result> resultBinding resultColBinding
-%type <integer> optFaceType optColorType
-%type <integer> optResultFaceType optResultColorType
-
-%type <integer> optTexImageUnitNum texImageUnitNum
-%type <integer> optTexCoordUnitNum texCoordUnitNum
-%type <integer> optLegacyTexUnitNum legacyTexUnitNum
-%type <integer> texImageUnit texTarget
-%type <integer> vtxAttribNum
-
-%type <attrib> attribBinding vtxAttribItem fragAttribItem
-
-%type <temp_sym> paramSingleInit paramSingleItemDecl
-%type <integer> optArraySize
-
-%type <state> stateSingleItem stateMultipleItem
-%type <state> stateMaterialItem
-%type <state> stateLightItem stateLightModelItem stateLightProdItem
-%type <state> stateTexGenItem stateFogItem stateClipPlaneItem statePointItem
-%type <state> stateMatrixItem stateMatrixRow stateMatrixRows
-%type <state> stateTexEnvItem stateDepthItem
-
-%type <state> stateLModProperty
-%type <state> stateMatrixName optMatrixRows
-
-%type <integer> stateMatProperty
-%type <integer> stateLightProperty stateSpotProperty
-%type <integer> stateLightNumber stateLProdProperty
-%type <integer> stateTexGenType stateTexGenCoord
-%type <integer> stateTexEnvProperty
-%type <integer> stateFogProperty
-%type <integer> stateClipPlaneNum
-%type <integer> statePointProperty
-
-%type <integer> stateOptMatModifier stateMatModifier stateMatrixRowNum
-%type <integer> stateOptModMatNum stateModMatNum statePaletteMatNum
-%type <integer> stateProgramMatNum
-
-%type <integer> ambDiffSpecProperty
-
-%type <state> programSingleItem progEnvParam progLocalParam
-%type <state> programMultipleItem progEnvParams progLocalParams
-
-%type <temp_sym> paramMultipleInit paramMultInitList paramMultipleItem
-%type <temp_sym> paramSingleItemUse
-
-%type <integer> progEnvParamNum progLocalParamNum
-%type <state> progEnvParamNums progLocalParamNums
-
-%type <vector> paramConstDecl paramConstUse
-%type <vector> paramConstScalarDecl paramConstScalarUse paramConstVector
-%type <real> signedFloatConstant
-%type <negate> optionalSign
-
-%{
-extern int yylex(YYSTYPE *yylval_param, YYLTYPE *yylloc_param,
- void *yyscanner);
-%}
-
-%%
-
-program: language optionSequence statementSequence END
- ;
-
-language: ARBvp_10
- {
- if (state->prog->Target != GL_VERTEX_PROGRAM_ARB) {
- yyerror(& @1, state, "invalid fragment program header");
-
- }
- state->mode = ARB_vertex;
- }
- | ARBfp_10
- {
- if (state->prog->Target != GL_FRAGMENT_PROGRAM_ARB) {
- yyerror(& @1, state, "invalid vertex program header");
- }
- state->mode = ARB_fragment;
-
- state->option.TexRect =
- (state->ctx->Extensions.NV_texture_rectangle != GL_FALSE);
- }
- ;
-
-optionSequence: optionSequence option
- |
- ;
-
-option: OPTION string ';'
- {
- int valid = 0;
-
- if (state->mode == ARB_vertex) {
- valid = _mesa_ARBvp_parse_option(state, $2);
- } else if (state->mode == ARB_fragment) {
- valid = _mesa_ARBfp_parse_option(state, $2);
- }
-
-
- free($2);
-
- if (!valid) {
- const char *const err_str = (state->mode == ARB_vertex)
- ? "invalid ARB vertex program option"
- : "invalid ARB fragment program option";
-
- yyerror(& @2, state, err_str);
- YYERROR;
- }
- }
- ;
-
-statementSequence: statementSequence statement
- |
- ;
-
-statement: instruction ';'
- {
- if ($1 != NULL) {
- if (state->inst_tail == NULL) {
- state->inst_head = $1;
- } else {
- state->inst_tail->next = $1;
- }
-
- state->inst_tail = $1;
- $1->next = NULL;
-
- state->prog->NumInstructions++;
- }
- }
- | namingStatement ';'
- ;
-
-instruction: ALU_instruction
- {
- $$ = $1;
- state->prog->NumAluInstructions++;
- }
- | TexInstruction
- {
- $$ = $1;
- state->prog->NumTexInstructions++;
- }
- ;
-
-ALU_instruction: ARL_instruction
- | VECTORop_instruction
- | SCALARop_instruction
- | BINSCop_instruction
- | BINop_instruction
- | TRIop_instruction
- | SWZ_instruction
- ;
-
-TexInstruction: SAMPLE_instruction
- | KIL_instruction
- | TXD_instruction
- ;
-
-ARL_instruction: ARL maskedAddrReg ',' scalarSrcReg
- {
- $$ = asm_instruction_ctor(OPCODE_ARL, & $2, & $4, NULL, NULL);
- }
- ;
-
-VECTORop_instruction: VECTOR_OP maskedDstReg ',' swizzleSrcReg
- {
- $$ = asm_instruction_copy_ctor(& $1, & $2, & $4, NULL, NULL);
- }
- ;
-
-SCALARop_instruction: SCALAR_OP maskedDstReg ',' scalarSrcReg
- {
- $$ = asm_instruction_copy_ctor(& $1, & $2, & $4, NULL, NULL);
- }
- ;
-
-BINSCop_instruction: BINSC_OP maskedDstReg ',' scalarSrcReg ',' scalarSrcReg
- {
- $$ = asm_instruction_copy_ctor(& $1, & $2, & $4, & $6, NULL);
- }
- ;
-
-
-BINop_instruction: BIN_OP maskedDstReg ',' swizzleSrcReg ',' swizzleSrcReg
- {
- $$ = asm_instruction_copy_ctor(& $1, & $2, & $4, & $6, NULL);
- }
- ;
-
-TRIop_instruction: TRI_OP maskedDstReg ','
- swizzleSrcReg ',' swizzleSrcReg ',' swizzleSrcReg
- {
- $$ = asm_instruction_copy_ctor(& $1, & $2, & $4, & $6, & $8);
- }
- ;
-
-SAMPLE_instruction: SAMPLE_OP maskedDstReg ',' swizzleSrcReg ',' texImageUnit ',' texTarget
- {
- $$ = asm_instruction_copy_ctor(& $1, & $2, & $4, NULL, NULL);
- if ($$ != NULL) {
- const GLbitfield tex_mask = (1U << $6);
- GLbitfield shadow_tex = 0;
- GLbitfield target_mask = 0;
-
-
- $$->Base.TexSrcUnit = $6;
-
- if ($8 < 0) {
- shadow_tex = tex_mask;
-
- $$->Base.TexSrcTarget = -$8;
- $$->Base.TexShadow = 1;
- } else {
- $$->Base.TexSrcTarget = $8;
- }
-
- target_mask = (1U << $$->Base.TexSrcTarget);
-
- /* If this texture unit was previously accessed and that access
- * had a different texture target, generate an error.
- *
- * If this texture unit was previously accessed and that access
- * had a different shadow mode, generate an error.
- */
- if ((state->prog->TexturesUsed[$6] != 0)
- && ((state->prog->TexturesUsed[$6] != target_mask)
- || ((state->prog->ShadowSamplers & tex_mask)
- != shadow_tex))) {
- yyerror(& @8, state,
- "multiple targets used on one texture image unit");
- YYERROR;
- }
-
-
- state->prog->TexturesUsed[$6] |= target_mask;
- state->prog->ShadowSamplers |= shadow_tex;
- }
- }
- ;
-
-KIL_instruction: KIL swizzleSrcReg
- {
- $$ = asm_instruction_ctor(OPCODE_KIL, NULL, & $2, NULL, NULL);
- state->fragment.UsesKill = 1;
- }
- | KIL ccTest
- {
- $$ = asm_instruction_ctor(OPCODE_KIL_NV, NULL, NULL, NULL, NULL);
- $$->Base.DstReg.CondMask = $2.CondMask;
- $$->Base.DstReg.CondSwizzle = $2.CondSwizzle;
- $$->Base.DstReg.CondSrc = $2.CondSrc;
- state->fragment.UsesKill = 1;
- }
- ;
-
-TXD_instruction: TXD_OP maskedDstReg ',' swizzleSrcReg ',' swizzleSrcReg ',' swizzleSrcReg ',' texImageUnit ',' texTarget
- {
- $$ = asm_instruction_copy_ctor(& $1, & $2, & $4, & $6, & $8);
- if ($$ != NULL) {
- const GLbitfield tex_mask = (1U << $10);
- GLbitfield shadow_tex = 0;
- GLbitfield target_mask = 0;
-
-
- $$->Base.TexSrcUnit = $10;
-
- if ($12 < 0) {
- shadow_tex = tex_mask;
-
- $$->Base.TexSrcTarget = -$12;
- $$->Base.TexShadow = 1;
- } else {
- $$->Base.TexSrcTarget = $12;
- }
-
- target_mask = (1U << $$->Base.TexSrcTarget);
-
- /* If this texture unit was previously accessed and that access
- * had a different texture target, generate an error.
- *
- * If this texture unit was previously accessed and that access
- * had a different shadow mode, generate an error.
- */
- if ((state->prog->TexturesUsed[$10] != 0)
- && ((state->prog->TexturesUsed[$10] != target_mask)
- || ((state->prog->ShadowSamplers & tex_mask)
- != shadow_tex))) {
- yyerror(& @12, state,
- "multiple targets used on one texture image unit");
- YYERROR;
- }
-
-
- state->prog->TexturesUsed[$10] |= target_mask;
- state->prog->ShadowSamplers |= shadow_tex;
- }
- }
- ;
-
-texImageUnit: TEXTURE_UNIT optTexImageUnitNum
- {
- $$ = $2;
- }
- ;
-
-texTarget: TEX_1D { $$ = TEXTURE_1D_INDEX; }
- | TEX_2D { $$ = TEXTURE_2D_INDEX; }
- | TEX_3D { $$ = TEXTURE_3D_INDEX; }
- | TEX_CUBE { $$ = TEXTURE_CUBE_INDEX; }
- | TEX_RECT { $$ = TEXTURE_RECT_INDEX; }
- | TEX_SHADOW1D { $$ = -TEXTURE_1D_INDEX; }
- | TEX_SHADOW2D { $$ = -TEXTURE_2D_INDEX; }
- | TEX_SHADOWRECT { $$ = -TEXTURE_RECT_INDEX; }
- | TEX_ARRAY1D { $$ = TEXTURE_1D_ARRAY_INDEX; }
- | TEX_ARRAY2D { $$ = TEXTURE_2D_ARRAY_INDEX; }
- | TEX_ARRAYSHADOW1D { $$ = -TEXTURE_1D_ARRAY_INDEX; }
- | TEX_ARRAYSHADOW2D { $$ = -TEXTURE_2D_ARRAY_INDEX; }
- ;
-
-SWZ_instruction: SWZ maskedDstReg ',' srcReg ',' extendedSwizzle
- {
- /* FIXME: Is this correct? Should the extenedSwizzle be applied
- * FIXME: to the existing swizzle?
- */
- $4.Base.Swizzle = $6.swizzle;
- $4.Base.Negate = $6.mask;
-
- $$ = asm_instruction_copy_ctor(& $1, & $2, & $4, NULL, NULL);
- }
- ;
-
-scalarSrcReg: optionalSign scalarUse
- {
- $$ = $2;
-
- if ($1) {
- $$.Base.Negate = ~$$.Base.Negate;
- }
- }
- | optionalSign '|' scalarUse '|'
- {
- $$ = $3;
-
- if (!state->option.NV_fragment) {
- yyerror(& @2, state, "unexpected character '|'");
- YYERROR;
- }
-
- if ($1) {
- $$.Base.Negate = ~$$.Base.Negate;
- }
-
- $$.Base.Abs = 1;
- }
- ;
-
-scalarUse: srcReg scalarSuffix
- {
- $$ = $1;
-
- $$.Base.Swizzle = _mesa_combine_swizzles($$.Base.Swizzle,
- $2.swizzle);
- }
- | paramConstScalarUse
- {
- struct asm_symbol temp_sym;
-
- if (!state->option.NV_fragment) {
- yyerror(& @1, state, "expected scalar suffix");
- YYERROR;
- }
-
- memset(& temp_sym, 0, sizeof(temp_sym));
- temp_sym.param_binding_begin = ~0;
- initialize_symbol_from_const(state->prog, & temp_sym, & $1, GL_TRUE);
-
- set_src_reg_swz(& $$, PROGRAM_CONSTANT,
- temp_sym.param_binding_begin,
- temp_sym.param_binding_swizzle);
- }
- ;
-
-swizzleSrcReg: optionalSign srcReg swizzleSuffix
- {
- $$ = $2;
-
- if ($1) {
- $$.Base.Negate = ~$$.Base.Negate;
- }
-
- $$.Base.Swizzle = _mesa_combine_swizzles($$.Base.Swizzle,
- $3.swizzle);
- }
- | optionalSign '|' srcReg swizzleSuffix '|'
- {
- $$ = $3;
-
- if (!state->option.NV_fragment) {
- yyerror(& @2, state, "unexpected character '|'");
- YYERROR;
- }
-
- if ($1) {
- $$.Base.Negate = ~$$.Base.Negate;
- }
-
- $$.Base.Abs = 1;
- $$.Base.Swizzle = _mesa_combine_swizzles($$.Base.Swizzle,
- $4.swizzle);
- }
-
- ;
-
-maskedDstReg: dstReg optionalMask optionalCcMask
- {
- $$ = $1;
- $$.WriteMask = $2.mask;
- $$.CondMask = $3.CondMask;
- $$.CondSwizzle = $3.CondSwizzle;
- $$.CondSrc = $3.CondSrc;
-
- if ($$.File == PROGRAM_OUTPUT) {
- /* Technically speaking, this should check that it is in
- * vertex program mode. However, PositionInvariant can never be
- * set in fragment program mode, so it is somewhat irrelevant.
- */
- if (state->option.PositionInvariant
- && ($$.Index == VERT_RESULT_HPOS)) {
- yyerror(& @1, state, "position-invariant programs cannot "
- "write position");
- YYERROR;
- }
-
- state->prog->OutputsWritten |= BITFIELD64_BIT($$.Index);
- }
- }
- ;
-
-maskedAddrReg: addrReg addrWriteMask
- {
- set_dst_reg(& $$, PROGRAM_ADDRESS, 0);
- $$.WriteMask = $2.mask;
- }
- ;
-
-extendedSwizzle: extSwizComp ',' extSwizComp ',' extSwizComp ',' extSwizComp
- {
- const unsigned xyzw_valid =
- ($1.xyzw_valid << 0)
- | ($3.xyzw_valid << 1)
- | ($5.xyzw_valid << 2)
- | ($7.xyzw_valid << 3);
- const unsigned rgba_valid =
- ($1.rgba_valid << 0)
- | ($3.rgba_valid << 1)
- | ($5.rgba_valid << 2)
- | ($7.rgba_valid << 3);
-
- /* All of the swizzle components have to be valid in either RGBA
- * or XYZW. Note that 0 and 1 are valid in both, so both masks
- * can have some bits set.
- *
- * We somewhat deviate from the spec here. It would be really hard
- * to figure out which component is the error, and there probably
- * isn't a lot of benefit.
- */
- if ((rgba_valid != 0x0f) && (xyzw_valid != 0x0f)) {
- yyerror(& @1, state, "cannot combine RGBA and XYZW swizzle "
- "components");
- YYERROR;
- }
-
- $$.swizzle = MAKE_SWIZZLE4($1.swz, $3.swz, $5.swz, $7.swz);
- $$.mask = ($1.negate) | ($3.negate << 1) | ($5.negate << 2)
- | ($7.negate << 3);
- }
- ;
-
-extSwizComp: optionalSign extSwizSel
- {
- $$ = $2;
- $$.negate = ($1) ? 1 : 0;
- }
- ;
-
-extSwizSel: INTEGER
- {
- if (($1 != 0) && ($1 != 1)) {
- yyerror(& @1, state, "invalid extended swizzle selector");
- YYERROR;
- }
-
- $$.swz = ($1 == 0) ? SWIZZLE_ZERO : SWIZZLE_ONE;
-
- /* 0 and 1 are valid for both RGBA swizzle names and XYZW
- * swizzle names.
- */
- $$.xyzw_valid = 1;
- $$.rgba_valid = 1;
- }
- | string
- {
- char s;
-
- if (strlen($1) > 1) {
- yyerror(& @1, state, "invalid extended swizzle selector");
- YYERROR;
- }
-
- s = $1[0];
- free($1);
-
- switch (s) {
- case 'x':
- $$.swz = SWIZZLE_X;
- $$.xyzw_valid = 1;
- break;
- case 'y':
- $$.swz = SWIZZLE_Y;
- $$.xyzw_valid = 1;
- break;
- case 'z':
- $$.swz = SWIZZLE_Z;
- $$.xyzw_valid = 1;
- break;
- case 'w':
- $$.swz = SWIZZLE_W;
- $$.xyzw_valid = 1;
- break;
-
- case 'r':
- $$.swz = SWIZZLE_X;
- $$.rgba_valid = 1;
- break;
- case 'g':
- $$.swz = SWIZZLE_Y;
- $$.rgba_valid = 1;
- break;
- case 'b':
- $$.swz = SWIZZLE_Z;
- $$.rgba_valid = 1;
- break;
- case 'a':
- $$.swz = SWIZZLE_W;
- $$.rgba_valid = 1;
- break;
-
- default:
- yyerror(& @1, state, "invalid extended swizzle selector");
- YYERROR;
- break;
- }
- }
- ;
-
-srcReg: USED_IDENTIFIER /* temporaryReg | progParamSingle */
- {
- struct asm_symbol *const s = (struct asm_symbol *)
- _mesa_symbol_table_find_symbol(state->st, 0, $1);
-
- free($1);
-
- if (s == NULL) {
- yyerror(& @1, state, "invalid operand variable");
- YYERROR;
- } else if ((s->type != at_param) && (s->type != at_temp)
- && (s->type != at_attrib)) {
- yyerror(& @1, state, "invalid operand variable");
- YYERROR;
- } else if ((s->type == at_param) && s->param_is_array) {
- yyerror(& @1, state, "non-array access to array PARAM");
- YYERROR;
- }
-
- init_src_reg(& $$);
- switch (s->type) {
- case at_temp:
- set_src_reg(& $$, PROGRAM_TEMPORARY, s->temp_binding);
- break;
- case at_param:
- set_src_reg_swz(& $$, s->param_binding_type,
- s->param_binding_begin,
- s->param_binding_swizzle);
- break;
- case at_attrib:
- set_src_reg(& $$, PROGRAM_INPUT, s->attrib_binding);
- state->prog->InputsRead |= (1U << $$.Base.Index);
-
- if (!validate_inputs(& @1, state)) {
- YYERROR;
- }
- break;
-
- default:
- YYERROR;
- break;
- }
- }
- | attribBinding
- {
- set_src_reg(& $$, PROGRAM_INPUT, $1);
- state->prog->InputsRead |= (1U << $$.Base.Index);
-
- if (!validate_inputs(& @1, state)) {
- YYERROR;
- }
- }
- | progParamArray '[' progParamArrayMem ']'
- {
- if (! $3.Base.RelAddr
- && ((unsigned) $3.Base.Index >= $1->param_binding_length)) {
- yyerror(& @3, state, "out of bounds array access");
- YYERROR;
- }
-
- init_src_reg(& $$);
- $$.Base.File = $1->param_binding_type;
-
- if ($3.Base.RelAddr) {
- state->prog->IndirectRegisterFiles |= (1 << $$.Base.File);
- $1->param_accessed_indirectly = 1;
-
- $$.Base.RelAddr = 1;
- $$.Base.Index = $3.Base.Index;
- $$.Symbol = $1;
- } else {
- $$.Base.Index = $1->param_binding_begin + $3.Base.Index;
- }
- }
- | paramSingleItemUse
- {
- gl_register_file file = ($1.name != NULL)
- ? $1.param_binding_type
- : PROGRAM_CONSTANT;
- set_src_reg_swz(& $$, file, $1.param_binding_begin,
- $1.param_binding_swizzle);
- }
- ;
-
-dstReg: resultBinding
- {
- set_dst_reg(& $$, PROGRAM_OUTPUT, $1);
- }
- | USED_IDENTIFIER /* temporaryReg | vertexResultReg */
- {
- struct asm_symbol *const s = (struct asm_symbol *)
- _mesa_symbol_table_find_symbol(state->st, 0, $1);
-
- free($1);
-
- if (s == NULL) {
- yyerror(& @1, state, "invalid operand variable");
- YYERROR;
- } else if ((s->type != at_output) && (s->type != at_temp)) {
- yyerror(& @1, state, "invalid operand variable");
- YYERROR;
- }
-
- switch (s->type) {
- case at_temp:
- set_dst_reg(& $$, PROGRAM_TEMPORARY, s->temp_binding);
- break;
- case at_output:
- set_dst_reg(& $$, PROGRAM_OUTPUT, s->output_binding);
- break;
- default:
- set_dst_reg(& $$, s->param_binding_type, s->param_binding_begin);
- break;
- }
- }
- ;
-
-progParamArray: USED_IDENTIFIER
- {
- struct asm_symbol *const s = (struct asm_symbol *)
- _mesa_symbol_table_find_symbol(state->st, 0, $1);
-
- free($1);
-
- if (s == NULL) {
- yyerror(& @1, state, "invalid operand variable");
- YYERROR;
- } else if ((s->type != at_param) || !s->param_is_array) {
- yyerror(& @1, state, "array access to non-PARAM variable");
- YYERROR;
- } else {
- $$ = s;
- }
- }
- ;
-
-progParamArrayMem: progParamArrayAbs | progParamArrayRel;
-
-progParamArrayAbs: INTEGER
- {
- init_src_reg(& $$);
- $$.Base.Index = $1;
- }
- ;
-
-progParamArrayRel: addrReg addrComponent addrRegRelOffset
- {
- /* FINISHME: Add support for multiple address registers.
- */
- /* FINISHME: Add support for 4-component address registers.
- */
- init_src_reg(& $$);
- $$.Base.RelAddr = 1;
- $$.Base.Index = $3;
- }
- ;
-
-addrRegRelOffset: { $$ = 0; }
- | '+' addrRegPosOffset { $$ = $2; }
- | '-' addrRegNegOffset { $$ = -$2; }
- ;
-
-addrRegPosOffset: INTEGER
- {
- if (($1 < 0) || ($1 > (state->limits->MaxAddressOffset - 1))) {
- char s[100];
- _mesa_snprintf(s, sizeof(s),
- "relative address offset too large (%d)", $1);
- yyerror(& @1, state, s);
- YYERROR;
- } else {
- $$ = $1;
- }
- }
- ;
-
-addrRegNegOffset: INTEGER
- {
- if (($1 < 0) || ($1 > state->limits->MaxAddressOffset)) {
- char s[100];
- _mesa_snprintf(s, sizeof(s),
- "relative address offset too large (%d)", $1);
- yyerror(& @1, state, s);
- YYERROR;
- } else {
- $$ = $1;
- }
- }
- ;
-
-addrReg: USED_IDENTIFIER
- {
- struct asm_symbol *const s = (struct asm_symbol *)
- _mesa_symbol_table_find_symbol(state->st, 0, $1);
-
- free($1);
-
- if (s == NULL) {
- yyerror(& @1, state, "invalid array member");
- YYERROR;
- } else if (s->type != at_address) {
- yyerror(& @1, state,
- "invalid variable for indexed array access");
- YYERROR;
- } else {
- $$ = s;
- }
- }
- ;
-
-addrComponent: MASK1
- {
- if ($1.mask != WRITEMASK_X) {
- yyerror(& @1, state, "invalid address component selector");
- YYERROR;
- } else {
- $$ = $1;
- }
- }
- ;
-
-addrWriteMask: MASK1
- {
- if ($1.mask != WRITEMASK_X) {
- yyerror(& @1, state,
- "address register write mask must be \".x\"");
- YYERROR;
- } else {
- $$ = $1;
- }
- }
- ;
-
-scalarSuffix: MASK1;
-
-swizzleSuffix: MASK1
- | MASK4
- | SWIZZLE
- | { $$.swizzle = SWIZZLE_NOOP; $$.mask = WRITEMASK_XYZW; }
- ;
-
-optionalMask: MASK4 | MASK3 | MASK2 | MASK1
- | { $$.swizzle = SWIZZLE_NOOP; $$.mask = WRITEMASK_XYZW; }
- ;
-
-optionalCcMask: '(' ccTest ')'
- {
- $$ = $2;
- }
- | '(' ccTest2 ')'
- {
- $$ = $2;
- }
- |
- {
- $$.CondMask = COND_TR;
- $$.CondSwizzle = SWIZZLE_NOOP;
- $$.CondSrc = 0;
- }
- ;
-
-ccTest: ccMaskRule swizzleSuffix
- {
- $$ = $1;
- $$.CondSwizzle = $2.swizzle;
- }
- ;
-
-ccTest2: ccMaskRule2 swizzleSuffix
- {
- $$ = $1;
- $$.CondSwizzle = $2.swizzle;
- }
- ;
-
-ccMaskRule: IDENTIFIER
- {
- const int cond = _mesa_parse_cc($1);
- if ((cond == 0) || ($1[2] != '\0')) {
- char *const err_str =
- make_error_string("invalid condition code \"%s\"", $1);
-
- yyerror(& @1, state, (err_str != NULL)
- ? err_str : "invalid condition code");
-
- if (err_str != NULL) {
- free(err_str);
- }
-
- YYERROR;
- }
-
- $$.CondMask = cond;
- $$.CondSwizzle = SWIZZLE_NOOP;
- $$.CondSrc = 0;
- }
- ;
-
-ccMaskRule2: USED_IDENTIFIER
- {
- const int cond = _mesa_parse_cc($1);
- if ((cond == 0) || ($1[2] != '\0')) {
- char *const err_str =
- make_error_string("invalid condition code \"%s\"", $1);
-
- yyerror(& @1, state, (err_str != NULL)
- ? err_str : "invalid condition code");
-
- if (err_str != NULL) {
- free(err_str);
- }
-
- YYERROR;
- }
-
- $$.CondMask = cond;
- $$.CondSwizzle = SWIZZLE_NOOP;
- $$.CondSrc = 0;
- }
- ;
-
-namingStatement: ATTRIB_statement
- | PARAM_statement
- | TEMP_statement
- | ADDRESS_statement
- | OUTPUT_statement
- | ALIAS_statement
- ;
-
-ATTRIB_statement: ATTRIB IDENTIFIER '=' attribBinding
- {
- struct asm_symbol *const s =
- declare_variable(state, $2, at_attrib, & @2);
-
- if (s == NULL) {
- free($2);
- YYERROR;
- } else {
- s->attrib_binding = $4;
- state->InputsBound |= (1U << s->attrib_binding);
-
- if (!validate_inputs(& @4, state)) {
- YYERROR;
- }
- }
- }
- ;
-
-attribBinding: VERTEX vtxAttribItem
- {
- $$ = $2;
- }
- | FRAGMENT fragAttribItem
- {
- $$ = $2;
- }
- ;
-
-vtxAttribItem: POSITION
- {
- $$ = VERT_ATTRIB_POS;
- }
- | WEIGHT vtxOptWeightNum
- {
- $$ = VERT_ATTRIB_WEIGHT;
- }
- | NORMAL
- {
- $$ = VERT_ATTRIB_NORMAL;
- }
- | COLOR optColorType
- {
- if (!state->ctx->Extensions.EXT_secondary_color) {
- yyerror(& @2, state, "GL_EXT_secondary_color not supported");
- YYERROR;
- }
-
- $$ = VERT_ATTRIB_COLOR0 + $2;
- }
- | FOGCOORD
- {
- if (!state->ctx->Extensions.EXT_fog_coord) {
- yyerror(& @1, state, "GL_EXT_fog_coord not supported");
- YYERROR;
- }
-
- $$ = VERT_ATTRIB_FOG;
- }
- | TEXCOORD optTexCoordUnitNum
- {
- $$ = VERT_ATTRIB_TEX0 + $2;
- }
- | MATRIXINDEX '[' vtxWeightNum ']'
- {
- yyerror(& @1, state, "GL_ARB_matrix_palette not supported");
- YYERROR;
- }
- | VTXATTRIB '[' vtxAttribNum ']'
- {
- $$ = VERT_ATTRIB_GENERIC0 + $3;
- }
- ;
-
-vtxAttribNum: INTEGER
- {
- if ((unsigned) $1 >= state->limits->MaxAttribs) {
- yyerror(& @1, state, "invalid vertex attribute reference");
- YYERROR;
- }
-
- $$ = $1;
- }
- ;
-
-vtxOptWeightNum: | '[' vtxWeightNum ']';
-vtxWeightNum: INTEGER;
-
-fragAttribItem: POSITION
- {
- $$ = FRAG_ATTRIB_WPOS;
- }
- | COLOR optColorType
- {
- $$ = FRAG_ATTRIB_COL0 + $2;
- }
- | FOGCOORD
- {
- $$ = FRAG_ATTRIB_FOGC;
- }
- | TEXCOORD optTexCoordUnitNum
- {
- $$ = FRAG_ATTRIB_TEX0 + $2;
- }
- ;
-
-PARAM_statement: PARAM_singleStmt | PARAM_multipleStmt;
-
-PARAM_singleStmt: PARAM IDENTIFIER paramSingleInit
- {
- struct asm_symbol *const s =
- declare_variable(state, $2, at_param, & @2);
-
- if (s == NULL) {
- free($2);
- YYERROR;
- } else {
- s->param_binding_type = $3.param_binding_type;
- s->param_binding_begin = $3.param_binding_begin;
- s->param_binding_length = $3.param_binding_length;
- s->param_binding_swizzle = $3.param_binding_swizzle;
- s->param_is_array = 0;
- }
- }
- ;
-
-PARAM_multipleStmt: PARAM IDENTIFIER '[' optArraySize ']' paramMultipleInit
- {
- if (($4 != 0) && ((unsigned) $4 != $6.param_binding_length)) {
- free($2);
- yyerror(& @4, state,
- "parameter array size and number of bindings must match");
- YYERROR;
- } else {
- struct asm_symbol *const s =
- declare_variable(state, $2, $6.type, & @2);
-
- if (s == NULL) {
- free($2);
- YYERROR;
- } else {
- s->param_binding_type = $6.param_binding_type;
- s->param_binding_begin = $6.param_binding_begin;
- s->param_binding_length = $6.param_binding_length;
- s->param_binding_swizzle = SWIZZLE_XYZW;
- s->param_is_array = 1;
- }
- }
- }
- ;
-
-optArraySize:
- {
- $$ = 0;
- }
- | INTEGER
- {
- if (($1 < 1) || ((unsigned) $1 > state->limits->MaxParameters)) {
- char msg[100];
- _mesa_snprintf(msg, sizeof(msg),
- "invalid parameter array size (size=%d max=%u)",
- $1, state->limits->MaxParameters);
- yyerror(& @1, state, msg);
- YYERROR;
- } else {
- $$ = $1;
- }
- }
- ;
-
-paramSingleInit: '=' paramSingleItemDecl
- {
- $$ = $2;
- }
- ;
-
-paramMultipleInit: '=' '{' paramMultInitList '}'
- {
- $$ = $3;
- }
- ;
-
-paramMultInitList: paramMultipleItem
- | paramMultInitList ',' paramMultipleItem
- {
- $1.param_binding_length += $3.param_binding_length;
- $$ = $1;
- }
- ;
-
-paramSingleItemDecl: stateSingleItem
- {
- memset(& $$, 0, sizeof($$));
- $$.param_binding_begin = ~0;
- initialize_symbol_from_state(state->prog, & $$, $1);
- }
- | programSingleItem
- {
- memset(& $$, 0, sizeof($$));
- $$.param_binding_begin = ~0;
- initialize_symbol_from_param(state->prog, & $$, $1);
- }
- | paramConstDecl
- {
- memset(& $$, 0, sizeof($$));
- $$.param_binding_begin = ~0;
- initialize_symbol_from_const(state->prog, & $$, & $1, GL_TRUE);
- }
- ;
-
-paramSingleItemUse: stateSingleItem
- {
- memset(& $$, 0, sizeof($$));
- $$.param_binding_begin = ~0;
- initialize_symbol_from_state(state->prog, & $$, $1);
- }
- | programSingleItem
- {
- memset(& $$, 0, sizeof($$));
- $$.param_binding_begin = ~0;
- initialize_symbol_from_param(state->prog, & $$, $1);
- }
- | paramConstUse
- {
- memset(& $$, 0, sizeof($$));
- $$.param_binding_begin = ~0;
- initialize_symbol_from_const(state->prog, & $$, & $1, GL_TRUE);
- }
- ;
-
-paramMultipleItem: stateMultipleItem
- {
- memset(& $$, 0, sizeof($$));
- $$.param_binding_begin = ~0;
- initialize_symbol_from_state(state->prog, & $$, $1);
- }
- | programMultipleItem
- {
- memset(& $$, 0, sizeof($$));
- $$.param_binding_begin = ~0;
- initialize_symbol_from_param(state->prog, & $$, $1);
- }
- | paramConstDecl
- {
- memset(& $$, 0, sizeof($$));
- $$.param_binding_begin = ~0;
- initialize_symbol_from_const(state->prog, & $$, & $1, GL_FALSE);
- }
- ;
-
-stateMultipleItem: stateSingleItem { memcpy($$, $1, sizeof($$)); }
- | STATE stateMatrixRows { memcpy($$, $2, sizeof($$)); }
- ;
-
-stateSingleItem: STATE stateMaterialItem { memcpy($$, $2, sizeof($$)); }
- | STATE stateLightItem { memcpy($$, $2, sizeof($$)); }
- | STATE stateLightModelItem { memcpy($$, $2, sizeof($$)); }
- | STATE stateLightProdItem { memcpy($$, $2, sizeof($$)); }
- | STATE stateTexGenItem { memcpy($$, $2, sizeof($$)); }
- | STATE stateTexEnvItem { memcpy($$, $2, sizeof($$)); }
- | STATE stateFogItem { memcpy($$, $2, sizeof($$)); }
- | STATE stateClipPlaneItem { memcpy($$, $2, sizeof($$)); }
- | STATE statePointItem { memcpy($$, $2, sizeof($$)); }
- | STATE stateMatrixRow { memcpy($$, $2, sizeof($$)); }
- | STATE stateDepthItem { memcpy($$, $2, sizeof($$)); }
- ;
-
-stateMaterialItem: MATERIAL optFaceType stateMatProperty
- {
- memset($$, 0, sizeof($$));
- $$[0] = STATE_MATERIAL;
- $$[1] = $2;
- $$[2] = $3;
- }
- ;
-
-stateMatProperty: ambDiffSpecProperty
- {
- $$ = $1;
- }
- | EMISSION
- {
- $$ = STATE_EMISSION;
- }
- | SHININESS
- {
- $$ = STATE_SHININESS;
- }
- ;
-
-stateLightItem: LIGHT '[' stateLightNumber ']' stateLightProperty
- {
- memset($$, 0, sizeof($$));
- $$[0] = STATE_LIGHT;
- $$[1] = $3;
- $$[2] = $5;
- }
- ;
-
-stateLightProperty: ambDiffSpecProperty
- {
- $$ = $1;
- }
- | POSITION
- {
- $$ = STATE_POSITION;
- }
- | ATTENUATION
- {
- if (!state->ctx->Extensions.EXT_point_parameters) {
- yyerror(& @1, state, "GL_ARB_point_parameters not supported");
- YYERROR;
- }
-
- $$ = STATE_ATTENUATION;
- }
- | SPOT stateSpotProperty
- {
- $$ = $2;
- }
- | HALF
- {
- $$ = STATE_HALF_VECTOR;
- }
- ;
-
-stateSpotProperty: DIRECTION
- {
- $$ = STATE_SPOT_DIRECTION;
- }
- ;
-
-stateLightModelItem: LIGHTMODEL stateLModProperty
- {
- $$[0] = $2[0];
- $$[1] = $2[1];
- }
- ;
-
-stateLModProperty: AMBIENT
- {
- memset($$, 0, sizeof($$));
- $$[0] = STATE_LIGHTMODEL_AMBIENT;
- }
- | optFaceType SCENECOLOR
- {
- memset($$, 0, sizeof($$));
- $$[0] = STATE_LIGHTMODEL_SCENECOLOR;
- $$[1] = $1;
- }
- ;
-
-stateLightProdItem: LIGHTPROD '[' stateLightNumber ']' optFaceType stateLProdProperty
- {
- memset($$, 0, sizeof($$));
- $$[0] = STATE_LIGHTPROD;
- $$[1] = $3;
- $$[2] = $5;
- $$[3] = $6;
- }
- ;
-
-stateLProdProperty: ambDiffSpecProperty;
-
-stateTexEnvItem: TEXENV optLegacyTexUnitNum stateTexEnvProperty
- {
- memset($$, 0, sizeof($$));
- $$[0] = $3;
- $$[1] = $2;
- }
- ;
-
-stateTexEnvProperty: COLOR
- {
- $$ = STATE_TEXENV_COLOR;
- }
- ;
-
-ambDiffSpecProperty: AMBIENT
- {
- $$ = STATE_AMBIENT;
- }
- | DIFFUSE
- {
- $$ = STATE_DIFFUSE;
- }
- | SPECULAR
- {
- $$ = STATE_SPECULAR;
- }
- ;
-
-stateLightNumber: INTEGER
- {
- if ((unsigned) $1 >= state->MaxLights) {
- yyerror(& @1, state, "invalid light selector");
- YYERROR;
- }
-
- $$ = $1;
- }
- ;
-
-stateTexGenItem: TEXGEN optTexCoordUnitNum stateTexGenType stateTexGenCoord
- {
- memset($$, 0, sizeof($$));
- $$[0] = STATE_TEXGEN;
- $$[1] = $2;
- $$[2] = $3 + $4;
- }
- ;
-
-stateTexGenType: EYE
- {
- $$ = STATE_TEXGEN_EYE_S;
- }
- | OBJECT
- {
- $$ = STATE_TEXGEN_OBJECT_S;
- }
- ;
-stateTexGenCoord: TEXGEN_S
- {
- $$ = STATE_TEXGEN_EYE_S - STATE_TEXGEN_EYE_S;
- }
- | TEXGEN_T
- {
- $$ = STATE_TEXGEN_EYE_T - STATE_TEXGEN_EYE_S;
- }
- | TEXGEN_R
- {
- $$ = STATE_TEXGEN_EYE_R - STATE_TEXGEN_EYE_S;
- }
- | TEXGEN_Q
- {
- $$ = STATE_TEXGEN_EYE_Q - STATE_TEXGEN_EYE_S;
- }
- ;
-
-stateFogItem: FOG stateFogProperty
- {
- memset($$, 0, sizeof($$));
- $$[0] = $2;
- }
- ;
-
-stateFogProperty: COLOR
- {
- $$ = STATE_FOG_COLOR;
- }
- | PARAMS
- {
- $$ = STATE_FOG_PARAMS;
- }
- ;
-
-stateClipPlaneItem: CLIP '[' stateClipPlaneNum ']' PLANE
- {
- memset($$, 0, sizeof($$));
- $$[0] = STATE_CLIPPLANE;
- $$[1] = $3;
- }
- ;
-
-stateClipPlaneNum: INTEGER
- {
- if ((unsigned) $1 >= state->MaxClipPlanes) {
- yyerror(& @1, state, "invalid clip plane selector");
- YYERROR;
- }
-
- $$ = $1;
- }
- ;
-
-statePointItem: POINT_TOK statePointProperty
- {
- memset($$, 0, sizeof($$));
- $$[0] = $2;
- }
- ;
-
-statePointProperty: SIZE_TOK
- {
- $$ = STATE_POINT_SIZE;
- }
- | ATTENUATION
- {
- $$ = STATE_POINT_ATTENUATION;
- }
- ;
-
-stateMatrixRow: stateMatrixItem ROW '[' stateMatrixRowNum ']'
- {
- $$[0] = $1[0];
- $$[1] = $1[1];
- $$[2] = $4;
- $$[3] = $4;
- $$[4] = $1[2];
- }
- ;
-
-stateMatrixRows: stateMatrixItem optMatrixRows
- {
- $$[0] = $1[0];
- $$[1] = $1[1];
- $$[2] = $2[2];
- $$[3] = $2[3];
- $$[4] = $1[2];
- }
- ;
-
-optMatrixRows:
- {
- $$[2] = 0;
- $$[3] = 3;
- }
- | ROW '[' stateMatrixRowNum DOT_DOT stateMatrixRowNum ']'
- {
- /* It seems logical that the matrix row range specifier would have
- * to specify a range or more than one row (i.e., $5 > $3).
- * However, the ARB_vertex_program spec says "a program will fail
- * to load if <a> is greater than <b>." This means that $3 == $5
- * is valid.
- */
- if ($3 > $5) {
- yyerror(& @3, state, "invalid matrix row range");
- YYERROR;
- }
-
- $$[2] = $3;
- $$[3] = $5;
- }
- ;
-
-stateMatrixItem: MATRIX stateMatrixName stateOptMatModifier
- {
- $$[0] = $2[0];
- $$[1] = $2[1];
- $$[2] = $3;
- }
- ;
-
-stateOptMatModifier:
- {
- $$ = 0;
- }
- | stateMatModifier
- {
- $$ = $1;
- }
- ;
-
-stateMatModifier: INVERSE
- {
- $$ = STATE_MATRIX_INVERSE;
- }
- | TRANSPOSE
- {
- $$ = STATE_MATRIX_TRANSPOSE;
- }
- | INVTRANS
- {
- $$ = STATE_MATRIX_INVTRANS;
- }
- ;
-
-stateMatrixRowNum: INTEGER
- {
- if ($1 > 3) {
- yyerror(& @1, state, "invalid matrix row reference");
- YYERROR;
- }
-
- $$ = $1;
- }
- ;
-
-stateMatrixName: MODELVIEW stateOptModMatNum
- {
- $$[0] = STATE_MODELVIEW_MATRIX;
- $$[1] = $2;
- }
- | PROJECTION
- {
- $$[0] = STATE_PROJECTION_MATRIX;
- $$[1] = 0;
- }
- | MVP
- {
- $$[0] = STATE_MVP_MATRIX;
- $$[1] = 0;
- }
- | TEXTURE optTexCoordUnitNum
- {
- $$[0] = STATE_TEXTURE_MATRIX;
- $$[1] = $2;
- }
- | PALETTE '[' statePaletteMatNum ']'
- {
- yyerror(& @1, state, "GL_ARB_matrix_palette not supported");
- YYERROR;
- }
- | MAT_PROGRAM '[' stateProgramMatNum ']'
- {
- $$[0] = STATE_PROGRAM_MATRIX;
- $$[1] = $3;
- }
- ;
-
-stateOptModMatNum:
- {
- $$ = 0;
- }
- | '[' stateModMatNum ']'
- {
- $$ = $2;
- }
- ;
-stateModMatNum: INTEGER
- {
- /* Since GL_ARB_vertex_blend isn't supported, only modelview matrix
- * zero is valid.
- */
- if ($1 != 0) {
- yyerror(& @1, state, "invalid modelview matrix index");
- YYERROR;
- }
-
- $$ = $1;
- }
- ;
-statePaletteMatNum: INTEGER
- {
- /* Since GL_ARB_matrix_palette isn't supported, just let any value
- * through here. The error will be generated later.
- */
- $$ = $1;
- }
- ;
-stateProgramMatNum: INTEGER
- {
- if ((unsigned) $1 >= state->MaxProgramMatrices) {
- yyerror(& @1, state, "invalid program matrix selector");
- YYERROR;
- }
-
- $$ = $1;
- }
- ;
-
-stateDepthItem: DEPTH RANGE
- {
- memset($$, 0, sizeof($$));
- $$[0] = STATE_DEPTH_RANGE;
- }
- ;
-
-
-programSingleItem: progEnvParam | progLocalParam;
-
-programMultipleItem: progEnvParams | progLocalParams;
-
-progEnvParams: PROGRAM ENV '[' progEnvParamNums ']'
- {
- memset($$, 0, sizeof($$));
- $$[0] = state->state_param_enum;
- $$[1] = STATE_ENV;
- $$[2] = $4[0];
- $$[3] = $4[1];
- }
- ;
-
-progEnvParamNums: progEnvParamNum
- {
- $$[0] = $1;
- $$[1] = $1;
- }
- | progEnvParamNum DOT_DOT progEnvParamNum
- {
- $$[0] = $1;
- $$[1] = $3;
- }
- ;
-
-progEnvParam: PROGRAM ENV '[' progEnvParamNum ']'
- {
- memset($$, 0, sizeof($$));
- $$[0] = state->state_param_enum;
- $$[1] = STATE_ENV;
- $$[2] = $4;
- $$[3] = $4;
- }
- ;
-
-progLocalParams: PROGRAM LOCAL '[' progLocalParamNums ']'
- {
- memset($$, 0, sizeof($$));
- $$[0] = state->state_param_enum;
- $$[1] = STATE_LOCAL;
- $$[2] = $4[0];
- $$[3] = $4[1];
- }
-
-progLocalParamNums: progLocalParamNum
- {
- $$[0] = $1;
- $$[1] = $1;
- }
- | progLocalParamNum DOT_DOT progLocalParamNum
- {
- $$[0] = $1;
- $$[1] = $3;
- }
- ;
-
-progLocalParam: PROGRAM LOCAL '[' progLocalParamNum ']'
- {
- memset($$, 0, sizeof($$));
- $$[0] = state->state_param_enum;
- $$[1] = STATE_LOCAL;
- $$[2] = $4;
- $$[3] = $4;
- }
- ;
-
-progEnvParamNum: INTEGER
- {
- if ((unsigned) $1 >= state->limits->MaxEnvParams) {
- yyerror(& @1, state, "invalid environment parameter reference");
- YYERROR;
- }
- $$ = $1;
- }
- ;
-
-progLocalParamNum: INTEGER
- {
- if ((unsigned) $1 >= state->limits->MaxLocalParams) {
- yyerror(& @1, state, "invalid local parameter reference");
- YYERROR;
- }
- $$ = $1;
- }
- ;
-
-
-
-paramConstDecl: paramConstScalarDecl | paramConstVector;
-paramConstUse: paramConstScalarUse | paramConstVector;
-
-paramConstScalarDecl: signedFloatConstant
- {
- $$.count = 4;
- $$.data[0] = $1;
- $$.data[1] = $1;
- $$.data[2] = $1;
- $$.data[3] = $1;
- }
- ;
-
-paramConstScalarUse: REAL
- {
- $$.count = 1;
- $$.data[0] = $1;
- $$.data[1] = $1;
- $$.data[2] = $1;
- $$.data[3] = $1;
- }
- | INTEGER
- {
- $$.count = 1;
- $$.data[0] = (float) $1;
- $$.data[1] = (float) $1;
- $$.data[2] = (float) $1;
- $$.data[3] = (float) $1;
- }
- ;
-
-paramConstVector: '{' signedFloatConstant '}'
- {
- $$.count = 4;
- $$.data[0] = $2;
- $$.data[1] = 0.0f;
- $$.data[2] = 0.0f;
- $$.data[3] = 1.0f;
- }
- | '{' signedFloatConstant ',' signedFloatConstant '}'
- {
- $$.count = 4;
- $$.data[0] = $2;
- $$.data[1] = $4;
- $$.data[2] = 0.0f;
- $$.data[3] = 1.0f;
- }
- | '{' signedFloatConstant ',' signedFloatConstant ','
- signedFloatConstant '}'
- {
- $$.count = 4;
- $$.data[0] = $2;
- $$.data[1] = $4;
- $$.data[2] = $6;
- $$.data[3] = 1.0f;
- }
- | '{' signedFloatConstant ',' signedFloatConstant ','
- signedFloatConstant ',' signedFloatConstant '}'
- {
- $$.count = 4;
- $$.data[0] = $2;
- $$.data[1] = $4;
- $$.data[2] = $6;
- $$.data[3] = $8;
- }
- ;
-
-signedFloatConstant: optionalSign REAL
- {
- $$ = ($1) ? -$2 : $2;
- }
- | optionalSign INTEGER
- {
- $$ = (float)(($1) ? -$2 : $2);
- }
- ;
-
-optionalSign: '+' { $$ = FALSE; }
- | '-' { $$ = TRUE; }
- | { $$ = FALSE; }
- ;
-
-TEMP_statement: optVarSize TEMP { $<integer>$ = $2; } varNameList
- ;
-
-optVarSize: string
- {
- /* NV_fragment_program_option defines the size qualifiers in a
- * fairly broken way. "SHORT" or "LONG" can optionally be used
- * before TEMP or OUTPUT. However, neither is a reserved word!
- * This means that we have to parse it as an identifier, then check
- * to make sure it's one of the valid values. *sigh*
- *
- * In addition, the grammar in the extension spec does *not* allow
- * the size specifier to be optional, but all known implementations
- * do.
- */
- if (!state->option.NV_fragment) {
- yyerror(& @1, state, "unexpected IDENTIFIER");
- YYERROR;
- }
-
- if (strcmp("SHORT", $1) == 0) {
- } else if (strcmp("LONG", $1) == 0) {
- } else {
- char *const err_str =
- make_error_string("invalid storage size specifier \"%s\"",
- $1);
-
- yyerror(& @1, state, (err_str != NULL)
- ? err_str : "invalid storage size specifier");
-
- if (err_str != NULL) {
- free(err_str);
- }
-
- YYERROR;
- }
- }
- |
- {
- }
- ;
-
-ADDRESS_statement: ADDRESS { $<integer>$ = $1; } varNameList
- ;
-
-varNameList: varNameList ',' IDENTIFIER
- {
- if (!declare_variable(state, $3, $<integer>0, & @3)) {
- free($3);
- YYERROR;
- }
- }
- | IDENTIFIER
- {
- if (!declare_variable(state, $1, $<integer>0, & @1)) {
- free($1);
- YYERROR;
- }
- }
- ;
-
-OUTPUT_statement: optVarSize OUTPUT IDENTIFIER '=' resultBinding
- {
- struct asm_symbol *const s =
- declare_variable(state, $3, at_output, & @3);
-
- if (s == NULL) {
- free($3);
- YYERROR;
- } else {
- s->output_binding = $5;
- }
- }
- ;
-
-resultBinding: RESULT POSITION
- {
- if (state->mode == ARB_vertex) {
- $$ = VERT_RESULT_HPOS;
- } else {
- yyerror(& @2, state, "invalid program result name");
- YYERROR;
- }
- }
- | RESULT FOGCOORD
- {
- if (state->mode == ARB_vertex) {
- $$ = VERT_RESULT_FOGC;
- } else {
- yyerror(& @2, state, "invalid program result name");
- YYERROR;
- }
- }
- | RESULT resultColBinding
- {
- $$ = $2;
- }
- | RESULT POINTSIZE
- {
- if (state->mode == ARB_vertex) {
- $$ = VERT_RESULT_PSIZ;
- } else {
- yyerror(& @2, state, "invalid program result name");
- YYERROR;
- }
- }
- | RESULT TEXCOORD optTexCoordUnitNum
- {
- if (state->mode == ARB_vertex) {
- $$ = VERT_RESULT_TEX0 + $3;
- } else {
- yyerror(& @2, state, "invalid program result name");
- YYERROR;
- }
- }
- | RESULT DEPTH
- {
- if (state->mode == ARB_fragment) {
- $$ = FRAG_RESULT_DEPTH;
- } else {
- yyerror(& @2, state, "invalid program result name");
- YYERROR;
- }
- }
- ;
-
-resultColBinding: COLOR optResultFaceType optResultColorType
- {
- $$ = $2 + $3;
- }
- ;
-
-optResultFaceType:
- {
- if (state->mode == ARB_vertex) {
- $$ = VERT_RESULT_COL0;
- } else {
- if (state->option.DrawBuffers)
- $$ = FRAG_RESULT_DATA0;
- else
- $$ = FRAG_RESULT_COLOR;
- }
- }
- | '[' INTEGER ']'
- {
- if (state->mode == ARB_vertex) {
- yyerror(& @1, state, "invalid program result name");
- YYERROR;
- } else {
- if (!state->option.DrawBuffers) {
- /* From the ARB_draw_buffers spec (same text exists
- * for ATI_draw_buffers):
- *
- * If this option is not specified, a fragment
- * program that attempts to bind
- * "result.color[n]" will fail to load, and only
- * "result.color" will be allowed.
- */
- yyerror(& @1, state,
- "result.color[] used without "
- "`OPTION ARB_draw_buffers' or "
- "`OPTION ATI_draw_buffers'");
- YYERROR;
- } else if ($2 >= state->MaxDrawBuffers) {
- yyerror(& @1, state,
- "result.color[] exceeds MAX_DRAW_BUFFERS_ARB");
- YYERROR;
- }
- $$ = FRAG_RESULT_DATA0 + $2;
- }
- }
- | FRONT
- {
- if (state->mode == ARB_vertex) {
- $$ = VERT_RESULT_COL0;
- } else {
- yyerror(& @1, state, "invalid program result name");
- YYERROR;
- }
- }
- | BACK
- {
- if (state->mode == ARB_vertex) {
- $$ = VERT_RESULT_BFC0;
- } else {
- yyerror(& @1, state, "invalid program result name");
- YYERROR;
- }
- }
- ;
-
-optResultColorType:
- {
- $$ = 0;
- }
- | PRIMARY
- {
- if (state->mode == ARB_vertex) {
- $$ = 0;
- } else {
- yyerror(& @1, state, "invalid program result name");
- YYERROR;
- }
- }
- | SECONDARY
- {
- if (state->mode == ARB_vertex) {
- $$ = 1;
- } else {
- yyerror(& @1, state, "invalid program result name");
- YYERROR;
- }
- }
- ;
-
-optFaceType: { $$ = 0; }
- | FRONT { $$ = 0; }
- | BACK { $$ = 1; }
- ;
-
-optColorType: { $$ = 0; }
- | PRIMARY { $$ = 0; }
- | SECONDARY { $$ = 1; }
- ;
-
-optTexCoordUnitNum: { $$ = 0; }
- | '[' texCoordUnitNum ']' { $$ = $2; }
- ;
-
-optTexImageUnitNum: { $$ = 0; }
- | '[' texImageUnitNum ']' { $$ = $2; }
- ;
-
-optLegacyTexUnitNum: { $$ = 0; }
- | '[' legacyTexUnitNum ']' { $$ = $2; }
- ;
-
-texCoordUnitNum: INTEGER
- {
- if ((unsigned) $1 >= state->MaxTextureCoordUnits) {
- yyerror(& @1, state, "invalid texture coordinate unit selector");
- YYERROR;
- }
-
- $$ = $1;
- }
- ;
-
-texImageUnitNum: INTEGER
- {
- if ((unsigned) $1 >= state->MaxTextureImageUnits) {
- yyerror(& @1, state, "invalid texture image unit selector");
- YYERROR;
- }
-
- $$ = $1;
- }
- ;
-
-legacyTexUnitNum: INTEGER
- {
- if ((unsigned) $1 >= state->MaxTextureUnits) {
- yyerror(& @1, state, "invalid texture unit selector");
- YYERROR;
- }
-
- $$ = $1;
- }
- ;
-
-ALIAS_statement: ALIAS IDENTIFIER '=' USED_IDENTIFIER
- {
- struct asm_symbol *exist = (struct asm_symbol *)
- _mesa_symbol_table_find_symbol(state->st, 0, $2);
- struct asm_symbol *target = (struct asm_symbol *)
- _mesa_symbol_table_find_symbol(state->st, 0, $4);
-
- free($4);
-
- if (exist != NULL) {
- char m[1000];
- _mesa_snprintf(m, sizeof(m), "redeclared identifier: %s", $2);
- free($2);
- yyerror(& @2, state, m);
- YYERROR;
- } else if (target == NULL) {
- free($2);
- yyerror(& @4, state,
- "undefined variable binding in ALIAS statement");
- YYERROR;
- } else {
- _mesa_symbol_table_add_symbol(state->st, 0, $2, target);
- }
- }
- ;
-
-string: IDENTIFIER
- | USED_IDENTIFIER
- ;
-
-%%
-
-void
-asm_instruction_set_operands(struct asm_instruction *inst,
- const struct prog_dst_register *dst,
- const struct asm_src_register *src0,
- const struct asm_src_register *src1,
- const struct asm_src_register *src2)
-{
- /* In the core ARB extensions only the KIL instruction doesn't have a
- * destination register.
- */
- if (dst == NULL) {
- init_dst_reg(& inst->Base.DstReg);
- } else {
- inst->Base.DstReg = *dst;
- }
-
- /* The only instruction that doesn't have any source registers is the
- * condition-code based KIL instruction added by NV_fragment_program_option.
- */
- if (src0 != NULL) {
- inst->Base.SrcReg[0] = src0->Base;
- inst->SrcReg[0] = *src0;
- } else {
- init_src_reg(& inst->SrcReg[0]);
- }
-
- if (src1 != NULL) {
- inst->Base.SrcReg[1] = src1->Base;
- inst->SrcReg[1] = *src1;
- } else {
- init_src_reg(& inst->SrcReg[1]);
- }
-
- if (src2 != NULL) {
- inst->Base.SrcReg[2] = src2->Base;
- inst->SrcReg[2] = *src2;
- } else {
- init_src_reg(& inst->SrcReg[2]);
- }
-}
-
-
-struct asm_instruction *
-asm_instruction_ctor(gl_inst_opcode op,
- const struct prog_dst_register *dst,
- const struct asm_src_register *src0,
- const struct asm_src_register *src1,
- const struct asm_src_register *src2)
-{
- struct asm_instruction *inst = CALLOC_STRUCT(asm_instruction);
-
- if (inst) {
- _mesa_init_instructions(& inst->Base, 1);
- inst->Base.Opcode = op;
-
- asm_instruction_set_operands(inst, dst, src0, src1, src2);
- }
-
- return inst;
-}
-
-
-struct asm_instruction *
-asm_instruction_copy_ctor(const struct prog_instruction *base,
- const struct prog_dst_register *dst,
- const struct asm_src_register *src0,
- const struct asm_src_register *src1,
- const struct asm_src_register *src2)
-{
- struct asm_instruction *inst = CALLOC_STRUCT(asm_instruction);
-
- if (inst) {
- _mesa_init_instructions(& inst->Base, 1);
- inst->Base.Opcode = base->Opcode;
- inst->Base.CondUpdate = base->CondUpdate;
- inst->Base.CondDst = base->CondDst;
- inst->Base.SaturateMode = base->SaturateMode;
- inst->Base.Precision = base->Precision;
-
- asm_instruction_set_operands(inst, dst, src0, src1, src2);
- }
-
- return inst;
-}
-
-
-void
-init_dst_reg(struct prog_dst_register *r)
-{
- memset(r, 0, sizeof(*r));
- r->File = PROGRAM_UNDEFINED;
- r->WriteMask = WRITEMASK_XYZW;
- r->CondMask = COND_TR;
- r->CondSwizzle = SWIZZLE_NOOP;
-}
-
-
-/** Like init_dst_reg() but set the File and Index fields. */
-void
-set_dst_reg(struct prog_dst_register *r, gl_register_file file, GLint index)
-{
- const GLint maxIndex = 1 << INST_INDEX_BITS;
- const GLint minIndex = 0;
- ASSERT(index >= minIndex);
- (void) minIndex;
- ASSERT(index <= maxIndex);
- (void) maxIndex;
- ASSERT(file == PROGRAM_TEMPORARY ||
- file == PROGRAM_ADDRESS ||
- file == PROGRAM_OUTPUT);
- memset(r, 0, sizeof(*r));
- r->File = file;
- r->Index = index;
- r->WriteMask = WRITEMASK_XYZW;
- r->CondMask = COND_TR;
- r->CondSwizzle = SWIZZLE_NOOP;
-}
-
-
-void
-init_src_reg(struct asm_src_register *r)
-{
- memset(r, 0, sizeof(*r));
- r->Base.File = PROGRAM_UNDEFINED;
- r->Base.Swizzle = SWIZZLE_NOOP;
- r->Symbol = NULL;
-}
-
-
-/** Like init_src_reg() but set the File and Index fields.
- * \return GL_TRUE if a valid src register, GL_FALSE otherwise
- */
-void
-set_src_reg(struct asm_src_register *r, gl_register_file file, GLint index)
-{
- set_src_reg_swz(r, file, index, SWIZZLE_XYZW);
-}
-
-
-void
-set_src_reg_swz(struct asm_src_register *r, gl_register_file file, GLint index,
- GLuint swizzle)
-{
- const GLint maxIndex = (1 << INST_INDEX_BITS) - 1;
- const GLint minIndex = -(1 << INST_INDEX_BITS);
- ASSERT(file < PROGRAM_FILE_MAX);
- ASSERT(index >= minIndex);
- (void) minIndex;
- ASSERT(index <= maxIndex);
- (void) maxIndex;
- memset(r, 0, sizeof(*r));
- r->Base.File = file;
- r->Base.Index = index;
- r->Base.Swizzle = swizzle;
- r->Symbol = NULL;
-}
-
-
-/**
- * Validate the set of inputs used by a program
- *
- * Validates that legal sets of inputs are used by the program. In this case
- * "used" included both reading the input or binding the input to a name using
- * the \c ATTRIB command.
- *
- * \return
- * \c TRUE if the combination of inputs used is valid, \c FALSE otherwise.
- */
-int
-validate_inputs(struct YYLTYPE *locp, struct asm_parser_state *state)
-{
- const int inputs = state->prog->InputsRead | state->InputsBound;
-
- if (((inputs & 0x0ffff) & (inputs >> 16)) != 0) {
- yyerror(locp, state, "illegal use of generic attribute and name attribute");
- return 0;
- }
-
- return 1;
-}
-
-
-struct asm_symbol *
-declare_variable(struct asm_parser_state *state, char *name, enum asm_type t,
- struct YYLTYPE *locp)
-{
- struct asm_symbol *s = NULL;
- struct asm_symbol *exist = (struct asm_symbol *)
- _mesa_symbol_table_find_symbol(state->st, 0, name);
-
-
- if (exist != NULL) {
- yyerror(locp, state, "redeclared identifier");
- } else {
- s = calloc(1, sizeof(struct asm_symbol));
- s->name = name;
- s->type = t;
-
- switch (t) {
- case at_temp:
- if (state->prog->NumTemporaries >= state->limits->MaxTemps) {
- yyerror(locp, state, "too many temporaries declared");
- free(s);
- return NULL;
- }
-
- s->temp_binding = state->prog->NumTemporaries;
- state->prog->NumTemporaries++;
- break;
-
- case at_address:
- if (state->prog->NumAddressRegs >= state->limits->MaxAddressRegs) {
- yyerror(locp, state, "too many address registers declared");
- free(s);
- return NULL;
- }
-
- /* FINISHME: Add support for multiple address registers.
- */
- state->prog->NumAddressRegs++;
- break;
-
- default:
- break;
- }
-
- _mesa_symbol_table_add_symbol(state->st, 0, s->name, s);
- s->next = state->sym;
- state->sym = s;
- }
-
- return s;
-}
-
-
-int add_state_reference(struct gl_program_parameter_list *param_list,
- const gl_state_index tokens[STATE_LENGTH])
-{
- const GLuint size = 4; /* XXX fix */
- char *name;
- GLint index;
-
- name = _mesa_program_state_string(tokens);
- index = _mesa_add_parameter(param_list, PROGRAM_STATE_VAR, name,
- size, GL_NONE, NULL, tokens, 0x0);
- param_list->StateFlags |= _mesa_program_state_flags(tokens);
-
- /* free name string here since we duplicated it in add_parameter() */
- free(name);
-
- return index;
-}
-
-
-int
-initialize_symbol_from_state(struct gl_program *prog,
- struct asm_symbol *param_var,
- const gl_state_index tokens[STATE_LENGTH])
-{
- int idx = -1;
- gl_state_index state_tokens[STATE_LENGTH];
-
-
- memcpy(state_tokens, tokens, sizeof(state_tokens));
-
- param_var->type = at_param;
- param_var->param_binding_type = PROGRAM_STATE_VAR;
-
- /* If we are adding a STATE_MATRIX that has multiple rows, we need to
- * unroll it and call add_state_reference() for each row
- */
- if ((state_tokens[0] == STATE_MODELVIEW_MATRIX ||
- state_tokens[0] == STATE_PROJECTION_MATRIX ||
- state_tokens[0] == STATE_MVP_MATRIX ||
- state_tokens[0] == STATE_TEXTURE_MATRIX ||
- state_tokens[0] == STATE_PROGRAM_MATRIX)
- && (state_tokens[2] != state_tokens[3])) {
- int row;
- const int first_row = state_tokens[2];
- const int last_row = state_tokens[3];
-
- for (row = first_row; row <= last_row; row++) {
- state_tokens[2] = state_tokens[3] = row;
-
- idx = add_state_reference(prog->Parameters, state_tokens);
- if (param_var->param_binding_begin == ~0U) {
- param_var->param_binding_begin = idx;
- param_var->param_binding_swizzle = SWIZZLE_XYZW;
- }
-
- param_var->param_binding_length++;
- }
- }
- else {
- idx = add_state_reference(prog->Parameters, state_tokens);
- if (param_var->param_binding_begin == ~0U) {
- param_var->param_binding_begin = idx;
- param_var->param_binding_swizzle = SWIZZLE_XYZW;
- }
- param_var->param_binding_length++;
- }
-
- return idx;
-}
-
-
-int
-initialize_symbol_from_param(struct gl_program *prog,
- struct asm_symbol *param_var,
- const gl_state_index tokens[STATE_LENGTH])
-{
- int idx = -1;
- gl_state_index state_tokens[STATE_LENGTH];
-
-
- memcpy(state_tokens, tokens, sizeof(state_tokens));
-
- assert((state_tokens[0] == STATE_VERTEX_PROGRAM)
- || (state_tokens[0] == STATE_FRAGMENT_PROGRAM));
- assert((state_tokens[1] == STATE_ENV)
- || (state_tokens[1] == STATE_LOCAL));
-
- /*
- * The param type is STATE_VAR. The program parameter entry will
- * effectively be a pointer into the LOCAL or ENV parameter array.
- */
- param_var->type = at_param;
- param_var->param_binding_type = PROGRAM_STATE_VAR;
-
- /* If we are adding a STATE_ENV or STATE_LOCAL that has multiple elements,
- * we need to unroll it and call add_state_reference() for each row
- */
- if (state_tokens[2] != state_tokens[3]) {
- int row;
- const int first_row = state_tokens[2];
- const int last_row = state_tokens[3];
-
- for (row = first_row; row <= last_row; row++) {
- state_tokens[2] = state_tokens[3] = row;
-
- idx = add_state_reference(prog->Parameters, state_tokens);
- if (param_var->param_binding_begin == ~0U) {
- param_var->param_binding_begin = idx;
- param_var->param_binding_swizzle = SWIZZLE_XYZW;
- }
- param_var->param_binding_length++;
- }
- }
- else {
- idx = add_state_reference(prog->Parameters, state_tokens);
- if (param_var->param_binding_begin == ~0U) {
- param_var->param_binding_begin = idx;
- param_var->param_binding_swizzle = SWIZZLE_XYZW;
- }
- param_var->param_binding_length++;
- }
-
- return idx;
-}
-
-
-/**
- * Put a float/vector constant/literal into the parameter list.
- * \param param_var returns info about the parameter/constant's location,
- * binding, type, etc.
- * \param vec the vector/constant to add
- * \param allowSwizzle if true, try to consolidate constants which only differ
- * by a swizzle. We don't want to do this when building
- * arrays of constants that may be indexed indirectly.
- * \return index of the constant in the parameter list.
- */
-int
-initialize_symbol_from_const(struct gl_program *prog,
- struct asm_symbol *param_var,
- const struct asm_vector *vec,
- GLboolean allowSwizzle)
-{
- unsigned swizzle;
- const int idx = _mesa_add_unnamed_constant(prog->Parameters,
- vec->data, vec->count,
- allowSwizzle ? &swizzle : NULL);
-
- param_var->type = at_param;
- param_var->param_binding_type = PROGRAM_CONSTANT;
-
- if (param_var->param_binding_begin == ~0U) {
- param_var->param_binding_begin = idx;
- param_var->param_binding_swizzle = allowSwizzle ? swizzle : SWIZZLE_XYZW;
- }
- param_var->param_binding_length++;
-
- return idx;
-}
-
-
-char *
-make_error_string(const char *fmt, ...)
-{
- int length;
- char *str;
- va_list args;
-
-
- /* Call vsnprintf once to determine how large the final string is. Call it
- * again to do the actual formatting. from the vsnprintf manual page:
- *
- * Upon successful return, these functions return the number of
- * characters printed (not including the trailing '\0' used to end
- * output to strings).
- */
- va_start(args, fmt);
- length = 1 + vsnprintf(NULL, 0, fmt, args);
- va_end(args);
-
- str = malloc(length);
- if (str) {
- va_start(args, fmt);
- vsnprintf(str, length, fmt, args);
- va_end(args);
- }
-
- return str;
-}
-
-
-void
-yyerror(YYLTYPE *locp, struct asm_parser_state *state, const char *s)
-{
- char *err_str;
-
-
- err_str = make_error_string("glProgramStringARB(%s)\n", s);
- if (err_str) {
- _mesa_error(state->ctx, GL_INVALID_OPERATION, "%s", err_str);
- free(err_str);
- }
-
- err_str = make_error_string("line %u, char %u: error: %s\n",
- locp->first_line, locp->first_column, s);
- _mesa_set_program_error(state->ctx, locp->position, err_str);
-
- if (err_str) {
- free(err_str);
- }
-}
-
-
-GLboolean
-_mesa_parse_arb_program(struct gl_context *ctx, GLenum target, const GLubyte *str,
- GLsizei len, struct asm_parser_state *state)
-{
- struct asm_instruction *inst;
- unsigned i;
- GLubyte *strz;
- GLboolean result = GL_FALSE;
- void *temp;
- struct asm_symbol *sym;
-
- state->ctx = ctx;
- state->prog->Target = target;
- state->prog->Parameters = _mesa_new_parameter_list();
-
- /* Make a copy of the program string and force it to be NUL-terminated.
- */
- strz = (GLubyte *) malloc(len + 1);
- if (strz == NULL) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "glProgramStringARB");
- return GL_FALSE;
- }
- memcpy (strz, str, len);
- strz[len] = '\0';
-
- state->prog->String = strz;
-
- state->st = _mesa_symbol_table_ctor();
-
- state->limits = (target == GL_VERTEX_PROGRAM_ARB)
- ? & ctx->Const.VertexProgram
- : & ctx->Const.FragmentProgram;
-
- state->MaxTextureImageUnits = ctx->Const.MaxTextureImageUnits;
- state->MaxTextureCoordUnits = ctx->Const.MaxTextureCoordUnits;
- state->MaxTextureUnits = ctx->Const.MaxTextureUnits;
- state->MaxClipPlanes = ctx->Const.MaxClipPlanes;
- state->MaxLights = ctx->Const.MaxLights;
- state->MaxProgramMatrices = ctx->Const.MaxProgramMatrices;
- state->MaxDrawBuffers = ctx->Const.MaxDrawBuffers;
-
- state->state_param_enum = (target == GL_VERTEX_PROGRAM_ARB)
- ? STATE_VERTEX_PROGRAM : STATE_FRAGMENT_PROGRAM;
-
- _mesa_set_program_error(ctx, -1, NULL);
-
- _mesa_program_lexer_ctor(& state->scanner, state, (const char *) str, len);
- yyparse(state);
- _mesa_program_lexer_dtor(state->scanner);
-
-
- if (ctx->Program.ErrorPos != -1) {
- goto error;
- }
-
- if (! _mesa_layout_parameters(state)) {
- struct YYLTYPE loc;
-
- loc.first_line = 0;
- loc.first_column = 0;
- loc.position = len;
-
- yyerror(& loc, state, "invalid PARAM usage");
- goto error;
- }
-
-
-
- /* Add one instruction to store the "END" instruction.
- */
- state->prog->Instructions =
- _mesa_alloc_instructions(state->prog->NumInstructions + 1);
- inst = state->inst_head;
- for (i = 0; i < state->prog->NumInstructions; i++) {
- struct asm_instruction *const temp = inst->next;
-
- state->prog->Instructions[i] = inst->Base;
- inst = temp;
- }
-
- /* Finally, tag on an OPCODE_END instruction */
- {
- const GLuint numInst = state->prog->NumInstructions;
- _mesa_init_instructions(state->prog->Instructions + numInst, 1);
- state->prog->Instructions[numInst].Opcode = OPCODE_END;
- }
- state->prog->NumInstructions++;
-
- state->prog->NumParameters = state->prog->Parameters->NumParameters;
- state->prog->NumAttributes = _mesa_bitcount(state->prog->InputsRead);
-
- /*
- * Initialize native counts to logical counts. The device driver may
- * change them if program is translated into a hardware program.
- */
- state->prog->NumNativeInstructions = state->prog->NumInstructions;
- state->prog->NumNativeTemporaries = state->prog->NumTemporaries;
- state->prog->NumNativeParameters = state->prog->NumParameters;
- state->prog->NumNativeAttributes = state->prog->NumAttributes;
- state->prog->NumNativeAddressRegs = state->prog->NumAddressRegs;
-
- result = GL_TRUE;
-
-error:
- for (inst = state->inst_head; inst != NULL; inst = temp) {
- temp = inst->next;
- free(inst);
- }
-
- state->inst_head = NULL;
- state->inst_tail = NULL;
-
- for (sym = state->sym; sym != NULL; sym = temp) {
- temp = sym->next;
-
- free((void *) sym->name);
- free(sym);
- }
- state->sym = NULL;
-
- _mesa_symbol_table_dtor(state->st);
- state->st = NULL;
-
- return result;
-}
+%{
+/*
+ * Copyright © 2009 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "main/mtypes.h"
+#include "main/imports.h"
+#include "program/program.h"
+#include "program/prog_parameter.h"
+#include "program/prog_parameter_layout.h"
+#include "program/prog_statevars.h"
+#include "program/prog_instruction.h"
+
+#include "program/symbol_table.h"
+#include "program/program_parser.h"
+
+extern void *yy_scan_string(char *);
+extern void yy_delete_buffer(void *);
+
+static struct asm_symbol *declare_variable(struct asm_parser_state *state,
+ char *name, enum asm_type t, struct YYLTYPE *locp);
+
+static int add_state_reference(struct gl_program_parameter_list *param_list,
+ const gl_state_index tokens[STATE_LENGTH]);
+
+static int initialize_symbol_from_state(struct gl_program *prog,
+ struct asm_symbol *param_var, const gl_state_index tokens[STATE_LENGTH]);
+
+static int initialize_symbol_from_param(struct gl_program *prog,
+ struct asm_symbol *param_var, const gl_state_index tokens[STATE_LENGTH]);
+
+static int initialize_symbol_from_const(struct gl_program *prog,
+ struct asm_symbol *param_var, const struct asm_vector *vec,
+ GLboolean allowSwizzle);
+
+static int yyparse(struct asm_parser_state *state);
+
+static char *make_error_string(const char *fmt, ...);
+
+static void yyerror(struct YYLTYPE *locp, struct asm_parser_state *state,
+ const char *s);
+
+static int validate_inputs(struct YYLTYPE *locp,
+ struct asm_parser_state *state);
+
+static void init_dst_reg(struct prog_dst_register *r);
+
+static void set_dst_reg(struct prog_dst_register *r,
+ gl_register_file file, GLint index);
+
+static void init_src_reg(struct asm_src_register *r);
+
+static void set_src_reg(struct asm_src_register *r,
+ gl_register_file file, GLint index);
+
+static void set_src_reg_swz(struct asm_src_register *r,
+ gl_register_file file, GLint index, GLuint swizzle);
+
+static void asm_instruction_set_operands(struct asm_instruction *inst,
+ const struct prog_dst_register *dst, const struct asm_src_register *src0,
+ const struct asm_src_register *src1, const struct asm_src_register *src2);
+
+static struct asm_instruction *asm_instruction_ctor(gl_inst_opcode op,
+ const struct prog_dst_register *dst, const struct asm_src_register *src0,
+ const struct asm_src_register *src1, const struct asm_src_register *src2);
+
+static struct asm_instruction *asm_instruction_copy_ctor(
+ const struct prog_instruction *base, const struct prog_dst_register *dst,
+ const struct asm_src_register *src0, const struct asm_src_register *src1,
+ const struct asm_src_register *src2);
+
+#ifndef FALSE
+#define FALSE 0
+#define TRUE (!FALSE)
+#endif
+
+#define YYLLOC_DEFAULT(Current, Rhs, N) \
+ do { \
+ if (YYID(N)) { \
+ (Current).first_line = YYRHSLOC(Rhs, 1).first_line; \
+ (Current).first_column = YYRHSLOC(Rhs, 1).first_column; \
+ (Current).position = YYRHSLOC(Rhs, 1).position; \
+ (Current).last_line = YYRHSLOC(Rhs, N).last_line; \
+ (Current).last_column = YYRHSLOC(Rhs, N).last_column; \
+ } else { \
+ (Current).first_line = YYRHSLOC(Rhs, 0).last_line; \
+ (Current).last_line = (Current).first_line; \
+ (Current).first_column = YYRHSLOC(Rhs, 0).last_column; \
+ (Current).last_column = (Current).first_column; \
+ (Current).position = YYRHSLOC(Rhs, 0).position \
+ + (Current).first_column; \
+ } \
+ } while(YYID(0))
+
+#define YYLEX_PARAM state->scanner
+%}
+
+%pure-parser
+%locations
+%parse-param { struct asm_parser_state *state }
+%error-verbose
+%lex-param { void *scanner }
+
+%union {
+ struct asm_instruction *inst;
+ struct asm_symbol *sym;
+ struct asm_symbol temp_sym;
+ struct asm_swizzle_mask swiz_mask;
+ struct asm_src_register src_reg;
+ struct prog_dst_register dst_reg;
+ struct prog_instruction temp_inst;
+ char *string;
+ unsigned result;
+ unsigned attrib;
+ int integer;
+ float real;
+ gl_state_index state[STATE_LENGTH];
+ int negate;
+ struct asm_vector vector;
+ gl_inst_opcode opcode;
+
+ struct {
+ unsigned swz;
+ unsigned rgba_valid:1;
+ unsigned xyzw_valid:1;
+ unsigned negate:1;
+ } ext_swizzle;
+}
+
+%token ARBvp_10 ARBfp_10
+
+/* Tokens for assembler pseudo-ops */
+%token <integer> ADDRESS
+%token ALIAS ATTRIB
+%token OPTION OUTPUT
+%token PARAM
+%token <integer> TEMP
+%token END
+
+ /* Tokens for instructions */
+%token <temp_inst> BIN_OP BINSC_OP SAMPLE_OP SCALAR_OP TRI_OP VECTOR_OP
+%token <temp_inst> ARL KIL SWZ TXD_OP
+
+%token <integer> INTEGER
+%token <real> REAL
+
+%token AMBIENT ATTENUATION
+%token BACK
+%token CLIP COLOR
+%token DEPTH DIFFUSE DIRECTION
+%token EMISSION ENV EYE
+%token FOG FOGCOORD FRAGMENT FRONT
+%token HALF
+%token INVERSE INVTRANS
+%token LIGHT LIGHTMODEL LIGHTPROD LOCAL
+%token MATERIAL MAT_PROGRAM MATRIX MATRIXINDEX MODELVIEW MVP
+%token NORMAL
+%token OBJECT
+%token PALETTE PARAMS PLANE POINT_TOK POINTSIZE POSITION PRIMARY PROGRAM PROJECTION
+%token RANGE RESULT ROW
+%token SCENECOLOR SECONDARY SHININESS SIZE_TOK SPECULAR SPOT STATE
+%token TEXCOORD TEXENV TEXGEN TEXGEN_Q TEXGEN_R TEXGEN_S TEXGEN_T TEXTURE TRANSPOSE
+%token TEXTURE_UNIT TEX_1D TEX_2D TEX_3D TEX_CUBE TEX_RECT
+%token TEX_SHADOW1D TEX_SHADOW2D TEX_SHADOWRECT
+%token TEX_ARRAY1D TEX_ARRAY2D TEX_ARRAYSHADOW1D TEX_ARRAYSHADOW2D
+%token VERTEX VTXATTRIB
+%token WEIGHT
+
+%token <string> IDENTIFIER USED_IDENTIFIER
+%type <string> string
+%token <swiz_mask> MASK4 MASK3 MASK2 MASK1 SWIZZLE
+%token DOT_DOT
+%token DOT
+
+%type <inst> instruction ALU_instruction TexInstruction
+%type <inst> ARL_instruction VECTORop_instruction
+%type <inst> SCALARop_instruction BINSCop_instruction BINop_instruction
+%type <inst> TRIop_instruction TXD_instruction SWZ_instruction SAMPLE_instruction
+%type <inst> KIL_instruction
+
+%type <dst_reg> dstReg maskedDstReg maskedAddrReg
+%type <src_reg> srcReg scalarUse scalarSrcReg swizzleSrcReg
+%type <swiz_mask> scalarSuffix swizzleSuffix extendedSwizzle
+%type <ext_swizzle> extSwizComp extSwizSel
+%type <swiz_mask> optionalMask
+
+%type <sym> progParamArray
+%type <integer> addrRegRelOffset addrRegPosOffset addrRegNegOffset
+%type <src_reg> progParamArrayMem progParamArrayAbs progParamArrayRel
+%type <sym> addrReg
+%type <swiz_mask> addrComponent addrWriteMask
+
+%type <dst_reg> ccMaskRule ccTest ccMaskRule2 ccTest2 optionalCcMask
+
+%type <result> resultBinding resultColBinding
+%type <integer> optFaceType optColorType
+%type <integer> optResultFaceType optResultColorType
+
+%type <integer> optTexImageUnitNum texImageUnitNum
+%type <integer> optTexCoordUnitNum texCoordUnitNum
+%type <integer> optLegacyTexUnitNum legacyTexUnitNum
+%type <integer> texImageUnit texTarget
+%type <integer> vtxAttribNum
+
+%type <attrib> attribBinding vtxAttribItem fragAttribItem
+
+%type <temp_sym> paramSingleInit paramSingleItemDecl
+%type <integer> optArraySize
+
+%type <state> stateSingleItem stateMultipleItem
+%type <state> stateMaterialItem
+%type <state> stateLightItem stateLightModelItem stateLightProdItem
+%type <state> stateTexGenItem stateFogItem stateClipPlaneItem statePointItem
+%type <state> stateMatrixItem stateMatrixRow stateMatrixRows
+%type <state> stateTexEnvItem stateDepthItem
+
+%type <state> stateLModProperty
+%type <state> stateMatrixName optMatrixRows
+
+%type <integer> stateMatProperty
+%type <integer> stateLightProperty stateSpotProperty
+%type <integer> stateLightNumber stateLProdProperty
+%type <integer> stateTexGenType stateTexGenCoord
+%type <integer> stateTexEnvProperty
+%type <integer> stateFogProperty
+%type <integer> stateClipPlaneNum
+%type <integer> statePointProperty
+
+%type <integer> stateOptMatModifier stateMatModifier stateMatrixRowNum
+%type <integer> stateOptModMatNum stateModMatNum statePaletteMatNum
+%type <integer> stateProgramMatNum
+
+%type <integer> ambDiffSpecProperty
+
+%type <state> programSingleItem progEnvParam progLocalParam
+%type <state> programMultipleItem progEnvParams progLocalParams
+
+%type <temp_sym> paramMultipleInit paramMultInitList paramMultipleItem
+%type <temp_sym> paramSingleItemUse
+
+%type <integer> progEnvParamNum progLocalParamNum
+%type <state> progEnvParamNums progLocalParamNums
+
+%type <vector> paramConstDecl paramConstUse
+%type <vector> paramConstScalarDecl paramConstScalarUse paramConstVector
+%type <real> signedFloatConstant
+%type <negate> optionalSign
+
+%{
+extern int yylex(YYSTYPE *yylval_param, YYLTYPE *yylloc_param,
+ void *yyscanner);
+%}
+
+%%
+
+program: language optionSequence statementSequence END
+ ;
+
+language: ARBvp_10
+ {
+ if (state->prog->Target != GL_VERTEX_PROGRAM_ARB) {
+ yyerror(& @1, state, "invalid fragment program header");
+
+ }
+ state->mode = ARB_vertex;
+ }
+ | ARBfp_10
+ {
+ if (state->prog->Target != GL_FRAGMENT_PROGRAM_ARB) {
+ yyerror(& @1, state, "invalid vertex program header");
+ }
+ state->mode = ARB_fragment;
+
+ state->option.TexRect =
+ (state->ctx->Extensions.NV_texture_rectangle != GL_FALSE);
+ }
+ ;
+
+optionSequence: optionSequence option
+ |
+ ;
+
+option: OPTION string ';'
+ {
+ int valid = 0;
+
+ if (state->mode == ARB_vertex) {
+ valid = _mesa_ARBvp_parse_option(state, $2);
+ } else if (state->mode == ARB_fragment) {
+ valid = _mesa_ARBfp_parse_option(state, $2);
+ }
+
+
+ free($2);
+
+ if (!valid) {
+ const char *const err_str = (state->mode == ARB_vertex)
+ ? "invalid ARB vertex program option"
+ : "invalid ARB fragment program option";
+
+ yyerror(& @2, state, err_str);
+ YYERROR;
+ }
+ }
+ ;
+
+statementSequence: statementSequence statement
+ |
+ ;
+
+statement: instruction ';'
+ {
+ if ($1 != NULL) {
+ if (state->inst_tail == NULL) {
+ state->inst_head = $1;
+ } else {
+ state->inst_tail->next = $1;
+ }
+
+ state->inst_tail = $1;
+ $1->next = NULL;
+
+ state->prog->NumInstructions++;
+ }
+ }
+ | namingStatement ';'
+ ;
+
+instruction: ALU_instruction
+ {
+ $$ = $1;
+ state->prog->NumAluInstructions++;
+ }
+ | TexInstruction
+ {
+ $$ = $1;
+ state->prog->NumTexInstructions++;
+ }
+ ;
+
+ALU_instruction: ARL_instruction
+ | VECTORop_instruction
+ | SCALARop_instruction
+ | BINSCop_instruction
+ | BINop_instruction
+ | TRIop_instruction
+ | SWZ_instruction
+ ;
+
+TexInstruction: SAMPLE_instruction
+ | KIL_instruction
+ | TXD_instruction
+ ;
+
+ARL_instruction: ARL maskedAddrReg ',' scalarSrcReg
+ {
+ $$ = asm_instruction_ctor(OPCODE_ARL, & $2, & $4, NULL, NULL);
+ }
+ ;
+
+VECTORop_instruction: VECTOR_OP maskedDstReg ',' swizzleSrcReg
+ {
+ $$ = asm_instruction_copy_ctor(& $1, & $2, & $4, NULL, NULL);
+ }
+ ;
+
+SCALARop_instruction: SCALAR_OP maskedDstReg ',' scalarSrcReg
+ {
+ $$ = asm_instruction_copy_ctor(& $1, & $2, & $4, NULL, NULL);
+ }
+ ;
+
+BINSCop_instruction: BINSC_OP maskedDstReg ',' scalarSrcReg ',' scalarSrcReg
+ {
+ $$ = asm_instruction_copy_ctor(& $1, & $2, & $4, & $6, NULL);
+ }
+ ;
+
+
+BINop_instruction: BIN_OP maskedDstReg ',' swizzleSrcReg ',' swizzleSrcReg
+ {
+ $$ = asm_instruction_copy_ctor(& $1, & $2, & $4, & $6, NULL);
+ }
+ ;
+
+TRIop_instruction: TRI_OP maskedDstReg ','
+ swizzleSrcReg ',' swizzleSrcReg ',' swizzleSrcReg
+ {
+ $$ = asm_instruction_copy_ctor(& $1, & $2, & $4, & $6, & $8);
+ }
+ ;
+
+SAMPLE_instruction: SAMPLE_OP maskedDstReg ',' swizzleSrcReg ',' texImageUnit ',' texTarget
+ {
+ $$ = asm_instruction_copy_ctor(& $1, & $2, & $4, NULL, NULL);
+ if ($$ != NULL) {
+ const GLbitfield tex_mask = (1U << $6);
+ GLbitfield shadow_tex = 0;
+ GLbitfield target_mask = 0;
+
+
+ $$->Base.TexSrcUnit = $6;
+
+ if ($8 < 0) {
+ shadow_tex = tex_mask;
+
+ $$->Base.TexSrcTarget = -$8;
+ $$->Base.TexShadow = 1;
+ } else {
+ $$->Base.TexSrcTarget = $8;
+ }
+
+ target_mask = (1U << $$->Base.TexSrcTarget);
+
+ /* If this texture unit was previously accessed and that access
+ * had a different texture target, generate an error.
+ *
+ * If this texture unit was previously accessed and that access
+ * had a different shadow mode, generate an error.
+ */
+ if ((state->prog->TexturesUsed[$6] != 0)
+ && ((state->prog->TexturesUsed[$6] != target_mask)
+ || ((state->prog->ShadowSamplers & tex_mask)
+ != shadow_tex))) {
+ yyerror(& @8, state,
+ "multiple targets used on one texture image unit");
+ YYERROR;
+ }
+
+
+ state->prog->TexturesUsed[$6] |= target_mask;
+ state->prog->ShadowSamplers |= shadow_tex;
+ }
+ }
+ ;
+
+KIL_instruction: KIL swizzleSrcReg
+ {
+ $$ = asm_instruction_ctor(OPCODE_KIL, NULL, & $2, NULL, NULL);
+ state->fragment.UsesKill = 1;
+ }
+ | KIL ccTest
+ {
+ $$ = asm_instruction_ctor(OPCODE_KIL_NV, NULL, NULL, NULL, NULL);
+ $$->Base.DstReg.CondMask = $2.CondMask;
+ $$->Base.DstReg.CondSwizzle = $2.CondSwizzle;
+ $$->Base.DstReg.CondSrc = $2.CondSrc;
+ state->fragment.UsesKill = 1;
+ }
+ ;
+
+TXD_instruction: TXD_OP maskedDstReg ',' swizzleSrcReg ',' swizzleSrcReg ',' swizzleSrcReg ',' texImageUnit ',' texTarget
+ {
+ $$ = asm_instruction_copy_ctor(& $1, & $2, & $4, & $6, & $8);
+ if ($$ != NULL) {
+ const GLbitfield tex_mask = (1U << $10);
+ GLbitfield shadow_tex = 0;
+ GLbitfield target_mask = 0;
+
+
+ $$->Base.TexSrcUnit = $10;
+
+ if ($12 < 0) {
+ shadow_tex = tex_mask;
+
+ $$->Base.TexSrcTarget = -$12;
+ $$->Base.TexShadow = 1;
+ } else {
+ $$->Base.TexSrcTarget = $12;
+ }
+
+ target_mask = (1U << $$->Base.TexSrcTarget);
+
+ /* If this texture unit was previously accessed and that access
+ * had a different texture target, generate an error.
+ *
+ * If this texture unit was previously accessed and that access
+ * had a different shadow mode, generate an error.
+ */
+ if ((state->prog->TexturesUsed[$10] != 0)
+ && ((state->prog->TexturesUsed[$10] != target_mask)
+ || ((state->prog->ShadowSamplers & tex_mask)
+ != shadow_tex))) {
+ yyerror(& @12, state,
+ "multiple targets used on one texture image unit");
+ YYERROR;
+ }
+
+
+ state->prog->TexturesUsed[$10] |= target_mask;
+ state->prog->ShadowSamplers |= shadow_tex;
+ }
+ }
+ ;
+
+texImageUnit: TEXTURE_UNIT optTexImageUnitNum
+ {
+ $$ = $2;
+ }
+ ;
+
+texTarget: TEX_1D { $$ = TEXTURE_1D_INDEX; }
+ | TEX_2D { $$ = TEXTURE_2D_INDEX; }
+ | TEX_3D { $$ = TEXTURE_3D_INDEX; }
+ | TEX_CUBE { $$ = TEXTURE_CUBE_INDEX; }
+ | TEX_RECT { $$ = TEXTURE_RECT_INDEX; }
+ | TEX_SHADOW1D { $$ = -TEXTURE_1D_INDEX; }
+ | TEX_SHADOW2D { $$ = -TEXTURE_2D_INDEX; }
+ | TEX_SHADOWRECT { $$ = -TEXTURE_RECT_INDEX; }
+ | TEX_ARRAY1D { $$ = TEXTURE_1D_ARRAY_INDEX; }
+ | TEX_ARRAY2D { $$ = TEXTURE_2D_ARRAY_INDEX; }
+ | TEX_ARRAYSHADOW1D { $$ = -TEXTURE_1D_ARRAY_INDEX; }
+ | TEX_ARRAYSHADOW2D { $$ = -TEXTURE_2D_ARRAY_INDEX; }
+ ;
+
+SWZ_instruction: SWZ maskedDstReg ',' srcReg ',' extendedSwizzle
+ {
+ /* FIXME: Is this correct? Should the extenedSwizzle be applied
+ * FIXME: to the existing swizzle?
+ */
+ $4.Base.Swizzle = $6.swizzle;
+ $4.Base.Negate = $6.mask;
+
+ $$ = asm_instruction_copy_ctor(& $1, & $2, & $4, NULL, NULL);
+ }
+ ;
+
+scalarSrcReg: optionalSign scalarUse
+ {
+ $$ = $2;
+
+ if ($1) {
+ $$.Base.Negate = ~$$.Base.Negate;
+ }
+ }
+ | optionalSign '|' scalarUse '|'
+ {
+ $$ = $3;
+
+ if (!state->option.NV_fragment) {
+ yyerror(& @2, state, "unexpected character '|'");
+ YYERROR;
+ }
+
+ if ($1) {
+ $$.Base.Negate = ~$$.Base.Negate;
+ }
+
+ $$.Base.Abs = 1;
+ }
+ ;
+
+scalarUse: srcReg scalarSuffix
+ {
+ $$ = $1;
+
+ $$.Base.Swizzle = _mesa_combine_swizzles($$.Base.Swizzle,
+ $2.swizzle);
+ }
+ | paramConstScalarUse
+ {
+ struct asm_symbol temp_sym;
+
+ if (!state->option.NV_fragment) {
+ yyerror(& @1, state, "expected scalar suffix");
+ YYERROR;
+ }
+
+ memset(& temp_sym, 0, sizeof(temp_sym));
+ temp_sym.param_binding_begin = ~0;
+ initialize_symbol_from_const(state->prog, & temp_sym, & $1, GL_TRUE);
+
+ set_src_reg_swz(& $$, PROGRAM_CONSTANT,
+ temp_sym.param_binding_begin,
+ temp_sym.param_binding_swizzle);
+ }
+ ;
+
+swizzleSrcReg: optionalSign srcReg swizzleSuffix
+ {
+ $$ = $2;
+
+ if ($1) {
+ $$.Base.Negate = ~$$.Base.Negate;
+ }
+
+ $$.Base.Swizzle = _mesa_combine_swizzles($$.Base.Swizzle,
+ $3.swizzle);
+ }
+ | optionalSign '|' srcReg swizzleSuffix '|'
+ {
+ $$ = $3;
+
+ if (!state->option.NV_fragment) {
+ yyerror(& @2, state, "unexpected character '|'");
+ YYERROR;
+ }
+
+ if ($1) {
+ $$.Base.Negate = ~$$.Base.Negate;
+ }
+
+ $$.Base.Abs = 1;
+ $$.Base.Swizzle = _mesa_combine_swizzles($$.Base.Swizzle,
+ $4.swizzle);
+ }
+
+ ;
+
+maskedDstReg: dstReg optionalMask optionalCcMask
+ {
+ $$ = $1;
+ $$.WriteMask = $2.mask;
+ $$.CondMask = $3.CondMask;
+ $$.CondSwizzle = $3.CondSwizzle;
+ $$.CondSrc = $3.CondSrc;
+
+ if ($$.File == PROGRAM_OUTPUT) {
+ /* Technically speaking, this should check that it is in
+ * vertex program mode. However, PositionInvariant can never be
+ * set in fragment program mode, so it is somewhat irrelevant.
+ */
+ if (state->option.PositionInvariant
+ && ($$.Index == VERT_RESULT_HPOS)) {
+ yyerror(& @1, state, "position-invariant programs cannot "
+ "write position");
+ YYERROR;
+ }
+
+ state->prog->OutputsWritten |= BITFIELD64_BIT($$.Index);
+ }
+ }
+ ;
+
+maskedAddrReg: addrReg addrWriteMask
+ {
+ set_dst_reg(& $$, PROGRAM_ADDRESS, 0);
+ $$.WriteMask = $2.mask;
+ }
+ ;
+
+extendedSwizzle: extSwizComp ',' extSwizComp ',' extSwizComp ',' extSwizComp
+ {
+ const unsigned xyzw_valid =
+ ($1.xyzw_valid << 0)
+ | ($3.xyzw_valid << 1)
+ | ($5.xyzw_valid << 2)
+ | ($7.xyzw_valid << 3);
+ const unsigned rgba_valid =
+ ($1.rgba_valid << 0)
+ | ($3.rgba_valid << 1)
+ | ($5.rgba_valid << 2)
+ | ($7.rgba_valid << 3);
+
+ /* All of the swizzle components have to be valid in either RGBA
+ * or XYZW. Note that 0 and 1 are valid in both, so both masks
+ * can have some bits set.
+ *
+ * We somewhat deviate from the spec here. It would be really hard
+ * to figure out which component is the error, and there probably
+ * isn't a lot of benefit.
+ */
+ if ((rgba_valid != 0x0f) && (xyzw_valid != 0x0f)) {
+ yyerror(& @1, state, "cannot combine RGBA and XYZW swizzle "
+ "components");
+ YYERROR;
+ }
+
+ $$.swizzle = MAKE_SWIZZLE4($1.swz, $3.swz, $5.swz, $7.swz);
+ $$.mask = ($1.negate) | ($3.negate << 1) | ($5.negate << 2)
+ | ($7.negate << 3);
+ }
+ ;
+
+extSwizComp: optionalSign extSwizSel
+ {
+ $$ = $2;
+ $$.negate = ($1) ? 1 : 0;
+ }
+ ;
+
+extSwizSel: INTEGER
+ {
+ if (($1 != 0) && ($1 != 1)) {
+ yyerror(& @1, state, "invalid extended swizzle selector");
+ YYERROR;
+ }
+
+ $$.swz = ($1 == 0) ? SWIZZLE_ZERO : SWIZZLE_ONE;
+
+ /* 0 and 1 are valid for both RGBA swizzle names and XYZW
+ * swizzle names.
+ */
+ $$.xyzw_valid = 1;
+ $$.rgba_valid = 1;
+ }
+ | string
+ {
+ char s;
+
+ if (strlen($1) > 1) {
+ yyerror(& @1, state, "invalid extended swizzle selector");
+ YYERROR;
+ }
+
+ s = $1[0];
+ free($1);
+
+ switch (s) {
+ case 'x':
+ $$.swz = SWIZZLE_X;
+ $$.xyzw_valid = 1;
+ break;
+ case 'y':
+ $$.swz = SWIZZLE_Y;
+ $$.xyzw_valid = 1;
+ break;
+ case 'z':
+ $$.swz = SWIZZLE_Z;
+ $$.xyzw_valid = 1;
+ break;
+ case 'w':
+ $$.swz = SWIZZLE_W;
+ $$.xyzw_valid = 1;
+ break;
+
+ case 'r':
+ $$.swz = SWIZZLE_X;
+ $$.rgba_valid = 1;
+ break;
+ case 'g':
+ $$.swz = SWIZZLE_Y;
+ $$.rgba_valid = 1;
+ break;
+ case 'b':
+ $$.swz = SWIZZLE_Z;
+ $$.rgba_valid = 1;
+ break;
+ case 'a':
+ $$.swz = SWIZZLE_W;
+ $$.rgba_valid = 1;
+ break;
+
+ default:
+ yyerror(& @1, state, "invalid extended swizzle selector");
+ YYERROR;
+ break;
+ }
+ }
+ ;
+
+srcReg: USED_IDENTIFIER /* temporaryReg | progParamSingle */
+ {
+ struct asm_symbol *const s = (struct asm_symbol *)
+ _mesa_symbol_table_find_symbol(state->st, 0, $1);
+
+ free($1);
+
+ if (s == NULL) {
+ yyerror(& @1, state, "invalid operand variable");
+ YYERROR;
+ } else if ((s->type != at_param) && (s->type != at_temp)
+ && (s->type != at_attrib)) {
+ yyerror(& @1, state, "invalid operand variable");
+ YYERROR;
+ } else if ((s->type == at_param) && s->param_is_array) {
+ yyerror(& @1, state, "non-array access to array PARAM");
+ YYERROR;
+ }
+
+ init_src_reg(& $$);
+ switch (s->type) {
+ case at_temp:
+ set_src_reg(& $$, PROGRAM_TEMPORARY, s->temp_binding);
+ break;
+ case at_param:
+ set_src_reg_swz(& $$, s->param_binding_type,
+ s->param_binding_begin,
+ s->param_binding_swizzle);
+ break;
+ case at_attrib:
+ set_src_reg(& $$, PROGRAM_INPUT, s->attrib_binding);
+ state->prog->InputsRead |= (1U << $$.Base.Index);
+
+ if (!validate_inputs(& @1, state)) {
+ YYERROR;
+ }
+ break;
+
+ default:
+ YYERROR;
+ break;
+ }
+ }
+ | attribBinding
+ {
+ set_src_reg(& $$, PROGRAM_INPUT, $1);
+ state->prog->InputsRead |= (1U << $$.Base.Index);
+
+ if (!validate_inputs(& @1, state)) {
+ YYERROR;
+ }
+ }
+ | progParamArray '[' progParamArrayMem ']'
+ {
+ if (! $3.Base.RelAddr
+ && ((unsigned) $3.Base.Index >= $1->param_binding_length)) {
+ yyerror(& @3, state, "out of bounds array access");
+ YYERROR;
+ }
+
+ init_src_reg(& $$);
+ $$.Base.File = $1->param_binding_type;
+
+ if ($3.Base.RelAddr) {
+ state->prog->IndirectRegisterFiles |= (1 << $$.Base.File);
+ $1->param_accessed_indirectly = 1;
+
+ $$.Base.RelAddr = 1;
+ $$.Base.Index = $3.Base.Index;
+ $$.Symbol = $1;
+ } else {
+ $$.Base.Index = $1->param_binding_begin + $3.Base.Index;
+ }
+ }
+ | paramSingleItemUse
+ {
+ gl_register_file file = ($1.name != NULL)
+ ? $1.param_binding_type
+ : PROGRAM_CONSTANT;
+ set_src_reg_swz(& $$, file, $1.param_binding_begin,
+ $1.param_binding_swizzle);
+ }
+ ;
+
+dstReg: resultBinding
+ {
+ set_dst_reg(& $$, PROGRAM_OUTPUT, $1);
+ }
+ | USED_IDENTIFIER /* temporaryReg | vertexResultReg */
+ {
+ struct asm_symbol *const s = (struct asm_symbol *)
+ _mesa_symbol_table_find_symbol(state->st, 0, $1);
+
+ free($1);
+
+ if (s == NULL) {
+ yyerror(& @1, state, "invalid operand variable");
+ YYERROR;
+ } else if ((s->type != at_output) && (s->type != at_temp)) {
+ yyerror(& @1, state, "invalid operand variable");
+ YYERROR;
+ }
+
+ switch (s->type) {
+ case at_temp:
+ set_dst_reg(& $$, PROGRAM_TEMPORARY, s->temp_binding);
+ break;
+ case at_output:
+ set_dst_reg(& $$, PROGRAM_OUTPUT, s->output_binding);
+ break;
+ default:
+ set_dst_reg(& $$, s->param_binding_type, s->param_binding_begin);
+ break;
+ }
+ }
+ ;
+
+progParamArray: USED_IDENTIFIER
+ {
+ struct asm_symbol *const s = (struct asm_symbol *)
+ _mesa_symbol_table_find_symbol(state->st, 0, $1);
+
+ free($1);
+
+ if (s == NULL) {
+ yyerror(& @1, state, "invalid operand variable");
+ YYERROR;
+ } else if ((s->type != at_param) || !s->param_is_array) {
+ yyerror(& @1, state, "array access to non-PARAM variable");
+ YYERROR;
+ } else {
+ $$ = s;
+ }
+ }
+ ;
+
+progParamArrayMem: progParamArrayAbs | progParamArrayRel;
+
+progParamArrayAbs: INTEGER
+ {
+ init_src_reg(& $$);
+ $$.Base.Index = $1;
+ }
+ ;
+
+progParamArrayRel: addrReg addrComponent addrRegRelOffset
+ {
+ /* FINISHME: Add support for multiple address registers.
+ */
+ /* FINISHME: Add support for 4-component address registers.
+ */
+ init_src_reg(& $$);
+ $$.Base.RelAddr = 1;
+ $$.Base.Index = $3;
+ }
+ ;
+
+addrRegRelOffset: { $$ = 0; }
+ | '+' addrRegPosOffset { $$ = $2; }
+ | '-' addrRegNegOffset { $$ = -$2; }
+ ;
+
+addrRegPosOffset: INTEGER
+ {
+ if (($1 < 0) || ($1 > (state->limits->MaxAddressOffset - 1))) {
+ char s[100];
+ _mesa_snprintf(s, sizeof(s),
+ "relative address offset too large (%d)", $1);
+ yyerror(& @1, state, s);
+ YYERROR;
+ } else {
+ $$ = $1;
+ }
+ }
+ ;
+
+addrRegNegOffset: INTEGER
+ {
+ if (($1 < 0) || ($1 > state->limits->MaxAddressOffset)) {
+ char s[100];
+ _mesa_snprintf(s, sizeof(s),
+ "relative address offset too large (%d)", $1);
+ yyerror(& @1, state, s);
+ YYERROR;
+ } else {
+ $$ = $1;
+ }
+ }
+ ;
+
+addrReg: USED_IDENTIFIER
+ {
+ struct asm_symbol *const s = (struct asm_symbol *)
+ _mesa_symbol_table_find_symbol(state->st, 0, $1);
+
+ free($1);
+
+ if (s == NULL) {
+ yyerror(& @1, state, "invalid array member");
+ YYERROR;
+ } else if (s->type != at_address) {
+ yyerror(& @1, state,
+ "invalid variable for indexed array access");
+ YYERROR;
+ } else {
+ $$ = s;
+ }
+ }
+ ;
+
+addrComponent: MASK1
+ {
+ if ($1.mask != WRITEMASK_X) {
+ yyerror(& @1, state, "invalid address component selector");
+ YYERROR;
+ } else {
+ $$ = $1;
+ }
+ }
+ ;
+
+addrWriteMask: MASK1
+ {
+ if ($1.mask != WRITEMASK_X) {
+ yyerror(& @1, state,
+ "address register write mask must be \".x\"");
+ YYERROR;
+ } else {
+ $$ = $1;
+ }
+ }
+ ;
+
+scalarSuffix: MASK1;
+
+swizzleSuffix: MASK1
+ | MASK4
+ | SWIZZLE
+ | { $$.swizzle = SWIZZLE_NOOP; $$.mask = WRITEMASK_XYZW; }
+ ;
+
+optionalMask: MASK4 | MASK3 | MASK2 | MASK1
+ | { $$.swizzle = SWIZZLE_NOOP; $$.mask = WRITEMASK_XYZW; }
+ ;
+
+optionalCcMask: '(' ccTest ')'
+ {
+ $$ = $2;
+ }
+ | '(' ccTest2 ')'
+ {
+ $$ = $2;
+ }
+ |
+ {
+ $$.CondMask = COND_TR;
+ $$.CondSwizzle = SWIZZLE_NOOP;
+ $$.CondSrc = 0;
+ }
+ ;
+
+ccTest: ccMaskRule swizzleSuffix
+ {
+ $$ = $1;
+ $$.CondSwizzle = $2.swizzle;
+ }
+ ;
+
+ccTest2: ccMaskRule2 swizzleSuffix
+ {
+ $$ = $1;
+ $$.CondSwizzle = $2.swizzle;
+ }
+ ;
+
+ccMaskRule: IDENTIFIER
+ {
+ const int cond = _mesa_parse_cc($1);
+ if ((cond == 0) || ($1[2] != '\0')) {
+ char *const err_str =
+ make_error_string("invalid condition code \"%s\"", $1);
+
+ yyerror(& @1, state, (err_str != NULL)
+ ? err_str : "invalid condition code");
+
+ if (err_str != NULL) {
+ free(err_str);
+ }
+
+ YYERROR;
+ }
+
+ $$.CondMask = cond;
+ $$.CondSwizzle = SWIZZLE_NOOP;
+ $$.CondSrc = 0;
+ }
+ ;
+
+ccMaskRule2: USED_IDENTIFIER
+ {
+ const int cond = _mesa_parse_cc($1);
+ if ((cond == 0) || ($1[2] != '\0')) {
+ char *const err_str =
+ make_error_string("invalid condition code \"%s\"", $1);
+
+ yyerror(& @1, state, (err_str != NULL)
+ ? err_str : "invalid condition code");
+
+ if (err_str != NULL) {
+ free(err_str);
+ }
+
+ YYERROR;
+ }
+
+ $$.CondMask = cond;
+ $$.CondSwizzle = SWIZZLE_NOOP;
+ $$.CondSrc = 0;
+ }
+ ;
+
+namingStatement: ATTRIB_statement
+ | PARAM_statement
+ | TEMP_statement
+ | ADDRESS_statement
+ | OUTPUT_statement
+ | ALIAS_statement
+ ;
+
+ATTRIB_statement: ATTRIB IDENTIFIER '=' attribBinding
+ {
+ struct asm_symbol *const s =
+ declare_variable(state, $2, at_attrib, & @2);
+
+ if (s == NULL) {
+ free($2);
+ YYERROR;
+ } else {
+ s->attrib_binding = $4;
+ state->InputsBound |= (1U << s->attrib_binding);
+
+ if (!validate_inputs(& @4, state)) {
+ YYERROR;
+ }
+ }
+ }
+ ;
+
+attribBinding: VERTEX vtxAttribItem
+ {
+ $$ = $2;
+ }
+ | FRAGMENT fragAttribItem
+ {
+ $$ = $2;
+ }
+ ;
+
+vtxAttribItem: POSITION
+ {
+ $$ = VERT_ATTRIB_POS;
+ }
+ | WEIGHT vtxOptWeightNum
+ {
+ $$ = VERT_ATTRIB_WEIGHT;
+ }
+ | NORMAL
+ {
+ $$ = VERT_ATTRIB_NORMAL;
+ }
+ | COLOR optColorType
+ {
+ if (!state->ctx->Extensions.EXT_secondary_color) {
+ yyerror(& @2, state, "GL_EXT_secondary_color not supported");
+ YYERROR;
+ }
+
+ $$ = VERT_ATTRIB_COLOR0 + $2;
+ }
+ | FOGCOORD
+ {
+ if (!state->ctx->Extensions.EXT_fog_coord) {
+ yyerror(& @1, state, "GL_EXT_fog_coord not supported");
+ YYERROR;
+ }
+
+ $$ = VERT_ATTRIB_FOG;
+ }
+ | TEXCOORD optTexCoordUnitNum
+ {
+ $$ = VERT_ATTRIB_TEX0 + $2;
+ }
+ | MATRIXINDEX '[' vtxWeightNum ']'
+ {
+ yyerror(& @1, state, "GL_ARB_matrix_palette not supported");
+ YYERROR;
+ }
+ | VTXATTRIB '[' vtxAttribNum ']'
+ {
+ $$ = VERT_ATTRIB_GENERIC0 + $3;
+ }
+ ;
+
+vtxAttribNum: INTEGER
+ {
+ if ((unsigned) $1 >= state->limits->MaxAttribs) {
+ yyerror(& @1, state, "invalid vertex attribute reference");
+ YYERROR;
+ }
+
+ $$ = $1;
+ }
+ ;
+
+vtxOptWeightNum: | '[' vtxWeightNum ']';
+vtxWeightNum: INTEGER;
+
+fragAttribItem: POSITION
+ {
+ $$ = FRAG_ATTRIB_WPOS;
+ }
+ | COLOR optColorType
+ {
+ $$ = FRAG_ATTRIB_COL0 + $2;
+ }
+ | FOGCOORD
+ {
+ $$ = FRAG_ATTRIB_FOGC;
+ }
+ | TEXCOORD optTexCoordUnitNum
+ {
+ $$ = FRAG_ATTRIB_TEX0 + $2;
+ }
+ ;
+
+PARAM_statement: PARAM_singleStmt | PARAM_multipleStmt;
+
+PARAM_singleStmt: PARAM IDENTIFIER paramSingleInit
+ {
+ struct asm_symbol *const s =
+ declare_variable(state, $2, at_param, & @2);
+
+ if (s == NULL) {
+ free($2);
+ YYERROR;
+ } else {
+ s->param_binding_type = $3.param_binding_type;
+ s->param_binding_begin = $3.param_binding_begin;
+ s->param_binding_length = $3.param_binding_length;
+ s->param_binding_swizzle = $3.param_binding_swizzle;
+ s->param_is_array = 0;
+ }
+ }
+ ;
+
+PARAM_multipleStmt: PARAM IDENTIFIER '[' optArraySize ']' paramMultipleInit
+ {
+ if (($4 != 0) && ((unsigned) $4 != $6.param_binding_length)) {
+ free($2);
+ yyerror(& @4, state,
+ "parameter array size and number of bindings must match");
+ YYERROR;
+ } else {
+ struct asm_symbol *const s =
+ declare_variable(state, $2, $6.type, & @2);
+
+ if (s == NULL) {
+ free($2);
+ YYERROR;
+ } else {
+ s->param_binding_type = $6.param_binding_type;
+ s->param_binding_begin = $6.param_binding_begin;
+ s->param_binding_length = $6.param_binding_length;
+ s->param_binding_swizzle = SWIZZLE_XYZW;
+ s->param_is_array = 1;
+ }
+ }
+ }
+ ;
+
+optArraySize:
+ {
+ $$ = 0;
+ }
+ | INTEGER
+ {
+ if (($1 < 1) || ((unsigned) $1 > state->limits->MaxParameters)) {
+ char msg[100];
+ _mesa_snprintf(msg, sizeof(msg),
+ "invalid parameter array size (size=%d max=%u)",
+ $1, state->limits->MaxParameters);
+ yyerror(& @1, state, msg);
+ YYERROR;
+ } else {
+ $$ = $1;
+ }
+ }
+ ;
+
+paramSingleInit: '=' paramSingleItemDecl
+ {
+ $$ = $2;
+ }
+ ;
+
+paramMultipleInit: '=' '{' paramMultInitList '}'
+ {
+ $$ = $3;
+ }
+ ;
+
+paramMultInitList: paramMultipleItem
+ | paramMultInitList ',' paramMultipleItem
+ {
+ $1.param_binding_length += $3.param_binding_length;
+ $$ = $1;
+ }
+ ;
+
+paramSingleItemDecl: stateSingleItem
+ {
+ memset(& $$, 0, sizeof($$));
+ $$.param_binding_begin = ~0;
+ initialize_symbol_from_state(state->prog, & $$, $1);
+ }
+ | programSingleItem
+ {
+ memset(& $$, 0, sizeof($$));
+ $$.param_binding_begin = ~0;
+ initialize_symbol_from_param(state->prog, & $$, $1);
+ }
+ | paramConstDecl
+ {
+ memset(& $$, 0, sizeof($$));
+ $$.param_binding_begin = ~0;
+ initialize_symbol_from_const(state->prog, & $$, & $1, GL_TRUE);
+ }
+ ;
+
+paramSingleItemUse: stateSingleItem
+ {
+ memset(& $$, 0, sizeof($$));
+ $$.param_binding_begin = ~0;
+ initialize_symbol_from_state(state->prog, & $$, $1);
+ }
+ | programSingleItem
+ {
+ memset(& $$, 0, sizeof($$));
+ $$.param_binding_begin = ~0;
+ initialize_symbol_from_param(state->prog, & $$, $1);
+ }
+ | paramConstUse
+ {
+ memset(& $$, 0, sizeof($$));
+ $$.param_binding_begin = ~0;
+ initialize_symbol_from_const(state->prog, & $$, & $1, GL_TRUE);
+ }
+ ;
+
+paramMultipleItem: stateMultipleItem
+ {
+ memset(& $$, 0, sizeof($$));
+ $$.param_binding_begin = ~0;
+ initialize_symbol_from_state(state->prog, & $$, $1);
+ }
+ | programMultipleItem
+ {
+ memset(& $$, 0, sizeof($$));
+ $$.param_binding_begin = ~0;
+ initialize_symbol_from_param(state->prog, & $$, $1);
+ }
+ | paramConstDecl
+ {
+ memset(& $$, 0, sizeof($$));
+ $$.param_binding_begin = ~0;
+ initialize_symbol_from_const(state->prog, & $$, & $1, GL_FALSE);
+ }
+ ;
+
+stateMultipleItem: stateSingleItem { memcpy($$, $1, sizeof($$)); }
+ | STATE stateMatrixRows { memcpy($$, $2, sizeof($$)); }
+ ;
+
+stateSingleItem: STATE stateMaterialItem { memcpy($$, $2, sizeof($$)); }
+ | STATE stateLightItem { memcpy($$, $2, sizeof($$)); }
+ | STATE stateLightModelItem { memcpy($$, $2, sizeof($$)); }
+ | STATE stateLightProdItem { memcpy($$, $2, sizeof($$)); }
+ | STATE stateTexGenItem { memcpy($$, $2, sizeof($$)); }
+ | STATE stateTexEnvItem { memcpy($$, $2, sizeof($$)); }
+ | STATE stateFogItem { memcpy($$, $2, sizeof($$)); }
+ | STATE stateClipPlaneItem { memcpy($$, $2, sizeof($$)); }
+ | STATE statePointItem { memcpy($$, $2, sizeof($$)); }
+ | STATE stateMatrixRow { memcpy($$, $2, sizeof($$)); }
+ | STATE stateDepthItem { memcpy($$, $2, sizeof($$)); }
+ ;
+
+stateMaterialItem: MATERIAL optFaceType stateMatProperty
+ {
+ memset($$, 0, sizeof($$));
+ $$[0] = STATE_MATERIAL;
+ $$[1] = $2;
+ $$[2] = $3;
+ }
+ ;
+
+stateMatProperty: ambDiffSpecProperty
+ {
+ $$ = $1;
+ }
+ | EMISSION
+ {
+ $$ = STATE_EMISSION;
+ }
+ | SHININESS
+ {
+ $$ = STATE_SHININESS;
+ }
+ ;
+
+stateLightItem: LIGHT '[' stateLightNumber ']' stateLightProperty
+ {
+ memset($$, 0, sizeof($$));
+ $$[0] = STATE_LIGHT;
+ $$[1] = $3;
+ $$[2] = $5;
+ }
+ ;
+
+stateLightProperty: ambDiffSpecProperty
+ {
+ $$ = $1;
+ }
+ | POSITION
+ {
+ $$ = STATE_POSITION;
+ }
+ | ATTENUATION
+ {
+ if (!state->ctx->Extensions.EXT_point_parameters) {
+ yyerror(& @1, state, "GL_ARB_point_parameters not supported");
+ YYERROR;
+ }
+
+ $$ = STATE_ATTENUATION;
+ }
+ | SPOT stateSpotProperty
+ {
+ $$ = $2;
+ }
+ | HALF
+ {
+ $$ = STATE_HALF_VECTOR;
+ }
+ ;
+
+stateSpotProperty: DIRECTION
+ {
+ $$ = STATE_SPOT_DIRECTION;
+ }
+ ;
+
+stateLightModelItem: LIGHTMODEL stateLModProperty
+ {
+ $$[0] = $2[0];
+ $$[1] = $2[1];
+ }
+ ;
+
+stateLModProperty: AMBIENT
+ {
+ memset($$, 0, sizeof($$));
+ $$[0] = STATE_LIGHTMODEL_AMBIENT;
+ }
+ | optFaceType SCENECOLOR
+ {
+ memset($$, 0, sizeof($$));
+ $$[0] = STATE_LIGHTMODEL_SCENECOLOR;
+ $$[1] = $1;
+ }
+ ;
+
+stateLightProdItem: LIGHTPROD '[' stateLightNumber ']' optFaceType stateLProdProperty
+ {
+ memset($$, 0, sizeof($$));
+ $$[0] = STATE_LIGHTPROD;
+ $$[1] = $3;
+ $$[2] = $5;
+ $$[3] = $6;
+ }
+ ;
+
+stateLProdProperty: ambDiffSpecProperty;
+
+stateTexEnvItem: TEXENV optLegacyTexUnitNum stateTexEnvProperty
+ {
+ memset($$, 0, sizeof($$));
+ $$[0] = $3;
+ $$[1] = $2;
+ }
+ ;
+
+stateTexEnvProperty: COLOR
+ {
+ $$ = STATE_TEXENV_COLOR;
+ }
+ ;
+
+ambDiffSpecProperty: AMBIENT
+ {
+ $$ = STATE_AMBIENT;
+ }
+ | DIFFUSE
+ {
+ $$ = STATE_DIFFUSE;
+ }
+ | SPECULAR
+ {
+ $$ = STATE_SPECULAR;
+ }
+ ;
+
+stateLightNumber: INTEGER
+ {
+ if ((unsigned) $1 >= state->MaxLights) {
+ yyerror(& @1, state, "invalid light selector");
+ YYERROR;
+ }
+
+ $$ = $1;
+ }
+ ;
+
+stateTexGenItem: TEXGEN optTexCoordUnitNum stateTexGenType stateTexGenCoord
+ {
+ memset($$, 0, sizeof($$));
+ $$[0] = STATE_TEXGEN;
+ $$[1] = $2;
+ $$[2] = $3 + $4;
+ }
+ ;
+
+stateTexGenType: EYE
+ {
+ $$ = STATE_TEXGEN_EYE_S;
+ }
+ | OBJECT
+ {
+ $$ = STATE_TEXGEN_OBJECT_S;
+ }
+ ;
+stateTexGenCoord: TEXGEN_S
+ {
+ $$ = STATE_TEXGEN_EYE_S - STATE_TEXGEN_EYE_S;
+ }
+ | TEXGEN_T
+ {
+ $$ = STATE_TEXGEN_EYE_T - STATE_TEXGEN_EYE_S;
+ }
+ | TEXGEN_R
+ {
+ $$ = STATE_TEXGEN_EYE_R - STATE_TEXGEN_EYE_S;
+ }
+ | TEXGEN_Q
+ {
+ $$ = STATE_TEXGEN_EYE_Q - STATE_TEXGEN_EYE_S;
+ }
+ ;
+
+stateFogItem: FOG stateFogProperty
+ {
+ memset($$, 0, sizeof($$));
+ $$[0] = $2;
+ }
+ ;
+
+stateFogProperty: COLOR
+ {
+ $$ = STATE_FOG_COLOR;
+ }
+ | PARAMS
+ {
+ $$ = STATE_FOG_PARAMS;
+ }
+ ;
+
+stateClipPlaneItem: CLIP '[' stateClipPlaneNum ']' PLANE
+ {
+ memset($$, 0, sizeof($$));
+ $$[0] = STATE_CLIPPLANE;
+ $$[1] = $3;
+ }
+ ;
+
+stateClipPlaneNum: INTEGER
+ {
+ if ((unsigned) $1 >= state->MaxClipPlanes) {
+ yyerror(& @1, state, "invalid clip plane selector");
+ YYERROR;
+ }
+
+ $$ = $1;
+ }
+ ;
+
+statePointItem: POINT_TOK statePointProperty
+ {
+ memset($$, 0, sizeof($$));
+ $$[0] = $2;
+ }
+ ;
+
+statePointProperty: SIZE_TOK
+ {
+ $$ = STATE_POINT_SIZE;
+ }
+ | ATTENUATION
+ {
+ $$ = STATE_POINT_ATTENUATION;
+ }
+ ;
+
+stateMatrixRow: stateMatrixItem ROW '[' stateMatrixRowNum ']'
+ {
+ $$[0] = $1[0];
+ $$[1] = $1[1];
+ $$[2] = $4;
+ $$[3] = $4;
+ $$[4] = $1[2];
+ }
+ ;
+
+stateMatrixRows: stateMatrixItem optMatrixRows
+ {
+ $$[0] = $1[0];
+ $$[1] = $1[1];
+ $$[2] = $2[2];
+ $$[3] = $2[3];
+ $$[4] = $1[2];
+ }
+ ;
+
+optMatrixRows:
+ {
+ $$[2] = 0;
+ $$[3] = 3;
+ }
+ | ROW '[' stateMatrixRowNum DOT_DOT stateMatrixRowNum ']'
+ {
+ /* It seems logical that the matrix row range specifier would have
+ * to specify a range or more than one row (i.e., $5 > $3).
+ * However, the ARB_vertex_program spec says "a program will fail
+ * to load if <a> is greater than <b>." This means that $3 == $5
+ * is valid.
+ */
+ if ($3 > $5) {
+ yyerror(& @3, state, "invalid matrix row range");
+ YYERROR;
+ }
+
+ $$[2] = $3;
+ $$[3] = $5;
+ }
+ ;
+
+stateMatrixItem: MATRIX stateMatrixName stateOptMatModifier
+ {
+ $$[0] = $2[0];
+ $$[1] = $2[1];
+ $$[2] = $3;
+ }
+ ;
+
+stateOptMatModifier:
+ {
+ $$ = 0;
+ }
+ | stateMatModifier
+ {
+ $$ = $1;
+ }
+ ;
+
+stateMatModifier: INVERSE
+ {
+ $$ = STATE_MATRIX_INVERSE;
+ }
+ | TRANSPOSE
+ {
+ $$ = STATE_MATRIX_TRANSPOSE;
+ }
+ | INVTRANS
+ {
+ $$ = STATE_MATRIX_INVTRANS;
+ }
+ ;
+
+stateMatrixRowNum: INTEGER
+ {
+ if ($1 > 3) {
+ yyerror(& @1, state, "invalid matrix row reference");
+ YYERROR;
+ }
+
+ $$ = $1;
+ }
+ ;
+
+stateMatrixName: MODELVIEW stateOptModMatNum
+ {
+ $$[0] = STATE_MODELVIEW_MATRIX;
+ $$[1] = $2;
+ }
+ | PROJECTION
+ {
+ $$[0] = STATE_PROJECTION_MATRIX;
+ $$[1] = 0;
+ }
+ | MVP
+ {
+ $$[0] = STATE_MVP_MATRIX;
+ $$[1] = 0;
+ }
+ | TEXTURE optTexCoordUnitNum
+ {
+ $$[0] = STATE_TEXTURE_MATRIX;
+ $$[1] = $2;
+ }
+ | PALETTE '[' statePaletteMatNum ']'
+ {
+ yyerror(& @1, state, "GL_ARB_matrix_palette not supported");
+ YYERROR;
+ }
+ | MAT_PROGRAM '[' stateProgramMatNum ']'
+ {
+ $$[0] = STATE_PROGRAM_MATRIX;
+ $$[1] = $3;
+ }
+ ;
+
+stateOptModMatNum:
+ {
+ $$ = 0;
+ }
+ | '[' stateModMatNum ']'
+ {
+ $$ = $2;
+ }
+ ;
+stateModMatNum: INTEGER
+ {
+ /* Since GL_ARB_vertex_blend isn't supported, only modelview matrix
+ * zero is valid.
+ */
+ if ($1 != 0) {
+ yyerror(& @1, state, "invalid modelview matrix index");
+ YYERROR;
+ }
+
+ $$ = $1;
+ }
+ ;
+statePaletteMatNum: INTEGER
+ {
+ /* Since GL_ARB_matrix_palette isn't supported, just let any value
+ * through here. The error will be generated later.
+ */
+ $$ = $1;
+ }
+ ;
+stateProgramMatNum: INTEGER
+ {
+ if ((unsigned) $1 >= state->MaxProgramMatrices) {
+ yyerror(& @1, state, "invalid program matrix selector");
+ YYERROR;
+ }
+
+ $$ = $1;
+ }
+ ;
+
+stateDepthItem: DEPTH RANGE
+ {
+ memset($$, 0, sizeof($$));
+ $$[0] = STATE_DEPTH_RANGE;
+ }
+ ;
+
+
+programSingleItem: progEnvParam | progLocalParam;
+
+programMultipleItem: progEnvParams | progLocalParams;
+
+progEnvParams: PROGRAM ENV '[' progEnvParamNums ']'
+ {
+ memset($$, 0, sizeof($$));
+ $$[0] = state->state_param_enum;
+ $$[1] = STATE_ENV;
+ $$[2] = $4[0];
+ $$[3] = $4[1];
+ }
+ ;
+
+progEnvParamNums: progEnvParamNum
+ {
+ $$[0] = $1;
+ $$[1] = $1;
+ }
+ | progEnvParamNum DOT_DOT progEnvParamNum
+ {
+ $$[0] = $1;
+ $$[1] = $3;
+ }
+ ;
+
+progEnvParam: PROGRAM ENV '[' progEnvParamNum ']'
+ {
+ memset($$, 0, sizeof($$));
+ $$[0] = state->state_param_enum;
+ $$[1] = STATE_ENV;
+ $$[2] = $4;
+ $$[3] = $4;
+ }
+ ;
+
+progLocalParams: PROGRAM LOCAL '[' progLocalParamNums ']'
+ {
+ memset($$, 0, sizeof($$));
+ $$[0] = state->state_param_enum;
+ $$[1] = STATE_LOCAL;
+ $$[2] = $4[0];
+ $$[3] = $4[1];
+ }
+
+progLocalParamNums: progLocalParamNum
+ {
+ $$[0] = $1;
+ $$[1] = $1;
+ }
+ | progLocalParamNum DOT_DOT progLocalParamNum
+ {
+ $$[0] = $1;
+ $$[1] = $3;
+ }
+ ;
+
+progLocalParam: PROGRAM LOCAL '[' progLocalParamNum ']'
+ {
+ memset($$, 0, sizeof($$));
+ $$[0] = state->state_param_enum;
+ $$[1] = STATE_LOCAL;
+ $$[2] = $4;
+ $$[3] = $4;
+ }
+ ;
+
+progEnvParamNum: INTEGER
+ {
+ if ((unsigned) $1 >= state->limits->MaxEnvParams) {
+ yyerror(& @1, state, "invalid environment parameter reference");
+ YYERROR;
+ }
+ $$ = $1;
+ }
+ ;
+
+progLocalParamNum: INTEGER
+ {
+ if ((unsigned) $1 >= state->limits->MaxLocalParams) {
+ yyerror(& @1, state, "invalid local parameter reference");
+ YYERROR;
+ }
+ $$ = $1;
+ }
+ ;
+
+
+
+paramConstDecl: paramConstScalarDecl | paramConstVector;
+paramConstUse: paramConstScalarUse | paramConstVector;
+
+paramConstScalarDecl: signedFloatConstant
+ {
+ $$.count = 4;
+ $$.data[0] = $1;
+ $$.data[1] = $1;
+ $$.data[2] = $1;
+ $$.data[3] = $1;
+ }
+ ;
+
+paramConstScalarUse: REAL
+ {
+ $$.count = 1;
+ $$.data[0] = $1;
+ $$.data[1] = $1;
+ $$.data[2] = $1;
+ $$.data[3] = $1;
+ }
+ | INTEGER
+ {
+ $$.count = 1;
+ $$.data[0] = (float) $1;
+ $$.data[1] = (float) $1;
+ $$.data[2] = (float) $1;
+ $$.data[3] = (float) $1;
+ }
+ ;
+
+paramConstVector: '{' signedFloatConstant '}'
+ {
+ $$.count = 4;
+ $$.data[0] = $2;
+ $$.data[1] = 0.0f;
+ $$.data[2] = 0.0f;
+ $$.data[3] = 1.0f;
+ }
+ | '{' signedFloatConstant ',' signedFloatConstant '}'
+ {
+ $$.count = 4;
+ $$.data[0] = $2;
+ $$.data[1] = $4;
+ $$.data[2] = 0.0f;
+ $$.data[3] = 1.0f;
+ }
+ | '{' signedFloatConstant ',' signedFloatConstant ','
+ signedFloatConstant '}'
+ {
+ $$.count = 4;
+ $$.data[0] = $2;
+ $$.data[1] = $4;
+ $$.data[2] = $6;
+ $$.data[3] = 1.0f;
+ }
+ | '{' signedFloatConstant ',' signedFloatConstant ','
+ signedFloatConstant ',' signedFloatConstant '}'
+ {
+ $$.count = 4;
+ $$.data[0] = $2;
+ $$.data[1] = $4;
+ $$.data[2] = $6;
+ $$.data[3] = $8;
+ }
+ ;
+
+signedFloatConstant: optionalSign REAL
+ {
+ $$ = ($1) ? -$2 : $2;
+ }
+ | optionalSign INTEGER
+ {
+ $$ = (float)(($1) ? -$2 : $2);
+ }
+ ;
+
+optionalSign: '+' { $$ = FALSE; }
+ | '-' { $$ = TRUE; }
+ | { $$ = FALSE; }
+ ;
+
+TEMP_statement: optVarSize TEMP { $<integer>$ = $2; } varNameList
+ ;
+
+optVarSize: string
+ {
+ /* NV_fragment_program_option defines the size qualifiers in a
+ * fairly broken way. "SHORT" or "LONG" can optionally be used
+ * before TEMP or OUTPUT. However, neither is a reserved word!
+ * This means that we have to parse it as an identifier, then check
+ * to make sure it's one of the valid values. *sigh*
+ *
+ * In addition, the grammar in the extension spec does *not* allow
+ * the size specifier to be optional, but all known implementations
+ * do.
+ */
+ if (!state->option.NV_fragment) {
+ yyerror(& @1, state, "unexpected IDENTIFIER");
+ YYERROR;
+ }
+
+ if (strcmp("SHORT", $1) == 0) {
+ } else if (strcmp("LONG", $1) == 0) {
+ } else {
+ char *const err_str =
+ make_error_string("invalid storage size specifier \"%s\"",
+ $1);
+
+ yyerror(& @1, state, (err_str != NULL)
+ ? err_str : "invalid storage size specifier");
+
+ if (err_str != NULL) {
+ free(err_str);
+ }
+
+ YYERROR;
+ }
+ }
+ |
+ {
+ }
+ ;
+
+ADDRESS_statement: ADDRESS { $<integer>$ = $1; } varNameList
+ ;
+
+varNameList: varNameList ',' IDENTIFIER
+ {
+ if (!declare_variable(state, $3, $<integer>0, & @3)) {
+ free($3);
+ YYERROR;
+ }
+ }
+ | IDENTIFIER
+ {
+ if (!declare_variable(state, $1, $<integer>0, & @1)) {
+ free($1);
+ YYERROR;
+ }
+ }
+ ;
+
+OUTPUT_statement: optVarSize OUTPUT IDENTIFIER '=' resultBinding
+ {
+ struct asm_symbol *const s =
+ declare_variable(state, $3, at_output, & @3);
+
+ if (s == NULL) {
+ free($3);
+ YYERROR;
+ } else {
+ s->output_binding = $5;
+ }
+ }
+ ;
+
+resultBinding: RESULT POSITION
+ {
+ if (state->mode == ARB_vertex) {
+ $$ = VERT_RESULT_HPOS;
+ } else {
+ yyerror(& @2, state, "invalid program result name");
+ YYERROR;
+ }
+ }
+ | RESULT FOGCOORD
+ {
+ if (state->mode == ARB_vertex) {
+ $$ = VERT_RESULT_FOGC;
+ } else {
+ yyerror(& @2, state, "invalid program result name");
+ YYERROR;
+ }
+ }
+ | RESULT resultColBinding
+ {
+ $$ = $2;
+ }
+ | RESULT POINTSIZE
+ {
+ if (state->mode == ARB_vertex) {
+ $$ = VERT_RESULT_PSIZ;
+ } else {
+ yyerror(& @2, state, "invalid program result name");
+ YYERROR;
+ }
+ }
+ | RESULT TEXCOORD optTexCoordUnitNum
+ {
+ if (state->mode == ARB_vertex) {
+ $$ = VERT_RESULT_TEX0 + $3;
+ } else {
+ yyerror(& @2, state, "invalid program result name");
+ YYERROR;
+ }
+ }
+ | RESULT DEPTH
+ {
+ if (state->mode == ARB_fragment) {
+ $$ = FRAG_RESULT_DEPTH;
+ } else {
+ yyerror(& @2, state, "invalid program result name");
+ YYERROR;
+ }
+ }
+ ;
+
+resultColBinding: COLOR optResultFaceType optResultColorType
+ {
+ $$ = $2 + $3;
+ }
+ ;
+
+optResultFaceType:
+ {
+ if (state->mode == ARB_vertex) {
+ $$ = VERT_RESULT_COL0;
+ } else {
+ if (state->option.DrawBuffers)
+ $$ = FRAG_RESULT_DATA0;
+ else
+ $$ = FRAG_RESULT_COLOR;
+ }
+ }
+ | '[' INTEGER ']'
+ {
+ if (state->mode == ARB_vertex) {
+ yyerror(& @1, state, "invalid program result name");
+ YYERROR;
+ } else {
+ if (!state->option.DrawBuffers) {
+ /* From the ARB_draw_buffers spec (same text exists
+ * for ATI_draw_buffers):
+ *
+ * If this option is not specified, a fragment
+ * program that attempts to bind
+ * "result.color[n]" will fail to load, and only
+ * "result.color" will be allowed.
+ */
+ yyerror(& @1, state,
+ "result.color[] used without "
+ "`OPTION ARB_draw_buffers' or "
+ "`OPTION ATI_draw_buffers'");
+ YYERROR;
+ } else if ($2 >= state->MaxDrawBuffers) {
+ yyerror(& @1, state,
+ "result.color[] exceeds MAX_DRAW_BUFFERS_ARB");
+ YYERROR;
+ }
+ $$ = FRAG_RESULT_DATA0 + $2;
+ }
+ }
+ | FRONT
+ {
+ if (state->mode == ARB_vertex) {
+ $$ = VERT_RESULT_COL0;
+ } else {
+ yyerror(& @1, state, "invalid program result name");
+ YYERROR;
+ }
+ }
+ | BACK
+ {
+ if (state->mode == ARB_vertex) {
+ $$ = VERT_RESULT_BFC0;
+ } else {
+ yyerror(& @1, state, "invalid program result name");
+ YYERROR;
+ }
+ }
+ ;
+
+optResultColorType:
+ {
+ $$ = 0;
+ }
+ | PRIMARY
+ {
+ if (state->mode == ARB_vertex) {
+ $$ = 0;
+ } else {
+ yyerror(& @1, state, "invalid program result name");
+ YYERROR;
+ }
+ }
+ | SECONDARY
+ {
+ if (state->mode == ARB_vertex) {
+ $$ = 1;
+ } else {
+ yyerror(& @1, state, "invalid program result name");
+ YYERROR;
+ }
+ }
+ ;
+
+optFaceType: { $$ = 0; }
+ | FRONT { $$ = 0; }
+ | BACK { $$ = 1; }
+ ;
+
+optColorType: { $$ = 0; }
+ | PRIMARY { $$ = 0; }
+ | SECONDARY { $$ = 1; }
+ ;
+
+optTexCoordUnitNum: { $$ = 0; }
+ | '[' texCoordUnitNum ']' { $$ = $2; }
+ ;
+
+optTexImageUnitNum: { $$ = 0; }
+ | '[' texImageUnitNum ']' { $$ = $2; }
+ ;
+
+optLegacyTexUnitNum: { $$ = 0; }
+ | '[' legacyTexUnitNum ']' { $$ = $2; }
+ ;
+
+texCoordUnitNum: INTEGER
+ {
+ if ((unsigned) $1 >= state->MaxTextureCoordUnits) {
+ yyerror(& @1, state, "invalid texture coordinate unit selector");
+ YYERROR;
+ }
+
+ $$ = $1;
+ }
+ ;
+
+texImageUnitNum: INTEGER
+ {
+ if ((unsigned) $1 >= state->MaxTextureImageUnits) {
+ yyerror(& @1, state, "invalid texture image unit selector");
+ YYERROR;
+ }
+
+ $$ = $1;
+ }
+ ;
+
+legacyTexUnitNum: INTEGER
+ {
+ if ((unsigned) $1 >= state->MaxTextureUnits) {
+ yyerror(& @1, state, "invalid texture unit selector");
+ YYERROR;
+ }
+
+ $$ = $1;
+ }
+ ;
+
+ALIAS_statement: ALIAS IDENTIFIER '=' USED_IDENTIFIER
+ {
+ struct asm_symbol *exist = (struct asm_symbol *)
+ _mesa_symbol_table_find_symbol(state->st, 0, $2);
+ struct asm_symbol *target = (struct asm_symbol *)
+ _mesa_symbol_table_find_symbol(state->st, 0, $4);
+
+ free($4);
+
+ if (exist != NULL) {
+ char m[1000];
+ _mesa_snprintf(m, sizeof(m), "redeclared identifier: %s", $2);
+ free($2);
+ yyerror(& @2, state, m);
+ YYERROR;
+ } else if (target == NULL) {
+ free($2);
+ yyerror(& @4, state,
+ "undefined variable binding in ALIAS statement");
+ YYERROR;
+ } else {
+ _mesa_symbol_table_add_symbol(state->st, 0, $2, target);
+ }
+ }
+ ;
+
+string: IDENTIFIER
+ | USED_IDENTIFIER
+ ;
+
+%%
+
+void
+asm_instruction_set_operands(struct asm_instruction *inst,
+ const struct prog_dst_register *dst,
+ const struct asm_src_register *src0,
+ const struct asm_src_register *src1,
+ const struct asm_src_register *src2)
+{
+ /* In the core ARB extensions only the KIL instruction doesn't have a
+ * destination register.
+ */
+ if (dst == NULL) {
+ init_dst_reg(& inst->Base.DstReg);
+ } else {
+ inst->Base.DstReg = *dst;
+ }
+
+ /* The only instruction that doesn't have any source registers is the
+ * condition-code based KIL instruction added by NV_fragment_program_option.
+ */
+ if (src0 != NULL) {
+ inst->Base.SrcReg[0] = src0->Base;
+ inst->SrcReg[0] = *src0;
+ } else {
+ init_src_reg(& inst->SrcReg[0]);
+ }
+
+ if (src1 != NULL) {
+ inst->Base.SrcReg[1] = src1->Base;
+ inst->SrcReg[1] = *src1;
+ } else {
+ init_src_reg(& inst->SrcReg[1]);
+ }
+
+ if (src2 != NULL) {
+ inst->Base.SrcReg[2] = src2->Base;
+ inst->SrcReg[2] = *src2;
+ } else {
+ init_src_reg(& inst->SrcReg[2]);
+ }
+}
+
+
+struct asm_instruction *
+asm_instruction_ctor(gl_inst_opcode op,
+ const struct prog_dst_register *dst,
+ const struct asm_src_register *src0,
+ const struct asm_src_register *src1,
+ const struct asm_src_register *src2)
+{
+ struct asm_instruction *inst = CALLOC_STRUCT(asm_instruction);
+
+ if (inst) {
+ _mesa_init_instructions(& inst->Base, 1);
+ inst->Base.Opcode = op;
+
+ asm_instruction_set_operands(inst, dst, src0, src1, src2);
+ }
+
+ return inst;
+}
+
+
+struct asm_instruction *
+asm_instruction_copy_ctor(const struct prog_instruction *base,
+ const struct prog_dst_register *dst,
+ const struct asm_src_register *src0,
+ const struct asm_src_register *src1,
+ const struct asm_src_register *src2)
+{
+ struct asm_instruction *inst = CALLOC_STRUCT(asm_instruction);
+
+ if (inst) {
+ _mesa_init_instructions(& inst->Base, 1);
+ inst->Base.Opcode = base->Opcode;
+ inst->Base.CondUpdate = base->CondUpdate;
+ inst->Base.CondDst = base->CondDst;
+ inst->Base.SaturateMode = base->SaturateMode;
+ inst->Base.Precision = base->Precision;
+
+ asm_instruction_set_operands(inst, dst, src0, src1, src2);
+ }
+
+ return inst;
+}
+
+
+void
+init_dst_reg(struct prog_dst_register *r)
+{
+ memset(r, 0, sizeof(*r));
+ r->File = PROGRAM_UNDEFINED;
+ r->WriteMask = WRITEMASK_XYZW;
+ r->CondMask = COND_TR;
+ r->CondSwizzle = SWIZZLE_NOOP;
+}
+
+
+/** Like init_dst_reg() but set the File and Index fields. */
+void
+set_dst_reg(struct prog_dst_register *r, gl_register_file file, GLint index)
+{
+ const GLint maxIndex = 1 << INST_INDEX_BITS;
+ const GLint minIndex = 0;
+ ASSERT(index >= minIndex);
+ (void) minIndex;
+ ASSERT(index <= maxIndex);
+ (void) maxIndex;
+ ASSERT(file == PROGRAM_TEMPORARY ||
+ file == PROGRAM_ADDRESS ||
+ file == PROGRAM_OUTPUT);
+ memset(r, 0, sizeof(*r));
+ r->File = file;
+ r->Index = index;
+ r->WriteMask = WRITEMASK_XYZW;
+ r->CondMask = COND_TR;
+ r->CondSwizzle = SWIZZLE_NOOP;
+}
+
+
+void
+init_src_reg(struct asm_src_register *r)
+{
+ memset(r, 0, sizeof(*r));
+ r->Base.File = PROGRAM_UNDEFINED;
+ r->Base.Swizzle = SWIZZLE_NOOP;
+ r->Symbol = NULL;
+}
+
+
+/** Like init_src_reg() but set the File and Index fields.
+ * \return GL_TRUE if a valid src register, GL_FALSE otherwise
+ */
+void
+set_src_reg(struct asm_src_register *r, gl_register_file file, GLint index)
+{
+ set_src_reg_swz(r, file, index, SWIZZLE_XYZW);
+}
+
+
+void
+set_src_reg_swz(struct asm_src_register *r, gl_register_file file, GLint index,
+ GLuint swizzle)
+{
+ const GLint maxIndex = (1 << INST_INDEX_BITS) - 1;
+ const GLint minIndex = -(1 << INST_INDEX_BITS);
+ ASSERT(file < PROGRAM_FILE_MAX);
+ ASSERT(index >= minIndex);
+ (void) minIndex;
+ ASSERT(index <= maxIndex);
+ (void) maxIndex;
+ memset(r, 0, sizeof(*r));
+ r->Base.File = file;
+ r->Base.Index = index;
+ r->Base.Swizzle = swizzle;
+ r->Symbol = NULL;
+}
+
+
+/**
+ * Validate the set of inputs used by a program
+ *
+ * Validates that legal sets of inputs are used by the program. In this case
+ * "used" included both reading the input or binding the input to a name using
+ * the \c ATTRIB command.
+ *
+ * \return
+ * \c TRUE if the combination of inputs used is valid, \c FALSE otherwise.
+ */
+int
+validate_inputs(struct YYLTYPE *locp, struct asm_parser_state *state)
+{
+ const int inputs = state->prog->InputsRead | state->InputsBound;
+
+ if (((inputs & 0x0ffff) & (inputs >> 16)) != 0) {
+ yyerror(locp, state, "illegal use of generic attribute and name attribute");
+ return 0;
+ }
+
+ return 1;
+}
+
+
+struct asm_symbol *
+declare_variable(struct asm_parser_state *state, char *name, enum asm_type t,
+ struct YYLTYPE *locp)
+{
+ struct asm_symbol *s = NULL;
+ struct asm_symbol *exist = (struct asm_symbol *)
+ _mesa_symbol_table_find_symbol(state->st, 0, name);
+
+
+ if (exist != NULL) {
+ yyerror(locp, state, "redeclared identifier");
+ } else {
+ s = calloc(1, sizeof(struct asm_symbol));
+ s->name = name;
+ s->type = t;
+
+ switch (t) {
+ case at_temp:
+ if (state->prog->NumTemporaries >= state->limits->MaxTemps) {
+ yyerror(locp, state, "too many temporaries declared");
+ free(s);
+ return NULL;
+ }
+
+ s->temp_binding = state->prog->NumTemporaries;
+ state->prog->NumTemporaries++;
+ break;
+
+ case at_address:
+ if (state->prog->NumAddressRegs >= state->limits->MaxAddressRegs) {
+ yyerror(locp, state, "too many address registers declared");
+ free(s);
+ return NULL;
+ }
+
+ /* FINISHME: Add support for multiple address registers.
+ */
+ state->prog->NumAddressRegs++;
+ break;
+
+ default:
+ break;
+ }
+
+ _mesa_symbol_table_add_symbol(state->st, 0, s->name, s);
+ s->next = state->sym;
+ state->sym = s;
+ }
+
+ return s;
+}
+
+
+int add_state_reference(struct gl_program_parameter_list *param_list,
+ const gl_state_index tokens[STATE_LENGTH])
+{
+ const GLuint size = 4; /* XXX fix */
+ char *name;
+ GLint index;
+
+ name = _mesa_program_state_string(tokens);
+ index = _mesa_add_parameter(param_list, PROGRAM_STATE_VAR, name,
+ size, GL_NONE, NULL, tokens, 0x0);
+ param_list->StateFlags |= _mesa_program_state_flags(tokens);
+
+ /* free name string here since we duplicated it in add_parameter() */
+ free(name);
+
+ return index;
+}
+
+
+int
+initialize_symbol_from_state(struct gl_program *prog,
+ struct asm_symbol *param_var,
+ const gl_state_index tokens[STATE_LENGTH])
+{
+ int idx = -1;
+ gl_state_index state_tokens[STATE_LENGTH];
+
+
+ memcpy(state_tokens, tokens, sizeof(state_tokens));
+
+ param_var->type = at_param;
+ param_var->param_binding_type = PROGRAM_STATE_VAR;
+
+ /* If we are adding a STATE_MATRIX that has multiple rows, we need to
+ * unroll it and call add_state_reference() for each row
+ */
+ if ((state_tokens[0] == STATE_MODELVIEW_MATRIX ||
+ state_tokens[0] == STATE_PROJECTION_MATRIX ||
+ state_tokens[0] == STATE_MVP_MATRIX ||
+ state_tokens[0] == STATE_TEXTURE_MATRIX ||
+ state_tokens[0] == STATE_PROGRAM_MATRIX)
+ && (state_tokens[2] != state_tokens[3])) {
+ int row;
+ const int first_row = state_tokens[2];
+ const int last_row = state_tokens[3];
+
+ for (row = first_row; row <= last_row; row++) {
+ state_tokens[2] = state_tokens[3] = row;
+
+ idx = add_state_reference(prog->Parameters, state_tokens);
+ if (param_var->param_binding_begin == ~0U) {
+ param_var->param_binding_begin = idx;
+ param_var->param_binding_swizzle = SWIZZLE_XYZW;
+ }
+
+ param_var->param_binding_length++;
+ }
+ }
+ else {
+ idx = add_state_reference(prog->Parameters, state_tokens);
+ if (param_var->param_binding_begin == ~0U) {
+ param_var->param_binding_begin = idx;
+ param_var->param_binding_swizzle = SWIZZLE_XYZW;
+ }
+ param_var->param_binding_length++;
+ }
+
+ return idx;
+}
+
+
+int
+initialize_symbol_from_param(struct gl_program *prog,
+ struct asm_symbol *param_var,
+ const gl_state_index tokens[STATE_LENGTH])
+{
+ int idx = -1;
+ gl_state_index state_tokens[STATE_LENGTH];
+
+
+ memcpy(state_tokens, tokens, sizeof(state_tokens));
+
+ assert((state_tokens[0] == STATE_VERTEX_PROGRAM)
+ || (state_tokens[0] == STATE_FRAGMENT_PROGRAM));
+ assert((state_tokens[1] == STATE_ENV)
+ || (state_tokens[1] == STATE_LOCAL));
+
+ /*
+ * The param type is STATE_VAR. The program parameter entry will
+ * effectively be a pointer into the LOCAL or ENV parameter array.
+ */
+ param_var->type = at_param;
+ param_var->param_binding_type = PROGRAM_STATE_VAR;
+
+ /* If we are adding a STATE_ENV or STATE_LOCAL that has multiple elements,
+ * we need to unroll it and call add_state_reference() for each row
+ */
+ if (state_tokens[2] != state_tokens[3]) {
+ int row;
+ const int first_row = state_tokens[2];
+ const int last_row = state_tokens[3];
+
+ for (row = first_row; row <= last_row; row++) {
+ state_tokens[2] = state_tokens[3] = row;
+
+ idx = add_state_reference(prog->Parameters, state_tokens);
+ if (param_var->param_binding_begin == ~0U) {
+ param_var->param_binding_begin = idx;
+ param_var->param_binding_swizzle = SWIZZLE_XYZW;
+ }
+ param_var->param_binding_length++;
+ }
+ }
+ else {
+ idx = add_state_reference(prog->Parameters, state_tokens);
+ if (param_var->param_binding_begin == ~0U) {
+ param_var->param_binding_begin = idx;
+ param_var->param_binding_swizzle = SWIZZLE_XYZW;
+ }
+ param_var->param_binding_length++;
+ }
+
+ return idx;
+}
+
+
+/**
+ * Put a float/vector constant/literal into the parameter list.
+ * \param param_var returns info about the parameter/constant's location,
+ * binding, type, etc.
+ * \param vec the vector/constant to add
+ * \param allowSwizzle if true, try to consolidate constants which only differ
+ * by a swizzle. We don't want to do this when building
+ * arrays of constants that may be indexed indirectly.
+ * \return index of the constant in the parameter list.
+ */
+int
+initialize_symbol_from_const(struct gl_program *prog,
+ struct asm_symbol *param_var,
+ const struct asm_vector *vec,
+ GLboolean allowSwizzle)
+{
+ unsigned swizzle;
+ const int idx = _mesa_add_unnamed_constant(prog->Parameters,
+ vec->data, vec->count,
+ allowSwizzle ? &swizzle : NULL);
+
+ param_var->type = at_param;
+ param_var->param_binding_type = PROGRAM_CONSTANT;
+
+ if (param_var->param_binding_begin == ~0U) {
+ param_var->param_binding_begin = idx;
+ param_var->param_binding_swizzle = allowSwizzle ? swizzle : SWIZZLE_XYZW;
+ }
+ param_var->param_binding_length++;
+
+ return idx;
+}
+
+
+char *
+make_error_string(const char *fmt, ...)
+{
+ int length;
+ char *str;
+ va_list args;
+
+
+ /* Call vsnprintf once to determine how large the final string is. Call it
+ * again to do the actual formatting. from the vsnprintf manual page:
+ *
+ * Upon successful return, these functions return the number of
+ * characters printed (not including the trailing '\0' used to end
+ * output to strings).
+ */
+ va_start(args, fmt);
+ length = 1 + vsnprintf(NULL, 0, fmt, args);
+ va_end(args);
+
+ str = malloc(length);
+ if (str) {
+ va_start(args, fmt);
+ vsnprintf(str, length, fmt, args);
+ va_end(args);
+ }
+
+ return str;
+}
+
+
+void
+yyerror(YYLTYPE *locp, struct asm_parser_state *state, const char *s)
+{
+ char *err_str;
+
+
+ err_str = make_error_string("glProgramStringARB(%s)\n", s);
+ if (err_str) {
+ _mesa_error(state->ctx, GL_INVALID_OPERATION, "%s", err_str);
+ free(err_str);
+ }
+
+ err_str = make_error_string("line %u, char %u: error: %s\n",
+ locp->first_line, locp->first_column, s);
+ _mesa_set_program_error(state->ctx, locp->position, err_str);
+
+ if (err_str) {
+ free(err_str);
+ }
+}
+
+
+GLboolean
+_mesa_parse_arb_program(struct gl_context *ctx, GLenum target, const GLubyte *str,
+ GLsizei len, struct asm_parser_state *state)
+{
+ struct asm_instruction *inst;
+ unsigned i;
+ GLubyte *strz;
+ GLboolean result = GL_FALSE;
+ void *temp;
+ struct asm_symbol *sym;
+
+ state->ctx = ctx;
+ state->prog->Target = target;
+ state->prog->Parameters = _mesa_new_parameter_list();
+
+ /* Make a copy of the program string and force it to be NUL-terminated.
+ */
+ strz = (GLubyte *) malloc(len + 1);
+ if (strz == NULL) {
+ _mesa_error(ctx, GL_OUT_OF_MEMORY, "glProgramStringARB");
+ return GL_FALSE;
+ }
+ memcpy (strz, str, len);
+ strz[len] = '\0';
+
+ state->prog->String = strz;
+
+ state->st = _mesa_symbol_table_ctor();
+
+ state->limits = (target == GL_VERTEX_PROGRAM_ARB)
+ ? & ctx->Const.VertexProgram
+ : & ctx->Const.FragmentProgram;
+
+ state->MaxTextureImageUnits = ctx->Const.MaxTextureImageUnits;
+ state->MaxTextureCoordUnits = ctx->Const.MaxTextureCoordUnits;
+ state->MaxTextureUnits = ctx->Const.MaxTextureUnits;
+ state->MaxClipPlanes = ctx->Const.MaxClipPlanes;
+ state->MaxLights = ctx->Const.MaxLights;
+ state->MaxProgramMatrices = ctx->Const.MaxProgramMatrices;
+ state->MaxDrawBuffers = ctx->Const.MaxDrawBuffers;
+
+ state->state_param_enum = (target == GL_VERTEX_PROGRAM_ARB)
+ ? STATE_VERTEX_PROGRAM : STATE_FRAGMENT_PROGRAM;
+
+ _mesa_set_program_error(ctx, -1, NULL);
+
+ _mesa_program_lexer_ctor(& state->scanner, state, (const char *) str, len);
+ yyparse(state);
+ _mesa_program_lexer_dtor(state->scanner);
+
+
+ if (ctx->Program.ErrorPos != -1) {
+ goto error;
+ }
+
+ if (! _mesa_layout_parameters(state)) {
+ struct YYLTYPE loc;
+
+ loc.first_line = 0;
+ loc.first_column = 0;
+ loc.position = len;
+
+ yyerror(& loc, state, "invalid PARAM usage");
+ goto error;
+ }
+
+
+
+ /* Add one instruction to store the "END" instruction.
+ */
+ state->prog->Instructions =
+ _mesa_alloc_instructions(state->prog->NumInstructions + 1);
+ inst = state->inst_head;
+ for (i = 0; i < state->prog->NumInstructions; i++) {
+ struct asm_instruction *const temp = inst->next;
+
+ state->prog->Instructions[i] = inst->Base;
+ inst = temp;
+ }
+
+ /* Finally, tag on an OPCODE_END instruction */
+ {
+ const GLuint numInst = state->prog->NumInstructions;
+ _mesa_init_instructions(state->prog->Instructions + numInst, 1);
+ state->prog->Instructions[numInst].Opcode = OPCODE_END;
+ }
+ state->prog->NumInstructions++;
+
+ state->prog->NumParameters = state->prog->Parameters->NumParameters;
+ state->prog->NumAttributes = _mesa_bitcount(state->prog->InputsRead);
+
+ /*
+ * Initialize native counts to logical counts. The device driver may
+ * change them if program is translated into a hardware program.
+ */
+ state->prog->NumNativeInstructions = state->prog->NumInstructions;
+ state->prog->NumNativeTemporaries = state->prog->NumTemporaries;
+ state->prog->NumNativeParameters = state->prog->NumParameters;
+ state->prog->NumNativeAttributes = state->prog->NumAttributes;
+ state->prog->NumNativeAddressRegs = state->prog->NumAddressRegs;
+
+ result = GL_TRUE;
+
+error:
+ for (inst = state->inst_head; inst != NULL; inst = temp) {
+ temp = inst->next;
+ free(inst);
+ }
+
+ state->inst_head = NULL;
+ state->inst_tail = NULL;
+
+ for (sym = state->sym; sym != NULL; sym = temp) {
+ temp = sym->next;
+
+ free((void *) sym->name);
+ free(sym);
+ }
+ state->sym = NULL;
+
+ _mesa_symbol_table_dtor(state->st);
+ state->st = NULL;
+
+ return result;
+}
diff --git a/mesalib/src/mesa/program/program_parse_extra.c b/mesalib/src/mesa/program/program_parse_extra.c
index 4d928483e..67ab9b99d 100644
--- a/mesalib/src/mesa/program/program_parse_extra.c
+++ b/mesalib/src/mesa/program/program_parse_extra.c
@@ -1,265 +1,265 @@
-/*
- * Copyright © 2009 Intel Corporation
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-
-#include <string.h>
-#include "main/mtypes.h"
-#include "prog_instruction.h"
-#include "program_parser.h"
-
-
-/**
- * Extra assembly-level parser routines
- *
- * \author Ian Romanick <ian.d.romanick@intel.com>
- */
-
-int
-_mesa_parse_instruction_suffix(const struct asm_parser_state *state,
- const char *suffix,
- struct prog_instruction *inst)
-{
- inst->CondUpdate = 0;
- inst->CondDst = 0;
- inst->SaturateMode = SATURATE_OFF;
- inst->Precision = FLOAT32;
-
-
- /* The first possible suffix element is the precision specifier from
- * NV_fragment_program_option.
- */
- if (state->option.NV_fragment) {
- switch (suffix[0]) {
- case 'H':
- inst->Precision = FLOAT16;
- suffix++;
- break;
- case 'R':
- inst->Precision = FLOAT32;
- suffix++;
- break;
- case 'X':
- inst->Precision = FIXED12;
- suffix++;
- break;
- default:
- break;
- }
- }
-
- /* The next possible suffix element is the condition code modifier selection
- * from NV_fragment_program_option.
- */
- if (state->option.NV_fragment) {
- if (suffix[0] == 'C') {
- inst->CondUpdate = 1;
- suffix++;
- }
- }
-
-
- /* The final possible suffix element is the saturation selector from
- * ARB_fragment_program.
- */
- if (state->mode == ARB_fragment) {
- if (strcmp(suffix, "_SAT") == 0) {
- inst->SaturateMode = SATURATE_ZERO_ONE;
- suffix += 4;
- }
- }
-
-
- /* It is an error for all of the suffix string not to be consumed.
- */
- return suffix[0] == '\0';
-}
-
-
-int
-_mesa_parse_cc(const char *s)
-{
- int cond = 0;
-
- switch (s[0]) {
- case 'E':
- if (s[1] == 'Q') {
- cond = COND_EQ;
- }
- break;
-
- case 'F':
- if (s[1] == 'L') {
- cond = COND_FL;
- }
- break;
-
- case 'G':
- if (s[1] == 'E') {
- cond = COND_GE;
- } else if (s[1] == 'T') {
- cond = COND_GT;
- }
- break;
-
- case 'L':
- if (s[1] == 'E') {
- cond = COND_LE;
- } else if (s[1] == 'T') {
- cond = COND_LT;
- }
- break;
-
- case 'N':
- if (s[1] == 'E') {
- cond = COND_NE;
- }
- break;
-
- case 'T':
- if (s[1] == 'R') {
- cond = COND_TR;
- }
- break;
-
- default:
- break;
- }
-
- return ((cond == 0) || (s[2] != '\0')) ? 0 : cond;
-}
-
-
-int
-_mesa_ARBvp_parse_option(struct asm_parser_state *state, const char *option)
-{
- if (strcmp(option, "ARB_position_invariant") == 0) {
- state->option.PositionInvariant = 1;
- return 1;
- }
-
- return 0;
-}
-
-
-int
-_mesa_ARBfp_parse_option(struct asm_parser_state *state, const char *option)
-{
- /* All of the options currently supported start with "ARB_". The code is
- * currently structured with nested if-statements because eventually options
- * that start with "NV_" will be supported. This structure will result in
- * less churn when those options are added.
- */
- if (strncmp(option, "ARB_", 4) == 0) {
- /* Advance the pointer past the "ARB_" prefix.
- */
- option += 4;
-
-
- if (strncmp(option, "fog_", 4) == 0) {
- option += 4;
-
- if (state->option.Fog == OPTION_NONE) {
- if (strcmp(option, "exp") == 0) {
- state->option.Fog = OPTION_FOG_EXP;
- return 1;
- } else if (strcmp(option, "exp2") == 0) {
- state->option.Fog = OPTION_FOG_EXP2;
- return 1;
- } else if (strcmp(option, "linear") == 0) {
- state->option.Fog = OPTION_FOG_LINEAR;
- return 1;
- }
- }
-
- return 0;
- } else if (strncmp(option, "precision_hint_", 15) == 0) {
- option += 15;
-
- if (state->option.PrecisionHint == OPTION_NONE) {
- if (strcmp(option, "nicest") == 0) {
- state->option.PrecisionHint = OPTION_NICEST;
- return 1;
- } else if (strcmp(option, "fastest") == 0) {
- state->option.PrecisionHint = OPTION_FASTEST;
- return 1;
- }
- }
-
- return 0;
- } else if (strcmp(option, "draw_buffers") == 0) {
- /* Don't need to check extension availability because all Mesa-based
- * drivers support GL_ARB_draw_buffers.
- */
- state->option.DrawBuffers = 1;
- return 1;
- } else if (strcmp(option, "fragment_program_shadow") == 0) {
- if (state->ctx->Extensions.ARB_fragment_program_shadow) {
- state->option.Shadow = 1;
- return 1;
- }
- } else if (strncmp(option, "fragment_coord_", 15) == 0) {
- option += 15;
- if (state->ctx->Extensions.ARB_fragment_coord_conventions) {
- if (strcmp(option, "origin_upper_left") == 0) {
- state->option.OriginUpperLeft = 1;
- return 1;
- }
- else if (strcmp(option, "pixel_center_integer") == 0) {
- state->option.PixelCenterInteger = 1;
- return 1;
- }
- }
- }
- } else if (strncmp(option, "ATI_", 4) == 0) {
- option += 4;
-
- if (strcmp(option, "draw_buffers") == 0) {
- /* Don't need to check extension availability because all Mesa-based
- * drivers support GL_ATI_draw_buffers.
- */
- state->option.DrawBuffers = 1;
- return 1;
- }
- } else if (strncmp(option, "NV_fragment_program", 19) == 0) {
- option += 19;
-
- /* Other NV_fragment_program strings may be supported later.
- */
- if (option[0] == '\0') {
- if (state->ctx->Extensions.NV_fragment_program_option) {
- state->option.NV_fragment = 1;
- return 1;
- }
- }
- } else if (strncmp(option, "MESA_", 5) == 0) {
- option += 5;
-
- if (strcmp(option, "texture_array") == 0) {
- if (state->ctx->Extensions.MESA_texture_array) {
- state->option.TexArray = 1;
- return 1;
- }
- }
- }
-
- return 0;
-}
+/*
+ * Copyright © 2009 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+#include <string.h>
+#include "main/mtypes.h"
+#include "prog_instruction.h"
+#include "program_parser.h"
+
+
+/**
+ * Extra assembly-level parser routines
+ *
+ * \author Ian Romanick <ian.d.romanick@intel.com>
+ */
+
+int
+_mesa_parse_instruction_suffix(const struct asm_parser_state *state,
+ const char *suffix,
+ struct prog_instruction *inst)
+{
+ inst->CondUpdate = 0;
+ inst->CondDst = 0;
+ inst->SaturateMode = SATURATE_OFF;
+ inst->Precision = FLOAT32;
+
+
+ /* The first possible suffix element is the precision specifier from
+ * NV_fragment_program_option.
+ */
+ if (state->option.NV_fragment) {
+ switch (suffix[0]) {
+ case 'H':
+ inst->Precision = FLOAT16;
+ suffix++;
+ break;
+ case 'R':
+ inst->Precision = FLOAT32;
+ suffix++;
+ break;
+ case 'X':
+ inst->Precision = FIXED12;
+ suffix++;
+ break;
+ default:
+ break;
+ }
+ }
+
+ /* The next possible suffix element is the condition code modifier selection
+ * from NV_fragment_program_option.
+ */
+ if (state->option.NV_fragment) {
+ if (suffix[0] == 'C') {
+ inst->CondUpdate = 1;
+ suffix++;
+ }
+ }
+
+
+ /* The final possible suffix element is the saturation selector from
+ * ARB_fragment_program.
+ */
+ if (state->mode == ARB_fragment) {
+ if (strcmp(suffix, "_SAT") == 0) {
+ inst->SaturateMode = SATURATE_ZERO_ONE;
+ suffix += 4;
+ }
+ }
+
+
+ /* It is an error for all of the suffix string not to be consumed.
+ */
+ return suffix[0] == '\0';
+}
+
+
+int
+_mesa_parse_cc(const char *s)
+{
+ int cond = 0;
+
+ switch (s[0]) {
+ case 'E':
+ if (s[1] == 'Q') {
+ cond = COND_EQ;
+ }
+ break;
+
+ case 'F':
+ if (s[1] == 'L') {
+ cond = COND_FL;
+ }
+ break;
+
+ case 'G':
+ if (s[1] == 'E') {
+ cond = COND_GE;
+ } else if (s[1] == 'T') {
+ cond = COND_GT;
+ }
+ break;
+
+ case 'L':
+ if (s[1] == 'E') {
+ cond = COND_LE;
+ } else if (s[1] == 'T') {
+ cond = COND_LT;
+ }
+ break;
+
+ case 'N':
+ if (s[1] == 'E') {
+ cond = COND_NE;
+ }
+ break;
+
+ case 'T':
+ if (s[1] == 'R') {
+ cond = COND_TR;
+ }
+ break;
+
+ default:
+ break;
+ }
+
+ return ((cond == 0) || (s[2] != '\0')) ? 0 : cond;
+}
+
+
+int
+_mesa_ARBvp_parse_option(struct asm_parser_state *state, const char *option)
+{
+ if (strcmp(option, "ARB_position_invariant") == 0) {
+ state->option.PositionInvariant = 1;
+ return 1;
+ }
+
+ return 0;
+}
+
+
+int
+_mesa_ARBfp_parse_option(struct asm_parser_state *state, const char *option)
+{
+ /* All of the options currently supported start with "ARB_". The code is
+ * currently structured with nested if-statements because eventually options
+ * that start with "NV_" will be supported. This structure will result in
+ * less churn when those options are added.
+ */
+ if (strncmp(option, "ARB_", 4) == 0) {
+ /* Advance the pointer past the "ARB_" prefix.
+ */
+ option += 4;
+
+
+ if (strncmp(option, "fog_", 4) == 0) {
+ option += 4;
+
+ if (state->option.Fog == OPTION_NONE) {
+ if (strcmp(option, "exp") == 0) {
+ state->option.Fog = OPTION_FOG_EXP;
+ return 1;
+ } else if (strcmp(option, "exp2") == 0) {
+ state->option.Fog = OPTION_FOG_EXP2;
+ return 1;
+ } else if (strcmp(option, "linear") == 0) {
+ state->option.Fog = OPTION_FOG_LINEAR;
+ return 1;
+ }
+ }
+
+ return 0;
+ } else if (strncmp(option, "precision_hint_", 15) == 0) {
+ option += 15;
+
+ if (state->option.PrecisionHint == OPTION_NONE) {
+ if (strcmp(option, "nicest") == 0) {
+ state->option.PrecisionHint = OPTION_NICEST;
+ return 1;
+ } else if (strcmp(option, "fastest") == 0) {
+ state->option.PrecisionHint = OPTION_FASTEST;
+ return 1;
+ }
+ }
+
+ return 0;
+ } else if (strcmp(option, "draw_buffers") == 0) {
+ /* Don't need to check extension availability because all Mesa-based
+ * drivers support GL_ARB_draw_buffers.
+ */
+ state->option.DrawBuffers = 1;
+ return 1;
+ } else if (strcmp(option, "fragment_program_shadow") == 0) {
+ if (state->ctx->Extensions.ARB_fragment_program_shadow) {
+ state->option.Shadow = 1;
+ return 1;
+ }
+ } else if (strncmp(option, "fragment_coord_", 15) == 0) {
+ option += 15;
+ if (state->ctx->Extensions.ARB_fragment_coord_conventions) {
+ if (strcmp(option, "origin_upper_left") == 0) {
+ state->option.OriginUpperLeft = 1;
+ return 1;
+ }
+ else if (strcmp(option, "pixel_center_integer") == 0) {
+ state->option.PixelCenterInteger = 1;
+ return 1;
+ }
+ }
+ }
+ } else if (strncmp(option, "ATI_", 4) == 0) {
+ option += 4;
+
+ if (strcmp(option, "draw_buffers") == 0) {
+ /* Don't need to check extension availability because all Mesa-based
+ * drivers support GL_ATI_draw_buffers.
+ */
+ state->option.DrawBuffers = 1;
+ return 1;
+ }
+ } else if (strncmp(option, "NV_fragment_program", 19) == 0) {
+ option += 19;
+
+ /* Other NV_fragment_program strings may be supported later.
+ */
+ if (option[0] == '\0') {
+ if (state->ctx->Extensions.NV_fragment_program_option) {
+ state->option.NV_fragment = 1;
+ return 1;
+ }
+ }
+ } else if (strncmp(option, "MESA_", 5) == 0) {
+ option += 5;
+
+ if (strcmp(option, "texture_array") == 0) {
+ if (state->ctx->Extensions.MESA_texture_array) {
+ state->option.TexArray = 1;
+ return 1;
+ }
+ }
+ }
+
+ return 0;
+}
diff --git a/mesalib/src/mesa/program/program_parser.h b/mesalib/src/mesa/program/program_parser.h
index 8e5aaee95..cbbb2677d 100644
--- a/mesalib/src/mesa/program/program_parser.h
+++ b/mesalib/src/mesa/program/program_parser.h
@@ -1,300 +1,300 @@
-/*
- * Copyright © 2009 Intel Corporation
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-#pragma once
-
-#include "main/config.h"
-
-struct gl_context;
-
-enum asm_type {
- at_none,
- at_address,
- at_attrib,
- at_param,
- at_temp,
- at_output
-};
-
-struct asm_symbol {
- struct asm_symbol *next; /**< List linkage for freeing. */
- const char *name;
- enum asm_type type;
- unsigned attrib_binding;
- unsigned output_binding; /**< Output / result register number. */
-
- /**
- * One of PROGRAM_STATE_VAR, PROGRAM_LOCAL_PARAM, or PROGRAM_ENV_PARAM.
- */
- unsigned param_binding_type;
-
- /**
- * Offset into the program_parameter_list where the tokens representing our
- * bound state (or constants) start.
- */
- unsigned param_binding_begin;
-
- /**
- * Constants put into the parameter list may be swizzled. This
- * field contain's the symbol's swizzle. (SWIZZLE_X/Y/Z/W)
- */
- unsigned param_binding_swizzle;
-
- /* This is how many entries in the program_parameter_list we take up
- * with our state tokens or constants. Note that this is _not_ the same as
- * the number of param registers we eventually use.
- */
- unsigned param_binding_length;
-
- /**
- * Index of the temp register assigned to this variable.
- */
- unsigned temp_binding;
-
- /**
- * Flag whether or not a PARAM is an array
- */
- unsigned param_is_array:1;
-
-
- /**
- * Flag whether or not a PARAM array is accessed indirectly
- */
- unsigned param_accessed_indirectly:1;
-
-
- /**
- * \brief Is first pass of parameter layout done with this variable?
- *
- * The parameter layout routine operates in two passes. This flag tracks
- * whether or not the first pass has handled this variable.
- *
- * \sa _mesa_layout_parameters
- */
- unsigned pass1_done:1;
-};
-
-
-struct asm_vector {
- unsigned count;
- float data[4];
-};
-
-
-struct asm_swizzle_mask {
- unsigned swizzle:12;
- unsigned mask:4;
-};
-
-
-struct asm_src_register {
- struct prog_src_register Base;
-
- /**
- * Symbol associated with indirect access to parameter arrays.
- *
- * If \c Base::RelAddr is 1, this will point to the symbol for the parameter
- * that is being dereferenced. Further, \c Base::Index will be the offset
- * from the address register being used.
- */
- struct asm_symbol *Symbol;
-};
-
-
-struct asm_instruction {
- struct prog_instruction Base;
- struct asm_instruction *next;
- struct asm_src_register SrcReg[3];
-};
-
-
-struct asm_parser_state {
- struct gl_context *ctx;
- struct gl_program *prog;
-
- /**
- * Per-program target limits
- */
- struct gl_program_constants *limits;
-
- struct _mesa_symbol_table *st;
-
- /**
- * Linked list of symbols
- *
- * This list is \b only used when cleaning up compiler state and freeing
- * memory.
- */
- struct asm_symbol *sym;
-
- /**
- * State for the lexer.
- */
- void *scanner;
-
- /**
- * Linked list of instructions generated during parsing.
- */
- /*@{*/
- struct asm_instruction *inst_head;
- struct asm_instruction *inst_tail;
- /*@}*/
-
-
- /**
- * Selected limits copied from gl_constants
- *
- * These are limits from the GL context, but various bits in the program
- * must be validated against these values.
- */
- /*@{*/
- unsigned MaxTextureCoordUnits;
- unsigned MaxTextureImageUnits;
- unsigned MaxTextureUnits;
- unsigned MaxClipPlanes;
- unsigned MaxLights;
- unsigned MaxProgramMatrices;
- unsigned MaxDrawBuffers;
- /*@}*/
-
- /**
- * Value to use in state vector accessors for environment and local
- * parameters
- */
- unsigned state_param_enum;
-
-
- /**
- * Input attributes bound to specific names
- *
- * This is only needed so that errors can be properly produced when
- * multiple ATTRIB statements bind illegal combinations of vertex
- * attributes.
- */
- unsigned InputsBound;
-
- enum {
- invalid_mode = 0,
- ARB_vertex,
- ARB_fragment
- } mode;
-
- struct {
- unsigned PositionInvariant:1;
- unsigned Fog:2;
- unsigned PrecisionHint:2;
- unsigned DrawBuffers:1;
- unsigned Shadow:1;
- unsigned TexRect:1;
- unsigned TexArray:1;
- unsigned NV_fragment:1;
- unsigned OriginUpperLeft:1;
- unsigned PixelCenterInteger:1;
- } option;
-
- struct {
- unsigned UsesKill:1;
- } fragment;
-};
-
-#define OPTION_NONE 0
-#define OPTION_FOG_EXP 1
-#define OPTION_FOG_EXP2 2
-#define OPTION_FOG_LINEAR 3
-#define OPTION_NICEST 1
-#define OPTION_FASTEST 2
-
-typedef struct YYLTYPE {
- int first_line;
- int first_column;
- int last_line;
- int last_column;
- int position;
-} YYLTYPE;
-
-#define YYLTYPE_IS_DECLARED 1
-#define YYLTYPE_IS_TRIVIAL 1
-
-
-extern GLboolean _mesa_parse_arb_program(struct gl_context *ctx, GLenum target,
- const GLubyte *str, GLsizei len, struct asm_parser_state *state);
-
-
-
-/* From program_lexer.l. */
-extern void _mesa_program_lexer_dtor(void *scanner);
-
-extern void _mesa_program_lexer_ctor(void **scanner,
- struct asm_parser_state *state, const char *string, size_t len);
-
-
-/**
- *\name From program_parse_extra.c
- */
-/*@{*/
-
-/**
- * Parses and processes an option string to an ARB vertex program
- *
- * \return
- * Non-zero on success, zero on failure.
- */
-extern int _mesa_ARBvp_parse_option(struct asm_parser_state *state,
- const char *option);
-
-/**
- * Parses and processes an option string to an ARB fragment program
- *
- * \return
- * Non-zero on success, zero on failure.
- */
-extern int _mesa_ARBfp_parse_option(struct asm_parser_state *state,
- const char *option);
-
-/**
- * Parses and processes instruction suffixes
- *
- * Instruction suffixes, such as \c _SAT, are processed. The relevant bits
- * are set in \c inst. If suffixes are encountered that are either not known
- * or not supported by the modes and options set in \c state, zero will be
- * returned.
- *
- * \return
- * Non-zero on success, zero on failure.
- */
-extern int _mesa_parse_instruction_suffix(const struct asm_parser_state *state,
- const char *suffix, struct prog_instruction *inst);
-
-/**
- * Parses a condition code name
- *
- * The condition code names (e.g., \c LT, \c GT, \c NE) were added to assembly
- * shaders with the \c GL_NV_fragment_program_option extension. This function
- * converts a string representation into one of the \c COND_ macros.
- *
- * \return
- * One of the \c COND_ macros defined in prog_instruction.h on success or zero
- * on failure.
- */
-extern int _mesa_parse_cc(const char *s);
-
-/*@}*/
+/*
+ * Copyright © 2009 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+#pragma once
+
+#include "main/config.h"
+
+struct gl_context;
+
+enum asm_type {
+ at_none,
+ at_address,
+ at_attrib,
+ at_param,
+ at_temp,
+ at_output
+};
+
+struct asm_symbol {
+ struct asm_symbol *next; /**< List linkage for freeing. */
+ const char *name;
+ enum asm_type type;
+ unsigned attrib_binding;
+ unsigned output_binding; /**< Output / result register number. */
+
+ /**
+ * One of PROGRAM_STATE_VAR, PROGRAM_LOCAL_PARAM, or PROGRAM_ENV_PARAM.
+ */
+ unsigned param_binding_type;
+
+ /**
+ * Offset into the program_parameter_list where the tokens representing our
+ * bound state (or constants) start.
+ */
+ unsigned param_binding_begin;
+
+ /**
+ * Constants put into the parameter list may be swizzled. This
+ * field contain's the symbol's swizzle. (SWIZZLE_X/Y/Z/W)
+ */
+ unsigned param_binding_swizzle;
+
+ /* This is how many entries in the program_parameter_list we take up
+ * with our state tokens or constants. Note that this is _not_ the same as
+ * the number of param registers we eventually use.
+ */
+ unsigned param_binding_length;
+
+ /**
+ * Index of the temp register assigned to this variable.
+ */
+ unsigned temp_binding;
+
+ /**
+ * Flag whether or not a PARAM is an array
+ */
+ unsigned param_is_array:1;
+
+
+ /**
+ * Flag whether or not a PARAM array is accessed indirectly
+ */
+ unsigned param_accessed_indirectly:1;
+
+
+ /**
+ * \brief Is first pass of parameter layout done with this variable?
+ *
+ * The parameter layout routine operates in two passes. This flag tracks
+ * whether or not the first pass has handled this variable.
+ *
+ * \sa _mesa_layout_parameters
+ */
+ unsigned pass1_done:1;
+};
+
+
+struct asm_vector {
+ unsigned count;
+ float data[4];
+};
+
+
+struct asm_swizzle_mask {
+ unsigned swizzle:12;
+ unsigned mask:4;
+};
+
+
+struct asm_src_register {
+ struct prog_src_register Base;
+
+ /**
+ * Symbol associated with indirect access to parameter arrays.
+ *
+ * If \c Base::RelAddr is 1, this will point to the symbol for the parameter
+ * that is being dereferenced. Further, \c Base::Index will be the offset
+ * from the address register being used.
+ */
+ struct asm_symbol *Symbol;
+};
+
+
+struct asm_instruction {
+ struct prog_instruction Base;
+ struct asm_instruction *next;
+ struct asm_src_register SrcReg[3];
+};
+
+
+struct asm_parser_state {
+ struct gl_context *ctx;
+ struct gl_program *prog;
+
+ /**
+ * Per-program target limits
+ */
+ struct gl_program_constants *limits;
+
+ struct _mesa_symbol_table *st;
+
+ /**
+ * Linked list of symbols
+ *
+ * This list is \b only used when cleaning up compiler state and freeing
+ * memory.
+ */
+ struct asm_symbol *sym;
+
+ /**
+ * State for the lexer.
+ */
+ void *scanner;
+
+ /**
+ * Linked list of instructions generated during parsing.
+ */
+ /*@{*/
+ struct asm_instruction *inst_head;
+ struct asm_instruction *inst_tail;
+ /*@}*/
+
+
+ /**
+ * Selected limits copied from gl_constants
+ *
+ * These are limits from the GL context, but various bits in the program
+ * must be validated against these values.
+ */
+ /*@{*/
+ unsigned MaxTextureCoordUnits;
+ unsigned MaxTextureImageUnits;
+ unsigned MaxTextureUnits;
+ unsigned MaxClipPlanes;
+ unsigned MaxLights;
+ unsigned MaxProgramMatrices;
+ unsigned MaxDrawBuffers;
+ /*@}*/
+
+ /**
+ * Value to use in state vector accessors for environment and local
+ * parameters
+ */
+ unsigned state_param_enum;
+
+
+ /**
+ * Input attributes bound to specific names
+ *
+ * This is only needed so that errors can be properly produced when
+ * multiple ATTRIB statements bind illegal combinations of vertex
+ * attributes.
+ */
+ unsigned InputsBound;
+
+ enum {
+ invalid_mode = 0,
+ ARB_vertex,
+ ARB_fragment
+ } mode;
+
+ struct {
+ unsigned PositionInvariant:1;
+ unsigned Fog:2;
+ unsigned PrecisionHint:2;
+ unsigned DrawBuffers:1;
+ unsigned Shadow:1;
+ unsigned TexRect:1;
+ unsigned TexArray:1;
+ unsigned NV_fragment:1;
+ unsigned OriginUpperLeft:1;
+ unsigned PixelCenterInteger:1;
+ } option;
+
+ struct {
+ unsigned UsesKill:1;
+ } fragment;
+};
+
+#define OPTION_NONE 0
+#define OPTION_FOG_EXP 1
+#define OPTION_FOG_EXP2 2
+#define OPTION_FOG_LINEAR 3
+#define OPTION_NICEST 1
+#define OPTION_FASTEST 2
+
+typedef struct YYLTYPE {
+ int first_line;
+ int first_column;
+ int last_line;
+ int last_column;
+ int position;
+} YYLTYPE;
+
+#define YYLTYPE_IS_DECLARED 1
+#define YYLTYPE_IS_TRIVIAL 1
+
+
+extern GLboolean _mesa_parse_arb_program(struct gl_context *ctx, GLenum target,
+ const GLubyte *str, GLsizei len, struct asm_parser_state *state);
+
+
+
+/* From program_lexer.l. */
+extern void _mesa_program_lexer_dtor(void *scanner);
+
+extern void _mesa_program_lexer_ctor(void **scanner,
+ struct asm_parser_state *state, const char *string, size_t len);
+
+
+/**
+ *\name From program_parse_extra.c
+ */
+/*@{*/
+
+/**
+ * Parses and processes an option string to an ARB vertex program
+ *
+ * \return
+ * Non-zero on success, zero on failure.
+ */
+extern int _mesa_ARBvp_parse_option(struct asm_parser_state *state,
+ const char *option);
+
+/**
+ * Parses and processes an option string to an ARB fragment program
+ *
+ * \return
+ * Non-zero on success, zero on failure.
+ */
+extern int _mesa_ARBfp_parse_option(struct asm_parser_state *state,
+ const char *option);
+
+/**
+ * Parses and processes instruction suffixes
+ *
+ * Instruction suffixes, such as \c _SAT, are processed. The relevant bits
+ * are set in \c inst. If suffixes are encountered that are either not known
+ * or not supported by the modes and options set in \c state, zero will be
+ * returned.
+ *
+ * \return
+ * Non-zero on success, zero on failure.
+ */
+extern int _mesa_parse_instruction_suffix(const struct asm_parser_state *state,
+ const char *suffix, struct prog_instruction *inst);
+
+/**
+ * Parses a condition code name
+ *
+ * The condition code names (e.g., \c LT, \c GT, \c NE) were added to assembly
+ * shaders with the \c GL_NV_fragment_program_option extension. This function
+ * converts a string representation into one of the \c COND_ macros.
+ *
+ * \return
+ * One of the \c COND_ macros defined in prog_instruction.h on success or zero
+ * on failure.
+ */
+extern int _mesa_parse_cc(const char *s);
+
+/*@}*/
diff --git a/mesalib/src/mesa/program/programopt.c b/mesalib/src/mesa/program/programopt.c
index c72dfb23b..62b406653 100644
--- a/mesalib/src/mesa/program/programopt.c
+++ b/mesalib/src/mesa/program/programopt.c
@@ -1,685 +1,685 @@
-/*
- * Mesa 3-D graphics library
- * Version: 6.5.3
- *
- * Copyright (C) 1999-2007 Brian Paul All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-/**
- * \file programopt.c
- * Vertex/Fragment program optimizations and transformations for program
- * options, etc.
- *
- * \author Brian Paul
- */
-
-
-#include "main/glheader.h"
-#include "main/context.h"
-#include "prog_parameter.h"
-#include "prog_statevars.h"
-#include "program.h"
-#include "programopt.h"
-#include "prog_instruction.h"
-
-
-/**
- * This function inserts instructions for coordinate modelview * projection
- * into a vertex program.
- * May be used to implement the position_invariant option.
- */
-static void
-_mesa_insert_mvp_dp4_code(struct gl_context *ctx, struct gl_vertex_program *vprog)
-{
- struct prog_instruction *newInst;
- const GLuint origLen = vprog->Base.NumInstructions;
- const GLuint newLen = origLen + 4;
- GLuint i;
-
- /*
- * Setup state references for the modelview/projection matrix.
- * XXX we should check if these state vars are already declared.
- */
- static const gl_state_index mvpState[4][STATE_LENGTH] = {
- { STATE_MVP_MATRIX, 0, 0, 0, 0 }, /* state.matrix.mvp.row[0] */
- { STATE_MVP_MATRIX, 0, 1, 1, 0 }, /* state.matrix.mvp.row[1] */
- { STATE_MVP_MATRIX, 0, 2, 2, 0 }, /* state.matrix.mvp.row[2] */
- { STATE_MVP_MATRIX, 0, 3, 3, 0 }, /* state.matrix.mvp.row[3] */
- };
- GLint mvpRef[4];
-
- for (i = 0; i < 4; i++) {
- mvpRef[i] = _mesa_add_state_reference(vprog->Base.Parameters,
- mvpState[i]);
- }
-
- /* Alloc storage for new instructions */
- newInst = _mesa_alloc_instructions(newLen);
- if (!newInst) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY,
- "glProgramString(inserting position_invariant code)");
- return;
- }
-
- /*
- * Generated instructions:
- * newInst[0] = DP4 result.position.x, mvp.row[0], vertex.position;
- * newInst[1] = DP4 result.position.y, mvp.row[1], vertex.position;
- * newInst[2] = DP4 result.position.z, mvp.row[2], vertex.position;
- * newInst[3] = DP4 result.position.w, mvp.row[3], vertex.position;
- */
- _mesa_init_instructions(newInst, 4);
- for (i = 0; i < 4; i++) {
- newInst[i].Opcode = OPCODE_DP4;
- newInst[i].DstReg.File = PROGRAM_OUTPUT;
- newInst[i].DstReg.Index = VERT_RESULT_HPOS;
- newInst[i].DstReg.WriteMask = (WRITEMASK_X << i);
- newInst[i].SrcReg[0].File = PROGRAM_STATE_VAR;
- newInst[i].SrcReg[0].Index = mvpRef[i];
- newInst[i].SrcReg[0].Swizzle = SWIZZLE_NOOP;
- newInst[i].SrcReg[1].File = PROGRAM_INPUT;
- newInst[i].SrcReg[1].Index = VERT_ATTRIB_POS;
- newInst[i].SrcReg[1].Swizzle = SWIZZLE_NOOP;
- }
-
- /* Append original instructions after new instructions */
- _mesa_copy_instructions (newInst + 4, vprog->Base.Instructions, origLen);
-
- /* free old instructions */
- _mesa_free_instructions(vprog->Base.Instructions, origLen);
-
- /* install new instructions */
- vprog->Base.Instructions = newInst;
- vprog->Base.NumInstructions = newLen;
- vprog->Base.InputsRead |= VERT_BIT_POS;
- vprog->Base.OutputsWritten |= BITFIELD64_BIT(VERT_RESULT_HPOS);
-}
-
-
-static void
-_mesa_insert_mvp_mad_code(struct gl_context *ctx, struct gl_vertex_program *vprog)
-{
- struct prog_instruction *newInst;
- const GLuint origLen = vprog->Base.NumInstructions;
- const GLuint newLen = origLen + 4;
- GLuint hposTemp;
- GLuint i;
-
- /*
- * Setup state references for the modelview/projection matrix.
- * XXX we should check if these state vars are already declared.
- */
- static const gl_state_index mvpState[4][STATE_LENGTH] = {
- { STATE_MVP_MATRIX, 0, 0, 0, STATE_MATRIX_TRANSPOSE },
- { STATE_MVP_MATRIX, 0, 1, 1, STATE_MATRIX_TRANSPOSE },
- { STATE_MVP_MATRIX, 0, 2, 2, STATE_MATRIX_TRANSPOSE },
- { STATE_MVP_MATRIX, 0, 3, 3, STATE_MATRIX_TRANSPOSE },
- };
- GLint mvpRef[4];
-
- for (i = 0; i < 4; i++) {
- mvpRef[i] = _mesa_add_state_reference(vprog->Base.Parameters,
- mvpState[i]);
- }
-
- /* Alloc storage for new instructions */
- newInst = _mesa_alloc_instructions(newLen);
- if (!newInst) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY,
- "glProgramString(inserting position_invariant code)");
- return;
- }
-
- /* TEMP hposTemp; */
- hposTemp = vprog->Base.NumTemporaries++;
-
- /*
- * Generated instructions:
- * emit_op2(p, OPCODE_MUL, tmp, 0, swizzle1(src,X), mat[0]);
- * emit_op3(p, OPCODE_MAD, tmp, 0, swizzle1(src,Y), mat[1], tmp);
- * emit_op3(p, OPCODE_MAD, tmp, 0, swizzle1(src,Z), mat[2], tmp);
- * emit_op3(p, OPCODE_MAD, dest, 0, swizzle1(src,W), mat[3], tmp);
- */
- _mesa_init_instructions(newInst, 4);
-
- newInst[0].Opcode = OPCODE_MUL;
- newInst[0].DstReg.File = PROGRAM_TEMPORARY;
- newInst[0].DstReg.Index = hposTemp;
- newInst[0].DstReg.WriteMask = WRITEMASK_XYZW;
- newInst[0].SrcReg[0].File = PROGRAM_INPUT;
- newInst[0].SrcReg[0].Index = VERT_ATTRIB_POS;
- newInst[0].SrcReg[0].Swizzle = SWIZZLE_XXXX;
- newInst[0].SrcReg[1].File = PROGRAM_STATE_VAR;
- newInst[0].SrcReg[1].Index = mvpRef[0];
- newInst[0].SrcReg[1].Swizzle = SWIZZLE_NOOP;
-
- for (i = 1; i <= 2; i++) {
- newInst[i].Opcode = OPCODE_MAD;
- newInst[i].DstReg.File = PROGRAM_TEMPORARY;
- newInst[i].DstReg.Index = hposTemp;
- newInst[i].DstReg.WriteMask = WRITEMASK_XYZW;
- newInst[i].SrcReg[0].File = PROGRAM_INPUT;
- newInst[i].SrcReg[0].Index = VERT_ATTRIB_POS;
- newInst[i].SrcReg[0].Swizzle = MAKE_SWIZZLE4(i,i,i,i);
- newInst[i].SrcReg[1].File = PROGRAM_STATE_VAR;
- newInst[i].SrcReg[1].Index = mvpRef[i];
- newInst[i].SrcReg[1].Swizzle = SWIZZLE_NOOP;
- newInst[i].SrcReg[2].File = PROGRAM_TEMPORARY;
- newInst[i].SrcReg[2].Index = hposTemp;
- newInst[1].SrcReg[2].Swizzle = SWIZZLE_NOOP;
- }
-
- newInst[3].Opcode = OPCODE_MAD;
- newInst[3].DstReg.File = PROGRAM_OUTPUT;
- newInst[3].DstReg.Index = VERT_RESULT_HPOS;
- newInst[3].DstReg.WriteMask = WRITEMASK_XYZW;
- newInst[3].SrcReg[0].File = PROGRAM_INPUT;
- newInst[3].SrcReg[0].Index = VERT_ATTRIB_POS;
- newInst[3].SrcReg[0].Swizzle = SWIZZLE_WWWW;
- newInst[3].SrcReg[1].File = PROGRAM_STATE_VAR;
- newInst[3].SrcReg[1].Index = mvpRef[3];
- newInst[3].SrcReg[1].Swizzle = SWIZZLE_NOOP;
- newInst[3].SrcReg[2].File = PROGRAM_TEMPORARY;
- newInst[3].SrcReg[2].Index = hposTemp;
- newInst[3].SrcReg[2].Swizzle = SWIZZLE_NOOP;
-
-
- /* Append original instructions after new instructions */
- _mesa_copy_instructions (newInst + 4, vprog->Base.Instructions, origLen);
-
- /* free old instructions */
- _mesa_free_instructions(vprog->Base.Instructions, origLen);
-
- /* install new instructions */
- vprog->Base.Instructions = newInst;
- vprog->Base.NumInstructions = newLen;
- vprog->Base.InputsRead |= VERT_BIT_POS;
- vprog->Base.OutputsWritten |= BITFIELD64_BIT(VERT_RESULT_HPOS);
-}
-
-
-void
-_mesa_insert_mvp_code(struct gl_context *ctx, struct gl_vertex_program *vprog)
-{
- if (ctx->mvp_with_dp4)
- _mesa_insert_mvp_dp4_code( ctx, vprog );
- else
- _mesa_insert_mvp_mad_code( ctx, vprog );
-}
-
-
-
-
-
-
-/**
- * Append instructions to implement fog
- *
- * The \c fragment.fogcoord input is used to compute the fog blend factor.
- *
- * \param ctx The GL context
- * \param fprog Fragment program that fog instructions will be appended to.
- * \param fog_mode Fog mode. One of \c GL_EXP, \c GL_EXP2, or \c GL_LINEAR.
- * \param saturate True if writes to color outputs should be clamped to [0, 1]
- *
- * \note
- * This function sets \c FRAG_BIT_FOGC in \c fprog->Base.InputsRead.
- *
- * \todo With a little work, this function could be adapted to add fog code
- * to vertex programs too.
- */
-void
-_mesa_append_fog_code(struct gl_context *ctx,
- struct gl_fragment_program *fprog, GLenum fog_mode,
- GLboolean saturate)
-{
- static const gl_state_index fogPStateOpt[STATE_LENGTH]
- = { STATE_INTERNAL, STATE_FOG_PARAMS_OPTIMIZED, 0, 0, 0 };
- static const gl_state_index fogColorState[STATE_LENGTH]
- = { STATE_FOG_COLOR, 0, 0, 0, 0};
- struct prog_instruction *newInst, *inst;
- const GLuint origLen = fprog->Base.NumInstructions;
- const GLuint newLen = origLen + 5;
- GLuint i;
- GLint fogPRefOpt, fogColorRef; /* state references */
- GLuint colorTemp, fogFactorTemp; /* temporary registerss */
-
- if (fog_mode == GL_NONE) {
- _mesa_problem(ctx, "_mesa_append_fog_code() called for fragment program"
- " with fog_mode == GL_NONE");
- return;
- }
-
- if (!(fprog->Base.OutputsWritten & (1 << FRAG_RESULT_COLOR))) {
- /* program doesn't output color, so nothing to do */
- return;
- }
-
- /* Alloc storage for new instructions */
- newInst = _mesa_alloc_instructions(newLen);
- if (!newInst) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY,
- "glProgramString(inserting fog_option code)");
- return;
- }
-
- /* Copy orig instructions into new instruction buffer */
- _mesa_copy_instructions(newInst, fprog->Base.Instructions, origLen);
-
- /* PARAM fogParamsRefOpt = internal optimized fog params; */
- fogPRefOpt
- = _mesa_add_state_reference(fprog->Base.Parameters, fogPStateOpt);
- /* PARAM fogColorRef = state.fog.color; */
- fogColorRef
- = _mesa_add_state_reference(fprog->Base.Parameters, fogColorState);
-
- /* TEMP colorTemp; */
- colorTemp = fprog->Base.NumTemporaries++;
- /* TEMP fogFactorTemp; */
- fogFactorTemp = fprog->Base.NumTemporaries++;
-
- /* Scan program to find where result.color is written */
- inst = newInst;
- for (i = 0; i < fprog->Base.NumInstructions; i++) {
- if (inst->Opcode == OPCODE_END)
- break;
- if (inst->DstReg.File == PROGRAM_OUTPUT &&
- inst->DstReg.Index == FRAG_RESULT_COLOR) {
- /* change the instruction to write to colorTemp w/ clamping */
- inst->DstReg.File = PROGRAM_TEMPORARY;
- inst->DstReg.Index = colorTemp;
- inst->SaturateMode = saturate;
- /* don't break (may be several writes to result.color) */
- }
- inst++;
- }
- assert(inst->Opcode == OPCODE_END); /* we'll overwrite this inst */
-
- _mesa_init_instructions(inst, 5);
-
- /* emit instructions to compute fog blending factor */
- /* this is always clamped to [0, 1] regardless of fragment clamping */
- if (fog_mode == GL_LINEAR) {
- /* MAD fogFactorTemp.x, fragment.fogcoord.x, fogPRefOpt.x, fogPRefOpt.y; */
- inst->Opcode = OPCODE_MAD;
- inst->DstReg.File = PROGRAM_TEMPORARY;
- inst->DstReg.Index = fogFactorTemp;
- inst->DstReg.WriteMask = WRITEMASK_X;
- inst->SrcReg[0].File = PROGRAM_INPUT;
- inst->SrcReg[0].Index = FRAG_ATTRIB_FOGC;
- inst->SrcReg[0].Swizzle = SWIZZLE_XXXX;
- inst->SrcReg[1].File = PROGRAM_STATE_VAR;
- inst->SrcReg[1].Index = fogPRefOpt;
- inst->SrcReg[1].Swizzle = SWIZZLE_XXXX;
- inst->SrcReg[2].File = PROGRAM_STATE_VAR;
- inst->SrcReg[2].Index = fogPRefOpt;
- inst->SrcReg[2].Swizzle = SWIZZLE_YYYY;
- inst->SaturateMode = SATURATE_ZERO_ONE;
- inst++;
- }
- else {
- ASSERT(fog_mode == GL_EXP || fog_mode == GL_EXP2);
- /* fogPRefOpt.z = d/ln(2), fogPRefOpt.w = d/sqrt(ln(2) */
- /* EXP: MUL fogFactorTemp.x, fogPRefOpt.z, fragment.fogcoord.x; */
- /* EXP2: MUL fogFactorTemp.x, fogPRefOpt.w, fragment.fogcoord.x; */
- inst->Opcode = OPCODE_MUL;
- inst->DstReg.File = PROGRAM_TEMPORARY;
- inst->DstReg.Index = fogFactorTemp;
- inst->DstReg.WriteMask = WRITEMASK_X;
- inst->SrcReg[0].File = PROGRAM_STATE_VAR;
- inst->SrcReg[0].Index = fogPRefOpt;
- inst->SrcReg[0].Swizzle
- = (fog_mode == GL_EXP) ? SWIZZLE_ZZZZ : SWIZZLE_WWWW;
- inst->SrcReg[1].File = PROGRAM_INPUT;
- inst->SrcReg[1].Index = FRAG_ATTRIB_FOGC;
- inst->SrcReg[1].Swizzle = SWIZZLE_XXXX;
- inst++;
- if (fog_mode == GL_EXP2) {
- /* MUL fogFactorTemp.x, fogFactorTemp.x, fogFactorTemp.x; */
- inst->Opcode = OPCODE_MUL;
- inst->DstReg.File = PROGRAM_TEMPORARY;
- inst->DstReg.Index = fogFactorTemp;
- inst->DstReg.WriteMask = WRITEMASK_X;
- inst->SrcReg[0].File = PROGRAM_TEMPORARY;
- inst->SrcReg[0].Index = fogFactorTemp;
- inst->SrcReg[0].Swizzle = SWIZZLE_XXXX;
- inst->SrcReg[1].File = PROGRAM_TEMPORARY;
- inst->SrcReg[1].Index = fogFactorTemp;
- inst->SrcReg[1].Swizzle = SWIZZLE_XXXX;
- inst++;
- }
- /* EX2_SAT fogFactorTemp.x, -fogFactorTemp.x; */
- inst->Opcode = OPCODE_EX2;
- inst->DstReg.File = PROGRAM_TEMPORARY;
- inst->DstReg.Index = fogFactorTemp;
- inst->DstReg.WriteMask = WRITEMASK_X;
- inst->SrcReg[0].File = PROGRAM_TEMPORARY;
- inst->SrcReg[0].Index = fogFactorTemp;
- inst->SrcReg[0].Negate = NEGATE_XYZW;
- inst->SrcReg[0].Swizzle = SWIZZLE_XXXX;
- inst->SaturateMode = SATURATE_ZERO_ONE;
- inst++;
- }
- /* LRP result.color.xyz, fogFactorTemp.xxxx, colorTemp, fogColorRef; */
- inst->Opcode = OPCODE_LRP;
- inst->DstReg.File = PROGRAM_OUTPUT;
- inst->DstReg.Index = FRAG_RESULT_COLOR;
- inst->DstReg.WriteMask = WRITEMASK_XYZ;
- inst->SrcReg[0].File = PROGRAM_TEMPORARY;
- inst->SrcReg[0].Index = fogFactorTemp;
- inst->SrcReg[0].Swizzle = SWIZZLE_XXXX;
- inst->SrcReg[1].File = PROGRAM_TEMPORARY;
- inst->SrcReg[1].Index = colorTemp;
- inst->SrcReg[1].Swizzle = SWIZZLE_NOOP;
- inst->SrcReg[2].File = PROGRAM_STATE_VAR;
- inst->SrcReg[2].Index = fogColorRef;
- inst->SrcReg[2].Swizzle = SWIZZLE_NOOP;
- inst++;
- /* MOV result.color.w, colorTemp.x; # copy alpha */
- inst->Opcode = OPCODE_MOV;
- inst->DstReg.File = PROGRAM_OUTPUT;
- inst->DstReg.Index = FRAG_RESULT_COLOR;
- inst->DstReg.WriteMask = WRITEMASK_W;
- inst->SrcReg[0].File = PROGRAM_TEMPORARY;
- inst->SrcReg[0].Index = colorTemp;
- inst->SrcReg[0].Swizzle = SWIZZLE_NOOP;
- inst++;
- /* END; */
- inst->Opcode = OPCODE_END;
- inst++;
-
- /* free old instructions */
- _mesa_free_instructions(fprog->Base.Instructions, origLen);
-
- /* install new instructions */
- fprog->Base.Instructions = newInst;
- fprog->Base.NumInstructions = inst - newInst;
- fprog->Base.InputsRead |= FRAG_BIT_FOGC;
- assert(fprog->Base.OutputsWritten & (1 << FRAG_RESULT_COLOR));
-}
-
-
-
-static GLboolean
-is_texture_instruction(const struct prog_instruction *inst)
-{
- switch (inst->Opcode) {
- case OPCODE_TEX:
- case OPCODE_TXB:
- case OPCODE_TXD:
- case OPCODE_TXL:
- case OPCODE_TXP:
- case OPCODE_TXP_NV:
- return GL_TRUE;
- default:
- return GL_FALSE;
- }
-}
-
-
-/**
- * Count the number of texure indirections in the given program.
- * The program's NumTexIndirections field will be updated.
- * See the GL_ARB_fragment_program spec (issue 24) for details.
- * XXX we count texture indirections in texenvprogram.c (maybe use this code
- * instead and elsewhere).
- */
-void
-_mesa_count_texture_indirections(struct gl_program *prog)
-{
- GLuint indirections = 1;
- GLbitfield tempsOutput = 0x0;
- GLbitfield aluTemps = 0x0;
- GLuint i;
-
- for (i = 0; i < prog->NumInstructions; i++) {
- const struct prog_instruction *inst = prog->Instructions + i;
-
- if (is_texture_instruction(inst)) {
- if (((inst->SrcReg[0].File == PROGRAM_TEMPORARY) &&
- (tempsOutput & (1 << inst->SrcReg[0].Index))) ||
- ((inst->Opcode != OPCODE_KIL) &&
- (inst->DstReg.File == PROGRAM_TEMPORARY) &&
- (aluTemps & (1 << inst->DstReg.Index))))
- {
- indirections++;
- tempsOutput = 0x0;
- aluTemps = 0x0;
- }
- }
- else {
- GLuint j;
- for (j = 0; j < 3; j++) {
- if (inst->SrcReg[j].File == PROGRAM_TEMPORARY)
- aluTemps |= (1 << inst->SrcReg[j].Index);
- }
- if (inst->DstReg.File == PROGRAM_TEMPORARY)
- aluTemps |= (1 << inst->DstReg.Index);
- }
-
- if ((inst->Opcode != OPCODE_KIL) && (inst->DstReg.File == PROGRAM_TEMPORARY))
- tempsOutput |= (1 << inst->DstReg.Index);
- }
-
- prog->NumTexIndirections = indirections;
-}
-
-
-/**
- * Count number of texture instructions in given program and update the
- * program's NumTexInstructions field.
- */
-void
-_mesa_count_texture_instructions(struct gl_program *prog)
-{
- GLuint i;
- prog->NumTexInstructions = 0;
- for (i = 0; i < prog->NumInstructions; i++) {
- prog->NumTexInstructions += is_texture_instruction(prog->Instructions + i);
- }
-}
-
-
-/**
- * Scan/rewrite program to remove reads of custom (output) registers.
- * The passed type has to be either PROGRAM_OUTPUT or PROGRAM_VARYING
- * (for vertex shaders).
- * In GLSL shaders, varying vars can be read and written.
- * On some hardware, trying to read an output register causes trouble.
- * So, rewrite the program to use a temporary register in this case.
- */
-void
-_mesa_remove_output_reads(struct gl_program *prog, gl_register_file type)
-{
- GLuint i;
- GLint outputMap[VERT_RESULT_MAX];
- GLuint numVaryingReads = 0;
- GLboolean usedTemps[MAX_PROGRAM_TEMPS];
- GLuint firstTemp = 0;
-
- _mesa_find_used_registers(prog, PROGRAM_TEMPORARY,
- usedTemps, MAX_PROGRAM_TEMPS);
-
- assert(type == PROGRAM_VARYING || type == PROGRAM_OUTPUT);
- assert(prog->Target == GL_VERTEX_PROGRAM_ARB || type != PROGRAM_VARYING);
-
- for (i = 0; i < VERT_RESULT_MAX; i++)
- outputMap[i] = -1;
-
- /* look for instructions which read from varying vars */
- for (i = 0; i < prog->NumInstructions; i++) {
- struct prog_instruction *inst = prog->Instructions + i;
- const GLuint numSrc = _mesa_num_inst_src_regs(inst->Opcode);
- GLuint j;
- for (j = 0; j < numSrc; j++) {
- if (inst->SrcReg[j].File == type) {
- /* replace the read with a temp reg */
- const GLuint var = inst->SrcReg[j].Index;
- if (outputMap[var] == -1) {
- numVaryingReads++;
- outputMap[var] = _mesa_find_free_register(usedTemps,
- MAX_PROGRAM_TEMPS,
- firstTemp);
- firstTemp = outputMap[var] + 1;
- }
- inst->SrcReg[j].File = PROGRAM_TEMPORARY;
- inst->SrcReg[j].Index = outputMap[var];
- }
- }
- }
-
- if (numVaryingReads == 0)
- return; /* nothing to be done */
-
- /* look for instructions which write to the varying vars identified above */
- for (i = 0; i < prog->NumInstructions; i++) {
- struct prog_instruction *inst = prog->Instructions + i;
- if (inst->DstReg.File == type &&
- outputMap[inst->DstReg.Index] >= 0) {
- /* change inst to write to the temp reg, instead of the varying */
- inst->DstReg.File = PROGRAM_TEMPORARY;
- inst->DstReg.Index = outputMap[inst->DstReg.Index];
- }
- }
-
- /* insert new instructions to copy the temp vars to the varying vars */
- {
- struct prog_instruction *inst;
- GLint endPos, var;
-
- /* Look for END instruction and insert the new varying writes */
- endPos = -1;
- for (i = 0; i < prog->NumInstructions; i++) {
- struct prog_instruction *inst = prog->Instructions + i;
- if (inst->Opcode == OPCODE_END) {
- endPos = i;
- _mesa_insert_instructions(prog, i, numVaryingReads);
- break;
- }
- }
-
- assert(endPos >= 0);
-
- /* insert new MOV instructions here */
- inst = prog->Instructions + endPos;
- for (var = 0; var < VERT_RESULT_MAX; var++) {
- if (outputMap[var] >= 0) {
- /* MOV VAR[var], TEMP[tmp]; */
- inst->Opcode = OPCODE_MOV;
- inst->DstReg.File = type;
- inst->DstReg.Index = var;
- inst->SrcReg[0].File = PROGRAM_TEMPORARY;
- inst->SrcReg[0].Index = outputMap[var];
- inst++;
- }
- }
- }
-}
-
-
-/**
- * Make the given fragment program into a "no-op" shader.
- * Actually, just copy the incoming fragment color (or texcoord)
- * to the output color.
- * This is for debug/test purposes.
- */
-void
-_mesa_nop_fragment_program(struct gl_context *ctx, struct gl_fragment_program *prog)
-{
- struct prog_instruction *inst;
- GLuint inputAttr;
-
- inst = _mesa_alloc_instructions(2);
- if (!inst) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "_mesa_nop_fragment_program");
- return;
- }
-
- _mesa_init_instructions(inst, 2);
-
- inst[0].Opcode = OPCODE_MOV;
- inst[0].DstReg.File = PROGRAM_OUTPUT;
- inst[0].DstReg.Index = FRAG_RESULT_COLOR;
- inst[0].SrcReg[0].File = PROGRAM_INPUT;
- if (prog->Base.InputsRead & FRAG_BIT_COL0)
- inputAttr = FRAG_ATTRIB_COL0;
- else
- inputAttr = FRAG_ATTRIB_TEX0;
- inst[0].SrcReg[0].Index = inputAttr;
-
- inst[1].Opcode = OPCODE_END;
-
- _mesa_free_instructions(prog->Base.Instructions,
- prog->Base.NumInstructions);
-
- prog->Base.Instructions = inst;
- prog->Base.NumInstructions = 2;
- prog->Base.InputsRead = 1 << inputAttr;
- prog->Base.OutputsWritten = BITFIELD64_BIT(FRAG_RESULT_COLOR);
-}
-
-
-/**
- * \sa _mesa_nop_fragment_program
- * Replace the given vertex program with a "no-op" program that just
- * transforms vertex position and emits color.
- */
-void
-_mesa_nop_vertex_program(struct gl_context *ctx, struct gl_vertex_program *prog)
-{
- struct prog_instruction *inst;
- GLuint inputAttr;
-
- /*
- * Start with a simple vertex program that emits color.
- */
- inst = _mesa_alloc_instructions(2);
- if (!inst) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "_mesa_nop_vertex_program");
- return;
- }
-
- _mesa_init_instructions(inst, 2);
-
- inst[0].Opcode = OPCODE_MOV;
- inst[0].DstReg.File = PROGRAM_OUTPUT;
- inst[0].DstReg.Index = VERT_RESULT_COL0;
- inst[0].SrcReg[0].File = PROGRAM_INPUT;
- if (prog->Base.InputsRead & VERT_BIT_COLOR0)
- inputAttr = VERT_ATTRIB_COLOR0;
- else
- inputAttr = VERT_ATTRIB_TEX0;
- inst[0].SrcReg[0].Index = inputAttr;
-
- inst[1].Opcode = OPCODE_END;
-
- _mesa_free_instructions(prog->Base.Instructions,
- prog->Base.NumInstructions);
-
- prog->Base.Instructions = inst;
- prog->Base.NumInstructions = 2;
- prog->Base.InputsRead = 1 << inputAttr;
- prog->Base.OutputsWritten = BITFIELD64_BIT(VERT_RESULT_COL0);
-
- /*
- * Now insert code to do standard modelview/projection transformation.
- */
- _mesa_insert_mvp_code(ctx, prog);
-}
+/*
+ * Mesa 3-D graphics library
+ * Version: 6.5.3
+ *
+ * Copyright (C) 1999-2007 Brian Paul All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+/**
+ * \file programopt.c
+ * Vertex/Fragment program optimizations and transformations for program
+ * options, etc.
+ *
+ * \author Brian Paul
+ */
+
+
+#include "main/glheader.h"
+#include "main/context.h"
+#include "prog_parameter.h"
+#include "prog_statevars.h"
+#include "program.h"
+#include "programopt.h"
+#include "prog_instruction.h"
+
+
+/**
+ * This function inserts instructions for coordinate modelview * projection
+ * into a vertex program.
+ * May be used to implement the position_invariant option.
+ */
+static void
+_mesa_insert_mvp_dp4_code(struct gl_context *ctx, struct gl_vertex_program *vprog)
+{
+ struct prog_instruction *newInst;
+ const GLuint origLen = vprog->Base.NumInstructions;
+ const GLuint newLen = origLen + 4;
+ GLuint i;
+
+ /*
+ * Setup state references for the modelview/projection matrix.
+ * XXX we should check if these state vars are already declared.
+ */
+ static const gl_state_index mvpState[4][STATE_LENGTH] = {
+ { STATE_MVP_MATRIX, 0, 0, 0, 0 }, /* state.matrix.mvp.row[0] */
+ { STATE_MVP_MATRIX, 0, 1, 1, 0 }, /* state.matrix.mvp.row[1] */
+ { STATE_MVP_MATRIX, 0, 2, 2, 0 }, /* state.matrix.mvp.row[2] */
+ { STATE_MVP_MATRIX, 0, 3, 3, 0 }, /* state.matrix.mvp.row[3] */
+ };
+ GLint mvpRef[4];
+
+ for (i = 0; i < 4; i++) {
+ mvpRef[i] = _mesa_add_state_reference(vprog->Base.Parameters,
+ mvpState[i]);
+ }
+
+ /* Alloc storage for new instructions */
+ newInst = _mesa_alloc_instructions(newLen);
+ if (!newInst) {
+ _mesa_error(ctx, GL_OUT_OF_MEMORY,
+ "glProgramString(inserting position_invariant code)");
+ return;
+ }
+
+ /*
+ * Generated instructions:
+ * newInst[0] = DP4 result.position.x, mvp.row[0], vertex.position;
+ * newInst[1] = DP4 result.position.y, mvp.row[1], vertex.position;
+ * newInst[2] = DP4 result.position.z, mvp.row[2], vertex.position;
+ * newInst[3] = DP4 result.position.w, mvp.row[3], vertex.position;
+ */
+ _mesa_init_instructions(newInst, 4);
+ for (i = 0; i < 4; i++) {
+ newInst[i].Opcode = OPCODE_DP4;
+ newInst[i].DstReg.File = PROGRAM_OUTPUT;
+ newInst[i].DstReg.Index = VERT_RESULT_HPOS;
+ newInst[i].DstReg.WriteMask = (WRITEMASK_X << i);
+ newInst[i].SrcReg[0].File = PROGRAM_STATE_VAR;
+ newInst[i].SrcReg[0].Index = mvpRef[i];
+ newInst[i].SrcReg[0].Swizzle = SWIZZLE_NOOP;
+ newInst[i].SrcReg[1].File = PROGRAM_INPUT;
+ newInst[i].SrcReg[1].Index = VERT_ATTRIB_POS;
+ newInst[i].SrcReg[1].Swizzle = SWIZZLE_NOOP;
+ }
+
+ /* Append original instructions after new instructions */
+ _mesa_copy_instructions (newInst + 4, vprog->Base.Instructions, origLen);
+
+ /* free old instructions */
+ _mesa_free_instructions(vprog->Base.Instructions, origLen);
+
+ /* install new instructions */
+ vprog->Base.Instructions = newInst;
+ vprog->Base.NumInstructions = newLen;
+ vprog->Base.InputsRead |= VERT_BIT_POS;
+ vprog->Base.OutputsWritten |= BITFIELD64_BIT(VERT_RESULT_HPOS);
+}
+
+
+static void
+_mesa_insert_mvp_mad_code(struct gl_context *ctx, struct gl_vertex_program *vprog)
+{
+ struct prog_instruction *newInst;
+ const GLuint origLen = vprog->Base.NumInstructions;
+ const GLuint newLen = origLen + 4;
+ GLuint hposTemp;
+ GLuint i;
+
+ /*
+ * Setup state references for the modelview/projection matrix.
+ * XXX we should check if these state vars are already declared.
+ */
+ static const gl_state_index mvpState[4][STATE_LENGTH] = {
+ { STATE_MVP_MATRIX, 0, 0, 0, STATE_MATRIX_TRANSPOSE },
+ { STATE_MVP_MATRIX, 0, 1, 1, STATE_MATRIX_TRANSPOSE },
+ { STATE_MVP_MATRIX, 0, 2, 2, STATE_MATRIX_TRANSPOSE },
+ { STATE_MVP_MATRIX, 0, 3, 3, STATE_MATRIX_TRANSPOSE },
+ };
+ GLint mvpRef[4];
+
+ for (i = 0; i < 4; i++) {
+ mvpRef[i] = _mesa_add_state_reference(vprog->Base.Parameters,
+ mvpState[i]);
+ }
+
+ /* Alloc storage for new instructions */
+ newInst = _mesa_alloc_instructions(newLen);
+ if (!newInst) {
+ _mesa_error(ctx, GL_OUT_OF_MEMORY,
+ "glProgramString(inserting position_invariant code)");
+ return;
+ }
+
+ /* TEMP hposTemp; */
+ hposTemp = vprog->Base.NumTemporaries++;
+
+ /*
+ * Generated instructions:
+ * emit_op2(p, OPCODE_MUL, tmp, 0, swizzle1(src,X), mat[0]);
+ * emit_op3(p, OPCODE_MAD, tmp, 0, swizzle1(src,Y), mat[1], tmp);
+ * emit_op3(p, OPCODE_MAD, tmp, 0, swizzle1(src,Z), mat[2], tmp);
+ * emit_op3(p, OPCODE_MAD, dest, 0, swizzle1(src,W), mat[3], tmp);
+ */
+ _mesa_init_instructions(newInst, 4);
+
+ newInst[0].Opcode = OPCODE_MUL;
+ newInst[0].DstReg.File = PROGRAM_TEMPORARY;
+ newInst[0].DstReg.Index = hposTemp;
+ newInst[0].DstReg.WriteMask = WRITEMASK_XYZW;
+ newInst[0].SrcReg[0].File = PROGRAM_INPUT;
+ newInst[0].SrcReg[0].Index = VERT_ATTRIB_POS;
+ newInst[0].SrcReg[0].Swizzle = SWIZZLE_XXXX;
+ newInst[0].SrcReg[1].File = PROGRAM_STATE_VAR;
+ newInst[0].SrcReg[1].Index = mvpRef[0];
+ newInst[0].SrcReg[1].Swizzle = SWIZZLE_NOOP;
+
+ for (i = 1; i <= 2; i++) {
+ newInst[i].Opcode = OPCODE_MAD;
+ newInst[i].DstReg.File = PROGRAM_TEMPORARY;
+ newInst[i].DstReg.Index = hposTemp;
+ newInst[i].DstReg.WriteMask = WRITEMASK_XYZW;
+ newInst[i].SrcReg[0].File = PROGRAM_INPUT;
+ newInst[i].SrcReg[0].Index = VERT_ATTRIB_POS;
+ newInst[i].SrcReg[0].Swizzle = MAKE_SWIZZLE4(i,i,i,i);
+ newInst[i].SrcReg[1].File = PROGRAM_STATE_VAR;
+ newInst[i].SrcReg[1].Index = mvpRef[i];
+ newInst[i].SrcReg[1].Swizzle = SWIZZLE_NOOP;
+ newInst[i].SrcReg[2].File = PROGRAM_TEMPORARY;
+ newInst[i].SrcReg[2].Index = hposTemp;
+ newInst[1].SrcReg[2].Swizzle = SWIZZLE_NOOP;
+ }
+
+ newInst[3].Opcode = OPCODE_MAD;
+ newInst[3].DstReg.File = PROGRAM_OUTPUT;
+ newInst[3].DstReg.Index = VERT_RESULT_HPOS;
+ newInst[3].DstReg.WriteMask = WRITEMASK_XYZW;
+ newInst[3].SrcReg[0].File = PROGRAM_INPUT;
+ newInst[3].SrcReg[0].Index = VERT_ATTRIB_POS;
+ newInst[3].SrcReg[0].Swizzle = SWIZZLE_WWWW;
+ newInst[3].SrcReg[1].File = PROGRAM_STATE_VAR;
+ newInst[3].SrcReg[1].Index = mvpRef[3];
+ newInst[3].SrcReg[1].Swizzle = SWIZZLE_NOOP;
+ newInst[3].SrcReg[2].File = PROGRAM_TEMPORARY;
+ newInst[3].SrcReg[2].Index = hposTemp;
+ newInst[3].SrcReg[2].Swizzle = SWIZZLE_NOOP;
+
+
+ /* Append original instructions after new instructions */
+ _mesa_copy_instructions (newInst + 4, vprog->Base.Instructions, origLen);
+
+ /* free old instructions */
+ _mesa_free_instructions(vprog->Base.Instructions, origLen);
+
+ /* install new instructions */
+ vprog->Base.Instructions = newInst;
+ vprog->Base.NumInstructions = newLen;
+ vprog->Base.InputsRead |= VERT_BIT_POS;
+ vprog->Base.OutputsWritten |= BITFIELD64_BIT(VERT_RESULT_HPOS);
+}
+
+
+void
+_mesa_insert_mvp_code(struct gl_context *ctx, struct gl_vertex_program *vprog)
+{
+ if (ctx->mvp_with_dp4)
+ _mesa_insert_mvp_dp4_code( ctx, vprog );
+ else
+ _mesa_insert_mvp_mad_code( ctx, vprog );
+}
+
+
+
+
+
+
+/**
+ * Append instructions to implement fog
+ *
+ * The \c fragment.fogcoord input is used to compute the fog blend factor.
+ *
+ * \param ctx The GL context
+ * \param fprog Fragment program that fog instructions will be appended to.
+ * \param fog_mode Fog mode. One of \c GL_EXP, \c GL_EXP2, or \c GL_LINEAR.
+ * \param saturate True if writes to color outputs should be clamped to [0, 1]
+ *
+ * \note
+ * This function sets \c FRAG_BIT_FOGC in \c fprog->Base.InputsRead.
+ *
+ * \todo With a little work, this function could be adapted to add fog code
+ * to vertex programs too.
+ */
+void
+_mesa_append_fog_code(struct gl_context *ctx,
+ struct gl_fragment_program *fprog, GLenum fog_mode,
+ GLboolean saturate)
+{
+ static const gl_state_index fogPStateOpt[STATE_LENGTH]
+ = { STATE_INTERNAL, STATE_FOG_PARAMS_OPTIMIZED, 0, 0, 0 };
+ static const gl_state_index fogColorState[STATE_LENGTH]
+ = { STATE_FOG_COLOR, 0, 0, 0, 0};
+ struct prog_instruction *newInst, *inst;
+ const GLuint origLen = fprog->Base.NumInstructions;
+ const GLuint newLen = origLen + 5;
+ GLuint i;
+ GLint fogPRefOpt, fogColorRef; /* state references */
+ GLuint colorTemp, fogFactorTemp; /* temporary registerss */
+
+ if (fog_mode == GL_NONE) {
+ _mesa_problem(ctx, "_mesa_append_fog_code() called for fragment program"
+ " with fog_mode == GL_NONE");
+ return;
+ }
+
+ if (!(fprog->Base.OutputsWritten & (1 << FRAG_RESULT_COLOR))) {
+ /* program doesn't output color, so nothing to do */
+ return;
+ }
+
+ /* Alloc storage for new instructions */
+ newInst = _mesa_alloc_instructions(newLen);
+ if (!newInst) {
+ _mesa_error(ctx, GL_OUT_OF_MEMORY,
+ "glProgramString(inserting fog_option code)");
+ return;
+ }
+
+ /* Copy orig instructions into new instruction buffer */
+ _mesa_copy_instructions(newInst, fprog->Base.Instructions, origLen);
+
+ /* PARAM fogParamsRefOpt = internal optimized fog params; */
+ fogPRefOpt
+ = _mesa_add_state_reference(fprog->Base.Parameters, fogPStateOpt);
+ /* PARAM fogColorRef = state.fog.color; */
+ fogColorRef
+ = _mesa_add_state_reference(fprog->Base.Parameters, fogColorState);
+
+ /* TEMP colorTemp; */
+ colorTemp = fprog->Base.NumTemporaries++;
+ /* TEMP fogFactorTemp; */
+ fogFactorTemp = fprog->Base.NumTemporaries++;
+
+ /* Scan program to find where result.color is written */
+ inst = newInst;
+ for (i = 0; i < fprog->Base.NumInstructions; i++) {
+ if (inst->Opcode == OPCODE_END)
+ break;
+ if (inst->DstReg.File == PROGRAM_OUTPUT &&
+ inst->DstReg.Index == FRAG_RESULT_COLOR) {
+ /* change the instruction to write to colorTemp w/ clamping */
+ inst->DstReg.File = PROGRAM_TEMPORARY;
+ inst->DstReg.Index = colorTemp;
+ inst->SaturateMode = saturate;
+ /* don't break (may be several writes to result.color) */
+ }
+ inst++;
+ }
+ assert(inst->Opcode == OPCODE_END); /* we'll overwrite this inst */
+
+ _mesa_init_instructions(inst, 5);
+
+ /* emit instructions to compute fog blending factor */
+ /* this is always clamped to [0, 1] regardless of fragment clamping */
+ if (fog_mode == GL_LINEAR) {
+ /* MAD fogFactorTemp.x, fragment.fogcoord.x, fogPRefOpt.x, fogPRefOpt.y; */
+ inst->Opcode = OPCODE_MAD;
+ inst->DstReg.File = PROGRAM_TEMPORARY;
+ inst->DstReg.Index = fogFactorTemp;
+ inst->DstReg.WriteMask = WRITEMASK_X;
+ inst->SrcReg[0].File = PROGRAM_INPUT;
+ inst->SrcReg[0].Index = FRAG_ATTRIB_FOGC;
+ inst->SrcReg[0].Swizzle = SWIZZLE_XXXX;
+ inst->SrcReg[1].File = PROGRAM_STATE_VAR;
+ inst->SrcReg[1].Index = fogPRefOpt;
+ inst->SrcReg[1].Swizzle = SWIZZLE_XXXX;
+ inst->SrcReg[2].File = PROGRAM_STATE_VAR;
+ inst->SrcReg[2].Index = fogPRefOpt;
+ inst->SrcReg[2].Swizzle = SWIZZLE_YYYY;
+ inst->SaturateMode = SATURATE_ZERO_ONE;
+ inst++;
+ }
+ else {
+ ASSERT(fog_mode == GL_EXP || fog_mode == GL_EXP2);
+ /* fogPRefOpt.z = d/ln(2), fogPRefOpt.w = d/sqrt(ln(2) */
+ /* EXP: MUL fogFactorTemp.x, fogPRefOpt.z, fragment.fogcoord.x; */
+ /* EXP2: MUL fogFactorTemp.x, fogPRefOpt.w, fragment.fogcoord.x; */
+ inst->Opcode = OPCODE_MUL;
+ inst->DstReg.File = PROGRAM_TEMPORARY;
+ inst->DstReg.Index = fogFactorTemp;
+ inst->DstReg.WriteMask = WRITEMASK_X;
+ inst->SrcReg[0].File = PROGRAM_STATE_VAR;
+ inst->SrcReg[0].Index = fogPRefOpt;
+ inst->SrcReg[0].Swizzle
+ = (fog_mode == GL_EXP) ? SWIZZLE_ZZZZ : SWIZZLE_WWWW;
+ inst->SrcReg[1].File = PROGRAM_INPUT;
+ inst->SrcReg[1].Index = FRAG_ATTRIB_FOGC;
+ inst->SrcReg[1].Swizzle = SWIZZLE_XXXX;
+ inst++;
+ if (fog_mode == GL_EXP2) {
+ /* MUL fogFactorTemp.x, fogFactorTemp.x, fogFactorTemp.x; */
+ inst->Opcode = OPCODE_MUL;
+ inst->DstReg.File = PROGRAM_TEMPORARY;
+ inst->DstReg.Index = fogFactorTemp;
+ inst->DstReg.WriteMask = WRITEMASK_X;
+ inst->SrcReg[0].File = PROGRAM_TEMPORARY;
+ inst->SrcReg[0].Index = fogFactorTemp;
+ inst->SrcReg[0].Swizzle = SWIZZLE_XXXX;
+ inst->SrcReg[1].File = PROGRAM_TEMPORARY;
+ inst->SrcReg[1].Index = fogFactorTemp;
+ inst->SrcReg[1].Swizzle = SWIZZLE_XXXX;
+ inst++;
+ }
+ /* EX2_SAT fogFactorTemp.x, -fogFactorTemp.x; */
+ inst->Opcode = OPCODE_EX2;
+ inst->DstReg.File = PROGRAM_TEMPORARY;
+ inst->DstReg.Index = fogFactorTemp;
+ inst->DstReg.WriteMask = WRITEMASK_X;
+ inst->SrcReg[0].File = PROGRAM_TEMPORARY;
+ inst->SrcReg[0].Index = fogFactorTemp;
+ inst->SrcReg[0].Negate = NEGATE_XYZW;
+ inst->SrcReg[0].Swizzle = SWIZZLE_XXXX;
+ inst->SaturateMode = SATURATE_ZERO_ONE;
+ inst++;
+ }
+ /* LRP result.color.xyz, fogFactorTemp.xxxx, colorTemp, fogColorRef; */
+ inst->Opcode = OPCODE_LRP;
+ inst->DstReg.File = PROGRAM_OUTPUT;
+ inst->DstReg.Index = FRAG_RESULT_COLOR;
+ inst->DstReg.WriteMask = WRITEMASK_XYZ;
+ inst->SrcReg[0].File = PROGRAM_TEMPORARY;
+ inst->SrcReg[0].Index = fogFactorTemp;
+ inst->SrcReg[0].Swizzle = SWIZZLE_XXXX;
+ inst->SrcReg[1].File = PROGRAM_TEMPORARY;
+ inst->SrcReg[1].Index = colorTemp;
+ inst->SrcReg[1].Swizzle = SWIZZLE_NOOP;
+ inst->SrcReg[2].File = PROGRAM_STATE_VAR;
+ inst->SrcReg[2].Index = fogColorRef;
+ inst->SrcReg[2].Swizzle = SWIZZLE_NOOP;
+ inst++;
+ /* MOV result.color.w, colorTemp.x; # copy alpha */
+ inst->Opcode = OPCODE_MOV;
+ inst->DstReg.File = PROGRAM_OUTPUT;
+ inst->DstReg.Index = FRAG_RESULT_COLOR;
+ inst->DstReg.WriteMask = WRITEMASK_W;
+ inst->SrcReg[0].File = PROGRAM_TEMPORARY;
+ inst->SrcReg[0].Index = colorTemp;
+ inst->SrcReg[0].Swizzle = SWIZZLE_NOOP;
+ inst++;
+ /* END; */
+ inst->Opcode = OPCODE_END;
+ inst++;
+
+ /* free old instructions */
+ _mesa_free_instructions(fprog->Base.Instructions, origLen);
+
+ /* install new instructions */
+ fprog->Base.Instructions = newInst;
+ fprog->Base.NumInstructions = inst - newInst;
+ fprog->Base.InputsRead |= FRAG_BIT_FOGC;
+ assert(fprog->Base.OutputsWritten & (1 << FRAG_RESULT_COLOR));
+}
+
+
+
+static GLboolean
+is_texture_instruction(const struct prog_instruction *inst)
+{
+ switch (inst->Opcode) {
+ case OPCODE_TEX:
+ case OPCODE_TXB:
+ case OPCODE_TXD:
+ case OPCODE_TXL:
+ case OPCODE_TXP:
+ case OPCODE_TXP_NV:
+ return GL_TRUE;
+ default:
+ return GL_FALSE;
+ }
+}
+
+
+/**
+ * Count the number of texure indirections in the given program.
+ * The program's NumTexIndirections field will be updated.
+ * See the GL_ARB_fragment_program spec (issue 24) for details.
+ * XXX we count texture indirections in texenvprogram.c (maybe use this code
+ * instead and elsewhere).
+ */
+void
+_mesa_count_texture_indirections(struct gl_program *prog)
+{
+ GLuint indirections = 1;
+ GLbitfield tempsOutput = 0x0;
+ GLbitfield aluTemps = 0x0;
+ GLuint i;
+
+ for (i = 0; i < prog->NumInstructions; i++) {
+ const struct prog_instruction *inst = prog->Instructions + i;
+
+ if (is_texture_instruction(inst)) {
+ if (((inst->SrcReg[0].File == PROGRAM_TEMPORARY) &&
+ (tempsOutput & (1 << inst->SrcReg[0].Index))) ||
+ ((inst->Opcode != OPCODE_KIL) &&
+ (inst->DstReg.File == PROGRAM_TEMPORARY) &&
+ (aluTemps & (1 << inst->DstReg.Index))))
+ {
+ indirections++;
+ tempsOutput = 0x0;
+ aluTemps = 0x0;
+ }
+ }
+ else {
+ GLuint j;
+ for (j = 0; j < 3; j++) {
+ if (inst->SrcReg[j].File == PROGRAM_TEMPORARY)
+ aluTemps |= (1 << inst->SrcReg[j].Index);
+ }
+ if (inst->DstReg.File == PROGRAM_TEMPORARY)
+ aluTemps |= (1 << inst->DstReg.Index);
+ }
+
+ if ((inst->Opcode != OPCODE_KIL) && (inst->DstReg.File == PROGRAM_TEMPORARY))
+ tempsOutput |= (1 << inst->DstReg.Index);
+ }
+
+ prog->NumTexIndirections = indirections;
+}
+
+
+/**
+ * Count number of texture instructions in given program and update the
+ * program's NumTexInstructions field.
+ */
+void
+_mesa_count_texture_instructions(struct gl_program *prog)
+{
+ GLuint i;
+ prog->NumTexInstructions = 0;
+ for (i = 0; i < prog->NumInstructions; i++) {
+ prog->NumTexInstructions += is_texture_instruction(prog->Instructions + i);
+ }
+}
+
+
+/**
+ * Scan/rewrite program to remove reads of custom (output) registers.
+ * The passed type has to be either PROGRAM_OUTPUT or PROGRAM_VARYING
+ * (for vertex shaders).
+ * In GLSL shaders, varying vars can be read and written.
+ * On some hardware, trying to read an output register causes trouble.
+ * So, rewrite the program to use a temporary register in this case.
+ */
+void
+_mesa_remove_output_reads(struct gl_program *prog, gl_register_file type)
+{
+ GLuint i;
+ GLint outputMap[VERT_RESULT_MAX];
+ GLuint numVaryingReads = 0;
+ GLboolean usedTemps[MAX_PROGRAM_TEMPS];
+ GLuint firstTemp = 0;
+
+ _mesa_find_used_registers(prog, PROGRAM_TEMPORARY,
+ usedTemps, MAX_PROGRAM_TEMPS);
+
+ assert(type == PROGRAM_VARYING || type == PROGRAM_OUTPUT);
+ assert(prog->Target == GL_VERTEX_PROGRAM_ARB || type != PROGRAM_VARYING);
+
+ for (i = 0; i < VERT_RESULT_MAX; i++)
+ outputMap[i] = -1;
+
+ /* look for instructions which read from varying vars */
+ for (i = 0; i < prog->NumInstructions; i++) {
+ struct prog_instruction *inst = prog->Instructions + i;
+ const GLuint numSrc = _mesa_num_inst_src_regs(inst->Opcode);
+ GLuint j;
+ for (j = 0; j < numSrc; j++) {
+ if (inst->SrcReg[j].File == type) {
+ /* replace the read with a temp reg */
+ const GLuint var = inst->SrcReg[j].Index;
+ if (outputMap[var] == -1) {
+ numVaryingReads++;
+ outputMap[var] = _mesa_find_free_register(usedTemps,
+ MAX_PROGRAM_TEMPS,
+ firstTemp);
+ firstTemp = outputMap[var] + 1;
+ }
+ inst->SrcReg[j].File = PROGRAM_TEMPORARY;
+ inst->SrcReg[j].Index = outputMap[var];
+ }
+ }
+ }
+
+ if (numVaryingReads == 0)
+ return; /* nothing to be done */
+
+ /* look for instructions which write to the varying vars identified above */
+ for (i = 0; i < prog->NumInstructions; i++) {
+ struct prog_instruction *inst = prog->Instructions + i;
+ if (inst->DstReg.File == type &&
+ outputMap[inst->DstReg.Index] >= 0) {
+ /* change inst to write to the temp reg, instead of the varying */
+ inst->DstReg.File = PROGRAM_TEMPORARY;
+ inst->DstReg.Index = outputMap[inst->DstReg.Index];
+ }
+ }
+
+ /* insert new instructions to copy the temp vars to the varying vars */
+ {
+ struct prog_instruction *inst;
+ GLint endPos, var;
+
+ /* Look for END instruction and insert the new varying writes */
+ endPos = -1;
+ for (i = 0; i < prog->NumInstructions; i++) {
+ struct prog_instruction *inst = prog->Instructions + i;
+ if (inst->Opcode == OPCODE_END) {
+ endPos = i;
+ _mesa_insert_instructions(prog, i, numVaryingReads);
+ break;
+ }
+ }
+
+ assert(endPos >= 0);
+
+ /* insert new MOV instructions here */
+ inst = prog->Instructions + endPos;
+ for (var = 0; var < VERT_RESULT_MAX; var++) {
+ if (outputMap[var] >= 0) {
+ /* MOV VAR[var], TEMP[tmp]; */
+ inst->Opcode = OPCODE_MOV;
+ inst->DstReg.File = type;
+ inst->DstReg.Index = var;
+ inst->SrcReg[0].File = PROGRAM_TEMPORARY;
+ inst->SrcReg[0].Index = outputMap[var];
+ inst++;
+ }
+ }
+ }
+}
+
+
+/**
+ * Make the given fragment program into a "no-op" shader.
+ * Actually, just copy the incoming fragment color (or texcoord)
+ * to the output color.
+ * This is for debug/test purposes.
+ */
+void
+_mesa_nop_fragment_program(struct gl_context *ctx, struct gl_fragment_program *prog)
+{
+ struct prog_instruction *inst;
+ GLuint inputAttr;
+
+ inst = _mesa_alloc_instructions(2);
+ if (!inst) {
+ _mesa_error(ctx, GL_OUT_OF_MEMORY, "_mesa_nop_fragment_program");
+ return;
+ }
+
+ _mesa_init_instructions(inst, 2);
+
+ inst[0].Opcode = OPCODE_MOV;
+ inst[0].DstReg.File = PROGRAM_OUTPUT;
+ inst[0].DstReg.Index = FRAG_RESULT_COLOR;
+ inst[0].SrcReg[0].File = PROGRAM_INPUT;
+ if (prog->Base.InputsRead & FRAG_BIT_COL0)
+ inputAttr = FRAG_ATTRIB_COL0;
+ else
+ inputAttr = FRAG_ATTRIB_TEX0;
+ inst[0].SrcReg[0].Index = inputAttr;
+
+ inst[1].Opcode = OPCODE_END;
+
+ _mesa_free_instructions(prog->Base.Instructions,
+ prog->Base.NumInstructions);
+
+ prog->Base.Instructions = inst;
+ prog->Base.NumInstructions = 2;
+ prog->Base.InputsRead = 1 << inputAttr;
+ prog->Base.OutputsWritten = BITFIELD64_BIT(FRAG_RESULT_COLOR);
+}
+
+
+/**
+ * \sa _mesa_nop_fragment_program
+ * Replace the given vertex program with a "no-op" program that just
+ * transforms vertex position and emits color.
+ */
+void
+_mesa_nop_vertex_program(struct gl_context *ctx, struct gl_vertex_program *prog)
+{
+ struct prog_instruction *inst;
+ GLuint inputAttr;
+
+ /*
+ * Start with a simple vertex program that emits color.
+ */
+ inst = _mesa_alloc_instructions(2);
+ if (!inst) {
+ _mesa_error(ctx, GL_OUT_OF_MEMORY, "_mesa_nop_vertex_program");
+ return;
+ }
+
+ _mesa_init_instructions(inst, 2);
+
+ inst[0].Opcode = OPCODE_MOV;
+ inst[0].DstReg.File = PROGRAM_OUTPUT;
+ inst[0].DstReg.Index = VERT_RESULT_COL0;
+ inst[0].SrcReg[0].File = PROGRAM_INPUT;
+ if (prog->Base.InputsRead & VERT_BIT_COLOR0)
+ inputAttr = VERT_ATTRIB_COLOR0;
+ else
+ inputAttr = VERT_ATTRIB_TEX0;
+ inst[0].SrcReg[0].Index = inputAttr;
+
+ inst[1].Opcode = OPCODE_END;
+
+ _mesa_free_instructions(prog->Base.Instructions,
+ prog->Base.NumInstructions);
+
+ prog->Base.Instructions = inst;
+ prog->Base.NumInstructions = 2;
+ prog->Base.InputsRead = 1 << inputAttr;
+ prog->Base.OutputsWritten = BITFIELD64_BIT(VERT_RESULT_COL0);
+
+ /*
+ * Now insert code to do standard modelview/projection transformation.
+ */
+ _mesa_insert_mvp_code(ctx, prog);
+}
diff --git a/mesalib/src/mesa/program/programopt.h b/mesalib/src/mesa/program/programopt.h
index b9205823c..99d7c3757 100644
--- a/mesalib/src/mesa/program/programopt.h
+++ b/mesalib/src/mesa/program/programopt.h
@@ -1,55 +1,55 @@
-/*
- * Mesa 3-D graphics library
- * Version: 6.5.3
- *
- * Copyright (C) 1999-2007 Brian Paul All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-
-#ifndef PROGRAMOPT_H
-#define PROGRAMOPT_H 1
-
-#include "main/mtypes.h"
-
-extern void
-_mesa_insert_mvp_code(struct gl_context *ctx, struct gl_vertex_program *vprog);
-
-extern void
-_mesa_append_fog_code(struct gl_context *ctx,
- struct gl_fragment_program *fprog, GLenum fog_mode,
- GLboolean saturate);
-
-extern void
-_mesa_count_texture_indirections(struct gl_program *prog);
-
-extern void
-_mesa_count_texture_instructions(struct gl_program *prog);
-
-extern void
-_mesa_remove_output_reads(struct gl_program *prog, gl_register_file type);
-
-extern void
-_mesa_nop_fragment_program(struct gl_context *ctx, struct gl_fragment_program *prog);
-
-extern void
-_mesa_nop_vertex_program(struct gl_context *ctx, struct gl_vertex_program *prog);
-
-
-#endif /* PROGRAMOPT_H */
+/*
+ * Mesa 3-D graphics library
+ * Version: 6.5.3
+ *
+ * Copyright (C) 1999-2007 Brian Paul All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+
+#ifndef PROGRAMOPT_H
+#define PROGRAMOPT_H 1
+
+#include "main/mtypes.h"
+
+extern void
+_mesa_insert_mvp_code(struct gl_context *ctx, struct gl_vertex_program *vprog);
+
+extern void
+_mesa_append_fog_code(struct gl_context *ctx,
+ struct gl_fragment_program *fprog, GLenum fog_mode,
+ GLboolean saturate);
+
+extern void
+_mesa_count_texture_indirections(struct gl_program *prog);
+
+extern void
+_mesa_count_texture_instructions(struct gl_program *prog);
+
+extern void
+_mesa_remove_output_reads(struct gl_program *prog, gl_register_file type);
+
+extern void
+_mesa_nop_fragment_program(struct gl_context *ctx, struct gl_fragment_program *prog);
+
+extern void
+_mesa_nop_vertex_program(struct gl_context *ctx, struct gl_vertex_program *prog);
+
+
+#endif /* PROGRAMOPT_H */
diff --git a/mesalib/src/mesa/program/register_allocate.c b/mesalib/src/mesa/program/register_allocate.c
index de96eb42c..095d53796 100644
--- a/mesalib/src/mesa/program/register_allocate.c
+++ b/mesalib/src/mesa/program/register_allocate.c
@@ -1,537 +1,537 @@
-/*
- * Copyright © 2010 Intel Corporation
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
- * IN THE SOFTWARE.
- *
- * Authors:
- * Eric Anholt <eric@anholt.net>
- *
- */
-
-/** @file register_allocate.c
- *
- * Graph-coloring register allocator.
- *
- * The basic idea of graph coloring is to make a node in a graph for
- * every thing that needs a register (color) number assigned, and make
- * edges in the graph between nodes that interfere (can't be allocated
- * to the same register at the same time).
- *
- * During the "simplify" process, any any node with fewer edges than
- * there are registers means that that edge can get assigned a
- * register regardless of what its neighbors choose, so that node is
- * pushed on a stack and removed (with its edges) from the graph.
- * That likely causes other nodes to become trivially colorable as well.
- *
- * Then during the "select" process, nodes are popped off of that
- * stack, their edges restored, and assigned a color different from
- * their neighbors. Because they were pushed on the stack only when
- * they were trivially colorable, any color chosen won't interfere
- * with the registers to be popped later.
- *
- * The downside to most graph coloring is that real hardware often has
- * limitations, like registers that need to be allocated to a node in
- * pairs, or aligned on some boundary. This implementation follows
- * the paper "Retargetable Graph-Coloring Register Allocation for
- * Irregular Architectures" by Johan Runeson and Sven-Olof Nyström.
- *
- * In this system, there are register classes each containing various
- * registers, and registers may interfere with other registers. For
- * example, one might have a class of base registers, and a class of
- * aligned register pairs that would each interfere with their pair of
- * the base registers. Each node has a register class it needs to be
- * assigned to. Define p(B) to be the size of register class B, and
- * q(B,C) to be the number of registers in B that the worst choice
- * register in C could conflict with. Then, this system replaces the
- * basic graph coloring test of "fewer edges from this node than there
- * are registers" with "For this node of class B, the sum of q(B,C)
- * for each neighbor node of class C is less than pB".
- *
- * A nice feature of the pq test is that q(B,C) can be computed once
- * up front and stored in a 2-dimensional array, so that the cost of
- * coloring a node is constant with the number of registers. We do
- * this during ra_set_finalize().
- */
-
-#include <ralloc.h>
-
-#include "main/imports.h"
-#include "main/macros.h"
-#include "main/mtypes.h"
-#include "register_allocate.h"
-
-#define NO_REG ~0
-
-struct ra_reg {
- GLboolean *conflicts;
- unsigned int *conflict_list;
- unsigned int conflict_list_size;
- unsigned int num_conflicts;
-};
-
-struct ra_regs {
- struct ra_reg *regs;
- unsigned int count;
-
- struct ra_class **classes;
- unsigned int class_count;
-};
-
-struct ra_class {
- GLboolean *regs;
-
- /**
- * p(B) in Runeson/Nyström paper.
- *
- * This is "how many regs are in the set."
- */
- unsigned int p;
-
- /**
- * q(B,C) (indexed by C, B is this register class) in
- * Runeson/Nyström paper. This is "how many registers of B could
- * the worst choice register from C conflict with".
- */
- unsigned int *q;
-};
-
-struct ra_node {
- /** @{
- *
- * List of which nodes this node interferes with. This should be
- * symmetric with the other node.
- */
- GLboolean *adjacency;
- unsigned int *adjacency_list;
- unsigned int adjacency_count;
- /** @} */
-
- unsigned int class;
-
- /* Register, if assigned, or NO_REG. */
- unsigned int reg;
-
- /**
- * Set when the node is in the trivially colorable stack. When
- * set, the adjacency to this node is ignored, to implement the
- * "remove the edge from the graph" in simplification without
- * having to actually modify the adjacency_list.
- */
- GLboolean in_stack;
-
- /* For an implementation that needs register spilling, this is the
- * approximate cost of spilling this node.
- */
- float spill_cost;
-};
-
-struct ra_graph {
- struct ra_regs *regs;
- /**
- * the variables that need register allocation.
- */
- struct ra_node *nodes;
- unsigned int count; /**< count of nodes. */
-
- unsigned int *stack;
- unsigned int stack_count;
-};
-
-struct ra_regs *
-ra_alloc_reg_set(unsigned int count)
-{
- unsigned int i;
- struct ra_regs *regs;
-
- regs = rzalloc(NULL, struct ra_regs);
- regs->count = count;
- regs->regs = rzalloc_array(regs, struct ra_reg, count);
-
- for (i = 0; i < count; i++) {
- regs->regs[i].conflicts = rzalloc_array(regs->regs, GLboolean, count);
- regs->regs[i].conflicts[i] = GL_TRUE;
-
- regs->regs[i].conflict_list = ralloc_array(regs->regs, unsigned int, 4);
- regs->regs[i].conflict_list_size = 4;
- regs->regs[i].conflict_list[0] = i;
- regs->regs[i].num_conflicts = 1;
- }
-
- return regs;
-}
-
-static void
-ra_add_conflict_list(struct ra_regs *regs, unsigned int r1, unsigned int r2)
-{
- struct ra_reg *reg1 = &regs->regs[r1];
-
- if (reg1->conflict_list_size == reg1->num_conflicts) {
- reg1->conflict_list_size *= 2;
- reg1->conflict_list = reralloc(regs->regs, reg1->conflict_list,
- unsigned int, reg1->conflict_list_size);
- }
- reg1->conflict_list[reg1->num_conflicts++] = r2;
- reg1->conflicts[r2] = GL_TRUE;
-}
-
-void
-ra_add_reg_conflict(struct ra_regs *regs, unsigned int r1, unsigned int r2)
-{
- if (!regs->regs[r1].conflicts[r2]) {
- ra_add_conflict_list(regs, r1, r2);
- ra_add_conflict_list(regs, r2, r1);
- }
-}
-
-unsigned int
-ra_alloc_reg_class(struct ra_regs *regs)
-{
- struct ra_class *class;
-
- regs->classes = reralloc(regs->regs, regs->classes, struct ra_class *,
- regs->class_count + 1);
-
- class = rzalloc(regs, struct ra_class);
- regs->classes[regs->class_count] = class;
-
- class->regs = rzalloc_array(class, GLboolean, regs->count);
-
- return regs->class_count++;
-}
-
-void
-ra_class_add_reg(struct ra_regs *regs, unsigned int c, unsigned int r)
-{
- struct ra_class *class = regs->classes[c];
-
- class->regs[r] = GL_TRUE;
- class->p++;
-}
-
-/**
- * Must be called after all conflicts and register classes have been
- * set up and before the register set is used for allocation.
- */
-void
-ra_set_finalize(struct ra_regs *regs)
-{
- unsigned int b, c;
-
- for (b = 0; b < regs->class_count; b++) {
- regs->classes[b]->q = ralloc_array(regs, unsigned int, regs->class_count);
- }
-
- /* Compute, for each class B and C, how many regs of B an
- * allocation to C could conflict with.
- */
- for (b = 0; b < regs->class_count; b++) {
- for (c = 0; c < regs->class_count; c++) {
- unsigned int rc;
- int max_conflicts = 0;
-
- for (rc = 0; rc < regs->count; rc++) {
- int conflicts = 0;
- int i;
-
- if (!regs->classes[c]->regs[rc])
- continue;
-
- for (i = 0; i < regs->regs[rc].num_conflicts; i++) {
- unsigned int rb = regs->regs[rc].conflict_list[i];
- if (regs->classes[b]->regs[rb])
- conflicts++;
- }
- max_conflicts = MAX2(max_conflicts, conflicts);
- }
- regs->classes[b]->q[c] = max_conflicts;
- }
- }
-}
-
-static void
-ra_add_node_adjacency(struct ra_graph *g, unsigned int n1, unsigned int n2)
-{
- g->nodes[n1].adjacency[n2] = GL_TRUE;
- g->nodes[n1].adjacency_list[g->nodes[n1].adjacency_count] = n2;
- g->nodes[n1].adjacency_count++;
-}
-
-struct ra_graph *
-ra_alloc_interference_graph(struct ra_regs *regs, unsigned int count)
-{
- struct ra_graph *g;
- unsigned int i;
-
- g = rzalloc(regs, struct ra_graph);
- g->regs = regs;
- g->nodes = rzalloc_array(g, struct ra_node, count);
- g->count = count;
-
- g->stack = rzalloc_array(g, unsigned int, count);
-
- for (i = 0; i < count; i++) {
- g->nodes[i].adjacency = rzalloc_array(g, GLboolean, count);
- g->nodes[i].adjacency_list = ralloc_array(g, unsigned int, count);
- g->nodes[i].adjacency_count = 0;
- ra_add_node_adjacency(g, i, i);
- g->nodes[i].reg = NO_REG;
- }
-
- return g;
-}
-
-void
-ra_set_node_class(struct ra_graph *g,
- unsigned int n, unsigned int class)
-{
- g->nodes[n].class = class;
-}
-
-void
-ra_add_node_interference(struct ra_graph *g,
- unsigned int n1, unsigned int n2)
-{
- if (!g->nodes[n1].adjacency[n2]) {
- ra_add_node_adjacency(g, n1, n2);
- ra_add_node_adjacency(g, n2, n1);
- }
-}
-
-static GLboolean pq_test(struct ra_graph *g, unsigned int n)
-{
- unsigned int j;
- unsigned int q = 0;
- int n_class = g->nodes[n].class;
-
- for (j = 0; j < g->nodes[n].adjacency_count; j++) {
- unsigned int n2 = g->nodes[n].adjacency_list[j];
- unsigned int n2_class = g->nodes[n2].class;
-
- if (n != n2 && !g->nodes[n2].in_stack) {
- q += g->regs->classes[n_class]->q[n2_class];
- }
- }
-
- return q < g->regs->classes[n_class]->p;
-}
-
-/**
- * Simplifies the interference graph by pushing all
- * trivially-colorable nodes into a stack of nodes to be colored,
- * removing them from the graph, and rinsing and repeating.
- *
- * Returns GL_TRUE if all nodes were removed from the graph. GL_FALSE
- * means that either spilling will be required, or optimistic coloring
- * should be applied.
- */
-GLboolean
-ra_simplify(struct ra_graph *g)
-{
- GLboolean progress = GL_TRUE;
- int i;
-
- while (progress) {
- progress = GL_FALSE;
-
- for (i = g->count - 1; i >= 0; i--) {
- if (g->nodes[i].in_stack || g->nodes[i].reg != NO_REG)
- continue;
-
- if (pq_test(g, i)) {
- g->stack[g->stack_count] = i;
- g->stack_count++;
- g->nodes[i].in_stack = GL_TRUE;
- progress = GL_TRUE;
- }
- }
- }
-
- for (i = 0; i < g->count; i++) {
- if (!g->nodes[i].in_stack)
- return GL_FALSE;
- }
-
- return GL_TRUE;
-}
-
-/**
- * Pops nodes from the stack back into the graph, coloring them with
- * registers as they go.
- *
- * If all nodes were trivially colorable, then this must succeed. If
- * not (optimistic coloring), then it may return GL_FALSE;
- */
-GLboolean
-ra_select(struct ra_graph *g)
-{
- int i;
-
- while (g->stack_count != 0) {
- unsigned int r;
- int n = g->stack[g->stack_count - 1];
- struct ra_class *c = g->regs->classes[g->nodes[n].class];
-
- /* Find the lowest-numbered reg which is not used by a member
- * of the graph adjacent to us.
- */
- for (r = 0; r < g->regs->count; r++) {
- if (!c->regs[r])
- continue;
-
- /* Check if any of our neighbors conflict with this register choice. */
- for (i = 0; i < g->nodes[n].adjacency_count; i++) {
- unsigned int n2 = g->nodes[n].adjacency_list[i];
-
- if (!g->nodes[n2].in_stack &&
- g->regs->regs[r].conflicts[g->nodes[n2].reg]) {
- break;
- }
- }
- if (i == g->nodes[n].adjacency_count)
- break;
- }
- if (r == g->regs->count)
- return GL_FALSE;
-
- g->nodes[n].reg = r;
- g->nodes[n].in_stack = GL_FALSE;
- g->stack_count--;
- }
-
- return GL_TRUE;
-}
-
-/**
- * Optimistic register coloring: Just push the remaining nodes
- * on the stack. They'll be colored first in ra_select(), and
- * if they succeed then the locally-colorable nodes are still
- * locally-colorable and the rest of the register allocation
- * will succeed.
- */
-void
-ra_optimistic_color(struct ra_graph *g)
-{
- unsigned int i;
-
- for (i = 0; i < g->count; i++) {
- if (g->nodes[i].in_stack || g->nodes[i].reg != NO_REG)
- continue;
-
- g->stack[g->stack_count] = i;
- g->stack_count++;
- g->nodes[i].in_stack = GL_TRUE;
- }
-}
-
-GLboolean
-ra_allocate_no_spills(struct ra_graph *g)
-{
- if (!ra_simplify(g)) {
- ra_optimistic_color(g);
- }
- return ra_select(g);
-}
-
-unsigned int
-ra_get_node_reg(struct ra_graph *g, unsigned int n)
-{
- return g->nodes[n].reg;
-}
-
-/**
- * Forces a node to a specific register. This can be used to avoid
- * creating a register class containing one node when handling data
- * that must live in a fixed location and is known to not conflict
- * with other forced register assignment (as is common with shader
- * input data). These nodes do not end up in the stack during
- * ra_simplify(), and thus at ra_select() time it is as if they were
- * the first popped off the stack and assigned their fixed locations.
- *
- * Must be called before ra_simplify().
- */
-void
-ra_set_node_reg(struct ra_graph *g, unsigned int n, unsigned int reg)
-{
- g->nodes[n].reg = reg;
- g->nodes[n].in_stack = GL_FALSE;
-}
-
-static float
-ra_get_spill_benefit(struct ra_graph *g, unsigned int n)
-{
- int j;
- float benefit = 0;
- int n_class = g->nodes[n].class;
-
- /* Define the benefit of eliminating an interference between n, n2
- * through spilling as q(C, B) / p(C). This is similar to the
- * "count number of edges" approach of traditional graph coloring,
- * but takes classes into account.
- */
- for (j = 0; j < g->nodes[n].adjacency_count; j++) {
- unsigned int n2 = g->nodes[n].adjacency_list[j];
- if (n != n2) {
- unsigned int n2_class = g->nodes[n2].class;
- benefit += ((float)g->regs->classes[n_class]->q[n2_class] /
- g->regs->classes[n_class]->p);
- }
- }
-
- return benefit;
-}
-
-/**
- * Returns a node number to be spilled according to the cost/benefit using
- * the pq test, or -1 if there are no spillable nodes.
- */
-int
-ra_get_best_spill_node(struct ra_graph *g)
-{
- unsigned int best_node = -1;
- unsigned int best_benefit = 0.0;
- unsigned int n;
-
- for (n = 0; n < g->count; n++) {
- float cost = g->nodes[n].spill_cost;
- float benefit;
-
- if (cost <= 0.0)
- continue;
-
- benefit = ra_get_spill_benefit(g, n);
-
- if (benefit / cost > best_benefit) {
- best_benefit = benefit / cost;
- best_node = n;
- }
- }
-
- return best_node;
-}
-
-/**
- * Only nodes with a spill cost set (cost != 0.0) will be considered
- * for register spilling.
- */
-void
-ra_set_node_spill_cost(struct ra_graph *g, unsigned int n, float cost)
-{
- g->nodes[n].spill_cost = cost;
-}
+/*
+ * Copyright © 2010 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ *
+ * Authors:
+ * Eric Anholt <eric@anholt.net>
+ *
+ */
+
+/** @file register_allocate.c
+ *
+ * Graph-coloring register allocator.
+ *
+ * The basic idea of graph coloring is to make a node in a graph for
+ * every thing that needs a register (color) number assigned, and make
+ * edges in the graph between nodes that interfere (can't be allocated
+ * to the same register at the same time).
+ *
+ * During the "simplify" process, any any node with fewer edges than
+ * there are registers means that that edge can get assigned a
+ * register regardless of what its neighbors choose, so that node is
+ * pushed on a stack and removed (with its edges) from the graph.
+ * That likely causes other nodes to become trivially colorable as well.
+ *
+ * Then during the "select" process, nodes are popped off of that
+ * stack, their edges restored, and assigned a color different from
+ * their neighbors. Because they were pushed on the stack only when
+ * they were trivially colorable, any color chosen won't interfere
+ * with the registers to be popped later.
+ *
+ * The downside to most graph coloring is that real hardware often has
+ * limitations, like registers that need to be allocated to a node in
+ * pairs, or aligned on some boundary. This implementation follows
+ * the paper "Retargetable Graph-Coloring Register Allocation for
+ * Irregular Architectures" by Johan Runeson and Sven-Olof Nyström.
+ *
+ * In this system, there are register classes each containing various
+ * registers, and registers may interfere with other registers. For
+ * example, one might have a class of base registers, and a class of
+ * aligned register pairs that would each interfere with their pair of
+ * the base registers. Each node has a register class it needs to be
+ * assigned to. Define p(B) to be the size of register class B, and
+ * q(B,C) to be the number of registers in B that the worst choice
+ * register in C could conflict with. Then, this system replaces the
+ * basic graph coloring test of "fewer edges from this node than there
+ * are registers" with "For this node of class B, the sum of q(B,C)
+ * for each neighbor node of class C is less than pB".
+ *
+ * A nice feature of the pq test is that q(B,C) can be computed once
+ * up front and stored in a 2-dimensional array, so that the cost of
+ * coloring a node is constant with the number of registers. We do
+ * this during ra_set_finalize().
+ */
+
+#include <ralloc.h>
+
+#include "main/imports.h"
+#include "main/macros.h"
+#include "main/mtypes.h"
+#include "register_allocate.h"
+
+#define NO_REG ~0
+
+struct ra_reg {
+ GLboolean *conflicts;
+ unsigned int *conflict_list;
+ unsigned int conflict_list_size;
+ unsigned int num_conflicts;
+};
+
+struct ra_regs {
+ struct ra_reg *regs;
+ unsigned int count;
+
+ struct ra_class **classes;
+ unsigned int class_count;
+};
+
+struct ra_class {
+ GLboolean *regs;
+
+ /**
+ * p(B) in Runeson/Nyström paper.
+ *
+ * This is "how many regs are in the set."
+ */
+ unsigned int p;
+
+ /**
+ * q(B,C) (indexed by C, B is this register class) in
+ * Runeson/Nyström paper. This is "how many registers of B could
+ * the worst choice register from C conflict with".
+ */
+ unsigned int *q;
+};
+
+struct ra_node {
+ /** @{
+ *
+ * List of which nodes this node interferes with. This should be
+ * symmetric with the other node.
+ */
+ GLboolean *adjacency;
+ unsigned int *adjacency_list;
+ unsigned int adjacency_count;
+ /** @} */
+
+ unsigned int class;
+
+ /* Register, if assigned, or NO_REG. */
+ unsigned int reg;
+
+ /**
+ * Set when the node is in the trivially colorable stack. When
+ * set, the adjacency to this node is ignored, to implement the
+ * "remove the edge from the graph" in simplification without
+ * having to actually modify the adjacency_list.
+ */
+ GLboolean in_stack;
+
+ /* For an implementation that needs register spilling, this is the
+ * approximate cost of spilling this node.
+ */
+ float spill_cost;
+};
+
+struct ra_graph {
+ struct ra_regs *regs;
+ /**
+ * the variables that need register allocation.
+ */
+ struct ra_node *nodes;
+ unsigned int count; /**< count of nodes. */
+
+ unsigned int *stack;
+ unsigned int stack_count;
+};
+
+struct ra_regs *
+ra_alloc_reg_set(unsigned int count)
+{
+ unsigned int i;
+ struct ra_regs *regs;
+
+ regs = rzalloc(NULL, struct ra_regs);
+ regs->count = count;
+ regs->regs = rzalloc_array(regs, struct ra_reg, count);
+
+ for (i = 0; i < count; i++) {
+ regs->regs[i].conflicts = rzalloc_array(regs->regs, GLboolean, count);
+ regs->regs[i].conflicts[i] = GL_TRUE;
+
+ regs->regs[i].conflict_list = ralloc_array(regs->regs, unsigned int, 4);
+ regs->regs[i].conflict_list_size = 4;
+ regs->regs[i].conflict_list[0] = i;
+ regs->regs[i].num_conflicts = 1;
+ }
+
+ return regs;
+}
+
+static void
+ra_add_conflict_list(struct ra_regs *regs, unsigned int r1, unsigned int r2)
+{
+ struct ra_reg *reg1 = &regs->regs[r1];
+
+ if (reg1->conflict_list_size == reg1->num_conflicts) {
+ reg1->conflict_list_size *= 2;
+ reg1->conflict_list = reralloc(regs->regs, reg1->conflict_list,
+ unsigned int, reg1->conflict_list_size);
+ }
+ reg1->conflict_list[reg1->num_conflicts++] = r2;
+ reg1->conflicts[r2] = GL_TRUE;
+}
+
+void
+ra_add_reg_conflict(struct ra_regs *regs, unsigned int r1, unsigned int r2)
+{
+ if (!regs->regs[r1].conflicts[r2]) {
+ ra_add_conflict_list(regs, r1, r2);
+ ra_add_conflict_list(regs, r2, r1);
+ }
+}
+
+unsigned int
+ra_alloc_reg_class(struct ra_regs *regs)
+{
+ struct ra_class *class;
+
+ regs->classes = reralloc(regs->regs, regs->classes, struct ra_class *,
+ regs->class_count + 1);
+
+ class = rzalloc(regs, struct ra_class);
+ regs->classes[regs->class_count] = class;
+
+ class->regs = rzalloc_array(class, GLboolean, regs->count);
+
+ return regs->class_count++;
+}
+
+void
+ra_class_add_reg(struct ra_regs *regs, unsigned int c, unsigned int r)
+{
+ struct ra_class *class = regs->classes[c];
+
+ class->regs[r] = GL_TRUE;
+ class->p++;
+}
+
+/**
+ * Must be called after all conflicts and register classes have been
+ * set up and before the register set is used for allocation.
+ */
+void
+ra_set_finalize(struct ra_regs *regs)
+{
+ unsigned int b, c;
+
+ for (b = 0; b < regs->class_count; b++) {
+ regs->classes[b]->q = ralloc_array(regs, unsigned int, regs->class_count);
+ }
+
+ /* Compute, for each class B and C, how many regs of B an
+ * allocation to C could conflict with.
+ */
+ for (b = 0; b < regs->class_count; b++) {
+ for (c = 0; c < regs->class_count; c++) {
+ unsigned int rc;
+ int max_conflicts = 0;
+
+ for (rc = 0; rc < regs->count; rc++) {
+ int conflicts = 0;
+ int i;
+
+ if (!regs->classes[c]->regs[rc])
+ continue;
+
+ for (i = 0; i < regs->regs[rc].num_conflicts; i++) {
+ unsigned int rb = regs->regs[rc].conflict_list[i];
+ if (regs->classes[b]->regs[rb])
+ conflicts++;
+ }
+ max_conflicts = MAX2(max_conflicts, conflicts);
+ }
+ regs->classes[b]->q[c] = max_conflicts;
+ }
+ }
+}
+
+static void
+ra_add_node_adjacency(struct ra_graph *g, unsigned int n1, unsigned int n2)
+{
+ g->nodes[n1].adjacency[n2] = GL_TRUE;
+ g->nodes[n1].adjacency_list[g->nodes[n1].adjacency_count] = n2;
+ g->nodes[n1].adjacency_count++;
+}
+
+struct ra_graph *
+ra_alloc_interference_graph(struct ra_regs *regs, unsigned int count)
+{
+ struct ra_graph *g;
+ unsigned int i;
+
+ g = rzalloc(regs, struct ra_graph);
+ g->regs = regs;
+ g->nodes = rzalloc_array(g, struct ra_node, count);
+ g->count = count;
+
+ g->stack = rzalloc_array(g, unsigned int, count);
+
+ for (i = 0; i < count; i++) {
+ g->nodes[i].adjacency = rzalloc_array(g, GLboolean, count);
+ g->nodes[i].adjacency_list = ralloc_array(g, unsigned int, count);
+ g->nodes[i].adjacency_count = 0;
+ ra_add_node_adjacency(g, i, i);
+ g->nodes[i].reg = NO_REG;
+ }
+
+ return g;
+}
+
+void
+ra_set_node_class(struct ra_graph *g,
+ unsigned int n, unsigned int class)
+{
+ g->nodes[n].class = class;
+}
+
+void
+ra_add_node_interference(struct ra_graph *g,
+ unsigned int n1, unsigned int n2)
+{
+ if (!g->nodes[n1].adjacency[n2]) {
+ ra_add_node_adjacency(g, n1, n2);
+ ra_add_node_adjacency(g, n2, n1);
+ }
+}
+
+static GLboolean pq_test(struct ra_graph *g, unsigned int n)
+{
+ unsigned int j;
+ unsigned int q = 0;
+ int n_class = g->nodes[n].class;
+
+ for (j = 0; j < g->nodes[n].adjacency_count; j++) {
+ unsigned int n2 = g->nodes[n].adjacency_list[j];
+ unsigned int n2_class = g->nodes[n2].class;
+
+ if (n != n2 && !g->nodes[n2].in_stack) {
+ q += g->regs->classes[n_class]->q[n2_class];
+ }
+ }
+
+ return q < g->regs->classes[n_class]->p;
+}
+
+/**
+ * Simplifies the interference graph by pushing all
+ * trivially-colorable nodes into a stack of nodes to be colored,
+ * removing them from the graph, and rinsing and repeating.
+ *
+ * Returns GL_TRUE if all nodes were removed from the graph. GL_FALSE
+ * means that either spilling will be required, or optimistic coloring
+ * should be applied.
+ */
+GLboolean
+ra_simplify(struct ra_graph *g)
+{
+ GLboolean progress = GL_TRUE;
+ int i;
+
+ while (progress) {
+ progress = GL_FALSE;
+
+ for (i = g->count - 1; i >= 0; i--) {
+ if (g->nodes[i].in_stack || g->nodes[i].reg != NO_REG)
+ continue;
+
+ if (pq_test(g, i)) {
+ g->stack[g->stack_count] = i;
+ g->stack_count++;
+ g->nodes[i].in_stack = GL_TRUE;
+ progress = GL_TRUE;
+ }
+ }
+ }
+
+ for (i = 0; i < g->count; i++) {
+ if (!g->nodes[i].in_stack)
+ return GL_FALSE;
+ }
+
+ return GL_TRUE;
+}
+
+/**
+ * Pops nodes from the stack back into the graph, coloring them with
+ * registers as they go.
+ *
+ * If all nodes were trivially colorable, then this must succeed. If
+ * not (optimistic coloring), then it may return GL_FALSE;
+ */
+GLboolean
+ra_select(struct ra_graph *g)
+{
+ int i;
+
+ while (g->stack_count != 0) {
+ unsigned int r;
+ int n = g->stack[g->stack_count - 1];
+ struct ra_class *c = g->regs->classes[g->nodes[n].class];
+
+ /* Find the lowest-numbered reg which is not used by a member
+ * of the graph adjacent to us.
+ */
+ for (r = 0; r < g->regs->count; r++) {
+ if (!c->regs[r])
+ continue;
+
+ /* Check if any of our neighbors conflict with this register choice. */
+ for (i = 0; i < g->nodes[n].adjacency_count; i++) {
+ unsigned int n2 = g->nodes[n].adjacency_list[i];
+
+ if (!g->nodes[n2].in_stack &&
+ g->regs->regs[r].conflicts[g->nodes[n2].reg]) {
+ break;
+ }
+ }
+ if (i == g->nodes[n].adjacency_count)
+ break;
+ }
+ if (r == g->regs->count)
+ return GL_FALSE;
+
+ g->nodes[n].reg = r;
+ g->nodes[n].in_stack = GL_FALSE;
+ g->stack_count--;
+ }
+
+ return GL_TRUE;
+}
+
+/**
+ * Optimistic register coloring: Just push the remaining nodes
+ * on the stack. They'll be colored first in ra_select(), and
+ * if they succeed then the locally-colorable nodes are still
+ * locally-colorable and the rest of the register allocation
+ * will succeed.
+ */
+void
+ra_optimistic_color(struct ra_graph *g)
+{
+ unsigned int i;
+
+ for (i = 0; i < g->count; i++) {
+ if (g->nodes[i].in_stack || g->nodes[i].reg != NO_REG)
+ continue;
+
+ g->stack[g->stack_count] = i;
+ g->stack_count++;
+ g->nodes[i].in_stack = GL_TRUE;
+ }
+}
+
+GLboolean
+ra_allocate_no_spills(struct ra_graph *g)
+{
+ if (!ra_simplify(g)) {
+ ra_optimistic_color(g);
+ }
+ return ra_select(g);
+}
+
+unsigned int
+ra_get_node_reg(struct ra_graph *g, unsigned int n)
+{
+ return g->nodes[n].reg;
+}
+
+/**
+ * Forces a node to a specific register. This can be used to avoid
+ * creating a register class containing one node when handling data
+ * that must live in a fixed location and is known to not conflict
+ * with other forced register assignment (as is common with shader
+ * input data). These nodes do not end up in the stack during
+ * ra_simplify(), and thus at ra_select() time it is as if they were
+ * the first popped off the stack and assigned their fixed locations.
+ *
+ * Must be called before ra_simplify().
+ */
+void
+ra_set_node_reg(struct ra_graph *g, unsigned int n, unsigned int reg)
+{
+ g->nodes[n].reg = reg;
+ g->nodes[n].in_stack = GL_FALSE;
+}
+
+static float
+ra_get_spill_benefit(struct ra_graph *g, unsigned int n)
+{
+ int j;
+ float benefit = 0;
+ int n_class = g->nodes[n].class;
+
+ /* Define the benefit of eliminating an interference between n, n2
+ * through spilling as q(C, B) / p(C). This is similar to the
+ * "count number of edges" approach of traditional graph coloring,
+ * but takes classes into account.
+ */
+ for (j = 0; j < g->nodes[n].adjacency_count; j++) {
+ unsigned int n2 = g->nodes[n].adjacency_list[j];
+ if (n != n2) {
+ unsigned int n2_class = g->nodes[n2].class;
+ benefit += ((float)g->regs->classes[n_class]->q[n2_class] /
+ g->regs->classes[n_class]->p);
+ }
+ }
+
+ return benefit;
+}
+
+/**
+ * Returns a node number to be spilled according to the cost/benefit using
+ * the pq test, or -1 if there are no spillable nodes.
+ */
+int
+ra_get_best_spill_node(struct ra_graph *g)
+{
+ unsigned int best_node = -1;
+ unsigned int best_benefit = 0.0;
+ unsigned int n;
+
+ for (n = 0; n < g->count; n++) {
+ float cost = g->nodes[n].spill_cost;
+ float benefit;
+
+ if (cost <= 0.0)
+ continue;
+
+ benefit = ra_get_spill_benefit(g, n);
+
+ if (benefit / cost > best_benefit) {
+ best_benefit = benefit / cost;
+ best_node = n;
+ }
+ }
+
+ return best_node;
+}
+
+/**
+ * Only nodes with a spill cost set (cost != 0.0) will be considered
+ * for register spilling.
+ */
+void
+ra_set_node_spill_cost(struct ra_graph *g, unsigned int n, float cost)
+{
+ g->nodes[n].spill_cost = cost;
+}
diff --git a/mesalib/src/mesa/program/register_allocate.h b/mesalib/src/mesa/program/register_allocate.h
index 5b95833f3..1345debd0 100644
--- a/mesalib/src/mesa/program/register_allocate.h
+++ b/mesalib/src/mesa/program/register_allocate.h
@@ -1,72 +1,72 @@
-/*
- * Copyright © 2010 Intel Corporation
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
- * IN THE SOFTWARE.
- *
- * Authors:
- * Eric Anholt <eric@anholt.net>
- *
- */
-
-struct ra_class;
-struct ra_regs;
-
-/* @{
- * Register set setup.
- *
- * This should be done once at backend initializaion, as
- * ra_set_finalize is O(r^2*c^2). The registers may be virtual
- * registers, such as aligned register pairs that conflict with the
- * two real registers from which they are composed.
- */
-struct ra_regs *ra_alloc_reg_set(unsigned int count);
-unsigned int ra_alloc_reg_class(struct ra_regs *regs);
-void ra_add_reg_conflict(struct ra_regs *regs,
- unsigned int r1, unsigned int r2);
-void ra_class_add_reg(struct ra_regs *regs, unsigned int c, unsigned int reg);
-void ra_set_finalize(struct ra_regs *regs);
-/** @} */
-
-/** @{ Interference graph setup.
- *
- * Each interference graph node is a virtual variable in the IL. It
- * is up to the user to ra_set_node_class() for the virtual variable,
- * and compute live ranges and ra_node_interfere() between conflicting
- * live ranges.
- */
-struct ra_graph *ra_alloc_interference_graph(struct ra_regs *regs,
- unsigned int count);
-void ra_set_node_class(struct ra_graph *g, unsigned int n, unsigned int c);
-void ra_add_node_interference(struct ra_graph *g,
- unsigned int n1, unsigned int n2);
-/** @} */
-
-/** @{ Graph-coloring register allocation */
-GLboolean ra_simplify(struct ra_graph *g);
-void ra_optimistic_color(struct ra_graph *g);
-GLboolean ra_select(struct ra_graph *g);
-GLboolean ra_allocate_no_spills(struct ra_graph *g);
-
-unsigned int ra_get_node_reg(struct ra_graph *g, unsigned int n);
-void ra_set_node_reg(struct ra_graph * g, unsigned int n, unsigned int reg);
-void ra_set_node_spill_cost(struct ra_graph *g, unsigned int n, float cost);
-int ra_get_best_spill_node(struct ra_graph *g);
-/** @} */
-
+/*
+ * Copyright © 2010 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ *
+ * Authors:
+ * Eric Anholt <eric@anholt.net>
+ *
+ */
+
+struct ra_class;
+struct ra_regs;
+
+/* @{
+ * Register set setup.
+ *
+ * This should be done once at backend initializaion, as
+ * ra_set_finalize is O(r^2*c^2). The registers may be virtual
+ * registers, such as aligned register pairs that conflict with the
+ * two real registers from which they are composed.
+ */
+struct ra_regs *ra_alloc_reg_set(unsigned int count);
+unsigned int ra_alloc_reg_class(struct ra_regs *regs);
+void ra_add_reg_conflict(struct ra_regs *regs,
+ unsigned int r1, unsigned int r2);
+void ra_class_add_reg(struct ra_regs *regs, unsigned int c, unsigned int reg);
+void ra_set_finalize(struct ra_regs *regs);
+/** @} */
+
+/** @{ Interference graph setup.
+ *
+ * Each interference graph node is a virtual variable in the IL. It
+ * is up to the user to ra_set_node_class() for the virtual variable,
+ * and compute live ranges and ra_node_interfere() between conflicting
+ * live ranges.
+ */
+struct ra_graph *ra_alloc_interference_graph(struct ra_regs *regs,
+ unsigned int count);
+void ra_set_node_class(struct ra_graph *g, unsigned int n, unsigned int c);
+void ra_add_node_interference(struct ra_graph *g,
+ unsigned int n1, unsigned int n2);
+/** @} */
+
+/** @{ Graph-coloring register allocation */
+GLboolean ra_simplify(struct ra_graph *g);
+void ra_optimistic_color(struct ra_graph *g);
+GLboolean ra_select(struct ra_graph *g);
+GLboolean ra_allocate_no_spills(struct ra_graph *g);
+
+unsigned int ra_get_node_reg(struct ra_graph *g, unsigned int n);
+void ra_set_node_reg(struct ra_graph * g, unsigned int n, unsigned int reg);
+void ra_set_node_spill_cost(struct ra_graph *g, unsigned int n, float cost);
+int ra_get_best_spill_node(struct ra_graph *g);
+/** @} */
+
diff --git a/mesalib/src/mesa/program/sampler.cpp b/mesalib/src/mesa/program/sampler.cpp
index 1457d1199..b219d7016 100644
--- a/mesalib/src/mesa/program/sampler.cpp
+++ b/mesalib/src/mesa/program/sampler.cpp
@@ -1,137 +1,137 @@
-/*
- * Copyright (C) 2005-2007 Brian Paul All Rights Reserved.
- * Copyright (C) 2008 VMware, Inc. All Rights Reserved.
- * Copyright © 2010 Intel Corporation
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-
-#include "ir.h"
-#include "glsl_types.h"
-#include "ir_visitor.h"
-
-extern "C" {
-#include "main/compiler.h"
-#include "main/mtypes.h"
-#include "program/prog_parameter.h"
-}
-
-static void fail_link(struct gl_shader_program *prog, const char *fmt, ...) PRINTFLIKE(2, 3);
-
-static void fail_link(struct gl_shader_program *prog, const char *fmt, ...)
-{
- va_list args;
- va_start(args, fmt);
- ralloc_vasprintf_append(&prog->InfoLog, fmt, args);
- va_end(args);
-
- prog->LinkStatus = GL_FALSE;
-}
-
-class get_sampler_name : public ir_hierarchical_visitor
-{
-public:
- get_sampler_name(ir_dereference *last,
- struct gl_shader_program *shader_program)
- {
- this->mem_ctx = ralloc_context(NULL);
- this->shader_program = shader_program;
- this->name = NULL;
- this->offset = 0;
- this->last = last;
- }
-
- ~get_sampler_name()
- {
- ralloc_free(this->mem_ctx);
- }
-
- virtual ir_visitor_status visit(ir_dereference_variable *ir)
- {
- this->name = ir->var->name;
- return visit_continue;
- }
-
- virtual ir_visitor_status visit_leave(ir_dereference_record *ir)
- {
- this->name = ralloc_asprintf(mem_ctx, "%s.%s", name, ir->field);
- return visit_continue;
- }
-
- virtual ir_visitor_status visit_leave(ir_dereference_array *ir)
- {
- ir_constant *index = ir->array_index->as_constant();
- int i;
-
- if (index) {
- i = index->value.i[0];
- } else {
- /* GLSL 1.10 and 1.20 allowed variable sampler array indices,
- * while GLSL 1.30 requires that the array indices be
- * constant integer expressions. We don't expect any driver
- * to actually work with a really variable array index, so
- * all that would work would be an unrolled loop counter that ends
- * up being constant above.
- */
- ralloc_strcat(&shader_program->InfoLog,
- "warning: Variable sampler array index unsupported.\n"
- "This feature of the language was removed in GLSL 1.20 "
- "and is unlikely to be supported for 1.10 in Mesa.\n");
- i = 0;
- }
- if (ir != last) {
- this->name = ralloc_asprintf(mem_ctx, "%s[%d]", name, i);
- } else {
- offset = i;
- }
- return visit_continue;
- }
-
- struct gl_shader_program *shader_program;
- const char *name;
- void *mem_ctx;
- int offset;
- ir_dereference *last;
-};
-
-extern "C" {
-int
-_mesa_get_sampler_uniform_value(class ir_dereference *sampler,
- struct gl_shader_program *shader_program,
- const struct gl_program *prog)
-{
- get_sampler_name getname(sampler, shader_program);
-
- sampler->accept(&getname);
-
- GLint index = _mesa_lookup_parameter_index(prog->Parameters, -1,
- getname.name);
-
- if (index < 0) {
- fail_link(shader_program,
- "failed to find sampler named %s.\n", getname.name);
- return 0;
- }
-
- index += getname.offset;
-
- return prog->Parameters->ParameterValues[index][0];
-}
-}
+/*
+ * Copyright (C) 2005-2007 Brian Paul All Rights Reserved.
+ * Copyright (C) 2008 VMware, Inc. All Rights Reserved.
+ * Copyright © 2010 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+#include "ir.h"
+#include "glsl_types.h"
+#include "ir_visitor.h"
+
+extern "C" {
+#include "main/compiler.h"
+#include "main/mtypes.h"
+#include "program/prog_parameter.h"
+}
+
+static void fail_link(struct gl_shader_program *prog, const char *fmt, ...) PRINTFLIKE(2, 3);
+
+static void fail_link(struct gl_shader_program *prog, const char *fmt, ...)
+{
+ va_list args;
+ va_start(args, fmt);
+ ralloc_vasprintf_append(&prog->InfoLog, fmt, args);
+ va_end(args);
+
+ prog->LinkStatus = GL_FALSE;
+}
+
+class get_sampler_name : public ir_hierarchical_visitor
+{
+public:
+ get_sampler_name(ir_dereference *last,
+ struct gl_shader_program *shader_program)
+ {
+ this->mem_ctx = ralloc_context(NULL);
+ this->shader_program = shader_program;
+ this->name = NULL;
+ this->offset = 0;
+ this->last = last;
+ }
+
+ ~get_sampler_name()
+ {
+ ralloc_free(this->mem_ctx);
+ }
+
+ virtual ir_visitor_status visit(ir_dereference_variable *ir)
+ {
+ this->name = ir->var->name;
+ return visit_continue;
+ }
+
+ virtual ir_visitor_status visit_leave(ir_dereference_record *ir)
+ {
+ this->name = ralloc_asprintf(mem_ctx, "%s.%s", name, ir->field);
+ return visit_continue;
+ }
+
+ virtual ir_visitor_status visit_leave(ir_dereference_array *ir)
+ {
+ ir_constant *index = ir->array_index->as_constant();
+ int i;
+
+ if (index) {
+ i = index->value.i[0];
+ } else {
+ /* GLSL 1.10 and 1.20 allowed variable sampler array indices,
+ * while GLSL 1.30 requires that the array indices be
+ * constant integer expressions. We don't expect any driver
+ * to actually work with a really variable array index, so
+ * all that would work would be an unrolled loop counter that ends
+ * up being constant above.
+ */
+ ralloc_strcat(&shader_program->InfoLog,
+ "warning: Variable sampler array index unsupported.\n"
+ "This feature of the language was removed in GLSL 1.20 "
+ "and is unlikely to be supported for 1.10 in Mesa.\n");
+ i = 0;
+ }
+ if (ir != last) {
+ this->name = ralloc_asprintf(mem_ctx, "%s[%d]", name, i);
+ } else {
+ offset = i;
+ }
+ return visit_continue;
+ }
+
+ struct gl_shader_program *shader_program;
+ const char *name;
+ void *mem_ctx;
+ int offset;
+ ir_dereference *last;
+};
+
+extern "C" {
+int
+_mesa_get_sampler_uniform_value(class ir_dereference *sampler,
+ struct gl_shader_program *shader_program,
+ const struct gl_program *prog)
+{
+ get_sampler_name getname(sampler, shader_program);
+
+ sampler->accept(&getname);
+
+ GLint index = _mesa_lookup_parameter_index(prog->Parameters, -1,
+ getname.name);
+
+ if (index < 0) {
+ fail_link(shader_program,
+ "failed to find sampler named %s.\n", getname.name);
+ return 0;
+ }
+
+ index += getname.offset;
+
+ return prog->Parameters->ParameterValues[index][0];
+}
+}
diff --git a/mesalib/src/mesa/sources.mak b/mesalib/src/mesa/sources.mak
index 9b2cb1a3c..3caa6b981 100644
--- a/mesalib/src/mesa/sources.mak
+++ b/mesalib/src/mesa/sources.mak
@@ -1,379 +1,379 @@
-### Lists of source files, included by Makefiles
-
-# this is part of MAIN_SOURCES
-MAIN_ES_SOURCES = \
- main/api_exec_es1.c \
- main/api_exec_es2.c
-
-MAIN_SOURCES = \
- main/api_arrayelt.c \
- main/api_exec.c \
- main/api_loopback.c \
- main/api_noop.c \
- main/api_validate.c \
- main/accum.c \
- main/arbprogram.c \
- main/atifragshader.c \
- main/attrib.c \
- main/arrayobj.c \
- main/blend.c \
- main/bufferobj.c \
- main/buffers.c \
- main/clear.c \
- main/clip.c \
- main/colortab.c \
- main/condrender.c \
- main/context.c \
- main/convolve.c \
- main/cpuinfo.c \
- main/debug.c \
- main/depth.c \
- main/depthstencil.c \
- main/dlist.c \
- main/dlopen.c \
- main/drawpix.c \
- main/drawtex.c \
- main/enable.c \
- main/enums.c \
- main/eval.c \
- main/execmem.c \
- main/extensions.c \
- main/fbobject.c \
- main/feedback.c \
- main/ffvertex_prog.c \
- main/fog.c \
- main/formats.c \
- main/framebuffer.c \
- main/get.c \
- main/getstring.c \
- main/hash.c \
- main/hint.c \
- main/histogram.c \
- main/image.c \
- main/imports.c \
- main/light.c \
- main/lines.c \
- main/matrix.c \
- main/mipmap.c \
- main/mm.c \
- main/multisample.c \
- main/nvprogram.c \
- main/pack.c \
- main/pbo.c \
- main/pixel.c \
- main/pixelstore.c \
- main/pixeltransfer.c \
- main/points.c \
- main/polygon.c \
- main/queryobj.c \
- main/querymatrix.c \
- main/rastpos.c \
- main/readpix.c \
- main/remap.c \
- main/renderbuffer.c \
- main/samplerobj.c \
- main/scissor.c \
- main/shaderapi.c \
- main/shaderobj.c \
- main/shared.c \
- main/state.c \
- main/stencil.c \
- main/syncobj.c \
- main/texcompress.c \
- main/texcompress_rgtc.c \
- main/texcompress_s3tc.c \
- main/texcompress_fxt1.c \
- main/texenv.c \
- main/texfetch.c \
- main/texformat.c \
- main/texgen.c \
- main/texgetimage.c \
- main/teximage.c \
- main/texobj.c \
- main/texpal.c \
- main/texparam.c \
- main/texrender.c \
- main/texstate.c \
- main/texstore.c \
- main/texturebarrier.c \
- main/transformfeedback.c \
- main/uniforms.c \
- main/varray.c \
- main/version.c \
- main/viewport.c \
- main/vtxfmt.c \
- $(MAIN_ES_SOURCES)
-
-MAIN_CXX_SOURCES = \
- main/ff_fragment_shader.cpp
-
-MATH_SOURCES = \
- math/m_debug_clip.c \
- math/m_debug_norm.c \
- math/m_debug_xform.c \
- math/m_eval.c \
- math/m_matrix.c \
- math/m_translate.c \
- math/m_vector.c
-
-MATH_XFORM_SOURCES = \
- math/m_xform.c
-
-SWRAST_SOURCES = \
- swrast/s_aaline.c \
- swrast/s_aatriangle.c \
- swrast/s_accum.c \
- swrast/s_alpha.c \
- swrast/s_atifragshader.c \
- swrast/s_bitmap.c \
- swrast/s_blend.c \
- swrast/s_blit.c \
- swrast/s_clear.c \
- swrast/s_copypix.c \
- swrast/s_context.c \
- swrast/s_depth.c \
- swrast/s_drawpix.c \
- swrast/s_feedback.c \
- swrast/s_fog.c \
- swrast/s_fragprog.c \
- swrast/s_lines.c \
- swrast/s_logic.c \
- swrast/s_masking.c \
- swrast/s_points.c \
- swrast/s_readpix.c \
- swrast/s_span.c \
- swrast/s_stencil.c \
- swrast/s_texcombine.c \
- swrast/s_texfilter.c \
- swrast/s_triangle.c \
- swrast/s_zoom.c
-
-SWRAST_SETUP_SOURCES = \
- swrast_setup/ss_context.c \
- swrast_setup/ss_triangle.c
-
-TNL_SOURCES = \
- tnl/t_context.c \
- tnl/t_pipeline.c \
- tnl/t_draw.c \
- tnl/t_rasterpos.c \
- tnl/t_vb_program.c \
- tnl/t_vb_render.c \
- tnl/t_vb_texgen.c \
- tnl/t_vb_texmat.c \
- tnl/t_vb_vertex.c \
- tnl/t_vb_fog.c \
- tnl/t_vb_light.c \
- tnl/t_vb_normals.c \
- tnl/t_vb_points.c \
- tnl/t_vp_build.c \
- tnl/t_vertex.c \
- tnl/t_vertex_sse.c \
- tnl/t_vertex_generic.c
-
-VBO_SOURCES = \
- vbo/vbo_context.c \
- vbo/vbo_exec.c \
- vbo/vbo_exec_api.c \
- vbo/vbo_exec_array.c \
- vbo/vbo_exec_draw.c \
- vbo/vbo_exec_eval.c \
- vbo/vbo_rebase.c \
- vbo/vbo_split.c \
- vbo/vbo_split_copy.c \
- vbo/vbo_split_inplace.c \
- vbo/vbo_save.c \
- vbo/vbo_save_api.c \
- vbo/vbo_save_draw.c \
- vbo/vbo_save_loopback.c
-
-STATETRACKER_SOURCES = \
- state_tracker/st_atom.c \
- state_tracker/st_atom_blend.c \
- state_tracker/st_atom_clip.c \
- state_tracker/st_atom_constbuf.c \
- state_tracker/st_atom_depth.c \
- state_tracker/st_atom_framebuffer.c \
- state_tracker/st_atom_msaa.c \
- state_tracker/st_atom_pixeltransfer.c \
- state_tracker/st_atom_sampler.c \
- state_tracker/st_atom_scissor.c \
- state_tracker/st_atom_shader.c \
- state_tracker/st_atom_rasterizer.c \
- state_tracker/st_atom_stipple.c \
- state_tracker/st_atom_texture.c \
- state_tracker/st_atom_viewport.c \
- state_tracker/st_cb_accum.c \
- state_tracker/st_cb_bitmap.c \
- state_tracker/st_cb_blit.c \
- state_tracker/st_cb_bufferobjects.c \
- state_tracker/st_cb_clear.c \
- state_tracker/st_cb_condrender.c \
- state_tracker/st_cb_flush.c \
- state_tracker/st_cb_drawpixels.c \
- state_tracker/st_cb_drawtex.c \
- state_tracker/st_cb_eglimage.c \
- state_tracker/st_cb_fbo.c \
- state_tracker/st_cb_feedback.c \
- state_tracker/st_cb_program.c \
- state_tracker/st_cb_queryobj.c \
- state_tracker/st_cb_rasterpos.c \
- state_tracker/st_cb_readpixels.c \
- state_tracker/st_cb_syncobj.c \
- state_tracker/st_cb_strings.c \
- state_tracker/st_cb_texture.c \
- state_tracker/st_cb_texturebarrier.c \
- state_tracker/st_cb_viewport.c \
- state_tracker/st_cb_xformfb.c \
- state_tracker/st_context.c \
- state_tracker/st_debug.c \
- state_tracker/st_draw.c \
- state_tracker/st_draw_feedback.c \
- state_tracker/st_extensions.c \
- state_tracker/st_format.c \
- state_tracker/st_gen_mipmap.c \
- state_tracker/st_manager.c \
- state_tracker/st_mesa_to_tgsi.c \
- state_tracker/st_program.c \
- state_tracker/st_texture.c
-
-PROGRAM_SOURCES = \
- program/arbprogparse.c \
- program/hash_table.c \
- program/lex.yy.c \
- program/nvfragparse.c \
- program/nvvertparse.c \
- program/program.c \
- program/program_parse.tab.c \
- program/program_parse_extra.c \
- program/prog_cache.c \
- program/prog_execute.c \
- program/prog_instruction.c \
- program/prog_noise.c \
- program/prog_optimize.c \
- program/prog_parameter.c \
- program/prog_parameter_layout.c \
- program/prog_print.c \
- program/prog_statevars.c \
- program/prog_uniform.c \
- program/programopt.c \
- program/register_allocate.c \
- program/symbol_table.c
-
-
-SHADER_CXX_SOURCES = \
- program/ir_to_mesa.cpp \
- program/sampler.cpp
-
-ASM_C_SOURCES = \
- x86/common_x86.c \
- x86/x86_xform.c \
- x86/3dnow.c \
- x86/sse.c \
- x86/rtasm/x86sse.c \
- sparc/sparc.c \
- ppc/common_ppc.c \
- x86-64/x86-64.c
-
-X86_SOURCES = \
- x86/common_x86_asm.S \
- x86/x86_xform2.S \
- x86/x86_xform3.S \
- x86/x86_xform4.S \
- x86/x86_cliptest.S \
- x86/mmx_blend.S \
- x86/3dnow_xform1.S \
- x86/3dnow_xform2.S \
- x86/3dnow_xform3.S \
- x86/3dnow_xform4.S \
- x86/3dnow_normal.S \
- x86/sse_xform1.S \
- x86/sse_xform2.S \
- x86/sse_xform3.S \
- x86/sse_xform4.S \
- x86/sse_normal.S \
- x86/read_rgba_span_x86.S
-
-X86-64_SOURCES = \
- x86-64/xform4.S
-
-SPARC_SOURCES = \
- sparc/clip.S \
- sparc/norm.S \
- sparc/xform.S
-
-COMMON_DRIVER_SOURCES = \
- drivers/common/driverfuncs.c \
- drivers/common/meta.c
-
-
-# Sources for building non-Gallium drivers
-MESA_SOURCES = \
- $(MAIN_SOURCES) \
- $(MATH_SOURCES) \
- $(MATH_XFORM_SOURCES) \
- $(VBO_SOURCES) \
- $(TNL_SOURCES) \
- $(PROGRAM_SOURCES) \
- $(SWRAST_SOURCES) \
- $(SWRAST_SETUP_SOURCES) \
- $(COMMON_DRIVER_SOURCES)\
- $(ASM_C_SOURCES)
-
-MESA_CXX_SOURCES = \
- $(MAIN_CXX_SOURCES) \
- $(SHADER_CXX_SOURCES)
-
-# Sources for building Gallium drivers
-MESA_GALLIUM_SOURCES = \
- $(MAIN_SOURCES) \
- $(MATH_SOURCES) \
- $(VBO_SOURCES) \
- $(STATETRACKER_SOURCES) \
- $(PROGRAM_SOURCES) \
- ppc/common_ppc.c \
- x86/common_x86.c
-
-MESA_GALLIUM_CXX_SOURCES = \
- $(MAIN_CXX_SOURCES) \
- $(SHADER_CXX_SOURCES)
-
-# All the core C sources, for dependency checking
-ALL_SOURCES = \
- $(MESA_SOURCES) \
- $(MESA_CXX_SOURCES) \
- $(MESA_ASM_SOURCES) \
- $(STATETRACKER_SOURCES)
-
-
-### Object files
-
-MESA_OBJECTS = \
- $(MESA_SOURCES:.c=.o) \
- $(MESA_CXX_SOURCES:.cpp=.o) \
- $(MESA_ASM_SOURCES:.S=.o)
-
-MESA_GALLIUM_OBJECTS = \
- $(MESA_GALLIUM_SOURCES:.c=.o) \
- $(MESA_GALLIUM_CXX_SOURCES:.cpp=.o) \
- $(MESA_ASM_SOURCES:.S=.o)
-
-
-COMMON_DRIVER_OBJECTS = $(COMMON_DRIVER_SOURCES:.c=.o)
-
-
-### Other archives/libraries
-
-GLSL_LIBS = \
- $(TOP)/src/glsl/libglsl.a
-
-
-### Include directories
-
-INCLUDE_DIRS = \
- -I$(TOP)/include \
- -I$(TOP)/src/glsl \
- -I$(TOP)/src/mesa \
- -I$(TOP)/src/mapi \
- -I$(TOP)/src/gallium/include \
- -I$(TOP)/src/gallium/auxiliary
+### Lists of source files, included by Makefiles
+
+# this is part of MAIN_SOURCES
+MAIN_ES_SOURCES = \
+ main/api_exec_es1.c \
+ main/api_exec_es2.c
+
+MAIN_SOURCES = \
+ main/api_arrayelt.c \
+ main/api_exec.c \
+ main/api_loopback.c \
+ main/api_noop.c \
+ main/api_validate.c \
+ main/accum.c \
+ main/arbprogram.c \
+ main/atifragshader.c \
+ main/attrib.c \
+ main/arrayobj.c \
+ main/blend.c \
+ main/bufferobj.c \
+ main/buffers.c \
+ main/clear.c \
+ main/clip.c \
+ main/colortab.c \
+ main/condrender.c \
+ main/context.c \
+ main/convolve.c \
+ main/cpuinfo.c \
+ main/debug.c \
+ main/depth.c \
+ main/depthstencil.c \
+ main/dlist.c \
+ main/dlopen.c \
+ main/drawpix.c \
+ main/drawtex.c \
+ main/enable.c \
+ main/enums.c \
+ main/eval.c \
+ main/execmem.c \
+ main/extensions.c \
+ main/fbobject.c \
+ main/feedback.c \
+ main/ffvertex_prog.c \
+ main/fog.c \
+ main/formats.c \
+ main/framebuffer.c \
+ main/get.c \
+ main/getstring.c \
+ main/hash.c \
+ main/hint.c \
+ main/histogram.c \
+ main/image.c \
+ main/imports.c \
+ main/light.c \
+ main/lines.c \
+ main/matrix.c \
+ main/mipmap.c \
+ main/mm.c \
+ main/multisample.c \
+ main/nvprogram.c \
+ main/pack.c \
+ main/pbo.c \
+ main/pixel.c \
+ main/pixelstore.c \
+ main/pixeltransfer.c \
+ main/points.c \
+ main/polygon.c \
+ main/queryobj.c \
+ main/querymatrix.c \
+ main/rastpos.c \
+ main/readpix.c \
+ main/remap.c \
+ main/renderbuffer.c \
+ main/samplerobj.c \
+ main/scissor.c \
+ main/shaderapi.c \
+ main/shaderobj.c \
+ main/shared.c \
+ main/state.c \
+ main/stencil.c \
+ main/syncobj.c \
+ main/texcompress.c \
+ main/texcompress_rgtc.c \
+ main/texcompress_s3tc.c \
+ main/texcompress_fxt1.c \
+ main/texenv.c \
+ main/texfetch.c \
+ main/texformat.c \
+ main/texgen.c \
+ main/texgetimage.c \
+ main/teximage.c \
+ main/texobj.c \
+ main/texpal.c \
+ main/texparam.c \
+ main/texrender.c \
+ main/texstate.c \
+ main/texstore.c \
+ main/texturebarrier.c \
+ main/transformfeedback.c \
+ main/uniforms.c \
+ main/varray.c \
+ main/version.c \
+ main/viewport.c \
+ main/vtxfmt.c \
+ $(MAIN_ES_SOURCES)
+
+MAIN_CXX_SOURCES = \
+ main/ff_fragment_shader.cpp
+
+MATH_SOURCES = \
+ math/m_debug_clip.c \
+ math/m_debug_norm.c \
+ math/m_debug_xform.c \
+ math/m_eval.c \
+ math/m_matrix.c \
+ math/m_translate.c \
+ math/m_vector.c
+
+MATH_XFORM_SOURCES = \
+ math/m_xform.c
+
+SWRAST_SOURCES = \
+ swrast/s_aaline.c \
+ swrast/s_aatriangle.c \
+ swrast/s_accum.c \
+ swrast/s_alpha.c \
+ swrast/s_atifragshader.c \
+ swrast/s_bitmap.c \
+ swrast/s_blend.c \
+ swrast/s_blit.c \
+ swrast/s_clear.c \
+ swrast/s_copypix.c \
+ swrast/s_context.c \
+ swrast/s_depth.c \
+ swrast/s_drawpix.c \
+ swrast/s_feedback.c \
+ swrast/s_fog.c \
+ swrast/s_fragprog.c \
+ swrast/s_lines.c \
+ swrast/s_logic.c \
+ swrast/s_masking.c \
+ swrast/s_points.c \
+ swrast/s_readpix.c \
+ swrast/s_span.c \
+ swrast/s_stencil.c \
+ swrast/s_texcombine.c \
+ swrast/s_texfilter.c \
+ swrast/s_triangle.c \
+ swrast/s_zoom.c
+
+SWRAST_SETUP_SOURCES = \
+ swrast_setup/ss_context.c \
+ swrast_setup/ss_triangle.c
+
+TNL_SOURCES = \
+ tnl/t_context.c \
+ tnl/t_pipeline.c \
+ tnl/t_draw.c \
+ tnl/t_rasterpos.c \
+ tnl/t_vb_program.c \
+ tnl/t_vb_render.c \
+ tnl/t_vb_texgen.c \
+ tnl/t_vb_texmat.c \
+ tnl/t_vb_vertex.c \
+ tnl/t_vb_fog.c \
+ tnl/t_vb_light.c \
+ tnl/t_vb_normals.c \
+ tnl/t_vb_points.c \
+ tnl/t_vp_build.c \
+ tnl/t_vertex.c \
+ tnl/t_vertex_sse.c \
+ tnl/t_vertex_generic.c
+
+VBO_SOURCES = \
+ vbo/vbo_context.c \
+ vbo/vbo_exec.c \
+ vbo/vbo_exec_api.c \
+ vbo/vbo_exec_array.c \
+ vbo/vbo_exec_draw.c \
+ vbo/vbo_exec_eval.c \
+ vbo/vbo_rebase.c \
+ vbo/vbo_split.c \
+ vbo/vbo_split_copy.c \
+ vbo/vbo_split_inplace.c \
+ vbo/vbo_save.c \
+ vbo/vbo_save_api.c \
+ vbo/vbo_save_draw.c \
+ vbo/vbo_save_loopback.c
+
+STATETRACKER_SOURCES = \
+ state_tracker/st_atom.c \
+ state_tracker/st_atom_blend.c \
+ state_tracker/st_atom_clip.c \
+ state_tracker/st_atom_constbuf.c \
+ state_tracker/st_atom_depth.c \
+ state_tracker/st_atom_framebuffer.c \
+ state_tracker/st_atom_msaa.c \
+ state_tracker/st_atom_pixeltransfer.c \
+ state_tracker/st_atom_sampler.c \
+ state_tracker/st_atom_scissor.c \
+ state_tracker/st_atom_shader.c \
+ state_tracker/st_atom_rasterizer.c \
+ state_tracker/st_atom_stipple.c \
+ state_tracker/st_atom_texture.c \
+ state_tracker/st_atom_viewport.c \
+ state_tracker/st_cb_accum.c \
+ state_tracker/st_cb_bitmap.c \
+ state_tracker/st_cb_blit.c \
+ state_tracker/st_cb_bufferobjects.c \
+ state_tracker/st_cb_clear.c \
+ state_tracker/st_cb_condrender.c \
+ state_tracker/st_cb_flush.c \
+ state_tracker/st_cb_drawpixels.c \
+ state_tracker/st_cb_drawtex.c \
+ state_tracker/st_cb_eglimage.c \
+ state_tracker/st_cb_fbo.c \
+ state_tracker/st_cb_feedback.c \
+ state_tracker/st_cb_program.c \
+ state_tracker/st_cb_queryobj.c \
+ state_tracker/st_cb_rasterpos.c \
+ state_tracker/st_cb_readpixels.c \
+ state_tracker/st_cb_syncobj.c \
+ state_tracker/st_cb_strings.c \
+ state_tracker/st_cb_texture.c \
+ state_tracker/st_cb_texturebarrier.c \
+ state_tracker/st_cb_viewport.c \
+ state_tracker/st_cb_xformfb.c \
+ state_tracker/st_context.c \
+ state_tracker/st_debug.c \
+ state_tracker/st_draw.c \
+ state_tracker/st_draw_feedback.c \
+ state_tracker/st_extensions.c \
+ state_tracker/st_format.c \
+ state_tracker/st_gen_mipmap.c \
+ state_tracker/st_manager.c \
+ state_tracker/st_mesa_to_tgsi.c \
+ state_tracker/st_program.c \
+ state_tracker/st_texture.c
+
+PROGRAM_SOURCES = \
+ program/arbprogparse.c \
+ program/hash_table.c \
+ program/lex.yy.c \
+ program/nvfragparse.c \
+ program/nvvertparse.c \
+ program/program.c \
+ program/program_parse.tab.c \
+ program/program_parse_extra.c \
+ program/prog_cache.c \
+ program/prog_execute.c \
+ program/prog_instruction.c \
+ program/prog_noise.c \
+ program/prog_optimize.c \
+ program/prog_parameter.c \
+ program/prog_parameter_layout.c \
+ program/prog_print.c \
+ program/prog_statevars.c \
+ program/prog_uniform.c \
+ program/programopt.c \
+ program/register_allocate.c \
+ program/symbol_table.c
+
+
+SHADER_CXX_SOURCES = \
+ program/ir_to_mesa.cpp \
+ program/sampler.cpp
+
+ASM_C_SOURCES = \
+ x86/common_x86.c \
+ x86/x86_xform.c \
+ x86/3dnow.c \
+ x86/sse.c \
+ x86/rtasm/x86sse.c \
+ sparc/sparc.c \
+ ppc/common_ppc.c \
+ x86-64/x86-64.c
+
+X86_SOURCES = \
+ x86/common_x86_asm.S \
+ x86/x86_xform2.S \
+ x86/x86_xform3.S \
+ x86/x86_xform4.S \
+ x86/x86_cliptest.S \
+ x86/mmx_blend.S \
+ x86/3dnow_xform1.S \
+ x86/3dnow_xform2.S \
+ x86/3dnow_xform3.S \
+ x86/3dnow_xform4.S \
+ x86/3dnow_normal.S \
+ x86/sse_xform1.S \
+ x86/sse_xform2.S \
+ x86/sse_xform3.S \
+ x86/sse_xform4.S \
+ x86/sse_normal.S \
+ x86/read_rgba_span_x86.S
+
+X86-64_SOURCES = \
+ x86-64/xform4.S
+
+SPARC_SOURCES = \
+ sparc/clip.S \
+ sparc/norm.S \
+ sparc/xform.S
+
+COMMON_DRIVER_SOURCES = \
+ drivers/common/driverfuncs.c \
+ drivers/common/meta.c
+
+
+# Sources for building non-Gallium drivers
+MESA_SOURCES = \
+ $(MAIN_SOURCES) \
+ $(MATH_SOURCES) \
+ $(MATH_XFORM_SOURCES) \
+ $(VBO_SOURCES) \
+ $(TNL_SOURCES) \
+ $(PROGRAM_SOURCES) \
+ $(SWRAST_SOURCES) \
+ $(SWRAST_SETUP_SOURCES) \
+ $(COMMON_DRIVER_SOURCES)\
+ $(ASM_C_SOURCES)
+
+MESA_CXX_SOURCES = \
+ $(MAIN_CXX_SOURCES) \
+ $(SHADER_CXX_SOURCES)
+
+# Sources for building Gallium drivers
+MESA_GALLIUM_SOURCES = \
+ $(MAIN_SOURCES) \
+ $(MATH_SOURCES) \
+ $(VBO_SOURCES) \
+ $(STATETRACKER_SOURCES) \
+ $(PROGRAM_SOURCES) \
+ ppc/common_ppc.c \
+ x86/common_x86.c
+
+MESA_GALLIUM_CXX_SOURCES = \
+ $(MAIN_CXX_SOURCES) \
+ $(SHADER_CXX_SOURCES)
+
+# All the core C sources, for dependency checking
+ALL_SOURCES = \
+ $(MESA_SOURCES) \
+ $(MESA_CXX_SOURCES) \
+ $(MESA_ASM_SOURCES) \
+ $(STATETRACKER_SOURCES)
+
+
+### Object files
+
+MESA_OBJECTS = \
+ $(MESA_SOURCES:.c=.o) \
+ $(MESA_CXX_SOURCES:.cpp=.o) \
+ $(MESA_ASM_SOURCES:.S=.o)
+
+MESA_GALLIUM_OBJECTS = \
+ $(MESA_GALLIUM_SOURCES:.c=.o) \
+ $(MESA_GALLIUM_CXX_SOURCES:.cpp=.o) \
+ $(MESA_ASM_SOURCES:.S=.o)
+
+
+COMMON_DRIVER_OBJECTS = $(COMMON_DRIVER_SOURCES:.c=.o)
+
+
+### Other archives/libraries
+
+GLSL_LIBS = \
+ $(TOP)/src/glsl/libglsl.a
+
+
+### Include directories
+
+INCLUDE_DIRS = \
+ -I$(TOP)/include \
+ -I$(TOP)/src/glsl \
+ -I$(TOP)/src/mesa \
+ -I$(TOP)/src/mapi \
+ -I$(TOP)/src/gallium/include \
+ -I$(TOP)/src/gallium/auxiliary
diff --git a/mesalib/src/mesa/state_tracker/st_atom_blend.c b/mesalib/src/mesa/state_tracker/st_atom_blend.c
index d1844e106..c22d4c42e 100644
--- a/mesalib/src/mesa/state_tracker/st_atom_blend.c
+++ b/mesalib/src/mesa/state_tracker/st_atom_blend.c
@@ -1,302 +1,302 @@
-/**************************************************************************
- *
- * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas.
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sub license, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice (including the
- * next paragraph) shall be included in all copies or substantial portions
- * of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
- * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
- * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- **************************************************************************/
-
- /*
- * Authors:
- * Keith Whitwell <keith@tungstengraphics.com>
- * Brian Paul
- */
-
-
-#include "st_context.h"
-#include "st_atom.h"
-
-#include "pipe/p_context.h"
-#include "pipe/p_defines.h"
-#include "cso_cache/cso_context.h"
-
-#include "main/macros.h"
-
-/**
- * Convert GLenum blend tokens to pipe tokens.
- * Both blend factors and blend funcs are accepted.
- */
-static GLuint
-translate_blend(GLenum blend)
-{
- switch (blend) {
- /* blend functions */
- case GL_FUNC_ADD:
- return PIPE_BLEND_ADD;
- case GL_FUNC_SUBTRACT:
- return PIPE_BLEND_SUBTRACT;
- case GL_FUNC_REVERSE_SUBTRACT:
- return PIPE_BLEND_REVERSE_SUBTRACT;
- case GL_MIN:
- return PIPE_BLEND_MIN;
- case GL_MAX:
- return PIPE_BLEND_MAX;
-
- /* blend factors */
- case GL_ONE:
- return PIPE_BLENDFACTOR_ONE;
- case GL_SRC_COLOR:
- return PIPE_BLENDFACTOR_SRC_COLOR;
- case GL_SRC_ALPHA:
- return PIPE_BLENDFACTOR_SRC_ALPHA;
- case GL_DST_ALPHA:
- return PIPE_BLENDFACTOR_DST_ALPHA;
- case GL_DST_COLOR:
- return PIPE_BLENDFACTOR_DST_COLOR;
- case GL_SRC_ALPHA_SATURATE:
- return PIPE_BLENDFACTOR_SRC_ALPHA_SATURATE;
- case GL_CONSTANT_COLOR:
- return PIPE_BLENDFACTOR_CONST_COLOR;
- case GL_CONSTANT_ALPHA:
- return PIPE_BLENDFACTOR_CONST_ALPHA;
- /*
- return PIPE_BLENDFACTOR_SRC1_COLOR;
- return PIPE_BLENDFACTOR_SRC1_ALPHA;
- */
- case GL_ZERO:
- return PIPE_BLENDFACTOR_ZERO;
- case GL_ONE_MINUS_SRC_COLOR:
- return PIPE_BLENDFACTOR_INV_SRC_COLOR;
- case GL_ONE_MINUS_SRC_ALPHA:
- return PIPE_BLENDFACTOR_INV_SRC_ALPHA;
- case GL_ONE_MINUS_DST_COLOR:
- return PIPE_BLENDFACTOR_INV_DST_COLOR;
- case GL_ONE_MINUS_DST_ALPHA:
- return PIPE_BLENDFACTOR_INV_DST_ALPHA;
- case GL_ONE_MINUS_CONSTANT_COLOR:
- return PIPE_BLENDFACTOR_INV_CONST_COLOR;
- case GL_ONE_MINUS_CONSTANT_ALPHA:
- return PIPE_BLENDFACTOR_INV_CONST_ALPHA;
- /*
- return PIPE_BLENDFACTOR_INV_SRC1_COLOR;
- return PIPE_BLENDFACTOR_INV_SRC1_ALPHA;
- */
- default:
- assert("invalid GL token in translate_blend()" == NULL);
- return 0;
- }
-}
-
-
-/**
- * Convert GLenum logicop tokens to pipe tokens.
- */
-static GLuint
-translate_logicop(GLenum logicop)
-{
- switch (logicop) {
- case GL_CLEAR:
- return PIPE_LOGICOP_CLEAR;
- case GL_NOR:
- return PIPE_LOGICOP_NOR;
- case GL_AND_INVERTED:
- return PIPE_LOGICOP_AND_INVERTED;
- case GL_COPY_INVERTED:
- return PIPE_LOGICOP_COPY_INVERTED;
- case GL_AND_REVERSE:
- return PIPE_LOGICOP_AND_REVERSE;
- case GL_INVERT:
- return PIPE_LOGICOP_INVERT;
- case GL_XOR:
- return PIPE_LOGICOP_XOR;
- case GL_NAND:
- return PIPE_LOGICOP_NAND;
- case GL_AND:
- return PIPE_LOGICOP_AND;
- case GL_EQUIV:
- return PIPE_LOGICOP_EQUIV;
- case GL_NOOP:
- return PIPE_LOGICOP_NOOP;
- case GL_OR_INVERTED:
- return PIPE_LOGICOP_OR_INVERTED;
- case GL_COPY:
- return PIPE_LOGICOP_COPY;
- case GL_OR_REVERSE:
- return PIPE_LOGICOP_OR_REVERSE;
- case GL_OR:
- return PIPE_LOGICOP_OR;
- case GL_SET:
- return PIPE_LOGICOP_SET;
- default:
- assert("invalid GL token in translate_logicop()" == NULL);
- return 0;
- }
-}
-
-/**
- * Figure out if colormasks are different per rt.
- */
-static GLboolean
-colormask_per_rt(struct gl_context *ctx)
-{
- /* a bit suboptimal have to compare lots of values */
- unsigned i;
- for (i = 1; i < ctx->Const.MaxDrawBuffers; i++) {
- if (memcmp(ctx->Color.ColorMask[0], ctx->Color.ColorMask[i], 4)) {
- return GL_TRUE;
- }
- }
- return GL_FALSE;
-}
-
-/**
- * Figure out if blend enables/state are different per rt.
- */
-static GLboolean
-blend_per_rt(struct gl_context *ctx)
-{
- if (ctx->Color.BlendEnabled &&
- (ctx->Color.BlendEnabled != ((1 << ctx->Const.MaxDrawBuffers) - 1))) {
- /* This can only happen if GL_EXT_draw_buffers2 is enabled */
- return GL_TRUE;
- }
- if (ctx->Color._BlendFuncPerBuffer || ctx->Color._BlendEquationPerBuffer) {
- /* this can only happen if GL_ARB_draw_buffers_blend is enabled */
- return GL_TRUE;
- }
- return GL_FALSE;
-}
-
-static void
-update_blend( struct st_context *st )
-{
- struct pipe_blend_state *blend = &st->state.blend;
- unsigned num_state = 1;
- unsigned i, j;
-
- memset(blend, 0, sizeof(*blend));
-
- if (blend_per_rt(st->ctx) || colormask_per_rt(st->ctx)) {
- num_state = st->ctx->Const.MaxDrawBuffers;
- blend->independent_blend_enable = 1;
- }
- /* Note it is impossible to correctly deal with EXT_blend_logic_op and
- EXT_draw_buffers2/EXT_blend_equation_separate at the same time.
- These combinations would require support for per-rt logicop enables
- and separate alpha/rgb logicop/blend support respectively. Neither
- possible in gallium nor most hardware. Assume these combinations
- don't happen. */
- if (st->ctx->Color.ColorLogicOpEnabled ||
- (st->ctx->Color.BlendEnabled &&
- st->ctx->Color.Blend[0].EquationRGB == GL_LOGIC_OP)) {
- /* logicop enabled */
- blend->logicop_enable = 1;
- blend->logicop_func = translate_logicop(st->ctx->Color.LogicOp);
- }
- else if (st->ctx->Color.BlendEnabled) {
- /* blending enabled */
- for (i = 0, j = 0; i < num_state; i++) {
-
- blend->rt[i].blend_enable = (st->ctx->Color.BlendEnabled >> i) & 0x1;
-
- if (st->ctx->Extensions.ARB_draw_buffers_blend)
- j = i;
-
- blend->rt[i].rgb_func =
- translate_blend(st->ctx->Color.Blend[j].EquationRGB);
-
- if (st->ctx->Color.Blend[i].EquationRGB == GL_MIN ||
- st->ctx->Color.Blend[i].EquationRGB == GL_MAX) {
- /* Min/max are special */
- blend->rt[i].rgb_src_factor = PIPE_BLENDFACTOR_ONE;
- blend->rt[i].rgb_dst_factor = PIPE_BLENDFACTOR_ONE;
- }
- else {
- blend->rt[i].rgb_src_factor =
- translate_blend(st->ctx->Color.Blend[j].SrcRGB);
- blend->rt[i].rgb_dst_factor =
- translate_blend(st->ctx->Color.Blend[j].DstRGB);
- }
-
- blend->rt[i].alpha_func =
- translate_blend(st->ctx->Color.Blend[j].EquationA);
-
- if (st->ctx->Color.Blend[i].EquationA == GL_MIN ||
- st->ctx->Color.Blend[i].EquationA == GL_MAX) {
- /* Min/max are special */
- blend->rt[i].alpha_src_factor = PIPE_BLENDFACTOR_ONE;
- blend->rt[i].alpha_dst_factor = PIPE_BLENDFACTOR_ONE;
- }
- else {
- blend->rt[i].alpha_src_factor =
- translate_blend(st->ctx->Color.Blend[j].SrcA);
- blend->rt[i].alpha_dst_factor =
- translate_blend(st->ctx->Color.Blend[j].DstA);
- }
- }
- }
- else {
- /* no blending / logicop */
- }
-
- /* Colormask - maybe reverse these bits? */
- for (i = 0; i < num_state; i++) {
- if (st->ctx->Color.ColorMask[i][0])
- blend->rt[i].colormask |= PIPE_MASK_R;
- if (st->ctx->Color.ColorMask[i][1])
- blend->rt[i].colormask |= PIPE_MASK_G;
- if (st->ctx->Color.ColorMask[i][2])
- blend->rt[i].colormask |= PIPE_MASK_B;
- if (st->ctx->Color.ColorMask[i][3])
- blend->rt[i].colormask |= PIPE_MASK_A;
- }
-
- if (st->ctx->Color.DitherFlag)
- blend->dither = 1;
-
- if (st->ctx->Multisample.Enabled) {
- /* unlike in gallium/d3d10 these operations are only performed
- if msaa is enabled */
- if (st->ctx->Multisample.SampleAlphaToCoverage)
- blend->alpha_to_coverage = 1;
- if (st->ctx->Multisample.SampleAlphaToOne)
- blend->alpha_to_one = 1;
- }
-
- cso_set_blend(st->cso_context, blend);
-
- {
- struct pipe_blend_color bc;
- COPY_4FV(bc.color, st->ctx->Color.BlendColorUnclamped);
- cso_set_blend_color(st->cso_context, &bc);
- }
-}
-
-
-const struct st_tracked_state st_update_blend = {
- "st_update_blend", /* name */
- { /* dirty */
- (_NEW_COLOR | _NEW_MULTISAMPLE), /* XXX _NEW_BLEND someday? */ /* mesa */
- 0, /* st */
- },
- update_blend, /* update */
-};
+/**************************************************************************
+ *
+ * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ **************************************************************************/
+
+ /*
+ * Authors:
+ * Keith Whitwell <keith@tungstengraphics.com>
+ * Brian Paul
+ */
+
+
+#include "st_context.h"
+#include "st_atom.h"
+
+#include "pipe/p_context.h"
+#include "pipe/p_defines.h"
+#include "cso_cache/cso_context.h"
+
+#include "main/macros.h"
+
+/**
+ * Convert GLenum blend tokens to pipe tokens.
+ * Both blend factors and blend funcs are accepted.
+ */
+static GLuint
+translate_blend(GLenum blend)
+{
+ switch (blend) {
+ /* blend functions */
+ case GL_FUNC_ADD:
+ return PIPE_BLEND_ADD;
+ case GL_FUNC_SUBTRACT:
+ return PIPE_BLEND_SUBTRACT;
+ case GL_FUNC_REVERSE_SUBTRACT:
+ return PIPE_BLEND_REVERSE_SUBTRACT;
+ case GL_MIN:
+ return PIPE_BLEND_MIN;
+ case GL_MAX:
+ return PIPE_BLEND_MAX;
+
+ /* blend factors */
+ case GL_ONE:
+ return PIPE_BLENDFACTOR_ONE;
+ case GL_SRC_COLOR:
+ return PIPE_BLENDFACTOR_SRC_COLOR;
+ case GL_SRC_ALPHA:
+ return PIPE_BLENDFACTOR_SRC_ALPHA;
+ case GL_DST_ALPHA:
+ return PIPE_BLENDFACTOR_DST_ALPHA;
+ case GL_DST_COLOR:
+ return PIPE_BLENDFACTOR_DST_COLOR;
+ case GL_SRC_ALPHA_SATURATE:
+ return PIPE_BLENDFACTOR_SRC_ALPHA_SATURATE;
+ case GL_CONSTANT_COLOR:
+ return PIPE_BLENDFACTOR_CONST_COLOR;
+ case GL_CONSTANT_ALPHA:
+ return PIPE_BLENDFACTOR_CONST_ALPHA;
+ /*
+ return PIPE_BLENDFACTOR_SRC1_COLOR;
+ return PIPE_BLENDFACTOR_SRC1_ALPHA;
+ */
+ case GL_ZERO:
+ return PIPE_BLENDFACTOR_ZERO;
+ case GL_ONE_MINUS_SRC_COLOR:
+ return PIPE_BLENDFACTOR_INV_SRC_COLOR;
+ case GL_ONE_MINUS_SRC_ALPHA:
+ return PIPE_BLENDFACTOR_INV_SRC_ALPHA;
+ case GL_ONE_MINUS_DST_COLOR:
+ return PIPE_BLENDFACTOR_INV_DST_COLOR;
+ case GL_ONE_MINUS_DST_ALPHA:
+ return PIPE_BLENDFACTOR_INV_DST_ALPHA;
+ case GL_ONE_MINUS_CONSTANT_COLOR:
+ return PIPE_BLENDFACTOR_INV_CONST_COLOR;
+ case GL_ONE_MINUS_CONSTANT_ALPHA:
+ return PIPE_BLENDFACTOR_INV_CONST_ALPHA;
+ /*
+ return PIPE_BLENDFACTOR_INV_SRC1_COLOR;
+ return PIPE_BLENDFACTOR_INV_SRC1_ALPHA;
+ */
+ default:
+ assert("invalid GL token in translate_blend()" == NULL);
+ return 0;
+ }
+}
+
+
+/**
+ * Convert GLenum logicop tokens to pipe tokens.
+ */
+static GLuint
+translate_logicop(GLenum logicop)
+{
+ switch (logicop) {
+ case GL_CLEAR:
+ return PIPE_LOGICOP_CLEAR;
+ case GL_NOR:
+ return PIPE_LOGICOP_NOR;
+ case GL_AND_INVERTED:
+ return PIPE_LOGICOP_AND_INVERTED;
+ case GL_COPY_INVERTED:
+ return PIPE_LOGICOP_COPY_INVERTED;
+ case GL_AND_REVERSE:
+ return PIPE_LOGICOP_AND_REVERSE;
+ case GL_INVERT:
+ return PIPE_LOGICOP_INVERT;
+ case GL_XOR:
+ return PIPE_LOGICOP_XOR;
+ case GL_NAND:
+ return PIPE_LOGICOP_NAND;
+ case GL_AND:
+ return PIPE_LOGICOP_AND;
+ case GL_EQUIV:
+ return PIPE_LOGICOP_EQUIV;
+ case GL_NOOP:
+ return PIPE_LOGICOP_NOOP;
+ case GL_OR_INVERTED:
+ return PIPE_LOGICOP_OR_INVERTED;
+ case GL_COPY:
+ return PIPE_LOGICOP_COPY;
+ case GL_OR_REVERSE:
+ return PIPE_LOGICOP_OR_REVERSE;
+ case GL_OR:
+ return PIPE_LOGICOP_OR;
+ case GL_SET:
+ return PIPE_LOGICOP_SET;
+ default:
+ assert("invalid GL token in translate_logicop()" == NULL);
+ return 0;
+ }
+}
+
+/**
+ * Figure out if colormasks are different per rt.
+ */
+static GLboolean
+colormask_per_rt(struct gl_context *ctx)
+{
+ /* a bit suboptimal have to compare lots of values */
+ unsigned i;
+ for (i = 1; i < ctx->Const.MaxDrawBuffers; i++) {
+ if (memcmp(ctx->Color.ColorMask[0], ctx->Color.ColorMask[i], 4)) {
+ return GL_TRUE;
+ }
+ }
+ return GL_FALSE;
+}
+
+/**
+ * Figure out if blend enables/state are different per rt.
+ */
+static GLboolean
+blend_per_rt(struct gl_context *ctx)
+{
+ if (ctx->Color.BlendEnabled &&
+ (ctx->Color.BlendEnabled != ((1 << ctx->Const.MaxDrawBuffers) - 1))) {
+ /* This can only happen if GL_EXT_draw_buffers2 is enabled */
+ return GL_TRUE;
+ }
+ if (ctx->Color._BlendFuncPerBuffer || ctx->Color._BlendEquationPerBuffer) {
+ /* this can only happen if GL_ARB_draw_buffers_blend is enabled */
+ return GL_TRUE;
+ }
+ return GL_FALSE;
+}
+
+static void
+update_blend( struct st_context *st )
+{
+ struct pipe_blend_state *blend = &st->state.blend;
+ unsigned num_state = 1;
+ unsigned i, j;
+
+ memset(blend, 0, sizeof(*blend));
+
+ if (blend_per_rt(st->ctx) || colormask_per_rt(st->ctx)) {
+ num_state = st->ctx->Const.MaxDrawBuffers;
+ blend->independent_blend_enable = 1;
+ }
+ /* Note it is impossible to correctly deal with EXT_blend_logic_op and
+ EXT_draw_buffers2/EXT_blend_equation_separate at the same time.
+ These combinations would require support for per-rt logicop enables
+ and separate alpha/rgb logicop/blend support respectively. Neither
+ possible in gallium nor most hardware. Assume these combinations
+ don't happen. */
+ if (st->ctx->Color.ColorLogicOpEnabled ||
+ (st->ctx->Color.BlendEnabled &&
+ st->ctx->Color.Blend[0].EquationRGB == GL_LOGIC_OP)) {
+ /* logicop enabled */
+ blend->logicop_enable = 1;
+ blend->logicop_func = translate_logicop(st->ctx->Color.LogicOp);
+ }
+ else if (st->ctx->Color.BlendEnabled) {
+ /* blending enabled */
+ for (i = 0, j = 0; i < num_state; i++) {
+
+ blend->rt[i].blend_enable = (st->ctx->Color.BlendEnabled >> i) & 0x1;
+
+ if (st->ctx->Extensions.ARB_draw_buffers_blend)
+ j = i;
+
+ blend->rt[i].rgb_func =
+ translate_blend(st->ctx->Color.Blend[j].EquationRGB);
+
+ if (st->ctx->Color.Blend[i].EquationRGB == GL_MIN ||
+ st->ctx->Color.Blend[i].EquationRGB == GL_MAX) {
+ /* Min/max are special */
+ blend->rt[i].rgb_src_factor = PIPE_BLENDFACTOR_ONE;
+ blend->rt[i].rgb_dst_factor = PIPE_BLENDFACTOR_ONE;
+ }
+ else {
+ blend->rt[i].rgb_src_factor =
+ translate_blend(st->ctx->Color.Blend[j].SrcRGB);
+ blend->rt[i].rgb_dst_factor =
+ translate_blend(st->ctx->Color.Blend[j].DstRGB);
+ }
+
+ blend->rt[i].alpha_func =
+ translate_blend(st->ctx->Color.Blend[j].EquationA);
+
+ if (st->ctx->Color.Blend[i].EquationA == GL_MIN ||
+ st->ctx->Color.Blend[i].EquationA == GL_MAX) {
+ /* Min/max are special */
+ blend->rt[i].alpha_src_factor = PIPE_BLENDFACTOR_ONE;
+ blend->rt[i].alpha_dst_factor = PIPE_BLENDFACTOR_ONE;
+ }
+ else {
+ blend->rt[i].alpha_src_factor =
+ translate_blend(st->ctx->Color.Blend[j].SrcA);
+ blend->rt[i].alpha_dst_factor =
+ translate_blend(st->ctx->Color.Blend[j].DstA);
+ }
+ }
+ }
+ else {
+ /* no blending / logicop */
+ }
+
+ /* Colormask - maybe reverse these bits? */
+ for (i = 0; i < num_state; i++) {
+ if (st->ctx->Color.ColorMask[i][0])
+ blend->rt[i].colormask |= PIPE_MASK_R;
+ if (st->ctx->Color.ColorMask[i][1])
+ blend->rt[i].colormask |= PIPE_MASK_G;
+ if (st->ctx->Color.ColorMask[i][2])
+ blend->rt[i].colormask |= PIPE_MASK_B;
+ if (st->ctx->Color.ColorMask[i][3])
+ blend->rt[i].colormask |= PIPE_MASK_A;
+ }
+
+ if (st->ctx->Color.DitherFlag)
+ blend->dither = 1;
+
+ if (st->ctx->Multisample.Enabled) {
+ /* unlike in gallium/d3d10 these operations are only performed
+ if msaa is enabled */
+ if (st->ctx->Multisample.SampleAlphaToCoverage)
+ blend->alpha_to_coverage = 1;
+ if (st->ctx->Multisample.SampleAlphaToOne)
+ blend->alpha_to_one = 1;
+ }
+
+ cso_set_blend(st->cso_context, blend);
+
+ {
+ struct pipe_blend_color bc;
+ COPY_4FV(bc.color, st->ctx->Color.BlendColorUnclamped);
+ cso_set_blend_color(st->cso_context, &bc);
+ }
+}
+
+
+const struct st_tracked_state st_update_blend = {
+ "st_update_blend", /* name */
+ { /* dirty */
+ (_NEW_COLOR | _NEW_MULTISAMPLE), /* XXX _NEW_BLEND someday? */ /* mesa */
+ 0, /* st */
+ },
+ update_blend, /* update */
+};
diff --git a/mesalib/src/mesa/state_tracker/st_atom_depth.c b/mesalib/src/mesa/state_tracker/st_atom_depth.c
index 6c51b1ac1..524f8986f 100644
--- a/mesalib/src/mesa/state_tracker/st_atom_depth.c
+++ b/mesalib/src/mesa/state_tracker/st_atom_depth.c
@@ -1,160 +1,160 @@
-/**************************************************************************
- *
- * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas.
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sub license, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice (including the
- * next paragraph) shall be included in all copies or substantial portions
- * of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
- * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
- * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- **************************************************************************/
-
- /*
- * Authors:
- * Keith Whitwell <keith@tungstengraphics.com>
- * Brian Paul
- * Zack Rusin
- */
-
-
-#include <assert.h>
-
-#include "st_context.h"
-#include "st_atom.h"
-#include "pipe/p_context.h"
-#include "pipe/p_defines.h"
-#include "cso_cache/cso_context.h"
-
-
-/**
- * Convert an OpenGL compare mode to a pipe tokens.
- */
-GLuint
-st_compare_func_to_pipe(GLenum func)
-{
- /* Same values, just biased */
- assert(PIPE_FUNC_NEVER == GL_NEVER - GL_NEVER);
- assert(PIPE_FUNC_LESS == GL_LESS - GL_NEVER);
- assert(PIPE_FUNC_EQUAL == GL_EQUAL - GL_NEVER);
- assert(PIPE_FUNC_LEQUAL == GL_LEQUAL - GL_NEVER);
- assert(PIPE_FUNC_GREATER == GL_GREATER - GL_NEVER);
- assert(PIPE_FUNC_NOTEQUAL == GL_NOTEQUAL - GL_NEVER);
- assert(PIPE_FUNC_GEQUAL == GL_GEQUAL - GL_NEVER);
- assert(PIPE_FUNC_ALWAYS == GL_ALWAYS - GL_NEVER);
- assert(func >= GL_NEVER);
- assert(func <= GL_ALWAYS);
- return func - GL_NEVER;
-}
-
-
-/**
- * Convert GLenum stencil op tokens to pipe tokens.
- */
-static GLuint
-gl_stencil_op_to_pipe(GLenum func)
-{
- switch (func) {
- case GL_KEEP:
- return PIPE_STENCIL_OP_KEEP;
- case GL_ZERO:
- return PIPE_STENCIL_OP_ZERO;
- case GL_REPLACE:
- return PIPE_STENCIL_OP_REPLACE;
- case GL_INCR:
- return PIPE_STENCIL_OP_INCR;
- case GL_DECR:
- return PIPE_STENCIL_OP_DECR;
- case GL_INCR_WRAP:
- return PIPE_STENCIL_OP_INCR_WRAP;
- case GL_DECR_WRAP:
- return PIPE_STENCIL_OP_DECR_WRAP;
- case GL_INVERT:
- return PIPE_STENCIL_OP_INVERT;
- default:
- assert("invalid GL token in gl_stencil_op_to_pipe()" == NULL);
- return 0;
- }
-}
-
-static void
-update_depth_stencil_alpha(struct st_context *st)
-{
- struct pipe_depth_stencil_alpha_state *dsa = &st->state.depth_stencil;
- struct pipe_stencil_ref sr;
- struct gl_context *ctx = st->ctx;
-
- memset(dsa, 0, sizeof(*dsa));
- memset(&sr, 0, sizeof(sr));
-
- if (ctx->Depth.Test && ctx->DrawBuffer->Visual.depthBits > 0) {
- dsa->depth.enabled = 1;
- dsa->depth.writemask = ctx->Depth.Mask;
- dsa->depth.func = st_compare_func_to_pipe(ctx->Depth.Func);
- }
-
- if (ctx->Stencil.Enabled && ctx->DrawBuffer->Visual.stencilBits > 0) {
- dsa->stencil[0].enabled = 1;
- dsa->stencil[0].func = st_compare_func_to_pipe(ctx->Stencil.Function[0]);
- dsa->stencil[0].fail_op = gl_stencil_op_to_pipe(ctx->Stencil.FailFunc[0]);
- dsa->stencil[0].zfail_op = gl_stencil_op_to_pipe(ctx->Stencil.ZFailFunc[0]);
- dsa->stencil[0].zpass_op = gl_stencil_op_to_pipe(ctx->Stencil.ZPassFunc[0]);
- dsa->stencil[0].valuemask = ctx->Stencil.ValueMask[0] & 0xff;
- dsa->stencil[0].writemask = ctx->Stencil.WriteMask[0] & 0xff;
- sr.ref_value[0] = ctx->Stencil.Ref[0] & 0xff;
-
- if (ctx->Stencil._TestTwoSide) {
- const GLuint back = ctx->Stencil._BackFace;
- dsa->stencil[1].enabled = 1;
- dsa->stencil[1].func = st_compare_func_to_pipe(ctx->Stencil.Function[back]);
- dsa->stencil[1].fail_op = gl_stencil_op_to_pipe(ctx->Stencil.FailFunc[back]);
- dsa->stencil[1].zfail_op = gl_stencil_op_to_pipe(ctx->Stencil.ZFailFunc[back]);
- dsa->stencil[1].zpass_op = gl_stencil_op_to_pipe(ctx->Stencil.ZPassFunc[back]);
- dsa->stencil[1].valuemask = ctx->Stencil.ValueMask[back] & 0xff;
- dsa->stencil[1].writemask = ctx->Stencil.WriteMask[back] & 0xff;
- sr.ref_value[1] = ctx->Stencil.Ref[back] & 0xff;
- }
- else {
- /* This should be unnecessary. Drivers must not expect this to
- * contain valid data, except the enabled bit
- */
- dsa->stencil[1] = dsa->stencil[0];
- dsa->stencil[1].enabled = 0;
- sr.ref_value[1] = sr.ref_value[0];
- }
- }
-
- if (ctx->Color.AlphaEnabled) {
- dsa->alpha.enabled = 1;
- dsa->alpha.func = st_compare_func_to_pipe(ctx->Color.AlphaFunc);
- dsa->alpha.ref_value = ctx->Color.AlphaRefUnclamped;
- }
-
- cso_set_depth_stencil_alpha(st->cso_context, dsa);
- cso_set_stencil_ref(st->cso_context, &sr);
-}
-
-
-const struct st_tracked_state st_update_depth_stencil_alpha = {
- "st_update_depth_stencil", /* name */
- { /* dirty */
- (_NEW_DEPTH|_NEW_STENCIL|_NEW_COLOR), /* mesa */
- 0, /* st */
- },
- update_depth_stencil_alpha /* update */
-};
+/**************************************************************************
+ *
+ * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ **************************************************************************/
+
+ /*
+ * Authors:
+ * Keith Whitwell <keith@tungstengraphics.com>
+ * Brian Paul
+ * Zack Rusin
+ */
+
+
+#include <assert.h>
+
+#include "st_context.h"
+#include "st_atom.h"
+#include "pipe/p_context.h"
+#include "pipe/p_defines.h"
+#include "cso_cache/cso_context.h"
+
+
+/**
+ * Convert an OpenGL compare mode to a pipe tokens.
+ */
+GLuint
+st_compare_func_to_pipe(GLenum func)
+{
+ /* Same values, just biased */
+ assert(PIPE_FUNC_NEVER == GL_NEVER - GL_NEVER);
+ assert(PIPE_FUNC_LESS == GL_LESS - GL_NEVER);
+ assert(PIPE_FUNC_EQUAL == GL_EQUAL - GL_NEVER);
+ assert(PIPE_FUNC_LEQUAL == GL_LEQUAL - GL_NEVER);
+ assert(PIPE_FUNC_GREATER == GL_GREATER - GL_NEVER);
+ assert(PIPE_FUNC_NOTEQUAL == GL_NOTEQUAL - GL_NEVER);
+ assert(PIPE_FUNC_GEQUAL == GL_GEQUAL - GL_NEVER);
+ assert(PIPE_FUNC_ALWAYS == GL_ALWAYS - GL_NEVER);
+ assert(func >= GL_NEVER);
+ assert(func <= GL_ALWAYS);
+ return func - GL_NEVER;
+}
+
+
+/**
+ * Convert GLenum stencil op tokens to pipe tokens.
+ */
+static GLuint
+gl_stencil_op_to_pipe(GLenum func)
+{
+ switch (func) {
+ case GL_KEEP:
+ return PIPE_STENCIL_OP_KEEP;
+ case GL_ZERO:
+ return PIPE_STENCIL_OP_ZERO;
+ case GL_REPLACE:
+ return PIPE_STENCIL_OP_REPLACE;
+ case GL_INCR:
+ return PIPE_STENCIL_OP_INCR;
+ case GL_DECR:
+ return PIPE_STENCIL_OP_DECR;
+ case GL_INCR_WRAP:
+ return PIPE_STENCIL_OP_INCR_WRAP;
+ case GL_DECR_WRAP:
+ return PIPE_STENCIL_OP_DECR_WRAP;
+ case GL_INVERT:
+ return PIPE_STENCIL_OP_INVERT;
+ default:
+ assert("invalid GL token in gl_stencil_op_to_pipe()" == NULL);
+ return 0;
+ }
+}
+
+static void
+update_depth_stencil_alpha(struct st_context *st)
+{
+ struct pipe_depth_stencil_alpha_state *dsa = &st->state.depth_stencil;
+ struct pipe_stencil_ref sr;
+ struct gl_context *ctx = st->ctx;
+
+ memset(dsa, 0, sizeof(*dsa));
+ memset(&sr, 0, sizeof(sr));
+
+ if (ctx->Depth.Test && ctx->DrawBuffer->Visual.depthBits > 0) {
+ dsa->depth.enabled = 1;
+ dsa->depth.writemask = ctx->Depth.Mask;
+ dsa->depth.func = st_compare_func_to_pipe(ctx->Depth.Func);
+ }
+
+ if (ctx->Stencil.Enabled && ctx->DrawBuffer->Visual.stencilBits > 0) {
+ dsa->stencil[0].enabled = 1;
+ dsa->stencil[0].func = st_compare_func_to_pipe(ctx->Stencil.Function[0]);
+ dsa->stencil[0].fail_op = gl_stencil_op_to_pipe(ctx->Stencil.FailFunc[0]);
+ dsa->stencil[0].zfail_op = gl_stencil_op_to_pipe(ctx->Stencil.ZFailFunc[0]);
+ dsa->stencil[0].zpass_op = gl_stencil_op_to_pipe(ctx->Stencil.ZPassFunc[0]);
+ dsa->stencil[0].valuemask = ctx->Stencil.ValueMask[0] & 0xff;
+ dsa->stencil[0].writemask = ctx->Stencil.WriteMask[0] & 0xff;
+ sr.ref_value[0] = ctx->Stencil.Ref[0] & 0xff;
+
+ if (ctx->Stencil._TestTwoSide) {
+ const GLuint back = ctx->Stencil._BackFace;
+ dsa->stencil[1].enabled = 1;
+ dsa->stencil[1].func = st_compare_func_to_pipe(ctx->Stencil.Function[back]);
+ dsa->stencil[1].fail_op = gl_stencil_op_to_pipe(ctx->Stencil.FailFunc[back]);
+ dsa->stencil[1].zfail_op = gl_stencil_op_to_pipe(ctx->Stencil.ZFailFunc[back]);
+ dsa->stencil[1].zpass_op = gl_stencil_op_to_pipe(ctx->Stencil.ZPassFunc[back]);
+ dsa->stencil[1].valuemask = ctx->Stencil.ValueMask[back] & 0xff;
+ dsa->stencil[1].writemask = ctx->Stencil.WriteMask[back] & 0xff;
+ sr.ref_value[1] = ctx->Stencil.Ref[back] & 0xff;
+ }
+ else {
+ /* This should be unnecessary. Drivers must not expect this to
+ * contain valid data, except the enabled bit
+ */
+ dsa->stencil[1] = dsa->stencil[0];
+ dsa->stencil[1].enabled = 0;
+ sr.ref_value[1] = sr.ref_value[0];
+ }
+ }
+
+ if (ctx->Color.AlphaEnabled) {
+ dsa->alpha.enabled = 1;
+ dsa->alpha.func = st_compare_func_to_pipe(ctx->Color.AlphaFunc);
+ dsa->alpha.ref_value = ctx->Color.AlphaRefUnclamped;
+ }
+
+ cso_set_depth_stencil_alpha(st->cso_context, dsa);
+ cso_set_stencil_ref(st->cso_context, &sr);
+}
+
+
+const struct st_tracked_state st_update_depth_stencil_alpha = {
+ "st_update_depth_stencil", /* name */
+ { /* dirty */
+ (_NEW_DEPTH|_NEW_STENCIL|_NEW_COLOR), /* mesa */
+ 0, /* st */
+ },
+ update_depth_stencil_alpha /* update */
+};
diff --git a/mesalib/src/mesa/state_tracker/st_atom_framebuffer.c b/mesalib/src/mesa/state_tracker/st_atom_framebuffer.c
index 76386fe01..678a270c7 100644
--- a/mesalib/src/mesa/state_tracker/st_atom_framebuffer.c
+++ b/mesalib/src/mesa/state_tracker/st_atom_framebuffer.c
@@ -1,182 +1,182 @@
-/**************************************************************************
- *
- * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas.
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sub license, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice (including the
- * next paragraph) shall be included in all copies or substantial portions
- * of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
- * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
- * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- **************************************************************************/
-
- /*
- * Authors:
- * Keith Whitwell <keith@tungstengraphics.com>
- * Brian Paul
- */
-
-#include "st_context.h"
-#include "st_atom.h"
-#include "st_cb_fbo.h"
-#include "st_texture.h"
-#include "pipe/p_context.h"
-#include "cso_cache/cso_context.h"
-#include "util/u_math.h"
-#include "util/u_inlines.h"
-#include "util/u_format.h"
-
-
-/**
- * When doing GL render to texture, we have to be sure that finalize_texture()
- * didn't yank out the pipe_resource that we earlier created a surface for.
- * Check for that here and create a new surface if needed.
- */
-static void
-update_renderbuffer_surface(struct st_context *st,
- struct st_renderbuffer *strb)
-{
- struct pipe_context *pipe = st->pipe;
- struct pipe_resource *resource = strb->rtt->pt;
- int rtt_width = strb->Base.Width;
- int rtt_height = strb->Base.Height;
- enum pipe_format format = st->ctx->Color.sRGBEnabled ? resource->format : util_format_linear(resource->format);
-
- if (!strb->surface ||
- strb->surface->format != format ||
- strb->surface->texture != resource ||
- strb->surface->width != rtt_width ||
- strb->surface->height != rtt_height) {
- GLuint level;
- /* find matching mipmap level size */
- for (level = 0; level <= resource->last_level; level++) {
- if (u_minify(resource->width0, level) == rtt_width &&
- u_minify(resource->height0, level) == rtt_height) {
- struct pipe_surface surf_tmpl;
- memset(&surf_tmpl, 0, sizeof(surf_tmpl));
- surf_tmpl.format = format;
- surf_tmpl.usage = PIPE_BIND_RENDER_TARGET;
- surf_tmpl.u.tex.level = level;
- surf_tmpl.u.tex.first_layer = strb->rtt_face + strb->rtt_slice;
- surf_tmpl.u.tex.last_layer = strb->rtt_face + strb->rtt_slice;
-
- pipe_surface_reference(&strb->surface, NULL);
-
- strb->surface = pipe->create_surface(pipe,
- resource,
- &surf_tmpl);
-#if 0
- printf("-- alloc new surface %d x %d into tex %p\n",
- strb->surface->width, strb->surface->height,
- texture);
-#endif
- break;
- }
- }
- }
-}
-
-
-/**
- * Update framebuffer state (color, depth, stencil, etc. buffers)
- */
-static void
-update_framebuffer_state( struct st_context *st )
-{
- struct pipe_framebuffer_state *framebuffer = &st->state.framebuffer;
- struct gl_framebuffer *fb = st->ctx->DrawBuffer;
- struct st_renderbuffer *strb;
- GLuint i;
-
- framebuffer->width = fb->Width;
- framebuffer->height = fb->Height;
-
- /*printf("------ fb size %d x %d\n", fb->Width, fb->Height);*/
-
- /* Examine Mesa's ctx->DrawBuffer->_ColorDrawBuffers state
- * to determine which surfaces to draw to
- */
- framebuffer->nr_cbufs = 0;
- for (i = 0; i < fb->_NumColorDrawBuffers; i++) {
- strb = st_renderbuffer(fb->_ColorDrawBuffers[i]);
-
- if (strb) {
- /*printf("--------- framebuffer surface rtt %p\n", strb->rtt);*/
- if (strb->rtt) {
- /* rendering to a GL texture, may have to update surface */
- update_renderbuffer_surface(st, strb);
- }
-
- if (strb->surface) {
- pipe_surface_reference(&framebuffer->cbufs[framebuffer->nr_cbufs],
- strb->surface);
- framebuffer->nr_cbufs++;
- }
- strb->defined = GL_TRUE; /* we'll be drawing something */
- }
- }
- for (i = framebuffer->nr_cbufs; i < PIPE_MAX_COLOR_BUFS; i++) {
- pipe_surface_reference(&framebuffer->cbufs[i], NULL);
- }
-
- /*
- * Depth/Stencil renderbuffer/surface.
- */
- strb = st_renderbuffer(fb->Attachment[BUFFER_DEPTH].Renderbuffer);
- if (strb) {
- strb = st_renderbuffer(strb->Base.Wrapped);
- if (strb->rtt) {
- /* rendering to a GL texture, may have to update surface */
- update_renderbuffer_surface(st, strb);
- }
- pipe_surface_reference(&framebuffer->zsbuf, strb->surface);
- }
- else {
- strb = st_renderbuffer(fb->Attachment[BUFFER_STENCIL].Renderbuffer);
- if (strb) {
- strb = st_renderbuffer(strb->Base.Wrapped);
- assert(strb->surface);
- pipe_surface_reference(&framebuffer->zsbuf, strb->surface);
- }
- else
- pipe_surface_reference(&framebuffer->zsbuf, NULL);
- }
-
-#ifdef DEBUG
- /* Make sure the resource binding flags were set properly */
- for (i = 0; i < framebuffer->nr_cbufs; i++) {
- assert(framebuffer->cbufs[i]->texture->bind & PIPE_BIND_RENDER_TARGET);
- }
- if (framebuffer->zsbuf) {
- assert(framebuffer->zsbuf->texture->bind & PIPE_BIND_DEPTH_STENCIL);
- }
-#endif
-
- cso_set_framebuffer(st->cso_context, framebuffer);
-}
-
-
-const struct st_tracked_state st_update_framebuffer = {
- "st_update_framebuffer", /* name */
- { /* dirty */
- _NEW_BUFFERS, /* mesa */
- ST_NEW_FRAMEBUFFER, /* st */
- },
- update_framebuffer_state /* update */
-};
-
+/**************************************************************************
+ *
+ * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ **************************************************************************/
+
+ /*
+ * Authors:
+ * Keith Whitwell <keith@tungstengraphics.com>
+ * Brian Paul
+ */
+
+#include "st_context.h"
+#include "st_atom.h"
+#include "st_cb_fbo.h"
+#include "st_texture.h"
+#include "pipe/p_context.h"
+#include "cso_cache/cso_context.h"
+#include "util/u_math.h"
+#include "util/u_inlines.h"
+#include "util/u_format.h"
+
+
+/**
+ * When doing GL render to texture, we have to be sure that finalize_texture()
+ * didn't yank out the pipe_resource that we earlier created a surface for.
+ * Check for that here and create a new surface if needed.
+ */
+static void
+update_renderbuffer_surface(struct st_context *st,
+ struct st_renderbuffer *strb)
+{
+ struct pipe_context *pipe = st->pipe;
+ struct pipe_resource *resource = strb->rtt->pt;
+ int rtt_width = strb->Base.Width;
+ int rtt_height = strb->Base.Height;
+ enum pipe_format format = st->ctx->Color.sRGBEnabled ? resource->format : util_format_linear(resource->format);
+
+ if (!strb->surface ||
+ strb->surface->format != format ||
+ strb->surface->texture != resource ||
+ strb->surface->width != rtt_width ||
+ strb->surface->height != rtt_height) {
+ GLuint level;
+ /* find matching mipmap level size */
+ for (level = 0; level <= resource->last_level; level++) {
+ if (u_minify(resource->width0, level) == rtt_width &&
+ u_minify(resource->height0, level) == rtt_height) {
+ struct pipe_surface surf_tmpl;
+ memset(&surf_tmpl, 0, sizeof(surf_tmpl));
+ surf_tmpl.format = format;
+ surf_tmpl.usage = PIPE_BIND_RENDER_TARGET;
+ surf_tmpl.u.tex.level = level;
+ surf_tmpl.u.tex.first_layer = strb->rtt_face + strb->rtt_slice;
+ surf_tmpl.u.tex.last_layer = strb->rtt_face + strb->rtt_slice;
+
+ pipe_surface_reference(&strb->surface, NULL);
+
+ strb->surface = pipe->create_surface(pipe,
+ resource,
+ &surf_tmpl);
+#if 0
+ printf("-- alloc new surface %d x %d into tex %p\n",
+ strb->surface->width, strb->surface->height,
+ texture);
+#endif
+ break;
+ }
+ }
+ }
+}
+
+
+/**
+ * Update framebuffer state (color, depth, stencil, etc. buffers)
+ */
+static void
+update_framebuffer_state( struct st_context *st )
+{
+ struct pipe_framebuffer_state *framebuffer = &st->state.framebuffer;
+ struct gl_framebuffer *fb = st->ctx->DrawBuffer;
+ struct st_renderbuffer *strb;
+ GLuint i;
+
+ framebuffer->width = fb->Width;
+ framebuffer->height = fb->Height;
+
+ /*printf("------ fb size %d x %d\n", fb->Width, fb->Height);*/
+
+ /* Examine Mesa's ctx->DrawBuffer->_ColorDrawBuffers state
+ * to determine which surfaces to draw to
+ */
+ framebuffer->nr_cbufs = 0;
+ for (i = 0; i < fb->_NumColorDrawBuffers; i++) {
+ strb = st_renderbuffer(fb->_ColorDrawBuffers[i]);
+
+ if (strb) {
+ /*printf("--------- framebuffer surface rtt %p\n", strb->rtt);*/
+ if (strb->rtt) {
+ /* rendering to a GL texture, may have to update surface */
+ update_renderbuffer_surface(st, strb);
+ }
+
+ if (strb->surface) {
+ pipe_surface_reference(&framebuffer->cbufs[framebuffer->nr_cbufs],
+ strb->surface);
+ framebuffer->nr_cbufs++;
+ }
+ strb->defined = GL_TRUE; /* we'll be drawing something */
+ }
+ }
+ for (i = framebuffer->nr_cbufs; i < PIPE_MAX_COLOR_BUFS; i++) {
+ pipe_surface_reference(&framebuffer->cbufs[i], NULL);
+ }
+
+ /*
+ * Depth/Stencil renderbuffer/surface.
+ */
+ strb = st_renderbuffer(fb->Attachment[BUFFER_DEPTH].Renderbuffer);
+ if (strb) {
+ strb = st_renderbuffer(strb->Base.Wrapped);
+ if (strb->rtt) {
+ /* rendering to a GL texture, may have to update surface */
+ update_renderbuffer_surface(st, strb);
+ }
+ pipe_surface_reference(&framebuffer->zsbuf, strb->surface);
+ }
+ else {
+ strb = st_renderbuffer(fb->Attachment[BUFFER_STENCIL].Renderbuffer);
+ if (strb) {
+ strb = st_renderbuffer(strb->Base.Wrapped);
+ assert(strb->surface);
+ pipe_surface_reference(&framebuffer->zsbuf, strb->surface);
+ }
+ else
+ pipe_surface_reference(&framebuffer->zsbuf, NULL);
+ }
+
+#ifdef DEBUG
+ /* Make sure the resource binding flags were set properly */
+ for (i = 0; i < framebuffer->nr_cbufs; i++) {
+ assert(framebuffer->cbufs[i]->texture->bind & PIPE_BIND_RENDER_TARGET);
+ }
+ if (framebuffer->zsbuf) {
+ assert(framebuffer->zsbuf->texture->bind & PIPE_BIND_DEPTH_STENCIL);
+ }
+#endif
+
+ cso_set_framebuffer(st->cso_context, framebuffer);
+}
+
+
+const struct st_tracked_state st_update_framebuffer = {
+ "st_update_framebuffer", /* name */
+ { /* dirty */
+ _NEW_BUFFERS, /* mesa */
+ ST_NEW_FRAMEBUFFER, /* st */
+ },
+ update_framebuffer_state /* update */
+};
+
diff --git a/mesalib/src/mesa/state_tracker/st_atom_pixeltransfer.c b/mesalib/src/mesa/state_tracker/st_atom_pixeltransfer.c
index 57430b36f..9b44d1a71 100644
--- a/mesalib/src/mesa/state_tracker/st_atom_pixeltransfer.c
+++ b/mesalib/src/mesa/state_tracker/st_atom_pixeltransfer.c
@@ -1,344 +1,344 @@
-/**************************************************************************
- *
- * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas.
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sub license, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice (including the
- * next paragraph) shall be included in all copies or substantial portions
- * of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
- * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
- * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- **************************************************************************/
-
-/*
- * Generate fragment programs to implement pixel transfer ops, such as
- * scale/bias, colortable, convolution...
- *
- * Authors:
- * Brian Paul
- */
-
-#include "main/imports.h"
-#include "main/image.h"
-#include "main/macros.h"
-#include "program/program.h"
-#include "program/prog_cache.h"
-#include "program/prog_instruction.h"
-#include "program/prog_parameter.h"
-#include "program/prog_print.h"
-
-#include "st_context.h"
-#include "st_format.h"
-#include "st_texture.h"
-
-#include "pipe/p_screen.h"
-#include "pipe/p_context.h"
-#include "util/u_inlines.h"
-#include "util/u_pack_color.h"
-
-
-struct state_key
-{
- GLuint scaleAndBias:1;
- GLuint pixelMaps:1;
-
-#if 0
- GLfloat Maps[3][256][4];
- int NumMaps;
- GLint NumStages;
- pipeline_stage Stages[STAGE_MAX];
- GLboolean StagesUsed[STAGE_MAX];
- GLfloat Scale1[4], Bias1[4];
- GLfloat Scale2[4], Bias2[4];
-#endif
-};
-
-static void
-make_state_key(struct gl_context *ctx, struct state_key *key)
-{
- memset(key, 0, sizeof(*key));
-
- if (ctx->Pixel.RedBias != 0.0 || ctx->Pixel.RedScale != 1.0 ||
- ctx->Pixel.GreenBias != 0.0 || ctx->Pixel.GreenScale != 1.0 ||
- ctx->Pixel.BlueBias != 0.0 || ctx->Pixel.BlueScale != 1.0 ||
- ctx->Pixel.AlphaBias != 0.0 || ctx->Pixel.AlphaScale != 1.0) {
- key->scaleAndBias = 1;
- }
-
- key->pixelMaps = ctx->Pixel.MapColorFlag;
-}
-
-
-static struct pipe_resource *
-create_color_map_texture(struct gl_context *ctx)
-{
- struct st_context *st = st_context(ctx);
- struct pipe_context *pipe = st->pipe;
- struct pipe_resource *pt;
- enum pipe_format format;
- const uint texSize = 256; /* simple, and usually perfect */
-
- /* find an RGBA texture format */
- format = st_choose_format(pipe->screen, GL_RGBA,
- PIPE_TEXTURE_2D, 0, PIPE_BIND_SAMPLER_VIEW);
-
- /* create texture for color map/table */
- pt = st_texture_create(st, PIPE_TEXTURE_2D, format, 0,
- texSize, texSize, 1, 1, PIPE_BIND_SAMPLER_VIEW);
- return pt;
-}
-
-
-/**
- * Update the pixelmap texture with the contents of the R/G/B/A pixel maps.
- */
-static void
-load_color_map_texture(struct gl_context *ctx, struct pipe_resource *pt)
-{
- struct st_context *st = st_context(ctx);
- struct pipe_context *pipe = st->pipe;
- struct pipe_transfer *transfer;
- const GLuint rSize = ctx->PixelMaps.RtoR.Size;
- const GLuint gSize = ctx->PixelMaps.GtoG.Size;
- const GLuint bSize = ctx->PixelMaps.BtoB.Size;
- const GLuint aSize = ctx->PixelMaps.AtoA.Size;
- const uint texSize = pt->width0;
- uint *dest;
- uint i, j;
-
- transfer = pipe_get_transfer(st_context(ctx)->pipe,
- pt, 0, 0, PIPE_TRANSFER_WRITE,
- 0, 0, texSize, texSize);
- dest = (uint *) pipe_transfer_map(pipe, transfer);
-
- /* Pack four 1D maps into a 2D texture:
- * R map is placed horizontally, indexed by S, in channel 0
- * G map is placed vertically, indexed by T, in channel 1
- * B map is placed horizontally, indexed by S, in channel 2
- * A map is placed vertically, indexed by T, in channel 3
- */
- for (i = 0; i < texSize; i++) {
- for (j = 0; j < texSize; j++) {
- union util_color uc;
- int k = (i * texSize + j);
- ubyte r = ctx->PixelMaps.RtoR.Map8[j * rSize / texSize];
- ubyte g = ctx->PixelMaps.GtoG.Map8[i * gSize / texSize];
- ubyte b = ctx->PixelMaps.BtoB.Map8[j * bSize / texSize];
- ubyte a = ctx->PixelMaps.AtoA.Map8[i * aSize / texSize];
- util_pack_color_ub(r, g, b, a, pt->format, &uc);
- *(dest + k) = uc.ui;
- }
- }
-
- pipe_transfer_unmap(pipe, transfer);
- pipe->transfer_destroy(pipe, transfer);
-}
-
-
-
-#define MAX_INST 100
-
-/**
- * Returns a fragment program which implements the current pixel transfer ops.
- */
-static struct gl_fragment_program *
-get_pixel_transfer_program(struct gl_context *ctx, const struct state_key *key)
-{
- struct st_context *st = st_context(ctx);
- struct prog_instruction inst[MAX_INST];
- struct gl_program_parameter_list *params;
- struct gl_fragment_program *fp;
- GLuint ic = 0;
- const GLuint colorTemp = 0;
-
- fp = (struct gl_fragment_program *)
- ctx->Driver.NewProgram(ctx, GL_FRAGMENT_PROGRAM_ARB, 0);
- if (!fp)
- return NULL;
-
- params = _mesa_new_parameter_list();
-
- /*
- * Get initial pixel color from the texture.
- * TEX colorTemp, fragment.texcoord[0], texture[0], 2D;
- */
- _mesa_init_instructions(inst + ic, 1);
- inst[ic].Opcode = OPCODE_TEX;
- inst[ic].DstReg.File = PROGRAM_TEMPORARY;
- inst[ic].DstReg.Index = colorTemp;
- inst[ic].SrcReg[0].File = PROGRAM_INPUT;
- inst[ic].SrcReg[0].Index = FRAG_ATTRIB_TEX0;
- inst[ic].TexSrcUnit = 0;
- inst[ic].TexSrcTarget = TEXTURE_2D_INDEX;
- ic++;
- fp->Base.InputsRead = (1 << FRAG_ATTRIB_TEX0);
- fp->Base.OutputsWritten = BITFIELD64_BIT(FRAG_RESULT_COLOR);
- fp->Base.SamplersUsed = 0x1; /* sampler 0 (bit 0) is used */
-
- if (key->scaleAndBias) {
- static const gl_state_index scale_state[STATE_LENGTH] =
- { STATE_INTERNAL, STATE_PT_SCALE, 0, 0, 0 };
- static const gl_state_index bias_state[STATE_LENGTH] =
- { STATE_INTERNAL, STATE_PT_BIAS, 0, 0, 0 };
- GLint scale_p, bias_p;
-
- scale_p = _mesa_add_state_reference(params, scale_state);
- bias_p = _mesa_add_state_reference(params, bias_state);
-
- /* MAD colorTemp, colorTemp, scale, bias; */
- _mesa_init_instructions(inst + ic, 1);
- inst[ic].Opcode = OPCODE_MAD;
- inst[ic].DstReg.File = PROGRAM_TEMPORARY;
- inst[ic].DstReg.Index = colorTemp;
- inst[ic].SrcReg[0].File = PROGRAM_TEMPORARY;
- inst[ic].SrcReg[0].Index = colorTemp;
- inst[ic].SrcReg[1].File = PROGRAM_STATE_VAR;
- inst[ic].SrcReg[1].Index = scale_p;
- inst[ic].SrcReg[2].File = PROGRAM_STATE_VAR;
- inst[ic].SrcReg[2].Index = bias_p;
- ic++;
- }
-
- if (key->pixelMaps) {
- const GLuint temp = 1;
-
- /* create the colormap/texture now if not already done */
- if (!st->pixel_xfer.pixelmap_texture) {
- st->pixel_xfer.pixelmap_texture = create_color_map_texture(ctx);
- st->pixel_xfer.pixelmap_sampler_view =
- st_create_texture_sampler_view(st->pipe,
- st->pixel_xfer.pixelmap_texture);
- }
-
- /* with a little effort, we can do four pixel map look-ups with
- * two TEX instructions:
- */
-
- /* TEX temp.rg, colorTemp.rgba, texture[1], 2D; */
- _mesa_init_instructions(inst + ic, 1);
- inst[ic].Opcode = OPCODE_TEX;
- inst[ic].DstReg.File = PROGRAM_TEMPORARY;
- inst[ic].DstReg.Index = temp;
- inst[ic].DstReg.WriteMask = WRITEMASK_XY; /* write R,G */
- inst[ic].SrcReg[0].File = PROGRAM_TEMPORARY;
- inst[ic].SrcReg[0].Index = colorTemp;
- inst[ic].TexSrcUnit = 1;
- inst[ic].TexSrcTarget = TEXTURE_2D_INDEX;
- ic++;
-
- /* TEX temp.ba, colorTemp.baba, texture[1], 2D; */
- _mesa_init_instructions(inst + ic, 1);
- inst[ic].Opcode = OPCODE_TEX;
- inst[ic].DstReg.File = PROGRAM_TEMPORARY;
- inst[ic].DstReg.Index = temp;
- inst[ic].DstReg.WriteMask = WRITEMASK_ZW; /* write B,A */
- inst[ic].SrcReg[0].File = PROGRAM_TEMPORARY;
- inst[ic].SrcReg[0].Index = colorTemp;
- inst[ic].SrcReg[0].Swizzle = MAKE_SWIZZLE4(SWIZZLE_Z, SWIZZLE_W,
- SWIZZLE_Z, SWIZZLE_W);
- inst[ic].TexSrcUnit = 1;
- inst[ic].TexSrcTarget = TEXTURE_2D_INDEX;
- ic++;
-
- /* MOV colorTemp, temp; */
- _mesa_init_instructions(inst + ic, 1);
- inst[ic].Opcode = OPCODE_MOV;
- inst[ic].DstReg.File = PROGRAM_TEMPORARY;
- inst[ic].DstReg.Index = colorTemp;
- inst[ic].SrcReg[0].File = PROGRAM_TEMPORARY;
- inst[ic].SrcReg[0].Index = temp;
- ic++;
-
- fp->Base.SamplersUsed |= (1 << 1); /* sampler 1 is used */
- }
-
- /* Modify last instruction's dst reg to write to result.color */
- {
- struct prog_instruction *last = &inst[ic - 1];
- last->DstReg.File = PROGRAM_OUTPUT;
- last->DstReg.Index = FRAG_RESULT_COLOR;
- }
-
- /* END; */
- _mesa_init_instructions(inst + ic, 1);
- inst[ic].Opcode = OPCODE_END;
- ic++;
-
- assert(ic <= MAX_INST);
-
-
- fp->Base.Instructions = _mesa_alloc_instructions(ic);
- if (!fp->Base.Instructions) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY,
- "generating pixel transfer program");
- return NULL;
- }
-
- _mesa_copy_instructions(fp->Base.Instructions, inst, ic);
- fp->Base.NumInstructions = ic;
- fp->Base.Parameters = params;
-
-#if 0
- printf("========= pixel transfer prog\n");
- _mesa_print_program(&fp->Base);
- _mesa_print_parameter_list(fp->Base.Parameters);
-#endif
-
- return fp;
-}
-
-
-
-/**
- * Update st->pixel_xfer.program in response to new pixel-transfer state.
- */
-static void
-update_pixel_transfer(struct st_context *st)
-{
- struct gl_context *ctx = st->ctx;
- struct state_key key;
- struct gl_fragment_program *fp;
-
- make_state_key(st->ctx, &key);
-
- fp = (struct gl_fragment_program *)
- _mesa_search_program_cache(st->pixel_xfer.cache, &key, sizeof(key));
- if (!fp) {
- fp = get_pixel_transfer_program(st->ctx, &key);
- _mesa_program_cache_insert(st->ctx, st->pixel_xfer.cache,
- &key, sizeof(key), &fp->Base);
- }
-
- if (ctx->Pixel.MapColorFlag) {
- load_color_map_texture(ctx, st->pixel_xfer.pixelmap_texture);
- }
- st->pixel_xfer.pixelmap_enabled = ctx->Pixel.MapColorFlag;
-
- st->pixel_xfer.program = (struct st_fragment_program *) fp;
-}
-
-
-
-const struct st_tracked_state st_update_pixel_transfer = {
- "st_update_pixel_transfer", /* name */
- { /* dirty */
- _NEW_PIXEL, /* mesa */
- 0, /* st */
- },
- update_pixel_transfer /* update */
-};
+/**************************************************************************
+ *
+ * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ **************************************************************************/
+
+/*
+ * Generate fragment programs to implement pixel transfer ops, such as
+ * scale/bias, colortable, convolution...
+ *
+ * Authors:
+ * Brian Paul
+ */
+
+#include "main/imports.h"
+#include "main/image.h"
+#include "main/macros.h"
+#include "program/program.h"
+#include "program/prog_cache.h"
+#include "program/prog_instruction.h"
+#include "program/prog_parameter.h"
+#include "program/prog_print.h"
+
+#include "st_context.h"
+#include "st_format.h"
+#include "st_texture.h"
+
+#include "pipe/p_screen.h"
+#include "pipe/p_context.h"
+#include "util/u_inlines.h"
+#include "util/u_pack_color.h"
+
+
+struct state_key
+{
+ GLuint scaleAndBias:1;
+ GLuint pixelMaps:1;
+
+#if 0
+ GLfloat Maps[3][256][4];
+ int NumMaps;
+ GLint NumStages;
+ pipeline_stage Stages[STAGE_MAX];
+ GLboolean StagesUsed[STAGE_MAX];
+ GLfloat Scale1[4], Bias1[4];
+ GLfloat Scale2[4], Bias2[4];
+#endif
+};
+
+static void
+make_state_key(struct gl_context *ctx, struct state_key *key)
+{
+ memset(key, 0, sizeof(*key));
+
+ if (ctx->Pixel.RedBias != 0.0 || ctx->Pixel.RedScale != 1.0 ||
+ ctx->Pixel.GreenBias != 0.0 || ctx->Pixel.GreenScale != 1.0 ||
+ ctx->Pixel.BlueBias != 0.0 || ctx->Pixel.BlueScale != 1.0 ||
+ ctx->Pixel.AlphaBias != 0.0 || ctx->Pixel.AlphaScale != 1.0) {
+ key->scaleAndBias = 1;
+ }
+
+ key->pixelMaps = ctx->Pixel.MapColorFlag;
+}
+
+
+static struct pipe_resource *
+create_color_map_texture(struct gl_context *ctx)
+{
+ struct st_context *st = st_context(ctx);
+ struct pipe_context *pipe = st->pipe;
+ struct pipe_resource *pt;
+ enum pipe_format format;
+ const uint texSize = 256; /* simple, and usually perfect */
+
+ /* find an RGBA texture format */
+ format = st_choose_format(pipe->screen, GL_RGBA,
+ PIPE_TEXTURE_2D, 0, PIPE_BIND_SAMPLER_VIEW);
+
+ /* create texture for color map/table */
+ pt = st_texture_create(st, PIPE_TEXTURE_2D, format, 0,
+ texSize, texSize, 1, 1, PIPE_BIND_SAMPLER_VIEW);
+ return pt;
+}
+
+
+/**
+ * Update the pixelmap texture with the contents of the R/G/B/A pixel maps.
+ */
+static void
+load_color_map_texture(struct gl_context *ctx, struct pipe_resource *pt)
+{
+ struct st_context *st = st_context(ctx);
+ struct pipe_context *pipe = st->pipe;
+ struct pipe_transfer *transfer;
+ const GLuint rSize = ctx->PixelMaps.RtoR.Size;
+ const GLuint gSize = ctx->PixelMaps.GtoG.Size;
+ const GLuint bSize = ctx->PixelMaps.BtoB.Size;
+ const GLuint aSize = ctx->PixelMaps.AtoA.Size;
+ const uint texSize = pt->width0;
+ uint *dest;
+ uint i, j;
+
+ transfer = pipe_get_transfer(st_context(ctx)->pipe,
+ pt, 0, 0, PIPE_TRANSFER_WRITE,
+ 0, 0, texSize, texSize);
+ dest = (uint *) pipe_transfer_map(pipe, transfer);
+
+ /* Pack four 1D maps into a 2D texture:
+ * R map is placed horizontally, indexed by S, in channel 0
+ * G map is placed vertically, indexed by T, in channel 1
+ * B map is placed horizontally, indexed by S, in channel 2
+ * A map is placed vertically, indexed by T, in channel 3
+ */
+ for (i = 0; i < texSize; i++) {
+ for (j = 0; j < texSize; j++) {
+ union util_color uc;
+ int k = (i * texSize + j);
+ ubyte r = ctx->PixelMaps.RtoR.Map8[j * rSize / texSize];
+ ubyte g = ctx->PixelMaps.GtoG.Map8[i * gSize / texSize];
+ ubyte b = ctx->PixelMaps.BtoB.Map8[j * bSize / texSize];
+ ubyte a = ctx->PixelMaps.AtoA.Map8[i * aSize / texSize];
+ util_pack_color_ub(r, g, b, a, pt->format, &uc);
+ *(dest + k) = uc.ui;
+ }
+ }
+
+ pipe_transfer_unmap(pipe, transfer);
+ pipe->transfer_destroy(pipe, transfer);
+}
+
+
+
+#define MAX_INST 100
+
+/**
+ * Returns a fragment program which implements the current pixel transfer ops.
+ */
+static struct gl_fragment_program *
+get_pixel_transfer_program(struct gl_context *ctx, const struct state_key *key)
+{
+ struct st_context *st = st_context(ctx);
+ struct prog_instruction inst[MAX_INST];
+ struct gl_program_parameter_list *params;
+ struct gl_fragment_program *fp;
+ GLuint ic = 0;
+ const GLuint colorTemp = 0;
+
+ fp = (struct gl_fragment_program *)
+ ctx->Driver.NewProgram(ctx, GL_FRAGMENT_PROGRAM_ARB, 0);
+ if (!fp)
+ return NULL;
+
+ params = _mesa_new_parameter_list();
+
+ /*
+ * Get initial pixel color from the texture.
+ * TEX colorTemp, fragment.texcoord[0], texture[0], 2D;
+ */
+ _mesa_init_instructions(inst + ic, 1);
+ inst[ic].Opcode = OPCODE_TEX;
+ inst[ic].DstReg.File = PROGRAM_TEMPORARY;
+ inst[ic].DstReg.Index = colorTemp;
+ inst[ic].SrcReg[0].File = PROGRAM_INPUT;
+ inst[ic].SrcReg[0].Index = FRAG_ATTRIB_TEX0;
+ inst[ic].TexSrcUnit = 0;
+ inst[ic].TexSrcTarget = TEXTURE_2D_INDEX;
+ ic++;
+ fp->Base.InputsRead = (1 << FRAG_ATTRIB_TEX0);
+ fp->Base.OutputsWritten = BITFIELD64_BIT(FRAG_RESULT_COLOR);
+ fp->Base.SamplersUsed = 0x1; /* sampler 0 (bit 0) is used */
+
+ if (key->scaleAndBias) {
+ static const gl_state_index scale_state[STATE_LENGTH] =
+ { STATE_INTERNAL, STATE_PT_SCALE, 0, 0, 0 };
+ static const gl_state_index bias_state[STATE_LENGTH] =
+ { STATE_INTERNAL, STATE_PT_BIAS, 0, 0, 0 };
+ GLint scale_p, bias_p;
+
+ scale_p = _mesa_add_state_reference(params, scale_state);
+ bias_p = _mesa_add_state_reference(params, bias_state);
+
+ /* MAD colorTemp, colorTemp, scale, bias; */
+ _mesa_init_instructions(inst + ic, 1);
+ inst[ic].Opcode = OPCODE_MAD;
+ inst[ic].DstReg.File = PROGRAM_TEMPORARY;
+ inst[ic].DstReg.Index = colorTemp;
+ inst[ic].SrcReg[0].File = PROGRAM_TEMPORARY;
+ inst[ic].SrcReg[0].Index = colorTemp;
+ inst[ic].SrcReg[1].File = PROGRAM_STATE_VAR;
+ inst[ic].SrcReg[1].Index = scale_p;
+ inst[ic].SrcReg[2].File = PROGRAM_STATE_VAR;
+ inst[ic].SrcReg[2].Index = bias_p;
+ ic++;
+ }
+
+ if (key->pixelMaps) {
+ const GLuint temp = 1;
+
+ /* create the colormap/texture now if not already done */
+ if (!st->pixel_xfer.pixelmap_texture) {
+ st->pixel_xfer.pixelmap_texture = create_color_map_texture(ctx);
+ st->pixel_xfer.pixelmap_sampler_view =
+ st_create_texture_sampler_view(st->pipe,
+ st->pixel_xfer.pixelmap_texture);
+ }
+
+ /* with a little effort, we can do four pixel map look-ups with
+ * two TEX instructions:
+ */
+
+ /* TEX temp.rg, colorTemp.rgba, texture[1], 2D; */
+ _mesa_init_instructions(inst + ic, 1);
+ inst[ic].Opcode = OPCODE_TEX;
+ inst[ic].DstReg.File = PROGRAM_TEMPORARY;
+ inst[ic].DstReg.Index = temp;
+ inst[ic].DstReg.WriteMask = WRITEMASK_XY; /* write R,G */
+ inst[ic].SrcReg[0].File = PROGRAM_TEMPORARY;
+ inst[ic].SrcReg[0].Index = colorTemp;
+ inst[ic].TexSrcUnit = 1;
+ inst[ic].TexSrcTarget = TEXTURE_2D_INDEX;
+ ic++;
+
+ /* TEX temp.ba, colorTemp.baba, texture[1], 2D; */
+ _mesa_init_instructions(inst + ic, 1);
+ inst[ic].Opcode = OPCODE_TEX;
+ inst[ic].DstReg.File = PROGRAM_TEMPORARY;
+ inst[ic].DstReg.Index = temp;
+ inst[ic].DstReg.WriteMask = WRITEMASK_ZW; /* write B,A */
+ inst[ic].SrcReg[0].File = PROGRAM_TEMPORARY;
+ inst[ic].SrcReg[0].Index = colorTemp;
+ inst[ic].SrcReg[0].Swizzle = MAKE_SWIZZLE4(SWIZZLE_Z, SWIZZLE_W,
+ SWIZZLE_Z, SWIZZLE_W);
+ inst[ic].TexSrcUnit = 1;
+ inst[ic].TexSrcTarget = TEXTURE_2D_INDEX;
+ ic++;
+
+ /* MOV colorTemp, temp; */
+ _mesa_init_instructions(inst + ic, 1);
+ inst[ic].Opcode = OPCODE_MOV;
+ inst[ic].DstReg.File = PROGRAM_TEMPORARY;
+ inst[ic].DstReg.Index = colorTemp;
+ inst[ic].SrcReg[0].File = PROGRAM_TEMPORARY;
+ inst[ic].SrcReg[0].Index = temp;
+ ic++;
+
+ fp->Base.SamplersUsed |= (1 << 1); /* sampler 1 is used */
+ }
+
+ /* Modify last instruction's dst reg to write to result.color */
+ {
+ struct prog_instruction *last = &inst[ic - 1];
+ last->DstReg.File = PROGRAM_OUTPUT;
+ last->DstReg.Index = FRAG_RESULT_COLOR;
+ }
+
+ /* END; */
+ _mesa_init_instructions(inst + ic, 1);
+ inst[ic].Opcode = OPCODE_END;
+ ic++;
+
+ assert(ic <= MAX_INST);
+
+
+ fp->Base.Instructions = _mesa_alloc_instructions(ic);
+ if (!fp->Base.Instructions) {
+ _mesa_error(ctx, GL_OUT_OF_MEMORY,
+ "generating pixel transfer program");
+ return NULL;
+ }
+
+ _mesa_copy_instructions(fp->Base.Instructions, inst, ic);
+ fp->Base.NumInstructions = ic;
+ fp->Base.Parameters = params;
+
+#if 0
+ printf("========= pixel transfer prog\n");
+ _mesa_print_program(&fp->Base);
+ _mesa_print_parameter_list(fp->Base.Parameters);
+#endif
+
+ return fp;
+}
+
+
+
+/**
+ * Update st->pixel_xfer.program in response to new pixel-transfer state.
+ */
+static void
+update_pixel_transfer(struct st_context *st)
+{
+ struct gl_context *ctx = st->ctx;
+ struct state_key key;
+ struct gl_fragment_program *fp;
+
+ make_state_key(st->ctx, &key);
+
+ fp = (struct gl_fragment_program *)
+ _mesa_search_program_cache(st->pixel_xfer.cache, &key, sizeof(key));
+ if (!fp) {
+ fp = get_pixel_transfer_program(st->ctx, &key);
+ _mesa_program_cache_insert(st->ctx, st->pixel_xfer.cache,
+ &key, sizeof(key), &fp->Base);
+ }
+
+ if (ctx->Pixel.MapColorFlag) {
+ load_color_map_texture(ctx, st->pixel_xfer.pixelmap_texture);
+ }
+ st->pixel_xfer.pixelmap_enabled = ctx->Pixel.MapColorFlag;
+
+ st->pixel_xfer.program = (struct st_fragment_program *) fp;
+}
+
+
+
+const struct st_tracked_state st_update_pixel_transfer = {
+ "st_update_pixel_transfer", /* name */
+ { /* dirty */
+ _NEW_PIXEL, /* mesa */
+ 0, /* st */
+ },
+ update_pixel_transfer /* update */
+};
diff --git a/mesalib/src/mesa/state_tracker/st_atom_rasterizer.c b/mesalib/src/mesa/state_tracker/st_atom_rasterizer.c
index 250cbb226..89ee4ebca 100644
--- a/mesalib/src/mesa/state_tracker/st_atom_rasterizer.c
+++ b/mesalib/src/mesa/state_tracker/st_atom_rasterizer.c
@@ -1,280 +1,280 @@
-/**************************************************************************
- *
- * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas.
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sub license, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice (including the
- * next paragraph) shall be included in all copies or substantial portions
- * of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
- * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
- * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- **************************************************************************/
-
- /*
- * Authors:
- * Keith Whitwell <keith@tungstengraphics.com>
- */
-
-#include "main/macros.h"
-#include "st_context.h"
-#include "st_atom.h"
-#include "pipe/p_context.h"
-#include "pipe/p_defines.h"
-#include "cso_cache/cso_context.h"
-
-
-static GLuint translate_fill( GLenum mode )
-{
- switch (mode) {
- case GL_POINT:
- return PIPE_POLYGON_MODE_POINT;
- case GL_LINE:
- return PIPE_POLYGON_MODE_LINE;
- case GL_FILL:
- return PIPE_POLYGON_MODE_FILL;
- default:
- assert(0);
- return 0;
- }
-}
-
-
-
-static void update_raster_state( struct st_context *st )
-{
- struct gl_context *ctx = st->ctx;
- struct pipe_rasterizer_state *raster = &st->state.rasterizer;
- const struct gl_vertex_program *vertProg = ctx->VertexProgram._Current;
- const struct gl_fragment_program *fragProg = ctx->FragmentProgram._Current;
- uint i;
-
- memset(raster, 0, sizeof(*raster));
-
- /* _NEW_POLYGON, _NEW_BUFFERS
- */
- {
- raster->front_ccw = (ctx->Polygon.FrontFace == GL_CCW);
-
- /*
- * Gallium's surfaces are Y=0=TOP orientation. OpenGL is the
- * opposite. Window system surfaces are Y=0=TOP. Mesa's FBOs
- * must match OpenGL conventions so FBOs use Y=0=BOTTOM. In that
- * case, we must invert Y and flip the notion of front vs. back.
- */
- if (st_fb_orientation(ctx->DrawBuffer) == Y_0_BOTTOM) {
- /* Drawing to an FBO. The viewport will be inverted. */
- raster->front_ccw ^= 1;
- }
- }
-
- /* _NEW_LIGHT
- */
- if (ctx->Light.ShadeModel == GL_FLAT)
- raster->flatshade = 1;
-
- if (ctx->Light.ProvokingVertex == GL_FIRST_VERTEX_CONVENTION_EXT)
- raster->flatshade_first = 1;
-
- /* _NEW_LIGHT | _NEW_PROGRAM
- *
- * Back-face colors can come from traditional lighting (when
- * GL_LIGHT_MODEL_TWO_SIDE is set) or from vertex programs/shaders (when
- * GL_VERTEX_PROGRAM_TWO_SIDE is set). Note the logic here.
- */
- if (ctx->VertexProgram._Current) {
- if (ctx->VertexProgram._Enabled ||
- (ctx->Shader.CurrentVertexProgram &&
- ctx->Shader.CurrentVertexProgram->LinkStatus)) {
- /* user-defined vertex program or shader */
- raster->light_twoside = ctx->VertexProgram.TwoSideEnabled;
- }
- else {
- /* TNL-generated program */
- raster->light_twoside = ctx->Light.Enabled && ctx->Light.Model.TwoSide;
- }
- }
- else if (ctx->Light.Enabled && ctx->Light.Model.TwoSide) {
- raster->light_twoside = 1;
- }
-
- raster->clamp_vertex_color = ctx->Light._ClampVertexColor;
-
- /* _NEW_POLYGON
- */
- if (ctx->Polygon.CullFlag) {
- switch (ctx->Polygon.CullFaceMode) {
- case GL_FRONT:
- raster->cull_face = PIPE_FACE_FRONT;
- break;
- case GL_BACK:
- raster->cull_face = PIPE_FACE_BACK;
- break;
- case GL_FRONT_AND_BACK:
- raster->cull_face = PIPE_FACE_FRONT_AND_BACK;
- break;
- }
- }
- else {
- raster->cull_face = PIPE_FACE_NONE;
- }
-
- /* _NEW_POLYGON
- */
- {
- raster->fill_front = translate_fill( ctx->Polygon.FrontMode );
- raster->fill_back = translate_fill( ctx->Polygon.BackMode );
-
- /* Simplify when culling is active:
- */
- if (raster->cull_face & PIPE_FACE_FRONT) {
- raster->fill_front = raster->fill_back;
- }
-
- if (raster->cull_face & PIPE_FACE_BACK) {
- raster->fill_back = raster->fill_front;
- }
- }
-
- /* _NEW_POLYGON
- */
- if (ctx->Polygon.OffsetUnits != 0.0 ||
- ctx->Polygon.OffsetFactor != 0.0) {
- raster->offset_point = ctx->Polygon.OffsetPoint;
- raster->offset_line = ctx->Polygon.OffsetLine;
- raster->offset_tri = ctx->Polygon.OffsetFill;
- }
-
- if (ctx->Polygon.OffsetPoint ||
- ctx->Polygon.OffsetLine ||
- ctx->Polygon.OffsetFill) {
- raster->offset_units = ctx->Polygon.OffsetUnits;
- raster->offset_scale = ctx->Polygon.OffsetFactor;
- }
-
- if (ctx->Polygon.SmoothFlag)
- raster->poly_smooth = 1;
-
- if (ctx->Polygon.StippleFlag)
- raster->poly_stipple_enable = 1;
-
- /* _NEW_POINT
- */
- raster->point_size = ctx->Point.Size;
-
- if (!ctx->Point.PointSprite && ctx->Point.SmoothFlag)
- raster->point_smooth = 1;
-
- /* _NEW_POINT | _NEW_PROGRAM
- */
- if (ctx->Point.PointSprite) {
- /* origin */
- if ((ctx->Point.SpriteOrigin == GL_UPPER_LEFT) ^
- (st_fb_orientation(ctx->DrawBuffer) == Y_0_BOTTOM))
- raster->sprite_coord_mode = PIPE_SPRITE_COORD_UPPER_LEFT;
- else
- raster->sprite_coord_mode = PIPE_SPRITE_COORD_LOWER_LEFT;
-
- /* Coord replacement flags. If bit 'k' is set that means
- * that we need to replace GENERIC[k] attrib with an automatically
- * computed texture coord.
- */
- for (i = 0; i < MAX_TEXTURE_COORD_UNITS; i++) {
- if (ctx->Point.CoordReplace[i]) {
- raster->sprite_coord_enable |= 1 << i;
- }
- }
- if (fragProg->Base.InputsRead & FRAG_BIT_PNTC) {
- raster->sprite_coord_enable |=
- 1 << (FRAG_ATTRIB_PNTC - FRAG_ATTRIB_TEX0);
- }
-
- raster->point_quad_rasterization = 1;
- }
-
- /* ST_NEW_VERTEX_PROGRAM
- */
- if (vertProg) {
- if (vertProg->Base.Id == 0) {
- if (vertProg->Base.OutputsWritten & BITFIELD64_BIT(VERT_RESULT_PSIZ)) {
- /* generated program which emits point size */
- raster->point_size_per_vertex = TRUE;
- }
- }
- else if (ctx->VertexProgram.PointSizeEnabled) {
- /* user-defined program and GL_VERTEX_PROGRAM_POINT_SIZE set */
- raster->point_size_per_vertex = ctx->VertexProgram.PointSizeEnabled;
- }
- }
- if (!raster->point_size_per_vertex) {
- /* clamp size now */
- raster->point_size = CLAMP(ctx->Point.Size,
- ctx->Point.MinSize,
- ctx->Point.MaxSize);
- }
-
- /* _NEW_LINE
- */
- raster->line_smooth = ctx->Line.SmoothFlag;
- if (ctx->Line.SmoothFlag) {
- raster->line_width = CLAMP(ctx->Line.Width,
- ctx->Const.MinLineWidthAA,
- ctx->Const.MaxLineWidthAA);
- }
- else {
- raster->line_width = CLAMP(ctx->Line.Width,
- ctx->Const.MinLineWidth,
- ctx->Const.MaxLineWidth);
- }
-
- raster->line_stipple_enable = ctx->Line.StippleFlag;
- raster->line_stipple_pattern = ctx->Line.StipplePattern;
- /* GL stipple factor is in [1,256], remap to [0, 255] here */
- raster->line_stipple_factor = ctx->Line.StippleFactor - 1;
-
- /* _NEW_MULTISAMPLE */
- if (ctx->Multisample._Enabled || st->force_msaa)
- raster->multisample = 1;
-
- /* _NEW_SCISSOR */
- if (ctx->Scissor.Enabled)
- raster->scissor = 1;
-
- /* _NEW_FRAG_CLAMP */
- raster->clamp_fragment_color = ctx->Color._ClampFragmentColor;
-
- raster->gl_rasterization_rules = 1;
-
- cso_set_rasterizer(st->cso_context, raster);
-}
-
-const struct st_tracked_state st_update_rasterizer = {
- "st_update_rasterizer", /* name */
- {
- (_NEW_BUFFERS |
- _NEW_LIGHT |
- _NEW_LINE |
- _NEW_MULTISAMPLE |
- _NEW_POINT |
- _NEW_POLYGON |
- _NEW_PROGRAM |
- _NEW_SCISSOR |
- _NEW_FRAG_CLAMP), /* mesa state dependencies*/
- ST_NEW_VERTEX_PROGRAM, /* state tracker dependencies */
- },
- update_raster_state /* update function */
-};
+/**************************************************************************
+ *
+ * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ **************************************************************************/
+
+ /*
+ * Authors:
+ * Keith Whitwell <keith@tungstengraphics.com>
+ */
+
+#include "main/macros.h"
+#include "st_context.h"
+#include "st_atom.h"
+#include "pipe/p_context.h"
+#include "pipe/p_defines.h"
+#include "cso_cache/cso_context.h"
+
+
+static GLuint translate_fill( GLenum mode )
+{
+ switch (mode) {
+ case GL_POINT:
+ return PIPE_POLYGON_MODE_POINT;
+ case GL_LINE:
+ return PIPE_POLYGON_MODE_LINE;
+ case GL_FILL:
+ return PIPE_POLYGON_MODE_FILL;
+ default:
+ assert(0);
+ return 0;
+ }
+}
+
+
+
+static void update_raster_state( struct st_context *st )
+{
+ struct gl_context *ctx = st->ctx;
+ struct pipe_rasterizer_state *raster = &st->state.rasterizer;
+ const struct gl_vertex_program *vertProg = ctx->VertexProgram._Current;
+ const struct gl_fragment_program *fragProg = ctx->FragmentProgram._Current;
+ uint i;
+
+ memset(raster, 0, sizeof(*raster));
+
+ /* _NEW_POLYGON, _NEW_BUFFERS
+ */
+ {
+ raster->front_ccw = (ctx->Polygon.FrontFace == GL_CCW);
+
+ /*
+ * Gallium's surfaces are Y=0=TOP orientation. OpenGL is the
+ * opposite. Window system surfaces are Y=0=TOP. Mesa's FBOs
+ * must match OpenGL conventions so FBOs use Y=0=BOTTOM. In that
+ * case, we must invert Y and flip the notion of front vs. back.
+ */
+ if (st_fb_orientation(ctx->DrawBuffer) == Y_0_BOTTOM) {
+ /* Drawing to an FBO. The viewport will be inverted. */
+ raster->front_ccw ^= 1;
+ }
+ }
+
+ /* _NEW_LIGHT
+ */
+ if (ctx->Light.ShadeModel == GL_FLAT)
+ raster->flatshade = 1;
+
+ if (ctx->Light.ProvokingVertex == GL_FIRST_VERTEX_CONVENTION_EXT)
+ raster->flatshade_first = 1;
+
+ /* _NEW_LIGHT | _NEW_PROGRAM
+ *
+ * Back-face colors can come from traditional lighting (when
+ * GL_LIGHT_MODEL_TWO_SIDE is set) or from vertex programs/shaders (when
+ * GL_VERTEX_PROGRAM_TWO_SIDE is set). Note the logic here.
+ */
+ if (ctx->VertexProgram._Current) {
+ if (ctx->VertexProgram._Enabled ||
+ (ctx->Shader.CurrentVertexProgram &&
+ ctx->Shader.CurrentVertexProgram->LinkStatus)) {
+ /* user-defined vertex program or shader */
+ raster->light_twoside = ctx->VertexProgram.TwoSideEnabled;
+ }
+ else {
+ /* TNL-generated program */
+ raster->light_twoside = ctx->Light.Enabled && ctx->Light.Model.TwoSide;
+ }
+ }
+ else if (ctx->Light.Enabled && ctx->Light.Model.TwoSide) {
+ raster->light_twoside = 1;
+ }
+
+ raster->clamp_vertex_color = ctx->Light._ClampVertexColor;
+
+ /* _NEW_POLYGON
+ */
+ if (ctx->Polygon.CullFlag) {
+ switch (ctx->Polygon.CullFaceMode) {
+ case GL_FRONT:
+ raster->cull_face = PIPE_FACE_FRONT;
+ break;
+ case GL_BACK:
+ raster->cull_face = PIPE_FACE_BACK;
+ break;
+ case GL_FRONT_AND_BACK:
+ raster->cull_face = PIPE_FACE_FRONT_AND_BACK;
+ break;
+ }
+ }
+ else {
+ raster->cull_face = PIPE_FACE_NONE;
+ }
+
+ /* _NEW_POLYGON
+ */
+ {
+ raster->fill_front = translate_fill( ctx->Polygon.FrontMode );
+ raster->fill_back = translate_fill( ctx->Polygon.BackMode );
+
+ /* Simplify when culling is active:
+ */
+ if (raster->cull_face & PIPE_FACE_FRONT) {
+ raster->fill_front = raster->fill_back;
+ }
+
+ if (raster->cull_face & PIPE_FACE_BACK) {
+ raster->fill_back = raster->fill_front;
+ }
+ }
+
+ /* _NEW_POLYGON
+ */
+ if (ctx->Polygon.OffsetUnits != 0.0 ||
+ ctx->Polygon.OffsetFactor != 0.0) {
+ raster->offset_point = ctx->Polygon.OffsetPoint;
+ raster->offset_line = ctx->Polygon.OffsetLine;
+ raster->offset_tri = ctx->Polygon.OffsetFill;
+ }
+
+ if (ctx->Polygon.OffsetPoint ||
+ ctx->Polygon.OffsetLine ||
+ ctx->Polygon.OffsetFill) {
+ raster->offset_units = ctx->Polygon.OffsetUnits;
+ raster->offset_scale = ctx->Polygon.OffsetFactor;
+ }
+
+ if (ctx->Polygon.SmoothFlag)
+ raster->poly_smooth = 1;
+
+ if (ctx->Polygon.StippleFlag)
+ raster->poly_stipple_enable = 1;
+
+ /* _NEW_POINT
+ */
+ raster->point_size = ctx->Point.Size;
+
+ if (!ctx->Point.PointSprite && ctx->Point.SmoothFlag)
+ raster->point_smooth = 1;
+
+ /* _NEW_POINT | _NEW_PROGRAM
+ */
+ if (ctx->Point.PointSprite) {
+ /* origin */
+ if ((ctx->Point.SpriteOrigin == GL_UPPER_LEFT) ^
+ (st_fb_orientation(ctx->DrawBuffer) == Y_0_BOTTOM))
+ raster->sprite_coord_mode = PIPE_SPRITE_COORD_UPPER_LEFT;
+ else
+ raster->sprite_coord_mode = PIPE_SPRITE_COORD_LOWER_LEFT;
+
+ /* Coord replacement flags. If bit 'k' is set that means
+ * that we need to replace GENERIC[k] attrib with an automatically
+ * computed texture coord.
+ */
+ for (i = 0; i < MAX_TEXTURE_COORD_UNITS; i++) {
+ if (ctx->Point.CoordReplace[i]) {
+ raster->sprite_coord_enable |= 1 << i;
+ }
+ }
+ if (fragProg->Base.InputsRead & FRAG_BIT_PNTC) {
+ raster->sprite_coord_enable |=
+ 1 << (FRAG_ATTRIB_PNTC - FRAG_ATTRIB_TEX0);
+ }
+
+ raster->point_quad_rasterization = 1;
+ }
+
+ /* ST_NEW_VERTEX_PROGRAM
+ */
+ if (vertProg) {
+ if (vertProg->Base.Id == 0) {
+ if (vertProg->Base.OutputsWritten & BITFIELD64_BIT(VERT_RESULT_PSIZ)) {
+ /* generated program which emits point size */
+ raster->point_size_per_vertex = TRUE;
+ }
+ }
+ else if (ctx->VertexProgram.PointSizeEnabled) {
+ /* user-defined program and GL_VERTEX_PROGRAM_POINT_SIZE set */
+ raster->point_size_per_vertex = ctx->VertexProgram.PointSizeEnabled;
+ }
+ }
+ if (!raster->point_size_per_vertex) {
+ /* clamp size now */
+ raster->point_size = CLAMP(ctx->Point.Size,
+ ctx->Point.MinSize,
+ ctx->Point.MaxSize);
+ }
+
+ /* _NEW_LINE
+ */
+ raster->line_smooth = ctx->Line.SmoothFlag;
+ if (ctx->Line.SmoothFlag) {
+ raster->line_width = CLAMP(ctx->Line.Width,
+ ctx->Const.MinLineWidthAA,
+ ctx->Const.MaxLineWidthAA);
+ }
+ else {
+ raster->line_width = CLAMP(ctx->Line.Width,
+ ctx->Const.MinLineWidth,
+ ctx->Const.MaxLineWidth);
+ }
+
+ raster->line_stipple_enable = ctx->Line.StippleFlag;
+ raster->line_stipple_pattern = ctx->Line.StipplePattern;
+ /* GL stipple factor is in [1,256], remap to [0, 255] here */
+ raster->line_stipple_factor = ctx->Line.StippleFactor - 1;
+
+ /* _NEW_MULTISAMPLE */
+ if (ctx->Multisample._Enabled || st->force_msaa)
+ raster->multisample = 1;
+
+ /* _NEW_SCISSOR */
+ if (ctx->Scissor.Enabled)
+ raster->scissor = 1;
+
+ /* _NEW_FRAG_CLAMP */
+ raster->clamp_fragment_color = ctx->Color._ClampFragmentColor;
+
+ raster->gl_rasterization_rules = 1;
+
+ cso_set_rasterizer(st->cso_context, raster);
+}
+
+const struct st_tracked_state st_update_rasterizer = {
+ "st_update_rasterizer", /* name */
+ {
+ (_NEW_BUFFERS |
+ _NEW_LIGHT |
+ _NEW_LINE |
+ _NEW_MULTISAMPLE |
+ _NEW_POINT |
+ _NEW_POLYGON |
+ _NEW_PROGRAM |
+ _NEW_SCISSOR |
+ _NEW_FRAG_CLAMP), /* mesa state dependencies*/
+ ST_NEW_VERTEX_PROGRAM, /* state tracker dependencies */
+ },
+ update_raster_state /* update function */
+};
diff --git a/mesalib/src/mesa/state_tracker/st_cb_blit.c b/mesalib/src/mesa/state_tracker/st_cb_blit.c
index 25c95c7b9..4c3d561a4 100644
--- a/mesalib/src/mesa/state_tracker/st_cb_blit.c
+++ b/mesalib/src/mesa/state_tracker/st_cb_blit.c
@@ -1,211 +1,211 @@
-/**************************************************************************
- *
- * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas.
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sub license, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice (including the
- * next paragraph) shall be included in all copies or substantial portions
- * of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
- * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
- * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- **************************************************************************/
-
- /*
- * Authors:
- * Brian Paul
- */
-
-#include "main/imports.h"
-#include "main/image.h"
-#include "main/macros.h"
-#include "main/mfeatures.h"
-
-#include "st_context.h"
-#include "st_texture.h"
-#include "st_cb_blit.h"
-#include "st_cb_fbo.h"
-#include "st_atom.h"
-
-#include "util/u_blit.h"
-
-
-void
-st_init_blit(struct st_context *st)
-{
- st->blit = util_create_blit(st->pipe, st->cso_context);
-}
-
-
-void
-st_destroy_blit(struct st_context *st)
-{
- util_destroy_blit(st->blit);
- st->blit = NULL;
-}
-
-
-#if FEATURE_EXT_framebuffer_blit
-
-static void
-st_BlitFramebuffer(struct gl_context *ctx,
- GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1,
- GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1,
- GLbitfield mask, GLenum filter)
-{
- const GLbitfield depthStencil = (GL_DEPTH_BUFFER_BIT |
- GL_STENCIL_BUFFER_BIT);
- struct st_context *st = st_context(ctx);
- const uint pFilter = ((filter == GL_NEAREST)
- ? PIPE_TEX_MIPFILTER_NEAREST
- : PIPE_TEX_MIPFILTER_LINEAR);
- struct gl_framebuffer *readFB = ctx->ReadBuffer;
- struct gl_framebuffer *drawFB = ctx->DrawBuffer;
-
- st_validate_state(st);
-
- if (!_mesa_clip_blit(ctx, &srcX0, &srcY0, &srcX1, &srcY1,
- &dstX0, &dstY0, &dstX1, &dstY1)) {
- return; /* nothing to draw/blit */
- }
-
- if (st_fb_orientation(drawFB) == Y_0_TOP) {
- /* invert Y for dest */
- dstY0 = drawFB->Height - dstY0;
- dstY1 = drawFB->Height - dstY1;
- }
-
- if (st_fb_orientation(readFB) == Y_0_TOP) {
- /* invert Y for src */
- srcY0 = readFB->Height - srcY0;
- srcY1 = readFB->Height - srcY1;
- }
-
- if (srcY0 > srcY1 && dstY0 > dstY1) {
- /* Both src and dst are upside down. Swap Y to make it
- * right-side up to increase odds of using a fast path.
- * Recall that all Gallium raster coords have Y=0=top.
- */
- GLint tmp;
- tmp = srcY0;
- srcY0 = srcY1;
- srcY1 = tmp;
- tmp = dstY0;
- dstY0 = dstY1;
- dstY1 = tmp;
- }
-
- if (mask & GL_COLOR_BUFFER_BIT) {
- struct gl_renderbuffer_attachment *srcAtt =
- &readFB->Attachment[readFB->_ColorReadBufferIndex];
-
- if(srcAtt->Type == GL_TEXTURE) {
- struct st_texture_object *srcObj =
- st_texture_object(srcAtt->Texture);
- struct st_renderbuffer *dstRb =
- st_renderbuffer(drawFB->_ColorDrawBuffers[0]);
- struct pipe_surface *dstSurf = dstRb->surface;
-
- if (!srcObj->pt)
- return;
-
- util_blit_pixels(st->blit, srcObj->pt, srcAtt->TextureLevel,
- srcX0, srcY0, srcX1, srcY1,
- srcAtt->Zoffset + srcAtt->CubeMapFace,
- dstSurf, dstX0, dstY0, dstX1, dstY1,
- 0.0, pFilter);
- }
- else {
- struct st_renderbuffer *srcRb =
- st_renderbuffer(readFB->_ColorReadBuffer);
- struct st_renderbuffer *dstRb =
- st_renderbuffer(drawFB->_ColorDrawBuffers[0]);
- struct pipe_surface *srcSurf = srcRb->surface;
- struct pipe_surface *dstSurf = dstRb->surface;
-
- util_blit_pixels(st->blit,
- srcRb->texture, srcSurf->u.tex.level,
- srcX0, srcY0, srcX1, srcY1,
- srcSurf->u.tex.first_layer,
- dstSurf, dstX0, dstY0, dstX1, dstY1,
- 0.0, pFilter);
- }
- }
-
- if (mask & depthStencil) {
- /* depth and/or stencil blit */
-
- /* get src/dst depth surfaces */
- struct gl_renderbuffer_attachment *srcDepth =
- &readFB->Attachment[BUFFER_DEPTH];
- struct gl_renderbuffer_attachment *dstDepth =
- &drawFB->Attachment[BUFFER_DEPTH];
- struct gl_renderbuffer_attachment *srcStencil =
- &readFB->Attachment[BUFFER_STENCIL];
- struct gl_renderbuffer_attachment *dstStencil =
- &drawFB->Attachment[BUFFER_STENCIL];
-
- struct st_renderbuffer *srcDepthRb =
- st_renderbuffer(readFB->Attachment[BUFFER_DEPTH].Renderbuffer);
- struct st_renderbuffer *dstDepthRb =
- st_renderbuffer(drawFB->Attachment[BUFFER_DEPTH].Renderbuffer);
- struct pipe_surface *dstDepthSurf =
- dstDepthRb ? dstDepthRb->surface : NULL;
-
- if ((mask & depthStencil) == depthStencil &&
- st_is_depth_stencil_combined(srcDepth, srcStencil) &&
- st_is_depth_stencil_combined(dstDepth, dstStencil)) {
-
- /* Blitting depth and stencil values between combined
- * depth/stencil buffers. This is the ideal case for such buffers.
- */
- util_blit_pixels(st->blit,
- srcDepthRb->texture,
- srcDepthRb->surface->u.tex.level,
- srcX0, srcY0, srcX1, srcY1,
- srcDepthRb->surface->u.tex.first_layer,
- dstDepthSurf, dstX0, dstY0, dstX1, dstY1,
- 0.0, pFilter);
- }
- else {
- /* blitting depth and stencil separately */
-
- if (mask & GL_DEPTH_BUFFER_BIT) {
- util_blit_pixels(st->blit, srcDepthRb->texture,
- srcDepthRb->surface->u.tex.level,
- srcX0, srcY0, srcX1, srcY1,
- srcDepthRb->surface->u.tex.first_layer,
- dstDepthSurf, dstX0, dstY0, dstX1, dstY1,
- 0.0, pFilter);
- }
-
- if (mask & GL_STENCIL_BUFFER_BIT) {
- /* blit stencil only */
- _mesa_problem(ctx, "st_BlitFramebuffer(STENCIL) not completed");
- }
- }
- }
-}
-
-
-void
-st_init_blit_functions(struct dd_function_table *functions)
-{
- functions->BlitFramebuffer = st_BlitFramebuffer;
-}
-
-#endif /* FEATURE_EXT_framebuffer_blit */
+/**************************************************************************
+ *
+ * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ **************************************************************************/
+
+ /*
+ * Authors:
+ * Brian Paul
+ */
+
+#include "main/imports.h"
+#include "main/image.h"
+#include "main/macros.h"
+#include "main/mfeatures.h"
+
+#include "st_context.h"
+#include "st_texture.h"
+#include "st_cb_blit.h"
+#include "st_cb_fbo.h"
+#include "st_atom.h"
+
+#include "util/u_blit.h"
+
+
+void
+st_init_blit(struct st_context *st)
+{
+ st->blit = util_create_blit(st->pipe, st->cso_context);
+}
+
+
+void
+st_destroy_blit(struct st_context *st)
+{
+ util_destroy_blit(st->blit);
+ st->blit = NULL;
+}
+
+
+#if FEATURE_EXT_framebuffer_blit
+
+static void
+st_BlitFramebuffer(struct gl_context *ctx,
+ GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1,
+ GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1,
+ GLbitfield mask, GLenum filter)
+{
+ const GLbitfield depthStencil = (GL_DEPTH_BUFFER_BIT |
+ GL_STENCIL_BUFFER_BIT);
+ struct st_context *st = st_context(ctx);
+ const uint pFilter = ((filter == GL_NEAREST)
+ ? PIPE_TEX_MIPFILTER_NEAREST
+ : PIPE_TEX_MIPFILTER_LINEAR);
+ struct gl_framebuffer *readFB = ctx->ReadBuffer;
+ struct gl_framebuffer *drawFB = ctx->DrawBuffer;
+
+ st_validate_state(st);
+
+ if (!_mesa_clip_blit(ctx, &srcX0, &srcY0, &srcX1, &srcY1,
+ &dstX0, &dstY0, &dstX1, &dstY1)) {
+ return; /* nothing to draw/blit */
+ }
+
+ if (st_fb_orientation(drawFB) == Y_0_TOP) {
+ /* invert Y for dest */
+ dstY0 = drawFB->Height - dstY0;
+ dstY1 = drawFB->Height - dstY1;
+ }
+
+ if (st_fb_orientation(readFB) == Y_0_TOP) {
+ /* invert Y for src */
+ srcY0 = readFB->Height - srcY0;
+ srcY1 = readFB->Height - srcY1;
+ }
+
+ if (srcY0 > srcY1 && dstY0 > dstY1) {
+ /* Both src and dst are upside down. Swap Y to make it
+ * right-side up to increase odds of using a fast path.
+ * Recall that all Gallium raster coords have Y=0=top.
+ */
+ GLint tmp;
+ tmp = srcY0;
+ srcY0 = srcY1;
+ srcY1 = tmp;
+ tmp = dstY0;
+ dstY0 = dstY1;
+ dstY1 = tmp;
+ }
+
+ if (mask & GL_COLOR_BUFFER_BIT) {
+ struct gl_renderbuffer_attachment *srcAtt =
+ &readFB->Attachment[readFB->_ColorReadBufferIndex];
+
+ if(srcAtt->Type == GL_TEXTURE) {
+ struct st_texture_object *srcObj =
+ st_texture_object(srcAtt->Texture);
+ struct st_renderbuffer *dstRb =
+ st_renderbuffer(drawFB->_ColorDrawBuffers[0]);
+ struct pipe_surface *dstSurf = dstRb->surface;
+
+ if (!srcObj->pt)
+ return;
+
+ util_blit_pixels(st->blit, srcObj->pt, srcAtt->TextureLevel,
+ srcX0, srcY0, srcX1, srcY1,
+ srcAtt->Zoffset + srcAtt->CubeMapFace,
+ dstSurf, dstX0, dstY0, dstX1, dstY1,
+ 0.0, pFilter);
+ }
+ else {
+ struct st_renderbuffer *srcRb =
+ st_renderbuffer(readFB->_ColorReadBuffer);
+ struct st_renderbuffer *dstRb =
+ st_renderbuffer(drawFB->_ColorDrawBuffers[0]);
+ struct pipe_surface *srcSurf = srcRb->surface;
+ struct pipe_surface *dstSurf = dstRb->surface;
+
+ util_blit_pixels(st->blit,
+ srcRb->texture, srcSurf->u.tex.level,
+ srcX0, srcY0, srcX1, srcY1,
+ srcSurf->u.tex.first_layer,
+ dstSurf, dstX0, dstY0, dstX1, dstY1,
+ 0.0, pFilter);
+ }
+ }
+
+ if (mask & depthStencil) {
+ /* depth and/or stencil blit */
+
+ /* get src/dst depth surfaces */
+ struct gl_renderbuffer_attachment *srcDepth =
+ &readFB->Attachment[BUFFER_DEPTH];
+ struct gl_renderbuffer_attachment *dstDepth =
+ &drawFB->Attachment[BUFFER_DEPTH];
+ struct gl_renderbuffer_attachment *srcStencil =
+ &readFB->Attachment[BUFFER_STENCIL];
+ struct gl_renderbuffer_attachment *dstStencil =
+ &drawFB->Attachment[BUFFER_STENCIL];
+
+ struct st_renderbuffer *srcDepthRb =
+ st_renderbuffer(readFB->Attachment[BUFFER_DEPTH].Renderbuffer);
+ struct st_renderbuffer *dstDepthRb =
+ st_renderbuffer(drawFB->Attachment[BUFFER_DEPTH].Renderbuffer);
+ struct pipe_surface *dstDepthSurf =
+ dstDepthRb ? dstDepthRb->surface : NULL;
+
+ if ((mask & depthStencil) == depthStencil &&
+ st_is_depth_stencil_combined(srcDepth, srcStencil) &&
+ st_is_depth_stencil_combined(dstDepth, dstStencil)) {
+
+ /* Blitting depth and stencil values between combined
+ * depth/stencil buffers. This is the ideal case for such buffers.
+ */
+ util_blit_pixels(st->blit,
+ srcDepthRb->texture,
+ srcDepthRb->surface->u.tex.level,
+ srcX0, srcY0, srcX1, srcY1,
+ srcDepthRb->surface->u.tex.first_layer,
+ dstDepthSurf, dstX0, dstY0, dstX1, dstY1,
+ 0.0, pFilter);
+ }
+ else {
+ /* blitting depth and stencil separately */
+
+ if (mask & GL_DEPTH_BUFFER_BIT) {
+ util_blit_pixels(st->blit, srcDepthRb->texture,
+ srcDepthRb->surface->u.tex.level,
+ srcX0, srcY0, srcX1, srcY1,
+ srcDepthRb->surface->u.tex.first_layer,
+ dstDepthSurf, dstX0, dstY0, dstX1, dstY1,
+ 0.0, pFilter);
+ }
+
+ if (mask & GL_STENCIL_BUFFER_BIT) {
+ /* blit stencil only */
+ _mesa_problem(ctx, "st_BlitFramebuffer(STENCIL) not completed");
+ }
+ }
+ }
+}
+
+
+void
+st_init_blit_functions(struct dd_function_table *functions)
+{
+ functions->BlitFramebuffer = st_BlitFramebuffer;
+}
+
+#endif /* FEATURE_EXT_framebuffer_blit */
diff --git a/mesalib/src/mesa/state_tracker/st_cb_bufferobjects.c b/mesalib/src/mesa/state_tracker/st_cb_bufferobjects.c
index 1e489b29d..06573d9ad 100644
--- a/mesalib/src/mesa/state_tracker/st_cb_bufferobjects.c
+++ b/mesalib/src/mesa/state_tracker/st_cb_bufferobjects.c
@@ -1,457 +1,457 @@
-/**************************************************************************
- *
- * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas.
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sub license, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice (including the
- * next paragraph) shall be included in all copies or substantial portions
- * of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
- * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
- * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- **************************************************************************/
-
-
-/**
- * Functions for pixel buffer objects and vertex/element buffer objects.
- */
-
-
-#include "main/imports.h"
-#include "main/mtypes.h"
-#include "main/arrayobj.h"
-#include "main/bufferobj.h"
-
-#include "st_context.h"
-#include "st_cb_bufferobjects.h"
-
-#include "pipe/p_context.h"
-#include "pipe/p_defines.h"
-#include "util/u_inlines.h"
-
-
-/**
- * There is some duplication between mesa's bufferobjects and our
- * bufmgr buffers. Both have an integer handle and a hashtable to
- * lookup an opaque structure. It would be nice if the handles and
- * internal structure where somehow shared.
- */
-static struct gl_buffer_object *
-st_bufferobj_alloc(struct gl_context *ctx, GLuint name, GLenum target)
-{
- struct st_buffer_object *st_obj = ST_CALLOC_STRUCT(st_buffer_object);
-
- if (!st_obj)
- return NULL;
-
- _mesa_initialize_buffer_object(&st_obj->Base, name, target);
-
- return &st_obj->Base;
-}
-
-
-
-/**
- * Deallocate/free a vertex/pixel buffer object.
- * Called via glDeleteBuffersARB().
- */
-static void
-st_bufferobj_free(struct gl_context *ctx, struct gl_buffer_object *obj)
-{
- struct st_buffer_object *st_obj = st_buffer_object(obj);
-
- assert(obj->RefCount == 0);
- assert(st_obj->transfer == NULL);
-
- if (st_obj->buffer)
- pipe_resource_reference(&st_obj->buffer, NULL);
-
- free(st_obj);
-}
-
-
-
-/**
- * Replace data in a subrange of buffer object. If the data range
- * specified by size + offset extends beyond the end of the buffer or
- * if data is NULL, no copy is performed.
- * Called via glBufferSubDataARB().
- */
-static void
-st_bufferobj_subdata(struct gl_context *ctx,
- GLenum target,
- GLintptrARB offset,
- GLsizeiptrARB size,
- const GLvoid * data, struct gl_buffer_object *obj)
-{
- struct st_buffer_object *st_obj = st_buffer_object(obj);
-
- /* we may be called from VBO code, so double-check params here */
- ASSERT(offset >= 0);
- ASSERT(size >= 0);
- ASSERT(offset + size <= obj->Size);
-
- if (!size)
- return;
-
- /*
- * According to ARB_vertex_buffer_object specification, if data is null,
- * then the contents of the buffer object's data store is undefined. We just
- * ignore, and leave it unchanged.
- */
- if (!data)
- return;
-
- /* Now that transfers are per-context, we don't have to figure out
- * flushing here. Usually drivers won't need to flush in this case
- * even if the buffer is currently referenced by hardware - they
- * just queue the upload as dma rather than mapping the underlying
- * buffer directly.
- */
- pipe_buffer_write(st_context(ctx)->pipe,
- st_obj->buffer,
- offset, size, data);
-}
-
-
-/**
- * Called via glGetBufferSubDataARB().
- */
-static void
-st_bufferobj_get_subdata(struct gl_context *ctx,
- GLenum target,
- GLintptrARB offset,
- GLsizeiptrARB size,
- GLvoid * data, struct gl_buffer_object *obj)
-{
- struct st_buffer_object *st_obj = st_buffer_object(obj);
-
- /* we may be called from VBO code, so double-check params here */
- ASSERT(offset >= 0);
- ASSERT(size >= 0);
- ASSERT(offset + size <= obj->Size);
-
- if (!size)
- return;
-
- pipe_buffer_read(st_context(ctx)->pipe, st_obj->buffer,
- offset, size, data);
-}
-
-
-/**
- * Allocate space for and store data in a buffer object. Any data that was
- * previously stored in the buffer object is lost. If data is NULL,
- * memory will be allocated, but no copy will occur.
- * Called via ctx->Driver.BufferData().
- * \return GL_TRUE for success, GL_FALSE if out of memory
- */
-static GLboolean
-st_bufferobj_data(struct gl_context *ctx,
- GLenum target,
- GLsizeiptrARB size,
- const GLvoid * data,
- GLenum usage,
- struct gl_buffer_object *obj)
-{
- struct st_context *st = st_context(ctx);
- struct pipe_context *pipe = st->pipe;
- struct st_buffer_object *st_obj = st_buffer_object(obj);
- unsigned bind, pipe_usage;
-
- st_obj->Base.Size = size;
- st_obj->Base.Usage = usage;
-
- switch(target) {
- case GL_PIXEL_PACK_BUFFER_ARB:
- case GL_PIXEL_UNPACK_BUFFER_ARB:
- bind = PIPE_BIND_RENDER_TARGET | PIPE_BIND_SAMPLER_VIEW;
- break;
- case GL_ARRAY_BUFFER_ARB:
- bind = PIPE_BIND_VERTEX_BUFFER;
- break;
- case GL_ELEMENT_ARRAY_BUFFER_ARB:
- bind = PIPE_BIND_INDEX_BUFFER;
- break;
- default:
- bind = 0;
- }
-
- switch (usage) {
- case GL_STATIC_DRAW:
- case GL_STATIC_READ:
- case GL_STATIC_COPY:
- pipe_usage = PIPE_USAGE_STATIC;
- break;
- case GL_DYNAMIC_DRAW:
- case GL_DYNAMIC_READ:
- case GL_DYNAMIC_COPY:
- pipe_usage = PIPE_USAGE_DYNAMIC;
- break;
- case GL_STREAM_DRAW:
- case GL_STREAM_READ:
- case GL_STREAM_COPY:
- pipe_usage = PIPE_USAGE_STREAM;
- break;
- default:
- pipe_usage = PIPE_USAGE_DEFAULT;
- }
-
- pipe_resource_reference( &st_obj->buffer, NULL );
-
- if (size != 0) {
- st_obj->buffer = pipe_buffer_create(pipe->screen, bind,
- pipe_usage, size);
-
- if (!st_obj->buffer) {
- return GL_FALSE;
- }
-
- if (data)
- pipe_buffer_write(st_context(ctx)->pipe, st_obj->buffer, 0,
- size, data);
- return GL_TRUE;
- }
-
- return GL_TRUE;
-}
-
-
-/**
- * Dummy data whose's pointer is used for zero size buffers or ranges.
- */
-static long st_bufferobj_zero_length = 0;
-
-
-
-/**
- * Called via glMapBufferARB().
- */
-static void *
-st_bufferobj_map(struct gl_context *ctx, GLenum target, GLenum access,
- struct gl_buffer_object *obj)
-{
- struct st_buffer_object *st_obj = st_buffer_object(obj);
- uint flags;
-
- switch (access) {
- case GL_WRITE_ONLY:
- flags = PIPE_TRANSFER_WRITE;
- break;
- case GL_READ_ONLY:
- flags = PIPE_TRANSFER_READ;
- break;
- case GL_READ_WRITE:
- default:
- flags = PIPE_TRANSFER_READ_WRITE;
- break;
- }
-
- /* Handle zero-size buffers here rather than in drivers */
- if (obj->Size == 0) {
- obj->Pointer = &st_bufferobj_zero_length;
- }
- else {
- obj->Pointer = pipe_buffer_map(st_context(ctx)->pipe,
- st_obj->buffer,
- flags,
- &st_obj->transfer);
- }
-
- if (obj->Pointer) {
- obj->Offset = 0;
- obj->Length = obj->Size;
- }
- return obj->Pointer;
-}
-
-
-/**
- * Called via glMapBufferRange().
- */
-static void *
-st_bufferobj_map_range(struct gl_context *ctx, GLenum target,
- GLintptr offset, GLsizeiptr length, GLbitfield access,
- struct gl_buffer_object *obj)
-{
- struct pipe_context *pipe = st_context(ctx)->pipe;
- struct st_buffer_object *st_obj = st_buffer_object(obj);
- enum pipe_transfer_usage flags = 0x0;
-
- if (access & GL_MAP_WRITE_BIT)
- flags |= PIPE_TRANSFER_WRITE;
-
- if (access & GL_MAP_READ_BIT)
- flags |= PIPE_TRANSFER_READ;
-
- if (access & GL_MAP_FLUSH_EXPLICIT_BIT)
- flags |= PIPE_TRANSFER_FLUSH_EXPLICIT;
-
- if (access & GL_MAP_INVALIDATE_BUFFER_BIT) {
- flags |= PIPE_TRANSFER_DISCARD_WHOLE_RESOURCE;
- }
- else if (access & GL_MAP_INVALIDATE_RANGE_BIT) {
- if (offset == 0 && length == obj->Size)
- flags |= PIPE_TRANSFER_DISCARD_WHOLE_RESOURCE;
- else
- flags |= PIPE_TRANSFER_DISCARD_RANGE;
- }
-
- if (access & GL_MAP_UNSYNCHRONIZED_BIT)
- flags |= PIPE_TRANSFER_UNSYNCHRONIZED;
-
- /* ... other flags ...
- */
-
- if (access & MESA_MAP_NOWAIT_BIT)
- flags |= PIPE_TRANSFER_DONTBLOCK;
-
- assert(offset >= 0);
- assert(length >= 0);
- assert(offset < obj->Size);
- assert(offset + length <= obj->Size);
-
- /*
- * We go out of way here to hide the degenerate yet valid case of zero
- * length range from the pipe driver.
- */
- if (!length) {
- obj->Pointer = &st_bufferobj_zero_length;
- }
- else {
- obj->Pointer = pipe_buffer_map_range(pipe,
- st_obj->buffer,
- offset, length,
- flags,
- &st_obj->transfer);
- if (obj->Pointer) {
- obj->Pointer = (ubyte *) obj->Pointer + offset;
- }
- }
-
- if (obj->Pointer) {
- obj->Offset = offset;
- obj->Length = length;
- obj->AccessFlags = access;
- }
-
- return obj->Pointer;
-}
-
-
-static void
-st_bufferobj_flush_mapped_range(struct gl_context *ctx, GLenum target,
- GLintptr offset, GLsizeiptr length,
- struct gl_buffer_object *obj)
-{
- struct pipe_context *pipe = st_context(ctx)->pipe;
- struct st_buffer_object *st_obj = st_buffer_object(obj);
-
- /* Subrange is relative to mapped range */
- assert(offset >= 0);
- assert(length >= 0);
- assert(offset + length <= obj->Length);
- assert(obj->Pointer);
-
- if (!length)
- return;
-
- pipe_buffer_flush_mapped_range(pipe, st_obj->transfer,
- obj->Offset + offset, length);
-}
-
-
-/**
- * Called via glUnmapBufferARB().
- */
-static GLboolean
-st_bufferobj_unmap(struct gl_context *ctx, GLenum target, struct gl_buffer_object *obj)
-{
- struct pipe_context *pipe = st_context(ctx)->pipe;
- struct st_buffer_object *st_obj = st_buffer_object(obj);
-
- if (obj->Length)
- pipe_buffer_unmap(pipe, st_obj->transfer);
-
- st_obj->transfer = NULL;
- obj->Pointer = NULL;
- obj->Offset = 0;
- obj->Length = 0;
- return GL_TRUE;
-}
-
-
-/**
- * Called via glCopyBufferSubData().
- */
-static void
-st_copy_buffer_subdata(struct gl_context *ctx,
- struct gl_buffer_object *src,
- struct gl_buffer_object *dst,
- GLintptr readOffset, GLintptr writeOffset,
- GLsizeiptr size)
-{
- struct pipe_context *pipe = st_context(ctx)->pipe;
- struct st_buffer_object *srcObj = st_buffer_object(src);
- struct st_buffer_object *dstObj = st_buffer_object(dst);
- struct pipe_box box;
-
- if(!size)
- return;
-
- /* buffer should not already be mapped */
- assert(!src->Pointer);
- assert(!dst->Pointer);
-
- u_box_1d(readOffset, size, &box);
-
- pipe->resource_copy_region(pipe, dstObj->buffer, 0, writeOffset, 0, 0,
- srcObj->buffer, 0, &box);
-}
-
-
-/* TODO: if buffer wasn't created with appropriate usage flags, need
- * to recreate it now and copy contents -- or possibly create a
- * gallium entrypoint to extend the usage flags and let the driver
- * decide if a copy is necessary.
- */
-void
-st_bufferobj_validate_usage(struct st_context *st,
- struct st_buffer_object *obj,
- unsigned usage)
-{
-}
-
-
-void
-st_init_bufferobject_functions(struct dd_function_table *functions)
-{
- functions->NewBufferObject = st_bufferobj_alloc;
- functions->DeleteBuffer = st_bufferobj_free;
- functions->BufferData = st_bufferobj_data;
- functions->BufferSubData = st_bufferobj_subdata;
- functions->GetBufferSubData = st_bufferobj_get_subdata;
- functions->MapBuffer = st_bufferobj_map;
- functions->MapBufferRange = st_bufferobj_map_range;
- functions->FlushMappedBufferRange = st_bufferobj_flush_mapped_range;
- functions->UnmapBuffer = st_bufferobj_unmap;
- functions->CopyBufferSubData = st_copy_buffer_subdata;
-
- /* For GL_APPLE_vertex_array_object */
- functions->NewArrayObject = _mesa_new_array_object;
- functions->DeleteArrayObject = _mesa_delete_array_object;
-}
+/**************************************************************************
+ *
+ * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ **************************************************************************/
+
+
+/**
+ * Functions for pixel buffer objects and vertex/element buffer objects.
+ */
+
+
+#include "main/imports.h"
+#include "main/mtypes.h"
+#include "main/arrayobj.h"
+#include "main/bufferobj.h"
+
+#include "st_context.h"
+#include "st_cb_bufferobjects.h"
+
+#include "pipe/p_context.h"
+#include "pipe/p_defines.h"
+#include "util/u_inlines.h"
+
+
+/**
+ * There is some duplication between mesa's bufferobjects and our
+ * bufmgr buffers. Both have an integer handle and a hashtable to
+ * lookup an opaque structure. It would be nice if the handles and
+ * internal structure where somehow shared.
+ */
+static struct gl_buffer_object *
+st_bufferobj_alloc(struct gl_context *ctx, GLuint name, GLenum target)
+{
+ struct st_buffer_object *st_obj = ST_CALLOC_STRUCT(st_buffer_object);
+
+ if (!st_obj)
+ return NULL;
+
+ _mesa_initialize_buffer_object(&st_obj->Base, name, target);
+
+ return &st_obj->Base;
+}
+
+
+
+/**
+ * Deallocate/free a vertex/pixel buffer object.
+ * Called via glDeleteBuffersARB().
+ */
+static void
+st_bufferobj_free(struct gl_context *ctx, struct gl_buffer_object *obj)
+{
+ struct st_buffer_object *st_obj = st_buffer_object(obj);
+
+ assert(obj->RefCount == 0);
+ assert(st_obj->transfer == NULL);
+
+ if (st_obj->buffer)
+ pipe_resource_reference(&st_obj->buffer, NULL);
+
+ free(st_obj);
+}
+
+
+
+/**
+ * Replace data in a subrange of buffer object. If the data range
+ * specified by size + offset extends beyond the end of the buffer or
+ * if data is NULL, no copy is performed.
+ * Called via glBufferSubDataARB().
+ */
+static void
+st_bufferobj_subdata(struct gl_context *ctx,
+ GLenum target,
+ GLintptrARB offset,
+ GLsizeiptrARB size,
+ const GLvoid * data, struct gl_buffer_object *obj)
+{
+ struct st_buffer_object *st_obj = st_buffer_object(obj);
+
+ /* we may be called from VBO code, so double-check params here */
+ ASSERT(offset >= 0);
+ ASSERT(size >= 0);
+ ASSERT(offset + size <= obj->Size);
+
+ if (!size)
+ return;
+
+ /*
+ * According to ARB_vertex_buffer_object specification, if data is null,
+ * then the contents of the buffer object's data store is undefined. We just
+ * ignore, and leave it unchanged.
+ */
+ if (!data)
+ return;
+
+ /* Now that transfers are per-context, we don't have to figure out
+ * flushing here. Usually drivers won't need to flush in this case
+ * even if the buffer is currently referenced by hardware - they
+ * just queue the upload as dma rather than mapping the underlying
+ * buffer directly.
+ */
+ pipe_buffer_write(st_context(ctx)->pipe,
+ st_obj->buffer,
+ offset, size, data);
+}
+
+
+/**
+ * Called via glGetBufferSubDataARB().
+ */
+static void
+st_bufferobj_get_subdata(struct gl_context *ctx,
+ GLenum target,
+ GLintptrARB offset,
+ GLsizeiptrARB size,
+ GLvoid * data, struct gl_buffer_object *obj)
+{
+ struct st_buffer_object *st_obj = st_buffer_object(obj);
+
+ /* we may be called from VBO code, so double-check params here */
+ ASSERT(offset >= 0);
+ ASSERT(size >= 0);
+ ASSERT(offset + size <= obj->Size);
+
+ if (!size)
+ return;
+
+ pipe_buffer_read(st_context(ctx)->pipe, st_obj->buffer,
+ offset, size, data);
+}
+
+
+/**
+ * Allocate space for and store data in a buffer object. Any data that was
+ * previously stored in the buffer object is lost. If data is NULL,
+ * memory will be allocated, but no copy will occur.
+ * Called via ctx->Driver.BufferData().
+ * \return GL_TRUE for success, GL_FALSE if out of memory
+ */
+static GLboolean
+st_bufferobj_data(struct gl_context *ctx,
+ GLenum target,
+ GLsizeiptrARB size,
+ const GLvoid * data,
+ GLenum usage,
+ struct gl_buffer_object *obj)
+{
+ struct st_context *st = st_context(ctx);
+ struct pipe_context *pipe = st->pipe;
+ struct st_buffer_object *st_obj = st_buffer_object(obj);
+ unsigned bind, pipe_usage;
+
+ st_obj->Base.Size = size;
+ st_obj->Base.Usage = usage;
+
+ switch(target) {
+ case GL_PIXEL_PACK_BUFFER_ARB:
+ case GL_PIXEL_UNPACK_BUFFER_ARB:
+ bind = PIPE_BIND_RENDER_TARGET | PIPE_BIND_SAMPLER_VIEW;
+ break;
+ case GL_ARRAY_BUFFER_ARB:
+ bind = PIPE_BIND_VERTEX_BUFFER;
+ break;
+ case GL_ELEMENT_ARRAY_BUFFER_ARB:
+ bind = PIPE_BIND_INDEX_BUFFER;
+ break;
+ default:
+ bind = 0;
+ }
+
+ switch (usage) {
+ case GL_STATIC_DRAW:
+ case GL_STATIC_READ:
+ case GL_STATIC_COPY:
+ pipe_usage = PIPE_USAGE_STATIC;
+ break;
+ case GL_DYNAMIC_DRAW:
+ case GL_DYNAMIC_READ:
+ case GL_DYNAMIC_COPY:
+ pipe_usage = PIPE_USAGE_DYNAMIC;
+ break;
+ case GL_STREAM_DRAW:
+ case GL_STREAM_READ:
+ case GL_STREAM_COPY:
+ pipe_usage = PIPE_USAGE_STREAM;
+ break;
+ default:
+ pipe_usage = PIPE_USAGE_DEFAULT;
+ }
+
+ pipe_resource_reference( &st_obj->buffer, NULL );
+
+ if (size != 0) {
+ st_obj->buffer = pipe_buffer_create(pipe->screen, bind,
+ pipe_usage, size);
+
+ if (!st_obj->buffer) {
+ return GL_FALSE;
+ }
+
+ if (data)
+ pipe_buffer_write(st_context(ctx)->pipe, st_obj->buffer, 0,
+ size, data);
+ return GL_TRUE;
+ }
+
+ return GL_TRUE;
+}
+
+
+/**
+ * Dummy data whose's pointer is used for zero size buffers or ranges.
+ */
+static long st_bufferobj_zero_length = 0;
+
+
+
+/**
+ * Called via glMapBufferARB().
+ */
+static void *
+st_bufferobj_map(struct gl_context *ctx, GLenum target, GLenum access,
+ struct gl_buffer_object *obj)
+{
+ struct st_buffer_object *st_obj = st_buffer_object(obj);
+ uint flags;
+
+ switch (access) {
+ case GL_WRITE_ONLY:
+ flags = PIPE_TRANSFER_WRITE;
+ break;
+ case GL_READ_ONLY:
+ flags = PIPE_TRANSFER_READ;
+ break;
+ case GL_READ_WRITE:
+ default:
+ flags = PIPE_TRANSFER_READ_WRITE;
+ break;
+ }
+
+ /* Handle zero-size buffers here rather than in drivers */
+ if (obj->Size == 0) {
+ obj->Pointer = &st_bufferobj_zero_length;
+ }
+ else {
+ obj->Pointer = pipe_buffer_map(st_context(ctx)->pipe,
+ st_obj->buffer,
+ flags,
+ &st_obj->transfer);
+ }
+
+ if (obj->Pointer) {
+ obj->Offset = 0;
+ obj->Length = obj->Size;
+ }
+ return obj->Pointer;
+}
+
+
+/**
+ * Called via glMapBufferRange().
+ */
+static void *
+st_bufferobj_map_range(struct gl_context *ctx, GLenum target,
+ GLintptr offset, GLsizeiptr length, GLbitfield access,
+ struct gl_buffer_object *obj)
+{
+ struct pipe_context *pipe = st_context(ctx)->pipe;
+ struct st_buffer_object *st_obj = st_buffer_object(obj);
+ enum pipe_transfer_usage flags = 0x0;
+
+ if (access & GL_MAP_WRITE_BIT)
+ flags |= PIPE_TRANSFER_WRITE;
+
+ if (access & GL_MAP_READ_BIT)
+ flags |= PIPE_TRANSFER_READ;
+
+ if (access & GL_MAP_FLUSH_EXPLICIT_BIT)
+ flags |= PIPE_TRANSFER_FLUSH_EXPLICIT;
+
+ if (access & GL_MAP_INVALIDATE_BUFFER_BIT) {
+ flags |= PIPE_TRANSFER_DISCARD_WHOLE_RESOURCE;
+ }
+ else if (access & GL_MAP_INVALIDATE_RANGE_BIT) {
+ if (offset == 0 && length == obj->Size)
+ flags |= PIPE_TRANSFER_DISCARD_WHOLE_RESOURCE;
+ else
+ flags |= PIPE_TRANSFER_DISCARD_RANGE;
+ }
+
+ if (access & GL_MAP_UNSYNCHRONIZED_BIT)
+ flags |= PIPE_TRANSFER_UNSYNCHRONIZED;
+
+ /* ... other flags ...
+ */
+
+ if (access & MESA_MAP_NOWAIT_BIT)
+ flags |= PIPE_TRANSFER_DONTBLOCK;
+
+ assert(offset >= 0);
+ assert(length >= 0);
+ assert(offset < obj->Size);
+ assert(offset + length <= obj->Size);
+
+ /*
+ * We go out of way here to hide the degenerate yet valid case of zero
+ * length range from the pipe driver.
+ */
+ if (!length) {
+ obj->Pointer = &st_bufferobj_zero_length;
+ }
+ else {
+ obj->Pointer = pipe_buffer_map_range(pipe,
+ st_obj->buffer,
+ offset, length,
+ flags,
+ &st_obj->transfer);
+ if (obj->Pointer) {
+ obj->Pointer = (ubyte *) obj->Pointer + offset;
+ }
+ }
+
+ if (obj->Pointer) {
+ obj->Offset = offset;
+ obj->Length = length;
+ obj->AccessFlags = access;
+ }
+
+ return obj->Pointer;
+}
+
+
+static void
+st_bufferobj_flush_mapped_range(struct gl_context *ctx, GLenum target,
+ GLintptr offset, GLsizeiptr length,
+ struct gl_buffer_object *obj)
+{
+ struct pipe_context *pipe = st_context(ctx)->pipe;
+ struct st_buffer_object *st_obj = st_buffer_object(obj);
+
+ /* Subrange is relative to mapped range */
+ assert(offset >= 0);
+ assert(length >= 0);
+ assert(offset + length <= obj->Length);
+ assert(obj->Pointer);
+
+ if (!length)
+ return;
+
+ pipe_buffer_flush_mapped_range(pipe, st_obj->transfer,
+ obj->Offset + offset, length);
+}
+
+
+/**
+ * Called via glUnmapBufferARB().
+ */
+static GLboolean
+st_bufferobj_unmap(struct gl_context *ctx, GLenum target, struct gl_buffer_object *obj)
+{
+ struct pipe_context *pipe = st_context(ctx)->pipe;
+ struct st_buffer_object *st_obj = st_buffer_object(obj);
+
+ if (obj->Length)
+ pipe_buffer_unmap(pipe, st_obj->transfer);
+
+ st_obj->transfer = NULL;
+ obj->Pointer = NULL;
+ obj->Offset = 0;
+ obj->Length = 0;
+ return GL_TRUE;
+}
+
+
+/**
+ * Called via glCopyBufferSubData().
+ */
+static void
+st_copy_buffer_subdata(struct gl_context *ctx,
+ struct gl_buffer_object *src,
+ struct gl_buffer_object *dst,
+ GLintptr readOffset, GLintptr writeOffset,
+ GLsizeiptr size)
+{
+ struct pipe_context *pipe = st_context(ctx)->pipe;
+ struct st_buffer_object *srcObj = st_buffer_object(src);
+ struct st_buffer_object *dstObj = st_buffer_object(dst);
+ struct pipe_box box;
+
+ if(!size)
+ return;
+
+ /* buffer should not already be mapped */
+ assert(!src->Pointer);
+ assert(!dst->Pointer);
+
+ u_box_1d(readOffset, size, &box);
+
+ pipe->resource_copy_region(pipe, dstObj->buffer, 0, writeOffset, 0, 0,
+ srcObj->buffer, 0, &box);
+}
+
+
+/* TODO: if buffer wasn't created with appropriate usage flags, need
+ * to recreate it now and copy contents -- or possibly create a
+ * gallium entrypoint to extend the usage flags and let the driver
+ * decide if a copy is necessary.
+ */
+void
+st_bufferobj_validate_usage(struct st_context *st,
+ struct st_buffer_object *obj,
+ unsigned usage)
+{
+}
+
+
+void
+st_init_bufferobject_functions(struct dd_function_table *functions)
+{
+ functions->NewBufferObject = st_bufferobj_alloc;
+ functions->DeleteBuffer = st_bufferobj_free;
+ functions->BufferData = st_bufferobj_data;
+ functions->BufferSubData = st_bufferobj_subdata;
+ functions->GetBufferSubData = st_bufferobj_get_subdata;
+ functions->MapBuffer = st_bufferobj_map;
+ functions->MapBufferRange = st_bufferobj_map_range;
+ functions->FlushMappedBufferRange = st_bufferobj_flush_mapped_range;
+ functions->UnmapBuffer = st_bufferobj_unmap;
+ functions->CopyBufferSubData = st_copy_buffer_subdata;
+
+ /* For GL_APPLE_vertex_array_object */
+ functions->NewArrayObject = _mesa_new_array_object;
+ functions->DeleteArrayObject = _mesa_delete_array_object;
+}
diff --git a/mesalib/src/mesa/state_tracker/st_cb_clear.c b/mesalib/src/mesa/state_tracker/st_cb_clear.c
index 181fedd2b..31dcaf681 100644
--- a/mesalib/src/mesa/state_tracker/st_cb_clear.c
+++ b/mesalib/src/mesa/state_tracker/st_cb_clear.c
@@ -1,601 +1,601 @@
-/**************************************************************************
- *
- * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas.
- * All Rights Reserved.
- * Copyright 2009 VMware, Inc. All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sub license, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice (including the
- * next paragraph) shall be included in all copies or substantial portions
- * of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
- * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
- * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- **************************************************************************/
-
- /*
- * Authors:
- * Keith Whitwell <keith@tungstengraphics.com>
- * Brian Paul
- * Michel Dänzer
- */
-
-#include "main/glheader.h"
-#include "main/formats.h"
-#include "main/macros.h"
-#include "program/prog_instruction.h"
-#include "st_context.h"
-#include "st_atom.h"
-#include "st_cb_accum.h"
-#include "st_cb_clear.h"
-#include "st_cb_fbo.h"
-#include "st_format.h"
-#include "st_program.h"
-
-#include "pipe/p_context.h"
-#include "pipe/p_shader_tokens.h"
-#include "pipe/p_state.h"
-#include "pipe/p_defines.h"
-#include "util/u_format.h"
-#include "util/u_inlines.h"
-#include "util/u_simple_shaders.h"
-#include "util/u_draw_quad.h"
-
-#include "cso_cache/cso_context.h"
-
-
-/**
- * Do per-context initialization for glClear.
- */
-void
-st_init_clear(struct st_context *st)
-{
- struct pipe_screen *pscreen = st->pipe->screen;
-
- memset(&st->clear, 0, sizeof(st->clear));
-
- st->clear.raster.gl_rasterization_rules = 1;
- st->clear.enable_ds_separate = pscreen->get_param(pscreen, PIPE_CAP_DEPTHSTENCIL_CLEAR_SEPARATE);
-}
-
-
-/**
- * Free per-context state for glClear.
- */
-void
-st_destroy_clear(struct st_context *st)
-{
- if (st->clear.fs) {
- cso_delete_fragment_shader(st->cso_context, st->clear.fs);
- st->clear.fs = NULL;
- }
- if (st->clear.vs) {
- cso_delete_vertex_shader(st->cso_context, st->clear.vs);
- st->clear.vs = NULL;
- }
- if (st->clear.vbuf) {
- pipe_resource_reference(&st->clear.vbuf, NULL);
- st->clear.vbuf = NULL;
- }
-}
-
-
-/**
- * Helper function to set the fragment shaders.
- */
-static INLINE void
-set_fragment_shader(struct st_context *st)
-{
- if (!st->clear.fs)
- st->clear.fs = util_make_fragment_passthrough_shader(st->pipe);
-
- cso_set_fragment_shader_handle(st->cso_context, st->clear.fs);
-}
-
-
-/**
- * Helper function to set the vertex shader.
- */
-static INLINE void
-set_vertex_shader(struct st_context *st)
-{
- /* vertex shader - still required to provide the linkage between
- * fragment shader input semantics and vertex_element/buffers.
- */
- if (!st->clear.vs)
- {
- const uint semantic_names[] = { TGSI_SEMANTIC_POSITION,
- TGSI_SEMANTIC_COLOR };
- const uint semantic_indexes[] = { 0, 0 };
- st->clear.vs = util_make_vertex_passthrough_shader(st->pipe, 2,
- semantic_names,
- semantic_indexes);
- }
-
- cso_set_vertex_shader_handle(st->cso_context, st->clear.vs);
-}
-
-
-/**
- * Draw a screen-aligned quadrilateral.
- * Coords are clip coords with y=0=bottom.
- */
-static void
-draw_quad(struct st_context *st,
- float x0, float y0, float x1, float y1, GLfloat z,
- const GLfloat color[4])
-{
- struct pipe_context *pipe = st->pipe;
-
- /* XXX: Need to improve buffer_write to allow NO_WAIT (as well as
- * no_flush) updates to buffers where we know there is no conflict
- * with previous data. Currently using max_slots > 1 will cause
- * synchronous rendering if the driver flushes its command buffers
- * between one bitmap and the next. Our flush hook below isn't
- * sufficient to catch this as the driver doesn't tell us when it
- * flushes its own command buffers. Until this gets fixed, pay the
- * price of allocating a new buffer for each bitmap cache-flush to
- * avoid synchronous rendering.
- */
- const GLuint max_slots = 1; /* 1024 / sizeof(st->clear.vertices); */
- GLuint i;
-
- if (st->clear.vbuf_slot >= max_slots) {
- pipe_resource_reference(&st->clear.vbuf, NULL);
- st->clear.vbuf_slot = 0;
- }
-
- if (!st->clear.vbuf) {
- st->clear.vbuf = pipe_buffer_create(pipe->screen,
- PIPE_BIND_VERTEX_BUFFER,
- PIPE_USAGE_STREAM,
- max_slots * sizeof(st->clear.vertices));
- }
-
- /* positions */
- st->clear.vertices[0][0][0] = x0;
- st->clear.vertices[0][0][1] = y0;
-
- st->clear.vertices[1][0][0] = x1;
- st->clear.vertices[1][0][1] = y0;
-
- st->clear.vertices[2][0][0] = x1;
- st->clear.vertices[2][0][1] = y1;
-
- st->clear.vertices[3][0][0] = x0;
- st->clear.vertices[3][0][1] = y1;
-
- /* same for all verts: */
- for (i = 0; i < 4; i++) {
- st->clear.vertices[i][0][2] = z;
- st->clear.vertices[i][0][3] = 1.0;
- st->clear.vertices[i][1][0] = color[0];
- st->clear.vertices[i][1][1] = color[1];
- st->clear.vertices[i][1][2] = color[2];
- st->clear.vertices[i][1][3] = color[3];
- }
-
- /* put vertex data into vbuf */
- pipe_buffer_write_nooverlap(st->pipe, st->clear.vbuf,
- st->clear.vbuf_slot
- * sizeof(st->clear.vertices),
- sizeof(st->clear.vertices),
- st->clear.vertices);
-
- /* draw */
- util_draw_vertex_buffer(pipe,
- st->cso_context,
- st->clear.vbuf,
- st->clear.vbuf_slot * sizeof(st->clear.vertices),
- PIPE_PRIM_TRIANGLE_FAN,
- 4, /* verts */
- 2); /* attribs/vert */
-
- /* Increment slot */
- st->clear.vbuf_slot++;
-}
-
-
-
-/**
- * Do glClear by drawing a quadrilateral.
- * The vertices of the quad will be computed from the
- * ctx->DrawBuffer->_X/Ymin/max fields.
- */
-static void
-clear_with_quad(struct gl_context *ctx,
- GLboolean color, GLboolean depth, GLboolean stencil)
-{
- struct st_context *st = st_context(ctx);
- const struct gl_framebuffer *fb = ctx->DrawBuffer;
- const GLfloat fb_width = (GLfloat) fb->Width;
- const GLfloat fb_height = (GLfloat) fb->Height;
- const GLfloat x0 = (GLfloat) ctx->DrawBuffer->_Xmin / fb_width * 2.0f - 1.0f;
- const GLfloat x1 = (GLfloat) ctx->DrawBuffer->_Xmax / fb_width * 2.0f - 1.0f;
- const GLfloat y0 = (GLfloat) ctx->DrawBuffer->_Ymin / fb_height * 2.0f - 1.0f;
- const GLfloat y1 = (GLfloat) ctx->DrawBuffer->_Ymax / fb_height * 2.0f - 1.0f;
- float clearColor[4];
-
- /*
- printf("%s %s%s%s %f,%f %f,%f\n", __FUNCTION__,
- color ? "color, " : "",
- depth ? "depth, " : "",
- stencil ? "stencil" : "",
- x0, y0,
- x1, y1);
- */
-
- cso_save_blend(st->cso_context);
- cso_save_stencil_ref(st->cso_context);
- cso_save_depth_stencil_alpha(st->cso_context);
- cso_save_rasterizer(st->cso_context);
- cso_save_viewport(st->cso_context);
- cso_save_clip(st->cso_context);
- cso_save_fragment_shader(st->cso_context);
- cso_save_vertex_shader(st->cso_context);
- cso_save_vertex_elements(st->cso_context);
- cso_save_vertex_buffers(st->cso_context);
-
- /* blend state: RGBA masking */
- {
- struct pipe_blend_state blend;
- memset(&blend, 0, sizeof(blend));
- blend.rt[0].rgb_src_factor = PIPE_BLENDFACTOR_ONE;
- blend.rt[0].alpha_src_factor = PIPE_BLENDFACTOR_ONE;
- blend.rt[0].rgb_dst_factor = PIPE_BLENDFACTOR_ZERO;
- blend.rt[0].alpha_dst_factor = PIPE_BLENDFACTOR_ZERO;
- if (color) {
- if (ctx->Color.ColorMask[0][0])
- blend.rt[0].colormask |= PIPE_MASK_R;
- if (ctx->Color.ColorMask[0][1])
- blend.rt[0].colormask |= PIPE_MASK_G;
- if (ctx->Color.ColorMask[0][2])
- blend.rt[0].colormask |= PIPE_MASK_B;
- if (ctx->Color.ColorMask[0][3])
- blend.rt[0].colormask |= PIPE_MASK_A;
- if (st->ctx->Color.DitherFlag)
- blend.dither = 1;
- }
- cso_set_blend(st->cso_context, &blend);
- }
-
- /* depth_stencil state: always pass/set to ref value */
- {
- struct pipe_depth_stencil_alpha_state depth_stencil;
- memset(&depth_stencil, 0, sizeof(depth_stencil));
- if (depth) {
- depth_stencil.depth.enabled = 1;
- depth_stencil.depth.writemask = 1;
- depth_stencil.depth.func = PIPE_FUNC_ALWAYS;
- }
-
- if (stencil) {
- struct pipe_stencil_ref stencil_ref;
- memset(&stencil_ref, 0, sizeof(stencil_ref));
- depth_stencil.stencil[0].enabled = 1;
- depth_stencil.stencil[0].func = PIPE_FUNC_ALWAYS;
- depth_stencil.stencil[0].fail_op = PIPE_STENCIL_OP_REPLACE;
- depth_stencil.stencil[0].zpass_op = PIPE_STENCIL_OP_REPLACE;
- depth_stencil.stencil[0].zfail_op = PIPE_STENCIL_OP_REPLACE;
- depth_stencil.stencil[0].valuemask = 0xff;
- depth_stencil.stencil[0].writemask = ctx->Stencil.WriteMask[0] & 0xff;
- stencil_ref.ref_value[0] = ctx->Stencil.Clear;
- cso_set_stencil_ref(st->cso_context, &stencil_ref);
- }
-
- cso_set_depth_stencil_alpha(st->cso_context, &depth_stencil);
- }
-
- cso_set_vertex_elements(st->cso_context, 2, st->velems_util_draw);
-
- cso_set_rasterizer(st->cso_context, &st->clear.raster);
-
- /* viewport state: viewport matching window dims */
- {
- const GLboolean invert = (st_fb_orientation(fb) == Y_0_TOP);
- struct pipe_viewport_state vp;
- vp.scale[0] = 0.5f * fb_width;
- vp.scale[1] = fb_height * (invert ? -0.5f : 0.5f);
- vp.scale[2] = 1.0f;
- vp.scale[3] = 1.0f;
- vp.translate[0] = 0.5f * fb_width;
- vp.translate[1] = 0.5f * fb_height;
- vp.translate[2] = 0.0f;
- vp.translate[3] = 0.0f;
- cso_set_viewport(st->cso_context, &vp);
- }
-
- cso_set_clip(st->cso_context, &st->clear.clip);
- set_fragment_shader(st);
- set_vertex_shader(st);
-
- if (ctx->DrawBuffer->_ColorDrawBuffers[0]) {
- st_translate_color(ctx->Color.ClearColorUnclamped,
- ctx->DrawBuffer->_ColorDrawBuffers[0]->_BaseFormat,
- clearColor);
- }
-
- /* draw quad matching scissor rect */
- draw_quad(st, x0, y0, x1, y1, (GLfloat) ctx->Depth.Clear, clearColor);
-
- /* Restore pipe state */
- cso_restore_blend(st->cso_context);
- cso_restore_stencil_ref(st->cso_context);
- cso_restore_depth_stencil_alpha(st->cso_context);
- cso_restore_rasterizer(st->cso_context);
- cso_restore_viewport(st->cso_context);
- cso_restore_clip(st->cso_context);
- cso_restore_fragment_shader(st->cso_context);
- cso_restore_vertex_shader(st->cso_context);
- cso_restore_vertex_elements(st->cso_context);
- cso_restore_vertex_buffers(st->cso_context);
-}
-
-
-/**
- * Determine if we need to clear the depth buffer by drawing a quad.
- */
-static INLINE GLboolean
-check_clear_color_with_quad(struct gl_context *ctx, struct gl_renderbuffer *rb)
-{
- if (ctx->Scissor.Enabled &&
- (ctx->Scissor.X != 0 ||
- ctx->Scissor.Y != 0 ||
- ctx->Scissor.Width < rb->Width ||
- ctx->Scissor.Height < rb->Height))
- return GL_TRUE;
-
- if (!ctx->Color.ColorMask[0][0] ||
- !ctx->Color.ColorMask[0][1] ||
- !ctx->Color.ColorMask[0][2] ||
- !ctx->Color.ColorMask[0][3])
- return GL_TRUE;
-
- return GL_FALSE;
-}
-
-
-/**
- * Determine if we need to clear the combiend depth/stencil buffer by
- * drawing a quad.
- */
-static INLINE GLboolean
-check_clear_depth_stencil_with_quad(struct gl_context *ctx, struct gl_renderbuffer *rb)
-{
- const GLuint stencilMax = 0xff;
- GLboolean maskStencil
- = (ctx->Stencil.WriteMask[0] & stencilMax) != stencilMax;
-
- assert(rb->Format == MESA_FORMAT_S8 ||
- rb->Format == MESA_FORMAT_Z24_S8 ||
- rb->Format == MESA_FORMAT_S8_Z24);
-
- if (ctx->Scissor.Enabled &&
- (ctx->Scissor.X != 0 ||
- ctx->Scissor.Y != 0 ||
- ctx->Scissor.Width < rb->Width ||
- ctx->Scissor.Height < rb->Height))
- return GL_TRUE;
-
- if (maskStencil)
- return GL_TRUE;
-
- return GL_FALSE;
-}
-
-
-/**
- * Determine if we need to clear the depth buffer by drawing a quad.
- */
-static INLINE GLboolean
-check_clear_depth_with_quad(struct gl_context *ctx, struct gl_renderbuffer *rb,
- boolean ds_separate)
-{
- const struct st_renderbuffer *strb = st_renderbuffer(rb);
- const GLboolean isDS = util_format_is_depth_and_stencil(strb->surface->format);
-
- if (ctx->Scissor.Enabled &&
- (ctx->Scissor.X != 0 ||
- ctx->Scissor.Y != 0 ||
- ctx->Scissor.Width < rb->Width ||
- ctx->Scissor.Height < rb->Height))
- return GL_TRUE;
-
- if (!ds_separate && isDS && ctx->DrawBuffer->Visual.stencilBits > 0)
- return GL_TRUE;
-
- return GL_FALSE;
-}
-
-
-/**
- * Determine if we need to clear the stencil buffer by drawing a quad.
- */
-static INLINE GLboolean
-check_clear_stencil_with_quad(struct gl_context *ctx, struct gl_renderbuffer *rb,
- boolean ds_separate)
-{
- const struct st_renderbuffer *strb = st_renderbuffer(rb);
- const GLboolean isDS = util_format_is_depth_and_stencil(strb->surface->format);
- const GLuint stencilMax = 0xff;
- const GLboolean maskStencil
- = (ctx->Stencil.WriteMask[0] & stencilMax) != stencilMax;
-
- assert(rb->Format == MESA_FORMAT_S8 ||
- rb->Format == MESA_FORMAT_Z24_S8 ||
- rb->Format == MESA_FORMAT_S8_Z24);
-
- if (maskStencil)
- return GL_TRUE;
-
- if (ctx->Scissor.Enabled &&
- (ctx->Scissor.X != 0 ||
- ctx->Scissor.Y != 0 ||
- ctx->Scissor.Width < rb->Width ||
- ctx->Scissor.Height < rb->Height))
- return GL_TRUE;
-
- /* This is correct, but it is necessary to look at the depth clear
- * value held in the surface when it comes time to issue the clear,
- * rather than taking depth and stencil clear values from the
- * current state.
- */
- if (!ds_separate && isDS && ctx->DrawBuffer->Visual.depthBits > 0)
- return GL_TRUE;
-
- return GL_FALSE;
-}
-
-
-
-/**
- * Called when we need to flush.
- */
-void
-st_flush_clear(struct st_context *st)
-{
- /* Release vertex buffer to avoid synchronous rendering if we were
- * to map it in the next frame.
- */
- pipe_resource_reference(&st->clear.vbuf, NULL);
- st->clear.vbuf_slot = 0;
-}
-
-
-
-/**
- * Called via ctx->Driver.Clear()
- */
-static void
-st_Clear(struct gl_context *ctx, GLbitfield mask)
-{
- static const GLbitfield BUFFER_BITS_DS
- = (BUFFER_BIT_DEPTH | BUFFER_BIT_STENCIL);
- struct st_context *st = st_context(ctx);
- struct gl_renderbuffer *depthRb
- = ctx->DrawBuffer->Attachment[BUFFER_DEPTH].Renderbuffer;
- struct gl_renderbuffer *stencilRb
- = ctx->DrawBuffer->Attachment[BUFFER_STENCIL].Renderbuffer;
- GLbitfield quad_buffers = 0x0;
- GLbitfield clear_buffers = 0x0;
- GLuint i;
-
- /* This makes sure the pipe has the latest scissor, etc values */
- st_validate_state( st );
-
- if (mask & BUFFER_BITS_COLOR) {
- for (i = 0; i < ctx->DrawBuffer->_NumColorDrawBuffers; i++) {
- GLuint b = ctx->DrawBuffer->_ColorDrawBufferIndexes[i];
-
- if (mask & (1 << b)) {
- struct gl_renderbuffer *rb
- = ctx->DrawBuffer->Attachment[b].Renderbuffer;
- struct st_renderbuffer *strb = st_renderbuffer(rb);
-
- if (!strb || !strb->surface)
- continue;
-
- if (check_clear_color_with_quad( ctx, rb ))
- quad_buffers |= PIPE_CLEAR_COLOR;
- else
- clear_buffers |= PIPE_CLEAR_COLOR;
- }
- }
- }
-
- if ((mask & BUFFER_BITS_DS) == BUFFER_BITS_DS && depthRb == stencilRb) {
- /* clearing combined depth + stencil */
- struct st_renderbuffer *strb = st_renderbuffer(depthRb);
-
- if (strb->surface) {
- if (check_clear_depth_stencil_with_quad(ctx, depthRb))
- quad_buffers |= PIPE_CLEAR_DEPTHSTENCIL;
- else
- clear_buffers |= PIPE_CLEAR_DEPTHSTENCIL;
- }
- }
- else {
- /* separate depth/stencil clears */
- /* I don't think truly separate buffers are actually possible in gallium or hw? */
- if (mask & BUFFER_BIT_DEPTH) {
- struct st_renderbuffer *strb = st_renderbuffer(depthRb);
-
- if (strb->surface) {
- if (check_clear_depth_with_quad(ctx, depthRb,
- st->clear.enable_ds_separate))
- quad_buffers |= PIPE_CLEAR_DEPTH;
- else
- clear_buffers |= PIPE_CLEAR_DEPTH;
- }
- }
- if (mask & BUFFER_BIT_STENCIL) {
- struct st_renderbuffer *strb = st_renderbuffer(stencilRb);
-
- if (strb->surface) {
- if (check_clear_stencil_with_quad(ctx, stencilRb,
- st->clear.enable_ds_separate))
- quad_buffers |= PIPE_CLEAR_STENCIL;
- else
- clear_buffers |= PIPE_CLEAR_STENCIL;
- }
- }
- }
-
- /*
- * If we're going to use clear_with_quad() for any reason, use it for
- * everything possible.
- */
- if (quad_buffers) {
- quad_buffers |= clear_buffers;
- clear_with_quad(ctx,
- quad_buffers & PIPE_CLEAR_COLOR,
- quad_buffers & PIPE_CLEAR_DEPTH,
- quad_buffers & PIPE_CLEAR_STENCIL);
- } else if (clear_buffers) {
- /* driver cannot know it can clear everything if the buffer
- * is a combined depth/stencil buffer but this wasn't actually
- * required from the visual. Hence fix this up to avoid potential
- * read-modify-write in the driver.
- */
- float clearColor[4];
-
- if ((clear_buffers & PIPE_CLEAR_DEPTHSTENCIL) &&
- ((clear_buffers & PIPE_CLEAR_DEPTHSTENCIL) != PIPE_CLEAR_DEPTHSTENCIL) &&
- (depthRb == stencilRb) &&
- (ctx->DrawBuffer->Visual.depthBits == 0 ||
- ctx->DrawBuffer->Visual.stencilBits == 0))
- clear_buffers |= PIPE_CLEAR_DEPTHSTENCIL;
-
- if (ctx->DrawBuffer->_ColorDrawBuffers[0]) {
- st_translate_color(ctx->Color.ClearColor,
- ctx->DrawBuffer->_ColorDrawBuffers[0]->_BaseFormat,
- clearColor);
- }
-
- st->pipe->clear(st->pipe, clear_buffers, ctx->Color.ClearColorUnclamped,
- ctx->Depth.Clear, ctx->Stencil.Clear);
- }
- if (mask & BUFFER_BIT_ACCUM)
- st_clear_accum_buffer(ctx,
- ctx->DrawBuffer->Attachment[BUFFER_ACCUM].Renderbuffer);
-}
-
-
-void
-st_init_clear_functions(struct dd_function_table *functions)
-{
- functions->Clear = st_Clear;
-}
+/**************************************************************************
+ *
+ * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas.
+ * All Rights Reserved.
+ * Copyright 2009 VMware, Inc. All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ **************************************************************************/
+
+ /*
+ * Authors:
+ * Keith Whitwell <keith@tungstengraphics.com>
+ * Brian Paul
+ * Michel Dänzer
+ */
+
+#include "main/glheader.h"
+#include "main/formats.h"
+#include "main/macros.h"
+#include "program/prog_instruction.h"
+#include "st_context.h"
+#include "st_atom.h"
+#include "st_cb_accum.h"
+#include "st_cb_clear.h"
+#include "st_cb_fbo.h"
+#include "st_format.h"
+#include "st_program.h"
+
+#include "pipe/p_context.h"
+#include "pipe/p_shader_tokens.h"
+#include "pipe/p_state.h"
+#include "pipe/p_defines.h"
+#include "util/u_format.h"
+#include "util/u_inlines.h"
+#include "util/u_simple_shaders.h"
+#include "util/u_draw_quad.h"
+
+#include "cso_cache/cso_context.h"
+
+
+/**
+ * Do per-context initialization for glClear.
+ */
+void
+st_init_clear(struct st_context *st)
+{
+ struct pipe_screen *pscreen = st->pipe->screen;
+
+ memset(&st->clear, 0, sizeof(st->clear));
+
+ st->clear.raster.gl_rasterization_rules = 1;
+ st->clear.enable_ds_separate = pscreen->get_param(pscreen, PIPE_CAP_DEPTHSTENCIL_CLEAR_SEPARATE);
+}
+
+
+/**
+ * Free per-context state for glClear.
+ */
+void
+st_destroy_clear(struct st_context *st)
+{
+ if (st->clear.fs) {
+ cso_delete_fragment_shader(st->cso_context, st->clear.fs);
+ st->clear.fs = NULL;
+ }
+ if (st->clear.vs) {
+ cso_delete_vertex_shader(st->cso_context, st->clear.vs);
+ st->clear.vs = NULL;
+ }
+ if (st->clear.vbuf) {
+ pipe_resource_reference(&st->clear.vbuf, NULL);
+ st->clear.vbuf = NULL;
+ }
+}
+
+
+/**
+ * Helper function to set the fragment shaders.
+ */
+static INLINE void
+set_fragment_shader(struct st_context *st)
+{
+ if (!st->clear.fs)
+ st->clear.fs = util_make_fragment_passthrough_shader(st->pipe);
+
+ cso_set_fragment_shader_handle(st->cso_context, st->clear.fs);
+}
+
+
+/**
+ * Helper function to set the vertex shader.
+ */
+static INLINE void
+set_vertex_shader(struct st_context *st)
+{
+ /* vertex shader - still required to provide the linkage between
+ * fragment shader input semantics and vertex_element/buffers.
+ */
+ if (!st->clear.vs)
+ {
+ const uint semantic_names[] = { TGSI_SEMANTIC_POSITION,
+ TGSI_SEMANTIC_COLOR };
+ const uint semantic_indexes[] = { 0, 0 };
+ st->clear.vs = util_make_vertex_passthrough_shader(st->pipe, 2,
+ semantic_names,
+ semantic_indexes);
+ }
+
+ cso_set_vertex_shader_handle(st->cso_context, st->clear.vs);
+}
+
+
+/**
+ * Draw a screen-aligned quadrilateral.
+ * Coords are clip coords with y=0=bottom.
+ */
+static void
+draw_quad(struct st_context *st,
+ float x0, float y0, float x1, float y1, GLfloat z,
+ const GLfloat color[4])
+{
+ struct pipe_context *pipe = st->pipe;
+
+ /* XXX: Need to improve buffer_write to allow NO_WAIT (as well as
+ * no_flush) updates to buffers where we know there is no conflict
+ * with previous data. Currently using max_slots > 1 will cause
+ * synchronous rendering if the driver flushes its command buffers
+ * between one bitmap and the next. Our flush hook below isn't
+ * sufficient to catch this as the driver doesn't tell us when it
+ * flushes its own command buffers. Until this gets fixed, pay the
+ * price of allocating a new buffer for each bitmap cache-flush to
+ * avoid synchronous rendering.
+ */
+ const GLuint max_slots = 1; /* 1024 / sizeof(st->clear.vertices); */
+ GLuint i;
+
+ if (st->clear.vbuf_slot >= max_slots) {
+ pipe_resource_reference(&st->clear.vbuf, NULL);
+ st->clear.vbuf_slot = 0;
+ }
+
+ if (!st->clear.vbuf) {
+ st->clear.vbuf = pipe_buffer_create(pipe->screen,
+ PIPE_BIND_VERTEX_BUFFER,
+ PIPE_USAGE_STREAM,
+ max_slots * sizeof(st->clear.vertices));
+ }
+
+ /* positions */
+ st->clear.vertices[0][0][0] = x0;
+ st->clear.vertices[0][0][1] = y0;
+
+ st->clear.vertices[1][0][0] = x1;
+ st->clear.vertices[1][0][1] = y0;
+
+ st->clear.vertices[2][0][0] = x1;
+ st->clear.vertices[2][0][1] = y1;
+
+ st->clear.vertices[3][0][0] = x0;
+ st->clear.vertices[3][0][1] = y1;
+
+ /* same for all verts: */
+ for (i = 0; i < 4; i++) {
+ st->clear.vertices[i][0][2] = z;
+ st->clear.vertices[i][0][3] = 1.0;
+ st->clear.vertices[i][1][0] = color[0];
+ st->clear.vertices[i][1][1] = color[1];
+ st->clear.vertices[i][1][2] = color[2];
+ st->clear.vertices[i][1][3] = color[3];
+ }
+
+ /* put vertex data into vbuf */
+ pipe_buffer_write_nooverlap(st->pipe, st->clear.vbuf,
+ st->clear.vbuf_slot
+ * sizeof(st->clear.vertices),
+ sizeof(st->clear.vertices),
+ st->clear.vertices);
+
+ /* draw */
+ util_draw_vertex_buffer(pipe,
+ st->cso_context,
+ st->clear.vbuf,
+ st->clear.vbuf_slot * sizeof(st->clear.vertices),
+ PIPE_PRIM_TRIANGLE_FAN,
+ 4, /* verts */
+ 2); /* attribs/vert */
+
+ /* Increment slot */
+ st->clear.vbuf_slot++;
+}
+
+
+
+/**
+ * Do glClear by drawing a quadrilateral.
+ * The vertices of the quad will be computed from the
+ * ctx->DrawBuffer->_X/Ymin/max fields.
+ */
+static void
+clear_with_quad(struct gl_context *ctx,
+ GLboolean color, GLboolean depth, GLboolean stencil)
+{
+ struct st_context *st = st_context(ctx);
+ const struct gl_framebuffer *fb = ctx->DrawBuffer;
+ const GLfloat fb_width = (GLfloat) fb->Width;
+ const GLfloat fb_height = (GLfloat) fb->Height;
+ const GLfloat x0 = (GLfloat) ctx->DrawBuffer->_Xmin / fb_width * 2.0f - 1.0f;
+ const GLfloat x1 = (GLfloat) ctx->DrawBuffer->_Xmax / fb_width * 2.0f - 1.0f;
+ const GLfloat y0 = (GLfloat) ctx->DrawBuffer->_Ymin / fb_height * 2.0f - 1.0f;
+ const GLfloat y1 = (GLfloat) ctx->DrawBuffer->_Ymax / fb_height * 2.0f - 1.0f;
+ float clearColor[4];
+
+ /*
+ printf("%s %s%s%s %f,%f %f,%f\n", __FUNCTION__,
+ color ? "color, " : "",
+ depth ? "depth, " : "",
+ stencil ? "stencil" : "",
+ x0, y0,
+ x1, y1);
+ */
+
+ cso_save_blend(st->cso_context);
+ cso_save_stencil_ref(st->cso_context);
+ cso_save_depth_stencil_alpha(st->cso_context);
+ cso_save_rasterizer(st->cso_context);
+ cso_save_viewport(st->cso_context);
+ cso_save_clip(st->cso_context);
+ cso_save_fragment_shader(st->cso_context);
+ cso_save_vertex_shader(st->cso_context);
+ cso_save_vertex_elements(st->cso_context);
+ cso_save_vertex_buffers(st->cso_context);
+
+ /* blend state: RGBA masking */
+ {
+ struct pipe_blend_state blend;
+ memset(&blend, 0, sizeof(blend));
+ blend.rt[0].rgb_src_factor = PIPE_BLENDFACTOR_ONE;
+ blend.rt[0].alpha_src_factor = PIPE_BLENDFACTOR_ONE;
+ blend.rt[0].rgb_dst_factor = PIPE_BLENDFACTOR_ZERO;
+ blend.rt[0].alpha_dst_factor = PIPE_BLENDFACTOR_ZERO;
+ if (color) {
+ if (ctx->Color.ColorMask[0][0])
+ blend.rt[0].colormask |= PIPE_MASK_R;
+ if (ctx->Color.ColorMask[0][1])
+ blend.rt[0].colormask |= PIPE_MASK_G;
+ if (ctx->Color.ColorMask[0][2])
+ blend.rt[0].colormask |= PIPE_MASK_B;
+ if (ctx->Color.ColorMask[0][3])
+ blend.rt[0].colormask |= PIPE_MASK_A;
+ if (st->ctx->Color.DitherFlag)
+ blend.dither = 1;
+ }
+ cso_set_blend(st->cso_context, &blend);
+ }
+
+ /* depth_stencil state: always pass/set to ref value */
+ {
+ struct pipe_depth_stencil_alpha_state depth_stencil;
+ memset(&depth_stencil, 0, sizeof(depth_stencil));
+ if (depth) {
+ depth_stencil.depth.enabled = 1;
+ depth_stencil.depth.writemask = 1;
+ depth_stencil.depth.func = PIPE_FUNC_ALWAYS;
+ }
+
+ if (stencil) {
+ struct pipe_stencil_ref stencil_ref;
+ memset(&stencil_ref, 0, sizeof(stencil_ref));
+ depth_stencil.stencil[0].enabled = 1;
+ depth_stencil.stencil[0].func = PIPE_FUNC_ALWAYS;
+ depth_stencil.stencil[0].fail_op = PIPE_STENCIL_OP_REPLACE;
+ depth_stencil.stencil[0].zpass_op = PIPE_STENCIL_OP_REPLACE;
+ depth_stencil.stencil[0].zfail_op = PIPE_STENCIL_OP_REPLACE;
+ depth_stencil.stencil[0].valuemask = 0xff;
+ depth_stencil.stencil[0].writemask = ctx->Stencil.WriteMask[0] & 0xff;
+ stencil_ref.ref_value[0] = ctx->Stencil.Clear;
+ cso_set_stencil_ref(st->cso_context, &stencil_ref);
+ }
+
+ cso_set_depth_stencil_alpha(st->cso_context, &depth_stencil);
+ }
+
+ cso_set_vertex_elements(st->cso_context, 2, st->velems_util_draw);
+
+ cso_set_rasterizer(st->cso_context, &st->clear.raster);
+
+ /* viewport state: viewport matching window dims */
+ {
+ const GLboolean invert = (st_fb_orientation(fb) == Y_0_TOP);
+ struct pipe_viewport_state vp;
+ vp.scale[0] = 0.5f * fb_width;
+ vp.scale[1] = fb_height * (invert ? -0.5f : 0.5f);
+ vp.scale[2] = 1.0f;
+ vp.scale[3] = 1.0f;
+ vp.translate[0] = 0.5f * fb_width;
+ vp.translate[1] = 0.5f * fb_height;
+ vp.translate[2] = 0.0f;
+ vp.translate[3] = 0.0f;
+ cso_set_viewport(st->cso_context, &vp);
+ }
+
+ cso_set_clip(st->cso_context, &st->clear.clip);
+ set_fragment_shader(st);
+ set_vertex_shader(st);
+
+ if (ctx->DrawBuffer->_ColorDrawBuffers[0]) {
+ st_translate_color(ctx->Color.ClearColorUnclamped,
+ ctx->DrawBuffer->_ColorDrawBuffers[0]->_BaseFormat,
+ clearColor);
+ }
+
+ /* draw quad matching scissor rect */
+ draw_quad(st, x0, y0, x1, y1, (GLfloat) ctx->Depth.Clear, clearColor);
+
+ /* Restore pipe state */
+ cso_restore_blend(st->cso_context);
+ cso_restore_stencil_ref(st->cso_context);
+ cso_restore_depth_stencil_alpha(st->cso_context);
+ cso_restore_rasterizer(st->cso_context);
+ cso_restore_viewport(st->cso_context);
+ cso_restore_clip(st->cso_context);
+ cso_restore_fragment_shader(st->cso_context);
+ cso_restore_vertex_shader(st->cso_context);
+ cso_restore_vertex_elements(st->cso_context);
+ cso_restore_vertex_buffers(st->cso_context);
+}
+
+
+/**
+ * Determine if we need to clear the depth buffer by drawing a quad.
+ */
+static INLINE GLboolean
+check_clear_color_with_quad(struct gl_context *ctx, struct gl_renderbuffer *rb)
+{
+ if (ctx->Scissor.Enabled &&
+ (ctx->Scissor.X != 0 ||
+ ctx->Scissor.Y != 0 ||
+ ctx->Scissor.Width < rb->Width ||
+ ctx->Scissor.Height < rb->Height))
+ return GL_TRUE;
+
+ if (!ctx->Color.ColorMask[0][0] ||
+ !ctx->Color.ColorMask[0][1] ||
+ !ctx->Color.ColorMask[0][2] ||
+ !ctx->Color.ColorMask[0][3])
+ return GL_TRUE;
+
+ return GL_FALSE;
+}
+
+
+/**
+ * Determine if we need to clear the combiend depth/stencil buffer by
+ * drawing a quad.
+ */
+static INLINE GLboolean
+check_clear_depth_stencil_with_quad(struct gl_context *ctx, struct gl_renderbuffer *rb)
+{
+ const GLuint stencilMax = 0xff;
+ GLboolean maskStencil
+ = (ctx->Stencil.WriteMask[0] & stencilMax) != stencilMax;
+
+ assert(rb->Format == MESA_FORMAT_S8 ||
+ rb->Format == MESA_FORMAT_Z24_S8 ||
+ rb->Format == MESA_FORMAT_S8_Z24);
+
+ if (ctx->Scissor.Enabled &&
+ (ctx->Scissor.X != 0 ||
+ ctx->Scissor.Y != 0 ||
+ ctx->Scissor.Width < rb->Width ||
+ ctx->Scissor.Height < rb->Height))
+ return GL_TRUE;
+
+ if (maskStencil)
+ return GL_TRUE;
+
+ return GL_FALSE;
+}
+
+
+/**
+ * Determine if we need to clear the depth buffer by drawing a quad.
+ */
+static INLINE GLboolean
+check_clear_depth_with_quad(struct gl_context *ctx, struct gl_renderbuffer *rb,
+ boolean ds_separate)
+{
+ const struct st_renderbuffer *strb = st_renderbuffer(rb);
+ const GLboolean isDS = util_format_is_depth_and_stencil(strb->surface->format);
+
+ if (ctx->Scissor.Enabled &&
+ (ctx->Scissor.X != 0 ||
+ ctx->Scissor.Y != 0 ||
+ ctx->Scissor.Width < rb->Width ||
+ ctx->Scissor.Height < rb->Height))
+ return GL_TRUE;
+
+ if (!ds_separate && isDS && ctx->DrawBuffer->Visual.stencilBits > 0)
+ return GL_TRUE;
+
+ return GL_FALSE;
+}
+
+
+/**
+ * Determine if we need to clear the stencil buffer by drawing a quad.
+ */
+static INLINE GLboolean
+check_clear_stencil_with_quad(struct gl_context *ctx, struct gl_renderbuffer *rb,
+ boolean ds_separate)
+{
+ const struct st_renderbuffer *strb = st_renderbuffer(rb);
+ const GLboolean isDS = util_format_is_depth_and_stencil(strb->surface->format);
+ const GLuint stencilMax = 0xff;
+ const GLboolean maskStencil
+ = (ctx->Stencil.WriteMask[0] & stencilMax) != stencilMax;
+
+ assert(rb->Format == MESA_FORMAT_S8 ||
+ rb->Format == MESA_FORMAT_Z24_S8 ||
+ rb->Format == MESA_FORMAT_S8_Z24);
+
+ if (maskStencil)
+ return GL_TRUE;
+
+ if (ctx->Scissor.Enabled &&
+ (ctx->Scissor.X != 0 ||
+ ctx->Scissor.Y != 0 ||
+ ctx->Scissor.Width < rb->Width ||
+ ctx->Scissor.Height < rb->Height))
+ return GL_TRUE;
+
+ /* This is correct, but it is necessary to look at the depth clear
+ * value held in the surface when it comes time to issue the clear,
+ * rather than taking depth and stencil clear values from the
+ * current state.
+ */
+ if (!ds_separate && isDS && ctx->DrawBuffer->Visual.depthBits > 0)
+ return GL_TRUE;
+
+ return GL_FALSE;
+}
+
+
+
+/**
+ * Called when we need to flush.
+ */
+void
+st_flush_clear(struct st_context *st)
+{
+ /* Release vertex buffer to avoid synchronous rendering if we were
+ * to map it in the next frame.
+ */
+ pipe_resource_reference(&st->clear.vbuf, NULL);
+ st->clear.vbuf_slot = 0;
+}
+
+
+
+/**
+ * Called via ctx->Driver.Clear()
+ */
+static void
+st_Clear(struct gl_context *ctx, GLbitfield mask)
+{
+ static const GLbitfield BUFFER_BITS_DS
+ = (BUFFER_BIT_DEPTH | BUFFER_BIT_STENCIL);
+ struct st_context *st = st_context(ctx);
+ struct gl_renderbuffer *depthRb
+ = ctx->DrawBuffer->Attachment[BUFFER_DEPTH].Renderbuffer;
+ struct gl_renderbuffer *stencilRb
+ = ctx->DrawBuffer->Attachment[BUFFER_STENCIL].Renderbuffer;
+ GLbitfield quad_buffers = 0x0;
+ GLbitfield clear_buffers = 0x0;
+ GLuint i;
+
+ /* This makes sure the pipe has the latest scissor, etc values */
+ st_validate_state( st );
+
+ if (mask & BUFFER_BITS_COLOR) {
+ for (i = 0; i < ctx->DrawBuffer->_NumColorDrawBuffers; i++) {
+ GLuint b = ctx->DrawBuffer->_ColorDrawBufferIndexes[i];
+
+ if (mask & (1 << b)) {
+ struct gl_renderbuffer *rb
+ = ctx->DrawBuffer->Attachment[b].Renderbuffer;
+ struct st_renderbuffer *strb = st_renderbuffer(rb);
+
+ if (!strb || !strb->surface)
+ continue;
+
+ if (check_clear_color_with_quad( ctx, rb ))
+ quad_buffers |= PIPE_CLEAR_COLOR;
+ else
+ clear_buffers |= PIPE_CLEAR_COLOR;
+ }
+ }
+ }
+
+ if ((mask & BUFFER_BITS_DS) == BUFFER_BITS_DS && depthRb == stencilRb) {
+ /* clearing combined depth + stencil */
+ struct st_renderbuffer *strb = st_renderbuffer(depthRb);
+
+ if (strb->surface) {
+ if (check_clear_depth_stencil_with_quad(ctx, depthRb))
+ quad_buffers |= PIPE_CLEAR_DEPTHSTENCIL;
+ else
+ clear_buffers |= PIPE_CLEAR_DEPTHSTENCIL;
+ }
+ }
+ else {
+ /* separate depth/stencil clears */
+ /* I don't think truly separate buffers are actually possible in gallium or hw? */
+ if (mask & BUFFER_BIT_DEPTH) {
+ struct st_renderbuffer *strb = st_renderbuffer(depthRb);
+
+ if (strb->surface) {
+ if (check_clear_depth_with_quad(ctx, depthRb,
+ st->clear.enable_ds_separate))
+ quad_buffers |= PIPE_CLEAR_DEPTH;
+ else
+ clear_buffers |= PIPE_CLEAR_DEPTH;
+ }
+ }
+ if (mask & BUFFER_BIT_STENCIL) {
+ struct st_renderbuffer *strb = st_renderbuffer(stencilRb);
+
+ if (strb->surface) {
+ if (check_clear_stencil_with_quad(ctx, stencilRb,
+ st->clear.enable_ds_separate))
+ quad_buffers |= PIPE_CLEAR_STENCIL;
+ else
+ clear_buffers |= PIPE_CLEAR_STENCIL;
+ }
+ }
+ }
+
+ /*
+ * If we're going to use clear_with_quad() for any reason, use it for
+ * everything possible.
+ */
+ if (quad_buffers) {
+ quad_buffers |= clear_buffers;
+ clear_with_quad(ctx,
+ quad_buffers & PIPE_CLEAR_COLOR,
+ quad_buffers & PIPE_CLEAR_DEPTH,
+ quad_buffers & PIPE_CLEAR_STENCIL);
+ } else if (clear_buffers) {
+ /* driver cannot know it can clear everything if the buffer
+ * is a combined depth/stencil buffer but this wasn't actually
+ * required from the visual. Hence fix this up to avoid potential
+ * read-modify-write in the driver.
+ */
+ float clearColor[4];
+
+ if ((clear_buffers & PIPE_CLEAR_DEPTHSTENCIL) &&
+ ((clear_buffers & PIPE_CLEAR_DEPTHSTENCIL) != PIPE_CLEAR_DEPTHSTENCIL) &&
+ (depthRb == stencilRb) &&
+ (ctx->DrawBuffer->Visual.depthBits == 0 ||
+ ctx->DrawBuffer->Visual.stencilBits == 0))
+ clear_buffers |= PIPE_CLEAR_DEPTHSTENCIL;
+
+ if (ctx->DrawBuffer->_ColorDrawBuffers[0]) {
+ st_translate_color(ctx->Color.ClearColor,
+ ctx->DrawBuffer->_ColorDrawBuffers[0]->_BaseFormat,
+ clearColor);
+ }
+
+ st->pipe->clear(st->pipe, clear_buffers, ctx->Color.ClearColorUnclamped,
+ ctx->Depth.Clear, ctx->Stencil.Clear);
+ }
+ if (mask & BUFFER_BIT_ACCUM)
+ st_clear_accum_buffer(ctx,
+ ctx->DrawBuffer->Attachment[BUFFER_ACCUM].Renderbuffer);
+}
+
+
+void
+st_init_clear_functions(struct dd_function_table *functions)
+{
+ functions->Clear = st_Clear;
+}
diff --git a/mesalib/src/mesa/state_tracker/st_cb_drawpixels.c b/mesalib/src/mesa/state_tracker/st_cb_drawpixels.c
index 9948f8d2b..a197bf3ca 100644
--- a/mesalib/src/mesa/state_tracker/st_cb_drawpixels.c
+++ b/mesalib/src/mesa/state_tracker/st_cb_drawpixels.c
@@ -1,1542 +1,1542 @@
-/**************************************************************************
- *
- * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas.
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sub license, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice (including the
- * next paragraph) shall be included in all copies or substantial portions
- * of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
- * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
- * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- **************************************************************************/
-
- /*
- * Authors:
- * Brian Paul
- */
-
-#include "main/imports.h"
-#include "main/image.h"
-#include "main/bufferobj.h"
-#include "main/macros.h"
-#include "main/mfeatures.h"
-#include "main/mtypes.h"
-#include "main/pack.h"
-#include "main/pbo.h"
-#include "main/texformat.h"
-#include "main/teximage.h"
-#include "main/texstore.h"
-#include "program/program.h"
-#include "program/prog_print.h"
-#include "program/prog_instruction.h"
-
-#include "st_atom.h"
-#include "st_atom_constbuf.h"
-#include "st_cb_drawpixels.h"
-#include "st_cb_readpixels.h"
-#include "st_cb_fbo.h"
-#include "st_context.h"
-#include "st_debug.h"
-#include "st_format.h"
-#include "st_program.h"
-#include "st_texture.h"
-
-#include "pipe/p_context.h"
-#include "pipe/p_defines.h"
-#include "tgsi/tgsi_ureg.h"
-#include "util/u_draw_quad.h"
-#include "util/u_format.h"
-#include "util/u_inlines.h"
-#include "util/u_math.h"
-#include "util/u_tile.h"
-#include "cso_cache/cso_context.h"
-
-
-#if FEATURE_drawpix
-
-/**
- * Check if the given program is:
- * 0: MOVE result.color, fragment.color;
- * 1: END;
- */
-static GLboolean
-is_passthrough_program(const struct gl_fragment_program *prog)
-{
- if (prog->Base.NumInstructions == 2) {
- const struct prog_instruction *inst = prog->Base.Instructions;
- if (inst[0].Opcode == OPCODE_MOV &&
- inst[1].Opcode == OPCODE_END &&
- inst[0].DstReg.File == PROGRAM_OUTPUT &&
- inst[0].DstReg.Index == FRAG_RESULT_COLOR &&
- inst[0].DstReg.WriteMask == WRITEMASK_XYZW &&
- inst[0].SrcReg[0].File == PROGRAM_INPUT &&
- inst[0].SrcReg[0].Index == FRAG_ATTRIB_COL0 &&
- inst[0].SrcReg[0].Swizzle == SWIZZLE_XYZW) {
- return GL_TRUE;
- }
- }
- return GL_FALSE;
-}
-
-
-
-/**
- * Make fragment shader for glDraw/CopyPixels. This shader is made
- * by combining the pixel transfer shader with the user-defined shader.
- * \param fpIn the current/incoming fragment program
- * \param fpOut returns the combined fragment program
- */
-void
-st_make_drawpix_fragment_program(struct st_context *st,
- struct gl_fragment_program *fpIn,
- struct gl_fragment_program **fpOut)
-{
- struct gl_program *newProg;
-
- if (is_passthrough_program(fpIn)) {
- newProg = (struct gl_program *) _mesa_clone_fragment_program(st->ctx,
- &st->pixel_xfer.program->Base);
- }
- else {
-#if 0
- /* debug */
- printf("Base program:\n");
- _mesa_print_program(&fpIn->Base);
- printf("DrawPix program:\n");
- _mesa_print_program(&st->pixel_xfer.program->Base.Base);
-#endif
- newProg = _mesa_combine_programs(st->ctx,
- &st->pixel_xfer.program->Base.Base,
- &fpIn->Base);
- }
-
-#if 0
- /* debug */
- printf("Combined DrawPixels program:\n");
- _mesa_print_program(newProg);
- printf("InputsRead: 0x%x\n", newProg->InputsRead);
- printf("OutputsWritten: 0x%x\n", newProg->OutputsWritten);
- _mesa_print_parameter_list(newProg->Parameters);
-#endif
-
- *fpOut = (struct gl_fragment_program *) newProg;
-}
-
-
-/**
- * Create fragment program that does a TEX() instruction to get a Z and/or
- * stencil value value, then writes to FRAG_RESULT_DEPTH/FRAG_RESULT_STENCIL.
- * Used for glDrawPixels(GL_DEPTH_COMPONENT / GL_STENCIL_INDEX).
- * Pass fragment color through as-is.
- * \return pointer to the gl_fragment program
- */
-struct gl_fragment_program *
-st_make_drawpix_z_stencil_program(struct st_context *st,
- GLboolean write_depth,
- GLboolean write_stencil)
-{
- struct gl_context *ctx = st->ctx;
- struct gl_program *p;
- struct gl_fragment_program *fp;
- GLuint ic = 0;
- const GLuint shaderIndex = write_depth * 2 + write_stencil;
-
- assert(shaderIndex < Elements(st->drawpix.shaders));
-
- if (st->drawpix.shaders[shaderIndex]) {
- /* already have the proper shader */
- return st->drawpix.shaders[shaderIndex];
- }
-
- /*
- * Create shader now
- */
- p = ctx->Driver.NewProgram(ctx, GL_FRAGMENT_PROGRAM_ARB, 0);
- if (!p)
- return NULL;
-
- p->NumInstructions = write_depth ? 2 : 1;
- p->NumInstructions += write_stencil ? 1 : 0;
-
- p->Instructions = _mesa_alloc_instructions(p->NumInstructions);
- if (!p->Instructions) {
- ctx->Driver.DeleteProgram(ctx, p);
- return NULL;
- }
- _mesa_init_instructions(p->Instructions, p->NumInstructions);
-
- if (write_depth) {
- /* TEX result.depth, fragment.texcoord[0], texture[0], 2D; */
- p->Instructions[ic].Opcode = OPCODE_TEX;
- p->Instructions[ic].DstReg.File = PROGRAM_OUTPUT;
- p->Instructions[ic].DstReg.Index = FRAG_RESULT_DEPTH;
- p->Instructions[ic].DstReg.WriteMask = WRITEMASK_Z;
- p->Instructions[ic].SrcReg[0].File = PROGRAM_INPUT;
- p->Instructions[ic].SrcReg[0].Index = FRAG_ATTRIB_TEX0;
- p->Instructions[ic].TexSrcUnit = 0;
- p->Instructions[ic].TexSrcTarget = TEXTURE_2D_INDEX;
- ic++;
- }
-
- if (write_stencil) {
- /* TEX result.stencil, fragment.texcoord[0], texture[0], 2D; */
- p->Instructions[ic].Opcode = OPCODE_TEX;
- p->Instructions[ic].DstReg.File = PROGRAM_OUTPUT;
- p->Instructions[ic].DstReg.Index = FRAG_RESULT_STENCIL;
- p->Instructions[ic].DstReg.WriteMask = WRITEMASK_Y;
- p->Instructions[ic].SrcReg[0].File = PROGRAM_INPUT;
- p->Instructions[ic].SrcReg[0].Index = FRAG_ATTRIB_TEX0;
- p->Instructions[ic].TexSrcUnit = 1;
- p->Instructions[ic].TexSrcTarget = TEXTURE_2D_INDEX;
- ic++;
- }
-
- /* END; */
- p->Instructions[ic++].Opcode = OPCODE_END;
-
- assert(ic == p->NumInstructions);
-
- p->InputsRead = FRAG_BIT_TEX0 | FRAG_BIT_COL0;
- p->OutputsWritten = 0;
- if (write_depth)
- p->OutputsWritten |= BITFIELD64_BIT(FRAG_RESULT_DEPTH);
- if (write_stencil)
- p->OutputsWritten |= BITFIELD64_BIT(FRAG_RESULT_STENCIL);
-
- p->SamplersUsed = 0x1; /* sampler 0 (bit 0) is used */
- if (write_stencil)
- p->SamplersUsed |= 1 << 1;
-
- fp = (struct gl_fragment_program *) p;
-
- /* save the new shader */
- st->drawpix.shaders[shaderIndex] = fp;
-
- return fp;
-}
-
-
-/**
- * Create a simple vertex shader that just passes through the
- * vertex position and texcoord (and optionally, color).
- */
-static void *
-make_passthrough_vertex_shader(struct st_context *st,
- GLboolean passColor)
-{
- if (!st->drawpix.vert_shaders[passColor]) {
- struct ureg_program *ureg = ureg_create( TGSI_PROCESSOR_VERTEX );
-
- if (ureg == NULL)
- return NULL;
-
- /* MOV result.pos, vertex.pos; */
- ureg_MOV(ureg,
- ureg_DECL_output( ureg, TGSI_SEMANTIC_POSITION, 0 ),
- ureg_DECL_vs_input( ureg, 0 ));
-
- /* MOV result.texcoord0, vertex.attr[1]; */
- ureg_MOV(ureg,
- ureg_DECL_output( ureg, TGSI_SEMANTIC_GENERIC, 0 ),
- ureg_DECL_vs_input( ureg, 1 ));
-
- if (passColor) {
- /* MOV result.color0, vertex.attr[2]; */
- ureg_MOV(ureg,
- ureg_DECL_output( ureg, TGSI_SEMANTIC_COLOR, 0 ),
- ureg_DECL_vs_input( ureg, 2 ));
- }
-
- ureg_END( ureg );
-
- st->drawpix.vert_shaders[passColor] =
- ureg_create_shader_and_destroy( ureg, st->pipe );
- }
-
- return st->drawpix.vert_shaders[passColor];
-}
-
-
-/**
- * Return a texture base format for drawing/copying an image
- * of the given format.
- */
-static GLenum
-base_format(GLenum format)
-{
- switch (format) {
- case GL_DEPTH_COMPONENT:
- return GL_DEPTH_COMPONENT;
- case GL_DEPTH_STENCIL:
- return GL_DEPTH_STENCIL;
- case GL_STENCIL_INDEX:
- return GL_STENCIL_INDEX;
- default:
- return GL_RGBA;
- }
-}
-
-
-/**
- * Return a texture internalFormat for drawing/copying an image
- * of the given format and type.
- */
-static GLenum
-internal_format(struct gl_context *ctx, GLenum format, GLenum type)
-{
- switch (format) {
- case GL_DEPTH_COMPONENT:
- return GL_DEPTH_COMPONENT;
- case GL_DEPTH_STENCIL:
- return GL_DEPTH_STENCIL;
- case GL_STENCIL_INDEX:
- return GL_STENCIL_INDEX;
- default:
- if (_mesa_is_integer_format(format)) {
- switch (type) {
- case GL_BYTE:
- return GL_RGBA8I;
- case GL_UNSIGNED_BYTE:
- return GL_RGBA8UI;
- case GL_SHORT:
- return GL_RGBA16I;
- case GL_UNSIGNED_SHORT:
- return GL_RGBA16UI;
- case GL_INT:
- return GL_RGBA32I;
- case GL_UNSIGNED_INT:
- return GL_RGBA32UI;
- default:
- assert(0 && "Unexpected type in internal_format()");
- return GL_RGBA_INTEGER;
- }
- }
- else {
- switch (type) {
- case GL_UNSIGNED_BYTE:
- case GL_UNSIGNED_INT_8_8_8_8:
- case GL_UNSIGNED_INT_8_8_8_8_REV:
- default:
- return GL_RGBA8;
-
- case GL_UNSIGNED_BYTE_3_3_2:
- case GL_UNSIGNED_BYTE_2_3_3_REV:
- case GL_UNSIGNED_SHORT_4_4_4_4:
- case GL_UNSIGNED_SHORT_4_4_4_4_REV:
- return GL_RGBA4;
-
- case GL_UNSIGNED_SHORT_5_6_5:
- case GL_UNSIGNED_SHORT_5_6_5_REV:
- case GL_UNSIGNED_SHORT_5_5_5_1:
- case GL_UNSIGNED_SHORT_1_5_5_5_REV:
- return GL_RGB5_A1;
-
- case GL_UNSIGNED_INT_10_10_10_2:
- case GL_UNSIGNED_INT_2_10_10_10_REV:
- return GL_RGB10_A2;
-
- case GL_UNSIGNED_SHORT:
- case GL_UNSIGNED_INT:
- return GL_RGBA16;
-
- case GL_BYTE:
- return
- ctx->Extensions.EXT_texture_snorm ? GL_RGBA8_SNORM : GL_RGBA8;
-
- case GL_SHORT:
- case GL_INT:
- return
- ctx->Extensions.EXT_texture_snorm ? GL_RGBA16_SNORM : GL_RGBA16;
-
- case GL_HALF_FLOAT_ARB:
- return
- ctx->Extensions.ARB_texture_float ? GL_RGBA16F :
- ctx->Extensions.EXT_texture_snorm ? GL_RGBA16_SNORM : GL_RGBA16;
-
- case GL_FLOAT:
- case GL_DOUBLE:
- return
- ctx->Extensions.ARB_texture_float ? GL_RGBA32F :
- ctx->Extensions.EXT_texture_snorm ? GL_RGBA16_SNORM : GL_RGBA16;
-
- case GL_UNSIGNED_INT_5_9_9_9_REV:
- assert(ctx->Extensions.EXT_texture_shared_exponent);
- return GL_RGB9_E5;
-
- case GL_UNSIGNED_INT_10F_11F_11F_REV:
- assert(ctx->Extensions.EXT_packed_float);
- return GL_R11F_G11F_B10F;
- }
- }
- }
-}
-
-
-/**
- * Create a temporary texture to hold an image of the given size.
- * If width, height are not POT and the driver only handles POT textures,
- * allocate the next larger size of texture that is POT.
- */
-static struct pipe_resource *
-alloc_texture(struct st_context *st, GLsizei width, GLsizei height,
- enum pipe_format texFormat)
-{
- struct pipe_resource *pt;
-
- pt = st_texture_create(st, st->internal_target, texFormat, 0,
- width, height, 1, 1, PIPE_BIND_SAMPLER_VIEW);
-
- return pt;
-}
-
-
-/**
- * Make texture containing an image for glDrawPixels image.
- * If 'pixels' is NULL, leave the texture image data undefined.
- */
-static struct pipe_resource *
-make_texture(struct st_context *st,
- GLsizei width, GLsizei height, GLenum format, GLenum type,
- const struct gl_pixelstore_attrib *unpack,
- const GLvoid *pixels)
-{
- struct gl_context *ctx = st->ctx;
- struct pipe_context *pipe = st->pipe;
- gl_format mformat;
- struct pipe_resource *pt;
- enum pipe_format pipeFormat;
- GLenum baseInternalFormat, intFormat;
-
- intFormat = internal_format(ctx, format, type);
- baseInternalFormat = _mesa_base_tex_format(ctx, intFormat);
-
- mformat = st_ChooseTextureFormat_renderable(ctx, intFormat,
- format, type, GL_FALSE);
- assert(mformat);
-
- pipeFormat = st_mesa_format_to_pipe_format(mformat);
- assert(pipeFormat);
-
- pixels = _mesa_map_pbo_source(ctx, unpack, pixels);
- if (!pixels)
- return NULL;
-
- /* alloc temporary texture */
- pt = alloc_texture(st, width, height, pipeFormat);
- if (!pt) {
- _mesa_unmap_pbo_source(ctx, unpack);
- return NULL;
- }
-
- {
- struct pipe_transfer *transfer;
- static const GLuint dstImageOffsets = 0;
- GLboolean success;
- GLubyte *dest;
- const GLbitfield imageTransferStateSave = ctx->_ImageTransferState;
-
- /* we'll do pixel transfer in a fragment shader */
- ctx->_ImageTransferState = 0x0;
-
- transfer = pipe_get_transfer(st->pipe, pt, 0, 0,
- PIPE_TRANSFER_WRITE, 0, 0,
- width, height);
-
- /* map texture transfer */
- dest = pipe_transfer_map(pipe, transfer);
-
-
- /* Put image into texture transfer.
- * Note that the image is actually going to be upside down in
- * the texture. We deal with that with texcoords.
- */
- success = _mesa_texstore(ctx, 2, /* dims */
- baseInternalFormat, /* baseInternalFormat */
- mformat, /* gl_format */
- dest, /* dest */
- 0, 0, 0, /* dstX/Y/Zoffset */
- transfer->stride, /* dstRowStride, bytes */
- &dstImageOffsets, /* dstImageOffsets */
- width, height, 1, /* size */
- format, type, /* src format/type */
- pixels, /* data source */
- unpack);
-
- /* unmap */
- pipe_transfer_unmap(pipe, transfer);
- pipe->transfer_destroy(pipe, transfer);
-
- assert(success);
-
- /* restore */
- ctx->_ImageTransferState = imageTransferStateSave;
- }
-
- _mesa_unmap_pbo_source(ctx, unpack);
-
- return pt;
-}
-
-
-/**
- * Draw quad with texcoords and optional color.
- * Coords are gallium window coords with y=0=top.
- * \param color may be null
- * \param invertTex if true, flip texcoords vertically
- */
-static void
-draw_quad(struct gl_context *ctx, GLfloat x0, GLfloat y0, GLfloat z,
- GLfloat x1, GLfloat y1, const GLfloat *color,
- GLboolean invertTex, GLfloat maxXcoord, GLfloat maxYcoord)
-{
- struct st_context *st = st_context(ctx);
- struct pipe_context *pipe = st->pipe;
- GLfloat verts[4][3][4]; /* four verts, three attribs, XYZW */
-
- /* setup vertex data */
- {
- const struct gl_framebuffer *fb = st->ctx->DrawBuffer;
- const GLfloat fb_width = (GLfloat) fb->Width;
- const GLfloat fb_height = (GLfloat) fb->Height;
- const GLfloat clip_x0 = x0 / fb_width * 2.0f - 1.0f;
- const GLfloat clip_y0 = y0 / fb_height * 2.0f - 1.0f;
- const GLfloat clip_x1 = x1 / fb_width * 2.0f - 1.0f;
- const GLfloat clip_y1 = y1 / fb_height * 2.0f - 1.0f;
- const GLfloat sLeft = 0.0f, sRight = maxXcoord;
- const GLfloat tTop = invertTex ? maxYcoord : 0.0f;
- const GLfloat tBot = invertTex ? 0.0f : maxYcoord;
- GLuint i;
-
- /* upper-left */
- verts[0][0][0] = clip_x0; /* v[0].attr[0].x */
- verts[0][0][1] = clip_y0; /* v[0].attr[0].y */
-
- /* upper-right */
- verts[1][0][0] = clip_x1;
- verts[1][0][1] = clip_y0;
-
- /* lower-right */
- verts[2][0][0] = clip_x1;
- verts[2][0][1] = clip_y1;
-
- /* lower-left */
- verts[3][0][0] = clip_x0;
- verts[3][0][1] = clip_y1;
-
- verts[0][1][0] = sLeft; /* v[0].attr[1].S */
- verts[0][1][1] = tTop; /* v[0].attr[1].T */
- verts[1][1][0] = sRight;
- verts[1][1][1] = tTop;
- verts[2][1][0] = sRight;
- verts[2][1][1] = tBot;
- verts[3][1][0] = sLeft;
- verts[3][1][1] = tBot;
-
- /* same for all verts: */
- if (color) {
- for (i = 0; i < 4; i++) {
- verts[i][0][2] = z; /* v[i].attr[0].z */
- verts[i][0][3] = 1.0f; /* v[i].attr[0].w */
- verts[i][2][0] = color[0]; /* v[i].attr[2].r */
- verts[i][2][1] = color[1]; /* v[i].attr[2].g */
- verts[i][2][2] = color[2]; /* v[i].attr[2].b */
- verts[i][2][3] = color[3]; /* v[i].attr[2].a */
- verts[i][1][2] = 0.0f; /* v[i].attr[1].R */
- verts[i][1][3] = 1.0f; /* v[i].attr[1].Q */
- }
- }
- else {
- for (i = 0; i < 4; i++) {
- verts[i][0][2] = z; /*Z*/
- verts[i][0][3] = 1.0f; /*W*/
- verts[i][1][2] = 0.0f; /*R*/
- verts[i][1][3] = 1.0f; /*Q*/
- }
- }
- }
-
- {
- struct pipe_resource *buf;
-
- /* allocate/load buffer object with vertex data */
- buf = pipe_buffer_create(pipe->screen,
- PIPE_BIND_VERTEX_BUFFER,
- PIPE_USAGE_STATIC,
- sizeof(verts));
- pipe_buffer_write(st->pipe, buf, 0, sizeof(verts), verts);
-
- util_draw_vertex_buffer(pipe, st->cso_context, buf, 0,
- PIPE_PRIM_QUADS,
- 4, /* verts */
- 3); /* attribs/vert */
- pipe_resource_reference(&buf, NULL);
- }
-}
-
-
-
-static void
-draw_textured_quad(struct gl_context *ctx, GLint x, GLint y, GLfloat z,
- GLsizei width, GLsizei height,
- GLfloat zoomX, GLfloat zoomY,
- struct pipe_sampler_view **sv,
- int num_sampler_view,
- void *driver_vp,
- void *driver_fp,
- const GLfloat *color,
- GLboolean invertTex,
- GLboolean write_depth, GLboolean write_stencil)
-{
- struct st_context *st = st_context(ctx);
- struct pipe_context *pipe = st->pipe;
- struct cso_context *cso = st->cso_context;
- GLfloat x0, y0, x1, y1;
- GLsizei maxSize;
- boolean normalized = sv[0]->texture->target != PIPE_TEXTURE_RECT;
-
- /* limit checks */
- /* XXX if DrawPixels image is larger than max texture size, break
- * it up into chunks.
- */
- maxSize = 1 << (pipe->screen->get_param(pipe->screen,
- PIPE_CAP_MAX_TEXTURE_2D_LEVELS) - 1);
- assert(width <= maxSize);
- assert(height <= maxSize);
-
- cso_save_rasterizer(cso);
- cso_save_viewport(cso);
- cso_save_samplers(cso);
- cso_save_fragment_sampler_views(cso);
- cso_save_fragment_shader(cso);
- cso_save_vertex_shader(cso);
- cso_save_vertex_elements(cso);
- cso_save_vertex_buffers(cso);
- if (write_stencil) {
- cso_save_depth_stencil_alpha(cso);
- cso_save_blend(cso);
- }
-
- /* rasterizer state: just scissor */
- {
- struct pipe_rasterizer_state rasterizer;
- memset(&rasterizer, 0, sizeof(rasterizer));
- rasterizer.clamp_fragment_color = ctx->Color._ClampFragmentColor;
- rasterizer.gl_rasterization_rules = 1;
- rasterizer.scissor = ctx->Scissor.Enabled;
- cso_set_rasterizer(cso, &rasterizer);
- }
-
- if (write_stencil) {
- /* Stencil writing bypasses the normal fragment pipeline to
- * disable color writing and set stencil test to always pass.
- */
- struct pipe_depth_stencil_alpha_state dsa;
- struct pipe_blend_state blend;
-
- /* depth/stencil */
- memset(&dsa, 0, sizeof(dsa));
- dsa.stencil[0].enabled = 1;
- dsa.stencil[0].func = PIPE_FUNC_ALWAYS;
- dsa.stencil[0].writemask = ctx->Stencil.WriteMask[0] & 0xff;
- dsa.stencil[0].zpass_op = PIPE_STENCIL_OP_REPLACE;
- if (write_depth) {
- /* writing depth+stencil: depth test always passes */
- dsa.depth.enabled = 1;
- dsa.depth.writemask = ctx->Depth.Mask;
- dsa.depth.func = PIPE_FUNC_ALWAYS;
- }
- cso_set_depth_stencil_alpha(cso, &dsa);
-
- /* blend (colormask) */
- memset(&blend, 0, sizeof(blend));
- cso_set_blend(cso, &blend);
- }
-
- /* fragment shader state: TEX lookup program */
- cso_set_fragment_shader_handle(cso, driver_fp);
-
- /* vertex shader state: position + texcoord pass-through */
- cso_set_vertex_shader_handle(cso, driver_vp);
-
-
- /* texture sampling state: */
- {
- struct pipe_sampler_state sampler;
- memset(&sampler, 0, sizeof(sampler));
- sampler.wrap_s = PIPE_TEX_WRAP_CLAMP;
- sampler.wrap_t = PIPE_TEX_WRAP_CLAMP;
- sampler.wrap_r = PIPE_TEX_WRAP_CLAMP;
- sampler.min_img_filter = PIPE_TEX_FILTER_NEAREST;
- sampler.min_mip_filter = PIPE_TEX_MIPFILTER_NONE;
- sampler.mag_img_filter = PIPE_TEX_FILTER_NEAREST;
- sampler.normalized_coords = normalized;
-
- cso_single_sampler(cso, 0, &sampler);
- if (num_sampler_view > 1) {
- cso_single_sampler(cso, 1, &sampler);
- }
- cso_single_sampler_done(cso);
- }
-
- /* viewport state: viewport matching window dims */
- {
- const float w = (float) ctx->DrawBuffer->Width;
- const float h = (float) ctx->DrawBuffer->Height;
- struct pipe_viewport_state vp;
- vp.scale[0] = 0.5f * w;
- vp.scale[1] = -0.5f * h;
- vp.scale[2] = 0.5f;
- vp.scale[3] = 1.0f;
- vp.translate[0] = 0.5f * w;
- vp.translate[1] = 0.5f * h;
- vp.translate[2] = 0.5f;
- vp.translate[3] = 0.0f;
- cso_set_viewport(cso, &vp);
- }
-
- cso_set_vertex_elements(cso, 3, st->velems_util_draw);
-
- /* texture state: */
- cso_set_fragment_sampler_views(cso, num_sampler_view, sv);
-
- /* Compute Gallium window coords (y=0=top) with pixel zoom.
- * Recall that these coords are transformed by the current
- * vertex shader and viewport transformation.
- */
- if (st_fb_orientation(ctx->DrawBuffer) == Y_0_BOTTOM) {
- y = ctx->DrawBuffer->Height - (int) (y + height * ctx->Pixel.ZoomY);
- invertTex = !invertTex;
- }
-
- x0 = (GLfloat) x;
- x1 = x + width * ctx->Pixel.ZoomX;
- y0 = (GLfloat) y;
- y1 = y + height * ctx->Pixel.ZoomY;
-
- /* convert Z from [0,1] to [-1,-1] to match viewport Z scale/bias */
- z = z * 2.0 - 1.0;
-
- draw_quad(ctx, x0, y0, z, x1, y1, color, invertTex,
- normalized ? ((GLfloat) width / sv[0]->texture->width0) : (GLfloat)width,
- normalized ? ((GLfloat) height / sv[0]->texture->height0) : (GLfloat)height);
-
- /* restore state */
- cso_restore_rasterizer(cso);
- cso_restore_viewport(cso);
- cso_restore_samplers(cso);
- cso_restore_fragment_sampler_views(cso);
- cso_restore_fragment_shader(cso);
- cso_restore_vertex_shader(cso);
- cso_restore_vertex_elements(cso);
- cso_restore_vertex_buffers(cso);
- if (write_stencil) {
- cso_restore_depth_stencil_alpha(cso);
- cso_restore_blend(cso);
- }
-}
-
-
-/**
- * Software fallback to do glDrawPixels(GL_STENCIL_INDEX) when we
- * can't use a fragment shader to write stencil values.
- */
-static void
-draw_stencil_pixels(struct gl_context *ctx, GLint x, GLint y,
- GLsizei width, GLsizei height, GLenum format, GLenum type,
- const struct gl_pixelstore_attrib *unpack,
- const GLvoid *pixels)
-{
- struct st_context *st = st_context(ctx);
- struct pipe_context *pipe = st->pipe;
- struct st_renderbuffer *strb;
- enum pipe_transfer_usage usage;
- struct pipe_transfer *pt;
- const GLboolean zoom = ctx->Pixel.ZoomX != 1.0 || ctx->Pixel.ZoomY != 1.0;
- GLint skipPixels;
- ubyte *stmap;
- struct gl_pixelstore_attrib clippedUnpack = *unpack;
-
- if (!zoom) {
- if (!_mesa_clip_drawpixels(ctx, &x, &y, &width, &height,
- &clippedUnpack)) {
- /* totally clipped */
- return;
- }
- }
-
- strb = st_renderbuffer(ctx->DrawBuffer->
- Attachment[BUFFER_STENCIL].Renderbuffer);
-
- if (st_fb_orientation(ctx->DrawBuffer) == Y_0_TOP) {
- y = ctx->DrawBuffer->Height - y - height;
- }
-
- if(format != GL_DEPTH_STENCIL &&
- util_format_get_component_bits(strb->format,
- UTIL_FORMAT_COLORSPACE_ZS, 0) != 0)
- usage = PIPE_TRANSFER_READ_WRITE;
- else
- usage = PIPE_TRANSFER_WRITE;
-
- pt = pipe_get_transfer(st_context(ctx)->pipe, strb->texture, 0, 0,
- usage, x, y,
- width, height);
-
- stmap = pipe_transfer_map(pipe, pt);
-
- pixels = _mesa_map_pbo_source(ctx, &clippedUnpack, pixels);
- assert(pixels);
-
- /* if width > MAX_WIDTH, have to process image in chunks */
- skipPixels = 0;
- while (skipPixels < width) {
- const GLint spanX = skipPixels;
- const GLint spanWidth = MIN2(width - skipPixels, MAX_WIDTH);
- GLint row;
- for (row = 0; row < height; row++) {
- GLubyte sValues[MAX_WIDTH];
- GLuint zValues[MAX_WIDTH];
- GLenum destType = GL_UNSIGNED_BYTE;
- const GLvoid *source = _mesa_image_address2d(&clippedUnpack, pixels,
- width, height,
- format, type,
- row, skipPixels);
- _mesa_unpack_stencil_span(ctx, spanWidth, destType, sValues,
- type, source, &clippedUnpack,
- ctx->_ImageTransferState);
-
- if (format == GL_DEPTH_STENCIL) {
- _mesa_unpack_depth_span(ctx, spanWidth, GL_UNSIGNED_INT, zValues,
- (1 << 24) - 1, type, source,
- &clippedUnpack);
- }
-
- if (zoom) {
- _mesa_problem(ctx, "Gallium glDrawPixels(GL_STENCIL) with "
- "zoom not complete");
- }
-
- {
- GLint spanY;
-
- if (st_fb_orientation(ctx->DrawBuffer) == Y_0_TOP) {
- spanY = height - row - 1;
- }
- else {
- spanY = row;
- }
-
- /* now pack the stencil (and Z) values in the dest format */
- switch (pt->resource->format) {
- case PIPE_FORMAT_S8_USCALED:
- {
- ubyte *dest = stmap + spanY * pt->stride + spanX;
- assert(usage == PIPE_TRANSFER_WRITE);
- memcpy(dest, sValues, spanWidth);
- }
- break;
- case PIPE_FORMAT_Z24_UNORM_S8_USCALED:
- if (format == GL_DEPTH_STENCIL) {
- uint *dest = (uint *) (stmap + spanY * pt->stride + spanX*4);
- GLint k;
- assert(usage == PIPE_TRANSFER_WRITE);
- for (k = 0; k < spanWidth; k++) {
- dest[k] = zValues[k] | (sValues[k] << 24);
- }
- }
- else {
- uint *dest = (uint *) (stmap + spanY * pt->stride + spanX*4);
- GLint k;
- assert(usage == PIPE_TRANSFER_READ_WRITE);
- for (k = 0; k < spanWidth; k++) {
- dest[k] = (dest[k] & 0xffffff) | (sValues[k] << 24);
- }
- }
- break;
- case PIPE_FORMAT_S8_USCALED_Z24_UNORM:
- if (format == GL_DEPTH_STENCIL) {
- uint *dest = (uint *) (stmap + spanY * pt->stride + spanX*4);
- GLint k;
- assert(usage == PIPE_TRANSFER_WRITE);
- for (k = 0; k < spanWidth; k++) {
- dest[k] = (zValues[k] << 8) | (sValues[k] & 0xff);
- }
- }
- else {
- uint *dest = (uint *) (stmap + spanY * pt->stride + spanX*4);
- GLint k;
- assert(usage == PIPE_TRANSFER_READ_WRITE);
- for (k = 0; k < spanWidth; k++) {
- dest[k] = (dest[k] & 0xffffff00) | (sValues[k] & 0xff);
- }
- }
- break;
- default:
- assert(0);
- }
- }
- }
- skipPixels += spanWidth;
- }
-
- _mesa_unmap_pbo_source(ctx, &clippedUnpack);
-
- /* unmap the stencil buffer */
- pipe_transfer_unmap(pipe, pt);
- pipe->transfer_destroy(pipe, pt);
-}
-
-
-/**
- * Get fragment program variant for a glDrawPixels or glCopyPixels
- * command for RGBA data.
- */
-static struct st_fp_variant *
-get_color_fp_variant(struct st_context *st)
-{
- struct gl_context *ctx = st->ctx;
- struct st_fp_variant_key key;
- struct st_fp_variant *fpv;
-
- memset(&key, 0, sizeof(key));
-
- key.st = st;
- key.drawpixels = 1;
- key.scaleAndBias = (ctx->Pixel.RedBias != 0.0 ||
- ctx->Pixel.RedScale != 1.0 ||
- ctx->Pixel.GreenBias != 0.0 ||
- ctx->Pixel.GreenScale != 1.0 ||
- ctx->Pixel.BlueBias != 0.0 ||
- ctx->Pixel.BlueScale != 1.0 ||
- ctx->Pixel.AlphaBias != 0.0 ||
- ctx->Pixel.AlphaScale != 1.0);
- key.pixelMaps = ctx->Pixel.MapColorFlag;
-
- fpv = st_get_fp_variant(st, st->fp, &key);
-
- return fpv;
-}
-
-
-/**
- * Get fragment program variant for a glDrawPixels or glCopyPixels
- * command for depth/stencil data.
- */
-static struct st_fp_variant *
-get_depth_stencil_fp_variant(struct st_context *st, GLboolean write_depth,
- GLboolean write_stencil)
-{
- struct st_fp_variant_key key;
- struct st_fp_variant *fpv;
-
- memset(&key, 0, sizeof(key));
-
- key.st = st;
- key.drawpixels = 1;
- key.drawpixels_z = write_depth;
- key.drawpixels_stencil = write_stencil;
-
- fpv = st_get_fp_variant(st, st->fp, &key);
-
- return fpv;
-}
-
-
-/**
- * Called via ctx->Driver.DrawPixels()
- */
-static void
-st_DrawPixels(struct gl_context *ctx, GLint x, GLint y,
- GLsizei width, GLsizei height,
- GLenum format, GLenum type,
- const struct gl_pixelstore_attrib *unpack, const GLvoid *pixels)
-{
- void *driver_vp, *driver_fp;
- struct st_context *st = st_context(ctx);
- const GLfloat *color;
- struct pipe_context *pipe = st->pipe;
- GLboolean write_stencil = GL_FALSE, write_depth = GL_FALSE;
- struct pipe_sampler_view *sv[2];
- int num_sampler_view = 1;
- enum pipe_format stencil_format = PIPE_FORMAT_NONE;
- struct st_fp_variant *fpv;
-
- if (format == GL_DEPTH_STENCIL)
- write_stencil = write_depth = GL_TRUE;
- else if (format == GL_STENCIL_INDEX)
- write_stencil = GL_TRUE;
- else if (format == GL_DEPTH_COMPONENT)
- write_depth = GL_TRUE;
-
- if (write_stencil) {
- enum pipe_format tex_format;
- /* can we write to stencil if not fallback */
- if (!pipe->screen->get_param(pipe->screen, PIPE_CAP_SHADER_STENCIL_EXPORT))
- goto stencil_fallback;
-
- tex_format = st_choose_format(st->pipe->screen, base_format(format),
- PIPE_TEXTURE_2D,
- 0, PIPE_BIND_SAMPLER_VIEW);
- if (tex_format == PIPE_FORMAT_Z24_UNORM_S8_USCALED)
- stencil_format = PIPE_FORMAT_X24S8_USCALED;
- else if (tex_format == PIPE_FORMAT_S8_USCALED_Z24_UNORM)
- stencil_format = PIPE_FORMAT_S8X24_USCALED;
- else
- stencil_format = PIPE_FORMAT_S8_USCALED;
- if (stencil_format == PIPE_FORMAT_NONE)
- goto stencil_fallback;
- }
-
- /* Mesa state should be up to date by now */
- assert(ctx->NewState == 0x0);
-
- st_validate_state(st);
-
- /*
- * Get vertex/fragment shaders
- */
- if (write_depth || write_stencil) {
- fpv = get_depth_stencil_fp_variant(st, write_depth, write_stencil);
-
- driver_fp = fpv->driver_shader;
-
- driver_vp = make_passthrough_vertex_shader(st, GL_TRUE);
-
- color = ctx->Current.RasterColor;
- }
- else {
- fpv = get_color_fp_variant(st);
-
- driver_fp = fpv->driver_shader;
-
- driver_vp = make_passthrough_vertex_shader(st, GL_FALSE);
-
- color = NULL;
- if (st->pixel_xfer.pixelmap_enabled) {
- sv[1] = st->pixel_xfer.pixelmap_sampler_view;
- num_sampler_view++;
- }
- }
-
- /* update fragment program constants */
- st_upload_constants(st, fpv->parameters, PIPE_SHADER_FRAGMENT);
-
- /* draw with textured quad */
- {
- struct pipe_resource *pt
- = make_texture(st, width, height, format, type, unpack, pixels);
- if (pt) {
- sv[0] = st_create_texture_sampler_view(st->pipe, pt);
-
- if (sv[0]) {
- if (write_stencil) {
- sv[1] = st_create_texture_sampler_view_format(st->pipe, pt,
- stencil_format);
- num_sampler_view++;
- }
-
- draw_textured_quad(ctx, x, y, ctx->Current.RasterPos[2],
- width, height,
- ctx->Pixel.ZoomX, ctx->Pixel.ZoomY,
- sv,
- num_sampler_view,
- driver_vp,
- driver_fp,
- color, GL_FALSE, write_depth, write_stencil);
- pipe_sampler_view_reference(&sv[0], NULL);
- if (num_sampler_view > 1)
- pipe_sampler_view_reference(&sv[1], NULL);
- }
- pipe_resource_reference(&pt, NULL);
- }
- }
- return;
-
-stencil_fallback:
- draw_stencil_pixels(ctx, x, y, width, height, format, type,
- unpack, pixels);
-}
-
-
-
-/**
- * Software fallback for glCopyPixels(GL_STENCIL).
- */
-static void
-copy_stencil_pixels(struct gl_context *ctx, GLint srcx, GLint srcy,
- GLsizei width, GLsizei height,
- GLint dstx, GLint dsty)
-{
- struct st_renderbuffer *rbDraw;
- struct pipe_context *pipe = st_context(ctx)->pipe;
- enum pipe_transfer_usage usage;
- struct pipe_transfer *ptDraw;
- ubyte *drawMap;
- ubyte *buffer;
- int i;
-
- buffer = malloc(width * height * sizeof(ubyte));
- if (!buffer) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyPixels(stencil)");
- return;
- }
-
- /* Get the dest renderbuffer. If there's a wrapper, use the
- * underlying renderbuffer.
- */
- rbDraw = st_renderbuffer(ctx->DrawBuffer->_StencilBuffer);
- if (rbDraw->Base.Wrapped)
- rbDraw = st_renderbuffer(rbDraw->Base.Wrapped);
-
- /* this will do stencil pixel transfer ops */
- st_read_stencil_pixels(ctx, srcx, srcy, width, height,
- GL_STENCIL_INDEX, GL_UNSIGNED_BYTE,
- &ctx->DefaultPacking, buffer);
-
- if (0) {
- /* debug code: dump stencil values */
- GLint row, col;
- for (row = 0; row < height; row++) {
- printf("%3d: ", row);
- for (col = 0; col < width; col++) {
- printf("%02x ", buffer[col + row * width]);
- }
- printf("\n");
- }
- }
-
- if (util_format_get_component_bits(rbDraw->format,
- UTIL_FORMAT_COLORSPACE_ZS, 0) != 0)
- usage = PIPE_TRANSFER_READ_WRITE;
- else
- usage = PIPE_TRANSFER_WRITE;
-
- if (st_fb_orientation(ctx->DrawBuffer) == Y_0_TOP) {
- dsty = rbDraw->Base.Height - dsty - height;
- }
-
- ptDraw = pipe_get_transfer(st_context(ctx)->pipe,
- rbDraw->texture, 0, 0,
- usage, dstx, dsty,
- width, height);
-
- assert(util_format_get_blockwidth(ptDraw->resource->format) == 1);
- assert(util_format_get_blockheight(ptDraw->resource->format) == 1);
-
- /* map the stencil buffer */
- drawMap = pipe_transfer_map(pipe, ptDraw);
-
- /* draw */
- /* XXX PixelZoom not handled yet */
- for (i = 0; i < height; i++) {
- ubyte *dst;
- const ubyte *src;
- int y;
-
- y = i;
-
- if (st_fb_orientation(ctx->DrawBuffer) == Y_0_TOP) {
- y = height - y - 1;
- }
-
- dst = drawMap + y * ptDraw->stride;
- src = buffer + i * width;
-
- switch (ptDraw->resource->format) {
- case PIPE_FORMAT_Z24_UNORM_S8_USCALED:
- {
- uint *dst4 = (uint *) dst;
- int j;
- assert(usage == PIPE_TRANSFER_READ_WRITE);
- for (j = 0; j < width; j++) {
- *dst4 = (*dst4 & 0xffffff) | (src[j] << 24);
- dst4++;
- }
- }
- break;
- case PIPE_FORMAT_S8_USCALED_Z24_UNORM:
- {
- uint *dst4 = (uint *) dst;
- int j;
- assert(usage == PIPE_TRANSFER_READ_WRITE);
- for (j = 0; j < width; j++) {
- *dst4 = (*dst4 & 0xffffff00) | (src[j] & 0xff);
- dst4++;
- }
- }
- break;
- case PIPE_FORMAT_S8_USCALED:
- assert(usage == PIPE_TRANSFER_WRITE);
- memcpy(dst, src, width);
- break;
- default:
- assert(0);
- }
- }
-
- free(buffer);
-
- /* unmap the stencil buffer */
- pipe_transfer_unmap(pipe, ptDraw);
- pipe->transfer_destroy(pipe, ptDraw);
-}
-
-
-/** Do the src/dest regions overlap? */
-static GLboolean
-regions_overlap(GLint srcX, GLint srcY, GLint dstX, GLint dstY,
- GLsizei width, GLsizei height)
-{
- if (srcX + width <= dstX ||
- dstX + width <= srcX ||
- srcY + height <= dstY ||
- dstY + height <= srcY)
- return GL_FALSE;
- else
- return GL_TRUE;
-}
-
-
-/**
- * Try to do a glCopyPixels for simple cases with a blit by calling
- * pipe->resource_copy_region().
- *
- * We can do this when we're copying color pixels (depth/stencil
- * eventually) with no pixel zoom, no pixel transfer ops, no
- * per-fragment ops, the src/dest regions don't overlap and the
- * src/dest pixel formats are the same.
- */
-static GLboolean
-blit_copy_pixels(struct gl_context *ctx, GLint srcx, GLint srcy,
- GLsizei width, GLsizei height,
- GLint dstx, GLint dsty, GLenum type)
-{
- struct st_context *st = st_context(ctx);
- struct pipe_context *pipe = st->pipe;
- struct gl_pixelstore_attrib pack, unpack;
- GLint readX, readY, readW, readH;
-
- if (type == GL_COLOR &&
- ctx->Pixel.ZoomX == 1.0 &&
- ctx->Pixel.ZoomY == 1.0 &&
- ctx->_ImageTransferState == 0x0 &&
- !ctx->Color.BlendEnabled &&
- !ctx->Color.AlphaEnabled &&
- !ctx->Depth.Test &&
- !ctx->Fog.Enabled &&
- !ctx->Stencil.Enabled &&
- !ctx->FragmentProgram.Enabled &&
- !ctx->VertexProgram.Enabled &&
- !ctx->Shader.CurrentFragmentProgram &&
- st_fb_orientation(ctx->ReadBuffer) == st_fb_orientation(ctx->DrawBuffer) &&
- ctx->DrawBuffer->_NumColorDrawBuffers == 1) {
- struct st_renderbuffer *rbRead, *rbDraw;
- GLint drawX, drawY;
-
- /*
- * Clip the read region against the src buffer bounds.
- * We'll still allocate a temporary buffer/texture for the original
- * src region size but we'll only read the region which is on-screen.
- * This may mean that we draw garbage pixels into the dest region, but
- * that's expected.
- */
- readX = srcx;
- readY = srcy;
- readW = width;
- readH = height;
- pack = ctx->DefaultPacking;
- if (!_mesa_clip_readpixels(ctx, &readX, &readY, &readW, &readH, &pack))
- return GL_TRUE; /* all done */
-
- /* clip against dest buffer bounds and scissor box */
- drawX = dstx + pack.SkipPixels;
- drawY = dsty + pack.SkipRows;
- unpack = pack;
- if (!_mesa_clip_drawpixels(ctx, &drawX, &drawY, &readW, &readH, &unpack))
- return GL_TRUE; /* all done */
-
- readX = readX - pack.SkipPixels + unpack.SkipPixels;
- readY = readY - pack.SkipRows + unpack.SkipRows;
-
- rbRead = st_get_color_read_renderbuffer(ctx);
- rbDraw = st_renderbuffer(ctx->DrawBuffer->_ColorDrawBuffers[0]);
-
- if ((rbRead != rbDraw ||
- !regions_overlap(readX, readY, drawX, drawY, readW, readH)) &&
- rbRead->Base.Format == rbDraw->Base.Format) {
- struct pipe_box srcBox;
-
- /* flip src/dst position if needed */
- if (st_fb_orientation(ctx->ReadBuffer) == Y_0_TOP) {
- /* both buffers will have the same orientation */
- readY = ctx->ReadBuffer->Height - readY - readH;
- drawY = ctx->DrawBuffer->Height - drawY - readH;
- }
-
- u_box_2d(readX, readY, readW, readH, &srcBox);
-
- pipe->resource_copy_region(pipe,
- rbDraw->texture, 0, drawX, drawY, 0,
- rbRead->texture, 0, &srcBox);
- return GL_TRUE;
- }
- }
-
- return GL_FALSE;
-}
-
-
-static void
-st_CopyPixels(struct gl_context *ctx, GLint srcx, GLint srcy,
- GLsizei width, GLsizei height,
- GLint dstx, GLint dsty, GLenum type)
-{
- struct st_context *st = st_context(ctx);
- struct pipe_context *pipe = st->pipe;
- struct pipe_screen *screen = pipe->screen;
- struct st_renderbuffer *rbRead;
- void *driver_vp, *driver_fp;
- struct pipe_resource *pt;
- struct pipe_sampler_view *sv[2];
- int num_sampler_view = 1;
- GLfloat *color;
- enum pipe_format srcFormat, texFormat;
- GLboolean invertTex = GL_FALSE;
- GLint readX, readY, readW, readH;
- GLuint sample_count;
- struct gl_pixelstore_attrib pack = ctx->DefaultPacking;
- struct st_fp_variant *fpv;
-
- st_validate_state(st);
-
- if (type == GL_STENCIL) {
- /* can't use texturing to do stencil */
- copy_stencil_pixels(ctx, srcx, srcy, width, height, dstx, dsty);
- return;
- }
-
- if (blit_copy_pixels(ctx, srcx, srcy, width, height, dstx, dsty, type))
- return;
-
- /*
- * The subsequent code implements glCopyPixels by copying the source
- * pixels into a temporary texture that's then applied to a textured quad.
- * When we draw the textured quad, all the usual per-fragment operations
- * are handled.
- */
-
-
- /*
- * Get vertex/fragment shaders
- */
- if (type == GL_COLOR) {
- rbRead = st_get_color_read_renderbuffer(ctx);
- color = NULL;
-
- fpv = get_color_fp_variant(st);
- driver_fp = fpv->driver_shader;
-
- driver_vp = make_passthrough_vertex_shader(st, GL_FALSE);
-
- if (st->pixel_xfer.pixelmap_enabled) {
- sv[1] = st->pixel_xfer.pixelmap_sampler_view;
- num_sampler_view++;
- }
- }
- else {
- assert(type == GL_DEPTH);
- rbRead = st_renderbuffer(ctx->ReadBuffer->_DepthBuffer);
- color = ctx->Current.Attrib[VERT_ATTRIB_COLOR0];
-
- fpv = get_depth_stencil_fp_variant(st, GL_TRUE, GL_FALSE);
- driver_fp = fpv->driver_shader;
-
- driver_vp = make_passthrough_vertex_shader(st, GL_TRUE);
- }
-
- /* update fragment program constants */
- st_upload_constants(st, fpv->parameters, PIPE_SHADER_FRAGMENT);
-
-
- if (rbRead->Base.Wrapped)
- rbRead = st_renderbuffer(rbRead->Base.Wrapped);
-
- sample_count = rbRead->texture->nr_samples;
- /* I believe this would be legal, presumably would need to do a resolve
- for color, and for depth/stencil spec says to just use one of the
- depth/stencil samples per pixel? Need some transfer clarifications. */
- assert(sample_count < 2);
-
- srcFormat = rbRead->texture->format;
-
- if (screen->is_format_supported(screen, srcFormat, st->internal_target,
- sample_count,
- PIPE_BIND_SAMPLER_VIEW)) {
- texFormat = srcFormat;
- }
- else {
- /* srcFormat can't be used as a texture format */
- if (type == GL_DEPTH) {
- texFormat = st_choose_format(screen, GL_DEPTH_COMPONENT,
- st->internal_target, sample_count,
- PIPE_BIND_DEPTH_STENCIL);
- assert(texFormat != PIPE_FORMAT_NONE);
- }
- else {
- /* default color format */
- texFormat = st_choose_format(screen, GL_RGBA, st->internal_target,
- sample_count, PIPE_BIND_SAMPLER_VIEW);
- assert(texFormat != PIPE_FORMAT_NONE);
- }
- }
-
- /* Invert src region if needed */
- if (st_fb_orientation(ctx->ReadBuffer) == Y_0_TOP) {
- srcy = ctx->ReadBuffer->Height - srcy - height;
- invertTex = !invertTex;
- }
-
- /* Clip the read region against the src buffer bounds.
- * We'll still allocate a temporary buffer/texture for the original
- * src region size but we'll only read the region which is on-screen.
- * This may mean that we draw garbage pixels into the dest region, but
- * that's expected.
- */
- readX = srcx;
- readY = srcy;
- readW = width;
- readH = height;
- _mesa_clip_readpixels(ctx, &readX, &readY, &readW, &readH, &pack);
- readW = MAX2(0, readW);
- readH = MAX2(0, readH);
-
- /* alloc temporary texture */
- pt = alloc_texture(st, width, height, texFormat);
- if (!pt)
- return;
-
- sv[0] = st_create_texture_sampler_view(st->pipe, pt);
- if (!sv[0]) {
- pipe_resource_reference(&pt, NULL);
- return;
- }
-
- /* Make temporary texture which is a copy of the src region.
- */
- if (srcFormat == texFormat) {
- struct pipe_box src_box;
- u_box_2d(readX, readY, readW, readH, &src_box);
- /* copy source framebuffer surface into mipmap/texture */
- pipe->resource_copy_region(pipe,
- pt, /* dest tex */
- 0,
- pack.SkipPixels, pack.SkipRows, 0, /* dest pos */
- rbRead->texture, /* src tex */
- 0,
- &src_box);
-
- }
- else {
- /* CPU-based fallback/conversion */
- struct pipe_transfer *ptRead =
- pipe_get_transfer(st->pipe, rbRead->texture,
- 0, 0, /* level, layer */
- PIPE_TRANSFER_READ,
- readX, readY, readW, readH);
- struct pipe_transfer *ptTex;
- enum pipe_transfer_usage transfer_usage;
-
- if (ST_DEBUG & DEBUG_FALLBACK)
- debug_printf("%s: fallback processing\n", __FUNCTION__);
-
- if (type == GL_DEPTH && util_format_is_depth_and_stencil(pt->format))
- transfer_usage = PIPE_TRANSFER_READ_WRITE;
- else
- transfer_usage = PIPE_TRANSFER_WRITE;
-
- ptTex = pipe_get_transfer(st->pipe, pt, 0, 0, transfer_usage,
- 0, 0, width, height);
-
- /* copy image from ptRead surface to ptTex surface */
- if (type == GL_COLOR) {
- /* alternate path using get/put_tile() */
- GLfloat *buf = (GLfloat *) malloc(width * height * 4 * sizeof(GLfloat));
- enum pipe_format readFormat, drawFormat;
- readFormat = util_format_linear(rbRead->texture->format);
- drawFormat = util_format_linear(pt->format);
- pipe_get_tile_rgba_format(pipe, ptRead, 0, 0, readW, readH,
- readFormat, buf);
- pipe_put_tile_rgba_format(pipe, ptTex, pack.SkipPixels, pack.SkipRows,
- readW, readH, drawFormat, buf);
- free(buf);
- }
- else {
- /* GL_DEPTH */
- GLuint *buf = (GLuint *) malloc(width * height * sizeof(GLuint));
- pipe_get_tile_z(pipe, ptRead, 0, 0, readW, readH, buf);
- pipe_put_tile_z(pipe, ptTex, pack.SkipPixels, pack.SkipRows,
- readW, readH, buf);
- free(buf);
- }
-
- pipe->transfer_destroy(pipe, ptRead);
- pipe->transfer_destroy(pipe, ptTex);
- }
-
- /* OK, the texture 'pt' contains the src image/pixels. Now draw a
- * textured quad with that texture.
- */
- draw_textured_quad(ctx, dstx, dsty, ctx->Current.RasterPos[2],
- width, height, ctx->Pixel.ZoomX, ctx->Pixel.ZoomY,
- sv,
- num_sampler_view,
- driver_vp,
- driver_fp,
- color, invertTex, GL_FALSE, GL_FALSE);
-
- pipe_resource_reference(&pt, NULL);
- pipe_sampler_view_reference(&sv[0], NULL);
-}
-
-
-
-void st_init_drawpixels_functions(struct dd_function_table *functions)
-{
- functions->DrawPixels = st_DrawPixels;
- functions->CopyPixels = st_CopyPixels;
-}
-
-
-void
-st_destroy_drawpix(struct st_context *st)
-{
- GLuint i;
-
- for (i = 0; i < Elements(st->drawpix.shaders); i++) {
- if (st->drawpix.shaders[i])
- _mesa_reference_fragprog(st->ctx, &st->drawpix.shaders[i], NULL);
- }
-
- st_reference_fragprog(st, &st->pixel_xfer.combined_prog, NULL);
- if (st->drawpix.vert_shaders[0])
- ureg_free_tokens(st->drawpix.vert_shaders[0]);
- if (st->drawpix.vert_shaders[1])
- ureg_free_tokens(st->drawpix.vert_shaders[1]);
-}
-
-#endif /* FEATURE_drawpix */
+/**************************************************************************
+ *
+ * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ **************************************************************************/
+
+ /*
+ * Authors:
+ * Brian Paul
+ */
+
+#include "main/imports.h"
+#include "main/image.h"
+#include "main/bufferobj.h"
+#include "main/macros.h"
+#include "main/mfeatures.h"
+#include "main/mtypes.h"
+#include "main/pack.h"
+#include "main/pbo.h"
+#include "main/texformat.h"
+#include "main/teximage.h"
+#include "main/texstore.h"
+#include "program/program.h"
+#include "program/prog_print.h"
+#include "program/prog_instruction.h"
+
+#include "st_atom.h"
+#include "st_atom_constbuf.h"
+#include "st_cb_drawpixels.h"
+#include "st_cb_readpixels.h"
+#include "st_cb_fbo.h"
+#include "st_context.h"
+#include "st_debug.h"
+#include "st_format.h"
+#include "st_program.h"
+#include "st_texture.h"
+
+#include "pipe/p_context.h"
+#include "pipe/p_defines.h"
+#include "tgsi/tgsi_ureg.h"
+#include "util/u_draw_quad.h"
+#include "util/u_format.h"
+#include "util/u_inlines.h"
+#include "util/u_math.h"
+#include "util/u_tile.h"
+#include "cso_cache/cso_context.h"
+
+
+#if FEATURE_drawpix
+
+/**
+ * Check if the given program is:
+ * 0: MOVE result.color, fragment.color;
+ * 1: END;
+ */
+static GLboolean
+is_passthrough_program(const struct gl_fragment_program *prog)
+{
+ if (prog->Base.NumInstructions == 2) {
+ const struct prog_instruction *inst = prog->Base.Instructions;
+ if (inst[0].Opcode == OPCODE_MOV &&
+ inst[1].Opcode == OPCODE_END &&
+ inst[0].DstReg.File == PROGRAM_OUTPUT &&
+ inst[0].DstReg.Index == FRAG_RESULT_COLOR &&
+ inst[0].DstReg.WriteMask == WRITEMASK_XYZW &&
+ inst[0].SrcReg[0].File == PROGRAM_INPUT &&
+ inst[0].SrcReg[0].Index == FRAG_ATTRIB_COL0 &&
+ inst[0].SrcReg[0].Swizzle == SWIZZLE_XYZW) {
+ return GL_TRUE;
+ }
+ }
+ return GL_FALSE;
+}
+
+
+
+/**
+ * Make fragment shader for glDraw/CopyPixels. This shader is made
+ * by combining the pixel transfer shader with the user-defined shader.
+ * \param fpIn the current/incoming fragment program
+ * \param fpOut returns the combined fragment program
+ */
+void
+st_make_drawpix_fragment_program(struct st_context *st,
+ struct gl_fragment_program *fpIn,
+ struct gl_fragment_program **fpOut)
+{
+ struct gl_program *newProg;
+
+ if (is_passthrough_program(fpIn)) {
+ newProg = (struct gl_program *) _mesa_clone_fragment_program(st->ctx,
+ &st->pixel_xfer.program->Base);
+ }
+ else {
+#if 0
+ /* debug */
+ printf("Base program:\n");
+ _mesa_print_program(&fpIn->Base);
+ printf("DrawPix program:\n");
+ _mesa_print_program(&st->pixel_xfer.program->Base.Base);
+#endif
+ newProg = _mesa_combine_programs(st->ctx,
+ &st->pixel_xfer.program->Base.Base,
+ &fpIn->Base);
+ }
+
+#if 0
+ /* debug */
+ printf("Combined DrawPixels program:\n");
+ _mesa_print_program(newProg);
+ printf("InputsRead: 0x%x\n", newProg->InputsRead);
+ printf("OutputsWritten: 0x%x\n", newProg->OutputsWritten);
+ _mesa_print_parameter_list(newProg->Parameters);
+#endif
+
+ *fpOut = (struct gl_fragment_program *) newProg;
+}
+
+
+/**
+ * Create fragment program that does a TEX() instruction to get a Z and/or
+ * stencil value value, then writes to FRAG_RESULT_DEPTH/FRAG_RESULT_STENCIL.
+ * Used for glDrawPixels(GL_DEPTH_COMPONENT / GL_STENCIL_INDEX).
+ * Pass fragment color through as-is.
+ * \return pointer to the gl_fragment program
+ */
+struct gl_fragment_program *
+st_make_drawpix_z_stencil_program(struct st_context *st,
+ GLboolean write_depth,
+ GLboolean write_stencil)
+{
+ struct gl_context *ctx = st->ctx;
+ struct gl_program *p;
+ struct gl_fragment_program *fp;
+ GLuint ic = 0;
+ const GLuint shaderIndex = write_depth * 2 + write_stencil;
+
+ assert(shaderIndex < Elements(st->drawpix.shaders));
+
+ if (st->drawpix.shaders[shaderIndex]) {
+ /* already have the proper shader */
+ return st->drawpix.shaders[shaderIndex];
+ }
+
+ /*
+ * Create shader now
+ */
+ p = ctx->Driver.NewProgram(ctx, GL_FRAGMENT_PROGRAM_ARB, 0);
+ if (!p)
+ return NULL;
+
+ p->NumInstructions = write_depth ? 2 : 1;
+ p->NumInstructions += write_stencil ? 1 : 0;
+
+ p->Instructions = _mesa_alloc_instructions(p->NumInstructions);
+ if (!p->Instructions) {
+ ctx->Driver.DeleteProgram(ctx, p);
+ return NULL;
+ }
+ _mesa_init_instructions(p->Instructions, p->NumInstructions);
+
+ if (write_depth) {
+ /* TEX result.depth, fragment.texcoord[0], texture[0], 2D; */
+ p->Instructions[ic].Opcode = OPCODE_TEX;
+ p->Instructions[ic].DstReg.File = PROGRAM_OUTPUT;
+ p->Instructions[ic].DstReg.Index = FRAG_RESULT_DEPTH;
+ p->Instructions[ic].DstReg.WriteMask = WRITEMASK_Z;
+ p->Instructions[ic].SrcReg[0].File = PROGRAM_INPUT;
+ p->Instructions[ic].SrcReg[0].Index = FRAG_ATTRIB_TEX0;
+ p->Instructions[ic].TexSrcUnit = 0;
+ p->Instructions[ic].TexSrcTarget = TEXTURE_2D_INDEX;
+ ic++;
+ }
+
+ if (write_stencil) {
+ /* TEX result.stencil, fragment.texcoord[0], texture[0], 2D; */
+ p->Instructions[ic].Opcode = OPCODE_TEX;
+ p->Instructions[ic].DstReg.File = PROGRAM_OUTPUT;
+ p->Instructions[ic].DstReg.Index = FRAG_RESULT_STENCIL;
+ p->Instructions[ic].DstReg.WriteMask = WRITEMASK_Y;
+ p->Instructions[ic].SrcReg[0].File = PROGRAM_INPUT;
+ p->Instructions[ic].SrcReg[0].Index = FRAG_ATTRIB_TEX0;
+ p->Instructions[ic].TexSrcUnit = 1;
+ p->Instructions[ic].TexSrcTarget = TEXTURE_2D_INDEX;
+ ic++;
+ }
+
+ /* END; */
+ p->Instructions[ic++].Opcode = OPCODE_END;
+
+ assert(ic == p->NumInstructions);
+
+ p->InputsRead = FRAG_BIT_TEX0 | FRAG_BIT_COL0;
+ p->OutputsWritten = 0;
+ if (write_depth)
+ p->OutputsWritten |= BITFIELD64_BIT(FRAG_RESULT_DEPTH);
+ if (write_stencil)
+ p->OutputsWritten |= BITFIELD64_BIT(FRAG_RESULT_STENCIL);
+
+ p->SamplersUsed = 0x1; /* sampler 0 (bit 0) is used */
+ if (write_stencil)
+ p->SamplersUsed |= 1 << 1;
+
+ fp = (struct gl_fragment_program *) p;
+
+ /* save the new shader */
+ st->drawpix.shaders[shaderIndex] = fp;
+
+ return fp;
+}
+
+
+/**
+ * Create a simple vertex shader that just passes through the
+ * vertex position and texcoord (and optionally, color).
+ */
+static void *
+make_passthrough_vertex_shader(struct st_context *st,
+ GLboolean passColor)
+{
+ if (!st->drawpix.vert_shaders[passColor]) {
+ struct ureg_program *ureg = ureg_create( TGSI_PROCESSOR_VERTEX );
+
+ if (ureg == NULL)
+ return NULL;
+
+ /* MOV result.pos, vertex.pos; */
+ ureg_MOV(ureg,
+ ureg_DECL_output( ureg, TGSI_SEMANTIC_POSITION, 0 ),
+ ureg_DECL_vs_input( ureg, 0 ));
+
+ /* MOV result.texcoord0, vertex.attr[1]; */
+ ureg_MOV(ureg,
+ ureg_DECL_output( ureg, TGSI_SEMANTIC_GENERIC, 0 ),
+ ureg_DECL_vs_input( ureg, 1 ));
+
+ if (passColor) {
+ /* MOV result.color0, vertex.attr[2]; */
+ ureg_MOV(ureg,
+ ureg_DECL_output( ureg, TGSI_SEMANTIC_COLOR, 0 ),
+ ureg_DECL_vs_input( ureg, 2 ));
+ }
+
+ ureg_END( ureg );
+
+ st->drawpix.vert_shaders[passColor] =
+ ureg_create_shader_and_destroy( ureg, st->pipe );
+ }
+
+ return st->drawpix.vert_shaders[passColor];
+}
+
+
+/**
+ * Return a texture base format for drawing/copying an image
+ * of the given format.
+ */
+static GLenum
+base_format(GLenum format)
+{
+ switch (format) {
+ case GL_DEPTH_COMPONENT:
+ return GL_DEPTH_COMPONENT;
+ case GL_DEPTH_STENCIL:
+ return GL_DEPTH_STENCIL;
+ case GL_STENCIL_INDEX:
+ return GL_STENCIL_INDEX;
+ default:
+ return GL_RGBA;
+ }
+}
+
+
+/**
+ * Return a texture internalFormat for drawing/copying an image
+ * of the given format and type.
+ */
+static GLenum
+internal_format(struct gl_context *ctx, GLenum format, GLenum type)
+{
+ switch (format) {
+ case GL_DEPTH_COMPONENT:
+ return GL_DEPTH_COMPONENT;
+ case GL_DEPTH_STENCIL:
+ return GL_DEPTH_STENCIL;
+ case GL_STENCIL_INDEX:
+ return GL_STENCIL_INDEX;
+ default:
+ if (_mesa_is_integer_format(format)) {
+ switch (type) {
+ case GL_BYTE:
+ return GL_RGBA8I;
+ case GL_UNSIGNED_BYTE:
+ return GL_RGBA8UI;
+ case GL_SHORT:
+ return GL_RGBA16I;
+ case GL_UNSIGNED_SHORT:
+ return GL_RGBA16UI;
+ case GL_INT:
+ return GL_RGBA32I;
+ case GL_UNSIGNED_INT:
+ return GL_RGBA32UI;
+ default:
+ assert(0 && "Unexpected type in internal_format()");
+ return GL_RGBA_INTEGER;
+ }
+ }
+ else {
+ switch (type) {
+ case GL_UNSIGNED_BYTE:
+ case GL_UNSIGNED_INT_8_8_8_8:
+ case GL_UNSIGNED_INT_8_8_8_8_REV:
+ default:
+ return GL_RGBA8;
+
+ case GL_UNSIGNED_BYTE_3_3_2:
+ case GL_UNSIGNED_BYTE_2_3_3_REV:
+ case GL_UNSIGNED_SHORT_4_4_4_4:
+ case GL_UNSIGNED_SHORT_4_4_4_4_REV:
+ return GL_RGBA4;
+
+ case GL_UNSIGNED_SHORT_5_6_5:
+ case GL_UNSIGNED_SHORT_5_6_5_REV:
+ case GL_UNSIGNED_SHORT_5_5_5_1:
+ case GL_UNSIGNED_SHORT_1_5_5_5_REV:
+ return GL_RGB5_A1;
+
+ case GL_UNSIGNED_INT_10_10_10_2:
+ case GL_UNSIGNED_INT_2_10_10_10_REV:
+ return GL_RGB10_A2;
+
+ case GL_UNSIGNED_SHORT:
+ case GL_UNSIGNED_INT:
+ return GL_RGBA16;
+
+ case GL_BYTE:
+ return
+ ctx->Extensions.EXT_texture_snorm ? GL_RGBA8_SNORM : GL_RGBA8;
+
+ case GL_SHORT:
+ case GL_INT:
+ return
+ ctx->Extensions.EXT_texture_snorm ? GL_RGBA16_SNORM : GL_RGBA16;
+
+ case GL_HALF_FLOAT_ARB:
+ return
+ ctx->Extensions.ARB_texture_float ? GL_RGBA16F :
+ ctx->Extensions.EXT_texture_snorm ? GL_RGBA16_SNORM : GL_RGBA16;
+
+ case GL_FLOAT:
+ case GL_DOUBLE:
+ return
+ ctx->Extensions.ARB_texture_float ? GL_RGBA32F :
+ ctx->Extensions.EXT_texture_snorm ? GL_RGBA16_SNORM : GL_RGBA16;
+
+ case GL_UNSIGNED_INT_5_9_9_9_REV:
+ assert(ctx->Extensions.EXT_texture_shared_exponent);
+ return GL_RGB9_E5;
+
+ case GL_UNSIGNED_INT_10F_11F_11F_REV:
+ assert(ctx->Extensions.EXT_packed_float);
+ return GL_R11F_G11F_B10F;
+ }
+ }
+ }
+}
+
+
+/**
+ * Create a temporary texture to hold an image of the given size.
+ * If width, height are not POT and the driver only handles POT textures,
+ * allocate the next larger size of texture that is POT.
+ */
+static struct pipe_resource *
+alloc_texture(struct st_context *st, GLsizei width, GLsizei height,
+ enum pipe_format texFormat)
+{
+ struct pipe_resource *pt;
+
+ pt = st_texture_create(st, st->internal_target, texFormat, 0,
+ width, height, 1, 1, PIPE_BIND_SAMPLER_VIEW);
+
+ return pt;
+}
+
+
+/**
+ * Make texture containing an image for glDrawPixels image.
+ * If 'pixels' is NULL, leave the texture image data undefined.
+ */
+static struct pipe_resource *
+make_texture(struct st_context *st,
+ GLsizei width, GLsizei height, GLenum format, GLenum type,
+ const struct gl_pixelstore_attrib *unpack,
+ const GLvoid *pixels)
+{
+ struct gl_context *ctx = st->ctx;
+ struct pipe_context *pipe = st->pipe;
+ gl_format mformat;
+ struct pipe_resource *pt;
+ enum pipe_format pipeFormat;
+ GLenum baseInternalFormat, intFormat;
+
+ intFormat = internal_format(ctx, format, type);
+ baseInternalFormat = _mesa_base_tex_format(ctx, intFormat);
+
+ mformat = st_ChooseTextureFormat_renderable(ctx, intFormat,
+ format, type, GL_FALSE);
+ assert(mformat);
+
+ pipeFormat = st_mesa_format_to_pipe_format(mformat);
+ assert(pipeFormat);
+
+ pixels = _mesa_map_pbo_source(ctx, unpack, pixels);
+ if (!pixels)
+ return NULL;
+
+ /* alloc temporary texture */
+ pt = alloc_texture(st, width, height, pipeFormat);
+ if (!pt) {
+ _mesa_unmap_pbo_source(ctx, unpack);
+ return NULL;
+ }
+
+ {
+ struct pipe_transfer *transfer;
+ static const GLuint dstImageOffsets = 0;
+ GLboolean success;
+ GLubyte *dest;
+ const GLbitfield imageTransferStateSave = ctx->_ImageTransferState;
+
+ /* we'll do pixel transfer in a fragment shader */
+ ctx->_ImageTransferState = 0x0;
+
+ transfer = pipe_get_transfer(st->pipe, pt, 0, 0,
+ PIPE_TRANSFER_WRITE, 0, 0,
+ width, height);
+
+ /* map texture transfer */
+ dest = pipe_transfer_map(pipe, transfer);
+
+
+ /* Put image into texture transfer.
+ * Note that the image is actually going to be upside down in
+ * the texture. We deal with that with texcoords.
+ */
+ success = _mesa_texstore(ctx, 2, /* dims */
+ baseInternalFormat, /* baseInternalFormat */
+ mformat, /* gl_format */
+ dest, /* dest */
+ 0, 0, 0, /* dstX/Y/Zoffset */
+ transfer->stride, /* dstRowStride, bytes */
+ &dstImageOffsets, /* dstImageOffsets */
+ width, height, 1, /* size */
+ format, type, /* src format/type */
+ pixels, /* data source */
+ unpack);
+
+ /* unmap */
+ pipe_transfer_unmap(pipe, transfer);
+ pipe->transfer_destroy(pipe, transfer);
+
+ assert(success);
+
+ /* restore */
+ ctx->_ImageTransferState = imageTransferStateSave;
+ }
+
+ _mesa_unmap_pbo_source(ctx, unpack);
+
+ return pt;
+}
+
+
+/**
+ * Draw quad with texcoords and optional color.
+ * Coords are gallium window coords with y=0=top.
+ * \param color may be null
+ * \param invertTex if true, flip texcoords vertically
+ */
+static void
+draw_quad(struct gl_context *ctx, GLfloat x0, GLfloat y0, GLfloat z,
+ GLfloat x1, GLfloat y1, const GLfloat *color,
+ GLboolean invertTex, GLfloat maxXcoord, GLfloat maxYcoord)
+{
+ struct st_context *st = st_context(ctx);
+ struct pipe_context *pipe = st->pipe;
+ GLfloat verts[4][3][4]; /* four verts, three attribs, XYZW */
+
+ /* setup vertex data */
+ {
+ const struct gl_framebuffer *fb = st->ctx->DrawBuffer;
+ const GLfloat fb_width = (GLfloat) fb->Width;
+ const GLfloat fb_height = (GLfloat) fb->Height;
+ const GLfloat clip_x0 = x0 / fb_width * 2.0f - 1.0f;
+ const GLfloat clip_y0 = y0 / fb_height * 2.0f - 1.0f;
+ const GLfloat clip_x1 = x1 / fb_width * 2.0f - 1.0f;
+ const GLfloat clip_y1 = y1 / fb_height * 2.0f - 1.0f;
+ const GLfloat sLeft = 0.0f, sRight = maxXcoord;
+ const GLfloat tTop = invertTex ? maxYcoord : 0.0f;
+ const GLfloat tBot = invertTex ? 0.0f : maxYcoord;
+ GLuint i;
+
+ /* upper-left */
+ verts[0][0][0] = clip_x0; /* v[0].attr[0].x */
+ verts[0][0][1] = clip_y0; /* v[0].attr[0].y */
+
+ /* upper-right */
+ verts[1][0][0] = clip_x1;
+ verts[1][0][1] = clip_y0;
+
+ /* lower-right */
+ verts[2][0][0] = clip_x1;
+ verts[2][0][1] = clip_y1;
+
+ /* lower-left */
+ verts[3][0][0] = clip_x0;
+ verts[3][0][1] = clip_y1;
+
+ verts[0][1][0] = sLeft; /* v[0].attr[1].S */
+ verts[0][1][1] = tTop; /* v[0].attr[1].T */
+ verts[1][1][0] = sRight;
+ verts[1][1][1] = tTop;
+ verts[2][1][0] = sRight;
+ verts[2][1][1] = tBot;
+ verts[3][1][0] = sLeft;
+ verts[3][1][1] = tBot;
+
+ /* same for all verts: */
+ if (color) {
+ for (i = 0; i < 4; i++) {
+ verts[i][0][2] = z; /* v[i].attr[0].z */
+ verts[i][0][3] = 1.0f; /* v[i].attr[0].w */
+ verts[i][2][0] = color[0]; /* v[i].attr[2].r */
+ verts[i][2][1] = color[1]; /* v[i].attr[2].g */
+ verts[i][2][2] = color[2]; /* v[i].attr[2].b */
+ verts[i][2][3] = color[3]; /* v[i].attr[2].a */
+ verts[i][1][2] = 0.0f; /* v[i].attr[1].R */
+ verts[i][1][3] = 1.0f; /* v[i].attr[1].Q */
+ }
+ }
+ else {
+ for (i = 0; i < 4; i++) {
+ verts[i][0][2] = z; /*Z*/
+ verts[i][0][3] = 1.0f; /*W*/
+ verts[i][1][2] = 0.0f; /*R*/
+ verts[i][1][3] = 1.0f; /*Q*/
+ }
+ }
+ }
+
+ {
+ struct pipe_resource *buf;
+
+ /* allocate/load buffer object with vertex data */
+ buf = pipe_buffer_create(pipe->screen,
+ PIPE_BIND_VERTEX_BUFFER,
+ PIPE_USAGE_STATIC,
+ sizeof(verts));
+ pipe_buffer_write(st->pipe, buf, 0, sizeof(verts), verts);
+
+ util_draw_vertex_buffer(pipe, st->cso_context, buf, 0,
+ PIPE_PRIM_QUADS,
+ 4, /* verts */
+ 3); /* attribs/vert */
+ pipe_resource_reference(&buf, NULL);
+ }
+}
+
+
+
+static void
+draw_textured_quad(struct gl_context *ctx, GLint x, GLint y, GLfloat z,
+ GLsizei width, GLsizei height,
+ GLfloat zoomX, GLfloat zoomY,
+ struct pipe_sampler_view **sv,
+ int num_sampler_view,
+ void *driver_vp,
+ void *driver_fp,
+ const GLfloat *color,
+ GLboolean invertTex,
+ GLboolean write_depth, GLboolean write_stencil)
+{
+ struct st_context *st = st_context(ctx);
+ struct pipe_context *pipe = st->pipe;
+ struct cso_context *cso = st->cso_context;
+ GLfloat x0, y0, x1, y1;
+ GLsizei maxSize;
+ boolean normalized = sv[0]->texture->target != PIPE_TEXTURE_RECT;
+
+ /* limit checks */
+ /* XXX if DrawPixels image is larger than max texture size, break
+ * it up into chunks.
+ */
+ maxSize = 1 << (pipe->screen->get_param(pipe->screen,
+ PIPE_CAP_MAX_TEXTURE_2D_LEVELS) - 1);
+ assert(width <= maxSize);
+ assert(height <= maxSize);
+
+ cso_save_rasterizer(cso);
+ cso_save_viewport(cso);
+ cso_save_samplers(cso);
+ cso_save_fragment_sampler_views(cso);
+ cso_save_fragment_shader(cso);
+ cso_save_vertex_shader(cso);
+ cso_save_vertex_elements(cso);
+ cso_save_vertex_buffers(cso);
+ if (write_stencil) {
+ cso_save_depth_stencil_alpha(cso);
+ cso_save_blend(cso);
+ }
+
+ /* rasterizer state: just scissor */
+ {
+ struct pipe_rasterizer_state rasterizer;
+ memset(&rasterizer, 0, sizeof(rasterizer));
+ rasterizer.clamp_fragment_color = ctx->Color._ClampFragmentColor;
+ rasterizer.gl_rasterization_rules = 1;
+ rasterizer.scissor = ctx->Scissor.Enabled;
+ cso_set_rasterizer(cso, &rasterizer);
+ }
+
+ if (write_stencil) {
+ /* Stencil writing bypasses the normal fragment pipeline to
+ * disable color writing and set stencil test to always pass.
+ */
+ struct pipe_depth_stencil_alpha_state dsa;
+ struct pipe_blend_state blend;
+
+ /* depth/stencil */
+ memset(&dsa, 0, sizeof(dsa));
+ dsa.stencil[0].enabled = 1;
+ dsa.stencil[0].func = PIPE_FUNC_ALWAYS;
+ dsa.stencil[0].writemask = ctx->Stencil.WriteMask[0] & 0xff;
+ dsa.stencil[0].zpass_op = PIPE_STENCIL_OP_REPLACE;
+ if (write_depth) {
+ /* writing depth+stencil: depth test always passes */
+ dsa.depth.enabled = 1;
+ dsa.depth.writemask = ctx->Depth.Mask;
+ dsa.depth.func = PIPE_FUNC_ALWAYS;
+ }
+ cso_set_depth_stencil_alpha(cso, &dsa);
+
+ /* blend (colormask) */
+ memset(&blend, 0, sizeof(blend));
+ cso_set_blend(cso, &blend);
+ }
+
+ /* fragment shader state: TEX lookup program */
+ cso_set_fragment_shader_handle(cso, driver_fp);
+
+ /* vertex shader state: position + texcoord pass-through */
+ cso_set_vertex_shader_handle(cso, driver_vp);
+
+
+ /* texture sampling state: */
+ {
+ struct pipe_sampler_state sampler;
+ memset(&sampler, 0, sizeof(sampler));
+ sampler.wrap_s = PIPE_TEX_WRAP_CLAMP;
+ sampler.wrap_t = PIPE_TEX_WRAP_CLAMP;
+ sampler.wrap_r = PIPE_TEX_WRAP_CLAMP;
+ sampler.min_img_filter = PIPE_TEX_FILTER_NEAREST;
+ sampler.min_mip_filter = PIPE_TEX_MIPFILTER_NONE;
+ sampler.mag_img_filter = PIPE_TEX_FILTER_NEAREST;
+ sampler.normalized_coords = normalized;
+
+ cso_single_sampler(cso, 0, &sampler);
+ if (num_sampler_view > 1) {
+ cso_single_sampler(cso, 1, &sampler);
+ }
+ cso_single_sampler_done(cso);
+ }
+
+ /* viewport state: viewport matching window dims */
+ {
+ const float w = (float) ctx->DrawBuffer->Width;
+ const float h = (float) ctx->DrawBuffer->Height;
+ struct pipe_viewport_state vp;
+ vp.scale[0] = 0.5f * w;
+ vp.scale[1] = -0.5f * h;
+ vp.scale[2] = 0.5f;
+ vp.scale[3] = 1.0f;
+ vp.translate[0] = 0.5f * w;
+ vp.translate[1] = 0.5f * h;
+ vp.translate[2] = 0.5f;
+ vp.translate[3] = 0.0f;
+ cso_set_viewport(cso, &vp);
+ }
+
+ cso_set_vertex_elements(cso, 3, st->velems_util_draw);
+
+ /* texture state: */
+ cso_set_fragment_sampler_views(cso, num_sampler_view, sv);
+
+ /* Compute Gallium window coords (y=0=top) with pixel zoom.
+ * Recall that these coords are transformed by the current
+ * vertex shader and viewport transformation.
+ */
+ if (st_fb_orientation(ctx->DrawBuffer) == Y_0_BOTTOM) {
+ y = ctx->DrawBuffer->Height - (int) (y + height * ctx->Pixel.ZoomY);
+ invertTex = !invertTex;
+ }
+
+ x0 = (GLfloat) x;
+ x1 = x + width * ctx->Pixel.ZoomX;
+ y0 = (GLfloat) y;
+ y1 = y + height * ctx->Pixel.ZoomY;
+
+ /* convert Z from [0,1] to [-1,-1] to match viewport Z scale/bias */
+ z = z * 2.0 - 1.0;
+
+ draw_quad(ctx, x0, y0, z, x1, y1, color, invertTex,
+ normalized ? ((GLfloat) width / sv[0]->texture->width0) : (GLfloat)width,
+ normalized ? ((GLfloat) height / sv[0]->texture->height0) : (GLfloat)height);
+
+ /* restore state */
+ cso_restore_rasterizer(cso);
+ cso_restore_viewport(cso);
+ cso_restore_samplers(cso);
+ cso_restore_fragment_sampler_views(cso);
+ cso_restore_fragment_shader(cso);
+ cso_restore_vertex_shader(cso);
+ cso_restore_vertex_elements(cso);
+ cso_restore_vertex_buffers(cso);
+ if (write_stencil) {
+ cso_restore_depth_stencil_alpha(cso);
+ cso_restore_blend(cso);
+ }
+}
+
+
+/**
+ * Software fallback to do glDrawPixels(GL_STENCIL_INDEX) when we
+ * can't use a fragment shader to write stencil values.
+ */
+static void
+draw_stencil_pixels(struct gl_context *ctx, GLint x, GLint y,
+ GLsizei width, GLsizei height, GLenum format, GLenum type,
+ const struct gl_pixelstore_attrib *unpack,
+ const GLvoid *pixels)
+{
+ struct st_context *st = st_context(ctx);
+ struct pipe_context *pipe = st->pipe;
+ struct st_renderbuffer *strb;
+ enum pipe_transfer_usage usage;
+ struct pipe_transfer *pt;
+ const GLboolean zoom = ctx->Pixel.ZoomX != 1.0 || ctx->Pixel.ZoomY != 1.0;
+ GLint skipPixels;
+ ubyte *stmap;
+ struct gl_pixelstore_attrib clippedUnpack = *unpack;
+
+ if (!zoom) {
+ if (!_mesa_clip_drawpixels(ctx, &x, &y, &width, &height,
+ &clippedUnpack)) {
+ /* totally clipped */
+ return;
+ }
+ }
+
+ strb = st_renderbuffer(ctx->DrawBuffer->
+ Attachment[BUFFER_STENCIL].Renderbuffer);
+
+ if (st_fb_orientation(ctx->DrawBuffer) == Y_0_TOP) {
+ y = ctx->DrawBuffer->Height - y - height;
+ }
+
+ if(format != GL_DEPTH_STENCIL &&
+ util_format_get_component_bits(strb->format,
+ UTIL_FORMAT_COLORSPACE_ZS, 0) != 0)
+ usage = PIPE_TRANSFER_READ_WRITE;
+ else
+ usage = PIPE_TRANSFER_WRITE;
+
+ pt = pipe_get_transfer(st_context(ctx)->pipe, strb->texture, 0, 0,
+ usage, x, y,
+ width, height);
+
+ stmap = pipe_transfer_map(pipe, pt);
+
+ pixels = _mesa_map_pbo_source(ctx, &clippedUnpack, pixels);
+ assert(pixels);
+
+ /* if width > MAX_WIDTH, have to process image in chunks */
+ skipPixels = 0;
+ while (skipPixels < width) {
+ const GLint spanX = skipPixels;
+ const GLint spanWidth = MIN2(width - skipPixels, MAX_WIDTH);
+ GLint row;
+ for (row = 0; row < height; row++) {
+ GLubyte sValues[MAX_WIDTH];
+ GLuint zValues[MAX_WIDTH];
+ GLenum destType = GL_UNSIGNED_BYTE;
+ const GLvoid *source = _mesa_image_address2d(&clippedUnpack, pixels,
+ width, height,
+ format, type,
+ row, skipPixels);
+ _mesa_unpack_stencil_span(ctx, spanWidth, destType, sValues,
+ type, source, &clippedUnpack,
+ ctx->_ImageTransferState);
+
+ if (format == GL_DEPTH_STENCIL) {
+ _mesa_unpack_depth_span(ctx, spanWidth, GL_UNSIGNED_INT, zValues,
+ (1 << 24) - 1, type, source,
+ &clippedUnpack);
+ }
+
+ if (zoom) {
+ _mesa_problem(ctx, "Gallium glDrawPixels(GL_STENCIL) with "
+ "zoom not complete");
+ }
+
+ {
+ GLint spanY;
+
+ if (st_fb_orientation(ctx->DrawBuffer) == Y_0_TOP) {
+ spanY = height - row - 1;
+ }
+ else {
+ spanY = row;
+ }
+
+ /* now pack the stencil (and Z) values in the dest format */
+ switch (pt->resource->format) {
+ case PIPE_FORMAT_S8_USCALED:
+ {
+ ubyte *dest = stmap + spanY * pt->stride + spanX;
+ assert(usage == PIPE_TRANSFER_WRITE);
+ memcpy(dest, sValues, spanWidth);
+ }
+ break;
+ case PIPE_FORMAT_Z24_UNORM_S8_USCALED:
+ if (format == GL_DEPTH_STENCIL) {
+ uint *dest = (uint *) (stmap + spanY * pt->stride + spanX*4);
+ GLint k;
+ assert(usage == PIPE_TRANSFER_WRITE);
+ for (k = 0; k < spanWidth; k++) {
+ dest[k] = zValues[k] | (sValues[k] << 24);
+ }
+ }
+ else {
+ uint *dest = (uint *) (stmap + spanY * pt->stride + spanX*4);
+ GLint k;
+ assert(usage == PIPE_TRANSFER_READ_WRITE);
+ for (k = 0; k < spanWidth; k++) {
+ dest[k] = (dest[k] & 0xffffff) | (sValues[k] << 24);
+ }
+ }
+ break;
+ case PIPE_FORMAT_S8_USCALED_Z24_UNORM:
+ if (format == GL_DEPTH_STENCIL) {
+ uint *dest = (uint *) (stmap + spanY * pt->stride + spanX*4);
+ GLint k;
+ assert(usage == PIPE_TRANSFER_WRITE);
+ for (k = 0; k < spanWidth; k++) {
+ dest[k] = (zValues[k] << 8) | (sValues[k] & 0xff);
+ }
+ }
+ else {
+ uint *dest = (uint *) (stmap + spanY * pt->stride + spanX*4);
+ GLint k;
+ assert(usage == PIPE_TRANSFER_READ_WRITE);
+ for (k = 0; k < spanWidth; k++) {
+ dest[k] = (dest[k] & 0xffffff00) | (sValues[k] & 0xff);
+ }
+ }
+ break;
+ default:
+ assert(0);
+ }
+ }
+ }
+ skipPixels += spanWidth;
+ }
+
+ _mesa_unmap_pbo_source(ctx, &clippedUnpack);
+
+ /* unmap the stencil buffer */
+ pipe_transfer_unmap(pipe, pt);
+ pipe->transfer_destroy(pipe, pt);
+}
+
+
+/**
+ * Get fragment program variant for a glDrawPixels or glCopyPixels
+ * command for RGBA data.
+ */
+static struct st_fp_variant *
+get_color_fp_variant(struct st_context *st)
+{
+ struct gl_context *ctx = st->ctx;
+ struct st_fp_variant_key key;
+ struct st_fp_variant *fpv;
+
+ memset(&key, 0, sizeof(key));
+
+ key.st = st;
+ key.drawpixels = 1;
+ key.scaleAndBias = (ctx->Pixel.RedBias != 0.0 ||
+ ctx->Pixel.RedScale != 1.0 ||
+ ctx->Pixel.GreenBias != 0.0 ||
+ ctx->Pixel.GreenScale != 1.0 ||
+ ctx->Pixel.BlueBias != 0.0 ||
+ ctx->Pixel.BlueScale != 1.0 ||
+ ctx->Pixel.AlphaBias != 0.0 ||
+ ctx->Pixel.AlphaScale != 1.0);
+ key.pixelMaps = ctx->Pixel.MapColorFlag;
+
+ fpv = st_get_fp_variant(st, st->fp, &key);
+
+ return fpv;
+}
+
+
+/**
+ * Get fragment program variant for a glDrawPixels or glCopyPixels
+ * command for depth/stencil data.
+ */
+static struct st_fp_variant *
+get_depth_stencil_fp_variant(struct st_context *st, GLboolean write_depth,
+ GLboolean write_stencil)
+{
+ struct st_fp_variant_key key;
+ struct st_fp_variant *fpv;
+
+ memset(&key, 0, sizeof(key));
+
+ key.st = st;
+ key.drawpixels = 1;
+ key.drawpixels_z = write_depth;
+ key.drawpixels_stencil = write_stencil;
+
+ fpv = st_get_fp_variant(st, st->fp, &key);
+
+ return fpv;
+}
+
+
+/**
+ * Called via ctx->Driver.DrawPixels()
+ */
+static void
+st_DrawPixels(struct gl_context *ctx, GLint x, GLint y,
+ GLsizei width, GLsizei height,
+ GLenum format, GLenum type,
+ const struct gl_pixelstore_attrib *unpack, const GLvoid *pixels)
+{
+ void *driver_vp, *driver_fp;
+ struct st_context *st = st_context(ctx);
+ const GLfloat *color;
+ struct pipe_context *pipe = st->pipe;
+ GLboolean write_stencil = GL_FALSE, write_depth = GL_FALSE;
+ struct pipe_sampler_view *sv[2];
+ int num_sampler_view = 1;
+ enum pipe_format stencil_format = PIPE_FORMAT_NONE;
+ struct st_fp_variant *fpv;
+
+ if (format == GL_DEPTH_STENCIL)
+ write_stencil = write_depth = GL_TRUE;
+ else if (format == GL_STENCIL_INDEX)
+ write_stencil = GL_TRUE;
+ else if (format == GL_DEPTH_COMPONENT)
+ write_depth = GL_TRUE;
+
+ if (write_stencil) {
+ enum pipe_format tex_format;
+ /* can we write to stencil if not fallback */
+ if (!pipe->screen->get_param(pipe->screen, PIPE_CAP_SHADER_STENCIL_EXPORT))
+ goto stencil_fallback;
+
+ tex_format = st_choose_format(st->pipe->screen, base_format(format),
+ PIPE_TEXTURE_2D,
+ 0, PIPE_BIND_SAMPLER_VIEW);
+ if (tex_format == PIPE_FORMAT_Z24_UNORM_S8_USCALED)
+ stencil_format = PIPE_FORMAT_X24S8_USCALED;
+ else if (tex_format == PIPE_FORMAT_S8_USCALED_Z24_UNORM)
+ stencil_format = PIPE_FORMAT_S8X24_USCALED;
+ else
+ stencil_format = PIPE_FORMAT_S8_USCALED;
+ if (stencil_format == PIPE_FORMAT_NONE)
+ goto stencil_fallback;
+ }
+
+ /* Mesa state should be up to date by now */
+ assert(ctx->NewState == 0x0);
+
+ st_validate_state(st);
+
+ /*
+ * Get vertex/fragment shaders
+ */
+ if (write_depth || write_stencil) {
+ fpv = get_depth_stencil_fp_variant(st, write_depth, write_stencil);
+
+ driver_fp = fpv->driver_shader;
+
+ driver_vp = make_passthrough_vertex_shader(st, GL_TRUE);
+
+ color = ctx->Current.RasterColor;
+ }
+ else {
+ fpv = get_color_fp_variant(st);
+
+ driver_fp = fpv->driver_shader;
+
+ driver_vp = make_passthrough_vertex_shader(st, GL_FALSE);
+
+ color = NULL;
+ if (st->pixel_xfer.pixelmap_enabled) {
+ sv[1] = st->pixel_xfer.pixelmap_sampler_view;
+ num_sampler_view++;
+ }
+ }
+
+ /* update fragment program constants */
+ st_upload_constants(st, fpv->parameters, PIPE_SHADER_FRAGMENT);
+
+ /* draw with textured quad */
+ {
+ struct pipe_resource *pt
+ = make_texture(st, width, height, format, type, unpack, pixels);
+ if (pt) {
+ sv[0] = st_create_texture_sampler_view(st->pipe, pt);
+
+ if (sv[0]) {
+ if (write_stencil) {
+ sv[1] = st_create_texture_sampler_view_format(st->pipe, pt,
+ stencil_format);
+ num_sampler_view++;
+ }
+
+ draw_textured_quad(ctx, x, y, ctx->Current.RasterPos[2],
+ width, height,
+ ctx->Pixel.ZoomX, ctx->Pixel.ZoomY,
+ sv,
+ num_sampler_view,
+ driver_vp,
+ driver_fp,
+ color, GL_FALSE, write_depth, write_stencil);
+ pipe_sampler_view_reference(&sv[0], NULL);
+ if (num_sampler_view > 1)
+ pipe_sampler_view_reference(&sv[1], NULL);
+ }
+ pipe_resource_reference(&pt, NULL);
+ }
+ }
+ return;
+
+stencil_fallback:
+ draw_stencil_pixels(ctx, x, y, width, height, format, type,
+ unpack, pixels);
+}
+
+
+
+/**
+ * Software fallback for glCopyPixels(GL_STENCIL).
+ */
+static void
+copy_stencil_pixels(struct gl_context *ctx, GLint srcx, GLint srcy,
+ GLsizei width, GLsizei height,
+ GLint dstx, GLint dsty)
+{
+ struct st_renderbuffer *rbDraw;
+ struct pipe_context *pipe = st_context(ctx)->pipe;
+ enum pipe_transfer_usage usage;
+ struct pipe_transfer *ptDraw;
+ ubyte *drawMap;
+ ubyte *buffer;
+ int i;
+
+ buffer = malloc(width * height * sizeof(ubyte));
+ if (!buffer) {
+ _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyPixels(stencil)");
+ return;
+ }
+
+ /* Get the dest renderbuffer. If there's a wrapper, use the
+ * underlying renderbuffer.
+ */
+ rbDraw = st_renderbuffer(ctx->DrawBuffer->_StencilBuffer);
+ if (rbDraw->Base.Wrapped)
+ rbDraw = st_renderbuffer(rbDraw->Base.Wrapped);
+
+ /* this will do stencil pixel transfer ops */
+ st_read_stencil_pixels(ctx, srcx, srcy, width, height,
+ GL_STENCIL_INDEX, GL_UNSIGNED_BYTE,
+ &ctx->DefaultPacking, buffer);
+
+ if (0) {
+ /* debug code: dump stencil values */
+ GLint row, col;
+ for (row = 0; row < height; row++) {
+ printf("%3d: ", row);
+ for (col = 0; col < width; col++) {
+ printf("%02x ", buffer[col + row * width]);
+ }
+ printf("\n");
+ }
+ }
+
+ if (util_format_get_component_bits(rbDraw->format,
+ UTIL_FORMAT_COLORSPACE_ZS, 0) != 0)
+ usage = PIPE_TRANSFER_READ_WRITE;
+ else
+ usage = PIPE_TRANSFER_WRITE;
+
+ if (st_fb_orientation(ctx->DrawBuffer) == Y_0_TOP) {
+ dsty = rbDraw->Base.Height - dsty - height;
+ }
+
+ ptDraw = pipe_get_transfer(st_context(ctx)->pipe,
+ rbDraw->texture, 0, 0,
+ usage, dstx, dsty,
+ width, height);
+
+ assert(util_format_get_blockwidth(ptDraw->resource->format) == 1);
+ assert(util_format_get_blockheight(ptDraw->resource->format) == 1);
+
+ /* map the stencil buffer */
+ drawMap = pipe_transfer_map(pipe, ptDraw);
+
+ /* draw */
+ /* XXX PixelZoom not handled yet */
+ for (i = 0; i < height; i++) {
+ ubyte *dst;
+ const ubyte *src;
+ int y;
+
+ y = i;
+
+ if (st_fb_orientation(ctx->DrawBuffer) == Y_0_TOP) {
+ y = height - y - 1;
+ }
+
+ dst = drawMap + y * ptDraw->stride;
+ src = buffer + i * width;
+
+ switch (ptDraw->resource->format) {
+ case PIPE_FORMAT_Z24_UNORM_S8_USCALED:
+ {
+ uint *dst4 = (uint *) dst;
+ int j;
+ assert(usage == PIPE_TRANSFER_READ_WRITE);
+ for (j = 0; j < width; j++) {
+ *dst4 = (*dst4 & 0xffffff) | (src[j] << 24);
+ dst4++;
+ }
+ }
+ break;
+ case PIPE_FORMAT_S8_USCALED_Z24_UNORM:
+ {
+ uint *dst4 = (uint *) dst;
+ int j;
+ assert(usage == PIPE_TRANSFER_READ_WRITE);
+ for (j = 0; j < width; j++) {
+ *dst4 = (*dst4 & 0xffffff00) | (src[j] & 0xff);
+ dst4++;
+ }
+ }
+ break;
+ case PIPE_FORMAT_S8_USCALED:
+ assert(usage == PIPE_TRANSFER_WRITE);
+ memcpy(dst, src, width);
+ break;
+ default:
+ assert(0);
+ }
+ }
+
+ free(buffer);
+
+ /* unmap the stencil buffer */
+ pipe_transfer_unmap(pipe, ptDraw);
+ pipe->transfer_destroy(pipe, ptDraw);
+}
+
+
+/** Do the src/dest regions overlap? */
+static GLboolean
+regions_overlap(GLint srcX, GLint srcY, GLint dstX, GLint dstY,
+ GLsizei width, GLsizei height)
+{
+ if (srcX + width <= dstX ||
+ dstX + width <= srcX ||
+ srcY + height <= dstY ||
+ dstY + height <= srcY)
+ return GL_FALSE;
+ else
+ return GL_TRUE;
+}
+
+
+/**
+ * Try to do a glCopyPixels for simple cases with a blit by calling
+ * pipe->resource_copy_region().
+ *
+ * We can do this when we're copying color pixels (depth/stencil
+ * eventually) with no pixel zoom, no pixel transfer ops, no
+ * per-fragment ops, the src/dest regions don't overlap and the
+ * src/dest pixel formats are the same.
+ */
+static GLboolean
+blit_copy_pixels(struct gl_context *ctx, GLint srcx, GLint srcy,
+ GLsizei width, GLsizei height,
+ GLint dstx, GLint dsty, GLenum type)
+{
+ struct st_context *st = st_context(ctx);
+ struct pipe_context *pipe = st->pipe;
+ struct gl_pixelstore_attrib pack, unpack;
+ GLint readX, readY, readW, readH;
+
+ if (type == GL_COLOR &&
+ ctx->Pixel.ZoomX == 1.0 &&
+ ctx->Pixel.ZoomY == 1.0 &&
+ ctx->_ImageTransferState == 0x0 &&
+ !ctx->Color.BlendEnabled &&
+ !ctx->Color.AlphaEnabled &&
+ !ctx->Depth.Test &&
+ !ctx->Fog.Enabled &&
+ !ctx->Stencil.Enabled &&
+ !ctx->FragmentProgram.Enabled &&
+ !ctx->VertexProgram.Enabled &&
+ !ctx->Shader.CurrentFragmentProgram &&
+ st_fb_orientation(ctx->ReadBuffer) == st_fb_orientation(ctx->DrawBuffer) &&
+ ctx->DrawBuffer->_NumColorDrawBuffers == 1) {
+ struct st_renderbuffer *rbRead, *rbDraw;
+ GLint drawX, drawY;
+
+ /*
+ * Clip the read region against the src buffer bounds.
+ * We'll still allocate a temporary buffer/texture for the original
+ * src region size but we'll only read the region which is on-screen.
+ * This may mean that we draw garbage pixels into the dest region, but
+ * that's expected.
+ */
+ readX = srcx;
+ readY = srcy;
+ readW = width;
+ readH = height;
+ pack = ctx->DefaultPacking;
+ if (!_mesa_clip_readpixels(ctx, &readX, &readY, &readW, &readH, &pack))
+ return GL_TRUE; /* all done */
+
+ /* clip against dest buffer bounds and scissor box */
+ drawX = dstx + pack.SkipPixels;
+ drawY = dsty + pack.SkipRows;
+ unpack = pack;
+ if (!_mesa_clip_drawpixels(ctx, &drawX, &drawY, &readW, &readH, &unpack))
+ return GL_TRUE; /* all done */
+
+ readX = readX - pack.SkipPixels + unpack.SkipPixels;
+ readY = readY - pack.SkipRows + unpack.SkipRows;
+
+ rbRead = st_get_color_read_renderbuffer(ctx);
+ rbDraw = st_renderbuffer(ctx->DrawBuffer->_ColorDrawBuffers[0]);
+
+ if ((rbRead != rbDraw ||
+ !regions_overlap(readX, readY, drawX, drawY, readW, readH)) &&
+ rbRead->Base.Format == rbDraw->Base.Format) {
+ struct pipe_box srcBox;
+
+ /* flip src/dst position if needed */
+ if (st_fb_orientation(ctx->ReadBuffer) == Y_0_TOP) {
+ /* both buffers will have the same orientation */
+ readY = ctx->ReadBuffer->Height - readY - readH;
+ drawY = ctx->DrawBuffer->Height - drawY - readH;
+ }
+
+ u_box_2d(readX, readY, readW, readH, &srcBox);
+
+ pipe->resource_copy_region(pipe,
+ rbDraw->texture, 0, drawX, drawY, 0,
+ rbRead->texture, 0, &srcBox);
+ return GL_TRUE;
+ }
+ }
+
+ return GL_FALSE;
+}
+
+
+static void
+st_CopyPixels(struct gl_context *ctx, GLint srcx, GLint srcy,
+ GLsizei width, GLsizei height,
+ GLint dstx, GLint dsty, GLenum type)
+{
+ struct st_context *st = st_context(ctx);
+ struct pipe_context *pipe = st->pipe;
+ struct pipe_screen *screen = pipe->screen;
+ struct st_renderbuffer *rbRead;
+ void *driver_vp, *driver_fp;
+ struct pipe_resource *pt;
+ struct pipe_sampler_view *sv[2];
+ int num_sampler_view = 1;
+ GLfloat *color;
+ enum pipe_format srcFormat, texFormat;
+ GLboolean invertTex = GL_FALSE;
+ GLint readX, readY, readW, readH;
+ GLuint sample_count;
+ struct gl_pixelstore_attrib pack = ctx->DefaultPacking;
+ struct st_fp_variant *fpv;
+
+ st_validate_state(st);
+
+ if (type == GL_STENCIL) {
+ /* can't use texturing to do stencil */
+ copy_stencil_pixels(ctx, srcx, srcy, width, height, dstx, dsty);
+ return;
+ }
+
+ if (blit_copy_pixels(ctx, srcx, srcy, width, height, dstx, dsty, type))
+ return;
+
+ /*
+ * The subsequent code implements glCopyPixels by copying the source
+ * pixels into a temporary texture that's then applied to a textured quad.
+ * When we draw the textured quad, all the usual per-fragment operations
+ * are handled.
+ */
+
+
+ /*
+ * Get vertex/fragment shaders
+ */
+ if (type == GL_COLOR) {
+ rbRead = st_get_color_read_renderbuffer(ctx);
+ color = NULL;
+
+ fpv = get_color_fp_variant(st);
+ driver_fp = fpv->driver_shader;
+
+ driver_vp = make_passthrough_vertex_shader(st, GL_FALSE);
+
+ if (st->pixel_xfer.pixelmap_enabled) {
+ sv[1] = st->pixel_xfer.pixelmap_sampler_view;
+ num_sampler_view++;
+ }
+ }
+ else {
+ assert(type == GL_DEPTH);
+ rbRead = st_renderbuffer(ctx->ReadBuffer->_DepthBuffer);
+ color = ctx->Current.Attrib[VERT_ATTRIB_COLOR0];
+
+ fpv = get_depth_stencil_fp_variant(st, GL_TRUE, GL_FALSE);
+ driver_fp = fpv->driver_shader;
+
+ driver_vp = make_passthrough_vertex_shader(st, GL_TRUE);
+ }
+
+ /* update fragment program constants */
+ st_upload_constants(st, fpv->parameters, PIPE_SHADER_FRAGMENT);
+
+
+ if (rbRead->Base.Wrapped)
+ rbRead = st_renderbuffer(rbRead->Base.Wrapped);
+
+ sample_count = rbRead->texture->nr_samples;
+ /* I believe this would be legal, presumably would need to do a resolve
+ for color, and for depth/stencil spec says to just use one of the
+ depth/stencil samples per pixel? Need some transfer clarifications. */
+ assert(sample_count < 2);
+
+ srcFormat = rbRead->texture->format;
+
+ if (screen->is_format_supported(screen, srcFormat, st->internal_target,
+ sample_count,
+ PIPE_BIND_SAMPLER_VIEW)) {
+ texFormat = srcFormat;
+ }
+ else {
+ /* srcFormat can't be used as a texture format */
+ if (type == GL_DEPTH) {
+ texFormat = st_choose_format(screen, GL_DEPTH_COMPONENT,
+ st->internal_target, sample_count,
+ PIPE_BIND_DEPTH_STENCIL);
+ assert(texFormat != PIPE_FORMAT_NONE);
+ }
+ else {
+ /* default color format */
+ texFormat = st_choose_format(screen, GL_RGBA, st->internal_target,
+ sample_count, PIPE_BIND_SAMPLER_VIEW);
+ assert(texFormat != PIPE_FORMAT_NONE);
+ }
+ }
+
+ /* Invert src region if needed */
+ if (st_fb_orientation(ctx->ReadBuffer) == Y_0_TOP) {
+ srcy = ctx->ReadBuffer->Height - srcy - height;
+ invertTex = !invertTex;
+ }
+
+ /* Clip the read region against the src buffer bounds.
+ * We'll still allocate a temporary buffer/texture for the original
+ * src region size but we'll only read the region which is on-screen.
+ * This may mean that we draw garbage pixels into the dest region, but
+ * that's expected.
+ */
+ readX = srcx;
+ readY = srcy;
+ readW = width;
+ readH = height;
+ _mesa_clip_readpixels(ctx, &readX, &readY, &readW, &readH, &pack);
+ readW = MAX2(0, readW);
+ readH = MAX2(0, readH);
+
+ /* alloc temporary texture */
+ pt = alloc_texture(st, width, height, texFormat);
+ if (!pt)
+ return;
+
+ sv[0] = st_create_texture_sampler_view(st->pipe, pt);
+ if (!sv[0]) {
+ pipe_resource_reference(&pt, NULL);
+ return;
+ }
+
+ /* Make temporary texture which is a copy of the src region.
+ */
+ if (srcFormat == texFormat) {
+ struct pipe_box src_box;
+ u_box_2d(readX, readY, readW, readH, &src_box);
+ /* copy source framebuffer surface into mipmap/texture */
+ pipe->resource_copy_region(pipe,
+ pt, /* dest tex */
+ 0,
+ pack.SkipPixels, pack.SkipRows, 0, /* dest pos */
+ rbRead->texture, /* src tex */
+ 0,
+ &src_box);
+
+ }
+ else {
+ /* CPU-based fallback/conversion */
+ struct pipe_transfer *ptRead =
+ pipe_get_transfer(st->pipe, rbRead->texture,
+ 0, 0, /* level, layer */
+ PIPE_TRANSFER_READ,
+ readX, readY, readW, readH);
+ struct pipe_transfer *ptTex;
+ enum pipe_transfer_usage transfer_usage;
+
+ if (ST_DEBUG & DEBUG_FALLBACK)
+ debug_printf("%s: fallback processing\n", __FUNCTION__);
+
+ if (type == GL_DEPTH && util_format_is_depth_and_stencil(pt->format))
+ transfer_usage = PIPE_TRANSFER_READ_WRITE;
+ else
+ transfer_usage = PIPE_TRANSFER_WRITE;
+
+ ptTex = pipe_get_transfer(st->pipe, pt, 0, 0, transfer_usage,
+ 0, 0, width, height);
+
+ /* copy image from ptRead surface to ptTex surface */
+ if (type == GL_COLOR) {
+ /* alternate path using get/put_tile() */
+ GLfloat *buf = (GLfloat *) malloc(width * height * 4 * sizeof(GLfloat));
+ enum pipe_format readFormat, drawFormat;
+ readFormat = util_format_linear(rbRead->texture->format);
+ drawFormat = util_format_linear(pt->format);
+ pipe_get_tile_rgba_format(pipe, ptRead, 0, 0, readW, readH,
+ readFormat, buf);
+ pipe_put_tile_rgba_format(pipe, ptTex, pack.SkipPixels, pack.SkipRows,
+ readW, readH, drawFormat, buf);
+ free(buf);
+ }
+ else {
+ /* GL_DEPTH */
+ GLuint *buf = (GLuint *) malloc(width * height * sizeof(GLuint));
+ pipe_get_tile_z(pipe, ptRead, 0, 0, readW, readH, buf);
+ pipe_put_tile_z(pipe, ptTex, pack.SkipPixels, pack.SkipRows,
+ readW, readH, buf);
+ free(buf);
+ }
+
+ pipe->transfer_destroy(pipe, ptRead);
+ pipe->transfer_destroy(pipe, ptTex);
+ }
+
+ /* OK, the texture 'pt' contains the src image/pixels. Now draw a
+ * textured quad with that texture.
+ */
+ draw_textured_quad(ctx, dstx, dsty, ctx->Current.RasterPos[2],
+ width, height, ctx->Pixel.ZoomX, ctx->Pixel.ZoomY,
+ sv,
+ num_sampler_view,
+ driver_vp,
+ driver_fp,
+ color, invertTex, GL_FALSE, GL_FALSE);
+
+ pipe_resource_reference(&pt, NULL);
+ pipe_sampler_view_reference(&sv[0], NULL);
+}
+
+
+
+void st_init_drawpixels_functions(struct dd_function_table *functions)
+{
+ functions->DrawPixels = st_DrawPixels;
+ functions->CopyPixels = st_CopyPixels;
+}
+
+
+void
+st_destroy_drawpix(struct st_context *st)
+{
+ GLuint i;
+
+ for (i = 0; i < Elements(st->drawpix.shaders); i++) {
+ if (st->drawpix.shaders[i])
+ _mesa_reference_fragprog(st->ctx, &st->drawpix.shaders[i], NULL);
+ }
+
+ st_reference_fragprog(st, &st->pixel_xfer.combined_prog, NULL);
+ if (st->drawpix.vert_shaders[0])
+ ureg_free_tokens(st->drawpix.vert_shaders[0]);
+ if (st->drawpix.vert_shaders[1])
+ ureg_free_tokens(st->drawpix.vert_shaders[1]);
+}
+
+#endif /* FEATURE_drawpix */
diff --git a/mesalib/src/mesa/state_tracker/st_cb_drawtex.c b/mesalib/src/mesa/state_tracker/st_cb_drawtex.c
index 86ceb9d78..db299eb8d 100644
--- a/mesalib/src/mesa/state_tracker/st_cb_drawtex.c
+++ b/mesalib/src/mesa/state_tracker/st_cb_drawtex.c
@@ -1,307 +1,307 @@
-/**************************************************************************
- *
- * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
- * All Rights Reserved.
- *
- **************************************************************************/
-
-
-/**
- * Implementation of glDrawTex() for GL_OES_draw_tex
- */
-
-
-
-#include "main/imports.h"
-#include "main/image.h"
-#include "main/macros.h"
-#include "main/mfeatures.h"
-#include "program/program.h"
-#include "program/prog_print.h"
-
-#include "st_context.h"
-#include "st_atom.h"
-#include "st_cb_drawtex.h"
-
-#include "pipe/p_context.h"
-#include "pipe/p_defines.h"
-#include "util/u_inlines.h"
-#include "pipe/p_shader_tokens.h"
-#include "util/u_draw_quad.h"
-#include "util/u_simple_shaders.h"
-
-#include "cso_cache/cso_context.h"
-
-
-#if FEATURE_OES_draw_texture
-
-
-struct cached_shader
-{
- void *handle;
-
- uint num_attribs;
- uint semantic_names[2 + MAX_TEXTURE_UNITS];
- uint semantic_indexes[2 + MAX_TEXTURE_UNITS];
-};
-
-#define MAX_SHADERS (2 * MAX_TEXTURE_UNITS)
-
-/**
- * Simple linear list cache.
- * Most of the time there'll only be one cached shader.
- */
-static struct cached_shader CachedShaders[MAX_SHADERS];
-static GLuint NumCachedShaders = 0;
-
-
-static void *
-lookup_shader(struct pipe_context *pipe,
- uint num_attribs,
- const uint *semantic_names,
- const uint *semantic_indexes)
-{
- GLuint i, j;
-
- /* look for existing shader with same attributes */
- for (i = 0; i < NumCachedShaders; i++) {
- if (CachedShaders[i].num_attribs == num_attribs) {
- GLboolean match = GL_TRUE;
- for (j = 0; j < num_attribs; j++) {
- if (semantic_names[j] != CachedShaders[i].semantic_names[j] ||
- semantic_indexes[j] != CachedShaders[i].semantic_indexes[j]) {
- match = GL_FALSE;
- break;
- }
- }
- if (match)
- return CachedShaders[i].handle;
- }
- }
-
- /* not found - create new one now */
- if (NumCachedShaders >= MAX_SHADERS) {
- return NULL;
- }
-
- CachedShaders[i].num_attribs = num_attribs;
- for (j = 0; j < num_attribs; j++) {
- CachedShaders[i].semantic_names[j] = semantic_names[j];
- CachedShaders[i].semantic_indexes[j] = semantic_indexes[j];
- }
-
- CachedShaders[i].handle =
- util_make_vertex_passthrough_shader(pipe,
- num_attribs,
- semantic_names,
- semantic_indexes);
- NumCachedShaders++;
-
- return CachedShaders[i].handle;
-}
-
-static void
-st_DrawTex(struct gl_context *ctx, GLfloat x, GLfloat y, GLfloat z,
- GLfloat width, GLfloat height)
-{
- struct st_context *st = ctx->st;
- struct pipe_context *pipe = st->pipe;
- struct cso_context *cso = ctx->st->cso_context;
- struct pipe_resource *vbuffer;
- struct pipe_transfer *vbuffer_transfer;
- GLuint i, numTexCoords, numAttribs;
- GLboolean emitColor;
- uint semantic_names[2 + MAX_TEXTURE_UNITS];
- uint semantic_indexes[2 + MAX_TEXTURE_UNITS];
- struct pipe_vertex_element velements[2 + MAX_TEXTURE_UNITS];
- GLbitfield inputs = VERT_BIT_POS;
-
- st_validate_state(st);
-
- /* determine if we need vertex color */
- if (ctx->FragmentProgram._Current->Base.InputsRead & FRAG_BIT_COL0)
- emitColor = GL_TRUE;
- else
- emitColor = GL_FALSE;
-
- /* determine how many enabled sets of texcoords */
- numTexCoords = 0;
- for (i = 0; i < ctx->Const.MaxTextureUnits; i++) {
- if (ctx->Texture.Unit[i]._ReallyEnabled & TEXTURE_2D_BIT) {
- inputs |= VERT_BIT_TEX(i);
- numTexCoords++;
- }
- }
-
- /* total number of attributes per vertex */
- numAttribs = 1 + emitColor + numTexCoords;
-
-
- /* create the vertex buffer */
- vbuffer = pipe_buffer_create(pipe->screen, PIPE_BIND_VERTEX_BUFFER,
- PIPE_USAGE_STREAM,
- numAttribs * 4 * 4 * sizeof(GLfloat));
-
- /* load vertex buffer */
- {
-#define SET_ATTRIB(VERT, ATTR, X, Y, Z, W) \
- do { \
- GLuint k = (((VERT) * numAttribs + (ATTR)) * 4); \
- assert(k < 4 * 4 * numAttribs); \
- vbuf[k + 0] = X; \
- vbuf[k + 1] = Y; \
- vbuf[k + 2] = Z; \
- vbuf[k + 3] = W; \
- } while (0)
-
- const GLfloat x0 = x, y0 = y, x1 = x + width, y1 = y + height;
- GLfloat *vbuf = (GLfloat *) pipe_buffer_map(pipe, vbuffer,
- PIPE_TRANSFER_WRITE,
- &vbuffer_transfer);
- GLuint attr;
-
- z = CLAMP(z, 0.0f, 1.0f);
-
- /* positions (in clip coords) */
- {
- const struct gl_framebuffer *fb = st->ctx->DrawBuffer;
- const GLfloat fb_width = (GLfloat)fb->Width;
- const GLfloat fb_height = (GLfloat)fb->Height;
-
- const GLfloat clip_x0 = (GLfloat)(x0 / fb_width * 2.0 - 1.0);
- const GLfloat clip_y0 = (GLfloat)(y0 / fb_height * 2.0 - 1.0);
- const GLfloat clip_x1 = (GLfloat)(x1 / fb_width * 2.0 - 1.0);
- const GLfloat clip_y1 = (GLfloat)(y1 / fb_height * 2.0 - 1.0);
-
- SET_ATTRIB(0, 0, clip_x0, clip_y0, z, 1.0f); /* lower left */
- SET_ATTRIB(1, 0, clip_x1, clip_y0, z, 1.0f); /* lower right */
- SET_ATTRIB(2, 0, clip_x1, clip_y1, z, 1.0f); /* upper right */
- SET_ATTRIB(3, 0, clip_x0, clip_y1, z, 1.0f); /* upper left */
-
- semantic_names[0] = TGSI_SEMANTIC_POSITION;
- semantic_indexes[0] = 0;
- }
-
- /* colors */
- if (emitColor) {
- const GLfloat *c = ctx->Current.Attrib[VERT_ATTRIB_COLOR0];
- SET_ATTRIB(0, 1, c[0], c[1], c[2], c[3]);
- SET_ATTRIB(1, 1, c[0], c[1], c[2], c[3]);
- SET_ATTRIB(2, 1, c[0], c[1], c[2], c[3]);
- SET_ATTRIB(3, 1, c[0], c[1], c[2], c[3]);
- semantic_names[1] = TGSI_SEMANTIC_COLOR;
- semantic_indexes[1] = 0;
- attr = 2;
- }
- else {
- attr = 1;
- }
-
- /* texcoords */
- for (i = 0; i < ctx->Const.MaxTextureUnits; i++) {
- if (ctx->Texture.Unit[i]._ReallyEnabled & TEXTURE_2D_BIT) {
- struct gl_texture_object *obj = ctx->Texture.Unit[i]._Current;
- struct gl_texture_image *img = obj->Image[0][obj->BaseLevel];
- const GLfloat wt = (GLfloat) img->Width;
- const GLfloat ht = (GLfloat) img->Height;
- const GLfloat s0 = obj->CropRect[0] / wt;
- const GLfloat t0 = obj->CropRect[1] / ht;
- const GLfloat s1 = (obj->CropRect[0] + obj->CropRect[2]) / wt;
- const GLfloat t1 = (obj->CropRect[1] + obj->CropRect[3]) / ht;
-
- /*printf("crop texcoords: %g, %g .. %g, %g\n", s0, t0, s1, t1);*/
- SET_ATTRIB(0, attr, s0, t0, 0.0f, 1.0f); /* lower left */
- SET_ATTRIB(1, attr, s1, t0, 0.0f, 1.0f); /* lower right */
- SET_ATTRIB(2, attr, s1, t1, 0.0f, 1.0f); /* upper right */
- SET_ATTRIB(3, attr, s0, t1, 0.0f, 1.0f); /* upper left */
-
- semantic_names[attr] = TGSI_SEMANTIC_GENERIC;
- semantic_indexes[attr] = 0;
-
- attr++;
- }
- }
-
- pipe_buffer_unmap(pipe, vbuffer_transfer);
-
-#undef SET_ATTRIB
- }
-
-
- cso_save_viewport(cso);
- cso_save_vertex_shader(cso);
- cso_save_vertex_elements(cso);
- cso_save_vertex_buffers(cso);
-
- {
- void *vs = lookup_shader(pipe, numAttribs,
- semantic_names, semantic_indexes);
- cso_set_vertex_shader_handle(cso, vs);
- }
-
- for (i = 0; i < numAttribs; i++) {
- velements[i].src_offset = i * 4 * sizeof(float);
- velements[i].instance_divisor = 0;
- velements[i].vertex_buffer_index = 0;
- velements[i].src_format = PIPE_FORMAT_R32G32B32A32_FLOAT;
- }
- cso_set_vertex_elements(cso, numAttribs, velements);
-
- /* viewport state: viewport matching window dims */
- {
- const struct gl_framebuffer *fb = st->ctx->DrawBuffer;
- const GLboolean invert = (st_fb_orientation(fb) == Y_0_TOP);
- const GLfloat width = (GLfloat)fb->Width;
- const GLfloat height = (GLfloat)fb->Height;
- struct pipe_viewport_state vp;
- vp.scale[0] = 0.5f * width;
- vp.scale[1] = height * (invert ? -0.5f : 0.5f);
- vp.scale[2] = 1.0f;
- vp.scale[3] = 1.0f;
- vp.translate[0] = 0.5f * width;
- vp.translate[1] = 0.5f * height;
- vp.translate[2] = 0.0f;
- vp.translate[3] = 0.0f;
- cso_set_viewport(cso, &vp);
- }
-
-
- util_draw_vertex_buffer(pipe, cso, vbuffer,
- 0, /* offset */
- PIPE_PRIM_TRIANGLE_FAN,
- 4, /* verts */
- numAttribs); /* attribs/vert */
-
-
- pipe_resource_reference(&vbuffer, NULL);
-
- /* restore state */
- cso_restore_viewport(cso);
- cso_restore_vertex_shader(cso);
- cso_restore_vertex_elements(cso);
- cso_restore_vertex_buffers(cso);
-}
-
-
-void
-st_init_drawtex_functions(struct dd_function_table *functions)
-{
- functions->DrawTex = st_DrawTex;
-}
-
-
-/**
- * Free any cached shaders
- */
-void
-st_destroy_drawtex(struct st_context *st)
-{
- GLuint i;
- for (i = 0; i < NumCachedShaders; i++) {
- cso_delete_vertex_shader(st->cso_context, CachedShaders[i].handle);
- }
- NumCachedShaders = 0;
-}
-
-
-#endif /* FEATURE_OES_draw_texture */
+/**************************************************************************
+ *
+ * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
+ * All Rights Reserved.
+ *
+ **************************************************************************/
+
+
+/**
+ * Implementation of glDrawTex() for GL_OES_draw_tex
+ */
+
+
+
+#include "main/imports.h"
+#include "main/image.h"
+#include "main/macros.h"
+#include "main/mfeatures.h"
+#include "program/program.h"
+#include "program/prog_print.h"
+
+#include "st_context.h"
+#include "st_atom.h"
+#include "st_cb_drawtex.h"
+
+#include "pipe/p_context.h"
+#include "pipe/p_defines.h"
+#include "util/u_inlines.h"
+#include "pipe/p_shader_tokens.h"
+#include "util/u_draw_quad.h"
+#include "util/u_simple_shaders.h"
+
+#include "cso_cache/cso_context.h"
+
+
+#if FEATURE_OES_draw_texture
+
+
+struct cached_shader
+{
+ void *handle;
+
+ uint num_attribs;
+ uint semantic_names[2 + MAX_TEXTURE_UNITS];
+ uint semantic_indexes[2 + MAX_TEXTURE_UNITS];
+};
+
+#define MAX_SHADERS (2 * MAX_TEXTURE_UNITS)
+
+/**
+ * Simple linear list cache.
+ * Most of the time there'll only be one cached shader.
+ */
+static struct cached_shader CachedShaders[MAX_SHADERS];
+static GLuint NumCachedShaders = 0;
+
+
+static void *
+lookup_shader(struct pipe_context *pipe,
+ uint num_attribs,
+ const uint *semantic_names,
+ const uint *semantic_indexes)
+{
+ GLuint i, j;
+
+ /* look for existing shader with same attributes */
+ for (i = 0; i < NumCachedShaders; i++) {
+ if (CachedShaders[i].num_attribs == num_attribs) {
+ GLboolean match = GL_TRUE;
+ for (j = 0; j < num_attribs; j++) {
+ if (semantic_names[j] != CachedShaders[i].semantic_names[j] ||
+ semantic_indexes[j] != CachedShaders[i].semantic_indexes[j]) {
+ match = GL_FALSE;
+ break;
+ }
+ }
+ if (match)
+ return CachedShaders[i].handle;
+ }
+ }
+
+ /* not found - create new one now */
+ if (NumCachedShaders >= MAX_SHADERS) {
+ return NULL;
+ }
+
+ CachedShaders[i].num_attribs = num_attribs;
+ for (j = 0; j < num_attribs; j++) {
+ CachedShaders[i].semantic_names[j] = semantic_names[j];
+ CachedShaders[i].semantic_indexes[j] = semantic_indexes[j];
+ }
+
+ CachedShaders[i].handle =
+ util_make_vertex_passthrough_shader(pipe,
+ num_attribs,
+ semantic_names,
+ semantic_indexes);
+ NumCachedShaders++;
+
+ return CachedShaders[i].handle;
+}
+
+static void
+st_DrawTex(struct gl_context *ctx, GLfloat x, GLfloat y, GLfloat z,
+ GLfloat width, GLfloat height)
+{
+ struct st_context *st = ctx->st;
+ struct pipe_context *pipe = st->pipe;
+ struct cso_context *cso = ctx->st->cso_context;
+ struct pipe_resource *vbuffer;
+ struct pipe_transfer *vbuffer_transfer;
+ GLuint i, numTexCoords, numAttribs;
+ GLboolean emitColor;
+ uint semantic_names[2 + MAX_TEXTURE_UNITS];
+ uint semantic_indexes[2 + MAX_TEXTURE_UNITS];
+ struct pipe_vertex_element velements[2 + MAX_TEXTURE_UNITS];
+ GLbitfield inputs = VERT_BIT_POS;
+
+ st_validate_state(st);
+
+ /* determine if we need vertex color */
+ if (ctx->FragmentProgram._Current->Base.InputsRead & FRAG_BIT_COL0)
+ emitColor = GL_TRUE;
+ else
+ emitColor = GL_FALSE;
+
+ /* determine how many enabled sets of texcoords */
+ numTexCoords = 0;
+ for (i = 0; i < ctx->Const.MaxTextureUnits; i++) {
+ if (ctx->Texture.Unit[i]._ReallyEnabled & TEXTURE_2D_BIT) {
+ inputs |= VERT_BIT_TEX(i);
+ numTexCoords++;
+ }
+ }
+
+ /* total number of attributes per vertex */
+ numAttribs = 1 + emitColor + numTexCoords;
+
+
+ /* create the vertex buffer */
+ vbuffer = pipe_buffer_create(pipe->screen, PIPE_BIND_VERTEX_BUFFER,
+ PIPE_USAGE_STREAM,
+ numAttribs * 4 * 4 * sizeof(GLfloat));
+
+ /* load vertex buffer */
+ {
+#define SET_ATTRIB(VERT, ATTR, X, Y, Z, W) \
+ do { \
+ GLuint k = (((VERT) * numAttribs + (ATTR)) * 4); \
+ assert(k < 4 * 4 * numAttribs); \
+ vbuf[k + 0] = X; \
+ vbuf[k + 1] = Y; \
+ vbuf[k + 2] = Z; \
+ vbuf[k + 3] = W; \
+ } while (0)
+
+ const GLfloat x0 = x, y0 = y, x1 = x + width, y1 = y + height;
+ GLfloat *vbuf = (GLfloat *) pipe_buffer_map(pipe, vbuffer,
+ PIPE_TRANSFER_WRITE,
+ &vbuffer_transfer);
+ GLuint attr;
+
+ z = CLAMP(z, 0.0f, 1.0f);
+
+ /* positions (in clip coords) */
+ {
+ const struct gl_framebuffer *fb = st->ctx->DrawBuffer;
+ const GLfloat fb_width = (GLfloat)fb->Width;
+ const GLfloat fb_height = (GLfloat)fb->Height;
+
+ const GLfloat clip_x0 = (GLfloat)(x0 / fb_width * 2.0 - 1.0);
+ const GLfloat clip_y0 = (GLfloat)(y0 / fb_height * 2.0 - 1.0);
+ const GLfloat clip_x1 = (GLfloat)(x1 / fb_width * 2.0 - 1.0);
+ const GLfloat clip_y1 = (GLfloat)(y1 / fb_height * 2.0 - 1.0);
+
+ SET_ATTRIB(0, 0, clip_x0, clip_y0, z, 1.0f); /* lower left */
+ SET_ATTRIB(1, 0, clip_x1, clip_y0, z, 1.0f); /* lower right */
+ SET_ATTRIB(2, 0, clip_x1, clip_y1, z, 1.0f); /* upper right */
+ SET_ATTRIB(3, 0, clip_x0, clip_y1, z, 1.0f); /* upper left */
+
+ semantic_names[0] = TGSI_SEMANTIC_POSITION;
+ semantic_indexes[0] = 0;
+ }
+
+ /* colors */
+ if (emitColor) {
+ const GLfloat *c = ctx->Current.Attrib[VERT_ATTRIB_COLOR0];
+ SET_ATTRIB(0, 1, c[0], c[1], c[2], c[3]);
+ SET_ATTRIB(1, 1, c[0], c[1], c[2], c[3]);
+ SET_ATTRIB(2, 1, c[0], c[1], c[2], c[3]);
+ SET_ATTRIB(3, 1, c[0], c[1], c[2], c[3]);
+ semantic_names[1] = TGSI_SEMANTIC_COLOR;
+ semantic_indexes[1] = 0;
+ attr = 2;
+ }
+ else {
+ attr = 1;
+ }
+
+ /* texcoords */
+ for (i = 0; i < ctx->Const.MaxTextureUnits; i++) {
+ if (ctx->Texture.Unit[i]._ReallyEnabled & TEXTURE_2D_BIT) {
+ struct gl_texture_object *obj = ctx->Texture.Unit[i]._Current;
+ struct gl_texture_image *img = obj->Image[0][obj->BaseLevel];
+ const GLfloat wt = (GLfloat) img->Width;
+ const GLfloat ht = (GLfloat) img->Height;
+ const GLfloat s0 = obj->CropRect[0] / wt;
+ const GLfloat t0 = obj->CropRect[1] / ht;
+ const GLfloat s1 = (obj->CropRect[0] + obj->CropRect[2]) / wt;
+ const GLfloat t1 = (obj->CropRect[1] + obj->CropRect[3]) / ht;
+
+ /*printf("crop texcoords: %g, %g .. %g, %g\n", s0, t0, s1, t1);*/
+ SET_ATTRIB(0, attr, s0, t0, 0.0f, 1.0f); /* lower left */
+ SET_ATTRIB(1, attr, s1, t0, 0.0f, 1.0f); /* lower right */
+ SET_ATTRIB(2, attr, s1, t1, 0.0f, 1.0f); /* upper right */
+ SET_ATTRIB(3, attr, s0, t1, 0.0f, 1.0f); /* upper left */
+
+ semantic_names[attr] = TGSI_SEMANTIC_GENERIC;
+ semantic_indexes[attr] = 0;
+
+ attr++;
+ }
+ }
+
+ pipe_buffer_unmap(pipe, vbuffer_transfer);
+
+#undef SET_ATTRIB
+ }
+
+
+ cso_save_viewport(cso);
+ cso_save_vertex_shader(cso);
+ cso_save_vertex_elements(cso);
+ cso_save_vertex_buffers(cso);
+
+ {
+ void *vs = lookup_shader(pipe, numAttribs,
+ semantic_names, semantic_indexes);
+ cso_set_vertex_shader_handle(cso, vs);
+ }
+
+ for (i = 0; i < numAttribs; i++) {
+ velements[i].src_offset = i * 4 * sizeof(float);
+ velements[i].instance_divisor = 0;
+ velements[i].vertex_buffer_index = 0;
+ velements[i].src_format = PIPE_FORMAT_R32G32B32A32_FLOAT;
+ }
+ cso_set_vertex_elements(cso, numAttribs, velements);
+
+ /* viewport state: viewport matching window dims */
+ {
+ const struct gl_framebuffer *fb = st->ctx->DrawBuffer;
+ const GLboolean invert = (st_fb_orientation(fb) == Y_0_TOP);
+ const GLfloat width = (GLfloat)fb->Width;
+ const GLfloat height = (GLfloat)fb->Height;
+ struct pipe_viewport_state vp;
+ vp.scale[0] = 0.5f * width;
+ vp.scale[1] = height * (invert ? -0.5f : 0.5f);
+ vp.scale[2] = 1.0f;
+ vp.scale[3] = 1.0f;
+ vp.translate[0] = 0.5f * width;
+ vp.translate[1] = 0.5f * height;
+ vp.translate[2] = 0.0f;
+ vp.translate[3] = 0.0f;
+ cso_set_viewport(cso, &vp);
+ }
+
+
+ util_draw_vertex_buffer(pipe, cso, vbuffer,
+ 0, /* offset */
+ PIPE_PRIM_TRIANGLE_FAN,
+ 4, /* verts */
+ numAttribs); /* attribs/vert */
+
+
+ pipe_resource_reference(&vbuffer, NULL);
+
+ /* restore state */
+ cso_restore_viewport(cso);
+ cso_restore_vertex_shader(cso);
+ cso_restore_vertex_elements(cso);
+ cso_restore_vertex_buffers(cso);
+}
+
+
+void
+st_init_drawtex_functions(struct dd_function_table *functions)
+{
+ functions->DrawTex = st_DrawTex;
+}
+
+
+/**
+ * Free any cached shaders
+ */
+void
+st_destroy_drawtex(struct st_context *st)
+{
+ GLuint i;
+ for (i = 0; i < NumCachedShaders; i++) {
+ cso_delete_vertex_shader(st->cso_context, CachedShaders[i].handle);
+ }
+ NumCachedShaders = 0;
+}
+
+
+#endif /* FEATURE_OES_draw_texture */
diff --git a/mesalib/src/mesa/state_tracker/st_cb_readpixels.c b/mesalib/src/mesa/state_tracker/st_cb_readpixels.c
index 2a63799bd..2c2da42c4 100644
--- a/mesalib/src/mesa/state_tracker/st_cb_readpixels.c
+++ b/mesalib/src/mesa/state_tracker/st_cb_readpixels.c
@@ -1,596 +1,596 @@
-/**************************************************************************
- *
- * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas.
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sub license, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice (including the
- * next paragraph) shall be included in all copies or substantial portions
- * of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
- * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
- * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- **************************************************************************/
-
-
-/**
- * glReadPixels interface to pipe
- *
- * \author Brian Paul
- */
-
-
-#include "main/imports.h"
-#include "main/bufferobj.h"
-#include "main/context.h"
-#include "main/image.h"
-#include "main/pack.h"
-#include "main/pbo.h"
-
-#include "pipe/p_context.h"
-#include "pipe/p_defines.h"
-#include "util/u_format.h"
-#include "util/u_inlines.h"
-#include "util/u_tile.h"
-
-#include "st_debug.h"
-#include "st_context.h"
-#include "st_atom.h"
-#include "st_cb_bitmap.h"
-#include "st_cb_readpixels.h"
-#include "st_cb_fbo.h"
-
-/**
- * Special case for reading stencil buffer.
- * For color/depth we use get_tile(). For stencil, map the stencil buffer.
- */
-void
-st_read_stencil_pixels(struct gl_context *ctx, GLint x, GLint y,
- GLsizei width, GLsizei height,
- GLenum format, GLenum type,
- const struct gl_pixelstore_attrib *packing,
- GLvoid *pixels)
-{
- struct gl_framebuffer *fb = ctx->ReadBuffer;
- struct pipe_context *pipe = st_context(ctx)->pipe;
- struct st_renderbuffer *strb = st_renderbuffer(fb->_StencilBuffer);
- struct pipe_transfer *pt;
- ubyte *stmap;
- GLint j;
-
- if (strb->Base.Wrapped) {
- strb = st_renderbuffer(strb->Base.Wrapped);
- }
-
- if (st_fb_orientation(ctx->DrawBuffer) == Y_0_TOP) {
- y = ctx->DrawBuffer->Height - y - height;
- }
-
- /* Create a read transfer from the renderbuffer's texture */
-
- pt = pipe_get_transfer(pipe, strb->texture,
- 0, 0,
- PIPE_TRANSFER_READ,
- x, y, width, height);
-
- /* map the stencil buffer */
- stmap = pipe_transfer_map(pipe, pt);
-
- /* width should never be > MAX_WIDTH since we did clipping earlier */
- ASSERT(width <= MAX_WIDTH);
-
- /* process image row by row */
- for (j = 0; j < height; j++) {
- GLvoid *dest;
- GLstencil sValues[MAX_WIDTH];
- GLfloat zValues[MAX_WIDTH];
- GLint srcY;
-
- if (st_fb_orientation(ctx->DrawBuffer) == Y_0_TOP) {
- srcY = height - j - 1;
- }
- else {
- srcY = j;
- }
-
- /* get stencil (and Z) values */
- switch (pt->resource->format) {
- case PIPE_FORMAT_S8_USCALED:
- {
- const ubyte *src = stmap + srcY * pt->stride;
- memcpy(sValues, src, width);
- }
- break;
- case PIPE_FORMAT_Z24_UNORM_S8_USCALED:
- if (format == GL_DEPTH_STENCIL) {
- const uint *src = (uint *) (stmap + srcY * pt->stride);
- const GLfloat scale = 1.0f / (0xffffff);
- GLint k;
- for (k = 0; k < width; k++) {
- sValues[k] = src[k] >> 24;
- zValues[k] = (src[k] & 0xffffff) * scale;
- }
- }
- else {
- const uint *src = (uint *) (stmap + srcY * pt->stride);
- GLint k;
- for (k = 0; k < width; k++) {
- sValues[k] = src[k] >> 24;
- }
- }
- break;
- case PIPE_FORMAT_S8_USCALED_Z24_UNORM:
- if (format == GL_DEPTH_STENCIL) {
- const uint *src = (uint *) (stmap + srcY * pt->stride);
- const GLfloat scale = 1.0f / (0xffffff);
- GLint k;
- for (k = 0; k < width; k++) {
- sValues[k] = src[k] & 0xff;
- zValues[k] = (src[k] >> 8) * scale;
- }
- }
- else {
- const uint *src = (uint *) (stmap + srcY * pt->stride);
- GLint k;
- for (k = 0; k < width; k++) {
- sValues[k] = src[k] & 0xff;
- }
- }
- break;
- default:
- assert(0);
- }
-
- /* store */
- dest = _mesa_image_address2d(packing, pixels, width, height,
- format, type, j, 0);
- if (format == GL_DEPTH_STENCIL) {
- _mesa_pack_depth_stencil_span(ctx, width, dest,
- zValues, sValues, packing);
- }
- else {
- _mesa_pack_stencil_span(ctx, width, type, dest, sValues, packing);
- }
- }
-
- /* unmap the stencil buffer */
- pipe_transfer_unmap(pipe, pt);
- pipe->transfer_destroy(pipe, pt);
-}
-
-
-/**
- * Return renderbuffer to use for reading color pixels for glRead/CopyPixel
- * commands.
- */
-struct st_renderbuffer *
-st_get_color_read_renderbuffer(struct gl_context *ctx)
-{
- struct gl_framebuffer *fb = ctx->ReadBuffer;
- struct st_renderbuffer *strb =
- st_renderbuffer(fb->_ColorReadBuffer);
-
- return strb;
-}
-
-
-/**
- * Try to do glReadPixels in a fast manner for common cases.
- * \return GL_TRUE for success, GL_FALSE for failure
- */
-static GLboolean
-st_fast_readpixels(struct gl_context *ctx, struct st_renderbuffer *strb,
- GLint x, GLint y, GLsizei width, GLsizei height,
- GLenum format, GLenum type,
- const struct gl_pixelstore_attrib *pack,
- GLvoid *dest)
-{
- GLubyte alphaORoperand;
- enum combination {
- A8R8G8B8_UNORM_TO_RGBA_UBYTE,
- A8R8G8B8_UNORM_TO_RGB_UBYTE,
- A8R8G8B8_UNORM_TO_BGRA_UINT,
- A8R8G8B8_UNORM_TO_RGBA_UINT
- } combo;
-
- if (ctx->_ImageTransferState)
- return GL_FALSE;
-
- if (strb->format == PIPE_FORMAT_B8G8R8A8_UNORM) {
- alphaORoperand = 0;
- }
- else if (strb->format == PIPE_FORMAT_B8G8R8X8_UNORM ) {
- alphaORoperand = 0xff;
- }
- else {
- return GL_FALSE;
- }
-
- if (format == GL_RGBA && type == GL_UNSIGNED_BYTE) {
- combo = A8R8G8B8_UNORM_TO_RGBA_UBYTE;
- }
- else if (format == GL_RGB && type == GL_UNSIGNED_BYTE) {
- combo = A8R8G8B8_UNORM_TO_RGB_UBYTE;
- }
- else if (format == GL_BGRA && type == GL_UNSIGNED_INT_8_8_8_8_REV) {
- combo = A8R8G8B8_UNORM_TO_BGRA_UINT;
- }
- else if (format == GL_RGBA && type == GL_UNSIGNED_INT_8_8_8_8) {
- combo = A8R8G8B8_UNORM_TO_RGBA_UINT;
- }
- else {
- return GL_FALSE;
- }
-
- /*printf("st_fast_readpixels combo %d\n", (GLint) combo);*/
-
- {
- struct pipe_context *pipe = st_context(ctx)->pipe;
- struct pipe_transfer *trans;
- const GLubyte *map;
- GLubyte *dst;
- GLint row, col, dy, dstStride;
-
- if (st_fb_orientation(ctx->ReadBuffer) == Y_0_TOP) {
- /* convert GL Y to Gallium Y */
- y = strb->texture->height0 - y - height;
- }
-
- trans = pipe_get_transfer(pipe, strb->texture,
- 0, 0,
- PIPE_TRANSFER_READ,
- x, y, width, height);
- if (!trans) {
- return GL_FALSE;
- }
-
- map = pipe_transfer_map(pipe, trans);
- if (!map) {
- pipe->transfer_destroy(pipe, trans);
- return GL_FALSE;
- }
-
- /* We always write to the user/dest buffer from low addr to high addr
- * but the read order depends on renderbuffer orientation
- */
- if (st_fb_orientation(ctx->ReadBuffer) == Y_0_TOP) {
- /* read source rows from bottom to top */
- y = height - 1;
- dy = -1;
- }
- else {
- /* read source rows from top to bottom */
- y = 0;
- dy = 1;
- }
-
- dst = _mesa_image_address2d(pack, dest, width, height,
- format, type, 0, 0);
- dstStride = _mesa_image_row_stride(pack, width, format, type);
-
- switch (combo) {
- case A8R8G8B8_UNORM_TO_RGBA_UBYTE:
- for (row = 0; row < height; row++) {
- const GLubyte *src = map + y * trans->stride;
- for (col = 0; col < width; col++) {
- GLuint pixel = ((GLuint *) src)[col];
- dst[col*4+0] = (pixel >> 16) & 0xff;
- dst[col*4+1] = (pixel >> 8) & 0xff;
- dst[col*4+2] = (pixel >> 0) & 0xff;
- dst[col*4+3] = ((pixel >> 24) & 0xff) | alphaORoperand;
- }
- dst += dstStride;
- y += dy;
- }
- break;
- case A8R8G8B8_UNORM_TO_RGB_UBYTE:
- for (row = 0; row < height; row++) {
- const GLubyte *src = map + y * trans->stride;
- for (col = 0; col < width; col++) {
- GLuint pixel = ((GLuint *) src)[col];
- dst[col*3+0] = (pixel >> 16) & 0xff;
- dst[col*3+1] = (pixel >> 8) & 0xff;
- dst[col*3+2] = (pixel >> 0) & 0xff;
- }
- dst += dstStride;
- y += dy;
- }
- break;
- case A8R8G8B8_UNORM_TO_BGRA_UINT:
- for (row = 0; row < height; row++) {
- const GLubyte *src = map + y * trans->stride;
- memcpy(dst, src, 4 * width);
- if (alphaORoperand) {
- assert(alphaORoperand == 0xff);
- for (col = 0; col < width; col++) {
- dst[col*4+3] = 0xff;
- }
- }
- dst += dstStride;
- y += dy;
- }
- break;
- case A8R8G8B8_UNORM_TO_RGBA_UINT:
- for (row = 0; row < height; row++) {
- const GLubyte *src = map + y * trans->stride;
- for (col = 0; col < width; col++) {
- GLuint pixel = ((GLuint *) src)[col];
- dst[col*4+0] = ((pixel >> 24) & 0xff) | alphaORoperand;
- dst[col*4+1] = (pixel >> 0) & 0xff;
- dst[col*4+2] = (pixel >> 8) & 0xff;
- dst[col*4+3] = (pixel >> 16) & 0xff;
- }
- dst += dstStride;
- y += dy;
- }
- break;
- default:
- ; /* nothing */
- }
-
- pipe_transfer_unmap(pipe, trans);
- pipe->transfer_destroy(pipe, trans);
- }
-
- return GL_TRUE;
-}
-
-
-/**
- * Do glReadPixels by getting rows from the framebuffer transfer with
- * get_tile(). Convert to requested format/type with Mesa image routines.
- * Image transfer ops are done in software too.
- */
-static void
-st_readpixels(struct gl_context *ctx, GLint x, GLint y, GLsizei width, GLsizei height,
- GLenum format, GLenum type,
- const struct gl_pixelstore_attrib *pack,
- GLvoid *dest)
-{
- struct st_context *st = st_context(ctx);
- struct pipe_context *pipe = st->pipe;
- GLfloat (*temp)[4];
- GLbitfield transferOps = ctx->_ImageTransferState;
- GLsizei i, j;
- GLint yStep, dfStride;
- GLfloat *df;
- struct st_renderbuffer *strb;
- struct gl_pixelstore_attrib clippedPacking = *pack;
- struct pipe_transfer *trans;
- enum pipe_format pformat;
-
- assert(ctx->ReadBuffer->Width > 0);
-
- st_validate_state(st);
-
- /* Do all needed clipping here, so that we can forget about it later */
- if (!_mesa_clip_readpixels(ctx, &x, &y, &width, &height, &clippedPacking)) {
- /* The ReadPixels transfer is totally outside the window bounds */
- return;
- }
-
- st_flush_bitmap_cache(st);
-
- dest = _mesa_map_pbo_dest(ctx, &clippedPacking, dest);
- if (!dest)
- return;
-
- if (format == GL_STENCIL_INDEX ||
- format == GL_DEPTH_STENCIL) {
- st_read_stencil_pixels(ctx, x, y, width, height,
- format, type, pack, dest);
- return;
- }
- else if (format == GL_DEPTH_COMPONENT) {
- strb = st_renderbuffer(ctx->ReadBuffer->_DepthBuffer);
- if (strb->Base.Wrapped) {
- strb = st_renderbuffer(strb->Base.Wrapped);
- }
- }
- else {
- /* Read color buffer */
- strb = st_get_color_read_renderbuffer(ctx);
- }
-
- if (!strb)
- return;
-
- /* try a fast-path readpixels before anything else */
- if (st_fast_readpixels(ctx, strb, x, y, width, height,
- format, type, pack, dest)) {
- /* success! */
- _mesa_unmap_pbo_dest(ctx, &clippedPacking);
- return;
- }
-
- /* allocate temp pixel row buffer */
- temp = (GLfloat (*)[4]) malloc(4 * width * sizeof(GLfloat));
- if (!temp) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "glReadPixels");
- return;
- }
-
- if(ctx->Color._ClampReadColor)
- transferOps |= IMAGE_CLAMP_BIT;
-
- if (format == GL_RGBA && type == GL_FLOAT && !transferOps) {
- /* write tile(row) directly into user's buffer */
- df = (GLfloat *) _mesa_image_address2d(&clippedPacking, dest, width,
- height, format, type, 0, 0);
- dfStride = width * 4;
- }
- else {
- /* write tile(row) into temp row buffer */
- df = (GLfloat *) temp;
- dfStride = 0;
- }
-
- if (st_fb_orientation(ctx->ReadBuffer) == Y_0_TOP) {
- /* convert GL Y to Gallium Y */
- y = strb->Base.Height - y - height;
- }
-
- /* Create a read transfer from the renderbuffer's texture */
- trans = pipe_get_transfer(pipe, strb->texture,
- 0, 0,
- PIPE_TRANSFER_READ,
- x, y, width, height);
-
- /* determine bottom-to-top vs. top-to-bottom order */
- if (st_fb_orientation(ctx->ReadBuffer) == Y_0_TOP) {
- y = height - 1;
- yStep = -1;
- }
- else {
- y = 0;
- yStep = 1;
- }
-
- /* possibly convert sRGB format to linear RGB format */
- pformat = util_format_linear(trans->resource->format);
-
- if (ST_DEBUG & DEBUG_FALLBACK)
- debug_printf("%s: fallback processing\n", __FUNCTION__);
-
- /*
- * Copy pixels from pipe_transfer to user memory
- */
- {
- /* dest of first pixel in client memory */
- GLubyte *dst = _mesa_image_address2d(&clippedPacking, dest, width,
- height, format, type, 0, 0);
- /* dest row stride */
- const GLint dstStride = _mesa_image_row_stride(&clippedPacking, width,
- format, type);
-
- if (pformat == PIPE_FORMAT_Z24_UNORM_S8_USCALED ||
- pformat == PIPE_FORMAT_Z24X8_UNORM) {
- if (format == GL_DEPTH_COMPONENT) {
- for (i = 0; i < height; i++) {
- GLuint ztemp[MAX_WIDTH];
- GLfloat zfloat[MAX_WIDTH];
- const double scale = 1.0 / ((1 << 24) - 1);
- pipe_get_tile_raw(pipe, trans, 0, y, width, 1, ztemp, 0);
- y += yStep;
- for (j = 0; j < width; j++) {
- zfloat[j] = (float) (scale * (ztemp[j] & 0xffffff));
- }
- _mesa_pack_depth_span(ctx, width, dst, type,
- zfloat, &clippedPacking);
- dst += dstStride;
- }
- }
- else {
- /* XXX: unreachable code -- should be before st_read_stencil_pixels */
- assert(format == GL_DEPTH_STENCIL_EXT);
- for (i = 0; i < height; i++) {
- GLuint *zshort = (GLuint *)dst;
- pipe_get_tile_raw(pipe, trans, 0, y, width, 1, dst, 0);
- y += yStep;
- /* Reverse into 24/8 */
- for (j = 0; j < width; j++) {
- zshort[j] = (zshort[j] << 8) | (zshort[j] >> 24);
- }
- dst += dstStride;
- }
- }
- }
- else if (pformat == PIPE_FORMAT_S8_USCALED_Z24_UNORM ||
- pformat == PIPE_FORMAT_X8Z24_UNORM) {
- if (format == GL_DEPTH_COMPONENT) {
- for (i = 0; i < height; i++) {
- GLuint ztemp[MAX_WIDTH];
- GLfloat zfloat[MAX_WIDTH];
- const double scale = 1.0 / ((1 << 24) - 1);
- pipe_get_tile_raw(pipe, trans, 0, y, width, 1, ztemp, 0);
- y += yStep;
- for (j = 0; j < width; j++) {
- zfloat[j] = (float) (scale * ((ztemp[j] >> 8) & 0xffffff));
- }
- _mesa_pack_depth_span(ctx, width, dst, type,
- zfloat, &clippedPacking);
- dst += dstStride;
- }
- }
- else {
- /* XXX: unreachable code -- should be before st_read_stencil_pixels */
- assert(format == GL_DEPTH_STENCIL_EXT);
- for (i = 0; i < height; i++) {
- pipe_get_tile_raw(pipe, trans, 0, y, width, 1, dst, 0);
- y += yStep;
- dst += dstStride;
- }
- }
- }
- else if (pformat == PIPE_FORMAT_Z16_UNORM) {
- for (i = 0; i < height; i++) {
- GLushort ztemp[MAX_WIDTH];
- GLfloat zfloat[MAX_WIDTH];
- const double scale = 1.0 / 0xffff;
- pipe_get_tile_raw(pipe, trans, 0, y, width, 1, ztemp, 0);
- y += yStep;
- for (j = 0; j < width; j++) {
- zfloat[j] = (float) (scale * ztemp[j]);
- }
- _mesa_pack_depth_span(ctx, width, dst, type,
- zfloat, &clippedPacking);
- dst += dstStride;
- }
- }
- else if (pformat == PIPE_FORMAT_Z32_UNORM) {
- for (i = 0; i < height; i++) {
- GLuint ztemp[MAX_WIDTH];
- GLfloat zfloat[MAX_WIDTH];
- const double scale = 1.0 / 0xffffffff;
- pipe_get_tile_raw(pipe, trans, 0, y, width, 1, ztemp, 0);
- y += yStep;
- for (j = 0; j < width; j++) {
- zfloat[j] = (float) (scale * ztemp[j]);
- }
- _mesa_pack_depth_span(ctx, width, dst, type,
- zfloat, &clippedPacking);
- dst += dstStride;
- }
- }
- else {
- /* RGBA format */
- /* Do a row at a time to flip image data vertically */
- for (i = 0; i < height; i++) {
- pipe_get_tile_rgba_format(pipe, trans, 0, y, width, 1,
- pformat, df);
- y += yStep;
- df += dfStride;
- if (!dfStride) {
- _mesa_pack_rgba_span_float(ctx, width, temp, format, type, dst,
- &clippedPacking, transferOps);
- dst += dstStride;
- }
- }
- }
- }
-
- free(temp);
-
- pipe->transfer_destroy(pipe, trans);
-
- _mesa_unmap_pbo_dest(ctx, &clippedPacking);
-}
-
-
-void st_init_readpixels_functions(struct dd_function_table *functions)
-{
- functions->ReadPixels = st_readpixels;
-}
+/**************************************************************************
+ *
+ * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ **************************************************************************/
+
+
+/**
+ * glReadPixels interface to pipe
+ *
+ * \author Brian Paul
+ */
+
+
+#include "main/imports.h"
+#include "main/bufferobj.h"
+#include "main/context.h"
+#include "main/image.h"
+#include "main/pack.h"
+#include "main/pbo.h"
+
+#include "pipe/p_context.h"
+#include "pipe/p_defines.h"
+#include "util/u_format.h"
+#include "util/u_inlines.h"
+#include "util/u_tile.h"
+
+#include "st_debug.h"
+#include "st_context.h"
+#include "st_atom.h"
+#include "st_cb_bitmap.h"
+#include "st_cb_readpixels.h"
+#include "st_cb_fbo.h"
+
+/**
+ * Special case for reading stencil buffer.
+ * For color/depth we use get_tile(). For stencil, map the stencil buffer.
+ */
+void
+st_read_stencil_pixels(struct gl_context *ctx, GLint x, GLint y,
+ GLsizei width, GLsizei height,
+ GLenum format, GLenum type,
+ const struct gl_pixelstore_attrib *packing,
+ GLvoid *pixels)
+{
+ struct gl_framebuffer *fb = ctx->ReadBuffer;
+ struct pipe_context *pipe = st_context(ctx)->pipe;
+ struct st_renderbuffer *strb = st_renderbuffer(fb->_StencilBuffer);
+ struct pipe_transfer *pt;
+ ubyte *stmap;
+ GLint j;
+
+ if (strb->Base.Wrapped) {
+ strb = st_renderbuffer(strb->Base.Wrapped);
+ }
+
+ if (st_fb_orientation(ctx->DrawBuffer) == Y_0_TOP) {
+ y = ctx->DrawBuffer->Height - y - height;
+ }
+
+ /* Create a read transfer from the renderbuffer's texture */
+
+ pt = pipe_get_transfer(pipe, strb->texture,
+ 0, 0,
+ PIPE_TRANSFER_READ,
+ x, y, width, height);
+
+ /* map the stencil buffer */
+ stmap = pipe_transfer_map(pipe, pt);
+
+ /* width should never be > MAX_WIDTH since we did clipping earlier */
+ ASSERT(width <= MAX_WIDTH);
+
+ /* process image row by row */
+ for (j = 0; j < height; j++) {
+ GLvoid *dest;
+ GLstencil sValues[MAX_WIDTH];
+ GLfloat zValues[MAX_WIDTH];
+ GLint srcY;
+
+ if (st_fb_orientation(ctx->DrawBuffer) == Y_0_TOP) {
+ srcY = height - j - 1;
+ }
+ else {
+ srcY = j;
+ }
+
+ /* get stencil (and Z) values */
+ switch (pt->resource->format) {
+ case PIPE_FORMAT_S8_USCALED:
+ {
+ const ubyte *src = stmap + srcY * pt->stride;
+ memcpy(sValues, src, width);
+ }
+ break;
+ case PIPE_FORMAT_Z24_UNORM_S8_USCALED:
+ if (format == GL_DEPTH_STENCIL) {
+ const uint *src = (uint *) (stmap + srcY * pt->stride);
+ const GLfloat scale = 1.0f / (0xffffff);
+ GLint k;
+ for (k = 0; k < width; k++) {
+ sValues[k] = src[k] >> 24;
+ zValues[k] = (src[k] & 0xffffff) * scale;
+ }
+ }
+ else {
+ const uint *src = (uint *) (stmap + srcY * pt->stride);
+ GLint k;
+ for (k = 0; k < width; k++) {
+ sValues[k] = src[k] >> 24;
+ }
+ }
+ break;
+ case PIPE_FORMAT_S8_USCALED_Z24_UNORM:
+ if (format == GL_DEPTH_STENCIL) {
+ const uint *src = (uint *) (stmap + srcY * pt->stride);
+ const GLfloat scale = 1.0f / (0xffffff);
+ GLint k;
+ for (k = 0; k < width; k++) {
+ sValues[k] = src[k] & 0xff;
+ zValues[k] = (src[k] >> 8) * scale;
+ }
+ }
+ else {
+ const uint *src = (uint *) (stmap + srcY * pt->stride);
+ GLint k;
+ for (k = 0; k < width; k++) {
+ sValues[k] = src[k] & 0xff;
+ }
+ }
+ break;
+ default:
+ assert(0);
+ }
+
+ /* store */
+ dest = _mesa_image_address2d(packing, pixels, width, height,
+ format, type, j, 0);
+ if (format == GL_DEPTH_STENCIL) {
+ _mesa_pack_depth_stencil_span(ctx, width, dest,
+ zValues, sValues, packing);
+ }
+ else {
+ _mesa_pack_stencil_span(ctx, width, type, dest, sValues, packing);
+ }
+ }
+
+ /* unmap the stencil buffer */
+ pipe_transfer_unmap(pipe, pt);
+ pipe->transfer_destroy(pipe, pt);
+}
+
+
+/**
+ * Return renderbuffer to use for reading color pixels for glRead/CopyPixel
+ * commands.
+ */
+struct st_renderbuffer *
+st_get_color_read_renderbuffer(struct gl_context *ctx)
+{
+ struct gl_framebuffer *fb = ctx->ReadBuffer;
+ struct st_renderbuffer *strb =
+ st_renderbuffer(fb->_ColorReadBuffer);
+
+ return strb;
+}
+
+
+/**
+ * Try to do glReadPixels in a fast manner for common cases.
+ * \return GL_TRUE for success, GL_FALSE for failure
+ */
+static GLboolean
+st_fast_readpixels(struct gl_context *ctx, struct st_renderbuffer *strb,
+ GLint x, GLint y, GLsizei width, GLsizei height,
+ GLenum format, GLenum type,
+ const struct gl_pixelstore_attrib *pack,
+ GLvoid *dest)
+{
+ GLubyte alphaORoperand;
+ enum combination {
+ A8R8G8B8_UNORM_TO_RGBA_UBYTE,
+ A8R8G8B8_UNORM_TO_RGB_UBYTE,
+ A8R8G8B8_UNORM_TO_BGRA_UINT,
+ A8R8G8B8_UNORM_TO_RGBA_UINT
+ } combo;
+
+ if (ctx->_ImageTransferState)
+ return GL_FALSE;
+
+ if (strb->format == PIPE_FORMAT_B8G8R8A8_UNORM) {
+ alphaORoperand = 0;
+ }
+ else if (strb->format == PIPE_FORMAT_B8G8R8X8_UNORM ) {
+ alphaORoperand = 0xff;
+ }
+ else {
+ return GL_FALSE;
+ }
+
+ if (format == GL_RGBA && type == GL_UNSIGNED_BYTE) {
+ combo = A8R8G8B8_UNORM_TO_RGBA_UBYTE;
+ }
+ else if (format == GL_RGB && type == GL_UNSIGNED_BYTE) {
+ combo = A8R8G8B8_UNORM_TO_RGB_UBYTE;
+ }
+ else if (format == GL_BGRA && type == GL_UNSIGNED_INT_8_8_8_8_REV) {
+ combo = A8R8G8B8_UNORM_TO_BGRA_UINT;
+ }
+ else if (format == GL_RGBA && type == GL_UNSIGNED_INT_8_8_8_8) {
+ combo = A8R8G8B8_UNORM_TO_RGBA_UINT;
+ }
+ else {
+ return GL_FALSE;
+ }
+
+ /*printf("st_fast_readpixels combo %d\n", (GLint) combo);*/
+
+ {
+ struct pipe_context *pipe = st_context(ctx)->pipe;
+ struct pipe_transfer *trans;
+ const GLubyte *map;
+ GLubyte *dst;
+ GLint row, col, dy, dstStride;
+
+ if (st_fb_orientation(ctx->ReadBuffer) == Y_0_TOP) {
+ /* convert GL Y to Gallium Y */
+ y = strb->texture->height0 - y - height;
+ }
+
+ trans = pipe_get_transfer(pipe, strb->texture,
+ 0, 0,
+ PIPE_TRANSFER_READ,
+ x, y, width, height);
+ if (!trans) {
+ return GL_FALSE;
+ }
+
+ map = pipe_transfer_map(pipe, trans);
+ if (!map) {
+ pipe->transfer_destroy(pipe, trans);
+ return GL_FALSE;
+ }
+
+ /* We always write to the user/dest buffer from low addr to high addr
+ * but the read order depends on renderbuffer orientation
+ */
+ if (st_fb_orientation(ctx->ReadBuffer) == Y_0_TOP) {
+ /* read source rows from bottom to top */
+ y = height - 1;
+ dy = -1;
+ }
+ else {
+ /* read source rows from top to bottom */
+ y = 0;
+ dy = 1;
+ }
+
+ dst = _mesa_image_address2d(pack, dest, width, height,
+ format, type, 0, 0);
+ dstStride = _mesa_image_row_stride(pack, width, format, type);
+
+ switch (combo) {
+ case A8R8G8B8_UNORM_TO_RGBA_UBYTE:
+ for (row = 0; row < height; row++) {
+ const GLubyte *src = map + y * trans->stride;
+ for (col = 0; col < width; col++) {
+ GLuint pixel = ((GLuint *) src)[col];
+ dst[col*4+0] = (pixel >> 16) & 0xff;
+ dst[col*4+1] = (pixel >> 8) & 0xff;
+ dst[col*4+2] = (pixel >> 0) & 0xff;
+ dst[col*4+3] = ((pixel >> 24) & 0xff) | alphaORoperand;
+ }
+ dst += dstStride;
+ y += dy;
+ }
+ break;
+ case A8R8G8B8_UNORM_TO_RGB_UBYTE:
+ for (row = 0; row < height; row++) {
+ const GLubyte *src = map + y * trans->stride;
+ for (col = 0; col < width; col++) {
+ GLuint pixel = ((GLuint *) src)[col];
+ dst[col*3+0] = (pixel >> 16) & 0xff;
+ dst[col*3+1] = (pixel >> 8) & 0xff;
+ dst[col*3+2] = (pixel >> 0) & 0xff;
+ }
+ dst += dstStride;
+ y += dy;
+ }
+ break;
+ case A8R8G8B8_UNORM_TO_BGRA_UINT:
+ for (row = 0; row < height; row++) {
+ const GLubyte *src = map + y * trans->stride;
+ memcpy(dst, src, 4 * width);
+ if (alphaORoperand) {
+ assert(alphaORoperand == 0xff);
+ for (col = 0; col < width; col++) {
+ dst[col*4+3] = 0xff;
+ }
+ }
+ dst += dstStride;
+ y += dy;
+ }
+ break;
+ case A8R8G8B8_UNORM_TO_RGBA_UINT:
+ for (row = 0; row < height; row++) {
+ const GLubyte *src = map + y * trans->stride;
+ for (col = 0; col < width; col++) {
+ GLuint pixel = ((GLuint *) src)[col];
+ dst[col*4+0] = ((pixel >> 24) & 0xff) | alphaORoperand;
+ dst[col*4+1] = (pixel >> 0) & 0xff;
+ dst[col*4+2] = (pixel >> 8) & 0xff;
+ dst[col*4+3] = (pixel >> 16) & 0xff;
+ }
+ dst += dstStride;
+ y += dy;
+ }
+ break;
+ default:
+ ; /* nothing */
+ }
+
+ pipe_transfer_unmap(pipe, trans);
+ pipe->transfer_destroy(pipe, trans);
+ }
+
+ return GL_TRUE;
+}
+
+
+/**
+ * Do glReadPixels by getting rows from the framebuffer transfer with
+ * get_tile(). Convert to requested format/type with Mesa image routines.
+ * Image transfer ops are done in software too.
+ */
+static void
+st_readpixels(struct gl_context *ctx, GLint x, GLint y, GLsizei width, GLsizei height,
+ GLenum format, GLenum type,
+ const struct gl_pixelstore_attrib *pack,
+ GLvoid *dest)
+{
+ struct st_context *st = st_context(ctx);
+ struct pipe_context *pipe = st->pipe;
+ GLfloat (*temp)[4];
+ GLbitfield transferOps = ctx->_ImageTransferState;
+ GLsizei i, j;
+ GLint yStep, dfStride;
+ GLfloat *df;
+ struct st_renderbuffer *strb;
+ struct gl_pixelstore_attrib clippedPacking = *pack;
+ struct pipe_transfer *trans;
+ enum pipe_format pformat;
+
+ assert(ctx->ReadBuffer->Width > 0);
+
+ st_validate_state(st);
+
+ /* Do all needed clipping here, so that we can forget about it later */
+ if (!_mesa_clip_readpixels(ctx, &x, &y, &width, &height, &clippedPacking)) {
+ /* The ReadPixels transfer is totally outside the window bounds */
+ return;
+ }
+
+ st_flush_bitmap_cache(st);
+
+ dest = _mesa_map_pbo_dest(ctx, &clippedPacking, dest);
+ if (!dest)
+ return;
+
+ if (format == GL_STENCIL_INDEX ||
+ format == GL_DEPTH_STENCIL) {
+ st_read_stencil_pixels(ctx, x, y, width, height,
+ format, type, pack, dest);
+ return;
+ }
+ else if (format == GL_DEPTH_COMPONENT) {
+ strb = st_renderbuffer(ctx->ReadBuffer->_DepthBuffer);
+ if (strb->Base.Wrapped) {
+ strb = st_renderbuffer(strb->Base.Wrapped);
+ }
+ }
+ else {
+ /* Read color buffer */
+ strb = st_get_color_read_renderbuffer(ctx);
+ }
+
+ if (!strb)
+ return;
+
+ /* try a fast-path readpixels before anything else */
+ if (st_fast_readpixels(ctx, strb, x, y, width, height,
+ format, type, pack, dest)) {
+ /* success! */
+ _mesa_unmap_pbo_dest(ctx, &clippedPacking);
+ return;
+ }
+
+ /* allocate temp pixel row buffer */
+ temp = (GLfloat (*)[4]) malloc(4 * width * sizeof(GLfloat));
+ if (!temp) {
+ _mesa_error(ctx, GL_OUT_OF_MEMORY, "glReadPixels");
+ return;
+ }
+
+ if(ctx->Color._ClampReadColor)
+ transferOps |= IMAGE_CLAMP_BIT;
+
+ if (format == GL_RGBA && type == GL_FLOAT && !transferOps) {
+ /* write tile(row) directly into user's buffer */
+ df = (GLfloat *) _mesa_image_address2d(&clippedPacking, dest, width,
+ height, format, type, 0, 0);
+ dfStride = width * 4;
+ }
+ else {
+ /* write tile(row) into temp row buffer */
+ df = (GLfloat *) temp;
+ dfStride = 0;
+ }
+
+ if (st_fb_orientation(ctx->ReadBuffer) == Y_0_TOP) {
+ /* convert GL Y to Gallium Y */
+ y = strb->Base.Height - y - height;
+ }
+
+ /* Create a read transfer from the renderbuffer's texture */
+ trans = pipe_get_transfer(pipe, strb->texture,
+ 0, 0,
+ PIPE_TRANSFER_READ,
+ x, y, width, height);
+
+ /* determine bottom-to-top vs. top-to-bottom order */
+ if (st_fb_orientation(ctx->ReadBuffer) == Y_0_TOP) {
+ y = height - 1;
+ yStep = -1;
+ }
+ else {
+ y = 0;
+ yStep = 1;
+ }
+
+ /* possibly convert sRGB format to linear RGB format */
+ pformat = util_format_linear(trans->resource->format);
+
+ if (ST_DEBUG & DEBUG_FALLBACK)
+ debug_printf("%s: fallback processing\n", __FUNCTION__);
+
+ /*
+ * Copy pixels from pipe_transfer to user memory
+ */
+ {
+ /* dest of first pixel in client memory */
+ GLubyte *dst = _mesa_image_address2d(&clippedPacking, dest, width,
+ height, format, type, 0, 0);
+ /* dest row stride */
+ const GLint dstStride = _mesa_image_row_stride(&clippedPacking, width,
+ format, type);
+
+ if (pformat == PIPE_FORMAT_Z24_UNORM_S8_USCALED ||
+ pformat == PIPE_FORMAT_Z24X8_UNORM) {
+ if (format == GL_DEPTH_COMPONENT) {
+ for (i = 0; i < height; i++) {
+ GLuint ztemp[MAX_WIDTH];
+ GLfloat zfloat[MAX_WIDTH];
+ const double scale = 1.0 / ((1 << 24) - 1);
+ pipe_get_tile_raw(pipe, trans, 0, y, width, 1, ztemp, 0);
+ y += yStep;
+ for (j = 0; j < width; j++) {
+ zfloat[j] = (float) (scale * (ztemp[j] & 0xffffff));
+ }
+ _mesa_pack_depth_span(ctx, width, dst, type,
+ zfloat, &clippedPacking);
+ dst += dstStride;
+ }
+ }
+ else {
+ /* XXX: unreachable code -- should be before st_read_stencil_pixels */
+ assert(format == GL_DEPTH_STENCIL_EXT);
+ for (i = 0; i < height; i++) {
+ GLuint *zshort = (GLuint *)dst;
+ pipe_get_tile_raw(pipe, trans, 0, y, width, 1, dst, 0);
+ y += yStep;
+ /* Reverse into 24/8 */
+ for (j = 0; j < width; j++) {
+ zshort[j] = (zshort[j] << 8) | (zshort[j] >> 24);
+ }
+ dst += dstStride;
+ }
+ }
+ }
+ else if (pformat == PIPE_FORMAT_S8_USCALED_Z24_UNORM ||
+ pformat == PIPE_FORMAT_X8Z24_UNORM) {
+ if (format == GL_DEPTH_COMPONENT) {
+ for (i = 0; i < height; i++) {
+ GLuint ztemp[MAX_WIDTH];
+ GLfloat zfloat[MAX_WIDTH];
+ const double scale = 1.0 / ((1 << 24) - 1);
+ pipe_get_tile_raw(pipe, trans, 0, y, width, 1, ztemp, 0);
+ y += yStep;
+ for (j = 0; j < width; j++) {
+ zfloat[j] = (float) (scale * ((ztemp[j] >> 8) & 0xffffff));
+ }
+ _mesa_pack_depth_span(ctx, width, dst, type,
+ zfloat, &clippedPacking);
+ dst += dstStride;
+ }
+ }
+ else {
+ /* XXX: unreachable code -- should be before st_read_stencil_pixels */
+ assert(format == GL_DEPTH_STENCIL_EXT);
+ for (i = 0; i < height; i++) {
+ pipe_get_tile_raw(pipe, trans, 0, y, width, 1, dst, 0);
+ y += yStep;
+ dst += dstStride;
+ }
+ }
+ }
+ else if (pformat == PIPE_FORMAT_Z16_UNORM) {
+ for (i = 0; i < height; i++) {
+ GLushort ztemp[MAX_WIDTH];
+ GLfloat zfloat[MAX_WIDTH];
+ const double scale = 1.0 / 0xffff;
+ pipe_get_tile_raw(pipe, trans, 0, y, width, 1, ztemp, 0);
+ y += yStep;
+ for (j = 0; j < width; j++) {
+ zfloat[j] = (float) (scale * ztemp[j]);
+ }
+ _mesa_pack_depth_span(ctx, width, dst, type,
+ zfloat, &clippedPacking);
+ dst += dstStride;
+ }
+ }
+ else if (pformat == PIPE_FORMAT_Z32_UNORM) {
+ for (i = 0; i < height; i++) {
+ GLuint ztemp[MAX_WIDTH];
+ GLfloat zfloat[MAX_WIDTH];
+ const double scale = 1.0 / 0xffffffff;
+ pipe_get_tile_raw(pipe, trans, 0, y, width, 1, ztemp, 0);
+ y += yStep;
+ for (j = 0; j < width; j++) {
+ zfloat[j] = (float) (scale * ztemp[j]);
+ }
+ _mesa_pack_depth_span(ctx, width, dst, type,
+ zfloat, &clippedPacking);
+ dst += dstStride;
+ }
+ }
+ else {
+ /* RGBA format */
+ /* Do a row at a time to flip image data vertically */
+ for (i = 0; i < height; i++) {
+ pipe_get_tile_rgba_format(pipe, trans, 0, y, width, 1,
+ pformat, df);
+ y += yStep;
+ df += dfStride;
+ if (!dfStride) {
+ _mesa_pack_rgba_span_float(ctx, width, temp, format, type, dst,
+ &clippedPacking, transferOps);
+ dst += dstStride;
+ }
+ }
+ }
+ }
+
+ free(temp);
+
+ pipe->transfer_destroy(pipe, trans);
+
+ _mesa_unmap_pbo_dest(ctx, &clippedPacking);
+}
+
+
+void st_init_readpixels_functions(struct dd_function_table *functions)
+{
+ functions->ReadPixels = st_readpixels;
+}
diff --git a/mesalib/src/mesa/state_tracker/st_cb_texture.c b/mesalib/src/mesa/state_tracker/st_cb_texture.c
index a27c30e51..74f9449b7 100644
--- a/mesalib/src/mesa/state_tracker/st_cb_texture.c
+++ b/mesalib/src/mesa/state_tracker/st_cb_texture.c
@@ -1,1948 +1,1948 @@
-/**************************************************************************
- *
- * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas.
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sub license, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice (including the
- * next paragraph) shall be included in all copies or substantial portions
- * of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
- * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
- * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- **************************************************************************/
-
-#include "main/mfeatures.h"
-#include "main/bufferobj.h"
-#include "main/enums.h"
-#include "main/fbobject.h"
-#include "main/formats.h"
-#include "main/image.h"
-#include "main/imports.h"
-#include "main/macros.h"
-#include "main/mipmap.h"
-#include "main/pack.h"
-#include "main/pbo.h"
-#include "main/pixeltransfer.h"
-#include "main/texcompress.h"
-#include "main/texfetch.h"
-#include "main/texgetimage.h"
-#include "main/teximage.h"
-#include "main/texobj.h"
-#include "main/texstore.h"
-
-#include "state_tracker/st_debug.h"
-#include "state_tracker/st_context.h"
-#include "state_tracker/st_cb_fbo.h"
-#include "state_tracker/st_cb_flush.h"
-#include "state_tracker/st_cb_texture.h"
-#include "state_tracker/st_format.h"
-#include "state_tracker/st_texture.h"
-#include "state_tracker/st_gen_mipmap.h"
-#include "state_tracker/st_atom.h"
-
-#include "pipe/p_context.h"
-#include "pipe/p_defines.h"
-#include "util/u_inlines.h"
-#include "pipe/p_shader_tokens.h"
-#include "util/u_tile.h"
-#include "util/u_blit.h"
-#include "util/u_format.h"
-#include "util/u_surface.h"
-#include "util/u_sampler.h"
-#include "util/u_math.h"
-#include "util/u_box.h"
-
-#define DBG if (0) printf
-
-
-static enum pipe_texture_target
-gl_target_to_pipe(GLenum target)
-{
- switch (target) {
- case GL_TEXTURE_1D:
- return PIPE_TEXTURE_1D;
- case GL_TEXTURE_2D:
- return PIPE_TEXTURE_2D;
- case GL_TEXTURE_RECTANGLE_NV:
- return PIPE_TEXTURE_RECT;
- case GL_TEXTURE_3D:
- return PIPE_TEXTURE_3D;
- case GL_TEXTURE_CUBE_MAP_ARB:
- return PIPE_TEXTURE_CUBE;
- case GL_TEXTURE_1D_ARRAY_EXT:
- return PIPE_TEXTURE_1D_ARRAY;
- case GL_TEXTURE_2D_ARRAY_EXT:
- return PIPE_TEXTURE_2D_ARRAY;
- case GL_TEXTURE_BUFFER:
- return PIPE_BUFFER;
- default:
- assert(0);
- return 0;
- }
-}
-
-
-/** called via ctx->Driver.NewTextureImage() */
-static struct gl_texture_image *
-st_NewTextureImage(struct gl_context * ctx)
-{
- DBG("%s\n", __FUNCTION__);
- (void) ctx;
- return (struct gl_texture_image *) ST_CALLOC_STRUCT(st_texture_image);
-}
-
-
-/** called via ctx->Driver.NewTextureObject() */
-static struct gl_texture_object *
-st_NewTextureObject(struct gl_context * ctx, GLuint name, GLenum target)
-{
- struct st_texture_object *obj = ST_CALLOC_STRUCT(st_texture_object);
-
- DBG("%s\n", __FUNCTION__);
- _mesa_initialize_texture_object(&obj->base, name, target);
-
- return &obj->base;
-}
-
-/** called via ctx->Driver.DeleteTextureObject() */
-static void
-st_DeleteTextureObject(struct gl_context *ctx,
- struct gl_texture_object *texObj)
-{
- struct st_context *st = st_context(ctx);
- struct st_texture_object *stObj = st_texture_object(texObj);
- if (stObj->pt)
- pipe_resource_reference(&stObj->pt, NULL);
- if (stObj->sampler_view) {
- if (stObj->sampler_view->context != st->pipe) {
- /* Take "ownership" of this texture sampler view by setting
- * its context pointer to this context. This avoids potential
- * crashes when the texture object is shared among contexts
- * and the original/owner context has already been destroyed.
- */
- stObj->sampler_view->context = st->pipe;
- }
- pipe_sampler_view_reference(&stObj->sampler_view, NULL);
- }
- _mesa_delete_texture_object(ctx, texObj);
-}
-
-
-/** called via ctx->Driver.FreeTexImageData() */
-static void
-st_FreeTextureImageData(struct gl_context * ctx, struct gl_texture_image *texImage)
-{
- struct st_texture_image *stImage = st_texture_image(texImage);
-
- DBG("%s\n", __FUNCTION__);
-
- if (stImage->pt) {
- pipe_resource_reference(&stImage->pt, NULL);
- }
-
- if (texImage->Data) {
- _mesa_align_free(texImage->Data);
- texImage->Data = NULL;
- }
-}
-
-
-/**
- * From linux kernel i386 header files, copes with odd sizes better
- * than COPY_DWORDS would:
- * XXX Put this in src/mesa/main/imports.h ???
- */
-#if defined(PIPE_CC_GCC) && defined(PIPE_ARCH_X86)
-static INLINE void *
-__memcpy(void *to, const void *from, size_t n)
-{
- int d0, d1, d2;
- __asm__ __volatile__("rep ; movsl\n\t"
- "testb $2,%b4\n\t"
- "je 1f\n\t"
- "movsw\n"
- "1:\ttestb $1,%b4\n\t"
- "je 2f\n\t"
- "movsb\n" "2:":"=&c"(d0), "=&D"(d1), "=&S"(d2)
- :"0"(n / 4), "q"(n), "1"((long) to), "2"((long) from)
- :"memory");
- return (to);
-}
-#else
-#define __memcpy(a,b,c) memcpy(a,b,c)
-#endif
-
-
-/**
- * The system memcpy (at least on ubuntu 5.10) has problems copying
- * to agp (writecombined) memory from a source which isn't 64-byte
- * aligned - there is a 4x performance falloff.
- *
- * The x86 __memcpy is immune to this but is slightly slower
- * (10%-ish) than the system memcpy.
- *
- * The sse_memcpy seems to have a slight cliff at 64/32 bytes, but
- * isn't much faster than x86_memcpy for agp copies.
- *
- * TODO: switch dynamically.
- */
-static void *
-do_memcpy(void *dest, const void *src, size_t n)
-{
- if ((((unsigned long) src) & 63) || (((unsigned long) dest) & 63)) {
- return __memcpy(dest, src, n);
- }
- else
- return memcpy(dest, src, n);
-}
-
-
-/**
- * Return default texture resource binding bitmask for the given format.
- */
-static GLuint
-default_bindings(struct st_context *st, enum pipe_format format)
-{
- struct pipe_screen *screen = st->pipe->screen;
- const unsigned target = PIPE_TEXTURE_2D;
- unsigned bindings;
-
- if (util_format_is_depth_or_stencil(format))
- bindings = PIPE_BIND_SAMPLER_VIEW | PIPE_BIND_DEPTH_STENCIL;
- else
- bindings = PIPE_BIND_SAMPLER_VIEW | PIPE_BIND_RENDER_TARGET;
-
- if (screen->is_format_supported(screen, format, target, 0, bindings))
- return bindings;
- else {
- /* Try non-sRGB. */
- format = util_format_linear(format);
-
- if (screen->is_format_supported(screen, format, target, 0, bindings))
- return bindings;
- else
- return PIPE_BIND_SAMPLER_VIEW;
- }
-}
-
-
-/** Return number of image dimensions (1, 2 or 3) for a texture target. */
-static GLuint
-get_texture_dims(GLenum target)
-{
- switch (target) {
- case GL_TEXTURE_1D:
- case GL_TEXTURE_1D_ARRAY_EXT:
- case GL_TEXTURE_BUFFER:
- return 1;
- case GL_TEXTURE_2D:
- case GL_TEXTURE_CUBE_MAP_ARB:
- case GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB:
- case GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB:
- case GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB:
- case GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB:
- case GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB:
- case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB:
- case GL_TEXTURE_RECTANGLE_NV:
- case GL_TEXTURE_2D_ARRAY_EXT:
- return 2;
- case GL_TEXTURE_3D:
- return 3;
- default:
- assert(0 && "invalid texture target in get_texture_dims()");
- return 1;
- }
-}
-
-
-/**
- * Given the size of a mipmap image, try to compute the size of the level=0
- * mipmap image.
- *
- * Note that this isn't always accurate for odd-sized, non-POW textures.
- * For example, if level=1 and width=40 then the level=0 width may be 80 or 81.
- *
- * \return GL_TRUE for success, GL_FALSE for failure
- */
-static GLboolean
-guess_base_level_size(GLenum target,
- GLuint width, GLuint height, GLuint depth, GLuint level,
- GLuint *width0, GLuint *height0, GLuint *depth0)
-{
- const GLuint dims = get_texture_dims(target);
-
- assert(width >= 1);
- assert(height >= 1);
- assert(depth >= 1);
-
- if (level > 0) {
- /* Depending on the image's size, we can't always make a guess here */
- if ((dims >= 1 && width == 1) ||
- (dims >= 2 && height == 1) ||
- (dims >= 3 && depth == 1)) {
- /* we can't determine the image size at level=0 */
- return GL_FALSE;
- }
-
- /* grow the image size until we hit level = 0 */
- while (level > 0) {
- if (width > 1)
- width <<= 1;
- if (height > 1)
- height <<= 1;
- if (depth > 1)
- depth <<= 1;
- level--;
- }
- }
-
- *width0 = width;
- *height0 = height;
- *depth0 = depth;
-
- return GL_TRUE;
-}
-
-
-/**
- * Try to allocate a pipe_resource object for the given st_texture_object.
- *
- * We use the given st_texture_image as a clue to determine the size of the
- * mipmap image at level=0.
- *
- * \return GL_TRUE for success, GL_FALSE if out of memory.
- */
-static GLboolean
-guess_and_alloc_texture(struct st_context *st,
- struct st_texture_object *stObj,
- const struct st_texture_image *stImage)
-{
- GLuint lastLevel, width, height, depth;
- GLuint bindings;
- GLuint ptWidth, ptHeight, ptDepth, ptLayers;
- enum pipe_format fmt;
-
- DBG("%s\n", __FUNCTION__);
-
- assert(!stObj->pt);
-
- if (!guess_base_level_size(stObj->base.Target,
- stImage->base.Width2,
- stImage->base.Height2,
- stImage->base.Depth2,
- stImage->level,
- &width, &height, &depth)) {
- /* we can't determine the image size at level=0 */
- stObj->width0 = stObj->height0 = stObj->depth0 = 0;
- /* this is not an out of memory error */
- return GL_TRUE;
- }
-
- /* At this point, (width x height x depth) is the expected size of
- * the level=0 mipmap image.
- */
-
- /* Guess a reasonable value for lastLevel. With OpenGL we have no
- * idea how many mipmap levels will be in a texture until we start
- * to render with it. Make an educated guess here but be prepared
- * to re-allocating a texture buffer with space for more (or fewer)
- * mipmap levels later.
- */
- if ((stObj->base.Sampler.MinFilter == GL_NEAREST ||
- stObj->base.Sampler.MinFilter == GL_LINEAR ||
- stImage->base._BaseFormat == GL_DEPTH_COMPONENT ||
- stImage->base._BaseFormat == GL_DEPTH_STENCIL_EXT) &&
- !stObj->base.GenerateMipmap &&
- stImage->level == 0) {
- /* only alloc space for a single mipmap level */
- lastLevel = 0;
- }
- else {
- /* alloc space for a full mipmap */
- GLuint l2width = util_logbase2(width);
- GLuint l2height = util_logbase2(height);
- GLuint l2depth = util_logbase2(depth);
- lastLevel = MAX2(MAX2(l2width, l2height), l2depth);
- }
-
- /* Save the level=0 dimensions */
- stObj->width0 = width;
- stObj->height0 = height;
- stObj->depth0 = depth;
-
- fmt = st_mesa_format_to_pipe_format(stImage->base.TexFormat);
-
- bindings = default_bindings(st, fmt);
-
- st_gl_texture_dims_to_pipe_dims(stObj->base.Target,
- width, height, depth,
- &ptWidth, &ptHeight, &ptDepth, &ptLayers);
-
- stObj->pt = st_texture_create(st,
- gl_target_to_pipe(stObj->base.Target),
- fmt,
- lastLevel,
- ptWidth,
- ptHeight,
- ptDepth,
- ptLayers,
- bindings);
-
- DBG("%s returning %d\n", __FUNCTION__, (stObj->pt != NULL));
-
- return stObj->pt != NULL;
-}
-
-
-/**
- * Adjust pixel unpack params and image dimensions to strip off the
- * texture border.
- * Gallium doesn't support texture borders. They've seldem been used
- * and seldom been implemented correctly anyway.
- * \param unpackNew returns the new pixel unpack parameters
- */
-static void
-strip_texture_border(GLint border,
- GLint *width, GLint *height, GLint *depth,
- const struct gl_pixelstore_attrib *unpack,
- struct gl_pixelstore_attrib *unpackNew)
-{
- assert(border > 0); /* sanity check */
-
- *unpackNew = *unpack;
-
- if (unpackNew->RowLength == 0)
- unpackNew->RowLength = *width;
-
- if (depth && unpackNew->ImageHeight == 0)
- unpackNew->ImageHeight = *height;
-
- unpackNew->SkipPixels += border;
- if (height)
- unpackNew->SkipRows += border;
- if (depth)
- unpackNew->SkipImages += border;
-
- assert(*width >= 3);
- *width = *width - 2 * border;
- if (height && *height >= 3)
- *height = *height - 2 * border;
- if (depth && *depth >= 3)
- *depth = *depth - 2 * border;
-}
-
-
-/**
- * Do glTexImage1/2/3D().
- */
-static void
-st_TexImage(struct gl_context * ctx,
- GLint dims,
- GLenum target, GLint level,
- GLint internalFormat,
- GLint width, GLint height, GLint depth,
- GLint border,
- GLenum format, GLenum type, const void *pixels,
- const struct gl_pixelstore_attrib *unpack,
- struct gl_texture_object *texObj,
- struct gl_texture_image *texImage,
- GLsizei imageSize, GLboolean compressed_src)
-{
- struct st_context *st = st_context(ctx);
- struct st_texture_object *stObj = st_texture_object(texObj);
- struct st_texture_image *stImage = st_texture_image(texImage);
- GLuint dstRowStride = 0;
- struct gl_pixelstore_attrib unpackNB;
- enum pipe_transfer_usage transfer_usage = 0;
-
- DBG("%s target %s level %d %dx%dx%d border %d\n", __FUNCTION__,
- _mesa_lookup_enum_by_nr(target), level, width, height, depth, border);
-
- /* switch to "normal" */
- if (stObj->surface_based) {
- gl_format texFormat;
-
- _mesa_clear_texture_object(ctx, texObj);
- pipe_resource_reference(&stObj->pt, NULL);
-
- /* oops, need to init this image again */
- texFormat = _mesa_choose_texture_format(ctx, texObj, target, level,
- internalFormat, format, type);
-
- _mesa_init_teximage_fields(ctx, target, texImage,
- width, height, depth, border,
- internalFormat, texFormat);
-
- stObj->surface_based = GL_FALSE;
- }
-
- /* gallium does not support texture borders, strip it off */
- if (border) {
- strip_texture_border(border, &width, &height, &depth, unpack, &unpackNB);
- unpack = &unpackNB;
- texImage->Width = width;
- texImage->Height = height;
- texImage->Depth = depth;
- texImage->Border = 0;
- border = 0;
- }
- else {
- assert(texImage->Width == width);
- assert(texImage->Height == height);
- assert(texImage->Depth == depth);
- }
-
- stImage->face = _mesa_tex_target_to_face(target);
- stImage->level = level;
-
- _mesa_set_fetch_functions(texImage, dims);
-
- /* Release the reference to a potentially orphaned buffer.
- * Release any old malloced memory.
- */
- if (stImage->pt) {
- pipe_resource_reference(&stImage->pt, NULL);
- assert(!texImage->Data);
- }
- else if (texImage->Data) {
- _mesa_align_free(texImage->Data);
- }
-
- /*
- * See if the new image is somehow incompatible with the existing
- * mipmap. If so, free the old mipmap.
- */
- if (stObj->pt) {
- if (level > (GLint) stObj->pt->last_level ||
- !st_texture_match_image(stObj->pt, &stImage->base,
- stImage->face, stImage->level)) {
- DBG("release it\n");
- pipe_resource_reference(&stObj->pt, NULL);
- assert(!stObj->pt);
- pipe_sampler_view_reference(&stObj->sampler_view, NULL);
- }
- }
-
- if (width == 0 || height == 0 || depth == 0) {
- /* stop after freeing old image */
- return;
- }
-
- if (!stObj->pt) {
- if (!guess_and_alloc_texture(st, stObj, stImage)) {
- /* Probably out of memory.
- * Try flushing any pending rendering, then retry.
- */
- st_finish(st);
- if (!guess_and_alloc_texture(st, stObj, stImage)) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage");
- return;
- }
- }
- }
-
- assert(!stImage->pt);
-
- /* Check if this texture image can live inside the texture object's buffer.
- * If so, store the image there. Otherwise the image will temporarily live
- * in its own buffer.
- */
- if (stObj->pt &&
- st_texture_match_image(stObj->pt, &stImage->base,
- stImage->face, stImage->level)) {
-
- pipe_resource_reference(&stImage->pt, stObj->pt);
- assert(stImage->pt);
- }
-
- if (!stImage->pt)
- DBG("XXX: Image did not fit into texture - storing in local memory!\n");
-
- /* Pixel data may come from regular user memory or a PBO. For the later,
- * do bounds checking and map the PBO to read pixels data from it.
- *
- * XXX we should try to use a GPU-accelerated path to copy the image data
- * from the PBO to the texture.
- */
- if (compressed_src) {
- pixels = _mesa_validate_pbo_compressed_teximage(ctx, imageSize, pixels,
- unpack,
- "glCompressedTexImage");
- }
- else {
- pixels = _mesa_validate_pbo_teximage(ctx, dims, width, height, 1,
- format, type,
- pixels, unpack, "glTexImage");
- }
-
- /* for a 1D array upload the image as a series of layer with height = 1 */
- if (target == GL_TEXTURE_1D_ARRAY) {
- depth = height;
- height = 1;
- }
-
- /*
- * Prepare to store the texture data. Either map the gallium texture buffer
- * memory or malloc space for it.
- */
- if (stImage->pt) {
- if (!pixels) {
- /* We've allocated texture resource, but have no pixel data - all done. */
- goto done;
- }
-
- /* Store the image in the gallium transfer object */
- if (format == GL_DEPTH_COMPONENT &&
- util_format_is_depth_and_stencil(stImage->pt->format))
- transfer_usage = PIPE_TRANSFER_READ_WRITE;
- else
- transfer_usage = PIPE_TRANSFER_WRITE;
-
- texImage->Data = st_texture_image_map(st, stImage, 0,
- transfer_usage, 0, 0, width, height);
- if(stImage->transfer)
- dstRowStride = stImage->transfer->stride;
- }
- else {
- /* Allocate regular memory and store the image there temporarily. */
- GLuint imageSize = _mesa_format_image_size(texImage->TexFormat,
- width, height, depth);
- dstRowStride = _mesa_format_row_stride(texImage->TexFormat, width);
-
- texImage->Data = _mesa_align_malloc(imageSize, 16);
- }
-
- if (!texImage->Data) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage");
- return;
- }
-
- if (!pixels) {
- /* We've allocated texture memory, but have no pixel data - all done. */
- goto done;
- }
-
- DBG("Upload image %dx%dx%d row_len %x pitch %x\n",
- width, height, depth, width, dstRowStride);
-
- /* Copy user texture image into the texture buffer.
- */
- if (compressed_src) {
- const GLuint srcRowStride =
- _mesa_format_row_stride(texImage->TexFormat, width);
- if (dstRowStride == srcRowStride) {
- memcpy(texImage->Data, pixels, imageSize);
- }
- else {
- char *dst = texImage->Data;
- const char *src = pixels;
- GLuint i, bw, bh, lines;
- _mesa_get_format_block_size(texImage->TexFormat, &bw, &bh);
- lines = (height + bh - 1) / bh;
-
- for (i = 0; i < lines; ++i) {
- memcpy(dst, src, srcRowStride);
- dst += dstRowStride;
- src += srcRowStride;
- }
- }
- }
- else {
- const GLuint srcImageStride =
- _mesa_image_image_stride(unpack, width, height, format, type);
- GLint i;
- const GLubyte *src = (const GLubyte *) pixels;
-
- for (i = 0; i < depth; i++) {
- if (!_mesa_texstore(ctx, dims,
- texImage->_BaseFormat,
- texImage->TexFormat,
- texImage->Data,
- 0, 0, 0, /* dstX/Y/Zoffset */
- dstRowStride,
- texImage->ImageOffsets,
- width, height, 1,
- format, type, src, unpack)) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage");
- }
-
- if (stImage->pt && i + 1 < depth) {
- /* unmap this slice */
- st_texture_image_unmap(st, stImage);
- /* map next slice of 3D texture */
- texImage->Data = st_texture_image_map(st, stImage, i + 1,
- transfer_usage, 0, 0,
- width, height);
- src += srcImageStride;
- }
- }
- }
-
-done:
- _mesa_unmap_teximage_pbo(ctx, unpack);
-
- if (stImage->pt && texImage->Data) {
- st_texture_image_unmap(st, stImage);
- texImage->Data = NULL;
- }
-}
-
-
-static void
-st_TexImage3D(struct gl_context * ctx,
- GLenum target, GLint level,
- GLint internalFormat,
- GLint width, GLint height, GLint depth,
- GLint border,
- GLenum format, GLenum type, const void *pixels,
- const struct gl_pixelstore_attrib *unpack,
- struct gl_texture_object *texObj,
- struct gl_texture_image *texImage)
-{
- st_TexImage(ctx, 3, target, level, internalFormat, width, height, depth,
- border, format, type, pixels, unpack, texObj, texImage,
- 0, GL_FALSE);
-}
-
-
-static void
-st_TexImage2D(struct gl_context * ctx,
- GLenum target, GLint level,
- GLint internalFormat,
- GLint width, GLint height, GLint border,
- GLenum format, GLenum type, const void *pixels,
- const struct gl_pixelstore_attrib *unpack,
- struct gl_texture_object *texObj,
- struct gl_texture_image *texImage)
-{
- st_TexImage(ctx, 2, target, level, internalFormat, width, height, 1, border,
- format, type, pixels, unpack, texObj, texImage, 0, GL_FALSE);
-}
-
-
-static void
-st_TexImage1D(struct gl_context * ctx,
- GLenum target, GLint level,
- GLint internalFormat,
- GLint width, GLint border,
- GLenum format, GLenum type, const void *pixels,
- const struct gl_pixelstore_attrib *unpack,
- struct gl_texture_object *texObj,
- struct gl_texture_image *texImage)
-{
- st_TexImage(ctx, 1, target, level, internalFormat, width, 1, 1, border,
- format, type, pixels, unpack, texObj, texImage, 0, GL_FALSE);
-}
-
-
-static void
-st_CompressedTexImage2D(struct gl_context *ctx, GLenum target, GLint level,
- GLint internalFormat,
- GLint width, GLint height, GLint border,
- GLsizei imageSize, const GLvoid *data,
- struct gl_texture_object *texObj,
- struct gl_texture_image *texImage)
-{
- st_TexImage(ctx, 2, target, level, internalFormat, width, height, 1, border,
- 0, 0, data, &ctx->Unpack, texObj, texImage, imageSize, GL_TRUE);
-}
-
-
-
-/**
- * glGetTexImage() helper: decompress a compressed texture by rendering
- * a textured quad. Store the results in the user's buffer.
- */
-static void
-decompress_with_blit(struct gl_context * ctx, GLenum target, GLint level,
- GLenum format, GLenum type, GLvoid *pixels,
- struct gl_texture_object *texObj,
- struct gl_texture_image *texImage)
-{
- struct st_context *st = st_context(ctx);
- struct pipe_context *pipe = st->pipe;
- struct st_texture_image *stImage = st_texture_image(texImage);
- struct st_texture_object *stObj = st_texture_object(texObj);
- struct pipe_sampler_view *src_view =
- st_get_texture_sampler_view(stObj, pipe);
- const GLuint width = texImage->Width;
- const GLuint height = texImage->Height;
- struct pipe_surface *dst_surface;
- struct pipe_resource *dst_texture;
- struct pipe_transfer *tex_xfer;
- unsigned bind = (PIPE_BIND_RENDER_TARGET | /* util_blit may choose to render */
- PIPE_BIND_TRANSFER_READ);
-
- /* create temp / dest surface */
- if (!util_create_rgba_surface(pipe, width, height, bind,
- &dst_texture, &dst_surface)) {
- _mesa_problem(ctx, "util_create_rgba_surface() failed "
- "in decompress_with_blit()");
- return;
- }
-
- /* blit/render/decompress */
- util_blit_pixels_tex(st->blit,
- src_view, /* pipe_resource (src) */
- 0, 0, /* src x0, y0 */
- width, height, /* src x1, y1 */
- dst_surface, /* pipe_surface (dst) */
- 0, 0, /* dst x0, y0 */
- width, height, /* dst x1, y1 */
- 0.0, /* z */
- PIPE_TEX_MIPFILTER_NEAREST);
-
- /* map the dst_surface so we can read from it */
- tex_xfer = pipe_get_transfer(st_context(ctx)->pipe,
- dst_texture, 0, 0,
- PIPE_TRANSFER_READ,
- 0, 0, width, height);
-
- pixels = _mesa_map_pbo_dest(ctx, &ctx->Pack, pixels);
-
- /* copy/pack data into user buffer */
- if (st_equal_formats(stImage->pt->format, format, type)) {
- /* memcpy */
- const uint bytesPerRow = width * util_format_get_blocksize(stImage->pt->format);
- ubyte *map = pipe_transfer_map(pipe, tex_xfer);
- GLuint row;
- for (row = 0; row < height; row++) {
- GLvoid *dest = _mesa_image_address2d(&ctx->Pack, pixels, width,
- height, format, type, row, 0);
- memcpy(dest, map, bytesPerRow);
- map += tex_xfer->stride;
- }
- pipe_transfer_unmap(pipe, tex_xfer);
- }
- else {
- /* format translation via floats */
- GLuint row;
- enum pipe_format format = util_format_linear(dst_texture->format);
- for (row = 0; row < height; row++) {
- const GLbitfield transferOps = 0x0; /* bypassed for glGetTexImage() */
- GLfloat rgba[4 * MAX_WIDTH];
- GLvoid *dest = _mesa_image_address2d(&ctx->Pack, pixels, width,
- height, format, type, row, 0);
-
- if (ST_DEBUG & DEBUG_FALLBACK)
- debug_printf("%s: fallback format translation\n", __FUNCTION__);
-
- /* get float[4] rgba row from surface */
- pipe_get_tile_rgba_format(pipe, tex_xfer, 0, row, width, 1,
- format, rgba);
-
- _mesa_pack_rgba_span_float(ctx, width, (GLfloat (*)[4]) rgba, format,
- type, dest, &ctx->Pack, transferOps);
- }
- }
-
- _mesa_unmap_pbo_dest(ctx, &ctx->Pack);
-
- pipe->transfer_destroy(pipe, tex_xfer);
-
- /* destroy the temp / dest surface */
- util_destroy_rgba_surface(dst_texture, dst_surface);
-}
-
-
-
-/**
- * Need to map texture image into memory before copying image data,
- * then unmap it.
- */
-static void
-st_get_tex_image(struct gl_context * ctx, GLenum target, GLint level,
- GLenum format, GLenum type, GLvoid * pixels,
- struct gl_texture_object *texObj,
- struct gl_texture_image *texImage, GLboolean compressed_dst)
-{
- struct st_context *st = st_context(ctx);
- struct st_texture_image *stImage = st_texture_image(texImage);
- const GLuint dstImageStride =
- _mesa_image_image_stride(&ctx->Pack, texImage->Width, texImage->Height,
- format, type);
- GLuint depth, i;
- GLubyte *dest;
-
- if (stImage->pt &&
- util_format_is_s3tc(stImage->pt->format) &&
- !compressed_dst) {
- /* Need to decompress the texture.
- * We'll do this by rendering a textured quad.
- * Note that we only expect RGBA formats (no Z/depth formats).
- */
- decompress_with_blit(ctx, target, level, format, type, pixels,
- texObj, texImage);
- return;
- }
-
- /* Map */
- if (stImage->pt) {
- /* Image is stored in hardware format in a buffer managed by the
- * kernel. Need to explicitly map and unmap it.
- */
- texImage->Data = st_texture_image_map(st, stImage, 0,
- PIPE_TRANSFER_READ, 0, 0,
- stImage->base.Width,
- stImage->base.Height);
- /* compute stride in texels from stride in bytes */
- texImage->RowStride = stImage->transfer->stride
- * util_format_get_blockwidth(stImage->pt->format)
- / util_format_get_blocksize(stImage->pt->format);
- }
- else {
- /* Otherwise, the image should actually be stored in
- * texImage->Data. This is pretty confusing for
- * everybody, I'd much prefer to separate the two functions of
- * texImage->Data - storage for texture images in main memory
- * and access (ie mappings) of images. In other words, we'd
- * create a new texImage->Map field and leave Data simply for
- * storage.
- */
- assert(texImage->Data);
- }
-
- depth = texImage->Depth;
- texImage->Depth = 1;
-
- dest = (GLubyte *) pixels;
-
- _mesa_set_fetch_functions(texImage, get_texture_dims(target));
-
- for (i = 0; i < depth; i++) {
- if (compressed_dst) {
- _mesa_get_compressed_teximage(ctx, target, level, dest,
- texObj, texImage);
- }
- else {
- _mesa_get_teximage(ctx, target, level, format, type, dest,
- texObj, texImage);
- }
-
- if (stImage->pt && i + 1 < depth) {
- /* unmap this slice */
- st_texture_image_unmap(st, stImage);
- /* map next slice of 3D texture */
- texImage->Data = st_texture_image_map(st, stImage, i + 1,
- PIPE_TRANSFER_READ, 0, 0,
- stImage->base.Width,
- stImage->base.Height);
- dest += dstImageStride;
- }
- }
-
- texImage->Depth = depth;
-
- /* Unmap */
- if (stImage->pt) {
- st_texture_image_unmap(st, stImage);
- texImage->Data = NULL;
- }
-}
-
-
-static void
-st_GetTexImage(struct gl_context * ctx, GLenum target, GLint level,
- GLenum format, GLenum type, GLvoid * pixels,
- struct gl_texture_object *texObj,
- struct gl_texture_image *texImage)
-{
- st_get_tex_image(ctx, target, level, format, type, pixels, texObj, texImage,
- GL_FALSE);
-}
-
-
-static void
-st_GetCompressedTexImage(struct gl_context *ctx, GLenum target, GLint level,
- GLvoid *pixels,
- struct gl_texture_object *texObj,
- struct gl_texture_image *texImage)
-{
- st_get_tex_image(ctx, target, level, 0, 0, pixels, texObj, texImage,
- GL_TRUE);
-}
-
-
-
-static void
-st_TexSubimage(struct gl_context *ctx, GLint dims, GLenum target, GLint level,
- GLint xoffset, GLint yoffset, GLint zoffset,
- GLint width, GLint height, GLint depth,
- GLenum format, GLenum type, const void *pixels,
- const struct gl_pixelstore_attrib *packing,
- struct gl_texture_object *texObj,
- struct gl_texture_image *texImage)
-{
- struct st_context *st = st_context(ctx);
- struct st_texture_image *stImage = st_texture_image(texImage);
- GLuint dstRowStride;
- const GLuint srcImageStride =
- _mesa_image_image_stride(packing, width, height, format, type);
- GLint i;
- const GLubyte *src;
- /* init to silence warning only: */
- enum pipe_transfer_usage transfer_usage = PIPE_TRANSFER_WRITE;
-
- DBG("%s target %s level %d offset %d,%d %dx%d\n", __FUNCTION__,
- _mesa_lookup_enum_by_nr(target),
- level, xoffset, yoffset, width, height);
-
- pixels =
- _mesa_validate_pbo_teximage(ctx, dims, width, height, depth, format,
- type, pixels, packing, "glTexSubImage2D");
- if (!pixels)
- return;
-
- /* for a 1D array upload the image as a series of layer with height = 1 */
- if (target == GL_TEXTURE_1D_ARRAY) {
- depth = height;
- height = 1;
- }
-
- /* Map buffer if necessary. Need to lock to prevent other contexts
- * from uploading the buffer under us.
- */
- if (stImage->pt) {
- if (format == GL_DEPTH_COMPONENT &&
- util_format_is_depth_and_stencil(stImage->pt->format))
- transfer_usage = PIPE_TRANSFER_READ_WRITE;
- else
- transfer_usage = PIPE_TRANSFER_WRITE;
-
- texImage->Data = st_texture_image_map(st, stImage, zoffset,
- transfer_usage,
- xoffset, yoffset,
- width, height);
- }
-
- if (!texImage->Data) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexSubImage");
- goto done;
- }
-
- src = (const GLubyte *) pixels;
- dstRowStride = stImage->transfer->stride;
-
- for (i = 0; i < depth; i++) {
- if (!_mesa_texstore(ctx, dims, texImage->_BaseFormat,
- texImage->TexFormat,
- texImage->Data,
- 0, 0, 0,
- dstRowStride,
- texImage->ImageOffsets,
- width, height, 1,
- format, type, src, packing)) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexSubImage");
- }
-
- if (stImage->pt && i + 1 < depth) {
- /* unmap this slice */
- st_texture_image_unmap(st, stImage);
- /* map next slice of 3D texture */
- texImage->Data = st_texture_image_map(st, stImage,
- zoffset + i + 1,
- transfer_usage,
- xoffset, yoffset,
- width, height);
- src += srcImageStride;
- }
- }
-
-done:
- _mesa_unmap_teximage_pbo(ctx, packing);
-
- if (stImage->pt && texImage->Data) {
- st_texture_image_unmap(st, stImage);
- texImage->Data = NULL;
- }
-}
-
-
-
-static void
-st_TexSubImage3D(struct gl_context *ctx, GLenum target, GLint level,
- GLint xoffset, GLint yoffset, GLint zoffset,
- GLsizei width, GLsizei height, GLsizei depth,
- GLenum format, GLenum type, const GLvoid *pixels,
- const struct gl_pixelstore_attrib *packing,
- struct gl_texture_object *texObj,
- struct gl_texture_image *texImage)
-{
- st_TexSubimage(ctx, 3, target, level, xoffset, yoffset, zoffset,
- width, height, depth, format, type,
- pixels, packing, texObj, texImage);
-}
-
-
-static void
-st_TexSubImage2D(struct gl_context *ctx, GLenum target, GLint level,
- GLint xoffset, GLint yoffset,
- GLsizei width, GLsizei height,
- GLenum format, GLenum type, const GLvoid * pixels,
- const struct gl_pixelstore_attrib *packing,
- struct gl_texture_object *texObj,
- struct gl_texture_image *texImage)
-{
- st_TexSubimage(ctx, 2, target, level, xoffset, yoffset, 0,
- width, height, 1, format, type,
- pixels, packing, texObj, texImage);
-}
-
-
-static void
-st_TexSubImage1D(struct gl_context *ctx, GLenum target, GLint level,
- GLint xoffset, GLsizei width, GLenum format, GLenum type,
- const GLvoid * pixels,
- const struct gl_pixelstore_attrib *packing,
- struct gl_texture_object *texObj,
- struct gl_texture_image *texImage)
-{
- st_TexSubimage(ctx, 1, target, level, xoffset, 0, 0, width, 1, 1,
- format, type, pixels, packing, texObj, texImage);
-}
-
-
-static void
-st_CompressedTexSubImage1D(struct gl_context *ctx, GLenum target, GLint level,
- GLint xoffset, GLsizei width,
- GLenum format,
- GLsizei imageSize, const GLvoid *data,
- struct gl_texture_object *texObj,
- struct gl_texture_image *texImage)
-{
- assert(0);
-}
-
-
-static void
-st_CompressedTexSubImage2D(struct gl_context *ctx, GLenum target, GLint level,
- GLint xoffset, GLint yoffset,
- GLsizei width, GLint height,
- GLenum format,
- GLsizei imageSize, const GLvoid *data,
- struct gl_texture_object *texObj,
- struct gl_texture_image *texImage)
-{
- struct st_context *st = st_context(ctx);
- struct st_texture_image *stImage = st_texture_image(texImage);
- int srcBlockStride;
- int dstBlockStride;
- int y;
- enum pipe_format pformat;
-
- if (stImage->pt) {
- pformat = stImage->pt->format;
-
- texImage->Data = st_texture_image_map(st, stImage, 0,
- PIPE_TRANSFER_WRITE,
- xoffset, yoffset,
- width, height);
-
- srcBlockStride = util_format_get_stride(pformat, width);
- dstBlockStride = stImage->transfer->stride;
- } else {
- assert(stImage->pt);
- /* TODO find good values for block and strides */
- /* TODO also adjust texImage->data for yoffset/xoffset */
- return;
- }
-
- if (!texImage->Data) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCompressedTexSubImage");
- return;
- }
-
- assert(xoffset % util_format_get_blockwidth(pformat) == 0);
- assert(yoffset % util_format_get_blockheight(pformat) == 0);
-
- for (y = 0; y < height; y += util_format_get_blockheight(pformat)) {
- /* don't need to adjust for xoffset and yoffset as st_texture_image_map does that */
- const char *src = (const char*)data + srcBlockStride * util_format_get_nblocksy(pformat, y);
- char *dst = (char*)texImage->Data + dstBlockStride * util_format_get_nblocksy(pformat, y);
- memcpy(dst, src, util_format_get_stride(pformat, width));
- }
-
- if (stImage->pt) {
- st_texture_image_unmap(st, stImage);
- texImage->Data = NULL;
- }
-}
-
-
-static void
-st_CompressedTexSubImage3D(struct gl_context *ctx, GLenum target, GLint level,
- GLint xoffset, GLint yoffset, GLint zoffset,
- GLsizei width, GLint height, GLint depth,
- GLenum format,
- GLsizei imageSize, const GLvoid *data,
- struct gl_texture_object *texObj,
- struct gl_texture_image *texImage)
-{
- assert(0);
-}
-
-
-
-/**
- * Do a CopyTexSubImage operation using a read transfer from the source,
- * a write transfer to the destination and get_tile()/put_tile() to access
- * the pixels/texels.
- *
- * Note: srcY=0=TOP of renderbuffer
- */
-static void
-fallback_copy_texsubimage(struct gl_context *ctx, GLenum target, GLint level,
- struct st_renderbuffer *strb,
- struct st_texture_image *stImage,
- GLenum baseFormat,
- GLint destX, GLint destY, GLint destZ,
- GLint srcX, GLint srcY,
- GLsizei width, GLsizei height)
-{
- struct st_context *st = st_context(ctx);
- struct pipe_context *pipe = st->pipe;
- struct pipe_transfer *src_trans;
- GLvoid *texDest;
- enum pipe_transfer_usage transfer_usage;
-
- if (ST_DEBUG & DEBUG_FALLBACK)
- debug_printf("%s: fallback processing\n", __FUNCTION__);
-
- assert(width <= MAX_WIDTH);
-
- if (st_fb_orientation(ctx->ReadBuffer) == Y_0_TOP) {
- srcY = strb->Base.Height - srcY - height;
- }
-
- src_trans = pipe_get_transfer(st_context(ctx)->pipe,
- strb->texture,
- 0, 0,
- PIPE_TRANSFER_READ,
- srcX, srcY,
- width, height);
-
- if ((baseFormat == GL_DEPTH_COMPONENT ||
- baseFormat == GL_DEPTH_STENCIL) &&
- util_format_is_depth_and_stencil(stImage->pt->format))
- transfer_usage = PIPE_TRANSFER_READ_WRITE;
- else
- transfer_usage = PIPE_TRANSFER_WRITE;
-
- /* XXX this used to ignore destZ param */
- texDest = st_texture_image_map(st, stImage, destZ, transfer_usage,
- destX, destY, width, height);
-
- if (baseFormat == GL_DEPTH_COMPONENT ||
- baseFormat == GL_DEPTH_STENCIL) {
- const GLboolean scaleOrBias = (ctx->Pixel.DepthScale != 1.0F ||
- ctx->Pixel.DepthBias != 0.0F);
- GLint row, yStep;
-
- /* determine bottom-to-top vs. top-to-bottom order for src buffer */
- if (st_fb_orientation(ctx->ReadBuffer) == Y_0_TOP) {
- srcY = height - 1;
- yStep = -1;
- }
- else {
- srcY = 0;
- yStep = 1;
- }
-
- /* To avoid a large temp memory allocation, do copy row by row */
- for (row = 0; row < height; row++, srcY += yStep) {
- uint data[MAX_WIDTH];
- pipe_get_tile_z(pipe, src_trans, 0, srcY, width, 1, data);
- if (scaleOrBias) {
- _mesa_scale_and_bias_depth_uint(ctx, width, data);
- }
- pipe_put_tile_z(pipe, stImage->transfer, 0, row, width, 1, data);
- }
- }
- else {
- /* RGBA format */
- GLfloat *tempSrc =
- (GLfloat *) malloc(width * height * 4 * sizeof(GLfloat));
-
- if (tempSrc && texDest) {
- const GLint dims = 2;
- const GLint dstRowStride = stImage->transfer->stride;
- struct gl_texture_image *texImage = &stImage->base;
- struct gl_pixelstore_attrib unpack = ctx->DefaultPacking;
-
- if (st_fb_orientation(ctx->ReadBuffer) == Y_0_TOP) {
- unpack.Invert = GL_TRUE;
- }
-
- /* get float/RGBA image from framebuffer */
- /* XXX this usually involves a lot of int/float conversion.
- * try to avoid that someday.
- */
- pipe_get_tile_rgba_format(pipe, src_trans, 0, 0, width, height,
- util_format_linear(strb->texture->format),
- tempSrc);
-
- /* Store into texture memory.
- * Note that this does some special things such as pixel transfer
- * ops and format conversion. In particular, if the dest tex format
- * is actually RGBA but the user created the texture as GL_RGB we
- * need to fill-in/override the alpha channel with 1.0.
- */
- _mesa_texstore(ctx, dims,
- texImage->_BaseFormat,
- texImage->TexFormat,
- texDest,
- 0, 0, 0,
- dstRowStride,
- texImage->ImageOffsets,
- width, height, 1,
- GL_RGBA, GL_FLOAT, tempSrc, /* src */
- &unpack);
- }
- else {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexSubImage");
- }
-
- if (tempSrc)
- free(tempSrc);
- }
-
- st_texture_image_unmap(st, stImage);
- pipe->transfer_destroy(pipe, src_trans);
-}
-
-
-
-/**
- * If the format of the src renderbuffer and the format of the dest
- * texture are compatible (in terms of blitting), return a TGSI writemask
- * to be used during the blit.
- * If the src/dest are incompatible, return 0.
- */
-static unsigned
-compatible_src_dst_formats(struct gl_context *ctx,
- const struct gl_renderbuffer *src,
- const struct gl_texture_image *dst)
-{
- /* Get logical base formats for the src and dest.
- * That is, use the user-requested formats and not the actual, device-
- * chosen formats.
- * For example, the user may have requested an A8 texture but the
- * driver may actually be using an RGBA texture format. When we
- * copy/blit to that texture, we only want to copy the Alpha channel
- * and not the RGB channels.
- *
- * Similarly, when the src FBO was created an RGB format may have been
- * requested but the driver actually chose an RGBA format. In that case,
- * we don't want to copy the undefined Alpha channel to the dest texture
- * (it should be 1.0).
- */
- const GLenum srcFormat = _mesa_base_fbo_format(ctx, src->InternalFormat);
- const GLenum dstFormat = _mesa_base_tex_format(ctx, dst->InternalFormat);
-
- /**
- * XXX when we have red-only and red/green renderbuffers we'll need
- * to add more cases here (or implement a general-purpose routine that
- * queries the existance of the R,G,B,A channels in the src and dest).
- */
- if (srcFormat == dstFormat) {
- /* This is the same as matching_base_formats, which should
- * always pass, as it did previously.
- */
- return TGSI_WRITEMASK_XYZW;
- }
- else if (srcFormat == GL_RGB && dstFormat == GL_RGBA) {
- /* Make sure that A in the dest is 1. The actual src format
- * may be RGBA and have undefined A values.
- */
- return TGSI_WRITEMASK_XYZ;
- }
- else if (srcFormat == GL_RGBA && dstFormat == GL_RGB) {
- /* Make sure that A in the dest is 1. The actual dst format
- * may be RGBA and will need A=1 to provide proper alpha values
- * when sampled later.
- */
- return TGSI_WRITEMASK_XYZ;
- }
- else {
- if (ST_DEBUG & DEBUG_FALLBACK)
- debug_printf("%s failed for src %s, dst %s\n",
- __FUNCTION__,
- _mesa_lookup_enum_by_nr(srcFormat),
- _mesa_lookup_enum_by_nr(dstFormat));
-
- /* Otherwise fail.
- */
- return 0;
- }
-}
-
-
-
-/**
- * Do a CopyTex[Sub]Image1/2/3D() using a hardware (blit) path if possible.
- * Note that the region to copy has already been clipped so we know we
- * won't read from outside the source renderbuffer's bounds.
- *
- * Note: srcY=0=Bottom of renderbuffer (GL convention)
- */
-static void
-st_copy_texsubimage(struct gl_context *ctx,
- GLenum target, GLint level,
- GLint destX, GLint destY, GLint destZ,
- GLint srcX, GLint srcY,
- GLsizei width, GLsizei height)
-{
- struct gl_texture_unit *texUnit =
- &ctx->Texture.Unit[ctx->Texture.CurrentUnit];
- struct gl_texture_object *texObj =
- _mesa_select_tex_object(ctx, texUnit, target);
- struct gl_texture_image *texImage =
- _mesa_select_tex_image(ctx, texObj, target, level);
- struct st_texture_image *stImage = st_texture_image(texImage);
- const GLenum texBaseFormat = texImage->_BaseFormat;
- struct gl_framebuffer *fb = ctx->ReadBuffer;
- struct st_renderbuffer *strb;
- struct st_context *st = st_context(ctx);
- struct pipe_context *pipe = st->pipe;
- struct pipe_screen *screen = pipe->screen;
- enum pipe_format dest_format, src_format;
- GLboolean use_fallback = GL_TRUE;
- GLboolean matching_base_formats;
- GLuint format_writemask, sample_count;
- struct pipe_surface *dest_surface = NULL;
- GLboolean do_flip = (st_fb_orientation(ctx->ReadBuffer) == Y_0_TOP);
-
- /* make sure finalize_textures has been called?
- */
- if (0) st_validate_state(st);
-
- /* determine if copying depth or color data */
- if (texBaseFormat == GL_DEPTH_COMPONENT ||
- texBaseFormat == GL_DEPTH_STENCIL) {
- strb = st_renderbuffer(fb->_DepthBuffer);
- if (strb->Base.Wrapped) {
- strb = st_renderbuffer(strb->Base.Wrapped);
- }
- }
- else {
- /* texBaseFormat == GL_RGB, GL_RGBA, GL_ALPHA, etc */
- strb = st_renderbuffer(fb->_ColorReadBuffer);
- }
-
- if (!strb || !strb->surface || !stImage->pt) {
- debug_printf("%s: null strb or stImage\n", __FUNCTION__);
- return;
- }
-
- sample_count = strb->surface->texture->nr_samples;
- /* I believe this would be legal, presumably would need to do a resolve
- for color, and for depth/stencil spec says to just use one of the
- depth/stencil samples per pixel? Need some transfer clarifications. */
- assert(sample_count < 2);
-
- if (srcX < 0) {
- width -= -srcX;
- destX += -srcX;
- srcX = 0;
- }
-
- if (srcY < 0) {
- height -= -srcY;
- destY += -srcY;
- srcY = 0;
- }
-
- if (destX < 0) {
- width -= -destX;
- srcX += -destX;
- destX = 0;
- }
-
- if (destY < 0) {
- height -= -destY;
- srcY += -destY;
- destY = 0;
- }
-
- if (width < 0 || height < 0)
- return;
-
-
- assert(strb);
- assert(strb->surface);
- assert(stImage->pt);
-
- src_format = strb->surface->format;
- dest_format = stImage->pt->format;
-
- /*
- * Determine if the src framebuffer and dest texture have the same
- * base format. We need this to detect a case such as the framebuffer
- * being GL_RGBA but the texture being GL_RGB. If the actual hardware
- * texture format stores RGBA we need to set A=1 (overriding the
- * framebuffer's alpha values). We can't do that with the blit or
- * textured-quad paths.
- */
- matching_base_formats =
- (_mesa_get_format_base_format(strb->Base.Format) ==
- _mesa_get_format_base_format(texImage->TexFormat));
- format_writemask = compatible_src_dst_formats(ctx, &strb->Base, texImage);
-
- if (ctx->_ImageTransferState == 0x0) {
-
- if (matching_base_formats &&
- src_format == dest_format &&
- !do_flip)
- {
- /* use surface_copy() / blit */
- struct pipe_box src_box;
- u_box_2d_zslice(srcX, srcY, strb->surface->u.tex.first_layer,
- width, height, &src_box);
-
- /* for resource_copy_region(), y=0=top, always */
- pipe->resource_copy_region(pipe,
- /* dest */
- stImage->pt,
- stImage->level,
- destX, destY, destZ + stImage->face,
- /* src */
- strb->texture,
- strb->surface->u.tex.level,
- &src_box);
- use_fallback = GL_FALSE;
- }
- else if (format_writemask &&
- texBaseFormat != GL_DEPTH_COMPONENT &&
- texBaseFormat != GL_DEPTH_STENCIL &&
- screen->is_format_supported(screen, src_format,
- PIPE_TEXTURE_2D, sample_count,
- PIPE_BIND_SAMPLER_VIEW) &&
- screen->is_format_supported(screen, dest_format,
- PIPE_TEXTURE_2D, 0,
- PIPE_BIND_RENDER_TARGET)) {
- /* draw textured quad to do the copy */
- GLint srcY0, srcY1;
- struct pipe_surface surf_tmpl;
- memset(&surf_tmpl, 0, sizeof(surf_tmpl));
- surf_tmpl.format = util_format_linear(stImage->pt->format);
- surf_tmpl.usage = PIPE_BIND_RENDER_TARGET;
- surf_tmpl.u.tex.level = stImage->level;
- surf_tmpl.u.tex.first_layer = stImage->face + destZ;
- surf_tmpl.u.tex.last_layer = stImage->face + destZ;
-
- dest_surface = pipe->create_surface(pipe, stImage->pt,
- &surf_tmpl);
-
- if (do_flip) {
- srcY1 = strb->Base.Height - srcY - height;
- srcY0 = srcY1 + height;
- }
- else {
- srcY0 = srcY;
- srcY1 = srcY0 + height;
- }
-
- util_blit_pixels_writemask(st->blit,
- strb->texture,
- strb->surface->u.tex.level,
- srcX, srcY0,
- srcX + width, srcY1,
- strb->surface->u.tex.first_layer,
- dest_surface,
- destX, destY,
- destX + width, destY + height,
- 0.0, PIPE_TEX_MIPFILTER_NEAREST,
- format_writemask);
- use_fallback = GL_FALSE;
- }
-
- if (dest_surface)
- pipe_surface_reference(&dest_surface, NULL);
- }
-
- if (use_fallback) {
- /* software fallback */
- fallback_copy_texsubimage(ctx, target, level,
- strb, stImage, texBaseFormat,
- destX, destY, destZ,
- srcX, srcY, width, height);
- }
-}
-
-
-
-static void
-st_CopyTexImage1D(struct gl_context * ctx, GLenum target, GLint level,
- GLenum internalFormat,
- GLint x, GLint y, GLsizei width, GLint border)
-{
- struct gl_texture_unit *texUnit =
- &ctx->Texture.Unit[ctx->Texture.CurrentUnit];
- struct gl_texture_object *texObj =
- _mesa_select_tex_object(ctx, texUnit, target);
- struct gl_texture_image *texImage =
- _mesa_select_tex_image(ctx, texObj, target, level);
-
- /* Setup or redefine the texture object, texture and texture
- * image. Don't populate yet.
- */
- ctx->Driver.TexImage1D(ctx, target, level, internalFormat,
- width, border,
- GL_RGBA, CHAN_TYPE, NULL,
- &ctx->DefaultPacking, texObj, texImage);
-
- st_copy_texsubimage(ctx, target, level,
- 0, 0, 0, /* destX,Y,Z */
- x, y, width, 1); /* src X, Y, size */
-}
-
-
-static void
-st_CopyTexImage2D(struct gl_context * ctx, GLenum target, GLint level,
- GLenum internalFormat,
- GLint x, GLint y, GLsizei width, GLsizei height,
- GLint border)
-{
- struct gl_texture_unit *texUnit =
- &ctx->Texture.Unit[ctx->Texture.CurrentUnit];
- struct gl_texture_object *texObj =
- _mesa_select_tex_object(ctx, texUnit, target);
- struct gl_texture_image *texImage =
- _mesa_select_tex_image(ctx, texObj, target, level);
-
- /* Setup or redefine the texture object, texture and texture
- * image. Don't populate yet.
- */
- ctx->Driver.TexImage2D(ctx, target, level, internalFormat,
- width, height, border,
- GL_RGBA, CHAN_TYPE, NULL,
- &ctx->DefaultPacking, texObj, texImage);
-
- st_copy_texsubimage(ctx, target, level,
- 0, 0, 0, /* destX,Y,Z */
- x, y, width, height); /* src X, Y, size */
-}
-
-
-static void
-st_CopyTexSubImage1D(struct gl_context * ctx, GLenum target, GLint level,
- GLint xoffset, GLint x, GLint y, GLsizei width)
-{
- const GLint yoffset = 0, zoffset = 0;
- const GLsizei height = 1;
- st_copy_texsubimage(ctx, target, level,
- xoffset, yoffset, zoffset, /* destX,Y,Z */
- x, y, width, height); /* src X, Y, size */
-}
-
-
-static void
-st_CopyTexSubImage2D(struct gl_context * ctx, GLenum target, GLint level,
- GLint xoffset, GLint yoffset,
- GLint x, GLint y, GLsizei width, GLsizei height)
-{
- const GLint zoffset = 0;
- st_copy_texsubimage(ctx, target, level,
- xoffset, yoffset, zoffset, /* destX,Y,Z */
- x, y, width, height); /* src X, Y, size */
-}
-
-
-static void
-st_CopyTexSubImage3D(struct gl_context * ctx, GLenum target, GLint level,
- GLint xoffset, GLint yoffset, GLint zoffset,
- GLint x, GLint y, GLsizei width, GLsizei height)
-{
- st_copy_texsubimage(ctx, target, level,
- xoffset, yoffset, zoffset, /* destX,Y,Z */
- x, y, width, height); /* src X, Y, size */
-}
-
-
-/**
- * Copy image data from stImage into the texture object 'stObj' at level
- * 'dstLevel'.
- */
-static void
-copy_image_data_to_texture(struct st_context *st,
- struct st_texture_object *stObj,
- GLuint dstLevel,
- struct st_texture_image *stImage)
-{
- /* debug checks */
- {
- const struct gl_texture_image *dstImage =
- stObj->base.Image[stImage->face][dstLevel];
- assert(dstImage);
- assert(dstImage->Width == stImage->base.Width);
- assert(dstImage->Height == stImage->base.Height);
- assert(dstImage->Depth == stImage->base.Depth);
- }
-
- if (stImage->pt) {
- /* Copy potentially with the blitter:
- */
- st_texture_image_copy(st->pipe,
- stObj->pt, dstLevel, /* dest texture, level */
- stImage->pt, stImage->level, /* src texture, level */
- stImage->face);
-
- pipe_resource_reference(&stImage->pt, NULL);
- }
- else if (stImage->base.Data) {
- st_texture_image_data(st,
- stObj->pt,
- stImage->face,
- dstLevel,
- stImage->base.Data,
- stImage->base.RowStride *
- util_format_get_blocksize(stObj->pt->format),
- stImage->base.RowStride *
- stImage->base.Height *
- util_format_get_blocksize(stObj->pt->format));
- _mesa_align_free(stImage->base.Data);
- stImage->base.Data = NULL;
- }
-
- pipe_resource_reference(&stImage->pt, stObj->pt);
-}
-
-
-/**
- * Called during state validation. When this function is finished,
- * the texture object should be ready for rendering.
- * \return GL_TRUE for success, GL_FALSE for failure (out of mem)
- */
-GLboolean
-st_finalize_texture(struct gl_context *ctx,
- struct pipe_context *pipe,
- struct gl_texture_object *tObj)
-{
- struct st_context *st = st_context(ctx);
- struct st_texture_object *stObj = st_texture_object(tObj);
- const GLuint nr_faces = (stObj->base.Target == GL_TEXTURE_CUBE_MAP) ? 6 : 1;
- GLuint face;
- struct st_texture_image *firstImage;
- enum pipe_format firstImageFormat;
- GLuint ptWidth, ptHeight, ptDepth, ptLayers;
-
- if (stObj->base._Complete) {
- /* The texture is complete and we know exactly how many mipmap levels
- * are present/needed. This is conditional because we may be called
- * from the st_generate_mipmap() function when the texture object is
- * incomplete. In that case, we'll have set stObj->lastLevel before
- * we get here.
- */
- if (stObj->base.Sampler.MinFilter == GL_LINEAR ||
- stObj->base.Sampler.MinFilter == GL_NEAREST)
- stObj->lastLevel = stObj->base.BaseLevel;
- else
- stObj->lastLevel = stObj->base._MaxLevel;
- }
-
- firstImage = st_texture_image(stObj->base.Image[0][stObj->base.BaseLevel]);
- assert(firstImage);
-
- /* If both firstImage and stObj point to a texture which can contain
- * all active images, favour firstImage. Note that because of the
- * completeness requirement, we know that the image dimensions
- * will match.
- */
- if (firstImage->pt &&
- firstImage->pt != stObj->pt &&
- (!stObj->pt || firstImage->pt->last_level >= stObj->pt->last_level)) {
- pipe_resource_reference(&stObj->pt, firstImage->pt);
- pipe_sampler_view_reference(&stObj->sampler_view, NULL);
- }
-
- /* Find gallium format for the Mesa texture */
- firstImageFormat = st_mesa_format_to_pipe_format(firstImage->base.TexFormat);
-
- /* Find size of level=0 Gallium mipmap image, plus number of texture layers */
- {
- GLuint width, height, depth;
- if (!guess_base_level_size(stObj->base.Target,
- firstImage->base.Width2,
- firstImage->base.Height2,
- firstImage->base.Depth2,
- stObj->base.BaseLevel,
- &width, &height, &depth)) {
- width = stObj->width0;
- height = stObj->height0;
- depth = stObj->depth0;
- }
- /* convert GL dims to Gallium dims */
- st_gl_texture_dims_to_pipe_dims(stObj->base.Target, width, height, depth,
- &ptWidth, &ptHeight, &ptDepth, &ptLayers);
- }
-
- /* If we already have a gallium texture, check that it matches the texture
- * object's format, target, size, num_levels, etc.
- */
- if (stObj->pt) {
- if (stObj->pt->target != gl_target_to_pipe(stObj->base.Target) ||
- !st_sampler_compat_formats(stObj->pt->format, firstImageFormat) ||
- stObj->pt->last_level < stObj->lastLevel ||
- stObj->pt->width0 != ptWidth ||
- stObj->pt->height0 != ptHeight ||
- stObj->pt->depth0 != ptDepth ||
- stObj->pt->array_size != ptLayers)
- {
- /* The gallium texture does not match the Mesa texture so delete the
- * gallium texture now. We'll make a new one below.
- */
- pipe_resource_reference(&stObj->pt, NULL);
- pipe_sampler_view_reference(&stObj->sampler_view, NULL);
- st->dirty.st |= ST_NEW_FRAMEBUFFER;
- }
- }
-
- /* May need to create a new gallium texture:
- */
- if (!stObj->pt) {
- GLuint bindings = default_bindings(st, firstImageFormat);
-
- stObj->pt = st_texture_create(st,
- gl_target_to_pipe(stObj->base.Target),
- firstImageFormat,
- stObj->lastLevel,
- ptWidth,
- ptHeight,
- ptDepth,
- ptLayers,
- bindings);
-
- if (!stObj->pt) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage");
- return GL_FALSE;
- }
- }
-
- /* Pull in any images not in the object's texture:
- */
- for (face = 0; face < nr_faces; face++) {
- GLuint level;
- for (level = stObj->base.BaseLevel; level <= stObj->lastLevel; level++) {
- struct st_texture_image *stImage =
- st_texture_image(stObj->base.Image[face][level]);
-
- /* Need to import images in main memory or held in other textures.
- */
- if (stImage && stObj->pt != stImage->pt) {
- if (level == 0 || (stImage->base.Width == u_minify(stObj->width0, level) &&
- stImage->base.Height == u_minify(stObj->height0, level) &&
- stImage->base.Depth == u_minify(stObj->depth0, level))) {
- /* src image fits expected dest mipmap level size */
- copy_image_data_to_texture(st, stObj, level, stImage);
- }
- }
- }
- }
-
- return GL_TRUE;
-}
-
-
-/**
- * Returns pointer to a default/dummy texture.
- * This is typically used when the current shader has tex/sample instructions
- * but the user has not provided a (any) texture(s).
- */
-struct gl_texture_object *
-st_get_default_texture(struct st_context *st)
-{
- if (!st->default_texture) {
- static const GLenum target = GL_TEXTURE_2D;
- GLubyte pixels[16][16][4];
- struct gl_texture_object *texObj;
- struct gl_texture_image *texImg;
- GLuint i, j;
-
- /* The ARB_fragment_program spec says (0,0,0,1) should be returned
- * when attempting to sample incomplete textures.
- */
- for (i = 0; i < 16; i++) {
- for (j = 0; j < 16; j++) {
- pixels[i][j][0] = 0;
- pixels[i][j][1] = 0;
- pixels[i][j][2] = 0;
- pixels[i][j][3] = 255;
- }
- }
-
- texObj = st->ctx->Driver.NewTextureObject(st->ctx, 0, target);
-
- texImg = _mesa_get_tex_image(st->ctx, texObj, target, 0);
-
- _mesa_init_teximage_fields(st->ctx, target, texImg,
- 16, 16, 1, 0, /* w, h, d, border */
- GL_RGBA, MESA_FORMAT_RGBA8888);
-
- st_TexImage(st->ctx, 2, target,
- 0, GL_RGBA, /* level, intformat */
- 16, 16, 1, 0, /* w, h, d, border */
- GL_RGBA, GL_UNSIGNED_BYTE, pixels,
- &st->ctx->DefaultPacking,
- texObj, texImg,
- 0, 0);
-
- texObj->Sampler.MinFilter = GL_NEAREST;
- texObj->Sampler.MagFilter = GL_NEAREST;
- texObj->_Complete = GL_TRUE;
-
- st->default_texture = texObj;
- }
- return st->default_texture;
-}
-
-
-void
-st_init_texture_functions(struct dd_function_table *functions)
-{
- functions->ChooseTextureFormat = st_ChooseTextureFormat;
- functions->TexImage1D = st_TexImage1D;
- functions->TexImage2D = st_TexImage2D;
- functions->TexImage3D = st_TexImage3D;
- functions->TexSubImage1D = st_TexSubImage1D;
- functions->TexSubImage2D = st_TexSubImage2D;
- functions->TexSubImage3D = st_TexSubImage3D;
- functions->CompressedTexSubImage1D = st_CompressedTexSubImage1D;
- functions->CompressedTexSubImage2D = st_CompressedTexSubImage2D;
- functions->CompressedTexSubImage3D = st_CompressedTexSubImage3D;
- functions->CopyTexImage1D = st_CopyTexImage1D;
- functions->CopyTexImage2D = st_CopyTexImage2D;
- functions->CopyTexSubImage1D = st_CopyTexSubImage1D;
- functions->CopyTexSubImage2D = st_CopyTexSubImage2D;
- functions->CopyTexSubImage3D = st_CopyTexSubImage3D;
- functions->GenerateMipmap = st_generate_mipmap;
-
- functions->GetTexImage = st_GetTexImage;
-
- /* compressed texture functions */
- functions->CompressedTexImage2D = st_CompressedTexImage2D;
- functions->GetCompressedTexImage = st_GetCompressedTexImage;
-
- functions->NewTextureObject = st_NewTextureObject;
- functions->NewTextureImage = st_NewTextureImage;
- functions->DeleteTexture = st_DeleteTextureObject;
- functions->FreeTexImageData = st_FreeTextureImageData;
-
- functions->TextureMemCpy = do_memcpy;
-
- /* XXX Temporary until we can query pipe's texture sizes */
- functions->TestProxyTexImage = _mesa_test_proxy_teximage;
-}
+/**************************************************************************
+ *
+ * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ **************************************************************************/
+
+#include "main/mfeatures.h"
+#include "main/bufferobj.h"
+#include "main/enums.h"
+#include "main/fbobject.h"
+#include "main/formats.h"
+#include "main/image.h"
+#include "main/imports.h"
+#include "main/macros.h"
+#include "main/mipmap.h"
+#include "main/pack.h"
+#include "main/pbo.h"
+#include "main/pixeltransfer.h"
+#include "main/texcompress.h"
+#include "main/texfetch.h"
+#include "main/texgetimage.h"
+#include "main/teximage.h"
+#include "main/texobj.h"
+#include "main/texstore.h"
+
+#include "state_tracker/st_debug.h"
+#include "state_tracker/st_context.h"
+#include "state_tracker/st_cb_fbo.h"
+#include "state_tracker/st_cb_flush.h"
+#include "state_tracker/st_cb_texture.h"
+#include "state_tracker/st_format.h"
+#include "state_tracker/st_texture.h"
+#include "state_tracker/st_gen_mipmap.h"
+#include "state_tracker/st_atom.h"
+
+#include "pipe/p_context.h"
+#include "pipe/p_defines.h"
+#include "util/u_inlines.h"
+#include "pipe/p_shader_tokens.h"
+#include "util/u_tile.h"
+#include "util/u_blit.h"
+#include "util/u_format.h"
+#include "util/u_surface.h"
+#include "util/u_sampler.h"
+#include "util/u_math.h"
+#include "util/u_box.h"
+
+#define DBG if (0) printf
+
+
+static enum pipe_texture_target
+gl_target_to_pipe(GLenum target)
+{
+ switch (target) {
+ case GL_TEXTURE_1D:
+ return PIPE_TEXTURE_1D;
+ case GL_TEXTURE_2D:
+ return PIPE_TEXTURE_2D;
+ case GL_TEXTURE_RECTANGLE_NV:
+ return PIPE_TEXTURE_RECT;
+ case GL_TEXTURE_3D:
+ return PIPE_TEXTURE_3D;
+ case GL_TEXTURE_CUBE_MAP_ARB:
+ return PIPE_TEXTURE_CUBE;
+ case GL_TEXTURE_1D_ARRAY_EXT:
+ return PIPE_TEXTURE_1D_ARRAY;
+ case GL_TEXTURE_2D_ARRAY_EXT:
+ return PIPE_TEXTURE_2D_ARRAY;
+ case GL_TEXTURE_BUFFER:
+ return PIPE_BUFFER;
+ default:
+ assert(0);
+ return 0;
+ }
+}
+
+
+/** called via ctx->Driver.NewTextureImage() */
+static struct gl_texture_image *
+st_NewTextureImage(struct gl_context * ctx)
+{
+ DBG("%s\n", __FUNCTION__);
+ (void) ctx;
+ return (struct gl_texture_image *) ST_CALLOC_STRUCT(st_texture_image);
+}
+
+
+/** called via ctx->Driver.NewTextureObject() */
+static struct gl_texture_object *
+st_NewTextureObject(struct gl_context * ctx, GLuint name, GLenum target)
+{
+ struct st_texture_object *obj = ST_CALLOC_STRUCT(st_texture_object);
+
+ DBG("%s\n", __FUNCTION__);
+ _mesa_initialize_texture_object(&obj->base, name, target);
+
+ return &obj->base;
+}
+
+/** called via ctx->Driver.DeleteTextureObject() */
+static void
+st_DeleteTextureObject(struct gl_context *ctx,
+ struct gl_texture_object *texObj)
+{
+ struct st_context *st = st_context(ctx);
+ struct st_texture_object *stObj = st_texture_object(texObj);
+ if (stObj->pt)
+ pipe_resource_reference(&stObj->pt, NULL);
+ if (stObj->sampler_view) {
+ if (stObj->sampler_view->context != st->pipe) {
+ /* Take "ownership" of this texture sampler view by setting
+ * its context pointer to this context. This avoids potential
+ * crashes when the texture object is shared among contexts
+ * and the original/owner context has already been destroyed.
+ */
+ stObj->sampler_view->context = st->pipe;
+ }
+ pipe_sampler_view_reference(&stObj->sampler_view, NULL);
+ }
+ _mesa_delete_texture_object(ctx, texObj);
+}
+
+
+/** called via ctx->Driver.FreeTexImageData() */
+static void
+st_FreeTextureImageData(struct gl_context * ctx, struct gl_texture_image *texImage)
+{
+ struct st_texture_image *stImage = st_texture_image(texImage);
+
+ DBG("%s\n", __FUNCTION__);
+
+ if (stImage->pt) {
+ pipe_resource_reference(&stImage->pt, NULL);
+ }
+
+ if (texImage->Data) {
+ _mesa_align_free(texImage->Data);
+ texImage->Data = NULL;
+ }
+}
+
+
+/**
+ * From linux kernel i386 header files, copes with odd sizes better
+ * than COPY_DWORDS would:
+ * XXX Put this in src/mesa/main/imports.h ???
+ */
+#if defined(PIPE_CC_GCC) && defined(PIPE_ARCH_X86)
+static INLINE void *
+__memcpy(void *to, const void *from, size_t n)
+{
+ int d0, d1, d2;
+ __asm__ __volatile__("rep ; movsl\n\t"
+ "testb $2,%b4\n\t"
+ "je 1f\n\t"
+ "movsw\n"
+ "1:\ttestb $1,%b4\n\t"
+ "je 2f\n\t"
+ "movsb\n" "2:":"=&c"(d0), "=&D"(d1), "=&S"(d2)
+ :"0"(n / 4), "q"(n), "1"((long) to), "2"((long) from)
+ :"memory");
+ return (to);
+}
+#else
+#define __memcpy(a,b,c) memcpy(a,b,c)
+#endif
+
+
+/**
+ * The system memcpy (at least on ubuntu 5.10) has problems copying
+ * to agp (writecombined) memory from a source which isn't 64-byte
+ * aligned - there is a 4x performance falloff.
+ *
+ * The x86 __memcpy is immune to this but is slightly slower
+ * (10%-ish) than the system memcpy.
+ *
+ * The sse_memcpy seems to have a slight cliff at 64/32 bytes, but
+ * isn't much faster than x86_memcpy for agp copies.
+ *
+ * TODO: switch dynamically.
+ */
+static void *
+do_memcpy(void *dest, const void *src, size_t n)
+{
+ if ((((unsigned long) src) & 63) || (((unsigned long) dest) & 63)) {
+ return __memcpy(dest, src, n);
+ }
+ else
+ return memcpy(dest, src, n);
+}
+
+
+/**
+ * Return default texture resource binding bitmask for the given format.
+ */
+static GLuint
+default_bindings(struct st_context *st, enum pipe_format format)
+{
+ struct pipe_screen *screen = st->pipe->screen;
+ const unsigned target = PIPE_TEXTURE_2D;
+ unsigned bindings;
+
+ if (util_format_is_depth_or_stencil(format))
+ bindings = PIPE_BIND_SAMPLER_VIEW | PIPE_BIND_DEPTH_STENCIL;
+ else
+ bindings = PIPE_BIND_SAMPLER_VIEW | PIPE_BIND_RENDER_TARGET;
+
+ if (screen->is_format_supported(screen, format, target, 0, bindings))
+ return bindings;
+ else {
+ /* Try non-sRGB. */
+ format = util_format_linear(format);
+
+ if (screen->is_format_supported(screen, format, target, 0, bindings))
+ return bindings;
+ else
+ return PIPE_BIND_SAMPLER_VIEW;
+ }
+}
+
+
+/** Return number of image dimensions (1, 2 or 3) for a texture target. */
+static GLuint
+get_texture_dims(GLenum target)
+{
+ switch (target) {
+ case GL_TEXTURE_1D:
+ case GL_TEXTURE_1D_ARRAY_EXT:
+ case GL_TEXTURE_BUFFER:
+ return 1;
+ case GL_TEXTURE_2D:
+ case GL_TEXTURE_CUBE_MAP_ARB:
+ case GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB:
+ case GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB:
+ case GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB:
+ case GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB:
+ case GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB:
+ case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB:
+ case GL_TEXTURE_RECTANGLE_NV:
+ case GL_TEXTURE_2D_ARRAY_EXT:
+ return 2;
+ case GL_TEXTURE_3D:
+ return 3;
+ default:
+ assert(0 && "invalid texture target in get_texture_dims()");
+ return 1;
+ }
+}
+
+
+/**
+ * Given the size of a mipmap image, try to compute the size of the level=0
+ * mipmap image.
+ *
+ * Note that this isn't always accurate for odd-sized, non-POW textures.
+ * For example, if level=1 and width=40 then the level=0 width may be 80 or 81.
+ *
+ * \return GL_TRUE for success, GL_FALSE for failure
+ */
+static GLboolean
+guess_base_level_size(GLenum target,
+ GLuint width, GLuint height, GLuint depth, GLuint level,
+ GLuint *width0, GLuint *height0, GLuint *depth0)
+{
+ const GLuint dims = get_texture_dims(target);
+
+ assert(width >= 1);
+ assert(height >= 1);
+ assert(depth >= 1);
+
+ if (level > 0) {
+ /* Depending on the image's size, we can't always make a guess here */
+ if ((dims >= 1 && width == 1) ||
+ (dims >= 2 && height == 1) ||
+ (dims >= 3 && depth == 1)) {
+ /* we can't determine the image size at level=0 */
+ return GL_FALSE;
+ }
+
+ /* grow the image size until we hit level = 0 */
+ while (level > 0) {
+ if (width > 1)
+ width <<= 1;
+ if (height > 1)
+ height <<= 1;
+ if (depth > 1)
+ depth <<= 1;
+ level--;
+ }
+ }
+
+ *width0 = width;
+ *height0 = height;
+ *depth0 = depth;
+
+ return GL_TRUE;
+}
+
+
+/**
+ * Try to allocate a pipe_resource object for the given st_texture_object.
+ *
+ * We use the given st_texture_image as a clue to determine the size of the
+ * mipmap image at level=0.
+ *
+ * \return GL_TRUE for success, GL_FALSE if out of memory.
+ */
+static GLboolean
+guess_and_alloc_texture(struct st_context *st,
+ struct st_texture_object *stObj,
+ const struct st_texture_image *stImage)
+{
+ GLuint lastLevel, width, height, depth;
+ GLuint bindings;
+ GLuint ptWidth, ptHeight, ptDepth, ptLayers;
+ enum pipe_format fmt;
+
+ DBG("%s\n", __FUNCTION__);
+
+ assert(!stObj->pt);
+
+ if (!guess_base_level_size(stObj->base.Target,
+ stImage->base.Width2,
+ stImage->base.Height2,
+ stImage->base.Depth2,
+ stImage->level,
+ &width, &height, &depth)) {
+ /* we can't determine the image size at level=0 */
+ stObj->width0 = stObj->height0 = stObj->depth0 = 0;
+ /* this is not an out of memory error */
+ return GL_TRUE;
+ }
+
+ /* At this point, (width x height x depth) is the expected size of
+ * the level=0 mipmap image.
+ */
+
+ /* Guess a reasonable value for lastLevel. With OpenGL we have no
+ * idea how many mipmap levels will be in a texture until we start
+ * to render with it. Make an educated guess here but be prepared
+ * to re-allocating a texture buffer with space for more (or fewer)
+ * mipmap levels later.
+ */
+ if ((stObj->base.Sampler.MinFilter == GL_NEAREST ||
+ stObj->base.Sampler.MinFilter == GL_LINEAR ||
+ stImage->base._BaseFormat == GL_DEPTH_COMPONENT ||
+ stImage->base._BaseFormat == GL_DEPTH_STENCIL_EXT) &&
+ !stObj->base.GenerateMipmap &&
+ stImage->level == 0) {
+ /* only alloc space for a single mipmap level */
+ lastLevel = 0;
+ }
+ else {
+ /* alloc space for a full mipmap */
+ GLuint l2width = util_logbase2(width);
+ GLuint l2height = util_logbase2(height);
+ GLuint l2depth = util_logbase2(depth);
+ lastLevel = MAX2(MAX2(l2width, l2height), l2depth);
+ }
+
+ /* Save the level=0 dimensions */
+ stObj->width0 = width;
+ stObj->height0 = height;
+ stObj->depth0 = depth;
+
+ fmt = st_mesa_format_to_pipe_format(stImage->base.TexFormat);
+
+ bindings = default_bindings(st, fmt);
+
+ st_gl_texture_dims_to_pipe_dims(stObj->base.Target,
+ width, height, depth,
+ &ptWidth, &ptHeight, &ptDepth, &ptLayers);
+
+ stObj->pt = st_texture_create(st,
+ gl_target_to_pipe(stObj->base.Target),
+ fmt,
+ lastLevel,
+ ptWidth,
+ ptHeight,
+ ptDepth,
+ ptLayers,
+ bindings);
+
+ DBG("%s returning %d\n", __FUNCTION__, (stObj->pt != NULL));
+
+ return stObj->pt != NULL;
+}
+
+
+/**
+ * Adjust pixel unpack params and image dimensions to strip off the
+ * texture border.
+ * Gallium doesn't support texture borders. They've seldem been used
+ * and seldom been implemented correctly anyway.
+ * \param unpackNew returns the new pixel unpack parameters
+ */
+static void
+strip_texture_border(GLint border,
+ GLint *width, GLint *height, GLint *depth,
+ const struct gl_pixelstore_attrib *unpack,
+ struct gl_pixelstore_attrib *unpackNew)
+{
+ assert(border > 0); /* sanity check */
+
+ *unpackNew = *unpack;
+
+ if (unpackNew->RowLength == 0)
+ unpackNew->RowLength = *width;
+
+ if (depth && unpackNew->ImageHeight == 0)
+ unpackNew->ImageHeight = *height;
+
+ unpackNew->SkipPixels += border;
+ if (height)
+ unpackNew->SkipRows += border;
+ if (depth)
+ unpackNew->SkipImages += border;
+
+ assert(*width >= 3);
+ *width = *width - 2 * border;
+ if (height && *height >= 3)
+ *height = *height - 2 * border;
+ if (depth && *depth >= 3)
+ *depth = *depth - 2 * border;
+}
+
+
+/**
+ * Do glTexImage1/2/3D().
+ */
+static void
+st_TexImage(struct gl_context * ctx,
+ GLint dims,
+ GLenum target, GLint level,
+ GLint internalFormat,
+ GLint width, GLint height, GLint depth,
+ GLint border,
+ GLenum format, GLenum type, const void *pixels,
+ const struct gl_pixelstore_attrib *unpack,
+ struct gl_texture_object *texObj,
+ struct gl_texture_image *texImage,
+ GLsizei imageSize, GLboolean compressed_src)
+{
+ struct st_context *st = st_context(ctx);
+ struct st_texture_object *stObj = st_texture_object(texObj);
+ struct st_texture_image *stImage = st_texture_image(texImage);
+ GLuint dstRowStride = 0;
+ struct gl_pixelstore_attrib unpackNB;
+ enum pipe_transfer_usage transfer_usage = 0;
+
+ DBG("%s target %s level %d %dx%dx%d border %d\n", __FUNCTION__,
+ _mesa_lookup_enum_by_nr(target), level, width, height, depth, border);
+
+ /* switch to "normal" */
+ if (stObj->surface_based) {
+ gl_format texFormat;
+
+ _mesa_clear_texture_object(ctx, texObj);
+ pipe_resource_reference(&stObj->pt, NULL);
+
+ /* oops, need to init this image again */
+ texFormat = _mesa_choose_texture_format(ctx, texObj, target, level,
+ internalFormat, format, type);
+
+ _mesa_init_teximage_fields(ctx, target, texImage,
+ width, height, depth, border,
+ internalFormat, texFormat);
+
+ stObj->surface_based = GL_FALSE;
+ }
+
+ /* gallium does not support texture borders, strip it off */
+ if (border) {
+ strip_texture_border(border, &width, &height, &depth, unpack, &unpackNB);
+ unpack = &unpackNB;
+ texImage->Width = width;
+ texImage->Height = height;
+ texImage->Depth = depth;
+ texImage->Border = 0;
+ border = 0;
+ }
+ else {
+ assert(texImage->Width == width);
+ assert(texImage->Height == height);
+ assert(texImage->Depth == depth);
+ }
+
+ stImage->face = _mesa_tex_target_to_face(target);
+ stImage->level = level;
+
+ _mesa_set_fetch_functions(texImage, dims);
+
+ /* Release the reference to a potentially orphaned buffer.
+ * Release any old malloced memory.
+ */
+ if (stImage->pt) {
+ pipe_resource_reference(&stImage->pt, NULL);
+ assert(!texImage->Data);
+ }
+ else if (texImage->Data) {
+ _mesa_align_free(texImage->Data);
+ }
+
+ /*
+ * See if the new image is somehow incompatible with the existing
+ * mipmap. If so, free the old mipmap.
+ */
+ if (stObj->pt) {
+ if (level > (GLint) stObj->pt->last_level ||
+ !st_texture_match_image(stObj->pt, &stImage->base,
+ stImage->face, stImage->level)) {
+ DBG("release it\n");
+ pipe_resource_reference(&stObj->pt, NULL);
+ assert(!stObj->pt);
+ pipe_sampler_view_reference(&stObj->sampler_view, NULL);
+ }
+ }
+
+ if (width == 0 || height == 0 || depth == 0) {
+ /* stop after freeing old image */
+ return;
+ }
+
+ if (!stObj->pt) {
+ if (!guess_and_alloc_texture(st, stObj, stImage)) {
+ /* Probably out of memory.
+ * Try flushing any pending rendering, then retry.
+ */
+ st_finish(st);
+ if (!guess_and_alloc_texture(st, stObj, stImage)) {
+ _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage");
+ return;
+ }
+ }
+ }
+
+ assert(!stImage->pt);
+
+ /* Check if this texture image can live inside the texture object's buffer.
+ * If so, store the image there. Otherwise the image will temporarily live
+ * in its own buffer.
+ */
+ if (stObj->pt &&
+ st_texture_match_image(stObj->pt, &stImage->base,
+ stImage->face, stImage->level)) {
+
+ pipe_resource_reference(&stImage->pt, stObj->pt);
+ assert(stImage->pt);
+ }
+
+ if (!stImage->pt)
+ DBG("XXX: Image did not fit into texture - storing in local memory!\n");
+
+ /* Pixel data may come from regular user memory or a PBO. For the later,
+ * do bounds checking and map the PBO to read pixels data from it.
+ *
+ * XXX we should try to use a GPU-accelerated path to copy the image data
+ * from the PBO to the texture.
+ */
+ if (compressed_src) {
+ pixels = _mesa_validate_pbo_compressed_teximage(ctx, imageSize, pixels,
+ unpack,
+ "glCompressedTexImage");
+ }
+ else {
+ pixels = _mesa_validate_pbo_teximage(ctx, dims, width, height, 1,
+ format, type,
+ pixels, unpack, "glTexImage");
+ }
+
+ /* for a 1D array upload the image as a series of layer with height = 1 */
+ if (target == GL_TEXTURE_1D_ARRAY) {
+ depth = height;
+ height = 1;
+ }
+
+ /*
+ * Prepare to store the texture data. Either map the gallium texture buffer
+ * memory or malloc space for it.
+ */
+ if (stImage->pt) {
+ if (!pixels) {
+ /* We've allocated texture resource, but have no pixel data - all done. */
+ goto done;
+ }
+
+ /* Store the image in the gallium transfer object */
+ if (format == GL_DEPTH_COMPONENT &&
+ util_format_is_depth_and_stencil(stImage->pt->format))
+ transfer_usage = PIPE_TRANSFER_READ_WRITE;
+ else
+ transfer_usage = PIPE_TRANSFER_WRITE;
+
+ texImage->Data = st_texture_image_map(st, stImage, 0,
+ transfer_usage, 0, 0, width, height);
+ if(stImage->transfer)
+ dstRowStride = stImage->transfer->stride;
+ }
+ else {
+ /* Allocate regular memory and store the image there temporarily. */
+ GLuint imageSize = _mesa_format_image_size(texImage->TexFormat,
+ width, height, depth);
+ dstRowStride = _mesa_format_row_stride(texImage->TexFormat, width);
+
+ texImage->Data = _mesa_align_malloc(imageSize, 16);
+ }
+
+ if (!texImage->Data) {
+ _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage");
+ return;
+ }
+
+ if (!pixels) {
+ /* We've allocated texture memory, but have no pixel data - all done. */
+ goto done;
+ }
+
+ DBG("Upload image %dx%dx%d row_len %x pitch %x\n",
+ width, height, depth, width, dstRowStride);
+
+ /* Copy user texture image into the texture buffer.
+ */
+ if (compressed_src) {
+ const GLuint srcRowStride =
+ _mesa_format_row_stride(texImage->TexFormat, width);
+ if (dstRowStride == srcRowStride) {
+ memcpy(texImage->Data, pixels, imageSize);
+ }
+ else {
+ char *dst = texImage->Data;
+ const char *src = pixels;
+ GLuint i, bw, bh, lines;
+ _mesa_get_format_block_size(texImage->TexFormat, &bw, &bh);
+ lines = (height + bh - 1) / bh;
+
+ for (i = 0; i < lines; ++i) {
+ memcpy(dst, src, srcRowStride);
+ dst += dstRowStride;
+ src += srcRowStride;
+ }
+ }
+ }
+ else {
+ const GLuint srcImageStride =
+ _mesa_image_image_stride(unpack, width, height, format, type);
+ GLint i;
+ const GLubyte *src = (const GLubyte *) pixels;
+
+ for (i = 0; i < depth; i++) {
+ if (!_mesa_texstore(ctx, dims,
+ texImage->_BaseFormat,
+ texImage->TexFormat,
+ texImage->Data,
+ 0, 0, 0, /* dstX/Y/Zoffset */
+ dstRowStride,
+ texImage->ImageOffsets,
+ width, height, 1,
+ format, type, src, unpack)) {
+ _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage");
+ }
+
+ if (stImage->pt && i + 1 < depth) {
+ /* unmap this slice */
+ st_texture_image_unmap(st, stImage);
+ /* map next slice of 3D texture */
+ texImage->Data = st_texture_image_map(st, stImage, i + 1,
+ transfer_usage, 0, 0,
+ width, height);
+ src += srcImageStride;
+ }
+ }
+ }
+
+done:
+ _mesa_unmap_teximage_pbo(ctx, unpack);
+
+ if (stImage->pt && texImage->Data) {
+ st_texture_image_unmap(st, stImage);
+ texImage->Data = NULL;
+ }
+}
+
+
+static void
+st_TexImage3D(struct gl_context * ctx,
+ GLenum target, GLint level,
+ GLint internalFormat,
+ GLint width, GLint height, GLint depth,
+ GLint border,
+ GLenum format, GLenum type, const void *pixels,
+ const struct gl_pixelstore_attrib *unpack,
+ struct gl_texture_object *texObj,
+ struct gl_texture_image *texImage)
+{
+ st_TexImage(ctx, 3, target, level, internalFormat, width, height, depth,
+ border, format, type, pixels, unpack, texObj, texImage,
+ 0, GL_FALSE);
+}
+
+
+static void
+st_TexImage2D(struct gl_context * ctx,
+ GLenum target, GLint level,
+ GLint internalFormat,
+ GLint width, GLint height, GLint border,
+ GLenum format, GLenum type, const void *pixels,
+ const struct gl_pixelstore_attrib *unpack,
+ struct gl_texture_object *texObj,
+ struct gl_texture_image *texImage)
+{
+ st_TexImage(ctx, 2, target, level, internalFormat, width, height, 1, border,
+ format, type, pixels, unpack, texObj, texImage, 0, GL_FALSE);
+}
+
+
+static void
+st_TexImage1D(struct gl_context * ctx,
+ GLenum target, GLint level,
+ GLint internalFormat,
+ GLint width, GLint border,
+ GLenum format, GLenum type, const void *pixels,
+ const struct gl_pixelstore_attrib *unpack,
+ struct gl_texture_object *texObj,
+ struct gl_texture_image *texImage)
+{
+ st_TexImage(ctx, 1, target, level, internalFormat, width, 1, 1, border,
+ format, type, pixels, unpack, texObj, texImage, 0, GL_FALSE);
+}
+
+
+static void
+st_CompressedTexImage2D(struct gl_context *ctx, GLenum target, GLint level,
+ GLint internalFormat,
+ GLint width, GLint height, GLint border,
+ GLsizei imageSize, const GLvoid *data,
+ struct gl_texture_object *texObj,
+ struct gl_texture_image *texImage)
+{
+ st_TexImage(ctx, 2, target, level, internalFormat, width, height, 1, border,
+ 0, 0, data, &ctx->Unpack, texObj, texImage, imageSize, GL_TRUE);
+}
+
+
+
+/**
+ * glGetTexImage() helper: decompress a compressed texture by rendering
+ * a textured quad. Store the results in the user's buffer.
+ */
+static void
+decompress_with_blit(struct gl_context * ctx, GLenum target, GLint level,
+ GLenum format, GLenum type, GLvoid *pixels,
+ struct gl_texture_object *texObj,
+ struct gl_texture_image *texImage)
+{
+ struct st_context *st = st_context(ctx);
+ struct pipe_context *pipe = st->pipe;
+ struct st_texture_image *stImage = st_texture_image(texImage);
+ struct st_texture_object *stObj = st_texture_object(texObj);
+ struct pipe_sampler_view *src_view =
+ st_get_texture_sampler_view(stObj, pipe);
+ const GLuint width = texImage->Width;
+ const GLuint height = texImage->Height;
+ struct pipe_surface *dst_surface;
+ struct pipe_resource *dst_texture;
+ struct pipe_transfer *tex_xfer;
+ unsigned bind = (PIPE_BIND_RENDER_TARGET | /* util_blit may choose to render */
+ PIPE_BIND_TRANSFER_READ);
+
+ /* create temp / dest surface */
+ if (!util_create_rgba_surface(pipe, width, height, bind,
+ &dst_texture, &dst_surface)) {
+ _mesa_problem(ctx, "util_create_rgba_surface() failed "
+ "in decompress_with_blit()");
+ return;
+ }
+
+ /* blit/render/decompress */
+ util_blit_pixels_tex(st->blit,
+ src_view, /* pipe_resource (src) */
+ 0, 0, /* src x0, y0 */
+ width, height, /* src x1, y1 */
+ dst_surface, /* pipe_surface (dst) */
+ 0, 0, /* dst x0, y0 */
+ width, height, /* dst x1, y1 */
+ 0.0, /* z */
+ PIPE_TEX_MIPFILTER_NEAREST);
+
+ /* map the dst_surface so we can read from it */
+ tex_xfer = pipe_get_transfer(st_context(ctx)->pipe,
+ dst_texture, 0, 0,
+ PIPE_TRANSFER_READ,
+ 0, 0, width, height);
+
+ pixels = _mesa_map_pbo_dest(ctx, &ctx->Pack, pixels);
+
+ /* copy/pack data into user buffer */
+ if (st_equal_formats(stImage->pt->format, format, type)) {
+ /* memcpy */
+ const uint bytesPerRow = width * util_format_get_blocksize(stImage->pt->format);
+ ubyte *map = pipe_transfer_map(pipe, tex_xfer);
+ GLuint row;
+ for (row = 0; row < height; row++) {
+ GLvoid *dest = _mesa_image_address2d(&ctx->Pack, pixels, width,
+ height, format, type, row, 0);
+ memcpy(dest, map, bytesPerRow);
+ map += tex_xfer->stride;
+ }
+ pipe_transfer_unmap(pipe, tex_xfer);
+ }
+ else {
+ /* format translation via floats */
+ GLuint row;
+ enum pipe_format format = util_format_linear(dst_texture->format);
+ for (row = 0; row < height; row++) {
+ const GLbitfield transferOps = 0x0; /* bypassed for glGetTexImage() */
+ GLfloat rgba[4 * MAX_WIDTH];
+ GLvoid *dest = _mesa_image_address2d(&ctx->Pack, pixels, width,
+ height, format, type, row, 0);
+
+ if (ST_DEBUG & DEBUG_FALLBACK)
+ debug_printf("%s: fallback format translation\n", __FUNCTION__);
+
+ /* get float[4] rgba row from surface */
+ pipe_get_tile_rgba_format(pipe, tex_xfer, 0, row, width, 1,
+ format, rgba);
+
+ _mesa_pack_rgba_span_float(ctx, width, (GLfloat (*)[4]) rgba, format,
+ type, dest, &ctx->Pack, transferOps);
+ }
+ }
+
+ _mesa_unmap_pbo_dest(ctx, &ctx->Pack);
+
+ pipe->transfer_destroy(pipe, tex_xfer);
+
+ /* destroy the temp / dest surface */
+ util_destroy_rgba_surface(dst_texture, dst_surface);
+}
+
+
+
+/**
+ * Need to map texture image into memory before copying image data,
+ * then unmap it.
+ */
+static void
+st_get_tex_image(struct gl_context * ctx, GLenum target, GLint level,
+ GLenum format, GLenum type, GLvoid * pixels,
+ struct gl_texture_object *texObj,
+ struct gl_texture_image *texImage, GLboolean compressed_dst)
+{
+ struct st_context *st = st_context(ctx);
+ struct st_texture_image *stImage = st_texture_image(texImage);
+ const GLuint dstImageStride =
+ _mesa_image_image_stride(&ctx->Pack, texImage->Width, texImage->Height,
+ format, type);
+ GLuint depth, i;
+ GLubyte *dest;
+
+ if (stImage->pt &&
+ util_format_is_s3tc(stImage->pt->format) &&
+ !compressed_dst) {
+ /* Need to decompress the texture.
+ * We'll do this by rendering a textured quad.
+ * Note that we only expect RGBA formats (no Z/depth formats).
+ */
+ decompress_with_blit(ctx, target, level, format, type, pixels,
+ texObj, texImage);
+ return;
+ }
+
+ /* Map */
+ if (stImage->pt) {
+ /* Image is stored in hardware format in a buffer managed by the
+ * kernel. Need to explicitly map and unmap it.
+ */
+ texImage->Data = st_texture_image_map(st, stImage, 0,
+ PIPE_TRANSFER_READ, 0, 0,
+ stImage->base.Width,
+ stImage->base.Height);
+ /* compute stride in texels from stride in bytes */
+ texImage->RowStride = stImage->transfer->stride
+ * util_format_get_blockwidth(stImage->pt->format)
+ / util_format_get_blocksize(stImage->pt->format);
+ }
+ else {
+ /* Otherwise, the image should actually be stored in
+ * texImage->Data. This is pretty confusing for
+ * everybody, I'd much prefer to separate the two functions of
+ * texImage->Data - storage for texture images in main memory
+ * and access (ie mappings) of images. In other words, we'd
+ * create a new texImage->Map field and leave Data simply for
+ * storage.
+ */
+ assert(texImage->Data);
+ }
+
+ depth = texImage->Depth;
+ texImage->Depth = 1;
+
+ dest = (GLubyte *) pixels;
+
+ _mesa_set_fetch_functions(texImage, get_texture_dims(target));
+
+ for (i = 0; i < depth; i++) {
+ if (compressed_dst) {
+ _mesa_get_compressed_teximage(ctx, target, level, dest,
+ texObj, texImage);
+ }
+ else {
+ _mesa_get_teximage(ctx, target, level, format, type, dest,
+ texObj, texImage);
+ }
+
+ if (stImage->pt && i + 1 < depth) {
+ /* unmap this slice */
+ st_texture_image_unmap(st, stImage);
+ /* map next slice of 3D texture */
+ texImage->Data = st_texture_image_map(st, stImage, i + 1,
+ PIPE_TRANSFER_READ, 0, 0,
+ stImage->base.Width,
+ stImage->base.Height);
+ dest += dstImageStride;
+ }
+ }
+
+ texImage->Depth = depth;
+
+ /* Unmap */
+ if (stImage->pt) {
+ st_texture_image_unmap(st, stImage);
+ texImage->Data = NULL;
+ }
+}
+
+
+static void
+st_GetTexImage(struct gl_context * ctx, GLenum target, GLint level,
+ GLenum format, GLenum type, GLvoid * pixels,
+ struct gl_texture_object *texObj,
+ struct gl_texture_image *texImage)
+{
+ st_get_tex_image(ctx, target, level, format, type, pixels, texObj, texImage,
+ GL_FALSE);
+}
+
+
+static void
+st_GetCompressedTexImage(struct gl_context *ctx, GLenum target, GLint level,
+ GLvoid *pixels,
+ struct gl_texture_object *texObj,
+ struct gl_texture_image *texImage)
+{
+ st_get_tex_image(ctx, target, level, 0, 0, pixels, texObj, texImage,
+ GL_TRUE);
+}
+
+
+
+static void
+st_TexSubimage(struct gl_context *ctx, GLint dims, GLenum target, GLint level,
+ GLint xoffset, GLint yoffset, GLint zoffset,
+ GLint width, GLint height, GLint depth,
+ GLenum format, GLenum type, const void *pixels,
+ const struct gl_pixelstore_attrib *packing,
+ struct gl_texture_object *texObj,
+ struct gl_texture_image *texImage)
+{
+ struct st_context *st = st_context(ctx);
+ struct st_texture_image *stImage = st_texture_image(texImage);
+ GLuint dstRowStride;
+ const GLuint srcImageStride =
+ _mesa_image_image_stride(packing, width, height, format, type);
+ GLint i;
+ const GLubyte *src;
+ /* init to silence warning only: */
+ enum pipe_transfer_usage transfer_usage = PIPE_TRANSFER_WRITE;
+
+ DBG("%s target %s level %d offset %d,%d %dx%d\n", __FUNCTION__,
+ _mesa_lookup_enum_by_nr(target),
+ level, xoffset, yoffset, width, height);
+
+ pixels =
+ _mesa_validate_pbo_teximage(ctx, dims, width, height, depth, format,
+ type, pixels, packing, "glTexSubImage2D");
+ if (!pixels)
+ return;
+
+ /* for a 1D array upload the image as a series of layer with height = 1 */
+ if (target == GL_TEXTURE_1D_ARRAY) {
+ depth = height;
+ height = 1;
+ }
+
+ /* Map buffer if necessary. Need to lock to prevent other contexts
+ * from uploading the buffer under us.
+ */
+ if (stImage->pt) {
+ if (format == GL_DEPTH_COMPONENT &&
+ util_format_is_depth_and_stencil(stImage->pt->format))
+ transfer_usage = PIPE_TRANSFER_READ_WRITE;
+ else
+ transfer_usage = PIPE_TRANSFER_WRITE;
+
+ texImage->Data = st_texture_image_map(st, stImage, zoffset,
+ transfer_usage,
+ xoffset, yoffset,
+ width, height);
+ }
+
+ if (!texImage->Data) {
+ _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexSubImage");
+ goto done;
+ }
+
+ src = (const GLubyte *) pixels;
+ dstRowStride = stImage->transfer->stride;
+
+ for (i = 0; i < depth; i++) {
+ if (!_mesa_texstore(ctx, dims, texImage->_BaseFormat,
+ texImage->TexFormat,
+ texImage->Data,
+ 0, 0, 0,
+ dstRowStride,
+ texImage->ImageOffsets,
+ width, height, 1,
+ format, type, src, packing)) {
+ _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexSubImage");
+ }
+
+ if (stImage->pt && i + 1 < depth) {
+ /* unmap this slice */
+ st_texture_image_unmap(st, stImage);
+ /* map next slice of 3D texture */
+ texImage->Data = st_texture_image_map(st, stImage,
+ zoffset + i + 1,
+ transfer_usage,
+ xoffset, yoffset,
+ width, height);
+ src += srcImageStride;
+ }
+ }
+
+done:
+ _mesa_unmap_teximage_pbo(ctx, packing);
+
+ if (stImage->pt && texImage->Data) {
+ st_texture_image_unmap(st, stImage);
+ texImage->Data = NULL;
+ }
+}
+
+
+
+static void
+st_TexSubImage3D(struct gl_context *ctx, GLenum target, GLint level,
+ GLint xoffset, GLint yoffset, GLint zoffset,
+ GLsizei width, GLsizei height, GLsizei depth,
+ GLenum format, GLenum type, const GLvoid *pixels,
+ const struct gl_pixelstore_attrib *packing,
+ struct gl_texture_object *texObj,
+ struct gl_texture_image *texImage)
+{
+ st_TexSubimage(ctx, 3, target, level, xoffset, yoffset, zoffset,
+ width, height, depth, format, type,
+ pixels, packing, texObj, texImage);
+}
+
+
+static void
+st_TexSubImage2D(struct gl_context *ctx, GLenum target, GLint level,
+ GLint xoffset, GLint yoffset,
+ GLsizei width, GLsizei height,
+ GLenum format, GLenum type, const GLvoid * pixels,
+ const struct gl_pixelstore_attrib *packing,
+ struct gl_texture_object *texObj,
+ struct gl_texture_image *texImage)
+{
+ st_TexSubimage(ctx, 2, target, level, xoffset, yoffset, 0,
+ width, height, 1, format, type,
+ pixels, packing, texObj, texImage);
+}
+
+
+static void
+st_TexSubImage1D(struct gl_context *ctx, GLenum target, GLint level,
+ GLint xoffset, GLsizei width, GLenum format, GLenum type,
+ const GLvoid * pixels,
+ const struct gl_pixelstore_attrib *packing,
+ struct gl_texture_object *texObj,
+ struct gl_texture_image *texImage)
+{
+ st_TexSubimage(ctx, 1, target, level, xoffset, 0, 0, width, 1, 1,
+ format, type, pixels, packing, texObj, texImage);
+}
+
+
+static void
+st_CompressedTexSubImage1D(struct gl_context *ctx, GLenum target, GLint level,
+ GLint xoffset, GLsizei width,
+ GLenum format,
+ GLsizei imageSize, const GLvoid *data,
+ struct gl_texture_object *texObj,
+ struct gl_texture_image *texImage)
+{
+ assert(0);
+}
+
+
+static void
+st_CompressedTexSubImage2D(struct gl_context *ctx, GLenum target, GLint level,
+ GLint xoffset, GLint yoffset,
+ GLsizei width, GLint height,
+ GLenum format,
+ GLsizei imageSize, const GLvoid *data,
+ struct gl_texture_object *texObj,
+ struct gl_texture_image *texImage)
+{
+ struct st_context *st = st_context(ctx);
+ struct st_texture_image *stImage = st_texture_image(texImage);
+ int srcBlockStride;
+ int dstBlockStride;
+ int y;
+ enum pipe_format pformat;
+
+ if (stImage->pt) {
+ pformat = stImage->pt->format;
+
+ texImage->Data = st_texture_image_map(st, stImage, 0,
+ PIPE_TRANSFER_WRITE,
+ xoffset, yoffset,
+ width, height);
+
+ srcBlockStride = util_format_get_stride(pformat, width);
+ dstBlockStride = stImage->transfer->stride;
+ } else {
+ assert(stImage->pt);
+ /* TODO find good values for block and strides */
+ /* TODO also adjust texImage->data for yoffset/xoffset */
+ return;
+ }
+
+ if (!texImage->Data) {
+ _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCompressedTexSubImage");
+ return;
+ }
+
+ assert(xoffset % util_format_get_blockwidth(pformat) == 0);
+ assert(yoffset % util_format_get_blockheight(pformat) == 0);
+
+ for (y = 0; y < height; y += util_format_get_blockheight(pformat)) {
+ /* don't need to adjust for xoffset and yoffset as st_texture_image_map does that */
+ const char *src = (const char*)data + srcBlockStride * util_format_get_nblocksy(pformat, y);
+ char *dst = (char*)texImage->Data + dstBlockStride * util_format_get_nblocksy(pformat, y);
+ memcpy(dst, src, util_format_get_stride(pformat, width));
+ }
+
+ if (stImage->pt) {
+ st_texture_image_unmap(st, stImage);
+ texImage->Data = NULL;
+ }
+}
+
+
+static void
+st_CompressedTexSubImage3D(struct gl_context *ctx, GLenum target, GLint level,
+ GLint xoffset, GLint yoffset, GLint zoffset,
+ GLsizei width, GLint height, GLint depth,
+ GLenum format,
+ GLsizei imageSize, const GLvoid *data,
+ struct gl_texture_object *texObj,
+ struct gl_texture_image *texImage)
+{
+ assert(0);
+}
+
+
+
+/**
+ * Do a CopyTexSubImage operation using a read transfer from the source,
+ * a write transfer to the destination and get_tile()/put_tile() to access
+ * the pixels/texels.
+ *
+ * Note: srcY=0=TOP of renderbuffer
+ */
+static void
+fallback_copy_texsubimage(struct gl_context *ctx, GLenum target, GLint level,
+ struct st_renderbuffer *strb,
+ struct st_texture_image *stImage,
+ GLenum baseFormat,
+ GLint destX, GLint destY, GLint destZ,
+ GLint srcX, GLint srcY,
+ GLsizei width, GLsizei height)
+{
+ struct st_context *st = st_context(ctx);
+ struct pipe_context *pipe = st->pipe;
+ struct pipe_transfer *src_trans;
+ GLvoid *texDest;
+ enum pipe_transfer_usage transfer_usage;
+
+ if (ST_DEBUG & DEBUG_FALLBACK)
+ debug_printf("%s: fallback processing\n", __FUNCTION__);
+
+ assert(width <= MAX_WIDTH);
+
+ if (st_fb_orientation(ctx->ReadBuffer) == Y_0_TOP) {
+ srcY = strb->Base.Height - srcY - height;
+ }
+
+ src_trans = pipe_get_transfer(st_context(ctx)->pipe,
+ strb->texture,
+ 0, 0,
+ PIPE_TRANSFER_READ,
+ srcX, srcY,
+ width, height);
+
+ if ((baseFormat == GL_DEPTH_COMPONENT ||
+ baseFormat == GL_DEPTH_STENCIL) &&
+ util_format_is_depth_and_stencil(stImage->pt->format))
+ transfer_usage = PIPE_TRANSFER_READ_WRITE;
+ else
+ transfer_usage = PIPE_TRANSFER_WRITE;
+
+ /* XXX this used to ignore destZ param */
+ texDest = st_texture_image_map(st, stImage, destZ, transfer_usage,
+ destX, destY, width, height);
+
+ if (baseFormat == GL_DEPTH_COMPONENT ||
+ baseFormat == GL_DEPTH_STENCIL) {
+ const GLboolean scaleOrBias = (ctx->Pixel.DepthScale != 1.0F ||
+ ctx->Pixel.DepthBias != 0.0F);
+ GLint row, yStep;
+
+ /* determine bottom-to-top vs. top-to-bottom order for src buffer */
+ if (st_fb_orientation(ctx->ReadBuffer) == Y_0_TOP) {
+ srcY = height - 1;
+ yStep = -1;
+ }
+ else {
+ srcY = 0;
+ yStep = 1;
+ }
+
+ /* To avoid a large temp memory allocation, do copy row by row */
+ for (row = 0; row < height; row++, srcY += yStep) {
+ uint data[MAX_WIDTH];
+ pipe_get_tile_z(pipe, src_trans, 0, srcY, width, 1, data);
+ if (scaleOrBias) {
+ _mesa_scale_and_bias_depth_uint(ctx, width, data);
+ }
+ pipe_put_tile_z(pipe, stImage->transfer, 0, row, width, 1, data);
+ }
+ }
+ else {
+ /* RGBA format */
+ GLfloat *tempSrc =
+ (GLfloat *) malloc(width * height * 4 * sizeof(GLfloat));
+
+ if (tempSrc && texDest) {
+ const GLint dims = 2;
+ const GLint dstRowStride = stImage->transfer->stride;
+ struct gl_texture_image *texImage = &stImage->base;
+ struct gl_pixelstore_attrib unpack = ctx->DefaultPacking;
+
+ if (st_fb_orientation(ctx->ReadBuffer) == Y_0_TOP) {
+ unpack.Invert = GL_TRUE;
+ }
+
+ /* get float/RGBA image from framebuffer */
+ /* XXX this usually involves a lot of int/float conversion.
+ * try to avoid that someday.
+ */
+ pipe_get_tile_rgba_format(pipe, src_trans, 0, 0, width, height,
+ util_format_linear(strb->texture->format),
+ tempSrc);
+
+ /* Store into texture memory.
+ * Note that this does some special things such as pixel transfer
+ * ops and format conversion. In particular, if the dest tex format
+ * is actually RGBA but the user created the texture as GL_RGB we
+ * need to fill-in/override the alpha channel with 1.0.
+ */
+ _mesa_texstore(ctx, dims,
+ texImage->_BaseFormat,
+ texImage->TexFormat,
+ texDest,
+ 0, 0, 0,
+ dstRowStride,
+ texImage->ImageOffsets,
+ width, height, 1,
+ GL_RGBA, GL_FLOAT, tempSrc, /* src */
+ &unpack);
+ }
+ else {
+ _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexSubImage");
+ }
+
+ if (tempSrc)
+ free(tempSrc);
+ }
+
+ st_texture_image_unmap(st, stImage);
+ pipe->transfer_destroy(pipe, src_trans);
+}
+
+
+
+/**
+ * If the format of the src renderbuffer and the format of the dest
+ * texture are compatible (in terms of blitting), return a TGSI writemask
+ * to be used during the blit.
+ * If the src/dest are incompatible, return 0.
+ */
+static unsigned
+compatible_src_dst_formats(struct gl_context *ctx,
+ const struct gl_renderbuffer *src,
+ const struct gl_texture_image *dst)
+{
+ /* Get logical base formats for the src and dest.
+ * That is, use the user-requested formats and not the actual, device-
+ * chosen formats.
+ * For example, the user may have requested an A8 texture but the
+ * driver may actually be using an RGBA texture format. When we
+ * copy/blit to that texture, we only want to copy the Alpha channel
+ * and not the RGB channels.
+ *
+ * Similarly, when the src FBO was created an RGB format may have been
+ * requested but the driver actually chose an RGBA format. In that case,
+ * we don't want to copy the undefined Alpha channel to the dest texture
+ * (it should be 1.0).
+ */
+ const GLenum srcFormat = _mesa_base_fbo_format(ctx, src->InternalFormat);
+ const GLenum dstFormat = _mesa_base_tex_format(ctx, dst->InternalFormat);
+
+ /**
+ * XXX when we have red-only and red/green renderbuffers we'll need
+ * to add more cases here (or implement a general-purpose routine that
+ * queries the existance of the R,G,B,A channels in the src and dest).
+ */
+ if (srcFormat == dstFormat) {
+ /* This is the same as matching_base_formats, which should
+ * always pass, as it did previously.
+ */
+ return TGSI_WRITEMASK_XYZW;
+ }
+ else if (srcFormat == GL_RGB && dstFormat == GL_RGBA) {
+ /* Make sure that A in the dest is 1. The actual src format
+ * may be RGBA and have undefined A values.
+ */
+ return TGSI_WRITEMASK_XYZ;
+ }
+ else if (srcFormat == GL_RGBA && dstFormat == GL_RGB) {
+ /* Make sure that A in the dest is 1. The actual dst format
+ * may be RGBA and will need A=1 to provide proper alpha values
+ * when sampled later.
+ */
+ return TGSI_WRITEMASK_XYZ;
+ }
+ else {
+ if (ST_DEBUG & DEBUG_FALLBACK)
+ debug_printf("%s failed for src %s, dst %s\n",
+ __FUNCTION__,
+ _mesa_lookup_enum_by_nr(srcFormat),
+ _mesa_lookup_enum_by_nr(dstFormat));
+
+ /* Otherwise fail.
+ */
+ return 0;
+ }
+}
+
+
+
+/**
+ * Do a CopyTex[Sub]Image1/2/3D() using a hardware (blit) path if possible.
+ * Note that the region to copy has already been clipped so we know we
+ * won't read from outside the source renderbuffer's bounds.
+ *
+ * Note: srcY=0=Bottom of renderbuffer (GL convention)
+ */
+static void
+st_copy_texsubimage(struct gl_context *ctx,
+ GLenum target, GLint level,
+ GLint destX, GLint destY, GLint destZ,
+ GLint srcX, GLint srcY,
+ GLsizei width, GLsizei height)
+{
+ struct gl_texture_unit *texUnit =
+ &ctx->Texture.Unit[ctx->Texture.CurrentUnit];
+ struct gl_texture_object *texObj =
+ _mesa_select_tex_object(ctx, texUnit, target);
+ struct gl_texture_image *texImage =
+ _mesa_select_tex_image(ctx, texObj, target, level);
+ struct st_texture_image *stImage = st_texture_image(texImage);
+ const GLenum texBaseFormat = texImage->_BaseFormat;
+ struct gl_framebuffer *fb = ctx->ReadBuffer;
+ struct st_renderbuffer *strb;
+ struct st_context *st = st_context(ctx);
+ struct pipe_context *pipe = st->pipe;
+ struct pipe_screen *screen = pipe->screen;
+ enum pipe_format dest_format, src_format;
+ GLboolean use_fallback = GL_TRUE;
+ GLboolean matching_base_formats;
+ GLuint format_writemask, sample_count;
+ struct pipe_surface *dest_surface = NULL;
+ GLboolean do_flip = (st_fb_orientation(ctx->ReadBuffer) == Y_0_TOP);
+
+ /* make sure finalize_textures has been called?
+ */
+ if (0) st_validate_state(st);
+
+ /* determine if copying depth or color data */
+ if (texBaseFormat == GL_DEPTH_COMPONENT ||
+ texBaseFormat == GL_DEPTH_STENCIL) {
+ strb = st_renderbuffer(fb->_DepthBuffer);
+ if (strb->Base.Wrapped) {
+ strb = st_renderbuffer(strb->Base.Wrapped);
+ }
+ }
+ else {
+ /* texBaseFormat == GL_RGB, GL_RGBA, GL_ALPHA, etc */
+ strb = st_renderbuffer(fb->_ColorReadBuffer);
+ }
+
+ if (!strb || !strb->surface || !stImage->pt) {
+ debug_printf("%s: null strb or stImage\n", __FUNCTION__);
+ return;
+ }
+
+ sample_count = strb->surface->texture->nr_samples;
+ /* I believe this would be legal, presumably would need to do a resolve
+ for color, and for depth/stencil spec says to just use one of the
+ depth/stencil samples per pixel? Need some transfer clarifications. */
+ assert(sample_count < 2);
+
+ if (srcX < 0) {
+ width -= -srcX;
+ destX += -srcX;
+ srcX = 0;
+ }
+
+ if (srcY < 0) {
+ height -= -srcY;
+ destY += -srcY;
+ srcY = 0;
+ }
+
+ if (destX < 0) {
+ width -= -destX;
+ srcX += -destX;
+ destX = 0;
+ }
+
+ if (destY < 0) {
+ height -= -destY;
+ srcY += -destY;
+ destY = 0;
+ }
+
+ if (width < 0 || height < 0)
+ return;
+
+
+ assert(strb);
+ assert(strb->surface);
+ assert(stImage->pt);
+
+ src_format = strb->surface->format;
+ dest_format = stImage->pt->format;
+
+ /*
+ * Determine if the src framebuffer and dest texture have the same
+ * base format. We need this to detect a case such as the framebuffer
+ * being GL_RGBA but the texture being GL_RGB. If the actual hardware
+ * texture format stores RGBA we need to set A=1 (overriding the
+ * framebuffer's alpha values). We can't do that with the blit or
+ * textured-quad paths.
+ */
+ matching_base_formats =
+ (_mesa_get_format_base_format(strb->Base.Format) ==
+ _mesa_get_format_base_format(texImage->TexFormat));
+ format_writemask = compatible_src_dst_formats(ctx, &strb->Base, texImage);
+
+ if (ctx->_ImageTransferState == 0x0) {
+
+ if (matching_base_formats &&
+ src_format == dest_format &&
+ !do_flip)
+ {
+ /* use surface_copy() / blit */
+ struct pipe_box src_box;
+ u_box_2d_zslice(srcX, srcY, strb->surface->u.tex.first_layer,
+ width, height, &src_box);
+
+ /* for resource_copy_region(), y=0=top, always */
+ pipe->resource_copy_region(pipe,
+ /* dest */
+ stImage->pt,
+ stImage->level,
+ destX, destY, destZ + stImage->face,
+ /* src */
+ strb->texture,
+ strb->surface->u.tex.level,
+ &src_box);
+ use_fallback = GL_FALSE;
+ }
+ else if (format_writemask &&
+ texBaseFormat != GL_DEPTH_COMPONENT &&
+ texBaseFormat != GL_DEPTH_STENCIL &&
+ screen->is_format_supported(screen, src_format,
+ PIPE_TEXTURE_2D, sample_count,
+ PIPE_BIND_SAMPLER_VIEW) &&
+ screen->is_format_supported(screen, dest_format,
+ PIPE_TEXTURE_2D, 0,
+ PIPE_BIND_RENDER_TARGET)) {
+ /* draw textured quad to do the copy */
+ GLint srcY0, srcY1;
+ struct pipe_surface surf_tmpl;
+ memset(&surf_tmpl, 0, sizeof(surf_tmpl));
+ surf_tmpl.format = util_format_linear(stImage->pt->format);
+ surf_tmpl.usage = PIPE_BIND_RENDER_TARGET;
+ surf_tmpl.u.tex.level = stImage->level;
+ surf_tmpl.u.tex.first_layer = stImage->face + destZ;
+ surf_tmpl.u.tex.last_layer = stImage->face + destZ;
+
+ dest_surface = pipe->create_surface(pipe, stImage->pt,
+ &surf_tmpl);
+
+ if (do_flip) {
+ srcY1 = strb->Base.Height - srcY - height;
+ srcY0 = srcY1 + height;
+ }
+ else {
+ srcY0 = srcY;
+ srcY1 = srcY0 + height;
+ }
+
+ util_blit_pixels_writemask(st->blit,
+ strb->texture,
+ strb->surface->u.tex.level,
+ srcX, srcY0,
+ srcX + width, srcY1,
+ strb->surface->u.tex.first_layer,
+ dest_surface,
+ destX, destY,
+ destX + width, destY + height,
+ 0.0, PIPE_TEX_MIPFILTER_NEAREST,
+ format_writemask);
+ use_fallback = GL_FALSE;
+ }
+
+ if (dest_surface)
+ pipe_surface_reference(&dest_surface, NULL);
+ }
+
+ if (use_fallback) {
+ /* software fallback */
+ fallback_copy_texsubimage(ctx, target, level,
+ strb, stImage, texBaseFormat,
+ destX, destY, destZ,
+ srcX, srcY, width, height);
+ }
+}
+
+
+
+static void
+st_CopyTexImage1D(struct gl_context * ctx, GLenum target, GLint level,
+ GLenum internalFormat,
+ GLint x, GLint y, GLsizei width, GLint border)
+{
+ struct gl_texture_unit *texUnit =
+ &ctx->Texture.Unit[ctx->Texture.CurrentUnit];
+ struct gl_texture_object *texObj =
+ _mesa_select_tex_object(ctx, texUnit, target);
+ struct gl_texture_image *texImage =
+ _mesa_select_tex_image(ctx, texObj, target, level);
+
+ /* Setup or redefine the texture object, texture and texture
+ * image. Don't populate yet.
+ */
+ ctx->Driver.TexImage1D(ctx, target, level, internalFormat,
+ width, border,
+ GL_RGBA, CHAN_TYPE, NULL,
+ &ctx->DefaultPacking, texObj, texImage);
+
+ st_copy_texsubimage(ctx, target, level,
+ 0, 0, 0, /* destX,Y,Z */
+ x, y, width, 1); /* src X, Y, size */
+}
+
+
+static void
+st_CopyTexImage2D(struct gl_context * ctx, GLenum target, GLint level,
+ GLenum internalFormat,
+ GLint x, GLint y, GLsizei width, GLsizei height,
+ GLint border)
+{
+ struct gl_texture_unit *texUnit =
+ &ctx->Texture.Unit[ctx->Texture.CurrentUnit];
+ struct gl_texture_object *texObj =
+ _mesa_select_tex_object(ctx, texUnit, target);
+ struct gl_texture_image *texImage =
+ _mesa_select_tex_image(ctx, texObj, target, level);
+
+ /* Setup or redefine the texture object, texture and texture
+ * image. Don't populate yet.
+ */
+ ctx->Driver.TexImage2D(ctx, target, level, internalFormat,
+ width, height, border,
+ GL_RGBA, CHAN_TYPE, NULL,
+ &ctx->DefaultPacking, texObj, texImage);
+
+ st_copy_texsubimage(ctx, target, level,
+ 0, 0, 0, /* destX,Y,Z */
+ x, y, width, height); /* src X, Y, size */
+}
+
+
+static void
+st_CopyTexSubImage1D(struct gl_context * ctx, GLenum target, GLint level,
+ GLint xoffset, GLint x, GLint y, GLsizei width)
+{
+ const GLint yoffset = 0, zoffset = 0;
+ const GLsizei height = 1;
+ st_copy_texsubimage(ctx, target, level,
+ xoffset, yoffset, zoffset, /* destX,Y,Z */
+ x, y, width, height); /* src X, Y, size */
+}
+
+
+static void
+st_CopyTexSubImage2D(struct gl_context * ctx, GLenum target, GLint level,
+ GLint xoffset, GLint yoffset,
+ GLint x, GLint y, GLsizei width, GLsizei height)
+{
+ const GLint zoffset = 0;
+ st_copy_texsubimage(ctx, target, level,
+ xoffset, yoffset, zoffset, /* destX,Y,Z */
+ x, y, width, height); /* src X, Y, size */
+}
+
+
+static void
+st_CopyTexSubImage3D(struct gl_context * ctx, GLenum target, GLint level,
+ GLint xoffset, GLint yoffset, GLint zoffset,
+ GLint x, GLint y, GLsizei width, GLsizei height)
+{
+ st_copy_texsubimage(ctx, target, level,
+ xoffset, yoffset, zoffset, /* destX,Y,Z */
+ x, y, width, height); /* src X, Y, size */
+}
+
+
+/**
+ * Copy image data from stImage into the texture object 'stObj' at level
+ * 'dstLevel'.
+ */
+static void
+copy_image_data_to_texture(struct st_context *st,
+ struct st_texture_object *stObj,
+ GLuint dstLevel,
+ struct st_texture_image *stImage)
+{
+ /* debug checks */
+ {
+ const struct gl_texture_image *dstImage =
+ stObj->base.Image[stImage->face][dstLevel];
+ assert(dstImage);
+ assert(dstImage->Width == stImage->base.Width);
+ assert(dstImage->Height == stImage->base.Height);
+ assert(dstImage->Depth == stImage->base.Depth);
+ }
+
+ if (stImage->pt) {
+ /* Copy potentially with the blitter:
+ */
+ st_texture_image_copy(st->pipe,
+ stObj->pt, dstLevel, /* dest texture, level */
+ stImage->pt, stImage->level, /* src texture, level */
+ stImage->face);
+
+ pipe_resource_reference(&stImage->pt, NULL);
+ }
+ else if (stImage->base.Data) {
+ st_texture_image_data(st,
+ stObj->pt,
+ stImage->face,
+ dstLevel,
+ stImage->base.Data,
+ stImage->base.RowStride *
+ util_format_get_blocksize(stObj->pt->format),
+ stImage->base.RowStride *
+ stImage->base.Height *
+ util_format_get_blocksize(stObj->pt->format));
+ _mesa_align_free(stImage->base.Data);
+ stImage->base.Data = NULL;
+ }
+
+ pipe_resource_reference(&stImage->pt, stObj->pt);
+}
+
+
+/**
+ * Called during state validation. When this function is finished,
+ * the texture object should be ready for rendering.
+ * \return GL_TRUE for success, GL_FALSE for failure (out of mem)
+ */
+GLboolean
+st_finalize_texture(struct gl_context *ctx,
+ struct pipe_context *pipe,
+ struct gl_texture_object *tObj)
+{
+ struct st_context *st = st_context(ctx);
+ struct st_texture_object *stObj = st_texture_object(tObj);
+ const GLuint nr_faces = (stObj->base.Target == GL_TEXTURE_CUBE_MAP) ? 6 : 1;
+ GLuint face;
+ struct st_texture_image *firstImage;
+ enum pipe_format firstImageFormat;
+ GLuint ptWidth, ptHeight, ptDepth, ptLayers;
+
+ if (stObj->base._Complete) {
+ /* The texture is complete and we know exactly how many mipmap levels
+ * are present/needed. This is conditional because we may be called
+ * from the st_generate_mipmap() function when the texture object is
+ * incomplete. In that case, we'll have set stObj->lastLevel before
+ * we get here.
+ */
+ if (stObj->base.Sampler.MinFilter == GL_LINEAR ||
+ stObj->base.Sampler.MinFilter == GL_NEAREST)
+ stObj->lastLevel = stObj->base.BaseLevel;
+ else
+ stObj->lastLevel = stObj->base._MaxLevel;
+ }
+
+ firstImage = st_texture_image(stObj->base.Image[0][stObj->base.BaseLevel]);
+ assert(firstImage);
+
+ /* If both firstImage and stObj point to a texture which can contain
+ * all active images, favour firstImage. Note that because of the
+ * completeness requirement, we know that the image dimensions
+ * will match.
+ */
+ if (firstImage->pt &&
+ firstImage->pt != stObj->pt &&
+ (!stObj->pt || firstImage->pt->last_level >= stObj->pt->last_level)) {
+ pipe_resource_reference(&stObj->pt, firstImage->pt);
+ pipe_sampler_view_reference(&stObj->sampler_view, NULL);
+ }
+
+ /* Find gallium format for the Mesa texture */
+ firstImageFormat = st_mesa_format_to_pipe_format(firstImage->base.TexFormat);
+
+ /* Find size of level=0 Gallium mipmap image, plus number of texture layers */
+ {
+ GLuint width, height, depth;
+ if (!guess_base_level_size(stObj->base.Target,
+ firstImage->base.Width2,
+ firstImage->base.Height2,
+ firstImage->base.Depth2,
+ stObj->base.BaseLevel,
+ &width, &height, &depth)) {
+ width = stObj->width0;
+ height = stObj->height0;
+ depth = stObj->depth0;
+ }
+ /* convert GL dims to Gallium dims */
+ st_gl_texture_dims_to_pipe_dims(stObj->base.Target, width, height, depth,
+ &ptWidth, &ptHeight, &ptDepth, &ptLayers);
+ }
+
+ /* If we already have a gallium texture, check that it matches the texture
+ * object's format, target, size, num_levels, etc.
+ */
+ if (stObj->pt) {
+ if (stObj->pt->target != gl_target_to_pipe(stObj->base.Target) ||
+ !st_sampler_compat_formats(stObj->pt->format, firstImageFormat) ||
+ stObj->pt->last_level < stObj->lastLevel ||
+ stObj->pt->width0 != ptWidth ||
+ stObj->pt->height0 != ptHeight ||
+ stObj->pt->depth0 != ptDepth ||
+ stObj->pt->array_size != ptLayers)
+ {
+ /* The gallium texture does not match the Mesa texture so delete the
+ * gallium texture now. We'll make a new one below.
+ */
+ pipe_resource_reference(&stObj->pt, NULL);
+ pipe_sampler_view_reference(&stObj->sampler_view, NULL);
+ st->dirty.st |= ST_NEW_FRAMEBUFFER;
+ }
+ }
+
+ /* May need to create a new gallium texture:
+ */
+ if (!stObj->pt) {
+ GLuint bindings = default_bindings(st, firstImageFormat);
+
+ stObj->pt = st_texture_create(st,
+ gl_target_to_pipe(stObj->base.Target),
+ firstImageFormat,
+ stObj->lastLevel,
+ ptWidth,
+ ptHeight,
+ ptDepth,
+ ptLayers,
+ bindings);
+
+ if (!stObj->pt) {
+ _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage");
+ return GL_FALSE;
+ }
+ }
+
+ /* Pull in any images not in the object's texture:
+ */
+ for (face = 0; face < nr_faces; face++) {
+ GLuint level;
+ for (level = stObj->base.BaseLevel; level <= stObj->lastLevel; level++) {
+ struct st_texture_image *stImage =
+ st_texture_image(stObj->base.Image[face][level]);
+
+ /* Need to import images in main memory or held in other textures.
+ */
+ if (stImage && stObj->pt != stImage->pt) {
+ if (level == 0 || (stImage->base.Width == u_minify(stObj->width0, level) &&
+ stImage->base.Height == u_minify(stObj->height0, level) &&
+ stImage->base.Depth == u_minify(stObj->depth0, level))) {
+ /* src image fits expected dest mipmap level size */
+ copy_image_data_to_texture(st, stObj, level, stImage);
+ }
+ }
+ }
+ }
+
+ return GL_TRUE;
+}
+
+
+/**
+ * Returns pointer to a default/dummy texture.
+ * This is typically used when the current shader has tex/sample instructions
+ * but the user has not provided a (any) texture(s).
+ */
+struct gl_texture_object *
+st_get_default_texture(struct st_context *st)
+{
+ if (!st->default_texture) {
+ static const GLenum target = GL_TEXTURE_2D;
+ GLubyte pixels[16][16][4];
+ struct gl_texture_object *texObj;
+ struct gl_texture_image *texImg;
+ GLuint i, j;
+
+ /* The ARB_fragment_program spec says (0,0,0,1) should be returned
+ * when attempting to sample incomplete textures.
+ */
+ for (i = 0; i < 16; i++) {
+ for (j = 0; j < 16; j++) {
+ pixels[i][j][0] = 0;
+ pixels[i][j][1] = 0;
+ pixels[i][j][2] = 0;
+ pixels[i][j][3] = 255;
+ }
+ }
+
+ texObj = st->ctx->Driver.NewTextureObject(st->ctx, 0, target);
+
+ texImg = _mesa_get_tex_image(st->ctx, texObj, target, 0);
+
+ _mesa_init_teximage_fields(st->ctx, target, texImg,
+ 16, 16, 1, 0, /* w, h, d, border */
+ GL_RGBA, MESA_FORMAT_RGBA8888);
+
+ st_TexImage(st->ctx, 2, target,
+ 0, GL_RGBA, /* level, intformat */
+ 16, 16, 1, 0, /* w, h, d, border */
+ GL_RGBA, GL_UNSIGNED_BYTE, pixels,
+ &st->ctx->DefaultPacking,
+ texObj, texImg,
+ 0, 0);
+
+ texObj->Sampler.MinFilter = GL_NEAREST;
+ texObj->Sampler.MagFilter = GL_NEAREST;
+ texObj->_Complete = GL_TRUE;
+
+ st->default_texture = texObj;
+ }
+ return st->default_texture;
+}
+
+
+void
+st_init_texture_functions(struct dd_function_table *functions)
+{
+ functions->ChooseTextureFormat = st_ChooseTextureFormat;
+ functions->TexImage1D = st_TexImage1D;
+ functions->TexImage2D = st_TexImage2D;
+ functions->TexImage3D = st_TexImage3D;
+ functions->TexSubImage1D = st_TexSubImage1D;
+ functions->TexSubImage2D = st_TexSubImage2D;
+ functions->TexSubImage3D = st_TexSubImage3D;
+ functions->CompressedTexSubImage1D = st_CompressedTexSubImage1D;
+ functions->CompressedTexSubImage2D = st_CompressedTexSubImage2D;
+ functions->CompressedTexSubImage3D = st_CompressedTexSubImage3D;
+ functions->CopyTexImage1D = st_CopyTexImage1D;
+ functions->CopyTexImage2D = st_CopyTexImage2D;
+ functions->CopyTexSubImage1D = st_CopyTexSubImage1D;
+ functions->CopyTexSubImage2D = st_CopyTexSubImage2D;
+ functions->CopyTexSubImage3D = st_CopyTexSubImage3D;
+ functions->GenerateMipmap = st_generate_mipmap;
+
+ functions->GetTexImage = st_GetTexImage;
+
+ /* compressed texture functions */
+ functions->CompressedTexImage2D = st_CompressedTexImage2D;
+ functions->GetCompressedTexImage = st_GetCompressedTexImage;
+
+ functions->NewTextureObject = st_NewTextureObject;
+ functions->NewTextureImage = st_NewTextureImage;
+ functions->DeleteTexture = st_DeleteTextureObject;
+ functions->FreeTexImageData = st_FreeTextureImageData;
+
+ functions->TextureMemCpy = do_memcpy;
+
+ /* XXX Temporary until we can query pipe's texture sizes */
+ functions->TestProxyTexImage = _mesa_test_proxy_teximage;
+}
diff --git a/mesalib/src/mesa/state_tracker/st_context.c b/mesalib/src/mesa/state_tracker/st_context.c
index 6eddbfc88..40af1a5bb 100644
--- a/mesalib/src/mesa/state_tracker/st_context.c
+++ b/mesalib/src/mesa/state_tracker/st_context.c
@@ -1,300 +1,300 @@
-/**************************************************************************
- *
- * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas.
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sub license, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice (including the
- * next paragraph) shall be included in all copies or substantial portions
- * of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
- * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
- * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- **************************************************************************/
-
-#include "main/imports.h"
-#include "main/context.h"
-#include "main/samplerobj.h"
-#include "main/shaderobj.h"
-#include "program/prog_cache.h"
-#include "vbo/vbo.h"
-#include "glapi/glapi.h"
-#include "st_context.h"
-#include "st_debug.h"
-#include "st_cb_accum.h"
-#include "st_cb_bitmap.h"
-#include "st_cb_blit.h"
-#include "st_cb_bufferobjects.h"
-#include "st_cb_clear.h"
-#include "st_cb_condrender.h"
-#include "st_cb_drawpixels.h"
-#include "st_cb_rasterpos.h"
-#include "st_cb_drawtex.h"
-#include "st_cb_eglimage.h"
-#include "st_cb_fbo.h"
-#include "st_cb_feedback.h"
-#include "st_cb_program.h"
-#include "st_cb_queryobj.h"
-#include "st_cb_readpixels.h"
-#include "st_cb_texture.h"
-#include "st_cb_xformfb.h"
-#include "st_cb_flush.h"
-#include "st_cb_syncobj.h"
-#include "st_cb_strings.h"
-#include "st_cb_texturebarrier.h"
-#include "st_cb_viewport.h"
-#include "st_atom.h"
-#include "st_draw.h"
-#include "st_extensions.h"
-#include "st_gen_mipmap.h"
-#include "st_program.h"
-#include "pipe/p_context.h"
-#include "util/u_inlines.h"
-#include "cso_cache/cso_context.h"
-
-
-DEBUG_GET_ONCE_BOOL_OPTION(mesa_mvp_dp4, "MESA_MVP_DP4", FALSE)
-
-
-/**
- * Called via ctx->Driver.UpdateState()
- */
-void st_invalidate_state(struct gl_context * ctx, GLuint new_state)
-{
- struct st_context *st = st_context(ctx);
-
- st->dirty.mesa |= new_state;
- st->dirty.st |= ST_NEW_MESA;
-
- /* This is the only core Mesa module we depend upon.
- * No longer use swrast, swsetup, tnl.
- */
- _vbo_InvalidateState(ctx, new_state);
-}
-
-
-/**
- * Check for multisample env var override.
- */
-int
-st_get_msaa(void)
-{
- const char *msaa = _mesa_getenv("__GL_FSAA_MODE");
- if (msaa)
- return atoi(msaa);
- return 0;
-}
-
-
-static struct st_context *
-st_create_context_priv( struct gl_context *ctx, struct pipe_context *pipe )
-{
- uint i;
- struct st_context *st = ST_CALLOC_STRUCT( st_context );
-
- ctx->st = st;
-
- st->ctx = ctx;
- st->pipe = pipe;
-
- /* XXX: this is one-off, per-screen init: */
- st_debug_init();
-
- /* state tracker needs the VBO module */
- _vbo_CreateContext(ctx);
-
- st->dirty.mesa = ~0;
- st->dirty.st = ~0;
-
- st->cso_context = cso_create_context(pipe);
-
- st_init_atoms( st );
- st_init_bitmap(st);
- st_init_clear(st);
- st_init_draw( st );
- st_init_generate_mipmap(st);
- st_init_blit(st);
-
- if(pipe->screen->get_param(pipe->screen, PIPE_CAP_NPOT_TEXTURES))
- st->internal_target = PIPE_TEXTURE_2D;
- else
- st->internal_target = PIPE_TEXTURE_RECT;
-
- for (i = 0; i < 3; i++) {
- memset(&st->velems_util_draw[i], 0, sizeof(struct pipe_vertex_element));
- st->velems_util_draw[i].src_offset = i * 4 * sizeof(float);
- st->velems_util_draw[i].instance_divisor = 0;
- st->velems_util_draw[i].vertex_buffer_index = 0;
- st->velems_util_draw[i].src_format = PIPE_FORMAT_R32G32B32A32_FLOAT;
- }
-
- /* we want all vertex data to be placed in buffer objects */
- vbo_use_buffer_objects(ctx);
-
- /* Need these flags:
- */
- st->ctx->FragmentProgram._MaintainTexEnvProgram = GL_TRUE;
-
- st->ctx->VertexProgram._MaintainTnlProgram = GL_TRUE;
-
- st->pixel_xfer.cache = _mesa_new_program_cache();
-
- st->force_msaa = st_get_msaa();
-
- /* GL limits and extensions */
- st_init_limits(st);
- st_init_extensions(st);
-
- return st;
-}
-
-
-struct st_context *st_create_context(gl_api api, struct pipe_context *pipe,
- const struct gl_config *visual,
- struct st_context *share)
-{
- struct gl_context *ctx;
- struct gl_context *shareCtx = share ? share->ctx : NULL;
- struct dd_function_table funcs;
-
- /* Sanity checks */
- assert(MESA_SHADER_VERTEX == PIPE_SHADER_VERTEX);
- assert(MESA_SHADER_FRAGMENT == PIPE_SHADER_FRAGMENT);
- assert(MESA_SHADER_GEOMETRY == PIPE_SHADER_GEOMETRY);
-
- memset(&funcs, 0, sizeof(funcs));
- st_init_driver_functions(&funcs);
-
- ctx = _mesa_create_context(api, visual, shareCtx, &funcs, NULL);
-
- /* XXX: need a capability bit in gallium to query if the pipe
- * driver prefers DP4 or MUL/MAD for vertex transformation.
- */
- if (debug_get_option_mesa_mvp_dp4())
- _mesa_set_mvp_with_dp4( ctx, GL_TRUE );
-
- return st_create_context_priv(ctx, pipe);
-}
-
-
-static void st_destroy_context_priv( struct st_context *st )
-{
- uint i;
-
- st_destroy_atoms( st );
- st_destroy_draw( st );
- st_destroy_generate_mipmap(st);
- st_destroy_blit(st);
- st_destroy_clear(st);
- st_destroy_bitmap(st);
- st_destroy_drawpix(st);
- st_destroy_drawtex(st);
-
- /* Unreference any user vertex buffers. */
- for (i = 0; i < st->num_user_attribs; i++) {
- pipe_resource_reference(&st->user_attrib[i].buffer, NULL);
- }
-
- for (i = 0; i < Elements(st->state.sampler_views); i++) {
- pipe_sampler_view_reference(&st->state.sampler_views[i], NULL);
- }
-
- if (st->default_texture) {
- st->ctx->Driver.DeleteTexture(st->ctx, st->default_texture);
- st->default_texture = NULL;
- }
-
- free( st );
-}
-
-
-void st_destroy_context( struct st_context *st )
-{
- struct pipe_context *pipe = st->pipe;
- struct cso_context *cso = st->cso_context;
- struct gl_context *ctx = st->ctx;
- GLuint i;
-
- /* need to unbind and destroy CSO objects before anything else */
- cso_release_all(st->cso_context);
-
- st_reference_fragprog(st, &st->fp, NULL);
- st_reference_vertprog(st, &st->vp, NULL);
-
- /* release framebuffer surfaces */
- for (i = 0; i < PIPE_MAX_COLOR_BUFS; i++) {
- pipe_surface_reference(&st->state.framebuffer.cbufs[i], NULL);
- }
- pipe_surface_reference(&st->state.framebuffer.zsbuf, NULL);
-
- pipe->set_index_buffer(pipe, NULL);
-
- for (i = 0; i < PIPE_SHADER_TYPES; i++) {
- pipe->set_constant_buffer(pipe, i, 0, NULL);
- }
-
- _mesa_delete_program_cache(st->ctx, st->pixel_xfer.cache);
-
- _vbo_DestroyContext(st->ctx);
-
- st_destroy_program_variants(st);
-
- _mesa_free_context_data(ctx);
-
- st_destroy_context_priv(st);
-
- cso_destroy_context(cso);
-
- pipe->destroy( pipe );
-
- free(ctx);
-}
-
-
-void st_init_driver_functions(struct dd_function_table *functions)
-{
- _mesa_init_shader_object_functions(functions);
- _mesa_init_sampler_object_functions(functions);
-
- st_init_accum_functions(functions);
- st_init_blit_functions(functions);
- st_init_bufferobject_functions(functions);
- st_init_clear_functions(functions);
- st_init_bitmap_functions(functions);
- st_init_drawpixels_functions(functions);
- st_init_rasterpos_functions(functions);
-
- st_init_drawtex_functions(functions);
-
- st_init_eglimage_functions(functions);
-
- st_init_fbo_functions(functions);
- st_init_feedback_functions(functions);
- st_init_program_functions(functions);
- st_init_query_functions(functions);
- st_init_cond_render_functions(functions);
- st_init_readpixels_functions(functions);
- st_init_texture_functions(functions);
- st_init_texture_barrier_functions(functions);
- st_init_flush_functions(functions);
- st_init_string_functions(functions);
- st_init_viewport_functions(functions);
-
- st_init_xformfb_functions(functions);
- st_init_syncobj_functions(functions);
-
- functions->UpdateState = st_invalidate_state;
-}
+/**************************************************************************
+ *
+ * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ **************************************************************************/
+
+#include "main/imports.h"
+#include "main/context.h"
+#include "main/samplerobj.h"
+#include "main/shaderobj.h"
+#include "program/prog_cache.h"
+#include "vbo/vbo.h"
+#include "glapi/glapi.h"
+#include "st_context.h"
+#include "st_debug.h"
+#include "st_cb_accum.h"
+#include "st_cb_bitmap.h"
+#include "st_cb_blit.h"
+#include "st_cb_bufferobjects.h"
+#include "st_cb_clear.h"
+#include "st_cb_condrender.h"
+#include "st_cb_drawpixels.h"
+#include "st_cb_rasterpos.h"
+#include "st_cb_drawtex.h"
+#include "st_cb_eglimage.h"
+#include "st_cb_fbo.h"
+#include "st_cb_feedback.h"
+#include "st_cb_program.h"
+#include "st_cb_queryobj.h"
+#include "st_cb_readpixels.h"
+#include "st_cb_texture.h"
+#include "st_cb_xformfb.h"
+#include "st_cb_flush.h"
+#include "st_cb_syncobj.h"
+#include "st_cb_strings.h"
+#include "st_cb_texturebarrier.h"
+#include "st_cb_viewport.h"
+#include "st_atom.h"
+#include "st_draw.h"
+#include "st_extensions.h"
+#include "st_gen_mipmap.h"
+#include "st_program.h"
+#include "pipe/p_context.h"
+#include "util/u_inlines.h"
+#include "cso_cache/cso_context.h"
+
+
+DEBUG_GET_ONCE_BOOL_OPTION(mesa_mvp_dp4, "MESA_MVP_DP4", FALSE)
+
+
+/**
+ * Called via ctx->Driver.UpdateState()
+ */
+void st_invalidate_state(struct gl_context * ctx, GLuint new_state)
+{
+ struct st_context *st = st_context(ctx);
+
+ st->dirty.mesa |= new_state;
+ st->dirty.st |= ST_NEW_MESA;
+
+ /* This is the only core Mesa module we depend upon.
+ * No longer use swrast, swsetup, tnl.
+ */
+ _vbo_InvalidateState(ctx, new_state);
+}
+
+
+/**
+ * Check for multisample env var override.
+ */
+int
+st_get_msaa(void)
+{
+ const char *msaa = _mesa_getenv("__GL_FSAA_MODE");
+ if (msaa)
+ return atoi(msaa);
+ return 0;
+}
+
+
+static struct st_context *
+st_create_context_priv( struct gl_context *ctx, struct pipe_context *pipe )
+{
+ uint i;
+ struct st_context *st = ST_CALLOC_STRUCT( st_context );
+
+ ctx->st = st;
+
+ st->ctx = ctx;
+ st->pipe = pipe;
+
+ /* XXX: this is one-off, per-screen init: */
+ st_debug_init();
+
+ /* state tracker needs the VBO module */
+ _vbo_CreateContext(ctx);
+
+ st->dirty.mesa = ~0;
+ st->dirty.st = ~0;
+
+ st->cso_context = cso_create_context(pipe);
+
+ st_init_atoms( st );
+ st_init_bitmap(st);
+ st_init_clear(st);
+ st_init_draw( st );
+ st_init_generate_mipmap(st);
+ st_init_blit(st);
+
+ if(pipe->screen->get_param(pipe->screen, PIPE_CAP_NPOT_TEXTURES))
+ st->internal_target = PIPE_TEXTURE_2D;
+ else
+ st->internal_target = PIPE_TEXTURE_RECT;
+
+ for (i = 0; i < 3; i++) {
+ memset(&st->velems_util_draw[i], 0, sizeof(struct pipe_vertex_element));
+ st->velems_util_draw[i].src_offset = i * 4 * sizeof(float);
+ st->velems_util_draw[i].instance_divisor = 0;
+ st->velems_util_draw[i].vertex_buffer_index = 0;
+ st->velems_util_draw[i].src_format = PIPE_FORMAT_R32G32B32A32_FLOAT;
+ }
+
+ /* we want all vertex data to be placed in buffer objects */
+ vbo_use_buffer_objects(ctx);
+
+ /* Need these flags:
+ */
+ st->ctx->FragmentProgram._MaintainTexEnvProgram = GL_TRUE;
+
+ st->ctx->VertexProgram._MaintainTnlProgram = GL_TRUE;
+
+ st->pixel_xfer.cache = _mesa_new_program_cache();
+
+ st->force_msaa = st_get_msaa();
+
+ /* GL limits and extensions */
+ st_init_limits(st);
+ st_init_extensions(st);
+
+ return st;
+}
+
+
+struct st_context *st_create_context(gl_api api, struct pipe_context *pipe,
+ const struct gl_config *visual,
+ struct st_context *share)
+{
+ struct gl_context *ctx;
+ struct gl_context *shareCtx = share ? share->ctx : NULL;
+ struct dd_function_table funcs;
+
+ /* Sanity checks */
+ assert(MESA_SHADER_VERTEX == PIPE_SHADER_VERTEX);
+ assert(MESA_SHADER_FRAGMENT == PIPE_SHADER_FRAGMENT);
+ assert(MESA_SHADER_GEOMETRY == PIPE_SHADER_GEOMETRY);
+
+ memset(&funcs, 0, sizeof(funcs));
+ st_init_driver_functions(&funcs);
+
+ ctx = _mesa_create_context(api, visual, shareCtx, &funcs, NULL);
+
+ /* XXX: need a capability bit in gallium to query if the pipe
+ * driver prefers DP4 or MUL/MAD for vertex transformation.
+ */
+ if (debug_get_option_mesa_mvp_dp4())
+ _mesa_set_mvp_with_dp4( ctx, GL_TRUE );
+
+ return st_create_context_priv(ctx, pipe);
+}
+
+
+static void st_destroy_context_priv( struct st_context *st )
+{
+ uint i;
+
+ st_destroy_atoms( st );
+ st_destroy_draw( st );
+ st_destroy_generate_mipmap(st);
+ st_destroy_blit(st);
+ st_destroy_clear(st);
+ st_destroy_bitmap(st);
+ st_destroy_drawpix(st);
+ st_destroy_drawtex(st);
+
+ /* Unreference any user vertex buffers. */
+ for (i = 0; i < st->num_user_attribs; i++) {
+ pipe_resource_reference(&st->user_attrib[i].buffer, NULL);
+ }
+
+ for (i = 0; i < Elements(st->state.sampler_views); i++) {
+ pipe_sampler_view_reference(&st->state.sampler_views[i], NULL);
+ }
+
+ if (st->default_texture) {
+ st->ctx->Driver.DeleteTexture(st->ctx, st->default_texture);
+ st->default_texture = NULL;
+ }
+
+ free( st );
+}
+
+
+void st_destroy_context( struct st_context *st )
+{
+ struct pipe_context *pipe = st->pipe;
+ struct cso_context *cso = st->cso_context;
+ struct gl_context *ctx = st->ctx;
+ GLuint i;
+
+ /* need to unbind and destroy CSO objects before anything else */
+ cso_release_all(st->cso_context);
+
+ st_reference_fragprog(st, &st->fp, NULL);
+ st_reference_vertprog(st, &st->vp, NULL);
+
+ /* release framebuffer surfaces */
+ for (i = 0; i < PIPE_MAX_COLOR_BUFS; i++) {
+ pipe_surface_reference(&st->state.framebuffer.cbufs[i], NULL);
+ }
+ pipe_surface_reference(&st->state.framebuffer.zsbuf, NULL);
+
+ pipe->set_index_buffer(pipe, NULL);
+
+ for (i = 0; i < PIPE_SHADER_TYPES; i++) {
+ pipe->set_constant_buffer(pipe, i, 0, NULL);
+ }
+
+ _mesa_delete_program_cache(st->ctx, st->pixel_xfer.cache);
+
+ _vbo_DestroyContext(st->ctx);
+
+ st_destroy_program_variants(st);
+
+ _mesa_free_context_data(ctx);
+
+ st_destroy_context_priv(st);
+
+ cso_destroy_context(cso);
+
+ pipe->destroy( pipe );
+
+ free(ctx);
+}
+
+
+void st_init_driver_functions(struct dd_function_table *functions)
+{
+ _mesa_init_shader_object_functions(functions);
+ _mesa_init_sampler_object_functions(functions);
+
+ st_init_accum_functions(functions);
+ st_init_blit_functions(functions);
+ st_init_bufferobject_functions(functions);
+ st_init_clear_functions(functions);
+ st_init_bitmap_functions(functions);
+ st_init_drawpixels_functions(functions);
+ st_init_rasterpos_functions(functions);
+
+ st_init_drawtex_functions(functions);
+
+ st_init_eglimage_functions(functions);
+
+ st_init_fbo_functions(functions);
+ st_init_feedback_functions(functions);
+ st_init_program_functions(functions);
+ st_init_query_functions(functions);
+ st_init_cond_render_functions(functions);
+ st_init_readpixels_functions(functions);
+ st_init_texture_functions(functions);
+ st_init_texture_barrier_functions(functions);
+ st_init_flush_functions(functions);
+ st_init_string_functions(functions);
+ st_init_viewport_functions(functions);
+
+ st_init_xformfb_functions(functions);
+ st_init_syncobj_functions(functions);
+
+ functions->UpdateState = st_invalidate_state;
+}
diff --git a/mesalib/src/mesa/state_tracker/st_context.h b/mesalib/src/mesa/state_tracker/st_context.h
index c6fc31801..eacb3544f 100644
--- a/mesalib/src/mesa/state_tracker/st_context.h
+++ b/mesalib/src/mesa/state_tracker/st_context.h
@@ -1,280 +1,280 @@
-/**************************************************************************
- *
- * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas.
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sub license, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice (including the
- * next paragraph) shall be included in all copies or substantial portions
- * of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
- * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
- * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- **************************************************************************/
-
-#ifndef ST_CONTEXT_H
-#define ST_CONTEXT_H
-
-#include "main/mtypes.h"
-#include "pipe/p_state.h"
-#include "state_tracker/st_api.h"
-
-struct bitmap_cache;
-struct blit_state;
-struct dd_function_table;
-struct draw_context;
-struct draw_stage;
-struct gen_mipmap_state;
-struct st_context;
-struct st_fragment_program;
-
-
-#define ST_NEW_MESA 0x1 /* Mesa state has changed */
-#define ST_NEW_FRAGMENT_PROGRAM 0x2
-#define ST_NEW_VERTEX_PROGRAM 0x4
-#define ST_NEW_FRAMEBUFFER 0x8
-#define ST_NEW_EDGEFLAGS_DATA 0x10
-#define ST_NEW_GEOMETRY_PROGRAM 0x20
-
-
-struct st_state_flags {
- GLuint mesa;
- GLuint st;
-};
-
-struct st_tracked_state {
- const char *name;
- struct st_state_flags dirty;
- void (*update)( struct st_context *st );
-};
-
-
-
-struct st_context
-{
- struct st_context_iface iface;
-
- struct gl_context *ctx;
-
- struct pipe_context *pipe;
-
- struct draw_context *draw; /**< For selection/feedback/rastpos only */
- struct draw_stage *feedback_stage; /**< For GL_FEEDBACK rendermode */
- struct draw_stage *selection_stage; /**< For GL_SELECT rendermode */
- struct draw_stage *rastpos_stage; /**< For glRasterPos */
-
-
- /* On old libGL's for linux we need to invalidate the drawables
- * on glViewpport calls, this is set via a option.
- */
- boolean invalidate_on_gl_viewport;
-
- /* Some state is contained in constant objects.
- * Other state is just parameter values.
- */
- struct {
- struct pipe_blend_state blend;
- struct pipe_depth_stencil_alpha_state depth_stencil;
- struct pipe_rasterizer_state rasterizer;
- struct pipe_sampler_state samplers[PIPE_MAX_SAMPLERS];
- struct pipe_sampler_state vertex_samplers[PIPE_MAX_VERTEX_SAMPLERS];
- struct pipe_clip_state clip;
- struct {
- void *ptr;
- unsigned size;
- } constants[PIPE_SHADER_TYPES];
- struct pipe_framebuffer_state framebuffer;
- struct pipe_sampler_view *sampler_views[PIPE_MAX_SAMPLERS];
- struct pipe_sampler_view *sampler_vertex_views[PIPE_MAX_VERTEX_SAMPLERS];
- struct pipe_scissor_state scissor;
- struct pipe_viewport_state viewport;
- unsigned sample_mask;
-
- GLuint num_samplers;
- GLuint num_vertex_samplers;
- GLuint num_textures;
- GLuint num_vertex_textures;
-
- GLuint poly_stipple[32]; /**< In OpenGL's bottom-to-top order */
- } state;
-
- char vendor[100];
- char renderer[100];
-
- struct st_state_flags dirty;
-
- GLboolean missing_textures;
- GLboolean vertdata_edgeflags;
-
- /** Mapping from VERT_RESULT_x to post-transformed vertex slot */
- const GLuint *vertex_result_to_slot;
-
- struct st_vertex_program *vp; /**< Currently bound vertex program */
- struct st_fragment_program *fp; /**< Currently bound fragment program */
- struct st_geometry_program *gp; /**< Currently bound geometry program */
-
- struct st_vp_variant *vp_variant;
- struct st_fp_variant *fp_variant;
- struct st_gp_variant *gp_variant;
-
- struct gl_texture_object *default_texture;
-
- struct {
- struct gl_program_cache *cache;
- struct st_fragment_program *program; /**< cur pixel transfer prog */
- GLuint xfer_prog_sn; /**< pixel xfer program serial no. */
- GLuint user_prog_sn; /**< user fragment program serial no. */
- struct st_fragment_program *combined_prog;
- GLuint combined_prog_sn;
- struct pipe_resource *pixelmap_texture;
- struct pipe_sampler_view *pixelmap_sampler_view;
- boolean pixelmap_enabled; /**< use the pixelmap texture? */
- } pixel_xfer;
-
- /** for glBitmap */
- struct {
- struct pipe_rasterizer_state rasterizer;
- struct pipe_sampler_state samplers[2];
- enum pipe_format tex_format;
- void *vs;
- float vertices[4][3][4]; /**< vertex pos + color + texcoord */
- struct pipe_resource *vbuf;
- unsigned vbuf_slot; /* next free slot in vbuf */
- struct bitmap_cache *cache;
- } bitmap;
-
- /** for glDraw/CopyPixels */
- struct {
- struct gl_fragment_program *shaders[4];
- void *vert_shaders[2]; /**< ureg shaders */
- } drawpix;
-
- /** for glClear */
- struct {
- struct pipe_rasterizer_state raster;
- struct pipe_viewport_state viewport;
- struct pipe_clip_state clip;
- void *vs;
- void *fs;
- float vertices[4][2][4]; /**< vertex pos + color */
- struct pipe_resource *vbuf;
- unsigned vbuf_slot;
- boolean enable_ds_separate;
- } clear;
-
- /** used for anything using util_draw_vertex_buffer */
- struct pipe_vertex_element velems_util_draw[3];
-
- void *passthrough_fs; /**< simple pass-through frag shader */
-
- enum pipe_texture_target internal_target;
- struct gen_mipmap_state *gen_mipmap;
- struct blit_state *blit;
-
- struct cso_context *cso_context;
-
- int force_msaa;
- void *winsys_drawable_handle;
-
- /* User vertex buffers. */
- struct {
- struct pipe_resource *buffer;
-
- /** Element size */
- GLuint element_size;
-
- /** Attribute stride */
- GLsizei stride;
- } user_attrib[PIPE_MAX_ATTRIBS];
- unsigned num_user_attribs;
-};
-
-
-/* Need this so that we can implement Mesa callbacks in this module.
- */
-static INLINE struct st_context *st_context(struct gl_context *ctx)
-{
- return ctx->st;
-}
-
-
-/**
- * Wrapper for struct gl_framebuffer.
- * This is an opaque type to the outside world.
- */
-struct st_framebuffer
-{
- struct gl_framebuffer Base;
- void *Private;
-
- struct st_framebuffer_iface *iface;
- enum st_attachment_type statts[ST_ATTACHMENT_COUNT];
- unsigned num_statts;
- int32_t revalidate;
-};
-
-
-extern void st_init_driver_functions(struct dd_function_table *functions);
-
-void st_invalidate_state(struct gl_context * ctx, GLuint new_state);
-
-
-
-#define Y_0_TOP 1
-#define Y_0_BOTTOM 2
-
-static INLINE GLuint
-st_fb_orientation(const struct gl_framebuffer *fb)
-{
- if (fb && fb->Name == 0) {
- /* Drawing into a window (on-screen buffer).
- *
- * Negate Y scale to flip image vertically.
- * The NDC Y coords prior to viewport transformation are in the range
- * [y=-1=bottom, y=1=top]
- * Hardware window coords are in the range [y=0=top, y=H-1=bottom] where
- * H is the window height.
- * Use the viewport transformation to invert Y.
- */
- return Y_0_TOP;
- }
- else {
- /* Drawing into user-created FBO (very likely a texture).
- *
- * For textures, T=0=Bottom, so by extension Y=0=Bottom for rendering.
- */
- return Y_0_BOTTOM;
- }
-}
-
-
-/** clear-alloc a struct-sized object, with casting */
-#define ST_CALLOC_STRUCT(T) (struct T *) calloc(1, sizeof(struct T))
-
-
-extern int
-st_get_msaa(void);
-
-extern struct st_context *
-st_create_context(gl_api api, struct pipe_context *pipe,
- const struct gl_config *visual,
- struct st_context *share);
-
-extern void
-st_destroy_context(struct st_context *st);
-
-
-#endif
+/**************************************************************************
+ *
+ * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ **************************************************************************/
+
+#ifndef ST_CONTEXT_H
+#define ST_CONTEXT_H
+
+#include "main/mtypes.h"
+#include "pipe/p_state.h"
+#include "state_tracker/st_api.h"
+
+struct bitmap_cache;
+struct blit_state;
+struct dd_function_table;
+struct draw_context;
+struct draw_stage;
+struct gen_mipmap_state;
+struct st_context;
+struct st_fragment_program;
+
+
+#define ST_NEW_MESA 0x1 /* Mesa state has changed */
+#define ST_NEW_FRAGMENT_PROGRAM 0x2
+#define ST_NEW_VERTEX_PROGRAM 0x4
+#define ST_NEW_FRAMEBUFFER 0x8
+#define ST_NEW_EDGEFLAGS_DATA 0x10
+#define ST_NEW_GEOMETRY_PROGRAM 0x20
+
+
+struct st_state_flags {
+ GLuint mesa;
+ GLuint st;
+};
+
+struct st_tracked_state {
+ const char *name;
+ struct st_state_flags dirty;
+ void (*update)( struct st_context *st );
+};
+
+
+
+struct st_context
+{
+ struct st_context_iface iface;
+
+ struct gl_context *ctx;
+
+ struct pipe_context *pipe;
+
+ struct draw_context *draw; /**< For selection/feedback/rastpos only */
+ struct draw_stage *feedback_stage; /**< For GL_FEEDBACK rendermode */
+ struct draw_stage *selection_stage; /**< For GL_SELECT rendermode */
+ struct draw_stage *rastpos_stage; /**< For glRasterPos */
+
+
+ /* On old libGL's for linux we need to invalidate the drawables
+ * on glViewpport calls, this is set via a option.
+ */
+ boolean invalidate_on_gl_viewport;
+
+ /* Some state is contained in constant objects.
+ * Other state is just parameter values.
+ */
+ struct {
+ struct pipe_blend_state blend;
+ struct pipe_depth_stencil_alpha_state depth_stencil;
+ struct pipe_rasterizer_state rasterizer;
+ struct pipe_sampler_state samplers[PIPE_MAX_SAMPLERS];
+ struct pipe_sampler_state vertex_samplers[PIPE_MAX_VERTEX_SAMPLERS];
+ struct pipe_clip_state clip;
+ struct {
+ void *ptr;
+ unsigned size;
+ } constants[PIPE_SHADER_TYPES];
+ struct pipe_framebuffer_state framebuffer;
+ struct pipe_sampler_view *sampler_views[PIPE_MAX_SAMPLERS];
+ struct pipe_sampler_view *sampler_vertex_views[PIPE_MAX_VERTEX_SAMPLERS];
+ struct pipe_scissor_state scissor;
+ struct pipe_viewport_state viewport;
+ unsigned sample_mask;
+
+ GLuint num_samplers;
+ GLuint num_vertex_samplers;
+ GLuint num_textures;
+ GLuint num_vertex_textures;
+
+ GLuint poly_stipple[32]; /**< In OpenGL's bottom-to-top order */
+ } state;
+
+ char vendor[100];
+ char renderer[100];
+
+ struct st_state_flags dirty;
+
+ GLboolean missing_textures;
+ GLboolean vertdata_edgeflags;
+
+ /** Mapping from VERT_RESULT_x to post-transformed vertex slot */
+ const GLuint *vertex_result_to_slot;
+
+ struct st_vertex_program *vp; /**< Currently bound vertex program */
+ struct st_fragment_program *fp; /**< Currently bound fragment program */
+ struct st_geometry_program *gp; /**< Currently bound geometry program */
+
+ struct st_vp_variant *vp_variant;
+ struct st_fp_variant *fp_variant;
+ struct st_gp_variant *gp_variant;
+
+ struct gl_texture_object *default_texture;
+
+ struct {
+ struct gl_program_cache *cache;
+ struct st_fragment_program *program; /**< cur pixel transfer prog */
+ GLuint xfer_prog_sn; /**< pixel xfer program serial no. */
+ GLuint user_prog_sn; /**< user fragment program serial no. */
+ struct st_fragment_program *combined_prog;
+ GLuint combined_prog_sn;
+ struct pipe_resource *pixelmap_texture;
+ struct pipe_sampler_view *pixelmap_sampler_view;
+ boolean pixelmap_enabled; /**< use the pixelmap texture? */
+ } pixel_xfer;
+
+ /** for glBitmap */
+ struct {
+ struct pipe_rasterizer_state rasterizer;
+ struct pipe_sampler_state samplers[2];
+ enum pipe_format tex_format;
+ void *vs;
+ float vertices[4][3][4]; /**< vertex pos + color + texcoord */
+ struct pipe_resource *vbuf;
+ unsigned vbuf_slot; /* next free slot in vbuf */
+ struct bitmap_cache *cache;
+ } bitmap;
+
+ /** for glDraw/CopyPixels */
+ struct {
+ struct gl_fragment_program *shaders[4];
+ void *vert_shaders[2]; /**< ureg shaders */
+ } drawpix;
+
+ /** for glClear */
+ struct {
+ struct pipe_rasterizer_state raster;
+ struct pipe_viewport_state viewport;
+ struct pipe_clip_state clip;
+ void *vs;
+ void *fs;
+ float vertices[4][2][4]; /**< vertex pos + color */
+ struct pipe_resource *vbuf;
+ unsigned vbuf_slot;
+ boolean enable_ds_separate;
+ } clear;
+
+ /** used for anything using util_draw_vertex_buffer */
+ struct pipe_vertex_element velems_util_draw[3];
+
+ void *passthrough_fs; /**< simple pass-through frag shader */
+
+ enum pipe_texture_target internal_target;
+ struct gen_mipmap_state *gen_mipmap;
+ struct blit_state *blit;
+
+ struct cso_context *cso_context;
+
+ int force_msaa;
+ void *winsys_drawable_handle;
+
+ /* User vertex buffers. */
+ struct {
+ struct pipe_resource *buffer;
+
+ /** Element size */
+ GLuint element_size;
+
+ /** Attribute stride */
+ GLsizei stride;
+ } user_attrib[PIPE_MAX_ATTRIBS];
+ unsigned num_user_attribs;
+};
+
+
+/* Need this so that we can implement Mesa callbacks in this module.
+ */
+static INLINE struct st_context *st_context(struct gl_context *ctx)
+{
+ return ctx->st;
+}
+
+
+/**
+ * Wrapper for struct gl_framebuffer.
+ * This is an opaque type to the outside world.
+ */
+struct st_framebuffer
+{
+ struct gl_framebuffer Base;
+ void *Private;
+
+ struct st_framebuffer_iface *iface;
+ enum st_attachment_type statts[ST_ATTACHMENT_COUNT];
+ unsigned num_statts;
+ int32_t revalidate;
+};
+
+
+extern void st_init_driver_functions(struct dd_function_table *functions);
+
+void st_invalidate_state(struct gl_context * ctx, GLuint new_state);
+
+
+
+#define Y_0_TOP 1
+#define Y_0_BOTTOM 2
+
+static INLINE GLuint
+st_fb_orientation(const struct gl_framebuffer *fb)
+{
+ if (fb && fb->Name == 0) {
+ /* Drawing into a window (on-screen buffer).
+ *
+ * Negate Y scale to flip image vertically.
+ * The NDC Y coords prior to viewport transformation are in the range
+ * [y=-1=bottom, y=1=top]
+ * Hardware window coords are in the range [y=0=top, y=H-1=bottom] where
+ * H is the window height.
+ * Use the viewport transformation to invert Y.
+ */
+ return Y_0_TOP;
+ }
+ else {
+ /* Drawing into user-created FBO (very likely a texture).
+ *
+ * For textures, T=0=Bottom, so by extension Y=0=Bottom for rendering.
+ */
+ return Y_0_BOTTOM;
+ }
+}
+
+
+/** clear-alloc a struct-sized object, with casting */
+#define ST_CALLOC_STRUCT(T) (struct T *) calloc(1, sizeof(struct T))
+
+
+extern int
+st_get_msaa(void);
+
+extern struct st_context *
+st_create_context(gl_api api, struct pipe_context *pipe,
+ const struct gl_config *visual,
+ struct st_context *share);
+
+extern void
+st_destroy_context(struct st_context *st);
+
+
+#endif
diff --git a/mesalib/src/mesa/state_tracker/st_draw.c b/mesalib/src/mesa/state_tracker/st_draw.c
index 46a4f9cf8..bf4fef57a 100644
--- a/mesalib/src/mesa/state_tracker/st_draw.c
+++ b/mesalib/src/mesa/state_tracker/st_draw.c
@@ -1,790 +1,790 @@
-/**************************************************************************
- *
- * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas.
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sub license, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice (including the
- * next paragraph) shall be included in all copies or substantial portions
- * of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
- * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
- * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- **************************************************************************/
-
-/*
- * This file implements the st_draw_vbo() function which is called from
- * Mesa's VBO module. All point/line/triangle rendering is done through
- * this function whether the user called glBegin/End, glDrawArrays,
- * glDrawElements, glEvalMesh, or glCalList, etc.
- *
- * We basically convert the VBO's vertex attribute/array information into
- * Gallium vertex state, bind the vertex buffer objects and call
- * pipe->draw_elements(), pipe->draw_range_elements() or pipe->draw_arrays().
- *
- * Authors:
- * Keith Whitwell <keith@tungstengraphics.com>
- */
-
-
-#include "main/imports.h"
-#include "main/image.h"
-#include "main/macros.h"
-#include "main/mfeatures.h"
-#include "program/prog_uniform.h"
-
-#include "vbo/vbo.h"
-
-#include "st_context.h"
-#include "st_atom.h"
-#include "st_cb_bufferobjects.h"
-#include "st_draw.h"
-#include "st_program.h"
-
-#include "pipe/p_context.h"
-#include "pipe/p_defines.h"
-#include "util/u_inlines.h"
-#include "util/u_format.h"
-#include "util/u_prim.h"
-#include "util/u_draw_quad.h"
-#include "draw/draw_context.h"
-#include "cso_cache/cso_context.h"
-
-
-static GLuint double_types[4] = {
- PIPE_FORMAT_R64_FLOAT,
- PIPE_FORMAT_R64G64_FLOAT,
- PIPE_FORMAT_R64G64B64_FLOAT,
- PIPE_FORMAT_R64G64B64A64_FLOAT
-};
-
-static GLuint float_types[4] = {
- PIPE_FORMAT_R32_FLOAT,
- PIPE_FORMAT_R32G32_FLOAT,
- PIPE_FORMAT_R32G32B32_FLOAT,
- PIPE_FORMAT_R32G32B32A32_FLOAT
-};
-
-static GLuint half_float_types[4] = {
- PIPE_FORMAT_R16_FLOAT,
- PIPE_FORMAT_R16G16_FLOAT,
- PIPE_FORMAT_R16G16B16_FLOAT,
- PIPE_FORMAT_R16G16B16A16_FLOAT
-};
-
-static GLuint uint_types_norm[4] = {
- PIPE_FORMAT_R32_UNORM,
- PIPE_FORMAT_R32G32_UNORM,
- PIPE_FORMAT_R32G32B32_UNORM,
- PIPE_FORMAT_R32G32B32A32_UNORM
-};
-
-static GLuint uint_types_scale[4] = {
- PIPE_FORMAT_R32_USCALED,
- PIPE_FORMAT_R32G32_USCALED,
- PIPE_FORMAT_R32G32B32_USCALED,
- PIPE_FORMAT_R32G32B32A32_USCALED
-};
-
-static GLuint int_types_norm[4] = {
- PIPE_FORMAT_R32_SNORM,
- PIPE_FORMAT_R32G32_SNORM,
- PIPE_FORMAT_R32G32B32_SNORM,
- PIPE_FORMAT_R32G32B32A32_SNORM
-};
-
-static GLuint int_types_scale[4] = {
- PIPE_FORMAT_R32_SSCALED,
- PIPE_FORMAT_R32G32_SSCALED,
- PIPE_FORMAT_R32G32B32_SSCALED,
- PIPE_FORMAT_R32G32B32A32_SSCALED
-};
-
-static GLuint ushort_types_norm[4] = {
- PIPE_FORMAT_R16_UNORM,
- PIPE_FORMAT_R16G16_UNORM,
- PIPE_FORMAT_R16G16B16_UNORM,
- PIPE_FORMAT_R16G16B16A16_UNORM
-};
-
-static GLuint ushort_types_scale[4] = {
- PIPE_FORMAT_R16_USCALED,
- PIPE_FORMAT_R16G16_USCALED,
- PIPE_FORMAT_R16G16B16_USCALED,
- PIPE_FORMAT_R16G16B16A16_USCALED
-};
-
-static GLuint short_types_norm[4] = {
- PIPE_FORMAT_R16_SNORM,
- PIPE_FORMAT_R16G16_SNORM,
- PIPE_FORMAT_R16G16B16_SNORM,
- PIPE_FORMAT_R16G16B16A16_SNORM
-};
-
-static GLuint short_types_scale[4] = {
- PIPE_FORMAT_R16_SSCALED,
- PIPE_FORMAT_R16G16_SSCALED,
- PIPE_FORMAT_R16G16B16_SSCALED,
- PIPE_FORMAT_R16G16B16A16_SSCALED
-};
-
-static GLuint ubyte_types_norm[4] = {
- PIPE_FORMAT_R8_UNORM,
- PIPE_FORMAT_R8G8_UNORM,
- PIPE_FORMAT_R8G8B8_UNORM,
- PIPE_FORMAT_R8G8B8A8_UNORM
-};
-
-static GLuint ubyte_types_scale[4] = {
- PIPE_FORMAT_R8_USCALED,
- PIPE_FORMAT_R8G8_USCALED,
- PIPE_FORMAT_R8G8B8_USCALED,
- PIPE_FORMAT_R8G8B8A8_USCALED
-};
-
-static GLuint byte_types_norm[4] = {
- PIPE_FORMAT_R8_SNORM,
- PIPE_FORMAT_R8G8_SNORM,
- PIPE_FORMAT_R8G8B8_SNORM,
- PIPE_FORMAT_R8G8B8A8_SNORM
-};
-
-static GLuint byte_types_scale[4] = {
- PIPE_FORMAT_R8_SSCALED,
- PIPE_FORMAT_R8G8_SSCALED,
- PIPE_FORMAT_R8G8B8_SSCALED,
- PIPE_FORMAT_R8G8B8A8_SSCALED
-};
-
-static GLuint fixed_types[4] = {
- PIPE_FORMAT_R32_FIXED,
- PIPE_FORMAT_R32G32_FIXED,
- PIPE_FORMAT_R32G32B32_FIXED,
- PIPE_FORMAT_R32G32B32A32_FIXED
-};
-
-
-
-/**
- * Return a PIPE_FORMAT_x for the given GL datatype and size.
- */
-enum pipe_format
-st_pipe_vertex_format(GLenum type, GLuint size, GLenum format,
- GLboolean normalized)
-{
- assert((type >= GL_BYTE && type <= GL_DOUBLE) ||
- type == GL_FIXED || type == GL_HALF_FLOAT);
- assert(size >= 1);
- assert(size <= 4);
- assert(format == GL_RGBA || format == GL_BGRA);
-
- if (format == GL_BGRA) {
- /* this is an odd-ball case */
- assert(type == GL_UNSIGNED_BYTE);
- assert(normalized);
- return PIPE_FORMAT_B8G8R8A8_UNORM;
- }
-
- if (normalized) {
- switch (type) {
- case GL_DOUBLE: return double_types[size-1];
- case GL_FLOAT: return float_types[size-1];
- case GL_HALF_FLOAT: return half_float_types[size-1];
- case GL_INT: return int_types_norm[size-1];
- case GL_SHORT: return short_types_norm[size-1];
- case GL_BYTE: return byte_types_norm[size-1];
- case GL_UNSIGNED_INT: return uint_types_norm[size-1];
- case GL_UNSIGNED_SHORT: return ushort_types_norm[size-1];
- case GL_UNSIGNED_BYTE: return ubyte_types_norm[size-1];
- case GL_FIXED: return fixed_types[size-1];
- default: assert(0); return 0;
- }
- }
- else {
- switch (type) {
- case GL_DOUBLE: return double_types[size-1];
- case GL_FLOAT: return float_types[size-1];
- case GL_HALF_FLOAT: return half_float_types[size-1];
- case GL_INT: return int_types_scale[size-1];
- case GL_SHORT: return short_types_scale[size-1];
- case GL_BYTE: return byte_types_scale[size-1];
- case GL_UNSIGNED_INT: return uint_types_scale[size-1];
- case GL_UNSIGNED_SHORT: return ushort_types_scale[size-1];
- case GL_UNSIGNED_BYTE: return ubyte_types_scale[size-1];
- case GL_FIXED: return fixed_types[size-1];
- default: assert(0); return 0;
- }
- }
- return PIPE_FORMAT_NONE; /* silence compiler warning */
-}
-
-
-
-/**
- * Examine the active arrays to determine if we have interleaved
- * vertex arrays all living in one VBO, or all living in user space.
- * \param userSpace returns whether the arrays are in user space.
- */
-static GLboolean
-is_interleaved_arrays(const struct st_vertex_program *vp,
- const struct st_vp_variant *vpv,
- const struct gl_client_array **arrays)
-{
- GLuint attr;
- const struct gl_buffer_object *firstBufObj = NULL;
- GLint firstStride = -1;
- const GLubyte *client_addr = NULL;
- GLboolean user_memory = GL_FALSE;
-
- for (attr = 0; attr < vpv->num_inputs; attr++) {
- const GLuint mesaAttr = vp->index_to_input[attr];
- const struct gl_client_array *array = arrays[mesaAttr];
- const struct gl_buffer_object *bufObj = array->BufferObj;
- const GLsizei stride = array->StrideB; /* in bytes */
-
- if (firstStride < 0) {
- firstStride = stride;
- user_memory = !bufObj || !bufObj->Name;
- }
- else if (firstStride != stride) {
- return GL_FALSE;
- }
-
- if (!bufObj || !bufObj->Name) {
- /* Try to detect if the client-space arrays are
- * "close" to each other.
- */
- if (!user_memory) {
- return GL_FALSE;
- }
- if (!client_addr) {
- client_addr = array->Ptr;
- }
- else if (abs(array->Ptr - client_addr) > firstStride) {
- /* arrays start too far apart */
- return GL_FALSE;
- }
- }
- else if (!firstBufObj) {
- if (user_memory) {
- return GL_FALSE;
- }
- firstBufObj = bufObj;
- }
- else if (bufObj != firstBufObj) {
- return GL_FALSE;
- }
- }
-
- return GL_TRUE;
-}
-
-
-/**
- * Set up for drawing interleaved arrays that all live in one VBO
- * or all live in user space.
- * \param vbuffer returns vertex buffer info
- * \param velements returns vertex element info
- */
-static void
-setup_interleaved_attribs(struct gl_context *ctx,
- const struct st_vertex_program *vp,
- const struct st_vp_variant *vpv,
- const struct gl_client_array **arrays,
- struct pipe_vertex_buffer *vbuffer,
- struct pipe_vertex_element velements[],
- unsigned max_index,
- unsigned num_instances)
-{
- struct st_context *st = st_context(ctx);
- struct pipe_context *pipe = st->pipe;
- GLuint attr;
- const GLubyte *low_addr = NULL;
-
- /* Find the lowest address of the arrays we're drawing */
- if (vpv->num_inputs) {
- low_addr = arrays[vp->index_to_input[0]]->Ptr;
-
- for (attr = 1; attr < vpv->num_inputs; attr++) {
- const GLubyte *start = arrays[vp->index_to_input[attr]]->Ptr;
- low_addr = MIN2(low_addr, start);
- }
- }
-
- for (attr = 0; attr < vpv->num_inputs; attr++) {
- const GLuint mesaAttr = vp->index_to_input[attr];
- const struct gl_client_array *array = arrays[mesaAttr];
- struct gl_buffer_object *bufobj = array->BufferObj;
- struct st_buffer_object *stobj = st_buffer_object(bufobj);
- unsigned src_offset = (unsigned) (array->Ptr - low_addr);
- GLuint element_size = array->_ElementSize;
- GLsizei stride = array->StrideB;
-
- assert(element_size == array->Size * _mesa_sizeof_type(array->Type));
-
- if (attr == 0) {
- if (bufobj && bufobj->Name) {
- vbuffer->buffer = NULL;
- pipe_resource_reference(&vbuffer->buffer, stobj->buffer);
- vbuffer->buffer_offset = pointer_to_offset(low_addr);
- }
- else {
- uint divisor = array->InstanceDivisor;
- uint last_index = divisor ? num_instances / divisor : max_index;
- uint bytes = src_offset + stride * last_index + element_size;
-
- vbuffer->buffer = pipe_user_buffer_create(pipe->screen,
- (void*) low_addr,
- bytes,
- PIPE_BIND_VERTEX_BUFFER);
- vbuffer->buffer_offset = 0;
-
- /* Track user vertex buffers. */
- pipe_resource_reference(&st->user_attrib[0].buffer, vbuffer->buffer);
- st->user_attrib[0].element_size = element_size;
- st->user_attrib[0].stride = stride;
- st->num_user_attribs = 1;
- }
- vbuffer->stride = stride; /* in bytes */
- }
-
- velements[attr].src_offset = src_offset;
- velements[attr].instance_divisor = array->InstanceDivisor;
- velements[attr].vertex_buffer_index = 0;
- velements[attr].src_format = st_pipe_vertex_format(array->Type,
- array->Size,
- array->Format,
- array->Normalized);
- assert(velements[attr].src_format);
- }
-}
-
-
-/**
- * Set up a separate pipe_vertex_buffer and pipe_vertex_element for each
- * vertex attribute.
- * \param vbuffer returns vertex buffer info
- * \param velements returns vertex element info
- */
-static void
-setup_non_interleaved_attribs(struct gl_context *ctx,
- const struct st_vertex_program *vp,
- const struct st_vp_variant *vpv,
- const struct gl_client_array **arrays,
- struct pipe_vertex_buffer vbuffer[],
- struct pipe_vertex_element velements[],
- unsigned max_index,
- unsigned num_instances)
-{
- struct st_context *st = st_context(ctx);
- struct pipe_context *pipe = st->pipe;
- GLuint attr;
-
- for (attr = 0; attr < vpv->num_inputs; attr++) {
- const GLuint mesaAttr = vp->index_to_input[attr];
- const struct gl_client_array *array = arrays[mesaAttr];
- struct gl_buffer_object *bufobj = array->BufferObj;
- GLuint element_size = array->_ElementSize;
- GLsizei stride = array->StrideB;
-
- assert(element_size == array->Size * _mesa_sizeof_type(array->Type));
-
- if (bufobj && bufobj->Name) {
- /* Attribute data is in a VBO.
- * Recall that for VBOs, the gl_client_array->Ptr field is
- * really an offset from the start of the VBO, not a pointer.
- */
- struct st_buffer_object *stobj = st_buffer_object(bufobj);
- assert(stobj->buffer);
-
- vbuffer[attr].buffer = NULL;
- pipe_resource_reference(&vbuffer[attr].buffer, stobj->buffer);
- vbuffer[attr].buffer_offset = pointer_to_offset(array->Ptr);
- }
- else {
- /* wrap user data */
- uint bytes;
- void *ptr;
-
- if (array->Ptr) {
- uint divisor = array->InstanceDivisor;
- uint last_index = divisor ? num_instances / divisor : max_index;
-
- bytes = stride * last_index + element_size;
-
- ptr = (void *) array->Ptr;
- }
- else {
- /* no array, use ctx->Current.Attrib[] value */
- bytes = element_size = sizeof(ctx->Current.Attrib[0]);
- ptr = (void *) ctx->Current.Attrib[mesaAttr];
- stride = 0;
- }
-
- assert(ptr);
- assert(bytes);
-
- vbuffer[attr].buffer =
- pipe_user_buffer_create(pipe->screen, ptr, bytes,
- PIPE_BIND_VERTEX_BUFFER);
-
- vbuffer[attr].buffer_offset = 0;
-
- /* Track user vertex buffers. */
- pipe_resource_reference(&st->user_attrib[attr].buffer, vbuffer[attr].buffer);
- st->user_attrib[attr].element_size = element_size;
- st->user_attrib[attr].stride = stride;
- st->num_user_attribs = MAX2(st->num_user_attribs, attr + 1);
- }
-
- /* common-case setup */
- vbuffer[attr].stride = stride; /* in bytes */
-
- velements[attr].src_offset = 0;
- velements[attr].instance_divisor = array->InstanceDivisor;
- velements[attr].vertex_buffer_index = attr;
- velements[attr].src_format = st_pipe_vertex_format(array->Type,
- array->Size,
- array->Format,
- array->Normalized);
- assert(velements[attr].src_format);
- }
-}
-
-
-static void
-setup_index_buffer(struct gl_context *ctx,
- const struct _mesa_index_buffer *ib,
- struct pipe_index_buffer *ibuffer)
-{
- struct st_context *st = st_context(ctx);
- struct pipe_context *pipe = st->pipe;
-
- memset(ibuffer, 0, sizeof(*ibuffer));
- if (ib) {
- struct gl_buffer_object *bufobj = ib->obj;
-
- switch (ib->type) {
- case GL_UNSIGNED_INT:
- ibuffer->index_size = 4;
- break;
- case GL_UNSIGNED_SHORT:
- ibuffer->index_size = 2;
- break;
- case GL_UNSIGNED_BYTE:
- ibuffer->index_size = 1;
- break;
- default:
- assert(0);
- return;
- }
-
- /* get/create the index buffer object */
- if (bufobj && bufobj->Name) {
- /* elements/indexes are in a real VBO */
- struct st_buffer_object *stobj = st_buffer_object(bufobj);
- pipe_resource_reference(&ibuffer->buffer, stobj->buffer);
- ibuffer->offset = pointer_to_offset(ib->ptr);
- }
- else {
- /* element/indicies are in user space memory */
- ibuffer->buffer =
- pipe_user_buffer_create(pipe->screen, (void *) ib->ptr,
- ib->count * ibuffer->index_size,
- PIPE_BIND_INDEX_BUFFER);
- }
- }
-}
-
-/**
- * Prior to drawing, check that any uniforms referenced by the
- * current shader have been set. If a uniform has not been set,
- * issue a warning.
- */
-static void
-check_uniforms(struct gl_context *ctx)
-{
- struct gl_shader_program *shProg[3] = {
- ctx->Shader.CurrentVertexProgram,
- ctx->Shader.CurrentGeometryProgram,
- ctx->Shader.CurrentFragmentProgram,
- };
- unsigned j;
-
- for (j = 0; j < 3; j++) {
- unsigned i;
-
- if (shProg[j] == NULL || !shProg[j]->LinkStatus)
- continue;
-
- for (i = 0; i < shProg[j]->Uniforms->NumUniforms; i++) {
- const struct gl_uniform *u = &shProg[j]->Uniforms->Uniforms[i];
- if (!u->Initialized) {
- _mesa_warning(ctx,
- "Using shader with uninitialized uniform: %s",
- u->Name);
- }
- }
- }
-}
-
-
-/**
- * Translate OpenGL primtive type (GL_POINTS, GL_TRIANGLE_STRIP, etc) to
- * the corresponding Gallium type.
- */
-static unsigned
-translate_prim(const struct gl_context *ctx, unsigned prim)
-{
- /* GL prims should match Gallium prims, spot-check a few */
- assert(GL_POINTS == PIPE_PRIM_POINTS);
- assert(GL_QUADS == PIPE_PRIM_QUADS);
- assert(GL_TRIANGLE_STRIP_ADJACENCY == PIPE_PRIM_TRIANGLE_STRIP_ADJACENCY);
-
- /* Avoid quadstrips if it's easy to do so:
- * Note: it's imporant to do the correct trimming if we change the prim type!
- * We do that wherever this function is called.
- */
- if (prim == GL_QUAD_STRIP &&
- ctx->Light.ShadeModel != GL_FLAT &&
- ctx->Polygon.FrontMode == GL_FILL &&
- ctx->Polygon.BackMode == GL_FILL)
- prim = GL_TRIANGLE_STRIP;
-
- return prim;
-}
-
-
-static void
-st_validate_varrays(struct gl_context *ctx,
- const struct gl_client_array **arrays,
- unsigned max_index,
- unsigned num_instances)
-{
- struct st_context *st = st_context(ctx);
- const struct st_vertex_program *vp;
- const struct st_vp_variant *vpv;
- struct pipe_vertex_buffer vbuffer[PIPE_MAX_SHADER_INPUTS];
- struct pipe_vertex_element velements[PIPE_MAX_ATTRIBS];
- unsigned num_vbuffers, num_velements;
- GLuint attr;
- unsigned i;
-
- /* must get these after state validation! */
- vp = st->vp;
- vpv = st->vp_variant;
-
- memset(velements, 0, sizeof(struct pipe_vertex_element) * vpv->num_inputs);
-
- /* Unreference any user vertex buffers. */
- for (i = 0; i < st->num_user_attribs; i++) {
- pipe_resource_reference(&st->user_attrib[i].buffer, NULL);
- }
- st->num_user_attribs = 0;
-
- /*
- * Setup the vbuffer[] and velements[] arrays.
- */
- if (is_interleaved_arrays(vp, vpv, arrays)) {
- setup_interleaved_attribs(ctx, vp, vpv, arrays, vbuffer, velements,
- max_index, num_instances);
-
- num_vbuffers = 1;
- num_velements = vpv->num_inputs;
- if (num_velements == 0)
- num_vbuffers = 0;
- }
- else {
- setup_non_interleaved_attribs(ctx, vp, vpv, arrays,
- vbuffer, velements, max_index,
- num_instances);
- num_vbuffers = vpv->num_inputs;
- num_velements = vpv->num_inputs;
- }
-
- cso_set_vertex_buffers(st->cso_context, num_vbuffers, vbuffer);
- cso_set_vertex_elements(st->cso_context, num_velements, velements);
-
- /* unreference buffers (frees wrapped user-space buffer objects)
- * This is OK, because the pipe driver should reference buffers by itself
- * in set_vertex_buffers. */
- for (attr = 0; attr < num_vbuffers; attr++) {
- pipe_resource_reference(&vbuffer[attr].buffer, NULL);
- assert(!vbuffer[attr].buffer);
- }
-}
-
-
-/**
- * This function gets plugged into the VBO module and is called when
- * we have something to render.
- * Basically, translate the information into the format expected by gallium.
- */
-void
-st_draw_vbo(struct gl_context *ctx,
- const struct gl_client_array **arrays,
- const struct _mesa_prim *prims,
- GLuint nr_prims,
- const struct _mesa_index_buffer *ib,
- GLboolean index_bounds_valid,
- GLuint min_index,
- GLuint max_index)
-{
- struct st_context *st = st_context(ctx);
- struct pipe_context *pipe = st->pipe;
- struct pipe_index_buffer ibuffer;
- struct pipe_draw_info info;
- unsigned i, num_instances = 1;
- GLboolean new_array =
- st->dirty.st && (st->dirty.mesa & (_NEW_ARRAY | _NEW_PROGRAM)) != 0;
-
- /* Mesa core state should have been validated already */
- assert(ctx->NewState == 0x0);
-
- if (ib) {
- /* Gallium probably doesn't want this in some cases. */
- if (!index_bounds_valid)
- if (!vbo_all_varyings_in_vbos(arrays))
- vbo_get_minmax_index(ctx, prims, ib, &min_index, &max_index);
-
- for (i = 0; i < nr_prims; i++) {
- num_instances = MAX2(num_instances, prims[i].num_instances);
- }
- }
- else {
- /* Get min/max index for non-indexed drawing. */
- min_index = ~0;
- max_index = 0;
-
- for (i = 0; i < nr_prims; i++) {
- min_index = MIN2(min_index, prims[i].start);
- max_index = MAX2(max_index, prims[i].start + prims[i].count - 1);
- num_instances = MAX2(num_instances, prims[i].num_instances);
- }
- }
-
- /* Validate state. */
- if (st->dirty.st) {
- GLboolean vertDataEdgeFlags;
-
- /* sanity check for pointer arithmetic below */
- assert(sizeof(arrays[0]->Ptr[0]) == 1);
-
- vertDataEdgeFlags = arrays[VERT_ATTRIB_EDGEFLAG]->BufferObj &&
- arrays[VERT_ATTRIB_EDGEFLAG]->BufferObj->Name;
- if (vertDataEdgeFlags != st->vertdata_edgeflags) {
- st->vertdata_edgeflags = vertDataEdgeFlags;
- st->dirty.st |= ST_NEW_EDGEFLAGS_DATA;
- }
-
- st_validate_state(st);
-
- if (new_array) {
- st_validate_varrays(ctx, arrays, max_index, num_instances);
- }
-
-#if 0
- if (MESA_VERBOSE & VERBOSE_GLSL) {
- check_uniforms(ctx);
- }
-#else
- (void) check_uniforms;
-#endif
- }
-
- /* Notify the driver that the content of user buffers may have been
- * changed. */
- assert(max_index >= min_index);
- if (!new_array && st->num_user_attribs) {
- for (i = 0; i < st->num_user_attribs; i++) {
- if (st->user_attrib[i].buffer) {
- unsigned element_size = st->user_attrib[i].element_size;
- unsigned stride = st->user_attrib[i].stride;
- unsigned min_offset = min_index * stride;
- unsigned max_offset = max_index * stride + element_size;
-
- assert(max_offset > min_offset);
-
- pipe->redefine_user_buffer(pipe, st->user_attrib[i].buffer,
- min_offset,
- max_offset - min_offset);
- }
- }
- }
-
- setup_index_buffer(ctx, ib, &ibuffer);
- pipe->set_index_buffer(pipe, &ibuffer);
-
- util_draw_init_info(&info);
- if (ib) {
- info.indexed = TRUE;
- if (min_index != ~0 && max_index != ~0) {
- info.min_index = min_index;
- info.max_index = max_index;
- }
- }
-
- info.primitive_restart = st->ctx->Array.PrimitiveRestart;
- info.restart_index = st->ctx->Array.RestartIndex;
-
- /* do actual drawing */
- for (i = 0; i < nr_prims; i++) {
- info.mode = translate_prim( ctx, prims[i].mode );
- info.start = prims[i].start;
- info.count = prims[i].count;
- info.instance_count = prims[i].num_instances;
- info.index_bias = prims[i].basevertex;
- if (!ib) {
- info.min_index = info.start;
- info.max_index = info.start + info.count - 1;
- }
-
- if (u_trim_pipe_prim(info.mode, &info.count))
- pipe->draw_vbo(pipe, &info);
- }
-
- pipe_resource_reference(&ibuffer.buffer, NULL);
-}
-
-
-void
-st_init_draw(struct st_context *st)
-{
- struct gl_context *ctx = st->ctx;
-
- vbo_set_draw_func(ctx, st_draw_vbo);
-
-#if FEATURE_feedback || FEATURE_rastpos
- st->draw = draw_create(st->pipe); /* for selection/feedback */
-
- /* Disable draw options that might convert points/lines to tris, etc.
- * as that would foul-up feedback/selection mode.
- */
- draw_wide_line_threshold(st->draw, 1000.0f);
- draw_wide_point_threshold(st->draw, 1000.0f);
- draw_enable_line_stipple(st->draw, FALSE);
- draw_enable_point_sprites(st->draw, FALSE);
-#endif
-}
-
-
-void
-st_destroy_draw(struct st_context *st)
-{
-#if FEATURE_feedback || FEATURE_rastpos
- draw_destroy(st->draw);
-#endif
-}
+/**************************************************************************
+ *
+ * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ **************************************************************************/
+
+/*
+ * This file implements the st_draw_vbo() function which is called from
+ * Mesa's VBO module. All point/line/triangle rendering is done through
+ * this function whether the user called glBegin/End, glDrawArrays,
+ * glDrawElements, glEvalMesh, or glCalList, etc.
+ *
+ * We basically convert the VBO's vertex attribute/array information into
+ * Gallium vertex state, bind the vertex buffer objects and call
+ * pipe->draw_elements(), pipe->draw_range_elements() or pipe->draw_arrays().
+ *
+ * Authors:
+ * Keith Whitwell <keith@tungstengraphics.com>
+ */
+
+
+#include "main/imports.h"
+#include "main/image.h"
+#include "main/macros.h"
+#include "main/mfeatures.h"
+#include "program/prog_uniform.h"
+
+#include "vbo/vbo.h"
+
+#include "st_context.h"
+#include "st_atom.h"
+#include "st_cb_bufferobjects.h"
+#include "st_draw.h"
+#include "st_program.h"
+
+#include "pipe/p_context.h"
+#include "pipe/p_defines.h"
+#include "util/u_inlines.h"
+#include "util/u_format.h"
+#include "util/u_prim.h"
+#include "util/u_draw_quad.h"
+#include "draw/draw_context.h"
+#include "cso_cache/cso_context.h"
+
+
+static GLuint double_types[4] = {
+ PIPE_FORMAT_R64_FLOAT,
+ PIPE_FORMAT_R64G64_FLOAT,
+ PIPE_FORMAT_R64G64B64_FLOAT,
+ PIPE_FORMAT_R64G64B64A64_FLOAT
+};
+
+static GLuint float_types[4] = {
+ PIPE_FORMAT_R32_FLOAT,
+ PIPE_FORMAT_R32G32_FLOAT,
+ PIPE_FORMAT_R32G32B32_FLOAT,
+ PIPE_FORMAT_R32G32B32A32_FLOAT
+};
+
+static GLuint half_float_types[4] = {
+ PIPE_FORMAT_R16_FLOAT,
+ PIPE_FORMAT_R16G16_FLOAT,
+ PIPE_FORMAT_R16G16B16_FLOAT,
+ PIPE_FORMAT_R16G16B16A16_FLOAT
+};
+
+static GLuint uint_types_norm[4] = {
+ PIPE_FORMAT_R32_UNORM,
+ PIPE_FORMAT_R32G32_UNORM,
+ PIPE_FORMAT_R32G32B32_UNORM,
+ PIPE_FORMAT_R32G32B32A32_UNORM
+};
+
+static GLuint uint_types_scale[4] = {
+ PIPE_FORMAT_R32_USCALED,
+ PIPE_FORMAT_R32G32_USCALED,
+ PIPE_FORMAT_R32G32B32_USCALED,
+ PIPE_FORMAT_R32G32B32A32_USCALED
+};
+
+static GLuint int_types_norm[4] = {
+ PIPE_FORMAT_R32_SNORM,
+ PIPE_FORMAT_R32G32_SNORM,
+ PIPE_FORMAT_R32G32B32_SNORM,
+ PIPE_FORMAT_R32G32B32A32_SNORM
+};
+
+static GLuint int_types_scale[4] = {
+ PIPE_FORMAT_R32_SSCALED,
+ PIPE_FORMAT_R32G32_SSCALED,
+ PIPE_FORMAT_R32G32B32_SSCALED,
+ PIPE_FORMAT_R32G32B32A32_SSCALED
+};
+
+static GLuint ushort_types_norm[4] = {
+ PIPE_FORMAT_R16_UNORM,
+ PIPE_FORMAT_R16G16_UNORM,
+ PIPE_FORMAT_R16G16B16_UNORM,
+ PIPE_FORMAT_R16G16B16A16_UNORM
+};
+
+static GLuint ushort_types_scale[4] = {
+ PIPE_FORMAT_R16_USCALED,
+ PIPE_FORMAT_R16G16_USCALED,
+ PIPE_FORMAT_R16G16B16_USCALED,
+ PIPE_FORMAT_R16G16B16A16_USCALED
+};
+
+static GLuint short_types_norm[4] = {
+ PIPE_FORMAT_R16_SNORM,
+ PIPE_FORMAT_R16G16_SNORM,
+ PIPE_FORMAT_R16G16B16_SNORM,
+ PIPE_FORMAT_R16G16B16A16_SNORM
+};
+
+static GLuint short_types_scale[4] = {
+ PIPE_FORMAT_R16_SSCALED,
+ PIPE_FORMAT_R16G16_SSCALED,
+ PIPE_FORMAT_R16G16B16_SSCALED,
+ PIPE_FORMAT_R16G16B16A16_SSCALED
+};
+
+static GLuint ubyte_types_norm[4] = {
+ PIPE_FORMAT_R8_UNORM,
+ PIPE_FORMAT_R8G8_UNORM,
+ PIPE_FORMAT_R8G8B8_UNORM,
+ PIPE_FORMAT_R8G8B8A8_UNORM
+};
+
+static GLuint ubyte_types_scale[4] = {
+ PIPE_FORMAT_R8_USCALED,
+ PIPE_FORMAT_R8G8_USCALED,
+ PIPE_FORMAT_R8G8B8_USCALED,
+ PIPE_FORMAT_R8G8B8A8_USCALED
+};
+
+static GLuint byte_types_norm[4] = {
+ PIPE_FORMAT_R8_SNORM,
+ PIPE_FORMAT_R8G8_SNORM,
+ PIPE_FORMAT_R8G8B8_SNORM,
+ PIPE_FORMAT_R8G8B8A8_SNORM
+};
+
+static GLuint byte_types_scale[4] = {
+ PIPE_FORMAT_R8_SSCALED,
+ PIPE_FORMAT_R8G8_SSCALED,
+ PIPE_FORMAT_R8G8B8_SSCALED,
+ PIPE_FORMAT_R8G8B8A8_SSCALED
+};
+
+static GLuint fixed_types[4] = {
+ PIPE_FORMAT_R32_FIXED,
+ PIPE_FORMAT_R32G32_FIXED,
+ PIPE_FORMAT_R32G32B32_FIXED,
+ PIPE_FORMAT_R32G32B32A32_FIXED
+};
+
+
+
+/**
+ * Return a PIPE_FORMAT_x for the given GL datatype and size.
+ */
+enum pipe_format
+st_pipe_vertex_format(GLenum type, GLuint size, GLenum format,
+ GLboolean normalized)
+{
+ assert((type >= GL_BYTE && type <= GL_DOUBLE) ||
+ type == GL_FIXED || type == GL_HALF_FLOAT);
+ assert(size >= 1);
+ assert(size <= 4);
+ assert(format == GL_RGBA || format == GL_BGRA);
+
+ if (format == GL_BGRA) {
+ /* this is an odd-ball case */
+ assert(type == GL_UNSIGNED_BYTE);
+ assert(normalized);
+ return PIPE_FORMAT_B8G8R8A8_UNORM;
+ }
+
+ if (normalized) {
+ switch (type) {
+ case GL_DOUBLE: return double_types[size-1];
+ case GL_FLOAT: return float_types[size-1];
+ case GL_HALF_FLOAT: return half_float_types[size-1];
+ case GL_INT: return int_types_norm[size-1];
+ case GL_SHORT: return short_types_norm[size-1];
+ case GL_BYTE: return byte_types_norm[size-1];
+ case GL_UNSIGNED_INT: return uint_types_norm[size-1];
+ case GL_UNSIGNED_SHORT: return ushort_types_norm[size-1];
+ case GL_UNSIGNED_BYTE: return ubyte_types_norm[size-1];
+ case GL_FIXED: return fixed_types[size-1];
+ default: assert(0); return 0;
+ }
+ }
+ else {
+ switch (type) {
+ case GL_DOUBLE: return double_types[size-1];
+ case GL_FLOAT: return float_types[size-1];
+ case GL_HALF_FLOAT: return half_float_types[size-1];
+ case GL_INT: return int_types_scale[size-1];
+ case GL_SHORT: return short_types_scale[size-1];
+ case GL_BYTE: return byte_types_scale[size-1];
+ case GL_UNSIGNED_INT: return uint_types_scale[size-1];
+ case GL_UNSIGNED_SHORT: return ushort_types_scale[size-1];
+ case GL_UNSIGNED_BYTE: return ubyte_types_scale[size-1];
+ case GL_FIXED: return fixed_types[size-1];
+ default: assert(0); return 0;
+ }
+ }
+ return PIPE_FORMAT_NONE; /* silence compiler warning */
+}
+
+
+
+/**
+ * Examine the active arrays to determine if we have interleaved
+ * vertex arrays all living in one VBO, or all living in user space.
+ * \param userSpace returns whether the arrays are in user space.
+ */
+static GLboolean
+is_interleaved_arrays(const struct st_vertex_program *vp,
+ const struct st_vp_variant *vpv,
+ const struct gl_client_array **arrays)
+{
+ GLuint attr;
+ const struct gl_buffer_object *firstBufObj = NULL;
+ GLint firstStride = -1;
+ const GLubyte *client_addr = NULL;
+ GLboolean user_memory = GL_FALSE;
+
+ for (attr = 0; attr < vpv->num_inputs; attr++) {
+ const GLuint mesaAttr = vp->index_to_input[attr];
+ const struct gl_client_array *array = arrays[mesaAttr];
+ const struct gl_buffer_object *bufObj = array->BufferObj;
+ const GLsizei stride = array->StrideB; /* in bytes */
+
+ if (firstStride < 0) {
+ firstStride = stride;
+ user_memory = !bufObj || !bufObj->Name;
+ }
+ else if (firstStride != stride) {
+ return GL_FALSE;
+ }
+
+ if (!bufObj || !bufObj->Name) {
+ /* Try to detect if the client-space arrays are
+ * "close" to each other.
+ */
+ if (!user_memory) {
+ return GL_FALSE;
+ }
+ if (!client_addr) {
+ client_addr = array->Ptr;
+ }
+ else if (abs(array->Ptr - client_addr) > firstStride) {
+ /* arrays start too far apart */
+ return GL_FALSE;
+ }
+ }
+ else if (!firstBufObj) {
+ if (user_memory) {
+ return GL_FALSE;
+ }
+ firstBufObj = bufObj;
+ }
+ else if (bufObj != firstBufObj) {
+ return GL_FALSE;
+ }
+ }
+
+ return GL_TRUE;
+}
+
+
+/**
+ * Set up for drawing interleaved arrays that all live in one VBO
+ * or all live in user space.
+ * \param vbuffer returns vertex buffer info
+ * \param velements returns vertex element info
+ */
+static void
+setup_interleaved_attribs(struct gl_context *ctx,
+ const struct st_vertex_program *vp,
+ const struct st_vp_variant *vpv,
+ const struct gl_client_array **arrays,
+ struct pipe_vertex_buffer *vbuffer,
+ struct pipe_vertex_element velements[],
+ unsigned max_index,
+ unsigned num_instances)
+{
+ struct st_context *st = st_context(ctx);
+ struct pipe_context *pipe = st->pipe;
+ GLuint attr;
+ const GLubyte *low_addr = NULL;
+
+ /* Find the lowest address of the arrays we're drawing */
+ if (vpv->num_inputs) {
+ low_addr = arrays[vp->index_to_input[0]]->Ptr;
+
+ for (attr = 1; attr < vpv->num_inputs; attr++) {
+ const GLubyte *start = arrays[vp->index_to_input[attr]]->Ptr;
+ low_addr = MIN2(low_addr, start);
+ }
+ }
+
+ for (attr = 0; attr < vpv->num_inputs; attr++) {
+ const GLuint mesaAttr = vp->index_to_input[attr];
+ const struct gl_client_array *array = arrays[mesaAttr];
+ struct gl_buffer_object *bufobj = array->BufferObj;
+ struct st_buffer_object *stobj = st_buffer_object(bufobj);
+ unsigned src_offset = (unsigned) (array->Ptr - low_addr);
+ GLuint element_size = array->_ElementSize;
+ GLsizei stride = array->StrideB;
+
+ assert(element_size == array->Size * _mesa_sizeof_type(array->Type));
+
+ if (attr == 0) {
+ if (bufobj && bufobj->Name) {
+ vbuffer->buffer = NULL;
+ pipe_resource_reference(&vbuffer->buffer, stobj->buffer);
+ vbuffer->buffer_offset = pointer_to_offset(low_addr);
+ }
+ else {
+ uint divisor = array->InstanceDivisor;
+ uint last_index = divisor ? num_instances / divisor : max_index;
+ uint bytes = src_offset + stride * last_index + element_size;
+
+ vbuffer->buffer = pipe_user_buffer_create(pipe->screen,
+ (void*) low_addr,
+ bytes,
+ PIPE_BIND_VERTEX_BUFFER);
+ vbuffer->buffer_offset = 0;
+
+ /* Track user vertex buffers. */
+ pipe_resource_reference(&st->user_attrib[0].buffer, vbuffer->buffer);
+ st->user_attrib[0].element_size = element_size;
+ st->user_attrib[0].stride = stride;
+ st->num_user_attribs = 1;
+ }
+ vbuffer->stride = stride; /* in bytes */
+ }
+
+ velements[attr].src_offset = src_offset;
+ velements[attr].instance_divisor = array->InstanceDivisor;
+ velements[attr].vertex_buffer_index = 0;
+ velements[attr].src_format = st_pipe_vertex_format(array->Type,
+ array->Size,
+ array->Format,
+ array->Normalized);
+ assert(velements[attr].src_format);
+ }
+}
+
+
+/**
+ * Set up a separate pipe_vertex_buffer and pipe_vertex_element for each
+ * vertex attribute.
+ * \param vbuffer returns vertex buffer info
+ * \param velements returns vertex element info
+ */
+static void
+setup_non_interleaved_attribs(struct gl_context *ctx,
+ const struct st_vertex_program *vp,
+ const struct st_vp_variant *vpv,
+ const struct gl_client_array **arrays,
+ struct pipe_vertex_buffer vbuffer[],
+ struct pipe_vertex_element velements[],
+ unsigned max_index,
+ unsigned num_instances)
+{
+ struct st_context *st = st_context(ctx);
+ struct pipe_context *pipe = st->pipe;
+ GLuint attr;
+
+ for (attr = 0; attr < vpv->num_inputs; attr++) {
+ const GLuint mesaAttr = vp->index_to_input[attr];
+ const struct gl_client_array *array = arrays[mesaAttr];
+ struct gl_buffer_object *bufobj = array->BufferObj;
+ GLuint element_size = array->_ElementSize;
+ GLsizei stride = array->StrideB;
+
+ assert(element_size == array->Size * _mesa_sizeof_type(array->Type));
+
+ if (bufobj && bufobj->Name) {
+ /* Attribute data is in a VBO.
+ * Recall that for VBOs, the gl_client_array->Ptr field is
+ * really an offset from the start of the VBO, not a pointer.
+ */
+ struct st_buffer_object *stobj = st_buffer_object(bufobj);
+ assert(stobj->buffer);
+
+ vbuffer[attr].buffer = NULL;
+ pipe_resource_reference(&vbuffer[attr].buffer, stobj->buffer);
+ vbuffer[attr].buffer_offset = pointer_to_offset(array->Ptr);
+ }
+ else {
+ /* wrap user data */
+ uint bytes;
+ void *ptr;
+
+ if (array->Ptr) {
+ uint divisor = array->InstanceDivisor;
+ uint last_index = divisor ? num_instances / divisor : max_index;
+
+ bytes = stride * last_index + element_size;
+
+ ptr = (void *) array->Ptr;
+ }
+ else {
+ /* no array, use ctx->Current.Attrib[] value */
+ bytes = element_size = sizeof(ctx->Current.Attrib[0]);
+ ptr = (void *) ctx->Current.Attrib[mesaAttr];
+ stride = 0;
+ }
+
+ assert(ptr);
+ assert(bytes);
+
+ vbuffer[attr].buffer =
+ pipe_user_buffer_create(pipe->screen, ptr, bytes,
+ PIPE_BIND_VERTEX_BUFFER);
+
+ vbuffer[attr].buffer_offset = 0;
+
+ /* Track user vertex buffers. */
+ pipe_resource_reference(&st->user_attrib[attr].buffer, vbuffer[attr].buffer);
+ st->user_attrib[attr].element_size = element_size;
+ st->user_attrib[attr].stride = stride;
+ st->num_user_attribs = MAX2(st->num_user_attribs, attr + 1);
+ }
+
+ /* common-case setup */
+ vbuffer[attr].stride = stride; /* in bytes */
+
+ velements[attr].src_offset = 0;
+ velements[attr].instance_divisor = array->InstanceDivisor;
+ velements[attr].vertex_buffer_index = attr;
+ velements[attr].src_format = st_pipe_vertex_format(array->Type,
+ array->Size,
+ array->Format,
+ array->Normalized);
+ assert(velements[attr].src_format);
+ }
+}
+
+
+static void
+setup_index_buffer(struct gl_context *ctx,
+ const struct _mesa_index_buffer *ib,
+ struct pipe_index_buffer *ibuffer)
+{
+ struct st_context *st = st_context(ctx);
+ struct pipe_context *pipe = st->pipe;
+
+ memset(ibuffer, 0, sizeof(*ibuffer));
+ if (ib) {
+ struct gl_buffer_object *bufobj = ib->obj;
+
+ switch (ib->type) {
+ case GL_UNSIGNED_INT:
+ ibuffer->index_size = 4;
+ break;
+ case GL_UNSIGNED_SHORT:
+ ibuffer->index_size = 2;
+ break;
+ case GL_UNSIGNED_BYTE:
+ ibuffer->index_size = 1;
+ break;
+ default:
+ assert(0);
+ return;
+ }
+
+ /* get/create the index buffer object */
+ if (bufobj && bufobj->Name) {
+ /* elements/indexes are in a real VBO */
+ struct st_buffer_object *stobj = st_buffer_object(bufobj);
+ pipe_resource_reference(&ibuffer->buffer, stobj->buffer);
+ ibuffer->offset = pointer_to_offset(ib->ptr);
+ }
+ else {
+ /* element/indicies are in user space memory */
+ ibuffer->buffer =
+ pipe_user_buffer_create(pipe->screen, (void *) ib->ptr,
+ ib->count * ibuffer->index_size,
+ PIPE_BIND_INDEX_BUFFER);
+ }
+ }
+}
+
+/**
+ * Prior to drawing, check that any uniforms referenced by the
+ * current shader have been set. If a uniform has not been set,
+ * issue a warning.
+ */
+static void
+check_uniforms(struct gl_context *ctx)
+{
+ struct gl_shader_program *shProg[3] = {
+ ctx->Shader.CurrentVertexProgram,
+ ctx->Shader.CurrentGeometryProgram,
+ ctx->Shader.CurrentFragmentProgram,
+ };
+ unsigned j;
+
+ for (j = 0; j < 3; j++) {
+ unsigned i;
+
+ if (shProg[j] == NULL || !shProg[j]->LinkStatus)
+ continue;
+
+ for (i = 0; i < shProg[j]->Uniforms->NumUniforms; i++) {
+ const struct gl_uniform *u = &shProg[j]->Uniforms->Uniforms[i];
+ if (!u->Initialized) {
+ _mesa_warning(ctx,
+ "Using shader with uninitialized uniform: %s",
+ u->Name);
+ }
+ }
+ }
+}
+
+
+/**
+ * Translate OpenGL primtive type (GL_POINTS, GL_TRIANGLE_STRIP, etc) to
+ * the corresponding Gallium type.
+ */
+static unsigned
+translate_prim(const struct gl_context *ctx, unsigned prim)
+{
+ /* GL prims should match Gallium prims, spot-check a few */
+ assert(GL_POINTS == PIPE_PRIM_POINTS);
+ assert(GL_QUADS == PIPE_PRIM_QUADS);
+ assert(GL_TRIANGLE_STRIP_ADJACENCY == PIPE_PRIM_TRIANGLE_STRIP_ADJACENCY);
+
+ /* Avoid quadstrips if it's easy to do so:
+ * Note: it's imporant to do the correct trimming if we change the prim type!
+ * We do that wherever this function is called.
+ */
+ if (prim == GL_QUAD_STRIP &&
+ ctx->Light.ShadeModel != GL_FLAT &&
+ ctx->Polygon.FrontMode == GL_FILL &&
+ ctx->Polygon.BackMode == GL_FILL)
+ prim = GL_TRIANGLE_STRIP;
+
+ return prim;
+}
+
+
+static void
+st_validate_varrays(struct gl_context *ctx,
+ const struct gl_client_array **arrays,
+ unsigned max_index,
+ unsigned num_instances)
+{
+ struct st_context *st = st_context(ctx);
+ const struct st_vertex_program *vp;
+ const struct st_vp_variant *vpv;
+ struct pipe_vertex_buffer vbuffer[PIPE_MAX_SHADER_INPUTS];
+ struct pipe_vertex_element velements[PIPE_MAX_ATTRIBS];
+ unsigned num_vbuffers, num_velements;
+ GLuint attr;
+ unsigned i;
+
+ /* must get these after state validation! */
+ vp = st->vp;
+ vpv = st->vp_variant;
+
+ memset(velements, 0, sizeof(struct pipe_vertex_element) * vpv->num_inputs);
+
+ /* Unreference any user vertex buffers. */
+ for (i = 0; i < st->num_user_attribs; i++) {
+ pipe_resource_reference(&st->user_attrib[i].buffer, NULL);
+ }
+ st->num_user_attribs = 0;
+
+ /*
+ * Setup the vbuffer[] and velements[] arrays.
+ */
+ if (is_interleaved_arrays(vp, vpv, arrays)) {
+ setup_interleaved_attribs(ctx, vp, vpv, arrays, vbuffer, velements,
+ max_index, num_instances);
+
+ num_vbuffers = 1;
+ num_velements = vpv->num_inputs;
+ if (num_velements == 0)
+ num_vbuffers = 0;
+ }
+ else {
+ setup_non_interleaved_attribs(ctx, vp, vpv, arrays,
+ vbuffer, velements, max_index,
+ num_instances);
+ num_vbuffers = vpv->num_inputs;
+ num_velements = vpv->num_inputs;
+ }
+
+ cso_set_vertex_buffers(st->cso_context, num_vbuffers, vbuffer);
+ cso_set_vertex_elements(st->cso_context, num_velements, velements);
+
+ /* unreference buffers (frees wrapped user-space buffer objects)
+ * This is OK, because the pipe driver should reference buffers by itself
+ * in set_vertex_buffers. */
+ for (attr = 0; attr < num_vbuffers; attr++) {
+ pipe_resource_reference(&vbuffer[attr].buffer, NULL);
+ assert(!vbuffer[attr].buffer);
+ }
+}
+
+
+/**
+ * This function gets plugged into the VBO module and is called when
+ * we have something to render.
+ * Basically, translate the information into the format expected by gallium.
+ */
+void
+st_draw_vbo(struct gl_context *ctx,
+ const struct gl_client_array **arrays,
+ const struct _mesa_prim *prims,
+ GLuint nr_prims,
+ const struct _mesa_index_buffer *ib,
+ GLboolean index_bounds_valid,
+ GLuint min_index,
+ GLuint max_index)
+{
+ struct st_context *st = st_context(ctx);
+ struct pipe_context *pipe = st->pipe;
+ struct pipe_index_buffer ibuffer;
+ struct pipe_draw_info info;
+ unsigned i, num_instances = 1;
+ GLboolean new_array =
+ st->dirty.st && (st->dirty.mesa & (_NEW_ARRAY | _NEW_PROGRAM)) != 0;
+
+ /* Mesa core state should have been validated already */
+ assert(ctx->NewState == 0x0);
+
+ if (ib) {
+ /* Gallium probably doesn't want this in some cases. */
+ if (!index_bounds_valid)
+ if (!vbo_all_varyings_in_vbos(arrays))
+ vbo_get_minmax_index(ctx, prims, ib, &min_index, &max_index);
+
+ for (i = 0; i < nr_prims; i++) {
+ num_instances = MAX2(num_instances, prims[i].num_instances);
+ }
+ }
+ else {
+ /* Get min/max index for non-indexed drawing. */
+ min_index = ~0;
+ max_index = 0;
+
+ for (i = 0; i < nr_prims; i++) {
+ min_index = MIN2(min_index, prims[i].start);
+ max_index = MAX2(max_index, prims[i].start + prims[i].count - 1);
+ num_instances = MAX2(num_instances, prims[i].num_instances);
+ }
+ }
+
+ /* Validate state. */
+ if (st->dirty.st) {
+ GLboolean vertDataEdgeFlags;
+
+ /* sanity check for pointer arithmetic below */
+ assert(sizeof(arrays[0]->Ptr[0]) == 1);
+
+ vertDataEdgeFlags = arrays[VERT_ATTRIB_EDGEFLAG]->BufferObj &&
+ arrays[VERT_ATTRIB_EDGEFLAG]->BufferObj->Name;
+ if (vertDataEdgeFlags != st->vertdata_edgeflags) {
+ st->vertdata_edgeflags = vertDataEdgeFlags;
+ st->dirty.st |= ST_NEW_EDGEFLAGS_DATA;
+ }
+
+ st_validate_state(st);
+
+ if (new_array) {
+ st_validate_varrays(ctx, arrays, max_index, num_instances);
+ }
+
+#if 0
+ if (MESA_VERBOSE & VERBOSE_GLSL) {
+ check_uniforms(ctx);
+ }
+#else
+ (void) check_uniforms;
+#endif
+ }
+
+ /* Notify the driver that the content of user buffers may have been
+ * changed. */
+ assert(max_index >= min_index);
+ if (!new_array && st->num_user_attribs) {
+ for (i = 0; i < st->num_user_attribs; i++) {
+ if (st->user_attrib[i].buffer) {
+ unsigned element_size = st->user_attrib[i].element_size;
+ unsigned stride = st->user_attrib[i].stride;
+ unsigned min_offset = min_index * stride;
+ unsigned max_offset = max_index * stride + element_size;
+
+ assert(max_offset > min_offset);
+
+ pipe->redefine_user_buffer(pipe, st->user_attrib[i].buffer,
+ min_offset,
+ max_offset - min_offset);
+ }
+ }
+ }
+
+ setup_index_buffer(ctx, ib, &ibuffer);
+ pipe->set_index_buffer(pipe, &ibuffer);
+
+ util_draw_init_info(&info);
+ if (ib) {
+ info.indexed = TRUE;
+ if (min_index != ~0 && max_index != ~0) {
+ info.min_index = min_index;
+ info.max_index = max_index;
+ }
+ }
+
+ info.primitive_restart = st->ctx->Array.PrimitiveRestart;
+ info.restart_index = st->ctx->Array.RestartIndex;
+
+ /* do actual drawing */
+ for (i = 0; i < nr_prims; i++) {
+ info.mode = translate_prim( ctx, prims[i].mode );
+ info.start = prims[i].start;
+ info.count = prims[i].count;
+ info.instance_count = prims[i].num_instances;
+ info.index_bias = prims[i].basevertex;
+ if (!ib) {
+ info.min_index = info.start;
+ info.max_index = info.start + info.count - 1;
+ }
+
+ if (u_trim_pipe_prim(info.mode, &info.count))
+ pipe->draw_vbo(pipe, &info);
+ }
+
+ pipe_resource_reference(&ibuffer.buffer, NULL);
+}
+
+
+void
+st_init_draw(struct st_context *st)
+{
+ struct gl_context *ctx = st->ctx;
+
+ vbo_set_draw_func(ctx, st_draw_vbo);
+
+#if FEATURE_feedback || FEATURE_rastpos
+ st->draw = draw_create(st->pipe); /* for selection/feedback */
+
+ /* Disable draw options that might convert points/lines to tris, etc.
+ * as that would foul-up feedback/selection mode.
+ */
+ draw_wide_line_threshold(st->draw, 1000.0f);
+ draw_wide_point_threshold(st->draw, 1000.0f);
+ draw_enable_line_stipple(st->draw, FALSE);
+ draw_enable_point_sprites(st->draw, FALSE);
+#endif
+}
+
+
+void
+st_destroy_draw(struct st_context *st)
+{
+#if FEATURE_feedback || FEATURE_rastpos
+ draw_destroy(st->draw);
+#endif
+}
diff --git a/mesalib/src/mesa/state_tracker/st_extensions.c b/mesalib/src/mesa/state_tracker/st_extensions.c
index d3aebe526..4a2963043 100644
--- a/mesalib/src/mesa/state_tracker/st_extensions.c
+++ b/mesalib/src/mesa/state_tracker/st_extensions.c
@@ -1,610 +1,610 @@
-/**************************************************************************
- *
- * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas.
- * Copyright (c) 2008 VMware, Inc.
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sub license, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice (including the
- * next paragraph) shall be included in all copies or substantial portions
- * of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
- * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
- * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- **************************************************************************/
-
-#include "main/imports.h"
-#include "main/context.h"
-#include "main/macros.h"
-#include "main/mfeatures.h"
-
-#include "pipe/p_context.h"
-#include "pipe/p_defines.h"
-#include "pipe/p_screen.h"
-
-#include "st_context.h"
-#include "st_extensions.h"
-
-
-static int _min(int a, int b)
-{
- return (a < b) ? a : b;
-}
-
-static float _maxf(float a, float b)
-{
- return (a > b) ? a : b;
-}
-
-static int _clamp(int a, int min, int max)
-{
- if (a < min)
- return min;
- else if (a > max)
- return max;
- else
- return a;
-}
-
-
-/**
- * Query driver to get implementation limits.
- * Note that we have to limit/clamp against Mesa's internal limits too.
- */
-void st_init_limits(struct st_context *st)
-{
- struct pipe_screen *screen = st->pipe->screen;
- struct gl_constants *c = &st->ctx->Const;
- gl_shader_type sh;
-
- c->MaxTextureLevels
- = _min(screen->get_param(screen, PIPE_CAP_MAX_TEXTURE_2D_LEVELS),
- MAX_TEXTURE_LEVELS);
-
- c->Max3DTextureLevels
- = _min(screen->get_param(screen, PIPE_CAP_MAX_TEXTURE_3D_LEVELS),
- MAX_3D_TEXTURE_LEVELS);
-
- c->MaxCubeTextureLevels
- = _min(screen->get_param(screen, PIPE_CAP_MAX_TEXTURE_CUBE_LEVELS),
- MAX_CUBE_TEXTURE_LEVELS);
-
- c->MaxTextureRectSize
- = _min(1 << (c->MaxTextureLevels - 1), MAX_TEXTURE_RECT_SIZE);
-
- c->MaxTextureImageUnits
- = _min(screen->get_param(screen, PIPE_CAP_MAX_TEXTURE_IMAGE_UNITS),
- MAX_TEXTURE_IMAGE_UNITS);
-
- c->MaxVertexTextureImageUnits
- = _min(screen->get_param(screen, PIPE_CAP_MAX_VERTEX_TEXTURE_UNITS),
- MAX_VERTEX_TEXTURE_IMAGE_UNITS);
-
- c->MaxCombinedTextureImageUnits
- = _min(screen->get_param(screen, PIPE_CAP_MAX_COMBINED_SAMPLERS),
- MAX_COMBINED_TEXTURE_IMAGE_UNITS);
-
- c->MaxTextureCoordUnits
- = _min(c->MaxTextureImageUnits, MAX_TEXTURE_COORD_UNITS);
-
- c->MaxTextureUnits = _min(c->MaxTextureImageUnits, c->MaxTextureCoordUnits);
-
- c->MaxDrawBuffers
- = _clamp(screen->get_param(screen, PIPE_CAP_MAX_RENDER_TARGETS),
- 1, MAX_DRAW_BUFFERS);
-
- c->MaxLineWidth
- = _maxf(1.0f, screen->get_paramf(screen, PIPE_CAP_MAX_LINE_WIDTH));
- c->MaxLineWidthAA
- = _maxf(1.0f, screen->get_paramf(screen, PIPE_CAP_MAX_LINE_WIDTH_AA));
-
- c->MaxPointSize
- = _maxf(1.0f, screen->get_paramf(screen, PIPE_CAP_MAX_POINT_WIDTH));
- c->MaxPointSizeAA
- = _maxf(1.0f, screen->get_paramf(screen, PIPE_CAP_MAX_POINT_WIDTH_AA));
- /* called after _mesa_create_context/_mesa_init_point, fix default user
- * settable max point size up
- */
- st->ctx->Point.MaxSize = MAX2(c->MaxPointSize, c->MaxPointSizeAA);
- /* these are not queryable. Note that GL basically mandates a 1.0 minimum
- * for non-aa sizes, but we can go down to 0.0 for aa points.
- */
- c->MinPointSize = 1.0f;
- c->MinPointSizeAA = 0.0f;
-
- c->MaxTextureMaxAnisotropy
- = _maxf(2.0f, screen->get_paramf(screen, PIPE_CAP_MAX_TEXTURE_ANISOTROPY));
-
- c->MaxTextureLodBias
- = screen->get_paramf(screen, PIPE_CAP_MAX_TEXTURE_LOD_BIAS);
-
- c->MaxDrawBuffers
- = CLAMP(screen->get_param(screen, PIPE_CAP_MAX_RENDER_TARGETS),
- 1, MAX_DRAW_BUFFERS);
-
- /* Quads always follow GL provoking rules. */
- c->QuadsFollowProvokingVertexConvention = GL_FALSE;
-
- for (sh = 0; sh < MESA_SHADER_TYPES; ++sh) {
- struct gl_shader_compiler_options *options =
- &st->ctx->ShaderCompilerOptions[sh];
- struct gl_program_constants *pc;
-
- switch (sh) {
- case PIPE_SHADER_FRAGMENT:
- pc = &c->FragmentProgram;
- break;
- case PIPE_SHADER_VERTEX:
- pc = &c->VertexProgram;
- break;
- case PIPE_SHADER_GEOMETRY:
- pc = &c->GeometryProgram;
- break;
- default:
- assert(0);
- continue;
- }
-
- pc->MaxNativeInstructions = screen->get_shader_param(screen, sh, PIPE_SHADER_CAP_MAX_INSTRUCTIONS);
- pc->MaxNativeAluInstructions = screen->get_shader_param(screen, sh, PIPE_SHADER_CAP_MAX_ALU_INSTRUCTIONS);
- pc->MaxNativeTexInstructions = screen->get_shader_param(screen, sh, PIPE_SHADER_CAP_MAX_TEX_INSTRUCTIONS);
- pc->MaxNativeTexIndirections = screen->get_shader_param(screen, sh, PIPE_SHADER_CAP_MAX_TEX_INDIRECTIONS);
- pc->MaxNativeAttribs = screen->get_shader_param(screen, sh, PIPE_SHADER_CAP_MAX_INPUTS);
- pc->MaxNativeTemps = screen->get_shader_param(screen, sh, PIPE_SHADER_CAP_MAX_TEMPS);
- pc->MaxNativeAddressRegs = screen->get_shader_param(screen, sh, PIPE_SHADER_CAP_MAX_ADDRS);
- pc->MaxNativeParameters = screen->get_shader_param(screen, sh, PIPE_SHADER_CAP_MAX_CONSTS);
- pc->MaxUniformComponents = 4 * MIN2(pc->MaxNativeParameters, MAX_UNIFORMS);
- /* raise MaxParameters if native support is higher */
- pc->MaxParameters = MAX2(pc->MaxParameters, pc->MaxNativeParameters);
-
- options->EmitNoNoise = TRUE;
-
- /* TODO: make these more fine-grained if anyone needs it */
- options->EmitNoIfs = !screen->get_shader_param(screen, sh, PIPE_SHADER_CAP_MAX_CONTROL_FLOW_DEPTH);
- options->EmitNoLoops = !screen->get_shader_param(screen, sh, PIPE_SHADER_CAP_MAX_CONTROL_FLOW_DEPTH);
- options->EmitNoFunctions = !screen->get_shader_param(screen, sh, PIPE_SHADER_CAP_SUBROUTINES);
- options->EmitNoMainReturn = !screen->get_shader_param(screen, sh, PIPE_SHADER_CAP_SUBROUTINES);
-
- options->EmitNoCont = !screen->get_shader_param(screen, sh, PIPE_SHADER_CAP_TGSI_CONT_SUPPORTED);
-
- options->EmitNoIndirectInput = !screen->get_shader_param(screen, sh,
- PIPE_SHADER_CAP_INDIRECT_INPUT_ADDR);
- options->EmitNoIndirectOutput = !screen->get_shader_param(screen, sh,
- PIPE_SHADER_CAP_INDIRECT_OUTPUT_ADDR);
- options->EmitNoIndirectTemp = !screen->get_shader_param(screen, sh,
- PIPE_SHADER_CAP_INDIRECT_TEMP_ADDR);
- options->EmitNoIndirectUniform = !screen->get_shader_param(screen, sh,
- PIPE_SHADER_CAP_INDIRECT_CONST_ADDR);
-
- if (options->EmitNoLoops)
- options->MaxUnrollIterations = MIN2(screen->get_shader_param(screen, sh, PIPE_SHADER_CAP_MAX_INSTRUCTIONS), 65536);
- }
-
- /* PIPE_CAP_MAX_FS_INPUTS specifies the number of COLORn + GENERICn inputs
- * and is set in MaxNativeAttribs. It's always 2 colors + N generic
- * attributes. The GLSL compiler never uses COLORn for varyings, so we
- * subtract the 2 colors to get the maximum number of varyings (generic
- * attributes) supported by a driver. */
- c->MaxVarying = screen->get_shader_param(screen, PIPE_SHADER_FRAGMENT, PIPE_SHADER_CAP_MAX_INPUTS) - 2;
- c->MaxVarying = MIN2(c->MaxVarying, MAX_VARYING);
-
- /* XXX we'll need a better query here someday */
- if (screen->get_param(screen, PIPE_CAP_GLSL)) {
- c->GLSLVersion = 120;
- }
-}
-
-
-/**
- * Use pipe_screen::get_param() to query PIPE_CAP_ values to determine
- * which GL extensions are supported.
- * Quite a few extensions are always supported because they are standard
- * features or can be built on top of other gallium features.
- * Some fine tuning may still be needed.
- */
-void st_init_extensions(struct st_context *st)
-{
- struct pipe_screen *screen = st->pipe->screen;
- struct gl_context *ctx = st->ctx;
-
- /*
- * Extensions that are supported by all Gallium drivers:
- */
- ctx->Extensions.ARB_copy_buffer = GL_TRUE;
- ctx->Extensions.ARB_draw_elements_base_vertex = GL_TRUE;
- ctx->Extensions.ARB_fragment_coord_conventions = GL_TRUE;
- ctx->Extensions.ARB_fragment_program = GL_TRUE;
- ctx->Extensions.ARB_half_float_pixel = GL_TRUE;
- ctx->Extensions.ARB_map_buffer_range = GL_TRUE;
- ctx->Extensions.ARB_multisample = GL_TRUE;
- ctx->Extensions.ARB_sampler_objects = GL_TRUE;
- ctx->Extensions.ARB_texture_border_clamp = GL_TRUE; /* XXX temp */
- ctx->Extensions.ARB_texture_compression = GL_TRUE;
- ctx->Extensions.ARB_texture_cube_map = GL_TRUE;
- ctx->Extensions.ARB_texture_env_combine = GL_TRUE;
- ctx->Extensions.ARB_texture_env_crossbar = GL_TRUE;
- ctx->Extensions.ARB_texture_env_dot3 = GL_TRUE;
- ctx->Extensions.ARB_vertex_array_object = GL_TRUE;
- ctx->Extensions.ARB_vertex_buffer_object = GL_TRUE;
- ctx->Extensions.ARB_vertex_program = GL_TRUE;
- ctx->Extensions.ARB_window_pos = GL_TRUE;
-
- ctx->Extensions.EXT_blend_color = GL_TRUE;
- ctx->Extensions.EXT_blend_func_separate = GL_TRUE;
- ctx->Extensions.EXT_blend_logic_op = GL_TRUE;
- ctx->Extensions.EXT_blend_minmax = GL_TRUE;
- ctx->Extensions.EXT_blend_subtract = GL_TRUE;
- ctx->Extensions.EXT_framebuffer_blit = GL_TRUE;
- ctx->Extensions.EXT_framebuffer_object = GL_TRUE;
- ctx->Extensions.EXT_framebuffer_multisample = GL_TRUE;
- ctx->Extensions.EXT_fog_coord = GL_TRUE;
- ctx->Extensions.EXT_gpu_program_parameters = GL_TRUE;
- ctx->Extensions.EXT_multi_draw_arrays = GL_TRUE;
- ctx->Extensions.EXT_pixel_buffer_object = GL_TRUE;
- ctx->Extensions.EXT_point_parameters = GL_TRUE;
- ctx->Extensions.EXT_provoking_vertex = GL_TRUE;
- ctx->Extensions.EXT_secondary_color = GL_TRUE;
- ctx->Extensions.EXT_stencil_wrap = GL_TRUE;
- ctx->Extensions.EXT_texture_env_add = GL_TRUE;
- ctx->Extensions.EXT_texture_env_combine = GL_TRUE;
- ctx->Extensions.EXT_texture_env_dot3 = GL_TRUE;
- ctx->Extensions.EXT_texture_lod_bias = GL_TRUE;
- ctx->Extensions.EXT_vertex_array_bgra = GL_TRUE;
- if (ctx->API == API_OPENGLES || ctx->API == API_OPENGLES2)
- ctx->Extensions.EXT_texture_format_BGRA8888 = GL_TRUE;
-
- ctx->Extensions.APPLE_vertex_array_object = GL_TRUE;
-
- ctx->Extensions.ATI_texture_env_combine3 = GL_TRUE;
-
- ctx->Extensions.MESA_pack_invert = GL_TRUE;
-
- ctx->Extensions.NV_blend_square = GL_TRUE;
- ctx->Extensions.NV_texgen_reflection = GL_TRUE;
- ctx->Extensions.NV_texture_env_combine4 = GL_TRUE;
- ctx->Extensions.NV_texture_rectangle = GL_TRUE;
-#if 0
- /* possibly could support the following two */
- ctx->Extensions.NV_vertex_program = GL_TRUE;
- ctx->Extensions.NV_vertex_program1_1 = GL_TRUE;
-#endif
-
-#if FEATURE_OES_EGL_image
- ctx->Extensions.OES_EGL_image = GL_TRUE;
-#endif
-#if FEATURE_OES_draw_texture
- ctx->Extensions.OES_draw_texture = GL_TRUE;
-#endif
-
- ctx->Extensions.SGIS_generate_mipmap = GL_TRUE;
-
- /*
- * Extensions that depend on the driver/hardware:
- */
- if (screen->get_param(screen, PIPE_CAP_MAX_RENDER_TARGETS) > 0) {
- ctx->Extensions.ARB_draw_buffers = GL_TRUE;
- }
-
- if (screen->get_param(screen, PIPE_CAP_TEXTURE_SWIZZLE) > 0) {
- ctx->Extensions.EXT_texture_swizzle = GL_TRUE;
- }
-
- if (screen->get_param(screen, PIPE_CAP_GLSL)) {
- ctx->Extensions.ARB_fragment_shader = GL_TRUE;
- ctx->Extensions.ARB_vertex_shader = GL_TRUE;
- ctx->Extensions.ARB_shader_objects = GL_TRUE;
- ctx->Extensions.ARB_shading_language_100 = GL_TRUE;
- ctx->Extensions.ARB_explicit_attrib_location = GL_TRUE;
- ctx->Extensions.EXT_separate_shader_objects = GL_TRUE;
- }
-
- if (screen->get_param(screen, PIPE_CAP_TEXTURE_MIRROR_REPEAT) > 0) {
- ctx->Extensions.ARB_texture_mirrored_repeat = GL_TRUE;
- }
-
- if (screen->get_param(screen, PIPE_CAP_BLEND_EQUATION_SEPARATE)) {
- ctx->Extensions.EXT_blend_equation_separate = GL_TRUE;
- }
-
- if (screen->get_param(screen, PIPE_CAP_TEXTURE_MIRROR_CLAMP) > 0) {
- ctx->Extensions.EXT_texture_mirror_clamp = GL_TRUE;
- ctx->Extensions.ATI_texture_mirror_once = GL_TRUE;
- }
-
- if (screen->get_param(screen, PIPE_CAP_NPOT_TEXTURES)) {
- ctx->Extensions.ARB_texture_non_power_of_two = GL_TRUE;
- }
-
- if (screen->get_param(screen, PIPE_CAP_MAX_TEXTURE_IMAGE_UNITS) > 1) {
- ctx->Extensions.ARB_multitexture = GL_TRUE;
- }
-
- if (screen->get_param(screen, PIPE_CAP_TWO_SIDED_STENCIL)) {
- ctx->Extensions.ATI_separate_stencil = GL_TRUE;
- ctx->Extensions.EXT_stencil_two_side = GL_TRUE;
- }
-
- if (screen->get_param(screen, PIPE_CAP_ANISOTROPIC_FILTER)) {
- ctx->Extensions.EXT_texture_filter_anisotropic = GL_TRUE;
- }
-
- if (screen->get_param(screen, PIPE_CAP_POINT_SPRITE)) {
- ctx->Extensions.ARB_point_sprite = GL_TRUE;
- /* GL_NV_point_sprite is not supported by gallium because we don't
- * support the GL_POINT_SPRITE_R_MODE_NV option.
- */
- }
-
- if (screen->get_param(screen, PIPE_CAP_OCCLUSION_QUERY)) {
- ctx->Extensions.ARB_occlusion_query = GL_TRUE;
- ctx->Extensions.ARB_occlusion_query2 = GL_TRUE;
- }
- if (screen->get_param(screen, PIPE_CAP_TIMER_QUERY)) {
- ctx->Extensions.EXT_timer_query = GL_TRUE;
- }
-
- if (screen->get_param(screen, PIPE_CAP_TEXTURE_SHADOW_MAP)) {
- ctx->Extensions.ARB_depth_texture = GL_TRUE;
- ctx->Extensions.ARB_fragment_program_shadow = GL_TRUE;
- ctx->Extensions.ARB_shadow = GL_TRUE;
- ctx->Extensions.EXT_shadow_funcs = GL_TRUE;
- /*ctx->Extensions.ARB_shadow_ambient = GL_TRUE;*/
- }
-
- /* GL_EXT_packed_depth_stencil requires both the ability to render to
- * a depth/stencil buffer and texture from depth/stencil source.
- */
- if (screen->is_format_supported(screen, PIPE_FORMAT_S8_USCALED_Z24_UNORM,
- PIPE_TEXTURE_2D, 0,
- PIPE_BIND_DEPTH_STENCIL) &&
- screen->is_format_supported(screen, PIPE_FORMAT_S8_USCALED_Z24_UNORM,
- PIPE_TEXTURE_2D, 0,
- PIPE_BIND_SAMPLER_VIEW)) {
- ctx->Extensions.EXT_packed_depth_stencil = GL_TRUE;
- }
- else if (screen->is_format_supported(screen, PIPE_FORMAT_Z24_UNORM_S8_USCALED,
- PIPE_TEXTURE_2D, 0,
- PIPE_BIND_DEPTH_STENCIL) &&
- screen->is_format_supported(screen, PIPE_FORMAT_Z24_UNORM_S8_USCALED,
- PIPE_TEXTURE_2D, 0,
- PIPE_BIND_SAMPLER_VIEW)) {
- ctx->Extensions.EXT_packed_depth_stencil = GL_TRUE;
- }
-
- /* float support - assume nothing exclusively supports 64-bit floats */
- if (screen->is_format_supported(screen, PIPE_FORMAT_R32G32B32A32_FLOAT,
- PIPE_TEXTURE_2D, 0,
- PIPE_BIND_SAMPLER_VIEW |
- PIPE_BIND_RENDER_TARGET) &&
- screen->is_format_supported(screen, PIPE_FORMAT_R16G16B16A16_FLOAT,
- PIPE_TEXTURE_2D, 0,
- PIPE_BIND_SAMPLER_VIEW |
- PIPE_BIND_RENDER_TARGET)) {
- ctx->Extensions.ARB_texture_float = GL_TRUE;
- }
-
- /* sRGB support */
- if (screen->is_format_supported(screen, PIPE_FORMAT_A8B8G8R8_SRGB,
- PIPE_TEXTURE_2D, 0,
- PIPE_BIND_SAMPLER_VIEW) ||
- screen->is_format_supported(screen, PIPE_FORMAT_B8G8R8A8_SRGB,
- PIPE_TEXTURE_2D, 0,
- PIPE_BIND_SAMPLER_VIEW)) {
- ctx->Extensions.EXT_texture_sRGB = GL_TRUE;
- ctx->Extensions.EXT_texture_sRGB_decode = GL_TRUE;
- if (screen->is_format_supported(screen, PIPE_FORMAT_A8B8G8R8_SRGB,
- PIPE_TEXTURE_2D, 0,
- PIPE_BIND_RENDER_TARGET) ||
- screen->is_format_supported(screen, PIPE_FORMAT_B8G8R8A8_SRGB,
- PIPE_TEXTURE_2D, 0,
- PIPE_BIND_RENDER_TARGET)) {
- ctx->Extensions.EXT_framebuffer_sRGB = GL_TRUE;
- ctx->Const.sRGBCapable = GL_TRUE;
- }
- }
-
- if (screen->is_format_supported(screen, PIPE_FORMAT_R8G8_UNORM,
- PIPE_TEXTURE_2D, 0,
- PIPE_BIND_SAMPLER_VIEW)) {
- ctx->Extensions.ARB_texture_rg = GL_TRUE;
- }
-
- /* s3tc support */
- if (screen->is_format_supported(screen, PIPE_FORMAT_DXT5_RGBA,
- PIPE_TEXTURE_2D, 0,
- PIPE_BIND_SAMPLER_VIEW) &&
- ctx->Mesa_DXTn) {
- ctx->Extensions.EXT_texture_compression_s3tc = GL_TRUE;
- ctx->Extensions.S3_s3tc = GL_TRUE;
- }
-
- if (screen->is_format_supported(screen, PIPE_FORMAT_RGTC1_UNORM,
- PIPE_TEXTURE_2D, 0,
- PIPE_BIND_SAMPLER_VIEW) &&
- screen->is_format_supported(screen, PIPE_FORMAT_RGTC1_SNORM,
- PIPE_TEXTURE_2D, 0,
- PIPE_BIND_SAMPLER_VIEW) &&
- screen->is_format_supported(screen, PIPE_FORMAT_RGTC2_UNORM,
- PIPE_TEXTURE_2D, 0,
- PIPE_BIND_SAMPLER_VIEW) &&
- screen->is_format_supported(screen, PIPE_FORMAT_RGTC2_SNORM,
- PIPE_TEXTURE_2D, 0,
- PIPE_BIND_SAMPLER_VIEW)
- ) {
- ctx->Extensions.ARB_texture_compression_rgtc = GL_TRUE;
- }
-
- if (screen->is_format_supported(screen, PIPE_FORMAT_LATC1_UNORM,
- PIPE_TEXTURE_2D, 0,
- PIPE_BIND_SAMPLER_VIEW) &&
- screen->is_format_supported(screen, PIPE_FORMAT_LATC1_SNORM,
- PIPE_TEXTURE_2D, 0,
- PIPE_BIND_SAMPLER_VIEW) &&
- screen->is_format_supported(screen, PIPE_FORMAT_LATC2_UNORM,
- PIPE_TEXTURE_2D, 0,
- PIPE_BIND_SAMPLER_VIEW) &&
- screen->is_format_supported(screen, PIPE_FORMAT_LATC2_SNORM,
- PIPE_TEXTURE_2D, 0,
- PIPE_BIND_SAMPLER_VIEW)) {
- ctx->Extensions.EXT_texture_compression_latc = GL_TRUE;
- }
-
- if (screen->is_format_supported(screen, PIPE_FORMAT_LATC2_UNORM,
- PIPE_TEXTURE_2D, 0,
- PIPE_BIND_SAMPLER_VIEW)) {
- ctx->Extensions.ATI_texture_compression_3dc = GL_TRUE;
- }
-
- if (screen->is_format_supported(screen, PIPE_FORMAT_R8G8B8A8_SNORM,
- PIPE_TEXTURE_2D, 0,
- PIPE_BIND_SAMPLER_VIEW)) {
- ctx->Extensions.EXT_texture_snorm = GL_TRUE;
- }
-
- /* ycbcr support */
- if (screen->is_format_supported(screen, PIPE_FORMAT_UYVY,
- PIPE_TEXTURE_2D, 0,
- PIPE_BIND_SAMPLER_VIEW) ||
- screen->is_format_supported(screen, PIPE_FORMAT_YUYV,
- PIPE_TEXTURE_2D, 0,
- PIPE_BIND_SAMPLER_VIEW)) {
- ctx->Extensions.MESA_ycbcr_texture = GL_TRUE;
- }
-
- /* GL_EXT_texture_array */
- if (screen->get_param(screen, PIPE_CAP_ARRAY_TEXTURES)) {
- ctx->Extensions.EXT_texture_array = GL_TRUE;
- ctx->Extensions.MESA_texture_array = GL_TRUE;
- }
-
- /* GL_ARB_framebuffer_object */
- if (ctx->Extensions.EXT_packed_depth_stencil) {
- /* we support always support GL_EXT_framebuffer_blit */
- ctx->Extensions.ARB_framebuffer_object = GL_TRUE;
- }
-
- if (st->pipe->render_condition) {
- ctx->Extensions.NV_conditional_render = GL_TRUE;
- }
-
- if (screen->get_param(screen, PIPE_CAP_INDEP_BLEND_ENABLE)) {
- ctx->Extensions.EXT_draw_buffers2 = GL_TRUE;
- }
-
- if (screen->get_param(screen, PIPE_CAP_INDEP_BLEND_FUNC)) {
- ctx->Extensions.ARB_draw_buffers_blend = GL_TRUE;
- }
-
- /* GL_ARB_half_float_vertex */
- if (screen->is_format_supported(screen, PIPE_FORMAT_R16G16B16A16_FLOAT,
- PIPE_BUFFER, 0,
- PIPE_BIND_VERTEX_BUFFER)) {
- ctx->Extensions.ARB_half_float_vertex = GL_TRUE;
- }
-
- if (screen->is_format_supported(screen, PIPE_FORMAT_R32G32B32A32_FIXED,
- PIPE_BUFFER, 0,
- PIPE_BIND_VERTEX_BUFFER)) {
- ctx->Extensions.ARB_ES2_compatibility = GL_TRUE;
- }
-
- if (screen->get_shader_param(screen, PIPE_SHADER_GEOMETRY, PIPE_SHADER_CAP_MAX_INSTRUCTIONS) > 0) {
-#if 0 /* XXX re-enable when GLSL compiler again supports geometry shaders */
- ctx->Extensions.ARB_geometry_shader4 = GL_TRUE;
-#endif
- }
-
- if (screen->get_param(screen, PIPE_CAP_PRIMITIVE_RESTART)) {
- ctx->Extensions.NV_primitive_restart = GL_TRUE;
- }
-
- if (screen->get_param(screen, PIPE_CAP_DEPTH_CLAMP)) {
- ctx->Extensions.ARB_depth_clamp = GL_TRUE;
- }
-
- /* This extension does not actually require support of floating point
- * render targets, just clamping controls.
- * Advertise this extension if either fragment color clamping is supported
- * or no render targets having color values outside of the range [0, 1]
- * are supported, in which case the fragment color clamping has no effect
- * on rendering.
- */
- if (screen->get_param(screen, PIPE_CAP_FRAGMENT_COLOR_CLAMP_CONTROL) ||
- (!screen->is_format_supported(screen, PIPE_FORMAT_R8G8B8A8_SNORM,
- PIPE_TEXTURE_2D, 0,
- PIPE_BIND_RENDER_TARGET) &&
- !screen->is_format_supported(screen, PIPE_FORMAT_R16G16B16A16_SNORM,
- PIPE_TEXTURE_2D, 0,
- PIPE_BIND_RENDER_TARGET) &&
- !screen->is_format_supported(screen, PIPE_FORMAT_R16G16B16A16_FLOAT,
- PIPE_TEXTURE_2D, 0,
- PIPE_BIND_RENDER_TARGET) &&
- !screen->is_format_supported(screen, PIPE_FORMAT_R32G32B32A32_FLOAT,
- PIPE_TEXTURE_2D, 0,
- PIPE_BIND_RENDER_TARGET) &&
- !screen->is_format_supported(screen, PIPE_FORMAT_R11G11B10_FLOAT,
- PIPE_TEXTURE_2D, 0,
- PIPE_BIND_RENDER_TARGET) &&
- !screen->is_format_supported(screen, PIPE_FORMAT_R9G9B9E5_FLOAT,
- PIPE_TEXTURE_2D, 0,
- PIPE_BIND_RENDER_TARGET))) {
- ctx->Extensions.ARB_color_buffer_float = GL_TRUE;
- }
-
- if (screen->get_param(screen, PIPE_CAP_SHADER_STENCIL_EXPORT)) {
- ctx->Extensions.ARB_shader_stencil_export = GL_TRUE;
- }
-
- if (screen->get_param(screen, PIPE_CAP_TGSI_INSTANCEID)) {
- ctx->Extensions.ARB_draw_instanced = GL_TRUE;
- }
- if (screen->get_param(screen, PIPE_CAP_VERTEX_ELEMENT_INSTANCE_DIVISOR)) {
- ctx->Extensions.ARB_instanced_arrays = GL_TRUE;
- }
-
- if (screen->fence_finish) {
- ctx->Extensions.ARB_sync = GL_TRUE;
- }
-
- if (st->pipe->texture_barrier) {
- ctx->Extensions.NV_texture_barrier = GL_TRUE;
- }
-
- if (screen->is_format_supported(screen, PIPE_FORMAT_R9G9B9E5_FLOAT,
- PIPE_TEXTURE_2D, 0,
- PIPE_BIND_SAMPLER_VIEW)) {
- ctx->Extensions.EXT_texture_shared_exponent = GL_TRUE;
- }
-
- if (screen->is_format_supported(screen, PIPE_FORMAT_R11G11B10_FLOAT,
- PIPE_TEXTURE_2D, 0,
- PIPE_BIND_RENDER_TARGET |
- PIPE_BIND_SAMPLER_VIEW)) {
- ctx->Extensions.EXT_packed_float = GL_TRUE;
- }
-
- if (screen->get_param(screen, PIPE_CAP_SEAMLESS_CUBE_MAP_PER_TEXTURE)) {
- ctx->Extensions.ARB_seamless_cube_map = GL_TRUE;
- ctx->Extensions.AMD_seamless_cubemap_per_texture = GL_TRUE;
- }
- else if (screen->get_param(screen, PIPE_CAP_SEAMLESS_CUBE_MAP)) {
- ctx->Extensions.ARB_seamless_cube_map = GL_TRUE;
- }
-
- if (screen->get_param(screen, PIPE_CAP_SM3)) {
- ctx->Extensions.ARB_shader_texture_lod = GL_TRUE;
- }
-}
+/**************************************************************************
+ *
+ * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas.
+ * Copyright (c) 2008 VMware, Inc.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ **************************************************************************/
+
+#include "main/imports.h"
+#include "main/context.h"
+#include "main/macros.h"
+#include "main/mfeatures.h"
+
+#include "pipe/p_context.h"
+#include "pipe/p_defines.h"
+#include "pipe/p_screen.h"
+
+#include "st_context.h"
+#include "st_extensions.h"
+
+
+static int _min(int a, int b)
+{
+ return (a < b) ? a : b;
+}
+
+static float _maxf(float a, float b)
+{
+ return (a > b) ? a : b;
+}
+
+static int _clamp(int a, int min, int max)
+{
+ if (a < min)
+ return min;
+ else if (a > max)
+ return max;
+ else
+ return a;
+}
+
+
+/**
+ * Query driver to get implementation limits.
+ * Note that we have to limit/clamp against Mesa's internal limits too.
+ */
+void st_init_limits(struct st_context *st)
+{
+ struct pipe_screen *screen = st->pipe->screen;
+ struct gl_constants *c = &st->ctx->Const;
+ gl_shader_type sh;
+
+ c->MaxTextureLevels
+ = _min(screen->get_param(screen, PIPE_CAP_MAX_TEXTURE_2D_LEVELS),
+ MAX_TEXTURE_LEVELS);
+
+ c->Max3DTextureLevels
+ = _min(screen->get_param(screen, PIPE_CAP_MAX_TEXTURE_3D_LEVELS),
+ MAX_3D_TEXTURE_LEVELS);
+
+ c->MaxCubeTextureLevels
+ = _min(screen->get_param(screen, PIPE_CAP_MAX_TEXTURE_CUBE_LEVELS),
+ MAX_CUBE_TEXTURE_LEVELS);
+
+ c->MaxTextureRectSize
+ = _min(1 << (c->MaxTextureLevels - 1), MAX_TEXTURE_RECT_SIZE);
+
+ c->MaxTextureImageUnits
+ = _min(screen->get_param(screen, PIPE_CAP_MAX_TEXTURE_IMAGE_UNITS),
+ MAX_TEXTURE_IMAGE_UNITS);
+
+ c->MaxVertexTextureImageUnits
+ = _min(screen->get_param(screen, PIPE_CAP_MAX_VERTEX_TEXTURE_UNITS),
+ MAX_VERTEX_TEXTURE_IMAGE_UNITS);
+
+ c->MaxCombinedTextureImageUnits
+ = _min(screen->get_param(screen, PIPE_CAP_MAX_COMBINED_SAMPLERS),
+ MAX_COMBINED_TEXTURE_IMAGE_UNITS);
+
+ c->MaxTextureCoordUnits
+ = _min(c->MaxTextureImageUnits, MAX_TEXTURE_COORD_UNITS);
+
+ c->MaxTextureUnits = _min(c->MaxTextureImageUnits, c->MaxTextureCoordUnits);
+
+ c->MaxDrawBuffers
+ = _clamp(screen->get_param(screen, PIPE_CAP_MAX_RENDER_TARGETS),
+ 1, MAX_DRAW_BUFFERS);
+
+ c->MaxLineWidth
+ = _maxf(1.0f, screen->get_paramf(screen, PIPE_CAP_MAX_LINE_WIDTH));
+ c->MaxLineWidthAA
+ = _maxf(1.0f, screen->get_paramf(screen, PIPE_CAP_MAX_LINE_WIDTH_AA));
+
+ c->MaxPointSize
+ = _maxf(1.0f, screen->get_paramf(screen, PIPE_CAP_MAX_POINT_WIDTH));
+ c->MaxPointSizeAA
+ = _maxf(1.0f, screen->get_paramf(screen, PIPE_CAP_MAX_POINT_WIDTH_AA));
+ /* called after _mesa_create_context/_mesa_init_point, fix default user
+ * settable max point size up
+ */
+ st->ctx->Point.MaxSize = MAX2(c->MaxPointSize, c->MaxPointSizeAA);
+ /* these are not queryable. Note that GL basically mandates a 1.0 minimum
+ * for non-aa sizes, but we can go down to 0.0 for aa points.
+ */
+ c->MinPointSize = 1.0f;
+ c->MinPointSizeAA = 0.0f;
+
+ c->MaxTextureMaxAnisotropy
+ = _maxf(2.0f, screen->get_paramf(screen, PIPE_CAP_MAX_TEXTURE_ANISOTROPY));
+
+ c->MaxTextureLodBias
+ = screen->get_paramf(screen, PIPE_CAP_MAX_TEXTURE_LOD_BIAS);
+
+ c->MaxDrawBuffers
+ = CLAMP(screen->get_param(screen, PIPE_CAP_MAX_RENDER_TARGETS),
+ 1, MAX_DRAW_BUFFERS);
+
+ /* Quads always follow GL provoking rules. */
+ c->QuadsFollowProvokingVertexConvention = GL_FALSE;
+
+ for (sh = 0; sh < MESA_SHADER_TYPES; ++sh) {
+ struct gl_shader_compiler_options *options =
+ &st->ctx->ShaderCompilerOptions[sh];
+ struct gl_program_constants *pc;
+
+ switch (sh) {
+ case PIPE_SHADER_FRAGMENT:
+ pc = &c->FragmentProgram;
+ break;
+ case PIPE_SHADER_VERTEX:
+ pc = &c->VertexProgram;
+ break;
+ case PIPE_SHADER_GEOMETRY:
+ pc = &c->GeometryProgram;
+ break;
+ default:
+ assert(0);
+ continue;
+ }
+
+ pc->MaxNativeInstructions = screen->get_shader_param(screen, sh, PIPE_SHADER_CAP_MAX_INSTRUCTIONS);
+ pc->MaxNativeAluInstructions = screen->get_shader_param(screen, sh, PIPE_SHADER_CAP_MAX_ALU_INSTRUCTIONS);
+ pc->MaxNativeTexInstructions = screen->get_shader_param(screen, sh, PIPE_SHADER_CAP_MAX_TEX_INSTRUCTIONS);
+ pc->MaxNativeTexIndirections = screen->get_shader_param(screen, sh, PIPE_SHADER_CAP_MAX_TEX_INDIRECTIONS);
+ pc->MaxNativeAttribs = screen->get_shader_param(screen, sh, PIPE_SHADER_CAP_MAX_INPUTS);
+ pc->MaxNativeTemps = screen->get_shader_param(screen, sh, PIPE_SHADER_CAP_MAX_TEMPS);
+ pc->MaxNativeAddressRegs = screen->get_shader_param(screen, sh, PIPE_SHADER_CAP_MAX_ADDRS);
+ pc->MaxNativeParameters = screen->get_shader_param(screen, sh, PIPE_SHADER_CAP_MAX_CONSTS);
+ pc->MaxUniformComponents = 4 * MIN2(pc->MaxNativeParameters, MAX_UNIFORMS);
+ /* raise MaxParameters if native support is higher */
+ pc->MaxParameters = MAX2(pc->MaxParameters, pc->MaxNativeParameters);
+
+ options->EmitNoNoise = TRUE;
+
+ /* TODO: make these more fine-grained if anyone needs it */
+ options->EmitNoIfs = !screen->get_shader_param(screen, sh, PIPE_SHADER_CAP_MAX_CONTROL_FLOW_DEPTH);
+ options->EmitNoLoops = !screen->get_shader_param(screen, sh, PIPE_SHADER_CAP_MAX_CONTROL_FLOW_DEPTH);
+ options->EmitNoFunctions = !screen->get_shader_param(screen, sh, PIPE_SHADER_CAP_SUBROUTINES);
+ options->EmitNoMainReturn = !screen->get_shader_param(screen, sh, PIPE_SHADER_CAP_SUBROUTINES);
+
+ options->EmitNoCont = !screen->get_shader_param(screen, sh, PIPE_SHADER_CAP_TGSI_CONT_SUPPORTED);
+
+ options->EmitNoIndirectInput = !screen->get_shader_param(screen, sh,
+ PIPE_SHADER_CAP_INDIRECT_INPUT_ADDR);
+ options->EmitNoIndirectOutput = !screen->get_shader_param(screen, sh,
+ PIPE_SHADER_CAP_INDIRECT_OUTPUT_ADDR);
+ options->EmitNoIndirectTemp = !screen->get_shader_param(screen, sh,
+ PIPE_SHADER_CAP_INDIRECT_TEMP_ADDR);
+ options->EmitNoIndirectUniform = !screen->get_shader_param(screen, sh,
+ PIPE_SHADER_CAP_INDIRECT_CONST_ADDR);
+
+ if (options->EmitNoLoops)
+ options->MaxUnrollIterations = MIN2(screen->get_shader_param(screen, sh, PIPE_SHADER_CAP_MAX_INSTRUCTIONS), 65536);
+ }
+
+ /* PIPE_CAP_MAX_FS_INPUTS specifies the number of COLORn + GENERICn inputs
+ * and is set in MaxNativeAttribs. It's always 2 colors + N generic
+ * attributes. The GLSL compiler never uses COLORn for varyings, so we
+ * subtract the 2 colors to get the maximum number of varyings (generic
+ * attributes) supported by a driver. */
+ c->MaxVarying = screen->get_shader_param(screen, PIPE_SHADER_FRAGMENT, PIPE_SHADER_CAP_MAX_INPUTS) - 2;
+ c->MaxVarying = MIN2(c->MaxVarying, MAX_VARYING);
+
+ /* XXX we'll need a better query here someday */
+ if (screen->get_param(screen, PIPE_CAP_GLSL)) {
+ c->GLSLVersion = 120;
+ }
+}
+
+
+/**
+ * Use pipe_screen::get_param() to query PIPE_CAP_ values to determine
+ * which GL extensions are supported.
+ * Quite a few extensions are always supported because they are standard
+ * features or can be built on top of other gallium features.
+ * Some fine tuning may still be needed.
+ */
+void st_init_extensions(struct st_context *st)
+{
+ struct pipe_screen *screen = st->pipe->screen;
+ struct gl_context *ctx = st->ctx;
+
+ /*
+ * Extensions that are supported by all Gallium drivers:
+ */
+ ctx->Extensions.ARB_copy_buffer = GL_TRUE;
+ ctx->Extensions.ARB_draw_elements_base_vertex = GL_TRUE;
+ ctx->Extensions.ARB_fragment_coord_conventions = GL_TRUE;
+ ctx->Extensions.ARB_fragment_program = GL_TRUE;
+ ctx->Extensions.ARB_half_float_pixel = GL_TRUE;
+ ctx->Extensions.ARB_map_buffer_range = GL_TRUE;
+ ctx->Extensions.ARB_multisample = GL_TRUE;
+ ctx->Extensions.ARB_sampler_objects = GL_TRUE;
+ ctx->Extensions.ARB_texture_border_clamp = GL_TRUE; /* XXX temp */
+ ctx->Extensions.ARB_texture_compression = GL_TRUE;
+ ctx->Extensions.ARB_texture_cube_map = GL_TRUE;
+ ctx->Extensions.ARB_texture_env_combine = GL_TRUE;
+ ctx->Extensions.ARB_texture_env_crossbar = GL_TRUE;
+ ctx->Extensions.ARB_texture_env_dot3 = GL_TRUE;
+ ctx->Extensions.ARB_vertex_array_object = GL_TRUE;
+ ctx->Extensions.ARB_vertex_buffer_object = GL_TRUE;
+ ctx->Extensions.ARB_vertex_program = GL_TRUE;
+ ctx->Extensions.ARB_window_pos = GL_TRUE;
+
+ ctx->Extensions.EXT_blend_color = GL_TRUE;
+ ctx->Extensions.EXT_blend_func_separate = GL_TRUE;
+ ctx->Extensions.EXT_blend_logic_op = GL_TRUE;
+ ctx->Extensions.EXT_blend_minmax = GL_TRUE;
+ ctx->Extensions.EXT_blend_subtract = GL_TRUE;
+ ctx->Extensions.EXT_framebuffer_blit = GL_TRUE;
+ ctx->Extensions.EXT_framebuffer_object = GL_TRUE;
+ ctx->Extensions.EXT_framebuffer_multisample = GL_TRUE;
+ ctx->Extensions.EXT_fog_coord = GL_TRUE;
+ ctx->Extensions.EXT_gpu_program_parameters = GL_TRUE;
+ ctx->Extensions.EXT_multi_draw_arrays = GL_TRUE;
+ ctx->Extensions.EXT_pixel_buffer_object = GL_TRUE;
+ ctx->Extensions.EXT_point_parameters = GL_TRUE;
+ ctx->Extensions.EXT_provoking_vertex = GL_TRUE;
+ ctx->Extensions.EXT_secondary_color = GL_TRUE;
+ ctx->Extensions.EXT_stencil_wrap = GL_TRUE;
+ ctx->Extensions.EXT_texture_env_add = GL_TRUE;
+ ctx->Extensions.EXT_texture_env_combine = GL_TRUE;
+ ctx->Extensions.EXT_texture_env_dot3 = GL_TRUE;
+ ctx->Extensions.EXT_texture_lod_bias = GL_TRUE;
+ ctx->Extensions.EXT_vertex_array_bgra = GL_TRUE;
+ if (ctx->API == API_OPENGLES || ctx->API == API_OPENGLES2)
+ ctx->Extensions.EXT_texture_format_BGRA8888 = GL_TRUE;
+
+ ctx->Extensions.APPLE_vertex_array_object = GL_TRUE;
+
+ ctx->Extensions.ATI_texture_env_combine3 = GL_TRUE;
+
+ ctx->Extensions.MESA_pack_invert = GL_TRUE;
+
+ ctx->Extensions.NV_blend_square = GL_TRUE;
+ ctx->Extensions.NV_texgen_reflection = GL_TRUE;
+ ctx->Extensions.NV_texture_env_combine4 = GL_TRUE;
+ ctx->Extensions.NV_texture_rectangle = GL_TRUE;
+#if 0
+ /* possibly could support the following two */
+ ctx->Extensions.NV_vertex_program = GL_TRUE;
+ ctx->Extensions.NV_vertex_program1_1 = GL_TRUE;
+#endif
+
+#if FEATURE_OES_EGL_image
+ ctx->Extensions.OES_EGL_image = GL_TRUE;
+#endif
+#if FEATURE_OES_draw_texture
+ ctx->Extensions.OES_draw_texture = GL_TRUE;
+#endif
+
+ ctx->Extensions.SGIS_generate_mipmap = GL_TRUE;
+
+ /*
+ * Extensions that depend on the driver/hardware:
+ */
+ if (screen->get_param(screen, PIPE_CAP_MAX_RENDER_TARGETS) > 0) {
+ ctx->Extensions.ARB_draw_buffers = GL_TRUE;
+ }
+
+ if (screen->get_param(screen, PIPE_CAP_TEXTURE_SWIZZLE) > 0) {
+ ctx->Extensions.EXT_texture_swizzle = GL_TRUE;
+ }
+
+ if (screen->get_param(screen, PIPE_CAP_GLSL)) {
+ ctx->Extensions.ARB_fragment_shader = GL_TRUE;
+ ctx->Extensions.ARB_vertex_shader = GL_TRUE;
+ ctx->Extensions.ARB_shader_objects = GL_TRUE;
+ ctx->Extensions.ARB_shading_language_100 = GL_TRUE;
+ ctx->Extensions.ARB_explicit_attrib_location = GL_TRUE;
+ ctx->Extensions.EXT_separate_shader_objects = GL_TRUE;
+ }
+
+ if (screen->get_param(screen, PIPE_CAP_TEXTURE_MIRROR_REPEAT) > 0) {
+ ctx->Extensions.ARB_texture_mirrored_repeat = GL_TRUE;
+ }
+
+ if (screen->get_param(screen, PIPE_CAP_BLEND_EQUATION_SEPARATE)) {
+ ctx->Extensions.EXT_blend_equation_separate = GL_TRUE;
+ }
+
+ if (screen->get_param(screen, PIPE_CAP_TEXTURE_MIRROR_CLAMP) > 0) {
+ ctx->Extensions.EXT_texture_mirror_clamp = GL_TRUE;
+ ctx->Extensions.ATI_texture_mirror_once = GL_TRUE;
+ }
+
+ if (screen->get_param(screen, PIPE_CAP_NPOT_TEXTURES)) {
+ ctx->Extensions.ARB_texture_non_power_of_two = GL_TRUE;
+ }
+
+ if (screen->get_param(screen, PIPE_CAP_MAX_TEXTURE_IMAGE_UNITS) > 1) {
+ ctx->Extensions.ARB_multitexture = GL_TRUE;
+ }
+
+ if (screen->get_param(screen, PIPE_CAP_TWO_SIDED_STENCIL)) {
+ ctx->Extensions.ATI_separate_stencil = GL_TRUE;
+ ctx->Extensions.EXT_stencil_two_side = GL_TRUE;
+ }
+
+ if (screen->get_param(screen, PIPE_CAP_ANISOTROPIC_FILTER)) {
+ ctx->Extensions.EXT_texture_filter_anisotropic = GL_TRUE;
+ }
+
+ if (screen->get_param(screen, PIPE_CAP_POINT_SPRITE)) {
+ ctx->Extensions.ARB_point_sprite = GL_TRUE;
+ /* GL_NV_point_sprite is not supported by gallium because we don't
+ * support the GL_POINT_SPRITE_R_MODE_NV option.
+ */
+ }
+
+ if (screen->get_param(screen, PIPE_CAP_OCCLUSION_QUERY)) {
+ ctx->Extensions.ARB_occlusion_query = GL_TRUE;
+ ctx->Extensions.ARB_occlusion_query2 = GL_TRUE;
+ }
+ if (screen->get_param(screen, PIPE_CAP_TIMER_QUERY)) {
+ ctx->Extensions.EXT_timer_query = GL_TRUE;
+ }
+
+ if (screen->get_param(screen, PIPE_CAP_TEXTURE_SHADOW_MAP)) {
+ ctx->Extensions.ARB_depth_texture = GL_TRUE;
+ ctx->Extensions.ARB_fragment_program_shadow = GL_TRUE;
+ ctx->Extensions.ARB_shadow = GL_TRUE;
+ ctx->Extensions.EXT_shadow_funcs = GL_TRUE;
+ /*ctx->Extensions.ARB_shadow_ambient = GL_TRUE;*/
+ }
+
+ /* GL_EXT_packed_depth_stencil requires both the ability to render to
+ * a depth/stencil buffer and texture from depth/stencil source.
+ */
+ if (screen->is_format_supported(screen, PIPE_FORMAT_S8_USCALED_Z24_UNORM,
+ PIPE_TEXTURE_2D, 0,
+ PIPE_BIND_DEPTH_STENCIL) &&
+ screen->is_format_supported(screen, PIPE_FORMAT_S8_USCALED_Z24_UNORM,
+ PIPE_TEXTURE_2D, 0,
+ PIPE_BIND_SAMPLER_VIEW)) {
+ ctx->Extensions.EXT_packed_depth_stencil = GL_TRUE;
+ }
+ else if (screen->is_format_supported(screen, PIPE_FORMAT_Z24_UNORM_S8_USCALED,
+ PIPE_TEXTURE_2D, 0,
+ PIPE_BIND_DEPTH_STENCIL) &&
+ screen->is_format_supported(screen, PIPE_FORMAT_Z24_UNORM_S8_USCALED,
+ PIPE_TEXTURE_2D, 0,
+ PIPE_BIND_SAMPLER_VIEW)) {
+ ctx->Extensions.EXT_packed_depth_stencil = GL_TRUE;
+ }
+
+ /* float support - assume nothing exclusively supports 64-bit floats */
+ if (screen->is_format_supported(screen, PIPE_FORMAT_R32G32B32A32_FLOAT,
+ PIPE_TEXTURE_2D, 0,
+ PIPE_BIND_SAMPLER_VIEW |
+ PIPE_BIND_RENDER_TARGET) &&
+ screen->is_format_supported(screen, PIPE_FORMAT_R16G16B16A16_FLOAT,
+ PIPE_TEXTURE_2D, 0,
+ PIPE_BIND_SAMPLER_VIEW |
+ PIPE_BIND_RENDER_TARGET)) {
+ ctx->Extensions.ARB_texture_float = GL_TRUE;
+ }
+
+ /* sRGB support */
+ if (screen->is_format_supported(screen, PIPE_FORMAT_A8B8G8R8_SRGB,
+ PIPE_TEXTURE_2D, 0,
+ PIPE_BIND_SAMPLER_VIEW) ||
+ screen->is_format_supported(screen, PIPE_FORMAT_B8G8R8A8_SRGB,
+ PIPE_TEXTURE_2D, 0,
+ PIPE_BIND_SAMPLER_VIEW)) {
+ ctx->Extensions.EXT_texture_sRGB = GL_TRUE;
+ ctx->Extensions.EXT_texture_sRGB_decode = GL_TRUE;
+ if (screen->is_format_supported(screen, PIPE_FORMAT_A8B8G8R8_SRGB,
+ PIPE_TEXTURE_2D, 0,
+ PIPE_BIND_RENDER_TARGET) ||
+ screen->is_format_supported(screen, PIPE_FORMAT_B8G8R8A8_SRGB,
+ PIPE_TEXTURE_2D, 0,
+ PIPE_BIND_RENDER_TARGET)) {
+ ctx->Extensions.EXT_framebuffer_sRGB = GL_TRUE;
+ ctx->Const.sRGBCapable = GL_TRUE;
+ }
+ }
+
+ if (screen->is_format_supported(screen, PIPE_FORMAT_R8G8_UNORM,
+ PIPE_TEXTURE_2D, 0,
+ PIPE_BIND_SAMPLER_VIEW)) {
+ ctx->Extensions.ARB_texture_rg = GL_TRUE;
+ }
+
+ /* s3tc support */
+ if (screen->is_format_supported(screen, PIPE_FORMAT_DXT5_RGBA,
+ PIPE_TEXTURE_2D, 0,
+ PIPE_BIND_SAMPLER_VIEW) &&
+ ctx->Mesa_DXTn) {
+ ctx->Extensions.EXT_texture_compression_s3tc = GL_TRUE;
+ ctx->Extensions.S3_s3tc = GL_TRUE;
+ }
+
+ if (screen->is_format_supported(screen, PIPE_FORMAT_RGTC1_UNORM,
+ PIPE_TEXTURE_2D, 0,
+ PIPE_BIND_SAMPLER_VIEW) &&
+ screen->is_format_supported(screen, PIPE_FORMAT_RGTC1_SNORM,
+ PIPE_TEXTURE_2D, 0,
+ PIPE_BIND_SAMPLER_VIEW) &&
+ screen->is_format_supported(screen, PIPE_FORMAT_RGTC2_UNORM,
+ PIPE_TEXTURE_2D, 0,
+ PIPE_BIND_SAMPLER_VIEW) &&
+ screen->is_format_supported(screen, PIPE_FORMAT_RGTC2_SNORM,
+ PIPE_TEXTURE_2D, 0,
+ PIPE_BIND_SAMPLER_VIEW)
+ ) {
+ ctx->Extensions.ARB_texture_compression_rgtc = GL_TRUE;
+ }
+
+ if (screen->is_format_supported(screen, PIPE_FORMAT_LATC1_UNORM,
+ PIPE_TEXTURE_2D, 0,
+ PIPE_BIND_SAMPLER_VIEW) &&
+ screen->is_format_supported(screen, PIPE_FORMAT_LATC1_SNORM,
+ PIPE_TEXTURE_2D, 0,
+ PIPE_BIND_SAMPLER_VIEW) &&
+ screen->is_format_supported(screen, PIPE_FORMAT_LATC2_UNORM,
+ PIPE_TEXTURE_2D, 0,
+ PIPE_BIND_SAMPLER_VIEW) &&
+ screen->is_format_supported(screen, PIPE_FORMAT_LATC2_SNORM,
+ PIPE_TEXTURE_2D, 0,
+ PIPE_BIND_SAMPLER_VIEW)) {
+ ctx->Extensions.EXT_texture_compression_latc = GL_TRUE;
+ }
+
+ if (screen->is_format_supported(screen, PIPE_FORMAT_LATC2_UNORM,
+ PIPE_TEXTURE_2D, 0,
+ PIPE_BIND_SAMPLER_VIEW)) {
+ ctx->Extensions.ATI_texture_compression_3dc = GL_TRUE;
+ }
+
+ if (screen->is_format_supported(screen, PIPE_FORMAT_R8G8B8A8_SNORM,
+ PIPE_TEXTURE_2D, 0,
+ PIPE_BIND_SAMPLER_VIEW)) {
+ ctx->Extensions.EXT_texture_snorm = GL_TRUE;
+ }
+
+ /* ycbcr support */
+ if (screen->is_format_supported(screen, PIPE_FORMAT_UYVY,
+ PIPE_TEXTURE_2D, 0,
+ PIPE_BIND_SAMPLER_VIEW) ||
+ screen->is_format_supported(screen, PIPE_FORMAT_YUYV,
+ PIPE_TEXTURE_2D, 0,
+ PIPE_BIND_SAMPLER_VIEW)) {
+ ctx->Extensions.MESA_ycbcr_texture = GL_TRUE;
+ }
+
+ /* GL_EXT_texture_array */
+ if (screen->get_param(screen, PIPE_CAP_ARRAY_TEXTURES)) {
+ ctx->Extensions.EXT_texture_array = GL_TRUE;
+ ctx->Extensions.MESA_texture_array = GL_TRUE;
+ }
+
+ /* GL_ARB_framebuffer_object */
+ if (ctx->Extensions.EXT_packed_depth_stencil) {
+ /* we support always support GL_EXT_framebuffer_blit */
+ ctx->Extensions.ARB_framebuffer_object = GL_TRUE;
+ }
+
+ if (st->pipe->render_condition) {
+ ctx->Extensions.NV_conditional_render = GL_TRUE;
+ }
+
+ if (screen->get_param(screen, PIPE_CAP_INDEP_BLEND_ENABLE)) {
+ ctx->Extensions.EXT_draw_buffers2 = GL_TRUE;
+ }
+
+ if (screen->get_param(screen, PIPE_CAP_INDEP_BLEND_FUNC)) {
+ ctx->Extensions.ARB_draw_buffers_blend = GL_TRUE;
+ }
+
+ /* GL_ARB_half_float_vertex */
+ if (screen->is_format_supported(screen, PIPE_FORMAT_R16G16B16A16_FLOAT,
+ PIPE_BUFFER, 0,
+ PIPE_BIND_VERTEX_BUFFER)) {
+ ctx->Extensions.ARB_half_float_vertex = GL_TRUE;
+ }
+
+ if (screen->is_format_supported(screen, PIPE_FORMAT_R32G32B32A32_FIXED,
+ PIPE_BUFFER, 0,
+ PIPE_BIND_VERTEX_BUFFER)) {
+ ctx->Extensions.ARB_ES2_compatibility = GL_TRUE;
+ }
+
+ if (screen->get_shader_param(screen, PIPE_SHADER_GEOMETRY, PIPE_SHADER_CAP_MAX_INSTRUCTIONS) > 0) {
+#if 0 /* XXX re-enable when GLSL compiler again supports geometry shaders */
+ ctx->Extensions.ARB_geometry_shader4 = GL_TRUE;
+#endif
+ }
+
+ if (screen->get_param(screen, PIPE_CAP_PRIMITIVE_RESTART)) {
+ ctx->Extensions.NV_primitive_restart = GL_TRUE;
+ }
+
+ if (screen->get_param(screen, PIPE_CAP_DEPTH_CLAMP)) {
+ ctx->Extensions.ARB_depth_clamp = GL_TRUE;
+ }
+
+ /* This extension does not actually require support of floating point
+ * render targets, just clamping controls.
+ * Advertise this extension if either fragment color clamping is supported
+ * or no render targets having color values outside of the range [0, 1]
+ * are supported, in which case the fragment color clamping has no effect
+ * on rendering.
+ */
+ if (screen->get_param(screen, PIPE_CAP_FRAGMENT_COLOR_CLAMP_CONTROL) ||
+ (!screen->is_format_supported(screen, PIPE_FORMAT_R8G8B8A8_SNORM,
+ PIPE_TEXTURE_2D, 0,
+ PIPE_BIND_RENDER_TARGET) &&
+ !screen->is_format_supported(screen, PIPE_FORMAT_R16G16B16A16_SNORM,
+ PIPE_TEXTURE_2D, 0,
+ PIPE_BIND_RENDER_TARGET) &&
+ !screen->is_format_supported(screen, PIPE_FORMAT_R16G16B16A16_FLOAT,
+ PIPE_TEXTURE_2D, 0,
+ PIPE_BIND_RENDER_TARGET) &&
+ !screen->is_format_supported(screen, PIPE_FORMAT_R32G32B32A32_FLOAT,
+ PIPE_TEXTURE_2D, 0,
+ PIPE_BIND_RENDER_TARGET) &&
+ !screen->is_format_supported(screen, PIPE_FORMAT_R11G11B10_FLOAT,
+ PIPE_TEXTURE_2D, 0,
+ PIPE_BIND_RENDER_TARGET) &&
+ !screen->is_format_supported(screen, PIPE_FORMAT_R9G9B9E5_FLOAT,
+ PIPE_TEXTURE_2D, 0,
+ PIPE_BIND_RENDER_TARGET))) {
+ ctx->Extensions.ARB_color_buffer_float = GL_TRUE;
+ }
+
+ if (screen->get_param(screen, PIPE_CAP_SHADER_STENCIL_EXPORT)) {
+ ctx->Extensions.ARB_shader_stencil_export = GL_TRUE;
+ }
+
+ if (screen->get_param(screen, PIPE_CAP_TGSI_INSTANCEID)) {
+ ctx->Extensions.ARB_draw_instanced = GL_TRUE;
+ }
+ if (screen->get_param(screen, PIPE_CAP_VERTEX_ELEMENT_INSTANCE_DIVISOR)) {
+ ctx->Extensions.ARB_instanced_arrays = GL_TRUE;
+ }
+
+ if (screen->fence_finish) {
+ ctx->Extensions.ARB_sync = GL_TRUE;
+ }
+
+ if (st->pipe->texture_barrier) {
+ ctx->Extensions.NV_texture_barrier = GL_TRUE;
+ }
+
+ if (screen->is_format_supported(screen, PIPE_FORMAT_R9G9B9E5_FLOAT,
+ PIPE_TEXTURE_2D, 0,
+ PIPE_BIND_SAMPLER_VIEW)) {
+ ctx->Extensions.EXT_texture_shared_exponent = GL_TRUE;
+ }
+
+ if (screen->is_format_supported(screen, PIPE_FORMAT_R11G11B10_FLOAT,
+ PIPE_TEXTURE_2D, 0,
+ PIPE_BIND_RENDER_TARGET |
+ PIPE_BIND_SAMPLER_VIEW)) {
+ ctx->Extensions.EXT_packed_float = GL_TRUE;
+ }
+
+ if (screen->get_param(screen, PIPE_CAP_SEAMLESS_CUBE_MAP_PER_TEXTURE)) {
+ ctx->Extensions.ARB_seamless_cube_map = GL_TRUE;
+ ctx->Extensions.AMD_seamless_cubemap_per_texture = GL_TRUE;
+ }
+ else if (screen->get_param(screen, PIPE_CAP_SEAMLESS_CUBE_MAP)) {
+ ctx->Extensions.ARB_seamless_cube_map = GL_TRUE;
+ }
+
+ if (screen->get_param(screen, PIPE_CAP_SM3)) {
+ ctx->Extensions.ARB_shader_texture_lod = GL_TRUE;
+ }
+}
diff --git a/mesalib/src/mesa/state_tracker/st_format.h b/mesalib/src/mesa/state_tracker/st_format.h
index 0fb570f6e..d31e60711 100644
--- a/mesalib/src/mesa/state_tracker/st_format.h
+++ b/mesalib/src/mesa/state_tracker/st_format.h
@@ -1,86 +1,86 @@
-/**************************************************************************
- *
- * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas.
- * Copyright (c) 2010 VMware, Inc.
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sub license, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice (including the
- * next paragraph) shall be included in all copies or substantial portions
- * of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
- * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
- * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- **************************************************************************/
-
-
-#ifndef ST_FORMAT_H
-#define ST_FORMAT_H
-
-#include "main/formats.h"
-#include "main/glheader.h"
-
-#include "pipe/p_defines.h"
-#include "pipe/p_format.h"
-
-struct gl_context;
-struct pipe_screen;
-
-extern GLenum
-st_format_datatype(enum pipe_format format);
-
-
-extern enum pipe_format
-st_mesa_format_to_pipe_format(gl_format mesaFormat);
-
-extern gl_format
-st_pipe_format_to_mesa_format(enum pipe_format pipeFormat);
-
-
-extern enum pipe_format
-st_choose_format(struct pipe_screen *screen, GLenum internalFormat,
- enum pipe_texture_target target, unsigned sample_count,
- unsigned tex_usage);
-
-extern enum pipe_format
-st_choose_renderbuffer_format(struct pipe_screen *screen,
- GLenum internalFormat, unsigned sample_count);
-
-
-gl_format
-st_ChooseTextureFormat_renderable(struct gl_context *ctx, GLint internalFormat,
- GLenum format, GLenum type, GLboolean renderable);
-
-extern gl_format
-st_ChooseTextureFormat(struct gl_context * ctx, GLint internalFormat,
- GLenum format, GLenum type);
-
-
-extern GLboolean
-st_equal_formats(enum pipe_format pFormat, GLenum format, GLenum type);
-
-/* can we use a sampler view to translate these formats
- only used to make TFP so far */
-extern GLboolean
-st_sampler_compat_formats(enum pipe_format format1, enum pipe_format format2);
-
-
-extern void
-st_translate_color(const GLfloat colorIn[4], GLenum baseFormat,
- GLfloat colorOut[4]);
-
-
-#endif /* ST_FORMAT_H */
+/**************************************************************************
+ *
+ * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas.
+ * Copyright (c) 2010 VMware, Inc.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ **************************************************************************/
+
+
+#ifndef ST_FORMAT_H
+#define ST_FORMAT_H
+
+#include "main/formats.h"
+#include "main/glheader.h"
+
+#include "pipe/p_defines.h"
+#include "pipe/p_format.h"
+
+struct gl_context;
+struct pipe_screen;
+
+extern GLenum
+st_format_datatype(enum pipe_format format);
+
+
+extern enum pipe_format
+st_mesa_format_to_pipe_format(gl_format mesaFormat);
+
+extern gl_format
+st_pipe_format_to_mesa_format(enum pipe_format pipeFormat);
+
+
+extern enum pipe_format
+st_choose_format(struct pipe_screen *screen, GLenum internalFormat,
+ enum pipe_texture_target target, unsigned sample_count,
+ unsigned tex_usage);
+
+extern enum pipe_format
+st_choose_renderbuffer_format(struct pipe_screen *screen,
+ GLenum internalFormat, unsigned sample_count);
+
+
+gl_format
+st_ChooseTextureFormat_renderable(struct gl_context *ctx, GLint internalFormat,
+ GLenum format, GLenum type, GLboolean renderable);
+
+extern gl_format
+st_ChooseTextureFormat(struct gl_context * ctx, GLint internalFormat,
+ GLenum format, GLenum type);
+
+
+extern GLboolean
+st_equal_formats(enum pipe_format pFormat, GLenum format, GLenum type);
+
+/* can we use a sampler view to translate these formats
+ only used to make TFP so far */
+extern GLboolean
+st_sampler_compat_formats(enum pipe_format format1, enum pipe_format format2);
+
+
+extern void
+st_translate_color(const GLfloat colorIn[4], GLenum baseFormat,
+ GLfloat colorOut[4]);
+
+
+#endif /* ST_FORMAT_H */
diff --git a/mesalib/src/mesa/state_tracker/st_mesa_to_tgsi.c b/mesalib/src/mesa/state_tracker/st_mesa_to_tgsi.c
index a41e5b16a..535bf0c66 100644
--- a/mesalib/src/mesa/state_tracker/st_mesa_to_tgsi.c
+++ b/mesalib/src/mesa/state_tracker/st_mesa_to_tgsi.c
@@ -1,1281 +1,1281 @@
-/**************************************************************************
- *
- * Copyright 2007-2008 Tungsten Graphics, Inc., Cedar Park, Texas.
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sub license, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice (including the
- * next paragraph) shall be included in all copies or substantial portions
- * of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
- * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
- * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- **************************************************************************/
-
-/*
- * \author
- * Michal Krol,
- * Keith Whitwell
- */
-
-#include "pipe/p_compiler.h"
-#include "pipe/p_context.h"
-#include "pipe/p_screen.h"
-#include "pipe/p_shader_tokens.h"
-#include "pipe/p_state.h"
-#include "tgsi/tgsi_ureg.h"
-#include "st_mesa_to_tgsi.h"
-#include "st_context.h"
-#include "program/prog_instruction.h"
-#include "program/prog_parameter.h"
-#include "util/u_debug.h"
-#include "util/u_math.h"
-#include "util/u_memory.h"
-
-
-#define PROGRAM_ANY_CONST ((1 << PROGRAM_LOCAL_PARAM) | \
- (1 << PROGRAM_ENV_PARAM) | \
- (1 << PROGRAM_STATE_VAR) | \
- (1 << PROGRAM_NAMED_PARAM) | \
- (1 << PROGRAM_CONSTANT) | \
- (1 << PROGRAM_UNIFORM))
-
-
-struct label {
- unsigned branch_target;
- unsigned token;
-};
-
-
-/**
- * Intermediate state used during shader translation.
- */
-struct st_translate {
- struct ureg_program *ureg;
-
- struct ureg_dst temps[MAX_PROGRAM_TEMPS];
- struct ureg_src *constants;
- struct ureg_dst outputs[PIPE_MAX_SHADER_OUTPUTS];
- struct ureg_src inputs[PIPE_MAX_SHADER_INPUTS];
- struct ureg_dst address[1];
- struct ureg_src samplers[PIPE_MAX_SAMPLERS];
- struct ureg_src systemValues[SYSTEM_VALUE_MAX];
-
- /* Extra info for handling point size clamping in vertex shader */
- struct ureg_dst pointSizeResult; /**< Actual point size output register */
- struct ureg_src pointSizeConst; /**< Point size range constant register */
- GLint pointSizeOutIndex; /**< Temp point size output register */
- GLboolean prevInstWrotePointSize;
-
- const GLuint *inputMapping;
- const GLuint *outputMapping;
-
- /* For every instruction that contains a label (eg CALL), keep
- * details so that we can go back afterwards and emit the correct
- * tgsi instruction number for each label.
- */
- struct label *labels;
- unsigned labels_size;
- unsigned labels_count;
-
- /* Keep a record of the tgsi instruction number that each mesa
- * instruction starts at, will be used to fix up labels after
- * translation.
- */
- unsigned *insn;
- unsigned insn_size;
- unsigned insn_count;
-
- unsigned procType; /**< TGSI_PROCESSOR_VERTEX/FRAGMENT */
-
- boolean error;
-};
-
-
-/** Map Mesa's SYSTEM_VALUE_x to TGSI_SEMANTIC_x */
-static unsigned mesa_sysval_to_semantic[SYSTEM_VALUE_MAX] = {
- TGSI_SEMANTIC_FACE,
- TGSI_SEMANTIC_INSTANCEID
-};
-
-
-/**
- * Make note of a branch to a label in the TGSI code.
- * After we've emitted all instructions, we'll go over the list
- * of labels built here and patch the TGSI code with the actual
- * location of each label.
- */
-static unsigned *get_label( struct st_translate *t,
- unsigned branch_target )
-{
- unsigned i;
-
- if (t->labels_count + 1 >= t->labels_size) {
- unsigned old_size = t->labels_size;
- t->labels_size = 1 << (util_logbase2(t->labels_size) + 1);
- t->labels = REALLOC( t->labels,
- old_size * sizeof t->labels[0],
- t->labels_size * sizeof t->labels[0] );
- if (t->labels == NULL) {
- static unsigned dummy;
- t->error = TRUE;
- return &dummy;
- }
- }
-
- i = t->labels_count++;
- t->labels[i].branch_target = branch_target;
- return &t->labels[i].token;
-}
-
-
-/**
- * Called prior to emitting the TGSI code for each Mesa instruction.
- * Allocate additional space for instructions if needed.
- * Update the insn[] array so the next Mesa instruction points to
- * the next TGSI instruction.
- */
-static void set_insn_start( struct st_translate *t,
- unsigned start )
-{
- if (t->insn_count + 1 >= t->insn_size) {
- unsigned old_size = t->insn_size;
- t->insn_size = 1 << (util_logbase2(t->insn_size) + 1);
- t->insn = REALLOC( t->insn,
- old_size * sizeof t->insn[0],
- t->insn_size * sizeof t->insn[0] );
- if (t->insn == NULL) {
- t->error = TRUE;
- return;
- }
- }
-
- t->insn[t->insn_count++] = start;
-}
-
-
-/**
- * Map a Mesa dst register to a TGSI ureg_dst register.
- */
-static struct ureg_dst
-dst_register( struct st_translate *t,
- gl_register_file file,
- GLuint index )
-{
- switch( file ) {
- case PROGRAM_UNDEFINED:
- return ureg_dst_undef();
-
- case PROGRAM_TEMPORARY:
- if (ureg_dst_is_undef(t->temps[index]))
- t->temps[index] = ureg_DECL_temporary( t->ureg );
-
- return t->temps[index];
-
- case PROGRAM_OUTPUT:
- if (t->procType == TGSI_PROCESSOR_VERTEX && index == VERT_RESULT_PSIZ)
- t->prevInstWrotePointSize = GL_TRUE;
-
- if (t->procType == TGSI_PROCESSOR_VERTEX)
- assert(index < VERT_RESULT_MAX);
- else if (t->procType == TGSI_PROCESSOR_FRAGMENT)
- assert(index < FRAG_RESULT_MAX);
- else
- assert(index < GEOM_RESULT_MAX);
-
- assert(t->outputMapping[index] < Elements(t->outputs));
-
- return t->outputs[t->outputMapping[index]];
-
- case PROGRAM_ADDRESS:
- return t->address[index];
-
- default:
- debug_assert( 0 );
- return ureg_dst_undef();
- }
-}
-
-
-/**
- * Map a Mesa src register to a TGSI ureg_src register.
- */
-static struct ureg_src
-src_register( struct st_translate *t,
- gl_register_file file,
- GLint index )
-{
- switch( file ) {
- case PROGRAM_UNDEFINED:
- return ureg_src_undef();
-
- case PROGRAM_TEMPORARY:
- assert(index >= 0);
- assert(index < Elements(t->temps));
- if (ureg_dst_is_undef(t->temps[index]))
- t->temps[index] = ureg_DECL_temporary( t->ureg );
- return ureg_src(t->temps[index]);
-
- case PROGRAM_NAMED_PARAM:
- case PROGRAM_ENV_PARAM:
- case PROGRAM_LOCAL_PARAM:
- case PROGRAM_UNIFORM:
- assert(index >= 0);
- return t->constants[index];
- case PROGRAM_STATE_VAR:
- case PROGRAM_CONSTANT: /* ie, immediate */
- if (index < 0)
- return ureg_DECL_constant( t->ureg, 0 );
- else
- return t->constants[index];
-
- case PROGRAM_INPUT:
- assert(t->inputMapping[index] < Elements(t->inputs));
- return t->inputs[t->inputMapping[index]];
-
- case PROGRAM_OUTPUT:
- assert(t->outputMapping[index] < Elements(t->outputs));
- return ureg_src(t->outputs[t->outputMapping[index]]); /* not needed? */
-
- case PROGRAM_ADDRESS:
- return ureg_src(t->address[index]);
-
- case PROGRAM_SYSTEM_VALUE:
- assert(index < Elements(t->systemValues));
- return t->systemValues[index];
-
- default:
- debug_assert( 0 );
- return ureg_src_undef();
- }
-}
-
-
-/**
- * Map mesa texture target to TGSI texture target.
- */
-static unsigned
-translate_texture_target( GLuint textarget,
- GLboolean shadow )
-{
- if (shadow) {
- switch( textarget ) {
- case TEXTURE_1D_INDEX: return TGSI_TEXTURE_SHADOW1D;
- case TEXTURE_2D_INDEX: return TGSI_TEXTURE_SHADOW2D;
- case TEXTURE_RECT_INDEX: return TGSI_TEXTURE_SHADOWRECT;
- default: break;
- }
- }
-
- switch( textarget ) {
- case TEXTURE_1D_INDEX: return TGSI_TEXTURE_1D;
- case TEXTURE_2D_INDEX: return TGSI_TEXTURE_2D;
- case TEXTURE_3D_INDEX: return TGSI_TEXTURE_3D;
- case TEXTURE_CUBE_INDEX: return TGSI_TEXTURE_CUBE;
- case TEXTURE_RECT_INDEX: return TGSI_TEXTURE_RECT;
- case TEXTURE_1D_ARRAY_INDEX: return TGSI_TEXTURE_1D_ARRAY;
- case TEXTURE_2D_ARRAY_INDEX: return TGSI_TEXTURE_2D_ARRAY;
- default:
- debug_assert( 0 );
- return TGSI_TEXTURE_1D;
- }
-}
-
-
-/**
- * Create a TGSI ureg_dst register from a Mesa dest register.
- */
-static struct ureg_dst
-translate_dst( struct st_translate *t,
- const struct prog_dst_register *DstReg,
- boolean saturate )
-{
- struct ureg_dst dst = dst_register( t,
- DstReg->File,
- DstReg->Index );
-
- dst = ureg_writemask( dst,
- DstReg->WriteMask );
-
- if (saturate)
- dst = ureg_saturate( dst );
-
- if (DstReg->RelAddr)
- dst = ureg_dst_indirect( dst, ureg_src(t->address[0]) );
-
- return dst;
-}
-
-
-/**
- * Create a TGSI ureg_src register from a Mesa src register.
- */
-static struct ureg_src
-translate_src( struct st_translate *t,
- const struct prog_src_register *SrcReg )
-{
- struct ureg_src src = src_register( t, SrcReg->File, SrcReg->Index );
-
- if (t->procType == TGSI_PROCESSOR_GEOMETRY && SrcReg->HasIndex2) {
- src = src_register( t, SrcReg->File, SrcReg->Index2 );
- if (SrcReg->RelAddr2)
- src = ureg_src_dimension_indirect( src, ureg_src(t->address[0]),
- SrcReg->Index);
- else
- src = ureg_src_dimension( src, SrcReg->Index);
- }
-
- src = ureg_swizzle( src,
- GET_SWZ( SrcReg->Swizzle, 0 ) & 0x3,
- GET_SWZ( SrcReg->Swizzle, 1 ) & 0x3,
- GET_SWZ( SrcReg->Swizzle, 2 ) & 0x3,
- GET_SWZ( SrcReg->Swizzle, 3 ) & 0x3);
-
- if (SrcReg->Negate == NEGATE_XYZW)
- src = ureg_negate(src);
-
- if (SrcReg->Abs)
- src = ureg_abs(src);
-
- if (SrcReg->RelAddr) {
- src = ureg_src_indirect( src, ureg_src(t->address[0]));
- if (SrcReg->File != PROGRAM_INPUT &&
- SrcReg->File != PROGRAM_OUTPUT) {
- /* If SrcReg->Index was negative, it was set to zero in
- * src_register(). Reassign it now. But don't do this
- * for input/output regs since they get remapped while
- * const buffers don't.
- */
- src.Index = SrcReg->Index;
- }
- }
-
- return src;
-}
-
-
-static struct ureg_src swizzle_4v( struct ureg_src src,
- const unsigned *swz )
-{
- return ureg_swizzle( src, swz[0], swz[1], swz[2], swz[3] );
-}
-
-
-/**
- * Translate a SWZ instruction into a MOV, MUL or MAD instruction. EG:
- *
- * SWZ dst, src.x-y10
- *
- * becomes:
- *
- * MAD dst {1,-1,0,0}, src.xyxx, {0,0,1,0}
- */
-static void emit_swz( struct st_translate *t,
- struct ureg_dst dst,
- const struct prog_src_register *SrcReg )
-{
- struct ureg_program *ureg = t->ureg;
- struct ureg_src src = src_register( t, SrcReg->File, SrcReg->Index );
-
- unsigned negate_mask = SrcReg->Negate;
-
- unsigned one_mask = ((GET_SWZ(SrcReg->Swizzle, 0) == SWIZZLE_ONE) << 0 |
- (GET_SWZ(SrcReg->Swizzle, 1) == SWIZZLE_ONE) << 1 |
- (GET_SWZ(SrcReg->Swizzle, 2) == SWIZZLE_ONE) << 2 |
- (GET_SWZ(SrcReg->Swizzle, 3) == SWIZZLE_ONE) << 3);
-
- unsigned zero_mask = ((GET_SWZ(SrcReg->Swizzle, 0) == SWIZZLE_ZERO) << 0 |
- (GET_SWZ(SrcReg->Swizzle, 1) == SWIZZLE_ZERO) << 1 |
- (GET_SWZ(SrcReg->Swizzle, 2) == SWIZZLE_ZERO) << 2 |
- (GET_SWZ(SrcReg->Swizzle, 3) == SWIZZLE_ZERO) << 3);
-
- unsigned negative_one_mask = one_mask & negate_mask;
- unsigned positive_one_mask = one_mask & ~negate_mask;
-
- struct ureg_src imm;
- unsigned i;
- unsigned mul_swizzle[4] = {0,0,0,0};
- unsigned add_swizzle[4] = {0,0,0,0};
- unsigned src_swizzle[4] = {0,0,0,0};
- boolean need_add = FALSE;
- boolean need_mul = FALSE;
-
- if (dst.WriteMask == 0)
- return;
-
- /* Is this just a MOV?
- */
- if (zero_mask == 0 &&
- one_mask == 0 &&
- (negate_mask == 0 || negate_mask == TGSI_WRITEMASK_XYZW))
- {
- ureg_MOV( ureg, dst, translate_src( t, SrcReg ));
- return;
- }
-
-#define IMM_ZERO 0
-#define IMM_ONE 1
-#define IMM_NEG_ONE 2
-
- imm = ureg_imm3f( ureg, 0, 1, -1 );
-
- for (i = 0; i < 4; i++) {
- unsigned bit = 1 << i;
-
- if (dst.WriteMask & bit) {
- if (positive_one_mask & bit) {
- mul_swizzle[i] = IMM_ZERO;
- add_swizzle[i] = IMM_ONE;
- need_add = TRUE;
- }
- else if (negative_one_mask & bit) {
- mul_swizzle[i] = IMM_ZERO;
- add_swizzle[i] = IMM_NEG_ONE;
- need_add = TRUE;
- }
- else if (zero_mask & bit) {
- mul_swizzle[i] = IMM_ZERO;
- add_swizzle[i] = IMM_ZERO;
- need_add = TRUE;
- }
- else {
- add_swizzle[i] = IMM_ZERO;
- src_swizzle[i] = GET_SWZ(SrcReg->Swizzle, i);
- need_mul = TRUE;
- if (negate_mask & bit) {
- mul_swizzle[i] = IMM_NEG_ONE;
- }
- else {
- mul_swizzle[i] = IMM_ONE;
- }
- }
- }
- }
-
- if (need_mul && need_add) {
- ureg_MAD( ureg,
- dst,
- swizzle_4v( src, src_swizzle ),
- swizzle_4v( imm, mul_swizzle ),
- swizzle_4v( imm, add_swizzle ) );
- }
- else if (need_mul) {
- ureg_MUL( ureg,
- dst,
- swizzle_4v( src, src_swizzle ),
- swizzle_4v( imm, mul_swizzle ) );
- }
- else if (need_add) {
- ureg_MOV( ureg,
- dst,
- swizzle_4v( imm, add_swizzle ) );
- }
- else {
- debug_assert(0);
- }
-
-#undef IMM_ZERO
-#undef IMM_ONE
-#undef IMM_NEG_ONE
-}
-
-
-/**
- * Negate the value of DDY to match GL semantics where (0,0) is the
- * lower-left corner of the window.
- * Note that the GL_ARB_fragment_coord_conventions extension will
- * effect this someday.
- */
-static void emit_ddy( struct st_translate *t,
- struct ureg_dst dst,
- const struct prog_src_register *SrcReg )
-{
- struct ureg_program *ureg = t->ureg;
- struct ureg_src src = translate_src( t, SrcReg );
- src = ureg_negate( src );
- ureg_DDY( ureg, dst, src );
-}
-
-
-
-static unsigned
-translate_opcode( unsigned op )
-{
- switch( op ) {
- case OPCODE_ARL:
- return TGSI_OPCODE_ARL;
- case OPCODE_ABS:
- return TGSI_OPCODE_ABS;
- case OPCODE_ADD:
- return TGSI_OPCODE_ADD;
- case OPCODE_BGNLOOP:
- return TGSI_OPCODE_BGNLOOP;
- case OPCODE_BGNSUB:
- return TGSI_OPCODE_BGNSUB;
- case OPCODE_BRA:
- return TGSI_OPCODE_BRA;
- case OPCODE_BRK:
- return TGSI_OPCODE_BRK;
- case OPCODE_CAL:
- return TGSI_OPCODE_CAL;
- case OPCODE_CMP:
- return TGSI_OPCODE_CMP;
- case OPCODE_CONT:
- return TGSI_OPCODE_CONT;
- case OPCODE_COS:
- return TGSI_OPCODE_COS;
- case OPCODE_DDX:
- return TGSI_OPCODE_DDX;
- case OPCODE_DDY:
- return TGSI_OPCODE_DDY;
- case OPCODE_DP2:
- return TGSI_OPCODE_DP2;
- case OPCODE_DP2A:
- return TGSI_OPCODE_DP2A;
- case OPCODE_DP3:
- return TGSI_OPCODE_DP3;
- case OPCODE_DP4:
- return TGSI_OPCODE_DP4;
- case OPCODE_DPH:
- return TGSI_OPCODE_DPH;
- case OPCODE_DST:
- return TGSI_OPCODE_DST;
- case OPCODE_ELSE:
- return TGSI_OPCODE_ELSE;
- case OPCODE_EMIT_VERTEX:
- return TGSI_OPCODE_EMIT;
- case OPCODE_END_PRIMITIVE:
- return TGSI_OPCODE_ENDPRIM;
- case OPCODE_ENDIF:
- return TGSI_OPCODE_ENDIF;
- case OPCODE_ENDLOOP:
- return TGSI_OPCODE_ENDLOOP;
- case OPCODE_ENDSUB:
- return TGSI_OPCODE_ENDSUB;
- case OPCODE_EX2:
- return TGSI_OPCODE_EX2;
- case OPCODE_EXP:
- return TGSI_OPCODE_EXP;
- case OPCODE_FLR:
- return TGSI_OPCODE_FLR;
- case OPCODE_FRC:
- return TGSI_OPCODE_FRC;
- case OPCODE_IF:
- return TGSI_OPCODE_IF;
- case OPCODE_TRUNC:
- return TGSI_OPCODE_TRUNC;
- case OPCODE_KIL:
- return TGSI_OPCODE_KIL;
- case OPCODE_KIL_NV:
- return TGSI_OPCODE_KILP;
- case OPCODE_LG2:
- return TGSI_OPCODE_LG2;
- case OPCODE_LOG:
- return TGSI_OPCODE_LOG;
- case OPCODE_LIT:
- return TGSI_OPCODE_LIT;
- case OPCODE_LRP:
- return TGSI_OPCODE_LRP;
- case OPCODE_MAD:
- return TGSI_OPCODE_MAD;
- case OPCODE_MAX:
- return TGSI_OPCODE_MAX;
- case OPCODE_MIN:
- return TGSI_OPCODE_MIN;
- case OPCODE_MOV:
- return TGSI_OPCODE_MOV;
- case OPCODE_MUL:
- return TGSI_OPCODE_MUL;
- case OPCODE_NOP:
- return TGSI_OPCODE_NOP;
- case OPCODE_NRM3:
- return TGSI_OPCODE_NRM;
- case OPCODE_NRM4:
- return TGSI_OPCODE_NRM4;
- case OPCODE_POW:
- return TGSI_OPCODE_POW;
- case OPCODE_RCP:
- return TGSI_OPCODE_RCP;
- case OPCODE_RET:
- return TGSI_OPCODE_RET;
- case OPCODE_RSQ:
- return TGSI_OPCODE_RSQ;
- case OPCODE_SCS:
- return TGSI_OPCODE_SCS;
- case OPCODE_SEQ:
- return TGSI_OPCODE_SEQ;
- case OPCODE_SGE:
- return TGSI_OPCODE_SGE;
- case OPCODE_SGT:
- return TGSI_OPCODE_SGT;
- case OPCODE_SIN:
- return TGSI_OPCODE_SIN;
- case OPCODE_SLE:
- return TGSI_OPCODE_SLE;
- case OPCODE_SLT:
- return TGSI_OPCODE_SLT;
- case OPCODE_SNE:
- return TGSI_OPCODE_SNE;
- case OPCODE_SSG:
- return TGSI_OPCODE_SSG;
- case OPCODE_SUB:
- return TGSI_OPCODE_SUB;
- case OPCODE_TEX:
- return TGSI_OPCODE_TEX;
- case OPCODE_TXB:
- return TGSI_OPCODE_TXB;
- case OPCODE_TXD:
- return TGSI_OPCODE_TXD;
- case OPCODE_TXL:
- return TGSI_OPCODE_TXL;
- case OPCODE_TXP:
- return TGSI_OPCODE_TXP;
- case OPCODE_XPD:
- return TGSI_OPCODE_XPD;
- case OPCODE_END:
- return TGSI_OPCODE_END;
- default:
- debug_assert( 0 );
- return TGSI_OPCODE_NOP;
- }
-}
-
-
-static void
-compile_instruction(
- struct st_translate *t,
- const struct prog_instruction *inst )
-{
- struct ureg_program *ureg = t->ureg;
- GLuint i;
- struct ureg_dst dst[1];
- struct ureg_src src[4];
- unsigned num_dst;
- unsigned num_src;
-
- num_dst = _mesa_num_inst_dst_regs( inst->Opcode );
- num_src = _mesa_num_inst_src_regs( inst->Opcode );
-
- if (num_dst)
- dst[0] = translate_dst( t,
- &inst->DstReg,
- inst->SaturateMode );
-
- for (i = 0; i < num_src; i++)
- src[i] = translate_src( t, &inst->SrcReg[i] );
-
- switch( inst->Opcode ) {
- case OPCODE_SWZ:
- emit_swz( t, dst[0], &inst->SrcReg[0] );
- return;
-
- case OPCODE_BGNLOOP:
- case OPCODE_CAL:
- case OPCODE_ELSE:
- case OPCODE_ENDLOOP:
- case OPCODE_IF:
- debug_assert(num_dst == 0);
- ureg_label_insn( ureg,
- translate_opcode( inst->Opcode ),
- src, num_src,
- get_label( t, inst->BranchTarget ));
- return;
-
- case OPCODE_TEX:
- case OPCODE_TXB:
- case OPCODE_TXD:
- case OPCODE_TXL:
- case OPCODE_TXP:
- src[num_src++] = t->samplers[inst->TexSrcUnit];
- ureg_tex_insn( ureg,
- translate_opcode( inst->Opcode ),
- dst, num_dst,
- translate_texture_target( inst->TexSrcTarget,
- inst->TexShadow ),
- src, num_src );
- return;
-
- case OPCODE_SCS:
- dst[0] = ureg_writemask(dst[0], TGSI_WRITEMASK_XY );
- ureg_insn( ureg,
- translate_opcode( inst->Opcode ),
- dst, num_dst,
- src, num_src );
- break;
-
- case OPCODE_XPD:
- dst[0] = ureg_writemask(dst[0], TGSI_WRITEMASK_XYZ );
- ureg_insn( ureg,
- translate_opcode( inst->Opcode ),
- dst, num_dst,
- src, num_src );
- break;
-
- case OPCODE_NOISE1:
- case OPCODE_NOISE2:
- case OPCODE_NOISE3:
- case OPCODE_NOISE4:
- /* At some point, a motivated person could add a better
- * implementation of noise. Currently not even the nvidia
- * binary drivers do anything more than this. In any case, the
- * place to do this is in the GL state tracker, not the poor
- * driver.
- */
- ureg_MOV( ureg, dst[0], ureg_imm1f(ureg, 0.5) );
- break;
-
- case OPCODE_DDY:
- emit_ddy( t, dst[0], &inst->SrcReg[0] );
- break;
-
- default:
- ureg_insn( ureg,
- translate_opcode( inst->Opcode ),
- dst, num_dst,
- src, num_src );
- break;
- }
-}
-
-
-/**
- * Emit the TGSI instructions for inverting and adjusting WPOS.
- * This code is unavoidable because it also depends on whether
- * a FBO is bound (STATE_FB_WPOS_Y_TRANSFORM).
- */
-static void
-emit_wpos_adjustment( struct st_translate *t,
- const struct gl_program *program,
- boolean invert,
- GLfloat adjX, GLfloat adjY[2])
-{
- struct ureg_program *ureg = t->ureg;
-
- /* Fragment program uses fragment position input.
- * Need to replace instances of INPUT[WPOS] with temp T
- * where T = INPUT[WPOS] by y is inverted.
- */
- static const gl_state_index wposTransformState[STATE_LENGTH]
- = { STATE_INTERNAL, STATE_FB_WPOS_Y_TRANSFORM, 0, 0, 0 };
-
- /* XXX: note we are modifying the incoming shader here! Need to
- * do this before emitting the constant decls below, or this
- * will be missed:
- */
- unsigned wposTransConst = _mesa_add_state_reference(program->Parameters,
- wposTransformState);
-
- struct ureg_src wpostrans = ureg_DECL_constant( ureg, wposTransConst );
- struct ureg_dst wpos_temp = ureg_DECL_temporary( ureg );
- struct ureg_src wpos_input = t->inputs[t->inputMapping[FRAG_ATTRIB_WPOS]];
-
- /* First, apply the coordinate shift: */
- if (adjX || adjY[0] || adjY[1]) {
- if (adjY[0] != adjY[1]) {
- /* Adjust the y coordinate by adjY[1] or adjY[0] respectively
- * depending on whether inversion is actually going to be applied
- * or not, which is determined by testing against the inversion
- * state variable used below, which will be either +1 or -1.
- */
- struct ureg_dst adj_temp = ureg_DECL_temporary(ureg);
-
- ureg_CMP(ureg, adj_temp,
- ureg_scalar(wpostrans, invert ? 2 : 0),
- ureg_imm4f(ureg, adjX, adjY[0], 0.0f, 0.0f),
- ureg_imm4f(ureg, adjX, adjY[1], 0.0f, 0.0f));
- ureg_ADD(ureg, wpos_temp, wpos_input, ureg_src(adj_temp));
- } else {
- ureg_ADD(ureg, wpos_temp, wpos_input,
- ureg_imm4f(ureg, adjX, adjY[0], 0.0f, 0.0f));
- }
- wpos_input = ureg_src(wpos_temp);
- } else {
- /* MOV wpos_temp, input[wpos]
- */
- ureg_MOV( ureg, wpos_temp, wpos_input );
- }
-
- /* Now the conditional y flip: STATE_FB_WPOS_Y_TRANSFORM.xy/zw will be
- * inversion/identity, or the other way around if we're drawing to an FBO.
- */
- if (invert) {
- /* MAD wpos_temp.y, wpos_input, wpostrans.xxxx, wpostrans.yyyy
- */
- ureg_MAD( ureg,
- ureg_writemask(wpos_temp, TGSI_WRITEMASK_Y ),
- wpos_input,
- ureg_scalar(wpostrans, 0),
- ureg_scalar(wpostrans, 1));
- } else {
- /* MAD wpos_temp.y, wpos_input, wpostrans.zzzz, wpostrans.wwww
- */
- ureg_MAD( ureg,
- ureg_writemask(wpos_temp, TGSI_WRITEMASK_Y ),
- wpos_input,
- ureg_scalar(wpostrans, 2),
- ureg_scalar(wpostrans, 3));
- }
-
- /* Use wpos_temp as position input from here on:
- */
- t->inputs[t->inputMapping[FRAG_ATTRIB_WPOS]] = ureg_src(wpos_temp);
-}
-
-
-/**
- * Emit fragment position/ooordinate code.
- */
-static void
-emit_wpos(struct st_context *st,
- struct st_translate *t,
- const struct gl_program *program,
- struct ureg_program *ureg)
-{
- const struct gl_fragment_program *fp =
- (const struct gl_fragment_program *) program;
- struct pipe_screen *pscreen = st->pipe->screen;
- GLfloat adjX = 0.0f;
- GLfloat adjY[2] = { 0.0f, 0.0f };
- boolean invert = FALSE;
-
- /* Query the pixel center conventions supported by the pipe driver and set
- * adjX, adjY to help out if it cannot handle the requested one internally.
- *
- * The bias of the y-coordinate depends on whether y-inversion takes place
- * (adjY[1]) or not (adjY[0]), which is in turn dependent on whether we are
- * drawing to an FBO (causes additional inversion), and whether the the pipe
- * driver origin and the requested origin differ (the latter condition is
- * stored in the 'invert' variable).
- *
- * For height = 100 (i = integer, h = half-integer, l = lower, u = upper):
- *
- * center shift only:
- * i -> h: +0.5
- * h -> i: -0.5
- *
- * inversion only:
- * l,i -> u,i: ( 0.0 + 1.0) * -1 + 100 = 99
- * l,h -> u,h: ( 0.5 + 0.0) * -1 + 100 = 99.5
- * u,i -> l,i: (99.0 + 1.0) * -1 + 100 = 0
- * u,h -> l,h: (99.5 + 0.0) * -1 + 100 = 0.5
- *
- * inversion and center shift:
- * l,i -> u,h: ( 0.0 + 0.5) * -1 + 100 = 99.5
- * l,h -> u,i: ( 0.5 + 0.5) * -1 + 100 = 99
- * u,i -> l,h: (99.0 + 0.5) * -1 + 100 = 0.5
- * u,h -> l,i: (99.5 + 0.5) * -1 + 100 = 0
- */
- if (fp->OriginUpperLeft) {
- /* Fragment shader wants origin in upper-left */
- if (pscreen->get_param(pscreen, PIPE_CAP_TGSI_FS_COORD_ORIGIN_UPPER_LEFT)) {
- /* the driver supports upper-left origin */
- }
- else if (pscreen->get_param(pscreen, PIPE_CAP_TGSI_FS_COORD_ORIGIN_LOWER_LEFT)) {
- /* the driver supports lower-left origin, need to invert Y */
- ureg_property_fs_coord_origin(ureg, TGSI_FS_COORD_ORIGIN_LOWER_LEFT);
- invert = TRUE;
- }
- else
- assert(0);
- }
- else {
- /* Fragment shader wants origin in lower-left */
- if (pscreen->get_param(pscreen, PIPE_CAP_TGSI_FS_COORD_ORIGIN_LOWER_LEFT))
- /* the driver supports lower-left origin */
- ureg_property_fs_coord_origin(ureg, TGSI_FS_COORD_ORIGIN_LOWER_LEFT);
- else if (pscreen->get_param(pscreen, PIPE_CAP_TGSI_FS_COORD_ORIGIN_UPPER_LEFT))
- /* the driver supports upper-left origin, need to invert Y */
- invert = TRUE;
- else
- assert(0);
- }
-
- if (fp->PixelCenterInteger) {
- /* Fragment shader wants pixel center integer */
- if (pscreen->get_param(pscreen, PIPE_CAP_TGSI_FS_COORD_PIXEL_CENTER_INTEGER)) {
- /* the driver supports pixel center integer */
- adjY[1] = 1.0f;
- ureg_property_fs_coord_pixel_center(ureg, TGSI_FS_COORD_PIXEL_CENTER_INTEGER);
- }
- else if (pscreen->get_param(pscreen, PIPE_CAP_TGSI_FS_COORD_PIXEL_CENTER_HALF_INTEGER)) {
- /* the driver supports pixel center half integer, need to bias X,Y */
- adjX = -0.5f;
- adjY[0] = -0.5f;
- adjY[1] = 0.5f;
- }
- else
- assert(0);
- }
- else {
- /* Fragment shader wants pixel center half integer */
- if (pscreen->get_param(pscreen, PIPE_CAP_TGSI_FS_COORD_PIXEL_CENTER_HALF_INTEGER)) {
- /* the driver supports pixel center half integer */
- }
- else if (pscreen->get_param(pscreen, PIPE_CAP_TGSI_FS_COORD_PIXEL_CENTER_INTEGER)) {
- /* the driver supports pixel center integer, need to bias X,Y */
- adjX = adjY[0] = adjY[1] = 0.5f;
- ureg_property_fs_coord_pixel_center(ureg, TGSI_FS_COORD_PIXEL_CENTER_INTEGER);
- }
- else
- assert(0);
- }
-
- /* we invert after adjustment so that we avoid the MOV to temporary,
- * and reuse the adjustment ADD instead */
- emit_wpos_adjustment(t, program, invert, adjX, adjY);
-}
-
-
-/**
- * OpenGL's fragment gl_FrontFace input is 1 for front-facing, 0 for back.
- * TGSI uses +1 for front, -1 for back.
- * This function converts the TGSI value to the GL value. Simply clamping/
- * saturating the value to [0,1] does the job.
- */
-static void
-emit_face_var( struct st_translate *t,
- const struct gl_program *program )
-{
- struct ureg_program *ureg = t->ureg;
- struct ureg_dst face_temp = ureg_DECL_temporary( ureg );
- struct ureg_src face_input = t->inputs[t->inputMapping[FRAG_ATTRIB_FACE]];
-
- /* MOV_SAT face_temp, input[face]
- */
- face_temp = ureg_saturate( face_temp );
- ureg_MOV( ureg, face_temp, face_input );
-
- /* Use face_temp as face input from here on:
- */
- t->inputs[t->inputMapping[FRAG_ATTRIB_FACE]] = ureg_src(face_temp);
-}
-
-
-static void
-emit_edgeflags( struct st_translate *t,
- const struct gl_program *program )
-{
- struct ureg_program *ureg = t->ureg;
- struct ureg_dst edge_dst = t->outputs[t->outputMapping[VERT_RESULT_EDGE]];
- struct ureg_src edge_src = t->inputs[t->inputMapping[VERT_ATTRIB_EDGEFLAG]];
-
- ureg_MOV( ureg, edge_dst, edge_src );
-}
-
-
-/**
- * Translate Mesa program to TGSI format.
- * \param program the program to translate
- * \param numInputs number of input registers used
- * \param inputMapping maps Mesa fragment program inputs to TGSI generic
- * input indexes
- * \param inputSemanticName the TGSI_SEMANTIC flag for each input
- * \param inputSemanticIndex the semantic index (ex: which texcoord) for
- * each input
- * \param interpMode the TGSI_INTERPOLATE_LINEAR/PERSP mode for each input
- * \param numOutputs number of output registers used
- * \param outputMapping maps Mesa fragment program outputs to TGSI
- * generic outputs
- * \param outputSemanticName the TGSI_SEMANTIC flag for each output
- * \param outputSemanticIndex the semantic index (ex: which texcoord) for
- * each output
- *
- * \return PIPE_OK or PIPE_ERROR_OUT_OF_MEMORY
- */
-enum pipe_error
-st_translate_mesa_program(
- struct gl_context *ctx,
- uint procType,
- struct ureg_program *ureg,
- const struct gl_program *program,
- GLuint numInputs,
- const GLuint inputMapping[],
- const ubyte inputSemanticName[],
- const ubyte inputSemanticIndex[],
- const GLuint interpMode[],
- GLuint numOutputs,
- const GLuint outputMapping[],
- const ubyte outputSemanticName[],
- const ubyte outputSemanticIndex[],
- boolean passthrough_edgeflags )
-{
- struct st_translate translate, *t;
- unsigned i;
- enum pipe_error ret = PIPE_OK;
-
- assert(numInputs <= Elements(t->inputs));
- assert(numOutputs <= Elements(t->outputs));
-
- t = &translate;
- memset(t, 0, sizeof *t);
-
- t->procType = procType;
- t->inputMapping = inputMapping;
- t->outputMapping = outputMapping;
- t->ureg = ureg;
- t->pointSizeOutIndex = -1;
- t->prevInstWrotePointSize = GL_FALSE;
-
- /*_mesa_print_program(program);*/
-
- /*
- * Declare input attributes.
- */
- if (procType == TGSI_PROCESSOR_FRAGMENT) {
- for (i = 0; i < numInputs; i++) {
- if (program->InputFlags[0] & PROG_PARAM_BIT_CYL_WRAP) {
- t->inputs[i] = ureg_DECL_fs_input_cyl(ureg,
- inputSemanticName[i],
- inputSemanticIndex[i],
- interpMode[i],
- TGSI_CYLINDRICAL_WRAP_X);
- }
- else {
- t->inputs[i] = ureg_DECL_fs_input(ureg,
- inputSemanticName[i],
- inputSemanticIndex[i],
- interpMode[i]);
- }
- }
-
- if (program->InputsRead & FRAG_BIT_WPOS) {
- /* Must do this after setting up t->inputs, and before
- * emitting constant references, below:
- */
- emit_wpos(st_context(ctx), t, program, ureg);
- }
-
- if (program->InputsRead & FRAG_BIT_FACE) {
- emit_face_var( t, program );
- }
-
- /*
- * Declare output attributes.
- */
- for (i = 0; i < numOutputs; i++) {
- switch (outputSemanticName[i]) {
- case TGSI_SEMANTIC_POSITION:
- t->outputs[i] = ureg_DECL_output( ureg,
- TGSI_SEMANTIC_POSITION, /* Z / Depth */
- outputSemanticIndex[i] );
-
- t->outputs[i] = ureg_writemask( t->outputs[i],
- TGSI_WRITEMASK_Z );
- break;
- case TGSI_SEMANTIC_STENCIL:
- t->outputs[i] = ureg_DECL_output( ureg,
- TGSI_SEMANTIC_STENCIL, /* Stencil */
- outputSemanticIndex[i] );
- t->outputs[i] = ureg_writemask( t->outputs[i],
- TGSI_WRITEMASK_Y );
- break;
- case TGSI_SEMANTIC_COLOR:
- t->outputs[i] = ureg_DECL_output( ureg,
- TGSI_SEMANTIC_COLOR,
- outputSemanticIndex[i] );
- break;
- default:
- debug_assert(0);
- return 0;
- }
- }
- }
- else if (procType == TGSI_PROCESSOR_GEOMETRY) {
- for (i = 0; i < numInputs; i++) {
- t->inputs[i] = ureg_DECL_gs_input(ureg,
- i,
- inputSemanticName[i],
- inputSemanticIndex[i]);
- }
-
- for (i = 0; i < numOutputs; i++) {
- t->outputs[i] = ureg_DECL_output( ureg,
- outputSemanticName[i],
- outputSemanticIndex[i] );
- }
- }
- else {
- assert(procType == TGSI_PROCESSOR_VERTEX);
-
- for (i = 0; i < numInputs; i++) {
- t->inputs[i] = ureg_DECL_vs_input(ureg, i);
- }
-
- for (i = 0; i < numOutputs; i++) {
- t->outputs[i] = ureg_DECL_output( ureg,
- outputSemanticName[i],
- outputSemanticIndex[i] );
- if ((outputSemanticName[i] == TGSI_SEMANTIC_PSIZE) && program->Id) {
- /* Writing to the point size result register requires special
- * handling to implement clamping.
- */
- static const gl_state_index pointSizeClampState[STATE_LENGTH]
- = { STATE_INTERNAL, STATE_POINT_SIZE_IMPL_CLAMP, 0, 0, 0 };
- /* XXX: note we are modifying the incoming shader here! Need to
- * do this before emitting the constant decls below, or this
- * will be missed:
- */
- unsigned pointSizeClampConst =
- _mesa_add_state_reference(program->Parameters,
- pointSizeClampState);
- struct ureg_dst psizregtemp = ureg_DECL_temporary( ureg );
- t->pointSizeConst = ureg_DECL_constant( ureg, pointSizeClampConst );
- t->pointSizeResult = t->outputs[i];
- t->pointSizeOutIndex = i;
- t->outputs[i] = psizregtemp;
- }
- }
- if (passthrough_edgeflags)
- emit_edgeflags( t, program );
- }
-
- /* Declare address register.
- */
- if (program->NumAddressRegs > 0) {
- debug_assert( program->NumAddressRegs == 1 );
- t->address[0] = ureg_DECL_address( ureg );
- }
-
- /* Declare misc input registers
- */
- {
- GLbitfield sysInputs = program->SystemValuesRead;
- unsigned numSys = 0;
- for (i = 0; sysInputs; i++) {
- if (sysInputs & (1 << i)) {
- unsigned semName = mesa_sysval_to_semantic[i];
- t->systemValues[i] = ureg_DECL_system_value(ureg, numSys, semName, 0);
- numSys++;
- sysInputs &= ~(1 << i);
- }
- }
- }
-
- if (program->IndirectRegisterFiles & (1 << PROGRAM_TEMPORARY)) {
- /* If temps are accessed with indirect addressing, declare temporaries
- * in sequential order. Else, we declare them on demand elsewhere.
- */
- for (i = 0; i < program->NumTemporaries; i++) {
- /* XXX use TGSI_FILE_TEMPORARY_ARRAY when it's supported by ureg */
- t->temps[i] = ureg_DECL_temporary( t->ureg );
- }
- }
-
- /* Emit constants and immediates. Mesa uses a single index space
- * for these, so we put all the translated regs in t->constants.
- */
- if (program->Parameters) {
- t->constants = CALLOC( program->Parameters->NumParameters,
- sizeof t->constants[0] );
- if (t->constants == NULL) {
- ret = PIPE_ERROR_OUT_OF_MEMORY;
- goto out;
- }
-
- for (i = 0; i < program->Parameters->NumParameters; i++) {
- switch (program->Parameters->Parameters[i].Type) {
- case PROGRAM_ENV_PARAM:
- case PROGRAM_LOCAL_PARAM:
- case PROGRAM_STATE_VAR:
- case PROGRAM_NAMED_PARAM:
- case PROGRAM_UNIFORM:
- t->constants[i] = ureg_DECL_constant( ureg, i );
- break;
-
- /* Emit immediates only when there's no indirect addressing of
- * the const buffer.
- * FIXME: Be smarter and recognize param arrays:
- * indirect addressing is only valid within the referenced
- * array.
- */
- case PROGRAM_CONSTANT:
- if (program->IndirectRegisterFiles & PROGRAM_ANY_CONST)
- t->constants[i] = ureg_DECL_constant( ureg, i );
- else
- t->constants[i] =
- ureg_DECL_immediate( ureg,
- program->Parameters->ParameterValues[i],
- 4 );
- break;
- default:
- break;
- }
- }
- }
-
- /* texture samplers */
- for (i = 0; i < ctx->Const.MaxTextureImageUnits; i++) {
- if (program->SamplersUsed & (1 << i)) {
- t->samplers[i] = ureg_DECL_sampler( ureg, i );
- }
- }
-
- /* Emit each instruction in turn:
- */
- for (i = 0; i < program->NumInstructions; i++) {
- set_insn_start( t, ureg_get_instruction_number( ureg ));
- compile_instruction( t, &program->Instructions[i] );
-
- if (t->prevInstWrotePointSize && program->Id) {
- /* The previous instruction wrote to the (fake) vertex point size
- * result register. Now we need to clamp that value to the min/max
- * point size range, putting the result into the real point size
- * register.
- * Note that we can't do this easily at the end of program due to
- * possible early return.
- */
- set_insn_start( t, ureg_get_instruction_number( ureg ));
- ureg_MAX( t->ureg,
- ureg_writemask(t->outputs[t->pointSizeOutIndex], WRITEMASK_X),
- ureg_src(t->outputs[t->pointSizeOutIndex]),
- ureg_swizzle(t->pointSizeConst, 1,1,1,1));
- ureg_MIN( t->ureg, ureg_writemask(t->pointSizeResult, WRITEMASK_X),
- ureg_src(t->outputs[t->pointSizeOutIndex]),
- ureg_swizzle(t->pointSizeConst, 2,2,2,2));
- }
- t->prevInstWrotePointSize = GL_FALSE;
- }
-
- /* Fix up all emitted labels:
- */
- for (i = 0; i < t->labels_count; i++) {
- ureg_fixup_label( ureg,
- t->labels[i].token,
- t->insn[t->labels[i].branch_target] );
- }
-
-out:
- FREE(t->insn);
- FREE(t->labels);
- FREE(t->constants);
-
- if (t->error) {
- debug_printf("%s: translate error flag set\n", __FUNCTION__);
- }
-
- return ret;
-}
-
-
-/**
- * Tokens cannot be free with free otherwise the builtin gallium
- * malloc debugging will get confused.
- */
-void
-st_free_tokens(const struct tgsi_token *tokens)
-{
- FREE((void *)tokens);
-}
+/**************************************************************************
+ *
+ * Copyright 2007-2008 Tungsten Graphics, Inc., Cedar Park, Texas.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ **************************************************************************/
+
+/*
+ * \author
+ * Michal Krol,
+ * Keith Whitwell
+ */
+
+#include "pipe/p_compiler.h"
+#include "pipe/p_context.h"
+#include "pipe/p_screen.h"
+#include "pipe/p_shader_tokens.h"
+#include "pipe/p_state.h"
+#include "tgsi/tgsi_ureg.h"
+#include "st_mesa_to_tgsi.h"
+#include "st_context.h"
+#include "program/prog_instruction.h"
+#include "program/prog_parameter.h"
+#include "util/u_debug.h"
+#include "util/u_math.h"
+#include "util/u_memory.h"
+
+
+#define PROGRAM_ANY_CONST ((1 << PROGRAM_LOCAL_PARAM) | \
+ (1 << PROGRAM_ENV_PARAM) | \
+ (1 << PROGRAM_STATE_VAR) | \
+ (1 << PROGRAM_NAMED_PARAM) | \
+ (1 << PROGRAM_CONSTANT) | \
+ (1 << PROGRAM_UNIFORM))
+
+
+struct label {
+ unsigned branch_target;
+ unsigned token;
+};
+
+
+/**
+ * Intermediate state used during shader translation.
+ */
+struct st_translate {
+ struct ureg_program *ureg;
+
+ struct ureg_dst temps[MAX_PROGRAM_TEMPS];
+ struct ureg_src *constants;
+ struct ureg_dst outputs[PIPE_MAX_SHADER_OUTPUTS];
+ struct ureg_src inputs[PIPE_MAX_SHADER_INPUTS];
+ struct ureg_dst address[1];
+ struct ureg_src samplers[PIPE_MAX_SAMPLERS];
+ struct ureg_src systemValues[SYSTEM_VALUE_MAX];
+
+ /* Extra info for handling point size clamping in vertex shader */
+ struct ureg_dst pointSizeResult; /**< Actual point size output register */
+ struct ureg_src pointSizeConst; /**< Point size range constant register */
+ GLint pointSizeOutIndex; /**< Temp point size output register */
+ GLboolean prevInstWrotePointSize;
+
+ const GLuint *inputMapping;
+ const GLuint *outputMapping;
+
+ /* For every instruction that contains a label (eg CALL), keep
+ * details so that we can go back afterwards and emit the correct
+ * tgsi instruction number for each label.
+ */
+ struct label *labels;
+ unsigned labels_size;
+ unsigned labels_count;
+
+ /* Keep a record of the tgsi instruction number that each mesa
+ * instruction starts at, will be used to fix up labels after
+ * translation.
+ */
+ unsigned *insn;
+ unsigned insn_size;
+ unsigned insn_count;
+
+ unsigned procType; /**< TGSI_PROCESSOR_VERTEX/FRAGMENT */
+
+ boolean error;
+};
+
+
+/** Map Mesa's SYSTEM_VALUE_x to TGSI_SEMANTIC_x */
+static unsigned mesa_sysval_to_semantic[SYSTEM_VALUE_MAX] = {
+ TGSI_SEMANTIC_FACE,
+ TGSI_SEMANTIC_INSTANCEID
+};
+
+
+/**
+ * Make note of a branch to a label in the TGSI code.
+ * After we've emitted all instructions, we'll go over the list
+ * of labels built here and patch the TGSI code with the actual
+ * location of each label.
+ */
+static unsigned *get_label( struct st_translate *t,
+ unsigned branch_target )
+{
+ unsigned i;
+
+ if (t->labels_count + 1 >= t->labels_size) {
+ unsigned old_size = t->labels_size;
+ t->labels_size = 1 << (util_logbase2(t->labels_size) + 1);
+ t->labels = REALLOC( t->labels,
+ old_size * sizeof t->labels[0],
+ t->labels_size * sizeof t->labels[0] );
+ if (t->labels == NULL) {
+ static unsigned dummy;
+ t->error = TRUE;
+ return &dummy;
+ }
+ }
+
+ i = t->labels_count++;
+ t->labels[i].branch_target = branch_target;
+ return &t->labels[i].token;
+}
+
+
+/**
+ * Called prior to emitting the TGSI code for each Mesa instruction.
+ * Allocate additional space for instructions if needed.
+ * Update the insn[] array so the next Mesa instruction points to
+ * the next TGSI instruction.
+ */
+static void set_insn_start( struct st_translate *t,
+ unsigned start )
+{
+ if (t->insn_count + 1 >= t->insn_size) {
+ unsigned old_size = t->insn_size;
+ t->insn_size = 1 << (util_logbase2(t->insn_size) + 1);
+ t->insn = REALLOC( t->insn,
+ old_size * sizeof t->insn[0],
+ t->insn_size * sizeof t->insn[0] );
+ if (t->insn == NULL) {
+ t->error = TRUE;
+ return;
+ }
+ }
+
+ t->insn[t->insn_count++] = start;
+}
+
+
+/**
+ * Map a Mesa dst register to a TGSI ureg_dst register.
+ */
+static struct ureg_dst
+dst_register( struct st_translate *t,
+ gl_register_file file,
+ GLuint index )
+{
+ switch( file ) {
+ case PROGRAM_UNDEFINED:
+ return ureg_dst_undef();
+
+ case PROGRAM_TEMPORARY:
+ if (ureg_dst_is_undef(t->temps[index]))
+ t->temps[index] = ureg_DECL_temporary( t->ureg );
+
+ return t->temps[index];
+
+ case PROGRAM_OUTPUT:
+ if (t->procType == TGSI_PROCESSOR_VERTEX && index == VERT_RESULT_PSIZ)
+ t->prevInstWrotePointSize = GL_TRUE;
+
+ if (t->procType == TGSI_PROCESSOR_VERTEX)
+ assert(index < VERT_RESULT_MAX);
+ else if (t->procType == TGSI_PROCESSOR_FRAGMENT)
+ assert(index < FRAG_RESULT_MAX);
+ else
+ assert(index < GEOM_RESULT_MAX);
+
+ assert(t->outputMapping[index] < Elements(t->outputs));
+
+ return t->outputs[t->outputMapping[index]];
+
+ case PROGRAM_ADDRESS:
+ return t->address[index];
+
+ default:
+ debug_assert( 0 );
+ return ureg_dst_undef();
+ }
+}
+
+
+/**
+ * Map a Mesa src register to a TGSI ureg_src register.
+ */
+static struct ureg_src
+src_register( struct st_translate *t,
+ gl_register_file file,
+ GLint index )
+{
+ switch( file ) {
+ case PROGRAM_UNDEFINED:
+ return ureg_src_undef();
+
+ case PROGRAM_TEMPORARY:
+ assert(index >= 0);
+ assert(index < Elements(t->temps));
+ if (ureg_dst_is_undef(t->temps[index]))
+ t->temps[index] = ureg_DECL_temporary( t->ureg );
+ return ureg_src(t->temps[index]);
+
+ case PROGRAM_NAMED_PARAM:
+ case PROGRAM_ENV_PARAM:
+ case PROGRAM_LOCAL_PARAM:
+ case PROGRAM_UNIFORM:
+ assert(index >= 0);
+ return t->constants[index];
+ case PROGRAM_STATE_VAR:
+ case PROGRAM_CONSTANT: /* ie, immediate */
+ if (index < 0)
+ return ureg_DECL_constant( t->ureg, 0 );
+ else
+ return t->constants[index];
+
+ case PROGRAM_INPUT:
+ assert(t->inputMapping[index] < Elements(t->inputs));
+ return t->inputs[t->inputMapping[index]];
+
+ case PROGRAM_OUTPUT:
+ assert(t->outputMapping[index] < Elements(t->outputs));
+ return ureg_src(t->outputs[t->outputMapping[index]]); /* not needed? */
+
+ case PROGRAM_ADDRESS:
+ return ureg_src(t->address[index]);
+
+ case PROGRAM_SYSTEM_VALUE:
+ assert(index < Elements(t->systemValues));
+ return t->systemValues[index];
+
+ default:
+ debug_assert( 0 );
+ return ureg_src_undef();
+ }
+}
+
+
+/**
+ * Map mesa texture target to TGSI texture target.
+ */
+static unsigned
+translate_texture_target( GLuint textarget,
+ GLboolean shadow )
+{
+ if (shadow) {
+ switch( textarget ) {
+ case TEXTURE_1D_INDEX: return TGSI_TEXTURE_SHADOW1D;
+ case TEXTURE_2D_INDEX: return TGSI_TEXTURE_SHADOW2D;
+ case TEXTURE_RECT_INDEX: return TGSI_TEXTURE_SHADOWRECT;
+ default: break;
+ }
+ }
+
+ switch( textarget ) {
+ case TEXTURE_1D_INDEX: return TGSI_TEXTURE_1D;
+ case TEXTURE_2D_INDEX: return TGSI_TEXTURE_2D;
+ case TEXTURE_3D_INDEX: return TGSI_TEXTURE_3D;
+ case TEXTURE_CUBE_INDEX: return TGSI_TEXTURE_CUBE;
+ case TEXTURE_RECT_INDEX: return TGSI_TEXTURE_RECT;
+ case TEXTURE_1D_ARRAY_INDEX: return TGSI_TEXTURE_1D_ARRAY;
+ case TEXTURE_2D_ARRAY_INDEX: return TGSI_TEXTURE_2D_ARRAY;
+ default:
+ debug_assert( 0 );
+ return TGSI_TEXTURE_1D;
+ }
+}
+
+
+/**
+ * Create a TGSI ureg_dst register from a Mesa dest register.
+ */
+static struct ureg_dst
+translate_dst( struct st_translate *t,
+ const struct prog_dst_register *DstReg,
+ boolean saturate )
+{
+ struct ureg_dst dst = dst_register( t,
+ DstReg->File,
+ DstReg->Index );
+
+ dst = ureg_writemask( dst,
+ DstReg->WriteMask );
+
+ if (saturate)
+ dst = ureg_saturate( dst );
+
+ if (DstReg->RelAddr)
+ dst = ureg_dst_indirect( dst, ureg_src(t->address[0]) );
+
+ return dst;
+}
+
+
+/**
+ * Create a TGSI ureg_src register from a Mesa src register.
+ */
+static struct ureg_src
+translate_src( struct st_translate *t,
+ const struct prog_src_register *SrcReg )
+{
+ struct ureg_src src = src_register( t, SrcReg->File, SrcReg->Index );
+
+ if (t->procType == TGSI_PROCESSOR_GEOMETRY && SrcReg->HasIndex2) {
+ src = src_register( t, SrcReg->File, SrcReg->Index2 );
+ if (SrcReg->RelAddr2)
+ src = ureg_src_dimension_indirect( src, ureg_src(t->address[0]),
+ SrcReg->Index);
+ else
+ src = ureg_src_dimension( src, SrcReg->Index);
+ }
+
+ src = ureg_swizzle( src,
+ GET_SWZ( SrcReg->Swizzle, 0 ) & 0x3,
+ GET_SWZ( SrcReg->Swizzle, 1 ) & 0x3,
+ GET_SWZ( SrcReg->Swizzle, 2 ) & 0x3,
+ GET_SWZ( SrcReg->Swizzle, 3 ) & 0x3);
+
+ if (SrcReg->Negate == NEGATE_XYZW)
+ src = ureg_negate(src);
+
+ if (SrcReg->Abs)
+ src = ureg_abs(src);
+
+ if (SrcReg->RelAddr) {
+ src = ureg_src_indirect( src, ureg_src(t->address[0]));
+ if (SrcReg->File != PROGRAM_INPUT &&
+ SrcReg->File != PROGRAM_OUTPUT) {
+ /* If SrcReg->Index was negative, it was set to zero in
+ * src_register(). Reassign it now. But don't do this
+ * for input/output regs since they get remapped while
+ * const buffers don't.
+ */
+ src.Index = SrcReg->Index;
+ }
+ }
+
+ return src;
+}
+
+
+static struct ureg_src swizzle_4v( struct ureg_src src,
+ const unsigned *swz )
+{
+ return ureg_swizzle( src, swz[0], swz[1], swz[2], swz[3] );
+}
+
+
+/**
+ * Translate a SWZ instruction into a MOV, MUL or MAD instruction. EG:
+ *
+ * SWZ dst, src.x-y10
+ *
+ * becomes:
+ *
+ * MAD dst {1,-1,0,0}, src.xyxx, {0,0,1,0}
+ */
+static void emit_swz( struct st_translate *t,
+ struct ureg_dst dst,
+ const struct prog_src_register *SrcReg )
+{
+ struct ureg_program *ureg = t->ureg;
+ struct ureg_src src = src_register( t, SrcReg->File, SrcReg->Index );
+
+ unsigned negate_mask = SrcReg->Negate;
+
+ unsigned one_mask = ((GET_SWZ(SrcReg->Swizzle, 0) == SWIZZLE_ONE) << 0 |
+ (GET_SWZ(SrcReg->Swizzle, 1) == SWIZZLE_ONE) << 1 |
+ (GET_SWZ(SrcReg->Swizzle, 2) == SWIZZLE_ONE) << 2 |
+ (GET_SWZ(SrcReg->Swizzle, 3) == SWIZZLE_ONE) << 3);
+
+ unsigned zero_mask = ((GET_SWZ(SrcReg->Swizzle, 0) == SWIZZLE_ZERO) << 0 |
+ (GET_SWZ(SrcReg->Swizzle, 1) == SWIZZLE_ZERO) << 1 |
+ (GET_SWZ(SrcReg->Swizzle, 2) == SWIZZLE_ZERO) << 2 |
+ (GET_SWZ(SrcReg->Swizzle, 3) == SWIZZLE_ZERO) << 3);
+
+ unsigned negative_one_mask = one_mask & negate_mask;
+ unsigned positive_one_mask = one_mask & ~negate_mask;
+
+ struct ureg_src imm;
+ unsigned i;
+ unsigned mul_swizzle[4] = {0,0,0,0};
+ unsigned add_swizzle[4] = {0,0,0,0};
+ unsigned src_swizzle[4] = {0,0,0,0};
+ boolean need_add = FALSE;
+ boolean need_mul = FALSE;
+
+ if (dst.WriteMask == 0)
+ return;
+
+ /* Is this just a MOV?
+ */
+ if (zero_mask == 0 &&
+ one_mask == 0 &&
+ (negate_mask == 0 || negate_mask == TGSI_WRITEMASK_XYZW))
+ {
+ ureg_MOV( ureg, dst, translate_src( t, SrcReg ));
+ return;
+ }
+
+#define IMM_ZERO 0
+#define IMM_ONE 1
+#define IMM_NEG_ONE 2
+
+ imm = ureg_imm3f( ureg, 0, 1, -1 );
+
+ for (i = 0; i < 4; i++) {
+ unsigned bit = 1 << i;
+
+ if (dst.WriteMask & bit) {
+ if (positive_one_mask & bit) {
+ mul_swizzle[i] = IMM_ZERO;
+ add_swizzle[i] = IMM_ONE;
+ need_add = TRUE;
+ }
+ else if (negative_one_mask & bit) {
+ mul_swizzle[i] = IMM_ZERO;
+ add_swizzle[i] = IMM_NEG_ONE;
+ need_add = TRUE;
+ }
+ else if (zero_mask & bit) {
+ mul_swizzle[i] = IMM_ZERO;
+ add_swizzle[i] = IMM_ZERO;
+ need_add = TRUE;
+ }
+ else {
+ add_swizzle[i] = IMM_ZERO;
+ src_swizzle[i] = GET_SWZ(SrcReg->Swizzle, i);
+ need_mul = TRUE;
+ if (negate_mask & bit) {
+ mul_swizzle[i] = IMM_NEG_ONE;
+ }
+ else {
+ mul_swizzle[i] = IMM_ONE;
+ }
+ }
+ }
+ }
+
+ if (need_mul && need_add) {
+ ureg_MAD( ureg,
+ dst,
+ swizzle_4v( src, src_swizzle ),
+ swizzle_4v( imm, mul_swizzle ),
+ swizzle_4v( imm, add_swizzle ) );
+ }
+ else if (need_mul) {
+ ureg_MUL( ureg,
+ dst,
+ swizzle_4v( src, src_swizzle ),
+ swizzle_4v( imm, mul_swizzle ) );
+ }
+ else if (need_add) {
+ ureg_MOV( ureg,
+ dst,
+ swizzle_4v( imm, add_swizzle ) );
+ }
+ else {
+ debug_assert(0);
+ }
+
+#undef IMM_ZERO
+#undef IMM_ONE
+#undef IMM_NEG_ONE
+}
+
+
+/**
+ * Negate the value of DDY to match GL semantics where (0,0) is the
+ * lower-left corner of the window.
+ * Note that the GL_ARB_fragment_coord_conventions extension will
+ * effect this someday.
+ */
+static void emit_ddy( struct st_translate *t,
+ struct ureg_dst dst,
+ const struct prog_src_register *SrcReg )
+{
+ struct ureg_program *ureg = t->ureg;
+ struct ureg_src src = translate_src( t, SrcReg );
+ src = ureg_negate( src );
+ ureg_DDY( ureg, dst, src );
+}
+
+
+
+static unsigned
+translate_opcode( unsigned op )
+{
+ switch( op ) {
+ case OPCODE_ARL:
+ return TGSI_OPCODE_ARL;
+ case OPCODE_ABS:
+ return TGSI_OPCODE_ABS;
+ case OPCODE_ADD:
+ return TGSI_OPCODE_ADD;
+ case OPCODE_BGNLOOP:
+ return TGSI_OPCODE_BGNLOOP;
+ case OPCODE_BGNSUB:
+ return TGSI_OPCODE_BGNSUB;
+ case OPCODE_BRA:
+ return TGSI_OPCODE_BRA;
+ case OPCODE_BRK:
+ return TGSI_OPCODE_BRK;
+ case OPCODE_CAL:
+ return TGSI_OPCODE_CAL;
+ case OPCODE_CMP:
+ return TGSI_OPCODE_CMP;
+ case OPCODE_CONT:
+ return TGSI_OPCODE_CONT;
+ case OPCODE_COS:
+ return TGSI_OPCODE_COS;
+ case OPCODE_DDX:
+ return TGSI_OPCODE_DDX;
+ case OPCODE_DDY:
+ return TGSI_OPCODE_DDY;
+ case OPCODE_DP2:
+ return TGSI_OPCODE_DP2;
+ case OPCODE_DP2A:
+ return TGSI_OPCODE_DP2A;
+ case OPCODE_DP3:
+ return TGSI_OPCODE_DP3;
+ case OPCODE_DP4:
+ return TGSI_OPCODE_DP4;
+ case OPCODE_DPH:
+ return TGSI_OPCODE_DPH;
+ case OPCODE_DST:
+ return TGSI_OPCODE_DST;
+ case OPCODE_ELSE:
+ return TGSI_OPCODE_ELSE;
+ case OPCODE_EMIT_VERTEX:
+ return TGSI_OPCODE_EMIT;
+ case OPCODE_END_PRIMITIVE:
+ return TGSI_OPCODE_ENDPRIM;
+ case OPCODE_ENDIF:
+ return TGSI_OPCODE_ENDIF;
+ case OPCODE_ENDLOOP:
+ return TGSI_OPCODE_ENDLOOP;
+ case OPCODE_ENDSUB:
+ return TGSI_OPCODE_ENDSUB;
+ case OPCODE_EX2:
+ return TGSI_OPCODE_EX2;
+ case OPCODE_EXP:
+ return TGSI_OPCODE_EXP;
+ case OPCODE_FLR:
+ return TGSI_OPCODE_FLR;
+ case OPCODE_FRC:
+ return TGSI_OPCODE_FRC;
+ case OPCODE_IF:
+ return TGSI_OPCODE_IF;
+ case OPCODE_TRUNC:
+ return TGSI_OPCODE_TRUNC;
+ case OPCODE_KIL:
+ return TGSI_OPCODE_KIL;
+ case OPCODE_KIL_NV:
+ return TGSI_OPCODE_KILP;
+ case OPCODE_LG2:
+ return TGSI_OPCODE_LG2;
+ case OPCODE_LOG:
+ return TGSI_OPCODE_LOG;
+ case OPCODE_LIT:
+ return TGSI_OPCODE_LIT;
+ case OPCODE_LRP:
+ return TGSI_OPCODE_LRP;
+ case OPCODE_MAD:
+ return TGSI_OPCODE_MAD;
+ case OPCODE_MAX:
+ return TGSI_OPCODE_MAX;
+ case OPCODE_MIN:
+ return TGSI_OPCODE_MIN;
+ case OPCODE_MOV:
+ return TGSI_OPCODE_MOV;
+ case OPCODE_MUL:
+ return TGSI_OPCODE_MUL;
+ case OPCODE_NOP:
+ return TGSI_OPCODE_NOP;
+ case OPCODE_NRM3:
+ return TGSI_OPCODE_NRM;
+ case OPCODE_NRM4:
+ return TGSI_OPCODE_NRM4;
+ case OPCODE_POW:
+ return TGSI_OPCODE_POW;
+ case OPCODE_RCP:
+ return TGSI_OPCODE_RCP;
+ case OPCODE_RET:
+ return TGSI_OPCODE_RET;
+ case OPCODE_RSQ:
+ return TGSI_OPCODE_RSQ;
+ case OPCODE_SCS:
+ return TGSI_OPCODE_SCS;
+ case OPCODE_SEQ:
+ return TGSI_OPCODE_SEQ;
+ case OPCODE_SGE:
+ return TGSI_OPCODE_SGE;
+ case OPCODE_SGT:
+ return TGSI_OPCODE_SGT;
+ case OPCODE_SIN:
+ return TGSI_OPCODE_SIN;
+ case OPCODE_SLE:
+ return TGSI_OPCODE_SLE;
+ case OPCODE_SLT:
+ return TGSI_OPCODE_SLT;
+ case OPCODE_SNE:
+ return TGSI_OPCODE_SNE;
+ case OPCODE_SSG:
+ return TGSI_OPCODE_SSG;
+ case OPCODE_SUB:
+ return TGSI_OPCODE_SUB;
+ case OPCODE_TEX:
+ return TGSI_OPCODE_TEX;
+ case OPCODE_TXB:
+ return TGSI_OPCODE_TXB;
+ case OPCODE_TXD:
+ return TGSI_OPCODE_TXD;
+ case OPCODE_TXL:
+ return TGSI_OPCODE_TXL;
+ case OPCODE_TXP:
+ return TGSI_OPCODE_TXP;
+ case OPCODE_XPD:
+ return TGSI_OPCODE_XPD;
+ case OPCODE_END:
+ return TGSI_OPCODE_END;
+ default:
+ debug_assert( 0 );
+ return TGSI_OPCODE_NOP;
+ }
+}
+
+
+static void
+compile_instruction(
+ struct st_translate *t,
+ const struct prog_instruction *inst )
+{
+ struct ureg_program *ureg = t->ureg;
+ GLuint i;
+ struct ureg_dst dst[1];
+ struct ureg_src src[4];
+ unsigned num_dst;
+ unsigned num_src;
+
+ num_dst = _mesa_num_inst_dst_regs( inst->Opcode );
+ num_src = _mesa_num_inst_src_regs( inst->Opcode );
+
+ if (num_dst)
+ dst[0] = translate_dst( t,
+ &inst->DstReg,
+ inst->SaturateMode );
+
+ for (i = 0; i < num_src; i++)
+ src[i] = translate_src( t, &inst->SrcReg[i] );
+
+ switch( inst->Opcode ) {
+ case OPCODE_SWZ:
+ emit_swz( t, dst[0], &inst->SrcReg[0] );
+ return;
+
+ case OPCODE_BGNLOOP:
+ case OPCODE_CAL:
+ case OPCODE_ELSE:
+ case OPCODE_ENDLOOP:
+ case OPCODE_IF:
+ debug_assert(num_dst == 0);
+ ureg_label_insn( ureg,
+ translate_opcode( inst->Opcode ),
+ src, num_src,
+ get_label( t, inst->BranchTarget ));
+ return;
+
+ case OPCODE_TEX:
+ case OPCODE_TXB:
+ case OPCODE_TXD:
+ case OPCODE_TXL:
+ case OPCODE_TXP:
+ src[num_src++] = t->samplers[inst->TexSrcUnit];
+ ureg_tex_insn( ureg,
+ translate_opcode( inst->Opcode ),
+ dst, num_dst,
+ translate_texture_target( inst->TexSrcTarget,
+ inst->TexShadow ),
+ src, num_src );
+ return;
+
+ case OPCODE_SCS:
+ dst[0] = ureg_writemask(dst[0], TGSI_WRITEMASK_XY );
+ ureg_insn( ureg,
+ translate_opcode( inst->Opcode ),
+ dst, num_dst,
+ src, num_src );
+ break;
+
+ case OPCODE_XPD:
+ dst[0] = ureg_writemask(dst[0], TGSI_WRITEMASK_XYZ );
+ ureg_insn( ureg,
+ translate_opcode( inst->Opcode ),
+ dst, num_dst,
+ src, num_src );
+ break;
+
+ case OPCODE_NOISE1:
+ case OPCODE_NOISE2:
+ case OPCODE_NOISE3:
+ case OPCODE_NOISE4:
+ /* At some point, a motivated person could add a better
+ * implementation of noise. Currently not even the nvidia
+ * binary drivers do anything more than this. In any case, the
+ * place to do this is in the GL state tracker, not the poor
+ * driver.
+ */
+ ureg_MOV( ureg, dst[0], ureg_imm1f(ureg, 0.5) );
+ break;
+
+ case OPCODE_DDY:
+ emit_ddy( t, dst[0], &inst->SrcReg[0] );
+ break;
+
+ default:
+ ureg_insn( ureg,
+ translate_opcode( inst->Opcode ),
+ dst, num_dst,
+ src, num_src );
+ break;
+ }
+}
+
+
+/**
+ * Emit the TGSI instructions for inverting and adjusting WPOS.
+ * This code is unavoidable because it also depends on whether
+ * a FBO is bound (STATE_FB_WPOS_Y_TRANSFORM).
+ */
+static void
+emit_wpos_adjustment( struct st_translate *t,
+ const struct gl_program *program,
+ boolean invert,
+ GLfloat adjX, GLfloat adjY[2])
+{
+ struct ureg_program *ureg = t->ureg;
+
+ /* Fragment program uses fragment position input.
+ * Need to replace instances of INPUT[WPOS] with temp T
+ * where T = INPUT[WPOS] by y is inverted.
+ */
+ static const gl_state_index wposTransformState[STATE_LENGTH]
+ = { STATE_INTERNAL, STATE_FB_WPOS_Y_TRANSFORM, 0, 0, 0 };
+
+ /* XXX: note we are modifying the incoming shader here! Need to
+ * do this before emitting the constant decls below, or this
+ * will be missed:
+ */
+ unsigned wposTransConst = _mesa_add_state_reference(program->Parameters,
+ wposTransformState);
+
+ struct ureg_src wpostrans = ureg_DECL_constant( ureg, wposTransConst );
+ struct ureg_dst wpos_temp = ureg_DECL_temporary( ureg );
+ struct ureg_src wpos_input = t->inputs[t->inputMapping[FRAG_ATTRIB_WPOS]];
+
+ /* First, apply the coordinate shift: */
+ if (adjX || adjY[0] || adjY[1]) {
+ if (adjY[0] != adjY[1]) {
+ /* Adjust the y coordinate by adjY[1] or adjY[0] respectively
+ * depending on whether inversion is actually going to be applied
+ * or not, which is determined by testing against the inversion
+ * state variable used below, which will be either +1 or -1.
+ */
+ struct ureg_dst adj_temp = ureg_DECL_temporary(ureg);
+
+ ureg_CMP(ureg, adj_temp,
+ ureg_scalar(wpostrans, invert ? 2 : 0),
+ ureg_imm4f(ureg, adjX, adjY[0], 0.0f, 0.0f),
+ ureg_imm4f(ureg, adjX, adjY[1], 0.0f, 0.0f));
+ ureg_ADD(ureg, wpos_temp, wpos_input, ureg_src(adj_temp));
+ } else {
+ ureg_ADD(ureg, wpos_temp, wpos_input,
+ ureg_imm4f(ureg, adjX, adjY[0], 0.0f, 0.0f));
+ }
+ wpos_input = ureg_src(wpos_temp);
+ } else {
+ /* MOV wpos_temp, input[wpos]
+ */
+ ureg_MOV( ureg, wpos_temp, wpos_input );
+ }
+
+ /* Now the conditional y flip: STATE_FB_WPOS_Y_TRANSFORM.xy/zw will be
+ * inversion/identity, or the other way around if we're drawing to an FBO.
+ */
+ if (invert) {
+ /* MAD wpos_temp.y, wpos_input, wpostrans.xxxx, wpostrans.yyyy
+ */
+ ureg_MAD( ureg,
+ ureg_writemask(wpos_temp, TGSI_WRITEMASK_Y ),
+ wpos_input,
+ ureg_scalar(wpostrans, 0),
+ ureg_scalar(wpostrans, 1));
+ } else {
+ /* MAD wpos_temp.y, wpos_input, wpostrans.zzzz, wpostrans.wwww
+ */
+ ureg_MAD( ureg,
+ ureg_writemask(wpos_temp, TGSI_WRITEMASK_Y ),
+ wpos_input,
+ ureg_scalar(wpostrans, 2),
+ ureg_scalar(wpostrans, 3));
+ }
+
+ /* Use wpos_temp as position input from here on:
+ */
+ t->inputs[t->inputMapping[FRAG_ATTRIB_WPOS]] = ureg_src(wpos_temp);
+}
+
+
+/**
+ * Emit fragment position/ooordinate code.
+ */
+static void
+emit_wpos(struct st_context *st,
+ struct st_translate *t,
+ const struct gl_program *program,
+ struct ureg_program *ureg)
+{
+ const struct gl_fragment_program *fp =
+ (const struct gl_fragment_program *) program;
+ struct pipe_screen *pscreen = st->pipe->screen;
+ GLfloat adjX = 0.0f;
+ GLfloat adjY[2] = { 0.0f, 0.0f };
+ boolean invert = FALSE;
+
+ /* Query the pixel center conventions supported by the pipe driver and set
+ * adjX, adjY to help out if it cannot handle the requested one internally.
+ *
+ * The bias of the y-coordinate depends on whether y-inversion takes place
+ * (adjY[1]) or not (adjY[0]), which is in turn dependent on whether we are
+ * drawing to an FBO (causes additional inversion), and whether the the pipe
+ * driver origin and the requested origin differ (the latter condition is
+ * stored in the 'invert' variable).
+ *
+ * For height = 100 (i = integer, h = half-integer, l = lower, u = upper):
+ *
+ * center shift only:
+ * i -> h: +0.5
+ * h -> i: -0.5
+ *
+ * inversion only:
+ * l,i -> u,i: ( 0.0 + 1.0) * -1 + 100 = 99
+ * l,h -> u,h: ( 0.5 + 0.0) * -1 + 100 = 99.5
+ * u,i -> l,i: (99.0 + 1.0) * -1 + 100 = 0
+ * u,h -> l,h: (99.5 + 0.0) * -1 + 100 = 0.5
+ *
+ * inversion and center shift:
+ * l,i -> u,h: ( 0.0 + 0.5) * -1 + 100 = 99.5
+ * l,h -> u,i: ( 0.5 + 0.5) * -1 + 100 = 99
+ * u,i -> l,h: (99.0 + 0.5) * -1 + 100 = 0.5
+ * u,h -> l,i: (99.5 + 0.5) * -1 + 100 = 0
+ */
+ if (fp->OriginUpperLeft) {
+ /* Fragment shader wants origin in upper-left */
+ if (pscreen->get_param(pscreen, PIPE_CAP_TGSI_FS_COORD_ORIGIN_UPPER_LEFT)) {
+ /* the driver supports upper-left origin */
+ }
+ else if (pscreen->get_param(pscreen, PIPE_CAP_TGSI_FS_COORD_ORIGIN_LOWER_LEFT)) {
+ /* the driver supports lower-left origin, need to invert Y */
+ ureg_property_fs_coord_origin(ureg, TGSI_FS_COORD_ORIGIN_LOWER_LEFT);
+ invert = TRUE;
+ }
+ else
+ assert(0);
+ }
+ else {
+ /* Fragment shader wants origin in lower-left */
+ if (pscreen->get_param(pscreen, PIPE_CAP_TGSI_FS_COORD_ORIGIN_LOWER_LEFT))
+ /* the driver supports lower-left origin */
+ ureg_property_fs_coord_origin(ureg, TGSI_FS_COORD_ORIGIN_LOWER_LEFT);
+ else if (pscreen->get_param(pscreen, PIPE_CAP_TGSI_FS_COORD_ORIGIN_UPPER_LEFT))
+ /* the driver supports upper-left origin, need to invert Y */
+ invert = TRUE;
+ else
+ assert(0);
+ }
+
+ if (fp->PixelCenterInteger) {
+ /* Fragment shader wants pixel center integer */
+ if (pscreen->get_param(pscreen, PIPE_CAP_TGSI_FS_COORD_PIXEL_CENTER_INTEGER)) {
+ /* the driver supports pixel center integer */
+ adjY[1] = 1.0f;
+ ureg_property_fs_coord_pixel_center(ureg, TGSI_FS_COORD_PIXEL_CENTER_INTEGER);
+ }
+ else if (pscreen->get_param(pscreen, PIPE_CAP_TGSI_FS_COORD_PIXEL_CENTER_HALF_INTEGER)) {
+ /* the driver supports pixel center half integer, need to bias X,Y */
+ adjX = -0.5f;
+ adjY[0] = -0.5f;
+ adjY[1] = 0.5f;
+ }
+ else
+ assert(0);
+ }
+ else {
+ /* Fragment shader wants pixel center half integer */
+ if (pscreen->get_param(pscreen, PIPE_CAP_TGSI_FS_COORD_PIXEL_CENTER_HALF_INTEGER)) {
+ /* the driver supports pixel center half integer */
+ }
+ else if (pscreen->get_param(pscreen, PIPE_CAP_TGSI_FS_COORD_PIXEL_CENTER_INTEGER)) {
+ /* the driver supports pixel center integer, need to bias X,Y */
+ adjX = adjY[0] = adjY[1] = 0.5f;
+ ureg_property_fs_coord_pixel_center(ureg, TGSI_FS_COORD_PIXEL_CENTER_INTEGER);
+ }
+ else
+ assert(0);
+ }
+
+ /* we invert after adjustment so that we avoid the MOV to temporary,
+ * and reuse the adjustment ADD instead */
+ emit_wpos_adjustment(t, program, invert, adjX, adjY);
+}
+
+
+/**
+ * OpenGL's fragment gl_FrontFace input is 1 for front-facing, 0 for back.
+ * TGSI uses +1 for front, -1 for back.
+ * This function converts the TGSI value to the GL value. Simply clamping/
+ * saturating the value to [0,1] does the job.
+ */
+static void
+emit_face_var( struct st_translate *t,
+ const struct gl_program *program )
+{
+ struct ureg_program *ureg = t->ureg;
+ struct ureg_dst face_temp = ureg_DECL_temporary( ureg );
+ struct ureg_src face_input = t->inputs[t->inputMapping[FRAG_ATTRIB_FACE]];
+
+ /* MOV_SAT face_temp, input[face]
+ */
+ face_temp = ureg_saturate( face_temp );
+ ureg_MOV( ureg, face_temp, face_input );
+
+ /* Use face_temp as face input from here on:
+ */
+ t->inputs[t->inputMapping[FRAG_ATTRIB_FACE]] = ureg_src(face_temp);
+}
+
+
+static void
+emit_edgeflags( struct st_translate *t,
+ const struct gl_program *program )
+{
+ struct ureg_program *ureg = t->ureg;
+ struct ureg_dst edge_dst = t->outputs[t->outputMapping[VERT_RESULT_EDGE]];
+ struct ureg_src edge_src = t->inputs[t->inputMapping[VERT_ATTRIB_EDGEFLAG]];
+
+ ureg_MOV( ureg, edge_dst, edge_src );
+}
+
+
+/**
+ * Translate Mesa program to TGSI format.
+ * \param program the program to translate
+ * \param numInputs number of input registers used
+ * \param inputMapping maps Mesa fragment program inputs to TGSI generic
+ * input indexes
+ * \param inputSemanticName the TGSI_SEMANTIC flag for each input
+ * \param inputSemanticIndex the semantic index (ex: which texcoord) for
+ * each input
+ * \param interpMode the TGSI_INTERPOLATE_LINEAR/PERSP mode for each input
+ * \param numOutputs number of output registers used
+ * \param outputMapping maps Mesa fragment program outputs to TGSI
+ * generic outputs
+ * \param outputSemanticName the TGSI_SEMANTIC flag for each output
+ * \param outputSemanticIndex the semantic index (ex: which texcoord) for
+ * each output
+ *
+ * \return PIPE_OK or PIPE_ERROR_OUT_OF_MEMORY
+ */
+enum pipe_error
+st_translate_mesa_program(
+ struct gl_context *ctx,
+ uint procType,
+ struct ureg_program *ureg,
+ const struct gl_program *program,
+ GLuint numInputs,
+ const GLuint inputMapping[],
+ const ubyte inputSemanticName[],
+ const ubyte inputSemanticIndex[],
+ const GLuint interpMode[],
+ GLuint numOutputs,
+ const GLuint outputMapping[],
+ const ubyte outputSemanticName[],
+ const ubyte outputSemanticIndex[],
+ boolean passthrough_edgeflags )
+{
+ struct st_translate translate, *t;
+ unsigned i;
+ enum pipe_error ret = PIPE_OK;
+
+ assert(numInputs <= Elements(t->inputs));
+ assert(numOutputs <= Elements(t->outputs));
+
+ t = &translate;
+ memset(t, 0, sizeof *t);
+
+ t->procType = procType;
+ t->inputMapping = inputMapping;
+ t->outputMapping = outputMapping;
+ t->ureg = ureg;
+ t->pointSizeOutIndex = -1;
+ t->prevInstWrotePointSize = GL_FALSE;
+
+ /*_mesa_print_program(program);*/
+
+ /*
+ * Declare input attributes.
+ */
+ if (procType == TGSI_PROCESSOR_FRAGMENT) {
+ for (i = 0; i < numInputs; i++) {
+ if (program->InputFlags[0] & PROG_PARAM_BIT_CYL_WRAP) {
+ t->inputs[i] = ureg_DECL_fs_input_cyl(ureg,
+ inputSemanticName[i],
+ inputSemanticIndex[i],
+ interpMode[i],
+ TGSI_CYLINDRICAL_WRAP_X);
+ }
+ else {
+ t->inputs[i] = ureg_DECL_fs_input(ureg,
+ inputSemanticName[i],
+ inputSemanticIndex[i],
+ interpMode[i]);
+ }
+ }
+
+ if (program->InputsRead & FRAG_BIT_WPOS) {
+ /* Must do this after setting up t->inputs, and before
+ * emitting constant references, below:
+ */
+ emit_wpos(st_context(ctx), t, program, ureg);
+ }
+
+ if (program->InputsRead & FRAG_BIT_FACE) {
+ emit_face_var( t, program );
+ }
+
+ /*
+ * Declare output attributes.
+ */
+ for (i = 0; i < numOutputs; i++) {
+ switch (outputSemanticName[i]) {
+ case TGSI_SEMANTIC_POSITION:
+ t->outputs[i] = ureg_DECL_output( ureg,
+ TGSI_SEMANTIC_POSITION, /* Z / Depth */
+ outputSemanticIndex[i] );
+
+ t->outputs[i] = ureg_writemask( t->outputs[i],
+ TGSI_WRITEMASK_Z );
+ break;
+ case TGSI_SEMANTIC_STENCIL:
+ t->outputs[i] = ureg_DECL_output( ureg,
+ TGSI_SEMANTIC_STENCIL, /* Stencil */
+ outputSemanticIndex[i] );
+ t->outputs[i] = ureg_writemask( t->outputs[i],
+ TGSI_WRITEMASK_Y );
+ break;
+ case TGSI_SEMANTIC_COLOR:
+ t->outputs[i] = ureg_DECL_output( ureg,
+ TGSI_SEMANTIC_COLOR,
+ outputSemanticIndex[i] );
+ break;
+ default:
+ debug_assert(0);
+ return 0;
+ }
+ }
+ }
+ else if (procType == TGSI_PROCESSOR_GEOMETRY) {
+ for (i = 0; i < numInputs; i++) {
+ t->inputs[i] = ureg_DECL_gs_input(ureg,
+ i,
+ inputSemanticName[i],
+ inputSemanticIndex[i]);
+ }
+
+ for (i = 0; i < numOutputs; i++) {
+ t->outputs[i] = ureg_DECL_output( ureg,
+ outputSemanticName[i],
+ outputSemanticIndex[i] );
+ }
+ }
+ else {
+ assert(procType == TGSI_PROCESSOR_VERTEX);
+
+ for (i = 0; i < numInputs; i++) {
+ t->inputs[i] = ureg_DECL_vs_input(ureg, i);
+ }
+
+ for (i = 0; i < numOutputs; i++) {
+ t->outputs[i] = ureg_DECL_output( ureg,
+ outputSemanticName[i],
+ outputSemanticIndex[i] );
+ if ((outputSemanticName[i] == TGSI_SEMANTIC_PSIZE) && program->Id) {
+ /* Writing to the point size result register requires special
+ * handling to implement clamping.
+ */
+ static const gl_state_index pointSizeClampState[STATE_LENGTH]
+ = { STATE_INTERNAL, STATE_POINT_SIZE_IMPL_CLAMP, 0, 0, 0 };
+ /* XXX: note we are modifying the incoming shader here! Need to
+ * do this before emitting the constant decls below, or this
+ * will be missed:
+ */
+ unsigned pointSizeClampConst =
+ _mesa_add_state_reference(program->Parameters,
+ pointSizeClampState);
+ struct ureg_dst psizregtemp = ureg_DECL_temporary( ureg );
+ t->pointSizeConst = ureg_DECL_constant( ureg, pointSizeClampConst );
+ t->pointSizeResult = t->outputs[i];
+ t->pointSizeOutIndex = i;
+ t->outputs[i] = psizregtemp;
+ }
+ }
+ if (passthrough_edgeflags)
+ emit_edgeflags( t, program );
+ }
+
+ /* Declare address register.
+ */
+ if (program->NumAddressRegs > 0) {
+ debug_assert( program->NumAddressRegs == 1 );
+ t->address[0] = ureg_DECL_address( ureg );
+ }
+
+ /* Declare misc input registers
+ */
+ {
+ GLbitfield sysInputs = program->SystemValuesRead;
+ unsigned numSys = 0;
+ for (i = 0; sysInputs; i++) {
+ if (sysInputs & (1 << i)) {
+ unsigned semName = mesa_sysval_to_semantic[i];
+ t->systemValues[i] = ureg_DECL_system_value(ureg, numSys, semName, 0);
+ numSys++;
+ sysInputs &= ~(1 << i);
+ }
+ }
+ }
+
+ if (program->IndirectRegisterFiles & (1 << PROGRAM_TEMPORARY)) {
+ /* If temps are accessed with indirect addressing, declare temporaries
+ * in sequential order. Else, we declare them on demand elsewhere.
+ */
+ for (i = 0; i < program->NumTemporaries; i++) {
+ /* XXX use TGSI_FILE_TEMPORARY_ARRAY when it's supported by ureg */
+ t->temps[i] = ureg_DECL_temporary( t->ureg );
+ }
+ }
+
+ /* Emit constants and immediates. Mesa uses a single index space
+ * for these, so we put all the translated regs in t->constants.
+ */
+ if (program->Parameters) {
+ t->constants = CALLOC( program->Parameters->NumParameters,
+ sizeof t->constants[0] );
+ if (t->constants == NULL) {
+ ret = PIPE_ERROR_OUT_OF_MEMORY;
+ goto out;
+ }
+
+ for (i = 0; i < program->Parameters->NumParameters; i++) {
+ switch (program->Parameters->Parameters[i].Type) {
+ case PROGRAM_ENV_PARAM:
+ case PROGRAM_LOCAL_PARAM:
+ case PROGRAM_STATE_VAR:
+ case PROGRAM_NAMED_PARAM:
+ case PROGRAM_UNIFORM:
+ t->constants[i] = ureg_DECL_constant( ureg, i );
+ break;
+
+ /* Emit immediates only when there's no indirect addressing of
+ * the const buffer.
+ * FIXME: Be smarter and recognize param arrays:
+ * indirect addressing is only valid within the referenced
+ * array.
+ */
+ case PROGRAM_CONSTANT:
+ if (program->IndirectRegisterFiles & PROGRAM_ANY_CONST)
+ t->constants[i] = ureg_DECL_constant( ureg, i );
+ else
+ t->constants[i] =
+ ureg_DECL_immediate( ureg,
+ program->Parameters->ParameterValues[i],
+ 4 );
+ break;
+ default:
+ break;
+ }
+ }
+ }
+
+ /* texture samplers */
+ for (i = 0; i < ctx->Const.MaxTextureImageUnits; i++) {
+ if (program->SamplersUsed & (1 << i)) {
+ t->samplers[i] = ureg_DECL_sampler( ureg, i );
+ }
+ }
+
+ /* Emit each instruction in turn:
+ */
+ for (i = 0; i < program->NumInstructions; i++) {
+ set_insn_start( t, ureg_get_instruction_number( ureg ));
+ compile_instruction( t, &program->Instructions[i] );
+
+ if (t->prevInstWrotePointSize && program->Id) {
+ /* The previous instruction wrote to the (fake) vertex point size
+ * result register. Now we need to clamp that value to the min/max
+ * point size range, putting the result into the real point size
+ * register.
+ * Note that we can't do this easily at the end of program due to
+ * possible early return.
+ */
+ set_insn_start( t, ureg_get_instruction_number( ureg ));
+ ureg_MAX( t->ureg,
+ ureg_writemask(t->outputs[t->pointSizeOutIndex], WRITEMASK_X),
+ ureg_src(t->outputs[t->pointSizeOutIndex]),
+ ureg_swizzle(t->pointSizeConst, 1,1,1,1));
+ ureg_MIN( t->ureg, ureg_writemask(t->pointSizeResult, WRITEMASK_X),
+ ureg_src(t->outputs[t->pointSizeOutIndex]),
+ ureg_swizzle(t->pointSizeConst, 2,2,2,2));
+ }
+ t->prevInstWrotePointSize = GL_FALSE;
+ }
+
+ /* Fix up all emitted labels:
+ */
+ for (i = 0; i < t->labels_count; i++) {
+ ureg_fixup_label( ureg,
+ t->labels[i].token,
+ t->insn[t->labels[i].branch_target] );
+ }
+
+out:
+ FREE(t->insn);
+ FREE(t->labels);
+ FREE(t->constants);
+
+ if (t->error) {
+ debug_printf("%s: translate error flag set\n", __FUNCTION__);
+ }
+
+ return ret;
+}
+
+
+/**
+ * Tokens cannot be free with free otherwise the builtin gallium
+ * malloc debugging will get confused.
+ */
+void
+st_free_tokens(const struct tgsi_token *tokens)
+{
+ FREE((void *)tokens);
+}
diff --git a/mesalib/src/mesa/state_tracker/st_program.c b/mesalib/src/mesa/state_tracker/st_program.c
index 0b1ad63af..1efc58799 100644
--- a/mesalib/src/mesa/state_tracker/st_program.c
+++ b/mesalib/src/mesa/state_tracker/st_program.c
@@ -1,1165 +1,1165 @@
-/**************************************************************************
- *
- * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas.
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sub license, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice (including the
- * next paragraph) shall be included in all copies or substantial portions
- * of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
- * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
- * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- **************************************************************************/
- /*
- * Authors:
- * Keith Whitwell <keith@tungstengraphics.com>
- * Brian Paul
- */
-
-
-#include "main/imports.h"
-#include "main/hash.h"
-#include "main/mfeatures.h"
-#include "main/mtypes.h"
-#include "program/prog_parameter.h"
-#include "program/prog_print.h"
-#include "program/programopt.h"
-
-#include "pipe/p_context.h"
-#include "pipe/p_defines.h"
-#include "pipe/p_shader_tokens.h"
-#include "draw/draw_context.h"
-#include "tgsi/tgsi_dump.h"
-#include "tgsi/tgsi_ureg.h"
-
-#include "st_debug.h"
-#include "st_cb_bitmap.h"
-#include "st_cb_drawpixels.h"
-#include "st_context.h"
-#include "st_program.h"
-#include "st_mesa_to_tgsi.h"
-#include "cso_cache/cso_context.h"
-
-
-
-/**
- * Delete a vertex program variant. Note the caller must unlink
- * the variant from the linked list.
- */
-static void
-delete_vp_variant(struct st_context *st, struct st_vp_variant *vpv)
-{
- if (vpv->driver_shader)
- cso_delete_vertex_shader(st->cso_context, vpv->driver_shader);
-
-#if FEATURE_feedback || FEATURE_rastpos
- if (vpv->draw_shader)
- draw_delete_vertex_shader( st->draw, vpv->draw_shader );
-#endif
-
- if (vpv->tgsi.tokens)
- st_free_tokens(vpv->tgsi.tokens);
-
- FREE( vpv );
-}
-
-
-
-/**
- * Clean out any old compilations:
- */
-void
-st_release_vp_variants( struct st_context *st,
- struct st_vertex_program *stvp )
-{
- struct st_vp_variant *vpv;
-
- for (vpv = stvp->variants; vpv; ) {
- struct st_vp_variant *next = vpv->next;
- delete_vp_variant(st, vpv);
- vpv = next;
- }
-
- stvp->variants = NULL;
-}
-
-
-
-/**
- * Delete a fragment program variant. Note the caller must unlink
- * the variant from the linked list.
- */
-static void
-delete_fp_variant(struct st_context *st, struct st_fp_variant *fpv)
-{
- if (fpv->driver_shader)
- cso_delete_fragment_shader(st->cso_context, fpv->driver_shader);
- if (fpv->parameters)
- _mesa_free_parameter_list(fpv->parameters);
-
- FREE(fpv);
-}
-
-
-/**
- * Free all variants of a fragment program.
- */
-void
-st_release_fp_variants(struct st_context *st, struct st_fragment_program *stfp)
-{
- struct st_fp_variant *fpv;
-
- for (fpv = stfp->variants; fpv; ) {
- struct st_fp_variant *next = fpv->next;
- delete_fp_variant(st, fpv);
- fpv = next;
- }
-
- stfp->variants = NULL;
-}
-
-
-/**
- * Delete a geometry program variant. Note the caller must unlink
- * the variant from the linked list.
- */
-static void
-delete_gp_variant(struct st_context *st, struct st_gp_variant *gpv)
-{
- if (gpv->driver_shader)
- cso_delete_geometry_shader(st->cso_context, gpv->driver_shader);
-
- FREE(gpv);
-}
-
-
-/**
- * Free all variants of a geometry program.
- */
-void
-st_release_gp_variants(struct st_context *st, struct st_geometry_program *stgp)
-{
- struct st_gp_variant *gpv;
-
- for (gpv = stgp->variants; gpv; ) {
- struct st_gp_variant *next = gpv->next;
- delete_gp_variant(st, gpv);
- gpv = next;
- }
-
- stgp->variants = NULL;
-}
-
-
-
-
-/**
- * Translate a Mesa vertex shader into a TGSI shader.
- * \param outputMapping to map vertex program output registers (VERT_RESULT_x)
- * to TGSI output slots
- * \param tokensOut destination for TGSI tokens
- * \return pointer to cached pipe_shader object.
- */
-static void
-st_prepare_vertex_program(struct st_context *st,
- struct st_vertex_program *stvp)
-{
- GLuint attr;
-
- stvp->num_inputs = 0;
- stvp->num_outputs = 0;
-
- if (stvp->Base.IsPositionInvariant)
- _mesa_insert_mvp_code(st->ctx, &stvp->Base);
-
- assert(stvp->Base.Base.NumInstructions > 1);
-
- /*
- * Determine number of inputs, the mappings between VERT_ATTRIB_x
- * and TGSI generic input indexes, plus input attrib semantic info.
- */
- for (attr = 0; attr < VERT_ATTRIB_MAX; attr++) {
- if (stvp->Base.Base.InputsRead & (1 << attr)) {
- stvp->input_to_index[attr] = stvp->num_inputs;
- stvp->index_to_input[stvp->num_inputs] = attr;
- stvp->num_inputs++;
- }
- }
- /* bit of a hack, presetup potentially unused edgeflag input */
- stvp->input_to_index[VERT_ATTRIB_EDGEFLAG] = stvp->num_inputs;
- stvp->index_to_input[stvp->num_inputs] = VERT_ATTRIB_EDGEFLAG;
-
- /* Compute mapping of vertex program outputs to slots.
- */
- for (attr = 0; attr < VERT_RESULT_MAX; attr++) {
- if ((stvp->Base.Base.OutputsWritten & BITFIELD64_BIT(attr)) == 0) {
- stvp->result_to_output[attr] = ~0;
- }
- else {
- unsigned slot = stvp->num_outputs++;
-
- stvp->result_to_output[attr] = slot;
-
- switch (attr) {
- case VERT_RESULT_HPOS:
- stvp->output_semantic_name[slot] = TGSI_SEMANTIC_POSITION;
- stvp->output_semantic_index[slot] = 0;
- break;
- case VERT_RESULT_COL0:
- stvp->output_semantic_name[slot] = TGSI_SEMANTIC_COLOR;
- stvp->output_semantic_index[slot] = 0;
- break;
- case VERT_RESULT_COL1:
- stvp->output_semantic_name[slot] = TGSI_SEMANTIC_COLOR;
- stvp->output_semantic_index[slot] = 1;
- break;
- case VERT_RESULT_BFC0:
- stvp->output_semantic_name[slot] = TGSI_SEMANTIC_BCOLOR;
- stvp->output_semantic_index[slot] = 0;
- break;
- case VERT_RESULT_BFC1:
- stvp->output_semantic_name[slot] = TGSI_SEMANTIC_BCOLOR;
- stvp->output_semantic_index[slot] = 1;
- break;
- case VERT_RESULT_FOGC:
- stvp->output_semantic_name[slot] = TGSI_SEMANTIC_FOG;
- stvp->output_semantic_index[slot] = 0;
- break;
- case VERT_RESULT_PSIZ:
- stvp->output_semantic_name[slot] = TGSI_SEMANTIC_PSIZE;
- stvp->output_semantic_index[slot] = 0;
- break;
- case VERT_RESULT_EDGE:
- assert(0);
- break;
-
- case VERT_RESULT_TEX0:
- case VERT_RESULT_TEX1:
- case VERT_RESULT_TEX2:
- case VERT_RESULT_TEX3:
- case VERT_RESULT_TEX4:
- case VERT_RESULT_TEX5:
- case VERT_RESULT_TEX6:
- case VERT_RESULT_TEX7:
- stvp->output_semantic_name[slot] = TGSI_SEMANTIC_GENERIC;
- stvp->output_semantic_index[slot] = attr - VERT_RESULT_TEX0;
- break;
-
- case VERT_RESULT_VAR0:
- default:
- assert(attr < VERT_RESULT_MAX);
- stvp->output_semantic_name[slot] = TGSI_SEMANTIC_GENERIC;
- stvp->output_semantic_index[slot] = (FRAG_ATTRIB_VAR0 -
- FRAG_ATTRIB_TEX0 +
- attr -
- VERT_RESULT_VAR0);
- break;
- }
- }
- }
- /* similar hack to above, presetup potentially unused edgeflag output */
- stvp->result_to_output[VERT_RESULT_EDGE] = stvp->num_outputs;
- stvp->output_semantic_name[stvp->num_outputs] = TGSI_SEMANTIC_EDGEFLAG;
- stvp->output_semantic_index[stvp->num_outputs] = 0;
-}
-
-
-/**
- * Translate a vertex program to create a new variant.
- */
-static struct st_vp_variant *
-st_translate_vertex_program(struct st_context *st,
- struct st_vertex_program *stvp,
- const struct st_vp_variant_key *key)
-{
- struct st_vp_variant *vpv = CALLOC_STRUCT(st_vp_variant);
- struct pipe_context *pipe = st->pipe;
- struct ureg_program *ureg;
- enum pipe_error error;
- unsigned num_outputs;
-
- st_prepare_vertex_program( st, stvp );
-
- _mesa_remove_output_reads(&stvp->Base.Base, PROGRAM_OUTPUT);
- _mesa_remove_output_reads(&stvp->Base.Base, PROGRAM_VARYING);
-
- ureg = ureg_create( TGSI_PROCESSOR_VERTEX );
- if (ureg == NULL) {
- FREE(vpv);
- return NULL;
- }
-
- vpv->key = *key;
-
- vpv->num_inputs = stvp->num_inputs;
- num_outputs = stvp->num_outputs;
- if (key->passthrough_edgeflags) {
- vpv->num_inputs++;
- num_outputs++;
- }
-
- if (ST_DEBUG & DEBUG_MESA) {
- _mesa_print_program(&stvp->Base.Base);
- _mesa_print_program_parameters(st->ctx, &stvp->Base.Base);
- debug_printf("\n");
- }
-
- error = st_translate_mesa_program(st->ctx,
- TGSI_PROCESSOR_VERTEX,
- ureg,
- &stvp->Base.Base,
- /* inputs */
- vpv->num_inputs,
- stvp->input_to_index,
- NULL, /* input semantic name */
- NULL, /* input semantic index */
- NULL,
- /* outputs */
- num_outputs,
- stvp->result_to_output,
- stvp->output_semantic_name,
- stvp->output_semantic_index,
- key->passthrough_edgeflags );
-
- if (error)
- goto fail;
-
- vpv->tgsi.tokens = ureg_get_tokens( ureg, NULL );
- if (!vpv->tgsi.tokens)
- goto fail;
-
- ureg_destroy( ureg );
-
- vpv->driver_shader = pipe->create_vs_state(pipe, &vpv->tgsi);
-
- if (ST_DEBUG & DEBUG_TGSI) {
- tgsi_dump( vpv->tgsi.tokens, 0 );
- debug_printf("\n");
- }
-
- return vpv;
-
-fail:
- debug_printf("%s: failed to translate Mesa program:\n", __FUNCTION__);
- _mesa_print_program(&stvp->Base.Base);
- debug_assert(0);
-
- ureg_destroy( ureg );
- return NULL;
-}
-
-
-/**
- * Find/create a vertex program variant.
- */
-struct st_vp_variant *
-st_get_vp_variant(struct st_context *st,
- struct st_vertex_program *stvp,
- const struct st_vp_variant_key *key)
-{
- struct st_vp_variant *vpv;
-
- /* Search for existing variant */
- for (vpv = stvp->variants; vpv; vpv = vpv->next) {
- if (memcmp(&vpv->key, key, sizeof(*key)) == 0) {
- break;
- }
- }
-
- if (!vpv) {
- /* create now */
- vpv = st_translate_vertex_program(st, stvp, key);
- if (vpv) {
- /* insert into list */
- vpv->next = stvp->variants;
- stvp->variants = vpv;
- }
- }
-
- return vpv;
-}
-
-
-/**
- * Translate a Mesa fragment shader into a TGSI shader using extra info in
- * the key.
- * \return new fragment program variant
- */
-static struct st_fp_variant *
-st_translate_fragment_program(struct st_context *st,
- struct st_fragment_program *stfp,
- const struct st_fp_variant_key *key)
-{
- struct pipe_context *pipe = st->pipe;
- struct st_fp_variant *variant = CALLOC_STRUCT(st_fp_variant);
- GLboolean deleteFP = GL_FALSE;
-
- if (!variant)
- return NULL;
-
- assert(!(key->bitmap && key->drawpixels));
-
-#if FEATURE_drawpix
- if (key->bitmap) {
- /* glBitmap drawing */
- struct gl_fragment_program *fp; /* we free this temp program below */
-
- st_make_bitmap_fragment_program(st, &stfp->Base,
- &fp, &variant->bitmap_sampler);
-
- variant->parameters = _mesa_clone_parameter_list(fp->Base.Parameters);
- stfp = st_fragment_program(fp);
- deleteFP = GL_TRUE;
- }
- else if (key->drawpixels) {
- /* glDrawPixels drawing */
- struct gl_fragment_program *fp; /* we free this temp program below */
-
- if (key->drawpixels_z || key->drawpixels_stencil) {
- fp = st_make_drawpix_z_stencil_program(st, key->drawpixels_z,
- key->drawpixels_stencil);
- }
- else {
- /* RGBA */
- st_make_drawpix_fragment_program(st, &stfp->Base, &fp);
- variant->parameters = _mesa_clone_parameter_list(fp->Base.Parameters);
- deleteFP = GL_TRUE;
- }
- stfp = st_fragment_program(fp);
- }
-#endif
-
- if (!stfp->tgsi.tokens) {
- /* need to translate Mesa instructions to TGSI now */
- GLuint outputMapping[FRAG_RESULT_MAX];
- GLuint inputMapping[FRAG_ATTRIB_MAX];
- GLuint interpMode[PIPE_MAX_SHADER_INPUTS]; /* XXX size? */
- GLuint attr;
- enum pipe_error error;
- const GLbitfield inputsRead = stfp->Base.Base.InputsRead;
- struct ureg_program *ureg;
- GLboolean write_all = GL_FALSE;
-
- ubyte input_semantic_name[PIPE_MAX_SHADER_INPUTS];
- ubyte input_semantic_index[PIPE_MAX_SHADER_INPUTS];
- uint fs_num_inputs = 0;
-
- ubyte fs_output_semantic_name[PIPE_MAX_SHADER_OUTPUTS];
- ubyte fs_output_semantic_index[PIPE_MAX_SHADER_OUTPUTS];
- uint fs_num_outputs = 0;
-
-
- _mesa_remove_output_reads(&stfp->Base.Base, PROGRAM_OUTPUT);
-
- /*
- * Convert Mesa program inputs to TGSI input register semantics.
- */
- for (attr = 0; attr < FRAG_ATTRIB_MAX; attr++) {
- if (inputsRead & (1 << attr)) {
- const GLuint slot = fs_num_inputs++;
-
- inputMapping[attr] = slot;
-
- switch (attr) {
- case FRAG_ATTRIB_WPOS:
- input_semantic_name[slot] = TGSI_SEMANTIC_POSITION;
- input_semantic_index[slot] = 0;
- interpMode[slot] = TGSI_INTERPOLATE_LINEAR;
- break;
- case FRAG_ATTRIB_COL0:
- input_semantic_name[slot] = TGSI_SEMANTIC_COLOR;
- input_semantic_index[slot] = 0;
- interpMode[slot] = TGSI_INTERPOLATE_LINEAR;
- break;
- case FRAG_ATTRIB_COL1:
- input_semantic_name[slot] = TGSI_SEMANTIC_COLOR;
- input_semantic_index[slot] = 1;
- interpMode[slot] = TGSI_INTERPOLATE_LINEAR;
- break;
- case FRAG_ATTRIB_FOGC:
- input_semantic_name[slot] = TGSI_SEMANTIC_FOG;
- input_semantic_index[slot] = 0;
- interpMode[slot] = TGSI_INTERPOLATE_PERSPECTIVE;
- break;
- case FRAG_ATTRIB_FACE:
- input_semantic_name[slot] = TGSI_SEMANTIC_FACE;
- input_semantic_index[slot] = 0;
- interpMode[slot] = TGSI_INTERPOLATE_CONSTANT;
- break;
- /* In most cases, there is nothing special about these
- * inputs, so adopt a convention to use the generic
- * semantic name and the mesa FRAG_ATTRIB_ number as the
- * index.
- *
- * All that is required is that the vertex shader labels
- * its own outputs similarly, and that the vertex shader
- * generates at least every output required by the
- * fragment shader plus fixed-function hardware (such as
- * BFC).
- *
- * There is no requirement that semantic indexes start at
- * zero or be restricted to a particular range -- nobody
- * should be building tables based on semantic index.
- */
- case FRAG_ATTRIB_PNTC:
- case FRAG_ATTRIB_TEX0:
- case FRAG_ATTRIB_TEX1:
- case FRAG_ATTRIB_TEX2:
- case FRAG_ATTRIB_TEX3:
- case FRAG_ATTRIB_TEX4:
- case FRAG_ATTRIB_TEX5:
- case FRAG_ATTRIB_TEX6:
- case FRAG_ATTRIB_TEX7:
- case FRAG_ATTRIB_VAR0:
- default:
- /* Actually, let's try and zero-base this just for
- * readability of the generated TGSI.
- */
- assert(attr >= FRAG_ATTRIB_TEX0);
- input_semantic_index[slot] = (attr - FRAG_ATTRIB_TEX0);
- input_semantic_name[slot] = TGSI_SEMANTIC_GENERIC;
- if (attr == FRAG_ATTRIB_PNTC)
- interpMode[slot] = TGSI_INTERPOLATE_LINEAR;
- else
- interpMode[slot] = TGSI_INTERPOLATE_PERSPECTIVE;
- break;
- }
- }
- else {
- inputMapping[attr] = -1;
- }
- }
-
- /*
- * Semantics and mapping for outputs
- */
- {
- uint numColors = 0;
- GLbitfield64 outputsWritten = stfp->Base.Base.OutputsWritten;
-
- /* if z is written, emit that first */
- if (outputsWritten & BITFIELD64_BIT(FRAG_RESULT_DEPTH)) {
- fs_output_semantic_name[fs_num_outputs] = TGSI_SEMANTIC_POSITION;
- fs_output_semantic_index[fs_num_outputs] = 0;
- outputMapping[FRAG_RESULT_DEPTH] = fs_num_outputs;
- fs_num_outputs++;
- outputsWritten &= ~(1 << FRAG_RESULT_DEPTH);
- }
-
- if (outputsWritten & BITFIELD64_BIT(FRAG_RESULT_STENCIL)) {
- fs_output_semantic_name[fs_num_outputs] = TGSI_SEMANTIC_STENCIL;
- fs_output_semantic_index[fs_num_outputs] = 0;
- outputMapping[FRAG_RESULT_STENCIL] = fs_num_outputs;
- fs_num_outputs++;
- outputsWritten &= ~(1 << FRAG_RESULT_STENCIL);
- }
-
- /* handle remaning outputs (color) */
- for (attr = 0; attr < FRAG_RESULT_MAX; attr++) {
- if (outputsWritten & BITFIELD64_BIT(attr)) {
- switch (attr) {
- case FRAG_RESULT_DEPTH:
- case FRAG_RESULT_STENCIL:
- /* handled above */
- assert(0);
- break;
- case FRAG_RESULT_COLOR:
- write_all = GL_TRUE; /* fallthrough */
- default:
- assert(attr == FRAG_RESULT_COLOR ||
- (FRAG_RESULT_DATA0 <= attr && attr < FRAG_RESULT_MAX));
- fs_output_semantic_name[fs_num_outputs] = TGSI_SEMANTIC_COLOR;
- fs_output_semantic_index[fs_num_outputs] = numColors;
- outputMapping[attr] = fs_num_outputs;
- numColors++;
- break;
- }
-
- fs_num_outputs++;
- }
- }
- }
-
- ureg = ureg_create( TGSI_PROCESSOR_FRAGMENT );
- if (ureg == NULL)
- return NULL;
-
- if (ST_DEBUG & DEBUG_MESA) {
- _mesa_print_program(&stfp->Base.Base);
- _mesa_print_program_parameters(st->ctx, &stfp->Base.Base);
- debug_printf("\n");
- }
- if (write_all == GL_TRUE)
- ureg_property_fs_color0_writes_all_cbufs(ureg, 1);
-
- error = st_translate_mesa_program(st->ctx,
- TGSI_PROCESSOR_FRAGMENT,
- ureg,
- &stfp->Base.Base,
- /* inputs */
- fs_num_inputs,
- inputMapping,
- input_semantic_name,
- input_semantic_index,
- interpMode,
- /* outputs */
- fs_num_outputs,
- outputMapping,
- fs_output_semantic_name,
- fs_output_semantic_index, FALSE );
-
- stfp->tgsi.tokens = ureg_get_tokens( ureg, NULL );
- ureg_destroy( ureg );
- }
-
- /* fill in variant */
- variant->driver_shader = pipe->create_fs_state(pipe, &stfp->tgsi);
- variant->key = *key;
-
- if (ST_DEBUG & DEBUG_TGSI) {
- tgsi_dump( stfp->tgsi.tokens, 0/*TGSI_DUMP_VERBOSE*/ );
- debug_printf("\n");
- }
-
- if (deleteFP) {
- /* Free the temporary program made above */
- struct gl_fragment_program *fp = &stfp->Base;
- _mesa_reference_fragprog(st->ctx, &fp, NULL);
- }
-
- return variant;
-}
-
-
-/**
- * Translate fragment program if needed.
- */
-struct st_fp_variant *
-st_get_fp_variant(struct st_context *st,
- struct st_fragment_program *stfp,
- const struct st_fp_variant_key *key)
-{
- struct st_fp_variant *fpv;
-
- /* Search for existing variant */
- for (fpv = stfp->variants; fpv; fpv = fpv->next) {
- if (memcmp(&fpv->key, key, sizeof(*key)) == 0) {
- break;
- }
- }
-
- if (!fpv) {
- /* create new */
- fpv = st_translate_fragment_program(st, stfp, key);
- if (fpv) {
- /* insert into list */
- fpv->next = stfp->variants;
- stfp->variants = fpv;
- }
- }
-
- return fpv;
-}
-
-
-/**
- * Translate a geometry program to create a new variant.
- */
-static struct st_gp_variant *
-st_translate_geometry_program(struct st_context *st,
- struct st_geometry_program *stgp,
- const struct st_gp_variant_key *key)
-{
- GLuint inputMapping[GEOM_ATTRIB_MAX];
- GLuint outputMapping[GEOM_RESULT_MAX];
- struct pipe_context *pipe = st->pipe;
- enum pipe_error error;
- GLuint attr;
- const GLbitfield inputsRead = stgp->Base.Base.InputsRead;
- GLuint vslot = 0;
- GLuint num_generic = 0;
-
- uint gs_num_inputs = 0;
- uint gs_builtin_inputs = 0;
- uint gs_array_offset = 0;
-
- ubyte gs_output_semantic_name[PIPE_MAX_SHADER_OUTPUTS];
- ubyte gs_output_semantic_index[PIPE_MAX_SHADER_OUTPUTS];
- uint gs_num_outputs = 0;
-
- GLint i;
- GLuint maxSlot = 0;
- struct ureg_program *ureg;
-
- struct st_gp_variant *gpv;
-
- gpv = CALLOC_STRUCT(st_gp_variant);
- if (!gpv)
- return NULL;
-
- _mesa_remove_output_reads(&stgp->Base.Base, PROGRAM_OUTPUT);
- _mesa_remove_output_reads(&stgp->Base.Base, PROGRAM_VARYING);
-
- ureg = ureg_create( TGSI_PROCESSOR_GEOMETRY );
- if (ureg == NULL) {
- FREE(gpv);
- return NULL;
- }
-
- /* which vertex output goes to the first geometry input */
- vslot = 0;
-
- memset(inputMapping, 0, sizeof(inputMapping));
- memset(outputMapping, 0, sizeof(outputMapping));
-
- /*
- * Convert Mesa program inputs to TGSI input register semantics.
- */
- for (attr = 0; attr < GEOM_ATTRIB_MAX; attr++) {
- if (inputsRead & (1 << attr)) {
- const GLuint slot = gs_num_inputs;
-
- gs_num_inputs++;
-
- inputMapping[attr] = slot;
-
- stgp->input_map[slot + gs_array_offset] = vslot - gs_builtin_inputs;
- stgp->input_to_index[attr] = vslot;
- stgp->index_to_input[vslot] = attr;
- ++vslot;
-
- if (attr != GEOM_ATTRIB_PRIMITIVE_ID) {
- gs_array_offset += 2;
- } else
- ++gs_builtin_inputs;
-
-#if 0
- debug_printf("input map at %d = %d\n",
- slot + gs_array_offset, stgp->input_map[slot + gs_array_offset]);
-#endif
-
- switch (attr) {
- case GEOM_ATTRIB_PRIMITIVE_ID:
- stgp->input_semantic_name[slot] = TGSI_SEMANTIC_PRIMID;
- stgp->input_semantic_index[slot] = 0;
- break;
- case GEOM_ATTRIB_POSITION:
- stgp->input_semantic_name[slot] = TGSI_SEMANTIC_POSITION;
- stgp->input_semantic_index[slot] = 0;
- break;
- case GEOM_ATTRIB_COLOR0:
- stgp->input_semantic_name[slot] = TGSI_SEMANTIC_COLOR;
- stgp->input_semantic_index[slot] = 0;
- break;
- case GEOM_ATTRIB_COLOR1:
- stgp->input_semantic_name[slot] = TGSI_SEMANTIC_COLOR;
- stgp->input_semantic_index[slot] = 1;
- break;
- case GEOM_ATTRIB_FOG_FRAG_COORD:
- stgp->input_semantic_name[slot] = TGSI_SEMANTIC_FOG;
- stgp->input_semantic_index[slot] = 0;
- break;
- case GEOM_ATTRIB_TEX_COORD:
- stgp->input_semantic_name[slot] = TGSI_SEMANTIC_GENERIC;
- stgp->input_semantic_index[slot] = num_generic++;
- break;
- case GEOM_ATTRIB_VAR0:
- /* fall-through */
- default:
- stgp->input_semantic_name[slot] = TGSI_SEMANTIC_GENERIC;
- stgp->input_semantic_index[slot] = num_generic++;
- }
- }
- }
-
- /* initialize output semantics to defaults */
- for (i = 0; i < PIPE_MAX_SHADER_OUTPUTS; i++) {
- gs_output_semantic_name[i] = TGSI_SEMANTIC_GENERIC;
- gs_output_semantic_index[i] = 0;
- }
-
- num_generic = 0;
- /*
- * Determine number of outputs, the (default) output register
- * mapping and the semantic information for each output.
- */
- for (attr = 0; attr < GEOM_RESULT_MAX; attr++) {
- if (stgp->Base.Base.OutputsWritten & BITFIELD64_BIT(attr)) {
- GLuint slot;
-
- slot = gs_num_outputs;
- gs_num_outputs++;
- outputMapping[attr] = slot;
-
- switch (attr) {
- case GEOM_RESULT_POS:
- assert(slot == 0);
- gs_output_semantic_name[slot] = TGSI_SEMANTIC_POSITION;
- gs_output_semantic_index[slot] = 0;
- break;
- case GEOM_RESULT_COL0:
- gs_output_semantic_name[slot] = TGSI_SEMANTIC_COLOR;
- gs_output_semantic_index[slot] = 0;
- break;
- case GEOM_RESULT_COL1:
- gs_output_semantic_name[slot] = TGSI_SEMANTIC_COLOR;
- gs_output_semantic_index[slot] = 1;
- break;
- case GEOM_RESULT_SCOL0:
- gs_output_semantic_name[slot] = TGSI_SEMANTIC_BCOLOR;
- gs_output_semantic_index[slot] = 0;
- break;
- case GEOM_RESULT_SCOL1:
- gs_output_semantic_name[slot] = TGSI_SEMANTIC_BCOLOR;
- gs_output_semantic_index[slot] = 1;
- break;
- case GEOM_RESULT_FOGC:
- gs_output_semantic_name[slot] = TGSI_SEMANTIC_FOG;
- gs_output_semantic_index[slot] = 0;
- break;
- case GEOM_RESULT_PSIZ:
- gs_output_semantic_name[slot] = TGSI_SEMANTIC_PSIZE;
- gs_output_semantic_index[slot] = 0;
- break;
- case GEOM_RESULT_TEX0:
- case GEOM_RESULT_TEX1:
- case GEOM_RESULT_TEX2:
- case GEOM_RESULT_TEX3:
- case GEOM_RESULT_TEX4:
- case GEOM_RESULT_TEX5:
- case GEOM_RESULT_TEX6:
- case GEOM_RESULT_TEX7:
- /* fall-through */
- case GEOM_RESULT_VAR0:
- /* fall-through */
- default:
- assert(slot < Elements(gs_output_semantic_name));
- /* use default semantic info */
- gs_output_semantic_name[slot] = TGSI_SEMANTIC_GENERIC;
- gs_output_semantic_index[slot] = num_generic++;
- }
- }
- }
-
- assert(gs_output_semantic_name[0] == TGSI_SEMANTIC_POSITION);
-
- /* find max output slot referenced to compute gs_num_outputs */
- for (attr = 0; attr < GEOM_RESULT_MAX; attr++) {
- if (outputMapping[attr] != ~0 && outputMapping[attr] > maxSlot)
- maxSlot = outputMapping[attr];
- }
- gs_num_outputs = maxSlot + 1;
-
-#if 0 /* debug */
- {
- GLuint i;
- printf("outputMapping? %d\n", outputMapping ? 1 : 0);
- if (outputMapping) {
- printf("attr -> slot\n");
- for (i = 0; i < 16; i++) {
- printf(" %2d %3d\n", i, outputMapping[i]);
- }
- }
- printf("slot sem_name sem_index\n");
- for (i = 0; i < gs_num_outputs; i++) {
- printf(" %2d %d %d\n",
- i,
- gs_output_semantic_name[i],
- gs_output_semantic_index[i]);
- }
- }
-#endif
-
- /* free old shader state, if any */
- if (stgp->tgsi.tokens) {
- st_free_tokens(stgp->tgsi.tokens);
- stgp->tgsi.tokens = NULL;
- }
-
- ureg_property_gs_input_prim(ureg, stgp->Base.InputType);
- ureg_property_gs_output_prim(ureg, stgp->Base.OutputType);
- ureg_property_gs_max_vertices(ureg, stgp->Base.VerticesOut);
-
- error = st_translate_mesa_program(st->ctx,
- TGSI_PROCESSOR_GEOMETRY,
- ureg,
- &stgp->Base.Base,
- /* inputs */
- gs_num_inputs,
- inputMapping,
- stgp->input_semantic_name,
- stgp->input_semantic_index,
- NULL,
- /* outputs */
- gs_num_outputs,
- outputMapping,
- gs_output_semantic_name,
- gs_output_semantic_index,
- FALSE);
-
- stgp->num_inputs = gs_num_inputs;
- stgp->tgsi.tokens = ureg_get_tokens( ureg, NULL );
- ureg_destroy( ureg );
-
- /* fill in new variant */
- gpv->driver_shader = pipe->create_gs_state(pipe, &stgp->tgsi);
- gpv->key = *key;
-
- if ((ST_DEBUG & DEBUG_TGSI) && (ST_DEBUG & DEBUG_MESA)) {
- _mesa_print_program(&stgp->Base.Base);
- debug_printf("\n");
- }
-
- if (ST_DEBUG & DEBUG_TGSI) {
- tgsi_dump(stgp->tgsi.tokens, 0);
- debug_printf("\n");
- }
-
- return gpv;
-}
-
-
-/**
- * Get/create geometry program variant.
- */
-struct st_gp_variant *
-st_get_gp_variant(struct st_context *st,
- struct st_geometry_program *stgp,
- const struct st_gp_variant_key *key)
-{
- struct st_gp_variant *gpv;
-
- /* Search for existing variant */
- for (gpv = stgp->variants; gpv; gpv = gpv->next) {
- if (memcmp(&gpv->key, key, sizeof(*key)) == 0) {
- break;
- }
- }
-
- if (!gpv) {
- /* create new */
- gpv = st_translate_geometry_program(st, stgp, key);
- if (gpv) {
- /* insert into list */
- gpv->next = stgp->variants;
- stgp->variants = gpv;
- }
- }
-
- return gpv;
-}
-
-
-
-
-/**
- * Debug- print current shader text
- */
-void
-st_print_shaders(struct gl_context *ctx)
-{
- struct gl_shader_program *shProg[3] = {
- ctx->Shader.CurrentVertexProgram,
- ctx->Shader.CurrentGeometryProgram,
- ctx->Shader.CurrentFragmentProgram,
- };
- unsigned j;
-
- for (j = 0; j < 3; j++) {
- unsigned i;
-
- if (shProg[j] == NULL)
- continue;
-
- for (i = 0; i < shProg[j]->NumShaders; i++) {
- struct gl_shader *sh;
-
- switch (shProg[j]->Shaders[i]->Type) {
- case GL_VERTEX_SHADER:
- sh = (i != 0) ? NULL : shProg[j]->Shaders[i];
- break;
- case GL_GEOMETRY_SHADER_ARB:
- sh = (i != 1) ? NULL : shProg[j]->Shaders[i];
- break;
- case GL_FRAGMENT_SHADER:
- sh = (i != 2) ? NULL : shProg[j]->Shaders[i];
- break;
- default:
- assert(0);
- sh = NULL;
- break;
- }
-
- if (sh != NULL) {
- printf("GLSL shader %u of %u:\n", i, shProg[j]->NumShaders);
- printf("%s\n", sh->Source);
- }
- }
- }
-}
-
-
-/**
- * Vert/Geom/Frag programs have per-context variants. Free all the
- * variants attached to the given program which match the given context.
- */
-static void
-destroy_program_variants(struct st_context *st, struct gl_program *program)
-{
- if (!program)
- return;
-
- switch (program->Target) {
- case GL_VERTEX_PROGRAM_ARB:
- {
- struct st_vertex_program *stvp = (struct st_vertex_program *) program;
- struct st_vp_variant *vpv, **prevPtr = &stvp->variants;
-
- for (vpv = stvp->variants; vpv; ) {
- struct st_vp_variant *next = vpv->next;
- if (vpv->key.st == st) {
- /* unlink from list */
- *prevPtr = next;
- /* destroy this variant */
- delete_vp_variant(st, vpv);
- }
- else {
- prevPtr = &vpv->next;
- }
- vpv = next;
- }
- }
- break;
- case GL_FRAGMENT_PROGRAM_ARB:
- {
- struct st_fragment_program *stfp =
- (struct st_fragment_program *) program;
- struct st_fp_variant *fpv, **prevPtr = &stfp->variants;
-
- for (fpv = stfp->variants; fpv; ) {
- struct st_fp_variant *next = fpv->next;
- if (fpv->key.st == st) {
- /* unlink from list */
- *prevPtr = next;
- /* destroy this variant */
- delete_fp_variant(st, fpv);
- }
- else {
- prevPtr = &fpv->next;
- }
- fpv = next;
- }
- }
- break;
- case MESA_GEOMETRY_PROGRAM:
- {
- struct st_geometry_program *stgp =
- (struct st_geometry_program *) program;
- struct st_gp_variant *gpv, **prevPtr = &stgp->variants;
-
- for (gpv = stgp->variants; gpv; ) {
- struct st_gp_variant *next = gpv->next;
- if (gpv->key.st == st) {
- /* unlink from list */
- *prevPtr = next;
- /* destroy this variant */
- delete_gp_variant(st, gpv);
- }
- else {
- prevPtr = &gpv->next;
- }
- gpv = next;
- }
- }
- break;
- default:
- _mesa_problem(NULL, "Unexpected program target in "
- "destroy_program_variants_cb()");
- }
-}
-
-
-/**
- * Callback for _mesa_HashWalk. Free all the shader's program variants
- * which match the given context.
- */
-static void
-destroy_shader_program_variants_cb(GLuint key, void *data, void *userData)
-{
- struct st_context *st = (struct st_context *) userData;
- struct gl_shader *shader = (struct gl_shader *) data;
-
- switch (shader->Type) {
- case GL_SHADER_PROGRAM_MESA:
- {
- struct gl_shader_program *shProg = (struct gl_shader_program *) data;
- GLuint i;
-
- for (i = 0; i < shProg->NumShaders; i++) {
- destroy_program_variants(st, shProg->Shaders[i]->Program);
- }
-
- destroy_program_variants(st, (struct gl_program *)
- shProg->VertexProgram);
- destroy_program_variants(st, (struct gl_program *)
- shProg->FragmentProgram);
- destroy_program_variants(st, (struct gl_program *)
- shProg->GeometryProgram);
- }
- break;
- case GL_VERTEX_SHADER:
- case GL_FRAGMENT_SHADER:
- case GL_GEOMETRY_SHADER:
- {
- destroy_program_variants(st, shader->Program);
- }
- break;
- default:
- assert(0);
- }
-}
-
-
-/**
- * Callback for _mesa_HashWalk. Free all the program variants which match
- * the given context.
- */
-static void
-destroy_program_variants_cb(GLuint key, void *data, void *userData)
-{
- struct st_context *st = (struct st_context *) userData;
- struct gl_program *program = (struct gl_program *) data;
- destroy_program_variants(st, program);
-}
-
-
-/**
- * Walk over all shaders and programs to delete any variants which
- * belong to the given context.
- * This is called during context tear-down.
- */
-void
-st_destroy_program_variants(struct st_context *st)
-{
- /* ARB vert/frag program */
- _mesa_HashWalk(st->ctx->Shared->Programs,
- destroy_program_variants_cb, st);
-
- /* GLSL vert/frag/geom shaders */
- _mesa_HashWalk(st->ctx->Shared->ShaderObjects,
- destroy_shader_program_variants_cb, st);
-}
+/**************************************************************************
+ *
+ * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ **************************************************************************/
+ /*
+ * Authors:
+ * Keith Whitwell <keith@tungstengraphics.com>
+ * Brian Paul
+ */
+
+
+#include "main/imports.h"
+#include "main/hash.h"
+#include "main/mfeatures.h"
+#include "main/mtypes.h"
+#include "program/prog_parameter.h"
+#include "program/prog_print.h"
+#include "program/programopt.h"
+
+#include "pipe/p_context.h"
+#include "pipe/p_defines.h"
+#include "pipe/p_shader_tokens.h"
+#include "draw/draw_context.h"
+#include "tgsi/tgsi_dump.h"
+#include "tgsi/tgsi_ureg.h"
+
+#include "st_debug.h"
+#include "st_cb_bitmap.h"
+#include "st_cb_drawpixels.h"
+#include "st_context.h"
+#include "st_program.h"
+#include "st_mesa_to_tgsi.h"
+#include "cso_cache/cso_context.h"
+
+
+
+/**
+ * Delete a vertex program variant. Note the caller must unlink
+ * the variant from the linked list.
+ */
+static void
+delete_vp_variant(struct st_context *st, struct st_vp_variant *vpv)
+{
+ if (vpv->driver_shader)
+ cso_delete_vertex_shader(st->cso_context, vpv->driver_shader);
+
+#if FEATURE_feedback || FEATURE_rastpos
+ if (vpv->draw_shader)
+ draw_delete_vertex_shader( st->draw, vpv->draw_shader );
+#endif
+
+ if (vpv->tgsi.tokens)
+ st_free_tokens(vpv->tgsi.tokens);
+
+ FREE( vpv );
+}
+
+
+
+/**
+ * Clean out any old compilations:
+ */
+void
+st_release_vp_variants( struct st_context *st,
+ struct st_vertex_program *stvp )
+{
+ struct st_vp_variant *vpv;
+
+ for (vpv = stvp->variants; vpv; ) {
+ struct st_vp_variant *next = vpv->next;
+ delete_vp_variant(st, vpv);
+ vpv = next;
+ }
+
+ stvp->variants = NULL;
+}
+
+
+
+/**
+ * Delete a fragment program variant. Note the caller must unlink
+ * the variant from the linked list.
+ */
+static void
+delete_fp_variant(struct st_context *st, struct st_fp_variant *fpv)
+{
+ if (fpv->driver_shader)
+ cso_delete_fragment_shader(st->cso_context, fpv->driver_shader);
+ if (fpv->parameters)
+ _mesa_free_parameter_list(fpv->parameters);
+
+ FREE(fpv);
+}
+
+
+/**
+ * Free all variants of a fragment program.
+ */
+void
+st_release_fp_variants(struct st_context *st, struct st_fragment_program *stfp)
+{
+ struct st_fp_variant *fpv;
+
+ for (fpv = stfp->variants; fpv; ) {
+ struct st_fp_variant *next = fpv->next;
+ delete_fp_variant(st, fpv);
+ fpv = next;
+ }
+
+ stfp->variants = NULL;
+}
+
+
+/**
+ * Delete a geometry program variant. Note the caller must unlink
+ * the variant from the linked list.
+ */
+static void
+delete_gp_variant(struct st_context *st, struct st_gp_variant *gpv)
+{
+ if (gpv->driver_shader)
+ cso_delete_geometry_shader(st->cso_context, gpv->driver_shader);
+
+ FREE(gpv);
+}
+
+
+/**
+ * Free all variants of a geometry program.
+ */
+void
+st_release_gp_variants(struct st_context *st, struct st_geometry_program *stgp)
+{
+ struct st_gp_variant *gpv;
+
+ for (gpv = stgp->variants; gpv; ) {
+ struct st_gp_variant *next = gpv->next;
+ delete_gp_variant(st, gpv);
+ gpv = next;
+ }
+
+ stgp->variants = NULL;
+}
+
+
+
+
+/**
+ * Translate a Mesa vertex shader into a TGSI shader.
+ * \param outputMapping to map vertex program output registers (VERT_RESULT_x)
+ * to TGSI output slots
+ * \param tokensOut destination for TGSI tokens
+ * \return pointer to cached pipe_shader object.
+ */
+static void
+st_prepare_vertex_program(struct st_context *st,
+ struct st_vertex_program *stvp)
+{
+ GLuint attr;
+
+ stvp->num_inputs = 0;
+ stvp->num_outputs = 0;
+
+ if (stvp->Base.IsPositionInvariant)
+ _mesa_insert_mvp_code(st->ctx, &stvp->Base);
+
+ assert(stvp->Base.Base.NumInstructions > 1);
+
+ /*
+ * Determine number of inputs, the mappings between VERT_ATTRIB_x
+ * and TGSI generic input indexes, plus input attrib semantic info.
+ */
+ for (attr = 0; attr < VERT_ATTRIB_MAX; attr++) {
+ if (stvp->Base.Base.InputsRead & (1 << attr)) {
+ stvp->input_to_index[attr] = stvp->num_inputs;
+ stvp->index_to_input[stvp->num_inputs] = attr;
+ stvp->num_inputs++;
+ }
+ }
+ /* bit of a hack, presetup potentially unused edgeflag input */
+ stvp->input_to_index[VERT_ATTRIB_EDGEFLAG] = stvp->num_inputs;
+ stvp->index_to_input[stvp->num_inputs] = VERT_ATTRIB_EDGEFLAG;
+
+ /* Compute mapping of vertex program outputs to slots.
+ */
+ for (attr = 0; attr < VERT_RESULT_MAX; attr++) {
+ if ((stvp->Base.Base.OutputsWritten & BITFIELD64_BIT(attr)) == 0) {
+ stvp->result_to_output[attr] = ~0;
+ }
+ else {
+ unsigned slot = stvp->num_outputs++;
+
+ stvp->result_to_output[attr] = slot;
+
+ switch (attr) {
+ case VERT_RESULT_HPOS:
+ stvp->output_semantic_name[slot] = TGSI_SEMANTIC_POSITION;
+ stvp->output_semantic_index[slot] = 0;
+ break;
+ case VERT_RESULT_COL0:
+ stvp->output_semantic_name[slot] = TGSI_SEMANTIC_COLOR;
+ stvp->output_semantic_index[slot] = 0;
+ break;
+ case VERT_RESULT_COL1:
+ stvp->output_semantic_name[slot] = TGSI_SEMANTIC_COLOR;
+ stvp->output_semantic_index[slot] = 1;
+ break;
+ case VERT_RESULT_BFC0:
+ stvp->output_semantic_name[slot] = TGSI_SEMANTIC_BCOLOR;
+ stvp->output_semantic_index[slot] = 0;
+ break;
+ case VERT_RESULT_BFC1:
+ stvp->output_semantic_name[slot] = TGSI_SEMANTIC_BCOLOR;
+ stvp->output_semantic_index[slot] = 1;
+ break;
+ case VERT_RESULT_FOGC:
+ stvp->output_semantic_name[slot] = TGSI_SEMANTIC_FOG;
+ stvp->output_semantic_index[slot] = 0;
+ break;
+ case VERT_RESULT_PSIZ:
+ stvp->output_semantic_name[slot] = TGSI_SEMANTIC_PSIZE;
+ stvp->output_semantic_index[slot] = 0;
+ break;
+ case VERT_RESULT_EDGE:
+ assert(0);
+ break;
+
+ case VERT_RESULT_TEX0:
+ case VERT_RESULT_TEX1:
+ case VERT_RESULT_TEX2:
+ case VERT_RESULT_TEX3:
+ case VERT_RESULT_TEX4:
+ case VERT_RESULT_TEX5:
+ case VERT_RESULT_TEX6:
+ case VERT_RESULT_TEX7:
+ stvp->output_semantic_name[slot] = TGSI_SEMANTIC_GENERIC;
+ stvp->output_semantic_index[slot] = attr - VERT_RESULT_TEX0;
+ break;
+
+ case VERT_RESULT_VAR0:
+ default:
+ assert(attr < VERT_RESULT_MAX);
+ stvp->output_semantic_name[slot] = TGSI_SEMANTIC_GENERIC;
+ stvp->output_semantic_index[slot] = (FRAG_ATTRIB_VAR0 -
+ FRAG_ATTRIB_TEX0 +
+ attr -
+ VERT_RESULT_VAR0);
+ break;
+ }
+ }
+ }
+ /* similar hack to above, presetup potentially unused edgeflag output */
+ stvp->result_to_output[VERT_RESULT_EDGE] = stvp->num_outputs;
+ stvp->output_semantic_name[stvp->num_outputs] = TGSI_SEMANTIC_EDGEFLAG;
+ stvp->output_semantic_index[stvp->num_outputs] = 0;
+}
+
+
+/**
+ * Translate a vertex program to create a new variant.
+ */
+static struct st_vp_variant *
+st_translate_vertex_program(struct st_context *st,
+ struct st_vertex_program *stvp,
+ const struct st_vp_variant_key *key)
+{
+ struct st_vp_variant *vpv = CALLOC_STRUCT(st_vp_variant);
+ struct pipe_context *pipe = st->pipe;
+ struct ureg_program *ureg;
+ enum pipe_error error;
+ unsigned num_outputs;
+
+ st_prepare_vertex_program( st, stvp );
+
+ _mesa_remove_output_reads(&stvp->Base.Base, PROGRAM_OUTPUT);
+ _mesa_remove_output_reads(&stvp->Base.Base, PROGRAM_VARYING);
+
+ ureg = ureg_create( TGSI_PROCESSOR_VERTEX );
+ if (ureg == NULL) {
+ FREE(vpv);
+ return NULL;
+ }
+
+ vpv->key = *key;
+
+ vpv->num_inputs = stvp->num_inputs;
+ num_outputs = stvp->num_outputs;
+ if (key->passthrough_edgeflags) {
+ vpv->num_inputs++;
+ num_outputs++;
+ }
+
+ if (ST_DEBUG & DEBUG_MESA) {
+ _mesa_print_program(&stvp->Base.Base);
+ _mesa_print_program_parameters(st->ctx, &stvp->Base.Base);
+ debug_printf("\n");
+ }
+
+ error = st_translate_mesa_program(st->ctx,
+ TGSI_PROCESSOR_VERTEX,
+ ureg,
+ &stvp->Base.Base,
+ /* inputs */
+ vpv->num_inputs,
+ stvp->input_to_index,
+ NULL, /* input semantic name */
+ NULL, /* input semantic index */
+ NULL,
+ /* outputs */
+ num_outputs,
+ stvp->result_to_output,
+ stvp->output_semantic_name,
+ stvp->output_semantic_index,
+ key->passthrough_edgeflags );
+
+ if (error)
+ goto fail;
+
+ vpv->tgsi.tokens = ureg_get_tokens( ureg, NULL );
+ if (!vpv->tgsi.tokens)
+ goto fail;
+
+ ureg_destroy( ureg );
+
+ vpv->driver_shader = pipe->create_vs_state(pipe, &vpv->tgsi);
+
+ if (ST_DEBUG & DEBUG_TGSI) {
+ tgsi_dump( vpv->tgsi.tokens, 0 );
+ debug_printf("\n");
+ }
+
+ return vpv;
+
+fail:
+ debug_printf("%s: failed to translate Mesa program:\n", __FUNCTION__);
+ _mesa_print_program(&stvp->Base.Base);
+ debug_assert(0);
+
+ ureg_destroy( ureg );
+ return NULL;
+}
+
+
+/**
+ * Find/create a vertex program variant.
+ */
+struct st_vp_variant *
+st_get_vp_variant(struct st_context *st,
+ struct st_vertex_program *stvp,
+ const struct st_vp_variant_key *key)
+{
+ struct st_vp_variant *vpv;
+
+ /* Search for existing variant */
+ for (vpv = stvp->variants; vpv; vpv = vpv->next) {
+ if (memcmp(&vpv->key, key, sizeof(*key)) == 0) {
+ break;
+ }
+ }
+
+ if (!vpv) {
+ /* create now */
+ vpv = st_translate_vertex_program(st, stvp, key);
+ if (vpv) {
+ /* insert into list */
+ vpv->next = stvp->variants;
+ stvp->variants = vpv;
+ }
+ }
+
+ return vpv;
+}
+
+
+/**
+ * Translate a Mesa fragment shader into a TGSI shader using extra info in
+ * the key.
+ * \return new fragment program variant
+ */
+static struct st_fp_variant *
+st_translate_fragment_program(struct st_context *st,
+ struct st_fragment_program *stfp,
+ const struct st_fp_variant_key *key)
+{
+ struct pipe_context *pipe = st->pipe;
+ struct st_fp_variant *variant = CALLOC_STRUCT(st_fp_variant);
+ GLboolean deleteFP = GL_FALSE;
+
+ if (!variant)
+ return NULL;
+
+ assert(!(key->bitmap && key->drawpixels));
+
+#if FEATURE_drawpix
+ if (key->bitmap) {
+ /* glBitmap drawing */
+ struct gl_fragment_program *fp; /* we free this temp program below */
+
+ st_make_bitmap_fragment_program(st, &stfp->Base,
+ &fp, &variant->bitmap_sampler);
+
+ variant->parameters = _mesa_clone_parameter_list(fp->Base.Parameters);
+ stfp = st_fragment_program(fp);
+ deleteFP = GL_TRUE;
+ }
+ else if (key->drawpixels) {
+ /* glDrawPixels drawing */
+ struct gl_fragment_program *fp; /* we free this temp program below */
+
+ if (key->drawpixels_z || key->drawpixels_stencil) {
+ fp = st_make_drawpix_z_stencil_program(st, key->drawpixels_z,
+ key->drawpixels_stencil);
+ }
+ else {
+ /* RGBA */
+ st_make_drawpix_fragment_program(st, &stfp->Base, &fp);
+ variant->parameters = _mesa_clone_parameter_list(fp->Base.Parameters);
+ deleteFP = GL_TRUE;
+ }
+ stfp = st_fragment_program(fp);
+ }
+#endif
+
+ if (!stfp->tgsi.tokens) {
+ /* need to translate Mesa instructions to TGSI now */
+ GLuint outputMapping[FRAG_RESULT_MAX];
+ GLuint inputMapping[FRAG_ATTRIB_MAX];
+ GLuint interpMode[PIPE_MAX_SHADER_INPUTS]; /* XXX size? */
+ GLuint attr;
+ enum pipe_error error;
+ const GLbitfield inputsRead = stfp->Base.Base.InputsRead;
+ struct ureg_program *ureg;
+ GLboolean write_all = GL_FALSE;
+
+ ubyte input_semantic_name[PIPE_MAX_SHADER_INPUTS];
+ ubyte input_semantic_index[PIPE_MAX_SHADER_INPUTS];
+ uint fs_num_inputs = 0;
+
+ ubyte fs_output_semantic_name[PIPE_MAX_SHADER_OUTPUTS];
+ ubyte fs_output_semantic_index[PIPE_MAX_SHADER_OUTPUTS];
+ uint fs_num_outputs = 0;
+
+
+ _mesa_remove_output_reads(&stfp->Base.Base, PROGRAM_OUTPUT);
+
+ /*
+ * Convert Mesa program inputs to TGSI input register semantics.
+ */
+ for (attr = 0; attr < FRAG_ATTRIB_MAX; attr++) {
+ if (inputsRead & (1 << attr)) {
+ const GLuint slot = fs_num_inputs++;
+
+ inputMapping[attr] = slot;
+
+ switch (attr) {
+ case FRAG_ATTRIB_WPOS:
+ input_semantic_name[slot] = TGSI_SEMANTIC_POSITION;
+ input_semantic_index[slot] = 0;
+ interpMode[slot] = TGSI_INTERPOLATE_LINEAR;
+ break;
+ case FRAG_ATTRIB_COL0:
+ input_semantic_name[slot] = TGSI_SEMANTIC_COLOR;
+ input_semantic_index[slot] = 0;
+ interpMode[slot] = TGSI_INTERPOLATE_LINEAR;
+ break;
+ case FRAG_ATTRIB_COL1:
+ input_semantic_name[slot] = TGSI_SEMANTIC_COLOR;
+ input_semantic_index[slot] = 1;
+ interpMode[slot] = TGSI_INTERPOLATE_LINEAR;
+ break;
+ case FRAG_ATTRIB_FOGC:
+ input_semantic_name[slot] = TGSI_SEMANTIC_FOG;
+ input_semantic_index[slot] = 0;
+ interpMode[slot] = TGSI_INTERPOLATE_PERSPECTIVE;
+ break;
+ case FRAG_ATTRIB_FACE:
+ input_semantic_name[slot] = TGSI_SEMANTIC_FACE;
+ input_semantic_index[slot] = 0;
+ interpMode[slot] = TGSI_INTERPOLATE_CONSTANT;
+ break;
+ /* In most cases, there is nothing special about these
+ * inputs, so adopt a convention to use the generic
+ * semantic name and the mesa FRAG_ATTRIB_ number as the
+ * index.
+ *
+ * All that is required is that the vertex shader labels
+ * its own outputs similarly, and that the vertex shader
+ * generates at least every output required by the
+ * fragment shader plus fixed-function hardware (such as
+ * BFC).
+ *
+ * There is no requirement that semantic indexes start at
+ * zero or be restricted to a particular range -- nobody
+ * should be building tables based on semantic index.
+ */
+ case FRAG_ATTRIB_PNTC:
+ case FRAG_ATTRIB_TEX0:
+ case FRAG_ATTRIB_TEX1:
+ case FRAG_ATTRIB_TEX2:
+ case FRAG_ATTRIB_TEX3:
+ case FRAG_ATTRIB_TEX4:
+ case FRAG_ATTRIB_TEX5:
+ case FRAG_ATTRIB_TEX6:
+ case FRAG_ATTRIB_TEX7:
+ case FRAG_ATTRIB_VAR0:
+ default:
+ /* Actually, let's try and zero-base this just for
+ * readability of the generated TGSI.
+ */
+ assert(attr >= FRAG_ATTRIB_TEX0);
+ input_semantic_index[slot] = (attr - FRAG_ATTRIB_TEX0);
+ input_semantic_name[slot] = TGSI_SEMANTIC_GENERIC;
+ if (attr == FRAG_ATTRIB_PNTC)
+ interpMode[slot] = TGSI_INTERPOLATE_LINEAR;
+ else
+ interpMode[slot] = TGSI_INTERPOLATE_PERSPECTIVE;
+ break;
+ }
+ }
+ else {
+ inputMapping[attr] = -1;
+ }
+ }
+
+ /*
+ * Semantics and mapping for outputs
+ */
+ {
+ uint numColors = 0;
+ GLbitfield64 outputsWritten = stfp->Base.Base.OutputsWritten;
+
+ /* if z is written, emit that first */
+ if (outputsWritten & BITFIELD64_BIT(FRAG_RESULT_DEPTH)) {
+ fs_output_semantic_name[fs_num_outputs] = TGSI_SEMANTIC_POSITION;
+ fs_output_semantic_index[fs_num_outputs] = 0;
+ outputMapping[FRAG_RESULT_DEPTH] = fs_num_outputs;
+ fs_num_outputs++;
+ outputsWritten &= ~(1 << FRAG_RESULT_DEPTH);
+ }
+
+ if (outputsWritten & BITFIELD64_BIT(FRAG_RESULT_STENCIL)) {
+ fs_output_semantic_name[fs_num_outputs] = TGSI_SEMANTIC_STENCIL;
+ fs_output_semantic_index[fs_num_outputs] = 0;
+ outputMapping[FRAG_RESULT_STENCIL] = fs_num_outputs;
+ fs_num_outputs++;
+ outputsWritten &= ~(1 << FRAG_RESULT_STENCIL);
+ }
+
+ /* handle remaning outputs (color) */
+ for (attr = 0; attr < FRAG_RESULT_MAX; attr++) {
+ if (outputsWritten & BITFIELD64_BIT(attr)) {
+ switch (attr) {
+ case FRAG_RESULT_DEPTH:
+ case FRAG_RESULT_STENCIL:
+ /* handled above */
+ assert(0);
+ break;
+ case FRAG_RESULT_COLOR:
+ write_all = GL_TRUE; /* fallthrough */
+ default:
+ assert(attr == FRAG_RESULT_COLOR ||
+ (FRAG_RESULT_DATA0 <= attr && attr < FRAG_RESULT_MAX));
+ fs_output_semantic_name[fs_num_outputs] = TGSI_SEMANTIC_COLOR;
+ fs_output_semantic_index[fs_num_outputs] = numColors;
+ outputMapping[attr] = fs_num_outputs;
+ numColors++;
+ break;
+ }
+
+ fs_num_outputs++;
+ }
+ }
+ }
+
+ ureg = ureg_create( TGSI_PROCESSOR_FRAGMENT );
+ if (ureg == NULL)
+ return NULL;
+
+ if (ST_DEBUG & DEBUG_MESA) {
+ _mesa_print_program(&stfp->Base.Base);
+ _mesa_print_program_parameters(st->ctx, &stfp->Base.Base);
+ debug_printf("\n");
+ }
+ if (write_all == GL_TRUE)
+ ureg_property_fs_color0_writes_all_cbufs(ureg, 1);
+
+ error = st_translate_mesa_program(st->ctx,
+ TGSI_PROCESSOR_FRAGMENT,
+ ureg,
+ &stfp->Base.Base,
+ /* inputs */
+ fs_num_inputs,
+ inputMapping,
+ input_semantic_name,
+ input_semantic_index,
+ interpMode,
+ /* outputs */
+ fs_num_outputs,
+ outputMapping,
+ fs_output_semantic_name,
+ fs_output_semantic_index, FALSE );
+
+ stfp->tgsi.tokens = ureg_get_tokens( ureg, NULL );
+ ureg_destroy( ureg );
+ }
+
+ /* fill in variant */
+ variant->driver_shader = pipe->create_fs_state(pipe, &stfp->tgsi);
+ variant->key = *key;
+
+ if (ST_DEBUG & DEBUG_TGSI) {
+ tgsi_dump( stfp->tgsi.tokens, 0/*TGSI_DUMP_VERBOSE*/ );
+ debug_printf("\n");
+ }
+
+ if (deleteFP) {
+ /* Free the temporary program made above */
+ struct gl_fragment_program *fp = &stfp->Base;
+ _mesa_reference_fragprog(st->ctx, &fp, NULL);
+ }
+
+ return variant;
+}
+
+
+/**
+ * Translate fragment program if needed.
+ */
+struct st_fp_variant *
+st_get_fp_variant(struct st_context *st,
+ struct st_fragment_program *stfp,
+ const struct st_fp_variant_key *key)
+{
+ struct st_fp_variant *fpv;
+
+ /* Search for existing variant */
+ for (fpv = stfp->variants; fpv; fpv = fpv->next) {
+ if (memcmp(&fpv->key, key, sizeof(*key)) == 0) {
+ break;
+ }
+ }
+
+ if (!fpv) {
+ /* create new */
+ fpv = st_translate_fragment_program(st, stfp, key);
+ if (fpv) {
+ /* insert into list */
+ fpv->next = stfp->variants;
+ stfp->variants = fpv;
+ }
+ }
+
+ return fpv;
+}
+
+
+/**
+ * Translate a geometry program to create a new variant.
+ */
+static struct st_gp_variant *
+st_translate_geometry_program(struct st_context *st,
+ struct st_geometry_program *stgp,
+ const struct st_gp_variant_key *key)
+{
+ GLuint inputMapping[GEOM_ATTRIB_MAX];
+ GLuint outputMapping[GEOM_RESULT_MAX];
+ struct pipe_context *pipe = st->pipe;
+ enum pipe_error error;
+ GLuint attr;
+ const GLbitfield inputsRead = stgp->Base.Base.InputsRead;
+ GLuint vslot = 0;
+ GLuint num_generic = 0;
+
+ uint gs_num_inputs = 0;
+ uint gs_builtin_inputs = 0;
+ uint gs_array_offset = 0;
+
+ ubyte gs_output_semantic_name[PIPE_MAX_SHADER_OUTPUTS];
+ ubyte gs_output_semantic_index[PIPE_MAX_SHADER_OUTPUTS];
+ uint gs_num_outputs = 0;
+
+ GLint i;
+ GLuint maxSlot = 0;
+ struct ureg_program *ureg;
+
+ struct st_gp_variant *gpv;
+
+ gpv = CALLOC_STRUCT(st_gp_variant);
+ if (!gpv)
+ return NULL;
+
+ _mesa_remove_output_reads(&stgp->Base.Base, PROGRAM_OUTPUT);
+ _mesa_remove_output_reads(&stgp->Base.Base, PROGRAM_VARYING);
+
+ ureg = ureg_create( TGSI_PROCESSOR_GEOMETRY );
+ if (ureg == NULL) {
+ FREE(gpv);
+ return NULL;
+ }
+
+ /* which vertex output goes to the first geometry input */
+ vslot = 0;
+
+ memset(inputMapping, 0, sizeof(inputMapping));
+ memset(outputMapping, 0, sizeof(outputMapping));
+
+ /*
+ * Convert Mesa program inputs to TGSI input register semantics.
+ */
+ for (attr = 0; attr < GEOM_ATTRIB_MAX; attr++) {
+ if (inputsRead & (1 << attr)) {
+ const GLuint slot = gs_num_inputs;
+
+ gs_num_inputs++;
+
+ inputMapping[attr] = slot;
+
+ stgp->input_map[slot + gs_array_offset] = vslot - gs_builtin_inputs;
+ stgp->input_to_index[attr] = vslot;
+ stgp->index_to_input[vslot] = attr;
+ ++vslot;
+
+ if (attr != GEOM_ATTRIB_PRIMITIVE_ID) {
+ gs_array_offset += 2;
+ } else
+ ++gs_builtin_inputs;
+
+#if 0
+ debug_printf("input map at %d = %d\n",
+ slot + gs_array_offset, stgp->input_map[slot + gs_array_offset]);
+#endif
+
+ switch (attr) {
+ case GEOM_ATTRIB_PRIMITIVE_ID:
+ stgp->input_semantic_name[slot] = TGSI_SEMANTIC_PRIMID;
+ stgp->input_semantic_index[slot] = 0;
+ break;
+ case GEOM_ATTRIB_POSITION:
+ stgp->input_semantic_name[slot] = TGSI_SEMANTIC_POSITION;
+ stgp->input_semantic_index[slot] = 0;
+ break;
+ case GEOM_ATTRIB_COLOR0:
+ stgp->input_semantic_name[slot] = TGSI_SEMANTIC_COLOR;
+ stgp->input_semantic_index[slot] = 0;
+ break;
+ case GEOM_ATTRIB_COLOR1:
+ stgp->input_semantic_name[slot] = TGSI_SEMANTIC_COLOR;
+ stgp->input_semantic_index[slot] = 1;
+ break;
+ case GEOM_ATTRIB_FOG_FRAG_COORD:
+ stgp->input_semantic_name[slot] = TGSI_SEMANTIC_FOG;
+ stgp->input_semantic_index[slot] = 0;
+ break;
+ case GEOM_ATTRIB_TEX_COORD:
+ stgp->input_semantic_name[slot] = TGSI_SEMANTIC_GENERIC;
+ stgp->input_semantic_index[slot] = num_generic++;
+ break;
+ case GEOM_ATTRIB_VAR0:
+ /* fall-through */
+ default:
+ stgp->input_semantic_name[slot] = TGSI_SEMANTIC_GENERIC;
+ stgp->input_semantic_index[slot] = num_generic++;
+ }
+ }
+ }
+
+ /* initialize output semantics to defaults */
+ for (i = 0; i < PIPE_MAX_SHADER_OUTPUTS; i++) {
+ gs_output_semantic_name[i] = TGSI_SEMANTIC_GENERIC;
+ gs_output_semantic_index[i] = 0;
+ }
+
+ num_generic = 0;
+ /*
+ * Determine number of outputs, the (default) output register
+ * mapping and the semantic information for each output.
+ */
+ for (attr = 0; attr < GEOM_RESULT_MAX; attr++) {
+ if (stgp->Base.Base.OutputsWritten & BITFIELD64_BIT(attr)) {
+ GLuint slot;
+
+ slot = gs_num_outputs;
+ gs_num_outputs++;
+ outputMapping[attr] = slot;
+
+ switch (attr) {
+ case GEOM_RESULT_POS:
+ assert(slot == 0);
+ gs_output_semantic_name[slot] = TGSI_SEMANTIC_POSITION;
+ gs_output_semantic_index[slot] = 0;
+ break;
+ case GEOM_RESULT_COL0:
+ gs_output_semantic_name[slot] = TGSI_SEMANTIC_COLOR;
+ gs_output_semantic_index[slot] = 0;
+ break;
+ case GEOM_RESULT_COL1:
+ gs_output_semantic_name[slot] = TGSI_SEMANTIC_COLOR;
+ gs_output_semantic_index[slot] = 1;
+ break;
+ case GEOM_RESULT_SCOL0:
+ gs_output_semantic_name[slot] = TGSI_SEMANTIC_BCOLOR;
+ gs_output_semantic_index[slot] = 0;
+ break;
+ case GEOM_RESULT_SCOL1:
+ gs_output_semantic_name[slot] = TGSI_SEMANTIC_BCOLOR;
+ gs_output_semantic_index[slot] = 1;
+ break;
+ case GEOM_RESULT_FOGC:
+ gs_output_semantic_name[slot] = TGSI_SEMANTIC_FOG;
+ gs_output_semantic_index[slot] = 0;
+ break;
+ case GEOM_RESULT_PSIZ:
+ gs_output_semantic_name[slot] = TGSI_SEMANTIC_PSIZE;
+ gs_output_semantic_index[slot] = 0;
+ break;
+ case GEOM_RESULT_TEX0:
+ case GEOM_RESULT_TEX1:
+ case GEOM_RESULT_TEX2:
+ case GEOM_RESULT_TEX3:
+ case GEOM_RESULT_TEX4:
+ case GEOM_RESULT_TEX5:
+ case GEOM_RESULT_TEX6:
+ case GEOM_RESULT_TEX7:
+ /* fall-through */
+ case GEOM_RESULT_VAR0:
+ /* fall-through */
+ default:
+ assert(slot < Elements(gs_output_semantic_name));
+ /* use default semantic info */
+ gs_output_semantic_name[slot] = TGSI_SEMANTIC_GENERIC;
+ gs_output_semantic_index[slot] = num_generic++;
+ }
+ }
+ }
+
+ assert(gs_output_semantic_name[0] == TGSI_SEMANTIC_POSITION);
+
+ /* find max output slot referenced to compute gs_num_outputs */
+ for (attr = 0; attr < GEOM_RESULT_MAX; attr++) {
+ if (outputMapping[attr] != ~0 && outputMapping[attr] > maxSlot)
+ maxSlot = outputMapping[attr];
+ }
+ gs_num_outputs = maxSlot + 1;
+
+#if 0 /* debug */
+ {
+ GLuint i;
+ printf("outputMapping? %d\n", outputMapping ? 1 : 0);
+ if (outputMapping) {
+ printf("attr -> slot\n");
+ for (i = 0; i < 16; i++) {
+ printf(" %2d %3d\n", i, outputMapping[i]);
+ }
+ }
+ printf("slot sem_name sem_index\n");
+ for (i = 0; i < gs_num_outputs; i++) {
+ printf(" %2d %d %d\n",
+ i,
+ gs_output_semantic_name[i],
+ gs_output_semantic_index[i]);
+ }
+ }
+#endif
+
+ /* free old shader state, if any */
+ if (stgp->tgsi.tokens) {
+ st_free_tokens(stgp->tgsi.tokens);
+ stgp->tgsi.tokens = NULL;
+ }
+
+ ureg_property_gs_input_prim(ureg, stgp->Base.InputType);
+ ureg_property_gs_output_prim(ureg, stgp->Base.OutputType);
+ ureg_property_gs_max_vertices(ureg, stgp->Base.VerticesOut);
+
+ error = st_translate_mesa_program(st->ctx,
+ TGSI_PROCESSOR_GEOMETRY,
+ ureg,
+ &stgp->Base.Base,
+ /* inputs */
+ gs_num_inputs,
+ inputMapping,
+ stgp->input_semantic_name,
+ stgp->input_semantic_index,
+ NULL,
+ /* outputs */
+ gs_num_outputs,
+ outputMapping,
+ gs_output_semantic_name,
+ gs_output_semantic_index,
+ FALSE);
+
+ stgp->num_inputs = gs_num_inputs;
+ stgp->tgsi.tokens = ureg_get_tokens( ureg, NULL );
+ ureg_destroy( ureg );
+
+ /* fill in new variant */
+ gpv->driver_shader = pipe->create_gs_state(pipe, &stgp->tgsi);
+ gpv->key = *key;
+
+ if ((ST_DEBUG & DEBUG_TGSI) && (ST_DEBUG & DEBUG_MESA)) {
+ _mesa_print_program(&stgp->Base.Base);
+ debug_printf("\n");
+ }
+
+ if (ST_DEBUG & DEBUG_TGSI) {
+ tgsi_dump(stgp->tgsi.tokens, 0);
+ debug_printf("\n");
+ }
+
+ return gpv;
+}
+
+
+/**
+ * Get/create geometry program variant.
+ */
+struct st_gp_variant *
+st_get_gp_variant(struct st_context *st,
+ struct st_geometry_program *stgp,
+ const struct st_gp_variant_key *key)
+{
+ struct st_gp_variant *gpv;
+
+ /* Search for existing variant */
+ for (gpv = stgp->variants; gpv; gpv = gpv->next) {
+ if (memcmp(&gpv->key, key, sizeof(*key)) == 0) {
+ break;
+ }
+ }
+
+ if (!gpv) {
+ /* create new */
+ gpv = st_translate_geometry_program(st, stgp, key);
+ if (gpv) {
+ /* insert into list */
+ gpv->next = stgp->variants;
+ stgp->variants = gpv;
+ }
+ }
+
+ return gpv;
+}
+
+
+
+
+/**
+ * Debug- print current shader text
+ */
+void
+st_print_shaders(struct gl_context *ctx)
+{
+ struct gl_shader_program *shProg[3] = {
+ ctx->Shader.CurrentVertexProgram,
+ ctx->Shader.CurrentGeometryProgram,
+ ctx->Shader.CurrentFragmentProgram,
+ };
+ unsigned j;
+
+ for (j = 0; j < 3; j++) {
+ unsigned i;
+
+ if (shProg[j] == NULL)
+ continue;
+
+ for (i = 0; i < shProg[j]->NumShaders; i++) {
+ struct gl_shader *sh;
+
+ switch (shProg[j]->Shaders[i]->Type) {
+ case GL_VERTEX_SHADER:
+ sh = (i != 0) ? NULL : shProg[j]->Shaders[i];
+ break;
+ case GL_GEOMETRY_SHADER_ARB:
+ sh = (i != 1) ? NULL : shProg[j]->Shaders[i];
+ break;
+ case GL_FRAGMENT_SHADER:
+ sh = (i != 2) ? NULL : shProg[j]->Shaders[i];
+ break;
+ default:
+ assert(0);
+ sh = NULL;
+ break;
+ }
+
+ if (sh != NULL) {
+ printf("GLSL shader %u of %u:\n", i, shProg[j]->NumShaders);
+ printf("%s\n", sh->Source);
+ }
+ }
+ }
+}
+
+
+/**
+ * Vert/Geom/Frag programs have per-context variants. Free all the
+ * variants attached to the given program which match the given context.
+ */
+static void
+destroy_program_variants(struct st_context *st, struct gl_program *program)
+{
+ if (!program)
+ return;
+
+ switch (program->Target) {
+ case GL_VERTEX_PROGRAM_ARB:
+ {
+ struct st_vertex_program *stvp = (struct st_vertex_program *) program;
+ struct st_vp_variant *vpv, **prevPtr = &stvp->variants;
+
+ for (vpv = stvp->variants; vpv; ) {
+ struct st_vp_variant *next = vpv->next;
+ if (vpv->key.st == st) {
+ /* unlink from list */
+ *prevPtr = next;
+ /* destroy this variant */
+ delete_vp_variant(st, vpv);
+ }
+ else {
+ prevPtr = &vpv->next;
+ }
+ vpv = next;
+ }
+ }
+ break;
+ case GL_FRAGMENT_PROGRAM_ARB:
+ {
+ struct st_fragment_program *stfp =
+ (struct st_fragment_program *) program;
+ struct st_fp_variant *fpv, **prevPtr = &stfp->variants;
+
+ for (fpv = stfp->variants; fpv; ) {
+ struct st_fp_variant *next = fpv->next;
+ if (fpv->key.st == st) {
+ /* unlink from list */
+ *prevPtr = next;
+ /* destroy this variant */
+ delete_fp_variant(st, fpv);
+ }
+ else {
+ prevPtr = &fpv->next;
+ }
+ fpv = next;
+ }
+ }
+ break;
+ case MESA_GEOMETRY_PROGRAM:
+ {
+ struct st_geometry_program *stgp =
+ (struct st_geometry_program *) program;
+ struct st_gp_variant *gpv, **prevPtr = &stgp->variants;
+
+ for (gpv = stgp->variants; gpv; ) {
+ struct st_gp_variant *next = gpv->next;
+ if (gpv->key.st == st) {
+ /* unlink from list */
+ *prevPtr = next;
+ /* destroy this variant */
+ delete_gp_variant(st, gpv);
+ }
+ else {
+ prevPtr = &gpv->next;
+ }
+ gpv = next;
+ }
+ }
+ break;
+ default:
+ _mesa_problem(NULL, "Unexpected program target in "
+ "destroy_program_variants_cb()");
+ }
+}
+
+
+/**
+ * Callback for _mesa_HashWalk. Free all the shader's program variants
+ * which match the given context.
+ */
+static void
+destroy_shader_program_variants_cb(GLuint key, void *data, void *userData)
+{
+ struct st_context *st = (struct st_context *) userData;
+ struct gl_shader *shader = (struct gl_shader *) data;
+
+ switch (shader->Type) {
+ case GL_SHADER_PROGRAM_MESA:
+ {
+ struct gl_shader_program *shProg = (struct gl_shader_program *) data;
+ GLuint i;
+
+ for (i = 0; i < shProg->NumShaders; i++) {
+ destroy_program_variants(st, shProg->Shaders[i]->Program);
+ }
+
+ destroy_program_variants(st, (struct gl_program *)
+ shProg->VertexProgram);
+ destroy_program_variants(st, (struct gl_program *)
+ shProg->FragmentProgram);
+ destroy_program_variants(st, (struct gl_program *)
+ shProg->GeometryProgram);
+ }
+ break;
+ case GL_VERTEX_SHADER:
+ case GL_FRAGMENT_SHADER:
+ case GL_GEOMETRY_SHADER:
+ {
+ destroy_program_variants(st, shader->Program);
+ }
+ break;
+ default:
+ assert(0);
+ }
+}
+
+
+/**
+ * Callback for _mesa_HashWalk. Free all the program variants which match
+ * the given context.
+ */
+static void
+destroy_program_variants_cb(GLuint key, void *data, void *userData)
+{
+ struct st_context *st = (struct st_context *) userData;
+ struct gl_program *program = (struct gl_program *) data;
+ destroy_program_variants(st, program);
+}
+
+
+/**
+ * Walk over all shaders and programs to delete any variants which
+ * belong to the given context.
+ * This is called during context tear-down.
+ */
+void
+st_destroy_program_variants(struct st_context *st)
+{
+ /* ARB vert/frag program */
+ _mesa_HashWalk(st->ctx->Shared->Programs,
+ destroy_program_variants_cb, st);
+
+ /* GLSL vert/frag/geom shaders */
+ _mesa_HashWalk(st->ctx->Shared->ShaderObjects,
+ destroy_shader_program_variants_cb, st);
+}
diff --git a/mesalib/src/mesa/state_tracker/st_texture.h b/mesalib/src/mesa/state_tracker/st_texture.h
index d50c3c9af..b25f16410 100644
--- a/mesalib/src/mesa/state_tracker/st_texture.h
+++ b/mesalib/src/mesa/state_tracker/st_texture.h
@@ -1,235 +1,235 @@
-/**************************************************************************
- *
- * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas.
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sub license, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice (including the
- * next paragraph) shall be included in all copies or substantial portions
- * of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
- * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
- * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- **************************************************************************/
-
-#ifndef ST_TEXTURE_H
-#define ST_TEXTURE_H
-
-
-#include "pipe/p_context.h"
-#include "util/u_sampler.h"
-
-#include "main/mtypes.h"
-
-
-struct pipe_resource;
-
-
-/**
- * Subclass of gl_texure_image.
- */
-struct st_texture_image
-{
- struct gl_texture_image base;
-
- /* These aren't stored in gl_texture_image
- */
- GLuint level;
- GLuint face;
-
- /* If stImage->pt != NULL, image data is stored here.
- * Else if stImage->base.Data != NULL, image is stored there.
- * Else there is no image data.
- */
- struct pipe_resource *pt;
-
- struct pipe_transfer *transfer;
-};
-
-
-/**
- * Subclass of gl_texure_object.
- */
-struct st_texture_object
-{
- struct gl_texture_object base; /* The "parent" object */
-
- /* The texture must include at levels [0..lastLevel] once validated:
- */
- GLuint lastLevel;
-
- /** The size of the level=0 mipmap image.
- * Note that the number of 1D array layers will be in height0 and the
- * number of 2D array layers will be in depth0, as in GL.
- */
- GLuint width0, height0, depth0;
-
- /* On validation any active images held in main memory or in other
- * textures will be copied to this texture and the old storage freed.
- */
- struct pipe_resource *pt;
-
- /* Default sampler view attached to this texture object. Created lazily
- * on first binding.
- */
- struct pipe_sampler_view *sampler_view;
-
- /* True if there is/was a surface bound to this texture object. It helps
- * track whether the texture object is surface based or not.
- */
- GLboolean surface_based;
-};
-
-
-static INLINE struct st_texture_image *
-st_texture_image(struct gl_texture_image *img)
-{
- return (struct st_texture_image *) img;
-}
-
-static INLINE struct st_texture_object *
-st_texture_object(struct gl_texture_object *obj)
-{
- return (struct st_texture_object *) obj;
-}
-
-
-static INLINE struct pipe_resource *
-st_get_texobj_resource(struct gl_texture_object *texObj)
-{
- struct st_texture_object *stObj = st_texture_object(texObj);
- return stObj ? stObj->pt : NULL;
-}
-
-
-static INLINE struct pipe_resource *
-st_get_stobj_resource(struct st_texture_object *stObj)
-{
- return stObj ? stObj->pt : NULL;
-}
-
-
-static INLINE struct pipe_sampler_view *
-st_create_texture_sampler_view(struct pipe_context *pipe,
- struct pipe_resource *texture)
-{
- struct pipe_sampler_view templ;
-
- u_sampler_view_default_template(&templ, texture, texture->format);
-
- return pipe->create_sampler_view(pipe, texture, &templ);
-}
-
-
-static INLINE struct pipe_sampler_view *
-st_create_texture_sampler_view_format(struct pipe_context *pipe,
- struct pipe_resource *texture,
- enum pipe_format format)
-{
- struct pipe_sampler_view templ;
-
- u_sampler_view_default_template(&templ, texture, format);
-
- return pipe->create_sampler_view(pipe, texture, &templ);
-}
-
-
-static INLINE struct pipe_sampler_view *
-st_get_texture_sampler_view(struct st_texture_object *stObj,
- struct pipe_context *pipe)
-{
- if (!stObj || !stObj->pt) {
- return NULL;
- }
-
- if (!stObj->sampler_view) {
- stObj->sampler_view = st_create_texture_sampler_view(pipe, stObj->pt);
- }
-
- return stObj->sampler_view;
-}
-
-
-extern struct pipe_resource *
-st_texture_create(struct st_context *st,
- enum pipe_texture_target target,
- enum pipe_format format,
- GLuint last_level,
- GLuint width0,
- GLuint height0,
- GLuint depth0,
- GLuint layers,
- GLuint tex_usage );
-
-
-extern void
-st_gl_texture_dims_to_pipe_dims(GLenum texture,
- GLuint widthIn,
- GLuint heightIn,
- GLuint depthIn,
- GLuint *widthOut,
- GLuint *heightOut,
- GLuint *depthOut,
- GLuint *layersOut);
-
-/* Check if an image fits into an existing texture object.
- */
-extern GLboolean
-st_texture_match_image(const struct pipe_resource *pt,
- const struct gl_texture_image *image,
- GLuint face, GLuint level);
-
-/* Return a pointer to an image within a texture. Return image stride as
- * well.
- */
-extern GLubyte *
-st_texture_image_map(struct st_context *st,
- struct st_texture_image *stImage,
- GLuint zoffset,
- enum pipe_transfer_usage usage,
- unsigned x, unsigned y,
- unsigned w, unsigned h);
-
-extern void
-st_texture_image_unmap(struct st_context *st,
- struct st_texture_image *stImage);
-
-
-/* Return pointers to each 2d slice within an image. Indexed by depth
- * value.
- */
-extern const GLuint *
-st_texture_depth_offsets(struct pipe_resource *pt, GLuint level);
-
-
-/* Upload an image into a texture
- */
-extern void
-st_texture_image_data(struct st_context *st,
- struct pipe_resource *dst,
- GLuint face, GLuint level, void *src,
- GLuint src_row_pitch, GLuint src_image_pitch);
-
-
-/* Copy an image between two textures
- */
-extern void
-st_texture_image_copy(struct pipe_context *pipe,
- struct pipe_resource *dst, GLuint dstLevel,
- struct pipe_resource *src, GLuint srcLevel,
- GLuint face);
-
-#endif
+/**************************************************************************
+ *
+ * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ **************************************************************************/
+
+#ifndef ST_TEXTURE_H
+#define ST_TEXTURE_H
+
+
+#include "pipe/p_context.h"
+#include "util/u_sampler.h"
+
+#include "main/mtypes.h"
+
+
+struct pipe_resource;
+
+
+/**
+ * Subclass of gl_texure_image.
+ */
+struct st_texture_image
+{
+ struct gl_texture_image base;
+
+ /* These aren't stored in gl_texture_image
+ */
+ GLuint level;
+ GLuint face;
+
+ /* If stImage->pt != NULL, image data is stored here.
+ * Else if stImage->base.Data != NULL, image is stored there.
+ * Else there is no image data.
+ */
+ struct pipe_resource *pt;
+
+ struct pipe_transfer *transfer;
+};
+
+
+/**
+ * Subclass of gl_texure_object.
+ */
+struct st_texture_object
+{
+ struct gl_texture_object base; /* The "parent" object */
+
+ /* The texture must include at levels [0..lastLevel] once validated:
+ */
+ GLuint lastLevel;
+
+ /** The size of the level=0 mipmap image.
+ * Note that the number of 1D array layers will be in height0 and the
+ * number of 2D array layers will be in depth0, as in GL.
+ */
+ GLuint width0, height0, depth0;
+
+ /* On validation any active images held in main memory or in other
+ * textures will be copied to this texture and the old storage freed.
+ */
+ struct pipe_resource *pt;
+
+ /* Default sampler view attached to this texture object. Created lazily
+ * on first binding.
+ */
+ struct pipe_sampler_view *sampler_view;
+
+ /* True if there is/was a surface bound to this texture object. It helps
+ * track whether the texture object is surface based or not.
+ */
+ GLboolean surface_based;
+};
+
+
+static INLINE struct st_texture_image *
+st_texture_image(struct gl_texture_image *img)
+{
+ return (struct st_texture_image *) img;
+}
+
+static INLINE struct st_texture_object *
+st_texture_object(struct gl_texture_object *obj)
+{
+ return (struct st_texture_object *) obj;
+}
+
+
+static INLINE struct pipe_resource *
+st_get_texobj_resource(struct gl_texture_object *texObj)
+{
+ struct st_texture_object *stObj = st_texture_object(texObj);
+ return stObj ? stObj->pt : NULL;
+}
+
+
+static INLINE struct pipe_resource *
+st_get_stobj_resource(struct st_texture_object *stObj)
+{
+ return stObj ? stObj->pt : NULL;
+}
+
+
+static INLINE struct pipe_sampler_view *
+st_create_texture_sampler_view(struct pipe_context *pipe,
+ struct pipe_resource *texture)
+{
+ struct pipe_sampler_view templ;
+
+ u_sampler_view_default_template(&templ, texture, texture->format);
+
+ return pipe->create_sampler_view(pipe, texture, &templ);
+}
+
+
+static INLINE struct pipe_sampler_view *
+st_create_texture_sampler_view_format(struct pipe_context *pipe,
+ struct pipe_resource *texture,
+ enum pipe_format format)
+{
+ struct pipe_sampler_view templ;
+
+ u_sampler_view_default_template(&templ, texture, format);
+
+ return pipe->create_sampler_view(pipe, texture, &templ);
+}
+
+
+static INLINE struct pipe_sampler_view *
+st_get_texture_sampler_view(struct st_texture_object *stObj,
+ struct pipe_context *pipe)
+{
+ if (!stObj || !stObj->pt) {
+ return NULL;
+ }
+
+ if (!stObj->sampler_view) {
+ stObj->sampler_view = st_create_texture_sampler_view(pipe, stObj->pt);
+ }
+
+ return stObj->sampler_view;
+}
+
+
+extern struct pipe_resource *
+st_texture_create(struct st_context *st,
+ enum pipe_texture_target target,
+ enum pipe_format format,
+ GLuint last_level,
+ GLuint width0,
+ GLuint height0,
+ GLuint depth0,
+ GLuint layers,
+ GLuint tex_usage );
+
+
+extern void
+st_gl_texture_dims_to_pipe_dims(GLenum texture,
+ GLuint widthIn,
+ GLuint heightIn,
+ GLuint depthIn,
+ GLuint *widthOut,
+ GLuint *heightOut,
+ GLuint *depthOut,
+ GLuint *layersOut);
+
+/* Check if an image fits into an existing texture object.
+ */
+extern GLboolean
+st_texture_match_image(const struct pipe_resource *pt,
+ const struct gl_texture_image *image,
+ GLuint face, GLuint level);
+
+/* Return a pointer to an image within a texture. Return image stride as
+ * well.
+ */
+extern GLubyte *
+st_texture_image_map(struct st_context *st,
+ struct st_texture_image *stImage,
+ GLuint zoffset,
+ enum pipe_transfer_usage usage,
+ unsigned x, unsigned y,
+ unsigned w, unsigned h);
+
+extern void
+st_texture_image_unmap(struct st_context *st,
+ struct st_texture_image *stImage);
+
+
+/* Return pointers to each 2d slice within an image. Indexed by depth
+ * value.
+ */
+extern const GLuint *
+st_texture_depth_offsets(struct pipe_resource *pt, GLuint level);
+
+
+/* Upload an image into a texture
+ */
+extern void
+st_texture_image_data(struct st_context *st,
+ struct pipe_resource *dst,
+ GLuint face, GLuint level, void *src,
+ GLuint src_row_pitch, GLuint src_image_pitch);
+
+
+/* Copy an image between two textures
+ */
+extern void
+st_texture_image_copy(struct pipe_context *pipe,
+ struct pipe_resource *dst, GLuint dstLevel,
+ struct pipe_resource *src, GLuint srcLevel,
+ GLuint face);
+
+#endif
diff --git a/mesalib/src/mesa/swrast/s_accum.c b/mesalib/src/mesa/swrast/s_accum.c
index 0ec907d79..2889d908b 100644
--- a/mesalib/src/mesa/swrast/s_accum.c
+++ b/mesalib/src/mesa/swrast/s_accum.c
@@ -1,598 +1,598 @@
-/*
- * Mesa 3-D graphics library
- * Version: 6.5.2
- *
- * Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-
-#include "main/glheader.h"
-#include "main/condrender.h"
-#include "main/context.h"
-#include "main/macros.h"
-#include "main/imports.h"
-
-#include "s_accum.h"
-#include "s_context.h"
-#include "s_masking.h"
-#include "s_span.h"
-
-
-/* XXX this would have to change for accum buffers with more or less
- * than 16 bits per color channel.
- */
-#define ACCUM_SCALE16 32767.0F
-
-
-/*
- * Accumulation buffer notes
- *
- * Normally, accumulation buffer values are GLshorts with values in
- * [-32767, 32767] which represent floating point colors in [-1, 1],
- * as defined by the OpenGL specification.
- *
- * We optimize for the common case used for full-scene antialiasing:
- * // start with accum buffer cleared to zero
- * glAccum(GL_LOAD, w); // or GL_ACCUM the first image
- * glAccum(GL_ACCUM, w);
- * ...
- * glAccum(GL_ACCUM, w);
- * glAccum(GL_RETURN, 1.0);
- * That is, we start with an empty accumulation buffer and accumulate
- * n images, each with weight w = 1/n.
- * In this scenario, we can simply store unscaled integer values in
- * the accum buffer instead of scaled integers. We'll also keep track
- * of the w value so when we do GL_RETURN we simply divide the accumulated
- * values by n (n=1/w).
- * This lets us avoid _many_ int->float->int conversions.
- */
-
-
-#if CHAN_BITS == 8
-/* enable the optimization */
-#define USE_OPTIMIZED_ACCUM 1
-#else
-#define USE_OPTIMIZED_ACCUM 0
-#endif
-
-
-/**
- * This is called when we fall out of optimized/unscaled accum buffer mode.
- * That is, we convert each unscaled accum buffer value into a scaled value
- * representing the range[-1, 1].
- */
-static void
-rescale_accum( struct gl_context *ctx )
-{
- SWcontext *swrast = SWRAST_CONTEXT(ctx);
- struct gl_renderbuffer *rb
- = ctx->DrawBuffer->Attachment[BUFFER_ACCUM].Renderbuffer;
- const GLfloat s = swrast->_IntegerAccumScaler * (32767.0F / CHAN_MAXF);
-
- assert(rb);
- assert(rb->_BaseFormat == GL_RGBA);
- /* add other types in future? */
- assert(rb->DataType == GL_SHORT || rb->DataType == GL_UNSIGNED_SHORT);
- assert(swrast->_IntegerAccumMode);
-
- if (rb->GetPointer(ctx, rb, 0, 0)) {
- /* directly-addressable memory */
- GLuint y;
- for (y = 0; y < rb->Height; y++) {
- GLuint i;
- GLshort *acc = (GLshort *) rb->GetPointer(ctx, rb, 0, y);
- for (i = 0; i < 4 * rb->Width; i++) {
- acc[i] = (GLshort) (acc[i] * s);
- }
- }
- }
- else {
- /* use get/put row funcs */
- GLuint y;
- for (y = 0; y < rb->Height; y++) {
- GLshort accRow[MAX_WIDTH * 4];
- GLuint i;
- rb->GetRow(ctx, rb, rb->Width, 0, y, accRow);
- for (i = 0; i < 4 * rb->Width; i++) {
- accRow[i] = (GLshort) (accRow[i] * s);
- }
- rb->PutRow(ctx, rb, rb->Width, 0, y, accRow, NULL);
- }
- }
-
- swrast->_IntegerAccumMode = GL_FALSE;
-}
-
-
-
-/**
- * Clear the accumulation Buffer.
- */
-void
-_swrast_clear_accum_buffer( struct gl_context *ctx, struct gl_renderbuffer *rb )
-{
- SWcontext *swrast = SWRAST_CONTEXT(ctx);
- GLuint x, y, width, height;
-
- /* No accumulation buffer! Not an error. */
- if (!rb || !rb->Data)
- return;
-
- assert(rb->_BaseFormat == GL_RGBA);
- /* add other types in future? */
- assert(rb->DataType == GL_SHORT || rb->DataType == GL_UNSIGNED_SHORT);
-
- /* bounds, with scissor */
- x = ctx->DrawBuffer->_Xmin;
- y = ctx->DrawBuffer->_Ymin;
- width = ctx->DrawBuffer->_Xmax - ctx->DrawBuffer->_Xmin;
- height = ctx->DrawBuffer->_Ymax - ctx->DrawBuffer->_Ymin;
-
- if (rb->DataType == GL_SHORT || rb->DataType == GL_UNSIGNED_SHORT) {
- const GLfloat accScale = 32767.0;
- GLshort clearVal[4];
- GLuint i;
-
- clearVal[0] = (GLshort) (ctx->Accum.ClearColor[0] * accScale);
- clearVal[1] = (GLshort) (ctx->Accum.ClearColor[1] * accScale);
- clearVal[2] = (GLshort) (ctx->Accum.ClearColor[2] * accScale);
- clearVal[3] = (GLshort) (ctx->Accum.ClearColor[3] * accScale);
-
- for (i = 0; i < height; i++) {
- rb->PutMonoRow(ctx, rb, width, x, y + i, clearVal, NULL);
- }
- }
- else {
- /* someday support other sizes */
- }
-
- /* update optimized accum state vars */
- if (ctx->Accum.ClearColor[0] == 0.0 && ctx->Accum.ClearColor[1] == 0.0 &&
- ctx->Accum.ClearColor[2] == 0.0 && ctx->Accum.ClearColor[3] == 0.0) {
-#if USE_OPTIMIZED_ACCUM
- swrast->_IntegerAccumMode = GL_TRUE;
-#else
- swrast->_IntegerAccumMode = GL_FALSE;
-#endif
- swrast->_IntegerAccumScaler = 0.0; /* denotes empty accum buffer */
- }
- else {
- swrast->_IntegerAccumMode = GL_FALSE;
- }
-}
-
-
-static void
-accum_add(struct gl_context *ctx, GLfloat value,
- GLint xpos, GLint ypos, GLint width, GLint height )
-{
- SWcontext *swrast = SWRAST_CONTEXT(ctx);
- struct gl_renderbuffer *rb
- = ctx->DrawBuffer->Attachment[BUFFER_ACCUM].Renderbuffer;
-
- assert(rb);
-
- /* Leave optimized accum buffer mode */
- if (swrast->_IntegerAccumMode)
- rescale_accum(ctx);
-
- if (rb->DataType == GL_SHORT || rb->DataType == GL_UNSIGNED_SHORT) {
- const GLshort incr = (GLshort) (value * ACCUM_SCALE16);
- if (rb->GetPointer(ctx, rb, 0, 0)) {
- GLint i, j;
- for (i = 0; i < height; i++) {
- GLshort *acc = (GLshort *) rb->GetPointer(ctx, rb, xpos, ypos + i);
- for (j = 0; j < 4 * width; j++) {
- acc[j] += incr;
- }
- }
- }
- else {
- GLint i, j;
- for (i = 0; i < height; i++) {
- GLshort accRow[4 * MAX_WIDTH];
- rb->GetRow(ctx, rb, width, xpos, ypos + i, accRow);
- for (j = 0; j < 4 * width; j++) {
- accRow[j] += incr;
- }
- rb->PutRow(ctx, rb, width, xpos, ypos + i, accRow, NULL);
- }
- }
- }
- else {
- /* other types someday */
- }
-}
-
-
-static void
-accum_mult(struct gl_context *ctx, GLfloat mult,
- GLint xpos, GLint ypos, GLint width, GLint height )
-{
- SWcontext *swrast = SWRAST_CONTEXT(ctx);
- struct gl_renderbuffer *rb
- = ctx->DrawBuffer->Attachment[BUFFER_ACCUM].Renderbuffer;
-
- assert(rb);
-
- /* Leave optimized accum buffer mode */
- if (swrast->_IntegerAccumMode)
- rescale_accum(ctx);
-
- if (rb->DataType == GL_SHORT || rb->DataType == GL_UNSIGNED_SHORT) {
- if (rb->GetPointer(ctx, rb, 0, 0)) {
- GLint i, j;
- for (i = 0; i < height; i++) {
- GLshort *acc = (GLshort *) rb->GetPointer(ctx, rb, xpos, ypos + i);
- for (j = 0; j < 4 * width; j++) {
- acc[j] = (GLshort) (acc[j] * mult);
- }
- }
- }
- else {
- GLint i, j;
- for (i = 0; i < height; i++) {
- GLshort accRow[4 * MAX_WIDTH];
- rb->GetRow(ctx, rb, width, xpos, ypos + i, accRow);
- for (j = 0; j < 4 * width; j++) {
- accRow[j] = (GLshort) (accRow[j] * mult);
- }
- rb->PutRow(ctx, rb, width, xpos, ypos + i, accRow, NULL);
- }
- }
- }
- else {
- /* other types someday */
- }
-}
-
-
-
-static void
-accum_accum(struct gl_context *ctx, GLfloat value,
- GLint xpos, GLint ypos, GLint width, GLint height )
-{
- SWcontext *swrast = SWRAST_CONTEXT(ctx);
- struct gl_renderbuffer *rb
- = ctx->DrawBuffer->Attachment[BUFFER_ACCUM].Renderbuffer;
- const GLboolean directAccess = (rb->GetPointer(ctx, rb, 0, 0) != NULL);
-
- assert(rb);
-
- if (!ctx->ReadBuffer->_ColorReadBuffer) {
- /* no read buffer - OK */
- return;
- }
-
- /* May have to leave optimized accum buffer mode */
- if (swrast->_IntegerAccumScaler == 0.0 && value > 0.0 && value <= 1.0)
- swrast->_IntegerAccumScaler = value;
- if (swrast->_IntegerAccumMode && value != swrast->_IntegerAccumScaler)
- rescale_accum(ctx);
-
- if (rb->DataType == GL_SHORT || rb->DataType == GL_UNSIGNED_SHORT) {
- const GLfloat scale = value * ACCUM_SCALE16 / CHAN_MAXF;
- GLshort accumRow[4 * MAX_WIDTH];
- GLchan rgba[MAX_WIDTH][4];
- GLint i;
-
- for (i = 0; i < height; i++) {
- GLshort *acc;
- if (directAccess) {
- acc = (GLshort *) rb->GetPointer(ctx, rb, xpos, ypos + i);
- }
- else {
- rb->GetRow(ctx, rb, width, xpos, ypos + i, accumRow);
- acc = accumRow;
- }
-
- /* read colors from color buffer */
- _swrast_read_rgba_span(ctx, ctx->ReadBuffer->_ColorReadBuffer, width,
- xpos, ypos + i, CHAN_TYPE, rgba);
-
- /* do accumulation */
- if (swrast->_IntegerAccumMode) {
- /* simply add integer color values into accum buffer */
- GLint j;
- for (j = 0; j < width; j++) {
- acc[j * 4 + 0] += rgba[j][RCOMP];
- acc[j * 4 + 1] += rgba[j][GCOMP];
- acc[j * 4 + 2] += rgba[j][BCOMP];
- acc[j * 4 + 3] += rgba[j][ACOMP];
- }
- }
- else {
- /* scaled integer (or float) accum buffer */
- GLint j;
- for (j = 0; j < width; j++) {
- acc[j * 4 + 0] += (GLshort) ((GLfloat) rgba[j][RCOMP] * scale);
- acc[j * 4 + 1] += (GLshort) ((GLfloat) rgba[j][GCOMP] * scale);
- acc[j * 4 + 2] += (GLshort) ((GLfloat) rgba[j][BCOMP] * scale);
- acc[j * 4 + 3] += (GLshort) ((GLfloat) rgba[j][ACOMP] * scale);
- }
- }
-
- if (!directAccess) {
- rb->PutRow(ctx, rb, width, xpos, ypos + i, accumRow, NULL);
- }
- }
- }
- else {
- /* other types someday */
- }
-}
-
-
-
-static void
-accum_load(struct gl_context *ctx, GLfloat value,
- GLint xpos, GLint ypos, GLint width, GLint height )
-{
- SWcontext *swrast = SWRAST_CONTEXT(ctx);
- struct gl_renderbuffer *rb
- = ctx->DrawBuffer->Attachment[BUFFER_ACCUM].Renderbuffer;
- const GLboolean directAccess = (rb->GetPointer(ctx, rb, 0, 0) != NULL);
-
- assert(rb);
-
- if (!ctx->ReadBuffer->_ColorReadBuffer) {
- /* no read buffer - OK */
- return;
- }
-
- /* This is a change to go into optimized accum buffer mode */
- if (value > 0.0 && value <= 1.0) {
-#if USE_OPTIMIZED_ACCUM
- swrast->_IntegerAccumMode = GL_TRUE;
-#else
- swrast->_IntegerAccumMode = GL_FALSE;
-#endif
- swrast->_IntegerAccumScaler = value;
- }
- else {
- swrast->_IntegerAccumMode = GL_FALSE;
- swrast->_IntegerAccumScaler = 0.0;
- }
-
- if (rb->DataType == GL_SHORT || rb->DataType == GL_UNSIGNED_SHORT) {
- const GLfloat scale = value * ACCUM_SCALE16 / CHAN_MAXF;
- GLshort accumRow[4 * MAX_WIDTH];
- GLchan rgba[MAX_WIDTH][4];
- GLint i;
-
- for (i = 0; i < height; i++) {
- GLshort *acc;
- if (directAccess) {
- acc = (GLshort *) rb->GetPointer(ctx, rb, xpos, ypos + i);
- }
- else {
- rb->GetRow(ctx, rb, width, xpos, ypos + i, accumRow);
- acc = accumRow;
- }
-
- /* read colors from color buffer */
- _swrast_read_rgba_span(ctx, ctx->ReadBuffer->_ColorReadBuffer, width,
- xpos, ypos + i, CHAN_TYPE, rgba);
-
- /* do load */
- if (swrast->_IntegerAccumMode) {
- /* just copy values in */
- GLint j;
- assert(swrast->_IntegerAccumScaler > 0.0);
- assert(swrast->_IntegerAccumScaler <= 1.0);
- for (j = 0; j < width; j++) {
- acc[j * 4 + 0] = rgba[j][RCOMP];
- acc[j * 4 + 1] = rgba[j][GCOMP];
- acc[j * 4 + 2] = rgba[j][BCOMP];
- acc[j * 4 + 3] = rgba[j][ACOMP];
- }
- }
- else {
- /* scaled integer (or float) accum buffer */
- GLint j;
- for (j = 0; j < width; j++) {
- acc[j * 4 + 0] = (GLshort) ((GLfloat) rgba[j][RCOMP] * scale);
- acc[j * 4 + 1] = (GLshort) ((GLfloat) rgba[j][GCOMP] * scale);
- acc[j * 4 + 2] = (GLshort) ((GLfloat) rgba[j][BCOMP] * scale);
- acc[j * 4 + 3] = (GLshort) ((GLfloat) rgba[j][ACOMP] * scale);
- }
- }
-
- if (!directAccess) {
- rb->PutRow(ctx, rb, width, xpos, ypos + i, accumRow, NULL);
- }
- }
- }
-}
-
-
-static void
-accum_return(struct gl_context *ctx, GLfloat value,
- GLint xpos, GLint ypos, GLint width, GLint height )
-{
- SWcontext *swrast = SWRAST_CONTEXT(ctx);
- struct gl_framebuffer *fb = ctx->DrawBuffer;
- struct gl_renderbuffer *accumRb = fb->Attachment[BUFFER_ACCUM].Renderbuffer;
- const GLboolean directAccess
- = (accumRb->GetPointer(ctx, accumRb, 0, 0) != NULL);
-
- static GLchan multTable[32768];
- static GLfloat prevMult = 0.0;
- const GLfloat mult = swrast->_IntegerAccumScaler;
- const GLint max = MIN2((GLint) (256 / mult), 32767);
-
- /* May have to leave optimized accum buffer mode */
- if (swrast->_IntegerAccumMode && value != 1.0)
- rescale_accum(ctx);
-
- if (swrast->_IntegerAccumMode && swrast->_IntegerAccumScaler > 0) {
- /* build lookup table to avoid many floating point multiplies */
- GLint j;
- assert(swrast->_IntegerAccumScaler <= 1.0);
- if (mult != prevMult) {
- for (j = 0; j < max; j++)
- multTable[j] = IROUND((GLfloat) j * mult);
- prevMult = mult;
- }
- }
-
- if (accumRb->DataType == GL_SHORT ||
- accumRb->DataType == GL_UNSIGNED_SHORT) {
- const GLfloat scale = value * CHAN_MAXF / ACCUM_SCALE16;
- GLuint buffer;
- GLint i;
-
- /* XXX maybe transpose the 'i' and 'buffer' loops??? */
- for (i = 0; i < height; i++) {
- GLshort accumRow[4 * MAX_WIDTH];
- GLshort *acc;
- SWspan span;
-
- /* init color span */
- INIT_SPAN(span, GL_BITMAP);
- span.end = width;
- span.arrayMask = SPAN_RGBA;
- span.x = xpos;
- span.y = ypos + i;
-
- if (directAccess) {
- acc = (GLshort *) accumRb->GetPointer(ctx, accumRb, xpos, ypos +i);
- }
- else {
- accumRb->GetRow(ctx, accumRb, width, xpos, ypos + i, accumRow);
- acc = accumRow;
- }
-
- /* get the colors to return */
- if (swrast->_IntegerAccumMode) {
- GLint j;
- for (j = 0; j < width; j++) {
- ASSERT(acc[j * 4 + 0] < max);
- ASSERT(acc[j * 4 + 1] < max);
- ASSERT(acc[j * 4 + 2] < max);
- ASSERT(acc[j * 4 + 3] < max);
- span.array->rgba[j][RCOMP] = multTable[acc[j * 4 + 0]];
- span.array->rgba[j][GCOMP] = multTable[acc[j * 4 + 1]];
- span.array->rgba[j][BCOMP] = multTable[acc[j * 4 + 2]];
- span.array->rgba[j][ACOMP] = multTable[acc[j * 4 + 3]];
- }
- }
- else {
- /* scaled integer (or float) accum buffer */
- GLint j;
- for (j = 0; j < width; j++) {
-#if CHAN_BITS==32
- GLchan r = acc[j * 4 + 0] * scale;
- GLchan g = acc[j * 4 + 1] * scale;
- GLchan b = acc[j * 4 + 2] * scale;
- GLchan a = acc[j * 4 + 3] * scale;
-#else
- GLint r = IROUND( (GLfloat) (acc[j * 4 + 0]) * scale );
- GLint g = IROUND( (GLfloat) (acc[j * 4 + 1]) * scale );
- GLint b = IROUND( (GLfloat) (acc[j * 4 + 2]) * scale );
- GLint a = IROUND( (GLfloat) (acc[j * 4 + 3]) * scale );
-#endif
- span.array->rgba[j][RCOMP] = CLAMP( r, 0, CHAN_MAX );
- span.array->rgba[j][GCOMP] = CLAMP( g, 0, CHAN_MAX );
- span.array->rgba[j][BCOMP] = CLAMP( b, 0, CHAN_MAX );
- span.array->rgba[j][ACOMP] = CLAMP( a, 0, CHAN_MAX );
- }
- }
-
- /* store colors */
- for (buffer = 0; buffer < fb->_NumColorDrawBuffers; buffer++) {
- struct gl_renderbuffer *rb = fb->_ColorDrawBuffers[buffer];
- const GLboolean masking = (!ctx->Color.ColorMask[buffer][RCOMP] ||
- !ctx->Color.ColorMask[buffer][GCOMP] ||
- !ctx->Color.ColorMask[buffer][BCOMP] ||
- !ctx->Color.ColorMask[buffer][ACOMP]);
- if (masking) {
- _swrast_mask_rgba_span(ctx, rb, &span, buffer);
- }
- rb->PutRow(ctx, rb, width, xpos, ypos + i, span.array->rgba, NULL);
- }
- }
- }
- else {
- /* other types someday */
- }
-}
-
-
-
-/**
- * Software fallback for glAccum.
- */
-void
-_swrast_Accum(struct gl_context *ctx, GLenum op, GLfloat value)
-{
- SWcontext *swrast = SWRAST_CONTEXT(ctx);
- GLint xpos, ypos, width, height;
-
- if (swrast->NewState)
- _swrast_validate_derived( ctx );
-
- if (!ctx->DrawBuffer->Attachment[BUFFER_ACCUM].Renderbuffer) {
- _mesa_warning(ctx, "Calling glAccum() without an accumulation buffer");
- return;
- }
-
- if (!_mesa_check_conditional_render(ctx))
- return;
-
- swrast_render_start(ctx);
-
- /* Compute region after calling swrast_render_start() so that we know the
- * drawbuffer's size/bounds are up to date.
- */
- xpos = ctx->DrawBuffer->_Xmin;
- ypos = ctx->DrawBuffer->_Ymin;
- width = ctx->DrawBuffer->_Xmax - ctx->DrawBuffer->_Xmin;
- height = ctx->DrawBuffer->_Ymax - ctx->DrawBuffer->_Ymin;
-
- switch (op) {
- case GL_ADD:
- if (value != 0.0F) {
- accum_add(ctx, value, xpos, ypos, width, height);
- }
- break;
- case GL_MULT:
- if (value != 1.0F) {
- accum_mult(ctx, value, xpos, ypos, width, height);
- }
- break;
- case GL_ACCUM:
- if (value != 0.0F) {
- accum_accum(ctx, value, xpos, ypos, width, height);
- }
- break;
- case GL_LOAD:
- accum_load(ctx, value, xpos, ypos, width, height);
- break;
- case GL_RETURN:
- accum_return(ctx, value, xpos, ypos, width, height);
- break;
- default:
- _mesa_problem(ctx, "invalid mode in _swrast_Accum()");
- break;
- }
-
- swrast_render_finish(ctx);
-}
+/*
+ * Mesa 3-D graphics library
+ * Version: 6.5.2
+ *
+ * Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+
+#include "main/glheader.h"
+#include "main/condrender.h"
+#include "main/context.h"
+#include "main/macros.h"
+#include "main/imports.h"
+
+#include "s_accum.h"
+#include "s_context.h"
+#include "s_masking.h"
+#include "s_span.h"
+
+
+/* XXX this would have to change for accum buffers with more or less
+ * than 16 bits per color channel.
+ */
+#define ACCUM_SCALE16 32767.0F
+
+
+/*
+ * Accumulation buffer notes
+ *
+ * Normally, accumulation buffer values are GLshorts with values in
+ * [-32767, 32767] which represent floating point colors in [-1, 1],
+ * as defined by the OpenGL specification.
+ *
+ * We optimize for the common case used for full-scene antialiasing:
+ * // start with accum buffer cleared to zero
+ * glAccum(GL_LOAD, w); // or GL_ACCUM the first image
+ * glAccum(GL_ACCUM, w);
+ * ...
+ * glAccum(GL_ACCUM, w);
+ * glAccum(GL_RETURN, 1.0);
+ * That is, we start with an empty accumulation buffer and accumulate
+ * n images, each with weight w = 1/n.
+ * In this scenario, we can simply store unscaled integer values in
+ * the accum buffer instead of scaled integers. We'll also keep track
+ * of the w value so when we do GL_RETURN we simply divide the accumulated
+ * values by n (n=1/w).
+ * This lets us avoid _many_ int->float->int conversions.
+ */
+
+
+#if CHAN_BITS == 8
+/* enable the optimization */
+#define USE_OPTIMIZED_ACCUM 1
+#else
+#define USE_OPTIMIZED_ACCUM 0
+#endif
+
+
+/**
+ * This is called when we fall out of optimized/unscaled accum buffer mode.
+ * That is, we convert each unscaled accum buffer value into a scaled value
+ * representing the range[-1, 1].
+ */
+static void
+rescale_accum( struct gl_context *ctx )
+{
+ SWcontext *swrast = SWRAST_CONTEXT(ctx);
+ struct gl_renderbuffer *rb
+ = ctx->DrawBuffer->Attachment[BUFFER_ACCUM].Renderbuffer;
+ const GLfloat s = swrast->_IntegerAccumScaler * (32767.0F / CHAN_MAXF);
+
+ assert(rb);
+ assert(rb->_BaseFormat == GL_RGBA);
+ /* add other types in future? */
+ assert(rb->DataType == GL_SHORT || rb->DataType == GL_UNSIGNED_SHORT);
+ assert(swrast->_IntegerAccumMode);
+
+ if (rb->GetPointer(ctx, rb, 0, 0)) {
+ /* directly-addressable memory */
+ GLuint y;
+ for (y = 0; y < rb->Height; y++) {
+ GLuint i;
+ GLshort *acc = (GLshort *) rb->GetPointer(ctx, rb, 0, y);
+ for (i = 0; i < 4 * rb->Width; i++) {
+ acc[i] = (GLshort) (acc[i] * s);
+ }
+ }
+ }
+ else {
+ /* use get/put row funcs */
+ GLuint y;
+ for (y = 0; y < rb->Height; y++) {
+ GLshort accRow[MAX_WIDTH * 4];
+ GLuint i;
+ rb->GetRow(ctx, rb, rb->Width, 0, y, accRow);
+ for (i = 0; i < 4 * rb->Width; i++) {
+ accRow[i] = (GLshort) (accRow[i] * s);
+ }
+ rb->PutRow(ctx, rb, rb->Width, 0, y, accRow, NULL);
+ }
+ }
+
+ swrast->_IntegerAccumMode = GL_FALSE;
+}
+
+
+
+/**
+ * Clear the accumulation Buffer.
+ */
+void
+_swrast_clear_accum_buffer( struct gl_context *ctx, struct gl_renderbuffer *rb )
+{
+ SWcontext *swrast = SWRAST_CONTEXT(ctx);
+ GLuint x, y, width, height;
+
+ /* No accumulation buffer! Not an error. */
+ if (!rb || !rb->Data)
+ return;
+
+ assert(rb->_BaseFormat == GL_RGBA);
+ /* add other types in future? */
+ assert(rb->DataType == GL_SHORT || rb->DataType == GL_UNSIGNED_SHORT);
+
+ /* bounds, with scissor */
+ x = ctx->DrawBuffer->_Xmin;
+ y = ctx->DrawBuffer->_Ymin;
+ width = ctx->DrawBuffer->_Xmax - ctx->DrawBuffer->_Xmin;
+ height = ctx->DrawBuffer->_Ymax - ctx->DrawBuffer->_Ymin;
+
+ if (rb->DataType == GL_SHORT || rb->DataType == GL_UNSIGNED_SHORT) {
+ const GLfloat accScale = 32767.0;
+ GLshort clearVal[4];
+ GLuint i;
+
+ clearVal[0] = (GLshort) (ctx->Accum.ClearColor[0] * accScale);
+ clearVal[1] = (GLshort) (ctx->Accum.ClearColor[1] * accScale);
+ clearVal[2] = (GLshort) (ctx->Accum.ClearColor[2] * accScale);
+ clearVal[3] = (GLshort) (ctx->Accum.ClearColor[3] * accScale);
+
+ for (i = 0; i < height; i++) {
+ rb->PutMonoRow(ctx, rb, width, x, y + i, clearVal, NULL);
+ }
+ }
+ else {
+ /* someday support other sizes */
+ }
+
+ /* update optimized accum state vars */
+ if (ctx->Accum.ClearColor[0] == 0.0 && ctx->Accum.ClearColor[1] == 0.0 &&
+ ctx->Accum.ClearColor[2] == 0.0 && ctx->Accum.ClearColor[3] == 0.0) {
+#if USE_OPTIMIZED_ACCUM
+ swrast->_IntegerAccumMode = GL_TRUE;
+#else
+ swrast->_IntegerAccumMode = GL_FALSE;
+#endif
+ swrast->_IntegerAccumScaler = 0.0; /* denotes empty accum buffer */
+ }
+ else {
+ swrast->_IntegerAccumMode = GL_FALSE;
+ }
+}
+
+
+static void
+accum_add(struct gl_context *ctx, GLfloat value,
+ GLint xpos, GLint ypos, GLint width, GLint height )
+{
+ SWcontext *swrast = SWRAST_CONTEXT(ctx);
+ struct gl_renderbuffer *rb
+ = ctx->DrawBuffer->Attachment[BUFFER_ACCUM].Renderbuffer;
+
+ assert(rb);
+
+ /* Leave optimized accum buffer mode */
+ if (swrast->_IntegerAccumMode)
+ rescale_accum(ctx);
+
+ if (rb->DataType == GL_SHORT || rb->DataType == GL_UNSIGNED_SHORT) {
+ const GLshort incr = (GLshort) (value * ACCUM_SCALE16);
+ if (rb->GetPointer(ctx, rb, 0, 0)) {
+ GLint i, j;
+ for (i = 0; i < height; i++) {
+ GLshort *acc = (GLshort *) rb->GetPointer(ctx, rb, xpos, ypos + i);
+ for (j = 0; j < 4 * width; j++) {
+ acc[j] += incr;
+ }
+ }
+ }
+ else {
+ GLint i, j;
+ for (i = 0; i < height; i++) {
+ GLshort accRow[4 * MAX_WIDTH];
+ rb->GetRow(ctx, rb, width, xpos, ypos + i, accRow);
+ for (j = 0; j < 4 * width; j++) {
+ accRow[j] += incr;
+ }
+ rb->PutRow(ctx, rb, width, xpos, ypos + i, accRow, NULL);
+ }
+ }
+ }
+ else {
+ /* other types someday */
+ }
+}
+
+
+static void
+accum_mult(struct gl_context *ctx, GLfloat mult,
+ GLint xpos, GLint ypos, GLint width, GLint height )
+{
+ SWcontext *swrast = SWRAST_CONTEXT(ctx);
+ struct gl_renderbuffer *rb
+ = ctx->DrawBuffer->Attachment[BUFFER_ACCUM].Renderbuffer;
+
+ assert(rb);
+
+ /* Leave optimized accum buffer mode */
+ if (swrast->_IntegerAccumMode)
+ rescale_accum(ctx);
+
+ if (rb->DataType == GL_SHORT || rb->DataType == GL_UNSIGNED_SHORT) {
+ if (rb->GetPointer(ctx, rb, 0, 0)) {
+ GLint i, j;
+ for (i = 0; i < height; i++) {
+ GLshort *acc = (GLshort *) rb->GetPointer(ctx, rb, xpos, ypos + i);
+ for (j = 0; j < 4 * width; j++) {
+ acc[j] = (GLshort) (acc[j] * mult);
+ }
+ }
+ }
+ else {
+ GLint i, j;
+ for (i = 0; i < height; i++) {
+ GLshort accRow[4 * MAX_WIDTH];
+ rb->GetRow(ctx, rb, width, xpos, ypos + i, accRow);
+ for (j = 0; j < 4 * width; j++) {
+ accRow[j] = (GLshort) (accRow[j] * mult);
+ }
+ rb->PutRow(ctx, rb, width, xpos, ypos + i, accRow, NULL);
+ }
+ }
+ }
+ else {
+ /* other types someday */
+ }
+}
+
+
+
+static void
+accum_accum(struct gl_context *ctx, GLfloat value,
+ GLint xpos, GLint ypos, GLint width, GLint height )
+{
+ SWcontext *swrast = SWRAST_CONTEXT(ctx);
+ struct gl_renderbuffer *rb
+ = ctx->DrawBuffer->Attachment[BUFFER_ACCUM].Renderbuffer;
+ const GLboolean directAccess = (rb->GetPointer(ctx, rb, 0, 0) != NULL);
+
+ assert(rb);
+
+ if (!ctx->ReadBuffer->_ColorReadBuffer) {
+ /* no read buffer - OK */
+ return;
+ }
+
+ /* May have to leave optimized accum buffer mode */
+ if (swrast->_IntegerAccumScaler == 0.0 && value > 0.0 && value <= 1.0)
+ swrast->_IntegerAccumScaler = value;
+ if (swrast->_IntegerAccumMode && value != swrast->_IntegerAccumScaler)
+ rescale_accum(ctx);
+
+ if (rb->DataType == GL_SHORT || rb->DataType == GL_UNSIGNED_SHORT) {
+ const GLfloat scale = value * ACCUM_SCALE16 / CHAN_MAXF;
+ GLshort accumRow[4 * MAX_WIDTH];
+ GLchan rgba[MAX_WIDTH][4];
+ GLint i;
+
+ for (i = 0; i < height; i++) {
+ GLshort *acc;
+ if (directAccess) {
+ acc = (GLshort *) rb->GetPointer(ctx, rb, xpos, ypos + i);
+ }
+ else {
+ rb->GetRow(ctx, rb, width, xpos, ypos + i, accumRow);
+ acc = accumRow;
+ }
+
+ /* read colors from color buffer */
+ _swrast_read_rgba_span(ctx, ctx->ReadBuffer->_ColorReadBuffer, width,
+ xpos, ypos + i, CHAN_TYPE, rgba);
+
+ /* do accumulation */
+ if (swrast->_IntegerAccumMode) {
+ /* simply add integer color values into accum buffer */
+ GLint j;
+ for (j = 0; j < width; j++) {
+ acc[j * 4 + 0] += rgba[j][RCOMP];
+ acc[j * 4 + 1] += rgba[j][GCOMP];
+ acc[j * 4 + 2] += rgba[j][BCOMP];
+ acc[j * 4 + 3] += rgba[j][ACOMP];
+ }
+ }
+ else {
+ /* scaled integer (or float) accum buffer */
+ GLint j;
+ for (j = 0; j < width; j++) {
+ acc[j * 4 + 0] += (GLshort) ((GLfloat) rgba[j][RCOMP] * scale);
+ acc[j * 4 + 1] += (GLshort) ((GLfloat) rgba[j][GCOMP] * scale);
+ acc[j * 4 + 2] += (GLshort) ((GLfloat) rgba[j][BCOMP] * scale);
+ acc[j * 4 + 3] += (GLshort) ((GLfloat) rgba[j][ACOMP] * scale);
+ }
+ }
+
+ if (!directAccess) {
+ rb->PutRow(ctx, rb, width, xpos, ypos + i, accumRow, NULL);
+ }
+ }
+ }
+ else {
+ /* other types someday */
+ }
+}
+
+
+
+static void
+accum_load(struct gl_context *ctx, GLfloat value,
+ GLint xpos, GLint ypos, GLint width, GLint height )
+{
+ SWcontext *swrast = SWRAST_CONTEXT(ctx);
+ struct gl_renderbuffer *rb
+ = ctx->DrawBuffer->Attachment[BUFFER_ACCUM].Renderbuffer;
+ const GLboolean directAccess = (rb->GetPointer(ctx, rb, 0, 0) != NULL);
+
+ assert(rb);
+
+ if (!ctx->ReadBuffer->_ColorReadBuffer) {
+ /* no read buffer - OK */
+ return;
+ }
+
+ /* This is a change to go into optimized accum buffer mode */
+ if (value > 0.0 && value <= 1.0) {
+#if USE_OPTIMIZED_ACCUM
+ swrast->_IntegerAccumMode = GL_TRUE;
+#else
+ swrast->_IntegerAccumMode = GL_FALSE;
+#endif
+ swrast->_IntegerAccumScaler = value;
+ }
+ else {
+ swrast->_IntegerAccumMode = GL_FALSE;
+ swrast->_IntegerAccumScaler = 0.0;
+ }
+
+ if (rb->DataType == GL_SHORT || rb->DataType == GL_UNSIGNED_SHORT) {
+ const GLfloat scale = value * ACCUM_SCALE16 / CHAN_MAXF;
+ GLshort accumRow[4 * MAX_WIDTH];
+ GLchan rgba[MAX_WIDTH][4];
+ GLint i;
+
+ for (i = 0; i < height; i++) {
+ GLshort *acc;
+ if (directAccess) {
+ acc = (GLshort *) rb->GetPointer(ctx, rb, xpos, ypos + i);
+ }
+ else {
+ rb->GetRow(ctx, rb, width, xpos, ypos + i, accumRow);
+ acc = accumRow;
+ }
+
+ /* read colors from color buffer */
+ _swrast_read_rgba_span(ctx, ctx->ReadBuffer->_ColorReadBuffer, width,
+ xpos, ypos + i, CHAN_TYPE, rgba);
+
+ /* do load */
+ if (swrast->_IntegerAccumMode) {
+ /* just copy values in */
+ GLint j;
+ assert(swrast->_IntegerAccumScaler > 0.0);
+ assert(swrast->_IntegerAccumScaler <= 1.0);
+ for (j = 0; j < width; j++) {
+ acc[j * 4 + 0] = rgba[j][RCOMP];
+ acc[j * 4 + 1] = rgba[j][GCOMP];
+ acc[j * 4 + 2] = rgba[j][BCOMP];
+ acc[j * 4 + 3] = rgba[j][ACOMP];
+ }
+ }
+ else {
+ /* scaled integer (or float) accum buffer */
+ GLint j;
+ for (j = 0; j < width; j++) {
+ acc[j * 4 + 0] = (GLshort) ((GLfloat) rgba[j][RCOMP] * scale);
+ acc[j * 4 + 1] = (GLshort) ((GLfloat) rgba[j][GCOMP] * scale);
+ acc[j * 4 + 2] = (GLshort) ((GLfloat) rgba[j][BCOMP] * scale);
+ acc[j * 4 + 3] = (GLshort) ((GLfloat) rgba[j][ACOMP] * scale);
+ }
+ }
+
+ if (!directAccess) {
+ rb->PutRow(ctx, rb, width, xpos, ypos + i, accumRow, NULL);
+ }
+ }
+ }
+}
+
+
+static void
+accum_return(struct gl_context *ctx, GLfloat value,
+ GLint xpos, GLint ypos, GLint width, GLint height )
+{
+ SWcontext *swrast = SWRAST_CONTEXT(ctx);
+ struct gl_framebuffer *fb = ctx->DrawBuffer;
+ struct gl_renderbuffer *accumRb = fb->Attachment[BUFFER_ACCUM].Renderbuffer;
+ const GLboolean directAccess
+ = (accumRb->GetPointer(ctx, accumRb, 0, 0) != NULL);
+
+ static GLchan multTable[32768];
+ static GLfloat prevMult = 0.0;
+ const GLfloat mult = swrast->_IntegerAccumScaler;
+ const GLint max = MIN2((GLint) (256 / mult), 32767);
+
+ /* May have to leave optimized accum buffer mode */
+ if (swrast->_IntegerAccumMode && value != 1.0)
+ rescale_accum(ctx);
+
+ if (swrast->_IntegerAccumMode && swrast->_IntegerAccumScaler > 0) {
+ /* build lookup table to avoid many floating point multiplies */
+ GLint j;
+ assert(swrast->_IntegerAccumScaler <= 1.0);
+ if (mult != prevMult) {
+ for (j = 0; j < max; j++)
+ multTable[j] = IROUND((GLfloat) j * mult);
+ prevMult = mult;
+ }
+ }
+
+ if (accumRb->DataType == GL_SHORT ||
+ accumRb->DataType == GL_UNSIGNED_SHORT) {
+ const GLfloat scale = value * CHAN_MAXF / ACCUM_SCALE16;
+ GLuint buffer;
+ GLint i;
+
+ /* XXX maybe transpose the 'i' and 'buffer' loops??? */
+ for (i = 0; i < height; i++) {
+ GLshort accumRow[4 * MAX_WIDTH];
+ GLshort *acc;
+ SWspan span;
+
+ /* init color span */
+ INIT_SPAN(span, GL_BITMAP);
+ span.end = width;
+ span.arrayMask = SPAN_RGBA;
+ span.x = xpos;
+ span.y = ypos + i;
+
+ if (directAccess) {
+ acc = (GLshort *) accumRb->GetPointer(ctx, accumRb, xpos, ypos +i);
+ }
+ else {
+ accumRb->GetRow(ctx, accumRb, width, xpos, ypos + i, accumRow);
+ acc = accumRow;
+ }
+
+ /* get the colors to return */
+ if (swrast->_IntegerAccumMode) {
+ GLint j;
+ for (j = 0; j < width; j++) {
+ ASSERT(acc[j * 4 + 0] < max);
+ ASSERT(acc[j * 4 + 1] < max);
+ ASSERT(acc[j * 4 + 2] < max);
+ ASSERT(acc[j * 4 + 3] < max);
+ span.array->rgba[j][RCOMP] = multTable[acc[j * 4 + 0]];
+ span.array->rgba[j][GCOMP] = multTable[acc[j * 4 + 1]];
+ span.array->rgba[j][BCOMP] = multTable[acc[j * 4 + 2]];
+ span.array->rgba[j][ACOMP] = multTable[acc[j * 4 + 3]];
+ }
+ }
+ else {
+ /* scaled integer (or float) accum buffer */
+ GLint j;
+ for (j = 0; j < width; j++) {
+#if CHAN_BITS==32
+ GLchan r = acc[j * 4 + 0] * scale;
+ GLchan g = acc[j * 4 + 1] * scale;
+ GLchan b = acc[j * 4 + 2] * scale;
+ GLchan a = acc[j * 4 + 3] * scale;
+#else
+ GLint r = IROUND( (GLfloat) (acc[j * 4 + 0]) * scale );
+ GLint g = IROUND( (GLfloat) (acc[j * 4 + 1]) * scale );
+ GLint b = IROUND( (GLfloat) (acc[j * 4 + 2]) * scale );
+ GLint a = IROUND( (GLfloat) (acc[j * 4 + 3]) * scale );
+#endif
+ span.array->rgba[j][RCOMP] = CLAMP( r, 0, CHAN_MAX );
+ span.array->rgba[j][GCOMP] = CLAMP( g, 0, CHAN_MAX );
+ span.array->rgba[j][BCOMP] = CLAMP( b, 0, CHAN_MAX );
+ span.array->rgba[j][ACOMP] = CLAMP( a, 0, CHAN_MAX );
+ }
+ }
+
+ /* store colors */
+ for (buffer = 0; buffer < fb->_NumColorDrawBuffers; buffer++) {
+ struct gl_renderbuffer *rb = fb->_ColorDrawBuffers[buffer];
+ const GLboolean masking = (!ctx->Color.ColorMask[buffer][RCOMP] ||
+ !ctx->Color.ColorMask[buffer][GCOMP] ||
+ !ctx->Color.ColorMask[buffer][BCOMP] ||
+ !ctx->Color.ColorMask[buffer][ACOMP]);
+ if (masking) {
+ _swrast_mask_rgba_span(ctx, rb, &span, buffer);
+ }
+ rb->PutRow(ctx, rb, width, xpos, ypos + i, span.array->rgba, NULL);
+ }
+ }
+ }
+ else {
+ /* other types someday */
+ }
+}
+
+
+
+/**
+ * Software fallback for glAccum.
+ */
+void
+_swrast_Accum(struct gl_context *ctx, GLenum op, GLfloat value)
+{
+ SWcontext *swrast = SWRAST_CONTEXT(ctx);
+ GLint xpos, ypos, width, height;
+
+ if (swrast->NewState)
+ _swrast_validate_derived( ctx );
+
+ if (!ctx->DrawBuffer->Attachment[BUFFER_ACCUM].Renderbuffer) {
+ _mesa_warning(ctx, "Calling glAccum() without an accumulation buffer");
+ return;
+ }
+
+ if (!_mesa_check_conditional_render(ctx))
+ return;
+
+ swrast_render_start(ctx);
+
+ /* Compute region after calling swrast_render_start() so that we know the
+ * drawbuffer's size/bounds are up to date.
+ */
+ xpos = ctx->DrawBuffer->_Xmin;
+ ypos = ctx->DrawBuffer->_Ymin;
+ width = ctx->DrawBuffer->_Xmax - ctx->DrawBuffer->_Xmin;
+ height = ctx->DrawBuffer->_Ymax - ctx->DrawBuffer->_Ymin;
+
+ switch (op) {
+ case GL_ADD:
+ if (value != 0.0F) {
+ accum_add(ctx, value, xpos, ypos, width, height);
+ }
+ break;
+ case GL_MULT:
+ if (value != 1.0F) {
+ accum_mult(ctx, value, xpos, ypos, width, height);
+ }
+ break;
+ case GL_ACCUM:
+ if (value != 0.0F) {
+ accum_accum(ctx, value, xpos, ypos, width, height);
+ }
+ break;
+ case GL_LOAD:
+ accum_load(ctx, value, xpos, ypos, width, height);
+ break;
+ case GL_RETURN:
+ accum_return(ctx, value, xpos, ypos, width, height);
+ break;
+ default:
+ _mesa_problem(ctx, "invalid mode in _swrast_Accum()");
+ break;
+ }
+
+ swrast_render_finish(ctx);
+}
diff --git a/mesalib/src/mesa/swrast/s_bitmap.c b/mesalib/src/mesa/swrast/s_bitmap.c
index 18f1c1866..af65874fd 100644
--- a/mesalib/src/mesa/swrast/s_bitmap.c
+++ b/mesalib/src/mesa/swrast/s_bitmap.c
@@ -1,223 +1,223 @@
-/*
- * Mesa 3-D graphics library
- * Version: 7.1
- *
- * Copyright (C) 1999-2008 Brian Paul All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-/**
- * \file swrast/s_bitmap.c
- * \brief glBitmap rendering.
- * \author Brian Paul
- */
-
-#include "main/glheader.h"
-#include "main/bufferobj.h"
-#include "main/condrender.h"
-#include "main/image.h"
-#include "main/macros.h"
-#include "main/pbo.h"
-
-#include "s_context.h"
-#include "s_span.h"
-
-
-
-/**
- * Render a bitmap.
- * Called via ctx->Driver.Bitmap()
- * All parameter error checking will have been done before this is called.
- */
-void
-_swrast_Bitmap( struct gl_context *ctx, GLint px, GLint py,
- GLsizei width, GLsizei height,
- const struct gl_pixelstore_attrib *unpack,
- const GLubyte *bitmap )
-{
- GLint row, col;
- GLuint count = 0;
- SWspan span;
-
- ASSERT(ctx->RenderMode == GL_RENDER);
-
- if (!_mesa_check_conditional_render(ctx))
- return; /* don't draw */
-
- bitmap = (const GLubyte *) _mesa_map_pbo_source(ctx, unpack, bitmap);
- if (!bitmap)
- return;
-
- swrast_render_start(ctx);
-
- if (SWRAST_CONTEXT(ctx)->NewState)
- _swrast_validate_derived( ctx );
-
- INIT_SPAN(span, GL_BITMAP);
- span.end = width;
- span.arrayMask = SPAN_XY;
- _swrast_span_default_attribs(ctx, &span);
-
- for (row = 0; row < height; row++) {
- const GLubyte *src = (const GLubyte *) _mesa_image_address2d(unpack,
- bitmap, width, height, GL_COLOR_INDEX, GL_BITMAP, row, 0);
-
- if (unpack->LsbFirst) {
- /* Lsb first */
- GLubyte mask = 1U << (unpack->SkipPixels & 0x7);
- for (col = 0; col < width; col++) {
- if (*src & mask) {
- span.array->x[count] = px + col;
- span.array->y[count] = py + row;
- count++;
- }
- if (mask == 128U) {
- src++;
- mask = 1U;
- }
- else {
- mask = mask << 1;
- }
- }
-
- /* get ready for next row */
- if (mask != 1)
- src++;
- }
- else {
- /* Msb first */
- GLubyte mask = 128U >> (unpack->SkipPixels & 0x7);
- for (col = 0; col < width; col++) {
- if (*src & mask) {
- span.array->x[count] = px + col;
- span.array->y[count] = py + row;
- count++;
- }
- if (mask == 1U) {
- src++;
- mask = 128U;
- }
- else {
- mask = mask >> 1;
- }
- }
-
- /* get ready for next row */
- if (mask != 128)
- src++;
- }
-
- if (count + width >= MAX_WIDTH || row + 1 == height) {
- /* flush the span */
- span.end = count;
- _swrast_write_rgba_span(ctx, &span);
- span.end = 0;
- count = 0;
- }
- }
-
- swrast_render_finish(ctx);
-
- _mesa_unmap_pbo_source(ctx, unpack);
-}
-
-
-#if 0
-/*
- * XXX this is another way to implement Bitmap. Use horizontal runs of
- * fragments, initializing the mask array to indicate which fragments to
- * draw or skip.
- */
-void
-_swrast_Bitmap( struct gl_context *ctx, GLint px, GLint py,
- GLsizei width, GLsizei height,
- const struct gl_pixelstore_attrib *unpack,
- const GLubyte *bitmap )
-{
- SWcontext *swrast = SWRAST_CONTEXT(ctx);
- GLint row, col;
- SWspan span;
-
- ASSERT(ctx->RenderMode == GL_RENDER);
- ASSERT(bitmap);
-
- swrast_render_start(ctx);
-
- if (SWRAST_CONTEXT(ctx)->NewState)
- _swrast_validate_derived( ctx );
-
- INIT_SPAN(span, GL_BITMAP);
- span.end = width;
- span.arrayMask = SPAN_MASK;
- _swrast_span_default_attribs(ctx, &span);
-
- /*span.arrayMask |= SPAN_MASK;*/ /* we'll init span.mask[] */
- span.x = px;
- span.y = py;
- /*span.end = width;*/
-
- for (row=0; row<height; row++, span.y++) {
- const GLubyte *src = (const GLubyte *) _mesa_image_address2d(unpack,
- bitmap, width, height, GL_COLOR_INDEX, GL_BITMAP, row, 0);
-
- if (unpack->LsbFirst) {
- /* Lsb first */
- GLubyte mask = 1U << (unpack->SkipPixels & 0x7);
- for (col=0; col<width; col++) {
- span.array->mask[col] = (*src & mask) ? GL_TRUE : GL_FALSE;
- if (mask == 128U) {
- src++;
- mask = 1U;
- }
- else {
- mask = mask << 1;
- }
- }
-
- _swrast_write_rgba_span(ctx, &span);
-
- /* get ready for next row */
- if (mask != 1)
- src++;
- }
- else {
- /* Msb first */
- GLubyte mask = 128U >> (unpack->SkipPixels & 0x7);
- for (col=0; col<width; col++) {
- span.array->mask[col] = (*src & mask) ? GL_TRUE : GL_FALSE;
- if (mask == 1U) {
- src++;
- mask = 128U;
- }
- else {
- mask = mask >> 1;
- }
- }
-
- _swrast_write_rgba_span(ctx, &span);
-
- /* get ready for next row */
- if (mask != 128)
- src++;
- }
- }
-
- swrast_render_finish(ctx);
-}
-#endif
+/*
+ * Mesa 3-D graphics library
+ * Version: 7.1
+ *
+ * Copyright (C) 1999-2008 Brian Paul All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+/**
+ * \file swrast/s_bitmap.c
+ * \brief glBitmap rendering.
+ * \author Brian Paul
+ */
+
+#include "main/glheader.h"
+#include "main/bufferobj.h"
+#include "main/condrender.h"
+#include "main/image.h"
+#include "main/macros.h"
+#include "main/pbo.h"
+
+#include "s_context.h"
+#include "s_span.h"
+
+
+
+/**
+ * Render a bitmap.
+ * Called via ctx->Driver.Bitmap()
+ * All parameter error checking will have been done before this is called.
+ */
+void
+_swrast_Bitmap( struct gl_context *ctx, GLint px, GLint py,
+ GLsizei width, GLsizei height,
+ const struct gl_pixelstore_attrib *unpack,
+ const GLubyte *bitmap )
+{
+ GLint row, col;
+ GLuint count = 0;
+ SWspan span;
+
+ ASSERT(ctx->RenderMode == GL_RENDER);
+
+ if (!_mesa_check_conditional_render(ctx))
+ return; /* don't draw */
+
+ bitmap = (const GLubyte *) _mesa_map_pbo_source(ctx, unpack, bitmap);
+ if (!bitmap)
+ return;
+
+ swrast_render_start(ctx);
+
+ if (SWRAST_CONTEXT(ctx)->NewState)
+ _swrast_validate_derived( ctx );
+
+ INIT_SPAN(span, GL_BITMAP);
+ span.end = width;
+ span.arrayMask = SPAN_XY;
+ _swrast_span_default_attribs(ctx, &span);
+
+ for (row = 0; row < height; row++) {
+ const GLubyte *src = (const GLubyte *) _mesa_image_address2d(unpack,
+ bitmap, width, height, GL_COLOR_INDEX, GL_BITMAP, row, 0);
+
+ if (unpack->LsbFirst) {
+ /* Lsb first */
+ GLubyte mask = 1U << (unpack->SkipPixels & 0x7);
+ for (col = 0; col < width; col++) {
+ if (*src & mask) {
+ span.array->x[count] = px + col;
+ span.array->y[count] = py + row;
+ count++;
+ }
+ if (mask == 128U) {
+ src++;
+ mask = 1U;
+ }
+ else {
+ mask = mask << 1;
+ }
+ }
+
+ /* get ready for next row */
+ if (mask != 1)
+ src++;
+ }
+ else {
+ /* Msb first */
+ GLubyte mask = 128U >> (unpack->SkipPixels & 0x7);
+ for (col = 0; col < width; col++) {
+ if (*src & mask) {
+ span.array->x[count] = px + col;
+ span.array->y[count] = py + row;
+ count++;
+ }
+ if (mask == 1U) {
+ src++;
+ mask = 128U;
+ }
+ else {
+ mask = mask >> 1;
+ }
+ }
+
+ /* get ready for next row */
+ if (mask != 128)
+ src++;
+ }
+
+ if (count + width >= MAX_WIDTH || row + 1 == height) {
+ /* flush the span */
+ span.end = count;
+ _swrast_write_rgba_span(ctx, &span);
+ span.end = 0;
+ count = 0;
+ }
+ }
+
+ swrast_render_finish(ctx);
+
+ _mesa_unmap_pbo_source(ctx, unpack);
+}
+
+
+#if 0
+/*
+ * XXX this is another way to implement Bitmap. Use horizontal runs of
+ * fragments, initializing the mask array to indicate which fragments to
+ * draw or skip.
+ */
+void
+_swrast_Bitmap( struct gl_context *ctx, GLint px, GLint py,
+ GLsizei width, GLsizei height,
+ const struct gl_pixelstore_attrib *unpack,
+ const GLubyte *bitmap )
+{
+ SWcontext *swrast = SWRAST_CONTEXT(ctx);
+ GLint row, col;
+ SWspan span;
+
+ ASSERT(ctx->RenderMode == GL_RENDER);
+ ASSERT(bitmap);
+
+ swrast_render_start(ctx);
+
+ if (SWRAST_CONTEXT(ctx)->NewState)
+ _swrast_validate_derived( ctx );
+
+ INIT_SPAN(span, GL_BITMAP);
+ span.end = width;
+ span.arrayMask = SPAN_MASK;
+ _swrast_span_default_attribs(ctx, &span);
+
+ /*span.arrayMask |= SPAN_MASK;*/ /* we'll init span.mask[] */
+ span.x = px;
+ span.y = py;
+ /*span.end = width;*/
+
+ for (row=0; row<height; row++, span.y++) {
+ const GLubyte *src = (const GLubyte *) _mesa_image_address2d(unpack,
+ bitmap, width, height, GL_COLOR_INDEX, GL_BITMAP, row, 0);
+
+ if (unpack->LsbFirst) {
+ /* Lsb first */
+ GLubyte mask = 1U << (unpack->SkipPixels & 0x7);
+ for (col=0; col<width; col++) {
+ span.array->mask[col] = (*src & mask) ? GL_TRUE : GL_FALSE;
+ if (mask == 128U) {
+ src++;
+ mask = 1U;
+ }
+ else {
+ mask = mask << 1;
+ }
+ }
+
+ _swrast_write_rgba_span(ctx, &span);
+
+ /* get ready for next row */
+ if (mask != 1)
+ src++;
+ }
+ else {
+ /* Msb first */
+ GLubyte mask = 128U >> (unpack->SkipPixels & 0x7);
+ for (col=0; col<width; col++) {
+ span.array->mask[col] = (*src & mask) ? GL_TRUE : GL_FALSE;
+ if (mask == 1U) {
+ src++;
+ mask = 128U;
+ }
+ else {
+ mask = mask >> 1;
+ }
+ }
+
+ _swrast_write_rgba_span(ctx, &span);
+
+ /* get ready for next row */
+ if (mask != 128)
+ src++;
+ }
+ }
+
+ swrast_render_finish(ctx);
+}
+#endif
diff --git a/mesalib/src/mesa/swrast/s_context.c b/mesalib/src/mesa/swrast/s_context.c
index def1531d7..d5f49923c 100644
--- a/mesalib/src/mesa/swrast/s_context.c
+++ b/mesalib/src/mesa/swrast/s_context.c
@@ -1,949 +1,949 @@
-/*
- * Mesa 3-D graphics library
- * Version: 7.1
- *
- * Copyright (C) 1999-2008 Brian Paul All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- * Authors:
- * Keith Whitwell <keith@tungstengraphics.com>
- * Brian Paul
- */
-
-#include "main/imports.h"
-#include "main/bufferobj.h"
-#include "main/colormac.h"
-#include "main/mtypes.h"
-#include "main/teximage.h"
-#include "program/prog_parameter.h"
-#include "program/prog_statevars.h"
-#include "swrast.h"
-#include "s_blend.h"
-#include "s_context.h"
-#include "s_lines.h"
-#include "s_points.h"
-#include "s_span.h"
-#include "s_triangle.h"
-#include "s_texfilter.h"
-
-
-/**
- * Recompute the value of swrast->_RasterMask, etc. according to
- * the current context. The _RasterMask field can be easily tested by
- * drivers to determine certain basic GL state (does the primitive need
- * stenciling, logic-op, fog, etc?).
- */
-static void
-_swrast_update_rasterflags( struct gl_context *ctx )
-{
- SWcontext *swrast = SWRAST_CONTEXT(ctx);
- GLbitfield rasterMask = 0;
- GLuint i;
-
- if (ctx->Color.AlphaEnabled) rasterMask |= ALPHATEST_BIT;
- if (ctx->Color.BlendEnabled) rasterMask |= BLEND_BIT;
- if (ctx->Depth.Test) rasterMask |= DEPTH_BIT;
- if (swrast->_FogEnabled) rasterMask |= FOG_BIT;
- if (ctx->Scissor.Enabled) rasterMask |= CLIP_BIT;
- if (ctx->Stencil._Enabled) rasterMask |= STENCIL_BIT;
- for (i = 0; i < ctx->Const.MaxDrawBuffers; i++) {
- if (!ctx->Color.ColorMask[i][0] ||
- !ctx->Color.ColorMask[i][1] ||
- !ctx->Color.ColorMask[i][2] ||
- !ctx->Color.ColorMask[i][3]) {
- rasterMask |= MASKING_BIT;
- break;
- }
- }
- if (ctx->Color._LogicOpEnabled) rasterMask |= LOGIC_OP_BIT;
- if (ctx->Texture._EnabledUnits) rasterMask |= TEXTURE_BIT;
- if ( ctx->Viewport.X < 0
- || ctx->Viewport.X + ctx->Viewport.Width > (GLint) ctx->DrawBuffer->Width
- || ctx->Viewport.Y < 0
- || ctx->Viewport.Y + ctx->Viewport.Height > (GLint) ctx->DrawBuffer->Height) {
- rasterMask |= CLIP_BIT;
- }
-
- if (ctx->Query.CurrentOcclusionObject)
- rasterMask |= OCCLUSION_BIT;
-
-
- /* If we're not drawing to exactly one color buffer set the
- * MULTI_DRAW_BIT flag. Also set it if we're drawing to no
- * buffers or the RGBA or CI mask disables all writes.
- */
- if (ctx->DrawBuffer->_NumColorDrawBuffers != 1) {
- /* more than one color buffer designated for writing (or zero buffers) */
- rasterMask |= MULTI_DRAW_BIT;
- }
-
- for (i = 0; i < ctx->Const.MaxDrawBuffers; i++) {
- if (ctx->Color.ColorMask[i][0] +
- ctx->Color.ColorMask[i][1] +
- ctx->Color.ColorMask[i][2] +
- ctx->Color.ColorMask[i][3] == 0) {
- rasterMask |= MULTI_DRAW_BIT; /* all RGBA channels disabled */
- break;
- }
- }
-
-
- if (ctx->FragmentProgram._Current) {
- rasterMask |= FRAGPROG_BIT;
- }
-
- if (ctx->ATIFragmentShader._Enabled) {
- rasterMask |= ATIFRAGSHADER_BIT;
- }
-
-#if CHAN_TYPE == GL_FLOAT
- if (ctx->Color.ClampFragmentColor == GL_TRUE) {
- rasterMask |= CLAMPING_BIT;
- }
-#endif
-
- SWRAST_CONTEXT(ctx)->_RasterMask = rasterMask;
-}
-
-
-/**
- * Examine polygon cull state to compute the _BackfaceCullSign field.
- * _BackfaceCullSign will be 0 if no culling, -1 if culling back-faces,
- * and 1 if culling front-faces. The Polygon FrontFace state also
- * factors in.
- */
-static void
-_swrast_update_polygon( struct gl_context *ctx )
-{
- GLfloat backface_sign;
-
- if (ctx->Polygon.CullFlag) {
- switch (ctx->Polygon.CullFaceMode) {
- case GL_BACK:
- backface_sign = -1.0F;
- break;
- case GL_FRONT:
- backface_sign = 1.0F;
- break;
- case GL_FRONT_AND_BACK:
- /* fallthrough */
- default:
- backface_sign = 0.0F;
- }
- }
- else {
- backface_sign = 0.0F;
- }
-
- SWRAST_CONTEXT(ctx)->_BackfaceCullSign = backface_sign;
-
- /* This is for front/back-face determination, but not for culling */
- SWRAST_CONTEXT(ctx)->_BackfaceSign
- = (ctx->Polygon.FrontFace == GL_CW) ? -1.0F : 1.0F;
-}
-
-
-
-/**
- * Update the _PreferPixelFog field to indicate if we need to compute
- * fog blend factors (from the fog coords) per-fragment.
- */
-static void
-_swrast_update_fog_hint( struct gl_context *ctx )
-{
- SWcontext *swrast = SWRAST_CONTEXT(ctx);
- swrast->_PreferPixelFog = (!swrast->AllowVertexFog ||
- ctx->FragmentProgram._Current ||
- (ctx->Hint.Fog == GL_NICEST &&
- swrast->AllowPixelFog));
-}
-
-
-
-/**
- * Update the swrast->_TextureCombinePrimary flag.
- */
-static void
-_swrast_update_texture_env( struct gl_context *ctx )
-{
- SWcontext *swrast = SWRAST_CONTEXT(ctx);
- GLuint i;
-
- swrast->_TextureCombinePrimary = GL_FALSE;
-
- for (i = 0; i < ctx->Const.MaxTextureUnits; i++) {
- const struct gl_tex_env_combine_state *combine =
- ctx->Texture.Unit[i]._CurrentCombine;
- GLuint term;
- for (term = 0; term < combine->_NumArgsRGB; term++) {
- if (combine->SourceRGB[term] == GL_PRIMARY_COLOR) {
- swrast->_TextureCombinePrimary = GL_TRUE;
- return;
- }
- if (combine->SourceA[term] == GL_PRIMARY_COLOR) {
- swrast->_TextureCombinePrimary = GL_TRUE;
- return;
- }
- }
- }
-}
-
-
-/**
- * Determine if we can defer texturing/shading until after Z/stencil
- * testing. This potentially allows us to skip texturing/shading for
- * lots of fragments.
- */
-static void
-_swrast_update_deferred_texture(struct gl_context *ctx)
-{
- SWcontext *swrast = SWRAST_CONTEXT(ctx);
- if (ctx->Color.AlphaEnabled) {
- /* alpha test depends on post-texture/shader colors */
- swrast->_DeferredTexture = GL_FALSE;
- }
- else {
- const struct gl_fragment_program *fprog
- = ctx->FragmentProgram._Current;
- if (fprog && (fprog->Base.OutputsWritten & (1 << FRAG_RESULT_DEPTH))) {
- /* Z comes from fragment program/shader */
- swrast->_DeferredTexture = GL_FALSE;
- }
- else if (fprog && fprog->UsesKill) {
- swrast->_DeferredTexture = GL_FALSE;
- }
- else if (ctx->Query.CurrentOcclusionObject) {
- /* occlusion query depends on shader discard/kill results */
- swrast->_DeferredTexture = GL_FALSE;
- }
- else {
- swrast->_DeferredTexture = GL_TRUE;
- }
- }
-}
-
-
-/**
- * Update swrast->_FogColor and swrast->_FogEnable values.
- */
-static void
-_swrast_update_fog_state( struct gl_context *ctx )
-{
- SWcontext *swrast = SWRAST_CONTEXT(ctx);
- const struct gl_fragment_program *fp = ctx->FragmentProgram._Current;
-
- assert((fp == NULL) || (fp->Base.Target == GL_FRAGMENT_PROGRAM_ARB));
-
- /* determine if fog is needed, and if so, which fog mode */
- swrast->_FogEnabled = (fp == NULL && ctx->Fog.Enabled);
-}
-
-
-/**
- * Update state for running fragment programs. Basically, load the
- * program parameters with current state values.
- */
-static void
-_swrast_update_fragment_program(struct gl_context *ctx, GLbitfield newState)
-{
- const struct gl_fragment_program *fp = ctx->FragmentProgram._Current;
- if (fp) {
- _mesa_load_state_parameters(ctx, fp->Base.Parameters);
- }
-}
-
-
-/**
- * See if we can do early diffuse+specular (primary+secondary) color
- * add per vertex instead of per-fragment.
- */
-static void
-_swrast_update_specular_vertex_add(struct gl_context *ctx)
-{
- SWcontext *swrast = SWRAST_CONTEXT(ctx);
- GLboolean separateSpecular = ctx->Fog.ColorSumEnabled ||
- (ctx->Light.Enabled &&
- ctx->Light.Model.ColorControl == GL_SEPARATE_SPECULAR_COLOR);
-
- swrast->SpecularVertexAdd = (separateSpecular
- && ctx->Texture._EnabledUnits == 0x0
- && !ctx->FragmentProgram._Current
- && !ctx->ATIFragmentShader._Enabled);
-}
-
-
-#define _SWRAST_NEW_DERIVED (_SWRAST_NEW_RASTERMASK | \
- _NEW_PROGRAM_CONSTANTS | \
- _NEW_TEXTURE | \
- _NEW_HINT | \
- _NEW_POLYGON )
-
-/* State referenced by _swrast_choose_triangle, _swrast_choose_line.
- */
-#define _SWRAST_NEW_TRIANGLE (_SWRAST_NEW_DERIVED | \
- _NEW_RENDERMODE| \
- _NEW_POLYGON| \
- _NEW_DEPTH| \
- _NEW_STENCIL| \
- _NEW_COLOR| \
- _NEW_TEXTURE| \
- _SWRAST_NEW_RASTERMASK| \
- _NEW_LIGHT| \
- _NEW_FOG | \
- _DD_NEW_SEPARATE_SPECULAR)
-
-#define _SWRAST_NEW_LINE (_SWRAST_NEW_DERIVED | \
- _NEW_RENDERMODE| \
- _NEW_LINE| \
- _NEW_TEXTURE| \
- _NEW_LIGHT| \
- _NEW_FOG| \
- _NEW_DEPTH | \
- _DD_NEW_SEPARATE_SPECULAR)
-
-#define _SWRAST_NEW_POINT (_SWRAST_NEW_DERIVED | \
- _NEW_RENDERMODE | \
- _NEW_POINT | \
- _NEW_TEXTURE | \
- _NEW_LIGHT | \
- _NEW_FOG | \
- _DD_NEW_SEPARATE_SPECULAR)
-
-#define _SWRAST_NEW_TEXTURE_SAMPLE_FUNC _NEW_TEXTURE
-
-#define _SWRAST_NEW_TEXTURE_ENV_MODE _NEW_TEXTURE
-
-#define _SWRAST_NEW_BLEND_FUNC _NEW_COLOR
-
-
-
-/**
- * Stub for swrast->Triangle to select a true triangle function
- * after a state change.
- */
-static void
-_swrast_validate_triangle( struct gl_context *ctx,
- const SWvertex *v0,
- const SWvertex *v1,
- const SWvertex *v2 )
-{
- SWcontext *swrast = SWRAST_CONTEXT(ctx);
-
- _swrast_validate_derived( ctx );
- swrast->choose_triangle( ctx );
- ASSERT(swrast->Triangle);
-
- if (swrast->SpecularVertexAdd) {
- /* separate specular color, but no texture */
- swrast->SpecTriangle = swrast->Triangle;
- swrast->Triangle = _swrast_add_spec_terms_triangle;
- }
-
- swrast->Triangle( ctx, v0, v1, v2 );
-}
-
-/**
- * Called via swrast->Line. Examine current GL state and choose a software
- * line routine. Then call it.
- */
-static void
-_swrast_validate_line( struct gl_context *ctx, const SWvertex *v0, const SWvertex *v1 )
-{
- SWcontext *swrast = SWRAST_CONTEXT(ctx);
-
- _swrast_validate_derived( ctx );
- swrast->choose_line( ctx );
- ASSERT(swrast->Line);
-
- if (swrast->SpecularVertexAdd) {
- swrast->SpecLine = swrast->Line;
- swrast->Line = _swrast_add_spec_terms_line;
- }
-
- swrast->Line( ctx, v0, v1 );
-}
-
-/**
- * Called via swrast->Point. Examine current GL state and choose a software
- * point routine. Then call it.
- */
-static void
-_swrast_validate_point( struct gl_context *ctx, const SWvertex *v0 )
-{
- SWcontext *swrast = SWRAST_CONTEXT(ctx);
-
- _swrast_validate_derived( ctx );
- swrast->choose_point( ctx );
-
- if (swrast->SpecularVertexAdd) {
- swrast->SpecPoint = swrast->Point;
- swrast->Point = _swrast_add_spec_terms_point;
- }
-
- swrast->Point( ctx, v0 );
-}
-
-
-/**
- * Called via swrast->BlendFunc. Examine GL state to choose a blending
- * function, then call it.
- */
-static void _ASMAPI
-_swrast_validate_blend_func(struct gl_context *ctx, GLuint n, const GLubyte mask[],
- GLvoid *src, const GLvoid *dst,
- GLenum chanType )
-{
- SWcontext *swrast = SWRAST_CONTEXT(ctx);
-
- _swrast_validate_derived( ctx ); /* why is this needed? */
- _swrast_choose_blend_func( ctx, chanType );
-
- swrast->BlendFunc( ctx, n, mask, src, dst, chanType );
-}
-
-
-/**
- * Make sure we have texture image data for all the textures we may need
- * for subsequent rendering.
- */
-static void
-_swrast_validate_texture_images(struct gl_context *ctx)
-{
- SWcontext *swrast = SWRAST_CONTEXT(ctx);
- GLuint u;
-
- if (!swrast->ValidateTextureImage || !ctx->Texture._EnabledUnits) {
- /* no textures enabled, or no way to validate images! */
- return;
- }
-
- for (u = 0; u < ctx->Const.MaxTextureImageUnits; u++) {
- if (ctx->Texture.Unit[u]._ReallyEnabled) {
- struct gl_texture_object *texObj = ctx->Texture.Unit[u]._Current;
- ASSERT(texObj);
- if (texObj) {
- GLuint numFaces = (texObj->Target == GL_TEXTURE_CUBE_MAP) ? 6 : 1;
- GLuint face;
- for (face = 0; face < numFaces; face++) {
- GLint lvl;
- for (lvl = texObj->BaseLevel; lvl <= texObj->_MaxLevel; lvl++) {
- struct gl_texture_image *texImg = texObj->Image[face][lvl];
- if (texImg && !texImg->Data) {
- swrast->ValidateTextureImage(ctx, texObj, face, lvl);
- ASSERT(texObj->Image[face][lvl]->Data);
- }
- }
- }
- }
- }
- }
-}
-
-
-/**
- * Free the texture image data attached to all currently enabled
- * textures. Meant to be called by device drivers when transitioning
- * from software to hardware rendering.
- */
-void
-_swrast_eject_texture_images(struct gl_context *ctx)
-{
- GLuint u;
-
- if (!ctx->Texture._EnabledUnits) {
- /* no textures enabled */
- return;
- }
-
- for (u = 0; u < ctx->Const.MaxTextureImageUnits; u++) {
- if (ctx->Texture.Unit[u]._ReallyEnabled) {
- struct gl_texture_object *texObj = ctx->Texture.Unit[u]._Current;
- ASSERT(texObj);
- if (texObj) {
- GLuint numFaces = (texObj->Target == GL_TEXTURE_CUBE_MAP) ? 6 : 1;
- GLuint face;
- for (face = 0; face < numFaces; face++) {
- GLint lvl;
- for (lvl = texObj->BaseLevel; lvl <= texObj->_MaxLevel; lvl++) {
- struct gl_texture_image *texImg = texObj->Image[face][lvl];
- if (texImg && texImg->Data) {
- _mesa_free_texmemory(texImg->Data);
- texImg->Data = NULL;
- }
- }
- }
- }
- }
- }
-}
-
-
-
-static void
-_swrast_sleep( struct gl_context *ctx, GLbitfield new_state )
-{
- (void) ctx; (void) new_state;
-}
-
-
-static void
-_swrast_invalidate_state( struct gl_context *ctx, GLbitfield new_state )
-{
- SWcontext *swrast = SWRAST_CONTEXT(ctx);
- GLuint i;
-
- swrast->NewState |= new_state;
-
- /* After 10 statechanges without any swrast functions being called,
- * put the module to sleep.
- */
- if (++swrast->StateChanges > 10) {
- swrast->InvalidateState = _swrast_sleep;
- swrast->NewState = ~0;
- new_state = ~0;
- }
-
- if (new_state & swrast->InvalidateTriangleMask)
- swrast->Triangle = _swrast_validate_triangle;
-
- if (new_state & swrast->InvalidateLineMask)
- swrast->Line = _swrast_validate_line;
-
- if (new_state & swrast->InvalidatePointMask)
- swrast->Point = _swrast_validate_point;
-
- if (new_state & _SWRAST_NEW_BLEND_FUNC)
- swrast->BlendFunc = _swrast_validate_blend_func;
-
- if (new_state & _SWRAST_NEW_TEXTURE_SAMPLE_FUNC)
- for (i = 0 ; i < ctx->Const.MaxTextureImageUnits ; i++)
- swrast->TextureSample[i] = NULL;
-}
-
-
-void
-_swrast_update_texture_samplers(struct gl_context *ctx)
-{
- SWcontext *swrast = SWRAST_CONTEXT(ctx);
- GLuint u;
-
- if (!swrast)
- return; /* pipe hack */
-
- for (u = 0; u < ctx->Const.MaxTextureImageUnits; u++) {
- const struct gl_texture_object *tObj = ctx->Texture.Unit[u]._Current;
- /* Note: If tObj is NULL, the sample function will be a simple
- * function that just returns opaque black (0,0,0,1).
- */
- swrast->TextureSample[u] = _swrast_choose_texture_sample_func(ctx, tObj);
- }
-}
-
-
-/**
- * Update swrast->_ActiveAttribs, swrast->_NumActiveAttribs,
- * swrast->_ActiveAtttribMask.
- */
-static void
-_swrast_update_active_attribs(struct gl_context *ctx)
-{
- SWcontext *swrast = SWRAST_CONTEXT(ctx);
- GLuint attribsMask;
-
- /*
- * Compute _ActiveAttribsMask = which fragment attributes are needed.
- */
- if (ctx->FragmentProgram._Current) {
- /* fragment program/shader */
- attribsMask = ctx->FragmentProgram._Current->Base.InputsRead;
- attribsMask &= ~FRAG_BIT_WPOS; /* WPOS is always handled specially */
- }
- else if (ctx->ATIFragmentShader._Enabled) {
- attribsMask = ~0; /* XXX fix me */
- }
- else {
- /* fixed function */
- attribsMask = 0x0;
-
-#if CHAN_TYPE == GL_FLOAT
- attribsMask |= FRAG_BIT_COL0;
-#endif
-
- if (ctx->Fog.ColorSumEnabled ||
- (ctx->Light.Enabled &&
- ctx->Light.Model.ColorControl == GL_SEPARATE_SPECULAR_COLOR)) {
- attribsMask |= FRAG_BIT_COL1;
- }
-
- if (swrast->_FogEnabled)
- attribsMask |= FRAG_BIT_FOGC;
-
- attribsMask |= (ctx->Texture._EnabledUnits << FRAG_ATTRIB_TEX0);
- }
-
- swrast->_ActiveAttribMask = attribsMask;
-
- /* Update _ActiveAttribs[] list */
- {
- GLuint i, num = 0;
- for (i = 0; i < FRAG_ATTRIB_MAX; i++) {
- if (attribsMask & (1 << i)) {
- swrast->_ActiveAttribs[num++] = i;
- /* how should this attribute be interpolated? */
- if (i == FRAG_ATTRIB_COL0 || i == FRAG_ATTRIB_COL1)
- swrast->_InterpMode[i] = ctx->Light.ShadeModel;
- else
- swrast->_InterpMode[i] = GL_SMOOTH;
- }
- }
- swrast->_NumActiveAttribs = num;
- }
-}
-
-
-void
-_swrast_validate_derived( struct gl_context *ctx )
-{
- SWcontext *swrast = SWRAST_CONTEXT(ctx);
-
- if (swrast->NewState) {
- if (swrast->NewState & _NEW_POLYGON)
- _swrast_update_polygon( ctx );
-
- if (swrast->NewState & (_NEW_HINT | _NEW_PROGRAM))
- _swrast_update_fog_hint( ctx );
-
- if (swrast->NewState & _SWRAST_NEW_TEXTURE_ENV_MODE)
- _swrast_update_texture_env( ctx );
-
- if (swrast->NewState & (_NEW_FOG | _NEW_PROGRAM))
- _swrast_update_fog_state( ctx );
-
- if (swrast->NewState & (_NEW_PROGRAM_CONSTANTS | _NEW_PROGRAM))
- _swrast_update_fragment_program( ctx, swrast->NewState );
-
- if (swrast->NewState & (_NEW_TEXTURE | _NEW_PROGRAM)) {
- _swrast_update_texture_samplers( ctx );
- _swrast_validate_texture_images(ctx);
- }
-
- if (swrast->NewState & (_NEW_COLOR | _NEW_PROGRAM))
- _swrast_update_deferred_texture(ctx);
-
- if (swrast->NewState & _SWRAST_NEW_RASTERMASK)
- _swrast_update_rasterflags( ctx );
-
- if (swrast->NewState & (_NEW_DEPTH |
- _NEW_FOG |
- _NEW_LIGHT |
- _NEW_PROGRAM |
- _NEW_TEXTURE))
- _swrast_update_active_attribs(ctx);
-
- if (swrast->NewState & (_NEW_FOG |
- _NEW_PROGRAM |
- _NEW_LIGHT |
- _NEW_TEXTURE))
- _swrast_update_specular_vertex_add(ctx);
-
- swrast->NewState = 0;
- swrast->StateChanges = 0;
- swrast->InvalidateState = _swrast_invalidate_state;
- }
-}
-
-#define SWRAST_DEBUG 0
-
-/* Public entrypoints: See also s_accum.c, s_bitmap.c, etc.
- */
-void
-_swrast_Quad( struct gl_context *ctx,
- const SWvertex *v0, const SWvertex *v1,
- const SWvertex *v2, const SWvertex *v3 )
-{
- if (SWRAST_DEBUG) {
- _mesa_debug(ctx, "_swrast_Quad\n");
- _swrast_print_vertex( ctx, v0 );
- _swrast_print_vertex( ctx, v1 );
- _swrast_print_vertex( ctx, v2 );
- _swrast_print_vertex( ctx, v3 );
- }
- SWRAST_CONTEXT(ctx)->Triangle( ctx, v0, v1, v3 );
- SWRAST_CONTEXT(ctx)->Triangle( ctx, v1, v2, v3 );
-}
-
-void
-_swrast_Triangle( struct gl_context *ctx, const SWvertex *v0,
- const SWvertex *v1, const SWvertex *v2 )
-{
- if (SWRAST_DEBUG) {
- _mesa_debug(ctx, "_swrast_Triangle\n");
- _swrast_print_vertex( ctx, v0 );
- _swrast_print_vertex( ctx, v1 );
- _swrast_print_vertex( ctx, v2 );
- }
- SWRAST_CONTEXT(ctx)->Triangle( ctx, v0, v1, v2 );
-}
-
-void
-_swrast_Line( struct gl_context *ctx, const SWvertex *v0, const SWvertex *v1 )
-{
- if (SWRAST_DEBUG) {
- _mesa_debug(ctx, "_swrast_Line\n");
- _swrast_print_vertex( ctx, v0 );
- _swrast_print_vertex( ctx, v1 );
- }
- SWRAST_CONTEXT(ctx)->Line( ctx, v0, v1 );
-}
-
-void
-_swrast_Point( struct gl_context *ctx, const SWvertex *v0 )
-{
- if (SWRAST_DEBUG) {
- _mesa_debug(ctx, "_swrast_Point\n");
- _swrast_print_vertex( ctx, v0 );
- }
- SWRAST_CONTEXT(ctx)->Point( ctx, v0 );
-}
-
-void
-_swrast_InvalidateState( struct gl_context *ctx, GLbitfield new_state )
-{
- if (SWRAST_DEBUG) {
- _mesa_debug(ctx, "_swrast_InvalidateState\n");
- }
- SWRAST_CONTEXT(ctx)->InvalidateState( ctx, new_state );
-}
-
-void
-_swrast_ResetLineStipple( struct gl_context *ctx )
-{
- if (SWRAST_DEBUG) {
- _mesa_debug(ctx, "_swrast_ResetLineStipple\n");
- }
- SWRAST_CONTEXT(ctx)->StippleCounter = 0;
-}
-
-void
-_swrast_SetFacing(struct gl_context *ctx, GLuint facing)
-{
- SWRAST_CONTEXT(ctx)->PointLineFacing = facing;
-}
-
-void
-_swrast_allow_vertex_fog( struct gl_context *ctx, GLboolean value )
-{
- if (SWRAST_DEBUG) {
- _mesa_debug(ctx, "_swrast_allow_vertex_fog %d\n", value);
- }
- SWRAST_CONTEXT(ctx)->InvalidateState( ctx, _NEW_HINT );
- SWRAST_CONTEXT(ctx)->AllowVertexFog = value;
-}
-
-void
-_swrast_allow_pixel_fog( struct gl_context *ctx, GLboolean value )
-{
- if (SWRAST_DEBUG) {
- _mesa_debug(ctx, "_swrast_allow_pixel_fog %d\n", value);
- }
- SWRAST_CONTEXT(ctx)->InvalidateState( ctx, _NEW_HINT );
- SWRAST_CONTEXT(ctx)->AllowPixelFog = value;
-}
-
-
-GLboolean
-_swrast_CreateContext( struct gl_context *ctx )
-{
- GLuint i;
- SWcontext *swrast = (SWcontext *)CALLOC(sizeof(SWcontext));
-
- if (SWRAST_DEBUG) {
- _mesa_debug(ctx, "_swrast_CreateContext\n");
- }
-
- if (!swrast)
- return GL_FALSE;
-
- swrast->NewState = ~0;
-
- swrast->choose_point = _swrast_choose_point;
- swrast->choose_line = _swrast_choose_line;
- swrast->choose_triangle = _swrast_choose_triangle;
-
- swrast->InvalidatePointMask = _SWRAST_NEW_POINT;
- swrast->InvalidateLineMask = _SWRAST_NEW_LINE;
- swrast->InvalidateTriangleMask = _SWRAST_NEW_TRIANGLE;
-
- swrast->Point = _swrast_validate_point;
- swrast->Line = _swrast_validate_line;
- swrast->Triangle = _swrast_validate_triangle;
- swrast->InvalidateState = _swrast_sleep;
- swrast->BlendFunc = _swrast_validate_blend_func;
-
- swrast->AllowVertexFog = GL_TRUE;
- swrast->AllowPixelFog = GL_TRUE;
-
- /* Optimized Accum buffer */
- swrast->_IntegerAccumMode = GL_FALSE;
- swrast->_IntegerAccumScaler = 0.0;
-
- for (i = 0; i < MAX_TEXTURE_IMAGE_UNITS; i++)
- swrast->TextureSample[i] = NULL;
-
- swrast->SpanArrays = MALLOC_STRUCT(sw_span_arrays);
- if (!swrast->SpanArrays) {
- FREE(swrast);
- return GL_FALSE;
- }
- swrast->SpanArrays->ChanType = CHAN_TYPE;
-#if CHAN_TYPE == GL_UNSIGNED_BYTE
- swrast->SpanArrays->rgba = swrast->SpanArrays->rgba8;
-#elif CHAN_TYPE == GL_UNSIGNED_SHORT
- swrast->SpanArrays->rgba = swrast->SpanArrays->rgba16;
-#else
- swrast->SpanArrays->rgba = swrast->SpanArrays->attribs[FRAG_ATTRIB_COL0];
-#endif
-
- /* init point span buffer */
- swrast->PointSpan.primitive = GL_POINT;
- swrast->PointSpan.end = 0;
- swrast->PointSpan.facing = 0;
- swrast->PointSpan.array = swrast->SpanArrays;
-
- swrast->TexelBuffer = (GLfloat *) MALLOC(ctx->Const.MaxTextureImageUnits *
- MAX_WIDTH * 4 * sizeof(GLfloat));
- if (!swrast->TexelBuffer) {
- FREE(swrast->SpanArrays);
- FREE(swrast);
- return GL_FALSE;
- }
-
- ctx->swrast_context = swrast;
-
- return GL_TRUE;
-}
-
-void
-_swrast_DestroyContext( struct gl_context *ctx )
-{
- SWcontext *swrast = SWRAST_CONTEXT(ctx);
-
- if (SWRAST_DEBUG) {
- _mesa_debug(ctx, "_swrast_DestroyContext\n");
- }
-
- FREE( swrast->SpanArrays );
- if (swrast->ZoomedArrays)
- FREE( swrast->ZoomedArrays );
- FREE( swrast->TexelBuffer );
- FREE( swrast );
-
- ctx->swrast_context = 0;
-}
-
-
-struct swrast_device_driver *
-_swrast_GetDeviceDriverReference( struct gl_context *ctx )
-{
- SWcontext *swrast = SWRAST_CONTEXT(ctx);
- return &swrast->Driver;
-}
-
-void
-_swrast_flush( struct gl_context *ctx )
-{
- SWcontext *swrast = SWRAST_CONTEXT(ctx);
- /* flush any pending fragments from rendering points */
- if (swrast->PointSpan.end > 0) {
- _swrast_write_rgba_span(ctx, &(swrast->PointSpan));
- swrast->PointSpan.end = 0;
- }
-}
-
-void
-_swrast_render_primitive( struct gl_context *ctx, GLenum prim )
-{
- SWcontext *swrast = SWRAST_CONTEXT(ctx);
- if (swrast->Primitive == GL_POINTS && prim != GL_POINTS) {
- _swrast_flush(ctx);
- }
- swrast->Primitive = prim;
-}
-
-
-void
-_swrast_render_start( struct gl_context *ctx )
-{
- SWcontext *swrast = SWRAST_CONTEXT(ctx);
- if (swrast->Driver.SpanRenderStart)
- swrast->Driver.SpanRenderStart( ctx );
- swrast->PointSpan.end = 0;
-}
-
-void
-_swrast_render_finish( struct gl_context *ctx )
-{
- SWcontext *swrast = SWRAST_CONTEXT(ctx);
- if (swrast->Driver.SpanRenderFinish)
- swrast->Driver.SpanRenderFinish( ctx );
-
- _swrast_flush(ctx);
-}
-
-
-#define SWRAST_DEBUG_VERTICES 0
-
-void
-_swrast_print_vertex( struct gl_context *ctx, const SWvertex *v )
-{
- GLuint i;
-
- if (SWRAST_DEBUG_VERTICES) {
- _mesa_debug(ctx, "win %f %f %f %f\n",
- v->attrib[FRAG_ATTRIB_WPOS][0],
- v->attrib[FRAG_ATTRIB_WPOS][1],
- v->attrib[FRAG_ATTRIB_WPOS][2],
- v->attrib[FRAG_ATTRIB_WPOS][3]);
-
- for (i = 0 ; i < ctx->Const.MaxTextureCoordUnits ; i++)
- if (ctx->Texture.Unit[i]._ReallyEnabled)
- _mesa_debug(ctx, "texcoord[%d] %f %f %f %f\n", i,
- v->attrib[FRAG_ATTRIB_TEX0 + i][0],
- v->attrib[FRAG_ATTRIB_TEX0 + i][1],
- v->attrib[FRAG_ATTRIB_TEX0 + i][2],
- v->attrib[FRAG_ATTRIB_TEX0 + i][3]);
-
-#if CHAN_TYPE == GL_FLOAT
- _mesa_debug(ctx, "color %f %f %f %f\n",
- v->color[0], v->color[1], v->color[2], v->color[3]);
-#else
- _mesa_debug(ctx, "color %d %d %d %d\n",
- v->color[0], v->color[1], v->color[2], v->color[3]);
-#endif
- _mesa_debug(ctx, "spec %g %g %g %g\n",
- v->attrib[FRAG_ATTRIB_COL1][0],
- v->attrib[FRAG_ATTRIB_COL1][1],
- v->attrib[FRAG_ATTRIB_COL1][2],
- v->attrib[FRAG_ATTRIB_COL1][3]);
- _mesa_debug(ctx, "fog %f\n", v->attrib[FRAG_ATTRIB_FOGC][0]);
- _mesa_debug(ctx, "index %f\n", v->attrib[FRAG_ATTRIB_CI][0]);
- _mesa_debug(ctx, "pointsize %f\n", v->pointSize);
- _mesa_debug(ctx, "\n");
- }
-}
+/*
+ * Mesa 3-D graphics library
+ * Version: 7.1
+ *
+ * Copyright (C) 1999-2008 Brian Paul All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * Authors:
+ * Keith Whitwell <keith@tungstengraphics.com>
+ * Brian Paul
+ */
+
+#include "main/imports.h"
+#include "main/bufferobj.h"
+#include "main/colormac.h"
+#include "main/mtypes.h"
+#include "main/teximage.h"
+#include "program/prog_parameter.h"
+#include "program/prog_statevars.h"
+#include "swrast.h"
+#include "s_blend.h"
+#include "s_context.h"
+#include "s_lines.h"
+#include "s_points.h"
+#include "s_span.h"
+#include "s_triangle.h"
+#include "s_texfilter.h"
+
+
+/**
+ * Recompute the value of swrast->_RasterMask, etc. according to
+ * the current context. The _RasterMask field can be easily tested by
+ * drivers to determine certain basic GL state (does the primitive need
+ * stenciling, logic-op, fog, etc?).
+ */
+static void
+_swrast_update_rasterflags( struct gl_context *ctx )
+{
+ SWcontext *swrast = SWRAST_CONTEXT(ctx);
+ GLbitfield rasterMask = 0;
+ GLuint i;
+
+ if (ctx->Color.AlphaEnabled) rasterMask |= ALPHATEST_BIT;
+ if (ctx->Color.BlendEnabled) rasterMask |= BLEND_BIT;
+ if (ctx->Depth.Test) rasterMask |= DEPTH_BIT;
+ if (swrast->_FogEnabled) rasterMask |= FOG_BIT;
+ if (ctx->Scissor.Enabled) rasterMask |= CLIP_BIT;
+ if (ctx->Stencil._Enabled) rasterMask |= STENCIL_BIT;
+ for (i = 0; i < ctx->Const.MaxDrawBuffers; i++) {
+ if (!ctx->Color.ColorMask[i][0] ||
+ !ctx->Color.ColorMask[i][1] ||
+ !ctx->Color.ColorMask[i][2] ||
+ !ctx->Color.ColorMask[i][3]) {
+ rasterMask |= MASKING_BIT;
+ break;
+ }
+ }
+ if (ctx->Color._LogicOpEnabled) rasterMask |= LOGIC_OP_BIT;
+ if (ctx->Texture._EnabledUnits) rasterMask |= TEXTURE_BIT;
+ if ( ctx->Viewport.X < 0
+ || ctx->Viewport.X + ctx->Viewport.Width > (GLint) ctx->DrawBuffer->Width
+ || ctx->Viewport.Y < 0
+ || ctx->Viewport.Y + ctx->Viewport.Height > (GLint) ctx->DrawBuffer->Height) {
+ rasterMask |= CLIP_BIT;
+ }
+
+ if (ctx->Query.CurrentOcclusionObject)
+ rasterMask |= OCCLUSION_BIT;
+
+
+ /* If we're not drawing to exactly one color buffer set the
+ * MULTI_DRAW_BIT flag. Also set it if we're drawing to no
+ * buffers or the RGBA or CI mask disables all writes.
+ */
+ if (ctx->DrawBuffer->_NumColorDrawBuffers != 1) {
+ /* more than one color buffer designated for writing (or zero buffers) */
+ rasterMask |= MULTI_DRAW_BIT;
+ }
+
+ for (i = 0; i < ctx->Const.MaxDrawBuffers; i++) {
+ if (ctx->Color.ColorMask[i][0] +
+ ctx->Color.ColorMask[i][1] +
+ ctx->Color.ColorMask[i][2] +
+ ctx->Color.ColorMask[i][3] == 0) {
+ rasterMask |= MULTI_DRAW_BIT; /* all RGBA channels disabled */
+ break;
+ }
+ }
+
+
+ if (ctx->FragmentProgram._Current) {
+ rasterMask |= FRAGPROG_BIT;
+ }
+
+ if (ctx->ATIFragmentShader._Enabled) {
+ rasterMask |= ATIFRAGSHADER_BIT;
+ }
+
+#if CHAN_TYPE == GL_FLOAT
+ if (ctx->Color.ClampFragmentColor == GL_TRUE) {
+ rasterMask |= CLAMPING_BIT;
+ }
+#endif
+
+ SWRAST_CONTEXT(ctx)->_RasterMask = rasterMask;
+}
+
+
+/**
+ * Examine polygon cull state to compute the _BackfaceCullSign field.
+ * _BackfaceCullSign will be 0 if no culling, -1 if culling back-faces,
+ * and 1 if culling front-faces. The Polygon FrontFace state also
+ * factors in.
+ */
+static void
+_swrast_update_polygon( struct gl_context *ctx )
+{
+ GLfloat backface_sign;
+
+ if (ctx->Polygon.CullFlag) {
+ switch (ctx->Polygon.CullFaceMode) {
+ case GL_BACK:
+ backface_sign = -1.0F;
+ break;
+ case GL_FRONT:
+ backface_sign = 1.0F;
+ break;
+ case GL_FRONT_AND_BACK:
+ /* fallthrough */
+ default:
+ backface_sign = 0.0F;
+ }
+ }
+ else {
+ backface_sign = 0.0F;
+ }
+
+ SWRAST_CONTEXT(ctx)->_BackfaceCullSign = backface_sign;
+
+ /* This is for front/back-face determination, but not for culling */
+ SWRAST_CONTEXT(ctx)->_BackfaceSign
+ = (ctx->Polygon.FrontFace == GL_CW) ? -1.0F : 1.0F;
+}
+
+
+
+/**
+ * Update the _PreferPixelFog field to indicate if we need to compute
+ * fog blend factors (from the fog coords) per-fragment.
+ */
+static void
+_swrast_update_fog_hint( struct gl_context *ctx )
+{
+ SWcontext *swrast = SWRAST_CONTEXT(ctx);
+ swrast->_PreferPixelFog = (!swrast->AllowVertexFog ||
+ ctx->FragmentProgram._Current ||
+ (ctx->Hint.Fog == GL_NICEST &&
+ swrast->AllowPixelFog));
+}
+
+
+
+/**
+ * Update the swrast->_TextureCombinePrimary flag.
+ */
+static void
+_swrast_update_texture_env( struct gl_context *ctx )
+{
+ SWcontext *swrast = SWRAST_CONTEXT(ctx);
+ GLuint i;
+
+ swrast->_TextureCombinePrimary = GL_FALSE;
+
+ for (i = 0; i < ctx->Const.MaxTextureUnits; i++) {
+ const struct gl_tex_env_combine_state *combine =
+ ctx->Texture.Unit[i]._CurrentCombine;
+ GLuint term;
+ for (term = 0; term < combine->_NumArgsRGB; term++) {
+ if (combine->SourceRGB[term] == GL_PRIMARY_COLOR) {
+ swrast->_TextureCombinePrimary = GL_TRUE;
+ return;
+ }
+ if (combine->SourceA[term] == GL_PRIMARY_COLOR) {
+ swrast->_TextureCombinePrimary = GL_TRUE;
+ return;
+ }
+ }
+ }
+}
+
+
+/**
+ * Determine if we can defer texturing/shading until after Z/stencil
+ * testing. This potentially allows us to skip texturing/shading for
+ * lots of fragments.
+ */
+static void
+_swrast_update_deferred_texture(struct gl_context *ctx)
+{
+ SWcontext *swrast = SWRAST_CONTEXT(ctx);
+ if (ctx->Color.AlphaEnabled) {
+ /* alpha test depends on post-texture/shader colors */
+ swrast->_DeferredTexture = GL_FALSE;
+ }
+ else {
+ const struct gl_fragment_program *fprog
+ = ctx->FragmentProgram._Current;
+ if (fprog && (fprog->Base.OutputsWritten & (1 << FRAG_RESULT_DEPTH))) {
+ /* Z comes from fragment program/shader */
+ swrast->_DeferredTexture = GL_FALSE;
+ }
+ else if (fprog && fprog->UsesKill) {
+ swrast->_DeferredTexture = GL_FALSE;
+ }
+ else if (ctx->Query.CurrentOcclusionObject) {
+ /* occlusion query depends on shader discard/kill results */
+ swrast->_DeferredTexture = GL_FALSE;
+ }
+ else {
+ swrast->_DeferredTexture = GL_TRUE;
+ }
+ }
+}
+
+
+/**
+ * Update swrast->_FogColor and swrast->_FogEnable values.
+ */
+static void
+_swrast_update_fog_state( struct gl_context *ctx )
+{
+ SWcontext *swrast = SWRAST_CONTEXT(ctx);
+ const struct gl_fragment_program *fp = ctx->FragmentProgram._Current;
+
+ assert((fp == NULL) || (fp->Base.Target == GL_FRAGMENT_PROGRAM_ARB));
+
+ /* determine if fog is needed, and if so, which fog mode */
+ swrast->_FogEnabled = (fp == NULL && ctx->Fog.Enabled);
+}
+
+
+/**
+ * Update state for running fragment programs. Basically, load the
+ * program parameters with current state values.
+ */
+static void
+_swrast_update_fragment_program(struct gl_context *ctx, GLbitfield newState)
+{
+ const struct gl_fragment_program *fp = ctx->FragmentProgram._Current;
+ if (fp) {
+ _mesa_load_state_parameters(ctx, fp->Base.Parameters);
+ }
+}
+
+
+/**
+ * See if we can do early diffuse+specular (primary+secondary) color
+ * add per vertex instead of per-fragment.
+ */
+static void
+_swrast_update_specular_vertex_add(struct gl_context *ctx)
+{
+ SWcontext *swrast = SWRAST_CONTEXT(ctx);
+ GLboolean separateSpecular = ctx->Fog.ColorSumEnabled ||
+ (ctx->Light.Enabled &&
+ ctx->Light.Model.ColorControl == GL_SEPARATE_SPECULAR_COLOR);
+
+ swrast->SpecularVertexAdd = (separateSpecular
+ && ctx->Texture._EnabledUnits == 0x0
+ && !ctx->FragmentProgram._Current
+ && !ctx->ATIFragmentShader._Enabled);
+}
+
+
+#define _SWRAST_NEW_DERIVED (_SWRAST_NEW_RASTERMASK | \
+ _NEW_PROGRAM_CONSTANTS | \
+ _NEW_TEXTURE | \
+ _NEW_HINT | \
+ _NEW_POLYGON )
+
+/* State referenced by _swrast_choose_triangle, _swrast_choose_line.
+ */
+#define _SWRAST_NEW_TRIANGLE (_SWRAST_NEW_DERIVED | \
+ _NEW_RENDERMODE| \
+ _NEW_POLYGON| \
+ _NEW_DEPTH| \
+ _NEW_STENCIL| \
+ _NEW_COLOR| \
+ _NEW_TEXTURE| \
+ _SWRAST_NEW_RASTERMASK| \
+ _NEW_LIGHT| \
+ _NEW_FOG | \
+ _DD_NEW_SEPARATE_SPECULAR)
+
+#define _SWRAST_NEW_LINE (_SWRAST_NEW_DERIVED | \
+ _NEW_RENDERMODE| \
+ _NEW_LINE| \
+ _NEW_TEXTURE| \
+ _NEW_LIGHT| \
+ _NEW_FOG| \
+ _NEW_DEPTH | \
+ _DD_NEW_SEPARATE_SPECULAR)
+
+#define _SWRAST_NEW_POINT (_SWRAST_NEW_DERIVED | \
+ _NEW_RENDERMODE | \
+ _NEW_POINT | \
+ _NEW_TEXTURE | \
+ _NEW_LIGHT | \
+ _NEW_FOG | \
+ _DD_NEW_SEPARATE_SPECULAR)
+
+#define _SWRAST_NEW_TEXTURE_SAMPLE_FUNC _NEW_TEXTURE
+
+#define _SWRAST_NEW_TEXTURE_ENV_MODE _NEW_TEXTURE
+
+#define _SWRAST_NEW_BLEND_FUNC _NEW_COLOR
+
+
+
+/**
+ * Stub for swrast->Triangle to select a true triangle function
+ * after a state change.
+ */
+static void
+_swrast_validate_triangle( struct gl_context *ctx,
+ const SWvertex *v0,
+ const SWvertex *v1,
+ const SWvertex *v2 )
+{
+ SWcontext *swrast = SWRAST_CONTEXT(ctx);
+
+ _swrast_validate_derived( ctx );
+ swrast->choose_triangle( ctx );
+ ASSERT(swrast->Triangle);
+
+ if (swrast->SpecularVertexAdd) {
+ /* separate specular color, but no texture */
+ swrast->SpecTriangle = swrast->Triangle;
+ swrast->Triangle = _swrast_add_spec_terms_triangle;
+ }
+
+ swrast->Triangle( ctx, v0, v1, v2 );
+}
+
+/**
+ * Called via swrast->Line. Examine current GL state and choose a software
+ * line routine. Then call it.
+ */
+static void
+_swrast_validate_line( struct gl_context *ctx, const SWvertex *v0, const SWvertex *v1 )
+{
+ SWcontext *swrast = SWRAST_CONTEXT(ctx);
+
+ _swrast_validate_derived( ctx );
+ swrast->choose_line( ctx );
+ ASSERT(swrast->Line);
+
+ if (swrast->SpecularVertexAdd) {
+ swrast->SpecLine = swrast->Line;
+ swrast->Line = _swrast_add_spec_terms_line;
+ }
+
+ swrast->Line( ctx, v0, v1 );
+}
+
+/**
+ * Called via swrast->Point. Examine current GL state and choose a software
+ * point routine. Then call it.
+ */
+static void
+_swrast_validate_point( struct gl_context *ctx, const SWvertex *v0 )
+{
+ SWcontext *swrast = SWRAST_CONTEXT(ctx);
+
+ _swrast_validate_derived( ctx );
+ swrast->choose_point( ctx );
+
+ if (swrast->SpecularVertexAdd) {
+ swrast->SpecPoint = swrast->Point;
+ swrast->Point = _swrast_add_spec_terms_point;
+ }
+
+ swrast->Point( ctx, v0 );
+}
+
+
+/**
+ * Called via swrast->BlendFunc. Examine GL state to choose a blending
+ * function, then call it.
+ */
+static void _ASMAPI
+_swrast_validate_blend_func(struct gl_context *ctx, GLuint n, const GLubyte mask[],
+ GLvoid *src, const GLvoid *dst,
+ GLenum chanType )
+{
+ SWcontext *swrast = SWRAST_CONTEXT(ctx);
+
+ _swrast_validate_derived( ctx ); /* why is this needed? */
+ _swrast_choose_blend_func( ctx, chanType );
+
+ swrast->BlendFunc( ctx, n, mask, src, dst, chanType );
+}
+
+
+/**
+ * Make sure we have texture image data for all the textures we may need
+ * for subsequent rendering.
+ */
+static void
+_swrast_validate_texture_images(struct gl_context *ctx)
+{
+ SWcontext *swrast = SWRAST_CONTEXT(ctx);
+ GLuint u;
+
+ if (!swrast->ValidateTextureImage || !ctx->Texture._EnabledUnits) {
+ /* no textures enabled, or no way to validate images! */
+ return;
+ }
+
+ for (u = 0; u < ctx->Const.MaxTextureImageUnits; u++) {
+ if (ctx->Texture.Unit[u]._ReallyEnabled) {
+ struct gl_texture_object *texObj = ctx->Texture.Unit[u]._Current;
+ ASSERT(texObj);
+ if (texObj) {
+ GLuint numFaces = (texObj->Target == GL_TEXTURE_CUBE_MAP) ? 6 : 1;
+ GLuint face;
+ for (face = 0; face < numFaces; face++) {
+ GLint lvl;
+ for (lvl = texObj->BaseLevel; lvl <= texObj->_MaxLevel; lvl++) {
+ struct gl_texture_image *texImg = texObj->Image[face][lvl];
+ if (texImg && !texImg->Data) {
+ swrast->ValidateTextureImage(ctx, texObj, face, lvl);
+ ASSERT(texObj->Image[face][lvl]->Data);
+ }
+ }
+ }
+ }
+ }
+ }
+}
+
+
+/**
+ * Free the texture image data attached to all currently enabled
+ * textures. Meant to be called by device drivers when transitioning
+ * from software to hardware rendering.
+ */
+void
+_swrast_eject_texture_images(struct gl_context *ctx)
+{
+ GLuint u;
+
+ if (!ctx->Texture._EnabledUnits) {
+ /* no textures enabled */
+ return;
+ }
+
+ for (u = 0; u < ctx->Const.MaxTextureImageUnits; u++) {
+ if (ctx->Texture.Unit[u]._ReallyEnabled) {
+ struct gl_texture_object *texObj = ctx->Texture.Unit[u]._Current;
+ ASSERT(texObj);
+ if (texObj) {
+ GLuint numFaces = (texObj->Target == GL_TEXTURE_CUBE_MAP) ? 6 : 1;
+ GLuint face;
+ for (face = 0; face < numFaces; face++) {
+ GLint lvl;
+ for (lvl = texObj->BaseLevel; lvl <= texObj->_MaxLevel; lvl++) {
+ struct gl_texture_image *texImg = texObj->Image[face][lvl];
+ if (texImg && texImg->Data) {
+ _mesa_free_texmemory(texImg->Data);
+ texImg->Data = NULL;
+ }
+ }
+ }
+ }
+ }
+ }
+}
+
+
+
+static void
+_swrast_sleep( struct gl_context *ctx, GLbitfield new_state )
+{
+ (void) ctx; (void) new_state;
+}
+
+
+static void
+_swrast_invalidate_state( struct gl_context *ctx, GLbitfield new_state )
+{
+ SWcontext *swrast = SWRAST_CONTEXT(ctx);
+ GLuint i;
+
+ swrast->NewState |= new_state;
+
+ /* After 10 statechanges without any swrast functions being called,
+ * put the module to sleep.
+ */
+ if (++swrast->StateChanges > 10) {
+ swrast->InvalidateState = _swrast_sleep;
+ swrast->NewState = ~0;
+ new_state = ~0;
+ }
+
+ if (new_state & swrast->InvalidateTriangleMask)
+ swrast->Triangle = _swrast_validate_triangle;
+
+ if (new_state & swrast->InvalidateLineMask)
+ swrast->Line = _swrast_validate_line;
+
+ if (new_state & swrast->InvalidatePointMask)
+ swrast->Point = _swrast_validate_point;
+
+ if (new_state & _SWRAST_NEW_BLEND_FUNC)
+ swrast->BlendFunc = _swrast_validate_blend_func;
+
+ if (new_state & _SWRAST_NEW_TEXTURE_SAMPLE_FUNC)
+ for (i = 0 ; i < ctx->Const.MaxTextureImageUnits ; i++)
+ swrast->TextureSample[i] = NULL;
+}
+
+
+void
+_swrast_update_texture_samplers(struct gl_context *ctx)
+{
+ SWcontext *swrast = SWRAST_CONTEXT(ctx);
+ GLuint u;
+
+ if (!swrast)
+ return; /* pipe hack */
+
+ for (u = 0; u < ctx->Const.MaxTextureImageUnits; u++) {
+ const struct gl_texture_object *tObj = ctx->Texture.Unit[u]._Current;
+ /* Note: If tObj is NULL, the sample function will be a simple
+ * function that just returns opaque black (0,0,0,1).
+ */
+ swrast->TextureSample[u] = _swrast_choose_texture_sample_func(ctx, tObj);
+ }
+}
+
+
+/**
+ * Update swrast->_ActiveAttribs, swrast->_NumActiveAttribs,
+ * swrast->_ActiveAtttribMask.
+ */
+static void
+_swrast_update_active_attribs(struct gl_context *ctx)
+{
+ SWcontext *swrast = SWRAST_CONTEXT(ctx);
+ GLuint attribsMask;
+
+ /*
+ * Compute _ActiveAttribsMask = which fragment attributes are needed.
+ */
+ if (ctx->FragmentProgram._Current) {
+ /* fragment program/shader */
+ attribsMask = ctx->FragmentProgram._Current->Base.InputsRead;
+ attribsMask &= ~FRAG_BIT_WPOS; /* WPOS is always handled specially */
+ }
+ else if (ctx->ATIFragmentShader._Enabled) {
+ attribsMask = ~0; /* XXX fix me */
+ }
+ else {
+ /* fixed function */
+ attribsMask = 0x0;
+
+#if CHAN_TYPE == GL_FLOAT
+ attribsMask |= FRAG_BIT_COL0;
+#endif
+
+ if (ctx->Fog.ColorSumEnabled ||
+ (ctx->Light.Enabled &&
+ ctx->Light.Model.ColorControl == GL_SEPARATE_SPECULAR_COLOR)) {
+ attribsMask |= FRAG_BIT_COL1;
+ }
+
+ if (swrast->_FogEnabled)
+ attribsMask |= FRAG_BIT_FOGC;
+
+ attribsMask |= (ctx->Texture._EnabledUnits << FRAG_ATTRIB_TEX0);
+ }
+
+ swrast->_ActiveAttribMask = attribsMask;
+
+ /* Update _ActiveAttribs[] list */
+ {
+ GLuint i, num = 0;
+ for (i = 0; i < FRAG_ATTRIB_MAX; i++) {
+ if (attribsMask & (1 << i)) {
+ swrast->_ActiveAttribs[num++] = i;
+ /* how should this attribute be interpolated? */
+ if (i == FRAG_ATTRIB_COL0 || i == FRAG_ATTRIB_COL1)
+ swrast->_InterpMode[i] = ctx->Light.ShadeModel;
+ else
+ swrast->_InterpMode[i] = GL_SMOOTH;
+ }
+ }
+ swrast->_NumActiveAttribs = num;
+ }
+}
+
+
+void
+_swrast_validate_derived( struct gl_context *ctx )
+{
+ SWcontext *swrast = SWRAST_CONTEXT(ctx);
+
+ if (swrast->NewState) {
+ if (swrast->NewState & _NEW_POLYGON)
+ _swrast_update_polygon( ctx );
+
+ if (swrast->NewState & (_NEW_HINT | _NEW_PROGRAM))
+ _swrast_update_fog_hint( ctx );
+
+ if (swrast->NewState & _SWRAST_NEW_TEXTURE_ENV_MODE)
+ _swrast_update_texture_env( ctx );
+
+ if (swrast->NewState & (_NEW_FOG | _NEW_PROGRAM))
+ _swrast_update_fog_state( ctx );
+
+ if (swrast->NewState & (_NEW_PROGRAM_CONSTANTS | _NEW_PROGRAM))
+ _swrast_update_fragment_program( ctx, swrast->NewState );
+
+ if (swrast->NewState & (_NEW_TEXTURE | _NEW_PROGRAM)) {
+ _swrast_update_texture_samplers( ctx );
+ _swrast_validate_texture_images(ctx);
+ }
+
+ if (swrast->NewState & (_NEW_COLOR | _NEW_PROGRAM))
+ _swrast_update_deferred_texture(ctx);
+
+ if (swrast->NewState & _SWRAST_NEW_RASTERMASK)
+ _swrast_update_rasterflags( ctx );
+
+ if (swrast->NewState & (_NEW_DEPTH |
+ _NEW_FOG |
+ _NEW_LIGHT |
+ _NEW_PROGRAM |
+ _NEW_TEXTURE))
+ _swrast_update_active_attribs(ctx);
+
+ if (swrast->NewState & (_NEW_FOG |
+ _NEW_PROGRAM |
+ _NEW_LIGHT |
+ _NEW_TEXTURE))
+ _swrast_update_specular_vertex_add(ctx);
+
+ swrast->NewState = 0;
+ swrast->StateChanges = 0;
+ swrast->InvalidateState = _swrast_invalidate_state;
+ }
+}
+
+#define SWRAST_DEBUG 0
+
+/* Public entrypoints: See also s_accum.c, s_bitmap.c, etc.
+ */
+void
+_swrast_Quad( struct gl_context *ctx,
+ const SWvertex *v0, const SWvertex *v1,
+ const SWvertex *v2, const SWvertex *v3 )
+{
+ if (SWRAST_DEBUG) {
+ _mesa_debug(ctx, "_swrast_Quad\n");
+ _swrast_print_vertex( ctx, v0 );
+ _swrast_print_vertex( ctx, v1 );
+ _swrast_print_vertex( ctx, v2 );
+ _swrast_print_vertex( ctx, v3 );
+ }
+ SWRAST_CONTEXT(ctx)->Triangle( ctx, v0, v1, v3 );
+ SWRAST_CONTEXT(ctx)->Triangle( ctx, v1, v2, v3 );
+}
+
+void
+_swrast_Triangle( struct gl_context *ctx, const SWvertex *v0,
+ const SWvertex *v1, const SWvertex *v2 )
+{
+ if (SWRAST_DEBUG) {
+ _mesa_debug(ctx, "_swrast_Triangle\n");
+ _swrast_print_vertex( ctx, v0 );
+ _swrast_print_vertex( ctx, v1 );
+ _swrast_print_vertex( ctx, v2 );
+ }
+ SWRAST_CONTEXT(ctx)->Triangle( ctx, v0, v1, v2 );
+}
+
+void
+_swrast_Line( struct gl_context *ctx, const SWvertex *v0, const SWvertex *v1 )
+{
+ if (SWRAST_DEBUG) {
+ _mesa_debug(ctx, "_swrast_Line\n");
+ _swrast_print_vertex( ctx, v0 );
+ _swrast_print_vertex( ctx, v1 );
+ }
+ SWRAST_CONTEXT(ctx)->Line( ctx, v0, v1 );
+}
+
+void
+_swrast_Point( struct gl_context *ctx, const SWvertex *v0 )
+{
+ if (SWRAST_DEBUG) {
+ _mesa_debug(ctx, "_swrast_Point\n");
+ _swrast_print_vertex( ctx, v0 );
+ }
+ SWRAST_CONTEXT(ctx)->Point( ctx, v0 );
+}
+
+void
+_swrast_InvalidateState( struct gl_context *ctx, GLbitfield new_state )
+{
+ if (SWRAST_DEBUG) {
+ _mesa_debug(ctx, "_swrast_InvalidateState\n");
+ }
+ SWRAST_CONTEXT(ctx)->InvalidateState( ctx, new_state );
+}
+
+void
+_swrast_ResetLineStipple( struct gl_context *ctx )
+{
+ if (SWRAST_DEBUG) {
+ _mesa_debug(ctx, "_swrast_ResetLineStipple\n");
+ }
+ SWRAST_CONTEXT(ctx)->StippleCounter = 0;
+}
+
+void
+_swrast_SetFacing(struct gl_context *ctx, GLuint facing)
+{
+ SWRAST_CONTEXT(ctx)->PointLineFacing = facing;
+}
+
+void
+_swrast_allow_vertex_fog( struct gl_context *ctx, GLboolean value )
+{
+ if (SWRAST_DEBUG) {
+ _mesa_debug(ctx, "_swrast_allow_vertex_fog %d\n", value);
+ }
+ SWRAST_CONTEXT(ctx)->InvalidateState( ctx, _NEW_HINT );
+ SWRAST_CONTEXT(ctx)->AllowVertexFog = value;
+}
+
+void
+_swrast_allow_pixel_fog( struct gl_context *ctx, GLboolean value )
+{
+ if (SWRAST_DEBUG) {
+ _mesa_debug(ctx, "_swrast_allow_pixel_fog %d\n", value);
+ }
+ SWRAST_CONTEXT(ctx)->InvalidateState( ctx, _NEW_HINT );
+ SWRAST_CONTEXT(ctx)->AllowPixelFog = value;
+}
+
+
+GLboolean
+_swrast_CreateContext( struct gl_context *ctx )
+{
+ GLuint i;
+ SWcontext *swrast = (SWcontext *)CALLOC(sizeof(SWcontext));
+
+ if (SWRAST_DEBUG) {
+ _mesa_debug(ctx, "_swrast_CreateContext\n");
+ }
+
+ if (!swrast)
+ return GL_FALSE;
+
+ swrast->NewState = ~0;
+
+ swrast->choose_point = _swrast_choose_point;
+ swrast->choose_line = _swrast_choose_line;
+ swrast->choose_triangle = _swrast_choose_triangle;
+
+ swrast->InvalidatePointMask = _SWRAST_NEW_POINT;
+ swrast->InvalidateLineMask = _SWRAST_NEW_LINE;
+ swrast->InvalidateTriangleMask = _SWRAST_NEW_TRIANGLE;
+
+ swrast->Point = _swrast_validate_point;
+ swrast->Line = _swrast_validate_line;
+ swrast->Triangle = _swrast_validate_triangle;
+ swrast->InvalidateState = _swrast_sleep;
+ swrast->BlendFunc = _swrast_validate_blend_func;
+
+ swrast->AllowVertexFog = GL_TRUE;
+ swrast->AllowPixelFog = GL_TRUE;
+
+ /* Optimized Accum buffer */
+ swrast->_IntegerAccumMode = GL_FALSE;
+ swrast->_IntegerAccumScaler = 0.0;
+
+ for (i = 0; i < MAX_TEXTURE_IMAGE_UNITS; i++)
+ swrast->TextureSample[i] = NULL;
+
+ swrast->SpanArrays = MALLOC_STRUCT(sw_span_arrays);
+ if (!swrast->SpanArrays) {
+ FREE(swrast);
+ return GL_FALSE;
+ }
+ swrast->SpanArrays->ChanType = CHAN_TYPE;
+#if CHAN_TYPE == GL_UNSIGNED_BYTE
+ swrast->SpanArrays->rgba = swrast->SpanArrays->rgba8;
+#elif CHAN_TYPE == GL_UNSIGNED_SHORT
+ swrast->SpanArrays->rgba = swrast->SpanArrays->rgba16;
+#else
+ swrast->SpanArrays->rgba = swrast->SpanArrays->attribs[FRAG_ATTRIB_COL0];
+#endif
+
+ /* init point span buffer */
+ swrast->PointSpan.primitive = GL_POINT;
+ swrast->PointSpan.end = 0;
+ swrast->PointSpan.facing = 0;
+ swrast->PointSpan.array = swrast->SpanArrays;
+
+ swrast->TexelBuffer = (GLfloat *) MALLOC(ctx->Const.MaxTextureImageUnits *
+ MAX_WIDTH * 4 * sizeof(GLfloat));
+ if (!swrast->TexelBuffer) {
+ FREE(swrast->SpanArrays);
+ FREE(swrast);
+ return GL_FALSE;
+ }
+
+ ctx->swrast_context = swrast;
+
+ return GL_TRUE;
+}
+
+void
+_swrast_DestroyContext( struct gl_context *ctx )
+{
+ SWcontext *swrast = SWRAST_CONTEXT(ctx);
+
+ if (SWRAST_DEBUG) {
+ _mesa_debug(ctx, "_swrast_DestroyContext\n");
+ }
+
+ FREE( swrast->SpanArrays );
+ if (swrast->ZoomedArrays)
+ FREE( swrast->ZoomedArrays );
+ FREE( swrast->TexelBuffer );
+ FREE( swrast );
+
+ ctx->swrast_context = 0;
+}
+
+
+struct swrast_device_driver *
+_swrast_GetDeviceDriverReference( struct gl_context *ctx )
+{
+ SWcontext *swrast = SWRAST_CONTEXT(ctx);
+ return &swrast->Driver;
+}
+
+void
+_swrast_flush( struct gl_context *ctx )
+{
+ SWcontext *swrast = SWRAST_CONTEXT(ctx);
+ /* flush any pending fragments from rendering points */
+ if (swrast->PointSpan.end > 0) {
+ _swrast_write_rgba_span(ctx, &(swrast->PointSpan));
+ swrast->PointSpan.end = 0;
+ }
+}
+
+void
+_swrast_render_primitive( struct gl_context *ctx, GLenum prim )
+{
+ SWcontext *swrast = SWRAST_CONTEXT(ctx);
+ if (swrast->Primitive == GL_POINTS && prim != GL_POINTS) {
+ _swrast_flush(ctx);
+ }
+ swrast->Primitive = prim;
+}
+
+
+void
+_swrast_render_start( struct gl_context *ctx )
+{
+ SWcontext *swrast = SWRAST_CONTEXT(ctx);
+ if (swrast->Driver.SpanRenderStart)
+ swrast->Driver.SpanRenderStart( ctx );
+ swrast->PointSpan.end = 0;
+}
+
+void
+_swrast_render_finish( struct gl_context *ctx )
+{
+ SWcontext *swrast = SWRAST_CONTEXT(ctx);
+ if (swrast->Driver.SpanRenderFinish)
+ swrast->Driver.SpanRenderFinish( ctx );
+
+ _swrast_flush(ctx);
+}
+
+
+#define SWRAST_DEBUG_VERTICES 0
+
+void
+_swrast_print_vertex( struct gl_context *ctx, const SWvertex *v )
+{
+ GLuint i;
+
+ if (SWRAST_DEBUG_VERTICES) {
+ _mesa_debug(ctx, "win %f %f %f %f\n",
+ v->attrib[FRAG_ATTRIB_WPOS][0],
+ v->attrib[FRAG_ATTRIB_WPOS][1],
+ v->attrib[FRAG_ATTRIB_WPOS][2],
+ v->attrib[FRAG_ATTRIB_WPOS][3]);
+
+ for (i = 0 ; i < ctx->Const.MaxTextureCoordUnits ; i++)
+ if (ctx->Texture.Unit[i]._ReallyEnabled)
+ _mesa_debug(ctx, "texcoord[%d] %f %f %f %f\n", i,
+ v->attrib[FRAG_ATTRIB_TEX0 + i][0],
+ v->attrib[FRAG_ATTRIB_TEX0 + i][1],
+ v->attrib[FRAG_ATTRIB_TEX0 + i][2],
+ v->attrib[FRAG_ATTRIB_TEX0 + i][3]);
+
+#if CHAN_TYPE == GL_FLOAT
+ _mesa_debug(ctx, "color %f %f %f %f\n",
+ v->color[0], v->color[1], v->color[2], v->color[3]);
+#else
+ _mesa_debug(ctx, "color %d %d %d %d\n",
+ v->color[0], v->color[1], v->color[2], v->color[3]);
+#endif
+ _mesa_debug(ctx, "spec %g %g %g %g\n",
+ v->attrib[FRAG_ATTRIB_COL1][0],
+ v->attrib[FRAG_ATTRIB_COL1][1],
+ v->attrib[FRAG_ATTRIB_COL1][2],
+ v->attrib[FRAG_ATTRIB_COL1][3]);
+ _mesa_debug(ctx, "fog %f\n", v->attrib[FRAG_ATTRIB_FOGC][0]);
+ _mesa_debug(ctx, "index %f\n", v->attrib[FRAG_ATTRIB_CI][0]);
+ _mesa_debug(ctx, "pointsize %f\n", v->pointSize);
+ _mesa_debug(ctx, "\n");
+ }
+}
diff --git a/mesalib/src/mesa/swrast/s_context.h b/mesalib/src/mesa/swrast/s_context.h
index 8d7458c2d..1673cece1 100644
--- a/mesalib/src/mesa/swrast/s_context.h
+++ b/mesalib/src/mesa/swrast/s_context.h
@@ -1,348 +1,348 @@
-/*
- * Mesa 3-D graphics library
- * Version: 6.5.3
- *
- * Copyright (C) 1999-2007 Brian Paul All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-
-/**
- * \file swrast/s_context.h
- * \brief Software rasterization context and private types.
- * \author Keith Whitwell <keith@tungstengraphics.com>
- */
-
-/**
- * \mainpage swrast module
- *
- * This module, software rasterization, contains the software fallback
- * routines for drawing points, lines, triangles, bitmaps and images.
- * All rendering boils down to writing spans (arrays) of pixels with
- * particular colors. The span-writing routines must be implemented
- * by the device driver.
- */
-
-
-#ifndef S_CONTEXT_H
-#define S_CONTEXT_H
-
-#include "main/compiler.h"
-#include "main/mtypes.h"
-#include "program/prog_execute.h"
-#include "swrast.h"
-#include "s_span.h"
-
-
-typedef void (*texture_sample_func)(struct gl_context *ctx,
- const struct gl_texture_object *tObj,
- GLuint n, const GLfloat texcoords[][4],
- const GLfloat lambda[], GLfloat rgba[][4]);
-
-typedef void (_ASMAPIP blend_func)( struct gl_context *ctx, GLuint n,
- const GLubyte mask[],
- GLvoid *src, const GLvoid *dst,
- GLenum chanType);
-
-typedef void (*swrast_point_func)( struct gl_context *ctx, const SWvertex *);
-
-typedef void (*swrast_line_func)( struct gl_context *ctx,
- const SWvertex *, const SWvertex *);
-
-typedef void (*swrast_tri_func)( struct gl_context *ctx, const SWvertex *,
- const SWvertex *, const SWvertex *);
-
-
-typedef void (*validate_texture_image_func)(struct gl_context *ctx,
- struct gl_texture_object *texObj,
- GLuint face, GLuint level);
-
-
-/**
- * \defgroup Bitmasks
- * Bitmasks to indicate which rasterization options are enabled
- * (RasterMask)
- */
-/*@{*/
-#define ALPHATEST_BIT 0x001 /**< Alpha-test pixels */
-#define BLEND_BIT 0x002 /**< Blend pixels */
-#define DEPTH_BIT 0x004 /**< Depth-test pixels */
-#define FOG_BIT 0x008 /**< Fog pixels */
-#define LOGIC_OP_BIT 0x010 /**< Apply logic op in software */
-#define CLIP_BIT 0x020 /**< Scissor or window clip pixels */
-#define STENCIL_BIT 0x040 /**< Stencil pixels */
-#define MASKING_BIT 0x080 /**< Do glColorMask or glIndexMask */
-#define MULTI_DRAW_BIT 0x400 /**< Write to more than one color- */
- /**< buffer or no buffers. */
-#define OCCLUSION_BIT 0x800 /**< GL_HP_occlusion_test enabled */
-#define TEXTURE_BIT 0x1000 /**< Texturing really enabled */
-#define FRAGPROG_BIT 0x2000 /**< Fragment program enabled */
-#define ATIFRAGSHADER_BIT 0x4000 /**< ATI Fragment shader enabled */
-#define CLAMPING_BIT 0x8000 /**< Clamp colors to [0,1] */
-/*@}*/
-
-#define _SWRAST_NEW_RASTERMASK (_NEW_BUFFERS| \
- _NEW_SCISSOR| \
- _NEW_COLOR| \
- _NEW_DEPTH| \
- _NEW_FOG| \
- _NEW_PROGRAM| \
- _NEW_STENCIL| \
- _NEW_TEXTURE| \
- _NEW_VIEWPORT| \
- _NEW_DEPTH)
-
-
-/**
- * \struct SWcontext
- * \brief Per-context state that's private to the software rasterizer module.
- */
-typedef struct
-{
- /** Driver interface:
- */
- struct swrast_device_driver Driver;
-
- /** Configuration mechanisms to make software rasterizer match
- * characteristics of the hardware rasterizer (if present):
- */
- GLboolean AllowVertexFog;
- GLboolean AllowPixelFog;
-
- /** Derived values, invalidated on statechanges, updated from
- * _swrast_validate_derived():
- */
- GLbitfield _RasterMask;
- GLfloat _BackfaceSign; /** +1 or -1 */
- GLfloat _BackfaceCullSign; /** +1, 0, or -1 */
- GLboolean _PreferPixelFog; /* Compute fog blend factor per fragment? */
- GLboolean _TextureCombinePrimary;
- GLboolean _FogEnabled;
- GLboolean _DeferredTexture;
-
- /** List/array of the fragment attributes to interpolate */
- GLuint _ActiveAttribs[FRAG_ATTRIB_MAX];
- /** Same info, but as a bitmask */
- GLbitfield _ActiveAttribMask;
- /** Number of fragment attributes to interpolate */
- GLuint _NumActiveAttribs;
- /** Indicates how each attrib is to be interpolated (lines/tris) */
- GLenum _InterpMode[FRAG_ATTRIB_MAX]; /* GL_FLAT or GL_SMOOTH (for now) */
-
- /* Accum buffer temporaries.
- */
- GLboolean _IntegerAccumMode; /**< Storing unscaled integers? */
- GLfloat _IntegerAccumScaler; /**< Implicit scale factor */
-
- /* Working values:
- */
- GLuint StippleCounter; /**< Line stipple counter */
- GLuint PointLineFacing;
- GLbitfield NewState;
- GLuint StateChanges;
- GLenum Primitive; /* current primitive being drawn (ala glBegin) */
- GLboolean SpecularVertexAdd; /**< Add specular/secondary color per vertex */
-
- void (*InvalidateState)( struct gl_context *ctx, GLbitfield new_state );
-
- /**
- * When the NewState mask intersects these masks, we invalidate the
- * Point/Line/Triangle function pointers below.
- */
- /*@{*/
- GLbitfield InvalidatePointMask;
- GLbitfield InvalidateLineMask;
- GLbitfield InvalidateTriangleMask;
- /*@}*/
-
- /**
- * Device drivers plug in functions for these callbacks.
- * Will be called when the GL state change mask intersects the above masks.
- */
- /*@{*/
- void (*choose_point)( struct gl_context * );
- void (*choose_line)( struct gl_context * );
- void (*choose_triangle)( struct gl_context * );
- /*@}*/
-
- /**
- * Current point, line and triangle drawing functions.
- */
- /*@{*/
- swrast_point_func Point;
- swrast_line_func Line;
- swrast_tri_func Triangle;
- /*@}*/
-
- /**
- * Placeholders for when separate specular (or secondary color) is
- * enabled but texturing is not.
- */
- /*@{*/
- swrast_point_func SpecPoint;
- swrast_line_func SpecLine;
- swrast_tri_func SpecTriangle;
- /*@}*/
-
- /**
- * Typically, we'll allocate a sw_span structure as a local variable
- * and set its 'array' pointer to point to this object. The reason is
- * this object is big and causes problems when allocated on the stack
- * on some systems.
- */
- SWspanarrays *SpanArrays;
- SWspanarrays *ZoomedArrays; /**< For pixel zooming */
-
- /**
- * Used to buffer N GL_POINTS, instead of rendering one by one.
- */
- SWspan PointSpan;
-
- /** Internal hooks, kept up to date by the same mechanism as above.
- */
- blend_func BlendFunc;
- texture_sample_func TextureSample[MAX_TEXTURE_IMAGE_UNITS];
-
- /** Buffer for saving the sampled texture colors.
- * Needed for GL_ARB_texture_env_crossbar implementation.
- */
- GLfloat *TexelBuffer;
-
- validate_texture_image_func ValidateTextureImage;
-
- /** State used during execution of fragment programs */
- struct gl_program_machine FragProgMachine;
-
-} SWcontext;
-
-
-extern void
-_swrast_validate_derived( struct gl_context *ctx );
-
-extern void
-_swrast_update_texture_samplers(struct gl_context *ctx);
-
-
-/** Return SWcontext for the given struct gl_context */
-static INLINE SWcontext *
-SWRAST_CONTEXT(struct gl_context *ctx)
-{
- return (SWcontext *) ctx->swrast_context;
-}
-
-/** const version of above */
-static INLINE const SWcontext *
-CONST_SWRAST_CONTEXT(const struct gl_context *ctx)
-{
- return (const SWcontext *) ctx->swrast_context;
-}
-
-
-/**
- * Called prior to framebuffer reading/writing.
- * For drivers that rely on swrast for fallback rendering, this is the
- * driver's opportunity to map renderbuffers and textures.
- */
-static INLINE void
-swrast_render_start(struct gl_context *ctx)
-{
- SWcontext *swrast = SWRAST_CONTEXT(ctx);
- if (swrast->Driver.SpanRenderStart)
- swrast->Driver.SpanRenderStart(ctx);
-}
-
-
-/** Called after framebuffer reading/writing */
-static INLINE void
-swrast_render_finish(struct gl_context *ctx)
-{
- SWcontext *swrast = SWRAST_CONTEXT(ctx);
- if (swrast->Driver.SpanRenderFinish)
- swrast->Driver.SpanRenderFinish(ctx);
-}
-
-
-
-/**
- * Size of an RGBA pixel, in bytes, for given datatype.
- */
-#define RGBA_PIXEL_SIZE(TYPE) \
- ((TYPE == GL_UNSIGNED_BYTE) ? 4 * sizeof(GLubyte) : \
- ((TYPE == GL_UNSIGNED_SHORT) ? 4 * sizeof(GLushort) \
- : 4 * sizeof(GLfloat)))
-
-
-
-/*
- * Fixed point arithmetic macros
- */
-#ifndef FIXED_FRAC_BITS
-#define FIXED_FRAC_BITS 11
-#endif
-
-#define FIXED_SHIFT FIXED_FRAC_BITS
-#define FIXED_ONE (1 << FIXED_SHIFT)
-#define FIXED_HALF (1 << (FIXED_SHIFT-1))
-#define FIXED_FRAC_MASK (FIXED_ONE - 1)
-#define FIXED_INT_MASK (~FIXED_FRAC_MASK)
-#define FIXED_EPSILON 1
-#define FIXED_SCALE ((float) FIXED_ONE)
-#define FIXED_DBL_SCALE ((double) FIXED_ONE)
-#define FloatToFixed(X) (IROUND((X) * FIXED_SCALE))
-#define FixedToDouble(X) ((X) * (1.0 / FIXED_DBL_SCALE))
-#define IntToFixed(I) ((I) << FIXED_SHIFT)
-#define FixedToInt(X) ((X) >> FIXED_SHIFT)
-#define FixedToUns(X) (((unsigned int)(X)) >> FIXED_SHIFT)
-#define FixedCeil(X) (((X) + FIXED_ONE - FIXED_EPSILON) & FIXED_INT_MASK)
-#define FixedFloor(X) ((X) & FIXED_INT_MASK)
-#define FixedToFloat(X) ((X) * (1.0F / FIXED_SCALE))
-#define PosFloatToFixed(X) FloatToFixed(X)
-#define SignedFloatToFixed(X) FloatToFixed(X)
-
-
-
-/*
- * XXX these macros are just bandages for now in order to make
- * CHAN_BITS==32 compile cleanly.
- * These should probably go elsewhere at some point.
- */
-#if CHAN_TYPE == GL_FLOAT
-#define ChanToFixed(X) (X)
-#define FixedToChan(X) (X)
-#else
-#define ChanToFixed(X) IntToFixed(X)
-#define FixedToChan(X) FixedToInt(X)
-#endif
-
-
-/**
- * For looping over fragment attributes in the pointe, line
- * triangle rasterizers.
- */
-#define ATTRIB_LOOP_BEGIN \
- { \
- GLuint a; \
- for (a = 0; a < swrast->_NumActiveAttribs; a++) { \
- const GLuint attr = swrast->_ActiveAttribs[a];
-
-#define ATTRIB_LOOP_END } }
-
-
-
-#endif
+/*
+ * Mesa 3-D graphics library
+ * Version: 6.5.3
+ *
+ * Copyright (C) 1999-2007 Brian Paul All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+
+/**
+ * \file swrast/s_context.h
+ * \brief Software rasterization context and private types.
+ * \author Keith Whitwell <keith@tungstengraphics.com>
+ */
+
+/**
+ * \mainpage swrast module
+ *
+ * This module, software rasterization, contains the software fallback
+ * routines for drawing points, lines, triangles, bitmaps and images.
+ * All rendering boils down to writing spans (arrays) of pixels with
+ * particular colors. The span-writing routines must be implemented
+ * by the device driver.
+ */
+
+
+#ifndef S_CONTEXT_H
+#define S_CONTEXT_H
+
+#include "main/compiler.h"
+#include "main/mtypes.h"
+#include "program/prog_execute.h"
+#include "swrast.h"
+#include "s_span.h"
+
+
+typedef void (*texture_sample_func)(struct gl_context *ctx,
+ const struct gl_texture_object *tObj,
+ GLuint n, const GLfloat texcoords[][4],
+ const GLfloat lambda[], GLfloat rgba[][4]);
+
+typedef void (_ASMAPIP blend_func)( struct gl_context *ctx, GLuint n,
+ const GLubyte mask[],
+ GLvoid *src, const GLvoid *dst,
+ GLenum chanType);
+
+typedef void (*swrast_point_func)( struct gl_context *ctx, const SWvertex *);
+
+typedef void (*swrast_line_func)( struct gl_context *ctx,
+ const SWvertex *, const SWvertex *);
+
+typedef void (*swrast_tri_func)( struct gl_context *ctx, const SWvertex *,
+ const SWvertex *, const SWvertex *);
+
+
+typedef void (*validate_texture_image_func)(struct gl_context *ctx,
+ struct gl_texture_object *texObj,
+ GLuint face, GLuint level);
+
+
+/**
+ * \defgroup Bitmasks
+ * Bitmasks to indicate which rasterization options are enabled
+ * (RasterMask)
+ */
+/*@{*/
+#define ALPHATEST_BIT 0x001 /**< Alpha-test pixels */
+#define BLEND_BIT 0x002 /**< Blend pixels */
+#define DEPTH_BIT 0x004 /**< Depth-test pixels */
+#define FOG_BIT 0x008 /**< Fog pixels */
+#define LOGIC_OP_BIT 0x010 /**< Apply logic op in software */
+#define CLIP_BIT 0x020 /**< Scissor or window clip pixels */
+#define STENCIL_BIT 0x040 /**< Stencil pixels */
+#define MASKING_BIT 0x080 /**< Do glColorMask or glIndexMask */
+#define MULTI_DRAW_BIT 0x400 /**< Write to more than one color- */
+ /**< buffer or no buffers. */
+#define OCCLUSION_BIT 0x800 /**< GL_HP_occlusion_test enabled */
+#define TEXTURE_BIT 0x1000 /**< Texturing really enabled */
+#define FRAGPROG_BIT 0x2000 /**< Fragment program enabled */
+#define ATIFRAGSHADER_BIT 0x4000 /**< ATI Fragment shader enabled */
+#define CLAMPING_BIT 0x8000 /**< Clamp colors to [0,1] */
+/*@}*/
+
+#define _SWRAST_NEW_RASTERMASK (_NEW_BUFFERS| \
+ _NEW_SCISSOR| \
+ _NEW_COLOR| \
+ _NEW_DEPTH| \
+ _NEW_FOG| \
+ _NEW_PROGRAM| \
+ _NEW_STENCIL| \
+ _NEW_TEXTURE| \
+ _NEW_VIEWPORT| \
+ _NEW_DEPTH)
+
+
+/**
+ * \struct SWcontext
+ * \brief Per-context state that's private to the software rasterizer module.
+ */
+typedef struct
+{
+ /** Driver interface:
+ */
+ struct swrast_device_driver Driver;
+
+ /** Configuration mechanisms to make software rasterizer match
+ * characteristics of the hardware rasterizer (if present):
+ */
+ GLboolean AllowVertexFog;
+ GLboolean AllowPixelFog;
+
+ /** Derived values, invalidated on statechanges, updated from
+ * _swrast_validate_derived():
+ */
+ GLbitfield _RasterMask;
+ GLfloat _BackfaceSign; /** +1 or -1 */
+ GLfloat _BackfaceCullSign; /** +1, 0, or -1 */
+ GLboolean _PreferPixelFog; /* Compute fog blend factor per fragment? */
+ GLboolean _TextureCombinePrimary;
+ GLboolean _FogEnabled;
+ GLboolean _DeferredTexture;
+
+ /** List/array of the fragment attributes to interpolate */
+ GLuint _ActiveAttribs[FRAG_ATTRIB_MAX];
+ /** Same info, but as a bitmask */
+ GLbitfield _ActiveAttribMask;
+ /** Number of fragment attributes to interpolate */
+ GLuint _NumActiveAttribs;
+ /** Indicates how each attrib is to be interpolated (lines/tris) */
+ GLenum _InterpMode[FRAG_ATTRIB_MAX]; /* GL_FLAT or GL_SMOOTH (for now) */
+
+ /* Accum buffer temporaries.
+ */
+ GLboolean _IntegerAccumMode; /**< Storing unscaled integers? */
+ GLfloat _IntegerAccumScaler; /**< Implicit scale factor */
+
+ /* Working values:
+ */
+ GLuint StippleCounter; /**< Line stipple counter */
+ GLuint PointLineFacing;
+ GLbitfield NewState;
+ GLuint StateChanges;
+ GLenum Primitive; /* current primitive being drawn (ala glBegin) */
+ GLboolean SpecularVertexAdd; /**< Add specular/secondary color per vertex */
+
+ void (*InvalidateState)( struct gl_context *ctx, GLbitfield new_state );
+
+ /**
+ * When the NewState mask intersects these masks, we invalidate the
+ * Point/Line/Triangle function pointers below.
+ */
+ /*@{*/
+ GLbitfield InvalidatePointMask;
+ GLbitfield InvalidateLineMask;
+ GLbitfield InvalidateTriangleMask;
+ /*@}*/
+
+ /**
+ * Device drivers plug in functions for these callbacks.
+ * Will be called when the GL state change mask intersects the above masks.
+ */
+ /*@{*/
+ void (*choose_point)( struct gl_context * );
+ void (*choose_line)( struct gl_context * );
+ void (*choose_triangle)( struct gl_context * );
+ /*@}*/
+
+ /**
+ * Current point, line and triangle drawing functions.
+ */
+ /*@{*/
+ swrast_point_func Point;
+ swrast_line_func Line;
+ swrast_tri_func Triangle;
+ /*@}*/
+
+ /**
+ * Placeholders for when separate specular (or secondary color) is
+ * enabled but texturing is not.
+ */
+ /*@{*/
+ swrast_point_func SpecPoint;
+ swrast_line_func SpecLine;
+ swrast_tri_func SpecTriangle;
+ /*@}*/
+
+ /**
+ * Typically, we'll allocate a sw_span structure as a local variable
+ * and set its 'array' pointer to point to this object. The reason is
+ * this object is big and causes problems when allocated on the stack
+ * on some systems.
+ */
+ SWspanarrays *SpanArrays;
+ SWspanarrays *ZoomedArrays; /**< For pixel zooming */
+
+ /**
+ * Used to buffer N GL_POINTS, instead of rendering one by one.
+ */
+ SWspan PointSpan;
+
+ /** Internal hooks, kept up to date by the same mechanism as above.
+ */
+ blend_func BlendFunc;
+ texture_sample_func TextureSample[MAX_TEXTURE_IMAGE_UNITS];
+
+ /** Buffer for saving the sampled texture colors.
+ * Needed for GL_ARB_texture_env_crossbar implementation.
+ */
+ GLfloat *TexelBuffer;
+
+ validate_texture_image_func ValidateTextureImage;
+
+ /** State used during execution of fragment programs */
+ struct gl_program_machine FragProgMachine;
+
+} SWcontext;
+
+
+extern void
+_swrast_validate_derived( struct gl_context *ctx );
+
+extern void
+_swrast_update_texture_samplers(struct gl_context *ctx);
+
+
+/** Return SWcontext for the given struct gl_context */
+static INLINE SWcontext *
+SWRAST_CONTEXT(struct gl_context *ctx)
+{
+ return (SWcontext *) ctx->swrast_context;
+}
+
+/** const version of above */
+static INLINE const SWcontext *
+CONST_SWRAST_CONTEXT(const struct gl_context *ctx)
+{
+ return (const SWcontext *) ctx->swrast_context;
+}
+
+
+/**
+ * Called prior to framebuffer reading/writing.
+ * For drivers that rely on swrast for fallback rendering, this is the
+ * driver's opportunity to map renderbuffers and textures.
+ */
+static INLINE void
+swrast_render_start(struct gl_context *ctx)
+{
+ SWcontext *swrast = SWRAST_CONTEXT(ctx);
+ if (swrast->Driver.SpanRenderStart)
+ swrast->Driver.SpanRenderStart(ctx);
+}
+
+
+/** Called after framebuffer reading/writing */
+static INLINE void
+swrast_render_finish(struct gl_context *ctx)
+{
+ SWcontext *swrast = SWRAST_CONTEXT(ctx);
+ if (swrast->Driver.SpanRenderFinish)
+ swrast->Driver.SpanRenderFinish(ctx);
+}
+
+
+
+/**
+ * Size of an RGBA pixel, in bytes, for given datatype.
+ */
+#define RGBA_PIXEL_SIZE(TYPE) \
+ ((TYPE == GL_UNSIGNED_BYTE) ? 4 * sizeof(GLubyte) : \
+ ((TYPE == GL_UNSIGNED_SHORT) ? 4 * sizeof(GLushort) \
+ : 4 * sizeof(GLfloat)))
+
+
+
+/*
+ * Fixed point arithmetic macros
+ */
+#ifndef FIXED_FRAC_BITS
+#define FIXED_FRAC_BITS 11
+#endif
+
+#define FIXED_SHIFT FIXED_FRAC_BITS
+#define FIXED_ONE (1 << FIXED_SHIFT)
+#define FIXED_HALF (1 << (FIXED_SHIFT-1))
+#define FIXED_FRAC_MASK (FIXED_ONE - 1)
+#define FIXED_INT_MASK (~FIXED_FRAC_MASK)
+#define FIXED_EPSILON 1
+#define FIXED_SCALE ((float) FIXED_ONE)
+#define FIXED_DBL_SCALE ((double) FIXED_ONE)
+#define FloatToFixed(X) (IROUND((X) * FIXED_SCALE))
+#define FixedToDouble(X) ((X) * (1.0 / FIXED_DBL_SCALE))
+#define IntToFixed(I) ((I) << FIXED_SHIFT)
+#define FixedToInt(X) ((X) >> FIXED_SHIFT)
+#define FixedToUns(X) (((unsigned int)(X)) >> FIXED_SHIFT)
+#define FixedCeil(X) (((X) + FIXED_ONE - FIXED_EPSILON) & FIXED_INT_MASK)
+#define FixedFloor(X) ((X) & FIXED_INT_MASK)
+#define FixedToFloat(X) ((X) * (1.0F / FIXED_SCALE))
+#define PosFloatToFixed(X) FloatToFixed(X)
+#define SignedFloatToFixed(X) FloatToFixed(X)
+
+
+
+/*
+ * XXX these macros are just bandages for now in order to make
+ * CHAN_BITS==32 compile cleanly.
+ * These should probably go elsewhere at some point.
+ */
+#if CHAN_TYPE == GL_FLOAT
+#define ChanToFixed(X) (X)
+#define FixedToChan(X) (X)
+#else
+#define ChanToFixed(X) IntToFixed(X)
+#define FixedToChan(X) FixedToInt(X)
+#endif
+
+
+/**
+ * For looping over fragment attributes in the pointe, line
+ * triangle rasterizers.
+ */
+#define ATTRIB_LOOP_BEGIN \
+ { \
+ GLuint a; \
+ for (a = 0; a < swrast->_NumActiveAttribs; a++) { \
+ const GLuint attr = swrast->_ActiveAttribs[a];
+
+#define ATTRIB_LOOP_END } }
+
+
+
+#endif
diff --git a/mesalib/src/mesa/swrast/s_drawpix.c b/mesalib/src/mesa/swrast/s_drawpix.c
index 11c63457f..71f998324 100644
--- a/mesalib/src/mesa/swrast/s_drawpix.c
+++ b/mesalib/src/mesa/swrast/s_drawpix.c
@@ -1,753 +1,753 @@
-/*
- * Mesa 3-D graphics library
- * Version: 7.1
- *
- * Copyright (C) 1999-2007 Brian Paul All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-
-#include "main/glheader.h"
-#include "main/bufferobj.h"
-#include "main/condrender.h"
-#include "main/context.h"
-#include "main/image.h"
-#include "main/imports.h"
-#include "main/macros.h"
-#include "main/pack.h"
-#include "main/pbo.h"
-#include "main/pixeltransfer.h"
-#include "main/state.h"
-
-#include "s_context.h"
-#include "s_span.h"
-#include "s_stencil.h"
-#include "s_zoom.h"
-
-
-
-/**
- * Try to do a fast and simple RGB(a) glDrawPixels.
- * Return: GL_TRUE if success, GL_FALSE if slow path must be used instead
- */
-static GLboolean
-fast_draw_rgba_pixels(struct gl_context *ctx, GLint x, GLint y,
- GLsizei width, GLsizei height,
- GLenum format, GLenum type,
- const struct gl_pixelstore_attrib *userUnpack,
- const GLvoid *pixels)
-{
- const GLint imgX = x, imgY = y;
- struct gl_renderbuffer *rb = ctx->DrawBuffer->_ColorDrawBuffers[0];
- GLenum rbType;
- SWcontext *swrast = SWRAST_CONTEXT(ctx);
- SWspan span;
- GLboolean simpleZoom;
- GLint yStep; /* +1 or -1 */
- struct gl_pixelstore_attrib unpack;
- GLint destX, destY, drawWidth, drawHeight; /* post clipping */
-
- if (!rb)
- return GL_TRUE; /* no-op */
-
- rbType = rb->DataType;
-
- if ((swrast->_RasterMask & ~CLIP_BIT) ||
- ctx->Texture._EnabledCoordUnits ||
- userUnpack->SwapBytes ||
- ctx->_ImageTransferState) {
- /* can't handle any of those conditions */
- return GL_FALSE;
- }
-
- INIT_SPAN(span, GL_BITMAP);
- span.arrayMask = SPAN_RGBA;
- span.arrayAttribs = FRAG_BIT_COL0;
- _swrast_span_default_attribs(ctx, &span);
-
- /* copy input params since clipping may change them */
- unpack = *userUnpack;
- destX = x;
- destY = y;
- drawWidth = width;
- drawHeight = height;
-
- /* check for simple zooming and clipping */
- if (ctx->Pixel.ZoomX == 1.0F &&
- (ctx->Pixel.ZoomY == 1.0F || ctx->Pixel.ZoomY == -1.0F)) {
- if (!_mesa_clip_drawpixels(ctx, &destX, &destY,
- &drawWidth, &drawHeight, &unpack)) {
- /* image was completely clipped: no-op, all done */
- return GL_TRUE;
- }
- simpleZoom = GL_TRUE;
- yStep = (GLint) ctx->Pixel.ZoomY;
- ASSERT(yStep == 1 || yStep == -1);
- }
- else {
- /* non-simple zooming */
- simpleZoom = GL_FALSE;
- yStep = 1;
- if (unpack.RowLength == 0)
- unpack.RowLength = width;
- }
-
- /*
- * Ready to draw!
- */
-
- if (format == GL_RGBA && type == rbType) {
- const GLubyte *src
- = (const GLubyte *) _mesa_image_address2d(&unpack, pixels, width,
- height, format, type, 0, 0);
- const GLint srcStride = _mesa_image_row_stride(&unpack, width,
- format, type);
- if (simpleZoom) {
- GLint row;
- for (row = 0; row < drawHeight; row++) {
- rb->PutRow(ctx, rb, drawWidth, destX, destY, src, NULL);
- src += srcStride;
- destY += yStep;
- }
- }
- else {
- /* with zooming */
- GLint row;
- for (row = 0; row < drawHeight; row++) {
- span.x = destX;
- span.y = destY + row;
- span.end = drawWidth;
- span.array->ChanType = rbType;
- _swrast_write_zoomed_rgba_span(ctx, imgX, imgY, &span, src);
- src += srcStride;
- }
- span.array->ChanType = CHAN_TYPE;
- }
- return GL_TRUE;
- }
-
- if (format == GL_RGB && type == rbType) {
- const GLubyte *src
- = (const GLubyte *) _mesa_image_address2d(&unpack, pixels, width,
- height, format, type, 0, 0);
- const GLint srcStride = _mesa_image_row_stride(&unpack, width,
- format, type);
- if (simpleZoom) {
- GLint row;
- for (row = 0; row < drawHeight; row++) {
- rb->PutRowRGB(ctx, rb, drawWidth, destX, destY, src, NULL);
- src += srcStride;
- destY += yStep;
- }
- }
- else {
- /* with zooming */
- GLint row;
- for (row = 0; row < drawHeight; row++) {
- span.x = destX;
- span.y = destY;
- span.end = drawWidth;
- span.array->ChanType = rbType;
- _swrast_write_zoomed_rgb_span(ctx, imgX, imgY, &span, src);
- src += srcStride;
- destY++;
- }
- span.array->ChanType = CHAN_TYPE;
- }
- return GL_TRUE;
- }
-
- /* Remaining cases haven't been tested with alignment != 1 */
- if (userUnpack->Alignment != 1)
- return GL_FALSE;
-
- if (format == GL_LUMINANCE && type == CHAN_TYPE && rbType == CHAN_TYPE) {
- const GLchan *src = (const GLchan *) pixels
- + (unpack.SkipRows * unpack.RowLength + unpack.SkipPixels);
- if (simpleZoom) {
- /* no zooming */
- GLint row;
- ASSERT(drawWidth <= MAX_WIDTH);
- for (row = 0; row < drawHeight; row++) {
- GLchan rgb[MAX_WIDTH][3];
- GLint i;
- for (i = 0;i<drawWidth;i++) {
- rgb[i][0] = src[i];
- rgb[i][1] = src[i];
- rgb[i][2] = src[i];
- }
- rb->PutRowRGB(ctx, rb, drawWidth, destX, destY, rgb, NULL);
- src += unpack.RowLength;
- destY += yStep;
- }
- }
- else {
- /* with zooming */
- GLint row;
- ASSERT(drawWidth <= MAX_WIDTH);
- for (row = 0; row < drawHeight; row++) {
- GLchan rgb[MAX_WIDTH][3];
- GLint i;
- for (i = 0;i<drawWidth;i++) {
- rgb[i][0] = src[i];
- rgb[i][1] = src[i];
- rgb[i][2] = src[i];
- }
- span.x = destX;
- span.y = destY;
- span.end = drawWidth;
- _swrast_write_zoomed_rgb_span(ctx, imgX, imgY, &span, rgb);
- src += unpack.RowLength;
- destY++;
- }
- }
- return GL_TRUE;
- }
-
- if (format == GL_LUMINANCE_ALPHA && type == CHAN_TYPE && rbType == CHAN_TYPE) {
- const GLchan *src = (const GLchan *) pixels
- + (unpack.SkipRows * unpack.RowLength + unpack.SkipPixels)*2;
- if (simpleZoom) {
- GLint row;
- ASSERT(drawWidth <= MAX_WIDTH);
- for (row = 0; row < drawHeight; row++) {
- GLint i;
- const GLchan *ptr = src;
- for (i = 0;i<drawWidth;i++) {
- span.array->rgba[i][0] = *ptr;
- span.array->rgba[i][1] = *ptr;
- span.array->rgba[i][2] = *ptr++;
- span.array->rgba[i][3] = *ptr++;
- }
- rb->PutRow(ctx, rb, drawWidth, destX, destY,
- span.array->rgba, NULL);
- src += unpack.RowLength*2;
- destY += yStep;
- }
- }
- else {
- /* with zooming */
- GLint row;
- ASSERT(drawWidth <= MAX_WIDTH);
- for (row = 0; row < drawHeight; row++) {
- const GLchan *ptr = src;
- GLint i;
- for (i = 0;i<drawWidth;i++) {
- span.array->rgba[i][0] = *ptr;
- span.array->rgba[i][1] = *ptr;
- span.array->rgba[i][2] = *ptr++;
- span.array->rgba[i][3] = *ptr++;
- }
- span.x = destX;
- span.y = destY;
- span.end = drawWidth;
- _swrast_write_zoomed_rgba_span(ctx, imgX, imgY, &span,
- span.array->rgba);
- src += unpack.RowLength*2;
- destY++;
- }
- }
- return GL_TRUE;
- }
-
- if (format == GL_COLOR_INDEX && type == GL_UNSIGNED_BYTE) {
- const GLubyte *src = (const GLubyte *) pixels
- + unpack.SkipRows * unpack.RowLength + unpack.SkipPixels;
- if (rbType == GL_UNSIGNED_BYTE) {
- /* convert ubyte/CI data to ubyte/RGBA */
- if (simpleZoom) {
- GLint row;
- for (row = 0; row < drawHeight; row++) {
- ASSERT(drawWidth <= MAX_WIDTH);
- _mesa_map_ci8_to_rgba8(ctx, drawWidth, src,
- span.array->rgba8);
- rb->PutRow(ctx, rb, drawWidth, destX, destY,
- span.array->rgba8, NULL);
- src += unpack.RowLength;
- destY += yStep;
- }
- }
- else {
- /* ubyte/CI to ubyte/RGBA with zooming */
- GLint row;
- for (row = 0; row < drawHeight; row++) {
- ASSERT(drawWidth <= MAX_WIDTH);
- _mesa_map_ci8_to_rgba8(ctx, drawWidth, src,
- span.array->rgba8);
- span.x = destX;
- span.y = destY;
- span.end = drawWidth;
- _swrast_write_zoomed_rgba_span(ctx, imgX, imgY, &span,
- span.array->rgba8);
- src += unpack.RowLength;
- destY++;
- }
- }
- return GL_TRUE;
- }
- }
-
- /* can't handle this pixel format and/or data type */
- return GL_FALSE;
-}
-
-
-
-/*
- * Draw stencil image.
- */
-static void
-draw_stencil_pixels( struct gl_context *ctx, GLint x, GLint y,
- GLsizei width, GLsizei height,
- GLenum type,
- const struct gl_pixelstore_attrib *unpack,
- const GLvoid *pixels )
-{
- const GLboolean zoom = ctx->Pixel.ZoomX != 1.0 || ctx->Pixel.ZoomY != 1.0;
- GLint skipPixels;
-
- /* if width > MAX_WIDTH, have to process image in chunks */
- skipPixels = 0;
- while (skipPixels < width) {
- const GLint spanX = x + skipPixels;
- const GLint spanWidth = MIN2(width - skipPixels, MAX_WIDTH);
- GLint row;
- for (row = 0; row < height; row++) {
- const GLint spanY = y + row;
- GLstencil values[MAX_WIDTH];
- GLenum destType = (sizeof(GLstencil) == sizeof(GLubyte))
- ? GL_UNSIGNED_BYTE : GL_UNSIGNED_SHORT;
- const GLvoid *source = _mesa_image_address2d(unpack, pixels,
- width, height,
- GL_COLOR_INDEX, type,
- row, skipPixels);
- _mesa_unpack_stencil_span(ctx, spanWidth, destType, values,
- type, source, unpack,
- ctx->_ImageTransferState);
- if (zoom) {
- _swrast_write_zoomed_stencil_span(ctx, x, y, spanWidth,
- spanX, spanY, values);
- }
- else {
- _swrast_write_stencil_span(ctx, spanWidth, spanX, spanY, values);
- }
- }
- skipPixels += spanWidth;
- }
-}
-
-
-/*
- * Draw depth image.
- */
-static void
-draw_depth_pixels( struct gl_context *ctx, GLint x, GLint y,
- GLsizei width, GLsizei height,
- GLenum type,
- const struct gl_pixelstore_attrib *unpack,
- const GLvoid *pixels )
-{
- const GLboolean scaleOrBias
- = ctx->Pixel.DepthScale != 1.0 || ctx->Pixel.DepthBias != 0.0;
- const GLboolean zoom = ctx->Pixel.ZoomX != 1.0 || ctx->Pixel.ZoomY != 1.0;
- SWspan span;
-
- INIT_SPAN(span, GL_BITMAP);
- span.arrayMask = SPAN_Z;
- _swrast_span_default_attribs(ctx, &span);
-
- if (type == GL_UNSIGNED_SHORT
- && ctx->DrawBuffer->Visual.depthBits == 16
- && !scaleOrBias
- && !zoom
- && width <= MAX_WIDTH
- && !unpack->SwapBytes) {
- /* Special case: directly write 16-bit depth values */
- GLint row;
- for (row = 0; row < height; row++) {
- const GLushort *zSrc = (const GLushort *)
- _mesa_image_address2d(unpack, pixels, width, height,
- GL_DEPTH_COMPONENT, type, row, 0);
- GLint i;
- for (i = 0; i < width; i++)
- span.array->z[i] = zSrc[i];
- span.x = x;
- span.y = y + row;
- span.end = width;
- _swrast_write_rgba_span(ctx, &span);
- }
- }
- else if (type == GL_UNSIGNED_INT
- && !scaleOrBias
- && !zoom
- && width <= MAX_WIDTH
- && !unpack->SwapBytes) {
- /* Special case: shift 32-bit values down to Visual.depthBits */
- const GLint shift = 32 - ctx->DrawBuffer->Visual.depthBits;
- GLint row;
- for (row = 0; row < height; row++) {
- const GLuint *zSrc = (const GLuint *)
- _mesa_image_address2d(unpack, pixels, width, height,
- GL_DEPTH_COMPONENT, type, row, 0);
- if (shift == 0) {
- memcpy(span.array->z, zSrc, width * sizeof(GLuint));
- }
- else {
- GLint col;
- for (col = 0; col < width; col++)
- span.array->z[col] = zSrc[col] >> shift;
- }
- span.x = x;
- span.y = y + row;
- span.end = width;
- _swrast_write_rgba_span(ctx, &span);
- }
- }
- else {
- /* General case */
- const GLuint depthMax = ctx->DrawBuffer->_DepthMax;
- GLint skipPixels = 0;
-
- /* in case width > MAX_WIDTH do the copy in chunks */
- while (skipPixels < width) {
- const GLint spanWidth = MIN2(width - skipPixels, MAX_WIDTH);
- GLint row;
- ASSERT(span.end <= MAX_WIDTH);
- for (row = 0; row < height; row++) {
- const GLvoid *zSrc = _mesa_image_address2d(unpack,
- pixels, width, height,
- GL_DEPTH_COMPONENT, type,
- row, skipPixels);
-
- /* Set these for each row since the _swrast_write_* function may
- * change them while clipping.
- */
- span.x = x + skipPixels;
- span.y = y + row;
- span.end = spanWidth;
-
- _mesa_unpack_depth_span(ctx, spanWidth,
- GL_UNSIGNED_INT, span.array->z, depthMax,
- type, zSrc, unpack);
- if (zoom) {
- _swrast_write_zoomed_depth_span(ctx, x, y, &span);
- }
- else {
- _swrast_write_rgba_span(ctx, &span);
- }
- }
- skipPixels += spanWidth;
- }
- }
-}
-
-
-
-/**
- * Draw RGBA image.
- */
-static void
-draw_rgba_pixels( struct gl_context *ctx, GLint x, GLint y,
- GLsizei width, GLsizei height,
- GLenum format, GLenum type,
- const struct gl_pixelstore_attrib *unpack,
- const GLvoid *pixels )
-{
- const GLint imgX = x, imgY = y;
- const GLboolean zoom = ctx->Pixel.ZoomX!=1.0 || ctx->Pixel.ZoomY!=1.0;
- GLfloat *convImage = NULL;
- GLbitfield transferOps = ctx->_ImageTransferState;
- SWspan span;
-
- /* Try an optimized glDrawPixels first */
- if (fast_draw_rgba_pixels(ctx, x, y, width, height, format, type,
- unpack, pixels)) {
- return;
- }
-
- INIT_SPAN(span, GL_BITMAP);
- _swrast_span_default_attribs(ctx, &span);
- span.arrayMask = SPAN_RGBA;
- span.arrayAttribs = FRAG_BIT_COL0; /* we're fill in COL0 attrib values */
-
- if (ctx->DrawBuffer->_NumColorDrawBuffers > 0 &&
- ctx->DrawBuffer->_ColorDrawBuffers[0]->DataType != GL_FLOAT &&
- ctx->Color.ClampFragmentColor != GL_FALSE) {
- /* need to clamp colors before applying fragment ops */
- transferOps |= IMAGE_CLAMP_BIT;
- }
-
- /*
- * General solution
- */
- {
- const GLbitfield interpMask = span.interpMask;
- const GLbitfield arrayMask = span.arrayMask;
- const GLint srcStride
- = _mesa_image_row_stride(unpack, width, format, type);
- GLint skipPixels = 0;
- /* use span array for temp color storage */
- GLfloat *rgba = (GLfloat *) span.array->attribs[FRAG_ATTRIB_COL0];
-
- /* if the span is wider than MAX_WIDTH we have to do it in chunks */
- while (skipPixels < width) {
- const GLint spanWidth = MIN2(width - skipPixels, MAX_WIDTH);
- const GLubyte *source
- = (const GLubyte *) _mesa_image_address2d(unpack, pixels,
- width, height, format,
- type, 0, skipPixels);
- GLint row;
-
- for (row = 0; row < height; row++) {
- /* get image row as float/RGBA */
- _mesa_unpack_color_span_float(ctx, spanWidth, GL_RGBA, rgba,
- format, type, source, unpack,
- transferOps);
- /* Set these for each row since the _swrast_write_* functions
- * may change them while clipping/rendering.
- */
- span.array->ChanType = GL_FLOAT;
- span.x = x + skipPixels;
- span.y = y + row;
- span.end = spanWidth;
- span.arrayMask = arrayMask;
- span.interpMask = interpMask;
- if (zoom) {
- _swrast_write_zoomed_rgba_span(ctx, imgX, imgY, &span, rgba);
- }
- else {
- _swrast_write_rgba_span(ctx, &span);
- }
-
- source += srcStride;
- } /* for row */
-
- skipPixels += spanWidth;
- } /* while skipPixels < width */
-
- /* XXX this is ugly/temporary, to undo above change */
- span.array->ChanType = CHAN_TYPE;
- }
-
- if (convImage) {
- free(convImage);
- }
-}
-
-
-/**
- * This is a bit different from drawing GL_DEPTH_COMPONENT pixels.
- * The only per-pixel operations that apply are depth scale/bias,
- * stencil offset/shift, GL_DEPTH_WRITEMASK and GL_STENCIL_WRITEMASK,
- * and pixel zoom.
- * Also, only the depth buffer and stencil buffers are touched, not the
- * color buffer(s).
- */
-static void
-draw_depth_stencil_pixels(struct gl_context *ctx, GLint x, GLint y,
- GLsizei width, GLsizei height, GLenum type,
- const struct gl_pixelstore_attrib *unpack,
- const GLvoid *pixels)
-{
- const GLint imgX = x, imgY = y;
- const GLboolean scaleOrBias
- = ctx->Pixel.DepthScale != 1.0 || ctx->Pixel.DepthBias != 0.0;
- const GLuint depthMax = ctx->DrawBuffer->_DepthMax;
- const GLuint stencilMask = ctx->Stencil.WriteMask[0];
- const GLuint stencilType = (STENCIL_BITS == 8) ?
- GL_UNSIGNED_BYTE : GL_UNSIGNED_SHORT;
- const GLboolean zoom = ctx->Pixel.ZoomX != 1.0 || ctx->Pixel.ZoomY != 1.0;
- struct gl_renderbuffer *depthRb, *stencilRb;
- struct gl_pixelstore_attrib clippedUnpack = *unpack;
-
- if (!zoom) {
- if (!_mesa_clip_drawpixels(ctx, &x, &y, &width, &height,
- &clippedUnpack)) {
- /* totally clipped */
- return;
- }
- }
-
- depthRb = ctx->ReadBuffer->Attachment[BUFFER_DEPTH].Renderbuffer;
- stencilRb = ctx->ReadBuffer->Attachment[BUFFER_STENCIL].Renderbuffer;
- ASSERT(depthRb);
- ASSERT(stencilRb);
-
- if (depthRb->_BaseFormat == GL_DEPTH_STENCIL_EXT &&
- stencilRb->_BaseFormat == GL_DEPTH_STENCIL_EXT &&
- depthRb == stencilRb &&
- !scaleOrBias &&
- !zoom &&
- ctx->Depth.Mask &&
- (stencilMask & 0xff) == 0xff) {
- /* This is the ideal case.
- * Drawing GL_DEPTH_STENCIL pixels into a combined depth/stencil buffer.
- * Plus, no pixel transfer ops, zooming, or masking needed.
- */
- GLint i;
- for (i = 0; i < height; i++) {
- const GLuint *src = (const GLuint *)
- _mesa_image_address2d(&clippedUnpack, pixels, width, height,
- GL_DEPTH_STENCIL_EXT, type, i, 0);
- depthRb->PutRow(ctx, depthRb, width, x, y + i, src, NULL);
- }
- }
- else {
- /* sub-optimal cases:
- * Separate depth/stencil buffers, or pixel transfer ops required.
- */
- /* XXX need to handle very wide images (skippixels) */
- GLint i;
-
- depthRb = ctx->DrawBuffer->_DepthBuffer;
- stencilRb = ctx->DrawBuffer->_StencilBuffer;
-
- for (i = 0; i < height; i++) {
- const GLuint *depthStencilSrc = (const GLuint *)
- _mesa_image_address2d(&clippedUnpack, pixels, width, height,
- GL_DEPTH_STENCIL_EXT, type, i, 0);
-
- if (ctx->Depth.Mask) {
- if (!scaleOrBias && ctx->DrawBuffer->Visual.depthBits == 24) {
- /* fast path 24-bit zbuffer */
- GLuint zValues[MAX_WIDTH];
- GLint j;
- ASSERT(depthRb->DataType == GL_UNSIGNED_INT);
- for (j = 0; j < width; j++) {
- zValues[j] = depthStencilSrc[j] >> 8;
- }
- if (zoom)
- _swrast_write_zoomed_z_span(ctx, imgX, imgY, width,
- x, y + i, zValues);
- else
- depthRb->PutRow(ctx, depthRb, width, x, y + i, zValues,NULL);
- }
- else if (!scaleOrBias && ctx->DrawBuffer->Visual.depthBits == 16) {
- /* fast path 16-bit zbuffer */
- GLushort zValues[MAX_WIDTH];
- GLint j;
- ASSERT(depthRb->DataType == GL_UNSIGNED_SHORT);
- for (j = 0; j < width; j++) {
- zValues[j] = depthStencilSrc[j] >> 16;
- }
- if (zoom)
- _swrast_write_zoomed_z_span(ctx, imgX, imgY, width,
- x, y + i, zValues);
- else
- depthRb->PutRow(ctx, depthRb, width, x, y + i, zValues,NULL);
- }
- else {
- /* general case */
- GLuint zValues[MAX_WIDTH]; /* 16 or 32-bit Z value storage */
- _mesa_unpack_depth_span(ctx, width,
- depthRb->DataType, zValues, depthMax,
- type, depthStencilSrc, &clippedUnpack);
- if (zoom) {
- _swrast_write_zoomed_z_span(ctx, imgX, imgY, width, x,
- y + i, zValues);
- }
- else {
- depthRb->PutRow(ctx, depthRb, width, x, y + i, zValues,NULL);
- }
- }
- }
-
- if (stencilMask != 0x0) {
- GLstencil stencilValues[MAX_WIDTH];
- /* get stencil values, with shift/offset/mapping */
- _mesa_unpack_stencil_span(ctx, width, stencilType, stencilValues,
- type, depthStencilSrc, &clippedUnpack,
- ctx->_ImageTransferState);
- if (zoom)
- _swrast_write_zoomed_stencil_span(ctx, imgX, imgY, width,
- x, y + i, stencilValues);
- else
- _swrast_write_stencil_span(ctx, width, x, y + i, stencilValues);
- }
- }
- }
-}
-
-
-/**
- * Execute software-based glDrawPixels.
- * By time we get here, all error checking will have been done.
- */
-void
-_swrast_DrawPixels( struct gl_context *ctx,
- GLint x, GLint y,
- GLsizei width, GLsizei height,
- GLenum format, GLenum type,
- const struct gl_pixelstore_attrib *unpack,
- const GLvoid *pixels )
-{
- SWcontext *swrast = SWRAST_CONTEXT(ctx);
- GLboolean save_vp_override = ctx->VertexProgram._Overriden;
-
- if (!_mesa_check_conditional_render(ctx))
- return; /* don't draw */
-
- /* We are creating fragments directly, without going through vertex
- * programs.
- *
- * This override flag tells the fragment processing code that its input
- * comes from a non-standard source, and it may therefore not rely on
- * optimizations that assume e.g. constant color if there is no color
- * vertex array.
- */
- _mesa_set_vp_override(ctx, GL_TRUE);
-
- swrast_render_start(ctx);
-
- if (ctx->NewState)
- _mesa_update_state(ctx);
-
- if (swrast->NewState)
- _swrast_validate_derived( ctx );
-
- pixels = _mesa_map_pbo_source(ctx, unpack, pixels);
- if (!pixels) {
- swrast_render_finish(ctx);
- _mesa_set_vp_override(ctx, save_vp_override);
- return;
- }
-
- /*
- * By time we get here, all error checking should have been done.
- */
- switch (format) {
- case GL_STENCIL_INDEX:
- draw_stencil_pixels( ctx, x, y, width, height, type, unpack, pixels );
- break;
- case GL_DEPTH_COMPONENT:
- draw_depth_pixels( ctx, x, y, width, height, type, unpack, pixels );
- break;
- case GL_DEPTH_STENCIL_EXT:
- draw_depth_stencil_pixels(ctx, x, y, width, height, type, unpack, pixels);
- break;
- default:
- /* all other formats should be color formats */
- draw_rgba_pixels(ctx, x, y, width, height, format, type, unpack, pixels);
- }
-
- swrast_render_finish(ctx);
- _mesa_set_vp_override(ctx, save_vp_override);
-
- _mesa_unmap_pbo_source(ctx, unpack);
-}
+/*
+ * Mesa 3-D graphics library
+ * Version: 7.1
+ *
+ * Copyright (C) 1999-2007 Brian Paul All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+
+#include "main/glheader.h"
+#include "main/bufferobj.h"
+#include "main/condrender.h"
+#include "main/context.h"
+#include "main/image.h"
+#include "main/imports.h"
+#include "main/macros.h"
+#include "main/pack.h"
+#include "main/pbo.h"
+#include "main/pixeltransfer.h"
+#include "main/state.h"
+
+#include "s_context.h"
+#include "s_span.h"
+#include "s_stencil.h"
+#include "s_zoom.h"
+
+
+
+/**
+ * Try to do a fast and simple RGB(a) glDrawPixels.
+ * Return: GL_TRUE if success, GL_FALSE if slow path must be used instead
+ */
+static GLboolean
+fast_draw_rgba_pixels(struct gl_context *ctx, GLint x, GLint y,
+ GLsizei width, GLsizei height,
+ GLenum format, GLenum type,
+ const struct gl_pixelstore_attrib *userUnpack,
+ const GLvoid *pixels)
+{
+ const GLint imgX = x, imgY = y;
+ struct gl_renderbuffer *rb = ctx->DrawBuffer->_ColorDrawBuffers[0];
+ GLenum rbType;
+ SWcontext *swrast = SWRAST_CONTEXT(ctx);
+ SWspan span;
+ GLboolean simpleZoom;
+ GLint yStep; /* +1 or -1 */
+ struct gl_pixelstore_attrib unpack;
+ GLint destX, destY, drawWidth, drawHeight; /* post clipping */
+
+ if (!rb)
+ return GL_TRUE; /* no-op */
+
+ rbType = rb->DataType;
+
+ if ((swrast->_RasterMask & ~CLIP_BIT) ||
+ ctx->Texture._EnabledCoordUnits ||
+ userUnpack->SwapBytes ||
+ ctx->_ImageTransferState) {
+ /* can't handle any of those conditions */
+ return GL_FALSE;
+ }
+
+ INIT_SPAN(span, GL_BITMAP);
+ span.arrayMask = SPAN_RGBA;
+ span.arrayAttribs = FRAG_BIT_COL0;
+ _swrast_span_default_attribs(ctx, &span);
+
+ /* copy input params since clipping may change them */
+ unpack = *userUnpack;
+ destX = x;
+ destY = y;
+ drawWidth = width;
+ drawHeight = height;
+
+ /* check for simple zooming and clipping */
+ if (ctx->Pixel.ZoomX == 1.0F &&
+ (ctx->Pixel.ZoomY == 1.0F || ctx->Pixel.ZoomY == -1.0F)) {
+ if (!_mesa_clip_drawpixels(ctx, &destX, &destY,
+ &drawWidth, &drawHeight, &unpack)) {
+ /* image was completely clipped: no-op, all done */
+ return GL_TRUE;
+ }
+ simpleZoom = GL_TRUE;
+ yStep = (GLint) ctx->Pixel.ZoomY;
+ ASSERT(yStep == 1 || yStep == -1);
+ }
+ else {
+ /* non-simple zooming */
+ simpleZoom = GL_FALSE;
+ yStep = 1;
+ if (unpack.RowLength == 0)
+ unpack.RowLength = width;
+ }
+
+ /*
+ * Ready to draw!
+ */
+
+ if (format == GL_RGBA && type == rbType) {
+ const GLubyte *src
+ = (const GLubyte *) _mesa_image_address2d(&unpack, pixels, width,
+ height, format, type, 0, 0);
+ const GLint srcStride = _mesa_image_row_stride(&unpack, width,
+ format, type);
+ if (simpleZoom) {
+ GLint row;
+ for (row = 0; row < drawHeight; row++) {
+ rb->PutRow(ctx, rb, drawWidth, destX, destY, src, NULL);
+ src += srcStride;
+ destY += yStep;
+ }
+ }
+ else {
+ /* with zooming */
+ GLint row;
+ for (row = 0; row < drawHeight; row++) {
+ span.x = destX;
+ span.y = destY + row;
+ span.end = drawWidth;
+ span.array->ChanType = rbType;
+ _swrast_write_zoomed_rgba_span(ctx, imgX, imgY, &span, src);
+ src += srcStride;
+ }
+ span.array->ChanType = CHAN_TYPE;
+ }
+ return GL_TRUE;
+ }
+
+ if (format == GL_RGB && type == rbType) {
+ const GLubyte *src
+ = (const GLubyte *) _mesa_image_address2d(&unpack, pixels, width,
+ height, format, type, 0, 0);
+ const GLint srcStride = _mesa_image_row_stride(&unpack, width,
+ format, type);
+ if (simpleZoom) {
+ GLint row;
+ for (row = 0; row < drawHeight; row++) {
+ rb->PutRowRGB(ctx, rb, drawWidth, destX, destY, src, NULL);
+ src += srcStride;
+ destY += yStep;
+ }
+ }
+ else {
+ /* with zooming */
+ GLint row;
+ for (row = 0; row < drawHeight; row++) {
+ span.x = destX;
+ span.y = destY;
+ span.end = drawWidth;
+ span.array->ChanType = rbType;
+ _swrast_write_zoomed_rgb_span(ctx, imgX, imgY, &span, src);
+ src += srcStride;
+ destY++;
+ }
+ span.array->ChanType = CHAN_TYPE;
+ }
+ return GL_TRUE;
+ }
+
+ /* Remaining cases haven't been tested with alignment != 1 */
+ if (userUnpack->Alignment != 1)
+ return GL_FALSE;
+
+ if (format == GL_LUMINANCE && type == CHAN_TYPE && rbType == CHAN_TYPE) {
+ const GLchan *src = (const GLchan *) pixels
+ + (unpack.SkipRows * unpack.RowLength + unpack.SkipPixels);
+ if (simpleZoom) {
+ /* no zooming */
+ GLint row;
+ ASSERT(drawWidth <= MAX_WIDTH);
+ for (row = 0; row < drawHeight; row++) {
+ GLchan rgb[MAX_WIDTH][3];
+ GLint i;
+ for (i = 0;i<drawWidth;i++) {
+ rgb[i][0] = src[i];
+ rgb[i][1] = src[i];
+ rgb[i][2] = src[i];
+ }
+ rb->PutRowRGB(ctx, rb, drawWidth, destX, destY, rgb, NULL);
+ src += unpack.RowLength;
+ destY += yStep;
+ }
+ }
+ else {
+ /* with zooming */
+ GLint row;
+ ASSERT(drawWidth <= MAX_WIDTH);
+ for (row = 0; row < drawHeight; row++) {
+ GLchan rgb[MAX_WIDTH][3];
+ GLint i;
+ for (i = 0;i<drawWidth;i++) {
+ rgb[i][0] = src[i];
+ rgb[i][1] = src[i];
+ rgb[i][2] = src[i];
+ }
+ span.x = destX;
+ span.y = destY;
+ span.end = drawWidth;
+ _swrast_write_zoomed_rgb_span(ctx, imgX, imgY, &span, rgb);
+ src += unpack.RowLength;
+ destY++;
+ }
+ }
+ return GL_TRUE;
+ }
+
+ if (format == GL_LUMINANCE_ALPHA && type == CHAN_TYPE && rbType == CHAN_TYPE) {
+ const GLchan *src = (const GLchan *) pixels
+ + (unpack.SkipRows * unpack.RowLength + unpack.SkipPixels)*2;
+ if (simpleZoom) {
+ GLint row;
+ ASSERT(drawWidth <= MAX_WIDTH);
+ for (row = 0; row < drawHeight; row++) {
+ GLint i;
+ const GLchan *ptr = src;
+ for (i = 0;i<drawWidth;i++) {
+ span.array->rgba[i][0] = *ptr;
+ span.array->rgba[i][1] = *ptr;
+ span.array->rgba[i][2] = *ptr++;
+ span.array->rgba[i][3] = *ptr++;
+ }
+ rb->PutRow(ctx, rb, drawWidth, destX, destY,
+ span.array->rgba, NULL);
+ src += unpack.RowLength*2;
+ destY += yStep;
+ }
+ }
+ else {
+ /* with zooming */
+ GLint row;
+ ASSERT(drawWidth <= MAX_WIDTH);
+ for (row = 0; row < drawHeight; row++) {
+ const GLchan *ptr = src;
+ GLint i;
+ for (i = 0;i<drawWidth;i++) {
+ span.array->rgba[i][0] = *ptr;
+ span.array->rgba[i][1] = *ptr;
+ span.array->rgba[i][2] = *ptr++;
+ span.array->rgba[i][3] = *ptr++;
+ }
+ span.x = destX;
+ span.y = destY;
+ span.end = drawWidth;
+ _swrast_write_zoomed_rgba_span(ctx, imgX, imgY, &span,
+ span.array->rgba);
+ src += unpack.RowLength*2;
+ destY++;
+ }
+ }
+ return GL_TRUE;
+ }
+
+ if (format == GL_COLOR_INDEX && type == GL_UNSIGNED_BYTE) {
+ const GLubyte *src = (const GLubyte *) pixels
+ + unpack.SkipRows * unpack.RowLength + unpack.SkipPixels;
+ if (rbType == GL_UNSIGNED_BYTE) {
+ /* convert ubyte/CI data to ubyte/RGBA */
+ if (simpleZoom) {
+ GLint row;
+ for (row = 0; row < drawHeight; row++) {
+ ASSERT(drawWidth <= MAX_WIDTH);
+ _mesa_map_ci8_to_rgba8(ctx, drawWidth, src,
+ span.array->rgba8);
+ rb->PutRow(ctx, rb, drawWidth, destX, destY,
+ span.array->rgba8, NULL);
+ src += unpack.RowLength;
+ destY += yStep;
+ }
+ }
+ else {
+ /* ubyte/CI to ubyte/RGBA with zooming */
+ GLint row;
+ for (row = 0; row < drawHeight; row++) {
+ ASSERT(drawWidth <= MAX_WIDTH);
+ _mesa_map_ci8_to_rgba8(ctx, drawWidth, src,
+ span.array->rgba8);
+ span.x = destX;
+ span.y = destY;
+ span.end = drawWidth;
+ _swrast_write_zoomed_rgba_span(ctx, imgX, imgY, &span,
+ span.array->rgba8);
+ src += unpack.RowLength;
+ destY++;
+ }
+ }
+ return GL_TRUE;
+ }
+ }
+
+ /* can't handle this pixel format and/or data type */
+ return GL_FALSE;
+}
+
+
+
+/*
+ * Draw stencil image.
+ */
+static void
+draw_stencil_pixels( struct gl_context *ctx, GLint x, GLint y,
+ GLsizei width, GLsizei height,
+ GLenum type,
+ const struct gl_pixelstore_attrib *unpack,
+ const GLvoid *pixels )
+{
+ const GLboolean zoom = ctx->Pixel.ZoomX != 1.0 || ctx->Pixel.ZoomY != 1.0;
+ GLint skipPixels;
+
+ /* if width > MAX_WIDTH, have to process image in chunks */
+ skipPixels = 0;
+ while (skipPixels < width) {
+ const GLint spanX = x + skipPixels;
+ const GLint spanWidth = MIN2(width - skipPixels, MAX_WIDTH);
+ GLint row;
+ for (row = 0; row < height; row++) {
+ const GLint spanY = y + row;
+ GLstencil values[MAX_WIDTH];
+ GLenum destType = (sizeof(GLstencil) == sizeof(GLubyte))
+ ? GL_UNSIGNED_BYTE : GL_UNSIGNED_SHORT;
+ const GLvoid *source = _mesa_image_address2d(unpack, pixels,
+ width, height,
+ GL_COLOR_INDEX, type,
+ row, skipPixels);
+ _mesa_unpack_stencil_span(ctx, spanWidth, destType, values,
+ type, source, unpack,
+ ctx->_ImageTransferState);
+ if (zoom) {
+ _swrast_write_zoomed_stencil_span(ctx, x, y, spanWidth,
+ spanX, spanY, values);
+ }
+ else {
+ _swrast_write_stencil_span(ctx, spanWidth, spanX, spanY, values);
+ }
+ }
+ skipPixels += spanWidth;
+ }
+}
+
+
+/*
+ * Draw depth image.
+ */
+static void
+draw_depth_pixels( struct gl_context *ctx, GLint x, GLint y,
+ GLsizei width, GLsizei height,
+ GLenum type,
+ const struct gl_pixelstore_attrib *unpack,
+ const GLvoid *pixels )
+{
+ const GLboolean scaleOrBias
+ = ctx->Pixel.DepthScale != 1.0 || ctx->Pixel.DepthBias != 0.0;
+ const GLboolean zoom = ctx->Pixel.ZoomX != 1.0 || ctx->Pixel.ZoomY != 1.0;
+ SWspan span;
+
+ INIT_SPAN(span, GL_BITMAP);
+ span.arrayMask = SPAN_Z;
+ _swrast_span_default_attribs(ctx, &span);
+
+ if (type == GL_UNSIGNED_SHORT
+ && ctx->DrawBuffer->Visual.depthBits == 16
+ && !scaleOrBias
+ && !zoom
+ && width <= MAX_WIDTH
+ && !unpack->SwapBytes) {
+ /* Special case: directly write 16-bit depth values */
+ GLint row;
+ for (row = 0; row < height; row++) {
+ const GLushort *zSrc = (const GLushort *)
+ _mesa_image_address2d(unpack, pixels, width, height,
+ GL_DEPTH_COMPONENT, type, row, 0);
+ GLint i;
+ for (i = 0; i < width; i++)
+ span.array->z[i] = zSrc[i];
+ span.x = x;
+ span.y = y + row;
+ span.end = width;
+ _swrast_write_rgba_span(ctx, &span);
+ }
+ }
+ else if (type == GL_UNSIGNED_INT
+ && !scaleOrBias
+ && !zoom
+ && width <= MAX_WIDTH
+ && !unpack->SwapBytes) {
+ /* Special case: shift 32-bit values down to Visual.depthBits */
+ const GLint shift = 32 - ctx->DrawBuffer->Visual.depthBits;
+ GLint row;
+ for (row = 0; row < height; row++) {
+ const GLuint *zSrc = (const GLuint *)
+ _mesa_image_address2d(unpack, pixels, width, height,
+ GL_DEPTH_COMPONENT, type, row, 0);
+ if (shift == 0) {
+ memcpy(span.array->z, zSrc, width * sizeof(GLuint));
+ }
+ else {
+ GLint col;
+ for (col = 0; col < width; col++)
+ span.array->z[col] = zSrc[col] >> shift;
+ }
+ span.x = x;
+ span.y = y + row;
+ span.end = width;
+ _swrast_write_rgba_span(ctx, &span);
+ }
+ }
+ else {
+ /* General case */
+ const GLuint depthMax = ctx->DrawBuffer->_DepthMax;
+ GLint skipPixels = 0;
+
+ /* in case width > MAX_WIDTH do the copy in chunks */
+ while (skipPixels < width) {
+ const GLint spanWidth = MIN2(width - skipPixels, MAX_WIDTH);
+ GLint row;
+ ASSERT(span.end <= MAX_WIDTH);
+ for (row = 0; row < height; row++) {
+ const GLvoid *zSrc = _mesa_image_address2d(unpack,
+ pixels, width, height,
+ GL_DEPTH_COMPONENT, type,
+ row, skipPixels);
+
+ /* Set these for each row since the _swrast_write_* function may
+ * change them while clipping.
+ */
+ span.x = x + skipPixels;
+ span.y = y + row;
+ span.end = spanWidth;
+
+ _mesa_unpack_depth_span(ctx, spanWidth,
+ GL_UNSIGNED_INT, span.array->z, depthMax,
+ type, zSrc, unpack);
+ if (zoom) {
+ _swrast_write_zoomed_depth_span(ctx, x, y, &span);
+ }
+ else {
+ _swrast_write_rgba_span(ctx, &span);
+ }
+ }
+ skipPixels += spanWidth;
+ }
+ }
+}
+
+
+
+/**
+ * Draw RGBA image.
+ */
+static void
+draw_rgba_pixels( struct gl_context *ctx, GLint x, GLint y,
+ GLsizei width, GLsizei height,
+ GLenum format, GLenum type,
+ const struct gl_pixelstore_attrib *unpack,
+ const GLvoid *pixels )
+{
+ const GLint imgX = x, imgY = y;
+ const GLboolean zoom = ctx->Pixel.ZoomX!=1.0 || ctx->Pixel.ZoomY!=1.0;
+ GLfloat *convImage = NULL;
+ GLbitfield transferOps = ctx->_ImageTransferState;
+ SWspan span;
+
+ /* Try an optimized glDrawPixels first */
+ if (fast_draw_rgba_pixels(ctx, x, y, width, height, format, type,
+ unpack, pixels)) {
+ return;
+ }
+
+ INIT_SPAN(span, GL_BITMAP);
+ _swrast_span_default_attribs(ctx, &span);
+ span.arrayMask = SPAN_RGBA;
+ span.arrayAttribs = FRAG_BIT_COL0; /* we're fill in COL0 attrib values */
+
+ if (ctx->DrawBuffer->_NumColorDrawBuffers > 0 &&
+ ctx->DrawBuffer->_ColorDrawBuffers[0]->DataType != GL_FLOAT &&
+ ctx->Color.ClampFragmentColor != GL_FALSE) {
+ /* need to clamp colors before applying fragment ops */
+ transferOps |= IMAGE_CLAMP_BIT;
+ }
+
+ /*
+ * General solution
+ */
+ {
+ const GLbitfield interpMask = span.interpMask;
+ const GLbitfield arrayMask = span.arrayMask;
+ const GLint srcStride
+ = _mesa_image_row_stride(unpack, width, format, type);
+ GLint skipPixels = 0;
+ /* use span array for temp color storage */
+ GLfloat *rgba = (GLfloat *) span.array->attribs[FRAG_ATTRIB_COL0];
+
+ /* if the span is wider than MAX_WIDTH we have to do it in chunks */
+ while (skipPixels < width) {
+ const GLint spanWidth = MIN2(width - skipPixels, MAX_WIDTH);
+ const GLubyte *source
+ = (const GLubyte *) _mesa_image_address2d(unpack, pixels,
+ width, height, format,
+ type, 0, skipPixels);
+ GLint row;
+
+ for (row = 0; row < height; row++) {
+ /* get image row as float/RGBA */
+ _mesa_unpack_color_span_float(ctx, spanWidth, GL_RGBA, rgba,
+ format, type, source, unpack,
+ transferOps);
+ /* Set these for each row since the _swrast_write_* functions
+ * may change them while clipping/rendering.
+ */
+ span.array->ChanType = GL_FLOAT;
+ span.x = x + skipPixels;
+ span.y = y + row;
+ span.end = spanWidth;
+ span.arrayMask = arrayMask;
+ span.interpMask = interpMask;
+ if (zoom) {
+ _swrast_write_zoomed_rgba_span(ctx, imgX, imgY, &span, rgba);
+ }
+ else {
+ _swrast_write_rgba_span(ctx, &span);
+ }
+
+ source += srcStride;
+ } /* for row */
+
+ skipPixels += spanWidth;
+ } /* while skipPixels < width */
+
+ /* XXX this is ugly/temporary, to undo above change */
+ span.array->ChanType = CHAN_TYPE;
+ }
+
+ if (convImage) {
+ free(convImage);
+ }
+}
+
+
+/**
+ * This is a bit different from drawing GL_DEPTH_COMPONENT pixels.
+ * The only per-pixel operations that apply are depth scale/bias,
+ * stencil offset/shift, GL_DEPTH_WRITEMASK and GL_STENCIL_WRITEMASK,
+ * and pixel zoom.
+ * Also, only the depth buffer and stencil buffers are touched, not the
+ * color buffer(s).
+ */
+static void
+draw_depth_stencil_pixels(struct gl_context *ctx, GLint x, GLint y,
+ GLsizei width, GLsizei height, GLenum type,
+ const struct gl_pixelstore_attrib *unpack,
+ const GLvoid *pixels)
+{
+ const GLint imgX = x, imgY = y;
+ const GLboolean scaleOrBias
+ = ctx->Pixel.DepthScale != 1.0 || ctx->Pixel.DepthBias != 0.0;
+ const GLuint depthMax = ctx->DrawBuffer->_DepthMax;
+ const GLuint stencilMask = ctx->Stencil.WriteMask[0];
+ const GLuint stencilType = (STENCIL_BITS == 8) ?
+ GL_UNSIGNED_BYTE : GL_UNSIGNED_SHORT;
+ const GLboolean zoom = ctx->Pixel.ZoomX != 1.0 || ctx->Pixel.ZoomY != 1.0;
+ struct gl_renderbuffer *depthRb, *stencilRb;
+ struct gl_pixelstore_attrib clippedUnpack = *unpack;
+
+ if (!zoom) {
+ if (!_mesa_clip_drawpixels(ctx, &x, &y, &width, &height,
+ &clippedUnpack)) {
+ /* totally clipped */
+ return;
+ }
+ }
+
+ depthRb = ctx->ReadBuffer->Attachment[BUFFER_DEPTH].Renderbuffer;
+ stencilRb = ctx->ReadBuffer->Attachment[BUFFER_STENCIL].Renderbuffer;
+ ASSERT(depthRb);
+ ASSERT(stencilRb);
+
+ if (depthRb->_BaseFormat == GL_DEPTH_STENCIL_EXT &&
+ stencilRb->_BaseFormat == GL_DEPTH_STENCIL_EXT &&
+ depthRb == stencilRb &&
+ !scaleOrBias &&
+ !zoom &&
+ ctx->Depth.Mask &&
+ (stencilMask & 0xff) == 0xff) {
+ /* This is the ideal case.
+ * Drawing GL_DEPTH_STENCIL pixels into a combined depth/stencil buffer.
+ * Plus, no pixel transfer ops, zooming, or masking needed.
+ */
+ GLint i;
+ for (i = 0; i < height; i++) {
+ const GLuint *src = (const GLuint *)
+ _mesa_image_address2d(&clippedUnpack, pixels, width, height,
+ GL_DEPTH_STENCIL_EXT, type, i, 0);
+ depthRb->PutRow(ctx, depthRb, width, x, y + i, src, NULL);
+ }
+ }
+ else {
+ /* sub-optimal cases:
+ * Separate depth/stencil buffers, or pixel transfer ops required.
+ */
+ /* XXX need to handle very wide images (skippixels) */
+ GLint i;
+
+ depthRb = ctx->DrawBuffer->_DepthBuffer;
+ stencilRb = ctx->DrawBuffer->_StencilBuffer;
+
+ for (i = 0; i < height; i++) {
+ const GLuint *depthStencilSrc = (const GLuint *)
+ _mesa_image_address2d(&clippedUnpack, pixels, width, height,
+ GL_DEPTH_STENCIL_EXT, type, i, 0);
+
+ if (ctx->Depth.Mask) {
+ if (!scaleOrBias && ctx->DrawBuffer->Visual.depthBits == 24) {
+ /* fast path 24-bit zbuffer */
+ GLuint zValues[MAX_WIDTH];
+ GLint j;
+ ASSERT(depthRb->DataType == GL_UNSIGNED_INT);
+ for (j = 0; j < width; j++) {
+ zValues[j] = depthStencilSrc[j] >> 8;
+ }
+ if (zoom)
+ _swrast_write_zoomed_z_span(ctx, imgX, imgY, width,
+ x, y + i, zValues);
+ else
+ depthRb->PutRow(ctx, depthRb, width, x, y + i, zValues,NULL);
+ }
+ else if (!scaleOrBias && ctx->DrawBuffer->Visual.depthBits == 16) {
+ /* fast path 16-bit zbuffer */
+ GLushort zValues[MAX_WIDTH];
+ GLint j;
+ ASSERT(depthRb->DataType == GL_UNSIGNED_SHORT);
+ for (j = 0; j < width; j++) {
+ zValues[j] = depthStencilSrc[j] >> 16;
+ }
+ if (zoom)
+ _swrast_write_zoomed_z_span(ctx, imgX, imgY, width,
+ x, y + i, zValues);
+ else
+ depthRb->PutRow(ctx, depthRb, width, x, y + i, zValues,NULL);
+ }
+ else {
+ /* general case */
+ GLuint zValues[MAX_WIDTH]; /* 16 or 32-bit Z value storage */
+ _mesa_unpack_depth_span(ctx, width,
+ depthRb->DataType, zValues, depthMax,
+ type, depthStencilSrc, &clippedUnpack);
+ if (zoom) {
+ _swrast_write_zoomed_z_span(ctx, imgX, imgY, width, x,
+ y + i, zValues);
+ }
+ else {
+ depthRb->PutRow(ctx, depthRb, width, x, y + i, zValues,NULL);
+ }
+ }
+ }
+
+ if (stencilMask != 0x0) {
+ GLstencil stencilValues[MAX_WIDTH];
+ /* get stencil values, with shift/offset/mapping */
+ _mesa_unpack_stencil_span(ctx, width, stencilType, stencilValues,
+ type, depthStencilSrc, &clippedUnpack,
+ ctx->_ImageTransferState);
+ if (zoom)
+ _swrast_write_zoomed_stencil_span(ctx, imgX, imgY, width,
+ x, y + i, stencilValues);
+ else
+ _swrast_write_stencil_span(ctx, width, x, y + i, stencilValues);
+ }
+ }
+ }
+}
+
+
+/**
+ * Execute software-based glDrawPixels.
+ * By time we get here, all error checking will have been done.
+ */
+void
+_swrast_DrawPixels( struct gl_context *ctx,
+ GLint x, GLint y,
+ GLsizei width, GLsizei height,
+ GLenum format, GLenum type,
+ const struct gl_pixelstore_attrib *unpack,
+ const GLvoid *pixels )
+{
+ SWcontext *swrast = SWRAST_CONTEXT(ctx);
+ GLboolean save_vp_override = ctx->VertexProgram._Overriden;
+
+ if (!_mesa_check_conditional_render(ctx))
+ return; /* don't draw */
+
+ /* We are creating fragments directly, without going through vertex
+ * programs.
+ *
+ * This override flag tells the fragment processing code that its input
+ * comes from a non-standard source, and it may therefore not rely on
+ * optimizations that assume e.g. constant color if there is no color
+ * vertex array.
+ */
+ _mesa_set_vp_override(ctx, GL_TRUE);
+
+ swrast_render_start(ctx);
+
+ if (ctx->NewState)
+ _mesa_update_state(ctx);
+
+ if (swrast->NewState)
+ _swrast_validate_derived( ctx );
+
+ pixels = _mesa_map_pbo_source(ctx, unpack, pixels);
+ if (!pixels) {
+ swrast_render_finish(ctx);
+ _mesa_set_vp_override(ctx, save_vp_override);
+ return;
+ }
+
+ /*
+ * By time we get here, all error checking should have been done.
+ */
+ switch (format) {
+ case GL_STENCIL_INDEX:
+ draw_stencil_pixels( ctx, x, y, width, height, type, unpack, pixels );
+ break;
+ case GL_DEPTH_COMPONENT:
+ draw_depth_pixels( ctx, x, y, width, height, type, unpack, pixels );
+ break;
+ case GL_DEPTH_STENCIL_EXT:
+ draw_depth_stencil_pixels(ctx, x, y, width, height, type, unpack, pixels);
+ break;
+ default:
+ /* all other formats should be color formats */
+ draw_rgba_pixels(ctx, x, y, width, height, format, type, unpack, pixels);
+ }
+
+ swrast_render_finish(ctx);
+ _mesa_set_vp_override(ctx, save_vp_override);
+
+ _mesa_unmap_pbo_source(ctx, unpack);
+}
diff --git a/mesalib/src/mesa/swrast/s_fog.c b/mesalib/src/mesa/swrast/s_fog.c
index ea59de160..5df071481 100644
--- a/mesalib/src/mesa/swrast/s_fog.c
+++ b/mesalib/src/mesa/swrast/s_fog.c
@@ -1,244 +1,244 @@
-/*
- * Mesa 3-D graphics library
- * Version: 6.5.2
- *
- * Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-
-#include "main/glheader.h"
-#include "main/colormac.h"
-#include "main/macros.h"
-
-#include "s_context.h"
-#include "s_fog.h"
-
-
-/**
- * Used to convert current raster distance to a fog factor in [0,1].
- */
-GLfloat
-_swrast_z_to_fogfactor(struct gl_context *ctx, GLfloat z)
-{
- GLfloat d, f;
-
- switch (ctx->Fog.Mode) {
- case GL_LINEAR:
- if (ctx->Fog.Start == ctx->Fog.End)
- d = 1.0F;
- else
- d = 1.0F / (ctx->Fog.End - ctx->Fog.Start);
- f = (ctx->Fog.End - z) * d;
- return CLAMP(f, 0.0F, 1.0F);
- case GL_EXP:
- d = ctx->Fog.Density;
- f = EXPF(-d * z);
- f = CLAMP(f, 0.0F, 1.0F);
- return f;
- case GL_EXP2:
- d = ctx->Fog.Density;
- f = EXPF(-(d * d * z * z));
- f = CLAMP(f, 0.0F, 1.0F);
- return f;
- default:
- _mesa_problem(ctx, "Bad fog mode in _swrast_z_to_fogfactor");
- return 0.0;
- }
-}
-
-
-#define LINEAR_FOG(f, coord) f = (fogEnd - coord) * fogScale
-
-#define EXP_FOG(f, coord) f = EXPF(density * coord)
-
-#define EXP2_FOG(f, coord) \
-do { \
- GLfloat tmp = negDensitySquared * coord * coord; \
- if (tmp < FLT_MIN_10_EXP) \
- tmp = FLT_MIN_10_EXP; \
- f = EXPF(tmp); \
- } while(0)
-
-
-#define BLEND_FOG(f, coord) f = coord
-
-
-
-/**
- * Template code for computing fog blend factor and applying it to colors.
- * \param TYPE either GLubyte, GLushort or GLfloat.
- * \param COMPUTE_F code to compute the fog blend factor, f.
- */
-#define FOG_LOOP(TYPE, FOG_FUNC) \
-if (span->arrayAttribs & FRAG_BIT_FOGC) { \
- GLuint i; \
- for (i = 0; i < span->end; i++) { \
- const GLfloat fogCoord = span->array->attribs[FRAG_ATTRIB_FOGC][i][0]; \
- const GLfloat c = FABSF(fogCoord); \
- GLfloat f, oneMinusF; \
- FOG_FUNC(f, c); \
- f = CLAMP(f, 0.0F, 1.0F); \
- oneMinusF = 1.0F - f; \
- rgba[i][RCOMP] = (TYPE) (f * rgba[i][RCOMP] + oneMinusF * rFog); \
- rgba[i][GCOMP] = (TYPE) (f * rgba[i][GCOMP] + oneMinusF * gFog); \
- rgba[i][BCOMP] = (TYPE) (f * rgba[i][BCOMP] + oneMinusF * bFog); \
- } \
-} \
-else { \
- const GLfloat fogStep = span->attrStepX[FRAG_ATTRIB_FOGC][0]; \
- GLfloat fogCoord = span->attrStart[FRAG_ATTRIB_FOGC][0]; \
- const GLfloat wStep = span->attrStepX[FRAG_ATTRIB_WPOS][3]; \
- GLfloat w = span->attrStart[FRAG_ATTRIB_WPOS][3]; \
- GLuint i; \
- for (i = 0; i < span->end; i++) { \
- const GLfloat c = FABSF(fogCoord) / w; \
- GLfloat f, oneMinusF; \
- FOG_FUNC(f, c); \
- f = CLAMP(f, 0.0F, 1.0F); \
- oneMinusF = 1.0F - f; \
- rgba[i][RCOMP] = (TYPE) (f * rgba[i][RCOMP] + oneMinusF * rFog); \
- rgba[i][GCOMP] = (TYPE) (f * rgba[i][GCOMP] + oneMinusF * gFog); \
- rgba[i][BCOMP] = (TYPE) (f * rgba[i][BCOMP] + oneMinusF * bFog); \
- fogCoord += fogStep; \
- w += wStep; \
- } \
-}
-
-/**
- * Apply fog to a span of RGBA pixels.
- * The fog value are either in the span->array->fog array or interpolated from
- * the fog/fogStep values.
- * They fog values are either fog coordinates (Z) or fog blend factors.
- * _PreferPixelFog should be in sync with that state!
- */
-void
-_swrast_fog_rgba_span( const struct gl_context *ctx, SWspan *span )
-{
- const SWcontext *swrast = CONST_SWRAST_CONTEXT(ctx);
- GLfloat rFog, gFog, bFog;
-
- ASSERT(swrast->_FogEnabled);
- ASSERT(span->arrayMask & SPAN_RGBA);
-
- /* compute (scaled) fog color */
- if (span->array->ChanType == GL_UNSIGNED_BYTE) {
- rFog = ctx->Fog.Color[RCOMP] * 255.0F;
- gFog = ctx->Fog.Color[GCOMP] * 255.0F;
- bFog = ctx->Fog.Color[BCOMP] * 255.0F;
- }
- else if (span->array->ChanType == GL_UNSIGNED_SHORT) {
- rFog = ctx->Fog.Color[RCOMP] * 65535.0F;
- gFog = ctx->Fog.Color[GCOMP] * 65535.0F;
- bFog = ctx->Fog.Color[BCOMP] * 65535.0F;
- }
- else {
- rFog = ctx->Fog.Color[RCOMP];
- gFog = ctx->Fog.Color[GCOMP];
- bFog = ctx->Fog.Color[BCOMP];
- }
-
- if (swrast->_PreferPixelFog) {
- /* The span's fog values are fog coordinates, now compute blend factors
- * and blend the fragment colors with the fog color.
- */
- switch (ctx->Fog.Mode) {
- case GL_LINEAR:
- {
- const GLfloat fogEnd = ctx->Fog.End;
- const GLfloat fogScale = (ctx->Fog.Start == ctx->Fog.End)
- ? 1.0F : 1.0F / (ctx->Fog.End - ctx->Fog.Start);
- if (span->array->ChanType == GL_UNSIGNED_BYTE) {
- GLubyte (*rgba)[4] = span->array->rgba8;
- FOG_LOOP(GLubyte, LINEAR_FOG);
- }
- else if (span->array->ChanType == GL_UNSIGNED_SHORT) {
- GLushort (*rgba)[4] = span->array->rgba16;
- FOG_LOOP(GLushort, LINEAR_FOG);
- }
- else {
- GLfloat (*rgba)[4] = span->array->attribs[FRAG_ATTRIB_COL0];
- ASSERT(span->array->ChanType == GL_FLOAT);
- FOG_LOOP(GLfloat, LINEAR_FOG);
- }
- }
- break;
-
- case GL_EXP:
- {
- const GLfloat density = -ctx->Fog.Density;
- if (span->array->ChanType == GL_UNSIGNED_BYTE) {
- GLubyte (*rgba)[4] = span->array->rgba8;
- FOG_LOOP(GLubyte, EXP_FOG);
- }
- else if (span->array->ChanType == GL_UNSIGNED_SHORT) {
- GLushort (*rgba)[4] = span->array->rgba16;
- FOG_LOOP(GLushort, EXP_FOG);
- }
- else {
- GLfloat (*rgba)[4] = span->array->attribs[FRAG_ATTRIB_COL0];
- ASSERT(span->array->ChanType == GL_FLOAT);
- FOG_LOOP(GLfloat, EXP_FOG);
- }
- }
- break;
-
- case GL_EXP2:
- {
- const GLfloat negDensitySquared = -ctx->Fog.Density * ctx->Fog.Density;
- if (span->array->ChanType == GL_UNSIGNED_BYTE) {
- GLubyte (*rgba)[4] = span->array->rgba8;
- FOG_LOOP(GLubyte, EXP2_FOG);
- }
- else if (span->array->ChanType == GL_UNSIGNED_SHORT) {
- GLushort (*rgba)[4] = span->array->rgba16;
- FOG_LOOP(GLushort, EXP2_FOG);
- }
- else {
- GLfloat (*rgba)[4] = span->array->attribs[FRAG_ATTRIB_COL0];
- ASSERT(span->array->ChanType == GL_FLOAT);
- FOG_LOOP(GLfloat, EXP2_FOG);
- }
- }
- break;
-
- default:
- _mesa_problem(ctx, "Bad fog mode in _swrast_fog_rgba_span");
- return;
- }
- }
- else {
- /* The span's fog start/step/array values are blend factors in [0,1].
- * They were previously computed per-vertex.
- */
- if (span->array->ChanType == GL_UNSIGNED_BYTE) {
- GLubyte (*rgba)[4] = span->array->rgba8;
- FOG_LOOP(GLubyte, BLEND_FOG);
- }
- else if (span->array->ChanType == GL_UNSIGNED_SHORT) {
- GLushort (*rgba)[4] = span->array->rgba16;
- FOG_LOOP(GLushort, BLEND_FOG);
- }
- else {
- GLfloat (*rgba)[4] = span->array->attribs[FRAG_ATTRIB_COL0];
- ASSERT(span->array->ChanType == GL_FLOAT);
- FOG_LOOP(GLfloat, BLEND_FOG);
- }
- }
-}
+/*
+ * Mesa 3-D graphics library
+ * Version: 6.5.2
+ *
+ * Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+
+#include "main/glheader.h"
+#include "main/colormac.h"
+#include "main/macros.h"
+
+#include "s_context.h"
+#include "s_fog.h"
+
+
+/**
+ * Used to convert current raster distance to a fog factor in [0,1].
+ */
+GLfloat
+_swrast_z_to_fogfactor(struct gl_context *ctx, GLfloat z)
+{
+ GLfloat d, f;
+
+ switch (ctx->Fog.Mode) {
+ case GL_LINEAR:
+ if (ctx->Fog.Start == ctx->Fog.End)
+ d = 1.0F;
+ else
+ d = 1.0F / (ctx->Fog.End - ctx->Fog.Start);
+ f = (ctx->Fog.End - z) * d;
+ return CLAMP(f, 0.0F, 1.0F);
+ case GL_EXP:
+ d = ctx->Fog.Density;
+ f = EXPF(-d * z);
+ f = CLAMP(f, 0.0F, 1.0F);
+ return f;
+ case GL_EXP2:
+ d = ctx->Fog.Density;
+ f = EXPF(-(d * d * z * z));
+ f = CLAMP(f, 0.0F, 1.0F);
+ return f;
+ default:
+ _mesa_problem(ctx, "Bad fog mode in _swrast_z_to_fogfactor");
+ return 0.0;
+ }
+}
+
+
+#define LINEAR_FOG(f, coord) f = (fogEnd - coord) * fogScale
+
+#define EXP_FOG(f, coord) f = EXPF(density * coord)
+
+#define EXP2_FOG(f, coord) \
+do { \
+ GLfloat tmp = negDensitySquared * coord * coord; \
+ if (tmp < FLT_MIN_10_EXP) \
+ tmp = FLT_MIN_10_EXP; \
+ f = EXPF(tmp); \
+ } while(0)
+
+
+#define BLEND_FOG(f, coord) f = coord
+
+
+
+/**
+ * Template code for computing fog blend factor and applying it to colors.
+ * \param TYPE either GLubyte, GLushort or GLfloat.
+ * \param COMPUTE_F code to compute the fog blend factor, f.
+ */
+#define FOG_LOOP(TYPE, FOG_FUNC) \
+if (span->arrayAttribs & FRAG_BIT_FOGC) { \
+ GLuint i; \
+ for (i = 0; i < span->end; i++) { \
+ const GLfloat fogCoord = span->array->attribs[FRAG_ATTRIB_FOGC][i][0]; \
+ const GLfloat c = FABSF(fogCoord); \
+ GLfloat f, oneMinusF; \
+ FOG_FUNC(f, c); \
+ f = CLAMP(f, 0.0F, 1.0F); \
+ oneMinusF = 1.0F - f; \
+ rgba[i][RCOMP] = (TYPE) (f * rgba[i][RCOMP] + oneMinusF * rFog); \
+ rgba[i][GCOMP] = (TYPE) (f * rgba[i][GCOMP] + oneMinusF * gFog); \
+ rgba[i][BCOMP] = (TYPE) (f * rgba[i][BCOMP] + oneMinusF * bFog); \
+ } \
+} \
+else { \
+ const GLfloat fogStep = span->attrStepX[FRAG_ATTRIB_FOGC][0]; \
+ GLfloat fogCoord = span->attrStart[FRAG_ATTRIB_FOGC][0]; \
+ const GLfloat wStep = span->attrStepX[FRAG_ATTRIB_WPOS][3]; \
+ GLfloat w = span->attrStart[FRAG_ATTRIB_WPOS][3]; \
+ GLuint i; \
+ for (i = 0; i < span->end; i++) { \
+ const GLfloat c = FABSF(fogCoord) / w; \
+ GLfloat f, oneMinusF; \
+ FOG_FUNC(f, c); \
+ f = CLAMP(f, 0.0F, 1.0F); \
+ oneMinusF = 1.0F - f; \
+ rgba[i][RCOMP] = (TYPE) (f * rgba[i][RCOMP] + oneMinusF * rFog); \
+ rgba[i][GCOMP] = (TYPE) (f * rgba[i][GCOMP] + oneMinusF * gFog); \
+ rgba[i][BCOMP] = (TYPE) (f * rgba[i][BCOMP] + oneMinusF * bFog); \
+ fogCoord += fogStep; \
+ w += wStep; \
+ } \
+}
+
+/**
+ * Apply fog to a span of RGBA pixels.
+ * The fog value are either in the span->array->fog array or interpolated from
+ * the fog/fogStep values.
+ * They fog values are either fog coordinates (Z) or fog blend factors.
+ * _PreferPixelFog should be in sync with that state!
+ */
+void
+_swrast_fog_rgba_span( const struct gl_context *ctx, SWspan *span )
+{
+ const SWcontext *swrast = CONST_SWRAST_CONTEXT(ctx);
+ GLfloat rFog, gFog, bFog;
+
+ ASSERT(swrast->_FogEnabled);
+ ASSERT(span->arrayMask & SPAN_RGBA);
+
+ /* compute (scaled) fog color */
+ if (span->array->ChanType == GL_UNSIGNED_BYTE) {
+ rFog = ctx->Fog.Color[RCOMP] * 255.0F;
+ gFog = ctx->Fog.Color[GCOMP] * 255.0F;
+ bFog = ctx->Fog.Color[BCOMP] * 255.0F;
+ }
+ else if (span->array->ChanType == GL_UNSIGNED_SHORT) {
+ rFog = ctx->Fog.Color[RCOMP] * 65535.0F;
+ gFog = ctx->Fog.Color[GCOMP] * 65535.0F;
+ bFog = ctx->Fog.Color[BCOMP] * 65535.0F;
+ }
+ else {
+ rFog = ctx->Fog.Color[RCOMP];
+ gFog = ctx->Fog.Color[GCOMP];
+ bFog = ctx->Fog.Color[BCOMP];
+ }
+
+ if (swrast->_PreferPixelFog) {
+ /* The span's fog values are fog coordinates, now compute blend factors
+ * and blend the fragment colors with the fog color.
+ */
+ switch (ctx->Fog.Mode) {
+ case GL_LINEAR:
+ {
+ const GLfloat fogEnd = ctx->Fog.End;
+ const GLfloat fogScale = (ctx->Fog.Start == ctx->Fog.End)
+ ? 1.0F : 1.0F / (ctx->Fog.End - ctx->Fog.Start);
+ if (span->array->ChanType == GL_UNSIGNED_BYTE) {
+ GLubyte (*rgba)[4] = span->array->rgba8;
+ FOG_LOOP(GLubyte, LINEAR_FOG);
+ }
+ else if (span->array->ChanType == GL_UNSIGNED_SHORT) {
+ GLushort (*rgba)[4] = span->array->rgba16;
+ FOG_LOOP(GLushort, LINEAR_FOG);
+ }
+ else {
+ GLfloat (*rgba)[4] = span->array->attribs[FRAG_ATTRIB_COL0];
+ ASSERT(span->array->ChanType == GL_FLOAT);
+ FOG_LOOP(GLfloat, LINEAR_FOG);
+ }
+ }
+ break;
+
+ case GL_EXP:
+ {
+ const GLfloat density = -ctx->Fog.Density;
+ if (span->array->ChanType == GL_UNSIGNED_BYTE) {
+ GLubyte (*rgba)[4] = span->array->rgba8;
+ FOG_LOOP(GLubyte, EXP_FOG);
+ }
+ else if (span->array->ChanType == GL_UNSIGNED_SHORT) {
+ GLushort (*rgba)[4] = span->array->rgba16;
+ FOG_LOOP(GLushort, EXP_FOG);
+ }
+ else {
+ GLfloat (*rgba)[4] = span->array->attribs[FRAG_ATTRIB_COL0];
+ ASSERT(span->array->ChanType == GL_FLOAT);
+ FOG_LOOP(GLfloat, EXP_FOG);
+ }
+ }
+ break;
+
+ case GL_EXP2:
+ {
+ const GLfloat negDensitySquared = -ctx->Fog.Density * ctx->Fog.Density;
+ if (span->array->ChanType == GL_UNSIGNED_BYTE) {
+ GLubyte (*rgba)[4] = span->array->rgba8;
+ FOG_LOOP(GLubyte, EXP2_FOG);
+ }
+ else if (span->array->ChanType == GL_UNSIGNED_SHORT) {
+ GLushort (*rgba)[4] = span->array->rgba16;
+ FOG_LOOP(GLushort, EXP2_FOG);
+ }
+ else {
+ GLfloat (*rgba)[4] = span->array->attribs[FRAG_ATTRIB_COL0];
+ ASSERT(span->array->ChanType == GL_FLOAT);
+ FOG_LOOP(GLfloat, EXP2_FOG);
+ }
+ }
+ break;
+
+ default:
+ _mesa_problem(ctx, "Bad fog mode in _swrast_fog_rgba_span");
+ return;
+ }
+ }
+ else {
+ /* The span's fog start/step/array values are blend factors in [0,1].
+ * They were previously computed per-vertex.
+ */
+ if (span->array->ChanType == GL_UNSIGNED_BYTE) {
+ GLubyte (*rgba)[4] = span->array->rgba8;
+ FOG_LOOP(GLubyte, BLEND_FOG);
+ }
+ else if (span->array->ChanType == GL_UNSIGNED_SHORT) {
+ GLushort (*rgba)[4] = span->array->rgba16;
+ FOG_LOOP(GLushort, BLEND_FOG);
+ }
+ else {
+ GLfloat (*rgba)[4] = span->array->attribs[FRAG_ATTRIB_COL0];
+ ASSERT(span->array->ChanType == GL_FLOAT);
+ FOG_LOOP(GLfloat, BLEND_FOG);
+ }
+ }
+}
diff --git a/mesalib/src/mesa/swrast/s_fragprog.c b/mesalib/src/mesa/swrast/s_fragprog.c
index b6bfeaed4..ab411a2f0 100644
--- a/mesalib/src/mesa/swrast/s_fragprog.c
+++ b/mesalib/src/mesa/swrast/s_fragprog.c
@@ -1,277 +1,277 @@
-/*
- * Mesa 3-D graphics library
- * Version: 7.0.3
- *
- * Copyright (C) 1999-2007 Brian Paul All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-#include "main/glheader.h"
-#include "main/colormac.h"
-#include "program/prog_instruction.h"
-
-#include "s_context.h"
-#include "s_fragprog.h"
-#include "s_span.h"
-
-
-/**
- * Apply texture object's swizzle (X/Y/Z/W/0/1) to incoming 'texel'
- * and return results in 'colorOut'.
- */
-static INLINE void
-swizzle_texel(const GLfloat texel[4], GLfloat colorOut[4], GLuint swizzle)
-{
- if (swizzle == SWIZZLE_NOOP) {
- COPY_4V(colorOut, texel);
- }
- else {
- GLfloat vector[6];
- vector[SWIZZLE_X] = texel[0];
- vector[SWIZZLE_Y] = texel[1];
- vector[SWIZZLE_Z] = texel[2];
- vector[SWIZZLE_W] = texel[3];
- vector[SWIZZLE_ZERO] = 0.0F;
- vector[SWIZZLE_ONE] = 1.0F;
- colorOut[0] = vector[GET_SWZ(swizzle, 0)];
- colorOut[1] = vector[GET_SWZ(swizzle, 1)];
- colorOut[2] = vector[GET_SWZ(swizzle, 2)];
- colorOut[3] = vector[GET_SWZ(swizzle, 3)];
- }
-}
-
-
-/**
- * Fetch a texel with given lod.
- * Called via machine->FetchTexelLod()
- */
-static void
-fetch_texel_lod( struct gl_context *ctx, const GLfloat texcoord[4], GLfloat lambda,
- GLuint unit, GLfloat color[4] )
-{
- const struct gl_texture_object *texObj = ctx->Texture.Unit[unit]._Current;
-
- if (texObj) {
- SWcontext *swrast = SWRAST_CONTEXT(ctx);
- GLfloat rgba[4];
-
- lambda = CLAMP(lambda, texObj->Sampler.MinLod, texObj->Sampler.MaxLod);
-
- swrast->TextureSample[unit](ctx, texObj, 1,
- (const GLfloat (*)[4]) texcoord,
- &lambda, &rgba);
- swizzle_texel(rgba, color, texObj->_Swizzle);
- }
- else {
- ASSIGN_4V(color, 0.0F, 0.0F, 0.0F, 1.0F);
- }
-}
-
-
-/**
- * Fetch a texel with the given partial derivatives to compute a level
- * of detail in the mipmap.
- * Called via machine->FetchTexelDeriv()
- * \param lodBias the lod bias which may be specified by a TXB instruction,
- * otherwise zero.
- */
-static void
-fetch_texel_deriv( struct gl_context *ctx, const GLfloat texcoord[4],
- const GLfloat texdx[4], const GLfloat texdy[4],
- GLfloat lodBias, GLuint unit, GLfloat color[4] )
-{
- SWcontext *swrast = SWRAST_CONTEXT(ctx);
- const struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit];
- const struct gl_texture_object *texObj = texUnit->_Current;
-
- if (texObj) {
- const struct gl_texture_image *texImg =
- texObj->Image[0][texObj->BaseLevel];
- const GLfloat texW = (GLfloat) texImg->WidthScale;
- const GLfloat texH = (GLfloat) texImg->HeightScale;
- GLfloat lambda;
- GLfloat rgba[4];
-
- lambda = _swrast_compute_lambda(texdx[0], texdy[0], /* ds/dx, ds/dy */
- texdx[1], texdy[1], /* dt/dx, dt/dy */
- texdx[3], texdy[3], /* dq/dx, dq/dy */
- texW, texH,
- texcoord[0], texcoord[1], texcoord[3],
- 1.0F / texcoord[3]);
-
- lambda += lodBias + texUnit->LodBias + texObj->Sampler.LodBias;
-
- lambda = CLAMP(lambda, texObj->Sampler.MinLod, texObj->Sampler.MaxLod);
-
- swrast->TextureSample[unit](ctx, texObj, 1,
- (const GLfloat (*)[4]) texcoord,
- &lambda, &rgba);
- swizzle_texel(rgba, color, texObj->_Swizzle);
- }
- else {
- ASSIGN_4V(color, 0.0F, 0.0F, 0.0F, 1.0F);
- }
-}
-
-
-/**
- * Initialize the virtual fragment program machine state prior to running
- * fragment program on a fragment. This involves initializing the input
- * registers, condition codes, etc.
- * \param machine the virtual machine state to init
- * \param program the fragment program we're about to run
- * \param span the span of pixels we'll operate on
- * \param col which element (column) of the span we'll operate on
- */
-static void
-init_machine(struct gl_context *ctx, struct gl_program_machine *machine,
- const struct gl_fragment_program *program,
- const SWspan *span, GLuint col)
-{
- GLfloat *wpos = span->array->attribs[FRAG_ATTRIB_WPOS][col];
-
- if (program->Base.Target == GL_FRAGMENT_PROGRAM_NV) {
- /* Clear temporary registers (undefined for ARB_f_p) */
- memset(machine->Temporaries, 0, MAX_PROGRAM_TEMPS * 4 * sizeof(GLfloat));
- }
-
- /* ARB_fragment_coord_conventions */
- if (program->OriginUpperLeft)
- wpos[1] = ctx->DrawBuffer->Height - 1 - wpos[1];
- if (!program->PixelCenterInteger) {
- wpos[0] += 0.5F;
- wpos[1] += 0.5F;
- }
-
- /* Setup pointer to input attributes */
- machine->Attribs = span->array->attribs;
-
- machine->DerivX = (GLfloat (*)[4]) span->attrStepX;
- machine->DerivY = (GLfloat (*)[4]) span->attrStepY;
- machine->NumDeriv = FRAG_ATTRIB_MAX;
-
- machine->Samplers = program->Base.SamplerUnits;
-
- /* if running a GLSL program (not ARB_fragment_program) */
- if (ctx->Shader.CurrentFragmentProgram) {
- /* Store front/back facing value */
- machine->Attribs[FRAG_ATTRIB_FACE][col][0] = 1.0F - span->facing;
- }
-
- machine->CurElement = col;
-
- /* init condition codes */
- machine->CondCodes[0] = COND_EQ;
- machine->CondCodes[1] = COND_EQ;
- machine->CondCodes[2] = COND_EQ;
- machine->CondCodes[3] = COND_EQ;
-
- /* init call stack */
- machine->StackDepth = 0;
-
- machine->FetchTexelLod = fetch_texel_lod;
- machine->FetchTexelDeriv = fetch_texel_deriv;
-}
-
-
-/**
- * Run fragment program on the pixels in span from 'start' to 'end' - 1.
- */
-static void
-run_program(struct gl_context *ctx, SWspan *span, GLuint start, GLuint end)
-{
- SWcontext *swrast = SWRAST_CONTEXT(ctx);
- const struct gl_fragment_program *program = ctx->FragmentProgram._Current;
- const GLbitfield64 outputsWritten = program->Base.OutputsWritten;
- struct gl_program_machine *machine = &swrast->FragProgMachine;
- GLuint i;
-
- for (i = start; i < end; i++) {
- if (span->array->mask[i]) {
- init_machine(ctx, machine, program, span, i);
-
- if (_mesa_execute_program(ctx, &program->Base, machine)) {
-
- /* Store result color */
- if (outputsWritten & BITFIELD64_BIT(FRAG_RESULT_COLOR)) {
- COPY_4V(span->array->attribs[FRAG_ATTRIB_COL0][i],
- machine->Outputs[FRAG_RESULT_COLOR]);
- }
- else {
- /* Multiple drawbuffers / render targets
- * Note that colors beyond 0 and 1 will overwrite other
- * attributes, such as FOGC, TEX0, TEX1, etc. That's OK.
- */
- GLuint buf;
- for (buf = 0; buf < ctx->DrawBuffer->_NumColorDrawBuffers; buf++) {
- if (outputsWritten & BITFIELD64_BIT(FRAG_RESULT_DATA0 + buf)) {
- COPY_4V(span->array->attribs[FRAG_ATTRIB_COL0 + buf][i],
- machine->Outputs[FRAG_RESULT_DATA0 + buf]);
- }
- }
- }
-
- /* Store result depth/z */
- if (outputsWritten & BITFIELD64_BIT(FRAG_RESULT_DEPTH)) {
- const GLfloat depth = machine->Outputs[FRAG_RESULT_DEPTH][2];
- if (depth <= 0.0)
- span->array->z[i] = 0;
- else if (depth >= 1.0)
- span->array->z[i] = ctx->DrawBuffer->_DepthMax;
- else
- span->array->z[i] = IROUND(depth * ctx->DrawBuffer->_DepthMaxF);
- }
- }
- else {
- /* killed fragment */
- span->array->mask[i] = GL_FALSE;
- span->writeAll = GL_FALSE;
- }
- }
- }
-}
-
-
-/**
- * Execute the current fragment program for all the fragments
- * in the given span.
- */
-void
-_swrast_exec_fragment_program( struct gl_context *ctx, SWspan *span )
-{
- const struct gl_fragment_program *program = ctx->FragmentProgram._Current;
-
- /* incoming colors should be floats */
- if (program->Base.InputsRead & FRAG_BIT_COL0) {
- ASSERT(span->array->ChanType == GL_FLOAT);
- }
-
- run_program(ctx, span, 0, span->end);
-
- if (program->Base.OutputsWritten & BITFIELD64_BIT(FRAG_RESULT_COLOR)) {
- span->interpMask &= ~SPAN_RGBA;
- span->arrayMask |= SPAN_RGBA;
- }
-
- if (program->Base.OutputsWritten & BITFIELD64_BIT(FRAG_RESULT_DEPTH)) {
- span->interpMask &= ~SPAN_Z;
- span->arrayMask |= SPAN_Z;
- }
-}
-
+/*
+ * Mesa 3-D graphics library
+ * Version: 7.0.3
+ *
+ * Copyright (C) 1999-2007 Brian Paul All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+#include "main/glheader.h"
+#include "main/colormac.h"
+#include "program/prog_instruction.h"
+
+#include "s_context.h"
+#include "s_fragprog.h"
+#include "s_span.h"
+
+
+/**
+ * Apply texture object's swizzle (X/Y/Z/W/0/1) to incoming 'texel'
+ * and return results in 'colorOut'.
+ */
+static INLINE void
+swizzle_texel(const GLfloat texel[4], GLfloat colorOut[4], GLuint swizzle)
+{
+ if (swizzle == SWIZZLE_NOOP) {
+ COPY_4V(colorOut, texel);
+ }
+ else {
+ GLfloat vector[6];
+ vector[SWIZZLE_X] = texel[0];
+ vector[SWIZZLE_Y] = texel[1];
+ vector[SWIZZLE_Z] = texel[2];
+ vector[SWIZZLE_W] = texel[3];
+ vector[SWIZZLE_ZERO] = 0.0F;
+ vector[SWIZZLE_ONE] = 1.0F;
+ colorOut[0] = vector[GET_SWZ(swizzle, 0)];
+ colorOut[1] = vector[GET_SWZ(swizzle, 1)];
+ colorOut[2] = vector[GET_SWZ(swizzle, 2)];
+ colorOut[3] = vector[GET_SWZ(swizzle, 3)];
+ }
+}
+
+
+/**
+ * Fetch a texel with given lod.
+ * Called via machine->FetchTexelLod()
+ */
+static void
+fetch_texel_lod( struct gl_context *ctx, const GLfloat texcoord[4], GLfloat lambda,
+ GLuint unit, GLfloat color[4] )
+{
+ const struct gl_texture_object *texObj = ctx->Texture.Unit[unit]._Current;
+
+ if (texObj) {
+ SWcontext *swrast = SWRAST_CONTEXT(ctx);
+ GLfloat rgba[4];
+
+ lambda = CLAMP(lambda, texObj->Sampler.MinLod, texObj->Sampler.MaxLod);
+
+ swrast->TextureSample[unit](ctx, texObj, 1,
+ (const GLfloat (*)[4]) texcoord,
+ &lambda, &rgba);
+ swizzle_texel(rgba, color, texObj->_Swizzle);
+ }
+ else {
+ ASSIGN_4V(color, 0.0F, 0.0F, 0.0F, 1.0F);
+ }
+}
+
+
+/**
+ * Fetch a texel with the given partial derivatives to compute a level
+ * of detail in the mipmap.
+ * Called via machine->FetchTexelDeriv()
+ * \param lodBias the lod bias which may be specified by a TXB instruction,
+ * otherwise zero.
+ */
+static void
+fetch_texel_deriv( struct gl_context *ctx, const GLfloat texcoord[4],
+ const GLfloat texdx[4], const GLfloat texdy[4],
+ GLfloat lodBias, GLuint unit, GLfloat color[4] )
+{
+ SWcontext *swrast = SWRAST_CONTEXT(ctx);
+ const struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit];
+ const struct gl_texture_object *texObj = texUnit->_Current;
+
+ if (texObj) {
+ const struct gl_texture_image *texImg =
+ texObj->Image[0][texObj->BaseLevel];
+ const GLfloat texW = (GLfloat) texImg->WidthScale;
+ const GLfloat texH = (GLfloat) texImg->HeightScale;
+ GLfloat lambda;
+ GLfloat rgba[4];
+
+ lambda = _swrast_compute_lambda(texdx[0], texdy[0], /* ds/dx, ds/dy */
+ texdx[1], texdy[1], /* dt/dx, dt/dy */
+ texdx[3], texdy[3], /* dq/dx, dq/dy */
+ texW, texH,
+ texcoord[0], texcoord[1], texcoord[3],
+ 1.0F / texcoord[3]);
+
+ lambda += lodBias + texUnit->LodBias + texObj->Sampler.LodBias;
+
+ lambda = CLAMP(lambda, texObj->Sampler.MinLod, texObj->Sampler.MaxLod);
+
+ swrast->TextureSample[unit](ctx, texObj, 1,
+ (const GLfloat (*)[4]) texcoord,
+ &lambda, &rgba);
+ swizzle_texel(rgba, color, texObj->_Swizzle);
+ }
+ else {
+ ASSIGN_4V(color, 0.0F, 0.0F, 0.0F, 1.0F);
+ }
+}
+
+
+/**
+ * Initialize the virtual fragment program machine state prior to running
+ * fragment program on a fragment. This involves initializing the input
+ * registers, condition codes, etc.
+ * \param machine the virtual machine state to init
+ * \param program the fragment program we're about to run
+ * \param span the span of pixels we'll operate on
+ * \param col which element (column) of the span we'll operate on
+ */
+static void
+init_machine(struct gl_context *ctx, struct gl_program_machine *machine,
+ const struct gl_fragment_program *program,
+ const SWspan *span, GLuint col)
+{
+ GLfloat *wpos = span->array->attribs[FRAG_ATTRIB_WPOS][col];
+
+ if (program->Base.Target == GL_FRAGMENT_PROGRAM_NV) {
+ /* Clear temporary registers (undefined for ARB_f_p) */
+ memset(machine->Temporaries, 0, MAX_PROGRAM_TEMPS * 4 * sizeof(GLfloat));
+ }
+
+ /* ARB_fragment_coord_conventions */
+ if (program->OriginUpperLeft)
+ wpos[1] = ctx->DrawBuffer->Height - 1 - wpos[1];
+ if (!program->PixelCenterInteger) {
+ wpos[0] += 0.5F;
+ wpos[1] += 0.5F;
+ }
+
+ /* Setup pointer to input attributes */
+ machine->Attribs = span->array->attribs;
+
+ machine->DerivX = (GLfloat (*)[4]) span->attrStepX;
+ machine->DerivY = (GLfloat (*)[4]) span->attrStepY;
+ machine->NumDeriv = FRAG_ATTRIB_MAX;
+
+ machine->Samplers = program->Base.SamplerUnits;
+
+ /* if running a GLSL program (not ARB_fragment_program) */
+ if (ctx->Shader.CurrentFragmentProgram) {
+ /* Store front/back facing value */
+ machine->Attribs[FRAG_ATTRIB_FACE][col][0] = 1.0F - span->facing;
+ }
+
+ machine->CurElement = col;
+
+ /* init condition codes */
+ machine->CondCodes[0] = COND_EQ;
+ machine->CondCodes[1] = COND_EQ;
+ machine->CondCodes[2] = COND_EQ;
+ machine->CondCodes[3] = COND_EQ;
+
+ /* init call stack */
+ machine->StackDepth = 0;
+
+ machine->FetchTexelLod = fetch_texel_lod;
+ machine->FetchTexelDeriv = fetch_texel_deriv;
+}
+
+
+/**
+ * Run fragment program on the pixels in span from 'start' to 'end' - 1.
+ */
+static void
+run_program(struct gl_context *ctx, SWspan *span, GLuint start, GLuint end)
+{
+ SWcontext *swrast = SWRAST_CONTEXT(ctx);
+ const struct gl_fragment_program *program = ctx->FragmentProgram._Current;
+ const GLbitfield64 outputsWritten = program->Base.OutputsWritten;
+ struct gl_program_machine *machine = &swrast->FragProgMachine;
+ GLuint i;
+
+ for (i = start; i < end; i++) {
+ if (span->array->mask[i]) {
+ init_machine(ctx, machine, program, span, i);
+
+ if (_mesa_execute_program(ctx, &program->Base, machine)) {
+
+ /* Store result color */
+ if (outputsWritten & BITFIELD64_BIT(FRAG_RESULT_COLOR)) {
+ COPY_4V(span->array->attribs[FRAG_ATTRIB_COL0][i],
+ machine->Outputs[FRAG_RESULT_COLOR]);
+ }
+ else {
+ /* Multiple drawbuffers / render targets
+ * Note that colors beyond 0 and 1 will overwrite other
+ * attributes, such as FOGC, TEX0, TEX1, etc. That's OK.
+ */
+ GLuint buf;
+ for (buf = 0; buf < ctx->DrawBuffer->_NumColorDrawBuffers; buf++) {
+ if (outputsWritten & BITFIELD64_BIT(FRAG_RESULT_DATA0 + buf)) {
+ COPY_4V(span->array->attribs[FRAG_ATTRIB_COL0 + buf][i],
+ machine->Outputs[FRAG_RESULT_DATA0 + buf]);
+ }
+ }
+ }
+
+ /* Store result depth/z */
+ if (outputsWritten & BITFIELD64_BIT(FRAG_RESULT_DEPTH)) {
+ const GLfloat depth = machine->Outputs[FRAG_RESULT_DEPTH][2];
+ if (depth <= 0.0)
+ span->array->z[i] = 0;
+ else if (depth >= 1.0)
+ span->array->z[i] = ctx->DrawBuffer->_DepthMax;
+ else
+ span->array->z[i] = IROUND(depth * ctx->DrawBuffer->_DepthMaxF);
+ }
+ }
+ else {
+ /* killed fragment */
+ span->array->mask[i] = GL_FALSE;
+ span->writeAll = GL_FALSE;
+ }
+ }
+ }
+}
+
+
+/**
+ * Execute the current fragment program for all the fragments
+ * in the given span.
+ */
+void
+_swrast_exec_fragment_program( struct gl_context *ctx, SWspan *span )
+{
+ const struct gl_fragment_program *program = ctx->FragmentProgram._Current;
+
+ /* incoming colors should be floats */
+ if (program->Base.InputsRead & FRAG_BIT_COL0) {
+ ASSERT(span->array->ChanType == GL_FLOAT);
+ }
+
+ run_program(ctx, span, 0, span->end);
+
+ if (program->Base.OutputsWritten & BITFIELD64_BIT(FRAG_RESULT_COLOR)) {
+ span->interpMask &= ~SPAN_RGBA;
+ span->arrayMask |= SPAN_RGBA;
+ }
+
+ if (program->Base.OutputsWritten & BITFIELD64_BIT(FRAG_RESULT_DEPTH)) {
+ span->interpMask &= ~SPAN_Z;
+ span->arrayMask |= SPAN_Z;
+ }
+}
+
diff --git a/mesalib/src/mesa/swrast/s_readpix.c b/mesalib/src/mesa/swrast/s_readpix.c
index 214f2ea1a..59fb04a98 100644
--- a/mesalib/src/mesa/swrast/s_readpix.c
+++ b/mesalib/src/mesa/swrast/s_readpix.c
@@ -1,514 +1,514 @@
-/*
- * Mesa 3-D graphics library
- * Version: 7.0.3
- *
- * Copyright (C) 1999-2007 Brian Paul All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-
-#include "main/glheader.h"
-#include "main/colormac.h"
-#include "main/feedback.h"
-#include "main/formats.h"
-#include "main/image.h"
-#include "main/imports.h"
-#include "main/macros.h"
-#include "main/pack.h"
-#include "main/pbo.h"
-#include "main/state.h"
-
-#include "s_context.h"
-#include "s_depth.h"
-#include "s_span.h"
-#include "s_stencil.h"
-
-
-/**
- * Read pixels for format=GL_DEPTH_COMPONENT.
- */
-static void
-read_depth_pixels( struct gl_context *ctx,
- GLint x, GLint y,
- GLsizei width, GLsizei height,
- GLenum type, GLvoid *pixels,
- const struct gl_pixelstore_attrib *packing )
-{
- struct gl_framebuffer *fb = ctx->ReadBuffer;
- struct gl_renderbuffer *rb = fb->_DepthBuffer;
- const GLboolean biasOrScale
- = ctx->Pixel.DepthScale != 1.0 || ctx->Pixel.DepthBias != 0.0;
-
- if (!rb)
- return;
-
- /* clipping should have been done already */
- ASSERT(x >= 0);
- ASSERT(y >= 0);
- ASSERT(x + width <= (GLint) rb->Width);
- ASSERT(y + height <= (GLint) rb->Height);
- /* width should never be > MAX_WIDTH since we did clipping earlier */
- ASSERT(width <= MAX_WIDTH);
-
- if (type == GL_UNSIGNED_SHORT && fb->Visual.depthBits == 16
- && !biasOrScale && !packing->SwapBytes) {
- /* Special case: directly read 16-bit unsigned depth values. */
- GLint j;
- ASSERT(rb->Format == MESA_FORMAT_Z16);
- ASSERT(rb->DataType == GL_UNSIGNED_SHORT);
- for (j = 0; j < height; j++, y++) {
- void *dest =_mesa_image_address2d(packing, pixels, width, height,
- GL_DEPTH_COMPONENT, type, j, 0);
- rb->GetRow(ctx, rb, width, x, y, dest);
- }
- }
- else if (type == GL_UNSIGNED_INT && fb->Visual.depthBits == 24
- && !biasOrScale && !packing->SwapBytes) {
- /* Special case: directly read 24-bit unsigned depth values. */
- GLint j;
- ASSERT(rb->Format == MESA_FORMAT_X8_Z24 ||
- rb->Format == MESA_FORMAT_S8_Z24 ||
- rb->Format == MESA_FORMAT_Z24_X8 ||
- rb->Format == MESA_FORMAT_Z24_S8);
- ASSERT(rb->DataType == GL_UNSIGNED_INT ||
- rb->DataType == GL_UNSIGNED_INT_24_8);
- for (j = 0; j < height; j++, y++) {
- GLuint *dest = (GLuint *)
- _mesa_image_address2d(packing, pixels, width, height,
- GL_DEPTH_COMPONENT, type, j, 0);
- GLint k;
- rb->GetRow(ctx, rb, width, x, y, dest);
- /* convert range from 24-bit to 32-bit */
- if (rb->Format == MESA_FORMAT_X8_Z24 ||
- rb->Format == MESA_FORMAT_S8_Z24) {
- for (k = 0; k < width; k++) {
- /* Note: put MSByte of 24-bit value into LSByte */
- dest[k] = (dest[k] << 8) | ((dest[k] >> 16) & 0xff);
- }
- }
- else {
- for (k = 0; k < width; k++) {
- /* Note: fill in LSByte by replication */
- dest[k] = dest[k] | ((dest[k] >> 8) & 0xff);
- }
- }
- }
- }
- else if (type == GL_UNSIGNED_INT && fb->Visual.depthBits == 32
- && !biasOrScale && !packing->SwapBytes) {
- /* Special case: directly read 32-bit unsigned depth values. */
- GLint j;
- ASSERT(rb->Format == MESA_FORMAT_Z32);
- ASSERT(rb->DataType == GL_UNSIGNED_INT);
- for (j = 0; j < height; j++, y++) {
- void *dest = _mesa_image_address2d(packing, pixels, width, height,
- GL_DEPTH_COMPONENT, type, j, 0);
- rb->GetRow(ctx, rb, width, x, y, dest);
- }
- }
- else {
- /* General case (slower) */
- GLint j;
- for (j = 0; j < height; j++, y++) {
- GLfloat depthValues[MAX_WIDTH];
- GLvoid *dest = _mesa_image_address2d(packing, pixels, width, height,
- GL_DEPTH_COMPONENT, type, j, 0);
- _swrast_read_depth_span_float(ctx, rb, width, x, y, depthValues);
- _mesa_pack_depth_span(ctx, width, dest, type, depthValues, packing);
- }
- }
-}
-
-
-/**
- * Read pixels for format=GL_STENCIL_INDEX.
- */
-static void
-read_stencil_pixels( struct gl_context *ctx,
- GLint x, GLint y,
- GLsizei width, GLsizei height,
- GLenum type, GLvoid *pixels,
- const struct gl_pixelstore_attrib *packing )
-{
- struct gl_framebuffer *fb = ctx->ReadBuffer;
- struct gl_renderbuffer *rb = fb->_StencilBuffer;
- GLint j;
-
- if (!rb)
- return;
-
- /* width should never be > MAX_WIDTH since we did clipping earlier */
- ASSERT(width <= MAX_WIDTH);
-
- /* process image row by row */
- for (j=0;j<height;j++,y++) {
- GLvoid *dest;
- GLstencil stencil[MAX_WIDTH];
-
- _swrast_read_stencil_span(ctx, rb, width, x, y, stencil);
-
- dest = _mesa_image_address2d(packing, pixels, width, height,
- GL_STENCIL_INDEX, type, j, 0);
-
- _mesa_pack_stencil_span(ctx, width, type, dest, stencil, packing);
- }
-}
-
-
-
-/**
- * Optimized glReadPixels for particular pixel formats when pixel
- * scaling, biasing, mapping, etc. are disabled.
- * \return GL_TRUE if success, GL_FALSE if unable to do the readpixels
- */
-static GLboolean
-fast_read_rgba_pixels( struct gl_context *ctx,
- GLint x, GLint y,
- GLsizei width, GLsizei height,
- GLenum format, GLenum type,
- GLvoid *pixels,
- const struct gl_pixelstore_attrib *packing,
- GLbitfield transferOps)
-{
- struct gl_renderbuffer *rb = ctx->ReadBuffer->_ColorReadBuffer;
-
- if (!rb)
- return GL_FALSE;
-
- ASSERT(rb->_BaseFormat == GL_RGBA ||
- rb->_BaseFormat == GL_RGB ||
- rb->_BaseFormat == GL_RG ||
- rb->_BaseFormat == GL_RED ||
- rb->_BaseFormat == GL_LUMINANCE ||
- rb->_BaseFormat == GL_INTENSITY ||
- rb->_BaseFormat == GL_LUMINANCE_ALPHA ||
- rb->_BaseFormat == GL_ALPHA);
-
- /* clipping should have already been done */
- ASSERT(x + width <= (GLint) rb->Width);
- ASSERT(y + height <= (GLint) rb->Height);
-
- /* check for things we can't handle here */
- if (transferOps ||
- packing->SwapBytes ||
- packing->LsbFirst) {
- return GL_FALSE;
- }
-
- if (format == GL_RGBA && rb->DataType == type) {
- const GLint dstStride = _mesa_image_row_stride(packing, width,
- format, type);
- GLubyte *dest
- = (GLubyte *) _mesa_image_address2d(packing, pixels, width, height,
- format, type, 0, 0);
- GLint row;
- ASSERT(rb->GetRow);
- for (row = 0; row < height; row++) {
- rb->GetRow(ctx, rb, width, x, y + row, dest);
- dest += dstStride;
- }
- return GL_TRUE;
- }
-
- if (format == GL_RGB &&
- rb->DataType == GL_UNSIGNED_BYTE &&
- type == GL_UNSIGNED_BYTE) {
- const GLint dstStride = _mesa_image_row_stride(packing, width,
- format, type);
- GLubyte *dest
- = (GLubyte *) _mesa_image_address2d(packing, pixels, width, height,
- format, type, 0, 0);
- GLint row;
- ASSERT(rb->GetRow);
- for (row = 0; row < height; row++) {
- GLubyte tempRow[MAX_WIDTH][4];
- GLint col;
- rb->GetRow(ctx, rb, width, x, y + row, tempRow);
- /* convert RGBA to RGB */
- for (col = 0; col < width; col++) {
- dest[col * 3 + 0] = tempRow[col][0];
- dest[col * 3 + 1] = tempRow[col][1];
- dest[col * 3 + 2] = tempRow[col][2];
- }
- dest += dstStride;
- }
- return GL_TRUE;
- }
-
- /* not handled */
- return GL_FALSE;
-}
-
-
-/**
- * When we're using a low-precision color buffer (like 16-bit 5/6/5)
- * we have to adjust our color values a bit to pass conformance.
- * The problem is when a 5 or 6-bit color value is converted to an 8-bit
- * value and then a floating point value, the floating point values don't
- * increment uniformly as the 5 or 6-bit value is incremented.
- *
- * This function adjusts floating point values to compensate.
- */
-static void
-adjust_colors(const struct gl_framebuffer *fb, GLuint n, GLfloat rgba[][4])
-{
- const GLuint rShift = 8 - fb->Visual.redBits;
- const GLuint gShift = 8 - fb->Visual.greenBits;
- const GLuint bShift = 8 - fb->Visual.blueBits;
- GLfloat rScale = 1.0F / (GLfloat) ((1 << fb->Visual.redBits ) - 1);
- GLfloat gScale = 1.0F / (GLfloat) ((1 << fb->Visual.greenBits) - 1);
- GLfloat bScale = 1.0F / (GLfloat) ((1 << fb->Visual.blueBits ) - 1);
- GLuint i;
-
- if (fb->Visual.redBits == 0)
- rScale = 0;
- if (fb->Visual.greenBits == 0)
- gScale = 0;
- if (fb->Visual.blueBits == 0)
- bScale = 0;
-
- for (i = 0; i < n; i++) {
- GLint r, g, b;
- /* convert float back to ubyte */
- CLAMPED_FLOAT_TO_UBYTE(r, rgba[i][RCOMP]);
- CLAMPED_FLOAT_TO_UBYTE(g, rgba[i][GCOMP]);
- CLAMPED_FLOAT_TO_UBYTE(b, rgba[i][BCOMP]);
- /* using only the N most significant bits of the ubyte value, convert to
- * float in [0,1].
- */
- rgba[i][RCOMP] = (GLfloat) (r >> rShift) * rScale;
- rgba[i][GCOMP] = (GLfloat) (g >> gShift) * gScale;
- rgba[i][BCOMP] = (GLfloat) (b >> bShift) * bScale;
- }
-}
-
-
-
-/*
- * Read R, G, B, A, RGB, L, or LA pixels.
- */
-static void
-read_rgba_pixels( struct gl_context *ctx,
- GLint x, GLint y,
- GLsizei width, GLsizei height,
- GLenum format, GLenum type, GLvoid *pixels,
- const struct gl_pixelstore_attrib *packing )
-{
- SWcontext *swrast = SWRAST_CONTEXT(ctx);
- GLbitfield transferOps = ctx->_ImageTransferState;
- struct gl_framebuffer *fb = ctx->ReadBuffer;
- struct gl_renderbuffer *rb = fb->_ColorReadBuffer;
-
- if (!rb)
- return;
-
- if ((ctx->Color._ClampReadColor == GL_TRUE || type != GL_FLOAT) &&
- !_mesa_is_integer_format(format)) {
- transferOps |= IMAGE_CLAMP_BIT;
- }
-
- /* Try the optimized path first. */
- if (fast_read_rgba_pixels(ctx, x, y, width, height,
- format, type, pixels, packing, transferOps)) {
- return; /* done! */
- }
-
- /* width should never be > MAX_WIDTH since we did clipping earlier */
- ASSERT(width <= MAX_WIDTH);
-
- do {
- const GLint dstStride
- = _mesa_image_row_stride(packing, width, format, type);
- GLfloat (*rgba)[4] = swrast->SpanArrays->attribs[FRAG_ATTRIB_COL0];
- GLint row;
- GLubyte *dst
- = (GLubyte *) _mesa_image_address2d(packing, pixels, width, height,
- format, type, 0, 0);
-
- for (row = 0; row < height; row++, y++) {
-
- /* Get float rgba pixels */
- _swrast_read_rgba_span(ctx, rb, width, x, y, GL_FLOAT, rgba);
-
- /* apply fudge factor for shallow color buffers */
- if ((fb->Visual.redBits < 8 && fb->Visual.redBits != 0) ||
- (fb->Visual.greenBits < 8 && fb->Visual.greenBits != 0) ||
- (fb->Visual.blueBits < 8 && fb->Visual.blueBits != 0)) {
- adjust_colors(fb, width, rgba);
- }
-
- /* pack the row of RGBA pixels into user's buffer */
- _mesa_pack_rgba_span_float(ctx, width, rgba, format, type, dst,
- packing, transferOps);
-
- dst += dstStride;
- }
- } while (0);
-}
-
-
-/**
- * Read combined depth/stencil values.
- * We'll have already done error checking to be sure the expected
- * depth and stencil buffers really exist.
- */
-static void
-read_depth_stencil_pixels(struct gl_context *ctx,
- GLint x, GLint y,
- GLsizei width, GLsizei height,
- GLenum type, GLvoid *pixels,
- const struct gl_pixelstore_attrib *packing )
-{
- const GLboolean scaleOrBias
- = ctx->Pixel.DepthScale != 1.0 || ctx->Pixel.DepthBias != 0.0;
- const GLboolean stencilTransfer = ctx->Pixel.IndexShift
- || ctx->Pixel.IndexOffset || ctx->Pixel.MapStencilFlag;
- struct gl_renderbuffer *depthRb, *stencilRb;
-
- depthRb = ctx->ReadBuffer->_DepthBuffer;
- stencilRb = ctx->ReadBuffer->_StencilBuffer;
-
- if (!depthRb || !stencilRb)
- return;
-
- depthRb = ctx->ReadBuffer->Attachment[BUFFER_DEPTH].Renderbuffer;
- stencilRb = ctx->ReadBuffer->Attachment[BUFFER_STENCIL].Renderbuffer;
-
- if (depthRb->_BaseFormat == GL_DEPTH_STENCIL_EXT &&
- stencilRb->_BaseFormat == GL_DEPTH_STENCIL_EXT &&
- depthRb == stencilRb &&
- !scaleOrBias &&
- !stencilTransfer) {
- /* This is the ideal case.
- * Reading GL_DEPTH_STENCIL pixels from combined depth/stencil buffer.
- * Plus, no pixel transfer ops to worry about!
- */
- GLint i;
- GLint dstStride = _mesa_image_row_stride(packing, width,
- GL_DEPTH_STENCIL_EXT, type);
- GLubyte *dst = (GLubyte *) _mesa_image_address2d(packing, pixels,
- width, height,
- GL_DEPTH_STENCIL_EXT,
- type, 0, 0);
- for (i = 0; i < height; i++) {
- depthRb->GetRow(ctx, depthRb, width, x, y + i, dst);
- dst += dstStride;
- }
- }
- else {
- /* Reading GL_DEPTH_STENCIL pixels from separate depth/stencil buffers,
- * or we need pixel transfer.
- */
- GLint i;
- depthRb = ctx->ReadBuffer->_DepthBuffer;
- stencilRb = ctx->ReadBuffer->_StencilBuffer;
-
- for (i = 0; i < height; i++) {
- GLstencil stencilVals[MAX_WIDTH];
-
- GLuint *depthStencilDst = (GLuint *)
- _mesa_image_address2d(packing, pixels, width, height,
- GL_DEPTH_STENCIL_EXT, type, i, 0);
-
- _swrast_read_stencil_span(ctx, stencilRb, width,
- x, y + i, stencilVals);
-
- if (!scaleOrBias && !stencilTransfer
- && ctx->ReadBuffer->Visual.depthBits == 24) {
- /* ideal case */
- GLuint zVals[MAX_WIDTH]; /* 24-bit values! */
- GLint j;
- ASSERT(depthRb->DataType == GL_UNSIGNED_INT);
- /* note, we've already been clipped */
- depthRb->GetRow(ctx, depthRb, width, x, y + i, zVals);
- for (j = 0; j < width; j++) {
- depthStencilDst[j] = (zVals[j] << 8) | (stencilVals[j] & 0xff);
- }
- }
- else {
- /* general case */
- GLfloat depthVals[MAX_WIDTH];
- _swrast_read_depth_span_float(ctx, depthRb, width, x, y + i,
- depthVals);
- _mesa_pack_depth_stencil_span(ctx, width, depthStencilDst,
- depthVals, stencilVals, packing);
- }
- }
- }
-}
-
-
-
-/**
- * Software fallback routine for ctx->Driver.ReadPixels().
- * By time we get here, all error checking will have been done.
- */
-void
-_swrast_ReadPixels( struct gl_context *ctx,
- GLint x, GLint y, GLsizei width, GLsizei height,
- GLenum format, GLenum type,
- const struct gl_pixelstore_attrib *packing,
- GLvoid *pixels )
-{
- SWcontext *swrast = SWRAST_CONTEXT(ctx);
- struct gl_pixelstore_attrib clippedPacking = *packing;
-
- if (ctx->NewState)
- _mesa_update_state(ctx);
-
- /* Need to do swrast_render_start() before clipping or anything else
- * since this is where a driver may grab the hw lock and get an updated
- * window size.
- */
- swrast_render_start(ctx);
-
- if (swrast->NewState)
- _swrast_validate_derived( ctx );
-
- /* Do all needed clipping here, so that we can forget about it later */
- if (_mesa_clip_readpixels(ctx, &x, &y, &width, &height, &clippedPacking)) {
-
- pixels = _mesa_map_pbo_dest(ctx, &clippedPacking, pixels);
-
- if (pixels) {
- switch (format) {
- case GL_STENCIL_INDEX:
- read_stencil_pixels(ctx, x, y, width, height, type, pixels,
- &clippedPacking);
- break;
- case GL_DEPTH_COMPONENT:
- read_depth_pixels(ctx, x, y, width, height, type, pixels,
- &clippedPacking);
- break;
- case GL_DEPTH_STENCIL_EXT:
- read_depth_stencil_pixels(ctx, x, y, width, height, type, pixels,
- &clippedPacking);
- break;
- default:
- /* all other formats should be color formats */
- read_rgba_pixels(ctx, x, y, width, height, format, type, pixels,
- &clippedPacking);
- }
-
- _mesa_unmap_pbo_dest(ctx, &clippedPacking);
- }
- }
-
- swrast_render_finish(ctx);
-}
+/*
+ * Mesa 3-D graphics library
+ * Version: 7.0.3
+ *
+ * Copyright (C) 1999-2007 Brian Paul All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+
+#include "main/glheader.h"
+#include "main/colormac.h"
+#include "main/feedback.h"
+#include "main/formats.h"
+#include "main/image.h"
+#include "main/imports.h"
+#include "main/macros.h"
+#include "main/pack.h"
+#include "main/pbo.h"
+#include "main/state.h"
+
+#include "s_context.h"
+#include "s_depth.h"
+#include "s_span.h"
+#include "s_stencil.h"
+
+
+/**
+ * Read pixels for format=GL_DEPTH_COMPONENT.
+ */
+static void
+read_depth_pixels( struct gl_context *ctx,
+ GLint x, GLint y,
+ GLsizei width, GLsizei height,
+ GLenum type, GLvoid *pixels,
+ const struct gl_pixelstore_attrib *packing )
+{
+ struct gl_framebuffer *fb = ctx->ReadBuffer;
+ struct gl_renderbuffer *rb = fb->_DepthBuffer;
+ const GLboolean biasOrScale
+ = ctx->Pixel.DepthScale != 1.0 || ctx->Pixel.DepthBias != 0.0;
+
+ if (!rb)
+ return;
+
+ /* clipping should have been done already */
+ ASSERT(x >= 0);
+ ASSERT(y >= 0);
+ ASSERT(x + width <= (GLint) rb->Width);
+ ASSERT(y + height <= (GLint) rb->Height);
+ /* width should never be > MAX_WIDTH since we did clipping earlier */
+ ASSERT(width <= MAX_WIDTH);
+
+ if (type == GL_UNSIGNED_SHORT && fb->Visual.depthBits == 16
+ && !biasOrScale && !packing->SwapBytes) {
+ /* Special case: directly read 16-bit unsigned depth values. */
+ GLint j;
+ ASSERT(rb->Format == MESA_FORMAT_Z16);
+ ASSERT(rb->DataType == GL_UNSIGNED_SHORT);
+ for (j = 0; j < height; j++, y++) {
+ void *dest =_mesa_image_address2d(packing, pixels, width, height,
+ GL_DEPTH_COMPONENT, type, j, 0);
+ rb->GetRow(ctx, rb, width, x, y, dest);
+ }
+ }
+ else if (type == GL_UNSIGNED_INT && fb->Visual.depthBits == 24
+ && !biasOrScale && !packing->SwapBytes) {
+ /* Special case: directly read 24-bit unsigned depth values. */
+ GLint j;
+ ASSERT(rb->Format == MESA_FORMAT_X8_Z24 ||
+ rb->Format == MESA_FORMAT_S8_Z24 ||
+ rb->Format == MESA_FORMAT_Z24_X8 ||
+ rb->Format == MESA_FORMAT_Z24_S8);
+ ASSERT(rb->DataType == GL_UNSIGNED_INT ||
+ rb->DataType == GL_UNSIGNED_INT_24_8);
+ for (j = 0; j < height; j++, y++) {
+ GLuint *dest = (GLuint *)
+ _mesa_image_address2d(packing, pixels, width, height,
+ GL_DEPTH_COMPONENT, type, j, 0);
+ GLint k;
+ rb->GetRow(ctx, rb, width, x, y, dest);
+ /* convert range from 24-bit to 32-bit */
+ if (rb->Format == MESA_FORMAT_X8_Z24 ||
+ rb->Format == MESA_FORMAT_S8_Z24) {
+ for (k = 0; k < width; k++) {
+ /* Note: put MSByte of 24-bit value into LSByte */
+ dest[k] = (dest[k] << 8) | ((dest[k] >> 16) & 0xff);
+ }
+ }
+ else {
+ for (k = 0; k < width; k++) {
+ /* Note: fill in LSByte by replication */
+ dest[k] = dest[k] | ((dest[k] >> 8) & 0xff);
+ }
+ }
+ }
+ }
+ else if (type == GL_UNSIGNED_INT && fb->Visual.depthBits == 32
+ && !biasOrScale && !packing->SwapBytes) {
+ /* Special case: directly read 32-bit unsigned depth values. */
+ GLint j;
+ ASSERT(rb->Format == MESA_FORMAT_Z32);
+ ASSERT(rb->DataType == GL_UNSIGNED_INT);
+ for (j = 0; j < height; j++, y++) {
+ void *dest = _mesa_image_address2d(packing, pixels, width, height,
+ GL_DEPTH_COMPONENT, type, j, 0);
+ rb->GetRow(ctx, rb, width, x, y, dest);
+ }
+ }
+ else {
+ /* General case (slower) */
+ GLint j;
+ for (j = 0; j < height; j++, y++) {
+ GLfloat depthValues[MAX_WIDTH];
+ GLvoid *dest = _mesa_image_address2d(packing, pixels, width, height,
+ GL_DEPTH_COMPONENT, type, j, 0);
+ _swrast_read_depth_span_float(ctx, rb, width, x, y, depthValues);
+ _mesa_pack_depth_span(ctx, width, dest, type, depthValues, packing);
+ }
+ }
+}
+
+
+/**
+ * Read pixels for format=GL_STENCIL_INDEX.
+ */
+static void
+read_stencil_pixels( struct gl_context *ctx,
+ GLint x, GLint y,
+ GLsizei width, GLsizei height,
+ GLenum type, GLvoid *pixels,
+ const struct gl_pixelstore_attrib *packing )
+{
+ struct gl_framebuffer *fb = ctx->ReadBuffer;
+ struct gl_renderbuffer *rb = fb->_StencilBuffer;
+ GLint j;
+
+ if (!rb)
+ return;
+
+ /* width should never be > MAX_WIDTH since we did clipping earlier */
+ ASSERT(width <= MAX_WIDTH);
+
+ /* process image row by row */
+ for (j=0;j<height;j++,y++) {
+ GLvoid *dest;
+ GLstencil stencil[MAX_WIDTH];
+
+ _swrast_read_stencil_span(ctx, rb, width, x, y, stencil);
+
+ dest = _mesa_image_address2d(packing, pixels, width, height,
+ GL_STENCIL_INDEX, type, j, 0);
+
+ _mesa_pack_stencil_span(ctx, width, type, dest, stencil, packing);
+ }
+}
+
+
+
+/**
+ * Optimized glReadPixels for particular pixel formats when pixel
+ * scaling, biasing, mapping, etc. are disabled.
+ * \return GL_TRUE if success, GL_FALSE if unable to do the readpixels
+ */
+static GLboolean
+fast_read_rgba_pixels( struct gl_context *ctx,
+ GLint x, GLint y,
+ GLsizei width, GLsizei height,
+ GLenum format, GLenum type,
+ GLvoid *pixels,
+ const struct gl_pixelstore_attrib *packing,
+ GLbitfield transferOps)
+{
+ struct gl_renderbuffer *rb = ctx->ReadBuffer->_ColorReadBuffer;
+
+ if (!rb)
+ return GL_FALSE;
+
+ ASSERT(rb->_BaseFormat == GL_RGBA ||
+ rb->_BaseFormat == GL_RGB ||
+ rb->_BaseFormat == GL_RG ||
+ rb->_BaseFormat == GL_RED ||
+ rb->_BaseFormat == GL_LUMINANCE ||
+ rb->_BaseFormat == GL_INTENSITY ||
+ rb->_BaseFormat == GL_LUMINANCE_ALPHA ||
+ rb->_BaseFormat == GL_ALPHA);
+
+ /* clipping should have already been done */
+ ASSERT(x + width <= (GLint) rb->Width);
+ ASSERT(y + height <= (GLint) rb->Height);
+
+ /* check for things we can't handle here */
+ if (transferOps ||
+ packing->SwapBytes ||
+ packing->LsbFirst) {
+ return GL_FALSE;
+ }
+
+ if (format == GL_RGBA && rb->DataType == type) {
+ const GLint dstStride = _mesa_image_row_stride(packing, width,
+ format, type);
+ GLubyte *dest
+ = (GLubyte *) _mesa_image_address2d(packing, pixels, width, height,
+ format, type, 0, 0);
+ GLint row;
+ ASSERT(rb->GetRow);
+ for (row = 0; row < height; row++) {
+ rb->GetRow(ctx, rb, width, x, y + row, dest);
+ dest += dstStride;
+ }
+ return GL_TRUE;
+ }
+
+ if (format == GL_RGB &&
+ rb->DataType == GL_UNSIGNED_BYTE &&
+ type == GL_UNSIGNED_BYTE) {
+ const GLint dstStride = _mesa_image_row_stride(packing, width,
+ format, type);
+ GLubyte *dest
+ = (GLubyte *) _mesa_image_address2d(packing, pixels, width, height,
+ format, type, 0, 0);
+ GLint row;
+ ASSERT(rb->GetRow);
+ for (row = 0; row < height; row++) {
+ GLubyte tempRow[MAX_WIDTH][4];
+ GLint col;
+ rb->GetRow(ctx, rb, width, x, y + row, tempRow);
+ /* convert RGBA to RGB */
+ for (col = 0; col < width; col++) {
+ dest[col * 3 + 0] = tempRow[col][0];
+ dest[col * 3 + 1] = tempRow[col][1];
+ dest[col * 3 + 2] = tempRow[col][2];
+ }
+ dest += dstStride;
+ }
+ return GL_TRUE;
+ }
+
+ /* not handled */
+ return GL_FALSE;
+}
+
+
+/**
+ * When we're using a low-precision color buffer (like 16-bit 5/6/5)
+ * we have to adjust our color values a bit to pass conformance.
+ * The problem is when a 5 or 6-bit color value is converted to an 8-bit
+ * value and then a floating point value, the floating point values don't
+ * increment uniformly as the 5 or 6-bit value is incremented.
+ *
+ * This function adjusts floating point values to compensate.
+ */
+static void
+adjust_colors(const struct gl_framebuffer *fb, GLuint n, GLfloat rgba[][4])
+{
+ const GLuint rShift = 8 - fb->Visual.redBits;
+ const GLuint gShift = 8 - fb->Visual.greenBits;
+ const GLuint bShift = 8 - fb->Visual.blueBits;
+ GLfloat rScale = 1.0F / (GLfloat) ((1 << fb->Visual.redBits ) - 1);
+ GLfloat gScale = 1.0F / (GLfloat) ((1 << fb->Visual.greenBits) - 1);
+ GLfloat bScale = 1.0F / (GLfloat) ((1 << fb->Visual.blueBits ) - 1);
+ GLuint i;
+
+ if (fb->Visual.redBits == 0)
+ rScale = 0;
+ if (fb->Visual.greenBits == 0)
+ gScale = 0;
+ if (fb->Visual.blueBits == 0)
+ bScale = 0;
+
+ for (i = 0; i < n; i++) {
+ GLint r, g, b;
+ /* convert float back to ubyte */
+ CLAMPED_FLOAT_TO_UBYTE(r, rgba[i][RCOMP]);
+ CLAMPED_FLOAT_TO_UBYTE(g, rgba[i][GCOMP]);
+ CLAMPED_FLOAT_TO_UBYTE(b, rgba[i][BCOMP]);
+ /* using only the N most significant bits of the ubyte value, convert to
+ * float in [0,1].
+ */
+ rgba[i][RCOMP] = (GLfloat) (r >> rShift) * rScale;
+ rgba[i][GCOMP] = (GLfloat) (g >> gShift) * gScale;
+ rgba[i][BCOMP] = (GLfloat) (b >> bShift) * bScale;
+ }
+}
+
+
+
+/*
+ * Read R, G, B, A, RGB, L, or LA pixels.
+ */
+static void
+read_rgba_pixels( struct gl_context *ctx,
+ GLint x, GLint y,
+ GLsizei width, GLsizei height,
+ GLenum format, GLenum type, GLvoid *pixels,
+ const struct gl_pixelstore_attrib *packing )
+{
+ SWcontext *swrast = SWRAST_CONTEXT(ctx);
+ GLbitfield transferOps = ctx->_ImageTransferState;
+ struct gl_framebuffer *fb = ctx->ReadBuffer;
+ struct gl_renderbuffer *rb = fb->_ColorReadBuffer;
+
+ if (!rb)
+ return;
+
+ if ((ctx->Color._ClampReadColor == GL_TRUE || type != GL_FLOAT) &&
+ !_mesa_is_integer_format(format)) {
+ transferOps |= IMAGE_CLAMP_BIT;
+ }
+
+ /* Try the optimized path first. */
+ if (fast_read_rgba_pixels(ctx, x, y, width, height,
+ format, type, pixels, packing, transferOps)) {
+ return; /* done! */
+ }
+
+ /* width should never be > MAX_WIDTH since we did clipping earlier */
+ ASSERT(width <= MAX_WIDTH);
+
+ do {
+ const GLint dstStride
+ = _mesa_image_row_stride(packing, width, format, type);
+ GLfloat (*rgba)[4] = swrast->SpanArrays->attribs[FRAG_ATTRIB_COL0];
+ GLint row;
+ GLubyte *dst
+ = (GLubyte *) _mesa_image_address2d(packing, pixels, width, height,
+ format, type, 0, 0);
+
+ for (row = 0; row < height; row++, y++) {
+
+ /* Get float rgba pixels */
+ _swrast_read_rgba_span(ctx, rb, width, x, y, GL_FLOAT, rgba);
+
+ /* apply fudge factor for shallow color buffers */
+ if ((fb->Visual.redBits < 8 && fb->Visual.redBits != 0) ||
+ (fb->Visual.greenBits < 8 && fb->Visual.greenBits != 0) ||
+ (fb->Visual.blueBits < 8 && fb->Visual.blueBits != 0)) {
+ adjust_colors(fb, width, rgba);
+ }
+
+ /* pack the row of RGBA pixels into user's buffer */
+ _mesa_pack_rgba_span_float(ctx, width, rgba, format, type, dst,
+ packing, transferOps);
+
+ dst += dstStride;
+ }
+ } while (0);
+}
+
+
+/**
+ * Read combined depth/stencil values.
+ * We'll have already done error checking to be sure the expected
+ * depth and stencil buffers really exist.
+ */
+static void
+read_depth_stencil_pixels(struct gl_context *ctx,
+ GLint x, GLint y,
+ GLsizei width, GLsizei height,
+ GLenum type, GLvoid *pixels,
+ const struct gl_pixelstore_attrib *packing )
+{
+ const GLboolean scaleOrBias
+ = ctx->Pixel.DepthScale != 1.0 || ctx->Pixel.DepthBias != 0.0;
+ const GLboolean stencilTransfer = ctx->Pixel.IndexShift
+ || ctx->Pixel.IndexOffset || ctx->Pixel.MapStencilFlag;
+ struct gl_renderbuffer *depthRb, *stencilRb;
+
+ depthRb = ctx->ReadBuffer->_DepthBuffer;
+ stencilRb = ctx->ReadBuffer->_StencilBuffer;
+
+ if (!depthRb || !stencilRb)
+ return;
+
+ depthRb = ctx->ReadBuffer->Attachment[BUFFER_DEPTH].Renderbuffer;
+ stencilRb = ctx->ReadBuffer->Attachment[BUFFER_STENCIL].Renderbuffer;
+
+ if (depthRb->_BaseFormat == GL_DEPTH_STENCIL_EXT &&
+ stencilRb->_BaseFormat == GL_DEPTH_STENCIL_EXT &&
+ depthRb == stencilRb &&
+ !scaleOrBias &&
+ !stencilTransfer) {
+ /* This is the ideal case.
+ * Reading GL_DEPTH_STENCIL pixels from combined depth/stencil buffer.
+ * Plus, no pixel transfer ops to worry about!
+ */
+ GLint i;
+ GLint dstStride = _mesa_image_row_stride(packing, width,
+ GL_DEPTH_STENCIL_EXT, type);
+ GLubyte *dst = (GLubyte *) _mesa_image_address2d(packing, pixels,
+ width, height,
+ GL_DEPTH_STENCIL_EXT,
+ type, 0, 0);
+ for (i = 0; i < height; i++) {
+ depthRb->GetRow(ctx, depthRb, width, x, y + i, dst);
+ dst += dstStride;
+ }
+ }
+ else {
+ /* Reading GL_DEPTH_STENCIL pixels from separate depth/stencil buffers,
+ * or we need pixel transfer.
+ */
+ GLint i;
+ depthRb = ctx->ReadBuffer->_DepthBuffer;
+ stencilRb = ctx->ReadBuffer->_StencilBuffer;
+
+ for (i = 0; i < height; i++) {
+ GLstencil stencilVals[MAX_WIDTH];
+
+ GLuint *depthStencilDst = (GLuint *)
+ _mesa_image_address2d(packing, pixels, width, height,
+ GL_DEPTH_STENCIL_EXT, type, i, 0);
+
+ _swrast_read_stencil_span(ctx, stencilRb, width,
+ x, y + i, stencilVals);
+
+ if (!scaleOrBias && !stencilTransfer
+ && ctx->ReadBuffer->Visual.depthBits == 24) {
+ /* ideal case */
+ GLuint zVals[MAX_WIDTH]; /* 24-bit values! */
+ GLint j;
+ ASSERT(depthRb->DataType == GL_UNSIGNED_INT);
+ /* note, we've already been clipped */
+ depthRb->GetRow(ctx, depthRb, width, x, y + i, zVals);
+ for (j = 0; j < width; j++) {
+ depthStencilDst[j] = (zVals[j] << 8) | (stencilVals[j] & 0xff);
+ }
+ }
+ else {
+ /* general case */
+ GLfloat depthVals[MAX_WIDTH];
+ _swrast_read_depth_span_float(ctx, depthRb, width, x, y + i,
+ depthVals);
+ _mesa_pack_depth_stencil_span(ctx, width, depthStencilDst,
+ depthVals, stencilVals, packing);
+ }
+ }
+ }
+}
+
+
+
+/**
+ * Software fallback routine for ctx->Driver.ReadPixels().
+ * By time we get here, all error checking will have been done.
+ */
+void
+_swrast_ReadPixels( struct gl_context *ctx,
+ GLint x, GLint y, GLsizei width, GLsizei height,
+ GLenum format, GLenum type,
+ const struct gl_pixelstore_attrib *packing,
+ GLvoid *pixels )
+{
+ SWcontext *swrast = SWRAST_CONTEXT(ctx);
+ struct gl_pixelstore_attrib clippedPacking = *packing;
+
+ if (ctx->NewState)
+ _mesa_update_state(ctx);
+
+ /* Need to do swrast_render_start() before clipping or anything else
+ * since this is where a driver may grab the hw lock and get an updated
+ * window size.
+ */
+ swrast_render_start(ctx);
+
+ if (swrast->NewState)
+ _swrast_validate_derived( ctx );
+
+ /* Do all needed clipping here, so that we can forget about it later */
+ if (_mesa_clip_readpixels(ctx, &x, &y, &width, &height, &clippedPacking)) {
+
+ pixels = _mesa_map_pbo_dest(ctx, &clippedPacking, pixels);
+
+ if (pixels) {
+ switch (format) {
+ case GL_STENCIL_INDEX:
+ read_stencil_pixels(ctx, x, y, width, height, type, pixels,
+ &clippedPacking);
+ break;
+ case GL_DEPTH_COMPONENT:
+ read_depth_pixels(ctx, x, y, width, height, type, pixels,
+ &clippedPacking);
+ break;
+ case GL_DEPTH_STENCIL_EXT:
+ read_depth_stencil_pixels(ctx, x, y, width, height, type, pixels,
+ &clippedPacking);
+ break;
+ default:
+ /* all other formats should be color formats */
+ read_rgba_pixels(ctx, x, y, width, height, format, type, pixels,
+ &clippedPacking);
+ }
+
+ _mesa_unmap_pbo_dest(ctx, &clippedPacking);
+ }
+ }
+
+ swrast_render_finish(ctx);
+}
diff --git a/mesalib/src/mesa/swrast/s_triangle.c b/mesalib/src/mesa/swrast/s_triangle.c
index 8a9671aa0..0f21a33f9 100644
--- a/mesalib/src/mesa/swrast/s_triangle.c
+++ b/mesalib/src/mesa/swrast/s_triangle.c
@@ -1,1143 +1,1143 @@
-/*
- * Mesa 3-D graphics library
- * Version: 7.3
- *
- * Copyright (C) 1999-2007 Brian Paul All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-
-/*
- * When the device driver doesn't implement triangle rasterization it
- * can hook in _swrast_Triangle, which eventually calls one of these
- * functions to draw triangles.
- */
-
-#include "main/glheader.h"
-#include "main/context.h"
-#include "main/colormac.h"
-#include "main/imports.h"
-#include "main/macros.h"
-#include "main/mtypes.h"
-#include "main/state.h"
-#include "program/prog_instruction.h"
-
-#include "s_aatriangle.h"
-#include "s_context.h"
-#include "s_feedback.h"
-#include "s_span.h"
-#include "s_triangle.h"
-
-
-/**
- * Test if a triangle should be culled. Used for feedback and selection mode.
- * \return GL_TRUE if the triangle is to be culled, GL_FALSE otherwise.
- */
-GLboolean
-_swrast_culltriangle( struct gl_context *ctx,
- const SWvertex *v0,
- const SWvertex *v1,
- const SWvertex *v2 )
-{
- SWcontext *swrast = SWRAST_CONTEXT(ctx);
- GLfloat ex = v1->attrib[FRAG_ATTRIB_WPOS][0] - v0->attrib[FRAG_ATTRIB_WPOS][0];
- GLfloat ey = v1->attrib[FRAG_ATTRIB_WPOS][1] - v0->attrib[FRAG_ATTRIB_WPOS][1];
- GLfloat fx = v2->attrib[FRAG_ATTRIB_WPOS][0] - v0->attrib[FRAG_ATTRIB_WPOS][0];
- GLfloat fy = v2->attrib[FRAG_ATTRIB_WPOS][1] - v0->attrib[FRAG_ATTRIB_WPOS][1];
- GLfloat c = ex*fy-ey*fx;
-
- if (c * swrast->_BackfaceSign * swrast->_BackfaceCullSign <= 0.0F)
- return GL_FALSE;
-
- return GL_TRUE;
-}
-
-
-
-/*
- * Render a flat-shaded RGBA triangle.
- */
-#define NAME flat_rgba_triangle
-#define INTERP_Z 1
-#define SETUP_CODE \
- ASSERT(ctx->Texture._EnabledCoordUnits == 0);\
- ASSERT(ctx->Light.ShadeModel==GL_FLAT); \
- span.interpMask |= SPAN_RGBA; \
- span.red = ChanToFixed(v2->color[0]); \
- span.green = ChanToFixed(v2->color[1]); \
- span.blue = ChanToFixed(v2->color[2]); \
- span.alpha = ChanToFixed(v2->color[3]); \
- span.redStep = 0; \
- span.greenStep = 0; \
- span.blueStep = 0; \
- span.alphaStep = 0;
-#define RENDER_SPAN( span ) _swrast_write_rgba_span(ctx, &span);
-#include "s_tritemp.h"
-
-
-
-/*
- * Render a smooth-shaded RGBA triangle.
- */
-#define NAME smooth_rgba_triangle
-#define INTERP_Z 1
-#define INTERP_RGB 1
-#define INTERP_ALPHA 1
-#define SETUP_CODE \
- { \
- /* texturing must be off */ \
- ASSERT(ctx->Texture._EnabledCoordUnits == 0); \
- ASSERT(ctx->Light.ShadeModel==GL_SMOOTH); \
- }
-#define RENDER_SPAN( span ) _swrast_write_rgba_span(ctx, &span);
-#include "s_tritemp.h"
-
-
-
-/*
- * Render an RGB, GL_DECAL, textured triangle.
- * Interpolate S,T only w/out mipmapping or perspective correction.
- *
- * No fog. No depth testing.
- */
-#define NAME simple_textured_triangle
-#define INTERP_INT_TEX 1
-#define S_SCALE twidth
-#define T_SCALE theight
-
-#define SETUP_CODE \
- struct gl_renderbuffer *rb = ctx->DrawBuffer->_ColorDrawBuffers[0]; \
- const struct gl_texture_object *obj = \
- ctx->Texture.Unit[0].CurrentTex[TEXTURE_2D_INDEX]; \
- const struct gl_texture_image *texImg = \
- obj->Image[0][obj->BaseLevel]; \
- const GLfloat twidth = (GLfloat) texImg->Width; \
- const GLfloat theight = (GLfloat) texImg->Height; \
- const GLint twidth_log2 = texImg->WidthLog2; \
- const GLubyte *texture = (const GLubyte *) texImg->Data; \
- const GLint smask = texImg->Width - 1; \
- const GLint tmask = texImg->Height - 1; \
- ASSERT(texImg->TexFormat == MESA_FORMAT_RGB888); \
- if (!rb || !texture) { \
- return; \
- }
-
-#define RENDER_SPAN( span ) \
- GLuint i; \
- GLubyte rgb[MAX_WIDTH][3]; \
- span.intTex[0] -= FIXED_HALF; /* off-by-one error? */ \
- span.intTex[1] -= FIXED_HALF; \
- for (i = 0; i < span.end; i++) { \
- GLint s = FixedToInt(span.intTex[0]) & smask; \
- GLint t = FixedToInt(span.intTex[1]) & tmask; \
- GLint pos = (t << twidth_log2) + s; \
- pos = pos + pos + pos; /* multiply by 3 */ \
- rgb[i][RCOMP] = texture[pos+2]; \
- rgb[i][GCOMP] = texture[pos+1]; \
- rgb[i][BCOMP] = texture[pos+0]; \
- span.intTex[0] += span.intTexStep[0]; \
- span.intTex[1] += span.intTexStep[1]; \
- } \
- rb->PutRowRGB(ctx, rb, span.end, span.x, span.y, rgb, NULL);
-
-#include "s_tritemp.h"
-
-
-
-/*
- * Render an RGB, GL_DECAL, textured triangle.
- * Interpolate S,T, GL_LESS depth test, w/out mipmapping or
- * perspective correction.
- * Depth buffer bits must be <= sizeof(DEFAULT_SOFTWARE_DEPTH_TYPE)
- *
- * No fog.
- */
-#define NAME simple_z_textured_triangle
-#define INTERP_Z 1
-#define DEPTH_TYPE DEFAULT_SOFTWARE_DEPTH_TYPE
-#define INTERP_INT_TEX 1
-#define S_SCALE twidth
-#define T_SCALE theight
-
-#define SETUP_CODE \
- struct gl_renderbuffer *rb = ctx->DrawBuffer->_ColorDrawBuffers[0]; \
- const struct gl_texture_object *obj = \
- ctx->Texture.Unit[0].CurrentTex[TEXTURE_2D_INDEX]; \
- const struct gl_texture_image *texImg = \
- obj->Image[0][obj->BaseLevel]; \
- const GLfloat twidth = (GLfloat) texImg->Width; \
- const GLfloat theight = (GLfloat) texImg->Height; \
- const GLint twidth_log2 = texImg->WidthLog2; \
- const GLubyte *texture = (const GLubyte *) texImg->Data; \
- const GLint smask = texImg->Width - 1; \
- const GLint tmask = texImg->Height - 1; \
- ASSERT(texImg->TexFormat == MESA_FORMAT_RGB888); \
- if (!rb || !texture) { \
- return; \
- }
-
-#define RENDER_SPAN( span ) \
- GLuint i; \
- GLubyte rgb[MAX_WIDTH][3]; \
- span.intTex[0] -= FIXED_HALF; /* off-by-one error? */ \
- span.intTex[1] -= FIXED_HALF; \
- for (i = 0; i < span.end; i++) { \
- const GLuint z = FixedToDepth(span.z); \
- if (z < zRow[i]) { \
- GLint s = FixedToInt(span.intTex[0]) & smask; \
- GLint t = FixedToInt(span.intTex[1]) & tmask; \
- GLint pos = (t << twidth_log2) + s; \
- pos = pos + pos + pos; /* multiply by 3 */ \
- rgb[i][RCOMP] = texture[pos+2]; \
- rgb[i][GCOMP] = texture[pos+1]; \
- rgb[i][BCOMP] = texture[pos+0]; \
- zRow[i] = z; \
- span.array->mask[i] = 1; \
- } \
- else { \
- span.array->mask[i] = 0; \
- } \
- span.intTex[0] += span.intTexStep[0]; \
- span.intTex[1] += span.intTexStep[1]; \
- span.z += span.zStep; \
- } \
- rb->PutRowRGB(ctx, rb, span.end, span.x, span.y, rgb, span.array->mask);
-
-#include "s_tritemp.h"
-
-
-#if CHAN_TYPE != GL_FLOAT
-
-struct affine_info
-{
- GLenum filter;
- GLenum format;
- GLenum envmode;
- GLint smask, tmask;
- GLint twidth_log2;
- const GLchan *texture;
- GLfixed er, eg, eb, ea;
- GLint tbytesline, tsize;
-};
-
-
-static INLINE GLint
-ilerp(GLint t, GLint a, GLint b)
-{
- return a + ((t * (b - a)) >> FIXED_SHIFT);
-}
-
-static INLINE GLint
-ilerp_2d(GLint ia, GLint ib, GLint v00, GLint v10, GLint v01, GLint v11)
-{
- const GLint temp0 = ilerp(ia, v00, v10);
- const GLint temp1 = ilerp(ia, v01, v11);
- return ilerp(ib, temp0, temp1);
-}
-
-
-/* This function can handle GL_NEAREST or GL_LINEAR sampling of 2D RGB or RGBA
- * textures with GL_REPLACE, GL_MODULATE, GL_BLEND, GL_DECAL or GL_ADD
- * texture env modes.
- */
-static INLINE void
-affine_span(struct gl_context *ctx, SWspan *span,
- struct affine_info *info)
-{
- GLchan sample[4]; /* the filtered texture sample */
- const GLuint texEnableSave = ctx->Texture._EnabledCoordUnits;
-
- /* Instead of defining a function for each mode, a test is done
- * between the outer and inner loops. This is to reduce code size
- * and complexity. Observe that an optimizing compiler kills
- * unused variables (for instance tf,sf,ti,si in case of GL_NEAREST).
- */
-
-#define NEAREST_RGB \
- sample[RCOMP] = tex00[2]; \
- sample[GCOMP] = tex00[1]; \
- sample[BCOMP] = tex00[0]; \
- sample[ACOMP] = CHAN_MAX;
-
-#define LINEAR_RGB \
- sample[RCOMP] = ilerp_2d(sf, tf, tex00[2], tex01[2], tex10[2], tex11[2]);\
- sample[GCOMP] = ilerp_2d(sf, tf, tex00[1], tex01[1], tex10[1], tex11[1]);\
- sample[BCOMP] = ilerp_2d(sf, tf, tex00[0], tex01[0], tex10[0], tex11[0]);\
- sample[ACOMP] = CHAN_MAX;
-
-#define NEAREST_RGBA \
- sample[RCOMP] = tex00[3]; \
- sample[GCOMP] = tex00[2]; \
- sample[BCOMP] = tex00[1]; \
- sample[ACOMP] = tex00[0];
-
-#define LINEAR_RGBA \
- sample[RCOMP] = ilerp_2d(sf, tf, tex00[3], tex01[3], tex10[3], tex11[3]);\
- sample[GCOMP] = ilerp_2d(sf, tf, tex00[2], tex01[2], tex10[2], tex11[2]);\
- sample[BCOMP] = ilerp_2d(sf, tf, tex00[1], tex01[1], tex10[1], tex11[1]);\
- sample[ACOMP] = ilerp_2d(sf, tf, tex00[0], tex01[0], tex10[0], tex11[0])
-
-#define MODULATE \
- dest[RCOMP] = span->red * (sample[RCOMP] + 1u) >> (FIXED_SHIFT + 8); \
- dest[GCOMP] = span->green * (sample[GCOMP] + 1u) >> (FIXED_SHIFT + 8); \
- dest[BCOMP] = span->blue * (sample[BCOMP] + 1u) >> (FIXED_SHIFT + 8); \
- dest[ACOMP] = span->alpha * (sample[ACOMP] + 1u) >> (FIXED_SHIFT + 8)
-
-#define DECAL \
- dest[RCOMP] = ((CHAN_MAX - sample[ACOMP]) * span->red + \
- ((sample[ACOMP] + 1) * sample[RCOMP] << FIXED_SHIFT)) \
- >> (FIXED_SHIFT + 8); \
- dest[GCOMP] = ((CHAN_MAX - sample[ACOMP]) * span->green + \
- ((sample[ACOMP] + 1) * sample[GCOMP] << FIXED_SHIFT)) \
- >> (FIXED_SHIFT + 8); \
- dest[BCOMP] = ((CHAN_MAX - sample[ACOMP]) * span->blue + \
- ((sample[ACOMP] + 1) * sample[BCOMP] << FIXED_SHIFT)) \
- >> (FIXED_SHIFT + 8); \
- dest[ACOMP] = FixedToInt(span->alpha)
-
-#define BLEND \
- dest[RCOMP] = ((CHAN_MAX - sample[RCOMP]) * span->red \
- + (sample[RCOMP] + 1) * info->er) >> (FIXED_SHIFT + 8); \
- dest[GCOMP] = ((CHAN_MAX - sample[GCOMP]) * span->green \
- + (sample[GCOMP] + 1) * info->eg) >> (FIXED_SHIFT + 8); \
- dest[BCOMP] = ((CHAN_MAX - sample[BCOMP]) * span->blue \
- + (sample[BCOMP] + 1) * info->eb) >> (FIXED_SHIFT + 8); \
- dest[ACOMP] = span->alpha * (sample[ACOMP] + 1) >> (FIXED_SHIFT + 8)
-
-#define REPLACE COPY_CHAN4(dest, sample)
-
-#define ADD \
- { \
- GLint rSum = FixedToInt(span->red) + (GLint) sample[RCOMP]; \
- GLint gSum = FixedToInt(span->green) + (GLint) sample[GCOMP]; \
- GLint bSum = FixedToInt(span->blue) + (GLint) sample[BCOMP]; \
- dest[RCOMP] = MIN2(rSum, CHAN_MAX); \
- dest[GCOMP] = MIN2(gSum, CHAN_MAX); \
- dest[BCOMP] = MIN2(bSum, CHAN_MAX); \
- dest[ACOMP] = span->alpha * (sample[ACOMP] + 1) >> (FIXED_SHIFT + 8); \
- }
-
-/* shortcuts */
-
-#define NEAREST_RGB_REPLACE \
- NEAREST_RGB; \
- dest[0] = sample[0]; \
- dest[1] = sample[1]; \
- dest[2] = sample[2]; \
- dest[3] = FixedToInt(span->alpha);
-
-#define NEAREST_RGBA_REPLACE \
- dest[RCOMP] = tex00[3]; \
- dest[GCOMP] = tex00[2]; \
- dest[BCOMP] = tex00[1]; \
- dest[ACOMP] = tex00[0]
-
-#define SPAN_NEAREST(DO_TEX, COMPS) \
- for (i = 0; i < span->end; i++) { \
- /* Isn't it necessary to use FixedFloor below?? */ \
- GLint s = FixedToInt(span->intTex[0]) & info->smask; \
- GLint t = FixedToInt(span->intTex[1]) & info->tmask; \
- GLint pos = (t << info->twidth_log2) + s; \
- const GLchan *tex00 = info->texture + COMPS * pos; \
- DO_TEX; \
- span->red += span->redStep; \
- span->green += span->greenStep; \
- span->blue += span->blueStep; \
- span->alpha += span->alphaStep; \
- span->intTex[0] += span->intTexStep[0]; \
- span->intTex[1] += span->intTexStep[1]; \
- dest += 4; \
- }
-
-#define SPAN_LINEAR(DO_TEX, COMPS) \
- for (i = 0; i < span->end; i++) { \
- /* Isn't it necessary to use FixedFloor below?? */ \
- const GLint s = FixedToInt(span->intTex[0]) & info->smask; \
- const GLint t = FixedToInt(span->intTex[1]) & info->tmask; \
- const GLfixed sf = span->intTex[0] & FIXED_FRAC_MASK; \
- const GLfixed tf = span->intTex[1] & FIXED_FRAC_MASK; \
- const GLint pos = (t << info->twidth_log2) + s; \
- const GLchan *tex00 = info->texture + COMPS * pos; \
- const GLchan *tex10 = tex00 + info->tbytesline; \
- const GLchan *tex01 = tex00 + COMPS; \
- const GLchan *tex11 = tex10 + COMPS; \
- if (t == info->tmask) { \
- tex10 -= info->tsize; \
- tex11 -= info->tsize; \
- } \
- if (s == info->smask) { \
- tex01 -= info->tbytesline; \
- tex11 -= info->tbytesline; \
- } \
- DO_TEX; \
- span->red += span->redStep; \
- span->green += span->greenStep; \
- span->blue += span->blueStep; \
- span->alpha += span->alphaStep; \
- span->intTex[0] += span->intTexStep[0]; \
- span->intTex[1] += span->intTexStep[1]; \
- dest += 4; \
- }
-
-
- GLuint i;
- GLchan *dest = span->array->rgba[0];
-
- /* Disable tex units so they're not re-applied in swrast_write_rgba_span */
- ctx->Texture._EnabledCoordUnits = 0x0;
-
- span->intTex[0] -= FIXED_HALF;
- span->intTex[1] -= FIXED_HALF;
- switch (info->filter) {
- case GL_NEAREST:
- switch (info->format) {
- case MESA_FORMAT_RGB888:
- switch (info->envmode) {
- case GL_MODULATE:
- SPAN_NEAREST(NEAREST_RGB;MODULATE,3);
- break;
- case GL_DECAL:
- case GL_REPLACE:
- SPAN_NEAREST(NEAREST_RGB_REPLACE,3);
- break;
- case GL_BLEND:
- SPAN_NEAREST(NEAREST_RGB;BLEND,3);
- break;
- case GL_ADD:
- SPAN_NEAREST(NEAREST_RGB;ADD,3);
- break;
- default:
- _mesa_problem(ctx, "bad tex env mode in SPAN_LINEAR");
- return;
- }
- break;
- case MESA_FORMAT_RGBA8888:
- switch(info->envmode) {
- case GL_MODULATE:
- SPAN_NEAREST(NEAREST_RGBA;MODULATE,4);
- break;
- case GL_DECAL:
- SPAN_NEAREST(NEAREST_RGBA;DECAL,4);
- break;
- case GL_BLEND:
- SPAN_NEAREST(NEAREST_RGBA;BLEND,4);
- break;
- case GL_ADD:
- SPAN_NEAREST(NEAREST_RGBA;ADD,4);
- break;
- case GL_REPLACE:
- SPAN_NEAREST(NEAREST_RGBA_REPLACE,4);
- break;
- default:
- _mesa_problem(ctx, "bad tex env mode (2) in SPAN_LINEAR");
- return;
- }
- break;
- }
- break;
-
- case GL_LINEAR:
- span->intTex[0] -= FIXED_HALF;
- span->intTex[1] -= FIXED_HALF;
- switch (info->format) {
- case MESA_FORMAT_RGB888:
- switch (info->envmode) {
- case GL_MODULATE:
- SPAN_LINEAR(LINEAR_RGB;MODULATE,3);
- break;
- case GL_DECAL:
- case GL_REPLACE:
- SPAN_LINEAR(LINEAR_RGB;REPLACE,3);
- break;
- case GL_BLEND:
- SPAN_LINEAR(LINEAR_RGB;BLEND,3);
- break;
- case GL_ADD:
- SPAN_LINEAR(LINEAR_RGB;ADD,3);
- break;
- default:
- _mesa_problem(ctx, "bad tex env mode (3) in SPAN_LINEAR");
- return;
- }
- break;
- case MESA_FORMAT_RGBA8888:
- switch (info->envmode) {
- case GL_MODULATE:
- SPAN_LINEAR(LINEAR_RGBA;MODULATE,4);
- break;
- case GL_DECAL:
- SPAN_LINEAR(LINEAR_RGBA;DECAL,4);
- break;
- case GL_BLEND:
- SPAN_LINEAR(LINEAR_RGBA;BLEND,4);
- break;
- case GL_ADD:
- SPAN_LINEAR(LINEAR_RGBA;ADD,4);
- break;
- case GL_REPLACE:
- SPAN_LINEAR(LINEAR_RGBA;REPLACE,4);
- break;
- default:
- _mesa_problem(ctx, "bad tex env mode (4) in SPAN_LINEAR");
- return;
- }
- break;
- }
- break;
- }
- span->interpMask &= ~SPAN_RGBA;
- ASSERT(span->arrayMask & SPAN_RGBA);
-
- _swrast_write_rgba_span(ctx, span);
-
- /* re-enable texture units */
- ctx->Texture._EnabledCoordUnits = texEnableSave;
-
-#undef SPAN_NEAREST
-#undef SPAN_LINEAR
-}
-
-
-
-/*
- * Render an RGB/RGBA textured triangle without perspective correction.
- */
-#define NAME affine_textured_triangle
-#define INTERP_Z 1
-#define INTERP_RGB 1
-#define INTERP_ALPHA 1
-#define INTERP_INT_TEX 1
-#define S_SCALE twidth
-#define T_SCALE theight
-
-#define SETUP_CODE \
- struct affine_info info; \
- struct gl_texture_unit *unit = ctx->Texture.Unit+0; \
- const struct gl_texture_object *obj = \
- ctx->Texture.Unit[0].CurrentTex[TEXTURE_2D_INDEX]; \
- const struct gl_texture_image *texImg = \
- obj->Image[0][obj->BaseLevel]; \
- const GLfloat twidth = (GLfloat) texImg->Width; \
- const GLfloat theight = (GLfloat) texImg->Height; \
- info.texture = (const GLchan *) texImg->Data; \
- info.twidth_log2 = texImg->WidthLog2; \
- info.smask = texImg->Width - 1; \
- info.tmask = texImg->Height - 1; \
- info.format = texImg->TexFormat; \
- info.filter = obj->Sampler.MinFilter; \
- info.envmode = unit->EnvMode; \
- info.er = 0; \
- info.eg = 0; \
- info.eb = 0; \
- span.arrayMask |= SPAN_RGBA; \
- \
- if (info.envmode == GL_BLEND) { \
- /* potential off-by-one error here? (1.0f -> 2048 -> 0) */ \
- info.er = FloatToFixed(unit->EnvColor[RCOMP] * CHAN_MAXF); \
- info.eg = FloatToFixed(unit->EnvColor[GCOMP] * CHAN_MAXF); \
- info.eb = FloatToFixed(unit->EnvColor[BCOMP] * CHAN_MAXF); \
- info.ea = FloatToFixed(unit->EnvColor[ACOMP] * CHAN_MAXF); \
- } \
- if (!info.texture) { \
- /* this shouldn't happen */ \
- return; \
- } \
- \
- switch (info.format) { \
- case MESA_FORMAT_RGB888: \
- info.tbytesline = texImg->Width * 3; \
- break; \
- case MESA_FORMAT_RGBA8888: \
- info.tbytesline = texImg->Width * 4; \
- break; \
- default: \
- _mesa_problem(NULL, "Bad texture format in affine_texture_triangle");\
- return; \
- } \
- info.tsize = texImg->Height * info.tbytesline;
-
-#define RENDER_SPAN( span ) affine_span(ctx, &span, &info);
-
-#include "s_tritemp.h"
-
-
-
-struct persp_info
-{
- GLenum filter;
- GLenum format;
- GLenum envmode;
- GLint smask, tmask;
- GLint twidth_log2;
- const GLchan *texture;
- GLfixed er, eg, eb, ea; /* texture env color */
- GLint tbytesline, tsize;
-};
-
-
-static INLINE void
-fast_persp_span(struct gl_context *ctx, SWspan *span,
- struct persp_info *info)
-{
- GLchan sample[4]; /* the filtered texture sample */
-
- /* Instead of defining a function for each mode, a test is done
- * between the outer and inner loops. This is to reduce code size
- * and complexity. Observe that an optimizing compiler kills
- * unused variables (for instance tf,sf,ti,si in case of GL_NEAREST).
- */
-#define SPAN_NEAREST(DO_TEX,COMP) \
- for (i = 0; i < span->end; i++) { \
- GLdouble invQ = tex_coord[2] ? \
- (1.0 / tex_coord[2]) : 1.0; \
- GLfloat s_tmp = (GLfloat) (tex_coord[0] * invQ); \
- GLfloat t_tmp = (GLfloat) (tex_coord[1] * invQ); \
- GLint s = IFLOOR(s_tmp) & info->smask; \
- GLint t = IFLOOR(t_tmp) & info->tmask; \
- GLint pos = (t << info->twidth_log2) + s; \
- const GLchan *tex00 = info->texture + COMP * pos; \
- DO_TEX; \
- span->red += span->redStep; \
- span->green += span->greenStep; \
- span->blue += span->blueStep; \
- span->alpha += span->alphaStep; \
- tex_coord[0] += tex_step[0]; \
- tex_coord[1] += tex_step[1]; \
- tex_coord[2] += tex_step[2]; \
- dest += 4; \
- }
-
-#define SPAN_LINEAR(DO_TEX,COMP) \
- for (i = 0; i < span->end; i++) { \
- GLdouble invQ = tex_coord[2] ? \
- (1.0 / tex_coord[2]) : 1.0; \
- const GLfloat s_tmp = (GLfloat) (tex_coord[0] * invQ); \
- const GLfloat t_tmp = (GLfloat) (tex_coord[1] * invQ); \
- const GLfixed s_fix = FloatToFixed(s_tmp) - FIXED_HALF; \
- const GLfixed t_fix = FloatToFixed(t_tmp) - FIXED_HALF; \
- const GLint s = FixedToInt(FixedFloor(s_fix)) & info->smask; \
- const GLint t = FixedToInt(FixedFloor(t_fix)) & info->tmask; \
- const GLfixed sf = s_fix & FIXED_FRAC_MASK; \
- const GLfixed tf = t_fix & FIXED_FRAC_MASK; \
- const GLint pos = (t << info->twidth_log2) + s; \
- const GLchan *tex00 = info->texture + COMP * pos; \
- const GLchan *tex10 = tex00 + info->tbytesline; \
- const GLchan *tex01 = tex00 + COMP; \
- const GLchan *tex11 = tex10 + COMP; \
- if (t == info->tmask) { \
- tex10 -= info->tsize; \
- tex11 -= info->tsize; \
- } \
- if (s == info->smask) { \
- tex01 -= info->tbytesline; \
- tex11 -= info->tbytesline; \
- } \
- DO_TEX; \
- span->red += span->redStep; \
- span->green += span->greenStep; \
- span->blue += span->blueStep; \
- span->alpha += span->alphaStep; \
- tex_coord[0] += tex_step[0]; \
- tex_coord[1] += tex_step[1]; \
- tex_coord[2] += tex_step[2]; \
- dest += 4; \
- }
-
- GLuint i;
- GLfloat tex_coord[3], tex_step[3];
- GLchan *dest = span->array->rgba[0];
-
- const GLuint texEnableSave = ctx->Texture._EnabledCoordUnits;
- ctx->Texture._EnabledCoordUnits = 0;
-
- tex_coord[0] = span->attrStart[FRAG_ATTRIB_TEX0][0] * (info->smask + 1);
- tex_step[0] = span->attrStepX[FRAG_ATTRIB_TEX0][0] * (info->smask + 1);
- tex_coord[1] = span->attrStart[FRAG_ATTRIB_TEX0][1] * (info->tmask + 1);
- tex_step[1] = span->attrStepX[FRAG_ATTRIB_TEX0][1] * (info->tmask + 1);
- /* span->attrStart[FRAG_ATTRIB_TEX0][2] only if 3D-texturing, here only 2D */
- tex_coord[2] = span->attrStart[FRAG_ATTRIB_TEX0][3];
- tex_step[2] = span->attrStepX[FRAG_ATTRIB_TEX0][3];
-
- switch (info->filter) {
- case GL_NEAREST:
- switch (info->format) {
- case MESA_FORMAT_RGB888:
- switch (info->envmode) {
- case GL_MODULATE:
- SPAN_NEAREST(NEAREST_RGB;MODULATE,3);
- break;
- case GL_DECAL:
- case GL_REPLACE:
- SPAN_NEAREST(NEAREST_RGB_REPLACE,3);
- break;
- case GL_BLEND:
- SPAN_NEAREST(NEAREST_RGB;BLEND,3);
- break;
- case GL_ADD:
- SPAN_NEAREST(NEAREST_RGB;ADD,3);
- break;
- default:
- _mesa_problem(ctx, "bad tex env mode (5) in SPAN_LINEAR");
- return;
- }
- break;
- case MESA_FORMAT_RGBA8888:
- switch(info->envmode) {
- case GL_MODULATE:
- SPAN_NEAREST(NEAREST_RGBA;MODULATE,4);
- break;
- case GL_DECAL:
- SPAN_NEAREST(NEAREST_RGBA;DECAL,4);
- break;
- case GL_BLEND:
- SPAN_NEAREST(NEAREST_RGBA;BLEND,4);
- break;
- case GL_ADD:
- SPAN_NEAREST(NEAREST_RGBA;ADD,4);
- break;
- case GL_REPLACE:
- SPAN_NEAREST(NEAREST_RGBA_REPLACE,4);
- break;
- default:
- _mesa_problem(ctx, "bad tex env mode (6) in SPAN_LINEAR");
- return;
- }
- break;
- }
- break;
-
- case GL_LINEAR:
- switch (info->format) {
- case MESA_FORMAT_RGB888:
- switch (info->envmode) {
- case GL_MODULATE:
- SPAN_LINEAR(LINEAR_RGB;MODULATE,3);
- break;
- case GL_DECAL:
- case GL_REPLACE:
- SPAN_LINEAR(LINEAR_RGB;REPLACE,3);
- break;
- case GL_BLEND:
- SPAN_LINEAR(LINEAR_RGB;BLEND,3);
- break;
- case GL_ADD:
- SPAN_LINEAR(LINEAR_RGB;ADD,3);
- break;
- default:
- _mesa_problem(ctx, "bad tex env mode (7) in SPAN_LINEAR");
- return;
- }
- break;
- case MESA_FORMAT_RGBA8888:
- switch (info->envmode) {
- case GL_MODULATE:
- SPAN_LINEAR(LINEAR_RGBA;MODULATE,4);
- break;
- case GL_DECAL:
- SPAN_LINEAR(LINEAR_RGBA;DECAL,4);
- break;
- case GL_BLEND:
- SPAN_LINEAR(LINEAR_RGBA;BLEND,4);
- break;
- case GL_ADD:
- SPAN_LINEAR(LINEAR_RGBA;ADD,4);
- break;
- case GL_REPLACE:
- SPAN_LINEAR(LINEAR_RGBA;REPLACE,4);
- break;
- default:
- _mesa_problem(ctx, "bad tex env mode (8) in SPAN_LINEAR");
- return;
- }
- break;
- }
- break;
- }
-
- ASSERT(span->arrayMask & SPAN_RGBA);
- _swrast_write_rgba_span(ctx, span);
-
-#undef SPAN_NEAREST
-#undef SPAN_LINEAR
-
- /* restore state */
- ctx->Texture._EnabledCoordUnits = texEnableSave;
-}
-
-
-/*
- * Render an perspective corrected RGB/RGBA textured triangle.
- * The Q (aka V in Mesa) coordinate must be zero such that the divide
- * by interpolated Q/W comes out right.
- *
- */
-#define NAME persp_textured_triangle
-#define INTERP_Z 1
-#define INTERP_RGB 1
-#define INTERP_ALPHA 1
-#define INTERP_ATTRIBS 1
-
-#define SETUP_CODE \
- struct persp_info info; \
- const struct gl_texture_unit *unit = ctx->Texture.Unit+0; \
- const struct gl_texture_object *obj = \
- ctx->Texture.Unit[0].CurrentTex[TEXTURE_2D_INDEX]; \
- const struct gl_texture_image *texImg = \
- obj->Image[0][obj->BaseLevel]; \
- info.texture = (const GLchan *) texImg->Data; \
- info.twidth_log2 = texImg->WidthLog2; \
- info.smask = texImg->Width - 1; \
- info.tmask = texImg->Height - 1; \
- info.format = texImg->TexFormat; \
- info.filter = obj->Sampler.MinFilter; \
- info.envmode = unit->EnvMode; \
- info.er = 0; \
- info.eg = 0; \
- info.eb = 0; \
- \
- if (info.envmode == GL_BLEND) { \
- /* potential off-by-one error here? (1.0f -> 2048 -> 0) */ \
- info.er = FloatToFixed(unit->EnvColor[RCOMP] * CHAN_MAXF); \
- info.eg = FloatToFixed(unit->EnvColor[GCOMP] * CHAN_MAXF); \
- info.eb = FloatToFixed(unit->EnvColor[BCOMP] * CHAN_MAXF); \
- info.ea = FloatToFixed(unit->EnvColor[ACOMP] * CHAN_MAXF); \
- } \
- if (!info.texture) { \
- /* this shouldn't happen */ \
- return; \
- } \
- \
- switch (info.format) { \
- case MESA_FORMAT_RGB888: \
- info.tbytesline = texImg->Width * 3; \
- break; \
- case MESA_FORMAT_RGBA8888: \
- info.tbytesline = texImg->Width * 4; \
- break; \
- default: \
- _mesa_problem(NULL, "Bad texture format in persp_textured_triangle");\
- return; \
- } \
- info.tsize = texImg->Height * info.tbytesline;
-
-#define RENDER_SPAN( span ) \
- span.interpMask &= ~SPAN_RGBA; \
- span.arrayMask |= SPAN_RGBA; \
- fast_persp_span(ctx, &span, &info);
-
-#include "s_tritemp.h"
-
-#endif /*CHAN_TYPE != GL_FLOAT*/
-
-
-
-/*
- * Render an RGBA triangle with arbitrary attributes.
- */
-#define NAME general_triangle
-#define INTERP_Z 1
-#define INTERP_RGB 1
-#define INTERP_ALPHA 1
-#define INTERP_ATTRIBS 1
-#define RENDER_SPAN( span ) _swrast_write_rgba_span(ctx, &span);
-#include "s_tritemp.h"
-
-
-
-
-/*
- * Special tri function for occlusion testing
- */
-#define NAME occlusion_zless_triangle
-#define INTERP_Z 1
-#define SETUP_CODE \
- struct gl_renderbuffer *rb = ctx->DrawBuffer->_DepthBuffer; \
- struct gl_query_object *q = ctx->Query.CurrentOcclusionObject; \
- ASSERT(ctx->Depth.Test); \
- ASSERT(!ctx->Depth.Mask); \
- ASSERT(ctx->Depth.Func == GL_LESS); \
- if (!q) { \
- return; \
- }
-#define RENDER_SPAN( span ) \
- if (rb->Format == MESA_FORMAT_Z16) { \
- GLuint i; \
- const GLushort *zRow = (const GLushort *) \
- rb->GetPointer(ctx, rb, span.x, span.y); \
- for (i = 0; i < span.end; i++) { \
- GLuint z = FixedToDepth(span.z); \
- if (z < zRow[i]) { \
- q->Result++; \
- } \
- span.z += span.zStep; \
- } \
- } \
- else { \
- GLuint i; \
- const GLuint *zRow = (const GLuint *) \
- rb->GetPointer(ctx, rb, span.x, span.y); \
- for (i = 0; i < span.end; i++) { \
- if ((GLuint)span.z < zRow[i]) { \
- q->Result++; \
- } \
- span.z += span.zStep; \
- } \
- }
-#include "s_tritemp.h"
-
-
-
-static void
-nodraw_triangle( struct gl_context *ctx,
- const SWvertex *v0,
- const SWvertex *v1,
- const SWvertex *v2 )
-{
- (void) (ctx && v0 && v1 && v2);
-}
-
-
-/*
- * This is used when separate specular color is enabled, but not
- * texturing. We add the specular color to the primary color,
- * draw the triangle, then restore the original primary color.
- * Inefficient, but seldom needed.
- */
-void
-_swrast_add_spec_terms_triangle(struct gl_context *ctx, const SWvertex *v0,
- const SWvertex *v1, const SWvertex *v2)
-{
- SWvertex *ncv0 = (SWvertex *)v0; /* drop const qualifier */
- SWvertex *ncv1 = (SWvertex *)v1;
- SWvertex *ncv2 = (SWvertex *)v2;
- GLfloat rSum, gSum, bSum;
- GLchan cSave[3][4];
-
- /* save original colors */
- COPY_CHAN4( cSave[0], ncv0->color );
- COPY_CHAN4( cSave[1], ncv1->color );
- COPY_CHAN4( cSave[2], ncv2->color );
- /* sum v0 */
- rSum = CHAN_TO_FLOAT(ncv0->color[0]) + ncv0->attrib[FRAG_ATTRIB_COL1][0];
- gSum = CHAN_TO_FLOAT(ncv0->color[1]) + ncv0->attrib[FRAG_ATTRIB_COL1][1];
- bSum = CHAN_TO_FLOAT(ncv0->color[2]) + ncv0->attrib[FRAG_ATTRIB_COL1][2];
- UNCLAMPED_FLOAT_TO_CHAN(ncv0->color[0], rSum);
- UNCLAMPED_FLOAT_TO_CHAN(ncv0->color[1], gSum);
- UNCLAMPED_FLOAT_TO_CHAN(ncv0->color[2], bSum);
- /* sum v1 */
- rSum = CHAN_TO_FLOAT(ncv1->color[0]) + ncv1->attrib[FRAG_ATTRIB_COL1][0];
- gSum = CHAN_TO_FLOAT(ncv1->color[1]) + ncv1->attrib[FRAG_ATTRIB_COL1][1];
- bSum = CHAN_TO_FLOAT(ncv1->color[2]) + ncv1->attrib[FRAG_ATTRIB_COL1][2];
- UNCLAMPED_FLOAT_TO_CHAN(ncv1->color[0], rSum);
- UNCLAMPED_FLOAT_TO_CHAN(ncv1->color[1], gSum);
- UNCLAMPED_FLOAT_TO_CHAN(ncv1->color[2], bSum);
- /* sum v2 */
- rSum = CHAN_TO_FLOAT(ncv2->color[0]) + ncv2->attrib[FRAG_ATTRIB_COL1][0];
- gSum = CHAN_TO_FLOAT(ncv2->color[1]) + ncv2->attrib[FRAG_ATTRIB_COL1][1];
- bSum = CHAN_TO_FLOAT(ncv2->color[2]) + ncv2->attrib[FRAG_ATTRIB_COL1][2];
- UNCLAMPED_FLOAT_TO_CHAN(ncv2->color[0], rSum);
- UNCLAMPED_FLOAT_TO_CHAN(ncv2->color[1], gSum);
- UNCLAMPED_FLOAT_TO_CHAN(ncv2->color[2], bSum);
- /* draw */
- SWRAST_CONTEXT(ctx)->SpecTriangle( ctx, ncv0, ncv1, ncv2 );
- /* restore original colors */
- COPY_CHAN4( ncv0->color, cSave[0] );
- COPY_CHAN4( ncv1->color, cSave[1] );
- COPY_CHAN4( ncv2->color, cSave[2] );
-}
-
-
-
-#ifdef DEBUG
-
-/* record the current triangle function name */
-const char *_mesa_triFuncName = NULL;
-
-#define USE(triFunc) \
-do { \
- _mesa_triFuncName = #triFunc; \
- /*printf("%s\n", _mesa_triFuncName);*/ \
- swrast->Triangle = triFunc; \
-} while (0)
-
-#else
-
-#define USE(triFunc) swrast->Triangle = triFunc;
-
-#endif
-
-
-
-
-/*
- * Determine which triangle rendering function to use given the current
- * rendering context.
- *
- * Please update the summary flag _SWRAST_NEW_TRIANGLE if you add or
- * remove tests to this code.
- */
-void
-_swrast_choose_triangle( struct gl_context *ctx )
-{
- SWcontext *swrast = SWRAST_CONTEXT(ctx);
-
- if (ctx->Polygon.CullFlag &&
- ctx->Polygon.CullFaceMode == GL_FRONT_AND_BACK) {
- USE(nodraw_triangle);
- return;
- }
-
- if (ctx->RenderMode==GL_RENDER) {
-
- if (ctx->Polygon.SmoothFlag) {
- _swrast_set_aa_triangle_function(ctx);
- ASSERT(swrast->Triangle);
- return;
- }
-
- /* special case for occlusion testing */
- if (ctx->Query.CurrentOcclusionObject &&
- ctx->Depth.Test &&
- ctx->Depth.Mask == GL_FALSE &&
- ctx->Depth.Func == GL_LESS &&
- !ctx->Stencil._Enabled) {
- if (ctx->Color.ColorMask[0][0] == 0 &&
- ctx->Color.ColorMask[0][1] == 0 &&
- ctx->Color.ColorMask[0][2] == 0 &&
- ctx->Color.ColorMask[0][3] == 0) {
- USE(occlusion_zless_triangle);
- return;
- }
- }
-
- /*
- * XXX should examine swrast->_ActiveAttribMask to determine what
- * needs to be interpolated.
- */
- if (ctx->Texture._EnabledCoordUnits ||
- ctx->FragmentProgram._Current ||
- ctx->ATIFragmentShader._Enabled ||
- _mesa_need_secondary_color(ctx) ||
- swrast->_FogEnabled) {
- /* Ugh, we do a _lot_ of tests to pick the best textured tri func */
- const struct gl_texture_object *texObj2D;
- const struct gl_texture_image *texImg;
- GLenum minFilter, magFilter, envMode;
- gl_format format;
- texObj2D = ctx->Texture.Unit[0].CurrentTex[TEXTURE_2D_INDEX];
-
- texImg = texObj2D ? texObj2D->Image[0][texObj2D->BaseLevel] : NULL;
- format = texImg ? texImg->TexFormat : MESA_FORMAT_NONE;
- minFilter = texObj2D ? texObj2D->Sampler.MinFilter : GL_NONE;
- magFilter = texObj2D ? texObj2D->Sampler.MagFilter : GL_NONE;
- envMode = ctx->Texture.Unit[0].EnvMode;
-
- /* First see if we can use an optimized 2-D texture function */
- if (ctx->Texture._EnabledCoordUnits == 0x1
- && !ctx->FragmentProgram._Current
- && !ctx->ATIFragmentShader._Enabled
- && ctx->Texture._EnabledUnits == 0x1
- && ctx->Texture.Unit[0]._ReallyEnabled == TEXTURE_2D_BIT
- && texObj2D->Sampler.WrapS == GL_REPEAT
- && texObj2D->Sampler.WrapT == GL_REPEAT
- && texObj2D->_Swizzle == SWIZZLE_NOOP
- && texImg->_IsPowerOfTwo
- && texImg->Border == 0
- && texImg->Width == texImg->RowStride
- && (format == MESA_FORMAT_RGB888 || format == MESA_FORMAT_RGBA8888)
- && minFilter == magFilter
- && ctx->Light.Model.ColorControl == GL_SINGLE_COLOR
- && !swrast->_FogEnabled
- && ctx->Texture.Unit[0].EnvMode != GL_COMBINE_EXT
- && ctx->Texture.Unit[0].EnvMode != GL_COMBINE4_NV) {
- if (ctx->Hint.PerspectiveCorrection==GL_FASTEST) {
- if (minFilter == GL_NEAREST
- && format == MESA_FORMAT_RGB888
- && (envMode == GL_REPLACE || envMode == GL_DECAL)
- && ((swrast->_RasterMask == (DEPTH_BIT | TEXTURE_BIT)
- && ctx->Depth.Func == GL_LESS
- && ctx->Depth.Mask == GL_TRUE)
- || swrast->_RasterMask == TEXTURE_BIT)
- && ctx->Polygon.StippleFlag == GL_FALSE
- && ctx->DrawBuffer->Visual.depthBits <= 16) {
- if (swrast->_RasterMask == (DEPTH_BIT | TEXTURE_BIT)) {
- USE(simple_z_textured_triangle);
- }
- else {
- USE(simple_textured_triangle);
- }
- }
- else {
-#if CHAN_BITS != 8
- USE(general_triangle);
-#else
- if (format == MESA_FORMAT_RGBA8888 && !_mesa_little_endian()) {
- /* We only handle RGBA8888 correctly on little endian
- * in the optimized code above.
- */
- USE(general_triangle);
- }
- else {
- USE(affine_textured_triangle);
- }
-#endif
- }
- }
- else {
-#if CHAN_BITS != 8
- USE(general_triangle);
-#else
- USE(persp_textured_triangle);
-#endif
- }
- }
- else {
- /* general case textured triangles */
- USE(general_triangle);
- }
- }
- else {
- ASSERT(!swrast->_FogEnabled);
- ASSERT(!_mesa_need_secondary_color(ctx));
- if (ctx->Light.ShadeModel==GL_SMOOTH) {
- /* smooth shaded, no texturing, stippled or some raster ops */
-#if CHAN_BITS != 8
- USE(general_triangle);
-#else
- USE(smooth_rgba_triangle);
-#endif
- }
- else {
- /* flat shaded, no texturing, stippled or some raster ops */
-#if CHAN_BITS != 8
- USE(general_triangle);
-#else
- USE(flat_rgba_triangle);
-#endif
- }
- }
- }
- else if (ctx->RenderMode==GL_FEEDBACK) {
- USE(_swrast_feedback_triangle);
- }
- else {
- /* GL_SELECT mode */
- USE(_swrast_select_triangle);
- }
-}
+/*
+ * Mesa 3-D graphics library
+ * Version: 7.3
+ *
+ * Copyright (C) 1999-2007 Brian Paul All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+
+/*
+ * When the device driver doesn't implement triangle rasterization it
+ * can hook in _swrast_Triangle, which eventually calls one of these
+ * functions to draw triangles.
+ */
+
+#include "main/glheader.h"
+#include "main/context.h"
+#include "main/colormac.h"
+#include "main/imports.h"
+#include "main/macros.h"
+#include "main/mtypes.h"
+#include "main/state.h"
+#include "program/prog_instruction.h"
+
+#include "s_aatriangle.h"
+#include "s_context.h"
+#include "s_feedback.h"
+#include "s_span.h"
+#include "s_triangle.h"
+
+
+/**
+ * Test if a triangle should be culled. Used for feedback and selection mode.
+ * \return GL_TRUE if the triangle is to be culled, GL_FALSE otherwise.
+ */
+GLboolean
+_swrast_culltriangle( struct gl_context *ctx,
+ const SWvertex *v0,
+ const SWvertex *v1,
+ const SWvertex *v2 )
+{
+ SWcontext *swrast = SWRAST_CONTEXT(ctx);
+ GLfloat ex = v1->attrib[FRAG_ATTRIB_WPOS][0] - v0->attrib[FRAG_ATTRIB_WPOS][0];
+ GLfloat ey = v1->attrib[FRAG_ATTRIB_WPOS][1] - v0->attrib[FRAG_ATTRIB_WPOS][1];
+ GLfloat fx = v2->attrib[FRAG_ATTRIB_WPOS][0] - v0->attrib[FRAG_ATTRIB_WPOS][0];
+ GLfloat fy = v2->attrib[FRAG_ATTRIB_WPOS][1] - v0->attrib[FRAG_ATTRIB_WPOS][1];
+ GLfloat c = ex*fy-ey*fx;
+
+ if (c * swrast->_BackfaceSign * swrast->_BackfaceCullSign <= 0.0F)
+ return GL_FALSE;
+
+ return GL_TRUE;
+}
+
+
+
+/*
+ * Render a flat-shaded RGBA triangle.
+ */
+#define NAME flat_rgba_triangle
+#define INTERP_Z 1
+#define SETUP_CODE \
+ ASSERT(ctx->Texture._EnabledCoordUnits == 0);\
+ ASSERT(ctx->Light.ShadeModel==GL_FLAT); \
+ span.interpMask |= SPAN_RGBA; \
+ span.red = ChanToFixed(v2->color[0]); \
+ span.green = ChanToFixed(v2->color[1]); \
+ span.blue = ChanToFixed(v2->color[2]); \
+ span.alpha = ChanToFixed(v2->color[3]); \
+ span.redStep = 0; \
+ span.greenStep = 0; \
+ span.blueStep = 0; \
+ span.alphaStep = 0;
+#define RENDER_SPAN( span ) _swrast_write_rgba_span(ctx, &span);
+#include "s_tritemp.h"
+
+
+
+/*
+ * Render a smooth-shaded RGBA triangle.
+ */
+#define NAME smooth_rgba_triangle
+#define INTERP_Z 1
+#define INTERP_RGB 1
+#define INTERP_ALPHA 1
+#define SETUP_CODE \
+ { \
+ /* texturing must be off */ \
+ ASSERT(ctx->Texture._EnabledCoordUnits == 0); \
+ ASSERT(ctx->Light.ShadeModel==GL_SMOOTH); \
+ }
+#define RENDER_SPAN( span ) _swrast_write_rgba_span(ctx, &span);
+#include "s_tritemp.h"
+
+
+
+/*
+ * Render an RGB, GL_DECAL, textured triangle.
+ * Interpolate S,T only w/out mipmapping or perspective correction.
+ *
+ * No fog. No depth testing.
+ */
+#define NAME simple_textured_triangle
+#define INTERP_INT_TEX 1
+#define S_SCALE twidth
+#define T_SCALE theight
+
+#define SETUP_CODE \
+ struct gl_renderbuffer *rb = ctx->DrawBuffer->_ColorDrawBuffers[0]; \
+ const struct gl_texture_object *obj = \
+ ctx->Texture.Unit[0].CurrentTex[TEXTURE_2D_INDEX]; \
+ const struct gl_texture_image *texImg = \
+ obj->Image[0][obj->BaseLevel]; \
+ const GLfloat twidth = (GLfloat) texImg->Width; \
+ const GLfloat theight = (GLfloat) texImg->Height; \
+ const GLint twidth_log2 = texImg->WidthLog2; \
+ const GLubyte *texture = (const GLubyte *) texImg->Data; \
+ const GLint smask = texImg->Width - 1; \
+ const GLint tmask = texImg->Height - 1; \
+ ASSERT(texImg->TexFormat == MESA_FORMAT_RGB888); \
+ if (!rb || !texture) { \
+ return; \
+ }
+
+#define RENDER_SPAN( span ) \
+ GLuint i; \
+ GLubyte rgb[MAX_WIDTH][3]; \
+ span.intTex[0] -= FIXED_HALF; /* off-by-one error? */ \
+ span.intTex[1] -= FIXED_HALF; \
+ for (i = 0; i < span.end; i++) { \
+ GLint s = FixedToInt(span.intTex[0]) & smask; \
+ GLint t = FixedToInt(span.intTex[1]) & tmask; \
+ GLint pos = (t << twidth_log2) + s; \
+ pos = pos + pos + pos; /* multiply by 3 */ \
+ rgb[i][RCOMP] = texture[pos+2]; \
+ rgb[i][GCOMP] = texture[pos+1]; \
+ rgb[i][BCOMP] = texture[pos+0]; \
+ span.intTex[0] += span.intTexStep[0]; \
+ span.intTex[1] += span.intTexStep[1]; \
+ } \
+ rb->PutRowRGB(ctx, rb, span.end, span.x, span.y, rgb, NULL);
+
+#include "s_tritemp.h"
+
+
+
+/*
+ * Render an RGB, GL_DECAL, textured triangle.
+ * Interpolate S,T, GL_LESS depth test, w/out mipmapping or
+ * perspective correction.
+ * Depth buffer bits must be <= sizeof(DEFAULT_SOFTWARE_DEPTH_TYPE)
+ *
+ * No fog.
+ */
+#define NAME simple_z_textured_triangle
+#define INTERP_Z 1
+#define DEPTH_TYPE DEFAULT_SOFTWARE_DEPTH_TYPE
+#define INTERP_INT_TEX 1
+#define S_SCALE twidth
+#define T_SCALE theight
+
+#define SETUP_CODE \
+ struct gl_renderbuffer *rb = ctx->DrawBuffer->_ColorDrawBuffers[0]; \
+ const struct gl_texture_object *obj = \
+ ctx->Texture.Unit[0].CurrentTex[TEXTURE_2D_INDEX]; \
+ const struct gl_texture_image *texImg = \
+ obj->Image[0][obj->BaseLevel]; \
+ const GLfloat twidth = (GLfloat) texImg->Width; \
+ const GLfloat theight = (GLfloat) texImg->Height; \
+ const GLint twidth_log2 = texImg->WidthLog2; \
+ const GLubyte *texture = (const GLubyte *) texImg->Data; \
+ const GLint smask = texImg->Width - 1; \
+ const GLint tmask = texImg->Height - 1; \
+ ASSERT(texImg->TexFormat == MESA_FORMAT_RGB888); \
+ if (!rb || !texture) { \
+ return; \
+ }
+
+#define RENDER_SPAN( span ) \
+ GLuint i; \
+ GLubyte rgb[MAX_WIDTH][3]; \
+ span.intTex[0] -= FIXED_HALF; /* off-by-one error? */ \
+ span.intTex[1] -= FIXED_HALF; \
+ for (i = 0; i < span.end; i++) { \
+ const GLuint z = FixedToDepth(span.z); \
+ if (z < zRow[i]) { \
+ GLint s = FixedToInt(span.intTex[0]) & smask; \
+ GLint t = FixedToInt(span.intTex[1]) & tmask; \
+ GLint pos = (t << twidth_log2) + s; \
+ pos = pos + pos + pos; /* multiply by 3 */ \
+ rgb[i][RCOMP] = texture[pos+2]; \
+ rgb[i][GCOMP] = texture[pos+1]; \
+ rgb[i][BCOMP] = texture[pos+0]; \
+ zRow[i] = z; \
+ span.array->mask[i] = 1; \
+ } \
+ else { \
+ span.array->mask[i] = 0; \
+ } \
+ span.intTex[0] += span.intTexStep[0]; \
+ span.intTex[1] += span.intTexStep[1]; \
+ span.z += span.zStep; \
+ } \
+ rb->PutRowRGB(ctx, rb, span.end, span.x, span.y, rgb, span.array->mask);
+
+#include "s_tritemp.h"
+
+
+#if CHAN_TYPE != GL_FLOAT
+
+struct affine_info
+{
+ GLenum filter;
+ GLenum format;
+ GLenum envmode;
+ GLint smask, tmask;
+ GLint twidth_log2;
+ const GLchan *texture;
+ GLfixed er, eg, eb, ea;
+ GLint tbytesline, tsize;
+};
+
+
+static INLINE GLint
+ilerp(GLint t, GLint a, GLint b)
+{
+ return a + ((t * (b - a)) >> FIXED_SHIFT);
+}
+
+static INLINE GLint
+ilerp_2d(GLint ia, GLint ib, GLint v00, GLint v10, GLint v01, GLint v11)
+{
+ const GLint temp0 = ilerp(ia, v00, v10);
+ const GLint temp1 = ilerp(ia, v01, v11);
+ return ilerp(ib, temp0, temp1);
+}
+
+
+/* This function can handle GL_NEAREST or GL_LINEAR sampling of 2D RGB or RGBA
+ * textures with GL_REPLACE, GL_MODULATE, GL_BLEND, GL_DECAL or GL_ADD
+ * texture env modes.
+ */
+static INLINE void
+affine_span(struct gl_context *ctx, SWspan *span,
+ struct affine_info *info)
+{
+ GLchan sample[4]; /* the filtered texture sample */
+ const GLuint texEnableSave = ctx->Texture._EnabledCoordUnits;
+
+ /* Instead of defining a function for each mode, a test is done
+ * between the outer and inner loops. This is to reduce code size
+ * and complexity. Observe that an optimizing compiler kills
+ * unused variables (for instance tf,sf,ti,si in case of GL_NEAREST).
+ */
+
+#define NEAREST_RGB \
+ sample[RCOMP] = tex00[2]; \
+ sample[GCOMP] = tex00[1]; \
+ sample[BCOMP] = tex00[0]; \
+ sample[ACOMP] = CHAN_MAX;
+
+#define LINEAR_RGB \
+ sample[RCOMP] = ilerp_2d(sf, tf, tex00[2], tex01[2], tex10[2], tex11[2]);\
+ sample[GCOMP] = ilerp_2d(sf, tf, tex00[1], tex01[1], tex10[1], tex11[1]);\
+ sample[BCOMP] = ilerp_2d(sf, tf, tex00[0], tex01[0], tex10[0], tex11[0]);\
+ sample[ACOMP] = CHAN_MAX;
+
+#define NEAREST_RGBA \
+ sample[RCOMP] = tex00[3]; \
+ sample[GCOMP] = tex00[2]; \
+ sample[BCOMP] = tex00[1]; \
+ sample[ACOMP] = tex00[0];
+
+#define LINEAR_RGBA \
+ sample[RCOMP] = ilerp_2d(sf, tf, tex00[3], tex01[3], tex10[3], tex11[3]);\
+ sample[GCOMP] = ilerp_2d(sf, tf, tex00[2], tex01[2], tex10[2], tex11[2]);\
+ sample[BCOMP] = ilerp_2d(sf, tf, tex00[1], tex01[1], tex10[1], tex11[1]);\
+ sample[ACOMP] = ilerp_2d(sf, tf, tex00[0], tex01[0], tex10[0], tex11[0])
+
+#define MODULATE \
+ dest[RCOMP] = span->red * (sample[RCOMP] + 1u) >> (FIXED_SHIFT + 8); \
+ dest[GCOMP] = span->green * (sample[GCOMP] + 1u) >> (FIXED_SHIFT + 8); \
+ dest[BCOMP] = span->blue * (sample[BCOMP] + 1u) >> (FIXED_SHIFT + 8); \
+ dest[ACOMP] = span->alpha * (sample[ACOMP] + 1u) >> (FIXED_SHIFT + 8)
+
+#define DECAL \
+ dest[RCOMP] = ((CHAN_MAX - sample[ACOMP]) * span->red + \
+ ((sample[ACOMP] + 1) * sample[RCOMP] << FIXED_SHIFT)) \
+ >> (FIXED_SHIFT + 8); \
+ dest[GCOMP] = ((CHAN_MAX - sample[ACOMP]) * span->green + \
+ ((sample[ACOMP] + 1) * sample[GCOMP] << FIXED_SHIFT)) \
+ >> (FIXED_SHIFT + 8); \
+ dest[BCOMP] = ((CHAN_MAX - sample[ACOMP]) * span->blue + \
+ ((sample[ACOMP] + 1) * sample[BCOMP] << FIXED_SHIFT)) \
+ >> (FIXED_SHIFT + 8); \
+ dest[ACOMP] = FixedToInt(span->alpha)
+
+#define BLEND \
+ dest[RCOMP] = ((CHAN_MAX - sample[RCOMP]) * span->red \
+ + (sample[RCOMP] + 1) * info->er) >> (FIXED_SHIFT + 8); \
+ dest[GCOMP] = ((CHAN_MAX - sample[GCOMP]) * span->green \
+ + (sample[GCOMP] + 1) * info->eg) >> (FIXED_SHIFT + 8); \
+ dest[BCOMP] = ((CHAN_MAX - sample[BCOMP]) * span->blue \
+ + (sample[BCOMP] + 1) * info->eb) >> (FIXED_SHIFT + 8); \
+ dest[ACOMP] = span->alpha * (sample[ACOMP] + 1) >> (FIXED_SHIFT + 8)
+
+#define REPLACE COPY_CHAN4(dest, sample)
+
+#define ADD \
+ { \
+ GLint rSum = FixedToInt(span->red) + (GLint) sample[RCOMP]; \
+ GLint gSum = FixedToInt(span->green) + (GLint) sample[GCOMP]; \
+ GLint bSum = FixedToInt(span->blue) + (GLint) sample[BCOMP]; \
+ dest[RCOMP] = MIN2(rSum, CHAN_MAX); \
+ dest[GCOMP] = MIN2(gSum, CHAN_MAX); \
+ dest[BCOMP] = MIN2(bSum, CHAN_MAX); \
+ dest[ACOMP] = span->alpha * (sample[ACOMP] + 1) >> (FIXED_SHIFT + 8); \
+ }
+
+/* shortcuts */
+
+#define NEAREST_RGB_REPLACE \
+ NEAREST_RGB; \
+ dest[0] = sample[0]; \
+ dest[1] = sample[1]; \
+ dest[2] = sample[2]; \
+ dest[3] = FixedToInt(span->alpha);
+
+#define NEAREST_RGBA_REPLACE \
+ dest[RCOMP] = tex00[3]; \
+ dest[GCOMP] = tex00[2]; \
+ dest[BCOMP] = tex00[1]; \
+ dest[ACOMP] = tex00[0]
+
+#define SPAN_NEAREST(DO_TEX, COMPS) \
+ for (i = 0; i < span->end; i++) { \
+ /* Isn't it necessary to use FixedFloor below?? */ \
+ GLint s = FixedToInt(span->intTex[0]) & info->smask; \
+ GLint t = FixedToInt(span->intTex[1]) & info->tmask; \
+ GLint pos = (t << info->twidth_log2) + s; \
+ const GLchan *tex00 = info->texture + COMPS * pos; \
+ DO_TEX; \
+ span->red += span->redStep; \
+ span->green += span->greenStep; \
+ span->blue += span->blueStep; \
+ span->alpha += span->alphaStep; \
+ span->intTex[0] += span->intTexStep[0]; \
+ span->intTex[1] += span->intTexStep[1]; \
+ dest += 4; \
+ }
+
+#define SPAN_LINEAR(DO_TEX, COMPS) \
+ for (i = 0; i < span->end; i++) { \
+ /* Isn't it necessary to use FixedFloor below?? */ \
+ const GLint s = FixedToInt(span->intTex[0]) & info->smask; \
+ const GLint t = FixedToInt(span->intTex[1]) & info->tmask; \
+ const GLfixed sf = span->intTex[0] & FIXED_FRAC_MASK; \
+ const GLfixed tf = span->intTex[1] & FIXED_FRAC_MASK; \
+ const GLint pos = (t << info->twidth_log2) + s; \
+ const GLchan *tex00 = info->texture + COMPS * pos; \
+ const GLchan *tex10 = tex00 + info->tbytesline; \
+ const GLchan *tex01 = tex00 + COMPS; \
+ const GLchan *tex11 = tex10 + COMPS; \
+ if (t == info->tmask) { \
+ tex10 -= info->tsize; \
+ tex11 -= info->tsize; \
+ } \
+ if (s == info->smask) { \
+ tex01 -= info->tbytesline; \
+ tex11 -= info->tbytesline; \
+ } \
+ DO_TEX; \
+ span->red += span->redStep; \
+ span->green += span->greenStep; \
+ span->blue += span->blueStep; \
+ span->alpha += span->alphaStep; \
+ span->intTex[0] += span->intTexStep[0]; \
+ span->intTex[1] += span->intTexStep[1]; \
+ dest += 4; \
+ }
+
+
+ GLuint i;
+ GLchan *dest = span->array->rgba[0];
+
+ /* Disable tex units so they're not re-applied in swrast_write_rgba_span */
+ ctx->Texture._EnabledCoordUnits = 0x0;
+
+ span->intTex[0] -= FIXED_HALF;
+ span->intTex[1] -= FIXED_HALF;
+ switch (info->filter) {
+ case GL_NEAREST:
+ switch (info->format) {
+ case MESA_FORMAT_RGB888:
+ switch (info->envmode) {
+ case GL_MODULATE:
+ SPAN_NEAREST(NEAREST_RGB;MODULATE,3);
+ break;
+ case GL_DECAL:
+ case GL_REPLACE:
+ SPAN_NEAREST(NEAREST_RGB_REPLACE,3);
+ break;
+ case GL_BLEND:
+ SPAN_NEAREST(NEAREST_RGB;BLEND,3);
+ break;
+ case GL_ADD:
+ SPAN_NEAREST(NEAREST_RGB;ADD,3);
+ break;
+ default:
+ _mesa_problem(ctx, "bad tex env mode in SPAN_LINEAR");
+ return;
+ }
+ break;
+ case MESA_FORMAT_RGBA8888:
+ switch(info->envmode) {
+ case GL_MODULATE:
+ SPAN_NEAREST(NEAREST_RGBA;MODULATE,4);
+ break;
+ case GL_DECAL:
+ SPAN_NEAREST(NEAREST_RGBA;DECAL,4);
+ break;
+ case GL_BLEND:
+ SPAN_NEAREST(NEAREST_RGBA;BLEND,4);
+ break;
+ case GL_ADD:
+ SPAN_NEAREST(NEAREST_RGBA;ADD,4);
+ break;
+ case GL_REPLACE:
+ SPAN_NEAREST(NEAREST_RGBA_REPLACE,4);
+ break;
+ default:
+ _mesa_problem(ctx, "bad tex env mode (2) in SPAN_LINEAR");
+ return;
+ }
+ break;
+ }
+ break;
+
+ case GL_LINEAR:
+ span->intTex[0] -= FIXED_HALF;
+ span->intTex[1] -= FIXED_HALF;
+ switch (info->format) {
+ case MESA_FORMAT_RGB888:
+ switch (info->envmode) {
+ case GL_MODULATE:
+ SPAN_LINEAR(LINEAR_RGB;MODULATE,3);
+ break;
+ case GL_DECAL:
+ case GL_REPLACE:
+ SPAN_LINEAR(LINEAR_RGB;REPLACE,3);
+ break;
+ case GL_BLEND:
+ SPAN_LINEAR(LINEAR_RGB;BLEND,3);
+ break;
+ case GL_ADD:
+ SPAN_LINEAR(LINEAR_RGB;ADD,3);
+ break;
+ default:
+ _mesa_problem(ctx, "bad tex env mode (3) in SPAN_LINEAR");
+ return;
+ }
+ break;
+ case MESA_FORMAT_RGBA8888:
+ switch (info->envmode) {
+ case GL_MODULATE:
+ SPAN_LINEAR(LINEAR_RGBA;MODULATE,4);
+ break;
+ case GL_DECAL:
+ SPAN_LINEAR(LINEAR_RGBA;DECAL,4);
+ break;
+ case GL_BLEND:
+ SPAN_LINEAR(LINEAR_RGBA;BLEND,4);
+ break;
+ case GL_ADD:
+ SPAN_LINEAR(LINEAR_RGBA;ADD,4);
+ break;
+ case GL_REPLACE:
+ SPAN_LINEAR(LINEAR_RGBA;REPLACE,4);
+ break;
+ default:
+ _mesa_problem(ctx, "bad tex env mode (4) in SPAN_LINEAR");
+ return;
+ }
+ break;
+ }
+ break;
+ }
+ span->interpMask &= ~SPAN_RGBA;
+ ASSERT(span->arrayMask & SPAN_RGBA);
+
+ _swrast_write_rgba_span(ctx, span);
+
+ /* re-enable texture units */
+ ctx->Texture._EnabledCoordUnits = texEnableSave;
+
+#undef SPAN_NEAREST
+#undef SPAN_LINEAR
+}
+
+
+
+/*
+ * Render an RGB/RGBA textured triangle without perspective correction.
+ */
+#define NAME affine_textured_triangle
+#define INTERP_Z 1
+#define INTERP_RGB 1
+#define INTERP_ALPHA 1
+#define INTERP_INT_TEX 1
+#define S_SCALE twidth
+#define T_SCALE theight
+
+#define SETUP_CODE \
+ struct affine_info info; \
+ struct gl_texture_unit *unit = ctx->Texture.Unit+0; \
+ const struct gl_texture_object *obj = \
+ ctx->Texture.Unit[0].CurrentTex[TEXTURE_2D_INDEX]; \
+ const struct gl_texture_image *texImg = \
+ obj->Image[0][obj->BaseLevel]; \
+ const GLfloat twidth = (GLfloat) texImg->Width; \
+ const GLfloat theight = (GLfloat) texImg->Height; \
+ info.texture = (const GLchan *) texImg->Data; \
+ info.twidth_log2 = texImg->WidthLog2; \
+ info.smask = texImg->Width - 1; \
+ info.tmask = texImg->Height - 1; \
+ info.format = texImg->TexFormat; \
+ info.filter = obj->Sampler.MinFilter; \
+ info.envmode = unit->EnvMode; \
+ info.er = 0; \
+ info.eg = 0; \
+ info.eb = 0; \
+ span.arrayMask |= SPAN_RGBA; \
+ \
+ if (info.envmode == GL_BLEND) { \
+ /* potential off-by-one error here? (1.0f -> 2048 -> 0) */ \
+ info.er = FloatToFixed(unit->EnvColor[RCOMP] * CHAN_MAXF); \
+ info.eg = FloatToFixed(unit->EnvColor[GCOMP] * CHAN_MAXF); \
+ info.eb = FloatToFixed(unit->EnvColor[BCOMP] * CHAN_MAXF); \
+ info.ea = FloatToFixed(unit->EnvColor[ACOMP] * CHAN_MAXF); \
+ } \
+ if (!info.texture) { \
+ /* this shouldn't happen */ \
+ return; \
+ } \
+ \
+ switch (info.format) { \
+ case MESA_FORMAT_RGB888: \
+ info.tbytesline = texImg->Width * 3; \
+ break; \
+ case MESA_FORMAT_RGBA8888: \
+ info.tbytesline = texImg->Width * 4; \
+ break; \
+ default: \
+ _mesa_problem(NULL, "Bad texture format in affine_texture_triangle");\
+ return; \
+ } \
+ info.tsize = texImg->Height * info.tbytesline;
+
+#define RENDER_SPAN( span ) affine_span(ctx, &span, &info);
+
+#include "s_tritemp.h"
+
+
+
+struct persp_info
+{
+ GLenum filter;
+ GLenum format;
+ GLenum envmode;
+ GLint smask, tmask;
+ GLint twidth_log2;
+ const GLchan *texture;
+ GLfixed er, eg, eb, ea; /* texture env color */
+ GLint tbytesline, tsize;
+};
+
+
+static INLINE void
+fast_persp_span(struct gl_context *ctx, SWspan *span,
+ struct persp_info *info)
+{
+ GLchan sample[4]; /* the filtered texture sample */
+
+ /* Instead of defining a function for each mode, a test is done
+ * between the outer and inner loops. This is to reduce code size
+ * and complexity. Observe that an optimizing compiler kills
+ * unused variables (for instance tf,sf,ti,si in case of GL_NEAREST).
+ */
+#define SPAN_NEAREST(DO_TEX,COMP) \
+ for (i = 0; i < span->end; i++) { \
+ GLdouble invQ = tex_coord[2] ? \
+ (1.0 / tex_coord[2]) : 1.0; \
+ GLfloat s_tmp = (GLfloat) (tex_coord[0] * invQ); \
+ GLfloat t_tmp = (GLfloat) (tex_coord[1] * invQ); \
+ GLint s = IFLOOR(s_tmp) & info->smask; \
+ GLint t = IFLOOR(t_tmp) & info->tmask; \
+ GLint pos = (t << info->twidth_log2) + s; \
+ const GLchan *tex00 = info->texture + COMP * pos; \
+ DO_TEX; \
+ span->red += span->redStep; \
+ span->green += span->greenStep; \
+ span->blue += span->blueStep; \
+ span->alpha += span->alphaStep; \
+ tex_coord[0] += tex_step[0]; \
+ tex_coord[1] += tex_step[1]; \
+ tex_coord[2] += tex_step[2]; \
+ dest += 4; \
+ }
+
+#define SPAN_LINEAR(DO_TEX,COMP) \
+ for (i = 0; i < span->end; i++) { \
+ GLdouble invQ = tex_coord[2] ? \
+ (1.0 / tex_coord[2]) : 1.0; \
+ const GLfloat s_tmp = (GLfloat) (tex_coord[0] * invQ); \
+ const GLfloat t_tmp = (GLfloat) (tex_coord[1] * invQ); \
+ const GLfixed s_fix = FloatToFixed(s_tmp) - FIXED_HALF; \
+ const GLfixed t_fix = FloatToFixed(t_tmp) - FIXED_HALF; \
+ const GLint s = FixedToInt(FixedFloor(s_fix)) & info->smask; \
+ const GLint t = FixedToInt(FixedFloor(t_fix)) & info->tmask; \
+ const GLfixed sf = s_fix & FIXED_FRAC_MASK; \
+ const GLfixed tf = t_fix & FIXED_FRAC_MASK; \
+ const GLint pos = (t << info->twidth_log2) + s; \
+ const GLchan *tex00 = info->texture + COMP * pos; \
+ const GLchan *tex10 = tex00 + info->tbytesline; \
+ const GLchan *tex01 = tex00 + COMP; \
+ const GLchan *tex11 = tex10 + COMP; \
+ if (t == info->tmask) { \
+ tex10 -= info->tsize; \
+ tex11 -= info->tsize; \
+ } \
+ if (s == info->smask) { \
+ tex01 -= info->tbytesline; \
+ tex11 -= info->tbytesline; \
+ } \
+ DO_TEX; \
+ span->red += span->redStep; \
+ span->green += span->greenStep; \
+ span->blue += span->blueStep; \
+ span->alpha += span->alphaStep; \
+ tex_coord[0] += tex_step[0]; \
+ tex_coord[1] += tex_step[1]; \
+ tex_coord[2] += tex_step[2]; \
+ dest += 4; \
+ }
+
+ GLuint i;
+ GLfloat tex_coord[3], tex_step[3];
+ GLchan *dest = span->array->rgba[0];
+
+ const GLuint texEnableSave = ctx->Texture._EnabledCoordUnits;
+ ctx->Texture._EnabledCoordUnits = 0;
+
+ tex_coord[0] = span->attrStart[FRAG_ATTRIB_TEX0][0] * (info->smask + 1);
+ tex_step[0] = span->attrStepX[FRAG_ATTRIB_TEX0][0] * (info->smask + 1);
+ tex_coord[1] = span->attrStart[FRAG_ATTRIB_TEX0][1] * (info->tmask + 1);
+ tex_step[1] = span->attrStepX[FRAG_ATTRIB_TEX0][1] * (info->tmask + 1);
+ /* span->attrStart[FRAG_ATTRIB_TEX0][2] only if 3D-texturing, here only 2D */
+ tex_coord[2] = span->attrStart[FRAG_ATTRIB_TEX0][3];
+ tex_step[2] = span->attrStepX[FRAG_ATTRIB_TEX0][3];
+
+ switch (info->filter) {
+ case GL_NEAREST:
+ switch (info->format) {
+ case MESA_FORMAT_RGB888:
+ switch (info->envmode) {
+ case GL_MODULATE:
+ SPAN_NEAREST(NEAREST_RGB;MODULATE,3);
+ break;
+ case GL_DECAL:
+ case GL_REPLACE:
+ SPAN_NEAREST(NEAREST_RGB_REPLACE,3);
+ break;
+ case GL_BLEND:
+ SPAN_NEAREST(NEAREST_RGB;BLEND,3);
+ break;
+ case GL_ADD:
+ SPAN_NEAREST(NEAREST_RGB;ADD,3);
+ break;
+ default:
+ _mesa_problem(ctx, "bad tex env mode (5) in SPAN_LINEAR");
+ return;
+ }
+ break;
+ case MESA_FORMAT_RGBA8888:
+ switch(info->envmode) {
+ case GL_MODULATE:
+ SPAN_NEAREST(NEAREST_RGBA;MODULATE,4);
+ break;
+ case GL_DECAL:
+ SPAN_NEAREST(NEAREST_RGBA;DECAL,4);
+ break;
+ case GL_BLEND:
+ SPAN_NEAREST(NEAREST_RGBA;BLEND,4);
+ break;
+ case GL_ADD:
+ SPAN_NEAREST(NEAREST_RGBA;ADD,4);
+ break;
+ case GL_REPLACE:
+ SPAN_NEAREST(NEAREST_RGBA_REPLACE,4);
+ break;
+ default:
+ _mesa_problem(ctx, "bad tex env mode (6) in SPAN_LINEAR");
+ return;
+ }
+ break;
+ }
+ break;
+
+ case GL_LINEAR:
+ switch (info->format) {
+ case MESA_FORMAT_RGB888:
+ switch (info->envmode) {
+ case GL_MODULATE:
+ SPAN_LINEAR(LINEAR_RGB;MODULATE,3);
+ break;
+ case GL_DECAL:
+ case GL_REPLACE:
+ SPAN_LINEAR(LINEAR_RGB;REPLACE,3);
+ break;
+ case GL_BLEND:
+ SPAN_LINEAR(LINEAR_RGB;BLEND,3);
+ break;
+ case GL_ADD:
+ SPAN_LINEAR(LINEAR_RGB;ADD,3);
+ break;
+ default:
+ _mesa_problem(ctx, "bad tex env mode (7) in SPAN_LINEAR");
+ return;
+ }
+ break;
+ case MESA_FORMAT_RGBA8888:
+ switch (info->envmode) {
+ case GL_MODULATE:
+ SPAN_LINEAR(LINEAR_RGBA;MODULATE,4);
+ break;
+ case GL_DECAL:
+ SPAN_LINEAR(LINEAR_RGBA;DECAL,4);
+ break;
+ case GL_BLEND:
+ SPAN_LINEAR(LINEAR_RGBA;BLEND,4);
+ break;
+ case GL_ADD:
+ SPAN_LINEAR(LINEAR_RGBA;ADD,4);
+ break;
+ case GL_REPLACE:
+ SPAN_LINEAR(LINEAR_RGBA;REPLACE,4);
+ break;
+ default:
+ _mesa_problem(ctx, "bad tex env mode (8) in SPAN_LINEAR");
+ return;
+ }
+ break;
+ }
+ break;
+ }
+
+ ASSERT(span->arrayMask & SPAN_RGBA);
+ _swrast_write_rgba_span(ctx, span);
+
+#undef SPAN_NEAREST
+#undef SPAN_LINEAR
+
+ /* restore state */
+ ctx->Texture._EnabledCoordUnits = texEnableSave;
+}
+
+
+/*
+ * Render an perspective corrected RGB/RGBA textured triangle.
+ * The Q (aka V in Mesa) coordinate must be zero such that the divide
+ * by interpolated Q/W comes out right.
+ *
+ */
+#define NAME persp_textured_triangle
+#define INTERP_Z 1
+#define INTERP_RGB 1
+#define INTERP_ALPHA 1
+#define INTERP_ATTRIBS 1
+
+#define SETUP_CODE \
+ struct persp_info info; \
+ const struct gl_texture_unit *unit = ctx->Texture.Unit+0; \
+ const struct gl_texture_object *obj = \
+ ctx->Texture.Unit[0].CurrentTex[TEXTURE_2D_INDEX]; \
+ const struct gl_texture_image *texImg = \
+ obj->Image[0][obj->BaseLevel]; \
+ info.texture = (const GLchan *) texImg->Data; \
+ info.twidth_log2 = texImg->WidthLog2; \
+ info.smask = texImg->Width - 1; \
+ info.tmask = texImg->Height - 1; \
+ info.format = texImg->TexFormat; \
+ info.filter = obj->Sampler.MinFilter; \
+ info.envmode = unit->EnvMode; \
+ info.er = 0; \
+ info.eg = 0; \
+ info.eb = 0; \
+ \
+ if (info.envmode == GL_BLEND) { \
+ /* potential off-by-one error here? (1.0f -> 2048 -> 0) */ \
+ info.er = FloatToFixed(unit->EnvColor[RCOMP] * CHAN_MAXF); \
+ info.eg = FloatToFixed(unit->EnvColor[GCOMP] * CHAN_MAXF); \
+ info.eb = FloatToFixed(unit->EnvColor[BCOMP] * CHAN_MAXF); \
+ info.ea = FloatToFixed(unit->EnvColor[ACOMP] * CHAN_MAXF); \
+ } \
+ if (!info.texture) { \
+ /* this shouldn't happen */ \
+ return; \
+ } \
+ \
+ switch (info.format) { \
+ case MESA_FORMAT_RGB888: \
+ info.tbytesline = texImg->Width * 3; \
+ break; \
+ case MESA_FORMAT_RGBA8888: \
+ info.tbytesline = texImg->Width * 4; \
+ break; \
+ default: \
+ _mesa_problem(NULL, "Bad texture format in persp_textured_triangle");\
+ return; \
+ } \
+ info.tsize = texImg->Height * info.tbytesline;
+
+#define RENDER_SPAN( span ) \
+ span.interpMask &= ~SPAN_RGBA; \
+ span.arrayMask |= SPAN_RGBA; \
+ fast_persp_span(ctx, &span, &info);
+
+#include "s_tritemp.h"
+
+#endif /*CHAN_TYPE != GL_FLOAT*/
+
+
+
+/*
+ * Render an RGBA triangle with arbitrary attributes.
+ */
+#define NAME general_triangle
+#define INTERP_Z 1
+#define INTERP_RGB 1
+#define INTERP_ALPHA 1
+#define INTERP_ATTRIBS 1
+#define RENDER_SPAN( span ) _swrast_write_rgba_span(ctx, &span);
+#include "s_tritemp.h"
+
+
+
+
+/*
+ * Special tri function for occlusion testing
+ */
+#define NAME occlusion_zless_triangle
+#define INTERP_Z 1
+#define SETUP_CODE \
+ struct gl_renderbuffer *rb = ctx->DrawBuffer->_DepthBuffer; \
+ struct gl_query_object *q = ctx->Query.CurrentOcclusionObject; \
+ ASSERT(ctx->Depth.Test); \
+ ASSERT(!ctx->Depth.Mask); \
+ ASSERT(ctx->Depth.Func == GL_LESS); \
+ if (!q) { \
+ return; \
+ }
+#define RENDER_SPAN( span ) \
+ if (rb->Format == MESA_FORMAT_Z16) { \
+ GLuint i; \
+ const GLushort *zRow = (const GLushort *) \
+ rb->GetPointer(ctx, rb, span.x, span.y); \
+ for (i = 0; i < span.end; i++) { \
+ GLuint z = FixedToDepth(span.z); \
+ if (z < zRow[i]) { \
+ q->Result++; \
+ } \
+ span.z += span.zStep; \
+ } \
+ } \
+ else { \
+ GLuint i; \
+ const GLuint *zRow = (const GLuint *) \
+ rb->GetPointer(ctx, rb, span.x, span.y); \
+ for (i = 0; i < span.end; i++) { \
+ if ((GLuint)span.z < zRow[i]) { \
+ q->Result++; \
+ } \
+ span.z += span.zStep; \
+ } \
+ }
+#include "s_tritemp.h"
+
+
+
+static void
+nodraw_triangle( struct gl_context *ctx,
+ const SWvertex *v0,
+ const SWvertex *v1,
+ const SWvertex *v2 )
+{
+ (void) (ctx && v0 && v1 && v2);
+}
+
+
+/*
+ * This is used when separate specular color is enabled, but not
+ * texturing. We add the specular color to the primary color,
+ * draw the triangle, then restore the original primary color.
+ * Inefficient, but seldom needed.
+ */
+void
+_swrast_add_spec_terms_triangle(struct gl_context *ctx, const SWvertex *v0,
+ const SWvertex *v1, const SWvertex *v2)
+{
+ SWvertex *ncv0 = (SWvertex *)v0; /* drop const qualifier */
+ SWvertex *ncv1 = (SWvertex *)v1;
+ SWvertex *ncv2 = (SWvertex *)v2;
+ GLfloat rSum, gSum, bSum;
+ GLchan cSave[3][4];
+
+ /* save original colors */
+ COPY_CHAN4( cSave[0], ncv0->color );
+ COPY_CHAN4( cSave[1], ncv1->color );
+ COPY_CHAN4( cSave[2], ncv2->color );
+ /* sum v0 */
+ rSum = CHAN_TO_FLOAT(ncv0->color[0]) + ncv0->attrib[FRAG_ATTRIB_COL1][0];
+ gSum = CHAN_TO_FLOAT(ncv0->color[1]) + ncv0->attrib[FRAG_ATTRIB_COL1][1];
+ bSum = CHAN_TO_FLOAT(ncv0->color[2]) + ncv0->attrib[FRAG_ATTRIB_COL1][2];
+ UNCLAMPED_FLOAT_TO_CHAN(ncv0->color[0], rSum);
+ UNCLAMPED_FLOAT_TO_CHAN(ncv0->color[1], gSum);
+ UNCLAMPED_FLOAT_TO_CHAN(ncv0->color[2], bSum);
+ /* sum v1 */
+ rSum = CHAN_TO_FLOAT(ncv1->color[0]) + ncv1->attrib[FRAG_ATTRIB_COL1][0];
+ gSum = CHAN_TO_FLOAT(ncv1->color[1]) + ncv1->attrib[FRAG_ATTRIB_COL1][1];
+ bSum = CHAN_TO_FLOAT(ncv1->color[2]) + ncv1->attrib[FRAG_ATTRIB_COL1][2];
+ UNCLAMPED_FLOAT_TO_CHAN(ncv1->color[0], rSum);
+ UNCLAMPED_FLOAT_TO_CHAN(ncv1->color[1], gSum);
+ UNCLAMPED_FLOAT_TO_CHAN(ncv1->color[2], bSum);
+ /* sum v2 */
+ rSum = CHAN_TO_FLOAT(ncv2->color[0]) + ncv2->attrib[FRAG_ATTRIB_COL1][0];
+ gSum = CHAN_TO_FLOAT(ncv2->color[1]) + ncv2->attrib[FRAG_ATTRIB_COL1][1];
+ bSum = CHAN_TO_FLOAT(ncv2->color[2]) + ncv2->attrib[FRAG_ATTRIB_COL1][2];
+ UNCLAMPED_FLOAT_TO_CHAN(ncv2->color[0], rSum);
+ UNCLAMPED_FLOAT_TO_CHAN(ncv2->color[1], gSum);
+ UNCLAMPED_FLOAT_TO_CHAN(ncv2->color[2], bSum);
+ /* draw */
+ SWRAST_CONTEXT(ctx)->SpecTriangle( ctx, ncv0, ncv1, ncv2 );
+ /* restore original colors */
+ COPY_CHAN4( ncv0->color, cSave[0] );
+ COPY_CHAN4( ncv1->color, cSave[1] );
+ COPY_CHAN4( ncv2->color, cSave[2] );
+}
+
+
+
+#ifdef DEBUG
+
+/* record the current triangle function name */
+const char *_mesa_triFuncName = NULL;
+
+#define USE(triFunc) \
+do { \
+ _mesa_triFuncName = #triFunc; \
+ /*printf("%s\n", _mesa_triFuncName);*/ \
+ swrast->Triangle = triFunc; \
+} while (0)
+
+#else
+
+#define USE(triFunc) swrast->Triangle = triFunc;
+
+#endif
+
+
+
+
+/*
+ * Determine which triangle rendering function to use given the current
+ * rendering context.
+ *
+ * Please update the summary flag _SWRAST_NEW_TRIANGLE if you add or
+ * remove tests to this code.
+ */
+void
+_swrast_choose_triangle( struct gl_context *ctx )
+{
+ SWcontext *swrast = SWRAST_CONTEXT(ctx);
+
+ if (ctx->Polygon.CullFlag &&
+ ctx->Polygon.CullFaceMode == GL_FRONT_AND_BACK) {
+ USE(nodraw_triangle);
+ return;
+ }
+
+ if (ctx->RenderMode==GL_RENDER) {
+
+ if (ctx->Polygon.SmoothFlag) {
+ _swrast_set_aa_triangle_function(ctx);
+ ASSERT(swrast->Triangle);
+ return;
+ }
+
+ /* special case for occlusion testing */
+ if (ctx->Query.CurrentOcclusionObject &&
+ ctx->Depth.Test &&
+ ctx->Depth.Mask == GL_FALSE &&
+ ctx->Depth.Func == GL_LESS &&
+ !ctx->Stencil._Enabled) {
+ if (ctx->Color.ColorMask[0][0] == 0 &&
+ ctx->Color.ColorMask[0][1] == 0 &&
+ ctx->Color.ColorMask[0][2] == 0 &&
+ ctx->Color.ColorMask[0][3] == 0) {
+ USE(occlusion_zless_triangle);
+ return;
+ }
+ }
+
+ /*
+ * XXX should examine swrast->_ActiveAttribMask to determine what
+ * needs to be interpolated.
+ */
+ if (ctx->Texture._EnabledCoordUnits ||
+ ctx->FragmentProgram._Current ||
+ ctx->ATIFragmentShader._Enabled ||
+ _mesa_need_secondary_color(ctx) ||
+ swrast->_FogEnabled) {
+ /* Ugh, we do a _lot_ of tests to pick the best textured tri func */
+ const struct gl_texture_object *texObj2D;
+ const struct gl_texture_image *texImg;
+ GLenum minFilter, magFilter, envMode;
+ gl_format format;
+ texObj2D = ctx->Texture.Unit[0].CurrentTex[TEXTURE_2D_INDEX];
+
+ texImg = texObj2D ? texObj2D->Image[0][texObj2D->BaseLevel] : NULL;
+ format = texImg ? texImg->TexFormat : MESA_FORMAT_NONE;
+ minFilter = texObj2D ? texObj2D->Sampler.MinFilter : GL_NONE;
+ magFilter = texObj2D ? texObj2D->Sampler.MagFilter : GL_NONE;
+ envMode = ctx->Texture.Unit[0].EnvMode;
+
+ /* First see if we can use an optimized 2-D texture function */
+ if (ctx->Texture._EnabledCoordUnits == 0x1
+ && !ctx->FragmentProgram._Current
+ && !ctx->ATIFragmentShader._Enabled
+ && ctx->Texture._EnabledUnits == 0x1
+ && ctx->Texture.Unit[0]._ReallyEnabled == TEXTURE_2D_BIT
+ && texObj2D->Sampler.WrapS == GL_REPEAT
+ && texObj2D->Sampler.WrapT == GL_REPEAT
+ && texObj2D->_Swizzle == SWIZZLE_NOOP
+ && texImg->_IsPowerOfTwo
+ && texImg->Border == 0
+ && texImg->Width == texImg->RowStride
+ && (format == MESA_FORMAT_RGB888 || format == MESA_FORMAT_RGBA8888)
+ && minFilter == magFilter
+ && ctx->Light.Model.ColorControl == GL_SINGLE_COLOR
+ && !swrast->_FogEnabled
+ && ctx->Texture.Unit[0].EnvMode != GL_COMBINE_EXT
+ && ctx->Texture.Unit[0].EnvMode != GL_COMBINE4_NV) {
+ if (ctx->Hint.PerspectiveCorrection==GL_FASTEST) {
+ if (minFilter == GL_NEAREST
+ && format == MESA_FORMAT_RGB888
+ && (envMode == GL_REPLACE || envMode == GL_DECAL)
+ && ((swrast->_RasterMask == (DEPTH_BIT | TEXTURE_BIT)
+ && ctx->Depth.Func == GL_LESS
+ && ctx->Depth.Mask == GL_TRUE)
+ || swrast->_RasterMask == TEXTURE_BIT)
+ && ctx->Polygon.StippleFlag == GL_FALSE
+ && ctx->DrawBuffer->Visual.depthBits <= 16) {
+ if (swrast->_RasterMask == (DEPTH_BIT | TEXTURE_BIT)) {
+ USE(simple_z_textured_triangle);
+ }
+ else {
+ USE(simple_textured_triangle);
+ }
+ }
+ else {
+#if CHAN_BITS != 8
+ USE(general_triangle);
+#else
+ if (format == MESA_FORMAT_RGBA8888 && !_mesa_little_endian()) {
+ /* We only handle RGBA8888 correctly on little endian
+ * in the optimized code above.
+ */
+ USE(general_triangle);
+ }
+ else {
+ USE(affine_textured_triangle);
+ }
+#endif
+ }
+ }
+ else {
+#if CHAN_BITS != 8
+ USE(general_triangle);
+#else
+ USE(persp_textured_triangle);
+#endif
+ }
+ }
+ else {
+ /* general case textured triangles */
+ USE(general_triangle);
+ }
+ }
+ else {
+ ASSERT(!swrast->_FogEnabled);
+ ASSERT(!_mesa_need_secondary_color(ctx));
+ if (ctx->Light.ShadeModel==GL_SMOOTH) {
+ /* smooth shaded, no texturing, stippled or some raster ops */
+#if CHAN_BITS != 8
+ USE(general_triangle);
+#else
+ USE(smooth_rgba_triangle);
+#endif
+ }
+ else {
+ /* flat shaded, no texturing, stippled or some raster ops */
+#if CHAN_BITS != 8
+ USE(general_triangle);
+#else
+ USE(flat_rgba_triangle);
+#endif
+ }
+ }
+ }
+ else if (ctx->RenderMode==GL_FEEDBACK) {
+ USE(_swrast_feedback_triangle);
+ }
+ else {
+ /* GL_SELECT mode */
+ USE(_swrast_select_triangle);
+ }
+}
diff --git a/mesalib/src/mesa/tnl/t_context.c b/mesalib/src/mesa/tnl/t_context.c
index a6da8cafe..aaa564fae 100644
--- a/mesalib/src/mesa/tnl/t_context.c
+++ b/mesalib/src/mesa/tnl/t_context.c
@@ -1,220 +1,220 @@
-/*
- * Mesa 3-D graphics library
- * Version: 7.2
- *
- * Copyright (C) 1999-2008 Brian Paul All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- * Authors:
- * Keith Whitwell <keith@tungstengraphics.com>
- */
-
-
-#include "main/glheader.h"
-#include "main/imports.h"
-#include "main/context.h"
-#include "main/macros.h"
-#include "main/mtypes.h"
-#include "main/light.h"
-#include "math/m_translate.h"
-#include "math/m_xform.h"
-#include "main/state.h"
-
-#include "tnl.h"
-#include "t_context.h"
-#include "t_pipeline.h"
-
-#include "vbo/vbo.h"
-
-GLboolean
-_tnl_CreateContext( struct gl_context *ctx )
-{
- TNLcontext *tnl;
-
- /* Create the TNLcontext structure
- */
- ctx->swtnl_context = tnl = (TNLcontext *) CALLOC( sizeof(TNLcontext) );
-
- if (!tnl) {
- return GL_FALSE;
- }
-
- /* Initialize the VB.
- */
- tnl->vb.Size = ctx->Const.MaxArrayLockSize + MAX_CLIPPED_VERTICES;
-
-
- /* Initialize tnl state.
- */
- if (ctx->VertexProgram._MaintainTnlProgram) {
- _tnl_install_pipeline( ctx, _tnl_vp_pipeline );
- } else {
- _tnl_install_pipeline( ctx, _tnl_default_pipeline );
- }
-
- tnl->NeedNdcCoords = GL_TRUE;
- tnl->AllowVertexFog = GL_TRUE;
- tnl->AllowPixelFog = GL_TRUE;
-
- /* Set a few default values in the driver struct.
- */
- tnl->Driver.Render.PrimTabElts = _tnl_render_tab_elts;
- tnl->Driver.Render.PrimTabVerts = _tnl_render_tab_verts;
- tnl->Driver.NotifyMaterialChange = _mesa_validate_all_lighting_tables;
-
- tnl->nr_blocks = 0;
-
- /* plug in the VBO drawing function */
- vbo_set_draw_func(ctx, _tnl_vbo_draw_prims);
-
- _math_init_transformation();
- _math_init_translate();
-
- return GL_TRUE;
-}
-
-
-void
-_tnl_DestroyContext( struct gl_context *ctx )
-{
- TNLcontext *tnl = TNL_CONTEXT(ctx);
-
- _tnl_destroy_pipeline( ctx );
-
- FREE(tnl);
- ctx->swtnl_context = NULL;
-}
-
-
-void
-_tnl_InvalidateState( struct gl_context *ctx, GLuint new_state )
-{
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- const struct gl_vertex_program *vp = ctx->VertexProgram._Current;
- const struct gl_fragment_program *fp = ctx->FragmentProgram._Current;
- GLuint i;
-
- if (new_state & (_NEW_HINT | _NEW_PROGRAM)) {
- ASSERT(tnl->AllowVertexFog || tnl->AllowPixelFog);
- tnl->_DoVertexFog = ((tnl->AllowVertexFog && (ctx->Hint.Fog != GL_NICEST))
- || !tnl->AllowPixelFog) && !fp;
- }
-
- tnl->pipeline.new_state |= new_state;
-
- /* Calculate tnl->render_inputs. This bitmask indicates which vertex
- * attributes need to be emitted to the rasterizer.
- */
- RENDERINPUTS_ZERO( tnl->render_inputs_bitset );
- RENDERINPUTS_SET( tnl->render_inputs_bitset, _TNL_ATTRIB_POS );
-
- if (!fp || (fp->Base.InputsRead & FRAG_BIT_COL0)) {
- RENDERINPUTS_SET( tnl->render_inputs_bitset, _TNL_ATTRIB_COLOR0 );
- }
-
- if (_mesa_need_secondary_color(ctx))
- RENDERINPUTS_SET( tnl->render_inputs_bitset, _TNL_ATTRIB_COLOR1 );
-
- for (i = 0; i < ctx->Const.MaxTextureCoordUnits; i++) {
- if (ctx->Texture._EnabledCoordUnits & (1 << i) ||
- (fp && fp->Base.InputsRead & FRAG_BIT_TEX(i))) {
- RENDERINPUTS_SET( tnl->render_inputs_bitset, _TNL_ATTRIB_TEX(i) );
- }
- }
-
- if (ctx->Fog.Enabled
- || (fp != NULL && (fp->Base.InputsRead & FRAG_BIT_FOGC) != 0)) {
- /* Either fixed-function fog or a fragment program needs fog coord.
- */
- RENDERINPUTS_SET( tnl->render_inputs_bitset, _TNL_ATTRIB_FOG );
- }
-
- if (ctx->Polygon.FrontMode != GL_FILL ||
- ctx->Polygon.BackMode != GL_FILL)
- RENDERINPUTS_SET( tnl->render_inputs_bitset, _TNL_ATTRIB_EDGEFLAG );
-
- if (ctx->RenderMode == GL_FEEDBACK)
- RENDERINPUTS_SET( tnl->render_inputs_bitset, _TNL_ATTRIB_TEX0 );
-
- if (ctx->Point._Attenuated ||
- (ctx->VertexProgram._Enabled && ctx->VertexProgram.PointSizeEnabled))
- RENDERINPUTS_SET( tnl->render_inputs_bitset, _TNL_ATTRIB_POINTSIZE );
-
- /* check for varying vars which are written by the vertex program */
- if (vp) {
- GLuint i;
- for (i = 0; i < MAX_VARYING; i++) {
- if (vp->Base.OutputsWritten & BITFIELD64_BIT(VERT_RESULT_VAR0 + i)) {
- RENDERINPUTS_SET(tnl->render_inputs_bitset,
- _TNL_ATTRIB_GENERIC(i));
- }
- }
- }
-}
-
-
-void
-_tnl_wakeup( struct gl_context *ctx )
-{
- /* Assume we haven't been getting state updates either:
- */
- _tnl_InvalidateState( ctx, ~0 );
-
-#if 0
- if (ctx->Light.ColorMaterialEnabled) {
- _mesa_update_color_material( ctx,
- ctx->Current.Attrib[VERT_ATTRIB_COLOR0] );
- }
-#endif
-}
-
-
-
-
-/**
- * Drivers call this function to tell the TCL module whether or not
- * it wants Normalized Device Coords (NDC) computed. I.e. whether
- * we should "Divide-by-W". Software renders will want that.
- */
-void
-_tnl_need_projected_coords( struct gl_context *ctx, GLboolean mode )
-{
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- tnl->NeedNdcCoords = mode;
-}
-
-void
-_tnl_allow_vertex_fog( struct gl_context *ctx, GLboolean value )
-{
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- tnl->AllowVertexFog = value;
- tnl->_DoVertexFog = ((tnl->AllowVertexFog && (ctx->Hint.Fog != GL_NICEST))
- || !tnl->AllowPixelFog) && !ctx->FragmentProgram._Current;
-
-}
-
-void
-_tnl_allow_pixel_fog( struct gl_context *ctx, GLboolean value )
-{
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- tnl->AllowPixelFog = value;
- tnl->_DoVertexFog = ((tnl->AllowVertexFog && (ctx->Hint.Fog != GL_NICEST))
- || !tnl->AllowPixelFog) && !ctx->FragmentProgram._Current;
-}
-
+/*
+ * Mesa 3-D graphics library
+ * Version: 7.2
+ *
+ * Copyright (C) 1999-2008 Brian Paul All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * Authors:
+ * Keith Whitwell <keith@tungstengraphics.com>
+ */
+
+
+#include "main/glheader.h"
+#include "main/imports.h"
+#include "main/context.h"
+#include "main/macros.h"
+#include "main/mtypes.h"
+#include "main/light.h"
+#include "math/m_translate.h"
+#include "math/m_xform.h"
+#include "main/state.h"
+
+#include "tnl.h"
+#include "t_context.h"
+#include "t_pipeline.h"
+
+#include "vbo/vbo.h"
+
+GLboolean
+_tnl_CreateContext( struct gl_context *ctx )
+{
+ TNLcontext *tnl;
+
+ /* Create the TNLcontext structure
+ */
+ ctx->swtnl_context = tnl = (TNLcontext *) CALLOC( sizeof(TNLcontext) );
+
+ if (!tnl) {
+ return GL_FALSE;
+ }
+
+ /* Initialize the VB.
+ */
+ tnl->vb.Size = ctx->Const.MaxArrayLockSize + MAX_CLIPPED_VERTICES;
+
+
+ /* Initialize tnl state.
+ */
+ if (ctx->VertexProgram._MaintainTnlProgram) {
+ _tnl_install_pipeline( ctx, _tnl_vp_pipeline );
+ } else {
+ _tnl_install_pipeline( ctx, _tnl_default_pipeline );
+ }
+
+ tnl->NeedNdcCoords = GL_TRUE;
+ tnl->AllowVertexFog = GL_TRUE;
+ tnl->AllowPixelFog = GL_TRUE;
+
+ /* Set a few default values in the driver struct.
+ */
+ tnl->Driver.Render.PrimTabElts = _tnl_render_tab_elts;
+ tnl->Driver.Render.PrimTabVerts = _tnl_render_tab_verts;
+ tnl->Driver.NotifyMaterialChange = _mesa_validate_all_lighting_tables;
+
+ tnl->nr_blocks = 0;
+
+ /* plug in the VBO drawing function */
+ vbo_set_draw_func(ctx, _tnl_vbo_draw_prims);
+
+ _math_init_transformation();
+ _math_init_translate();
+
+ return GL_TRUE;
+}
+
+
+void
+_tnl_DestroyContext( struct gl_context *ctx )
+{
+ TNLcontext *tnl = TNL_CONTEXT(ctx);
+
+ _tnl_destroy_pipeline( ctx );
+
+ FREE(tnl);
+ ctx->swtnl_context = NULL;
+}
+
+
+void
+_tnl_InvalidateState( struct gl_context *ctx, GLuint new_state )
+{
+ TNLcontext *tnl = TNL_CONTEXT(ctx);
+ const struct gl_vertex_program *vp = ctx->VertexProgram._Current;
+ const struct gl_fragment_program *fp = ctx->FragmentProgram._Current;
+ GLuint i;
+
+ if (new_state & (_NEW_HINT | _NEW_PROGRAM)) {
+ ASSERT(tnl->AllowVertexFog || tnl->AllowPixelFog);
+ tnl->_DoVertexFog = ((tnl->AllowVertexFog && (ctx->Hint.Fog != GL_NICEST))
+ || !tnl->AllowPixelFog) && !fp;
+ }
+
+ tnl->pipeline.new_state |= new_state;
+
+ /* Calculate tnl->render_inputs. This bitmask indicates which vertex
+ * attributes need to be emitted to the rasterizer.
+ */
+ RENDERINPUTS_ZERO( tnl->render_inputs_bitset );
+ RENDERINPUTS_SET( tnl->render_inputs_bitset, _TNL_ATTRIB_POS );
+
+ if (!fp || (fp->Base.InputsRead & FRAG_BIT_COL0)) {
+ RENDERINPUTS_SET( tnl->render_inputs_bitset, _TNL_ATTRIB_COLOR0 );
+ }
+
+ if (_mesa_need_secondary_color(ctx))
+ RENDERINPUTS_SET( tnl->render_inputs_bitset, _TNL_ATTRIB_COLOR1 );
+
+ for (i = 0; i < ctx->Const.MaxTextureCoordUnits; i++) {
+ if (ctx->Texture._EnabledCoordUnits & (1 << i) ||
+ (fp && fp->Base.InputsRead & FRAG_BIT_TEX(i))) {
+ RENDERINPUTS_SET( tnl->render_inputs_bitset, _TNL_ATTRIB_TEX(i) );
+ }
+ }
+
+ if (ctx->Fog.Enabled
+ || (fp != NULL && (fp->Base.InputsRead & FRAG_BIT_FOGC) != 0)) {
+ /* Either fixed-function fog or a fragment program needs fog coord.
+ */
+ RENDERINPUTS_SET( tnl->render_inputs_bitset, _TNL_ATTRIB_FOG );
+ }
+
+ if (ctx->Polygon.FrontMode != GL_FILL ||
+ ctx->Polygon.BackMode != GL_FILL)
+ RENDERINPUTS_SET( tnl->render_inputs_bitset, _TNL_ATTRIB_EDGEFLAG );
+
+ if (ctx->RenderMode == GL_FEEDBACK)
+ RENDERINPUTS_SET( tnl->render_inputs_bitset, _TNL_ATTRIB_TEX0 );
+
+ if (ctx->Point._Attenuated ||
+ (ctx->VertexProgram._Enabled && ctx->VertexProgram.PointSizeEnabled))
+ RENDERINPUTS_SET( tnl->render_inputs_bitset, _TNL_ATTRIB_POINTSIZE );
+
+ /* check for varying vars which are written by the vertex program */
+ if (vp) {
+ GLuint i;
+ for (i = 0; i < MAX_VARYING; i++) {
+ if (vp->Base.OutputsWritten & BITFIELD64_BIT(VERT_RESULT_VAR0 + i)) {
+ RENDERINPUTS_SET(tnl->render_inputs_bitset,
+ _TNL_ATTRIB_GENERIC(i));
+ }
+ }
+ }
+}
+
+
+void
+_tnl_wakeup( struct gl_context *ctx )
+{
+ /* Assume we haven't been getting state updates either:
+ */
+ _tnl_InvalidateState( ctx, ~0 );
+
+#if 0
+ if (ctx->Light.ColorMaterialEnabled) {
+ _mesa_update_color_material( ctx,
+ ctx->Current.Attrib[VERT_ATTRIB_COLOR0] );
+ }
+#endif
+}
+
+
+
+
+/**
+ * Drivers call this function to tell the TCL module whether or not
+ * it wants Normalized Device Coords (NDC) computed. I.e. whether
+ * we should "Divide-by-W". Software renders will want that.
+ */
+void
+_tnl_need_projected_coords( struct gl_context *ctx, GLboolean mode )
+{
+ TNLcontext *tnl = TNL_CONTEXT(ctx);
+ tnl->NeedNdcCoords = mode;
+}
+
+void
+_tnl_allow_vertex_fog( struct gl_context *ctx, GLboolean value )
+{
+ TNLcontext *tnl = TNL_CONTEXT(ctx);
+ tnl->AllowVertexFog = value;
+ tnl->_DoVertexFog = ((tnl->AllowVertexFog && (ctx->Hint.Fog != GL_NICEST))
+ || !tnl->AllowPixelFog) && !ctx->FragmentProgram._Current;
+
+}
+
+void
+_tnl_allow_pixel_fog( struct gl_context *ctx, GLboolean value )
+{
+ TNLcontext *tnl = TNL_CONTEXT(ctx);
+ tnl->AllowPixelFog = value;
+ tnl->_DoVertexFog = ((tnl->AllowVertexFog && (ctx->Hint.Fog != GL_NICEST))
+ || !tnl->AllowPixelFog) && !ctx->FragmentProgram._Current;
+}
+
diff --git a/mesalib/src/mesa/tnl/t_draw.c b/mesalib/src/mesa/tnl/t_draw.c
index b1967e654..a2ca6225b 100644
--- a/mesalib/src/mesa/tnl/t_draw.c
+++ b/mesalib/src/mesa/tnl/t_draw.c
@@ -1,534 +1,534 @@
-/*
- * Mesa 3-D graphics library
- * Version: 7.1
- *
- * Copyright (C) 1999-2007 Brian Paul All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- * Authors:
- * Keith Whitwell <keith@tungstengraphics.com>
- */
-
-#include "main/glheader.h"
-#include "main/condrender.h"
-#include "main/context.h"
-#include "main/imports.h"
-#include "main/mtypes.h"
-#include "main/macros.h"
-#include "main/enums.h"
-
-#include "t_context.h"
-#include "tnl.h"
-
-
-
-static GLubyte *get_space(struct gl_context *ctx, GLuint bytes)
-{
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- GLubyte *space = malloc(bytes);
-
- tnl->block[tnl->nr_blocks++] = space;
- return space;
-}
-
-
-static void free_space(struct gl_context *ctx)
-{
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- GLuint i;
- for (i = 0; i < tnl->nr_blocks; i++)
- free(tnl->block[i]);
- tnl->nr_blocks = 0;
-}
-
-
-/* Convert the incoming array to GLfloats. Understands the
- * array->Normalized flag and selects the correct conversion method.
- */
-#define CONVERT( TYPE, MACRO ) do { \
- GLuint i, j; \
- if (input->Normalized) { \
- for (i = 0; i < count; i++) { \
- const TYPE *in = (TYPE *)ptr; \
- for (j = 0; j < sz; j++) { \
- *fptr++ = MACRO(*in); \
- in++; \
- } \
- ptr += input->StrideB; \
- } \
- } else { \
- for (i = 0; i < count; i++) { \
- const TYPE *in = (TYPE *)ptr; \
- for (j = 0; j < sz; j++) { \
- *fptr++ = (GLfloat)(*in); \
- in++; \
- } \
- ptr += input->StrideB; \
- } \
- } \
-} while (0)
-
-
-/**
- * Convert array of BGRA/GLubyte[4] values to RGBA/float[4]
- * \param ptr input/ubyte array
- * \param fptr output/float array
- */
-static void
-convert_bgra_to_float(const struct gl_client_array *input,
- const GLubyte *ptr, GLfloat *fptr,
- GLuint count )
-{
- GLuint i;
- assert(input->Normalized);
- assert(input->Size == 4);
- for (i = 0; i < count; i++) {
- const GLubyte *in = (GLubyte *) ptr; /* in is in BGRA order */
- *fptr++ = UBYTE_TO_FLOAT(in[2]); /* red */
- *fptr++ = UBYTE_TO_FLOAT(in[1]); /* green */
- *fptr++ = UBYTE_TO_FLOAT(in[0]); /* blue */
- *fptr++ = UBYTE_TO_FLOAT(in[3]); /* alpha */
- ptr += input->StrideB;
- }
-}
-
-static void
-convert_half_to_float(const struct gl_client_array *input,
- const GLubyte *ptr, GLfloat *fptr,
- GLuint count, GLuint sz)
-{
- GLuint i, j;
-
- for (i = 0; i < count; i++) {
- GLhalfARB *in = (GLhalfARB *)ptr;
-
- for (j = 0; j < sz; j++) {
- *fptr++ = _mesa_half_to_float(in[j]);
- }
- ptr += input->StrideB;
- }
-}
-
-/**
- * \brief Convert fixed-point to floating-point.
- *
- * In OpenGL, a fixed-point number is a "signed 2's complement 16.16 scaled
- * integer" (Table 2.2 of the OpenGL ES 2.0 spec).
- *
- * If the buffer has the \c normalized flag set, the formula
- * \code normalize(x) := (2*x + 1) / (2^16 - 1) \endcode
- * is used to map the fixed-point numbers into the range [-1, 1].
- */
-static void
-convert_fixed_to_float(const struct gl_client_array *input,
- const GLubyte *ptr, GLfloat *fptr,
- GLuint count)
-{
- GLuint i, j;
- const GLint size = input->Size;
-
- if (input->Normalized) {
- for (i = 0; i < count; ++i) {
- const GLfixed *in = (GLfixed *) ptr;
- for (j = 0; j < size; ++j) {
- *fptr++ = (GLfloat) (2 * in[j] + 1) / (GLfloat) ((1 << 16) - 1);
- }
- ptr += input->StrideB;
- }
- } else {
- for (i = 0; i < count; ++i) {
- const GLfixed *in = (GLfixed *) ptr;
- for (j = 0; j < size; ++j) {
- *fptr++ = in[j] / (GLfloat) (1 << 16);
- }
- ptr += input->StrideB;
- }
- }
-}
-
-/* Adjust pointer to point at first requested element, convert to
- * floating point, populate VB->AttribPtr[].
- */
-static void _tnl_import_array( struct gl_context *ctx,
- GLuint attrib,
- GLuint count,
- const struct gl_client_array *input,
- const GLubyte *ptr )
-{
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- struct vertex_buffer *VB = &tnl->vb;
- GLuint stride = input->StrideB;
-
- if (input->Type != GL_FLOAT) {
- const GLuint sz = input->Size;
- GLubyte *buf = get_space(ctx, count * sz * sizeof(GLfloat));
- GLfloat *fptr = (GLfloat *)buf;
-
- switch (input->Type) {
- case GL_BYTE:
- CONVERT(GLbyte, BYTE_TO_FLOAT);
- break;
- case GL_UNSIGNED_BYTE:
- if (input->Format == GL_BGRA) {
- /* See GL_EXT_vertex_array_bgra */
- convert_bgra_to_float(input, ptr, fptr, count);
- }
- else {
- CONVERT(GLubyte, UBYTE_TO_FLOAT);
- }
- break;
- case GL_SHORT:
- CONVERT(GLshort, SHORT_TO_FLOAT);
- break;
- case GL_UNSIGNED_SHORT:
- CONVERT(GLushort, USHORT_TO_FLOAT);
- break;
- case GL_INT:
- CONVERT(GLint, INT_TO_FLOAT);
- break;
- case GL_UNSIGNED_INT:
- CONVERT(GLuint, UINT_TO_FLOAT);
- break;
- case GL_DOUBLE:
- CONVERT(GLdouble, (GLfloat));
- break;
- case GL_HALF_FLOAT:
- convert_half_to_float(input, ptr, fptr, count, sz);
- break;
- case GL_FIXED:
- convert_fixed_to_float(input, ptr, fptr, count);
- break;
- default:
- assert(0);
- break;
- }
-
- ptr = buf;
- stride = sz * sizeof(GLfloat);
- }
-
- VB->AttribPtr[attrib] = &tnl->tmp_inputs[attrib];
- VB->AttribPtr[attrib]->data = (GLfloat (*)[4])ptr;
- VB->AttribPtr[attrib]->start = (GLfloat *)ptr;
- VB->AttribPtr[attrib]->count = count;
- VB->AttribPtr[attrib]->stride = stride;
- VB->AttribPtr[attrib]->size = input->Size;
-
- /* This should die, but so should the whole GLvector4f concept:
- */
- VB->AttribPtr[attrib]->flags = (((1<<input->Size)-1) |
- VEC_NOT_WRITEABLE |
- (stride == 4*sizeof(GLfloat) ? 0 : VEC_BAD_STRIDE));
-
- VB->AttribPtr[attrib]->storage = NULL;
-}
-
-#define CLIPVERTS ((6 + MAX_CLIP_PLANES) * 2)
-
-
-static GLboolean *_tnl_import_edgeflag( struct gl_context *ctx,
- const GLvector4f *input,
- GLuint count)
-{
- const GLubyte *ptr = (const GLubyte *)input->data;
- const GLuint stride = input->stride;
- GLboolean *space = (GLboolean *)get_space(ctx, count + CLIPVERTS);
- GLboolean *bptr = space;
- GLuint i;
-
- for (i = 0; i < count; i++) {
- *bptr++ = ((GLfloat *)ptr)[0] == 1.0;
- ptr += stride;
- }
-
- return space;
-}
-
-
-static void bind_inputs( struct gl_context *ctx,
- const struct gl_client_array *inputs[],
- GLint count,
- struct gl_buffer_object **bo,
- GLuint *nr_bo )
-{
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- struct vertex_buffer *VB = &tnl->vb;
- GLuint i;
-
- /* Map all the VBOs
- */
- for (i = 0; i < VERT_ATTRIB_MAX; i++) {
- const void *ptr;
-
- if (inputs[i]->BufferObj->Name) {
- if (!inputs[i]->BufferObj->Pointer) {
- bo[*nr_bo] = inputs[i]->BufferObj;
- (*nr_bo)++;
- ctx->Driver.MapBuffer(ctx,
- GL_ARRAY_BUFFER,
- GL_READ_ONLY_ARB,
- inputs[i]->BufferObj);
-
- assert(inputs[i]->BufferObj->Pointer);
- }
-
- ptr = ADD_POINTERS(inputs[i]->BufferObj->Pointer,
- inputs[i]->Ptr);
- }
- else
- ptr = inputs[i]->Ptr;
-
- /* Just make sure the array is floating point, otherwise convert to
- * temporary storage.
- *
- * XXX: remove the GLvector4f type at some stage and just use
- * client arrays.
- */
- _tnl_import_array(ctx, i, count, inputs[i], ptr);
- }
-
- /* We process only the vertices between min & max index:
- */
- VB->Count = count;
-
- /* These should perhaps be part of _TNL_ATTRIB_* */
- VB->BackfaceColorPtr = NULL;
- VB->BackfaceIndexPtr = NULL;
- VB->BackfaceSecondaryColorPtr = NULL;
-
- /* Clipping and drawing code still requires this to be a packed
- * array of ubytes which can be written into. TODO: Fix and
- * remove.
- */
- if (ctx->Polygon.FrontMode != GL_FILL ||
- ctx->Polygon.BackMode != GL_FILL)
- {
- VB->EdgeFlag = _tnl_import_edgeflag( ctx,
- VB->AttribPtr[_TNL_ATTRIB_EDGEFLAG],
- VB->Count );
- }
- else {
- /* the data previously pointed to by EdgeFlag may have been freed */
- VB->EdgeFlag = NULL;
- }
-}
-
-
-/* Translate indices to GLuints and store in VB->Elts.
- */
-static void bind_indices( struct gl_context *ctx,
- const struct _mesa_index_buffer *ib,
- struct gl_buffer_object **bo,
- GLuint *nr_bo)
-{
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- struct vertex_buffer *VB = &tnl->vb;
- GLuint i;
- void *ptr;
-
- if (!ib) {
- VB->Elts = NULL;
- return;
- }
-
- if (ib->obj->Name && !ib->obj->Pointer) {
- bo[*nr_bo] = ib->obj;
- (*nr_bo)++;
- ctx->Driver.MapBuffer(ctx,
- GL_ELEMENT_ARRAY_BUFFER,
- GL_READ_ONLY_ARB,
- ib->obj);
-
- assert(ib->obj->Pointer);
- }
-
- ptr = ADD_POINTERS(ib->obj->Pointer, ib->ptr);
-
- if (ib->type == GL_UNSIGNED_INT && VB->Primitive[0].basevertex == 0) {
- VB->Elts = (GLuint *) ptr;
- }
- else {
- GLuint *elts = (GLuint *)get_space(ctx, ib->count * sizeof(GLuint));
- VB->Elts = elts;
-
- if (ib->type == GL_UNSIGNED_INT) {
- const GLuint *in = (GLuint *)ptr;
- for (i = 0; i < ib->count; i++)
- *elts++ = (GLuint)(*in++) + VB->Primitive[0].basevertex;
- }
- else if (ib->type == GL_UNSIGNED_SHORT) {
- const GLushort *in = (GLushort *)ptr;
- for (i = 0; i < ib->count; i++)
- *elts++ = (GLuint)(*in++) + VB->Primitive[0].basevertex;
- }
- else {
- const GLubyte *in = (GLubyte *)ptr;
- for (i = 0; i < ib->count; i++)
- *elts++ = (GLuint)(*in++) + VB->Primitive[0].basevertex;
- }
- }
-}
-
-static void bind_prims( struct gl_context *ctx,
- const struct _mesa_prim *prim,
- GLuint nr_prims )
-{
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- struct vertex_buffer *VB = &tnl->vb;
-
- VB->Primitive = prim;
- VB->PrimitiveCount = nr_prims;
-}
-
-static void unmap_vbos( struct gl_context *ctx,
- struct gl_buffer_object **bo,
- GLuint nr_bo )
-{
- GLuint i;
- for (i = 0; i < nr_bo; i++) {
- ctx->Driver.UnmapBuffer(ctx,
- 0, /* target -- I don't see why this would be needed */
- bo[i]);
- }
-}
-
-
-void _tnl_vbo_draw_prims(struct gl_context *ctx,
- const struct gl_client_array *arrays[],
- const struct _mesa_prim *prim,
- GLuint nr_prims,
- const struct _mesa_index_buffer *ib,
- GLboolean index_bounds_valid,
- GLuint min_index,
- GLuint max_index)
-{
- if (!index_bounds_valid)
- vbo_get_minmax_index(ctx, prim, ib, &min_index, &max_index);
-
- _tnl_draw_prims(ctx, arrays, prim, nr_prims, ib, min_index, max_index);
-}
-
-/* This is the main entrypoint into the slimmed-down software tnl
- * module. In a regular swtnl driver, this can be plugged straight
- * into the vbo->Driver.DrawPrims() callback.
- */
-void _tnl_draw_prims( struct gl_context *ctx,
- const struct gl_client_array *arrays[],
- const struct _mesa_prim *prim,
- GLuint nr_prims,
- const struct _mesa_index_buffer *ib,
- GLuint min_index,
- GLuint max_index)
-{
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- const GLuint TEST_SPLIT = 0;
- const GLint max = TEST_SPLIT ? 8 : tnl->vb.Size - MAX_CLIPPED_VERTICES;
- GLint max_basevertex = prim->basevertex;
- GLuint i;
-
- /* Mesa core state should have been validated already */
- assert(ctx->NewState == 0x0);
-
- if (!_mesa_check_conditional_render(ctx))
- return; /* don't draw */
-
- for (i = 1; i < nr_prims; i++)
- max_basevertex = MAX2(max_basevertex, prim[i].basevertex);
-
- if (0)
- {
- printf("%s %d..%d\n", __FUNCTION__, min_index, max_index);
- for (i = 0; i < nr_prims; i++)
- printf("prim %d: %s start %d count %d\n", i,
- _mesa_lookup_enum_by_nr(prim[i].mode),
- prim[i].start,
- prim[i].count);
- }
-
- if (min_index) {
- /* We always translate away calls with min_index != 0.
- */
- vbo_rebase_prims( ctx, arrays, prim, nr_prims, ib,
- min_index, max_index,
- _tnl_vbo_draw_prims );
- return;
- }
- else if ((GLint)max_index + max_basevertex > max) {
- /* The software TNL pipeline has a fixed amount of storage for
- * vertices and it is necessary to split incoming drawing commands
- * if they exceed that limit.
- */
- struct split_limits limits;
- limits.max_verts = max;
- limits.max_vb_size = ~0;
- limits.max_indices = ~0;
-
- /* This will split the buffers one way or another and
- * recursively call back into this function.
- */
- vbo_split_prims( ctx, arrays, prim, nr_prims, ib,
- 0, max_index + prim->basevertex,
- _tnl_vbo_draw_prims,
- &limits );
- }
- else {
- /* May need to map a vertex buffer object for every attribute plus
- * one for the index buffer.
- */
- struct gl_buffer_object *bo[VERT_ATTRIB_MAX + 1];
- GLuint nr_bo = 0;
- GLuint inst;
-
- for (i = 0; i < nr_prims;) {
- GLuint this_nr_prims;
-
- /* Our SW TNL pipeline doesn't handle basevertex yet, so bind_indices
- * will rebase the elements to the basevertex, and we'll only
- * emit strings of prims with the same basevertex in one draw call.
- */
- for (this_nr_prims = 1; i + this_nr_prims < nr_prims;
- this_nr_prims++) {
- if (prim[i].basevertex != prim[i + this_nr_prims].basevertex)
- break;
- }
-
- assert(prim[i].num_instances > 0);
-
- /* Binding inputs may imply mapping some vertex buffer objects.
- * They will need to be unmapped below.
- */
- for (inst = 0; inst < prim[i].num_instances; inst++) {
-
- bind_prims(ctx, &prim[i], this_nr_prims);
- bind_inputs(ctx, arrays, max_index + prim[i].basevertex + 1,
- bo, &nr_bo);
- bind_indices(ctx, ib, bo, &nr_bo);
-
- tnl->CurInstance = inst;
- TNL_CONTEXT(ctx)->Driver.RunPipeline(ctx);
-
- unmap_vbos(ctx, bo, nr_bo);
- free_space(ctx);
- }
-
- i += this_nr_prims;
- }
- }
-}
-
+/*
+ * Mesa 3-D graphics library
+ * Version: 7.1
+ *
+ * Copyright (C) 1999-2007 Brian Paul All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * Authors:
+ * Keith Whitwell <keith@tungstengraphics.com>
+ */
+
+#include "main/glheader.h"
+#include "main/condrender.h"
+#include "main/context.h"
+#include "main/imports.h"
+#include "main/mtypes.h"
+#include "main/macros.h"
+#include "main/enums.h"
+
+#include "t_context.h"
+#include "tnl.h"
+
+
+
+static GLubyte *get_space(struct gl_context *ctx, GLuint bytes)
+{
+ TNLcontext *tnl = TNL_CONTEXT(ctx);
+ GLubyte *space = malloc(bytes);
+
+ tnl->block[tnl->nr_blocks++] = space;
+ return space;
+}
+
+
+static void free_space(struct gl_context *ctx)
+{
+ TNLcontext *tnl = TNL_CONTEXT(ctx);
+ GLuint i;
+ for (i = 0; i < tnl->nr_blocks; i++)
+ free(tnl->block[i]);
+ tnl->nr_blocks = 0;
+}
+
+
+/* Convert the incoming array to GLfloats. Understands the
+ * array->Normalized flag and selects the correct conversion method.
+ */
+#define CONVERT( TYPE, MACRO ) do { \
+ GLuint i, j; \
+ if (input->Normalized) { \
+ for (i = 0; i < count; i++) { \
+ const TYPE *in = (TYPE *)ptr; \
+ for (j = 0; j < sz; j++) { \
+ *fptr++ = MACRO(*in); \
+ in++; \
+ } \
+ ptr += input->StrideB; \
+ } \
+ } else { \
+ for (i = 0; i < count; i++) { \
+ const TYPE *in = (TYPE *)ptr; \
+ for (j = 0; j < sz; j++) { \
+ *fptr++ = (GLfloat)(*in); \
+ in++; \
+ } \
+ ptr += input->StrideB; \
+ } \
+ } \
+} while (0)
+
+
+/**
+ * Convert array of BGRA/GLubyte[4] values to RGBA/float[4]
+ * \param ptr input/ubyte array
+ * \param fptr output/float array
+ */
+static void
+convert_bgra_to_float(const struct gl_client_array *input,
+ const GLubyte *ptr, GLfloat *fptr,
+ GLuint count )
+{
+ GLuint i;
+ assert(input->Normalized);
+ assert(input->Size == 4);
+ for (i = 0; i < count; i++) {
+ const GLubyte *in = (GLubyte *) ptr; /* in is in BGRA order */
+ *fptr++ = UBYTE_TO_FLOAT(in[2]); /* red */
+ *fptr++ = UBYTE_TO_FLOAT(in[1]); /* green */
+ *fptr++ = UBYTE_TO_FLOAT(in[0]); /* blue */
+ *fptr++ = UBYTE_TO_FLOAT(in[3]); /* alpha */
+ ptr += input->StrideB;
+ }
+}
+
+static void
+convert_half_to_float(const struct gl_client_array *input,
+ const GLubyte *ptr, GLfloat *fptr,
+ GLuint count, GLuint sz)
+{
+ GLuint i, j;
+
+ for (i = 0; i < count; i++) {
+ GLhalfARB *in = (GLhalfARB *)ptr;
+
+ for (j = 0; j < sz; j++) {
+ *fptr++ = _mesa_half_to_float(in[j]);
+ }
+ ptr += input->StrideB;
+ }
+}
+
+/**
+ * \brief Convert fixed-point to floating-point.
+ *
+ * In OpenGL, a fixed-point number is a "signed 2's complement 16.16 scaled
+ * integer" (Table 2.2 of the OpenGL ES 2.0 spec).
+ *
+ * If the buffer has the \c normalized flag set, the formula
+ * \code normalize(x) := (2*x + 1) / (2^16 - 1) \endcode
+ * is used to map the fixed-point numbers into the range [-1, 1].
+ */
+static void
+convert_fixed_to_float(const struct gl_client_array *input,
+ const GLubyte *ptr, GLfloat *fptr,
+ GLuint count)
+{
+ GLuint i, j;
+ const GLint size = input->Size;
+
+ if (input->Normalized) {
+ for (i = 0; i < count; ++i) {
+ const GLfixed *in = (GLfixed *) ptr;
+ for (j = 0; j < size; ++j) {
+ *fptr++ = (GLfloat) (2 * in[j] + 1) / (GLfloat) ((1 << 16) - 1);
+ }
+ ptr += input->StrideB;
+ }
+ } else {
+ for (i = 0; i < count; ++i) {
+ const GLfixed *in = (GLfixed *) ptr;
+ for (j = 0; j < size; ++j) {
+ *fptr++ = in[j] / (GLfloat) (1 << 16);
+ }
+ ptr += input->StrideB;
+ }
+ }
+}
+
+/* Adjust pointer to point at first requested element, convert to
+ * floating point, populate VB->AttribPtr[].
+ */
+static void _tnl_import_array( struct gl_context *ctx,
+ GLuint attrib,
+ GLuint count,
+ const struct gl_client_array *input,
+ const GLubyte *ptr )
+{
+ TNLcontext *tnl = TNL_CONTEXT(ctx);
+ struct vertex_buffer *VB = &tnl->vb;
+ GLuint stride = input->StrideB;
+
+ if (input->Type != GL_FLOAT) {
+ const GLuint sz = input->Size;
+ GLubyte *buf = get_space(ctx, count * sz * sizeof(GLfloat));
+ GLfloat *fptr = (GLfloat *)buf;
+
+ switch (input->Type) {
+ case GL_BYTE:
+ CONVERT(GLbyte, BYTE_TO_FLOAT);
+ break;
+ case GL_UNSIGNED_BYTE:
+ if (input->Format == GL_BGRA) {
+ /* See GL_EXT_vertex_array_bgra */
+ convert_bgra_to_float(input, ptr, fptr, count);
+ }
+ else {
+ CONVERT(GLubyte, UBYTE_TO_FLOAT);
+ }
+ break;
+ case GL_SHORT:
+ CONVERT(GLshort, SHORT_TO_FLOAT);
+ break;
+ case GL_UNSIGNED_SHORT:
+ CONVERT(GLushort, USHORT_TO_FLOAT);
+ break;
+ case GL_INT:
+ CONVERT(GLint, INT_TO_FLOAT);
+ break;
+ case GL_UNSIGNED_INT:
+ CONVERT(GLuint, UINT_TO_FLOAT);
+ break;
+ case GL_DOUBLE:
+ CONVERT(GLdouble, (GLfloat));
+ break;
+ case GL_HALF_FLOAT:
+ convert_half_to_float(input, ptr, fptr, count, sz);
+ break;
+ case GL_FIXED:
+ convert_fixed_to_float(input, ptr, fptr, count);
+ break;
+ default:
+ assert(0);
+ break;
+ }
+
+ ptr = buf;
+ stride = sz * sizeof(GLfloat);
+ }
+
+ VB->AttribPtr[attrib] = &tnl->tmp_inputs[attrib];
+ VB->AttribPtr[attrib]->data = (GLfloat (*)[4])ptr;
+ VB->AttribPtr[attrib]->start = (GLfloat *)ptr;
+ VB->AttribPtr[attrib]->count = count;
+ VB->AttribPtr[attrib]->stride = stride;
+ VB->AttribPtr[attrib]->size = input->Size;
+
+ /* This should die, but so should the whole GLvector4f concept:
+ */
+ VB->AttribPtr[attrib]->flags = (((1<<input->Size)-1) |
+ VEC_NOT_WRITEABLE |
+ (stride == 4*sizeof(GLfloat) ? 0 : VEC_BAD_STRIDE));
+
+ VB->AttribPtr[attrib]->storage = NULL;
+}
+
+#define CLIPVERTS ((6 + MAX_CLIP_PLANES) * 2)
+
+
+static GLboolean *_tnl_import_edgeflag( struct gl_context *ctx,
+ const GLvector4f *input,
+ GLuint count)
+{
+ const GLubyte *ptr = (const GLubyte *)input->data;
+ const GLuint stride = input->stride;
+ GLboolean *space = (GLboolean *)get_space(ctx, count + CLIPVERTS);
+ GLboolean *bptr = space;
+ GLuint i;
+
+ for (i = 0; i < count; i++) {
+ *bptr++ = ((GLfloat *)ptr)[0] == 1.0;
+ ptr += stride;
+ }
+
+ return space;
+}
+
+
+static void bind_inputs( struct gl_context *ctx,
+ const struct gl_client_array *inputs[],
+ GLint count,
+ struct gl_buffer_object **bo,
+ GLuint *nr_bo )
+{
+ TNLcontext *tnl = TNL_CONTEXT(ctx);
+ struct vertex_buffer *VB = &tnl->vb;
+ GLuint i;
+
+ /* Map all the VBOs
+ */
+ for (i = 0; i < VERT_ATTRIB_MAX; i++) {
+ const void *ptr;
+
+ if (inputs[i]->BufferObj->Name) {
+ if (!inputs[i]->BufferObj->Pointer) {
+ bo[*nr_bo] = inputs[i]->BufferObj;
+ (*nr_bo)++;
+ ctx->Driver.MapBuffer(ctx,
+ GL_ARRAY_BUFFER,
+ GL_READ_ONLY_ARB,
+ inputs[i]->BufferObj);
+
+ assert(inputs[i]->BufferObj->Pointer);
+ }
+
+ ptr = ADD_POINTERS(inputs[i]->BufferObj->Pointer,
+ inputs[i]->Ptr);
+ }
+ else
+ ptr = inputs[i]->Ptr;
+
+ /* Just make sure the array is floating point, otherwise convert to
+ * temporary storage.
+ *
+ * XXX: remove the GLvector4f type at some stage and just use
+ * client arrays.
+ */
+ _tnl_import_array(ctx, i, count, inputs[i], ptr);
+ }
+
+ /* We process only the vertices between min & max index:
+ */
+ VB->Count = count;
+
+ /* These should perhaps be part of _TNL_ATTRIB_* */
+ VB->BackfaceColorPtr = NULL;
+ VB->BackfaceIndexPtr = NULL;
+ VB->BackfaceSecondaryColorPtr = NULL;
+
+ /* Clipping and drawing code still requires this to be a packed
+ * array of ubytes which can be written into. TODO: Fix and
+ * remove.
+ */
+ if (ctx->Polygon.FrontMode != GL_FILL ||
+ ctx->Polygon.BackMode != GL_FILL)
+ {
+ VB->EdgeFlag = _tnl_import_edgeflag( ctx,
+ VB->AttribPtr[_TNL_ATTRIB_EDGEFLAG],
+ VB->Count );
+ }
+ else {
+ /* the data previously pointed to by EdgeFlag may have been freed */
+ VB->EdgeFlag = NULL;
+ }
+}
+
+
+/* Translate indices to GLuints and store in VB->Elts.
+ */
+static void bind_indices( struct gl_context *ctx,
+ const struct _mesa_index_buffer *ib,
+ struct gl_buffer_object **bo,
+ GLuint *nr_bo)
+{
+ TNLcontext *tnl = TNL_CONTEXT(ctx);
+ struct vertex_buffer *VB = &tnl->vb;
+ GLuint i;
+ void *ptr;
+
+ if (!ib) {
+ VB->Elts = NULL;
+ return;
+ }
+
+ if (ib->obj->Name && !ib->obj->Pointer) {
+ bo[*nr_bo] = ib->obj;
+ (*nr_bo)++;
+ ctx->Driver.MapBuffer(ctx,
+ GL_ELEMENT_ARRAY_BUFFER,
+ GL_READ_ONLY_ARB,
+ ib->obj);
+
+ assert(ib->obj->Pointer);
+ }
+
+ ptr = ADD_POINTERS(ib->obj->Pointer, ib->ptr);
+
+ if (ib->type == GL_UNSIGNED_INT && VB->Primitive[0].basevertex == 0) {
+ VB->Elts = (GLuint *) ptr;
+ }
+ else {
+ GLuint *elts = (GLuint *)get_space(ctx, ib->count * sizeof(GLuint));
+ VB->Elts = elts;
+
+ if (ib->type == GL_UNSIGNED_INT) {
+ const GLuint *in = (GLuint *)ptr;
+ for (i = 0; i < ib->count; i++)
+ *elts++ = (GLuint)(*in++) + VB->Primitive[0].basevertex;
+ }
+ else if (ib->type == GL_UNSIGNED_SHORT) {
+ const GLushort *in = (GLushort *)ptr;
+ for (i = 0; i < ib->count; i++)
+ *elts++ = (GLuint)(*in++) + VB->Primitive[0].basevertex;
+ }
+ else {
+ const GLubyte *in = (GLubyte *)ptr;
+ for (i = 0; i < ib->count; i++)
+ *elts++ = (GLuint)(*in++) + VB->Primitive[0].basevertex;
+ }
+ }
+}
+
+static void bind_prims( struct gl_context *ctx,
+ const struct _mesa_prim *prim,
+ GLuint nr_prims )
+{
+ TNLcontext *tnl = TNL_CONTEXT(ctx);
+ struct vertex_buffer *VB = &tnl->vb;
+
+ VB->Primitive = prim;
+ VB->PrimitiveCount = nr_prims;
+}
+
+static void unmap_vbos( struct gl_context *ctx,
+ struct gl_buffer_object **bo,
+ GLuint nr_bo )
+{
+ GLuint i;
+ for (i = 0; i < nr_bo; i++) {
+ ctx->Driver.UnmapBuffer(ctx,
+ 0, /* target -- I don't see why this would be needed */
+ bo[i]);
+ }
+}
+
+
+void _tnl_vbo_draw_prims(struct gl_context *ctx,
+ const struct gl_client_array *arrays[],
+ const struct _mesa_prim *prim,
+ GLuint nr_prims,
+ const struct _mesa_index_buffer *ib,
+ GLboolean index_bounds_valid,
+ GLuint min_index,
+ GLuint max_index)
+{
+ if (!index_bounds_valid)
+ vbo_get_minmax_index(ctx, prim, ib, &min_index, &max_index);
+
+ _tnl_draw_prims(ctx, arrays, prim, nr_prims, ib, min_index, max_index);
+}
+
+/* This is the main entrypoint into the slimmed-down software tnl
+ * module. In a regular swtnl driver, this can be plugged straight
+ * into the vbo->Driver.DrawPrims() callback.
+ */
+void _tnl_draw_prims( struct gl_context *ctx,
+ const struct gl_client_array *arrays[],
+ const struct _mesa_prim *prim,
+ GLuint nr_prims,
+ const struct _mesa_index_buffer *ib,
+ GLuint min_index,
+ GLuint max_index)
+{
+ TNLcontext *tnl = TNL_CONTEXT(ctx);
+ const GLuint TEST_SPLIT = 0;
+ const GLint max = TEST_SPLIT ? 8 : tnl->vb.Size - MAX_CLIPPED_VERTICES;
+ GLint max_basevertex = prim->basevertex;
+ GLuint i;
+
+ /* Mesa core state should have been validated already */
+ assert(ctx->NewState == 0x0);
+
+ if (!_mesa_check_conditional_render(ctx))
+ return; /* don't draw */
+
+ for (i = 1; i < nr_prims; i++)
+ max_basevertex = MAX2(max_basevertex, prim[i].basevertex);
+
+ if (0)
+ {
+ printf("%s %d..%d\n", __FUNCTION__, min_index, max_index);
+ for (i = 0; i < nr_prims; i++)
+ printf("prim %d: %s start %d count %d\n", i,
+ _mesa_lookup_enum_by_nr(prim[i].mode),
+ prim[i].start,
+ prim[i].count);
+ }
+
+ if (min_index) {
+ /* We always translate away calls with min_index != 0.
+ */
+ vbo_rebase_prims( ctx, arrays, prim, nr_prims, ib,
+ min_index, max_index,
+ _tnl_vbo_draw_prims );
+ return;
+ }
+ else if ((GLint)max_index + max_basevertex > max) {
+ /* The software TNL pipeline has a fixed amount of storage for
+ * vertices and it is necessary to split incoming drawing commands
+ * if they exceed that limit.
+ */
+ struct split_limits limits;
+ limits.max_verts = max;
+ limits.max_vb_size = ~0;
+ limits.max_indices = ~0;
+
+ /* This will split the buffers one way or another and
+ * recursively call back into this function.
+ */
+ vbo_split_prims( ctx, arrays, prim, nr_prims, ib,
+ 0, max_index + prim->basevertex,
+ _tnl_vbo_draw_prims,
+ &limits );
+ }
+ else {
+ /* May need to map a vertex buffer object for every attribute plus
+ * one for the index buffer.
+ */
+ struct gl_buffer_object *bo[VERT_ATTRIB_MAX + 1];
+ GLuint nr_bo = 0;
+ GLuint inst;
+
+ for (i = 0; i < nr_prims;) {
+ GLuint this_nr_prims;
+
+ /* Our SW TNL pipeline doesn't handle basevertex yet, so bind_indices
+ * will rebase the elements to the basevertex, and we'll only
+ * emit strings of prims with the same basevertex in one draw call.
+ */
+ for (this_nr_prims = 1; i + this_nr_prims < nr_prims;
+ this_nr_prims++) {
+ if (prim[i].basevertex != prim[i + this_nr_prims].basevertex)
+ break;
+ }
+
+ assert(prim[i].num_instances > 0);
+
+ /* Binding inputs may imply mapping some vertex buffer objects.
+ * They will need to be unmapped below.
+ */
+ for (inst = 0; inst < prim[i].num_instances; inst++) {
+
+ bind_prims(ctx, &prim[i], this_nr_prims);
+ bind_inputs(ctx, arrays, max_index + prim[i].basevertex + 1,
+ bo, &nr_bo);
+ bind_indices(ctx, ib, bo, &nr_bo);
+
+ tnl->CurInstance = inst;
+ TNL_CONTEXT(ctx)->Driver.RunPipeline(ctx);
+
+ unmap_vbos(ctx, bo, nr_bo);
+ free_space(ctx);
+ }
+
+ i += this_nr_prims;
+ }
+ }
+}
+
diff --git a/mesalib/src/mesa/vbo/vbo.h b/mesalib/src/mesa/vbo/vbo.h
index 26c3d4e0a..37bdde9a8 100644
--- a/mesalib/src/mesa/vbo/vbo.h
+++ b/mesalib/src/mesa/vbo/vbo.h
@@ -1,176 +1,176 @@
-/*
- * mesa 3-D graphics library
- * Version: 6.5
- *
- * Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-/**
- * \file vbo_context.h
- * \brief VBO builder module datatypes and definitions.
- * \author Keith Whitwell
- */
-
-
-#ifndef _VBO_H
-#define _VBO_H
-
-#include "main/glheader.h"
-
-struct gl_client_array;
-struct gl_context;
-
-struct _mesa_prim {
- GLuint mode:8; /**< GL_POINTS, GL_LINES, GL_QUAD_STRIP, etc */
- GLuint indexed:1;
- GLuint begin:1;
- GLuint end:1;
- GLuint weak:1;
- GLuint no_current_update:1;
- GLuint pad:19;
-
- GLuint start;
- GLuint count;
- GLint basevertex;
- GLsizei num_instances;
-};
-
-/* Would like to call this a "vbo_index_buffer", but this would be
- * confusing as the indices are not neccessarily yet in a non-null
- * buffer object.
- */
-struct _mesa_index_buffer {
- GLuint count;
- GLenum type;
- struct gl_buffer_object *obj;
- const void *ptr;
-};
-
-
-
-GLboolean _vbo_CreateContext( struct gl_context *ctx );
-void _vbo_DestroyContext( struct gl_context *ctx );
-void _vbo_InvalidateState( struct gl_context *ctx, GLuint new_state );
-
-
-typedef void (*vbo_draw_func)( struct gl_context *ctx,
- const struct gl_client_array **arrays,
- const struct _mesa_prim *prims,
- GLuint nr_prims,
- const struct _mesa_index_buffer *ib,
- GLboolean index_bounds_valid,
- GLuint min_index,
- GLuint max_index );
-
-
-
-
-/* Utility function to cope with various constraints on tnl modules or
- * hardware. This can be used to split an incoming set of arrays and
- * primitives against the following constraints:
- * - Maximum number of indices in index buffer.
- * - Maximum number of vertices referenced by index buffer.
- * - Maximum hardware vertex buffer size.
- */
-struct split_limits {
- GLuint max_verts;
- GLuint max_indices;
- GLuint max_vb_size; /* bytes */
-};
-
-
-void vbo_split_prims( struct gl_context *ctx,
- const struct gl_client_array *arrays[],
- const struct _mesa_prim *prim,
- GLuint nr_prims,
- const struct _mesa_index_buffer *ib,
- GLuint min_index,
- GLuint max_index,
- vbo_draw_func draw,
- const struct split_limits *limits );
-
-
-/* Helpers for dealing translating away non-zero min_index.
- */
-GLboolean vbo_all_varyings_in_vbos( const struct gl_client_array *arrays[] );
-GLboolean vbo_any_varyings_in_vbos( const struct gl_client_array *arrays[] );
-
-void vbo_rebase_prims( struct gl_context *ctx,
- const struct gl_client_array *arrays[],
- const struct _mesa_prim *prim,
- GLuint nr_prims,
- const struct _mesa_index_buffer *ib,
- GLuint min_index,
- GLuint max_index,
- vbo_draw_func draw );
-void
-vbo_get_minmax_index(struct gl_context *ctx, const struct _mesa_prim *prim,
- const struct _mesa_index_buffer *ib,
- GLuint *min_index, GLuint *max_index);
-
-void vbo_use_buffer_objects(struct gl_context *ctx);
-
-void vbo_always_unmap_buffers(struct gl_context *ctx);
-
-void vbo_set_draw_func(struct gl_context *ctx, vbo_draw_func func);
-
-void vbo_check_buffers_are_unmapped(struct gl_context *ctx);
-
-
-void GLAPIENTRY
-_es_Color4f(GLfloat r, GLfloat g, GLfloat b, GLfloat a);
-
-void GLAPIENTRY
-_es_Normal3f(GLfloat x, GLfloat y, GLfloat z);
-
-void GLAPIENTRY
-_es_MultiTexCoord4f(GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q);
-
-void GLAPIENTRY
-_es_Materialfv(GLenum face, GLenum pname, const GLfloat *params);
-
-void GLAPIENTRY
-_es_Materialf(GLenum face, GLenum pname, GLfloat param);
-
-void GLAPIENTRY
-_es_VertexAttrib4f(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-
-void GLAPIENTRY
-_es_VertexAttrib1f(GLuint indx, GLfloat x);
-
-void GLAPIENTRY
-_es_VertexAttrib1fv(GLuint indx, const GLfloat* values);
-
-void GLAPIENTRY
-_es_VertexAttrib2f(GLuint indx, GLfloat x, GLfloat y);
-
-void GLAPIENTRY
-_es_VertexAttrib2fv(GLuint indx, const GLfloat* values);
-
-void GLAPIENTRY
-_es_VertexAttrib3f(GLuint indx, GLfloat x, GLfloat y, GLfloat z);
-
-void GLAPIENTRY
-_es_VertexAttrib3fv(GLuint indx, const GLfloat* values);
-
-void GLAPIENTRY
-_es_VertexAttrib4fv(GLuint indx, const GLfloat* values);
-
-#endif
+/*
+ * mesa 3-D graphics library
+ * Version: 6.5
+ *
+ * Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+/**
+ * \file vbo_context.h
+ * \brief VBO builder module datatypes and definitions.
+ * \author Keith Whitwell
+ */
+
+
+#ifndef _VBO_H
+#define _VBO_H
+
+#include "main/glheader.h"
+
+struct gl_client_array;
+struct gl_context;
+
+struct _mesa_prim {
+ GLuint mode:8; /**< GL_POINTS, GL_LINES, GL_QUAD_STRIP, etc */
+ GLuint indexed:1;
+ GLuint begin:1;
+ GLuint end:1;
+ GLuint weak:1;
+ GLuint no_current_update:1;
+ GLuint pad:19;
+
+ GLuint start;
+ GLuint count;
+ GLint basevertex;
+ GLsizei num_instances;
+};
+
+/* Would like to call this a "vbo_index_buffer", but this would be
+ * confusing as the indices are not neccessarily yet in a non-null
+ * buffer object.
+ */
+struct _mesa_index_buffer {
+ GLuint count;
+ GLenum type;
+ struct gl_buffer_object *obj;
+ const void *ptr;
+};
+
+
+
+GLboolean _vbo_CreateContext( struct gl_context *ctx );
+void _vbo_DestroyContext( struct gl_context *ctx );
+void _vbo_InvalidateState( struct gl_context *ctx, GLuint new_state );
+
+
+typedef void (*vbo_draw_func)( struct gl_context *ctx,
+ const struct gl_client_array **arrays,
+ const struct _mesa_prim *prims,
+ GLuint nr_prims,
+ const struct _mesa_index_buffer *ib,
+ GLboolean index_bounds_valid,
+ GLuint min_index,
+ GLuint max_index );
+
+
+
+
+/* Utility function to cope with various constraints on tnl modules or
+ * hardware. This can be used to split an incoming set of arrays and
+ * primitives against the following constraints:
+ * - Maximum number of indices in index buffer.
+ * - Maximum number of vertices referenced by index buffer.
+ * - Maximum hardware vertex buffer size.
+ */
+struct split_limits {
+ GLuint max_verts;
+ GLuint max_indices;
+ GLuint max_vb_size; /* bytes */
+};
+
+
+void vbo_split_prims( struct gl_context *ctx,
+ const struct gl_client_array *arrays[],
+ const struct _mesa_prim *prim,
+ GLuint nr_prims,
+ const struct _mesa_index_buffer *ib,
+ GLuint min_index,
+ GLuint max_index,
+ vbo_draw_func draw,
+ const struct split_limits *limits );
+
+
+/* Helpers for dealing translating away non-zero min_index.
+ */
+GLboolean vbo_all_varyings_in_vbos( const struct gl_client_array *arrays[] );
+GLboolean vbo_any_varyings_in_vbos( const struct gl_client_array *arrays[] );
+
+void vbo_rebase_prims( struct gl_context *ctx,
+ const struct gl_client_array *arrays[],
+ const struct _mesa_prim *prim,
+ GLuint nr_prims,
+ const struct _mesa_index_buffer *ib,
+ GLuint min_index,
+ GLuint max_index,
+ vbo_draw_func draw );
+void
+vbo_get_minmax_index(struct gl_context *ctx, const struct _mesa_prim *prim,
+ const struct _mesa_index_buffer *ib,
+ GLuint *min_index, GLuint *max_index);
+
+void vbo_use_buffer_objects(struct gl_context *ctx);
+
+void vbo_always_unmap_buffers(struct gl_context *ctx);
+
+void vbo_set_draw_func(struct gl_context *ctx, vbo_draw_func func);
+
+void vbo_check_buffers_are_unmapped(struct gl_context *ctx);
+
+
+void GLAPIENTRY
+_es_Color4f(GLfloat r, GLfloat g, GLfloat b, GLfloat a);
+
+void GLAPIENTRY
+_es_Normal3f(GLfloat x, GLfloat y, GLfloat z);
+
+void GLAPIENTRY
+_es_MultiTexCoord4f(GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q);
+
+void GLAPIENTRY
+_es_Materialfv(GLenum face, GLenum pname, const GLfloat *params);
+
+void GLAPIENTRY
+_es_Materialf(GLenum face, GLenum pname, GLfloat param);
+
+void GLAPIENTRY
+_es_VertexAttrib4f(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+
+void GLAPIENTRY
+_es_VertexAttrib1f(GLuint indx, GLfloat x);
+
+void GLAPIENTRY
+_es_VertexAttrib1fv(GLuint indx, const GLfloat* values);
+
+void GLAPIENTRY
+_es_VertexAttrib2f(GLuint indx, GLfloat x, GLfloat y);
+
+void GLAPIENTRY
+_es_VertexAttrib2fv(GLuint indx, const GLfloat* values);
+
+void GLAPIENTRY
+_es_VertexAttrib3f(GLuint indx, GLfloat x, GLfloat y, GLfloat z);
+
+void GLAPIENTRY
+_es_VertexAttrib3fv(GLuint indx, const GLfloat* values);
+
+void GLAPIENTRY
+_es_VertexAttrib4fv(GLuint indx, const GLfloat* values);
+
+#endif
diff --git a/mesalib/src/mesa/vbo/vbo_attrib_tmp.h b/mesalib/src/mesa/vbo/vbo_attrib_tmp.h
index c793ce0dc..198b2d85f 100644
--- a/mesalib/src/mesa/vbo/vbo_attrib_tmp.h
+++ b/mesalib/src/mesa/vbo/vbo_attrib_tmp.h
@@ -1,740 +1,740 @@
-/**************************************************************************
-
-Copyright 2002 Tungsten Graphics Inc., Cedar Park, Texas.
-
-All Rights Reserved.
-
-Permission is hereby granted, free of charge, to any person obtaining a
-copy of this software and associated documentation files (the "Software"),
-to deal in the Software without restriction, including without limitation
-on the rights to use, copy, modify, merge, publish, distribute, sub
-license, and/or sell copies of the Software, and to permit persons to whom
-the Software is furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice (including the next
-paragraph) shall be included in all copies or substantial portions of the
-Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
-TUNGSTEN GRAPHICS AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
-DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
-OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
-USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-**************************************************************************/
-
-/* float */
-#define ATTR1FV( A, V ) ATTR( A, 1, (V)[0], 0, 0, 1 )
-#define ATTR2FV( A, V ) ATTR( A, 2, (V)[0], (V)[1], 0, 1 )
-#define ATTR3FV( A, V ) ATTR( A, 3, (V)[0], (V)[1], (V)[2], 1 )
-#define ATTR4FV( A, V ) ATTR( A, 4, (V)[0], (V)[1], (V)[2], (V)[3] )
-
-#define ATTR1F( A, X ) ATTR( A, 1, X, 0, 0, 1 )
-#define ATTR2F( A, X, Y ) ATTR( A, 2, X, Y, 0, 1 )
-#define ATTR3F( A, X, Y, Z ) ATTR( A, 3, X, Y, Z, 1 )
-#define ATTR4F( A, X, Y, Z, W ) ATTR( A, 4, X, Y, Z, W )
-
-/* int */
-#define ATTR2IV( A, V ) ATTR( A, 2, (V)[0], (V)[1], 0, 1 )
-#define ATTR3IV( A, V ) ATTR( A, 3, (V)[0], (V)[1], (V)[2], 1 )
-#define ATTR4IV( A, V ) ATTR( A, 4, (V)[0], (V)[1], (V)[2], (V)[3] )
-
-#define ATTR1I( A, X ) ATTR( A, 1, X, 0, 0, 1 )
-#define ATTR2I( A, X, Y ) ATTR( A, 2, X, Y, 0, 1 )
-#define ATTR3I( A, X, Y, Z ) ATTR( A, 3, X, Y, Z, 1 )
-#define ATTR4I( A, X, Y, Z, W ) ATTR( A, 4, X, Y, Z, W )
-
-
-/* uint */
-#define ATTR2UIV( A, V ) ATTR( A, 2, (V)[0], (V)[1], 0, 1 )
-#define ATTR3UIV( A, V ) ATTR( A, 3, (V)[0], (V)[1], (V)[2], 1 )
-#define ATTR4UIV( A, V ) ATTR( A, 4, (V)[0], (V)[1], (V)[2], (V)[3] )
-
-#define ATTR1UI( A, X ) ATTR( A, 1, X, 0, 0, 1 )
-#define ATTR2UI( A, X, Y ) ATTR( A, 2, X, Y, 0, 1 )
-#define ATTR3UI( A, X, Y, Z ) ATTR( A, 3, X, Y, Z, 1 )
-#define ATTR4UI( A, X, Y, Z, W ) ATTR( A, 4, X, Y, Z, W )
-
-#define MAT_ATTR( A, N, V ) ATTR( A, N, (V)[0], (V)[1], (V)[2], (V)[3] )
-
-
-
-static void GLAPIENTRY
-TAG(Vertex2f)(GLfloat x, GLfloat y)
-{
- GET_CURRENT_CONTEXT(ctx);
- ATTR2F(VBO_ATTRIB_POS, x, y);
-}
-
-static void GLAPIENTRY
-TAG(Vertex2fv)(const GLfloat * v)
-{
- GET_CURRENT_CONTEXT(ctx);
- ATTR2FV(VBO_ATTRIB_POS, v);
-}
-
-static void GLAPIENTRY
-TAG(Vertex3f)(GLfloat x, GLfloat y, GLfloat z)
-{
- GET_CURRENT_CONTEXT(ctx);
- ATTR3F(VBO_ATTRIB_POS, x, y, z);
-}
-
-static void GLAPIENTRY
-TAG(Vertex3fv)(const GLfloat * v)
-{
- GET_CURRENT_CONTEXT(ctx);
- ATTR3FV(VBO_ATTRIB_POS, v);
-}
-
-static void GLAPIENTRY
-TAG(Vertex4f)(GLfloat x, GLfloat y, GLfloat z, GLfloat w)
-{
- GET_CURRENT_CONTEXT(ctx);
- ATTR4F(VBO_ATTRIB_POS, x, y, z, w);
-}
-
-static void GLAPIENTRY
-TAG(Vertex4fv)(const GLfloat * v)
-{
- GET_CURRENT_CONTEXT(ctx);
- ATTR4FV(VBO_ATTRIB_POS, v);
-}
-
-
-
-static void GLAPIENTRY
-TAG(TexCoord1f)(GLfloat x)
-{
- GET_CURRENT_CONTEXT(ctx);
- ATTR1F(VBO_ATTRIB_TEX0, x);
-}
-
-static void GLAPIENTRY
-TAG(TexCoord1fv)(const GLfloat * v)
-{
- GET_CURRENT_CONTEXT(ctx);
- ATTR1FV(VBO_ATTRIB_TEX0, v);
-}
-
-static void GLAPIENTRY
-TAG(TexCoord2f)(GLfloat x, GLfloat y)
-{
- GET_CURRENT_CONTEXT(ctx);
- ATTR2F(VBO_ATTRIB_TEX0, x, y);
-}
-
-static void GLAPIENTRY
-TAG(TexCoord2fv)(const GLfloat * v)
-{
- GET_CURRENT_CONTEXT(ctx);
- ATTR2FV(VBO_ATTRIB_TEX0, v);
-}
-
-static void GLAPIENTRY
-TAG(TexCoord3f)(GLfloat x, GLfloat y, GLfloat z)
-{
- GET_CURRENT_CONTEXT(ctx);
- ATTR3F(VBO_ATTRIB_TEX0, x, y, z);
-}
-
-static void GLAPIENTRY
-TAG(TexCoord3fv)(const GLfloat * v)
-{
- GET_CURRENT_CONTEXT(ctx);
- ATTR3FV(VBO_ATTRIB_TEX0, v);
-}
-
-static void GLAPIENTRY
-TAG(TexCoord4f)(GLfloat x, GLfloat y, GLfloat z, GLfloat w)
-{
- GET_CURRENT_CONTEXT(ctx);
- ATTR4F(VBO_ATTRIB_TEX0, x, y, z, w);
-}
-
-static void GLAPIENTRY
-TAG(TexCoord4fv)(const GLfloat * v)
-{
- GET_CURRENT_CONTEXT(ctx);
- ATTR4FV(VBO_ATTRIB_TEX0, v);
-}
-
-
-
-static void GLAPIENTRY
-TAG(Normal3f)(GLfloat x, GLfloat y, GLfloat z)
-{
- GET_CURRENT_CONTEXT(ctx);
- ATTR3F(VBO_ATTRIB_NORMAL, x, y, z);
-}
-
-static void GLAPIENTRY
-TAG(Normal3fv)(const GLfloat * v)
-{
- GET_CURRENT_CONTEXT(ctx);
- ATTR3FV(VBO_ATTRIB_NORMAL, v);
-}
-
-
-
-static void GLAPIENTRY
-TAG(FogCoordfEXT)(GLfloat x)
-{
- GET_CURRENT_CONTEXT(ctx);
- ATTR1F(VBO_ATTRIB_FOG, x);
-}
-
-
-
-static void GLAPIENTRY
-TAG(FogCoordfvEXT)(const GLfloat * v)
-{
- GET_CURRENT_CONTEXT(ctx);
- ATTR1FV(VBO_ATTRIB_FOG, v);
-}
-
-static void GLAPIENTRY
-TAG(Color3f)(GLfloat x, GLfloat y, GLfloat z)
-{
- GET_CURRENT_CONTEXT(ctx);
- ATTR3F(VBO_ATTRIB_COLOR0, x, y, z);
-}
-
-static void GLAPIENTRY
-TAG(Color3fv)(const GLfloat * v)
-{
- GET_CURRENT_CONTEXT(ctx);
- ATTR3FV(VBO_ATTRIB_COLOR0, v);
-}
-
-static void GLAPIENTRY
-TAG(Color4f)(GLfloat x, GLfloat y, GLfloat z, GLfloat w)
-{
- GET_CURRENT_CONTEXT(ctx);
- ATTR4F(VBO_ATTRIB_COLOR0, x, y, z, w);
-}
-
-static void GLAPIENTRY
-TAG(Color4fv)(const GLfloat * v)
-{
- GET_CURRENT_CONTEXT(ctx);
- ATTR4FV(VBO_ATTRIB_COLOR0, v);
-}
-
-
-
-static void GLAPIENTRY
-TAG(SecondaryColor3fEXT)(GLfloat x, GLfloat y, GLfloat z)
-{
- GET_CURRENT_CONTEXT(ctx);
- ATTR3F(VBO_ATTRIB_COLOR1, x, y, z);
-}
-
-static void GLAPIENTRY
-TAG(SecondaryColor3fvEXT)(const GLfloat * v)
-{
- GET_CURRENT_CONTEXT(ctx);
- ATTR3FV(VBO_ATTRIB_COLOR1, v);
-}
-
-
-
-static void GLAPIENTRY
-TAG(EdgeFlag)(GLboolean b)
-{
- GET_CURRENT_CONTEXT(ctx);
- ATTR1F(VBO_ATTRIB_EDGEFLAG, (GLfloat) b);
-}
-
-
-
-static void GLAPIENTRY
-TAG(Indexf)(GLfloat f)
-{
- GET_CURRENT_CONTEXT(ctx);
- ATTR1F(VBO_ATTRIB_INDEX, f);
-}
-
-static void GLAPIENTRY
-TAG(Indexfv)(const GLfloat * f)
-{
- GET_CURRENT_CONTEXT(ctx);
- ATTR1FV(VBO_ATTRIB_INDEX, f);
-}
-
-
-
-static void GLAPIENTRY
-TAG(MultiTexCoord1f)(GLenum target, GLfloat x)
-{
- GET_CURRENT_CONTEXT(ctx);
- GLuint attr = (target & 0x7) + VBO_ATTRIB_TEX0;
- ATTR1F(attr, x);
-}
-
-static void GLAPIENTRY
-TAG(MultiTexCoord1fv)(GLenum target, const GLfloat * v)
-{
- GET_CURRENT_CONTEXT(ctx);
- GLuint attr = (target & 0x7) + VBO_ATTRIB_TEX0;
- ATTR1FV(attr, v);
-}
-
-static void GLAPIENTRY
-TAG(MultiTexCoord2f)(GLenum target, GLfloat x, GLfloat y)
-{
- GET_CURRENT_CONTEXT(ctx);
- GLuint attr = (target & 0x7) + VBO_ATTRIB_TEX0;
- ATTR2F(attr, x, y);
-}
-
-static void GLAPIENTRY
-TAG(MultiTexCoord2fv)(GLenum target, const GLfloat * v)
-{
- GET_CURRENT_CONTEXT(ctx);
- GLuint attr = (target & 0x7) + VBO_ATTRIB_TEX0;
- ATTR2FV(attr, v);
-}
-
-static void GLAPIENTRY
-TAG(MultiTexCoord3f)(GLenum target, GLfloat x, GLfloat y, GLfloat z)
-{
- GET_CURRENT_CONTEXT(ctx);
- GLuint attr = (target & 0x7) + VBO_ATTRIB_TEX0;
- ATTR3F(attr, x, y, z);
-}
-
-static void GLAPIENTRY
-TAG(MultiTexCoord3fv)(GLenum target, const GLfloat * v)
-{
- GET_CURRENT_CONTEXT(ctx);
- GLuint attr = (target & 0x7) + VBO_ATTRIB_TEX0;
- ATTR3FV(attr, v);
-}
-
-static void GLAPIENTRY
-TAG(MultiTexCoord4f)(GLenum target, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
-{
- GET_CURRENT_CONTEXT(ctx);
- GLuint attr = (target & 0x7) + VBO_ATTRIB_TEX0;
- ATTR4F(attr, x, y, z, w);
-}
-
-static void GLAPIENTRY
-TAG(MultiTexCoord4fv)(GLenum target, const GLfloat * v)
-{
- GET_CURRENT_CONTEXT(ctx);
- GLuint attr = (target & 0x7) + VBO_ATTRIB_TEX0;
- ATTR4FV(attr, v);
-}
-
-
-
-static void GLAPIENTRY
-TAG(VertexAttrib1fARB)(GLuint index, GLfloat x)
-{
- GET_CURRENT_CONTEXT(ctx);
- if (index == 0)
- ATTR1F(0, x);
- else if (index < MAX_VERTEX_GENERIC_ATTRIBS)
- ATTR1F(VBO_ATTRIB_GENERIC0 + index, x);
- else
- ERROR(GL_INVALID_VALUE);
-}
-
-static void GLAPIENTRY
-TAG(VertexAttrib1fvARB)(GLuint index, const GLfloat * v)
-{
- GET_CURRENT_CONTEXT(ctx);
- if (index == 0)
- ATTR1FV(0, v);
- else if (index < MAX_VERTEX_GENERIC_ATTRIBS)
- ATTR1FV(VBO_ATTRIB_GENERIC0 + index, v);
- else
- ERROR(GL_INVALID_VALUE);
-}
-
-static void GLAPIENTRY
-TAG(VertexAttrib2fARB)(GLuint index, GLfloat x, GLfloat y)
-{
- GET_CURRENT_CONTEXT(ctx);
- if (index == 0)
- ATTR2F(0, x, y);
- else if (index < MAX_VERTEX_GENERIC_ATTRIBS)
- ATTR2F(VBO_ATTRIB_GENERIC0 + index, x, y);
- else
- ERROR(GL_INVALID_VALUE);
-}
-
-static void GLAPIENTRY
-TAG(VertexAttrib2fvARB)(GLuint index, const GLfloat * v)
-{
- GET_CURRENT_CONTEXT(ctx);
- if (index == 0)
- ATTR2FV(0, v);
- else if (index < MAX_VERTEX_GENERIC_ATTRIBS)
- ATTR2FV(VBO_ATTRIB_GENERIC0 + index, v);
- else
- ERROR(GL_INVALID_VALUE);
-}
-
-static void GLAPIENTRY
-TAG(VertexAttrib3fARB)(GLuint index, GLfloat x, GLfloat y, GLfloat z)
-{
- GET_CURRENT_CONTEXT(ctx);
- if (index == 0)
- ATTR3F(0, x, y, z);
- else if (index < MAX_VERTEX_GENERIC_ATTRIBS)
- ATTR3F(VBO_ATTRIB_GENERIC0 + index, x, y, z);
- else
- ERROR(GL_INVALID_VALUE);
-}
-
-static void GLAPIENTRY
-TAG(VertexAttrib3fvARB)(GLuint index, const GLfloat * v)
-{
- GET_CURRENT_CONTEXT(ctx);
- if (index == 0)
- ATTR3FV(0, v);
- else if (index < MAX_VERTEX_GENERIC_ATTRIBS)
- ATTR3FV(VBO_ATTRIB_GENERIC0 + index, v);
- else
- ERROR(GL_INVALID_VALUE);
-}
-
-static void GLAPIENTRY
-TAG(VertexAttrib4fARB)(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
-{
- GET_CURRENT_CONTEXT(ctx);
- if (index == 0)
- ATTR4F(0, x, y, z, w);
- else if (index < MAX_VERTEX_GENERIC_ATTRIBS)
- ATTR4F(VBO_ATTRIB_GENERIC0 + index, x, y, z, w);
- else
- ERROR(GL_INVALID_VALUE);
-}
-
-static void GLAPIENTRY
-TAG(VertexAttrib4fvARB)(GLuint index, const GLfloat * v)
-{
- GET_CURRENT_CONTEXT(ctx);
- if (index == 0)
- ATTR4FV(0, v);
- else if (index < MAX_VERTEX_GENERIC_ATTRIBS)
- ATTR4FV(VBO_ATTRIB_GENERIC0 + index, v);
- else
- ERROR(GL_INVALID_VALUE);
-}
-
-
-
-/* Integer-valued generic attributes.
- * XXX: the integers just get converted to floats at this time
- */
-static void GLAPIENTRY
-TAG(VertexAttribI1i)(GLuint index, GLint x)
-{
- GET_CURRENT_CONTEXT(ctx);
- if (index == 0)
- ATTR1I(0, x);
- else if (index < MAX_VERTEX_GENERIC_ATTRIBS)
- ATTR1I(VBO_ATTRIB_GENERIC0 + index, x);
- else
- ERROR(GL_INVALID_VALUE);
-}
-
-static void GLAPIENTRY
-TAG(VertexAttribI2i)(GLuint index, GLint x, GLint y)
-{
- GET_CURRENT_CONTEXT(ctx);
- if (index == 0)
- ATTR2I(0, x, y);
- else if (index < MAX_VERTEX_GENERIC_ATTRIBS)
- ATTR2I(VBO_ATTRIB_GENERIC0 + index, x, y);
- else
- ERROR(GL_INVALID_VALUE);
-}
-
-static void GLAPIENTRY
-TAG(VertexAttribI3i)(GLuint index, GLint x, GLint y, GLint z)
-{
- GET_CURRENT_CONTEXT(ctx);
- if (index == 0)
- ATTR3I(0, x, y, z);
- else if (index < MAX_VERTEX_GENERIC_ATTRIBS)
- ATTR3I(VBO_ATTRIB_GENERIC0 + index, x, y, z);
- else
- ERROR(GL_INVALID_VALUE);
-}
-
-static void GLAPIENTRY
-TAG(VertexAttribI4i)(GLuint index, GLint x, GLint y, GLint z, GLint w)
-{
- GET_CURRENT_CONTEXT(ctx);
- if (index == 0)
- ATTR4I(0, x, y, z, w);
- else if (index < MAX_VERTEX_GENERIC_ATTRIBS)
- ATTR4I(VBO_ATTRIB_GENERIC0 + index, x, y, z, w);
- else
- ERROR(GL_INVALID_VALUE);
-}
-
-static void GLAPIENTRY
-TAG(VertexAttribI2iv)(GLuint index, const GLint *v)
-{
- GET_CURRENT_CONTEXT(ctx);
- if (index == 0)
- ATTR2IV(0, v);
- else if (index < MAX_VERTEX_GENERIC_ATTRIBS)
- ATTR2IV(VBO_ATTRIB_GENERIC0 + index, v);
- else
- ERROR(GL_INVALID_VALUE);
-}
-
-static void GLAPIENTRY
-TAG(VertexAttribI3iv)(GLuint index, const GLint *v)
-{
- GET_CURRENT_CONTEXT(ctx);
- if (index == 0)
- ATTR3IV(0, v);
- else if (index < MAX_VERTEX_GENERIC_ATTRIBS)
- ATTR3IV(VBO_ATTRIB_GENERIC0 + index, v);
- else
- ERROR(GL_INVALID_VALUE);
-}
-
-static void GLAPIENTRY
-TAG(VertexAttribI4iv)(GLuint index, const GLint *v)
-{
- GET_CURRENT_CONTEXT(ctx);
- if (index == 0)
- ATTR4IV(0, v);
- else if (index < MAX_VERTEX_GENERIC_ATTRIBS)
- ATTR4IV(VBO_ATTRIB_GENERIC0 + index, v);
- else
- ERROR(GL_INVALID_VALUE);
-}
-
-
-
-/* Unsigned integer-valued generic attributes.
- * XXX: the integers just get converted to floats at this time
- */
-static void GLAPIENTRY
-TAG(VertexAttribI1ui)(GLuint index, GLuint x)
-{
- GET_CURRENT_CONTEXT(ctx);
- if (index == 0)
- ATTR1UI(0, x);
- else if (index < MAX_VERTEX_GENERIC_ATTRIBS)
- ATTR1UI(VBO_ATTRIB_GENERIC0 + index, x);
- else
- ERROR(GL_INVALID_VALUE);
-}
-
-static void GLAPIENTRY
-TAG(VertexAttribI2ui)(GLuint index, GLuint x, GLuint y)
-{
- GET_CURRENT_CONTEXT(ctx);
- if (index == 0)
- ATTR2UI(0, x, y);
- else if (index < MAX_VERTEX_GENERIC_ATTRIBS)
- ATTR2UI(VBO_ATTRIB_GENERIC0 + index, x, y);
- else
- ERROR(GL_INVALID_VALUE);
-}
-
-static void GLAPIENTRY
-TAG(VertexAttribI3ui)(GLuint index, GLuint x, GLuint y, GLuint z)
-{
- GET_CURRENT_CONTEXT(ctx);
- if (index == 0)
- ATTR3UI(0, x, y, z);
- else if (index < MAX_VERTEX_GENERIC_ATTRIBS)
- ATTR3UI(VBO_ATTRIB_GENERIC0 + index, x, y, z);
- else
- ERROR(GL_INVALID_VALUE);
-}
-
-static void GLAPIENTRY
-TAG(VertexAttribI4ui)(GLuint index, GLuint x, GLuint y, GLuint z, GLuint w)
-{
- GET_CURRENT_CONTEXT(ctx);
- if (index == 0)
- ATTR4UI(0, x, y, z, w);
- else if (index < MAX_VERTEX_GENERIC_ATTRIBS)
- ATTR4UI(VBO_ATTRIB_GENERIC0 + index, x, y, z, w);
- else
- ERROR(GL_INVALID_VALUE);
-}
-
-static void GLAPIENTRY
-TAG(VertexAttribI2uiv)(GLuint index, const GLuint *v)
-{
- GET_CURRENT_CONTEXT(ctx);
- if (index == 0)
- ATTR2UIV(0, v);
- else if (index < MAX_VERTEX_GENERIC_ATTRIBS)
- ATTR2UIV(VBO_ATTRIB_GENERIC0 + index, v);
- else
- ERROR(GL_INVALID_VALUE);
-}
-
-static void GLAPIENTRY
-TAG(VertexAttribI3uiv)(GLuint index, const GLuint *v)
-{
- GET_CURRENT_CONTEXT(ctx);
- if (index == 0)
- ATTR3UIV(0, v);
- else if (index < MAX_VERTEX_GENERIC_ATTRIBS)
- ATTR3UIV(VBO_ATTRIB_GENERIC0 + index, v);
- else
- ERROR(GL_INVALID_VALUE);
-}
-
-static void GLAPIENTRY
-TAG(VertexAttribI4uiv)(GLuint index, const GLuint *v)
-{
- GET_CURRENT_CONTEXT(ctx);
- if (index == 0)
- ATTR4UIV(0, v);
- else if (index < MAX_VERTEX_GENERIC_ATTRIBS)
- ATTR4UIV(VBO_ATTRIB_GENERIC0 + index, v);
- else
- ERROR(GL_INVALID_VALUE);
-}
-
-
-
-/* In addition to supporting NV_vertex_program, these entrypoints are
- * used by the display list and other code specifically because of
- * their property of aliasing with other attributes. (See
- * vbo_save_loopback.c)
- */
-static void GLAPIENTRY
-TAG(VertexAttrib1fNV)(GLuint index, GLfloat x)
-{
- GET_CURRENT_CONTEXT(ctx);
- if (index < VBO_ATTRIB_MAX)
- ATTR1F(index, x);
-}
-
-static void GLAPIENTRY
-TAG(VertexAttrib1fvNV)(GLuint index, const GLfloat * v)
-{
- GET_CURRENT_CONTEXT(ctx);
- if (index < VBO_ATTRIB_MAX)
- ATTR1FV(index, v);
-}
-
-static void GLAPIENTRY
-TAG(VertexAttrib2fNV)(GLuint index, GLfloat x, GLfloat y)
-{
- GET_CURRENT_CONTEXT(ctx);
- if (index < VBO_ATTRIB_MAX)
- ATTR2F(index, x, y);
-}
-
-static void GLAPIENTRY
-TAG(VertexAttrib2fvNV)(GLuint index, const GLfloat * v)
-{
- GET_CURRENT_CONTEXT(ctx);
- if (index < VBO_ATTRIB_MAX)
- ATTR2FV(index, v);
-}
-
-static void GLAPIENTRY
-TAG(VertexAttrib3fNV)(GLuint index, GLfloat x, GLfloat y, GLfloat z)
-{
- GET_CURRENT_CONTEXT(ctx);
- if (index < VBO_ATTRIB_MAX)
- ATTR3F(index, x, y, z);
-}
-
-static void GLAPIENTRY
-TAG(VertexAttrib3fvNV)(GLuint index,
- const GLfloat * v)
-{
- GET_CURRENT_CONTEXT(ctx);
- if (index < VBO_ATTRIB_MAX)
- ATTR3FV(index, v);
-}
-
-static void GLAPIENTRY
-TAG(VertexAttrib4fNV)(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
-{
- GET_CURRENT_CONTEXT(ctx);
- if (index < VBO_ATTRIB_MAX)
- ATTR4F(index, x, y, z, w);
-}
-
-static void GLAPIENTRY
-TAG(VertexAttrib4fvNV)(GLuint index, const GLfloat * v)
-{
- GET_CURRENT_CONTEXT(ctx);
- if (index < VBO_ATTRIB_MAX)
- ATTR4FV(index, v);
-}
-
-
-
-#define MAT( ATTR, N, face, params ) \
-do { \
- if (face != GL_BACK) \
- MAT_ATTR( ATTR, N, params ); /* front */ \
- if (face != GL_FRONT) \
- MAT_ATTR( ATTR + 1, N, params ); /* back */ \
-} while (0)
-
-
-/* Colormaterial conflicts are dealt with later.
- */
-static void GLAPIENTRY
-TAG(Materialfv)(GLenum face, GLenum pname,
- const GLfloat * params)
-{
- GET_CURRENT_CONTEXT(ctx);
- switch (pname) {
- case GL_EMISSION:
- MAT(VBO_ATTRIB_MAT_FRONT_EMISSION, 4, face, params);
- break;
- case GL_AMBIENT:
- MAT(VBO_ATTRIB_MAT_FRONT_AMBIENT, 4, face, params);
- break;
- case GL_DIFFUSE:
- MAT(VBO_ATTRIB_MAT_FRONT_DIFFUSE, 4, face, params);
- break;
- case GL_SPECULAR:
- MAT(VBO_ATTRIB_MAT_FRONT_SPECULAR, 4, face, params);
- break;
- case GL_SHININESS:
- MAT(VBO_ATTRIB_MAT_FRONT_SHININESS, 1, face, params);
- break;
- case GL_COLOR_INDEXES:
- MAT(VBO_ATTRIB_MAT_FRONT_INDEXES, 3, face, params);
- break;
- case GL_AMBIENT_AND_DIFFUSE:
- MAT(VBO_ATTRIB_MAT_FRONT_AMBIENT, 4, face, params);
- MAT(VBO_ATTRIB_MAT_FRONT_DIFFUSE, 4, face, params);
- break;
- default:
- ERROR(GL_INVALID_ENUM);
- return;
- }
-}
-
-
-#undef ATTR1FV
-#undef ATTR2FV
-#undef ATTR3FV
-#undef ATTR4FV
-
-#undef ATTR1F
-#undef ATTR2F
-#undef ATTR3F
-#undef ATTR4F
-
-#undef MAT
-#undef MAT_ATTR
+/**************************************************************************
+
+Copyright 2002 Tungsten Graphics Inc., Cedar Park, Texas.
+
+All Rights Reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the "Software"),
+to deal in the Software without restriction, including without limitation
+on the rights to use, copy, modify, merge, publish, distribute, sub
+license, and/or sell copies of the Software, and to permit persons to whom
+the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice (including the next
+paragraph) shall be included in all copies or substantial portions of the
+Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
+TUNGSTEN GRAPHICS AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
+DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+**************************************************************************/
+
+/* float */
+#define ATTR1FV( A, V ) ATTR( A, 1, (V)[0], 0, 0, 1 )
+#define ATTR2FV( A, V ) ATTR( A, 2, (V)[0], (V)[1], 0, 1 )
+#define ATTR3FV( A, V ) ATTR( A, 3, (V)[0], (V)[1], (V)[2], 1 )
+#define ATTR4FV( A, V ) ATTR( A, 4, (V)[0], (V)[1], (V)[2], (V)[3] )
+
+#define ATTR1F( A, X ) ATTR( A, 1, X, 0, 0, 1 )
+#define ATTR2F( A, X, Y ) ATTR( A, 2, X, Y, 0, 1 )
+#define ATTR3F( A, X, Y, Z ) ATTR( A, 3, X, Y, Z, 1 )
+#define ATTR4F( A, X, Y, Z, W ) ATTR( A, 4, X, Y, Z, W )
+
+/* int */
+#define ATTR2IV( A, V ) ATTR( A, 2, (V)[0], (V)[1], 0, 1 )
+#define ATTR3IV( A, V ) ATTR( A, 3, (V)[0], (V)[1], (V)[2], 1 )
+#define ATTR4IV( A, V ) ATTR( A, 4, (V)[0], (V)[1], (V)[2], (V)[3] )
+
+#define ATTR1I( A, X ) ATTR( A, 1, X, 0, 0, 1 )
+#define ATTR2I( A, X, Y ) ATTR( A, 2, X, Y, 0, 1 )
+#define ATTR3I( A, X, Y, Z ) ATTR( A, 3, X, Y, Z, 1 )
+#define ATTR4I( A, X, Y, Z, W ) ATTR( A, 4, X, Y, Z, W )
+
+
+/* uint */
+#define ATTR2UIV( A, V ) ATTR( A, 2, (V)[0], (V)[1], 0, 1 )
+#define ATTR3UIV( A, V ) ATTR( A, 3, (V)[0], (V)[1], (V)[2], 1 )
+#define ATTR4UIV( A, V ) ATTR( A, 4, (V)[0], (V)[1], (V)[2], (V)[3] )
+
+#define ATTR1UI( A, X ) ATTR( A, 1, X, 0, 0, 1 )
+#define ATTR2UI( A, X, Y ) ATTR( A, 2, X, Y, 0, 1 )
+#define ATTR3UI( A, X, Y, Z ) ATTR( A, 3, X, Y, Z, 1 )
+#define ATTR4UI( A, X, Y, Z, W ) ATTR( A, 4, X, Y, Z, W )
+
+#define MAT_ATTR( A, N, V ) ATTR( A, N, (V)[0], (V)[1], (V)[2], (V)[3] )
+
+
+
+static void GLAPIENTRY
+TAG(Vertex2f)(GLfloat x, GLfloat y)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ ATTR2F(VBO_ATTRIB_POS, x, y);
+}
+
+static void GLAPIENTRY
+TAG(Vertex2fv)(const GLfloat * v)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ ATTR2FV(VBO_ATTRIB_POS, v);
+}
+
+static void GLAPIENTRY
+TAG(Vertex3f)(GLfloat x, GLfloat y, GLfloat z)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ ATTR3F(VBO_ATTRIB_POS, x, y, z);
+}
+
+static void GLAPIENTRY
+TAG(Vertex3fv)(const GLfloat * v)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ ATTR3FV(VBO_ATTRIB_POS, v);
+}
+
+static void GLAPIENTRY
+TAG(Vertex4f)(GLfloat x, GLfloat y, GLfloat z, GLfloat w)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ ATTR4F(VBO_ATTRIB_POS, x, y, z, w);
+}
+
+static void GLAPIENTRY
+TAG(Vertex4fv)(const GLfloat * v)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ ATTR4FV(VBO_ATTRIB_POS, v);
+}
+
+
+
+static void GLAPIENTRY
+TAG(TexCoord1f)(GLfloat x)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ ATTR1F(VBO_ATTRIB_TEX0, x);
+}
+
+static void GLAPIENTRY
+TAG(TexCoord1fv)(const GLfloat * v)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ ATTR1FV(VBO_ATTRIB_TEX0, v);
+}
+
+static void GLAPIENTRY
+TAG(TexCoord2f)(GLfloat x, GLfloat y)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ ATTR2F(VBO_ATTRIB_TEX0, x, y);
+}
+
+static void GLAPIENTRY
+TAG(TexCoord2fv)(const GLfloat * v)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ ATTR2FV(VBO_ATTRIB_TEX0, v);
+}
+
+static void GLAPIENTRY
+TAG(TexCoord3f)(GLfloat x, GLfloat y, GLfloat z)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ ATTR3F(VBO_ATTRIB_TEX0, x, y, z);
+}
+
+static void GLAPIENTRY
+TAG(TexCoord3fv)(const GLfloat * v)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ ATTR3FV(VBO_ATTRIB_TEX0, v);
+}
+
+static void GLAPIENTRY
+TAG(TexCoord4f)(GLfloat x, GLfloat y, GLfloat z, GLfloat w)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ ATTR4F(VBO_ATTRIB_TEX0, x, y, z, w);
+}
+
+static void GLAPIENTRY
+TAG(TexCoord4fv)(const GLfloat * v)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ ATTR4FV(VBO_ATTRIB_TEX0, v);
+}
+
+
+
+static void GLAPIENTRY
+TAG(Normal3f)(GLfloat x, GLfloat y, GLfloat z)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ ATTR3F(VBO_ATTRIB_NORMAL, x, y, z);
+}
+
+static void GLAPIENTRY
+TAG(Normal3fv)(const GLfloat * v)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ ATTR3FV(VBO_ATTRIB_NORMAL, v);
+}
+
+
+
+static void GLAPIENTRY
+TAG(FogCoordfEXT)(GLfloat x)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ ATTR1F(VBO_ATTRIB_FOG, x);
+}
+
+
+
+static void GLAPIENTRY
+TAG(FogCoordfvEXT)(const GLfloat * v)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ ATTR1FV(VBO_ATTRIB_FOG, v);
+}
+
+static void GLAPIENTRY
+TAG(Color3f)(GLfloat x, GLfloat y, GLfloat z)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ ATTR3F(VBO_ATTRIB_COLOR0, x, y, z);
+}
+
+static void GLAPIENTRY
+TAG(Color3fv)(const GLfloat * v)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ ATTR3FV(VBO_ATTRIB_COLOR0, v);
+}
+
+static void GLAPIENTRY
+TAG(Color4f)(GLfloat x, GLfloat y, GLfloat z, GLfloat w)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ ATTR4F(VBO_ATTRIB_COLOR0, x, y, z, w);
+}
+
+static void GLAPIENTRY
+TAG(Color4fv)(const GLfloat * v)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ ATTR4FV(VBO_ATTRIB_COLOR0, v);
+}
+
+
+
+static void GLAPIENTRY
+TAG(SecondaryColor3fEXT)(GLfloat x, GLfloat y, GLfloat z)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ ATTR3F(VBO_ATTRIB_COLOR1, x, y, z);
+}
+
+static void GLAPIENTRY
+TAG(SecondaryColor3fvEXT)(const GLfloat * v)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ ATTR3FV(VBO_ATTRIB_COLOR1, v);
+}
+
+
+
+static void GLAPIENTRY
+TAG(EdgeFlag)(GLboolean b)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ ATTR1F(VBO_ATTRIB_EDGEFLAG, (GLfloat) b);
+}
+
+
+
+static void GLAPIENTRY
+TAG(Indexf)(GLfloat f)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ ATTR1F(VBO_ATTRIB_INDEX, f);
+}
+
+static void GLAPIENTRY
+TAG(Indexfv)(const GLfloat * f)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ ATTR1FV(VBO_ATTRIB_INDEX, f);
+}
+
+
+
+static void GLAPIENTRY
+TAG(MultiTexCoord1f)(GLenum target, GLfloat x)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ GLuint attr = (target & 0x7) + VBO_ATTRIB_TEX0;
+ ATTR1F(attr, x);
+}
+
+static void GLAPIENTRY
+TAG(MultiTexCoord1fv)(GLenum target, const GLfloat * v)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ GLuint attr = (target & 0x7) + VBO_ATTRIB_TEX0;
+ ATTR1FV(attr, v);
+}
+
+static void GLAPIENTRY
+TAG(MultiTexCoord2f)(GLenum target, GLfloat x, GLfloat y)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ GLuint attr = (target & 0x7) + VBO_ATTRIB_TEX0;
+ ATTR2F(attr, x, y);
+}
+
+static void GLAPIENTRY
+TAG(MultiTexCoord2fv)(GLenum target, const GLfloat * v)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ GLuint attr = (target & 0x7) + VBO_ATTRIB_TEX0;
+ ATTR2FV(attr, v);
+}
+
+static void GLAPIENTRY
+TAG(MultiTexCoord3f)(GLenum target, GLfloat x, GLfloat y, GLfloat z)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ GLuint attr = (target & 0x7) + VBO_ATTRIB_TEX0;
+ ATTR3F(attr, x, y, z);
+}
+
+static void GLAPIENTRY
+TAG(MultiTexCoord3fv)(GLenum target, const GLfloat * v)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ GLuint attr = (target & 0x7) + VBO_ATTRIB_TEX0;
+ ATTR3FV(attr, v);
+}
+
+static void GLAPIENTRY
+TAG(MultiTexCoord4f)(GLenum target, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ GLuint attr = (target & 0x7) + VBO_ATTRIB_TEX0;
+ ATTR4F(attr, x, y, z, w);
+}
+
+static void GLAPIENTRY
+TAG(MultiTexCoord4fv)(GLenum target, const GLfloat * v)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ GLuint attr = (target & 0x7) + VBO_ATTRIB_TEX0;
+ ATTR4FV(attr, v);
+}
+
+
+
+static void GLAPIENTRY
+TAG(VertexAttrib1fARB)(GLuint index, GLfloat x)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ if (index == 0)
+ ATTR1F(0, x);
+ else if (index < MAX_VERTEX_GENERIC_ATTRIBS)
+ ATTR1F(VBO_ATTRIB_GENERIC0 + index, x);
+ else
+ ERROR(GL_INVALID_VALUE);
+}
+
+static void GLAPIENTRY
+TAG(VertexAttrib1fvARB)(GLuint index, const GLfloat * v)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ if (index == 0)
+ ATTR1FV(0, v);
+ else if (index < MAX_VERTEX_GENERIC_ATTRIBS)
+ ATTR1FV(VBO_ATTRIB_GENERIC0 + index, v);
+ else
+ ERROR(GL_INVALID_VALUE);
+}
+
+static void GLAPIENTRY
+TAG(VertexAttrib2fARB)(GLuint index, GLfloat x, GLfloat y)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ if (index == 0)
+ ATTR2F(0, x, y);
+ else if (index < MAX_VERTEX_GENERIC_ATTRIBS)
+ ATTR2F(VBO_ATTRIB_GENERIC0 + index, x, y);
+ else
+ ERROR(GL_INVALID_VALUE);
+}
+
+static void GLAPIENTRY
+TAG(VertexAttrib2fvARB)(GLuint index, const GLfloat * v)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ if (index == 0)
+ ATTR2FV(0, v);
+ else if (index < MAX_VERTEX_GENERIC_ATTRIBS)
+ ATTR2FV(VBO_ATTRIB_GENERIC0 + index, v);
+ else
+ ERROR(GL_INVALID_VALUE);
+}
+
+static void GLAPIENTRY
+TAG(VertexAttrib3fARB)(GLuint index, GLfloat x, GLfloat y, GLfloat z)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ if (index == 0)
+ ATTR3F(0, x, y, z);
+ else if (index < MAX_VERTEX_GENERIC_ATTRIBS)
+ ATTR3F(VBO_ATTRIB_GENERIC0 + index, x, y, z);
+ else
+ ERROR(GL_INVALID_VALUE);
+}
+
+static void GLAPIENTRY
+TAG(VertexAttrib3fvARB)(GLuint index, const GLfloat * v)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ if (index == 0)
+ ATTR3FV(0, v);
+ else if (index < MAX_VERTEX_GENERIC_ATTRIBS)
+ ATTR3FV(VBO_ATTRIB_GENERIC0 + index, v);
+ else
+ ERROR(GL_INVALID_VALUE);
+}
+
+static void GLAPIENTRY
+TAG(VertexAttrib4fARB)(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ if (index == 0)
+ ATTR4F(0, x, y, z, w);
+ else if (index < MAX_VERTEX_GENERIC_ATTRIBS)
+ ATTR4F(VBO_ATTRIB_GENERIC0 + index, x, y, z, w);
+ else
+ ERROR(GL_INVALID_VALUE);
+}
+
+static void GLAPIENTRY
+TAG(VertexAttrib4fvARB)(GLuint index, const GLfloat * v)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ if (index == 0)
+ ATTR4FV(0, v);
+ else if (index < MAX_VERTEX_GENERIC_ATTRIBS)
+ ATTR4FV(VBO_ATTRIB_GENERIC0 + index, v);
+ else
+ ERROR(GL_INVALID_VALUE);
+}
+
+
+
+/* Integer-valued generic attributes.
+ * XXX: the integers just get converted to floats at this time
+ */
+static void GLAPIENTRY
+TAG(VertexAttribI1i)(GLuint index, GLint x)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ if (index == 0)
+ ATTR1I(0, x);
+ else if (index < MAX_VERTEX_GENERIC_ATTRIBS)
+ ATTR1I(VBO_ATTRIB_GENERIC0 + index, x);
+ else
+ ERROR(GL_INVALID_VALUE);
+}
+
+static void GLAPIENTRY
+TAG(VertexAttribI2i)(GLuint index, GLint x, GLint y)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ if (index == 0)
+ ATTR2I(0, x, y);
+ else if (index < MAX_VERTEX_GENERIC_ATTRIBS)
+ ATTR2I(VBO_ATTRIB_GENERIC0 + index, x, y);
+ else
+ ERROR(GL_INVALID_VALUE);
+}
+
+static void GLAPIENTRY
+TAG(VertexAttribI3i)(GLuint index, GLint x, GLint y, GLint z)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ if (index == 0)
+ ATTR3I(0, x, y, z);
+ else if (index < MAX_VERTEX_GENERIC_ATTRIBS)
+ ATTR3I(VBO_ATTRIB_GENERIC0 + index, x, y, z);
+ else
+ ERROR(GL_INVALID_VALUE);
+}
+
+static void GLAPIENTRY
+TAG(VertexAttribI4i)(GLuint index, GLint x, GLint y, GLint z, GLint w)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ if (index == 0)
+ ATTR4I(0, x, y, z, w);
+ else if (index < MAX_VERTEX_GENERIC_ATTRIBS)
+ ATTR4I(VBO_ATTRIB_GENERIC0 + index, x, y, z, w);
+ else
+ ERROR(GL_INVALID_VALUE);
+}
+
+static void GLAPIENTRY
+TAG(VertexAttribI2iv)(GLuint index, const GLint *v)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ if (index == 0)
+ ATTR2IV(0, v);
+ else if (index < MAX_VERTEX_GENERIC_ATTRIBS)
+ ATTR2IV(VBO_ATTRIB_GENERIC0 + index, v);
+ else
+ ERROR(GL_INVALID_VALUE);
+}
+
+static void GLAPIENTRY
+TAG(VertexAttribI3iv)(GLuint index, const GLint *v)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ if (index == 0)
+ ATTR3IV(0, v);
+ else if (index < MAX_VERTEX_GENERIC_ATTRIBS)
+ ATTR3IV(VBO_ATTRIB_GENERIC0 + index, v);
+ else
+ ERROR(GL_INVALID_VALUE);
+}
+
+static void GLAPIENTRY
+TAG(VertexAttribI4iv)(GLuint index, const GLint *v)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ if (index == 0)
+ ATTR4IV(0, v);
+ else if (index < MAX_VERTEX_GENERIC_ATTRIBS)
+ ATTR4IV(VBO_ATTRIB_GENERIC0 + index, v);
+ else
+ ERROR(GL_INVALID_VALUE);
+}
+
+
+
+/* Unsigned integer-valued generic attributes.
+ * XXX: the integers just get converted to floats at this time
+ */
+static void GLAPIENTRY
+TAG(VertexAttribI1ui)(GLuint index, GLuint x)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ if (index == 0)
+ ATTR1UI(0, x);
+ else if (index < MAX_VERTEX_GENERIC_ATTRIBS)
+ ATTR1UI(VBO_ATTRIB_GENERIC0 + index, x);
+ else
+ ERROR(GL_INVALID_VALUE);
+}
+
+static void GLAPIENTRY
+TAG(VertexAttribI2ui)(GLuint index, GLuint x, GLuint y)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ if (index == 0)
+ ATTR2UI(0, x, y);
+ else if (index < MAX_VERTEX_GENERIC_ATTRIBS)
+ ATTR2UI(VBO_ATTRIB_GENERIC0 + index, x, y);
+ else
+ ERROR(GL_INVALID_VALUE);
+}
+
+static void GLAPIENTRY
+TAG(VertexAttribI3ui)(GLuint index, GLuint x, GLuint y, GLuint z)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ if (index == 0)
+ ATTR3UI(0, x, y, z);
+ else if (index < MAX_VERTEX_GENERIC_ATTRIBS)
+ ATTR3UI(VBO_ATTRIB_GENERIC0 + index, x, y, z);
+ else
+ ERROR(GL_INVALID_VALUE);
+}
+
+static void GLAPIENTRY
+TAG(VertexAttribI4ui)(GLuint index, GLuint x, GLuint y, GLuint z, GLuint w)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ if (index == 0)
+ ATTR4UI(0, x, y, z, w);
+ else if (index < MAX_VERTEX_GENERIC_ATTRIBS)
+ ATTR4UI(VBO_ATTRIB_GENERIC0 + index, x, y, z, w);
+ else
+ ERROR(GL_INVALID_VALUE);
+}
+
+static void GLAPIENTRY
+TAG(VertexAttribI2uiv)(GLuint index, const GLuint *v)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ if (index == 0)
+ ATTR2UIV(0, v);
+ else if (index < MAX_VERTEX_GENERIC_ATTRIBS)
+ ATTR2UIV(VBO_ATTRIB_GENERIC0 + index, v);
+ else
+ ERROR(GL_INVALID_VALUE);
+}
+
+static void GLAPIENTRY
+TAG(VertexAttribI3uiv)(GLuint index, const GLuint *v)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ if (index == 0)
+ ATTR3UIV(0, v);
+ else if (index < MAX_VERTEX_GENERIC_ATTRIBS)
+ ATTR3UIV(VBO_ATTRIB_GENERIC0 + index, v);
+ else
+ ERROR(GL_INVALID_VALUE);
+}
+
+static void GLAPIENTRY
+TAG(VertexAttribI4uiv)(GLuint index, const GLuint *v)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ if (index == 0)
+ ATTR4UIV(0, v);
+ else if (index < MAX_VERTEX_GENERIC_ATTRIBS)
+ ATTR4UIV(VBO_ATTRIB_GENERIC0 + index, v);
+ else
+ ERROR(GL_INVALID_VALUE);
+}
+
+
+
+/* In addition to supporting NV_vertex_program, these entrypoints are
+ * used by the display list and other code specifically because of
+ * their property of aliasing with other attributes. (See
+ * vbo_save_loopback.c)
+ */
+static void GLAPIENTRY
+TAG(VertexAttrib1fNV)(GLuint index, GLfloat x)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ if (index < VBO_ATTRIB_MAX)
+ ATTR1F(index, x);
+}
+
+static void GLAPIENTRY
+TAG(VertexAttrib1fvNV)(GLuint index, const GLfloat * v)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ if (index < VBO_ATTRIB_MAX)
+ ATTR1FV(index, v);
+}
+
+static void GLAPIENTRY
+TAG(VertexAttrib2fNV)(GLuint index, GLfloat x, GLfloat y)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ if (index < VBO_ATTRIB_MAX)
+ ATTR2F(index, x, y);
+}
+
+static void GLAPIENTRY
+TAG(VertexAttrib2fvNV)(GLuint index, const GLfloat * v)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ if (index < VBO_ATTRIB_MAX)
+ ATTR2FV(index, v);
+}
+
+static void GLAPIENTRY
+TAG(VertexAttrib3fNV)(GLuint index, GLfloat x, GLfloat y, GLfloat z)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ if (index < VBO_ATTRIB_MAX)
+ ATTR3F(index, x, y, z);
+}
+
+static void GLAPIENTRY
+TAG(VertexAttrib3fvNV)(GLuint index,
+ const GLfloat * v)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ if (index < VBO_ATTRIB_MAX)
+ ATTR3FV(index, v);
+}
+
+static void GLAPIENTRY
+TAG(VertexAttrib4fNV)(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ if (index < VBO_ATTRIB_MAX)
+ ATTR4F(index, x, y, z, w);
+}
+
+static void GLAPIENTRY
+TAG(VertexAttrib4fvNV)(GLuint index, const GLfloat * v)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ if (index < VBO_ATTRIB_MAX)
+ ATTR4FV(index, v);
+}
+
+
+
+#define MAT( ATTR, N, face, params ) \
+do { \
+ if (face != GL_BACK) \
+ MAT_ATTR( ATTR, N, params ); /* front */ \
+ if (face != GL_FRONT) \
+ MAT_ATTR( ATTR + 1, N, params ); /* back */ \
+} while (0)
+
+
+/* Colormaterial conflicts are dealt with later.
+ */
+static void GLAPIENTRY
+TAG(Materialfv)(GLenum face, GLenum pname,
+ const GLfloat * params)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ switch (pname) {
+ case GL_EMISSION:
+ MAT(VBO_ATTRIB_MAT_FRONT_EMISSION, 4, face, params);
+ break;
+ case GL_AMBIENT:
+ MAT(VBO_ATTRIB_MAT_FRONT_AMBIENT, 4, face, params);
+ break;
+ case GL_DIFFUSE:
+ MAT(VBO_ATTRIB_MAT_FRONT_DIFFUSE, 4, face, params);
+ break;
+ case GL_SPECULAR:
+ MAT(VBO_ATTRIB_MAT_FRONT_SPECULAR, 4, face, params);
+ break;
+ case GL_SHININESS:
+ MAT(VBO_ATTRIB_MAT_FRONT_SHININESS, 1, face, params);
+ break;
+ case GL_COLOR_INDEXES:
+ MAT(VBO_ATTRIB_MAT_FRONT_INDEXES, 3, face, params);
+ break;
+ case GL_AMBIENT_AND_DIFFUSE:
+ MAT(VBO_ATTRIB_MAT_FRONT_AMBIENT, 4, face, params);
+ MAT(VBO_ATTRIB_MAT_FRONT_DIFFUSE, 4, face, params);
+ break;
+ default:
+ ERROR(GL_INVALID_ENUM);
+ return;
+ }
+}
+
+
+#undef ATTR1FV
+#undef ATTR2FV
+#undef ATTR3FV
+#undef ATTR4FV
+
+#undef ATTR1F
+#undef ATTR2F
+#undef ATTR3F
+#undef ATTR4F
+
+#undef MAT
+#undef MAT_ATTR
diff --git a/mesalib/src/mesa/vbo/vbo_exec.h b/mesalib/src/mesa/vbo/vbo_exec.h
index d52a557e0..c8e509285 100644
--- a/mesalib/src/mesa/vbo/vbo_exec.h
+++ b/mesalib/src/mesa/vbo/vbo_exec.h
@@ -1,204 +1,204 @@
-/**************************************************************************
-
-Copyright 2002 Tungsten Graphics Inc., Cedar Park, Texas.
-
-All Rights Reserved.
-
-Permission is hereby granted, free of charge, to any person obtaining a
-copy of this software and associated documentation files (the "Software"),
-to deal in the Software without restriction, including without limitation
-on the rights to use, copy, modify, merge, publish, distribute, sub
-license, and/or sell copies of the Software, and to permit persons to whom
-the Software is furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice (including the next
-paragraph) shall be included in all copies or substantial portions of the
-Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
-TUNGSTEN GRAPHICS AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
-DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
-OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
-USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-**************************************************************************/
-
-/*
- * Authors:
- * Keith Whitwell <keith@tungstengraphics.com>
- *
- */
-
-#ifndef __VBO_EXEC_H__
-#define __VBO_EXEC_H__
-
-#include "main/mfeatures.h"
-#include "main/mtypes.h"
-#include "vbo.h"
-#include "vbo_attrib.h"
-
-
-/**
- * Max number of primitives (number of glBegin/End pairs) per VBO.
- */
-#define VBO_MAX_PRIM 64
-
-
-/**
- * Size of the VBO to use for glBegin/glVertex/glEnd-style rendering.
- */
-#define VBO_VERT_BUFFER_SIZE (1024*64) /* bytes */
-
-
-/** Current vertex program mode */
-enum vp_mode {
- VP_NONE, /**< fixed function */
- VP_NV, /**< NV vertex program */
- VP_ARB /**< ARB vertex program or GLSL vertex shader */
-};
-
-
-struct vbo_exec_eval1_map {
- struct gl_1d_map *map;
- GLuint sz;
-};
-
-struct vbo_exec_eval2_map {
- struct gl_2d_map *map;
- GLuint sz;
-};
-
-
-
-struct vbo_exec_copied_vtx {
- GLfloat buffer[VBO_ATTRIB_MAX * 4 * VBO_MAX_COPIED_VERTS];
- GLuint nr;
-};
-
-
-typedef void (*vbo_attrfv_func)( const GLfloat * );
-
-
-struct vbo_exec_context
-{
- struct gl_context *ctx;
- GLvertexformat vtxfmt;
-
- struct {
- struct gl_buffer_object *bufferobj;
-
- GLuint vertex_size; /* in dwords */
-
- struct _mesa_prim prim[VBO_MAX_PRIM];
- GLuint prim_count;
-
- GLfloat *buffer_map;
- GLfloat *buffer_ptr; /* cursor, points into buffer */
- GLuint buffer_used; /* in bytes */
- GLfloat vertex[VBO_ATTRIB_MAX*4]; /* current vertex */
-
- GLuint vert_count;
- GLuint max_vert;
- struct vbo_exec_copied_vtx copied;
-
- GLubyte attrsz[VBO_ATTRIB_MAX];
- GLubyte active_sz[VBO_ATTRIB_MAX];
-
- GLfloat *attrptr[VBO_ATTRIB_MAX];
- struct gl_client_array arrays[VERT_ATTRIB_MAX];
-
- /* According to program mode, the values above plus current
- * values are squashed down to the 32 attributes passed to the
- * vertex program below:
- */
- enum vp_mode program_mode;
- GLuint enabled_flags;
- const struct gl_client_array *inputs[VERT_ATTRIB_MAX];
- } vtx;
-
-
- struct {
- GLboolean recalculate_maps;
- struct vbo_exec_eval1_map map1[VERT_ATTRIB_MAX];
- struct vbo_exec_eval2_map map2[VERT_ATTRIB_MAX];
- } eval;
-
- struct {
- enum vp_mode program_mode;
- GLuint enabled_flags;
- GLuint array_obj;
-
- /* These just mirror the current arrayobj (todo: make arrayobj
- * look like this and remove the mirror):
- */
- const struct gl_client_array *legacy_array[16];
- const struct gl_client_array *generic_array[16];
-
- /* Arrays and current values manipulated according to program
- * mode, etc. These are the attributes as seen by vertex
- * programs:
- */
- const struct gl_client_array *inputs[VERT_ATTRIB_MAX];
- } array;
-
- /* Which flags to set in vbo_exec_BeginVertices() */
- GLbitfield begin_vertices_flags;
-
-#ifdef DEBUG
- GLint flush_call_depth;
-#endif
-};
-
-
-
-/* External API:
- */
-void vbo_exec_init( struct gl_context *ctx );
-void vbo_exec_destroy( struct gl_context *ctx );
-void vbo_exec_invalidate_state( struct gl_context *ctx, GLuint new_state );
-
-void vbo_exec_BeginVertices( struct gl_context *ctx );
-void vbo_exec_FlushVertices( struct gl_context *ctx, GLuint flags );
-
-
-/* Internal functions:
- */
-void vbo_exec_array_init( struct vbo_exec_context *exec );
-void vbo_exec_array_destroy( struct vbo_exec_context *exec );
-
-
-void vbo_exec_vtx_init( struct vbo_exec_context *exec );
-void vbo_exec_vtx_destroy( struct vbo_exec_context *exec );
-
-#if FEATURE_beginend
-
-void vbo_exec_vtx_flush( struct vbo_exec_context *exec, GLboolean unmap );
-void vbo_exec_vtx_map( struct vbo_exec_context *exec );
-
-#else /* FEATURE_beginend */
-
-static INLINE void
-vbo_exec_vtx_flush( struct vbo_exec_context *exec, GLboolean unmap )
-{
-}
-
-static INLINE void
-vbo_exec_vtx_map( struct vbo_exec_context *exec )
-{
-}
-
-#endif /* FEATURE_beginend */
-
-void vbo_exec_vtx_wrap( struct vbo_exec_context *exec );
-
-void vbo_exec_eval_update( struct vbo_exec_context *exec );
-
-void vbo_exec_do_EvalCoord2f( struct vbo_exec_context *exec,
- GLfloat u, GLfloat v );
-
-void vbo_exec_do_EvalCoord1f( struct vbo_exec_context *exec,
- GLfloat u);
-
-#endif
+/**************************************************************************
+
+Copyright 2002 Tungsten Graphics Inc., Cedar Park, Texas.
+
+All Rights Reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the "Software"),
+to deal in the Software without restriction, including without limitation
+on the rights to use, copy, modify, merge, publish, distribute, sub
+license, and/or sell copies of the Software, and to permit persons to whom
+the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice (including the next
+paragraph) shall be included in all copies or substantial portions of the
+Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
+TUNGSTEN GRAPHICS AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
+DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+**************************************************************************/
+
+/*
+ * Authors:
+ * Keith Whitwell <keith@tungstengraphics.com>
+ *
+ */
+
+#ifndef __VBO_EXEC_H__
+#define __VBO_EXEC_H__
+
+#include "main/mfeatures.h"
+#include "main/mtypes.h"
+#include "vbo.h"
+#include "vbo_attrib.h"
+
+
+/**
+ * Max number of primitives (number of glBegin/End pairs) per VBO.
+ */
+#define VBO_MAX_PRIM 64
+
+
+/**
+ * Size of the VBO to use for glBegin/glVertex/glEnd-style rendering.
+ */
+#define VBO_VERT_BUFFER_SIZE (1024*64) /* bytes */
+
+
+/** Current vertex program mode */
+enum vp_mode {
+ VP_NONE, /**< fixed function */
+ VP_NV, /**< NV vertex program */
+ VP_ARB /**< ARB vertex program or GLSL vertex shader */
+};
+
+
+struct vbo_exec_eval1_map {
+ struct gl_1d_map *map;
+ GLuint sz;
+};
+
+struct vbo_exec_eval2_map {
+ struct gl_2d_map *map;
+ GLuint sz;
+};
+
+
+
+struct vbo_exec_copied_vtx {
+ GLfloat buffer[VBO_ATTRIB_MAX * 4 * VBO_MAX_COPIED_VERTS];
+ GLuint nr;
+};
+
+
+typedef void (*vbo_attrfv_func)( const GLfloat * );
+
+
+struct vbo_exec_context
+{
+ struct gl_context *ctx;
+ GLvertexformat vtxfmt;
+
+ struct {
+ struct gl_buffer_object *bufferobj;
+
+ GLuint vertex_size; /* in dwords */
+
+ struct _mesa_prim prim[VBO_MAX_PRIM];
+ GLuint prim_count;
+
+ GLfloat *buffer_map;
+ GLfloat *buffer_ptr; /* cursor, points into buffer */
+ GLuint buffer_used; /* in bytes */
+ GLfloat vertex[VBO_ATTRIB_MAX*4]; /* current vertex */
+
+ GLuint vert_count;
+ GLuint max_vert;
+ struct vbo_exec_copied_vtx copied;
+
+ GLubyte attrsz[VBO_ATTRIB_MAX];
+ GLubyte active_sz[VBO_ATTRIB_MAX];
+
+ GLfloat *attrptr[VBO_ATTRIB_MAX];
+ struct gl_client_array arrays[VERT_ATTRIB_MAX];
+
+ /* According to program mode, the values above plus current
+ * values are squashed down to the 32 attributes passed to the
+ * vertex program below:
+ */
+ enum vp_mode program_mode;
+ GLuint enabled_flags;
+ const struct gl_client_array *inputs[VERT_ATTRIB_MAX];
+ } vtx;
+
+
+ struct {
+ GLboolean recalculate_maps;
+ struct vbo_exec_eval1_map map1[VERT_ATTRIB_MAX];
+ struct vbo_exec_eval2_map map2[VERT_ATTRIB_MAX];
+ } eval;
+
+ struct {
+ enum vp_mode program_mode;
+ GLuint enabled_flags;
+ GLuint array_obj;
+
+ /* These just mirror the current arrayobj (todo: make arrayobj
+ * look like this and remove the mirror):
+ */
+ const struct gl_client_array *legacy_array[16];
+ const struct gl_client_array *generic_array[16];
+
+ /* Arrays and current values manipulated according to program
+ * mode, etc. These are the attributes as seen by vertex
+ * programs:
+ */
+ const struct gl_client_array *inputs[VERT_ATTRIB_MAX];
+ } array;
+
+ /* Which flags to set in vbo_exec_BeginVertices() */
+ GLbitfield begin_vertices_flags;
+
+#ifdef DEBUG
+ GLint flush_call_depth;
+#endif
+};
+
+
+
+/* External API:
+ */
+void vbo_exec_init( struct gl_context *ctx );
+void vbo_exec_destroy( struct gl_context *ctx );
+void vbo_exec_invalidate_state( struct gl_context *ctx, GLuint new_state );
+
+void vbo_exec_BeginVertices( struct gl_context *ctx );
+void vbo_exec_FlushVertices( struct gl_context *ctx, GLuint flags );
+
+
+/* Internal functions:
+ */
+void vbo_exec_array_init( struct vbo_exec_context *exec );
+void vbo_exec_array_destroy( struct vbo_exec_context *exec );
+
+
+void vbo_exec_vtx_init( struct vbo_exec_context *exec );
+void vbo_exec_vtx_destroy( struct vbo_exec_context *exec );
+
+#if FEATURE_beginend
+
+void vbo_exec_vtx_flush( struct vbo_exec_context *exec, GLboolean unmap );
+void vbo_exec_vtx_map( struct vbo_exec_context *exec );
+
+#else /* FEATURE_beginend */
+
+static INLINE void
+vbo_exec_vtx_flush( struct vbo_exec_context *exec, GLboolean unmap )
+{
+}
+
+static INLINE void
+vbo_exec_vtx_map( struct vbo_exec_context *exec )
+{
+}
+
+#endif /* FEATURE_beginend */
+
+void vbo_exec_vtx_wrap( struct vbo_exec_context *exec );
+
+void vbo_exec_eval_update( struct vbo_exec_context *exec );
+
+void vbo_exec_do_EvalCoord2f( struct vbo_exec_context *exec,
+ GLfloat u, GLfloat v );
+
+void vbo_exec_do_EvalCoord1f( struct vbo_exec_context *exec,
+ GLfloat u);
+
+#endif
diff --git a/mesalib/src/mesa/vbo/vbo_exec_array.c b/mesalib/src/mesa/vbo/vbo_exec_array.c
index a49cd5017..d06d0cc71 100644
--- a/mesalib/src/mesa/vbo/vbo_exec_array.c
+++ b/mesalib/src/mesa/vbo/vbo_exec_array.c
@@ -1,1337 +1,1337 @@
-/**************************************************************************
- *
- * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas.
- * Copyright 2009 VMware, Inc.
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sub license, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice (including the
- * next paragraph) shall be included in all copies or substantial portions
- * of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
- * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
- * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- **************************************************************************/
-
-#include "main/glheader.h"
-#include "main/context.h"
-#include "main/state.h"
-#include "main/api_validate.h"
-#include "main/varray.h"
-#include "main/bufferobj.h"
-#include "main/enums.h"
-#include "main/macros.h"
-
-#include "vbo_context.h"
-
-
-/**
- * All vertex buffers should be in an unmapped state when we're about
- * to draw. This debug function checks that.
- */
-static void
-check_buffers_are_unmapped(const struct gl_client_array **inputs)
-{
-#ifdef DEBUG
- GLuint i;
-
- for (i = 0; i < VERT_ATTRIB_MAX; i++) {
- if (inputs[i]) {
- struct gl_buffer_object *obj = inputs[i]->BufferObj;
- assert(!_mesa_bufferobj_mapped(obj));
- (void) obj;
- }
- }
-#endif
-}
-
-
-/**
- * A debug function that may be called from other parts of Mesa as
- * needed during debugging.
- */
-void
-vbo_check_buffers_are_unmapped(struct gl_context *ctx)
-{
- struct vbo_context *vbo = vbo_context(ctx);
- struct vbo_exec_context *exec = &vbo->exec;
- /* check the current vertex arrays */
- check_buffers_are_unmapped(exec->array.inputs);
- /* check the current glBegin/glVertex/glEnd-style VBO */
- assert(!_mesa_bufferobj_mapped(exec->vtx.bufferobj));
-}
-
-
-
-/**
- * Compute min and max elements by scanning the index buffer for
- * glDraw[Range]Elements() calls.
- * If primitive restart is enabled, we need to ignore restart
- * indexes when computing min/max.
- */
-void
-vbo_get_minmax_index(struct gl_context *ctx,
- const struct _mesa_prim *prim,
- const struct _mesa_index_buffer *ib,
- GLuint *min_index, GLuint *max_index)
-{
- const GLboolean restart = ctx->Array.PrimitiveRestart;
- const GLuint restartIndex = ctx->Array.RestartIndex;
- const GLuint count = prim->count;
- const void *indices;
- GLuint i;
-
- if (_mesa_is_bufferobj(ib->obj)) {
- const GLvoid *map =
- ctx->Driver.MapBuffer(ctx, GL_ELEMENT_ARRAY_BUFFER_ARB,
- GL_READ_ONLY, ib->obj);
- indices = ADD_POINTERS(map, ib->ptr);
- } else {
- indices = ib->ptr;
- }
-
- switch (ib->type) {
- case GL_UNSIGNED_INT: {
- const GLuint *ui_indices = (const GLuint *)indices;
- GLuint max_ui = 0;
- GLuint min_ui = ~0U;
- if (restart) {
- for (i = 0; i < count; i++) {
- if (ui_indices[i] != restartIndex) {
- if (ui_indices[i] > max_ui) max_ui = ui_indices[i];
- if (ui_indices[i] < min_ui) min_ui = ui_indices[i];
- }
- }
- }
- else {
- for (i = 0; i < count; i++) {
- if (ui_indices[i] > max_ui) max_ui = ui_indices[i];
- if (ui_indices[i] < min_ui) min_ui = ui_indices[i];
- }
- }
- *min_index = min_ui;
- *max_index = max_ui;
- break;
- }
- case GL_UNSIGNED_SHORT: {
- const GLushort *us_indices = (const GLushort *)indices;
- GLuint max_us = 0;
- GLuint min_us = ~0U;
- if (restart) {
- for (i = 0; i < count; i++) {
- if (us_indices[i] != restartIndex) {
- if (us_indices[i] > max_us) max_us = us_indices[i];
- if (us_indices[i] < min_us) min_us = us_indices[i];
- }
- }
- }
- else {
- for (i = 0; i < count; i++) {
- if (us_indices[i] > max_us) max_us = us_indices[i];
- if (us_indices[i] < min_us) min_us = us_indices[i];
- }
- }
- *min_index = min_us;
- *max_index = max_us;
- break;
- }
- case GL_UNSIGNED_BYTE: {
- const GLubyte *ub_indices = (const GLubyte *)indices;
- GLuint max_ub = 0;
- GLuint min_ub = ~0U;
- if (restart) {
- for (i = 0; i < count; i++) {
- if (ub_indices[i] != restartIndex) {
- if (ub_indices[i] > max_ub) max_ub = ub_indices[i];
- if (ub_indices[i] < min_ub) min_ub = ub_indices[i];
- }
- }
- }
- else {
- for (i = 0; i < count; i++) {
- if (ub_indices[i] > max_ub) max_ub = ub_indices[i];
- if (ub_indices[i] < min_ub) min_ub = ub_indices[i];
- }
- }
- *min_index = min_ub;
- *max_index = max_ub;
- break;
- }
- default:
- assert(0);
- break;
- }
-
- if (_mesa_is_bufferobj(ib->obj)) {
- ctx->Driver.UnmapBuffer(ctx, GL_ELEMENT_ARRAY_BUFFER_ARB, ib->obj);
- }
-}
-
-
-/**
- * Check that element 'j' of the array has reasonable data.
- * Map VBO if needed.
- * For debugging purposes; not normally used.
- */
-static void
-check_array_data(struct gl_context *ctx, struct gl_client_array *array,
- GLuint attrib, GLuint j)
-{
- if (array->Enabled) {
- const void *data = array->Ptr;
- if (_mesa_is_bufferobj(array->BufferObj)) {
- if (!array->BufferObj->Pointer) {
- /* need to map now */
- array->BufferObj->Pointer =
- ctx->Driver.MapBuffer(ctx, GL_ARRAY_BUFFER_ARB,
- GL_READ_ONLY, array->BufferObj);
- }
- data = ADD_POINTERS(data, array->BufferObj->Pointer);
- }
- switch (array->Type) {
- case GL_FLOAT:
- {
- GLfloat *f = (GLfloat *) ((GLubyte *) data + array->StrideB * j);
- GLint k;
- for (k = 0; k < array->Size; k++) {
- if (IS_INF_OR_NAN(f[k]) ||
- f[k] >= 1.0e20 || f[k] <= -1.0e10) {
- printf("Bad array data:\n");
- printf(" Element[%u].%u = %f\n", j, k, f[k]);
- printf(" Array %u at %p\n", attrib, (void* ) array);
- printf(" Type 0x%x, Size %d, Stride %d\n",
- array->Type, array->Size, array->Stride);
- printf(" Address/offset %p in Buffer Object %u\n",
- array->Ptr, array->BufferObj->Name);
- f[k] = 1.0; /* XXX replace the bad value! */
- }
- /*assert(!IS_INF_OR_NAN(f[k]));*/
- }
- }
- break;
- default:
- ;
- }
- }
-}
-
-
-/**
- * Unmap the buffer object referenced by given array, if mapped.
- */
-static void
-unmap_array_buffer(struct gl_context *ctx, struct gl_client_array *array)
-{
- if (array->Enabled &&
- _mesa_is_bufferobj(array->BufferObj) &&
- _mesa_bufferobj_mapped(array->BufferObj)) {
- ctx->Driver.UnmapBuffer(ctx, GL_ARRAY_BUFFER_ARB, array->BufferObj);
- }
-}
-
-
-/**
- * Examine the array's data for NaNs, etc.
- * For debug purposes; not normally used.
- */
-static void
-check_draw_elements_data(struct gl_context *ctx, GLsizei count, GLenum elemType,
- const void *elements, GLint basevertex)
-{
- struct gl_array_object *arrayObj = ctx->Array.ArrayObj;
- const void *elemMap;
- GLint i, k;
-
- if (_mesa_is_bufferobj(ctx->Array.ElementArrayBufferObj)) {
- elemMap = ctx->Driver.MapBuffer(ctx,
- GL_ELEMENT_ARRAY_BUFFER_ARB,
- GL_READ_ONLY,
- ctx->Array.ElementArrayBufferObj);
- elements = ADD_POINTERS(elements, elemMap);
- }
-
- for (i = 0; i < count; i++) {
- GLuint j;
-
- /* j = element[i] */
- switch (elemType) {
- case GL_UNSIGNED_BYTE:
- j = ((const GLubyte *) elements)[i];
- break;
- case GL_UNSIGNED_SHORT:
- j = ((const GLushort *) elements)[i];
- break;
- case GL_UNSIGNED_INT:
- j = ((const GLuint *) elements)[i];
- break;
- default:
- assert(0);
- }
-
- /* check element j of each enabled array */
- check_array_data(ctx, &arrayObj->Vertex, VERT_ATTRIB_POS, j);
- check_array_data(ctx, &arrayObj->Normal, VERT_ATTRIB_NORMAL, j);
- check_array_data(ctx, &arrayObj->Color, VERT_ATTRIB_COLOR0, j);
- check_array_data(ctx, &arrayObj->SecondaryColor, VERT_ATTRIB_COLOR1, j);
- for (k = 0; k < Elements(arrayObj->TexCoord); k++) {
- check_array_data(ctx, &arrayObj->TexCoord[k], VERT_ATTRIB_TEX0 + k, j);
- }
- for (k = 0; k < Elements(arrayObj->VertexAttrib); k++) {
- check_array_data(ctx, &arrayObj->VertexAttrib[k],
- VERT_ATTRIB_GENERIC0 + k, j);
- }
- }
-
- if (_mesa_is_bufferobj(ctx->Array.ElementArrayBufferObj)) {
- ctx->Driver.UnmapBuffer(ctx, GL_ELEMENT_ARRAY_BUFFER_ARB,
- ctx->Array.ElementArrayBufferObj);
- }
-
- unmap_array_buffer(ctx, &arrayObj->Vertex);
- unmap_array_buffer(ctx, &arrayObj->Normal);
- unmap_array_buffer(ctx, &arrayObj->Color);
- for (k = 0; k < Elements(arrayObj->TexCoord); k++) {
- unmap_array_buffer(ctx, &arrayObj->TexCoord[k]);
- }
- for (k = 0; k < Elements(arrayObj->VertexAttrib); k++) {
- unmap_array_buffer(ctx, &arrayObj->VertexAttrib[k]);
- }
-}
-
-
-/**
- * Check array data, looking for NaNs, etc.
- */
-static void
-check_draw_arrays_data(struct gl_context *ctx, GLint start, GLsizei count)
-{
- /* TO DO */
-}
-
-
-/**
- * Print info/data for glDrawArrays(), for debugging.
- */
-static void
-print_draw_arrays(struct gl_context *ctx,
- GLenum mode, GLint start, GLsizei count)
-{
- struct vbo_context *vbo = vbo_context(ctx);
- struct vbo_exec_context *exec = &vbo->exec;
- int i;
-
- printf("vbo_exec_DrawArrays(mode 0x%x, start %d, count %d):\n",
- mode, start, count);
-
- for (i = 0; i < 32; i++) {
- GLuint bufName = exec->array.inputs[i]->BufferObj->Name;
- GLint stride = exec->array.inputs[i]->Stride;
- printf("attr %2d: size %d stride %d enabled %d "
- "ptr %p Bufobj %u\n",
- i,
- exec->array.inputs[i]->Size,
- stride,
- /*exec->array.inputs[i]->Enabled,*/
- exec->array.legacy_array[i]->Enabled,
- exec->array.inputs[i]->Ptr,
- bufName);
-
- if (bufName) {
- struct gl_buffer_object *buf = _mesa_lookup_bufferobj(ctx, bufName);
- GLubyte *p = ctx->Driver.MapBuffer(ctx, GL_ARRAY_BUFFER_ARB,
- GL_READ_ONLY_ARB, buf);
- int offset = (int) (GLintptr) exec->array.inputs[i]->Ptr;
- float *f = (float *) (p + offset);
- int *k = (int *) f;
- int i;
- int n = (count * stride) / 4;
- if (n > 32)
- n = 32;
- printf(" Data at offset %d:\n", offset);
- for (i = 0; i < n; i++) {
- printf(" float[%d] = 0x%08x %f\n", i, k[i], f[i]);
- }
- ctx->Driver.UnmapBuffer(ctx, GL_ARRAY_BUFFER_ARB, buf);
- }
- }
-}
-
-
-/**
- * Bind the VBO executor to the current vertex array object prior
- * to drawing.
- *
- * Just translate the arrayobj into a sane layout.
- */
-static void
-bind_array_obj(struct gl_context *ctx)
-{
- struct vbo_context *vbo = vbo_context(ctx);
- struct vbo_exec_context *exec = &vbo->exec;
- struct gl_array_object *arrayObj = ctx->Array.ArrayObj;
- GLuint i;
-
- /* TODO: Fix the ArrayObj struct to keep legacy arrays in an array
- * rather than as individual named arrays. Then this function can
- * go away.
- */
- exec->array.legacy_array[VERT_ATTRIB_POS] = &arrayObj->Vertex;
- exec->array.legacy_array[VERT_ATTRIB_WEIGHT] = &arrayObj->Weight;
- exec->array.legacy_array[VERT_ATTRIB_NORMAL] = &arrayObj->Normal;
- exec->array.legacy_array[VERT_ATTRIB_COLOR0] = &arrayObj->Color;
- exec->array.legacy_array[VERT_ATTRIB_COLOR1] = &arrayObj->SecondaryColor;
- exec->array.legacy_array[VERT_ATTRIB_FOG] = &arrayObj->FogCoord;
- exec->array.legacy_array[VERT_ATTRIB_COLOR_INDEX] = &arrayObj->Index;
- if (arrayObj->PointSize.Enabled) {
- /* this aliases COLOR_INDEX */
- exec->array.legacy_array[VERT_ATTRIB_POINT_SIZE] = &arrayObj->PointSize;
- }
- exec->array.legacy_array[VERT_ATTRIB_EDGEFLAG] = &arrayObj->EdgeFlag;
-
- for (i = 0; i < Elements(arrayObj->TexCoord); i++)
- exec->array.legacy_array[VERT_ATTRIB_TEX0 + i] = &arrayObj->TexCoord[i];
-
- for (i = 0; i < Elements(arrayObj->VertexAttrib); i++) {
- assert(i < Elements(exec->array.generic_array));
- exec->array.generic_array[i] = &arrayObj->VertexAttrib[i];
- }
-
- exec->array.array_obj = arrayObj->Name;
-}
-
-
-/**
- * Set the vbo->exec->inputs[] pointers to point to the enabled
- * vertex arrays. This depends on the current vertex program/shader
- * being executed because of whether or not generic vertex arrays
- * alias the conventional vertex arrays.
- * For arrays that aren't enabled, we set the input[attrib] pointer
- * to point at a zero-stride current value "array".
- */
-static void
-recalculate_input_bindings(struct gl_context *ctx)
-{
- struct vbo_context *vbo = vbo_context(ctx);
- struct vbo_exec_context *exec = &vbo->exec;
- const struct gl_client_array **inputs = &exec->array.inputs[0];
- GLbitfield const_inputs = 0x0;
- GLuint i;
-
- exec->array.program_mode = get_program_mode(ctx);
- exec->array.enabled_flags = ctx->Array.ArrayObj->_Enabled;
-
- switch (exec->array.program_mode) {
- case VP_NONE:
- /* When no vertex program is active (or the vertex program is generated
- * from fixed-function state). We put the material values into the
- * generic slots. This is the only situation where material values
- * are available as per-vertex attributes.
- */
- for (i = 0; i <= VERT_ATTRIB_TEX7; i++) {
- if (exec->array.legacy_array[i]->Enabled)
- inputs[i] = exec->array.legacy_array[i];
- else {
- inputs[i] = &vbo->legacy_currval[i];
- const_inputs |= 1 << i;
- }
- }
-
- for (i = 0; i < MAT_ATTRIB_MAX; i++) {
- inputs[VERT_ATTRIB_GENERIC0 + i] = &vbo->mat_currval[i];
- const_inputs |= 1 << (VERT_ATTRIB_GENERIC0 + i);
- }
-
- /* Could use just about anything, just to fill in the empty
- * slots:
- */
- for (i = MAT_ATTRIB_MAX; i < VERT_ATTRIB_MAX - VERT_ATTRIB_GENERIC0; i++) {
- inputs[VERT_ATTRIB_GENERIC0 + i] = &vbo->generic_currval[i];
- const_inputs |= 1 << (VERT_ATTRIB_GENERIC0 + i);
- }
-
- /* There is no need to make _NEW_ARRAY dirty here for the TnL program,
- * because it already takes care of invalidating the state necessary
- * to revalidate vertex arrays. Not marking the state as dirty also
- * improves performance (quite significantly in some apps).
- */
- if (!ctx->VertexProgram._MaintainTnlProgram)
- ctx->NewState |= _NEW_ARRAY;
- break;
-
- case VP_NV:
- /* NV_vertex_program - attribute arrays alias and override
- * conventional, legacy arrays. No materials, and the generic
- * slots are vacant.
- */
- for (i = 0; i <= VERT_ATTRIB_TEX7; i++) {
- if (exec->array.generic_array[i]->Enabled)
- inputs[i] = exec->array.generic_array[i];
- else if (exec->array.legacy_array[i]->Enabled)
- inputs[i] = exec->array.legacy_array[i];
- else {
- inputs[i] = &vbo->legacy_currval[i];
- const_inputs |= 1 << i;
- }
- }
-
- /* Could use just about anything, just to fill in the empty
- * slots:
- */
- for (i = VERT_ATTRIB_GENERIC0; i < VERT_ATTRIB_MAX; i++) {
- inputs[i] = &vbo->generic_currval[i - VERT_ATTRIB_GENERIC0];
- const_inputs |= 1 << i;
- }
-
- ctx->NewState |= _NEW_ARRAY;
- break;
-
- case VP_ARB:
- /* GL_ARB_vertex_program or GLSL vertex shader - Only the generic[0]
- * attribute array aliases and overrides the legacy position array.
- *
- * Otherwise, legacy attributes available in the legacy slots,
- * generic attributes in the generic slots and materials are not
- * available as per-vertex attributes.
- */
- if (exec->array.generic_array[0]->Enabled)
- inputs[0] = exec->array.generic_array[0];
- else if (exec->array.legacy_array[0]->Enabled)
- inputs[0] = exec->array.legacy_array[0];
- else {
- inputs[0] = &vbo->legacy_currval[0];
- const_inputs |= 1 << 0;
- }
-
- for (i = 1; i <= VERT_ATTRIB_TEX7; i++) {
- if (exec->array.legacy_array[i]->Enabled)
- inputs[i] = exec->array.legacy_array[i];
- else {
- inputs[i] = &vbo->legacy_currval[i];
- const_inputs |= 1 << i;
- }
- }
-
- for (i = 0; i < MAX_VERTEX_GENERIC_ATTRIBS; i++) {
- if (exec->array.generic_array[i]->Enabled)
- inputs[VERT_ATTRIB_GENERIC0 + i] = exec->array.generic_array[i];
- else {
- inputs[VERT_ATTRIB_GENERIC0 + i] = &vbo->generic_currval[i];
- const_inputs |= 1 << (VERT_ATTRIB_GENERIC0 + i);
- }
- }
-
- ctx->NewState |= _NEW_ARRAY;
- break;
- }
-
- _mesa_set_varying_vp_inputs( ctx, ~const_inputs );
-}
-
-
-/**
- * Examine the enabled vertex arrays to set the exec->array.inputs[] values.
- * These will point to the arrays to actually use for drawing. Some will
- * be user-provided arrays, other will be zero-stride const-valued arrays.
- * Note that this might set the _NEW_ARRAY dirty flag so state validation
- * must be done after this call.
- */
-static void
-bind_arrays(struct gl_context *ctx)
-{
- if (!ctx->Array.RebindArrays) {
- return;
- }
-
- bind_array_obj(ctx);
- recalculate_input_bindings(ctx);
- ctx->Array.RebindArrays = GL_FALSE;
-}
-
-
-/**
- * Helper function called by the other DrawArrays() functions below.
- * This is where we handle primitive restart for drawing non-indexed
- * arrays. If primitive restart is enabled, it typically means
- * splitting one DrawArrays() into two.
- */
-static void
-vbo_draw_arrays(struct gl_context *ctx, GLenum mode, GLint start,
- GLsizei count, GLuint numInstances)
-{
- struct vbo_context *vbo = vbo_context(ctx);
- struct vbo_exec_context *exec = &vbo->exec;
- struct _mesa_prim prim[2];
-
- bind_arrays(ctx);
-
- /* Again... because we may have changed the bitmask of per-vertex varying
- * attributes. If we regenerate the fixed-function vertex program now
- * we may be able to prune down the number of vertex attributes which we
- * need in the shader.
- */
- if (ctx->NewState)
- _mesa_update_state(ctx);
-
- /* init most fields to zero */
- memset(prim, 0, sizeof(prim));
- prim[0].begin = 1;
- prim[0].end = 1;
- prim[0].mode = mode;
- prim[0].num_instances = numInstances;
-
- /* Implement the primitive restart index */
- if (ctx->Array.PrimitiveRestart && ctx->Array.RestartIndex < count) {
- GLuint primCount = 0;
-
- if (ctx->Array.RestartIndex == start) {
- /* special case: RestartIndex at beginning */
- if (count > 1) {
- prim[0].start = start + 1;
- prim[0].count = count - 1;
- primCount = 1;
- }
- }
- else if (ctx->Array.RestartIndex == start + count - 1) {
- /* special case: RestartIndex at end */
- if (count > 1) {
- prim[0].start = start;
- prim[0].count = count - 1;
- primCount = 1;
- }
- }
- else {
- /* general case: RestartIndex in middle, split into two prims */
- prim[0].start = start;
- prim[0].count = ctx->Array.RestartIndex - start;
-
- prim[1] = prim[0];
- prim[1].start = ctx->Array.RestartIndex + 1;
- prim[1].count = count - prim[1].start;
-
- primCount = 2;
- }
-
- if (primCount > 0) {
- /* draw one or two prims */
- check_buffers_are_unmapped(exec->array.inputs);
- vbo->draw_prims(ctx, exec->array.inputs, prim, primCount, NULL,
- GL_TRUE, start, start + count - 1);
- }
- }
- else {
- /* no prim restart */
- prim[0].start = start;
- prim[0].count = count;
-
- check_buffers_are_unmapped(exec->array.inputs);
- vbo->draw_prims(ctx, exec->array.inputs, prim, 1, NULL,
- GL_TRUE, start, start + count - 1);
- }
-}
-
-
-
-/**
- * Called from glDrawArrays when in immediate mode (not display list mode).
- */
-static void GLAPIENTRY
-vbo_exec_DrawArrays(GLenum mode, GLint start, GLsizei count)
-{
- GET_CURRENT_CONTEXT(ctx);
-
- if (MESA_VERBOSE & VERBOSE_DRAW)
- _mesa_debug(ctx, "glDrawArrays(%s, %d, %d)\n",
- _mesa_lookup_enum_by_nr(mode), start, count);
-
- if (!_mesa_validate_DrawArrays( ctx, mode, start, count ))
- return;
-
- FLUSH_CURRENT( ctx, 0 );
-
- if (!_mesa_valid_to_render(ctx, "glDrawArrays")) {
- return;
- }
-
- if (0)
- check_draw_arrays_data(ctx, start, count);
-
- vbo_draw_arrays(ctx, mode, start, count, 1);
-
- if (0)
- print_draw_arrays(ctx, mode, start, count);
-}
-
-
-/**
- * Called from glDrawArraysInstanced when in immediate mode (not
- * display list mode).
- */
-static void GLAPIENTRY
-vbo_exec_DrawArraysInstanced(GLenum mode, GLint start, GLsizei count,
- GLsizei numInstances)
-{
- GET_CURRENT_CONTEXT(ctx);
-
- if (MESA_VERBOSE & VERBOSE_DRAW)
- _mesa_debug(ctx, "glDrawArraysInstanced(%s, %d, %d, %d)\n",
- _mesa_lookup_enum_by_nr(mode), start, count, numInstances);
-
- if (!_mesa_validate_DrawArraysInstanced(ctx, mode, start, count, numInstances))
- return;
-
- FLUSH_CURRENT( ctx, 0 );
-
- if (!_mesa_valid_to_render(ctx, "glDrawArraysInstanced")) {
- return;
- }
-
- if (0)
- check_draw_arrays_data(ctx, start, count);
-
- vbo_draw_arrays(ctx, mode, start, count, numInstances);
-
- if (0)
- print_draw_arrays(ctx, mode, start, count);
-}
-
-
-/**
- * Map GL_ELEMENT_ARRAY_BUFFER and print contents.
- * For debugging.
- */
-static void
-dump_element_buffer(struct gl_context *ctx, GLenum type)
-{
- const GLvoid *map = ctx->Driver.MapBuffer(ctx,
- GL_ELEMENT_ARRAY_BUFFER_ARB,
- GL_READ_ONLY,
- ctx->Array.ElementArrayBufferObj);
- switch (type) {
- case GL_UNSIGNED_BYTE:
- {
- const GLubyte *us = (const GLubyte *) map;
- GLint i;
- for (i = 0; i < ctx->Array.ElementArrayBufferObj->Size; i++) {
- printf("%02x ", us[i]);
- if (i % 32 == 31)
- printf("\n");
- }
- printf("\n");
- }
- break;
- case GL_UNSIGNED_SHORT:
- {
- const GLushort *us = (const GLushort *) map;
- GLint i;
- for (i = 0; i < ctx->Array.ElementArrayBufferObj->Size / 2; i++) {
- printf("%04x ", us[i]);
- if (i % 16 == 15)
- printf("\n");
- }
- printf("\n");
- }
- break;
- case GL_UNSIGNED_INT:
- {
- const GLuint *us = (const GLuint *) map;
- GLint i;
- for (i = 0; i < ctx->Array.ElementArrayBufferObj->Size / 4; i++) {
- printf("%08x ", us[i]);
- if (i % 8 == 7)
- printf("\n");
- }
- printf("\n");
- }
- break;
- default:
- ;
- }
-
- ctx->Driver.UnmapBuffer(ctx, GL_ELEMENT_ARRAY_BUFFER_ARB,
- ctx->Array.ElementArrayBufferObj);
-}
-
-
-/**
- * Inner support for both _mesa_DrawElements and _mesa_DrawRangeElements.
- * Do the rendering for a glDrawElements or glDrawRangeElements call after
- * we've validated buffer bounds, etc.
- */
-static void
-vbo_validated_drawrangeelements(struct gl_context *ctx, GLenum mode,
- GLboolean index_bounds_valid,
- GLuint start, GLuint end,
- GLsizei count, GLenum type,
- const GLvoid *indices,
- GLint basevertex, GLint numInstances)
-{
- struct vbo_context *vbo = vbo_context(ctx);
- struct vbo_exec_context *exec = &vbo->exec;
- struct _mesa_index_buffer ib;
- struct _mesa_prim prim[1];
-
- FLUSH_CURRENT( ctx, 0 );
-
- if (!_mesa_valid_to_render(ctx, "glDraw[Range]Elements")) {
- return;
- }
-
- bind_arrays( ctx );
-
- /* check for dirty state again */
- if (ctx->NewState)
- _mesa_update_state( ctx );
-
- ib.count = count;
- ib.type = type;
- ib.obj = ctx->Array.ElementArrayBufferObj;
- ib.ptr = indices;
-
- prim[0].begin = 1;
- prim[0].end = 1;
- prim[0].weak = 0;
- prim[0].pad = 0;
- prim[0].mode = mode;
- prim[0].start = 0;
- prim[0].count = count;
- prim[0].indexed = 1;
- prim[0].basevertex = basevertex;
- prim[0].num_instances = numInstances;
-
- /* Need to give special consideration to rendering a range of
- * indices starting somewhere above zero. Typically the
- * application is issuing multiple DrawRangeElements() to draw
- * successive primitives layed out linearly in the vertex arrays.
- * Unless the vertex arrays are all in a VBO (or locked as with
- * CVA), the OpenGL semantics imply that we need to re-read or
- * re-upload the vertex data on each draw call.
- *
- * In the case of hardware tnl, we want to avoid starting the
- * upload at zero, as it will mean every draw call uploads an
- * increasing amount of not-used vertex data. Worse - in the
- * software tnl module, all those vertices might be transformed and
- * lit but never rendered.
- *
- * If we just upload or transform the vertices in start..end,
- * however, the indices will be incorrect.
- *
- * At this level, we don't know exactly what the requirements of
- * the backend are going to be, though it will likely boil down to
- * either:
- *
- * 1) Do nothing, everything is in a VBO and is processed once
- * only.
- *
- * 2) Adjust the indices and vertex arrays so that start becomes
- * zero.
- *
- * Rather than doing anything here, I'll provide a helper function
- * for the latter case elsewhere.
- */
-
- check_buffers_are_unmapped(exec->array.inputs);
- vbo->draw_prims( ctx, exec->array.inputs, prim, 1, &ib,
- index_bounds_valid, start, end );
-}
-
-
-/**
- * Called by glDrawRangeElementsBaseVertex() in immediate mode.
- */
-static void GLAPIENTRY
-vbo_exec_DrawRangeElementsBaseVertex(GLenum mode,
- GLuint start, GLuint end,
- GLsizei count, GLenum type,
- const GLvoid *indices,
- GLint basevertex)
-{
- static GLuint warnCount = 0;
- GET_CURRENT_CONTEXT(ctx);
-
- if (MESA_VERBOSE & VERBOSE_DRAW)
- _mesa_debug(ctx,
- "glDrawRangeElementsBaseVertex(%s, %u, %u, %d, %s, %p, %d)\n",
- _mesa_lookup_enum_by_nr(mode), start, end, count,
- _mesa_lookup_enum_by_nr(type), indices, basevertex);
-
- if (!_mesa_validate_DrawRangeElements( ctx, mode, start, end, count,
- type, indices, basevertex ))
- return;
-
- /* NOTE: It's important that 'end' is a reasonable value.
- * in _tnl_draw_prims(), we use end to determine how many vertices
- * to transform. If it's too large, we can unnecessarily split prims
- * or we can read/write out of memory in several different places!
- */
-
- /* Catch/fix some potential user errors */
- if (type == GL_UNSIGNED_BYTE) {
- start = MIN2(start, 0xff);
- end = MIN2(end, 0xff);
- }
- else if (type == GL_UNSIGNED_SHORT) {
- start = MIN2(start, 0xffff);
- end = MIN2(end, 0xffff);
- }
-
- if (end >= ctx->Array.ArrayObj->_MaxElement) {
- /* the max element is out of bounds of one or more enabled arrays */
- warnCount++;
-
- if (warnCount < 10) {
- _mesa_warning(ctx, "glDraw[Range]Elements(start %u, end %u, count %d, "
- "type 0x%x, indices=%p)\n"
- "\tend is out of bounds (max=%u) "
- "Element Buffer %u (size %d)\n"
- "\tThis should probably be fixed in the application.",
- start, end, count, type, indices,
- ctx->Array.ArrayObj->_MaxElement - 1,
- ctx->Array.ElementArrayBufferObj->Name,
- (int) ctx->Array.ElementArrayBufferObj->Size);
- }
-
- if (0)
- dump_element_buffer(ctx, type);
-
- if (0)
- _mesa_print_arrays(ctx);
-
-#ifdef DEBUG
- /* 'end' was out of bounds, but now let's check the actual array
- * indexes to see if any of them are out of bounds.
- */
- {
- GLuint max = _mesa_max_buffer_index(ctx, count, type, indices,
- ctx->Array.ElementArrayBufferObj);
- if (max >= ctx->Array.ArrayObj->_MaxElement) {
- if (warnCount < 10) {
- _mesa_warning(ctx, "glDraw[Range]Elements(start %u, end %u, "
- "count %d, type 0x%x, indices=%p)\n"
- "\tindex=%u is out of bounds (max=%u) "
- "Element Buffer %u (size %d)\n"
- "\tSkipping the glDrawRangeElements() call",
- start, end, count, type, indices, max,
- ctx->Array.ArrayObj->_MaxElement - 1,
- ctx->Array.ElementArrayBufferObj->Name,
- (int) ctx->Array.ElementArrayBufferObj->Size);
- }
- }
- /* XXX we could also find the min index and compare to 'start'
- * to see if start is correct. But it's more likely to get the
- * upper bound wrong.
- */
- }
-#endif
-
- /* Set 'end' to the max possible legal value */
- assert(ctx->Array.ArrayObj->_MaxElement >= 1);
- end = ctx->Array.ArrayObj->_MaxElement - 1;
-
- if (end < start) {
- return;
- }
- }
-
- if (0) {
- printf("glDraw[Range]Elements{,BaseVertex}"
- "(start %u, end %u, type 0x%x, count %d) ElemBuf %u, "
- "base %d\n",
- start, end, type, count,
- ctx->Array.ElementArrayBufferObj->Name,
- basevertex);
- }
-
-#if 0
- check_draw_elements_data(ctx, count, type, indices);
-#else
- (void) check_draw_elements_data;
-#endif
-
- vbo_validated_drawrangeelements(ctx, mode, GL_TRUE, start, end,
- count, type, indices, basevertex, 1);
-}
-
-
-/**
- * Called by glDrawRangeElements() in immediate mode.
- */
-static void GLAPIENTRY
-vbo_exec_DrawRangeElements(GLenum mode, GLuint start, GLuint end,
- GLsizei count, GLenum type, const GLvoid *indices)
-{
- GET_CURRENT_CONTEXT(ctx);
-
- if (MESA_VERBOSE & VERBOSE_DRAW)
- _mesa_debug(ctx,
- "glDrawRangeElements(%s, %u, %u, %d, %s, %p)\n",
- _mesa_lookup_enum_by_nr(mode), start, end, count,
- _mesa_lookup_enum_by_nr(type), indices);
-
- vbo_exec_DrawRangeElementsBaseVertex(mode, start, end, count, type,
- indices, 0);
-}
-
-
-/**
- * Called by glDrawElements() in immediate mode.
- */
-static void GLAPIENTRY
-vbo_exec_DrawElements(GLenum mode, GLsizei count, GLenum type,
- const GLvoid *indices)
-{
- GET_CURRENT_CONTEXT(ctx);
-
- if (MESA_VERBOSE & VERBOSE_DRAW)
- _mesa_debug(ctx, "glDrawElements(%s, %u, %s, %p)\n",
- _mesa_lookup_enum_by_nr(mode), count,
- _mesa_lookup_enum_by_nr(type), indices);
-
- if (!_mesa_validate_DrawElements( ctx, mode, count, type, indices, 0 ))
- return;
-
- vbo_validated_drawrangeelements(ctx, mode, GL_FALSE, ~0, ~0,
- count, type, indices, 0, 1);
-}
-
-
-/**
- * Called by glDrawElementsBaseVertex() in immediate mode.
- */
-static void GLAPIENTRY
-vbo_exec_DrawElementsBaseVertex(GLenum mode, GLsizei count, GLenum type,
- const GLvoid *indices, GLint basevertex)
-{
- GET_CURRENT_CONTEXT(ctx);
-
- if (MESA_VERBOSE & VERBOSE_DRAW)
- _mesa_debug(ctx, "glDrawElementsBaseVertex(%s, %d, %s, %p, %d)\n",
- _mesa_lookup_enum_by_nr(mode), count,
- _mesa_lookup_enum_by_nr(type), indices, basevertex);
-
- if (!_mesa_validate_DrawElements( ctx, mode, count, type, indices,
- basevertex ))
- return;
-
- vbo_validated_drawrangeelements(ctx, mode, GL_FALSE, ~0, ~0,
- count, type, indices, basevertex, 1);
-}
-
-
-/**
- * Called by glDrawElementsInstanced() in immediate mode.
- */
-static void GLAPIENTRY
-vbo_exec_DrawElementsInstanced(GLenum mode, GLsizei count, GLenum type,
- const GLvoid *indices, GLsizei numInstances)
-{
- GET_CURRENT_CONTEXT(ctx);
-
- if (MESA_VERBOSE & VERBOSE_DRAW)
- _mesa_debug(ctx, "glDrawElementsInstanced(%s, %d, %s, %p, %d)\n",
- _mesa_lookup_enum_by_nr(mode), count,
- _mesa_lookup_enum_by_nr(type), indices, numInstances);
-
- if (!_mesa_validate_DrawElementsInstanced(ctx, mode, count, type, indices,
- numInstances))
- return;
-
- vbo_validated_drawrangeelements(ctx, mode, GL_FALSE, ~0, ~0,
- count, type, indices, 0, numInstances);
-}
-
-
-/**
- * Inner support for both _mesa_MultiDrawElements() and
- * _mesa_MultiDrawRangeElements().
- * This does the actual rendering after we've checked array indexes, etc.
- */
-static void
-vbo_validated_multidrawelements(struct gl_context *ctx, GLenum mode,
- const GLsizei *count, GLenum type,
- const GLvoid **indices, GLsizei primcount,
- const GLint *basevertex)
-{
- struct vbo_context *vbo = vbo_context(ctx);
- struct vbo_exec_context *exec = &vbo->exec;
- struct _mesa_index_buffer ib;
- struct _mesa_prim *prim;
- unsigned int index_type_size = 0;
- uintptr_t min_index_ptr, max_index_ptr;
- GLboolean fallback = GL_FALSE;
- int i;
-
- if (primcount == 0)
- return;
-
- FLUSH_CURRENT( ctx, 0 );
-
- if (!_mesa_valid_to_render(ctx, "glMultiDrawElements")) {
- return;
- }
-
- prim = calloc(1, primcount * sizeof(*prim));
- if (prim == NULL) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "glMultiDrawElements");
- return;
- }
-
- /* Decide if we can do this all as one set of primitives sharing the
- * same index buffer, or if we have to reset the index pointer per
- * primitive.
- */
- bind_arrays( ctx );
-
- /* check for dirty state again */
- if (ctx->NewState)
- _mesa_update_state( ctx );
-
- switch (type) {
- case GL_UNSIGNED_INT:
- index_type_size = 4;
- break;
- case GL_UNSIGNED_SHORT:
- index_type_size = 2;
- break;
- case GL_UNSIGNED_BYTE:
- index_type_size = 1;
- break;
- default:
- assert(0);
- }
-
- min_index_ptr = (uintptr_t)indices[0];
- max_index_ptr = 0;
- for (i = 0; i < primcount; i++) {
- min_index_ptr = MIN2(min_index_ptr, (uintptr_t)indices[i]);
- max_index_ptr = MAX2(max_index_ptr, (uintptr_t)indices[i] +
- index_type_size * count[i]);
- }
-
- /* Check if we can handle this thing as a bunch of index offsets from the
- * same index pointer. If we can't, then we have to fall back to doing
- * a draw_prims per primitive.
- * Check that the difference between each prim's indexes is a multiple of
- * the index/element size.
- */
- if (index_type_size != 1) {
- for (i = 0; i < primcount; i++) {
- if ((((uintptr_t)indices[i] - min_index_ptr) % index_type_size) != 0) {
- fallback = GL_TRUE;
- break;
- }
- }
- }
-
- /* If the index buffer isn't in a VBO, then treating the application's
- * subranges of the index buffer as one large index buffer may lead to
- * us reading unmapped memory.
- */
- if (!_mesa_is_bufferobj(ctx->Array.ElementArrayBufferObj))
- fallback = GL_TRUE;
-
- if (!fallback) {
- ib.count = (max_index_ptr - min_index_ptr) / index_type_size;
- ib.type = type;
- ib.obj = ctx->Array.ElementArrayBufferObj;
- ib.ptr = (void *)min_index_ptr;
-
- for (i = 0; i < primcount; i++) {
- prim[i].begin = (i == 0);
- prim[i].end = (i == primcount - 1);
- prim[i].weak = 0;
- prim[i].pad = 0;
- prim[i].mode = mode;
- prim[i].start = ((uintptr_t)indices[i] - min_index_ptr) / index_type_size;
- prim[i].count = count[i];
- prim[i].indexed = 1;
- prim[i].num_instances = 1;
- if (basevertex != NULL)
- prim[i].basevertex = basevertex[i];
- else
- prim[i].basevertex = 0;
- }
-
- check_buffers_are_unmapped(exec->array.inputs);
- vbo->draw_prims(ctx, exec->array.inputs, prim, primcount, &ib,
- GL_FALSE, ~0, ~0);
- } else {
- /* render one prim at a time */
- for (i = 0; i < primcount; i++) {
- ib.count = count[i];
- ib.type = type;
- ib.obj = ctx->Array.ElementArrayBufferObj;
- ib.ptr = indices[i];
-
- prim[0].begin = 1;
- prim[0].end = 1;
- prim[0].weak = 0;
- prim[0].pad = 0;
- prim[0].mode = mode;
- prim[0].start = 0;
- prim[0].count = count[i];
- prim[0].indexed = 1;
- prim[0].num_instances = 1;
- if (basevertex != NULL)
- prim[0].basevertex = basevertex[i];
- else
- prim[0].basevertex = 0;
-
- check_buffers_are_unmapped(exec->array.inputs);
- vbo->draw_prims(ctx, exec->array.inputs, prim, 1, &ib,
- GL_FALSE, ~0, ~0);
- }
- }
-
- free(prim);
-}
-
-
-static void GLAPIENTRY
-vbo_exec_MultiDrawElements(GLenum mode,
- const GLsizei *count, GLenum type,
- const GLvoid **indices,
- GLsizei primcount)
-{
- GET_CURRENT_CONTEXT(ctx);
- GLint i;
-
- ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
-
- for (i = 0; i < primcount; i++) {
- if (!_mesa_validate_DrawElements(ctx, mode, count[i], type, indices[i],
- 0))
- return;
- }
-
- vbo_validated_multidrawelements(ctx, mode, count, type, indices, primcount,
- NULL);
-}
-
-
-static void GLAPIENTRY
-vbo_exec_MultiDrawElementsBaseVertex(GLenum mode,
- const GLsizei *count, GLenum type,
- const GLvoid **indices,
- GLsizei primcount,
- const GLsizei *basevertex)
-{
- GET_CURRENT_CONTEXT(ctx);
- GLint i;
-
- ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
-
- for (i = 0; i < primcount; i++) {
- if (!_mesa_validate_DrawElements(ctx, mode, count[i], type, indices[i],
- basevertex[i]))
- return;
- }
-
- vbo_validated_multidrawelements(ctx, mode, count, type, indices, primcount,
- basevertex);
-}
-
-
-/**
- * Plug in the immediate-mode vertex array drawing commands into the
- * givven vbo_exec_context object.
- */
-void
-vbo_exec_array_init( struct vbo_exec_context *exec )
-{
- exec->vtxfmt.DrawArrays = vbo_exec_DrawArrays;
- exec->vtxfmt.DrawElements = vbo_exec_DrawElements;
- exec->vtxfmt.DrawRangeElements = vbo_exec_DrawRangeElements;
- exec->vtxfmt.MultiDrawElementsEXT = vbo_exec_MultiDrawElements;
- exec->vtxfmt.DrawElementsBaseVertex = vbo_exec_DrawElementsBaseVertex;
- exec->vtxfmt.DrawRangeElementsBaseVertex = vbo_exec_DrawRangeElementsBaseVertex;
- exec->vtxfmt.MultiDrawElementsBaseVertex = vbo_exec_MultiDrawElementsBaseVertex;
- exec->vtxfmt.DrawArraysInstanced = vbo_exec_DrawArraysInstanced;
- exec->vtxfmt.DrawElementsInstanced = vbo_exec_DrawElementsInstanced;
-}
-
-
-void
-vbo_exec_array_destroy( struct vbo_exec_context *exec )
-{
- /* nothing to do */
-}
-
-
-
-/**
- * The following functions are only used for OpenGL ES 1/2 support.
- * And some aren't even supported (yet) in ES 1/2.
- */
-
-
-void GLAPIENTRY
-_mesa_DrawArrays(GLenum mode, GLint first, GLsizei count)
-{
- vbo_exec_DrawArrays(mode, first, count);
-}
-
-
-void GLAPIENTRY
-_mesa_DrawElements(GLenum mode, GLsizei count, GLenum type,
- const GLvoid *indices)
-{
- vbo_exec_DrawElements(mode, count, type, indices);
-}
-
-
-void GLAPIENTRY
-_mesa_DrawElementsBaseVertex(GLenum mode, GLsizei count, GLenum type,
- const GLvoid *indices, GLint basevertex)
-{
- vbo_exec_DrawElementsBaseVertex(mode, count, type, indices, basevertex);
-}
-
-
-void GLAPIENTRY
-_mesa_DrawRangeElements(GLenum mode, GLuint start, GLuint end, GLsizei count,
- GLenum type, const GLvoid *indices)
-{
- vbo_exec_DrawRangeElements(mode, start, end, count, type, indices);
-}
-
-
-void GLAPIENTRY
-_mesa_DrawRangeElementsBaseVertex(GLenum mode, GLuint start, GLuint end,
- GLsizei count, GLenum type,
- const GLvoid *indices, GLint basevertex)
-{
- vbo_exec_DrawRangeElementsBaseVertex(mode, start, end, count, type,
- indices, basevertex);
-}
-
-
-void GLAPIENTRY
-_mesa_MultiDrawElementsEXT(GLenum mode, const GLsizei *count, GLenum type,
- const GLvoid **indices, GLsizei primcount)
-{
- vbo_exec_MultiDrawElements(mode, count, type, indices, primcount);
-}
-
-
-void GLAPIENTRY
-_mesa_MultiDrawElementsBaseVertex(GLenum mode,
- const GLsizei *count, GLenum type,
- const GLvoid **indices, GLsizei primcount,
- const GLint *basevertex)
-{
- vbo_exec_MultiDrawElementsBaseVertex(mode, count, type, indices,
- primcount, basevertex);
-}
+/**************************************************************************
+ *
+ * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas.
+ * Copyright 2009 VMware, Inc.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ **************************************************************************/
+
+#include "main/glheader.h"
+#include "main/context.h"
+#include "main/state.h"
+#include "main/api_validate.h"
+#include "main/varray.h"
+#include "main/bufferobj.h"
+#include "main/enums.h"
+#include "main/macros.h"
+
+#include "vbo_context.h"
+
+
+/**
+ * All vertex buffers should be in an unmapped state when we're about
+ * to draw. This debug function checks that.
+ */
+static void
+check_buffers_are_unmapped(const struct gl_client_array **inputs)
+{
+#ifdef DEBUG
+ GLuint i;
+
+ for (i = 0; i < VERT_ATTRIB_MAX; i++) {
+ if (inputs[i]) {
+ struct gl_buffer_object *obj = inputs[i]->BufferObj;
+ assert(!_mesa_bufferobj_mapped(obj));
+ (void) obj;
+ }
+ }
+#endif
+}
+
+
+/**
+ * A debug function that may be called from other parts of Mesa as
+ * needed during debugging.
+ */
+void
+vbo_check_buffers_are_unmapped(struct gl_context *ctx)
+{
+ struct vbo_context *vbo = vbo_context(ctx);
+ struct vbo_exec_context *exec = &vbo->exec;
+ /* check the current vertex arrays */
+ check_buffers_are_unmapped(exec->array.inputs);
+ /* check the current glBegin/glVertex/glEnd-style VBO */
+ assert(!_mesa_bufferobj_mapped(exec->vtx.bufferobj));
+}
+
+
+
+/**
+ * Compute min and max elements by scanning the index buffer for
+ * glDraw[Range]Elements() calls.
+ * If primitive restart is enabled, we need to ignore restart
+ * indexes when computing min/max.
+ */
+void
+vbo_get_minmax_index(struct gl_context *ctx,
+ const struct _mesa_prim *prim,
+ const struct _mesa_index_buffer *ib,
+ GLuint *min_index, GLuint *max_index)
+{
+ const GLboolean restart = ctx->Array.PrimitiveRestart;
+ const GLuint restartIndex = ctx->Array.RestartIndex;
+ const GLuint count = prim->count;
+ const void *indices;
+ GLuint i;
+
+ if (_mesa_is_bufferobj(ib->obj)) {
+ const GLvoid *map =
+ ctx->Driver.MapBuffer(ctx, GL_ELEMENT_ARRAY_BUFFER_ARB,
+ GL_READ_ONLY, ib->obj);
+ indices = ADD_POINTERS(map, ib->ptr);
+ } else {
+ indices = ib->ptr;
+ }
+
+ switch (ib->type) {
+ case GL_UNSIGNED_INT: {
+ const GLuint *ui_indices = (const GLuint *)indices;
+ GLuint max_ui = 0;
+ GLuint min_ui = ~0U;
+ if (restart) {
+ for (i = 0; i < count; i++) {
+ if (ui_indices[i] != restartIndex) {
+ if (ui_indices[i] > max_ui) max_ui = ui_indices[i];
+ if (ui_indices[i] < min_ui) min_ui = ui_indices[i];
+ }
+ }
+ }
+ else {
+ for (i = 0; i < count; i++) {
+ if (ui_indices[i] > max_ui) max_ui = ui_indices[i];
+ if (ui_indices[i] < min_ui) min_ui = ui_indices[i];
+ }
+ }
+ *min_index = min_ui;
+ *max_index = max_ui;
+ break;
+ }
+ case GL_UNSIGNED_SHORT: {
+ const GLushort *us_indices = (const GLushort *)indices;
+ GLuint max_us = 0;
+ GLuint min_us = ~0U;
+ if (restart) {
+ for (i = 0; i < count; i++) {
+ if (us_indices[i] != restartIndex) {
+ if (us_indices[i] > max_us) max_us = us_indices[i];
+ if (us_indices[i] < min_us) min_us = us_indices[i];
+ }
+ }
+ }
+ else {
+ for (i = 0; i < count; i++) {
+ if (us_indices[i] > max_us) max_us = us_indices[i];
+ if (us_indices[i] < min_us) min_us = us_indices[i];
+ }
+ }
+ *min_index = min_us;
+ *max_index = max_us;
+ break;
+ }
+ case GL_UNSIGNED_BYTE: {
+ const GLubyte *ub_indices = (const GLubyte *)indices;
+ GLuint max_ub = 0;
+ GLuint min_ub = ~0U;
+ if (restart) {
+ for (i = 0; i < count; i++) {
+ if (ub_indices[i] != restartIndex) {
+ if (ub_indices[i] > max_ub) max_ub = ub_indices[i];
+ if (ub_indices[i] < min_ub) min_ub = ub_indices[i];
+ }
+ }
+ }
+ else {
+ for (i = 0; i < count; i++) {
+ if (ub_indices[i] > max_ub) max_ub = ub_indices[i];
+ if (ub_indices[i] < min_ub) min_ub = ub_indices[i];
+ }
+ }
+ *min_index = min_ub;
+ *max_index = max_ub;
+ break;
+ }
+ default:
+ assert(0);
+ break;
+ }
+
+ if (_mesa_is_bufferobj(ib->obj)) {
+ ctx->Driver.UnmapBuffer(ctx, GL_ELEMENT_ARRAY_BUFFER_ARB, ib->obj);
+ }
+}
+
+
+/**
+ * Check that element 'j' of the array has reasonable data.
+ * Map VBO if needed.
+ * For debugging purposes; not normally used.
+ */
+static void
+check_array_data(struct gl_context *ctx, struct gl_client_array *array,
+ GLuint attrib, GLuint j)
+{
+ if (array->Enabled) {
+ const void *data = array->Ptr;
+ if (_mesa_is_bufferobj(array->BufferObj)) {
+ if (!array->BufferObj->Pointer) {
+ /* need to map now */
+ array->BufferObj->Pointer =
+ ctx->Driver.MapBuffer(ctx, GL_ARRAY_BUFFER_ARB,
+ GL_READ_ONLY, array->BufferObj);
+ }
+ data = ADD_POINTERS(data, array->BufferObj->Pointer);
+ }
+ switch (array->Type) {
+ case GL_FLOAT:
+ {
+ GLfloat *f = (GLfloat *) ((GLubyte *) data + array->StrideB * j);
+ GLint k;
+ for (k = 0; k < array->Size; k++) {
+ if (IS_INF_OR_NAN(f[k]) ||
+ f[k] >= 1.0e20 || f[k] <= -1.0e10) {
+ printf("Bad array data:\n");
+ printf(" Element[%u].%u = %f\n", j, k, f[k]);
+ printf(" Array %u at %p\n", attrib, (void* ) array);
+ printf(" Type 0x%x, Size %d, Stride %d\n",
+ array->Type, array->Size, array->Stride);
+ printf(" Address/offset %p in Buffer Object %u\n",
+ array->Ptr, array->BufferObj->Name);
+ f[k] = 1.0; /* XXX replace the bad value! */
+ }
+ /*assert(!IS_INF_OR_NAN(f[k]));*/
+ }
+ }
+ break;
+ default:
+ ;
+ }
+ }
+}
+
+
+/**
+ * Unmap the buffer object referenced by given array, if mapped.
+ */
+static void
+unmap_array_buffer(struct gl_context *ctx, struct gl_client_array *array)
+{
+ if (array->Enabled &&
+ _mesa_is_bufferobj(array->BufferObj) &&
+ _mesa_bufferobj_mapped(array->BufferObj)) {
+ ctx->Driver.UnmapBuffer(ctx, GL_ARRAY_BUFFER_ARB, array->BufferObj);
+ }
+}
+
+
+/**
+ * Examine the array's data for NaNs, etc.
+ * For debug purposes; not normally used.
+ */
+static void
+check_draw_elements_data(struct gl_context *ctx, GLsizei count, GLenum elemType,
+ const void *elements, GLint basevertex)
+{
+ struct gl_array_object *arrayObj = ctx->Array.ArrayObj;
+ const void *elemMap;
+ GLint i, k;
+
+ if (_mesa_is_bufferobj(ctx->Array.ElementArrayBufferObj)) {
+ elemMap = ctx->Driver.MapBuffer(ctx,
+ GL_ELEMENT_ARRAY_BUFFER_ARB,
+ GL_READ_ONLY,
+ ctx->Array.ElementArrayBufferObj);
+ elements = ADD_POINTERS(elements, elemMap);
+ }
+
+ for (i = 0; i < count; i++) {
+ GLuint j;
+
+ /* j = element[i] */
+ switch (elemType) {
+ case GL_UNSIGNED_BYTE:
+ j = ((const GLubyte *) elements)[i];
+ break;
+ case GL_UNSIGNED_SHORT:
+ j = ((const GLushort *) elements)[i];
+ break;
+ case GL_UNSIGNED_INT:
+ j = ((const GLuint *) elements)[i];
+ break;
+ default:
+ assert(0);
+ }
+
+ /* check element j of each enabled array */
+ check_array_data(ctx, &arrayObj->Vertex, VERT_ATTRIB_POS, j);
+ check_array_data(ctx, &arrayObj->Normal, VERT_ATTRIB_NORMAL, j);
+ check_array_data(ctx, &arrayObj->Color, VERT_ATTRIB_COLOR0, j);
+ check_array_data(ctx, &arrayObj->SecondaryColor, VERT_ATTRIB_COLOR1, j);
+ for (k = 0; k < Elements(arrayObj->TexCoord); k++) {
+ check_array_data(ctx, &arrayObj->TexCoord[k], VERT_ATTRIB_TEX0 + k, j);
+ }
+ for (k = 0; k < Elements(arrayObj->VertexAttrib); k++) {
+ check_array_data(ctx, &arrayObj->VertexAttrib[k],
+ VERT_ATTRIB_GENERIC0 + k, j);
+ }
+ }
+
+ if (_mesa_is_bufferobj(ctx->Array.ElementArrayBufferObj)) {
+ ctx->Driver.UnmapBuffer(ctx, GL_ELEMENT_ARRAY_BUFFER_ARB,
+ ctx->Array.ElementArrayBufferObj);
+ }
+
+ unmap_array_buffer(ctx, &arrayObj->Vertex);
+ unmap_array_buffer(ctx, &arrayObj->Normal);
+ unmap_array_buffer(ctx, &arrayObj->Color);
+ for (k = 0; k < Elements(arrayObj->TexCoord); k++) {
+ unmap_array_buffer(ctx, &arrayObj->TexCoord[k]);
+ }
+ for (k = 0; k < Elements(arrayObj->VertexAttrib); k++) {
+ unmap_array_buffer(ctx, &arrayObj->VertexAttrib[k]);
+ }
+}
+
+
+/**
+ * Check array data, looking for NaNs, etc.
+ */
+static void
+check_draw_arrays_data(struct gl_context *ctx, GLint start, GLsizei count)
+{
+ /* TO DO */
+}
+
+
+/**
+ * Print info/data for glDrawArrays(), for debugging.
+ */
+static void
+print_draw_arrays(struct gl_context *ctx,
+ GLenum mode, GLint start, GLsizei count)
+{
+ struct vbo_context *vbo = vbo_context(ctx);
+ struct vbo_exec_context *exec = &vbo->exec;
+ int i;
+
+ printf("vbo_exec_DrawArrays(mode 0x%x, start %d, count %d):\n",
+ mode, start, count);
+
+ for (i = 0; i < 32; i++) {
+ GLuint bufName = exec->array.inputs[i]->BufferObj->Name;
+ GLint stride = exec->array.inputs[i]->Stride;
+ printf("attr %2d: size %d stride %d enabled %d "
+ "ptr %p Bufobj %u\n",
+ i,
+ exec->array.inputs[i]->Size,
+ stride,
+ /*exec->array.inputs[i]->Enabled,*/
+ exec->array.legacy_array[i]->Enabled,
+ exec->array.inputs[i]->Ptr,
+ bufName);
+
+ if (bufName) {
+ struct gl_buffer_object *buf = _mesa_lookup_bufferobj(ctx, bufName);
+ GLubyte *p = ctx->Driver.MapBuffer(ctx, GL_ARRAY_BUFFER_ARB,
+ GL_READ_ONLY_ARB, buf);
+ int offset = (int) (GLintptr) exec->array.inputs[i]->Ptr;
+ float *f = (float *) (p + offset);
+ int *k = (int *) f;
+ int i;
+ int n = (count * stride) / 4;
+ if (n > 32)
+ n = 32;
+ printf(" Data at offset %d:\n", offset);
+ for (i = 0; i < n; i++) {
+ printf(" float[%d] = 0x%08x %f\n", i, k[i], f[i]);
+ }
+ ctx->Driver.UnmapBuffer(ctx, GL_ARRAY_BUFFER_ARB, buf);
+ }
+ }
+}
+
+
+/**
+ * Bind the VBO executor to the current vertex array object prior
+ * to drawing.
+ *
+ * Just translate the arrayobj into a sane layout.
+ */
+static void
+bind_array_obj(struct gl_context *ctx)
+{
+ struct vbo_context *vbo = vbo_context(ctx);
+ struct vbo_exec_context *exec = &vbo->exec;
+ struct gl_array_object *arrayObj = ctx->Array.ArrayObj;
+ GLuint i;
+
+ /* TODO: Fix the ArrayObj struct to keep legacy arrays in an array
+ * rather than as individual named arrays. Then this function can
+ * go away.
+ */
+ exec->array.legacy_array[VERT_ATTRIB_POS] = &arrayObj->Vertex;
+ exec->array.legacy_array[VERT_ATTRIB_WEIGHT] = &arrayObj->Weight;
+ exec->array.legacy_array[VERT_ATTRIB_NORMAL] = &arrayObj->Normal;
+ exec->array.legacy_array[VERT_ATTRIB_COLOR0] = &arrayObj->Color;
+ exec->array.legacy_array[VERT_ATTRIB_COLOR1] = &arrayObj->SecondaryColor;
+ exec->array.legacy_array[VERT_ATTRIB_FOG] = &arrayObj->FogCoord;
+ exec->array.legacy_array[VERT_ATTRIB_COLOR_INDEX] = &arrayObj->Index;
+ if (arrayObj->PointSize.Enabled) {
+ /* this aliases COLOR_INDEX */
+ exec->array.legacy_array[VERT_ATTRIB_POINT_SIZE] = &arrayObj->PointSize;
+ }
+ exec->array.legacy_array[VERT_ATTRIB_EDGEFLAG] = &arrayObj->EdgeFlag;
+
+ for (i = 0; i < Elements(arrayObj->TexCoord); i++)
+ exec->array.legacy_array[VERT_ATTRIB_TEX0 + i] = &arrayObj->TexCoord[i];
+
+ for (i = 0; i < Elements(arrayObj->VertexAttrib); i++) {
+ assert(i < Elements(exec->array.generic_array));
+ exec->array.generic_array[i] = &arrayObj->VertexAttrib[i];
+ }
+
+ exec->array.array_obj = arrayObj->Name;
+}
+
+
+/**
+ * Set the vbo->exec->inputs[] pointers to point to the enabled
+ * vertex arrays. This depends on the current vertex program/shader
+ * being executed because of whether or not generic vertex arrays
+ * alias the conventional vertex arrays.
+ * For arrays that aren't enabled, we set the input[attrib] pointer
+ * to point at a zero-stride current value "array".
+ */
+static void
+recalculate_input_bindings(struct gl_context *ctx)
+{
+ struct vbo_context *vbo = vbo_context(ctx);
+ struct vbo_exec_context *exec = &vbo->exec;
+ const struct gl_client_array **inputs = &exec->array.inputs[0];
+ GLbitfield const_inputs = 0x0;
+ GLuint i;
+
+ exec->array.program_mode = get_program_mode(ctx);
+ exec->array.enabled_flags = ctx->Array.ArrayObj->_Enabled;
+
+ switch (exec->array.program_mode) {
+ case VP_NONE:
+ /* When no vertex program is active (or the vertex program is generated
+ * from fixed-function state). We put the material values into the
+ * generic slots. This is the only situation where material values
+ * are available as per-vertex attributes.
+ */
+ for (i = 0; i <= VERT_ATTRIB_TEX7; i++) {
+ if (exec->array.legacy_array[i]->Enabled)
+ inputs[i] = exec->array.legacy_array[i];
+ else {
+ inputs[i] = &vbo->legacy_currval[i];
+ const_inputs |= 1 << i;
+ }
+ }
+
+ for (i = 0; i < MAT_ATTRIB_MAX; i++) {
+ inputs[VERT_ATTRIB_GENERIC0 + i] = &vbo->mat_currval[i];
+ const_inputs |= 1 << (VERT_ATTRIB_GENERIC0 + i);
+ }
+
+ /* Could use just about anything, just to fill in the empty
+ * slots:
+ */
+ for (i = MAT_ATTRIB_MAX; i < VERT_ATTRIB_MAX - VERT_ATTRIB_GENERIC0; i++) {
+ inputs[VERT_ATTRIB_GENERIC0 + i] = &vbo->generic_currval[i];
+ const_inputs |= 1 << (VERT_ATTRIB_GENERIC0 + i);
+ }
+
+ /* There is no need to make _NEW_ARRAY dirty here for the TnL program,
+ * because it already takes care of invalidating the state necessary
+ * to revalidate vertex arrays. Not marking the state as dirty also
+ * improves performance (quite significantly in some apps).
+ */
+ if (!ctx->VertexProgram._MaintainTnlProgram)
+ ctx->NewState |= _NEW_ARRAY;
+ break;
+
+ case VP_NV:
+ /* NV_vertex_program - attribute arrays alias and override
+ * conventional, legacy arrays. No materials, and the generic
+ * slots are vacant.
+ */
+ for (i = 0; i <= VERT_ATTRIB_TEX7; i++) {
+ if (exec->array.generic_array[i]->Enabled)
+ inputs[i] = exec->array.generic_array[i];
+ else if (exec->array.legacy_array[i]->Enabled)
+ inputs[i] = exec->array.legacy_array[i];
+ else {
+ inputs[i] = &vbo->legacy_currval[i];
+ const_inputs |= 1 << i;
+ }
+ }
+
+ /* Could use just about anything, just to fill in the empty
+ * slots:
+ */
+ for (i = VERT_ATTRIB_GENERIC0; i < VERT_ATTRIB_MAX; i++) {
+ inputs[i] = &vbo->generic_currval[i - VERT_ATTRIB_GENERIC0];
+ const_inputs |= 1 << i;
+ }
+
+ ctx->NewState |= _NEW_ARRAY;
+ break;
+
+ case VP_ARB:
+ /* GL_ARB_vertex_program or GLSL vertex shader - Only the generic[0]
+ * attribute array aliases and overrides the legacy position array.
+ *
+ * Otherwise, legacy attributes available in the legacy slots,
+ * generic attributes in the generic slots and materials are not
+ * available as per-vertex attributes.
+ */
+ if (exec->array.generic_array[0]->Enabled)
+ inputs[0] = exec->array.generic_array[0];
+ else if (exec->array.legacy_array[0]->Enabled)
+ inputs[0] = exec->array.legacy_array[0];
+ else {
+ inputs[0] = &vbo->legacy_currval[0];
+ const_inputs |= 1 << 0;
+ }
+
+ for (i = 1; i <= VERT_ATTRIB_TEX7; i++) {
+ if (exec->array.legacy_array[i]->Enabled)
+ inputs[i] = exec->array.legacy_array[i];
+ else {
+ inputs[i] = &vbo->legacy_currval[i];
+ const_inputs |= 1 << i;
+ }
+ }
+
+ for (i = 0; i < MAX_VERTEX_GENERIC_ATTRIBS; i++) {
+ if (exec->array.generic_array[i]->Enabled)
+ inputs[VERT_ATTRIB_GENERIC0 + i] = exec->array.generic_array[i];
+ else {
+ inputs[VERT_ATTRIB_GENERIC0 + i] = &vbo->generic_currval[i];
+ const_inputs |= 1 << (VERT_ATTRIB_GENERIC0 + i);
+ }
+ }
+
+ ctx->NewState |= _NEW_ARRAY;
+ break;
+ }
+
+ _mesa_set_varying_vp_inputs( ctx, ~const_inputs );
+}
+
+
+/**
+ * Examine the enabled vertex arrays to set the exec->array.inputs[] values.
+ * These will point to the arrays to actually use for drawing. Some will
+ * be user-provided arrays, other will be zero-stride const-valued arrays.
+ * Note that this might set the _NEW_ARRAY dirty flag so state validation
+ * must be done after this call.
+ */
+static void
+bind_arrays(struct gl_context *ctx)
+{
+ if (!ctx->Array.RebindArrays) {
+ return;
+ }
+
+ bind_array_obj(ctx);
+ recalculate_input_bindings(ctx);
+ ctx->Array.RebindArrays = GL_FALSE;
+}
+
+
+/**
+ * Helper function called by the other DrawArrays() functions below.
+ * This is where we handle primitive restart for drawing non-indexed
+ * arrays. If primitive restart is enabled, it typically means
+ * splitting one DrawArrays() into two.
+ */
+static void
+vbo_draw_arrays(struct gl_context *ctx, GLenum mode, GLint start,
+ GLsizei count, GLuint numInstances)
+{
+ struct vbo_context *vbo = vbo_context(ctx);
+ struct vbo_exec_context *exec = &vbo->exec;
+ struct _mesa_prim prim[2];
+
+ bind_arrays(ctx);
+
+ /* Again... because we may have changed the bitmask of per-vertex varying
+ * attributes. If we regenerate the fixed-function vertex program now
+ * we may be able to prune down the number of vertex attributes which we
+ * need in the shader.
+ */
+ if (ctx->NewState)
+ _mesa_update_state(ctx);
+
+ /* init most fields to zero */
+ memset(prim, 0, sizeof(prim));
+ prim[0].begin = 1;
+ prim[0].end = 1;
+ prim[0].mode = mode;
+ prim[0].num_instances = numInstances;
+
+ /* Implement the primitive restart index */
+ if (ctx->Array.PrimitiveRestart && ctx->Array.RestartIndex < count) {
+ GLuint primCount = 0;
+
+ if (ctx->Array.RestartIndex == start) {
+ /* special case: RestartIndex at beginning */
+ if (count > 1) {
+ prim[0].start = start + 1;
+ prim[0].count = count - 1;
+ primCount = 1;
+ }
+ }
+ else if (ctx->Array.RestartIndex == start + count - 1) {
+ /* special case: RestartIndex at end */
+ if (count > 1) {
+ prim[0].start = start;
+ prim[0].count = count - 1;
+ primCount = 1;
+ }
+ }
+ else {
+ /* general case: RestartIndex in middle, split into two prims */
+ prim[0].start = start;
+ prim[0].count = ctx->Array.RestartIndex - start;
+
+ prim[1] = prim[0];
+ prim[1].start = ctx->Array.RestartIndex + 1;
+ prim[1].count = count - prim[1].start;
+
+ primCount = 2;
+ }
+
+ if (primCount > 0) {
+ /* draw one or two prims */
+ check_buffers_are_unmapped(exec->array.inputs);
+ vbo->draw_prims(ctx, exec->array.inputs, prim, primCount, NULL,
+ GL_TRUE, start, start + count - 1);
+ }
+ }
+ else {
+ /* no prim restart */
+ prim[0].start = start;
+ prim[0].count = count;
+
+ check_buffers_are_unmapped(exec->array.inputs);
+ vbo->draw_prims(ctx, exec->array.inputs, prim, 1, NULL,
+ GL_TRUE, start, start + count - 1);
+ }
+}
+
+
+
+/**
+ * Called from glDrawArrays when in immediate mode (not display list mode).
+ */
+static void GLAPIENTRY
+vbo_exec_DrawArrays(GLenum mode, GLint start, GLsizei count)
+{
+ GET_CURRENT_CONTEXT(ctx);
+
+ if (MESA_VERBOSE & VERBOSE_DRAW)
+ _mesa_debug(ctx, "glDrawArrays(%s, %d, %d)\n",
+ _mesa_lookup_enum_by_nr(mode), start, count);
+
+ if (!_mesa_validate_DrawArrays( ctx, mode, start, count ))
+ return;
+
+ FLUSH_CURRENT( ctx, 0 );
+
+ if (!_mesa_valid_to_render(ctx, "glDrawArrays")) {
+ return;
+ }
+
+ if (0)
+ check_draw_arrays_data(ctx, start, count);
+
+ vbo_draw_arrays(ctx, mode, start, count, 1);
+
+ if (0)
+ print_draw_arrays(ctx, mode, start, count);
+}
+
+
+/**
+ * Called from glDrawArraysInstanced when in immediate mode (not
+ * display list mode).
+ */
+static void GLAPIENTRY
+vbo_exec_DrawArraysInstanced(GLenum mode, GLint start, GLsizei count,
+ GLsizei numInstances)
+{
+ GET_CURRENT_CONTEXT(ctx);
+
+ if (MESA_VERBOSE & VERBOSE_DRAW)
+ _mesa_debug(ctx, "glDrawArraysInstanced(%s, %d, %d, %d)\n",
+ _mesa_lookup_enum_by_nr(mode), start, count, numInstances);
+
+ if (!_mesa_validate_DrawArraysInstanced(ctx, mode, start, count, numInstances))
+ return;
+
+ FLUSH_CURRENT( ctx, 0 );
+
+ if (!_mesa_valid_to_render(ctx, "glDrawArraysInstanced")) {
+ return;
+ }
+
+ if (0)
+ check_draw_arrays_data(ctx, start, count);
+
+ vbo_draw_arrays(ctx, mode, start, count, numInstances);
+
+ if (0)
+ print_draw_arrays(ctx, mode, start, count);
+}
+
+
+/**
+ * Map GL_ELEMENT_ARRAY_BUFFER and print contents.
+ * For debugging.
+ */
+static void
+dump_element_buffer(struct gl_context *ctx, GLenum type)
+{
+ const GLvoid *map = ctx->Driver.MapBuffer(ctx,
+ GL_ELEMENT_ARRAY_BUFFER_ARB,
+ GL_READ_ONLY,
+ ctx->Array.ElementArrayBufferObj);
+ switch (type) {
+ case GL_UNSIGNED_BYTE:
+ {
+ const GLubyte *us = (const GLubyte *) map;
+ GLint i;
+ for (i = 0; i < ctx->Array.ElementArrayBufferObj->Size; i++) {
+ printf("%02x ", us[i]);
+ if (i % 32 == 31)
+ printf("\n");
+ }
+ printf("\n");
+ }
+ break;
+ case GL_UNSIGNED_SHORT:
+ {
+ const GLushort *us = (const GLushort *) map;
+ GLint i;
+ for (i = 0; i < ctx->Array.ElementArrayBufferObj->Size / 2; i++) {
+ printf("%04x ", us[i]);
+ if (i % 16 == 15)
+ printf("\n");
+ }
+ printf("\n");
+ }
+ break;
+ case GL_UNSIGNED_INT:
+ {
+ const GLuint *us = (const GLuint *) map;
+ GLint i;
+ for (i = 0; i < ctx->Array.ElementArrayBufferObj->Size / 4; i++) {
+ printf("%08x ", us[i]);
+ if (i % 8 == 7)
+ printf("\n");
+ }
+ printf("\n");
+ }
+ break;
+ default:
+ ;
+ }
+
+ ctx->Driver.UnmapBuffer(ctx, GL_ELEMENT_ARRAY_BUFFER_ARB,
+ ctx->Array.ElementArrayBufferObj);
+}
+
+
+/**
+ * Inner support for both _mesa_DrawElements and _mesa_DrawRangeElements.
+ * Do the rendering for a glDrawElements or glDrawRangeElements call after
+ * we've validated buffer bounds, etc.
+ */
+static void
+vbo_validated_drawrangeelements(struct gl_context *ctx, GLenum mode,
+ GLboolean index_bounds_valid,
+ GLuint start, GLuint end,
+ GLsizei count, GLenum type,
+ const GLvoid *indices,
+ GLint basevertex, GLint numInstances)
+{
+ struct vbo_context *vbo = vbo_context(ctx);
+ struct vbo_exec_context *exec = &vbo->exec;
+ struct _mesa_index_buffer ib;
+ struct _mesa_prim prim[1];
+
+ FLUSH_CURRENT( ctx, 0 );
+
+ if (!_mesa_valid_to_render(ctx, "glDraw[Range]Elements")) {
+ return;
+ }
+
+ bind_arrays( ctx );
+
+ /* check for dirty state again */
+ if (ctx->NewState)
+ _mesa_update_state( ctx );
+
+ ib.count = count;
+ ib.type = type;
+ ib.obj = ctx->Array.ElementArrayBufferObj;
+ ib.ptr = indices;
+
+ prim[0].begin = 1;
+ prim[0].end = 1;
+ prim[0].weak = 0;
+ prim[0].pad = 0;
+ prim[0].mode = mode;
+ prim[0].start = 0;
+ prim[0].count = count;
+ prim[0].indexed = 1;
+ prim[0].basevertex = basevertex;
+ prim[0].num_instances = numInstances;
+
+ /* Need to give special consideration to rendering a range of
+ * indices starting somewhere above zero. Typically the
+ * application is issuing multiple DrawRangeElements() to draw
+ * successive primitives layed out linearly in the vertex arrays.
+ * Unless the vertex arrays are all in a VBO (or locked as with
+ * CVA), the OpenGL semantics imply that we need to re-read or
+ * re-upload the vertex data on each draw call.
+ *
+ * In the case of hardware tnl, we want to avoid starting the
+ * upload at zero, as it will mean every draw call uploads an
+ * increasing amount of not-used vertex data. Worse - in the
+ * software tnl module, all those vertices might be transformed and
+ * lit but never rendered.
+ *
+ * If we just upload or transform the vertices in start..end,
+ * however, the indices will be incorrect.
+ *
+ * At this level, we don't know exactly what the requirements of
+ * the backend are going to be, though it will likely boil down to
+ * either:
+ *
+ * 1) Do nothing, everything is in a VBO and is processed once
+ * only.
+ *
+ * 2) Adjust the indices and vertex arrays so that start becomes
+ * zero.
+ *
+ * Rather than doing anything here, I'll provide a helper function
+ * for the latter case elsewhere.
+ */
+
+ check_buffers_are_unmapped(exec->array.inputs);
+ vbo->draw_prims( ctx, exec->array.inputs, prim, 1, &ib,
+ index_bounds_valid, start, end );
+}
+
+
+/**
+ * Called by glDrawRangeElementsBaseVertex() in immediate mode.
+ */
+static void GLAPIENTRY
+vbo_exec_DrawRangeElementsBaseVertex(GLenum mode,
+ GLuint start, GLuint end,
+ GLsizei count, GLenum type,
+ const GLvoid *indices,
+ GLint basevertex)
+{
+ static GLuint warnCount = 0;
+ GET_CURRENT_CONTEXT(ctx);
+
+ if (MESA_VERBOSE & VERBOSE_DRAW)
+ _mesa_debug(ctx,
+ "glDrawRangeElementsBaseVertex(%s, %u, %u, %d, %s, %p, %d)\n",
+ _mesa_lookup_enum_by_nr(mode), start, end, count,
+ _mesa_lookup_enum_by_nr(type), indices, basevertex);
+
+ if (!_mesa_validate_DrawRangeElements( ctx, mode, start, end, count,
+ type, indices, basevertex ))
+ return;
+
+ /* NOTE: It's important that 'end' is a reasonable value.
+ * in _tnl_draw_prims(), we use end to determine how many vertices
+ * to transform. If it's too large, we can unnecessarily split prims
+ * or we can read/write out of memory in several different places!
+ */
+
+ /* Catch/fix some potential user errors */
+ if (type == GL_UNSIGNED_BYTE) {
+ start = MIN2(start, 0xff);
+ end = MIN2(end, 0xff);
+ }
+ else if (type == GL_UNSIGNED_SHORT) {
+ start = MIN2(start, 0xffff);
+ end = MIN2(end, 0xffff);
+ }
+
+ if (end >= ctx->Array.ArrayObj->_MaxElement) {
+ /* the max element is out of bounds of one or more enabled arrays */
+ warnCount++;
+
+ if (warnCount < 10) {
+ _mesa_warning(ctx, "glDraw[Range]Elements(start %u, end %u, count %d, "
+ "type 0x%x, indices=%p)\n"
+ "\tend is out of bounds (max=%u) "
+ "Element Buffer %u (size %d)\n"
+ "\tThis should probably be fixed in the application.",
+ start, end, count, type, indices,
+ ctx->Array.ArrayObj->_MaxElement - 1,
+ ctx->Array.ElementArrayBufferObj->Name,
+ (int) ctx->Array.ElementArrayBufferObj->Size);
+ }
+
+ if (0)
+ dump_element_buffer(ctx, type);
+
+ if (0)
+ _mesa_print_arrays(ctx);
+
+#ifdef DEBUG
+ /* 'end' was out of bounds, but now let's check the actual array
+ * indexes to see if any of them are out of bounds.
+ */
+ {
+ GLuint max = _mesa_max_buffer_index(ctx, count, type, indices,
+ ctx->Array.ElementArrayBufferObj);
+ if (max >= ctx->Array.ArrayObj->_MaxElement) {
+ if (warnCount < 10) {
+ _mesa_warning(ctx, "glDraw[Range]Elements(start %u, end %u, "
+ "count %d, type 0x%x, indices=%p)\n"
+ "\tindex=%u is out of bounds (max=%u) "
+ "Element Buffer %u (size %d)\n"
+ "\tSkipping the glDrawRangeElements() call",
+ start, end, count, type, indices, max,
+ ctx->Array.ArrayObj->_MaxElement - 1,
+ ctx->Array.ElementArrayBufferObj->Name,
+ (int) ctx->Array.ElementArrayBufferObj->Size);
+ }
+ }
+ /* XXX we could also find the min index and compare to 'start'
+ * to see if start is correct. But it's more likely to get the
+ * upper bound wrong.
+ */
+ }
+#endif
+
+ /* Set 'end' to the max possible legal value */
+ assert(ctx->Array.ArrayObj->_MaxElement >= 1);
+ end = ctx->Array.ArrayObj->_MaxElement - 1;
+
+ if (end < start) {
+ return;
+ }
+ }
+
+ if (0) {
+ printf("glDraw[Range]Elements{,BaseVertex}"
+ "(start %u, end %u, type 0x%x, count %d) ElemBuf %u, "
+ "base %d\n",
+ start, end, type, count,
+ ctx->Array.ElementArrayBufferObj->Name,
+ basevertex);
+ }
+
+#if 0
+ check_draw_elements_data(ctx, count, type, indices);
+#else
+ (void) check_draw_elements_data;
+#endif
+
+ vbo_validated_drawrangeelements(ctx, mode, GL_TRUE, start, end,
+ count, type, indices, basevertex, 1);
+}
+
+
+/**
+ * Called by glDrawRangeElements() in immediate mode.
+ */
+static void GLAPIENTRY
+vbo_exec_DrawRangeElements(GLenum mode, GLuint start, GLuint end,
+ GLsizei count, GLenum type, const GLvoid *indices)
+{
+ GET_CURRENT_CONTEXT(ctx);
+
+ if (MESA_VERBOSE & VERBOSE_DRAW)
+ _mesa_debug(ctx,
+ "glDrawRangeElements(%s, %u, %u, %d, %s, %p)\n",
+ _mesa_lookup_enum_by_nr(mode), start, end, count,
+ _mesa_lookup_enum_by_nr(type), indices);
+
+ vbo_exec_DrawRangeElementsBaseVertex(mode, start, end, count, type,
+ indices, 0);
+}
+
+
+/**
+ * Called by glDrawElements() in immediate mode.
+ */
+static void GLAPIENTRY
+vbo_exec_DrawElements(GLenum mode, GLsizei count, GLenum type,
+ const GLvoid *indices)
+{
+ GET_CURRENT_CONTEXT(ctx);
+
+ if (MESA_VERBOSE & VERBOSE_DRAW)
+ _mesa_debug(ctx, "glDrawElements(%s, %u, %s, %p)\n",
+ _mesa_lookup_enum_by_nr(mode), count,
+ _mesa_lookup_enum_by_nr(type), indices);
+
+ if (!_mesa_validate_DrawElements( ctx, mode, count, type, indices, 0 ))
+ return;
+
+ vbo_validated_drawrangeelements(ctx, mode, GL_FALSE, ~0, ~0,
+ count, type, indices, 0, 1);
+}
+
+
+/**
+ * Called by glDrawElementsBaseVertex() in immediate mode.
+ */
+static void GLAPIENTRY
+vbo_exec_DrawElementsBaseVertex(GLenum mode, GLsizei count, GLenum type,
+ const GLvoid *indices, GLint basevertex)
+{
+ GET_CURRENT_CONTEXT(ctx);
+
+ if (MESA_VERBOSE & VERBOSE_DRAW)
+ _mesa_debug(ctx, "glDrawElementsBaseVertex(%s, %d, %s, %p, %d)\n",
+ _mesa_lookup_enum_by_nr(mode), count,
+ _mesa_lookup_enum_by_nr(type), indices, basevertex);
+
+ if (!_mesa_validate_DrawElements( ctx, mode, count, type, indices,
+ basevertex ))
+ return;
+
+ vbo_validated_drawrangeelements(ctx, mode, GL_FALSE, ~0, ~0,
+ count, type, indices, basevertex, 1);
+}
+
+
+/**
+ * Called by glDrawElementsInstanced() in immediate mode.
+ */
+static void GLAPIENTRY
+vbo_exec_DrawElementsInstanced(GLenum mode, GLsizei count, GLenum type,
+ const GLvoid *indices, GLsizei numInstances)
+{
+ GET_CURRENT_CONTEXT(ctx);
+
+ if (MESA_VERBOSE & VERBOSE_DRAW)
+ _mesa_debug(ctx, "glDrawElementsInstanced(%s, %d, %s, %p, %d)\n",
+ _mesa_lookup_enum_by_nr(mode), count,
+ _mesa_lookup_enum_by_nr(type), indices, numInstances);
+
+ if (!_mesa_validate_DrawElementsInstanced(ctx, mode, count, type, indices,
+ numInstances))
+ return;
+
+ vbo_validated_drawrangeelements(ctx, mode, GL_FALSE, ~0, ~0,
+ count, type, indices, 0, numInstances);
+}
+
+
+/**
+ * Inner support for both _mesa_MultiDrawElements() and
+ * _mesa_MultiDrawRangeElements().
+ * This does the actual rendering after we've checked array indexes, etc.
+ */
+static void
+vbo_validated_multidrawelements(struct gl_context *ctx, GLenum mode,
+ const GLsizei *count, GLenum type,
+ const GLvoid **indices, GLsizei primcount,
+ const GLint *basevertex)
+{
+ struct vbo_context *vbo = vbo_context(ctx);
+ struct vbo_exec_context *exec = &vbo->exec;
+ struct _mesa_index_buffer ib;
+ struct _mesa_prim *prim;
+ unsigned int index_type_size = 0;
+ uintptr_t min_index_ptr, max_index_ptr;
+ GLboolean fallback = GL_FALSE;
+ int i;
+
+ if (primcount == 0)
+ return;
+
+ FLUSH_CURRENT( ctx, 0 );
+
+ if (!_mesa_valid_to_render(ctx, "glMultiDrawElements")) {
+ return;
+ }
+
+ prim = calloc(1, primcount * sizeof(*prim));
+ if (prim == NULL) {
+ _mesa_error(ctx, GL_OUT_OF_MEMORY, "glMultiDrawElements");
+ return;
+ }
+
+ /* Decide if we can do this all as one set of primitives sharing the
+ * same index buffer, or if we have to reset the index pointer per
+ * primitive.
+ */
+ bind_arrays( ctx );
+
+ /* check for dirty state again */
+ if (ctx->NewState)
+ _mesa_update_state( ctx );
+
+ switch (type) {
+ case GL_UNSIGNED_INT:
+ index_type_size = 4;
+ break;
+ case GL_UNSIGNED_SHORT:
+ index_type_size = 2;
+ break;
+ case GL_UNSIGNED_BYTE:
+ index_type_size = 1;
+ break;
+ default:
+ assert(0);
+ }
+
+ min_index_ptr = (uintptr_t)indices[0];
+ max_index_ptr = 0;
+ for (i = 0; i < primcount; i++) {
+ min_index_ptr = MIN2(min_index_ptr, (uintptr_t)indices[i]);
+ max_index_ptr = MAX2(max_index_ptr, (uintptr_t)indices[i] +
+ index_type_size * count[i]);
+ }
+
+ /* Check if we can handle this thing as a bunch of index offsets from the
+ * same index pointer. If we can't, then we have to fall back to doing
+ * a draw_prims per primitive.
+ * Check that the difference between each prim's indexes is a multiple of
+ * the index/element size.
+ */
+ if (index_type_size != 1) {
+ for (i = 0; i < primcount; i++) {
+ if ((((uintptr_t)indices[i] - min_index_ptr) % index_type_size) != 0) {
+ fallback = GL_TRUE;
+ break;
+ }
+ }
+ }
+
+ /* If the index buffer isn't in a VBO, then treating the application's
+ * subranges of the index buffer as one large index buffer may lead to
+ * us reading unmapped memory.
+ */
+ if (!_mesa_is_bufferobj(ctx->Array.ElementArrayBufferObj))
+ fallback = GL_TRUE;
+
+ if (!fallback) {
+ ib.count = (max_index_ptr - min_index_ptr) / index_type_size;
+ ib.type = type;
+ ib.obj = ctx->Array.ElementArrayBufferObj;
+ ib.ptr = (void *)min_index_ptr;
+
+ for (i = 0; i < primcount; i++) {
+ prim[i].begin = (i == 0);
+ prim[i].end = (i == primcount - 1);
+ prim[i].weak = 0;
+ prim[i].pad = 0;
+ prim[i].mode = mode;
+ prim[i].start = ((uintptr_t)indices[i] - min_index_ptr) / index_type_size;
+ prim[i].count = count[i];
+ prim[i].indexed = 1;
+ prim[i].num_instances = 1;
+ if (basevertex != NULL)
+ prim[i].basevertex = basevertex[i];
+ else
+ prim[i].basevertex = 0;
+ }
+
+ check_buffers_are_unmapped(exec->array.inputs);
+ vbo->draw_prims(ctx, exec->array.inputs, prim, primcount, &ib,
+ GL_FALSE, ~0, ~0);
+ } else {
+ /* render one prim at a time */
+ for (i = 0; i < primcount; i++) {
+ ib.count = count[i];
+ ib.type = type;
+ ib.obj = ctx->Array.ElementArrayBufferObj;
+ ib.ptr = indices[i];
+
+ prim[0].begin = 1;
+ prim[0].end = 1;
+ prim[0].weak = 0;
+ prim[0].pad = 0;
+ prim[0].mode = mode;
+ prim[0].start = 0;
+ prim[0].count = count[i];
+ prim[0].indexed = 1;
+ prim[0].num_instances = 1;
+ if (basevertex != NULL)
+ prim[0].basevertex = basevertex[i];
+ else
+ prim[0].basevertex = 0;
+
+ check_buffers_are_unmapped(exec->array.inputs);
+ vbo->draw_prims(ctx, exec->array.inputs, prim, 1, &ib,
+ GL_FALSE, ~0, ~0);
+ }
+ }
+
+ free(prim);
+}
+
+
+static void GLAPIENTRY
+vbo_exec_MultiDrawElements(GLenum mode,
+ const GLsizei *count, GLenum type,
+ const GLvoid **indices,
+ GLsizei primcount)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ GLint i;
+
+ ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
+
+ for (i = 0; i < primcount; i++) {
+ if (!_mesa_validate_DrawElements(ctx, mode, count[i], type, indices[i],
+ 0))
+ return;
+ }
+
+ vbo_validated_multidrawelements(ctx, mode, count, type, indices, primcount,
+ NULL);
+}
+
+
+static void GLAPIENTRY
+vbo_exec_MultiDrawElementsBaseVertex(GLenum mode,
+ const GLsizei *count, GLenum type,
+ const GLvoid **indices,
+ GLsizei primcount,
+ const GLsizei *basevertex)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ GLint i;
+
+ ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
+
+ for (i = 0; i < primcount; i++) {
+ if (!_mesa_validate_DrawElements(ctx, mode, count[i], type, indices[i],
+ basevertex[i]))
+ return;
+ }
+
+ vbo_validated_multidrawelements(ctx, mode, count, type, indices, primcount,
+ basevertex);
+}
+
+
+/**
+ * Plug in the immediate-mode vertex array drawing commands into the
+ * givven vbo_exec_context object.
+ */
+void
+vbo_exec_array_init( struct vbo_exec_context *exec )
+{
+ exec->vtxfmt.DrawArrays = vbo_exec_DrawArrays;
+ exec->vtxfmt.DrawElements = vbo_exec_DrawElements;
+ exec->vtxfmt.DrawRangeElements = vbo_exec_DrawRangeElements;
+ exec->vtxfmt.MultiDrawElementsEXT = vbo_exec_MultiDrawElements;
+ exec->vtxfmt.DrawElementsBaseVertex = vbo_exec_DrawElementsBaseVertex;
+ exec->vtxfmt.DrawRangeElementsBaseVertex = vbo_exec_DrawRangeElementsBaseVertex;
+ exec->vtxfmt.MultiDrawElementsBaseVertex = vbo_exec_MultiDrawElementsBaseVertex;
+ exec->vtxfmt.DrawArraysInstanced = vbo_exec_DrawArraysInstanced;
+ exec->vtxfmt.DrawElementsInstanced = vbo_exec_DrawElementsInstanced;
+}
+
+
+void
+vbo_exec_array_destroy( struct vbo_exec_context *exec )
+{
+ /* nothing to do */
+}
+
+
+
+/**
+ * The following functions are only used for OpenGL ES 1/2 support.
+ * And some aren't even supported (yet) in ES 1/2.
+ */
+
+
+void GLAPIENTRY
+_mesa_DrawArrays(GLenum mode, GLint first, GLsizei count)
+{
+ vbo_exec_DrawArrays(mode, first, count);
+}
+
+
+void GLAPIENTRY
+_mesa_DrawElements(GLenum mode, GLsizei count, GLenum type,
+ const GLvoid *indices)
+{
+ vbo_exec_DrawElements(mode, count, type, indices);
+}
+
+
+void GLAPIENTRY
+_mesa_DrawElementsBaseVertex(GLenum mode, GLsizei count, GLenum type,
+ const GLvoid *indices, GLint basevertex)
+{
+ vbo_exec_DrawElementsBaseVertex(mode, count, type, indices, basevertex);
+}
+
+
+void GLAPIENTRY
+_mesa_DrawRangeElements(GLenum mode, GLuint start, GLuint end, GLsizei count,
+ GLenum type, const GLvoid *indices)
+{
+ vbo_exec_DrawRangeElements(mode, start, end, count, type, indices);
+}
+
+
+void GLAPIENTRY
+_mesa_DrawRangeElementsBaseVertex(GLenum mode, GLuint start, GLuint end,
+ GLsizei count, GLenum type,
+ const GLvoid *indices, GLint basevertex)
+{
+ vbo_exec_DrawRangeElementsBaseVertex(mode, start, end, count, type,
+ indices, basevertex);
+}
+
+
+void GLAPIENTRY
+_mesa_MultiDrawElementsEXT(GLenum mode, const GLsizei *count, GLenum type,
+ const GLvoid **indices, GLsizei primcount)
+{
+ vbo_exec_MultiDrawElements(mode, count, type, indices, primcount);
+}
+
+
+void GLAPIENTRY
+_mesa_MultiDrawElementsBaseVertex(GLenum mode,
+ const GLsizei *count, GLenum type,
+ const GLvoid **indices, GLsizei primcount,
+ const GLint *basevertex)
+{
+ vbo_exec_MultiDrawElementsBaseVertex(mode, count, type, indices,
+ primcount, basevertex);
+}
diff --git a/mesalib/src/mesa/vbo/vbo_save_api.c b/mesalib/src/mesa/vbo/vbo_save_api.c
index 836c76fe8..52418788d 100644
--- a/mesalib/src/mesa/vbo/vbo_save_api.c
+++ b/mesalib/src/mesa/vbo/vbo_save_api.c
@@ -1,1310 +1,1310 @@
-/**************************************************************************
-
-Copyright 2002-2008 Tungsten Graphics Inc., Cedar Park, Texas.
-
-All Rights Reserved.
-
-Permission is hereby granted, free of charge, to any person obtaining a
-copy of this software and associated documentation files (the "Software"),
-to deal in the Software without restriction, including without limitation
-on the rights to use, copy, modify, merge, publish, distribute, sub
-license, and/or sell copies of the Software, and to permit persons to whom
-the Software is furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice (including the next
-paragraph) shall be included in all copies or substantial portions of the
-Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
-TUNGSTEN GRAPHICS AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
-DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
-OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
-USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-**************************************************************************/
-
-/*
- * Authors:
- * Keith Whitwell <keith@tungstengraphics.com>
- */
-
-
-
-/* Display list compiler attempts to store lists of vertices with the
- * same vertex layout. Additionally it attempts to minimize the need
- * for execute-time fixup of these vertex lists, allowing them to be
- * cached on hardware.
- *
- * There are still some circumstances where this can be thwarted, for
- * example by building a list that consists of one very long primitive
- * (eg Begin(Triangles), 1000 vertices, End), and calling that list
- * from inside a different begin/end object (Begin(Lines), CallList,
- * End).
- *
- * In that case the code will have to replay the list as individual
- * commands through the Exec dispatch table, or fix up the copied
- * vertices at execute-time.
- *
- * The other case where fixup is required is when a vertex attribute
- * is introduced in the middle of a primitive. Eg:
- * Begin(Lines)
- * TexCoord1f() Vertex2f()
- * TexCoord1f() Color3f() Vertex2f()
- * End()
- *
- * If the current value of Color isn't known at compile-time, this
- * primitive will require fixup.
- *
- *
- * The list compiler currently doesn't attempt to compile lists
- * containing EvalCoord or EvalPoint commands. On encountering one of
- * these, compilation falls back to opcodes.
- *
- * This could be improved to fallback only when a mix of EvalCoord and
- * Vertex commands are issued within a single primitive.
- */
-
-
-#include "main/glheader.h"
-#include "main/bufferobj.h"
-#include "main/context.h"
-#include "main/dlist.h"
-#include "main/enums.h"
-#include "main/eval.h"
-#include "main/macros.h"
-#include "main/mfeatures.h"
-#include "main/api_noop.h"
-#include "main/api_validate.h"
-#include "main/api_arrayelt.h"
-#include "main/vtxfmt.h"
-#include "main/dispatch.h"
-
-#include "vbo_context.h"
-
-
-#if FEATURE_dlist
-
-
-#ifdef ERROR
-#undef ERROR
-#endif
-
-
-/* An interesting VBO number/name to help with debugging */
-#define VBO_BUF_ID 12345
-
-
-/*
- * NOTE: Old 'parity' issue is gone, but copying can still be
- * wrong-footed on replay.
- */
-static GLuint _save_copy_vertices( struct gl_context *ctx,
- const struct vbo_save_vertex_list *node,
- const GLfloat *src_buffer)
-{
- struct vbo_save_context *save = &vbo_context( ctx )->save;
- const struct _mesa_prim *prim = &node->prim[node->prim_count-1];
- GLuint nr = prim->count;
- GLuint sz = save->vertex_size;
- const GLfloat *src = src_buffer + prim->start * sz;
- GLfloat *dst = save->copied.buffer;
- GLuint ovf, i;
-
- if (prim->end)
- return 0;
-
- switch( prim->mode )
- {
- case GL_POINTS:
- return 0;
- case GL_LINES:
- ovf = nr&1;
- for (i = 0 ; i < ovf ; i++)
- memcpy( dst+i*sz, src+(nr-ovf+i)*sz, sz*sizeof(GLfloat) );
- return i;
- case GL_TRIANGLES:
- ovf = nr%3;
- for (i = 0 ; i < ovf ; i++)
- memcpy( dst+i*sz, src+(nr-ovf+i)*sz, sz*sizeof(GLfloat) );
- return i;
- case GL_QUADS:
- ovf = nr&3;
- for (i = 0 ; i < ovf ; i++)
- memcpy( dst+i*sz, src+(nr-ovf+i)*sz, sz*sizeof(GLfloat) );
- return i;
- case GL_LINE_STRIP:
- if (nr == 0)
- return 0;
- else {
- memcpy( dst, src+(nr-1)*sz, sz*sizeof(GLfloat) );
- return 1;
- }
- case GL_LINE_LOOP:
- case GL_TRIANGLE_FAN:
- case GL_POLYGON:
- if (nr == 0)
- return 0;
- else if (nr == 1) {
- memcpy( dst, src+0, sz*sizeof(GLfloat) );
- return 1;
- } else {
- memcpy( dst, src+0, sz*sizeof(GLfloat) );
- memcpy( dst+sz, src+(nr-1)*sz, sz*sizeof(GLfloat) );
- return 2;
- }
- case GL_TRIANGLE_STRIP:
- case GL_QUAD_STRIP:
- switch (nr) {
- case 0: ovf = 0; break;
- case 1: ovf = 1; break;
- default: ovf = 2 + (nr&1); break;
- }
- for (i = 0 ; i < ovf ; i++)
- memcpy( dst+i*sz, src+(nr-ovf+i)*sz, sz*sizeof(GLfloat) );
- return i;
- default:
- assert(0);
- return 0;
- }
-}
-
-
-static struct vbo_save_vertex_store *alloc_vertex_store( struct gl_context *ctx )
-{
- struct vbo_save_vertex_store *vertex_store = CALLOC_STRUCT(vbo_save_vertex_store);
-
- /* obj->Name needs to be non-zero, but won't ever be examined more
- * closely than that. In particular these buffers won't be entered
- * into the hash and can never be confused with ones visible to the
- * user. Perhaps there could be a special number for internal
- * buffers:
- */
- vertex_store->bufferobj = ctx->Driver.NewBufferObject(ctx,
- VBO_BUF_ID,
- GL_ARRAY_BUFFER_ARB);
-
- ctx->Driver.BufferData( ctx,
- GL_ARRAY_BUFFER_ARB,
- VBO_SAVE_BUFFER_SIZE * sizeof(GLfloat),
- NULL,
- GL_STATIC_DRAW_ARB,
- vertex_store->bufferobj);
-
- vertex_store->buffer = NULL;
- vertex_store->used = 0;
- vertex_store->refcount = 1;
-
- return vertex_store;
-}
-
-static void free_vertex_store( struct gl_context *ctx, struct vbo_save_vertex_store *vertex_store )
-{
- assert(!vertex_store->buffer);
-
- if (vertex_store->bufferobj) {
- _mesa_reference_buffer_object(ctx, &vertex_store->bufferobj, NULL);
- }
-
- FREE( vertex_store );
-}
-
-static GLfloat *map_vertex_store( struct gl_context *ctx, struct vbo_save_vertex_store *vertex_store )
-{
- assert(vertex_store->bufferobj);
- assert(!vertex_store->buffer);
- vertex_store->buffer = (GLfloat *)ctx->Driver.MapBuffer(ctx,
- GL_ARRAY_BUFFER_ARB, /* not used */
- GL_WRITE_ONLY, /* not used */
- vertex_store->bufferobj);
-
- assert(vertex_store->buffer);
- return vertex_store->buffer + vertex_store->used;
-}
-
-static void unmap_vertex_store( struct gl_context *ctx, struct vbo_save_vertex_store *vertex_store )
-{
- ctx->Driver.UnmapBuffer( ctx, GL_ARRAY_BUFFER_ARB, vertex_store->bufferobj );
- vertex_store->buffer = NULL;
-}
-
-
-static struct vbo_save_primitive_store *alloc_prim_store( struct gl_context *ctx )
-{
- struct vbo_save_primitive_store *store = CALLOC_STRUCT(vbo_save_primitive_store);
- (void) ctx;
- store->used = 0;
- store->refcount = 1;
- return store;
-}
-
-static void _save_reset_counters( struct gl_context *ctx )
-{
- struct vbo_save_context *save = &vbo_context(ctx)->save;
-
- save->prim = save->prim_store->buffer + save->prim_store->used;
- save->buffer = (save->vertex_store->buffer +
- save->vertex_store->used);
-
- assert(save->buffer == save->buffer_ptr);
-
- if (save->vertex_size)
- save->max_vert = ((VBO_SAVE_BUFFER_SIZE - save->vertex_store->used) /
- save->vertex_size);
- else
- save->max_vert = 0;
-
- save->vert_count = 0;
- save->prim_count = 0;
- save->prim_max = VBO_SAVE_PRIM_SIZE - save->prim_store->used;
- save->dangling_attr_ref = 0;
-}
-
-
-/* Insert the active immediate struct onto the display list currently
- * being built.
- */
-static void _save_compile_vertex_list( struct gl_context *ctx )
-{
- struct vbo_save_context *save = &vbo_context(ctx)->save;
- struct vbo_save_vertex_list *node;
-
- /* Allocate space for this structure in the display list currently
- * being compiled.
- */
- node = (struct vbo_save_vertex_list *)
- _mesa_dlist_alloc(ctx, save->opcode_vertex_list, sizeof(*node));
-
- if (!node)
- return;
-
- /* Duplicate our template, increment refcounts to the storage structs:
- */
- memcpy(node->attrsz, save->attrsz, sizeof(node->attrsz));
- node->vertex_size = save->vertex_size;
- node->buffer_offset = (save->buffer - save->vertex_store->buffer) * sizeof(GLfloat);
- node->count = save->vert_count;
- node->wrap_count = save->copied.nr;
- node->dangling_attr_ref = save->dangling_attr_ref;
- node->prim = save->prim;
- node->prim_count = save->prim_count;
- node->vertex_store = save->vertex_store;
- node->prim_store = save->prim_store;
-
- node->vertex_store->refcount++;
- node->prim_store->refcount++;
-
- if (node->prim[0].no_current_update) {
- node->current_size = 0;
- node->current_data = NULL;
- } else {
- node->current_size = node->vertex_size - node->attrsz[0];
- node->current_data = NULL;
-
- if (node->current_size) {
- /* If the malloc fails, we just pull the data out of the VBO
- * later instead.
- */
- node->current_data = MALLOC( node->current_size * sizeof(GLfloat) );
- if (node->current_data) {
- const char *buffer = (const char *)save->vertex_store->buffer;
- unsigned attr_offset = node->attrsz[0] * sizeof(GLfloat);
- unsigned vertex_offset = 0;
-
- if (node->count)
- vertex_offset = (node->count-1) * node->vertex_size * sizeof(GLfloat);
-
- memcpy( node->current_data,
- buffer + node->buffer_offset + vertex_offset + attr_offset,
- node->current_size * sizeof(GLfloat) );
- }
- }
- }
-
-
-
- assert(node->attrsz[VBO_ATTRIB_POS] != 0 ||
- node->count == 0);
-
- if (save->dangling_attr_ref)
- ctx->ListState.CurrentList->Flags |= DLIST_DANGLING_REFS;
-
- save->vertex_store->used += save->vertex_size * node->count;
- save->prim_store->used += node->prim_count;
-
-
- /* Copy duplicated vertices
- */
- save->copied.nr = _save_copy_vertices( ctx, node, save->buffer );
-
-
- /* Deal with GL_COMPILE_AND_EXECUTE:
- */
- if (ctx->ExecuteFlag) {
- struct _glapi_table *dispatch = GET_DISPATCH();
-
- _glapi_set_dispatch(ctx->Exec);
-
- vbo_loopback_vertex_list( ctx,
- (const GLfloat *)((const char *)save->vertex_store->buffer +
- node->buffer_offset),
- node->attrsz,
- node->prim,
- node->prim_count,
- node->wrap_count,
- node->vertex_size);
-
- _glapi_set_dispatch(dispatch);
- }
-
-
- /* Decide whether the storage structs are full, or can be used for
- * the next vertex lists as well.
- */
- if (save->vertex_store->used >
- VBO_SAVE_BUFFER_SIZE - 16 * (save->vertex_size + 4)) {
-
- /* Unmap old store:
- */
- unmap_vertex_store( ctx, save->vertex_store );
-
- /* Release old reference:
- */
- save->vertex_store->refcount--;
- assert(save->vertex_store->refcount != 0);
- save->vertex_store = NULL;
-
- /* Allocate and map new store:
- */
- save->vertex_store = alloc_vertex_store( ctx );
- save->buffer_ptr = map_vertex_store( ctx, save->vertex_store );
- }
-
- if (save->prim_store->used > VBO_SAVE_PRIM_SIZE - 6) {
- save->prim_store->refcount--;
- assert(save->prim_store->refcount != 0);
- save->prim_store = alloc_prim_store( ctx );
- }
-
- /* Reset our structures for the next run of vertices:
- */
- _save_reset_counters( ctx );
-}
-
-
-/* TODO -- If no new vertices have been stored, don't bother saving
- * it.
- */
-static void _save_wrap_buffers( struct gl_context *ctx )
-{
- struct vbo_save_context *save = &vbo_context(ctx)->save;
- GLint i = save->prim_count - 1;
- GLenum mode;
- GLboolean weak;
- GLboolean no_current_update;
-
- assert(i < (GLint) save->prim_max);
- assert(i >= 0);
-
- /* Close off in-progress primitive.
- */
- save->prim[i].count = (save->vert_count -
- save->prim[i].start);
- mode = save->prim[i].mode;
- weak = save->prim[i].weak;
- no_current_update = save->prim[i].no_current_update;
-
- /* store the copied vertices, and allocate a new list.
- */
- _save_compile_vertex_list( ctx );
-
- /* Restart interrupted primitive
- */
- save->prim[0].mode = mode;
- save->prim[0].weak = weak;
- save->prim[0].no_current_update = no_current_update;
- save->prim[0].begin = 0;
- save->prim[0].end = 0;
- save->prim[0].pad = 0;
- save->prim[0].start = 0;
- save->prim[0].count = 0;
- save->prim[0].num_instances = 1;
- save->prim_count = 1;
-}
-
-
-
-/* Called only when buffers are wrapped as the result of filling the
- * vertex_store struct.
- */
-static void _save_wrap_filled_vertex( struct gl_context *ctx )
-{
- struct vbo_save_context *save = &vbo_context(ctx)->save;
- GLfloat *data = save->copied.buffer;
- GLuint i;
-
- /* Emit a glEnd to close off the last vertex list.
- */
- _save_wrap_buffers( ctx );
-
- /* Copy stored stored vertices to start of new list.
- */
- assert(save->max_vert - save->vert_count > save->copied.nr);
-
- for (i = 0 ; i < save->copied.nr ; i++) {
- memcpy( save->buffer_ptr, data, save->vertex_size * sizeof(GLfloat));
- data += save->vertex_size;
- save->buffer_ptr += save->vertex_size;
- save->vert_count++;
- }
-}
-
-
-static void _save_copy_to_current( struct gl_context *ctx )
-{
- struct vbo_save_context *save = &vbo_context(ctx)->save;
- GLuint i;
-
- for (i = VBO_ATTRIB_POS+1 ; i < VBO_ATTRIB_MAX ; i++) {
- if (save->attrsz[i]) {
- save->currentsz[i][0] = save->attrsz[i];
- COPY_CLEAN_4V(save->current[i],
- save->attrsz[i],
- save->attrptr[i]);
- }
- }
-}
-
-
-static void _save_copy_from_current( struct gl_context *ctx )
-{
- struct vbo_save_context *save = &vbo_context(ctx)->save;
- GLint i;
-
- for (i = VBO_ATTRIB_POS+1 ; i < VBO_ATTRIB_MAX ; i++) {
- switch (save->attrsz[i]) {
- case 4: save->attrptr[i][3] = save->current[i][3];
- case 3: save->attrptr[i][2] = save->current[i][2];
- case 2: save->attrptr[i][1] = save->current[i][1];
- case 1: save->attrptr[i][0] = save->current[i][0];
- case 0: break;
- }
- }
-}
-
-
-
-
-/* Flush existing data, set new attrib size, replay copied vertices.
- */
-static void _save_upgrade_vertex( struct gl_context *ctx,
- GLuint attr,
- GLuint newsz )
-{
- struct vbo_save_context *save = &vbo_context(ctx)->save;
- GLuint oldsz;
- GLuint i;
- GLfloat *tmp;
-
- /* Store the current run of vertices, and emit a GL_END. Emit a
- * BEGIN in the new buffer.
- */
- if (save->vert_count)
- _save_wrap_buffers( ctx );
- else
- assert( save->copied.nr == 0 );
-
- /* Do a COPY_TO_CURRENT to ensure back-copying works for the case
- * when the attribute already exists in the vertex and is having
- * its size increased.
- */
- _save_copy_to_current( ctx );
-
- /* Fix up sizes:
- */
- oldsz = save->attrsz[attr];
- save->attrsz[attr] = newsz;
-
- save->vertex_size += newsz - oldsz;
- save->max_vert = ((VBO_SAVE_BUFFER_SIZE - save->vertex_store->used) /
- save->vertex_size);
- save->vert_count = 0;
-
- /* Recalculate all the attrptr[] values:
- */
- for (i = 0, tmp = save->vertex ; i < VBO_ATTRIB_MAX ; i++) {
- if (save->attrsz[i]) {
- save->attrptr[i] = tmp;
- tmp += save->attrsz[i];
- }
- else
- save->attrptr[i] = NULL; /* will not be dereferenced. */
- }
-
- /* Copy from current to repopulate the vertex with correct values.
- */
- _save_copy_from_current( ctx );
-
- /* Replay stored vertices to translate them to new format here.
- *
- * If there are copied vertices and the new (upgraded) attribute
- * has not been defined before, this list is somewhat degenerate,
- * and will need fixup at runtime.
- */
- if (save->copied.nr)
- {
- GLfloat *data = save->copied.buffer;
- GLfloat *dest = save->buffer;
- GLuint j;
-
- /* Need to note this and fix up at runtime (or loopback):
- */
- if (attr != VBO_ATTRIB_POS && save->currentsz[attr][0] == 0) {
- assert(oldsz == 0);
- save->dangling_attr_ref = GL_TRUE;
- }
-
- for (i = 0 ; i < save->copied.nr ; i++) {
- for (j = 0 ; j < VBO_ATTRIB_MAX ; j++) {
- if (save->attrsz[j]) {
- if (j == attr) {
- if (oldsz) {
- COPY_CLEAN_4V( dest, oldsz, data );
- data += oldsz;
- dest += newsz;
- }
- else {
- COPY_SZ_4V( dest, newsz, save->current[attr] );
- dest += newsz;
- }
- }
- else {
- GLint sz = save->attrsz[j];
- COPY_SZ_4V( dest, sz, data );
- data += sz;
- dest += sz;
- }
- }
- }
- }
-
- save->buffer_ptr = dest;
- save->vert_count += save->copied.nr;
- }
-}
-
-static void save_fixup_vertex( struct gl_context *ctx, GLuint attr, GLuint sz )
-{
- struct vbo_save_context *save = &vbo_context(ctx)->save;
-
- if (sz > save->attrsz[attr]) {
- /* New size is larger. Need to flush existing vertices and get
- * an enlarged vertex format.
- */
- _save_upgrade_vertex( ctx, attr, sz );
- }
- else if (sz < save->active_sz[attr]) {
- static GLfloat id[4] = { 0, 0, 0, 1 };
- GLuint i;
-
- /* New size is equal or smaller - just need to fill in some
- * zeros.
- */
- for (i = sz ; i <= save->attrsz[attr] ; i++)
- save->attrptr[attr][i-1] = id[i-1];
- }
-
- save->active_sz[attr] = sz;
-}
-
-static void _save_reset_vertex( struct gl_context *ctx )
-{
- struct vbo_save_context *save = &vbo_context(ctx)->save;
- GLuint i;
-
- for (i = 0 ; i < VBO_ATTRIB_MAX ; i++) {
- save->attrsz[i] = 0;
- save->active_sz[i] = 0;
- }
-
- save->vertex_size = 0;
-}
-
-
-
-#define ERROR(err) _mesa_compile_error( ctx, err, __FUNCTION__ );
-
-
-/* Only one size for each attribute may be active at once. Eg. if
- * Color3f is installed/active, then Color4f may not be, even if the
- * vertex actually contains 4 color coordinates. This is because the
- * 3f version won't otherwise set color[3] to 1.0 -- this is the job
- * of the chooser function when switching between Color4f and Color3f.
- */
-#define ATTR( A, N, V0, V1, V2, V3 ) \
-do { \
- struct vbo_save_context *save = &vbo_context(ctx)->save; \
- \
- if (save->active_sz[A] != N) \
- save_fixup_vertex(ctx, A, N); \
- \
- { \
- GLfloat *dest = save->attrptr[A]; \
- if (N>0) dest[0] = V0; \
- if (N>1) dest[1] = V1; \
- if (N>2) dest[2] = V2; \
- if (N>3) dest[3] = V3; \
- } \
- \
- if ((A) == 0) { \
- GLuint i; \
- \
- for (i = 0; i < save->vertex_size; i++) \
- save->buffer_ptr[i] = save->vertex[i]; \
- \
- save->buffer_ptr += save->vertex_size; \
- \
- if (++save->vert_count >= save->max_vert) \
- _save_wrap_filled_vertex( ctx ); \
- } \
-} while (0)
-
-#define TAG(x) _save_##x
-
-#include "vbo_attrib_tmp.h"
-
-
-
-
-/* Cope with EvalCoord/CallList called within a begin/end object:
- * -- Flush current buffer
- * -- Fallback to opcodes for the rest of the begin/end object.
- */
-static void DO_FALLBACK( struct gl_context *ctx )
-{
- struct vbo_save_context *save = &vbo_context(ctx)->save;
-
- if (save->vert_count || save->prim_count) {
- GLint i = save->prim_count - 1;
-
- /* Close off in-progress primitive.
- */
- save->prim[i].count = (save->vert_count -
- save->prim[i].start);
-
- /* Need to replay this display list with loopback,
- * unfortunately, otherwise this primitive won't be handled
- * properly:
- */
- save->dangling_attr_ref = 1;
-
- _save_compile_vertex_list( ctx );
- }
-
- _save_copy_to_current( ctx );
- _save_reset_vertex( ctx );
- _save_reset_counters( ctx );
- _mesa_install_save_vtxfmt( ctx, &ctx->ListState.ListVtxfmt );
- ctx->Driver.SaveNeedFlush = 0;
-}
-
-static void GLAPIENTRY _save_EvalCoord1f( GLfloat u )
-{
- GET_CURRENT_CONTEXT(ctx);
- DO_FALLBACK(ctx);
- CALL_EvalCoord1f(ctx->Save, (u));
-}
-
-static void GLAPIENTRY _save_EvalCoord1fv( const GLfloat *v )
-{
- GET_CURRENT_CONTEXT(ctx);
- DO_FALLBACK(ctx);
- CALL_EvalCoord1fv(ctx->Save, (v));
-}
-
-static void GLAPIENTRY _save_EvalCoord2f( GLfloat u, GLfloat v )
-{
- GET_CURRENT_CONTEXT(ctx);
- DO_FALLBACK(ctx);
- CALL_EvalCoord2f(ctx->Save, (u, v));
-}
-
-static void GLAPIENTRY _save_EvalCoord2fv( const GLfloat *v )
-{
- GET_CURRENT_CONTEXT(ctx);
- DO_FALLBACK(ctx);
- CALL_EvalCoord2fv(ctx->Save, (v));
-}
-
-static void GLAPIENTRY _save_EvalPoint1( GLint i )
-{
- GET_CURRENT_CONTEXT(ctx);
- DO_FALLBACK(ctx);
- CALL_EvalPoint1(ctx->Save, (i));
-}
-
-static void GLAPIENTRY _save_EvalPoint2( GLint i, GLint j )
-{
- GET_CURRENT_CONTEXT(ctx);
- DO_FALLBACK(ctx);
- CALL_EvalPoint2(ctx->Save, (i, j));
-}
-
-static void GLAPIENTRY _save_CallList( GLuint l )
-{
- GET_CURRENT_CONTEXT(ctx);
- DO_FALLBACK(ctx);
- CALL_CallList(ctx->Save, (l));
-}
-
-static void GLAPIENTRY _save_CallLists( GLsizei n, GLenum type, const GLvoid *v )
-{
- GET_CURRENT_CONTEXT(ctx);
- DO_FALLBACK(ctx);
- CALL_CallLists(ctx->Save, (n, type, v));
-}
-
-
-
-
-/* This begin is hooked into ... Updating of
- * ctx->Driver.CurrentSavePrimitive is already taken care of.
- */
-GLboolean vbo_save_NotifyBegin( struct gl_context *ctx, GLenum mode )
-{
- struct vbo_save_context *save = &vbo_context(ctx)->save;
-
- GLuint i = save->prim_count++;
-
- assert(i < save->prim_max);
- save->prim[i].mode = mode & VBO_SAVE_PRIM_MODE_MASK;
- save->prim[i].begin = 1;
- save->prim[i].end = 0;
- save->prim[i].weak = (mode & VBO_SAVE_PRIM_WEAK) ? 1 : 0;
- save->prim[i].no_current_update = (mode & VBO_SAVE_PRIM_NO_CURRENT_UPDATE) ? 1 : 0;
- save->prim[i].pad = 0;
- save->prim[i].start = save->vert_count;
- save->prim[i].count = 0;
- save->prim[i].num_instances = 1;
-
- _mesa_install_save_vtxfmt( ctx, &save->vtxfmt );
- ctx->Driver.SaveNeedFlush = 1;
- return GL_TRUE;
-}
-
-
-
-static void GLAPIENTRY _save_End( void )
-{
- GET_CURRENT_CONTEXT( ctx );
- struct vbo_save_context *save = &vbo_context(ctx)->save;
- GLint i = save->prim_count - 1;
-
- ctx->Driver.CurrentSavePrimitive = PRIM_OUTSIDE_BEGIN_END;
- save->prim[i].end = 1;
- save->prim[i].count = (save->vert_count -
- save->prim[i].start);
-
- if (i == (GLint) save->prim_max - 1) {
- _save_compile_vertex_list( ctx );
- assert(save->copied.nr == 0);
- }
-
- /* Swap out this vertex format while outside begin/end. Any color,
- * etc. received between here and the next begin will be compiled
- * as opcodes.
- */
- _mesa_install_save_vtxfmt( ctx, &ctx->ListState.ListVtxfmt );
-}
-
-
-/* These are all errors as this vtxfmt is only installed inside
- * begin/end pairs.
- */
-static void GLAPIENTRY _save_DrawElements(GLenum mode, GLsizei count, GLenum type,
- const GLvoid *indices)
-{
- GET_CURRENT_CONTEXT(ctx);
- (void) mode; (void) count; (void) type; (void) indices;
- _mesa_compile_error( ctx, GL_INVALID_OPERATION, "glDrawElements" );
-}
-
-
-static void GLAPIENTRY _save_DrawRangeElements(GLenum mode,
- GLuint start, GLuint end,
- GLsizei count, GLenum type,
- const GLvoid *indices)
-{
- GET_CURRENT_CONTEXT(ctx);
- (void) mode; (void) start; (void) end; (void) count; (void) type; (void) indices;
- _mesa_compile_error( ctx, GL_INVALID_OPERATION, "glDrawRangeElements" );
-}
-
-static void GLAPIENTRY _save_DrawElementsBaseVertex(GLenum mode,
- GLsizei count,
- GLenum type,
- const GLvoid *indices,
- GLint basevertex)
-{
- GET_CURRENT_CONTEXT(ctx);
- (void) mode; (void) count; (void) type; (void) indices; (void)basevertex;
-
- _mesa_compile_error( ctx, GL_INVALID_OPERATION, "glDrawElements" );
-}
-
-static void GLAPIENTRY _save_DrawRangeElementsBaseVertex(GLenum mode,
- GLuint start,
- GLuint end,
- GLsizei count,
- GLenum type,
- const GLvoid *indices,
- GLint basevertex)
-{
- GET_CURRENT_CONTEXT(ctx);
- (void) mode; (void) start; (void) end; (void) count; (void) type;
- (void) indices; (void)basevertex;
-
- _mesa_compile_error( ctx, GL_INVALID_OPERATION, "glDrawRangeElements" );
-}
-
-static void GLAPIENTRY _save_DrawArrays(GLenum mode, GLint start, GLsizei count)
-{
- GET_CURRENT_CONTEXT(ctx);
- (void) mode; (void) start; (void) count;
- _mesa_compile_error( ctx, GL_INVALID_OPERATION, "glDrawArrays" );
-}
-
-static void GLAPIENTRY _save_Rectf( GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2 )
-{
- GET_CURRENT_CONTEXT(ctx);
- (void) x1; (void) y1; (void) x2; (void) y2;
- _mesa_compile_error( ctx, GL_INVALID_OPERATION, "glRectf" );
-}
-
-static void GLAPIENTRY _save_EvalMesh1( GLenum mode, GLint i1, GLint i2 )
-{
- GET_CURRENT_CONTEXT(ctx);
- (void) mode; (void) i1; (void) i2;
- _mesa_compile_error( ctx, GL_INVALID_OPERATION, "glEvalMesh1" );
-}
-
-static void GLAPIENTRY _save_EvalMesh2( GLenum mode, GLint i1, GLint i2,
- GLint j1, GLint j2 )
-{
- GET_CURRENT_CONTEXT(ctx);
- (void) mode; (void) i1; (void) i2; (void) j1; (void) j2;
- _mesa_compile_error( ctx, GL_INVALID_OPERATION, "glEvalMesh2" );
-}
-
-static void GLAPIENTRY _save_Begin( GLenum mode )
-{
- GET_CURRENT_CONTEXT( ctx );
- (void) mode;
- _mesa_compile_error( ctx, GL_INVALID_OPERATION, "Recursive glBegin" );
-}
-
-
-static void GLAPIENTRY _save_PrimitiveRestartNV( void )
-{
- GLenum curPrim;
- GET_CURRENT_CONTEXT( ctx );
-
- curPrim = ctx->Driver.CurrentSavePrimitive;
-
- _save_End();
- _save_Begin(curPrim);
-}
-
-
-/* Unlike the functions above, these are to be hooked into the vtxfmt
- * maintained in ctx->ListState, active when the list is known or
- * suspected to be outside any begin/end primitive.
- */
-static void GLAPIENTRY _save_OBE_Rectf( GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2 )
-{
- GET_CURRENT_CONTEXT(ctx);
- vbo_save_NotifyBegin( ctx, GL_QUADS | VBO_SAVE_PRIM_WEAK );
- CALL_Vertex2f(GET_DISPATCH(), ( x1, y1 ));
- CALL_Vertex2f(GET_DISPATCH(), ( x2, y1 ));
- CALL_Vertex2f(GET_DISPATCH(), ( x2, y2 ));
- CALL_Vertex2f(GET_DISPATCH(), ( x1, y2 ));
- CALL_End(GET_DISPATCH(), ());
-}
-
-
-static void GLAPIENTRY _save_OBE_DrawArrays(GLenum mode, GLint start, GLsizei count)
-{
- GET_CURRENT_CONTEXT(ctx);
- GLint i;
-
- if (!_mesa_validate_DrawArrays( ctx, mode, start, count ))
- return;
-
- _ae_map_vbos( ctx );
-
- vbo_save_NotifyBegin( ctx, mode | VBO_SAVE_PRIM_WEAK | VBO_SAVE_PRIM_NO_CURRENT_UPDATE);
-
- for (i = 0; i < count; i++)
- CALL_ArrayElement(GET_DISPATCH(), (start + i));
- CALL_End(GET_DISPATCH(), ());
-
- _ae_unmap_vbos( ctx );
-}
-
-/* Could do better by copying the arrays and element list intact and
- * then emitting an indexed prim at runtime.
- */
-static void GLAPIENTRY _save_OBE_DrawElements(GLenum mode, GLsizei count, GLenum type,
- const GLvoid *indices)
-{
- GET_CURRENT_CONTEXT(ctx);
- GLint i;
-
- if (!_mesa_validate_DrawElements( ctx, mode, count, type, indices, 0 ))
- return;
-
- _ae_map_vbos( ctx );
-
- if (_mesa_is_bufferobj(ctx->Array.ElementArrayBufferObj))
- indices = ADD_POINTERS(ctx->Array.ElementArrayBufferObj->Pointer, indices);
-
- vbo_save_NotifyBegin( ctx, mode | VBO_SAVE_PRIM_WEAK | VBO_SAVE_PRIM_NO_CURRENT_UPDATE );
-
- switch (type) {
- case GL_UNSIGNED_BYTE:
- for (i = 0 ; i < count ; i++)
- CALL_ArrayElement(GET_DISPATCH(), ( ((GLubyte *)indices)[i] ));
- break;
- case GL_UNSIGNED_SHORT:
- for (i = 0 ; i < count ; i++)
- CALL_ArrayElement(GET_DISPATCH(), ( ((GLushort *)indices)[i] ));
- break;
- case GL_UNSIGNED_INT:
- for (i = 0 ; i < count ; i++)
- CALL_ArrayElement(GET_DISPATCH(), ( ((GLuint *)indices)[i] ));
- break;
- default:
- _mesa_error( ctx, GL_INVALID_ENUM, "glDrawElements(type)" );
- break;
- }
-
- CALL_End(GET_DISPATCH(), ());
-
- _ae_unmap_vbos( ctx );
-}
-
-static void GLAPIENTRY _save_OBE_DrawRangeElements(GLenum mode,
- GLuint start, GLuint end,
- GLsizei count, GLenum type,
- const GLvoid *indices)
-{
- GET_CURRENT_CONTEXT(ctx);
- if (_mesa_validate_DrawRangeElements( ctx, mode,
- start, end,
- count, type, indices, 0 ))
- _save_OBE_DrawElements( mode, count, type, indices );
-}
-
-
-
-
-
-static void _save_vtxfmt_init( struct gl_context *ctx )
-{
- struct vbo_save_context *save = &vbo_context(ctx)->save;
- GLvertexformat *vfmt = &save->vtxfmt;
-
- _MESA_INIT_ARRAYELT_VTXFMT(vfmt, _ae_);
-
- vfmt->Begin = _save_Begin;
- vfmt->Color3f = _save_Color3f;
- vfmt->Color3fv = _save_Color3fv;
- vfmt->Color4f = _save_Color4f;
- vfmt->Color4fv = _save_Color4fv;
- vfmt->EdgeFlag = _save_EdgeFlag;
- vfmt->End = _save_End;
- vfmt->PrimitiveRestartNV = _save_PrimitiveRestartNV;
- vfmt->FogCoordfEXT = _save_FogCoordfEXT;
- vfmt->FogCoordfvEXT = _save_FogCoordfvEXT;
- vfmt->Indexf = _save_Indexf;
- vfmt->Indexfv = _save_Indexfv;
- vfmt->Materialfv = _save_Materialfv;
- vfmt->MultiTexCoord1fARB = _save_MultiTexCoord1f;
- vfmt->MultiTexCoord1fvARB = _save_MultiTexCoord1fv;
- vfmt->MultiTexCoord2fARB = _save_MultiTexCoord2f;
- vfmt->MultiTexCoord2fvARB = _save_MultiTexCoord2fv;
- vfmt->MultiTexCoord3fARB = _save_MultiTexCoord3f;
- vfmt->MultiTexCoord3fvARB = _save_MultiTexCoord3fv;
- vfmt->MultiTexCoord4fARB = _save_MultiTexCoord4f;
- vfmt->MultiTexCoord4fvARB = _save_MultiTexCoord4fv;
- vfmt->Normal3f = _save_Normal3f;
- vfmt->Normal3fv = _save_Normal3fv;
- vfmt->SecondaryColor3fEXT = _save_SecondaryColor3fEXT;
- vfmt->SecondaryColor3fvEXT = _save_SecondaryColor3fvEXT;
- vfmt->TexCoord1f = _save_TexCoord1f;
- vfmt->TexCoord1fv = _save_TexCoord1fv;
- vfmt->TexCoord2f = _save_TexCoord2f;
- vfmt->TexCoord2fv = _save_TexCoord2fv;
- vfmt->TexCoord3f = _save_TexCoord3f;
- vfmt->TexCoord3fv = _save_TexCoord3fv;
- vfmt->TexCoord4f = _save_TexCoord4f;
- vfmt->TexCoord4fv = _save_TexCoord4fv;
- vfmt->Vertex2f = _save_Vertex2f;
- vfmt->Vertex2fv = _save_Vertex2fv;
- vfmt->Vertex3f = _save_Vertex3f;
- vfmt->Vertex3fv = _save_Vertex3fv;
- vfmt->Vertex4f = _save_Vertex4f;
- vfmt->Vertex4fv = _save_Vertex4fv;
- vfmt->VertexAttrib1fARB = _save_VertexAttrib1fARB;
- vfmt->VertexAttrib1fvARB = _save_VertexAttrib1fvARB;
- vfmt->VertexAttrib2fARB = _save_VertexAttrib2fARB;
- vfmt->VertexAttrib2fvARB = _save_VertexAttrib2fvARB;
- vfmt->VertexAttrib3fARB = _save_VertexAttrib3fARB;
- vfmt->VertexAttrib3fvARB = _save_VertexAttrib3fvARB;
- vfmt->VertexAttrib4fARB = _save_VertexAttrib4fARB;
- vfmt->VertexAttrib4fvARB = _save_VertexAttrib4fvARB;
-
- vfmt->VertexAttrib1fNV = _save_VertexAttrib1fNV;
- vfmt->VertexAttrib1fvNV = _save_VertexAttrib1fvNV;
- vfmt->VertexAttrib2fNV = _save_VertexAttrib2fNV;
- vfmt->VertexAttrib2fvNV = _save_VertexAttrib2fvNV;
- vfmt->VertexAttrib3fNV = _save_VertexAttrib3fNV;
- vfmt->VertexAttrib3fvNV = _save_VertexAttrib3fvNV;
- vfmt->VertexAttrib4fNV = _save_VertexAttrib4fNV;
- vfmt->VertexAttrib4fvNV = _save_VertexAttrib4fvNV;
-
- /* integer-valued */
- vfmt->VertexAttribI1i = _save_VertexAttribI1i;
- vfmt->VertexAttribI2i = _save_VertexAttribI2i;
- vfmt->VertexAttribI3i = _save_VertexAttribI3i;
- vfmt->VertexAttribI4i = _save_VertexAttribI4i;
- vfmt->VertexAttribI2iv = _save_VertexAttribI2iv;
- vfmt->VertexAttribI3iv = _save_VertexAttribI3iv;
- vfmt->VertexAttribI4iv = _save_VertexAttribI4iv;
-
- /* unsigned integer-valued */
- vfmt->VertexAttribI1ui = _save_VertexAttribI1ui;
- vfmt->VertexAttribI2ui = _save_VertexAttribI2ui;
- vfmt->VertexAttribI3ui = _save_VertexAttribI3ui;
- vfmt->VertexAttribI4ui = _save_VertexAttribI4ui;
- vfmt->VertexAttribI2uiv = _save_VertexAttribI2uiv;
- vfmt->VertexAttribI3uiv = _save_VertexAttribI3uiv;
- vfmt->VertexAttribI4uiv = _save_VertexAttribI4uiv;
-
- /* This will all require us to fallback to saving the list as opcodes:
- */
- _MESA_INIT_DLIST_VTXFMT(vfmt, _save_); /* inside begin/end */
-
- _MESA_INIT_EVAL_VTXFMT(vfmt, _save_);
-
- /* These are all errors as we at least know we are in some sort of
- * begin/end pair:
- */
- vfmt->Begin = _save_Begin;
- vfmt->Rectf = _save_Rectf;
- vfmt->DrawArrays = _save_DrawArrays;
- vfmt->DrawElements = _save_DrawElements;
- vfmt->DrawRangeElements = _save_DrawRangeElements;
- vfmt->DrawElementsBaseVertex = _save_DrawElementsBaseVertex;
- vfmt->DrawRangeElementsBaseVertex = _save_DrawRangeElementsBaseVertex;
- /* Loops back into vfmt->DrawElements */
- vfmt->MultiDrawElementsEXT = _mesa_noop_MultiDrawElements;
- vfmt->MultiDrawElementsBaseVertex = _mesa_noop_MultiDrawElementsBaseVertex;
-}
-
-
-void vbo_save_SaveFlushVertices( struct gl_context *ctx )
-{
- struct vbo_save_context *save = &vbo_context(ctx)->save;
-
- /* Noop when we are actually active:
- */
- if (ctx->Driver.CurrentSavePrimitive == PRIM_INSIDE_UNKNOWN_PRIM ||
- ctx->Driver.CurrentSavePrimitive <= GL_POLYGON)
- return;
-
- if (save->vert_count ||
- save->prim_count)
- _save_compile_vertex_list( ctx );
-
- _save_copy_to_current( ctx );
- _save_reset_vertex( ctx );
- _save_reset_counters( ctx );
- ctx->Driver.SaveNeedFlush = 0;
-}
-
-void vbo_save_NewList( struct gl_context *ctx, GLuint list, GLenum mode )
-{
- struct vbo_save_context *save = &vbo_context(ctx)->save;
-
- (void) list; (void) mode;
-
- if (!save->prim_store)
- save->prim_store = alloc_prim_store( ctx );
-
- if (!save->vertex_store)
- save->vertex_store = alloc_vertex_store( ctx );
-
- save->buffer_ptr = map_vertex_store( ctx, save->vertex_store );
-
- _save_reset_vertex( ctx );
- _save_reset_counters( ctx );
- ctx->Driver.SaveNeedFlush = 0;
-}
-
-void vbo_save_EndList( struct gl_context *ctx )
-{
- struct vbo_save_context *save = &vbo_context(ctx)->save;
-
- /* EndList called inside a (saved) Begin/End pair?
- */
- if (ctx->Driver.CurrentSavePrimitive != PRIM_OUTSIDE_BEGIN_END) {
-
- if (save->prim_count > 0) {
- GLint i = save->prim_count - 1;
- ctx->Driver.CurrentSavePrimitive = PRIM_OUTSIDE_BEGIN_END;
- save->prim[i].end = 0;
- save->prim[i].count = (save->vert_count -
- save->prim[i].start);
- }
-
- /* Make sure this vertex list gets replayed by the "loopback"
- * mechanism:
- */
- save->dangling_attr_ref = 1;
- vbo_save_SaveFlushVertices( ctx );
-
- /* Swap out this vertex format while outside begin/end. Any color,
- * etc. received between here and the next begin will be compiled
- * as opcodes.
- */
- _mesa_install_save_vtxfmt( ctx, &ctx->ListState.ListVtxfmt );
- }
-
- unmap_vertex_store( ctx, save->vertex_store );
-
- assert(save->vertex_size == 0);
-}
-
-void vbo_save_BeginCallList( struct gl_context *ctx, struct gl_display_list *dlist )
-{
- struct vbo_save_context *save = &vbo_context(ctx)->save;
- save->replay_flags |= dlist->Flags;
-}
-
-void vbo_save_EndCallList( struct gl_context *ctx )
-{
- struct vbo_save_context *save = &vbo_context(ctx)->save;
-
- if (ctx->ListState.CallDepth == 1) {
- /* This is correct: want to keep only the VBO_SAVE_FALLBACK
- * flag, if it is set:
- */
- save->replay_flags &= VBO_SAVE_FALLBACK;
- }
-}
-
-
-static void vbo_destroy_vertex_list( struct gl_context *ctx, void *data )
-{
- struct vbo_save_vertex_list *node = (struct vbo_save_vertex_list *)data;
- (void) ctx;
-
- if ( --node->vertex_store->refcount == 0 )
- free_vertex_store( ctx, node->vertex_store );
-
- if ( --node->prim_store->refcount == 0 )
- FREE( node->prim_store );
-
- if (node->current_data) {
- FREE(node->current_data);
- node->current_data = NULL;
- }
-}
-
-
-static void vbo_print_vertex_list( struct gl_context *ctx, void *data )
-{
- struct vbo_save_vertex_list *node = (struct vbo_save_vertex_list *)data;
- GLuint i;
- (void) ctx;
-
- printf("VBO-VERTEX-LIST, %u vertices %d primitives, %d vertsize\n",
- node->count,
- node->prim_count,
- node->vertex_size);
-
- for (i = 0 ; i < node->prim_count ; i++) {
- struct _mesa_prim *prim = &node->prim[i];
- _mesa_debug(NULL, " prim %d: %s%s %d..%d %s %s\n",
- i,
- _mesa_lookup_prim_by_nr(prim->mode),
- prim->weak ? " (weak)" : "",
- prim->start,
- prim->start + prim->count,
- (prim->begin) ? "BEGIN" : "(wrap)",
- (prim->end) ? "END" : "(wrap)");
- }
-}
-
-
-static void _save_current_init( struct gl_context *ctx )
-{
- struct vbo_save_context *save = &vbo_context(ctx)->save;
- GLint i;
-
- for (i = VBO_ATTRIB_POS; i <= VBO_ATTRIB_GENERIC15; i++) {
- const GLuint j = i - VBO_ATTRIB_POS;
- ASSERT(j < VERT_ATTRIB_MAX);
- save->currentsz[i] = &ctx->ListState.ActiveAttribSize[j];
- save->current[i] = ctx->ListState.CurrentAttrib[j];
- }
-
- for (i = VBO_ATTRIB_FIRST_MATERIAL; i <= VBO_ATTRIB_LAST_MATERIAL; i++) {
- const GLuint j = i - VBO_ATTRIB_FIRST_MATERIAL;
- ASSERT(j < MAT_ATTRIB_MAX);
- save->currentsz[i] = &ctx->ListState.ActiveMaterialSize[j];
- save->current[i] = ctx->ListState.CurrentMaterial[j];
- }
-}
-
-/**
- * Initialize the display list compiler
- */
-void vbo_save_api_init( struct vbo_save_context *save )
-{
- struct gl_context *ctx = save->ctx;
- GLuint i;
-
- save->opcode_vertex_list =
- _mesa_dlist_alloc_opcode( ctx,
- sizeof(struct vbo_save_vertex_list),
- vbo_save_playback_vertex_list,
- vbo_destroy_vertex_list,
- vbo_print_vertex_list );
-
- ctx->Driver.NotifySaveBegin = vbo_save_NotifyBegin;
-
- _save_vtxfmt_init( ctx );
- _save_current_init( ctx );
-
- /* These will actually get set again when binding/drawing */
- for (i = 0; i < VBO_ATTRIB_MAX; i++)
- save->inputs[i] = &save->arrays[i];
-
- /* Hook our array functions into the outside-begin-end vtxfmt in
- * ctx->ListState.
- */
- ctx->ListState.ListVtxfmt.Rectf = _save_OBE_Rectf;
- ctx->ListState.ListVtxfmt.DrawArrays = _save_OBE_DrawArrays;
- ctx->ListState.ListVtxfmt.DrawElements = _save_OBE_DrawElements;
- ctx->ListState.ListVtxfmt.DrawRangeElements = _save_OBE_DrawRangeElements;
- /* loops back into _save_OBE_DrawElements */
- ctx->ListState.ListVtxfmt.MultiDrawElementsEXT = _mesa_noop_MultiDrawElements;
- ctx->ListState.ListVtxfmt.MultiDrawElementsBaseVertex = _mesa_noop_MultiDrawElementsBaseVertex;
- _mesa_install_save_vtxfmt( ctx, &ctx->ListState.ListVtxfmt );
-}
-
-
-#endif /* FEATURE_dlist */
+/**************************************************************************
+
+Copyright 2002-2008 Tungsten Graphics Inc., Cedar Park, Texas.
+
+All Rights Reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the "Software"),
+to deal in the Software without restriction, including without limitation
+on the rights to use, copy, modify, merge, publish, distribute, sub
+license, and/or sell copies of the Software, and to permit persons to whom
+the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice (including the next
+paragraph) shall be included in all copies or substantial portions of the
+Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
+TUNGSTEN GRAPHICS AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
+DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+**************************************************************************/
+
+/*
+ * Authors:
+ * Keith Whitwell <keith@tungstengraphics.com>
+ */
+
+
+
+/* Display list compiler attempts to store lists of vertices with the
+ * same vertex layout. Additionally it attempts to minimize the need
+ * for execute-time fixup of these vertex lists, allowing them to be
+ * cached on hardware.
+ *
+ * There are still some circumstances where this can be thwarted, for
+ * example by building a list that consists of one very long primitive
+ * (eg Begin(Triangles), 1000 vertices, End), and calling that list
+ * from inside a different begin/end object (Begin(Lines), CallList,
+ * End).
+ *
+ * In that case the code will have to replay the list as individual
+ * commands through the Exec dispatch table, or fix up the copied
+ * vertices at execute-time.
+ *
+ * The other case where fixup is required is when a vertex attribute
+ * is introduced in the middle of a primitive. Eg:
+ * Begin(Lines)
+ * TexCoord1f() Vertex2f()
+ * TexCoord1f() Color3f() Vertex2f()
+ * End()
+ *
+ * If the current value of Color isn't known at compile-time, this
+ * primitive will require fixup.
+ *
+ *
+ * The list compiler currently doesn't attempt to compile lists
+ * containing EvalCoord or EvalPoint commands. On encountering one of
+ * these, compilation falls back to opcodes.
+ *
+ * This could be improved to fallback only when a mix of EvalCoord and
+ * Vertex commands are issued within a single primitive.
+ */
+
+
+#include "main/glheader.h"
+#include "main/bufferobj.h"
+#include "main/context.h"
+#include "main/dlist.h"
+#include "main/enums.h"
+#include "main/eval.h"
+#include "main/macros.h"
+#include "main/mfeatures.h"
+#include "main/api_noop.h"
+#include "main/api_validate.h"
+#include "main/api_arrayelt.h"
+#include "main/vtxfmt.h"
+#include "main/dispatch.h"
+
+#include "vbo_context.h"
+
+
+#if FEATURE_dlist
+
+
+#ifdef ERROR
+#undef ERROR
+#endif
+
+
+/* An interesting VBO number/name to help with debugging */
+#define VBO_BUF_ID 12345
+
+
+/*
+ * NOTE: Old 'parity' issue is gone, but copying can still be
+ * wrong-footed on replay.
+ */
+static GLuint _save_copy_vertices( struct gl_context *ctx,
+ const struct vbo_save_vertex_list *node,
+ const GLfloat *src_buffer)
+{
+ struct vbo_save_context *save = &vbo_context( ctx )->save;
+ const struct _mesa_prim *prim = &node->prim[node->prim_count-1];
+ GLuint nr = prim->count;
+ GLuint sz = save->vertex_size;
+ const GLfloat *src = src_buffer + prim->start * sz;
+ GLfloat *dst = save->copied.buffer;
+ GLuint ovf, i;
+
+ if (prim->end)
+ return 0;
+
+ switch( prim->mode )
+ {
+ case GL_POINTS:
+ return 0;
+ case GL_LINES:
+ ovf = nr&1;
+ for (i = 0 ; i < ovf ; i++)
+ memcpy( dst+i*sz, src+(nr-ovf+i)*sz, sz*sizeof(GLfloat) );
+ return i;
+ case GL_TRIANGLES:
+ ovf = nr%3;
+ for (i = 0 ; i < ovf ; i++)
+ memcpy( dst+i*sz, src+(nr-ovf+i)*sz, sz*sizeof(GLfloat) );
+ return i;
+ case GL_QUADS:
+ ovf = nr&3;
+ for (i = 0 ; i < ovf ; i++)
+ memcpy( dst+i*sz, src+(nr-ovf+i)*sz, sz*sizeof(GLfloat) );
+ return i;
+ case GL_LINE_STRIP:
+ if (nr == 0)
+ return 0;
+ else {
+ memcpy( dst, src+(nr-1)*sz, sz*sizeof(GLfloat) );
+ return 1;
+ }
+ case GL_LINE_LOOP:
+ case GL_TRIANGLE_FAN:
+ case GL_POLYGON:
+ if (nr == 0)
+ return 0;
+ else if (nr == 1) {
+ memcpy( dst, src+0, sz*sizeof(GLfloat) );
+ return 1;
+ } else {
+ memcpy( dst, src+0, sz*sizeof(GLfloat) );
+ memcpy( dst+sz, src+(nr-1)*sz, sz*sizeof(GLfloat) );
+ return 2;
+ }
+ case GL_TRIANGLE_STRIP:
+ case GL_QUAD_STRIP:
+ switch (nr) {
+ case 0: ovf = 0; break;
+ case 1: ovf = 1; break;
+ default: ovf = 2 + (nr&1); break;
+ }
+ for (i = 0 ; i < ovf ; i++)
+ memcpy( dst+i*sz, src+(nr-ovf+i)*sz, sz*sizeof(GLfloat) );
+ return i;
+ default:
+ assert(0);
+ return 0;
+ }
+}
+
+
+static struct vbo_save_vertex_store *alloc_vertex_store( struct gl_context *ctx )
+{
+ struct vbo_save_vertex_store *vertex_store = CALLOC_STRUCT(vbo_save_vertex_store);
+
+ /* obj->Name needs to be non-zero, but won't ever be examined more
+ * closely than that. In particular these buffers won't be entered
+ * into the hash and can never be confused with ones visible to the
+ * user. Perhaps there could be a special number for internal
+ * buffers:
+ */
+ vertex_store->bufferobj = ctx->Driver.NewBufferObject(ctx,
+ VBO_BUF_ID,
+ GL_ARRAY_BUFFER_ARB);
+
+ ctx->Driver.BufferData( ctx,
+ GL_ARRAY_BUFFER_ARB,
+ VBO_SAVE_BUFFER_SIZE * sizeof(GLfloat),
+ NULL,
+ GL_STATIC_DRAW_ARB,
+ vertex_store->bufferobj);
+
+ vertex_store->buffer = NULL;
+ vertex_store->used = 0;
+ vertex_store->refcount = 1;
+
+ return vertex_store;
+}
+
+static void free_vertex_store( struct gl_context *ctx, struct vbo_save_vertex_store *vertex_store )
+{
+ assert(!vertex_store->buffer);
+
+ if (vertex_store->bufferobj) {
+ _mesa_reference_buffer_object(ctx, &vertex_store->bufferobj, NULL);
+ }
+
+ FREE( vertex_store );
+}
+
+static GLfloat *map_vertex_store( struct gl_context *ctx, struct vbo_save_vertex_store *vertex_store )
+{
+ assert(vertex_store->bufferobj);
+ assert(!vertex_store->buffer);
+ vertex_store->buffer = (GLfloat *)ctx->Driver.MapBuffer(ctx,
+ GL_ARRAY_BUFFER_ARB, /* not used */
+ GL_WRITE_ONLY, /* not used */
+ vertex_store->bufferobj);
+
+ assert(vertex_store->buffer);
+ return vertex_store->buffer + vertex_store->used;
+}
+
+static void unmap_vertex_store( struct gl_context *ctx, struct vbo_save_vertex_store *vertex_store )
+{
+ ctx->Driver.UnmapBuffer( ctx, GL_ARRAY_BUFFER_ARB, vertex_store->bufferobj );
+ vertex_store->buffer = NULL;
+}
+
+
+static struct vbo_save_primitive_store *alloc_prim_store( struct gl_context *ctx )
+{
+ struct vbo_save_primitive_store *store = CALLOC_STRUCT(vbo_save_primitive_store);
+ (void) ctx;
+ store->used = 0;
+ store->refcount = 1;
+ return store;
+}
+
+static void _save_reset_counters( struct gl_context *ctx )
+{
+ struct vbo_save_context *save = &vbo_context(ctx)->save;
+
+ save->prim = save->prim_store->buffer + save->prim_store->used;
+ save->buffer = (save->vertex_store->buffer +
+ save->vertex_store->used);
+
+ assert(save->buffer == save->buffer_ptr);
+
+ if (save->vertex_size)
+ save->max_vert = ((VBO_SAVE_BUFFER_SIZE - save->vertex_store->used) /
+ save->vertex_size);
+ else
+ save->max_vert = 0;
+
+ save->vert_count = 0;
+ save->prim_count = 0;
+ save->prim_max = VBO_SAVE_PRIM_SIZE - save->prim_store->used;
+ save->dangling_attr_ref = 0;
+}
+
+
+/* Insert the active immediate struct onto the display list currently
+ * being built.
+ */
+static void _save_compile_vertex_list( struct gl_context *ctx )
+{
+ struct vbo_save_context *save = &vbo_context(ctx)->save;
+ struct vbo_save_vertex_list *node;
+
+ /* Allocate space for this structure in the display list currently
+ * being compiled.
+ */
+ node = (struct vbo_save_vertex_list *)
+ _mesa_dlist_alloc(ctx, save->opcode_vertex_list, sizeof(*node));
+
+ if (!node)
+ return;
+
+ /* Duplicate our template, increment refcounts to the storage structs:
+ */
+ memcpy(node->attrsz, save->attrsz, sizeof(node->attrsz));
+ node->vertex_size = save->vertex_size;
+ node->buffer_offset = (save->buffer - save->vertex_store->buffer) * sizeof(GLfloat);
+ node->count = save->vert_count;
+ node->wrap_count = save->copied.nr;
+ node->dangling_attr_ref = save->dangling_attr_ref;
+ node->prim = save->prim;
+ node->prim_count = save->prim_count;
+ node->vertex_store = save->vertex_store;
+ node->prim_store = save->prim_store;
+
+ node->vertex_store->refcount++;
+ node->prim_store->refcount++;
+
+ if (node->prim[0].no_current_update) {
+ node->current_size = 0;
+ node->current_data = NULL;
+ } else {
+ node->current_size = node->vertex_size - node->attrsz[0];
+ node->current_data = NULL;
+
+ if (node->current_size) {
+ /* If the malloc fails, we just pull the data out of the VBO
+ * later instead.
+ */
+ node->current_data = MALLOC( node->current_size * sizeof(GLfloat) );
+ if (node->current_data) {
+ const char *buffer = (const char *)save->vertex_store->buffer;
+ unsigned attr_offset = node->attrsz[0] * sizeof(GLfloat);
+ unsigned vertex_offset = 0;
+
+ if (node->count)
+ vertex_offset = (node->count-1) * node->vertex_size * sizeof(GLfloat);
+
+ memcpy( node->current_data,
+ buffer + node->buffer_offset + vertex_offset + attr_offset,
+ node->current_size * sizeof(GLfloat) );
+ }
+ }
+ }
+
+
+
+ assert(node->attrsz[VBO_ATTRIB_POS] != 0 ||
+ node->count == 0);
+
+ if (save->dangling_attr_ref)
+ ctx->ListState.CurrentList->Flags |= DLIST_DANGLING_REFS;
+
+ save->vertex_store->used += save->vertex_size * node->count;
+ save->prim_store->used += node->prim_count;
+
+
+ /* Copy duplicated vertices
+ */
+ save->copied.nr = _save_copy_vertices( ctx, node, save->buffer );
+
+
+ /* Deal with GL_COMPILE_AND_EXECUTE:
+ */
+ if (ctx->ExecuteFlag) {
+ struct _glapi_table *dispatch = GET_DISPATCH();
+
+ _glapi_set_dispatch(ctx->Exec);
+
+ vbo_loopback_vertex_list( ctx,
+ (const GLfloat *)((const char *)save->vertex_store->buffer +
+ node->buffer_offset),
+ node->attrsz,
+ node->prim,
+ node->prim_count,
+ node->wrap_count,
+ node->vertex_size);
+
+ _glapi_set_dispatch(dispatch);
+ }
+
+
+ /* Decide whether the storage structs are full, or can be used for
+ * the next vertex lists as well.
+ */
+ if (save->vertex_store->used >
+ VBO_SAVE_BUFFER_SIZE - 16 * (save->vertex_size + 4)) {
+
+ /* Unmap old store:
+ */
+ unmap_vertex_store( ctx, save->vertex_store );
+
+ /* Release old reference:
+ */
+ save->vertex_store->refcount--;
+ assert(save->vertex_store->refcount != 0);
+ save->vertex_store = NULL;
+
+ /* Allocate and map new store:
+ */
+ save->vertex_store = alloc_vertex_store( ctx );
+ save->buffer_ptr = map_vertex_store( ctx, save->vertex_store );
+ }
+
+ if (save->prim_store->used > VBO_SAVE_PRIM_SIZE - 6) {
+ save->prim_store->refcount--;
+ assert(save->prim_store->refcount != 0);
+ save->prim_store = alloc_prim_store( ctx );
+ }
+
+ /* Reset our structures for the next run of vertices:
+ */
+ _save_reset_counters( ctx );
+}
+
+
+/* TODO -- If no new vertices have been stored, don't bother saving
+ * it.
+ */
+static void _save_wrap_buffers( struct gl_context *ctx )
+{
+ struct vbo_save_context *save = &vbo_context(ctx)->save;
+ GLint i = save->prim_count - 1;
+ GLenum mode;
+ GLboolean weak;
+ GLboolean no_current_update;
+
+ assert(i < (GLint) save->prim_max);
+ assert(i >= 0);
+
+ /* Close off in-progress primitive.
+ */
+ save->prim[i].count = (save->vert_count -
+ save->prim[i].start);
+ mode = save->prim[i].mode;
+ weak = save->prim[i].weak;
+ no_current_update = save->prim[i].no_current_update;
+
+ /* store the copied vertices, and allocate a new list.
+ */
+ _save_compile_vertex_list( ctx );
+
+ /* Restart interrupted primitive
+ */
+ save->prim[0].mode = mode;
+ save->prim[0].weak = weak;
+ save->prim[0].no_current_update = no_current_update;
+ save->prim[0].begin = 0;
+ save->prim[0].end = 0;
+ save->prim[0].pad = 0;
+ save->prim[0].start = 0;
+ save->prim[0].count = 0;
+ save->prim[0].num_instances = 1;
+ save->prim_count = 1;
+}
+
+
+
+/* Called only when buffers are wrapped as the result of filling the
+ * vertex_store struct.
+ */
+static void _save_wrap_filled_vertex( struct gl_context *ctx )
+{
+ struct vbo_save_context *save = &vbo_context(ctx)->save;
+ GLfloat *data = save->copied.buffer;
+ GLuint i;
+
+ /* Emit a glEnd to close off the last vertex list.
+ */
+ _save_wrap_buffers( ctx );
+
+ /* Copy stored stored vertices to start of new list.
+ */
+ assert(save->max_vert - save->vert_count > save->copied.nr);
+
+ for (i = 0 ; i < save->copied.nr ; i++) {
+ memcpy( save->buffer_ptr, data, save->vertex_size * sizeof(GLfloat));
+ data += save->vertex_size;
+ save->buffer_ptr += save->vertex_size;
+ save->vert_count++;
+ }
+}
+
+
+static void _save_copy_to_current( struct gl_context *ctx )
+{
+ struct vbo_save_context *save = &vbo_context(ctx)->save;
+ GLuint i;
+
+ for (i = VBO_ATTRIB_POS+1 ; i < VBO_ATTRIB_MAX ; i++) {
+ if (save->attrsz[i]) {
+ save->currentsz[i][0] = save->attrsz[i];
+ COPY_CLEAN_4V(save->current[i],
+ save->attrsz[i],
+ save->attrptr[i]);
+ }
+ }
+}
+
+
+static void _save_copy_from_current( struct gl_context *ctx )
+{
+ struct vbo_save_context *save = &vbo_context(ctx)->save;
+ GLint i;
+
+ for (i = VBO_ATTRIB_POS+1 ; i < VBO_ATTRIB_MAX ; i++) {
+ switch (save->attrsz[i]) {
+ case 4: save->attrptr[i][3] = save->current[i][3];
+ case 3: save->attrptr[i][2] = save->current[i][2];
+ case 2: save->attrptr[i][1] = save->current[i][1];
+ case 1: save->attrptr[i][0] = save->current[i][0];
+ case 0: break;
+ }
+ }
+}
+
+
+
+
+/* Flush existing data, set new attrib size, replay copied vertices.
+ */
+static void _save_upgrade_vertex( struct gl_context *ctx,
+ GLuint attr,
+ GLuint newsz )
+{
+ struct vbo_save_context *save = &vbo_context(ctx)->save;
+ GLuint oldsz;
+ GLuint i;
+ GLfloat *tmp;
+
+ /* Store the current run of vertices, and emit a GL_END. Emit a
+ * BEGIN in the new buffer.
+ */
+ if (save->vert_count)
+ _save_wrap_buffers( ctx );
+ else
+ assert( save->copied.nr == 0 );
+
+ /* Do a COPY_TO_CURRENT to ensure back-copying works for the case
+ * when the attribute already exists in the vertex and is having
+ * its size increased.
+ */
+ _save_copy_to_current( ctx );
+
+ /* Fix up sizes:
+ */
+ oldsz = save->attrsz[attr];
+ save->attrsz[attr] = newsz;
+
+ save->vertex_size += newsz - oldsz;
+ save->max_vert = ((VBO_SAVE_BUFFER_SIZE - save->vertex_store->used) /
+ save->vertex_size);
+ save->vert_count = 0;
+
+ /* Recalculate all the attrptr[] values:
+ */
+ for (i = 0, tmp = save->vertex ; i < VBO_ATTRIB_MAX ; i++) {
+ if (save->attrsz[i]) {
+ save->attrptr[i] = tmp;
+ tmp += save->attrsz[i];
+ }
+ else
+ save->attrptr[i] = NULL; /* will not be dereferenced. */
+ }
+
+ /* Copy from current to repopulate the vertex with correct values.
+ */
+ _save_copy_from_current( ctx );
+
+ /* Replay stored vertices to translate them to new format here.
+ *
+ * If there are copied vertices and the new (upgraded) attribute
+ * has not been defined before, this list is somewhat degenerate,
+ * and will need fixup at runtime.
+ */
+ if (save->copied.nr)
+ {
+ GLfloat *data = save->copied.buffer;
+ GLfloat *dest = save->buffer;
+ GLuint j;
+
+ /* Need to note this and fix up at runtime (or loopback):
+ */
+ if (attr != VBO_ATTRIB_POS && save->currentsz[attr][0] == 0) {
+ assert(oldsz == 0);
+ save->dangling_attr_ref = GL_TRUE;
+ }
+
+ for (i = 0 ; i < save->copied.nr ; i++) {
+ for (j = 0 ; j < VBO_ATTRIB_MAX ; j++) {
+ if (save->attrsz[j]) {
+ if (j == attr) {
+ if (oldsz) {
+ COPY_CLEAN_4V( dest, oldsz, data );
+ data += oldsz;
+ dest += newsz;
+ }
+ else {
+ COPY_SZ_4V( dest, newsz, save->current[attr] );
+ dest += newsz;
+ }
+ }
+ else {
+ GLint sz = save->attrsz[j];
+ COPY_SZ_4V( dest, sz, data );
+ data += sz;
+ dest += sz;
+ }
+ }
+ }
+ }
+
+ save->buffer_ptr = dest;
+ save->vert_count += save->copied.nr;
+ }
+}
+
+static void save_fixup_vertex( struct gl_context *ctx, GLuint attr, GLuint sz )
+{
+ struct vbo_save_context *save = &vbo_context(ctx)->save;
+
+ if (sz > save->attrsz[attr]) {
+ /* New size is larger. Need to flush existing vertices and get
+ * an enlarged vertex format.
+ */
+ _save_upgrade_vertex( ctx, attr, sz );
+ }
+ else if (sz < save->active_sz[attr]) {
+ static GLfloat id[4] = { 0, 0, 0, 1 };
+ GLuint i;
+
+ /* New size is equal or smaller - just need to fill in some
+ * zeros.
+ */
+ for (i = sz ; i <= save->attrsz[attr] ; i++)
+ save->attrptr[attr][i-1] = id[i-1];
+ }
+
+ save->active_sz[attr] = sz;
+}
+
+static void _save_reset_vertex( struct gl_context *ctx )
+{
+ struct vbo_save_context *save = &vbo_context(ctx)->save;
+ GLuint i;
+
+ for (i = 0 ; i < VBO_ATTRIB_MAX ; i++) {
+ save->attrsz[i] = 0;
+ save->active_sz[i] = 0;
+ }
+
+ save->vertex_size = 0;
+}
+
+
+
+#define ERROR(err) _mesa_compile_error( ctx, err, __FUNCTION__ );
+
+
+/* Only one size for each attribute may be active at once. Eg. if
+ * Color3f is installed/active, then Color4f may not be, even if the
+ * vertex actually contains 4 color coordinates. This is because the
+ * 3f version won't otherwise set color[3] to 1.0 -- this is the job
+ * of the chooser function when switching between Color4f and Color3f.
+ */
+#define ATTR( A, N, V0, V1, V2, V3 ) \
+do { \
+ struct vbo_save_context *save = &vbo_context(ctx)->save; \
+ \
+ if (save->active_sz[A] != N) \
+ save_fixup_vertex(ctx, A, N); \
+ \
+ { \
+ GLfloat *dest = save->attrptr[A]; \
+ if (N>0) dest[0] = V0; \
+ if (N>1) dest[1] = V1; \
+ if (N>2) dest[2] = V2; \
+ if (N>3) dest[3] = V3; \
+ } \
+ \
+ if ((A) == 0) { \
+ GLuint i; \
+ \
+ for (i = 0; i < save->vertex_size; i++) \
+ save->buffer_ptr[i] = save->vertex[i]; \
+ \
+ save->buffer_ptr += save->vertex_size; \
+ \
+ if (++save->vert_count >= save->max_vert) \
+ _save_wrap_filled_vertex( ctx ); \
+ } \
+} while (0)
+
+#define TAG(x) _save_##x
+
+#include "vbo_attrib_tmp.h"
+
+
+
+
+/* Cope with EvalCoord/CallList called within a begin/end object:
+ * -- Flush current buffer
+ * -- Fallback to opcodes for the rest of the begin/end object.
+ */
+static void DO_FALLBACK( struct gl_context *ctx )
+{
+ struct vbo_save_context *save = &vbo_context(ctx)->save;
+
+ if (save->vert_count || save->prim_count) {
+ GLint i = save->prim_count - 1;
+
+ /* Close off in-progress primitive.
+ */
+ save->prim[i].count = (save->vert_count -
+ save->prim[i].start);
+
+ /* Need to replay this display list with loopback,
+ * unfortunately, otherwise this primitive won't be handled
+ * properly:
+ */
+ save->dangling_attr_ref = 1;
+
+ _save_compile_vertex_list( ctx );
+ }
+
+ _save_copy_to_current( ctx );
+ _save_reset_vertex( ctx );
+ _save_reset_counters( ctx );
+ _mesa_install_save_vtxfmt( ctx, &ctx->ListState.ListVtxfmt );
+ ctx->Driver.SaveNeedFlush = 0;
+}
+
+static void GLAPIENTRY _save_EvalCoord1f( GLfloat u )
+{
+ GET_CURRENT_CONTEXT(ctx);
+ DO_FALLBACK(ctx);
+ CALL_EvalCoord1f(ctx->Save, (u));
+}
+
+static void GLAPIENTRY _save_EvalCoord1fv( const GLfloat *v )
+{
+ GET_CURRENT_CONTEXT(ctx);
+ DO_FALLBACK(ctx);
+ CALL_EvalCoord1fv(ctx->Save, (v));
+}
+
+static void GLAPIENTRY _save_EvalCoord2f( GLfloat u, GLfloat v )
+{
+ GET_CURRENT_CONTEXT(ctx);
+ DO_FALLBACK(ctx);
+ CALL_EvalCoord2f(ctx->Save, (u, v));
+}
+
+static void GLAPIENTRY _save_EvalCoord2fv( const GLfloat *v )
+{
+ GET_CURRENT_CONTEXT(ctx);
+ DO_FALLBACK(ctx);
+ CALL_EvalCoord2fv(ctx->Save, (v));
+}
+
+static void GLAPIENTRY _save_EvalPoint1( GLint i )
+{
+ GET_CURRENT_CONTEXT(ctx);
+ DO_FALLBACK(ctx);
+ CALL_EvalPoint1(ctx->Save, (i));
+}
+
+static void GLAPIENTRY _save_EvalPoint2( GLint i, GLint j )
+{
+ GET_CURRENT_CONTEXT(ctx);
+ DO_FALLBACK(ctx);
+ CALL_EvalPoint2(ctx->Save, (i, j));
+}
+
+static void GLAPIENTRY _save_CallList( GLuint l )
+{
+ GET_CURRENT_CONTEXT(ctx);
+ DO_FALLBACK(ctx);
+ CALL_CallList(ctx->Save, (l));
+}
+
+static void GLAPIENTRY _save_CallLists( GLsizei n, GLenum type, const GLvoid *v )
+{
+ GET_CURRENT_CONTEXT(ctx);
+ DO_FALLBACK(ctx);
+ CALL_CallLists(ctx->Save, (n, type, v));
+}
+
+
+
+
+/* This begin is hooked into ... Updating of
+ * ctx->Driver.CurrentSavePrimitive is already taken care of.
+ */
+GLboolean vbo_save_NotifyBegin( struct gl_context *ctx, GLenum mode )
+{
+ struct vbo_save_context *save = &vbo_context(ctx)->save;
+
+ GLuint i = save->prim_count++;
+
+ assert(i < save->prim_max);
+ save->prim[i].mode = mode & VBO_SAVE_PRIM_MODE_MASK;
+ save->prim[i].begin = 1;
+ save->prim[i].end = 0;
+ save->prim[i].weak = (mode & VBO_SAVE_PRIM_WEAK) ? 1 : 0;
+ save->prim[i].no_current_update = (mode & VBO_SAVE_PRIM_NO_CURRENT_UPDATE) ? 1 : 0;
+ save->prim[i].pad = 0;
+ save->prim[i].start = save->vert_count;
+ save->prim[i].count = 0;
+ save->prim[i].num_instances = 1;
+
+ _mesa_install_save_vtxfmt( ctx, &save->vtxfmt );
+ ctx->Driver.SaveNeedFlush = 1;
+ return GL_TRUE;
+}
+
+
+
+static void GLAPIENTRY _save_End( void )
+{
+ GET_CURRENT_CONTEXT( ctx );
+ struct vbo_save_context *save = &vbo_context(ctx)->save;
+ GLint i = save->prim_count - 1;
+
+ ctx->Driver.CurrentSavePrimitive = PRIM_OUTSIDE_BEGIN_END;
+ save->prim[i].end = 1;
+ save->prim[i].count = (save->vert_count -
+ save->prim[i].start);
+
+ if (i == (GLint) save->prim_max - 1) {
+ _save_compile_vertex_list( ctx );
+ assert(save->copied.nr == 0);
+ }
+
+ /* Swap out this vertex format while outside begin/end. Any color,
+ * etc. received between here and the next begin will be compiled
+ * as opcodes.
+ */
+ _mesa_install_save_vtxfmt( ctx, &ctx->ListState.ListVtxfmt );
+}
+
+
+/* These are all errors as this vtxfmt is only installed inside
+ * begin/end pairs.
+ */
+static void GLAPIENTRY _save_DrawElements(GLenum mode, GLsizei count, GLenum type,
+ const GLvoid *indices)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ (void) mode; (void) count; (void) type; (void) indices;
+ _mesa_compile_error( ctx, GL_INVALID_OPERATION, "glDrawElements" );
+}
+
+
+static void GLAPIENTRY _save_DrawRangeElements(GLenum mode,
+ GLuint start, GLuint end,
+ GLsizei count, GLenum type,
+ const GLvoid *indices)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ (void) mode; (void) start; (void) end; (void) count; (void) type; (void) indices;
+ _mesa_compile_error( ctx, GL_INVALID_OPERATION, "glDrawRangeElements" );
+}
+
+static void GLAPIENTRY _save_DrawElementsBaseVertex(GLenum mode,
+ GLsizei count,
+ GLenum type,
+ const GLvoid *indices,
+ GLint basevertex)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ (void) mode; (void) count; (void) type; (void) indices; (void)basevertex;
+
+ _mesa_compile_error( ctx, GL_INVALID_OPERATION, "glDrawElements" );
+}
+
+static void GLAPIENTRY _save_DrawRangeElementsBaseVertex(GLenum mode,
+ GLuint start,
+ GLuint end,
+ GLsizei count,
+ GLenum type,
+ const GLvoid *indices,
+ GLint basevertex)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ (void) mode; (void) start; (void) end; (void) count; (void) type;
+ (void) indices; (void)basevertex;
+
+ _mesa_compile_error( ctx, GL_INVALID_OPERATION, "glDrawRangeElements" );
+}
+
+static void GLAPIENTRY _save_DrawArrays(GLenum mode, GLint start, GLsizei count)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ (void) mode; (void) start; (void) count;
+ _mesa_compile_error( ctx, GL_INVALID_OPERATION, "glDrawArrays" );
+}
+
+static void GLAPIENTRY _save_Rectf( GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2 )
+{
+ GET_CURRENT_CONTEXT(ctx);
+ (void) x1; (void) y1; (void) x2; (void) y2;
+ _mesa_compile_error( ctx, GL_INVALID_OPERATION, "glRectf" );
+}
+
+static void GLAPIENTRY _save_EvalMesh1( GLenum mode, GLint i1, GLint i2 )
+{
+ GET_CURRENT_CONTEXT(ctx);
+ (void) mode; (void) i1; (void) i2;
+ _mesa_compile_error( ctx, GL_INVALID_OPERATION, "glEvalMesh1" );
+}
+
+static void GLAPIENTRY _save_EvalMesh2( GLenum mode, GLint i1, GLint i2,
+ GLint j1, GLint j2 )
+{
+ GET_CURRENT_CONTEXT(ctx);
+ (void) mode; (void) i1; (void) i2; (void) j1; (void) j2;
+ _mesa_compile_error( ctx, GL_INVALID_OPERATION, "glEvalMesh2" );
+}
+
+static void GLAPIENTRY _save_Begin( GLenum mode )
+{
+ GET_CURRENT_CONTEXT( ctx );
+ (void) mode;
+ _mesa_compile_error( ctx, GL_INVALID_OPERATION, "Recursive glBegin" );
+}
+
+
+static void GLAPIENTRY _save_PrimitiveRestartNV( void )
+{
+ GLenum curPrim;
+ GET_CURRENT_CONTEXT( ctx );
+
+ curPrim = ctx->Driver.CurrentSavePrimitive;
+
+ _save_End();
+ _save_Begin(curPrim);
+}
+
+
+/* Unlike the functions above, these are to be hooked into the vtxfmt
+ * maintained in ctx->ListState, active when the list is known or
+ * suspected to be outside any begin/end primitive.
+ */
+static void GLAPIENTRY _save_OBE_Rectf( GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2 )
+{
+ GET_CURRENT_CONTEXT(ctx);
+ vbo_save_NotifyBegin( ctx, GL_QUADS | VBO_SAVE_PRIM_WEAK );
+ CALL_Vertex2f(GET_DISPATCH(), ( x1, y1 ));
+ CALL_Vertex2f(GET_DISPATCH(), ( x2, y1 ));
+ CALL_Vertex2f(GET_DISPATCH(), ( x2, y2 ));
+ CALL_Vertex2f(GET_DISPATCH(), ( x1, y2 ));
+ CALL_End(GET_DISPATCH(), ());
+}
+
+
+static void GLAPIENTRY _save_OBE_DrawArrays(GLenum mode, GLint start, GLsizei count)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ GLint i;
+
+ if (!_mesa_validate_DrawArrays( ctx, mode, start, count ))
+ return;
+
+ _ae_map_vbos( ctx );
+
+ vbo_save_NotifyBegin( ctx, mode | VBO_SAVE_PRIM_WEAK | VBO_SAVE_PRIM_NO_CURRENT_UPDATE);
+
+ for (i = 0; i < count; i++)
+ CALL_ArrayElement(GET_DISPATCH(), (start + i));
+ CALL_End(GET_DISPATCH(), ());
+
+ _ae_unmap_vbos( ctx );
+}
+
+/* Could do better by copying the arrays and element list intact and
+ * then emitting an indexed prim at runtime.
+ */
+static void GLAPIENTRY _save_OBE_DrawElements(GLenum mode, GLsizei count, GLenum type,
+ const GLvoid *indices)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ GLint i;
+
+ if (!_mesa_validate_DrawElements( ctx, mode, count, type, indices, 0 ))
+ return;
+
+ _ae_map_vbos( ctx );
+
+ if (_mesa_is_bufferobj(ctx->Array.ElementArrayBufferObj))
+ indices = ADD_POINTERS(ctx->Array.ElementArrayBufferObj->Pointer, indices);
+
+ vbo_save_NotifyBegin( ctx, mode | VBO_SAVE_PRIM_WEAK | VBO_SAVE_PRIM_NO_CURRENT_UPDATE );
+
+ switch (type) {
+ case GL_UNSIGNED_BYTE:
+ for (i = 0 ; i < count ; i++)
+ CALL_ArrayElement(GET_DISPATCH(), ( ((GLubyte *)indices)[i] ));
+ break;
+ case GL_UNSIGNED_SHORT:
+ for (i = 0 ; i < count ; i++)
+ CALL_ArrayElement(GET_DISPATCH(), ( ((GLushort *)indices)[i] ));
+ break;
+ case GL_UNSIGNED_INT:
+ for (i = 0 ; i < count ; i++)
+ CALL_ArrayElement(GET_DISPATCH(), ( ((GLuint *)indices)[i] ));
+ break;
+ default:
+ _mesa_error( ctx, GL_INVALID_ENUM, "glDrawElements(type)" );
+ break;
+ }
+
+ CALL_End(GET_DISPATCH(), ());
+
+ _ae_unmap_vbos( ctx );
+}
+
+static void GLAPIENTRY _save_OBE_DrawRangeElements(GLenum mode,
+ GLuint start, GLuint end,
+ GLsizei count, GLenum type,
+ const GLvoid *indices)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ if (_mesa_validate_DrawRangeElements( ctx, mode,
+ start, end,
+ count, type, indices, 0 ))
+ _save_OBE_DrawElements( mode, count, type, indices );
+}
+
+
+
+
+
+static void _save_vtxfmt_init( struct gl_context *ctx )
+{
+ struct vbo_save_context *save = &vbo_context(ctx)->save;
+ GLvertexformat *vfmt = &save->vtxfmt;
+
+ _MESA_INIT_ARRAYELT_VTXFMT(vfmt, _ae_);
+
+ vfmt->Begin = _save_Begin;
+ vfmt->Color3f = _save_Color3f;
+ vfmt->Color3fv = _save_Color3fv;
+ vfmt->Color4f = _save_Color4f;
+ vfmt->Color4fv = _save_Color4fv;
+ vfmt->EdgeFlag = _save_EdgeFlag;
+ vfmt->End = _save_End;
+ vfmt->PrimitiveRestartNV = _save_PrimitiveRestartNV;
+ vfmt->FogCoordfEXT = _save_FogCoordfEXT;
+ vfmt->FogCoordfvEXT = _save_FogCoordfvEXT;
+ vfmt->Indexf = _save_Indexf;
+ vfmt->Indexfv = _save_Indexfv;
+ vfmt->Materialfv = _save_Materialfv;
+ vfmt->MultiTexCoord1fARB = _save_MultiTexCoord1f;
+ vfmt->MultiTexCoord1fvARB = _save_MultiTexCoord1fv;
+ vfmt->MultiTexCoord2fARB = _save_MultiTexCoord2f;
+ vfmt->MultiTexCoord2fvARB = _save_MultiTexCoord2fv;
+ vfmt->MultiTexCoord3fARB = _save_MultiTexCoord3f;
+ vfmt->MultiTexCoord3fvARB = _save_MultiTexCoord3fv;
+ vfmt->MultiTexCoord4fARB = _save_MultiTexCoord4f;
+ vfmt->MultiTexCoord4fvARB = _save_MultiTexCoord4fv;
+ vfmt->Normal3f = _save_Normal3f;
+ vfmt->Normal3fv = _save_Normal3fv;
+ vfmt->SecondaryColor3fEXT = _save_SecondaryColor3fEXT;
+ vfmt->SecondaryColor3fvEXT = _save_SecondaryColor3fvEXT;
+ vfmt->TexCoord1f = _save_TexCoord1f;
+ vfmt->TexCoord1fv = _save_TexCoord1fv;
+ vfmt->TexCoord2f = _save_TexCoord2f;
+ vfmt->TexCoord2fv = _save_TexCoord2fv;
+ vfmt->TexCoord3f = _save_TexCoord3f;
+ vfmt->TexCoord3fv = _save_TexCoord3fv;
+ vfmt->TexCoord4f = _save_TexCoord4f;
+ vfmt->TexCoord4fv = _save_TexCoord4fv;
+ vfmt->Vertex2f = _save_Vertex2f;
+ vfmt->Vertex2fv = _save_Vertex2fv;
+ vfmt->Vertex3f = _save_Vertex3f;
+ vfmt->Vertex3fv = _save_Vertex3fv;
+ vfmt->Vertex4f = _save_Vertex4f;
+ vfmt->Vertex4fv = _save_Vertex4fv;
+ vfmt->VertexAttrib1fARB = _save_VertexAttrib1fARB;
+ vfmt->VertexAttrib1fvARB = _save_VertexAttrib1fvARB;
+ vfmt->VertexAttrib2fARB = _save_VertexAttrib2fARB;
+ vfmt->VertexAttrib2fvARB = _save_VertexAttrib2fvARB;
+ vfmt->VertexAttrib3fARB = _save_VertexAttrib3fARB;
+ vfmt->VertexAttrib3fvARB = _save_VertexAttrib3fvARB;
+ vfmt->VertexAttrib4fARB = _save_VertexAttrib4fARB;
+ vfmt->VertexAttrib4fvARB = _save_VertexAttrib4fvARB;
+
+ vfmt->VertexAttrib1fNV = _save_VertexAttrib1fNV;
+ vfmt->VertexAttrib1fvNV = _save_VertexAttrib1fvNV;
+ vfmt->VertexAttrib2fNV = _save_VertexAttrib2fNV;
+ vfmt->VertexAttrib2fvNV = _save_VertexAttrib2fvNV;
+ vfmt->VertexAttrib3fNV = _save_VertexAttrib3fNV;
+ vfmt->VertexAttrib3fvNV = _save_VertexAttrib3fvNV;
+ vfmt->VertexAttrib4fNV = _save_VertexAttrib4fNV;
+ vfmt->VertexAttrib4fvNV = _save_VertexAttrib4fvNV;
+
+ /* integer-valued */
+ vfmt->VertexAttribI1i = _save_VertexAttribI1i;
+ vfmt->VertexAttribI2i = _save_VertexAttribI2i;
+ vfmt->VertexAttribI3i = _save_VertexAttribI3i;
+ vfmt->VertexAttribI4i = _save_VertexAttribI4i;
+ vfmt->VertexAttribI2iv = _save_VertexAttribI2iv;
+ vfmt->VertexAttribI3iv = _save_VertexAttribI3iv;
+ vfmt->VertexAttribI4iv = _save_VertexAttribI4iv;
+
+ /* unsigned integer-valued */
+ vfmt->VertexAttribI1ui = _save_VertexAttribI1ui;
+ vfmt->VertexAttribI2ui = _save_VertexAttribI2ui;
+ vfmt->VertexAttribI3ui = _save_VertexAttribI3ui;
+ vfmt->VertexAttribI4ui = _save_VertexAttribI4ui;
+ vfmt->VertexAttribI2uiv = _save_VertexAttribI2uiv;
+ vfmt->VertexAttribI3uiv = _save_VertexAttribI3uiv;
+ vfmt->VertexAttribI4uiv = _save_VertexAttribI4uiv;
+
+ /* This will all require us to fallback to saving the list as opcodes:
+ */
+ _MESA_INIT_DLIST_VTXFMT(vfmt, _save_); /* inside begin/end */
+
+ _MESA_INIT_EVAL_VTXFMT(vfmt, _save_);
+
+ /* These are all errors as we at least know we are in some sort of
+ * begin/end pair:
+ */
+ vfmt->Begin = _save_Begin;
+ vfmt->Rectf = _save_Rectf;
+ vfmt->DrawArrays = _save_DrawArrays;
+ vfmt->DrawElements = _save_DrawElements;
+ vfmt->DrawRangeElements = _save_DrawRangeElements;
+ vfmt->DrawElementsBaseVertex = _save_DrawElementsBaseVertex;
+ vfmt->DrawRangeElementsBaseVertex = _save_DrawRangeElementsBaseVertex;
+ /* Loops back into vfmt->DrawElements */
+ vfmt->MultiDrawElementsEXT = _mesa_noop_MultiDrawElements;
+ vfmt->MultiDrawElementsBaseVertex = _mesa_noop_MultiDrawElementsBaseVertex;
+}
+
+
+void vbo_save_SaveFlushVertices( struct gl_context *ctx )
+{
+ struct vbo_save_context *save = &vbo_context(ctx)->save;
+
+ /* Noop when we are actually active:
+ */
+ if (ctx->Driver.CurrentSavePrimitive == PRIM_INSIDE_UNKNOWN_PRIM ||
+ ctx->Driver.CurrentSavePrimitive <= GL_POLYGON)
+ return;
+
+ if (save->vert_count ||
+ save->prim_count)
+ _save_compile_vertex_list( ctx );
+
+ _save_copy_to_current( ctx );
+ _save_reset_vertex( ctx );
+ _save_reset_counters( ctx );
+ ctx->Driver.SaveNeedFlush = 0;
+}
+
+void vbo_save_NewList( struct gl_context *ctx, GLuint list, GLenum mode )
+{
+ struct vbo_save_context *save = &vbo_context(ctx)->save;
+
+ (void) list; (void) mode;
+
+ if (!save->prim_store)
+ save->prim_store = alloc_prim_store( ctx );
+
+ if (!save->vertex_store)
+ save->vertex_store = alloc_vertex_store( ctx );
+
+ save->buffer_ptr = map_vertex_store( ctx, save->vertex_store );
+
+ _save_reset_vertex( ctx );
+ _save_reset_counters( ctx );
+ ctx->Driver.SaveNeedFlush = 0;
+}
+
+void vbo_save_EndList( struct gl_context *ctx )
+{
+ struct vbo_save_context *save = &vbo_context(ctx)->save;
+
+ /* EndList called inside a (saved) Begin/End pair?
+ */
+ if (ctx->Driver.CurrentSavePrimitive != PRIM_OUTSIDE_BEGIN_END) {
+
+ if (save->prim_count > 0) {
+ GLint i = save->prim_count - 1;
+ ctx->Driver.CurrentSavePrimitive = PRIM_OUTSIDE_BEGIN_END;
+ save->prim[i].end = 0;
+ save->prim[i].count = (save->vert_count -
+ save->prim[i].start);
+ }
+
+ /* Make sure this vertex list gets replayed by the "loopback"
+ * mechanism:
+ */
+ save->dangling_attr_ref = 1;
+ vbo_save_SaveFlushVertices( ctx );
+
+ /* Swap out this vertex format while outside begin/end. Any color,
+ * etc. received between here and the next begin will be compiled
+ * as opcodes.
+ */
+ _mesa_install_save_vtxfmt( ctx, &ctx->ListState.ListVtxfmt );
+ }
+
+ unmap_vertex_store( ctx, save->vertex_store );
+
+ assert(save->vertex_size == 0);
+}
+
+void vbo_save_BeginCallList( struct gl_context *ctx, struct gl_display_list *dlist )
+{
+ struct vbo_save_context *save = &vbo_context(ctx)->save;
+ save->replay_flags |= dlist->Flags;
+}
+
+void vbo_save_EndCallList( struct gl_context *ctx )
+{
+ struct vbo_save_context *save = &vbo_context(ctx)->save;
+
+ if (ctx->ListState.CallDepth == 1) {
+ /* This is correct: want to keep only the VBO_SAVE_FALLBACK
+ * flag, if it is set:
+ */
+ save->replay_flags &= VBO_SAVE_FALLBACK;
+ }
+}
+
+
+static void vbo_destroy_vertex_list( struct gl_context *ctx, void *data )
+{
+ struct vbo_save_vertex_list *node = (struct vbo_save_vertex_list *)data;
+ (void) ctx;
+
+ if ( --node->vertex_store->refcount == 0 )
+ free_vertex_store( ctx, node->vertex_store );
+
+ if ( --node->prim_store->refcount == 0 )
+ FREE( node->prim_store );
+
+ if (node->current_data) {
+ FREE(node->current_data);
+ node->current_data = NULL;
+ }
+}
+
+
+static void vbo_print_vertex_list( struct gl_context *ctx, void *data )
+{
+ struct vbo_save_vertex_list *node = (struct vbo_save_vertex_list *)data;
+ GLuint i;
+ (void) ctx;
+
+ printf("VBO-VERTEX-LIST, %u vertices %d primitives, %d vertsize\n",
+ node->count,
+ node->prim_count,
+ node->vertex_size);
+
+ for (i = 0 ; i < node->prim_count ; i++) {
+ struct _mesa_prim *prim = &node->prim[i];
+ _mesa_debug(NULL, " prim %d: %s%s %d..%d %s %s\n",
+ i,
+ _mesa_lookup_prim_by_nr(prim->mode),
+ prim->weak ? " (weak)" : "",
+ prim->start,
+ prim->start + prim->count,
+ (prim->begin) ? "BEGIN" : "(wrap)",
+ (prim->end) ? "END" : "(wrap)");
+ }
+}
+
+
+static void _save_current_init( struct gl_context *ctx )
+{
+ struct vbo_save_context *save = &vbo_context(ctx)->save;
+ GLint i;
+
+ for (i = VBO_ATTRIB_POS; i <= VBO_ATTRIB_GENERIC15; i++) {
+ const GLuint j = i - VBO_ATTRIB_POS;
+ ASSERT(j < VERT_ATTRIB_MAX);
+ save->currentsz[i] = &ctx->ListState.ActiveAttribSize[j];
+ save->current[i] = ctx->ListState.CurrentAttrib[j];
+ }
+
+ for (i = VBO_ATTRIB_FIRST_MATERIAL; i <= VBO_ATTRIB_LAST_MATERIAL; i++) {
+ const GLuint j = i - VBO_ATTRIB_FIRST_MATERIAL;
+ ASSERT(j < MAT_ATTRIB_MAX);
+ save->currentsz[i] = &ctx->ListState.ActiveMaterialSize[j];
+ save->current[i] = ctx->ListState.CurrentMaterial[j];
+ }
+}
+
+/**
+ * Initialize the display list compiler
+ */
+void vbo_save_api_init( struct vbo_save_context *save )
+{
+ struct gl_context *ctx = save->ctx;
+ GLuint i;
+
+ save->opcode_vertex_list =
+ _mesa_dlist_alloc_opcode( ctx,
+ sizeof(struct vbo_save_vertex_list),
+ vbo_save_playback_vertex_list,
+ vbo_destroy_vertex_list,
+ vbo_print_vertex_list );
+
+ ctx->Driver.NotifySaveBegin = vbo_save_NotifyBegin;
+
+ _save_vtxfmt_init( ctx );
+ _save_current_init( ctx );
+
+ /* These will actually get set again when binding/drawing */
+ for (i = 0; i < VBO_ATTRIB_MAX; i++)
+ save->inputs[i] = &save->arrays[i];
+
+ /* Hook our array functions into the outside-begin-end vtxfmt in
+ * ctx->ListState.
+ */
+ ctx->ListState.ListVtxfmt.Rectf = _save_OBE_Rectf;
+ ctx->ListState.ListVtxfmt.DrawArrays = _save_OBE_DrawArrays;
+ ctx->ListState.ListVtxfmt.DrawElements = _save_OBE_DrawElements;
+ ctx->ListState.ListVtxfmt.DrawRangeElements = _save_OBE_DrawRangeElements;
+ /* loops back into _save_OBE_DrawElements */
+ ctx->ListState.ListVtxfmt.MultiDrawElementsEXT = _mesa_noop_MultiDrawElements;
+ ctx->ListState.ListVtxfmt.MultiDrawElementsBaseVertex = _mesa_noop_MultiDrawElementsBaseVertex;
+ _mesa_install_save_vtxfmt( ctx, &ctx->ListState.ListVtxfmt );
+}
+
+
+#endif /* FEATURE_dlist */
diff --git a/mesalib/windows/VC8/mesa/glsl_apps_compile/glsl_apps_compile.vcproj b/mesalib/windows/VC8/mesa/glsl_apps_compile/glsl_apps_compile.vcproj
new file mode 100644
index 000000000..3fed6b466
--- /dev/null
+++ b/mesalib/windows/VC8/mesa/glsl_apps_compile/glsl_apps_compile.vcproj
@@ -0,0 +1,304 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="9,00"
+ Name="glsl_apps_compile"
+ ProjectGUID="{98AB3D51-1820-4D14-9195-75FCA6997784}"
+ RootNamespace="glsl_apps_compile"
+ Keyword="Win32Proj"
+ TargetFrameworkVersion="131072"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)"
+ ConfigurationType="1"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ PreprocessorDefinitions="_DEBUG;WIN32;_WINDOWS;_CRT_SECURE_NO_WARNINGS"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="false"
+ DebugInformationFormat="4"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile="$(OutDir)\compile.exe"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ CommandLine="copy &quot;$(OutDir)\compile.exe&quot; ..\..\..\..\src\glsl\apps"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)"
+ ConfigurationType="1"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions="NDEBUG;WIN32;_WINDOWS;_CRT_SECURE_NO_WARNINGS"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="false"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile="$(OutDir)\compile.exe"
+ LinkIncremental="1"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ CommandLine="copy &quot;$(OutDir)\compile.exe&quot; ..\..\..\..\src\glsl\apps"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
+ UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
+ >
+ <File
+ RelativePath="..\..\..\..\src\glsl\apps\compile.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\glsl\cl\sl_cl_parse.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\glsl\pp\sl_pp_context.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\glsl\pp\sl_pp_define.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\glsl\pp\sl_pp_dict.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\glsl\pp\sl_pp_error.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\glsl\pp\sl_pp_expression.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\glsl\pp\sl_pp_extension.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\glsl\pp\sl_pp_if.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\glsl\pp\sl_pp_line.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\glsl\pp\sl_pp_macro.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\glsl\pp\sl_pp_pragma.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\glsl\pp\sl_pp_process.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\glsl\pp\sl_pp_purify.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\glsl\pp\sl_pp_token.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\glsl\pp\sl_pp_token.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\glsl\pp\sl_pp_token_util.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\glsl\pp\sl_pp_version.c"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl;inc;xsd"
+ UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
+ >
+ <File
+ RelativePath="..\..\..\..\src\glsl\cl\sl_cl_parse.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\glsl\pp\sl_pp_context.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\glsl\pp\sl_pp_dict.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\glsl\pp\sl_pp_expression.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\glsl\pp\sl_pp_macro.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\glsl\pp\sl_pp_process.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\glsl\pp\sl_pp_public.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\glsl\pp\sl_pp_purify.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\glsl\pp\sl_pp_token_util.h"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Resource Files"
+ Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
+ UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
+ >
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/mesalib/windows/VC8/mesa/glsl_apps_compile/glsl_apps_compile.vcxproj b/mesalib/windows/VC8/mesa/glsl_apps_compile/glsl_apps_compile.vcxproj
new file mode 100644
index 000000000..c34f08e20
--- /dev/null
+++ b/mesalib/windows/VC8/mesa/glsl_apps_compile/glsl_apps_compile.vcxproj
@@ -0,0 +1,189 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{98AB3D51-1820-4D14-9195-75FCA6997784}</ProjectGuid>
+ <RootNamespace>glsl_apps_compile</RootNamespace>
+ <Keyword>Win32Proj</Keyword>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <CharacterSet>MultiByte</CharacterSet>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <CharacterSet>MultiByte</CharacterSet>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup>
+ <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Configuration)\</IntDir>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Configuration)\</IntDir>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
+ <TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">compile</TargetName>
+ <TargetName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">compile</TargetName>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <ClCompile>
+ <Optimization>Disabled</Optimization>
+ <PreprocessorDefinitions>_DEBUG;WIN32;_WINDOWS;_CRT_SECURE_NO_WARNINGS;INSERVER;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MinimalRebuild>true</MinimalRebuild>
+ <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ <WarningLevel>Level3</WarningLevel>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\src\mesa;..\..\..\..\src\glsl;..\..\..\..\src\mapi;..\..\..\..\..\include</AdditionalIncludeDirectories>
+ </ClCompile>
+ <Link>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <SubSystem>Console</SubSystem>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>
+ </DataExecutionPrevention>
+ <TargetMachine>MachineX86</TargetMachine>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <ClCompile>
+ <PreprocessorDefinitions>NDEBUG;WIN32;_WINDOWS;_CRT_SECURE_NO_WARNINGS;INSERVER;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ <WarningLevel>Level3</WarningLevel>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\src\mesa;..\..\..\..\src\glsl;..\..\..\..\src\mapi;..\..\..\..\..\include</AdditionalIncludeDirectories>
+ </ClCompile>
+ <Link>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <SubSystem>Console</SubSystem>
+ <OptimizeReferences>true</OptimizeReferences>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>
+ </DataExecutionPrevention>
+ <TargetMachine>MachineX86</TargetMachine>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\..\src\glsl\ast_expr.cpp" />
+ <ClCompile Include="..\..\..\..\src\glsl\ast_function.cpp" />
+ <ClCompile Include="..\..\..\..\src\glsl\ast_to_hir.cpp" />
+ <ClCompile Include="..\..\..\..\src\glsl\ast_type.cpp" />
+ <ClCompile Include="..\..\..\..\src\glsl\builtin_stubs.cpp" />
+ <ClCompile Include="..\..\..\..\src\glsl\getopt.cpp" />
+ <ClCompile Include="..\..\..\..\src\glsl\glcpp\glcpp-lex.c" />
+ <ClCompile Include="..\..\..\..\src\glsl\glcpp\glcpp-parse.c" />
+ <ClCompile Include="..\..\..\..\src\glsl\glcpp\pp.c" />
+ <ClCompile Include="..\..\..\..\src\glsl\glsl_lexer.cpp" />
+ <ClCompile Include="..\..\..\..\src\glsl\glsl_parser.cpp" />
+ <ClCompile Include="..\..\..\..\src\glsl\glsl_parser_extras.cpp" />
+ <ClCompile Include="..\..\..\..\src\glsl\glsl_symbol_table.cpp" />
+ <ClCompile Include="..\..\..\..\src\glsl\glsl_types.cpp" />
+ <ClCompile Include="..\..\..\..\src\glsl\hir_field_selection.cpp" />
+ <ClCompile Include="..\..\..\..\src\glsl\ir.cpp" />
+ <ClCompile Include="..\..\..\..\src\glsl\ir_basic_block.cpp" />
+ <ClCompile Include="..\..\..\..\src\glsl\ir_clone.cpp" />
+ <ClCompile Include="..\..\..\..\src\glsl\ir_constant_expression.cpp" />
+ <ClCompile Include="..\..\..\..\src\glsl\ir_expression_flattening.cpp" />
+ <ClCompile Include="..\..\..\..\src\glsl\ir_function.cpp" />
+ <ClCompile Include="..\..\..\..\src\glsl\ir_function_can_inline.cpp" />
+ <ClCompile Include="..\..\..\..\src\glsl\ir_hierarchical_visitor.cpp" />
+ <ClCompile Include="..\..\..\..\src\glsl\ir_hv_accept.cpp" />
+ <ClCompile Include="..\..\..\..\src\glsl\ir_import_prototypes.cpp" />
+ <ClCompile Include="..\..\..\..\src\glsl\ir_print_visitor.cpp" />
+ <ClCompile Include="..\..\..\..\src\glsl\ir_reader.cpp" />
+ <ClCompile Include="..\..\..\..\src\glsl\ir_rvalue_visitor.cpp" />
+ <ClCompile Include="..\..\..\..\src\glsl\ir_set_program_inouts.cpp" />
+ <ClCompile Include="..\..\..\..\src\glsl\ir_validate.cpp" />
+ <ClCompile Include="..\..\..\..\src\glsl\ir_variable.cpp" />
+ <ClCompile Include="..\..\..\..\src\glsl\ir_variable_refcount.cpp" />
+ <ClCompile Include="..\..\..\..\src\glsl\linker.cpp" />
+ <ClCompile Include="..\..\..\..\src\glsl\link_functions.cpp" />
+ <ClCompile Include="..\..\..\..\src\glsl\loop_analysis.cpp" />
+ <ClCompile Include="..\..\..\..\src\glsl\loop_controls.cpp" />
+ <ClCompile Include="..\..\..\..\src\glsl\loop_unroll.cpp" />
+ <ClCompile Include="..\..\..\..\src\glsl\lower_discard.cpp" />
+ <ClCompile Include="..\..\..\..\src\glsl\lower_if_to_cond_assign.cpp" />
+ <ClCompile Include="..\..\..\..\src\glsl\lower_instructions.cpp" />
+ <ClCompile Include="..\..\..\..\src\glsl\lower_jumps.cpp" />
+ <ClCompile Include="..\..\..\..\src\glsl\lower_mat_op_to_vec.cpp" />
+ <ClCompile Include="..\..\..\..\src\glsl\lower_noise.cpp" />
+ <ClCompile Include="..\..\..\..\src\glsl\lower_texture_projection.cpp" />
+ <ClCompile Include="..\..\..\..\src\glsl\lower_variable_index_to_cond_assign.cpp" />
+ <ClCompile Include="..\..\..\..\src\glsl\lower_vector.cpp" />
+ <ClCompile Include="..\..\..\..\src\glsl\lower_vec_index_to_cond_assign.cpp" />
+ <ClCompile Include="..\..\..\..\src\glsl\lower_vec_index_to_swizzle.cpp" />
+ <ClCompile Include="..\..\..\..\src\glsl\main.cpp" />
+ <ClCompile Include="..\..\..\..\src\glsl\opt_algebraic.cpp" />
+ <ClCompile Include="..\..\..\..\src\glsl\opt_constant_folding.cpp" />
+ <ClCompile Include="..\..\..\..\src\glsl\opt_constant_propagation.cpp" />
+ <ClCompile Include="..\..\..\..\src\glsl\opt_constant_variable.cpp" />
+ <ClCompile Include="..\..\..\..\src\glsl\opt_copy_propagation.cpp" />
+ <ClCompile Include="..\..\..\..\src\glsl\opt_copy_propagation_elements.cpp" />
+ <ClCompile Include="..\..\..\..\src\glsl\opt_dead_code.cpp" />
+ <ClCompile Include="..\..\..\..\src\glsl\opt_dead_code_local.cpp" />
+ <ClCompile Include="..\..\..\..\src\glsl\opt_dead_functions.cpp" />
+ <ClCompile Include="..\..\..\..\src\glsl\opt_discard_simplification.cpp" />
+ <ClCompile Include="..\..\..\..\src\glsl\opt_function_inlining.cpp" />
+ <ClCompile Include="..\..\..\..\src\glsl\opt_if_simplification.cpp" />
+ <ClCompile Include="..\..\..\..\src\glsl\opt_noop_swizzle.cpp" />
+ <ClCompile Include="..\..\..\..\src\glsl\opt_redundant_jumps.cpp" />
+ <ClCompile Include="..\..\..\..\src\glsl\opt_structure_splitting.cpp" />
+ <ClCompile Include="..\..\..\..\src\glsl\opt_swizzle_swizzle.cpp" />
+ <ClCompile Include="..\..\..\..\src\glsl\opt_tree_grafting.cpp" />
+ <ClCompile Include="..\..\..\..\src\glsl\ralloc.c" />
+ <ClCompile Include="..\..\..\..\src\glsl\strtod.c" />
+ <ClCompile Include="..\..\..\..\src\glsl\s_expression.cpp" />
+ <ClCompile Include="..\..\..\..\src\mesa\program\hash_table.c" />
+ <ClCompile Include="..\..\..\..\src\mesa\program\symbol_table.c" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\..\..\src\glsl\strtod.h" />
+ </ItemGroup>
+ <ItemGroup>
+ <CustomBuild Include="..\..\..\..\src\glsl\glsl_lexer.ll">
+ <FileType>Document</FileType>
+ <Command Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\..\..\..\src\glsl\doflexbison.bat</Command>
+ <Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\..\..\..\src\glsl\glsl_lexer.cpp;..\..\..\..\src\glsl\glcpp\glcpp-lex.c;..\..\..\..\src\glsl\glsl_parser.cpp;..\..\..\..\src\glsl\glsl_parser.h;..\..\..\..\src\glsl\glcpp\glcpp-parse.c;..\..\..\..\src\glsl\glcpp\glcpp-parse.h</Outputs>
+ <Command Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">..\..\..\..\src\glsl\doflexbison.bat</Command>
+ <Outputs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">..\..\..\..\src\glsl\glsl_lexer.cpp;..\..\..\..\src\glsl\glcpp\glcpp-lex.c;..\..\..\..\src\glsl\glsl_parser.cpp;..\..\..\..\src\glsl\glsl_parser.h;..\..\..\..\src\glsl\glcpp\glcpp-parse.c;..\..\..\..\src\glsl\glcpp\glcpp-parse.h</Outputs>
+ <AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\..\..\..\src\glsl\glsl_parser.yy;%(AdditionalInputs)</AdditionalInputs>
+ <AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">..\..\..\..\src\glsl\glsl_parser.yy;%(AdditionalInputs)</AdditionalInputs>
+ </CustomBuild>
+ <None Include="..\..\..\..\src\glsl\glsl_parser.yy">
+ <Command Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\..\..\..\src\glsl\dobison.bat</Command>
+ <Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\..\..\..\src\glsl\glsl_parser.cpp;..\..\..\..\src\glsl\glsl_parser.h;..\..\..\..\src\glsl\glcpp\glcpp-parse.c;..\..\..\..\src\glsl\glcpp\glcpp-parse.h</Outputs>
+ <Command Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">..\..\..\..\src\glsl\dobison.bat</Command>
+ <Outputs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">..\..\..\..\src\glsl\glsl_parser.cpp;..\..\..\..\src\glsl\glsl_parser.h;..\..\..\..\src\glsl\glcpp\glcpp-parse.c;..\..\..\..\src\glsl\glcpp\glcpp-parse.h</Outputs>
+ <FileType>Document</FileType>
+ </None>
+ </ItemGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project> \ No newline at end of file
diff --git a/mesalib/windows/VC8/mesa/glsl_apps_compile/glsl_apps_compile.vcxproj.filters b/mesalib/windows/VC8/mesa/glsl_apps_compile/glsl_apps_compile.vcxproj.filters
new file mode 100644
index 000000000..57c32b876
--- /dev/null
+++ b/mesalib/windows/VC8/mesa/glsl_apps_compile/glsl_apps_compile.vcxproj.filters
@@ -0,0 +1,247 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="Source Files">
+ <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
+ <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+ </Filter>
+ <Filter Include="Header Files">
+ <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
+ <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
+ </Filter>
+ <Filter Include="Resource Files">
+ <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
+ <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav</Extensions>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\..\src\glsl\ast_expr.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\glsl\ast_function.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\glsl\ast_to_hir.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\glsl\ast_type.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\glsl\glsl_lexer.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\glsl\glsl_parser.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\glsl\glsl_parser_extras.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\glsl\glsl_symbol_table.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\glsl\glsl_types.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\glsl\hir_field_selection.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\glsl\ir.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\glsl\ir_basic_block.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\glsl\ir_clone.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\glsl\ir_constant_expression.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\glsl\ir_expression_flattening.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\glsl\ir_function.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\glsl\ir_function_can_inline.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\glsl\ir_hierarchical_visitor.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\glsl\ir_hv_accept.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\glsl\ir_import_prototypes.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\glsl\ir_print_visitor.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\glsl\ir_reader.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\glsl\ir_rvalue_visitor.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\glsl\ir_set_program_inouts.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\glsl\ir_validate.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\glsl\ir_variable.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\glsl\ir_variable_refcount.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\glsl\link_functions.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\glsl\linker.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\glsl\loop_analysis.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\glsl\loop_controls.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\glsl\loop_unroll.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\glsl\lower_noise.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\glsl\lower_variable_index_to_cond_assign.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\glsl\main.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\glsl\opt_redundant_jumps.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\glsl\ralloc.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\glsl\s_expression.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\program\hash_table.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\program\symbol_table.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\glsl\glcpp\pp.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\glsl\glcpp\glcpp-lex.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\glsl\glcpp\glcpp-parse.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\glsl\getopt.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\glsl\lower_vec_index_to_swizzle.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\glsl\opt_constant_folding.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\glsl\opt_structure_splitting.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\glsl\opt_constant_variable.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\glsl\opt_algebraic.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\glsl\opt_if_simplification.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\glsl\lower_instructions.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\glsl\opt_dead_code_local.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\glsl\opt_discard_simplification.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\glsl\lower_vec_index_to_cond_assign.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\glsl\opt_function_inlining.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\glsl\lower_texture_projection.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\glsl\opt_dead_functions.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\glsl\lower_vector.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\glsl\strtod.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\glsl\opt_copy_propagation.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\glsl\opt_dead_code.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\glsl\lower_discard.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\glsl\lower_mat_op_to_vec.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\glsl\opt_tree_grafting.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\glsl\opt_noop_swizzle.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\glsl\lower_jumps.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\glsl\opt_constant_propagation.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\glsl\lower_if_to_cond_assign.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\glsl\opt_swizzle_swizzle.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\glsl\builtin_stubs.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\glsl\opt_copy_propagation_elements.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\..\..\src\glsl\strtod.h">
+ <Filter>Source Files</Filter>
+ </ClInclude>
+ </ItemGroup>
+ <ItemGroup>
+ <CustomBuild Include="..\..\..\..\src\glsl\glsl_lexer.ll">
+ <Filter>Source Files</Filter>
+ </CustomBuild>
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="..\..\..\..\src\glsl\glsl_parser.yy">
+ <Filter>Source Files</Filter>
+ </None>
+ </ItemGroup>
+</Project> \ No newline at end of file
diff --git a/mesalib/windows/VC8/mesa/makefile b/mesalib/windows/VC8/mesa/makefile
new file mode 100644
index 000000000..727065a40
--- /dev/null
+++ b/mesalib/windows/VC8/mesa/makefile
@@ -0,0 +1,58 @@
+ifdef VS2008
+MHMAKESLNFILE=mesa.sln
+BUILDCMD=vcbuild $(MHMAKESLNFILE)
+else
+MHMAKESLNFILE=mesavc10.sln
+BUILDCMD=devenv.com $(MHMAKESLNFILE) /build
+endif
+
+DEPS:=$(wildcard ..\..\..\src\mesa\swrast\*.c) \
+ $(wildcard ..\..\..\src\mesa\swrast\*.h) \
+ $(wildcard ..\..\..\src\mesa\swrast_setup\*.c) \
+ $(wildcard ..\..\..\src\mesa\swrast_setup\*.h) \
+ $(wildcard ..\..\..\src\mesa\main\*.c) \
+ $(wildcard ..\..\..\src\mesa\main\*.h) \
+ $(wildcard ..\..\..\src\mesa\math\*.c) \
+ $(wildcard ..\..\..\src\mesa\math\*.h) \
+ $(wildcard ..\..\..\src\mesa\program\*.c) \
+ $(wildcard ..\..\..\src\mesa\program\*.cpp) \
+ $(wildcard ..\..\..\src\mesa\program\*.h) \
+ $(wildcard ..\..\..\src\mesa\shader\*.c) \
+ $(wildcard ..\..\..\src\mesa\shader\*.h) \
+ $(wildcard ..\..\..\src\mesa\shader\slang\*.c) \
+ $(wildcard ..\..\..\src\mesa\shader\slang\*.h) \
+ $(wildcard ..\..\..\src\mesa\shader\slang\library\*.c) \
+ $(wildcard ..\..\..\src\mesa\shader\slang\library\*.h) \
+ $(wildcard ..\..\..\src\mesa\glapi\*.c) \
+ $(wildcard ..\..\..\src\mesa\glapi\*.h) \
+ $(wildcard ..\..\..\src\mesa\math\*.c) \
+ $(wildcard ..\..\..\src\mesa\math\*.h) \
+ $(wildcard ..\..\..\src\mesa\tnl\*.c) \
+ $(wildcard ..\..\..\src\mesa\tnl\*.h) \
+ $(wildcard ..\..\..\src\mesa\vbo\*.c) \
+ $(wildcard ..\..\..\src\mesa\vbo\*.h) \
+ $(wildcard ..\..\..\src\glsl\glcpp\*.c) \
+ $(wildcard ..\..\..\src\glsl\glcpp\*.h) \
+ $(wildcard ..\..\..\src\glsl\*.c) \
+ $(wildcard ..\..\..\src\glsl\*.h) \
+ $(wildcard ..\..\..\src\glsl\*.cpp) \
+ $(wildcard ..\..\..\src\mesa\drivers\dri\swrast\*.c) \
+ $(wildcard ..\..\..\src\mesa\drivers\dri\swrast\*.h) \
+ $(wildcard ..\..\..\src\mesa\drivers\dri\common\*.c) \
+ $(wildcard ..\..\..\src\mesa\drivers\dri\common\*.h) \
+ $(wildcard ..\..\..\src\mesa\drivers\common\*.c) \
+ $(wildcard ..\..\..\src\mesa\drivers\common\*.h)
+
+all: Release\swrast_dri.dll Debug\swrast_dri.dll
+
+Debug\swrast_dri.dll: $(DEPS)
+ $(BUILDCMD) "Debug|Win32"
+
+Release\swrast_dri.dll: $(DEPS)
+ $(BUILDCMD) "Release|Win32"
+
+clean: cleanthis
+
+cleanthis:
+ del -e Debug
+ del -e Release
diff --git a/mesalib/windows/VC8/mesa/mesa.sln b/mesalib/windows/VC8/mesa/mesa.sln
new file mode 100644
index 000000000..9d232353b
--- /dev/null
+++ b/mesalib/windows/VC8/mesa/mesa.sln
@@ -0,0 +1,63 @@
+Microsoft Visual Studio Solution File, Format Version 10.00
+# Visual C++ Express 2008
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mesa", "mesa\mesa.vcproj", "{2120C974-2717-4709-B44F-D6E6D0A56448}"
+ ProjectSection(ProjectDependencies) = postProject
+ {98AB3D51-1820-4D14-9195-75FCA6997784} = {98AB3D51-1820-4D14-9195-75FCA6997784}
+ EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "glsl_apps_compile", "glsl_apps_compile\glsl_apps_compile.vcproj", "{98AB3D51-1820-4D14-9195-75FCA6997784}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "swrast_dri", "swrast_dri\swrast_dri.vcproj", "{FEF62E6F-A7E0-47BE-99A0-2494717DBDB7}"
+ ProjectSection(ProjectDependencies) = postProject
+ {2120C974-2717-4709-B44F-D6E6D0A56448} = {2120C974-2717-4709-B44F-D6E6D0A56448}
+ EndProjectSection
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug Static CRT|Win32 = Debug Static CRT|Win32
+ Debug|Win32 = Debug|Win32
+ Release Static CRT|Win32 = Release Static CRT|Win32
+ Release|Win32 = Release|Win32
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {A1B24907-E196-4826-B6AF-26723629B633}.Debug Static CRT|Win32.ActiveCfg = Debug Static CRT|Win32
+ {A1B24907-E196-4826-B6AF-26723629B633}.Debug|Win32.ActiveCfg = Debug|Win32
+ {A1B24907-E196-4826-B6AF-26723629B633}.Release Static CRT|Win32.ActiveCfg = Release Static CRT|Win32
+ {A1B24907-E196-4826-B6AF-26723629B633}.Release|Win32.ActiveCfg = Release|Win32
+ {2E50FDAF-430B-475B-AE6B-60B68F2875BA}.Debug Static CRT|Win32.ActiveCfg = Debug Static CRT|Win32
+ {2E50FDAF-430B-475B-AE6B-60B68F2875BA}.Debug|Win32.ActiveCfg = Debug|Win32
+ {2E50FDAF-430B-475B-AE6B-60B68F2875BA}.Release Static CRT|Win32.ActiveCfg = Release Static CRT|Win32
+ {2E50FDAF-430B-475B-AE6B-60B68F2875BA}.Release|Win32.ActiveCfg = Release|Win32
+ {2120C974-2717-4709-B44F-D6E6D0A56448}.Debug Static CRT|Win32.ActiveCfg = Debug Static CRT|Win32
+ {2120C974-2717-4709-B44F-D6E6D0A56448}.Debug Static CRT|Win32.Build.0 = Debug Static CRT|Win32
+ {2120C974-2717-4709-B44F-D6E6D0A56448}.Debug|Win32.ActiveCfg = Debug|Win32
+ {2120C974-2717-4709-B44F-D6E6D0A56448}.Debug|Win32.Build.0 = Debug|Win32
+ {2120C974-2717-4709-B44F-D6E6D0A56448}.Release Static CRT|Win32.ActiveCfg = Release Static CRT|Win32
+ {2120C974-2717-4709-B44F-D6E6D0A56448}.Release Static CRT|Win32.Build.0 = Release Static CRT|Win32
+ {2120C974-2717-4709-B44F-D6E6D0A56448}.Release|Win32.ActiveCfg = Release|Win32
+ {2120C974-2717-4709-B44F-D6E6D0A56448}.Release|Win32.Build.0 = Release|Win32
+ {8D6CD423-383B-49E7-81BC-D20C70B07DF5}.Debug Static CRT|Win32.ActiveCfg = Debug Static CRT|Win32
+ {8D6CD423-383B-49E7-81BC-D20C70B07DF5}.Debug|Win32.ActiveCfg = Debug|Win32
+ {8D6CD423-383B-49E7-81BC-D20C70B07DF5}.Release Static CRT|Win32.ActiveCfg = Release Static CRT|Win32
+ {8D6CD423-383B-49E7-81BC-D20C70B07DF5}.Release|Win32.ActiveCfg = Release|Win32
+ {FEF62E6F-A7E0-47BE-99A0-2494717DBDB7}.Debug Static CRT|Win32.ActiveCfg = Debug Static CRT|Win32
+ {FEF62E6F-A7E0-47BE-99A0-2494717DBDB7}.Debug Static CRT|Win32.Build.0 = Debug Static CRT|Win32
+ {FEF62E6F-A7E0-47BE-99A0-2494717DBDB7}.Debug|Win32.ActiveCfg = Debug|Win32
+ {FEF62E6F-A7E0-47BE-99A0-2494717DBDB7}.Debug|Win32.Build.0 = Debug|Win32
+ {FEF62E6F-A7E0-47BE-99A0-2494717DBDB7}.Release Static CRT|Win32.ActiveCfg = Release Static CRT|Win32
+ {FEF62E6F-A7E0-47BE-99A0-2494717DBDB7}.Release Static CRT|Win32.Build.0 = Release Static CRT|Win32
+ {FEF62E6F-A7E0-47BE-99A0-2494717DBDB7}.Release|Win32.ActiveCfg = Release|Win32
+ {FEF62E6F-A7E0-47BE-99A0-2494717DBDB7}.Release|Win32.Build.0 = Release|Win32
+ {98AB3D51-1820-4D14-9195-75FCA6997784}.Debug Static CRT|Win32.ActiveCfg = Debug|Win32
+ {98AB3D51-1820-4D14-9195-75FCA6997784}.Debug Static CRT|Win32.Build.0 = Debug|Win32
+ {98AB3D51-1820-4D14-9195-75FCA6997784}.Debug|Win32.ActiveCfg = Debug|Win32
+ {98AB3D51-1820-4D14-9195-75FCA6997784}.Debug|Win32.Build.0 = Debug|Win32
+ {98AB3D51-1820-4D14-9195-75FCA6997784}.Release Static CRT|Win32.ActiveCfg = Release|Win32
+ {98AB3D51-1820-4D14-9195-75FCA6997784}.Release Static CRT|Win32.Build.0 = Release|Win32
+ {98AB3D51-1820-4D14-9195-75FCA6997784}.Release|Win32.ActiveCfg = Release|Win32
+ {98AB3D51-1820-4D14-9195-75FCA6997784}.Release|Win32.Build.0 = Release|Win32
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
diff --git a/mesalib/windows/VC8/mesa/mesa/mesa.vcproj b/mesalib/windows/VC8/mesa/mesa/mesa.vcproj
new file mode 100644
index 000000000..eb78e6c60
--- /dev/null
+++ b/mesalib/windows/VC8/mesa/mesa/mesa.vcproj
@@ -0,0 +1,2486 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="9,00"
+ Name="mesa"
+ ProjectGUID="{2120C974-2717-4709-B44F-D6E6D0A56448}"
+ RootNamespace="mesa"
+ TargetFrameworkVersion="131072"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)"
+ ConfigurationType="4"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ CommandLine=""
+ ExcludedFromBuild="false"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ CommandLine=""
+ Outputs=""
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalOptions="/Zm1000 "
+ InlineFunctionExpansion="2"
+ OmitFramePointers="true"
+ WholeProgramOptimization="true"
+ AdditionalIncludeDirectories="../../../../include,../../../../src/mesa,../../../../src/mesa/glapi,../../../../src/mesa/main,../../../../src/mesa/shader,../../../../src/mesa/shader/slang"
+ PreprocessorDefinitions="NDEBUG;WIN32;_LIB;_DLL;BUILD_GL32;MESA_MINWARN;_CRT_SECURE_NO_DEPRECATE;INSERVER"
+ StringPooling="true"
+ RuntimeLibrary="2"
+ EnableFunctionLevelLinking="true"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ CompileAs="0"
+ ForcedIncludeFiles="../../../../src/mesa/main/compiler.h"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="NDEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLibrarianTool"
+ SuppressStartupBanner="true"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)"
+ ConfigurationType="4"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ CommandLine=""
+ ExcludedFromBuild="false"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ CommandLine=""
+ Outputs=""
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalOptions="/Zm1000 "
+ Optimization="0"
+ AdditionalIncludeDirectories="../../../../include,../../../../src/mesa,../../../../src/mesa/glapi,../../../../src/mesa/main,../../../../src/mesa/shader,../../../../src/mesa/shader/slang"
+ PreprocessorDefinitions="_DEBUG;WIN32;_LIB;_DLL;BUILD_GL32;MESA_MINWARN;_CRT_SECURE_NO_DEPRECATE;INSERVER"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ BrowseInformation="1"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ DebugInformationFormat="3"
+ CompileAs="1"
+ ForcedIncludeFiles="../../../../src/mesa/main/compiler.h"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_DEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLibrarianTool"
+ SuppressStartupBanner="true"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Debug Static CRT|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)"
+ ConfigurationType="4"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ CommandLine=""
+ ExcludedFromBuild="false"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ CommandLine=""
+ Outputs=""
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalOptions="/Zm1000 "
+ Optimization="0"
+ AdditionalIncludeDirectories="../../../../include,../../../../src/mesa,../../../../src/mesa/glapi,../../../../src/mesa/main,../../../../src/mesa/shader,../../../../src/mesa/shader/slang"
+ PreprocessorDefinitions="_DEBUG;WIN32;_LIB;BUILD_GL32;MESA_MINWARN;_CRT_SECURE_NO_DEPRECATE;INSERVER"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="1"
+ BrowseInformation="1"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ DebugInformationFormat="3"
+ CompileAs="0"
+ ForcedIncludeFiles="../../../../src/mesa/main/compiler.h"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_DEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLibrarianTool"
+ SuppressStartupBanner="true"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release Static CRT|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)"
+ ConfigurationType="4"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ CommandLine=""
+ ExcludedFromBuild="false"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ CommandLine=""
+ Outputs=""
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalOptions="/Zm1000 "
+ InlineFunctionExpansion="2"
+ OmitFramePointers="true"
+ WholeProgramOptimization="true"
+ AdditionalIncludeDirectories="../../../../include,../../../../src/mesa,../../../../src/mesa/glapi,../../../../src/mesa/main,../../../../src/mesa/shader,../../../../src/mesa/shader/slang"
+ PreprocessorDefinitions="NDEBUG;WIN32;_LIB;BUILD_GL32;MESA_MINWARN;_CRT_SECURE_NO_DEPRECATE;INSERVER"
+ StringPooling="true"
+ ExceptionHandling="0"
+ RuntimeLibrary="0"
+ BufferSecurityCheck="false"
+ EnableFunctionLevelLinking="true"
+ EnableEnhancedInstructionSet="2"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ CompileAs="0"
+ ForcedIncludeFiles="../../../../src/mesa/main/compiler.h"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="NDEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLibrarianTool"
+ SuppressStartupBanner="true"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ <ProjectReference
+ ReferencedProjectIdentifier="{98AB3D51-1820-4D14-9195-75FCA6997784}"
+ RelativePathToProject=".\glsl_apps_compile\glsl_apps_compile.vcproj"
+ />
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+ >
+ <File
+ RelativePath="..\..\..\..\src\mesa\main\accum.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\main\api_arrayelt.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\main\api_exec.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\main\api_loopback.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\main\api_noop.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\main\api_validate.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\shader\arbprogparse.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\shader\arbprogram.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\main\arrayobj.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\shader\atifragshader.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\main\attrib.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\main\blend.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\main\bufferobj.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\main\buffers.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\main\clear.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\main\clip.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\main\colortab.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\main\condrender.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\main\context.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\main\convolve.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\main\cpuinfo.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\main\debug.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\main\depth.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\main\depthstencil.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\main\dlist.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\main\dlopen.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\main\drawpix.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\main\enable.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\main\enums.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\main\eval.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\main\execmem.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\main\extensions.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\main\fbobject.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\main\feedback.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\main\ffvertex_prog.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\main\fog.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\main\formats.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\main\framebuffer.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\main\get.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\main\getstring.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\glapi\glapi.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\glapi\glapi_dispatch.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\glapi\glapi_entrypoint.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\glapi\glapi_getproc.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\glapi\glapi_nop.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\glapi\glthread.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\main\hash.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\shader\hash_table.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\shader\hash_table.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\main\hint.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\main\histogram.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\main\image.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\main\imports.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\shader\lex.yy.c"
+ >
+ <FileConfiguration
+ Name="Release|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions="YY_USE_CONST;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions="YY_USE_CONST;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug Static CRT|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions="YY_USE_CONST;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release Static CRT|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions="YY_USE_CONST;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE"
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\shader\lex.yy.c"
+ >
+ <FileConfiguration
+ Name="Release|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions="YY_NO_UNISTD_H"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions="YY_NO_UNISTD_H"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug Static CRT|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions="YY_NO_UNISTD_H"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release Static CRT|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions="YY_NO_UNISTD_H"
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\main\light.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\main\lines.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\math\m_debug_clip.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\math\m_debug_norm.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\math\m_debug_xform.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\math\m_eval.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\math\m_matrix.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\math\m_translate.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\math\m_vector.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\math\m_xform.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\main\matrix.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\main\mipmap.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\main\mm.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\main\multisample.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\shader\nvfragparse.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\shader\nvprogram.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\shader\nvvertparse.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\main\pixel.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\main\pixelstore.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\main\points.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\main\polygon.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\shader\prog_cache.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\shader\prog_execute.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\shader\prog_instruction.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\shader\prog_noise.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\shader\prog_optimize.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\shader\prog_parameter.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\shader\prog_parameter_layout.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\shader\prog_print.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\shader\prog_statevars.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\shader\prog_uniform.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\shader\program.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\shader\program_parse.tab.c"
+ >
+ <FileConfiguration
+ Name="Release|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions="YYMALLOC=malloc;YYFREE=free"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions="YYMALLOC=malloc;YYFREE=free"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug Static CRT|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions="YYMALLOC=malloc;YYFREE=free"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release Static CRT|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions="YYMALLOC=malloc;YYFREE=free"
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\shader\program_parse_extra.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\shader\programopt.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\main\queryobj.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\main\rastpos.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\main\rbadaptors.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\main\readpix.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\main\renderbuffer.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\swrast\s_aaline.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\swrast\s_aatriangle.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\swrast\s_accum.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\swrast\s_alpha.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\swrast\s_atifragshader.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\swrast\s_bitmap.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\swrast\s_blend.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\swrast\s_blit.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\swrast\s_clear.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\swrast\s_context.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\swrast\s_copypix.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\swrast\s_depth.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\swrast\s_drawpix.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\swrast\s_feedback.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\swrast\s_fog.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\swrast\s_fragprog.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\swrast\s_lines.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\swrast\s_logic.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\swrast\s_masking.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\swrast\s_points.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\swrast\s_readpix.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\swrast\s_span.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\swrast\s_stencil.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\swrast\s_texcombine.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\swrast\s_texfilter.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\swrast\s_triangle.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\swrast\s_zoom.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\main\scissor.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\shader\shader_api.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\main\shaders.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\main\shared.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\glsl\cl\sl_cl_parse.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\glsl\pp\sl_pp_context.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\glsl\pp\sl_pp_define.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\glsl\pp\sl_pp_dict.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\glsl\pp\sl_pp_error.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\glsl\pp\sl_pp_expression.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\glsl\pp\sl_pp_extension.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\glsl\pp\sl_pp_if.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\glsl\pp\sl_pp_line.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\glsl\pp\sl_pp_macro.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\glsl\pp\sl_pp_pragma.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\glsl\pp\sl_pp_process.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\glsl\pp\sl_pp_purify.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\glsl\pp\sl_pp_token.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\glsl\pp\sl_pp_token_util.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\glsl\pp\sl_pp_version.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\shader\slang\slang_builtin.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\shader\slang\slang_codegen.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\shader\slang\slang_compile.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\shader\slang\slang_compile_function.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\shader\slang\slang_compile_operation.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\shader\slang\slang_compile_struct.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\shader\slang\slang_compile_variable.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\shader\slang\slang_emit.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\shader\slang\slang_ir.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\shader\slang\slang_label.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\shader\slang\slang_link.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\shader\slang\slang_log.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\shader\slang\slang_mem.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\shader\slang\slang_print.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\shader\slang\slang_simplify.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\shader\slang\slang_storage.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\shader\slang\slang_typeinfo.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\shader\slang\slang_utility.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\shader\slang\slang_vartable.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\swrast_setup\ss_context.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\swrast_setup\ss_triangle.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\main\state.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\main\stencil.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\shader\symbol_table.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\shader\symbol_table.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\main\syncobj.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\main\syncobj.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\tnl\t_context.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\tnl\t_draw.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\tnl\t_pipeline.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\tnl\t_rasterpos.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\tnl\t_vb_cull.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\tnl\t_vb_fog.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\tnl\t_vb_light.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\tnl\t_vb_normals.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\tnl\t_vb_points.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\tnl\t_vb_program.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\tnl\t_vb_render.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\tnl\t_vb_texgen.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\tnl\t_vb_texmat.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\tnl\t_vb_vertex.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\tnl\t_vertex.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\tnl\t_vertex_generic.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\tnl\t_vp_build.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\main\texcompress.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\main\texcompress_fxt1.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\main\texcompress_s3tc.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\main\texenv.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\main\texenvprogram.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\main\texfetch.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\main\texformat.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\main\texgen.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\main\texgetimage.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\main\teximage.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\main\texobj.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\main\texparam.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\main\texrender.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\main\texstate.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\main\texstore.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\main\varray.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\vbo\vbo_context.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\vbo\vbo_exec.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\vbo\vbo_exec_api.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\vbo\vbo_exec_array.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\vbo\vbo_exec_draw.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\vbo\vbo_exec_eval.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\vbo\vbo_rebase.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\vbo\vbo_save.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\vbo\vbo_save_api.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\vbo\vbo_save_draw.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\vbo\vbo_save_loopback.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\vbo\vbo_split.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\vbo\vbo_split_copy.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\vbo\vbo_split_inplace.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\main\version.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\main\viewport.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\main\vtxfmt.c"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl"
+ >
+ <File
+ RelativePath="..\..\..\..\src\mesa\main\accum.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\main\api_arrayelt.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\main\api_exec.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\main\api_loopback.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\main\api_noop.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\main\api_validate.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\shader\arbprogparse.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\shader\arbprogram.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\main\arrayobj.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\shader\atifragshader.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\main\attrib.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\main\bitset.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\main\blend.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\main\bufferobj.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\main\buffers.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\main\clear.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\main\clip.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\main\colormac.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\main\colortab.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\main\condrender.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\main\config.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\main\context.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\main\convolve.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\main\cpuinfo.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\main\dd.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\main\debug.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\main\depth.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\main\depthstencil.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\main\dlist.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\main\dlopen.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\main\drawpix.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\main\enable.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\main\enums.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\main\eval.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\main\extensions.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\main\fbobject.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\main\feedback.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\main\ffvertex_prog.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\main\fog.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\main\formats.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\main\framebuffer.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\main\get.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\glapi\glapi.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\glapi\glapioffsets.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\glapi\glapitable.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\glapi\glapitemp.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\main\glheader.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\glapi\glprocs.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\glapi\glthread.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\main\hash.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\shader\hash_table.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\main\hint.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\main\histogram.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\main\image.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\main\imports.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\main\light.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\main\lines.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\math\m_clip_tmp.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\math\m_copy_tmp.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\math\m_debug.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\math\m_debug_util.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\math\m_dotprod_tmp.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\math\m_eval.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\math\m_matrix.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\math\m_norm_tmp.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\math\m_trans_tmp.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\math\m_translate.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\math\m_vector.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\math\m_xform.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\math\m_xform_tmp.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\main\macros.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\main\matrix.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\main\mfeatures.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\main\mipmap.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\main\mm.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\main\mtypes.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\main\multisample.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\shader\nvfragparse.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\shader\nvprogram.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\shader\nvvertparse.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\main\pixel.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\main\pixelstore.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\main\points.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\main\polygon.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\shader\prog_execute.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\shader\prog_instruction.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\shader\prog_noise.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\shader\prog_optimize.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\shader\prog_parameter.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\shader\prog_parameter_layout.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\shader\prog_print.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\shader\prog_statevars.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\shader\prog_uniform.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\shader\program.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\shader\program_parse.tab.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\shader\programopt.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\main\queryobj.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\main\rastpos.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\main\rbadaptors.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\main\readpix.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\main\remap.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\main\renderbuffer.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\swrast\s_aaline.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\swrast\s_aalinetemp.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\swrast\s_aatriangle.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\swrast\s_aatritemp.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\swrast\s_accum.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\swrast\s_alpha.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\swrast\s_atifragshader.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\swrast\s_blend.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\swrast\s_context.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\swrast\s_depth.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\swrast\s_drawpix.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\swrast\s_feedback.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\swrast\s_fog.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\swrast\s_fragprog.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\swrast\s_lines.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\swrast\s_linetemp.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\swrast\s_logic.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\swrast\s_masking.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\swrast\s_points.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\swrast\s_span.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\swrast\s_spantemp.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\swrast\s_stencil.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\swrast\s_texcombine.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\swrast\s_texfilter.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\swrast\s_triangle.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\swrast\s_trispan.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\swrast\s_tritemp.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\swrast\s_zoom.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\main\scissor.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\shader\shader_api.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\main\shaders.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\main\shared.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\main\simple_list.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\glsl\cl\sl_cl_parse.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\glsl\pp\sl_pp_context.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\glsl\pp\sl_pp_dict.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\glsl\pp\sl_pp_expression.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\glsl\pp\sl_pp_macro.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\glsl\pp\sl_pp_process.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\glsl\pp\sl_pp_public.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\glsl\pp\sl_pp_purify.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\glsl\pp\sl_pp_token.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\glsl\pp\sl_pp_token_util.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\shader\slang\library\slang_120_core_gc.h"
+ >
+ <FileConfiguration
+ Name="Release|Win32"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ Description="Building predefined shaders"
+ CommandLine="..\..\..\..\src\glsl\apps\compile.exe fragment ..\..\..\..\src\mesa\shader\slang\library\slang_120_core.gc ..\..\..\..\src\mesa\shader\slang\library\slang_120_core_gc.h&#x0D;&#x0A;"
+ AdditionalDependencies="..\..\..\..\src\mesa\shader\slang\library\slang_120_core.gc"
+ Outputs="..\..\..\..\src\mesa\shader\slang\library\slang_120_core_gc.h"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ Description="Building predefined shaders"
+ CommandLine="..\..\..\..\src\glsl\apps\compile.exe fragment ..\..\..\..\src\mesa\shader\slang\library\slang_120_core.gc ..\..\..\..\src\mesa\shader\slang\library\slang_120_core_gc.h&#x0D;&#x0A;"
+ AdditionalDependencies="..\..\..\..\src\mesa\shader\slang\library\slang_120_core.gc"
+ Outputs="..\..\..\..\src\mesa\shader\slang\library\slang_120_core_gc.h"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug Static CRT|Win32"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ Description="Building predefined shaders"
+ CommandLine="..\..\..\..\src\glsl\apps\compile.exe fragment ..\..\..\..\src\mesa\shader\slang\library\slang_120_core.gc ..\..\..\..\src\mesa\shader\slang\library\slang_120_core_gc.h&#x0D;&#x0A;"
+ AdditionalDependencies="..\..\..\..\src\mesa\shader\slang\library\slang_120_core.gc"
+ Outputs="..\..\..\..\src\mesa\shader\slang\library\slang_120_core_gc.h"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release Static CRT|Win32"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ Description="Building predefined shaders"
+ CommandLine="..\..\..\..\src\glsl\apps\compile.exe fragment ..\..\..\..\src\mesa\shader\slang\library\slang_120_core.gc ..\..\..\..\src\mesa\shader\slang\library\slang_120_core_gc.h&#x0D;&#x0A;"
+ AdditionalDependencies="..\..\..\..\src\mesa\shader\slang\library\slang_120_core.gc"
+ Outputs="..\..\..\..\src\mesa\shader\slang\library\slang_120_core_gc.h"
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\shader\slang\slang_builtin.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\shader\slang\library\slang_builtin_120_common_gc.h"
+ >
+ <FileConfiguration
+ Name="Release|Win32"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ Description="Building predefined shaders"
+ CommandLine="..\..\..\..\src\glsl\apps\compile.exe fragment ..\..\..\..\src\mesa\shader\slang\library\slang_builtin_120_common.gc ..\..\..\..\src\mesa\shader\slang\library\slang_builtin_120_common_gc.h&#x0D;&#x0A;"
+ AdditionalDependencies="..\..\..\..\src\mesa\shader\slang\library\slang_builtin_120_common.gc"
+ Outputs="..\..\..\..\src\mesa\shader\slang\library\slang_builtin_120_common_gc.h"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ Description="Building predefined shaders"
+ CommandLine="..\..\..\..\src\glsl\apps\compile.exe fragment ..\..\..\..\src\mesa\shader\slang\library\slang_builtin_120_common.gc ..\..\..\..\src\mesa\shader\slang\library\slang_builtin_120_common_gc.h&#x0D;&#x0A;"
+ AdditionalDependencies="..\..\..\..\src\mesa\shader\slang\library\slang_builtin_120_common.gc"
+ Outputs="..\..\..\..\src\mesa\shader\slang\library\slang_builtin_120_common_gc.h"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug Static CRT|Win32"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ Description="Building predefined shaders"
+ CommandLine="..\..\..\..\src\glsl\apps\compile.exe fragment ..\..\..\..\src\mesa\shader\slang\library\slang_builtin_120_common.gc ..\..\..\..\src\mesa\shader\slang\library\slang_builtin_120_common_gc.h&#x0D;&#x0A;"
+ AdditionalDependencies="..\..\..\..\src\mesa\shader\slang\library\slang_builtin_120_common.gc"
+ Outputs="..\..\..\..\src\mesa\shader\slang\library\slang_builtin_120_common_gc.h"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release Static CRT|Win32"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ Description="Building predefined shaders"
+ CommandLine="..\..\..\..\src\glsl\apps\compile.exe fragment ..\..\..\..\src\mesa\shader\slang\library\slang_builtin_120_common.gc ..\..\..\..\src\mesa\shader\slang\library\slang_builtin_120_common_gc.h&#x0D;&#x0A;"
+ AdditionalDependencies="..\..\..\..\src\mesa\shader\slang\library\slang_builtin_120_common.gc"
+ Outputs="..\..\..\..\src\mesa\shader\slang\library\slang_builtin_120_common_gc.h"
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\shader\slang\library\slang_builtin_120_fragment_gc.h"
+ >
+ <FileConfiguration
+ Name="Release|Win32"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ Description="Building predefined shaders"
+ CommandLine="..\..\..\..\src\glsl\apps\compile.exe fragment ..\..\..\..\src\mesa\shader\slang\library\slang_builtin_120_fragment.gc ..\..\..\..\src\mesa\shader\slang\library\slang_builtin_120_fragment_gc.h&#x0D;&#x0A;"
+ AdditionalDependencies="..\..\..\..\src\mesa\shader\slang\library\slang_builtin_120_fragment.gc"
+ Outputs="..\..\..\..\src\mesa\shader\slang\library\slang_builtin_120_fragment_gc.h"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ Description="Building predefined shaders"
+ CommandLine="..\..\..\..\src\glsl\apps\compile.exe fragment ..\..\..\..\src\mesa\shader\slang\library\slang_builtin_120_fragment.gc ..\..\..\..\src\mesa\shader\slang\library\slang_builtin_120_fragment_gc.h&#x0D;&#x0A;"
+ AdditionalDependencies="..\..\..\..\src\mesa\shader\slang\library\slang_builtin_120_fragment.gc"
+ Outputs="..\..\..\..\src\mesa\shader\slang\library\slang_builtin_120_fragment_gc.h"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug Static CRT|Win32"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ Description="Building predefined shaders"
+ CommandLine="..\..\..\..\src\glsl\apps\compile.exe fragment ..\..\..\..\src\mesa\shader\slang\library\slang_builtin_120_fragment.gc ..\..\..\..\src\mesa\shader\slang\library\slang_builtin_120_fragment_gc.h&#x0D;&#x0A;"
+ AdditionalDependencies="..\..\..\..\src\mesa\shader\slang\library\slang_builtin_120_fragment.gc"
+ Outputs="..\..\..\..\src\mesa\shader\slang\library\slang_builtin_120_fragment_gc.h"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release Static CRT|Win32"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ Description="Building predefined shaders"
+ CommandLine="..\..\..\..\src\glsl\apps\compile.exe fragment ..\..\..\..\src\mesa\shader\slang\library\slang_builtin_120_fragment.gc ..\..\..\..\src\mesa\shader\slang\library\slang_builtin_120_fragment_gc.h&#x0D;&#x0A;"
+ AdditionalDependencies="..\..\..\..\src\mesa\shader\slang\library\slang_builtin_120_fragment.gc"
+ Outputs="..\..\..\..\src\mesa\shader\slang\library\slang_builtin_120_fragment_gc.h"
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\shader\slang\slang_codegen.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\shader\slang\library\slang_common_builtin_gc.h"
+ >
+ <FileConfiguration
+ Name="Release|Win32"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ Description="Building predefined shaders"
+ CommandLine="..\..\..\..\src\glsl\apps\compile.exe fragment ..\..\..\..\src\mesa\shader\slang\library\slang_common_builtin.gc ..\..\..\..\src\mesa\shader\slang\library\slang_common_builtin_gc.h&#x0D;&#x0A;"
+ AdditionalDependencies="..\..\..\..\src\mesa\shader\slang\library\slang_common_builtin.gc"
+ Outputs="..\..\..\..\src\mesa\shader\slang\library\slang_common_builtin_gc.h"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ Description="Building predefined shaders"
+ CommandLine="..\..\..\..\src\glsl\apps\compile.exe fragment ..\..\..\..\src\mesa\shader\slang\library\slang_common_builtin.gc ..\..\..\..\src\mesa\shader\slang\library\slang_common_builtin_gc.h&#x0D;&#x0A;"
+ AdditionalDependencies="..\..\..\..\src\mesa\shader\slang\library\slang_common_builtin.gc"
+ Outputs="..\..\..\..\src\mesa\shader\slang\library\slang_common_builtin_gc.h"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug Static CRT|Win32"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ Description="Building predefined shaders"
+ CommandLine="..\..\..\..\src\glsl\apps\compile.exe fragment ..\..\..\..\src\mesa\shader\slang\library\slang_common_builtin.gc ..\..\..\..\src\mesa\shader\slang\library\slang_common_builtin_gc.h&#x0D;&#x0A;"
+ AdditionalDependencies="..\..\..\..\src\mesa\shader\slang\library\slang_common_builtin.gc"
+ Outputs="..\..\..\..\src\mesa\shader\slang\library\slang_common_builtin_gc.h"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release Static CRT|Win32"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ Description="Building predefined shaders"
+ CommandLine="..\..\..\..\src\glsl\apps\compile.exe fragment ..\..\..\..\src\mesa\shader\slang\library\slang_common_builtin.gc ..\..\..\..\src\mesa\shader\slang\library\slang_common_builtin_gc.h&#x0D;&#x0A;"
+ AdditionalDependencies="..\..\..\..\src\mesa\shader\slang\library\slang_common_builtin.gc"
+ Outputs="..\..\..\..\src\mesa\shader\slang\library\slang_common_builtin_gc.h"
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\shader\slang\slang_compile.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\shader\slang\slang_compile_function.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\shader\slang\slang_compile_operation.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\shader\slang\slang_compile_struct.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\shader\slang\slang_compile_variable.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\shader\slang\library\slang_core_gc.h"
+ >
+ <FileConfiguration
+ Name="Release|Win32"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ Description="Building predefined shaders"
+ CommandLine="..\..\..\..\src\glsl\apps\compile.exe fragment ..\..\..\..\src\mesa\shader\slang\library\slang_core.gc ..\..\..\..\src\mesa\shader\slang\library\slang_core_gc.h&#x0D;&#x0A;"
+ AdditionalDependencies="..\..\..\..\src\mesa\shader\slang\library\slang_core_gc"
+ Outputs="..\..\..\..\src\mesa\shader\slang\library\slang_core_gc.h"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ Description="Building predefined shaders"
+ CommandLine="..\..\..\..\src\glsl\apps\compile.exe fragment ..\..\..\..\src\mesa\shader\slang\library\slang_core.gc ..\..\..\..\src\mesa\shader\slang\library\slang_core_gc.h&#x0D;&#x0A;"
+ AdditionalDependencies="..\..\..\..\src\mesa\shader\slang\library\slang_core_gc"
+ Outputs="..\..\..\..\src\mesa\shader\slang\library\slang_core_gc.h"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug Static CRT|Win32"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ Description="Building predefined shaders"
+ CommandLine="..\..\..\..\src\glsl\apps\compile.exe fragment ..\..\..\..\src\mesa\shader\slang\library\slang_core.gc ..\..\..\..\src\mesa\shader\slang\library\slang_core_gc.h&#x0D;&#x0A;"
+ AdditionalDependencies="..\..\..\..\src\mesa\shader\slang\library\slang_core_gc"
+ Outputs="..\..\..\..\src\mesa\shader\slang\library\slang_core_gc.h"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release Static CRT|Win32"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ Description="Building predefined shaders"
+ CommandLine="..\..\..\..\src\glsl\apps\compile.exe fragment ..\..\..\..\src\mesa\shader\slang\library\slang_core.gc ..\..\..\..\src\mesa\shader\slang\library\slang_core_gc.h&#x0D;&#x0A;"
+ AdditionalDependencies="..\..\..\..\src\mesa\shader\slang\library\slang_core_gc"
+ Outputs="..\..\..\..\src\mesa\shader\slang\library\slang_core_gc.h"
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\shader\slang\slang_emit.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\shader\slang\library\slang_fragment_builtin_gc.h"
+ >
+ <FileConfiguration
+ Name="Release|Win32"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ Description="Building predefined shaders"
+ CommandLine="..\..\..\..\src\glsl\apps\compile.exe fragment ..\..\..\..\src\mesa\shader\slang\library\slang_fragment_builtin.gc ..\..\..\..\src\mesa\shader\slang\library\slang_fragment_builtin_gc.h&#x0D;&#x0A;"
+ AdditionalDependencies="..\..\..\..\src\mesa\shader\slang\library\slang_fragment_builtin.gc"
+ Outputs="..\..\..\..\src\mesa\shader\slang\library\slang_fragment_builtin_gc.h"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ Description="Building predefined shaders"
+ CommandLine="..\..\..\..\src\glsl\apps\compile.exe fragment ..\..\..\..\src\mesa\shader\slang\library\slang_fragment_builtin.gc ..\..\..\..\src\mesa\shader\slang\library\slang_fragment_builtin_gc.h&#x0D;&#x0A;"
+ AdditionalDependencies="..\..\..\..\src\mesa\shader\slang\library\slang_fragment_builtin.gc"
+ Outputs="..\..\..\..\src\mesa\shader\slang\library\slang_fragment_builtin_gc.h"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug Static CRT|Win32"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ Description="Building predefined shaders"
+ CommandLine="..\..\..\..\src\glsl\apps\compile.exe fragment ..\..\..\..\src\mesa\shader\slang\library\slang_fragment_builtin.gc ..\..\..\..\src\mesa\shader\slang\library\slang_fragment_builtin_gc.h&#x0D;&#x0A;"
+ AdditionalDependencies="..\..\..\..\src\mesa\shader\slang\library\slang_fragment_builtin.gc"
+ Outputs="..\..\..\..\src\mesa\shader\slang\library\slang_fragment_builtin_gc.h"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release Static CRT|Win32"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ Description="Building predefined shaders"
+ CommandLine="..\..\..\..\src\glsl\apps\compile.exe fragment ..\..\..\..\src\mesa\shader\slang\library\slang_fragment_builtin.gc ..\..\..\..\src\mesa\shader\slang\library\slang_fragment_builtin_gc.h&#x0D;&#x0A;"
+ AdditionalDependencies="..\..\..\..\src\mesa\shader\slang\library\slang_fragment_builtin.gc"
+ Outputs="..\..\..\..\src\mesa\shader\slang\library\slang_fragment_builtin_gc.h"
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\shader\slang\slang_ir.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\shader\slang\slang_label.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\shader\slang\slang_link.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\shader\slang\slang_log.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\shader\slang\slang_mem.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\shader\slang\slang_print.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\shader\slang\slang_simplify.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\shader\slang\slang_storage.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\shader\slang\slang_typeinfo.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\shader\slang\slang_utility.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\shader\slang\slang_vartable.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\shader\slang\library\slang_vertex_builtin_gc.h"
+ >
+ <FileConfiguration
+ Name="Release|Win32"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ Description="Building predefined shaders"
+ CommandLine="..\..\..\..\src\glsl\apps\compile.exe vertex ..\..\..\..\src\mesa\shader\slang\library\slang_vertex_builtin.gc ..\..\..\..\src\mesa\shader\slang\library\slang_vertex_builtin_gc.h&#x0D;&#x0A;"
+ AdditionalDependencies="..\..\..\..\src\mesa\shader\slang\library\slang_vertex_builtin.gc"
+ Outputs="..\..\..\..\src\mesa\shader\slang\library\slang_vertex_builtin_gc.h"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ Description="Building predefined shaders"
+ CommandLine="..\..\..\..\src\glsl\apps\compile.exe vertex ..\..\..\..\src\mesa\shader\slang\library\slang_vertex_builtin.gc ..\..\..\..\src\mesa\shader\slang\library\slang_vertex_builtin_gc.h&#x0D;&#x0A;"
+ AdditionalDependencies="..\..\..\..\src\mesa\shader\slang\library\slang_vertex_builtin.gc"
+ Outputs="..\..\..\..\src\mesa\shader\slang\library\slang_vertex_builtin_gc.h"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug Static CRT|Win32"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ Description="Building predefined shaders"
+ CommandLine="..\..\..\..\src\glsl\apps\compile.exe vertex ..\..\..\..\src\mesa\shader\slang\library\slang_vertex_builtin.gc ..\..\..\..\src\mesa\shader\slang\library\slang_vertex_builtin_gc.h&#x0D;&#x0A;"
+ AdditionalDependencies="..\..\..\..\src\mesa\shader\slang\library\slang_vertex_builtin.gc"
+ Outputs="..\..\..\..\src\mesa\shader\slang\library\slang_vertex_builtin_gc.h"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release Static CRT|Win32"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ Description="Building predefined shaders"
+ CommandLine="..\..\..\..\src\glsl\apps\compile.exe vertex ..\..\..\..\src\mesa\shader\slang\library\slang_vertex_builtin.gc ..\..\..\..\src\mesa\shader\slang\library\slang_vertex_builtin_gc.h&#x0D;&#x0A;"
+ AdditionalDependencies="..\..\..\..\src\mesa\shader\slang\library\slang_vertex_builtin.gc"
+ Outputs="..\..\..\..\src\mesa\shader\slang\library\slang_vertex_builtin_gc.h"
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\swrast_setup\ss_context.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\swrast_setup\ss_triangle.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\swrast_setup\ss_tritmp.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\swrast_setup\ss_vb.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\main\state.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\main\stencil.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\swrast\swrast.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\swrast_setup\swrast_setup.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\shader\symbol_table.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\main\syncobj.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\tnl\t_context.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\tnl\t_pipeline.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\tnl\t_vb_cliptmp.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\tnl\t_vb_lighttmp.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\tnl\t_vb_rendertmp.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\tnl\t_vertex.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\tnl\t_vp_build.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\main\texcompress.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\main\texenv.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\main\texenvprogram.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\main\texfetch.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\main\texfetch_tmp.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\main\texformat.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\main\texgen.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\main\texgetimage.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\main\teximage.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\main\texobj.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\main\texparam.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\main\texrender.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\main\texstate.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\main\texstore.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\tnl\tnl.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\main\varray.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\vbo\vbo.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\vbo\vbo_attrib.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\vbo\vbo_attrib_tmp.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\vbo\vbo_context.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\vbo\vbo_exec.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\vbo\vbo_save.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\vbo\vbo_split.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\main\version.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\main\viewport.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\main\vtxfmt.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\main\vtxfmt_tmp.h"
+ >
+ </File>
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/mesalib/windows/VC8/mesa/mesa/mesa.vcxproj b/mesalib/windows/VC8/mesa/mesa/mesa.vcxproj
new file mode 100644
index 000000000..6e9dc489c
--- /dev/null
+++ b/mesalib/windows/VC8/mesa/mesa/mesa.vcxproj
@@ -0,0 +1,359 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{2120C974-2717-4709-B44F-D6E6D0A56448}</ProjectGuid>
+ <RootNamespace>mesa</RootNamespace>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>StaticLibrary</ConfigurationType>
+ <UseOfMfc>false</UseOfMfc>
+ <CharacterSet>MultiByte</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>StaticLibrary</ConfigurationType>
+ <UseOfMfc>false</UseOfMfc>
+ <CharacterSet>MultiByte</CharacterSet>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup>
+ <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Configuration)\</IntDir>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Configuration)\</IntDir>
+ <PreBuildEventUseInBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</PreBuildEventUseInBuild>
+ <PreLinkEventUseInBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</PreLinkEventUseInBuild>
+ <PostBuildEventUseInBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</PostBuildEventUseInBuild>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <ClCompile>
+ <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
+ <OmitFramePointers>true</OmitFramePointers>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ <AdditionalIncludeDirectories>../../../../include;../../../../src/mesa;../../../../src/glsl;../../../../src/mapi;../../../../src/mesa/main;../../../../src/mesa/shader;../../../../src/mesa/shader/slang;../../../../../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>NDEBUG;WIN32;_LIB;_DLL;_GDI32_;BUILD_GL32;WIN32_THREADS;MESA_MINWARN;_CRT_SECURE_NO_DEPRECATE;INSERVER;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ <WarningLevel>Level3</WarningLevel>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <ForcedIncludeFiles>../../../../src/mesa/main/compiler.h;%(ForcedIncludeFiles)</ForcedIncludeFiles>
+ <BufferSecurityCheck>false</BufferSecurityCheck>
+ <EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>
+ </ClCompile>
+ <ResourceCompile>
+ <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <Culture>0x0409</Culture>
+ </ResourceCompile>
+ <Lib>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ </Lib>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <ClCompile>
+ <Optimization>Disabled</Optimization>
+ <AdditionalIncludeDirectories>../../../../include;../../../../src/mesa;../../../../src/glsl;../../../../src/mapi;../../../../src/mesa/main;../../../../src/mesa/shader;../../../../src/mesa/shader/slang;../../../../../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>_DEBUG;DEBUG;WIN32;_LIB;_DLL;_GDI32_;BUILD_GL32;WIN32_THREADS;MESA_MINWARN;_CRT_SECURE_NO_DEPRECATE;INSERVER;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
+ <BrowseInformation>true</BrowseInformation>
+ <WarningLevel>Level3</WarningLevel>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <ForcedIncludeFiles>../../../../src/mesa/main/compiler.h;%(ForcedIncludeFiles)</ForcedIncludeFiles>
+ </ClCompile>
+ <ResourceCompile>
+ <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <Culture>0x0409</Culture>
+ </ResourceCompile>
+ <Lib>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ </Lib>
+ </ItemDefinitionGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\glsl_apps_compile\glsl_apps_compile.vcxproj">
+ <Project>{98ab3d51-1820-4d14-9195-75fca6997784}</Project>
+ <CopyLocalSatelliteAssemblies>true</CopyLocalSatelliteAssemblies>
+ <ReferenceOutputAssembly>true</ReferenceOutputAssembly>
+ </ProjectReference>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\..\src\glsl\ast_expr.cpp" />
+ <ClCompile Include="..\..\..\..\src\glsl\ast_function.cpp" />
+ <ClCompile Include="..\..\..\..\src\glsl\ast_to_hir.cpp" />
+ <ClCompile Include="..\..\..\..\src\glsl\ast_type.cpp" />
+ <ClCompile Include="..\..\..\..\src\glsl\builtin_stubs.cpp" />
+ <ClCompile Include="..\..\..\..\src\glsl\glcpp\glcpp-lex.c" />
+ <ClCompile Include="..\..\..\..\src\glsl\glcpp\glcpp-parse.c" />
+ <ClCompile Include="..\..\..\..\src\glsl\glcpp\pp.c" />
+ <ClCompile Include="..\..\..\..\src\glsl\glsl_lexer.cpp" />
+ <ClCompile Include="..\..\..\..\src\glsl\glsl_parser.cpp" />
+ <ClCompile Include="..\..\..\..\src\glsl\glsl_parser_extras.cpp" />
+ <ClCompile Include="..\..\..\..\src\glsl\glsl_symbol_table.cpp" />
+ <ClCompile Include="..\..\..\..\src\glsl\glsl_types.cpp" />
+ <ClCompile Include="..\..\..\..\src\glsl\hir_field_selection.cpp" />
+ <ClCompile Include="..\..\..\..\src\glsl\ir.cpp" />
+ <ClCompile Include="..\..\..\..\src\glsl\ir_basic_block.cpp" />
+ <ClCompile Include="..\..\..\..\src\glsl\ir_clone.cpp" />
+ <ClCompile Include="..\..\..\..\src\glsl\ir_constant_expression.cpp" />
+ <ClCompile Include="..\..\..\..\src\glsl\ir_expression_flattening.cpp" />
+ <ClCompile Include="..\..\..\..\src\glsl\ir_function.cpp" />
+ <ClCompile Include="..\..\..\..\src\glsl\ir_function_can_inline.cpp" />
+ <ClCompile Include="..\..\..\..\src\glsl\ir_hierarchical_visitor.cpp" />
+ <ClCompile Include="..\..\..\..\src\glsl\ir_hv_accept.cpp" />
+ <ClCompile Include="..\..\..\..\src\glsl\ir_import_prototypes.cpp" />
+ <ClCompile Include="..\..\..\..\src\glsl\ir_print_visitor.cpp" />
+ <ClCompile Include="..\..\..\..\src\glsl\ir_reader.cpp" />
+ <ClCompile Include="..\..\..\..\src\glsl\ir_rvalue_visitor.cpp" />
+ <ClCompile Include="..\..\..\..\src\glsl\ir_set_program_inouts.cpp" />
+ <ClCompile Include="..\..\..\..\src\glsl\ir_validate.cpp">
+ <ForcedIncludeFiles Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ </ForcedIncludeFiles>
+ <ForcedIncludeFiles Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ </ForcedIncludeFiles>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\glsl\ir_variable.cpp">
+ <ForcedIncludeFiles Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ </ForcedIncludeFiles>
+ <ForcedIncludeFiles Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ </ForcedIncludeFiles>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\glsl\ir_variable_refcount.cpp" />
+ <ClCompile Include="..\..\..\..\src\glsl\linker.cpp" />
+ <ClCompile Include="..\..\..\..\src\glsl\link_functions.cpp" />
+ <ClCompile Include="..\..\..\..\src\glsl\loop_analysis.cpp" />
+ <ClCompile Include="..\..\..\..\src\glsl\loop_controls.cpp" />
+ <ClCompile Include="..\..\..\..\src\glsl\loop_unroll.cpp" />
+ <ClCompile Include="..\..\..\..\src\glsl\lower_discard.cpp" />
+ <ClCompile Include="..\..\..\..\src\glsl\lower_if_to_cond_assign.cpp" />
+ <ClCompile Include="..\..\..\..\src\glsl\lower_instructions.cpp" />
+ <ClCompile Include="..\..\..\..\src\glsl\lower_jumps.cpp" />
+ <ClCompile Include="..\..\..\..\src\glsl\lower_mat_op_to_vec.cpp" />
+ <ClCompile Include="..\..\..\..\src\glsl\lower_noise.cpp" />
+ <ClCompile Include="..\..\..\..\src\glsl\lower_texture_projection.cpp" />
+ <ClCompile Include="..\..\..\..\src\glsl\lower_variable_index_to_cond_assign.cpp" />
+ <ClCompile Include="..\..\..\..\src\glsl\lower_vector.cpp" />
+ <ClCompile Include="..\..\..\..\src\glsl\lower_vec_index_to_cond_assign.cpp" />
+ <ClCompile Include="..\..\..\..\src\glsl\lower_vec_index_to_swizzle.cpp" />
+ <ClCompile Include="..\..\..\..\src\glsl\opt_algebraic.cpp" />
+ <ClCompile Include="..\..\..\..\src\glsl\opt_constant_folding.cpp" />
+ <ClCompile Include="..\..\..\..\src\glsl\opt_constant_propagation.cpp" />
+ <ClCompile Include="..\..\..\..\src\glsl\opt_constant_variable.cpp" />
+ <ClCompile Include="..\..\..\..\src\glsl\opt_copy_propagation.cpp" />
+ <ClCompile Include="..\..\..\..\src\glsl\opt_copy_propagation_elements.cpp" />
+ <ClCompile Include="..\..\..\..\src\glsl\opt_dead_code.cpp" />
+ <ClCompile Include="..\..\..\..\src\glsl\opt_dead_code_local.cpp" />
+ <ClCompile Include="..\..\..\..\src\glsl\opt_dead_functions.cpp" />
+ <ClCompile Include="..\..\..\..\src\glsl\opt_discard_simplification.cpp" />
+ <ClCompile Include="..\..\..\..\src\glsl\opt_function_inlining.cpp" />
+ <ClCompile Include="..\..\..\..\src\glsl\opt_if_simplification.cpp" />
+ <ClCompile Include="..\..\..\..\src\glsl\opt_noop_swizzle.cpp" />
+ <ClCompile Include="..\..\..\..\src\glsl\opt_redundant_jumps.cpp" />
+ <ClCompile Include="..\..\..\..\src\glsl\opt_structure_splitting.cpp" />
+ <ClCompile Include="..\..\..\..\src\glsl\opt_swizzle_swizzle.cpp" />
+ <ClCompile Include="..\..\..\..\src\glsl\opt_tree_grafting.cpp" />
+ <ClCompile Include="..\..\..\..\src\glsl\ralloc.c" />
+ <ClCompile Include="..\..\..\..\src\glsl\strtod.c" />
+ <ClCompile Include="..\..\..\..\src\glsl\s_expression.cpp" />
+ <ClCompile Include="..\..\..\..\src\mesa\main\accum.c" />
+ <ClCompile Include="..\..\..\..\src\mesa\main\api_arrayelt.c" />
+ <ClCompile Include="..\..\..\..\src\mesa\main\api_exec.c" />
+ <ClCompile Include="..\..\..\..\src\mesa\main\api_loopback.c" />
+ <ClCompile Include="..\..\..\..\src\mesa\main\api_noop.c" />
+ <ClCompile Include="..\..\..\..\src\mesa\main\api_validate.c" />
+ <ClCompile Include="..\..\..\..\src\mesa\main\arbprogram.c" />
+ <ClCompile Include="..\..\..\..\src\mesa\main\atifragshader.c" />
+ <ClCompile Include="..\..\..\..\src\mesa\main\nvprogram.c" />
+ <ClCompile Include="..\..\..\..\src\mesa\main\pack.c" />
+ <ClCompile Include="..\..\..\..\src\mesa\main\pixeltransfer.c" />
+ <ClCompile Include="..\..\..\..\src\mesa\main\querymatrix.c" />
+ <ClCompile Include="..\..\..\..\src\mesa\main\shaderapi.c" />
+ <ClCompile Include="..\..\..\..\src\mesa\main\shaderobj.c" />
+ <ClCompile Include="..\..\..\..\src\mesa\main\transformfeedback.c" />
+ <ClCompile Include="..\..\..\..\src\mesa\main\uniforms.c" />
+ <ClCompile Include="..\..\..\..\src\mesa\program\arbprogparse.c" />
+ <ClCompile Include="..\..\..\..\src\mesa\main\arrayobj.c" />
+ <ClCompile Include="..\..\..\..\src\mesa\main\attrib.c" />
+ <ClCompile Include="..\..\..\..\src\mesa\main\blend.c" />
+ <ClCompile Include="..\..\..\..\src\mesa\main\bufferobj.c" />
+ <ClCompile Include="..\..\..\..\src\mesa\main\buffers.c" />
+ <ClCompile Include="..\..\..\..\src\mesa\main\ff_fragment_shader.cpp" />
+ <ClCompile Include="..\..\..\..\src\mesa\main\clear.c" />
+ <ClCompile Include="..\..\..\..\src\mesa\main\clip.c" />
+ <ClCompile Include="..\..\..\..\src\mesa\main\colortab.c" />
+ <ClCompile Include="..\..\..\..\src\mesa\main\condrender.c" />
+ <ClCompile Include="..\..\..\..\src\mesa\main\context.c" />
+ <ClCompile Include="..\..\..\..\src\mesa\main\convolve.c" />
+ <ClCompile Include="..\..\..\..\src\mesa\main\cpuinfo.c" />
+ <ClCompile Include="..\..\..\..\src\mesa\main\debug.c" />
+ <ClCompile Include="..\..\..\..\src\mesa\main\depth.c" />
+ <ClCompile Include="..\..\..\..\src\mesa\main\depthstencil.c" />
+ <ClCompile Include="..\..\..\..\src\mesa\main\dlist.c" />
+ <ClCompile Include="..\..\..\..\src\mesa\main\dlopen.c" />
+ <ClCompile Include="..\..\..\..\src\mesa\main\drawpix.c" />
+ <ClCompile Include="..\..\..\..\src\mesa\main\enable.c" />
+ <ClCompile Include="..\..\..\..\src\mesa\main\enums.c" />
+ <ClCompile Include="..\..\..\..\src\mesa\main\eval.c" />
+ <ClCompile Include="..\..\..\..\src\mesa\main\execmem.c" />
+ <ClCompile Include="..\..\..\..\src\mesa\main\extensions.c" />
+ <ClCompile Include="..\..\..\..\src\mesa\main\texturebarrier.c" />
+ <ClCompile Include="..\..\..\..\src\mesa\main\fbobject.c" />
+ <ClCompile Include="..\..\..\..\src\mesa\main\feedback.c" />
+ <ClCompile Include="..\..\..\..\src\mesa\main\ffvertex_prog.c" />
+ <ClCompile Include="..\..\..\..\src\mesa\main\fog.c" />
+ <ClCompile Include="..\..\..\..\src\mesa\main\formats.c" />
+ <ClCompile Include="..\..\..\..\src\mesa\main\framebuffer.c" />
+ <ClCompile Include="..\..\..\..\src\mesa\main\get.c" />
+ <ClCompile Include="..\..\..\..\src\mesa\main\getstring.c" />
+ <ClCompile Include="..\..\..\..\src\mesa\main\hash.c" />
+ <ClCompile Include="..\..\..\..\src\mesa\program\hash_table.c" />
+ <ClCompile Include="..\..\..\..\src\mesa\program\ir_to_mesa.cpp" />
+ <ClCompile Include="..\..\..\..\src\mesa\program\lex.yy.c" />
+ <ClCompile Include="..\..\..\..\src\mesa\program\nvfragparse.c" />
+ <ClCompile Include="..\..\..\..\src\mesa\program\nvvertparse.c" />
+ <ClCompile Include="..\..\..\..\src\mesa\program\program.c" />
+ <ClCompile Include="..\..\..\..\src\mesa\program\programopt.c" />
+ <ClCompile Include="..\..\..\..\src\mesa\program\program_parse.tab.c" />
+ <ClCompile Include="..\..\..\..\src\mesa\program\program_parse_extra.c" />
+ <ClCompile Include="..\..\..\..\src\mesa\program\prog_cache.c" />
+ <ClCompile Include="..\..\..\..\src\mesa\program\prog_execute.c" />
+ <ClCompile Include="..\..\..\..\src\mesa\program\prog_instruction.c" />
+ <ClCompile Include="..\..\..\..\src\mesa\program\prog_noise.c" />
+ <ClCompile Include="..\..\..\..\src\mesa\program\prog_optimize.c" />
+ <ClCompile Include="..\..\..\..\src\mesa\program\prog_parameter.c" />
+ <ClCompile Include="..\..\..\..\src\mesa\program\prog_parameter_layout.c" />
+ <ClCompile Include="..\..\..\..\src\mesa\program\prog_print.c" />
+ <ClCompile Include="..\..\..\..\src\mesa\program\prog_statevars.c" />
+ <ClCompile Include="..\..\..\..\src\mesa\program\prog_uniform.c" />
+ <ClCompile Include="..\..\..\..\src\mesa\program\register_allocate.c" />
+ <ClCompile Include="..\..\..\..\src\mesa\program\sampler.cpp" />
+ <ClCompile Include="..\..\..\..\src\mesa\program\symbol_table.c" />
+ <ClCompile Include="..\..\..\..\src\mesa\main\hint.c" />
+ <ClCompile Include="..\..\..\..\src\mesa\main\histogram.c" />
+ <ClCompile Include="..\..\..\..\src\mesa\main\image.c" />
+ <ClCompile Include="..\..\..\..\src\mesa\main\imports.c" />
+ <ClCompile Include="..\..\..\..\src\mesa\main\light.c" />
+ <ClCompile Include="..\..\..\..\src\mesa\main\lines.c" />
+ <ClCompile Include="..\..\..\..\src\mesa\math\m_eval.c" />
+ <ClCompile Include="..\..\..\..\src\mesa\math\m_matrix.c" />
+ <ClCompile Include="..\..\..\..\src\mesa\math\m_translate.c" />
+ <ClCompile Include="..\..\..\..\src\mesa\math\m_vector.c" />
+ <ClCompile Include="..\..\..\..\src\mesa\math\m_xform.c" />
+ <ClCompile Include="..\..\..\..\src\mesa\main\matrix.c" />
+ <ClCompile Include="..\..\..\..\src\mesa\main\mipmap.c" />
+ <ClCompile Include="..\..\..\..\src\mesa\main\mm.c" />
+ <ClCompile Include="..\..\..\..\src\mesa\main\multisample.c" />
+ <ClCompile Include="..\..\..\..\src\mesa\main\pbo.c" />
+ <ClCompile Include="..\..\..\..\src\mesa\main\pixel.c" />
+ <ClCompile Include="..\..\..\..\src\mesa\main\pixelstore.c" />
+ <ClCompile Include="..\..\..\..\src\mesa\main\points.c" />
+ <ClCompile Include="..\..\..\..\src\mesa\main\polygon.c" />
+ <ClCompile Include="..\..\..\..\src\mesa\main\queryobj.c" />
+ <ClCompile Include="..\..\..\..\src\mesa\main\rastpos.c" />
+ <ClCompile Include="..\..\..\..\src\mesa\main\readpix.c" />
+ <ClCompile Include="..\..\..\..\src\mesa\main\renderbuffer.c" />
+ <ClCompile Include="..\..\..\..\src\mesa\main\scissor.c" />
+ <ClCompile Include="..\..\..\..\src\mesa\main\shared.c" />
+ <ClCompile Include="..\..\..\..\src\mesa\main\state.c" />
+ <ClCompile Include="..\..\..\..\src\mesa\main\stencil.c" />
+ <ClCompile Include="..\..\..\..\src\mesa\main\syncobj.c" />
+ <ClCompile Include="..\..\..\..\src\mesa\tnl\t_context.c" />
+ <ClCompile Include="..\..\..\..\src\mesa\tnl\t_draw.c" />
+ <ClCompile Include="..\..\..\..\src\mesa\tnl\t_pipeline.c" />
+ <ClCompile Include="..\..\..\..\src\mesa\tnl\t_rasterpos.c" />
+ <ClCompile Include="..\..\..\..\src\mesa\tnl\t_vb_fog.c" />
+ <ClCompile Include="..\..\..\..\src\mesa\tnl\t_vb_light.c" />
+ <ClCompile Include="..\..\..\..\src\mesa\tnl\t_vb_normals.c" />
+ <ClCompile Include="..\..\..\..\src\mesa\tnl\t_vb_points.c" />
+ <ClCompile Include="..\..\..\..\src\mesa\tnl\t_vb_program.c" />
+ <ClCompile Include="..\..\..\..\src\mesa\tnl\t_vb_render.c" />
+ <ClCompile Include="..\..\..\..\src\mesa\tnl\t_vb_texgen.c" />
+ <ClCompile Include="..\..\..\..\src\mesa\tnl\t_vb_texmat.c" />
+ <ClCompile Include="..\..\..\..\src\mesa\tnl\t_vb_vertex.c" />
+ <ClCompile Include="..\..\..\..\src\mesa\tnl\t_vertex.c" />
+ <ClCompile Include="..\..\..\..\src\mesa\tnl\t_vertex_generic.c" />
+ <ClCompile Include="..\..\..\..\src\mesa\tnl\t_vp_build.c" />
+ <ClCompile Include="..\..\..\..\src\mesa\main\texcompress.c" />
+ <ClCompile Include="..\..\..\..\src\mesa\main\texcompress_fxt1.c" />
+ <ClCompile Include="..\..\..\..\src\mesa\main\texcompress_rgtc.c" />
+ <ClCompile Include="..\..\..\..\src\mesa\main\texcompress_s3tc.c" />
+ <ClCompile Include="..\..\..\..\src\mesa\main\texenv.c" />
+ <ClCompile Include="..\..\..\..\src\mesa\main\texfetch.c" />
+ <ClCompile Include="..\..\..\..\src\mesa\main\samplerobj.c" />
+ <ClCompile Include="..\..\..\..\src\mesa\main\texformat.c" />
+ <ClCompile Include="..\..\..\..\src\mesa\main\texgen.c" />
+ <ClCompile Include="..\..\..\..\src\mesa\main\texgetimage.c" />
+ <ClCompile Include="..\..\..\..\src\mesa\main\teximage.c" />
+ <ClCompile Include="..\..\..\..\src\mesa\main\texobj.c" />
+ <ClCompile Include="..\..\..\..\src\mesa\main\texparam.c" />
+ <ClCompile Include="..\..\..\..\src\mesa\main\texrender.c" />
+ <ClCompile Include="..\..\..\..\src\mesa\main\texstate.c" />
+ <ClCompile Include="..\..\..\..\src\mesa\main\texstore.c" />
+ <ClCompile Include="..\..\..\..\src\mesa\main\varray.c" />
+ <ClCompile Include="..\..\..\..\src\mesa\vbo\vbo_context.c" />
+ <ClCompile Include="..\..\..\..\src\mesa\vbo\vbo_exec.c" />
+ <ClCompile Include="..\..\..\..\src\mesa\vbo\vbo_exec_api.c" />
+ <ClCompile Include="..\..\..\..\src\mesa\vbo\vbo_exec_array.c" />
+ <ClCompile Include="..\..\..\..\src\mesa\vbo\vbo_exec_draw.c" />
+ <ClCompile Include="..\..\..\..\src\mesa\vbo\vbo_exec_eval.c" />
+ <ClCompile Include="..\..\..\..\src\mesa\vbo\vbo_rebase.c" />
+ <ClCompile Include="..\..\..\..\src\mesa\vbo\vbo_save.c" />
+ <ClCompile Include="..\..\..\..\src\mesa\vbo\vbo_save_api.c" />
+ <ClCompile Include="..\..\..\..\src\mesa\vbo\vbo_save_draw.c" />
+ <ClCompile Include="..\..\..\..\src\mesa\vbo\vbo_save_loopback.c" />
+ <ClCompile Include="..\..\..\..\src\mesa\vbo\vbo_split.c" />
+ <ClCompile Include="..\..\..\..\src\mesa\vbo\vbo_split_copy.c" />
+ <ClCompile Include="..\..\..\..\src\mesa\vbo\vbo_split_inplace.c" />
+ <ClCompile Include="..\..\..\..\src\mesa\main\version.c" />
+ <ClCompile Include="..\..\..\..\src\mesa\main\viewport.c" />
+ <ClCompile Include="..\..\..\..\src\mesa\main\vtxfmt.c" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\..\..\src\glsl\strtod.h" />
+ </ItemGroup>
+ <ItemGroup>
+ <CustomBuild Include="..\..\..\..\src\mesa\program\program_lexer.l">
+ <FileType>Document</FileType>
+ <Command Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\..\..\..\src\mesa\program\doflexbison.bat</Command>
+ <Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\..\..\..\src\mesa\program\lex.yy.c;..\..\..\..\src\mesa\program\program_parse.tab.c;..\..\..\..\src\mesa\program\program_parse.tab.h;%(Outputs)</Outputs>
+ <Command Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">..\..\..\..\src\mesa\program\doflexbison.bat</Command>
+ <Outputs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">..\..\..\..\src\mesa\program\lex.yy.c;..\..\..\..\src\mesa\program\program_parse.tab.c;..\..\..\..\src\mesa\program\program_parse.tab.h;%(Outputs)</Outputs>
+ <AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\..\..\..\src\mesa\program\program_parse.y;%(AdditionalInputs)</AdditionalInputs>
+ <AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">..\..\..\..\src\mesa\program\program_parse.y;%(AdditionalInputs)</AdditionalInputs>
+ </CustomBuild>
+ <None Include="..\..\..\..\src\mesa\program\program_parse.y">
+ <Command Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\..\..\..\src\mesa\program\dobison.bat</Command>
+ <Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\..\..\..\src\mesa\program\program_parse.tab.c;..\..\..\..\src\mesa\program\program_parse.tab.h;%(Outputs)</Outputs>
+ <Command Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">..\..\..\..\src\mesa\program\dobison.bat</Command>
+ <Outputs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">..\..\..\..\src\mesa\program\program_parse.tab.c;..\..\..\..\src\mesa\program\program_parse.tab.h;%(Outputs)</Outputs>
+ <FileType>Document</FileType>
+ </None>
+ </ItemGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project> \ No newline at end of file
diff --git a/mesalib/windows/VC8/mesa/mesa/mesa.vcxproj.filters b/mesalib/windows/VC8/mesa/mesa/mesa.vcxproj.filters
new file mode 100644
index 000000000..6746a6d51
--- /dev/null
+++ b/mesalib/windows/VC8/mesa/mesa/mesa.vcxproj.filters
@@ -0,0 +1,687 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="Source Files">
+ <UniqueIdentifier>{8411a2f0-9621-4bb9-9aec-30713df37794}</UniqueIdentifier>
+ <Extensions>cpp;c;cxx;rc;def;r;odl;idl;hpj;bat</Extensions>
+ </Filter>
+ <Filter Include="Header Files">
+ <UniqueIdentifier>{82940400-de84-4aa3-8c90-a68fc32ae059}</UniqueIdentifier>
+ <Extensions>h;hpp;hxx;hm;inl</Extensions>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\..\src\mesa\main\api_arrayelt.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\main\api_exec.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\main\api_loopback.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\main\api_noop.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\main\api_validate.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\main\arrayobj.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\main\attrib.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\main\blend.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\main\bufferobj.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\main\ff_fragment_shader.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\main\buffers.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\main\clear.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\main\clip.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\main\colortab.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\main\condrender.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\main\context.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\main\convolve.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\main\cpuinfo.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\main\debug.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\main\depth.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\main\depthstencil.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\main\dlist.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\main\dlopen.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\main\drawpix.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\main\enable.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\main\enums.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\main\eval.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\main\execmem.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\main\extensions.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\main\texturebarrier.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\main\fbobject.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\main\feedback.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\main\ffvertex_prog.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\main\fog.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\main\formats.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\main\framebuffer.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\main\get.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\main\getstring.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\main\hash.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\main\hint.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\main\histogram.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\main\image.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\main\imports.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\main\light.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\main\lines.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\math\m_eval.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\math\m_matrix.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\math\m_translate.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\math\m_vector.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\math\m_xform.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\main\matrix.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\main\mipmap.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\main\mm.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\main\multisample.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\main\pixel.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\main\pixelstore.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\main\points.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\main\polygon.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\main\queryobj.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\main\rastpos.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\main\readpix.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\main\renderbuffer.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\main\scissor.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\main\shared.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\main\state.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\main\stencil.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\main\syncobj.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\tnl\t_context.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\tnl\t_draw.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\tnl\t_pipeline.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\tnl\t_rasterpos.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\tnl\t_vb_fog.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\tnl\t_vb_light.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\tnl\t_vb_normals.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\tnl\t_vb_points.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\tnl\t_vb_program.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\tnl\t_vb_render.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\tnl\t_vb_texgen.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\tnl\t_vb_texmat.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\tnl\t_vb_vertex.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\tnl\t_vertex.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\tnl\t_vertex_generic.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\tnl\t_vp_build.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\main\texcompress.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\main\texcompress_fxt1.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\main\texcompress_s3tc.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\main\texenv.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\main\texfetch.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\main\samplerobj.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\main\texformat.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\main\texgen.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\main\texgetimage.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\main\teximage.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\main\texobj.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\main\texparam.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\main\texrender.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\main\texstate.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\main\texstore.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\main\varray.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\vbo\vbo_context.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\vbo\vbo_exec.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\vbo\vbo_exec_api.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\vbo\vbo_exec_array.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\vbo\vbo_exec_draw.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\vbo\vbo_exec_eval.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\vbo\vbo_rebase.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\vbo\vbo_save.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\vbo\vbo_save_api.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\vbo\vbo_save_draw.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\vbo\vbo_save_loopback.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\vbo\vbo_split.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\vbo\vbo_split_copy.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\vbo\vbo_split_inplace.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\main\version.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\main\viewport.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\main\vtxfmt.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\program\arbprogparse.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\main\arbprogram.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\main\atifragshader.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\program\symbol_table.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\program\programopt.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\program\prog_uniform.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\program\program.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\program\program_parse_extra.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\program\prog_cache.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\program\prog_execute.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\program\prog_instruction.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\program\prog_noise.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\program\prog_optimize.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\program\prog_parameter.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\program\prog_parameter_layout.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\program\prog_print.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\program\prog_statevars.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\program\hash_table.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\program\nvfragparse.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\program\nvvertparse.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\main\nvprogram.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\program\lex.yy.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\program\program_parse.tab.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\main\transformfeedback.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\main\shaderobj.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\main\shaderapi.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\main\accum.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\main\querymatrix.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\main\uniforms.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\program\ir_to_mesa.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\glsl\ralloc.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\glsl\ir.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\glsl\lower_variable_index_to_cond_assign.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\glsl\ir_hierarchical_visitor.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\glsl\glsl_types.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\glsl\ir_variable.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\glsl\ir_function.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\glsl\ir_function_can_inline.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\glsl\ir_rvalue_visitor.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\glsl\ir_hv_accept.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\glsl\glsl_symbol_table.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\glsl\ir_constant_expression.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\glsl\ir_clone.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\glsl\linker.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\glsl\glsl_parser_extras.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\glsl\ir_variable_refcount.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\glsl\ir_basic_block.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\glsl\loop_analysis.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\glsl\loop_controls.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\glsl\ir_expression_flattening.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\glsl\ir_import_prototypes.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\glsl\link_functions.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\glsl\loop_unroll.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\glsl\opt_redundant_jumps.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\glsl\ast_to_hir.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\glsl\ast_expr.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\glsl\hir_field_selection.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\glsl\glsl_lexer.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\glsl\ast_type.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\glsl\glcpp\pp.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\glsl\glcpp\glcpp-parse.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\glsl\glcpp\glcpp-lex.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\glsl\ir_reader.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\glsl\glsl_parser.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\glsl\ir_print_visitor.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\glsl\ir_validate.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\glsl\ir_set_program_inouts.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\glsl\lower_noise.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\glsl\ast_function.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\glsl\s_expression.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\main\pack.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\main\pixeltransfer.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\program\register_allocate.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\glsl\lower_vec_index_to_swizzle.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\glsl\opt_constant_folding.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\glsl\opt_structure_splitting.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\glsl\opt_constant_variable.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\glsl\opt_algebraic.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\glsl\opt_if_simplification.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\glsl\lower_instructions.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\glsl\opt_dead_code_local.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\glsl\opt_discard_simplification.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\glsl\lower_vec_index_to_cond_assign.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\glsl\opt_function_inlining.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\glsl\lower_texture_projection.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\glsl\opt_dead_functions.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\glsl\lower_vector.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\glsl\strtod.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\glsl\opt_copy_propagation.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\glsl\opt_dead_code.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\glsl\lower_discard.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\glsl\lower_mat_op_to_vec.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\glsl\opt_tree_grafting.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\glsl\opt_noop_swizzle.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\glsl\lower_jumps.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\glsl\opt_constant_propagation.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\glsl\lower_if_to_cond_assign.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\glsl\opt_swizzle_swizzle.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\program\sampler.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\glsl\builtin_stubs.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\glsl\opt_copy_propagation_elements.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\main\pbo.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\main\texcompress_rgtc.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\..\..\src\glsl\strtod.h">
+ <Filter>Source Files</Filter>
+ </ClInclude>
+ </ItemGroup>
+ <ItemGroup>
+ <CustomBuild Include="..\..\..\..\src\mesa\program\program_lexer.l">
+ <Filter>Source Files</Filter>
+ </CustomBuild>
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="..\..\..\..\src\mesa\program\program_parse.y">
+ <Filter>Source Files</Filter>
+ </None>
+ </ItemGroup>
+</Project> \ No newline at end of file
diff --git a/mesalib/windows/VC8/mesa/mesavc10.sln b/mesalib/windows/VC8/mesa/mesavc10.sln
new file mode 100644
index 000000000..92fcf6f6d
--- /dev/null
+++ b/mesalib/windows/VC8/mesa/mesavc10.sln
@@ -0,0 +1,31 @@
+Microsoft Visual Studio Solution File, Format Version 11.00
+# Visual Studio 2010
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mesa", "mesa\mesa.vcxproj", "{2120C974-2717-4709-B44F-D6E6D0A56448}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "glsl_apps_compile", "glsl_apps_compile\glsl_apps_compile.vcxproj", "{98AB3D51-1820-4D14-9195-75FCA6997784}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "swrast_dri", "swrast_dri\swrast_dri.vcxproj", "{FEF62E6F-A7E0-47BE-99A0-2494717DBDB7}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Win32 = Debug|Win32
+ Release|Win32 = Release|Win32
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {2120C974-2717-4709-B44F-D6E6D0A56448}.Debug|Win32.ActiveCfg = Debug|Win32
+ {2120C974-2717-4709-B44F-D6E6D0A56448}.Debug|Win32.Build.0 = Debug|Win32
+ {2120C974-2717-4709-B44F-D6E6D0A56448}.Release|Win32.ActiveCfg = Release|Win32
+ {2120C974-2717-4709-B44F-D6E6D0A56448}.Release|Win32.Build.0 = Release|Win32
+ {98AB3D51-1820-4D14-9195-75FCA6997784}.Debug|Win32.ActiveCfg = Debug|Win32
+ {98AB3D51-1820-4D14-9195-75FCA6997784}.Debug|Win32.Build.0 = Debug|Win32
+ {98AB3D51-1820-4D14-9195-75FCA6997784}.Release|Win32.ActiveCfg = Release|Win32
+ {98AB3D51-1820-4D14-9195-75FCA6997784}.Release|Win32.Build.0 = Release|Win32
+ {FEF62E6F-A7E0-47BE-99A0-2494717DBDB7}.Debug|Win32.ActiveCfg = Debug|Win32
+ {FEF62E6F-A7E0-47BE-99A0-2494717DBDB7}.Debug|Win32.Build.0 = Debug|Win32
+ {FEF62E6F-A7E0-47BE-99A0-2494717DBDB7}.Release|Win32.ActiveCfg = Release|Win32
+ {FEF62E6F-A7E0-47BE-99A0-2494717DBDB7}.Release|Win32.Build.0 = Release|Win32
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
diff --git a/mesalib/windows/VC8/mesa/swrast_dri/swrast_dri.vcproj b/mesalib/windows/VC8/mesa/swrast_dri/swrast_dri.vcproj
new file mode 100644
index 000000000..d4086f118
--- /dev/null
+++ b/mesalib/windows/VC8/mesa/swrast_dri/swrast_dri.vcproj
@@ -0,0 +1,434 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="9,00"
+ Name="swrast_dri"
+ ProjectGUID="{FEF62E6F-A7E0-47BE-99A0-2494717DBDB7}"
+ RootNamespace="swrast_dri"
+ TargetFrameworkVersion="131072"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)"
+ ConfigurationType="2"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ PreprocessorDefinitions="_DEBUG"
+ MkTypLibCompatible="true"
+ SuppressStartupBanner="true"
+ TargetEnvironment="1"
+ TypeLibraryName=".\Debug/swrast_dri.tlb"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../../../include;../../../../src/mesa/drivers/dri/common;../../../../src/mesa"
+ PreprocessorDefinitions="_DEBUG;WIN32;_WINDOWS;_USRDLL;SWRAST_DRI_EXPORTS;_DLL;BUILD_GL32;MESA_MINWARN;IN_DRI_DRIVER;INSERVER"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ BrowseInformation="1"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ DebugInformationFormat="3"
+ CompileAs="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_DEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalOptions="/MACHINE:I386"
+ AdditionalDependencies="gdi32.lib user32.lib vcxsrv_dbg.lib"
+ OutputFile="$(OutDir)\swrast_dri.dll"
+ LinkIncremental="1"
+ SuppressStartupBanner="true"
+ AdditionalLibraryDirectories="&quot;$(TargetDir)&quot;;&quot;..\..\..\..\..\xorg-server\obj\servdebug&quot;"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile="$(TargetDir)swrast_dri.pdb"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)"
+ ConfigurationType="2"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ PreprocessorDefinitions="NDEBUG"
+ MkTypLibCompatible="true"
+ SuppressStartupBanner="true"
+ TargetEnvironment="1"
+ TypeLibraryName=".\Release/swrast_dri.tlb"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ InlineFunctionExpansion="2"
+ OmitFramePointers="true"
+ WholeProgramOptimization="true"
+ AdditionalIncludeDirectories="../../../../include;../../../../src/mesa/drivers/dri/common;../../../../src/mesa"
+ PreprocessorDefinitions="NDEBUG;WIN32;_WINDOWS;_USRDLL;SWRAST_DRI_EXPORTS;_DLL;BUILD_GL32;MESA_MINWARN;IN_DRI_DRIVER;INSERVER"
+ StringPooling="true"
+ ExceptionHandling="0"
+ RuntimeLibrary="2"
+ BufferSecurityCheck="false"
+ EnableFunctionLevelLinking="true"
+ EnableEnhancedInstructionSet="2"
+ PrecompiledHeaderFile=".\Release/swrast_dri.pch"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ CompileAs="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="NDEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalOptions="/MACHINE:I386"
+ AdditionalDependencies="gdi32.lib user32.lib vcxsrv.lib"
+ OutputFile="$(OutDir)\swrast_dri.dll"
+ LinkIncremental="1"
+ SuppressStartupBanner="true"
+ AdditionalLibraryDirectories="$(TargetDir);&quot;..\..\..\..\..\xorg-server\obj\servrelease&quot;"
+ ProgramDatabaseFile="$(TargetDir)swrast_dri.pdb"
+ LinkTimeCodeGeneration="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Debug Static CRT|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)"
+ ConfigurationType="2"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ PreprocessorDefinitions="_DEBUG"
+ MkTypLibCompatible="true"
+ SuppressStartupBanner="true"
+ TargetEnvironment="1"
+ TypeLibraryName=".\Debug/swrast_dri.tlb"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../../../include;../../../../src/mesa/drivers/dri/common;../../../../src/mesa"
+ PreprocessorDefinitions="_DEBUG;WIN32;_WINDOWS;_USRDLL;SWRAST_DRI_EXPORTS;BUILD_GL32;MESA_MINWARN;IN_DRI_DRIVER;INSERVER"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="1"
+ BrowseInformation="1"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ DebugInformationFormat="3"
+ CompileAs="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_DEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalOptions="/MACHINE:I386"
+ AdditionalDependencies="gdi32.lib user32.lib vcxsrv_dbg.lib"
+ OutputFile="$(OutDir)\swrast_dri.dll"
+ LinkIncremental="1"
+ SuppressStartupBanner="true"
+ AdditionalLibraryDirectories="$(TargetDir);&quot;..\..\..\..\..\xorg-server\obj\servdebug&quot;"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile="$(TargetDir)swrast_dri.pdb"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release Static CRT|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)"
+ ConfigurationType="2"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ PreprocessorDefinitions="NDEBUG"
+ MkTypLibCompatible="true"
+ SuppressStartupBanner="true"
+ TargetEnvironment="1"
+ TypeLibraryName=".\Release/swrast_dri.tlb"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ InlineFunctionExpansion="2"
+ OmitFramePointers="true"
+ WholeProgramOptimization="true"
+ AdditionalIncludeDirectories="../../../../include;../../../../src/mesa/drivers/dri/common;../../../../src/mesa"
+ PreprocessorDefinitions="NDEBUG;WIN32;_WINDOWS;_USRDLL;SWRAST_DRI_EXPORTS;BUILD_GL32;MESA_MINWARN;IN_DRI_DRIVER;INSERVER"
+ StringPooling="true"
+ ExceptionHandling="0"
+ RuntimeLibrary="0"
+ BufferSecurityCheck="false"
+ EnableFunctionLevelLinking="true"
+ EnableEnhancedInstructionSet="2"
+ PrecompiledHeaderFile=".\Release/swrast_dri.pch"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ CompileAs="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="NDEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalOptions="/MACHINE:I386"
+ AdditionalDependencies="gdi32.lib user32.lib vcxsrv.lib"
+ OutputFile="$(OutDir)\swrast_dri.dll"
+ LinkIncremental="1"
+ SuppressStartupBanner="true"
+ AdditionalLibraryDirectories="$(TargetDir);&quot;..\..\..\..\..\xorg-server\obj\servrelease&quot;"
+ ProgramDatabaseFile="$(TargetDir)swrast_dri.pdb"
+ LinkTimeCodeGeneration="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+ >
+ <File
+ RelativePath="..\..\..\..\src\mesa\drivers\common\driverfuncs.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\drivers\common\meta.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\main\remap.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\drivers\dri\swrast\swrast.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\drivers\dri\swrast\swrast_priv.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\drivers\dri\swrast\swrast_span.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\src\mesa\drivers\dri\common\utils.c"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl"
+ >
+ </Filter>
+ <Filter
+ Name="Resource Files"
+ Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+ >
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/mesalib/windows/VC8/mesa/swrast_dri/swrast_dri.vcxproj b/mesalib/windows/VC8/mesa/swrast_dri/swrast_dri.vcxproj
new file mode 100644
index 000000000..16e22f71c
--- /dev/null
+++ b/mesalib/windows/VC8/mesa/swrast_dri/swrast_dri.vcxproj
@@ -0,0 +1,178 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{FEF62E6F-A7E0-47BE-99A0-2494717DBDB7}</ProjectGuid>
+ <RootNamespace>swrast_dri</RootNamespace>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseOfMfc>false</UseOfMfc>
+ <CharacterSet>MultiByte</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseOfMfc>false</UseOfMfc>
+ <CharacterSet>MultiByte</CharacterSet>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup>
+ <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Configuration)\</IntDir>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</LinkIncremental>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Configuration)\</IntDir>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <Midl>
+ <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MkTypLibCompatible>true</MkTypLibCompatible>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <TargetEnvironment>Win32</TargetEnvironment>
+ <TypeLibraryName>.\Debug/swrast_dri.tlb</TypeLibraryName>
+ </Midl>
+ <ClCompile>
+ <Optimization>Disabled</Optimization>
+ <AdditionalIncludeDirectories>../../../../include;../../../../src/mesa;../../../../src/glsl;../../../../src/mapi;../../../../src/mesa/main;../../../../src/mesa/shader;../../../../src/mesa/shader/slang;../../../../../include;../../../../src/mesa/drivers/dri/common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>_DEBUG;DEBUG;WIN32;_DLL;SWRAST_DRI_EXPORTS;_GDI32_;BUILD_GL32;WIN32_THREADS;MESA_MINWARN;_CRT_SECURE_NO_DEPRECATE;INSERVER;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
+ <BrowseInformation>true</BrowseInformation>
+ <WarningLevel>Level3</WarningLevel>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <CompileAs>Default</CompileAs>
+ </ClCompile>
+ <ResourceCompile>
+ <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <Culture>0x0409</Culture>
+ </ResourceCompile>
+ <Link>
+ <AdditionalOptions>/MACHINE:I386 %(AdditionalOptions)</AdditionalOptions>
+ <AdditionalDependencies>gdi32.lib;user32.lib;vcxsrv_dbg.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)swrast_dri.dll</OutputFile>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <AdditionalLibraryDirectories>$(TargetDir);..\..\..\..\..\xorg-server\obj\servdebug;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <ProgramDatabaseFile>$(TargetDir)swrast_dri.pdb</ProgramDatabaseFile>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>
+ </DataExecutionPrevention>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <Midl>
+ <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MkTypLibCompatible>true</MkTypLibCompatible>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <TargetEnvironment>Win32</TargetEnvironment>
+ <TypeLibraryName>.\Release/swrast_dri.tlb</TypeLibraryName>
+ </Midl>
+ <ClCompile>
+ <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
+ <OmitFramePointers>true</OmitFramePointers>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ <AdditionalIncludeDirectories>../../../../include;../../../../src/mesa;../../../../src/glsl;../../../../src/mapi;../../../../src/mesa/main;../../../../src/mesa/shader;../../../../src/mesa/shader/slang;../../../../../include;../../../../src/mesa/drivers/dri/common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>NDEBUG;WIN32;_DLL;SWRAST_DRI_EXPORTS;_GDI32_;BUILD_GL32;WIN32_THREADS;MESA_MINWARN;_CRT_SECURE_NO_DEPRECATE;INSERVER;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <ExceptionHandling>
+ </ExceptionHandling>
+ <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+ <BufferSecurityCheck>false</BufferSecurityCheck>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>
+ <PrecompiledHeaderOutputFile>.\Release/swrast_dri.pch</PrecompiledHeaderOutputFile>
+ <WarningLevel>Level3</WarningLevel>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <CompileAs>Default</CompileAs>
+ </ClCompile>
+ <ResourceCompile>
+ <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <Culture>0x0409</Culture>
+ </ResourceCompile>
+ <Link>
+ <AdditionalOptions>/MACHINE:I386 %(AdditionalOptions)</AdditionalOptions>
+ <AdditionalDependencies>gdi32.lib;user32.lib;vcxsrv.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)swrast_dri.dll</OutputFile>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <AdditionalLibraryDirectories>$(TargetDir);..\..\..\..\..\xorg-server\obj\servrelease;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+ <ProgramDatabaseFile>$(TargetDir)swrast_dri.pdb</ProgramDatabaseFile>
+ <LinkTimeCodeGeneration>UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>
+ </DataExecutionPrevention>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\..\src\mesa\drivers\common\driverfuncs.c" />
+ <ClCompile Include="..\..\..\..\src\mesa\drivers\common\meta.c" />
+ <ClCompile Include="..\..\..\..\src\mesa\drivers\dri\common\drisw_util.c" />
+ <ClCompile Include="..\..\..\..\src\mesa\drivers\dri\swrast\swrast.c" />
+ <ClCompile Include="..\..\..\..\src\mesa\drivers\dri\swrast\swrast_span.c" />
+ <ClCompile Include="..\..\..\..\src\mesa\drivers\dri\common\utils.c" />
+ <ClCompile Include="..\..\..\..\src\mesa\swrast\s_aaline.c" />
+ <ClCompile Include="..\..\..\..\src\mesa\swrast\s_aatriangle.c" />
+ <ClCompile Include="..\..\..\..\src\mesa\swrast\s_accum.c" />
+ <ClCompile Include="..\..\..\..\src\mesa\swrast\s_alpha.c" />
+ <ClCompile Include="..\..\..\..\src\mesa\swrast\s_atifragshader.c" />
+ <ClCompile Include="..\..\..\..\src\mesa\swrast\s_bitmap.c" />
+ <ClCompile Include="..\..\..\..\src\mesa\swrast\s_blend.c" />
+ <ClCompile Include="..\..\..\..\src\mesa\swrast\s_blit.c" />
+ <ClCompile Include="..\..\..\..\src\mesa\swrast\s_clear.c" />
+ <ClCompile Include="..\..\..\..\src\mesa\swrast\s_context.c" />
+ <ClCompile Include="..\..\..\..\src\mesa\swrast\s_copypix.c" />
+ <ClCompile Include="..\..\..\..\src\mesa\swrast\s_depth.c" />
+ <ClCompile Include="..\..\..\..\src\mesa\swrast\s_drawpix.c" />
+ <ClCompile Include="..\..\..\..\src\mesa\swrast\s_feedback.c" />
+ <ClCompile Include="..\..\..\..\src\mesa\swrast\s_fog.c" />
+ <ClCompile Include="..\..\..\..\src\mesa\swrast\s_fragprog.c" />
+ <ClCompile Include="..\..\..\..\src\mesa\swrast\s_lines.c" />
+ <ClCompile Include="..\..\..\..\src\mesa\swrast\s_logic.c" />
+ <ClCompile Include="..\..\..\..\src\mesa\swrast\s_masking.c" />
+ <ClCompile Include="..\..\..\..\src\mesa\swrast\s_points.c" />
+ <ClCompile Include="..\..\..\..\src\mesa\swrast\s_readpix.c" />
+ <ClCompile Include="..\..\..\..\src\mesa\swrast\s_span.c" />
+ <ClCompile Include="..\..\..\..\src\mesa\swrast\s_stencil.c" />
+ <ClCompile Include="..\..\..\..\src\mesa\swrast\s_texcombine.c" />
+ <ClCompile Include="..\..\..\..\src\mesa\swrast\s_texfilter.c" />
+ <ClCompile Include="..\..\..\..\src\mesa\swrast\s_triangle.c" />
+ <ClCompile Include="..\..\..\..\src\mesa\swrast\s_zoom.c" />
+ <ClCompile Include="..\..\..\..\src\mesa\swrast_setup\ss_context.c" />
+ <ClCompile Include="..\..\..\..\src\mesa\swrast_setup\ss_triangle.c" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\..\..\src\mesa\drivers\dri\swrast\swrast_priv.h" />
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\mesa\mesa.vcxproj">
+ <Project>{2120c974-2717-4709-b44f-d6e6d0a56448}</Project>
+ <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
+ </ProjectReference>
+ </ItemGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project> \ No newline at end of file
diff --git a/mesalib/windows/VC8/mesa/swrast_dri/swrast_dri.vcxproj.filters b/mesalib/windows/VC8/mesa/swrast_dri/swrast_dri.vcxproj.filters
new file mode 100644
index 000000000..375cfd711
--- /dev/null
+++ b/mesalib/windows/VC8/mesa/swrast_dri/swrast_dri.vcxproj.filters
@@ -0,0 +1,129 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="Source Files">
+ <UniqueIdentifier>{3f55ce52-2780-4f28-bb1f-06759ea15ba4}</UniqueIdentifier>
+ <Extensions>cpp;c;cxx;rc;def;r;odl;idl;hpj;bat</Extensions>
+ </Filter>
+ <Filter Include="Header Files">
+ <UniqueIdentifier>{b64ef3e4-df7d-40b7-8ecd-4805cbbdc8b8}</UniqueIdentifier>
+ <Extensions>h;hpp;hxx;hm;inl</Extensions>
+ </Filter>
+ <Filter Include="Resource Files">
+ <UniqueIdentifier>{aaf2266b-a56e-474d-926c-d8a91f25992f}</UniqueIdentifier>
+ <Extensions>ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe</Extensions>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\..\src\mesa\drivers\common\driverfuncs.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\drivers\common\meta.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\drivers\dri\swrast\swrast.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\drivers\dri\swrast\swrast_span.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\drivers\dri\common\utils.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\drivers\dri\common\drisw_util.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\swrast_setup\ss_context.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\swrast\s_context.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\swrast\s_lines.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\swrast\s_bitmap.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\swrast\s_accum.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\swrast\s_clear.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\swrast\s_copypix.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\swrast\s_drawpix.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\swrast\s_readpix.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\swrast\s_zoom.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\swrast_setup\ss_triangle.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\swrast\s_masking.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\swrast\s_aaline.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\swrast\s_points.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\swrast\s_feedback.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\swrast\s_triangle.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\swrast\s_depth.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\swrast\s_texfilter.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\swrast\s_aatriangle.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\swrast\s_alpha.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\swrast\s_atifragshader.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\swrast\s_blend.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\swrast\s_blit.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\swrast\s_fog.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\swrast\s_fragprog.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\swrast\s_logic.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\swrast\s_span.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\swrast\s_stencil.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\src\mesa\swrast\s_texcombine.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\..\..\src\mesa\drivers\dri\swrast\swrast_priv.h">
+ <Filter>Source Files</Filter>
+ </ClInclude>
+ </ItemGroup>
+</Project> \ No newline at end of file